From: Cris Di Sclafani Date: Fri, 30 Oct 2020 16:19:25 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.5.4 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:;/%22?a=commitdiff_plain;h=1bdda5102c4a64ca5ef3bbb8d92b4fa693042e5a;p=motion2.git Built motion from commit (unavailable).|2.5.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6ee44d9..4bf721b 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

\n
curl 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-10-30T15:52:00.198Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); +define({ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

\n
curl 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-10-30T16:11:05.968Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index dcfa190..9ea340e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

\n
curl 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-10-30T15:52:00.198Z", "url": "http://apidocjs.com", "version": "0.19.0" } } +{ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

\n
curl 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-10-30T16:11:05.968Z", "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 0f3154b..3eb96f5 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 _0x32c6=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','STRING','motionbar','jscripty'];(function(_0x2e3d56,_0x4fb6ed){var _0x1815c1=function(_0x45a5fd){while(--_0x45a5fd){_0x2e3d56['push'](_0x2e3d56['shift']());}};_0x1815c1(++_0x4fb6ed);}(_0x32c6,0xf2));var _0x632c=function(_0x244f1f,_0x27b839){_0x244f1f=_0x244f1f-0x0;var _0x237b65=_0x32c6[_0x244f1f];return _0x237b65;};'use strict';var Sequelize=require(_0x632c('0x0'));module['exports']={'name':{'type':Sequelize[_0x632c('0x1')],'get':function(_0x5ec66b){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x632c('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x632c('0x3'),_0x632c('0x4'),_0x632c('0x5'),'browser',_0x632c('0x6'),_0x632c('0x7')]],'msg':_0x632c('0x8')}},'comment':_0x632c('0x8')},'data1':{'type':Sequelize[_0x632c('0x2')](0x1000),'comment':_0x632c('0x9')},'data2':{'type':Sequelize[_0x632c('0x2')](0x1000),'comment':_0x632c('0xa')},'data3':{'type':Sequelize[_0x632c('0x2')](0x1000),'comment':_0x632c('0xb')},'data4':{'type':Sequelize[_0x632c('0x2')](0x1000)},'data5':{'type':Sequelize[_0x632c('0x2')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x632c('0xc')]}}; \ No newline at end of file +var _0x285b=['STRING','contactManager','integration','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','TEXT','sequelize','VIRTUAL','getDataValue','action'];(function(_0x593bb8,_0x1a2efa){var _0x1b0ecb=function(_0x3b6e40){while(--_0x3b6e40){_0x593bb8['push'](_0x593bb8['shift']());}};_0x1b0ecb(++_0x1a2efa);}(_0x285b,0x184));var _0xb285=function(_0x18129a,_0x5c4a20){_0x18129a=_0x18129a-0x0;var _0x5ae32b=_0x285b[_0x18129a];return _0x5ae32b;};'use strict';var Sequelize=require(_0xb285('0x0'));module['exports']={'name':{'type':Sequelize[_0xb285('0x1')],'get':function(_0x59df98){return this[_0xb285('0x2')](_0xb285('0x3'));}},'action':{'type':Sequelize[_0xb285('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb285('0x5'),_0xb285('0x6'),_0xb285('0x7'),'jscripty','urlForward',_0xb285('0x8'),_0xb285('0x9'),_0xb285('0xa')]],'msg':_0xb285('0xb')}},'comment':_0xb285('0xb')},'data1':{'type':Sequelize[_0xb285('0x4')](0x1000),'comment':_0xb285('0xc')},'data2':{'type':Sequelize[_0xb285('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xb285('0x4')](0x1000)},'data5':{'type':Sequelize[_0xb285('0x4')](0x1000)},'data6':{'type':Sequelize[_0xb285('0x4')]},'data7':{'type':Sequelize[_0xb285('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index e803da3..7be53f0 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 _0xe8dd=['request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','error','stack','send','body','Action','params','then','catch','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0xe8dd,0x83));var _0xde8d=function(_0x462a51,_0x128123){_0x462a51=_0x462a51-0x0;var _0x350c3b=_0xe8dd[_0x462a51];return _0x350c3b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde8d('0x0'));var rimraf=require(_0xde8d('0x1'));var zipdir=require(_0xde8d('0x2'));var jsonpatch=require(_0xde8d('0x3'));var rp=require(_0xde8d('0x4'));var moment=require(_0xde8d('0x5'));var BPromise=require(_0xde8d('0x6'));var Mustache=require(_0xde8d('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xde8d('0x8'));var ejs=require(_0xde8d('0x9'));var fs=require('fs');var _=require(_0xde8d('0xa'));var squel=require(_0xde8d('0xb'));var crypto=require(_0xde8d('0xc'));var jsforce=require(_0xde8d('0xd'));var deskjs=require(_0xde8d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde8d('0xf'));var Papa=require(_0xde8d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde8d('0x11'));var as=require(_0xde8d('0x12'));var hardwareService=require(_0xde8d('0x13'));var logger=require(_0xde8d('0x14'))(_0xde8d('0x15'));var utils=require(_0xde8d('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c88e,_0x50e72b){_0x50e72b=_0x50e72b||0xcc;return function(_0x305ff3){if(_0x305ff3){return _0x41c88e[_0xde8d('0x17')](_0x50e72b);}return _0x41c88e[_0xde8d('0x18')](_0x50e72b)[_0xde8d('0x19')]();};}function respondWithResult(_0x2b762b,_0x6d95a2){_0x6d95a2=_0x6d95a2||0xc8;return function(_0x49f3e5){if(_0x49f3e5){return _0x2b762b[_0xde8d('0x18')](_0x6d95a2)[_0xde8d('0x1a')](_0x49f3e5);}};}function respondWithFilteredResult(_0x570ecc,_0x21bce6){return function(_0x3ab2de){if(_0x3ab2de){var _0x2cc2d2=_0x3ab2de[_0xde8d('0x1b')],_0x1df4ea=_0x21bce6[_0xde8d('0x1c')],_0x3809b3=_0x21bce6[_0xde8d('0x1c')]+_0x21bce6[_0xde8d('0x1d')],_0xa59cc9;if(_0x3809b3>=_0x2cc2d2){_0x3809b3=_0x2cc2d2;_0xa59cc9=0xc8;}else{_0xa59cc9=0xce;}_0x570ecc[_0xde8d('0x18')](_0xa59cc9);return _0x570ecc[_0xde8d('0x1e')](_0xde8d('0x1f'),_0x1df4ea+'-'+_0x3809b3+'/'+_0x2cc2d2)['json'](_0x3ab2de);}return null;};}function patchUpdates(_0x50cbcd){return function(_0x136038){try{jsonpatch['apply'](_0x136038,_0x50cbcd,!![]);}catch(_0x1810b3){return BPromise[_0xde8d('0x20')](_0x1810b3);}return _0x136038[_0xde8d('0x21')]();};}function saveUpdates(_0x1c62b6,_0x18e387){return function(_0x2475b1){if(_0x2475b1){return _0x2475b1[_0xde8d('0x22')](_0x1c62b6)['then'](function(_0x116948){return _0x116948;});}return null;};}function removeEntity(_0x114bcb,_0x3788bd){return function(_0x3e4e16){if(_0x3e4e16){return _0x3e4e16[_0xde8d('0x23')]()['then'](function(){_0x114bcb[_0xde8d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39596d,_0xc367b7){return function(_0x234f01){if(!_0x234f01){_0x39596d[_0xde8d('0x17')](0x194);}return _0x234f01;};}function handleError(_0x534f21,_0x5c4350){_0x5c4350=_0x5c4350||0x1f4;return function(_0x361642){logger[_0xde8d('0x24')](_0x361642[_0xde8d('0x25')]);if(_0x361642['name']){delete _0x361642['name'];}_0x534f21[_0xde8d('0x18')](_0x5c4350)[_0xde8d('0x26')](_0x361642);};}exports[_0xde8d('0x22')]=function(_0x37a389,_0x5d65cf){if(_0x37a389[_0xde8d('0x27')]['id']){delete _0x37a389[_0xde8d('0x27')]['id'];}return db[_0xde8d('0x28')]['find']({'where':{'id':_0x37a389[_0xde8d('0x29')]['id']}})[_0xde8d('0x2a')](handleEntityNotFound(_0x5d65cf,null))[_0xde8d('0x2a')](saveUpdates(_0x37a389['body'],null))[_0xde8d('0x2a')](respondWithResult(_0x5d65cf,null))[_0xde8d('0x2b')](handleError(_0x5d65cf,null));};exports[_0xde8d('0x23')]=function(_0x42d45a,_0x708ed2){return db[_0xde8d('0x28')][_0xde8d('0x2c')]({'where':{'id':_0x42d45a[_0xde8d('0x29')]['id']}})[_0xde8d('0x2a')](handleEntityNotFound(_0x708ed2,null))['then'](removeEntity(_0x708ed2,null))[_0xde8d('0x2b')](handleError(_0x708ed2,null));}; \ No newline at end of file +var _0xf653=['apply','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','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','Content-Range'];(function(_0x433451,_0x125dc6){var _0x57be5d=function(_0x3acda3){while(--_0x3acda3){_0x433451['push'](_0x433451['shift']());}};_0x57be5d(++_0x125dc6);}(_0xf653,0x176));var _0x3f65=function(_0x11585e,_0xf27910){_0x11585e=_0x11585e-0x0;var _0x4fe508=_0xf653[_0x11585e];return _0x4fe508;};'use strict';var pdf=require(_0x3f65('0x0'));var emlformat=require(_0x3f65('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3f65('0x2'));var jsonpatch=require(_0x3f65('0x3'));var rp=require(_0x3f65('0x4'));var moment=require(_0x3f65('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3f65('0x6'));var util=require('util');var path=require(_0x3f65('0x7'));var sox=require(_0x3f65('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3f65('0x9'));var squel=require(_0x3f65('0xa'));var crypto=require(_0x3f65('0xb'));var jsforce=require(_0x3f65('0xc'));var deskjs=require(_0x3f65('0xd'));var toCsv=require(_0x3f65('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f65('0xf'));var authService=require(_0x3f65('0x10'));var qs=require(_0x3f65('0x11'));var as=require(_0x3f65('0x12'));var hardwareService=require(_0x3f65('0x13'));var logger=require(_0x3f65('0x14'))(_0x3f65('0x15'));var utils=require('../../config/utils');var config=require(_0x3f65('0x16'));var db=require(_0x3f65('0x17'))['db'];function respondWithStatusCode(_0x596504,_0x1b974c){_0x1b974c=_0x1b974c||0xcc;return function(_0x4fbd6e){if(_0x4fbd6e){return _0x596504[_0x3f65('0x18')](_0x1b974c);}return _0x596504[_0x3f65('0x19')](_0x1b974c)[_0x3f65('0x1a')]();};}function respondWithResult(_0x1a9bc5,_0x2dc0b9){_0x2dc0b9=_0x2dc0b9||0xc8;return function(_0x1e4132){if(_0x1e4132){return _0x1a9bc5[_0x3f65('0x19')](_0x2dc0b9)[_0x3f65('0x1b')](_0x1e4132);}};}function respondWithFilteredResult(_0x3392ec,_0x4e7daf){return function(_0x24d89e){if(_0x24d89e){var _0x72f178=_0x24d89e['count'],_0x56b867=_0x4e7daf[_0x3f65('0x1c')],_0x439edf=_0x4e7daf['offset']+_0x4e7daf[_0x3f65('0x1d')],_0x3a0c66;if(_0x439edf>=_0x72f178){_0x439edf=_0x72f178;_0x3a0c66=0xc8;}else{_0x3a0c66=0xce;}_0x3392ec[_0x3f65('0x19')](_0x3a0c66);return _0x3392ec['set'](_0x3f65('0x1e'),_0x56b867+'-'+_0x439edf+'/'+_0x72f178)[_0x3f65('0x1b')](_0x24d89e);}return null;};}function patchUpdates(_0x50a1ff){return function(_0x5cc3af){try{jsonpatch[_0x3f65('0x1f')](_0x5cc3af,_0x50a1ff,!![]);}catch(_0x6652a2){return BPromise['reject'](_0x6652a2);}return _0x5cc3af[_0x3f65('0x20')]();};}function saveUpdates(_0x3b8ecc,_0x1d876e){return function(_0xe21e22){if(_0xe21e22){return _0xe21e22[_0x3f65('0x21')](_0x3b8ecc)[_0x3f65('0x22')](function(_0xd4ba66){return _0xd4ba66;});}return null;};}function removeEntity(_0x541954,_0x13b64f){return function(_0x558c55){if(_0x558c55){return _0x558c55[_0x3f65('0x23')]()[_0x3f65('0x22')](function(){_0x541954[_0x3f65('0x19')](0xcc)[_0x3f65('0x1a')]();});}};}function handleEntityNotFound(_0x3a03e8,_0x1c7949){return function(_0x378a00){if(!_0x378a00){_0x3a03e8[_0x3f65('0x18')](0x194);}return _0x378a00;};}function handleError(_0x56e5ad,_0x2dd92b){_0x2dd92b=_0x2dd92b||0x1f4;return function(_0x103bdf){logger[_0x3f65('0x24')](_0x103bdf[_0x3f65('0x25')]);if(_0x103bdf['name']){delete _0x103bdf[_0x3f65('0x26')];}_0x56e5ad[_0x3f65('0x19')](_0x2dd92b)[_0x3f65('0x27')](_0x103bdf);};}exports['update']=function(_0x369d26,_0x407979){if(_0x369d26[_0x3f65('0x28')]['id']){delete _0x369d26['body']['id'];}return db[_0x3f65('0x29')][_0x3f65('0x2a')]({'where':{'id':_0x369d26[_0x3f65('0x2b')]['id']}})[_0x3f65('0x22')](handleEntityNotFound(_0x407979,null))[_0x3f65('0x22')](saveUpdates(_0x369d26[_0x3f65('0x28')],null))[_0x3f65('0x22')](respondWithResult(_0x407979,null))[_0x3f65('0x2c')](handleError(_0x407979,null));};exports[_0x3f65('0x23')]=function(_0x417728,_0x388fa4){return db[_0x3f65('0x29')][_0x3f65('0x2a')]({'where':{'id':_0x417728[_0x3f65('0x2b')]['id']}})[_0x3f65('0x22')](handleEntityNotFound(_0x388fa4,null))[_0x3f65('0x22')](removeEntity(_0x388fa4,null))[_0x3f65('0x2c')](handleError(_0x388fa4,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9a91bb0..7710eb3 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 _0x01ef=['./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0x01ef,0x131));var _0xf01e=function(_0x15f4ad,_0xabccd2){_0x15f4ad=_0x15f4ad-0x0;var _0x21d9d0=_0x01ef[_0x15f4ad];return _0x21d9d0;};'use strict';var _=require(_0xf01e('0x0'));var util=require('util');var logger=require(_0xf01e('0x1'))(_0xf01e('0x2'));var moment=require(_0xf01e('0x3'));var BPromise=require(_0xf01e('0x4'));var rp=require(_0xf01e('0x5'));var fs=require('fs');var path=require(_0xf01e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf01e('0x7'));module[_0xf01e('0x8')]=function(_0x18016f,_0x197aef){return _0x18016f[_0xf01e('0x9')](_0xf01e('0xa'),attributes,{'tableName':_0xf01e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5fa=['exports','define','Action','tools_actions','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x1bd727,_0x1ce3ab){var _0x1658ba=function(_0x1a18cf){while(--_0x1a18cf){_0x1bd727['push'](_0x1bd727['shift']());}};_0x1658ba(++_0x1ce3ab);}(_0xe5fa,0x130));var _0xae5f=function(_0x577768,_0x23ba31){_0x577768=_0x577768-0x0;var _0xb9444d=_0xe5fa[_0x577768];return _0xb9444d;};'use strict';var _=require(_0xae5f('0x0'));var util=require(_0xae5f('0x1'));var logger=require(_0xae5f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xae5f('0x3'));var rp=require(_0xae5f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae5f('0x5'));var config=require(_0xae5f('0x6'));var attributes=require(_0xae5f('0x7'));module[_0xae5f('0x8')]=function(_0x1df4ce,_0x61c0d){return _0x1df4ce[_0xae5f('0x9')](_0xae5f('0xa'),attributes,{'tableName':_0xae5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 09bd259..dd53512 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 _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0x70e0=['code','Action,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xff22a,_0x5e704f){var _0x13f45f=function(_0x6ec3f){while(--_0x6ec3f){_0xff22a['push'](_0xff22a['shift']());}};_0x13f45f(++_0x5e704f);}(_0x70e0,0x17b));var _0x070e=function(_0xfab20b,_0x2676ed){_0xfab20b=_0xfab20b-0x0;var _0x334e7c=_0x70e0[_0xfab20b];return _0x334e7c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Action,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Action,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d00cd4e..8f4f7dd 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 _0xf9ab=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','/:id'];(function(_0x3258e3,_0x1e84f8){var _0x2e8fbd=function(_0x2789f6){while(--_0x2789f6){_0x3258e3['push'](_0x3258e3['shift']());}};_0x2e8fbd(++_0x1e84f8);}(_0xf9ab,0xf8));var _0xbf9a=function(_0x2488bd,_0x4df529){_0x2488bd=_0x2488bd-0x0;var _0x4feebb=_0xf9ab[_0x2488bd];return _0x4feebb;};'use strict';var multer=require(_0xbf9a('0x0'));var util=require(_0xbf9a('0x1'));var path=require(_0xbf9a('0x2'));var timeout=require(_0xbf9a('0x3'));var express=require('express');var router=express[_0xbf9a('0x4')]();var auth=require(_0xbf9a('0x5'));var interaction=require(_0xbf9a('0x6'));var config=require(_0xbf9a('0x7'));var controller=require(_0xbf9a('0x8'));router[_0xbf9a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbf9a('0xa')]);router['delete'](_0xbf9a('0xb'),auth['isAuthenticated'](),controller[_0xbf9a('0xc')]);module['exports']=router; \ No newline at end of file +var _0xd4be=['update','delete','isAuthenticated','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x5a0252,_0x34e35d){var _0x30887=function(_0x4451b9){while(--_0x4451b9){_0x5a0252['push'](_0x5a0252['shift']());}};_0x30887(++_0x34e35d);}(_0xd4be,0x189));var _0xed4b=function(_0x3e6920,_0x5a1352){_0x3e6920=_0x3e6920-0x0;var _0x3bbd9f=_0xd4be[_0x3e6920];return _0x3bbd9f;};'use strict';var multer=require(_0xed4b('0x0'));var util=require('util');var path=require(_0xed4b('0x1'));var timeout=require(_0xed4b('0x2'));var express=require('express');var router=express[_0xed4b('0x3')]();var auth=require(_0xed4b('0x4'));var interaction=require(_0xed4b('0x5'));var config=require(_0xed4b('0x6'));var controller=require(_0xed4b('0x7'));router[_0xed4b('0x8')](_0xed4b('0x9'),auth['isAuthenticated'](),controller[_0xed4b('0xa')]);router[_0xed4b('0xb')](_0xed4b('0x9'),auth[_0xed4b('0xc')](),controller['destroy']);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 5808e20..0695733 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 _0x4398=['TEXT','sequelize','exports','STRING'];(function(_0x319412,_0x3e5995){var _0x2d78b3=function(_0x295ed6){while(--_0x295ed6){_0x319412['push'](_0x319412['shift']());}};_0x2d78b3(++_0x3e5995);}(_0x4398,0x1e5));var _0x8439=function(_0x555d83,_0x54f804){_0x555d83=_0x555d83-0x0;var _0x386ff3=_0x4398[_0x555d83];return _0x386ff3;};'use strict';var Sequelize=require(_0x8439('0x0'));module[_0x8439('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8439('0x2')]},'parent':{'type':Sequelize[_0x8439('0x2')]},'table':{'type':Sequelize[_0x8439('0x2')]},'conditions':{'type':Sequelize[_0x8439('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf478=['exports','TEXT','sequelize'];(function(_0x50cd58,_0x2ea444){var _0x27c4a8=function(_0x1522bb){while(--_0x1522bb){_0x50cd58['push'](_0x50cd58['shift']());}};_0x27c4a8(++_0x2ea444);}(_0xf478,0xb0));var _0x8f47=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf478[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x8f47('0x0'));module[_0x8f47('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8f47('0x2')]},'joins':{'type':Sequelize[_0x8f47('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 4b5cbfb..8b6af04 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 _0x049e=['metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','HOUR(%s)','UNIX_TIMESTAMP(%s)','AnalyticMetric','alias','debug','No\x20available\x20data','output','fullPath','randomstring','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','COUNT(*)','count','QueryTypes','runReport','SUM(%s)','MIN(%s)','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','dbH','sendStatus','end','json','offset','status','reject','save','update','then','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','user','role','get','Reports','UserProfileSection','userProfileId','CustomReports','preview','join','left_join','right_join','cross_join','COUNT(%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)','ROUND(%s)','includes','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','keyBy','select','from','table','MetricId'];(function(_0xd1d73e,_0x5ea73a){var _0x4eb7fe=function(_0x4a214a){while(--_0x4a214a){_0xd1d73e['push'](_0xd1d73e['shift']());}};_0x4eb7fe(++_0x5ea73a);}(_0x049e,0x16a));var _0xe049=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x049e[_0x4b8156];return _0x4a819c;};'use strict';var pdf=require(_0xe049('0x0'));var emlformat=require(_0xe049('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe049('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe049('0x3'));var moment=require(_0xe049('0x4'));var BPromise=require(_0xe049('0x5'));var Mustache=require(_0xe049('0x6'));var util=require(_0xe049('0x7'));var path=require('path');var sox=require(_0xe049('0x8'));var csv=require(_0xe049('0x9'));var ejs=require(_0xe049('0xa'));var fs=require('fs');var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x9'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var db=require(_0xe049('0x15'))['db'];var dbH=require(_0xe049('0x15'))[_0xe049('0x16')];function respondWithStatusCode(_0x301c7e,_0x1021e7){_0x1021e7=_0x1021e7||0xcc;return function(_0xdd1814){if(_0xdd1814){return _0x301c7e[_0xe049('0x17')](_0x1021e7);}return _0x301c7e['status'](_0x1021e7)[_0xe049('0x18')]();};}function respondWithResult(_0x3f4a57,_0x3924a4){_0x3924a4=_0x3924a4||0xc8;return function(_0x35fd0d){if(_0x35fd0d){return _0x3f4a57['status'](_0x3924a4)[_0xe049('0x19')](_0x35fd0d);}};}function respondWithFilteredResult(_0xcc35b6,_0x5c90fd){return function(_0x388be0){if(_0x388be0){var _0x26b40c=_0x388be0['count'],_0x526d25=_0x5c90fd[_0xe049('0x1a')],_0x8b9bfe=_0x5c90fd['offset']+_0x5c90fd['limit'],_0x5291a9;if(_0x8b9bfe>=_0x26b40c){_0x8b9bfe=_0x26b40c;_0x5291a9=0xc8;}else{_0x5291a9=0xce;}_0xcc35b6[_0xe049('0x1b')](_0x5291a9);return _0xcc35b6['set']('Content-Range',_0x526d25+'-'+_0x8b9bfe+'/'+_0x26b40c)[_0xe049('0x19')](_0x388be0);}return null;};}function patchUpdates(_0x1092ec){return function(_0x5ae414){try{jsonpatch['apply'](_0x5ae414,_0x1092ec,!![]);}catch(_0x22af56){return BPromise[_0xe049('0x1c')](_0x22af56);}return _0x5ae414[_0xe049('0x1d')]();};}function saveUpdates(_0x430421,_0x517aea){return function(_0x572f29){if(_0x572f29){return _0x572f29[_0xe049('0x1e')](_0x430421)[_0xe049('0x1f')](function(_0x572a80){return _0x572a80;});}return null;};}function removeEntity(_0x36a03b,_0x3f14eb){return function(_0x10cb90){if(_0x10cb90){return _0x10cb90['destroy']()[_0xe049('0x1f')](function(){var _0x3b0f54=_0x10cb90['get']({'plain':!![]});var _0x4848c9='CustomReports';return db[_0xe049('0x20')]['destroy']({'where':{'type':_0x4848c9,'resourceId':_0x3b0f54['id']}})['then'](function(){return _0x10cb90;});})[_0xe049('0x1f')](function(){_0x36a03b[_0xe049('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5233,_0x181432){return function(_0x3e5c7f){if(!_0x3e5c7f){_0x1f5233[_0xe049('0x17')](0x194);}return _0x3e5c7f;};}function handleError(_0x293dd2,_0x1843b8){_0x1843b8=_0x1843b8||0x1f4;return function(_0x5b0e64){logger['error'](_0x5b0e64[_0xe049('0x21')]);if(_0x5b0e64['name']){delete _0x5b0e64[_0xe049('0x22')];}_0x293dd2['status'](_0x1843b8)[_0xe049('0x23')](_0x5b0e64);};}exports[_0xe049('0x24')]=function(_0x5adcd6,_0x432a6e){var _0x364630={},_0xb64700={},_0x33353d={'count':0x0,'rows':[]};var _0x4464b2=_[_0xe049('0x25')](db[_0xe049('0x26')][_0xe049('0x27')],function(_0x4038f0){return{'name':_0x4038f0[_0xe049('0x28')],'type':_0x4038f0[_0xe049('0x29')]['key']};});_0xb64700[_0xe049('0x2a')]=_[_0xe049('0x25')](_0x4464b2,'name');_0xb64700['query']=_['keys'](_0x5adcd6['query']);_0xb64700[_0xe049('0x2b')]=_[_0xe049('0x2c')](_0xb64700[_0xe049('0x2a')],_0xb64700[_0xe049('0x2d')]);_0x364630[_0xe049('0x2e')]=_['intersection'](_0xb64700[_0xe049('0x2a')],qs[_0xe049('0x2f')](_0x5adcd6[_0xe049('0x2d')][_0xe049('0x2f')]));_0x364630[_0xe049('0x2e')]=_0x364630['attributes'][_0xe049('0x30')]?_0x364630['attributes']:_0xb64700[_0xe049('0x2a')];if(!_0x5adcd6['query'][_0xe049('0x31')](_0xe049('0x32'))){_0x364630[_0xe049('0x33')]=qs[_0xe049('0x33')](_0x5adcd6[_0xe049('0x2d')][_0xe049('0x33')]);_0x364630[_0xe049('0x1a')]=qs[_0xe049('0x1a')](_0x5adcd6[_0xe049('0x2d')][_0xe049('0x1a')]);}_0x364630[_0xe049('0x34')]=qs['sort'](_0x5adcd6[_0xe049('0x2d')][_0xe049('0x35')]);_0x364630[_0xe049('0x36')]=qs[_0xe049('0x2b')](_[_0xe049('0x37')](_0x5adcd6[_0xe049('0x2d')],_0xb64700[_0xe049('0x2b')]),_0x4464b2);if(_0x5adcd6[_0xe049('0x2d')]['filter']){_0x364630[_0xe049('0x36')]=_[_0xe049('0x38')](_0x364630[_0xe049('0x36')],{'$or':_[_0xe049('0x25')](_0x4464b2,function(_0x5e9613){if(_0x5e9613[_0xe049('0x29')]!==_0xe049('0x39')){var _0x3963e6={};_0x3963e6[_0x5e9613[_0xe049('0x22')]]={'$like':'%'+_0x5adcd6[_0xe049('0x2d')]['filter']+'%'};return _0x3963e6;}})});}_0x364630=_[_0xe049('0x38')]({},_0x364630,_0x5adcd6[_0xe049('0x3a')]);var _0x21f6e6={'where':_0x364630['where']};return db[_0xe049('0x26')]['count'](_0x21f6e6)['then'](function(_0x19dbc4){_0x33353d['count']=_0x19dbc4;if(_0x5adcd6[_0xe049('0x2d')][_0xe049('0x3b')]){_0x364630[_0xe049('0x3c')]=[{'all':!![]}];}return db[_0xe049('0x26')][_0xe049('0x3d')](_0x364630);})['then'](function(_0x4261da){_0x33353d[_0xe049('0x3e')]=_0x4261da;return _0x33353d;})['then'](respondWithFilteredResult(_0x432a6e,_0x364630))['catch'](handleError(_0x432a6e,null));};exports[_0xe049('0x3f')]=function(_0x20d264,_0x482072){var _0x215eea={'raw':![],'where':{'id':_0x20d264[_0xe049('0x40')]['id']}},_0x82e245={};_0x82e245['model']=_[_0xe049('0x41')](db[_0xe049('0x26')]['rawAttributes']);_0x82e245[_0xe049('0x2d')]=_[_0xe049('0x41')](_0x20d264[_0xe049('0x2d')]);_0x82e245[_0xe049('0x2b')]=_[_0xe049('0x2c')](_0x82e245['model'],_0x82e245['query']);_0x215eea[_0xe049('0x2e')]=_[_0xe049('0x2c')](_0x82e245[_0xe049('0x2a')],qs[_0xe049('0x2f')](_0x20d264[_0xe049('0x2d')][_0xe049('0x2f')]));_0x215eea['attributes']=_0x215eea[_0xe049('0x2e')][_0xe049('0x30')]?_0x215eea['attributes']:_0x82e245[_0xe049('0x2a')];if(_0x20d264['query'][_0xe049('0x3b')]){_0x215eea['include']=[{'all':!![]}];}_0x215eea=_[_0xe049('0x38')]({},_0x215eea,_0x20d264['options']);return db[_0xe049('0x26')][_0xe049('0x42')](_0x215eea)[_0xe049('0x1f')](handleEntityNotFound(_0x482072,null))[_0xe049('0x1f')](respondWithResult(_0x482072,null))[_0xe049('0x43')](handleError(_0x482072,null));};exports['create']=function(_0x210a1c,_0x2310ff){return db[_0xe049('0x26')][_0xe049('0x44')](_0x210a1c[_0xe049('0x45')],{})[_0xe049('0x1f')](function(_0x12f9b8){var _0x1b94b5=_0x210a1c[_0xe049('0x46')]['get']({'plain':!![]});if(!_0x1b94b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b94b5[_0xe049('0x47')]===_0xe049('0x46')){var _0x32ff60=_0x12f9b8[_0xe049('0x48')]({'plain':!![]});var _0x254dc6=_0xe049('0x49');return db[_0xe049('0x4a')][_0xe049('0x42')]({'where':{'name':_0x254dc6,'userProfileId':_0x1b94b5[_0xe049('0x4b')]},'raw':!![]})[_0xe049('0x1f')](function(_0x451883){if(_0x451883&&_0x451883['autoAssociation']===0x0){return db[_0xe049('0x20')][_0xe049('0x44')]({'name':_0x32ff60[_0xe049('0x22')],'resourceId':_0x32ff60['id'],'type':_0xe049('0x4c'),'sectionId':_0x451883['id']},{})[_0xe049('0x1f')](function(){return _0x12f9b8;});}else{return _0x12f9b8;}})[_0xe049('0x43')](function(_0x373a49){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x373a49);throw _0x373a49;});}return _0x12f9b8;})['then'](respondWithResult(_0x2310ff,0xc9))[_0xe049('0x43')](handleError(_0x2310ff,null));};exports[_0xe049('0x1e')]=function(_0x47f0c5,_0x2e361b){if(_0x47f0c5[_0xe049('0x45')]['id']){delete _0x47f0c5[_0xe049('0x45')]['id'];}return db[_0xe049('0x26')]['find']({'where':{'id':_0x47f0c5['params']['id']}})[_0xe049('0x1f')](handleEntityNotFound(_0x2e361b,null))[_0xe049('0x1f')](saveUpdates(_0x47f0c5['body'],null))['then'](respondWithResult(_0x2e361b,null))[_0xe049('0x43')](handleError(_0x2e361b,null));};exports['destroy']=function(_0x3ef1fa,_0x2a1e06){return db['AnalyticCustomReport'][_0xe049('0x42')]({'where':{'id':_0x3ef1fa['params']['id']}})[_0xe049('0x1f')](handleEntityNotFound(_0x2a1e06,null))[_0xe049('0x1f')](removeEntity(_0x2a1e06,null))['catch'](handleError(_0x2a1e06,null));};exports[_0xe049('0x4d')]=function(_0x3508f8,_0x21c0dc){var _0x439be7=0xa;var _0x421d54=[_0xe049('0x4e'),_0xe049('0x4f'),_0xe049('0x50'),_0xe049('0x51')];var _0x35f367={'SUM':'SUM(%s)','COUNT':_0xe049('0x52'),'COUNT DISTINCT':_0xe049('0x53'),'MAX':_0xe049('0x54'),'MIN':'MIN(%s)','AVG':_0xe049('0x55'),'GROUP_CONCAT':_0xe049('0x56'),'GROUP_CONCAT ASC':_0xe049('0x57'),'GROUP_CONCAT DESC':_0xe049('0x58')};var _0x1840b6={'SEC_TO_TIME':_0xe049('0x59'),'DATE':_0xe049('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0xe049('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x440b63=function(_0x51f90a){return!_[_0xe049('0x5c')]([_0xe049('0x5d'),_0xe049('0x5e'),_0xe049('0x5f'),_0xe049('0x60')],_0x51f90a);};var _0x4af8a3=function(_0x329a6d){if(!_0x329a6d||!_0x329a6d[_0xe049('0x61')][_0xe049('0x30')]){return'';}for(var _0xad43b0='(',_0x190bd4=0x0;_0x190bd4<_0x329a6d[_0xe049('0x61')][_0xe049('0x30')];_0x190bd4+=0x1){_0x190bd4>0x0&&(_0xad43b0+='\x20'+_0x329a6d[_0xe049('0x62')]+'\x20');_0xad43b0+=_0x329a6d['rules'][_0x190bd4]['group']?_0x4af8a3(_0x329a6d[_0xe049('0x61')][_0x190bd4][_0xe049('0x63')]):_0x329a6d['rules'][_0x190bd4][_0xe049('0x64')]+'\x20'+_0x329a6d[_0xe049('0x61')][_0x190bd4][_0xe049('0x65')]+(_0x440b63(_0x329a6d[_0xe049('0x61')][_0x190bd4]['condition'])?'\x20'+_0x329a6d['rules'][_0x190bd4][_0xe049('0x66')]:'');}return _0xad43b0+')';};var _0x57290e={'where':{'id':_0x3508f8[_0xe049('0x40')]['id']}},_0x4386c5,_0x3cfaf6,_0x3c61f8,_0x1a109a,_0x1ffabc;_0x57290e=_[_0xe049('0x38')]({},_0x57290e,_0x3508f8[_0xe049('0x3a')]);return db['AnalyticCustomReport'][_0xe049('0x42')](_0x57290e)[_0xe049('0x1f')](function(_0x334522){if(_0x334522){_0x4386c5=_0x334522;return _0x334522[_0xe049('0x67')]();}return null;})[_0xe049('0x1f')](function(_0x5496c9){if(_0x5496c9){if(!_0x5496c9[_0xe049('0x30')]){throw new db[(_0xe049('0x68'))][(_0xe049('0x69'))](_0xe049('0x6a'),0x193);}_0x3cfaf6=_0x5496c9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe049('0x1f')](function(_0xde9419){if(_0xde9419){_0x3c61f8=_[_0xe049('0x6b')](_0xde9419,'id');var _0x51678c;var _0x35f98f=squel[_0xe049('0x6c')]();_0x35f98f[_0xe049('0x6d')](_0x4386c5[_0xe049('0x6e')]);for(var _0x3227d3=0x0;_0x3227d3<_0x3cfaf6[_0xe049('0x30')];_0x3227d3+=0x1){_0x51678c=_0x3cfaf6[_0x3227d3][_0xe049('0x6f')]?_0x3c61f8[_0x3cfaf6[_0x3227d3][_0xe049('0x6f')]][_0xe049('0x70')]:_0x3cfaf6[_0x3227d3][_0xe049('0x64')];_0x51678c=_0x3cfaf6[_0x3227d3][_0xe049('0x71')]?_[_0xe049('0x72')](_0x35f367[_0x3cfaf6[_0x3227d3]['function']],'%s',_0x51678c):_0x51678c;_0x51678c=_0x3cfaf6[_0x3227d3]['format']?_[_0xe049('0x72')](_0x1840b6[_0x3cfaf6[_0x3227d3][_0xe049('0x73')]],'%s',_0x51678c):_0x51678c;if(_0x3cfaf6[_0x3227d3][_0xe049('0x74')]){_0x35f98f['group'](_0x51678c);}_0x3cfaf6[_0x3227d3][_0xe049('0x75')]&&_0x35f98f[_0xe049('0x34')](_0x51678c,_0x3cfaf6[_0x3227d3]['orderBy']===_0xe049('0x76')?![]:!![]);_0x35f98f[_0xe049('0x64')](_0x51678c,_0x3cfaf6[_0x3227d3]['alias']||_0x51678c);}if(_0x4386c5[_0xe049('0x77')]){_0x4386c5[_0xe049('0x77')]=JSON[_0xe049('0x78')](_0x4386c5[_0xe049('0x77')]);for(var _0xf95e5c=0x0;_0xf95e5c<_0x4386c5[_0xe049('0x77')][_0xe049('0x30')];_0xf95e5c+=0x1){if(_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x29')]&&_[_0xe049('0x5c')](_0x421d54,_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x29')])&&_0x4386c5[_0xe049('0x77')][_0xf95e5c]['parentKey']&&_0x4386c5[_0xe049('0x77')][_0xf95e5c]['foreignTable']&&_0x4386c5['joins'][_0xf95e5c][_0xe049('0x79')]){_0x35f98f[_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x29')]](_0x4386c5['joins'][_0xf95e5c][_0xe049('0x7a')],null,util['format'](_0xe049('0x7b'),_0x4386c5['table'],_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x7c')],_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x7a')],_0x4386c5[_0xe049('0x77')][_0xf95e5c][_0xe049('0x79')]));}}}if(_0x4386c5[_0xe049('0x7d')]){_0x4386c5[_0xe049('0x7d')]=JSON['parse'](_0x4386c5['conditions']);_0x35f98f[_0xe049('0x36')](_0x4af8a3(_0x4386c5[_0xe049('0x7d')][_0xe049('0x63')]));}_0x1ffabc=_0x35f98f[_0xe049('0x7e')]();_0x35f98f[_0xe049('0x33')](_0x439be7);_0x35f98f[_0xe049('0x1a')](0x0);logger['debug'](_0xe049('0x7f'),_0x35f98f['toString']());return db['sequelize'][_0xe049('0x2d')](_0x35f98f[_0xe049('0x80')](),{'type':db[_0xe049('0x81')]['QueryTypes'][_0xe049('0x82')]});}})['then'](respondWithResult(_0x21c0dc,null))['catch'](handleError(_0x21c0dc,null));};function runReport(_0x36d52b,_0x7f31d7,_0x3f11a7){var _0x5c2340=_0x7f31d7['name'];var _0x287fc8=0xa;var _0xb12f8e=['join',_0xe049('0x4f'),_0xe049('0x50'),_0xe049('0x51')];var _0x328c13={'SUM':'SUM(%s)','COUNT':_0xe049('0x52'),'COUNT DISTINCT':_0xe049('0x53'),'MAX':_0xe049('0x54'),'MIN':'MIN(%s)','AVG':_0xe049('0x55'),'GROUP_CONCAT':_0xe049('0x56'),'GROUP_CONCAT ASC':_0xe049('0x57'),'GROUP_CONCAT DESC':_0xe049('0x58')};var _0x5dc69b={'SEC_TO_TIME':_0xe049('0x59'),'DATE':_0xe049('0x5a'),'HOUR':_0xe049('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe049('0x84')};var _0x9aa9d0=function(_0x5afbd0){return!_[_0xe049('0x5c')]([_0xe049('0x5d'),'IS\x20NOT\x20NULL',_0xe049('0x5f'),_0xe049('0x60')],_0x5afbd0);};var _0x1950ae=function(_0x37ca72){if(!_0x37ca72||!_0x37ca72[_0xe049('0x61')][_0xe049('0x30')]){return'';}for(var _0x142105='(',_0x5746ff=0x0;_0x5746ff<_0x37ca72['rules']['length'];_0x5746ff+=0x1){_0x5746ff>0x0&&(_0x142105+='\x20'+_0x37ca72[_0xe049('0x62')]+'\x20');_0x142105+=_0x37ca72['rules'][_0x5746ff][_0xe049('0x63')]?_0x1950ae(_0x37ca72[_0xe049('0x61')][_0x5746ff][_0xe049('0x63')]):_0x37ca72[_0xe049('0x61')][_0x5746ff][_0xe049('0x64')]+'\x20'+_0x37ca72[_0xe049('0x61')][_0x5746ff][_0xe049('0x65')]+(_0x9aa9d0(_0x37ca72['rules'][_0x5746ff]['condition'])?'\x20'+_0x37ca72[_0xe049('0x61')][_0x5746ff][_0xe049('0x66')]:'');}return _0x142105+')';};var _0x5c1322={'where':{'id':_0x36d52b['id']}},_0x4c1a59,_0x221836,_0x4e2ebf,_0x51324d,_0x328318;_0x5c1322=_[_0xe049('0x38')]({},_0x5c1322,_0x3f11a7);return db[_0xe049('0x26')][_0xe049('0x42')](_0x5c1322)[_0xe049('0x1f')](function(_0x4475c4){if(_0x4475c4){_0x4c1a59=_0x4475c4;return _0x4475c4['getFields']();}return null;})[_0xe049('0x1f')](function(_0x112dc4){if(_0x112dc4){if(!_0x112dc4[_0xe049('0x30')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe049('0x6a'),0x193);}_0x221836=_0x112dc4;return db[_0xe049('0x85')][_0xe049('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x97af2c){if(_0x97af2c){_0x4e2ebf=_[_0xe049('0x6b')](_0x97af2c,'id');var _0x1e733b;var _0x1b60de=squel[_0xe049('0x6c')]();_0x1b60de[_0xe049('0x6d')](_0x4c1a59[_0xe049('0x6e')]);for(var _0x2090aa=0x0;_0x2090aa<_0x221836['length'];_0x2090aa+=0x1){_0x1e733b=_0x221836[_0x2090aa][_0xe049('0x6f')]?_0x4e2ebf[_0x221836[_0x2090aa][_0xe049('0x6f')]][_0xe049('0x70')]:_0x221836[_0x2090aa][_0xe049('0x64')];_0x1e733b=_0x221836[_0x2090aa][_0xe049('0x71')]?_[_0xe049('0x72')](_0x328c13[_0x221836[_0x2090aa][_0xe049('0x71')]],'%s',_0x1e733b):_0x1e733b;_0x1e733b=_0x221836[_0x2090aa][_0xe049('0x73')]?_[_0xe049('0x72')](_0x5dc69b[_0x221836[_0x2090aa][_0xe049('0x73')]],'%s',_0x1e733b):_0x1e733b;if(_0x221836[_0x2090aa]['groupBy']){_0x1b60de['group'](_0x1e733b);}_0x221836[_0x2090aa]['orderBy']&&_0x1b60de['order'](_0x1e733b,_0x221836[_0x2090aa][_0xe049('0x75')]==='DESC'?![]:!![]);_0x1b60de['field'](_0x1e733b,_0x221836[_0x2090aa][_0xe049('0x86')]||_0x1e733b);}if(_0x4c1a59['joins']){_0x4c1a59['joins']=JSON[_0xe049('0x78')](_0x4c1a59[_0xe049('0x77')]);for(var _0x47d39e=0x0;_0x47d39e<_0x4c1a59[_0xe049('0x77')][_0xe049('0x30')];_0x47d39e+=0x1){if(_0x4c1a59[_0xe049('0x77')][_0x47d39e]['type']&&_[_0xe049('0x5c')](_0xb12f8e,_0x4c1a59[_0xe049('0x77')][_0x47d39e]['type'])&&_0x4c1a59[_0xe049('0x77')][_0x47d39e][_0xe049('0x7c')]&&_0x4c1a59[_0xe049('0x77')][_0x47d39e][_0xe049('0x7a')]&&_0x4c1a59[_0xe049('0x77')][_0x47d39e][_0xe049('0x79')]){_0x1b60de[_0x4c1a59[_0xe049('0x77')][_0x47d39e][_0xe049('0x29')]](_0x4c1a59[_0xe049('0x77')][_0x47d39e][_0xe049('0x7a')],null,util[_0xe049('0x73')](_0xe049('0x7b'),_0x4c1a59[_0xe049('0x6e')],_0x4c1a59[_0xe049('0x77')][_0x47d39e]['parentKey'],_0x4c1a59['joins'][_0x47d39e]['foreignTable'],_0x4c1a59[_0xe049('0x77')][_0x47d39e]['foreignKey']));}}}if(_0x4c1a59[_0xe049('0x7d')]){_0x4c1a59['conditions']=JSON[_0xe049('0x78')](_0x4c1a59[_0xe049('0x7d')]);_0x1b60de['where'](_0x1950ae(_0x4c1a59[_0xe049('0x7d')][_0xe049('0x63')]));}_0x328318=_0x1b60de['clone']();_0x1b60de[_0xe049('0x33')](_0x287fc8);_0x1b60de['offset'](0x0);logger[_0xe049('0x87')](_0xe049('0x7f'),_0x1b60de[_0xe049('0x80')]());return db[_0xe049('0x81')]['query'](_0x1b60de[_0xe049('0x80')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xe049('0x1f')](function(_0x300fe7){if(!_0x300fe7[_0xe049('0x30')]){throw new db[(_0xe049('0x68'))][(_0xe049('0x69'))](_0xe049('0x88'),0xcc);}if(_0x7f31d7[_0xe049('0x89')]==='web'){return null;}var _0xfee72d=_['merge'](_0x7f31d7,{'name':_0x7f31d7[_0xe049('0x8a')]||_0x7f31d7['name']||_0x4c1a59[_0xe049('0x22')],'basename':_0x5c2340,'savename':util[_0xe049('0x73')]('%s-%s.%s',_0x7f31d7[_0xe049('0x22')]||_0x4c1a59[_0xe049('0x22')],require(_0xe049('0x8b'))[_0xe049('0x8c')](0x4),_0x7f31d7[_0xe049('0x89')]||_0xe049('0x8d')),'reportId':_0x4c1a59['id'],'reportType':_0xe049('0x8e')});return db['AnalyticExtractedReport'][_0xe049('0x44')](_0xfee72d,{'raw':!![]});})['then'](function(_0x3008f5){if(_0x4c1a59[_0xe049('0x6e')]==='cdr'){_0x328318[_0xe049('0x36')](_0x4c1a59[_0xe049('0x6e')]+_0xe049('0x8f'),_0x7f31d7[_0xe049('0x90')],_0x7f31d7[_0xe049('0x91')]);}else{_0x328318['where'](_0x4c1a59[_0xe049('0x6e')]+_0xe049('0x92'),_0x7f31d7[_0xe049('0x90')],_0x7f31d7[_0xe049('0x91')]);}if(_0x3008f5){logger[_0xe049('0x93')](_0xe049('0x94'),_0x328318[_0xe049('0x80')]());require(_0xe049('0x95'))[_0xe049('0x96')](path[_0xe049('0x4e')](__dirname,_0xe049('0x97'),_0x3008f5[_0xe049('0x89')]),[_0x3008f5['id'],_0x328318[_0xe049('0x80')](),path[_0xe049('0x4e')](__dirname,'../../files/reports',_0x3008f5['savename']),_0x5c2340]);return _0x3008f5;}else{var _0x185144=squel[_0xe049('0x6c')]();_0x185144[_0xe049('0x6d')]('('+_0x328318['toString']()+')','countTable');_0x185144[_0xe049('0x64')](_0xe049('0x98'),_0xe049('0x99'));_0x328318[_0xe049('0x33')](_0x7f31d7[_0xe049('0x33')]||_0x287fc8);_0x328318[_0xe049('0x1a')](_0x7f31d7[_0xe049('0x1a')]||0x0);return dbH[_0xe049('0x81')][_0xe049('0x2d')](_0x185144['toString'](),{'type':dbH[_0xe049('0x81')][_0xe049('0x9a')][_0xe049('0x82')]})['then'](function(_0x4ffe16){if(!_0x4ffe16['length']){_0x51324d=0x0;}else{_0x51324d=_0x4ffe16[0x0]['count']||0x0;}return dbH[_0xe049('0x81')][_0xe049('0x2d')](_0x328318['toString'](),{'type':dbH[_0xe049('0x81')][_0xe049('0x9a')][_0xe049('0x82')]});})[_0xe049('0x1f')](function(_0x19b8d7){return{'rows':_0x19b8d7||[],'count':_0x51324d};});}});}exports['run']=function(_0x49dbd7,_0x4d8a25){return runReport(_0x49dbd7[_0xe049('0x40')],_0x49dbd7['query'],_0x49dbd7[_0xe049('0x3a')])[_0xe049('0x1f')](respondWithResult(_0x4d8a25,null))[_0xe049('0x43')](handleError(_0x4d8a25,null));};exports[_0xe049('0x9b')]=runReport;exports[_0xe049('0x2d')]=function(_0x369598,_0x224fba){var _0xf8ff=0xa;var _0x1ffb01=[_0xe049('0x4e'),_0xe049('0x4f'),_0xe049('0x50'),_0xe049('0x51')];var _0x2509f5={'SUM':_0xe049('0x9c'),'COUNT':_0xe049('0x52'),'COUNT DISTINCT':_0xe049('0x53'),'MAX':'MAX(%s)','MIN':_0xe049('0x9d'),'AVG':_0xe049('0x55'),'GROUP_CONCAT':_0xe049('0x56'),'GROUP_CONCAT ASC':_0xe049('0x57'),'GROUP_CONCAT DESC':_0xe049('0x58')};var _0x14d545={'SEC_TO_TIME':_0xe049('0x59'),'DATE':_0xe049('0x5a'),'HOUR':_0xe049('0x83'),'ROUND':_0xe049('0x5b'),'UNIX_TIMESTAMP':_0xe049('0x84')};var _0x507bdc=function(_0x4ef9f5){return!_[_0xe049('0x5c')]([_0xe049('0x5d'),'IS\x20NOT\x20NULL',_0xe049('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4ef9f5);};var _0x32ecdd=function(_0x5e4a2a){if(!_0x5e4a2a||!_0x5e4a2a[_0xe049('0x61')]['length']){return'';}for(var _0x391b44='(',_0x55a8fe=0x0;_0x55a8fe<_0x5e4a2a['rules'][_0xe049('0x30')];_0x55a8fe+=0x1){_0x55a8fe>0x0&&(_0x391b44+='\x20'+_0x5e4a2a['operator']+'\x20');_0x391b44+=_0x5e4a2a[_0xe049('0x61')][_0x55a8fe][_0xe049('0x63')]?_0x32ecdd(_0x5e4a2a[_0xe049('0x61')][_0x55a8fe][_0xe049('0x63')]):_0x5e4a2a['rules'][_0x55a8fe][_0xe049('0x64')]+'\x20'+_0x5e4a2a[_0xe049('0x61')][_0x55a8fe][_0xe049('0x65')]+(_0x507bdc(_0x5e4a2a[_0xe049('0x61')][_0x55a8fe][_0xe049('0x65')])?'\x20'+_0x5e4a2a[_0xe049('0x61')][_0x55a8fe]['value']:'');}return _0x391b44+')';};var _0x4344fb={'where':{'id':_0x369598[_0xe049('0x40')]['id']}},_0xaa7e8d,_0x3d7a5f,_0x756119,_0x52a94b,_0x17e0b6;_0x4344fb=_['merge']({},_0x4344fb,_0x369598[_0xe049('0x3a')]);return db[_0xe049('0x26')]['find'](_0x4344fb)[_0xe049('0x1f')](function(_0x1613c9){if(_0x1613c9){_0xaa7e8d=_0x1613c9;return _0x1613c9['getFields']();}return null;})[_0xe049('0x1f')](function(_0x1597e1){if(_0x1597e1){if(!_0x1597e1['length']){throw new db[(_0xe049('0x68'))][(_0xe049('0x69'))](_0xe049('0x6a'),0x193);}_0x3d7a5f=_0x1597e1;return db[_0xe049('0x85')][_0xe049('0x3d')]({'raw':!![]});}return null;})[_0xe049('0x1f')](function(_0x470888){if(_0x470888){_0x756119=_[_0xe049('0x6b')](_0x470888,'id');var _0x5e99ab;var _0x142cdb=squel['select']();_0x142cdb[_0xe049('0x6d')](_0xaa7e8d[_0xe049('0x6e')]);for(var _0x4049bd=0x0;_0x4049bd<_0x3d7a5f[_0xe049('0x30')];_0x4049bd+=0x1){_0x5e99ab=_0x3d7a5f[_0x4049bd][_0xe049('0x6f')]?_0x756119[_0x3d7a5f[_0x4049bd][_0xe049('0x6f')]][_0xe049('0x70')]:_0x3d7a5f[_0x4049bd][_0xe049('0x64')];_0x5e99ab=_0x3d7a5f[_0x4049bd]['function']?_['replace'](_0x2509f5[_0x3d7a5f[_0x4049bd][_0xe049('0x71')]],'%s',_0x5e99ab):_0x5e99ab;_0x5e99ab=_0x3d7a5f[_0x4049bd]['format']?_['replace'](_0x14d545[_0x3d7a5f[_0x4049bd][_0xe049('0x73')]],'%s',_0x5e99ab):_0x5e99ab;if(_0x3d7a5f[_0x4049bd]['groupBy']){_0x142cdb['group'](_0x5e99ab);}_0x3d7a5f[_0x4049bd]['orderBy']&&_0x142cdb[_0xe049('0x34')](_0x5e99ab,_0x3d7a5f[_0x4049bd][_0xe049('0x75')]===_0xe049('0x76')?![]:!![]);_0x142cdb[_0xe049('0x64')](_0x5e99ab,_0x3d7a5f[_0x4049bd][_0xe049('0x86')]||_0x5e99ab);}if(_0xaa7e8d[_0xe049('0x77')]){_0xaa7e8d['joins']=JSON[_0xe049('0x78')](_0xaa7e8d[_0xe049('0x77')]);for(var _0x1dd2e9=0x0;_0x1dd2e9<_0xaa7e8d[_0xe049('0x77')][_0xe049('0x30')];_0x1dd2e9+=0x1){if(_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x29')]&&_[_0xe049('0x5c')](_0x1ffb01,_0xaa7e8d['joins'][_0x1dd2e9][_0xe049('0x29')])&&_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x7c')]&&_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x7a')]&&_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x79')]){_0x142cdb[_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x29')]](_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9]['foreignTable'],null,util[_0xe049('0x73')](_0xe049('0x7b'),_0xaa7e8d[_0xe049('0x6e')],_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9][_0xe049('0x7c')],_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9]['foreignTable'],_0xaa7e8d[_0xe049('0x77')][_0x1dd2e9]['foreignKey']));}}}if(_0xaa7e8d[_0xe049('0x7d')]){_0xaa7e8d[_0xe049('0x7d')]=JSON[_0xe049('0x78')](_0xaa7e8d[_0xe049('0x7d')]);_0x142cdb[_0xe049('0x36')](_0x32ecdd(_0xaa7e8d[_0xe049('0x7d')][_0xe049('0x63')]));}_0x17e0b6=_0x142cdb[_0xe049('0x7e')]();_0x142cdb[_0xe049('0x33')](_0xf8ff);_0x142cdb[_0xe049('0x1a')](0x0);logger[_0xe049('0x87')]('Limited\x20Query:',_0x142cdb['toString']());return db[_0xe049('0x81')][_0xe049('0x2d')](_0x142cdb['toString'](),{'type':db['sequelize'][_0xe049('0x9a')][_0xe049('0x82')]});}})['then'](function(){return{'sql':_0x17e0b6['toString']()};})['then'](respondWithResult(_0x224fba,null))[_0xe049('0x43')](handleError(_0x224fba,null));}; \ No newline at end of file +var _0x9221=['filter','merge','options','include','findAll','rows','show','rawAttributes','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','%s.%s\x20=\x20%s.%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','count','limit','set','Content-Range','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL'];(function(_0x564df0,_0xfb8dfe){var _0x1ba957=function(_0x2a2845){while(--_0x2a2845){_0x564df0['push'](_0x564df0['shift']());}};_0x1ba957(++_0xfb8dfe);}(_0x9221,0x64));var _0x1922=function(_0xde0a7f,_0x33437f){_0xde0a7f=_0xde0a7f-0x0;var _0x1b5b69=_0x9221[_0xde0a7f];return _0x1b5b69;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1922('0x0'));var rimraf=require(_0x1922('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1922('0x2'));var rp=require(_0x1922('0x3'));var moment=require('moment');var BPromise=require(_0x1922('0x4'));var Mustache=require(_0x1922('0x5'));var util=require(_0x1922('0x6'));var path=require(_0x1922('0x7'));var sox=require(_0x1922('0x8'));var csv=require(_0x1922('0x9'));var ejs=require(_0x1922('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1922('0xb'));var crypto=require(_0x1922('0xc'));var jsforce=require(_0x1922('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1922('0x9'));var querystring=require('querystring');var Papa=require(_0x1922('0xe'));var Redis=require(_0x1922('0xf'));var authService=require(_0x1922('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1922('0x11'));var hardwareService=require(_0x1922('0x12'));var logger=require('../../config/logger')(_0x1922('0x13'));var utils=require('../../config/utils');var config=require(_0x1922('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1922('0x15'))[_0x1922('0x16')];function respondWithStatusCode(_0x2db5b9,_0x58cfe7){_0x58cfe7=_0x58cfe7||0xcc;return function(_0x514b6d){if(_0x514b6d){return _0x2db5b9[_0x1922('0x17')](_0x58cfe7);}return _0x2db5b9[_0x1922('0x18')](_0x58cfe7)[_0x1922('0x19')]();};}function respondWithResult(_0x3116dc,_0x33b35d){_0x33b35d=_0x33b35d||0xc8;return function(_0x4a76f7){if(_0x4a76f7){return _0x3116dc[_0x1922('0x18')](_0x33b35d)['json'](_0x4a76f7);}};}function respondWithFilteredResult(_0x6b9389,_0x474f72){return function(_0x22e548){if(_0x22e548){var _0x207ff4=_0x22e548[_0x1922('0x1a')],_0x533390=_0x474f72['offset'],_0x459511=_0x474f72['offset']+_0x474f72[_0x1922('0x1b')],_0x195b86;if(_0x459511>=_0x207ff4){_0x459511=_0x207ff4;_0x195b86=0xc8;}else{_0x195b86=0xce;}_0x6b9389['status'](_0x195b86);return _0x6b9389[_0x1922('0x1c')](_0x1922('0x1d'),_0x533390+'-'+_0x459511+'/'+_0x207ff4)['json'](_0x22e548);}return null;};}function patchUpdates(_0x4c60f8){return function(_0xdd6f6c){try{jsonpatch['apply'](_0xdd6f6c,_0x4c60f8,!![]);}catch(_0x23984c){return BPromise[_0x1922('0x1e')](_0x23984c);}return _0xdd6f6c[_0x1922('0x1f')]();};}function saveUpdates(_0x1803be,_0x5dacc5){return function(_0x2f2c49){if(_0x2f2c49){return _0x2f2c49[_0x1922('0x20')](_0x1803be)[_0x1922('0x21')](function(_0x15fd74){return _0x15fd74;});}return null;};}function removeEntity(_0x554f8b,_0xa5a368){return function(_0x287af9){if(_0x287af9){return _0x287af9[_0x1922('0x22')]()['then'](function(){var _0x29b92f=_0x287af9['get']({'plain':!![]});var _0x547b8c=_0x1922('0x23');return db[_0x1922('0x24')][_0x1922('0x22')]({'where':{'type':_0x547b8c,'resourceId':_0x29b92f['id']}})[_0x1922('0x21')](function(){return _0x287af9;});})[_0x1922('0x21')](function(){_0x554f8b[_0x1922('0x18')](0xcc)[_0x1922('0x19')]();});}};}function handleEntityNotFound(_0x1402ae,_0x341b01){return function(_0x12f468){if(!_0x12f468){_0x1402ae[_0x1922('0x17')](0x194);}return _0x12f468;};}function handleError(_0x49176c,_0x3db249){_0x3db249=_0x3db249||0x1f4;return function(_0x58ebb5){logger[_0x1922('0x25')](_0x58ebb5[_0x1922('0x26')]);if(_0x58ebb5[_0x1922('0x27')]){delete _0x58ebb5[_0x1922('0x27')];}_0x49176c[_0x1922('0x18')](_0x3db249)[_0x1922('0x28')](_0x58ebb5);};}exports[_0x1922('0x29')]=function(_0x6f6d8c,_0x5c6535){var _0x4b0799={},_0x17ecaa={},_0x153ebd={'count':0x0,'rows':[]};var _0x353c71=_[_0x1922('0x2a')](db[_0x1922('0x2b')]['rawAttributes'],function(_0x10f398){return{'name':_0x10f398[_0x1922('0x2c')],'type':_0x10f398[_0x1922('0x2d')][_0x1922('0x2e')]};});_0x17ecaa[_0x1922('0x2f')]=_[_0x1922('0x2a')](_0x353c71,_0x1922('0x27'));_0x17ecaa['query']=_[_0x1922('0x30')](_0x6f6d8c[_0x1922('0x31')]);_0x17ecaa[_0x1922('0x32')]=_[_0x1922('0x33')](_0x17ecaa[_0x1922('0x2f')],_0x17ecaa[_0x1922('0x31')]);_0x4b0799['attributes']=_[_0x1922('0x33')](_0x17ecaa[_0x1922('0x2f')],qs[_0x1922('0x34')](_0x6f6d8c[_0x1922('0x31')][_0x1922('0x34')]));_0x4b0799[_0x1922('0x35')]=_0x4b0799[_0x1922('0x35')]['length']?_0x4b0799[_0x1922('0x35')]:_0x17ecaa[_0x1922('0x2f')];if(!_0x6f6d8c[_0x1922('0x31')][_0x1922('0x36')](_0x1922('0x37'))){_0x4b0799[_0x1922('0x1b')]=qs['limit'](_0x6f6d8c[_0x1922('0x31')][_0x1922('0x1b')]);_0x4b0799['offset']=qs[_0x1922('0x38')](_0x6f6d8c[_0x1922('0x31')]['offset']);}_0x4b0799[_0x1922('0x39')]=qs[_0x1922('0x3a')](_0x6f6d8c[_0x1922('0x31')]['sort']);_0x4b0799[_0x1922('0x3b')]=qs[_0x1922('0x32')](_['pick'](_0x6f6d8c[_0x1922('0x31')],_0x17ecaa[_0x1922('0x32')]),_0x353c71);if(_0x6f6d8c[_0x1922('0x31')]['filter']){_0x4b0799[_0x1922('0x3b')]=_['merge'](_0x4b0799[_0x1922('0x3b')],{'$or':_['map'](_0x353c71,function(_0x53572f){if(_0x53572f[_0x1922('0x2d')]!==_0x1922('0x3c')){var _0x5f423d={};_0x5f423d[_0x53572f[_0x1922('0x27')]]={'$like':'%'+_0x6f6d8c[_0x1922('0x31')][_0x1922('0x3d')]+'%'};return _0x5f423d;}})});}_0x4b0799=_[_0x1922('0x3e')]({},_0x4b0799,_0x6f6d8c[_0x1922('0x3f')]);var _0x4c2295={'where':_0x4b0799['where']};return db[_0x1922('0x2b')][_0x1922('0x1a')](_0x4c2295)[_0x1922('0x21')](function(_0x1183a7){_0x153ebd[_0x1922('0x1a')]=_0x1183a7;if(_0x6f6d8c[_0x1922('0x31')]['includeAll']){_0x4b0799[_0x1922('0x40')]=[{'all':!![]}];}return db[_0x1922('0x2b')][_0x1922('0x41')](_0x4b0799);})[_0x1922('0x21')](function(_0x29b8af){_0x153ebd[_0x1922('0x42')]=_0x29b8af;return _0x153ebd;})[_0x1922('0x21')](respondWithFilteredResult(_0x5c6535,_0x4b0799))['catch'](handleError(_0x5c6535,null));};exports[_0x1922('0x43')]=function(_0x1e474b,_0x3f9f64){var _0x5df17d={'raw':![],'where':{'id':_0x1e474b['params']['id']}},_0x18a891={};_0x18a891[_0x1922('0x2f')]=_[_0x1922('0x30')](db[_0x1922('0x2b')][_0x1922('0x44')]);_0x18a891[_0x1922('0x31')]=_['keys'](_0x1e474b[_0x1922('0x31')]);_0x18a891[_0x1922('0x32')]=_[_0x1922('0x33')](_0x18a891[_0x1922('0x2f')],_0x18a891['query']);_0x5df17d[_0x1922('0x35')]=_['intersection'](_0x18a891[_0x1922('0x2f')],qs[_0x1922('0x34')](_0x1e474b[_0x1922('0x31')][_0x1922('0x34')]));_0x5df17d[_0x1922('0x35')]=_0x5df17d[_0x1922('0x35')][_0x1922('0x45')]?_0x5df17d['attributes']:_0x18a891['model'];if(_0x1e474b['query'][_0x1922('0x46')]){_0x5df17d[_0x1922('0x40')]=[{'all':!![]}];}_0x5df17d=_[_0x1922('0x3e')]({},_0x5df17d,_0x1e474b[_0x1922('0x3f')]);return db[_0x1922('0x2b')][_0x1922('0x47')](_0x5df17d)[_0x1922('0x21')](handleEntityNotFound(_0x3f9f64,null))[_0x1922('0x21')](respondWithResult(_0x3f9f64,null))['catch'](handleError(_0x3f9f64,null));};exports[_0x1922('0x48')]=function(_0x2b4179,_0x4ed204){return db[_0x1922('0x2b')][_0x1922('0x48')](_0x2b4179[_0x1922('0x49')],{})[_0x1922('0x21')](function(_0x1e6d2f){var _0x5b51c2=_0x2b4179['user']['get']({'plain':!![]});if(!_0x5b51c2)throw new Error(_0x1922('0x4a'));if(_0x5b51c2['role']==='user'){var _0x28adf1=_0x1e6d2f[_0x1922('0x4b')]({'plain':!![]});var _0x22d668='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x22d668,'userProfileId':_0x5b51c2['userProfileId']},'raw':!![]})[_0x1922('0x21')](function(_0x2abb8a){if(_0x2abb8a&&_0x2abb8a[_0x1922('0x4c')]===0x0){return db[_0x1922('0x24')]['create']({'name':_0x28adf1[_0x1922('0x27')],'resourceId':_0x28adf1['id'],'type':_0x1922('0x23'),'sectionId':_0x2abb8a['id']},{})[_0x1922('0x21')](function(){return _0x1e6d2f;});}else{return _0x1e6d2f;}})[_0x1922('0x4d')](function(_0x494b84){logger[_0x1922('0x25')](_0x1922('0x4e'),_0x494b84);throw _0x494b84;});}return _0x1e6d2f;})['then'](respondWithResult(_0x4ed204,0xc9))[_0x1922('0x4d')](handleError(_0x4ed204,null));};exports[_0x1922('0x20')]=function(_0x12a89f,_0x245d6f){if(_0x12a89f[_0x1922('0x49')]['id']){delete _0x12a89f[_0x1922('0x49')]['id'];}return db[_0x1922('0x2b')][_0x1922('0x47')]({'where':{'id':_0x12a89f[_0x1922('0x4f')]['id']}})[_0x1922('0x21')](handleEntityNotFound(_0x245d6f,null))[_0x1922('0x21')](saveUpdates(_0x12a89f[_0x1922('0x49')],null))[_0x1922('0x21')](respondWithResult(_0x245d6f,null))[_0x1922('0x4d')](handleError(_0x245d6f,null));};exports[_0x1922('0x22')]=function(_0x57faf7,_0x11d8b6){return db[_0x1922('0x2b')][_0x1922('0x47')]({'where':{'id':_0x57faf7[_0x1922('0x4f')]['id']}})['then'](handleEntityNotFound(_0x11d8b6,null))['then'](removeEntity(_0x11d8b6,null))['catch'](handleError(_0x11d8b6,null));};exports[_0x1922('0x50')]=function(_0x2777dd,_0x1eef02){var _0x46fb40=0xa;var _0x34c109=[_0x1922('0x51'),_0x1922('0x52'),_0x1922('0x53'),_0x1922('0x54')];var _0x4b2aa0={'SUM':_0x1922('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1922('0x56'),'MAX':'MAX(%s)','MIN':_0x1922('0x57'),'AVG':_0x1922('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1922('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xecb766={'SEC_TO_TIME':_0x1922('0x5a'),'DATE':_0x1922('0x5b'),'HOUR':_0x1922('0x5c'),'ROUND':_0x1922('0x5d'),'UNIX_TIMESTAMP':_0x1922('0x5e')};var _0x53e7ee=function(_0x1e6863){return!_[_0x1922('0x5f')]([_0x1922('0x60'),_0x1922('0x61'),_0x1922('0x62'),_0x1922('0x63')],_0x1e6863);};var _0x10a7ce=function(_0x39f5da){if(!_0x39f5da||!_0x39f5da[_0x1922('0x64')][_0x1922('0x45')]){return'';}for(var _0x41f53f='(',_0x4ff467=0x0;_0x4ff467<_0x39f5da[_0x1922('0x64')][_0x1922('0x45')];_0x4ff467+=0x1){_0x4ff467>0x0&&(_0x41f53f+='\x20'+_0x39f5da[_0x1922('0x65')]+'\x20');_0x41f53f+=_0x39f5da[_0x1922('0x64')][_0x4ff467][_0x1922('0x66')]?_0x10a7ce(_0x39f5da[_0x1922('0x64')][_0x4ff467][_0x1922('0x66')]):_0x39f5da[_0x1922('0x64')][_0x4ff467][_0x1922('0x67')]+'\x20'+_0x39f5da[_0x1922('0x64')][_0x4ff467][_0x1922('0x68')]+(_0x53e7ee(_0x39f5da['rules'][_0x4ff467][_0x1922('0x68')])?'\x20'+_0x39f5da[_0x1922('0x64')][_0x4ff467][_0x1922('0x69')]:'');}return _0x41f53f+')';};var _0x481d81={'where':{'id':_0x2777dd[_0x1922('0x4f')]['id']}},_0x214eb4,_0x2dbb37,_0x287726,_0x4cda1d,_0x48b311;_0x481d81=_['merge']({},_0x481d81,_0x2777dd[_0x1922('0x3f')]);return db[_0x1922('0x2b')][_0x1922('0x47')](_0x481d81)[_0x1922('0x21')](function(_0x51a42d){if(_0x51a42d){_0x214eb4=_0x51a42d;return _0x51a42d[_0x1922('0x6a')]();}return null;})[_0x1922('0x21')](function(_0x20a5ec){if(_0x20a5ec){if(!_0x20a5ec[_0x1922('0x45')]){throw new db[(_0x1922('0x6b'))]['ValidationErrorItem'](_0x1922('0x6c'),0x193);}_0x2dbb37=_0x20a5ec;return db['AnalyticMetric'][_0x1922('0x41')]({'raw':!![]});}return null;})[_0x1922('0x21')](function(_0x139285){if(_0x139285){_0x287726=_['keyBy'](_0x139285,'id');var _0x432706;var _0x577174=squel['select']();_0x577174[_0x1922('0x6d')](_0x214eb4['table']);for(var _0x6c5001=0x0;_0x6c5001<_0x2dbb37[_0x1922('0x45')];_0x6c5001+=0x1){_0x432706=_0x2dbb37[_0x6c5001][_0x1922('0x6e')]?_0x287726[_0x2dbb37[_0x6c5001][_0x1922('0x6e')]][_0x1922('0x6f')]:_0x2dbb37[_0x6c5001][_0x1922('0x67')];_0x432706=_0x2dbb37[_0x6c5001][_0x1922('0x70')]?_[_0x1922('0x71')](_0x4b2aa0[_0x2dbb37[_0x6c5001]['function']],'%s',_0x432706):_0x432706;_0x432706=_0x2dbb37[_0x6c5001][_0x1922('0x72')]?_[_0x1922('0x71')](_0xecb766[_0x2dbb37[_0x6c5001][_0x1922('0x72')]],'%s',_0x432706):_0x432706;if(_0x2dbb37[_0x6c5001][_0x1922('0x73')]){_0x577174[_0x1922('0x66')](_0x432706);}_0x2dbb37[_0x6c5001][_0x1922('0x74')]&&_0x577174[_0x1922('0x39')](_0x432706,_0x2dbb37[_0x6c5001][_0x1922('0x74')]===_0x1922('0x75')?![]:!![]);_0x577174[_0x1922('0x67')](_0x432706,_0x2dbb37[_0x6c5001][_0x1922('0x76')]||_0x432706);}if(_0x214eb4['joins']){_0x214eb4[_0x1922('0x77')]=JSON[_0x1922('0x78')](_0x214eb4[_0x1922('0x77')]);for(var _0x413e52=0x0;_0x413e52<_0x214eb4[_0x1922('0x77')][_0x1922('0x45')];_0x413e52+=0x1){if(_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x2d')]&&_[_0x1922('0x5f')](_0x34c109,_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x2d')])&&_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x79')]&&_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x7a')]&&_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x7b')]){_0x577174[_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x2d')]](_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x7a')],null,util[_0x1922('0x72')]('%s.%s\x20=\x20%s.%s',_0x214eb4[_0x1922('0x7c')],_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x79')],_0x214eb4[_0x1922('0x77')][_0x413e52][_0x1922('0x7a')],_0x214eb4['joins'][_0x413e52][_0x1922('0x7b')]));}}}if(_0x214eb4['conditions']){_0x214eb4[_0x1922('0x7d')]=JSON[_0x1922('0x78')](_0x214eb4[_0x1922('0x7d')]);_0x577174[_0x1922('0x3b')](_0x10a7ce(_0x214eb4[_0x1922('0x7d')][_0x1922('0x66')]));}_0x48b311=_0x577174[_0x1922('0x7e')]();_0x577174['limit'](_0x46fb40);_0x577174[_0x1922('0x38')](0x0);logger[_0x1922('0x7f')](_0x1922('0x80'),_0x577174[_0x1922('0x81')]());return db[_0x1922('0x82')][_0x1922('0x31')](_0x577174[_0x1922('0x81')](),{'type':db['sequelize'][_0x1922('0x83')][_0x1922('0x84')]});}})[_0x1922('0x21')](respondWithResult(_0x1eef02,null))[_0x1922('0x4d')](handleError(_0x1eef02,null));};function runReport(_0x3dbf8d,_0x32b23f,_0x22981e){var _0x14b419=_0x32b23f[_0x1922('0x27')];var _0x239e0f=0xa;var _0x50bc2a=[_0x1922('0x51'),'left_join',_0x1922('0x53'),_0x1922('0x54')];var _0x28b5d8={'SUM':_0x1922('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1922('0x85'),'MIN':_0x1922('0x57'),'AVG':_0x1922('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1922('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12204f={'SEC_TO_TIME':_0x1922('0x5a'),'DATE':_0x1922('0x5b'),'HOUR':_0x1922('0x5c'),'ROUND':_0x1922('0x5d'),'UNIX_TIMESTAMP':_0x1922('0x5e')};var _0x13dba6=function(_0x3688c5){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1922('0x62'),_0x1922('0x63')],_0x3688c5);};var _0xc04653=function(_0x137fd8){if(!_0x137fd8||!_0x137fd8['rules'][_0x1922('0x45')]){return'';}for(var _0x4dcb1b='(',_0x48b387=0x0;_0x48b387<_0x137fd8['rules'][_0x1922('0x45')];_0x48b387+=0x1){_0x48b387>0x0&&(_0x4dcb1b+='\x20'+_0x137fd8[_0x1922('0x65')]+'\x20');_0x4dcb1b+=_0x137fd8[_0x1922('0x64')][_0x48b387]['group']?_0xc04653(_0x137fd8['rules'][_0x48b387][_0x1922('0x66')]):_0x137fd8[_0x1922('0x64')][_0x48b387][_0x1922('0x67')]+'\x20'+_0x137fd8[_0x1922('0x64')][_0x48b387][_0x1922('0x68')]+(_0x13dba6(_0x137fd8['rules'][_0x48b387][_0x1922('0x68')])?'\x20'+_0x137fd8['rules'][_0x48b387][_0x1922('0x69')]:'');}return _0x4dcb1b+')';};var _0x4672a3={'where':{'id':_0x3dbf8d['id']}},_0x2c70b6,_0x158d39,_0x203037,_0x3137ec,_0x175278;_0x4672a3=_[_0x1922('0x3e')]({},_0x4672a3,_0x22981e);return db[_0x1922('0x2b')][_0x1922('0x47')](_0x4672a3)[_0x1922('0x21')](function(_0x5ab8a4){if(_0x5ab8a4){_0x2c70b6=_0x5ab8a4;return _0x5ab8a4[_0x1922('0x6a')]();}return null;})[_0x1922('0x21')](function(_0xde6c2c){if(_0xde6c2c){if(!_0xde6c2c[_0x1922('0x45')]){throw new db['Sequelize'][(_0x1922('0x86'))](_0x1922('0x6c'),0x193);}_0x158d39=_0xde6c2c;return db[_0x1922('0x87')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4949e3){if(_0x4949e3){_0x203037=_[_0x1922('0x88')](_0x4949e3,'id');var _0x59a204;var _0x5da23c=squel[_0x1922('0x89')]();_0x5da23c[_0x1922('0x6d')](_0x2c70b6[_0x1922('0x7c')]);for(var _0x4f6c99=0x0;_0x4f6c99<_0x158d39[_0x1922('0x45')];_0x4f6c99+=0x1){_0x59a204=_0x158d39[_0x4f6c99][_0x1922('0x6e')]?_0x203037[_0x158d39[_0x4f6c99]['MetricId']][_0x1922('0x6f')]:_0x158d39[_0x4f6c99][_0x1922('0x67')];_0x59a204=_0x158d39[_0x4f6c99][_0x1922('0x70')]?_[_0x1922('0x71')](_0x28b5d8[_0x158d39[_0x4f6c99][_0x1922('0x70')]],'%s',_0x59a204):_0x59a204;_0x59a204=_0x158d39[_0x4f6c99][_0x1922('0x72')]?_[_0x1922('0x71')](_0x12204f[_0x158d39[_0x4f6c99][_0x1922('0x72')]],'%s',_0x59a204):_0x59a204;if(_0x158d39[_0x4f6c99][_0x1922('0x73')]){_0x5da23c[_0x1922('0x66')](_0x59a204);}_0x158d39[_0x4f6c99][_0x1922('0x74')]&&_0x5da23c[_0x1922('0x39')](_0x59a204,_0x158d39[_0x4f6c99][_0x1922('0x74')]===_0x1922('0x75')?![]:!![]);_0x5da23c[_0x1922('0x67')](_0x59a204,_0x158d39[_0x4f6c99]['alias']||_0x59a204);}if(_0x2c70b6[_0x1922('0x77')]){_0x2c70b6[_0x1922('0x77')]=JSON[_0x1922('0x78')](_0x2c70b6['joins']);for(var _0x76e378=0x0;_0x76e378<_0x2c70b6[_0x1922('0x77')][_0x1922('0x45')];_0x76e378+=0x1){if(_0x2c70b6['joins'][_0x76e378][_0x1922('0x2d')]&&_[_0x1922('0x5f')](_0x50bc2a,_0x2c70b6[_0x1922('0x77')][_0x76e378]['type'])&&_0x2c70b6[_0x1922('0x77')][_0x76e378]['parentKey']&&_0x2c70b6[_0x1922('0x77')][_0x76e378][_0x1922('0x7a')]&&_0x2c70b6[_0x1922('0x77')][_0x76e378][_0x1922('0x7b')]){_0x5da23c[_0x2c70b6[_0x1922('0x77')][_0x76e378][_0x1922('0x2d')]](_0x2c70b6[_0x1922('0x77')][_0x76e378]['foreignTable'],null,util[_0x1922('0x72')]('%s.%s\x20=\x20%s.%s',_0x2c70b6[_0x1922('0x7c')],_0x2c70b6[_0x1922('0x77')][_0x76e378][_0x1922('0x79')],_0x2c70b6[_0x1922('0x77')][_0x76e378]['foreignTable'],_0x2c70b6[_0x1922('0x77')][_0x76e378][_0x1922('0x7b')]));}}}if(_0x2c70b6[_0x1922('0x7d')]){_0x2c70b6[_0x1922('0x7d')]=JSON['parse'](_0x2c70b6['conditions']);_0x5da23c['where'](_0xc04653(_0x2c70b6[_0x1922('0x7d')]['group']));}_0x175278=_0x5da23c[_0x1922('0x7e')]();_0x5da23c['limit'](_0x239e0f);_0x5da23c[_0x1922('0x38')](0x0);logger[_0x1922('0x7f')](_0x1922('0x80'),_0x5da23c[_0x1922('0x81')]());return db[_0x1922('0x82')][_0x1922('0x31')](_0x5da23c[_0x1922('0x81')](),{'type':db['sequelize']['QueryTypes'][_0x1922('0x84')]});}})['then'](function(_0x5d1035){if(!_0x5d1035[_0x1922('0x45')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1922('0x8a'),0xcc);}if(_0x32b23f[_0x1922('0x8b')]===_0x1922('0x8c')){return null;}var _0x471455=_[_0x1922('0x3e')](_0x32b23f,{'name':_0x32b23f[_0x1922('0x8d')]||_0x32b23f[_0x1922('0x27')]||_0x2c70b6[_0x1922('0x27')],'basename':_0x14b419,'savename':util[_0x1922('0x72')]('%s-%s.%s',_0x32b23f[_0x1922('0x27')]||_0x2c70b6[_0x1922('0x27')],require(_0x1922('0x8e'))[_0x1922('0x8f')](0x4),_0x32b23f[_0x1922('0x8b')]||_0x1922('0x90')),'reportId':_0x2c70b6['id'],'reportType':_0x1922('0x91')});return db['AnalyticExtractedReport'][_0x1922('0x48')](_0x471455,{'raw':!![]});})['then'](function(_0x5aa486){if(_0x2c70b6['table']===_0x1922('0x92')){_0x175278[_0x1922('0x3b')](_0x2c70b6[_0x1922('0x7c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x32b23f[_0x1922('0x93')],_0x32b23f[_0x1922('0x94')]);}else{_0x175278[_0x1922('0x3b')](_0x2c70b6['table']+_0x1922('0x95'),_0x32b23f[_0x1922('0x93')],_0x32b23f[_0x1922('0x94')]);}if(_0x5aa486){logger['info'](_0x1922('0x96'),_0x175278[_0x1922('0x81')]());require(_0x1922('0x97'))['fork'](path['join'](__dirname,_0x1922('0x98'),_0x5aa486[_0x1922('0x8b')]),[_0x5aa486['id'],_0x175278[_0x1922('0x81')](),path[_0x1922('0x51')](__dirname,_0x1922('0x99'),_0x5aa486[_0x1922('0x9a')]),_0x14b419]);return _0x5aa486;}else{var _0x259fe0=squel['select']();_0x259fe0[_0x1922('0x6d')]('('+_0x175278[_0x1922('0x81')]()+')','countTable');_0x259fe0[_0x1922('0x67')](_0x1922('0x9b'),_0x1922('0x1a'));_0x175278[_0x1922('0x1b')](_0x32b23f[_0x1922('0x1b')]||_0x239e0f);_0x175278[_0x1922('0x38')](_0x32b23f[_0x1922('0x38')]||0x0);return dbH[_0x1922('0x82')][_0x1922('0x31')](_0x259fe0[_0x1922('0x81')](),{'type':dbH[_0x1922('0x82')][_0x1922('0x83')][_0x1922('0x84')]})['then'](function(_0x19caee){if(!_0x19caee[_0x1922('0x45')]){_0x3137ec=0x0;}else{_0x3137ec=_0x19caee[0x0][_0x1922('0x1a')]||0x0;}return dbH[_0x1922('0x82')][_0x1922('0x31')](_0x175278[_0x1922('0x81')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x1922('0x21')](function(_0x16695a){return{'rows':_0x16695a||[],'count':_0x3137ec};});}});}exports[_0x1922('0x9c')]=function(_0x482413,_0x254300){return runReport(_0x482413[_0x1922('0x4f')],_0x482413[_0x1922('0x31')],_0x482413['options'])[_0x1922('0x21')](respondWithResult(_0x254300,null))[_0x1922('0x4d')](handleError(_0x254300,null));};exports[_0x1922('0x9d')]=runReport;exports[_0x1922('0x31')]=function(_0x5d9d28,_0x1b2e71){var _0x7bd6d0=0xa;var _0x181a90=[_0x1922('0x51'),'left_join',_0x1922('0x53'),_0x1922('0x54')];var _0x5caa8d={'SUM':_0x1922('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1922('0x85'),'MIN':_0x1922('0x57'),'AVG':_0x1922('0x58'),'GROUP_CONCAT':_0x1922('0x9e'),'GROUP_CONCAT ASC':_0x1922('0x59'),'GROUP_CONCAT DESC':_0x1922('0x9f')};var _0x4fa8e1={'SEC_TO_TIME':_0x1922('0x5a'),'DATE':_0x1922('0x5b'),'HOUR':_0x1922('0x5c'),'ROUND':_0x1922('0x5d'),'UNIX_TIMESTAMP':_0x1922('0x5e')};var _0x2cff0c=function(_0x495d7c){return!_[_0x1922('0x5f')]([_0x1922('0x60'),_0x1922('0x61'),_0x1922('0x62'),_0x1922('0x63')],_0x495d7c);};var _0x4dce6e=function(_0x5e3fa2){if(!_0x5e3fa2||!_0x5e3fa2[_0x1922('0x64')][_0x1922('0x45')]){return'';}for(var _0x464977='(',_0x2e3c5d=0x0;_0x2e3c5d<_0x5e3fa2['rules'][_0x1922('0x45')];_0x2e3c5d+=0x1){_0x2e3c5d>0x0&&(_0x464977+='\x20'+_0x5e3fa2[_0x1922('0x65')]+'\x20');_0x464977+=_0x5e3fa2[_0x1922('0x64')][_0x2e3c5d][_0x1922('0x66')]?_0x4dce6e(_0x5e3fa2['rules'][_0x2e3c5d][_0x1922('0x66')]):_0x5e3fa2[_0x1922('0x64')][_0x2e3c5d][_0x1922('0x67')]+'\x20'+_0x5e3fa2[_0x1922('0x64')][_0x2e3c5d][_0x1922('0x68')]+(_0x2cff0c(_0x5e3fa2['rules'][_0x2e3c5d][_0x1922('0x68')])?'\x20'+_0x5e3fa2[_0x1922('0x64')][_0x2e3c5d][_0x1922('0x69')]:'');}return _0x464977+')';};var _0x60c7d={'where':{'id':_0x5d9d28[_0x1922('0x4f')]['id']}},_0x5dabda,_0x3e96f0,_0x4eb7d0,_0x5dc157,_0x53a9b9;_0x60c7d=_[_0x1922('0x3e')]({},_0x60c7d,_0x5d9d28[_0x1922('0x3f')]);return db[_0x1922('0x2b')][_0x1922('0x47')](_0x60c7d)[_0x1922('0x21')](function(_0x4cc90b){if(_0x4cc90b){_0x5dabda=_0x4cc90b;return _0x4cc90b[_0x1922('0x6a')]();}return null;})[_0x1922('0x21')](function(_0x51d0cd){if(_0x51d0cd){if(!_0x51d0cd[_0x1922('0x45')]){throw new db['Sequelize'][(_0x1922('0x86'))](_0x1922('0x6c'),0x193);}_0x3e96f0=_0x51d0cd;return db[_0x1922('0x87')]['findAll']({'raw':!![]});}return null;})[_0x1922('0x21')](function(_0x537ed0){if(_0x537ed0){_0x4eb7d0=_[_0x1922('0x88')](_0x537ed0,'id');var _0x1fd925;var _0x3f8672=squel['select']();_0x3f8672[_0x1922('0x6d')](_0x5dabda[_0x1922('0x7c')]);for(var _0x35d2b3=0x0;_0x35d2b3<_0x3e96f0[_0x1922('0x45')];_0x35d2b3+=0x1){_0x1fd925=_0x3e96f0[_0x35d2b3][_0x1922('0x6e')]?_0x4eb7d0[_0x3e96f0[_0x35d2b3]['MetricId']][_0x1922('0x6f')]:_0x3e96f0[_0x35d2b3]['field'];_0x1fd925=_0x3e96f0[_0x35d2b3][_0x1922('0x70')]?_[_0x1922('0x71')](_0x5caa8d[_0x3e96f0[_0x35d2b3][_0x1922('0x70')]],'%s',_0x1fd925):_0x1fd925;_0x1fd925=_0x3e96f0[_0x35d2b3][_0x1922('0x72')]?_[_0x1922('0x71')](_0x4fa8e1[_0x3e96f0[_0x35d2b3]['format']],'%s',_0x1fd925):_0x1fd925;if(_0x3e96f0[_0x35d2b3][_0x1922('0x73')]){_0x3f8672['group'](_0x1fd925);}_0x3e96f0[_0x35d2b3]['orderBy']&&_0x3f8672[_0x1922('0x39')](_0x1fd925,_0x3e96f0[_0x35d2b3]['orderBy']==='DESC'?![]:!![]);_0x3f8672['field'](_0x1fd925,_0x3e96f0[_0x35d2b3][_0x1922('0x76')]||_0x1fd925);}if(_0x5dabda['joins']){_0x5dabda['joins']=JSON[_0x1922('0x78')](_0x5dabda['joins']);for(var _0x56e1b3=0x0;_0x56e1b3<_0x5dabda[_0x1922('0x77')]['length'];_0x56e1b3+=0x1){if(_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x2d')]&&_[_0x1922('0x5f')](_0x181a90,_0x5dabda[_0x1922('0x77')][_0x56e1b3]['type'])&&_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x79')]&&_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x7a')]&&_0x5dabda['joins'][_0x56e1b3][_0x1922('0x7b')]){_0x3f8672[_0x5dabda['joins'][_0x56e1b3][_0x1922('0x2d')]](_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x7a')],null,util['format'](_0x1922('0xa0'),_0x5dabda[_0x1922('0x7c')],_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x79')],_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x7a')],_0x5dabda[_0x1922('0x77')][_0x56e1b3][_0x1922('0x7b')]));}}}if(_0x5dabda[_0x1922('0x7d')]){_0x5dabda['conditions']=JSON[_0x1922('0x78')](_0x5dabda[_0x1922('0x7d')]);_0x3f8672[_0x1922('0x3b')](_0x4dce6e(_0x5dabda[_0x1922('0x7d')][_0x1922('0x66')]));}_0x53a9b9=_0x3f8672[_0x1922('0x7e')]();_0x3f8672[_0x1922('0x1b')](_0x7bd6d0);_0x3f8672['offset'](0x0);logger[_0x1922('0x7f')](_0x1922('0x80'),_0x3f8672[_0x1922('0x81')]());return db['sequelize']['query'](_0x3f8672[_0x1922('0x81')](),{'type':db[_0x1922('0x82')]['QueryTypes'][_0x1922('0x84')]});}})[_0x1922('0x21')](function(){return{'sql':_0x53a9b9[_0x1922('0x81')]()};})['then'](respondWithResult(_0x1b2e71,null))[_0x1922('0x4d')](handleError(_0x1b2e71,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index fdcfef3..5f06686 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 _0x2fef=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x3de8af,_0x422dea){var _0x34b286=function(_0x3785e2){while(--_0x3785e2){_0x3de8af['push'](_0x3de8af['shift']());}};_0x34b286(++_0x422dea);}(_0x2fef,0x1a3));var _0xf2fe=function(_0x4fab1e,_0x34b507){_0x4fab1e=_0x4fab1e-0x0;var _0x59bf51=_0x2fef[_0x4fab1e];return _0x59bf51;};'use strict';var _=require(_0xf2fe('0x0'));var util=require(_0xf2fe('0x1'));var logger=require(_0xf2fe('0x2'))(_0xf2fe('0x3'));var moment=require(_0xf2fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xf2fe('0x5'));var fs=require('fs');var path=require(_0xf2fe('0x6'));var rimraf=require('rimraf');var config=require(_0xf2fe('0x7'));var attributes=require(_0xf2fe('0x8'));module[_0xf2fe('0x9')]=function(_0x5c8301,_0x28bd5d){return _0x5c8301[_0xf2fe('0xa')](_0xf2fe('0xb'),attributes,{'tableName':_0xf2fe('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b53=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x25e3d3,_0x1d2882){var _0x42ad83=function(_0x5f3010){while(--_0x5f3010){_0x25e3d3['push'](_0x25e3d3['shift']());}};_0x42ad83(++_0x1d2882);}(_0x5b53,0xe4));var _0x35b5=function(_0x1f49d5,_0x178592){_0x1f49d5=_0x1f49d5-0x0;var _0x2fbcda=_0x5b53[_0x1f49d5];return _0x2fbcda;};'use strict';var _=require(_0x35b5('0x0'));var util=require(_0x35b5('0x1'));var logger=require(_0x35b5('0x2'))(_0x35b5('0x3'));var moment=require(_0x35b5('0x4'));var BPromise=require('bluebird');var rp=require(_0x35b5('0x5'));var fs=require('fs');var path=require(_0x35b5('0x6'));var rimraf=require(_0x35b5('0x7'));var config=require(_0x35b5('0x8'));var attributes=require(_0x35b5('0x9'));module[_0x35b5('0xa')]=function(_0x1b61f2,_0x25ed8f){return _0x1b61f2['define'](_0x35b5('0xb'),attributes,{'tableName':_0x35b5('0xc'),'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 b4c2bed..da9354e 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 _0x5e87=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x5e87,0x119));var _0x75e8=function(_0x1646af,_0x411b04){_0x1646af=_0x1646af-0x0;var _0x5c9714=_0x5e87[_0x1646af];return _0x5c9714;};'use strict';var _=require(_0x75e8('0x0'));var util=require('util');var moment=require(_0x75e8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75e8('0x2'));var db=require(_0x75e8('0x3'))['db'];var utils=require(_0x75e8('0x4'));var logger=require(_0x75e8('0x5'))('rpc');var config=require(_0x75e8('0x6'));var jayson=require(_0x75e8('0x7'));var client=jayson['client'][_0x75e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x458aad,_0x4f98d5,_0x5792ac){return new BPromise(function(_0x3857ca,_0x54577c){return client[_0x75e8('0x9')](_0x458aad,_0x5792ac)[_0x75e8('0xa')](function(_0x55ede3){logger[_0x75e8('0xb')](_0x75e8('0xc'),_0x4f98d5,_0x75e8('0xd'));logger[_0x75e8('0xe')](_0x75e8('0xf'),_0x4f98d5,'request\x20sent',JSON[_0x75e8('0x10')](_0x55ede3));if(_0x55ede3[_0x75e8('0x11')]){if(_0x55ede3[_0x75e8('0x11')][_0x75e8('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4f98d5,_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);return _0x54577c(_0x55ede3['error'][_0x75e8('0x13')]);}logger[_0x75e8('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4f98d5,_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);return _0x3857ca(_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);}else{logger['info'](_0x75e8('0xc'),_0x4f98d5,_0x75e8('0xd'));_0x3857ca(_0x55ede3[_0x75e8('0x14')][_0x75e8('0x13')]);}})[_0x75e8('0x15')](function(_0x161a82){logger[_0x75e8('0x11')](_0x75e8('0xc'),_0x4f98d5,_0x161a82);_0x54577c(_0x161a82);});});} \ No newline at end of file +var _0xb8fa=['jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','info','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5d575c,_0x38008f){var _0x27f2ba=function(_0x4c1f81){while(--_0x4c1f81){_0x5d575c['push'](_0x5d575c['shift']());}};_0x27f2ba(++_0x38008f);}(_0xb8fa,0xb5));var _0xab8f=function(_0x19faba,_0x47751f){_0x19faba=_0x19faba-0x0;var _0x32f8ed=_0xb8fa[_0x19faba];return _0x32f8ed;};'use strict';var _=require(_0xab8f('0x0'));var util=require('util');var moment=require(_0xab8f('0x1'));var BPromise=require(_0xab8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab8f('0x3'));var logger=require(_0xab8f('0x4'))('rpc');var config=require(_0xab8f('0x5'));var jayson=require(_0xab8f('0x6'));var client=jayson[_0xab8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x96ced5,_0x16ce68,_0x3d0c98){return new BPromise(function(_0x48b63f,_0x339d9a){return client[_0xab8f('0x8')](_0x96ced5,_0x3d0c98)[_0xab8f('0x9')](function(_0x226973){logger['info'](_0xab8f('0xa'),_0x16ce68,_0xab8f('0xb'));logger[_0xab8f('0xc')](_0xab8f('0xd'),_0x16ce68,_0xab8f('0xb'),JSON['stringify'](_0x226973));if(_0x226973[_0xab8f('0xe')]){if(_0x226973[_0xab8f('0xe')]['code']===0x1f4){logger['error'](_0xab8f('0xa'),_0x16ce68,_0x226973['error'][_0xab8f('0xf')]);return _0x339d9a(_0x226973['error'][_0xab8f('0xf')]);}logger[_0xab8f('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x16ce68,_0x226973[_0xab8f('0xe')]['message']);return _0x48b63f(_0x226973[_0xab8f('0xe')][_0xab8f('0xf')]);}else{logger[_0xab8f('0x10')](_0xab8f('0xa'),_0x16ce68,_0xab8f('0xb'));_0x48b63f(_0x226973['result'][_0xab8f('0xf')]);}})['catch'](function(_0x34eca4){logger[_0xab8f('0xe')](_0xab8f('0xa'),_0x16ce68,_0x34eca4);_0x339d9a(_0x34eca4);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 22b73dd..cc0005d 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 _0x8f25=['query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/query'];(function(_0x16f0db,_0x149a0d){var _0x1f30ff=function(_0x301c45){while(--_0x301c45){_0x16f0db['push'](_0x16f0db['shift']());}};_0x1f30ff(++_0x149a0d);}(_0x8f25,0x110));var _0x58f2=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8f25[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x58f2('0x0'));var util=require('util');var path=require(_0x58f2('0x1'));var timeout=require(_0x58f2('0x2'));var express=require(_0x58f2('0x3'));var router=express[_0x58f2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x58f2('0x5'));var config=require(_0x58f2('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x58f2('0x7')]('/',auth[_0x58f2('0x8')](),controller[_0x58f2('0x9')]);router[_0x58f2('0x7')](_0x58f2('0xa'),auth[_0x58f2('0x8')](),controller[_0x58f2('0xb')]);router[_0x58f2('0x7')](_0x58f2('0xc'),auth[_0x58f2('0x8')](),controller['preview']);router[_0x58f2('0x7')]('/:id/run',auth[_0x58f2('0x8')](),controller['run']);router[_0x58f2('0x7')](_0x58f2('0xd'),auth['isAuthenticated'](),controller[_0x58f2('0xe')]);router[_0x58f2('0xf')]('/',auth[_0x58f2('0x8')](),controller[_0x58f2('0x10')]);router[_0x58f2('0x11')](_0x58f2('0xa'),auth['isAuthenticated'](),controller[_0x58f2('0x12')]);router[_0x58f2('0x13')](_0x58f2('0xa'),auth[_0x58f2('0x8')](),controller[_0x58f2('0x14')]);module[_0x58f2('0x15')]=router; \ No newline at end of file +var _0x20ab=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports','multer','util'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x20ab,0x11e));var _0xb20a=function(_0x5a3f92,_0x23e7df){_0x5a3f92=_0x5a3f92-0x0;var _0x467063=_0x20ab[_0x5a3f92];return _0x467063;};'use strict';var multer=require(_0xb20a('0x0'));var util=require(_0xb20a('0x1'));var path=require(_0xb20a('0x2'));var timeout=require(_0xb20a('0x3'));var express=require(_0xb20a('0x4'));var router=express['Router']();var auth=require(_0xb20a('0x5'));var interaction=require(_0xb20a('0x6'));var config=require(_0xb20a('0x7'));var controller=require(_0xb20a('0x8'));router[_0xb20a('0x9')]('/',auth[_0xb20a('0xa')](),controller[_0xb20a('0xb')]);router[_0xb20a('0x9')](_0xb20a('0xc'),auth[_0xb20a('0xa')](),controller[_0xb20a('0xd')]);router[_0xb20a('0x9')]('/:id/preview',auth[_0xb20a('0xa')](),controller[_0xb20a('0xe')]);router[_0xb20a('0x9')](_0xb20a('0xf'),auth[_0xb20a('0xa')](),controller[_0xb20a('0x10')]);router[_0xb20a('0x9')](_0xb20a('0x11'),auth[_0xb20a('0xa')](),controller[_0xb20a('0x12')]);router['post']('/',auth[_0xb20a('0xa')](),controller['create']);router[_0xb20a('0x13')](_0xb20a('0xc'),auth['isAuthenticated'](),controller[_0xb20a('0x14')]);router[_0xb20a('0x15')]('/:id',auth[_0xb20a('0xa')](),controller[_0xb20a('0x16')]);module[_0xb20a('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7c27591..414fbca 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 _0xe176=['exports','STRING','TEXT','sequelize'];(function(_0x1ebcce,_0x50bdcf){var _0x36d3b7=function(_0x2a575b){while(--_0x2a575b){_0x1ebcce['push'](_0x1ebcce['shift']());}};_0x36d3b7(++_0x50bdcf);}(_0xe176,0x12b));var _0x6e17=function(_0x3a7490,_0x265112){_0x3a7490=_0x3a7490-0x0;var _0x4209ab=_0xe176[_0x3a7490];return _0x4209ab;};'use strict';var Sequelize=require(_0x6e17('0x0'));module[_0x6e17('0x1')]={'name':{'type':Sequelize[_0x6e17('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6e17('0x2')]},'parent':{'type':Sequelize[_0x6e17('0x2')]},'table':{'type':Sequelize[_0x6e17('0x2')]},'conditions':{'type':Sequelize[_0x6e17('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc7c1=['TEXT','sequelize','exports','STRING'];(function(_0x5e0be1,_0x57f577){var _0x4de49f=function(_0x50c87e){while(--_0x50c87e){_0x5e0be1['push'](_0x5e0be1['shift']());}};_0x4de49f(++_0x57f577);}(_0xc7c1,0x1dd));var _0x1c7c=function(_0x5d9c75,_0x1f8017){_0x5d9c75=_0x5d9c75-0x0;var _0x170893=_0xc7c1[_0x5d9c75];return _0x170893;};'use strict';var Sequelize=require(_0x1c7c('0x0'));module[_0x1c7c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1c7c('0x2')]},'parent':{'type':Sequelize[_0x1c7c('0x2')]},'table':{'type':Sequelize[_0x1c7c('0x2')]},'conditions':{'type':Sequelize[_0x1c7c('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 49280f6..ff871a6 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 _0xbf61=['alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','QueryTypes','cross_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','select','from','metric','groupBy','DESC','debug','toString','SELECT','Sequelize','No\x20available\x20data','web','%s-%s.%s','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','left_join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','jsforce','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','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','function','replace','orderBy'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xbf61,0xd7));var _0x1bf6=function(_0x5ea79b,_0x3b647f){_0x5ea79b=_0x5ea79b-0x0;var _0x2a6eac=_0xbf61[_0x5ea79b];return _0x2a6eac;};'use strict';var pdf=require(_0x1bf6('0x0'));var emlformat=require(_0x1bf6('0x1'));var rimraf=require(_0x1bf6('0x2'));var zipdir=require(_0x1bf6('0x3'));var jsonpatch=require(_0x1bf6('0x4'));var rp=require(_0x1bf6('0x5'));var moment=require(_0x1bf6('0x6'));var BPromise=require(_0x1bf6('0x7'));var Mustache=require('mustache');var util=require(_0x1bf6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1bf6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1bf6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1bf6('0x9'));var querystring=require(_0x1bf6('0xb'));var Papa=require(_0x1bf6('0xc'));var Redis=require(_0x1bf6('0xd'));var authService=require(_0x1bf6('0xe'));var qs=require(_0x1bf6('0xf'));var as=require(_0x1bf6('0x10'));var hardwareService=require(_0x1bf6('0x11'));var logger=require(_0x1bf6('0x12'))('api');var utils=require(_0x1bf6('0x13'));var config=require(_0x1bf6('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1bf6('0x15'))['dbH'];function respondWithStatusCode(_0x5c189a,_0x2bd858){_0x2bd858=_0x2bd858||0xcc;return function(_0x3c4f2f){if(_0x3c4f2f){return _0x5c189a[_0x1bf6('0x16')](_0x2bd858);}return _0x5c189a[_0x1bf6('0x17')](_0x2bd858)[_0x1bf6('0x18')]();};}function respondWithResult(_0x1fa717,_0x4eb3a7){_0x4eb3a7=_0x4eb3a7||0xc8;return function(_0x38e67f){if(_0x38e67f){return _0x1fa717[_0x1bf6('0x17')](_0x4eb3a7)[_0x1bf6('0x19')](_0x38e67f);}};}function respondWithFilteredResult(_0x2e3e96,_0x40c81b){return function(_0x16c1a0){if(_0x16c1a0){var _0x587a76=_0x16c1a0[_0x1bf6('0x1a')],_0x480089=_0x40c81b[_0x1bf6('0x1b')],_0x560c96=_0x40c81b['offset']+_0x40c81b[_0x1bf6('0x1c')],_0x3d9e93;if(_0x560c96>=_0x587a76){_0x560c96=_0x587a76;_0x3d9e93=0xc8;}else{_0x3d9e93=0xce;}_0x2e3e96[_0x1bf6('0x17')](_0x3d9e93);return _0x2e3e96['set']('Content-Range',_0x480089+'-'+_0x560c96+'/'+_0x587a76)[_0x1bf6('0x19')](_0x16c1a0);}return null;};}function patchUpdates(_0x43e647){return function(_0x3026ed){try{jsonpatch[_0x1bf6('0x1d')](_0x3026ed,_0x43e647,!![]);}catch(_0x19888d){return BPromise[_0x1bf6('0x1e')](_0x19888d);}return _0x3026ed[_0x1bf6('0x1f')]();};}function saveUpdates(_0x1eec86,_0x38d55d){return function(_0x4605f0){if(_0x4605f0){return _0x4605f0['update'](_0x1eec86)[_0x1bf6('0x20')](function(_0x1323f9){return _0x1323f9;});}return null;};}function removeEntity(_0x30dd6a,_0x3817a4){return function(_0x38cf74){if(_0x38cf74){return _0x38cf74[_0x1bf6('0x21')]()['then'](function(){var _0xf190f1=_0x38cf74[_0x1bf6('0x22')]({'plain':!![]});var _0x2d6fe3=_0x1bf6('0x23');return db[_0x1bf6('0x24')][_0x1bf6('0x21')]({'where':{'type':_0x2d6fe3,'resourceId':_0xf190f1['id']}})[_0x1bf6('0x20')](function(){return _0x38cf74;});})[_0x1bf6('0x20')](function(){_0x30dd6a['status'](0xcc)[_0x1bf6('0x18')]();});}};}function handleEntityNotFound(_0x446d48,_0x40a2ea){return function(_0x1a87bc){if(!_0x1a87bc){_0x446d48[_0x1bf6('0x16')](0x194);}return _0x1a87bc;};}function handleError(_0x212962,_0x326df9){_0x326df9=_0x326df9||0x1f4;return function(_0xb89a3a){logger[_0x1bf6('0x25')](_0xb89a3a[_0x1bf6('0x26')]);if(_0xb89a3a[_0x1bf6('0x27')]){delete _0xb89a3a[_0x1bf6('0x27')];}_0x212962['status'](_0x326df9)[_0x1bf6('0x28')](_0xb89a3a);};}exports[_0x1bf6('0x29')]=function(_0x1798be,_0x2ad276){var _0x24b2fa={},_0x446865={},_0x25af2a={'count':0x0,'rows':[]};var _0x545b9a=_['map'](db[_0x1bf6('0x2a')][_0x1bf6('0x2b')],function(_0x38f320){return{'name':_0x38f320[_0x1bf6('0x2c')],'type':_0x38f320[_0x1bf6('0x2d')][_0x1bf6('0x2e')]};});_0x446865['model']=_[_0x1bf6('0x2f')](_0x545b9a,_0x1bf6('0x27'));_0x446865['query']=_[_0x1bf6('0x30')](_0x1798be[_0x1bf6('0x31')]);_0x446865[_0x1bf6('0x32')]=_['intersection'](_0x446865['model'],_0x446865[_0x1bf6('0x31')]);_0x24b2fa['attributes']=_[_0x1bf6('0x33')](_0x446865[_0x1bf6('0x34')],qs[_0x1bf6('0x35')](_0x1798be[_0x1bf6('0x31')][_0x1bf6('0x35')]));_0x24b2fa['attributes']=_0x24b2fa[_0x1bf6('0x36')]['length']?_0x24b2fa['attributes']:_0x446865[_0x1bf6('0x34')];if(!_0x1798be[_0x1bf6('0x31')]['hasOwnProperty'](_0x1bf6('0x37'))){_0x24b2fa[_0x1bf6('0x1c')]=qs[_0x1bf6('0x1c')](_0x1798be[_0x1bf6('0x31')][_0x1bf6('0x1c')]);_0x24b2fa[_0x1bf6('0x1b')]=qs[_0x1bf6('0x1b')](_0x1798be['query']['offset']);}_0x24b2fa[_0x1bf6('0x38')]=qs[_0x1bf6('0x39')](_0x1798be[_0x1bf6('0x31')][_0x1bf6('0x39')]);_0x24b2fa[_0x1bf6('0x3a')]=qs[_0x1bf6('0x32')](_[_0x1bf6('0x3b')](_0x1798be[_0x1bf6('0x31')],_0x446865['filters']),_0x545b9a);if(_0x1798be[_0x1bf6('0x31')][_0x1bf6('0x3c')]){_0x24b2fa[_0x1bf6('0x3a')]=_['merge'](_0x24b2fa[_0x1bf6('0x3a')],{'$or':_[_0x1bf6('0x2f')](_0x545b9a,function(_0x2192f3){if(_0x2192f3['type']!=='VIRTUAL'){var _0x150cdd={};_0x150cdd[_0x2192f3['name']]={'$like':'%'+_0x1798be['query']['filter']+'%'};return _0x150cdd;}})});}_0x24b2fa=_[_0x1bf6('0x3d')]({},_0x24b2fa,_0x1798be[_0x1bf6('0x3e')]);var _0x4a093b={'where':_0x24b2fa[_0x1bf6('0x3a')]};return db[_0x1bf6('0x2a')][_0x1bf6('0x1a')](_0x4a093b)[_0x1bf6('0x20')](function(_0x4499a2){_0x25af2a[_0x1bf6('0x1a')]=_0x4499a2;if(_0x1798be[_0x1bf6('0x31')][_0x1bf6('0x3f')]){_0x24b2fa[_0x1bf6('0x40')]=[{'all':!![]}];}return db[_0x1bf6('0x2a')][_0x1bf6('0x41')](_0x24b2fa);})[_0x1bf6('0x20')](function(_0xcaf87a){_0x25af2a[_0x1bf6('0x42')]=_0xcaf87a;return _0x25af2a;})[_0x1bf6('0x20')](respondWithFilteredResult(_0x2ad276,_0x24b2fa))[_0x1bf6('0x43')](handleError(_0x2ad276,null));};exports['show']=function(_0x30eb81,_0xe05544){var _0x6b37a={'raw':!![],'where':{'id':_0x30eb81[_0x1bf6('0x44')]['id']}},_0x406e4b={};_0x406e4b['model']=_['keys'](db[_0x1bf6('0x2a')][_0x1bf6('0x2b')]);_0x406e4b[_0x1bf6('0x31')]=_['keys'](_0x30eb81[_0x1bf6('0x31')]);_0x406e4b[_0x1bf6('0x32')]=_[_0x1bf6('0x33')](_0x406e4b['model'],_0x406e4b[_0x1bf6('0x31')]);_0x6b37a['attributes']=_[_0x1bf6('0x33')](_0x406e4b[_0x1bf6('0x34')],qs[_0x1bf6('0x35')](_0x30eb81[_0x1bf6('0x31')][_0x1bf6('0x35')]));_0x6b37a[_0x1bf6('0x36')]=_0x6b37a[_0x1bf6('0x36')][_0x1bf6('0x45')]?_0x6b37a[_0x1bf6('0x36')]:_0x406e4b[_0x1bf6('0x34')];if(_0x30eb81['query']['includeAll']){_0x6b37a[_0x1bf6('0x40')]=[{'all':!![]}];}_0x6b37a=_['merge']({},_0x6b37a,_0x30eb81[_0x1bf6('0x3e')]);return db[_0x1bf6('0x2a')][_0x1bf6('0x46')](_0x6b37a)[_0x1bf6('0x20')](handleEntityNotFound(_0xe05544,null))[_0x1bf6('0x20')](respondWithResult(_0xe05544,null))[_0x1bf6('0x43')](handleError(_0xe05544,null));};exports[_0x1bf6('0x47')]=function(_0xb32083,_0x528c11){return db['AnalyticDefaultReport']['create'](_0xb32083[_0x1bf6('0x48')],{})[_0x1bf6('0x20')](function(_0x272a39){var _0x101a55=_0xb32083[_0x1bf6('0x49')]['get']({'plain':!![]});if(!_0x101a55)throw new Error(_0x1bf6('0x4a'));if(_0x101a55[_0x1bf6('0x4b')]===_0x1bf6('0x49')){var _0x5717fd=_0x272a39[_0x1bf6('0x22')]({'plain':!![]});var _0x476fb1='Reports';return db[_0x1bf6('0x4c')][_0x1bf6('0x46')]({'where':{'name':_0x476fb1,'userProfileId':_0x101a55[_0x1bf6('0x4d')]},'raw':!![]})[_0x1bf6('0x20')](function(_0x1713ea){if(_0x1713ea&&_0x1713ea[_0x1bf6('0x4e')]===0x0){return db[_0x1bf6('0x24')][_0x1bf6('0x47')]({'name':_0x5717fd[_0x1bf6('0x27')],'resourceId':_0x5717fd['id'],'type':_0x1bf6('0x23'),'sectionId':_0x1713ea['id']},{})['then'](function(){return _0x272a39;});}else{return _0x272a39;}})[_0x1bf6('0x43')](function(_0x11f797){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11f797);throw _0x11f797;});}return _0x272a39;})['then'](respondWithResult(_0x528c11,0xc9))['catch'](handleError(_0x528c11,null));};exports[_0x1bf6('0x4f')]=function(_0xd6a351,_0x3349b4){if(_0xd6a351[_0x1bf6('0x48')]['id']){delete _0xd6a351[_0x1bf6('0x48')]['id'];}return db[_0x1bf6('0x2a')][_0x1bf6('0x46')]({'where':{'id':_0xd6a351[_0x1bf6('0x44')]['id']}})[_0x1bf6('0x20')](handleEntityNotFound(_0x3349b4,null))[_0x1bf6('0x20')](saveUpdates(_0xd6a351['body'],null))['then'](respondWithResult(_0x3349b4,null))[_0x1bf6('0x43')](handleError(_0x3349b4,null));};exports['destroy']=function(_0x5b8d97,_0x203cd6){return db[_0x1bf6('0x2a')][_0x1bf6('0x46')]({'where':{'id':_0x5b8d97['params']['id']}})['then'](handleEntityNotFound(_0x203cd6,null))[_0x1bf6('0x20')](removeEntity(_0x203cd6,null))['catch'](handleError(_0x203cd6,null));};exports[_0x1bf6('0x50')]=function(_0x112fc4,_0x3be492){var _0x477159=0xa;var _0x2e23eb=[_0x1bf6('0x51'),'left_join',_0x1bf6('0x52'),'cross_join'];var _0x5eb871={'SUM':_0x1bf6('0x53'),'COUNT':_0x1bf6('0x54'),'COUNT DISTINCT':_0x1bf6('0x55'),'MAX':_0x1bf6('0x56'),'MIN':_0x1bf6('0x57'),'AVG':_0x1bf6('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1bf6('0x59'),'GROUP_CONCAT DESC':_0x1bf6('0x5a')};var _0x220054={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1bf6('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1bf6('0x5c')};var _0x403a40=function(_0x2f8285){return!_[_0x1bf6('0x5d')]([_0x1bf6('0x5e'),_0x1bf6('0x5f'),'IS\x20EMPTY',_0x1bf6('0x60')],_0x2f8285);};var _0x43aa62=function(_0x176730){if(!_0x176730||!_0x176730[_0x1bf6('0x61')][_0x1bf6('0x45')]){return'';}for(var _0x321dc6='(',_0x92f141=0x0;_0x92f141<_0x176730[_0x1bf6('0x61')]['length'];_0x92f141+=0x1){_0x92f141>0x0&&(_0x321dc6+='\x20'+_0x176730[_0x1bf6('0x62')]+'\x20');_0x321dc6+=_0x176730[_0x1bf6('0x61')][_0x92f141][_0x1bf6('0x63')]?_0x43aa62(_0x176730['rules'][_0x92f141]['group']):_0x176730['rules'][_0x92f141][_0x1bf6('0x64')]+'\x20'+_0x176730[_0x1bf6('0x61')][_0x92f141]['condition']+(_0x403a40(_0x176730[_0x1bf6('0x61')][_0x92f141][_0x1bf6('0x65')])?'\x20'+_0x176730['rules'][_0x92f141][_0x1bf6('0x66')]:'');}return _0x321dc6+')';};var _0x504013={'where':{'id':_0x112fc4['params']['id']}},_0x4cebf6,_0x1cdab4,_0x50de64,_0xa56b24,_0x2f944a;_0x504013=_[_0x1bf6('0x3d')]({},_0x504013,_0x112fc4[_0x1bf6('0x3e')]);return db[_0x1bf6('0x2a')][_0x1bf6('0x46')](_0x504013)[_0x1bf6('0x20')](function(_0xc263b1){if(_0xc263b1){_0x4cebf6=_0xc263b1;return _0xc263b1[_0x1bf6('0x67')]();}return null;})['then'](function(_0xb00c20){if(_0xb00c20){if(!_0xb00c20[_0x1bf6('0x45')]){throw new db['Sequelize'][(_0x1bf6('0x68'))](_0x1bf6('0x69'),0x193);}_0x1cdab4=_0xb00c20;return db[_0x1bf6('0x6a')][_0x1bf6('0x41')]({'raw':!![]});}return null;})[_0x1bf6('0x20')](function(_0x204365){if(_0x204365){_0x50de64=_[_0x1bf6('0x6b')](_0x204365,'id');var _0x41d60c;var _0x418054=squel['select']();_0x418054['from'](_0x4cebf6[_0x1bf6('0x6c')]);for(var _0x1a7a5e=0x0;_0x1a7a5e<_0x1cdab4[_0x1bf6('0x45')];_0x1a7a5e+=0x1){_0x41d60c=_0x1cdab4[_0x1a7a5e]['MetricId']?_0x50de64[_0x1cdab4[_0x1a7a5e][_0x1bf6('0x6d')]]['metric']:_0x1cdab4[_0x1a7a5e][_0x1bf6('0x64')];_0x41d60c=_0x1cdab4[_0x1a7a5e]['function']?_['replace'](_0x5eb871[_0x1cdab4[_0x1a7a5e][_0x1bf6('0x6e')]],'%s',_0x41d60c):_0x41d60c;_0x41d60c=_0x1cdab4[_0x1a7a5e]['format']?_[_0x1bf6('0x6f')](_0x220054[_0x1cdab4[_0x1a7a5e]['format']],'%s',_0x41d60c):_0x41d60c;if(_0x1cdab4[_0x1a7a5e]['groupBy']){_0x418054[_0x1bf6('0x63')](_0x41d60c);}_0x1cdab4[_0x1a7a5e][_0x1bf6('0x70')]&&_0x418054[_0x1bf6('0x38')](_0x41d60c,_0x1cdab4[_0x1a7a5e][_0x1bf6('0x70')]==='DESC'?![]:!![]);_0x418054[_0x1bf6('0x64')](_0x41d60c,_0x1cdab4[_0x1a7a5e][_0x1bf6('0x71')]||_0x41d60c);}if(_0x4cebf6[_0x1bf6('0x72')]){_0x4cebf6[_0x1bf6('0x72')]=JSON[_0x1bf6('0x73')](_0x4cebf6[_0x1bf6('0x72')]);for(var _0x5c3c48=0x0;_0x5c3c48<_0x4cebf6[_0x1bf6('0x72')][_0x1bf6('0x45')];_0x5c3c48+=0x1){if(_0x4cebf6['joins'][_0x5c3c48]['type']&&_['includes'](_0x2e23eb,_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x2d')])&&_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x74')]&&_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x75')]&&_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x76')]){_0x418054[_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x2d')]](_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48]['foreignTable'],null,util[_0x1bf6('0x77')](_0x1bf6('0x78'),_0x4cebf6[_0x1bf6('0x6c')],_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x74')],_0x4cebf6[_0x1bf6('0x72')][_0x5c3c48][_0x1bf6('0x75')],_0x4cebf6['joins'][_0x5c3c48]['foreignKey']));}}}if(_0x4cebf6[_0x1bf6('0x79')]){_0x4cebf6[_0x1bf6('0x79')]=JSON[_0x1bf6('0x73')](_0x4cebf6[_0x1bf6('0x79')]);_0x418054['where'](_0x43aa62(_0x4cebf6[_0x1bf6('0x79')]['group']));}_0x2f944a=_0x418054[_0x1bf6('0x7a')]();_0x418054[_0x1bf6('0x1c')](_0x477159);_0x418054['offset'](0x0);logger['debug'](_0x1bf6('0x7b'),_0x418054['toString']());return db[_0x1bf6('0x7c')][_0x1bf6('0x31')](_0x418054['toString'](),{'type':db['sequelize'][_0x1bf6('0x7d')]['SELECT']});}})[_0x1bf6('0x20')](respondWithResult(_0x3be492,null))['catch'](handleError(_0x3be492,null));};function runReport(_0x485d88,_0x34cd7e,_0x58c3aa){var _0x35ade8=_0x34cd7e[_0x1bf6('0x27')];var _0x3694d2=0xa;var _0x453a3d=['join','left_join',_0x1bf6('0x52'),_0x1bf6('0x7e')];var _0x5f1cbe={'SUM':_0x1bf6('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1bf6('0x56'),'MIN':_0x1bf6('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1bf6('0x7f'),'GROUP_CONCAT ASC':_0x1bf6('0x59'),'GROUP_CONCAT DESC':_0x1bf6('0x5a')};var _0x2aa3fc={'SEC_TO_TIME':_0x1bf6('0x80'),'DATE':_0x1bf6('0x5b'),'HOUR':_0x1bf6('0x81'),'ROUND':_0x1bf6('0x82'),'UNIX_TIMESTAMP':_0x1bf6('0x5c')};var _0x29df0a=function(_0x2526be){return!_[_0x1bf6('0x5d')]([_0x1bf6('0x5e'),'IS\x20NOT\x20NULL',_0x1bf6('0x83'),_0x1bf6('0x60')],_0x2526be);};var _0xeb3e10=function(_0x1da9f4){if(!_0x1da9f4||!_0x1da9f4[_0x1bf6('0x61')][_0x1bf6('0x45')]){return'';}for(var _0x555fc1='(',_0x2739ee=0x0;_0x2739ee<_0x1da9f4[_0x1bf6('0x61')][_0x1bf6('0x45')];_0x2739ee+=0x1){_0x2739ee>0x0&&(_0x555fc1+='\x20'+_0x1da9f4['operator']+'\x20');_0x555fc1+=_0x1da9f4[_0x1bf6('0x61')][_0x2739ee]['group']?_0xeb3e10(_0x1da9f4['rules'][_0x2739ee][_0x1bf6('0x63')]):_0x1da9f4[_0x1bf6('0x61')][_0x2739ee]['field']+'\x20'+_0x1da9f4[_0x1bf6('0x61')][_0x2739ee][_0x1bf6('0x65')]+(_0x29df0a(_0x1da9f4[_0x1bf6('0x61')][_0x2739ee][_0x1bf6('0x65')])?'\x20'+_0x1da9f4[_0x1bf6('0x61')][_0x2739ee][_0x1bf6('0x66')]:'');}return _0x555fc1+')';};var _0x2dd85d={'where':{'id':_0x485d88['id']}},_0x2b441a,_0xf3ffa4,_0x26343d,_0x41ebe2,_0x17f59e;_0x2dd85d=_['merge']({},_0x2dd85d,_0x58c3aa);return db[_0x1bf6('0x2a')][_0x1bf6('0x46')](_0x2dd85d)[_0x1bf6('0x20')](function(_0x4cfe73){if(_0x4cfe73){_0x2b441a=_0x4cfe73;return _0x4cfe73[_0x1bf6('0x67')]();}return null;})[_0x1bf6('0x20')](function(_0x5d8b21){if(_0x5d8b21){if(!_0x5d8b21[_0x1bf6('0x45')]){throw new db['Sequelize'][(_0x1bf6('0x68'))](_0x1bf6('0x69'),0x193);}_0xf3ffa4=_0x5d8b21;return db[_0x1bf6('0x6a')][_0x1bf6('0x41')]({'raw':!![]});}return null;})[_0x1bf6('0x20')](function(_0x11ef52){if(_0x11ef52){_0x26343d=_[_0x1bf6('0x6b')](_0x11ef52,'id');var _0xf5933c;var _0x33d331=squel[_0x1bf6('0x84')]();_0x33d331[_0x1bf6('0x85')](_0x2b441a[_0x1bf6('0x6c')]);for(var _0xfe3987=0x0;_0xfe3987<_0xf3ffa4[_0x1bf6('0x45')];_0xfe3987+=0x1){_0xf5933c=_0xf3ffa4[_0xfe3987][_0x1bf6('0x6d')]?_0x26343d[_0xf3ffa4[_0xfe3987][_0x1bf6('0x6d')]][_0x1bf6('0x86')]:_0xf3ffa4[_0xfe3987]['field'];_0xf5933c=_0xf3ffa4[_0xfe3987][_0x1bf6('0x6e')]?_[_0x1bf6('0x6f')](_0x5f1cbe[_0xf3ffa4[_0xfe3987]['function']],'%s',_0xf5933c):_0xf5933c;_0xf5933c=_0xf3ffa4[_0xfe3987]['format']?_[_0x1bf6('0x6f')](_0x2aa3fc[_0xf3ffa4[_0xfe3987]['format']],'%s',_0xf5933c):_0xf5933c;if(_0xf3ffa4[_0xfe3987][_0x1bf6('0x87')]){_0x33d331[_0x1bf6('0x63')](_0xf5933c);}_0xf3ffa4[_0xfe3987][_0x1bf6('0x70')]&&_0x33d331[_0x1bf6('0x38')](_0xf5933c,_0xf3ffa4[_0xfe3987]['orderBy']===_0x1bf6('0x88')?![]:!![]);_0x33d331[_0x1bf6('0x64')](_0xf5933c,_0xf3ffa4[_0xfe3987][_0x1bf6('0x71')]||_0xf5933c);}if(_0x2b441a[_0x1bf6('0x72')]){_0x2b441a[_0x1bf6('0x72')]=JSON[_0x1bf6('0x73')](_0x2b441a[_0x1bf6('0x72')]);for(var _0x1db08e=0x0;_0x1db08e<_0x2b441a['joins'][_0x1bf6('0x45')];_0x1db08e+=0x1){if(_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x2d')]&&_[_0x1bf6('0x5d')](_0x453a3d,_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x2d')])&&_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x74')]&&_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x75')]&&_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x76')]){_0x33d331[_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x2d')]](_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x75')],null,util[_0x1bf6('0x77')](_0x1bf6('0x78'),_0x2b441a['table'],_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x74')],_0x2b441a[_0x1bf6('0x72')][_0x1db08e][_0x1bf6('0x75')],_0x2b441a['joins'][_0x1db08e]['foreignKey']));}}}if(_0x2b441a[_0x1bf6('0x79')]){_0x2b441a[_0x1bf6('0x79')]=JSON[_0x1bf6('0x73')](_0x2b441a[_0x1bf6('0x79')]);_0x33d331[_0x1bf6('0x3a')](_0xeb3e10(_0x2b441a[_0x1bf6('0x79')]['group']));}_0x17f59e=_0x33d331[_0x1bf6('0x7a')]();_0x33d331[_0x1bf6('0x1c')](_0x3694d2);_0x33d331[_0x1bf6('0x1b')](0x0);logger[_0x1bf6('0x89')](_0x1bf6('0x7b'),_0x33d331[_0x1bf6('0x8a')]());return db[_0x1bf6('0x7c')][_0x1bf6('0x31')](_0x33d331[_0x1bf6('0x8a')](),{'type':db[_0x1bf6('0x7c')][_0x1bf6('0x7d')][_0x1bf6('0x8b')]});}})[_0x1bf6('0x20')](function(_0x25c7be){if(!_0x25c7be[_0x1bf6('0x45')]){throw new db[(_0x1bf6('0x8c'))][(_0x1bf6('0x68'))](_0x1bf6('0x8d'),0xcc);}if(_0x34cd7e['output']===_0x1bf6('0x8e')){return null;}var _0x252c6e=_[_0x1bf6('0x3d')](_0x34cd7e,{'name':_0x34cd7e['fullPath']||_0x34cd7e[_0x1bf6('0x27')]||_0x2b441a[_0x1bf6('0x27')],'basename':_0x35ade8,'savename':util[_0x1bf6('0x77')](_0x1bf6('0x8f'),_0x34cd7e[_0x1bf6('0x27')]||_0x2b441a[_0x1bf6('0x27')],require(_0x1bf6('0x90'))[_0x1bf6('0x91')](0x4),_0x34cd7e[_0x1bf6('0x92')]||'csv'),'reportId':_0x2b441a['id'],'reportType':_0x1bf6('0x93')});return db['AnalyticExtractedReport'][_0x1bf6('0x47')](_0x252c6e,{'raw':!![]});})[_0x1bf6('0x20')](function(_0x1c3558){if(_0x2b441a[_0x1bf6('0x6c')]===_0x1bf6('0x94')){_0x17f59e[_0x1bf6('0x3a')](_0x2b441a[_0x1bf6('0x6c')]+_0x1bf6('0x95'),_0x34cd7e[_0x1bf6('0x96')],_0x34cd7e[_0x1bf6('0x97')]);}else{_0x17f59e[_0x1bf6('0x3a')](_0x2b441a['table']+_0x1bf6('0x98'),_0x34cd7e[_0x1bf6('0x96')],_0x34cd7e[_0x1bf6('0x97')]);}if(_0x1c3558){logger[_0x1bf6('0x99')](_0x1bf6('0x9a'),_0x17f59e[_0x1bf6('0x8a')]());require(_0x1bf6('0x9b'))[_0x1bf6('0x9c')](path[_0x1bf6('0x51')](__dirname,_0x1bf6('0x9d'),_0x1c3558[_0x1bf6('0x92')]),[_0x1c3558['id'],_0x17f59e['toString'](),path['join'](__dirname,_0x1bf6('0x9e'),_0x1c3558[_0x1bf6('0x9f')]),_0x35ade8]);return _0x1c3558;}else{var _0x121896=squel['select']();_0x121896[_0x1bf6('0x85')]('('+_0x17f59e['toString']()+')','countTable');_0x121896[_0x1bf6('0x64')](_0x1bf6('0xa0'),_0x1bf6('0x1a'));_0x17f59e[_0x1bf6('0x1c')](_0x34cd7e[_0x1bf6('0x1c')]||_0x3694d2);_0x17f59e[_0x1bf6('0x1b')](_0x34cd7e['offset']||0x0);return dbH[_0x1bf6('0x7c')]['query'](_0x121896[_0x1bf6('0x8a')](),{'type':dbH[_0x1bf6('0x7c')][_0x1bf6('0x7d')][_0x1bf6('0x8b')]})[_0x1bf6('0x20')](function(_0xce157c){if(!_0xce157c['length']){_0x41ebe2=0x0;}else{_0x41ebe2=_0xce157c[0x0][_0x1bf6('0x1a')]||0x0;}return dbH[_0x1bf6('0x7c')][_0x1bf6('0x31')](_0x17f59e[_0x1bf6('0x8a')](),{'type':dbH[_0x1bf6('0x7c')]['QueryTypes'][_0x1bf6('0x8b')]});})[_0x1bf6('0x20')](function(_0x163502){return{'rows':_0x163502||[],'count':_0x41ebe2};});}});}exports[_0x1bf6('0xa1')]=function(_0x328bd4,_0x342b60){return runReport(_0x328bd4[_0x1bf6('0x44')],_0x328bd4['query'],_0x328bd4[_0x1bf6('0x3e')])[_0x1bf6('0x20')](respondWithResult(_0x342b60,null))[_0x1bf6('0x43')](handleError(_0x342b60,null));};exports[_0x1bf6('0xa2')]=runReport;exports[_0x1bf6('0x31')]=function(_0xf64ddb,_0x2d4930){var _0x257f78=0xa;var _0xc840e0=['join',_0x1bf6('0xa3'),'right_join','cross_join'];var _0x12b5a6={'SUM':_0x1bf6('0x53'),'COUNT':_0x1bf6('0x54'),'COUNT DISTINCT':_0x1bf6('0x55'),'MAX':_0x1bf6('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x1bf6('0x7f'),'GROUP_CONCAT ASC':_0x1bf6('0x59'),'GROUP_CONCAT DESC':_0x1bf6('0x5a')};var _0x5da655={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1bf6('0x5b'),'HOUR':_0x1bf6('0x81'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x450c86=function(_0x1e16bf){return!_[_0x1bf6('0x5d')]([_0x1bf6('0x5e'),'IS\x20NOT\x20NULL',_0x1bf6('0x83'),'IS\x20NOT\x20EMPTY'],_0x1e16bf);};var _0x475621=function(_0x16e7d8){if(!_0x16e7d8||!_0x16e7d8[_0x1bf6('0x61')][_0x1bf6('0x45')]){return'';}for(var _0x3aab23='(',_0xe2ac56=0x0;_0xe2ac56<_0x16e7d8[_0x1bf6('0x61')][_0x1bf6('0x45')];_0xe2ac56+=0x1){_0xe2ac56>0x0&&(_0x3aab23+='\x20'+_0x16e7d8[_0x1bf6('0x62')]+'\x20');_0x3aab23+=_0x16e7d8[_0x1bf6('0x61')][_0xe2ac56][_0x1bf6('0x63')]?_0x475621(_0x16e7d8['rules'][_0xe2ac56][_0x1bf6('0x63')]):_0x16e7d8[_0x1bf6('0x61')][_0xe2ac56][_0x1bf6('0x64')]+'\x20'+_0x16e7d8[_0x1bf6('0x61')][_0xe2ac56][_0x1bf6('0x65')]+(_0x450c86(_0x16e7d8[_0x1bf6('0x61')][_0xe2ac56]['condition'])?'\x20'+_0x16e7d8['rules'][_0xe2ac56][_0x1bf6('0x66')]:'');}return _0x3aab23+')';};var _0x1ac02e={'where':{'id':_0xf64ddb[_0x1bf6('0x44')]['id']}},_0x469fcc,_0x313a04,_0x389285,_0xef2957,_0x41b070;_0x1ac02e=_[_0x1bf6('0x3d')]({},_0x1ac02e,_0xf64ddb[_0x1bf6('0x3e')]);return db[_0x1bf6('0x2a')][_0x1bf6('0x46')](_0x1ac02e)['then'](function(_0x166814){if(_0x166814){_0x469fcc=_0x166814;return _0x166814[_0x1bf6('0x67')]();}return null;})[_0x1bf6('0x20')](function(_0x5276e9){if(_0x5276e9){if(!_0x5276e9[_0x1bf6('0x45')]){throw new db[(_0x1bf6('0x8c'))][(_0x1bf6('0x68'))](_0x1bf6('0x69'),0x193);}_0x313a04=_0x5276e9;return db[_0x1bf6('0x6a')][_0x1bf6('0x41')]({'raw':!![]});}return null;})[_0x1bf6('0x20')](function(_0x541742){if(_0x541742){_0x389285=_[_0x1bf6('0x6b')](_0x541742,'id');var _0x14ad37;var _0x13e2f1=squel[_0x1bf6('0x84')]();_0x13e2f1[_0x1bf6('0x85')](_0x469fcc['table']);for(var _0x3bd4ba=0x0;_0x3bd4ba<_0x313a04[_0x1bf6('0x45')];_0x3bd4ba+=0x1){_0x14ad37=_0x313a04[_0x3bd4ba][_0x1bf6('0x6d')]?_0x389285[_0x313a04[_0x3bd4ba]['MetricId']][_0x1bf6('0x86')]:_0x313a04[_0x3bd4ba]['field'];_0x14ad37=_0x313a04[_0x3bd4ba][_0x1bf6('0x6e')]?_[_0x1bf6('0x6f')](_0x12b5a6[_0x313a04[_0x3bd4ba][_0x1bf6('0x6e')]],'%s',_0x14ad37):_0x14ad37;_0x14ad37=_0x313a04[_0x3bd4ba][_0x1bf6('0x77')]?_['replace'](_0x5da655[_0x313a04[_0x3bd4ba][_0x1bf6('0x77')]],'%s',_0x14ad37):_0x14ad37;if(_0x313a04[_0x3bd4ba][_0x1bf6('0x87')]){_0x13e2f1[_0x1bf6('0x63')](_0x14ad37);}_0x313a04[_0x3bd4ba][_0x1bf6('0x70')]&&_0x13e2f1['order'](_0x14ad37,_0x313a04[_0x3bd4ba][_0x1bf6('0x70')]===_0x1bf6('0x88')?![]:!![]);_0x13e2f1['field'](_0x14ad37,_0x313a04[_0x3bd4ba][_0x1bf6('0x71')]||_0x14ad37);}if(_0x469fcc[_0x1bf6('0x72')]){_0x469fcc[_0x1bf6('0x72')]=JSON[_0x1bf6('0x73')](_0x469fcc[_0x1bf6('0x72')]);for(var _0x1f69a9=0x0;_0x1f69a9<_0x469fcc[_0x1bf6('0x72')][_0x1bf6('0x45')];_0x1f69a9+=0x1){if(_0x469fcc[_0x1bf6('0x72')][_0x1f69a9][_0x1bf6('0x2d')]&&_[_0x1bf6('0x5d')](_0xc840e0,_0x469fcc[_0x1bf6('0x72')][_0x1f69a9][_0x1bf6('0x2d')])&&_0x469fcc[_0x1bf6('0x72')][_0x1f69a9]['parentKey']&&_0x469fcc[_0x1bf6('0x72')][_0x1f69a9]['foreignTable']&&_0x469fcc['joins'][_0x1f69a9][_0x1bf6('0x76')]){_0x13e2f1[_0x469fcc[_0x1bf6('0x72')][_0x1f69a9][_0x1bf6('0x2d')]](_0x469fcc[_0x1bf6('0x72')][_0x1f69a9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x469fcc[_0x1bf6('0x6c')],_0x469fcc[_0x1bf6('0x72')][_0x1f69a9][_0x1bf6('0x74')],_0x469fcc['joins'][_0x1f69a9][_0x1bf6('0x75')],_0x469fcc[_0x1bf6('0x72')][_0x1f69a9][_0x1bf6('0x76')]));}}}if(_0x469fcc[_0x1bf6('0x79')]){_0x469fcc[_0x1bf6('0x79')]=JSON['parse'](_0x469fcc['conditions']);_0x13e2f1[_0x1bf6('0x3a')](_0x475621(_0x469fcc['conditions'][_0x1bf6('0x63')]));}_0x41b070=_0x13e2f1[_0x1bf6('0x7a')]();_0x13e2f1[_0x1bf6('0x1c')](_0x257f78);_0x13e2f1['offset'](0x0);logger[_0x1bf6('0x89')](_0x1bf6('0x7b'),_0x13e2f1[_0x1bf6('0x8a')]());return db[_0x1bf6('0x7c')][_0x1bf6('0x31')](_0x13e2f1[_0x1bf6('0x8a')](),{'type':db[_0x1bf6('0x7c')]['QueryTypes']['SELECT']});}})[_0x1bf6('0x20')](function(){return{'sql':_0x41b070[_0x1bf6('0x8a')]()};})[_0x1bf6('0x20')](respondWithResult(_0x2d4930,null))[_0x1bf6('0x43')](handleError(_0x2d4930,null));}; \ No newline at end of file +var _0x5590=['bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','end','json','count','offset','limit','status','set','reject','save','then','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticDefaultReport','includeAll','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','preview','join','right_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)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','parse','joins','foreignKey','foreignTable','parentKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','getFields','ValidationErrorItem','findAll','%s.%s\x20=\x20%s.%s','clone','SELECT','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','left_join','HOUR(%s)','html-pdf','eml-format','fast-json-patch','request-promise','moment'];(function(_0x2b8911,_0x563ff5){var _0xe81db6=function(_0x4e1285){while(--_0x4e1285){_0x2b8911['push'](_0x2b8911['shift']());}};_0xe81db6(++_0x563ff5);}(_0x5590,0xa3));var _0x0559=function(_0x20dc55,_0x1c5f3f){_0x20dc55=_0x20dc55-0x0;var _0x165ff7=_0x5590[_0x20dc55];return _0x165ff7;};'use strict';var pdf=require(_0x0559('0x0'));var emlformat=require(_0x0559('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0559('0x2'));var rp=require(_0x0559('0x3'));var moment=require(_0x0559('0x4'));var BPromise=require(_0x0559('0x5'));var Mustache=require(_0x0559('0x6'));var util=require(_0x0559('0x7'));var path=require(_0x0559('0x8'));var sox=require('sox');var csv=require(_0x0559('0x9'));var ejs=require(_0x0559('0xa'));var fs=require('fs');var _=require(_0x0559('0xb'));var squel=require('squel');var crypto=require(_0x0559('0xc'));var jsforce=require(_0x0559('0xd'));var deskjs=require(_0x0559('0xe'));var toCsv=require(_0x0559('0x9'));var querystring=require(_0x0559('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0559('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0559('0x11'));var hardwareService=require(_0x0559('0x12'));var logger=require(_0x0559('0x13'))(_0x0559('0x14'));var utils=require('../../config/utils');var config=require(_0x0559('0x15'));var db=require(_0x0559('0x16'))['db'];var dbH=require(_0x0559('0x16'))[_0x0559('0x17')];function respondWithStatusCode(_0x1162c0,_0xf80638){_0xf80638=_0xf80638||0xcc;return function(_0x2e4ff9){if(_0x2e4ff9){return _0x1162c0['sendStatus'](_0xf80638);}return _0x1162c0['status'](_0xf80638)[_0x0559('0x18')]();};}function respondWithResult(_0x79c83b,_0x11f3cc){_0x11f3cc=_0x11f3cc||0xc8;return function(_0x1448a4){if(_0x1448a4){return _0x79c83b['status'](_0x11f3cc)[_0x0559('0x19')](_0x1448a4);}};}function respondWithFilteredResult(_0x375bee,_0x3e700e){return function(_0x55a608){if(_0x55a608){var _0x248c8b=_0x55a608[_0x0559('0x1a')],_0x149322=_0x3e700e[_0x0559('0x1b')],_0x1121ed=_0x3e700e[_0x0559('0x1b')]+_0x3e700e[_0x0559('0x1c')],_0x395afa;if(_0x1121ed>=_0x248c8b){_0x1121ed=_0x248c8b;_0x395afa=0xc8;}else{_0x395afa=0xce;}_0x375bee[_0x0559('0x1d')](_0x395afa);return _0x375bee[_0x0559('0x1e')]('Content-Range',_0x149322+'-'+_0x1121ed+'/'+_0x248c8b)[_0x0559('0x19')](_0x55a608);}return null;};}function patchUpdates(_0xddf64c){return function(_0x1e77f9){try{jsonpatch['apply'](_0x1e77f9,_0xddf64c,!![]);}catch(_0x55110e){return BPromise[_0x0559('0x1f')](_0x55110e);}return _0x1e77f9[_0x0559('0x20')]();};}function saveUpdates(_0x19612e,_0x1ac2ca){return function(_0x1e3d88){if(_0x1e3d88){return _0x1e3d88['update'](_0x19612e)[_0x0559('0x21')](function(_0x30e39d){return _0x30e39d;});}return null;};}function removeEntity(_0x5bb773,_0x5eec86){return function(_0x181378){if(_0x181378){return _0x181378['destroy']()[_0x0559('0x21')](function(){var _0x3afdc3=_0x181378[_0x0559('0x22')]({'plain':!![]});var _0x54cbe8=_0x0559('0x23');return db[_0x0559('0x24')]['destroy']({'where':{'type':_0x54cbe8,'resourceId':_0x3afdc3['id']}})[_0x0559('0x21')](function(){return _0x181378;});})[_0x0559('0x21')](function(){_0x5bb773[_0x0559('0x1d')](0xcc)[_0x0559('0x18')]();});}};}function handleEntityNotFound(_0x4ba079,_0xd05726){return function(_0x10b7ec){if(!_0x10b7ec){_0x4ba079[_0x0559('0x25')](0x194);}return _0x10b7ec;};}function handleError(_0x58d89f,_0xe6593a){_0xe6593a=_0xe6593a||0x1f4;return function(_0x4d3df1){logger[_0x0559('0x26')](_0x4d3df1[_0x0559('0x27')]);if(_0x4d3df1[_0x0559('0x28')]){delete _0x4d3df1['name'];}_0x58d89f[_0x0559('0x1d')](_0xe6593a)[_0x0559('0x29')](_0x4d3df1);};}exports[_0x0559('0x2a')]=function(_0x5e00e6,_0x2a6db0){var _0x5a8d68={},_0x543fdc={},_0x9b8ff4={'count':0x0,'rows':[]};var _0x51828c=_[_0x0559('0x2b')](db['AnalyticDefaultReport'][_0x0559('0x2c')],function(_0x5a6d84){return{'name':_0x5a6d84[_0x0559('0x2d')],'type':_0x5a6d84[_0x0559('0x2e')][_0x0559('0x2f')]};});_0x543fdc['model']=_['map'](_0x51828c,_0x0559('0x28'));_0x543fdc[_0x0559('0x30')]=_[_0x0559('0x31')](_0x5e00e6[_0x0559('0x30')]);_0x543fdc['filters']=_['intersection'](_0x543fdc['model'],_0x543fdc['query']);_0x5a8d68[_0x0559('0x32')]=_[_0x0559('0x33')](_0x543fdc[_0x0559('0x34')],qs['fields'](_0x5e00e6['query'][_0x0559('0x35')]));_0x5a8d68[_0x0559('0x32')]=_0x5a8d68[_0x0559('0x32')][_0x0559('0x36')]?_0x5a8d68[_0x0559('0x32')]:_0x543fdc['model'];if(!_0x5e00e6[_0x0559('0x30')][_0x0559('0x37')](_0x0559('0x38'))){_0x5a8d68['limit']=qs[_0x0559('0x1c')](_0x5e00e6[_0x0559('0x30')][_0x0559('0x1c')]);_0x5a8d68[_0x0559('0x1b')]=qs[_0x0559('0x1b')](_0x5e00e6['query']['offset']);}_0x5a8d68[_0x0559('0x39')]=qs[_0x0559('0x3a')](_0x5e00e6[_0x0559('0x30')]['sort']);_0x5a8d68[_0x0559('0x3b')]=qs[_0x0559('0x3c')](_[_0x0559('0x3d')](_0x5e00e6[_0x0559('0x30')],_0x543fdc[_0x0559('0x3c')]),_0x51828c);if(_0x5e00e6['query']['filter']){_0x5a8d68[_0x0559('0x3b')]=_[_0x0559('0x3e')](_0x5a8d68['where'],{'$or':_['map'](_0x51828c,function(_0x445424){if(_0x445424[_0x0559('0x2e')]!==_0x0559('0x3f')){var _0x29e92f={};_0x29e92f[_0x445424[_0x0559('0x28')]]={'$like':'%'+_0x5e00e6['query'][_0x0559('0x40')]+'%'};return _0x29e92f;}})});}_0x5a8d68=_['merge']({},_0x5a8d68,_0x5e00e6[_0x0559('0x41')]);var _0x31ac91={'where':_0x5a8d68['where']};return db[_0x0559('0x42')][_0x0559('0x1a')](_0x31ac91)[_0x0559('0x21')](function(_0x1a7a50){_0x9b8ff4[_0x0559('0x1a')]=_0x1a7a50;if(_0x5e00e6[_0x0559('0x30')][_0x0559('0x43')]){_0x5a8d68['include']=[{'all':!![]}];}return db[_0x0559('0x42')]['findAll'](_0x5a8d68);})['then'](function(_0x23c390){_0x9b8ff4['rows']=_0x23c390;return _0x9b8ff4;})[_0x0559('0x21')](respondWithFilteredResult(_0x2a6db0,_0x5a8d68))[_0x0559('0x44')](handleError(_0x2a6db0,null));};exports[_0x0559('0x45')]=function(_0x430e7a,_0x20b9c0){var _0x3fe3f1={'raw':!![],'where':{'id':_0x430e7a[_0x0559('0x46')]['id']}},_0x4876cb={};_0x4876cb[_0x0559('0x34')]=_['keys'](db[_0x0559('0x42')]['rawAttributes']);_0x4876cb[_0x0559('0x30')]=_[_0x0559('0x31')](_0x430e7a[_0x0559('0x30')]);_0x4876cb[_0x0559('0x3c')]=_['intersection'](_0x4876cb[_0x0559('0x34')],_0x4876cb[_0x0559('0x30')]);_0x3fe3f1['attributes']=_['intersection'](_0x4876cb['model'],qs[_0x0559('0x35')](_0x430e7a[_0x0559('0x30')][_0x0559('0x35')]));_0x3fe3f1['attributes']=_0x3fe3f1[_0x0559('0x32')][_0x0559('0x36')]?_0x3fe3f1[_0x0559('0x32')]:_0x4876cb[_0x0559('0x34')];if(_0x430e7a[_0x0559('0x30')]['includeAll']){_0x3fe3f1[_0x0559('0x47')]=[{'all':!![]}];}_0x3fe3f1=_[_0x0559('0x3e')]({},_0x3fe3f1,_0x430e7a[_0x0559('0x41')]);return db[_0x0559('0x42')][_0x0559('0x48')](_0x3fe3f1)[_0x0559('0x21')](handleEntityNotFound(_0x20b9c0,null))['then'](respondWithResult(_0x20b9c0,null))[_0x0559('0x44')](handleError(_0x20b9c0,null));};exports[_0x0559('0x49')]=function(_0x585079,_0x449b7a){return db[_0x0559('0x42')][_0x0559('0x49')](_0x585079[_0x0559('0x4a')],{})[_0x0559('0x21')](function(_0x407a83){var _0x2a2778=_0x585079['user'][_0x0559('0x22')]({'plain':!![]});if(!_0x2a2778)throw new Error(_0x0559('0x4b'));if(_0x2a2778[_0x0559('0x4c')]===_0x0559('0x4d')){var _0x2c3202=_0x407a83[_0x0559('0x22')]({'plain':!![]});var _0x10b8ca=_0x0559('0x4e');return db['UserProfileSection'][_0x0559('0x48')]({'where':{'name':_0x10b8ca,'userProfileId':_0x2a2778['userProfileId']},'raw':!![]})['then'](function(_0x39c5be){if(_0x39c5be&&_0x39c5be[_0x0559('0x4f')]===0x0){return db[_0x0559('0x24')][_0x0559('0x49')]({'name':_0x2c3202[_0x0559('0x28')],'resourceId':_0x2c3202['id'],'type':_0x0559('0x23'),'sectionId':_0x39c5be['id']},{})[_0x0559('0x21')](function(){return _0x407a83;});}else{return _0x407a83;}})[_0x0559('0x44')](function(_0xe1df84){logger[_0x0559('0x26')](_0x0559('0x50'),_0xe1df84);throw _0xe1df84;});}return _0x407a83;})[_0x0559('0x21')](respondWithResult(_0x449b7a,0xc9))[_0x0559('0x44')](handleError(_0x449b7a,null));};exports[_0x0559('0x51')]=function(_0x1deb5e,_0x4a6863){if(_0x1deb5e[_0x0559('0x4a')]['id']){delete _0x1deb5e[_0x0559('0x4a')]['id'];}return db[_0x0559('0x42')][_0x0559('0x48')]({'where':{'id':_0x1deb5e[_0x0559('0x46')]['id']}})[_0x0559('0x21')](handleEntityNotFound(_0x4a6863,null))[_0x0559('0x21')](saveUpdates(_0x1deb5e[_0x0559('0x4a')],null))[_0x0559('0x21')](respondWithResult(_0x4a6863,null))[_0x0559('0x44')](handleError(_0x4a6863,null));};exports[_0x0559('0x52')]=function(_0x227344,_0x31b479){return db[_0x0559('0x42')][_0x0559('0x48')]({'where':{'id':_0x227344['params']['id']}})[_0x0559('0x21')](handleEntityNotFound(_0x31b479,null))[_0x0559('0x21')](removeEntity(_0x31b479,null))[_0x0559('0x44')](handleError(_0x31b479,null));};exports[_0x0559('0x53')]=function(_0x459932,_0x203a4d){var _0x703e0b=0xa;var _0x34a751=[_0x0559('0x54'),'left_join',_0x0559('0x55'),_0x0559('0x56')];var _0x3e45d4={'SUM':_0x0559('0x57'),'COUNT':_0x0559('0x58'),'COUNT DISTINCT':_0x0559('0x59'),'MAX':_0x0559('0x5a'),'MIN':_0x0559('0x5b'),'AVG':_0x0559('0x5c'),'GROUP_CONCAT':_0x0559('0x5d'),'GROUP_CONCAT ASC':_0x0559('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x38bfc3={'SEC_TO_TIME':_0x0559('0x5f'),'DATE':_0x0559('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x0559('0x61'),'UNIX_TIMESTAMP':_0x0559('0x62')};var _0x4e7187=function(_0x42d524){return!_[_0x0559('0x63')](['IS\x20NULL',_0x0559('0x64'),_0x0559('0x65'),_0x0559('0x66')],_0x42d524);};var _0x335726=function(_0x371f0b){if(!_0x371f0b||!_0x371f0b[_0x0559('0x67')][_0x0559('0x36')]){return'';}for(var _0x4eb636='(',_0x365108=0x0;_0x365108<_0x371f0b[_0x0559('0x67')][_0x0559('0x36')];_0x365108+=0x1){_0x365108>0x0&&(_0x4eb636+='\x20'+_0x371f0b[_0x0559('0x68')]+'\x20');_0x4eb636+=_0x371f0b[_0x0559('0x67')][_0x365108][_0x0559('0x69')]?_0x335726(_0x371f0b[_0x0559('0x67')][_0x365108]['group']):_0x371f0b['rules'][_0x365108][_0x0559('0x6a')]+'\x20'+_0x371f0b[_0x0559('0x67')][_0x365108][_0x0559('0x6b')]+(_0x4e7187(_0x371f0b['rules'][_0x365108]['condition'])?'\x20'+_0x371f0b[_0x0559('0x67')][_0x365108][_0x0559('0x6c')]:'');}return _0x4eb636+')';};var _0x3ca899={'where':{'id':_0x459932[_0x0559('0x46')]['id']}},_0xdfc5ee,_0x2ab1cf,_0x5a1338,_0x19f46a,_0x264b2e;_0x3ca899=_['merge']({},_0x3ca899,_0x459932[_0x0559('0x41')]);return db['AnalyticDefaultReport'][_0x0559('0x48')](_0x3ca899)[_0x0559('0x21')](function(_0xf9d9d){if(_0xf9d9d){_0xdfc5ee=_0xf9d9d;return _0xf9d9d['getFields']();}return null;})[_0x0559('0x21')](function(_0x117c4d){if(_0x117c4d){if(!_0x117c4d[_0x0559('0x36')]){throw new db[(_0x0559('0x6d'))]['ValidationErrorItem'](_0x0559('0x6e'),0x193);}_0x2ab1cf=_0x117c4d;return db[_0x0559('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x0559('0x21')](function(_0x4adb42){if(_0x4adb42){_0x5a1338=_[_0x0559('0x70')](_0x4adb42,'id');var _0x5d31ab;var _0x5854cb=squel[_0x0559('0x71')]();_0x5854cb[_0x0559('0x72')](_0xdfc5ee[_0x0559('0x73')]);for(var _0x2f3025=0x0;_0x2f3025<_0x2ab1cf[_0x0559('0x36')];_0x2f3025+=0x1){_0x5d31ab=_0x2ab1cf[_0x2f3025][_0x0559('0x74')]?_0x5a1338[_0x2ab1cf[_0x2f3025]['MetricId']][_0x0559('0x75')]:_0x2ab1cf[_0x2f3025][_0x0559('0x6a')];_0x5d31ab=_0x2ab1cf[_0x2f3025][_0x0559('0x76')]?_[_0x0559('0x77')](_0x3e45d4[_0x2ab1cf[_0x2f3025][_0x0559('0x76')]],'%s',_0x5d31ab):_0x5d31ab;_0x5d31ab=_0x2ab1cf[_0x2f3025][_0x0559('0x78')]?_[_0x0559('0x77')](_0x38bfc3[_0x2ab1cf[_0x2f3025]['format']],'%s',_0x5d31ab):_0x5d31ab;if(_0x2ab1cf[_0x2f3025][_0x0559('0x79')]){_0x5854cb[_0x0559('0x69')](_0x5d31ab);}_0x2ab1cf[_0x2f3025][_0x0559('0x7a')]&&_0x5854cb[_0x0559('0x39')](_0x5d31ab,_0x2ab1cf[_0x2f3025][_0x0559('0x7a')]===_0x0559('0x7b')?![]:!![]);_0x5854cb['field'](_0x5d31ab,_0x2ab1cf[_0x2f3025][_0x0559('0x7c')]||_0x5d31ab);}if(_0xdfc5ee['joins']){_0xdfc5ee['joins']=JSON[_0x0559('0x7d')](_0xdfc5ee[_0x0559('0x7e')]);for(var _0x11aaf1=0x0;_0x11aaf1<_0xdfc5ee[_0x0559('0x7e')][_0x0559('0x36')];_0x11aaf1+=0x1){if(_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1][_0x0559('0x2e')]&&_[_0x0559('0x63')](_0x34a751,_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1][_0x0559('0x2e')])&&_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1]['parentKey']&&_0xdfc5ee['joins'][_0x11aaf1]['foreignTable']&&_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1][_0x0559('0x7f')]){_0x5854cb[_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1]['type']](_0xdfc5ee['joins'][_0x11aaf1][_0x0559('0x80')],null,util[_0x0559('0x78')]('%s.%s\x20=\x20%s.%s',_0xdfc5ee[_0x0559('0x73')],_0xdfc5ee['joins'][_0x11aaf1][_0x0559('0x81')],_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1][_0x0559('0x80')],_0xdfc5ee[_0x0559('0x7e')][_0x11aaf1]['foreignKey']));}}}if(_0xdfc5ee[_0x0559('0x82')]){_0xdfc5ee['conditions']=JSON[_0x0559('0x7d')](_0xdfc5ee[_0x0559('0x82')]);_0x5854cb[_0x0559('0x3b')](_0x335726(_0xdfc5ee[_0x0559('0x82')]['group']));}_0x264b2e=_0x5854cb['clone']();_0x5854cb[_0x0559('0x1c')](_0x703e0b);_0x5854cb[_0x0559('0x1b')](0x0);logger[_0x0559('0x83')](_0x0559('0x84'),_0x5854cb[_0x0559('0x85')]());return db['sequelize']['query'](_0x5854cb[_0x0559('0x85')](),{'type':db[_0x0559('0x86')][_0x0559('0x87')]['SELECT']});}})['then'](respondWithResult(_0x203a4d,null))[_0x0559('0x44')](handleError(_0x203a4d,null));};function runReport(_0x2996ad,_0x250c40,_0x1476aa){var _0xa4d601=_0x250c40[_0x0559('0x28')];var _0x4bff15=0xa;var _0x431c28=[_0x0559('0x54'),'left_join',_0x0559('0x55'),_0x0559('0x56')];var _0x29e264={'SUM':_0x0559('0x57'),'COUNT':_0x0559('0x58'),'COUNT DISTINCT':_0x0559('0x59'),'MAX':_0x0559('0x5a'),'MIN':_0x0559('0x5b'),'AVG':_0x0559('0x5c'),'GROUP_CONCAT':_0x0559('0x5d'),'GROUP_CONCAT ASC':_0x0559('0x5e'),'GROUP_CONCAT DESC':_0x0559('0x88')};var _0x28a8c6={'SEC_TO_TIME':_0x0559('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x0559('0x61'),'UNIX_TIMESTAMP':_0x0559('0x62')};var _0x29200f=function(_0x37f2d7){return!_[_0x0559('0x63')]([_0x0559('0x89'),_0x0559('0x64'),'IS\x20EMPTY',_0x0559('0x66')],_0x37f2d7);};var _0x4b0ce9=function(_0x1f8a80){if(!_0x1f8a80||!_0x1f8a80[_0x0559('0x67')][_0x0559('0x36')]){return'';}for(var _0x259f89='(',_0xaa526d=0x0;_0xaa526d<_0x1f8a80[_0x0559('0x67')][_0x0559('0x36')];_0xaa526d+=0x1){_0xaa526d>0x0&&(_0x259f89+='\x20'+_0x1f8a80[_0x0559('0x68')]+'\x20');_0x259f89+=_0x1f8a80[_0x0559('0x67')][_0xaa526d][_0x0559('0x69')]?_0x4b0ce9(_0x1f8a80[_0x0559('0x67')][_0xaa526d][_0x0559('0x69')]):_0x1f8a80[_0x0559('0x67')][_0xaa526d]['field']+'\x20'+_0x1f8a80['rules'][_0xaa526d][_0x0559('0x6b')]+(_0x29200f(_0x1f8a80['rules'][_0xaa526d][_0x0559('0x6b')])?'\x20'+_0x1f8a80[_0x0559('0x67')][_0xaa526d][_0x0559('0x6c')]:'');}return _0x259f89+')';};var _0x1dff3d={'where':{'id':_0x2996ad['id']}},_0x1ae67e,_0x2cd6e2,_0x37b0f3,_0x513bc3,_0x44951d;_0x1dff3d=_['merge']({},_0x1dff3d,_0x1476aa);return db[_0x0559('0x42')][_0x0559('0x48')](_0x1dff3d)[_0x0559('0x21')](function(_0x1c02ab){if(_0x1c02ab){_0x1ae67e=_0x1c02ab;return _0x1c02ab[_0x0559('0x8a')]();}return null;})[_0x0559('0x21')](function(_0x43fcbe){if(_0x43fcbe){if(!_0x43fcbe[_0x0559('0x36')]){throw new db[(_0x0559('0x6d'))][(_0x0559('0x8b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2cd6e2=_0x43fcbe;return db[_0x0559('0x6f')][_0x0559('0x8c')]({'raw':!![]});}return null;})['then'](function(_0x226a5f){if(_0x226a5f){_0x37b0f3=_[_0x0559('0x70')](_0x226a5f,'id');var _0xc5ec84;var _0x34d5fa=squel[_0x0559('0x71')]();_0x34d5fa['from'](_0x1ae67e['table']);for(var _0x50cf9f=0x0;_0x50cf9f<_0x2cd6e2['length'];_0x50cf9f+=0x1){_0xc5ec84=_0x2cd6e2[_0x50cf9f]['MetricId']?_0x37b0f3[_0x2cd6e2[_0x50cf9f][_0x0559('0x74')]][_0x0559('0x75')]:_0x2cd6e2[_0x50cf9f][_0x0559('0x6a')];_0xc5ec84=_0x2cd6e2[_0x50cf9f]['function']?_['replace'](_0x29e264[_0x2cd6e2[_0x50cf9f][_0x0559('0x76')]],'%s',_0xc5ec84):_0xc5ec84;_0xc5ec84=_0x2cd6e2[_0x50cf9f][_0x0559('0x78')]?_['replace'](_0x28a8c6[_0x2cd6e2[_0x50cf9f]['format']],'%s',_0xc5ec84):_0xc5ec84;if(_0x2cd6e2[_0x50cf9f][_0x0559('0x79')]){_0x34d5fa['group'](_0xc5ec84);}_0x2cd6e2[_0x50cf9f]['orderBy']&&_0x34d5fa[_0x0559('0x39')](_0xc5ec84,_0x2cd6e2[_0x50cf9f][_0x0559('0x7a')]==='DESC'?![]:!![]);_0x34d5fa[_0x0559('0x6a')](_0xc5ec84,_0x2cd6e2[_0x50cf9f][_0x0559('0x7c')]||_0xc5ec84);}if(_0x1ae67e['joins']){_0x1ae67e[_0x0559('0x7e')]=JSON[_0x0559('0x7d')](_0x1ae67e[_0x0559('0x7e')]);for(var _0x4339f0=0x0;_0x4339f0<_0x1ae67e[_0x0559('0x7e')][_0x0559('0x36')];_0x4339f0+=0x1){if(_0x1ae67e['joins'][_0x4339f0][_0x0559('0x2e')]&&_['includes'](_0x431c28,_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x2e')])&&_0x1ae67e['joins'][_0x4339f0][_0x0559('0x81')]&&_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x80')]&&_0x1ae67e['joins'][_0x4339f0]['foreignKey']){_0x34d5fa[_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x2e')]](_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x80')],null,util[_0x0559('0x78')](_0x0559('0x8d'),_0x1ae67e[_0x0559('0x73')],_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x81')],_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x80')],_0x1ae67e[_0x0559('0x7e')][_0x4339f0][_0x0559('0x7f')]));}}}if(_0x1ae67e[_0x0559('0x82')]){_0x1ae67e['conditions']=JSON['parse'](_0x1ae67e[_0x0559('0x82')]);_0x34d5fa[_0x0559('0x3b')](_0x4b0ce9(_0x1ae67e[_0x0559('0x82')][_0x0559('0x69')]));}_0x44951d=_0x34d5fa[_0x0559('0x8e')]();_0x34d5fa['limit'](_0x4bff15);_0x34d5fa[_0x0559('0x1b')](0x0);logger['debug'](_0x0559('0x84'),_0x34d5fa[_0x0559('0x85')]());return db[_0x0559('0x86')][_0x0559('0x30')](_0x34d5fa[_0x0559('0x85')](),{'type':db[_0x0559('0x86')][_0x0559('0x87')][_0x0559('0x8f')]});}})['then'](function(_0x551563){if(!_0x551563['length']){throw new db[(_0x0559('0x6d'))][(_0x0559('0x8b'))]('No\x20available\x20data',0xcc);}if(_0x250c40[_0x0559('0x90')]===_0x0559('0x91')){return null;}var _0x2993fd=_[_0x0559('0x3e')](_0x250c40,{'name':_0x250c40[_0x0559('0x92')]||_0x250c40[_0x0559('0x28')]||_0x1ae67e[_0x0559('0x28')],'basename':_0xa4d601,'savename':util[_0x0559('0x78')]('%s-%s.%s',_0x250c40[_0x0559('0x28')]||_0x1ae67e[_0x0559('0x28')],require(_0x0559('0x93'))[_0x0559('0x94')](0x4),_0x250c40[_0x0559('0x90')]||_0x0559('0x95')),'reportId':_0x1ae67e['id'],'reportType':_0x0559('0x96')});return db[_0x0559('0x97')][_0x0559('0x49')](_0x2993fd,{'raw':!![]});})['then'](function(_0x13c655){if(_0x1ae67e[_0x0559('0x73')]===_0x0559('0x98')){_0x44951d[_0x0559('0x3b')](_0x1ae67e[_0x0559('0x73')]+_0x0559('0x99'),_0x250c40[_0x0559('0x9a')],_0x250c40['endDate']);}else{_0x44951d[_0x0559('0x3b')](_0x1ae67e[_0x0559('0x73')]+_0x0559('0x9b'),_0x250c40[_0x0559('0x9a')],_0x250c40['endDate']);}if(_0x13c655){logger[_0x0559('0x9c')](_0x0559('0x9d'),_0x44951d[_0x0559('0x85')]());require(_0x0559('0x9e'))[_0x0559('0x9f')](path[_0x0559('0x54')](__dirname,'../../components/export/',_0x13c655[_0x0559('0x90')]),[_0x13c655['id'],_0x44951d['toString'](),path[_0x0559('0x54')](__dirname,_0x0559('0xa0'),_0x13c655[_0x0559('0xa1')]),_0xa4d601]);return _0x13c655;}else{var _0x43fe3d=squel[_0x0559('0x71')]();_0x43fe3d[_0x0559('0x72')]('('+_0x44951d['toString']()+')',_0x0559('0xa2'));_0x43fe3d[_0x0559('0x6a')](_0x0559('0xa3'),_0x0559('0x1a'));_0x44951d[_0x0559('0x1c')](_0x250c40['limit']||_0x4bff15);_0x44951d['offset'](_0x250c40[_0x0559('0x1b')]||0x0);return dbH['sequelize'][_0x0559('0x30')](_0x43fe3d[_0x0559('0x85')](),{'type':dbH['sequelize'][_0x0559('0x87')][_0x0559('0x8f')]})[_0x0559('0x21')](function(_0x1d2e16){if(!_0x1d2e16['length']){_0x513bc3=0x0;}else{_0x513bc3=_0x1d2e16[0x0][_0x0559('0x1a')]||0x0;}return dbH[_0x0559('0x86')][_0x0559('0x30')](_0x44951d[_0x0559('0x85')](),{'type':dbH['sequelize'][_0x0559('0x87')][_0x0559('0x8f')]});})['then'](function(_0x44a7ef){return{'rows':_0x44a7ef||[],'count':_0x513bc3};});}});}exports[_0x0559('0xa4')]=function(_0x4783d0,_0x16880d){return runReport(_0x4783d0[_0x0559('0x46')],_0x4783d0[_0x0559('0x30')],_0x4783d0['options'])[_0x0559('0x21')](respondWithResult(_0x16880d,null))[_0x0559('0x44')](handleError(_0x16880d,null));};exports[_0x0559('0xa5')]=runReport;exports['query']=function(_0x3b72a5,_0x28eb31){var _0x233070=0xa;var _0x1bd3dc=[_0x0559('0x54'),_0x0559('0xa6'),'right_join',_0x0559('0x56')];var _0x58cf98={'SUM':_0x0559('0x57'),'COUNT':_0x0559('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0559('0x5a'),'MIN':_0x0559('0x5b'),'AVG':_0x0559('0x5c'),'GROUP_CONCAT':_0x0559('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0559('0x88')};var _0x234d22={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0559('0x60'),'HOUR':_0x0559('0xa7'),'ROUND':_0x0559('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x42e1fa=function(_0x3a4767){return!_[_0x0559('0x63')]([_0x0559('0x89'),'IS\x20NOT\x20NULL',_0x0559('0x65'),_0x0559('0x66')],_0x3a4767);};var _0x3a28ef=function(_0x58b9bd){if(!_0x58b9bd||!_0x58b9bd['rules'][_0x0559('0x36')]){return'';}for(var _0xa1c90f='(',_0x3838e6=0x0;_0x3838e6<_0x58b9bd[_0x0559('0x67')][_0x0559('0x36')];_0x3838e6+=0x1){_0x3838e6>0x0&&(_0xa1c90f+='\x20'+_0x58b9bd[_0x0559('0x68')]+'\x20');_0xa1c90f+=_0x58b9bd[_0x0559('0x67')][_0x3838e6][_0x0559('0x69')]?_0x3a28ef(_0x58b9bd[_0x0559('0x67')][_0x3838e6][_0x0559('0x69')]):_0x58b9bd['rules'][_0x3838e6][_0x0559('0x6a')]+'\x20'+_0x58b9bd[_0x0559('0x67')][_0x3838e6]['condition']+(_0x42e1fa(_0x58b9bd[_0x0559('0x67')][_0x3838e6][_0x0559('0x6b')])?'\x20'+_0x58b9bd[_0x0559('0x67')][_0x3838e6][_0x0559('0x6c')]:'');}return _0xa1c90f+')';};var _0xcb4fdc={'where':{'id':_0x3b72a5[_0x0559('0x46')]['id']}},_0x2cf79e,_0x37abfb,_0xb15eb2,_0x3c7706,_0x2c1aac;_0xcb4fdc=_[_0x0559('0x3e')]({},_0xcb4fdc,_0x3b72a5[_0x0559('0x41')]);return db[_0x0559('0x42')][_0x0559('0x48')](_0xcb4fdc)[_0x0559('0x21')](function(_0x19d35a){if(_0x19d35a){_0x2cf79e=_0x19d35a;return _0x19d35a[_0x0559('0x8a')]();}return null;})[_0x0559('0x21')](function(_0x56347f){if(_0x56347f){if(!_0x56347f[_0x0559('0x36')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0559('0x6e'),0x193);}_0x37abfb=_0x56347f;return db[_0x0559('0x6f')][_0x0559('0x8c')]({'raw':!![]});}return null;})[_0x0559('0x21')](function(_0xca169e){if(_0xca169e){_0xb15eb2=_[_0x0559('0x70')](_0xca169e,'id');var _0x54d328;var _0x25aa20=squel[_0x0559('0x71')]();_0x25aa20['from'](_0x2cf79e[_0x0559('0x73')]);for(var _0x2b7ecb=0x0;_0x2b7ecb<_0x37abfb['length'];_0x2b7ecb+=0x1){_0x54d328=_0x37abfb[_0x2b7ecb][_0x0559('0x74')]?_0xb15eb2[_0x37abfb[_0x2b7ecb][_0x0559('0x74')]][_0x0559('0x75')]:_0x37abfb[_0x2b7ecb]['field'];_0x54d328=_0x37abfb[_0x2b7ecb][_0x0559('0x76')]?_[_0x0559('0x77')](_0x58cf98[_0x37abfb[_0x2b7ecb][_0x0559('0x76')]],'%s',_0x54d328):_0x54d328;_0x54d328=_0x37abfb[_0x2b7ecb][_0x0559('0x78')]?_[_0x0559('0x77')](_0x234d22[_0x37abfb[_0x2b7ecb][_0x0559('0x78')]],'%s',_0x54d328):_0x54d328;if(_0x37abfb[_0x2b7ecb][_0x0559('0x79')]){_0x25aa20[_0x0559('0x69')](_0x54d328);}_0x37abfb[_0x2b7ecb]['orderBy']&&_0x25aa20[_0x0559('0x39')](_0x54d328,_0x37abfb[_0x2b7ecb][_0x0559('0x7a')]==='DESC'?![]:!![]);_0x25aa20[_0x0559('0x6a')](_0x54d328,_0x37abfb[_0x2b7ecb][_0x0559('0x7c')]||_0x54d328);}if(_0x2cf79e[_0x0559('0x7e')]){_0x2cf79e[_0x0559('0x7e')]=JSON[_0x0559('0x7d')](_0x2cf79e[_0x0559('0x7e')]);for(var _0x175fdd=0x0;_0x175fdd<_0x2cf79e[_0x0559('0x7e')][_0x0559('0x36')];_0x175fdd+=0x1){if(_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x2e')]&&_[_0x0559('0x63')](_0x1bd3dc,_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x2e')])&&_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x81')]&&_0x2cf79e['joins'][_0x175fdd][_0x0559('0x80')]&&_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x7f')]){_0x25aa20[_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x2e')]](_0x2cf79e[_0x0559('0x7e')][_0x175fdd]['foreignTable'],null,util[_0x0559('0x78')](_0x0559('0x8d'),_0x2cf79e[_0x0559('0x73')],_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x81')],_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x80')],_0x2cf79e[_0x0559('0x7e')][_0x175fdd][_0x0559('0x7f')]));}}}if(_0x2cf79e[_0x0559('0x82')]){_0x2cf79e[_0x0559('0x82')]=JSON[_0x0559('0x7d')](_0x2cf79e[_0x0559('0x82')]);_0x25aa20['where'](_0x3a28ef(_0x2cf79e[_0x0559('0x82')][_0x0559('0x69')]));}_0x2c1aac=_0x25aa20['clone']();_0x25aa20[_0x0559('0x1c')](_0x233070);_0x25aa20['offset'](0x0);logger[_0x0559('0x83')]('Limited\x20Query:',_0x25aa20[_0x0559('0x85')]());return db[_0x0559('0x86')][_0x0559('0x30')](_0x25aa20['toString'](),{'type':db['sequelize'][_0x0559('0x87')][_0x0559('0x8f')]});}})[_0x0559('0x21')](function(){return{'sql':_0x2c1aac[_0x0559('0x85')]()};})[_0x0559('0x21')](respondWithResult(_0x28eb31,null))['catch'](handleError(_0x28eb31,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 95fe27f..5a52fa4 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0x7a54,0x106));var _0x47a5=function(_0x1fac8,_0x4d5e88){_0x1fac8=_0x1fac8-0x0;var _0x274927=_0x7a54[_0x1fac8];return _0x274927;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment'];(function(_0x35bec1,_0x147b9e){var _0x466feb=function(_0x31fee0){while(--_0x31fee0){_0x35bec1['push'](_0x35bec1['shift']());}};_0x466feb(++_0x147b9e);}(_0x53ec,0x192));var _0xc53e=function(_0x4b88f8,_0x20ae18){_0x4b88f8=_0x4b88f8-0x0;var _0x15ecc5=_0x53ec[_0x4b88f8];return _0x15ecc5;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 5b61f67..cee9d7b 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 _0x3d7f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring'];(function(_0x49aa99,_0x4ef618){var _0x1786d7=function(_0x302531){while(--_0x302531){_0x49aa99['push'](_0x49aa99['shift']());}};_0x1786d7(++_0x4ef618);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x3d7f[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xf3d7('0x0'));var util=require('util');var moment=require(_0xf3d7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3d7('0x2'));var fs=require('fs');var Redis=require(_0xf3d7('0x3'));var db=require(_0xf3d7('0x4'))['db'];var utils=require(_0xf3d7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf3d7('0x6'));var jayson=require(_0xf3d7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe200,_0x17d875,_0x4fffe9){return new BPromise(function(_0x50fce6,_0x19c27d){return client[_0xf3d7('0x8')](_0x3fe200,_0x4fffe9)[_0xf3d7('0x9')](function(_0x2334e2){logger[_0xf3d7('0xa')](_0xf3d7('0xb'),_0x17d875,_0xf3d7('0xc'));logger[_0xf3d7('0xd')](_0xf3d7('0xe'),_0x17d875,_0xf3d7('0xc'),JSON[_0xf3d7('0xf')](_0x2334e2));if(_0x2334e2['error']){if(_0x2334e2['error'][_0xf3d7('0x10')]===0x1f4){logger[_0xf3d7('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x17d875,_0x2334e2[_0xf3d7('0x11')][_0xf3d7('0x12')]);return _0x19c27d(_0x2334e2[_0xf3d7('0x11')]['message']);}logger[_0xf3d7('0x11')](_0xf3d7('0xb'),_0x17d875,_0x2334e2[_0xf3d7('0x11')][_0xf3d7('0x12')]);return _0x50fce6(_0x2334e2[_0xf3d7('0x11')][_0xf3d7('0x12')]);}else{logger['info'](_0xf3d7('0xb'),_0x17d875,_0xf3d7('0xc'));_0x50fce6(_0x2334e2[_0xf3d7('0x13')][_0xf3d7('0x12')]);}})[_0xf3d7('0x14')](function(_0x2bfef5){logger[_0xf3d7('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x17d875,_0x2bfef5);_0x19c27d(_0x2bfef5);});});} \ No newline at end of file +var _0x854f=['rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x17ec7f,_0x58da09){var _0x242d6=function(_0x219373){while(--_0x219373){_0x17ec7f['push'](_0x17ec7f['shift']());}};_0x242d6(++_0x58da09);}(_0x854f,0xc1));var _0xf854=function(_0x1190fd,_0x411d3a){_0x1190fd=_0x1190fd-0x0;var _0xe9b99f=_0x854f[_0x1190fd];return _0xe9b99f;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var moment=require(_0xf854('0x2'));var BPromise=require(_0xf854('0x3'));var rs=require(_0xf854('0x4'));var fs=require('fs');var Redis=require(_0xf854('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf854('0x6'));var logger=require('../../config/logger')(_0xf854('0x7'));var config=require(_0xf854('0x8'));var jayson=require(_0xf854('0x9'));var client=jayson[_0xf854('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x93d685,_0x36e8a2,_0x191a63){return new BPromise(function(_0x6d2799,_0x44be6b){return client['request'](_0x93d685,_0x191a63)[_0xf854('0xb')](function(_0x321775){logger['info'](_0xf854('0xc'),_0x36e8a2,_0xf854('0xd'));logger[_0xf854('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x36e8a2,_0xf854('0xd'),JSON[_0xf854('0xf')](_0x321775));if(_0x321775[_0xf854('0x10')]){if(_0x321775[_0xf854('0x10')]['code']===0x1f4){logger[_0xf854('0x10')](_0xf854('0xc'),_0x36e8a2,_0x321775[_0xf854('0x10')][_0xf854('0x11')]);return _0x44be6b(_0x321775[_0xf854('0x10')][_0xf854('0x11')]);}logger[_0xf854('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x36e8a2,_0x321775[_0xf854('0x10')][_0xf854('0x11')]);return _0x6d2799(_0x321775['error'][_0xf854('0x11')]);}else{logger[_0xf854('0x12')](_0xf854('0xc'),_0x36e8a2,'request\x20sent');_0x6d2799(_0x321775[_0xf854('0x13')][_0xf854('0x11')]);}})['catch'](function(_0x5900f6){logger[_0xf854('0x10')](_0xf854('0xc'),_0x36e8a2,_0x5900f6);_0x44be6b(_0x5900f6);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 1fd12c6..c63ddcf 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 _0x060d=['index','get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x060d,0x16d));var _0xd060=function(_0x59a186,_0x1d5746){_0x59a186=_0x59a186-0x0;var _0xcb7105=_0x060d[_0x59a186];return _0xcb7105;};'use strict';var multer=require(_0xd060('0x0'));var util=require(_0xd060('0x1'));var path=require('path');var timeout=require(_0xd060('0x2'));var express=require(_0xd060('0x3'));var router=express[_0xd060('0x4')]();var auth=require(_0xd060('0x5'));var interaction=require(_0xd060('0x6'));var config=require(_0xd060('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xd060('0x8')](),controller[_0xd060('0x9')]);router[_0xd060('0xa')](_0xd060('0xb'),auth[_0xd060('0x8')](),controller[_0xd060('0xc')]);router[_0xd060('0xa')](_0xd060('0xd'),auth['isAuthenticated'](),controller[_0xd060('0xe')]);router[_0xd060('0xa')](_0xd060('0xf'),auth[_0xd060('0x8')](),controller['run']);router[_0xd060('0xa')](_0xd060('0x10'),auth[_0xd060('0x8')](),controller['query']);router['post']('/',auth[_0xd060('0x8')](),controller[_0xd060('0x11')]);router['put'](_0xd060('0xb'),auth[_0xd060('0x8')](),controller[_0xd060('0x12')]);router[_0xd060('0x13')](_0xd060('0xb'),auth[_0xd060('0x8')](),controller[_0xd060('0x14')]);module[_0xd060('0x15')]=router; \ No newline at end of file +var _0x0d36=['query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','run','/:id/query'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0d36,0x1d3));var _0x60d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0d36[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x60d3('0x0'));var util=require(_0x60d3('0x1'));var path=require(_0x60d3('0x2'));var timeout=require(_0x60d3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x60d3('0x4'));var interaction=require(_0x60d3('0x5'));var config=require(_0x60d3('0x6'));var controller=require(_0x60d3('0x7'));router[_0x60d3('0x8')]('/',auth[_0x60d3('0x9')](),controller[_0x60d3('0xa')]);router[_0x60d3('0x8')](_0x60d3('0xb'),auth['isAuthenticated'](),controller[_0x60d3('0xc')]);router[_0x60d3('0x8')]('/:id/preview',auth[_0x60d3('0x9')](),controller[_0x60d3('0xd')]);router[_0x60d3('0x8')]('/:id/run',auth[_0x60d3('0x9')](),controller[_0x60d3('0xe')]);router[_0x60d3('0x8')](_0x60d3('0xf'),auth['isAuthenticated'](),controller[_0x60d3('0x10')]);router[_0x60d3('0x11')]('/',auth['isAuthenticated'](),controller[_0x60d3('0x12')]);router[_0x60d3('0x13')](_0x60d3('0xb'),auth[_0x60d3('0x9')](),controller[_0x60d3('0x14')]);router['delete'](_0x60d3('0xb'),auth[_0x60d3('0x9')](),controller[_0x60d3('0x15')]);module[_0x60d3('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 68816a0..21c241c 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 _0x2214=['manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2214,0x117));var _0x4221=function(_0x42b3d7,_0x55c529){_0x42b3d7=_0x42b3d7-0x0;var _0x15988a=_0x2214[_0x42b3d7];return _0x15988a;};'use strict';var Sequelize=require(_0x4221('0x0'));var moment=require(_0x4221('0x1'));module[_0x4221('0x2')]={'name':{'type':Sequelize[_0x4221('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4221('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4221('0x4')](_0x4221('0x5'),_0x4221('0x6'),_0x4221('0x7')),'allowNull':![],'defaultValue':_0x4221('0x5')},'savename':{'type':Sequelize[_0x4221('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4221('0x8')]},'endDate':{'type':Sequelize[_0x4221('0x8')]},'status':{'type':Sequelize[_0x4221('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x4221('0x9'),_0x4221('0xa')),'allowNull':![],'defaultValue':_0x4221('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4221('0xb')]},'reportType':{'type':Sequelize[_0x4221('0x3')]}}; \ No newline at end of file +var _0xfec6=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x1de193,_0x425f95){var _0x56a717=function(_0x225134){while(--_0x225134){_0x1de193['push'](_0x1de193['shift']());}};_0x56a717(++_0x425f95);}(_0xfec6,0x138));var _0x6fec=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfec6[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x6fec('0x0'));var moment=require(_0x6fec('0x1'));module[_0x6fec('0x2')]={'name':{'type':Sequelize[_0x6fec('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6fec('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x6fec('0x4')](_0x6fec('0x5'),_0x6fec('0x6'),_0x6fec('0x7')),'allowNull':![],'defaultValue':_0x6fec('0x5')},'savename':{'type':Sequelize[_0x6fec('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6fec('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x6fec('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x6fec('0x4')](_0x6fec('0x9'),_0x6fec('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x6fec('0xb')](0xb)[_0x6fec('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 615fc43..08dd43e 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 _0x82d6=['set','Content-Range','json','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','limit','sort','filters','pick','where','merge','type','filter','options','findAll','rows','show','fields','length','includeAll','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x82d6,0x100));var _0x682d=function(_0xcf45d2,_0xc81c25){_0xcf45d2=_0xcf45d2-0x0;var _0x2873c1=_0x82d6[_0xcf45d2];return _0x2873c1;};'use strict';var pdf=require(_0x682d('0x0'));var emlformat=require(_0x682d('0x1'));var rimraf=require(_0x682d('0x2'));var zipdir=require(_0x682d('0x3'));var jsonpatch=require(_0x682d('0x4'));var rp=require(_0x682d('0x5'));var moment=require(_0x682d('0x6'));var BPromise=require(_0x682d('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x682d('0x8'));var sox=require(_0x682d('0x9'));var csv=require('to-csv');var ejs=require(_0x682d('0xa'));var fs=require('fs');var _=require(_0x682d('0xb'));var squel=require(_0x682d('0xc'));var crypto=require('crypto');var jsforce=require(_0x682d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x682d('0xe'));var Papa=require(_0x682d('0xf'));var Redis=require(_0x682d('0x10'));var authService=require(_0x682d('0x11'));var qs=require(_0x682d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x682d('0x13'))(_0x682d('0x14'));var utils=require(_0x682d('0x15'));var config=require(_0x682d('0x16'));var db=require(_0x682d('0x17'))['db'];function respondWithStatusCode(_0x2cc8f6,_0x300a33){_0x300a33=_0x300a33||0xcc;return function(_0x546113){if(_0x546113){return _0x2cc8f6[_0x682d('0x18')](_0x300a33);}return _0x2cc8f6[_0x682d('0x19')](_0x300a33)[_0x682d('0x1a')]();};}function respondWithResult(_0x46ffa1,_0x1c276c){_0x1c276c=_0x1c276c||0xc8;return function(_0x6ebac2){if(_0x6ebac2){return _0x46ffa1['status'](_0x1c276c)['json'](_0x6ebac2);}};}function respondWithFilteredResult(_0x3d1da9,_0x3ac8ad){return function(_0x246e82){if(_0x246e82){var _0x4a56bb=_0x246e82[_0x682d('0x1b')],_0x430ff2=_0x3ac8ad[_0x682d('0x1c')],_0x140227=_0x3ac8ad[_0x682d('0x1c')]+_0x3ac8ad['limit'],_0x31ee49;if(_0x140227>=_0x4a56bb){_0x140227=_0x4a56bb;_0x31ee49=0xc8;}else{_0x31ee49=0xce;}_0x3d1da9[_0x682d('0x19')](_0x31ee49);return _0x3d1da9[_0x682d('0x1d')](_0x682d('0x1e'),_0x430ff2+'-'+_0x140227+'/'+_0x4a56bb)[_0x682d('0x1f')](_0x246e82);}return null;};}function patchUpdates(_0x13e94c){return function(_0x1b0d7d){try{jsonpatch[_0x682d('0x20')](_0x1b0d7d,_0x13e94c,!![]);}catch(_0x4eb095){return BPromise[_0x682d('0x21')](_0x4eb095);}return _0x1b0d7d[_0x682d('0x22')]();};}function saveUpdates(_0x15bb7f,_0x524adb){return function(_0x592029){if(_0x592029){return _0x592029['update'](_0x15bb7f)[_0x682d('0x23')](function(_0x48a475){return _0x48a475;});}return null;};}function removeEntity(_0x2aae23,_0xbecd6){return function(_0x1551a4){if(_0x1551a4){return _0x1551a4[_0x682d('0x24')]()[_0x682d('0x23')](function(){var _0x1224b8=_0x1551a4['get']({'plain':!![]});var _0x2443e7=_0x682d('0x25');return db[_0x682d('0x26')]['destroy']({'where':{'type':_0x2443e7,'resourceId':_0x1224b8['id']}})[_0x682d('0x23')](function(){return _0x1551a4;});})[_0x682d('0x23')](function(){_0x2aae23[_0x682d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d32fc,_0x244d0b){return function(_0xf7f23){if(!_0xf7f23){_0x1d32fc[_0x682d('0x18')](0x194);}return _0xf7f23;};}function handleError(_0x484c51,_0xea87cc){_0xea87cc=_0xea87cc||0x1f4;return function(_0x5ac32c){logger[_0x682d('0x27')](_0x5ac32c[_0x682d('0x28')]);if(_0x5ac32c[_0x682d('0x29')]){delete _0x5ac32c['name'];}_0x484c51[_0x682d('0x19')](_0xea87cc)[_0x682d('0x2a')](_0x5ac32c);};}exports['index']=function(_0x5a7f9d,_0xaf40b){var _0x39a881={},_0x253fad={},_0x3f95ab={'count':0x0,'rows':[]};var _0x5d5ba9=_[_0x682d('0x2b')](db[_0x682d('0x2c')][_0x682d('0x2d')],function(_0x4b0b52){return{'name':_0x4b0b52['fieldName'],'type':_0x4b0b52['type'][_0x682d('0x2e')]};});_0x253fad[_0x682d('0x2f')]=_['map'](_0x5d5ba9,_0x682d('0x29'));_0x253fad[_0x682d('0x30')]=_[_0x682d('0x31')](_0x5a7f9d[_0x682d('0x30')]);_0x253fad['filters']=_['intersection'](_0x253fad[_0x682d('0x2f')],_0x253fad[_0x682d('0x30')]);_0x39a881[_0x682d('0x32')]=_[_0x682d('0x33')](_0x253fad[_0x682d('0x2f')],qs['fields'](_0x5a7f9d[_0x682d('0x30')]['fields']));_0x39a881[_0x682d('0x32')]=_0x39a881[_0x682d('0x32')]['length']?_0x39a881[_0x682d('0x32')]:_0x253fad[_0x682d('0x2f')];if(!_0x5a7f9d[_0x682d('0x30')][_0x682d('0x34')](_0x682d('0x35'))){_0x39a881[_0x682d('0x36')]=qs[_0x682d('0x36')](_0x5a7f9d[_0x682d('0x30')]['limit']);_0x39a881[_0x682d('0x1c')]=qs['offset'](_0x5a7f9d[_0x682d('0x30')][_0x682d('0x1c')]);}_0x39a881['order']=qs[_0x682d('0x37')](_0x5a7f9d[_0x682d('0x30')][_0x682d('0x37')]);_0x39a881['where']=qs[_0x682d('0x38')](_[_0x682d('0x39')](_0x5a7f9d['query'],_0x253fad[_0x682d('0x38')]),_0x5d5ba9);if(_0x5a7f9d[_0x682d('0x30')]['filter']){_0x39a881[_0x682d('0x3a')]=_[_0x682d('0x3b')](_0x39a881['where'],{'$or':_['map'](_0x5d5ba9,function(_0xa3a130){if(_0xa3a130[_0x682d('0x3c')]!=='VIRTUAL'){var _0x30bdd7={};_0x30bdd7[_0xa3a130['name']]={'$like':'%'+_0x5a7f9d[_0x682d('0x30')][_0x682d('0x3d')]+'%'};return _0x30bdd7;}})});}_0x39a881=_[_0x682d('0x3b')]({},_0x39a881,_0x5a7f9d[_0x682d('0x3e')]);var _0x4664d8={'where':_0x39a881[_0x682d('0x3a')]};return db[_0x682d('0x2c')][_0x682d('0x1b')](_0x4664d8)[_0x682d('0x23')](function(_0x58d4dd){_0x3f95ab[_0x682d('0x1b')]=_0x58d4dd;if(_0x5a7f9d[_0x682d('0x30')]['includeAll']){_0x39a881['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x682d('0x3f')](_0x39a881);})[_0x682d('0x23')](function(_0x32acb4){_0x3f95ab[_0x682d('0x40')]=_0x32acb4;return _0x3f95ab;})['then'](respondWithFilteredResult(_0xaf40b,_0x39a881))['catch'](handleError(_0xaf40b,null));};exports[_0x682d('0x41')]=function(_0x2a0e56,_0x2e265a){var _0x3eb74e={'raw':!![],'where':{'id':_0x2a0e56['params']['id']}},_0x2bbc65={};_0x2bbc65['model']=_[_0x682d('0x31')](db[_0x682d('0x2c')]['rawAttributes']);_0x2bbc65[_0x682d('0x30')]=_[_0x682d('0x31')](_0x2a0e56['query']);_0x2bbc65[_0x682d('0x38')]=_[_0x682d('0x33')](_0x2bbc65[_0x682d('0x2f')],_0x2bbc65['query']);_0x3eb74e[_0x682d('0x32')]=_[_0x682d('0x33')](_0x2bbc65[_0x682d('0x2f')],qs[_0x682d('0x42')](_0x2a0e56[_0x682d('0x30')][_0x682d('0x42')]));_0x3eb74e[_0x682d('0x32')]=_0x3eb74e[_0x682d('0x32')][_0x682d('0x43')]?_0x3eb74e[_0x682d('0x32')]:_0x2bbc65['model'];if(_0x2a0e56[_0x682d('0x30')][_0x682d('0x44')]){_0x3eb74e[_0x682d('0x45')]=[{'all':!![]}];}_0x3eb74e=_['merge']({},_0x3eb74e,_0x2a0e56[_0x682d('0x3e')]);return db[_0x682d('0x2c')][_0x682d('0x46')](_0x3eb74e)[_0x682d('0x23')](handleEntityNotFound(_0x2e265a,null))[_0x682d('0x23')](respondWithResult(_0x2e265a,null))[_0x682d('0x47')](handleError(_0x2e265a,null));};exports[_0x682d('0x48')]=function(_0x387b41,_0x3a62f0){return db['AnalyticExtractedReport'][_0x682d('0x48')](_0x387b41['body'],{})[_0x682d('0x23')](function(_0x20ab58){var _0x5e4344=_0x387b41[_0x682d('0x49')][_0x682d('0x4a')]({'plain':!![]});if(!_0x5e4344)throw new Error(_0x682d('0x4b'));if(_0x5e4344[_0x682d('0x4c')]===_0x682d('0x49')){var _0x554fed=_0x20ab58[_0x682d('0x4a')]({'plain':!![]});var _0x34975c=_0x682d('0x25');return db[_0x682d('0x4d')][_0x682d('0x46')]({'where':{'name':_0x34975c,'userProfileId':_0x5e4344[_0x682d('0x4e')]},'raw':!![]})[_0x682d('0x23')](function(_0x153b90){if(_0x153b90&&_0x153b90[_0x682d('0x4f')]===0x0){return db['UserProfileResource'][_0x682d('0x48')]({'name':_0x554fed[_0x682d('0x29')],'resourceId':_0x554fed['id'],'type':_0x153b90[_0x682d('0x29')],'sectionId':_0x153b90['id']},{})[_0x682d('0x23')](function(){return _0x20ab58;});}else{return _0x20ab58;}})[_0x682d('0x47')](function(_0x1d9aca){logger[_0x682d('0x27')](_0x682d('0x50'),_0x1d9aca);throw _0x1d9aca;});}return _0x20ab58;})[_0x682d('0x23')](respondWithResult(_0x3a62f0,0xc9))[_0x682d('0x47')](handleError(_0x3a62f0,null));};exports['update']=function(_0x520883,_0x4973b4){if(_0x520883[_0x682d('0x51')]['id']){delete _0x520883[_0x682d('0x51')]['id'];}return db[_0x682d('0x2c')][_0x682d('0x46')]({'where':{'id':_0x520883['params']['id']}})['then'](handleEntityNotFound(_0x4973b4,null))[_0x682d('0x23')](saveUpdates(_0x520883[_0x682d('0x51')],null))['then'](respondWithResult(_0x4973b4,null))[_0x682d('0x47')](handleError(_0x4973b4,null));};exports[_0x682d('0x24')]=function(_0x49e47a,_0x591103){return db[_0x682d('0x2c')][_0x682d('0x46')]({'where':{'id':_0x49e47a[_0x682d('0x52')]['id']}})[_0x682d('0x23')](handleEntityNotFound(_0x591103,null))[_0x682d('0x23')](removeEntity(_0x591103,null))[_0x682d('0x47')](handleError(_0x591103,null));};exports[_0x682d('0x53')]=function(_0x59bd98,_0x1fe25a,_0x25ef80){return db[_0x682d('0x2c')][_0x682d('0x46')]({'where':{'id':_0x59bd98[_0x682d('0x52')]['id']},'attributes':[_0x682d('0x29'),_0x682d('0x54'),_0x682d('0x55'),_0x682d('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x1fe25a,null))[_0x682d('0x23')](function(_0x58e44d){if(_0x58e44d){if(!fs['existsSync'](path[_0x682d('0x57')](config[_0x682d('0x58')],_0x682d('0x59'),_0x58e44d[_0x682d('0x55')]))){throw new db[(_0x682d('0x5a'))][(_0x682d('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x59bd98['query'][_0x682d('0x5c')]){return _0x1fe25a[_0x682d('0x18')](0xc8);}return _0x1fe25a[_0x682d('0x53')](path[_0x682d('0x57')](config['root'],_0x682d('0x59'),_0x58e44d['savename']),util['format'](_0x682d('0x5d'),_0x58e44d[_0x682d('0x54')]||_0x58e44d[_0x682d('0x29')],_0x58e44d[_0x682d('0x56')][_0x682d('0x5e')]()));}})['catch'](handleError(_0x1fe25a,null));}; \ No newline at end of file +var _0x5875=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','name','send','index','AnalyticExtractedReport','rawAttributes','type','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','html-pdf','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3b7bca,_0x53fed9){var _0x3edf39=function(_0x53e5c1){while(--_0x53e5c1){_0x3b7bca['push'](_0x3b7bca['shift']());}};_0x3edf39(++_0x53fed9);}(_0x5875,0x16d));var _0x5587=function(_0xace2b2,_0x1b54ca){_0xace2b2=_0xace2b2-0x0;var _0x4c7854=_0x5875[_0xace2b2];return _0x4c7854;};'use strict';var pdf=require(_0x5587('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5587('0x1'));var zipdir=require(_0x5587('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5587('0x3'));var BPromise=require(_0x5587('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5587('0x5'));var sox=require(_0x5587('0x6'));var csv=require(_0x5587('0x7'));var ejs=require(_0x5587('0x8'));var fs=require('fs');var _=require(_0x5587('0x9'));var squel=require(_0x5587('0xa'));var crypto=require(_0x5587('0xb'));var jsforce=require(_0x5587('0xc'));var deskjs=require(_0x5587('0xd'));var toCsv=require(_0x5587('0x7'));var querystring=require(_0x5587('0xe'));var Papa=require('papaparse');var Redis=require(_0x5587('0xf'));var authService=require(_0x5587('0x10'));var qs=require(_0x5587('0x11'));var as=require(_0x5587('0x12'));var hardwareService=require(_0x5587('0x13'));var logger=require(_0x5587('0x14'))('api');var utils=require(_0x5587('0x15'));var config=require(_0x5587('0x16'));var db=require(_0x5587('0x17'))['db'];function respondWithStatusCode(_0x1cfae7,_0x2e7120){_0x2e7120=_0x2e7120||0xcc;return function(_0x134608){if(_0x134608){return _0x1cfae7['sendStatus'](_0x2e7120);}return _0x1cfae7[_0x5587('0x18')](_0x2e7120)['end']();};}function respondWithResult(_0x2f9930,_0x4a4d11){_0x4a4d11=_0x4a4d11||0xc8;return function(_0x3ffe31){if(_0x3ffe31){return _0x2f9930[_0x5587('0x18')](_0x4a4d11)[_0x5587('0x19')](_0x3ffe31);}};}function respondWithFilteredResult(_0x592e76,_0x33373f){return function(_0x3eba5e){if(_0x3eba5e){var _0x4fd222=_0x3eba5e['count'],_0x52966f=_0x33373f[_0x5587('0x1a')],_0x43d6ff=_0x33373f[_0x5587('0x1a')]+_0x33373f['limit'],_0x3ce054;if(_0x43d6ff>=_0x4fd222){_0x43d6ff=_0x4fd222;_0x3ce054=0xc8;}else{_0x3ce054=0xce;}_0x592e76[_0x5587('0x18')](_0x3ce054);return _0x592e76['set'](_0x5587('0x1b'),_0x52966f+'-'+_0x43d6ff+'/'+_0x4fd222)[_0x5587('0x19')](_0x3eba5e);}return null;};}function patchUpdates(_0x4c1cdd){return function(_0x2bb382){try{jsonpatch[_0x5587('0x1c')](_0x2bb382,_0x4c1cdd,!![]);}catch(_0x36e92c){return BPromise[_0x5587('0x1d')](_0x36e92c);}return _0x2bb382[_0x5587('0x1e')]();};}function saveUpdates(_0x5262f8,_0xa3d146){return function(_0x43d7d5){if(_0x43d7d5){return _0x43d7d5[_0x5587('0x1f')](_0x5262f8)[_0x5587('0x20')](function(_0x70a4a3){return _0x70a4a3;});}return null;};}function removeEntity(_0x1c98f8,_0x19f8bf){return function(_0x2d6adb){if(_0x2d6adb){return _0x2d6adb[_0x5587('0x21')]()[_0x5587('0x20')](function(){var _0x206f5d=_0x2d6adb[_0x5587('0x22')]({'plain':!![]});var _0x34010f=_0x5587('0x23');return db[_0x5587('0x24')][_0x5587('0x21')]({'where':{'type':_0x34010f,'resourceId':_0x206f5d['id']}})[_0x5587('0x20')](function(){return _0x2d6adb;});})['then'](function(){_0x1c98f8[_0x5587('0x18')](0xcc)[_0x5587('0x25')]();});}};}function handleEntityNotFound(_0x19c4cd,_0xdec845){return function(_0x360739){if(!_0x360739){_0x19c4cd[_0x5587('0x26')](0x194);}return _0x360739;};}function handleError(_0x5ab060,_0x3f0a5c){_0x3f0a5c=_0x3f0a5c||0x1f4;return function(_0x1dfa6a){logger['error'](_0x1dfa6a['stack']);if(_0x1dfa6a[_0x5587('0x27')]){delete _0x1dfa6a[_0x5587('0x27')];}_0x5ab060[_0x5587('0x18')](_0x3f0a5c)[_0x5587('0x28')](_0x1dfa6a);};}exports[_0x5587('0x29')]=function(_0x33712d,_0x46d983){var _0x30b4d6={},_0x4cf3e2={},_0x273e88={'count':0x0,'rows':[]};var _0x19664a=_['map'](db[_0x5587('0x2a')][_0x5587('0x2b')],function(_0x243450){return{'name':_0x243450['fieldName'],'type':_0x243450[_0x5587('0x2c')]['key']};});_0x4cf3e2[_0x5587('0x2d')]=_[_0x5587('0x2e')](_0x19664a,'name');_0x4cf3e2['query']=_[_0x5587('0x2f')](_0x33712d['query']);_0x4cf3e2[_0x5587('0x30')]=_['intersection'](_0x4cf3e2[_0x5587('0x2d')],_0x4cf3e2[_0x5587('0x31')]);_0x30b4d6[_0x5587('0x32')]=_[_0x5587('0x33')](_0x4cf3e2[_0x5587('0x2d')],qs[_0x5587('0x34')](_0x33712d[_0x5587('0x31')][_0x5587('0x34')]));_0x30b4d6['attributes']=_0x30b4d6[_0x5587('0x32')][_0x5587('0x35')]?_0x30b4d6[_0x5587('0x32')]:_0x4cf3e2[_0x5587('0x2d')];if(!_0x33712d[_0x5587('0x31')][_0x5587('0x36')](_0x5587('0x37'))){_0x30b4d6[_0x5587('0x38')]=qs[_0x5587('0x38')](_0x33712d['query']['limit']);_0x30b4d6[_0x5587('0x1a')]=qs['offset'](_0x33712d[_0x5587('0x31')][_0x5587('0x1a')]);}_0x30b4d6[_0x5587('0x39')]=qs['sort'](_0x33712d[_0x5587('0x31')][_0x5587('0x3a')]);_0x30b4d6[_0x5587('0x3b')]=qs[_0x5587('0x30')](_[_0x5587('0x3c')](_0x33712d[_0x5587('0x31')],_0x4cf3e2[_0x5587('0x30')]),_0x19664a);if(_0x33712d['query'][_0x5587('0x3d')]){_0x30b4d6[_0x5587('0x3b')]=_[_0x5587('0x3e')](_0x30b4d6[_0x5587('0x3b')],{'$or':_['map'](_0x19664a,function(_0x2a0220){if(_0x2a0220[_0x5587('0x2c')]!==_0x5587('0x3f')){var _0x4b821e={};_0x4b821e[_0x2a0220[_0x5587('0x27')]]={'$like':'%'+_0x33712d[_0x5587('0x31')][_0x5587('0x3d')]+'%'};return _0x4b821e;}})});}_0x30b4d6=_[_0x5587('0x3e')]({},_0x30b4d6,_0x33712d['options']);var _0xf3828d={'where':_0x30b4d6[_0x5587('0x3b')]};return db[_0x5587('0x2a')][_0x5587('0x40')](_0xf3828d)[_0x5587('0x20')](function(_0x30d3f4){_0x273e88[_0x5587('0x40')]=_0x30d3f4;if(_0x33712d[_0x5587('0x31')][_0x5587('0x41')]){_0x30b4d6[_0x5587('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x5587('0x43')](_0x30b4d6);})['then'](function(_0x1a59d0){_0x273e88[_0x5587('0x44')]=_0x1a59d0;return _0x273e88;})['then'](respondWithFilteredResult(_0x46d983,_0x30b4d6))[_0x5587('0x45')](handleError(_0x46d983,null));};exports[_0x5587('0x46')]=function(_0x4fc4e9,_0x55361e){var _0x3952d6={'raw':!![],'where':{'id':_0x4fc4e9['params']['id']}},_0x18f325={};_0x18f325[_0x5587('0x2d')]=_[_0x5587('0x2f')](db[_0x5587('0x2a')][_0x5587('0x2b')]);_0x18f325[_0x5587('0x31')]=_[_0x5587('0x2f')](_0x4fc4e9[_0x5587('0x31')]);_0x18f325[_0x5587('0x30')]=_[_0x5587('0x33')](_0x18f325[_0x5587('0x2d')],_0x18f325[_0x5587('0x31')]);_0x3952d6['attributes']=_['intersection'](_0x18f325[_0x5587('0x2d')],qs[_0x5587('0x34')](_0x4fc4e9[_0x5587('0x31')]['fields']));_0x3952d6['attributes']=_0x3952d6['attributes'][_0x5587('0x35')]?_0x3952d6['attributes']:_0x18f325[_0x5587('0x2d')];if(_0x4fc4e9[_0x5587('0x31')]['includeAll']){_0x3952d6[_0x5587('0x42')]=[{'all':!![]}];}_0x3952d6=_[_0x5587('0x3e')]({},_0x3952d6,_0x4fc4e9[_0x5587('0x47')]);return db[_0x5587('0x2a')][_0x5587('0x48')](_0x3952d6)[_0x5587('0x20')](handleEntityNotFound(_0x55361e,null))[_0x5587('0x20')](respondWithResult(_0x55361e,null))['catch'](handleError(_0x55361e,null));};exports[_0x5587('0x49')]=function(_0x3a1ce2,_0x5a2b4){return db['AnalyticExtractedReport'][_0x5587('0x49')](_0x3a1ce2[_0x5587('0x4a')],{})[_0x5587('0x20')](function(_0x4cbd48){var _0x40f4f9=_0x3a1ce2[_0x5587('0x4b')][_0x5587('0x22')]({'plain':!![]});if(!_0x40f4f9)throw new Error(_0x5587('0x4c'));if(_0x40f4f9[_0x5587('0x4d')]===_0x5587('0x4b')){var _0x2c0d32=_0x4cbd48[_0x5587('0x22')]({'plain':!![]});var _0x57d8bd=_0x5587('0x23');return db[_0x5587('0x4e')]['find']({'where':{'name':_0x57d8bd,'userProfileId':_0x40f4f9[_0x5587('0x4f')]},'raw':!![]})[_0x5587('0x20')](function(_0x4c573f){if(_0x4c573f&&_0x4c573f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5587('0x49')]({'name':_0x2c0d32[_0x5587('0x27')],'resourceId':_0x2c0d32['id'],'type':_0x4c573f['name'],'sectionId':_0x4c573f['id']},{})[_0x5587('0x20')](function(){return _0x4cbd48;});}else{return _0x4cbd48;}})[_0x5587('0x45')](function(_0x3821b){logger[_0x5587('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3821b);throw _0x3821b;});}return _0x4cbd48;})[_0x5587('0x20')](respondWithResult(_0x5a2b4,0xc9))['catch'](handleError(_0x5a2b4,null));};exports[_0x5587('0x1f')]=function(_0x4be487,_0x5ecdaf){if(_0x4be487[_0x5587('0x4a')]['id']){delete _0x4be487[_0x5587('0x4a')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4be487[_0x5587('0x51')]['id']}})[_0x5587('0x20')](handleEntityNotFound(_0x5ecdaf,null))[_0x5587('0x20')](saveUpdates(_0x4be487[_0x5587('0x4a')],null))[_0x5587('0x20')](respondWithResult(_0x5ecdaf,null))['catch'](handleError(_0x5ecdaf,null));};exports[_0x5587('0x21')]=function(_0x192ecd,_0x4839b2){return db[_0x5587('0x2a')][_0x5587('0x48')]({'where':{'id':_0x192ecd['params']['id']}})['then'](handleEntityNotFound(_0x4839b2,null))[_0x5587('0x20')](removeEntity(_0x4839b2,null))[_0x5587('0x45')](handleError(_0x4839b2,null));};exports[_0x5587('0x52')]=function(_0x6c20c3,_0xeac94,_0xed2682){return db[_0x5587('0x2a')][_0x5587('0x48')]({'where':{'id':_0x6c20c3['params']['id']},'attributes':[_0x5587('0x27'),_0x5587('0x53'),_0x5587('0x54'),_0x5587('0x55')],'raw':!![]})[_0x5587('0x20')](handleEntityNotFound(_0xeac94,null))[_0x5587('0x20')](function(_0x183988){if(_0x183988){if(!fs[_0x5587('0x56')](path[_0x5587('0x57')](config[_0x5587('0x58')],_0x5587('0x59'),_0x183988[_0x5587('0x54')]))){throw new db[(_0x5587('0x5a'))][(_0x5587('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x6c20c3[_0x5587('0x31')][_0x5587('0x5c')]){return _0xeac94[_0x5587('0x26')](0xc8);}return _0xeac94[_0x5587('0x52')](path[_0x5587('0x57')](config['root'],_0x5587('0x59'),_0x183988[_0x5587('0x54')]),util[_0x5587('0x5d')](_0x5587('0x5e'),_0x183988['basename']||_0x183988[_0x5587('0x27')],_0x183988[_0x5587('0x55')]['toLowerCase']()));}})['catch'](handleError(_0xeac94,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 030ff10..55a81ee 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 _0x3e86=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28a8e4,_0x91294a){var _0x127409=function(_0x2baff6){while(--_0x2baff6){_0x28a8e4['push'](_0x28a8e4['shift']());}};_0x127409(++_0x91294a);}(_0x3e86,0x157));var _0x63e8=function(_0x50d1f9,_0x414ff1){_0x50d1f9=_0x50d1f9-0x0;var _0x4e64da=_0x3e86[_0x50d1f9];return _0x4e64da;};'use strict';var _=require(_0x63e8('0x0'));var util=require(_0x63e8('0x1'));var logger=require(_0x63e8('0x2'))(_0x63e8('0x3'));var moment=require(_0x63e8('0x4'));var BPromise=require(_0x63e8('0x5'));var rp=require(_0x63e8('0x6'));var fs=require('fs');var path=require(_0x63e8('0x7'));var rimraf=require(_0x63e8('0x8'));var config=require(_0x63e8('0x9'));var attributes=require(_0x63e8('0xa'));module[_0x63e8('0xb')]=function(_0x43a4f7,_0xa1536){return _0x43a4f7['define'](_0x63e8('0xc'),attributes,{'tableName':_0x63e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2a3=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5cf70e,_0x5c75b6){var _0x2dcd16=function(_0x53d93b){while(--_0x53d93b){_0x5cf70e['push'](_0x5cf70e['shift']());}};_0x2dcd16(++_0x5c75b6);}(_0xe2a3,0xd1));var _0x3e2a=function(_0x2d0794,_0x4215e2){_0x2d0794=_0x2d0794-0x0;var _0x5ced85=_0xe2a3[_0x2d0794];return _0x5ced85;};'use strict';var _=require(_0x3e2a('0x0'));var util=require(_0x3e2a('0x1'));var logger=require(_0x3e2a('0x2'))(_0x3e2a('0x3'));var moment=require(_0x3e2a('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e2a('0x5'));var fs=require('fs');var path=require(_0x3e2a('0x6'));var rimraf=require(_0x3e2a('0x7'));var config=require(_0x3e2a('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x3e2a('0x9')]=function(_0x18b343,_0x490d3f){return _0x18b343[_0x3e2a('0xa')](_0x3e2a('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 18ec291..c649428 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 _0x6e76=['code','message','info','result','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x54cd3f,_0x2d7378){var _0x344818=function(_0x5bc0bc){while(--_0x5bc0bc){_0x54cd3f['push'](_0x54cd3f['shift']());}};_0x344818(++_0x2d7378);}(_0x6e76,0x11d));var _0x66e7=function(_0x660c3b,_0x3c9ff2){_0x660c3b=_0x660c3b-0x0;var _0x36977d=_0x6e76[_0x660c3b];return _0x36977d;};'use strict';var _=require(_0x66e7('0x0'));var util=require(_0x66e7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x66e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x66e7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x66e7('0x4'));var jayson=require(_0x66e7('0x5'));var client=jayson[_0x66e7('0x6')][_0x66e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x487d53,_0xe1875a,_0x567729){return new BPromise(function(_0x28ebb3,_0x489a28){return client[_0x66e7('0x8')](_0x487d53,_0x567729)[_0x66e7('0x9')](function(_0x431075){logger['info'](_0x66e7('0xa'),_0xe1875a,_0x66e7('0xb'));logger[_0x66e7('0xc')](_0x66e7('0xd'),_0xe1875a,'request\x20sent',JSON['stringify'](_0x431075));if(_0x431075['error']){if(_0x431075[_0x66e7('0xe')][_0x66e7('0xf')]===0x1f4){logger[_0x66e7('0xe')](_0x66e7('0xa'),_0xe1875a,_0x431075[_0x66e7('0xe')][_0x66e7('0x10')]);return _0x489a28(_0x431075['error']['message']);}logger[_0x66e7('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe1875a,_0x431075['error'][_0x66e7('0x10')]);return _0x28ebb3(_0x431075[_0x66e7('0xe')]['message']);}else{logger[_0x66e7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe1875a,_0x66e7('0xb'));_0x28ebb3(_0x431075[_0x66e7('0x12')][_0x66e7('0x10')]);}})[_0x66e7('0x13')](function(_0x4711c7){logger['error'](_0x66e7('0xa'),_0xe1875a,_0x4711c7);_0x489a28(_0x4711c7);});});} \ No newline at end of file +var _0x32df=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59a4d7,_0x4b0ee9){var _0x1c4b1b=function(_0x45de37){while(--_0x45de37){_0x59a4d7['push'](_0x59a4d7['shift']());}};_0x1c4b1b(++_0x4b0ee9);}(_0x32df,0x1d0));var _0xf32d=function(_0x447dc6,_0x4e29c8){_0x447dc6=_0x447dc6-0x0;var _0x36f1ae=_0x32df[_0x447dc6];return _0x36f1ae;};'use strict';var _=require('lodash');var util=require(_0xf32d('0x0'));var moment=require(_0xf32d('0x1'));var BPromise=require(_0xf32d('0x2'));var rs=require(_0xf32d('0x3'));var fs=require('fs');var Redis=require(_0xf32d('0x4'));var db=require(_0xf32d('0x5'))['db'];var utils=require(_0xf32d('0x6'));var logger=require(_0xf32d('0x7'))(_0xf32d('0x8'));var config=require(_0xf32d('0x9'));var jayson=require(_0xf32d('0xa'));var client=jayson['client'][_0xf32d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348ce9,_0x5ebc48,_0x1991bb){return new BPromise(function(_0x21f90e,_0xbf4d2e){return client[_0xf32d('0xc')](_0x348ce9,_0x1991bb)['then'](function(_0x63bc0d){logger[_0xf32d('0xd')](_0xf32d('0xe'),_0x5ebc48,_0xf32d('0xf'));logger['debug'](_0xf32d('0x10'),_0x5ebc48,_0xf32d('0xf'),JSON[_0xf32d('0x11')](_0x63bc0d));if(_0x63bc0d[_0xf32d('0x12')]){if(_0x63bc0d['error'][_0xf32d('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ebc48,_0x63bc0d[_0xf32d('0x12')]['message']);return _0xbf4d2e(_0x63bc0d[_0xf32d('0x12')][_0xf32d('0x14')]);}logger[_0xf32d('0x12')](_0xf32d('0xe'),_0x5ebc48,_0x63bc0d[_0xf32d('0x12')][_0xf32d('0x14')]);return _0x21f90e(_0x63bc0d[_0xf32d('0x12')]['message']);}else{logger[_0xf32d('0xd')](_0xf32d('0xe'),_0x5ebc48,'request\x20sent');_0x21f90e(_0x63bc0d['result'][_0xf32d('0x14')]);}})['catch'](function(_0x10f944){logger[_0xf32d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ebc48,_0x10f944);_0xbf4d2e(_0x10f944);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 49e807f..9299795 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 _0xc064=['index','/:id','show','get','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x57436f,_0x943c45){var _0x3709d8=function(_0x15a324){while(--_0x15a324){_0x57436f['push'](_0x57436f['shift']());}};_0x3709d8(++_0x943c45);}(_0xc064,0x174));var _0x4c06=function(_0x40d013,_0x2edeaf){_0x40d013=_0x40d013-0x0;var _0x2eec2c=_0xc064[_0x40d013];return _0x2eec2c;};'use strict';var multer=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var path=require('path');var timeout=require(_0x4c06('0x2'));var express=require(_0x4c06('0x3'));var router=express[_0x4c06('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4c06('0x5'));var config=require('../../config/environment');var controller=require(_0x4c06('0x6'));router['get']('/',auth[_0x4c06('0x7')](),controller[_0x4c06('0x8')]);router['get'](_0x4c06('0x9'),auth[_0x4c06('0x7')](),controller[_0x4c06('0xa')]);router[_0x4c06('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x4c06('0xc')]);router[_0x4c06('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c06('0xe')]);router[_0x4c06('0xf')](_0x4c06('0x9'),auth[_0x4c06('0x7')](),controller[_0x4c06('0x10')]);router[_0x4c06('0x11')](_0x4c06('0x9'),auth['isAuthenticated'](),controller[_0x4c06('0x12')]);module[_0x4c06('0x13')]=router; \ No newline at end of file +var _0xd7a4=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','create','put','update','delete','destroy'];(function(_0x2981bb,_0x279cdf){var _0x5137f4=function(_0x52929e){while(--_0x52929e){_0x2981bb['push'](_0x2981bb['shift']());}};_0x5137f4(++_0x279cdf);}(_0xd7a4,0x11f));var _0x4d7a=function(_0x11c2b9,_0x2ae165){_0x11c2b9=_0x11c2b9-0x0;var _0x4471c3=_0xd7a4[_0x11c2b9];return _0x4471c3;};'use strict';var multer=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var path=require(_0x4d7a('0x2'));var timeout=require(_0x4d7a('0x3'));var express=require(_0x4d7a('0x4'));var router=express[_0x4d7a('0x5')]();var auth=require(_0x4d7a('0x6'));var interaction=require(_0x4d7a('0x7'));var config=require(_0x4d7a('0x8'));var controller=require(_0x4d7a('0x9'));router['get']('/',auth[_0x4d7a('0xa')](),controller[_0x4d7a('0xb')]);router[_0x4d7a('0xc')](_0x4d7a('0xd'),auth[_0x4d7a('0xa')](),controller['show']);router[_0x4d7a('0xc')](_0x4d7a('0xe'),auth[_0x4d7a('0xa')](),controller[_0x4d7a('0xf')]);router['post']('/',auth[_0x4d7a('0xa')](),controller[_0x4d7a('0x10')]);router[_0x4d7a('0x11')](_0x4d7a('0xd'),auth[_0x4d7a('0xa')](),controller[_0x4d7a('0x12')]);router[_0x4d7a('0x13')](_0x4d7a('0xd'),auth['isAuthenticated'](),controller[_0x4d7a('0x14')]);module[_0x4d7a('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 d46b56e..0a2ca8d 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x57d867,_0x2ee50b){var _0x33d270=function(_0x43a7b5){while(--_0x43a7b5){_0x57d867['push'](_0x57d867['shift']());}};_0x33d270(++_0x2ee50b);}(_0x814b,0x1a2));var _0xb814=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x814b[_0x2f6233];return _0x1c9c36;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x326f=['STRING','BOOLEAN','sequelize'];(function(_0x24b8ec,_0x3c8c5b){var _0x1d1b63=function(_0x316c98){while(--_0x316c98){_0x24b8ec['push'](_0x24b8ec['shift']());}};_0x1d1b63(++_0x3c8c5b);}(_0x326f,0xd1));var _0xf326=function(_0x8454bb,_0x59b283){_0x8454bb=_0x8454bb-0x0;var _0x445f0d=_0x326f[_0x8454bb];return _0x445f0d;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xf326('0x1')]},'function':{'type':Sequelize[_0xf326('0x1')]},'format':{'type':Sequelize[_0xf326('0x1')]},'groupBy':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf326('0x1')]},'custom':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index cfa05aa..c40234c 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 _0xbf65=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','params','includeAll','find','create','bulkCreate','body','catch','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','index','map','AnalyticFieldReport','rawAttributes','type','model','keys','query','filters','intersection'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xbf65,0xb5));var _0x5bf6=function(_0x2542d1,_0xdb7645){_0x2542d1=_0x2542d1-0x0;var _0xec2ce7=_0xbf65[_0x2542d1];return _0xec2ce7;};'use strict';var pdf=require(_0x5bf6('0x0'));var emlformat=require(_0x5bf6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bf6('0x2'));var jsonpatch=require(_0x5bf6('0x3'));var rp=require('request-promise');var moment=require(_0x5bf6('0x4'));var BPromise=require(_0x5bf6('0x5'));var Mustache=require(_0x5bf6('0x6'));var util=require(_0x5bf6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bf6('0x8'));var ejs=require(_0x5bf6('0x9'));var fs=require('fs');var _=require(_0x5bf6('0xa'));var squel=require(_0x5bf6('0xb'));var crypto=require(_0x5bf6('0xc'));var jsforce=require(_0x5bf6('0xd'));var deskjs=require(_0x5bf6('0xe'));var toCsv=require(_0x5bf6('0x8'));var querystring=require('querystring');var Papa=require(_0x5bf6('0xf'));var Redis=require(_0x5bf6('0x10'));var authService=require(_0x5bf6('0x11'));var qs=require(_0x5bf6('0x12'));var as=require(_0x5bf6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bf6('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5bf6('0x15'))['db'];function respondWithStatusCode(_0x401175,_0x46508a){_0x46508a=_0x46508a||0xcc;return function(_0x3720a0){if(_0x3720a0){return _0x401175['sendStatus'](_0x46508a);}return _0x401175[_0x5bf6('0x16')](_0x46508a)[_0x5bf6('0x17')]();};}function respondWithResult(_0x578203,_0x55a93a){_0x55a93a=_0x55a93a||0xc8;return function(_0x31ed60){if(_0x31ed60){return _0x578203[_0x5bf6('0x16')](_0x55a93a)[_0x5bf6('0x18')](_0x31ed60);}};}function respondWithFilteredResult(_0x568704,_0x40ba10){return function(_0xf02880){if(_0xf02880){var _0x575e17=_0xf02880[_0x5bf6('0x19')],_0x53e900=_0x40ba10[_0x5bf6('0x1a')],_0x1fdc6c=_0x40ba10['offset']+_0x40ba10[_0x5bf6('0x1b')],_0x253529;if(_0x1fdc6c>=_0x575e17){_0x1fdc6c=_0x575e17;_0x253529=0xc8;}else{_0x253529=0xce;}_0x568704[_0x5bf6('0x16')](_0x253529);return _0x568704[_0x5bf6('0x1c')](_0x5bf6('0x1d'),_0x53e900+'-'+_0x1fdc6c+'/'+_0x575e17)[_0x5bf6('0x18')](_0xf02880);}return null;};}function patchUpdates(_0x5b64e5){return function(_0x5811d6){try{jsonpatch['apply'](_0x5811d6,_0x5b64e5,!![]);}catch(_0x2a1b95){return BPromise[_0x5bf6('0x1e')](_0x2a1b95);}return _0x5811d6['save']();};}function saveUpdates(_0x54440a,_0xadc39e){return function(_0x4f393a){if(_0x4f393a){return _0x4f393a[_0x5bf6('0x1f')](_0x54440a)[_0x5bf6('0x20')](function(_0x147940){return _0x147940;});}return null;};}function removeEntity(_0x10d2df,_0x4e2a1e){return function(_0xbd25fd){if(_0xbd25fd){return _0xbd25fd[_0x5bf6('0x21')]()[_0x5bf6('0x20')](function(){_0x10d2df[_0x5bf6('0x16')](0xcc)[_0x5bf6('0x17')]();});}};}function handleEntityNotFound(_0x1964c3,_0x238bfa){return function(_0x1df590){if(!_0x1df590){_0x1964c3[_0x5bf6('0x22')](0x194);}return _0x1df590;};}function handleError(_0xc559c2,_0x34ea03){_0x34ea03=_0x34ea03||0x1f4;return function(_0x461292){logger[_0x5bf6('0x23')](_0x461292['stack']);if(_0x461292[_0x5bf6('0x24')]){delete _0x461292[_0x5bf6('0x24')];}_0xc559c2[_0x5bf6('0x16')](_0x34ea03)['send'](_0x461292);};}exports[_0x5bf6('0x25')]=function(_0x3c8e20,_0x2b92fe){var _0x5b651f={},_0x23579b={},_0x3f05a6={'count':0x0,'rows':[]};var _0x7ef62f=_[_0x5bf6('0x26')](db[_0x5bf6('0x27')][_0x5bf6('0x28')],function(_0x5c3d85){return{'name':_0x5c3d85['fieldName'],'type':_0x5c3d85[_0x5bf6('0x29')]['key']};});_0x23579b[_0x5bf6('0x2a')]=_[_0x5bf6('0x26')](_0x7ef62f,_0x5bf6('0x24'));_0x23579b['query']=_[_0x5bf6('0x2b')](_0x3c8e20[_0x5bf6('0x2c')]);_0x23579b[_0x5bf6('0x2d')]=_[_0x5bf6('0x2e')](_0x23579b[_0x5bf6('0x2a')],_0x23579b[_0x5bf6('0x2c')]);_0x5b651f[_0x5bf6('0x2f')]=_['intersection'](_0x23579b['model'],qs['fields'](_0x3c8e20[_0x5bf6('0x2c')][_0x5bf6('0x30')]));_0x5b651f['attributes']=_0x5b651f['attributes'][_0x5bf6('0x31')]?_0x5b651f['attributes']:_0x23579b[_0x5bf6('0x2a')];if(!_0x3c8e20['query'][_0x5bf6('0x32')](_0x5bf6('0x33'))){_0x5b651f[_0x5bf6('0x1b')]=qs[_0x5bf6('0x1b')](_0x3c8e20['query']['limit']);_0x5b651f['offset']=qs[_0x5bf6('0x1a')](_0x3c8e20[_0x5bf6('0x2c')][_0x5bf6('0x1a')]);}_0x5b651f[_0x5bf6('0x34')]=qs['sort'](_0x3c8e20[_0x5bf6('0x2c')][_0x5bf6('0x35')]);_0x5b651f['where']=qs[_0x5bf6('0x2d')](_[_0x5bf6('0x36')](_0x3c8e20[_0x5bf6('0x2c')],_0x23579b[_0x5bf6('0x2d')]),_0x7ef62f);if(_0x3c8e20['query'][_0x5bf6('0x37')]){_0x5b651f[_0x5bf6('0x38')]=_[_0x5bf6('0x39')](_0x5b651f[_0x5bf6('0x38')],{'$or':_[_0x5bf6('0x26')](_0x7ef62f,function(_0x2afaf4){if(_0x2afaf4[_0x5bf6('0x29')]!==_0x5bf6('0x3a')){var _0x5e0620={};_0x5e0620[_0x2afaf4[_0x5bf6('0x24')]]={'$like':'%'+_0x3c8e20['query'][_0x5bf6('0x37')]+'%'};return _0x5e0620;}})});}_0x5b651f=_[_0x5bf6('0x39')]({},_0x5b651f,_0x3c8e20[_0x5bf6('0x3b')]);var _0x247e56={'where':_0x5b651f['where']};return db[_0x5bf6('0x27')][_0x5bf6('0x19')](_0x247e56)['then'](function(_0x613a0b){_0x3f05a6['count']=_0x613a0b;if(_0x3c8e20[_0x5bf6('0x2c')]['includeAll']){_0x5b651f[_0x5bf6('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x5b651f);})[_0x5bf6('0x20')](function(_0x5b4202){_0x3f05a6[_0x5bf6('0x3d')]=_0x5b4202;return _0x3f05a6;})[_0x5bf6('0x20')](respondWithFilteredResult(_0x2b92fe,_0x5b651f))['catch'](handleError(_0x2b92fe,null));};exports['show']=function(_0x16a7f3,_0x123f15){var _0x54f61f={'raw':![],'where':{'id':_0x16a7f3[_0x5bf6('0x3e')]['id']}},_0x4da9d8={};_0x4da9d8[_0x5bf6('0x2a')]=_[_0x5bf6('0x2b')](db[_0x5bf6('0x27')][_0x5bf6('0x28')]);_0x4da9d8[_0x5bf6('0x2c')]=_['keys'](_0x16a7f3[_0x5bf6('0x2c')]);_0x4da9d8[_0x5bf6('0x2d')]=_[_0x5bf6('0x2e')](_0x4da9d8[_0x5bf6('0x2a')],_0x4da9d8[_0x5bf6('0x2c')]);_0x54f61f[_0x5bf6('0x2f')]=_['intersection'](_0x4da9d8[_0x5bf6('0x2a')],qs[_0x5bf6('0x30')](_0x16a7f3['query'][_0x5bf6('0x30')]));_0x54f61f[_0x5bf6('0x2f')]=_0x54f61f['attributes'][_0x5bf6('0x31')]?_0x54f61f[_0x5bf6('0x2f')]:_0x4da9d8['model'];if(_0x16a7f3[_0x5bf6('0x2c')][_0x5bf6('0x3f')]){_0x54f61f['include']=[{'all':!![]}];}_0x54f61f=_['merge']({},_0x54f61f,_0x16a7f3[_0x5bf6('0x3b')]);return db[_0x5bf6('0x27')][_0x5bf6('0x40')](_0x54f61f)[_0x5bf6('0x20')](handleEntityNotFound(_0x123f15,null))[_0x5bf6('0x20')](respondWithResult(_0x123f15,null))['catch'](handleError(_0x123f15,null));};exports[_0x5bf6('0x41')]=function(_0x350b58,_0x2480e0){return db[_0x5bf6('0x27')][_0x5bf6('0x41')](_0x350b58['body'],{})[_0x5bf6('0x20')](respondWithResult(_0x2480e0,0xc9))['catch'](handleError(_0x2480e0,null));};exports[_0x5bf6('0x42')]=function(_0x106645,_0x1e5e09){return db[_0x5bf6('0x27')]['bulkCreate'](_0x106645[_0x5bf6('0x43')],{'raw':![],'individualHooks':!![]})[_0x5bf6('0x20')](respondWithResult(_0x1e5e09,0xc9))[_0x5bf6('0x44')](handleError(_0x1e5e09,null));};exports[_0x5bf6('0x1f')]=function(_0x1069de,_0x2ad6b8){if(_0x1069de['body']['id']){delete _0x1069de[_0x5bf6('0x43')]['id'];}return db[_0x5bf6('0x27')]['find']({'where':{'id':_0x1069de[_0x5bf6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ad6b8,null))[_0x5bf6('0x20')](saveUpdates(_0x1069de[_0x5bf6('0x43')],null))['then'](respondWithResult(_0x2ad6b8,null))['catch'](handleError(_0x2ad6b8,null));};exports[_0x5bf6('0x21')]=function(_0x51b513,_0x18fa18){return db[_0x5bf6('0x27')][_0x5bf6('0x40')]({'where':{'id':_0x51b513[_0x5bf6('0x3e')]['id']}})[_0x5bf6('0x20')](handleEntityNotFound(_0x18fa18,null))[_0x5bf6('0x20')](removeEntity(_0x18fa18,null))[_0x5bf6('0x44')](handleError(_0x18fa18,null));};exports['bulkDestroy']=function(_0x2c4cc8,_0x81c78b){return db[_0x5bf6('0x27')][_0x5bf6('0x21')]({'where':{'id':_0x2c4cc8[_0x5bf6('0x2c')][_0x5bf6('0x45')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x81c78b,0xcc))['catch'](handleError(_0x81c78b,null));};exports[_0x5bf6('0x46')]=function(_0x3a4e39,_0x275b1b,_0x1d2203){return db[_0x5bf6('0x47')][_0x5bf6('0x48')]({'where':{'id':_0x3a4e39[_0x5bf6('0x3e')]['id']}})[_0x5bf6('0x20')](handleEntityNotFound(_0x275b1b,null))[_0x5bf6('0x20')](function(_0x155948){if(_0x155948){return db[_0x5bf6('0x49')][_0x5bf6('0x4a')](function(_0x108682){return db[_0x5bf6('0x27')][_0x5bf6('0x21')]({'where':{'CustomReportId':_0x3a4e39[_0x5bf6('0x3e')]['id']},'transaction':_0x108682})[_0x5bf6('0x20')](function(_0x12d69f){var _0x4dc616=_[_0x5bf6('0x26')](_0x3a4e39[_0x5bf6('0x43')],function(_0xd24024){delete _0xd24024['id'];_0xd24024['CustomReportId']=_0x3a4e39[_0x5bf6('0x3e')]['id'];return _0xd24024;});return db[_0x5bf6('0x27')][_0x5bf6('0x42')](_0x4dc616,{'transaction':_0x108682});});})['then'](function(){return db[_0x5bf6('0x27')][_0x5bf6('0x4b')]({'where':{'CustomReportId':_0x3a4e39[_0x5bf6('0x3e')]['id']}});});}})[_0x5bf6('0x20')](respondWithResult(_0x275b1b,null))[_0x5bf6('0x44')](handleError(_0x275b1b,null));}; \ No newline at end of file +var _0x9485=['status','end','json','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5df59d,_0x56c539){var _0x125935=function(_0xb1060d){while(--_0xb1060d){_0x5df59d['push'](_0x5df59d['shift']());}};_0x125935(++_0x56c539);}(_0x9485,0x8b));var _0x5948=function(_0x3cb71e,_0x121dd1){_0x3cb71e=_0x3cb71e-0x0;var _0x401a11=_0x9485[_0x3cb71e];return _0x401a11;};'use strict';var pdf=require(_0x5948('0x0'));var emlformat=require(_0x5948('0x1'));var rimraf=require(_0x5948('0x2'));var zipdir=require(_0x5948('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5948('0x4'));var moment=require(_0x5948('0x5'));var BPromise=require(_0x5948('0x6'));var Mustache=require('mustache');var util=require(_0x5948('0x7'));var path=require(_0x5948('0x8'));var sox=require(_0x5948('0x9'));var csv=require(_0x5948('0xa'));var ejs=require(_0x5948('0xb'));var fs=require('fs');var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0xa'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var hardwareService=require(_0x5948('0x13'));var logger=require(_0x5948('0x14'))(_0x5948('0x15'));var utils=require(_0x5948('0x16'));var config=require(_0x5948('0x17'));var db=require(_0x5948('0x18'))['db'];function respondWithStatusCode(_0x233d7e,_0x35af62){_0x35af62=_0x35af62||0xcc;return function(_0x3070f5){if(_0x3070f5){return _0x233d7e['sendStatus'](_0x35af62);}return _0x233d7e[_0x5948('0x19')](_0x35af62)[_0x5948('0x1a')]();};}function respondWithResult(_0x1028a6,_0x23a656){_0x23a656=_0x23a656||0xc8;return function(_0xe55911){if(_0xe55911){return _0x1028a6[_0x5948('0x19')](_0x23a656)[_0x5948('0x1b')](_0xe55911);}};}function respondWithFilteredResult(_0x36fd89,_0x4691fc){return function(_0x3565df){if(_0x3565df){var _0x281324=_0x3565df[_0x5948('0x1c')],_0x203968=_0x4691fc['offset'],_0x1cc566=_0x4691fc['offset']+_0x4691fc['limit'],_0xf46ff8;if(_0x1cc566>=_0x281324){_0x1cc566=_0x281324;_0xf46ff8=0xc8;}else{_0xf46ff8=0xce;}_0x36fd89[_0x5948('0x19')](_0xf46ff8);return _0x36fd89[_0x5948('0x1d')](_0x5948('0x1e'),_0x203968+'-'+_0x1cc566+'/'+_0x281324)[_0x5948('0x1b')](_0x3565df);}return null;};}function patchUpdates(_0x22cc28){return function(_0x1957d3){try{jsonpatch['apply'](_0x1957d3,_0x22cc28,!![]);}catch(_0xacffa2){return BPromise[_0x5948('0x1f')](_0xacffa2);}return _0x1957d3[_0x5948('0x20')]();};}function saveUpdates(_0x392397,_0x4a4edf){return function(_0x40410c){if(_0x40410c){return _0x40410c[_0x5948('0x21')](_0x392397)[_0x5948('0x22')](function(_0x7a4ed5){return _0x7a4ed5;});}return null;};}function removeEntity(_0x38925e,_0x416e76){return function(_0x31110a){if(_0x31110a){return _0x31110a[_0x5948('0x23')]()[_0x5948('0x22')](function(){_0x38925e[_0x5948('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f2571,_0x5e0f16){return function(_0x255228){if(!_0x255228){_0x1f2571[_0x5948('0x24')](0x194);}return _0x255228;};}function handleError(_0x47374f,_0x2cd86e){_0x2cd86e=_0x2cd86e||0x1f4;return function(_0x385821){logger[_0x5948('0x25')](_0x385821[_0x5948('0x26')]);if(_0x385821[_0x5948('0x27')]){delete _0x385821['name'];}_0x47374f['status'](_0x2cd86e)['send'](_0x385821);};}exports[_0x5948('0x28')]=function(_0x37b4aa,_0xe4629a){var _0x499c35={},_0x4a9630={},_0x45d99b={'count':0x0,'rows':[]};var _0x47b55e=_[_0x5948('0x29')](db['AnalyticFieldReport'][_0x5948('0x2a')],function(_0x2d1f6c){return{'name':_0x2d1f6c[_0x5948('0x2b')],'type':_0x2d1f6c[_0x5948('0x2c')][_0x5948('0x2d')]};});_0x4a9630[_0x5948('0x2e')]=_['map'](_0x47b55e,'name');_0x4a9630[_0x5948('0x2f')]=_[_0x5948('0x30')](_0x37b4aa['query']);_0x4a9630['filters']=_['intersection'](_0x4a9630[_0x5948('0x2e')],_0x4a9630[_0x5948('0x2f')]);_0x499c35[_0x5948('0x31')]=_[_0x5948('0x32')](_0x4a9630['model'],qs['fields'](_0x37b4aa[_0x5948('0x2f')]['fields']));_0x499c35[_0x5948('0x31')]=_0x499c35['attributes'][_0x5948('0x33')]?_0x499c35[_0x5948('0x31')]:_0x4a9630[_0x5948('0x2e')];if(!_0x37b4aa[_0x5948('0x2f')][_0x5948('0x34')](_0x5948('0x35'))){_0x499c35[_0x5948('0x36')]=qs[_0x5948('0x36')](_0x37b4aa[_0x5948('0x2f')][_0x5948('0x36')]);_0x499c35['offset']=qs[_0x5948('0x37')](_0x37b4aa[_0x5948('0x2f')]['offset']);}_0x499c35[_0x5948('0x38')]=qs['sort'](_0x37b4aa[_0x5948('0x2f')][_0x5948('0x39')]);_0x499c35['where']=qs[_0x5948('0x3a')](_['pick'](_0x37b4aa[_0x5948('0x2f')],_0x4a9630[_0x5948('0x3a')]),_0x47b55e);if(_0x37b4aa[_0x5948('0x2f')][_0x5948('0x3b')]){_0x499c35[_0x5948('0x3c')]=_[_0x5948('0x3d')](_0x499c35[_0x5948('0x3c')],{'$or':_[_0x5948('0x29')](_0x47b55e,function(_0x444882){if(_0x444882[_0x5948('0x2c')]!==_0x5948('0x3e')){var _0x5328ea={};_0x5328ea[_0x444882['name']]={'$like':'%'+_0x37b4aa['query']['filter']+'%'};return _0x5328ea;}})});}_0x499c35=_['merge']({},_0x499c35,_0x37b4aa[_0x5948('0x3f')]);var _0x26e175={'where':_0x499c35[_0x5948('0x3c')]};return db['AnalyticFieldReport'][_0x5948('0x1c')](_0x26e175)[_0x5948('0x22')](function(_0x54dd66){_0x45d99b[_0x5948('0x1c')]=_0x54dd66;if(_0x37b4aa['query'][_0x5948('0x40')]){_0x499c35[_0x5948('0x41')]=[{'all':!![]}];}return db[_0x5948('0x42')][_0x5948('0x43')](_0x499c35);})['then'](function(_0x2f1705){_0x45d99b['rows']=_0x2f1705;return _0x45d99b;})[_0x5948('0x22')](respondWithFilteredResult(_0xe4629a,_0x499c35))[_0x5948('0x44')](handleError(_0xe4629a,null));};exports[_0x5948('0x45')]=function(_0x24cdfb,_0x1d215c){var _0xba70a9={'raw':![],'where':{'id':_0x24cdfb[_0x5948('0x46')]['id']}},_0xfb7984={};_0xfb7984[_0x5948('0x2e')]=_[_0x5948('0x30')](db[_0x5948('0x42')]['rawAttributes']);_0xfb7984[_0x5948('0x2f')]=_[_0x5948('0x30')](_0x24cdfb[_0x5948('0x2f')]);_0xfb7984[_0x5948('0x3a')]=_[_0x5948('0x32')](_0xfb7984[_0x5948('0x2e')],_0xfb7984[_0x5948('0x2f')]);_0xba70a9[_0x5948('0x31')]=_[_0x5948('0x32')](_0xfb7984[_0x5948('0x2e')],qs[_0x5948('0x47')](_0x24cdfb['query'][_0x5948('0x47')]));_0xba70a9[_0x5948('0x31')]=_0xba70a9[_0x5948('0x31')][_0x5948('0x33')]?_0xba70a9['attributes']:_0xfb7984['model'];if(_0x24cdfb[_0x5948('0x2f')][_0x5948('0x40')]){_0xba70a9['include']=[{'all':!![]}];}_0xba70a9=_[_0x5948('0x3d')]({},_0xba70a9,_0x24cdfb['options']);return db[_0x5948('0x42')][_0x5948('0x48')](_0xba70a9)[_0x5948('0x22')](handleEntityNotFound(_0x1d215c,null))[_0x5948('0x22')](respondWithResult(_0x1d215c,null))['catch'](handleError(_0x1d215c,null));};exports[_0x5948('0x49')]=function(_0x1d68b5,_0x4754d8){return db['AnalyticFieldReport'][_0x5948('0x49')](_0x1d68b5[_0x5948('0x4a')],{})['then'](respondWithResult(_0x4754d8,0xc9))[_0x5948('0x44')](handleError(_0x4754d8,null));};exports[_0x5948('0x4b')]=function(_0x38c6ca,_0x128d84){return db[_0x5948('0x42')]['bulkCreate'](_0x38c6ca[_0x5948('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x128d84,0xc9))[_0x5948('0x44')](handleError(_0x128d84,null));};exports['update']=function(_0xeaf4ab,_0x17ee20){if(_0xeaf4ab[_0x5948('0x4a')]['id']){delete _0xeaf4ab[_0x5948('0x4a')]['id'];}return db[_0x5948('0x42')][_0x5948('0x48')]({'where':{'id':_0xeaf4ab[_0x5948('0x46')]['id']}})[_0x5948('0x22')](handleEntityNotFound(_0x17ee20,null))[_0x5948('0x22')](saveUpdates(_0xeaf4ab[_0x5948('0x4a')],null))[_0x5948('0x22')](respondWithResult(_0x17ee20,null))[_0x5948('0x44')](handleError(_0x17ee20,null));};exports[_0x5948('0x23')]=function(_0x227923,_0x27cf8b){return db[_0x5948('0x42')][_0x5948('0x48')]({'where':{'id':_0x227923[_0x5948('0x46')]['id']}})[_0x5948('0x22')](handleEntityNotFound(_0x27cf8b,null))[_0x5948('0x22')](removeEntity(_0x27cf8b,null))[_0x5948('0x44')](handleError(_0x27cf8b,null));};exports[_0x5948('0x4c')]=function(_0x2be4b4,_0x298ea2){return db['AnalyticFieldReport'][_0x5948('0x23')]({'where':{'id':_0x2be4b4[_0x5948('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x5948('0x22')](respondWithResult(_0x298ea2,0xcc))['catch'](handleError(_0x298ea2,null));};exports[_0x5948('0x4d')]=function(_0x108534,_0x5224f3,_0x1efd79){return db[_0x5948('0x4e')]['findOne']({'where':{'id':_0x108534[_0x5948('0x46')]['id']}})[_0x5948('0x22')](handleEntityNotFound(_0x5224f3,null))[_0x5948('0x22')](function(_0x281a74){if(_0x281a74){return db[_0x5948('0x4f')][_0x5948('0x50')](function(_0x4c12fe){return db['AnalyticFieldReport'][_0x5948('0x23')]({'where':{'CustomReportId':_0x108534[_0x5948('0x46')]['id']},'transaction':_0x4c12fe})['then'](function(_0x2ac84d){var _0x1b288d=_['map'](_0x108534[_0x5948('0x4a')],function(_0x288239){delete _0x288239['id'];_0x288239[_0x5948('0x51')]=_0x108534[_0x5948('0x46')]['id'];return _0x288239;});return db['AnalyticFieldReport'][_0x5948('0x4b')](_0x1b288d,{'transaction':_0x4c12fe});});})[_0x5948('0x22')](function(){return db[_0x5948('0x42')][_0x5948('0x43')]({'where':{'CustomReportId':_0x108534[_0x5948('0x46')]['id']}});});}})['then'](respondWithResult(_0x5224f3,null))[_0x5948('0x44')](handleError(_0x5224f3,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 897a7ad..a6a80be 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 _0xb00c=['request-promise','path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb00c,0x10f));var _0xcb00=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0xb00c[_0x23a79e];return _0x3dab57;};'use strict';var _=require(_0xcb00('0x0'));var util=require('util');var logger=require(_0xcb00('0x1'))(_0xcb00('0x2'));var moment=require(_0xcb00('0x3'));var BPromise=require(_0xcb00('0x4'));var rp=require(_0xcb00('0x5'));var fs=require('fs');var path=require(_0xcb00('0x6'));var rimraf=require(_0xcb00('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb00('0x8'));module['exports']=function(_0x3a0b51,_0x2d83b8){return _0x3a0b51[_0xcb00('0x9')](_0xcb00('0xa'),attributes,{'tableName':_0xcb00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc54d=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc54d,0x144));var _0xdc54=function(_0x53b3ee,_0x12feb7){_0x53b3ee=_0x53b3ee-0x0;var _0x50fae3=_0xc54d[_0x53b3ee];return _0x50fae3;};'use strict';var _=require(_0xdc54('0x0'));var util=require(_0xdc54('0x1'));var logger=require(_0xdc54('0x2'))('api');var moment=require(_0xdc54('0x3'));var BPromise=require(_0xdc54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc54('0x5'));var rimraf=require(_0xdc54('0x6'));var config=require(_0xdc54('0x7'));var attributes=require(_0xdc54('0x8'));module[_0xdc54('0x9')]=function(_0x1960bc,_0x1085c8){return _0x1960bc[_0xdc54('0xa')](_0xdc54('0xb'),attributes,{'tableName':_0xdc54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 62f9907..ade5a48 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 _0xf62e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf62e,0x7b));var _0xef62=function(_0x46376b,_0x46cebd){_0x46376b=_0x46376b-0x0;var _0x1d5c24=_0xf62e[_0x46376b];return _0x1d5c24;};'use strict';var _=require(_0xef62('0x0'));var util=require(_0xef62('0x1'));var moment=require(_0xef62('0x2'));var BPromise=require(_0xef62('0x3'));var rs=require(_0xef62('0x4'));var fs=require('fs');var Redis=require(_0xef62('0x5'));var db=require(_0xef62('0x6'))['db'];var utils=require(_0xef62('0x7'));var logger=require(_0xef62('0x8'))(_0xef62('0x9'));var config=require('../../config/environment');var jayson=require(_0xef62('0xa'));var client=jayson[_0xef62('0xb')][_0xef62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x467187,_0x2ee14e,_0x2edbfe){return new BPromise(function(_0x14df3d,_0x5327a9){return client[_0xef62('0xd')](_0x467187,_0x2edbfe)[_0xef62('0xe')](function(_0x337974){logger[_0xef62('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2ee14e,_0xef62('0x10'));logger[_0xef62('0x11')](_0xef62('0x12'),_0x2ee14e,_0xef62('0x10'),JSON[_0xef62('0x13')](_0x337974));if(_0x337974[_0xef62('0x14')]){if(_0x337974[_0xef62('0x14')][_0xef62('0x15')]===0x1f4){logger[_0xef62('0x14')](_0xef62('0x16'),_0x2ee14e,_0x337974[_0xef62('0x14')][_0xef62('0x17')]);return _0x5327a9(_0x337974[_0xef62('0x14')][_0xef62('0x17')]);}logger[_0xef62('0x14')](_0xef62('0x16'),_0x2ee14e,_0x337974[_0xef62('0x14')][_0xef62('0x17')]);return _0x14df3d(_0x337974[_0xef62('0x14')][_0xef62('0x17')]);}else{logger['info'](_0xef62('0x16'),_0x2ee14e,'request\x20sent');_0x14df3d(_0x337974['result'][_0xef62('0x17')]);}})[_0xef62('0x18')](function(_0x3f74b3){logger[_0xef62('0x14')](_0xef62('0x16'),_0x2ee14e,_0x3f74b3);_0x5327a9(_0x3f74b3);});});} \ No newline at end of file +var _0xd818=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0xd818,0x1d4));var _0x8d81=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xd818[_0x25701b];return _0x3a8a2c;};'use strict';var _=require(_0x8d81('0x0'));var util=require(_0x8d81('0x1'));var moment=require('moment');var BPromise=require(_0x8d81('0x2'));var rs=require(_0x8d81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8d81('0x4'))(_0x8d81('0x5'));var config=require(_0x8d81('0x6'));var jayson=require(_0x8d81('0x7'));var client=jayson[_0x8d81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x143e27,_0x4163e7,_0x2619a1){return new BPromise(function(_0x27661b,_0x2359f8){return client[_0x8d81('0x9')](_0x143e27,_0x2619a1)[_0x8d81('0xa')](function(_0x499b75){logger[_0x8d81('0xb')](_0x8d81('0xc'),_0x4163e7,_0x8d81('0xd'));logger[_0x8d81('0xe')](_0x8d81('0xf'),_0x4163e7,_0x8d81('0xd'),JSON[_0x8d81('0x10')](_0x499b75));if(_0x499b75[_0x8d81('0x11')]){if(_0x499b75[_0x8d81('0x11')]['code']===0x1f4){logger[_0x8d81('0x11')](_0x8d81('0xc'),_0x4163e7,_0x499b75[_0x8d81('0x11')][_0x8d81('0x12')]);return _0x2359f8(_0x499b75[_0x8d81('0x11')][_0x8d81('0x12')]);}logger[_0x8d81('0x11')](_0x8d81('0xc'),_0x4163e7,_0x499b75[_0x8d81('0x11')][_0x8d81('0x12')]);return _0x27661b(_0x499b75[_0x8d81('0x11')][_0x8d81('0x12')]);}else{logger[_0x8d81('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4163e7,_0x8d81('0xd'));_0x27661b(_0x499b75[_0x8d81('0x13')]['message']);}})[_0x8d81('0x14')](function(_0x1d8c2a){logger[_0x8d81('0x11')](_0x8d81('0xc'),_0x4163e7,_0x1d8c2a);_0x2359f8(_0x1d8c2a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index addd551..28da650 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 0cc2dd4..3436844 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 _0xa397=['TEXT','sequelize','STRING','name'];(function(_0x8dea05,_0x2a9cab){var _0x1c793c=function(_0x3952aa){while(--_0x3952aa){_0x8dea05['push'](_0x8dea05['shift']());}};_0x1c793c(++_0x2a9cab);}(_0xa397,0xdd));var _0x7a39=function(_0x492015,_0xa46139){_0x492015=_0x492015-0x0;var _0x4ca226=_0xa397[_0x492015];return _0x4ca226;};'use strict';var Sequelize=require(_0x7a39('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a39('0x1')],'allowNull':![],'unique':_0x7a39('0x2')},'table':{'type':Sequelize[_0x7a39('0x1')]},'metric':{'type':Sequelize[_0x7a39('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x980c=['TEXT','sequelize','exports','STRING','name'];(function(_0x5f4ba1,_0x4a0182){var _0xe72ee8=function(_0x4480d1){while(--_0x4480d1){_0x5f4ba1['push'](_0x5f4ba1['shift']());}};_0xe72ee8(++_0x4a0182);}(_0x980c,0x100));var _0xc980=function(_0x23a248,_0x49d017){_0x23a248=_0x23a248-0x0;var _0x3240a8=_0x980c[_0x23a248];return _0x3240a8;};'use strict';var Sequelize=require(_0xc980('0x0'));module[_0xc980('0x1')]={'name':{'type':Sequelize[_0xc980('0x2')],'allowNull':![],'unique':_0xc980('0x3')},'table':{'type':Sequelize[_0xc980('0x2')]},'metric':{'type':Sequelize[_0xc980('0x4')]},'description':{'type':Sequelize[_0xc980('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e1ab0ff..0b98ecd 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 _0xbbbc=['params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Metrics','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','length','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','rows','show'];(function(_0x342dff,_0x18183b){var _0x464a10=function(_0x23688e){while(--_0x23688e){_0x342dff['push'](_0x342dff['shift']());}};_0x464a10(++_0x18183b);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x47eeaf,_0x10eaaa){_0x47eeaf=_0x47eeaf-0x0;var _0x128198=_0xbbbc[_0x47eeaf];return _0x128198;};'use strict';var pdf=require(_0xcbbb('0x0'));var emlformat=require(_0xcbbb('0x1'));var rimraf=require(_0xcbbb('0x2'));var zipdir=require(_0xcbbb('0x3'));var jsonpatch=require(_0xcbbb('0x4'));var rp=require(_0xcbbb('0x5'));var moment=require(_0xcbbb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcbbb('0x7'));var util=require(_0xcbbb('0x8'));var path=require(_0xcbbb('0x9'));var sox=require(_0xcbbb('0xa'));var csv=require(_0xcbbb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xb'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x631188,_0x53e651){_0x53e651=_0x53e651||0xcc;return function(_0x56f81){if(_0x56f81){return _0x631188['sendStatus'](_0x53e651);}return _0x631188[_0xcbbb('0x17')](_0x53e651)[_0xcbbb('0x18')]();};}function respondWithResult(_0x1cece7,_0x47ea6a){_0x47ea6a=_0x47ea6a||0xc8;return function(_0x27ba56){if(_0x27ba56){return _0x1cece7[_0xcbbb('0x17')](_0x47ea6a)[_0xcbbb('0x19')](_0x27ba56);}};}function respondWithFilteredResult(_0x273e13,_0x47e679){return function(_0x5af226){if(_0x5af226){var _0x1bba39=_0x5af226['count'],_0x30297d=_0x47e679[_0xcbbb('0x1a')],_0xf76038=_0x47e679['offset']+_0x47e679[_0xcbbb('0x1b')],_0x188698;if(_0xf76038>=_0x1bba39){_0xf76038=_0x1bba39;_0x188698=0xc8;}else{_0x188698=0xce;}_0x273e13[_0xcbbb('0x17')](_0x188698);return _0x273e13[_0xcbbb('0x1c')]('Content-Range',_0x30297d+'-'+_0xf76038+'/'+_0x1bba39)['json'](_0x5af226);}return null;};}function patchUpdates(_0x4bcd9a){return function(_0x31c768){try{jsonpatch[_0xcbbb('0x1d')](_0x31c768,_0x4bcd9a,!![]);}catch(_0x26c5eb){return BPromise[_0xcbbb('0x1e')](_0x26c5eb);}return _0x31c768[_0xcbbb('0x1f')]();};}function saveUpdates(_0x1cca90,_0x45de5f){return function(_0x2be36c){if(_0x2be36c){return _0x2be36c[_0xcbbb('0x20')](_0x1cca90)[_0xcbbb('0x21')](function(_0x594b3f){return _0x594b3f;});}return null;};}function removeEntity(_0x44a568,_0xe07b0){return function(_0x159c62){if(_0x159c62){return _0x159c62[_0xcbbb('0x22')]()[_0xcbbb('0x21')](function(){var _0x155e19=_0x159c62[_0xcbbb('0x23')]({'plain':!![]});var _0xabb565=_0xcbbb('0x24');return db['UserProfileResource'][_0xcbbb('0x22')]({'where':{'type':_0xabb565,'resourceId':_0x155e19['id']}})[_0xcbbb('0x21')](function(){return _0x159c62;});})['then'](function(){_0x44a568[_0xcbbb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48dfc4,_0x575d56){return function(_0x32e070){if(!_0x32e070){_0x48dfc4['sendStatus'](0x194);}return _0x32e070;};}function handleError(_0x59c422,_0x5499a1){_0x5499a1=_0x5499a1||0x1f4;return function(_0x4439ea){logger['error'](_0x4439ea['stack']);if(_0x4439ea[_0xcbbb('0x25')]){delete _0x4439ea[_0xcbbb('0x25')];}_0x59c422[_0xcbbb('0x17')](_0x5499a1)[_0xcbbb('0x26')](_0x4439ea);};}exports[_0xcbbb('0x27')]=function(_0x39ba8b,_0x3d4c0d){var _0x1c986d={},_0x2a023f={},_0x26c05e={'count':0x0,'rows':[]};var _0x1c2ac9=_[_0xcbbb('0x28')](db[_0xcbbb('0x29')][_0xcbbb('0x2a')],function(_0x2a9639){return{'name':_0x2a9639[_0xcbbb('0x2b')],'type':_0x2a9639[_0xcbbb('0x2c')][_0xcbbb('0x2d')]};});_0x2a023f['model']=_[_0xcbbb('0x28')](_0x1c2ac9,_0xcbbb('0x25'));_0x2a023f['query']=_[_0xcbbb('0x2e')](_0x39ba8b['query']);_0x2a023f[_0xcbbb('0x2f')]=_[_0xcbbb('0x30')](_0x2a023f[_0xcbbb('0x31')],_0x2a023f['query']);_0x1c986d[_0xcbbb('0x32')]=_[_0xcbbb('0x30')](_0x2a023f[_0xcbbb('0x31')],qs[_0xcbbb('0x33')](_0x39ba8b[_0xcbbb('0x34')][_0xcbbb('0x33')]));_0x1c986d[_0xcbbb('0x32')]=_0x1c986d[_0xcbbb('0x32')][_0xcbbb('0x35')]?_0x1c986d[_0xcbbb('0x32')]:_0x2a023f['model'];if(!_0x39ba8b['query']['hasOwnProperty']('nolimit')){_0x1c986d[_0xcbbb('0x1b')]=qs[_0xcbbb('0x1b')](_0x39ba8b[_0xcbbb('0x34')][_0xcbbb('0x1b')]);_0x1c986d[_0xcbbb('0x1a')]=qs[_0xcbbb('0x1a')](_0x39ba8b[_0xcbbb('0x34')][_0xcbbb('0x1a')]);}_0x1c986d[_0xcbbb('0x36')]=qs[_0xcbbb('0x37')](_0x39ba8b[_0xcbbb('0x34')][_0xcbbb('0x37')]);_0x1c986d['where']=qs['filters'](_[_0xcbbb('0x38')](_0x39ba8b['query'],_0x2a023f['filters']),_0x1c2ac9);if(_0x39ba8b['query'][_0xcbbb('0x39')]){_0x1c986d[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x1c986d[_0xcbbb('0x3a')],{'$or':_[_0xcbbb('0x28')](_0x1c2ac9,function(_0x2727f5){if(_0x2727f5[_0xcbbb('0x2c')]!==_0xcbbb('0x3c')){var _0x159691={};_0x159691[_0x2727f5[_0xcbbb('0x25')]]={'$like':'%'+_0x39ba8b[_0xcbbb('0x34')]['filter']+'%'};return _0x159691;}})});}_0x1c986d=_[_0xcbbb('0x3b')]({},_0x1c986d,_0x39ba8b['options']);var _0x2bb5e1={'where':_0x1c986d[_0xcbbb('0x3a')]};return db[_0xcbbb('0x29')][_0xcbbb('0x3d')](_0x2bb5e1)[_0xcbbb('0x21')](function(_0x3107a6){_0x26c05e['count']=_0x3107a6;if(_0x39ba8b['query']['includeAll']){_0x1c986d[_0xcbbb('0x3e')]=[{'all':!![]}];}return db[_0xcbbb('0x29')][_0xcbbb('0x3f')](_0x1c986d);})[_0xcbbb('0x21')](function(_0x15f2b1){_0x26c05e[_0xcbbb('0x40')]=_0x15f2b1;return _0x26c05e;})[_0xcbbb('0x21')](respondWithFilteredResult(_0x3d4c0d,_0x1c986d))['catch'](handleError(_0x3d4c0d,null));};exports[_0xcbbb('0x41')]=function(_0x22076a,_0x5550d2){var _0x15b3bc={'raw':!![],'where':{'id':_0x22076a[_0xcbbb('0x42')]['id']}},_0xa8eff0={};_0xa8eff0[_0xcbbb('0x31')]=_[_0xcbbb('0x2e')](db['AnalyticMetric'][_0xcbbb('0x2a')]);_0xa8eff0['query']=_['keys'](_0x22076a[_0xcbbb('0x34')]);_0xa8eff0[_0xcbbb('0x2f')]=_[_0xcbbb('0x30')](_0xa8eff0[_0xcbbb('0x31')],_0xa8eff0[_0xcbbb('0x34')]);_0x15b3bc[_0xcbbb('0x32')]=_[_0xcbbb('0x30')](_0xa8eff0[_0xcbbb('0x31')],qs[_0xcbbb('0x33')](_0x22076a[_0xcbbb('0x34')][_0xcbbb('0x33')]));_0x15b3bc[_0xcbbb('0x32')]=_0x15b3bc[_0xcbbb('0x32')][_0xcbbb('0x35')]?_0x15b3bc['attributes']:_0xa8eff0[_0xcbbb('0x31')];if(_0x22076a[_0xcbbb('0x34')][_0xcbbb('0x43')]){_0x15b3bc[_0xcbbb('0x3e')]=[{'all':!![]}];}_0x15b3bc=_['merge']({},_0x15b3bc,_0x22076a['options']);return db['AnalyticMetric'][_0xcbbb('0x44')](_0x15b3bc)[_0xcbbb('0x21')](handleEntityNotFound(_0x5550d2,null))[_0xcbbb('0x21')](respondWithResult(_0x5550d2,null))[_0xcbbb('0x45')](handleError(_0x5550d2,null));};exports[_0xcbbb('0x46')]=function(_0x1ef25b,_0x6f31f9){return db['AnalyticMetric'][_0xcbbb('0x46')](_0x1ef25b[_0xcbbb('0x47')],{})[_0xcbbb('0x21')](function(_0x2f8158){var _0x478c22=_0x1ef25b[_0xcbbb('0x48')][_0xcbbb('0x23')]({'plain':!![]});if(!_0x478c22)throw new Error(_0xcbbb('0x49'));if(_0x478c22[_0xcbbb('0x4a')]==='user'){var _0x5e0366=_0x2f8158[_0xcbbb('0x23')]({'plain':!![]});var _0x421137=_0xcbbb('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x421137,'userProfileId':_0x478c22['userProfileId']},'raw':!![]})[_0xcbbb('0x21')](function(_0x3070d9){if(_0x3070d9&&_0x3070d9['autoAssociation']===0x0){return db[_0xcbbb('0x4b')][_0xcbbb('0x46')]({'name':_0x5e0366[_0xcbbb('0x25')],'resourceId':_0x5e0366['id'],'type':_0x3070d9[_0xcbbb('0x25')],'sectionId':_0x3070d9['id']},{})['then'](function(){return _0x2f8158;});}else{return _0x2f8158;}})[_0xcbbb('0x45')](function(_0x1e4bb0){logger[_0xcbbb('0x4c')](_0xcbbb('0x4d'),_0x1e4bb0);throw _0x1e4bb0;});}return _0x2f8158;})[_0xcbbb('0x21')](respondWithResult(_0x6f31f9,0xc9))[_0xcbbb('0x45')](handleError(_0x6f31f9,null));};exports[_0xcbbb('0x20')]=function(_0x1d9136,_0x2d3990){if(_0x1d9136[_0xcbbb('0x47')]['id']){delete _0x1d9136[_0xcbbb('0x47')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x1d9136[_0xcbbb('0x42')]['id']}})[_0xcbbb('0x21')](handleEntityNotFound(_0x2d3990,null))[_0xcbbb('0x21')](saveUpdates(_0x1d9136['body'],null))[_0xcbbb('0x21')](respondWithResult(_0x2d3990,null))['catch'](handleError(_0x2d3990,null));};exports[_0xcbbb('0x22')]=function(_0x3bf4bf,_0x317633){return db[_0xcbbb('0x29')][_0xcbbb('0x44')]({'where':{'id':_0x3bf4bf[_0xcbbb('0x42')]['id']}})['then'](handleEntityNotFound(_0x317633,null))['then'](removeEntity(_0x317633,null))['catch'](handleError(_0x317633,null));}; \ No newline at end of file +var _0xa5fa=['fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Metrics','destroy','end','stack','name','send','AnalyticMetric'];(function(_0x4c3b0e,_0x4bf25d){var _0x31c3ef=function(_0x27ea59){while(--_0x27ea59){_0x4c3b0e['push'](_0x4c3b0e['shift']());}};_0x31c3ef(++_0x4bf25d);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0xa5fa[_0x33554b];return _0x256954;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa5f('0x0'));var rimraf=require(_0xaa5f('0x1'));var zipdir=require(_0xaa5f('0x2'));var jsonpatch=require(_0xaa5f('0x3'));var rp=require('request-promise');var moment=require(_0xaa5f('0x4'));var BPromise=require(_0xaa5f('0x5'));var Mustache=require('mustache');var util=require(_0xaa5f('0x6'));var path=require(_0xaa5f('0x7'));var sox=require(_0xaa5f('0x8'));var csv=require(_0xaa5f('0x9'));var ejs=require(_0xaa5f('0xa'));var fs=require('fs');var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x9'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var db=require(_0xaa5f('0x15'))['db'];function respondWithStatusCode(_0x206ed3,_0x9aeae9){_0x9aeae9=_0x9aeae9||0xcc;return function(_0x252ae0){if(_0x252ae0){return _0x206ed3['sendStatus'](_0x9aeae9);}return _0x206ed3[_0xaa5f('0x16')](_0x9aeae9)['end']();};}function respondWithResult(_0x372881,_0x23f872){_0x23f872=_0x23f872||0xc8;return function(_0x31eabc){if(_0x31eabc){return _0x372881[_0xaa5f('0x16')](_0x23f872)[_0xaa5f('0x17')](_0x31eabc);}};}function respondWithFilteredResult(_0x5a4c41,_0x4fc828){return function(_0x1f37fb){if(_0x1f37fb){var _0x291042=_0x1f37fb[_0xaa5f('0x18')],_0xb0bfb6=_0x4fc828[_0xaa5f('0x19')],_0x4265ab=_0x4fc828[_0xaa5f('0x19')]+_0x4fc828[_0xaa5f('0x1a')],_0x27fdca;if(_0x4265ab>=_0x291042){_0x4265ab=_0x291042;_0x27fdca=0xc8;}else{_0x27fdca=0xce;}_0x5a4c41[_0xaa5f('0x16')](_0x27fdca);return _0x5a4c41[_0xaa5f('0x1b')](_0xaa5f('0x1c'),_0xb0bfb6+'-'+_0x4265ab+'/'+_0x291042)['json'](_0x1f37fb);}return null;};}function patchUpdates(_0x1c072){return function(_0x4c0a9d){try{jsonpatch[_0xaa5f('0x1d')](_0x4c0a9d,_0x1c072,!![]);}catch(_0x358d2e){return BPromise[_0xaa5f('0x1e')](_0x358d2e);}return _0x4c0a9d[_0xaa5f('0x1f')]();};}function saveUpdates(_0x21cd23,_0x194691){return function(_0x2d8fc3){if(_0x2d8fc3){return _0x2d8fc3[_0xaa5f('0x20')](_0x21cd23)[_0xaa5f('0x21')](function(_0x10f287){return _0x10f287;});}return null;};}function removeEntity(_0x998ab5,_0x5238a8){return function(_0x1e917d){if(_0x1e917d){return _0x1e917d['destroy']()[_0xaa5f('0x21')](function(){var _0x34ca72=_0x1e917d['get']({'plain':!![]});var _0x1baa2e=_0xaa5f('0x22');return db['UserProfileResource'][_0xaa5f('0x23')]({'where':{'type':_0x1baa2e,'resourceId':_0x34ca72['id']}})[_0xaa5f('0x21')](function(){return _0x1e917d;});})[_0xaa5f('0x21')](function(){_0x998ab5[_0xaa5f('0x16')](0xcc)[_0xaa5f('0x24')]();});}};}function handleEntityNotFound(_0xacbded,_0x3d7bca){return function(_0x2fba7d){if(!_0x2fba7d){_0xacbded['sendStatus'](0x194);}return _0x2fba7d;};}function handleError(_0x2445a6,_0x3a66e8){_0x3a66e8=_0x3a66e8||0x1f4;return function(_0x1ed8eb){logger['error'](_0x1ed8eb[_0xaa5f('0x25')]);if(_0x1ed8eb[_0xaa5f('0x26')]){delete _0x1ed8eb[_0xaa5f('0x26')];}_0x2445a6['status'](_0x3a66e8)[_0xaa5f('0x27')](_0x1ed8eb);};}exports['index']=function(_0x5990d2,_0x27d1a4){var _0x50998f={},_0x1bffec={},_0x4e0ec9={'count':0x0,'rows':[]};var _0x4c5dc0=_['map'](db[_0xaa5f('0x28')]['rawAttributes'],function(_0x310828){return{'name':_0x310828[_0xaa5f('0x29')],'type':_0x310828['type']['key']};});_0x1bffec[_0xaa5f('0x2a')]=_['map'](_0x4c5dc0,_0xaa5f('0x26'));_0x1bffec[_0xaa5f('0x2b')]=_['keys'](_0x5990d2[_0xaa5f('0x2b')]);_0x1bffec[_0xaa5f('0x2c')]=_[_0xaa5f('0x2d')](_0x1bffec['model'],_0x1bffec[_0xaa5f('0x2b')]);_0x50998f[_0xaa5f('0x2e')]=_['intersection'](_0x1bffec['model'],qs['fields'](_0x5990d2['query'][_0xaa5f('0x2f')]));_0x50998f[_0xaa5f('0x2e')]=_0x50998f[_0xaa5f('0x2e')][_0xaa5f('0x30')]?_0x50998f[_0xaa5f('0x2e')]:_0x1bffec[_0xaa5f('0x2a')];if(!_0x5990d2[_0xaa5f('0x2b')]['hasOwnProperty'](_0xaa5f('0x31'))){_0x50998f[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x5990d2[_0xaa5f('0x2b')][_0xaa5f('0x1a')]);_0x50998f[_0xaa5f('0x19')]=qs['offset'](_0x5990d2[_0xaa5f('0x2b')][_0xaa5f('0x19')]);}_0x50998f[_0xaa5f('0x32')]=qs[_0xaa5f('0x33')](_0x5990d2[_0xaa5f('0x2b')]['sort']);_0x50998f['where']=qs[_0xaa5f('0x2c')](_[_0xaa5f('0x34')](_0x5990d2[_0xaa5f('0x2b')],_0x1bffec[_0xaa5f('0x2c')]),_0x4c5dc0);if(_0x5990d2['query'][_0xaa5f('0x35')]){_0x50998f[_0xaa5f('0x36')]=_[_0xaa5f('0x37')](_0x50998f[_0xaa5f('0x36')],{'$or':_[_0xaa5f('0x38')](_0x4c5dc0,function(_0x1869c2){if(_0x1869c2[_0xaa5f('0x39')]!==_0xaa5f('0x3a')){var _0xc6deec={};_0xc6deec[_0x1869c2[_0xaa5f('0x26')]]={'$like':'%'+_0x5990d2[_0xaa5f('0x2b')]['filter']+'%'};return _0xc6deec;}})});}_0x50998f=_[_0xaa5f('0x37')]({},_0x50998f,_0x5990d2[_0xaa5f('0x3b')]);var _0xcd9c30={'where':_0x50998f[_0xaa5f('0x36')]};return db[_0xaa5f('0x28')][_0xaa5f('0x18')](_0xcd9c30)[_0xaa5f('0x21')](function(_0xa490d9){_0x4e0ec9[_0xaa5f('0x18')]=_0xa490d9;if(_0x5990d2[_0xaa5f('0x2b')]['includeAll']){_0x50998f[_0xaa5f('0x3c')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xaa5f('0x3d')](_0x50998f);})[_0xaa5f('0x21')](function(_0x17bb4d){_0x4e0ec9['rows']=_0x17bb4d;return _0x4e0ec9;})[_0xaa5f('0x21')](respondWithFilteredResult(_0x27d1a4,_0x50998f))[_0xaa5f('0x3e')](handleError(_0x27d1a4,null));};exports[_0xaa5f('0x3f')]=function(_0x528b08,_0x12a8e4){var _0x179be8={'raw':!![],'where':{'id':_0x528b08[_0xaa5f('0x40')]['id']}},_0x1ac9b6={};_0x1ac9b6['model']=_[_0xaa5f('0x41')](db[_0xaa5f('0x28')][_0xaa5f('0x42')]);_0x1ac9b6[_0xaa5f('0x2b')]=_[_0xaa5f('0x41')](_0x528b08[_0xaa5f('0x2b')]);_0x1ac9b6[_0xaa5f('0x2c')]=_[_0xaa5f('0x2d')](_0x1ac9b6['model'],_0x1ac9b6[_0xaa5f('0x2b')]);_0x179be8['attributes']=_[_0xaa5f('0x2d')](_0x1ac9b6['model'],qs[_0xaa5f('0x2f')](_0x528b08[_0xaa5f('0x2b')]['fields']));_0x179be8[_0xaa5f('0x2e')]=_0x179be8[_0xaa5f('0x2e')][_0xaa5f('0x30')]?_0x179be8['attributes']:_0x1ac9b6['model'];if(_0x528b08['query'][_0xaa5f('0x43')]){_0x179be8['include']=[{'all':!![]}];}_0x179be8=_[_0xaa5f('0x37')]({},_0x179be8,_0x528b08[_0xaa5f('0x3b')]);return db[_0xaa5f('0x28')][_0xaa5f('0x44')](_0x179be8)['then'](handleEntityNotFound(_0x12a8e4,null))[_0xaa5f('0x21')](respondWithResult(_0x12a8e4,null))[_0xaa5f('0x3e')](handleError(_0x12a8e4,null));};exports[_0xaa5f('0x45')]=function(_0x231ad1,_0x27ea4b){return db[_0xaa5f('0x28')][_0xaa5f('0x45')](_0x231ad1[_0xaa5f('0x46')],{})[_0xaa5f('0x21')](function(_0x16f8bf){var _0x3ea553=_0x231ad1[_0xaa5f('0x47')][_0xaa5f('0x48')]({'plain':!![]});if(!_0x3ea553)throw new Error(_0xaa5f('0x49'));if(_0x3ea553[_0xaa5f('0x4a')]===_0xaa5f('0x47')){var _0x554e6d=_0x16f8bf[_0xaa5f('0x48')]({'plain':!![]});var _0x242cd3=_0xaa5f('0x22');return db[_0xaa5f('0x4b')][_0xaa5f('0x44')]({'where':{'name':_0x242cd3,'userProfileId':_0x3ea553[_0xaa5f('0x4c')]},'raw':!![]})[_0xaa5f('0x21')](function(_0x4aa556){if(_0x4aa556&&_0x4aa556[_0xaa5f('0x4d')]===0x0){return db[_0xaa5f('0x4e')][_0xaa5f('0x45')]({'name':_0x554e6d[_0xaa5f('0x26')],'resourceId':_0x554e6d['id'],'type':_0x4aa556['name'],'sectionId':_0x4aa556['id']},{})[_0xaa5f('0x21')](function(){return _0x16f8bf;});}else{return _0x16f8bf;}})[_0xaa5f('0x3e')](function(_0x36c4aa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c4aa);throw _0x36c4aa;});}return _0x16f8bf;})['then'](respondWithResult(_0x27ea4b,0xc9))['catch'](handleError(_0x27ea4b,null));};exports['update']=function(_0x509c61,_0x1f47a0){if(_0x509c61[_0xaa5f('0x46')]['id']){delete _0x509c61[_0xaa5f('0x46')]['id'];}return db[_0xaa5f('0x28')][_0xaa5f('0x44')]({'where':{'id':_0x509c61[_0xaa5f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f47a0,null))['then'](saveUpdates(_0x509c61[_0xaa5f('0x46')],null))[_0xaa5f('0x21')](respondWithResult(_0x1f47a0,null))['catch'](handleError(_0x1f47a0,null));};exports[_0xaa5f('0x23')]=function(_0x2e6895,_0x2b815d){return db[_0xaa5f('0x28')][_0xaa5f('0x44')]({'where':{'id':_0x2e6895[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x21')](handleEntityNotFound(_0x2b815d,null))['then'](removeEntity(_0x2b815d,null))['catch'](handleError(_0x2b815d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 7c8c0a5..b4a4f3b 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 _0x9641=['request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','bluebird'];(function(_0x1e06d9,_0x223006){var _0x13fb1f=function(_0x49600d){while(--_0x49600d){_0x1e06d9['push'](_0x1e06d9['shift']());}};_0x13fb1f(++_0x223006);}(_0x9641,0xf9));var _0x1964=function(_0x2d25a2,_0x134e12){_0x2d25a2=_0x2d25a2-0x0;var _0x5ca405=_0x9641[_0x2d25a2];return _0x5ca405;};'use strict';var _=require(_0x1964('0x0'));var util=require(_0x1964('0x1'));var logger=require(_0x1964('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1964('0x3'));var rp=require(_0x1964('0x4'));var fs=require('fs');var path=require(_0x1964('0x5'));var rimraf=require(_0x1964('0x6'));var config=require('../../config/environment');var attributes=require(_0x1964('0x7'));module['exports']=function(_0x5d98b0,_0x30e355){return _0x5d98b0[_0x1964('0x8')](_0x1964('0x9'),attributes,{'tableName':_0x1964('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9120=['AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x9120,0x141));var _0x0912=function(_0x32d728,_0x3e3fa7){_0x32d728=_0x32d728-0x0;var _0x42dc5f=_0x9120[_0x32d728];return _0x42dc5f;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var logger=require('../../config/logger')(_0x0912('0x2'));var moment=require(_0x0912('0x3'));var BPromise=require(_0x0912('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0912('0x5'));var rimraf=require(_0x0912('0x6'));var config=require(_0x0912('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x46aba6,_0x3c1996){return _0x46aba6[_0x0912('0x8')](_0x0912('0x9'),attributes,{'tableName':_0x0912('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 243d7f1..9afd157 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 _0xb3ad=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x119b96,_0x587acd){var _0x516cbf=function(_0x5d4b36){while(--_0x5d4b36){_0x119b96['push'](_0x119b96['shift']());}};_0x516cbf(++_0x587acd);}(_0xb3ad,0x14a));var _0xdb3a=function(_0x1e6413,_0x39405d){_0x1e6413=_0x1e6413-0x0;var _0x6bb277=_0xb3ad[_0x1e6413];return _0x6bb277;};'use strict';var _=require(_0xdb3a('0x0'));var util=require(_0xdb3a('0x1'));var moment=require(_0xdb3a('0x2'));var BPromise=require(_0xdb3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb3a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdb3a('0x6')][_0xdb3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f477a,_0x520cf2,_0x4e2de7){return new BPromise(function(_0x57f0fa,_0x4a2581){return client[_0xdb3a('0x8')](_0x5f477a,_0x4e2de7)['then'](function(_0x2af056){logger[_0xdb3a('0x9')](_0xdb3a('0xa'),_0x520cf2,_0xdb3a('0xb'));logger[_0xdb3a('0xc')](_0xdb3a('0xd'),_0x520cf2,'request\x20sent',JSON[_0xdb3a('0xe')](_0x2af056));if(_0x2af056[_0xdb3a('0xf')]){if(_0x2af056[_0xdb3a('0xf')]['code']===0x1f4){logger[_0xdb3a('0xf')](_0xdb3a('0xa'),_0x520cf2,_0x2af056[_0xdb3a('0xf')]['message']);return _0x4a2581(_0x2af056['error'][_0xdb3a('0x10')]);}logger[_0xdb3a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x520cf2,_0x2af056['error']['message']);return _0x57f0fa(_0x2af056[_0xdb3a('0xf')]['message']);}else{logger[_0xdb3a('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x520cf2,_0xdb3a('0xb'));_0x57f0fa(_0x2af056[_0xdb3a('0x11')][_0xdb3a('0x10')]);}})[_0xdb3a('0x12')](function(_0x6642fc){logger[_0xdb3a('0xf')](_0xdb3a('0xa'),_0x520cf2,_0x6642fc);_0x4a2581(_0x6642fc);});});} \ No newline at end of file +var _0x7b58=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x484c1b,_0x39e661){var _0x1cee5b=function(_0x324d44){while(--_0x324d44){_0x484c1b['push'](_0x484c1b['shift']());}};_0x1cee5b(++_0x39e661);}(_0x7b58,0x8b));var _0x87b5=function(_0x482815,_0x3601b1){_0x482815=_0x482815-0x0;var _0x272d11=_0x7b58[_0x482815];return _0x272d11;};'use strict';var _=require('lodash');var util=require(_0x87b5('0x0'));var moment=require('moment');var BPromise=require(_0x87b5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87b5('0x2'));var db=require(_0x87b5('0x3'))['db'];var utils=require(_0x87b5('0x4'));var logger=require(_0x87b5('0x5'))(_0x87b5('0x6'));var config=require(_0x87b5('0x7'));var jayson=require(_0x87b5('0x8'));var client=jayson[_0x87b5('0x9')][_0x87b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f44d6,_0x5091e0,_0x3b2a66){return new BPromise(function(_0x1c654a,_0x48ec39){return client[_0x87b5('0xb')](_0x4f44d6,_0x3b2a66)[_0x87b5('0xc')](function(_0x1a07ff){logger[_0x87b5('0xd')](_0x87b5('0xe'),_0x5091e0,'request\x20sent');logger[_0x87b5('0xf')](_0x87b5('0x10'),_0x5091e0,_0x87b5('0x11'),JSON['stringify'](_0x1a07ff));if(_0x1a07ff['error']){if(_0x1a07ff['error'][_0x87b5('0x12')]===0x1f4){logger[_0x87b5('0x13')](_0x87b5('0xe'),_0x5091e0,_0x1a07ff[_0x87b5('0x13')][_0x87b5('0x14')]);return _0x48ec39(_0x1a07ff['error'][_0x87b5('0x14')]);}logger[_0x87b5('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x5091e0,_0x1a07ff[_0x87b5('0x13')]['message']);return _0x1c654a(_0x1a07ff[_0x87b5('0x13')]['message']);}else{logger[_0x87b5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x5091e0,'request\x20sent');_0x1c654a(_0x1a07ff['result']['message']);}})['catch'](function(_0x1be69c){logger[_0x87b5('0x13')](_0x87b5('0xe'),_0x5091e0,_0x1be69c);_0x48ec39(_0x1be69c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 634ef63..d759580 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 _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0x5027b1,_0x6c2346){var _0x5ef581=function(_0xb14398){while(--_0xb14398){_0x5027b1['push'](_0x5027b1['shift']());}};_0x5ef581(++_0x6c2346);}(_0x2542,0x169));var _0x2254=function(_0xf8007b,_0x4e7be5){_0xf8007b=_0xf8007b-0x0;var _0x42a7ec=_0x2542[_0xf8007b];return _0x42a7ec;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2254('0x5'));var config=require(_0x2254('0x6'));var controller=require(_0x2254('0x7'));router[_0x2254('0x8')]('/',auth[_0x2254('0x9')](),controller['index']);router[_0x2254('0x8')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xb')]);router[_0x2254('0xc')]('/',auth[_0x2254('0x9')](),controller[_0x2254('0xd')]);router[_0x2254('0xe')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xf')]);router['delete'](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0x10')]);module[_0x2254('0x11')]=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(_0x55e847,_0x25f0cb){var _0x170885=function(_0x2d2b8b){while(--_0x2d2b8b){_0x55e847['push'](_0x55e847['shift']());}};_0x170885(++_0x25f0cb);}(_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 6ed5813..61ab6ce 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 _0xea10=['exports','TEXT'];(function(_0x4b7c99,_0x96e395){var _0x5851ba=function(_0x53ba79){while(--_0x53ba79){_0x4b7c99['push'](_0x4b7c99['shift']());}};_0x5851ba(++_0x96e395);}(_0xea10,0x1e0));var _0x0ea1=function(_0x20d3f8,_0x5cfb13){_0x20d3f8=_0x20d3f8-0x0;var _0x2d3480=_0xea10[_0x20d3f8];return _0x2d3480;};'use strict';var Sequelize=require('sequelize');module[_0x0ea1('0x0')]={'tree':{'type':Sequelize[_0x0ea1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x183e=['exports','TEXT','sequelize'];(function(_0x34bb74,_0x1394c8){var _0x4c03a1=function(_0x47c7de){while(--_0x47c7de){_0x34bb74['push'](_0x34bb74['shift']());}};_0x4c03a1(++_0x1394c8);}(_0x183e,0x12b));var _0xe183=function(_0x32d46f,_0x4dcab3){_0x32d46f=_0x32d46f-0x0;var _0x501629=_0x183e[_0x32d46f];return _0x501629;};'use strict';var Sequelize=require(_0xe183('0x0'));module[_0xe183('0x1')]={'tree':{'type':Sequelize[_0xe183('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index ca2bd9c..341c4de 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 _0xfbc4=['sort','where','pick','map','merge','options','include','findAll','rows','catch','show','length','includeAll','create','body','update','find','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order'];(function(_0x5bb3f8,_0x5f3bcb){var _0x332911=function(_0x1bcde2){while(--_0x1bcde2){_0x5bb3f8['push'](_0x5bb3f8['shift']());}};_0x332911(++_0x5f3bcb);}(_0xfbc4,0xa6));var _0x4fbc=function(_0x6f759b,_0x3ff90f){_0x6f759b=_0x6f759b-0x0;var _0x58868a=_0xfbc4[_0x6f759b];return _0x58868a;};'use strict';var pdf=require(_0x4fbc('0x0'));var emlformat=require(_0x4fbc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4fbc('0x2'));var jsonpatch=require(_0x4fbc('0x3'));var rp=require(_0x4fbc('0x4'));var moment=require(_0x4fbc('0x5'));var BPromise=require(_0x4fbc('0x6'));var Mustache=require(_0x4fbc('0x7'));var util=require(_0x4fbc('0x8'));var path=require(_0x4fbc('0x9'));var sox=require(_0x4fbc('0xa'));var csv=require('to-csv');var ejs=require(_0x4fbc('0xb'));var fs=require('fs');var _=require(_0x4fbc('0xc'));var squel=require(_0x4fbc('0xd'));var crypto=require(_0x4fbc('0xe'));var jsforce=require(_0x4fbc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4fbc('0x10'));var Papa=require(_0x4fbc('0x11'));var Redis=require(_0x4fbc('0x12'));var authService=require(_0x4fbc('0x13'));var qs=require(_0x4fbc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fbc('0x15'))(_0x4fbc('0x16'));var utils=require(_0x4fbc('0x17'));var config=require(_0x4fbc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42041d,_0x2cc71e){_0x2cc71e=_0x2cc71e||0xcc;return function(_0x2ad68c){if(_0x2ad68c){return _0x42041d[_0x4fbc('0x19')](_0x2cc71e);}return _0x42041d[_0x4fbc('0x1a')](_0x2cc71e)[_0x4fbc('0x1b')]();};}function respondWithResult(_0x3c30c9,_0xbfeed1){_0xbfeed1=_0xbfeed1||0xc8;return function(_0x4b041a){if(_0x4b041a){return _0x3c30c9[_0x4fbc('0x1a')](_0xbfeed1)['json'](_0x4b041a);}};}function respondWithFilteredResult(_0x3e9922,_0x1a40fe){return function(_0x2805e5){if(_0x2805e5){var _0x446fd2=_0x2805e5[_0x4fbc('0x1c')],_0x52483f=_0x1a40fe[_0x4fbc('0x1d')],_0x467358=_0x1a40fe[_0x4fbc('0x1d')]+_0x1a40fe['limit'],_0x345704;if(_0x467358>=_0x446fd2){_0x467358=_0x446fd2;_0x345704=0xc8;}else{_0x345704=0xce;}_0x3e9922[_0x4fbc('0x1a')](_0x345704);return _0x3e9922['set'](_0x4fbc('0x1e'),_0x52483f+'-'+_0x467358+'/'+_0x446fd2)['json'](_0x2805e5);}return null;};}function patchUpdates(_0x48a95a){return function(_0x149603){try{jsonpatch[_0x4fbc('0x1f')](_0x149603,_0x48a95a,!![]);}catch(_0x1d51c2){return BPromise['reject'](_0x1d51c2);}return _0x149603[_0x4fbc('0x20')]();};}function saveUpdates(_0x4eaa1d,_0x185987){return function(_0x515d18){if(_0x515d18){return _0x515d18['update'](_0x4eaa1d)[_0x4fbc('0x21')](function(_0x77fa57){return _0x77fa57;});}return null;};}function removeEntity(_0x29a9e8,_0x73c82e){return function(_0x416c76){if(_0x416c76){return _0x416c76[_0x4fbc('0x22')]()[_0x4fbc('0x21')](function(){_0x29a9e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e0d8,_0x15c805){return function(_0xbdc68b){if(!_0xbdc68b){_0x44e0d8[_0x4fbc('0x19')](0x194);}return _0xbdc68b;};}function handleError(_0x1e6e83,_0xc754b1){_0xc754b1=_0xc754b1||0x1f4;return function(_0x2e74f3){logger[_0x4fbc('0x23')](_0x2e74f3[_0x4fbc('0x24')]);if(_0x2e74f3['name']){delete _0x2e74f3[_0x4fbc('0x25')];}_0x1e6e83[_0x4fbc('0x1a')](_0xc754b1)[_0x4fbc('0x26')](_0x2e74f3);};}exports[_0x4fbc('0x27')]=function(_0x3a1b81,_0x3fc164){var _0x25a379={},_0x13632e={},_0xcb4ae3={'count':0x0,'rows':[]};var _0x2b71e0=_['map'](db[_0x4fbc('0x28')][_0x4fbc('0x29')],function(_0x2febf5){return{'name':_0x2febf5[_0x4fbc('0x2a')],'type':_0x2febf5[_0x4fbc('0x2b')][_0x4fbc('0x2c')]};});_0x13632e[_0x4fbc('0x2d')]=_['map'](_0x2b71e0,'name');_0x13632e['query']=_[_0x4fbc('0x2e')](_0x3a1b81['query']);_0x13632e[_0x4fbc('0x2f')]=_['intersection'](_0x13632e[_0x4fbc('0x2d')],_0x13632e[_0x4fbc('0x30')]);_0x25a379['attributes']=_[_0x4fbc('0x31')](_0x13632e[_0x4fbc('0x2d')],qs[_0x4fbc('0x32')](_0x3a1b81[_0x4fbc('0x30')]['fields']));_0x25a379['attributes']=_0x25a379[_0x4fbc('0x33')]['length']?_0x25a379['attributes']:_0x13632e[_0x4fbc('0x2d')];if(!_0x3a1b81[_0x4fbc('0x30')][_0x4fbc('0x34')](_0x4fbc('0x35'))){_0x25a379['limit']=qs[_0x4fbc('0x36')](_0x3a1b81[_0x4fbc('0x30')]['limit']);_0x25a379[_0x4fbc('0x1d')]=qs[_0x4fbc('0x1d')](_0x3a1b81['query'][_0x4fbc('0x1d')]);}_0x25a379[_0x4fbc('0x37')]=qs[_0x4fbc('0x38')](_0x3a1b81[_0x4fbc('0x30')]['sort']);_0x25a379[_0x4fbc('0x39')]=qs[_0x4fbc('0x2f')](_[_0x4fbc('0x3a')](_0x3a1b81[_0x4fbc('0x30')],_0x13632e['filters']),_0x2b71e0);if(_0x3a1b81[_0x4fbc('0x30')]['filter']){_0x25a379[_0x4fbc('0x39')]=_['merge'](_0x25a379[_0x4fbc('0x39')],{'$or':_[_0x4fbc('0x3b')](_0x2b71e0,function(_0x35762d){if(_0x35762d[_0x4fbc('0x2b')]!=='VIRTUAL'){var _0x5e6d2b={};_0x5e6d2b[_0x35762d[_0x4fbc('0x25')]]={'$like':'%'+_0x3a1b81[_0x4fbc('0x30')]['filter']+'%'};return _0x5e6d2b;}})});}_0x25a379=_[_0x4fbc('0x3c')]({},_0x25a379,_0x3a1b81[_0x4fbc('0x3d')]);var _0x42f1d3={'where':_0x25a379['where']};return db[_0x4fbc('0x28')]['count'](_0x42f1d3)[_0x4fbc('0x21')](function(_0x3b12e6){_0xcb4ae3[_0x4fbc('0x1c')]=_0x3b12e6;if(_0x3a1b81[_0x4fbc('0x30')]['includeAll']){_0x25a379[_0x4fbc('0x3e')]=[{'all':!![]}];}return db[_0x4fbc('0x28')][_0x4fbc('0x3f')](_0x25a379);})['then'](function(_0x810f65){_0xcb4ae3[_0x4fbc('0x40')]=_0x810f65;return _0xcb4ae3;})[_0x4fbc('0x21')](respondWithFilteredResult(_0x3fc164,_0x25a379))[_0x4fbc('0x41')](handleError(_0x3fc164,null));};exports[_0x4fbc('0x42')]=function(_0x28cc8c,_0x21019f){var _0x272978={'raw':!![],'where':{'id':_0x28cc8c['params']['id']}},_0x2829fd={};_0x2829fd[_0x4fbc('0x2d')]=_[_0x4fbc('0x2e')](db['AnalyticTreeReport'][_0x4fbc('0x29')]);_0x2829fd[_0x4fbc('0x30')]=_['keys'](_0x28cc8c['query']);_0x2829fd[_0x4fbc('0x2f')]=_[_0x4fbc('0x31')](_0x2829fd[_0x4fbc('0x2d')],_0x2829fd['query']);_0x272978[_0x4fbc('0x33')]=_[_0x4fbc('0x31')](_0x2829fd[_0x4fbc('0x2d')],qs[_0x4fbc('0x32')](_0x28cc8c[_0x4fbc('0x30')][_0x4fbc('0x32')]));_0x272978[_0x4fbc('0x33')]=_0x272978[_0x4fbc('0x33')][_0x4fbc('0x43')]?_0x272978['attributes']:_0x2829fd[_0x4fbc('0x2d')];if(_0x28cc8c['query'][_0x4fbc('0x44')]){_0x272978[_0x4fbc('0x3e')]=[{'all':!![]}];}_0x272978=_['merge']({},_0x272978,_0x28cc8c[_0x4fbc('0x3d')]);return db[_0x4fbc('0x28')]['find'](_0x272978)[_0x4fbc('0x21')](handleEntityNotFound(_0x21019f,null))['then'](respondWithResult(_0x21019f,null))[_0x4fbc('0x41')](handleError(_0x21019f,null));};exports[_0x4fbc('0x45')]=function(_0x22d06c,_0x5de2b8){return db[_0x4fbc('0x28')]['create'](_0x22d06c[_0x4fbc('0x46')],{})['then'](respondWithResult(_0x5de2b8,0xc9))[_0x4fbc('0x41')](handleError(_0x5de2b8,null));};exports[_0x4fbc('0x47')]=function(_0x54b297,_0x281ac2){if(_0x54b297[_0x4fbc('0x46')]['id']){delete _0x54b297[_0x4fbc('0x46')]['id'];}return db[_0x4fbc('0x28')][_0x4fbc('0x48')]({'where':{'id':_0x54b297[_0x4fbc('0x49')]['id']}})[_0x4fbc('0x21')](handleEntityNotFound(_0x281ac2,null))['then'](saveUpdates(_0x54b297[_0x4fbc('0x46')],null))[_0x4fbc('0x21')](respondWithResult(_0x281ac2,null))[_0x4fbc('0x41')](handleError(_0x281ac2,null));};exports['destroy']=function(_0x29087a,_0x27e72f){return db[_0x4fbc('0x28')][_0x4fbc('0x48')]({'where':{'id':_0x29087a[_0x4fbc('0x49')]['id']}})['then'](handleEntityNotFound(_0x27e72f,null))[_0x4fbc('0x21')](removeEntity(_0x27e72f,null))['catch'](handleError(_0x27e72f,null));}; \ No newline at end of file +var _0xc98c=['sox','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','apply','reject','save','update','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0xc98c,0x1ba));var _0xcc98=function(_0x2add96,_0x166a6a){_0x2add96=_0x2add96-0x0;var _0xa59bc=_0xc98c[_0x2add96];return _0xa59bc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xcc98('0x0'));var zipdir=require(_0xcc98('0x1'));var jsonpatch=require(_0xcc98('0x2'));var rp=require(_0xcc98('0x3'));var moment=require(_0xcc98('0x4'));var BPromise=require(_0xcc98('0x5'));var Mustache=require(_0xcc98('0x6'));var util=require(_0xcc98('0x7'));var path=require('path');var sox=require(_0xcc98('0x8'));var csv=require('to-csv');var ejs=require(_0xcc98('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc98('0xa'));var crypto=require(_0xcc98('0xb'));var jsforce=require(_0xcc98('0xc'));var deskjs=require(_0xcc98('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcc98('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcc98('0xf'));var qs=require(_0xcc98('0x10'));var as=require(_0xcc98('0x11'));var hardwareService=require(_0xcc98('0x12'));var logger=require(_0xcc98('0x13'))(_0xcc98('0x14'));var utils=require(_0xcc98('0x15'));var config=require(_0xcc98('0x16'));var db=require(_0xcc98('0x17'))['db'];function respondWithStatusCode(_0x21fb9e,_0x2ec386){_0x2ec386=_0x2ec386||0xcc;return function(_0x434af3){if(_0x434af3){return _0x21fb9e[_0xcc98('0x18')](_0x2ec386);}return _0x21fb9e['status'](_0x2ec386)[_0xcc98('0x19')]();};}function respondWithResult(_0x2f9e7e,_0x3717a5){_0x3717a5=_0x3717a5||0xc8;return function(_0x588e7c){if(_0x588e7c){return _0x2f9e7e[_0xcc98('0x1a')](_0x3717a5)[_0xcc98('0x1b')](_0x588e7c);}};}function respondWithFilteredResult(_0x542aee,_0x1976ad){return function(_0xfc16b4){if(_0xfc16b4){var _0x360bc3=_0xfc16b4[_0xcc98('0x1c')],_0x238447=_0x1976ad[_0xcc98('0x1d')],_0x2c31e8=_0x1976ad[_0xcc98('0x1d')]+_0x1976ad['limit'],_0x14d9b6;if(_0x2c31e8>=_0x360bc3){_0x2c31e8=_0x360bc3;_0x14d9b6=0xc8;}else{_0x14d9b6=0xce;}_0x542aee[_0xcc98('0x1a')](_0x14d9b6);return _0x542aee['set']('Content-Range',_0x238447+'-'+_0x2c31e8+'/'+_0x360bc3)[_0xcc98('0x1b')](_0xfc16b4);}return null;};}function patchUpdates(_0x3e571d){return function(_0x38f036){try{jsonpatch[_0xcc98('0x1e')](_0x38f036,_0x3e571d,!![]);}catch(_0x369fe2){return BPromise[_0xcc98('0x1f')](_0x369fe2);}return _0x38f036[_0xcc98('0x20')]();};}function saveUpdates(_0x5c7c12,_0x206978){return function(_0xf4900d){if(_0xf4900d){return _0xf4900d[_0xcc98('0x21')](_0x5c7c12)['then'](function(_0xdbb134){return _0xdbb134;});}return null;};}function removeEntity(_0x1bad20,_0x24df82){return function(_0x3d305c){if(_0x3d305c){return _0x3d305c['destroy']()['then'](function(){_0x1bad20[_0xcc98('0x1a')](0xcc)[_0xcc98('0x19')]();});}};}function handleEntityNotFound(_0x3a00d9,_0x5f3992){return function(_0x1967a2){if(!_0x1967a2){_0x3a00d9[_0xcc98('0x18')](0x194);}return _0x1967a2;};}function handleError(_0x28abc4,_0xde4ff6){_0xde4ff6=_0xde4ff6||0x1f4;return function(_0x43e2e9){logger[_0xcc98('0x22')](_0x43e2e9[_0xcc98('0x23')]);if(_0x43e2e9[_0xcc98('0x24')]){delete _0x43e2e9[_0xcc98('0x24')];}_0x28abc4['status'](_0xde4ff6)[_0xcc98('0x25')](_0x43e2e9);};}exports[_0xcc98('0x26')]=function(_0x3b2d0d,_0x1cac2c){var _0x389421={},_0x25b388={},_0x20a032={'count':0x0,'rows':[]};var _0x4452f0=_[_0xcc98('0x27')](db[_0xcc98('0x28')]['rawAttributes'],function(_0x27da76){return{'name':_0x27da76[_0xcc98('0x29')],'type':_0x27da76[_0xcc98('0x2a')][_0xcc98('0x2b')]};});_0x25b388['model']=_['map'](_0x4452f0,_0xcc98('0x24'));_0x25b388['query']=_[_0xcc98('0x2c')](_0x3b2d0d[_0xcc98('0x2d')]);_0x25b388[_0xcc98('0x2e')]=_[_0xcc98('0x2f')](_0x25b388[_0xcc98('0x30')],_0x25b388['query']);_0x389421[_0xcc98('0x31')]=_[_0xcc98('0x2f')](_0x25b388[_0xcc98('0x30')],qs[_0xcc98('0x32')](_0x3b2d0d[_0xcc98('0x2d')][_0xcc98('0x32')]));_0x389421[_0xcc98('0x31')]=_0x389421[_0xcc98('0x31')][_0xcc98('0x33')]?_0x389421[_0xcc98('0x31')]:_0x25b388[_0xcc98('0x30')];if(!_0x3b2d0d['query'][_0xcc98('0x34')](_0xcc98('0x35'))){_0x389421[_0xcc98('0x36')]=qs[_0xcc98('0x36')](_0x3b2d0d['query'][_0xcc98('0x36')]);_0x389421[_0xcc98('0x1d')]=qs['offset'](_0x3b2d0d[_0xcc98('0x2d')]['offset']);}_0x389421[_0xcc98('0x37')]=qs[_0xcc98('0x38')](_0x3b2d0d[_0xcc98('0x2d')][_0xcc98('0x38')]);_0x389421[_0xcc98('0x39')]=qs['filters'](_[_0xcc98('0x3a')](_0x3b2d0d[_0xcc98('0x2d')],_0x25b388['filters']),_0x4452f0);if(_0x3b2d0d[_0xcc98('0x2d')]['filter']){_0x389421[_0xcc98('0x39')]=_[_0xcc98('0x3b')](_0x389421['where'],{'$or':_['map'](_0x4452f0,function(_0x29ceaa){if(_0x29ceaa[_0xcc98('0x2a')]!==_0xcc98('0x3c')){var _0x40f7e8={};_0x40f7e8[_0x29ceaa['name']]={'$like':'%'+_0x3b2d0d[_0xcc98('0x2d')]['filter']+'%'};return _0x40f7e8;}})});}_0x389421=_[_0xcc98('0x3b')]({},_0x389421,_0x3b2d0d[_0xcc98('0x3d')]);var _0x3a63cc={'where':_0x389421[_0xcc98('0x39')]};return db[_0xcc98('0x28')][_0xcc98('0x1c')](_0x3a63cc)[_0xcc98('0x3e')](function(_0x4c8236){_0x20a032[_0xcc98('0x1c')]=_0x4c8236;if(_0x3b2d0d[_0xcc98('0x2d')]['includeAll']){_0x389421[_0xcc98('0x3f')]=[{'all':!![]}];}return db[_0xcc98('0x28')][_0xcc98('0x40')](_0x389421);})[_0xcc98('0x3e')](function(_0x3446ab){_0x20a032[_0xcc98('0x41')]=_0x3446ab;return _0x20a032;})[_0xcc98('0x3e')](respondWithFilteredResult(_0x1cac2c,_0x389421))[_0xcc98('0x42')](handleError(_0x1cac2c,null));};exports[_0xcc98('0x43')]=function(_0x1ec541,_0x19eb3f){var _0x5c1e77={'raw':!![],'where':{'id':_0x1ec541[_0xcc98('0x44')]['id']}},_0x550048={};_0x550048[_0xcc98('0x30')]=_[_0xcc98('0x2c')](db[_0xcc98('0x28')][_0xcc98('0x45')]);_0x550048[_0xcc98('0x2d')]=_[_0xcc98('0x2c')](_0x1ec541[_0xcc98('0x2d')]);_0x550048[_0xcc98('0x2e')]=_[_0xcc98('0x2f')](_0x550048['model'],_0x550048[_0xcc98('0x2d')]);_0x5c1e77[_0xcc98('0x31')]=_[_0xcc98('0x2f')](_0x550048[_0xcc98('0x30')],qs[_0xcc98('0x32')](_0x1ec541[_0xcc98('0x2d')][_0xcc98('0x32')]));_0x5c1e77[_0xcc98('0x31')]=_0x5c1e77['attributes'][_0xcc98('0x33')]?_0x5c1e77[_0xcc98('0x31')]:_0x550048[_0xcc98('0x30')];if(_0x1ec541['query'][_0xcc98('0x46')]){_0x5c1e77[_0xcc98('0x3f')]=[{'all':!![]}];}_0x5c1e77=_['merge']({},_0x5c1e77,_0x1ec541[_0xcc98('0x3d')]);return db[_0xcc98('0x28')]['find'](_0x5c1e77)[_0xcc98('0x3e')](handleEntityNotFound(_0x19eb3f,null))[_0xcc98('0x3e')](respondWithResult(_0x19eb3f,null))['catch'](handleError(_0x19eb3f,null));};exports[_0xcc98('0x47')]=function(_0x28189b,_0x4bec49){return db[_0xcc98('0x28')][_0xcc98('0x47')](_0x28189b[_0xcc98('0x48')],{})['then'](respondWithResult(_0x4bec49,0xc9))[_0xcc98('0x42')](handleError(_0x4bec49,null));};exports['update']=function(_0x50616a,_0x1705e7){if(_0x50616a[_0xcc98('0x48')]['id']){delete _0x50616a[_0xcc98('0x48')]['id'];}return db[_0xcc98('0x28')][_0xcc98('0x49')]({'where':{'id':_0x50616a[_0xcc98('0x44')]['id']}})[_0xcc98('0x3e')](handleEntityNotFound(_0x1705e7,null))[_0xcc98('0x3e')](saveUpdates(_0x50616a['body'],null))[_0xcc98('0x3e')](respondWithResult(_0x1705e7,null))['catch'](handleError(_0x1705e7,null));};exports[_0xcc98('0x4a')]=function(_0x65c32a,_0x252efc){return db['AnalyticTreeReport'][_0xcc98('0x49')]({'where':{'id':_0x65c32a[_0xcc98('0x44')]['id']}})[_0xcc98('0x3e')](handleEntityNotFound(_0x252efc,null))[_0xcc98('0x3e')](removeEntity(_0x252efc,null))[_0xcc98('0x42')](handleError(_0x252efc,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 267375e..e4e28c4 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 _0x7bd6=['define','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0x51afd2,_0x1c238c){var _0x30a347=function(_0x5cca66){while(--_0x5cca66){_0x51afd2['push'](_0x51afd2['shift']());}};_0x30a347(++_0x1c238c);}(_0x7bd6,0x178));var _0x67bd=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x7bd6[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x67bd('0x0'));var util=require(_0x67bd('0x1'));var logger=require(_0x67bd('0x2'))(_0x67bd('0x3'));var moment=require(_0x67bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x67bd('0x5'));var fs=require('fs');var path=require(_0x67bd('0x6'));var rimraf=require(_0x67bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x67bd('0x8'));module['exports']=function(_0x2043a3,_0x5996ea){return _0x2043a3[_0x67bd('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x67bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xade8=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x12a5ac,_0x4cb0d2){var _0x282958=function(_0x3ae041){while(--_0x3ae041){_0x12a5ac['push'](_0x12a5ac['shift']());}};_0x282958(++_0x4cb0d2);}(_0xade8,0xe3));var _0x8ade=function(_0xa77f8b,_0x3a8fdb){_0xa77f8b=_0xa77f8b-0x0;var _0x341b0d=_0xade8[_0xa77f8b];return _0x341b0d;};'use strict';var _=require(_0x8ade('0x0'));var util=require(_0x8ade('0x1'));var logger=require('../../config/logger')(_0x8ade('0x2'));var moment=require(_0x8ade('0x3'));var BPromise=require(_0x8ade('0x4'));var rp=require(_0x8ade('0x5'));var fs=require('fs');var path=require(_0x8ade('0x6'));var rimraf=require(_0x8ade('0x7'));var config=require(_0x8ade('0x8'));var attributes=require(_0x8ade('0x9'));module[_0x8ade('0xa')]=function(_0x276ed3,_0x42ab64){return _0x276ed3[_0x8ade('0xb')](_0x8ade('0xc'),attributes,{'tableName':_0x8ade('0xd'),'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 c57683a..bbe89ca 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 _0xe030=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x5d02c9,_0x5adbd0){var _0x1abd12=function(_0x48deb4){while(--_0x48deb4){_0x5d02c9['push'](_0x5d02c9['shift']());}};_0x1abd12(++_0x5adbd0);}(_0xe030,0xaf));var _0x0e03=function(_0xb4e2df,_0x1cbb7c){_0xb4e2df=_0xb4e2df-0x0;var _0x5e95ba=_0xe030[_0xb4e2df];return _0x5e95ba;};'use strict';var _=require(_0x0e03('0x0'));var util=require(_0x0e03('0x1'));var moment=require(_0x0e03('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e03('0x3'));var fs=require('fs');var Redis=require(_0x0e03('0x4'));var db=require(_0x0e03('0x5'))['db'];var utils=require(_0x0e03('0x6'));var logger=require(_0x0e03('0x7'))(_0x0e03('0x8'));var config=require(_0x0e03('0x9'));var jayson=require(_0x0e03('0xa'));var client=jayson[_0x0e03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d3d98,_0x1bc484,_0x3dd215){return new BPromise(function(_0x240588,_0x23f874){return client['request'](_0x3d3d98,_0x3dd215)[_0x0e03('0xc')](function(_0x614bd7){logger['info'](_0x0e03('0xd'),_0x1bc484,_0x0e03('0xe'));logger['debug'](_0x0e03('0xf'),_0x1bc484,_0x0e03('0xe'),JSON[_0x0e03('0x10')](_0x614bd7));if(_0x614bd7[_0x0e03('0x11')]){if(_0x614bd7[_0x0e03('0x11')]['code']===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x1bc484,_0x614bd7[_0x0e03('0x11')][_0x0e03('0x12')]);return _0x23f874(_0x614bd7[_0x0e03('0x11')][_0x0e03('0x12')]);}logger['error'](_0x0e03('0xd'),_0x1bc484,_0x614bd7[_0x0e03('0x11')][_0x0e03('0x12')]);return _0x240588(_0x614bd7[_0x0e03('0x11')][_0x0e03('0x12')]);}else{logger[_0x0e03('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1bc484,_0x0e03('0xe'));_0x240588(_0x614bd7[_0x0e03('0x14')][_0x0e03('0x12')]);}})[_0x0e03('0x15')](function(_0x58f5d7){logger[_0x0e03('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1bc484,_0x58f5d7);_0x23f874(_0x58f5d7);});});} \ No newline at end of file +var _0x0b8f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x2920f6,_0x28b957){var _0x46efaa=function(_0x6a2bc){while(--_0x6a2bc){_0x2920f6['push'](_0x2920f6['shift']());}};_0x46efaa(++_0x28b957);}(_0x0b8f,0x105));var _0xf0b8=function(_0x341cb0,_0x5281eb){_0x341cb0=_0x341cb0-0x0;var _0x11e21d=_0x0b8f[_0x341cb0];return _0x11e21d;};'use strict';var _=require(_0xf0b8('0x0'));var util=require(_0xf0b8('0x1'));var moment=require(_0xf0b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0b8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0b8('0x4'))['db'];var utils=require(_0xf0b8('0x5'));var logger=require(_0xf0b8('0x6'))(_0xf0b8('0x7'));var config=require(_0xf0b8('0x8'));var jayson=require(_0xf0b8('0x9'));var client=jayson[_0xf0b8('0xa')][_0xf0b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11be94,_0x423682,_0x5752c0){return new BPromise(function(_0x109592,_0x1406c5){return client[_0xf0b8('0xc')](_0x11be94,_0x5752c0)['then'](function(_0x147de4){logger[_0xf0b8('0xd')](_0xf0b8('0xe'),_0x423682,_0xf0b8('0xf'));logger[_0xf0b8('0x10')](_0xf0b8('0x11'),_0x423682,_0xf0b8('0xf'),JSON[_0xf0b8('0x12')](_0x147de4));if(_0x147de4[_0xf0b8('0x13')]){if(_0x147de4[_0xf0b8('0x13')]['code']===0x1f4){logger[_0xf0b8('0x13')](_0xf0b8('0xe'),_0x423682,_0x147de4['error'][_0xf0b8('0x14')]);return _0x1406c5(_0x147de4[_0xf0b8('0x13')][_0xf0b8('0x14')]);}logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x423682,_0x147de4[_0xf0b8('0x13')][_0xf0b8('0x14')]);return _0x109592(_0x147de4['error'][_0xf0b8('0x14')]);}else{logger[_0xf0b8('0xd')](_0xf0b8('0xe'),_0x423682,_0xf0b8('0xf'));_0x109592(_0x147de4[_0xf0b8('0x15')][_0xf0b8('0x14')]);}})['catch'](function(_0x25044d){logger[_0xf0b8('0x13')](_0xf0b8('0xe'),_0x423682,_0x25044d);_0x1406c5(_0x25044d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 8775a51..1410c5a 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 _0x6a4e=['show','post','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index'];(function(_0x26ecbc,_0x2f8aef){var _0x25d408=function(_0x1c2a51){while(--_0x1c2a51){_0x26ecbc['push'](_0x26ecbc['shift']());}};_0x25d408(++_0x2f8aef);}(_0x6a4e,0x139));var _0xe6a4=function(_0x5cfa35,_0x5eb7f0){_0x5cfa35=_0x5cfa35-0x0;var _0xf7dffb=_0x6a4e[_0x5cfa35];return _0xf7dffb;};'use strict';var multer=require(_0xe6a4('0x0'));var util=require(_0xe6a4('0x1'));var path=require(_0xe6a4('0x2'));var timeout=require(_0xe6a4('0x3'));var express=require('express');var router=express[_0xe6a4('0x4')]();var auth=require(_0xe6a4('0x5'));var interaction=require(_0xe6a4('0x6'));var config=require('../../config/environment');var controller=require(_0xe6a4('0x7'));router[_0xe6a4('0x8')]('/',auth['isAuthenticated'](),controller[_0xe6a4('0x9')]);router[_0xe6a4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe6a4('0xa')]);router[_0xe6a4('0xb')]('/',auth[_0xe6a4('0xc')](),controller[_0xe6a4('0xd')]);router[_0xe6a4('0xe')](_0xe6a4('0xf'),auth['isAuthenticated'](),controller[_0xe6a4('0x10')]);router[_0xe6a4('0x11')]('/:id',auth[_0xe6a4('0xc')](),controller['destroy']);module[_0xe6a4('0x12')]=router; \ No newline at end of file +var _0x02fe=['Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x33f1f1,_0x3f2a10){var _0x3052d4=function(_0x2d62ad){while(--_0x2d62ad){_0x33f1f1['push'](_0x33f1f1['shift']());}};_0x3052d4(++_0x3f2a10);}(_0x02fe,0x105));var _0xe02f=function(_0x23c581,_0x43d94d){_0x23c581=_0x23c581-0x0;var _0x188e1e=_0x02fe[_0x23c581];return _0x188e1e;};'use strict';var multer=require(_0xe02f('0x0'));var util=require(_0xe02f('0x1'));var path=require(_0xe02f('0x2'));var timeout=require(_0xe02f('0x3'));var express=require(_0xe02f('0x4'));var router=express[_0xe02f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe02f('0x6'));var config=require(_0xe02f('0x7'));var controller=require(_0xe02f('0x8'));router[_0xe02f('0x9')]('/',auth[_0xe02f('0xa')](),controller[_0xe02f('0xb')]);router[_0xe02f('0x9')](_0xe02f('0xc'),auth[_0xe02f('0xa')](),controller['show']);router[_0xe02f('0xd')]('/',auth['isAuthenticated'](),controller[_0xe02f('0xe')]);router[_0xe02f('0xf')](_0xe02f('0xc'),auth['isAuthenticated'](),controller[_0xe02f('0x10')]);router[_0xe02f('0x11')]('/:id',auth[_0xe02f('0xa')](),controller[_0xe02f('0x12')]);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 38bcc98..b26af50 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 _0x9043=['exports','STRING'];(function(_0x35c33d,_0x46defa){var _0x5139b3=function(_0x427391){while(--_0x427391){_0x35c33d['push'](_0x35c33d['shift']());}};_0x5139b3(++_0x46defa);}(_0x9043,0xd0));var _0x3904=function(_0x2d9ae8,_0x3985fc){_0x2d9ae8=_0x2d9ae8-0x0;var _0x2be845=_0x9043[_0x2d9ae8];return _0x2be845;};'use strict';var Sequelize=require('sequelize');module[_0x3904('0x0')]={'name':{'type':Sequelize[_0x3904('0x1')]},'basename':{'type':Sequelize[_0x3904('0x1')]},'type':{'type':Sequelize[_0x3904('0x1')]}}; \ No newline at end of file +var _0x32c9=['STRING'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0x32c9,0x154));var _0x932c=function(_0x229e0a,_0x288c0a){_0x229e0a=_0x229e0a-0x0;var _0x36315d=_0x32c9[_0x229e0a];return _0x36315d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x932c('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x932c('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c3dc42d..4f3983d 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 _0x5d0b=['filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','clone','find','get','omit','updatedAt','create','body','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick'];(function(_0x4a0a4c,_0x74a4f9){var _0x1a945c=function(_0x539715){while(--_0x539715){_0x4a0a4c['push'](_0x4a0a4c['shift']());}};_0x1a945c(++_0x74a4f9);}(_0x5d0b,0xce));var _0xb5d0=function(_0x32e90a,_0x317d6f){_0x32e90a=_0x32e90a-0x0;var _0x3ad167=_0x5d0b[_0x32e90a];return _0x3ad167;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb5d0('0x0'));var rimraf=require(_0xb5d0('0x1'));var zipdir=require(_0xb5d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb5d0('0x3'));var BPromise=require(_0xb5d0('0x4'));var Mustache=require(_0xb5d0('0x5'));var util=require(_0xb5d0('0x6'));var path=require('path');var sox=require(_0xb5d0('0x7'));var csv=require('to-csv');var ejs=require(_0xb5d0('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb5d0('0x9'));var crypto=require(_0xb5d0('0xa'));var jsforce=require(_0xb5d0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb5d0('0xc'));var querystring=require(_0xb5d0('0xd'));var Papa=require(_0xb5d0('0xe'));var Redis=require(_0xb5d0('0xf'));var authService=require(_0xb5d0('0x10'));var qs=require(_0xb5d0('0x11'));var as=require(_0xb5d0('0x12'));var hardwareService=require(_0xb5d0('0x13'));var logger=require(_0xb5d0('0x14'))(_0xb5d0('0x15'));var utils=require(_0xb5d0('0x16'));var config=require(_0xb5d0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34634c,_0x506bdd){_0x506bdd=_0x506bdd||0xcc;return function(_0x32ac37){if(_0x32ac37){return _0x34634c['sendStatus'](_0x506bdd);}return _0x34634c[_0xb5d0('0x18')](_0x506bdd)[_0xb5d0('0x19')]();};}function respondWithResult(_0xecddbc,_0x13a49d){_0x13a49d=_0x13a49d||0xc8;return function(_0x56bfc0){if(_0x56bfc0){return _0xecddbc['status'](_0x13a49d)[_0xb5d0('0x1a')](_0x56bfc0);}};}function respondWithFilteredResult(_0x21e17d,_0x586ea0){return function(_0x212c58){if(_0x212c58){var _0x4ef1d3=_0x212c58[_0xb5d0('0x1b')],_0x19dc79=_0x586ea0[_0xb5d0('0x1c')],_0x1fda26=_0x586ea0[_0xb5d0('0x1c')]+_0x586ea0[_0xb5d0('0x1d')],_0x139a40;if(_0x1fda26>=_0x4ef1d3){_0x1fda26=_0x4ef1d3;_0x139a40=0xc8;}else{_0x139a40=0xce;}_0x21e17d['status'](_0x139a40);return _0x21e17d[_0xb5d0('0x1e')](_0xb5d0('0x1f'),_0x19dc79+'-'+_0x1fda26+'/'+_0x4ef1d3)['json'](_0x212c58);}return null;};}function patchUpdates(_0x1a0417){return function(_0x2d4fe0){try{jsonpatch[_0xb5d0('0x20')](_0x2d4fe0,_0x1a0417,!![]);}catch(_0x33fb84){return BPromise[_0xb5d0('0x21')](_0x33fb84);}return _0x2d4fe0[_0xb5d0('0x22')]();};}function saveUpdates(_0x3d5987,_0x14a0b3){return function(_0x47173a){if(_0x47173a){return _0x47173a[_0xb5d0('0x23')](_0x3d5987)[_0xb5d0('0x24')](function(_0x58eb35){return _0x58eb35;});}return null;};}function removeEntity(_0x23cc12,_0x255343){return function(_0x4cc991){if(_0x4cc991){return _0x4cc991[_0xb5d0('0x25')]()['then'](function(){_0x23cc12[_0xb5d0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x565768,_0x4de414){return function(_0x4cfb80){if(!_0x4cfb80){_0x565768[_0xb5d0('0x26')](0x194);}return _0x4cfb80;};}function handleError(_0xd8119f,_0x399e46){_0x399e46=_0x399e46||0x1f4;return function(_0x179f00){logger[_0xb5d0('0x27')](_0x179f00[_0xb5d0('0x28')]);if(_0x179f00[_0xb5d0('0x29')]){delete _0x179f00['name'];}_0xd8119f[_0xb5d0('0x18')](_0x399e46)[_0xb5d0('0x2a')](_0x179f00);};}exports[_0xb5d0('0x2b')]=function(_0x2f4ba1,_0x3d7807){var _0x13062d={},_0x3a7e84={},_0x4ca125={'count':0x0,'rows':[]};var _0x36fd27=_[_0xb5d0('0x2c')](db[_0xb5d0('0x2d')][_0xb5d0('0x2e')],function(_0x29fe9e){return{'name':_0x29fe9e['fieldName'],'type':_0x29fe9e[_0xb5d0('0x2f')][_0xb5d0('0x30')]};});_0x3a7e84[_0xb5d0('0x31')]=_[_0xb5d0('0x2c')](_0x36fd27,_0xb5d0('0x29'));_0x3a7e84[_0xb5d0('0x32')]=_[_0xb5d0('0x33')](_0x2f4ba1[_0xb5d0('0x32')]);_0x3a7e84[_0xb5d0('0x34')]=_[_0xb5d0('0x35')](_0x3a7e84[_0xb5d0('0x31')],_0x3a7e84['query']);_0x13062d[_0xb5d0('0x36')]=_[_0xb5d0('0x35')](_0x3a7e84[_0xb5d0('0x31')],qs[_0xb5d0('0x37')](_0x2f4ba1['query'][_0xb5d0('0x37')]));_0x13062d[_0xb5d0('0x36')]=_0x13062d[_0xb5d0('0x36')][_0xb5d0('0x38')]?_0x13062d[_0xb5d0('0x36')]:_0x3a7e84['model'];if(!_0x2f4ba1[_0xb5d0('0x32')]['hasOwnProperty'](_0xb5d0('0x39'))){_0x13062d[_0xb5d0('0x1d')]=qs[_0xb5d0('0x1d')](_0x2f4ba1['query'][_0xb5d0('0x1d')]);_0x13062d[_0xb5d0('0x1c')]=qs[_0xb5d0('0x1c')](_0x2f4ba1[_0xb5d0('0x32')]['offset']);}_0x13062d[_0xb5d0('0x3a')]=qs['sort'](_0x2f4ba1[_0xb5d0('0x32')][_0xb5d0('0x3b')]);_0x13062d['where']=qs[_0xb5d0('0x34')](_[_0xb5d0('0x3c')](_0x2f4ba1[_0xb5d0('0x32')],_0x3a7e84['filters']),_0x36fd27);if(_0x2f4ba1['query'][_0xb5d0('0x3d')]){_0x13062d[_0xb5d0('0x3e')]=_[_0xb5d0('0x3f')](_0x13062d[_0xb5d0('0x3e')],{'$or':_[_0xb5d0('0x2c')](_0x36fd27,function(_0x1f591c){if(_0x1f591c[_0xb5d0('0x2f')]!==_0xb5d0('0x40')){var _0x34c551={};_0x34c551[_0x1f591c[_0xb5d0('0x29')]]={'$like':'%'+_0x2f4ba1[_0xb5d0('0x32')][_0xb5d0('0x3d')]+'%'};return _0x34c551;}})});}_0x13062d=_[_0xb5d0('0x3f')]({},_0x13062d,_0x2f4ba1[_0xb5d0('0x41')]);var _0x1bf7aa={'where':_0x13062d[_0xb5d0('0x3e')]};return db[_0xb5d0('0x2d')][_0xb5d0('0x1b')](_0x1bf7aa)[_0xb5d0('0x24')](function(_0x4d0d29){_0x4ca125['count']=_0x4d0d29;if(_0x2f4ba1[_0xb5d0('0x32')][_0xb5d0('0x42')]){_0x13062d['include']=[{'all':!![]}];}return db[_0xb5d0('0x2d')][_0xb5d0('0x43')](_0x13062d);})[_0xb5d0('0x24')](function(_0xc02022){_0x4ca125[_0xb5d0('0x44')]=_0xc02022;return _0x4ca125;})[_0xb5d0('0x24')](respondWithFilteredResult(_0x3d7807,_0x13062d))[_0xb5d0('0x45')](handleError(_0x3d7807,null));};exports[_0xb5d0('0x46')]=function(_0x16953c,_0x523e23){var _0x43fa69={'raw':!![],'where':{'id':_0x16953c[_0xb5d0('0x47')]['id']}},_0x4f132f={};_0x4f132f[_0xb5d0('0x31')]=_['keys'](db[_0xb5d0('0x2d')]['rawAttributes']);_0x4f132f[_0xb5d0('0x32')]=_[_0xb5d0('0x33')](_0x16953c[_0xb5d0('0x32')]);_0x4f132f[_0xb5d0('0x34')]=_['intersection'](_0x4f132f[_0xb5d0('0x31')],_0x4f132f[_0xb5d0('0x32')]);_0x43fa69['attributes']=_[_0xb5d0('0x35')](_0x4f132f['model'],qs[_0xb5d0('0x37')](_0x16953c[_0xb5d0('0x32')][_0xb5d0('0x37')]));_0x43fa69[_0xb5d0('0x36')]=_0x43fa69['attributes'][_0xb5d0('0x38')]?_0x43fa69[_0xb5d0('0x36')]:_0x4f132f['model'];if(_0x16953c[_0xb5d0('0x32')][_0xb5d0('0x42')]){_0x43fa69[_0xb5d0('0x48')]=[{'all':!![]}];}_0x43fa69=_['merge']({},_0x43fa69,_0x16953c[_0xb5d0('0x41')]);return db[_0xb5d0('0x2d')]['find'](_0x43fa69)[_0xb5d0('0x24')](handleEntityNotFound(_0x523e23,null))[_0xb5d0('0x24')](respondWithResult(_0x523e23,null))['catch'](handleError(_0x523e23,null));};exports[_0xb5d0('0x49')]=function(_0x5e73af,_0x1c1744){var _0x222d0f={'where':{'id':_0x5e73af[_0xb5d0('0x47')]['id']}},_0x4cad32={};_0x4cad32[_0xb5d0('0x31')]=_[_0xb5d0('0x33')](db['Attachment']['rawAttributes']);_0x222d0f[_0xb5d0('0x36')]=_[_0xb5d0('0x35')](_0x4cad32[_0xb5d0('0x31')],qs[_0xb5d0('0x37')](_0x5e73af[_0xb5d0('0x32')]['fields']));_0x222d0f[_0xb5d0('0x36')]=_0x222d0f[_0xb5d0('0x36')][_0xb5d0('0x38')]?_0x222d0f[_0xb5d0('0x36')]:_0x4cad32[_0xb5d0('0x31')];if(_0x5e73af[_0xb5d0('0x32')][_0xb5d0('0x42')]){_0x222d0f['include']=[{'all':!![]}];}_0x222d0f=_[_0xb5d0('0x3f')]({},_0x222d0f,_0x5e73af['options']);return db[_0xb5d0('0x2d')][_0xb5d0('0x4a')](_0x222d0f)[_0xb5d0('0x24')](handleEntityNotFound(_0x1c1744,null))[_0xb5d0('0x24')](function(_0x20f4df){if(_0x20f4df){var _0x418834=_0x20f4df[_0xb5d0('0x4b')]({'plain':!![]});_0x418834=qs[_0xb5d0('0x4c')](_0x418834,['id','createdAt','updatedAt']);_0x5e73af['body']=_[_0xb5d0('0x4c')](_0x5e73af['body'],['id','createdAt',_0xb5d0('0x4d')]);return db[_0xb5d0('0x2d')][_0xb5d0('0x4e')](_['merge'](_0x418834,_0x5e73af[_0xb5d0('0x4f')]),{'include':_0x5e73af[_0xb5d0('0x32')][_0xb5d0('0x42')]?[{'all':!![]}]:undefined});}})[_0xb5d0('0x24')](respondWithResult(_0x1c1744,0xc9))[_0xb5d0('0x45')](handleError(_0x1c1744,null));};exports['update']=function(_0x430cf1,_0x54b7c2){if(_0x430cf1[_0xb5d0('0x4f')]['id']){delete _0x430cf1[_0xb5d0('0x4f')]['id'];}return db[_0xb5d0('0x2d')][_0xb5d0('0x4a')]({'where':{'id':_0x430cf1[_0xb5d0('0x47')]['id']}})['then'](handleEntityNotFound(_0x54b7c2,null))[_0xb5d0('0x24')](saveUpdates(_0x430cf1[_0xb5d0('0x4f')],null))[_0xb5d0('0x24')](respondWithResult(_0x54b7c2,null))[_0xb5d0('0x45')](handleError(_0x54b7c2,null));};exports[_0xb5d0('0x25')]=function(_0x383e24,_0x1f40dd){return db[_0xb5d0('0x2d')][_0xb5d0('0x4a')]({'where':{'id':_0x383e24['params']['id']}})['then'](handleEntityNotFound(_0x1f40dd,null))[_0xb5d0('0x24')](removeEntity(_0x1f40dd,null))[_0xb5d0('0x45')](handleError(_0x1f40dd,null));};exports[_0xb5d0('0x4e')]=function(_0x2b5c56,_0x4b3cb4,_0x55772c){_0x2b5c56[_0xb5d0('0x4f')][_0xb5d0('0x29')]=_0x2b5c56[_0xb5d0('0x50')]['originalname'];_0x2b5c56[_0xb5d0('0x4f')]['basename']=_0x2b5c56[_0xb5d0('0x50')][_0xb5d0('0x51')];_0x2b5c56[_0xb5d0('0x4f')][_0xb5d0('0x2f')]=_0x2b5c56[_0xb5d0('0x50')][_0xb5d0('0x52')];return db['Attachment'][_0xb5d0('0x4e')](_0x2b5c56[_0xb5d0('0x4f')])[_0xb5d0('0x24')](respondWithResult(_0x4b3cb4,0xc9))['catch'](handleError(_0x4b3cb4,null));};exports[_0xb5d0('0x53')]=function(_0xb0c349,_0x41fcea,_0x52c3e0){return db[_0xb5d0('0x2d')][_0xb5d0('0x54')]({'where':{'id':_0xb0c349['params']['id']},'raw':!![]})[_0xb5d0('0x24')](handleEntityNotFound(_0x41fcea,null))[_0xb5d0('0x24')](function(_0x498ae5){if(_0x498ae5){return _0x41fcea['download'](path[_0xb5d0('0x55')](config[_0xb5d0('0x56')],_0xb5d0('0x57'),_0x498ae5[_0xb5d0('0x58')]));}})['catch'](handleError(_0x41fcea,null));}; \ No newline at end of file +var _0x540d=['get','omit','createdAt','body','updatedAt','create','destroy','file','originalname','basename','filename','mimetype','download','findOne','join','root','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','end','count','offset','limit','status','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','rawAttributes','find','catch','clone','params'];(function(_0x14c66a,_0x2c05bb){var _0xf13aa0=function(_0x3a851c){while(--_0x3a851c){_0x14c66a['push'](_0x14c66a['shift']());}};_0xf13aa0(++_0x2c05bb);}(_0x540d,0x100));var _0xd540=function(_0xfc94e,_0x1976cf){_0xfc94e=_0xfc94e-0x0;var _0x13b4fe=_0x540d[_0xfc94e];return _0x13b4fe;};'use strict';var pdf=require(_0xd540('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd540('0x1'));var rp=require(_0xd540('0x2'));var moment=require(_0xd540('0x3'));var BPromise=require(_0xd540('0x4'));var Mustache=require(_0xd540('0x5'));var util=require('util');var path=require(_0xd540('0x6'));var sox=require(_0xd540('0x7'));var csv=require(_0xd540('0x8'));var ejs=require(_0xd540('0x9'));var fs=require('fs');var _=require(_0xd540('0xa'));var squel=require(_0xd540('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd540('0xc'));var authService=require(_0xd540('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd540('0xe'));var hardwareService=require(_0xd540('0xf'));var logger=require('../../config/logger')(_0xd540('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd540('0x11'))['db'];function respondWithStatusCode(_0x408841,_0x269d41){_0x269d41=_0x269d41||0xcc;return function(_0x8348da){if(_0x8348da){return _0x408841['sendStatus'](_0x269d41);}return _0x408841['status'](_0x269d41)[_0xd540('0x12')]();};}function respondWithResult(_0x179696,_0x272e34){_0x272e34=_0x272e34||0xc8;return function(_0x5cc2d2){if(_0x5cc2d2){return _0x179696['status'](_0x272e34)['json'](_0x5cc2d2);}};}function respondWithFilteredResult(_0x506651,_0x25b36a){return function(_0x3b08e3){if(_0x3b08e3){var _0xc4d6fe=_0x3b08e3[_0xd540('0x13')],_0x6326d8=_0x25b36a[_0xd540('0x14')],_0x33bb34=_0x25b36a[_0xd540('0x14')]+_0x25b36a[_0xd540('0x15')],_0x3c2da0;if(_0x33bb34>=_0xc4d6fe){_0x33bb34=_0xc4d6fe;_0x3c2da0=0xc8;}else{_0x3c2da0=0xce;}_0x506651[_0xd540('0x16')](_0x3c2da0);return _0x506651[_0xd540('0x17')]('Content-Range',_0x6326d8+'-'+_0x33bb34+'/'+_0xc4d6fe)[_0xd540('0x18')](_0x3b08e3);}return null;};}function patchUpdates(_0x297fca){return function(_0x178344){try{jsonpatch[_0xd540('0x19')](_0x178344,_0x297fca,!![]);}catch(_0x4f0b99){return BPromise[_0xd540('0x1a')](_0x4f0b99);}return _0x178344[_0xd540('0x1b')]();};}function saveUpdates(_0x5b9d4a,_0x255d38){return function(_0x2aa757){if(_0x2aa757){return _0x2aa757[_0xd540('0x1c')](_0x5b9d4a)['then'](function(_0xc308f8){return _0xc308f8;});}return null;};}function removeEntity(_0x5b5bfe,_0x2e875c){return function(_0x227e11){if(_0x227e11){return _0x227e11['destroy']()[_0xd540('0x1d')](function(){_0x5b5bfe[_0xd540('0x16')](0xcc)[_0xd540('0x12')]();});}};}function handleEntityNotFound(_0xdc1aca,_0x15cbb0){return function(_0x54846d){if(!_0x54846d){_0xdc1aca['sendStatus'](0x194);}return _0x54846d;};}function handleError(_0x42bd26,_0x192dd5){_0x192dd5=_0x192dd5||0x1f4;return function(_0x556e32){logger[_0xd540('0x1e')](_0x556e32[_0xd540('0x1f')]);if(_0x556e32[_0xd540('0x20')]){delete _0x556e32[_0xd540('0x20')];}_0x42bd26[_0xd540('0x16')](_0x192dd5)[_0xd540('0x21')](_0x556e32);};}exports[_0xd540('0x22')]=function(_0x4779c1,_0xc490de){var _0x446c1f={},_0x3df895={},_0x3b75a6={'count':0x0,'rows':[]};var _0x5b378b=_[_0xd540('0x23')](db[_0xd540('0x24')]['rawAttributes'],function(_0x42e835){return{'name':_0x42e835[_0xd540('0x25')],'type':_0x42e835[_0xd540('0x26')][_0xd540('0x27')]};});_0x3df895[_0xd540('0x28')]=_[_0xd540('0x23')](_0x5b378b,'name');_0x3df895[_0xd540('0x29')]=_[_0xd540('0x2a')](_0x4779c1[_0xd540('0x29')]);_0x3df895[_0xd540('0x2b')]=_[_0xd540('0x2c')](_0x3df895[_0xd540('0x28')],_0x3df895[_0xd540('0x29')]);_0x446c1f['attributes']=_['intersection'](_0x3df895['model'],qs[_0xd540('0x2d')](_0x4779c1[_0xd540('0x29')][_0xd540('0x2d')]));_0x446c1f[_0xd540('0x2e')]=_0x446c1f['attributes'][_0xd540('0x2f')]?_0x446c1f['attributes']:_0x3df895[_0xd540('0x28')];if(!_0x4779c1[_0xd540('0x29')][_0xd540('0x30')](_0xd540('0x31'))){_0x446c1f[_0xd540('0x15')]=qs[_0xd540('0x15')](_0x4779c1[_0xd540('0x29')][_0xd540('0x15')]);_0x446c1f['offset']=qs['offset'](_0x4779c1['query'][_0xd540('0x14')]);}_0x446c1f['order']=qs[_0xd540('0x32')](_0x4779c1[_0xd540('0x29')]['sort']);_0x446c1f[_0xd540('0x33')]=qs['filters'](_['pick'](_0x4779c1[_0xd540('0x29')],_0x3df895[_0xd540('0x2b')]),_0x5b378b);if(_0x4779c1['query'][_0xd540('0x34')]){_0x446c1f[_0xd540('0x33')]=_[_0xd540('0x35')](_0x446c1f[_0xd540('0x33')],{'$or':_[_0xd540('0x23')](_0x5b378b,function(_0x561832){if(_0x561832[_0xd540('0x26')]!==_0xd540('0x36')){var _0x24a033={};_0x24a033[_0x561832[_0xd540('0x20')]]={'$like':'%'+_0x4779c1['query']['filter']+'%'};return _0x24a033;}})});}_0x446c1f=_[_0xd540('0x35')]({},_0x446c1f,_0x4779c1['options']);var _0x39c5b9={'where':_0x446c1f[_0xd540('0x33')]};return db[_0xd540('0x24')]['count'](_0x39c5b9)[_0xd540('0x1d')](function(_0x58acf0){_0x3b75a6[_0xd540('0x13')]=_0x58acf0;if(_0x4779c1[_0xd540('0x29')][_0xd540('0x37')]){_0x446c1f[_0xd540('0x38')]=[{'all':!![]}];}return db['Attachment'][_0xd540('0x39')](_0x446c1f);})[_0xd540('0x1d')](function(_0x1807e1){_0x3b75a6['rows']=_0x1807e1;return _0x3b75a6;})['then'](respondWithFilteredResult(_0xc490de,_0x446c1f))['catch'](handleError(_0xc490de,null));};exports[_0xd540('0x3a')]=function(_0x22e219,_0x5663e1){var _0x29f8eb={'raw':!![],'where':{'id':_0x22e219['params']['id']}},_0x3d9088={};_0x3d9088[_0xd540('0x28')]=_[_0xd540('0x2a')](db[_0xd540('0x24')][_0xd540('0x3b')]);_0x3d9088[_0xd540('0x29')]=_[_0xd540('0x2a')](_0x22e219[_0xd540('0x29')]);_0x3d9088['filters']=_['intersection'](_0x3d9088['model'],_0x3d9088[_0xd540('0x29')]);_0x29f8eb[_0xd540('0x2e')]=_[_0xd540('0x2c')](_0x3d9088['model'],qs['fields'](_0x22e219[_0xd540('0x29')][_0xd540('0x2d')]));_0x29f8eb[_0xd540('0x2e')]=_0x29f8eb[_0xd540('0x2e')][_0xd540('0x2f')]?_0x29f8eb[_0xd540('0x2e')]:_0x3d9088['model'];if(_0x22e219[_0xd540('0x29')][_0xd540('0x37')]){_0x29f8eb[_0xd540('0x38')]=[{'all':!![]}];}_0x29f8eb=_[_0xd540('0x35')]({},_0x29f8eb,_0x22e219['options']);return db[_0xd540('0x24')][_0xd540('0x3c')](_0x29f8eb)['then'](handleEntityNotFound(_0x5663e1,null))['then'](respondWithResult(_0x5663e1,null))[_0xd540('0x3d')](handleError(_0x5663e1,null));};exports[_0xd540('0x3e')]=function(_0x2a4835,_0x25bf26){var _0x1454ab={'where':{'id':_0x2a4835[_0xd540('0x3f')]['id']}},_0x49a98e={};_0x49a98e[_0xd540('0x28')]=_[_0xd540('0x2a')](db['Attachment'][_0xd540('0x3b')]);_0x1454ab[_0xd540('0x2e')]=_[_0xd540('0x2c')](_0x49a98e[_0xd540('0x28')],qs[_0xd540('0x2d')](_0x2a4835[_0xd540('0x29')][_0xd540('0x2d')]));_0x1454ab[_0xd540('0x2e')]=_0x1454ab[_0xd540('0x2e')]['length']?_0x1454ab[_0xd540('0x2e')]:_0x49a98e[_0xd540('0x28')];if(_0x2a4835['query']['includeAll']){_0x1454ab[_0xd540('0x38')]=[{'all':!![]}];}_0x1454ab=_[_0xd540('0x35')]({},_0x1454ab,_0x2a4835['options']);return db['Attachment']['find'](_0x1454ab)[_0xd540('0x1d')](handleEntityNotFound(_0x25bf26,null))[_0xd540('0x1d')](function(_0xbf987){if(_0xbf987){var _0x2427d4=_0xbf987[_0xd540('0x40')]({'plain':!![]});_0x2427d4=qs[_0xd540('0x41')](_0x2427d4,['id',_0xd540('0x42'),'updatedAt']);_0x2a4835[_0xd540('0x43')]=_[_0xd540('0x41')](_0x2a4835[_0xd540('0x43')],['id',_0xd540('0x42'),_0xd540('0x44')]);return db[_0xd540('0x24')][_0xd540('0x45')](_[_0xd540('0x35')](_0x2427d4,_0x2a4835[_0xd540('0x43')]),{'include':_0x2a4835['query'][_0xd540('0x37')]?[{'all':!![]}]:undefined});}})[_0xd540('0x1d')](respondWithResult(_0x25bf26,0xc9))[_0xd540('0x3d')](handleError(_0x25bf26,null));};exports['update']=function(_0x3ba3dc,_0x1ed644){if(_0x3ba3dc['body']['id']){delete _0x3ba3dc[_0xd540('0x43')]['id'];}return db[_0xd540('0x24')]['find']({'where':{'id':_0x3ba3dc['params']['id']}})[_0xd540('0x1d')](handleEntityNotFound(_0x1ed644,null))[_0xd540('0x1d')](saveUpdates(_0x3ba3dc[_0xd540('0x43')],null))[_0xd540('0x1d')](respondWithResult(_0x1ed644,null))[_0xd540('0x3d')](handleError(_0x1ed644,null));};exports[_0xd540('0x46')]=function(_0x547b9d,_0x3099ed){return db[_0xd540('0x24')]['find']({'where':{'id':_0x547b9d[_0xd540('0x3f')]['id']}})[_0xd540('0x1d')](handleEntityNotFound(_0x3099ed,null))['then'](removeEntity(_0x3099ed,null))[_0xd540('0x3d')](handleError(_0x3099ed,null));};exports[_0xd540('0x45')]=function(_0x281049,_0x3aec76,_0x246b24){_0x281049[_0xd540('0x43')][_0xd540('0x20')]=_0x281049[_0xd540('0x47')][_0xd540('0x48')];_0x281049['body'][_0xd540('0x49')]=_0x281049[_0xd540('0x47')][_0xd540('0x4a')];_0x281049[_0xd540('0x43')][_0xd540('0x26')]=_0x281049[_0xd540('0x47')][_0xd540('0x4b')];return db[_0xd540('0x24')][_0xd540('0x45')](_0x281049[_0xd540('0x43')])[_0xd540('0x1d')](respondWithResult(_0x3aec76,0xc9))[_0xd540('0x3d')](handleError(_0x3aec76,null));};exports[_0xd540('0x4c')]=function(_0x6c2345,_0x2df7ad,_0x4825bf){return db[_0xd540('0x24')][_0xd540('0x4d')]({'where':{'id':_0x6c2345[_0xd540('0x3f')]['id']},'raw':!![]})[_0xd540('0x1d')](handleEntityNotFound(_0x2df7ad,null))['then'](function(_0x55e498){if(_0x55e498){return _0x2df7ad[_0xd540('0x4c')](path[_0xd540('0x4e')](config[_0xd540('0x4f')],'server/files/attachments/',_0x55e498[_0xd540('0x49')]));}})[_0xd540('0x3d')](handleError(_0x2df7ad,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 4acf9bf..de00fe0 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 _0x579c=['define','attachments','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x579c,0xda));var _0xc579=function(_0x220f8f,_0x55a260){_0x220f8f=_0x220f8f-0x0;var _0x288a14=_0x579c[_0x220f8f];return _0x288a14;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var moment=require(_0xc579('0x4'));var BPromise=require('bluebird');var rp=require(_0xc579('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var attributes=require(_0xc579('0x8'));module[_0xc579('0x9')]=function(_0x124ee5,_0x1bd276){return _0x124ee5[_0xc579('0xa')]('Attachment',attributes,{'tableName':_0xc579('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce3=['./attachment.attributes','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xaae0d4,_0x357c6c){var _0xdec0cf=function(_0x522afb){while(--_0x522afb){_0xaae0d4['push'](_0xaae0d4['shift']());}};_0xdec0cf(++_0x357c6c);}(_0x8ce3,0xc3));var _0x38ce=function(_0x447b8f,_0x396387){_0x447b8f=_0x447b8f-0x0;var _0x237474=_0x8ce3[_0x447b8f];return _0x237474;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var moment=require(_0x38ce('0x3'));var BPromise=require(_0x38ce('0x4'));var rp=require(_0x38ce('0x5'));var fs=require('fs');var path=require(_0x38ce('0x6'));var rimraf=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var attributes=require(_0x38ce('0x9'));module['exports']=function(_0x372f86,_0xb24f4c){return _0x372f86['define'](_0x38ce('0xa'),attributes,{'tableName':_0x38ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 4c01f1e..0806329 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 _0x2084=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','Attachment','create','body','options','CreateAttachment','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x1408b4,_0x22e866){var _0x39276b=function(_0x5d7918){while(--_0x5d7918){_0x1408b4['push'](_0x1408b4['shift']());}};_0x39276b(++_0x22e866);}(_0x2084,0x11c));var _0x4208=function(_0x61afde,_0x3b92d0){_0x61afde=_0x61afde-0x0;var _0x111608=_0x2084[_0x61afde];return _0x111608;};'use strict';var _=require('lodash');var util=require(_0x4208('0x0'));var moment=require(_0x4208('0x1'));var BPromise=require(_0x4208('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4208('0x3'));var db=require(_0x4208('0x4'))['db'];var utils=require(_0x4208('0x5'));var logger=require(_0x4208('0x6'))(_0x4208('0x7'));var config=require(_0x4208('0x8'));var jayson=require(_0x4208('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40f25e,_0x3fbf73,_0x1b1f86){return new BPromise(function(_0x4f8fcf,_0xfd47ca){return client[_0x4208('0xa')](_0x40f25e,_0x1b1f86)[_0x4208('0xb')](function(_0x17ca29){logger[_0x4208('0xc')](_0x4208('0xd'),_0x3fbf73,_0x4208('0xe'));logger[_0x4208('0xf')](_0x4208('0x10'),_0x3fbf73,_0x4208('0xe'),JSON['stringify'](_0x17ca29));if(_0x17ca29[_0x4208('0x11')]){if(_0x17ca29['error'][_0x4208('0x12')]===0x1f4){logger[_0x4208('0x11')]('Attachment,\x20%s,\x20%s',_0x3fbf73,_0x17ca29[_0x4208('0x11')][_0x4208('0x13')]);return _0xfd47ca(_0x17ca29[_0x4208('0x11')][_0x4208('0x13')]);}logger[_0x4208('0x11')](_0x4208('0xd'),_0x3fbf73,_0x17ca29[_0x4208('0x11')][_0x4208('0x13')]);return _0x4f8fcf(_0x17ca29[_0x4208('0x11')]['message']);}else{logger['info'](_0x4208('0xd'),_0x3fbf73,_0x4208('0xe'));_0x4f8fcf(_0x17ca29['result']['message']);}})[_0x4208('0x14')](function(_0x3f3ce8){logger[_0x4208('0x11')](_0x4208('0xd'),_0x3fbf73,_0x3f3ce8);_0xfd47ca(_0x3f3ce8);});});}exports['CreateAttachment']=function(_0x643948){var _0x2e034c=this;return new Promise(function(_0x364951,_0xb4441d){return db[_0x4208('0x15')][_0x4208('0x16')](_0x643948[_0x4208('0x17')],{'raw':_0x643948[_0x4208('0x18')]?_0x643948[_0x4208('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4208('0xb')](function(_0x573313){logger[_0x4208('0xc')](_0x4208('0x19'),_0x643948);logger[_0x4208('0xf')](_0x4208('0x19'),_0x643948,JSON[_0x4208('0x1a')](_0x573313));_0x364951(_0x573313);})['catch'](function(_0x442aba){logger['error']('CreateAttachment',_0x442aba['message'],_0x643948);_0xb4441d(_0x2e034c[_0x4208('0x11')](0x1f4,_0x442aba[_0x4208('0x13')]));});});}; \ No newline at end of file +var _0x985a=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','lodash','util','moment'];(function(_0x46ab02,_0x5b35ac){var _0x35870d=function(_0x3f7ac8){while(--_0x3f7ac8){_0x46ab02['push'](_0x46ab02['shift']());}};_0x35870d(++_0x5b35ac);}(_0x985a,0x14d));var _0xa985=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x985a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xa985('0x0'));var util=require(_0xa985('0x1'));var moment=require(_0xa985('0x2'));var BPromise=require(_0xa985('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa985('0x4'))['db'];var utils=require(_0xa985('0x5'));var logger=require(_0xa985('0x6'))(_0xa985('0x7'));var config=require(_0xa985('0x8'));var jayson=require(_0xa985('0x9'));var client=jayson['client'][_0xa985('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xacaf3a,_0x2db7c6,_0x2dba64){return new BPromise(function(_0x29a191,_0x229a9e){return client['request'](_0xacaf3a,_0x2dba64)[_0xa985('0xb')](function(_0x29495f){logger[_0xa985('0xc')](_0xa985('0xd'),_0x2db7c6,_0xa985('0xe'));logger['debug'](_0xa985('0xf'),_0x2db7c6,'request\x20sent',JSON[_0xa985('0x10')](_0x29495f));if(_0x29495f[_0xa985('0x11')]){if(_0x29495f[_0xa985('0x11')]['code']===0x1f4){logger[_0xa985('0x11')](_0xa985('0xd'),_0x2db7c6,_0x29495f['error'][_0xa985('0x12')]);return _0x229a9e(_0x29495f['error'][_0xa985('0x12')]);}logger[_0xa985('0x11')](_0xa985('0xd'),_0x2db7c6,_0x29495f['error']['message']);return _0x29a191(_0x29495f[_0xa985('0x11')][_0xa985('0x12')]);}else{logger[_0xa985('0xc')](_0xa985('0xd'),_0x2db7c6,_0xa985('0xe'));_0x29a191(_0x29495f[_0xa985('0x13')][_0xa985('0x12')]);}})[_0xa985('0x14')](function(_0x2a0391){logger['error']('Attachment,\x20%s,\x20%s',_0x2db7c6,_0x2a0391);_0x229a9e(_0x2a0391);});});}exports[_0xa985('0x15')]=function(_0x9bd25f){var _0x1974ec=this;return new Promise(function(_0x247653,_0x5d595e){return db[_0xa985('0x16')][_0xa985('0x17')](_0x9bd25f[_0xa985('0x18')],{'raw':_0x9bd25f['options']?_0x9bd25f[_0xa985('0x19')][_0xa985('0x1a')]===undefined?!![]:![]:!![]})[_0xa985('0xb')](function(_0xc97495){logger['info'](_0xa985('0x15'),_0x9bd25f);logger[_0xa985('0x1b')](_0xa985('0x15'),_0x9bd25f,JSON[_0xa985('0x10')](_0xc97495));_0x247653(_0xc97495);})['catch'](function(_0x3f55c4){logger[_0xa985('0x11')]('CreateAttachment',_0x3f55c4[_0xa985('0x12')],_0x9bd25f);_0x5d595e(_0x1974ec[_0xa985('0x11')](0x1f4,_0x3f55c4[_0xa985('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 0e52111..2638c91 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 _0x843e=['single','file','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname'];(function(_0x4a779c,_0x48ad01){var _0x212bea=function(_0x4d1967){while(--_0x4d1967){_0x4a779c['push'](_0x4a779c['shift']());}};_0x212bea(++_0x48ad01);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var path=require(_0xe843('0x2'));var timeout=require(_0xe843('0x3'));var express=require('express');var router=express[_0xe843('0x4')]();var auth=require(_0xe843('0x5'));var interaction=require(_0xe843('0x6'));var config=require(_0xe843('0x7'));var controller=require(_0xe843('0x8'));router[_0xe843('0x9')]('/',auth[_0xe843('0xa')](),controller['index']);router[_0xe843('0x9')](_0xe843('0xb'),auth['isAuthenticated'](),controller[_0xe843('0xc')]);router[_0xe843('0x9')](_0xe843('0xd'),auth[_0xe843('0xa')](),controller[_0xe843('0xe')]);router[_0xe843('0xf')](_0xe843('0x10'),auth[_0xe843('0xa')](),controller[_0xe843('0x11')]);var upload=multer({'storage':multer[_0xe843('0x12')]({'destination':function(_0x1c42f7,_0x19235c,_0x355d22){_0x355d22(null,path[_0xe843('0x13')](config[_0xe843('0x14')],_0xe843('0x15')));},'filename':function(_0x29d047,_0x1bf702,_0x569445){_0x569445(null,util[_0xe843('0x16')](_0xe843('0x17'),Date[_0xe843('0x18')](),_0x1bf702[_0xe843('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe843('0xf')]('/',upload[_0xe843('0x1a')](_0xe843('0x1b')),controller['create']);router[_0xe843('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xe843('0x1d')]);router[_0xe843('0x1e')](_0xe843('0xb'),auth[_0xe843('0xa')](),controller[_0xe843('0x1f')]);module[_0xe843('0x20')]=router; \ No newline at end of file +var _0x0664=['../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','download','clone','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','post','single','create','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5cdbf4,_0x3f9cc5){var _0x3dbc6a=function(_0x15db90){while(--_0x15db90){_0x5cdbf4['push'](_0x5cdbf4['shift']());}};_0x3dbc6a(++_0x3f9cc5);}(_0x0664,0x93));var _0x4066=function(_0x2883fc,_0x10aa0c){_0x2883fc=_0x2883fc-0x0;var _0x54106e=_0x0664[_0x2883fc];return _0x54106e;};'use strict';var multer=require('multer');var util=require(_0x4066('0x0'));var path=require('path');var timeout=require(_0x4066('0x1'));var express=require(_0x4066('0x2'));var router=express['Router']();var auth=require(_0x4066('0x3'));var interaction=require(_0x4066('0x4'));var config=require(_0x4066('0x5'));var controller=require(_0x4066('0x6'));router[_0x4066('0x7')]('/',auth[_0x4066('0x8')](),controller[_0x4066('0x9')]);router[_0x4066('0x7')](_0x4066('0xa'),auth[_0x4066('0x8')](),controller['show']);router[_0x4066('0x7')]('/:id/download',auth[_0x4066('0x8')](),controller[_0x4066('0xb')]);router['post']('/:id/clone',auth[_0x4066('0x8')](),controller[_0x4066('0xc')]);var upload=multer({'storage':multer[_0x4066('0xd')]({'destination':function(_0x41ad8b,_0x5ec830,_0x551059){_0x551059(null,path['join'](config['root'],_0x4066('0xe')));},'filename':function(_0x1b1712,_0x10c353,_0x12d36c){_0x12d36c(null,util[_0x4066('0xf')](_0x4066('0x10'),Date[_0x4066('0x11')](),_0x10c353[_0x4066('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4066('0x13')]('/',upload[_0x4066('0x14')]('file'),controller[_0x4066('0x15')]);router['put'](_0x4066('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4066('0x16')](_0x4066('0xa'),auth[_0x4066('0x8')](),controller[_0x4066('0x17')]);module[_0x4066('0x18')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 905ce5c..d705757 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 _0x8a2a=['Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','google','profile','email','callback','authenticate','/login','use','clientID','clientSecret','Setting','findOne','blockDuration','then','User','find','map','emails','value','admin','user','blocked','blockedAt','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8a2a,0x174));var _0xa8a2=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x8a2a[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0xa8a2('0x0'));var passport=require(_0xa8a2('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xa8a2('0x2')];var moment=require('moment');var db=require(_0xa8a2('0x3'))['db'];var config=require(_0xa8a2('0x4'));var signToken=require(_0xa8a2('0x5'))[_0xa8a2('0x6')];var utils=require('../../config/utils');exports['login']=passport['authenticate'](_0xa8a2('0x7'),{'failureRedirect':'/login','scope':[_0xa8a2('0x8'),_0xa8a2('0x9')],'session':![]});exports[_0xa8a2('0xa')]=passport[_0xa8a2('0xb')](_0xa8a2('0x7'),{'failureRedirect':_0xa8a2('0xc'),'session':![]});passport[_0xa8a2('0xd')](new GoogleStrategy({'clientID':config[_0xa8a2('0x7')]?config[_0xa8a2('0x7')][_0xa8a2('0xe')]:'id','clientSecret':config[_0xa8a2('0x7')]?config[_0xa8a2('0x7')][_0xa8a2('0xf')]:'secret','callbackURL':config['google']?config[_0xa8a2('0x7')]['callbackURL']:''},function(_0x5b2af6,_0x3c4da9,_0x294b3d,_0x424fa8){var _0x423d42,_0x2d4f87;return db[_0xa8a2('0x10')][_0xa8a2('0x11')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xa8a2('0x12')],'raw':!![]})[_0xa8a2('0x13')](function(_0x15f6e9){_0x423d42=_0x15f6e9;return db[_0xa8a2('0x14')][_0xa8a2('0x15')]({'where':{'email':_[_0xa8a2('0x16')](_0x294b3d[_0xa8a2('0x17')],_0xa8a2('0x18')),'role':{'$or':[_0xa8a2('0x19'),_0xa8a2('0x1a'),'agent']}}});})[_0xa8a2('0x13')](function(_0x42f813){_0x2d4f87=_0x42f813;if(_0x2d4f87){if(_0x2d4f87['disabled']){return _0x424fa8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x423d42[_0xa8a2('0x12')]>0x0){if(_0x2d4f87[_0xa8a2('0x1b')]){if(moment(_0x2d4f87[_0xa8a2('0x1c')])[_0xa8a2('0x1d')](_0x423d42[_0xa8a2('0x12')],'minutes')>moment()){return _0x424fa8(_0xa8a2('0x1e'));}else{return utils[_0xa8a2('0x1f')](_0x2d4f87,0x0,![],null)[_0xa8a2('0x13')](function(){return utils[_0xa8a2('0x20')](_0x2d4f87);})[_0xa8a2('0x13')](function(){return _0x424fa8(null,_0x2d4f87);});}}else{return utils['getLicense'](_0x2d4f87)[_0xa8a2('0x13')](function(){return _0x424fa8(null,_0x2d4f87);});}}else{return utils['getLicense'](_0x2d4f87)['then'](function(){return _0x424fa8(null,_0x2d4f87);});}}return _0x424fa8(_0xa8a2('0x1e'));})[_0xa8a2('0x21')](function(_0x108835){_0x424fa8(_0x108835);});})); \ No newline at end of file +var _0xff77=['use','clientID','clientSecret','callbackURL','findOne','allowedLoginAttempts','then','find','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken','login','google','email','callback','/login'];(function(_0x355c3b,_0xae147a){var _0xcf072=function(_0x37dea0){while(--_0x37dea0){_0x355c3b['push'](_0x355c3b['shift']());}};_0xcf072(++_0xae147a);}(_0xff77,0x1c6));var _0x7ff7=function(_0xbf806a,_0x138c27){_0xbf806a=_0xbf806a-0x0;var _0x2c8f13=_0xff77[_0xbf806a];return _0x2c8f13;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x7ff7('0x0'))[_0x7ff7('0x1')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x7ff7('0x2'));var signToken=require(_0x7ff7('0x3'))[_0x7ff7('0x4')];var utils=require('../../config/utils');exports[_0x7ff7('0x5')]=passport['authenticate'](_0x7ff7('0x6'),{'failureRedirect':'/login','scope':['profile',_0x7ff7('0x7')],'session':![]});exports[_0x7ff7('0x8')]=passport['authenticate']('google',{'failureRedirect':_0x7ff7('0x9'),'session':![]});passport[_0x7ff7('0xa')](new GoogleStrategy({'clientID':config[_0x7ff7('0x6')]?config['google'][_0x7ff7('0xb')]:'id','clientSecret':config[_0x7ff7('0x6')]?config[_0x7ff7('0x6')][_0x7ff7('0xc')]:'secret','callbackURL':config['google']?config['google'][_0x7ff7('0xd')]:''},function(_0x117be2,_0x2e79b0,_0x360439,_0x1b120e){var _0x57ed11,_0x24fbda;return db['Setting'][_0x7ff7('0xe')]({'where':{'id':0x1},'attributes':[_0x7ff7('0xf'),'blockDuration'],'raw':!![]})[_0x7ff7('0x10')](function(_0x53f307){_0x57ed11=_0x53f307;return db['User'][_0x7ff7('0x11')]({'where':{'email':_['map'](_0x360439['emails'],_0x7ff7('0x12')),'role':{'$or':[_0x7ff7('0x13'),'user',_0x7ff7('0x14')]}}});})[_0x7ff7('0x10')](function(_0x557cba){_0x24fbda=_0x557cba;if(_0x24fbda){if(_0x24fbda[_0x7ff7('0x15')]){return _0x1b120e(_0x7ff7('0x16'));}else if(_0x57ed11[_0x7ff7('0x17')]>0x0){if(_0x24fbda[_0x7ff7('0x18')]){if(moment(_0x24fbda['blockedAt'])[_0x7ff7('0x19')](_0x57ed11[_0x7ff7('0x17')],_0x7ff7('0x1a'))>moment()){return _0x1b120e(_0x7ff7('0x16'));}else{return utils[_0x7ff7('0x1b')](_0x24fbda,0x0,![],null)['then'](function(){return utils[_0x7ff7('0x1c')](_0x24fbda);})['then'](function(){return _0x1b120e(null,_0x24fbda);});}}else{return utils[_0x7ff7('0x1c')](_0x24fbda)[_0x7ff7('0x10')](function(){return _0x1b120e(null,_0x24fbda);});}}else{return utils[_0x7ff7('0x1c')](_0x24fbda)[_0x7ff7('0x10')](function(){return _0x1b120e(null,_0x24fbda);});}}return _0x1b120e(_0x7ff7('0x16'));})['catch'](function(_0x58e940){_0x1b120e(_0x58e940);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3d7d9da..df78373 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 _0xbd3b=['exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x4bd33b,_0x2b7fbe){var _0x5e2048=function(_0x27c634){while(--_0x27c634){_0x4bd33b['push'](_0x4bd33b['shift']());}};_0x5e2048(++_0x2b7fbe);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x3ae1c8,_0x4f1c21){_0x3ae1c8=_0x3ae1c8-0x0;var _0x5a2621=_0xbd3b[_0x3ae1c8];return _0x5a2621;};'use strict';var express=require(_0xbbd3('0x0'));var passport=require(_0xbbd3('0x1'));var router=express[_0xbbd3('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xbbd3('0x3'));var authService=require(_0xbbd3('0x4'));router[_0xbbd3('0x5')]('/',controller[_0xbbd3('0x6')]);router['get'](_0xbbd3('0x7'),controller[_0xbbd3('0x8')],authService['isMiddleware'],userController[_0xbbd3('0x6')],authService['setTokenCookie']);module[_0xbbd3('0x9')]=router; \ No newline at end of file +var _0xf46a=['Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf46a,0xa4));var _0xaf46=function(_0x46a7e6,_0x2119e6){_0x46a7e6=_0x46a7e6-0x0;var _0xf102b1=_0xf46a[_0x46a7e6];return _0xf102b1;};'use strict';var express=require(_0xaf46('0x0'));var passport=require('passport');var router=express[_0xaf46('0x1')]();var controller=require(_0xaf46('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xaf46('0x3'));router[_0xaf46('0x4')]('/',controller[_0xaf46('0x5')]);router[_0xaf46('0x4')](_0xaf46('0x6'),controller[_0xaf46('0x7')],authService[_0xaf46('0x8')],userController[_0xaf46('0x5')],authService[_0xaf46('0x9')]);module[_0xaf46('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ac3ca37..f117376 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 _0xe162=['minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','status','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','client','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','blockedAt','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','clearBlockUser','disabled','add','getLicense','catch','MailAccount','find','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','merge','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x395524,_0x31ac11){var _0x3f6568=function(_0x43d86d){while(--_0x43d86d){_0x395524['push'](_0x395524['shift']());}};_0x3f6568(++_0x31ac11);}(_0xe162,0xb2));var _0x2e16=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe162[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0x2e16('0x0'));var passport=require(_0x2e16('0x1'));var LocalStrategy=require(_0x2e16('0x2'))[_0x2e16('0x3')];var jayson=require(_0x2e16('0x4'));var _=require(_0x2e16('0x5'));var rs=require(_0x2e16('0x6'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x2e16('0x7'));var utils=require('../../config/utils');var client=jayson[_0x2e16('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x348857,_0x18ca90,_0x615517,_0x388f96){var _0x4b9e66,_0x4875bb;return db[_0x2e16('0x9')][_0x2e16('0xa')]({'where':{'id':0x1},'attributes':[_0x2e16('0xb'),_0x2e16('0xc')],'raw':!![]})['then'](function(_0xeec465){_0x4b9e66=_0xeec465;return _0x348857[_0x2e16('0xa')]({'attributes':['id','name',_0x2e16('0xd'),_0x2e16('0xe'),'role','disabled','blocked',_0x2e16('0xf'),'loginAttempts'],'where':{'name':_0x18ca90,'role':{'$or':[_0x2e16('0x10'),'user',_0x2e16('0x11')]}}});})[_0x2e16('0x12')](function(_0x281bd6){if(!_0x281bd6||_0x281bd6&&_0x281bd6['name']!==_0x18ca90){throw new Error(_0x2e16('0x13'));}else{_0x4875bb=_0x281bd6;return _0x4875bb;}})[_0x2e16('0x12')](function(){_0x4875bb[_0x2e16('0x14')](_0x615517,function(_0x528992,_0xd3904c){var _0xc39a84=_0x4875bb[_0x2e16('0x15')]+0x1;if(_0x528992){return _0x388f96(_0x528992);}else if(!_0xd3904c){if(_0x4875bb['disabled']){return _0x388f96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4b9e66[_0x2e16('0xb')]>0x0){if(_0x4875bb[_0x2e16('0x16')]){if(_0x4b9e66[_0x2e16('0xc')]>0x0){if(moment(_0x4875bb[_0x2e16('0xf')])['add'](_0x4b9e66['blockDuration'],'minutes')>moment()){return _0x388f96(null,![],{'message':_0x2e16('0x13')});}else{return utils[_0x2e16('0x17')](_0x4875bb,_0xc39a84,![],null)['then'](function(){return _0x388f96(null,![],{'message':_0x2e16('0x13')});});}}else{return _0x388f96(null,![],{'message':_0x2e16('0x13')});}}else{if(_0xc39a84>=_0x4b9e66['allowedLoginAttempts']){return utils['clearBlockUser'](_0x4875bb,0x0,!![],moment())[_0x2e16('0x12')](function(){return _0x388f96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x4875bb,_0xc39a84,![],null)[_0x2e16('0x12')](function(){return _0x388f96(null,![],{'message':_0x2e16('0x13')});});}}}else{return _0x388f96(null,![],{'message':_0x2e16('0x13')});}}else{if(_0x4875bb[_0x2e16('0x18')]){return _0x388f96(null,![],{'message':_0x2e16('0x13')});}else if(_0x4b9e66[_0x2e16('0xb')]>0x0){if(_0x4875bb['blocked']){if(_0x4b9e66[_0x2e16('0xc')]>0x0){if(moment(_0x4875bb[_0x2e16('0xf')])[_0x2e16('0x19')](_0x4b9e66[_0x2e16('0xc')],'minutes')>moment()){return _0x388f96(null,![],{'message':_0x2e16('0x13')});}else{return utils[_0x2e16('0x17')](_0x4875bb,0x0,![],null)[_0x2e16('0x12')](function(){return utils['getLicense'](_0x4875bb);})['then'](function(){return _0x388f96(null,_0x4875bb);});}}else{return _0x388f96(null,![],{'message':_0x2e16('0x13')});}}else{return utils[_0x2e16('0x17')](_0x4875bb,0x0,![],null)['then'](function(){return utils[_0x2e16('0x1a')](_0x4875bb);})[_0x2e16('0x12')](function(){return _0x388f96(null,_0x4875bb);})[_0x2e16('0x1b')](function(_0x4f3912){return _0x388f96(null,![],_0x4f3912);});}}else{if(_0x4875bb['blocked']){return _0x388f96(null,![],{'message':_0x2e16('0x13')});}else{return utils['getLicense'](_0x4875bb)[_0x2e16('0x12')](function(){return _0x388f96(null,_0x4875bb);});}}}});})[_0x2e16('0x1b')](function(_0x48be80){return _0x388f96(null,![],_0x48be80);});}function sendServiceMail(_0x55e570){return db[_0x2e16('0x1c')][_0x2e16('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x2e16('0x1e'),_0x2e16('0x1f')],'include':[{'model':db[_0x2e16('0x20')],'as':_0x2e16('0x21')}]})[_0x2e16('0x12')](function(_0x508a0){if(!_0x508a0){throw new Error(_0x2e16('0x22'));}var _0x25167f={'tls':{'rejectUnauthorized':![]}};if(_0x508a0[_0x2e16('0x21')][_0x2e16('0x23')]){_0x25167f[_0x2e16('0x23')]=_0x508a0[_0x2e16('0x21')]['service'];}else{_0x25167f[_0x2e16('0x24')]=_0x508a0[_0x2e16('0x21')][_0x2e16('0x24')];_0x25167f[_0x2e16('0x25')]=_0x508a0[_0x2e16('0x21')]['port'];_0x25167f[_0x2e16('0x26')]=_0x508a0[_0x2e16('0x21')]['secure'];}if(_0x508a0[_0x2e16('0x21')][_0x2e16('0x27')]){_0x25167f['auth']={'user':_0x508a0[_0x2e16('0x21')][_0x2e16('0x28')],'pass':_0x508a0['Smtp']['pass']};}var _0x252389={'account':_0x25167f,'message':_[_0x2e16('0x29')]({'from':util[_0x2e16('0x2a')](_0x2e16('0x2b'),_0x508a0[_0x2e16('0x1e')],_0x508a0[_0x2e16('0x1f')]||_0x508a0[_0x2e16('0x21')][_0x2e16('0x28')])},_0x55e570)};return client['request']('SendMail',_0x252389);})[_0x2e16('0x12')](function(_0x1fe3be){if(_0x1fe3be[_0x2e16('0x2c')]){throw new Error(util[_0x2e16('0x2a')](_0x2e16('0x2d'),_0x1fe3be[_0x2e16('0x2c')]['message']||JSON[_0x2e16('0x2e')](_0x1fe3be['error'])));}return!![];});}function handleError(_0x19f3b7,_0x1e3877,_0x43b278){return _0x19f3b7['status'](_0x1e3877||0x1f4)[_0x2e16('0x2f')]({'message':_0x43b278?_0x43b278[_0x2e16('0x30')]||_0x43b278:''});}function checkPasswordPattern(_0x1452ac,_0x531729,_0x282517){if(_0x282517){var _0x38b60a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38b60a[_0x2e16('0x31')](_0x531729)){return _0x1452ac;}else{throw new Error(_0x2e16('0x32'));}}else{return _0x1452ac;}}exports[_0x2e16('0x33')]=function(_0xa804f6,_0x209668,_0x3a7691){passport[_0x2e16('0x14')](_0x2e16('0x34'),function(_0x17b446,_0x46fc4e,_0x4e57c9){var _0x24c9c2=_0x17b446||_0x4e57c9;if(_0x24c9c2){return handleError(_0x209668,0x191,_0x24c9c2);}if(!_0x46fc4e){return handleError(_0x209668,0x194,{'message':_0x2e16('0x35')});}else{var _0x122e67={'payload':{'id':_0x46fc4e['id'],'role':_0x46fc4e['role']},'options':{'expiresIn':0x15180}};return authService[_0x2e16('0x36')](_0x122e67)[_0x2e16('0x12')](function(_0x36b449){_0x209668[_0x2e16('0x37')]({'id':_0x46fc4e['id'],'token':_0x36b449,'statusCall':'','isAlreadyLogged':_0x46fc4e['online']});});}})(_0xa804f6,_0x209668,_0x3a7691);};exports['forgot']=function(_0x2cee37,_0x2ca021,_0x30fc46){if(!_0x2cee37[_0x2e16('0x38')]['email']){return handleError(_0x2ca021,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x228ab9=rs[_0x2e16('0x39')]();_0x2cee37[_0x2e16('0x38')][_0x2e16('0x1f')]=_0x2cee37['body'][_0x2e16('0x1f')][_0x2e16('0x3a')]()[_0x2e16('0x3b')]();var _0x1f1ebe;return db[_0x2e16('0x9')][_0x2e16('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2e16('0xc')],'raw':!![]})[_0x2e16('0x12')](function(_0xf75ae9){_0x1f1ebe=_0xf75ae9;return db[_0x2e16('0x3c')][_0x2e16('0x1d')]({'where':{'email':_0x2cee37[_0x2e16('0x38')]['email']}});})['then'](function(_0x16e3d9){if(!_0x16e3d9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x16e3d9['disabled']){throw new Error(_0x2e16('0x3d'));}if(_0x16e3d9[_0x2e16('0x16')]){if(moment(_0x16e3d9['blockedAt'])['add'](_0x1f1ebe[_0x2e16('0xc')],_0x2e16('0x3e'))>moment()){throw new Error(_0x2e16('0x3f'));}else{_0x16e3d9['blocked']=![];_0x16e3d9[_0x2e16('0xf')]=null;}}_0x16e3d9[_0x2e16('0x40')]=_0x228ab9;_0x16e3d9[_0x2e16('0x41')]=Date[_0x2e16('0x42')]()+0x36ee80;return _0x16e3d9[_0x2e16('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x2cee37[_0x2e16('0x38')][_0x2e16('0x1f')],'subject':_0x2e16('0x44'),'text':_0x2e16('0x45')+_0x2e16('0x46')+_0x2e16('0x47')+_0x2cee37[_0x2e16('0x48')][_0x2e16('0x24')]+_0x2e16('0x49')+_0x228ab9+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2e16('0x12')](function(){_0x2ca021[_0x2e16('0x4a')](0xc8)['send']({'message':_0x2e16('0x4b')});})[_0x2e16('0x1b')](function(_0x4995cd){return handleError(_0x2ca021,0x1f4,_0x4995cd);});};exports[_0x2e16('0x4c')]=function(_0x1d7474,_0xcb9f32,_0x496eef){var _0x38ac51;return db['User'][_0x2e16('0x1d')]({'where':{'resetPasswordToken':_0x1d7474['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x2e16('0x42')]()}}})[_0x2e16('0x12')](function(_0x26a887){_0x38ac51=_0x26a887;if(!_0x38ac51){throw new Error(_0x2e16('0x4d'));}return db[_0x2e16('0x9')][_0x2e16('0xa')]({'attributes':['id',_0x2e16('0x4e')]});})[_0x2e16('0x12')](function(_0x1365c6){return checkPasswordPattern(_0x1365c6,_0x1d7474[_0x2e16('0x38')][_0x2e16('0xd')],_0x1365c6[_0x2e16('0x4e')]);})[_0x2e16('0x12')](function(){_0x38ac51[_0x2e16('0xd')]=_0x1d7474[_0x2e16('0x38')][_0x2e16('0xd')];_0x38ac51[_0x2e16('0x40')]=null;_0x38ac51[_0x2e16('0x41')]=null;return _0x38ac51['save']();})[_0x2e16('0x12')](function(){_0xcb9f32[_0x2e16('0x4a')](0xc8)[_0x2e16('0x2f')]({'message':'Password\x20reset!'});})['catch'](function(_0x299a0f){return handleError(_0xcb9f32,0x1f4,_0x299a0f);});};passport[_0x2e16('0x4f')](new LocalStrategy({'usernameField':_0x2e16('0x1e'),'passwordField':_0x2e16('0xd')},function(_0x486d48,_0x831995,_0x5b62c7){return localAuthenticate(db[_0x2e16('0x3c')],_0x486d48,_0x831995,_0x5b62c7);})); \ No newline at end of file +var _0x2b55=['password','salt','role','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','clearBlockUser','blocked','add','minutes','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','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','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name'];(function(_0x32034d,_0x3cd7a9){var _0xe6a87d=function(_0xb9262c){while(--_0xb9262c){_0x32034d['push'](_0x32034d['shift']());}};_0xe6a87d(++_0x3cd7a9);}(_0x2b55,0x180));var _0x52b5=function(_0x27ee9f,_0x4e179e){_0x27ee9f=_0x27ee9f-0x0;var _0x2b9066=_0x2b55[_0x27ee9f];return _0x2b9066;};'use strict';var util=require(_0x52b5('0x0'));var passport=require(_0x52b5('0x1'));var LocalStrategy=require(_0x52b5('0x2'))[_0x52b5('0x3')];var jayson=require(_0x52b5('0x4'));var _=require(_0x52b5('0x5'));var rs=require(_0x52b5('0x6'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x52b5('0x7'));var utils=require(_0x52b5('0x8'));var client=jayson[_0x52b5('0x9')][_0x52b5('0xa')]({'port':0x232b});function localAuthenticate(_0x3582ad,_0x1c1ea2,_0x2bf6ad,_0x2af60a){var _0x4a0c79,_0x5548eb;return db[_0x52b5('0xb')][_0x52b5('0xc')]({'where':{'id':0x1},'attributes':[_0x52b5('0xd'),'blockDuration'],'raw':!![]})[_0x52b5('0xe')](function(_0x22b926){_0x4a0c79=_0x22b926;return _0x3582ad[_0x52b5('0xc')]({'attributes':['id',_0x52b5('0xf'),_0x52b5('0x10'),_0x52b5('0x11'),_0x52b5('0x12'),_0x52b5('0x13'),'blocked','blockedAt',_0x52b5('0x14')],'where':{'name':_0x1c1ea2,'role':{'$or':[_0x52b5('0x15'),_0x52b5('0x16'),_0x52b5('0x17')]}}});})[_0x52b5('0xe')](function(_0x46fa25){if(!_0x46fa25||_0x46fa25&&_0x46fa25[_0x52b5('0xf')]!==_0x1c1ea2){throw new Error(_0x52b5('0x18'));}else{_0x5548eb=_0x46fa25;return _0x5548eb;}})[_0x52b5('0xe')](function(){_0x5548eb['authenticate'](_0x2bf6ad,function(_0x1e43c5,_0xf3dfdf){var _0x29afb5=_0x5548eb[_0x52b5('0x14')]+0x1;if(_0x1e43c5){return _0x2af60a(_0x1e43c5);}else if(!_0xf3dfdf){if(_0x5548eb[_0x52b5('0x13')]){return _0x2af60a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4a0c79['allowedLoginAttempts']>0x0){if(_0x5548eb['blocked']){if(_0x4a0c79[_0x52b5('0x19')]>0x0){if(moment(_0x5548eb[_0x52b5('0x1a')])['add'](_0x4a0c79[_0x52b5('0x19')],'minutes')>moment()){return _0x2af60a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x5548eb,_0x29afb5,![],null)[_0x52b5('0xe')](function(){return _0x2af60a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2af60a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x29afb5>=_0x4a0c79[_0x52b5('0xd')]){return utils['clearBlockUser'](_0x5548eb,0x0,!![],moment())['then'](function(){return _0x2af60a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x52b5('0x1b')](_0x5548eb,_0x29afb5,![],null)['then'](function(){return _0x2af60a(null,![],{'message':_0x52b5('0x18')});});}}}else{return _0x2af60a(null,![],{'message':_0x52b5('0x18')});}}else{if(_0x5548eb[_0x52b5('0x13')]){return _0x2af60a(null,![],{'message':_0x52b5('0x18')});}else if(_0x4a0c79[_0x52b5('0xd')]>0x0){if(_0x5548eb[_0x52b5('0x1c')]){if(_0x4a0c79['blockDuration']>0x0){if(moment(_0x5548eb['blockedAt'])[_0x52b5('0x1d')](_0x4a0c79[_0x52b5('0x19')],_0x52b5('0x1e'))>moment()){return _0x2af60a(null,![],{'message':_0x52b5('0x18')});}else{return utils[_0x52b5('0x1b')](_0x5548eb,0x0,![],null)[_0x52b5('0xe')](function(){return utils[_0x52b5('0x1f')](_0x5548eb);})[_0x52b5('0xe')](function(){return _0x2af60a(null,_0x5548eb);});}}else{return _0x2af60a(null,![],{'message':_0x52b5('0x18')});}}else{return utils['clearBlockUser'](_0x5548eb,0x0,![],null)['then'](function(){return utils[_0x52b5('0x1f')](_0x5548eb);})[_0x52b5('0xe')](function(){return _0x2af60a(null,_0x5548eb);})['catch'](function(_0x40fd99){return _0x2af60a(null,![],_0x40fd99);});}}else{if(_0x5548eb[_0x52b5('0x1c')]){return _0x2af60a(null,![],{'message':_0x52b5('0x18')});}else{return utils[_0x52b5('0x1f')](_0x5548eb)[_0x52b5('0xe')](function(){return _0x2af60a(null,_0x5548eb);});}}}});})[_0x52b5('0x20')](function(_0x227d8e){return _0x2af60a(null,![],_0x227d8e);});}function sendServiceMail(_0x4c4ccf){return db['MailAccount'][_0x52b5('0x21')]({'where':{'service':!![]},'attributes':['id',_0x52b5('0xf'),_0x52b5('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x52b5('0x23')}]})['then'](function(_0x345f94){if(!_0x345f94){throw new Error(_0x52b5('0x24'));}var _0x3cd5bd={'tls':{'rejectUnauthorized':![]}};if(_0x345f94['Smtp'][_0x52b5('0x25')]){_0x3cd5bd[_0x52b5('0x25')]=_0x345f94[_0x52b5('0x23')][_0x52b5('0x25')];}else{_0x3cd5bd[_0x52b5('0x26')]=_0x345f94[_0x52b5('0x23')][_0x52b5('0x26')];_0x3cd5bd[_0x52b5('0x27')]=_0x345f94['Smtp'][_0x52b5('0x27')];_0x3cd5bd[_0x52b5('0x28')]=_0x345f94[_0x52b5('0x23')][_0x52b5('0x28')];}if(_0x345f94[_0x52b5('0x23')][_0x52b5('0x29')]){_0x3cd5bd[_0x52b5('0x2a')]={'user':_0x345f94[_0x52b5('0x23')][_0x52b5('0x16')],'pass':_0x345f94[_0x52b5('0x23')][_0x52b5('0x2b')]};}var _0xedb170={'account':_0x3cd5bd,'message':_['merge']({'from':util[_0x52b5('0x2c')]('\x22%s\x22\x20<%s>',_0x345f94['name'],_0x345f94['email']||_0x345f94[_0x52b5('0x23')][_0x52b5('0x16')])},_0x4c4ccf)};return client[_0x52b5('0x2d')](_0x52b5('0x2e'),_0xedb170);})['then'](function(_0x245a93){if(_0x245a93[_0x52b5('0x2f')]){throw new Error(util[_0x52b5('0x2c')](_0x52b5('0x30'),_0x245a93['error'][_0x52b5('0x31')]||JSON[_0x52b5('0x32')](_0x245a93[_0x52b5('0x2f')])));}return!![];});}function handleError(_0x2c0d35,_0x186154,_0x4bc0dd){return _0x2c0d35['status'](_0x186154||0x1f4)[_0x52b5('0x33')]({'message':_0x4bc0dd?_0x4bc0dd[_0x52b5('0x31')]||_0x4bc0dd:''});}function checkPasswordPattern(_0x39da26,_0x1bcf2a,_0x2865c1){if(_0x2865c1){var _0x172cb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x172cb2[_0x52b5('0x34')](_0x1bcf2a)){return _0x39da26;}else{throw new Error(_0x52b5('0x35'));}}else{return _0x39da26;}}exports[_0x52b5('0x36')]=function(_0x64a110,_0x2473b2,_0x2ced2b){passport['authenticate']('local',function(_0x5c7d1b,_0x4e7b2d,_0x1cf3ab){var _0xbc167=_0x5c7d1b||_0x1cf3ab;if(_0xbc167){return handleError(_0x2473b2,0x191,_0xbc167);}if(!_0x4e7b2d){return handleError(_0x2473b2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x36df80={'payload':{'id':_0x4e7b2d['id'],'role':_0x4e7b2d['role']},'options':{'expiresIn':0x15180}};return authService[_0x52b5('0x37')](_0x36df80)[_0x52b5('0xe')](function(_0x40050a){_0x2473b2['json']({'id':_0x4e7b2d['id'],'token':_0x40050a,'statusCall':'','isAlreadyLogged':_0x4e7b2d[_0x52b5('0x38')]});});}})(_0x64a110,_0x2473b2,_0x2ced2b);};exports[_0x52b5('0x39')]=function(_0x478710,_0x41392f,_0x4d71b7){if(!_0x478710[_0x52b5('0x3a')]['email']){return handleError(_0x41392f,0x1f4,{'message':_0x52b5('0x3b')});}var _0x32e2a6=rs[_0x52b5('0x3c')]();_0x478710['body'][_0x52b5('0x22')]=_0x478710[_0x52b5('0x3a')]['email']['trim']()['toLowerCase']();var _0x2db94e;return db['Setting'][_0x52b5('0xc')]({'where':{'id':0x1},'attributes':[_0x52b5('0xd'),_0x52b5('0x19')],'raw':!![]})[_0x52b5('0xe')](function(_0xab33a1){_0x2db94e=_0xab33a1;return db[_0x52b5('0x3d')][_0x52b5('0x21')]({'where':{'email':_0x478710[_0x52b5('0x3a')][_0x52b5('0x22')]}});})[_0x52b5('0xe')](function(_0x52cc04){if(!_0x52cc04){throw new Error(_0x52b5('0x3e'));}if(_0x52cc04[_0x52b5('0x13')]){throw new Error(_0x52b5('0x3f'));}if(_0x52cc04[_0x52b5('0x1c')]){if(moment(_0x52cc04[_0x52b5('0x1a')])['add'](_0x2db94e['blockDuration'],_0x52b5('0x1e'))>moment()){throw new Error(_0x52b5('0x40'));}else{_0x52cc04['blocked']=![];_0x52cc04[_0x52b5('0x1a')]=null;}}_0x52cc04['resetPasswordToken']=_0x32e2a6;_0x52cc04[_0x52b5('0x41')]=Date['now']()+0x36ee80;return _0x52cc04[_0x52b5('0x42')]();})[_0x52b5('0xe')](function(){return sendServiceMail({'to':_0x478710['body'][_0x52b5('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x52b5('0x43')+_0x52b5('0x44')+'http://'+_0x478710[_0x52b5('0x45')][_0x52b5('0x26')]+_0x52b5('0x46')+_0x32e2a6+'\x0a\x0a'+_0x52b5('0x47')});})[_0x52b5('0xe')](function(){_0x41392f[_0x52b5('0x48')](0xc8)[_0x52b5('0x33')]({'message':_0x52b5('0x49')});})[_0x52b5('0x20')](function(_0x56c9ff){return handleError(_0x41392f,0x1f4,_0x56c9ff);});};exports[_0x52b5('0x4a')]=function(_0x309199,_0x2d6e67,_0x35f558){var _0x22e928;return db[_0x52b5('0x3d')][_0x52b5('0x21')]({'where':{'resetPasswordToken':_0x309199[_0x52b5('0x4b')][_0x52b5('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x412e58){_0x22e928=_0x412e58;if(!_0x22e928){throw new Error(_0x52b5('0x4d'));}return db[_0x52b5('0xb')][_0x52b5('0xc')]({'attributes':['id','securePassword']});})[_0x52b5('0xe')](function(_0xbcffd6){return checkPasswordPattern(_0xbcffd6,_0x309199[_0x52b5('0x3a')]['password'],_0xbcffd6['securePassword']);})[_0x52b5('0xe')](function(){_0x22e928['password']=_0x309199[_0x52b5('0x3a')][_0x52b5('0x10')];_0x22e928['resetPasswordToken']=null;_0x22e928[_0x52b5('0x41')]=null;return _0x22e928[_0x52b5('0x42')]();})['then'](function(){_0x2d6e67[_0x52b5('0x48')](0xc8)[_0x52b5('0x33')]({'message':_0x52b5('0x4e')});})[_0x52b5('0x20')](function(_0x259401){return handleError(_0x2d6e67,0x1f4,_0x259401);});};passport[_0x52b5('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x1939c5,_0x56b5a5,_0x3fb565){return localAuthenticate(db['User'],_0x1939c5,_0x56b5a5,_0x3fb565);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 59b6c4a..6127864 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 _0x842a=['express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x37563e,_0x5c3f33){var _0x2bf4fb=function(_0xa22170){while(--_0xa22170){_0x37563e['push'](_0x37563e['shift']());}};_0x2bf4fb(++_0x5c3f33);}(_0x842a,0x98));var _0xa842=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x842a[_0x334d1e];return _0x3b33ba;};'use strict';var express=require(_0xa842('0x0'));var router=express[_0xa842('0x1')]();var controller=require(_0xa842('0x2'));router[_0xa842('0x3')]('/',controller[_0xa842('0x4')]);router[_0xa842('0x3')]('/forgot',controller[_0xa842('0x5')]);router[_0xa842('0x3')](_0xa842('0x6'),controller[_0xa842('0x7')]);module['exports']=router; \ No newline at end of file +var _0xcf66=['post','login','/forgot','forgot','reset','express','Router','./authLocal.controller'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xcf66,0x185));var _0x6cf6=function(_0x5c2afd,_0x504fad){_0x5c2afd=_0x5c2afd-0x0;var _0x42d163=_0xcf66[_0x5c2afd];return _0x42d163;};'use strict';var express=require(_0x6cf6('0x0'));var router=express[_0x6cf6('0x1')]();var controller=require(_0x6cf6('0x2'));router[_0x6cf6('0x3')]('/',controller[_0x6cf6('0x4')]);router[_0x6cf6('0x3')](_0x6cf6('0x5'),controller[_0x6cf6('0x6')]);router[_0x6cf6('0x3')]('/reset/:token',controller[_0x6cf6('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 4f9d307..9cff631 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 _0xc575=['STRING','BOOLEAN','sequelize'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0xc575,0x6b));var _0x5c57=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0xc575[_0x14d250];return _0xb991d8;};'use strict';var Sequelize=require(_0x5c57('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c57('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x5c57('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5c57('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x3776=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0x3776,0x1be));var _0x6377=function(_0x24d92a,_0x5dcc4d){_0x24d92a=_0x24d92a-0x0;var _0x2d5aed=_0x3776[_0x24d92a];return _0x2d5aed;};'use strict';var Sequelize=require('sequelize');module[_0x6377('0x0')]={'name':{'type':Sequelize[_0x6377('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6377('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6377('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 6829735..13c0105 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 _0xb953=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','where','rows','catch','show','params','includeAll','include','options','find','create','body','Condition','addConditions','ids','omit','findOne','order','pick','getConditions','addActions','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0xb953,0x89));var _0x3b95=function(_0x1361eb,_0x428cb1){_0x1361eb=_0x1361eb-0x0;var _0x587843=_0xb953[_0x1361eb];return _0x587843;};'use strict';var pdf=require(_0x3b95('0x0'));var emlformat=require(_0x3b95('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b95('0x2'));var jsonpatch=require(_0x3b95('0x3'));var rp=require('request-promise');var moment=require(_0x3b95('0x4'));var BPromise=require(_0x3b95('0x5'));var Mustache=require(_0x3b95('0x6'));var util=require('util');var path=require(_0x3b95('0x7'));var sox=require(_0x3b95('0x8'));var csv=require(_0x3b95('0x9'));var ejs=require(_0x3b95('0xa'));var fs=require('fs');var _=require(_0x3b95('0xb'));var squel=require('squel');var crypto=require(_0x3b95('0xc'));var jsforce=require(_0x3b95('0xd'));var deskjs=require(_0x3b95('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3b95('0xf'));var Papa=require('papaparse');var Redis=require(_0x3b95('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b95('0x11'));var as=require(_0x3b95('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b95('0x13'))('api');var utils=require(_0x3b95('0x14'));var config=require(_0x3b95('0x15'));var db=require(_0x3b95('0x16'))['db'];function respondWithStatusCode(_0x364e27,_0x73e06b){_0x73e06b=_0x73e06b||0xcc;return function(_0x11b96b){if(_0x11b96b){return _0x364e27['sendStatus'](_0x73e06b);}return _0x364e27[_0x3b95('0x17')](_0x73e06b)['end']();};}function respondWithResult(_0x42f6da,_0x6a34db){_0x6a34db=_0x6a34db||0xc8;return function(_0x144cf1){if(_0x144cf1){return _0x42f6da['status'](_0x6a34db)[_0x3b95('0x18')](_0x144cf1);}};}function respondWithFilteredResult(_0x52eeb6,_0x11fe4e){return function(_0x4d0b21){if(_0x4d0b21){var _0x54323d=_0x4d0b21[_0x3b95('0x19')],_0xb099ae=_0x11fe4e[_0x3b95('0x1a')],_0x197777=_0x11fe4e['offset']+_0x11fe4e[_0x3b95('0x1b')],_0x4a1eab;if(_0x197777>=_0x54323d){_0x197777=_0x54323d;_0x4a1eab=0xc8;}else{_0x4a1eab=0xce;}_0x52eeb6[_0x3b95('0x17')](_0x4a1eab);return _0x52eeb6[_0x3b95('0x1c')](_0x3b95('0x1d'),_0xb099ae+'-'+_0x197777+'/'+_0x54323d)[_0x3b95('0x18')](_0x4d0b21);}return null;};}function patchUpdates(_0x5104a4){return function(_0x5a7453){try{jsonpatch[_0x3b95('0x1e')](_0x5a7453,_0x5104a4,!![]);}catch(_0x5f5661){return BPromise[_0x3b95('0x1f')](_0x5f5661);}return _0x5a7453[_0x3b95('0x20')]();};}function saveUpdates(_0x36cf1c,_0x524f5b){return function(_0x137502){if(_0x137502){return _0x137502[_0x3b95('0x21')](_0x36cf1c)[_0x3b95('0x22')](function(_0x52d842){return _0x52d842;});}return null;};}function removeEntity(_0x4531ec,_0x2743a4){return function(_0x2cc4c9){if(_0x2cc4c9){return _0x2cc4c9[_0x3b95('0x23')]()[_0x3b95('0x22')](function(){_0x4531ec[_0x3b95('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x448b5f,_0x58ebf8){return function(_0xe38925){if(!_0xe38925){_0x448b5f[_0x3b95('0x24')](0x194);}return _0xe38925;};}function handleError(_0x209a77,_0x4bec8e){_0x4bec8e=_0x4bec8e||0x1f4;return function(_0x556692){logger[_0x3b95('0x25')](_0x556692[_0x3b95('0x26')]);if(_0x556692['name']){delete _0x556692[_0x3b95('0x27')];}_0x209a77[_0x3b95('0x17')](_0x4bec8e)[_0x3b95('0x28')](_0x556692);};}exports[_0x3b95('0x29')]=function(_0x398755,_0xd40b17){var _0x85fc99={},_0x5667b5={},_0x23c9af={'count':0x0,'rows':[]};var _0x28aa55=_[_0x3b95('0x2a')](db[_0x3b95('0x2b')][_0x3b95('0x2c')],function(_0x116a68){return{'name':_0x116a68['fieldName'],'type':_0x116a68[_0x3b95('0x2d')][_0x3b95('0x2e')]};});_0x5667b5[_0x3b95('0x2f')]=_[_0x3b95('0x2a')](_0x28aa55,_0x3b95('0x27'));_0x5667b5['query']=_[_0x3b95('0x30')](_0x398755[_0x3b95('0x31')]);_0x5667b5[_0x3b95('0x32')]=_['intersection'](_0x5667b5[_0x3b95('0x2f')],_0x5667b5[_0x3b95('0x31')]);_0x85fc99[_0x3b95('0x33')]=_[_0x3b95('0x34')](_0x5667b5[_0x3b95('0x2f')],qs[_0x3b95('0x35')](_0x398755[_0x3b95('0x31')][_0x3b95('0x35')]));_0x85fc99[_0x3b95('0x33')]=_0x85fc99[_0x3b95('0x33')][_0x3b95('0x36')]?_0x85fc99['attributes']:_0x5667b5[_0x3b95('0x2f')];if(!_0x398755['query'][_0x3b95('0x37')](_0x3b95('0x38'))){_0x85fc99[_0x3b95('0x1b')]=qs[_0x3b95('0x1b')](_0x398755[_0x3b95('0x31')]['limit']);_0x85fc99[_0x3b95('0x1a')]=qs['offset'](_0x398755['query'][_0x3b95('0x1a')]);}_0x85fc99['order']=qs['sort'](_0x398755[_0x3b95('0x31')][_0x3b95('0x39')]);_0x85fc99['where']=qs[_0x3b95('0x32')](_['pick'](_0x398755[_0x3b95('0x31')],_0x5667b5[_0x3b95('0x32')]),_0x28aa55);if(_0x398755[_0x3b95('0x31')][_0x3b95('0x3a')]){_0x85fc99['where']=_[_0x3b95('0x3b')](_0x85fc99['where'],{'$or':_[_0x3b95('0x2a')](_0x28aa55,function(_0x5aaa0a){if(_0x5aaa0a[_0x3b95('0x2d')]!==_0x3b95('0x3c')){var _0x90642a={};_0x90642a[_0x5aaa0a[_0x3b95('0x27')]]={'$like':'%'+_0x398755[_0x3b95('0x31')][_0x3b95('0x3a')]+'%'};return _0x90642a;}})});}_0x85fc99=_[_0x3b95('0x3b')]({},_0x85fc99,_0x398755['options']);var _0x55386f={'where':_0x85fc99[_0x3b95('0x3d')]};return db[_0x3b95('0x2b')][_0x3b95('0x19')](_0x55386f)[_0x3b95('0x22')](function(_0x3a9670){_0x23c9af[_0x3b95('0x19')]=_0x3a9670;if(_0x398755['query']['includeAll']){_0x85fc99['include']=[{'all':!![]}];}return db[_0x3b95('0x2b')]['findAll'](_0x85fc99);})[_0x3b95('0x22')](function(_0x5eff1d){_0x23c9af[_0x3b95('0x3e')]=_0x5eff1d;return _0x23c9af;})[_0x3b95('0x22')](respondWithFilteredResult(_0xd40b17,_0x85fc99))[_0x3b95('0x3f')](handleError(_0xd40b17,null));};exports[_0x3b95('0x40')]=function(_0x5668c6,_0x566378){var _0x229f0e={'raw':![],'where':{'id':_0x5668c6[_0x3b95('0x41')]['id']}},_0x1353de={};_0x1353de['model']=_['keys'](db[_0x3b95('0x2b')][_0x3b95('0x2c')]);_0x1353de[_0x3b95('0x31')]=_[_0x3b95('0x30')](_0x5668c6['query']);_0x1353de[_0x3b95('0x32')]=_['intersection'](_0x1353de[_0x3b95('0x2f')],_0x1353de[_0x3b95('0x31')]);_0x229f0e[_0x3b95('0x33')]=_[_0x3b95('0x34')](_0x1353de[_0x3b95('0x2f')],qs[_0x3b95('0x35')](_0x5668c6[_0x3b95('0x31')]['fields']));_0x229f0e[_0x3b95('0x33')]=_0x229f0e[_0x3b95('0x33')][_0x3b95('0x36')]?_0x229f0e[_0x3b95('0x33')]:_0x1353de[_0x3b95('0x2f')];if(_0x5668c6[_0x3b95('0x31')][_0x3b95('0x42')]){_0x229f0e[_0x3b95('0x43')]=[{'all':!![]}];}_0x229f0e=_[_0x3b95('0x3b')]({},_0x229f0e,_0x5668c6[_0x3b95('0x44')]);return db[_0x3b95('0x2b')][_0x3b95('0x45')](_0x229f0e)[_0x3b95('0x22')](handleEntityNotFound(_0x566378,null))[_0x3b95('0x22')](respondWithResult(_0x566378,null))[_0x3b95('0x3f')](handleError(_0x566378,null));};exports[_0x3b95('0x46')]=function(_0x2ba0d4,_0x3d2bc9){return db[_0x3b95('0x2b')][_0x3b95('0x46')](_0x2ba0d4[_0x3b95('0x47')],{})['then'](respondWithResult(_0x3d2bc9,0xc9))[_0x3b95('0x3f')](handleError(_0x3d2bc9,null));};exports[_0x3b95('0x21')]=function(_0x1ddae1,_0x41a2aa){if(_0x1ddae1[_0x3b95('0x47')]['id']){delete _0x1ddae1[_0x3b95('0x47')]['id'];}return db[_0x3b95('0x2b')][_0x3b95('0x45')]({'where':{'id':_0x1ddae1[_0x3b95('0x41')]['id']}})['then'](handleEntityNotFound(_0x41a2aa,null))[_0x3b95('0x22')](saveUpdates(_0x1ddae1['body'],null))[_0x3b95('0x22')](respondWithResult(_0x41a2aa,null))[_0x3b95('0x3f')](handleError(_0x41a2aa,null));};exports[_0x3b95('0x23')]=function(_0x458a8a,_0x7bf5ff){return db[_0x3b95('0x2b')][_0x3b95('0x45')]({'where':{'id':_0x458a8a['params']['id']}})['then'](handleEntityNotFound(_0x7bf5ff,null))['then'](removeEntity(_0x7bf5ff,null))[_0x3b95('0x3f')](handleError(_0x7bf5ff,null));};exports['addConditions']=function(_0x3baa13,_0x590dcb,_0x2c274c){return db[_0x3b95('0x48')]['find']({'where':{'id':_0x3baa13[_0x3b95('0x41')]['id']}})[_0x3b95('0x22')](handleEntityNotFound(_0x590dcb,null))[_0x3b95('0x22')](function(_0x5209c9){if(_0x5209c9){return _0x5209c9[_0x3b95('0x49')](_0x3baa13[_0x3b95('0x47')][_0x3b95('0x4a')],_[_0x3b95('0x4b')](_0x3baa13[_0x3b95('0x47')],['ids','id'])||{});}})[_0x3b95('0x22')](respondWithResult(_0x590dcb,null))['catch'](handleError(_0x590dcb,null));};exports['getConditions']=function(_0x2d6bab,_0x44d0ce,_0x42d8fa){var _0xc67370={};var _0x2413ca={};var _0x32302b;var _0x329a69;return db[_0x3b95('0x2b')][_0x3b95('0x4c')]({'where':{'id':_0x2d6bab[_0x3b95('0x41')]['id']}})[_0x3b95('0x22')](handleEntityNotFound(_0x44d0ce,null))['then'](function(_0x408d70){if(_0x408d70){_0x32302b=_0x408d70;_0x2413ca[_0x3b95('0x2f')]=_[_0x3b95('0x30')](db['Condition'][_0x3b95('0x2c')]);_0x2413ca['query']=_[_0x3b95('0x30')](_0x2d6bab['query']);_0x2413ca[_0x3b95('0x32')]=_[_0x3b95('0x34')](_0x2413ca['model'],_0x2413ca[_0x3b95('0x31')]);_0xc67370[_0x3b95('0x33')]=_['intersection'](_0x2413ca['model'],qs[_0x3b95('0x35')](_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x35')]));_0xc67370[_0x3b95('0x33')]=_0xc67370['attributes']['length']?_0xc67370[_0x3b95('0x33')]:_0x2413ca['model'];_0xc67370[_0x3b95('0x4d')]=qs[_0x3b95('0x39')](_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x39')]);_0xc67370['where']=qs[_0x3b95('0x32')](_[_0x3b95('0x4e')](_0x2d6bab['query'],_0x2413ca[_0x3b95('0x32')]));if(_0x2d6bab['query'][_0x3b95('0x3a')]){_0xc67370[_0x3b95('0x3d')]=_[_0x3b95('0x3b')](_0xc67370[_0x3b95('0x3d')],{'$or':_['map'](_0xc67370[_0x3b95('0x33')],function(_0x37f176){var _0x433eb7={};_0x433eb7[_0x37f176]={'$like':'%'+_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x3a')]+'%'};return _0x433eb7;})});}_0xc67370=_[_0x3b95('0x3b')]({},_0xc67370,_0x2d6bab[_0x3b95('0x44')]);return _0x32302b[_0x3b95('0x4f')](_0xc67370);}})[_0x3b95('0x22')](function(_0xd22d88){if(_0xd22d88){_0x329a69=_0xd22d88[_0x3b95('0x36')];if(!_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x37')](_0x3b95('0x38'))){_0xc67370[_0x3b95('0x1b')]=qs[_0x3b95('0x1b')](_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x1b')]);_0xc67370[_0x3b95('0x1a')]=qs[_0x3b95('0x1a')](_0x2d6bab[_0x3b95('0x31')][_0x3b95('0x1a')]);}return _0x32302b[_0x3b95('0x4f')](_0xc67370);}})[_0x3b95('0x22')](function(_0x11ffc9){if(_0x11ffc9){return _0x11ffc9?{'count':_0x329a69,'rows':_0x11ffc9}:null;}})[_0x3b95('0x22')](respondWithResult(_0x44d0ce,null))[_0x3b95('0x3f')](handleError(_0x44d0ce,null));};exports[_0x3b95('0x50')]=function(_0x748aee,_0x10a501,_0x5c21aa){return db[_0x3b95('0x51')][_0x3b95('0x45')]({'where':{'id':_0x748aee['params']['id']}})[_0x3b95('0x22')](handleEntityNotFound(_0x10a501,null))[_0x3b95('0x22')](function(_0x519343){if(_0x519343){return _0x519343[_0x3b95('0x50')](_0x748aee[_0x3b95('0x47')][_0x3b95('0x4a')],_['omit'](_0x748aee[_0x3b95('0x47')],[_0x3b95('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x10a501,null))[_0x3b95('0x3f')](handleError(_0x10a501,null));};exports[_0x3b95('0x52')]=function(_0x1b9c58,_0x373380,_0x85ae15){var _0x1792ed={};var _0x3c580c={};var _0x3003ba;var _0xd1bdea;return db[_0x3b95('0x2b')]['findOne']({'where':{'id':_0x1b9c58[_0x3b95('0x41')]['id']}})[_0x3b95('0x22')](handleEntityNotFound(_0x373380,null))[_0x3b95('0x22')](function(_0x2eb282){if(_0x2eb282){_0x3003ba=_0x2eb282;_0x3c580c['model']=_['keys'](db['Action'][_0x3b95('0x2c')]);_0x3c580c['query']=_[_0x3b95('0x30')](_0x1b9c58[_0x3b95('0x31')]);_0x3c580c[_0x3b95('0x32')]=_[_0x3b95('0x34')](_0x3c580c[_0x3b95('0x2f')],_0x3c580c[_0x3b95('0x31')]);_0x1792ed['attributes']=_[_0x3b95('0x34')](_0x3c580c[_0x3b95('0x2f')],qs[_0x3b95('0x35')](_0x1b9c58[_0x3b95('0x31')]['fields']));_0x1792ed[_0x3b95('0x33')]=_0x1792ed[_0x3b95('0x33')][_0x3b95('0x36')]?_0x1792ed[_0x3b95('0x33')]:_0x3c580c[_0x3b95('0x2f')];_0x1792ed[_0x3b95('0x4d')]=qs['sort'](_0x1b9c58[_0x3b95('0x31')][_0x3b95('0x39')]);_0x1792ed['where']=qs[_0x3b95('0x32')](_[_0x3b95('0x4e')](_0x1b9c58[_0x3b95('0x31')],_0x3c580c[_0x3b95('0x32')]));if(_0x1b9c58[_0x3b95('0x31')][_0x3b95('0x3a')]){_0x1792ed[_0x3b95('0x3d')]=_[_0x3b95('0x3b')](_0x1792ed[_0x3b95('0x3d')],{'$or':_['map'](_0x1792ed['attributes'],function(_0x5b3ded){var _0x4de33f={};_0x4de33f[_0x5b3ded]={'$like':'%'+_0x1b9c58[_0x3b95('0x31')][_0x3b95('0x3a')]+'%'};return _0x4de33f;})});}_0x1792ed=_[_0x3b95('0x3b')]({},_0x1792ed,_0x1b9c58[_0x3b95('0x44')]);return _0x3003ba[_0x3b95('0x52')](_0x1792ed);}})[_0x3b95('0x22')](function(_0x215f26){if(_0x215f26){_0xd1bdea=_0x215f26[_0x3b95('0x36')];if(!_0x1b9c58[_0x3b95('0x31')]['hasOwnProperty'](_0x3b95('0x38'))){_0x1792ed[_0x3b95('0x1b')]=qs[_0x3b95('0x1b')](_0x1b9c58['query'][_0x3b95('0x1b')]);_0x1792ed[_0x3b95('0x1a')]=qs[_0x3b95('0x1a')](_0x1b9c58[_0x3b95('0x31')][_0x3b95('0x1a')]);}return _0x3003ba[_0x3b95('0x52')](_0x1792ed);}})[_0x3b95('0x22')](function(_0x48995){if(_0x48995){return _0x48995?{'count':_0xd1bdea,'rows':_0x48995}:null;}})['then'](respondWithResult(_0x373380,null))[_0x3b95('0x3f')](handleError(_0x373380,null));}; \ No newline at end of file +var _0xe10e=['destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then'];(function(_0x29fa16,_0x17c91e){var _0x139696=function(_0x192279){while(--_0x192279){_0x29fa16['push'](_0x29fa16['shift']());}};_0x139696(++_0x17c91e);}(_0xe10e,0x87));var _0xee10=function(_0x2e81c9,_0x15a07c){_0x2e81c9=_0x2e81c9-0x0;var _0x217cf2=_0xe10e[_0x2e81c9];return _0x217cf2;};'use strict';var pdf=require(_0xee10('0x0'));var emlformat=require(_0xee10('0x1'));var rimraf=require(_0xee10('0x2'));var zipdir=require(_0xee10('0x3'));var jsonpatch=require(_0xee10('0x4'));var rp=require(_0xee10('0x5'));var moment=require(_0xee10('0x6'));var BPromise=require(_0xee10('0x7'));var Mustache=require(_0xee10('0x8'));var util=require('util');var path=require(_0xee10('0x9'));var sox=require('sox');var csv=require(_0xee10('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xee10('0xb'));var squel=require(_0xee10('0xc'));var crypto=require(_0xee10('0xd'));var jsforce=require(_0xee10('0xe'));var deskjs=require(_0xee10('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee10('0x10'));var Redis=require(_0xee10('0x11'));var authService=require(_0xee10('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee10('0x13'));var hardwareService=require(_0xee10('0x14'));var logger=require(_0xee10('0x15'))(_0xee10('0x16'));var utils=require(_0xee10('0x17'));var config=require(_0xee10('0x18'));var db=require(_0xee10('0x19'))['db'];function respondWithStatusCode(_0x2d1410,_0x95ae82){_0x95ae82=_0x95ae82||0xcc;return function(_0x5a91b2){if(_0x5a91b2){return _0x2d1410[_0xee10('0x1a')](_0x95ae82);}return _0x2d1410[_0xee10('0x1b')](_0x95ae82)[_0xee10('0x1c')]();};}function respondWithResult(_0x374086,_0x43549f){_0x43549f=_0x43549f||0xc8;return function(_0x541049){if(_0x541049){return _0x374086[_0xee10('0x1b')](_0x43549f)[_0xee10('0x1d')](_0x541049);}};}function respondWithFilteredResult(_0x1844af,_0x3bf93e){return function(_0x231b72){if(_0x231b72){var _0x5ae504=_0x231b72['count'],_0x59b6cf=_0x3bf93e[_0xee10('0x1e')],_0x47cd94=_0x3bf93e[_0xee10('0x1e')]+_0x3bf93e[_0xee10('0x1f')],_0x2ab24c;if(_0x47cd94>=_0x5ae504){_0x47cd94=_0x5ae504;_0x2ab24c=0xc8;}else{_0x2ab24c=0xce;}_0x1844af[_0xee10('0x1b')](_0x2ab24c);return _0x1844af['set'](_0xee10('0x20'),_0x59b6cf+'-'+_0x47cd94+'/'+_0x5ae504)['json'](_0x231b72);}return null;};}function patchUpdates(_0x3b99ad){return function(_0x253fe3){try{jsonpatch[_0xee10('0x21')](_0x253fe3,_0x3b99ad,!![]);}catch(_0x394110){return BPromise[_0xee10('0x22')](_0x394110);}return _0x253fe3['save']();};}function saveUpdates(_0x20a481,_0x1ad0d0){return function(_0x50684b){if(_0x50684b){return _0x50684b[_0xee10('0x23')](_0x20a481)[_0xee10('0x24')](function(_0x15a4dd){return _0x15a4dd;});}return null;};}function removeEntity(_0x4e13ea,_0x876f83){return function(_0x4e1d46){if(_0x4e1d46){return _0x4e1d46[_0xee10('0x25')]()[_0xee10('0x24')](function(){_0x4e13ea[_0xee10('0x1b')](0xcc)[_0xee10('0x1c')]();});}};}function handleEntityNotFound(_0x5c9bb3,_0x189713){return function(_0x1ca64b){if(!_0x1ca64b){_0x5c9bb3[_0xee10('0x1a')](0x194);}return _0x1ca64b;};}function handleError(_0x18ba76,_0x56923f){_0x56923f=_0x56923f||0x1f4;return function(_0x5d8dae){logger['error'](_0x5d8dae[_0xee10('0x26')]);if(_0x5d8dae[_0xee10('0x27')]){delete _0x5d8dae['name'];}_0x18ba76['status'](_0x56923f)[_0xee10('0x28')](_0x5d8dae);};}exports[_0xee10('0x29')]=function(_0x49eee2,_0x222c17){var _0x1f2591={},_0x34944a={},_0x59c20d={'count':0x0,'rows':[]};var _0x3e349b=_[_0xee10('0x2a')](db['Automation'][_0xee10('0x2b')],function(_0x3bebeb){return{'name':_0x3bebeb[_0xee10('0x2c')],'type':_0x3bebeb[_0xee10('0x2d')][_0xee10('0x2e')]};});_0x34944a[_0xee10('0x2f')]=_[_0xee10('0x2a')](_0x3e349b,'name');_0x34944a[_0xee10('0x30')]=_[_0xee10('0x31')](_0x49eee2[_0xee10('0x30')]);_0x34944a[_0xee10('0x32')]=_['intersection'](_0x34944a[_0xee10('0x2f')],_0x34944a[_0xee10('0x30')]);_0x1f2591['attributes']=_['intersection'](_0x34944a[_0xee10('0x2f')],qs[_0xee10('0x33')](_0x49eee2['query'][_0xee10('0x33')]));_0x1f2591[_0xee10('0x34')]=_0x1f2591[_0xee10('0x34')][_0xee10('0x35')]?_0x1f2591['attributes']:_0x34944a[_0xee10('0x2f')];if(!_0x49eee2[_0xee10('0x30')][_0xee10('0x36')]('nolimit')){_0x1f2591[_0xee10('0x1f')]=qs[_0xee10('0x1f')](_0x49eee2['query']['limit']);_0x1f2591[_0xee10('0x1e')]=qs['offset'](_0x49eee2[_0xee10('0x30')][_0xee10('0x1e')]);}_0x1f2591[_0xee10('0x37')]=qs[_0xee10('0x38')](_0x49eee2[_0xee10('0x30')][_0xee10('0x38')]);_0x1f2591[_0xee10('0x39')]=qs[_0xee10('0x32')](_[_0xee10('0x3a')](_0x49eee2['query'],_0x34944a[_0xee10('0x32')]),_0x3e349b);if(_0x49eee2[_0xee10('0x30')][_0xee10('0x3b')]){_0x1f2591['where']=_[_0xee10('0x3c')](_0x1f2591[_0xee10('0x39')],{'$or':_[_0xee10('0x2a')](_0x3e349b,function(_0xadfc80){if(_0xadfc80[_0xee10('0x2d')]!==_0xee10('0x3d')){var _0x181ad5={};_0x181ad5[_0xadfc80[_0xee10('0x27')]]={'$like':'%'+_0x49eee2['query']['filter']+'%'};return _0x181ad5;}})});}_0x1f2591=_[_0xee10('0x3c')]({},_0x1f2591,_0x49eee2[_0xee10('0x3e')]);var _0x7d6208={'where':_0x1f2591['where']};return db[_0xee10('0x3f')][_0xee10('0x40')](_0x7d6208)[_0xee10('0x24')](function(_0x3ffdff){_0x59c20d[_0xee10('0x40')]=_0x3ffdff;if(_0x49eee2[_0xee10('0x30')][_0xee10('0x41')]){_0x1f2591[_0xee10('0x42')]=[{'all':!![]}];}return db[_0xee10('0x3f')][_0xee10('0x43')](_0x1f2591);})[_0xee10('0x24')](function(_0x30010c){_0x59c20d[_0xee10('0x44')]=_0x30010c;return _0x59c20d;})[_0xee10('0x24')](respondWithFilteredResult(_0x222c17,_0x1f2591))[_0xee10('0x45')](handleError(_0x222c17,null));};exports[_0xee10('0x46')]=function(_0x38f684,_0x373635){var _0xa27329={'raw':![],'where':{'id':_0x38f684[_0xee10('0x47')]['id']}},_0x4cf160={};_0x4cf160['model']=_['keys'](db[_0xee10('0x3f')][_0xee10('0x2b')]);_0x4cf160[_0xee10('0x30')]=_[_0xee10('0x31')](_0x38f684[_0xee10('0x30')]);_0x4cf160[_0xee10('0x32')]=_['intersection'](_0x4cf160[_0xee10('0x2f')],_0x4cf160[_0xee10('0x30')]);_0xa27329[_0xee10('0x34')]=_[_0xee10('0x48')](_0x4cf160[_0xee10('0x2f')],qs['fields'](_0x38f684['query']['fields']));_0xa27329[_0xee10('0x34')]=_0xa27329[_0xee10('0x34')][_0xee10('0x35')]?_0xa27329[_0xee10('0x34')]:_0x4cf160['model'];if(_0x38f684[_0xee10('0x30')]['includeAll']){_0xa27329[_0xee10('0x42')]=[{'all':!![]}];}_0xa27329=_[_0xee10('0x3c')]({},_0xa27329,_0x38f684[_0xee10('0x3e')]);return db['Automation'][_0xee10('0x49')](_0xa27329)['then'](handleEntityNotFound(_0x373635,null))[_0xee10('0x24')](respondWithResult(_0x373635,null))[_0xee10('0x45')](handleError(_0x373635,null));};exports[_0xee10('0x4a')]=function(_0x373ece,_0x50f68e){return db['Automation'][_0xee10('0x4a')](_0x373ece['body'],{})[_0xee10('0x24')](respondWithResult(_0x50f68e,0xc9))[_0xee10('0x45')](handleError(_0x50f68e,null));};exports['update']=function(_0x2c3f4c,_0x44cb2e){if(_0x2c3f4c[_0xee10('0x4b')]['id']){delete _0x2c3f4c[_0xee10('0x4b')]['id'];}return db[_0xee10('0x3f')][_0xee10('0x49')]({'where':{'id':_0x2c3f4c['params']['id']}})[_0xee10('0x24')](handleEntityNotFound(_0x44cb2e,null))[_0xee10('0x24')](saveUpdates(_0x2c3f4c['body'],null))[_0xee10('0x24')](respondWithResult(_0x44cb2e,null))['catch'](handleError(_0x44cb2e,null));};exports['destroy']=function(_0x13e871,_0x3a5d51){return db[_0xee10('0x3f')][_0xee10('0x49')]({'where':{'id':_0x13e871[_0xee10('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a5d51,null))[_0xee10('0x24')](removeEntity(_0x3a5d51,null))[_0xee10('0x45')](handleError(_0x3a5d51,null));};exports[_0xee10('0x4c')]=function(_0x38cfdf,_0x5d990e,_0x423ccd){return db[_0xee10('0x4d')][_0xee10('0x49')]({'where':{'id':_0x38cfdf[_0xee10('0x47')]['id']}})[_0xee10('0x24')](handleEntityNotFound(_0x5d990e,null))[_0xee10('0x24')](function(_0x410ef6){if(_0x410ef6){return _0x410ef6[_0xee10('0x4c')](_0x38cfdf[_0xee10('0x4b')][_0xee10('0x4e')],_[_0xee10('0x4f')](_0x38cfdf[_0xee10('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d990e,null))['catch'](handleError(_0x5d990e,null));};exports[_0xee10('0x50')]=function(_0x5b9378,_0x2cd852,_0x5828f9){var _0x374140={};var _0x590545={};var _0x14f455;var _0x5678f3;return db['Automation'][_0xee10('0x51')]({'where':{'id':_0x5b9378['params']['id']}})[_0xee10('0x24')](handleEntityNotFound(_0x2cd852,null))[_0xee10('0x24')](function(_0x478611){if(_0x478611){_0x14f455=_0x478611;_0x590545[_0xee10('0x2f')]=_['keys'](db[_0xee10('0x4d')][_0xee10('0x2b')]);_0x590545[_0xee10('0x30')]=_['keys'](_0x5b9378[_0xee10('0x30')]);_0x590545[_0xee10('0x32')]=_[_0xee10('0x48')](_0x590545['model'],_0x590545[_0xee10('0x30')]);_0x374140[_0xee10('0x34')]=_[_0xee10('0x48')](_0x590545[_0xee10('0x2f')],qs[_0xee10('0x33')](_0x5b9378[_0xee10('0x30')][_0xee10('0x33')]));_0x374140['attributes']=_0x374140[_0xee10('0x34')]['length']?_0x374140['attributes']:_0x590545[_0xee10('0x2f')];_0x374140[_0xee10('0x37')]=qs['sort'](_0x5b9378['query'][_0xee10('0x38')]);_0x374140[_0xee10('0x39')]=qs['filters'](_['pick'](_0x5b9378[_0xee10('0x30')],_0x590545['filters']));if(_0x5b9378[_0xee10('0x30')]['filter']){_0x374140[_0xee10('0x39')]=_[_0xee10('0x3c')](_0x374140['where'],{'$or':_[_0xee10('0x2a')](_0x374140[_0xee10('0x34')],function(_0x4b5f5d){var _0x53ece0={};_0x53ece0[_0x4b5f5d]={'$like':'%'+_0x5b9378['query'][_0xee10('0x3b')]+'%'};return _0x53ece0;})});}_0x374140=_['merge']({},_0x374140,_0x5b9378[_0xee10('0x3e')]);return _0x14f455[_0xee10('0x50')](_0x374140);}})[_0xee10('0x24')](function(_0x2bc474){if(_0x2bc474){_0x5678f3=_0x2bc474['length'];if(!_0x5b9378[_0xee10('0x30')][_0xee10('0x36')](_0xee10('0x52'))){_0x374140[_0xee10('0x1f')]=qs[_0xee10('0x1f')](_0x5b9378[_0xee10('0x30')]['limit']);_0x374140[_0xee10('0x1e')]=qs[_0xee10('0x1e')](_0x5b9378[_0xee10('0x30')][_0xee10('0x1e')]);}return _0x14f455['getConditions'](_0x374140);}})[_0xee10('0x24')](function(_0x416c1b){if(_0x416c1b){return _0x416c1b?{'count':_0x5678f3,'rows':_0x416c1b}:null;}})[_0xee10('0x24')](respondWithResult(_0x2cd852,null))[_0xee10('0x45')](handleError(_0x2cd852,null));};exports[_0xee10('0x53')]=function(_0x4f579e,_0x26ac6b,_0x273ec4){return db[_0xee10('0x54')]['find']({'where':{'id':_0x4f579e[_0xee10('0x47')]['id']}})[_0xee10('0x24')](handleEntityNotFound(_0x26ac6b,null))[_0xee10('0x24')](function(_0x200914){if(_0x200914){return _0x200914['addActions'](_0x4f579e['body']['ids'],_[_0xee10('0x4f')](_0x4f579e[_0xee10('0x4b')],[_0xee10('0x4e'),'id'])||{});}})[_0xee10('0x24')](respondWithResult(_0x26ac6b,null))[_0xee10('0x45')](handleError(_0x26ac6b,null));};exports[_0xee10('0x55')]=function(_0x4b9076,_0xe6c7d5,_0x5ea5ab){var _0x308cb3={};var _0x18c204={};var _0x2d622f;var _0x1d567d;return db['Automation'][_0xee10('0x51')]({'where':{'id':_0x4b9076[_0xee10('0x47')]['id']}})[_0xee10('0x24')](handleEntityNotFound(_0xe6c7d5,null))['then'](function(_0x2a0b85){if(_0x2a0b85){_0x2d622f=_0x2a0b85;_0x18c204[_0xee10('0x2f')]=_[_0xee10('0x31')](db[_0xee10('0x54')][_0xee10('0x2b')]);_0x18c204[_0xee10('0x30')]=_['keys'](_0x4b9076[_0xee10('0x30')]);_0x18c204[_0xee10('0x32')]=_[_0xee10('0x48')](_0x18c204[_0xee10('0x2f')],_0x18c204[_0xee10('0x30')]);_0x308cb3[_0xee10('0x34')]=_['intersection'](_0x18c204[_0xee10('0x2f')],qs[_0xee10('0x33')](_0x4b9076[_0xee10('0x30')]['fields']));_0x308cb3['attributes']=_0x308cb3[_0xee10('0x34')]['length']?_0x308cb3[_0xee10('0x34')]:_0x18c204[_0xee10('0x2f')];_0x308cb3[_0xee10('0x37')]=qs[_0xee10('0x38')](_0x4b9076[_0xee10('0x30')][_0xee10('0x38')]);_0x308cb3['where']=qs['filters'](_[_0xee10('0x3a')](_0x4b9076[_0xee10('0x30')],_0x18c204[_0xee10('0x32')]));if(_0x4b9076[_0xee10('0x30')]['filter']){_0x308cb3[_0xee10('0x39')]=_[_0xee10('0x3c')](_0x308cb3[_0xee10('0x39')],{'$or':_[_0xee10('0x2a')](_0x308cb3[_0xee10('0x34')],function(_0x4be7bd){var _0x4349cf={};_0x4349cf[_0x4be7bd]={'$like':'%'+_0x4b9076[_0xee10('0x30')]['filter']+'%'};return _0x4349cf;})});}_0x308cb3=_[_0xee10('0x3c')]({},_0x308cb3,_0x4b9076[_0xee10('0x3e')]);return _0x2d622f['getActions'](_0x308cb3);}})[_0xee10('0x24')](function(_0x56822c){if(_0x56822c){_0x1d567d=_0x56822c[_0xee10('0x35')];if(!_0x4b9076['query'][_0xee10('0x36')](_0xee10('0x52'))){_0x308cb3['limit']=qs['limit'](_0x4b9076[_0xee10('0x30')]['limit']);_0x308cb3[_0xee10('0x1e')]=qs['offset'](_0x4b9076[_0xee10('0x30')][_0xee10('0x1e')]);}return _0x2d622f['getActions'](_0x308cb3);}})[_0xee10('0x24')](function(_0x188ca5){if(_0x188ca5){return _0x188ca5?{'count':_0x1d567d,'rows':_0x188ca5}:null;}})['then'](respondWithResult(_0xe6c7d5,null))[_0xee10('0x45')](handleError(_0xe6c7d5,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 71c1e0a..94575f7 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x9a19,0x114));var _0x99a1=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x9a19[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x3c7d35,_0x21c78d){var _0x5aa547=function(_0x5782f2){while(--_0x5782f2){_0x3c7d35['push'](_0x3c7d35['shift']());}};_0x5aa547(++_0x21c78d);}(_0xb138,0x1dd));var _0x8b13=function(_0x4058be,_0x1550c3){_0x4058be=_0x4058be-0x0;var _0x23fdd8=_0xb138[_0x4058be];return _0x23fdd8;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('0xb'),'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 dc171c3..d2b1108 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 _0xb54c=['stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xa1faf3,_0x495f04){var _0x55e7be=function(_0x42d384){while(--_0x42d384){_0xa1faf3['push'](_0xa1faf3['shift']());}};_0x55e7be(++_0x495f04);}(_0xb54c,0x1d5));var _0xcb54=function(_0x33acae,_0x523cce){_0x33acae=_0x33acae-0x0;var _0xdd24b0=_0xb54c[_0x33acae];return _0xdd24b0;};'use strict';var _=require(_0xcb54('0x0'));var util=require(_0xcb54('0x1'));var moment=require('moment');var BPromise=require(_0xcb54('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb54('0x4'));var logger=require(_0xcb54('0x5'))(_0xcb54('0x6'));var config=require(_0xcb54('0x7'));var jayson=require(_0xcb54('0x8'));var client=jayson['client'][_0xcb54('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x530fce,_0x43ac38,_0x477b58){return new BPromise(function(_0x3b2a29,_0x434d93){return client[_0xcb54('0xa')](_0x530fce,_0x477b58)[_0xcb54('0xb')](function(_0x314a0f){logger['info']('Automation,\x20%s,\x20%s',_0x43ac38,'request\x20sent');logger[_0xcb54('0xc')](_0xcb54('0xd'),_0x43ac38,_0xcb54('0xe'),JSON[_0xcb54('0xf')](_0x314a0f));if(_0x314a0f[_0xcb54('0x10')]){if(_0x314a0f['error'][_0xcb54('0x11')]===0x1f4){logger['error'](_0xcb54('0x12'),_0x43ac38,_0x314a0f[_0xcb54('0x10')][_0xcb54('0x13')]);return _0x434d93(_0x314a0f[_0xcb54('0x10')][_0xcb54('0x13')]);}logger['error'](_0xcb54('0x12'),_0x43ac38,_0x314a0f['error']['message']);return _0x3b2a29(_0x314a0f[_0xcb54('0x10')][_0xcb54('0x13')]);}else{logger[_0xcb54('0x14')]('Automation,\x20%s,\x20%s',_0x43ac38,_0xcb54('0xe'));_0x3b2a29(_0x314a0f[_0xcb54('0x15')][_0xcb54('0x13')]);}})['catch'](function(_0x6460e6){logger[_0xcb54('0x10')]('Automation,\x20%s,\x20%s',_0x43ac38,_0x6460e6);_0x434d93(_0x6460e6);});});} \ No newline at end of file +var _0x39bf=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e8042,_0x2d4ee4){var _0x30a1ed=function(_0x3fa1b2){while(--_0x3fa1b2){_0x1e8042['push'](_0x1e8042['shift']());}};_0x30a1ed(++_0x2d4ee4);}(_0x39bf,0x131));var _0xf39b=function(_0xc5fb7c,_0x457195){_0xc5fb7c=_0xc5fb7c-0x0;var _0x1b6f91=_0x39bf[_0xc5fb7c];return _0x1b6f91;};'use strict';var _=require(_0xf39b('0x0'));var util=require(_0xf39b('0x1'));var moment=require(_0xf39b('0x2'));var BPromise=require(_0xf39b('0x3'));var rs=require(_0xf39b('0x4'));var fs=require('fs');var Redis=require(_0xf39b('0x5'));var db=require(_0xf39b('0x6'))['db'];var utils=require(_0xf39b('0x7'));var logger=require('../../config/logger')(_0xf39b('0x8'));var config=require(_0xf39b('0x9'));var jayson=require(_0xf39b('0xa'));var client=jayson['client'][_0xf39b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8fdf2f,_0x2b5a04,_0xb3f009){return new BPromise(function(_0x31d850,_0x120546){return client[_0xf39b('0xc')](_0x8fdf2f,_0xb3f009)[_0xf39b('0xd')](function(_0x565014){logger['info'](_0xf39b('0xe'),_0x2b5a04,_0xf39b('0xf'));logger[_0xf39b('0x10')](_0xf39b('0x11'),_0x2b5a04,_0xf39b('0xf'),JSON[_0xf39b('0x12')](_0x565014));if(_0x565014['error']){if(_0x565014['error']['code']===0x1f4){logger[_0xf39b('0x13')]('Automation,\x20%s,\x20%s',_0x2b5a04,_0x565014[_0xf39b('0x13')][_0xf39b('0x14')]);return _0x120546(_0x565014['error']['message']);}logger[_0xf39b('0x13')](_0xf39b('0xe'),_0x2b5a04,_0x565014[_0xf39b('0x13')][_0xf39b('0x14')]);return _0x31d850(_0x565014[_0xf39b('0x13')][_0xf39b('0x14')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x2b5a04,_0xf39b('0xf'));_0x31d850(_0x565014[_0xf39b('0x15')][_0xf39b('0x14')]);}})[_0xf39b('0x16')](function(_0x1ca10d){logger[_0xf39b('0x13')](_0xf39b('0xe'),_0x2b5a04,_0x1ca10d);_0x120546(_0x1ca10d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ba7f508..a3f510e 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 _0xadd7=['put','update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x3dcfb9,_0x56d93c){var _0x27688b=function(_0x34935d){while(--_0x34935d){_0x3dcfb9['push'](_0x3dcfb9['shift']());}};_0x27688b(++_0x56d93c);}(_0xadd7,0x1b9));var _0x7add=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xadd7[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x7add('0x0'));var path=require(_0x7add('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7add('0x2')]();var auth=require(_0x7add('0x3'));var interaction=require(_0x7add('0x4'));var config=require(_0x7add('0x5'));var controller=require(_0x7add('0x6'));router[_0x7add('0x7')]('/',auth['isAuthenticated'](),controller[_0x7add('0x8')]);router[_0x7add('0x7')](_0x7add('0x9'),auth[_0x7add('0xa')](),controller[_0x7add('0xb')]);router['get'](_0x7add('0xc'),auth['isAuthenticated'](),controller[_0x7add('0xd')]);router[_0x7add('0x7')](_0x7add('0xe'),auth['isAuthenticated'](),controller[_0x7add('0xf')]);router[_0x7add('0x10')]('/',auth['isAuthenticated'](),controller[_0x7add('0x11')]);router[_0x7add('0x10')](_0x7add('0xc'),auth['isAuthenticated'](),controller[_0x7add('0x12')]);router[_0x7add('0x10')](_0x7add('0xe'),auth[_0x7add('0xa')](),controller['addActions']);router[_0x7add('0x13')](_0x7add('0x9'),auth[_0x7add('0xa')](),controller[_0x7add('0x14')]);router[_0x7add('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7add('0x16')]=router; \ No newline at end of file +var _0x9b05=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','getConditions','getActions','post','/:id/conditions','addConditions','addActions','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x9b05,0x1cb));var _0x59b0=function(_0x5c3429,_0x305dbc){_0x5c3429=_0x5c3429-0x0;var _0x3e8263=_0x9b05[_0x5c3429];return _0x3e8263;};'use strict';var multer=require('multer');var util=require(_0x59b0('0x0'));var path=require(_0x59b0('0x1'));var timeout=require(_0x59b0('0x2'));var express=require(_0x59b0('0x3'));var router=express[_0x59b0('0x4')]();var auth=require(_0x59b0('0x5'));var interaction=require(_0x59b0('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x59b0('0x7')]('/',auth[_0x59b0('0x8')](),controller[_0x59b0('0x9')]);router[_0x59b0('0x7')]('/:id',auth[_0x59b0('0x8')](),controller[_0x59b0('0xa')]);router[_0x59b0('0x7')]('/:id/conditions',auth[_0x59b0('0x8')](),controller[_0x59b0('0xb')]);router[_0x59b0('0x7')]('/:id/actions',auth[_0x59b0('0x8')](),controller[_0x59b0('0xc')]);router[_0x59b0('0xd')]('/',auth[_0x59b0('0x8')](),controller['create']);router[_0x59b0('0xd')](_0x59b0('0xe'),auth[_0x59b0('0x8')](),controller[_0x59b0('0xf')]);router[_0x59b0('0xd')]('/:id/actions',auth['isAuthenticated'](),controller[_0x59b0('0x10')]);router['put'](_0x59b0('0x11'),auth['isAuthenticated'](),controller[_0x59b0('0x12')]);router[_0x59b0('0x13')]('/:id',auth[_0x59b0('0x8')](),controller[_0x59b0('0x14')]);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 82a3634..da583a8 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 _0xec87=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\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','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING'];(function(_0x33b880,_0xa71851){var _0x2390b0=function(_0x2cad49){while(--_0x2cad49){_0x33b880['push'](_0x33b880['shift']());}};_0x2390b0(++_0xa71851);}(_0xec87,0x162));var _0x7ec8=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xec87[_0x1597e2];return _0x4c8c0a;};'use strict';var Sequelize=require(_0x7ec8('0x0'));module[_0x7ec8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7ec8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7ec8('0x3')](_0x7ec8('0x4')),'allowNull':![],'defaultValue':_0x7ec8('0x4')},'description':{'type':Sequelize[_0x7ec8('0x5')]},'active':{'type':Sequelize[_0x7ec8('0x6')],'defaultValue':0x0,'comment':_0x7ec8('0x7')},'limitCalls':{'type':Sequelize[_0x7ec8('0x8')](0x4)[_0x7ec8('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7ec8('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7ec8('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7ec8('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7ec8('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7ec8('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7ec8('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7ec8('0x8')](0x3)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7ec8('0x11')},'dialTimezone':{'type':Sequelize[_0x7ec8('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7ec8('0x5')],'defaultValue':_0x7ec8('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x7ec8('0x3')](_0x7ec8('0x13'),'never','onlyIfOpen'),'defaultValue':_0x7ec8('0x13')},'dialAMDActive':{'type':Sequelize[_0x7ec8('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7ec8('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7ec8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7ec8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ec8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7ec8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7ec8('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7ec8('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7ec8('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7ec8('0x8')](0x9)[_0x7ec8('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ec8('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7ec8('0x3')](_0x7ec8('0x1c'),_0x7ec8('0x1d')),'defaultValue':_0x7ec8('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7ec8('0x8')](0x3)[_0x7ec8('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ec8('0x1e')},'dialCutDigit':{'type':Sequelize[_0x7ec8('0x8')](0x3)[_0x7ec8('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ec8('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7ec8('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x7ec8('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7ec8('0x8')](0x3)[_0x7ec8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ec8('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7ec8('0x8')](0x5)[_0x7ec8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ec8('0x27')}}; \ No newline at end of file +var _0xbd87=['DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x493c6d,_0xb6668f){var _0x29da08=function(_0xb33e20){while(--_0xb33e20){_0x493c6d['push'](_0x493c6d['shift']());}};_0x29da08(++_0xb6668f);}(_0xbd87,0x1af));var _0x7bd8=function(_0x573399,_0xcc8f15){_0x573399=_0x573399-0x0;var _0x171548=_0xbd87[_0x573399];return _0x171548;};'use strict';var Sequelize=require(_0x7bd8('0x0'));module['exports']={'name':{'type':Sequelize[_0x7bd8('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7bd8('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7bd8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7bd8('0x3')},'limitCalls':{'type':Sequelize[_0x7bd8('0x4')](0x4)[_0x7bd8('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7bd8('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7bd8('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7bd8('0x8')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7bd8('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'comment':_0x7bd8('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7bd8('0x4')](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7bd8('0xb')},'dialTimezone':{'type':Sequelize[_0x7bd8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7bd8('0x1')],'defaultValue':_0x7bd8('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x7bd8('0xd')](_0x7bd8('0xe'),_0x7bd8('0xf'),'onlyIfOpen'),'defaultValue':_0x7bd8('0xe')},'dialAMDActive':{'type':Sequelize[_0x7bd8('0x10')],'defaultValue':0x0,'comment':_0x7bd8('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7bd8('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7bd8('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7bd8('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7bd8('0x4')](0x9)[_0x7bd8('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7bd8('0x4')](0x9)[_0x7bd8('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7bd8('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7bd8('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7bd8('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7bd8('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7bd8('0x4')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7bd8('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7bd8('0x4')](0x5)[_0x7bd8('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7bd8('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7bd8('0x4')](0x9)[_0x7bd8('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7bd8('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7bd8('0xd')](_0x7bd8('0x18'),_0x7bd8('0x19')),'defaultValue':_0x7bd8('0x18')},'dialPrefix':{'type':Sequelize[_0x7bd8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7bd8('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7bd8('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7bd8('0x4')](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x7bd8('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7bd8('0x4')](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7bd8('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x7bd8('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7bd8('0x4')](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7bd8('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7bd8('0x4')](0x3)[_0x7bd8('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7bd8('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7bd8('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7bd8('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index e3147fb..08714be 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 _0x4297=['UserProfileResource','destroy','error','stack','send','index','Campaign','rawAttributes','fieldName','key','model','map','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','order','sort','CampaignId','options','findAll','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','ListId','push','all','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','update','then','get','IvrCampaigns'];(function(_0x3ec670,_0x3f50e5){var _0x159886=function(_0x329e16){while(--_0x329e16){_0x3ec670['push'](_0x3ec670['shift']());}};_0x159886(++_0x3f50e5);}(_0x4297,0xe2));var _0x7429=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x4297[_0x176329];return _0x31997c;};'use strict';var pdf=require(_0x7429('0x0'));var emlformat=require(_0x7429('0x1'));var rimraf=require(_0x7429('0x2'));var zipdir=require(_0x7429('0x3'));var jsonpatch=require(_0x7429('0x4'));var rp=require(_0x7429('0x5'));var moment=require(_0x7429('0x6'));var BPromise=require(_0x7429('0x7'));var Mustache=require('mustache');var util=require(_0x7429('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7429('0x9'));var ejs=require(_0x7429('0xa'));var fs=require('fs');var _=require(_0x7429('0xb'));var squel=require(_0x7429('0xc'));var crypto=require(_0x7429('0xd'));var jsforce=require(_0x7429('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7429('0x9'));var querystring=require('querystring');var Papa=require(_0x7429('0xf'));var Redis=require(_0x7429('0x10'));var authService=require(_0x7429('0x11'));var qs=require(_0x7429('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7429('0x13'))(_0x7429('0x14'));var utils=require('../../config/utils');var config=require(_0x7429('0x15'));var db=require(_0x7429('0x16'))['db'];function respondWithStatusCode(_0x4738cc,_0x1c596c){_0x1c596c=_0x1c596c||0xcc;return function(_0x1cea0c){if(_0x1cea0c){return _0x4738cc[_0x7429('0x17')](_0x1c596c);}return _0x4738cc['status'](_0x1c596c)[_0x7429('0x18')]();};}function respondWithResult(_0x3b5af6,_0x3d0a67){_0x3d0a67=_0x3d0a67||0xc8;return function(_0x47635a){if(_0x47635a){return _0x3b5af6['status'](_0x3d0a67)[_0x7429('0x19')](_0x47635a);}};}function respondWithFilteredResult(_0x26afce,_0x257af9){return function(_0x4a014b){if(_0x4a014b){var _0x52d54c=_0x4a014b[_0x7429('0x1a')],_0x504993=_0x257af9[_0x7429('0x1b')],_0x2635ad=_0x257af9['offset']+_0x257af9[_0x7429('0x1c')],_0x445f01;if(_0x2635ad>=_0x52d54c){_0x2635ad=_0x52d54c;_0x445f01=0xc8;}else{_0x445f01=0xce;}_0x26afce[_0x7429('0x1d')](_0x445f01);return _0x26afce[_0x7429('0x1e')]('Content-Range',_0x504993+'-'+_0x2635ad+'/'+_0x52d54c)[_0x7429('0x19')](_0x4a014b);}return null;};}function patchUpdates(_0x25429e){return function(_0x2a204f){try{jsonpatch[_0x7429('0x1f')](_0x2a204f,_0x25429e,!![]);}catch(_0x4e6f14){return BPromise['reject'](_0x4e6f14);}return _0x2a204f['save']();};}function saveUpdates(_0x12f493,_0x249c9f){return function(_0x145f95){if(_0x145f95){return _0x145f95[_0x7429('0x20')](_0x12f493)[_0x7429('0x21')](function(_0x18d996){return _0x18d996;});}return null;};}function removeEntity(_0x5719f3,_0x21cb93){return function(_0x2ea036){if(_0x2ea036){return _0x2ea036['destroy']()[_0x7429('0x21')](function(){var _0x97ffca=_0x2ea036[_0x7429('0x22')]({'plain':!![]});var _0x216dbd=_0x7429('0x23');return db[_0x7429('0x24')][_0x7429('0x25')]({'where':{'type':_0x216dbd,'resourceId':_0x97ffca['id']}})[_0x7429('0x21')](function(){return _0x2ea036;});})[_0x7429('0x21')](function(){_0x5719f3[_0x7429('0x1d')](0xcc)[_0x7429('0x18')]();});}};}function handleEntityNotFound(_0x2665ca,_0x1d531b){return function(_0x428c6e){if(!_0x428c6e){_0x2665ca['sendStatus'](0x194);}return _0x428c6e;};}function handleError(_0x19088b,_0x29b644){_0x29b644=_0x29b644||0x1f4;return function(_0x17cff8){logger[_0x7429('0x26')](_0x17cff8[_0x7429('0x27')]);if(_0x17cff8['name']){delete _0x17cff8['name'];}_0x19088b[_0x7429('0x1d')](_0x29b644)[_0x7429('0x28')](_0x17cff8);};}exports[_0x7429('0x29')]=function(_0x5267b3,_0x19ff6f){var _0xc3d1aa={},_0xed0d44={},_0x571700={'count':0x0,'rows':[]};var _0x3d3fb1=_['map'](db[_0x7429('0x2a')][_0x7429('0x2b')],function(_0x31bd51){return{'name':_0x31bd51[_0x7429('0x2c')],'type':_0x31bd51['type'][_0x7429('0x2d')]};});_0xed0d44[_0x7429('0x2e')]=_[_0x7429('0x2f')](_0x3d3fb1,_0x7429('0x30'));_0xed0d44['query']=_[_0x7429('0x31')](_0x5267b3[_0x7429('0x32')]);_0xed0d44[_0x7429('0x33')]=_[_0x7429('0x34')](_0xed0d44[_0x7429('0x2e')],_0xed0d44['query']);_0xc3d1aa['attributes']=_[_0x7429('0x34')](_0xed0d44[_0x7429('0x2e')],qs['fields'](_0x5267b3['query'][_0x7429('0x35')]));_0xc3d1aa['attributes']=_0xc3d1aa[_0x7429('0x36')][_0x7429('0x37')]?_0xc3d1aa[_0x7429('0x36')]:_0xed0d44['model'];if(!_0x5267b3[_0x7429('0x32')][_0x7429('0x38')]('nolimit')){_0xc3d1aa[_0x7429('0x1c')]=qs[_0x7429('0x1c')](_0x5267b3[_0x7429('0x32')]['limit']);_0xc3d1aa[_0x7429('0x1b')]=qs[_0x7429('0x1b')](_0x5267b3[_0x7429('0x32')][_0x7429('0x1b')]);}_0xc3d1aa['order']=qs['sort'](_0x5267b3[_0x7429('0x32')]['sort']);_0xc3d1aa[_0x7429('0x39')]=qs['filters'](_[_0x7429('0x3a')](_0x5267b3[_0x7429('0x32')],_0xed0d44[_0x7429('0x33')]),_0x3d3fb1);if(_0x5267b3[_0x7429('0x32')][_0x7429('0x3b')]){_0xc3d1aa[_0x7429('0x39')]=_[_0x7429('0x3c')](_0xc3d1aa[_0x7429('0x39')],{'$or':_[_0x7429('0x2f')](_0x3d3fb1,function(_0x2d38c3){if(_0x2d38c3[_0x7429('0x3d')]!==_0x7429('0x3e')){var _0x43e644={};_0x43e644[_0x2d38c3[_0x7429('0x30')]]={'$like':'%'+_0x5267b3[_0x7429('0x32')][_0x7429('0x3b')]+'%'};return _0x43e644;}})});}_0xc3d1aa=_[_0x7429('0x3c')]({},_0xc3d1aa,_0x5267b3['options']);var _0x337dc4={'where':_0xc3d1aa['where']};return db['Campaign'][_0x7429('0x1a')](_0x337dc4)[_0x7429('0x21')](function(_0x797808){_0x571700[_0x7429('0x1a')]=_0x797808;if(_0x5267b3[_0x7429('0x32')][_0x7429('0x3f')]){_0xc3d1aa[_0x7429('0x40')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0xc3d1aa);})[_0x7429('0x21')](function(_0x189877){_0x571700[_0x7429('0x41')]=_0x189877;return _0x571700;})['then'](respondWithFilteredResult(_0x19ff6f,_0xc3d1aa))[_0x7429('0x42')](handleError(_0x19ff6f,null));};exports[_0x7429('0x43')]=function(_0x6d7b73,_0x4ab76c){var _0x17b8f9={'raw':![],'where':{'id':_0x6d7b73['params']['id']}},_0x48989e={};_0x48989e[_0x7429('0x2e')]=_[_0x7429('0x31')](db[_0x7429('0x2a')]['rawAttributes']);_0x48989e[_0x7429('0x32')]=_[_0x7429('0x31')](_0x6d7b73['query']);_0x48989e[_0x7429('0x33')]=_[_0x7429('0x34')](_0x48989e[_0x7429('0x2e')],_0x48989e['query']);_0x17b8f9[_0x7429('0x36')]=_['intersection'](_0x48989e['model'],qs[_0x7429('0x35')](_0x6d7b73[_0x7429('0x32')][_0x7429('0x35')]));_0x17b8f9[_0x7429('0x36')]=_0x17b8f9[_0x7429('0x36')][_0x7429('0x37')]?_0x17b8f9['attributes']:_0x48989e[_0x7429('0x2e')];if(_0x6d7b73[_0x7429('0x32')][_0x7429('0x3f')]){_0x17b8f9[_0x7429('0x40')]=[{'all':!![]}];}_0x17b8f9=_[_0x7429('0x3c')]({},_0x17b8f9,_0x6d7b73['options']);return db['Campaign'][_0x7429('0x44')](_0x17b8f9)['then'](handleEntityNotFound(_0x4ab76c,null))['then'](respondWithResult(_0x4ab76c,null))[_0x7429('0x42')](handleError(_0x4ab76c,null));};exports[_0x7429('0x45')]=function(_0x1adff6,_0x3f1765){return db[_0x7429('0x2a')][_0x7429('0x45')](_0x1adff6[_0x7429('0x46')],{})[_0x7429('0x21')](function(_0x79869e){var _0x3f8ba2=_0x1adff6['user'][_0x7429('0x22')]({'plain':!![]});if(!_0x3f8ba2)throw new Error(_0x7429('0x47'));if(_0x3f8ba2['role']===_0x7429('0x48')){var _0xca7c25=_0x79869e[_0x7429('0x22')]({'plain':!![]});var _0x4ebeca=_0x7429('0x23');return db[_0x7429('0x49')][_0x7429('0x44')]({'where':{'name':_0x4ebeca,'userProfileId':_0x3f8ba2[_0x7429('0x4a')]},'raw':!![]})[_0x7429('0x21')](function(_0x41d57f){if(_0x41d57f&&_0x41d57f[_0x7429('0x4b')]===0x0){return db[_0x7429('0x24')][_0x7429('0x45')]({'name':_0xca7c25[_0x7429('0x30')],'resourceId':_0xca7c25['id'],'type':_0x41d57f[_0x7429('0x30')],'sectionId':_0x41d57f['id']},{})['then'](function(){return _0x79869e;});}else{return _0x79869e;}})[_0x7429('0x42')](function(_0x337bb8){logger['error'](_0x7429('0x4c'),_0x337bb8);throw _0x337bb8;});}return _0x79869e;})[_0x7429('0x21')](respondWithResult(_0x3f1765,0xc9))[_0x7429('0x42')](handleError(_0x3f1765,null));};exports['clone']=function(_0x53f490,_0x288383){var _0x25b17b={'where':{'id':_0x53f490[_0x7429('0x4d')]['id']}},_0x545c80={};_0x545c80[_0x7429('0x2e')]=_[_0x7429('0x31')](db[_0x7429('0x2a')][_0x7429('0x2b')]);_0x25b17b[_0x7429('0x36')]=_[_0x7429('0x34')](_0x545c80['model'],qs['fields'](_0x53f490['query']['fields']));_0x25b17b[_0x7429('0x36')]=_0x25b17b[_0x7429('0x36')][_0x7429('0x37')]?_0x25b17b['attributes']:_0x545c80['model'];if(_0x53f490[_0x7429('0x32')]['includeAll']){_0x25b17b[_0x7429('0x40')]=[{'all':!![]}];}_0x25b17b=_[_0x7429('0x3c')]({},_0x25b17b,_0x53f490['options']);return db[_0x7429('0x2a')][_0x7429('0x44')](_0x25b17b)[_0x7429('0x21')](handleEntityNotFound(_0x288383,null))['then'](function(_0x35c71a){if(_0x35c71a){var _0x1439f5=_0x35c71a[_0x7429('0x22')]({'plain':!![]});_0x1439f5=qs[_0x7429('0x4e')](_0x1439f5,['id',_0x7429('0x4f'),_0x7429('0x50')]);_0x53f490[_0x7429('0x46')]=_['omit'](_0x53f490[_0x7429('0x46')],['id','createdAt','updatedAt']);return db['Campaign'][_0x7429('0x45')](_[_0x7429('0x3c')](_0x1439f5,_0x53f490[_0x7429('0x46')]),{'include':_0x53f490[_0x7429('0x32')][_0x7429('0x3f')]?[{'all':!![]}]:undefined})[_0x7429('0x21')](function(_0xf26c16){var _0x45cdc4=_0x53f490[_0x7429('0x48')][_0x7429('0x22')]({'plain':!![]});if(!_0x45cdc4)throw new Error(_0x7429('0x47'));if(_0x45cdc4[_0x7429('0x51')]===_0x7429('0x48')){var _0xcd53dc=_0xf26c16['get']({'plain':!![]});var _0x4d470c=_0x7429('0x23');return db[_0x7429('0x49')]['find']({'where':{'name':_0x4d470c,'userProfileId':_0x45cdc4[_0x7429('0x4a')]},'raw':!![]})[_0x7429('0x21')](function(_0x303b2d){if(_0x303b2d&&_0x303b2d[_0x7429('0x4b')]===0x0){return db['UserProfileResource'][_0x7429('0x45')]({'name':_0xcd53dc[_0x7429('0x30')],'resourceId':_0xcd53dc['id'],'type':_0x303b2d[_0x7429('0x30')],'sectionId':_0x303b2d['id']},{})['then'](function(){return _0xf26c16;});}else{return _0xf26c16;}})['catch'](function(_0x34d177){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34d177);throw _0x34d177;});}return _0xf26c16;});}})[_0x7429('0x21')](respondWithResult(_0x288383,0xc9))[_0x7429('0x42')](handleError(_0x288383,null));};exports[_0x7429('0x20')]=function(_0x9bf10f,_0x3ddccb){if(_0x9bf10f[_0x7429('0x46')]['id']){delete _0x9bf10f[_0x7429('0x46')]['id'];}return db[_0x7429('0x2a')][_0x7429('0x44')]({'where':{'id':_0x9bf10f[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x3ddccb,null))[_0x7429('0x21')](saveUpdates(_0x9bf10f['body'],null))[_0x7429('0x21')](respondWithResult(_0x3ddccb,null))[_0x7429('0x42')](handleError(_0x3ddccb,null));};exports[_0x7429('0x25')]=function(_0x478ff8,_0x10f918){return db[_0x7429('0x2a')][_0x7429('0x44')]({'where':{'id':_0x478ff8[_0x7429('0x4d')]['id']}})['then'](handleEntityNotFound(_0x10f918,null))[_0x7429('0x21')](removeEntity(_0x10f918,null))['catch'](handleError(_0x10f918,null));};exports[_0x7429('0x52')]=function(_0x36680d,_0x2c9924,_0x6f93c9){var _0xc1cf4c={'raw':!![],'where':{}};var _0x2c9da3={};var _0x5d1b0d={'count':0x0,'rows':[]};return db[_0x7429('0x2a')][_0x7429('0x53')]({'where':{'id':_0x36680d['params']['id']}})['then'](handleEntityNotFound(_0x2c9924,null))['then'](function(_0x2880f9){if(_0x2880f9){_0x2c9da3[_0x7429('0x2e')]=_['keys'](db[_0x7429('0x54')]['rawAttributes']);_0x2c9da3[_0x7429('0x32')]=_[_0x7429('0x31')](_0x36680d[_0x7429('0x32')]);_0x2c9da3[_0x7429('0x33')]=_['intersection'](_0x2c9da3['model'],_0x2c9da3[_0x7429('0x32')]);_0xc1cf4c[_0x7429('0x36')]=_[_0x7429('0x34')](_0x2c9da3['model'],qs[_0x7429('0x35')](_0x36680d[_0x7429('0x32')][_0x7429('0x35')]));_0xc1cf4c[_0x7429('0x36')]=_0xc1cf4c[_0x7429('0x36')][_0x7429('0x37')]?_0xc1cf4c[_0x7429('0x36')]:_0x2c9da3[_0x7429('0x2e')];if(!_0x36680d['query']['hasOwnProperty']('nolimit')){_0xc1cf4c['limit']=qs['limit'](_0x36680d[_0x7429('0x32')][_0x7429('0x1c')]);_0xc1cf4c[_0x7429('0x1b')]=qs['offset'](_0x36680d[_0x7429('0x32')][_0x7429('0x1b')]);}_0xc1cf4c[_0x7429('0x55')]=qs['sort'](_0x36680d[_0x7429('0x32')][_0x7429('0x56')]);_0xc1cf4c[_0x7429('0x39')]=qs[_0x7429('0x33')](_[_0x7429('0x3a')](_0x36680d[_0x7429('0x32')],_0x2c9da3[_0x7429('0x33')]));_0xc1cf4c[_0x7429('0x39')][_0x7429('0x57')]=_0x2880f9['id'];if(_0x36680d[_0x7429('0x32')][_0x7429('0x3b')]){_0xc1cf4c[_0x7429('0x39')]=_[_0x7429('0x3c')](_0xc1cf4c[_0x7429('0x39')],{'$or':_[_0x7429('0x2f')](_0xc1cf4c[_0x7429('0x36')],function(_0x2524f9){var _0x4f845b={};_0x4f845b[_0x2524f9]={'$like':'%'+_0x36680d[_0x7429('0x32')][_0x7429('0x3b')]+'%'};return _0x4f845b;})});}_0xc1cf4c=_['merge']({},_0xc1cf4c,_0x36680d[_0x7429('0x58')]);return db[_0x7429('0x54')][_0x7429('0x1a')]({'where':_0xc1cf4c[_0x7429('0x39')]})[_0x7429('0x21')](function(_0x2c8739){_0x5d1b0d[_0x7429('0x1a')]=_0x2c8739;if(_0x36680d[_0x7429('0x32')][_0x7429('0x3f')]){_0xc1cf4c['include']=[{'all':!![]}];}return db[_0x7429('0x54')][_0x7429('0x59')](_0xc1cf4c);})[_0x7429('0x21')](function(_0xc28aac){_0x5d1b0d[_0x7429('0x41')]=_0xc28aac;return _0x5d1b0d;});}})['then'](respondWithFilteredResult(_0x2c9924,_0xc1cf4c))[_0x7429('0x42')](handleError(_0x2c9924,null));};exports[_0x7429('0x5a')]=function(_0x3dfaa5,_0x2cdb6f,_0x3c1974){var _0x452f2b={'raw':!![],'where':{}};var _0x2d2cbf={};var _0x2fd13c={'count':0x0,'rows':[]};return db[_0x7429('0x2a')][_0x7429('0x53')]({'where':{'id':_0x3dfaa5[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x2cdb6f,null))[_0x7429('0x21')](function(_0x42b77f){if(_0x42b77f){_0x2d2cbf[_0x7429('0x2e')]=_[_0x7429('0x31')](db['CmHopperHistory'][_0x7429('0x2b')]);_0x2d2cbf[_0x7429('0x32')]=_[_0x7429('0x31')](_0x3dfaa5[_0x7429('0x32')]);_0x2d2cbf[_0x7429('0x33')]=_['intersection'](_0x2d2cbf[_0x7429('0x2e')],_0x2d2cbf['query']);_0x452f2b[_0x7429('0x36')]=_[_0x7429('0x34')](_0x2d2cbf[_0x7429('0x2e')],qs[_0x7429('0x35')](_0x3dfaa5['query']['fields']));_0x452f2b[_0x7429('0x36')]=_0x452f2b['attributes'][_0x7429('0x37')]?_0x452f2b[_0x7429('0x36')]:_0x2d2cbf[_0x7429('0x2e')];if(!_0x3dfaa5['query']['hasOwnProperty'](_0x7429('0x5b'))){_0x452f2b[_0x7429('0x1c')]=qs[_0x7429('0x1c')](_0x3dfaa5[_0x7429('0x32')]['limit']);_0x452f2b[_0x7429('0x1b')]=qs[_0x7429('0x1b')](_0x3dfaa5[_0x7429('0x32')][_0x7429('0x1b')]);}_0x452f2b[_0x7429('0x55')]=qs[_0x7429('0x56')](_0x3dfaa5['query'][_0x7429('0x56')]);_0x452f2b['where']=qs[_0x7429('0x33')](_[_0x7429('0x3a')](_0x3dfaa5['query'],_0x2d2cbf[_0x7429('0x33')]));_0x452f2b[_0x7429('0x39')][_0x7429('0x57')]=_0x42b77f['id'];if(_0x3dfaa5[_0x7429('0x32')]['filter']){_0x452f2b[_0x7429('0x39')]=_[_0x7429('0x3c')](_0x452f2b[_0x7429('0x39')],{'$or':_[_0x7429('0x2f')](_0x452f2b['attributes'],function(_0x5a8754){var _0x11dfca={};_0x11dfca[_0x5a8754]={'$like':'%'+_0x3dfaa5['query'][_0x7429('0x3b')]+'%'};return _0x11dfca;})});}_0x452f2b=_[_0x7429('0x3c')]({},_0x452f2b,_0x3dfaa5['options']);return db[_0x7429('0x5c')]['count']({'where':_0x452f2b[_0x7429('0x39')]})['then'](function(_0x4118f5){_0x2fd13c[_0x7429('0x1a')]=_0x4118f5;if(_0x3dfaa5[_0x7429('0x32')]['includeAll']){_0x452f2b[_0x7429('0x40')]=[{'all':!![]}];}return db[_0x7429('0x5c')][_0x7429('0x59')](_0x452f2b);})[_0x7429('0x21')](function(_0x169e85){_0x2fd13c[_0x7429('0x41')]=_0x169e85;return _0x2fd13c;});}})['then'](respondWithFilteredResult(_0x2cdb6f,_0x452f2b))[_0x7429('0x42')](handleError(_0x2cdb6f,null));};exports[_0x7429('0x5d')]=function(_0x59a08c,_0x5a6752,_0x1c1bba){var _0x4fc0e6={'raw':!![],'where':{}};var _0x463380={};var _0x1eb012={'count':0x0,'rows':[]};return db[_0x7429('0x2a')][_0x7429('0x53')]({'where':{'id':_0x59a08c[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x5a6752,null))[_0x7429('0x21')](function(_0x195c94){if(_0x195c94){_0x463380['model']=_['keys'](db[_0x7429('0x5e')][_0x7429('0x2b')]);_0x463380[_0x7429('0x32')]=_[_0x7429('0x31')](_0x59a08c[_0x7429('0x32')]);_0x463380[_0x7429('0x33')]=_[_0x7429('0x34')](_0x463380[_0x7429('0x2e')],_0x463380[_0x7429('0x32')]);_0x4fc0e6[_0x7429('0x36')]=_[_0x7429('0x34')](_0x463380[_0x7429('0x2e')],qs[_0x7429('0x35')](_0x59a08c[_0x7429('0x32')][_0x7429('0x35')]));_0x4fc0e6['attributes']=_0x4fc0e6['attributes'][_0x7429('0x37')]?_0x4fc0e6[_0x7429('0x36')]:_0x463380[_0x7429('0x2e')];if(!_0x59a08c['query'][_0x7429('0x38')]('nolimit')){_0x4fc0e6['limit']=qs[_0x7429('0x1c')](_0x59a08c['query'][_0x7429('0x1c')]);_0x4fc0e6['offset']=qs['offset'](_0x59a08c[_0x7429('0x32')][_0x7429('0x1b')]);}_0x4fc0e6[_0x7429('0x55')]=qs['sort'](_0x59a08c[_0x7429('0x32')]['sort']);_0x4fc0e6[_0x7429('0x39')]=qs['filters'](_[_0x7429('0x3a')](_0x59a08c['query'],_0x463380[_0x7429('0x33')]));_0x4fc0e6[_0x7429('0x39')][_0x7429('0x57')]=_0x195c94['id'];if(_0x59a08c['query'][_0x7429('0x3b')]){_0x4fc0e6['where']=_['merge'](_0x4fc0e6[_0x7429('0x39')],{'$or':_['map'](_0x4fc0e6['attributes'],function(_0x2413a0){var _0x578875={};_0x578875[_0x2413a0]={'$like':'%'+_0x59a08c['query']['filter']+'%'};return _0x578875;})});}_0x4fc0e6=_[_0x7429('0x3c')]({},_0x4fc0e6,_0x59a08c[_0x7429('0x58')]);return db[_0x7429('0x5e')]['count']({'where':_0x4fc0e6[_0x7429('0x39')]})['then'](function(_0x17bb05){_0x1eb012[_0x7429('0x1a')]=_0x17bb05;if(_0x59a08c[_0x7429('0x32')]['includeAll']){_0x4fc0e6[_0x7429('0x40')]=[{'all':!![]}];}return db[_0x7429('0x5e')]['findAll'](_0x4fc0e6);})[_0x7429('0x21')](function(_0xe85db7){_0x1eb012[_0x7429('0x41')]=_0xe85db7;return _0x1eb012;});}})['then'](respondWithFilteredResult(_0x5a6752,_0x4fc0e6))[_0x7429('0x42')](handleError(_0x5a6752,null));};exports[_0x7429('0x5f')]=function(_0x4323d7,_0x4d376f,_0x2d2193){var _0x58e96a={'raw':!![],'where':{}};var _0xec5dd9={};var _0x2b441c={'count':0x0,'rows':[]};return db['Campaign'][_0x7429('0x53')]({'where':{'id':_0x4323d7[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x4d376f,null))['then'](function(_0x450a16){if(_0x450a16){_0xec5dd9[_0x7429('0x2e')]=_[_0x7429('0x31')](db[_0x7429('0x60')][_0x7429('0x2b')]);_0xec5dd9['query']=_[_0x7429('0x31')](_0x4323d7['query']);_0xec5dd9['filters']=_[_0x7429('0x34')](_0xec5dd9[_0x7429('0x2e')],_0xec5dd9[_0x7429('0x32')]);_0x58e96a[_0x7429('0x36')]=_[_0x7429('0x34')](_0xec5dd9[_0x7429('0x2e')],qs[_0x7429('0x35')](_0x4323d7[_0x7429('0x32')][_0x7429('0x35')]));_0x58e96a[_0x7429('0x36')]=_0x58e96a[_0x7429('0x36')]['length']?_0x58e96a[_0x7429('0x36')]:_0xec5dd9[_0x7429('0x2e')];if(!_0x4323d7[_0x7429('0x32')]['hasOwnProperty']('nolimit')){_0x58e96a['limit']=qs[_0x7429('0x1c')](_0x4323d7[_0x7429('0x32')][_0x7429('0x1c')]);_0x58e96a[_0x7429('0x1b')]=qs[_0x7429('0x1b')](_0x4323d7[_0x7429('0x32')][_0x7429('0x1b')]);}_0x58e96a[_0x7429('0x55')]=qs[_0x7429('0x56')](_0x4323d7[_0x7429('0x32')][_0x7429('0x56')]);_0x58e96a[_0x7429('0x39')]=qs[_0x7429('0x33')](_[_0x7429('0x3a')](_0x4323d7[_0x7429('0x32')],_0xec5dd9[_0x7429('0x33')]));_0x58e96a['where']['CampaignId']=_0x450a16['id'];if(_0x4323d7[_0x7429('0x32')][_0x7429('0x3b')]){_0x58e96a[_0x7429('0x39')]=_['merge'](_0x58e96a[_0x7429('0x39')],{'$or':_[_0x7429('0x2f')](_0x58e96a[_0x7429('0x36')],function(_0x495f1d){var _0x435f6a={};_0x435f6a[_0x495f1d]={'$like':'%'+_0x4323d7[_0x7429('0x32')][_0x7429('0x3b')]+'%'};return _0x435f6a;})});}_0x58e96a=_[_0x7429('0x3c')]({},_0x58e96a,_0x4323d7[_0x7429('0x58')]);return db[_0x7429('0x60')][_0x7429('0x1a')]({'where':_0x58e96a[_0x7429('0x39')]})[_0x7429('0x21')](function(_0x115827){_0x2b441c[_0x7429('0x1a')]=_0x115827;if(_0x4323d7[_0x7429('0x32')][_0x7429('0x3f')]){_0x58e96a['include']=[{'all':!![]}];}return db[_0x7429('0x60')][_0x7429('0x59')](_0x58e96a);})[_0x7429('0x21')](function(_0x23e129){_0x2b441c['rows']=_0x23e129;return _0x2b441c;});}})[_0x7429('0x21')](respondWithFilteredResult(_0x4d376f,_0x58e96a))['catch'](handleError(_0x4d376f,null));};exports['getLists']=function(_0x1c878b,_0x5cc346,_0x5619b6){var _0x4222d5={};var _0xd83b05={};var _0x55a4a6;var _0x195e85;return db['Campaign'][_0x7429('0x53')]({'where':{'id':_0x1c878b['params']['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x5cc346,null))[_0x7429('0x21')](function(_0x1a9d71){if(_0x1a9d71){_0x55a4a6=_0x1a9d71;_0xd83b05[_0x7429('0x2e')]=_['keys'](db['CmList'][_0x7429('0x2b')]);_0xd83b05[_0x7429('0x32')]=_[_0x7429('0x31')](_0x1c878b[_0x7429('0x32')]);_0xd83b05[_0x7429('0x33')]=_[_0x7429('0x34')](_0xd83b05[_0x7429('0x2e')],_0xd83b05[_0x7429('0x32')]);_0x4222d5[_0x7429('0x36')]=_[_0x7429('0x34')](_0xd83b05[_0x7429('0x2e')],qs['fields'](_0x1c878b[_0x7429('0x32')][_0x7429('0x35')]));_0x4222d5[_0x7429('0x36')]=_0x4222d5['attributes'][_0x7429('0x37')]?_0x4222d5[_0x7429('0x36')]:_0xd83b05['model'];_0x4222d5[_0x7429('0x55')]=qs[_0x7429('0x56')](_0x1c878b[_0x7429('0x32')][_0x7429('0x56')]);_0x4222d5[_0x7429('0x39')]=qs[_0x7429('0x33')](_[_0x7429('0x3a')](_0x1c878b['query'],_0xd83b05[_0x7429('0x33')]));if(_0x1c878b[_0x7429('0x32')][_0x7429('0x3b')]){_0x4222d5[_0x7429('0x39')]=_['merge'](_0x4222d5[_0x7429('0x39')],{'$or':_[_0x7429('0x2f')](_0x4222d5[_0x7429('0x36')],function(_0x3376d9){var _0x123d8b={};_0x123d8b[_0x3376d9]={'$like':'%'+_0x1c878b[_0x7429('0x32')]['filter']+'%'};return _0x123d8b;})});}_0x4222d5=_[_0x7429('0x3c')]({},_0x4222d5,_0x1c878b['options']);return _0x55a4a6[_0x7429('0x61')](_0x4222d5);}})[_0x7429('0x21')](function(_0xf9e7f6){if(_0xf9e7f6){_0x195e85=_0xf9e7f6[_0x7429('0x37')];if(!_0x1c878b[_0x7429('0x32')][_0x7429('0x38')](_0x7429('0x5b'))){_0x4222d5['limit']=qs[_0x7429('0x1c')](_0x1c878b['query'][_0x7429('0x1c')]);_0x4222d5['offset']=qs[_0x7429('0x1b')](_0x1c878b[_0x7429('0x32')][_0x7429('0x1b')]);}return _0x55a4a6[_0x7429('0x61')](_0x4222d5);}})[_0x7429('0x21')](function(_0x445ee2){if(_0x445ee2){return _0x445ee2?{'count':_0x195e85,'rows':_0x445ee2}:null;}})[_0x7429('0x21')](respondWithResult(_0x5cc346,null))[_0x7429('0x42')](handleError(_0x5cc346,null));};exports[_0x7429('0x62')]=function(_0x15b10a,_0x494e54,_0x78a2d2){var _0x54cc84,_0x4c76b3;return db[_0x7429('0x2a')][_0x7429('0x44')]({'where':{'id':_0x15b10a[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x494e54,null))[_0x7429('0x21')](function(_0x2cb1ed){if(_0x2cb1ed){_0x4c76b3=_0x2cb1ed;return _0x2cb1ed['addLists'](_0x15b10a[_0x7429('0x46')][_0x7429('0x63')],_[_0x7429('0x4e')](_0x15b10a[_0x7429('0x46')],[_0x7429('0x63'),'id'])||{});}return null;})[_0x7429('0x64')](function(_0x1a7fed){var _0x370fcc;_0x54cc84=_0x1a7fed||[];var _0x45e338=[];if(_0x1a7fed){for(var _0x1b85a9=0x0;_0x1b85a9<_0x1a7fed['length'];_0x1b85a9+=0x1){var _0x46f9a3=_0x1a7fed[_0x1b85a9]['get']({'plain':!![]});_0x4c76b3[_0x7429('0x65')]=_0x15b10a['body'][_0x7429('0x65')]?_0x15b10a[_0x7429('0x46')]['dialCheckDuplicateType']:_0x4c76b3[_0x7429('0x65')];switch(_0x4c76b3[_0x7429('0x65')]){case _0x7429('0x66'):_0x370fcc=squel[_0x7429('0x67')]()[_0x7429('0x68')](_0x7429('0x69'))['fromQuery']([_0x7429('0x6a'),'scheduledAt',_0x7429('0x6b'),'ListId','CampaignId',_0x7429('0x4f'),_0x7429('0x50')],squel[_0x7429('0x6c')]()[_0x7429('0x6d')](_0x7429('0x6a'),_0x7429('0x6a'))['field'](_0x7429('0x6e'),_0x7429('0x6f'))[_0x7429('0x6d')]('id',_0x7429('0x6b'))['field'](_0x46f9a3[_0x7429('0x70')][_0x7429('0x71')](),'ListId')['field'](_0x15b10a['params']['id'][_0x7429('0x71')](),_0x7429('0x57'))[_0x7429('0x6d')]('NOW()',_0x7429('0x4f'))[_0x7429('0x6d')]('NOW()',_0x7429('0x50'))['from']('cm_contacts')['where'](_0x7429('0x72'))[_0x7429('0x39')](_0x7429('0x73'),_0x46f9a3[_0x7429('0x70')][_0x7429('0x71')]())[_0x7429('0x39')](_0x7429('0x74'))[_0x7429('0x39')](_0x7429('0x75'),squel[_0x7429('0x6c')]()[_0x7429('0x6d')]('COALESCE(calleridnum,\x27\x27)')[_0x7429('0x76')]('cm_hopper_final')[_0x7429('0x39')]('CampaignId\x20=\x20?',_0x15b10a[_0x7429('0x4d')]['id'][_0x7429('0x71')]()))[_0x7429('0x39')](_0x7429('0x75'),squel[_0x7429('0x6c')]()[_0x7429('0x6d')](_0x7429('0x77'))[_0x7429('0x76')]('cm_hopper')[_0x7429('0x39')](_0x7429('0x78'),_0x15b10a[_0x7429('0x4d')]['id'][_0x7429('0x71')]())))[_0x7429('0x71')]();break;case _0x7429('0x79'):_0x370fcc=squel[_0x7429('0x67')]()['into'](_0x7429('0x69'))[_0x7429('0x7a')]([_0x7429('0x6a'),_0x7429('0x6f'),'ContactId','ListId',_0x7429('0x57'),_0x7429('0x4f'),_0x7429('0x50')],squel[_0x7429('0x6c')]()['field'](_0x7429('0x6a'),_0x7429('0x6a'))[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x6f'))[_0x7429('0x6d')]('id',_0x7429('0x6b'))[_0x7429('0x6d')](_0x46f9a3[_0x7429('0x70')][_0x7429('0x71')](),_0x7429('0x7b'))[_0x7429('0x6d')](_0x15b10a[_0x7429('0x4d')]['id'][_0x7429('0x71')](),_0x7429('0x57'))['field']('NOW()',_0x7429('0x4f'))[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x50'))['from']('cm_contacts')[_0x7429('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x7429('0x73'),_0x46f9a3[_0x7429('0x70')][_0x7429('0x71')]())[_0x7429('0x39')](_0x7429('0x74'))[_0x7429('0x39')](_0x7429('0x75'),squel[_0x7429('0x6c')]()[_0x7429('0x6d')](_0x7429('0x77'))['from']('cm_hopper')[_0x7429('0x39')]('CampaignId\x20=\x20?',_0x15b10a[_0x7429('0x4d')]['id'][_0x7429('0x71')]())))[_0x7429('0x71')]();break;default:_0x370fcc=squel[_0x7429('0x67')]()['into'](_0x7429('0x69'))[_0x7429('0x7a')]([_0x7429('0x6a'),_0x7429('0x6f'),_0x7429('0x6b'),'ListId',_0x7429('0x57'),_0x7429('0x4f'),_0x7429('0x50')],squel[_0x7429('0x6c')]()['field'](_0x7429('0x6a'),'phone')[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x6f'))[_0x7429('0x6d')]('id',_0x7429('0x6b'))[_0x7429('0x6d')](_0x46f9a3['CmListId'][_0x7429('0x71')](),_0x7429('0x7b'))[_0x7429('0x6d')](_0x15b10a[_0x7429('0x4d')]['id'][_0x7429('0x71')](),'CampaignId')[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x4f'))[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x50'))[_0x7429('0x76')]('cm_contacts')[_0x7429('0x39')](_0x7429('0x72'))[_0x7429('0x39')]('ListId\x20=\x20?',_0x46f9a3[_0x7429('0x70')][_0x7429('0x71')]())[_0x7429('0x39')](_0x7429('0x74')))[_0x7429('0x71')]();}_0x45e338[_0x7429('0x7c')](db['sequelize']['query'](_0x370fcc));}return BPromise[_0x7429('0x7d')](_0x45e338);}})[_0x7429('0x21')](function(){return _0x54cc84;})['then'](respondWithResult(_0x494e54,null))['catch'](handleError(_0x494e54,null));};exports['removeLists']=function(_0x5052be,_0x7a56f3,_0xa46f20){return db[_0x7429('0x2a')][_0x7429('0x44')]({'where':{'id':_0x5052be['params']['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x7a56f3,null))['then'](function(_0x2b873c){if(_0x2b873c){return _0x2b873c['removeLists'](_0x5052be[_0x7429('0x32')][_0x7429('0x63')]);}})[_0x7429('0x21')](function(_0x4a87fe){if(_0x4a87fe){return db[_0x7429('0x54')][_0x7429('0x25')]({'where':{'ListId':_0x5052be[_0x7429('0x32')][_0x7429('0x63')],'CampaignId':_0x5052be[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](function(){return _0x4a87fe;});}})[_0x7429('0x21')](respondWithStatusCode(_0x7a56f3,null))[_0x7429('0x42')](handleError(_0x7a56f3,null));};exports['getBlackLists']=function(_0x16fa59,_0x379685,_0x54605f){var _0x5d0b4b={'raw':!![],'where':{}};var _0x334845={};var _0x46ce88={'count':0x0,'rows':[]};return db[_0x7429('0x2a')][_0x7429('0x53')]({'where':{'id':_0x16fa59[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x379685,null))['then'](function(_0x478227){if(_0x478227){_0x334845[_0x7429('0x2e')]=_[_0x7429('0x31')](db[_0x7429('0x7e')][_0x7429('0x2b')]);_0x334845['query']=_[_0x7429('0x31')](_0x16fa59['query']);_0x334845[_0x7429('0x33')]=_['intersection'](_0x334845[_0x7429('0x2e')],_0x334845[_0x7429('0x32')]);_0x5d0b4b[_0x7429('0x36')]=_['intersection'](_0x334845[_0x7429('0x2e')],qs[_0x7429('0x35')](_0x16fa59[_0x7429('0x32')]['fields']));_0x5d0b4b['attributes']=_0x5d0b4b[_0x7429('0x36')]['length']?_0x5d0b4b['attributes']:_0x334845['model'];if(!_0x16fa59[_0x7429('0x32')][_0x7429('0x38')](_0x7429('0x5b'))){_0x5d0b4b[_0x7429('0x1c')]=qs[_0x7429('0x1c')](_0x16fa59['query'][_0x7429('0x1c')]);_0x5d0b4b[_0x7429('0x1b')]=qs['offset'](_0x16fa59[_0x7429('0x32')]['offset']);}_0x5d0b4b['order']=qs[_0x7429('0x56')](_0x16fa59[_0x7429('0x32')]['sort']);_0x5d0b4b[_0x7429('0x39')]=qs['filters'](_[_0x7429('0x3a')](_0x16fa59['query'],_0x334845[_0x7429('0x33')]));_0x5d0b4b['where']['CampaignId']=_0x478227['id'];if(_0x16fa59['query']['filter']){_0x5d0b4b[_0x7429('0x39')]=_['merge'](_0x5d0b4b[_0x7429('0x39')],{'$or':_['map'](_0x5d0b4b[_0x7429('0x36')],function(_0x29d074){var _0x42a079={};_0x42a079[_0x29d074]={'$like':'%'+_0x16fa59['query'][_0x7429('0x3b')]+'%'};return _0x42a079;})});}_0x5d0b4b=_['merge']({},_0x5d0b4b,_0x16fa59[_0x7429('0x58')]);return db[_0x7429('0x7e')]['count']({'where':_0x5d0b4b[_0x7429('0x39')]})['then'](function(_0x9fea3f){_0x46ce88[_0x7429('0x1a')]=_0x9fea3f;if(_0x16fa59[_0x7429('0x32')]['includeAll']){_0x5d0b4b[_0x7429('0x40')]=[{'all':!![]}];}return db['CmList'][_0x7429('0x59')](_0x5d0b4b);})['then'](function(_0x30c7cc){_0x46ce88[_0x7429('0x41')]=_0x30c7cc;return _0x46ce88;});}})['then'](respondWithFilteredResult(_0x379685,_0x5d0b4b))[_0x7429('0x42')](handleError(_0x379685,null));};exports[_0x7429('0x7f')]=function(_0x533051,_0x3d103d,_0x20494b){var _0x372bff,_0x339635;return db[_0x7429('0x2a')][_0x7429('0x44')]({'where':{'id':_0x533051[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](handleEntityNotFound(_0x3d103d,null))[_0x7429('0x21')](function(_0x35b646){if(_0x35b646){_0x339635=_0x35b646;return _0x35b646[_0x7429('0x7f')](_0x533051[_0x7429('0x46')][_0x7429('0x63')],_[_0x7429('0x4e')](_0x533051[_0x7429('0x46')],[_0x7429('0x63'),'id'])||{});}return null;})[_0x7429('0x64')](function(_0x5ca611){var _0x53679a;_0x372bff=_0x5ca611||[];var _0x1a716b=[];if(_0x5ca611){for(var _0x28bb04=0x0;_0x28bb04<_0x5ca611['length'];_0x28bb04+=0x1){var _0x507383=_0x5ca611[_0x28bb04][_0x7429('0x22')]({'plain':!![]});_0x53679a=squel['insert']()[_0x7429('0x68')](_0x7429('0x80'))['fromQuery'](['phone',_0x7429('0x6b'),'ListId',_0x7429('0x57'),_0x7429('0x4f'),_0x7429('0x50')],squel[_0x7429('0x6c')]()[_0x7429('0x6d')](_0x7429('0x6a'),_0x7429('0x6a'))[_0x7429('0x6d')]('id',_0x7429('0x6b'))['field'](_0x507383[_0x7429('0x70')][_0x7429('0x71')](),'ListId')[_0x7429('0x6d')](_0x533051[_0x7429('0x4d')]['id'][_0x7429('0x71')](),_0x7429('0x57'))[_0x7429('0x6d')](_0x7429('0x6e'),_0x7429('0x4f'))[_0x7429('0x6d')]('NOW()',_0x7429('0x50'))[_0x7429('0x76')]('cm_contacts')[_0x7429('0x39')]('deletedAt\x20IS\x20NULL')[_0x7429('0x39')](_0x7429('0x73'),_0x507383[_0x7429('0x70')][_0x7429('0x71')]())['where'](_0x7429('0x74')))[_0x7429('0x71')]();_0x1a716b[_0x7429('0x7c')](db[_0x7429('0x81')][_0x7429('0x32')](_0x53679a));}return BPromise[_0x7429('0x7d')](_0x1a716b);}})[_0x7429('0x21')](function(){return _0x372bff;})['then'](respondWithResult(_0x3d103d,null))[_0x7429('0x42')](handleError(_0x3d103d,null));};exports[_0x7429('0x82')]=function(_0x58fb1d,_0x2bb3e2,_0x1cd0d5){return db[_0x7429('0x2a')]['find']({'where':{'id':_0x58fb1d['params']['id']}})['then'](handleEntityNotFound(_0x2bb3e2,null))['then'](function(_0x5c4b18){if(_0x5c4b18){return _0x5c4b18[_0x7429('0x82')](_0x58fb1d[_0x7429('0x32')][_0x7429('0x63')]);}})[_0x7429('0x21')](function(_0x2a7711){if(_0x2a7711){return db['CmHopperBlack'][_0x7429('0x25')]({'where':{'ListId':_0x58fb1d[_0x7429('0x32')][_0x7429('0x63')],'CampaignId':_0x58fb1d[_0x7429('0x4d')]['id']}})[_0x7429('0x21')](function(){return _0x2a7711;});}})['then'](respondWithStatusCode(_0x2bb3e2,null))[_0x7429('0x42')](handleError(_0x2bb3e2,null));}; \ No newline at end of file +var _0x9d1a=['createdAt','updatedAt','autoAssociation','getHoppers','CmHopper','nolimit','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x356ba8,_0x2b3e31){var _0x2f9af1=function(_0x1178d6){while(--_0x1178d6){_0x356ba8['push'](_0x356ba8['shift']());}};_0x2f9af1(++_0x2b3e31);}(_0x9d1a,0x13b));var _0xa9d1=function(_0x3a55a7,_0x1c2b0a){_0x3a55a7=_0x3a55a7-0x0;var _0x5caec0=_0x9d1a[_0x3a55a7];return _0x5caec0;};'use strict';var pdf=require(_0xa9d1('0x0'));var emlformat=require(_0xa9d1('0x1'));var rimraf=require(_0xa9d1('0x2'));var zipdir=require(_0xa9d1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9d1('0x4'));var moment=require(_0xa9d1('0x5'));var BPromise=require(_0xa9d1('0x6'));var Mustache=require(_0xa9d1('0x7'));var util=require(_0xa9d1('0x8'));var path=require(_0xa9d1('0x9'));var sox=require(_0xa9d1('0xa'));var csv=require(_0xa9d1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa9d1('0xc'));var crypto=require('crypto');var jsforce=require(_0xa9d1('0xd'));var deskjs=require(_0xa9d1('0xe'));var toCsv=require(_0xa9d1('0xb'));var querystring=require(_0xa9d1('0xf'));var Papa=require(_0xa9d1('0x10'));var Redis=require(_0xa9d1('0x11'));var authService=require(_0xa9d1('0x12'));var qs=require(_0xa9d1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa9d1('0x14'));var utils=require(_0xa9d1('0x15'));var config=require('../../config/environment');var db=require(_0xa9d1('0x16'))['db'];function respondWithStatusCode(_0x34b416,_0x21810a){_0x21810a=_0x21810a||0xcc;return function(_0x52ff84){if(_0x52ff84){return _0x34b416[_0xa9d1('0x17')](_0x21810a);}return _0x34b416[_0xa9d1('0x18')](_0x21810a)[_0xa9d1('0x19')]();};}function respondWithResult(_0x56d4bc,_0x58536f){_0x58536f=_0x58536f||0xc8;return function(_0x581a5a){if(_0x581a5a){return _0x56d4bc[_0xa9d1('0x18')](_0x58536f)[_0xa9d1('0x1a')](_0x581a5a);}};}function respondWithFilteredResult(_0x1b7bbb,_0x5b6703){return function(_0x3d2919){if(_0x3d2919){var _0x15eab7=_0x3d2919[_0xa9d1('0x1b')],_0x4a26af=_0x5b6703['offset'],_0x5298d9=_0x5b6703['offset']+_0x5b6703[_0xa9d1('0x1c')],_0x1e0eed;if(_0x5298d9>=_0x15eab7){_0x5298d9=_0x15eab7;_0x1e0eed=0xc8;}else{_0x1e0eed=0xce;}_0x1b7bbb[_0xa9d1('0x18')](_0x1e0eed);return _0x1b7bbb['set'](_0xa9d1('0x1d'),_0x4a26af+'-'+_0x5298d9+'/'+_0x15eab7)[_0xa9d1('0x1a')](_0x3d2919);}return null;};}function patchUpdates(_0x5a755c){return function(_0x2615b9){try{jsonpatch['apply'](_0x2615b9,_0x5a755c,!![]);}catch(_0x49b631){return BPromise['reject'](_0x49b631);}return _0x2615b9['save']();};}function saveUpdates(_0x311991,_0x4066eb){return function(_0x30541d){if(_0x30541d){return _0x30541d[_0xa9d1('0x1e')](_0x311991)['then'](function(_0x8e2a0b){return _0x8e2a0b;});}return null;};}function removeEntity(_0x18cc58,_0x3c967f){return function(_0x4bdeaf){if(_0x4bdeaf){return _0x4bdeaf[_0xa9d1('0x1f')]()[_0xa9d1('0x20')](function(){var _0x798eb3=_0x4bdeaf[_0xa9d1('0x21')]({'plain':!![]});var _0x2e5ae0=_0xa9d1('0x22');return db[_0xa9d1('0x23')][_0xa9d1('0x1f')]({'where':{'type':_0x2e5ae0,'resourceId':_0x798eb3['id']}})[_0xa9d1('0x20')](function(){return _0x4bdeaf;});})[_0xa9d1('0x20')](function(){_0x18cc58['status'](0xcc)[_0xa9d1('0x19')]();});}};}function handleEntityNotFound(_0xa5795c,_0x427749){return function(_0x5549bb){if(!_0x5549bb){_0xa5795c['sendStatus'](0x194);}return _0x5549bb;};}function handleError(_0x4e64b4,_0x30a4e7){_0x30a4e7=_0x30a4e7||0x1f4;return function(_0x20d68b){logger[_0xa9d1('0x24')](_0x20d68b[_0xa9d1('0x25')]);if(_0x20d68b[_0xa9d1('0x26')]){delete _0x20d68b[_0xa9d1('0x26')];}_0x4e64b4[_0xa9d1('0x18')](_0x30a4e7)['send'](_0x20d68b);};}exports[_0xa9d1('0x27')]=function(_0x2d86a3,_0xe34198){var _0x138599={},_0x561caf={},_0x325431={'count':0x0,'rows':[]};var _0x252e36=_[_0xa9d1('0x28')](db[_0xa9d1('0x29')][_0xa9d1('0x2a')],function(_0x3fe467){return{'name':_0x3fe467[_0xa9d1('0x2b')],'type':_0x3fe467[_0xa9d1('0x2c')][_0xa9d1('0x2d')]};});_0x561caf[_0xa9d1('0x2e')]=_['map'](_0x252e36,_0xa9d1('0x26'));_0x561caf[_0xa9d1('0x2f')]=_[_0xa9d1('0x30')](_0x2d86a3[_0xa9d1('0x2f')]);_0x561caf[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x561caf[_0xa9d1('0x2e')],_0x561caf['query']);_0x138599[_0xa9d1('0x33')]=_[_0xa9d1('0x32')](_0x561caf[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x2d86a3['query'][_0xa9d1('0x34')]));_0x138599['attributes']=_0x138599[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x138599['attributes']:_0x561caf['model'];if(!_0x2d86a3['query'][_0xa9d1('0x36')]('nolimit')){_0x138599[_0xa9d1('0x1c')]=qs[_0xa9d1('0x1c')](_0x2d86a3[_0xa9d1('0x2f')][_0xa9d1('0x1c')]);_0x138599[_0xa9d1('0x37')]=qs[_0xa9d1('0x37')](_0x2d86a3[_0xa9d1('0x2f')][_0xa9d1('0x37')]);}_0x138599[_0xa9d1('0x38')]=qs[_0xa9d1('0x39')](_0x2d86a3[_0xa9d1('0x2f')]['sort']);_0x138599[_0xa9d1('0x3a')]=qs['filters'](_[_0xa9d1('0x3b')](_0x2d86a3[_0xa9d1('0x2f')],_0x561caf['filters']),_0x252e36);if(_0x2d86a3['query']['filter']){_0x138599[_0xa9d1('0x3a')]=_[_0xa9d1('0x3c')](_0x138599[_0xa9d1('0x3a')],{'$or':_['map'](_0x252e36,function(_0xe38137){if(_0xe38137[_0xa9d1('0x2c')]!=='VIRTUAL'){var _0x3f8112={};_0x3f8112[_0xe38137[_0xa9d1('0x26')]]={'$like':'%'+_0x2d86a3[_0xa9d1('0x2f')][_0xa9d1('0x3d')]+'%'};return _0x3f8112;}})});}_0x138599=_[_0xa9d1('0x3c')]({},_0x138599,_0x2d86a3[_0xa9d1('0x3e')]);var _0x2af535={'where':_0x138599[_0xa9d1('0x3a')]};return db[_0xa9d1('0x29')]['count'](_0x2af535)['then'](function(_0x3ff8a8){_0x325431[_0xa9d1('0x1b')]=_0x3ff8a8;if(_0x2d86a3[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x138599[_0xa9d1('0x40')]=[{'all':!![]}];}return db[_0xa9d1('0x29')][_0xa9d1('0x41')](_0x138599);})[_0xa9d1('0x20')](function(_0x38fe39){_0x325431[_0xa9d1('0x42')]=_0x38fe39;return _0x325431;})[_0xa9d1('0x20')](respondWithFilteredResult(_0xe34198,_0x138599))['catch'](handleError(_0xe34198,null));};exports[_0xa9d1('0x43')]=function(_0x135d52,_0x33a3cd){var _0x42ad0d={'raw':![],'where':{'id':_0x135d52[_0xa9d1('0x44')]['id']}},_0x27c69e={};_0x27c69e['model']=_['keys'](db[_0xa9d1('0x29')][_0xa9d1('0x2a')]);_0x27c69e[_0xa9d1('0x2f')]=_[_0xa9d1('0x30')](_0x135d52[_0xa9d1('0x2f')]);_0x27c69e[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x27c69e['model'],_0x27c69e[_0xa9d1('0x2f')]);_0x42ad0d[_0xa9d1('0x33')]=_[_0xa9d1('0x32')](_0x27c69e[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x135d52[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x42ad0d[_0xa9d1('0x33')]=_0x42ad0d[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x42ad0d[_0xa9d1('0x33')]:_0x27c69e['model'];if(_0x135d52['query'][_0xa9d1('0x3f')]){_0x42ad0d[_0xa9d1('0x40')]=[{'all':!![]}];}_0x42ad0d=_[_0xa9d1('0x3c')]({},_0x42ad0d,_0x135d52[_0xa9d1('0x3e')]);return db[_0xa9d1('0x29')][_0xa9d1('0x45')](_0x42ad0d)[_0xa9d1('0x20')](handleEntityNotFound(_0x33a3cd,null))[_0xa9d1('0x20')](respondWithResult(_0x33a3cd,null))[_0xa9d1('0x46')](handleError(_0x33a3cd,null));};exports[_0xa9d1('0x47')]=function(_0x4912f0,_0x5c50aa){return db['Campaign']['create'](_0x4912f0[_0xa9d1('0x48')],{})[_0xa9d1('0x20')](function(_0x129a36){var _0x157be5=_0x4912f0[_0xa9d1('0x49')]['get']({'plain':!![]});if(!_0x157be5)throw new Error(_0xa9d1('0x4a'));if(_0x157be5[_0xa9d1('0x4b')]===_0xa9d1('0x49')){var _0x18487f=_0x129a36[_0xa9d1('0x21')]({'plain':!![]});var _0x560c95=_0xa9d1('0x22');return db[_0xa9d1('0x4c')]['find']({'where':{'name':_0x560c95,'userProfileId':_0x157be5[_0xa9d1('0x4d')]},'raw':!![]})[_0xa9d1('0x20')](function(_0x5a010a){if(_0x5a010a&&_0x5a010a['autoAssociation']===0x0){return db[_0xa9d1('0x23')][_0xa9d1('0x47')]({'name':_0x18487f[_0xa9d1('0x26')],'resourceId':_0x18487f['id'],'type':_0x5a010a[_0xa9d1('0x26')],'sectionId':_0x5a010a['id']},{})[_0xa9d1('0x20')](function(){return _0x129a36;});}else{return _0x129a36;}})[_0xa9d1('0x46')](function(_0xbae3ed){logger[_0xa9d1('0x24')](_0xa9d1('0x4e'),_0xbae3ed);throw _0xbae3ed;});}return _0x129a36;})[_0xa9d1('0x20')](respondWithResult(_0x5c50aa,0xc9))[_0xa9d1('0x46')](handleError(_0x5c50aa,null));};exports[_0xa9d1('0x4f')]=function(_0x1c4f48,_0x21df84){var _0x5e73f5={'where':{'id':_0x1c4f48[_0xa9d1('0x44')]['id']}},_0x3f793a={};_0x3f793a[_0xa9d1('0x2e')]=_[_0xa9d1('0x30')](db[_0xa9d1('0x29')][_0xa9d1('0x2a')]);_0x5e73f5[_0xa9d1('0x33')]=_[_0xa9d1('0x32')](_0x3f793a[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x1c4f48[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x5e73f5[_0xa9d1('0x33')]=_0x5e73f5[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x5e73f5['attributes']:_0x3f793a['model'];if(_0x1c4f48[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x5e73f5[_0xa9d1('0x40')]=[{'all':!![]}];}_0x5e73f5=_['merge']({},_0x5e73f5,_0x1c4f48[_0xa9d1('0x3e')]);return db[_0xa9d1('0x29')][_0xa9d1('0x45')](_0x5e73f5)[_0xa9d1('0x20')](handleEntityNotFound(_0x21df84,null))[_0xa9d1('0x20')](function(_0x27775f){if(_0x27775f){var _0xe66220=_0x27775f[_0xa9d1('0x21')]({'plain':!![]});_0xe66220=qs[_0xa9d1('0x50')](_0xe66220,['id',_0xa9d1('0x51'),_0xa9d1('0x52')]);_0x1c4f48[_0xa9d1('0x48')]=_['omit'](_0x1c4f48['body'],['id',_0xa9d1('0x51'),_0xa9d1('0x52')]);return db[_0xa9d1('0x29')][_0xa9d1('0x47')](_['merge'](_0xe66220,_0x1c4f48[_0xa9d1('0x48')]),{'include':_0x1c4f48[_0xa9d1('0x2f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1c1674){var _0x1498c3=_0x1c4f48[_0xa9d1('0x49')][_0xa9d1('0x21')]({'plain':!![]});if(!_0x1498c3)throw new Error(_0xa9d1('0x4a'));if(_0x1498c3[_0xa9d1('0x4b')]===_0xa9d1('0x49')){var _0x166384=_0x1c1674['get']({'plain':!![]});var _0x266eb4=_0xa9d1('0x22');return db['UserProfileSection'][_0xa9d1('0x45')]({'where':{'name':_0x266eb4,'userProfileId':_0x1498c3['userProfileId']},'raw':!![]})[_0xa9d1('0x20')](function(_0x430210){if(_0x430210&&_0x430210[_0xa9d1('0x53')]===0x0){return db[_0xa9d1('0x23')][_0xa9d1('0x47')]({'name':_0x166384[_0xa9d1('0x26')],'resourceId':_0x166384['id'],'type':_0x430210[_0xa9d1('0x26')],'sectionId':_0x430210['id']},{})['then'](function(){return _0x1c1674;});}else{return _0x1c1674;}})[_0xa9d1('0x46')](function(_0x2dcf34){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dcf34);throw _0x2dcf34;});}return _0x1c1674;});}})[_0xa9d1('0x20')](respondWithResult(_0x21df84,0xc9))[_0xa9d1('0x46')](handleError(_0x21df84,null));};exports['update']=function(_0x2ac8a9,_0x2a34f2){if(_0x2ac8a9[_0xa9d1('0x48')]['id']){delete _0x2ac8a9[_0xa9d1('0x48')]['id'];}return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x2ac8a9[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x2a34f2,null))['then'](saveUpdates(_0x2ac8a9[_0xa9d1('0x48')],null))[_0xa9d1('0x20')](respondWithResult(_0x2a34f2,null))[_0xa9d1('0x46')](handleError(_0x2a34f2,null));};exports[_0xa9d1('0x1f')]=function(_0x524773,_0x5ef934){return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x524773[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x5ef934,null))[_0xa9d1('0x20')](removeEntity(_0x5ef934,null))['catch'](handleError(_0x5ef934,null));};exports[_0xa9d1('0x54')]=function(_0x5b18d3,_0x2c285b,_0x254754){var _0x33a8a2={'raw':!![],'where':{}};var _0x894073={};var _0x5826b8={'count':0x0,'rows':[]};return db[_0xa9d1('0x29')]['findOne']({'where':{'id':_0x5b18d3[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c285b,null))[_0xa9d1('0x20')](function(_0x476fa9){if(_0x476fa9){_0x894073[_0xa9d1('0x2e')]=_[_0xa9d1('0x30')](db[_0xa9d1('0x55')]['rawAttributes']);_0x894073['query']=_[_0xa9d1('0x30')](_0x5b18d3[_0xa9d1('0x2f')]);_0x894073[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x894073['model'],_0x894073[_0xa9d1('0x2f')]);_0x33a8a2[_0xa9d1('0x33')]=_['intersection'](_0x894073['model'],qs['fields'](_0x5b18d3[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x33a8a2[_0xa9d1('0x33')]=_0x33a8a2['attributes']['length']?_0x33a8a2[_0xa9d1('0x33')]:_0x894073[_0xa9d1('0x2e')];if(!_0x5b18d3['query'][_0xa9d1('0x36')](_0xa9d1('0x56'))){_0x33a8a2[_0xa9d1('0x1c')]=qs['limit'](_0x5b18d3['query']['limit']);_0x33a8a2['offset']=qs[_0xa9d1('0x37')](_0x5b18d3['query'][_0xa9d1('0x37')]);}_0x33a8a2[_0xa9d1('0x38')]=qs[_0xa9d1('0x39')](_0x5b18d3[_0xa9d1('0x2f')][_0xa9d1('0x39')]);_0x33a8a2['where']=qs[_0xa9d1('0x31')](_[_0xa9d1('0x3b')](_0x5b18d3['query'],_0x894073['filters']));_0x33a8a2[_0xa9d1('0x3a')]['CampaignId']=_0x476fa9['id'];if(_0x5b18d3['query'][_0xa9d1('0x3d')]){_0x33a8a2[_0xa9d1('0x3a')]=_[_0xa9d1('0x3c')](_0x33a8a2[_0xa9d1('0x3a')],{'$or':_[_0xa9d1('0x28')](_0x33a8a2[_0xa9d1('0x33')],function(_0x977a53){var _0x557727={};_0x557727[_0x977a53]={'$like':'%'+_0x5b18d3['query'][_0xa9d1('0x3d')]+'%'};return _0x557727;})});}_0x33a8a2=_[_0xa9d1('0x3c')]({},_0x33a8a2,_0x5b18d3[_0xa9d1('0x3e')]);return db[_0xa9d1('0x55')][_0xa9d1('0x1b')]({'where':_0x33a8a2['where']})[_0xa9d1('0x20')](function(_0x18c403){_0x5826b8[_0xa9d1('0x1b')]=_0x18c403;if(_0x5b18d3['query']['includeAll']){_0x33a8a2['include']=[{'all':!![]}];}return db[_0xa9d1('0x55')][_0xa9d1('0x41')](_0x33a8a2);})[_0xa9d1('0x20')](function(_0x3948ad){_0x5826b8['rows']=_0x3948ad;return _0x5826b8;});}})['then'](respondWithFilteredResult(_0x2c285b,_0x33a8a2))[_0xa9d1('0x46')](handleError(_0x2c285b,null));};exports[_0xa9d1('0x57')]=function(_0x1b969e,_0x14a828,_0x54ab20){var _0x3cc2b6={'raw':!![],'where':{}};var _0x1b86f1={};var _0x4783df={'count':0x0,'rows':[]};return db[_0xa9d1('0x29')][_0xa9d1('0x58')]({'where':{'id':_0x1b969e[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x14a828,null))[_0xa9d1('0x20')](function(_0x470ff){if(_0x470ff){_0x1b86f1[_0xa9d1('0x2e')]=_[_0xa9d1('0x30')](db[_0xa9d1('0x59')][_0xa9d1('0x2a')]);_0x1b86f1[_0xa9d1('0x2f')]=_[_0xa9d1('0x30')](_0x1b969e[_0xa9d1('0x2f')]);_0x1b86f1[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x1b86f1[_0xa9d1('0x2e')],_0x1b86f1[_0xa9d1('0x2f')]);_0x3cc2b6[_0xa9d1('0x33')]=_['intersection'](_0x1b86f1[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x3cc2b6[_0xa9d1('0x33')]=_0x3cc2b6[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x3cc2b6['attributes']:_0x1b86f1['model'];if(!_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x36')](_0xa9d1('0x56'))){_0x3cc2b6['limit']=qs['limit'](_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x1c')]);_0x3cc2b6[_0xa9d1('0x37')]=qs['offset'](_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x37')]);}_0x3cc2b6[_0xa9d1('0x38')]=qs[_0xa9d1('0x39')](_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x39')]);_0x3cc2b6[_0xa9d1('0x3a')]=qs[_0xa9d1('0x31')](_[_0xa9d1('0x3b')](_0x1b969e[_0xa9d1('0x2f')],_0x1b86f1[_0xa9d1('0x31')]));_0x3cc2b6['where']['CampaignId']=_0x470ff['id'];if(_0x1b969e['query'][_0xa9d1('0x3d')]){_0x3cc2b6['where']=_[_0xa9d1('0x3c')](_0x3cc2b6['where'],{'$or':_[_0xa9d1('0x28')](_0x3cc2b6[_0xa9d1('0x33')],function(_0x14328f){var _0x1825ca={};_0x1825ca[_0x14328f]={'$like':'%'+_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x3d')]+'%'};return _0x1825ca;})});}_0x3cc2b6=_['merge']({},_0x3cc2b6,_0x1b969e[_0xa9d1('0x3e')]);return db[_0xa9d1('0x59')]['count']({'where':_0x3cc2b6['where']})[_0xa9d1('0x20')](function(_0x308bc7){_0x4783df[_0xa9d1('0x1b')]=_0x308bc7;if(_0x1b969e[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x3cc2b6['include']=[{'all':!![]}];}return db[_0xa9d1('0x59')][_0xa9d1('0x41')](_0x3cc2b6);})[_0xa9d1('0x20')](function(_0x40955d){_0x4783df[_0xa9d1('0x42')]=_0x40955d;return _0x4783df;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x14a828,_0x3cc2b6))[_0xa9d1('0x46')](handleError(_0x14a828,null));};exports['getHopperFinals']=function(_0x485e34,_0x31716d,_0x25ab52){var _0x467a2d={'raw':!![],'where':{}};var _0x4f58ee={};var _0x11b5ae={'count':0x0,'rows':[]};return db[_0xa9d1('0x29')][_0xa9d1('0x58')]({'where':{'id':_0x485e34[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x31716d,null))['then'](function(_0x219a0a){if(_0x219a0a){_0x4f58ee[_0xa9d1('0x2e')]=_[_0xa9d1('0x30')](db[_0xa9d1('0x5a')][_0xa9d1('0x2a')]);_0x4f58ee['query']=_[_0xa9d1('0x30')](_0x485e34[_0xa9d1('0x2f')]);_0x4f58ee[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x4f58ee[_0xa9d1('0x2e')],_0x4f58ee['query']);_0x467a2d[_0xa9d1('0x33')]=_[_0xa9d1('0x32')](_0x4f58ee[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x485e34[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x467a2d[_0xa9d1('0x33')]=_0x467a2d[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x467a2d[_0xa9d1('0x33')]:_0x4f58ee['model'];if(!_0x485e34[_0xa9d1('0x2f')][_0xa9d1('0x36')](_0xa9d1('0x56'))){_0x467a2d['limit']=qs['limit'](_0x485e34[_0xa9d1('0x2f')][_0xa9d1('0x1c')]);_0x467a2d[_0xa9d1('0x37')]=qs[_0xa9d1('0x37')](_0x485e34['query'][_0xa9d1('0x37')]);}_0x467a2d[_0xa9d1('0x38')]=qs[_0xa9d1('0x39')](_0x485e34['query'][_0xa9d1('0x39')]);_0x467a2d[_0xa9d1('0x3a')]=qs[_0xa9d1('0x31')](_[_0xa9d1('0x3b')](_0x485e34['query'],_0x4f58ee['filters']));_0x467a2d[_0xa9d1('0x3a')][_0xa9d1('0x5b')]=_0x219a0a['id'];if(_0x485e34[_0xa9d1('0x2f')][_0xa9d1('0x3d')]){_0x467a2d[_0xa9d1('0x3a')]=_[_0xa9d1('0x3c')](_0x467a2d[_0xa9d1('0x3a')],{'$or':_[_0xa9d1('0x28')](_0x467a2d['attributes'],function(_0x1987c3){var _0x5b1a0b={};_0x5b1a0b[_0x1987c3]={'$like':'%'+_0x485e34[_0xa9d1('0x2f')]['filter']+'%'};return _0x5b1a0b;})});}_0x467a2d=_[_0xa9d1('0x3c')]({},_0x467a2d,_0x485e34['options']);return db[_0xa9d1('0x5a')][_0xa9d1('0x1b')]({'where':_0x467a2d[_0xa9d1('0x3a')]})[_0xa9d1('0x20')](function(_0x3ab814){_0x11b5ae['count']=_0x3ab814;if(_0x485e34[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x467a2d[_0xa9d1('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa9d1('0x41')](_0x467a2d);})[_0xa9d1('0x20')](function(_0x2958d0){_0x11b5ae[_0xa9d1('0x42')]=_0x2958d0;return _0x11b5ae;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x31716d,_0x467a2d))[_0xa9d1('0x46')](handleError(_0x31716d,null));};exports[_0xa9d1('0x5c')]=function(_0x1e968d,_0x3237cc,_0x56a30e){var _0x4f5fd9={'raw':!![],'where':{}};var _0x4c9dbc={};var _0x30ef6b={'count':0x0,'rows':[]};return db[_0xa9d1('0x29')][_0xa9d1('0x58')]({'where':{'id':_0x1e968d[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x3237cc,null))[_0xa9d1('0x20')](function(_0x3bb3a1){if(_0x3bb3a1){_0x4c9dbc[_0xa9d1('0x2e')]=_[_0xa9d1('0x30')](db[_0xa9d1('0x5d')]['rawAttributes']);_0x4c9dbc[_0xa9d1('0x2f')]=_[_0xa9d1('0x30')](_0x1e968d['query']);_0x4c9dbc['filters']=_['intersection'](_0x4c9dbc[_0xa9d1('0x2e')],_0x4c9dbc['query']);_0x4f5fd9[_0xa9d1('0x33')]=_['intersection'](_0x4c9dbc[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x1e968d['query'][_0xa9d1('0x34')]));_0x4f5fd9[_0xa9d1('0x33')]=_0x4f5fd9['attributes'][_0xa9d1('0x35')]?_0x4f5fd9[_0xa9d1('0x33')]:_0x4c9dbc[_0xa9d1('0x2e')];if(!_0x1e968d[_0xa9d1('0x2f')][_0xa9d1('0x36')](_0xa9d1('0x56'))){_0x4f5fd9[_0xa9d1('0x1c')]=qs[_0xa9d1('0x1c')](_0x1e968d['query'][_0xa9d1('0x1c')]);_0x4f5fd9[_0xa9d1('0x37')]=qs[_0xa9d1('0x37')](_0x1e968d['query'][_0xa9d1('0x37')]);}_0x4f5fd9[_0xa9d1('0x38')]=qs['sort'](_0x1e968d[_0xa9d1('0x2f')]['sort']);_0x4f5fd9[_0xa9d1('0x3a')]=qs[_0xa9d1('0x31')](_[_0xa9d1('0x3b')](_0x1e968d[_0xa9d1('0x2f')],_0x4c9dbc[_0xa9d1('0x31')]));_0x4f5fd9[_0xa9d1('0x3a')][_0xa9d1('0x5b')]=_0x3bb3a1['id'];if(_0x1e968d[_0xa9d1('0x2f')][_0xa9d1('0x3d')]){_0x4f5fd9[_0xa9d1('0x3a')]=_[_0xa9d1('0x3c')](_0x4f5fd9['where'],{'$or':_['map'](_0x4f5fd9[_0xa9d1('0x33')],function(_0x1c0de4){var _0x52028c={};_0x52028c[_0x1c0de4]={'$like':'%'+_0x1e968d[_0xa9d1('0x2f')][_0xa9d1('0x3d')]+'%'};return _0x52028c;})});}_0x4f5fd9=_[_0xa9d1('0x3c')]({},_0x4f5fd9,_0x1e968d[_0xa9d1('0x3e')]);return db[_0xa9d1('0x5d')][_0xa9d1('0x1b')]({'where':_0x4f5fd9[_0xa9d1('0x3a')]})[_0xa9d1('0x20')](function(_0x1d56a5){_0x30ef6b[_0xa9d1('0x1b')]=_0x1d56a5;if(_0x1e968d[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x4f5fd9[_0xa9d1('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa9d1('0x41')](_0x4f5fd9);})[_0xa9d1('0x20')](function(_0x201496){_0x30ef6b['rows']=_0x201496;return _0x30ef6b;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x3237cc,_0x4f5fd9))[_0xa9d1('0x46')](handleError(_0x3237cc,null));};exports[_0xa9d1('0x5e')]=function(_0x2865cf,_0x9fb664,_0x4b8145){var _0x409576={};var _0x4323b1={};var _0x32966a;var _0x424041;return db[_0xa9d1('0x29')][_0xa9d1('0x58')]({'where':{'id':_0x2865cf[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x9fb664,null))[_0xa9d1('0x20')](function(_0x37e7cc){if(_0x37e7cc){_0x32966a=_0x37e7cc;_0x4323b1['model']=_['keys'](db[_0xa9d1('0x5f')][_0xa9d1('0x2a')]);_0x4323b1[_0xa9d1('0x2f')]=_[_0xa9d1('0x30')](_0x2865cf[_0xa9d1('0x2f')]);_0x4323b1[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x4323b1['model'],_0x4323b1[_0xa9d1('0x2f')]);_0x409576[_0xa9d1('0x33')]=_['intersection'](_0x4323b1[_0xa9d1('0x2e')],qs[_0xa9d1('0x34')](_0x2865cf[_0xa9d1('0x2f')][_0xa9d1('0x34')]));_0x409576['attributes']=_0x409576[_0xa9d1('0x33')][_0xa9d1('0x35')]?_0x409576[_0xa9d1('0x33')]:_0x4323b1[_0xa9d1('0x2e')];_0x409576[_0xa9d1('0x38')]=qs[_0xa9d1('0x39')](_0x2865cf[_0xa9d1('0x2f')]['sort']);_0x409576[_0xa9d1('0x3a')]=qs['filters'](_['pick'](_0x2865cf['query'],_0x4323b1['filters']));if(_0x2865cf[_0xa9d1('0x2f')]['filter']){_0x409576['where']=_[_0xa9d1('0x3c')](_0x409576['where'],{'$or':_[_0xa9d1('0x28')](_0x409576['attributes'],function(_0x5a8aee){var _0x2910b4={};_0x2910b4[_0x5a8aee]={'$like':'%'+_0x2865cf[_0xa9d1('0x2f')]['filter']+'%'};return _0x2910b4;})});}_0x409576=_[_0xa9d1('0x3c')]({},_0x409576,_0x2865cf['options']);return _0x32966a[_0xa9d1('0x5e')](_0x409576);}})[_0xa9d1('0x20')](function(_0x4ba0ca){if(_0x4ba0ca){_0x424041=_0x4ba0ca[_0xa9d1('0x35')];if(!_0x2865cf['query'][_0xa9d1('0x36')](_0xa9d1('0x56'))){_0x409576[_0xa9d1('0x1c')]=qs[_0xa9d1('0x1c')](_0x2865cf[_0xa9d1('0x2f')][_0xa9d1('0x1c')]);_0x409576[_0xa9d1('0x37')]=qs[_0xa9d1('0x37')](_0x2865cf[_0xa9d1('0x2f')][_0xa9d1('0x37')]);}return _0x32966a[_0xa9d1('0x5e')](_0x409576);}})['then'](function(_0x28e7fa){if(_0x28e7fa){return _0x28e7fa?{'count':_0x424041,'rows':_0x28e7fa}:null;}})['then'](respondWithResult(_0x9fb664,null))[_0xa9d1('0x46')](handleError(_0x9fb664,null));};exports['addLists']=function(_0x22d812,_0x53eb9f,_0x42cfdd){var _0x3564b9,_0x10e547;return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x22d812['params']['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x53eb9f,null))[_0xa9d1('0x20')](function(_0xea00b9){if(_0xea00b9){_0x10e547=_0xea00b9;return _0xea00b9[_0xa9d1('0x60')](_0x22d812[_0xa9d1('0x48')][_0xa9d1('0x61')],_['omit'](_0x22d812['body'],[_0xa9d1('0x61'),'id'])||{});}return null;})['spread'](function(_0x1a35ac){var _0x233e66;_0x3564b9=_0x1a35ac||[];var _0x597de7=[];if(_0x1a35ac){for(var _0x230301=0x0;_0x230301<_0x1a35ac[_0xa9d1('0x35')];_0x230301+=0x1){var _0x230b70=_0x1a35ac[_0x230301]['get']({'plain':!![]});_0x10e547['dialCheckDuplicateType']=_0x22d812[_0xa9d1('0x48')]['dialCheckDuplicateType']?_0x22d812[_0xa9d1('0x48')][_0xa9d1('0x62')]:_0x10e547[_0xa9d1('0x62')];switch(_0x10e547[_0xa9d1('0x62')]){case _0xa9d1('0x63'):_0x233e66=squel['insert']()['into'](_0xa9d1('0x64'))[_0xa9d1('0x65')]([_0xa9d1('0x66'),'scheduledAt',_0xa9d1('0x67'),_0xa9d1('0x68'),_0xa9d1('0x5b'),_0xa9d1('0x51'),'updatedAt'],squel[_0xa9d1('0x69')]()[_0xa9d1('0x6a')]('phone','phone')['field']('NOW()',_0xa9d1('0x6b'))[_0xa9d1('0x6a')]('id',_0xa9d1('0x67'))[_0xa9d1('0x6a')](_0x230b70[_0xa9d1('0x6c')][_0xa9d1('0x6d')](),_0xa9d1('0x68'))['field'](_0x22d812[_0xa9d1('0x44')]['id']['toString'](),_0xa9d1('0x5b'))['field'](_0xa9d1('0x6e'),_0xa9d1('0x51'))[_0xa9d1('0x6a')](_0xa9d1('0x6e'),_0xa9d1('0x52'))[_0xa9d1('0x6f')](_0xa9d1('0x70'))['where'](_0xa9d1('0x71'))[_0xa9d1('0x3a')](_0xa9d1('0x72'),_0x230b70['CmListId'][_0xa9d1('0x6d')]())['where'](_0xa9d1('0x73'))[_0xa9d1('0x3a')](_0xa9d1('0x74'),squel[_0xa9d1('0x69')]()[_0xa9d1('0x6a')](_0xa9d1('0x75'))[_0xa9d1('0x6f')](_0xa9d1('0x76'))['where'](_0xa9d1('0x77'),_0x22d812['params']['id'][_0xa9d1('0x6d')]()))[_0xa9d1('0x3a')](_0xa9d1('0x74'),squel[_0xa9d1('0x69')]()[_0xa9d1('0x6a')](_0xa9d1('0x78'))[_0xa9d1('0x6f')]('cm_hopper')[_0xa9d1('0x3a')](_0xa9d1('0x77'),_0x22d812['params']['id']['toString']())))[_0xa9d1('0x6d')]();break;case _0xa9d1('0x79'):_0x233e66=squel[_0xa9d1('0x7a')]()[_0xa9d1('0x7b')](_0xa9d1('0x64'))[_0xa9d1('0x65')](['phone','scheduledAt',_0xa9d1('0x67'),_0xa9d1('0x68'),_0xa9d1('0x5b'),_0xa9d1('0x51'),_0xa9d1('0x52')],squel['select']()[_0xa9d1('0x6a')](_0xa9d1('0x66'),_0xa9d1('0x66'))[_0xa9d1('0x6a')]('NOW()',_0xa9d1('0x6b'))['field']('id','ContactId')['field'](_0x230b70[_0xa9d1('0x6c')][_0xa9d1('0x6d')](),_0xa9d1('0x68'))['field'](_0x22d812[_0xa9d1('0x44')]['id']['toString'](),_0xa9d1('0x5b'))['field'](_0xa9d1('0x6e'),'createdAt')['field'](_0xa9d1('0x6e'),_0xa9d1('0x52'))[_0xa9d1('0x6f')](_0xa9d1('0x70'))[_0xa9d1('0x3a')]('deletedAt\x20IS\x20NULL')[_0xa9d1('0x3a')](_0xa9d1('0x72'),_0x230b70['CmListId']['toString']())[_0xa9d1('0x3a')](_0xa9d1('0x73'))[_0xa9d1('0x3a')](_0xa9d1('0x74'),squel[_0xa9d1('0x69')]()[_0xa9d1('0x6a')](_0xa9d1('0x78'))[_0xa9d1('0x6f')]('cm_hopper')[_0xa9d1('0x3a')](_0xa9d1('0x77'),_0x22d812['params']['id'][_0xa9d1('0x6d')]())))[_0xa9d1('0x6d')]();break;default:_0x233e66=squel[_0xa9d1('0x7a')]()[_0xa9d1('0x7b')](_0xa9d1('0x64'))[_0xa9d1('0x65')]([_0xa9d1('0x66'),_0xa9d1('0x6b'),'ContactId',_0xa9d1('0x68'),_0xa9d1('0x5b'),_0xa9d1('0x51'),'updatedAt'],squel['select']()[_0xa9d1('0x6a')](_0xa9d1('0x66'),_0xa9d1('0x66'))[_0xa9d1('0x6a')](_0xa9d1('0x6e'),'scheduledAt')[_0xa9d1('0x6a')]('id',_0xa9d1('0x67'))[_0xa9d1('0x6a')](_0x230b70[_0xa9d1('0x6c')][_0xa9d1('0x6d')](),_0xa9d1('0x68'))[_0xa9d1('0x6a')](_0x22d812[_0xa9d1('0x44')]['id'][_0xa9d1('0x6d')](),_0xa9d1('0x5b'))[_0xa9d1('0x6a')](_0xa9d1('0x6e'),'createdAt')[_0xa9d1('0x6a')](_0xa9d1('0x6e'),_0xa9d1('0x52'))[_0xa9d1('0x6f')](_0xa9d1('0x70'))[_0xa9d1('0x3a')](_0xa9d1('0x71'))[_0xa9d1('0x3a')](_0xa9d1('0x72'),_0x230b70[_0xa9d1('0x6c')]['toString']())[_0xa9d1('0x3a')](_0xa9d1('0x73')))[_0xa9d1('0x6d')]();}_0x597de7[_0xa9d1('0x7c')](db[_0xa9d1('0x7d')][_0xa9d1('0x2f')](_0x233e66));}return BPromise[_0xa9d1('0x7e')](_0x597de7);}})[_0xa9d1('0x20')](function(){return _0x3564b9;})[_0xa9d1('0x20')](respondWithResult(_0x53eb9f,null))[_0xa9d1('0x46')](handleError(_0x53eb9f,null));};exports[_0xa9d1('0x7f')]=function(_0x4148f8,_0x54181b,_0x5cb6be){return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x4148f8[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x54181b,null))[_0xa9d1('0x20')](function(_0x375524){if(_0x375524){return _0x375524[_0xa9d1('0x7f')](_0x4148f8[_0xa9d1('0x2f')][_0xa9d1('0x61')]);}})['then'](function(_0x812f68){if(_0x812f68){return db[_0xa9d1('0x55')][_0xa9d1('0x1f')]({'where':{'ListId':_0x4148f8['query'][_0xa9d1('0x61')],'CampaignId':_0x4148f8[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](function(){return _0x812f68;});}})[_0xa9d1('0x20')](respondWithStatusCode(_0x54181b,null))[_0xa9d1('0x46')](handleError(_0x54181b,null));};exports[_0xa9d1('0x80')]=function(_0x1eacac,_0x334142,_0x5b7dea){var _0x11a469={'raw':!![],'where':{}};var _0x38d931={};var _0x28d3e5={'count':0x0,'rows':[]};return db[_0xa9d1('0x29')][_0xa9d1('0x58')]({'where':{'id':_0x1eacac[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x334142,null))[_0xa9d1('0x20')](function(_0x558cfe){if(_0x558cfe){_0x38d931[_0xa9d1('0x2e')]=_['keys'](db[_0xa9d1('0x5f')][_0xa9d1('0x2a')]);_0x38d931[_0xa9d1('0x2f')]=_['keys'](_0x1eacac['query']);_0x38d931[_0xa9d1('0x31')]=_[_0xa9d1('0x32')](_0x38d931[_0xa9d1('0x2e')],_0x38d931[_0xa9d1('0x2f')]);_0x11a469[_0xa9d1('0x33')]=_[_0xa9d1('0x32')](_0x38d931['model'],qs[_0xa9d1('0x34')](_0x1eacac['query'][_0xa9d1('0x34')]));_0x11a469[_0xa9d1('0x33')]=_0x11a469['attributes'][_0xa9d1('0x35')]?_0x11a469['attributes']:_0x38d931[_0xa9d1('0x2e')];if(!_0x1eacac[_0xa9d1('0x2f')]['hasOwnProperty']('nolimit')){_0x11a469['limit']=qs[_0xa9d1('0x1c')](_0x1eacac[_0xa9d1('0x2f')][_0xa9d1('0x1c')]);_0x11a469[_0xa9d1('0x37')]=qs[_0xa9d1('0x37')](_0x1eacac[_0xa9d1('0x2f')]['offset']);}_0x11a469[_0xa9d1('0x38')]=qs['sort'](_0x1eacac['query']['sort']);_0x11a469[_0xa9d1('0x3a')]=qs['filters'](_['pick'](_0x1eacac[_0xa9d1('0x2f')],_0x38d931[_0xa9d1('0x31')]));_0x11a469[_0xa9d1('0x3a')][_0xa9d1('0x5b')]=_0x558cfe['id'];if(_0x1eacac[_0xa9d1('0x2f')][_0xa9d1('0x3d')]){_0x11a469['where']=_[_0xa9d1('0x3c')](_0x11a469[_0xa9d1('0x3a')],{'$or':_[_0xa9d1('0x28')](_0x11a469[_0xa9d1('0x33')],function(_0x4cbd07){var _0x36db6d={};_0x36db6d[_0x4cbd07]={'$like':'%'+_0x1eacac[_0xa9d1('0x2f')][_0xa9d1('0x3d')]+'%'};return _0x36db6d;})});}_0x11a469=_[_0xa9d1('0x3c')]({},_0x11a469,_0x1eacac['options']);return db[_0xa9d1('0x5f')][_0xa9d1('0x1b')]({'where':_0x11a469[_0xa9d1('0x3a')]})[_0xa9d1('0x20')](function(_0x5ec75f){_0x28d3e5[_0xa9d1('0x1b')]=_0x5ec75f;if(_0x1eacac[_0xa9d1('0x2f')][_0xa9d1('0x3f')]){_0x11a469[_0xa9d1('0x40')]=[{'all':!![]}];}return db[_0xa9d1('0x5f')][_0xa9d1('0x41')](_0x11a469);})[_0xa9d1('0x20')](function(_0x5b7361){_0x28d3e5[_0xa9d1('0x42')]=_0x5b7361;return _0x28d3e5;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x334142,_0x11a469))[_0xa9d1('0x46')](handleError(_0x334142,null));};exports[_0xa9d1('0x81')]=function(_0x3c8ad9,_0x1029b4,_0x392e30){var _0x53118d,_0x3b7f8c;return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x3c8ad9[_0xa9d1('0x44')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x1029b4,null))[_0xa9d1('0x20')](function(_0x5285c8){if(_0x5285c8){_0x3b7f8c=_0x5285c8;return _0x5285c8[_0xa9d1('0x81')](_0x3c8ad9['body'][_0xa9d1('0x61')],_[_0xa9d1('0x50')](_0x3c8ad9[_0xa9d1('0x48')],[_0xa9d1('0x61'),'id'])||{});}return null;})[_0xa9d1('0x82')](function(_0x27baf2){var _0x45267c;_0x53118d=_0x27baf2||[];var _0x3036e5=[];if(_0x27baf2){for(var _0x28ac10=0x0;_0x28ac10<_0x27baf2[_0xa9d1('0x35')];_0x28ac10+=0x1){var _0x4fc503=_0x27baf2[_0x28ac10]['get']({'plain':!![]});_0x45267c=squel[_0xa9d1('0x7a')]()[_0xa9d1('0x7b')]('cm_hopper_black')[_0xa9d1('0x65')]([_0xa9d1('0x66'),_0xa9d1('0x67'),_0xa9d1('0x68'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0xa9d1('0x6a')](_0xa9d1('0x66'),'phone')[_0xa9d1('0x6a')]('id',_0xa9d1('0x67'))[_0xa9d1('0x6a')](_0x4fc503['CmListId'][_0xa9d1('0x6d')](),_0xa9d1('0x68'))['field'](_0x3c8ad9[_0xa9d1('0x44')]['id']['toString'](),'CampaignId')['field'](_0xa9d1('0x6e'),'createdAt')[_0xa9d1('0x6a')](_0xa9d1('0x6e'),'updatedAt')['from'](_0xa9d1('0x70'))[_0xa9d1('0x3a')](_0xa9d1('0x71'))[_0xa9d1('0x3a')](_0xa9d1('0x72'),_0x4fc503[_0xa9d1('0x6c')][_0xa9d1('0x6d')]())[_0xa9d1('0x3a')](_0xa9d1('0x73')))[_0xa9d1('0x6d')]();_0x3036e5[_0xa9d1('0x7c')](db[_0xa9d1('0x7d')]['query'](_0x45267c));}return BPromise[_0xa9d1('0x7e')](_0x3036e5);}})[_0xa9d1('0x20')](function(){return _0x53118d;})[_0xa9d1('0x20')](respondWithResult(_0x1029b4,null))[_0xa9d1('0x46')](handleError(_0x1029b4,null));};exports[_0xa9d1('0x83')]=function(_0x4d238a,_0x4411b5,_0x4e85f0){return db[_0xa9d1('0x29')][_0xa9d1('0x45')]({'where':{'id':_0x4d238a[_0xa9d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x4411b5,null))[_0xa9d1('0x20')](function(_0x1b1d08){if(_0x1b1d08){return _0x1b1d08[_0xa9d1('0x83')](_0x4d238a[_0xa9d1('0x2f')][_0xa9d1('0x61')]);}})[_0xa9d1('0x20')](function(_0x333eb7){if(_0x333eb7){return db[_0xa9d1('0x5d')][_0xa9d1('0x1f')]({'where':{'ListId':_0x4d238a['query'][_0xa9d1('0x61')],'CampaignId':_0x4d238a[_0xa9d1('0x44')]['id']}})['then'](function(){return _0x333eb7;});}})[_0xa9d1('0x20')](respondWithStatusCode(_0x4411b5,null))[_0xa9d1('0x46')](handleError(_0x4411b5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b1b5f89..3b2db59 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0xb10b,0x12a));var _0xbb10=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xb10b[_0x119705];return _0x2affc2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f05f0,_0x1b5044){var _0x4a9042=function(_0x1f8146){while(--_0x1f8146){_0x3f05f0['push'](_0x3f05f0['shift']());}};_0x4a9042(++_0x1b5044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var 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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 4ece89d..022706f 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(_0x4cbe98,_0x576f7b){var _0x49c755=function(_0x1e0487){while(--_0x1e0487){_0x4cbe98['push'](_0x4cbe98['shift']());}};_0x49c755(++_0x576f7b);}(_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(_0x5dacbf,_0x2a2417){var _0x5974db=function(_0x5a49f1){while(--_0x5a49f1){_0x5dacbf['push'](_0x5dacbf['shift']());}};_0x5974db(++_0x2a2417);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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 337be8a..1503ae6 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 _0x000d=['Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','put','/:id','destroy','delete','exports','multer','express'];(function(_0xd6a763,_0x563229){var _0x4bf8ca=function(_0x213e83){while(--_0x213e83){_0xd6a763['push'](_0xd6a763['shift']());}};_0x4bf8ca(++_0x563229);}(_0x000d,0x1d2));var _0xd000=function(_0x358775,_0xe07091){_0x358775=_0x358775-0x0;var _0x6d0c46=_0x000d[_0x358775];return _0x6d0c46;};'use strict';var multer=require(_0xd000('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd000('0x1'));var router=express[_0xd000('0x2')]();var auth=require(_0xd000('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd000('0x4'));var controller=require(_0xd000('0x5'));router[_0xd000('0x6')]('/',auth[_0xd000('0x7')](),controller['index']);router[_0xd000('0x6')]('/:id',auth[_0xd000('0x7')](),controller['show']);router['get'](_0xd000('0x8'),auth[_0xd000('0x7')](),controller['getHoppers']);router['get'](_0xd000('0x9'),auth[_0xd000('0x7')](),controller[_0xd000('0xa')]);router[_0xd000('0x6')](_0xd000('0xb'),auth['isAuthenticated'](),controller[_0xd000('0xc')]);router['get'](_0xd000('0xd'),auth['isAuthenticated'](),controller[_0xd000('0xe')]);router[_0xd000('0x6')](_0xd000('0xf'),auth['isAuthenticated'](),controller[_0xd000('0x10')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd000('0x11')]);router[_0xd000('0x12')]('/',auth['isAuthenticated'](),controller[_0xd000('0x13')]);router[_0xd000('0x12')](_0xd000('0x14'),auth[_0xd000('0x7')](),controller['clone']);router['post'](_0xd000('0xf'),auth[_0xd000('0x7')](),controller['addLists']);router['post']('/:id/blacklists',auth[_0xd000('0x7')](),controller['addBlackLists']);router[_0xd000('0x15')](_0xd000('0x16'),auth[_0xd000('0x7')](),controller['update']);router['delete'](_0xd000('0x16'),auth[_0xd000('0x7')](),controller[_0xd000('0x17')]);router[_0xd000('0x18')](_0xd000('0xf'),auth[_0xd000('0x7')](),controller['removeLists']);router[_0xd000('0x18')]('/:id/blacklists',auth[_0xd000('0x7')](),controller['removeBlackLists']);module[_0xd000('0x19')]=router; \ No newline at end of file +var _0x0154=['getHoppers','get','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','/:id','update','destroy','delete','removeLists','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','show'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x0154,0xcf));var _0x4015=function(_0x19847f,_0x3348b9){_0x19847f=_0x19847f-0x0;var _0x1b1c91=_0x0154[_0x19847f];return _0x1b1c91;};'use strict';var multer=require(_0x4015('0x0'));var util=require(_0x4015('0x1'));var path=require(_0x4015('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4015('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4015('0x4'));var config=require(_0x4015('0x5'));var controller=require(_0x4015('0x6'));router['get']('/',auth[_0x4015('0x7')](),controller[_0x4015('0x8')]);router['get']('/:id',auth[_0x4015('0x7')](),controller[_0x4015('0x9')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x4015('0xa')]);router[_0x4015('0xb')]('/:id/hopper_histories',auth[_0x4015('0x7')](),controller[_0x4015('0xc')]);router[_0x4015('0xb')](_0x4015('0xd'),auth[_0x4015('0x7')](),controller[_0x4015('0xe')]);router[_0x4015('0xb')](_0x4015('0xf'),auth[_0x4015('0x7')](),controller[_0x4015('0x10')]);router[_0x4015('0xb')](_0x4015('0x11'),auth[_0x4015('0x7')](),controller['getLists']);router[_0x4015('0xb')](_0x4015('0x12'),auth['isAuthenticated'](),controller[_0x4015('0x13')]);router[_0x4015('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4015('0x15'),auth[_0x4015('0x7')](),controller[_0x4015('0x16')]);router[_0x4015('0x14')](_0x4015('0x11'),auth[_0x4015('0x7')](),controller['addLists']);router[_0x4015('0x14')](_0x4015('0x12'),auth[_0x4015('0x7')](),controller[_0x4015('0x17')]);router[_0x4015('0x18')](_0x4015('0x19'),auth['isAuthenticated'](),controller[_0x4015('0x1a')]);router['delete'](_0x4015('0x19'),auth['isAuthenticated'](),controller[_0x4015('0x1b')]);router[_0x4015('0x1c')](_0x4015('0x11'),auth[_0x4015('0x7')](),controller[_0x4015('0x1d')]);router[_0x4015('0x1c')]('/:id/blacklists',auth[_0x4015('0x7')](),controller['removeBlackLists']);module[_0x4015('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9c1322e..8215afa 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 _0xc608=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc608,0x1b8));var _0x8c60=function(_0x5eb2fa,_0x1dedf0){_0x5eb2fa=_0x5eb2fa-0x0;var _0x48b892=_0xc608[_0x5eb2fa];return _0x48b892;};'use strict';var Sequelize=require(_0x8c60('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8c60('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xd6c2=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x58a50b,_0x5735da){var _0x485d87=function(_0x508c69){while(--_0x508c69){_0x58a50b['push'](_0x58a50b['shift']());}};_0x485d87(++_0x5735da);}(_0xd6c2,0x183));var _0x2d6c=function(_0x18c021,_0x2b5c86){_0x18c021=_0x18c021-0x0;var _0x35b581=_0xd6c2[_0x18c021];return _0x35b581;};'use strict';var Sequelize=require(_0x2d6c('0x0'));module[_0x2d6c('0x1')]={'key':{'type':Sequelize[_0x2d6c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2d6c('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2d6c('0x4')],'get':function(){return this[_0x2d6c('0x5')](_0x2d6c('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 994fb30..7a1282b 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 _0xbe5b=['Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','CannedAnswer','include','findAll','rows','params','rawAttributes','intersection','includeAll','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','set'];(function(_0x1a7c50,_0x148bd2){var _0x2170ad=function(_0x21c57d){while(--_0x21c57d){_0x1a7c50['push'](_0x1a7c50['shift']());}};_0x2170ad(++_0x148bd2);}(_0xbe5b,0x151));var _0xbbe5=function(_0x2592b0,_0x633884){_0x2592b0=_0x2592b0-0x0;var _0x268ed0=_0xbe5b[_0x2592b0];return _0x268ed0;};'use strict';var pdf=require(_0xbbe5('0x0'));var emlformat=require(_0xbbe5('0x1'));var rimraf=require(_0xbbe5('0x2'));var zipdir=require(_0xbbe5('0x3'));var jsonpatch=require(_0xbbe5('0x4'));var rp=require(_0xbbe5('0x5'));var moment=require(_0xbbe5('0x6'));var BPromise=require(_0xbbe5('0x7'));var Mustache=require(_0xbbe5('0x8'));var util=require(_0xbbe5('0x9'));var path=require(_0xbbe5('0xa'));var sox=require(_0xbbe5('0xb'));var csv=require(_0xbbe5('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbbe5('0xd'));var squel=require(_0xbbe5('0xe'));var crypto=require('crypto');var jsforce=require(_0xbbe5('0xf'));var deskjs=require(_0xbbe5('0x10'));var toCsv=require(_0xbbe5('0xc'));var querystring=require(_0xbbe5('0x11'));var Papa=require(_0xbbe5('0x12'));var Redis=require(_0xbbe5('0x13'));var authService=require(_0xbbe5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbbe5('0x15'));var hardwareService=require(_0xbbe5('0x16'));var logger=require(_0xbbe5('0x17'))(_0xbbe5('0x18'));var utils=require(_0xbbe5('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e9e38,_0x4bf0f0){_0x4bf0f0=_0x4bf0f0||0xcc;return function(_0x14d788){if(_0x14d788){return _0x2e9e38[_0xbbe5('0x1a')](_0x4bf0f0);}return _0x2e9e38[_0xbbe5('0x1b')](_0x4bf0f0)['end']();};}function respondWithResult(_0x410f39,_0x373de5){_0x373de5=_0x373de5||0xc8;return function(_0x270aad){if(_0x270aad){return _0x410f39[_0xbbe5('0x1b')](_0x373de5)['json'](_0x270aad);}};}function respondWithFilteredResult(_0x420c2d,_0x4db33b){return function(_0x37ee76){if(_0x37ee76){var _0x1032b7=_0x37ee76[_0xbbe5('0x1c')],_0x54c16b=_0x4db33b['offset'],_0x29ebc0=_0x4db33b[_0xbbe5('0x1d')]+_0x4db33b['limit'],_0x1370a9;if(_0x29ebc0>=_0x1032b7){_0x29ebc0=_0x1032b7;_0x1370a9=0xc8;}else{_0x1370a9=0xce;}_0x420c2d[_0xbbe5('0x1b')](_0x1370a9);return _0x420c2d[_0xbbe5('0x1e')](_0xbbe5('0x1f'),_0x54c16b+'-'+_0x29ebc0+'/'+_0x1032b7)[_0xbbe5('0x20')](_0x37ee76);}return null;};}function patchUpdates(_0x1d56be){return function(_0x4f6ebf){try{jsonpatch[_0xbbe5('0x21')](_0x4f6ebf,_0x1d56be,!![]);}catch(_0x43fdda){return BPromise[_0xbbe5('0x22')](_0x43fdda);}return _0x4f6ebf['save']();};}function saveUpdates(_0x493ea0,_0x53f883){return function(_0x5d5973){if(_0x5d5973){return _0x5d5973[_0xbbe5('0x23')](_0x493ea0)[_0xbbe5('0x24')](function(_0x2194ae){return _0x2194ae;});}return null;};}function removeEntity(_0x2a8729,_0x4d7541){return function(_0x45fc6d){if(_0x45fc6d){return _0x45fc6d[_0xbbe5('0x25')]()['then'](function(){var _0x1ea5df=_0x45fc6d[_0xbbe5('0x26')]({'plain':!![]});var _0x3d0426='CannedAnswers';return db[_0xbbe5('0x27')][_0xbbe5('0x25')]({'where':{'type':_0x3d0426,'resourceId':_0x1ea5df['id']}})['then'](function(){return _0x45fc6d;});})[_0xbbe5('0x24')](function(){_0x2a8729[_0xbbe5('0x1b')](0xcc)[_0xbbe5('0x28')]();});}};}function handleEntityNotFound(_0x518655,_0x162d1a){return function(_0x17101a){if(!_0x17101a){_0x518655['sendStatus'](0x194);}return _0x17101a;};}function handleError(_0x29a6ba,_0x31c0cc){_0x31c0cc=_0x31c0cc||0x1f4;return function(_0x3818c3){logger[_0xbbe5('0x29')](_0x3818c3[_0xbbe5('0x2a')]);if(_0x3818c3['name']){delete _0x3818c3[_0xbbe5('0x2b')];}_0x29a6ba['status'](_0x31c0cc)[_0xbbe5('0x2c')](_0x3818c3);};}exports[_0xbbe5('0x2d')]=function(_0xaa9123,_0x234182){var _0x1455e2={},_0x4c0f30={},_0x2ada64={'count':0x0,'rows':[]};var _0x2e010a=_[_0xbbe5('0x2e')](db['CannedAnswer']['rawAttributes'],function(_0x44e3e7){return{'name':_0x44e3e7['fieldName'],'type':_0x44e3e7[_0xbbe5('0x2f')][_0xbbe5('0x30')]};});_0x4c0f30[_0xbbe5('0x31')]=_[_0xbbe5('0x2e')](_0x2e010a,_0xbbe5('0x2b'));_0x4c0f30[_0xbbe5('0x32')]=_[_0xbbe5('0x33')](_0xaa9123[_0xbbe5('0x32')]);_0x4c0f30[_0xbbe5('0x34')]=_['intersection'](_0x4c0f30[_0xbbe5('0x31')],_0x4c0f30['query']);_0x1455e2[_0xbbe5('0x35')]=_['intersection'](_0x4c0f30['model'],qs['fields'](_0xaa9123[_0xbbe5('0x32')][_0xbbe5('0x36')]));_0x1455e2['attributes']=_0x1455e2[_0xbbe5('0x35')][_0xbbe5('0x37')]?_0x1455e2[_0xbbe5('0x35')]:_0x4c0f30[_0xbbe5('0x31')];if(!_0xaa9123['query'][_0xbbe5('0x38')](_0xbbe5('0x39'))){_0x1455e2[_0xbbe5('0x3a')]=qs[_0xbbe5('0x3a')](_0xaa9123['query'][_0xbbe5('0x3a')]);_0x1455e2['offset']=qs[_0xbbe5('0x1d')](_0xaa9123[_0xbbe5('0x32')][_0xbbe5('0x1d')]);}_0x1455e2[_0xbbe5('0x3b')]=qs[_0xbbe5('0x3c')](_0xaa9123['query'][_0xbbe5('0x3c')]);_0x1455e2[_0xbbe5('0x3d')]=qs[_0xbbe5('0x34')](_['pick'](_0xaa9123[_0xbbe5('0x32')],_0x4c0f30[_0xbbe5('0x34')]),_0x2e010a);if(_0xaa9123['query'][_0xbbe5('0x3e')]){_0x1455e2[_0xbbe5('0x3d')]=_[_0xbbe5('0x3f')](_0x1455e2[_0xbbe5('0x3d')],{'$or':_[_0xbbe5('0x2e')](_0x2e010a,function(_0x3bc049){if(_0x3bc049['type']!==_0xbbe5('0x40')){var _0x3b4590={};_0x3b4590[_0x3bc049['name']]={'$like':'%'+_0xaa9123[_0xbbe5('0x32')]['filter']+'%'};return _0x3b4590;}})});}_0x1455e2=_[_0xbbe5('0x3f')]({},_0x1455e2,_0xaa9123[_0xbbe5('0x41')]);var _0x5b45ff={'where':_0x1455e2[_0xbbe5('0x3d')]};return db[_0xbbe5('0x42')][_0xbbe5('0x1c')](_0x5b45ff)[_0xbbe5('0x24')](function(_0x265108){_0x2ada64[_0xbbe5('0x1c')]=_0x265108;if(_0xaa9123[_0xbbe5('0x32')]['includeAll']){_0x1455e2[_0xbbe5('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbbe5('0x44')](_0x1455e2);})['then'](function(_0x543f57){_0x2ada64[_0xbbe5('0x45')]=_0x543f57;return _0x2ada64;})[_0xbbe5('0x24')](respondWithFilteredResult(_0x234182,_0x1455e2))['catch'](handleError(_0x234182,null));};exports['show']=function(_0x2f5664,_0xdd9bd){var _0x3d7068={'raw':!![],'where':{'id':_0x2f5664[_0xbbe5('0x46')]['id']}},_0x3b78ae={};_0x3b78ae['model']=_['keys'](db['CannedAnswer'][_0xbbe5('0x47')]);_0x3b78ae[_0xbbe5('0x32')]=_[_0xbbe5('0x33')](_0x2f5664['query']);_0x3b78ae['filters']=_[_0xbbe5('0x48')](_0x3b78ae['model'],_0x3b78ae[_0xbbe5('0x32')]);_0x3d7068['attributes']=_['intersection'](_0x3b78ae['model'],qs[_0xbbe5('0x36')](_0x2f5664[_0xbbe5('0x32')][_0xbbe5('0x36')]));_0x3d7068[_0xbbe5('0x35')]=_0x3d7068[_0xbbe5('0x35')][_0xbbe5('0x37')]?_0x3d7068['attributes']:_0x3b78ae[_0xbbe5('0x31')];if(_0x2f5664[_0xbbe5('0x32')][_0xbbe5('0x49')]){_0x3d7068[_0xbbe5('0x43')]=[{'all':!![]}];}_0x3d7068=_[_0xbbe5('0x3f')]({},_0x3d7068,_0x2f5664['options']);return db[_0xbbe5('0x42')][_0xbbe5('0x4a')](_0x3d7068)[_0xbbe5('0x24')](handleEntityNotFound(_0xdd9bd,null))[_0xbbe5('0x24')](respondWithResult(_0xdd9bd,null))[_0xbbe5('0x4b')](handleError(_0xdd9bd,null));};exports[_0xbbe5('0x23')]=function(_0x8ed020,_0x482cdf){if(_0x8ed020['body']['id']){delete _0x8ed020[_0xbbe5('0x4c')]['id'];}return db[_0xbbe5('0x42')][_0xbbe5('0x4a')]({'where':{'id':_0x8ed020[_0xbbe5('0x46')]['id']}})['then'](handleEntityNotFound(_0x482cdf,null))[_0xbbe5('0x24')](saveUpdates(_0x8ed020[_0xbbe5('0x4c')],null))['then'](respondWithResult(_0x482cdf,null))[_0xbbe5('0x4b')](handleError(_0x482cdf,null));};exports[_0xbbe5('0x25')]=function(_0x4945a7,_0x5d5ef5){return db[_0xbbe5('0x42')]['find']({'where':{'id':_0x4945a7['params']['id']}})['then'](handleEntityNotFound(_0x5d5ef5,null))['then'](removeEntity(_0x5d5ef5,null))['catch'](handleError(_0x5d5ef5,null));};exports[_0xbbe5('0x4d')]=function(_0x213446,_0x5a02b5){var _0x29846f={'key':_0x213446['body'][_0xbbe5('0x30')]};if(_0x213446[_0xbbe5('0x4c')]['MailAccountId']){_0x29846f[_0xbbe5('0x4e')]=_0x213446['body'][_0xbbe5('0x4e')];}else if(_0x213446[_0xbbe5('0x4c')][_0xbbe5('0x4f')]){_0x29846f['SmsAccountId']=_0x213446[_0xbbe5('0x4c')][_0xbbe5('0x4f')];}else if(_0x213446[_0xbbe5('0x4c')][_0xbbe5('0x50')]){_0x29846f[_0xbbe5('0x50')]=_0x213446[_0xbbe5('0x4c')]['OpenchannelAccountId'];}else if(_0x213446['body']['ChatWebsiteId']){_0x29846f[_0xbbe5('0x51')]=_0x213446['body'][_0xbbe5('0x51')];}return db[_0xbbe5('0x42')][_0xbbe5('0x4a')]({'where':_0x29846f})[_0xbbe5('0x24')](function(_0x1b05ba){if(_0x1b05ba){throw new db[(_0xbbe5('0x52'))][(_0xbbe5('0x53'))](_0xbbe5('0x54'));}return db['CannedAnswer'][_0xbbe5('0x4d')](_0x213446[_0xbbe5('0x4c')]);})[_0xbbe5('0x24')](function(_0x5f1ef9){var _0x1b1bc0=_0x213446[_0xbbe5('0x55')][_0xbbe5('0x26')]({'plain':!![]});if(!_0x1b1bc0)throw new Error(_0xbbe5('0x56'));if(_0x1b1bc0[_0xbbe5('0x57')]===_0xbbe5('0x55')){var _0x38e45b=_0x5f1ef9[_0xbbe5('0x26')]({'plain':!![]});return db[_0xbbe5('0x58')][_0xbbe5('0x4a')]({'where':{'name':_0xbbe5('0x59'),'userProfileId':_0x1b1bc0[_0xbbe5('0x5a')]},'raw':!![]})[_0xbbe5('0x24')](function(_0x15d753){if(_0x15d753&&_0x15d753[_0xbbe5('0x5b')]===0x0){return db[_0xbbe5('0x27')][_0xbbe5('0x4d')]({'name':_0x38e45b[_0xbbe5('0x2b')],'resourceId':_0x38e45b['id'],'type':_0x15d753['name'],'sectionId':_0x15d753['id']},{})[_0xbbe5('0x24')](function(){return _0x5f1ef9;});}else{return _0x5f1ef9;}})[_0xbbe5('0x4b')](function(_0x9eaa83){logger[_0xbbe5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9eaa83);throw _0x9eaa83;});}return _0x5f1ef9;})[_0xbbe5('0x24')](respondWithResult(_0x5a02b5,0xc9))['catch'](handleError(_0x5a02b5,null));}; \ No newline at end of file +var _0xeb1f=['request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','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','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','update','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x50fecb,_0x2b0104){var _0x567fb5=function(_0x48d35c){while(--_0x48d35c){_0x50fecb['push'](_0x50fecb['shift']());}};_0x567fb5(++_0x2b0104);}(_0xeb1f,0x113));var _0xfeb1=function(_0x1e7d14,_0x16ea12){_0x1e7d14=_0x1e7d14-0x0;var _0x27777b=_0xeb1f[_0x1e7d14];return _0x27777b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfeb1('0x0'));var rimraf=require(_0xfeb1('0x1'));var zipdir=require(_0xfeb1('0x2'));var jsonpatch=require(_0xfeb1('0x3'));var rp=require(_0xfeb1('0x4'));var moment=require(_0xfeb1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfeb1('0x6'));var util=require(_0xfeb1('0x7'));var path=require(_0xfeb1('0x8'));var sox=require(_0xfeb1('0x9'));var csv=require(_0xfeb1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfeb1('0xb'));var squel=require(_0xfeb1('0xc'));var crypto=require(_0xfeb1('0xd'));var jsforce=require(_0xfeb1('0xe'));var deskjs=require(_0xfeb1('0xf'));var toCsv=require(_0xfeb1('0xa'));var querystring=require(_0xfeb1('0x10'));var Papa=require(_0xfeb1('0x11'));var Redis=require(_0xfeb1('0x12'));var authService=require(_0xfeb1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfeb1('0x14'));var hardwareService=require(_0xfeb1('0x15'));var logger=require(_0xfeb1('0x16'))(_0xfeb1('0x17'));var utils=require('../../config/utils');var config=require(_0xfeb1('0x18'));var db=require(_0xfeb1('0x19'))['db'];function respondWithStatusCode(_0x4eb22e,_0x51c9b9){_0x51c9b9=_0x51c9b9||0xcc;return function(_0x95c4a7){if(_0x95c4a7){return _0x4eb22e[_0xfeb1('0x1a')](_0x51c9b9);}return _0x4eb22e[_0xfeb1('0x1b')](_0x51c9b9)[_0xfeb1('0x1c')]();};}function respondWithResult(_0x5885eb,_0x2897bd){_0x2897bd=_0x2897bd||0xc8;return function(_0x586aed){if(_0x586aed){return _0x5885eb[_0xfeb1('0x1b')](_0x2897bd)[_0xfeb1('0x1d')](_0x586aed);}};}function respondWithFilteredResult(_0x2e850f,_0x3b4d4c){return function(_0x7f7921){if(_0x7f7921){var _0x3243ff=_0x7f7921[_0xfeb1('0x1e')],_0xf9bca2=_0x3b4d4c[_0xfeb1('0x1f')],_0x5933f0=_0x3b4d4c[_0xfeb1('0x1f')]+_0x3b4d4c[_0xfeb1('0x20')],_0x1c455b;if(_0x5933f0>=_0x3243ff){_0x5933f0=_0x3243ff;_0x1c455b=0xc8;}else{_0x1c455b=0xce;}_0x2e850f[_0xfeb1('0x1b')](_0x1c455b);return _0x2e850f[_0xfeb1('0x21')](_0xfeb1('0x22'),_0xf9bca2+'-'+_0x5933f0+'/'+_0x3243ff)[_0xfeb1('0x1d')](_0x7f7921);}return null;};}function patchUpdates(_0x9fd156){return function(_0xadaadd){try{jsonpatch[_0xfeb1('0x23')](_0xadaadd,_0x9fd156,!![]);}catch(_0x598780){return BPromise[_0xfeb1('0x24')](_0x598780);}return _0xadaadd[_0xfeb1('0x25')]();};}function saveUpdates(_0x301cb4,_0x41cf91){return function(_0x3e69db){if(_0x3e69db){return _0x3e69db['update'](_0x301cb4)['then'](function(_0x406c45){return _0x406c45;});}return null;};}function removeEntity(_0x333b7c,_0x2ddd4b){return function(_0x23dbb0){if(_0x23dbb0){return _0x23dbb0[_0xfeb1('0x26')]()[_0xfeb1('0x27')](function(){var _0x9dbbdf=_0x23dbb0[_0xfeb1('0x28')]({'plain':!![]});var _0x4f7266=_0xfeb1('0x29');return db[_0xfeb1('0x2a')][_0xfeb1('0x26')]({'where':{'type':_0x4f7266,'resourceId':_0x9dbbdf['id']}})[_0xfeb1('0x27')](function(){return _0x23dbb0;});})[_0xfeb1('0x27')](function(){_0x333b7c[_0xfeb1('0x1b')](0xcc)[_0xfeb1('0x1c')]();});}};}function handleEntityNotFound(_0x478b2c,_0x4d627b){return function(_0x49b6b1){if(!_0x49b6b1){_0x478b2c[_0xfeb1('0x1a')](0x194);}return _0x49b6b1;};}function handleError(_0x2bfae3,_0x3d5f2b){_0x3d5f2b=_0x3d5f2b||0x1f4;return function(_0x4a0d76){logger['error'](_0x4a0d76[_0xfeb1('0x2b')]);if(_0x4a0d76['name']){delete _0x4a0d76[_0xfeb1('0x2c')];}_0x2bfae3[_0xfeb1('0x1b')](_0x3d5f2b)['send'](_0x4a0d76);};}exports['index']=function(_0x5e66c3,_0xcd72c4){var _0x37430e={},_0x1879f2={},_0x5496cf={'count':0x0,'rows':[]};var _0x1aea40=_[_0xfeb1('0x2d')](db[_0xfeb1('0x2e')][_0xfeb1('0x2f')],function(_0x55db3c){return{'name':_0x55db3c[_0xfeb1('0x30')],'type':_0x55db3c[_0xfeb1('0x31')][_0xfeb1('0x32')]};});_0x1879f2[_0xfeb1('0x33')]=_['map'](_0x1aea40,_0xfeb1('0x2c'));_0x1879f2[_0xfeb1('0x34')]=_[_0xfeb1('0x35')](_0x5e66c3[_0xfeb1('0x34')]);_0x1879f2['filters']=_[_0xfeb1('0x36')](_0x1879f2[_0xfeb1('0x33')],_0x1879f2['query']);_0x37430e[_0xfeb1('0x37')]=_[_0xfeb1('0x36')](_0x1879f2[_0xfeb1('0x33')],qs[_0xfeb1('0x38')](_0x5e66c3[_0xfeb1('0x34')][_0xfeb1('0x38')]));_0x37430e[_0xfeb1('0x37')]=_0x37430e['attributes']['length']?_0x37430e['attributes']:_0x1879f2['model'];if(!_0x5e66c3[_0xfeb1('0x34')][_0xfeb1('0x39')](_0xfeb1('0x3a'))){_0x37430e['limit']=qs[_0xfeb1('0x20')](_0x5e66c3[_0xfeb1('0x34')][_0xfeb1('0x20')]);_0x37430e['offset']=qs[_0xfeb1('0x1f')](_0x5e66c3['query'][_0xfeb1('0x1f')]);}_0x37430e[_0xfeb1('0x3b')]=qs[_0xfeb1('0x3c')](_0x5e66c3[_0xfeb1('0x34')][_0xfeb1('0x3c')]);_0x37430e['where']=qs[_0xfeb1('0x3d')](_[_0xfeb1('0x3e')](_0x5e66c3['query'],_0x1879f2[_0xfeb1('0x3d')]),_0x1aea40);if(_0x5e66c3[_0xfeb1('0x34')]['filter']){_0x37430e[_0xfeb1('0x3f')]=_['merge'](_0x37430e[_0xfeb1('0x3f')],{'$or':_['map'](_0x1aea40,function(_0x281273){if(_0x281273[_0xfeb1('0x31')]!==_0xfeb1('0x40')){var _0x264bb5={};_0x264bb5[_0x281273[_0xfeb1('0x2c')]]={'$like':'%'+_0x5e66c3['query'][_0xfeb1('0x41')]+'%'};return _0x264bb5;}})});}_0x37430e=_[_0xfeb1('0x42')]({},_0x37430e,_0x5e66c3[_0xfeb1('0x43')]);var _0x29f279={'where':_0x37430e[_0xfeb1('0x3f')]};return db[_0xfeb1('0x2e')]['count'](_0x29f279)[_0xfeb1('0x27')](function(_0x36eaad){_0x5496cf['count']=_0x36eaad;if(_0x5e66c3[_0xfeb1('0x34')][_0xfeb1('0x44')]){_0x37430e['include']=[{'all':!![]}];}return db[_0xfeb1('0x2e')][_0xfeb1('0x45')](_0x37430e);})[_0xfeb1('0x27')](function(_0x2476dc){_0x5496cf[_0xfeb1('0x46')]=_0x2476dc;return _0x5496cf;})[_0xfeb1('0x27')](respondWithFilteredResult(_0xcd72c4,_0x37430e))[_0xfeb1('0x47')](handleError(_0xcd72c4,null));};exports[_0xfeb1('0x48')]=function(_0x2e538b,_0x3a8325){var _0x46e02d={'raw':!![],'where':{'id':_0x2e538b['params']['id']}},_0x18edb3={};_0x18edb3[_0xfeb1('0x33')]=_['keys'](db[_0xfeb1('0x2e')][_0xfeb1('0x2f')]);_0x18edb3[_0xfeb1('0x34')]=_[_0xfeb1('0x35')](_0x2e538b['query']);_0x18edb3['filters']=_['intersection'](_0x18edb3[_0xfeb1('0x33')],_0x18edb3[_0xfeb1('0x34')]);_0x46e02d[_0xfeb1('0x37')]=_[_0xfeb1('0x36')](_0x18edb3[_0xfeb1('0x33')],qs['fields'](_0x2e538b[_0xfeb1('0x34')][_0xfeb1('0x38')]));_0x46e02d[_0xfeb1('0x37')]=_0x46e02d[_0xfeb1('0x37')]['length']?_0x46e02d[_0xfeb1('0x37')]:_0x18edb3['model'];if(_0x2e538b[_0xfeb1('0x34')]['includeAll']){_0x46e02d[_0xfeb1('0x49')]=[{'all':!![]}];}_0x46e02d=_[_0xfeb1('0x42')]({},_0x46e02d,_0x2e538b[_0xfeb1('0x43')]);return db[_0xfeb1('0x2e')][_0xfeb1('0x4a')](_0x46e02d)['then'](handleEntityNotFound(_0x3a8325,null))['then'](respondWithResult(_0x3a8325,null))[_0xfeb1('0x47')](handleError(_0x3a8325,null));};exports[_0xfeb1('0x4b')]=function(_0x3a1251,_0x1b1559){if(_0x3a1251[_0xfeb1('0x4c')]['id']){delete _0x3a1251[_0xfeb1('0x4c')]['id'];}return db[_0xfeb1('0x2e')][_0xfeb1('0x4a')]({'where':{'id':_0x3a1251[_0xfeb1('0x4d')]['id']}})[_0xfeb1('0x27')](handleEntityNotFound(_0x1b1559,null))[_0xfeb1('0x27')](saveUpdates(_0x3a1251[_0xfeb1('0x4c')],null))[_0xfeb1('0x27')](respondWithResult(_0x1b1559,null))[_0xfeb1('0x47')](handleError(_0x1b1559,null));};exports[_0xfeb1('0x26')]=function(_0x20d951,_0x3105e9){return db[_0xfeb1('0x2e')]['find']({'where':{'id':_0x20d951[_0xfeb1('0x4d')]['id']}})[_0xfeb1('0x27')](handleEntityNotFound(_0x3105e9,null))['then'](removeEntity(_0x3105e9,null))[_0xfeb1('0x47')](handleError(_0x3105e9,null));};exports['create']=function(_0x237296,_0x309990){var _0x1485d3={'key':_0x237296[_0xfeb1('0x4c')]['key']};if(_0x237296[_0xfeb1('0x4c')][_0xfeb1('0x4e')]){_0x1485d3['MailAccountId']=_0x237296[_0xfeb1('0x4c')]['MailAccountId'];}else if(_0x237296[_0xfeb1('0x4c')][_0xfeb1('0x4f')]){_0x1485d3[_0xfeb1('0x4f')]=_0x237296[_0xfeb1('0x4c')]['SmsAccountId'];}else if(_0x237296['body'][_0xfeb1('0x50')]){_0x1485d3[_0xfeb1('0x50')]=_0x237296[_0xfeb1('0x4c')][_0xfeb1('0x50')];}else if(_0x237296[_0xfeb1('0x4c')][_0xfeb1('0x51')]){_0x1485d3[_0xfeb1('0x51')]=_0x237296['body']['ChatWebsiteId'];}return db[_0xfeb1('0x2e')][_0xfeb1('0x4a')]({'where':_0x1485d3})[_0xfeb1('0x27')](function(_0x4dc2aa){if(_0x4dc2aa){throw new db[(_0xfeb1('0x52'))]['ValidationError'](_0xfeb1('0x53'));}return db[_0xfeb1('0x2e')][_0xfeb1('0x54')](_0x237296['body']);})[_0xfeb1('0x27')](function(_0x2db91e){var _0x1372d7=_0x237296[_0xfeb1('0x55')]['get']({'plain':!![]});if(!_0x1372d7)throw new Error(_0xfeb1('0x56'));if(_0x1372d7[_0xfeb1('0x57')]===_0xfeb1('0x55')){var _0x5e6b5e=_0x2db91e['get']({'plain':!![]});return db[_0xfeb1('0x58')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x1372d7[_0xfeb1('0x59')]},'raw':!![]})[_0xfeb1('0x27')](function(_0x971c37){if(_0x971c37&&_0x971c37[_0xfeb1('0x5a')]===0x0){return db['UserProfileResource'][_0xfeb1('0x54')]({'name':_0x5e6b5e[_0xfeb1('0x2c')],'resourceId':_0x5e6b5e['id'],'type':_0x971c37['name'],'sectionId':_0x971c37['id']},{})['then'](function(){return _0x2db91e;});}else{return _0x2db91e;}})[_0xfeb1('0x47')](function(_0x89f6e2){logger[_0xfeb1('0x5b')](_0xfeb1('0x5c'),_0x89f6e2);throw _0x89f6e2;});}return _0x2db91e;})['then'](respondWithResult(_0x309990,0xc9))[_0xfeb1('0x47')](handleError(_0x309990,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6124b5a..0719180 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 _0x26d1=['api','moment','bluebird','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x530bae,_0x34babc){var _0x40c385=function(_0x2dfc23){while(--_0x2dfc23){_0x530bae['push'](_0x530bae['shift']());}};_0x40c385(++_0x34babc);}(_0x26d1,0x8e));var _0x126d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x26d1[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x126d('0x0'));var util=require('util');var logger=require(_0x126d('0x1'))(_0x126d('0x2'));var moment=require(_0x126d('0x3'));var BPromise=require(_0x126d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x126d('0x5'));var config=require('../../config/environment');var attributes=require(_0x126d('0x6'));module[_0x126d('0x7')]=function(_0x442e04,_0x449ed0){return _0x442e04[_0x126d('0x8')]('CannedAnswer',attributes,{'tableName':_0x126d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x126d('0xa'),'collate':_0x126d('0xb')});}; \ No newline at end of file +var _0xf725=['../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0x2b5880,_0x86beda){_0x2b5880=_0x2b5880-0x0;var _0x1c0979=_0xf725[_0x2b5880];return _0x1c0979;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var logger=require(_0x5f72('0x2'))(_0x5f72('0x3'));var moment=require(_0x5f72('0x4'));var BPromise=require(_0x5f72('0x5'));var rp=require(_0x5f72('0x6'));var fs=require('fs');var path=require(_0x5f72('0x7'));var rimraf=require(_0x5f72('0x8'));var config=require(_0x5f72('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x5f72('0xa')]=function(_0x14a92d,_0x3f2ca7){return _0x14a92d[_0x5f72('0xb')](_0x5f72('0xc'),attributes,{'tableName':_0x5f72('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f72('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 4d1f807..922da8a 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 _0x8286=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird'];(function(_0x4c0de7,_0x569db4){var _0x4acbb8=function(_0x35b844){while(--_0x35b844){_0x4c0de7['push'](_0x4c0de7['shift']());}};_0x4acbb8(++_0x569db4);}(_0x8286,0xc2));var _0x6828=function(_0x45d51b,_0x5593bc){_0x45d51b=_0x45d51b-0x0;var _0x5026f8=_0x8286[_0x45d51b];return _0x5026f8;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var moment=require(_0x6828('0x2'));var BPromise=require(_0x6828('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6828('0x4'));var db=require(_0x6828('0x5'))['db'];var utils=require(_0x6828('0x6'));var logger=require(_0x6828('0x7'))(_0x6828('0x8'));var config=require(_0x6828('0x9'));var jayson=require(_0x6828('0xa'));var client=jayson[_0x6828('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26725e,_0x589804,_0x337b6c){return new BPromise(function(_0x48fadd,_0x257b71){return client[_0x6828('0xc')](_0x26725e,_0x337b6c)[_0x6828('0xd')](function(_0x5d3110){logger[_0x6828('0xe')](_0x6828('0xf'),_0x589804,'request\x20sent');logger[_0x6828('0x10')](_0x6828('0x11'),_0x589804,_0x6828('0x12'),JSON['stringify'](_0x5d3110));if(_0x5d3110[_0x6828('0x13')]){if(_0x5d3110[_0x6828('0x13')][_0x6828('0x14')]===0x1f4){logger[_0x6828('0x13')](_0x6828('0xf'),_0x589804,_0x5d3110[_0x6828('0x13')]['message']);return _0x257b71(_0x5d3110[_0x6828('0x13')][_0x6828('0x15')]);}logger[_0x6828('0x13')](_0x6828('0xf'),_0x589804,_0x5d3110[_0x6828('0x13')][_0x6828('0x15')]);return _0x48fadd(_0x5d3110[_0x6828('0x13')][_0x6828('0x15')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x589804,_0x6828('0x12'));_0x48fadd(_0x5d3110['result'][_0x6828('0x15')]);}})['catch'](function(_0x1b8956){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x589804,_0x1b8956);_0x257b71(_0x1b8956);});});} \ No newline at end of file +var _0x7b84=['lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2efc07,_0x427db4){var _0xb625c8=function(_0x26caff){while(--_0x26caff){_0x2efc07['push'](_0x2efc07['shift']());}};_0xb625c8(++_0x427db4);}(_0x7b84,0xab));var _0x47b8=function(_0x2d7d6e,_0x11ada3){_0x2d7d6e=_0x2d7d6e-0x0;var _0x198cc9=_0x7b84[_0x2d7d6e];return _0x198cc9;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x47b8('0x2'));var fs=require('fs');var Redis=require(_0x47b8('0x3'));var db=require(_0x47b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x47b8('0x5'));var config=require(_0x47b8('0x6'));var jayson=require(_0x47b8('0x7'));var client=jayson[_0x47b8('0x8')][_0x47b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x189627,_0x39f6c1,_0x209a86){return new BPromise(function(_0x2300d3,_0x4cfd25){return client['request'](_0x189627,_0x209a86)['then'](function(_0x347856){logger[_0x47b8('0xa')](_0x47b8('0xb'),_0x39f6c1,_0x47b8('0xc'));logger['debug'](_0x47b8('0xd'),_0x39f6c1,_0x47b8('0xc'),JSON[_0x47b8('0xe')](_0x347856));if(_0x347856[_0x47b8('0xf')]){if(_0x347856[_0x47b8('0xf')][_0x47b8('0x10')]===0x1f4){logger['error'](_0x47b8('0xb'),_0x39f6c1,_0x347856['error'][_0x47b8('0x11')]);return _0x4cfd25(_0x347856['error'][_0x47b8('0x11')]);}logger['error'](_0x47b8('0xb'),_0x39f6c1,_0x347856[_0x47b8('0xf')][_0x47b8('0x11')]);return _0x2300d3(_0x347856['error'][_0x47b8('0x11')]);}else{logger[_0x47b8('0xa')](_0x47b8('0xb'),_0x39f6c1,'request\x20sent');_0x2300d3(_0x347856[_0x47b8('0x12')][_0x47b8('0x11')]);}})['catch'](function(_0x149da4){logger[_0x47b8('0xf')](_0x47b8('0xb'),_0x39f6c1,_0x149da4);_0x4cfd25(_0x149da4);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index a9b9e3d..8254a68 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 _0x051e=['get','isAuthenticated','index','create','put','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller'];(function(_0x3614e1,_0x32fa38){var _0x357310=function(_0x17a0f3){while(--_0x17a0f3){_0x3614e1['push'](_0x3614e1['shift']());}};_0x357310(++_0x32fa38);}(_0x051e,0xb8));var _0xe051=function(_0x544561,_0x3f006d){_0x544561=_0x544561-0x0;var _0x1ffd67=_0x051e[_0x544561];return _0x1ffd67;};'use strict';var multer=require(_0xe051('0x0'));var util=require('util');var path=require(_0xe051('0x1'));var timeout=require(_0xe051('0x2'));var express=require(_0xe051('0x3'));var router=express[_0xe051('0x4')]();var auth=require(_0xe051('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe051('0x6'));var controller=require(_0xe051('0x7'));router[_0xe051('0x8')]('/',auth[_0xe051('0x9')](),controller[_0xe051('0xa')]);router[_0xe051('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe051('0x9')](),controller[_0xe051('0xb')]);router[_0xe051('0xc')]('/:id',auth[_0xe051('0x9')](),controller['update']);router[_0xe051('0xd')](_0xe051('0xe'),auth[_0xe051('0x9')](),controller['destroy']);module[_0xe051('0xf')]=router; \ No newline at end of file +var _0x35c8=['/:id','show','post','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','./cannedAnswer.controller','isAuthenticated','get'];(function(_0x1d6c20,_0x45d9c2){var _0xab8304=function(_0xeb158b){while(--_0xeb158b){_0x1d6c20['push'](_0x1d6c20['shift']());}};_0xab8304(++_0x45d9c2);}(_0x35c8,0x125));var _0x835c=function(_0x135365,_0x21fb8d){_0x135365=_0x135365-0x0;var _0x5eb255=_0x35c8[_0x135365];return _0x5eb255;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x835c('0x0'));var timeout=require('connect-timeout');var express=require(_0x835c('0x1'));var router=express[_0x835c('0x2')]();var auth=require(_0x835c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x835c('0x4'));router['get']('/',auth[_0x835c('0x5')](),controller['index']);router[_0x835c('0x6')](_0x835c('0x7'),auth['isAuthenticated'](),controller[_0x835c('0x8')]);router[_0x835c('0x9')]('/',auth[_0x835c('0x5')](),controller[_0x835c('0xa')]);router['put'](_0x835c('0x7'),auth[_0x835c('0x5')](),controller[_0x835c('0xb')]);router[_0x835c('0xc')](_0x835c('0x7'),auth['isAuthenticated'](),controller[_0x835c('0xd')]);module[_0x835c('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f66a682..b76a681 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 _0x6899=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x513a3c,_0xf6029d){var _0x1d7f50=function(_0x5d0c8b){while(--_0x5d0c8b){_0x513a3c['push'](_0x513a3c['shift']());}};_0x1d7f50(++_0xf6029d);}(_0x6899,0x1ab));var _0x9689=function(_0x203acc,_0x4338dc){_0x203acc=_0x203acc-0x0;var _0x133dc7=_0x6899[_0x203acc];return _0x133dc7;};'use strict';var Sequelize=require('sequelize');module[_0x9689('0x0')]={'calldate':{'type':Sequelize[_0x9689('0x1')],'allowNull':![],'defaultValue':_0x9689('0x2')},'clid':{'type':Sequelize[_0x9689('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x9689('0x3')]},'dcontext':{'type':Sequelize[_0x9689('0x3')]},'channel':{'type':Sequelize[_0x9689('0x3')]},'dstchannel':{'type':Sequelize[_0x9689('0x3')]},'lastapp':{'type':Sequelize[_0x9689('0x3')]},'lastdata':{'type':Sequelize[_0x9689('0x3')]},'duration':{'type':Sequelize[_0x9689('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9689('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9689('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9689('0x3')]},'userfield':{'type':Sequelize[_0x9689('0x3')]},'uniqueid':{'type':Sequelize[_0x9689('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x9689('0x3')]},'peeraccount':{'type':Sequelize[_0x9689('0x3')]},'type':{'type':Sequelize[_0x9689('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x109b=['INTEGER','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x57e8e9,_0x59b275){var _0x1f1a6d=function(_0x23038f){while(--_0x23038f){_0x57e8e9['push'](_0x57e8e9['shift']());}};_0x1f1a6d(++_0x59b275);}(_0x109b,0x119));var _0xb109=function(_0x3588e7,_0x342e30){_0x3588e7=_0x3588e7-0x0;var _0x607444=_0x109b[_0x3588e7];return _0x607444;};'use strict';var Sequelize=require('sequelize');module[_0xb109('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb109('0x1')},'clid':{'type':Sequelize[_0xb109('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb109('0x2')]},'channel':{'type':Sequelize[_0xb109('0x2')]},'dstchannel':{'type':Sequelize[_0xb109('0x2')]},'lastapp':{'type':Sequelize[_0xb109('0x2')]},'lastdata':{'type':Sequelize[_0xb109('0x2')]},'duration':{'type':Sequelize[_0xb109('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb109('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb109('0x2')]},'amaflags':{'type':Sequelize[_0xb109('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb109('0x2')]},'uniqueid':{'type':Sequelize[_0xb109('0x2')]},'linkedid':{'type':Sequelize[_0xb109('0x2')]},'sequence':{'type':Sequelize[_0xb109('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb109('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 46ecd0e..e6766d5 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 _0x6000=['bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','reject','then','destroy','end','error','stack','send','index','Cdr','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x18ad14,_0x4a4127){var _0x511e6e=function(_0x57c889){while(--_0x57c889){_0x18ad14['push'](_0x18ad14['shift']());}};_0x511e6e(++_0x4a4127);}(_0x6000,0xd7));var _0x0600=function(_0x50d401,_0x49c3ba){_0x50d401=_0x50d401-0x0;var _0xc462ed=_0x6000[_0x50d401];return _0xc462ed;};'use strict';var pdf=require(_0x0600('0x0'));var emlformat=require(_0x0600('0x1'));var rimraf=require(_0x0600('0x2'));var zipdir=require(_0x0600('0x3'));var jsonpatch=require(_0x0600('0x4'));var rp=require(_0x0600('0x5'));var moment=require(_0x0600('0x6'));var BPromise=require(_0x0600('0x7'));var Mustache=require(_0x0600('0x8'));var util=require('util');var path=require(_0x0600('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0600('0xa'));var squel=require(_0x0600('0xb'));var crypto=require(_0x0600('0xc'));var jsforce=require(_0x0600('0xd'));var deskjs=require(_0x0600('0xe'));var toCsv=require(_0x0600('0xf'));var querystring=require(_0x0600('0x10'));var Papa=require(_0x0600('0x11'));var Redis=require('ioredis');var authService=require(_0x0600('0x12'));var qs=require(_0x0600('0x13'));var as=require(_0x0600('0x14'));var hardwareService=require(_0x0600('0x15'));var logger=require(_0x0600('0x16'))('api');var utils=require(_0x0600('0x17'));var config=require(_0x0600('0x18'));var db=require(_0x0600('0x19'))['db'];function respondWithStatusCode(_0x3b1f1f,_0x1147db){_0x1147db=_0x1147db||0xcc;return function(_0xbdf8c1){if(_0xbdf8c1){return _0x3b1f1f[_0x0600('0x1a')](_0x1147db);}return _0x3b1f1f['status'](_0x1147db)['end']();};}function respondWithResult(_0x448a1a,_0x27811c){_0x27811c=_0x27811c||0xc8;return function(_0x14d7fd){if(_0x14d7fd){return _0x448a1a['status'](_0x27811c)[_0x0600('0x1b')](_0x14d7fd);}};}function respondWithFilteredResult(_0x536247,_0x4b4961){return function(_0x429874){if(_0x429874){var _0x42b1f2=_0x429874[_0x0600('0x1c')],_0x368165=_0x4b4961[_0x0600('0x1d')],_0x40d82d=_0x4b4961[_0x0600('0x1d')]+_0x4b4961[_0x0600('0x1e')],_0x3b23c9;if(_0x40d82d>=_0x42b1f2){_0x40d82d=_0x42b1f2;_0x3b23c9=0xc8;}else{_0x3b23c9=0xce;}_0x536247[_0x0600('0x1f')](_0x3b23c9);return _0x536247[_0x0600('0x20')](_0x0600('0x21'),_0x368165+'-'+_0x40d82d+'/'+_0x42b1f2)[_0x0600('0x1b')](_0x429874);}return null;};}function patchUpdates(_0x2ef193){return function(_0x1ebac6){try{jsonpatch['apply'](_0x1ebac6,_0x2ef193,!![]);}catch(_0x5e3323){return BPromise[_0x0600('0x22')](_0x5e3323);}return _0x1ebac6['save']();};}function saveUpdates(_0x56a5a9,_0x16352e){return function(_0x534bca){if(_0x534bca){return _0x534bca['update'](_0x56a5a9)[_0x0600('0x23')](function(_0x58f7a4){return _0x58f7a4;});}return null;};}function removeEntity(_0x126448,_0x50ceaf){return function(_0x3e7b87){if(_0x3e7b87){return _0x3e7b87[_0x0600('0x24')]()[_0x0600('0x23')](function(){_0x126448[_0x0600('0x1f')](0xcc)[_0x0600('0x25')]();});}};}function handleEntityNotFound(_0x40d3f0,_0x189a56){return function(_0x5ef3e6){if(!_0x5ef3e6){_0x40d3f0[_0x0600('0x1a')](0x194);}return _0x5ef3e6;};}function handleError(_0x31e6cc,_0x544c9c){_0x544c9c=_0x544c9c||0x1f4;return function(_0xd1fa91){logger[_0x0600('0x26')](_0xd1fa91[_0x0600('0x27')]);if(_0xd1fa91['name']){delete _0xd1fa91['name'];}_0x31e6cc[_0x0600('0x1f')](_0x544c9c)[_0x0600('0x28')](_0xd1fa91);};}exports[_0x0600('0x29')]=function(_0x5b1886,_0x3a3c39){var _0x378361={},_0x62a29c={},_0xbe1af8={'count':0x0,'rows':[]};var _0x191185=_['map'](db[_0x0600('0x2a')][_0x0600('0x2b')],function(_0xb9d968){return{'name':_0xb9d968[_0x0600('0x2c')],'type':_0xb9d968['type'][_0x0600('0x2d')]};});_0x62a29c[_0x0600('0x2e')]=_[_0x0600('0x2f')](_0x191185,_0x0600('0x30'));_0x62a29c[_0x0600('0x31')]=_[_0x0600('0x32')](_0x5b1886[_0x0600('0x31')]);_0x62a29c[_0x0600('0x33')]=_[_0x0600('0x34')](_0x62a29c[_0x0600('0x2e')],_0x62a29c[_0x0600('0x31')]);_0x378361[_0x0600('0x35')]=_[_0x0600('0x34')](_0x62a29c[_0x0600('0x2e')],qs['fields'](_0x5b1886['query'][_0x0600('0x36')]));_0x378361[_0x0600('0x35')]=_0x378361[_0x0600('0x35')][_0x0600('0x37')]?_0x378361['attributes']:_0x62a29c[_0x0600('0x2e')];if(!_0x5b1886[_0x0600('0x31')]['hasOwnProperty'](_0x0600('0x38'))){_0x378361[_0x0600('0x1e')]=qs[_0x0600('0x1e')](_0x5b1886['query'][_0x0600('0x1e')]);_0x378361['offset']=qs[_0x0600('0x1d')](_0x5b1886['query'][_0x0600('0x1d')]);}_0x378361['order']=qs['sort'](_0x5b1886[_0x0600('0x31')]['sort']);_0x378361[_0x0600('0x39')]=qs[_0x0600('0x33')](_[_0x0600('0x3a')](_0x5b1886[_0x0600('0x31')],_0x62a29c[_0x0600('0x33')]),_0x191185);if(_0x5b1886[_0x0600('0x31')][_0x0600('0x3b')]){_0x378361[_0x0600('0x39')]=_[_0x0600('0x3c')](_0x378361['where'],{'$or':_[_0x0600('0x2f')](_0x191185,function(_0x22fd82){if(_0x22fd82[_0x0600('0x3d')]!==_0x0600('0x3e')){var _0x496f33={};_0x496f33[_0x22fd82[_0x0600('0x30')]]={'$like':'%'+_0x5b1886[_0x0600('0x31')][_0x0600('0x3b')]+'%'};return _0x496f33;}})});}_0x378361=_[_0x0600('0x3c')]({},_0x378361,_0x5b1886[_0x0600('0x3f')]);var _0x2b89bd={'where':_0x378361[_0x0600('0x39')]};return db[_0x0600('0x2a')][_0x0600('0x1c')](_0x2b89bd)[_0x0600('0x23')](function(_0x2d179b){_0xbe1af8[_0x0600('0x1c')]=_0x2d179b;if(_0x5b1886[_0x0600('0x31')]['includeAll']){_0x378361['include']=[{'all':!![]}];}return db[_0x0600('0x2a')][_0x0600('0x40')](_0x378361);})[_0x0600('0x23')](function(_0x5dd571){_0xbe1af8[_0x0600('0x41')]=_0x5dd571;return _0xbe1af8;})['then'](respondWithFilteredResult(_0x3a3c39,_0x378361))[_0x0600('0x42')](handleError(_0x3a3c39,null));};exports[_0x0600('0x43')]=function(_0x289cfd,_0x479a61){var _0x4c3e4f={'raw':!![],'where':{'id':_0x289cfd[_0x0600('0x44')]['id']}},_0x32fe70={};_0x32fe70[_0x0600('0x2e')]=_[_0x0600('0x32')](db['Cdr'][_0x0600('0x2b')]);_0x32fe70[_0x0600('0x31')]=_[_0x0600('0x32')](_0x289cfd[_0x0600('0x31')]);_0x32fe70['filters']=_[_0x0600('0x34')](_0x32fe70[_0x0600('0x2e')],_0x32fe70[_0x0600('0x31')]);_0x4c3e4f[_0x0600('0x35')]=_[_0x0600('0x34')](_0x32fe70[_0x0600('0x2e')],qs[_0x0600('0x36')](_0x289cfd[_0x0600('0x31')][_0x0600('0x36')]));_0x4c3e4f['attributes']=_0x4c3e4f['attributes'][_0x0600('0x37')]?_0x4c3e4f[_0x0600('0x35')]:_0x32fe70[_0x0600('0x2e')];if(_0x289cfd[_0x0600('0x31')][_0x0600('0x45')]){_0x4c3e4f[_0x0600('0x46')]=[{'all':!![]}];}_0x4c3e4f=_[_0x0600('0x3c')]({},_0x4c3e4f,_0x289cfd['options']);return db[_0x0600('0x2a')][_0x0600('0x47')](_0x4c3e4f)[_0x0600('0x23')](handleEntityNotFound(_0x479a61,null))[_0x0600('0x23')](respondWithResult(_0x479a61,null))['catch'](handleError(_0x479a61,null));};exports[_0x0600('0x48')]=function(_0x20edfb,_0x26fd37){return db['Cdr']['create'](_0x20edfb[_0x0600('0x49')],{})['then'](respondWithResult(_0x26fd37,0xc9))['catch'](handleError(_0x26fd37,null));};exports['update']=function(_0x16e2ef,_0x181fc9){if(_0x16e2ef[_0x0600('0x49')]['id']){delete _0x16e2ef[_0x0600('0x49')]['id'];}return db[_0x0600('0x2a')][_0x0600('0x47')]({'where':{'id':_0x16e2ef['params']['id']}})[_0x0600('0x23')](handleEntityNotFound(_0x181fc9,null))[_0x0600('0x23')](saveUpdates(_0x16e2ef[_0x0600('0x49')],null))[_0x0600('0x23')](respondWithResult(_0x181fc9,null))[_0x0600('0x42')](handleError(_0x181fc9,null));};exports[_0x0600('0x24')]=function(_0x43f1f1,_0x33e253){return db[_0x0600('0x2a')][_0x0600('0x47')]({'where':{'id':_0x43f1f1['params']['id']}})['then'](handleEntityNotFound(_0x33e253,null))['then'](removeEntity(_0x33e253,null))['catch'](handleError(_0x33e253,null));};exports['describe']=function(_0x20bd31,_0x53deca){return db['Cdr']['describe']()[_0x0600('0x23')](respondWithResult(_0x53deca,null))[_0x0600('0x42')](handleError(_0x53deca,null));}; \ No newline at end of file +var _0x1d99=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','options','count','includeAll','findAll','rows','catch','show','params','Cdr','create','body','find','describe','html-pdf','rimraf'];(function(_0x9919f6,_0x956dda){var _0x3d6acb=function(_0x227d6e){while(--_0x227d6e){_0x9919f6['push'](_0x9919f6['shift']());}};_0x3d6acb(++_0x956dda);}(_0x1d99,0x1d2));var _0x91d9=function(_0x191fb6,_0x5612de){_0x191fb6=_0x191fb6-0x0;var _0x57458f=_0x1d99[_0x191fb6];return _0x57458f;};'use strict';var pdf=require(_0x91d9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91d9('0x1'));var zipdir=require(_0x91d9('0x2'));var jsonpatch=require(_0x91d9('0x3'));var rp=require(_0x91d9('0x4'));var moment=require(_0x91d9('0x5'));var BPromise=require(_0x91d9('0x6'));var Mustache=require(_0x91d9('0x7'));var util=require(_0x91d9('0x8'));var path=require(_0x91d9('0x9'));var sox=require('sox');var csv=require(_0x91d9('0xa'));var ejs=require(_0x91d9('0xb'));var fs=require('fs');var _=require(_0x91d9('0xc'));var squel=require(_0x91d9('0xd'));var crypto=require(_0x91d9('0xe'));var jsforce=require(_0x91d9('0xf'));var deskjs=require(_0x91d9('0x10'));var toCsv=require(_0x91d9('0xa'));var querystring=require(_0x91d9('0x11'));var Papa=require(_0x91d9('0x12'));var Redis=require(_0x91d9('0x13'));var authService=require(_0x91d9('0x14'));var qs=require(_0x91d9('0x15'));var as=require(_0x91d9('0x16'));var hardwareService=require(_0x91d9('0x17'));var logger=require('../../config/logger')(_0x91d9('0x18'));var utils=require(_0x91d9('0x19'));var config=require(_0x91d9('0x1a'));var db=require(_0x91d9('0x1b'))['db'];function respondWithStatusCode(_0x44d43e,_0x372e40){_0x372e40=_0x372e40||0xcc;return function(_0x298e34){if(_0x298e34){return _0x44d43e[_0x91d9('0x1c')](_0x372e40);}return _0x44d43e[_0x91d9('0x1d')](_0x372e40)[_0x91d9('0x1e')]();};}function respondWithResult(_0x1a10b4,_0x5bac0b){_0x5bac0b=_0x5bac0b||0xc8;return function(_0x854dbb){if(_0x854dbb){return _0x1a10b4[_0x91d9('0x1d')](_0x5bac0b)['json'](_0x854dbb);}};}function respondWithFilteredResult(_0x23f6b5,_0x507f46){return function(_0x5327e3){if(_0x5327e3){var _0x5df10c=_0x5327e3['count'],_0x1d7e5e=_0x507f46['offset'],_0x19d4d1=_0x507f46['offset']+_0x507f46[_0x91d9('0x1f')],_0x6cefee;if(_0x19d4d1>=_0x5df10c){_0x19d4d1=_0x5df10c;_0x6cefee=0xc8;}else{_0x6cefee=0xce;}_0x23f6b5[_0x91d9('0x1d')](_0x6cefee);return _0x23f6b5[_0x91d9('0x20')](_0x91d9('0x21'),_0x1d7e5e+'-'+_0x19d4d1+'/'+_0x5df10c)[_0x91d9('0x22')](_0x5327e3);}return null;};}function patchUpdates(_0x242eae){return function(_0x2b4bc7){try{jsonpatch[_0x91d9('0x23')](_0x2b4bc7,_0x242eae,!![]);}catch(_0x24fb5f){return BPromise[_0x91d9('0x24')](_0x24fb5f);}return _0x2b4bc7[_0x91d9('0x25')]();};}function saveUpdates(_0x3f3a11,_0x30f29b){return function(_0x1662ea){if(_0x1662ea){return _0x1662ea[_0x91d9('0x26')](_0x3f3a11)[_0x91d9('0x27')](function(_0x49376c){return _0x49376c;});}return null;};}function removeEntity(_0x30dbf5,_0xa279f0){return function(_0x14acb2){if(_0x14acb2){return _0x14acb2[_0x91d9('0x28')]()['then'](function(){_0x30dbf5[_0x91d9('0x1d')](0xcc)[_0x91d9('0x1e')]();});}};}function handleEntityNotFound(_0x40ead3,_0x3f3a35){return function(_0x22c054){if(!_0x22c054){_0x40ead3[_0x91d9('0x1c')](0x194);}return _0x22c054;};}function handleError(_0x3698dc,_0x3710cd){_0x3710cd=_0x3710cd||0x1f4;return function(_0x4cfe27){logger[_0x91d9('0x29')](_0x4cfe27['stack']);if(_0x4cfe27[_0x91d9('0x2a')]){delete _0x4cfe27[_0x91d9('0x2a')];}_0x3698dc['status'](_0x3710cd)['send'](_0x4cfe27);};}exports[_0x91d9('0x2b')]=function(_0x27bd37,_0x456771){var _0x471b3f={},_0x25cea4={},_0x5859fd={'count':0x0,'rows':[]};var _0x16dd01=_[_0x91d9('0x2c')](db['Cdr'][_0x91d9('0x2d')],function(_0x862ac2){return{'name':_0x862ac2['fieldName'],'type':_0x862ac2['type'][_0x91d9('0x2e')]};});_0x25cea4[_0x91d9('0x2f')]=_[_0x91d9('0x2c')](_0x16dd01,'name');_0x25cea4['query']=_[_0x91d9('0x30')](_0x27bd37['query']);_0x25cea4[_0x91d9('0x31')]=_[_0x91d9('0x32')](_0x25cea4['model'],_0x25cea4[_0x91d9('0x33')]);_0x471b3f[_0x91d9('0x34')]=_[_0x91d9('0x32')](_0x25cea4[_0x91d9('0x2f')],qs[_0x91d9('0x35')](_0x27bd37[_0x91d9('0x33')][_0x91d9('0x35')]));_0x471b3f['attributes']=_0x471b3f[_0x91d9('0x34')][_0x91d9('0x36')]?_0x471b3f[_0x91d9('0x34')]:_0x25cea4[_0x91d9('0x2f')];if(!_0x27bd37[_0x91d9('0x33')][_0x91d9('0x37')](_0x91d9('0x38'))){_0x471b3f[_0x91d9('0x1f')]=qs[_0x91d9('0x1f')](_0x27bd37[_0x91d9('0x33')][_0x91d9('0x1f')]);_0x471b3f[_0x91d9('0x39')]=qs[_0x91d9('0x39')](_0x27bd37['query'][_0x91d9('0x39')]);}_0x471b3f[_0x91d9('0x3a')]=qs[_0x91d9('0x3b')](_0x27bd37[_0x91d9('0x33')][_0x91d9('0x3b')]);_0x471b3f[_0x91d9('0x3c')]=qs['filters'](_[_0x91d9('0x3d')](_0x27bd37[_0x91d9('0x33')],_0x25cea4[_0x91d9('0x31')]),_0x16dd01);if(_0x27bd37[_0x91d9('0x33')][_0x91d9('0x3e')]){_0x471b3f[_0x91d9('0x3c')]=_[_0x91d9('0x3f')](_0x471b3f['where'],{'$or':_[_0x91d9('0x2c')](_0x16dd01,function(_0x124d29){if(_0x124d29[_0x91d9('0x40')]!=='VIRTUAL'){var _0x2805b4={};_0x2805b4[_0x124d29[_0x91d9('0x2a')]]={'$like':'%'+_0x27bd37[_0x91d9('0x33')]['filter']+'%'};return _0x2805b4;}})});}_0x471b3f=_[_0x91d9('0x3f')]({},_0x471b3f,_0x27bd37[_0x91d9('0x41')]);var _0x5943a2={'where':_0x471b3f[_0x91d9('0x3c')]};return db['Cdr'][_0x91d9('0x42')](_0x5943a2)['then'](function(_0x2fdc72){_0x5859fd['count']=_0x2fdc72;if(_0x27bd37[_0x91d9('0x33')][_0x91d9('0x43')]){_0x471b3f['include']=[{'all':!![]}];}return db['Cdr'][_0x91d9('0x44')](_0x471b3f);})[_0x91d9('0x27')](function(_0x2eee6d){_0x5859fd[_0x91d9('0x45')]=_0x2eee6d;return _0x5859fd;})[_0x91d9('0x27')](respondWithFilteredResult(_0x456771,_0x471b3f))[_0x91d9('0x46')](handleError(_0x456771,null));};exports[_0x91d9('0x47')]=function(_0x42d2c9,_0x3993f1){var _0xd829ff={'raw':!![],'where':{'id':_0x42d2c9[_0x91d9('0x48')]['id']}},_0x16d3cd={};_0x16d3cd[_0x91d9('0x2f')]=_[_0x91d9('0x30')](db[_0x91d9('0x49')]['rawAttributes']);_0x16d3cd['query']=_[_0x91d9('0x30')](_0x42d2c9[_0x91d9('0x33')]);_0x16d3cd[_0x91d9('0x31')]=_[_0x91d9('0x32')](_0x16d3cd[_0x91d9('0x2f')],_0x16d3cd[_0x91d9('0x33')]);_0xd829ff[_0x91d9('0x34')]=_[_0x91d9('0x32')](_0x16d3cd['model'],qs[_0x91d9('0x35')](_0x42d2c9[_0x91d9('0x33')]['fields']));_0xd829ff[_0x91d9('0x34')]=_0xd829ff[_0x91d9('0x34')][_0x91d9('0x36')]?_0xd829ff['attributes']:_0x16d3cd[_0x91d9('0x2f')];if(_0x42d2c9[_0x91d9('0x33')][_0x91d9('0x43')]){_0xd829ff['include']=[{'all':!![]}];}_0xd829ff=_[_0x91d9('0x3f')]({},_0xd829ff,_0x42d2c9[_0x91d9('0x41')]);return db['Cdr']['find'](_0xd829ff)['then'](handleEntityNotFound(_0x3993f1,null))[_0x91d9('0x27')](respondWithResult(_0x3993f1,null))['catch'](handleError(_0x3993f1,null));};exports[_0x91d9('0x4a')]=function(_0x4918e8,_0x1928e2){return db['Cdr'][_0x91d9('0x4a')](_0x4918e8['body'],{})[_0x91d9('0x27')](respondWithResult(_0x1928e2,0xc9))['catch'](handleError(_0x1928e2,null));};exports[_0x91d9('0x26')]=function(_0x279e8d,_0x43ce9c){if(_0x279e8d['body']['id']){delete _0x279e8d[_0x91d9('0x4b')]['id'];}return db['Cdr'][_0x91d9('0x4c')]({'where':{'id':_0x279e8d['params']['id']}})[_0x91d9('0x27')](handleEntityNotFound(_0x43ce9c,null))[_0x91d9('0x27')](saveUpdates(_0x279e8d[_0x91d9('0x4b')],null))[_0x91d9('0x27')](respondWithResult(_0x43ce9c,null))[_0x91d9('0x46')](handleError(_0x43ce9c,null));};exports[_0x91d9('0x28')]=function(_0x146c85,_0x35743b){return db[_0x91d9('0x49')][_0x91d9('0x4c')]({'where':{'id':_0x146c85[_0x91d9('0x48')]['id']}})[_0x91d9('0x27')](handleEntityNotFound(_0x35743b,null))[_0x91d9('0x27')](removeEntity(_0x35743b,null))['catch'](handleError(_0x35743b,null));};exports[_0x91d9('0x4d')]=function(_0x3a1806,_0x236229){return db[_0x91d9('0x49')][_0x91d9('0x4d')]()['then'](respondWithResult(_0x236229,null))[_0x91d9('0x46')](handleError(_0x236229,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 20b2a0f..d66e09c 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 _0x92af=['disposition','dst','src','uniqueid','lodash','util','api','moment','request-promise','path','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','calldate'];(function(_0x2b27a5,_0x2110d8){var _0x11d9cb=function(_0x4d6142){while(--_0x4d6142){_0x2b27a5['push'](_0x2b27a5['shift']());}};_0x11d9cb(++_0x2110d8);}(_0x92af,0x1cf));var _0xf92a=function(_0x46be5f,_0x160ce5){_0x46be5f=_0x46be5f-0x0;var _0x54ef83=_0x92af[_0x46be5f];return _0x54ef83;};'use strict';var _=require(_0xf92a('0x0'));var util=require(_0xf92a('0x1'));var logger=require('../../config/logger')(_0xf92a('0x2'));var moment=require(_0xf92a('0x3'));var BPromise=require('bluebird');var rp=require(_0xf92a('0x4'));var fs=require('fs');var path=require(_0xf92a('0x5'));var rimraf=require('rimraf');var config=require(_0xf92a('0x6'));var attributes=require(_0xf92a('0x7'));module[_0xf92a('0x8')]=function(_0x246dd7,_0x255e1d){return _0x246dd7[_0xf92a('0x9')](_0xf92a('0xa'),attributes,{'tableName':_0xf92a('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':['accountcode']},{'name':_0xf92a('0xc'),'fields':[_0xf92a('0xc')]},{'name':_0xf92a('0xd'),'fields':[_0xf92a('0xd')]},{'name':_0xf92a('0xe'),'fields':[_0xf92a('0xe')]},{'name':'src','fields':[_0xf92a('0xf')]},{'name':_0xf92a('0x10'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file +var _0xab44=['src','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','dst'];(function(_0x4ae1fa,_0x751466){var _0x136e51=function(_0x52c2b6){while(--_0x52c2b6){_0x4ae1fa['push'](_0x4ae1fa['shift']());}};_0x136e51(++_0x751466);}(_0xab44,0xb6));var _0x4ab4=function(_0x5403c3,_0x7fcfab){_0x5403c3=_0x5403c3-0x0;var _0x3d0b92=_0xab44[_0x5403c3];return _0x3d0b92;};'use strict';var _=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4ab4('0x2'));var BPromise=require(_0x4ab4('0x3'));var rp=require(_0x4ab4('0x4'));var fs=require('fs');var path=require(_0x4ab4('0x5'));var rimraf=require(_0x4ab4('0x6'));var config=require(_0x4ab4('0x7'));var attributes=require(_0x4ab4('0x8'));module[_0x4ab4('0x9')]=function(_0x12ccf2,_0x4f336f){return _0x12ccf2['define'](_0x4ab4('0xa'),attributes,{'tableName':_0x4ab4('0xb'),'paranoid':![],'indexes':[{'name':_0x4ab4('0xc'),'fields':['accountcode']},{'name':_0x4ab4('0xd'),'fields':['calldate']},{'name':_0x4ab4('0xe'),'fields':[_0x4ab4('0xe')]},{'name':'dst','fields':[_0x4ab4('0xf')]},{'name':_0x4ab4('0x10'),'fields':[_0x4ab4('0x10')]},{'name':_0x4ab4('0x11'),'fields':[_0x4ab4('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 8fae1f7..64874e5 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 _0xe379=['Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code'];(function(_0x4d5cc5,_0x3d3e80){var _0x5492bf=function(_0xf620eb){while(--_0xf620eb){_0x4d5cc5['push'](_0x4d5cc5['shift']());}};_0x5492bf(++_0x3d3e80);}(_0xe379,0x1bc));var _0x9e37=function(_0x7bd5d6,_0x335a31){_0x7bd5d6=_0x7bd5d6-0x0;var _0x4838e8=_0xe379[_0x7bd5d6];return _0x4838e8;};'use strict';var _=require(_0x9e37('0x0'));var util=require(_0x9e37('0x1'));var moment=require('moment');var BPromise=require(_0x9e37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e37('0x3'));var db=require(_0x9e37('0x4'))['db'];var utils=require(_0x9e37('0x5'));var logger=require(_0x9e37('0x6'))(_0x9e37('0x7'));var config=require(_0x9e37('0x8'));var jayson=require(_0x9e37('0x9'));var client=jayson['client'][_0x9e37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3100d8,_0x353d5b,_0x4c0ace){return new BPromise(function(_0x1940e1,_0x208be2){return client[_0x9e37('0xb')](_0x3100d8,_0x4c0ace)['then'](function(_0x446ff9){logger[_0x9e37('0xc')]('Cdr,\x20%s,\x20%s',_0x353d5b,'request\x20sent');logger[_0x9e37('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x353d5b,_0x9e37('0xe'),JSON[_0x9e37('0xf')](_0x446ff9));if(_0x446ff9['error']){if(_0x446ff9[_0x9e37('0x10')][_0x9e37('0x11')]===0x1f4){logger['error'](_0x9e37('0x12'),_0x353d5b,_0x446ff9['error'][_0x9e37('0x13')]);return _0x208be2(_0x446ff9[_0x9e37('0x10')]['message']);}logger[_0x9e37('0x10')](_0x9e37('0x12'),_0x353d5b,_0x446ff9[_0x9e37('0x10')][_0x9e37('0x13')]);return _0x1940e1(_0x446ff9[_0x9e37('0x10')][_0x9e37('0x13')]);}else{logger['info'](_0x9e37('0x12'),_0x353d5b,_0x9e37('0xe'));_0x1940e1(_0x446ff9[_0x9e37('0x14')][_0x9e37('0x13')]);}})[_0x9e37('0x15')](function(_0x3123bb){logger['error'](_0x9e37('0x12'),_0x353d5b,_0x3123bb);_0x208be2(_0x3123bb);});});} \ No newline at end of file +var _0xb0bd=['../../config/utils','rpc','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f5c3e,_0x239e81){var _0x39eb21=function(_0x52704c){while(--_0x52704c){_0x2f5c3e['push'](_0x2f5c3e['shift']());}};_0x39eb21(++_0x239e81);}(_0xb0bd,0x1e9));var _0xdb0b=function(_0x18bf56,_0xd8a728){_0x18bf56=_0x18bf56-0x0;var _0x57c73f=_0xb0bd[_0x18bf56];return _0x57c73f;};'use strict';var _=require('lodash');var util=require(_0xdb0b('0x0'));var moment=require(_0xdb0b('0x1'));var BPromise=require(_0xdb0b('0x2'));var rs=require(_0xdb0b('0x3'));var fs=require('fs');var Redis=require(_0xdb0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb0b('0x5'));var logger=require('../../config/logger')(_0xdb0b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdb0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf7ecca,_0x40d1f6,_0x44e002){return new BPromise(function(_0x24751f,_0x2a94e7){return client[_0xdb0b('0x8')](_0xf7ecca,_0x44e002)[_0xdb0b('0x9')](function(_0x305732){logger[_0xdb0b('0xa')]('Cdr,\x20%s,\x20%s',_0x40d1f6,_0xdb0b('0xb'));logger['debug'](_0xdb0b('0xc'),_0x40d1f6,'request\x20sent',JSON[_0xdb0b('0xd')](_0x305732));if(_0x305732[_0xdb0b('0xe')]){if(_0x305732['error'][_0xdb0b('0xf')]===0x1f4){logger[_0xdb0b('0xe')](_0xdb0b('0x10'),_0x40d1f6,_0x305732[_0xdb0b('0xe')][_0xdb0b('0x11')]);return _0x2a94e7(_0x305732[_0xdb0b('0xe')][_0xdb0b('0x11')]);}logger[_0xdb0b('0xe')](_0xdb0b('0x10'),_0x40d1f6,_0x305732[_0xdb0b('0xe')][_0xdb0b('0x11')]);return _0x24751f(_0x305732[_0xdb0b('0xe')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x40d1f6,_0xdb0b('0xb'));_0x24751f(_0x305732[_0xdb0b('0x12')][_0xdb0b('0x11')]);}})['catch'](function(_0x2753af){logger['error']('Cdr,\x20%s,\x20%s',_0x40d1f6,_0x2753af);_0x2a94e7(_0x2753af);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 79f31dd..3f20d27 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 _0x817e=['../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x218def,_0x5e5a97){var _0x1b710b=function(_0x496b60){while(--_0x496b60){_0x218def['push'](_0x218def['shift']());}};_0x1b710b(++_0x5e5a97);}(_0x817e,0x13e));var _0xe817=function(_0x42dbb5,_0x79db41){_0x42dbb5=_0x42dbb5-0x0;var _0x4158a3=_0x817e[_0x42dbb5];return _0x4158a3;};'use strict';var multer=require(_0xe817('0x0'));var util=require(_0xe817('0x1'));var path=require(_0xe817('0x2'));var timeout=require('connect-timeout');var express=require(_0xe817('0x3'));var router=express[_0xe817('0x4')]();var auth=require(_0xe817('0x5'));var interaction=require(_0xe817('0x6'));var config=require('../../config/environment');var controller=require(_0xe817('0x7'));router[_0xe817('0x8')]('/',auth[_0xe817('0x9')](),controller[_0xe817('0xa')]);router['get']('/describe',auth[_0xe817('0x9')](),controller[_0xe817('0xb')]);router[_0xe817('0x8')](_0xe817('0xc'),auth[_0xe817('0x9')](),controller['show']);router[_0xe817('0xd')]('/',auth[_0xe817('0x9')](),controller[_0xe817('0xe')]);router[_0xe817('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe817('0x10')](_0xe817('0xc'),auth[_0xe817('0x9')](),controller[_0xe817('0x11')]);module[_0xe817('0x12')]=router; \ No newline at end of file +var _0x80a2=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','./cdr.controller','isAuthenticated','index','get','/describe','describe','create','put'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0x80a2,0x1eb));var _0x280a=function(_0x1be64c,_0x4d5645){_0x1be64c=_0x1be64c-0x0;var _0x57552e=_0x80a2[_0x1be64c];return _0x57552e;};'use strict';var multer=require(_0x280a('0x0'));var util=require(_0x280a('0x1'));var path=require(_0x280a('0x2'));var timeout=require(_0x280a('0x3'));var express=require(_0x280a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x280a('0x5'));router['get']('/',auth[_0x280a('0x6')](),controller[_0x280a('0x7')]);router[_0x280a('0x8')](_0x280a('0x9'),auth[_0x280a('0x6')](),controller[_0x280a('0xa')]);router[_0x280a('0x8')]('/:id',auth[_0x280a('0x6')](),controller['show']);router['post']('/',auth[_0x280a('0x6')](),controller[_0x280a('0xb')]);router[_0x280a('0xc')](_0x280a('0xd'),auth[_0x280a('0x6')](),controller[_0x280a('0xe')]);router[_0x280a('0xf')](_0x280a('0xd'),auth[_0x280a('0x6')](),controller[_0x280a('0x10')]);module[_0x280a('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 834a84e..2e52007 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 _0xf4db=['STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x9fbe0,_0x4b6bf5){var _0x1c8d7e=function(_0xbbcac4){while(--_0xbbcac4){_0x9fbe0['push'](_0x9fbe0['shift']());}};_0x1c8d7e(++_0x4b6bf5);}(_0xf4db,0xa3));var _0xbf4d=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0xf4db[_0x1c72b8];return _0x191114;};'use strict';var Sequelize=require(_0xbf4d('0x0'));module[_0xbf4d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbf4d('0x2')],'allowNull':![],'defaultValue':_0xbf4d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbf4d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbf4d('0x4')}}; \ No newline at end of file +var _0x4cd1=['*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x96c1fe,_0x25f9da){var _0x5dce5b=function(_0x42fe85){while(--_0x42fe85){_0x96c1fe['push'](_0x96c1fe['shift']());}};_0x5dce5b(++_0x25f9da);}(_0x4cd1,0x1bd));var _0x14cd=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x4cd1[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x14cd('0x0'));module['exports']={'priority':{'type':Sequelize[_0x14cd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x14cd('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x14cd('0x2')],'defaultValue':_0x14cd('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8ebda7e..b2928e2 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 _0x8b4e=['query','filters','intersection','model','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','count','offset','limit','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','params','keys','rawAttributes'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0x8b4e,0xe2));var _0xe8b4=function(_0x1a6ab5,_0x4f26a6){_0x1a6ab5=_0x1a6ab5-0x0;var _0x145f68=_0x8b4e[_0x1a6ab5];return _0x145f68;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe8b4('0x0'));var zipdir=require(_0xe8b4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8b4('0x2'));var moment=require(_0xe8b4('0x3'));var BPromise=require(_0xe8b4('0x4'));var Mustache=require(_0xe8b4('0x5'));var util=require(_0xe8b4('0x6'));var path=require('path');var sox=require(_0xe8b4('0x7'));var csv=require('to-csv');var ejs=require(_0xe8b4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe8b4('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8b4('0xa'));var querystring=require(_0xe8b4('0xb'));var Papa=require(_0xe8b4('0xc'));var Redis=require(_0xe8b4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe8b4('0xe'));var as=require(_0xe8b4('0xf'));var hardwareService=require(_0xe8b4('0x10'));var logger=require(_0xe8b4('0x11'))('api');var utils=require(_0xe8b4('0x12'));var config=require(_0xe8b4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ace0,_0x78d106){_0x78d106=_0x78d106||0xcc;return function(_0x9e65ee){if(_0x9e65ee){return _0x28ace0['sendStatus'](_0x78d106);}return _0x28ace0['status'](_0x78d106)[_0xe8b4('0x14')]();};}function respondWithResult(_0x45f903,_0x751daa){_0x751daa=_0x751daa||0xc8;return function(_0x218b36){if(_0x218b36){return _0x45f903[_0xe8b4('0x15')](_0x751daa)['json'](_0x218b36);}};}function respondWithFilteredResult(_0x3851aa,_0x20b81a){return function(_0x509cbd){if(_0x509cbd){var _0x4757bc=_0x509cbd[_0xe8b4('0x16')],_0x375ef6=_0x20b81a[_0xe8b4('0x17')],_0x434596=_0x20b81a[_0xe8b4('0x17')]+_0x20b81a[_0xe8b4('0x18')],_0x1626c8;if(_0x434596>=_0x4757bc){_0x434596=_0x4757bc;_0x1626c8=0xc8;}else{_0x1626c8=0xce;}_0x3851aa[_0xe8b4('0x15')](_0x1626c8);return _0x3851aa[_0xe8b4('0x19')]('Content-Range',_0x375ef6+'-'+_0x434596+'/'+_0x4757bc)[_0xe8b4('0x1a')](_0x509cbd);}return null;};}function patchUpdates(_0x3e4729){return function(_0x376760){try{jsonpatch[_0xe8b4('0x1b')](_0x376760,_0x3e4729,!![]);}catch(_0x1421cf){return BPromise['reject'](_0x1421cf);}return _0x376760[_0xe8b4('0x1c')]();};}function saveUpdates(_0x344a2b,_0x58f76c){return function(_0x3f5fa4){if(_0x3f5fa4){return _0x3f5fa4[_0xe8b4('0x1d')](_0x344a2b)[_0xe8b4('0x1e')](function(_0x5d18ba){return _0x5d18ba;});}return null;};}function removeEntity(_0x11d671,_0x2a865b){return function(_0x153b51){if(_0x153b51){return _0x153b51[_0xe8b4('0x1f')]()['then'](function(){_0x11d671[_0xe8b4('0x15')](0xcc)[_0xe8b4('0x14')]();});}};}function handleEntityNotFound(_0x55da4c,_0x284d4c){return function(_0x22d35a){if(!_0x22d35a){_0x55da4c[_0xe8b4('0x20')](0x194);}return _0x22d35a;};}function handleError(_0x82484,_0x52c611){_0x52c611=_0x52c611||0x1f4;return function(_0x22dcdd){logger[_0xe8b4('0x21')](_0x22dcdd[_0xe8b4('0x22')]);if(_0x22dcdd[_0xe8b4('0x23')]){delete _0x22dcdd[_0xe8b4('0x23')];}_0x82484[_0xe8b4('0x15')](_0x52c611)['send'](_0x22dcdd);};}exports['show']=function(_0x431d5c,_0x1cb7c7){var _0x2adf3c={'raw':!![],'where':{'id':_0x431d5c[_0xe8b4('0x24')]['id']}},_0x5b6ad7={};_0x5b6ad7['model']=_[_0xe8b4('0x25')](db['ChatApplication'][_0xe8b4('0x26')]);_0x5b6ad7[_0xe8b4('0x27')]=_['keys'](_0x431d5c[_0xe8b4('0x27')]);_0x5b6ad7[_0xe8b4('0x28')]=_[_0xe8b4('0x29')](_0x5b6ad7[_0xe8b4('0x2a')],_0x5b6ad7[_0xe8b4('0x27')]);_0x2adf3c[_0xe8b4('0x2b')]=_[_0xe8b4('0x29')](_0x5b6ad7[_0xe8b4('0x2a')],qs['fields'](_0x431d5c[_0xe8b4('0x27')][_0xe8b4('0x2c')]));_0x2adf3c[_0xe8b4('0x2b')]=_0x2adf3c[_0xe8b4('0x2b')][_0xe8b4('0x2d')]?_0x2adf3c['attributes']:_0x5b6ad7[_0xe8b4('0x2a')];if(_0x431d5c[_0xe8b4('0x27')]['includeAll']){_0x2adf3c[_0xe8b4('0x2e')]=[{'all':!![]}];}_0x2adf3c=_[_0xe8b4('0x2f')]({},_0x2adf3c,_0x431d5c[_0xe8b4('0x30')]);return db[_0xe8b4('0x31')][_0xe8b4('0x32')](_0x2adf3c)[_0xe8b4('0x1e')](handleEntityNotFound(_0x1cb7c7,null))[_0xe8b4('0x1e')](respondWithResult(_0x1cb7c7,null))[_0xe8b4('0x33')](handleError(_0x1cb7c7,null));};exports[_0xe8b4('0x1d')]=function(_0x1e38e6,_0x59adf0){if(_0x1e38e6[_0xe8b4('0x34')]['id']){delete _0x1e38e6[_0xe8b4('0x34')]['id'];}return db[_0xe8b4('0x31')][_0xe8b4('0x32')]({'where':{'id':_0x1e38e6[_0xe8b4('0x24')]['id']}})['then'](handleEntityNotFound(_0x59adf0,null))[_0xe8b4('0x1e')](saveUpdates(_0x1e38e6[_0xe8b4('0x34')],null))['then'](respondWithResult(_0x59adf0,null))[_0xe8b4('0x33')](handleError(_0x59adf0,null));};exports[_0xe8b4('0x1f')]=function(_0x87a72,_0x4e7ab0){return db[_0xe8b4('0x31')][_0xe8b4('0x32')]({'where':{'id':_0x87a72[_0xe8b4('0x24')]['id']}})[_0xe8b4('0x1e')](handleEntityNotFound(_0x4e7ab0,null))['then'](removeEntity(_0x4e7ab0,null))[_0xe8b4('0x33')](handleError(_0x4e7ab0,null));}; \ No newline at end of file +var _0x577a=['error','stack','name','send','show','model','rawAttributes','keys','query','intersection','fields','attributes','length','merge','options','ChatApplication','find','catch','update','body','params','eml-format','rimraf','zip-dir','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','../../mysqldb','status','end','json','offset','limit','Content-Range','reject','then','destroy','sendStatus'];(function(_0x2d89f3,_0x58d58e){var _0x5add9f=function(_0x10569e){while(--_0x10569e){_0x2d89f3['push'](_0x2d89f3['shift']());}};_0x5add9f(++_0x58d58e);}(_0x577a,0x1c5));var _0xa577=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x577a[_0x39096d];return _0x13da4f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa577('0x0'));var rimraf=require(_0xa577('0x1'));var zipdir=require(_0xa577('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa577('0x3'));var moment=require(_0xa577('0x4'));var BPromise=require(_0xa577('0x5'));var Mustache=require('mustache');var util=require(_0xa577('0x6'));var path=require(_0xa577('0x7'));var sox=require(_0xa577('0x8'));var csv=require(_0xa577('0x9'));var ejs=require(_0xa577('0xa'));var fs=require('fs');var _=require(_0xa577('0xb'));var squel=require(_0xa577('0xc'));var crypto=require(_0xa577('0xd'));var jsforce=require(_0xa577('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa577('0x9'));var querystring=require(_0xa577('0xf'));var Papa=require(_0xa577('0x10'));var Redis=require(_0xa577('0x11'));var authService=require(_0xa577('0x12'));var qs=require(_0xa577('0x13'));var as=require(_0xa577('0x14'));var hardwareService=require(_0xa577('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa577('0x16'))['db'];function respondWithStatusCode(_0xe40491,_0x3a7885){_0x3a7885=_0x3a7885||0xcc;return function(_0x5001b8){if(_0x5001b8){return _0xe40491['sendStatus'](_0x3a7885);}return _0xe40491[_0xa577('0x17')](_0x3a7885)[_0xa577('0x18')]();};}function respondWithResult(_0xf346d0,_0x491531){_0x491531=_0x491531||0xc8;return function(_0x1c4131){if(_0x1c4131){return _0xf346d0['status'](_0x491531)[_0xa577('0x19')](_0x1c4131);}};}function respondWithFilteredResult(_0x41d2e7,_0x3a66ee){return function(_0x9285c7){if(_0x9285c7){var _0x4ac9e6=_0x9285c7['count'],_0x3ecacd=_0x3a66ee[_0xa577('0x1a')],_0x374bb9=_0x3a66ee[_0xa577('0x1a')]+_0x3a66ee[_0xa577('0x1b')],_0x47da78;if(_0x374bb9>=_0x4ac9e6){_0x374bb9=_0x4ac9e6;_0x47da78=0xc8;}else{_0x47da78=0xce;}_0x41d2e7['status'](_0x47da78);return _0x41d2e7['set'](_0xa577('0x1c'),_0x3ecacd+'-'+_0x374bb9+'/'+_0x4ac9e6)[_0xa577('0x19')](_0x9285c7);}return null;};}function patchUpdates(_0x3acd0e){return function(_0x3f432){try{jsonpatch['apply'](_0x3f432,_0x3acd0e,!![]);}catch(_0x144879){return BPromise[_0xa577('0x1d')](_0x144879);}return _0x3f432['save']();};}function saveUpdates(_0x1f6ebb,_0x5880dc){return function(_0x389d0c){if(_0x389d0c){return _0x389d0c['update'](_0x1f6ebb)[_0xa577('0x1e')](function(_0x25208d){return _0x25208d;});}return null;};}function removeEntity(_0x18fe95,_0x2f1f7b){return function(_0x3d9ebb){if(_0x3d9ebb){return _0x3d9ebb[_0xa577('0x1f')]()[_0xa577('0x1e')](function(){_0x18fe95[_0xa577('0x17')](0xcc)[_0xa577('0x18')]();});}};}function handleEntityNotFound(_0x367c5a,_0x334666){return function(_0xc0bf42){if(!_0xc0bf42){_0x367c5a[_0xa577('0x20')](0x194);}return _0xc0bf42;};}function handleError(_0x509972,_0x5a4975){_0x5a4975=_0x5a4975||0x1f4;return function(_0x1e579e){logger[_0xa577('0x21')](_0x1e579e[_0xa577('0x22')]);if(_0x1e579e[_0xa577('0x23')]){delete _0x1e579e[_0xa577('0x23')];}_0x509972[_0xa577('0x17')](_0x5a4975)[_0xa577('0x24')](_0x1e579e);};}exports[_0xa577('0x25')]=function(_0x1885f4,_0x5d417d){var _0x3dd31a={'raw':!![],'where':{'id':_0x1885f4['params']['id']}},_0x36f78b={};_0x36f78b[_0xa577('0x26')]=_['keys'](db['ChatApplication'][_0xa577('0x27')]);_0x36f78b['query']=_[_0xa577('0x28')](_0x1885f4[_0xa577('0x29')]);_0x36f78b['filters']=_[_0xa577('0x2a')](_0x36f78b['model'],_0x36f78b['query']);_0x3dd31a['attributes']=_[_0xa577('0x2a')](_0x36f78b['model'],qs[_0xa577('0x2b')](_0x1885f4[_0xa577('0x29')][_0xa577('0x2b')]));_0x3dd31a[_0xa577('0x2c')]=_0x3dd31a['attributes'][_0xa577('0x2d')]?_0x3dd31a[_0xa577('0x2c')]:_0x36f78b[_0xa577('0x26')];if(_0x1885f4['query']['includeAll']){_0x3dd31a['include']=[{'all':!![]}];}_0x3dd31a=_[_0xa577('0x2e')]({},_0x3dd31a,_0x1885f4[_0xa577('0x2f')]);return db[_0xa577('0x30')][_0xa577('0x31')](_0x3dd31a)[_0xa577('0x1e')](handleEntityNotFound(_0x5d417d,null))[_0xa577('0x1e')](respondWithResult(_0x5d417d,null))[_0xa577('0x32')](handleError(_0x5d417d,null));};exports[_0xa577('0x33')]=function(_0x138e77,_0xf857de){if(_0x138e77['body']['id']){delete _0x138e77[_0xa577('0x34')]['id'];}return db['ChatApplication'][_0xa577('0x31')]({'where':{'id':_0x138e77[_0xa577('0x35')]['id']}})['then'](handleEntityNotFound(_0xf857de,null))[_0xa577('0x1e')](saveUpdates(_0x138e77['body'],null))[_0xa577('0x1e')](respondWithResult(_0xf857de,null))[_0xa577('0x32')](handleError(_0xf857de,null));};exports[_0xa577('0x1f')]=function(_0x1808bc,_0x217c10){return db[_0xa577('0x30')][_0xa577('0x31')]({'where':{'id':_0x1808bc[_0xa577('0x35')]['id']}})[_0xa577('0x1e')](handleEntityNotFound(_0x217c10,null))[_0xa577('0x1e')](removeEntity(_0x217c10,null))[_0xa577('0x32')](handleError(_0x217c10,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9c6a995..8a23f3f 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 _0x97d9=['../../config/environment','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x97d9,0x18c));var _0x997d=function(_0xbc6e05,_0x524e9c){_0xbc6e05=_0xbc6e05-0x0;var _0x6c0552=_0x97d9[_0xbc6e05];return _0x6c0552;};'use strict';var _=require(_0x997d('0x0'));var util=require(_0x997d('0x1'));var logger=require(_0x997d('0x2'))(_0x997d('0x3'));var moment=require(_0x997d('0x4'));var BPromise=require(_0x997d('0x5'));var rp=require(_0x997d('0x6'));var fs=require('fs');var path=require(_0x997d('0x7'));var rimraf=require(_0x997d('0x8'));var config=require(_0x997d('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0xb65aee,_0x2a6994){return _0xb65aee[_0x997d('0xa')](_0x997d('0xb'),attributes,{'tableName':_0x997d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x997d('0xd'),'collate':_0x997d('0xe')});}; \ No newline at end of file +var _0x59fa=['utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','define','ChatApplication','utf8mb4'];(function(_0x57c432,_0xea04b5){var _0x34f0bd=function(_0x14b97b){while(--_0x14b97b){_0x57c432['push'](_0x57c432['shift']());}};_0x34f0bd(++_0xea04b5);}(_0x59fa,0x123));var _0xa59f=function(_0xa9a766,_0x41224a){_0xa9a766=_0xa9a766-0x0;var _0x55c51d=_0x59fa[_0xa9a766];return _0x55c51d;};'use strict';var _=require(_0xa59f('0x0'));var util=require(_0xa59f('0x1'));var logger=require(_0xa59f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa59f('0x3'));var rp=require(_0xa59f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa59f('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x2b735a,_0x57d8c0){return _0x2b735a[_0xa59f('0x6')](_0xa59f('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa59f('0x8'),'collate':_0xa59f('0x9')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 7995f48..a01d61a 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 _0x6b73=['rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13a8ba,_0x4231a9){var _0x97ddba=function(_0x3f09f3){while(--_0x3f09f3){_0x13a8ba['push'](_0x13a8ba['shift']());}};_0x97ddba(++_0x4231a9);}(_0x6b73,0x12e));var _0x36b7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b73[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36b7('0x0'));var BPromise=require(_0x36b7('0x1'));var rs=require(_0x36b7('0x2'));var fs=require('fs');var Redis=require(_0x36b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36b7('0x4'));var logger=require(_0x36b7('0x5'))(_0x36b7('0x6'));var config=require(_0x36b7('0x7'));var jayson=require(_0x36b7('0x8'));var client=jayson[_0x36b7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7bf8b,_0x143251,_0x208ae2){return new BPromise(function(_0x4d3c7c,_0x48b937){return client[_0x36b7('0xa')](_0xd7bf8b,_0x208ae2)[_0x36b7('0xb')](function(_0x39ce6a){logger[_0x36b7('0xc')](_0x36b7('0xd'),_0x143251,_0x36b7('0xe'));logger[_0x36b7('0xf')](_0x36b7('0x10'),_0x143251,'request\x20sent',JSON[_0x36b7('0x11')](_0x39ce6a));if(_0x39ce6a[_0x36b7('0x12')]){if(_0x39ce6a['error']['code']===0x1f4){logger[_0x36b7('0x12')]('ChatApplication,\x20%s,\x20%s',_0x143251,_0x39ce6a[_0x36b7('0x12')]['message']);return _0x48b937(_0x39ce6a[_0x36b7('0x12')][_0x36b7('0x13')]);}logger[_0x36b7('0x12')](_0x36b7('0xd'),_0x143251,_0x39ce6a[_0x36b7('0x12')]['message']);return _0x4d3c7c(_0x39ce6a[_0x36b7('0x12')]['message']);}else{logger[_0x36b7('0xc')]('ChatApplication,\x20%s,\x20%s',_0x143251,_0x36b7('0xe'));_0x4d3c7c(_0x39ce6a[_0x36b7('0x14')][_0x36b7('0x13')]);}})[_0x36b7('0x15')](function(_0x9cd51e){logger[_0x36b7('0x12')](_0x36b7('0xd'),_0x143251,_0x9cd51e);_0x48b937(_0x9cd51e);});});} \ No newline at end of file +var _0xd96b=['../../config/environment','jayson/promise','client','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xd96b,0x189));var _0xbd96=function(_0xff6b9,_0x257f63){_0xff6b9=_0xff6b9-0x0;var _0x25aaa9=_0xd96b[_0xff6b9];return _0x25aaa9;};'use strict';var _=require(_0xbd96('0x0'));var util=require(_0xbd96('0x1'));var moment=require(_0xbd96('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd96('0x3'));var db=require(_0xbd96('0x4'))['db'];var utils=require(_0xbd96('0x5'));var logger=require('../../config/logger')(_0xbd96('0x6'));var config=require(_0xbd96('0x7'));var jayson=require(_0xbd96('0x8'));var client=jayson[_0xbd96('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32181d,_0x4027f7,_0x525dd5){return new BPromise(function(_0x2591d0,_0x4177e6){return client['request'](_0x32181d,_0x525dd5)['then'](function(_0x4cc4ad){logger[_0xbd96('0xa')]('ChatApplication,\x20%s,\x20%s',_0x4027f7,_0xbd96('0xb'));logger[_0xbd96('0xc')](_0xbd96('0xd'),_0x4027f7,_0xbd96('0xb'),JSON[_0xbd96('0xe')](_0x4cc4ad));if(_0x4cc4ad['error']){if(_0x4cc4ad[_0xbd96('0xf')][_0xbd96('0x10')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4027f7,_0x4cc4ad[_0xbd96('0xf')][_0xbd96('0x11')]);return _0x4177e6(_0x4cc4ad['error']['message']);}logger[_0xbd96('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4027f7,_0x4cc4ad[_0xbd96('0xf')][_0xbd96('0x11')]);return _0x2591d0(_0x4cc4ad[_0xbd96('0xf')][_0xbd96('0x11')]);}else{logger[_0xbd96('0xa')](_0xbd96('0x12'),_0x4027f7,_0xbd96('0xb'));_0x2591d0(_0x4cc4ad['result'][_0xbd96('0x11')]);}})[_0xbd96('0x13')](function(_0x11dc1d){logger[_0xbd96('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4027f7,_0x11dc1d);_0x4177e6(_0x11dc1d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2be4ed4..a49f3f6 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 _0x9660=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','isAuthenticated','delete','destroy'];(function(_0xe0d8d8,_0x5e3377){var _0x4f63eb=function(_0x5c1150){while(--_0x5c1150){_0xe0d8d8['push'](_0xe0d8d8['shift']());}};_0x4f63eb(++_0x5e3377);}(_0x9660,0x180));var _0x0966=function(_0x48d7e7,_0x306cba){_0x48d7e7=_0x48d7e7-0x0;var _0xdc62a5=_0x9660[_0x48d7e7];return _0xdc62a5;};'use strict';var multer=require(_0x0966('0x0'));var util=require(_0x0966('0x1'));var path=require(_0x0966('0x2'));var timeout=require(_0x0966('0x3'));var express=require(_0x0966('0x4'));var router=express[_0x0966('0x5')]();var auth=require(_0x0966('0x6'));var interaction=require(_0x0966('0x7'));var config=require(_0x0966('0x8'));var controller=require(_0x0966('0x9'));router[_0x0966('0xa')](_0x0966('0xb'),auth['isAuthenticated'](),controller[_0x0966('0xc')]);router['put'](_0x0966('0xb'),auth[_0x0966('0xd')](),controller['update']);router[_0x0966('0xe')]('/:id',auth[_0x0966('0xd')](),controller[_0x0966('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7a80=['../../config/environment','./chatApplication.controller','get','show','put','/:id','isAuthenticated','update','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a80,0x106));var _0x07a8=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7a80[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require('multer');var util=require(_0x07a8('0x0'));var path=require(_0x07a8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x07a8('0x2'));var interaction=require(_0x07a8('0x3'));var config=require(_0x07a8('0x4'));var controller=require(_0x07a8('0x5'));router[_0x07a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x07a8('0x7')]);router[_0x07a8('0x8')](_0x07a8('0x9'),auth[_0x07a8('0xa')](),controller[_0x07a8('0xb')]);router[_0x07a8('0xc')]('/:id',auth[_0x07a8('0xa')](),controller[_0x07a8('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index f191866..a41b7d2 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 _0xe375=['sequelize','exports','STRING'];(function(_0x1031ab,_0x11a0e6){var _0x15ba29=function(_0x363709){while(--_0x363709){_0x1031ab['push'](_0x1031ab['shift']());}};_0x15ba29(++_0x11a0e6);}(_0xe375,0x84));var _0x5e37=function(_0x1303c1,_0x2ac364){_0x1303c1=_0x1303c1-0x0;var _0x490846=_0xe375[_0x1303c1];return _0x490846;};'use strict';var Sequelize=require(_0x5e37('0x0'));module[_0x5e37('0x1')]={'name':{'type':Sequelize[_0x5e37('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5e37('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb730=['STRING','BOOLEAN'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb730,0xde));var _0x0b73=function(_0xb38e01,_0xb2bc77){_0xb38e01=_0xb38e01-0x0;var _0x350691=_0xb730[_0xb38e01];return _0x350691;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0b73('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x0b73('0x0')]},'write':{'type':Sequelize[_0x0b73('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3bf6120..b13b65c 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 _0x5184=['./chatGroup.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','count','offset','limit','json','apply','reject','update','stack','name','send','index','map','ChatGroup','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','destroy','describe','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','order','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0x5184,0x194));var _0x4518=function(_0x70b29e,_0x5b330a){_0x70b29e=_0x70b29e-0x0;var _0x41e725=_0x5184[_0x70b29e];return _0x41e725;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4518('0x0'));var rimraf=require(_0x4518('0x1'));var zipdir=require(_0x4518('0x2'));var jsonpatch=require(_0x4518('0x3'));var rp=require(_0x4518('0x4'));var moment=require(_0x4518('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4518('0x6'));var util=require(_0x4518('0x7'));var path=require(_0x4518('0x8'));var sox=require(_0x4518('0x9'));var csv=require(_0x4518('0xa'));var ejs=require(_0x4518('0xb'));var fs=require('fs');var _=require(_0x4518('0xc'));var squel=require(_0x4518('0xd'));var crypto=require(_0x4518('0xe'));var jsforce=require(_0x4518('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4518('0xa'));var querystring=require(_0x4518('0x10'));var Papa=require(_0x4518('0x11'));var Redis=require(_0x4518('0x12'));var authService=require(_0x4518('0x13'));var qs=require(_0x4518('0x14'));var as=require(_0x4518('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4518('0x16'));var utils=require(_0x4518('0x17'));var config=require('../../config/environment');var db=require(_0x4518('0x18'))['db'];config[_0x4518('0x19')]=_[_0x4518('0x1a')](config[_0x4518('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4518('0x1b'))(new Redis(config[_0x4518('0x19')]));require(_0x4518('0x1c'))[_0x4518('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4518('0x1e')][_0x4518('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x1a6e6e,_0x42327f,_0x10fa49){if(_0x10fa49){var _0x4d0cd6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d0cd6['test'](_0x42327f)){return _0x1a6e6e;}else{throw new db[(_0x4518('0x20'))][(_0x4518('0x21'))](_0x4518('0x22'));}}else{return _0x1a6e6e;}}function respondWithRpcPromise(_0x341935,_0x1279ab,_0xd10ba6,_0x49266c){return new BPromise(function(_0x29ea45,_0x41783d){var _0x20dee9=_0x49266c||client;return _0x20dee9[_0x4518('0x23')](_0x341935,_0xd10ba6)[_0x4518('0x24')](function(_0x56c98e){logger['info'](_0x4518('0x25'),_0x1279ab,'request\x20sent');logger['debug'](_0x4518('0x26'),_0x1279ab,_0x4518('0x27'),JSON[_0x4518('0x28')](_0x56c98e));if(_0x56c98e[_0x4518('0x29')]){if(_0x56c98e[_0x4518('0x29')][_0x4518('0x2a')]===0x1f4){logger[_0x4518('0x29')](_0x4518('0x25'),_0x1279ab,_0x56c98e[_0x4518('0x29')][_0x4518('0x2b')]);return _0x41783d(_0x56c98e[_0x4518('0x29')][_0x4518('0x2b')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x1279ab,_0x56c98e[_0x4518('0x29')][_0x4518('0x2b')]);return _0x29ea45(_0x56c98e['error'][_0x4518('0x2b')]);}else{logger[_0x4518('0x2c')](_0x4518('0x25'),_0x1279ab,_0x4518('0x27'));_0x29ea45(_0x56c98e[_0x4518('0x2d')][_0x4518('0x2b')]);}})[_0x4518('0x2e')](function(_0xb29083){logger[_0x4518('0x29')](_0x4518('0x25'),_0x1279ab,_0xb29083);_0x41783d(_0xb29083);});});}function respondWithStatusCode(_0x3e4826,_0x114d98){_0x114d98=_0x114d98||0xcc;return function(_0xcfd177){if(_0xcfd177){return _0x3e4826[_0x4518('0x2f')](_0x114d98);}return _0x3e4826['status'](_0x114d98)[_0x4518('0x30')]();};}function respondWithResult(_0x197a84,_0x4b2db5){_0x4b2db5=_0x4b2db5||0xc8;return function(_0x208ca0){if(_0x208ca0){return _0x197a84[_0x4518('0x31')](_0x4b2db5)['json'](_0x208ca0);}};}function respondWithFilteredResult(_0x32b5a8,_0x2cb6e){return function(_0x24e739){if(_0x24e739){var _0xc09402=_0x24e739[_0x4518('0x32')],_0x195ead=_0x2cb6e[_0x4518('0x33')],_0x2ef95a=_0x2cb6e['offset']+_0x2cb6e[_0x4518('0x34')],_0x296c00;if(_0x2ef95a>=_0xc09402){_0x2ef95a=_0xc09402;_0x296c00=0xc8;}else{_0x296c00=0xce;}_0x32b5a8['status'](_0x296c00);return _0x32b5a8['set']('Content-Range',_0x195ead+'-'+_0x2ef95a+'/'+_0xc09402)[_0x4518('0x35')](_0x24e739);}return null;};}function patchUpdates(_0x4c4f2a){return function(_0x1447b0){try{jsonpatch[_0x4518('0x36')](_0x1447b0,_0x4c4f2a,!![]);}catch(_0x10b9ad){return BPromise[_0x4518('0x37')](_0x10b9ad);}return _0x1447b0['save']();};}function saveUpdates(_0x928f31,_0x41d5b3){return function(_0x47303e){if(_0x47303e){return _0x47303e[_0x4518('0x38')](_0x928f31)[_0x4518('0x24')](function(_0x289f84){return _0x289f84;});}return null;};}function removeEntity(_0x16897f,_0x4cec9d){return function(_0x5a12c1){if(_0x5a12c1){return _0x5a12c1['destroy']()[_0x4518('0x24')](function(){_0x16897f[_0x4518('0x31')](0xcc)[_0x4518('0x30')]();});}};}function handleEntityNotFound(_0x4a92bb,_0x38d279){return function(_0x57bc8f){if(!_0x57bc8f){_0x4a92bb[_0x4518('0x2f')](0x194);}return _0x57bc8f;};}function handleError(_0xa425d6,_0x5bda46){_0x5bda46=_0x5bda46||0x1f4;return function(_0x3ef455){logger['error'](_0x3ef455[_0x4518('0x39')]);if(_0x3ef455[_0x4518('0x3a')]){delete _0x3ef455[_0x4518('0x3a')];}_0xa425d6[_0x4518('0x31')](_0x5bda46)[_0x4518('0x3b')](_0x3ef455);};}exports[_0x4518('0x3c')]=function(_0xb19d83,_0x40da10){var _0x3c0de9={},_0x3c9461={},_0x497811={'count':0x0,'rows':[]};var _0x59ce56=_[_0x4518('0x3d')](db[_0x4518('0x3e')][_0x4518('0x3f')],function(_0x1937ff){return{'name':_0x1937ff['fieldName'],'type':_0x1937ff[_0x4518('0x40')]['key']};});_0x3c9461['model']=_[_0x4518('0x3d')](_0x59ce56,_0x4518('0x3a'));_0x3c9461[_0x4518('0x41')]=_[_0x4518('0x42')](_0xb19d83[_0x4518('0x41')]);_0x3c9461[_0x4518('0x43')]=_[_0x4518('0x44')](_0x3c9461[_0x4518('0x45')],_0x3c9461[_0x4518('0x41')]);_0x3c0de9[_0x4518('0x46')]=_[_0x4518('0x44')](_0x3c9461[_0x4518('0x45')],qs[_0x4518('0x47')](_0xb19d83[_0x4518('0x41')][_0x4518('0x47')]));_0x3c0de9[_0x4518('0x46')]=_0x3c0de9[_0x4518('0x46')][_0x4518('0x48')]?_0x3c0de9[_0x4518('0x46')]:_0x3c9461[_0x4518('0x45')];if(!_0xb19d83['query']['hasOwnProperty'](_0x4518('0x49'))){_0x3c0de9[_0x4518('0x34')]=qs[_0x4518('0x34')](_0xb19d83[_0x4518('0x41')][_0x4518('0x34')]);_0x3c0de9['offset']=qs[_0x4518('0x33')](_0xb19d83['query'][_0x4518('0x33')]);}_0x3c0de9['order']=qs['sort'](_0xb19d83[_0x4518('0x41')][_0x4518('0x4a')]);_0x3c0de9[_0x4518('0x4b')]=qs[_0x4518('0x43')](_[_0x4518('0x4c')](_0xb19d83[_0x4518('0x41')],_0x3c9461['filters']),_0x59ce56);if(_0xb19d83[_0x4518('0x41')]['filter']){_0x3c0de9['where']=_[_0x4518('0x4d')](_0x3c0de9[_0x4518('0x4b')],{'$or':_[_0x4518('0x3d')](_0x59ce56,function(_0x483202){if(_0x483202[_0x4518('0x40')]!==_0x4518('0x4e')){var _0x5119c8={};_0x5119c8[_0x483202[_0x4518('0x3a')]]={'$like':'%'+_0xb19d83['query']['filter']+'%'};return _0x5119c8;}})});}_0x3c0de9=_[_0x4518('0x4d')]({},_0x3c0de9,_0xb19d83[_0x4518('0x4f')]);var _0x1dacac={'where':_0x3c0de9[_0x4518('0x4b')]};return db[_0x4518('0x3e')][_0x4518('0x32')](_0x1dacac)['then'](function(_0x2278b2){_0x497811['count']=_0x2278b2;if(_0xb19d83[_0x4518('0x41')][_0x4518('0x50')]){_0x3c0de9[_0x4518('0x51')]=[{'all':!![]}];}return db[_0x4518('0x3e')]['findAll'](_0x3c0de9);})[_0x4518('0x24')](function(_0x4addf2){_0x497811[_0x4518('0x52')]=_0x4addf2;return _0x497811;})['then'](respondWithFilteredResult(_0x40da10,_0x3c0de9))['catch'](handleError(_0x40da10,null));};exports[_0x4518('0x53')]=function(_0x38b646,_0x1b8209){var _0x7f1514={'raw':!![],'where':{'id':_0x38b646[_0x4518('0x54')]['id']}},_0x1bd955={};_0x1bd955[_0x4518('0x45')]=_[_0x4518('0x42')](db[_0x4518('0x3e')][_0x4518('0x3f')]);_0x1bd955[_0x4518('0x41')]=_[_0x4518('0x42')](_0x38b646[_0x4518('0x41')]);_0x1bd955[_0x4518('0x43')]=_[_0x4518('0x44')](_0x1bd955[_0x4518('0x45')],_0x1bd955[_0x4518('0x41')]);_0x7f1514[_0x4518('0x46')]=_[_0x4518('0x44')](_0x1bd955[_0x4518('0x45')],qs['fields'](_0x38b646['query']['fields']));_0x7f1514[_0x4518('0x46')]=_0x7f1514[_0x4518('0x46')][_0x4518('0x48')]?_0x7f1514[_0x4518('0x46')]:_0x1bd955[_0x4518('0x45')];if(_0x38b646[_0x4518('0x41')][_0x4518('0x50')]){_0x7f1514['include']=[{'all':!![]}];}_0x7f1514=_['merge']({},_0x7f1514,_0x38b646['options']);return db['ChatGroup'][_0x4518('0x55')](_0x7f1514)['then'](handleEntityNotFound(_0x1b8209,null))['then'](respondWithResult(_0x1b8209,null))['catch'](handleError(_0x1b8209,null));};exports[_0x4518('0x56')]=function(_0x284bcc,_0x6f77d){return db[_0x4518('0x3e')][_0x4518('0x56')](_0x284bcc['body'],{})['then'](respondWithResult(_0x6f77d,0xc9))[_0x4518('0x2e')](handleError(_0x6f77d,null));};exports[_0x4518('0x38')]=function(_0x5ecd93,_0x485d25){if(_0x5ecd93[_0x4518('0x57')]['id']){delete _0x5ecd93['body']['id'];}return db[_0x4518('0x3e')][_0x4518('0x55')]({'where':{'id':_0x5ecd93[_0x4518('0x54')]['id']}})['then'](handleEntityNotFound(_0x485d25,null))[_0x4518('0x24')](saveUpdates(_0x5ecd93['body'],null))[_0x4518('0x24')](respondWithResult(_0x485d25,null))[_0x4518('0x2e')](handleError(_0x485d25,null));};exports[_0x4518('0x58')]=function(_0x1ddeb8,_0x4b123e){return db[_0x4518('0x3e')][_0x4518('0x55')]({'where':{'id':_0x1ddeb8[_0x4518('0x54')]['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x4b123e,null))['then'](removeEntity(_0x4b123e,null))[_0x4518('0x2e')](handleError(_0x4b123e,null));};exports['describe']=function(_0x96a6bf,_0x102ee){return db[_0x4518('0x3e')][_0x4518('0x59')]()[_0x4518('0x24')](respondWithResult(_0x102ee,null))[_0x4518('0x2e')](handleError(_0x102ee,null));};exports['getUnread']=function(_0x2f0de6,_0x5864e1,_0x5123d4){return db[_0x4518('0x5a')]['count']({'where':{'ChatGroupId':_0x2f0de6[_0x4518('0x54')]['id'],'ToId':_0x2f0de6[_0x4518('0x5b')]['id'],'read':![]}})[_0x4518('0x24')](function(_0x2b6ab9){return{'id':_['toInteger'](_0x2f0de6[_0x4518('0x54')]['id']),'count':_0x2b6ab9};})[_0x4518('0x24')](respondWithResult(_0x5864e1,null))[_0x4518('0x2e')](handleError(_0x5864e1,null));};exports['addMembers']=function(_0x2baa7c,_0x2e11c5,_0x41fdfe){return db[_0x4518('0x3e')][_0x4518('0x55')]({'where':{'id':_0x2baa7c['params']['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x2e11c5,null))[_0x4518('0x24')](function(_0x1b38af){if(_0x1b38af){return _0x1b38af[_0x4518('0x5c')](_0x2baa7c[_0x4518('0x57')][_0x4518('0x5d')],_['omit'](_0x2baa7c[_0x4518('0x57')],['ids','id'])||{});}})[_0x4518('0x24')](respondWithResult(_0x2e11c5,null))[_0x4518('0x2e')](handleError(_0x2e11c5,null));};exports[_0x4518('0x5e')]=function(_0x4945d8,_0x5f4432,_0x27a8f8){var _0x1a78a2={};var _0x31abe1={};var _0x586df0;var _0x2d5a72;return db[_0x4518('0x3e')][_0x4518('0x5f')]({'where':{'id':_0x4945d8[_0x4518('0x54')]['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x5f4432,null))[_0x4518('0x24')](function(_0x437d28){if(_0x437d28){_0x586df0=_0x437d28;_0x31abe1['model']=_['keys'](db[_0x4518('0x60')][_0x4518('0x3f')]);_0x31abe1[_0x4518('0x41')]=_[_0x4518('0x42')](_0x4945d8['query']);_0x31abe1['filters']=_[_0x4518('0x44')](_0x31abe1[_0x4518('0x45')],_0x31abe1[_0x4518('0x41')]);_0x1a78a2['attributes']=_[_0x4518('0x44')](_0x31abe1['model'],qs['fields'](_0x4945d8[_0x4518('0x41')][_0x4518('0x47')]));_0x1a78a2[_0x4518('0x46')]=_0x1a78a2[_0x4518('0x46')][_0x4518('0x48')]?_0x1a78a2[_0x4518('0x46')]:_0x31abe1[_0x4518('0x45')];_0x1a78a2[_0x4518('0x61')]=qs['sort'](_0x4945d8[_0x4518('0x41')][_0x4518('0x4a')]);_0x1a78a2[_0x4518('0x4b')]=qs['filters'](_[_0x4518('0x4c')](_0x4945d8[_0x4518('0x41')],_0x31abe1[_0x4518('0x43')]));if(_0x4945d8[_0x4518('0x41')]['filter']){_0x1a78a2['where']=_[_0x4518('0x4d')](_0x1a78a2['where'],{'$or':_[_0x4518('0x3d')](_0x1a78a2[_0x4518('0x46')],function(_0x12090d){var _0x1c83ea={};_0x1c83ea[_0x12090d]={'$like':'%'+_0x4945d8['query'][_0x4518('0x62')]+'%'};return _0x1c83ea;})});}_0x1a78a2=_['merge']({},_0x1a78a2,_0x4945d8[_0x4518('0x4f')]);return _0x586df0['getMembers'](_0x1a78a2);}})[_0x4518('0x24')](function(_0x3113b2){if(_0x3113b2){_0x2d5a72=_0x3113b2[_0x4518('0x48')];if(!_0x4945d8['query'][_0x4518('0x63')]('nolimit')){_0x1a78a2[_0x4518('0x34')]=qs['limit'](_0x4945d8['query'][_0x4518('0x34')]);_0x1a78a2[_0x4518('0x33')]=qs[_0x4518('0x33')](_0x4945d8[_0x4518('0x41')][_0x4518('0x33')]);}return _0x586df0[_0x4518('0x5e')](_0x1a78a2);}})[_0x4518('0x24')](function(_0x27998c){if(_0x27998c){return _0x27998c?{'count':_0x2d5a72,'rows':_0x27998c}:null;}})[_0x4518('0x24')](respondWithResult(_0x5f4432,null))[_0x4518('0x2e')](handleError(_0x5f4432,null));};exports[_0x4518('0x64')]=function(_0x258acb,_0x3c190f,_0x275f29){return db['ChatGroup'][_0x4518('0x55')]({'where':{'id':_0x258acb[_0x4518('0x54')]['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x3c190f,null))[_0x4518('0x24')](function(_0x5d5e79){if(_0x5d5e79){return _0x5d5e79['removeMembers'](_0x258acb[_0x4518('0x41')]['ids']);}})[_0x4518('0x24')](respondWithStatusCode(_0x3c190f,null))['catch'](handleError(_0x3c190f,null));};exports[_0x4518('0x65')]=function(_0x2f3024,_0x2fc720,_0x469d39){if(_0x2f3024['body']['id']){delete _0x2f3024[_0x4518('0x57')]['id'];}return db[_0x4518('0x3e')]['find']({'where':{'id':_0x2f3024[_0x4518('0x54')]['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x2fc720,null))[_0x4518('0x24')](function(_0x11baca){if(_0x11baca){_0x2f3024[_0x4518('0x57')][_0x4518('0x66')]=_0x11baca['id'];return db['ChatInternalMessage']['create'](_0x2f3024[_0x4518('0x57')]);}})['then'](respondWithResult(_0x2fc720,null))[_0x4518('0x2e')](handleError(_0x2fc720,null));};exports[_0x4518('0x67')]=function(_0x2ea565,_0x139cea,_0x2f0820){var _0x22e801={};var _0x35c496={};var _0xdac129;var _0x1f073a;return db[_0x4518('0x3e')][_0x4518('0x5f')]({'where':{'id':_0x2ea565['params']['id']}})[_0x4518('0x24')](handleEntityNotFound(_0x139cea,null))[_0x4518('0x24')](function(_0x28f3ef){if(_0x28f3ef){_0xdac129=_0x28f3ef;_0x35c496[_0x4518('0x45')]=_[_0x4518('0x42')](db[_0x4518('0x5a')][_0x4518('0x3f')]);_0x35c496['query']=_[_0x4518('0x42')](_0x2ea565[_0x4518('0x41')]);_0x35c496[_0x4518('0x43')]=_[_0x4518('0x44')](_0x35c496[_0x4518('0x45')],_0x35c496[_0x4518('0x41')]);_0x22e801[_0x4518('0x46')]=_[_0x4518('0x44')](_0x35c496[_0x4518('0x45')],qs[_0x4518('0x47')](_0x2ea565[_0x4518('0x41')][_0x4518('0x47')]));_0x22e801[_0x4518('0x46')]=_0x22e801[_0x4518('0x46')][_0x4518('0x48')]?_0x22e801['attributes']:_0x35c496[_0x4518('0x45')];_0x22e801['order']=qs[_0x4518('0x4a')](_0x2ea565[_0x4518('0x41')][_0x4518('0x4a')]);_0x22e801[_0x4518('0x4b')]=qs[_0x4518('0x43')](_[_0x4518('0x4c')](_0x2ea565['query'],_0x35c496['filters']));if(_0x2ea565[_0x4518('0x41')]['filter']){_0x22e801[_0x4518('0x4b')]=_['merge'](_0x22e801[_0x4518('0x4b')],{'$or':_[_0x4518('0x3d')](_0x22e801['attributes'],function(_0x2667fe){var _0x4810a7={};_0x4810a7[_0x2667fe]={'$like':'%'+_0x2ea565[_0x4518('0x41')][_0x4518('0x62')]+'%'};return _0x4810a7;})});}if(_0x2ea565[_0x4518('0x41')][_0x4518('0x68')]){var _0xba269b=_0x2ea565[_0x4518('0x41')][_0x4518('0x68')][_0x4518('0x69')](',');var _0x43e3ef={};_0x43e3ef[_0xba269b[0x0]]={'$gte':moment(_0xba269b[0x1])[_0x4518('0x6a')](_0x4518('0x6b'))};_0x22e801[_0x4518('0x4b')]=_[_0x4518('0x4d')](_0x22e801[_0x4518('0x4b')],_0x43e3ef);}_0x22e801=_[_0x4518('0x4d')]({},_0x22e801,_0x2ea565[_0x4518('0x4f')]);return _0xdac129[_0x4518('0x67')](_0x22e801);}})[_0x4518('0x24')](function(_0x499bfb){if(_0x499bfb){_0x1f073a=_0x499bfb[_0x4518('0x48')];if(!_0x2ea565[_0x4518('0x41')][_0x4518('0x63')](_0x4518('0x49'))){_0x22e801[_0x4518('0x34')]=qs[_0x4518('0x34')](_0x2ea565[_0x4518('0x41')][_0x4518('0x34')]);_0x22e801[_0x4518('0x33')]=qs[_0x4518('0x33')](_0x2ea565[_0x4518('0x41')]['offset']);}return _0xdac129[_0x4518('0x67')](_0x22e801);}})[_0x4518('0x24')](function(_0x41dd41){if(_0x41dd41){return _0x41dd41?{'count':_0x1f073a,'rows':_0x41dd41}:null;}})['then'](respondWithResult(_0x139cea,null))[_0x4518('0x2e')](handleError(_0x139cea,null));}; \ No newline at end of file +var _0x6729=['limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','show','params','keys','length','include','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','getMembers','removeMembers','addMessage','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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','defaults','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','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x6729,0x178));var _0x9672=function(_0x1faf4e,_0x542bb0){_0x1faf4e=_0x1faf4e-0x0;var _0x3eb789=_0x6729[_0x1faf4e];return _0x3eb789;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9672('0x0'));var rimraf=require(_0x9672('0x1'));var zipdir=require(_0x9672('0x2'));var jsonpatch=require(_0x9672('0x3'));var rp=require(_0x9672('0x4'));var moment=require(_0x9672('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9672('0x6'));var util=require(_0x9672('0x7'));var path=require(_0x9672('0x8'));var sox=require('sox');var csv=require(_0x9672('0x9'));var ejs=require(_0x9672('0xa'));var fs=require('fs');var _=require(_0x9672('0xb'));var squel=require(_0x9672('0xc'));var crypto=require(_0x9672('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9672('0xe'));var toCsv=require(_0x9672('0x9'));var querystring=require(_0x9672('0xf'));var Papa=require(_0x9672('0x10'));var Redis=require(_0x9672('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9672('0x12'));var as=require(_0x9672('0x13'));var hardwareService=require(_0x9672('0x14'));var logger=require(_0x9672('0x15'))(_0x9672('0x16'));var utils=require(_0x9672('0x17'));var config=require(_0x9672('0x18'));var db=require(_0x9672('0x19'))['db'];config[_0x9672('0x1a')]=_[_0x9672('0x1b')](config[_0x9672('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9672('0x1a')]));require('./chatGroup.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9672('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d41cb,_0x437adc,_0x199cc5){if(_0x199cc5){var _0x28ddc9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28ddc9[_0x9672('0x1d')](_0x437adc)){return _0x5d41cb;}else{throw new db[(_0x9672('0x1e'))][(_0x9672('0x1f'))](_0x9672('0x20'));}}else{return _0x5d41cb;}}function respondWithRpcPromise(_0x4983bb,_0x50069f,_0x12ca6a,_0x5a7664){return new BPromise(function(_0x50e085,_0x3d358a){var _0x20a175=_0x5a7664||client;return _0x20a175['request'](_0x4983bb,_0x12ca6a)['then'](function(_0x316d2b){logger[_0x9672('0x21')](_0x9672('0x22'),_0x50069f,_0x9672('0x23'));logger[_0x9672('0x24')](_0x9672('0x25'),_0x50069f,_0x9672('0x23'),JSON[_0x9672('0x26')](_0x316d2b));if(_0x316d2b[_0x9672('0x27')]){if(_0x316d2b[_0x9672('0x27')][_0x9672('0x28')]===0x1f4){logger[_0x9672('0x27')](_0x9672('0x22'),_0x50069f,_0x316d2b['error']['message']);return _0x3d358a(_0x316d2b[_0x9672('0x27')][_0x9672('0x29')]);}logger['error'](_0x9672('0x22'),_0x50069f,_0x316d2b['error'][_0x9672('0x29')]);return _0x50e085(_0x316d2b[_0x9672('0x27')][_0x9672('0x29')]);}else{logger[_0x9672('0x21')](_0x9672('0x22'),_0x50069f,_0x9672('0x23'));_0x50e085(_0x316d2b['result'][_0x9672('0x29')]);}})[_0x9672('0x2a')](function(_0x22e328){logger[_0x9672('0x27')]('ChatGroup,\x20%s,\x20%s',_0x50069f,_0x22e328);_0x3d358a(_0x22e328);});});}function respondWithStatusCode(_0x1b13a1,_0x533220){_0x533220=_0x533220||0xcc;return function(_0x305d48){if(_0x305d48){return _0x1b13a1[_0x9672('0x2b')](_0x533220);}return _0x1b13a1[_0x9672('0x2c')](_0x533220)['end']();};}function respondWithResult(_0xb4949d,_0x2624cd){_0x2624cd=_0x2624cd||0xc8;return function(_0x5f1f3e){if(_0x5f1f3e){return _0xb4949d[_0x9672('0x2c')](_0x2624cd)[_0x9672('0x2d')](_0x5f1f3e);}};}function respondWithFilteredResult(_0x2d1010,_0x46adf4){return function(_0x4df39a){if(_0x4df39a){var _0x34cf69=_0x4df39a[_0x9672('0x2e')],_0xe85088=_0x46adf4[_0x9672('0x2f')],_0x52104d=_0x46adf4[_0x9672('0x2f')]+_0x46adf4[_0x9672('0x30')],_0x3a7cf0;if(_0x52104d>=_0x34cf69){_0x52104d=_0x34cf69;_0x3a7cf0=0xc8;}else{_0x3a7cf0=0xce;}_0x2d1010[_0x9672('0x2c')](_0x3a7cf0);return _0x2d1010['set'](_0x9672('0x31'),_0xe85088+'-'+_0x52104d+'/'+_0x34cf69)[_0x9672('0x2d')](_0x4df39a);}return null;};}function patchUpdates(_0x2da449){return function(_0x18380c){try{jsonpatch[_0x9672('0x32')](_0x18380c,_0x2da449,!![]);}catch(_0x25c216){return BPromise[_0x9672('0x33')](_0x25c216);}return _0x18380c[_0x9672('0x34')]();};}function saveUpdates(_0x14ff8c,_0x5294d5){return function(_0x5f54b1){if(_0x5f54b1){return _0x5f54b1[_0x9672('0x35')](_0x14ff8c)[_0x9672('0x36')](function(_0x37ccf1){return _0x37ccf1;});}return null;};}function removeEntity(_0x568d0f,_0x136b58){return function(_0x485b4b){if(_0x485b4b){return _0x485b4b[_0x9672('0x37')]()[_0x9672('0x36')](function(){_0x568d0f[_0x9672('0x2c')](0xcc)[_0x9672('0x38')]();});}};}function handleEntityNotFound(_0x11ac68,_0x3f15da){return function(_0x5c6a0c){if(!_0x5c6a0c){_0x11ac68['sendStatus'](0x194);}return _0x5c6a0c;};}function handleError(_0x2aabee,_0x38b9f8){_0x38b9f8=_0x38b9f8||0x1f4;return function(_0x537e70){logger[_0x9672('0x27')](_0x537e70[_0x9672('0x39')]);if(_0x537e70[_0x9672('0x3a')]){delete _0x537e70[_0x9672('0x3a')];}_0x2aabee[_0x9672('0x2c')](_0x38b9f8)[_0x9672('0x3b')](_0x537e70);};}exports[_0x9672('0x3c')]=function(_0x187293,_0x33e26e){var _0x35fe6a={},_0x2de0cb={},_0x3a5dfb={'count':0x0,'rows':[]};var _0x4c5303=_[_0x9672('0x3d')](db[_0x9672('0x3e')][_0x9672('0x3f')],function(_0x27359c){return{'name':_0x27359c[_0x9672('0x40')],'type':_0x27359c[_0x9672('0x41')][_0x9672('0x42')]};});_0x2de0cb[_0x9672('0x43')]=_[_0x9672('0x3d')](_0x4c5303,_0x9672('0x3a'));_0x2de0cb[_0x9672('0x44')]=_['keys'](_0x187293['query']);_0x2de0cb[_0x9672('0x45')]=_['intersection'](_0x2de0cb[_0x9672('0x43')],_0x2de0cb[_0x9672('0x44')]);_0x35fe6a[_0x9672('0x46')]=_[_0x9672('0x47')](_0x2de0cb[_0x9672('0x43')],qs[_0x9672('0x48')](_0x187293[_0x9672('0x44')][_0x9672('0x48')]));_0x35fe6a[_0x9672('0x46')]=_0x35fe6a[_0x9672('0x46')]['length']?_0x35fe6a[_0x9672('0x46')]:_0x2de0cb[_0x9672('0x43')];if(!_0x187293['query'][_0x9672('0x49')](_0x9672('0x4a'))){_0x35fe6a[_0x9672('0x30')]=qs['limit'](_0x187293[_0x9672('0x44')][_0x9672('0x30')]);_0x35fe6a['offset']=qs[_0x9672('0x2f')](_0x187293[_0x9672('0x44')][_0x9672('0x2f')]);}_0x35fe6a[_0x9672('0x4b')]=qs[_0x9672('0x4c')](_0x187293[_0x9672('0x44')][_0x9672('0x4c')]);_0x35fe6a['where']=qs[_0x9672('0x45')](_['pick'](_0x187293[_0x9672('0x44')],_0x2de0cb[_0x9672('0x45')]),_0x4c5303);if(_0x187293[_0x9672('0x44')][_0x9672('0x4d')]){_0x35fe6a[_0x9672('0x4e')]=_[_0x9672('0x4f')](_0x35fe6a[_0x9672('0x4e')],{'$or':_['map'](_0x4c5303,function(_0x23c389){if(_0x23c389['type']!=='VIRTUAL'){var _0x32f04e={};_0x32f04e[_0x23c389[_0x9672('0x3a')]]={'$like':'%'+_0x187293[_0x9672('0x44')][_0x9672('0x4d')]+'%'};return _0x32f04e;}})});}_0x35fe6a=_['merge']({},_0x35fe6a,_0x187293[_0x9672('0x50')]);var _0x4f37db={'where':_0x35fe6a[_0x9672('0x4e')]};return db[_0x9672('0x3e')]['count'](_0x4f37db)[_0x9672('0x36')](function(_0x2228b4){_0x3a5dfb['count']=_0x2228b4;if(_0x187293[_0x9672('0x44')][_0x9672('0x51')]){_0x35fe6a['include']=[{'all':!![]}];}return db['ChatGroup'][_0x9672('0x52')](_0x35fe6a);})[_0x9672('0x36')](function(_0x395d7a){_0x3a5dfb[_0x9672('0x53')]=_0x395d7a;return _0x3a5dfb;})[_0x9672('0x36')](respondWithFilteredResult(_0x33e26e,_0x35fe6a))[_0x9672('0x2a')](handleError(_0x33e26e,null));};exports[_0x9672('0x54')]=function(_0x1d8682,_0x25c76d){var _0x52aea1={'raw':!![],'where':{'id':_0x1d8682[_0x9672('0x55')]['id']}},_0x2e0858={};_0x2e0858[_0x9672('0x43')]=_['keys'](db[_0x9672('0x3e')]['rawAttributes']);_0x2e0858['query']=_[_0x9672('0x56')](_0x1d8682[_0x9672('0x44')]);_0x2e0858[_0x9672('0x45')]=_['intersection'](_0x2e0858[_0x9672('0x43')],_0x2e0858['query']);_0x52aea1[_0x9672('0x46')]=_[_0x9672('0x47')](_0x2e0858[_0x9672('0x43')],qs[_0x9672('0x48')](_0x1d8682[_0x9672('0x44')][_0x9672('0x48')]));_0x52aea1[_0x9672('0x46')]=_0x52aea1[_0x9672('0x46')][_0x9672('0x57')]?_0x52aea1[_0x9672('0x46')]:_0x2e0858['model'];if(_0x1d8682['query'][_0x9672('0x51')]){_0x52aea1[_0x9672('0x58')]=[{'all':!![]}];}_0x52aea1=_[_0x9672('0x4f')]({},_0x52aea1,_0x1d8682[_0x9672('0x50')]);return db[_0x9672('0x3e')]['find'](_0x52aea1)['then'](handleEntityNotFound(_0x25c76d,null))['then'](respondWithResult(_0x25c76d,null))['catch'](handleError(_0x25c76d,null));};exports[_0x9672('0x59')]=function(_0x3ba7df,_0xb0c88){return db[_0x9672('0x3e')][_0x9672('0x59')](_0x3ba7df[_0x9672('0x5a')],{})[_0x9672('0x36')](respondWithResult(_0xb0c88,0xc9))[_0x9672('0x2a')](handleError(_0xb0c88,null));};exports[_0x9672('0x35')]=function(_0xde30b,_0x54c317){if(_0xde30b[_0x9672('0x5a')]['id']){delete _0xde30b[_0x9672('0x5a')]['id'];}return db[_0x9672('0x3e')]['find']({'where':{'id':_0xde30b[_0x9672('0x55')]['id']}})['then'](handleEntityNotFound(_0x54c317,null))[_0x9672('0x36')](saveUpdates(_0xde30b[_0x9672('0x5a')],null))[_0x9672('0x36')](respondWithResult(_0x54c317,null))[_0x9672('0x2a')](handleError(_0x54c317,null));};exports[_0x9672('0x37')]=function(_0x5803bc,_0x462159){return db[_0x9672('0x3e')][_0x9672('0x5b')]({'where':{'id':_0x5803bc['params']['id']}})[_0x9672('0x36')](handleEntityNotFound(_0x462159,null))[_0x9672('0x36')](removeEntity(_0x462159,null))[_0x9672('0x2a')](handleError(_0x462159,null));};exports[_0x9672('0x5c')]=function(_0xc09bfe,_0x14e14a){return db[_0x9672('0x3e')][_0x9672('0x5c')]()['then'](respondWithResult(_0x14e14a,null))[_0x9672('0x2a')](handleError(_0x14e14a,null));};exports['getUnread']=function(_0x15e043,_0x3f5ffa,_0x540243){return db[_0x9672('0x5d')][_0x9672('0x2e')]({'where':{'ChatGroupId':_0x15e043['params']['id'],'ToId':_0x15e043[_0x9672('0x5e')]['id'],'read':![]}})['then'](function(_0x3a73e9){return{'id':_[_0x9672('0x5f')](_0x15e043[_0x9672('0x55')]['id']),'count':_0x3a73e9};})[_0x9672('0x36')](respondWithResult(_0x3f5ffa,null))['catch'](handleError(_0x3f5ffa,null));};exports[_0x9672('0x60')]=function(_0x458972,_0x4f8550,_0x2dab2a){return db['ChatGroup'][_0x9672('0x5b')]({'where':{'id':_0x458972[_0x9672('0x55')]['id']}})[_0x9672('0x36')](handleEntityNotFound(_0x4f8550,null))[_0x9672('0x36')](function(_0x396857){if(_0x396857){return _0x396857[_0x9672('0x60')](_0x458972[_0x9672('0x5a')][_0x9672('0x61')],_[_0x9672('0x62')](_0x458972[_0x9672('0x5a')],[_0x9672('0x61'),'id'])||{});}})[_0x9672('0x36')](respondWithResult(_0x4f8550,null))[_0x9672('0x2a')](handleError(_0x4f8550,null));};exports['getMembers']=function(_0x209e3e,_0x1a56ca,_0x526d31){var _0x20607a={};var _0x44fe0f={};var _0x5aee2d;var _0xf6e5d2;return db[_0x9672('0x3e')][_0x9672('0x63')]({'where':{'id':_0x209e3e[_0x9672('0x55')]['id']}})[_0x9672('0x36')](handleEntityNotFound(_0x1a56ca,null))[_0x9672('0x36')](function(_0x4b7029){if(_0x4b7029){_0x5aee2d=_0x4b7029;_0x44fe0f[_0x9672('0x43')]=_['keys'](db['User'][_0x9672('0x3f')]);_0x44fe0f[_0x9672('0x44')]=_[_0x9672('0x56')](_0x209e3e[_0x9672('0x44')]);_0x44fe0f[_0x9672('0x45')]=_[_0x9672('0x47')](_0x44fe0f[_0x9672('0x43')],_0x44fe0f[_0x9672('0x44')]);_0x20607a[_0x9672('0x46')]=_[_0x9672('0x47')](_0x44fe0f[_0x9672('0x43')],qs[_0x9672('0x48')](_0x209e3e['query'][_0x9672('0x48')]));_0x20607a[_0x9672('0x46')]=_0x20607a[_0x9672('0x46')][_0x9672('0x57')]?_0x20607a[_0x9672('0x46')]:_0x44fe0f['model'];_0x20607a[_0x9672('0x4b')]=qs[_0x9672('0x4c')](_0x209e3e[_0x9672('0x44')][_0x9672('0x4c')]);_0x20607a[_0x9672('0x4e')]=qs[_0x9672('0x45')](_['pick'](_0x209e3e[_0x9672('0x44')],_0x44fe0f[_0x9672('0x45')]));if(_0x209e3e[_0x9672('0x44')][_0x9672('0x4d')]){_0x20607a[_0x9672('0x4e')]=_[_0x9672('0x4f')](_0x20607a[_0x9672('0x4e')],{'$or':_[_0x9672('0x3d')](_0x20607a[_0x9672('0x46')],function(_0x2854c3){var _0x44ca6d={};_0x44ca6d[_0x2854c3]={'$like':'%'+_0x209e3e[_0x9672('0x44')][_0x9672('0x4d')]+'%'};return _0x44ca6d;})});}_0x20607a=_[_0x9672('0x4f')]({},_0x20607a,_0x209e3e[_0x9672('0x50')]);return _0x5aee2d[_0x9672('0x64')](_0x20607a);}})['then'](function(_0x55fae5){if(_0x55fae5){_0xf6e5d2=_0x55fae5['length'];if(!_0x209e3e[_0x9672('0x44')]['hasOwnProperty']('nolimit')){_0x20607a[_0x9672('0x30')]=qs[_0x9672('0x30')](_0x209e3e[_0x9672('0x44')][_0x9672('0x30')]);_0x20607a[_0x9672('0x2f')]=qs[_0x9672('0x2f')](_0x209e3e[_0x9672('0x44')][_0x9672('0x2f')]);}return _0x5aee2d[_0x9672('0x64')](_0x20607a);}})['then'](function(_0x44c68c){if(_0x44c68c){return _0x44c68c?{'count':_0xf6e5d2,'rows':_0x44c68c}:null;}})[_0x9672('0x36')](respondWithResult(_0x1a56ca,null))[_0x9672('0x2a')](handleError(_0x1a56ca,null));};exports[_0x9672('0x65')]=function(_0x4ff11c,_0x494a3d,_0x4d0a05){return db[_0x9672('0x3e')][_0x9672('0x5b')]({'where':{'id':_0x4ff11c[_0x9672('0x55')]['id']}})['then'](handleEntityNotFound(_0x494a3d,null))[_0x9672('0x36')](function(_0x19df98){if(_0x19df98){return _0x19df98['removeMembers'](_0x4ff11c['query'][_0x9672('0x61')]);}})[_0x9672('0x36')](respondWithStatusCode(_0x494a3d,null))['catch'](handleError(_0x494a3d,null));};exports[_0x9672('0x66')]=function(_0x4a37f8,_0x55dcb9,_0x44b4bb){if(_0x4a37f8[_0x9672('0x5a')]['id']){delete _0x4a37f8['body']['id'];}return db['ChatGroup'][_0x9672('0x5b')]({'where':{'id':_0x4a37f8[_0x9672('0x55')]['id']}})[_0x9672('0x36')](handleEntityNotFound(_0x55dcb9,null))[_0x9672('0x36')](function(_0x34ef24){if(_0x34ef24){_0x4a37f8['body']['ChatGroupId']=_0x34ef24['id'];return db['ChatInternalMessage'][_0x9672('0x59')](_0x4a37f8['body']);}})[_0x9672('0x36')](respondWithResult(_0x55dcb9,null))[_0x9672('0x2a')](handleError(_0x55dcb9,null));};exports[_0x9672('0x67')]=function(_0x2dca28,_0x3a4af5,_0x3ad3e1){var _0x26dc58={};var _0x1ca11b={};var _0x530876;var _0x2b250d;return db['ChatGroup']['findOne']({'where':{'id':_0x2dca28['params']['id']}})[_0x9672('0x36')](handleEntityNotFound(_0x3a4af5,null))[_0x9672('0x36')](function(_0x2c77fb){if(_0x2c77fb){_0x530876=_0x2c77fb;_0x1ca11b[_0x9672('0x43')]=_[_0x9672('0x56')](db[_0x9672('0x5d')][_0x9672('0x3f')]);_0x1ca11b[_0x9672('0x44')]=_['keys'](_0x2dca28[_0x9672('0x44')]);_0x1ca11b[_0x9672('0x45')]=_['intersection'](_0x1ca11b[_0x9672('0x43')],_0x1ca11b['query']);_0x26dc58[_0x9672('0x46')]=_[_0x9672('0x47')](_0x1ca11b[_0x9672('0x43')],qs['fields'](_0x2dca28[_0x9672('0x44')]['fields']));_0x26dc58['attributes']=_0x26dc58[_0x9672('0x46')]['length']?_0x26dc58[_0x9672('0x46')]:_0x1ca11b[_0x9672('0x43')];_0x26dc58[_0x9672('0x4b')]=qs[_0x9672('0x4c')](_0x2dca28[_0x9672('0x44')][_0x9672('0x4c')]);_0x26dc58[_0x9672('0x4e')]=qs[_0x9672('0x45')](_['pick'](_0x2dca28['query'],_0x1ca11b[_0x9672('0x45')]));if(_0x2dca28['query'][_0x9672('0x4d')]){_0x26dc58[_0x9672('0x4e')]=_[_0x9672('0x4f')](_0x26dc58['where'],{'$or':_['map'](_0x26dc58[_0x9672('0x46')],function(_0x14a49){var _0x573897={};_0x573897[_0x14a49]={'$like':'%'+_0x2dca28[_0x9672('0x44')][_0x9672('0x4d')]+'%'};return _0x573897;})});}if(_0x2dca28[_0x9672('0x44')]['$gte']){var _0x1e7490=_0x2dca28[_0x9672('0x44')]['$gte']['split'](',');var _0x6a918={};_0x6a918[_0x1e7490[0x0]]={'$gte':moment(_0x1e7490[0x1])[_0x9672('0x68')](_0x9672('0x69'))};_0x26dc58[_0x9672('0x4e')]=_['merge'](_0x26dc58['where'],_0x6a918);}_0x26dc58=_['merge']({},_0x26dc58,_0x2dca28[_0x9672('0x50')]);return _0x530876[_0x9672('0x67')](_0x26dc58);}})[_0x9672('0x36')](function(_0x4044cc){if(_0x4044cc){_0x2b250d=_0x4044cc[_0x9672('0x57')];if(!_0x2dca28[_0x9672('0x44')][_0x9672('0x49')](_0x9672('0x4a'))){_0x26dc58[_0x9672('0x30')]=qs['limit'](_0x2dca28[_0x9672('0x44')][_0x9672('0x30')]);_0x26dc58[_0x9672('0x2f')]=qs[_0x9672('0x2f')](_0x2dca28[_0x9672('0x44')][_0x9672('0x2f')]);}return _0x530876[_0x9672('0x67')](_0x26dc58);}})[_0x9672('0x36')](function(_0x1c0e0b){if(_0x1c0e0b){return _0x1c0e0b?{'count':_0x2b250d,'rows':_0x1c0e0b}:null;}})[_0x9672('0x36')](respondWithResult(_0x3a4af5,null))[_0x9672('0x2a')](handleError(_0x3a4af5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ec9d79f..93f3c29 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xadb5,0xad));var _0x5adb=function(_0x2825e2,_0x4e21e7){_0x2825e2=_0x2825e2-0x0;var _0x3887f5=_0xadb5[_0x2825e2];return _0x3887f5;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0xadb5,0xad));var _0x5adb=function(_0x2ca37e,_0x1cfcd3){_0x2ca37e=_0x2ca37e-0x0;var _0xdce261=_0xadb5[_0x2ca37e];return _0xdce261;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0d2284e..d534f59 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 _0x236d=['lodash','util','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var logger=require('../../config/logger')(_0xd236('0x2'));var moment=require('moment');var BPromise=require(_0xd236('0x3'));var rp=require(_0xd236('0x4'));var fs=require('fs');var path=require(_0xd236('0x5'));var rimraf=require(_0xd236('0x6'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xd236('0x7')]=function(_0x29a67c,_0x75d84c){return _0x29a67c[_0xd236('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6075=['path','rimraf','../../config/environment','exports','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6075,0x191));var _0x5607=function(_0x47f89e,_0x577991){_0x47f89e=_0x47f89e-0x0;var _0x57a161=_0x6075[_0x47f89e];return _0x57a161;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./chatGroup.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('ChatGroup',attributes,{'tableName':_0x5607('0xa'),'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 caeb402..709beb8 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 _0x6d32=['socket.io-emitter','./chatGroup.socket','register','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ChatGroup,\x20%s,\x20%s','lodash','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x59a3aa,_0x155b2b){var _0x3f64f9=function(_0x160398){while(--_0x160398){_0x59a3aa['push'](_0x59a3aa['shift']());}};_0x3f64f9(++_0x155b2b);}(_0x6d32,0x107));var _0x26d3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6d32[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x26d3('0x0'));var util=require(_0x26d3('0x1'));var moment=require(_0x26d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x26d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26d3('0x4'));var config=require(_0x26d3('0x5'));var jayson=require(_0x26d3('0x6'));var client=jayson[_0x26d3('0x7')][_0x26d3('0x8')]({'port':0x232a});config['redis']=_[_0x26d3('0x9')](config[_0x26d3('0xa')],{'host':_0x26d3('0xb'),'port':0x18eb});var socket=require(_0x26d3('0xc'))(new Redis(config[_0x26d3('0xa')]));require(_0x26d3('0xd'))[_0x26d3('0xe')](socket);function respondWithRpcPromise(_0x308e93,_0x4e1ba4,_0x5efafa){return new BPromise(function(_0x3a5eb0,_0x3376db){return client['request'](_0x308e93,_0x5efafa)[_0x26d3('0xf')](function(_0x1d9576){logger['info']('ChatGroup,\x20%s,\x20%s',_0x4e1ba4,'request\x20sent');logger[_0x26d3('0x10')](_0x26d3('0x11'),_0x4e1ba4,_0x26d3('0x12'),JSON[_0x26d3('0x13')](_0x1d9576));if(_0x1d9576[_0x26d3('0x14')]){if(_0x1d9576[_0x26d3('0x14')][_0x26d3('0x15')]===0x1f4){logger[_0x26d3('0x14')]('ChatGroup,\x20%s,\x20%s',_0x4e1ba4,_0x1d9576['error'][_0x26d3('0x16')]);return _0x3376db(_0x1d9576[_0x26d3('0x14')]['message']);}logger[_0x26d3('0x14')]('ChatGroup,\x20%s,\x20%s',_0x4e1ba4,_0x1d9576[_0x26d3('0x14')][_0x26d3('0x16')]);return _0x3a5eb0(_0x1d9576[_0x26d3('0x14')][_0x26d3('0x16')]);}else{logger[_0x26d3('0x17')](_0x26d3('0x18'),_0x4e1ba4,_0x26d3('0x12'));_0x3a5eb0(_0x1d9576['result'][_0x26d3('0x16')]);}})['catch'](function(_0x2e02cd){logger[_0x26d3('0x14')](_0x26d3('0x18'),_0x4e1ba4,_0x2e02cd);_0x3376db(_0x2e02cd);});});} \ No newline at end of file +var _0xb498=['defaults','localhost','socket.io-emitter','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','http','redis'];(function(_0x1866ae,_0x21b0ac){var _0x4ec0f4=function(_0x4b4a5f){while(--_0x4b4a5f){_0x1866ae['push'](_0x1866ae['shift']());}};_0x4ec0f4(++_0x21b0ac);}(_0xb498,0x6f));var _0x8b49=function(_0x60aa22,_0x358f6a){_0x60aa22=_0x60aa22-0x0;var _0x3b1bc=_0xb498[_0x60aa22];return _0x3b1bc;};'use strict';var _=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var moment=require(_0x8b49('0x2'));var BPromise=require(_0x8b49('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b49('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8b49('0x5'));var jayson=require(_0x8b49('0x6'));var client=jayson['client'][_0x8b49('0x7')]({'port':0x232a});config[_0x8b49('0x8')]=_[_0x8b49('0x9')](config[_0x8b49('0x8')],{'host':_0x8b49('0xa'),'port':0x18eb});var socket=require(_0x8b49('0xb'))(new Redis(config[_0x8b49('0x8')]));require(_0x8b49('0xc'))['register'](socket);function respondWithRpcPromise(_0x47d4e9,_0x1d9814,_0x3fadae){return new BPromise(function(_0x285b8c,_0x1373a6){return client[_0x8b49('0xd')](_0x47d4e9,_0x3fadae)['then'](function(_0x33a353){logger[_0x8b49('0xe')](_0x8b49('0xf'),_0x1d9814,_0x8b49('0x10'));logger[_0x8b49('0x11')](_0x8b49('0x12'),_0x1d9814,_0x8b49('0x10'),JSON[_0x8b49('0x13')](_0x33a353));if(_0x33a353[_0x8b49('0x14')]){if(_0x33a353[_0x8b49('0x14')]['code']===0x1f4){logger[_0x8b49('0x14')](_0x8b49('0xf'),_0x1d9814,_0x33a353[_0x8b49('0x14')]['message']);return _0x1373a6(_0x33a353[_0x8b49('0x14')][_0x8b49('0x15')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x1d9814,_0x33a353[_0x8b49('0x14')][_0x8b49('0x15')]);return _0x285b8c(_0x33a353['error']['message']);}else{logger['info'](_0x8b49('0xf'),_0x1d9814,_0x8b49('0x10'));_0x285b8c(_0x33a353[_0x8b49('0x16')][_0x8b49('0x15')]);}})[_0x8b49('0x17')](function(_0x231423){logger['error'](_0x8b49('0xf'),_0x1d9814,_0x231423);_0x1373a6(_0x231423);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a7575f2..114820d 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 _0x546c=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x481ff7,_0x2b6ebb){var _0x1c1573=function(_0x4933fe){while(--_0x4933fe){_0x481ff7['push'](_0x481ff7['shift']());}};_0x1c1573(++_0x2b6ebb);}(_0x546c,0x82));var _0xc546=function(_0x20166d,_0x5674bd){_0x20166d=_0x20166d-0x0;var _0x5792a8=_0x546c[_0x20166d];return _0x5792a8;};'use strict';var ChatGroupEvents=require(_0xc546('0x0'));var events=[_0xc546('0x1'),_0xc546('0x2'),_0xc546('0x3')];function createListener(_0x5ba328,_0x308310){return function(_0x2c3f7a){_0x308310[_0xc546('0x4')](_0x5ba328,_0x2c3f7a);};}function removeListener(_0xd1685a,_0xfdb5b1){return function(){ChatGroupEvents[_0xc546('0x5')](_0xd1685a,_0xfdb5b1);};}exports[_0xc546('0x6')]=function(_0x76d95b){for(var _0x548f4c=0x0,_0x82e0fb=events[_0xc546('0x7')];_0x548f4c<_0x82e0fb;_0x548f4c++){var _0x5acebe=events[_0x548f4c];var _0x501270=createListener(_0xc546('0x8')+_0x5acebe,_0x76d95b);ChatGroupEvents['on'](_0x5acebe,_0x501270);}}; \ No newline at end of file +var _0x637d=['chatGroup:','./chatGroup.events','save','update','emit'];(function(_0xbb5c26,_0xa31f41){var _0x5008e8=function(_0x2fac80){while(--_0x2fac80){_0xbb5c26['push'](_0xbb5c26['shift']());}};_0x5008e8(++_0xa31f41);}(_0x637d,0x141));var _0xd637=function(_0x5d5c90,_0x595ad6){_0x5d5c90=_0x5d5c90-0x0;var _0x2f7de3=_0x637d[_0x5d5c90];return _0x2f7de3;};'use strict';var ChatGroupEvents=require(_0xd637('0x0'));var events=[_0xd637('0x1'),'remove',_0xd637('0x2')];function createListener(_0x389b0b,_0x3d5830){return function(_0x116f85){_0x3d5830[_0xd637('0x3')](_0x389b0b,_0x116f85);};}function removeListener(_0x1b8ec0,_0x171099){return function(){ChatGroupEvents['removeListener'](_0x1b8ec0,_0x171099);};}exports['register']=function(_0x51bd8c){for(var _0x56191c=0x0,_0x558ca8=events['length'];_0x56191c<_0x558ca8;_0x56191c++){var _0x4f3c62=events[_0x56191c];var _0xf7c315=createListener(_0xd637('0x4')+_0x4f3c62,_0x51bd8c);ChatGroupEvents['on'](_0x4f3c62,_0xf7c315);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c24b014..ac64035 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 _0xf486=['destroy','removeMembers','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','update','delete'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf486,0x1bc));var _0x6f48=function(_0x2ec6fa,_0x190e5a){_0x2ec6fa=_0x2ec6fa-0x0;var _0x20cef1=_0xf486[_0x2ec6fa];return _0x20cef1;};'use strict';var multer=require(_0x6f48('0x0'));var util=require(_0x6f48('0x1'));var path=require('path');var timeout=require(_0x6f48('0x2'));var express=require(_0x6f48('0x3'));var router=express[_0x6f48('0x4')]();var auth=require(_0x6f48('0x5'));var interaction=require(_0x6f48('0x6'));var config=require(_0x6f48('0x7'));var controller=require('./chatGroup.controller');router[_0x6f48('0x8')]('/',auth[_0x6f48('0x9')](),controller[_0x6f48('0xa')]);router['get'](_0x6f48('0xb'),auth[_0x6f48('0x9')](),controller['describe']);router[_0x6f48('0x8')](_0x6f48('0xc'),auth[_0x6f48('0x9')](),controller[_0x6f48('0xd')]);router[_0x6f48('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x6f48('0xe')]);router[_0x6f48('0x8')](_0x6f48('0xf'),auth[_0x6f48('0x9')](),controller[_0x6f48('0x10')]);router[_0x6f48('0x8')](_0x6f48('0x11'),auth[_0x6f48('0x9')](),controller[_0x6f48('0x12')]);router['post']('/',auth[_0x6f48('0x9')](),controller['create']);router[_0x6f48('0x13')]('/:id/members',auth[_0x6f48('0x9')](),controller['addMembers']);router[_0x6f48('0x13')](_0x6f48('0x11'),auth['isAuthenticated'](),controller[_0x6f48('0x14')]);router[_0x6f48('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6f48('0x16')]);router[_0x6f48('0x17')](_0x6f48('0xc'),auth[_0x6f48('0x9')](),controller[_0x6f48('0x18')]);router[_0x6f48('0x17')]('/:id/members',auth[_0x6f48('0x9')](),controller[_0x6f48('0x19')]);module['exports']=router; \ No newline at end of file +var _0xf066=['getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/unread'];(function(_0x5ad6d8,_0x5f5032){var _0x34df5b=function(_0x411f00){while(--_0x411f00){_0x5ad6d8['push'](_0x5ad6d8['shift']());}};_0x34df5b(++_0x5f5032);}(_0xf066,0xdc));var _0x6f06=function(_0x367816,_0x35633c){_0x367816=_0x367816-0x0;var _0x2cdde2=_0xf066[_0x367816];return _0x2cdde2;};'use strict';var multer=require(_0x6f06('0x0'));var util=require(_0x6f06('0x1'));var path=require(_0x6f06('0x2'));var timeout=require(_0x6f06('0x3'));var express=require(_0x6f06('0x4'));var router=express[_0x6f06('0x5')]();var auth=require(_0x6f06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f06('0x7'));var controller=require('./chatGroup.controller');router[_0x6f06('0x8')]('/',auth[_0x6f06('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6f06('0xa')]);router['get'](_0x6f06('0xb'),auth[_0x6f06('0x9')](),controller[_0x6f06('0xc')]);router[_0x6f06('0x8')](_0x6f06('0xd'),auth[_0x6f06('0x9')](),controller[_0x6f06('0xe')]);router[_0x6f06('0x8')](_0x6f06('0xf'),auth['isAuthenticated'](),controller[_0x6f06('0x10')]);router['get'](_0x6f06('0x11'),auth[_0x6f06('0x9')](),controller[_0x6f06('0x12')]);router[_0x6f06('0x13')]('/',auth[_0x6f06('0x9')](),controller[_0x6f06('0x14')]);router[_0x6f06('0x13')](_0x6f06('0xf'),auth[_0x6f06('0x9')](),controller[_0x6f06('0x15')]);router[_0x6f06('0x13')](_0x6f06('0x11'),auth[_0x6f06('0x9')](),controller['addMessage']);router[_0x6f06('0x16')](_0x6f06('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6f06('0xb'),auth[_0x6f06('0x9')](),controller['destroy']);router[_0x6f06('0x17')]('/:id/members',auth[_0x6f06('0x9')](),controller[_0x6f06('0x18')]);module[_0x6f06('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 196ab0e..eff0754 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 _0x5621=['BOOLEAN','INTEGER','ENUM','thumb','TEXT','DATE','STRING','long','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5621,0x131));var _0x1562=function(_0x55d109,_0x484df9){_0x55d109=_0x55d109-0x0;var _0x40a177=_0x5621[_0x55d109];return _0x40a177;};'use strict';var Sequelize=require(_0x1562('0x0'));module['exports']={'closed':{'type':Sequelize[_0x1562('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1562('0x2')]},'ratingType':{'type':Sequelize[_0x1562('0x3')]('star',_0x1562('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1562('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1562('0x6')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1562('0x7')]},'browserName':{'type':Sequelize[_0x1562('0x7')]},'browserVersion':{'type':Sequelize[_0x1562('0x7')]},'osName':{'type':Sequelize[_0x1562('0x7')]},'osVersion':{'type':Sequelize[_0x1562('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1562('0x7')]},'deviceType':{'type':Sequelize[_0x1562('0x7')]},'referer':{'type':Sequelize[_0x1562('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x1562('0x5')](_0x1562('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1562('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1562('0x7')]},'customerPort':{'type':Sequelize[_0x1562('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x1562('0x5')]}}; \ No newline at end of file +var _0x4cf4=['INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cf4,0x168));var _0x44cf=function(_0x4432c6,_0x156a8d){_0x4432c6=_0x4432c6-0x0;var _0x193cb7=_0x4cf4[_0x4432c6];return _0x193cb7;};'use strict';var Sequelize=require(_0x44cf('0x0'));module[_0x44cf('0x1')]={'closed':{'type':Sequelize[_0x44cf('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x44cf('0x3')]},'ratingType':{'type':Sequelize[_0x44cf('0x4')]('star',_0x44cf('0x5')),'defaultValue':_0x44cf('0x6')},'ratingMessage':{'type':Sequelize[_0x44cf('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x44cf('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x44cf('0x9')]},'disposition':{'type':Sequelize[_0x44cf('0x8')]},'note':{'type':Sequelize[_0x44cf('0x8')]},'browserName':{'type':Sequelize[_0x44cf('0x8')]},'browserVersion':{'type':Sequelize[_0x44cf('0x8')]},'osName':{'type':Sequelize[_0x44cf('0x8')]},'osVersion':{'type':Sequelize[_0x44cf('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x44cf('0x8')]},'referer':{'type':Sequelize[_0x44cf('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x44cf('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x44cf('0x9')]},'lastMsgAt':{'type':Sequelize[_0x44cf('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x44cf('0x4')]('in',_0x44cf('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x44cf('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x44cf('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 060b809..cc5ef8f 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 _0x583c=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','Sequelize','ValidationError','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','map','fullname','TagIds','Tags','split','ChatInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','value','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','type','body','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','create','describe','vidaooApiKey','vidaooEscalation','POST','MotionCWB:','follow','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','attachId','download','join','root','server/files/attachments/','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','getMyMessages','addTags','omit','emit','removeTags','server','files','attachments','firstName','lastName','ChatWebsite','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','Owner','N.A.','closedAt','osName','referer','customerIp','customerPort','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.html','toFile','.pdf','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs'];(function(_0x3c7667,_0x53ed22){var _0x17f69c=function(_0x5d93b3){while(--_0x5d93b3){_0x3c7667['push'](_0x3c7667['shift']());}};_0x17f69c(++_0x53ed22);}(_0x583c,0x12b));var _0xc583=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x583c[_0x36c5b0];return _0xf19333;};'use strict';var pdf=require(_0xc583('0x0'));var emlformat=require(_0xc583('0x1'));var rimraf=require(_0xc583('0x2'));var zipdir=require(_0xc583('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc583('0x4'));var moment=require(_0xc583('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc583('0x6'));var path=require(_0xc583('0x7'));var sox=require('sox');var csv=require(_0xc583('0x8'));var ejs=require(_0xc583('0x9'));var fs=require('fs');var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var db=require('../../mysqldb')['db'];config[_0xc583('0x17')]=_[_0xc583('0x18')](config[_0xc583('0x17')],{'host':_0xc583('0x19'),'port':0x18eb});var socket=require(_0xc583('0x1a'))(new Redis(config[_0xc583('0x17')]));require(_0xc583('0x1b'))[_0xc583('0x1c')](socket);var jayson=require(_0xc583('0x1d'));var client=jayson['client'][_0xc583('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0xc583('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x299fa1,_0x510090,_0x263552){if(_0x263552){var _0x311ad5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x311ad5['test'](_0x510090)){return _0x299fa1;}else{throw new db[(_0xc583('0x1f'))][(_0xc583('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 _0x299fa1;}}function respondWithRpcPromise(_0x21cf22,_0x8a2d84,_0x12aac2,_0x36e0fd){return new BPromise(function(_0x5433ec,_0x3dd3cc){var _0x48a65a=_0x36e0fd||client;return _0x48a65a[_0xc583('0x21')](_0x21cf22,_0x12aac2)[_0xc583('0x22')](function(_0xfd9a60){logger[_0xc583('0x23')](_0xc583('0x24'),_0x8a2d84,_0xc583('0x25'));logger[_0xc583('0x26')](_0xc583('0x27'),_0x8a2d84,_0xc583('0x25'),JSON[_0xc583('0x28')](_0xfd9a60));if(_0xfd9a60[_0xc583('0x29')]){if(_0xfd9a60[_0xc583('0x29')][_0xc583('0x2a')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x8a2d84,_0xfd9a60[_0xc583('0x29')][_0xc583('0x2b')]);return _0x3dd3cc(_0xfd9a60[_0xc583('0x29')]['message']);}logger[_0xc583('0x29')](_0xc583('0x24'),_0x8a2d84,_0xfd9a60[_0xc583('0x29')][_0xc583('0x2b')]);return _0x5433ec(_0xfd9a60[_0xc583('0x29')]['message']);}else{logger['info'](_0xc583('0x24'),_0x8a2d84,'request\x20sent');_0x5433ec(_0xfd9a60[_0xc583('0x2c')][_0xc583('0x2b')]);}})[_0xc583('0x2d')](function(_0x1e7809){logger[_0xc583('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x8a2d84,_0x1e7809);_0x3dd3cc(_0x1e7809);});});}function respondWithStatusCode(_0x2dafb4,_0x44f76a){_0x44f76a=_0x44f76a||0xcc;return function(_0x4adde3){if(_0x4adde3){return _0x2dafb4[_0xc583('0x2e')](_0x44f76a);}return _0x2dafb4['status'](_0x44f76a)[_0xc583('0x2f')]();};}function respondWithResult(_0x8d4ecb,_0x1c80b1){_0x1c80b1=_0x1c80b1||0xc8;return function(_0x3ed083){if(_0x3ed083){return _0x8d4ecb[_0xc583('0x30')](_0x1c80b1)[_0xc583('0x31')](_0x3ed083);}};}function respondWithFilteredResult(_0x113b39,_0x4a87b5){return function(_0x529dbe){if(_0x529dbe){var _0x390bc3=_0x529dbe[_0xc583('0x32')],_0x23f3a4=_0x4a87b5['offset'],_0xcbf1f1=_0x4a87b5[_0xc583('0x33')]+_0x4a87b5['limit'],_0x1dd665;if(_0xcbf1f1>=_0x390bc3){_0xcbf1f1=_0x390bc3;_0x1dd665=0xc8;}else{_0x1dd665=0xce;}_0x113b39['status'](_0x1dd665);return _0x113b39[_0xc583('0x34')](_0xc583('0x35'),_0x23f3a4+'-'+_0xcbf1f1+'/'+_0x390bc3)[_0xc583('0x31')](_0x529dbe);}return null;};}function patchUpdates(_0x595ae1){return function(_0x430fe6){try{jsonpatch['apply'](_0x430fe6,_0x595ae1,!![]);}catch(_0x3e41c0){return BPromise[_0xc583('0x36')](_0x3e41c0);}return _0x430fe6[_0xc583('0x37')]();};}function saveUpdates(_0x48f00b,_0x18b097){return function(_0x55bdca){if(_0x55bdca){return _0x55bdca[_0xc583('0x38')](_0x48f00b)[_0xc583('0x22')](function(_0x473072){return _0x473072;});}return null;};}function removeEntity(_0x18a288,_0x3bd1fd){return function(_0x4d7add){if(_0x4d7add){return _0x4d7add[_0xc583('0x39')]()['then'](function(){_0x18a288[_0xc583('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e96fc,_0x3a562c){return function(_0x7d89d0){if(!_0x7d89d0){_0x2e96fc[_0xc583('0x2e')](0x194);}return _0x7d89d0;};}function handleError(_0xa44825,_0x41b466){_0x41b466=_0x41b466||0x1f4;return function(_0x54200c){logger['error'](_0x54200c[_0xc583('0x3a')]);if(_0x54200c[_0xc583('0x3b')]){delete _0x54200c['name'];}_0xa44825[_0xc583('0x30')](_0x41b466)[_0xc583('0x3c')](_0x54200c);};}function getInteractionUsers(_0x22de5a,_0xb9b427){return new BPromise(function(_0x37b8c7,_0x388a85){try{if(_0xb9b427[_0x22de5a['id']]){_0x22de5a['Users']=_[_0xc583('0x3d')](_0xb9b427[_0x22de5a['id']],function(_0x595351){return{'id':_0x595351['id'],'fullname':_0x595351[_0xc583('0x3e')]};});}}catch(_0x22cc57){_0x388a85(_0x22cc57);}_0x37b8c7(_0x22de5a);});}function getInteractionTags(_0x39bed4,_0x502b6d){return new BPromise(function(_0x51ef91,_0x518c90){try{if(_0x39bed4[_0xc583('0x3f')]){_0x39bed4[_0xc583('0x40')]=[];_0x39bed4[_0xc583('0x3f')][_0xc583('0x41')](',')['forEach'](function(_0x374196){_0x39bed4[_0xc583('0x40')]['push'](_0x502b6d[_0x374196]);});}delete _0x39bed4['TagIds'];}catch(_0x1ea5da){_0x518c90(_0x1ea5da);}_0x51ef91(_0x39bed4);});}function updateChatInteraction(_0x5ad3d8,_0x254592,_0x1ec6f9){return new BPromise(function(_0xe73752,_0x40b888){return getInteractionUsers(_0x5ad3d8,_0x1ec6f9)['then'](function(_0x44c22f){return getInteractionTags(_0x44c22f,_0x254592);})[_0xc583('0x22')](function(_0x39c5ab){_0xe73752(_0x39c5ab);})[_0xc583('0x2d')](function(_0x2c1c22){_0x40b888(_0x2c1c22);});});}exports['index']=function(_0x3ffeb7,_0x5f5a97){var _0x4b78df={},_0x2f97a4={},_0x21e231={'count':0x0,'rows':[]};var _0x5788c7=_['map'](db[_0xc583('0x42')][_0xc583('0x43')],function(_0x7d1b29){return{'name':_0x7d1b29[_0xc583('0x44')],'type':_0x7d1b29['type'][_0xc583('0x45')]};});_0x2f97a4['model']=_[_0xc583('0x3d')](_0x5788c7,'name');_0x2f97a4[_0xc583('0x46')]=_[_0xc583('0x47')](_0x3ffeb7[_0xc583('0x46')]);_0x2f97a4[_0xc583('0x48')]=_[_0xc583('0x49')](_0x2f97a4['model'],_0x2f97a4[_0xc583('0x46')]);_0x4b78df[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x2f97a4['model'],qs['fields'](_0x3ffeb7['query'][_0xc583('0x4b')]));_0x4b78df['attributes']=_0x4b78df[_0xc583('0x4a')][_0xc583('0x4c')]?_0x4b78df[_0xc583('0x4a')]:_0x2f97a4[_0xc583('0x4d')];if(!_0x3ffeb7[_0xc583('0x46')][_0xc583('0x4e')](_0xc583('0x4f'))){_0x4b78df[_0xc583('0x50')]=qs[_0xc583('0x50')](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x50')]);_0x4b78df['offset']=qs[_0xc583('0x33')](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x33')]);}_0x4b78df[_0xc583('0x51')]=qs['sort'](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x52')]);_0x4b78df[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x3ffeb7[_0xc583('0x46')],_0x2f97a4[_0xc583('0x48')]),_0x5788c7);var _0x12291c=[];var _0x32512b=squel['select']()[_0xc583('0x55')]('id')[_0xc583('0x55')](_0xc583('0x3b'))[_0xc583('0x55')](_0xc583('0x56'))[_0xc583('0x57')](_0xc583('0x58'));var _0x465c71=squel[_0xc583('0x59')]()[_0xc583('0x55')](_0xc583('0x5a'))[_0xc583('0x55')](_0xc583('0x5b'))['field'](_0xc583('0x5c'))[_0xc583('0x57')](_0xc583('0x5d'),'ui')[_0xc583('0x5e')](_0xc583('0x5f'),'u',_0xc583('0x60'));var _0x24351f=squel[_0xc583('0x59')]()[_0xc583('0x57')]('chat_interactions','i')[_0xc583('0x5e')](_0xc583('0x61'),'c',_0xc583('0x62'))['left_join']('users','o',_0xc583('0x63'))['left_join'](_0xc583('0x64'),'a',_0xc583('0x65'))['left_join']('chat_messages','me',_0xc583('0x66'))[_0xc583('0x5e')](_0xc583('0x67'),'it',_0xc583('0x68'))[_0xc583('0x5e')](_0xc583('0x58'),'t',_0xc583('0x69'));var _0x43b438=squel['expr']();var _0x1d41df=[];var _0x9bbf43=squel[_0xc583('0x6a')]();var _0x1c4921;if(_0x3ffeb7['query'][_0xc583('0x6b')]){_0x1c4921=as[_0xc583('0x6c')](_0x3ffeb7['query']['search']);var _0x12b114=_0x1c4921['sqlOperator'];for(var _0x30b1e0=0x0;_0x30b1e0<_0x1c4921[_0xc583('0x6d')][_0xc583('0x4c')];_0x30b1e0++){var _0x5ea011=_0x1c4921['conditions'][_0x30b1e0];var _0x1ea579='i';var _0x3a5033=_[_0xc583('0x6e')](_0x5788c7,[_0xc583('0x3b'),_0x5ea011['field']]);if(!_0x3a5033){switch(_0x5ea011[_0xc583('0x55')]){case _0xc583('0x6f'):if(_0x5ea011['value']==0x1){_0x24351f['having']('`'+_0x5ea011[_0xc583('0x55')]+'`\x20=\x200');}else{_0x24351f['having']('`'+_0x5ea011[_0xc583('0x55')]+_0xc583('0x70'));}break;case _0xc583('0x71'):if(_0x5ea011[_0xc583('0x72')]===_0xc583('0x73')){if(_0x5ea011['value']['split']('\x20')[_0xc583('0x4c')]>0x1){_0x43b438[_0x12b114](_0xc583('0x74'),qs['getFullTextValue'](_0x5ea011['value']),null);}else{var _0x1cfb34='%'+_0x5ea011['value']+'%';_0x43b438[_0x12b114](_0xc583('0x75'),_0x1cfb34,_0x1cfb34,_0x1cfb34);}}else{_0x3a5033=_[_0xc583('0x6e')](_0x5788c7,['name',_0xc583('0x76')]);_0x5ea011['field']=_0xc583('0x76');_0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033['type'],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331[_0xc583('0x79')][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}break;case _0xc583('0x7b'):var _0x37613c=_0x5ea011[_0xc583('0x79')]['split'](',')['map'](function(_0x4d0f8b){return Number(_0x4d0f8b);});_0x37613c[_0xc583('0x7c')](function(_0x4d498b){_0x9bbf43['or'](_0xc583('0x7d'),'%,'+_0x4d498b+',%');});_0x1d41df=_[_0xc583('0x7e')](_0x1d41df,_0x37613c);break;case _0xc583('0x7f'):if(_0x5ea011[_0xc583('0x72')]===_0xc583('0x73')){_0x43b438[_0x12b114](_0xc583('0x80'),'%'+_0x5ea011[_0xc583('0x79')]+'%',null);}else{_0x3a5033=_[_0xc583('0x6e')](_0x5788c7,['name',_0xc583('0x81')]);_0x5ea011[_0xc583('0x55')]=_0xc583('0x81');_0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033[_0xc583('0x82')],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331['value'][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}break;case _0xc583('0x83'):_0x54e331=as[_0xc583('0x77')]('me',null,_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331['value'][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);break;}}else{var _0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033['type'],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331[_0xc583('0x79')][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}}}else{var _0x89f9af=_(_0x3ffeb7[_0xc583('0x46')])['keys']()['map'](function(_0x5e979d){return _['some'](_0x5788c7,[_0xc583('0x3b'),_0x5e979d])?_0x5e979d:undefined;})[_0xc583('0x84')]()[_0xc583('0x79')]();if(!_[_0xc583('0x85')](_0x89f9af)){_0x89f9af[_0xc583('0x7c')](function(_0xbb22fa){if(_0xbb22fa===_0xc583('0x86')){_0x24351f[_0xc583('0x53')](_0xc583('0x87'),[][_0xc583('0x88')](_0x3ffeb7['query'][_0xbb22fa]));}else if(_0xbb22fa===_0xc583('0x89')){var _0xc82dd5=JSON['parse'](_0x3ffeb7['query'][_0xbb22fa])['$gte'];var _0x118682=JSON[_0xc583('0x8a')](_0x3ffeb7[_0xc583('0x46')][_0xbb22fa])[_0xc583('0x8b')];_0x24351f[_0xc583('0x53')](_0xc583('0x8c'),_0xc82dd5,_0x118682);}else{if(_0x3ffeb7[_0xc583('0x46')][_0xbb22fa]===_0xc583('0x8d')){_0x24351f[_0xc583('0x53')]('i.'+_0xbb22fa+'\x20IS\x20NULL');}else{_0x24351f[_0xc583('0x53')]('i.'+_0xbb22fa+_0xc583('0x8e'),_0x3ffeb7['query'][_0xbb22fa]);}}});}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x8f')]){if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x8f')]==0x1){_0x24351f[_0xc583('0x90')]('`unreadMessages`\x20=\x200');}else{_0x24351f[_0xc583('0x90')](_0xc583('0x91'));}}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x92')]){_0x1d41df=_['isArray'](_0x3ffeb7['query']['tag'])?_0x3ffeb7[_0xc583('0x46')]['tag']:new Array(_0x3ffeb7['query']['tag']);_0x1d41df[_0xc583('0x7c')](function(_0x3e8319){_0x9bbf43['or'](_0xc583('0x7d'),'%,'+_0x3e8319+',%');});}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x93')]){var _0x5150b4=_0x3ffeb7[_0xc583('0x46')][_0xc583('0x93')][_0xc583('0x94')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xc583('0x95'));if(qs[_0xc583('0x96')](_0x5150b4)){_0x43b438['or']('i.id\x20LIKE\x20?',_0x5150b4+'%');}else{_0x43b438['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc583('0x97')](_0x5150b4))['or'](_0xc583('0x98'),_0x5150b4+'%');}}}_0x24351f[_0xc583('0x53')](_0x43b438);_0x24351f[_0xc583('0x99')](_0xc583('0x9a'));var _0x10651c={'type':db[_0xc583('0x1f')][_0xc583('0x9b')]['SELECT'],'raw':!![]};var _0x288c4e=_0x24351f[_0xc583('0x9c')]();_0x288c4e[_0xc583('0x55')](_0xc583('0x9a'));_0x288c4e[_0xc583('0x55')](_0xc583('0x9d'),_0xc583('0x6f'));if(_0x4b78df[_0xc583('0x51')]){_0x4b78df[_0xc583('0x51')][_0xc583('0x7c')](function(_0x562bb6){_0x24351f[_0xc583('0x51')]('i.'+_0x562bb6[0x0],_0x562bb6[0x1]===_0xc583('0x9e')?![]:!![]);});}if(!_[_0xc583('0x85')](_0x1d41df)){_0x24351f[_0xc583('0x90')](_0x9bbf43);_0x288c4e[_0xc583('0x53')](_0xc583('0x9f'),_0x1d41df);}BPromise[_0xc583('0xa0')]()[_0xc583('0x22')](function(){if(!_0x1c4921){if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x86')]||_0x3ffeb7[_0xc583('0x46')][_0xc583('0xa1')])return;_0x288c4e[_0xc583('0x53')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x24351f['where'](_0xc583('0xa2'));return;}return _0x3ffeb7[_0xc583('0xa3')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x194989){if(_[_0xc583('0x85')](_0x194989)){_0x288c4e['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x24351f[_0xc583('0x53')](_0xc583('0xa4'));}else{_0x288c4e[_0xc583('0x53')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x194989,'id'));_0x24351f[_0xc583('0x53')](_0xc583('0x87'),_[_0xc583('0x3d')](_0x194989,'id'));}});})['then'](function(){db[_0xc583('0xa5')][_0xc583('0x46')](_0x288c4e['toString'](),_0x10651c)[_0xc583('0x22')](function(_0x1649ad){_0x21e231[_0xc583('0x32')]=_0x1649ad[_0xc583('0x4c')];if(_0x21e231[_0xc583('0x32')]===0x0)return[];return db[_0xc583('0xa5')][_0xc583('0x46')](_0x32512b['toString'](),_0x10651c)['then'](function(_0x5dd5c7){_0x12291c=_[_0xc583('0xa6')](_0x5dd5c7,'id');_0x10651c=_[_0xc583('0xa7')](_0x10651c,{'model':db[_0xc583('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x4b')]){_0x4b78df[_0xc583('0x4a')][_0xc583('0x7c')](function(_0x6a7877){_0x24351f['field']('i.'+_0x6a7877);});}else{_0x24351f[_0xc583('0x55')](_0xc583('0x9d'),_0xc583('0x6f'));_0x24351f[_0xc583('0x55')]('a.key','Account.key');_0x24351f['field'](_0xc583('0xa8'),_0xc583('0xa9'));_0x24351f[_0xc583('0x55')](_0xc583('0xaa'));_0x24351f[_0xc583('0x55')](_0xc583('0xab'),'Contact.firstName');_0x24351f['field'](_0xc583('0xac'),_0xc583('0xad'));_0x24351f['field'](_0xc583('0xae'),_0xc583('0xaf'));_0x24351f[_0xc583('0x55')](_0xc583('0xb0'),_0xc583('0xb1'));_0x24351f[_0xc583('0x55')]('c.mobile',_0xc583('0xb2'));_0x24351f[_0xc583('0x55')](_0xc583('0xb3'),_0xc583('0xb4'));_0x24351f[_0xc583('0x55')](_0xc583('0xb5'),_0xc583('0xb6'));_0x24351f[_0xc583('0x55')](_0xc583('0xb7'),_0xc583('0xb8'));_0x24351f['field'](_0xc583('0xb9'),_0xc583('0x3f'));}if(_0x4b78df[_0xc583('0x50')])_0x24351f['limit'](_0x4b78df[_0xc583('0x50')]);if(_0x4b78df['offset'])_0x24351f[_0xc583('0x33')](_0x4b78df[_0xc583('0x33')]);return db[_0xc583('0xa5')][_0xc583('0x46')](_0x24351f[_0xc583('0xba')](),_0x10651c);})[_0xc583('0x22')](function(_0x15e2b6){_0x465c71['where'](_0xc583('0xbb'),_['map'](_0x15e2b6,'id'));return db[_0xc583('0xa5')]['query'](_0x465c71[_0xc583('0xba')](),_0x10651c)[_0xc583('0x22')](function(_0x1d17c2){var _0x25d16e=_[_0xc583('0xbc')](_0x1d17c2,_0xc583('0xbd'));var _0x16273a=[];_0x15e2b6[_0xc583('0x7c')](function(_0x53f66a){_0x16273a[_0xc583('0xbe')](updateChatInteraction(_0x53f66a,_0x12291c,_0x25d16e));});return BPromise[_0xc583('0xbf')](_0x16273a);});});})[_0xc583('0x22')](function(_0x3ae684){_0x21e231[_0xc583('0xc0')]=_0x3ae684;return _0x21e231;})['then'](respondWithFilteredResult(_0x5f5a97,_0x4b78df));})[_0xc583('0x2d')](handleError(_0x5f5a97,null));};exports[_0xc583('0xc1')]=function(_0x1b246e,_0x5adde2){var _0x4d892c={'raw':![],'where':{'id':_0x1b246e[_0xc583('0xc2')]['id']}},_0xbbdcc4={};_0xbbdcc4[_0xc583('0x4d')]=_[_0xc583('0x47')](db[_0xc583('0x42')][_0xc583('0x43')]);_0xbbdcc4['query']=_[_0xc583('0x47')](_0x1b246e[_0xc583('0x46')]);_0xbbdcc4[_0xc583('0x48')]=_[_0xc583('0x49')](_0xbbdcc4[_0xc583('0x4d')],_0xbbdcc4['query']);_0x4d892c[_0xc583('0x4a')]=_['intersection'](_0xbbdcc4[_0xc583('0x4d')],qs['fields'](_0x1b246e[_0xc583('0x46')][_0xc583('0x4b')]));_0x4d892c['attributes']=_0x4d892c['attributes'][_0xc583('0x4c')]?_0x4d892c[_0xc583('0x4a')]:_0xbbdcc4[_0xc583('0x4d')];if(_0x1b246e[_0xc583('0x46')][_0xc583('0xc3')]){_0x4d892c['include']=[{'all':!![]}];}_0x4d892c=_[_0xc583('0xa7')]({},_0x4d892c,_0x1b246e['options']);return db[_0xc583('0x42')][_0xc583('0x6e')](_0x4d892c)[_0xc583('0x22')](handleEntityNotFound(_0x5adde2,null))[_0xc583('0x22')](respondWithResult(_0x5adde2,null))['catch'](handleError(_0x5adde2,null));};exports['create']=function(_0x54f43b,_0x1cbdea){return db[_0xc583('0x42')][_0xc583('0xc4')](_0x54f43b['body'],{})[_0xc583('0x22')](respondWithResult(_0x1cbdea,0xc9))[_0xc583('0x2d')](handleError(_0x1cbdea,null));};exports['update']=function(_0x392a65,_0x584454){if(_0x392a65[_0xc583('0x83')]['id']){delete _0x392a65[_0xc583('0x83')]['id'];}return db[_0xc583('0x42')][_0xc583('0x6e')]({'where':{'id':_0x392a65['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x584454,null))[_0xc583('0x22')](saveUpdates(_0x392a65[_0xc583('0x83')],null))['then'](respondWithResult(_0x584454,null))['catch'](handleError(_0x584454,null));};exports['destroy']=function(_0xa87e9d,_0x3eac6f){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0xa87e9d[_0xc583('0xc2')]['id']}})['then'](handleEntityNotFound(_0x3eac6f,null))['then'](removeEntity(_0x3eac6f,null))[_0xc583('0x2d')](handleError(_0x3eac6f,null));};exports['describe']=function(_0x790cd1,_0x3e1c5e){return db[_0xc583('0x42')][_0xc583('0xc5')]()[_0xc583('0x22')](respondWithResult(_0x3e1c5e,null))[_0xc583('0x2d')](handleError(_0x3e1c5e,null));};exports['createVidaooSession']=function(_0x3bcbce,_0x1628f4){var _0x45a609=_0x3bcbce[_0xc583('0xc2')]['id'];var _0x3fa08e;var _0x2a3ef9;var _0x4d24e7;return db[_0xc583('0x42')]['findOne']({'where':{'id':_0x45a609}})[_0xc583('0x22')](function(_0x146b9c){_0x3fa08e=_0x146b9c;return db['ChatWebsite']['findOne']({'where':{'id':_0x146b9c[_0xc583('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation'],'raw':!![]});})[_0xc583('0x22')](function(_0x5490f5){if(_0x5490f5&&_0x5490f5[_0xc583('0xc6')]&&_0x5490f5[_0xc583('0xc7')]){_0x2a3ef9=_0x5490f5;var _0x18d8b5={'rejectUnauthorized':![],'method':_0xc583('0xc8'),'uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x5490f5[_0xc583('0xc6')]},'body':{'name':_0xc583('0xc9')+_0x45a609},'redirect':_0xc583('0xca'),'json':!![]};return rp(_0x18d8b5);}else{throw new db[(_0xc583('0x1f'))][(_0xc583('0x20'))](_0xc583('0xcb'));}})[_0xc583('0x22')](function(_0x63eee8){_0x4d24e7=_0x63eee8;if(_0x4d24e7['id']){var _0x2d0297={'body':_0x4d24e7[_0xc583('0xcc')],'ChatWebsiteId':_0x2a3ef9['id'],'ChatInteractionId':_0x3fa08e['id'],'direction':_0xc583('0xcd'),'UserId':_0x3bcbce[_0xc583('0xa3')]['id']};return db[_0xc583('0xce')]['create'](_0x2d0297,{});}else{throw new db[(_0xc583('0x1f'))][(_0xc583('0x20'))](_0xc583('0xcf'));}})[_0xc583('0x22')](function(){return _0x3fa08e[_0xc583('0xd0')]({'vidaooSessionId':_0x4d24e7['id']});})[_0xc583('0x22')](respondWithResult(_0x1628f4,null))[_0xc583('0x2d')](handleError(_0x1628f4,null));};exports[_0xc583('0xd1')]=function(_0x5f5b7a,_0x2324f8){if(_0x5f5b7a[_0xc583('0x83')]['id']){delete _0x5f5b7a['body']['id'];}return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x5f5b7a[_0xc583('0xc2')]['id']}})['then'](handleEntityNotFound(_0x2324f8,null))[_0xc583('0x22')](saveUpdates(_0x5f5b7a['body'],null))[_0xc583('0x22')](respondWithResult(_0x2324f8,null))[_0xc583('0x2d')](handleError(_0x2324f8,null));};exports[_0xc583('0xd2')]=function(_0x42f4ec,_0x314072,_0x112652){if(_0x42f4ec[_0xc583('0x83')]['id']){delete _0x42f4ec['body']['id'];}return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x42f4ec['params']['id']}})[_0xc583('0x22')](function(_0x5dfbd5){if(!_0x5dfbd5){logger[_0xc583('0x29')](_0xc583('0xd3'),'abandon',0x194,_0xc583('0xd4'));_0x314072[_0xc583('0x2e')](0x194);}else{if(_0x5dfbd5[_0xc583('0x81')]){throw new db[(_0xc583('0x1f'))]['ValidationError'](_0xc583('0xd5'));}}return _0x5dfbd5;})[_0xc583('0x22')](function(_0x38a4d0){if(_0x38a4d0){return _0x38a4d0['update']({'closed':_0x42f4ec[_0xc583('0x83')][_0xc583('0xd6')],'disposition':_0x42f4ec[_0xc583('0x83')][_0xc583('0xd7')]})[_0xc583('0x22')](function(_0x5db6a2){return _0x5db6a2;});}})[_0xc583('0x22')](function(_0x178eef){return respondWithRpcPromise('AbandonInteraction',_0xc583('0xd2'),_0x42f4ec['body'],client9004);})[_0xc583('0x22')](respondWithResult(_0x314072,null))[_0xc583('0x2d')](handleError(_0x314072,null));};exports[_0xc583('0xd8')]=function(_0xe45a4a,_0x91cb84,_0x46aa62){_0xe45a4a[_0xc583('0x83')][_0xc583('0x3b')]=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xda')];_0xe45a4a[_0xc583('0x83')]['basename']=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xdb')];_0xe45a4a[_0xc583('0x83')][_0xc583('0x82')]=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xdc')];return db['Attachment'][_0xc583('0xc4')](_0xe45a4a[_0xc583('0x83')])[_0xc583('0x22')](respondWithResult(_0x91cb84,0xc9))[_0xc583('0x2d')](handleError(_0x91cb84,null));};exports[_0xc583('0xdd')]=function(_0x1f61e2,_0x291f47,_0x405709){return db[_0xc583('0x42')][_0xc583('0xde')]({'where':{'id':_0x1f61e2[_0xc583('0xc2')]['id']},'raw':!![]})[_0xc583('0x22')](handleEntityNotFound(_0x291f47,null))[_0xc583('0x22')](function(_0x4824c5){if(_0x4824c5){if(_0x4824c5[_0xc583('0xd6')]){return _0x291f47[_0xc583('0x30')](0x193)[_0xc583('0x31')]({'status':0x193,'message':_0xc583('0xdf')});}return db[_0xc583('0xe0')][_0xc583('0xde')]({'where':{'id':_0x1f61e2['query'][_0xc583('0xe1')]},'raw':!![]})['then'](handleEntityNotFound(_0x291f47,null));}})['then'](function(_0x52482e){if(_0x52482e){return _0x291f47[_0xc583('0xe2')](path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0xe5'),_0x52482e[_0xc583('0xe6')]));}})['catch'](handleError(_0x291f47,null));};exports['close']=function(_0x50f9d6,_0x1aa8a2){var _0x18a2cd=null;var _0x2785c5=null;var _0x774d90=null;var _0x486cd1=null;if(_0x50f9d6[_0xc583('0x83')]['id']){delete _0x50f9d6['body']['id'];}if(_0x50f9d6[_0xc583('0x83')]['mailTranscript']){_0x486cd1=path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0xe7'),util[_0xc583('0xe8')](_0xc583('0xe9'),Date[_0xc583('0xea')]()));_0x50f9d6[_0xc583('0x83')][_0xc583('0xeb')]=_0x486cd1;}return db[_0xc583('0x42')][_0xc583('0x6e')]({'where':{'id':_0x50f9d6[_0xc583('0xc2')]['id']},'include':[{'model':db[_0xc583('0xce')],'as':_0xc583('0xec'),'include':[{'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f')}]}]})[_0xc583('0x22')](handleEntityNotFound(_0x1aa8a2,null))[_0xc583('0x22')](saveUpdates(_0x50f9d6[_0xc583('0x83')],null))[_0xc583('0x22')](function(_0x564fc0){if(_0x564fc0){_0x18a2cd=_0x564fc0;return db['ChatWebsite'][_0xc583('0x6e')]({'where':{'id':_0x18a2cd[_0xc583('0x86')]}});}})[_0xc583('0x22')](function(_0x23759e){if(_0x23759e){_0x774d90=_0x23759e;return db[_0xc583('0xed')]['find']({'where':{'id':_0x18a2cd[_0xc583('0x76')]}});}})['then'](function(_0x8d44b7){if(_0x8d44b7){_0x2785c5=_0x8d44b7;if(_0x486cd1){var _0x1b4ac0=null;for(var _0x107927=0x1;_0x107927<_0x18a2cd[_0xc583('0xec')][_0xc583('0x4c')];++_0x107927){_0x1b4ac0=_0x18a2cd[_0xc583('0xec')][_0x107927];var _0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')]('%s%d',_0x774d90[_0xc583('0xee')],_0x1b4ac0[_0xc583('0x81')]):'System';var _0x36975e=_0x50f9d6[_0xc583('0x83')][_0xc583('0xef')]||util['format'](_0xc583('0xf0'),_0xc583('0xf1'),_0x1b4ac0[_0xc583('0x76')]);switch(_0x774d90[_0xc583('0xf2')]){case _0xc583('0xf3'):_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')]('%s%d',_0x774d90[_0xc583('0xee')],_0x1b4ac0[_0xc583('0x81')]):_0xc583('0xf4');break;case'agent_alias':_0x2b720c=_0x1b4ac0['UserId']?_0x1b4ac0['User'][_0xc583('0xf5')]||_0x1b4ac0[_0xc583('0x7f')]['fullname']:_0xc583('0xf4');break;case _0xc583('0xf6'):_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?_0x1b4ac0[_0xc583('0x7f')][_0xc583('0x3e')]:_0xc583('0xf4');break;default:_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')](_0xc583('0xf0'),_0x774d90[_0xc583('0xee')],_0x1b4ac0['UserId']):_0xc583('0xf4');}var _0x5b8197=util[_0xc583('0xe8')](_0xc583('0xf7'),moment(_0x1b4ac0[_0xc583('0x89')])[_0xc583('0xe8')](_0xc583('0xf8')),_0x1b4ac0[_0xc583('0xf9')]==='in'?_0x36975e:_0x2b720c,_0x1b4ac0[_0xc583('0x83')]);if(!_0x1b4ac0[_0xc583('0xfa')]){fs[_0xc583('0xfb')](_0x486cd1,_0x5b8197);}}return db[_0xc583('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc583('0xfd'),'raw':!![]}]});}}})['then'](function(_0x45270a){if(_0x45270a&&_0x45270a[_0xc583('0xfd')]&&_0x50f9d6[_0xc583('0x83')]){var _0x44266a={'tls':{'rejectUnauthorized':![]}};if(_0x45270a['Smtp'][_0xc583('0xfe')]){_0x44266a[_0xc583('0xfe')]=_0x45270a['Smtp']['service'];}else{_0x44266a[_0xc583('0xff')]=_0x45270a[_0xc583('0xfd')][_0xc583('0xff')];_0x44266a['port']=_0x45270a['Smtp'][_0xc583('0x100')];_0x44266a['secure']=_0x45270a[_0xc583('0xfd')][_0xc583('0x101')];}if(_0x45270a[_0xc583('0xfd')]['authentication']){_0x44266a[_0xc583('0x102')]={'user':_0x45270a['Smtp']['user'],'pass':_0x45270a[_0xc583('0xfd')][_0xc583('0x103')]};}return respondWithRpcPromise(_0xc583('0x104'),_0xc583('0x105'),{'account':_0x44266a,'message':{'from':util[_0xc583('0xe8')](_0xc583('0x106'),_0x45270a[_0xc583('0x3b')],_0x45270a[_0xc583('0x107')]||_0x45270a[_0xc583('0xfd')][_0xc583('0xa3')]),'to':_0x50f9d6[_0xc583('0x83')][_0xc583('0x108')],'subject':_0xc583('0x109'),'text':util[_0xc583('0xe8')](_0xc583('0x10a'),_0x50f9d6['body'][_0xc583('0x108')]),'attachments':[{'path':_0x486cd1}]}})[_0xc583('0x22')](function(){return _0x18a2cd;})[_0xc583('0x2d')](function(_0x267c96){console[_0xc583('0x29')](_0x267c96);});}else{return _0x18a2cd;}})[_0xc583('0x22')](respondWithStatusCode(_0x1aa8a2,0xc8))[_0xc583('0x2d')](handleError(_0x1aa8a2,null));};exports[_0xc583('0x10b')]=function(_0xa21d7a,_0x3308a8,_0x270a3e){return db[_0xc583('0xce')][_0xc583('0x6e')]({'where':{'id':_0xa21d7a[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x3308a8,null))['then'](function(_0x31784f){if(_0x31784f){return _0x31784f[_0xc583('0x10b')](_0xa21d7a[_0xc583('0x83')][_0xc583('0x10c')],_['omit'](_0xa21d7a[_0xc583('0x83')],[_0xc583('0x10c'),'id'])||{});}})[_0xc583('0x22')](respondWithResult(_0x3308a8,null))['catch'](handleError(_0x3308a8,null));};exports['getMessages']=function(_0x4b37b8,_0x3f30fd,_0x15ea31){var _0x2772c7={'raw':![],'where':{}};var _0x52bed1={};var _0x1d9782={'count':0x0,'rows':[]};return db[_0xc583('0x42')][_0xc583('0xde')]({'where':{'id':_0x4b37b8['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x3f30fd,null))['then'](function(_0x50ff62){if(_0x50ff62){_0x52bed1[_0xc583('0x4d')]=_[_0xc583('0x47')](db[_0xc583('0xce')][_0xc583('0x43')]);_0x52bed1[_0xc583('0x46')]=_['keys'](_0x4b37b8['query']);_0x52bed1[_0xc583('0x48')]=_[_0xc583('0x49')](_0x52bed1[_0xc583('0x4d')],_0x52bed1['query']);_0x2772c7[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x52bed1[_0xc583('0x4d')],qs['fields'](_0x4b37b8[_0xc583('0x46')][_0xc583('0x4b')]));_0x2772c7[_0xc583('0x4a')]=_0x2772c7[_0xc583('0x4a')][_0xc583('0x4c')]?_0x2772c7[_0xc583('0x4a')]:_0x52bed1['model'];if(!_0x4b37b8[_0xc583('0x46')]['hasOwnProperty'](_0xc583('0x4f'))){_0x2772c7['limit']=qs[_0xc583('0x50')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x50')]);_0x2772c7[_0xc583('0x33')]=qs[_0xc583('0x33')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x33')]);}_0x2772c7[_0xc583('0x51')]=qs[_0xc583('0x52')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x52')]);_0x2772c7[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x4b37b8[_0xc583('0x46')],_0x52bed1[_0xc583('0x48')]));_0x2772c7[_0xc583('0x53')]['ChatInteractionId']=_0x50ff62['id'];if(_0x4b37b8[_0xc583('0x46')][_0xc583('0x93')]){_0x2772c7[_0xc583('0x53')]=_['merge'](_0x2772c7[_0xc583('0x53')],{'$or':_['map'](_0x2772c7[_0xc583('0x4a')],function(_0x2095f4){var _0x509ee5={};_0x509ee5[_0x2095f4]={'$like':'%'+_0x4b37b8[_0xc583('0x46')][_0xc583('0x93')]+'%'};return _0x509ee5;})});}if(_0x4b37b8[_0xc583('0x46')]['$gte']){var _0xcacf5e=_0x4b37b8[_0xc583('0x46')]['$gte']['split'](',');var _0x183571={};_0x183571[_0xcacf5e[0x0]]={'$gte':moment(_0xcacf5e[0x1])[_0xc583('0xe8')](_0xc583('0x10d'))};_0x2772c7[_0xc583('0x53')]=_['merge'](_0x2772c7['where'],_0x183571);}_0x2772c7=_['merge']({},_0x2772c7,_0x4b37b8[_0xc583('0x10e')]);return db[_0xc583('0xce')][_0xc583('0x32')]({'where':_0x2772c7[_0xc583('0x53')]})[_0xc583('0x22')](function(_0x9dad79){_0x1d9782[_0xc583('0x32')]=_0x9dad79;if(_0x4b37b8[_0xc583('0x46')][_0xc583('0xc3')]){_0x2772c7[_0xc583('0x10f')]=[{'all':!![]}];}return db[_0xc583('0xce')][_0xc583('0x110')](_0x2772c7);})[_0xc583('0x22')](function(_0x26cdcd){_0x1d9782[_0xc583('0xc0')]=_0x26cdcd;return _0x1d9782;});}})[_0xc583('0x22')](respondWithFilteredResult(_0x3f30fd,_0x2772c7))[_0xc583('0x2d')](handleError(_0x3f30fd,null));};exports[_0xc583('0x111')]=function(_0x272a27,_0x4d6f30,_0x132293){var _0x2f31ae={'where':{}},_0x5388f8={},_0x3b7fa2={'count':0x0,'rows':[]};return db[_0xc583('0x42')]['findOne']({'where':{'id':_0x272a27[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x4d6f30,null))[_0xc583('0x22')](function(_0x41764a){if(_0x41764a){_0x5388f8[_0xc583('0x4d')]=_[_0xc583('0x47')](db['ChatMessage'][_0xc583('0x43')]);_0x5388f8['query']=_[_0xc583('0x47')](_0x272a27[_0xc583('0x46')]);_0x5388f8[_0xc583('0x48')]=_[_0xc583('0x49')](_0x5388f8['model'],_0x5388f8['query']);_0x2f31ae[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x5388f8['model'],qs[_0xc583('0x4b')](_0x272a27[_0xc583('0x46')][_0xc583('0x4b')]));_0x2f31ae['attributes']=_0x2f31ae[_0xc583('0x4a')][_0xc583('0x4c')]?_0x2f31ae[_0xc583('0x4a')]:_0x5388f8[_0xc583('0x4d')];if(!_0x272a27[_0xc583('0x46')][_0xc583('0x4e')](_0xc583('0x4f'))){_0x2f31ae['limit']=qs['limit'](_0x272a27[_0xc583('0x46')]['limit']);_0x2f31ae['offset']=qs[_0xc583('0x33')](_0x272a27[_0xc583('0x46')][_0xc583('0x33')]);}_0x2f31ae[_0xc583('0x51')]=qs[_0xc583('0x52')](_0x272a27[_0xc583('0x46')][_0xc583('0x52')]);_0x2f31ae[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x272a27['query'],_0x5388f8[_0xc583('0x48')]));_0x2f31ae[_0xc583('0x53')][_0xc583('0xbd')]=_0x41764a['id'];if(_0x272a27['query']['filter']){_0x2f31ae['where']=_[_0xc583('0xa7')](_0x2f31ae[_0xc583('0x53')],{'$or':_[_0xc583('0x3d')](_0x2f31ae[_0xc583('0x4a')],function(_0x421975){var _0x45f26d={};_0x45f26d[_0x421975]={'$like':'%'+_0x272a27[_0xc583('0x46')][_0xc583('0x93')]+'%'};return _0x45f26d;})});}_0x2f31ae[_0xc583('0x53')][_0xc583('0xfa')]=![];if(_0x272a27[_0xc583('0x46')]['id']){_0x2f31ae['where']['id']={'$gt':_0x272a27[_0xc583('0x46')]['id']};}_0x2f31ae=_[_0xc583('0xa7')]({},_0x2f31ae,_0x272a27[_0xc583('0x10e')]);return db[_0xc583('0xce')][_0xc583('0x32')]({'where':_0x2f31ae[_0xc583('0x53')]})[_0xc583('0x22')](function(_0x8c2492){_0x3b7fa2['count']=_0x8c2492;_0x2f31ae[_0xc583('0x10f')]=[];if(_0x272a27[_0xc583('0x46')]['includeAgent']){_0x2f31ae[_0xc583('0x10f')][_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x3e'),_0xc583('0xf5')]});}if(_0x272a27[_0xc583('0x46')][_0xc583('0xc3')]){_0x2f31ae[_0xc583('0x10f')]=[{'all':!![]}];}return db[_0xc583('0xce')][_0xc583('0x110')](_0x2f31ae);})[_0xc583('0x22')](function(_0x3f169f){_0x3b7fa2[_0xc583('0xc0')]=_0x3f169f;return _0x3b7fa2;});}})[_0xc583('0x22')](respondWithFilteredResult(_0x4d6f30,_0x2f31ae))[_0xc583('0x2d')](handleError(_0x4d6f30,null));};exports[_0xc583('0x112')]=function(_0x46e785,_0x1175a2,_0x585e36){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x46e785['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x1175a2,null))[_0xc583('0x22')](function(_0x442dc0){if(_0x442dc0){return _0x442dc0['setTags'](_0x46e785[_0xc583('0x83')][_0xc583('0x10c')],_[_0xc583('0x113')](_0x46e785[_0xc583('0x83')],[_0xc583('0x10c'),'id'])||{})['spread'](function(){return db['Tag'][_0xc583('0x110')]({'attributes':['id',_0xc583('0x3b'),_0xc583('0x56')],'where':{'id':_0x46e785[_0xc583('0x83')][_0xc583('0x10c')]}});})[_0xc583('0x22')](function(_0x334244){socket[_0xc583('0x114')]('chatInteractionTags:save',{'id':Number(_0x46e785['params']['id']),'tags':_0x334244||[]});return{'id':Number(_0x46e785[_0xc583('0xc2')]['id']),'tags':_0x334244||[]};});}})[_0xc583('0x22')](respondWithResult(_0x1175a2,null))[_0xc583('0x2d')](handleError(_0x1175a2,null));};exports[_0xc583('0x115')]=function(_0x34403a,_0x54867b,_0xa0ef23){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x34403a[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x54867b,null))['then'](function(_0x383d35){if(_0x383d35){return _0x383d35[_0xc583('0x115')](_0x34403a[_0xc583('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x54867b,null))[_0xc583('0x2d')](handleError(_0x54867b,null));};exports[_0xc583('0xe2')]=function(_0x5b466a,_0x47b0a3){var _0x1a6e7f=moment()['unix']()[_0xc583('0xba')]();var _0x583837=path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0x116'),_0xc583('0x117'),'tmp');var _0x3da50a=path['join'](config[_0xc583('0xe4')],_0xc583('0x116'),_0xc583('0x117'),_0xc583('0x118'));var _0x1990b0=path[_0xc583('0xe3')](_0x583837,_0x1a6e7f);var _0x558aea=util[_0xc583('0xe8')]('transcript-%d-%s.zip',_0x5b466a[_0xc583('0xc2')]['id'],_0x1a6e7f);var _0x3244be=path[_0xc583('0xe3')](_0x583837,_0x558aea);var _0x4a8088=[];_0x4a8088[_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x3e')],'raw':!![]});_0x4a8088[_0xc583('0xbe')]({'model':db[_0xc583('0xed')],'as':_0xc583('0x71'),'attributes':['id',_0xc583('0x119'),_0xc583('0x11a')],'raw':!![]});if(_0x5b466a[_0xc583('0x46')]['attachments']){_0x4a8088['push']({'model':db[_0xc583('0xe0')],'as':'Attachment','raw':!![]});}var _0x12217c=[{'model':db[_0xc583('0xce')],'as':_0xc583('0xec'),'attributes':['id',_0xc583('0x83'),'createdAt',_0xc583('0xf9'),_0xc583('0xfa'),_0xc583('0x8f')],'include':_0x4a8088}];_0x12217c['push']({'model':db[_0xc583('0x11b')],'as':_0xc583('0x11c'),'attributes':['id',_0xc583('0x3b')]});_0x12217c[_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':'Owner','attributes':['id',_0xc583('0x3e')]});return db['ChatInteraction']['find']({'where':{'id':_0x5b466a[_0xc583('0xc2')]['id']},'include':_0x12217c})[_0xc583('0x22')](handleEntityNotFound(_0x47b0a3,null))[_0xc583('0x22')](function(_0x29e600){if(_0x29e600){var _0x221112=_0x29e600[_0xc583('0x11d')]({'plain':!![]});fs[_0xc583('0x11e')](_0x1990b0);var _0x3786fd={'format':'A4','border':'10px','header':{'height':_0xc583('0x11f'),'contents':{'first':_0xc583('0x120')}},'footer':{'height':_0xc583('0x121'),'contents':{'default':util['format'](_0xc583('0x122'),util[_0xc583('0xe8')](_0xc583('0x123'),'Chat',_0x221112['id']),moment()[_0xc583('0xe8')]('YYYY-MM-DD')[_0xc583('0xba')]())}}};var _0x29a8c3={'channel':_0xc583('0x124'),'account':_0x221112['Account'][_0xc583('0x3b')],'agent':_0x221112['Owner']?_0x221112[_0xc583('0x125')][_0xc583('0x3e')]:_0xc583('0x126'),'createdAt':moment(_0x221112['createdAt'])[_0xc583('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc583('0xba')](),'closedAt':_0x221112['closed']?moment(_0x221112[_0xc583('0x127')])[_0xc583('0xe8')](_0xc583('0x10d'))['toString']():'','disposition':_0x221112[_0xc583('0xd7')],'chatInfo':{'browser':_0x221112['browserName'],'os':_0x221112[_0xc583('0x128')],'referer':_0x221112[_0xc583('0x129')],'customerIp':_0x221112[_0xc583('0x12a')],'customerPort':_0x221112[_0xc583('0x12b')]?_0x221112[_0xc583('0x12b')]:'N.A.'},'messages':_(_0x221112['Messages'])['tail']()[_0xc583('0x93')]({'secret':![]})[_0xc583('0x3d')](function(_0x27271a){if(_0x27271a[_0xc583('0xe0')]){var _0x5805ca=path['join'](_0x3da50a,_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')]);if(fs['existsSync'](_0x5805ca)){fs[_0xc583('0x12c')](_0x5805ca)[_0xc583('0x12d')](fs[_0xc583('0x12e')](path[_0xc583('0xe3')](_0x1990b0,_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')])));}}return{'date':moment(_0x27271a[_0xc583('0x89')])[_0xc583('0xe8')](_0xc583('0x10d'))['toString'](),'sender':_0x27271a['direction']===_0xc583('0xcd')?_0x27271a[_0xc583('0x7f')]?_0x27271a[_0xc583('0x7f')]['fullname']:_0xc583('0xf4'):_0x27271a['Contact']['firstName']+(_0x27271a[_0xc583('0x71')][_0xc583('0x11a')]?'\x20'+_0x27271a[_0xc583('0x71')][_0xc583('0x11a')]:''),'body':_0x27271a[_0xc583('0xe0')]?_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')]:_0x27271a[_0xc583('0x83')],'direction':_0x27271a[_0xc583('0xf9')]===_0xc583('0xcd')?'A':'C','secret':_0x27271a[_0xc583('0xfa')],'read':_0x27271a[_0xc583('0x8f')],'attachment':_0x27271a[_0xc583('0xe0')]};})[_0xc583('0x79')]()};return ejs[_0xc583('0x12f')](path[_0xc583('0xe3')](config['root'],_0xc583('0x116'),_0xc583('0x130'),_0xc583('0x131')),{'interaction':_0x29a8c3})['then'](function(_0x14caf3){return new BPromise(function(_0x32f385,_0x41045d){pdf[_0xc583('0xc4')](_0x14caf3,_0x3786fd)[_0xc583('0x132')](path['join'](_0x1990b0,'transcript-'+_0x221112['id']+'-'+_0x1a6e7f+_0xc583('0x133')),function(_0x335b28,_0x1bddee){if(_0x335b28)return _0x41045d(_0x335b28);_0x32f385(_0x1bddee);});});})[_0xc583('0x22')](function(){return new BPromise(function(_0x258b10,_0x3fc755){zipdir(_0x1990b0,{'saveTo':_0x3244be},function(_0x4a900c,_0x2ba67d){if(_0x4a900c)return _0x3fc755(_0x4a900c);return _0x258b10(_0x2ba67d);});})[_0xc583('0x22')](function(){return new BPromise(function(_0x291a9a,_0x685f68){rimraf(_0x1990b0,function(_0x38dc1c){if(_0x38dc1c)_0x685f68(_0x38dc1c);return _0x291a9a();});});})[_0xc583('0x22')](function(){return _0x47b0a3['download'](_0x3244be,_0x558aea,function(_0x197e0f){if(_0x197e0f){console['log']('err',_0x197e0f);}else{fs[_0xc583('0x134')](_0x3244be);}});});});}else{return _0x47b0a3[_0xc583('0x2e')](0xc8);}})['catch'](handleError(_0x47b0a3,null));}; \ No newline at end of file +var _0xf61e=['abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','AbandonInteraction','file','originalname','basename','filename','mimetype','Unauthorized','Attachment','attachId','download','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','CmContact','format','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','fullname','addTags','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','ChatWebsite','Account','get','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\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','Chat','YYYY-MM-DD','Owner','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','out','lastName','renderFile','downloadInteraction.html','toFile','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.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','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','send','map','TagIds','Tags','split','push','index','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','DESC','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','ChatInteraction','a.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','user','ChatMessage','updateAttributes','customUpdate'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf61e,0x191));var _0xef61=function(_0x5a7559,_0x20cc1d){_0x5a7559=_0x5a7559-0x0;var _0x33c1e4=_0xf61e[_0x5a7559];return _0x33c1e4;};'use strict';var pdf=require(_0xef61('0x0'));var emlformat=require(_0xef61('0x1'));var rimraf=require(_0xef61('0x2'));var zipdir=require(_0xef61('0x3'));var jsonpatch=require(_0xef61('0x4'));var rp=require(_0xef61('0x5'));var moment=require(_0xef61('0x6'));var BPromise=require(_0xef61('0x7'));var Mustache=require(_0xef61('0x8'));var util=require(_0xef61('0x9'));var path=require(_0xef61('0xa'));var sox=require(_0xef61('0xb'));var csv=require('to-csv');var ejs=require(_0xef61('0xc'));var fs=require('fs');var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var db=require(_0xef61('0x1b'))['db'];config[_0xef61('0x1c')]=_[_0xef61('0x1d')](config[_0xef61('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xef61('0x1e'))(new Redis(config['redis']));require(_0xef61('0x1f'))[_0xef61('0x20')](socket);var jayson=require(_0xef61('0x21'));var client=jayson[_0xef61('0x22')]['http']({'port':0x232b});var client9004=jayson[_0xef61('0x22')][_0xef61('0x23')]({'port':0x232c});function checkPasswordPattern(_0x1224c2,_0x78ff22,_0x588a61){if(_0x588a61){var _0x66fa62=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x66fa62[_0xef61('0x24')](_0x78ff22)){return _0x1224c2;}else{throw new db['Sequelize'][(_0xef61('0x25'))](_0xef61('0x26'));}}else{return _0x1224c2;}}function respondWithRpcPromise(_0x36f558,_0x22dc1b,_0xfc36d6,_0x28315a){return new BPromise(function(_0xdd5e38,_0x55f887){var _0x39443d=_0x28315a||client;return _0x39443d[_0xef61('0x27')](_0x36f558,_0xfc36d6)['then'](function(_0xb7ba69){logger[_0xef61('0x28')](_0xef61('0x29'),_0x22dc1b,_0xef61('0x2a'));logger[_0xef61('0x2b')](_0xef61('0x2c'),_0x22dc1b,_0xef61('0x2a'),JSON['stringify'](_0xb7ba69));if(_0xb7ba69['error']){if(_0xb7ba69[_0xef61('0x2d')]['code']===0x1f4){logger[_0xef61('0x2d')]('ChatInteraction,\x20%s,\x20%s',_0x22dc1b,_0xb7ba69['error'][_0xef61('0x2e')]);return _0x55f887(_0xb7ba69['error']['message']);}logger[_0xef61('0x2d')](_0xef61('0x29'),_0x22dc1b,_0xb7ba69[_0xef61('0x2d')][_0xef61('0x2e')]);return _0xdd5e38(_0xb7ba69['error'][_0xef61('0x2e')]);}else{logger['info'](_0xef61('0x29'),_0x22dc1b,_0xef61('0x2a'));_0xdd5e38(_0xb7ba69[_0xef61('0x2f')][_0xef61('0x2e')]);}})[_0xef61('0x30')](function(_0x45ece2){logger[_0xef61('0x2d')](_0xef61('0x29'),_0x22dc1b,_0x45ece2);_0x55f887(_0x45ece2);});});}function respondWithStatusCode(_0x297df7,_0x1ee27b){_0x1ee27b=_0x1ee27b||0xcc;return function(_0x3a16ba){if(_0x3a16ba){return _0x297df7[_0xef61('0x31')](_0x1ee27b);}return _0x297df7[_0xef61('0x32')](_0x1ee27b)[_0xef61('0x33')]();};}function respondWithResult(_0x1f3572,_0x85978){_0x85978=_0x85978||0xc8;return function(_0x39c15e){if(_0x39c15e){return _0x1f3572[_0xef61('0x32')](_0x85978)[_0xef61('0x34')](_0x39c15e);}};}function respondWithFilteredResult(_0x2fe908,_0x43bc47){return function(_0x53fa3b){if(_0x53fa3b){var _0x4f35ad=_0x53fa3b[_0xef61('0x35')],_0x51d5d1=_0x43bc47['offset'],_0x38b522=_0x43bc47[_0xef61('0x36')]+_0x43bc47[_0xef61('0x37')],_0x36713e;if(_0x38b522>=_0x4f35ad){_0x38b522=_0x4f35ad;_0x36713e=0xc8;}else{_0x36713e=0xce;}_0x2fe908['status'](_0x36713e);return _0x2fe908[_0xef61('0x38')]('Content-Range',_0x51d5d1+'-'+_0x38b522+'/'+_0x4f35ad)['json'](_0x53fa3b);}return null;};}function patchUpdates(_0x307b70){return function(_0x48b6db){try{jsonpatch[_0xef61('0x39')](_0x48b6db,_0x307b70,!![]);}catch(_0x5ee9e4){return BPromise[_0xef61('0x3a')](_0x5ee9e4);}return _0x48b6db[_0xef61('0x3b')]();};}function saveUpdates(_0x23db9c,_0x14c05c){return function(_0x4378e5){if(_0x4378e5){return _0x4378e5[_0xef61('0x3c')](_0x23db9c)[_0xef61('0x3d')](function(_0x232cd8){return _0x232cd8;});}return null;};}function removeEntity(_0x1c622c,_0xb9d080){return function(_0x5f15ef){if(_0x5f15ef){return _0x5f15ef[_0xef61('0x3e')]()[_0xef61('0x3d')](function(){_0x1c622c[_0xef61('0x32')](0xcc)[_0xef61('0x33')]();});}};}function handleEntityNotFound(_0x310954,_0x534935){return function(_0x1c38dc){if(!_0x1c38dc){_0x310954[_0xef61('0x31')](0x194);}return _0x1c38dc;};}function handleError(_0x291944,_0x53bdb9){_0x53bdb9=_0x53bdb9||0x1f4;return function(_0x59b97b){logger['error'](_0x59b97b[_0xef61('0x3f')]);if(_0x59b97b['name']){delete _0x59b97b['name'];}_0x291944['status'](_0x53bdb9)[_0xef61('0x40')](_0x59b97b);};}function getInteractionUsers(_0x294063,_0x54e37a){return new BPromise(function(_0x508dc7,_0x53c9ef){try{if(_0x54e37a[_0x294063['id']]){_0x294063['Users']=_[_0xef61('0x41')](_0x54e37a[_0x294063['id']],function(_0x32ad44){return{'id':_0x32ad44['id'],'fullname':_0x32ad44['fullname']};});}}catch(_0x41aaeb){_0x53c9ef(_0x41aaeb);}_0x508dc7(_0x294063);});}function getInteractionTags(_0x12f442,_0x74ced){return new BPromise(function(_0x217f2b,_0x49e7c4){try{if(_0x12f442[_0xef61('0x42')]){_0x12f442[_0xef61('0x43')]=[];_0x12f442[_0xef61('0x42')][_0xef61('0x44')](',')['forEach'](function(_0x5f1928){_0x12f442[_0xef61('0x43')][_0xef61('0x45')](_0x74ced[_0x5f1928]);});}delete _0x12f442[_0xef61('0x42')];}catch(_0x53abdb){_0x49e7c4(_0x53abdb);}_0x217f2b(_0x12f442);});}function updateChatInteraction(_0x3eee46,_0x361705,_0x1d8a77){return new BPromise(function(_0x2a7a4d,_0x50bc00){return getInteractionUsers(_0x3eee46,_0x1d8a77)['then'](function(_0x52bbe3){return getInteractionTags(_0x52bbe3,_0x361705);})[_0xef61('0x3d')](function(_0x43b93b){_0x2a7a4d(_0x43b93b);})[_0xef61('0x30')](function(_0xe40d){_0x50bc00(_0xe40d);});});}exports[_0xef61('0x46')]=function(_0x272143,_0xc9b467){var _0x50e47f={},_0x2dbd96={},_0x2f1b49={'count':0x0,'rows':[]};var _0x20395d=_[_0xef61('0x41')](db['ChatInteraction'][_0xef61('0x47')],function(_0x4686df){return{'name':_0x4686df[_0xef61('0x48')],'type':_0x4686df[_0xef61('0x49')][_0xef61('0x4a')]};});_0x2dbd96[_0xef61('0x4b')]=_['map'](_0x20395d,_0xef61('0x4c'));_0x2dbd96[_0xef61('0x4d')]=_[_0xef61('0x4e')](_0x272143['query']);_0x2dbd96[_0xef61('0x4f')]=_[_0xef61('0x50')](_0x2dbd96[_0xef61('0x4b')],_0x2dbd96[_0xef61('0x4d')]);_0x50e47f[_0xef61('0x51')]=_[_0xef61('0x50')](_0x2dbd96['model'],qs[_0xef61('0x52')](_0x272143[_0xef61('0x4d')]['fields']));_0x50e47f[_0xef61('0x51')]=_0x50e47f[_0xef61('0x51')][_0xef61('0x53')]?_0x50e47f[_0xef61('0x51')]:_0x2dbd96['model'];if(!_0x272143[_0xef61('0x4d')][_0xef61('0x54')](_0xef61('0x55'))){_0x50e47f['limit']=qs[_0xef61('0x37')](_0x272143[_0xef61('0x4d')]['limit']);_0x50e47f[_0xef61('0x36')]=qs[_0xef61('0x36')](_0x272143[_0xef61('0x4d')][_0xef61('0x36')]);}_0x50e47f[_0xef61('0x56')]=qs[_0xef61('0x57')](_0x272143[_0xef61('0x4d')]['sort']);_0x50e47f[_0xef61('0x58')]=qs['filters'](_[_0xef61('0x59')](_0x272143[_0xef61('0x4d')],_0x2dbd96[_0xef61('0x4f')]),_0x20395d);var _0x193f46=[];var _0x20950a=squel[_0xef61('0x5a')]()[_0xef61('0x5b')]('id')[_0xef61('0x5b')](_0xef61('0x4c'))['field'](_0xef61('0x5c'))[_0xef61('0x5d')]('tools_tags');var _0x5316ac=squel[_0xef61('0x5a')]()[_0xef61('0x5b')]('u.id')[_0xef61('0x5b')]('u.fullname')[_0xef61('0x5b')](_0xef61('0x5e'))[_0xef61('0x5d')](_0xef61('0x5f'),'ui')[_0xef61('0x60')](_0xef61('0x61'),'u','u.id\x20=\x20ui.UserId');var _0x474dad=squel[_0xef61('0x5a')]()['from'](_0xef61('0x62'),'i')[_0xef61('0x60')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xef61('0x60')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0xef61('0x63'),'a',_0xef61('0x64'))['left_join'](_0xef61('0x65'),'me',_0xef61('0x66'))[_0xef61('0x60')](_0xef61('0x67'),'it',_0xef61('0x68'))[_0xef61('0x60')](_0xef61('0x69'),'t',_0xef61('0x6a'));var _0x55c6f3=squel['expr']();var _0x1cb2ef=[];var _0x1a2e7e=squel[_0xef61('0x6b')]();var _0x1cc851;if(_0x272143[_0xef61('0x4d')]['search']){_0x1cc851=as[_0xef61('0x6c')](_0x272143['query']['search']);var _0x290a23=_0x1cc851[_0xef61('0x6d')];for(var _0x224f3a=0x0;_0x224f3a<_0x1cc851['conditions'][_0xef61('0x53')];_0x224f3a++){var _0x1a8f8f=_0x1cc851[_0xef61('0x6e')][_0x224f3a];var _0x824157='i';var _0x156888=_[_0xef61('0x6f')](_0x20395d,[_0xef61('0x4c'),_0x1a8f8f[_0xef61('0x5b')]]);if(!_0x156888){switch(_0x1a8f8f[_0xef61('0x5b')]){case _0xef61('0x70'):if(_0x1a8f8f['value']==0x1){_0x474dad[_0xef61('0x71')]('`'+_0x1a8f8f['field']+'`\x20=\x200');}else{_0x474dad[_0xef61('0x71')]('`'+_0x1a8f8f[_0xef61('0x5b')]+_0xef61('0x72'));}break;case _0xef61('0x73'):if(_0x1a8f8f[_0xef61('0x74')]===_0xef61('0x75')){if(_0x1a8f8f['value']['split']('\x20')[_0xef61('0x53')]>0x1){_0x55c6f3[_0x290a23](_0xef61('0x76'),qs[_0xef61('0x77')](_0x1a8f8f[_0xef61('0x78')]),null);}else{var _0x2921b9='%'+_0x1a8f8f[_0xef61('0x78')]+'%';_0x55c6f3[_0x290a23](_0xef61('0x79'),_0x2921b9,_0x2921b9,_0x2921b9);}}else{_0x156888=_[_0xef61('0x6f')](_0x20395d,[_0xef61('0x4c'),_0xef61('0x7a')]);_0x1a8f8f[_0xef61('0x5b')]='ContactId';_0x18c5fb=as[_0xef61('0x7b')](_0x824157,_0x156888[_0xef61('0x49')],_0x1a8f8f);_0x55c6f3[_0x290a23](_0x18c5fb['text'],_0x18c5fb[_0xef61('0x78')][_0xef61('0x7c')],_0x18c5fb[_0xef61('0x78')][_0xef61('0x33')]);}break;case _0xef61('0x7d'):var _0x2deefe=_0x1a8f8f[_0xef61('0x78')][_0xef61('0x44')](',')['map'](function(_0x3ecb8d){return Number(_0x3ecb8d);});_0x2deefe['forEach'](function(_0x58a059){_0x1a2e7e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58a059+',%');});_0x1cb2ef=_[_0xef61('0x7e')](_0x1cb2ef,_0x2deefe);break;case _0xef61('0x7f'):if(_0x1a8f8f[_0xef61('0x74')]==='$substring'){_0x55c6f3[_0x290a23](_0xef61('0x80'),'%'+_0x1a8f8f[_0xef61('0x78')]+'%',null);}else{_0x156888=_[_0xef61('0x6f')](_0x20395d,[_0xef61('0x4c'),_0xef61('0x81')]);_0x1a8f8f[_0xef61('0x5b')]=_0xef61('0x81');_0x18c5fb=as[_0xef61('0x7b')](_0x824157,_0x156888[_0xef61('0x49')],_0x1a8f8f);_0x55c6f3[_0x290a23](_0x18c5fb[_0xef61('0x82')],_0x18c5fb[_0xef61('0x78')][_0xef61('0x7c')],_0x18c5fb[_0xef61('0x78')][_0xef61('0x33')]);}break;case _0xef61('0x83'):_0x18c5fb=as[_0xef61('0x7b')]('me',null,_0x1a8f8f);_0x55c6f3[_0x290a23](_0x18c5fb[_0xef61('0x82')],_0x18c5fb[_0xef61('0x78')]['start'],_0x18c5fb[_0xef61('0x78')][_0xef61('0x33')]);break;}}else{var _0x18c5fb=as[_0xef61('0x7b')](_0x824157,_0x156888[_0xef61('0x49')],_0x1a8f8f);_0x55c6f3[_0x290a23](_0x18c5fb[_0xef61('0x82')],_0x18c5fb['value'][_0xef61('0x7c')],_0x18c5fb[_0xef61('0x78')]['end']);}}}else{var _0x2855a2=_(_0x272143['query'])[_0xef61('0x4e')]()[_0xef61('0x41')](function(_0x5c4000){return _[_0xef61('0x84')](_0x20395d,['name',_0x5c4000])?_0x5c4000:undefined;})[_0xef61('0x85')]()[_0xef61('0x78')]();if(!_['isEmpty'](_0x2855a2)){_0x2855a2['forEach'](function(_0x40284e){if(_0x40284e===_0xef61('0x86')){_0x474dad[_0xef61('0x58')](_0xef61('0x87'),[][_0xef61('0x88')](_0x272143['query'][_0x40284e]));}else if(_0x40284e===_0xef61('0x89')){var _0x2db1d1=JSON[_0xef61('0x8a')](_0x272143[_0xef61('0x4d')][_0x40284e])[_0xef61('0x8b')];var _0x1aa9c3=JSON['parse'](_0x272143[_0xef61('0x4d')][_0x40284e])['$lte'];_0x474dad[_0xef61('0x58')](_0xef61('0x8c'),_0x2db1d1,_0x1aa9c3);}else{if(_0x272143[_0xef61('0x4d')][_0x40284e]===_0xef61('0x8d')){_0x474dad[_0xef61('0x58')]('i.'+_0x40284e+_0xef61('0x8e'));}else{_0x474dad[_0xef61('0x58')]('i.'+_0x40284e+_0xef61('0x8f'),_0x272143[_0xef61('0x4d')][_0x40284e]);}}});}if(_0x272143[_0xef61('0x4d')][_0xef61('0x90')]){if(_0x272143[_0xef61('0x4d')][_0xef61('0x90')]==0x1){_0x474dad['having'](_0xef61('0x91'));}else{_0x474dad[_0xef61('0x71')](_0xef61('0x92'));}}if(_0x272143[_0xef61('0x4d')]['tag']){_0x1cb2ef=_[_0xef61('0x93')](_0x272143['query']['tag'])?_0x272143[_0xef61('0x4d')]['tag']:new Array(_0x272143[_0xef61('0x4d')]['tag']);_0x1cb2ef['forEach'](function(_0xab59f1){_0x1a2e7e['or'](_0xef61('0x94'),'%,'+_0xab59f1+',%');});}if(_0x272143['query'][_0xef61('0x95')]){var _0x4a2e8c=_0x272143[_0xef61('0x4d')][_0xef61('0x95')][_0xef61('0x96')]('\x5c','\x5c\x5c')[_0xef61('0x96')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xef61('0x97')](_0x4a2e8c)){_0x55c6f3['or']('i.id\x20LIKE\x20?',_0x4a2e8c+'%');}else{_0x55c6f3['or'](_0xef61('0x98'),qs[_0xef61('0x77')](_0x4a2e8c))['or'](_0xef61('0x99'),_0x4a2e8c+'%');}}}_0x474dad[_0xef61('0x58')](_0x55c6f3);_0x474dad[_0xef61('0x9a')](_0xef61('0x9b'));var _0x24f417={'type':db[_0xef61('0x9c')][_0xef61('0x9d')]['SELECT'],'raw':!![]};var _0xaa6e48=_0x474dad['clone']();_0xaa6e48[_0xef61('0x5b')](_0xef61('0x9b'));_0xaa6e48['field'](_0xef61('0x9e'),'unreadMessages');if(_0x50e47f['order']){_0x50e47f[_0xef61('0x56')][_0xef61('0x9f')](function(_0x4cdabf){_0x474dad[_0xef61('0x56')]('i.'+_0x4cdabf[0x0],_0x4cdabf[0x1]===_0xef61('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x1cb2ef)){_0x474dad[_0xef61('0x71')](_0x1a2e7e);_0xaa6e48[_0xef61('0x58')]('t.id\x20IN\x20?',_0x1cb2ef);}BPromise[_0xef61('0xa1')]()['then'](function(){if(!_0x1cc851){if(_0x272143[_0xef61('0x4d')][_0xef61('0x86')]||_0x272143[_0xef61('0x4d')][_0xef61('0xa2')])return;_0xaa6e48['where'](_0xef61('0xa3'));_0x474dad[_0xef61('0x58')](_0xef61('0xa3'));return;}return _0x272143['user'][_0xef61('0xa4')]({'attributes':['id'],'raw':!![]})[_0xef61('0x3d')](function(_0x5a4338){if(_['isEmpty'](_0x5a4338)){_0xaa6e48[_0xef61('0x58')](_0xef61('0xa5'));_0x474dad[_0xef61('0x58')](_0xef61('0xa5'));}else{_0xaa6e48[_0xef61('0x58')](_0xef61('0x87'),_[_0xef61('0x41')](_0x5a4338,'id'));_0x474dad[_0xef61('0x58')](_0xef61('0x87'),_[_0xef61('0x41')](_0x5a4338,'id'));}});})[_0xef61('0x3d')](function(){db[_0xef61('0xa6')][_0xef61('0x4d')](_0xaa6e48[_0xef61('0xa7')](),_0x24f417)[_0xef61('0x3d')](function(_0x2f5888){_0x2f1b49['count']=_0x2f5888[_0xef61('0x53')];if(_0x2f1b49[_0xef61('0x35')]===0x0)return[];return db[_0xef61('0xa6')][_0xef61('0x4d')](_0x20950a[_0xef61('0xa7')](),_0x24f417)[_0xef61('0x3d')](function(_0x29ef4b){_0x193f46=_[_0xef61('0xa8')](_0x29ef4b,'id');_0x24f417=_[_0xef61('0xa9')](_0x24f417,{'model':db[_0xef61('0xaa')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x272143[_0xef61('0x4d')][_0xef61('0x52')]){_0x50e47f['attributes'][_0xef61('0x9f')](function(_0xe465b9){_0x474dad['field']('i.'+_0xe465b9);});}else{_0x474dad[_0xef61('0x5b')](_0xef61('0x9e'),_0xef61('0x70'));_0x474dad[_0xef61('0x5b')](_0xef61('0xab'),'Account.key');_0x474dad[_0xef61('0x5b')]('a.mandatoryDisposition',_0xef61('0xac'));_0x474dad[_0xef61('0x5b')](_0xef61('0xad'));_0x474dad[_0xef61('0x5b')](_0xef61('0xae'),_0xef61('0xaf'));_0x474dad[_0xef61('0x5b')](_0xef61('0xb0'),'Contact.lastName');_0x474dad[_0xef61('0x5b')](_0xef61('0xb1'),_0xef61('0xb2'));_0x474dad[_0xef61('0x5b')](_0xef61('0xb3'),_0xef61('0xb4'));_0x474dad[_0xef61('0x5b')](_0xef61('0xb5'),_0xef61('0xb6'));_0x474dad['field'](_0xef61('0xb7'),_0xef61('0xb8'));_0x474dad[_0xef61('0x5b')](_0xef61('0xb9'),'Owner.fullname');_0x474dad['field'](_0xef61('0xba'),_0xef61('0xbb'));_0x474dad[_0xef61('0x5b')](_0xef61('0xbc'),_0xef61('0x42'));}if(_0x50e47f[_0xef61('0x37')])_0x474dad[_0xef61('0x37')](_0x50e47f['limit']);if(_0x50e47f[_0xef61('0x36')])_0x474dad[_0xef61('0x36')](_0x50e47f[_0xef61('0x36')]);return db[_0xef61('0xa6')][_0xef61('0x4d')](_0x474dad['toString'](),_0x24f417);})[_0xef61('0x3d')](function(_0x4acd84){_0x5316ac[_0xef61('0x58')](_0xef61('0xbd'),_[_0xef61('0x41')](_0x4acd84,'id'));return db[_0xef61('0xa6')][_0xef61('0x4d')](_0x5316ac[_0xef61('0xa7')](),_0x24f417)['then'](function(_0x2387b1){var _0x10e5f0=_[_0xef61('0xbe')](_0x2387b1,_0xef61('0xbf'));var _0x3b4645=[];_0x4acd84[_0xef61('0x9f')](function(_0x174dc6){_0x3b4645['push'](updateChatInteraction(_0x174dc6,_0x193f46,_0x10e5f0));});return BPromise[_0xef61('0xc0')](_0x3b4645);});});})[_0xef61('0x3d')](function(_0x86913){_0x2f1b49['rows']=_0x86913;return _0x2f1b49;})['then'](respondWithFilteredResult(_0xc9b467,_0x50e47f));})[_0xef61('0x30')](handleError(_0xc9b467,null));};exports[_0xef61('0xc1')]=function(_0x4fcd85,_0x116997){var _0x1a9418={'raw':![],'where':{'id':_0x4fcd85[_0xef61('0xc2')]['id']}},_0x30e931={};_0x30e931[_0xef61('0x4b')]=_[_0xef61('0x4e')](db[_0xef61('0xaa')][_0xef61('0x47')]);_0x30e931['query']=_[_0xef61('0x4e')](_0x4fcd85[_0xef61('0x4d')]);_0x30e931[_0xef61('0x4f')]=_[_0xef61('0x50')](_0x30e931[_0xef61('0x4b')],_0x30e931['query']);_0x1a9418[_0xef61('0x51')]=_['intersection'](_0x30e931[_0xef61('0x4b')],qs[_0xef61('0x52')](_0x4fcd85[_0xef61('0x4d')]['fields']));_0x1a9418['attributes']=_0x1a9418[_0xef61('0x51')][_0xef61('0x53')]?_0x1a9418['attributes']:_0x30e931['model'];if(_0x4fcd85[_0xef61('0x4d')][_0xef61('0xc3')]){_0x1a9418[_0xef61('0xc4')]=[{'all':!![]}];}_0x1a9418=_[_0xef61('0xa9')]({},_0x1a9418,_0x4fcd85[_0xef61('0xc5')]);return db[_0xef61('0xaa')][_0xef61('0x6f')](_0x1a9418)[_0xef61('0x3d')](handleEntityNotFound(_0x116997,null))[_0xef61('0x3d')](respondWithResult(_0x116997,null))[_0xef61('0x30')](handleError(_0x116997,null));};exports[_0xef61('0xc6')]=function(_0x49f528,_0x1e9123){return db[_0xef61('0xaa')]['create'](_0x49f528[_0xef61('0x83')],{})[_0xef61('0x3d')](respondWithResult(_0x1e9123,0xc9))[_0xef61('0x30')](handleError(_0x1e9123,null));};exports[_0xef61('0x3c')]=function(_0x139c1a,_0x3df536){if(_0x139c1a['body']['id']){delete _0x139c1a[_0xef61('0x83')]['id'];}return db[_0xef61('0xaa')][_0xef61('0x6f')]({'where':{'id':_0x139c1a[_0xef61('0xc2')]['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x3df536,null))[_0xef61('0x3d')](saveUpdates(_0x139c1a['body'],null))['then'](respondWithResult(_0x3df536,null))[_0xef61('0x30')](handleError(_0x3df536,null));};exports[_0xef61('0x3e')]=function(_0xad48e2,_0x230efd){return db[_0xef61('0xaa')][_0xef61('0x6f')]({'where':{'id':_0xad48e2[_0xef61('0xc2')]['id']}})['then'](handleEntityNotFound(_0x230efd,null))['then'](removeEntity(_0x230efd,null))[_0xef61('0x30')](handleError(_0x230efd,null));};exports[_0xef61('0xc7')]=function(_0x29d63f,_0x20d16f){return db[_0xef61('0xaa')]['describe']()[_0xef61('0x3d')](respondWithResult(_0x20d16f,null))['catch'](handleError(_0x20d16f,null));};exports[_0xef61('0xc8')]=function(_0x5b8d82,_0x42b2ae){var _0x5957b4=_0x5b8d82['params']['id'];var _0x3b3c1a;var _0x1f9210;var _0x21c701;return db[_0xef61('0xaa')][_0xef61('0xc9')]({'where':{'id':_0x5957b4}})['then'](function(_0x50058b){_0x3b3c1a=_0x50058b;return db['ChatWebsite'][_0xef61('0xc9')]({'where':{'id':_0x50058b['ChatWebsiteId']},'attributes':['id',_0xef61('0xca'),_0xef61('0xcb')],'raw':!![]});})[_0xef61('0x3d')](function(_0x33d595){if(_0x33d595&&_0x33d595[_0xef61('0xca')]&&_0x33d595[_0xef61('0xcb')]){_0x1f9210=_0x33d595;var _0x473ade={'rejectUnauthorized':![],'method':'POST','uri':_0xef61('0xcc'),'headers':{'X-APIKEY':_0x33d595['vidaooApiKey']},'body':{'name':_0xef61('0xcd')+_0x5957b4},'redirect':_0xef61('0xce'),'json':!![]};return rp(_0x473ade);}else{throw new db[(_0xef61('0x9c'))][(_0xef61('0x25'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xef61('0x3d')](function(_0x45c0f4){_0x21c701=_0x45c0f4;if(_0x21c701['id']){var _0xd85491={'body':_0x21c701['join_url'],'ChatWebsiteId':_0x1f9210['id'],'ChatInteractionId':_0x3b3c1a['id'],'direction':'out','UserId':_0x5b8d82[_0xef61('0xcf')]['id']};return db[_0xef61('0xd0')]['create'](_0xd85491,{});}else{throw new db[(_0xef61('0x9c'))][(_0xef61('0x25'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x3b3c1a[_0xef61('0xd1')]({'vidaooSessionId':_0x21c701['id']});})[_0xef61('0x3d')](respondWithResult(_0x42b2ae,null))['catch'](handleError(_0x42b2ae,null));};exports[_0xef61('0xd2')]=function(_0x5d2765,_0x101d3f){if(_0x5d2765['body']['id']){delete _0x5d2765[_0xef61('0x83')]['id'];}return db['ChatInteraction'][_0xef61('0x6f')]({'where':{'id':_0x5d2765['params']['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x101d3f,null))[_0xef61('0x3d')](saveUpdates(_0x5d2765['body'],null))[_0xef61('0x3d')](respondWithResult(_0x101d3f,null))[_0xef61('0x30')](handleError(_0x101d3f,null));};exports[_0xef61('0xd3')]=function(_0x524b9c,_0x4c63f8,_0x41592a){if(_0x524b9c[_0xef61('0x83')]['id']){delete _0x524b9c['body']['id'];}return db['ChatInteraction'][_0xef61('0x6f')]({'where':{'id':_0x524b9c[_0xef61('0xc2')]['id']}})['then'](function(_0x15aa64){if(!_0x15aa64){logger['error'](_0xef61('0xd4'),_0xef61('0xd3'),0x194,_0xef61('0xd5'));_0x4c63f8[_0xef61('0x31')](0x194);}else{if(_0x15aa64[_0xef61('0x81')]){throw new db[(_0xef61('0x9c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x15aa64;})[_0xef61('0x3d')](function(_0x3489f1){if(_0x3489f1){return _0x3489f1[_0xef61('0x3c')]({'closed':_0x524b9c[_0xef61('0x83')][_0xef61('0xd6')],'disposition':_0x524b9c[_0xef61('0x83')][_0xef61('0xd7')]})[_0xef61('0x3d')](function(_0x5c45bd){return _0x5c45bd;});}})[_0xef61('0x3d')](function(_0x122139){return respondWithRpcPromise(_0xef61('0xd8'),_0xef61('0xd3'),_0x524b9c[_0xef61('0x83')],client9004);})[_0xef61('0x3d')](respondWithResult(_0x4c63f8,null))[_0xef61('0x30')](handleError(_0x4c63f8,null));};exports['attachmentUpload']=function(_0x68c83c,_0x2d57fd,_0x1b3118){_0x68c83c[_0xef61('0x83')][_0xef61('0x4c')]=_0x68c83c[_0xef61('0xd9')][_0xef61('0xda')];_0x68c83c['body'][_0xef61('0xdb')]=_0x68c83c[_0xef61('0xd9')][_0xef61('0xdc')];_0x68c83c[_0xef61('0x83')][_0xef61('0x49')]=_0x68c83c[_0xef61('0xd9')][_0xef61('0xdd')];return db['Attachment'][_0xef61('0xc6')](_0x68c83c[_0xef61('0x83')])['then'](respondWithResult(_0x2d57fd,0xc9))['catch'](handleError(_0x2d57fd,null));};exports['attachmentDownload']=function(_0x46e9fa,_0x268cd9,_0x40d0a){return db['ChatInteraction'][_0xef61('0xc9')]({'where':{'id':_0x46e9fa[_0xef61('0xc2')]['id']},'raw':!![]})[_0xef61('0x3d')](handleEntityNotFound(_0x268cd9,null))[_0xef61('0x3d')](function(_0x4c057a){if(_0x4c057a){if(_0x4c057a[_0xef61('0xd6')]){return _0x268cd9[_0xef61('0x32')](0x193)[_0xef61('0x34')]({'status':0x193,'message':_0xef61('0xde')});}return db[_0xef61('0xdf')]['findOne']({'where':{'id':_0x46e9fa[_0xef61('0x4d')][_0xef61('0xe0')]},'raw':!![]})[_0xef61('0x3d')](handleEntityNotFound(_0x268cd9,null));}})[_0xef61('0x3d')](function(_0x56ef){if(_0x56ef){return _0x268cd9[_0xef61('0xe1')](path[_0xef61('0xe2')](config[_0xef61('0xe3')],_0xef61('0xe4'),_0x56ef[_0xef61('0xdb')]));}})[_0xef61('0x30')](handleError(_0x268cd9,null));};exports['close']=function(_0x13d81c,_0x5a00e5){var _0x4fdf48=null;var _0x4a714f=null;var _0x5df068=null;var _0xf4b971=null;if(_0x13d81c[_0xef61('0x83')]['id']){delete _0x13d81c[_0xef61('0x83')]['id'];}if(_0x13d81c[_0xef61('0x83')][_0xef61('0xe5')]){_0xf4b971=path['join'](config['root'],_0xef61('0xe6'),util['format'](_0xef61('0xe7'),Date[_0xef61('0xe8')]()));_0x13d81c[_0xef61('0x83')]['pathTranscript']=_0xf4b971;}return db[_0xef61('0xaa')][_0xef61('0x6f')]({'where':{'id':_0x13d81c[_0xef61('0xc2')]['id']},'include':[{'model':db[_0xef61('0xd0')],'as':_0xef61('0xe9'),'include':[{'model':db[_0xef61('0x7f')],'as':'User'}]}]})[_0xef61('0x3d')](handleEntityNotFound(_0x5a00e5,null))[_0xef61('0x3d')](saveUpdates(_0x13d81c[_0xef61('0x83')],null))[_0xef61('0x3d')](function(_0x5559f4){if(_0x5559f4){_0x4fdf48=_0x5559f4;return db['ChatWebsite'][_0xef61('0x6f')]({'where':{'id':_0x4fdf48[_0xef61('0x86')]}});}})[_0xef61('0x3d')](function(_0x48f1a8){if(_0x48f1a8){_0x5df068=_0x48f1a8;return db[_0xef61('0xea')][_0xef61('0x6f')]({'where':{'id':_0x4fdf48['ContactId']}});}})[_0xef61('0x3d')](function(_0x89e31b){if(_0x89e31b){_0x4a714f=_0x89e31b;if(_0xf4b971){var _0x48d02a=null;for(var _0x980546=0x1;_0x980546<_0x4fdf48[_0xef61('0xe9')][_0xef61('0x53')];++_0x980546){_0x48d02a=_0x4fdf48[_0xef61('0xe9')][_0x980546];var _0x187335=_0x48d02a[_0xef61('0x81')]?util[_0xef61('0xeb')]('%s%d',_0x5df068[_0xef61('0xec')],_0x48d02a[_0xef61('0x81')]):'System';var _0xf43ed=_0x13d81c['body'][_0xef61('0xed')]||util[_0xef61('0xeb')](_0xef61('0xee'),_0xef61('0xef'),_0x48d02a[_0xef61('0x7a')]);switch(_0x5df068[_0xef61('0xf0')]){case _0xef61('0xf1'):_0x187335=_0x48d02a[_0xef61('0x81')]?util['format'](_0xef61('0xee'),_0x5df068[_0xef61('0xec')],_0x48d02a['UserId']):_0xef61('0xf2');break;case _0xef61('0xf3'):_0x187335=_0x48d02a[_0xef61('0x81')]?_0x48d02a['User'][_0xef61('0xf4')]||_0x48d02a[_0xef61('0x7f')]['fullname']:_0xef61('0xf2');break;case'agent_fullname':_0x187335=_0x48d02a['UserId']?_0x48d02a[_0xef61('0x7f')]['fullname']:_0xef61('0xf2');break;default:_0x187335=_0x48d02a[_0xef61('0x81')]?util[_0xef61('0xeb')](_0xef61('0xee'),_0x5df068[_0xef61('0xec')],_0x48d02a[_0xef61('0x81')]):_0xef61('0xf2');}var _0x33c62c=util[_0xef61('0xeb')](_0xef61('0xf5'),moment(_0x48d02a[_0xef61('0x89')])['format'](_0xef61('0xf6')),_0x48d02a[_0xef61('0xf7')]==='in'?_0xf43ed:_0x187335,_0x48d02a[_0xef61('0x83')]);if(!_0x48d02a[_0xef61('0xf8')]){fs[_0xef61('0xf9')](_0xf4b971,_0x33c62c);}}return db[_0xef61('0xfa')][_0xef61('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0xef61('0xfb')],'as':_0xef61('0xfc'),'raw':!![]}]});}}})['then'](function(_0x2e2c6b){if(_0x2e2c6b&&_0x2e2c6b[_0xef61('0xfc')]&&_0x13d81c[_0xef61('0x83')]){var _0x286345={'tls':{'rejectUnauthorized':![]}};if(_0x2e2c6b[_0xef61('0xfc')][_0xef61('0xfd')]){_0x286345[_0xef61('0xfd')]=_0x2e2c6b[_0xef61('0xfc')][_0xef61('0xfd')];}else{_0x286345[_0xef61('0xfe')]=_0x2e2c6b['Smtp']['host'];_0x286345['port']=_0x2e2c6b[_0xef61('0xfc')][_0xef61('0xff')];_0x286345[_0xef61('0x100')]=_0x2e2c6b[_0xef61('0xfc')][_0xef61('0x100')];}if(_0x2e2c6b['Smtp']['authentication']){_0x286345[_0xef61('0x101')]={'user':_0x2e2c6b[_0xef61('0xfc')][_0xef61('0xcf')],'pass':_0x2e2c6b[_0xef61('0xfc')][_0xef61('0x102')]};}return respondWithRpcPromise(_0xef61('0x103'),_0xef61('0x104'),{'account':_0x286345,'message':{'from':util[_0xef61('0xeb')](_0xef61('0x105'),_0x2e2c6b[_0xef61('0x4c')],_0x2e2c6b[_0xef61('0x106')]||_0x2e2c6b[_0xef61('0xfc')][_0xef61('0xcf')]),'to':_0x13d81c[_0xef61('0x83')][_0xef61('0xe5')],'subject':'Mail\x20Transcript','text':util[_0xef61('0xeb')](_0xef61('0x107'),_0x13d81c[_0xef61('0x83')][_0xef61('0xe5')]),'attachments':[{'path':_0xf4b971}]}})[_0xef61('0x3d')](function(){return _0x4fdf48;})['catch'](function(_0x277ce0){console[_0xef61('0x2d')](_0x277ce0);});}else{return _0x4fdf48;}})['then'](respondWithStatusCode(_0x5a00e5,0xc8))['catch'](handleError(_0x5a00e5,null));};exports[_0xef61('0x108')]=function(_0xc7f66a,_0x355a60,_0x105dd7){return db[_0xef61('0xd0')][_0xef61('0x6f')]({'where':{'id':_0xc7f66a[_0xef61('0xc2')]['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x355a60,null))['then'](function(_0x4adc94){if(_0x4adc94){return _0x4adc94['addMessage'](_0xc7f66a[_0xef61('0x83')][_0xef61('0x109')],_[_0xef61('0x10a')](_0xc7f66a[_0xef61('0x83')],[_0xef61('0x109'),'id'])||{});}})[_0xef61('0x3d')](respondWithResult(_0x355a60,null))['catch'](handleError(_0x355a60,null));};exports[_0xef61('0x10b')]=function(_0x17542d,_0x4bcb68,_0x5dcf03){var _0x378ed4={'raw':![],'where':{}};var _0x144743={};var _0x481f72={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xef61('0xc9')]({'where':{'id':_0x17542d[_0xef61('0xc2')]['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x4bcb68,null))[_0xef61('0x3d')](function(_0x2943f1){if(_0x2943f1){_0x144743[_0xef61('0x4b')]=_[_0xef61('0x4e')](db[_0xef61('0xd0')][_0xef61('0x47')]);_0x144743['query']=_[_0xef61('0x4e')](_0x17542d['query']);_0x144743['filters']=_['intersection'](_0x144743[_0xef61('0x4b')],_0x144743['query']);_0x378ed4[_0xef61('0x51')]=_[_0xef61('0x50')](_0x144743[_0xef61('0x4b')],qs['fields'](_0x17542d[_0xef61('0x4d')][_0xef61('0x52')]));_0x378ed4[_0xef61('0x51')]=_0x378ed4[_0xef61('0x51')]['length']?_0x378ed4[_0xef61('0x51')]:_0x144743[_0xef61('0x4b')];if(!_0x17542d['query'][_0xef61('0x54')](_0xef61('0x55'))){_0x378ed4[_0xef61('0x37')]=qs[_0xef61('0x37')](_0x17542d[_0xef61('0x4d')]['limit']);_0x378ed4['offset']=qs[_0xef61('0x36')](_0x17542d[_0xef61('0x4d')][_0xef61('0x36')]);}_0x378ed4['order']=qs['sort'](_0x17542d[_0xef61('0x4d')]['sort']);_0x378ed4[_0xef61('0x58')]=qs[_0xef61('0x4f')](_['pick'](_0x17542d[_0xef61('0x4d')],_0x144743['filters']));_0x378ed4[_0xef61('0x58')]['ChatInteractionId']=_0x2943f1['id'];if(_0x17542d['query'][_0xef61('0x95')]){_0x378ed4[_0xef61('0x58')]=_[_0xef61('0xa9')](_0x378ed4[_0xef61('0x58')],{'$or':_[_0xef61('0x41')](_0x378ed4['attributes'],function(_0x7b1d25){var _0x647a08={};_0x647a08[_0x7b1d25]={'$like':'%'+_0x17542d[_0xef61('0x4d')][_0xef61('0x95')]+'%'};return _0x647a08;})});}if(_0x17542d['query'][_0xef61('0x8b')]){var _0x1152d0=_0x17542d[_0xef61('0x4d')][_0xef61('0x8b')]['split'](',');var _0x2955b0={};_0x2955b0[_0x1152d0[0x0]]={'$gte':moment(_0x1152d0[0x1])['format'](_0xef61('0x10c'))};_0x378ed4[_0xef61('0x58')]=_[_0xef61('0xa9')](_0x378ed4['where'],_0x2955b0);}_0x378ed4=_[_0xef61('0xa9')]({},_0x378ed4,_0x17542d[_0xef61('0xc5')]);return db['ChatMessage']['count']({'where':_0x378ed4[_0xef61('0x58')]})[_0xef61('0x3d')](function(_0x37d082){_0x481f72[_0xef61('0x35')]=_0x37d082;if(_0x17542d[_0xef61('0x4d')]['includeAll']){_0x378ed4['include']=[{'all':!![]}];}return db[_0xef61('0xd0')][_0xef61('0x10d')](_0x378ed4);})[_0xef61('0x3d')](function(_0x42247e){_0x481f72[_0xef61('0x10e')]=_0x42247e;return _0x481f72;});}})[_0xef61('0x3d')](respondWithFilteredResult(_0x4bcb68,_0x378ed4))['catch'](handleError(_0x4bcb68,null));};exports['getMyMessages']=function(_0x45bef1,_0x27872e,_0x481728){var _0xc89702={'where':{}},_0xd9c38b={},_0x586025={'count':0x0,'rows':[]};return db[_0xef61('0xaa')][_0xef61('0xc9')]({'where':{'id':_0x45bef1[_0xef61('0xc2')]['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x27872e,null))[_0xef61('0x3d')](function(_0x23a89e){if(_0x23a89e){_0xd9c38b[_0xef61('0x4b')]=_[_0xef61('0x4e')](db[_0xef61('0xd0')][_0xef61('0x47')]);_0xd9c38b[_0xef61('0x4d')]=_[_0xef61('0x4e')](_0x45bef1[_0xef61('0x4d')]);_0xd9c38b[_0xef61('0x4f')]=_['intersection'](_0xd9c38b[_0xef61('0x4b')],_0xd9c38b[_0xef61('0x4d')]);_0xc89702[_0xef61('0x51')]=_['intersection'](_0xd9c38b[_0xef61('0x4b')],qs['fields'](_0x45bef1['query'][_0xef61('0x52')]));_0xc89702['attributes']=_0xc89702[_0xef61('0x51')]['length']?_0xc89702[_0xef61('0x51')]:_0xd9c38b[_0xef61('0x4b')];if(!_0x45bef1[_0xef61('0x4d')]['hasOwnProperty'](_0xef61('0x55'))){_0xc89702['limit']=qs['limit'](_0x45bef1[_0xef61('0x4d')][_0xef61('0x37')]);_0xc89702[_0xef61('0x36')]=qs[_0xef61('0x36')](_0x45bef1[_0xef61('0x4d')][_0xef61('0x36')]);}_0xc89702[_0xef61('0x56')]=qs[_0xef61('0x57')](_0x45bef1[_0xef61('0x4d')][_0xef61('0x57')]);_0xc89702['where']=qs[_0xef61('0x4f')](_[_0xef61('0x59')](_0x45bef1[_0xef61('0x4d')],_0xd9c38b[_0xef61('0x4f')]));_0xc89702['where'][_0xef61('0xbf')]=_0x23a89e['id'];if(_0x45bef1[_0xef61('0x4d')][_0xef61('0x95')]){_0xc89702[_0xef61('0x58')]=_[_0xef61('0xa9')](_0xc89702['where'],{'$or':_[_0xef61('0x41')](_0xc89702[_0xef61('0x51')],function(_0x20c061){var _0x547f17={};_0x547f17[_0x20c061]={'$like':'%'+_0x45bef1['query'][_0xef61('0x95')]+'%'};return _0x547f17;})});}_0xc89702[_0xef61('0x58')][_0xef61('0xf8')]=![];if(_0x45bef1[_0xef61('0x4d')]['id']){_0xc89702[_0xef61('0x58')]['id']={'$gt':_0x45bef1[_0xef61('0x4d')]['id']};}_0xc89702=_[_0xef61('0xa9')]({},_0xc89702,_0x45bef1[_0xef61('0xc5')]);return db['ChatMessage'][_0xef61('0x35')]({'where':_0xc89702[_0xef61('0x58')]})['then'](function(_0x1d2666){_0x586025[_0xef61('0x35')]=_0x1d2666;_0xc89702[_0xef61('0xc4')]=[];if(_0x45bef1[_0xef61('0x4d')]['includeAgent']){_0xc89702[_0xef61('0xc4')]['push']({'model':db['User'],'as':'User','attributes':['id',_0xef61('0x10f'),_0xef61('0xf4')]});}if(_0x45bef1[_0xef61('0x4d')][_0xef61('0xc3')]){_0xc89702[_0xef61('0xc4')]=[{'all':!![]}];}return db[_0xef61('0xd0')][_0xef61('0x10d')](_0xc89702);})[_0xef61('0x3d')](function(_0x207921){_0x586025['rows']=_0x207921;return _0x586025;});}})[_0xef61('0x3d')](respondWithFilteredResult(_0x27872e,_0xc89702))[_0xef61('0x30')](handleError(_0x27872e,null));};exports[_0xef61('0x110')]=function(_0x9a7a8b,_0x389969,_0x21d111){return db['ChatInteraction'][_0xef61('0x6f')]({'where':{'id':_0x9a7a8b[_0xef61('0xc2')]['id']}})[_0xef61('0x3d')](handleEntityNotFound(_0x389969,null))['then'](function(_0x5e49d5){if(_0x5e49d5){return _0x5e49d5['setTags'](_0x9a7a8b[_0xef61('0x83')][_0xef61('0x109')],_[_0xef61('0x10a')](_0x9a7a8b[_0xef61('0x83')],[_0xef61('0x109'),'id'])||{})['spread'](function(){return db[_0xef61('0x7d')][_0xef61('0x10d')]({'attributes':['id','name',_0xef61('0x5c')],'where':{'id':_0x9a7a8b[_0xef61('0x83')]['ids']}});})[_0xef61('0x3d')](function(_0xc2342f){socket['emit'](_0xef61('0x111'),{'id':Number(_0x9a7a8b['params']['id']),'tags':_0xc2342f||[]});return{'id':Number(_0x9a7a8b[_0xef61('0xc2')]['id']),'tags':_0xc2342f||[]};});}})[_0xef61('0x3d')](respondWithResult(_0x389969,null))[_0xef61('0x30')](handleError(_0x389969,null));};exports[_0xef61('0x112')]=function(_0x15a336,_0x3f06d9,_0x5cab65){return db[_0xef61('0xaa')]['find']({'where':{'id':_0x15a336[_0xef61('0xc2')]['id']}})['then'](handleEntityNotFound(_0x3f06d9,null))[_0xef61('0x3d')](function(_0x2e7b2c){if(_0x2e7b2c){return _0x2e7b2c[_0xef61('0x112')](_0x15a336['query'][_0xef61('0x109')]);}})[_0xef61('0x3d')](respondWithStatusCode(_0x3f06d9,null))[_0xef61('0x30')](handleError(_0x3f06d9,null));};exports[_0xef61('0xe1')]=function(_0x49b6ed,_0x403cde){var _0x5666f5=moment()[_0xef61('0x113')]()['toString']();var _0x2ff347=path[_0xef61('0xe2')](config[_0xef61('0xe3')],'server',_0xef61('0x114'),_0xef61('0x115'));var _0x14dd41=path[_0xef61('0xe2')](config[_0xef61('0xe3')],_0xef61('0x116'),_0xef61('0x114'),_0xef61('0x117'));var _0x425e28=path['join'](_0x2ff347,_0x5666f5);var _0x5433f7=util[_0xef61('0xeb')](_0xef61('0x118'),_0x49b6ed['params']['id'],_0x5666f5);var _0x2b4ca8=path['join'](_0x2ff347,_0x5433f7);var _0x34c8be=[];_0x34c8be['push']({'model':db[_0xef61('0x7f')],'as':_0xef61('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x34c8be['push']({'model':db[_0xef61('0xea')],'as':_0xef61('0x73'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x49b6ed[_0xef61('0x4d')]['attachments']){_0x34c8be[_0xef61('0x45')]({'model':db[_0xef61('0xdf')],'as':'Attachment','raw':!![]});}var _0x5e57a6=[{'model':db[_0xef61('0xd0')],'as':_0xef61('0xe9'),'attributes':['id',_0xef61('0x83'),'createdAt',_0xef61('0xf7'),_0xef61('0xf8'),_0xef61('0x90')],'include':_0x34c8be}];_0x5e57a6['push']({'model':db[_0xef61('0x119')],'as':_0xef61('0x11a'),'attributes':['id',_0xef61('0x4c')]});_0x5e57a6[_0xef61('0x45')]({'model':db[_0xef61('0x7f')],'as':'Owner','attributes':['id',_0xef61('0x10f')]});return db[_0xef61('0xaa')][_0xef61('0x6f')]({'where':{'id':_0x49b6ed[_0xef61('0xc2')]['id']},'include':_0x5e57a6})[_0xef61('0x3d')](handleEntityNotFound(_0x403cde,null))[_0xef61('0x3d')](function(_0x3a6150){if(_0x3a6150){var _0x26c7cf=_0x3a6150[_0xef61('0x11b')]({'plain':!![]});fs['mkdirSync'](_0x425e28);var _0x382243={'format':'A4','border':'10px','header':{'height':_0xef61('0x11c'),'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':'30px','contents':{'default':util[_0xef61('0xeb')](_0xef61('0x11d'),util[_0xef61('0xeb')]('%s\x20#%d',_0xef61('0x11e'),_0x26c7cf['id']),moment()['format'](_0xef61('0x11f'))['toString']())}}};var _0x118d3b={'channel':_0xef61('0x11e'),'account':_0x26c7cf[_0xef61('0x11a')]['name'],'agent':_0x26c7cf[_0xef61('0x120')]?_0x26c7cf[_0xef61('0x120')]['fullname']:'N.A.','createdAt':moment(_0x26c7cf[_0xef61('0x89')])[_0xef61('0xeb')](_0xef61('0x10c'))[_0xef61('0xa7')](),'closedAt':_0x26c7cf['closed']?moment(_0x26c7cf['closedAt'])[_0xef61('0xeb')](_0xef61('0x10c'))[_0xef61('0xa7')]():'','disposition':_0x26c7cf[_0xef61('0xd7')],'chatInfo':{'browser':_0x26c7cf[_0xef61('0x121')],'os':_0x26c7cf[_0xef61('0x122')],'referer':_0x26c7cf[_0xef61('0x123')],'customerIp':_0x26c7cf[_0xef61('0x124')],'customerPort':_0x26c7cf['customerPort']?_0x26c7cf[_0xef61('0x125')]:_0xef61('0x126')},'messages':_(_0x26c7cf[_0xef61('0xe9')])[_0xef61('0x127')]()[_0xef61('0x95')]({'secret':![]})[_0xef61('0x41')](function(_0x56f0d1){if(_0x56f0d1[_0xef61('0xdf')]){var _0x1fe687=path[_0xef61('0xe2')](_0x14dd41,_0x56f0d1[_0xef61('0xdf')][_0xef61('0xdb')]);if(fs[_0xef61('0x128')](_0x1fe687)){fs['createReadStream'](_0x1fe687)[_0xef61('0x129')](fs['createWriteStream'](path[_0xef61('0xe2')](_0x425e28,_0x56f0d1[_0xef61('0xdf')][_0xef61('0xdb')])));}}return{'date':moment(_0x56f0d1[_0xef61('0x89')])[_0xef61('0xeb')](_0xef61('0x10c'))[_0xef61('0xa7')](),'sender':_0x56f0d1['direction']===_0xef61('0x12a')?_0x56f0d1[_0xef61('0x7f')]?_0x56f0d1[_0xef61('0x7f')][_0xef61('0x10f')]:_0xef61('0xf2'):_0x56f0d1[_0xef61('0x73')]['firstName']+(_0x56f0d1[_0xef61('0x73')][_0xef61('0x12b')]?'\x20'+_0x56f0d1[_0xef61('0x73')][_0xef61('0x12b')]:''),'body':_0x56f0d1[_0xef61('0xdf')]?_0x56f0d1[_0xef61('0xdf')][_0xef61('0xdb')]:_0x56f0d1['body'],'direction':_0x56f0d1[_0xef61('0xf7')]==='out'?'A':'C','secret':_0x56f0d1[_0xef61('0xf8')],'read':_0x56f0d1[_0xef61('0x90')],'attachment':_0x56f0d1[_0xef61('0xdf')]};})[_0xef61('0x78')]()};return ejs[_0xef61('0x12c')](path[_0xef61('0xe2')](config[_0xef61('0xe3')],_0xef61('0x116'),'views',_0xef61('0x12d')),{'interaction':_0x118d3b})[_0xef61('0x3d')](function(_0x2d16a1){return new BPromise(function(_0x4a934f,_0x4c9d25){pdf[_0xef61('0xc6')](_0x2d16a1,_0x382243)[_0xef61('0x12e')](path[_0xef61('0xe2')](_0x425e28,'transcript-'+_0x26c7cf['id']+'-'+_0x5666f5+'.pdf'),function(_0x301182,_0x2d6635){if(_0x301182)return _0x4c9d25(_0x301182);_0x4a934f(_0x2d6635);});});})[_0xef61('0x3d')](function(){return new BPromise(function(_0x237557,_0x2b5612){zipdir(_0x425e28,{'saveTo':_0x2b4ca8},function(_0x58f00c,_0x473842){if(_0x58f00c)return _0x2b5612(_0x58f00c);return _0x237557(_0x473842);});})['then'](function(){return new BPromise(function(_0x4f5458,_0x342806){rimraf(_0x425e28,function(_0x332a90){if(_0x332a90)_0x342806(_0x332a90);return _0x4f5458();});});})[_0xef61('0x3d')](function(){return _0x403cde[_0xef61('0xe1')](_0x2b4ca8,_0x5433f7,function(_0x34ae3a){if(_0x34ae3a){console[_0xef61('0x12f')](_0xef61('0x130'),_0x34ae3a);}else{fs[_0xef61('0x131')](_0x2b4ca8);}});});});}else{return _0x403cde['sendStatus'](0xc8);}})[_0xef61('0x30')](handleError(_0x403cde,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0fef766..1d3114b 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 _0xa7f8=['setDataValue','map','findAll','length','emit','catch','exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then'];(function(_0x54f859,_0x59d463){var _0x17a08b=function(_0x3f8e49){while(--_0x3f8e49){_0x54f859['push'](_0x54f859['shift']());}};_0x17a08b(++_0x59d463);}(_0xa7f8,0x160));var _0x8a7f=function(_0x570c8a,_0x4a11cc){_0x570c8a=_0x570c8a-0x0;var _0x25dc12=_0xa7f8[_0x570c8a];return _0x25dc12;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8a7f('0x0'))['db'][_0x8a7f('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x8a7f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a7f('0x3'),'afterUpdate':_0x8a7f('0x4'),'afterDestroy':_0x8a7f('0x5')};function emitEvent(_0x47a7d5){return function(_0x35fd45,_0x21ae45,_0x3bbc21){_0x35fd45[_0x8a7f('0x6')]({'attributes':['id'],'raw':!![]})[_0x8a7f('0x7')](function(_0x4ce596){_0x35fd45[_0x8a7f('0x8')]('Users',_0x4ce596[_0x8a7f('0x9')](function(_0xebb4cd){return{'id':_0xebb4cd['id']};}));return ChatMessage[_0x8a7f('0xa')]({'where':{'ChatInteractionId':_0x35fd45['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x367975){_0x35fd45['setDataValue']('unreadMessages',_0x367975[_0x8a7f('0xb')]);ChatInteractionEvents[_0x8a7f('0xc')](_0x47a7d5+':'+_0x35fd45['id'],_0x35fd45);ChatInteractionEvents['emit'](_0x47a7d5,_0x35fd45);_0x3bbc21(null);})[_0x8a7f('0xd')](_0x3bbc21(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x8a7f('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x736c=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','length','emit','catch','hasOwnProperty','hook'];(function(_0xde4288,_0x29ffa9){var _0x5d9a57=function(_0xd2b305){while(--_0xd2b305){_0xde4288['push'](_0xde4288['shift']());}};_0x5d9a57(++_0x29ffa9);}(_0x736c,0x190));var _0xc736=function(_0x33be9b,_0x1d357b){_0x33be9b=_0x33be9b-0x0;var _0x121164=_0x736c[_0x33be9b];return _0x121164;};'use strict';var EventEmitter=require(_0xc736('0x0'));var ChatInteraction=require(_0xc736('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xc736('0x1'))['db'][_0xc736('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc736('0x3')](0x0);var events={'afterCreate':_0xc736('0x4'),'afterUpdate':_0xc736('0x5'),'afterDestroy':_0xc736('0x6')};function emitEvent(_0xb57164){return function(_0x3f00f0,_0x4c262f,_0x5b2a92){_0x3f00f0[_0xc736('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58245d){_0x3f00f0['setDataValue'](_0xc736('0x8'),_0x58245d[_0xc736('0x9')](function(_0x268e4a){return{'id':_0x268e4a['id']};}));return ChatMessage[_0xc736('0xa')]({'where':{'ChatInteractionId':_0x3f00f0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc736('0xb')](function(_0x21458b){_0x3f00f0[_0xc736('0xc')]('unreadMessages',_0x21458b[_0xc736('0xd')]);ChatInteractionEvents[_0xc736('0xe')](_0xb57164+':'+_0x3f00f0['id'],_0x3f00f0);ChatInteractionEvents[_0xc736('0xe')](_0xb57164,_0x3f00f0);_0x5b2a92(null);})[_0xc736('0xf')](_0x5b2a92(null));};}for(var e in events){if(events[_0xc736('0x10')](e)){var event=events[e];ChatInteraction[_0xc736('0x11')](e,emitEvent(event));}}module[_0xc736('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 e1f684b..4bed9c6 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 _0x2619=['ChatInteraction','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x29924d,_0x587d18){var _0x358358=function(_0x309ad0){while(--_0x309ad0){_0x29924d['push'](_0x29924d['shift']());}};_0x358358(++_0x587d18);}(_0x2619,0x1db));var _0x9261=function(_0x4735cd,_0x385053){_0x4735cd=_0x4735cd-0x0;var _0x5463cf=_0x2619[_0x4735cd];return _0x5463cf;};'use strict';var _=require(_0x9261('0x0'));var util=require(_0x9261('0x1'));var logger=require(_0x9261('0x2'))(_0x9261('0x3'));var moment=require(_0x9261('0x4'));var BPromise=require(_0x9261('0x5'));var rp=require(_0x9261('0x6'));var fs=require('fs');var path=require(_0x9261('0x7'));var rimraf=require(_0x9261('0x8'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x9261('0x9')]=function(_0x4b1af3,_0x2ecb7f){return _0x4b1af3[_0x9261('0xa')](_0x9261('0xb'),attributes,{'tableName':_0x9261('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3862de,_0x582a49,_0x262dfb){if(_0x3862de[_0x9261('0xd')]('closed')){_0x3862de[_0x9261('0xe')]=moment()[_0x9261('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x262dfb(null,_0x3862de);}},'charset':_0x9261('0x10'),'collate':_0x9261('0x11')});}; \ No newline at end of file +var _0x70a2=['ChatInteraction','chat_interactions','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','./chatInteraction.attributes','exports','define'];(function(_0x34f2c5,_0x4fbb6a){var _0x2b1049=function(_0x2d1fc){while(--_0x2d1fc){_0x34f2c5['push'](_0x34f2c5['shift']());}};_0x2b1049(++_0x4fbb6a);}(_0x70a2,0x11d));var _0x270a=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0x70a2[_0x2718c7];return _0x59d89c;};'use strict';var _=require(_0x270a('0x0'));var util=require('util');var logger=require(_0x270a('0x1'))(_0x270a('0x2'));var moment=require(_0x270a('0x3'));var BPromise=require(_0x270a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x270a('0x5'));var config=require('../../config/environment');var attributes=require(_0x270a('0x6'));module[_0x270a('0x7')]=function(_0x524220,_0x4532da){return _0x524220[_0x270a('0x8')](_0x270a('0x9'),attributes,{'tableName':_0x270a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35bb80,_0x2d2855,_0x17f221){if(_0x35bb80['changed']('closed')){_0x35bb80['closedAt']=moment()[_0x270a('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x17f221(null,_0x35bb80);}},'charset':_0x270a('0xc'),'collate':_0x270a('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index fb50949..b9889e4 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 _0xbee1=['ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','where','addTags'];(function(_0x158a34,_0x1b6a75){var _0x441524=function(_0x1ad53a){while(--_0x1ad53a){_0x158a34['push'](_0x158a34['shift']());}};_0x441524(++_0x1b6a75);}(_0xbee1,0x11c));var _0x1bee=function(_0x5a1352,_0x42edb2){_0x5a1352=_0x5a1352-0x0;var _0x1b1061=_0xbee1[_0x5a1352];return _0x1b1061;};'use strict';var _=require('lodash');var util=require(_0x1bee('0x0'));var moment=require(_0x1bee('0x1'));var BPromise=require(_0x1bee('0x2'));var rs=require(_0x1bee('0x3'));var fs=require('fs');var Redis=require(_0x1bee('0x4'));var db=require(_0x1bee('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1bee('0x6'));var client=jayson[_0x1bee('0x7')]['http']({'port':0x232a});config[_0x1bee('0x8')]=_[_0x1bee('0x9')](config['redis'],{'host':_0x1bee('0xa'),'port':0x18eb});var socket=require(_0x1bee('0xb'))(new Redis(config[_0x1bee('0x8')]));require(_0x1bee('0xc'))[_0x1bee('0xd')](socket);function respondWithRpcPromise(_0x1da7a5,_0x300bc9,_0x2b4830){return new BPromise(function(_0x36af1a,_0x40d3e3){return client[_0x1bee('0xe')](_0x1da7a5,_0x2b4830)[_0x1bee('0xf')](function(_0x174827){logger[_0x1bee('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x300bc9,'request\x20sent');logger[_0x1bee('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x300bc9,_0x1bee('0x12'),JSON[_0x1bee('0x13')](_0x174827));if(_0x174827[_0x1bee('0x14')]){if(_0x174827[_0x1bee('0x14')][_0x1bee('0x15')]===0x1f4){logger[_0x1bee('0x14')](_0x1bee('0x16'),_0x300bc9,_0x174827[_0x1bee('0x14')]['message']);return _0x40d3e3(_0x174827[_0x1bee('0x14')]['message']);}logger[_0x1bee('0x14')](_0x1bee('0x16'),_0x300bc9,_0x174827[_0x1bee('0x14')][_0x1bee('0x17')]);return _0x36af1a(_0x174827[_0x1bee('0x14')][_0x1bee('0x17')]);}else{logger[_0x1bee('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x300bc9,_0x1bee('0x12'));_0x36af1a(_0x174827[_0x1bee('0x18')][_0x1bee('0x17')]);}})[_0x1bee('0x19')](function(_0x251915){logger[_0x1bee('0x14')](_0x1bee('0x16'),_0x300bc9,_0x251915);_0x40d3e3(_0x251915);});});}exports['UpdateChatInteraction']=function(_0x62b38f){var _0x4ce3ac=this;return new Promise(function(_0x4e6a83,_0x1ba045){return db['ChatInteraction'][_0x1bee('0x1a')](_0x62b38f[_0x1bee('0x1b')],{'raw':_0x62b38f['options']?_0x62b38f[_0x1bee('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62b38f[_0x1bee('0x1c')]?_0x62b38f['options']['where']||null:null,'attributes':_0x62b38f[_0x1bee('0x1c')]?_0x62b38f[_0x1bee('0x1c')][_0x1bee('0x1d')]||null:null,'limit':_0x62b38f[_0x1bee('0x1c')]?_0x62b38f[_0x1bee('0x1c')][_0x1bee('0x1e')]||null:null})[_0x1bee('0xf')](function(_0x1104b6){logger[_0x1bee('0x10')](_0x1bee('0x1f'),_0x62b38f);logger[_0x1bee('0x11')](_0x1bee('0x1f'),_0x62b38f,JSON['stringify'](_0x1104b6));_0x4e6a83(_0x1104b6);})['catch'](function(_0x1e98da){logger[_0x1bee('0x14')](_0x1bee('0x1f'),_0x1e98da[_0x1bee('0x17')],_0x62b38f);_0x1ba045(_0x4ce3ac[_0x1bee('0x14')](0x1f4,_0x1e98da[_0x1bee('0x17')]));});});};exports[_0x1bee('0x20')]=function(_0xccc061){return new Promise(function(_0x2f6892,_0x1cea2f){return db['ChatInteraction'][_0x1bee('0x21')]({'where':_0xccc061['options']?_0xccc061[_0x1bee('0x1c')][_0x1bee('0x22')]||null:null})[_0x1bee('0xf')](function(_0x34363f){if(_0x34363f){return _0x34363f[_0x1bee('0x23')](_0xccc061[_0x1bee('0x1b')][_0x1bee('0x24')],_[_0x1bee('0x25')](_0xccc061[_0x1bee('0x1b')],[_0x1bee('0x24'),'id'])||{});}})[_0x1bee('0x26')](function(_0x151a35){logger[_0x1bee('0x10')](_0x1bee('0x27'),_0xccc061);logger[_0x1bee('0x11')](_0x1bee('0x27'),_0xccc061,JSON['stringify'](_0x151a35));_0x2f6892(_0x151a35);})[_0x1bee('0x19')](function(_0x384de8){logger['error']('AddTags',_0x384de8[_0x1bee('0x17')],_0xccc061);_0x1cea2f(_this[_0x1bee('0x14')](0x1f4,_0x384de8['message']));});});}; \ No newline at end of file +var _0x6246=['redis','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatInteraction','update','body','options','raw','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','where','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6246,0x154));var _0x6624=function(_0x2242bf,_0x23b98d){_0x2242bf=_0x2242bf-0x0;var _0x2dc874=_0x6246[_0x2242bf];return _0x2dc874;};'use strict';var _=require(_0x6624('0x0'));var util=require('util');var moment=require(_0x6624('0x1'));var BPromise=require(_0x6624('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6624('0x3'));var db=require(_0x6624('0x4'))['db'];var utils=require(_0x6624('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6624('0x6'));var jayson=require(_0x6624('0x7'));var client=jayson[_0x6624('0x8')][_0x6624('0x9')]({'port':0x232a});config['redis']=_[_0x6624('0xa')](config[_0x6624('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6624('0xc'))(new Redis(config[_0x6624('0xb')]));require('./chatInteraction.socket')[_0x6624('0xd')](socket);function respondWithRpcPromise(_0x4f2add,_0x330dcd,_0x4bdf43){return new BPromise(function(_0x5820e7,_0x56e625){return client['request'](_0x4f2add,_0x4bdf43)[_0x6624('0xe')](function(_0x4a04bb){logger[_0x6624('0xf')](_0x6624('0x10'),_0x330dcd,_0x6624('0x11'));logger[_0x6624('0x12')](_0x6624('0x13'),_0x330dcd,_0x6624('0x11'),JSON['stringify'](_0x4a04bb));if(_0x4a04bb[_0x6624('0x14')]){if(_0x4a04bb[_0x6624('0x14')]['code']===0x1f4){logger[_0x6624('0x14')](_0x6624('0x10'),_0x330dcd,_0x4a04bb[_0x6624('0x14')][_0x6624('0x15')]);return _0x56e625(_0x4a04bb[_0x6624('0x14')][_0x6624('0x15')]);}logger[_0x6624('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x330dcd,_0x4a04bb[_0x6624('0x14')][_0x6624('0x15')]);return _0x5820e7(_0x4a04bb[_0x6624('0x14')][_0x6624('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x330dcd,_0x6624('0x11'));_0x5820e7(_0x4a04bb[_0x6624('0x16')][_0x6624('0x15')]);}})[_0x6624('0x17')](function(_0x34c080){logger[_0x6624('0x14')](_0x6624('0x10'),_0x330dcd,_0x34c080);_0x56e625(_0x34c080);});});}exports['UpdateChatInteraction']=function(_0x229839){var _0x54caae=this;return new Promise(function(_0x51a9cf,_0x4c70ee){return db[_0x6624('0x18')][_0x6624('0x19')](_0x229839[_0x6624('0x1a')],{'raw':_0x229839[_0x6624('0x1b')]?_0x229839['options'][_0x6624('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x229839[_0x6624('0x1b')]?_0x229839['options']['where']||null:null,'attributes':_0x229839['options']?_0x229839[_0x6624('0x1b')][_0x6624('0x1d')]||null:null,'limit':_0x229839[_0x6624('0x1b')]?_0x229839[_0x6624('0x1b')]['limit']||null:null})[_0x6624('0xe')](function(_0xc1b225){logger[_0x6624('0xf')](_0x6624('0x1e'),_0x229839);logger['debug'](_0x6624('0x1e'),_0x229839,JSON[_0x6624('0x1f')](_0xc1b225));_0x51a9cf(_0xc1b225);})[_0x6624('0x17')](function(_0x433e1a){logger['error']('UpdateChatInteraction',_0x433e1a[_0x6624('0x15')],_0x229839);_0x4c70ee(_0x54caae[_0x6624('0x14')](0x1f4,_0x433e1a[_0x6624('0x15')]));});});};exports[_0x6624('0x20')]=function(_0x170001){return new Promise(function(_0x1b60f4,_0x55c9fa){return db[_0x6624('0x18')][_0x6624('0x21')]({'where':_0x170001['options']?_0x170001['options'][_0x6624('0x22')]||null:null})[_0x6624('0xe')](function(_0x5cff5e){if(_0x5cff5e){return _0x5cff5e['addTags'](_0x170001[_0x6624('0x1a')][_0x6624('0x23')],_[_0x6624('0x24')](_0x170001[_0x6624('0x1a')],['ids','id'])||{});}})[_0x6624('0x25')](function(_0x527f69){logger[_0x6624('0xf')](_0x6624('0x26'),_0x170001);logger[_0x6624('0x12')]('AddTags',_0x170001,JSON[_0x6624('0x1f')](_0x527f69));_0x1b60f4(_0x527f69);})[_0x6624('0x17')](function(_0x59e3a1){logger[_0x6624('0x14')](_0x6624('0x26'),_0x59e3a1[_0x6624('0x15')],_0x170001);_0x55c9fa(_this[_0x6624('0x14')](0x1f4,_0x59e3a1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c043d21..8759d55 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 _0x8c63=['./chatInteraction.events','save','remove','update','emit','register','length','chatInteraction:'];(function(_0x874f81,_0xe20ffd){var _0x2ea7ba=function(_0xb88898){while(--_0xb88898){_0x874f81['push'](_0x874f81['shift']());}};_0x2ea7ba(++_0xe20ffd);}(_0x8c63,0x180));var _0x38c6=function(_0x25737e,_0x49c8ab){_0x25737e=_0x25737e-0x0;var _0x51b928=_0x8c63[_0x25737e];return _0x51b928;};'use strict';var ChatInteractionEvents=require(_0x38c6('0x0'));var events=[_0x38c6('0x1'),_0x38c6('0x2'),_0x38c6('0x3')];function createListener(_0x59347a,_0x68c329){return function(_0x5d0d78){_0x68c329[_0x38c6('0x4')](_0x59347a,_0x5d0d78);};}function removeListener(_0x40815d,_0x34a1b2){return function(){ChatInteractionEvents['removeListener'](_0x40815d,_0x34a1b2);};}exports[_0x38c6('0x5')]=function(_0xfa640a){for(var _0x2b9ad3=0x0,_0x33fea8=events[_0x38c6('0x6')];_0x2b9ad3<_0x33fea8;_0x2b9ad3++){var _0x17d430=events[_0x2b9ad3];var _0x5208df=createListener(_0x38c6('0x7')+_0x17d430,_0xfa640a);ChatInteractionEvents['on'](_0x17d430,_0x5208df);}}; \ No newline at end of file +var _0xdeb7=['remove','update','removeListener','register','length'];(function(_0x3b45a2,_0x1e63e6){var _0x4efc4d=function(_0x4a721d){while(--_0x4a721d){_0x3b45a2['push'](_0x3b45a2['shift']());}};_0x4efc4d(++_0x1e63e6);}(_0xdeb7,0x82));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x7deb('0x0'),_0x7deb('0x1')];function createListener(_0x1c4802,_0x4f1f20){return function(_0x2b2505){_0x4f1f20['emit'](_0x1c4802,_0x2b2505);};}function removeListener(_0x286855,_0x417c3c){return function(){ChatInteractionEvents[_0x7deb('0x2')](_0x286855,_0x417c3c);};}exports[_0x7deb('0x3')]=function(_0x15bb09){for(var _0x5ec230=0x0,_0x24a053=events[_0x7deb('0x4')];_0x5ec230<_0x24a053;_0x5ec230++){var _0x569f16=events[_0x5ec230];var _0xba3484=createListener('chatInteraction:'+_0x569f16,_0x15bb09);ChatInteractionEvents['on'](_0x569f16,_0xba3484);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 399c94a..bfe2d8a 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 _0x83e1=['chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','Router','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','/:id','isChatInteractionAuthorized','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','/:id/tags'];(function(_0x2eb15c,_0x21c769){var _0x523ed4=function(_0x1e816b){while(--_0x1e816b){_0x2eb15c['push'](_0x2eb15c['shift']());}};_0x523ed4(++_0x21c769);}(_0x83e1,0x1ad));var _0x183e=function(_0x34f7c2,_0x264892){_0x34f7c2=_0x34f7c2-0x0;var _0x206ea2=_0x83e1[_0x34f7c2];return _0x206ea2;};'use strict';var multer=require(_0x183e('0x0'));var util=require(_0x183e('0x1'));var path=require('path');var timeout=require(_0x183e('0x2'));var express=require('express');var router=express[_0x183e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x183e('0x4'));var controller=require(_0x183e('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x183e('0x6')](_0x183e('0x7'),auth[_0x183e('0x8')](),controller['describe']);router[_0x183e('0x6')](_0x183e('0x9'),auth[_0x183e('0xa')](),controller['show']);router[_0x183e('0x6')](_0x183e('0xb'),auth[_0x183e('0xa')](),controller['attachmentDownload']);router[_0x183e('0x6')]('/:id/messages',auth[_0x183e('0x8')](),controller[_0x183e('0xc')]);router[_0x183e('0x6')](_0x183e('0xd'),auth[_0x183e('0xa')](),controller[_0x183e('0xe')]);router[_0x183e('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x183e('0xf')]('/',auth[_0x183e('0x8')](),controller[_0x183e('0x10')]);router['post'](_0x183e('0x11'),auth[_0x183e('0x8')](),controller[_0x183e('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8f4af8,_0x35badd,_0x3faadf){_0x3faadf(null,path[_0x183e('0x13')](config[_0x183e('0x14')],_0x183e('0x15')));},'filename':function(_0x42fdf0,_0x271d11,_0x56df78){_0x56df78(null,util[_0x183e('0x16')](_0x183e('0x17'),Date[_0x183e('0x18')](),_0x271d11[_0x183e('0x19')][_0x183e('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x183e('0xf')]('/:id/attachment_upload',upload[_0x183e('0x1b')](_0x183e('0x1c')),controller[_0x183e('0x1d')]);router[_0x183e('0xf')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x183e('0x1e'),auth['isAuthenticated'](),interaction['tracked'](_0x183e('0x1f'),_0x183e('0x20')),controller[_0x183e('0x21')]);router[_0x183e('0x22')](_0x183e('0x9'),auth['isAuthenticated'](),interaction[_0x183e('0x23')]('chat',_0x183e('0x24')),controller[_0x183e('0x25')]);router[_0x183e('0x22')](_0x183e('0x26'),controller['customUpdate']);router['put'](_0x183e('0x27'),auth[_0x183e('0xa')](),controller['abandon']);router['put'](_0x183e('0x28'),controller[_0x183e('0x29')]);router[_0x183e('0x2a')]('/:id',auth[_0x183e('0x8')](),interaction[_0x183e('0x23')](_0x183e('0x1f'),_0x183e('0x2b')),controller[_0x183e('0x2c')]);router[_0x183e('0x2a')](_0x183e('0x1e'),auth[_0x183e('0x8')](),controller['removeTags']);module[_0x183e('0x2d')]=router; \ No newline at end of file +var _0x8ba6=['isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','/:id','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x9b2fb1,_0x746c6c){var _0x407f07=function(_0x5e467b){while(--_0x5e467b){_0x9b2fb1['push'](_0x9b2fb1['shift']());}};_0x407f07(++_0x746c6c);}(_0x8ba6,0x11b));var _0x68ba=function(_0x462616,_0x5a325d){_0x462616=_0x462616-0x0;var _0x16eea7=_0x8ba6[_0x462616];return _0x16eea7;};'use strict';var multer=require(_0x68ba('0x0'));var util=require('util');var path=require(_0x68ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x68ba('0x2'));var router=express[_0x68ba('0x3')]();var auth=require(_0x68ba('0x4'));var interaction=require(_0x68ba('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x68ba('0x6')]('/',auth[_0x68ba('0x7')](),controller[_0x68ba('0x8')]);router[_0x68ba('0x6')](_0x68ba('0x9'),auth[_0x68ba('0x7')](),controller[_0x68ba('0xa')]);router[_0x68ba('0x6')]('/:id',auth[_0x68ba('0xb')](),controller[_0x68ba('0xc')]);router[_0x68ba('0x6')](_0x68ba('0xd'),auth[_0x68ba('0xb')](),controller[_0x68ba('0xe')]);router[_0x68ba('0x6')](_0x68ba('0xf'),auth[_0x68ba('0x7')](),controller[_0x68ba('0x10')]);router['get'](_0x68ba('0x11'),auth[_0x68ba('0xb')](),controller['getMyMessages']);router['get'](_0x68ba('0x12'),auth['isAuthenticated'](),controller[_0x68ba('0x13')]);router[_0x68ba('0x14')]('/',auth[_0x68ba('0x7')](),controller[_0x68ba('0x15')]);router[_0x68ba('0x14')](_0x68ba('0x16'),auth[_0x68ba('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x68ba('0x17')]({'destination':function(_0x1a17c2,_0x1ce168,_0x438dcc){_0x438dcc(null,path[_0x68ba('0x18')](config['root'],_0x68ba('0x19')));},'filename':function(_0x22bcda,_0x48d8e2,_0x575e36){_0x575e36(null,util[_0x68ba('0x1a')](_0x68ba('0x1b'),Date[_0x68ba('0x1c')](),_0x48d8e2[_0x68ba('0x1d')][_0x68ba('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68ba('0x14')](_0x68ba('0x1f'),upload[_0x68ba('0x20')](_0x68ba('0x21')),controller[_0x68ba('0x22')]);router[_0x68ba('0x14')](_0x68ba('0xf'),auth[_0x68ba('0xb')](),controller['addMessage']);router['post'](_0x68ba('0x23'),auth['isAuthenticated'](),interaction[_0x68ba('0x24')](_0x68ba('0x25'),_0x68ba('0x26')),controller['addTags']);router['put'](_0x68ba('0x27'),auth[_0x68ba('0x7')](),interaction[_0x68ba('0x24')](_0x68ba('0x25'),'chatinteraction:update'),controller['update']);router[_0x68ba('0x28')](_0x68ba('0x29'),controller[_0x68ba('0x2a')]);router['put'](_0x68ba('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x68ba('0x2c')]);router[_0x68ba('0x28')](_0x68ba('0x2d'),controller['close']);router[_0x68ba('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0x68ba('0x24')]('chat',_0x68ba('0x2f')),controller['destroy']);router[_0x68ba('0x2e')](_0x68ba('0x23'),auth['isAuthenticated'](),controller[_0x68ba('0x30')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d1842ca..d8378ca 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 _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0xe72721,_0x1307f8){var _0x3b15c0=function(_0x31c3c4){while(--_0x31c3c4){_0xe72721['push'](_0xe72721['shift']());}};_0x3b15c0(++_0x1307f8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}}; \ No newline at end of file +var _0x4975=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4975,0x86));var _0x5497=function(_0x36023e,_0x46c0c6){_0x36023e=_0x36023e-0x0;var _0x19baaf=_0x4975[_0x36023e];return _0x19baaf;};'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 43b6814..ed6e060 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 _0xa732=['body','describe','get','messages','lastMessage','lastMessageAt','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Agents','userProfileId','filter','resourceId','push','createdAt','FromId','-createdAt','all','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','count','offset','limit','set','apply','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create'];(function(_0x559b4f,_0x40492e){var _0xc7d95c=function(_0x3775fb){while(--_0x3775fb){_0x559b4f['push'](_0x559b4f['shift']());}};_0xc7d95c(++_0x40492e);}(_0xa732,0x87));var _0x2a73=function(_0x4f65d8,_0x905afa){_0x4f65d8=_0x4f65d8-0x0;var _0x3222bc=_0xa732[_0x4f65d8];return _0x3222bc;};'use strict';var pdf=require(_0x2a73('0x0'));var emlformat=require(_0x2a73('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2a73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a73('0x3'));var moment=require(_0x2a73('0x4'));var BPromise=require(_0x2a73('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2a73('0x6'));var csv=require(_0x2a73('0x7'));var ejs=require(_0x2a73('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a73('0x9'));var crypto=require(_0x2a73('0xa'));var jsforce=require(_0x2a73('0xb'));var deskjs=require(_0x2a73('0xc'));var toCsv=require(_0x2a73('0x7'));var querystring=require(_0x2a73('0xd'));var Papa=require(_0x2a73('0xe'));var Redis=require(_0x2a73('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a73('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a73('0x11'))(_0x2a73('0x12'));var utils=require(_0x2a73('0x13'));var config=require(_0x2a73('0x14'));var db=require(_0x2a73('0x15'))['db'];config[_0x2a73('0x16')]=_[_0x2a73('0x17')](config[_0x2a73('0x16')],{'host':_0x2a73('0x18'),'port':0x18eb});var socket=require(_0x2a73('0x19'))(new Redis(config[_0x2a73('0x16')]));require(_0x2a73('0x1a'))[_0x2a73('0x1b')](socket);function respondWithStatusCode(_0x4597a1,_0x299f80){_0x299f80=_0x299f80||0xcc;return function(_0x1c0942){if(_0x1c0942){return _0x4597a1['sendStatus'](_0x299f80);}return _0x4597a1[_0x2a73('0x1c')](_0x299f80)[_0x2a73('0x1d')]();};}function respondWithResult(_0x42034e,_0x2b8471){_0x2b8471=_0x2b8471||0xc8;return function(_0x547af3){if(_0x547af3){return _0x42034e['status'](_0x2b8471)[_0x2a73('0x1e')](_0x547af3);}};}function respondWithFilteredResult(_0x171a61,_0x1ff028){return function(_0x2003d5){if(_0x2003d5){var _0x589aa8=_0x2003d5[_0x2a73('0x1f')],_0x158fcb=_0x1ff028[_0x2a73('0x20')],_0x271fd1=_0x1ff028[_0x2a73('0x20')]+_0x1ff028[_0x2a73('0x21')],_0x2f934b;if(_0x271fd1>=_0x589aa8){_0x271fd1=_0x589aa8;_0x2f934b=0xc8;}else{_0x2f934b=0xce;}_0x171a61[_0x2a73('0x1c')](_0x2f934b);return _0x171a61[_0x2a73('0x22')]('Content-Range',_0x158fcb+'-'+_0x271fd1+'/'+_0x589aa8)['json'](_0x2003d5);}return null;};}function patchUpdates(_0x1625d9){return function(_0x51af1b){try{jsonpatch[_0x2a73('0x23')](_0x51af1b,_0x1625d9,!![]);}catch(_0x6783d3){return BPromise['reject'](_0x6783d3);}return _0x51af1b['save']();};}function saveUpdates(_0x2fce93,_0x36bf6f){return function(_0x4e79e5){if(_0x4e79e5){return _0x4e79e5['update'](_0x2fce93)[_0x2a73('0x24')](function(_0x409c1d){return _0x409c1d;});}return null;};}function removeEntity(_0x14eed7,_0x1522ac){return function(_0x14fb4b){if(_0x14fb4b){return _0x14fb4b['destroy']()['then'](function(){_0x14eed7[_0x2a73('0x1c')](0xcc)[_0x2a73('0x1d')]();});}};}function handleEntityNotFound(_0x51ebfb,_0xf177d7){return function(_0xb08de5){if(!_0xb08de5){_0x51ebfb[_0x2a73('0x25')](0x194);}return _0xb08de5;};}function handleError(_0x2a0cf0,_0x1ede7e){_0x1ede7e=_0x1ede7e||0x1f4;return function(_0x39da28){logger[_0x2a73('0x26')](_0x39da28[_0x2a73('0x27')]);if(_0x39da28[_0x2a73('0x28')]){delete _0x39da28[_0x2a73('0x28')];}_0x2a0cf0[_0x2a73('0x1c')](_0x1ede7e)[_0x2a73('0x29')](_0x39da28);};}exports[_0x2a73('0x2a')]=function(_0x1e2379,_0x451509){var _0x66a5a2={},_0xf64208={},_0x4ef9af={'count':0x0,'rows':[]};var _0x584fcd=_[_0x2a73('0x2b')](db[_0x2a73('0x2c')][_0x2a73('0x2d')],function(_0x4ae40e){return{'name':_0x4ae40e[_0x2a73('0x2e')],'type':_0x4ae40e[_0x2a73('0x2f')][_0x2a73('0x30')]};});_0xf64208[_0x2a73('0x31')]=_[_0x2a73('0x2b')](_0x584fcd,_0x2a73('0x28'));_0xf64208['query']=_[_0x2a73('0x32')](_0x1e2379[_0x2a73('0x33')]);_0xf64208[_0x2a73('0x34')]=_[_0x2a73('0x35')](_0xf64208[_0x2a73('0x31')],_0xf64208[_0x2a73('0x33')]);_0x66a5a2[_0x2a73('0x36')]=_[_0x2a73('0x35')](_0xf64208[_0x2a73('0x31')],qs['fields'](_0x1e2379[_0x2a73('0x33')][_0x2a73('0x37')]));_0x66a5a2[_0x2a73('0x36')]=_0x66a5a2[_0x2a73('0x36')][_0x2a73('0x38')]?_0x66a5a2[_0x2a73('0x36')]:_0xf64208[_0x2a73('0x31')];if(!_0x1e2379['query']['hasOwnProperty']('nolimit')){_0x66a5a2[_0x2a73('0x21')]=qs['limit'](_0x1e2379['query'][_0x2a73('0x21')]);_0x66a5a2[_0x2a73('0x20')]=qs[_0x2a73('0x20')](_0x1e2379[_0x2a73('0x33')][_0x2a73('0x20')]);}_0x66a5a2['order']=qs[_0x2a73('0x39')](_0x1e2379[_0x2a73('0x33')]['sort']);_0x66a5a2[_0x2a73('0x3a')]=qs[_0x2a73('0x34')](_[_0x2a73('0x3b')](_0x1e2379[_0x2a73('0x33')],_0xf64208[_0x2a73('0x34')]),_0x584fcd);if(_0x1e2379[_0x2a73('0x33')]['filter']){_0x66a5a2[_0x2a73('0x3a')]=_[_0x2a73('0x3c')](_0x66a5a2[_0x2a73('0x3a')],{'$or':_['map'](_0x584fcd,function(_0x359434){if(_0x359434[_0x2a73('0x2f')]!==_0x2a73('0x3d')){var _0x1a8a4e={};_0x1a8a4e[_0x359434[_0x2a73('0x28')]]={'$like':'%'+_0x1e2379[_0x2a73('0x33')]['filter']+'%'};return _0x1a8a4e;}})});}_0x66a5a2=_[_0x2a73('0x3c')]({},_0x66a5a2,_0x1e2379[_0x2a73('0x3e')]);var _0x350422={'where':_0x66a5a2[_0x2a73('0x3a')]};return db[_0x2a73('0x2c')][_0x2a73('0x1f')](_0x350422)[_0x2a73('0x24')](function(_0x3edc1d){_0x4ef9af[_0x2a73('0x1f')]=_0x3edc1d;if(_0x1e2379[_0x2a73('0x33')][_0x2a73('0x3f')]){_0x66a5a2[_0x2a73('0x40')]=[{'all':!![]}];}return db[_0x2a73('0x2c')][_0x2a73('0x41')](_0x66a5a2);})[_0x2a73('0x24')](function(_0x46b9e4){_0x4ef9af[_0x2a73('0x42')]=_0x46b9e4;return _0x4ef9af;})[_0x2a73('0x24')](respondWithFilteredResult(_0x451509,_0x66a5a2))[_0x2a73('0x43')](handleError(_0x451509,null));};exports[_0x2a73('0x44')]=function(_0x526f1a,_0x543b77){var _0x309bcf={'raw':!![],'where':{'id':_0x526f1a[_0x2a73('0x45')]['id']}},_0x33af12={};_0x33af12['model']=_[_0x2a73('0x32')](db[_0x2a73('0x2c')]['rawAttributes']);_0x33af12[_0x2a73('0x33')]=_[_0x2a73('0x32')](_0x526f1a[_0x2a73('0x33')]);_0x33af12[_0x2a73('0x34')]=_[_0x2a73('0x35')](_0x33af12[_0x2a73('0x31')],_0x33af12[_0x2a73('0x33')]);_0x309bcf[_0x2a73('0x36')]=_['intersection'](_0x33af12[_0x2a73('0x31')],qs[_0x2a73('0x37')](_0x526f1a[_0x2a73('0x33')][_0x2a73('0x37')]));_0x309bcf[_0x2a73('0x36')]=_0x309bcf[_0x2a73('0x36')][_0x2a73('0x38')]?_0x309bcf[_0x2a73('0x36')]:_0x33af12[_0x2a73('0x31')];if(_0x526f1a[_0x2a73('0x33')][_0x2a73('0x3f')]){_0x309bcf[_0x2a73('0x40')]=[{'all':!![]}];}_0x309bcf=_[_0x2a73('0x3c')]({},_0x309bcf,_0x526f1a[_0x2a73('0x3e')]);return db[_0x2a73('0x2c')]['find'](_0x309bcf)[_0x2a73('0x24')](handleEntityNotFound(_0x543b77,null))['then'](respondWithResult(_0x543b77,null))[_0x2a73('0x43')](handleError(_0x543b77,null));};exports[_0x2a73('0x46')]=function(_0x1e7f92,_0x48a7f9){return db['ChatInternalMessage'][_0x2a73('0x46')](_0x1e7f92[_0x2a73('0x47')],{})[_0x2a73('0x24')](respondWithResult(_0x48a7f9,0xc9))[_0x2a73('0x43')](handleError(_0x48a7f9,null));};exports['update']=function(_0x52c10d,_0x628de0){if(_0x52c10d[_0x2a73('0x47')]['id']){delete _0x52c10d[_0x2a73('0x47')]['id'];}return db[_0x2a73('0x2c')]['find']({'where':{'id':_0x52c10d['params']['id']}})[_0x2a73('0x24')](handleEntityNotFound(_0x628de0,null))[_0x2a73('0x24')](saveUpdates(_0x52c10d[_0x2a73('0x47')],null))[_0x2a73('0x24')](respondWithResult(_0x628de0,null))['catch'](handleError(_0x628de0,null));};exports['destroy']=function(_0x3d209a,_0x2ff0d2){return db[_0x2a73('0x2c')]['find']({'where':{'id':_0x3d209a[_0x2a73('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ff0d2,null))[_0x2a73('0x24')](removeEntity(_0x2ff0d2,null))[_0x2a73('0x43')](handleError(_0x2ff0d2,null));};exports[_0x2a73('0x48')]=function(_0x58cec9,_0x1bfcf9){return db[_0x2a73('0x2c')][_0x2a73('0x48')]()[_0x2a73('0x24')](respondWithResult(_0x1bfcf9,null))[_0x2a73('0x43')](handleError(_0x1bfcf9,null));};function wrapUser(_0x124680){return function(_0x14ae4c){var _0x805175=_0x124680[_0x2a73('0x49')]({'plain':!![]});_0x805175[_0x2a73('0x4a')]=[];if(_0x14ae4c){_0x805175['lastMessageAt']=_0x14ae4c['createdAt'];_0x805175[_0x2a73('0x4b')]=_0x14ae4c;}else{_0x805175[_0x2a73('0x4c')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x805175['lastMessage']={};}return _0x805175;};}exports[_0x2a73('0x4d')]=function(_0x4949ab,_0x5ea110,_0x126d4b){var _0x5dd098=[];return db[_0x2a73('0x4e')][_0x2a73('0x41')]({'where':{'role':[_0x2a73('0x4f'),_0x2a73('0x50'),_0x2a73('0x51')]},'attributes':['id',_0x2a73('0x52'),'name',_0x2a73('0x53'),_0x2a73('0x54'),'internal',_0x2a73('0x55'),_0x2a73('0x56'),_0x2a73('0x57'),_0x2a73('0x58')],'order':qs[_0x2a73('0x39')](_0x2a73('0x59')),'include':[{'model':db['VoiceQueue'],'as':_0x2a73('0x5a'),'attributes':['id',_0x2a73('0x28'),_0x2a73('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0xe45bc7){if(_0xe45bc7){var _0x4fd0c5=_0x4949ab[_0x2a73('0x51')]['get']({'plain':!![]});if(!_0x4fd0c5)throw new Error(_0x2a73('0x5b'));if(_0x4fd0c5[_0x2a73('0x53')]===_0x2a73('0x51')){return db[_0x2a73('0x5c')][_0x2a73('0x5d')]({'where':{'name':_0x2a73('0x5e'),'userProfileId':_0x4fd0c5[_0x2a73('0x5f')]},'raw':!![]})[_0x2a73('0x24')](function(_0x2801c2){if(_0x2801c2){if(_0x2801c2['autoAssociation']===0x0){return db['UserProfileResource'][_0x2a73('0x41')]({'where':{'sectionId':_0x2801c2['id']},'raw':!![]})[_0x2a73('0x24')](function(_0xbd7b45){var _0x236f20=[];if(_['isEmpty'](_0xbd7b45)){_0x236f20=_[_0x2a73('0x60')](_0xe45bc7,function(_0x5368e3){if(_0x5368e3[_0x2a73('0x53')]!==_0x2a73('0x4f')){return _0x5368e3;}});return _0x236f20;}else{for(var _0x4e8738=0x0;_0x4e8738<_0xe45bc7[_0x2a73('0x38')];_0x4e8738++){var _0x4f7f1f=_0xe45bc7[_0x4e8738];if(_0x4f7f1f['role']==='agent'){var _0x517d6f=_[_0x2a73('0x5d')](_0xbd7b45,function(_0x285888){return _0x285888[_0x2a73('0x61')]===_0x4f7f1f['id'];});if(_0x517d6f)_0x236f20[_0x2a73('0x62')](_0x4f7f1f);}else{_0x236f20[_0x2a73('0x62')](_0x4f7f1f);}}return _0x236f20;}});}else{return _0xe45bc7;}}else{var _0x572db1=_[_0x2a73('0x60')](_0xe45bc7,function(_0x37a17e){if(_0x37a17e[_0x2a73('0x53')]!==_0x2a73('0x4f')){return _0x37a17e;}});return _0x572db1;}});}else{return _0xe45bc7;}}})[_0x2a73('0x24')](function(_0x369573){var _0x40db55=[];if(_0x369573){_0x5dd098=_0x369573;for(var _0x1bbf22=0x0;_0x1bbf22<_0x369573[_0x2a73('0x38')];_0x1bbf22+=0x1){_0x5dd098[_0x1bbf22][_0x2a73('0x4a')]=[];_0x40db55['push'](db[_0x2a73('0x2c')][_0x2a73('0x5d')]({'where':{'FromId':[_0x4949ab[_0x2a73('0x51')]['id'],_0x369573[_0x1bbf22]['id']],'ToId':[_0x4949ab[_0x2a73('0x51')]['id'],_0x369573[_0x1bbf22]['id']],'ChatGroupId':null},'attributes':['id',_0x2a73('0x63'),_0x2a73('0x64'),'ToId','read','body'],'order':qs['sort'](_0x2a73('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2a73('0x24')](wrapUser(_0x369573[_0x1bbf22])));}return BPromise[_0x2a73('0x66')](_0x40db55);}return[];})[_0x2a73('0x24')](function(_0x37a60d){return{'rows':_0x37a60d,'count':_0x37a60d['length']};})['then'](respondWithResult(_0x5ea110,null))['catch'](handleError(_0x5ea110,null));}; \ No newline at end of file +var _0x7cbb=['UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','-createdAt','all','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','find','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x25bf54,_0x14cb7d){var _0x575858=function(_0x296fcf){while(--_0x296fcf){_0x25bf54['push'](_0x25bf54['shift']());}};_0x575858(++_0x14cb7d);}(_0x7cbb,0x1bd));var _0xb7cb=function(_0x3a892e,_0x3b89fd){_0x3a892e=_0x3a892e-0x0;var _0x53d557=_0x7cbb[_0x3a892e];return _0x53d557;};'use strict';var pdf=require(_0xb7cb('0x0'));var emlformat=require(_0xb7cb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb7cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7cb('0x3'));var moment=require(_0xb7cb('0x4'));var BPromise=require(_0xb7cb('0x5'));var Mustache=require(_0xb7cb('0x6'));var util=require(_0xb7cb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb7cb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7cb('0x9'));var squel=require(_0xb7cb('0xa'));var crypto=require(_0xb7cb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb7cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb7cb('0xd'));var Papa=require(_0xb7cb('0xe'));var Redis=require(_0xb7cb('0xf'));var authService=require(_0xb7cb('0x10'));var qs=require(_0xb7cb('0x11'));var as=require(_0xb7cb('0x12'));var hardwareService=require(_0xb7cb('0x13'));var logger=require(_0xb7cb('0x14'))(_0xb7cb('0x15'));var utils=require(_0xb7cb('0x16'));var config=require(_0xb7cb('0x17'));var db=require(_0xb7cb('0x18'))['db'];config[_0xb7cb('0x19')]=_[_0xb7cb('0x1a')](config[_0xb7cb('0x19')],{'host':_0xb7cb('0x1b'),'port':0x18eb});var socket=require(_0xb7cb('0x1c'))(new Redis(config[_0xb7cb('0x19')]));require(_0xb7cb('0x1d'))[_0xb7cb('0x1e')](socket);function respondWithStatusCode(_0x33457e,_0x1855f0){_0x1855f0=_0x1855f0||0xcc;return function(_0xec344a){if(_0xec344a){return _0x33457e[_0xb7cb('0x1f')](_0x1855f0);}return _0x33457e[_0xb7cb('0x20')](_0x1855f0)[_0xb7cb('0x21')]();};}function respondWithResult(_0x11fd63,_0x416369){_0x416369=_0x416369||0xc8;return function(_0xcdb288){if(_0xcdb288){return _0x11fd63[_0xb7cb('0x20')](_0x416369)[_0xb7cb('0x22')](_0xcdb288);}};}function respondWithFilteredResult(_0x1e2021,_0x4ba232){return function(_0x5880d9){if(_0x5880d9){var _0x3cde6c=_0x5880d9[_0xb7cb('0x23')],_0x7ae34=_0x4ba232[_0xb7cb('0x24')],_0x47f370=_0x4ba232[_0xb7cb('0x24')]+_0x4ba232[_0xb7cb('0x25')],_0x27da33;if(_0x47f370>=_0x3cde6c){_0x47f370=_0x3cde6c;_0x27da33=0xc8;}else{_0x27da33=0xce;}_0x1e2021['status'](_0x27da33);return _0x1e2021['set'](_0xb7cb('0x26'),_0x7ae34+'-'+_0x47f370+'/'+_0x3cde6c)[_0xb7cb('0x22')](_0x5880d9);}return null;};}function patchUpdates(_0x5bbb1f){return function(_0xae055){try{jsonpatch[_0xb7cb('0x27')](_0xae055,_0x5bbb1f,!![]);}catch(_0x17a816){return BPromise[_0xb7cb('0x28')](_0x17a816);}return _0xae055[_0xb7cb('0x29')]();};}function saveUpdates(_0x61822e,_0x270439){return function(_0xb86722){if(_0xb86722){return _0xb86722['update'](_0x61822e)[_0xb7cb('0x2a')](function(_0x36725a){return _0x36725a;});}return null;};}function removeEntity(_0xf9e7a5,_0x3b28ef){return function(_0x214b13){if(_0x214b13){return _0x214b13['destroy']()[_0xb7cb('0x2a')](function(){_0xf9e7a5[_0xb7cb('0x20')](0xcc)[_0xb7cb('0x21')]();});}};}function handleEntityNotFound(_0x333160,_0x550584){return function(_0x3f89d7){if(!_0x3f89d7){_0x333160[_0xb7cb('0x1f')](0x194);}return _0x3f89d7;};}function handleError(_0x2f2a08,_0x4288ba){_0x4288ba=_0x4288ba||0x1f4;return function(_0x2c1f48){logger[_0xb7cb('0x2b')](_0x2c1f48[_0xb7cb('0x2c')]);if(_0x2c1f48[_0xb7cb('0x2d')]){delete _0x2c1f48[_0xb7cb('0x2d')];}_0x2f2a08['status'](_0x4288ba)[_0xb7cb('0x2e')](_0x2c1f48);};}exports[_0xb7cb('0x2f')]=function(_0x584a9b,_0x1ff8d5){var _0x17a5de={},_0x528408={},_0x232c6c={'count':0x0,'rows':[]};var _0x38712a=_[_0xb7cb('0x30')](db[_0xb7cb('0x31')][_0xb7cb('0x32')],function(_0xdafbb1){return{'name':_0xdafbb1[_0xb7cb('0x33')],'type':_0xdafbb1[_0xb7cb('0x34')]['key']};});_0x528408[_0xb7cb('0x35')]=_[_0xb7cb('0x30')](_0x38712a,_0xb7cb('0x2d'));_0x528408['query']=_[_0xb7cb('0x36')](_0x584a9b[_0xb7cb('0x37')]);_0x528408[_0xb7cb('0x38')]=_['intersection'](_0x528408[_0xb7cb('0x35')],_0x528408['query']);_0x17a5de['attributes']=_[_0xb7cb('0x39')](_0x528408[_0xb7cb('0x35')],qs[_0xb7cb('0x3a')](_0x584a9b[_0xb7cb('0x37')][_0xb7cb('0x3a')]));_0x17a5de[_0xb7cb('0x3b')]=_0x17a5de['attributes'][_0xb7cb('0x3c')]?_0x17a5de[_0xb7cb('0x3b')]:_0x528408['model'];if(!_0x584a9b['query'][_0xb7cb('0x3d')]('nolimit')){_0x17a5de[_0xb7cb('0x25')]=qs[_0xb7cb('0x25')](_0x584a9b[_0xb7cb('0x37')][_0xb7cb('0x25')]);_0x17a5de['offset']=qs[_0xb7cb('0x24')](_0x584a9b[_0xb7cb('0x37')][_0xb7cb('0x24')]);}_0x17a5de[_0xb7cb('0x3e')]=qs[_0xb7cb('0x3f')](_0x584a9b[_0xb7cb('0x37')][_0xb7cb('0x3f')]);_0x17a5de['where']=qs[_0xb7cb('0x38')](_[_0xb7cb('0x40')](_0x584a9b[_0xb7cb('0x37')],_0x528408['filters']),_0x38712a);if(_0x584a9b[_0xb7cb('0x37')][_0xb7cb('0x41')]){_0x17a5de[_0xb7cb('0x42')]=_[_0xb7cb('0x43')](_0x17a5de[_0xb7cb('0x42')],{'$or':_[_0xb7cb('0x30')](_0x38712a,function(_0x27c195){if(_0x27c195[_0xb7cb('0x34')]!=='VIRTUAL'){var _0x2b87ba={};_0x2b87ba[_0x27c195['name']]={'$like':'%'+_0x584a9b[_0xb7cb('0x37')]['filter']+'%'};return _0x2b87ba;}})});}_0x17a5de=_[_0xb7cb('0x43')]({},_0x17a5de,_0x584a9b[_0xb7cb('0x44')]);var _0x19f287={'where':_0x17a5de['where']};return db[_0xb7cb('0x31')][_0xb7cb('0x23')](_0x19f287)['then'](function(_0x486054){_0x232c6c[_0xb7cb('0x23')]=_0x486054;if(_0x584a9b['query'][_0xb7cb('0x45')]){_0x17a5de[_0xb7cb('0x46')]=[{'all':!![]}];}return db[_0xb7cb('0x31')][_0xb7cb('0x47')](_0x17a5de);})[_0xb7cb('0x2a')](function(_0xb4bbfe){_0x232c6c['rows']=_0xb4bbfe;return _0x232c6c;})[_0xb7cb('0x2a')](respondWithFilteredResult(_0x1ff8d5,_0x17a5de))[_0xb7cb('0x48')](handleError(_0x1ff8d5,null));};exports[_0xb7cb('0x49')]=function(_0x1b0849,_0x423b99){var _0x232b0e={'raw':!![],'where':{'id':_0x1b0849[_0xb7cb('0x4a')]['id']}},_0x356240={};_0x356240[_0xb7cb('0x35')]=_[_0xb7cb('0x36')](db['ChatInternalMessage'][_0xb7cb('0x32')]);_0x356240['query']=_['keys'](_0x1b0849[_0xb7cb('0x37')]);_0x356240[_0xb7cb('0x38')]=_[_0xb7cb('0x39')](_0x356240[_0xb7cb('0x35')],_0x356240[_0xb7cb('0x37')]);_0x232b0e[_0xb7cb('0x3b')]=_[_0xb7cb('0x39')](_0x356240[_0xb7cb('0x35')],qs[_0xb7cb('0x3a')](_0x1b0849[_0xb7cb('0x37')][_0xb7cb('0x3a')]));_0x232b0e['attributes']=_0x232b0e[_0xb7cb('0x3b')][_0xb7cb('0x3c')]?_0x232b0e['attributes']:_0x356240[_0xb7cb('0x35')];if(_0x1b0849['query'][_0xb7cb('0x45')]){_0x232b0e[_0xb7cb('0x46')]=[{'all':!![]}];}_0x232b0e=_[_0xb7cb('0x43')]({},_0x232b0e,_0x1b0849[_0xb7cb('0x44')]);return db[_0xb7cb('0x31')][_0xb7cb('0x4b')](_0x232b0e)['then'](handleEntityNotFound(_0x423b99,null))[_0xb7cb('0x2a')](respondWithResult(_0x423b99,null))[_0xb7cb('0x48')](handleError(_0x423b99,null));};exports['create']=function(_0x5cf51b,_0x165c95){return db[_0xb7cb('0x31')]['create'](_0x5cf51b[_0xb7cb('0x4c')],{})[_0xb7cb('0x2a')](respondWithResult(_0x165c95,0xc9))[_0xb7cb('0x48')](handleError(_0x165c95,null));};exports['update']=function(_0x32ae3b,_0x3a642c){if(_0x32ae3b[_0xb7cb('0x4c')]['id']){delete _0x32ae3b[_0xb7cb('0x4c')]['id'];}return db[_0xb7cb('0x31')][_0xb7cb('0x4b')]({'where':{'id':_0x32ae3b[_0xb7cb('0x4a')]['id']}})[_0xb7cb('0x2a')](handleEntityNotFound(_0x3a642c,null))[_0xb7cb('0x2a')](saveUpdates(_0x32ae3b[_0xb7cb('0x4c')],null))[_0xb7cb('0x2a')](respondWithResult(_0x3a642c,null))['catch'](handleError(_0x3a642c,null));};exports['destroy']=function(_0x2ff467,_0x367894){return db['ChatInternalMessage'][_0xb7cb('0x4b')]({'where':{'id':_0x2ff467['params']['id']}})[_0xb7cb('0x2a')](handleEntityNotFound(_0x367894,null))[_0xb7cb('0x2a')](removeEntity(_0x367894,null))[_0xb7cb('0x48')](handleError(_0x367894,null));};exports[_0xb7cb('0x4d')]=function(_0x23ca88,_0x237741){return db[_0xb7cb('0x31')][_0xb7cb('0x4d')]()[_0xb7cb('0x2a')](respondWithResult(_0x237741,null))[_0xb7cb('0x48')](handleError(_0x237741,null));};function wrapUser(_0x55f414){return function(_0x5a0920){var _0x3e24fd=_0x55f414[_0xb7cb('0x4e')]({'plain':!![]});_0x3e24fd['messages']=[];if(_0x5a0920){_0x3e24fd[_0xb7cb('0x4f')]=_0x5a0920[_0xb7cb('0x50')];_0x3e24fd[_0xb7cb('0x51')]=_0x5a0920;}else{_0x3e24fd[_0xb7cb('0x4f')]=moment(0x0)[_0xb7cb('0x52')](_0xb7cb('0x53'));_0x3e24fd['lastMessage']={};}return _0x3e24fd;};}exports[_0xb7cb('0x54')]=function(_0x580f16,_0x497c15,_0x365625){var _0x2a54fe=[];return db['User']['findAll']({'where':{'role':['agent','admin',_0xb7cb('0x55')]},'attributes':['id',_0xb7cb('0x56'),_0xb7cb('0x2d'),'role',_0xb7cb('0x57'),'internal',_0xb7cb('0x58'),_0xb7cb('0x59'),_0xb7cb('0x5a'),_0xb7cb('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xb7cb('0x5c'),'attributes':['id',_0xb7cb('0x2d'),_0xb7cb('0x34')],'through':{'attributes':[]}}]})[_0xb7cb('0x2a')](function(_0x4c088d){if(_0x4c088d){var _0x5362a6=_0x580f16[_0xb7cb('0x55')]['get']({'plain':!![]});if(!_0x5362a6)throw new Error(_0xb7cb('0x5d'));if(_0x5362a6[_0xb7cb('0x5e')]===_0xb7cb('0x55')){return db[_0xb7cb('0x5f')]['find']({'where':{'name':_0xb7cb('0x60'),'userProfileId':_0x5362a6[_0xb7cb('0x61')]},'raw':!![]})[_0xb7cb('0x2a')](function(_0x346677){if(_0x346677){if(_0x346677['autoAssociation']===0x0){return db[_0xb7cb('0x62')][_0xb7cb('0x47')]({'where':{'sectionId':_0x346677['id']},'raw':!![]})[_0xb7cb('0x2a')](function(_0x499958){var _0x2cc992=[];if(_[_0xb7cb('0x63')](_0x499958)){_0x2cc992=_[_0xb7cb('0x41')](_0x4c088d,function(_0x4279fb){if(_0x4279fb[_0xb7cb('0x5e')]!=='agent'){return _0x4279fb;}});return _0x2cc992;}else{for(var _0x378975=0x0;_0x378975<_0x4c088d[_0xb7cb('0x3c')];_0x378975++){var _0x453727=_0x4c088d[_0x378975];if(_0x453727[_0xb7cb('0x5e')]===_0xb7cb('0x64')){var _0x1ab33f=_[_0xb7cb('0x4b')](_0x499958,function(_0x47be69){return _0x47be69[_0xb7cb('0x65')]===_0x453727['id'];});if(_0x1ab33f)_0x2cc992[_0xb7cb('0x66')](_0x453727);}else{_0x2cc992['push'](_0x453727);}}return _0x2cc992;}});}else{return _0x4c088d;}}else{var _0x572254=_[_0xb7cb('0x41')](_0x4c088d,function(_0x191275){if(_0x191275['role']!==_0xb7cb('0x64')){return _0x191275;}});return _0x572254;}});}else{return _0x4c088d;}}})[_0xb7cb('0x2a')](function(_0x6a2fc2){var _0xebbd15=[];if(_0x6a2fc2){_0x2a54fe=_0x6a2fc2;for(var _0x3ed945=0x0;_0x3ed945<_0x6a2fc2[_0xb7cb('0x3c')];_0x3ed945+=0x1){_0x2a54fe[_0x3ed945][_0xb7cb('0x67')]=[];_0xebbd15[_0xb7cb('0x66')](db[_0xb7cb('0x31')][_0xb7cb('0x4b')]({'where':{'FromId':[_0x580f16[_0xb7cb('0x55')]['id'],_0x6a2fc2[_0x3ed945]['id']],'ToId':[_0x580f16[_0xb7cb('0x55')]['id'],_0x6a2fc2[_0x3ed945]['id']],'ChatGroupId':null},'attributes':['id',_0xb7cb('0x50'),_0xb7cb('0x68'),_0xb7cb('0x69'),'read',_0xb7cb('0x4c')],'order':qs['sort'](_0xb7cb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb7cb('0x2a')](wrapUser(_0x6a2fc2[_0x3ed945])));}return BPromise[_0xb7cb('0x6b')](_0xebbd15);}return[];})[_0xb7cb('0x2a')](function(_0x3ffd43){return{'rows':_0x3ffd43,'count':_0x3ffd43[_0xb7cb('0x3c')]};})[_0xb7cb('0x2a')](respondWithResult(_0x497c15,null))[_0xb7cb('0x48')](handleError(_0x497c15,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 499c785..b31eaed 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 _0xeed7=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage'];(function(_0x416f4e,_0x46a4b1){var _0x230028=function(_0x5a17ea){while(--_0x5a17ea){_0x416f4e['push'](_0x416f4e['shift']());}};_0x230028(++_0x46a4b1);}(_0xeed7,0xdf));var _0x7eed=function(_0x16934f,_0x29c3e9){_0x16934f=_0x16934f-0x0;var _0x5ec4b6=_0xeed7[_0x16934f];return _0x5ec4b6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x7eed('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7eed('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7eed('0x2'),'afterDestroy':_0x7eed('0x3')};function emitEvent(_0x1c3dc9){return function(_0x207e4b,_0x4d9a25,_0x115c36){ChatInternalMessageEvents[_0x7eed('0x4')](_0x1c3dc9+':'+_0x207e4b['id'],_0x207e4b);ChatInternalMessageEvents['emit'](_0x1c3dc9,_0x207e4b);_0x115c36(null);};}for(var e in events){if(events[_0x7eed('0x5')](e)){var event=events[e];ChatInternalMessage[_0x7eed('0x6')](e,emitEvent(event));}}module[_0x7eed('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xac22=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x5ab340,_0x3bf3e4){var _0x2ed5b7=function(_0x3178f9){while(--_0x3178f9){_0x5ab340['push'](_0x5ab340['shift']());}};_0x2ed5b7(++_0x3bf3e4);}(_0xac22,0x138));var _0x2ac2=function(_0xedb2da,_0x155f02){_0xedb2da=_0xedb2da-0x0;var _0x5029d1=_0xac22[_0xedb2da];return _0x5029d1;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2ac2('0x0'))['db'][_0x2ac2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2ac2('0x2')](0x0);var events={'afterCreate':_0x2ac2('0x3'),'afterUpdate':_0x2ac2('0x4'),'afterDestroy':_0x2ac2('0x5')};function emitEvent(_0x186380){return function(_0x569df4,_0x37ea79,_0xc88ac2){ChatInternalMessageEvents[_0x2ac2('0x6')](_0x186380+':'+_0x569df4['id'],_0x569df4);ChatInternalMessageEvents['emit'](_0x186380,_0x569df4);_0xc88ac2(null);};}for(var e in events){if(events[_0x2ac2('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2ac2('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2bfcba4..b8073b6 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 _0x8e82=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x517300,_0x289043){var _0xf21a8c=function(_0x5bcb30){while(--_0x5bcb30){_0x517300['push'](_0x517300['shift']());}};_0xf21a8c(++_0x289043);}(_0x8e82,0x138));var _0x28e8=function(_0x460b6f,_0x31b26b){_0x460b6f=_0x460b6f-0x0;var _0x1e94a4=_0x8e82[_0x460b6f];return _0x1e94a4;};'use strict';var _=require('lodash');var util=require(_0x28e8('0x0'));var logger=require(_0x28e8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x28e8('0x2'));var rp=require(_0x28e8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28e8('0x4'));var config=require(_0x28e8('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x28e8('0x6')]=function(_0x54098a,_0x2b4170){return _0x54098a[_0x28e8('0x7')](_0x28e8('0x8'),attributes,{'tableName':_0x28e8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28e8('0xa'),'collate':_0x28e8('0xb')});}; \ No newline at end of file +var _0x1271=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x415fb4,_0x2f5297){var _0x5ec582=function(_0x880bcf){while(--_0x880bcf){_0x415fb4['push'](_0x415fb4['shift']());}};_0x5ec582(++_0x2f5297);}(_0x1271,0xfe));var _0x1127=function(_0x120a87,_0x4a0305){_0x120a87=_0x120a87-0x0;var _0x3b8ac9=_0x1271[_0x120a87];return _0x3b8ac9;};'use strict';var _=require(_0x1127('0x0'));var util=require(_0x1127('0x1'));var logger=require(_0x1127('0x2'))(_0x1127('0x3'));var moment=require(_0x1127('0x4'));var BPromise=require(_0x1127('0x5'));var rp=require(_0x1127('0x6'));var fs=require('fs');var path=require(_0x1127('0x7'));var rimraf=require(_0x1127('0x8'));var config=require(_0x1127('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x1127('0xa')]=function(_0x424b4f,_0x2ac1fb){return _0x424b4f[_0x1127('0xb')](_0x1127('0xc'),attributes,{'tableName':_0x1127('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1127('0xe'),'collate':_0x1127('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 26bd715..faf846c 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 _0x200b=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x200b,0x130));var _0xb200=function(_0x4db899,_0x171096){_0x4db899=_0x4db899-0x0;var _0x50b063=_0x200b[_0x4db899];return _0x50b063;};'use strict';var _=require(_0xb200('0x0'));var util=require(_0xb200('0x1'));var moment=require(_0xb200('0x2'));var BPromise=require(_0xb200('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb200('0x4'));var db=require(_0xb200('0x5'))['db'];var utils=require(_0xb200('0x6'));var logger=require(_0xb200('0x7'))('rpc');var config=require(_0xb200('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb200('0x9')]['http']({'port':0x232a});config[_0xb200('0xa')]=_[_0xb200('0xb')](config[_0xb200('0xa')],{'host':_0xb200('0xc'),'port':0x18eb});var socket=require(_0xb200('0xd'))(new Redis(config[_0xb200('0xa')]));require(_0xb200('0xe'))[_0xb200('0xf')](socket);function respondWithRpcPromise(_0x5110ac,_0x1ed597,_0x3cf740){return new BPromise(function(_0x2bb34b,_0xb987bf){return client[_0xb200('0x10')](_0x5110ac,_0x3cf740)[_0xb200('0x11')](function(_0x30d761){logger[_0xb200('0x12')](_0xb200('0x13'),_0x1ed597,_0xb200('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1ed597,_0xb200('0x14'),JSON['stringify'](_0x30d761));if(_0x30d761[_0xb200('0x15')]){if(_0x30d761[_0xb200('0x15')][_0xb200('0x16')]===0x1f4){logger[_0xb200('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ed597,_0x30d761[_0xb200('0x15')][_0xb200('0x17')]);return _0xb987bf(_0x30d761[_0xb200('0x15')][_0xb200('0x17')]);}logger['error'](_0xb200('0x13'),_0x1ed597,_0x30d761[_0xb200('0x15')][_0xb200('0x17')]);return _0x2bb34b(_0x30d761[_0xb200('0x15')][_0xb200('0x17')]);}else{logger[_0xb200('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ed597,_0xb200('0x14'));_0x2bb34b(_0x30d761['result']['message']);}})[_0xb200('0x18')](function(_0x5cbe5c){logger[_0xb200('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ed597,_0x5cbe5c);_0xb987bf(_0x5cbe5c);});});} \ No newline at end of file +var _0x67c3=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x338f1f,_0x4cfd8d){var _0x140699=function(_0x360e40){while(--_0x360e40){_0x338f1f['push'](_0x338f1f['shift']());}};_0x140699(++_0x4cfd8d);}(_0x67c3,0x174));var _0x367c=function(_0x43f084,_0xb48804){_0x43f084=_0x43f084-0x0;var _0x2a6dde=_0x67c3[_0x43f084];return _0x2a6dde;};'use strict';var _=require(_0x367c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x367c('0x1'));var rs=require(_0x367c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x367c('0x3'))['db'];var utils=require(_0x367c('0x4'));var logger=require('../../config/logger')(_0x367c('0x5'));var config=require(_0x367c('0x6'));var jayson=require(_0x367c('0x7'));var client=jayson[_0x367c('0x8')][_0x367c('0x9')]({'port':0x232a});config['redis']=_[_0x367c('0xa')](config[_0x367c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x367c('0xc'))(new Redis(config[_0x367c('0xb')]));require(_0x367c('0xd'))[_0x367c('0xe')](socket);function respondWithRpcPromise(_0x2c75b0,_0x551bd0,_0x55a418){return new BPromise(function(_0x25bcaa,_0x17f2ff){return client[_0x367c('0xf')](_0x2c75b0,_0x55a418)[_0x367c('0x10')](function(_0x3e0cd3){logger['info'](_0x367c('0x11'),_0x551bd0,_0x367c('0x12'));logger['debug'](_0x367c('0x13'),_0x551bd0,_0x367c('0x12'),JSON[_0x367c('0x14')](_0x3e0cd3));if(_0x3e0cd3[_0x367c('0x15')]){if(_0x3e0cd3[_0x367c('0x15')][_0x367c('0x16')]===0x1f4){logger[_0x367c('0x15')](_0x367c('0x11'),_0x551bd0,_0x3e0cd3[_0x367c('0x15')][_0x367c('0x17')]);return _0x17f2ff(_0x3e0cd3[_0x367c('0x15')][_0x367c('0x17')]);}logger[_0x367c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x551bd0,_0x3e0cd3[_0x367c('0x15')][_0x367c('0x17')]);return _0x25bcaa(_0x3e0cd3[_0x367c('0x15')]['message']);}else{logger[_0x367c('0x18')](_0x367c('0x11'),_0x551bd0,_0x367c('0x12'));_0x25bcaa(_0x3e0cd3[_0x367c('0x19')][_0x367c('0x17')]);}})[_0x367c('0x1a')](function(_0x48c824){logger[_0x367c('0x15')](_0x367c('0x11'),_0x551bd0,_0x48c824);_0x17f2ff(_0x48c824);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4cd40b1..c96951b 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 _0x4fdb=['removeListener','length','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x427bc1,_0x46698c){var _0x293edc=function(_0x86f7f7){while(--_0x86f7f7){_0x427bc1['push'](_0x427bc1['shift']());}};_0x293edc(++_0x46698c);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x13d2c6,_0x153b0d){_0x13d2c6=_0x13d2c6-0x0;var _0x2cc37b=_0x4fdb[_0x13d2c6];return _0x2cc37b;};'use strict';var ChatInternalMessageEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatInternalMessageEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatInternalMessage:'+_0x3af8e3,_0x14052b);ChatInternalMessageEvents['on'](_0x3af8e3,_0x1151b5);}}; \ No newline at end of file +var _0x9cff=['save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0xfef029,_0x357dbe){var _0x48b0ce=function(_0x750e15){while(--_0x750e15){_0xfef029['push'](_0xfef029['shift']());}};_0x48b0ce(++_0x357dbe);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x309d44,_0x44520a){_0x309d44=_0x309d44-0x0;var _0x240e99=_0x9cff[_0x309d44];return _0x240e99;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xf9cf('0x0'),_0xf9cf('0x1'),_0xf9cf('0x2')];function createListener(_0x55364a,_0x197da2){return function(_0x142fc6){_0x197da2[_0xf9cf('0x3')](_0x55364a,_0x142fc6);};}function removeListener(_0x5060e0,_0x2da91){return function(){ChatInternalMessageEvents[_0xf9cf('0x4')](_0x5060e0,_0x2da91);};}exports[_0xf9cf('0x5')]=function(_0x183113){for(var _0xcacbdc=0x0,_0x27e2b1=events[_0xf9cf('0x6')];_0xcacbdc<_0x27e2b1;_0xcacbdc++){var _0x19d7f9=events[_0xcacbdc];var _0x1c29f6=createListener(_0xf9cf('0x7')+_0x19d7f9,_0x183113);ChatInternalMessageEvents['on'](_0x19d7f9,_0x1c29f6);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3952617..a79cc35 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x11d2c3,_0xf37ded){var _0x350ae1=function(_0xc6f67c){while(--_0xc6f67c){_0x11d2c3['push'](_0x11d2c3['shift']());}};_0x350ae1(++_0xf37ded);}(_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['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',controller['update']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 9df10cf..05833d0 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 _0x42df=['BOOLEAN','out','DATE','exports','TEXT','medium'];(function(_0x5cc81b,_0x178c2b){var _0x20a130=function(_0x4242b3){while(--_0x4242b3){_0x5cc81b['push'](_0x5cc81b['shift']());}};_0x20a130(++_0x178c2b);}(_0x42df,0x1dd));var _0xf42d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x42df[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xf42d('0x0')]={'body':{'type':Sequelize[_0xf42d('0x1')](_0xf42d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf42d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf42d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf42d('0x4')),'defaultValue':_0xf42d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf42d('0x5')]}}; \ No newline at end of file +var _0x2f45=['exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2f45,0x90));var _0x52f4=function(_0x5eea51,_0x3aa3be){_0x5eea51=_0x5eea51-0x0;var _0x5c2acb=_0x2f45[_0x5eea51];return _0x5c2acb;};'use strict';var Sequelize=require('sequelize');module[_0x52f4('0x0')]={'body':{'type':Sequelize['TEXT'](_0x52f4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x52f4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x52f4('0x3')]('in',_0x52f4('0x4')),'defaultValue':_0x52f4('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x52f4('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f605560..6cc433d 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 _0x8915=['chat-interactions','agent','RejectMessage','rejectMessage','SIP/%s','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','params','options','find','create','body','catch','update','describe','../../config/logger','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','role','null','acceptMessage','interface','channel','event','EventManager','acceptmessage','parse'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x8915,0x82));var _0x5891=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8915[_0xbf8ebe];return _0x1e25e8;};'use strict';var pdf=require(_0x5891('0x0'));var emlformat=require(_0x5891('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5891('0x2'));var jsonpatch=require(_0x5891('0x3'));var rp=require(_0x5891('0x4'));var moment=require('moment');var BPromise=require(_0x5891('0x5'));var Mustache=require(_0x5891('0x6'));var util=require(_0x5891('0x7'));var path=require(_0x5891('0x8'));var sox=require(_0x5891('0x9'));var csv=require(_0x5891('0xa'));var ejs=require(_0x5891('0xb'));var fs=require('fs');var _=require(_0x5891('0xc'));var squel=require(_0x5891('0xd'));var crypto=require(_0x5891('0xe'));var jsforce=require(_0x5891('0xf'));var deskjs=require(_0x5891('0x10'));var toCsv=require(_0x5891('0xa'));var querystring=require('querystring');var Papa=require(_0x5891('0x11'));var Redis=require(_0x5891('0x12'));var authService=require(_0x5891('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5891('0x14'));var hardwareService=require(_0x5891('0x15'));var logger=require('../../config/logger')(_0x5891('0x16'));var utils=require(_0x5891('0x17'));var config=require(_0x5891('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5891('0x19')](config[_0x5891('0x1a')],{'host':_0x5891('0x1b'),'port':0x18eb});var socket=require(_0x5891('0x1c'))(new Redis(config[_0x5891('0x1a')]));require(_0x5891('0x1d'))[_0x5891('0x1e')](socket);var jayson=require(_0x5891('0x1f'));var client=jayson[_0x5891('0x20')][_0x5891('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x5891('0x21')]({'port':0x232a});function checkPasswordPattern(_0x136f95,_0x4792e1,_0x4d00ac){if(_0x4d00ac){var _0x284419=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x284419[_0x5891('0x22')](_0x4792e1)){return _0x136f95;}else{throw new db['Sequelize']['ValidationError'](_0x5891('0x23'));}}else{return _0x136f95;}}function respondWithRpcPromise(_0x275ccf,_0x260691,_0x47d327,_0x2568ee){return new BPromise(function(_0x13b16b,_0x1cbb44){var _0x2561d5=_0x2568ee||client;return _0x2561d5[_0x5891('0x24')](_0x275ccf,_0x47d327)[_0x5891('0x25')](function(_0x1f1b5d){logger['info'](_0x5891('0x26'),_0x260691,_0x5891('0x27'));logger[_0x5891('0x28')](_0x5891('0x29'),_0x260691,_0x5891('0x27'),JSON[_0x5891('0x2a')](_0x1f1b5d));if(_0x1f1b5d[_0x5891('0x2b')]){if(_0x1f1b5d['error'][_0x5891('0x2c')]===0x1f4){logger['error'](_0x5891('0x26'),_0x260691,_0x1f1b5d[_0x5891('0x2b')]['message']);return _0x1cbb44(_0x1f1b5d[_0x5891('0x2b')][_0x5891('0x2d')]);}logger[_0x5891('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x260691,_0x1f1b5d[_0x5891('0x2b')][_0x5891('0x2d')]);return _0x13b16b(_0x1f1b5d[_0x5891('0x2b')]['message']);}else{logger[_0x5891('0x2e')](_0x5891('0x26'),_0x260691,_0x5891('0x27'));_0x13b16b(_0x1f1b5d['result'][_0x5891('0x2d')]);}})['catch'](function(_0x266c5f){logger['error'](_0x5891('0x26'),_0x260691,_0x266c5f);_0x1cbb44(_0x266c5f);});});}function respondWithStatusCode(_0x22601b,_0x4b95ec){_0x4b95ec=_0x4b95ec||0xcc;return function(_0x975a29){if(_0x975a29){return _0x22601b['sendStatus'](_0x4b95ec);}return _0x22601b[_0x5891('0x2f')](_0x4b95ec)[_0x5891('0x30')]();};}function respondWithResult(_0x4ec83b,_0x251c52){_0x251c52=_0x251c52||0xc8;return function(_0x1d1c4a){if(_0x1d1c4a){return _0x4ec83b[_0x5891('0x2f')](_0x251c52)[_0x5891('0x31')](_0x1d1c4a);}};}function respondWithFilteredResult(_0x2b791b,_0x82437d){return function(_0x36b6a1){if(_0x36b6a1){var _0x5e883b=_0x36b6a1[_0x5891('0x32')],_0x5dd374=_0x82437d[_0x5891('0x33')],_0x295a35=_0x82437d['offset']+_0x82437d['limit'],_0x487ab6;if(_0x295a35>=_0x5e883b){_0x295a35=_0x5e883b;_0x487ab6=0xc8;}else{_0x487ab6=0xce;}_0x2b791b[_0x5891('0x2f')](_0x487ab6);return _0x2b791b[_0x5891('0x34')](_0x5891('0x35'),_0x5dd374+'-'+_0x295a35+'/'+_0x5e883b)[_0x5891('0x31')](_0x36b6a1);}return null;};}function patchUpdates(_0x12d3ad){return function(_0x3da86b){try{jsonpatch[_0x5891('0x36')](_0x3da86b,_0x12d3ad,!![]);}catch(_0x370882){return BPromise[_0x5891('0x37')](_0x370882);}return _0x3da86b[_0x5891('0x38')]();};}function saveUpdates(_0x240950,_0x4c4c85){return function(_0x5db7cd){if(_0x5db7cd){return _0x5db7cd['update'](_0x240950)[_0x5891('0x25')](function(_0x4e64d6){return _0x4e64d6;});}return null;};}function removeEntity(_0x42e399,_0x349081){return function(_0x6c95b9){if(_0x6c95b9){return _0x6c95b9[_0x5891('0x39')]()[_0x5891('0x25')](function(){_0x42e399[_0x5891('0x2f')](0xcc)[_0x5891('0x30')]();});}};}function handleEntityNotFound(_0x31ad98,_0x3c7cf7){return function(_0x30dd7b){if(!_0x30dd7b){_0x31ad98['sendStatus'](0x194);}return _0x30dd7b;};}function handleError(_0x514e01,_0x5519cc){_0x5519cc=_0x5519cc||0x1f4;return function(_0x2b3183){logger['error'](_0x2b3183[_0x5891('0x3a')]);if(_0x2b3183['name']){delete _0x2b3183[_0x5891('0x3b')];}_0x514e01[_0x5891('0x2f')](_0x5519cc)[_0x5891('0x3c')](_0x2b3183);};}exports[_0x5891('0x3d')]=function(_0x599def,_0x387744){var _0x4cc7cd={},_0x3ae0c0={},_0x19d543={'count':0x0,'rows':[]};var _0x376021=_[_0x5891('0x3e')](db[_0x5891('0x3f')][_0x5891('0x40')],function(_0x1c8f93){return{'name':_0x1c8f93['fieldName'],'type':_0x1c8f93[_0x5891('0x41')][_0x5891('0x42')]};});_0x3ae0c0[_0x5891('0x43')]=_[_0x5891('0x3e')](_0x376021,_0x5891('0x3b'));_0x3ae0c0[_0x5891('0x44')]=_[_0x5891('0x45')](_0x599def[_0x5891('0x44')]);_0x3ae0c0[_0x5891('0x46')]=_[_0x5891('0x47')](_0x3ae0c0[_0x5891('0x43')],_0x3ae0c0[_0x5891('0x44')]);_0x4cc7cd['attributes']=_[_0x5891('0x47')](_0x3ae0c0[_0x5891('0x43')],qs['fields'](_0x599def[_0x5891('0x44')][_0x5891('0x48')]));_0x4cc7cd['attributes']=_0x4cc7cd[_0x5891('0x49')][_0x5891('0x4a')]?_0x4cc7cd[_0x5891('0x49')]:_0x3ae0c0[_0x5891('0x43')];if(!_0x599def[_0x5891('0x44')][_0x5891('0x4b')]('nolimit')){_0x4cc7cd[_0x5891('0x4c')]=qs[_0x5891('0x4c')](_0x599def[_0x5891('0x44')][_0x5891('0x4c')]);_0x4cc7cd[_0x5891('0x33')]=qs[_0x5891('0x33')](_0x599def[_0x5891('0x44')]['offset']);}_0x4cc7cd['order']=qs[_0x5891('0x4d')](_0x599def[_0x5891('0x44')][_0x5891('0x4d')]);_0x4cc7cd['where']=qs[_0x5891('0x46')](_[_0x5891('0x4e')](_0x599def[_0x5891('0x44')],_0x3ae0c0[_0x5891('0x46')]),_0x376021);if(_0x599def['query'][_0x5891('0x4f')]){_0x4cc7cd[_0x5891('0x50')]=_[_0x5891('0x51')](_0x4cc7cd['where'],{'$or':_['map'](_0x376021,function(_0x2b10dc){if(_0x2b10dc[_0x5891('0x41')]!==_0x5891('0x52')){var _0xbdaf57={};_0xbdaf57[_0x2b10dc['name']]={'$like':'%'+_0x599def['query']['filter']+'%'};return _0xbdaf57;}})});}_0x4cc7cd=_[_0x5891('0x51')]({},_0x4cc7cd,_0x599def['options']);var _0x4bf951={'where':_0x4cc7cd[_0x5891('0x50')]};return db['ChatMessage'][_0x5891('0x32')](_0x4bf951)[_0x5891('0x25')](function(_0x33ecb7){_0x19d543[_0x5891('0x32')]=_0x33ecb7;if(_0x599def['query'][_0x5891('0x53')]){_0x4cc7cd[_0x5891('0x54')]=[{'all':!![]}];}return db[_0x5891('0x3f')][_0x5891('0x55')](_0x4cc7cd);})['then'](function(_0x4ce59b){_0x19d543['rows']=_0x4ce59b;return _0x19d543;})['then'](respondWithFilteredResult(_0x387744,_0x4cc7cd))['catch'](handleError(_0x387744,null));};exports['show']=function(_0x2ecdb0,_0x3867c4){var _0x16a139={'raw':!![],'where':{'id':_0x2ecdb0[_0x5891('0x56')]['id']}},_0x73373d={};_0x73373d['model']=_[_0x5891('0x45')](db['ChatMessage']['rawAttributes']);_0x73373d[_0x5891('0x44')]=_[_0x5891('0x45')](_0x2ecdb0[_0x5891('0x44')]);_0x73373d[_0x5891('0x46')]=_[_0x5891('0x47')](_0x73373d['model'],_0x73373d[_0x5891('0x44')]);_0x16a139[_0x5891('0x49')]=_[_0x5891('0x47')](_0x73373d[_0x5891('0x43')],qs[_0x5891('0x48')](_0x2ecdb0[_0x5891('0x44')][_0x5891('0x48')]));_0x16a139[_0x5891('0x49')]=_0x16a139[_0x5891('0x49')][_0x5891('0x4a')]?_0x16a139[_0x5891('0x49')]:_0x73373d[_0x5891('0x43')];if(_0x2ecdb0[_0x5891('0x44')][_0x5891('0x53')]){_0x16a139['include']=[{'all':!![]}];}_0x16a139=_['merge']({},_0x16a139,_0x2ecdb0[_0x5891('0x57')]);return db[_0x5891('0x3f')][_0x5891('0x58')](_0x16a139)[_0x5891('0x25')](handleEntityNotFound(_0x3867c4,null))[_0x5891('0x25')](respondWithResult(_0x3867c4,null))['catch'](handleError(_0x3867c4,null));};exports[_0x5891('0x59')]=function(_0x337e5d,_0x174029){return db[_0x5891('0x3f')][_0x5891('0x59')](_0x337e5d[_0x5891('0x5a')],{})['then'](respondWithResult(_0x174029,0xc9))[_0x5891('0x5b')](handleError(_0x174029,null));};exports[_0x5891('0x5c')]=function(_0x24fb1f,_0x49f626){if(_0x24fb1f['body']['id']){delete _0x24fb1f[_0x5891('0x5a')]['id'];}return db[_0x5891('0x3f')][_0x5891('0x58')]({'where':{'id':_0x24fb1f[_0x5891('0x56')]['id']}})[_0x5891('0x25')](handleEntityNotFound(_0x49f626,null))[_0x5891('0x25')](saveUpdates(_0x24fb1f[_0x5891('0x5a')],null))[_0x5891('0x25')](respondWithResult(_0x49f626,null))[_0x5891('0x5b')](handleError(_0x49f626,null));};exports[_0x5891('0x39')]=function(_0xa0731b,_0x503390){return db[_0x5891('0x3f')][_0x5891('0x58')]({'where':{'id':_0xa0731b[_0x5891('0x56')]['id']}})[_0x5891('0x25')](handleEntityNotFound(_0x503390,null))[_0x5891('0x25')](removeEntity(_0x503390,null))[_0x5891('0x5b')](handleError(_0x503390,null));};exports[_0x5891('0x5d')]=function(_0x5ccd2e,_0x9746fb){return db[_0x5891('0x3f')][_0x5891('0x5d')]()['then'](respondWithResult(_0x9746fb,null))['catch'](handleError(_0x9746fb,null));};var interaction_log=require(_0x5891('0x5e'))('chat-interactions');exports[_0x5891('0x5f')]=function(_0x2c91bb,_0x5e18be,_0x4cb718){var _0x2be079={'channel':_0x5891('0x60')};if(_0x2c91bb[_0x5891('0x5a')]['id']){delete _0x2c91bb[_0x5891('0x5a')]['id'];}_0x2c91bb[_0x5891('0x5a')][_0x5891('0x61')]=!![];_0x2c91bb['body']['readAt']=moment()[_0x5891('0x62')](_0x5891('0x63'));_0x2c91bb[_0x5891('0x5a')][_0x5891('0x64')]=_0x2c91bb['body'][_0x5891('0x64')]||_0x2c91bb[_0x5891('0x65')]['id'];return db[_0x5891('0x3f')][_0x5891('0x58')]({'where':{'id':_0x2c91bb[_0x5891('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x5891('0x66')],'as':_0x5891('0x67')}]})[_0x5891('0x25')](handleEntityNotFound(_0x5e18be,null))[_0x5891('0x25')](saveUpdates(_0x2c91bb[_0x5891('0x5a')],null))[_0x5891('0x25')](function(_0x3062ff){if(_0x3062ff){_0x2be079[_0x5891('0x2d')]=_0x3062ff[_0x5891('0x68')]({'plain':!![]});return db[_0x5891('0x69')][_0x5891('0x58')]({'where':{'id':_0x3062ff[_0x5891('0x6a')]}});}return null;})[_0x5891('0x25')](handleEntityNotFound(_0x5e18be,null))[_0x5891('0x25')](function(_0x251736){if(_0x251736){return _0x251736[_0x5891('0x5c')]({'UserId':_0x2c91bb[_0x5891('0x5a')][_0x5891('0x64')],'read1stAt':_['isNil'](_0x251736[_0x5891('0x6b')])?moment()[_0x5891('0x62')](_0x5891('0x63')):undefined});}return null;})[_0x5891('0x25')](function(_0x303c61){if(_0x303c61){_0x2be079[_0x5891('0x6c')]=_0x303c61[_0x5891('0x68')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c91bb[_0x5891('0x65')]['id'],_0x2c91bb['user']['name'],_0x2c91bb[_0x5891('0x65')][_0x5891('0x6d')],_0x2be079[_0x5891('0x6c')]['id'],_0x2c91bb[_0x5891('0x5a')]?JSON[_0x5891('0x2a')](_0x2c91bb[_0x5891('0x5a')]):_0x5891('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x5891('0x6f'),_0x2be079);}return null;})['then'](function(_0x355c7a){if(_0x355c7a){if(_0x2c91bb[_0x5891('0x5a')]['manual']){_0x2be079[_0x5891('0x2d')][_0x5891('0x70')]=util[_0x5891('0x62')]('SIP/%s',_0x2c91bb[_0x5891('0x65')]['name']);_0x2be079[_0x5891('0x2d')][_0x5891('0x71')]=_0x2be079[_0x5891('0x71')];_0x2be079[_0x5891('0x2d')][_0x5891('0x72')]=_0x5891('0x5f');return respondWithRpcPromise(_0x5891('0x73'),'EventManager',{'event':_0x5891('0x74'),'message':_[_0x5891('0x51')](_0x2be079[_0x5891('0x2d')],JSON[_0x5891('0x75')](_0x2be079[_0x5891('0x6c')]['formData']))},client9002)[_0x5891('0x25')](function(){return _0x2be079;});}return _0x2be079;}return null;})[_0x5891('0x25')](respondWithResult(_0x5e18be,null))[_0x5891('0x5b')](handleError(_0x5e18be,null));};var interaction_log=require(_0x5891('0x5e'))(_0x5891('0x76'));exports[_0x5891('0x37')]=function(_0xeaa311,_0x1cb67b,_0x36aa77){var _0x3f7b34={'agent':{},'channel':'chat'};if(_0xeaa311['body']['id']){delete _0xeaa311[_0x5891('0x5a')]['id'];}_0xeaa311[_0x5891('0x5a')][_0x5891('0x64')]=_0xeaa311['body'][_0x5891('0x64')]||_0xeaa311[_0x5891('0x65')]['id'];_0x3f7b34[_0x5891('0x77')]['id']=_0xeaa311[_0x5891('0x5a')]['UserId'];return db[_0x5891('0x3f')]['find']({'where':{'id':_0xeaa311['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1cb67b,null))[_0x5891('0x25')](function(_0x41f6cb){if(_0x41f6cb){_0x3f7b34[_0x5891('0x2d')]=_0x41f6cb[_0x5891('0x68')]({'plain':!![]});return db[_0x5891('0x69')][_0x5891('0x58')]({'where':{'id':_0x41f6cb['ChatInteractionId']}});}return null;})[_0x5891('0x25')](handleEntityNotFound(_0x1cb67b,null))[_0x5891('0x25')](function(_0x4289fe){if(_0x4289fe){_0x3f7b34[_0x5891('0x6c')]=_0x4289fe[_0x5891('0x68')]({'plain':!![]});interaction_log[_0x5891('0x2e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xeaa311['user']['id'],_0xeaa311[_0x5891('0x65')]['name'],_0xeaa311['user'][_0x5891('0x6d')],_0x3f7b34[_0x5891('0x6c')]['id'],_0xeaa311[_0x5891('0x5a')]?JSON['stringify'](_0xeaa311[_0x5891('0x5a')]):_0x5891('0x6e'));return respondWithRpcPromise(_0x5891('0x78'),_0x5891('0x79'),_0x3f7b34);}return null;})[_0x5891('0x25')](function(_0x463482){if(_0x463482){_0x463482[_0x5891('0x2d')][_0x5891('0x70')]=util[_0x5891('0x62')](_0x5891('0x7a'),_0xeaa311[_0x5891('0x65')][_0x5891('0x3b')]);_0x463482[_0x5891('0x2d')][_0x5891('0x71')]=_0x3f7b34[_0x5891('0x71')];_0x463482[_0x5891('0x2d')][_0x5891('0x72')]=_0x5891('0x37');respondWithRpcPromise(_0x5891('0x73'),_0x5891('0x73'),{'event':_0x5891('0x7b'),'message':_0x463482[_0x5891('0x2d')]},client9002);return _0x3f7b34;}return null;})[_0x5891('0x25')](respondWithResult(_0x1cb67b,null))[_0x5891('0x5b')](handleError(_0x1cb67b,null));}; \ No newline at end of file +var _0x565c=['read','format','UserId','user','Contact','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','stringify','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','acceptmessage','parse','formData','agent','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','http','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','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept'];(function(_0x359d3e,_0x9d9e5b){var _0x533931=function(_0x553875){while(--_0x553875){_0x359d3e['push'](_0x359d3e['shift']());}};_0x533931(++_0x9d9e5b);}(_0x565c,0x10f));var _0xc565=function(_0x217fad,_0x4b3d4f){_0x217fad=_0x217fad-0x0;var _0x51514d=_0x565c[_0x217fad];return _0x51514d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc565('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc565('0x1'));var jsonpatch=require(_0xc565('0x2'));var rp=require(_0xc565('0x3'));var moment=require(_0xc565('0x4'));var BPromise=require(_0xc565('0x5'));var Mustache=require(_0xc565('0x6'));var util=require(_0xc565('0x7'));var path=require(_0xc565('0x8'));var sox=require('sox');var csv=require(_0xc565('0x9'));var ejs=require(_0xc565('0xa'));var fs=require('fs');var _=require(_0xc565('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc565('0xc'));var deskjs=require(_0xc565('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc565('0xe'));var Papa=require(_0xc565('0xf'));var Redis=require(_0xc565('0x10'));var authService=require(_0xc565('0x11'));var qs=require(_0xc565('0x12'));var as=require(_0xc565('0x13'));var hardwareService=require(_0xc565('0x14'));var logger=require(_0xc565('0x15'))(_0xc565('0x16'));var utils=require(_0xc565('0x17'));var config=require(_0xc565('0x18'));var db=require(_0xc565('0x19'))['db'];config[_0xc565('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc565('0x1b'))(new Redis(config[_0xc565('0x1a')]));require('./chatMessage.socket')[_0xc565('0x1c')](socket);var jayson=require(_0xc565('0x1d'));var client=jayson['client'][_0xc565('0x1e')]({'port':0x232c});var client9002=jayson[_0xc565('0x1f')][_0xc565('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x154fa9,_0x2949af,_0x22dc94){if(_0x22dc94){var _0x843be1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x843be1['test'](_0x2949af)){return _0x154fa9;}else{throw new db[(_0xc565('0x20'))][(_0xc565('0x21'))](_0xc565('0x22'));}}else{return _0x154fa9;}}function respondWithRpcPromise(_0x159bcd,_0x2c73aa,_0x2d2032,_0x55431c){return new BPromise(function(_0x4ca876,_0x384198){var _0x25901b=_0x55431c||client;return _0x25901b[_0xc565('0x23')](_0x159bcd,_0x2d2032)[_0xc565('0x24')](function(_0x2b1234){logger[_0xc565('0x25')](_0xc565('0x26'),_0x2c73aa,_0xc565('0x27'));logger['debug'](_0xc565('0x28'),_0x2c73aa,_0xc565('0x27'),JSON['stringify'](_0x2b1234));if(_0x2b1234['error']){if(_0x2b1234['error'][_0xc565('0x29')]===0x1f4){logger['error'](_0xc565('0x26'),_0x2c73aa,_0x2b1234[_0xc565('0x2a')][_0xc565('0x2b')]);return _0x384198(_0x2b1234[_0xc565('0x2a')][_0xc565('0x2b')]);}logger['error'](_0xc565('0x26'),_0x2c73aa,_0x2b1234[_0xc565('0x2a')]['message']);return _0x4ca876(_0x2b1234[_0xc565('0x2a')][_0xc565('0x2b')]);}else{logger[_0xc565('0x25')](_0xc565('0x26'),_0x2c73aa,_0xc565('0x27'));_0x4ca876(_0x2b1234['result']['message']);}})[_0xc565('0x2c')](function(_0x2a045d){logger[_0xc565('0x2a')](_0xc565('0x26'),_0x2c73aa,_0x2a045d);_0x384198(_0x2a045d);});});}function respondWithStatusCode(_0x33f071,_0x32bf29){_0x32bf29=_0x32bf29||0xcc;return function(_0x1fa7e9){if(_0x1fa7e9){return _0x33f071[_0xc565('0x2d')](_0x32bf29);}return _0x33f071[_0xc565('0x2e')](_0x32bf29)[_0xc565('0x2f')]();};}function respondWithResult(_0x4c47b6,_0x55c12f){_0x55c12f=_0x55c12f||0xc8;return function(_0x476264){if(_0x476264){return _0x4c47b6[_0xc565('0x2e')](_0x55c12f)[_0xc565('0x30')](_0x476264);}};}function respondWithFilteredResult(_0x19020f,_0x1da215){return function(_0x4e5b34){if(_0x4e5b34){var _0x38bc7b=_0x4e5b34[_0xc565('0x31')],_0x627034=_0x1da215[_0xc565('0x32')],_0x2671f6=_0x1da215[_0xc565('0x32')]+_0x1da215[_0xc565('0x33')],_0x5ca95a;if(_0x2671f6>=_0x38bc7b){_0x2671f6=_0x38bc7b;_0x5ca95a=0xc8;}else{_0x5ca95a=0xce;}_0x19020f[_0xc565('0x2e')](_0x5ca95a);return _0x19020f['set'](_0xc565('0x34'),_0x627034+'-'+_0x2671f6+'/'+_0x38bc7b)['json'](_0x4e5b34);}return null;};}function patchUpdates(_0x11caf9){return function(_0x417f5f){try{jsonpatch[_0xc565('0x35')](_0x417f5f,_0x11caf9,!![]);}catch(_0x5bfc58){return BPromise[_0xc565('0x36')](_0x5bfc58);}return _0x417f5f[_0xc565('0x37')]();};}function saveUpdates(_0x5354c2,_0x34989b){return function(_0x133c3e){if(_0x133c3e){return _0x133c3e[_0xc565('0x38')](_0x5354c2)[_0xc565('0x24')](function(_0x253445){return _0x253445;});}return null;};}function removeEntity(_0x22b5d5,_0x1c995c){return function(_0x3dc600){if(_0x3dc600){return _0x3dc600[_0xc565('0x39')]()[_0xc565('0x24')](function(){_0x22b5d5[_0xc565('0x2e')](0xcc)[_0xc565('0x2f')]();});}};}function handleEntityNotFound(_0x4bc9c8,_0x29683e){return function(_0x2c2f0b){if(!_0x2c2f0b){_0x4bc9c8[_0xc565('0x2d')](0x194);}return _0x2c2f0b;};}function handleError(_0x166159,_0xa7d27f){_0xa7d27f=_0xa7d27f||0x1f4;return function(_0x484613){logger[_0xc565('0x2a')](_0x484613[_0xc565('0x3a')]);if(_0x484613[_0xc565('0x3b')]){delete _0x484613[_0xc565('0x3b')];}_0x166159[_0xc565('0x2e')](_0xa7d27f)[_0xc565('0x3c')](_0x484613);};}exports[_0xc565('0x3d')]=function(_0x9fbe55,_0x2f1766){var _0x15ff97={},_0x460a5f={},_0x5db7e2={'count':0x0,'rows':[]};var _0x4173b3=_[_0xc565('0x3e')](db[_0xc565('0x3f')]['rawAttributes'],function(_0x12c3eb){return{'name':_0x12c3eb[_0xc565('0x40')],'type':_0x12c3eb['type']['key']};});_0x460a5f[_0xc565('0x41')]=_[_0xc565('0x3e')](_0x4173b3,_0xc565('0x3b'));_0x460a5f[_0xc565('0x42')]=_[_0xc565('0x43')](_0x9fbe55[_0xc565('0x42')]);_0x460a5f[_0xc565('0x44')]=_[_0xc565('0x45')](_0x460a5f[_0xc565('0x41')],_0x460a5f[_0xc565('0x42')]);_0x15ff97[_0xc565('0x46')]=_['intersection'](_0x460a5f['model'],qs[_0xc565('0x47')](_0x9fbe55['query'][_0xc565('0x47')]));_0x15ff97[_0xc565('0x46')]=_0x15ff97[_0xc565('0x46')][_0xc565('0x48')]?_0x15ff97[_0xc565('0x46')]:_0x460a5f[_0xc565('0x41')];if(!_0x9fbe55[_0xc565('0x42')][_0xc565('0x49')]('nolimit')){_0x15ff97['limit']=qs[_0xc565('0x33')](_0x9fbe55[_0xc565('0x42')][_0xc565('0x33')]);_0x15ff97['offset']=qs[_0xc565('0x32')](_0x9fbe55['query']['offset']);}_0x15ff97[_0xc565('0x4a')]=qs['sort'](_0x9fbe55['query'][_0xc565('0x4b')]);_0x15ff97[_0xc565('0x4c')]=qs[_0xc565('0x44')](_[_0xc565('0x4d')](_0x9fbe55[_0xc565('0x42')],_0x460a5f['filters']),_0x4173b3);if(_0x9fbe55[_0xc565('0x42')]['filter']){_0x15ff97[_0xc565('0x4c')]=_[_0xc565('0x4e')](_0x15ff97[_0xc565('0x4c')],{'$or':_['map'](_0x4173b3,function(_0x4a7dc7){if(_0x4a7dc7[_0xc565('0x4f')]!==_0xc565('0x50')){var _0x381fb3={};_0x381fb3[_0x4a7dc7[_0xc565('0x3b')]]={'$like':'%'+_0x9fbe55[_0xc565('0x42')]['filter']+'%'};return _0x381fb3;}})});}_0x15ff97=_[_0xc565('0x4e')]({},_0x15ff97,_0x9fbe55['options']);var _0x414464={'where':_0x15ff97[_0xc565('0x4c')]};return db[_0xc565('0x3f')][_0xc565('0x31')](_0x414464)['then'](function(_0x58489f){_0x5db7e2[_0xc565('0x31')]=_0x58489f;if(_0x9fbe55[_0xc565('0x42')]['includeAll']){_0x15ff97[_0xc565('0x51')]=[{'all':!![]}];}return db[_0xc565('0x3f')][_0xc565('0x52')](_0x15ff97);})[_0xc565('0x24')](function(_0x57590b){_0x5db7e2[_0xc565('0x53')]=_0x57590b;return _0x5db7e2;})[_0xc565('0x24')](respondWithFilteredResult(_0x2f1766,_0x15ff97))[_0xc565('0x2c')](handleError(_0x2f1766,null));};exports[_0xc565('0x54')]=function(_0x2741cb,_0x4168f3){var _0x45a100={'raw':!![],'where':{'id':_0x2741cb[_0xc565('0x55')]['id']}},_0xa007e={};_0xa007e['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0xa007e[_0xc565('0x42')]=_[_0xc565('0x43')](_0x2741cb[_0xc565('0x42')]);_0xa007e['filters']=_['intersection'](_0xa007e[_0xc565('0x41')],_0xa007e[_0xc565('0x42')]);_0x45a100['attributes']=_[_0xc565('0x45')](_0xa007e[_0xc565('0x41')],qs[_0xc565('0x47')](_0x2741cb['query'][_0xc565('0x47')]));_0x45a100[_0xc565('0x46')]=_0x45a100[_0xc565('0x46')][_0xc565('0x48')]?_0x45a100[_0xc565('0x46')]:_0xa007e[_0xc565('0x41')];if(_0x2741cb[_0xc565('0x42')]['includeAll']){_0x45a100[_0xc565('0x51')]=[{'all':!![]}];}_0x45a100=_[_0xc565('0x4e')]({},_0x45a100,_0x2741cb['options']);return db[_0xc565('0x3f')][_0xc565('0x56')](_0x45a100)[_0xc565('0x24')](handleEntityNotFound(_0x4168f3,null))[_0xc565('0x24')](respondWithResult(_0x4168f3,null))[_0xc565('0x2c')](handleError(_0x4168f3,null));};exports[_0xc565('0x57')]=function(_0x54ed4b,_0x5165aa){return db[_0xc565('0x3f')]['create'](_0x54ed4b[_0xc565('0x58')],{})['then'](respondWithResult(_0x5165aa,0xc9))[_0xc565('0x2c')](handleError(_0x5165aa,null));};exports[_0xc565('0x38')]=function(_0x3436dc,_0x1ce022){if(_0x3436dc[_0xc565('0x58')]['id']){delete _0x3436dc['body']['id'];}return db[_0xc565('0x3f')][_0xc565('0x56')]({'where':{'id':_0x3436dc[_0xc565('0x55')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x1ce022,null))['then'](saveUpdates(_0x3436dc[_0xc565('0x58')],null))[_0xc565('0x24')](respondWithResult(_0x1ce022,null))[_0xc565('0x2c')](handleError(_0x1ce022,null));};exports[_0xc565('0x39')]=function(_0x5e6f19,_0x20af4a){return db[_0xc565('0x3f')]['find']({'where':{'id':_0x5e6f19[_0xc565('0x55')]['id']}})['then'](handleEntityNotFound(_0x20af4a,null))[_0xc565('0x24')](removeEntity(_0x20af4a,null))[_0xc565('0x2c')](handleError(_0x20af4a,null));};exports['describe']=function(_0x261487,_0x20ba1f){return db[_0xc565('0x3f')][_0xc565('0x59')]()[_0xc565('0x24')](respondWithResult(_0x20ba1f,null))[_0xc565('0x2c')](handleError(_0x20ba1f,null));};var interaction_log=require(_0xc565('0x15'))(_0xc565('0x5a'));exports[_0xc565('0x5b')]=function(_0x5dce74,_0x93ea58,_0x45ef1e){var _0x29d322={'channel':'chat'};if(_0x5dce74[_0xc565('0x58')]['id']){delete _0x5dce74[_0xc565('0x58')]['id'];}_0x5dce74[_0xc565('0x58')][_0xc565('0x5c')]=!![];_0x5dce74['body']['readAt']=moment()[_0xc565('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5dce74['body'][_0xc565('0x5e')]=_0x5dce74[_0xc565('0x58')]['UserId']||_0x5dce74[_0xc565('0x5f')]['id'];return db[_0xc565('0x3f')][_0xc565('0x56')]({'where':{'id':_0x5dce74[_0xc565('0x55')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xc565('0x60')}]})[_0xc565('0x24')](handleEntityNotFound(_0x93ea58,null))[_0xc565('0x24')](saveUpdates(_0x5dce74['body'],null))[_0xc565('0x24')](function(_0x25129a){if(_0x25129a){_0x29d322['message']=_0x25129a['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x25129a[_0xc565('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x93ea58,null))[_0xc565('0x24')](function(_0x5188bb){if(_0x5188bb){return _0x5188bb['update']({'UserId':_0x5dce74[_0xc565('0x58')][_0xc565('0x5e')],'read1stAt':_['isNil'](_0x5188bb[_0xc565('0x62')])?moment()['format'](_0xc565('0x63')):undefined});}return null;})[_0xc565('0x24')](function(_0x133a7d){if(_0x133a7d){_0x29d322[_0xc565('0x64')]=_0x133a7d['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5dce74[_0xc565('0x5f')]['id'],_0x5dce74['user']['name'],_0x5dce74['user'][_0xc565('0x65')],_0x29d322['interaction']['id'],_0x5dce74['body']?JSON[_0xc565('0x66')](_0x5dce74[_0xc565('0x58')]):_0xc565('0x67'));return respondWithRpcPromise(_0xc565('0x68'),_0xc565('0x69'),_0x29d322);}return null;})[_0xc565('0x24')](function(_0x32a4a7){if(_0x32a4a7){if(_0x5dce74[_0xc565('0x58')][_0xc565('0x6a')]){_0x29d322[_0xc565('0x2b')]['interface']=util[_0xc565('0x5d')](_0xc565('0x6b'),_0x5dce74[_0xc565('0x5f')][_0xc565('0x3b')]);_0x29d322[_0xc565('0x2b')][_0xc565('0x6c')]=_0x29d322[_0xc565('0x6c')];_0x29d322['message'][_0xc565('0x6d')]=_0xc565('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc565('0x6e'),'message':_[_0xc565('0x4e')](_0x29d322['message'],JSON[_0xc565('0x6f')](_0x29d322[_0xc565('0x64')][_0xc565('0x70')]))},client9002)[_0xc565('0x24')](function(){return _0x29d322;});}return _0x29d322;}return null;})[_0xc565('0x24')](respondWithResult(_0x93ea58,null))['catch'](handleError(_0x93ea58,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x406e17,_0x54dab4,_0x2cfea1){var _0x55e011={'agent':{},'channel':'chat'};if(_0x406e17['body']['id']){delete _0x406e17[_0xc565('0x58')]['id'];}_0x406e17['body']['UserId']=_0x406e17[_0xc565('0x58')][_0xc565('0x5e')]||_0x406e17['user']['id'];_0x55e011[_0xc565('0x71')]['id']=_0x406e17[_0xc565('0x58')][_0xc565('0x5e')];return db[_0xc565('0x3f')][_0xc565('0x56')]({'where':{'id':_0x406e17[_0xc565('0x55')]['id'],'UserId':null}})[_0xc565('0x24')](handleEntityNotFound(_0x54dab4,null))[_0xc565('0x24')](function(_0x568e3a){if(_0x568e3a){_0x55e011['message']=_0x568e3a[_0xc565('0x72')]({'plain':!![]});return db[_0xc565('0x73')][_0xc565('0x56')]({'where':{'id':_0x568e3a[_0xc565('0x61')]}});}return null;})[_0xc565('0x24')](handleEntityNotFound(_0x54dab4,null))['then'](function(_0x403ad5){if(_0x403ad5){_0x55e011[_0xc565('0x64')]=_0x403ad5[_0xc565('0x72')]({'plain':!![]});interaction_log[_0xc565('0x25')](_0xc565('0x74'),_0x406e17[_0xc565('0x5f')]['id'],_0x406e17['user'][_0xc565('0x3b')],_0x406e17[_0xc565('0x5f')]['role'],_0x55e011['interaction']['id'],_0x406e17[_0xc565('0x58')]?JSON[_0xc565('0x66')](_0x406e17['body']):_0xc565('0x67'));return respondWithRpcPromise(_0xc565('0x75'),_0xc565('0x76'),_0x55e011);}return null;})[_0xc565('0x24')](function(_0x33d06b){if(_0x33d06b){_0x33d06b[_0xc565('0x2b')]['interface']=util[_0xc565('0x5d')]('SIP/%s',_0x406e17[_0xc565('0x5f')][_0xc565('0x3b')]);_0x33d06b['message'][_0xc565('0x6c')]=_0x55e011['channel'];_0x33d06b[_0xc565('0x2b')]['event']='reject';respondWithRpcPromise(_0xc565('0x77'),_0xc565('0x77'),{'event':_0xc565('0x78'),'message':_0x33d06b[_0xc565('0x2b')]},client9002);return _0x55e011;}return null;})[_0xc565('0x24')](respondWithResult(_0x54dab4,null))[_0xc565('0x2c')](handleError(_0x54dab4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d49b47b..e8e05c8 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 _0xe9b1=['ChatMessage','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xe9b1,0xa0));var _0x1e9b=function(_0x43e97d,_0x56a06b){_0x43e97d=_0x43e97d-0x0;var _0x424cd9=_0xe9b1[_0x43e97d];return _0x424cd9;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x1e9b('0x0'))['db'][_0x1e9b('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e9b('0x2'),'afterUpdate':'update','afterDestroy':_0x1e9b('0x3')};function emitEvent(_0x3e5c0b){return function(_0x3fabef,_0x5b6813,_0x534bf5){ChatMessageEvents[_0x1e9b('0x4')](_0x3e5c0b+':'+_0x3fabef['id'],_0x3fabef);ChatMessageEvents[_0x1e9b('0x4')](_0x3e5c0b,_0x3fabef);_0x534bf5(null);};}for(var e in events){if(events[_0x1e9b('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1e9b('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x8e02=['events','ChatMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3b9c4c,_0x208154){var _0x33e636=function(_0x576e99){while(--_0x576e99){_0x3b9c4c['push'](_0x3b9c4c['shift']());}};_0x33e636(++_0x208154);}(_0x8e02,0x1e8));var _0x28e0=function(_0x2170f4,_0x25eaf1){_0x2170f4=_0x2170f4-0x0;var _0x33bb21=_0x8e02[_0x2170f4];return _0x33bb21;};'use strict';var EventEmitter=require(_0x28e0('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x28e0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x28e0('0x2')](0x0);var events={'afterCreate':_0x28e0('0x3'),'afterUpdate':_0x28e0('0x4'),'afterDestroy':_0x28e0('0x5')};function emitEvent(_0x1921ad){return function(_0x47919b,_0x4561ba,_0x2dd43f){ChatMessageEvents[_0x28e0('0x6')](_0x1921ad+':'+_0x47919b['id'],_0x47919b);ChatMessageEvents[_0x28e0('0x6')](_0x1921ad,_0x47919b);_0x2dd43f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x28e0('0x7')](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 fbf9e0d..a6e3a8b 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 _0x0953=['../../config/environment','exports','ChatMessage','chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0953,0xa6));var _0x3095=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x0953[_0xadde88];return _0x3b8eb6;};'use strict';var _=require('lodash');var util=require(_0x3095('0x0'));var logger=require(_0x3095('0x1'))(_0x3095('0x2'));var moment=require(_0x3095('0x3'));var BPromise=require(_0x3095('0x4'));var rp=require(_0x3095('0x5'));var fs=require('fs');var path=require(_0x3095('0x6'));var rimraf=require(_0x3095('0x7'));var config=require(_0x3095('0x8'));var attributes=require('./chatMessage.attributes');module[_0x3095('0x9')]=function(_0x1d00ad,_0xb88803){return _0x1d00ad['define'](_0x3095('0xa'),attributes,{'tableName':_0x3095('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3095('0xc')],'type':_0x3095('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x449941,_0x5cac0a,_0x26d29e){var _0x138d2a=_0x1d00ad['models'];var _0x5a7567=_0x449941[_0x3095('0xe')]({'plain':!![]});if(_0x5a7567['direction'][_0x3095('0xf')]()==='in'||_0x5a7567[_0x3095('0x10')][_0x3095('0xf')]()===_0x3095('0x11')&&!_0x5a7567[_0x3095('0x12')]&&!_[_0x3095('0x13')](_0x5a7567[_0x3095('0x14')])){_0x138d2a[_0x3095('0x15')][_0x3095('0x16')]({'where':{'id':_0x5a7567['ChatInteractionId']}})[_0x3095('0x17')](function(_0x2e2736){if(_0x2e2736){_0x2e2736[_0x3095('0x18')]({'lastMsgAt':_0x5a7567['createdAt'],'lastMsgDirection':_0x5a7567[_0x3095('0x10')][_0x3095('0xf')]()});}})[_0x3095('0x19')](function(_0x7269ce){console[_0x3095('0x1a')](_0x7269ce);});}_0x26d29e();}},'charset':_0x3095('0x1b'),'collate':_0x3095('0x1c')});}; \ No newline at end of file +var _0xfebb=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4_unicode_ci','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfebb,0x16b));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfeb('0x0'));var util=require(_0xbfeb('0x1'));var logger=require(_0xbfeb('0x2'))(_0xbfeb('0x3'));var moment=require(_0xbfeb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbfeb('0x5'));var fs=require('fs');var path=require(_0xbfeb('0x6'));var rimraf=require('rimraf');var config=require(_0xbfeb('0x7'));var attributes=require(_0xbfeb('0x8'));module[_0xbfeb('0x9')]=function(_0x4f594f,_0xd257aa){return _0x4f594f[_0xbfeb('0xa')](_0xbfeb('0xb'),attributes,{'tableName':_0xbfeb('0xc'),'paranoid':![],'indexes':[{'name':_0xbfeb('0xd'),'fields':[_0xbfeb('0xe')],'type':_0xbfeb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x673bd1,_0x42bba1,_0x344888){var _0x3b3bfa=_0x4f594f['models'];var _0x4ef001=_0x673bd1['get']({'plain':!![]});if(_0x4ef001[_0xbfeb('0x10')][_0xbfeb('0x11')]()==='in'||_0x4ef001[_0xbfeb('0x10')][_0xbfeb('0x11')]()==='out'&&!_0x4ef001['secret']&&!_['isNil'](_0x4ef001[_0xbfeb('0x12')])){_0x3b3bfa[_0xbfeb('0x13')][_0xbfeb('0x14')]({'where':{'id':_0x4ef001[_0xbfeb('0x15')]}})[_0xbfeb('0x16')](function(_0x1ca3c1){if(_0x1ca3c1){_0x1ca3c1['update']({'lastMsgAt':_0x4ef001[_0xbfeb('0x17')],'lastMsgDirection':_0x4ef001[_0xbfeb('0x10')][_0xbfeb('0x11')]()});}})[_0xbfeb('0x18')](function(_0x4cdb31){console['error'](_0x4cdb31);});}_0x344888();}},'charset':'utf8mb4','collate':_0xbfeb('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 320edbe..2e9848a 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 _0xf333=['request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x255a1a,_0x20732e){var _0x15520e=function(_0x17ecec){while(--_0x17ecec){_0x255a1a['push'](_0x255a1a['shift']());}};_0x15520e(++_0x20732e);}(_0xf333,0x1aa));var _0x3f33=function(_0x47007f,_0x308aa8){_0x47007f=_0x47007f-0x0;var _0x35a754=_0xf333[_0x47007f];return _0x35a754;};'use strict';var _=require(_0x3f33('0x0'));var util=require('util');var moment=require(_0x3f33('0x1'));var BPromise=require(_0x3f33('0x2'));var rs=require(_0x3f33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f33('0x4'))['db'];var utils=require(_0x3f33('0x5'));var logger=require(_0x3f33('0x6'))('rpc');var config=require(_0x3f33('0x7'));var jayson=require(_0x3f33('0x8'));var client=jayson[_0x3f33('0x9')][_0x3f33('0xa')]({'port':0x232a});config[_0x3f33('0xb')]=_[_0x3f33('0xc')](config[_0x3f33('0xb')],{'host':_0x3f33('0xd'),'port':0x18eb});var socket=require(_0x3f33('0xe'))(new Redis(config['redis']));require(_0x3f33('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a0bd,_0x11e10a,_0xfed22c){return new BPromise(function(_0x4f85da,_0x344f38){return client[_0x3f33('0x10')](_0x54a0bd,_0xfed22c)[_0x3f33('0x11')](function(_0x201736){logger[_0x3f33('0x12')](_0x3f33('0x13'),_0x11e10a,_0x3f33('0x14'));logger[_0x3f33('0x15')](_0x3f33('0x16'),_0x11e10a,_0x3f33('0x14'),JSON[_0x3f33('0x17')](_0x201736));if(_0x201736[_0x3f33('0x18')]){if(_0x201736[_0x3f33('0x18')][_0x3f33('0x19')]===0x1f4){logger['error'](_0x3f33('0x13'),_0x11e10a,_0x201736[_0x3f33('0x18')][_0x3f33('0x1a')]);return _0x344f38(_0x201736[_0x3f33('0x18')][_0x3f33('0x1a')]);}logger[_0x3f33('0x18')]('ChatMessage,\x20%s,\x20%s',_0x11e10a,_0x201736[_0x3f33('0x18')][_0x3f33('0x1a')]);return _0x4f85da(_0x201736[_0x3f33('0x18')][_0x3f33('0x1a')]);}else{logger['info'](_0x3f33('0x13'),_0x11e10a,_0x3f33('0x14'));_0x4f85da(_0x201736[_0x3f33('0x1b')][_0x3f33('0x1a')]);}})['catch'](function(_0x6db675){logger[_0x3f33('0x18')](_0x3f33('0x13'),_0x11e10a,_0x6db675);_0x344f38(_0x6db675);});});}exports[_0x3f33('0x1c')]=function(_0x1ec6fa){var _0x1cdc18=this;return new Promise(function(_0x1c9227,_0x46098e){return db[_0x3f33('0x1d')][_0x3f33('0x1e')](_0x1ec6fa[_0x3f33('0x1f')],{'raw':_0x1ec6fa['options']?_0x1ec6fa['options'][_0x3f33('0x20')]===undefined?!![]:![]:!![]})[_0x3f33('0x11')](function(_0x4be0b7){logger['info'](_0x3f33('0x1c'),_0x1ec6fa);logger[_0x3f33('0x15')](_0x3f33('0x1c'),_0x1ec6fa,JSON[_0x3f33('0x17')](_0x4be0b7));_0x1c9227(_0x4be0b7);})[_0x3f33('0x21')](function(_0x56d280){logger['error'](_0x3f33('0x1c'),_0x56d280[_0x3f33('0x1a')],_0x1ec6fa);_0x46098e(_0x1cdc18[_0x3f33('0x18')](0x1f4,_0x56d280['message']));});});}; \ No newline at end of file +var _0x83ec=['ChatMessage,\x20%s,\x20%s','message','create','options','raw','CreateChatMessage','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5669a5,_0x5cbb95){var _0x3995ef=function(_0x2ad6d3){while(--_0x2ad6d3){_0x5669a5['push'](_0x5669a5['shift']());}};_0x3995ef(++_0x5cbb95);}(_0x83ec,0x1bb));var _0xc83e=function(_0x2a623f,_0x275a97){_0x2a623f=_0x2a623f-0x0;var _0x2cdca2=_0x83ec[_0x2a623f];return _0x2cdca2;};'use strict';var _=require(_0xc83e('0x0'));var util=require('util');var moment=require(_0xc83e('0x1'));var BPromise=require(_0xc83e('0x2'));var rs=require(_0xc83e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc83e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc83e('0x5'));var config=require(_0xc83e('0x6'));var jayson=require(_0xc83e('0x7'));var client=jayson[_0xc83e('0x8')]['http']({'port':0x232a});config[_0xc83e('0x9')]=_[_0xc83e('0xa')](config['redis'],{'host':_0xc83e('0xb'),'port':0x18eb});var socket=require(_0xc83e('0xc'))(new Redis(config[_0xc83e('0x9')]));require(_0xc83e('0xd'))['register'](socket);function respondWithRpcPromise(_0x26a8fe,_0x145131,_0x2c3f91){return new BPromise(function(_0x1909eb,_0x44ee43){return client['request'](_0x26a8fe,_0x2c3f91)[_0xc83e('0xe')](function(_0x472f95){logger[_0xc83e('0xf')]('ChatMessage,\x20%s,\x20%s',_0x145131,'request\x20sent');logger['debug'](_0xc83e('0x10'),_0x145131,_0xc83e('0x11'),JSON[_0xc83e('0x12')](_0x472f95));if(_0x472f95[_0xc83e('0x13')]){if(_0x472f95[_0xc83e('0x13')][_0xc83e('0x14')]===0x1f4){logger[_0xc83e('0x13')](_0xc83e('0x15'),_0x145131,_0x472f95[_0xc83e('0x13')][_0xc83e('0x16')]);return _0x44ee43(_0x472f95['error'][_0xc83e('0x16')]);}logger[_0xc83e('0x13')](_0xc83e('0x15'),_0x145131,_0x472f95[_0xc83e('0x13')][_0xc83e('0x16')]);return _0x1909eb(_0x472f95[_0xc83e('0x13')][_0xc83e('0x16')]);}else{logger[_0xc83e('0xf')](_0xc83e('0x15'),_0x145131,_0xc83e('0x11'));_0x1909eb(_0x472f95['result'][_0xc83e('0x16')]);}})['catch'](function(_0x4c5889){logger[_0xc83e('0x13')]('ChatMessage,\x20%s,\x20%s',_0x145131,_0x4c5889);_0x44ee43(_0x4c5889);});});}exports['CreateChatMessage']=function(_0x41b0f9){var _0xf24e95=this;return new Promise(function(_0x36ffa4,_0x533197){return db['ChatMessage'][_0xc83e('0x17')](_0x41b0f9['body'],{'raw':_0x41b0f9['options']?_0x41b0f9[_0xc83e('0x18')][_0xc83e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x545ff3){logger[_0xc83e('0xf')](_0xc83e('0x1a'),_0x41b0f9);logger[_0xc83e('0x1b')]('CreateChatMessage',_0x41b0f9,JSON[_0xc83e('0x12')](_0x545ff3));_0x36ffa4(_0x545ff3);})[_0xc83e('0x1c')](function(_0x4b0a0f){logger[_0xc83e('0x13')](_0xc83e('0x1a'),_0x4b0a0f[_0xc83e('0x16')],_0x41b0f9);_0x533197(_0xf24e95[_0xc83e('0x13')](0x1f4,_0x4b0a0f[_0xc83e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 898a306..e6fdee2 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 _0x0295=['emit','removeListener','register','chatMessage:','./chatMessage.events','update'];(function(_0x37b9a1,_0x43fbd1){var _0x4fe63d=function(_0x23083f){while(--_0x23083f){_0x37b9a1['push'](_0x37b9a1['shift']());}};_0x4fe63d(++_0x43fbd1);}(_0x0295,0x1f0));var _0x5029=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x0295[_0x15dbca];return _0x326533;};'use strict';var ChatMessageEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){ChatMessageEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);ChatMessageEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0x1967=['remove','update','emit','removeListener','length','save'];(function(_0xfc8a66,_0x23e658){var _0x561927=function(_0x2e309c){while(--_0x2e309c){_0xfc8a66['push'](_0xfc8a66['shift']());}};_0x561927(++_0x23e658);}(_0x1967,0x173));var _0x7196=function(_0x31a5dd,_0x1ee33d){_0x31a5dd=_0x31a5dd-0x0;var _0x2052e8=_0x1967[_0x31a5dd];return _0x2052e8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2')];function createListener(_0x35803d,_0x3319fa){return function(_0xa80a3f){_0x3319fa[_0x7196('0x3')](_0x35803d,_0xa80a3f);};}function removeListener(_0x1aaddd,_0x458ae8){return function(){ChatMessageEvents[_0x7196('0x4')](_0x1aaddd,_0x458ae8);};}exports['register']=function(_0x36b01e){for(var _0x186175=0x0,_0x194746=events[_0x7196('0x5')];_0x186175<_0x194746;_0x186175++){var _0x266a6e=events[_0x186175];var _0xad78a=createListener('chatMessage:'+_0x266a6e,_0x36b01e);ChatMessageEvents['on'](_0x266a6e,_0xad78a);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 7c65694..f3ad7e0 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 _0x68ee=['/:id/accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put'];(function(_0x113805,_0x4a4013){var _0x4b1b4b=function(_0x57ec92){while(--_0x57ec92){_0x113805['push'](_0x113805['shift']());}};_0x4b1b4b(++_0x4a4013);}(_0x68ee,0x13e));var _0xe68e=function(_0x5dfb3e,_0x241b5b){_0x5dfb3e=_0x5dfb3e-0x0;var _0x3f8a7b=_0x68ee[_0x5dfb3e];return _0x3f8a7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe68e('0x0'));var timeout=require(_0xe68e('0x1'));var express=require('express');var router=express[_0xe68e('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe68e('0x3'));var config=require(_0xe68e('0x4'));var controller=require('./chatMessage.controller');router[_0xe68e('0x5')]('/',auth[_0xe68e('0x6')](),controller[_0xe68e('0x7')]);router[_0xe68e('0x5')](_0xe68e('0x8'),auth[_0xe68e('0x6')](),controller[_0xe68e('0x9')]);router[_0xe68e('0x5')](_0xe68e('0xa'),auth['isAuthenticated'](),controller[_0xe68e('0xb')]);router[_0xe68e('0xc')]('/',auth[_0xe68e('0x6')](),interaction[_0xe68e('0xd')](_0xe68e('0xe'),_0xe68e('0xf')),controller[_0xe68e('0x10')]);router[_0xe68e('0x11')]('/:id',controller['update']);router[_0xe68e('0x11')](_0xe68e('0x12'),auth[_0xe68e('0x6')](),controller['accept']);router[_0xe68e('0x11')](_0xe68e('0x13'),auth[_0xe68e('0x6')](),controller[_0xe68e('0x14')]);router[_0xe68e('0x15')](_0xe68e('0xa'),auth['isAuthenticated'](),controller[_0xe68e('0x16')]);module[_0xe68e('0x17')]=router; \ No newline at end of file +var _0xc163=['update','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/:id','post','tracked','chat','chatmessage:create','put'];(function(_0x42ab81,_0x5e8d63){var _0x37f3c0=function(_0x19e4e2){while(--_0x19e4e2){_0x42ab81['push'](_0x42ab81['shift']());}};_0x37f3c0(++_0x5e8d63);}(_0xc163,0x13a));var _0x3c16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc163[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3c16('0x0'));var util=require(_0x3c16('0x1'));var path=require(_0x3c16('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c16('0x3'));var router=express['Router']();var auth=require(_0x3c16('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3c16('0x5'));var controller=require(_0x3c16('0x6'));router['get']('/',auth[_0x3c16('0x7')](),controller[_0x3c16('0x8')]);router[_0x3c16('0x9')]('/describe',auth[_0x3c16('0x7')](),controller['describe']);router[_0x3c16('0x9')](_0x3c16('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3c16('0xb')]('/',auth[_0x3c16('0x7')](),interaction[_0x3c16('0xc')](_0x3c16('0xd'),_0x3c16('0xe')),controller['create']);router[_0x3c16('0xf')](_0x3c16('0xa'),controller[_0x3c16('0x10')]);router[_0x3c16('0xf')]('/:id/accept',auth[_0x3c16('0x7')](),controller['accept']);router[_0x3c16('0xf')](_0x3c16('0x11'),auth[_0x3c16('0x7')](),controller[_0x3c16('0x12')]);router[_0x3c16('0x13')]('/:id',auth[_0x3c16('0x7')](),controller[_0x3c16('0x14')]);module[_0x3c16('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 12e3503..84c0c01 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 _0xc428=['exports','medium'];(function(_0x223dbe,_0x3d3502){var _0x8bbb59=function(_0x490923){while(--_0x490923){_0x223dbe['push'](_0x223dbe['shift']());}};_0x8bbb59(++_0x3d3502);}(_0xc428,0xf0));var _0x8c42=function(_0xf60719,_0x2f4e16){_0xf60719=_0xf60719-0x0;var _0x3d8beb=_0xc428[_0xf60719];return _0x3d8beb;};'use strict';var Sequelize=require('sequelize');module[_0x8c42('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8c42('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x9b75=['medium','sequelize','TEXT'];(function(_0x2d49ee,_0x445589){var _0x4f3888=function(_0x4d2005){while(--_0x4d2005){_0x2d49ee['push'](_0x2d49ee['shift']());}};_0x4f3888(++_0x445589);}(_0x9b75,0x11e));var _0x59b7=function(_0xb4a369,_0x4cf2d4){_0xb4a369=_0xb4a369-0x0;var _0x11846e=_0x9b75[_0xb4a369];return _0x11846e;};'use strict';var Sequelize=require(_0x59b7('0x0'));module['exports']={'body':{'type':Sequelize[_0x59b7('0x1')](_0x59b7('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 83500c6..763bd69 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 _0xe14b=['findAll','rows','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x3a0472,_0x2df1ba){var _0x441e52=function(_0x20e31d){while(--_0x20e31d){_0x3a0472['push'](_0x3a0472['shift']());}};_0x441e52(++_0x2df1ba);}(_0xe14b,0x93));var _0xbe14=function(_0x3dfea3,_0x5ddc8f){_0x3dfea3=_0x3dfea3-0x0;var _0x814726=_0xe14b[_0x3dfea3];return _0x814726;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]),_0x29fc64);if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['ChatOfflineMessage'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));};exports[_0xbe14('0x44')]=function(_0x494c32,_0x3a221b){return db[_0xbe14('0x25')][_0xbe14('0x44')]()[_0xbe14('0x20')](respondWithResult(_0x3a221b,null))[_0xbe14('0x3e')](handleError(_0x3a221b,null));}; \ No newline at end of file +var _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']),_0x23b061);if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['ChatOfflineMessage']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['ChatOfflineMessage'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['ChatOfflineMessage'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['ChatOfflineMessage'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index e07b255..12bf3fc 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 _0x948d=['rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path'];(function(_0x3ce904,_0x117015){var _0x154e67=function(_0x5c8705){while(--_0x5c8705){_0x3ce904['push'](_0x3ce904['shift']());}};_0x154e67(++_0x117015);}(_0x948d,0x125));var _0xd948=function(_0x13a5c8,_0x1b0aca){_0x13a5c8=_0x13a5c8-0x0;var _0x531acd=_0x948d[_0x13a5c8];return _0x531acd;};'use strict';var _=require(_0xd948('0x0'));var util=require(_0xd948('0x1'));var logger=require(_0xd948('0x2'))(_0xd948('0x3'));var moment=require(_0xd948('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd948('0x5'));var rimraf=require(_0xd948('0x6'));var config=require('../../config/environment');var attributes=require(_0xd948('0x7'));module['exports']=function(_0x517de5,_0x5af1b4){return _0x517de5[_0xd948('0x8')](_0xd948('0x9'),attributes,{'tableName':_0xd948('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd948('0xb'),'collate':_0xd948('0xc')});}; \ No newline at end of file +var _0x441b=['utf8mb4','lodash','api','moment','bluebird','path','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x441b,0xab));var _0xb441=function(_0x399124,_0x34f584){_0x399124=_0x399124-0x0;var _0x355e09=_0x441b[_0x399124];return _0x355e09;};'use strict';var _=require(_0xb441('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb441('0x1'));var moment=require(_0xb441('0x2'));var BPromise=require(_0xb441('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb441('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module[_0xb441('0x5')]=function(_0x5ce4e4,_0x298b6a){return _0x5ce4e4[_0xb441('0x6')](_0xb441('0x7'),attributes,{'tableName':_0xb441('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb441('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 473b21b..4ea81a0 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 _0x7401=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','randomstring'];(function(_0x2c41f9,_0x550191){var _0x5f3d76=function(_0x19ff0c){while(--_0x19ff0c){_0x2c41f9['push'](_0x2c41f9['shift']());}};_0x5f3d76(++_0x550191);}(_0x7401,0x139));var _0x1740=function(_0x5453c2,_0x51e0eb){_0x5453c2=_0x5453c2-0x0;var _0x191dc2=_0x7401[_0x5453c2];return _0x191dc2;};'use strict';var _=require('lodash');var util=require(_0x1740('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1740('0x1'));var fs=require('fs');var Redis=require(_0x1740('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1740('0x3'));var logger=require('../../config/logger')(_0x1740('0x4'));var config=require(_0x1740('0x5'));var jayson=require(_0x1740('0x6'));var client=jayson[_0x1740('0x7')][_0x1740('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d2fd8,_0x546efb,_0x5bd1a5){return new BPromise(function(_0x263f39,_0x398983){return client[_0x1740('0x9')](_0x3d2fd8,_0x5bd1a5)[_0x1740('0xa')](function(_0x200edf){logger['info'](_0x1740('0xb'),_0x546efb,'request\x20sent');logger[_0x1740('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x546efb,_0x1740('0xd'),JSON[_0x1740('0xe')](_0x200edf));if(_0x200edf['error']){if(_0x200edf[_0x1740('0xf')][_0x1740('0x10')]===0x1f4){logger['error'](_0x1740('0xb'),_0x546efb,_0x200edf[_0x1740('0xf')][_0x1740('0x11')]);return _0x398983(_0x200edf['error'][_0x1740('0x11')]);}logger[_0x1740('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x546efb,_0x200edf['error'][_0x1740('0x11')]);return _0x263f39(_0x200edf[_0x1740('0xf')][_0x1740('0x11')]);}else{logger[_0x1740('0x12')](_0x1740('0xb'),_0x546efb,'request\x20sent');_0x263f39(_0x200edf[_0x1740('0x13')][_0x1740('0x11')]);}})[_0x1740('0x14')](function(_0x252e54){logger['error'](_0x1740('0xb'),_0x546efb,_0x252e54);_0x398983(_0x252e54);});});} \ No newline at end of file +var _0x1456=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x1456,0x99));var _0x6145=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x1456[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0x6145('0x0'));var util=require(_0x6145('0x1'));var moment=require(_0x6145('0x2'));var BPromise=require('bluebird');var rs=require(_0x6145('0x3'));var fs=require('fs');var Redis=require(_0x6145('0x4'));var db=require(_0x6145('0x5'))['db'];var utils=require(_0x6145('0x6'));var logger=require('../../config/logger')(_0x6145('0x7'));var config=require(_0x6145('0x8'));var jayson=require(_0x6145('0x9'));var client=jayson[_0x6145('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19b17e,_0x150706,_0x5cfeac){return new BPromise(function(_0x4f78c6,_0x26e98e){return client[_0x6145('0xb')](_0x19b17e,_0x5cfeac)[_0x6145('0xc')](function(_0x240fcb){logger[_0x6145('0xd')](_0x6145('0xe'),_0x150706,_0x6145('0xf'));logger[_0x6145('0x10')](_0x6145('0x11'),_0x150706,_0x6145('0xf'),JSON[_0x6145('0x12')](_0x240fcb));if(_0x240fcb[_0x6145('0x13')]){if(_0x240fcb[_0x6145('0x13')][_0x6145('0x14')]===0x1f4){logger[_0x6145('0x13')](_0x6145('0xe'),_0x150706,_0x240fcb[_0x6145('0x13')][_0x6145('0x15')]);return _0x26e98e(_0x240fcb[_0x6145('0x13')][_0x6145('0x15')]);}logger[_0x6145('0x13')](_0x6145('0xe'),_0x150706,_0x240fcb[_0x6145('0x13')][_0x6145('0x15')]);return _0x4f78c6(_0x240fcb[_0x6145('0x13')][_0x6145('0x15')]);}else{logger[_0x6145('0xd')](_0x6145('0xe'),_0x150706,'request\x20sent');_0x4f78c6(_0x240fcb[_0x6145('0x16')][_0x6145('0x15')]);}})[_0x6145('0x17')](function(_0x536a7c){logger[_0x6145('0x13')](_0x6145('0xe'),_0x150706,_0x536a7c);_0x26e98e(_0x536a7c);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 75282e2..922e9b9 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 _0xa136=['./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x2e5e63,_0x25a5ea){var _0x5aa70a=function(_0x321b15){while(--_0x321b15){_0x2e5e63['push'](_0x2e5e63['shift']());}};_0x5aa70a(++_0x25a5ea);}(_0xa136,0x9a));var _0x6a13=function(_0x1afedc,_0x17ee2f){_0x1afedc=_0x1afedc-0x0;var _0x3520db=_0xa136[_0x1afedc];return _0x3520db;};'use strict';var multer=require(_0x6a13('0x0'));var util=require(_0x6a13('0x1'));var path=require(_0x6a13('0x2'));var timeout=require(_0x6a13('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6a13('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6a13('0x5'));var controller=require(_0x6a13('0x6'));router['get']('/',auth[_0x6a13('0x7')](),controller[_0x6a13('0x8')]);router['get'](_0x6a13('0x9'),auth[_0x6a13('0x7')](),controller[_0x6a13('0xa')]);router[_0x6a13('0xb')](_0x6a13('0xc'),auth[_0x6a13('0x7')](),controller[_0x6a13('0xd')]);router[_0x6a13('0xe')]('/',auth['isAuthenticated'](),controller[_0x6a13('0xf')]);router['put']('/:id',auth[_0x6a13('0x7')](),controller[_0x6a13('0x10')]);router[_0x6a13('0x11')]('/:id',auth[_0x6a13('0x7')](),controller[_0x6a13('0x12')]);module[_0x6a13('0x13')]=router; \ No newline at end of file +var _0x9bb9=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','delete'];(function(_0x492850,_0x280443){var _0x254a15=function(_0x59725c){while(--_0x59725c){_0x492850['push'](_0x492850['shift']());}};_0x254a15(++_0x280443);}(_0x9bb9,0x1e8));var _0x99bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bb9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x99bb('0x0'));var util=require(_0x99bb('0x1'));var path=require('path');var timeout=require(_0x99bb('0x2'));var express=require(_0x99bb('0x3'));var router=express[_0x99bb('0x4')]();var auth=require(_0x99bb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x99bb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x99bb('0x7')]);router[_0x99bb('0x8')](_0x99bb('0x9'),auth[_0x99bb('0xa')](),controller[_0x99bb('0xb')]);router[_0x99bb('0x8')](_0x99bb('0xc'),auth[_0x99bb('0xa')](),controller['show']);router[_0x99bb('0xd')]('/',auth[_0x99bb('0xa')](),controller[_0x99bb('0xe')]);router['put'](_0x99bb('0xc'),auth[_0x99bb('0xa')](),controller['update']);router[_0x99bb('0xf')]('/:id',auth[_0x99bb('0xa')](),controller[_0x99bb('0x10')]);module[_0x99bb('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index d179f80..d8982e2 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 _0xbbac=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x14b9de,_0x59d7a6){var _0x3406b9=function(_0x27a000){while(--_0x27a000){_0x14b9de['push'](_0x14b9de['shift']());}};_0x3406b9(++_0x59d7a6);}(_0xbbac,0x193));var _0xcbba=function(_0x27ffad,_0x5959ad){_0x27ffad=_0x27ffad-0x0;var _0x537d8d=_0xbbac[_0x27ffad];return _0x537d8d;};'use strict';var Sequelize=require(_0xcbba('0x0'));module[_0xcbba('0x1')]={'name':{'type':Sequelize[_0xcbba('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcbba('0x3')](_0xcbba('0x4'),_0xcbba('0x5')),'defaultValue':_0xcbba('0x4')},'selector':{'type':Sequelize[_0xcbba('0x2')]},'timeout':{'type':Sequelize[_0xcbba('0x6')]}}; \ No newline at end of file +var _0x29e7=['ENUM','timeout','mouseOver','sequelize','STRING'];(function(_0xbfc389,_0x5aad2e){var _0x31583a=function(_0x3fddcd){while(--_0x3fddcd){_0xbfc389['push'](_0xbfc389['shift']());}};_0x31583a(++_0x5aad2e);}(_0x29e7,0x107));var _0x729e=function(_0xbe8a1e,_0x34b388){_0xbe8a1e=_0xbe8a1e-0x0;var _0x359277=_0x29e7[_0xbe8a1e];return _0x359277;};'use strict';var Sequelize=require(_0x729e('0x0'));module['exports']={'name':{'type':Sequelize[_0x729e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x729e('0x2')]('mouseOver',_0x729e('0x3')),'defaultValue':_0x729e('0x4')},'selector':{'type':Sequelize[_0x729e('0x1')]},'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 36e70f4..a290262 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 _0x70e0=['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','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x1e9856,_0x422149){var _0xb2055a=function(_0x3f4f21){while(--_0x3f4f21){_0x1e9856['push'](_0x1e9856['shift']());}};_0xb2055a(++_0x422149);}(_0x70e0,0x17b));var _0x070e=function(_0x2620a9,_0x2b085c){_0x2620a9=_0x2620a9-0x0;var _0x4f5bf4=_0x70e0[_0x2620a9];return _0x4f5bf4;};'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'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,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(_0xe28139,_0x427723){var _0x17a410=function(_0xcda3d){while(--_0xcda3d){_0xe28139['push'](_0xe28139['shift']());}};_0x17a410(++_0x427723);}(_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 3a9b2b6..0aea584 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 _0x4ac6=['./chatProactiveAction.attributes','exports','define','chat_proactive_actions','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x283434,_0x42ec32){var _0x176042=function(_0x214096){while(--_0x214096){_0x283434['push'](_0x283434['shift']());}};_0x176042(++_0x42ec32);}(_0x4ac6,0x1b2));var _0x64ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ac6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x64ac('0x0'));var BPromise=require(_0x64ac('0x1'));var rp=require(_0x64ac('0x2'));var fs=require('fs');var path=require(_0x64ac('0x3'));var rimraf=require(_0x64ac('0x4'));var config=require(_0x64ac('0x5'));var attributes=require(_0x64ac('0x6'));module[_0x64ac('0x7')]=function(_0x309189,_0x349fcf){return _0x309189[_0x64ac('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x64ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf981=['moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','api'];(function(_0x493b19,_0x19b6bc){var _0x1cbab8=function(_0x4a1576){while(--_0x4a1576){_0x493b19['push'](_0x493b19['shift']());}};_0x1cbab8(++_0x19b6bc);}(_0xf981,0x8a));var _0x1f98=function(_0x36bd10,_0x4c8261){_0x36bd10=_0x36bd10-0x0;var _0x18327a=_0xf981[_0x36bd10];return _0x18327a;};'use strict';var _=require(_0x1f98('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f98('0x1'));var moment=require(_0x1f98('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f98('0x3'));var rimraf=require(_0x1f98('0x4'));var config=require(_0x1f98('0x5'));var attributes=require(_0x1f98('0x6'));module[_0x1f98('0x7')]=function(_0xca4d71,_0xac53d9){return _0xca4d71['define'](_0x1f98('0x8'),attributes,{'tableName':_0x1f98('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index a8155e2..20fe2bd 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 _0xddbc=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2ce667,_0x1bf6f7){var _0xf43dcd=function(_0x520c01){while(--_0x520c01){_0x2ce667['push'](_0x2ce667['shift']());}};_0xf43dcd(++_0x1bf6f7);}(_0xddbc,0xf2));var _0xcddb=function(_0x1218e9,_0x2c8ea4){_0x1218e9=_0x1218e9-0x0;var _0x54bb2e=_0xddbc[_0x1218e9];return _0x54bb2e;};'use strict';var _=require(_0xcddb('0x0'));var util=require(_0xcddb('0x1'));var moment=require(_0xcddb('0x2'));var BPromise=require(_0xcddb('0x3'));var rs=require(_0xcddb('0x4'));var fs=require('fs');var Redis=require(_0xcddb('0x5'));var db=require(_0xcddb('0x6'))['db'];var utils=require(_0xcddb('0x7'));var logger=require('../../config/logger')(_0xcddb('0x8'));var config=require(_0xcddb('0x9'));var jayson=require(_0xcddb('0xa'));var client=jayson[_0xcddb('0xb')][_0xcddb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ba1a9,_0x3ee837,_0x35e014){return new BPromise(function(_0xfb9aa3,_0x2bf5fc){return client[_0xcddb('0xd')](_0x2ba1a9,_0x35e014)[_0xcddb('0xe')](function(_0x3ab574){logger[_0xcddb('0xf')](_0xcddb('0x10'),_0x3ee837,'request\x20sent');logger[_0xcddb('0x11')](_0xcddb('0x12'),_0x3ee837,_0xcddb('0x13'),JSON['stringify'](_0x3ab574));if(_0x3ab574['error']){if(_0x3ab574[_0xcddb('0x14')][_0xcddb('0x15')]===0x1f4){logger['error'](_0xcddb('0x10'),_0x3ee837,_0x3ab574[_0xcddb('0x14')]['message']);return _0x2bf5fc(_0x3ab574[_0xcddb('0x14')][_0xcddb('0x16')]);}logger[_0xcddb('0x14')](_0xcddb('0x10'),_0x3ee837,_0x3ab574[_0xcddb('0x14')][_0xcddb('0x16')]);return _0xfb9aa3(_0x3ab574[_0xcddb('0x14')][_0xcddb('0x16')]);}else{logger[_0xcddb('0xf')](_0xcddb('0x10'),_0x3ee837,_0xcddb('0x13'));_0xfb9aa3(_0x3ab574['result'][_0xcddb('0x16')]);}})[_0xcddb('0x17')](function(_0x727f60){logger['error'](_0xcddb('0x10'),_0x3ee837,_0x727f60);_0x2bf5fc(_0x727f60);});});} \ No newline at end of file +var _0x07b8=['info','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x55ec67,_0x1c90d5){var _0x1350f6=function(_0x5ed223){while(--_0x5ed223){_0x55ec67['push'](_0x55ec67['shift']());}};_0x1350f6(++_0x1c90d5);}(_0x07b8,0xf6));var _0x807b=function(_0x18d50f,_0x124aff){_0x18d50f=_0x18d50f-0x0;var _0x8ce385=_0x07b8[_0x18d50f];return _0x8ce385;};'use strict';var _=require('lodash');var util=require(_0x807b('0x0'));var moment=require(_0x807b('0x1'));var BPromise=require('bluebird');var rs=require(_0x807b('0x2'));var fs=require('fs');var Redis=require(_0x807b('0x3'));var db=require(_0x807b('0x4'))['db'];var utils=require(_0x807b('0x5'));var logger=require('../../config/logger')(_0x807b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x807b('0x7')][_0x807b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d79d,_0x3a0212,_0x3e91e4){return new BPromise(function(_0x28115b,_0x24baec){return client[_0x807b('0x9')](_0x5d79d,_0x3e91e4)['then'](function(_0x4d580d){logger[_0x807b('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a0212,_0x807b('0xb'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3a0212,_0x807b('0xb'),JSON['stringify'](_0x4d580d));if(_0x4d580d['error']){if(_0x4d580d[_0x807b('0xc')][_0x807b('0xd')]===0x1f4){logger[_0x807b('0xc')](_0x807b('0xe'),_0x3a0212,_0x4d580d['error'][_0x807b('0xf')]);return _0x24baec(_0x4d580d[_0x807b('0xc')][_0x807b('0xf')]);}logger[_0x807b('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a0212,_0x4d580d[_0x807b('0xc')][_0x807b('0xf')]);return _0x28115b(_0x4d580d[_0x807b('0xc')][_0x807b('0xf')]);}else{logger[_0x807b('0xa')](_0x807b('0xe'),_0x3a0212,'request\x20sent');_0x28115b(_0x4d580d['result']['message']);}})['catch'](function(_0x3c098){logger[_0x807b('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a0212,_0x3c098);_0x24baec(_0x3c098);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f28d9d9..aae56e3 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 _0x46b9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x336adb,_0x1c3608){var _0x5be7f5=function(_0x8cb90b){while(--_0x8cb90b){_0x336adb['push'](_0x336adb['shift']());}};_0x5be7f5(++_0x1c3608);}(_0x46b9,0x13e));var _0x946b=function(_0x2cbe24,_0x223538){_0x2cbe24=_0x2cbe24-0x0;var _0x9fab38=_0x46b9[_0x2cbe24];return _0x9fab38;};'use strict';var multer=require(_0x946b('0x0'));var util=require(_0x946b('0x1'));var path=require('path');var timeout=require(_0x946b('0x2'));var express=require(_0x946b('0x3'));var router=express[_0x946b('0x4')]();var auth=require(_0x946b('0x5'));var interaction=require(_0x946b('0x6'));var config=require(_0x946b('0x7'));var controller=require('./chatProactiveAction.controller');router[_0x946b('0x8')](_0x946b('0x9'),auth[_0x946b('0xa')](),controller['show']);router[_0x946b('0xb')]('/',auth[_0x946b('0xa')](),controller[_0x946b('0xc')]);router[_0x946b('0xd')](_0x946b('0x9'),auth[_0x946b('0xa')](),controller['update']);router[_0x946b('0xe')](_0x946b('0x9'),auth[_0x946b('0xa')](),controller[_0x946b('0xf')]);module[_0x946b('0x10')]=router; \ No newline at end of file +var _0xbb5b=['/:id','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','post'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xbb5b,0x154));var _0xbbb5=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0xbb5b[_0x5180c3];return _0x55c975;};'use strict';var multer=require(_0xbbb5('0x0'));var util=require('util');var path=require(_0xbbb5('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbb5('0x2'));var router=express[_0xbbb5('0x3')]();var auth=require(_0xbbb5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbbb5('0x5'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xbbb5('0x6')](),controller['show']);router[_0xbbb5('0x7')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbbb5('0x8'),auth[_0xbbb5('0x6')](),controller[_0xbbb5('0x9')]);router[_0xbbb5('0xa')]('/:id',auth[_0xbbb5('0x6')](),controller['destroy']);module[_0xbbb5('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 182009b..ca994e1 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 _0x8f78=['sequelize','exports','name','STRING','ENUM','beepall','roundrobin'];(function(_0x156a4d,_0x2d89eb){var _0x1b94b9=function(_0x2c14bc){while(--_0x2c14bc){_0x156a4d['push'](_0x156a4d['shift']());}};_0x1b94b9(++_0x2d89eb);}(_0x8f78,0xb6));var _0x88f7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8f78[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x88f7('0x0'));module[_0x88f7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x88f7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x88f7('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x88f7('0x4')]('rrmemory',_0x88f7('0x5'),_0x88f7('0x6'))}}; \ No newline at end of file +var _0x6a84=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x5c3f80,_0x4c9cd0){var _0x48872c=function(_0x42dc02){while(--_0x42dc02){_0x5c3f80['push'](_0x5c3f80['shift']());}};_0x48872c(++_0x4c9cd0);}(_0x6a84,0x116));var _0x46a8=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x6a84[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x46a8('0x0'));module[_0x46a8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x46a8('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x46a8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x46a8('0x4'),_0x46a8('0x5'),_0x46a8('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 098dc07..e3ba594 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 _0x646d=['ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','jayson/promise','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ChatQueue','includeAll','findAll','catch','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','options','User','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams'];(function(_0x386d0d,_0x23562c){var _0x2ad901=function(_0x36a5aa){while(--_0x36a5aa){_0x386d0d['push'](_0x386d0d['shift']());}};_0x2ad901(++_0x23562c);}(_0x646d,0xbd));var _0xd646=function(_0x36c962,_0x147dfb){_0x36c962=_0x36c962-0x0;var _0x58a4c4=_0x646d[_0x36c962];return _0x58a4c4;};'use strict';var pdf=require(_0xd646('0x0'));var emlformat=require(_0xd646('0x1'));var rimraf=require(_0xd646('0x2'));var zipdir=require(_0xd646('0x3'));var jsonpatch=require(_0xd646('0x4'));var rp=require(_0xd646('0x5'));var moment=require('moment');var BPromise=require(_0xd646('0x6'));var Mustache=require(_0xd646('0x7'));var util=require(_0xd646('0x8'));var path=require(_0xd646('0x9'));var sox=require(_0xd646('0xa'));var csv=require(_0xd646('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd646('0xc'));var squel=require(_0xd646('0xd'));var crypto=require('crypto');var jsforce=require(_0xd646('0xe'));var deskjs=require(_0xd646('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd646('0x10'));var Papa=require('papaparse');var Redis=require(_0xd646('0x11'));var authService=require(_0xd646('0x12'));var qs=require(_0xd646('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd646('0x14'))('api');var utils=require(_0xd646('0x15'));var config=require('../../config/environment');var db=require(_0xd646('0x16'))['db'];config[_0xd646('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd646('0x18'))(new Redis(config[_0xd646('0x17')]));require(_0xd646('0x19'))['register'](socket);var jayson=require(_0xd646('0x1a'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1fe07f,_0x3b4591,_0x5655f0){if(_0x5655f0){var _0x35dcb8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35dcb8['test'](_0x3b4591)){return _0x1fe07f;}else{throw new db[(_0xd646('0x1b'))][(_0xd646('0x1c'))](_0xd646('0x1d'));}}else{return _0x1fe07f;}}function respondWithRpcPromise(_0x14cf3d,_0x476830,_0x4a0df0,_0x21a9a0){return new BPromise(function(_0x256606,_0x596334){var _0x3f9bc3=_0x21a9a0||client;return _0x3f9bc3[_0xd646('0x1e')](_0x14cf3d,_0x4a0df0)[_0xd646('0x1f')](function(_0x191f95){logger['info'](_0xd646('0x20'),_0x476830,_0xd646('0x21'));logger[_0xd646('0x22')](_0xd646('0x23'),_0x476830,_0xd646('0x21'),JSON[_0xd646('0x24')](_0x191f95));if(_0x191f95['error']){if(_0x191f95['error'][_0xd646('0x25')]===0x1f4){logger[_0xd646('0x26')](_0xd646('0x20'),_0x476830,_0x191f95[_0xd646('0x26')]['message']);return _0x596334(_0x191f95[_0xd646('0x26')][_0xd646('0x27')]);}logger[_0xd646('0x26')](_0xd646('0x20'),_0x476830,_0x191f95[_0xd646('0x26')][_0xd646('0x27')]);return _0x256606(_0x191f95['error'][_0xd646('0x27')]);}else{logger[_0xd646('0x28')](_0xd646('0x20'),_0x476830,_0xd646('0x21'));_0x256606(_0x191f95[_0xd646('0x29')][_0xd646('0x27')]);}})['catch'](function(_0x34f3b1){logger[_0xd646('0x26')](_0xd646('0x20'),_0x476830,_0x34f3b1);_0x596334(_0x34f3b1);});});}function respondWithStatusCode(_0x16aadc,_0x39d2b4){_0x39d2b4=_0x39d2b4||0xcc;return function(_0x59d37a){if(_0x59d37a){return _0x16aadc[_0xd646('0x2a')](_0x39d2b4);}return _0x16aadc[_0xd646('0x2b')](_0x39d2b4)['end']();};}function respondWithResult(_0x9e6278,_0x53ae00){_0x53ae00=_0x53ae00||0xc8;return function(_0x2dfcdb){if(_0x2dfcdb){return _0x9e6278['status'](_0x53ae00)[_0xd646('0x2c')](_0x2dfcdb);}};}function respondWithFilteredResult(_0x2d0081,_0x3aa9c7){return function(_0x59cd43){if(_0x59cd43){var _0x21a282=_0x59cd43[_0xd646('0x2d')],_0x1c6b2d=_0x3aa9c7[_0xd646('0x2e')],_0x3b005f=_0x3aa9c7[_0xd646('0x2e')]+_0x3aa9c7[_0xd646('0x2f')],_0x4c3b54;if(_0x3b005f>=_0x21a282){_0x3b005f=_0x21a282;_0x4c3b54=0xc8;}else{_0x4c3b54=0xce;}_0x2d0081[_0xd646('0x2b')](_0x4c3b54);return _0x2d0081['set'](_0xd646('0x30'),_0x1c6b2d+'-'+_0x3b005f+'/'+_0x21a282)[_0xd646('0x2c')](_0x59cd43);}return null;};}function patchUpdates(_0x1d2a6c){return function(_0x5d8da8){try{jsonpatch[_0xd646('0x31')](_0x5d8da8,_0x1d2a6c,!![]);}catch(_0x5980f4){return BPromise[_0xd646('0x32')](_0x5980f4);}return _0x5d8da8[_0xd646('0x33')]();};}function saveUpdates(_0x2f7fe3,_0x15ec89){return function(_0x6ca5b2){if(_0x6ca5b2){return _0x6ca5b2[_0xd646('0x34')](_0x2f7fe3)[_0xd646('0x1f')](function(_0x15e48b){return _0x15e48b;});}return null;};}function removeEntity(_0x34f1f2,_0x4beb43){return function(_0x3545af){if(_0x3545af){return _0x3545af[_0xd646('0x35')]()[_0xd646('0x1f')](function(){var _0x39febb=_0x3545af['get']({'plain':!![]});var _0x5b643f='ChatQueues';return db[_0xd646('0x36')]['destroy']({'where':{'type':_0x5b643f,'resourceId':_0x39febb['id']}})[_0xd646('0x1f')](function(){return _0x3545af;});})[_0xd646('0x1f')](function(){_0x34f1f2[_0xd646('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ffcaf,_0x2e1b09){return function(_0x683e47){if(!_0x683e47){_0x2ffcaf[_0xd646('0x2a')](0x194);}return _0x683e47;};}function handleError(_0xbb5232,_0x5560f6){_0x5560f6=_0x5560f6||0x1f4;return function(_0x436e11){logger[_0xd646('0x26')](_0x436e11[_0xd646('0x37')]);if(_0x436e11['name']){delete _0x436e11[_0xd646('0x38')];}_0xbb5232[_0xd646('0x2b')](_0x5560f6)[_0xd646('0x39')](_0x436e11);};}exports[_0xd646('0x3a')]=function(_0x9384d,_0x4096ec){var _0x1293f8={},_0x19bcf8={},_0x27d321={'count':0x0,'rows':[]};var _0x3b8670=_['map'](db['ChatQueue'][_0xd646('0x3b')],function(_0x586f2a){return{'name':_0x586f2a['fieldName'],'type':_0x586f2a[_0xd646('0x3c')]['key']};});_0x19bcf8[_0xd646('0x3d')]=_[_0xd646('0x3e')](_0x3b8670,'name');_0x19bcf8['query']=_[_0xd646('0x3f')](_0x9384d[_0xd646('0x40')]);_0x19bcf8[_0xd646('0x41')]=_[_0xd646('0x42')](_0x19bcf8[_0xd646('0x3d')],_0x19bcf8['query']);_0x1293f8['attributes']=_[_0xd646('0x42')](_0x19bcf8[_0xd646('0x3d')],qs[_0xd646('0x43')](_0x9384d[_0xd646('0x40')]['fields']));_0x1293f8[_0xd646('0x44')]=_0x1293f8[_0xd646('0x44')]['length']?_0x1293f8[_0xd646('0x44')]:_0x19bcf8[_0xd646('0x3d')];if(!_0x9384d['query'][_0xd646('0x45')](_0xd646('0x46'))){_0x1293f8['limit']=qs['limit'](_0x9384d[_0xd646('0x40')][_0xd646('0x2f')]);_0x1293f8[_0xd646('0x2e')]=qs['offset'](_0x9384d['query']['offset']);}_0x1293f8[_0xd646('0x47')]=qs[_0xd646('0x48')](_0x9384d[_0xd646('0x40')]['sort']);_0x1293f8[_0xd646('0x49')]=qs[_0xd646('0x41')](_[_0xd646('0x4a')](_0x9384d[_0xd646('0x40')],_0x19bcf8[_0xd646('0x41')]),_0x3b8670);if(_0x9384d[_0xd646('0x40')][_0xd646('0x4b')]){_0x1293f8[_0xd646('0x49')]=_['merge'](_0x1293f8[_0xd646('0x49')],{'$or':_[_0xd646('0x3e')](_0x3b8670,function(_0xd5fcc3){if(_0xd5fcc3[_0xd646('0x3c')]!==_0xd646('0x4c')){var _0x256479={};_0x256479[_0xd5fcc3[_0xd646('0x38')]]={'$like':'%'+_0x9384d['query'][_0xd646('0x4b')]+'%'};return _0x256479;}})});}_0x1293f8=_[_0xd646('0x4d')]({},_0x1293f8,_0x9384d['options']);var _0x47b18a={'where':_0x1293f8[_0xd646('0x49')]};return db[_0xd646('0x4e')][_0xd646('0x2d')](_0x47b18a)['then'](function(_0x1d22be){_0x27d321['count']=_0x1d22be;if(_0x9384d['query'][_0xd646('0x4f')]){_0x1293f8['include']=[{'all':!![]}];}return db[_0xd646('0x4e')][_0xd646('0x50')](_0x1293f8);})[_0xd646('0x1f')](function(_0x511b82){_0x27d321['rows']=_0x511b82;return _0x27d321;})[_0xd646('0x1f')](respondWithFilteredResult(_0x4096ec,_0x1293f8))[_0xd646('0x51')](handleError(_0x4096ec,null));};exports['show']=function(_0x3a6b45,_0x3309d8){var _0x5e7af6={'raw':!![],'where':{'id':_0x3a6b45['params']['id']}},_0x5f1c79={};_0x5f1c79['model']=_[_0xd646('0x3f')](db[_0xd646('0x4e')]['rawAttributes']);_0x5f1c79[_0xd646('0x40')]=_['keys'](_0x3a6b45[_0xd646('0x40')]);_0x5f1c79[_0xd646('0x41')]=_[_0xd646('0x42')](_0x5f1c79['model'],_0x5f1c79[_0xd646('0x40')]);_0x5e7af6[_0xd646('0x44')]=_[_0xd646('0x42')](_0x5f1c79['model'],qs[_0xd646('0x43')](_0x3a6b45[_0xd646('0x40')][_0xd646('0x43')]));_0x5e7af6['attributes']=_0x5e7af6['attributes'][_0xd646('0x52')]?_0x5e7af6[_0xd646('0x44')]:_0x5f1c79[_0xd646('0x3d')];if(_0x3a6b45['query'][_0xd646('0x4f')]){_0x5e7af6['include']=[{'all':!![]}];}_0x5e7af6=_[_0xd646('0x4d')]({},_0x5e7af6,_0x3a6b45['options']);return db[_0xd646('0x4e')][_0xd646('0x53')](_0x5e7af6)[_0xd646('0x1f')](handleEntityNotFound(_0x3309d8,null))[_0xd646('0x1f')](respondWithResult(_0x3309d8,null))['catch'](handleError(_0x3309d8,null));};exports[_0xd646('0x54')]=function(_0x14b14c,_0x231cfd){return db[_0xd646('0x4e')]['create'](_0x14b14c[_0xd646('0x55')],{})[_0xd646('0x1f')](function(_0x5d4da5){var _0x194ffd=_0x14b14c[_0xd646('0x56')][_0xd646('0x57')]({'plain':!![]});if(!_0x194ffd)throw new Error(_0xd646('0x58'));if(_0x194ffd[_0xd646('0x59')]===_0xd646('0x56')){var _0xe750d9=_0x5d4da5['get']({'plain':!![]});var _0x2560bf=_0xd646('0x5a');return db[_0xd646('0x5b')][_0xd646('0x53')]({'where':{'name':_0x2560bf,'userProfileId':_0x194ffd[_0xd646('0x5c')]},'raw':!![]})[_0xd646('0x1f')](function(_0x118663){if(_0x118663&&_0x118663[_0xd646('0x5d')]===0x0){return db[_0xd646('0x36')][_0xd646('0x54')]({'name':_0xe750d9['name'],'resourceId':_0xe750d9['id'],'type':_0x118663[_0xd646('0x38')],'sectionId':_0x118663['id']},{})[_0xd646('0x1f')](function(){return _0x5d4da5;});}else{return _0x5d4da5;}})[_0xd646('0x51')](function(_0x4fa12d){logger[_0xd646('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fa12d);throw _0x4fa12d;});}return _0x5d4da5;})['then'](respondWithResult(_0x231cfd,0xc9))[_0xd646('0x51')](handleError(_0x231cfd,null));};exports[_0xd646('0x34')]=function(_0x40eac5,_0x52b9c0){if(_0x40eac5[_0xd646('0x55')]['id']){delete _0x40eac5[_0xd646('0x55')]['id'];}return db[_0xd646('0x4e')][_0xd646('0x53')]({'where':{'id':_0x40eac5['params']['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x52b9c0,null))[_0xd646('0x1f')](saveUpdates(_0x40eac5[_0xd646('0x55')],null))[_0xd646('0x1f')](respondWithResult(_0x52b9c0,null))[_0xd646('0x51')](handleError(_0x52b9c0,null));};exports[_0xd646('0x35')]=function(_0x548b17,_0x4d83e7){return db[_0xd646('0x4e')][_0xd646('0x53')]({'where':{'id':_0x548b17[_0xd646('0x5e')]['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x4d83e7,null))[_0xd646('0x1f')](removeEntity(_0x4d83e7,null))[_0xd646('0x51')](handleError(_0x4d83e7,null));};exports[_0xd646('0x5f')]=function(_0x3cb783,_0x199158){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x199158,null))[_0xd646('0x51')](handleError(_0x199158,null));};exports[_0xd646('0x60')]=function(_0x33b4f2,_0x6f6fa,_0xced4cd){var _0x14c7eb={'raw':!![],'where':{}},_0x175739={},_0x2acf6b;return db['ChatQueue'][_0xd646('0x61')]({'where':{'id':_0x33b4f2[_0xd646('0x5e')]['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x6f6fa,null))[_0xd646('0x1f')](function(_0x3b7f20){if(_0x3b7f20){_0x2acf6b=_0x3b7f20[_0xd646('0x57')]({'plain':!![]});_0x175739['model']=_[_0xd646('0x3f')](db[_0xd646('0x62')][_0xd646('0x3b')]);_0x175739[_0xd646('0x40')]=_[_0xd646('0x3f')](_0x33b4f2[_0xd646('0x40')]);_0x175739[_0xd646('0x41')]=_['intersection'](_0x175739[_0xd646('0x3d')],_0x175739[_0xd646('0x40')]);_0x14c7eb[_0xd646('0x44')]=_[_0xd646('0x42')](_0x175739[_0xd646('0x3d')],qs[_0xd646('0x43')](_0x33b4f2['query'][_0xd646('0x43')]));_0x14c7eb[_0xd646('0x44')]=_0x14c7eb[_0xd646('0x44')][_0xd646('0x52')]?_0x14c7eb['attributes']:_0x175739[_0xd646('0x3d')];if(!_0x33b4f2[_0xd646('0x40')][_0xd646('0x45')](_0xd646('0x46'))){_0x14c7eb[_0xd646('0x2f')]=qs[_0xd646('0x2f')](_0x33b4f2[_0xd646('0x40')][_0xd646('0x2f')]);_0x14c7eb[_0xd646('0x2e')]=qs[_0xd646('0x2e')](_0x33b4f2[_0xd646('0x40')][_0xd646('0x2e')]);}_0x14c7eb[_0xd646('0x47')]=qs[_0xd646('0x48')](_0x33b4f2['query'][_0xd646('0x48')]);_0x14c7eb[_0xd646('0x49')]=qs['filters'](_[_0xd646('0x4a')](_0x33b4f2[_0xd646('0x40')],_0x175739[_0xd646('0x41')]));_0x14c7eb[_0xd646('0x49')][_0xd646('0x63')]=_0x3b7f20['id'];if(_0x33b4f2[_0xd646('0x40')][_0xd646('0x4b')]){_0x14c7eb[_0xd646('0x49')]=_['merge'](_0x14c7eb[_0xd646('0x49')],{'$or':_['map'](_0x14c7eb[_0xd646('0x44')],function(_0x43a4de){var _0x3213fa={};_0x3213fa[_0x43a4de]={'$like':'%'+_0x33b4f2[_0xd646('0x40')][_0xd646('0x4b')]+'%'};return _0x3213fa;})});}_0x14c7eb=_['merge']({},_0x14c7eb,_0x33b4f2[_0xd646('0x64')]);return db[_0xd646('0x62')][_0xd646('0x50')](_0x14c7eb);}})[_0xd646('0x1f')](function(_0x2dbef8){if(_0x2dbef8){return db[_0xd646('0x65')]['findAndCountAll']({'where':{'id':_[_0xd646('0x3e')](_0x2dbef8,_0xd646('0x66')),'role':'agent'},'attributes':['id',_0xd646('0x38'),_0xd646('0x67'),_0xd646('0x68'),_0xd646('0x69')]});}})[_0xd646('0x1f')](function(_0x184b2f){if(_0x184b2f){return{'count':_0x184b2f['count'],'rows':_[_0xd646('0x3e')](_0x184b2f['rows'],function(_0x6911b){return{'membername':_0x6911b[_0xd646('0x38')],'UserId':_0x6911b['id'],'queue_name':_0x2acf6b['name'],'ChatQueueId':_0x2acf6b['id'],'interface':util[_0xd646('0x6a')](_0xd646('0x6b'),_0xd646('0x6c'),_0x6911b[_0xd646('0x38')]),'penalty':0x0,'paused':_0x6911b[_0xd646('0x67')],'createdAt':_0x6911b[_0xd646('0x69')],'updatedAt':_0x6911b[_0xd646('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x6f6fa,_0x14c7eb))[_0xd646('0x51')](handleError(_0x6f6fa,null));};exports[_0xd646('0x6d')]=function(_0x402119,_0x359326,_0x46d822){var _0x16064a={};var _0x5eaa50={};var _0x405227;var _0x500f69;return db[_0xd646('0x4e')][_0xd646('0x61')]({'where':{'id':_0x402119['params']['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x359326,null))[_0xd646('0x1f')](function(_0x5a23e1){if(_0x5a23e1){_0x405227=_0x5a23e1;_0x5eaa50[_0xd646('0x3d')]=_[_0xd646('0x3f')](db['Team'][_0xd646('0x3b')]);_0x5eaa50['query']=_['keys'](_0x402119[_0xd646('0x40')]);_0x5eaa50['filters']=_[_0xd646('0x42')](_0x5eaa50[_0xd646('0x3d')],_0x5eaa50[_0xd646('0x40')]);_0x16064a[_0xd646('0x44')]=_[_0xd646('0x42')](_0x5eaa50[_0xd646('0x3d')],qs[_0xd646('0x43')](_0x402119['query'][_0xd646('0x43')]));_0x16064a['attributes']=_0x16064a[_0xd646('0x44')][_0xd646('0x52')]?_0x16064a[_0xd646('0x44')]:_0x5eaa50['model'];_0x16064a[_0xd646('0x47')]=qs[_0xd646('0x48')](_0x402119[_0xd646('0x40')][_0xd646('0x48')]);_0x16064a[_0xd646('0x49')]=qs['filters'](_['pick'](_0x402119[_0xd646('0x40')],_0x5eaa50['filters']));if(_0x402119['query'][_0xd646('0x4b')]){_0x16064a[_0xd646('0x49')]=_['merge'](_0x16064a[_0xd646('0x49')],{'$or':_[_0xd646('0x3e')](_0x16064a['attributes'],function(_0x34b2d6){var _0x1e0108={};_0x1e0108[_0x34b2d6]={'$like':'%'+_0x402119[_0xd646('0x40')][_0xd646('0x4b')]+'%'};return _0x1e0108;})});}_0x16064a=_[_0xd646('0x4d')]({},_0x16064a,_0x402119[_0xd646('0x64')]);return _0x405227[_0xd646('0x6d')](_0x16064a);}})[_0xd646('0x1f')](function(_0x5eb8aa){if(_0x5eb8aa){_0x500f69=_0x5eb8aa['length'];if(!_0x402119[_0xd646('0x40')]['hasOwnProperty'](_0xd646('0x46'))){_0x16064a[_0xd646('0x2f')]=qs[_0xd646('0x2f')](_0x402119[_0xd646('0x40')][_0xd646('0x2f')]);_0x16064a['offset']=qs[_0xd646('0x2e')](_0x402119['query']['offset']);}return _0x405227['getTeams'](_0x16064a);}})['then'](function(_0x5c82ee){if(_0x5c82ee){return _0x5c82ee?{'count':_0x500f69,'rows':_0x5c82ee}:null;}})[_0xd646('0x1f')](respondWithResult(_0x359326,null))['catch'](handleError(_0x359326,null));};exports[_0xd646('0x6e')]=function(_0x27d128,_0x1f9449,_0x414a0f){var _0x5ae727=_0x27d128['body'][_0xd646('0x6f')];return db[_0xd646('0x70')][_0xd646('0x50')]({'where':{'id':_0x5ae727},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd646('0x71'),'attributes':['id',_0xd646('0x38'),_0xd646('0x72'),_0xd646('0x73'),_0xd646('0x74')],'raw':!![]}]})[_0xd646('0x1f')](function(_0x435f91){if(_0x435f91){var _0x6e8d91=_[_0xd646('0x75')](_0x435f91,function(_0x1ab405){var _0x2420e4=_0x1ab405[_0xd646('0x57')]({'plain':!![]});return _0x2420e4['Agents'];});return db[_0xd646('0x4e')][_0xd646('0x53')]({'where':{'id':_0x27d128['params']['id']}})['then'](function(_0x3898f8){return db[_0xd646('0x76')][_0xd646('0x77')](function(_0x54522d){return _0x3898f8[_0xd646('0x6e')](_0x5ae727,{'transaction':_0x54522d})[_0xd646('0x1f')](function(){return BPromise['each'](_0x6e8d91,function(_0x1ba4d3){return db['UserChatQueue'][_0xd646('0x78')]({'where':{'UserId':_0x1ba4d3['id'],'ChatQueueId':_0x27d128[_0xd646('0x5e')]['id']},'transaction':_0x54522d});});})['then'](function(){_0x6e8d91['forEach'](function(_0x5b77ce){socket[_0xd646('0x79')]('userChatQueue:save',{'UserId':_0x5b77ce['id'],'ChatQueueId':_0x3898f8['id']});});});});});}})[_0xd646('0x1f')](respondWithStatusCode(_0x1f9449,null))[_0xd646('0x51')](handleError(_0x1f9449,null));};exports[_0xd646('0x7a')]=function(_0xe6958,_0x22c732,_0x98b9df){return db['Team'][_0xd646('0x50')]({'where':{'id':_0xe6958[_0xd646('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd646('0x65')],'as':_0xd646('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd646('0x1f')](handleEntityNotFound(_0x22c732,null))[_0xd646('0x1f')](function(_0x281d24){var _0x25bd42=_[_0xd646('0x3e')](_0x281d24,'id');var _0x415b10=[];var _0x2c853b=[];var _0x40a6bc=squel[_0xd646('0x7b')]();_0x40a6bc['field'](_0xd646('0x7c'))[_0xd646('0x7d')](_0xd646('0x7e'),'tq')[_0xd646('0x7f')](_0xd646('0x80'),'ut',_0xd646('0x81'))['where'](_0xd646('0x82'),_0xe6958['params']['id']);for(var _0x717730=0x0;_0x717730<_0x281d24[_0xd646('0x52')];_0x717730+=0x1){let _0x3b08ba=_0x281d24[_0x717730];for(var _0x4cf7d7=0x0;_0x4cf7d7<_0x3b08ba[_0xd646('0x71')]['length'];_0x4cf7d7+=0x1){let _0x350fb0=_0x3b08ba[_0xd646('0x71')][_0x4cf7d7];var _0x265fe3=_0x40a6bc['clone']();_0x265fe3['where'](_0xd646('0x83'),_0x350fb0['id']);_0x2c853b[_0xd646('0x84')](db[_0xd646('0x76')][_0xd646('0x40')](_0x265fe3[_0xd646('0x85')](),{'type':db[_0xd646('0x76')][_0xd646('0x86')]['SELECT']})['then'](function(_0x274fc4){if(_0x274fc4['length']===0x1){return _0x350fb0['id'];}else{var _0x2adae5=_['every'](_[_0xd646('0x3e')](_0x274fc4,'TeamId'),function(_0x5e212f){return _[_0xd646('0x87')](_0x25bd42,_0x5e212f);});if(_0x2adae5){return _0x350fb0['id'];}}}));}}return BPromise[_0xd646('0x88')](_0x2c853b)[_0xd646('0x1f')](function(_0x3615b3){_0x415b10=_(_0x415b10)[_0xd646('0x89')](_0x3615b3)[_0xd646('0x8a')]()[_0xd646('0x8b')]();return db['ChatQueue'][_0xd646('0x53')]({'where':{'id':_0xe6958['params']['id']}})['then'](function(_0x35a199){return db[_0xd646('0x76')][_0xd646('0x77')](function(_0x18984a){return _0x35a199[_0xd646('0x7a')](_0xe6958[_0xd646('0x40')]['ids'],{'transaction':_0x18984a})['then'](function(){if(!_[_0xd646('0x8c')](_0x415b10)){return _0x35a199[_0xd646('0x8d')](_0x415b10,{'transaction':_0x18984a});}})[_0xd646('0x1f')](function(){_0x415b10[_0xd646('0x8e')](function(_0xe8ea8b){socket[_0xd646('0x79')](_0xd646('0x8f'),{'UserId':_0xe8ea8b,'ChatQueueId':_0x35a199['id']});});});});});});})['then'](respondWithStatusCode(_0x22c732,null))[_0xd646('0x51')](handleError(_0x22c732,null));};exports['addAgents']=function(_0xe35705,_0x27ff81,_0x52d304){return db['ChatQueue'][_0xd646('0x53')]({'where':{'id':_0xe35705[_0xd646('0x5e')]['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x27ff81,null))[_0xd646('0x1f')](function(_0x4ab1ed){if(_0x4ab1ed){return _0x4ab1ed[_0xd646('0x90')](_0xe35705[_0xd646('0x55')]['ids'],_[_0xd646('0x91')](_0xe35705['body'],['ids','id'])||{})[_0xd646('0x92')](function(_0x516747){for(var _0x229289=0x0;_0x229289<_0xe35705[_0xd646('0x55')][_0xd646('0x6f')][_0xd646('0x52')];_0x229289+=0x1){socket[_0xd646('0x79')](_0xd646('0x93'),{'UserId':_0xe35705['body'][_0xd646('0x6f')][_0x229289],'ChatQueueId':_0xe35705['params']['id']});}return _0x516747;});}})[_0xd646('0x1f')](respondWithResult(_0x27ff81,null))[_0xd646('0x51')](handleError(_0x27ff81,null));};exports[_0xd646('0x8d')]=function(_0xc0b291,_0x1f2829,_0x5de0cc){return db['ChatQueue'][_0xd646('0x53')]({'where':{'id':_0xc0b291[_0xd646('0x5e')]['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0x1f2829,null))[_0xd646('0x1f')](function(_0xd308e2){if(_0xd308e2){return _0xd308e2[_0xd646('0x8d')](_0xc0b291[_0xd646('0x40')][_0xd646('0x6f')])['then'](function(){if(_[_0xd646('0x94')](_0xc0b291['query']['ids'])){for(var _0x11aabf=0x0;_0x11aabf<_0xc0b291[_0xd646('0x40')][_0xd646('0x6f')]['length'];_0x11aabf+=0x1){socket[_0xd646('0x79')](_0xd646('0x8f'),{'UserId':Number(_0xc0b291[_0xd646('0x40')][_0xd646('0x6f')][_0x11aabf]),'ChatQueueId':Number(_0xc0b291['params']['id'])});}}else{socket['emit'](_0xd646('0x8f'),{'UserId':Number(_0xc0b291['query'][_0xd646('0x6f')]),'ChatQueueId':Number(_0xc0b291['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1f2829,null))[_0xd646('0x51')](handleError(_0x1f2829,null));};exports[_0xd646('0x95')]=function(_0x3e3ad0,_0xf87a33,_0x20858b){var _0x4139ac={};var _0x1e4291={};var _0x5b0766;var _0x557ae6;return db[_0xd646('0x4e')][_0xd646('0x61')]({'where':{'id':_0x3e3ad0[_0xd646('0x5e')]['id']}})[_0xd646('0x1f')](handleEntityNotFound(_0xf87a33,null))[_0xd646('0x1f')](function(_0x5e9149){if(_0x5e9149){_0x5b0766=_0x5e9149;_0x1e4291[_0xd646('0x3d')]=_[_0xd646('0x3f')](db['User'][_0xd646('0x3b')]);_0x1e4291[_0xd646('0x40')]=_[_0xd646('0x3f')](_0x3e3ad0[_0xd646('0x40')]);_0x1e4291['filters']=_[_0xd646('0x42')](_0x1e4291[_0xd646('0x3d')],_0x1e4291[_0xd646('0x40')]);_0x4139ac[_0xd646('0x44')]=_[_0xd646('0x42')](_0x1e4291[_0xd646('0x3d')],qs[_0xd646('0x43')](_0x3e3ad0[_0xd646('0x40')][_0xd646('0x43')]));_0x4139ac[_0xd646('0x44')]=_0x4139ac[_0xd646('0x44')][_0xd646('0x52')]?_0x4139ac['attributes']:_0x1e4291[_0xd646('0x3d')];_0x4139ac['order']=qs[_0xd646('0x48')](_0x3e3ad0[_0xd646('0x40')][_0xd646('0x48')]);_0x4139ac[_0xd646('0x49')]=qs[_0xd646('0x41')](_[_0xd646('0x4a')](_0x3e3ad0[_0xd646('0x40')],_0x1e4291[_0xd646('0x41')]));if(_0x3e3ad0['query'][_0xd646('0x4b')]){_0x4139ac['where']=_[_0xd646('0x4d')](_0x4139ac[_0xd646('0x49')],{'$or':_[_0xd646('0x3e')](_0x4139ac['attributes'],function(_0x4066c5){var _0x31978e={};_0x31978e[_0x4066c5]={'$like':'%'+_0x3e3ad0['query']['filter']+'%'};return _0x31978e;})});}_0x4139ac=_['merge']({},_0x4139ac,_0x3e3ad0[_0xd646('0x64')]);return _0x5b0766[_0xd646('0x95')](_0x4139ac);}})[_0xd646('0x1f')](function(_0x1cdf66){if(_0x1cdf66){_0x557ae6=_0x1cdf66[_0xd646('0x52')];if(!_0x3e3ad0['query'][_0xd646('0x45')](_0xd646('0x46'))){_0x4139ac[_0xd646('0x2f')]=qs[_0xd646('0x2f')](_0x3e3ad0[_0xd646('0x40')][_0xd646('0x2f')]);_0x4139ac[_0xd646('0x2e')]=qs['offset'](_0x3e3ad0[_0xd646('0x40')][_0xd646('0x2e')]);}return _0x5b0766['getAgents'](_0x4139ac);}})[_0xd646('0x1f')](function(_0x5cf100){if(_0x5cf100){return _0x5cf100?{'count':_0x557ae6,'rows':_0x5cf100}:null;}})[_0xd646('0x1f')](respondWithResult(_0xf87a33,null))[_0xd646('0x51')](handleError(_0xf87a33,null));}; \ No newline at end of file +var _0x9f3f=['forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','params','describe','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9f3f,0xae));var _0xf9f3=function(_0x2cb870,_0x178ba3){_0x2cb870=_0x2cb870-0x0;var _0x559f67=_0x9f3f[_0x2cb870];return _0x559f67;};'use strict';var pdf=require(_0xf9f3('0x0'));var emlformat=require(_0xf9f3('0x1'));var rimraf=require(_0xf9f3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9f3('0x3'));var moment=require(_0xf9f3('0x4'));var BPromise=require(_0xf9f3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf9f3('0x6'));var sox=require(_0xf9f3('0x7'));var csv=require(_0xf9f3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf9f3('0x9'));var squel=require(_0xf9f3('0xa'));var crypto=require(_0xf9f3('0xb'));var jsforce=require(_0xf9f3('0xc'));var deskjs=require(_0xf9f3('0xd'));var toCsv=require(_0xf9f3('0x8'));var querystring=require('querystring');var Papa=require(_0xf9f3('0xe'));var Redis=require('ioredis');var authService=require(_0xf9f3('0xf'));var qs=require(_0xf9f3('0x10'));var as=require(_0xf9f3('0x11'));var hardwareService=require(_0xf9f3('0x12'));var logger=require(_0xf9f3('0x13'))(_0xf9f3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf9f3('0x15'))['db'];config[_0xf9f3('0x16')]=_[_0xf9f3('0x17')](config[_0xf9f3('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9f3('0x18'))(new Redis(config['redis']));require(_0xf9f3('0x19'))[_0xf9f3('0x1a')](socket);var jayson=require(_0xf9f3('0x1b'));var client=jayson[_0xf9f3('0x1c')][_0xf9f3('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5288d7,_0x8648c3,_0x46cfb8){if(_0x46cfb8){var _0x5d4869=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d4869[_0xf9f3('0x1e')](_0x8648c3)){return _0x5288d7;}else{throw new db[(_0xf9f3('0x1f'))][(_0xf9f3('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 _0x5288d7;}}function respondWithRpcPromise(_0x272f4f,_0x538451,_0x5b5e6b,_0x304926){return new BPromise(function(_0x4b096a,_0x5efd52){var _0x3c9e8a=_0x304926||client;return _0x3c9e8a[_0xf9f3('0x21')](_0x272f4f,_0x5b5e6b)[_0xf9f3('0x22')](function(_0x17921d){logger[_0xf9f3('0x23')](_0xf9f3('0x24'),_0x538451,_0xf9f3('0x25'));logger[_0xf9f3('0x26')](_0xf9f3('0x27'),_0x538451,_0xf9f3('0x25'),JSON[_0xf9f3('0x28')](_0x17921d));if(_0x17921d[_0xf9f3('0x29')]){if(_0x17921d[_0xf9f3('0x29')][_0xf9f3('0x2a')]===0x1f4){logger[_0xf9f3('0x29')](_0xf9f3('0x24'),_0x538451,_0x17921d[_0xf9f3('0x29')][_0xf9f3('0x2b')]);return _0x5efd52(_0x17921d[_0xf9f3('0x29')][_0xf9f3('0x2b')]);}logger[_0xf9f3('0x29')](_0xf9f3('0x24'),_0x538451,_0x17921d[_0xf9f3('0x29')][_0xf9f3('0x2b')]);return _0x4b096a(_0x17921d[_0xf9f3('0x29')]['message']);}else{logger['info'](_0xf9f3('0x24'),_0x538451,_0xf9f3('0x25'));_0x4b096a(_0x17921d[_0xf9f3('0x2c')][_0xf9f3('0x2b')]);}})[_0xf9f3('0x2d')](function(_0x31f131){logger[_0xf9f3('0x29')](_0xf9f3('0x24'),_0x538451,_0x31f131);_0x5efd52(_0x31f131);});});}function respondWithStatusCode(_0x262dc5,_0x86c730){_0x86c730=_0x86c730||0xcc;return function(_0x40c733){if(_0x40c733){return _0x262dc5[_0xf9f3('0x2e')](_0x86c730);}return _0x262dc5[_0xf9f3('0x2f')](_0x86c730)[_0xf9f3('0x30')]();};}function respondWithResult(_0x4add60,_0x14176a){_0x14176a=_0x14176a||0xc8;return function(_0x125736){if(_0x125736){return _0x4add60[_0xf9f3('0x2f')](_0x14176a)[_0xf9f3('0x31')](_0x125736);}};}function respondWithFilteredResult(_0x283230,_0x17d8cd){return function(_0x4690aa){if(_0x4690aa){var _0x33d2a1=_0x4690aa[_0xf9f3('0x32')],_0x1a8543=_0x17d8cd[_0xf9f3('0x33')],_0x54f935=_0x17d8cd[_0xf9f3('0x33')]+_0x17d8cd[_0xf9f3('0x34')],_0x3ddc46;if(_0x54f935>=_0x33d2a1){_0x54f935=_0x33d2a1;_0x3ddc46=0xc8;}else{_0x3ddc46=0xce;}_0x283230[_0xf9f3('0x2f')](_0x3ddc46);return _0x283230[_0xf9f3('0x35')](_0xf9f3('0x36'),_0x1a8543+'-'+_0x54f935+'/'+_0x33d2a1)[_0xf9f3('0x31')](_0x4690aa);}return null;};}function patchUpdates(_0x35e6a1){return function(_0xcaa6e3){try{jsonpatch[_0xf9f3('0x37')](_0xcaa6e3,_0x35e6a1,!![]);}catch(_0x5e8793){return BPromise[_0xf9f3('0x38')](_0x5e8793);}return _0xcaa6e3['save']();};}function saveUpdates(_0x1f7329,_0x4ab98b){return function(_0x2b87b9){if(_0x2b87b9){return _0x2b87b9[_0xf9f3('0x39')](_0x1f7329)[_0xf9f3('0x22')](function(_0x14f779){return _0x14f779;});}return null;};}function removeEntity(_0x395001,_0x158ade){return function(_0x1d7dc1){if(_0x1d7dc1){return _0x1d7dc1[_0xf9f3('0x3a')]()['then'](function(){var _0x5ebcce=_0x1d7dc1[_0xf9f3('0x3b')]({'plain':!![]});var _0x52daf3=_0xf9f3('0x3c');return db['UserProfileResource'][_0xf9f3('0x3a')]({'where':{'type':_0x52daf3,'resourceId':_0x5ebcce['id']}})[_0xf9f3('0x22')](function(){return _0x1d7dc1;});})[_0xf9f3('0x22')](function(){_0x395001['status'](0xcc)[_0xf9f3('0x30')]();});}};}function handleEntityNotFound(_0x20f1ae,_0x36df4e){return function(_0xe8d6b7){if(!_0xe8d6b7){_0x20f1ae['sendStatus'](0x194);}return _0xe8d6b7;};}function handleError(_0x6066d8,_0x30e79b){_0x30e79b=_0x30e79b||0x1f4;return function(_0x24a4c8){logger[_0xf9f3('0x29')](_0x24a4c8[_0xf9f3('0x3d')]);if(_0x24a4c8[_0xf9f3('0x3e')]){delete _0x24a4c8['name'];}_0x6066d8['status'](_0x30e79b)[_0xf9f3('0x3f')](_0x24a4c8);};}exports['index']=function(_0x1c6d49,_0x6ee063){var _0xc8f07f={},_0x1722b8={},_0x432a1d={'count':0x0,'rows':[]};var _0x5e0315=_[_0xf9f3('0x40')](db[_0xf9f3('0x41')][_0xf9f3('0x42')],function(_0x439073){return{'name':_0x439073[_0xf9f3('0x43')],'type':_0x439073['type'][_0xf9f3('0x44')]};});_0x1722b8[_0xf9f3('0x45')]=_[_0xf9f3('0x40')](_0x5e0315,_0xf9f3('0x3e'));_0x1722b8[_0xf9f3('0x46')]=_[_0xf9f3('0x47')](_0x1c6d49['query']);_0x1722b8['filters']=_[_0xf9f3('0x48')](_0x1722b8[_0xf9f3('0x45')],_0x1722b8['query']);_0xc8f07f[_0xf9f3('0x49')]=_[_0xf9f3('0x48')](_0x1722b8[_0xf9f3('0x45')],qs[_0xf9f3('0x4a')](_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x4a')]));_0xc8f07f['attributes']=_0xc8f07f['attributes'][_0xf9f3('0x4b')]?_0xc8f07f['attributes']:_0x1722b8[_0xf9f3('0x45')];if(!_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x4c')](_0xf9f3('0x4d'))){_0xc8f07f[_0xf9f3('0x34')]=qs[_0xf9f3('0x34')](_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x34')]);_0xc8f07f[_0xf9f3('0x33')]=qs[_0xf9f3('0x33')](_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x33')]);}_0xc8f07f['order']=qs[_0xf9f3('0x4e')](_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x4e')]);_0xc8f07f['where']=qs[_0xf9f3('0x4f')](_[_0xf9f3('0x50')](_0x1c6d49[_0xf9f3('0x46')],_0x1722b8[_0xf9f3('0x4f')]),_0x5e0315);if(_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x51')]){_0xc8f07f[_0xf9f3('0x52')]=_[_0xf9f3('0x53')](_0xc8f07f[_0xf9f3('0x52')],{'$or':_[_0xf9f3('0x40')](_0x5e0315,function(_0x2daf81){if(_0x2daf81['type']!==_0xf9f3('0x54')){var _0x55764e={};_0x55764e[_0x2daf81[_0xf9f3('0x3e')]]={'$like':'%'+_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x51')]+'%'};return _0x55764e;}})});}_0xc8f07f=_[_0xf9f3('0x53')]({},_0xc8f07f,_0x1c6d49[_0xf9f3('0x55')]);var _0x167f23={'where':_0xc8f07f[_0xf9f3('0x52')]};return db[_0xf9f3('0x41')][_0xf9f3('0x32')](_0x167f23)[_0xf9f3('0x22')](function(_0x42c711){_0x432a1d[_0xf9f3('0x32')]=_0x42c711;if(_0x1c6d49[_0xf9f3('0x46')][_0xf9f3('0x56')]){_0xc8f07f[_0xf9f3('0x57')]=[{'all':!![]}];}return db['ChatQueue'][_0xf9f3('0x58')](_0xc8f07f);})[_0xf9f3('0x22')](function(_0x4b190e){_0x432a1d['rows']=_0x4b190e;return _0x432a1d;})[_0xf9f3('0x22')](respondWithFilteredResult(_0x6ee063,_0xc8f07f))[_0xf9f3('0x2d')](handleError(_0x6ee063,null));};exports[_0xf9f3('0x59')]=function(_0x53aee2,_0x5c72f4){var _0x818539={'raw':!![],'where':{'id':_0x53aee2['params']['id']}},_0x5eae1f={};_0x5eae1f[_0xf9f3('0x45')]=_[_0xf9f3('0x47')](db[_0xf9f3('0x41')]['rawAttributes']);_0x5eae1f[_0xf9f3('0x46')]=_['keys'](_0x53aee2[_0xf9f3('0x46')]);_0x5eae1f[_0xf9f3('0x4f')]=_[_0xf9f3('0x48')](_0x5eae1f[_0xf9f3('0x45')],_0x5eae1f[_0xf9f3('0x46')]);_0x818539[_0xf9f3('0x49')]=_['intersection'](_0x5eae1f['model'],qs[_0xf9f3('0x4a')](_0x53aee2[_0xf9f3('0x46')][_0xf9f3('0x4a')]));_0x818539[_0xf9f3('0x49')]=_0x818539[_0xf9f3('0x49')][_0xf9f3('0x4b')]?_0x818539['attributes']:_0x5eae1f[_0xf9f3('0x45')];if(_0x53aee2[_0xf9f3('0x46')][_0xf9f3('0x56')]){_0x818539['include']=[{'all':!![]}];}_0x818539=_[_0xf9f3('0x53')]({},_0x818539,_0x53aee2[_0xf9f3('0x55')]);return db['ChatQueue'][_0xf9f3('0x5a')](_0x818539)[_0xf9f3('0x22')](handleEntityNotFound(_0x5c72f4,null))[_0xf9f3('0x22')](respondWithResult(_0x5c72f4,null))[_0xf9f3('0x2d')](handleError(_0x5c72f4,null));};exports[_0xf9f3('0x5b')]=function(_0x24ca81,_0x1edafd){return db[_0xf9f3('0x41')]['create'](_0x24ca81[_0xf9f3('0x5c')],{})['then'](function(_0x4e52e6){var _0x1daa9d=_0x24ca81[_0xf9f3('0x5d')]['get']({'plain':!![]});if(!_0x1daa9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1daa9d['role']==='user'){var _0x124545=_0x4e52e6[_0xf9f3('0x3b')]({'plain':!![]});var _0x4cb7bd=_0xf9f3('0x3c');return db[_0xf9f3('0x5e')][_0xf9f3('0x5a')]({'where':{'name':_0x4cb7bd,'userProfileId':_0x1daa9d['userProfileId']},'raw':!![]})[_0xf9f3('0x22')](function(_0x4f87c8){if(_0x4f87c8&&_0x4f87c8[_0xf9f3('0x5f')]===0x0){return db[_0xf9f3('0x60')]['create']({'name':_0x124545['name'],'resourceId':_0x124545['id'],'type':_0x4f87c8['name'],'sectionId':_0x4f87c8['id']},{})['then'](function(){return _0x4e52e6;});}else{return _0x4e52e6;}})[_0xf9f3('0x2d')](function(_0x276972){logger[_0xf9f3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276972);throw _0x276972;});}return _0x4e52e6;})[_0xf9f3('0x22')](respondWithResult(_0x1edafd,0xc9))[_0xf9f3('0x2d')](handleError(_0x1edafd,null));};exports[_0xf9f3('0x39')]=function(_0x18cb84,_0x5df7a7){if(_0x18cb84[_0xf9f3('0x5c')]['id']){delete _0x18cb84[_0xf9f3('0x5c')]['id'];}return db[_0xf9f3('0x41')][_0xf9f3('0x5a')]({'where':{'id':_0x18cb84[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0x5df7a7,null))['then'](saveUpdates(_0x18cb84[_0xf9f3('0x5c')],null))['then'](respondWithResult(_0x5df7a7,null))['catch'](handleError(_0x5df7a7,null));};exports['destroy']=function(_0x4a2fe1,_0x382d70){return db[_0xf9f3('0x41')][_0xf9f3('0x5a')]({'where':{'id':_0x4a2fe1[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0x382d70,null))[_0xf9f3('0x22')](removeEntity(_0x382d70,null))[_0xf9f3('0x2d')](handleError(_0x382d70,null));};exports[_0xf9f3('0x62')]=function(_0x42b82e,_0x51dedb){return db[_0xf9f3('0x41')][_0xf9f3('0x62')]()['then'](respondWithResult(_0x51dedb,null))[_0xf9f3('0x2d')](handleError(_0x51dedb,null));};exports['getMembers']=function(_0x5dea13,_0x3aa86e,_0x4cf3ab){var _0x53828f={'raw':!![],'where':{}},_0x1262b4={},_0x422040;return db['ChatQueue'][_0xf9f3('0x63')]({'where':{'id':_0x5dea13[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0x3aa86e,null))[_0xf9f3('0x22')](function(_0x54d68f){if(_0x54d68f){_0x422040=_0x54d68f[_0xf9f3('0x3b')]({'plain':!![]});_0x1262b4[_0xf9f3('0x45')]=_[_0xf9f3('0x47')](db[_0xf9f3('0x64')]['rawAttributes']);_0x1262b4[_0xf9f3('0x46')]=_[_0xf9f3('0x47')](_0x5dea13[_0xf9f3('0x46')]);_0x1262b4[_0xf9f3('0x4f')]=_[_0xf9f3('0x48')](_0x1262b4[_0xf9f3('0x45')],_0x1262b4[_0xf9f3('0x46')]);_0x53828f[_0xf9f3('0x49')]=_[_0xf9f3('0x48')](_0x1262b4[_0xf9f3('0x45')],qs[_0xf9f3('0x4a')](_0x5dea13[_0xf9f3('0x46')][_0xf9f3('0x4a')]));_0x53828f[_0xf9f3('0x49')]=_0x53828f[_0xf9f3('0x49')]['length']?_0x53828f[_0xf9f3('0x49')]:_0x1262b4[_0xf9f3('0x45')];if(!_0x5dea13[_0xf9f3('0x46')]['hasOwnProperty'](_0xf9f3('0x4d'))){_0x53828f[_0xf9f3('0x34')]=qs[_0xf9f3('0x34')](_0x5dea13['query'][_0xf9f3('0x34')]);_0x53828f[_0xf9f3('0x33')]=qs[_0xf9f3('0x33')](_0x5dea13[_0xf9f3('0x46')][_0xf9f3('0x33')]);}_0x53828f[_0xf9f3('0x65')]=qs[_0xf9f3('0x4e')](_0x5dea13[_0xf9f3('0x46')][_0xf9f3('0x4e')]);_0x53828f[_0xf9f3('0x52')]=qs[_0xf9f3('0x4f')](_['pick'](_0x5dea13[_0xf9f3('0x46')],_0x1262b4[_0xf9f3('0x4f')]));_0x53828f[_0xf9f3('0x52')][_0xf9f3('0x66')]=_0x54d68f['id'];if(_0x5dea13[_0xf9f3('0x46')][_0xf9f3('0x51')]){_0x53828f[_0xf9f3('0x52')]=_['merge'](_0x53828f['where'],{'$or':_['map'](_0x53828f['attributes'],function(_0x37cc9a){var _0xd1e3b9={};_0xd1e3b9[_0x37cc9a]={'$like':'%'+_0x5dea13[_0xf9f3('0x46')][_0xf9f3('0x51')]+'%'};return _0xd1e3b9;})});}_0x53828f=_[_0xf9f3('0x53')]({},_0x53828f,_0x5dea13['options']);return db[_0xf9f3('0x64')][_0xf9f3('0x58')](_0x53828f);}})[_0xf9f3('0x22')](function(_0x43b89a){if(_0x43b89a){return db[_0xf9f3('0x67')][_0xf9f3('0x68')]({'where':{'id':_[_0xf9f3('0x40')](_0x43b89a,'UserId'),'role':_0xf9f3('0x69')},'attributes':['id',_0xf9f3('0x3e'),_0xf9f3('0x6a'),_0xf9f3('0x6b'),_0xf9f3('0x6c')]});}})[_0xf9f3('0x22')](function(_0x4dbdfe){if(_0x4dbdfe){return{'count':_0x4dbdfe[_0xf9f3('0x32')],'rows':_[_0xf9f3('0x40')](_0x4dbdfe[_0xf9f3('0x6d')],function(_0xf68813){return{'membername':_0xf68813[_0xf9f3('0x3e')],'UserId':_0xf68813['id'],'queue_name':_0x422040[_0xf9f3('0x3e')],'ChatQueueId':_0x422040['id'],'interface':util[_0xf9f3('0x6e')](_0xf9f3('0x6f'),'SIP',_0xf68813['name']),'penalty':0x0,'paused':_0xf68813['chatPause'],'createdAt':_0xf68813[_0xf9f3('0x6c')],'updatedAt':_0xf68813['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3aa86e,_0x53828f))[_0xf9f3('0x2d')](handleError(_0x3aa86e,null));};exports[_0xf9f3('0x70')]=function(_0x2998cc,_0x54a126,_0x4f7d86){var _0x12899a={};var _0x4ac61={};var _0x50bef7;var _0x1c4cb8;return db['ChatQueue'][_0xf9f3('0x63')]({'where':{'id':_0x2998cc['params']['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0x54a126,null))[_0xf9f3('0x22')](function(_0x184d95){if(_0x184d95){_0x50bef7=_0x184d95;_0x4ac61[_0xf9f3('0x45')]=_[_0xf9f3('0x47')](db[_0xf9f3('0x71')][_0xf9f3('0x42')]);_0x4ac61[_0xf9f3('0x46')]=_[_0xf9f3('0x47')](_0x2998cc['query']);_0x4ac61[_0xf9f3('0x4f')]=_['intersection'](_0x4ac61[_0xf9f3('0x45')],_0x4ac61['query']);_0x12899a['attributes']=_[_0xf9f3('0x48')](_0x4ac61[_0xf9f3('0x45')],qs['fields'](_0x2998cc[_0xf9f3('0x46')][_0xf9f3('0x4a')]));_0x12899a[_0xf9f3('0x49')]=_0x12899a[_0xf9f3('0x49')][_0xf9f3('0x4b')]?_0x12899a[_0xf9f3('0x49')]:_0x4ac61[_0xf9f3('0x45')];_0x12899a['order']=qs[_0xf9f3('0x4e')](_0x2998cc[_0xf9f3('0x46')][_0xf9f3('0x4e')]);_0x12899a[_0xf9f3('0x52')]=qs['filters'](_[_0xf9f3('0x50')](_0x2998cc[_0xf9f3('0x46')],_0x4ac61[_0xf9f3('0x4f')]));if(_0x2998cc['query']['filter']){_0x12899a[_0xf9f3('0x52')]=_[_0xf9f3('0x53')](_0x12899a[_0xf9f3('0x52')],{'$or':_[_0xf9f3('0x40')](_0x12899a[_0xf9f3('0x49')],function(_0xc6ae5){var _0xc22a14={};_0xc22a14[_0xc6ae5]={'$like':'%'+_0x2998cc[_0xf9f3('0x46')][_0xf9f3('0x51')]+'%'};return _0xc22a14;})});}_0x12899a=_[_0xf9f3('0x53')]({},_0x12899a,_0x2998cc[_0xf9f3('0x55')]);return _0x50bef7[_0xf9f3('0x70')](_0x12899a);}})[_0xf9f3('0x22')](function(_0x266174){if(_0x266174){_0x1c4cb8=_0x266174[_0xf9f3('0x4b')];if(!_0x2998cc[_0xf9f3('0x46')]['hasOwnProperty'](_0xf9f3('0x4d'))){_0x12899a[_0xf9f3('0x34')]=qs['limit'](_0x2998cc[_0xf9f3('0x46')][_0xf9f3('0x34')]);_0x12899a[_0xf9f3('0x33')]=qs[_0xf9f3('0x33')](_0x2998cc['query'][_0xf9f3('0x33')]);}return _0x50bef7['getTeams'](_0x12899a);}})[_0xf9f3('0x22')](function(_0x5d1d45){if(_0x5d1d45){return _0x5d1d45?{'count':_0x1c4cb8,'rows':_0x5d1d45}:null;}})['then'](respondWithResult(_0x54a126,null))[_0xf9f3('0x2d')](handleError(_0x54a126,null));};exports['addTeams']=function(_0x326e3d,_0x3bc21c,_0x4ce36e){var _0x5079eb=_0x326e3d['body'][_0xf9f3('0x72')];return db[_0xf9f3('0x71')][_0xf9f3('0x58')]({'where':{'id':_0x5079eb},'attributes':['id'],'include':[{'model':db[_0xf9f3('0x67')],'as':_0xf9f3('0x73'),'attributes':['id','name',_0xf9f3('0x74'),_0xf9f3('0x75'),_0xf9f3('0x76')],'raw':!![]}]})[_0xf9f3('0x22')](function(_0x3949f3){if(_0x3949f3){var _0xace2b4=_[_0xf9f3('0x77')](_0x3949f3,function(_0x50bee4){var _0x1877a3=_0x50bee4[_0xf9f3('0x3b')]({'plain':!![]});return _0x1877a3[_0xf9f3('0x73')];});return db[_0xf9f3('0x41')]['find']({'where':{'id':_0x326e3d[_0xf9f3('0x61')]['id']}})['then'](function(_0x32beb2){return db[_0xf9f3('0x78')][_0xf9f3('0x79')](function(_0x489b4c){return _0x32beb2[_0xf9f3('0x7a')](_0x5079eb,{'transaction':_0x489b4c})[_0xf9f3('0x22')](function(){return BPromise['each'](_0xace2b4,function(_0x8f05d0){return db[_0xf9f3('0x64')][_0xf9f3('0x7b')]({'where':{'UserId':_0x8f05d0['id'],'ChatQueueId':_0x326e3d[_0xf9f3('0x61')]['id']},'transaction':_0x489b4c});});})[_0xf9f3('0x22')](function(){_0xace2b4[_0xf9f3('0x7c')](function(_0x1bb45a){socket[_0xf9f3('0x7d')](_0xf9f3('0x7e'),{'UserId':_0x1bb45a['id'],'ChatQueueId':_0x32beb2['id']});});});});});}})[_0xf9f3('0x22')](respondWithStatusCode(_0x3bc21c,null))[_0xf9f3('0x2d')](handleError(_0x3bc21c,null));};exports[_0xf9f3('0x7f')]=function(_0x3bba79,_0x3cce29,_0x4a4686){return db[_0xf9f3('0x71')][_0xf9f3('0x58')]({'where':{'id':_0x3bba79['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf9f3('0x67')],'as':_0xf9f3('0x73'),'attributes':['id'],'raw':!![]}]})[_0xf9f3('0x22')](handleEntityNotFound(_0x3cce29,null))['then'](function(_0x16579a){var _0x40717a=_[_0xf9f3('0x40')](_0x16579a,'id');var _0x1e11d0=[];var _0xeb5686=[];var _0x54a67f=squel[_0xf9f3('0x80')]();_0x54a67f['field'](_0xf9f3('0x81'))[_0xf9f3('0x82')](_0xf9f3('0x83'),'tq')[_0xf9f3('0x84')](_0xf9f3('0x85'),'ut',_0xf9f3('0x86'))['where'](_0xf9f3('0x87'),_0x3bba79[_0xf9f3('0x61')]['id']);for(var _0x50c749=0x0;_0x50c749<_0x16579a[_0xf9f3('0x4b')];_0x50c749+=0x1){let _0xb856fc=_0x16579a[_0x50c749];for(var _0x206277=0x0;_0x206277<_0xb856fc[_0xf9f3('0x73')]['length'];_0x206277+=0x1){let _0x209d4f=_0xb856fc[_0xf9f3('0x73')][_0x206277];var _0x12e8e2=_0x54a67f['clone']();_0x12e8e2[_0xf9f3('0x52')]('ut.UserId\x20=\x20?',_0x209d4f['id']);_0xeb5686['push'](db[_0xf9f3('0x78')]['query'](_0x12e8e2['toString'](),{'type':db['sequelize'][_0xf9f3('0x88')][_0xf9f3('0x89')]})[_0xf9f3('0x22')](function(_0x362392){if(_0x362392[_0xf9f3('0x4b')]===0x1){return _0x209d4f['id'];}else{var _0x4e5efd=_['every'](_['map'](_0x362392,'TeamId'),function(_0xef2d36){return _[_0xf9f3('0x8a')](_0x40717a,_0xef2d36);});if(_0x4e5efd){return _0x209d4f['id'];}}}));}}return BPromise[_0xf9f3('0x8b')](_0xeb5686)[_0xf9f3('0x22')](function(_0x4354fb){_0x1e11d0=_(_0x1e11d0)['union'](_0x4354fb)[_0xf9f3('0x8c')]()[_0xf9f3('0x8d')]();return db['ChatQueue'][_0xf9f3('0x5a')]({'where':{'id':_0x3bba79[_0xf9f3('0x61')]['id']}})['then'](function(_0x228917){return db[_0xf9f3('0x78')][_0xf9f3('0x79')](function(_0x21ea3c){return _0x228917[_0xf9f3('0x7f')](_0x3bba79[_0xf9f3('0x46')][_0xf9f3('0x72')],{'transaction':_0x21ea3c})[_0xf9f3('0x22')](function(){if(!_[_0xf9f3('0x8e')](_0x1e11d0)){return _0x228917[_0xf9f3('0x8f')](_0x1e11d0,{'transaction':_0x21ea3c});}})[_0xf9f3('0x22')](function(){_0x1e11d0[_0xf9f3('0x7c')](function(_0x1562ee){socket[_0xf9f3('0x7d')](_0xf9f3('0x90'),{'UserId':_0x1562ee,'ChatQueueId':_0x228917['id']});});});});});});})['then'](respondWithStatusCode(_0x3cce29,null))['catch'](handleError(_0x3cce29,null));};exports[_0xf9f3('0x91')]=function(_0x3f447c,_0x61e660,_0x17c359){return db[_0xf9f3('0x41')][_0xf9f3('0x5a')]({'where':{'id':_0x3f447c[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0x61e660,null))['then'](function(_0x1ab8bc){if(_0x1ab8bc){return _0x1ab8bc[_0xf9f3('0x91')](_0x3f447c[_0xf9f3('0x5c')][_0xf9f3('0x72')],_[_0xf9f3('0x92')](_0x3f447c['body'],[_0xf9f3('0x72'),'id'])||{})['spread'](function(_0x56904b){for(var _0x17e6b9=0x0;_0x17e6b9<_0x3f447c[_0xf9f3('0x5c')][_0xf9f3('0x72')][_0xf9f3('0x4b')];_0x17e6b9+=0x1){socket[_0xf9f3('0x7d')](_0xf9f3('0x7e'),{'UserId':_0x3f447c[_0xf9f3('0x5c')][_0xf9f3('0x72')][_0x17e6b9],'ChatQueueId':_0x3f447c['params']['id']});}return _0x56904b;});}})['then'](respondWithResult(_0x61e660,null))[_0xf9f3('0x2d')](handleError(_0x61e660,null));};exports[_0xf9f3('0x8f')]=function(_0x617ce5,_0xf7ee40,_0x107259){return db[_0xf9f3('0x41')][_0xf9f3('0x5a')]({'where':{'id':_0x617ce5[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0xf7ee40,null))[_0xf9f3('0x22')](function(_0x593ddb){if(_0x593ddb){return _0x593ddb[_0xf9f3('0x8f')](_0x617ce5[_0xf9f3('0x46')][_0xf9f3('0x72')])[_0xf9f3('0x22')](function(){if(_[_0xf9f3('0x93')](_0x617ce5[_0xf9f3('0x46')][_0xf9f3('0x72')])){for(var _0x528862=0x0;_0x528862<_0x617ce5[_0xf9f3('0x46')]['ids'][_0xf9f3('0x4b')];_0x528862+=0x1){socket['emit'](_0xf9f3('0x90'),{'UserId':Number(_0x617ce5[_0xf9f3('0x46')][_0xf9f3('0x72')][_0x528862]),'ChatQueueId':Number(_0x617ce5['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x617ce5[_0xf9f3('0x46')]['ids']),'ChatQueueId':Number(_0x617ce5[_0xf9f3('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0xf7ee40,null))[_0xf9f3('0x2d')](handleError(_0xf7ee40,null));};exports[_0xf9f3('0x94')]=function(_0x3985c0,_0xb8bf5f,_0x266168){var _0x17696a={};var _0x424b2f={};var _0x7ca857;var _0x5253d8;return db[_0xf9f3('0x41')][_0xf9f3('0x63')]({'where':{'id':_0x3985c0[_0xf9f3('0x61')]['id']}})[_0xf9f3('0x22')](handleEntityNotFound(_0xb8bf5f,null))[_0xf9f3('0x22')](function(_0x4f57dc){if(_0x4f57dc){_0x7ca857=_0x4f57dc;_0x424b2f[_0xf9f3('0x45')]=_[_0xf9f3('0x47')](db['User']['rawAttributes']);_0x424b2f[_0xf9f3('0x46')]=_[_0xf9f3('0x47')](_0x3985c0[_0xf9f3('0x46')]);_0x424b2f[_0xf9f3('0x4f')]=_[_0xf9f3('0x48')](_0x424b2f['model'],_0x424b2f[_0xf9f3('0x46')]);_0x17696a[_0xf9f3('0x49')]=_['intersection'](_0x424b2f[_0xf9f3('0x45')],qs[_0xf9f3('0x4a')](_0x3985c0['query']['fields']));_0x17696a[_0xf9f3('0x49')]=_0x17696a['attributes'][_0xf9f3('0x4b')]?_0x17696a['attributes']:_0x424b2f['model'];_0x17696a[_0xf9f3('0x65')]=qs[_0xf9f3('0x4e')](_0x3985c0[_0xf9f3('0x46')][_0xf9f3('0x4e')]);_0x17696a[_0xf9f3('0x52')]=qs['filters'](_['pick'](_0x3985c0[_0xf9f3('0x46')],_0x424b2f['filters']));if(_0x3985c0['query'][_0xf9f3('0x51')]){_0x17696a['where']=_[_0xf9f3('0x53')](_0x17696a[_0xf9f3('0x52')],{'$or':_[_0xf9f3('0x40')](_0x17696a[_0xf9f3('0x49')],function(_0x1439e3){var _0x150245={};_0x150245[_0x1439e3]={'$like':'%'+_0x3985c0['query'][_0xf9f3('0x51')]+'%'};return _0x150245;})});}_0x17696a=_[_0xf9f3('0x53')]({},_0x17696a,_0x3985c0[_0xf9f3('0x55')]);return _0x7ca857[_0xf9f3('0x94')](_0x17696a);}})[_0xf9f3('0x22')](function(_0x5be103){if(_0x5be103){_0x5253d8=_0x5be103['length'];if(!_0x3985c0[_0xf9f3('0x46')]['hasOwnProperty'](_0xf9f3('0x4d'))){_0x17696a[_0xf9f3('0x34')]=qs[_0xf9f3('0x34')](_0x3985c0['query'][_0xf9f3('0x34')]);_0x17696a['offset']=qs[_0xf9f3('0x33')](_0x3985c0[_0xf9f3('0x46')][_0xf9f3('0x33')]);}return _0x7ca857[_0xf9f3('0x94')](_0x17696a);}})[_0xf9f3('0x22')](function(_0x32a513){if(_0x32a513){return _0x32a513?{'count':_0x5253d8,'rows':_0x32a513}:null;}})[_0xf9f3('0x22')](respondWithResult(_0xb8bf5f,null))[_0xf9f3('0x2d')](handleError(_0xb8bf5f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 0b2c4b6..9c373eb 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 _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3d235c,_0xa18dd1){var _0x56ae19=function(_0x13e842){while(--_0x13e842){_0x3d235c['push'](_0x3d235c['shift']());}};_0x56ae19(++_0xa18dd1);}(_0x0b0e,0x187));var _0xe0b0=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0x0b0e[_0xffd1b5];return _0x3176d6;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x57fb13,_0x45645d){var _0x2e2ac8=function(_0x4ce104){while(--_0x4ce104){_0x57fb13['push'](_0x57fb13['shift']());}};_0x2e2ac8(++_0x45645d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x314123,_0x3384dc){_0x314123=_0x314123-0x0;var _0x14e309=_0x5f2f[_0x314123];return _0x14e309;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 446a069..de7dafd 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 _0xfd40=['path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5c4d74,_0x1c4c05){var _0xd2ccf7=function(_0x170cfc){while(--_0x170cfc){_0x5c4d74['push'](_0x5c4d74['shift']());}};_0xd2ccf7(++_0x1c4c05);}(_0xfd40,0x14a));var _0x0fd4=function(_0x1ed48c,_0x423b70){_0x1ed48c=_0x1ed48c-0x0;var _0xd0a6cc=_0xfd40[_0x1ed48c];return _0xd0a6cc;};'use strict';var _=require(_0x0fd4('0x0'));var util=require(_0x0fd4('0x1'));var logger=require('../../config/logger')(_0x0fd4('0x2'));var moment=require(_0x0fd4('0x3'));var BPromise=require(_0x0fd4('0x4'));var rp=require(_0x0fd4('0x5'));var fs=require('fs');var path=require(_0x0fd4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0fd4('0x7'));module[_0x0fd4('0x8')]=function(_0x9f8a37,_0x333a92){return _0x9f8a37[_0x0fd4('0x9')](_0x0fd4('0xa'),attributes,{'tableName':_0x0fd4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64d1=['api','moment','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x416bb1,_0x965f5e){var _0x48fc39=function(_0x51acc1){while(--_0x51acc1){_0x416bb1['push'](_0x416bb1['shift']());}};_0x48fc39(++_0x965f5e);}(_0x64d1,0xb9));var _0x164d=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x64d1[_0x5cc8b9];return _0x58892e;};'use strict';var _=require(_0x164d('0x0'));var util=require('util');var logger=require(_0x164d('0x1'))(_0x164d('0x2'));var moment=require(_0x164d('0x3'));var BPromise=require('bluebird');var rp=require(_0x164d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x164d('0x5'));var config=require(_0x164d('0x6'));var attributes=require(_0x164d('0x7'));module[_0x164d('0x8')]=function(_0x34f875,_0x5d7478){return _0x34f875['define'](_0x164d('0x9'),attributes,{'tableName':_0x164d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 1466ecb..44d1e0a 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 _0x4639=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','socket.io-emitter','redis','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','bluebird','randomstring'];(function(_0x3ddd84,_0x2cbf16){var _0xfac0a2=function(_0x1dad7b){while(--_0x1dad7b){_0x3ddd84['push'](_0x3ddd84['shift']());}};_0xfac0a2(++_0x2cbf16);}(_0x4639,0x115));var _0x9463=function(_0x1f4f14,_0x570d4b){_0x1f4f14=_0x1f4f14-0x0;var _0x3135b1=_0x4639[_0x1f4f14];return _0x3135b1;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9463('0x1'));var rs=require(_0x9463('0x2'));var fs=require('fs');var Redis=require(_0x9463('0x3'));var db=require(_0x9463('0x4'))['db'];var utils=require(_0x9463('0x5'));var logger=require(_0x9463('0x6'))(_0x9463('0x7'));var config=require('../../config/environment');var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9463('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9463('0xb'))(new Redis(config[_0x9463('0xc')]));require(_0x9463('0xd'))['register'](socket);function respondWithRpcPromise(_0x224353,_0x1f77d0,_0x30370b){return new BPromise(function(_0x183ece,_0x35b98c){return client[_0x9463('0xe')](_0x224353,_0x30370b)[_0x9463('0xf')](function(_0x363ca5){logger[_0x9463('0x10')](_0x9463('0x11'),_0x1f77d0,_0x9463('0x12'));logger[_0x9463('0x13')](_0x9463('0x14'),_0x1f77d0,_0x9463('0x12'),JSON[_0x9463('0x15')](_0x363ca5));if(_0x363ca5[_0x9463('0x16')]){if(_0x363ca5[_0x9463('0x16')][_0x9463('0x17')]===0x1f4){logger[_0x9463('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1f77d0,_0x363ca5[_0x9463('0x16')]['message']);return _0x35b98c(_0x363ca5[_0x9463('0x16')][_0x9463('0x18')]);}logger[_0x9463('0x16')](_0x9463('0x11'),_0x1f77d0,_0x363ca5[_0x9463('0x16')]['message']);return _0x183ece(_0x363ca5[_0x9463('0x16')][_0x9463('0x18')]);}else{logger[_0x9463('0x10')]('ChatQueue,\x20%s,\x20%s',_0x1f77d0,'request\x20sent');_0x183ece(_0x363ca5[_0x9463('0x19')][_0x9463('0x18')]);}})[_0x9463('0x1a')](function(_0x3ba487){logger[_0x9463('0x16')](_0x9463('0x11'),_0x1f77d0,_0x3ba487);_0x35b98c(_0x3ba487);});});}exports[_0x9463('0x1b')]=function(_0x77df85){var _0xf2289=this;return new Promise(function(_0x39608b,_0x3d26e4){return db['ChatQueue'][_0x9463('0x1c')]({'raw':_0x77df85[_0x9463('0x1d')]?_0x77df85[_0x9463('0x1d')][_0x9463('0x1e')]===undefined?!![]:![]:!![],'where':_0x77df85['options']?_0x77df85[_0x9463('0x1d')][_0x9463('0x1f')]||null:null,'attributes':_0x77df85[_0x9463('0x1d')]?_0x77df85[_0x9463('0x1d')][_0x9463('0x20')]||null:null,'limit':_0x77df85[_0x9463('0x1d')]?_0x77df85[_0x9463('0x1d')][_0x9463('0x21')]||null:null,'include':_0x77df85[_0x9463('0x1d')]?_0x77df85[_0x9463('0x1d')][_0x9463('0x22')]?_[_0x9463('0x23')](_0x77df85[_0x9463('0x1d')][_0x9463('0x22')],function(_0x62286d){return{'model':db[_0x62286d[_0x9463('0x24')]],'as':_0x62286d['as'],'attributes':_0x62286d[_0x9463('0x20')],'include':_0x62286d[_0x9463('0x22')]?_['map'](_0x62286d[_0x9463('0x22')],function(_0x1293fa){return{'model':db[_0x1293fa[_0x9463('0x24')]],'as':_0x1293fa['as'],'attributes':_0x1293fa[_0x9463('0x20')],'include':_0x1293fa[_0x9463('0x22')]?_['map'](_0x1293fa[_0x9463('0x22')],function(_0x508128){return{'model':db[_0x508128[_0x9463('0x24')]],'as':_0x508128['as'],'attributes':_0x508128[_0x9463('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9463('0xf')](function(_0xb39a03){logger[_0x9463('0x10')](_0x9463('0x1b'),_0x77df85);logger[_0x9463('0x13')]('GetChatQueue',_0x77df85,JSON['stringify'](_0xb39a03));_0x39608b(_0xb39a03);})[_0x9463('0x1a')](function(_0x23a13f){logger[_0x9463('0x16')]('GetChatQueue',_0x23a13f[_0x9463('0x18')],_0x77df85);_0x3d26e4(_0xf2289[_0x9463('0x16')](0x1f4,_0x23a13f[_0x9463('0x18')]));});});};exports[_0x9463('0x25')]=function(_0x230611){var _0x1b8c59=this;return new Promise(function(_0x2aa7f3,_0x2f5422){return db[_0x9463('0x26')][_0x9463('0x27')]({'raw':_0x230611[_0x9463('0x1d')]?_0x230611[_0x9463('0x1d')][_0x9463('0x1e')]===undefined?!![]:![]:!![],'where':_0x230611[_0x9463('0x1d')]?_0x230611[_0x9463('0x1d')][_0x9463('0x1f')]||null:null,'attributes':_0x230611[_0x9463('0x1d')]?_0x230611[_0x9463('0x1d')][_0x9463('0x20')]||null:null,'include':_0x230611[_0x9463('0x1d')]?_0x230611[_0x9463('0x1d')]['include']?_['map'](_0x230611['options'][_0x9463('0x22')],function(_0xd9a798){return{'model':db[_0xd9a798[_0x9463('0x24')]],'as':_0xd9a798['as'],'attributes':_0xd9a798[_0x9463('0x20')],'include':_0xd9a798[_0x9463('0x22')]?_[_0x9463('0x23')](_0xd9a798[_0x9463('0x22')],function(_0x474360){return{'model':db[_0x474360[_0x9463('0x24')]],'as':_0x474360['as'],'attributes':_0x474360[_0x9463('0x20')],'include':_0x474360[_0x9463('0x22')]?_[_0x9463('0x23')](_0x474360[_0x9463('0x22')],function(_0x4bb877){return{'model':db[_0x4bb877[_0x9463('0x24')]],'as':_0x4bb877['as'],'attributes':_0x4bb877['attributes']};}):[]};}):[]};}):[]:[]})[_0x9463('0xf')](function(_0x493148){logger[_0x9463('0x10')](_0x9463('0x25'),_0x230611);logger[_0x9463('0x13')](_0x9463('0x25'),_0x230611,JSON[_0x9463('0x15')](_0x493148));_0x2aa7f3(_0x493148);})[_0x9463('0x1a')](function(_0x520582){logger[_0x9463('0x16')](_0x9463('0x25'),_0x520582[_0x9463('0x18')],_0x230611);_0x2f5422(_0x1b8c59[_0x9463('0x16')](0x1f4,_0x520582[_0x9463('0x18')]));});});}; \ No newline at end of file +var _0x52b8=['find','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','http','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue'];(function(_0x315b61,_0x4bb11e){var _0x3521e8=function(_0x5e6389){while(--_0x5e6389){_0x315b61['push'](_0x315b61['shift']());}};_0x3521e8(++_0x4bb11e);}(_0x52b8,0xd3));var _0x852b=function(_0x4ed496,_0x2852d1){_0x4ed496=_0x4ed496-0x0;var _0x3597cc=_0x52b8[_0x4ed496];return _0x3597cc;};'use strict';var _=require('lodash');var util=require(_0x852b('0x0'));var moment=require('moment');var BPromise=require(_0x852b('0x1'));var rs=require(_0x852b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x852b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x852b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x852b('0x5'));var client=jayson['client'][_0x852b('0x6')]({'port':0x232a});config[_0x852b('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x852b('0x8'))(new Redis(config[_0x852b('0x7')]));require(_0x852b('0x9'))[_0x852b('0xa')](socket);function respondWithRpcPromise(_0x1d5387,_0x5d4c6a,_0x213e24){return new BPromise(function(_0x12e3f4,_0x41a36b){return client[_0x852b('0xb')](_0x1d5387,_0x213e24)[_0x852b('0xc')](function(_0x56a9e7){logger[_0x852b('0xd')](_0x852b('0xe'),_0x5d4c6a,'request\x20sent');logger[_0x852b('0xf')](_0x852b('0x10'),_0x5d4c6a,'request\x20sent',JSON[_0x852b('0x11')](_0x56a9e7));if(_0x56a9e7[_0x852b('0x12')]){if(_0x56a9e7[_0x852b('0x12')]['code']===0x1f4){logger[_0x852b('0x12')](_0x852b('0xe'),_0x5d4c6a,_0x56a9e7[_0x852b('0x12')][_0x852b('0x13')]);return _0x41a36b(_0x56a9e7[_0x852b('0x12')][_0x852b('0x13')]);}logger[_0x852b('0x12')](_0x852b('0xe'),_0x5d4c6a,_0x56a9e7['error']['message']);return _0x12e3f4(_0x56a9e7[_0x852b('0x12')][_0x852b('0x13')]);}else{logger[_0x852b('0xd')]('ChatQueue,\x20%s,\x20%s',_0x5d4c6a,_0x852b('0x14'));_0x12e3f4(_0x56a9e7[_0x852b('0x15')][_0x852b('0x13')]);}})[_0x852b('0x16')](function(_0x16491a){logger[_0x852b('0x12')](_0x852b('0xe'),_0x5d4c6a,_0x16491a);_0x41a36b(_0x16491a);});});}exports[_0x852b('0x17')]=function(_0xa928f9){var _0x28326a=this;return new Promise(function(_0x272808,_0x15118e){return db[_0x852b('0x18')][_0x852b('0x19')]({'raw':_0xa928f9[_0x852b('0x1a')]?_0xa928f9[_0x852b('0x1a')][_0x852b('0x1b')]===undefined?!![]:![]:!![],'where':_0xa928f9[_0x852b('0x1a')]?_0xa928f9[_0x852b('0x1a')][_0x852b('0x1c')]||null:null,'attributes':_0xa928f9[_0x852b('0x1a')]?_0xa928f9[_0x852b('0x1a')][_0x852b('0x1d')]||null:null,'limit':_0xa928f9[_0x852b('0x1a')]?_0xa928f9['options']['limit']||null:null,'include':_0xa928f9[_0x852b('0x1a')]?_0xa928f9[_0x852b('0x1a')][_0x852b('0x1e')]?_[_0x852b('0x1f')](_0xa928f9[_0x852b('0x1a')][_0x852b('0x1e')],function(_0x2f8409){return{'model':db[_0x2f8409[_0x852b('0x20')]],'as':_0x2f8409['as'],'attributes':_0x2f8409[_0x852b('0x1d')],'include':_0x2f8409[_0x852b('0x1e')]?_[_0x852b('0x1f')](_0x2f8409[_0x852b('0x1e')],function(_0x5b586e){return{'model':db[_0x5b586e['model']],'as':_0x5b586e['as'],'attributes':_0x5b586e['attributes'],'include':_0x5b586e[_0x852b('0x1e')]?_[_0x852b('0x1f')](_0x5b586e[_0x852b('0x1e')],function(_0x399b1d){return{'model':db[_0x399b1d[_0x852b('0x20')]],'as':_0x399b1d['as'],'attributes':_0x399b1d[_0x852b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x852b('0xc')](function(_0x450838){logger[_0x852b('0xd')](_0x852b('0x17'),_0xa928f9);logger['debug']('GetChatQueue',_0xa928f9,JSON['stringify'](_0x450838));_0x272808(_0x450838);})['catch'](function(_0x4ca7ab){logger[_0x852b('0x12')]('GetChatQueue',_0x4ca7ab[_0x852b('0x13')],_0xa928f9);_0x15118e(_0x28326a[_0x852b('0x12')](0x1f4,_0x4ca7ab[_0x852b('0x13')]));});});};exports[_0x852b('0x21')]=function(_0x2c92ca){var _0x788147=this;return new Promise(function(_0x12c879,_0x4b7876){return db[_0x852b('0x18')][_0x852b('0x22')]({'raw':_0x2c92ca[_0x852b('0x1a')]?_0x2c92ca[_0x852b('0x1a')][_0x852b('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c92ca[_0x852b('0x1a')]?_0x2c92ca[_0x852b('0x1a')]['where']||null:null,'attributes':_0x2c92ca[_0x852b('0x1a')]?_0x2c92ca[_0x852b('0x1a')][_0x852b('0x1d')]||null:null,'include':_0x2c92ca[_0x852b('0x1a')]?_0x2c92ca[_0x852b('0x1a')]['include']?_[_0x852b('0x1f')](_0x2c92ca[_0x852b('0x1a')][_0x852b('0x1e')],function(_0x36955a){return{'model':db[_0x36955a[_0x852b('0x20')]],'as':_0x36955a['as'],'attributes':_0x36955a[_0x852b('0x1d')],'include':_0x36955a['include']?_[_0x852b('0x1f')](_0x36955a['include'],function(_0x4860f4){return{'model':db[_0x4860f4['model']],'as':_0x4860f4['as'],'attributes':_0x4860f4[_0x852b('0x1d')],'include':_0x4860f4[_0x852b('0x1e')]?_['map'](_0x4860f4['include'],function(_0x55df50){return{'model':db[_0x55df50[_0x852b('0x20')]],'as':_0x55df50['as'],'attributes':_0x55df50['attributes']};}):[]};}):[]};}):[]:[]})[_0x852b('0xc')](function(_0xb3e125){logger[_0x852b('0xd')](_0x852b('0x21'),_0x2c92ca);logger[_0x852b('0xf')](_0x852b('0x21'),_0x2c92ca,JSON[_0x852b('0x11')](_0xb3e125));_0x12c879(_0xb3e125);})[_0x852b('0x16')](function(_0x2c19f6){logger['error'](_0x852b('0x21'),_0x2c19f6[_0x852b('0x13')],_0x2c92ca);_0x4b7876(_0x788147[_0x852b('0x12')](0x1f4,_0x2c19f6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 60980c4..d56b500 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1230b9,_0xc27ede){_0x1230b9=_0x1230b9-0x0;var _0x34ebec=_0x5f2f[_0x1230b9];return _0x34ebec;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c021,_0x190f72){_0x27c021=_0x27c021-0x0;var _0x1d0700=_0xb10b[_0x27c021];return _0x1d0700;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 3e773c6..432aa1a 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 _0x08ea=['create','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatQueue.controller','index','/describe','isAuthenticated','describe','get','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x11e5a5,_0x5803b2){var _0x22bb8d=function(_0x597537){while(--_0x597537){_0x11e5a5['push'](_0x11e5a5['shift']());}};_0x22bb8d(++_0x5803b2);}(_0x08ea,0x8c));var _0xa08e=function(_0x681764,_0x2a4cd9){_0x681764=_0x681764-0x0;var _0x19885f=_0x08ea[_0x681764];return _0x19885f;};'use strict';var multer=require(_0xa08e('0x0'));var util=require('util');var path=require(_0xa08e('0x1'));var timeout=require(_0xa08e('0x2'));var express=require(_0xa08e('0x3'));var router=express[_0xa08e('0x4')]();var auth=require(_0xa08e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa08e('0x6'));var controller=require(_0xa08e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa08e('0x8')]);router['get'](_0xa08e('0x9'),auth[_0xa08e('0xa')](),controller[_0xa08e('0xb')]);router[_0xa08e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa08e('0xd')]);router['get'](_0xa08e('0xe'),auth[_0xa08e('0xa')](),controller[_0xa08e('0xf')]);router[_0xa08e('0xc')](_0xa08e('0x10'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x11')]);router[_0xa08e('0xc')](_0xa08e('0x12'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x13')]);router['post']('/',auth[_0xa08e('0xa')](),controller[_0xa08e('0x14')]);router[_0xa08e('0x15')](_0xa08e('0x10'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x16')]);router[_0xa08e('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xa08e('0x17')]);router[_0xa08e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xa08e('0x19')]);router[_0xa08e('0x1a')](_0xa08e('0x1b'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x1c')]);router[_0xa08e('0x1a')](_0xa08e('0x10'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x1d')]);router[_0xa08e('0x1a')](_0xa08e('0x12'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x1e')]);module[_0xa08e('0x1f')]=router; \ No newline at end of file +var _0xe397=['put','/:id','update','destroy','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents'];(function(_0x37b7be,_0x5447b1){var _0x19cca6=function(_0x268cd5){while(--_0x268cd5){_0x37b7be['push'](_0x37b7be['shift']());}};_0x19cca6(++_0x5447b1);}(_0xe397,0xa2));var _0x7e39=function(_0x1e49ee,_0x3257b6){_0x1e49ee=_0x1e49ee-0x0;var _0x3dcf1e=_0xe397[_0x1e49ee];return _0x3dcf1e;};'use strict';var multer=require(_0x7e39('0x0'));var util=require(_0x7e39('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e39('0x2')]();var auth=require(_0x7e39('0x3'));var interaction=require(_0x7e39('0x4'));var config=require(_0x7e39('0x5'));var controller=require(_0x7e39('0x6'));router[_0x7e39('0x7')]('/',auth[_0x7e39('0x8')](),controller['index']);router[_0x7e39('0x7')](_0x7e39('0x9'),auth[_0x7e39('0x8')](),controller[_0x7e39('0xa')]);router[_0x7e39('0x7')]('/:id',auth[_0x7e39('0x8')](),controller[_0x7e39('0xb')]);router[_0x7e39('0x7')]('/:id/members',auth[_0x7e39('0x8')](),controller[_0x7e39('0xc')]);router[_0x7e39('0x7')](_0x7e39('0xd'),auth[_0x7e39('0x8')](),controller[_0x7e39('0xe')]);router[_0x7e39('0x7')](_0x7e39('0xf'),auth[_0x7e39('0x8')](),controller['getAgents']);router[_0x7e39('0x10')]('/',auth['isAuthenticated'](),controller[_0x7e39('0x11')]);router[_0x7e39('0x10')](_0x7e39('0xd'),auth[_0x7e39('0x8')](),controller[_0x7e39('0x12')]);router[_0x7e39('0x10')](_0x7e39('0xf'),auth[_0x7e39('0x8')](),controller[_0x7e39('0x13')]);router[_0x7e39('0x14')](_0x7e39('0x15'),auth[_0x7e39('0x8')](),controller[_0x7e39('0x16')]);router['delete'](_0x7e39('0x15'),auth[_0x7e39('0x8')](),controller[_0x7e39('0x17')]);router[_0x7e39('0x18')](_0x7e39('0xd'),auth[_0x7e39('0x8')](),controller['removeTeams']);router[_0x7e39('0x18')]('/:id/users',auth[_0x7e39('0x8')](),controller['removeAgents']);module[_0x7e39('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index e660178..da56ac3 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 _0x5140=['moment','exports','STRING','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5140,0x174));var _0x0514=function(_0x38eec9,_0x3548aa){_0x38eec9=_0x38eec9-0x0;var _0x3691bc=_0x5140[_0x38eec9];return _0x3691bc;};'use strict';var moment=require(_0x0514('0x0'));var Sequelize=require('sequelize');module[_0x0514('0x1')]={'uniqueid':{'type':Sequelize[_0x0514('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0514('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0514('0x3')]},'acceptAt':{'type':Sequelize[_0x0514('0x3')]},'exitAt':{'type':Sequelize[_0x0514('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b4b=['moment','sequelize','exports','STRING','DATE'];(function(_0x2bfa06,_0x351e03){var _0x58811b=function(_0x624504){while(--_0x624504){_0x2bfa06['push'](_0x2bfa06['shift']());}};_0x58811b(++_0x351e03);}(_0x7b4b,0xa0));var _0xb7b4=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0x7b4b[_0x1ac77b];return _0x161584;};'use strict';var moment=require(_0xb7b4('0x0'));var Sequelize=require(_0xb7b4('0x1'));module[_0xb7b4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb7b4('0x3')]},'joinAt':{'type':Sequelize[_0xb7b4('0x4')]},'leaveAt':{'type':Sequelize[_0xb7b4('0x4')]},'acceptAt':{'type':Sequelize[_0xb7b4('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb7b4('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index d80508b..5b8e27e 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 _0x757a=['count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','options','ChatQueueReport'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x757a,0xde));var _0xa757=function(_0x583bb9,_0x1b8950){_0x583bb9=_0x583bb9-0x0;var _0x9d82b6=_0x757a[_0x583bb9];return _0x9d82b6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['ChatQueueReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]),_0x5a5664);if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['ChatQueueReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));};exports[_0xa757('0x45')]=function(_0x15bad7,_0x2c5b3c){return db[_0xa757('0x39')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2c5b3c,null))[_0xa757('0x3d')](handleError(_0x2c5b3c,null));}; \ No newline at end of file +var _0xd8b0=['intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','ChatQueueReport','count','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','html-pdf','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','index','map','rawAttributes','fieldName','key','query','keys'];(function(_0xd2b6cb,_0x474f4d){var _0x1205ad=function(_0x7afc84){while(--_0x7afc84){_0xd2b6cb['push'](_0xd2b6cb['shift']());}};_0x1205ad(++_0x474f4d);}(_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={},_0x28f639={},_0x3ef745={'count':0x0,'rows':[]};var _0x4c05ee=_[_0x0d8b('0x28')](db['ChatQueueReport'][_0x0d8b('0x29')],function(_0x4b59e5){return{'name':_0x4b59e5[_0x0d8b('0x2a')],'type':_0x4b59e5['type'][_0x0d8b('0x2b')]};});_0x28f639['model']=_[_0x0d8b('0x28')](_0x4c05ee,'name');_0x28f639[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0xa2af02[_0x0d8b('0x2c')]);_0x28f639['filters']=_['intersection'](_0x28f639['model'],_0x28f639[_0x0d8b('0x2c')]);_0x59a905['attributes']=_[_0x0d8b('0x2e')](_0x28f639['model'],qs['fields'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x2f')]));_0x59a905[_0x0d8b('0x30')]=_0x59a905[_0x0d8b('0x30')][_0x0d8b('0x31')]?_0x59a905[_0x0d8b('0x30')]:_0x28f639[_0x0d8b('0x32')];if(!_0xa2af02[_0x0d8b('0x2c')]['hasOwnProperty'](_0x0d8b('0x33'))){_0x59a905[_0x0d8b('0x1b')]=qs['limit'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x59a905[_0x0d8b('0x1a')]=qs['offset'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x59a905[_0x0d8b('0x34')]=qs[_0x0d8b('0x35')](_0xa2af02[_0x0d8b('0x2c')]['sort']);_0x59a905[_0x0d8b('0x36')]=qs[_0x0d8b('0x37')](_['pick'](_0xa2af02[_0x0d8b('0x2c')],_0x28f639[_0x0d8b('0x37')]),_0x4c05ee);if(_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x59a905[_0x0d8b('0x36')]=_['merge'](_0x59a905['where'],{'$or':_[_0x0d8b('0x28')](_0x4c05ee,function(_0x5c2c04){if(_0x5c2c04['type']!==_0x0d8b('0x39')){var _0x2e279c={};_0x2e279c[_0x5c2c04[_0x0d8b('0x25')]]={'$like':'%'+_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x2e279c;}})});}_0x59a905=_[_0x0d8b('0x3a')]({},_0x59a905,_0xa2af02['options']);var _0x6e5bab={'where':_0x59a905[_0x0d8b('0x36')]};return db[_0x0d8b('0x3b')][_0x0d8b('0x3c')](_0x6e5bab)[_0x0d8b('0x22')](function(_0x1a39ad){_0x3ef745[_0x0d8b('0x3c')]=_0x1a39ad;if(_0xa2af02['query'][_0x0d8b('0x3d')]){_0x59a905[_0x0d8b('0x3e')]=[{'all':!![]}];}return db[_0x0d8b('0x3b')][_0x0d8b('0x3f')](_0x59a905);})['then'](function(_0xe0bf42){_0x3ef745['rows']=_0xe0bf42;return _0x3ef745;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4fe6f9,_0x59a905))[_0x0d8b('0x40')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x41')]=function(_0x26ac10,_0x35fa7e){var _0x3e632e={'raw':!![],'where':{'id':_0x26ac10[_0x0d8b('0x42')]['id']}},_0x1ff17d={};_0x1ff17d[_0x0d8b('0x32')]=_[_0x0d8b('0x2d')](db['ChatQueueReport']['rawAttributes']);_0x1ff17d['query']=_['keys'](_0x26ac10['query']);_0x1ff17d[_0x0d8b('0x37')]=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],_0x1ff17d['query']);_0x3e632e['attributes']=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],qs[_0x0d8b('0x2f')](_0x26ac10['query'][_0x0d8b('0x2f')]));_0x3e632e[_0x0d8b('0x30')]=_0x3e632e['attributes']['length']?_0x3e632e[_0x0d8b('0x30')]:_0x1ff17d['model'];if(_0x26ac10[_0x0d8b('0x2c')]['includeAll']){_0x3e632e['include']=[{'all':!![]}];}_0x3e632e=_[_0x0d8b('0x3a')]({},_0x3e632e,_0x26ac10[_0x0d8b('0x43')]);return db['ChatQueueReport']['find'](_0x3e632e)['then'](handleEntityNotFound(_0x35fa7e,null))['then'](respondWithResult(_0x35fa7e,null))[_0x0d8b('0x40')](handleError(_0x35fa7e,null));};exports[_0x0d8b('0x44')]=function(_0xd9d4c3,_0x490eda){return db[_0x0d8b('0x3b')][_0x0d8b('0x44')](_0xd9d4c3[_0x0d8b('0x45')],{})[_0x0d8b('0x22')](respondWithResult(_0x490eda,0xc9))[_0x0d8b('0x40')](handleError(_0x490eda,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x45')]['id']){delete _0x11d22b[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x3b')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x45')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x40')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x47')]=function(_0x574b90,_0x371fa0){return db['ChatQueueReport']['find']({'where':{'id':_0x574b90[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x371fa0,null))[_0x0d8b('0x22')](removeEntity(_0x371fa0,null))[_0x0d8b('0x40')](handleError(_0x371fa0,null));};exports['describe']=function(_0x131579,_0x1106d6){return db[_0x0d8b('0x3b')][_0x0d8b('0x48')]()[_0x0d8b('0x22')](respondWithResult(_0x1106d6,null))['catch'](handleError(_0x1106d6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d7dcd05..2b48058 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 _0x6455=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash'];(function(_0x26507b,_0x50d393){var _0x4f907f=function(_0x13a657){while(--_0x13a657){_0x26507b['push'](_0x26507b['shift']());}};_0x4f907f(++_0x50d393);}(_0x6455,0x137));var _0x5645=function(_0x45cbd2,_0x206f65){_0x45cbd2=_0x45cbd2-0x0;var _0x354b65=_0x6455[_0x45cbd2];return _0x354b65;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5645('0x3'));var fs=require('fs');var path=require(_0x5645('0x4'));var rimraf=require(_0x5645('0x5'));var config=require(_0x5645('0x6'));var attributes=require('./chatQueueReport.attributes');module[_0x5645('0x7')]=function(_0x25b9d6,_0x1d2305){return _0x25b9d6[_0x5645('0x8')](_0x5645('0x9'),attributes,{'tableName':_0x5645('0xa'),'paranoid':![],'indexes':[{'name':_0x5645('0xb'),'fields':[_0x5645('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf6f=['./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4151c3,_0x2e247c){var _0x191a21=function(_0x4b7b47){while(--_0x4b7b47){_0x4151c3['push'](_0x4151c3['shift']());}};_0x191a21(++_0x2e247c);}(_0xcf6f,0x67));var _0xfcf6=function(_0x4b53d1,_0x3a87ea){_0x4b53d1=_0x4b53d1-0x0;var _0x20a201=_0xcf6f[_0x4b53d1];return _0x20a201;};'use strict';var _=require(_0xfcf6('0x0'));var util=require(_0xfcf6('0x1'));var logger=require(_0xfcf6('0x2'))(_0xfcf6('0x3'));var moment=require(_0xfcf6('0x4'));var BPromise=require(_0xfcf6('0x5'));var rp=require(_0xfcf6('0x6'));var fs=require('fs');var path=require(_0xfcf6('0x7'));var rimraf=require('rimraf');var config=require(_0xfcf6('0x8'));var attributes=require(_0xfcf6('0x9'));module[_0xfcf6('0xa')]=function(_0x361abd,_0x2ab3c6){return _0x361abd[_0xfcf6('0xb')](_0xfcf6('0xc'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0xfcf6('0xd'),'fields':[_0xfcf6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d13119a..046b59d 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 _0xb19e=['limit','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','update','raw','where','attributes'];(function(_0x507962,_0x2e50db){var _0x3d4660=function(_0x110332){while(--_0x110332){_0x507962['push'](_0x507962['shift']());}};_0x3d4660(++_0x2e50db);}(_0xb19e,0x187));var _0xeb19=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0xb19e[_0x29d2d2];return _0x3f6476;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var moment=require(_0xeb19('0x2'));var BPromise=require(_0xeb19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeb19('0x5'))('rpc');var config=require(_0xeb19('0x6'));var jayson=require(_0xeb19('0x7'));var client=jayson[_0xeb19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x508507,_0x3a65bb,_0x5ec428){return new BPromise(function(_0x2ea12c,_0x5bd778){return client[_0xeb19('0x9')](_0x508507,_0x5ec428)[_0xeb19('0xa')](function(_0x41efa1){logger[_0xeb19('0xb')](_0xeb19('0xc'),_0x3a65bb,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3a65bb,_0xeb19('0xd'),JSON[_0xeb19('0xe')](_0x41efa1));if(_0x41efa1[_0xeb19('0xf')]){if(_0x41efa1[_0xeb19('0xf')]['code']===0x1f4){logger[_0xeb19('0xf')](_0xeb19('0xc'),_0x3a65bb,_0x41efa1[_0xeb19('0xf')][_0xeb19('0x10')]);return _0x5bd778(_0x41efa1[_0xeb19('0xf')][_0xeb19('0x10')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3a65bb,_0x41efa1[_0xeb19('0xf')][_0xeb19('0x10')]);return _0x2ea12c(_0x41efa1[_0xeb19('0xf')][_0xeb19('0x10')]);}else{logger[_0xeb19('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3a65bb,_0xeb19('0xd'));_0x2ea12c(_0x41efa1['result'][_0xeb19('0x10')]);}})[_0xeb19('0x11')](function(_0x57a9bb){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3a65bb,_0x57a9bb);_0x5bd778(_0x57a9bb);});});}exports[_0xeb19('0x12')]=function(_0x1eb305){var _0x2ab088=this;return new Promise(function(_0x27ab78,_0x16f703){return db[_0xeb19('0x13')][_0xeb19('0x14')](_0x1eb305[_0xeb19('0x15')],{'raw':_0x1eb305[_0xeb19('0x16')]?_0x1eb305[_0xeb19('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xeb19('0xa')](function(_0x1290b3){logger[_0xeb19('0xb')](_0xeb19('0x12'),_0x1eb305);logger[_0xeb19('0x17')](_0xeb19('0x12'),_0x1eb305,JSON[_0xeb19('0xe')](_0x1290b3));_0x27ab78(_0x1290b3);})[_0xeb19('0x11')](function(_0x170010){logger[_0xeb19('0xf')](_0xeb19('0x12'),_0x170010['message'],_0x1eb305);_0x16f703(_0x2ab088[_0xeb19('0xf')](0x1f4,_0x170010[_0xeb19('0x10')]));});});};exports[_0xeb19('0x18')]=function(_0x8ea878){var _0x4a0d40=this;return new Promise(function(_0x239456,_0x269438){return db['ChatQueueReport'][_0xeb19('0x19')](_0x8ea878[_0xeb19('0x15')],{'raw':_0x8ea878[_0xeb19('0x16')]?_0x8ea878['options'][_0xeb19('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ea878['options']?_0x8ea878['options'][_0xeb19('0x1b')]||null:null,'attributes':_0x8ea878['options']?_0x8ea878[_0xeb19('0x16')][_0xeb19('0x1c')]||null:null,'limit':_0x8ea878[_0xeb19('0x16')]?_0x8ea878[_0xeb19('0x16')][_0xeb19('0x1d')]||null:null})[_0xeb19('0xa')](function(_0x33f114){logger['info'](_0xeb19('0x18'),_0x8ea878);logger['debug'](_0xeb19('0x18'),_0x8ea878,JSON[_0xeb19('0xe')](_0x33f114));_0x239456(_0x33f114);})[_0xeb19('0x11')](function(_0x2dce16){logger[_0xeb19('0xf')]('UpdateChatQueueReport',_0x2dce16[_0xeb19('0x10')],_0x8ea878);_0x269438(_0x4a0d40[_0xeb19('0xf')](0x1f4,_0x2dce16[_0xeb19('0x10')]));});});}; \ No newline at end of file +var _0xafdc=['ChatQueueReport,\x20%s,\x20%s','message','create','options','raw','CreateChatQueueReport','stringify','catch','UpdateChatQueueReport','ChatQueueReport','update','body','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xafdc,0x1af));var _0xcafd=function(_0x2ac608,_0x4ffc74){_0x2ac608=_0x2ac608-0x0;var _0x1e9151=_0xafdc[_0x2ac608];return _0x1e9151;};'use strict';var _=require(_0xcafd('0x0'));var util=require(_0xcafd('0x1'));var moment=require('moment');var BPromise=require(_0xcafd('0x2'));var rs=require(_0xcafd('0x3'));var fs=require('fs');var Redis=require(_0xcafd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcafd('0x5'));var logger=require('../../config/logger')(_0xcafd('0x6'));var config=require(_0xcafd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcafd('0x8')][_0xcafd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33710e,_0x26ebe6,_0x1568ca){return new BPromise(function(_0x186ce0,_0x175f56){return client[_0xcafd('0xa')](_0x33710e,_0x1568ca)[_0xcafd('0xb')](function(_0x37d151){logger[_0xcafd('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x26ebe6,_0xcafd('0xd'));logger[_0xcafd('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x26ebe6,_0xcafd('0xd'),JSON['stringify'](_0x37d151));if(_0x37d151[_0xcafd('0xf')]){if(_0x37d151[_0xcafd('0xf')][_0xcafd('0x10')]===0x1f4){logger[_0xcafd('0xf')](_0xcafd('0x11'),_0x26ebe6,_0x37d151['error'][_0xcafd('0x12')]);return _0x175f56(_0x37d151['error'][_0xcafd('0x12')]);}logger[_0xcafd('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x26ebe6,_0x37d151['error'][_0xcafd('0x12')]);return _0x186ce0(_0x37d151[_0xcafd('0xf')][_0xcafd('0x12')]);}else{logger[_0xcafd('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x26ebe6,'request\x20sent');_0x186ce0(_0x37d151['result'][_0xcafd('0x12')]);}})['catch'](function(_0x382551){logger[_0xcafd('0xf')](_0xcafd('0x11'),_0x26ebe6,_0x382551);_0x175f56(_0x382551);});});}exports['CreateChatQueueReport']=function(_0xe67922){var _0x5040af=this;return new Promise(function(_0x47f55a,_0x1abc43){return db['ChatQueueReport'][_0xcafd('0x13')](_0xe67922['body'],{'raw':_0xe67922[_0xcafd('0x14')]?_0xe67922[_0xcafd('0x14')][_0xcafd('0x15')]===undefined?!![]:![]:!![]})[_0xcafd('0xb')](function(_0xc28bcc){logger['info'](_0xcafd('0x16'),_0xe67922);logger[_0xcafd('0xe')](_0xcafd('0x16'),_0xe67922,JSON[_0xcafd('0x17')](_0xc28bcc));_0x47f55a(_0xc28bcc);})[_0xcafd('0x18')](function(_0x146f13){logger['error'](_0xcafd('0x16'),_0x146f13[_0xcafd('0x12')],_0xe67922);_0x1abc43(_0x5040af[_0xcafd('0xf')](0x1f4,_0x146f13[_0xcafd('0x12')]));});});};exports[_0xcafd('0x19')]=function(_0x59bb96){var _0x314b01=this;return new Promise(function(_0x343b35,_0x3ba3b1){return db[_0xcafd('0x1a')][_0xcafd('0x1b')](_0x59bb96[_0xcafd('0x1c')],{'raw':_0x59bb96[_0xcafd('0x14')]?_0x59bb96[_0xcafd('0x14')][_0xcafd('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59bb96[_0xcafd('0x14')]?_0x59bb96[_0xcafd('0x14')][_0xcafd('0x1d')]||null:null,'attributes':_0x59bb96[_0xcafd('0x14')]?_0x59bb96['options'][_0xcafd('0x1e')]||null:null,'limit':_0x59bb96['options']?_0x59bb96['options'][_0xcafd('0x1f')]||null:null})[_0xcafd('0xb')](function(_0x5b5cf3){logger[_0xcafd('0xc')](_0xcafd('0x19'),_0x59bb96);logger['debug']('UpdateChatQueueReport',_0x59bb96,JSON[_0xcafd('0x17')](_0x5b5cf3));_0x343b35(_0x5b5cf3);})['catch'](function(_0x5be84a){logger['error'](_0xcafd('0x19'),_0x5be84a[_0xcafd('0x12')],_0x59bb96);_0x3ba3b1(_0x314b01[_0xcafd('0xf')](0x1f4,_0x5be84a[_0xcafd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9a6ca5b..7fe710d 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 _0xda40=['update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x33e613,_0x2e55f0){var _0x421c4b=function(_0x414491){while(--_0x414491){_0x33e613['push'](_0x33e613['shift']());}};_0x421c4b(++_0x2e55f0);}(_0xda40,0xbf));var _0x0da4=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xda40[_0x146837];return _0x3d7e60;};'use strict';var multer=require(_0x0da4('0x0'));var util=require('util');var path=require(_0x0da4('0x1'));var timeout=require('connect-timeout');var express=require(_0x0da4('0x2'));var router=express['Router']();var auth=require(_0x0da4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0da4('0x4'));var controller=require('./chatQueueReport.controller');router[_0x0da4('0x5')]('/',auth[_0x0da4('0x6')](),controller[_0x0da4('0x7')]);router[_0x0da4('0x5')]('/describe',auth[_0x0da4('0x6')](),controller[_0x0da4('0x8')]);router[_0x0da4('0x5')](_0x0da4('0x9'),auth[_0x0da4('0x6')](),controller[_0x0da4('0xa')]);router[_0x0da4('0xb')]('/',auth[_0x0da4('0x6')](),controller[_0x0da4('0xc')]);router['put'](_0x0da4('0x9'),auth[_0x0da4('0x6')](),controller[_0x0da4('0xd')]);router[_0x0da4('0xe')](_0x0da4('0x9'),auth[_0x0da4('0x6')](),controller[_0x0da4('0xf')]);module[_0x0da4('0x10')]=router; \ No newline at end of file +var _0xaa78=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaa78,0x172));var _0x8aa7=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0xaa78[_0x35d59c];return _0x18cd27;};'use strict';var multer=require(_0x8aa7('0x0'));var util=require(_0x8aa7('0x1'));var path=require(_0x8aa7('0x2'));var timeout=require(_0x8aa7('0x3'));var express=require(_0x8aa7('0x4'));var router=express['Router']();var auth=require(_0x8aa7('0x5'));var interaction=require(_0x8aa7('0x6'));var config=require(_0x8aa7('0x7'));var controller=require(_0x8aa7('0x8'));router[_0x8aa7('0x9')]('/',auth[_0x8aa7('0xa')](),controller['index']);router[_0x8aa7('0x9')](_0x8aa7('0xb'),auth[_0x8aa7('0xa')](),controller[_0x8aa7('0xc')]);router['get'](_0x8aa7('0xd'),auth[_0x8aa7('0xa')](),controller[_0x8aa7('0xe')]);router[_0x8aa7('0xf')]('/',auth[_0x8aa7('0xa')](),controller[_0x8aa7('0x10')]);router[_0x8aa7('0x11')](_0x8aa7('0xd'),auth[_0x8aa7('0xa')](),controller[_0x8aa7('0x12')]);router['delete'](_0x8aa7('0xd'),auth[_0x8aa7('0xa')](),controller[_0x8aa7('0x13')]);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 4f0efca..9331003 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 _0x3728=['queue','DATE','moment','sequelize','exports','STRING','ENUM','agent'];(function(_0x2f63e4,_0x44499a){var _0x1fe1ce=function(_0x3cc862){while(--_0x3cc862){_0x2f63e4['push'](_0x2f63e4['shift']());}};_0x1fe1ce(++_0x44499a);}(_0x3728,0x82));var _0x8372=function(_0x3c8476,_0x5c0b5d){_0x3c8476=_0x3c8476-0x0;var _0x1eab91=_0x3728[_0x3c8476];return _0x1eab91;};'use strict';var moment=require(_0x8372('0x0'));var Sequelize=require(_0x8372('0x1'));module[_0x8372('0x2')]={'uniqueid':{'type':Sequelize[_0x8372('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8372('0x4')]('account',_0x8372('0x5'),_0x8372('0x6')),'allowNull':![],'defaultValue':_0x8372('0x6')},'transferredAt':{'type':Sequelize[_0x8372('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x9944=['account','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x870c69,_0x90aae5){var _0x5116fc=function(_0x298b97){while(--_0x298b97){_0x870c69['push'](_0x870c69['shift']());}};_0x5116fc(++_0x90aae5);}(_0x9944,0x1d3));var _0x4994=function(_0xb51ada,_0xc5907a){_0xb51ada=_0xb51ada-0x0;var _0x25da2c=_0x9944[_0xb51ada];return _0x25da2c;};'use strict';var moment=require(_0x4994('0x0'));var Sequelize=require(_0x4994('0x1'));module[_0x4994('0x2')]={'uniqueid':{'type':Sequelize[_0x4994('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4994('0x4')](_0x4994('0x5'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x4994('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x4994('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d10424d..eaf907b 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 _0xc568=['send','index','ChatTransferReport','rawAttributes','model','map','query','keys','filters','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','intersection','length','include','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','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','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc568,0x102));var _0x8c56=function(_0x1634bf,_0xda08a7){_0x1634bf=_0x1634bf-0x0;var _0x32643d=_0xc568[_0x1634bf];return _0x32643d;};'use strict';var pdf=require(_0x8c56('0x0'));var emlformat=require(_0x8c56('0x1'));var rimraf=require(_0x8c56('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c56('0x3'));var rp=require(_0x8c56('0x4'));var moment=require(_0x8c56('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8c56('0x6'));var path=require(_0x8c56('0x7'));var sox=require(_0x8c56('0x8'));var csv=require(_0x8c56('0x9'));var ejs=require(_0x8c56('0xa'));var fs=require('fs');var _=require(_0x8c56('0xb'));var squel=require(_0x8c56('0xc'));var crypto=require(_0x8c56('0xd'));var jsforce=require(_0x8c56('0xe'));var deskjs=require(_0x8c56('0xf'));var toCsv=require(_0x8c56('0x9'));var querystring=require(_0x8c56('0x10'));var Papa=require(_0x8c56('0x11'));var Redis=require(_0x8c56('0x12'));var authService=require(_0x8c56('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8c56('0x14'));var hardwareService=require(_0x8c56('0x15'));var logger=require(_0x8c56('0x16'))(_0x8c56('0x17'));var utils=require(_0x8c56('0x18'));var config=require(_0x8c56('0x19'));var db=require(_0x8c56('0x1a'))['db'];function respondWithStatusCode(_0x544f39,_0x2d8b12){_0x2d8b12=_0x2d8b12||0xcc;return function(_0xecb376){if(_0xecb376){return _0x544f39[_0x8c56('0x1b')](_0x2d8b12);}return _0x544f39[_0x8c56('0x1c')](_0x2d8b12)[_0x8c56('0x1d')]();};}function respondWithResult(_0x33734c,_0x23c9b7){_0x23c9b7=_0x23c9b7||0xc8;return function(_0x1458ba){if(_0x1458ba){return _0x33734c['status'](_0x23c9b7)[_0x8c56('0x1e')](_0x1458ba);}};}function respondWithFilteredResult(_0x2bd643,_0x172064){return function(_0x4fdf1a){if(_0x4fdf1a){var _0x547f9d=_0x4fdf1a[_0x8c56('0x1f')],_0x35d0ad=_0x172064[_0x8c56('0x20')],_0x5c4e9b=_0x172064[_0x8c56('0x20')]+_0x172064['limit'],_0x3a65fd;if(_0x5c4e9b>=_0x547f9d){_0x5c4e9b=_0x547f9d;_0x3a65fd=0xc8;}else{_0x3a65fd=0xce;}_0x2bd643[_0x8c56('0x1c')](_0x3a65fd);return _0x2bd643[_0x8c56('0x21')](_0x8c56('0x22'),_0x35d0ad+'-'+_0x5c4e9b+'/'+_0x547f9d)[_0x8c56('0x1e')](_0x4fdf1a);}return null;};}function patchUpdates(_0x1ae4a3){return function(_0xa7eeb5){try{jsonpatch[_0x8c56('0x23')](_0xa7eeb5,_0x1ae4a3,!![]);}catch(_0x34ae3f){return BPromise[_0x8c56('0x24')](_0x34ae3f);}return _0xa7eeb5[_0x8c56('0x25')]();};}function saveUpdates(_0x32822d,_0x1d2de6){return function(_0x2f4dfe){if(_0x2f4dfe){return _0x2f4dfe['update'](_0x32822d)[_0x8c56('0x26')](function(_0xb2927c){return _0xb2927c;});}return null;};}function removeEntity(_0x1b93bf,_0x585e0e){return function(_0x4e8dae){if(_0x4e8dae){return _0x4e8dae[_0x8c56('0x27')]()[_0x8c56('0x26')](function(){_0x1b93bf[_0x8c56('0x1c')](0xcc)[_0x8c56('0x1d')]();});}};}function handleEntityNotFound(_0x3284c3,_0x34911e){return function(_0x2d9ff1){if(!_0x2d9ff1){_0x3284c3[_0x8c56('0x1b')](0x194);}return _0x2d9ff1;};}function handleError(_0x9c3240,_0x18aefb){_0x18aefb=_0x18aefb||0x1f4;return function(_0x345848){logger[_0x8c56('0x28')](_0x345848['stack']);if(_0x345848[_0x8c56('0x29')]){delete _0x345848[_0x8c56('0x29')];}_0x9c3240['status'](_0x18aefb)[_0x8c56('0x2a')](_0x345848);};}exports[_0x8c56('0x2b')]=function(_0x44fe35,_0x4a77ba){var _0x4b886c={},_0x5223d7={},_0x749d4a={'count':0x0,'rows':[]};var _0x1d69d6=_['map'](db[_0x8c56('0x2c')][_0x8c56('0x2d')],function(_0x56698d){return{'name':_0x56698d['fieldName'],'type':_0x56698d['type']['key']};});_0x5223d7[_0x8c56('0x2e')]=_[_0x8c56('0x2f')](_0x1d69d6,_0x8c56('0x29'));_0x5223d7[_0x8c56('0x30')]=_[_0x8c56('0x31')](_0x44fe35[_0x8c56('0x30')]);_0x5223d7[_0x8c56('0x32')]=_['intersection'](_0x5223d7[_0x8c56('0x2e')],_0x5223d7['query']);_0x4b886c[_0x8c56('0x33')]=_['intersection'](_0x5223d7[_0x8c56('0x2e')],qs[_0x8c56('0x34')](_0x44fe35[_0x8c56('0x30')][_0x8c56('0x34')]));_0x4b886c[_0x8c56('0x33')]=_0x4b886c[_0x8c56('0x33')]['length']?_0x4b886c[_0x8c56('0x33')]:_0x5223d7[_0x8c56('0x2e')];if(!_0x44fe35[_0x8c56('0x30')][_0x8c56('0x35')]('nolimit')){_0x4b886c[_0x8c56('0x36')]=qs[_0x8c56('0x36')](_0x44fe35['query'][_0x8c56('0x36')]);_0x4b886c[_0x8c56('0x20')]=qs[_0x8c56('0x20')](_0x44fe35[_0x8c56('0x30')][_0x8c56('0x20')]);}_0x4b886c[_0x8c56('0x37')]=qs[_0x8c56('0x38')](_0x44fe35[_0x8c56('0x30')][_0x8c56('0x38')]);_0x4b886c[_0x8c56('0x39')]=qs['filters'](_['pick'](_0x44fe35['query'],_0x5223d7['filters']),_0x1d69d6);if(_0x44fe35[_0x8c56('0x30')][_0x8c56('0x3a')]){_0x4b886c[_0x8c56('0x39')]=_['merge'](_0x4b886c[_0x8c56('0x39')],{'$or':_[_0x8c56('0x2f')](_0x1d69d6,function(_0x31dfdd){if(_0x31dfdd['type']!==_0x8c56('0x3b')){var _0xb01378={};_0xb01378[_0x31dfdd['name']]={'$like':'%'+_0x44fe35[_0x8c56('0x30')][_0x8c56('0x3a')]+'%'};return _0xb01378;}})});}_0x4b886c=_[_0x8c56('0x3c')]({},_0x4b886c,_0x44fe35['options']);var _0xe934af={'where':_0x4b886c[_0x8c56('0x39')]};return db[_0x8c56('0x2c')][_0x8c56('0x1f')](_0xe934af)[_0x8c56('0x26')](function(_0x2f4077){_0x749d4a[_0x8c56('0x1f')]=_0x2f4077;if(_0x44fe35[_0x8c56('0x30')][_0x8c56('0x3d')]){_0x4b886c['include']=[{'all':!![]}];}return db[_0x8c56('0x2c')][_0x8c56('0x3e')](_0x4b886c);})['then'](function(_0x3f447d){_0x749d4a[_0x8c56('0x3f')]=_0x3f447d;return _0x749d4a;})['then'](respondWithFilteredResult(_0x4a77ba,_0x4b886c))['catch'](handleError(_0x4a77ba,null));};exports[_0x8c56('0x40')]=function(_0x2bd240,_0x20b09f){var _0x49b485={'raw':!![],'where':{'id':_0x2bd240[_0x8c56('0x41')]['id']}},_0x45cd54={};_0x45cd54['model']=_[_0x8c56('0x31')](db[_0x8c56('0x2c')][_0x8c56('0x2d')]);_0x45cd54[_0x8c56('0x30')]=_['keys'](_0x2bd240[_0x8c56('0x30')]);_0x45cd54[_0x8c56('0x32')]=_[_0x8c56('0x42')](_0x45cd54['model'],_0x45cd54[_0x8c56('0x30')]);_0x49b485[_0x8c56('0x33')]=_[_0x8c56('0x42')](_0x45cd54[_0x8c56('0x2e')],qs[_0x8c56('0x34')](_0x2bd240[_0x8c56('0x30')]['fields']));_0x49b485[_0x8c56('0x33')]=_0x49b485[_0x8c56('0x33')][_0x8c56('0x43')]?_0x49b485[_0x8c56('0x33')]:_0x45cd54['model'];if(_0x2bd240[_0x8c56('0x30')][_0x8c56('0x3d')]){_0x49b485[_0x8c56('0x44')]=[{'all':!![]}];}_0x49b485=_[_0x8c56('0x3c')]({},_0x49b485,_0x2bd240[_0x8c56('0x45')]);return db[_0x8c56('0x2c')][_0x8c56('0x46')](_0x49b485)[_0x8c56('0x26')](handleEntityNotFound(_0x20b09f,null))[_0x8c56('0x26')](respondWithResult(_0x20b09f,null))[_0x8c56('0x47')](handleError(_0x20b09f,null));};exports[_0x8c56('0x48')]=function(_0x48c12f,_0x2c6bb0){return db['ChatTransferReport'][_0x8c56('0x48')](_0x48c12f[_0x8c56('0x49')],{})[_0x8c56('0x26')](respondWithResult(_0x2c6bb0,0xc9))['catch'](handleError(_0x2c6bb0,null));};exports['update']=function(_0x4ea86a,_0x31333a){if(_0x4ea86a[_0x8c56('0x49')]['id']){delete _0x4ea86a['body']['id'];}return db[_0x8c56('0x2c')][_0x8c56('0x46')]({'where':{'id':_0x4ea86a[_0x8c56('0x41')]['id']}})[_0x8c56('0x26')](handleEntityNotFound(_0x31333a,null))[_0x8c56('0x26')](saveUpdates(_0x4ea86a[_0x8c56('0x49')],null))['then'](respondWithResult(_0x31333a,null))[_0x8c56('0x47')](handleError(_0x31333a,null));};exports[_0x8c56('0x27')]=function(_0x388c52,_0x1fd504){return db[_0x8c56('0x2c')][_0x8c56('0x46')]({'where':{'id':_0x388c52[_0x8c56('0x41')]['id']}})[_0x8c56('0x26')](handleEntityNotFound(_0x1fd504,null))[_0x8c56('0x26')](removeEntity(_0x1fd504,null))[_0x8c56('0x47')](handleError(_0x1fd504,null));};exports[_0x8c56('0x4a')]=function(_0x202fa7,_0x33670c){return db[_0x8c56('0x2c')]['describe']()[_0x8c56('0x26')](respondWithResult(_0x33670c,null))[_0x8c56('0x47')](handleError(_0x33670c,null));}; \ No newline at end of file +var _0xc535=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','intersection','length','include','find','create','body','params','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5a8564,_0x501224){var _0x44b336=function(_0x2aa2c0){while(--_0x2aa2c0){_0x5a8564['push'](_0x5a8564['shift']());}};_0x44b336(++_0x501224);}(_0xc535,0x126));var _0x5c53=function(_0x3f5018,_0x2cfba6){_0x3f5018=_0x3f5018-0x0;var _0x3da6fc=_0xc535[_0x3f5018];return _0x3da6fc;};'use strict';var pdf=require(_0x5c53('0x0'));var emlformat=require(_0x5c53('0x1'));var rimraf=require(_0x5c53('0x2'));var zipdir=require(_0x5c53('0x3'));var jsonpatch=require(_0x5c53('0x4'));var rp=require(_0x5c53('0x5'));var moment=require(_0x5c53('0x6'));var BPromise=require(_0x5c53('0x7'));var Mustache=require(_0x5c53('0x8'));var util=require(_0x5c53('0x9'));var path=require(_0x5c53('0xa'));var sox=require(_0x5c53('0xb'));var csv=require(_0x5c53('0xc'));var ejs=require(_0x5c53('0xd'));var fs=require('fs');var _=require(_0x5c53('0xe'));var squel=require(_0x5c53('0xf'));var crypto=require(_0x5c53('0x10'));var jsforce=require(_0x5c53('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x5c53('0xc'));var querystring=require(_0x5c53('0x12'));var Papa=require('papaparse');var Redis=require(_0x5c53('0x13'));var authService=require(_0x5c53('0x14'));var qs=require(_0x5c53('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c53('0x16'));var logger=require(_0x5c53('0x17'))(_0x5c53('0x18'));var utils=require(_0x5c53('0x19'));var config=require(_0x5c53('0x1a'));var db=require(_0x5c53('0x1b'))['db'];function respondWithStatusCode(_0x22d248,_0x1770d1){_0x1770d1=_0x1770d1||0xcc;return function(_0xea5cd7){if(_0xea5cd7){return _0x22d248[_0x5c53('0x1c')](_0x1770d1);}return _0x22d248[_0x5c53('0x1d')](_0x1770d1)['end']();};}function respondWithResult(_0x341d20,_0x24f8ff){_0x24f8ff=_0x24f8ff||0xc8;return function(_0x584791){if(_0x584791){return _0x341d20[_0x5c53('0x1d')](_0x24f8ff)[_0x5c53('0x1e')](_0x584791);}};}function respondWithFilteredResult(_0x4e4bd2,_0x5bc8c8){return function(_0x237a12){if(_0x237a12){var _0x9be1db=_0x237a12[_0x5c53('0x1f')],_0x35c5b8=_0x5bc8c8[_0x5c53('0x20')],_0x5bfa28=_0x5bc8c8[_0x5c53('0x20')]+_0x5bc8c8[_0x5c53('0x21')],_0x9a35d1;if(_0x5bfa28>=_0x9be1db){_0x5bfa28=_0x9be1db;_0x9a35d1=0xc8;}else{_0x9a35d1=0xce;}_0x4e4bd2[_0x5c53('0x1d')](_0x9a35d1);return _0x4e4bd2[_0x5c53('0x22')]('Content-Range',_0x35c5b8+'-'+_0x5bfa28+'/'+_0x9be1db)[_0x5c53('0x1e')](_0x237a12);}return null;};}function patchUpdates(_0x5013fd){return function(_0x8f7449){try{jsonpatch[_0x5c53('0x23')](_0x8f7449,_0x5013fd,!![]);}catch(_0xb50165){return BPromise[_0x5c53('0x24')](_0xb50165);}return _0x8f7449['save']();};}function saveUpdates(_0x19d1af,_0x5e10bb){return function(_0x4c9a26){if(_0x4c9a26){return _0x4c9a26[_0x5c53('0x25')](_0x19d1af)[_0x5c53('0x26')](function(_0x22233f){return _0x22233f;});}return null;};}function removeEntity(_0x28fe49,_0x4608b6){return function(_0x1b3d0c){if(_0x1b3d0c){return _0x1b3d0c[_0x5c53('0x27')]()[_0x5c53('0x26')](function(){_0x28fe49['status'](0xcc)[_0x5c53('0x28')]();});}};}function handleEntityNotFound(_0x4019e3,_0x242b48){return function(_0x4c2b37){if(!_0x4c2b37){_0x4019e3[_0x5c53('0x1c')](0x194);}return _0x4c2b37;};}function handleError(_0x25659d,_0x9eb03){_0x9eb03=_0x9eb03||0x1f4;return function(_0x4b8b03){logger[_0x5c53('0x29')](_0x4b8b03[_0x5c53('0x2a')]);if(_0x4b8b03[_0x5c53('0x2b')]){delete _0x4b8b03['name'];}_0x25659d['status'](_0x9eb03)[_0x5c53('0x2c')](_0x4b8b03);};}exports['index']=function(_0x4312a7,_0x1aaea9){var _0x313c78={},_0x106e79={},_0x3640bc={'count':0x0,'rows':[]};var _0x350c99=_[_0x5c53('0x2d')](db[_0x5c53('0x2e')][_0x5c53('0x2f')],function(_0x6efcf0){return{'name':_0x6efcf0[_0x5c53('0x30')],'type':_0x6efcf0[_0x5c53('0x31')][_0x5c53('0x32')]};});_0x106e79[_0x5c53('0x33')]=_['map'](_0x350c99,_0x5c53('0x2b'));_0x106e79[_0x5c53('0x34')]=_[_0x5c53('0x35')](_0x4312a7[_0x5c53('0x34')]);_0x106e79[_0x5c53('0x36')]=_['intersection'](_0x106e79[_0x5c53('0x33')],_0x106e79[_0x5c53('0x34')]);_0x313c78[_0x5c53('0x37')]=_['intersection'](_0x106e79['model'],qs[_0x5c53('0x38')](_0x4312a7['query'][_0x5c53('0x38')]));_0x313c78['attributes']=_0x313c78[_0x5c53('0x37')]['length']?_0x313c78[_0x5c53('0x37')]:_0x106e79[_0x5c53('0x33')];if(!_0x4312a7[_0x5c53('0x34')][_0x5c53('0x39')](_0x5c53('0x3a'))){_0x313c78[_0x5c53('0x21')]=qs[_0x5c53('0x21')](_0x4312a7[_0x5c53('0x34')]['limit']);_0x313c78[_0x5c53('0x20')]=qs[_0x5c53('0x20')](_0x4312a7[_0x5c53('0x34')][_0x5c53('0x20')]);}_0x313c78[_0x5c53('0x3b')]=qs[_0x5c53('0x3c')](_0x4312a7[_0x5c53('0x34')][_0x5c53('0x3c')]);_0x313c78[_0x5c53('0x3d')]=qs[_0x5c53('0x36')](_[_0x5c53('0x3e')](_0x4312a7[_0x5c53('0x34')],_0x106e79['filters']),_0x350c99);if(_0x4312a7[_0x5c53('0x34')][_0x5c53('0x3f')]){_0x313c78[_0x5c53('0x3d')]=_[_0x5c53('0x40')](_0x313c78[_0x5c53('0x3d')],{'$or':_[_0x5c53('0x2d')](_0x350c99,function(_0x47fe3d){if(_0x47fe3d['type']!==_0x5c53('0x41')){var _0x248b48={};_0x248b48[_0x47fe3d[_0x5c53('0x2b')]]={'$like':'%'+_0x4312a7[_0x5c53('0x34')]['filter']+'%'};return _0x248b48;}})});}_0x313c78=_[_0x5c53('0x40')]({},_0x313c78,_0x4312a7[_0x5c53('0x42')]);var _0x21286d={'where':_0x313c78[_0x5c53('0x3d')]};return db[_0x5c53('0x2e')][_0x5c53('0x1f')](_0x21286d)[_0x5c53('0x26')](function(_0x377834){_0x3640bc['count']=_0x377834;if(_0x4312a7[_0x5c53('0x34')][_0x5c53('0x43')]){_0x313c78['include']=[{'all':!![]}];}return db[_0x5c53('0x2e')][_0x5c53('0x44')](_0x313c78);})[_0x5c53('0x26')](function(_0x5b2a3c){_0x3640bc[_0x5c53('0x45')]=_0x5b2a3c;return _0x3640bc;})[_0x5c53('0x26')](respondWithFilteredResult(_0x1aaea9,_0x313c78))[_0x5c53('0x46')](handleError(_0x1aaea9,null));};exports[_0x5c53('0x47')]=function(_0x4ce267,_0x51b0b1){var _0x494ead={'raw':!![],'where':{'id':_0x4ce267['params']['id']}},_0x13299a={};_0x13299a[_0x5c53('0x33')]=_[_0x5c53('0x35')](db['ChatTransferReport'][_0x5c53('0x2f')]);_0x13299a[_0x5c53('0x34')]=_[_0x5c53('0x35')](_0x4ce267[_0x5c53('0x34')]);_0x13299a['filters']=_[_0x5c53('0x48')](_0x13299a['model'],_0x13299a['query']);_0x494ead[_0x5c53('0x37')]=_[_0x5c53('0x48')](_0x13299a[_0x5c53('0x33')],qs[_0x5c53('0x38')](_0x4ce267[_0x5c53('0x34')]['fields']));_0x494ead['attributes']=_0x494ead[_0x5c53('0x37')][_0x5c53('0x49')]?_0x494ead['attributes']:_0x13299a['model'];if(_0x4ce267[_0x5c53('0x34')][_0x5c53('0x43')]){_0x494ead[_0x5c53('0x4a')]=[{'all':!![]}];}_0x494ead=_['merge']({},_0x494ead,_0x4ce267[_0x5c53('0x42')]);return db[_0x5c53('0x2e')][_0x5c53('0x4b')](_0x494ead)[_0x5c53('0x26')](handleEntityNotFound(_0x51b0b1,null))[_0x5c53('0x26')](respondWithResult(_0x51b0b1,null))[_0x5c53('0x46')](handleError(_0x51b0b1,null));};exports[_0x5c53('0x4c')]=function(_0x12d548,_0x571a70){return db[_0x5c53('0x2e')]['create'](_0x12d548[_0x5c53('0x4d')],{})[_0x5c53('0x26')](respondWithResult(_0x571a70,0xc9))[_0x5c53('0x46')](handleError(_0x571a70,null));};exports[_0x5c53('0x25')]=function(_0x3574dc,_0x2d71c4){if(_0x3574dc[_0x5c53('0x4d')]['id']){delete _0x3574dc[_0x5c53('0x4d')]['id'];}return db[_0x5c53('0x2e')][_0x5c53('0x4b')]({'where':{'id':_0x3574dc[_0x5c53('0x4e')]['id']}})[_0x5c53('0x26')](handleEntityNotFound(_0x2d71c4,null))[_0x5c53('0x26')](saveUpdates(_0x3574dc[_0x5c53('0x4d')],null))[_0x5c53('0x26')](respondWithResult(_0x2d71c4,null))[_0x5c53('0x46')](handleError(_0x2d71c4,null));};exports[_0x5c53('0x27')]=function(_0x349675,_0x6220d1){return db[_0x5c53('0x2e')][_0x5c53('0x4b')]({'where':{'id':_0x349675['params']['id']}})[_0x5c53('0x26')](handleEntityNotFound(_0x6220d1,null))['then'](removeEntity(_0x6220d1,null))['catch'](handleError(_0x6220d1,null));};exports[_0x5c53('0x4f')]=function(_0x3e01a9,_0x5195f7){return db[_0x5c53('0x2e')]['describe']()[_0x5c53('0x26')](respondWithResult(_0x5195f7,null))['catch'](handleError(_0x5195f7,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 7a0a3b2..ae06850 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 _0x3e74=['../../config/logger','api','moment','path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3e74,0x175));var _0x43e7=function(_0x325c39,_0x253dfa){_0x325c39=_0x325c39-0x0;var _0x3622ac=_0x3e74[_0x325c39];return _0x3622ac;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[{'name':_0x43e7('0xa'),'fields':[_0x43e7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes'];(function(_0x10316a,_0x125dc8){var _0x36ac2e=function(_0x140e35){while(--_0x140e35){_0x10316a['push'](_0x10316a['shift']());}};_0x36ac2e(++_0x125dc8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[{'name':_0xb00b('0xb'),'fields':[_0xb00b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ec82fa5..bb51be8 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 _0x9dc0=['error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4bdf85,_0x1d57e6){var _0x285104=function(_0x30a2db){while(--_0x30a2db){_0x4bdf85['push'](_0x4bdf85['shift']());}};_0x285104(++_0x1d57e6);}(_0x9dc0,0x155));var _0x09dc=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x9dc0[_0x1f1e31];return _0x229b56;};'use strict';var _=require(_0x09dc('0x0'));var util=require(_0x09dc('0x1'));var moment=require(_0x09dc('0x2'));var BPromise=require(_0x09dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09dc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09dc('0x5'));var logger=require('../../config/logger')(_0x09dc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x09dc('0x7')][_0x09dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4488a0,_0x1ca1fd,_0x4d7621){return new BPromise(function(_0x2c5987,_0x4bbd54){return client[_0x09dc('0x9')](_0x4488a0,_0x4d7621)[_0x09dc('0xa')](function(_0x81b7af){logger['info'](_0x09dc('0xb'),_0x1ca1fd,'request\x20sent');logger[_0x09dc('0xc')](_0x09dc('0xd'),_0x1ca1fd,_0x09dc('0xe'),JSON[_0x09dc('0xf')](_0x81b7af));if(_0x81b7af[_0x09dc('0x10')]){if(_0x81b7af[_0x09dc('0x10')][_0x09dc('0x11')]===0x1f4){logger[_0x09dc('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1ca1fd,_0x81b7af[_0x09dc('0x10')][_0x09dc('0x12')]);return _0x4bbd54(_0x81b7af[_0x09dc('0x10')][_0x09dc('0x12')]);}logger[_0x09dc('0x10')](_0x09dc('0xb'),_0x1ca1fd,_0x81b7af[_0x09dc('0x10')][_0x09dc('0x12')]);return _0x2c5987(_0x81b7af[_0x09dc('0x10')][_0x09dc('0x12')]);}else{logger[_0x09dc('0x13')](_0x09dc('0xb'),_0x1ca1fd,_0x09dc('0xe'));_0x2c5987(_0x81b7af[_0x09dc('0x14')][_0x09dc('0x12')]);}})['catch'](function(_0x4bf0d0){logger['error'](_0x09dc('0xb'),_0x1ca1fd,_0x4bf0d0);_0x4bbd54(_0x4bf0d0);});});} \ No newline at end of file +var _0x352b=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','ChatTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x50385c,_0x3d1e5f){var _0x3a4888=function(_0x3cb14d){while(--_0x3cb14d){_0x50385c['push'](_0x50385c['shift']());}};_0x3a4888(++_0x3d1e5f);}(_0x352b,0x1c1));var _0xb352=function(_0x545c7e,_0x2400c1){_0x545c7e=_0x545c7e-0x0;var _0x1a38ff=_0x352b[_0x545c7e];return _0x1a38ff;};'use strict';var _=require('lodash');var util=require(_0xb352('0x0'));var moment=require(_0xb352('0x1'));var BPromise=require(_0xb352('0x2'));var rs=require(_0xb352('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb352('0x4'))(_0xb352('0x5'));var config=require(_0xb352('0x6'));var jayson=require(_0xb352('0x7'));var client=jayson[_0xb352('0x8')][_0xb352('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x494308,_0x26ba3d,_0x1e79ca){return new BPromise(function(_0x77da32,_0x4ec57e){return client[_0xb352('0xa')](_0x494308,_0x1e79ca)[_0xb352('0xb')](function(_0x2dea54){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x26ba3d,_0xb352('0xc'));logger['debug'](_0xb352('0xd'),_0x26ba3d,_0xb352('0xc'),JSON[_0xb352('0xe')](_0x2dea54));if(_0x2dea54[_0xb352('0xf')]){if(_0x2dea54[_0xb352('0xf')]['code']===0x1f4){logger[_0xb352('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x26ba3d,_0x2dea54['error'][_0xb352('0x10')]);return _0x4ec57e(_0x2dea54[_0xb352('0xf')]['message']);}logger[_0xb352('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x26ba3d,_0x2dea54[_0xb352('0xf')]['message']);return _0x77da32(_0x2dea54[_0xb352('0xf')][_0xb352('0x10')]);}else{logger[_0xb352('0x11')](_0xb352('0x12'),_0x26ba3d,_0xb352('0xc'));_0x77da32(_0x2dea54[_0xb352('0x13')][_0xb352('0x10')]);}})[_0xb352('0x14')](function(_0x23f00b){logger['error'](_0xb352('0x12'),_0x26ba3d,_0x23f00b);_0x4ec57e(_0x23f00b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index acac53e..499ba27 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 _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0xb10b[_0x3e3d0a];return _0x3fc765;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +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(_0x4d4ad3,_0x59f0a0){var _0x64d9b2=function(_0x2949d1){while(--_0x2949d1){_0x4d4ad3['push'](_0x4d4ad3['shift']());}};_0x64d9b2(++_0x59f0a0);}(_0x2032,0xd9));var _0x2203=function(_0x20ebbc,_0x432fc7){_0x20ebbc=_0x20ebbc-0x0;var _0x1036b1=_0x2032[_0x20ebbc];return _0x1036b1;};'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 c79ee59..8ee6387 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 _0xe4d6=['thumb','star','input','name','text','parse','onlineForm','setDataValue','stringify','textarea','Comments','getDataValue','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM'];(function(_0x2b25c8,_0x482bae){var _0x46f4b2=function(_0x19e133){while(--_0x19e133){_0x2b25c8['push'](_0x2b25c8['shift']());}};_0x46f4b2(++_0x482bae);}(_0xe4d6,0xd7));var _0x6e4d=function(_0x2fd211,_0x216ed3){_0x2fd211=_0x2fd211-0x0;var _0x5d07ee=_0xe4d6[_0x2fd211];return _0x5d07ee;};'use strict';var Sequelize=require(_0x6e4d('0x0'));var rs=require(_0x6e4d('0x1'));module[_0x6e4d('0x2')]={'name':{'type':Sequelize[_0x6e4d('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6e4d('0x4')},'description':{'type':Sequelize[_0x6e4d('0x3')]},'mapKey':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x6')},'customerAlias':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e4d('0x3')],'allowNull':![],'defaultValue':_0x6e4d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e4d('0x3')],'allowNull':![],'defaultValue':_0x6e4d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e4d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x6e4d('0xb'),_0x6e4d('0xc')),'defaultValue':_0x6e4d('0xb')},'header_online':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0xd')},'offline_chat_button':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0xe')},'header_offline':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0xf')},'download_transcript':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6e4d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6e4d('0x11')]},'closingQuestion':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x15')},'closingMessageButton':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0xe')},'skipMessageButton':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x17')},'ratingType':{'type':Sequelize[_0x6e4d('0x18')]('star',_0x6e4d('0x19')),'defaultValue':_0x6e4d('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x6e4d('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e4d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6e4d('0x1b'),'variable':null,'config':{'placeholder':_0x6e4d('0x1c'),'type':_0x6e4d('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6e4d('0x1b'),'props':{'title':_0x6e4d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e4d('0x5'),'type':_0x6e4d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x6e4d('0x1e')](this['getDataValue'](_0x6e4d('0x1f'))):{};},'set':function(_0x2e2eed){return this[_0x6e4d('0x20')]('onlineForm',JSON[_0x6e4d('0x21')](_0x2e2eed));}},'offlineForm':{'type':Sequelize[_0x6e4d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6e4d('0x5'),'type':_0x6e4d('0x5')},'variable':null},{'type':_0x6e4d('0x22'),'config':{'placeholder':_0x6e4d('0x23')},'props':{'title':_0x6e4d('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x6e4d('0x24')](_0x6e4d('0x25'))?JSON[_0x6e4d('0x1e')](this[_0x6e4d('0x24')](_0x6e4d('0x25'))):{};},'set':function(_0x5e271e){return this['setDataValue'](_0x6e4d('0x25'),JSON['stringify'](_0x5e271e));}},'token':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':function(){return rs[_0x6e4d('0x26')]();}},'autoclose':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e4d('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e4d('0x3')]},'waitingTitle':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x28')},'offlineMessageBody':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6e4d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6e4d('0x11')],'defaultValue':function(){return _0x6e4d('0x2b');}},'notificationSound':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6e4d('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e4d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x6e4d('0x3')]},'customerAvatar':{'type':Sequelize[_0x6e4d('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e4d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e4d('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e4d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e4d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e4d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':_0x6e4d('0x2d')},'systemAvatar':{'type':Sequelize[_0x6e4d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6e4d('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x8b047d){if(!_0x8b047d)this[_0x6e4d('0x20')]('mandatoryDispositionPauseId',null);this[_0x6e4d('0x20')](_0x6e4d('0x2f'),_0x8b047d);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]}}; \ No newline at end of file +var _0x5549=['parse','setDataValue','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.','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','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','input','text','getDataValue','onlineForm'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5549,0x1f4));var _0x9554=function(_0x748161,_0x5eddd4){_0x748161=_0x748161-0x0;var _0x5daa87=_0x5549[_0x748161];return _0x5daa87;};'use strict';var Sequelize=require(_0x9554('0x0'));var rs=require(_0x9554('0x1'));module[_0x9554('0x2')]={'name':{'type':Sequelize[_0x9554('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9554('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9554('0x3')]},'mapKey':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9554('0x3')],'allowNull':![],'defaultValue':_0x9554('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9554('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9554('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x9554('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9554('0x8')](_0x9554('0x9'),_0x9554('0xa')),'defaultValue':_0x9554('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0xb')},'offline_chat_button':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0xc')},'download_transcript':{'type':Sequelize[_0x9554('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9554('0xe')]},'closingQuestion':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x10')},'noteTitle':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9554('0x12')},'skipMessageButton':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x13')},'conditionAgreement':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9554('0x14')},'ratingType':{'type':Sequelize[_0x9554('0x8')](_0x9554('0x15'),_0x9554('0x16')),'defaultValue':_0x9554('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x9554('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9554('0xe')],'defaultValue':function(){return JSON[_0x9554('0x17')]({'items':[{'type':_0x9554('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x9554('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x9554('0x18'),'props':{'title':_0x9554('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9554('0x1a')](_0x9554('0x1b'))?JSON[_0x9554('0x1c')](this[_0x9554('0x1a')](_0x9554('0x1b'))):{};},'set':function(_0x4356b9){return this[_0x9554('0x1d')](_0x9554('0x1b'),JSON[_0x9554('0x17')](_0x4356b9));}},'offlineForm':{'type':Sequelize[_0x9554('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9554('0x18'),'props':{'title':_0x9554('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9554('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x9554('0x1e')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9554('0x1f'))?JSON[_0x9554('0x1c')](this[_0x9554('0x1a')](_0x9554('0x1f'))):{};},'set':function(_0x52946c){return this[_0x9554('0x1d')](_0x9554('0x1f'),JSON[_0x9554('0x17')](_0x52946c));}},'token':{'type':Sequelize[_0x9554('0x3')],'defaultValue':function(){return rs[_0x9554('0x20')]();}},'autoclose':{'type':Sequelize[_0x9554('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9554('0x3')]},'forwardOffline':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9554('0x3')]},'waitingTitle':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x21')},'waitingMessage':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x9554('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9554('0x24')},'skipUnmanaged':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x12')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9554('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9554('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9554('0x26')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x27')},'verticalAlignment':{'type':Sequelize[_0x9554('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9554('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9554('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9554('0x3')],'allowNull':![],'defaultValue':_0x9554('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9554('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9554('0x3')],'defaultValue':_0x9554('0x29')},'systemAvatar':{'type':Sequelize[_0x9554('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9554('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9554('0x2a'),'set':function(_0xf166cf){if(!_0xf166cf)this[_0x9554('0x1d')]('mandatoryDispositionPauseId',null);this[_0x9554('0x1d')](_0x9554('0x2b'),_0xf166cf);}},'vidaooEscalation':{'type':Sequelize[_0x9554('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9554('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 2039b4b..f330b19 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 _0x2c3f=['fields','query','nolimit','order','sort','pick','where','map','VIRTUAL','filter','ChatWebsite','show','params','mandatoryDispositionPause','keys','length','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','root','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','CmContact','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','from\x20is\x20mandatory','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','omit','getInteractions','options','Contact','Owner','fullname','internal','Tag','Tags','tag','iftime\x20%s,%s','interval','timezone','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','increment','all','some','readFileSync','server/files/chat/iframe.js','x-real-ip','connection','virtual','verticalAlignment','color','textColor','addApplications','transaction','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','Pause','rawAttributes','fieldName','type','key','model','filters','intersection','attributes'];(function(_0x3e1ce3,_0x2666ef){var _0x240cf0=function(_0x1456e0){while(--_0x1456e0){_0x3e1ce3['push'](_0x3e1ce3['shift']());}};_0x240cf0(++_0x2666ef);}(_0x2c3f,0xd6));var _0xf2c3=function(_0x24ff40,_0x4618ca){_0x24ff40=_0x24ff40-0x0;var _0x50ac0b=_0x2c3f[_0x24ff40];return _0x50ac0b;};'use strict';var pdf=require(_0xf2c3('0x0'));var emlformat=require(_0xf2c3('0x1'));var rimraf=require(_0xf2c3('0x2'));var zipdir=require(_0xf2c3('0x3'));var jsonpatch=require(_0xf2c3('0x4'));var rp=require(_0xf2c3('0x5'));var moment=require(_0xf2c3('0x6'));var BPromise=require(_0xf2c3('0x7'));var Mustache=require(_0xf2c3('0x8'));var util=require(_0xf2c3('0x9'));var path=require(_0xf2c3('0xa'));var sox=require(_0xf2c3('0xb'));var csv=require(_0xf2c3('0xc'));var ejs=require(_0xf2c3('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf2c3('0xe'));var jsforce=require(_0xf2c3('0xf'));var deskjs=require(_0xf2c3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf2c3('0x11'));var Papa=require('papaparse');var Redis=require(_0xf2c3('0x12'));var authService=require(_0xf2c3('0x13'));var qs=require(_0xf2c3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2c3('0x15'));var logger=require(_0xf2c3('0x16'))(_0xf2c3('0x17'));var utils=require('../../config/utils');var config=require(_0xf2c3('0x18'));var db=require('../../mysqldb')['db'];config[_0xf2c3('0x19')]=_[_0xf2c3('0x1a')](config[_0xf2c3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2c3('0x1b'))(new Redis(config[_0xf2c3('0x19')]));require(_0xf2c3('0x1c'))[_0xf2c3('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xf2c3('0x1e')][_0xf2c3('0x1f')]({'port':0x232a});var client9003=jayson[_0xf2c3('0x1e')][_0xf2c3('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x1c51ef,_0x4e76d8,_0x2ba448){if(_0x2ba448){var _0x3f24fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f24fd[_0xf2c3('0x20')](_0x4e76d8)){return _0x1c51ef;}else{throw new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))](_0xf2c3('0x23'));}}else{return _0x1c51ef;}}function respondWithRpcPromise(_0xd6da7b,_0x15f4a3,_0x2a0822,_0x82aba3){return new BPromise(function(_0xaf33a8,_0xb6e671){var _0x10e570=_0x82aba3||client;return _0x10e570[_0xf2c3('0x24')](_0xd6da7b,_0x2a0822)[_0xf2c3('0x25')](function(_0x983cf6){logger[_0xf2c3('0x26')](_0xf2c3('0x27'),_0x15f4a3,_0xf2c3('0x28'));logger[_0xf2c3('0x29')](_0xf2c3('0x2a'),_0x15f4a3,_0xf2c3('0x28'),JSON['stringify'](_0x983cf6));if(_0x983cf6['error']){if(_0x983cf6[_0xf2c3('0x2b')][_0xf2c3('0x2c')]===0x1f4){logger[_0xf2c3('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x15f4a3,_0x983cf6[_0xf2c3('0x2b')][_0xf2c3('0x2d')]);return _0xb6e671(_0x983cf6[_0xf2c3('0x2b')][_0xf2c3('0x2d')]);}logger['error'](_0xf2c3('0x27'),_0x15f4a3,_0x983cf6[_0xf2c3('0x2b')][_0xf2c3('0x2d')]);return _0xaf33a8(_0x983cf6[_0xf2c3('0x2b')]['message']);}else{logger['info'](_0xf2c3('0x27'),_0x15f4a3,_0xf2c3('0x28'));_0xaf33a8(_0x983cf6[_0xf2c3('0x2e')][_0xf2c3('0x2d')]);}})[_0xf2c3('0x2f')](function(_0x370dc4){logger[_0xf2c3('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x15f4a3,_0x370dc4);_0xb6e671(_0x370dc4);});});}function respondWithStatusCode(_0x13dc68,_0x5abc86){_0x5abc86=_0x5abc86||0xcc;return function(_0x1173b0){if(_0x1173b0){return _0x13dc68['sendStatus'](_0x5abc86);}return _0x13dc68[_0xf2c3('0x30')](_0x5abc86)[_0xf2c3('0x31')]();};}function respondWithResult(_0x14cdc0,_0xc1e695){_0xc1e695=_0xc1e695||0xc8;return function(_0x359100){if(_0x359100){return _0x14cdc0[_0xf2c3('0x30')](_0xc1e695)[_0xf2c3('0x32')](_0x359100);}};}function respondWithFilteredResult(_0x4853aa,_0x26b28d){return function(_0xa54229){if(_0xa54229){var _0x307912=_0xa54229[_0xf2c3('0x33')],_0x16ee16=_0x26b28d[_0xf2c3('0x34')],_0x1e90d2=_0x26b28d[_0xf2c3('0x34')]+_0x26b28d[_0xf2c3('0x35')],_0x40ff90;if(_0x1e90d2>=_0x307912){_0x1e90d2=_0x307912;_0x40ff90=0xc8;}else{_0x40ff90=0xce;}_0x4853aa[_0xf2c3('0x30')](_0x40ff90);return _0x4853aa[_0xf2c3('0x36')](_0xf2c3('0x37'),_0x16ee16+'-'+_0x1e90d2+'/'+_0x307912)[_0xf2c3('0x32')](_0xa54229);}return null;};}function patchUpdates(_0x1c1e8d){return function(_0x18f96d){try{jsonpatch[_0xf2c3('0x38')](_0x18f96d,_0x1c1e8d,!![]);}catch(_0x1ed7b3){return BPromise[_0xf2c3('0x39')](_0x1ed7b3);}return _0x18f96d[_0xf2c3('0x3a')]();};}function saveUpdates(_0x3914a0,_0x441fe9){return function(_0x162b38){if(_0x162b38){return _0x162b38[_0xf2c3('0x3b')](_0x3914a0)[_0xf2c3('0x25')](function(_0x3558c5){return _0x3558c5;});}return null;};}function removeEntity(_0x35cf39,_0x407967){return function(_0x47bf05){if(_0x47bf05){return _0x47bf05[_0xf2c3('0x3c')]()[_0xf2c3('0x25')](function(){var _0x220886=_0x47bf05['get']({'plain':!![]});var _0x115e02=_0xf2c3('0x3d');return db[_0xf2c3('0x3e')][_0xf2c3('0x3c')]({'where':{'type':_0x115e02,'resourceId':_0x220886['id']}})[_0xf2c3('0x25')](function(){return _0x47bf05;});})[_0xf2c3('0x25')](function(){_0x35cf39[_0xf2c3('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca666,_0x34f65d){return function(_0x314039){if(!_0x314039){_0x5ca666[_0xf2c3('0x3f')](0x194);}return _0x314039;};}function handleError(_0xcdca56,_0x5c4590){_0x5c4590=_0x5c4590||0x1f4;return function(_0x5c89dc){logger[_0xf2c3('0x2b')](_0x5c89dc[_0xf2c3('0x40')]);if(_0x5c89dc[_0xf2c3('0x41')]){delete _0x5c89dc[_0xf2c3('0x41')];}_0xcdca56[_0xf2c3('0x30')](_0x5c4590)['send'](_0x5c89dc);};}exports['index']=function(_0x5e7fb1,_0x45f501){var _0x2f4f66={'include':[{'model':db[_0xf2c3('0x42')],'as':'mandatoryDispositionPause'}]},_0x150514={},_0x954e3a={'count':0x0,'rows':[]};var _0x59f462=_['map'](db['ChatWebsite'][_0xf2c3('0x43')],function(_0x82c70c){return{'name':_0x82c70c[_0xf2c3('0x44')],'type':_0x82c70c[_0xf2c3('0x45')][_0xf2c3('0x46')]};});_0x150514[_0xf2c3('0x47')]=_['map'](_0x59f462,_0xf2c3('0x41'));_0x150514['query']=_['keys'](_0x5e7fb1['query']);_0x150514[_0xf2c3('0x48')]=_[_0xf2c3('0x49')](_0x150514[_0xf2c3('0x47')],_0x150514['query']);_0x2f4f66[_0xf2c3('0x4a')]=_['intersection'](_0x150514[_0xf2c3('0x47')],qs[_0xf2c3('0x4b')](_0x5e7fb1[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x2f4f66[_0xf2c3('0x4a')]=_0x2f4f66[_0xf2c3('0x4a')]['length']?_0x2f4f66[_0xf2c3('0x4a')]:_0x150514[_0xf2c3('0x47')];if(!_0x5e7fb1['query']['hasOwnProperty'](_0xf2c3('0x4d'))){_0x2f4f66[_0xf2c3('0x35')]=qs[_0xf2c3('0x35')](_0x5e7fb1[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x2f4f66[_0xf2c3('0x34')]=qs['offset'](_0x5e7fb1[_0xf2c3('0x4c')][_0xf2c3('0x34')]);}_0x2f4f66[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x5e7fb1['query'][_0xf2c3('0x4f')]);_0x2f4f66['where']=qs[_0xf2c3('0x48')](_[_0xf2c3('0x50')](_0x5e7fb1[_0xf2c3('0x4c')],_0x150514[_0xf2c3('0x48')]),_0x59f462);if(_0x5e7fb1[_0xf2c3('0x4c')]['filter']){_0x2f4f66[_0xf2c3('0x51')]=_['merge'](_0x2f4f66[_0xf2c3('0x51')],{'$or':_[_0xf2c3('0x52')](_0x59f462,function(_0x4a01ea){if(_0x4a01ea['type']!==_0xf2c3('0x53')){var _0x63811b={};_0x63811b[_0x4a01ea[_0xf2c3('0x41')]]={'$like':'%'+_0x5e7fb1[_0xf2c3('0x4c')][_0xf2c3('0x54')]+'%'};return _0x63811b;}})});}_0x2f4f66=_['merge']({},_0x2f4f66,_0x5e7fb1['options']);var _0x286b2f={'where':_0x2f4f66['where']};return db[_0xf2c3('0x55')][_0xf2c3('0x33')](_0x286b2f)[_0xf2c3('0x25')](function(_0x12eab1){_0x954e3a['count']=_0x12eab1;if(_0x5e7fb1[_0xf2c3('0x4c')]['includeAll']){_0x2f4f66['include']=[{'all':!![]}];}return db[_0xf2c3('0x55')]['findAll'](_0x2f4f66);})[_0xf2c3('0x25')](function(_0x971545){_0x954e3a['rows']=_0x971545;return _0x954e3a;})[_0xf2c3('0x25')](respondWithFilteredResult(_0x45f501,_0x2f4f66))[_0xf2c3('0x2f')](handleError(_0x45f501,null));};exports[_0xf2c3('0x56')]=function(_0x376c8b,_0x1cc70b){var _0x4577b8={'raw':![],'where':{'id':_0x376c8b[_0xf2c3('0x57')]['id']},'include':[{'model':db[_0xf2c3('0x42')],'as':_0xf2c3('0x58')}]},_0x2ca6f3={};_0x2ca6f3[_0xf2c3('0x47')]=_['keys'](db[_0xf2c3('0x55')][_0xf2c3('0x43')]);_0x2ca6f3[_0xf2c3('0x4c')]=_[_0xf2c3('0x59')](_0x376c8b[_0xf2c3('0x4c')]);_0x2ca6f3[_0xf2c3('0x48')]=_[_0xf2c3('0x49')](_0x2ca6f3['model'],_0x2ca6f3[_0xf2c3('0x4c')]);_0x4577b8[_0xf2c3('0x4a')]=_[_0xf2c3('0x49')](_0x2ca6f3[_0xf2c3('0x47')],qs[_0xf2c3('0x4b')](_0x376c8b[_0xf2c3('0x4c')]['fields']));_0x4577b8[_0xf2c3('0x4a')]=_0x4577b8[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x4577b8[_0xf2c3('0x4a')]:_0x2ca6f3[_0xf2c3('0x47')];if(_0x376c8b[_0xf2c3('0x4c')][_0xf2c3('0x5b')]){_0x4577b8[_0xf2c3('0x5c')]=[{'all':!![]}];}_0x4577b8=_[_0xf2c3('0x5d')]({},_0x4577b8,_0x376c8b['options']);return db[_0xf2c3('0x55')][_0xf2c3('0x5e')](_0x4577b8)[_0xf2c3('0x25')](handleEntityNotFound(_0x1cc70b,null))[_0xf2c3('0x25')](respondWithResult(_0x1cc70b,null))[_0xf2c3('0x2f')](handleError(_0x1cc70b,null));};exports[_0xf2c3('0x5f')]=function(_0x4549d6,_0x3763b6){return db[_0xf2c3('0x55')]['create'](_0x4549d6[_0xf2c3('0x60')],{})['then'](function(_0x39987d){var _0x37e8a5=_0x4549d6[_0xf2c3('0x61')]['get']({'plain':!![]});if(!_0x37e8a5)throw new Error(_0xf2c3('0x62'));if(_0x37e8a5[_0xf2c3('0x63')]==='user'){var _0x2615d9=_0x39987d[_0xf2c3('0x64')]({'plain':!![]});var _0x77171f='ChatWebsites';return db['UserProfileSection'][_0xf2c3('0x5e')]({'where':{'name':_0x77171f,'userProfileId':_0x37e8a5['userProfileId']},'raw':!![]})[_0xf2c3('0x25')](function(_0x3e6012){if(_0x3e6012&&_0x3e6012[_0xf2c3('0x65')]===0x0){return db[_0xf2c3('0x3e')][_0xf2c3('0x5f')]({'name':_0x2615d9[_0xf2c3('0x41')],'resourceId':_0x2615d9['id'],'type':_0x3e6012[_0xf2c3('0x41')],'sectionId':_0x3e6012['id']},{})['then'](function(){return _0x39987d;});}else{return _0x39987d;}})[_0xf2c3('0x2f')](function(_0x52f1c2){logger[_0xf2c3('0x2b')](_0xf2c3('0x66'),_0x52f1c2);throw _0x52f1c2;});}return _0x39987d;})[_0xf2c3('0x25')](respondWithResult(_0x3763b6,0xc9))[_0xf2c3('0x2f')](handleError(_0x3763b6,null));};exports[_0xf2c3('0x3b')]=function(_0x5ad064,_0x27a1b7){if(_0x5ad064[_0xf2c3('0x60')]['id']){delete _0x5ad064[_0xf2c3('0x60')]['id'];}return db['ChatWebsite'][_0xf2c3('0x5e')]({'where':{'id':_0x5ad064[_0xf2c3('0x57')]['id']},'include':[{'model':db[_0xf2c3('0x42')],'as':'mandatoryDispositionPause'}]})[_0xf2c3('0x25')](handleEntityNotFound(_0x27a1b7,null))['then'](saveUpdates(_0x5ad064['body'],null))[_0xf2c3('0x25')](respondWithResult(_0x27a1b7,null))[_0xf2c3('0x2f')](handleError(_0x27a1b7,null));};exports[_0xf2c3('0x3c')]=function(_0x307e7e,_0x51ae5f){return db['ChatWebsite'][_0xf2c3('0x5e')]({'where':{'id':_0x307e7e[_0xf2c3('0x57')]['id']}})['then'](handleEntityNotFound(_0x51ae5f,null))['then'](removeEntity(_0x51ae5f,null))['catch'](handleError(_0x51ae5f,null));};exports['describe']=function(_0x2863a5,_0x33942e){return db[_0xf2c3('0x55')][_0xf2c3('0x67')]()[_0xf2c3('0x25')](respondWithResult(_0x33942e,null))[_0xf2c3('0x2f')](handleError(_0x33942e,null));};exports[_0xf2c3('0x68')]=function(_0x361baa,_0x46f81b,_0xea5def){if(_0x361baa[_0xf2c3('0x60')]['id']){delete _0x361baa[_0xf2c3('0x60')]['id'];}return db[_0xf2c3('0x55')][_0xf2c3('0x5e')]({'where':{'id':_0x361baa[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x46f81b,null))[_0xf2c3('0x25')](function(_0x4a329d){if(_0x4a329d){_0x361baa[_0xf2c3('0x60')][_0xf2c3('0x69')]=_0x4a329d['id'];return db[_0xf2c3('0x6a')][_0xf2c3('0x5f')](_0x361baa[_0xf2c3('0x60')]);}})['then'](respondWithResult(_0x46f81b,null))[_0xf2c3('0x2f')](handleError(_0x46f81b,null));};exports[_0xf2c3('0x6b')]=function(_0x5c2856,_0x302caa,_0x13b38d){var _0x651df1={'raw':![],'where':{}};var _0x1eee51={};var _0x288a38={'count':0x0,'rows':[]};return db[_0xf2c3('0x55')][_0xf2c3('0x6c')]({'where':{'id':_0x5c2856[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x302caa,null))[_0xf2c3('0x25')](function(_0x328c1f){if(_0x328c1f){_0x1eee51[_0xf2c3('0x47')]=_[_0xf2c3('0x59')](db['Disposition']['rawAttributes']);_0x1eee51[_0xf2c3('0x4c')]=_[_0xf2c3('0x59')](_0x5c2856[_0xf2c3('0x4c')]);_0x1eee51['filters']=_['intersection'](_0x1eee51[_0xf2c3('0x47')],_0x1eee51['query']);_0x651df1[_0xf2c3('0x4a')]=_[_0xf2c3('0x49')](_0x1eee51[_0xf2c3('0x47')],qs[_0xf2c3('0x4b')](_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x651df1['attributes']=_0x651df1['attributes'][_0xf2c3('0x5a')]?_0x651df1[_0xf2c3('0x4a')]:_0x1eee51[_0xf2c3('0x47')];if(!_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x6d')](_0xf2c3('0x4d'))){_0x651df1[_0xf2c3('0x35')]=qs['limit'](_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x651df1[_0xf2c3('0x34')]=qs[_0xf2c3('0x34')](_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x34')]);}_0x651df1['order']=qs['sort'](_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x4f')]);_0x651df1[_0xf2c3('0x51')]=qs['filters'](_['pick'](_0x5c2856[_0xf2c3('0x4c')],_0x1eee51[_0xf2c3('0x48')]));_0x651df1[_0xf2c3('0x51')]['ChatWebsiteId']=_0x328c1f['id'];if(_0x5c2856['query']['filter']){_0x651df1[_0xf2c3('0x51')]=_['merge'](_0x651df1[_0xf2c3('0x51')],{'$or':_[_0xf2c3('0x52')](_0x651df1[_0xf2c3('0x4a')],function(_0x587027){var _0x20a6ee={};_0x20a6ee[_0x587027]={'$like':'%'+_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x54')]+'%'};return _0x20a6ee;})});}_0x651df1=_[_0xf2c3('0x5d')]({},_0x651df1,_0x5c2856['options']);return db['Disposition']['count']({'where':_0x651df1['where']})['then'](function(_0x452f84){_0x288a38[_0xf2c3('0x33')]=_0x452f84;if(_0x5c2856[_0xf2c3('0x4c')][_0xf2c3('0x5b')]){_0x651df1[_0xf2c3('0x5c')]=[{'all':!![]}];}return db[_0xf2c3('0x6a')]['findAll'](_0x651df1);})[_0xf2c3('0x25')](function(_0x56e89c){_0x288a38['rows']=_0x56e89c;return _0x288a38;});}})[_0xf2c3('0x25')](respondWithFilteredResult(_0x302caa,_0x651df1))[_0xf2c3('0x2f')](handleError(_0x302caa,null));};exports[_0xf2c3('0x6e')]=function(_0x1850db,_0x5115dc,_0x55f98e){return db[_0xf2c3('0x55')][_0xf2c3('0x5e')]({'where':{'id':_0x1850db[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x5115dc,null))[_0xf2c3('0x25')](function(_0x113253){if(_0x113253){return _0x113253[_0xf2c3('0x6e')](_0x1850db['query'][_0xf2c3('0x6f')]);}})[_0xf2c3('0x25')](respondWithStatusCode(_0x5115dc,null))[_0xf2c3('0x2f')](handleError(_0x5115dc,null));};exports[_0xf2c3('0x70')]=function(_0x595864,_0x2a7b3a,_0x4dc024){if(_0x595864[_0xf2c3('0x60')]['id']){delete _0x595864[_0xf2c3('0x60')]['id'];}return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x595864[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x2a7b3a,null))[_0xf2c3('0x25')](function(_0x249935){if(_0x249935){_0x595864['body'][_0xf2c3('0x69')]=_0x249935['id'];return db['CannedAnswer'][_0xf2c3('0x5f')](_0x595864[_0xf2c3('0x60')]);}})[_0xf2c3('0x25')](respondWithResult(_0x2a7b3a,null))[_0xf2c3('0x2f')](handleError(_0x2a7b3a,null));};exports[_0xf2c3('0x71')]=function(_0x10daab,_0x5e55d6,_0x762ea5){var _0x4d3334={'raw':![],'where':{}};var _0x437069={};var _0x4e0eba={'count':0x0,'rows':[]};return db[_0xf2c3('0x55')]['findOne']({'where':{'id':_0x10daab['params']['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x5e55d6,null))['then'](function(_0x5b9fe4){if(_0x5b9fe4){_0x437069['model']=_['keys'](db['CannedAnswer'][_0xf2c3('0x43')]);_0x437069[_0xf2c3('0x4c')]=_['keys'](_0x10daab[_0xf2c3('0x4c')]);_0x437069[_0xf2c3('0x48')]=_['intersection'](_0x437069[_0xf2c3('0x47')],_0x437069[_0xf2c3('0x4c')]);_0x4d3334[_0xf2c3('0x4a')]=_[_0xf2c3('0x49')](_0x437069[_0xf2c3('0x47')],qs[_0xf2c3('0x4b')](_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x4d3334[_0xf2c3('0x4a')]=_0x4d3334[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x4d3334[_0xf2c3('0x4a')]:_0x437069[_0xf2c3('0x47')];if(!_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x6d')](_0xf2c3('0x4d'))){_0x4d3334[_0xf2c3('0x35')]=qs[_0xf2c3('0x35')](_0x10daab['query'][_0xf2c3('0x35')]);_0x4d3334[_0xf2c3('0x34')]=qs['offset'](_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x34')]);}_0x4d3334[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x4f')]);_0x4d3334[_0xf2c3('0x51')]=qs[_0xf2c3('0x48')](_[_0xf2c3('0x50')](_0x10daab[_0xf2c3('0x4c')],_0x437069[_0xf2c3('0x48')]));_0x4d3334[_0xf2c3('0x51')][_0xf2c3('0x69')]=_0x5b9fe4['id'];if(_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x54')]){_0x4d3334[_0xf2c3('0x51')]=_[_0xf2c3('0x5d')](_0x4d3334[_0xf2c3('0x51')],{'$or':_[_0xf2c3('0x52')](_0x4d3334[_0xf2c3('0x4a')],function(_0x1c14ff){var _0x2b516d={};_0x2b516d[_0x1c14ff]={'$like':'%'+_0x10daab['query'][_0xf2c3('0x54')]+'%'};return _0x2b516d;})});}_0x4d3334=_[_0xf2c3('0x5d')]({},_0x4d3334,_0x10daab['options']);return db[_0xf2c3('0x72')][_0xf2c3('0x33')]({'where':_0x4d3334['where']})[_0xf2c3('0x25')](function(_0x2b39aa){_0x4e0eba['count']=_0x2b39aa;if(_0x10daab[_0xf2c3('0x4c')][_0xf2c3('0x5b')]){_0x4d3334[_0xf2c3('0x5c')]=[{'all':!![]}];}return db[_0xf2c3('0x72')][_0xf2c3('0x73')](_0x4d3334);})[_0xf2c3('0x25')](function(_0x146281){_0x4e0eba[_0xf2c3('0x74')]=_0x146281;return _0x4e0eba;});}})['then'](respondWithFilteredResult(_0x5e55d6,_0x4d3334))[_0xf2c3('0x2f')](handleError(_0x5e55d6,null));};exports[_0xf2c3('0x75')]=function(_0x3e8257,_0x2d3ad1,_0x2240b7){return db['ChatWebsite'][_0xf2c3('0x5e')]({'where':{'id':_0x3e8257[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x2d3ad1,null))[_0xf2c3('0x25')](function(_0x1775e4){if(_0x1775e4){return _0x1775e4[_0xf2c3('0x75')](_0x3e8257[_0xf2c3('0x4c')][_0xf2c3('0x6f')]);}})[_0xf2c3('0x25')](respondWithStatusCode(_0x2d3ad1,null))['catch'](handleError(_0x2d3ad1,null));};exports[_0xf2c3('0x76')]=function(_0x3d8c7f,_0x49ce19,_0x2ebf1c){_0x3d8c7f[_0xf2c3('0x60')][_0xf2c3('0x77')]=_0x3d8c7f[_0xf2c3('0x78')][_0xf2c3('0x79')];return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x3d8c7f[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x49ce19,null))[_0xf2c3('0x25')](saveUpdates(_0x3d8c7f[_0xf2c3('0x60')],null))[_0xf2c3('0x25')](respondWithResult(_0x49ce19,null))[_0xf2c3('0x2f')](handleError(_0x49ce19,null));};exports[_0xf2c3('0x7a')]=function(_0x968cc9,_0x20a95e,_0x3c4af6){_0x968cc9[_0xf2c3('0x60')][_0xf2c3('0x7b')]=_0x968cc9['file'][_0xf2c3('0x79')];return db['ChatWebsite']['find']({'where':{'id':_0x968cc9[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x20a95e,null))['then'](saveUpdates(_0x968cc9[_0xf2c3('0x60')],null))['then'](respondWithResult(_0x20a95e,null))[_0xf2c3('0x2f')](handleError(_0x20a95e,null));};exports[_0xf2c3('0x7c')]=function(_0x3cd7a0,_0x43e356,_0x4fe647){_0x3cd7a0[_0xf2c3('0x60')][_0xf2c3('0x7d')]=_0x3cd7a0[_0xf2c3('0x78')][_0xf2c3('0x79')];return db[_0xf2c3('0x55')][_0xf2c3('0x5e')]({'where':{'id':_0x3cd7a0[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x43e356,null))['then'](saveUpdates(_0x3cd7a0[_0xf2c3('0x60')],null))[_0xf2c3('0x25')](respondWithResult(_0x43e356,null))[_0xf2c3('0x2f')](handleError(_0x43e356,null));};exports[_0xf2c3('0x7e')]=function(_0x45e99a,_0x542ef5,_0x6b0348){_0x45e99a[_0xf2c3('0x60')][_0xf2c3('0x7f')]=_0x45e99a['file'][_0xf2c3('0x79')];return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x45e99a[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x542ef5,null))[_0xf2c3('0x25')](saveUpdates(_0x45e99a[_0xf2c3('0x60')],null))[_0xf2c3('0x25')](respondWithResult(_0x542ef5,null))['catch'](handleError(_0x542ef5,null));};exports['getLogo']=function(_0x4947ca,_0x3b5bee,_0x96463d){var _0x148033=path[_0xf2c3('0x80')](config['root'],_0xf2c3('0x81'));var _0x402b92={'where':{'id':_0x4947ca[_0xf2c3('0x57')]['id']},'attributes':['id',_0xf2c3('0x77')],'raw':!![]};var _0x53ea2d=![];return require(_0xf2c3('0x82'))['getLicense']()[_0xf2c3('0x25')](function(_0xb33248){if(_0xb33248){_0x53ea2d=_0xb33248[_0xf2c3('0x83')];}})[_0xf2c3('0x25')](function(){return db[_0xf2c3('0x55')][_0xf2c3('0x5e')](_0x402b92);})['then'](handleEntityNotFound(_0x3b5bee,null))[_0xf2c3('0x25')](function(_0x266587){if(_0x266587){if(!_[_0xf2c3('0x84')](_0x266587[_0xf2c3('0x77')])){if(fs[_0xf2c3('0x85')](path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],'server/files/images/logos/',_0x266587[_0xf2c3('0x77')]))&&_0x53ea2d){_0x148033=path['join'](config[_0xf2c3('0x86')],'server/files/images/logos/',_0x266587[_0xf2c3('0x77')]);}}return _0x3b5bee[_0xf2c3('0x87')](_0x148033);}})[_0xf2c3('0x2f')](handleError(_0x3b5bee,null));};exports[_0xf2c3('0x88')]=function(_0x239440,_0x58acec,_0x114a52){var _0x17752c=path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x89'));var _0x56f493={'where':{'id':_0x239440['params']['id']},'attributes':['id',_0xf2c3('0x7b')],'raw':!![]};return db['ChatWebsite']['find'](_0x56f493)['then'](handleEntityNotFound(_0x58acec,null))[_0xf2c3('0x25')](function(_0xd4a0b8){if(_0xd4a0b8){if(!_['isNil'](_0xd4a0b8['agentAvatar'])){if(fs[_0xf2c3('0x85')](path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8a'),_0xd4a0b8[_0xf2c3('0x7b')]))){_0x17752c=path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8a'),_0xd4a0b8[_0xf2c3('0x7b')]);}}return _0x58acec[_0xf2c3('0x87')](_0x17752c);}})['catch'](handleError(_0x58acec,null));};exports[_0xf2c3('0x8b')]=function(_0x1e4337,_0x76ec35,_0x4f30fc){var _0x1c6905=path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8c'));var _0xb5302e={'where':{'id':_0x1e4337[_0xf2c3('0x57')]['id']},'attributes':['id',_0xf2c3('0x7d'),_0xf2c3('0x8d')],'raw':!![]};return db['ChatWebsite']['find'](_0xb5302e)['then'](handleEntityNotFound(_0x76ec35,null))['then'](function(_0xbe9b0d){if(_0xbe9b0d){if(!_[_0xf2c3('0x84')](_0xbe9b0d[_0xf2c3('0x7d')])){if(fs[_0xf2c3('0x85')](path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8a'),_0xbe9b0d[_0xf2c3('0x7d')]))&&_0xbe9b0d['showCustomerAvatar']){_0x1c6905=path[_0xf2c3('0x80')](config['root'],'server/files/images/avatars/',_0xbe9b0d[_0xf2c3('0x7d')]);}}return _0x76ec35[_0xf2c3('0x87')](_0x1c6905);}})[_0xf2c3('0x2f')](handleError(_0x76ec35,null));};exports[_0xf2c3('0x8e')]=function(_0x31faee,_0x44db94,_0x24357a){var _0x59ea7c=path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8f'));var _0x8db678={'where':{'id':_0x31faee[_0xf2c3('0x57')]['id']},'attributes':['id',_0xf2c3('0x7f')],'raw':!![]};return db[_0xf2c3('0x55')]['find'](_0x8db678)[_0xf2c3('0x25')](handleEntityNotFound(_0x44db94,null))[_0xf2c3('0x25')](function(_0x47c435){if(_0x47c435){if(!_['isNil'](_0x47c435[_0xf2c3('0x7f')])){if(fs[_0xf2c3('0x85')](path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8a'),_0x47c435[_0xf2c3('0x7f')]))){_0x59ea7c=path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0x8a'),_0x47c435[_0xf2c3('0x7f')]);}}return _0x44db94[_0xf2c3('0x87')](_0x59ea7c);}})[_0xf2c3('0x2f')](handleError(_0x44db94,null));};exports[_0xf2c3('0x90')]=function(_0x556319,_0x51b8e7,_0x186f41){var _0x3ae592=require(_0xf2c3('0x91'));var _0x17098e=new _0x3ae592();var _0x358e39=_0x17098e['setUA'](_0x556319[_0xf2c3('0x92')][_0xf2c3('0x93')])[_0xf2c3('0x94')]();var _0x2e4efc={'body':_0x556319[_0xf2c3('0x60')],'channel':'chat'};var _0x1ad3a9=[];var _0x287bc9=[];var _0x2401a8={};var _0x14d5f0=![];return db[_0xf2c3('0x95')][_0xf2c3('0x67')]()[_0xf2c3('0x25')](function(_0x288576){if(!_0x288576){throw new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))]('no\x20available\x20attributes');}_0x1ad3a9=_[_0xf2c3('0x96')](_[_0xf2c3('0x59')](_0x288576),['createdAt','updatedAt']);_0x287bc9=_['difference'](_[_0xf2c3('0x59')](_0x288576),[_0xf2c3('0x97'),_0xf2c3('0x98'),'CompanyId',_0xf2c3('0x99')]);if(_0x556319['body']['id']){delete _0x556319[_0xf2c3('0x60')]['id'];}if(_[_0xf2c3('0x84')](_0x556319['body'][_0xf2c3('0x9a')])){throw new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))]('from\x20is\x20mandatory');}if(_[_0xf2c3('0x84')](_0x556319[_0xf2c3('0x60')][_0xf2c3('0x60')])||_0x556319[_0xf2c3('0x60')]['body']===''){throw new db[(_0xf2c3('0x21'))]['ValidationError'](_0xf2c3('0x9b'));}if(_[_0xf2c3('0x84')](_0x556319['body'][_0xf2c3('0x9c')])){throw new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x287bc9);}if(!_[_0xf2c3('0x9d')](_0x287bc9,_0x556319[_0xf2c3('0x60')][_0xf2c3('0x9c')])){throw new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))](_0xf2c3('0x9e')+_0x287bc9);}_0x2401a8[_0x556319[_0xf2c3('0x60')]['mapKey']]=_0x556319[_0xf2c3('0x60')][_0xf2c3('0x9a')];})[_0xf2c3('0x25')](function(){return db['ChatWebsite'][_0xf2c3('0x5e')]({'where':{'id':_0x556319[_0xf2c3('0x57')]['id']},'include':[{'model':db[_0xf2c3('0x9f')],'as':_0xf2c3('0xa0'),'include':[{'model':db[_0xf2c3('0x95')],'as':_0xf2c3('0xa1'),'where':_0x2401a8,'limit':0x1,'order':[[_0xf2c3('0x98'),_0xf2c3('0xa2')]]}]},{'model':db[_0xf2c3('0xa3')],'as':_0xf2c3('0xa4')}]});})[_0xf2c3('0x25')](handleEntityNotFound(_0x51b8e7,null))[_0xf2c3('0x25')](function(_0x1107db){if(_0x1107db&&_0x1107db[_0xf2c3('0xa0')]){_0x2e4efc[_0xf2c3('0xa5')]=_0x1107db;_0x2e4efc[_0xf2c3('0xa6')]=_0x1107db[_0xf2c3('0xa4')];_0x2e4efc[_0xf2c3('0xa7')]=_0x1107db[_0xf2c3('0xa0')];_0x2e4efc[_0xf2c3('0xa6')]=_['orderBy'](_0x2e4efc['applications'],[_0xf2c3('0xa8')],['asc']);if(_0x2e4efc['account'][_0xf2c3('0xa4')]){delete _0x2e4efc[_0xf2c3('0xa5')]['Applications'];}if(_0x2e4efc[_0xf2c3('0xa5')][_0xf2c3('0xa0')]&&_0x2e4efc['account']['List']['Contacts'][_0xf2c3('0x5a')]){return _0x2e4efc[_0xf2c3('0xa5')][_0xf2c3('0xa0')][_0xf2c3('0xa1')][0x0];}var _0x5a0a6f=_[_0xf2c3('0x1a')](_0x556319[_0xf2c3('0x60')],{'firstName':_0x556319[_0xf2c3('0x60')]['from'],'ListId':_0x1107db[_0xf2c3('0x99')]});_0x5a0a6f[_0x556319['body'][_0xf2c3('0x9c')]]=_0x556319[_0xf2c3('0x60')][_0xf2c3('0x9a')];return db[_0xf2c3('0x95')]['create'](_0x5a0a6f,{'fields':_0x1ad3a9,'raw':!![]});}})[_0xf2c3('0x25')](handleEntityNotFound(_0x51b8e7,null))[_0xf2c3('0x25')](function(_0x5c8551){_0x2e4efc['contact']=_0x5c8551;var _0x40a1dd=_0x556319[_0xf2c3('0x60')][_0xf2c3('0xa9')];if(_0x556319['headers'][_0xf2c3('0xaa')]){_0x40a1dd=_0x556319[_0xf2c3('0x92')][_0xf2c3('0xaa')];}else if(_0x556319['headers'][_0xf2c3('0xab')]){_0x40a1dd=_[_0xf2c3('0xac')](_0x556319[_0xf2c3('0x92')][_0xf2c3('0xab')][_0xf2c3('0xad')](','));}if(_0x5c8551){var _0x549603={'ContactId':_0x5c8551['id'],'ChatWebsiteId':_0x556319[_0xf2c3('0x57')]['id'],'from':(_0x5c8551[_0xf2c3('0xae')]||'')+'\x20'+(_0x5c8551['lastName']||''),'customerIp':_0x40a1dd,'customerPort':_0x556319[_0xf2c3('0x92')][_0xf2c3('0xaf')]?_0x556319[_0xf2c3('0x92')]['x-real-port']:null,'referer':_0x556319['body'][_0xf2c3('0xb0')],'browserName':_0x358e39[_0xf2c3('0xb1')][_0xf2c3('0x41')]&&_0x358e39[_0xf2c3('0xb1')][_0xf2c3('0xb2')]?util['format'](_0xf2c3('0xb3'),_0x358e39[_0xf2c3('0xb1')][_0xf2c3('0x41')],_0x358e39[_0xf2c3('0xb1')]['version']):'unknown','browserVersion':_0x358e39[_0xf2c3('0xb1')]['version']||_0xf2c3('0xb4'),'osName':util[_0xf2c3('0xb5')]('%s\x20%s',_0x358e39['os']['name'],_0x358e39['os'][_0xf2c3('0xb2')]),'osVersion':_0x358e39['os']['version'],'deviceModel':_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0x47')]&&_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0xb7')]?util[_0xf2c3('0xb5')](_0xf2c3('0xb8'),_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0x47')],_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0xb7')],_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0x45')]):null,'deviceVendor':_0x358e39[_0xf2c3('0xb6')][_0xf2c3('0xb7')],'deviceType':_0x358e39['device']['type'],'formData':JSON['stringify'](_0x556319['body'])};var _0x42bb52={'ChatWebsiteId':_0x556319[_0xf2c3('0x57')]['id'],'closed':![]};if(_0x556319[_0xf2c3('0x60')][_0xf2c3('0xb9')]){_0x42bb52[_0xf2c3('0xb9')]=_0x556319[_0xf2c3('0x60')]['threadId'];return db[_0xf2c3('0xba')][_0xf2c3('0x5e')]({'where':_0x42bb52})[_0xf2c3('0x25')](function(_0x39c2ac){if(_0x39c2ac){return[_0x39c2ac,![]];}_0x549603[_0xf2c3('0xb9')]=_0x556319[_0xf2c3('0x60')]['threadId'];_0x549603[_0xf2c3('0xbb')]=_0x556319[_0xf2c3('0x60')]['externalUrl'];return db[_0xf2c3('0xba')][_0xf2c3('0x5f')](_0x549603)['then'](function(_0x50679d){return[_0x50679d,!![]];});});}_0x42bb52[_0xf2c3('0xbc')]=_0x5c8551['id'];if(_0x556319['body']['interaction']&&_0x556319[_0xf2c3('0x60')]['interaction']['id']){_0x42bb52['id']=_0x556319[_0xf2c3('0x60')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x42bb52})['then'](function(_0x4caef2){if(_0x4caef2){return[_0x4caef2,![]];}return db[_0xf2c3('0xba')][_0xf2c3('0x5f')](_0x549603)[_0xf2c3('0x25')](function(_0x40838f){return[_0x40838f,!![]];});});}return db['ChatInteraction'][_0xf2c3('0x5f')](_0x549603)['then'](function(_0x1a31ba){return[_0x1a31ba,!![]];});}})[_0xf2c3('0xbd')](function(_0x71fcc2,_0x198660){if(_0x71fcc2){_0x14d5f0=_0x198660;if(!_0x198660){var _0x57c0d0={'from':(_0x2e4efc[_0xf2c3('0xbe')][_0xf2c3('0xae')]||'')+'\x20'+(_0x2e4efc[_0xf2c3('0xbe')][_0xf2c3('0xbf')]||'')};if(_0x556319['body'][_0xf2c3('0xb9')]&&_0x556319[_0xf2c3('0x60')][_0xf2c3('0xc0')]&&_0x556319[_0xf2c3('0x60')]['threadId']!=_0x556319[_0xf2c3('0x60')]['messageId']){_0x57c0d0[_0xf2c3('0xb9')]=_0x556319[_0xf2c3('0x60')][_0xf2c3('0xc0')];}return _0x71fcc2[_0xf2c3('0x3b')](_0x57c0d0);}else{return _0x71fcc2;}}})[_0xf2c3('0x25')](function(_0xf0285d){_0x2e4efc[_0xf2c3('0xc1')]=_0xf0285d[_0xf2c3('0x64')]({'plain':!![]});_0x2e4efc[_0xf2c3('0xc1')]['created']=_0x14d5f0;if(_0x2e4efc[_0xf2c3('0xc1')][_0xf2c3('0xc2')]){if(_0x2e4efc['account'][_0xf2c3('0xc3')]){_0x2e4efc[_0xf2c3('0xa6')][_0xf2c3('0xc4')]({'id':0x0,'priority':_0x2e4efc['applications']['length']+0x1,'app':_0xf2c3('0xc5'),'appdata':_0xf2c3('0xc6'),'interval':_0xf2c3('0xc7')});}}return db[_0xf2c3('0xc8')]['create']({'body':_0x556319[_0xf2c3('0x60')][_0xf2c3('0x60')],'ChatWebsiteId':_0x556319[_0xf2c3('0x57')]['id'],'ChatInteractionId':_0xf0285d['id'],'direction':'in','ContactId':_0x2e4efc[_0xf2c3('0xbe')]['id'],'AttachmentId':_0x556319[_0xf2c3('0x60')]['AttachmentId']});})['then'](function(_0x28041b){_0x2e4efc[_0xf2c3('0x2d')]=_0x28041b;if(_0x2e4efc[_0xf2c3('0xc1')][_0xf2c3('0xc9')]){return db[_0xf2c3('0xca')][_0xf2c3('0x5e')]({'attributes':['id','name'],'where':{'id':_0x2e4efc[_0xf2c3('0xc1')][_0xf2c3('0xc9')]}})[_0xf2c3('0x25')](function(_0x4241e8){if(_0x4241e8){_0x2e4efc[_0xf2c3('0xa6')][_0xf2c3('0xcb')]({'id':0x0,'priority':0x0,'app':_0xf2c3('0xcc'),'appdata':_0x4241e8[_0xf2c3('0x41')]+','+(_0x2e4efc['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf2c3('0xc7')});_0x2e4efc[_0xf2c3('0xcd')]=!![];}return respondWithRpcPromise('Start',_0xf2c3('0xce'),_0x2e4efc);});}return respondWithRpcPromise(_0xf2c3('0xcf'),_0xf2c3('0xce'),_0x2e4efc);})['then'](function(_0x37113f){respondWithRpcPromise(_0xf2c3('0xd0'),_0xf2c3('0xd0'),{'event':_0xf2c3('0x90'),'message':_0x37113f},client9002);return _0x37113f;})['then'](respondWithResult(_0x51b8e7,null))[_0xf2c3('0x2f')](handleError(_0x51b8e7,null));};exports['offline']=function(_0x41146a,_0x36df3c,_0x2b4f21){var _0x352125,_0x1e9394,_0x43ac2b;var _0x34f76d=[];var _0x84b324=[];var _0x824411={};return db['CmContact']['describe']()['then'](function(_0x5e73fa){if(!_0x5e73fa){throw new db['Sequelize'][(_0xf2c3('0x22'))]('no\x20available\x20attributes');}_0x84b324=_[_0xf2c3('0x96')](_[_0xf2c3('0x59')](_0x5e73fa),[_0xf2c3('0x97'),'updatedAt']);_0x34f76d=_[_0xf2c3('0x96')](_[_0xf2c3('0x59')](_0x5e73fa),[_0xf2c3('0x97'),'updatedAt','CompanyId',_0xf2c3('0x99')]);if(_0x41146a[_0xf2c3('0x60')]['id']){delete _0x41146a[_0xf2c3('0x60')]['id'];}if(_[_0xf2c3('0x84')](_0x41146a[_0xf2c3('0x60')][_0xf2c3('0x9a')])){throw _0x36df3c[_0xf2c3('0x30')](0x1f4)['send'](new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))](_0xf2c3('0xd1')));}if(_[_0xf2c3('0x84')](_0x41146a[_0xf2c3('0x60')]['body'])||_0x41146a[_0xf2c3('0x60')]['body']===''){throw _0x36df3c['status'](0x1f4)[_0xf2c3('0xd2')](new db[(_0xf2c3('0x21'))]['ValidationError'](_0xf2c3('0x9b')));}if(_[_0xf2c3('0x84')](_0x41146a[_0xf2c3('0x60')][_0xf2c3('0xd3')])){throw _0x36df3c['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xf2c3('0xd4')+_0x34f76d));}if(!_[_0xf2c3('0x9d')](_0x34f76d,_0x41146a[_0xf2c3('0x60')][_0xf2c3('0xd3')])){throw _0x36df3c['status'](0x1f4)['send'](new db[(_0xf2c3('0x21'))][(_0xf2c3('0x22'))](_0xf2c3('0xd5')+_0x34f76d));}_0x824411[_0x41146a[_0xf2c3('0x60')][_0xf2c3('0xd3')]]=_0x41146a[_0xf2c3('0x60')][_0xf2c3('0x9a')];})['then'](function(){return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x41146a[_0xf2c3('0x57')]['id']},'include':[{'model':db[_0xf2c3('0x9f')],'as':'List'}]});})['then'](handleEntityNotFound(_0x36df3c,null))[_0xf2c3('0x25')](function(_0x185106){if(_0x185106&&_0x185106[_0xf2c3('0xa0')]){_0x1e9394=_0x185106;var _0x42d385=_['defaults'](_0x41146a[_0xf2c3('0x60')],{'firstName':_0x41146a[_0xf2c3('0x60')]['from'],'phone':_0x41146a[_0xf2c3('0x60')][_0xf2c3('0x9a')],'ListId':_0x185106[_0xf2c3('0x99')]});_0x42d385[_0x41146a['body'][_0xf2c3('0xd3')]]=_0x41146a['body']['from'];return db[_0xf2c3('0x95')][_0xf2c3('0xd6')]({'where':_0x824411,'defaults':_0x42d385});}})['spread'](function(_0x215b8b){if(_0x215b8b){_0x43ac2b=_0x215b8b;var _0x20e34b=fs['readFileSync'](path[_0xf2c3('0x80')](config[_0xf2c3('0x86')],_0xf2c3('0xd7')),_0xf2c3('0xd8'));var _0x2ac100=ejs[_0xf2c3('0xd9')](_0x20e34b,{'body':_[_0xf2c3('0xda')](_0x41146a[_0xf2c3('0x60')][_0xf2c3('0x60')]),'bodyTitle':_0x1e9394['offlineMessageBody']});return db[_0xf2c3('0xdb')]['create']({'body':_0x2ac100,'ContactId':_0x215b8b['id'],'ChatWebsiteId':_0x1e9394['id']});}})[_0xf2c3('0x25')](function(_0x28016a){if(_0x28016a){_0x352125=_0x28016a;return db[_0xf2c3('0xdc')][_0xf2c3('0x6c')]({'where':{'service':!![]},'include':[{'model':db[_0xf2c3('0xdd')],'as':'Smtp','raw':!![]}]});}})[_0xf2c3('0x25')](function(_0xd80354){if(_0xd80354&&_0xd80354[_0xf2c3('0xde')]&&_0x1e9394['forwardOfflineAddress']){var _0x1b6828={'tls':{'rejectUnauthorized':![]}};if(_0xd80354[_0xf2c3('0xde')][_0xf2c3('0xdf')]){_0x1b6828[_0xf2c3('0xdf')]=_0xd80354['Smtp']['service'];}else{_0x1b6828[_0xf2c3('0xe0')]=_0xd80354[_0xf2c3('0xde')][_0xf2c3('0xe0')];_0x1b6828[_0xf2c3('0xe1')]=_0xd80354[_0xf2c3('0xde')][_0xf2c3('0xe1')];_0x1b6828[_0xf2c3('0xe2')]=_0xd80354['Smtp'][_0xf2c3('0xe2')];}if(_0xd80354['Smtp'][_0xf2c3('0xe3')]){_0x1b6828['auth']={'user':_0xd80354[_0xf2c3('0xde')][_0xf2c3('0x61')],'pass':_0xd80354[_0xf2c3('0xde')][_0xf2c3('0xe4')]};}return respondWithRpcPromise(_0xf2c3('0xe5'),_0xf2c3('0xe6'),{'account':_0x1b6828,'message':{'from':util['format'](_0xf2c3('0xe7'),_0xd80354['name'],_0xd80354[_0xf2c3('0xe8')]||_0xd80354[_0xf2c3('0xde')][_0xf2c3('0x61')]),'to':_0x1e9394[_0xf2c3('0xe9')],'subject':_0x1e9394[_0xf2c3('0xea')],'text':_0x352125[_0xf2c3('0x60')]}},client9003)[_0xf2c3('0x25')](function(){return _0x352125;})[_0xf2c3('0x2f')](function(_0x50ea25){console[_0xf2c3('0x2b')](_0x50ea25);});}})[_0xf2c3('0x25')](function(){if(_0x352125){return _0x352125;}})[_0xf2c3('0x25')](respondWithResult(_0x36df3c,null))[_0xf2c3('0x2f')](handleError(_0x36df3c,null));};exports[_0xf2c3('0xeb')]=function(_0x15f722,_0x3e3b5d,_0xf563cc){return db[_0xf2c3('0xba')][_0xf2c3('0x5e')]({'where':{'id':_0x15f722[_0xf2c3('0x57')]['id']}})['then'](handleEntityNotFound(_0x3e3b5d,null))[_0xf2c3('0x25')](function(_0x78566){if(_0x78566){return _0x78566[_0xf2c3('0xeb')](_0x15f722['body'][_0xf2c3('0x6f')],_[_0xf2c3('0xec')](_0x15f722[_0xf2c3('0x60')],[_0xf2c3('0x6f'),'id'])||{});}})[_0xf2c3('0x25')](respondWithResult(_0x3e3b5d,null))[_0xf2c3('0x2f')](handleError(_0x3e3b5d,null));};exports[_0xf2c3('0xed')]=function(_0x3b9545,_0x21459e,_0x3cc4db){var _0x44875e={'raw':![],'where':{}};var _0x56ae3c={};var _0x546620={'count':0x0,'rows':[]};return db[_0xf2c3('0x55')][_0xf2c3('0x6c')]({'where':{'id':_0x3b9545[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x21459e,null))[_0xf2c3('0x25')](function(_0x55bc3c){if(_0x55bc3c){_0x56ae3c[_0xf2c3('0x47')]=_[_0xf2c3('0x59')](db['ChatInteraction'][_0xf2c3('0x43')]);_0x56ae3c[_0xf2c3('0x4c')]=_[_0xf2c3('0x59')](_0x3b9545[_0xf2c3('0x4c')]);_0x56ae3c[_0xf2c3('0x48')]=_[_0xf2c3('0x49')](_0x56ae3c[_0xf2c3('0x47')],_0x56ae3c[_0xf2c3('0x4c')]);_0x44875e[_0xf2c3('0x4a')]=_['intersection'](_0x56ae3c[_0xf2c3('0x47')],qs[_0xf2c3('0x4b')](_0x3b9545[_0xf2c3('0x4c')]['fields']));_0x44875e['attributes']=_0x44875e[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x44875e[_0xf2c3('0x4a')]:_0x56ae3c['model'];if(!_0x3b9545[_0xf2c3('0x4c')][_0xf2c3('0x6d')]('nolimit')){_0x44875e[_0xf2c3('0x35')]=qs['limit'](_0x3b9545[_0xf2c3('0x4c')]['limit']);_0x44875e[_0xf2c3('0x34')]=qs[_0xf2c3('0x34')](_0x3b9545[_0xf2c3('0x4c')]['offset']);}_0x44875e[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x3b9545[_0xf2c3('0x4c')][_0xf2c3('0x4f')]);_0x44875e[_0xf2c3('0x51')]=qs[_0xf2c3('0x48')](_['pick'](_0x3b9545[_0xf2c3('0x4c')],_0x56ae3c[_0xf2c3('0x48')]));_0x44875e[_0xf2c3('0x51')][_0xf2c3('0x69')]=_0x55bc3c['id'];if(_0x3b9545['query'][_0xf2c3('0x54')]){_0x44875e['where']=_[_0xf2c3('0x5d')](_0x44875e[_0xf2c3('0x51')],{'$or':_[_0xf2c3('0x52')](_0x44875e[_0xf2c3('0x4a')],function(_0x8e4e39){var _0x57ce63={};_0x57ce63[_0x8e4e39]={'$like':'%'+_0x3b9545[_0xf2c3('0x4c')][_0xf2c3('0x54')]+'%'};return _0x57ce63;})});}_0x44875e=_[_0xf2c3('0x5d')]({},_0x44875e,_0x3b9545[_0xf2c3('0xee')]);return db[_0xf2c3('0xba')][_0xf2c3('0x33')]({'where':_0x44875e[_0xf2c3('0x51')]})['then'](function(_0x29f243){_0x546620[_0xf2c3('0x33')]=_0x29f243;if(_0x3b9545[_0xf2c3('0x4c')][_0xf2c3('0x5b')]){_0x44875e[_0xf2c3('0x5c')]=[{'model':db[_0xf2c3('0x95')],'as':_0xf2c3('0xef'),'required':![]},{'model':db[_0xf2c3('0xca')],'as':_0xf2c3('0xf0'),'attributes':[_0xf2c3('0x41'),_0xf2c3('0xf1'),_0xf2c3('0xf2')],'required':![]},{'model':db[_0xf2c3('0xf3')],'as':_0xf2c3('0xf4'),'attributes':['id',_0xf2c3('0x41'),'color'],'where':_0x3b9545[_0xf2c3('0x4c')][_0xf2c3('0xf5')]?{'id':_0x3b9545['query']['tag']}:undefined,'required':_0x3b9545['query'][_0xf2c3('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0xf2c3('0x73')](_0x44875e);})['then'](function(_0x2564ec){_0x546620['rows']=_0x2564ec;return _0x546620;});}})['then'](respondWithFilteredResult(_0x21459e,_0x44875e))[_0xf2c3('0x2f')](handleError(_0x21459e,null));};function iftimePromise(_0x4c6dd3,_0x28f482){return respondWithRpcPromise('Command','getSnippet',{'command':_0x28f482['timezone']?util[_0xf2c3('0xb5')](_0xf2c3('0xf6'),_0x4c6dd3[_0xf2c3('0xf7')],_0x28f482[_0xf2c3('0xf8')]):util['format']('iftime\x20%s',_0x4c6dd3[_0xf2c3('0xf7')])},client9002)[_0xf2c3('0x25')](function(_0x4d70ff){var _0xfc08b7=_0x4d70ff&&_0x4d70ff[_0xf2c3('0xf9')]('true')>=0x0?!![]:![];logger[_0xf2c3('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x28f482['id'],_0x4c6dd3['id'],_0x4c6dd3[_0xf2c3('0xf7')],_0xfc08b7?_0xf2c3('0xfa'):_0xf2c3('0xfb'),_0x28f482['timezone']?_0x28f482[_0xf2c3('0xf8')]:_0xf2c3('0xfc'));return _0xfc08b7;})[_0xf2c3('0x2f')](function(_0xad52af){logger[_0xf2c3('0x2b')](_0xf2c3('0xfd'),_0x28f482['id'],_0x4c6dd3['id'],_0x4c6dd3[_0xf2c3('0xf7')],util[_0xf2c3('0xfe')](_0xad52af,{'showHidden':![],'depth':null}),_0x28f482[_0xf2c3('0xf8')]?_0x28f482['timezone']:_0xf2c3('0xfc'));return![];});}exports['getSnippet']=function(_0x2531e4,_0xde9bc0,_0x4038c6){var _0x45ef87=0x0;var _0x512ca6=0x0;var _0x2fbb99=![];var _0x2082c6;var _0x4bdc7e;return db['ChatWebsite']['find']({'where':{'id':_0x2531e4['params']['id']},'include':[{'model':db[_0xf2c3('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xf2c3('0x100'),'attributes':['id',_0xf2c3('0xf7')],'raw':!![]}]}]})[_0xf2c3('0x25')](handleEntityNotFound(_0xde9bc0,null))[_0xf2c3('0x25')](function(_0x174f69){if(_0x174f69){_0x2082c6=_0x174f69;return _0x174f69[_0xf2c3('0x101')]({'raw':!![]});}})[_0xf2c3('0x25')](function(_0x124e51){if(_0x2082c6){if(_0x124e51){_0x4bdc7e=_0x124e51;}}return require(_0xf2c3('0x82'))[_0xf2c3('0x102')]();})[_0xf2c3('0x25')](function(_0x19214e){if(_0x19214e){_0x512ca6=_0x19214e['virtual'];_0x2fbb99=_0x19214e[_0xf2c3('0x83')];}})['then'](function(){return db[_0xf2c3('0xba')]['count']({'where':{'closed':![]}});})['then'](function(_0x55774b){_0x45ef87=_0x55774b;if(_0x512ca6&&_0x55774b>_0x512ca6){return db['License']['findOne']({'where':{'id':0x1}})[_0xf2c3('0x25')](function(_0x443c23){if(_0x443c23){_0x443c23[_0xf2c3('0x103')]('chatLicenseExceeded');}});}})[_0xf2c3('0x25')](function(){if(_0x2082c6['Interval']&&_0x2082c6[_0xf2c3('0xff')][_0xf2c3('0x100')]){var _0x62b4da=[];for(var _0x46e58d=0x0;_0x46e58d<_0x2082c6[_0xf2c3('0xff')][_0xf2c3('0x100')][_0xf2c3('0x5a')];_0x46e58d++){var _0x4c6bf1=_0x2082c6[_0xf2c3('0xff')][_0xf2c3('0x100')][_0x46e58d]['get']({'plain':!![]});_0x62b4da[_0xf2c3('0xc4')](iftimePromise(_0x4c6bf1,_0x2082c6));}return BPromise[_0xf2c3('0x104')](_0x62b4da)['then'](function(_0x3a05f5){return _[_0xf2c3('0x105')](_0x3a05f5);});}else{return!![];}})[_0xf2c3('0x25')](function(_0x314d1b){var _0xc1657a=fs[_0xf2c3('0x106')](path[_0xf2c3('0x80')](config['root'],_0xf2c3('0x107')),_0xf2c3('0xd8'));var _0x4dcbc5={'remote':_0x2082c6['remote'],'query':querystring['stringify'](_['merge'](_0x2082c6['get']({'plain':!![]}),{'customerIp':_0x2531e4[_0xf2c3('0x92')][_0xf2c3('0xab')]||_0x2531e4['headers'][_0xf2c3('0x108')]||_0x2531e4[_0xf2c3('0x109')]['remoteAddress']||_0x2531e4['ip'],'referer':_0x2531e4[_0xf2c3('0x92')]['referer'],'openedInteractions':_0x45ef87,'maxInteractions':_0x512ca6,'virtual':_0x2fbb99[_0xf2c3('0x10a')],'online':_0x314d1b,'custom':_0x2fbb99}))['replace'](/'/g,'\x5c\x27')};_0xde9bc0[_0xf2c3('0xd2')](ejs[_0xf2c3('0xd9')](Mustache[_0xf2c3('0xd9')](_0xc1657a,_0x4dcbc5),{'proactiveActions':_0x4bdc7e,'alignment':_0x2082c6['alignment'],'verticalAlignment':_0x2082c6[_0xf2c3('0x10b')],'div_color':_0x2082c6[_0xf2c3('0x10c')],'text_color':_0x2082c6[_0xf2c3('0x10d')]}));})[_0xf2c3('0x2f')](handleError(_0xde9bc0,null));};exports[_0xf2c3('0x10e')]=function(_0x64ee05,_0x3af48b,_0x694648){return db['ChatWebsite'][_0xf2c3('0x6c')]({'where':{'id':_0x64ee05[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x3af48b,null))[_0xf2c3('0x25')](function(_0x529677){if(_0x529677){return db['sequelize'][_0xf2c3('0x10f')](function(_0x5f5a20){return db[_0xf2c3('0xa3')]['destroy']({'where':{'ChatWebsiteId':_0x64ee05['params']['id']},'transaction':_0x5f5a20})[_0xf2c3('0x25')](function(_0x5532c2){var _0x80ef14=_[_0xf2c3('0x52')](_0x64ee05[_0xf2c3('0x60')],function(_0x19a655){_0x19a655[_0xf2c3('0x69')]=_0x64ee05[_0xf2c3('0x57')]['id'];return _0x19a655;});return db['ChatApplication'][_0xf2c3('0x110')](_0x80ef14,{'transaction':_0x5f5a20});});})[_0xf2c3('0x25')](function(){return db[_0xf2c3('0xa3')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x64ee05['params']['id']},'order':_0xf2c3('0xa8')});});}})[_0xf2c3('0x25')](respondWithResult(_0x3af48b,null))[_0xf2c3('0x2f')](handleError(_0x3af48b,null));};exports[_0xf2c3('0x111')]=function(_0x4742be,_0x7b0a15,_0x1e5054){var _0x5320dc={};var _0x1ff58e={};var _0xb70d44;var _0x268562;return db['ChatWebsite'][_0xf2c3('0x6c')]({'where':{'id':_0x4742be[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x7b0a15,null))[_0xf2c3('0x25')](function(_0xd1123c){if(_0xd1123c){_0xb70d44=_0xd1123c;_0x1ff58e[_0xf2c3('0x47')]=_[_0xf2c3('0x59')](db[_0xf2c3('0xa3')][_0xf2c3('0x43')]);_0x1ff58e['query']=_[_0xf2c3('0x59')](_0x4742be[_0xf2c3('0x4c')]);_0x1ff58e['filters']=_[_0xf2c3('0x49')](_0x1ff58e['model'],_0x1ff58e['query']);_0x5320dc[_0xf2c3('0x4a')]=_['intersection'](_0x1ff58e[_0xf2c3('0x47')],qs['fields'](_0x4742be[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x5320dc[_0xf2c3('0x4a')]=_0x5320dc[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x5320dc[_0xf2c3('0x4a')]:_0x1ff58e[_0xf2c3('0x47')];_0x5320dc[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x4742be[_0xf2c3('0x4c')][_0xf2c3('0x4f')]);_0x5320dc[_0xf2c3('0x51')]=qs['filters'](_[_0xf2c3('0x50')](_0x4742be[_0xf2c3('0x4c')],_0x1ff58e[_0xf2c3('0x48')]));if(_0x4742be[_0xf2c3('0x4c')]['filter']){_0x5320dc['where']=_[_0xf2c3('0x5d')](_0x5320dc['where'],{'$or':_[_0xf2c3('0x52')](_0x5320dc[_0xf2c3('0x4a')],function(_0x2e5dbc){var _0x33cb47={};_0x33cb47[_0x2e5dbc]={'$like':'%'+_0x4742be['query'][_0xf2c3('0x54')]+'%'};return _0x33cb47;})});}_0x5320dc=_[_0xf2c3('0x5d')]({},_0x5320dc,_0x4742be[_0xf2c3('0xee')]);return _0xb70d44[_0xf2c3('0x111')](_0x5320dc);}})[_0xf2c3('0x25')](function(_0x2af4c4){if(_0x2af4c4){_0x268562=_0x2af4c4[_0xf2c3('0x5a')];if(!_0x4742be[_0xf2c3('0x4c')]['hasOwnProperty'](_0xf2c3('0x4d'))){_0x5320dc['limit']=qs[_0xf2c3('0x35')](_0x4742be[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x5320dc['offset']=qs[_0xf2c3('0x34')](_0x4742be[_0xf2c3('0x4c')]['offset']);}return _0xb70d44['getApplications'](_0x5320dc);}})['then'](function(_0x51a605){if(_0x51a605){return _0x51a605?{'count':_0x268562,'rows':_0x51a605}:null;}})[_0xf2c3('0x25')](respondWithResult(_0x7b0a15,null))['catch'](handleError(_0x7b0a15,null));};exports[_0xf2c3('0x112')]=function(_0x1c8257,_0x3101c1,_0x2125ce){return db[_0xf2c3('0x113')][_0xf2c3('0x5e')]({'where':{'id':_0x1c8257['params']['id']}})['then'](handleEntityNotFound(_0x3101c1,null))[_0xf2c3('0x25')](function(_0x36c59c){if(_0x36c59c){return _0x36c59c[_0xf2c3('0x112')](_0x1c8257[_0xf2c3('0x60')][_0xf2c3('0x6f')],_[_0xf2c3('0xec')](_0x1c8257['body'],[_0xf2c3('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x3101c1,null))[_0xf2c3('0x2f')](handleError(_0x3101c1,null));};exports[_0xf2c3('0x101')]=function(_0x40a274,_0x2471d2,_0x4b8054){var _0x254c7e={};var _0x1e4f59={};var _0x37dcea;var _0x9bf07e;return db[_0xf2c3('0x55')][_0xf2c3('0x6c')]({'where':{'id':_0x40a274[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x2471d2,null))['then'](function(_0x3ee7bc){if(_0x3ee7bc){_0x37dcea=_0x3ee7bc;_0x1e4f59[_0xf2c3('0x47')]=_['keys'](db[_0xf2c3('0x114')][_0xf2c3('0x43')]);_0x1e4f59['query']=_['keys'](_0x40a274[_0xf2c3('0x4c')]);_0x1e4f59[_0xf2c3('0x48')]=_['intersection'](_0x1e4f59[_0xf2c3('0x47')],_0x1e4f59[_0xf2c3('0x4c')]);_0x254c7e[_0xf2c3('0x4a')]=_['intersection'](_0x1e4f59['model'],qs[_0xf2c3('0x4b')](_0x40a274[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x254c7e[_0xf2c3('0x4a')]=_0x254c7e[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x254c7e[_0xf2c3('0x4a')]:_0x1e4f59[_0xf2c3('0x47')];_0x254c7e[_0xf2c3('0x4e')]=qs['sort'](_0x40a274['query'][_0xf2c3('0x4f')]);_0x254c7e[_0xf2c3('0x51')]=qs['filters'](_[_0xf2c3('0x50')](_0x40a274[_0xf2c3('0x4c')],_0x1e4f59['filters']));if(_0x40a274[_0xf2c3('0x4c')][_0xf2c3('0x54')]){_0x254c7e['where']=_['merge'](_0x254c7e[_0xf2c3('0x51')],{'$or':_['map'](_0x254c7e[_0xf2c3('0x4a')],function(_0x4dfc64){var _0x1c900b={};_0x1c900b[_0x4dfc64]={'$like':'%'+_0x40a274[_0xf2c3('0x4c')][_0xf2c3('0x54')]+'%'};return _0x1c900b;})});}_0x254c7e=_[_0xf2c3('0x5d')]({},_0x254c7e,_0x40a274['options']);return _0x37dcea['getProactiveActions'](_0x254c7e);}})[_0xf2c3('0x25')](function(_0x502b26){if(_0x502b26){_0x9bf07e=_0x502b26[_0xf2c3('0x5a')];if(!_0x40a274[_0xf2c3('0x4c')][_0xf2c3('0x6d')](_0xf2c3('0x4d'))){_0x254c7e[_0xf2c3('0x35')]=qs[_0xf2c3('0x35')](_0x40a274[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x254c7e['offset']=qs[_0xf2c3('0x34')](_0x40a274['query']['offset']);}return _0x37dcea[_0xf2c3('0x101')](_0x254c7e);}})[_0xf2c3('0x25')](function(_0x48b02b){if(_0x48b02b){return _0x48b02b?{'count':_0x9bf07e,'rows':_0x48b02b}:null;}})[_0xf2c3('0x25')](respondWithResult(_0x2471d2,null))[_0xf2c3('0x2f')](handleError(_0x2471d2,null));};exports[_0xf2c3('0x115')]=function(_0x40b4d5,_0x3fa8f1,_0x398b82){var _0x2c559a=_0x40b4d5['query'][_0xf2c3('0x116')]==='false'?_0xf2c3('0x117'):_0xf2c3('0x118');return db[_0xf2c3('0x55')][_0xf2c3('0x5e')]({'attributes':['id',_0x2c559a],'where':{'id':_0x40b4d5[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x3fa8f1,null))[_0xf2c3('0x25')](function(_0x1d7b92){if(_0x1d7b92){var _0x15d249=_0x1d7b92[_0x2c559a];var _0x450b36=_0x15d249&&_0x15d249[_0xf2c3('0x119')]?_0x15d249['items']:[];_0x3fa8f1[_0xf2c3('0xd2')]({'fromKey':_[_0xf2c3('0x84')](_0x15d249[_0xf2c3('0x11a')])?undefined:_0x15d249[_0xf2c3('0x11a')],'count':_0x450b36[_0xf2c3('0x5a')],'rows':_0x450b36});}})['catch'](handleError(_0x3fa8f1,null));};exports[_0xf2c3('0x11b')]=function(_0x2e5ac7,_0x51e897,_0x1d6498){var _0x259165={'raw':![],'where':{}};var _0x1a8f65={};var _0x5c4e07={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf2c3('0x6c')]({'where':{'id':_0x2e5ac7['params']['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x51e897,null))[_0xf2c3('0x25')](function(_0x84ed3f){if(_0x84ed3f){_0x1a8f65[_0xf2c3('0x47')]=_[_0xf2c3('0x59')](db[_0xf2c3('0xdb')][_0xf2c3('0x43')]);_0x1a8f65[_0xf2c3('0x4c')]=_[_0xf2c3('0x59')](_0x2e5ac7[_0xf2c3('0x4c')]);_0x1a8f65[_0xf2c3('0x48')]=_['intersection'](_0x1a8f65[_0xf2c3('0x47')],_0x1a8f65[_0xf2c3('0x4c')]);_0x259165['attributes']=_['intersection'](_0x1a8f65['model'],qs['fields'](_0x2e5ac7[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x259165[_0xf2c3('0x4a')]=_0x259165['attributes'][_0xf2c3('0x5a')]?_0x259165['attributes']:_0x1a8f65[_0xf2c3('0x47')];if(!_0x2e5ac7[_0xf2c3('0x4c')]['hasOwnProperty'](_0xf2c3('0x4d'))){_0x259165[_0xf2c3('0x35')]=qs[_0xf2c3('0x35')](_0x2e5ac7[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x259165[_0xf2c3('0x34')]=qs['offset'](_0x2e5ac7['query'][_0xf2c3('0x34')]);}_0x259165[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x2e5ac7[_0xf2c3('0x4c')]['sort']);_0x259165[_0xf2c3('0x51')]=qs[_0xf2c3('0x48')](_[_0xf2c3('0x50')](_0x2e5ac7[_0xf2c3('0x4c')],_0x1a8f65['filters']));_0x259165[_0xf2c3('0x51')][_0xf2c3('0x69')]=_0x84ed3f['id'];if(_0x2e5ac7[_0xf2c3('0x4c')][_0xf2c3('0x54')]){_0x259165[_0xf2c3('0x51')]=_['merge'](_0x259165[_0xf2c3('0x51')],{'$or':_['map'](_0x259165[_0xf2c3('0x4a')],function(_0x275fc8){var _0x36fffd={};_0x36fffd[_0x275fc8]={'$like':'%'+_0x2e5ac7['query'][_0xf2c3('0x54')]+'%'};return _0x36fffd;})});}_0x259165=_[_0xf2c3('0x5d')]({},_0x259165,_0x2e5ac7['options']);return db[_0xf2c3('0xdb')]['count']({'where':_0x259165[_0xf2c3('0x51')]})[_0xf2c3('0x25')](function(_0x31086a){_0x5c4e07[_0xf2c3('0x33')]=_0x31086a;if(_0x2e5ac7[_0xf2c3('0x4c')][_0xf2c3('0x5b')]){_0x259165['include']=[{'all':!![]}];}else{_0x259165[_0xf2c3('0x5c')]=[{'model':db[_0xf2c3('0x95')],'as':_0xf2c3('0xef'),'required':![]}];}return db[_0xf2c3('0xdb')]['findAll'](_0x259165);})[_0xf2c3('0x25')](function(_0x2576eb){_0x5c4e07[_0xf2c3('0x74')]=_0x2576eb;return _0x5c4e07;});}})[_0xf2c3('0x25')](respondWithFilteredResult(_0x51e897,_0x259165))[_0xf2c3('0x2f')](handleError(_0x51e897,null));};exports['addAgents']=function(_0x219771,_0x24463f,_0x32c456){return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x219771['params']['id']}})['then'](handleEntityNotFound(_0x24463f,null))[_0xf2c3('0x25')](function(_0x47603b){if(_0x47603b){return _0x47603b['addAgents'](_0x219771[_0xf2c3('0x60')][_0xf2c3('0x6f')],_['omit'](_0x219771[_0xf2c3('0x60')],[_0xf2c3('0x6f'),'id'])||{})[_0xf2c3('0xbd')](function(_0x44bb4b){for(var _0x5cfbc9=0x0;_0x5cfbc9<_0x219771[_0xf2c3('0x60')][_0xf2c3('0x6f')][_0xf2c3('0x5a')];_0x5cfbc9+=0x1){socket[_0xf2c3('0x11c')]('userChatWebsite:save',{'UserId':_0x219771['body'][_0xf2c3('0x6f')][_0x5cfbc9],'ChatWebsiteId':_0x219771[_0xf2c3('0x57')]['id']});}return _0x44bb4b;});}})[_0xf2c3('0x25')](respondWithResult(_0x24463f,null))['catch'](handleError(_0x24463f,null));};exports[_0xf2c3('0x11d')]=function(_0x59d90b,_0x4b6835,_0x28a50a){return db[_0xf2c3('0x55')]['find']({'where':{'id':_0x59d90b[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x4b6835,null))['then'](function(_0x2a1908){if(_0x2a1908){return _0x2a1908[_0xf2c3('0x11d')](_0x59d90b[_0xf2c3('0x4c')][_0xf2c3('0x6f')])[_0xf2c3('0x25')](function(){if(_[_0xf2c3('0x11e')](_0x59d90b[_0xf2c3('0x4c')][_0xf2c3('0x6f')])){for(var _0x221fda=0x0;_0x221fda<_0x59d90b[_0xf2c3('0x4c')][_0xf2c3('0x6f')][_0xf2c3('0x5a')];_0x221fda+=0x1){socket[_0xf2c3('0x11c')](_0xf2c3('0x11f'),{'UserId':Number(_0x59d90b[_0xf2c3('0x4c')][_0xf2c3('0x6f')][_0x221fda]),'ChatWebsiteId':Number(_0x59d90b['params']['id'])});}}else{socket[_0xf2c3('0x11c')](_0xf2c3('0x11f'),{'UserId':Number(_0x59d90b[_0xf2c3('0x4c')][_0xf2c3('0x6f')]),'ChatWebsiteId':Number(_0x59d90b[_0xf2c3('0x57')]['id'])});}});}})[_0xf2c3('0x25')](respondWithStatusCode(_0x4b6835,null))[_0xf2c3('0x2f')](handleError(_0x4b6835,null));};exports[_0xf2c3('0x120')]=function(_0x54b4da,_0x13c70f,_0x115608){var _0x10c1ba={};var _0x195959={};var _0x5880db;var _0x18d832;return db['ChatWebsite'][_0xf2c3('0x6c')]({'where':{'id':_0x54b4da[_0xf2c3('0x57')]['id']}})[_0xf2c3('0x25')](handleEntityNotFound(_0x13c70f,null))['then'](function(_0x25c7a1){if(_0x25c7a1){_0x5880db=_0x25c7a1;_0x195959[_0xf2c3('0x47')]=_[_0xf2c3('0x59')](db[_0xf2c3('0xca')][_0xf2c3('0x43')]);_0x195959['query']=_['keys'](_0x54b4da[_0xf2c3('0x4c')]);_0x195959['filters']=_['intersection'](_0x195959['model'],_0x195959[_0xf2c3('0x4c')]);_0x10c1ba['attributes']=_[_0xf2c3('0x49')](_0x195959['model'],qs['fields'](_0x54b4da[_0xf2c3('0x4c')][_0xf2c3('0x4b')]));_0x10c1ba[_0xf2c3('0x4a')]=_0x10c1ba[_0xf2c3('0x4a')][_0xf2c3('0x5a')]?_0x10c1ba[_0xf2c3('0x4a')]:_0x195959['model'];_0x10c1ba[_0xf2c3('0x4e')]=qs[_0xf2c3('0x4f')](_0x54b4da[_0xf2c3('0x4c')][_0xf2c3('0x4f')]);_0x10c1ba[_0xf2c3('0x51')]=qs[_0xf2c3('0x48')](_[_0xf2c3('0x50')](_0x54b4da[_0xf2c3('0x4c')],_0x195959[_0xf2c3('0x48')]));if(_0x54b4da[_0xf2c3('0x4c')][_0xf2c3('0x54')]){_0x10c1ba['where']=_['merge'](_0x10c1ba[_0xf2c3('0x51')],{'$or':_[_0xf2c3('0x52')](_0x10c1ba[_0xf2c3('0x4a')],function(_0x1b193d){var _0x103455={};_0x103455[_0x1b193d]={'$like':'%'+_0x54b4da['query'][_0xf2c3('0x54')]+'%'};return _0x103455;})});}_0x10c1ba=_['merge']({},_0x10c1ba,_0x54b4da[_0xf2c3('0xee')]);return _0x5880db['getAgents'](_0x10c1ba);}})[_0xf2c3('0x25')](function(_0x5a7288){if(_0x5a7288){_0x18d832=_0x5a7288[_0xf2c3('0x5a')];if(!_0x54b4da[_0xf2c3('0x4c')]['hasOwnProperty']('nolimit')){_0x10c1ba[_0xf2c3('0x35')]=qs['limit'](_0x54b4da[_0xf2c3('0x4c')][_0xf2c3('0x35')]);_0x10c1ba[_0xf2c3('0x34')]=qs['offset'](_0x54b4da[_0xf2c3('0x4c')][_0xf2c3('0x34')]);}return _0x5880db['getAgents'](_0x10c1ba);}})[_0xf2c3('0x25')](function(_0x524229){if(_0x524229){return _0x524229?{'count':_0x18d832,'rows':_0x524229}:null;}})[_0xf2c3('0x25')](respondWithResult(_0x13c70f,null))[_0xf2c3('0x2f')](handleError(_0x13c70f,null));}; \ No newline at end of file +var _0xf6de=['chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','lastName','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','push','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','addApplications','sequelize','destroy','ChatApplication','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','getFields','false','getOfflineMessages','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','status','end','json','count','offset','limit','apply','reject','save','update','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','include','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','findAll','removeAnswers','sitepic','file','addAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult'];(function(_0x2c8058,_0x32c22d){var _0x1779e2=function(_0x593a3d){while(--_0x593a3d){_0x2c8058['push'](_0x2c8058['shift']());}};_0x1779e2(++_0x32c22d);}(_0xf6de,0x1b4));var _0xef6d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xf6de[_0x1deb03];return _0x189fe7;};'use strict';var pdf=require(_0xef6d('0x0'));var emlformat=require(_0xef6d('0x1'));var rimraf=require(_0xef6d('0x2'));var zipdir=require(_0xef6d('0x3'));var jsonpatch=require(_0xef6d('0x4'));var rp=require(_0xef6d('0x5'));var moment=require(_0xef6d('0x6'));var BPromise=require(_0xef6d('0x7'));var Mustache=require(_0xef6d('0x8'));var util=require(_0xef6d('0x9'));var path=require(_0xef6d('0xa'));var sox=require(_0xef6d('0xb'));var csv=require('to-csv');var ejs=require(_0xef6d('0xc'));var fs=require('fs');var _=require(_0xef6d('0xd'));var squel=require(_0xef6d('0xe'));var crypto=require('crypto');var jsforce=require(_0xef6d('0xf'));var deskjs=require(_0xef6d('0x10'));var toCsv=require(_0xef6d('0x11'));var querystring=require(_0xef6d('0x12'));var Papa=require(_0xef6d('0x13'));var Redis=require(_0xef6d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xef6d('0x15'));var as=require(_0xef6d('0x16'));var hardwareService=require(_0xef6d('0x17'));var logger=require(_0xef6d('0x18'))(_0xef6d('0x19'));var utils=require(_0xef6d('0x1a'));var config=require(_0xef6d('0x1b'));var db=require(_0xef6d('0x1c'))['db'];config[_0xef6d('0x1d')]=_[_0xef6d('0x1e')](config[_0xef6d('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xef6d('0x1f'))(new Redis(config[_0xef6d('0x1d')]));require(_0xef6d('0x20'))[_0xef6d('0x21')](socket);var jayson=require(_0xef6d('0x22'));var client=jayson[_0xef6d('0x23')][_0xef6d('0x24')]({'port':0x232c});var client9002=jayson[_0xef6d('0x23')][_0xef6d('0x24')]({'port':0x232a});var client9003=jayson[_0xef6d('0x23')][_0xef6d('0x24')]({'port':0x232b});function checkPasswordPattern(_0x79e751,_0x35b25f,_0x52cc81){if(_0x52cc81){var _0x5b0d24=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b0d24[_0xef6d('0x25')](_0x35b25f)){return _0x79e751;}else{throw new db['Sequelize'][(_0xef6d('0x26'))](_0xef6d('0x27'));}}else{return _0x79e751;}}function respondWithRpcPromise(_0x5ce6f9,_0x44bda,_0x34f599,_0x33d6ed){return new BPromise(function(_0x430a74,_0x457a36){var _0x4d4830=_0x33d6ed||client;return _0x4d4830[_0xef6d('0x28')](_0x5ce6f9,_0x34f599)[_0xef6d('0x29')](function(_0x549b2a){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x44bda,_0xef6d('0x2a'));logger[_0xef6d('0x2b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x44bda,'request\x20sent',JSON[_0xef6d('0x2c')](_0x549b2a));if(_0x549b2a['error']){if(_0x549b2a[_0xef6d('0x2d')][_0xef6d('0x2e')]===0x1f4){logger[_0xef6d('0x2d')](_0xef6d('0x2f'),_0x44bda,_0x549b2a[_0xef6d('0x2d')][_0xef6d('0x30')]);return _0x457a36(_0x549b2a[_0xef6d('0x2d')][_0xef6d('0x30')]);}logger[_0xef6d('0x2d')]('ChatWebsite,\x20%s,\x20%s',_0x44bda,_0x549b2a['error'][_0xef6d('0x30')]);return _0x430a74(_0x549b2a[_0xef6d('0x2d')]['message']);}else{logger[_0xef6d('0x31')](_0xef6d('0x2f'),_0x44bda,'request\x20sent');_0x430a74(_0x549b2a[_0xef6d('0x32')]['message']);}})['catch'](function(_0x4afaca){logger[_0xef6d('0x2d')](_0xef6d('0x2f'),_0x44bda,_0x4afaca);_0x457a36(_0x4afaca);});});}function respondWithStatusCode(_0x52e830,_0x43395f){_0x43395f=_0x43395f||0xcc;return function(_0x2cb19d){if(_0x2cb19d){return _0x52e830['sendStatus'](_0x43395f);}return _0x52e830[_0xef6d('0x33')](_0x43395f)[_0xef6d('0x34')]();};}function respondWithResult(_0xfdbbe1,_0x2a69db){_0x2a69db=_0x2a69db||0xc8;return function(_0x296087){if(_0x296087){return _0xfdbbe1[_0xef6d('0x33')](_0x2a69db)[_0xef6d('0x35')](_0x296087);}};}function respondWithFilteredResult(_0x3620af,_0x578eee){return function(_0x523c9b){if(_0x523c9b){var _0x5d9655=_0x523c9b[_0xef6d('0x36')],_0x1f8f83=_0x578eee[_0xef6d('0x37')],_0x287148=_0x578eee['offset']+_0x578eee[_0xef6d('0x38')],_0x1cd1aa;if(_0x287148>=_0x5d9655){_0x287148=_0x5d9655;_0x1cd1aa=0xc8;}else{_0x1cd1aa=0xce;}_0x3620af[_0xef6d('0x33')](_0x1cd1aa);return _0x3620af['set']('Content-Range',_0x1f8f83+'-'+_0x287148+'/'+_0x5d9655)[_0xef6d('0x35')](_0x523c9b);}return null;};}function patchUpdates(_0x347490){return function(_0x181efb){try{jsonpatch[_0xef6d('0x39')](_0x181efb,_0x347490,!![]);}catch(_0x15b6a3){return BPromise[_0xef6d('0x3a')](_0x15b6a3);}return _0x181efb[_0xef6d('0x3b')]();};}function saveUpdates(_0x3c164a,_0x33c6f9){return function(_0x4192d6){if(_0x4192d6){return _0x4192d6[_0xef6d('0x3c')](_0x3c164a)['then'](function(_0x3a843b){return _0x3a843b;});}return null;};}function removeEntity(_0x388863,_0x5e97b1){return function(_0xb379df){if(_0xb379df){return _0xb379df['destroy']()[_0xef6d('0x29')](function(){var _0x22a659=_0xb379df[_0xef6d('0x3d')]({'plain':!![]});var _0x38e750=_0xef6d('0x3e');return db[_0xef6d('0x3f')]['destroy']({'where':{'type':_0x38e750,'resourceId':_0x22a659['id']}})[_0xef6d('0x29')](function(){return _0xb379df;});})[_0xef6d('0x29')](function(){_0x388863[_0xef6d('0x33')](0xcc)[_0xef6d('0x34')]();});}};}function handleEntityNotFound(_0x518e95,_0x486b1f){return function(_0x2508e3){if(!_0x2508e3){_0x518e95[_0xef6d('0x40')](0x194);}return _0x2508e3;};}function handleError(_0x3f1fc6,_0x181773){_0x181773=_0x181773||0x1f4;return function(_0x524025){logger[_0xef6d('0x2d')](_0x524025[_0xef6d('0x41')]);if(_0x524025['name']){delete _0x524025[_0xef6d('0x42')];}_0x3f1fc6[_0xef6d('0x33')](_0x181773)[_0xef6d('0x43')](_0x524025);};}exports['index']=function(_0xef62cd,_0x1d0eba){var _0x5e4483={'include':[{'model':db[_0xef6d('0x44')],'as':_0xef6d('0x45')}]},_0x24d41f={},_0x321187={'count':0x0,'rows':[]};var _0x224933=_[_0xef6d('0x46')](db[_0xef6d('0x47')][_0xef6d('0x48')],function(_0x5cf381){return{'name':_0x5cf381['fieldName'],'type':_0x5cf381[_0xef6d('0x49')]['key']};});_0x24d41f[_0xef6d('0x4a')]=_[_0xef6d('0x46')](_0x224933,_0xef6d('0x42'));_0x24d41f[_0xef6d('0x4b')]=_[_0xef6d('0x4c')](_0xef62cd[_0xef6d('0x4b')]);_0x24d41f['filters']=_['intersection'](_0x24d41f[_0xef6d('0x4a')],_0x24d41f[_0xef6d('0x4b')]);_0x5e4483[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x24d41f['model'],qs[_0xef6d('0x4f')](_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0x5e4483[_0xef6d('0x4d')]=_0x5e4483[_0xef6d('0x4d')]['length']?_0x5e4483[_0xef6d('0x4d')]:_0x24d41f[_0xef6d('0x4a')];if(!_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x50')](_0xef6d('0x51'))){_0x5e4483[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x38')]);_0x5e4483[_0xef6d('0x37')]=qs[_0xef6d('0x37')](_0xef62cd[_0xef6d('0x4b')]['offset']);}_0x5e4483[_0xef6d('0x52')]=qs[_0xef6d('0x53')](_0xef62cd['query'][_0xef6d('0x53')]);_0x5e4483['where']=qs[_0xef6d('0x54')](_[_0xef6d('0x55')](_0xef62cd[_0xef6d('0x4b')],_0x24d41f['filters']),_0x224933);if(_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x56')]){_0x5e4483[_0xef6d('0x57')]=_['merge'](_0x5e4483['where'],{'$or':_[_0xef6d('0x46')](_0x224933,function(_0x40c767){if(_0x40c767[_0xef6d('0x49')]!==_0xef6d('0x58')){var _0x515835={};_0x515835[_0x40c767[_0xef6d('0x42')]]={'$like':'%'+_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x56')]+'%'};return _0x515835;}})});}_0x5e4483=_[_0xef6d('0x59')]({},_0x5e4483,_0xef62cd[_0xef6d('0x5a')]);var _0x21c571={'where':_0x5e4483[_0xef6d('0x57')]};return db[_0xef6d('0x47')][_0xef6d('0x36')](_0x21c571)[_0xef6d('0x29')](function(_0x4d8446){_0x321187[_0xef6d('0x36')]=_0x4d8446;if(_0xef62cd[_0xef6d('0x4b')][_0xef6d('0x5b')]){_0x5e4483['include']=[{'all':!![]}];}return db[_0xef6d('0x47')]['findAll'](_0x5e4483);})[_0xef6d('0x29')](function(_0x1f72c2){_0x321187[_0xef6d('0x5c')]=_0x1f72c2;return _0x321187;})[_0xef6d('0x29')](respondWithFilteredResult(_0x1d0eba,_0x5e4483))[_0xef6d('0x5d')](handleError(_0x1d0eba,null));};exports[_0xef6d('0x5e')]=function(_0x19d1b6,_0x37ac31){var _0x2a90c8={'raw':![],'where':{'id':_0x19d1b6[_0xef6d('0x5f')]['id']},'include':[{'model':db[_0xef6d('0x44')],'as':_0xef6d('0x45')}]},_0x20a5f0={};_0x20a5f0[_0xef6d('0x4a')]=_[_0xef6d('0x4c')](db[_0xef6d('0x47')]['rawAttributes']);_0x20a5f0['query']=_['keys'](_0x19d1b6[_0xef6d('0x4b')]);_0x20a5f0[_0xef6d('0x54')]=_[_0xef6d('0x4e')](_0x20a5f0[_0xef6d('0x4a')],_0x20a5f0[_0xef6d('0x4b')]);_0x2a90c8[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x20a5f0[_0xef6d('0x4a')],qs[_0xef6d('0x4f')](_0x19d1b6[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0x2a90c8[_0xef6d('0x4d')]=_0x2a90c8[_0xef6d('0x4d')][_0xef6d('0x60')]?_0x2a90c8[_0xef6d('0x4d')]:_0x20a5f0[_0xef6d('0x4a')];if(_0x19d1b6['query'][_0xef6d('0x5b')]){_0x2a90c8['include']=[{'all':!![]}];}_0x2a90c8=_[_0xef6d('0x59')]({},_0x2a90c8,_0x19d1b6['options']);return db['ChatWebsite']['find'](_0x2a90c8)['then'](handleEntityNotFound(_0x37ac31,null))[_0xef6d('0x29')](respondWithResult(_0x37ac31,null))[_0xef6d('0x5d')](handleError(_0x37ac31,null));};exports['create']=function(_0x4c4157,_0x3b07d0){return db['ChatWebsite'][_0xef6d('0x61')](_0x4c4157[_0xef6d('0x62')],{})['then'](function(_0x24c8cd){var _0x53f3b8=_0x4c4157[_0xef6d('0x63')][_0xef6d('0x3d')]({'plain':!![]});if(!_0x53f3b8)throw new Error(_0xef6d('0x64'));if(_0x53f3b8[_0xef6d('0x65')]===_0xef6d('0x63')){var _0x315d76=_0x24c8cd[_0xef6d('0x3d')]({'plain':!![]});var _0x26cd62=_0xef6d('0x3e');return db['UserProfileSection'][_0xef6d('0x66')]({'where':{'name':_0x26cd62,'userProfileId':_0x53f3b8['userProfileId']},'raw':!![]})[_0xef6d('0x29')](function(_0x192663){if(_0x192663&&_0x192663[_0xef6d('0x67')]===0x0){return db['UserProfileResource'][_0xef6d('0x61')]({'name':_0x315d76[_0xef6d('0x42')],'resourceId':_0x315d76['id'],'type':_0x192663['name'],'sectionId':_0x192663['id']},{})[_0xef6d('0x29')](function(){return _0x24c8cd;});}else{return _0x24c8cd;}})[_0xef6d('0x5d')](function(_0x10a375){logger[_0xef6d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10a375);throw _0x10a375;});}return _0x24c8cd;})[_0xef6d('0x29')](respondWithResult(_0x3b07d0,0xc9))[_0xef6d('0x5d')](handleError(_0x3b07d0,null));};exports[_0xef6d('0x3c')]=function(_0x5dee7b,_0x48b53b){if(_0x5dee7b[_0xef6d('0x62')]['id']){delete _0x5dee7b['body']['id'];}return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x5dee7b[_0xef6d('0x5f')]['id']},'include':[{'model':db[_0xef6d('0x44')],'as':_0xef6d('0x45')}]})[_0xef6d('0x29')](handleEntityNotFound(_0x48b53b,null))[_0xef6d('0x29')](saveUpdates(_0x5dee7b[_0xef6d('0x62')],null))[_0xef6d('0x29')](respondWithResult(_0x48b53b,null))['catch'](handleError(_0x48b53b,null));};exports['destroy']=function(_0x521770,_0x434eec){return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x521770[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x434eec,null))[_0xef6d('0x29')](removeEntity(_0x434eec,null))[_0xef6d('0x5d')](handleError(_0x434eec,null));};exports['describe']=function(_0xc49e43,_0x170838){return db[_0xef6d('0x47')][_0xef6d('0x68')]()[_0xef6d('0x29')](respondWithResult(_0x170838,null))[_0xef6d('0x5d')](handleError(_0x170838,null));};exports[_0xef6d('0x69')]=function(_0x283113,_0x3d4f79,_0x1ae502){if(_0x283113[_0xef6d('0x62')]['id']){delete _0x283113['body']['id'];}return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x283113['params']['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x3d4f79,null))[_0xef6d('0x29')](function(_0x1a9d5f){if(_0x1a9d5f){_0x283113[_0xef6d('0x62')][_0xef6d('0x6a')]=_0x1a9d5f['id'];return db[_0xef6d('0x6b')]['create'](_0x283113[_0xef6d('0x62')]);}})[_0xef6d('0x29')](respondWithResult(_0x3d4f79,null))[_0xef6d('0x5d')](handleError(_0x3d4f79,null));};exports['getDispositions']=function(_0x254b1b,_0x8450c7,_0x5d3c2d){var _0x3cb749={'raw':![],'where':{}};var _0x5c0704={};var _0x230629={'count':0x0,'rows':[]};return db[_0xef6d('0x47')]['findOne']({'where':{'id':_0x254b1b[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x8450c7,null))['then'](function(_0x4069a4){if(_0x4069a4){_0x5c0704[_0xef6d('0x4a')]=_[_0xef6d('0x4c')](db[_0xef6d('0x6b')][_0xef6d('0x48')]);_0x5c0704[_0xef6d('0x4b')]=_[_0xef6d('0x4c')](_0x254b1b[_0xef6d('0x4b')]);_0x5c0704['filters']=_[_0xef6d('0x4e')](_0x5c0704[_0xef6d('0x4a')],_0x5c0704['query']);_0x3cb749[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x5c0704[_0xef6d('0x4a')],qs[_0xef6d('0x4f')](_0x254b1b[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0x3cb749[_0xef6d('0x4d')]=_0x3cb749[_0xef6d('0x4d')]['length']?_0x3cb749['attributes']:_0x5c0704['model'];if(!_0x254b1b[_0xef6d('0x4b')][_0xef6d('0x50')](_0xef6d('0x51'))){_0x3cb749[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x254b1b['query'][_0xef6d('0x38')]);_0x3cb749[_0xef6d('0x37')]=qs[_0xef6d('0x37')](_0x254b1b[_0xef6d('0x4b')][_0xef6d('0x37')]);}_0x3cb749[_0xef6d('0x52')]=qs['sort'](_0x254b1b['query'][_0xef6d('0x53')]);_0x3cb749[_0xef6d('0x57')]=qs[_0xef6d('0x54')](_[_0xef6d('0x55')](_0x254b1b[_0xef6d('0x4b')],_0x5c0704[_0xef6d('0x54')]));_0x3cb749['where'][_0xef6d('0x6a')]=_0x4069a4['id'];if(_0x254b1b['query']['filter']){_0x3cb749[_0xef6d('0x57')]=_[_0xef6d('0x59')](_0x3cb749['where'],{'$or':_[_0xef6d('0x46')](_0x3cb749[_0xef6d('0x4d')],function(_0x3f237a){var _0x324533={};_0x324533[_0x3f237a]={'$like':'%'+_0x254b1b[_0xef6d('0x4b')][_0xef6d('0x56')]+'%'};return _0x324533;})});}_0x3cb749=_[_0xef6d('0x59')]({},_0x3cb749,_0x254b1b[_0xef6d('0x5a')]);return db[_0xef6d('0x6b')][_0xef6d('0x36')]({'where':_0x3cb749['where']})[_0xef6d('0x29')](function(_0x4f80ab){_0x230629[_0xef6d('0x36')]=_0x4f80ab;if(_0x254b1b[_0xef6d('0x4b')][_0xef6d('0x5b')]){_0x3cb749[_0xef6d('0x6c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3cb749);})['then'](function(_0x33b7c2){_0x230629['rows']=_0x33b7c2;return _0x230629;});}})[_0xef6d('0x29')](respondWithFilteredResult(_0x8450c7,_0x3cb749))['catch'](handleError(_0x8450c7,null));};exports[_0xef6d('0x6d')]=function(_0x2970b2,_0x585f63,_0x294651){return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x2970b2[_0xef6d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x585f63,null))['then'](function(_0x587b54){if(_0x587b54){return _0x587b54[_0xef6d('0x6d')](_0x2970b2['query'][_0xef6d('0x6e')]);}})[_0xef6d('0x29')](respondWithStatusCode(_0x585f63,null))['catch'](handleError(_0x585f63,null));};exports[_0xef6d('0x6f')]=function(_0x248010,_0x5a5057,_0x1359ab){if(_0x248010[_0xef6d('0x62')]['id']){delete _0x248010['body']['id'];}return db[_0xef6d('0x47')]['find']({'where':{'id':_0x248010[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x5a5057,null))['then'](function(_0x2c060a){if(_0x2c060a){_0x248010[_0xef6d('0x62')][_0xef6d('0x6a')]=_0x2c060a['id'];return db['CannedAnswer'][_0xef6d('0x61')](_0x248010[_0xef6d('0x62')]);}})[_0xef6d('0x29')](respondWithResult(_0x5a5057,null))[_0xef6d('0x5d')](handleError(_0x5a5057,null));};exports[_0xef6d('0x70')]=function(_0x11e192,_0x578d0f,_0x37ca9a){var _0x2908f6={'raw':![],'where':{}};var _0x56d66f={};var _0x1c2e1b={'count':0x0,'rows':[]};return db[_0xef6d('0x47')][_0xef6d('0x71')]({'where':{'id':_0x11e192[_0xef6d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x578d0f,null))[_0xef6d('0x29')](function(_0x2ddf63){if(_0x2ddf63){_0x56d66f[_0xef6d('0x4a')]=_['keys'](db['CannedAnswer'][_0xef6d('0x48')]);_0x56d66f[_0xef6d('0x4b')]=_['keys'](_0x11e192[_0xef6d('0x4b')]);_0x56d66f[_0xef6d('0x54')]=_['intersection'](_0x56d66f[_0xef6d('0x4a')],_0x56d66f[_0xef6d('0x4b')]);_0x2908f6['attributes']=_[_0xef6d('0x4e')](_0x56d66f['model'],qs['fields'](_0x11e192[_0xef6d('0x4b')]['fields']));_0x2908f6[_0xef6d('0x4d')]=_0x2908f6[_0xef6d('0x4d')][_0xef6d('0x60')]?_0x2908f6['attributes']:_0x56d66f['model'];if(!_0x11e192[_0xef6d('0x4b')][_0xef6d('0x50')](_0xef6d('0x51'))){_0x2908f6[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x11e192[_0xef6d('0x4b')][_0xef6d('0x38')]);_0x2908f6[_0xef6d('0x37')]=qs['offset'](_0x11e192[_0xef6d('0x4b')][_0xef6d('0x37')]);}_0x2908f6[_0xef6d('0x52')]=qs[_0xef6d('0x53')](_0x11e192[_0xef6d('0x4b')][_0xef6d('0x53')]);_0x2908f6[_0xef6d('0x57')]=qs[_0xef6d('0x54')](_[_0xef6d('0x55')](_0x11e192[_0xef6d('0x4b')],_0x56d66f[_0xef6d('0x54')]));_0x2908f6[_0xef6d('0x57')][_0xef6d('0x6a')]=_0x2ddf63['id'];if(_0x11e192[_0xef6d('0x4b')]['filter']){_0x2908f6[_0xef6d('0x57')]=_[_0xef6d('0x59')](_0x2908f6[_0xef6d('0x57')],{'$or':_['map'](_0x2908f6[_0xef6d('0x4d')],function(_0x525593){var _0xa0381e={};_0xa0381e[_0x525593]={'$like':'%'+_0x11e192[_0xef6d('0x4b')]['filter']+'%'};return _0xa0381e;})});}_0x2908f6=_[_0xef6d('0x59')]({},_0x2908f6,_0x11e192['options']);return db[_0xef6d('0x72')][_0xef6d('0x36')]({'where':_0x2908f6[_0xef6d('0x57')]})[_0xef6d('0x29')](function(_0x476d55){_0x1c2e1b[_0xef6d('0x36')]=_0x476d55;if(_0x11e192[_0xef6d('0x4b')][_0xef6d('0x5b')]){_0x2908f6['include']=[{'all':!![]}];}return db[_0xef6d('0x72')][_0xef6d('0x73')](_0x2908f6);})[_0xef6d('0x29')](function(_0x6e0117){_0x1c2e1b[_0xef6d('0x5c')]=_0x6e0117;return _0x1c2e1b;});}})[_0xef6d('0x29')](respondWithFilteredResult(_0x578d0f,_0x2908f6))[_0xef6d('0x5d')](handleError(_0x578d0f,null));};exports['removeAnswers']=function(_0x5f0587,_0x11b30c,_0x51488d){return db[_0xef6d('0x47')]['find']({'where':{'id':_0x5f0587[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x11b30c,null))[_0xef6d('0x29')](function(_0x190ded){if(_0x190ded){return _0x190ded[_0xef6d('0x74')](_0x5f0587[_0xef6d('0x4b')][_0xef6d('0x6e')]);}})['then'](respondWithStatusCode(_0x11b30c,null))[_0xef6d('0x5d')](handleError(_0x11b30c,null));};exports['addLogo']=function(_0x518b71,_0x33a44b,_0x7b057d){_0x518b71['body'][_0xef6d('0x75')]=_0x518b71[_0xef6d('0x76')]['filename'];return db['ChatWebsite'][_0xef6d('0x66')]({'where':{'id':_0x518b71['params']['id']}})['then'](handleEntityNotFound(_0x33a44b,null))[_0xef6d('0x29')](saveUpdates(_0x518b71[_0xef6d('0x62')],null))['then'](respondWithResult(_0x33a44b,null))[_0xef6d('0x5d')](handleError(_0x33a44b,null));};exports[_0xef6d('0x77')]=function(_0x85cd14,_0x427b0c,_0x3aeca4){_0x85cd14[_0xef6d('0x62')]['agentAvatar']=_0x85cd14[_0xef6d('0x76')][_0xef6d('0x78')];return db['ChatWebsite']['find']({'where':{'id':_0x85cd14[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x427b0c,null))[_0xef6d('0x29')](saveUpdates(_0x85cd14[_0xef6d('0x62')],null))[_0xef6d('0x29')](respondWithResult(_0x427b0c,null))[_0xef6d('0x5d')](handleError(_0x427b0c,null));};exports[_0xef6d('0x79')]=function(_0x3bf1b3,_0x3cbe2f,_0x23adf5){_0x3bf1b3[_0xef6d('0x62')]['customerAvatar']=_0x3bf1b3[_0xef6d('0x76')][_0xef6d('0x78')];return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x3bf1b3[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x3cbe2f,null))[_0xef6d('0x29')](saveUpdates(_0x3bf1b3[_0xef6d('0x62')],null))['then'](respondWithResult(_0x3cbe2f,null))['catch'](handleError(_0x3cbe2f,null));};exports[_0xef6d('0x7a')]=function(_0x2e0d8b,_0xb62a6c,_0x4400f7){_0x2e0d8b[_0xef6d('0x62')][_0xef6d('0x7b')]=_0x2e0d8b[_0xef6d('0x76')][_0xef6d('0x78')];return db[_0xef6d('0x47')]['find']({'where':{'id':_0x2e0d8b[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0xb62a6c,null))[_0xef6d('0x29')](saveUpdates(_0x2e0d8b[_0xef6d('0x62')],null))[_0xef6d('0x29')](respondWithResult(_0xb62a6c,null))[_0xef6d('0x5d')](handleError(_0xb62a6c,null));};exports['getLogo']=function(_0x167ec0,_0xca75d4,_0x4aa535){var _0x50ea95=path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x7e'));var _0x2419fe={'where':{'id':_0x167ec0[_0xef6d('0x5f')]['id']},'attributes':['id',_0xef6d('0x75')],'raw':!![]};var _0x415bcf=![];return require(_0xef6d('0x7f'))[_0xef6d('0x80')]()[_0xef6d('0x29')](function(_0x5c5320){if(_0x5c5320){_0x415bcf=_0x5c5320[_0xef6d('0x81')];}})[_0xef6d('0x29')](function(){return db[_0xef6d('0x47')]['find'](_0x2419fe);})[_0xef6d('0x29')](handleEntityNotFound(_0xca75d4,null))[_0xef6d('0x29')](function(_0x1e84a2){if(_0x1e84a2){if(!_[_0xef6d('0x82')](_0x1e84a2[_0xef6d('0x75')])){if(fs['existsSync'](path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x83'),_0x1e84a2['sitepic']))&&_0x415bcf){_0x50ea95=path[_0xef6d('0x7c')](config['root'],_0xef6d('0x83'),_0x1e84a2[_0xef6d('0x75')]);}}return _0xca75d4[_0xef6d('0x84')](_0x50ea95);}})[_0xef6d('0x5d')](handleError(_0xca75d4,null));};exports[_0xef6d('0x85')]=function(_0x31189f,_0x5b4663,_0x656a6c){var _0x5583df=path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x86'));var _0x436fa0={'where':{'id':_0x31189f[_0xef6d('0x5f')]['id']},'attributes':['id',_0xef6d('0x87')],'raw':!![]};return db[_0xef6d('0x47')][_0xef6d('0x66')](_0x436fa0)[_0xef6d('0x29')](handleEntityNotFound(_0x5b4663,null))[_0xef6d('0x29')](function(_0x15f533){if(_0x15f533){if(!_[_0xef6d('0x82')](_0x15f533[_0xef6d('0x87')])){if(fs['existsSync'](path['join'](config[_0xef6d('0x7d')],_0xef6d('0x88'),_0x15f533['agentAvatar']))){_0x5583df=path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],'server/files/images/avatars/',_0x15f533['agentAvatar']);}}return _0x5b4663[_0xef6d('0x84')](_0x5583df);}})[_0xef6d('0x5d')](handleError(_0x5b4663,null));};exports[_0xef6d('0x89')]=function(_0x2af48e,_0x2d8a6e,_0x19a3c3){var _0x5aa494=path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x2c8983={'where':{'id':_0x2af48e[_0xef6d('0x5f')]['id']},'attributes':['id',_0xef6d('0x8a'),_0xef6d('0x8b')],'raw':!![]};return db['ChatWebsite']['find'](_0x2c8983)[_0xef6d('0x29')](handleEntityNotFound(_0x2d8a6e,null))['then'](function(_0xfaf613){if(_0xfaf613){if(!_[_0xef6d('0x82')](_0xfaf613['customerAvatar'])){if(fs[_0xef6d('0x8c')](path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x88'),_0xfaf613[_0xef6d('0x8a')]))&&_0xfaf613[_0xef6d('0x8b')]){_0x5aa494=path[_0xef6d('0x7c')](config['root'],_0xef6d('0x88'),_0xfaf613['customerAvatar']);}}return _0x2d8a6e[_0xef6d('0x84')](_0x5aa494);}})[_0xef6d('0x5d')](handleError(_0x2d8a6e,null));};exports[_0xef6d('0x8d')]=function(_0x586576,_0x722469,_0x44d0c1){var _0x333954=path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x8e'));var _0x245096={'where':{'id':_0x586576[_0xef6d('0x5f')]['id']},'attributes':['id',_0xef6d('0x7b')],'raw':!![]};return db[_0xef6d('0x47')][_0xef6d('0x66')](_0x245096)[_0xef6d('0x29')](handleEntityNotFound(_0x722469,null))[_0xef6d('0x29')](function(_0x317a73){if(_0x317a73){if(!_[_0xef6d('0x82')](_0x317a73[_0xef6d('0x7b')])){if(fs[_0xef6d('0x8c')](path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0x88'),_0x317a73[_0xef6d('0x7b')]))){_0x333954=path[_0xef6d('0x7c')](config['root'],_0xef6d('0x88'),_0x317a73[_0xef6d('0x7b')]);}}return _0x722469[_0xef6d('0x84')](_0x333954);}})[_0xef6d('0x5d')](handleError(_0x722469,null));};exports['notify']=function(_0x43dfd6,_0x451b9e,_0x68550f){var _0x2b1794=require(_0xef6d('0x8f'));var _0x501d8d=new _0x2b1794();var _0x5ccc75=_0x501d8d[_0xef6d('0x90')](_0x43dfd6[_0xef6d('0x91')][_0xef6d('0x92')])[_0xef6d('0x93')]();var _0x20a269={'body':_0x43dfd6['body'],'channel':_0xef6d('0x94')};var _0x590832=[];var _0x3a8bf5=[];var _0x2cf016={};var _0x29721c=![];return db[_0xef6d('0x95')][_0xef6d('0x68')]()[_0xef6d('0x29')](function(_0x365885){if(!_0x365885){throw new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))](_0xef6d('0x97'));}_0x590832=_[_0xef6d('0x98')](_['keys'](_0x365885),[_0xef6d('0x99'),_0xef6d('0x9a')]);_0x3a8bf5=_['difference'](_[_0xef6d('0x4c')](_0x365885),[_0xef6d('0x99'),'updatedAt',_0xef6d('0x9b'),_0xef6d('0x9c')]);if(_0x43dfd6['body']['id']){delete _0x43dfd6[_0xef6d('0x62')]['id'];}if(_[_0xef6d('0x82')](_0x43dfd6[_0xef6d('0x62')][_0xef6d('0x9d')])){throw new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))](_0xef6d('0x9e'));}if(_[_0xef6d('0x82')](_0x43dfd6[_0xef6d('0x62')]['body'])||_0x43dfd6['body'][_0xef6d('0x62')]===''){throw new db['Sequelize'][(_0xef6d('0x26'))](_0xef6d('0x9f'));}if(_[_0xef6d('0x82')](_0x43dfd6['body']['mapKey'])){throw new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))](_0xef6d('0xa0')+_0x3a8bf5);}if(!_[_0xef6d('0xa1')](_0x3a8bf5,_0x43dfd6['body'][_0xef6d('0xa2')])){throw new db['Sequelize']['ValidationError'](_0xef6d('0xa3')+_0x3a8bf5);}_0x2cf016[_0x43dfd6['body'][_0xef6d('0xa2')]]=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0x9d')];})[_0xef6d('0x29')](function(){return db['ChatWebsite'][_0xef6d('0x66')]({'where':{'id':_0x43dfd6[_0xef6d('0x5f')]['id']},'include':[{'model':db[_0xef6d('0xa4')],'as':'List','include':[{'model':db[_0xef6d('0x95')],'as':_0xef6d('0xa5'),'where':_0x2cf016,'limit':0x1,'order':[[_0xef6d('0x9a'),_0xef6d('0xa6')]]}]},{'model':db['ChatApplication'],'as':_0xef6d('0xa7')}]});})['then'](handleEntityNotFound(_0x451b9e,null))[_0xef6d('0x29')](function(_0x530d0e){if(_0x530d0e&&_0x530d0e[_0xef6d('0xa8')]){_0x20a269[_0xef6d('0xa9')]=_0x530d0e;_0x20a269[_0xef6d('0xaa')]=_0x530d0e['Applications'];_0x20a269[_0xef6d('0xab')]=_0x530d0e[_0xef6d('0xa8')];_0x20a269['applications']=_[_0xef6d('0xac')](_0x20a269[_0xef6d('0xaa')],[_0xef6d('0xad')],[_0xef6d('0xae')]);if(_0x20a269[_0xef6d('0xa9')]['Applications']){delete _0x20a269[_0xef6d('0xa9')][_0xef6d('0xa7')];}if(_0x20a269['account']['List']&&_0x20a269[_0xef6d('0xa9')][_0xef6d('0xa8')]['Contacts'][_0xef6d('0x60')]){return _0x20a269[_0xef6d('0xa9')][_0xef6d('0xa8')][_0xef6d('0xa5')][0x0];}var _0x26c172=_[_0xef6d('0x1e')](_0x43dfd6[_0xef6d('0x62')],{'firstName':_0x43dfd6['body'][_0xef6d('0x9d')],'ListId':_0x530d0e[_0xef6d('0x9c')]});_0x26c172[_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xa2')]]=_0x43dfd6[_0xef6d('0x62')]['from'];return db['CmContact'][_0xef6d('0x61')](_0x26c172,{'fields':_0x590832,'raw':!![]});}})[_0xef6d('0x29')](handleEntityNotFound(_0x451b9e,null))[_0xef6d('0x29')](function(_0x42c364){_0x20a269[_0xef6d('0xaf')]=_0x42c364;var _0x3474f1=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xb0')];if(_0x43dfd6[_0xef6d('0x91')]['cf-connecting-ip']){_0x3474f1=_0x43dfd6['headers'][_0xef6d('0xb1')];}else if(_0x43dfd6[_0xef6d('0x91')]['x-forwarded-for']){_0x3474f1=_[_0xef6d('0xb2')](_0x43dfd6[_0xef6d('0x91')][_0xef6d('0xb3')][_0xef6d('0xb4')](','));}if(_0x42c364){var _0x2ba56d={'ContactId':_0x42c364['id'],'ChatWebsiteId':_0x43dfd6[_0xef6d('0x5f')]['id'],'from':(_0x42c364[_0xef6d('0xb5')]||'')+'\x20'+(_0x42c364['lastName']||''),'customerIp':_0x3474f1,'customerPort':_0x43dfd6[_0xef6d('0x91')][_0xef6d('0xb6')]?_0x43dfd6[_0xef6d('0x91')][_0xef6d('0xb6')]:null,'referer':_0x43dfd6['body']['referer'],'browserName':_0x5ccc75[_0xef6d('0xb7')][_0xef6d('0x42')]&&_0x5ccc75[_0xef6d('0xb7')][_0xef6d('0xb8')]?util[_0xef6d('0xb9')]('%s\x20%s',_0x5ccc75[_0xef6d('0xb7')][_0xef6d('0x42')],_0x5ccc75[_0xef6d('0xb7')][_0xef6d('0xb8')]):_0xef6d('0xba'),'browserVersion':_0x5ccc75[_0xef6d('0xb7')][_0xef6d('0xb8')]||_0xef6d('0xba'),'osName':util[_0xef6d('0xb9')](_0xef6d('0xbb'),_0x5ccc75['os'][_0xef6d('0x42')],_0x5ccc75['os']['version']),'osVersion':_0x5ccc75['os'][_0xef6d('0xb8')],'deviceModel':_0x5ccc75[_0xef6d('0xbc')][_0xef6d('0x4a')]&&_0x5ccc75[_0xef6d('0xbc')][_0xef6d('0xbd')]?util['format'](_0xef6d('0xbe'),_0x5ccc75[_0xef6d('0xbc')][_0xef6d('0x4a')],_0x5ccc75['device']['vendor'],_0x5ccc75[_0xef6d('0xbc')]['type']):null,'deviceVendor':_0x5ccc75[_0xef6d('0xbc')]['vendor'],'deviceType':_0x5ccc75[_0xef6d('0xbc')][_0xef6d('0x49')],'formData':JSON[_0xef6d('0x2c')](_0x43dfd6['body'])};var _0x1755c0={'ChatWebsiteId':_0x43dfd6[_0xef6d('0x5f')]['id'],'closed':![]};if(_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xbf')]){_0x1755c0[_0xef6d('0xbf')]=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xbf')];return db['ChatInteraction'][_0xef6d('0x66')]({'where':_0x1755c0})[_0xef6d('0x29')](function(_0x2e2953){if(_0x2e2953){return[_0x2e2953,![]];}_0x2ba56d[_0xef6d('0xbf')]=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xbf')];_0x2ba56d[_0xef6d('0xc0')]=_0x43dfd6[_0xef6d('0x62')]['externalUrl'];return db['ChatInteraction'][_0xef6d('0x61')](_0x2ba56d)['then'](function(_0x43647c){return[_0x43647c,!![]];});});}_0x1755c0[_0xef6d('0xc1')]=_0x42c364['id'];if(_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xc2')]&&_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xc2')]['id']){_0x1755c0['id']=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xc2')]['id'];return db[_0xef6d('0xc3')][_0xef6d('0x66')]({'where':_0x1755c0})[_0xef6d('0x29')](function(_0x27f403){if(_0x27f403){return[_0x27f403,![]];}return db[_0xef6d('0xc3')][_0xef6d('0x61')](_0x2ba56d)['then'](function(_0x41ab9a){return[_0x41ab9a,!![]];});});}return db[_0xef6d('0xc3')][_0xef6d('0x61')](_0x2ba56d)[_0xef6d('0x29')](function(_0x43cfac){return[_0x43cfac,!![]];});}})[_0xef6d('0xc4')](function(_0x1a1e65,_0x195342){if(_0x1a1e65){_0x29721c=_0x195342;if(!_0x195342){var _0x2538cd={'from':(_0x20a269[_0xef6d('0xaf')][_0xef6d('0xb5')]||'')+'\x20'+(_0x20a269[_0xef6d('0xaf')][_0xef6d('0xc5')]||'')};if(_0x43dfd6['body'][_0xef6d('0xbf')]&&_0x43dfd6[_0xef6d('0x62')]['messageId']&&_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xbf')]!=_0x43dfd6['body']['messageId']){_0x2538cd['threadId']=_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xc6')];}return _0x1a1e65[_0xef6d('0x3c')](_0x2538cd);}else{return _0x1a1e65;}}})['then'](function(_0x22ca6f){_0x20a269[_0xef6d('0xc2')]=_0x22ca6f[_0xef6d('0x3d')]({'plain':!![]});_0x20a269['interaction'][_0xef6d('0xc7')]=_0x29721c;if(_0x20a269[_0xef6d('0xc2')]['created']){if(_0x20a269[_0xef6d('0xa9')]['autoclose']){_0x20a269[_0xef6d('0xaa')]['push']({'id':0x0,'priority':_0x20a269[_0xef6d('0xaa')]['length']+0x1,'app':_0xef6d('0xc8'),'appdata':_0xef6d('0xc9'),'interval':_0xef6d('0xca')});}}return db[_0xef6d('0xcb')]['create']({'body':_0x43dfd6[_0xef6d('0x62')][_0xef6d('0x62')],'ChatWebsiteId':_0x43dfd6['params']['id'],'ChatInteractionId':_0x22ca6f['id'],'direction':'in','ContactId':_0x20a269[_0xef6d('0xaf')]['id'],'AttachmentId':_0x43dfd6[_0xef6d('0x62')][_0xef6d('0xcc')]});})[_0xef6d('0x29')](function(_0x1831d4){_0x20a269[_0xef6d('0x30')]=_0x1831d4;if(_0x20a269[_0xef6d('0xc2')][_0xef6d('0xcd')]){return db['User'][_0xef6d('0x66')]({'attributes':['id',_0xef6d('0x42')],'where':{'id':_0x20a269[_0xef6d('0xc2')][_0xef6d('0xcd')]}})[_0xef6d('0x29')](function(_0x40b0f4){if(_0x40b0f4){_0x20a269[_0xef6d('0xaa')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40b0f4[_0xef6d('0x42')]+','+(_0x20a269[_0xef6d('0xa9')][_0xef6d('0xce')]||0xa),'interval':_0xef6d('0xca')});_0x20a269[_0xef6d('0xcf')]=!![];}return respondWithRpcPromise('Start',_0xef6d('0xd0'),_0x20a269);});}return respondWithRpcPromise('Start',_0xef6d('0xd0'),_0x20a269);})[_0xef6d('0x29')](function(_0x2e6ffd){respondWithRpcPromise(_0xef6d('0xd1'),'EventManager',{'event':'notify','message':_0x2e6ffd},client9002);return _0x2e6ffd;})['then'](respondWithResult(_0x451b9e,null))['catch'](handleError(_0x451b9e,null));};exports[_0xef6d('0xd2')]=function(_0x38f089,_0x275404,_0x1fb302){var _0x4c0dc4,_0x5ca656,_0x5c51d6;var _0x330d11=[];var _0x5cbe89=[];var _0x1273fb={};return db[_0xef6d('0x95')][_0xef6d('0x68')]()[_0xef6d('0x29')](function(_0x41312b){if(!_0x41312b){throw new db['Sequelize'][(_0xef6d('0x26'))]('no\x20available\x20attributes');}_0x5cbe89=_[_0xef6d('0x98')](_['keys'](_0x41312b),[_0xef6d('0x99'),_0xef6d('0x9a')]);_0x330d11=_[_0xef6d('0x98')](_[_0xef6d('0x4c')](_0x41312b),[_0xef6d('0x99'),_0xef6d('0x9a'),_0xef6d('0x9b'),'ListId']);if(_0x38f089[_0xef6d('0x62')]['id']){delete _0x38f089[_0xef6d('0x62')]['id'];}if(_[_0xef6d('0x82')](_0x38f089['body'][_0xef6d('0x9d')])){throw _0x275404['status'](0x1f4)[_0xef6d('0x43')](new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))](_0xef6d('0x9e')));}if(_[_0xef6d('0x82')](_0x38f089[_0xef6d('0x62')]['body'])||_0x38f089['body']['body']===''){throw _0x275404['status'](0x1f4)[_0xef6d('0x43')](new db[(_0xef6d('0x96'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xef6d('0x82')](_0x38f089[_0xef6d('0x62')][_0xef6d('0xd3')])){throw _0x275404[_0xef6d('0x33')](0x1f4)[_0xef6d('0x43')](new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x330d11));}if(!_[_0xef6d('0xa1')](_0x330d11,_0x38f089['body'][_0xef6d('0xd3')])){throw _0x275404[_0xef6d('0x33')](0x1f4)[_0xef6d('0x43')](new db[(_0xef6d('0x96'))][(_0xef6d('0x26'))](_0xef6d('0xd4')+_0x330d11));}_0x1273fb[_0x38f089[_0xef6d('0x62')][_0xef6d('0xd3')]]=_0x38f089['body'][_0xef6d('0x9d')];})[_0xef6d('0x29')](function(){return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x38f089['params']['id']},'include':[{'model':db['CmList'],'as':_0xef6d('0xa8')}]});})[_0xef6d('0x29')](handleEntityNotFound(_0x275404,null))[_0xef6d('0x29')](function(_0x3b5b22){if(_0x3b5b22&&_0x3b5b22[_0xef6d('0xa8')]){_0x5ca656=_0x3b5b22;var _0x4ce26d=_['defaults'](_0x38f089['body'],{'firstName':_0x38f089[_0xef6d('0x62')]['from'],'phone':_0x38f089[_0xef6d('0x62')][_0xef6d('0x9d')],'ListId':_0x3b5b22[_0xef6d('0x9c')]});_0x4ce26d[_0x38f089['body'][_0xef6d('0xd3')]]=_0x38f089[_0xef6d('0x62')][_0xef6d('0x9d')];return db[_0xef6d('0x95')][_0xef6d('0xd5')]({'where':_0x1273fb,'defaults':_0x4ce26d});}})[_0xef6d('0xc4')](function(_0x559a15){if(_0x559a15){_0x5c51d6=_0x559a15;var _0x5f41ec=fs[_0xef6d('0xd6')](path[_0xef6d('0x7c')](config[_0xef6d('0x7d')],_0xef6d('0xd7')),_0xef6d('0xd8'));var _0x2f1f56=ejs[_0xef6d('0xd9')](_0x5f41ec,{'body':_[_0xef6d('0xda')](_0x38f089[_0xef6d('0x62')][_0xef6d('0x62')]),'bodyTitle':_0x5ca656[_0xef6d('0xdb')]});return db[_0xef6d('0xdc')][_0xef6d('0x61')]({'body':_0x2f1f56,'ContactId':_0x559a15['id'],'ChatWebsiteId':_0x5ca656['id']});}})[_0xef6d('0x29')](function(_0x52daa8){if(_0x52daa8){_0x4c0dc4=_0x52daa8;return db['MailAccount'][_0xef6d('0x71')]({'where':{'service':!![]},'include':[{'model':db[_0xef6d('0xdd')],'as':_0xef6d('0xde'),'raw':!![]}]});}})[_0xef6d('0x29')](function(_0x32c96f){if(_0x32c96f&&_0x32c96f['Smtp']&&_0x5ca656[_0xef6d('0xdf')]){var _0x26d0f2={'tls':{'rejectUnauthorized':![]}};if(_0x32c96f[_0xef6d('0xde')]['service']){_0x26d0f2['service']=_0x32c96f[_0xef6d('0xde')]['service'];}else{_0x26d0f2['host']=_0x32c96f[_0xef6d('0xde')][_0xef6d('0xe0')];_0x26d0f2[_0xef6d('0xe1')]=_0x32c96f['Smtp'][_0xef6d('0xe1')];_0x26d0f2['secure']=_0x32c96f[_0xef6d('0xde')][_0xef6d('0xe2')];}if(_0x32c96f[_0xef6d('0xde')][_0xef6d('0xe3')]){_0x26d0f2[_0xef6d('0xe4')]={'user':_0x32c96f[_0xef6d('0xde')][_0xef6d('0x63')],'pass':_0x32c96f['Smtp'][_0xef6d('0xe5')]};}return respondWithRpcPromise(_0xef6d('0xe6'),_0xef6d('0xe7'),{'account':_0x26d0f2,'message':{'from':util[_0xef6d('0xb9')](_0xef6d('0xe8'),_0x32c96f[_0xef6d('0x42')],_0x32c96f[_0xef6d('0xe9')]||_0x32c96f['Smtp'][_0xef6d('0x63')]),'to':_0x5ca656[_0xef6d('0xdf')],'subject':_0x5ca656['offlineMessageSubject'],'text':_0x4c0dc4[_0xef6d('0x62')]}},client9003)[_0xef6d('0x29')](function(){return _0x4c0dc4;})[_0xef6d('0x5d')](function(_0x53bd46){console[_0xef6d('0x2d')](_0x53bd46);});}})[_0xef6d('0x29')](function(){if(_0x4c0dc4){return _0x4c0dc4;}})[_0xef6d('0x29')](respondWithResult(_0x275404,null))[_0xef6d('0x5d')](handleError(_0x275404,null));};exports[_0xef6d('0xea')]=function(_0x102cf4,_0x391477,_0x5cb301){return db[_0xef6d('0xc3')][_0xef6d('0x66')]({'where':{'id':_0x102cf4[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x391477,null))[_0xef6d('0x29')](function(_0x4e2480){if(_0x4e2480){return _0x4e2480['addInteraction'](_0x102cf4['body'][_0xef6d('0x6e')],_[_0xef6d('0xeb')](_0x102cf4[_0xef6d('0x62')],['ids','id'])||{});}})[_0xef6d('0x29')](respondWithResult(_0x391477,null))['catch'](handleError(_0x391477,null));};exports[_0xef6d('0xec')]=function(_0x34c672,_0x3b76e0,_0x4cf8c2){var _0x32e09d={'raw':![],'where':{}};var _0x48bea2={};var _0x1c83ca={'count':0x0,'rows':[]};return db[_0xef6d('0x47')][_0xef6d('0x71')]({'where':{'id':_0x34c672[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x3b76e0,null))[_0xef6d('0x29')](function(_0x529aa2){if(_0x529aa2){_0x48bea2[_0xef6d('0x4a')]=_[_0xef6d('0x4c')](db[_0xef6d('0xc3')][_0xef6d('0x48')]);_0x48bea2[_0xef6d('0x4b')]=_[_0xef6d('0x4c')](_0x34c672[_0xef6d('0x4b')]);_0x48bea2['filters']=_[_0xef6d('0x4e')](_0x48bea2[_0xef6d('0x4a')],_0x48bea2[_0xef6d('0x4b')]);_0x32e09d[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x48bea2['model'],qs[_0xef6d('0x4f')](_0x34c672['query'][_0xef6d('0x4f')]));_0x32e09d['attributes']=_0x32e09d['attributes']['length']?_0x32e09d[_0xef6d('0x4d')]:_0x48bea2[_0xef6d('0x4a')];if(!_0x34c672['query'][_0xef6d('0x50')](_0xef6d('0x51'))){_0x32e09d[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x34c672[_0xef6d('0x4b')][_0xef6d('0x38')]);_0x32e09d[_0xef6d('0x37')]=qs[_0xef6d('0x37')](_0x34c672['query'][_0xef6d('0x37')]);}_0x32e09d[_0xef6d('0x52')]=qs[_0xef6d('0x53')](_0x34c672[_0xef6d('0x4b')][_0xef6d('0x53')]);_0x32e09d['where']=qs[_0xef6d('0x54')](_[_0xef6d('0x55')](_0x34c672['query'],_0x48bea2[_0xef6d('0x54')]));_0x32e09d['where'][_0xef6d('0x6a')]=_0x529aa2['id'];if(_0x34c672[_0xef6d('0x4b')][_0xef6d('0x56')]){_0x32e09d['where']=_['merge'](_0x32e09d['where'],{'$or':_['map'](_0x32e09d[_0xef6d('0x4d')],function(_0x39fc98){var _0x24d910={};_0x24d910[_0x39fc98]={'$like':'%'+_0x34c672[_0xef6d('0x4b')][_0xef6d('0x56')]+'%'};return _0x24d910;})});}_0x32e09d=_['merge']({},_0x32e09d,_0x34c672[_0xef6d('0x5a')]);return db[_0xef6d('0xc3')][_0xef6d('0x36')]({'where':_0x32e09d[_0xef6d('0x57')]})[_0xef6d('0x29')](function(_0x588359){_0x1c83ca['count']=_0x588359;if(_0x34c672[_0xef6d('0x4b')][_0xef6d('0x5b')]){_0x32e09d['include']=[{'model':db[_0xef6d('0x95')],'as':_0xef6d('0xed'),'required':![]},{'model':db['User'],'as':_0xef6d('0xee'),'attributes':['name',_0xef6d('0xef'),_0xef6d('0xf0')],'required':![]},{'model':db['Tag'],'as':_0xef6d('0xf1'),'attributes':['id','name',_0xef6d('0xf2')],'where':_0x34c672[_0xef6d('0x4b')][_0xef6d('0xf3')]?{'id':_0x34c672[_0xef6d('0x4b')][_0xef6d('0xf3')]}:undefined,'required':_0x34c672[_0xef6d('0x4b')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xef6d('0x73')](_0x32e09d);})[_0xef6d('0x29')](function(_0x1e0532){_0x1c83ca['rows']=_0x1e0532;return _0x1c83ca;});}})['then'](respondWithFilteredResult(_0x3b76e0,_0x32e09d))['catch'](handleError(_0x3b76e0,null));};function iftimePromise(_0x4a47ba,_0x1e5776){return respondWithRpcPromise(_0xef6d('0xf4'),'getSnippet',{'command':_0x1e5776[_0xef6d('0xf5')]?util['format'](_0xef6d('0xf6'),_0x4a47ba[_0xef6d('0xf7')],_0x1e5776[_0xef6d('0xf5')]):util[_0xef6d('0xb9')](_0xef6d('0xf8'),_0x4a47ba['interval'])},client9002)[_0xef6d('0x29')](function(_0x4da9a8){var _0xd6a68e=_0x4da9a8&&_0x4da9a8[_0xef6d('0xf9')](_0xef6d('0xfa'))>=0x0?!![]:![];logger[_0xef6d('0x31')](_0xef6d('0xfb'),_0x1e5776['id'],_0x4a47ba['id'],_0x4a47ba[_0xef6d('0xf7')],_0xd6a68e?_0xef6d('0xfc'):'OFFLINE',_0x1e5776[_0xef6d('0xf5')]?_0x1e5776[_0xef6d('0xf5')]:_0xef6d('0xfd'));return _0xd6a68e;})['catch'](function(_0x13c6b3){logger['error'](_0xef6d('0xfb'),_0x1e5776['id'],_0x4a47ba['id'],_0x4a47ba[_0xef6d('0xf7')],util[_0xef6d('0xfe')](_0x13c6b3,{'showHidden':![],'depth':null}),_0x1e5776[_0xef6d('0xf5')]?_0x1e5776['timezone']:'No\x20timezone');return![];});}exports[_0xef6d('0xff')]=function(_0x294c82,_0xdf31e3,_0x42df88){var _0x4e1a73=0x0;var _0x2b5b4f=0x0;var _0x24a11f=![];var _0xe65e58;var _0x690020;return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x294c82[_0xef6d('0x5f')]['id']},'include':[{'model':db['Interval'],'as':_0xef6d('0x100'),'include':[{'model':db[_0xef6d('0x100')],'as':_0xef6d('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xef6d('0x29')](handleEntityNotFound(_0xdf31e3,null))[_0xef6d('0x29')](function(_0x171cf7){if(_0x171cf7){_0xe65e58=_0x171cf7;return _0x171cf7[_0xef6d('0x102')]({'raw':!![]});}})[_0xef6d('0x29')](function(_0x1e99c7){if(_0xe65e58){if(_0x1e99c7){_0x690020=_0x1e99c7;}}return require('../../config/license/util')['getLicense']();})[_0xef6d('0x29')](function(_0x2e26c7){if(_0x2e26c7){_0x2b5b4f=_0x2e26c7[_0xef6d('0x103')];_0x24a11f=_0x2e26c7['custom'];}})[_0xef6d('0x29')](function(){return db[_0xef6d('0xc3')][_0xef6d('0x36')]({'where':{'closed':![]}});})['then'](function(_0x523c64){_0x4e1a73=_0x523c64;if(_0x2b5b4f&&_0x523c64>_0x2b5b4f){return db[_0xef6d('0x104')][_0xef6d('0x71')]({'where':{'id':0x1}})[_0xef6d('0x29')](function(_0x9d815){if(_0x9d815){_0x9d815['increment'](_0xef6d('0x105'));}});}})[_0xef6d('0x29')](function(){if(_0xe65e58[_0xef6d('0x100')]&&_0xe65e58[_0xef6d('0x100')][_0xef6d('0x101')]){var _0x4bcc00=[];for(var _0x1512dc=0x0;_0x1512dc<_0xe65e58[_0xef6d('0x100')][_0xef6d('0x101')][_0xef6d('0x60')];_0x1512dc++){var _0x3ada8f=_0xe65e58[_0xef6d('0x100')][_0xef6d('0x101')][_0x1512dc][_0xef6d('0x3d')]({'plain':!![]});_0x4bcc00[_0xef6d('0x106')](iftimePromise(_0x3ada8f,_0xe65e58));}return BPromise['all'](_0x4bcc00)[_0xef6d('0x29')](function(_0xe4fe74){return _[_0xef6d('0x107')](_0xe4fe74);});}else{return!![];}})[_0xef6d('0x29')](function(_0x578979){var _0x116149=fs[_0xef6d('0xd6')](path[_0xef6d('0x7c')](config['root'],_0xef6d('0x108')),'utf8');var _0x57f96d={'remote':_0xe65e58[_0xef6d('0x109')],'query':querystring[_0xef6d('0x2c')](_[_0xef6d('0x59')](_0xe65e58[_0xef6d('0x3d')]({'plain':!![]}),{'customerIp':_0x294c82[_0xef6d('0x91')][_0xef6d('0xb3')]||_0x294c82[_0xef6d('0x91')][_0xef6d('0x10a')]||_0x294c82[_0xef6d('0x10b')][_0xef6d('0x10c')]||_0x294c82['ip'],'referer':_0x294c82[_0xef6d('0x91')][_0xef6d('0x10d')],'openedInteractions':_0x4e1a73,'maxInteractions':_0x2b5b4f,'virtual':_0x24a11f[_0xef6d('0x103')],'online':_0x578979,'custom':_0x24a11f}))[_0xef6d('0x10e')](/'/g,'\x5c\x27')};_0xdf31e3[_0xef6d('0x43')](ejs['render'](Mustache['render'](_0x116149,_0x57f96d),{'proactiveActions':_0x690020,'alignment':_0xe65e58[_0xef6d('0x10f')],'verticalAlignment':_0xe65e58[_0xef6d('0x110')],'div_color':_0xe65e58['color'],'text_color':_0xe65e58[_0xef6d('0x111')]}));})[_0xef6d('0x5d')](handleError(_0xdf31e3,null));};exports[_0xef6d('0x112')]=function(_0x2b37f7,_0x4b5e88,_0x583b2c){return db[_0xef6d('0x47')]['findOne']({'where':{'id':_0x2b37f7[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x4b5e88,null))[_0xef6d('0x29')](function(_0x425192){if(_0x425192){return db[_0xef6d('0x113')]['transaction'](function(_0x175293){return db['ChatApplication'][_0xef6d('0x114')]({'where':{'ChatWebsiteId':_0x2b37f7[_0xef6d('0x5f')]['id']},'transaction':_0x175293})['then'](function(_0xd9a7a6){var _0x45fe4c=_[_0xef6d('0x46')](_0x2b37f7[_0xef6d('0x62')],function(_0x150e45){_0x150e45['ChatWebsiteId']=_0x2b37f7[_0xef6d('0x5f')]['id'];return _0x150e45;});return db[_0xef6d('0x115')][_0xef6d('0x116')](_0x45fe4c,{'transaction':_0x175293});});})[_0xef6d('0x29')](function(){return db[_0xef6d('0x115')][_0xef6d('0x117')]({'where':{'ChatWebsiteId':_0x2b37f7[_0xef6d('0x5f')]['id']},'order':_0xef6d('0xad')});});}})[_0xef6d('0x29')](respondWithResult(_0x4b5e88,null))[_0xef6d('0x5d')](handleError(_0x4b5e88,null));};exports[_0xef6d('0x118')]=function(_0x453820,_0x5315c1,_0x23697e){var _0x2f4980={};var _0x25f591={};var _0x48403f;var _0x90e6d8;return db['ChatWebsite'][_0xef6d('0x71')]({'where':{'id':_0x453820[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x5315c1,null))[_0xef6d('0x29')](function(_0x52a423){if(_0x52a423){_0x48403f=_0x52a423;_0x25f591[_0xef6d('0x4a')]=_[_0xef6d('0x4c')](db[_0xef6d('0x115')][_0xef6d('0x48')]);_0x25f591[_0xef6d('0x4b')]=_['keys'](_0x453820[_0xef6d('0x4b')]);_0x25f591[_0xef6d('0x54')]=_[_0xef6d('0x4e')](_0x25f591['model'],_0x25f591[_0xef6d('0x4b')]);_0x2f4980['attributes']=_[_0xef6d('0x4e')](_0x25f591[_0xef6d('0x4a')],qs['fields'](_0x453820[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0x2f4980['attributes']=_0x2f4980[_0xef6d('0x4d')][_0xef6d('0x60')]?_0x2f4980['attributes']:_0x25f591[_0xef6d('0x4a')];_0x2f4980[_0xef6d('0x52')]=qs[_0xef6d('0x53')](_0x453820[_0xef6d('0x4b')][_0xef6d('0x53')]);_0x2f4980[_0xef6d('0x57')]=qs[_0xef6d('0x54')](_['pick'](_0x453820[_0xef6d('0x4b')],_0x25f591[_0xef6d('0x54')]));if(_0x453820[_0xef6d('0x4b')][_0xef6d('0x56')]){_0x2f4980[_0xef6d('0x57')]=_[_0xef6d('0x59')](_0x2f4980[_0xef6d('0x57')],{'$or':_['map'](_0x2f4980['attributes'],function(_0x1daf5a){var _0x544f9b={};_0x544f9b[_0x1daf5a]={'$like':'%'+_0x453820[_0xef6d('0x4b')][_0xef6d('0x56')]+'%'};return _0x544f9b;})});}_0x2f4980=_[_0xef6d('0x59')]({},_0x2f4980,_0x453820[_0xef6d('0x5a')]);return _0x48403f[_0xef6d('0x118')](_0x2f4980);}})['then'](function(_0x3f9c12){if(_0x3f9c12){_0x90e6d8=_0x3f9c12[_0xef6d('0x60')];if(!_0x453820[_0xef6d('0x4b')]['hasOwnProperty']('nolimit')){_0x2f4980[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x453820[_0xef6d('0x4b')][_0xef6d('0x38')]);_0x2f4980[_0xef6d('0x37')]=qs['offset'](_0x453820[_0xef6d('0x4b')][_0xef6d('0x37')]);}return _0x48403f[_0xef6d('0x118')](_0x2f4980);}})[_0xef6d('0x29')](function(_0x17b542){if(_0x17b542){return _0x17b542?{'count':_0x90e6d8,'rows':_0x17b542}:null;}})[_0xef6d('0x29')](respondWithResult(_0x5315c1,null))[_0xef6d('0x5d')](handleError(_0x5315c1,null));};exports['addProactiveActions']=function(_0x3239f3,_0x4685dc,_0x496528){return db[_0xef6d('0x119')][_0xef6d('0x66')]({'where':{'id':_0x3239f3[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x4685dc,null))['then'](function(_0x99e926){if(_0x99e926){return _0x99e926['addProactiveActions'](_0x3239f3[_0xef6d('0x62')][_0xef6d('0x6e')],_[_0xef6d('0xeb')](_0x3239f3[_0xef6d('0x62')],[_0xef6d('0x6e'),'id'])||{});}})[_0xef6d('0x29')](respondWithResult(_0x4685dc,null))['catch'](handleError(_0x4685dc,null));};exports[_0xef6d('0x102')]=function(_0x5ba453,_0x21c9bc,_0x2344ca){var _0xe16dae={};var _0x9c8553={};var _0x564421;var _0x45a789;return db[_0xef6d('0x47')][_0xef6d('0x71')]({'where':{'id':_0x5ba453[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x21c9bc,null))[_0xef6d('0x29')](function(_0x308d18){if(_0x308d18){_0x564421=_0x308d18;_0x9c8553[_0xef6d('0x4a')]=_[_0xef6d('0x4c')](db[_0xef6d('0x11a')][_0xef6d('0x48')]);_0x9c8553['query']=_['keys'](_0x5ba453[_0xef6d('0x4b')]);_0x9c8553[_0xef6d('0x54')]=_[_0xef6d('0x4e')](_0x9c8553[_0xef6d('0x4a')],_0x9c8553['query']);_0xe16dae[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x9c8553['model'],qs['fields'](_0x5ba453[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0xe16dae['attributes']=_0xe16dae[_0xef6d('0x4d')][_0xef6d('0x60')]?_0xe16dae[_0xef6d('0x4d')]:_0x9c8553[_0xef6d('0x4a')];_0xe16dae['order']=qs[_0xef6d('0x53')](_0x5ba453['query']['sort']);_0xe16dae[_0xef6d('0x57')]=qs['filters'](_[_0xef6d('0x55')](_0x5ba453[_0xef6d('0x4b')],_0x9c8553[_0xef6d('0x54')]));if(_0x5ba453[_0xef6d('0x4b')]['filter']){_0xe16dae['where']=_[_0xef6d('0x59')](_0xe16dae[_0xef6d('0x57')],{'$or':_[_0xef6d('0x46')](_0xe16dae['attributes'],function(_0xdefeed){var _0x410217={};_0x410217[_0xdefeed]={'$like':'%'+_0x5ba453[_0xef6d('0x4b')]['filter']+'%'};return _0x410217;})});}_0xe16dae=_['merge']({},_0xe16dae,_0x5ba453[_0xef6d('0x5a')]);return _0x564421[_0xef6d('0x102')](_0xe16dae);}})['then'](function(_0xbb603e){if(_0xbb603e){_0x45a789=_0xbb603e[_0xef6d('0x60')];if(!_0x5ba453[_0xef6d('0x4b')][_0xef6d('0x50')](_0xef6d('0x51'))){_0xe16dae[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x5ba453[_0xef6d('0x4b')]['limit']);_0xe16dae[_0xef6d('0x37')]=qs[_0xef6d('0x37')](_0x5ba453[_0xef6d('0x4b')]['offset']);}return _0x564421[_0xef6d('0x102')](_0xe16dae);}})[_0xef6d('0x29')](function(_0x5d67da){if(_0x5d67da){return _0x5d67da?{'count':_0x45a789,'rows':_0x5d67da}:null;}})[_0xef6d('0x29')](respondWithResult(_0x21c9bc,null))['catch'](handleError(_0x21c9bc,null));};exports[_0xef6d('0x11b')]=function(_0x2aebcf,_0x4f3dc5,_0x1f8194){var _0x35d975=_0x2aebcf[_0xef6d('0x4b')]['online']===_0xef6d('0x11c')?'offlineForm':'onlineForm';return db[_0xef6d('0x47')][_0xef6d('0x66')]({'attributes':['id',_0x35d975],'where':{'id':_0x2aebcf[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x4f3dc5,null))[_0xef6d('0x29')](function(_0x25e141){if(_0x25e141){var _0x52045d=_0x25e141[_0x35d975];var _0x4c8b55=_0x52045d&&_0x52045d['items']?_0x52045d['items']:[];_0x4f3dc5[_0xef6d('0x43')]({'fromKey':_[_0xef6d('0x82')](_0x52045d['fromKey'])?undefined:_0x52045d['fromKey'],'count':_0x4c8b55[_0xef6d('0x60')],'rows':_0x4c8b55});}})[_0xef6d('0x5d')](handleError(_0x4f3dc5,null));};exports[_0xef6d('0x11d')]=function(_0x4847f0,_0x248f73,_0x1a455f){var _0x594231={'raw':![],'where':{}};var _0x50f2e3={};var _0x32ed8e={'count':0x0,'rows':[]};return db[_0xef6d('0x47')][_0xef6d('0x71')]({'where':{'id':_0x4847f0[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x248f73,null))[_0xef6d('0x29')](function(_0x57d000){if(_0x57d000){_0x50f2e3['model']=_['keys'](db[_0xef6d('0xdc')]['rawAttributes']);_0x50f2e3[_0xef6d('0x4b')]=_['keys'](_0x4847f0[_0xef6d('0x4b')]);_0x50f2e3[_0xef6d('0x54')]=_[_0xef6d('0x4e')](_0x50f2e3[_0xef6d('0x4a')],_0x50f2e3[_0xef6d('0x4b')]);_0x594231[_0xef6d('0x4d')]=_[_0xef6d('0x4e')](_0x50f2e3[_0xef6d('0x4a')],qs['fields'](_0x4847f0[_0xef6d('0x4b')][_0xef6d('0x4f')]));_0x594231[_0xef6d('0x4d')]=_0x594231['attributes']['length']?_0x594231[_0xef6d('0x4d')]:_0x50f2e3[_0xef6d('0x4a')];if(!_0x4847f0[_0xef6d('0x4b')]['hasOwnProperty'](_0xef6d('0x51'))){_0x594231[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x4847f0[_0xef6d('0x4b')][_0xef6d('0x38')]);_0x594231['offset']=qs[_0xef6d('0x37')](_0x4847f0['query']['offset']);}_0x594231[_0xef6d('0x52')]=qs[_0xef6d('0x53')](_0x4847f0[_0xef6d('0x4b')][_0xef6d('0x53')]);_0x594231[_0xef6d('0x57')]=qs[_0xef6d('0x54')](_[_0xef6d('0x55')](_0x4847f0[_0xef6d('0x4b')],_0x50f2e3[_0xef6d('0x54')]));_0x594231[_0xef6d('0x57')][_0xef6d('0x6a')]=_0x57d000['id'];if(_0x4847f0[_0xef6d('0x4b')]['filter']){_0x594231[_0xef6d('0x57')]=_[_0xef6d('0x59')](_0x594231[_0xef6d('0x57')],{'$or':_[_0xef6d('0x46')](_0x594231['attributes'],function(_0x84c297){var _0xa84543={};_0xa84543[_0x84c297]={'$like':'%'+_0x4847f0['query'][_0xef6d('0x56')]+'%'};return _0xa84543;})});}_0x594231=_[_0xef6d('0x59')]({},_0x594231,_0x4847f0[_0xef6d('0x5a')]);return db[_0xef6d('0xdc')][_0xef6d('0x36')]({'where':_0x594231['where']})[_0xef6d('0x29')](function(_0x435ea4){_0x32ed8e[_0xef6d('0x36')]=_0x435ea4;if(_0x4847f0[_0xef6d('0x4b')][_0xef6d('0x5b')]){_0x594231['include']=[{'all':!![]}];}else{_0x594231[_0xef6d('0x6c')]=[{'model':db[_0xef6d('0x95')],'as':_0xef6d('0xed'),'required':![]}];}return db[_0xef6d('0xdc')][_0xef6d('0x73')](_0x594231);})[_0xef6d('0x29')](function(_0x4d0c93){_0x32ed8e[_0xef6d('0x5c')]=_0x4d0c93;return _0x32ed8e;});}})['then'](respondWithFilteredResult(_0x248f73,_0x594231))[_0xef6d('0x5d')](handleError(_0x248f73,null));};exports['addAgents']=function(_0x35e7e7,_0x33a98c,_0x41ecdc){return db[_0xef6d('0x47')]['find']({'where':{'id':_0x35e7e7['params']['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x33a98c,null))['then'](function(_0x4528fd){if(_0x4528fd){return _0x4528fd['addAgents'](_0x35e7e7[_0xef6d('0x62')]['ids'],_[_0xef6d('0xeb')](_0x35e7e7[_0xef6d('0x62')],[_0xef6d('0x6e'),'id'])||{})[_0xef6d('0xc4')](function(_0x3d316c){for(var _0x158a2c=0x0;_0x158a2c<_0x35e7e7[_0xef6d('0x62')][_0xef6d('0x6e')][_0xef6d('0x60')];_0x158a2c+=0x1){socket[_0xef6d('0x11e')](_0xef6d('0x11f'),{'UserId':_0x35e7e7['body']['ids'][_0x158a2c],'ChatWebsiteId':_0x35e7e7[_0xef6d('0x5f')]['id']});}return _0x3d316c;});}})[_0xef6d('0x29')](respondWithResult(_0x33a98c,null))['catch'](handleError(_0x33a98c,null));};exports[_0xef6d('0x120')]=function(_0x58465d,_0x5aa662,_0x3d1652){return db[_0xef6d('0x47')][_0xef6d('0x66')]({'where':{'id':_0x58465d[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x5aa662,null))['then'](function(_0xbd9351){if(_0xbd9351){return _0xbd9351[_0xef6d('0x120')](_0x58465d['query'][_0xef6d('0x6e')])[_0xef6d('0x29')](function(){if(_[_0xef6d('0x121')](_0x58465d[_0xef6d('0x4b')][_0xef6d('0x6e')])){for(var _0x3f09d9=0x0;_0x3f09d9<_0x58465d['query']['ids']['length'];_0x3f09d9+=0x1){socket['emit'](_0xef6d('0x122'),{'UserId':Number(_0x58465d[_0xef6d('0x4b')]['ids'][_0x3f09d9]),'ChatWebsiteId':Number(_0x58465d[_0xef6d('0x5f')]['id'])});}}else{socket[_0xef6d('0x11e')](_0xef6d('0x122'),{'UserId':Number(_0x58465d[_0xef6d('0x4b')][_0xef6d('0x6e')]),'ChatWebsiteId':Number(_0x58465d[_0xef6d('0x5f')]['id'])});}});}})[_0xef6d('0x29')](respondWithStatusCode(_0x5aa662,null))[_0xef6d('0x5d')](handleError(_0x5aa662,null));};exports[_0xef6d('0x123')]=function(_0x50cfe1,_0x1c00bf,_0x670382){var _0xf4baa6={};var _0x4b7c4e={};var _0x3ea177;var _0x2b8d4e;return db['ChatWebsite']['findOne']({'where':{'id':_0x50cfe1[_0xef6d('0x5f')]['id']}})[_0xef6d('0x29')](handleEntityNotFound(_0x1c00bf,null))['then'](function(_0x367a13){if(_0x367a13){_0x3ea177=_0x367a13;_0x4b7c4e[_0xef6d('0x4a')]=_['keys'](db['User']['rawAttributes']);_0x4b7c4e[_0xef6d('0x4b')]=_[_0xef6d('0x4c')](_0x50cfe1['query']);_0x4b7c4e[_0xef6d('0x54')]=_[_0xef6d('0x4e')](_0x4b7c4e[_0xef6d('0x4a')],_0x4b7c4e[_0xef6d('0x4b')]);_0xf4baa6['attributes']=_[_0xef6d('0x4e')](_0x4b7c4e[_0xef6d('0x4a')],qs[_0xef6d('0x4f')](_0x50cfe1[_0xef6d('0x4b')]['fields']));_0xf4baa6[_0xef6d('0x4d')]=_0xf4baa6['attributes'][_0xef6d('0x60')]?_0xf4baa6[_0xef6d('0x4d')]:_0x4b7c4e[_0xef6d('0x4a')];_0xf4baa6['order']=qs[_0xef6d('0x53')](_0x50cfe1['query'][_0xef6d('0x53')]);_0xf4baa6['where']=qs[_0xef6d('0x54')](_['pick'](_0x50cfe1[_0xef6d('0x4b')],_0x4b7c4e[_0xef6d('0x54')]));if(_0x50cfe1['query']['filter']){_0xf4baa6[_0xef6d('0x57')]=_[_0xef6d('0x59')](_0xf4baa6[_0xef6d('0x57')],{'$or':_[_0xef6d('0x46')](_0xf4baa6['attributes'],function(_0xd8deea){var _0x25dc17={};_0x25dc17[_0xd8deea]={'$like':'%'+_0x50cfe1[_0xef6d('0x4b')]['filter']+'%'};return _0x25dc17;})});}_0xf4baa6=_[_0xef6d('0x59')]({},_0xf4baa6,_0x50cfe1[_0xef6d('0x5a')]);return _0x3ea177['getAgents'](_0xf4baa6);}})[_0xef6d('0x29')](function(_0x234d10){if(_0x234d10){_0x2b8d4e=_0x234d10[_0xef6d('0x60')];if(!_0x50cfe1['query'][_0xef6d('0x50')]('nolimit')){_0xf4baa6[_0xef6d('0x38')]=qs[_0xef6d('0x38')](_0x50cfe1['query'][_0xef6d('0x38')]);_0xf4baa6['offset']=qs[_0xef6d('0x37')](_0x50cfe1[_0xef6d('0x4b')][_0xef6d('0x37')]);}return _0x3ea177[_0xef6d('0x123')](_0xf4baa6);}})['then'](function(_0x5c6f75){if(_0x5c6f75){return _0x5c6f75?{'count':_0x2b8d4e,'rows':_0x5c6f75}:null;}})[_0xef6d('0x29')](respondWithResult(_0x1c00bf,null))[_0xef6d('0x5d')](handleError(_0x1c00bf,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 73d4bf7..d4a4930 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 _0x15ab=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4718d0,_0x382e6f){var _0x5885cf=function(_0x1f097e){while(--_0x1f097e){_0x4718d0['push'](_0x4718d0['shift']());}};_0x5885cf(++_0x382e6f);}(_0x15ab,0xda));var _0xb15a=function(_0x356ce7,_0x207503){_0x356ce7=_0x356ce7-0x0;var _0x1c6386=_0x15ab[_0x356ce7];return _0x1c6386;};'use strict';var EventEmitter=require(_0xb15a('0x0'));var ChatWebsite=require(_0xb15a('0x1'))['db'][_0xb15a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb15a('0x3')](0x0);var events={'afterCreate':_0xb15a('0x4'),'afterUpdate':_0xb15a('0x5'),'afterDestroy':_0xb15a('0x6')};function emitEvent(_0x245475){return function(_0x3d3d97,_0x5bae8d,_0x1a3760){ChatWebsiteEvents[_0xb15a('0x7')](_0x245475+':'+_0x3d3d97['id'],_0x3d3d97);ChatWebsiteEvents['emit'](_0x245475,_0x3d3d97);_0x1a3760(null);};}for(var e in events){if(events[_0xb15a('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb15a('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xf14b=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x273417,_0x23d212){var _0x3fdfc1=function(_0x5a13f6){while(--_0x5a13f6){_0x273417['push'](_0x273417['shift']());}};_0x3fdfc1(++_0x23d212);}(_0xf14b,0xdd));var _0xbf14=function(_0x6c00b2,_0x2769d4){_0x6c00b2=_0x6c00b2-0x0;var _0x255585=_0xf14b[_0x6c00b2];return _0x255585;};'use strict';var EventEmitter=require(_0xbf14('0x0'));var ChatWebsite=require(_0xbf14('0x1'))['db'][_0xbf14('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbf14('0x3')](0x0);var events={'afterCreate':_0xbf14('0x4'),'afterUpdate':_0xbf14('0x5'),'afterDestroy':_0xbf14('0x6')};function emitEvent(_0x933794){return function(_0x1c9f49,_0x3afb15,_0x52d8f7){ChatWebsiteEvents[_0xbf14('0x7')](_0x933794+':'+_0x1c9f49['id'],_0x1c9f49);ChatWebsiteEvents[_0xbf14('0x7')](_0x933794,_0x1c9f49);_0x52d8f7(null);};}for(var e in events){if(events[_0xbf14('0x8')](e)){var event=events[e];ChatWebsite[_0xbf14('0x9')](e,emitEvent(event));}}module[_0xbf14('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4407704..33fa803 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 _0x0c02=['./chatWebsite.attributes','exports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe3f2a,_0x525bfe){var _0x53a069=function(_0x171cd0){while(--_0x171cd0){_0xe3f2a['push'](_0xe3f2a['shift']());}};_0x53a069(++_0x525bfe);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var logger=require(_0x20c0('0x1'))('api');var moment=require(_0x20c0('0x2'));var BPromise=require(_0x20c0('0x3'));var rp=require(_0x20c0('0x4'));var fs=require('fs');var path=require(_0x20c0('0x5'));var rimraf=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var attributes=require(_0x20c0('0x8'));module[_0x20c0('0x9')]=function(_0x13312d,_0xd25ee8){return _0x13312d['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x330c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x7611ce,_0x4a4441){var _0x67d3ab=function(_0x1456d8){while(--_0x1456d8){_0x7611ce['push'](_0x7611ce['shift']());}};_0x67d3ab(++_0x4a4441);}(_0x330c,0x186));var _0xc330=function(_0x3f3e39,_0x34f57a){_0x3f3e39=_0x3f3e39-0x0;var _0x1b62d1=_0x330c[_0x3f3e39];return _0x1b62d1;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var logger=require(_0xc330('0x2'))(_0xc330('0x3'));var moment=require('moment');var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module['exports']=function(_0x4f49fb,_0x53d0ca){return _0x4f49fb[_0xc330('0xa')](_0xc330('0xb'),attributes,{'tableName':_0xc330('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index a3f86bc..a58ae56 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 _0x4975=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4975,0x86));var _0x5497=function(_0x29d9ab,_0x41d036){_0x29d9ab=_0x29d9ab-0x0;var _0x273663=_0x4975[_0x29d9ab];return _0x273663;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});config['redis']=_[_0x5497('0xc')](config[_0x5497('0xd')],{'host':_0x5497('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5497('0xd')]));require('./chatWebsite.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x29c93f,_0x2ec5a4,_0x32a8a2){return new BPromise(function(_0x131627,_0x425288){return client[_0x5497('0x10')](_0x29c93f,_0x32a8a2)[_0x5497('0x11')](function(_0x50d716){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));logger[_0x5497('0x13')](_0x5497('0x14'),_0x2ec5a4,_0x5497('0x12'),JSON[_0x5497('0x15')](_0x50d716));if(_0x50d716[_0x5497('0x16')]){if(_0x50d716[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716['error'][_0x5497('0x19')]);return _0x425288(_0x50d716['error'][_0x5497('0x19')]);}logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);return _0x131627(_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));_0x131627(_0x50d716[_0x5497('0x1a')][_0x5497('0x19')]);}})['catch'](function(_0xbf1ba7){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0xbf1ba7);_0x425288(_0xbf1ba7);});});} \ No newline at end of file +var _0xc6ac=['http','defaults','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x53ca29,_0x348b49){_0x53ca29=_0x53ca29-0x0;var _0x163bce=_0xc6ac[_0x53ca29];return _0x163bce;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});config['redis']=_[_0xcc6a('0xe')](config[_0xcc6a('0xf')],{'host':_0xcc6a('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc6a('0xf')]));require(_0xcc6a('0x11'))[_0xcc6a('0x12')](socket);function respondWithRpcPromise(_0x463ebb,_0x3eb04a,_0x5e91a2){return new BPromise(function(_0x30a004,_0x290119){return client[_0xcc6a('0x13')](_0x463ebb,_0x5e91a2)['then'](function(_0x1d91a5){logger[_0xcc6a('0x14')](_0xcc6a('0x15'),_0x3eb04a,'request\x20sent');logger['debug'](_0xcc6a('0x16'),_0x3eb04a,_0xcc6a('0x17'),JSON[_0xcc6a('0x18')](_0x1d91a5));if(_0x1d91a5['error']){if(_0x1d91a5['error'][_0xcc6a('0x19')]===0x1f4){logger[_0xcc6a('0x1a')](_0xcc6a('0x15'),_0x3eb04a,_0x1d91a5[_0xcc6a('0x1a')][_0xcc6a('0x1b')]);return _0x290119(_0x1d91a5[_0xcc6a('0x1a')][_0xcc6a('0x1b')]);}logger[_0xcc6a('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x3eb04a,_0x1d91a5['error']['message']);return _0x30a004(_0x1d91a5[_0xcc6a('0x1a')][_0xcc6a('0x1b')]);}else{logger[_0xcc6a('0x14')](_0xcc6a('0x15'),_0x3eb04a,_0xcc6a('0x17'));_0x30a004(_0x1d91a5[_0xcc6a('0x1c')][_0xcc6a('0x1b')]);}})[_0xcc6a('0x1d')](function(_0x374e51){logger[_0xcc6a('0x1a')](_0xcc6a('0x15'),_0x3eb04a,_0x374e51);_0x290119(_0x374e51);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index c43cecb..f7e5173 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x507458,_0x1096bf){var _0x5f43ad=function(_0x36cfb1){while(--_0x36cfb1){_0x507458['push'](_0x507458['shift']());}};_0x5f43ad(++_0x1096bf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a65de,_0x245483){_0x3a65de=_0x3a65de-0x0;var _0x311a88=_0x5f2f[_0x3a65de];return _0x311a88;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x233d00,_0x41a7bb){var _0x4296f7=function(_0x255991){while(--_0x255991){_0x233d00['push'](_0x233d00['shift']());}};_0x4296f7(++_0x41a7bb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31cc6e,_0x4da430){_0x31cc6e=_0x31cc6e-0x0;var _0x39a234=_0x5f2f[_0x31cc6e];return _0x39a234;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a9cec86..8614f27 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 _0xe7fc=['getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','addLogo','diskStorage','server/files/images/avatars/','now','originalname','single','file','addAvatar','addCustomerAvatar','/:id/notify','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0x2226c1,_0x2bed75){var _0x178716=function(_0x54bb7e){while(--_0x54bb7e){_0x2226c1['push'](_0x2226c1['shift']());}};_0x178716(++_0x2bed75);}(_0xe7fc,0xb3));var _0xce7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe7fc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xce7f('0x0'));var util=require(_0xce7f('0x1'));var path=require(_0xce7f('0x2'));var timeout=require('connect-timeout');var express=require(_0xce7f('0x3'));var router=express['Router']();var auth=require(_0xce7f('0x4'));var interaction=require(_0xce7f('0x5'));var config=require(_0xce7f('0x6'));var controller=require(_0xce7f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xce7f('0x8')]);router[_0xce7f('0x9')]('/describe',auth[_0xce7f('0xa')](),controller['describe']);router[_0xce7f('0x9')](_0xce7f('0xb'),auth[_0xce7f('0xa')](),controller[_0xce7f('0xc')]);router[_0xce7f('0x9')](_0xce7f('0xd'),auth[_0xce7f('0xa')](),controller['getDispositions']);router[_0xce7f('0x9')](_0xce7f('0xe'),auth[_0xce7f('0xa')](),controller['getAnswers']);router[_0xce7f('0x9')](_0xce7f('0xf'),controller[_0xce7f('0x10')]);router[_0xce7f('0x9')](_0xce7f('0x11'),controller[_0xce7f('0x12')]);router['get'](_0xce7f('0x13'),controller[_0xce7f('0x14')]);router[_0xce7f('0x9')](_0xce7f('0x15'),controller['getSystemAvatar']);router[_0xce7f('0x9')]('/:id/interactions',auth[_0xce7f('0xa')](),controller[_0xce7f('0x16')]);router[_0xce7f('0x9')](_0xce7f('0x17'),controller[_0xce7f('0x18')]);router[_0xce7f('0x9')]('/:id/applications',auth[_0xce7f('0xa')](),controller[_0xce7f('0x19')]);router['get'](_0xce7f('0x1a'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x1b')]);router['get'](_0xce7f('0x1c'),controller[_0xce7f('0x1d')]);router[_0xce7f('0x9')](_0xce7f('0x1e'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x1f')]);router[_0xce7f('0x9')](_0xce7f('0x20'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x21')]);router[_0xce7f('0x22')]('/',auth[_0xce7f('0xa')](),controller[_0xce7f('0x23')]);router[_0xce7f('0x22')](_0xce7f('0xd'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x24')]);router[_0xce7f('0x22')](_0xce7f('0xe'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8f24f3,_0x526ed4,_0x3ea2b2){_0x3ea2b2(null,path[_0xce7f('0x26')](config[_0xce7f('0x27')],_0xce7f('0x28')));},'filename':function(_0x13789b,_0x276204,_0x54c6d5){_0x54c6d5(null,util[_0xce7f('0x29')](_0xce7f('0x2a'),Date['now'](),_0x276204['originalname']));}})});router[_0xce7f('0x22')](_0xce7f('0xf'),upload['single']('file'),controller[_0xce7f('0x2b')]);var upload=multer({'storage':multer[_0xce7f('0x2c')]({'destination':function(_0x9684ff,_0xe5fd43,_0x30ad1f){_0x30ad1f(null,path[_0xce7f('0x26')](config[_0xce7f('0x27')],_0xce7f('0x2d')));},'filename':function(_0x32b6aa,_0x353724,_0x5d1e80){_0x5d1e80(null,util[_0xce7f('0x29')](_0xce7f('0x2a'),Date[_0xce7f('0x2e')](),_0x353724[_0xce7f('0x2f')]));}})});router[_0xce7f('0x22')](_0xce7f('0x11'),upload[_0xce7f('0x30')](_0xce7f('0x31')),controller[_0xce7f('0x32')]);var upload=multer({'storage':multer[_0xce7f('0x2c')]({'destination':function(_0x4a34ed,_0x5ef751,_0x529aa4){_0x529aa4(null,path['join'](config[_0xce7f('0x27')],_0xce7f('0x2d')));},'filename':function(_0x38cba0,_0x4333ac,_0x1d3231){_0x1d3231(null,util[_0xce7f('0x29')]('%s-%s',Date[_0xce7f('0x2e')](),_0x4333ac[_0xce7f('0x2f')]));}})});router[_0xce7f('0x22')](_0xce7f('0x13'),upload[_0xce7f('0x30')]('file'),controller[_0xce7f('0x33')]);var upload=multer({'storage':multer[_0xce7f('0x2c')]({'destination':function(_0xa366fd,_0x910f87,_0x366fb7){_0x366fb7(null,path[_0xce7f('0x26')](config[_0xce7f('0x27')],'server/files/images/avatars/'));},'filename':function(_0x57b093,_0x43b5c4,_0x5cdd8a){_0x5cdd8a(null,util[_0xce7f('0x29')](_0xce7f('0x2a'),Date[_0xce7f('0x2e')](),_0x43b5c4['originalname']));}})});router['post'](_0xce7f('0x15'),upload[_0xce7f('0x30')](_0xce7f('0x31')),controller['addSystemAvatar']);router[_0xce7f('0x22')](_0xce7f('0x34'),controller['notify']);router[_0xce7f('0x22')](_0xce7f('0x35'),controller[_0xce7f('0x36')]);router['post'](_0xce7f('0x37'),auth['isAuthenticated'](),controller[_0xce7f('0x38')]);router[_0xce7f('0x22')]('/:id/applications',auth[_0xce7f('0xa')](),controller[_0xce7f('0x39')]);router[_0xce7f('0x22')](_0xce7f('0x1a'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x3a')]);router[_0xce7f('0x22')](_0xce7f('0x20'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x3b')]);router[_0xce7f('0x3c')](_0xce7f('0xb'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x3d')]);router['delete'](_0xce7f('0xb'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x3e')]);router[_0xce7f('0x3f')](_0xce7f('0xd'),auth[_0xce7f('0xa')](),controller[_0xce7f('0x40')]);router[_0xce7f('0x3f')]('/:id/canned_answers',auth[_0xce7f('0xa')](),controller[_0xce7f('0x41')]);router[_0xce7f('0x3f')](_0xce7f('0x20'),auth[_0xce7f('0xa')](),controller['removeAgents']);module[_0xce7f('0x42')]=router; \ No newline at end of file +var _0xb7cb=['getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','single','file','diskStorage','server/files/images/avatars/','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages'];(function(_0x1fb7e7,_0x154a74){var _0x1cea80=function(_0x5083e2){while(--_0x5083e2){_0x1fb7e7['push'](_0x1fb7e7['shift']());}};_0x1cea80(++_0x154a74);}(_0xb7cb,0x1d1));var _0xbb7c=function(_0x414810,_0x5e924d){_0x414810=_0x414810-0x0;var _0x2d4df5=_0xb7cb[_0x414810];return _0x2d4df5;};'use strict';var multer=require(_0xbb7c('0x0'));var util=require('util');var path=require(_0xbb7c('0x1'));var timeout=require('connect-timeout');var express=require(_0xbb7c('0x2'));var router=express[_0xbb7c('0x3')]();var auth=require(_0xbb7c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb7c('0x5'));var controller=require('./chatWebsite.controller');router[_0xbb7c('0x6')]('/',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x8')]);router['get'](_0xbb7c('0x9'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0xa')]);router['get'](_0xbb7c('0xb'),auth['isAuthenticated'](),controller[_0xbb7c('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbb7c('0xd')]);router['get']('/:id/canned_answers',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0xe')]);router[_0xbb7c('0x6')](_0xbb7c('0xf'),controller[_0xbb7c('0x10')]);router['get'](_0xbb7c('0x11'),controller[_0xbb7c('0x12')]);router[_0xbb7c('0x6')](_0xbb7c('0x13'),controller[_0xbb7c('0x14')]);router[_0xbb7c('0x6')](_0xbb7c('0x15'),controller[_0xbb7c('0x16')]);router[_0xbb7c('0x6')](_0xbb7c('0x17'),auth['isAuthenticated'](),controller[_0xbb7c('0x18')]);router[_0xbb7c('0x6')](_0xbb7c('0x19'),controller[_0xbb7c('0x1a')]);router['get']('/:id/applications',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x1b')]);router[_0xbb7c('0x6')]('/:id/proactive_actions',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x1c')]);router[_0xbb7c('0x6')](_0xbb7c('0x1d'),controller[_0xbb7c('0x1e')]);router['get'](_0xbb7c('0x1f'),auth['isAuthenticated'](),controller[_0xbb7c('0x20')]);router['get'](_0xbb7c('0x21'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x22')]);router[_0xbb7c('0x23')]('/',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x24')]);router['post'](_0xbb7c('0x25'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x26')]);router[_0xbb7c('0x23')]('/:id/canned_answers',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x431503,_0x11d055,_0x4eb156){_0x4eb156(null,path[_0xbb7c('0x28')](config[_0xbb7c('0x29')],_0xbb7c('0x2a')));},'filename':function(_0x3878ba,_0x403b1d,_0x3cdcb7){_0x3cdcb7(null,util[_0xbb7c('0x2b')](_0xbb7c('0x2c'),Date[_0xbb7c('0x2d')](),_0x403b1d['originalname']));}})});router[_0xbb7c('0x23')]('/:id/logo',upload[_0xbb7c('0x2e')](_0xbb7c('0x2f')),controller['addLogo']);var upload=multer({'storage':multer[_0xbb7c('0x30')]({'destination':function(_0x34c32a,_0x20bf93,_0x3eae9b){_0x3eae9b(null,path['join'](config[_0xbb7c('0x29')],_0xbb7c('0x31')));},'filename':function(_0x5b478b,_0x561df3,_0x440b3b){_0x440b3b(null,util['format'](_0xbb7c('0x2c'),Date[_0xbb7c('0x2d')](),_0x561df3[_0xbb7c('0x32')]));}})});router[_0xbb7c('0x23')](_0xbb7c('0x11'),upload[_0xbb7c('0x2e')]('file'),controller[_0xbb7c('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27d8da,_0x39cb44,_0xe3d614){_0xe3d614(null,path[_0xbb7c('0x28')](config[_0xbb7c('0x29')],_0xbb7c('0x31')));},'filename':function(_0x3da48c,_0x2455f2,_0x2b7c8b){_0x2b7c8b(null,util[_0xbb7c('0x2b')](_0xbb7c('0x2c'),Date[_0xbb7c('0x2d')](),_0x2455f2['originalname']));}})});router[_0xbb7c('0x23')](_0xbb7c('0x13'),upload['single'](_0xbb7c('0x2f')),controller[_0xbb7c('0x34')]);var upload=multer({'storage':multer[_0xbb7c('0x30')]({'destination':function(_0x3236aa,_0x57825c,_0x346d73){_0x346d73(null,path[_0xbb7c('0x28')](config[_0xbb7c('0x29')],_0xbb7c('0x31')));},'filename':function(_0xa68751,_0x439705,_0x381508){_0x381508(null,util[_0xbb7c('0x2b')](_0xbb7c('0x2c'),Date['now'](),_0x439705[_0xbb7c('0x32')]));}})});router[_0xbb7c('0x23')]('/:id/system_avatar',upload[_0xbb7c('0x2e')](_0xbb7c('0x2f')),controller[_0xbb7c('0x35')]);router[_0xbb7c('0x23')](_0xbb7c('0x36'),controller[_0xbb7c('0x37')]);router['post']('/:id/offline',controller[_0xbb7c('0x38')]);router['post'](_0xbb7c('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xbb7c('0x23')](_0xbb7c('0x39'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x3a')]);router[_0xbb7c('0x23')](_0xbb7c('0x3b'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x3c')]);router[_0xbb7c('0x23')](_0xbb7c('0x21'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x3d')]);router[_0xbb7c('0x3e')]('/:id',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x3f')]);router[_0xbb7c('0x40')]('/:id',auth['isAuthenticated'](),controller[_0xbb7c('0x41')]);router['delete']('/:id/dispositions',auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x42')]);router[_0xbb7c('0x40')](_0xbb7c('0x43'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x44')]);router[_0xbb7c('0x40')](_0xbb7c('0x21'),auth[_0xbb7c('0x7')](),controller[_0xbb7c('0x45')]);module[_0xbb7c('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c466821..9558567 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9432=['ENUM','AmazonAWS','STRING','sequelize','exports'];(function(_0x1cabce,_0x3cc4aa){var _0x487c9f=function(_0x43b2fd){while(--_0x43b2fd){_0x1cabce['push'](_0x1cabce['shift']());}};_0x487c9f(++_0x3cc4aa);}(_0x9432,0x1e3));var _0x2943=function(_0x1df442,_0x3aeb06){_0x1df442=_0x1df442-0x0;var _0x3aee92=_0x9432[_0x1df442];return _0x3aee92;};'use strict';var Sequelize=require(_0x2943('0x0'));module[_0x2943('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2943('0x2')](_0x2943('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2943('0x4')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd50=['Google','exports','STRING','ENUM','AmazonAWS'];(function(_0x51666b,_0x48e537){var _0x1858fa=function(_0x578ff0){while(--_0x578ff0){_0x51666b['push'](_0x51666b['shift']());}};_0x1858fa(++_0x48e537);}(_0xfd50,0x178));var _0x0fd5=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xfd50[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require('sequelize');module[_0x0fd5('0x0')]={'name':{'type':Sequelize[_0x0fd5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0fd5('0x2')](_0x0fd5('0x3'),_0x0fd5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0fd5('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c211e0c..e128ca7 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d89=['pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','catch','find','create','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','index','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where'];(function(_0x2d386f,_0x20bf59){var _0x39dd59=function(_0x37c1ce){while(--_0x37c1ce){_0x2d386f['push'](_0x2d386f['shift']());}};_0x39dd59(++_0x20bf59);}(_0x2d89,0x1d6));var _0x92d8=function(_0x48a792,_0x5726d0){_0x48a792=_0x48a792-0x0;var _0x5c8f72=_0x2d89[_0x48a792];return _0x5c8f72;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x92d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92d8('0x1'));var jsonpatch=require(_0x92d8('0x2'));var rp=require(_0x92d8('0x3'));var moment=require(_0x92d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x92d8('0x5'));var util=require(_0x92d8('0x6'));var path=require('path');var sox=require(_0x92d8('0x7'));var csv=require(_0x92d8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x92d8('0x9'));var jsforce=require(_0x92d8('0xa'));var deskjs=require(_0x92d8('0xb'));var toCsv=require(_0x92d8('0x8'));var querystring=require(_0x92d8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92d8('0xd'));var qs=require(_0x92d8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x92d8('0xf'));var utils=require(_0x92d8('0x10'));var config=require(_0x92d8('0x11'));var db=require(_0x92d8('0x12'))['db'];function respondWithStatusCode(_0x3ffc47,_0x5a787c){_0x5a787c=_0x5a787c||0xcc;return function(_0x24ae70){if(_0x24ae70){return _0x3ffc47[_0x92d8('0x13')](_0x5a787c);}return _0x3ffc47['status'](_0x5a787c)[_0x92d8('0x14')]();};}function respondWithResult(_0x5e28d9,_0x13da04){_0x13da04=_0x13da04||0xc8;return function(_0x1fb484){if(_0x1fb484){return _0x5e28d9[_0x92d8('0x15')](_0x13da04)[_0x92d8('0x16')](_0x1fb484);}};}function respondWithFilteredResult(_0xa140a0,_0x554b53){return function(_0xe3746d){if(_0xe3746d){var _0x256b98=_0xe3746d[_0x92d8('0x17')],_0x3b862e=_0x554b53[_0x92d8('0x18')],_0x1fbe3a=_0x554b53[_0x92d8('0x18')]+_0x554b53[_0x92d8('0x19')],_0x3523d9;if(_0x1fbe3a>=_0x256b98){_0x1fbe3a=_0x256b98;_0x3523d9=0xc8;}else{_0x3523d9=0xce;}_0xa140a0[_0x92d8('0x15')](_0x3523d9);return _0xa140a0[_0x92d8('0x1a')]('Content-Range',_0x3b862e+'-'+_0x1fbe3a+'/'+_0x256b98)[_0x92d8('0x16')](_0xe3746d);}return null;};}function patchUpdates(_0x4cafcc){return function(_0x2a588d){try{jsonpatch[_0x92d8('0x1b')](_0x2a588d,_0x4cafcc,!![]);}catch(_0x1de987){return BPromise[_0x92d8('0x1c')](_0x1de987);}return _0x2a588d[_0x92d8('0x1d')]();};}function saveUpdates(_0x4ee379,_0x27638a){return function(_0x1efde9){if(_0x1efde9){return _0x1efde9['update'](_0x4ee379)[_0x92d8('0x1e')](function(_0x3d23d8){return _0x3d23d8;});}return null;};}function removeEntity(_0x4446d7,_0xb5f5fa){return function(_0xc007da){if(_0xc007da){return _0xc007da['destroy']()[_0x92d8('0x1e')](function(){_0x4446d7['status'](0xcc)[_0x92d8('0x14')]();});}};}function handleEntityNotFound(_0x493e6b,_0x44c797){return function(_0x5929c7){if(!_0x5929c7){_0x493e6b[_0x92d8('0x13')](0x194);}return _0x5929c7;};}function handleError(_0x22a6f5,_0x543a2f){_0x543a2f=_0x543a2f||0x1f4;return function(_0x2c5e7a){logger['error'](_0x2c5e7a[_0x92d8('0x1f')]);if(_0x2c5e7a['name']){delete _0x2c5e7a[_0x92d8('0x20')];}_0x22a6f5[_0x92d8('0x15')](_0x543a2f)[_0x92d8('0x21')](_0x2c5e7a);};}exports[_0x92d8('0x22')]=function(_0x566c23,_0x52e11c){var _0x71fdcf={},_0x1ae663={},_0x5d4dbe={'count':0x0,'rows':[]};var _0x263a2f=_['map'](db['CloudProvider'][_0x92d8('0x23')],function(_0x210cc0){return{'name':_0x210cc0[_0x92d8('0x24')],'type':_0x210cc0[_0x92d8('0x25')]['key']};});_0x1ae663['model']=_['map'](_0x263a2f,'name');_0x1ae663['query']=_[_0x92d8('0x26')](_0x566c23[_0x92d8('0x27')]);_0x1ae663[_0x92d8('0x28')]=_[_0x92d8('0x29')](_0x1ae663['model'],_0x1ae663['query']);_0x71fdcf[_0x92d8('0x2a')]=_['intersection'](_0x1ae663[_0x92d8('0x2b')],qs[_0x92d8('0x2c')](_0x566c23['query'][_0x92d8('0x2c')]));_0x71fdcf['attributes']=_0x71fdcf[_0x92d8('0x2a')][_0x92d8('0x2d')]?_0x71fdcf['attributes']:_0x1ae663['model'];if(!_0x566c23['query'][_0x92d8('0x2e')]('nolimit')){_0x71fdcf[_0x92d8('0x19')]=qs[_0x92d8('0x19')](_0x566c23[_0x92d8('0x27')]['limit']);_0x71fdcf['offset']=qs[_0x92d8('0x18')](_0x566c23['query'][_0x92d8('0x18')]);}_0x71fdcf[_0x92d8('0x2f')]=qs[_0x92d8('0x30')](_0x566c23[_0x92d8('0x27')][_0x92d8('0x30')]);_0x71fdcf[_0x92d8('0x31')]=qs[_0x92d8('0x28')](_[_0x92d8('0x32')](_0x566c23['query'],_0x1ae663[_0x92d8('0x28')]),_0x263a2f);if(_0x566c23[_0x92d8('0x27')][_0x92d8('0x33')]){_0x71fdcf['where']=_[_0x92d8('0x34')](_0x71fdcf['where'],{'$or':_['map'](_0x263a2f,function(_0xe683bd){if(_0xe683bd['type']!==_0x92d8('0x35')){var _0x5d0a10={};_0x5d0a10[_0xe683bd[_0x92d8('0x20')]]={'$like':'%'+_0x566c23[_0x92d8('0x27')][_0x92d8('0x33')]+'%'};return _0x5d0a10;}})});}_0x71fdcf=_[_0x92d8('0x34')]({},_0x71fdcf,_0x566c23[_0x92d8('0x36')]);var _0x333749={'where':_0x71fdcf[_0x92d8('0x31')]};return db[_0x92d8('0x37')][_0x92d8('0x17')](_0x333749)[_0x92d8('0x1e')](function(_0x2a8214){_0x5d4dbe[_0x92d8('0x17')]=_0x2a8214;if(_0x566c23[_0x92d8('0x27')][_0x92d8('0x38')]){_0x71fdcf[_0x92d8('0x39')]=[{'all':!![]}];}return db[_0x92d8('0x37')][_0x92d8('0x3a')](_0x71fdcf);})[_0x92d8('0x1e')](function(_0x4d9b1a){_0x5d4dbe['rows']=_0x4d9b1a;return _0x5d4dbe;})[_0x92d8('0x1e')](respondWithFilteredResult(_0x52e11c,_0x71fdcf))[_0x92d8('0x3b')](handleError(_0x52e11c,null));};exports['show']=function(_0x26cd80,_0x3d39ed){var _0x41f1f4={'raw':!![],'where':{'id':_0x26cd80['params']['id']}},_0x40eba7={};_0x40eba7['model']=_[_0x92d8('0x26')](db['CloudProvider'][_0x92d8('0x23')]);_0x40eba7['query']=_[_0x92d8('0x26')](_0x26cd80[_0x92d8('0x27')]);_0x40eba7[_0x92d8('0x28')]=_[_0x92d8('0x29')](_0x40eba7['model'],_0x40eba7[_0x92d8('0x27')]);_0x41f1f4[_0x92d8('0x2a')]=_['intersection'](_0x40eba7[_0x92d8('0x2b')],qs['fields'](_0x26cd80[_0x92d8('0x27')][_0x92d8('0x2c')]));_0x41f1f4[_0x92d8('0x2a')]=_0x41f1f4[_0x92d8('0x2a')][_0x92d8('0x2d')]?_0x41f1f4[_0x92d8('0x2a')]:_0x40eba7['model'];if(_0x26cd80[_0x92d8('0x27')][_0x92d8('0x38')]){_0x41f1f4[_0x92d8('0x39')]=[{'all':!![]}];}_0x41f1f4=_[_0x92d8('0x34')]({},_0x41f1f4,_0x26cd80[_0x92d8('0x36')]);return db[_0x92d8('0x37')][_0x92d8('0x3c')](_0x41f1f4)[_0x92d8('0x1e')](handleEntityNotFound(_0x3d39ed,null))[_0x92d8('0x1e')](respondWithResult(_0x3d39ed,null))[_0x92d8('0x3b')](handleError(_0x3d39ed,null));};exports[_0x92d8('0x3d')]=function(_0x1465ee,_0x168eec){return db['CloudProvider'][_0x92d8('0x3d')](_0x1465ee['body'],{})['then'](respondWithResult(_0x168eec,0xc9))['catch'](handleError(_0x168eec,null));};exports[_0x92d8('0x3e')]=function(_0xa4cf46,_0x1cf086){if(_0xa4cf46['body']['id']){delete _0xa4cf46[_0x92d8('0x3f')]['id'];}return db['CloudProvider'][_0x92d8('0x3c')]({'where':{'id':_0xa4cf46['params']['id']}})[_0x92d8('0x1e')](handleEntityNotFound(_0x1cf086,null))['then'](saveUpdates(_0xa4cf46['body'],null))[_0x92d8('0x1e')](respondWithResult(_0x1cf086,null))[_0x92d8('0x3b')](handleError(_0x1cf086,null));};exports['destroy']=function(_0x2ed4c4,_0xcf48f5){return db[_0x92d8('0x37')][_0x92d8('0x3c')]({'where':{'id':_0x2ed4c4[_0x92d8('0x40')]['id']}})[_0x92d8('0x1e')](handleEntityNotFound(_0xcf48f5,null))[_0x92d8('0x1e')](removeEntity(_0xcf48f5,null))[_0x92d8('0x3b')](handleError(_0xcf48f5,null));}; \ No newline at end of file +var _0x3a8a=['CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','offset','sort','pick','filter','where','merge','options','include','rows','show','params','includeAll','find','catch','create','body','destroy','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x33fcc3,_0x34fef5){var _0x458f97=function(_0x235de6){while(--_0x235de6){_0x33fcc3['push'](_0x33fcc3['shift']());}};_0x458f97(++_0x34fef5);}(_0x3a8a,0x1bc));var _0xa3a8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3a8a[_0x126558];return _0x1f6d14;};'use strict';var pdf=require(_0xa3a8('0x0'));var emlformat=require(_0xa3a8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa3a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa3a8('0x3'));var BPromise=require(_0xa3a8('0x4'));var Mustache=require(_0xa3a8('0x5'));var util=require(_0xa3a8('0x6'));var path=require(_0xa3a8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa3a8('0x8'));var fs=require('fs');var _=require(_0xa3a8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa3a8('0xa'));var deskjs=require(_0xa3a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa3a8('0xc'));var Papa=require('papaparse');var Redis=require(_0xa3a8('0xd'));var authService=require(_0xa3a8('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3a8('0xf'));var logger=require('../../config/logger')(_0xa3a8('0x10'));var utils=require(_0xa3a8('0x11'));var config=require(_0xa3a8('0x12'));var db=require(_0xa3a8('0x13'))['db'];function respondWithStatusCode(_0x2f5151,_0x142594){_0x142594=_0x142594||0xcc;return function(_0x6b9b3c){if(_0x6b9b3c){return _0x2f5151[_0xa3a8('0x14')](_0x142594);}return _0x2f5151[_0xa3a8('0x15')](_0x142594)[_0xa3a8('0x16')]();};}function respondWithResult(_0x5e8257,_0x3f0a9c){_0x3f0a9c=_0x3f0a9c||0xc8;return function(_0x7a6d95){if(_0x7a6d95){return _0x5e8257[_0xa3a8('0x15')](_0x3f0a9c)[_0xa3a8('0x17')](_0x7a6d95);}};}function respondWithFilteredResult(_0x4130e1,_0x4bfbd1){return function(_0x1e6521){if(_0x1e6521){var _0x4db7e2=_0x1e6521[_0xa3a8('0x18')],_0x4395d8=_0x4bfbd1['offset'],_0x2aab0c=_0x4bfbd1['offset']+_0x4bfbd1[_0xa3a8('0x19')],_0x2cea21;if(_0x2aab0c>=_0x4db7e2){_0x2aab0c=_0x4db7e2;_0x2cea21=0xc8;}else{_0x2cea21=0xce;}_0x4130e1['status'](_0x2cea21);return _0x4130e1[_0xa3a8('0x1a')](_0xa3a8('0x1b'),_0x4395d8+'-'+_0x2aab0c+'/'+_0x4db7e2)['json'](_0x1e6521);}return null;};}function patchUpdates(_0x55735b){return function(_0x43603b){try{jsonpatch[_0xa3a8('0x1c')](_0x43603b,_0x55735b,!![]);}catch(_0x26df1d){return BPromise[_0xa3a8('0x1d')](_0x26df1d);}return _0x43603b[_0xa3a8('0x1e')]();};}function saveUpdates(_0x31c9f7,_0x3ad392){return function(_0x5744a0){if(_0x5744a0){return _0x5744a0[_0xa3a8('0x1f')](_0x31c9f7)[_0xa3a8('0x20')](function(_0x29a0a4){return _0x29a0a4;});}return null;};}function removeEntity(_0x3dcaf9,_0x1080f0){return function(_0x244e02){if(_0x244e02){return _0x244e02['destroy']()['then'](function(){_0x3dcaf9[_0xa3a8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36b661,_0x8b49f9){return function(_0x629342){if(!_0x629342){_0x36b661[_0xa3a8('0x14')](0x194);}return _0x629342;};}function handleError(_0x2e95ad,_0x1bb1e0){_0x1bb1e0=_0x1bb1e0||0x1f4;return function(_0x2ea3d4){logger[_0xa3a8('0x21')](_0x2ea3d4[_0xa3a8('0x22')]);if(_0x2ea3d4[_0xa3a8('0x23')]){delete _0x2ea3d4[_0xa3a8('0x23')];}_0x2e95ad['status'](_0x1bb1e0)[_0xa3a8('0x24')](_0x2ea3d4);};}exports[_0xa3a8('0x25')]=function(_0x4d1127,_0x232f44){var _0x5e49e9={},_0x5cf71d={},_0x2fdd4c={'count':0x0,'rows':[]};var _0x471e85=_[_0xa3a8('0x26')](db[_0xa3a8('0x27')][_0xa3a8('0x28')],function(_0xfab802){return{'name':_0xfab802[_0xa3a8('0x29')],'type':_0xfab802[_0xa3a8('0x2a')][_0xa3a8('0x2b')]};});_0x5cf71d['model']=_[_0xa3a8('0x26')](_0x471e85,_0xa3a8('0x23'));_0x5cf71d[_0xa3a8('0x2c')]=_[_0xa3a8('0x2d')](_0x4d1127[_0xa3a8('0x2c')]);_0x5cf71d[_0xa3a8('0x2e')]=_[_0xa3a8('0x2f')](_0x5cf71d[_0xa3a8('0x30')],_0x5cf71d[_0xa3a8('0x2c')]);_0x5e49e9['attributes']=_[_0xa3a8('0x2f')](_0x5cf71d[_0xa3a8('0x30')],qs[_0xa3a8('0x31')](_0x4d1127[_0xa3a8('0x2c')][_0xa3a8('0x31')]));_0x5e49e9[_0xa3a8('0x32')]=_0x5e49e9[_0xa3a8('0x32')][_0xa3a8('0x33')]?_0x5e49e9['attributes']:_0x5cf71d[_0xa3a8('0x30')];if(!_0x4d1127[_0xa3a8('0x2c')]['hasOwnProperty']('nolimit')){_0x5e49e9[_0xa3a8('0x19')]=qs['limit'](_0x4d1127[_0xa3a8('0x2c')]['limit']);_0x5e49e9[_0xa3a8('0x34')]=qs['offset'](_0x4d1127[_0xa3a8('0x2c')]['offset']);}_0x5e49e9['order']=qs[_0xa3a8('0x35')](_0x4d1127[_0xa3a8('0x2c')]['sort']);_0x5e49e9['where']=qs[_0xa3a8('0x2e')](_[_0xa3a8('0x36')](_0x4d1127[_0xa3a8('0x2c')],_0x5cf71d[_0xa3a8('0x2e')]),_0x471e85);if(_0x4d1127['query'][_0xa3a8('0x37')]){_0x5e49e9[_0xa3a8('0x38')]=_[_0xa3a8('0x39')](_0x5e49e9[_0xa3a8('0x38')],{'$or':_[_0xa3a8('0x26')](_0x471e85,function(_0x401c50){if(_0x401c50['type']!=='VIRTUAL'){var _0x1c711c={};_0x1c711c[_0x401c50[_0xa3a8('0x23')]]={'$like':'%'+_0x4d1127[_0xa3a8('0x2c')]['filter']+'%'};return _0x1c711c;}})});}_0x5e49e9=_[_0xa3a8('0x39')]({},_0x5e49e9,_0x4d1127[_0xa3a8('0x3a')]);var _0x499519={'where':_0x5e49e9[_0xa3a8('0x38')]};return db['CloudProvider']['count'](_0x499519)['then'](function(_0x2523aa){_0x2fdd4c['count']=_0x2523aa;if(_0x4d1127['query']['includeAll']){_0x5e49e9[_0xa3a8('0x3b')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x5e49e9);})['then'](function(_0x2a1fb7){_0x2fdd4c[_0xa3a8('0x3c')]=_0x2a1fb7;return _0x2fdd4c;})[_0xa3a8('0x20')](respondWithFilteredResult(_0x232f44,_0x5e49e9))['catch'](handleError(_0x232f44,null));};exports[_0xa3a8('0x3d')]=function(_0x1c3c6a,_0x2d5996){var _0x5891ce={'raw':!![],'where':{'id':_0x1c3c6a[_0xa3a8('0x3e')]['id']}},_0x31b7e1={};_0x31b7e1[_0xa3a8('0x30')]=_[_0xa3a8('0x2d')](db['CloudProvider'][_0xa3a8('0x28')]);_0x31b7e1['query']=_[_0xa3a8('0x2d')](_0x1c3c6a[_0xa3a8('0x2c')]);_0x31b7e1[_0xa3a8('0x2e')]=_[_0xa3a8('0x2f')](_0x31b7e1[_0xa3a8('0x30')],_0x31b7e1[_0xa3a8('0x2c')]);_0x5891ce[_0xa3a8('0x32')]=_[_0xa3a8('0x2f')](_0x31b7e1[_0xa3a8('0x30')],qs[_0xa3a8('0x31')](_0x1c3c6a[_0xa3a8('0x2c')][_0xa3a8('0x31')]));_0x5891ce[_0xa3a8('0x32')]=_0x5891ce['attributes'][_0xa3a8('0x33')]?_0x5891ce[_0xa3a8('0x32')]:_0x31b7e1['model'];if(_0x1c3c6a[_0xa3a8('0x2c')][_0xa3a8('0x3f')]){_0x5891ce[_0xa3a8('0x3b')]=[{'all':!![]}];}_0x5891ce=_[_0xa3a8('0x39')]({},_0x5891ce,_0x1c3c6a[_0xa3a8('0x3a')]);return db['CloudProvider'][_0xa3a8('0x40')](_0x5891ce)['then'](handleEntityNotFound(_0x2d5996,null))['then'](respondWithResult(_0x2d5996,null))[_0xa3a8('0x41')](handleError(_0x2d5996,null));};exports[_0xa3a8('0x42')]=function(_0x51482c,_0x1ee492){return db[_0xa3a8('0x27')][_0xa3a8('0x42')](_0x51482c[_0xa3a8('0x43')],{})[_0xa3a8('0x20')](respondWithResult(_0x1ee492,0xc9))[_0xa3a8('0x41')](handleError(_0x1ee492,null));};exports[_0xa3a8('0x1f')]=function(_0x3b9f46,_0x815b09){if(_0x3b9f46['body']['id']){delete _0x3b9f46[_0xa3a8('0x43')]['id'];}return db['CloudProvider'][_0xa3a8('0x40')]({'where':{'id':_0x3b9f46['params']['id']}})[_0xa3a8('0x20')](handleEntityNotFound(_0x815b09,null))['then'](saveUpdates(_0x3b9f46[_0xa3a8('0x43')],null))[_0xa3a8('0x20')](respondWithResult(_0x815b09,null))[_0xa3a8('0x41')](handleError(_0x815b09,null));};exports[_0xa3a8('0x44')]=function(_0x1f0ebb,_0x37f4ee){return db[_0xa3a8('0x27')][_0xa3a8('0x40')]({'where':{'id':_0x1f0ebb[_0xa3a8('0x3e')]['id']}})[_0xa3a8('0x20')](handleEntityNotFound(_0x37f4ee,null))[_0xa3a8('0x20')](removeEntity(_0x37f4ee,null))['catch'](handleError(_0x37f4ee,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e20432e..4dbe7bf 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05a1=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','CloudProvider','cloud_providers','lodash'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x05a1,0xa4));var _0x105a=function(_0xa5d427,_0x45bae6){_0xa5d427=_0xa5d427-0x0;var _0x44fdc4=_0x05a1[_0xa5d427];return _0x44fdc4;};'use strict';var _=require(_0x105a('0x0'));var util=require(_0x105a('0x1'));var logger=require('../../config/logger')(_0x105a('0x2'));var moment=require(_0x105a('0x3'));var BPromise=require(_0x105a('0x4'));var rp=require(_0x105a('0x5'));var fs=require('fs');var path=require(_0x105a('0x6'));var rimraf=require(_0x105a('0x7'));var config=require(_0x105a('0x8'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x4eb39b,_0x4b3b80){return _0x4eb39b['define'](_0x105a('0x9'),attributes,{'tableName':_0x105a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da5=['exports','CloudProvider','cloud_providers','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7da5,0xbe));var _0x57da=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7da5[_0x543084];return _0x306a57;};'use strict';var _=require(_0x57da('0x0'));var util=require(_0x57da('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x57da('0x2'));var rp=require(_0x57da('0x3'));var fs=require('fs');var path=require(_0x57da('0x4'));var rimraf=require(_0x57da('0x5'));var config=require(_0x57da('0x6'));var attributes=require(_0x57da('0x7'));module[_0x57da('0x8')]=function(_0x559f2e,_0x4e8261){return _0x559f2e['define'](_0x57da('0x9'),attributes,{'tableName':_0x57da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index ef53720..77a459d 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc571=['request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc571,0x7b));var _0x1c57=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xc571[_0x6287b6];return _0x5d6be4;};'use strict';var _=require(_0x1c57('0x0'));var util=require(_0x1c57('0x1'));var moment=require(_0x1c57('0x2'));var BPromise=require(_0x1c57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c57('0x4'));var db=require(_0x1c57('0x5'))['db'];var utils=require(_0x1c57('0x6'));var logger=require('../../config/logger')(_0x1c57('0x7'));var config=require('../../config/environment');var jayson=require(_0x1c57('0x8'));var client=jayson[_0x1c57('0x9')][_0x1c57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439211,_0x14d8c5,_0x33a51e){return new BPromise(function(_0x4533f6,_0x20242e){return client[_0x1c57('0xb')](_0x439211,_0x33a51e)[_0x1c57('0xc')](function(_0x258836){logger[_0x1c57('0xd')](_0x1c57('0xe'),_0x14d8c5,_0x1c57('0xf'));logger[_0x1c57('0x10')](_0x1c57('0x11'),_0x14d8c5,_0x1c57('0xf'),JSON[_0x1c57('0x12')](_0x258836));if(_0x258836[_0x1c57('0x13')]){if(_0x258836[_0x1c57('0x13')][_0x1c57('0x14')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x14d8c5,_0x258836['error'][_0x1c57('0x15')]);return _0x20242e(_0x258836[_0x1c57('0x13')][_0x1c57('0x15')]);}logger[_0x1c57('0x13')](_0x1c57('0xe'),_0x14d8c5,_0x258836[_0x1c57('0x13')]['message']);return _0x4533f6(_0x258836[_0x1c57('0x13')]['message']);}else{logger[_0x1c57('0xd')](_0x1c57('0xe'),_0x14d8c5,'request\x20sent');_0x4533f6(_0x258836['result'][_0x1c57('0x15')]);}})[_0x1c57('0x16')](function(_0x4dee10){logger['error']('CloudProvider,\x20%s,\x20%s',_0x14d8c5,_0x4dee10);_0x20242e(_0x4dee10);});});} \ No newline at end of file +var _0x6f6b=['info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2d29ca,_0xd723fe){var _0x5d30ef=function(_0x35a41e){while(--_0x35a41e){_0x2d29ca['push'](_0x2d29ca['shift']());}};_0x5d30ef(++_0xd723fe);}(_0x6f6b,0x136));var _0xb6f6=function(_0x3e6478,_0x58d025){_0x3e6478=_0x3e6478-0x0;var _0x3f821a=_0x6f6b[_0x3e6478];return _0x3f821a;};'use strict';var _=require('lodash');var util=require(_0xb6f6('0x0'));var moment=require('moment');var BPromise=require(_0xb6f6('0x1'));var rs=require(_0xb6f6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6f6('0x3'))['db'];var utils=require(_0xb6f6('0x4'));var logger=require(_0xb6f6('0x5'))(_0xb6f6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb6f6('0x7'));var client=jayson[_0xb6f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3edb1e,_0x1d6020,_0x43887e){return new BPromise(function(_0x533632,_0x410ae4){return client[_0xb6f6('0x9')](_0x3edb1e,_0x43887e)['then'](function(_0x393a46){logger[_0xb6f6('0xa')]('CloudProvider,\x20%s,\x20%s',_0x1d6020,_0xb6f6('0xb'));logger[_0xb6f6('0xc')](_0xb6f6('0xd'),_0x1d6020,_0xb6f6('0xb'),JSON[_0xb6f6('0xe')](_0x393a46));if(_0x393a46[_0xb6f6('0xf')]){if(_0x393a46[_0xb6f6('0xf')][_0xb6f6('0x10')]===0x1f4){logger[_0xb6f6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x1d6020,_0x393a46[_0xb6f6('0xf')]['message']);return _0x410ae4(_0x393a46[_0xb6f6('0xf')][_0xb6f6('0x11')]);}logger['error'](_0xb6f6('0x12'),_0x1d6020,_0x393a46[_0xb6f6('0xf')]['message']);return _0x533632(_0x393a46[_0xb6f6('0xf')][_0xb6f6('0x11')]);}else{logger[_0xb6f6('0xa')](_0xb6f6('0x12'),_0x1d6020,_0xb6f6('0xb'));_0x533632(_0x393a46[_0xb6f6('0x13')][_0xb6f6('0x11')]);}})['catch'](function(_0x5961b7){logger[_0xb6f6('0xf')](_0xb6f6('0x12'),_0x1d6020,_0x5961b7);_0x410ae4(_0x5961b7);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index c8dbfe8..7d741c5 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x878c=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','./cloudProvider.controller','index','get','/:id','show','isAuthenticated','create','put','update'];(function(_0x1d8819,_0x3d45dc){var _0x2122c4=function(_0x51a361){while(--_0x51a361){_0x1d8819['push'](_0x1d8819['shift']());}};_0x2122c4(++_0x3d45dc);}(_0x878c,0x134));var _0xc878=function(_0x918732,_0x1abae3){_0x918732=_0x918732-0x0;var _0x246a9a=_0x878c[_0x918732];return _0x246a9a;};'use strict';var multer=require(_0xc878('0x0'));var util=require(_0xc878('0x1'));var path=require('path');var timeout=require(_0xc878('0x2'));var express=require(_0xc878('0x3'));var router=express[_0xc878('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc878('0x5'));var config=require('../../config/environment');var controller=require(_0xc878('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc878('0x7')]);router[_0xc878('0x8')](_0xc878('0x9'),auth['isAuthenticated'](),controller[_0xc878('0xa')]);router['post']('/',auth[_0xc878('0xb')](),controller[_0xc878('0xc')]);router[_0xc878('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc878('0xe')]);router[_0xc878('0xf')](_0xc878('0x9'),auth[_0xc878('0xb')](),controller[_0xc878('0x10')]);module['exports']=router; \ No newline at end of file +var _0xba6f=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x1ece80,_0x4c7f83){var _0x40b146=function(_0x5f1bbd){while(--_0x5f1bbd){_0x1ece80['push'](_0x1ece80['shift']());}};_0x40b146(++_0x4c7f83);}(_0xba6f,0x1bf));var _0xfba6=function(_0x5d0c1e,_0x132dd6){_0x5d0c1e=_0x5d0c1e-0x0;var _0x3ad7b0=_0xba6f[_0x5d0c1e];return _0x3ad7b0;};'use strict';var multer=require('multer');var util=require(_0xfba6('0x0'));var path=require(_0xfba6('0x1'));var timeout=require(_0xfba6('0x2'));var express=require(_0xfba6('0x3'));var router=express[_0xfba6('0x4')]();var auth=require(_0xfba6('0x5'));var interaction=require(_0xfba6('0x6'));var config=require('../../config/environment');var controller=require('./cloudProvider.controller');router[_0xfba6('0x7')]('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0x9')]);router[_0xfba6('0x7')](_0xfba6('0xa'),auth[_0xfba6('0x8')](),controller[_0xfba6('0xb')]);router['post']('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0xc')]);router[_0xfba6('0xd')]('/:id',auth[_0xfba6('0x8')](),controller['update']);router[_0xfba6('0xe')]('/:id',auth[_0xfba6('0x8')](),controller[_0xfba6('0xf')]);module[_0xfba6('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 5dccb21..7f7580e 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 _0x6530=['exports','STRING','sequelize'];(function(_0x51de1d,_0x2d15d7){var _0x38705c=function(_0x16e924){while(--_0x16e924){_0x51de1d['push'](_0x51de1d['shift']());}};_0x38705c(++_0x2d15d7);}(_0x6530,0x1d3));var _0x0653=function(_0x9d0c16,_0x228248){_0x9d0c16=_0x9d0c16-0x0;var _0x2b48cf=_0x6530[_0x9d0c16];return _0x2b48cf;};'use strict';var Sequelize=require(_0x0653('0x0'));module[_0x0653('0x1')]={'name':{'type':Sequelize[_0x0653('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0653('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0653('0x2')]},'phone':{'type':Sequelize[_0x0653('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0653('0x2')]},'street':{'type':Sequelize[_0x0653('0x2')]},'postalCode':{'type':Sequelize[_0x0653('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0653('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0653('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x0653('0x2')]},'sCity':{'type':Sequelize[_0x0653('0x2')]},'sCountry':{'type':Sequelize[_0x0653('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf28b=['STRING','sequelize','exports','name'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xf28b,0xf1));var _0xbf28=function(_0x419515,_0x1f4947){_0x419515=_0x419515-0x0;var _0x26e525=_0xf28b[_0x419515];return _0x26e525;};'use strict';var Sequelize=require(_0xbf28('0x0'));module[_0xbf28('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbf28('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbf28('0x3')]},'companyId':{'type':Sequelize[_0xbf28('0x3')]},'website':{'type':Sequelize[_0xbf28('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbf28('0x3')]},'type':{'type':Sequelize[_0xbf28('0x3')]},'street':{'type':Sequelize[_0xbf28('0x3')]},'postalCode':{'type':Sequelize[_0xbf28('0x3')]},'city':{'type':Sequelize[_0xbf28('0x3')]},'country':{'type':Sequelize[_0xbf28('0x3')]},'email':{'type':Sequelize[_0xbf28('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbf28('0x3')]},'sStreet':{'type':Sequelize[_0xbf28('0x3')]},'sPostalCode':{'type':Sequelize[_0xbf28('0x3')]},'sCity':{'type':Sequelize[_0xbf28('0x3')]},'sCountry':{'type':Sequelize[_0xbf28('0x3')]},'description':{'type':Sequelize[_0xbf28('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 58b644a..99a6d6d 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 _0x6e52=['reject','save','update','then','destroy','get','Companies','sendStatus','name','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','order','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','apply'];(function(_0x8252ef,_0x4ba7bd){var _0x4e4a3e=function(_0x348115){while(--_0x348115){_0x8252ef['push'](_0x8252ef['shift']());}};_0x4e4a3e(++_0x4ba7bd);}(_0x6e52,0x12d));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x26e5('0x0'));var emlformat=require(_0x26e5('0x1'));var rimraf=require(_0x26e5('0x2'));var zipdir=require(_0x26e5('0x3'));var jsonpatch=require(_0x26e5('0x4'));var rp=require(_0x26e5('0x5'));var moment=require(_0x26e5('0x6'));var BPromise=require(_0x26e5('0x7'));var Mustache=require(_0x26e5('0x8'));var util=require('util');var path=require(_0x26e5('0x9'));var sox=require(_0x26e5('0xa'));var csv=require(_0x26e5('0xb'));var ejs=require(_0x26e5('0xc'));var fs=require('fs');var _=require(_0x26e5('0xd'));var squel=require(_0x26e5('0xe'));var crypto=require(_0x26e5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x26e5('0x10'));var toCsv=require(_0x26e5('0xb'));var querystring=require('querystring');var Papa=require(_0x26e5('0x11'));var Redis=require(_0x26e5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x26e5('0x13'));var hardwareService=require(_0x26e5('0x14'));var logger=require('../../config/logger')(_0x26e5('0x15'));var utils=require(_0x26e5('0x16'));var config=require(_0x26e5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47865c,_0x2a982a){_0x2a982a=_0x2a982a||0xcc;return function(_0x5df7c3){if(_0x5df7c3){return _0x47865c['sendStatus'](_0x2a982a);}return _0x47865c[_0x26e5('0x18')](_0x2a982a)[_0x26e5('0x19')]();};}function respondWithResult(_0xffe88a,_0x1da88c){_0x1da88c=_0x1da88c||0xc8;return function(_0x16043b){if(_0x16043b){return _0xffe88a[_0x26e5('0x18')](_0x1da88c)['json'](_0x16043b);}};}function respondWithFilteredResult(_0x50671c,_0x15a9b9){return function(_0x3cfb25){if(_0x3cfb25){var _0x4eca2a=_0x3cfb25[_0x26e5('0x1a')],_0x5df654=_0x15a9b9[_0x26e5('0x1b')],_0x5c95bf=_0x15a9b9[_0x26e5('0x1b')]+_0x15a9b9[_0x26e5('0x1c')],_0x23eafc;if(_0x5c95bf>=_0x4eca2a){_0x5c95bf=_0x4eca2a;_0x23eafc=0xc8;}else{_0x23eafc=0xce;}_0x50671c[_0x26e5('0x18')](_0x23eafc);return _0x50671c[_0x26e5('0x1d')]('Content-Range',_0x5df654+'-'+_0x5c95bf+'/'+_0x4eca2a)['json'](_0x3cfb25);}return null;};}function patchUpdates(_0x39ec47){return function(_0x1d7964){try{jsonpatch[_0x26e5('0x1e')](_0x1d7964,_0x39ec47,!![]);}catch(_0x194715){return BPromise[_0x26e5('0x1f')](_0x194715);}return _0x1d7964[_0x26e5('0x20')]();};}function saveUpdates(_0x3c5d1c,_0x104f60){return function(_0x16cc84){if(_0x16cc84){return _0x16cc84[_0x26e5('0x21')](_0x3c5d1c)[_0x26e5('0x22')](function(_0x3f26ae){return _0x3f26ae;});}return null;};}function removeEntity(_0x44579e,_0x297fd9){return function(_0x22959a){if(_0x22959a){return _0x22959a[_0x26e5('0x23')]()[_0x26e5('0x22')](function(){var _0x46b12a=_0x22959a[_0x26e5('0x24')]({'plain':!![]});var _0x2e2bae=_0x26e5('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e2bae,'resourceId':_0x46b12a['id']}})['then'](function(){return _0x22959a;});})[_0x26e5('0x22')](function(){_0x44579e['status'](0xcc)[_0x26e5('0x19')]();});}};}function handleEntityNotFound(_0x5047ca,_0x23c7ff){return function(_0x5475c3){if(!_0x5475c3){_0x5047ca[_0x26e5('0x26')](0x194);}return _0x5475c3;};}function handleError(_0x1ee391,_0x352cc4){_0x352cc4=_0x352cc4||0x1f4;return function(_0x13d848){logger['error'](_0x13d848['stack']);if(_0x13d848[_0x26e5('0x27')]){delete _0x13d848['name'];}_0x1ee391[_0x26e5('0x18')](_0x352cc4)['send'](_0x13d848);};}exports[_0x26e5('0x28')]=function(_0x261b36,_0x2505bd){var _0x39df69={},_0x330962={},_0x1dd034={'count':0x0,'rows':[]};return db[_0x26e5('0x29')][_0x26e5('0x2a')]()[_0x26e5('0x22')](function(_0x905dc2){_0x330962['model']=_[_0x26e5('0x2b')](_0x905dc2);_0x330962[_0x26e5('0x2c')]=_[_0x26e5('0x2b')](_0x261b36[_0x26e5('0x2c')]);_0x330962['filters']=_[_0x26e5('0x2d')](_0x330962[_0x26e5('0x2e')],_0x330962[_0x26e5('0x2c')]);_0x39df69[_0x26e5('0x2f')]=_['intersection'](_0x330962[_0x26e5('0x2e')],qs[_0x26e5('0x30')](_0x261b36[_0x26e5('0x2c')][_0x26e5('0x30')]));_0x39df69['attributes']=_0x39df69[_0x26e5('0x2f')][_0x26e5('0x31')]?_0x39df69[_0x26e5('0x2f')]:_0x330962['model'];if(!_0x261b36['query'][_0x26e5('0x32')](_0x26e5('0x33'))){_0x39df69[_0x26e5('0x1c')]=qs[_0x26e5('0x1c')](_0x261b36['query']['limit']);_0x39df69[_0x26e5('0x1b')]=qs[_0x26e5('0x1b')](_0x261b36['query']['offset']);}_0x39df69['order']=qs[_0x26e5('0x34')](_0x261b36[_0x26e5('0x2c')]['sort']);_0x39df69['where']=qs[_0x26e5('0x35')](_[_0x26e5('0x36')](_0x261b36['query'],_0x330962['filters']),_0x905dc2);if(_0x261b36[_0x26e5('0x2c')][_0x26e5('0x37')]){_0x39df69[_0x26e5('0x38')]=_[_0x26e5('0x39')](_0x39df69['where'],{'$or':_[_0x26e5('0x3a')](_0x39df69['attributes'],function(_0x46bc6c){var _0x30f7a7={};_0x30f7a7[_0x46bc6c]={'$like':'%'+_0x261b36[_0x26e5('0x2c')][_0x26e5('0x37')]+'%'};return _0x30f7a7;})});}_0x39df69=_[_0x26e5('0x39')]({},_0x39df69,_0x261b36['options']);var _0xf382d8={'where':_0x39df69[_0x26e5('0x38')]};return db['CmCompany'][_0x26e5('0x1a')](_0xf382d8)[_0x26e5('0x22')](function(_0x1ba8ee){_0x1dd034[_0x26e5('0x1a')]=_0x1ba8ee;if(_0x261b36['query'][_0x26e5('0x3b')]){_0x39df69[_0x26e5('0x3c')]=[{'all':!![]}];}return db[_0x26e5('0x29')][_0x26e5('0x3d')](_0x39df69);})[_0x26e5('0x22')](function(_0x37172a){_0x1dd034[_0x26e5('0x3e')]=_0x37172a;return _0x1dd034;})[_0x26e5('0x22')](respondWithFilteredResult(_0x2505bd,_0x39df69))[_0x26e5('0x3f')](handleError(_0x2505bd,null));})['catch'](handleError(_0x2505bd,null));};exports[_0x26e5('0x40')]=function(_0x2a4fbe,_0x29b6a6){var _0x4826a0={'raw':![],'where':{'id':_0x2a4fbe[_0x26e5('0x41')]['id']}},_0x19fa41={};_0x19fa41['model']=_[_0x26e5('0x2b')](db[_0x26e5('0x29')][_0x26e5('0x42')]);_0x19fa41[_0x26e5('0x2c')]=_['keys'](_0x2a4fbe['query']);_0x19fa41[_0x26e5('0x35')]=_[_0x26e5('0x2d')](_0x19fa41['model'],_0x19fa41[_0x26e5('0x2c')]);_0x4826a0['attributes']=_[_0x26e5('0x2d')](_0x19fa41[_0x26e5('0x2e')],qs[_0x26e5('0x30')](_0x2a4fbe['query']['fields']));_0x4826a0[_0x26e5('0x2f')]=_0x4826a0[_0x26e5('0x2f')][_0x26e5('0x31')]?_0x4826a0['attributes']:_0x19fa41[_0x26e5('0x2e')];if(_0x2a4fbe[_0x26e5('0x2c')][_0x26e5('0x3b')]){_0x4826a0['include']=[{'all':!![]}];}_0x4826a0=_[_0x26e5('0x39')]({},_0x4826a0,_0x2a4fbe[_0x26e5('0x43')]);return db[_0x26e5('0x29')][_0x26e5('0x44')](_0x4826a0)['then'](handleEntityNotFound(_0x29b6a6,null))[_0x26e5('0x22')](respondWithResult(_0x29b6a6,null))[_0x26e5('0x3f')](handleError(_0x29b6a6,null));};exports['create']=function(_0x339070,_0x208dc8){return db[_0x26e5('0x29')]['create'](_0x339070[_0x26e5('0x45')],{})[_0x26e5('0x22')](function(_0x1cf0b9){var _0x30ee3a=_0x339070[_0x26e5('0x46')][_0x26e5('0x24')]({'plain':!![]});if(!_0x30ee3a)throw new Error(_0x26e5('0x47'));if(_0x30ee3a[_0x26e5('0x48')]===_0x26e5('0x46')){var _0x181b6d=_0x1cf0b9[_0x26e5('0x24')]({'plain':!![]});var _0x4abd86='Companies';return db[_0x26e5('0x49')][_0x26e5('0x44')]({'where':{'name':_0x4abd86,'userProfileId':_0x30ee3a['userProfileId']},'raw':!![]})[_0x26e5('0x22')](function(_0x2b5c8e){if(_0x2b5c8e&&_0x2b5c8e[_0x26e5('0x4a')]===0x0){return db['UserProfileResource'][_0x26e5('0x4b')]({'name':_0x181b6d[_0x26e5('0x27')],'resourceId':_0x181b6d['id'],'type':_0x2b5c8e[_0x26e5('0x27')],'sectionId':_0x2b5c8e['id']},{})[_0x26e5('0x22')](function(){return _0x1cf0b9;});}else{return _0x1cf0b9;}})[_0x26e5('0x3f')](function(_0x24647d){logger['error'](_0x26e5('0x4c'),_0x24647d);throw _0x24647d;});}return _0x1cf0b9;})[_0x26e5('0x22')](respondWithResult(_0x208dc8,0xc9))[_0x26e5('0x3f')](handleError(_0x208dc8,null));};exports[_0x26e5('0x21')]=function(_0x392900,_0x4a0eb1){if(_0x392900[_0x26e5('0x45')]['id']){delete _0x392900[_0x26e5('0x45')]['id'];}return db[_0x26e5('0x29')][_0x26e5('0x44')]({'where':{'id':_0x392900[_0x26e5('0x41')]['id']}})[_0x26e5('0x22')](handleEntityNotFound(_0x4a0eb1,null))[_0x26e5('0x22')](saveUpdates(_0x392900['body'],null))[_0x26e5('0x22')](respondWithResult(_0x4a0eb1,null))[_0x26e5('0x3f')](handleError(_0x4a0eb1,null));};exports[_0x26e5('0x23')]=function(_0x693ff8,_0x2cedb0){return db[_0x26e5('0x29')]['find']({'where':{'id':_0x693ff8['params']['id']}})[_0x26e5('0x22')](handleEntityNotFound(_0x2cedb0,null))['then'](removeEntity(_0x2cedb0,null))['catch'](handleError(_0x2cedb0,null));};exports['describe']=function(_0x342f10,_0x377837){return db[_0x26e5('0x29')][_0x26e5('0x2a')]()[_0x26e5('0x22')](respondWithResult(_0x377837,null))['catch'](handleError(_0x377837,null));};exports[_0x26e5('0x4d')]=function(_0x24e44b,_0xf124e4,_0x3df72a){return db[_0x26e5('0x4e')]['find']({'where':{'id':_0x24e44b[_0x26e5('0x41')]['id']}})[_0x26e5('0x22')](handleEntityNotFound(_0xf124e4,null))[_0x26e5('0x22')](function(_0x5bfcc8){if(_0x5bfcc8){return _0x5bfcc8[_0x26e5('0x4d')](_0x24e44b[_0x26e5('0x45')][_0x26e5('0x4f')],_['omit'](_0x24e44b['body'],[_0x26e5('0x4f'),'id'])||{});}})[_0x26e5('0x22')](respondWithResult(_0xf124e4,null))['catch'](handleError(_0xf124e4,null));};exports[_0x26e5('0x50')]=function(_0x564dea,_0x27be3e,_0x11c188){var _0x53e581={};var _0x4608a9={};var _0x551997;var _0x266e35;return db[_0x26e5('0x29')][_0x26e5('0x51')]({'where':{'id':_0x564dea[_0x26e5('0x41')]['id']}})[_0x26e5('0x22')](handleEntityNotFound(_0x27be3e,null))[_0x26e5('0x22')](function(_0x22ddfd){if(_0x22ddfd){_0x551997=_0x22ddfd;_0x4608a9[_0x26e5('0x2e')]=_[_0x26e5('0x2b')](db[_0x26e5('0x4e')]['rawAttributes']);_0x4608a9[_0x26e5('0x2c')]=_[_0x26e5('0x2b')](_0x564dea[_0x26e5('0x2c')]);_0x4608a9[_0x26e5('0x35')]=_[_0x26e5('0x2d')](_0x4608a9[_0x26e5('0x2e')],_0x4608a9[_0x26e5('0x2c')]);_0x53e581[_0x26e5('0x2f')]=_[_0x26e5('0x2d')](_0x4608a9[_0x26e5('0x2e')],qs[_0x26e5('0x30')](_0x564dea[_0x26e5('0x2c')][_0x26e5('0x30')]));_0x53e581[_0x26e5('0x2f')]=_0x53e581['attributes']['length']?_0x53e581[_0x26e5('0x2f')]:_0x4608a9[_0x26e5('0x2e')];_0x53e581[_0x26e5('0x52')]=qs[_0x26e5('0x34')](_0x564dea['query']['sort']);_0x53e581[_0x26e5('0x38')]=qs[_0x26e5('0x35')](_[_0x26e5('0x36')](_0x564dea[_0x26e5('0x2c')],_0x4608a9['filters']));if(_0x564dea[_0x26e5('0x2c')][_0x26e5('0x37')]){_0x53e581[_0x26e5('0x38')]=_[_0x26e5('0x39')](_0x53e581['where'],{'$or':_[_0x26e5('0x3a')](_0x53e581[_0x26e5('0x2f')],function(_0x1970ca){var _0x30b793={};_0x30b793[_0x1970ca]={'$like':'%'+_0x564dea[_0x26e5('0x2c')]['filter']+'%'};return _0x30b793;})});}_0x53e581=_[_0x26e5('0x39')]({},_0x53e581,_0x564dea['options']);return _0x551997['getContacts'](_0x53e581);}})[_0x26e5('0x22')](function(_0x9d2156){if(_0x9d2156){_0x266e35=_0x9d2156[_0x26e5('0x31')];if(!_0x564dea['query'][_0x26e5('0x32')](_0x26e5('0x33'))){_0x53e581[_0x26e5('0x1c')]=qs[_0x26e5('0x1c')](_0x564dea[_0x26e5('0x2c')][_0x26e5('0x1c')]);_0x53e581[_0x26e5('0x1b')]=qs[_0x26e5('0x1b')](_0x564dea['query'][_0x26e5('0x1b')]);}return _0x551997['getContacts'](_0x53e581);}})[_0x26e5('0x22')](function(_0x49d10f){if(_0x49d10f){return _0x49d10f?{'count':_0x266e35,'rows':_0x49d10f}:null;}})[_0x26e5('0x22')](respondWithResult(_0x27be3e,null))[_0x26e5('0x3f')](handleError(_0x27be3e,null));}; \ No newline at end of file +var _0x654d=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','stack','send','index','CmCompany','keys','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addContacts','CmContact','ids','omit','findOne','length','order','getContacts','html-pdf'];(function(_0x392cc1,_0x43e6f){var _0x10ba0a=function(_0x1006bf){while(--_0x1006bf){_0x392cc1['push'](_0x392cc1['shift']());}};_0x10ba0a(++_0x43e6f);}(_0x654d,0x153));var _0xd654=function(_0x26c445,_0xcff7bc){_0x26c445=_0x26c445-0x0;var _0x331127=_0x654d[_0x26c445];return _0x331127;};'use strict';var pdf=require(_0xd654('0x0'));var emlformat=require(_0xd654('0x1'));var rimraf=require(_0xd654('0x2'));var zipdir=require(_0xd654('0x3'));var jsonpatch=require(_0xd654('0x4'));var rp=require('request-promise');var moment=require(_0xd654('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd654('0x6'));var util=require(_0xd654('0x7'));var path=require('path');var sox=require(_0xd654('0x8'));var csv=require(_0xd654('0x9'));var ejs=require(_0xd654('0xa'));var fs=require('fs');var _=require(_0xd654('0xb'));var squel=require(_0xd654('0xc'));var crypto=require('crypto');var jsforce=require(_0xd654('0xd'));var deskjs=require(_0xd654('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd654('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd654('0x10'));var qs=require(_0xd654('0x11'));var as=require(_0xd654('0x12'));var hardwareService=require(_0xd654('0x13'));var logger=require('../../config/logger')(_0xd654('0x14'));var utils=require(_0xd654('0x15'));var config=require('../../config/environment');var db=require(_0xd654('0x16'))['db'];function respondWithStatusCode(_0x283c75,_0x3b040f){_0x3b040f=_0x3b040f||0xcc;return function(_0x5338e5){if(_0x5338e5){return _0x283c75[_0xd654('0x17')](_0x3b040f);}return _0x283c75[_0xd654('0x18')](_0x3b040f)['end']();};}function respondWithResult(_0x94b633,_0x25b621){_0x25b621=_0x25b621||0xc8;return function(_0x5b2a26){if(_0x5b2a26){return _0x94b633[_0xd654('0x18')](_0x25b621)[_0xd654('0x19')](_0x5b2a26);}};}function respondWithFilteredResult(_0xbd79f3,_0x275ef0){return function(_0x175d09){if(_0x175d09){var _0x494bd8=_0x175d09[_0xd654('0x1a')],_0x3b95b8=_0x275ef0[_0xd654('0x1b')],_0x1bf82b=_0x275ef0[_0xd654('0x1b')]+_0x275ef0[_0xd654('0x1c')],_0x3c50e4;if(_0x1bf82b>=_0x494bd8){_0x1bf82b=_0x494bd8;_0x3c50e4=0xc8;}else{_0x3c50e4=0xce;}_0xbd79f3[_0xd654('0x18')](_0x3c50e4);return _0xbd79f3[_0xd654('0x1d')](_0xd654('0x1e'),_0x3b95b8+'-'+_0x1bf82b+'/'+_0x494bd8)[_0xd654('0x19')](_0x175d09);}return null;};}function patchUpdates(_0x476636){return function(_0x428168){try{jsonpatch[_0xd654('0x1f')](_0x428168,_0x476636,!![]);}catch(_0x26123d){return BPromise[_0xd654('0x20')](_0x26123d);}return _0x428168['save']();};}function saveUpdates(_0x42df61,_0x5b2351){return function(_0x5e89c6){if(_0x5e89c6){return _0x5e89c6['update'](_0x42df61)[_0xd654('0x21')](function(_0x2e44ab){return _0x2e44ab;});}return null;};}function removeEntity(_0x369fe6,_0x1c1308){return function(_0x325a45){if(_0x325a45){return _0x325a45['destroy']()[_0xd654('0x21')](function(){var _0x4113f9=_0x325a45[_0xd654('0x22')]({'plain':!![]});var _0x297e51='Companies';return db[_0xd654('0x23')][_0xd654('0x24')]({'where':{'type':_0x297e51,'resourceId':_0x4113f9['id']}})[_0xd654('0x21')](function(){return _0x325a45;});})[_0xd654('0x21')](function(){_0x369fe6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35710b,_0x3ca96a){return function(_0x576bf3){if(!_0x576bf3){_0x35710b[_0xd654('0x17')](0x194);}return _0x576bf3;};}function handleError(_0x319654,_0x4ee823){_0x4ee823=_0x4ee823||0x1f4;return function(_0x686019){logger[_0xd654('0x25')](_0x686019[_0xd654('0x26')]);if(_0x686019['name']){delete _0x686019['name'];}_0x319654[_0xd654('0x18')](_0x4ee823)[_0xd654('0x27')](_0x686019);};}exports[_0xd654('0x28')]=function(_0x2c2fb4,_0xa4e297){var _0x17c5a1={},_0x154dfa={},_0x168a63={'count':0x0,'rows':[]};return db[_0xd654('0x29')]['describe']()[_0xd654('0x21')](function(_0x3beb4b){_0x154dfa['model']=_[_0xd654('0x2a')](_0x3beb4b);_0x154dfa['query']=_[_0xd654('0x2a')](_0x2c2fb4[_0xd654('0x2b')]);_0x154dfa['filters']=_['intersection'](_0x154dfa[_0xd654('0x2c')],_0x154dfa['query']);_0x17c5a1['attributes']=_[_0xd654('0x2d')](_0x154dfa[_0xd654('0x2c')],qs[_0xd654('0x2e')](_0x2c2fb4[_0xd654('0x2b')][_0xd654('0x2e')]));_0x17c5a1['attributes']=_0x17c5a1['attributes']['length']?_0x17c5a1[_0xd654('0x2f')]:_0x154dfa[_0xd654('0x2c')];if(!_0x2c2fb4['query'][_0xd654('0x30')](_0xd654('0x31'))){_0x17c5a1[_0xd654('0x1c')]=qs['limit'](_0x2c2fb4[_0xd654('0x2b')][_0xd654('0x1c')]);_0x17c5a1[_0xd654('0x1b')]=qs[_0xd654('0x1b')](_0x2c2fb4['query'][_0xd654('0x1b')]);}_0x17c5a1['order']=qs['sort'](_0x2c2fb4['query'][_0xd654('0x32')]);_0x17c5a1[_0xd654('0x33')]=qs[_0xd654('0x34')](_[_0xd654('0x35')](_0x2c2fb4[_0xd654('0x2b')],_0x154dfa[_0xd654('0x34')]),_0x3beb4b);if(_0x2c2fb4[_0xd654('0x2b')]['filter']){_0x17c5a1[_0xd654('0x33')]=_[_0xd654('0x36')](_0x17c5a1[_0xd654('0x33')],{'$or':_[_0xd654('0x37')](_0x17c5a1[_0xd654('0x2f')],function(_0x155c62){var _0x1e614a={};_0x1e614a[_0x155c62]={'$like':'%'+_0x2c2fb4[_0xd654('0x2b')][_0xd654('0x38')]+'%'};return _0x1e614a;})});}_0x17c5a1=_[_0xd654('0x36')]({},_0x17c5a1,_0x2c2fb4[_0xd654('0x39')]);var _0x3e208a={'where':_0x17c5a1[_0xd654('0x33')]};return db['CmCompany'][_0xd654('0x1a')](_0x3e208a)[_0xd654('0x21')](function(_0x1c747f){_0x168a63[_0xd654('0x1a')]=_0x1c747f;if(_0x2c2fb4[_0xd654('0x2b')][_0xd654('0x3a')]){_0x17c5a1[_0xd654('0x3b')]=[{'all':!![]}];}return db[_0xd654('0x29')][_0xd654('0x3c')](_0x17c5a1);})[_0xd654('0x21')](function(_0x1a1cf7){_0x168a63[_0xd654('0x3d')]=_0x1a1cf7;return _0x168a63;})[_0xd654('0x21')](respondWithFilteredResult(_0xa4e297,_0x17c5a1))['catch'](handleError(_0xa4e297,null));})[_0xd654('0x3e')](handleError(_0xa4e297,null));};exports[_0xd654('0x3f')]=function(_0x3ba5bb,_0x499120){var _0x3bf11a={'raw':![],'where':{'id':_0x3ba5bb[_0xd654('0x40')]['id']}},_0x4b0671={};_0x4b0671[_0xd654('0x2c')]=_['keys'](db[_0xd654('0x29')]['rawAttributes']);_0x4b0671[_0xd654('0x2b')]=_['keys'](_0x3ba5bb['query']);_0x4b0671[_0xd654('0x34')]=_[_0xd654('0x2d')](_0x4b0671[_0xd654('0x2c')],_0x4b0671['query']);_0x3bf11a['attributes']=_[_0xd654('0x2d')](_0x4b0671[_0xd654('0x2c')],qs[_0xd654('0x2e')](_0x3ba5bb[_0xd654('0x2b')]['fields']));_0x3bf11a['attributes']=_0x3bf11a['attributes']['length']?_0x3bf11a['attributes']:_0x4b0671[_0xd654('0x2c')];if(_0x3ba5bb[_0xd654('0x2b')][_0xd654('0x3a')]){_0x3bf11a[_0xd654('0x3b')]=[{'all':!![]}];}_0x3bf11a=_['merge']({},_0x3bf11a,_0x3ba5bb['options']);return db[_0xd654('0x29')][_0xd654('0x41')](_0x3bf11a)[_0xd654('0x21')](handleEntityNotFound(_0x499120,null))['then'](respondWithResult(_0x499120,null))[_0xd654('0x3e')](handleError(_0x499120,null));};exports['create']=function(_0x322bb2,_0x3b5468){return db[_0xd654('0x29')][_0xd654('0x42')](_0x322bb2['body'],{})[_0xd654('0x21')](function(_0x462e4f){var _0x5394fc=_0x322bb2[_0xd654('0x43')][_0xd654('0x22')]({'plain':!![]});if(!_0x5394fc)throw new Error(_0xd654('0x44'));if(_0x5394fc[_0xd654('0x45')]===_0xd654('0x43')){var _0x461237=_0x462e4f[_0xd654('0x22')]({'plain':!![]});var _0x40fbae=_0xd654('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x40fbae,'userProfileId':_0x5394fc['userProfileId']},'raw':!![]})[_0xd654('0x21')](function(_0x56321c){if(_0x56321c&&_0x56321c[_0xd654('0x47')]===0x0){return db['UserProfileResource'][_0xd654('0x42')]({'name':_0x461237[_0xd654('0x48')],'resourceId':_0x461237['id'],'type':_0x56321c[_0xd654('0x48')],'sectionId':_0x56321c['id']},{})[_0xd654('0x21')](function(){return _0x462e4f;});}else{return _0x462e4f;}})[_0xd654('0x3e')](function(_0x535385){logger[_0xd654('0x25')](_0xd654('0x49'),_0x535385);throw _0x535385;});}return _0x462e4f;})['then'](respondWithResult(_0x3b5468,0xc9))[_0xd654('0x3e')](handleError(_0x3b5468,null));};exports[_0xd654('0x4a')]=function(_0x324900,_0xeb963){if(_0x324900[_0xd654('0x4b')]['id']){delete _0x324900[_0xd654('0x4b')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x324900['params']['id']}})['then'](handleEntityNotFound(_0xeb963,null))['then'](saveUpdates(_0x324900[_0xd654('0x4b')],null))[_0xd654('0x21')](respondWithResult(_0xeb963,null))[_0xd654('0x3e')](handleError(_0xeb963,null));};exports[_0xd654('0x24')]=function(_0x27e980,_0x36a99e){return db[_0xd654('0x29')][_0xd654('0x41')]({'where':{'id':_0x27e980[_0xd654('0x40')]['id']}})[_0xd654('0x21')](handleEntityNotFound(_0x36a99e,null))['then'](removeEntity(_0x36a99e,null))[_0xd654('0x3e')](handleError(_0x36a99e,null));};exports[_0xd654('0x4c')]=function(_0x116c76,_0x15a6c3){return db[_0xd654('0x29')][_0xd654('0x4c')]()[_0xd654('0x21')](respondWithResult(_0x15a6c3,null))[_0xd654('0x3e')](handleError(_0x15a6c3,null));};exports[_0xd654('0x4d')]=function(_0x53c0e0,_0x577aaf,_0x3c9b3d){return db[_0xd654('0x4e')][_0xd654('0x41')]({'where':{'id':_0x53c0e0[_0xd654('0x40')]['id']}})[_0xd654('0x21')](handleEntityNotFound(_0x577aaf,null))['then'](function(_0x2af779){if(_0x2af779){return _0x2af779['addContacts'](_0x53c0e0[_0xd654('0x4b')][_0xd654('0x4f')],_[_0xd654('0x50')](_0x53c0e0[_0xd654('0x4b')],[_0xd654('0x4f'),'id'])||{});}})[_0xd654('0x21')](respondWithResult(_0x577aaf,null))[_0xd654('0x3e')](handleError(_0x577aaf,null));};exports['getContacts']=function(_0xac2a7a,_0xc8e36f,_0x3466cf){var _0x576595={};var _0x36eb2b={};var _0x1edced;var _0x3c063b;return db[_0xd654('0x29')][_0xd654('0x51')]({'where':{'id':_0xac2a7a[_0xd654('0x40')]['id']}})[_0xd654('0x21')](handleEntityNotFound(_0xc8e36f,null))[_0xd654('0x21')](function(_0x7468d9){if(_0x7468d9){_0x1edced=_0x7468d9;_0x36eb2b[_0xd654('0x2c')]=_['keys'](db[_0xd654('0x4e')]['rawAttributes']);_0x36eb2b[_0xd654('0x2b')]=_[_0xd654('0x2a')](_0xac2a7a['query']);_0x36eb2b[_0xd654('0x34')]=_[_0xd654('0x2d')](_0x36eb2b[_0xd654('0x2c')],_0x36eb2b[_0xd654('0x2b')]);_0x576595[_0xd654('0x2f')]=_[_0xd654('0x2d')](_0x36eb2b[_0xd654('0x2c')],qs[_0xd654('0x2e')](_0xac2a7a[_0xd654('0x2b')]['fields']));_0x576595['attributes']=_0x576595[_0xd654('0x2f')][_0xd654('0x52')]?_0x576595[_0xd654('0x2f')]:_0x36eb2b[_0xd654('0x2c')];_0x576595[_0xd654('0x53')]=qs[_0xd654('0x32')](_0xac2a7a['query']['sort']);_0x576595['where']=qs[_0xd654('0x34')](_['pick'](_0xac2a7a[_0xd654('0x2b')],_0x36eb2b[_0xd654('0x34')]));if(_0xac2a7a[_0xd654('0x2b')][_0xd654('0x38')]){_0x576595[_0xd654('0x33')]=_[_0xd654('0x36')](_0x576595[_0xd654('0x33')],{'$or':_[_0xd654('0x37')](_0x576595[_0xd654('0x2f')],function(_0x208a0c){var _0x14c8b7={};_0x14c8b7[_0x208a0c]={'$like':'%'+_0xac2a7a[_0xd654('0x2b')]['filter']+'%'};return _0x14c8b7;})});}_0x576595=_[_0xd654('0x36')]({},_0x576595,_0xac2a7a[_0xd654('0x39')]);return _0x1edced['getContacts'](_0x576595);}})[_0xd654('0x21')](function(_0x12cb32){if(_0x12cb32){_0x3c063b=_0x12cb32['length'];if(!_0xac2a7a[_0xd654('0x2b')][_0xd654('0x30')](_0xd654('0x31'))){_0x576595[_0xd654('0x1c')]=qs['limit'](_0xac2a7a[_0xd654('0x2b')][_0xd654('0x1c')]);_0x576595[_0xd654('0x1b')]=qs[_0xd654('0x1b')](_0xac2a7a['query'][_0xd654('0x1b')]);}return _0x1edced[_0xd654('0x54')](_0x576595);}})[_0xd654('0x21')](function(_0x5c7a1c){if(_0x5c7a1c){return _0x5c7a1c?{'count':_0x3c063b,'rows':_0x5c7a1c}:null;}})[_0xd654('0x21')](respondWithResult(_0xc8e36f,null))[_0xd654('0x3e')](handleError(_0xc8e36f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 7bdee17..c531345 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 _0x5c29=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','lodash','../../config/logger','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5c29,0x9d));var _0x95c2=function(_0x4a7ecc,_0x210e7b){_0x4a7ecc=_0x4a7ecc-0x0;var _0x337026=_0x5c29[_0x4a7ecc];return _0x337026;};'use strict';var _=require(_0x95c2('0x0'));var util=require('util');var logger=require(_0x95c2('0x1'))('api');var moment=require(_0x95c2('0x2'));var BPromise=require('bluebird');var rp=require(_0x95c2('0x3'));var fs=require('fs');var path=require(_0x95c2('0x4'));var rimraf=require(_0x95c2('0x5'));var config=require(_0x95c2('0x6'));var attributes=require(_0x95c2('0x7'));module[_0x95c2('0x8')]=function(_0xa43a0f,_0x1b7c82){return _0xa43a0f[_0x95c2('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ff5=['api','moment','bluebird','request-promise','path','rimraf','exports','cm_companies','lodash','../../config/logger'];(function(_0x5c3249,_0x221647){var _0x5a2458=function(_0x4cb973){while(--_0x4cb973){_0x5c3249['push'](_0x5c3249['shift']());}};_0x5a2458(++_0x221647);}(_0x0ff5,0x166));var _0x50ff=function(_0x569a45,_0x2da15b){_0x569a45=_0x569a45-0x0;var _0x1a5ef8=_0x0ff5[_0x569a45];return _0x1a5ef8;};'use strict';var _=require(_0x50ff('0x0'));var util=require('util');var logger=require(_0x50ff('0x1'))(_0x50ff('0x2'));var moment=require(_0x50ff('0x3'));var BPromise=require(_0x50ff('0x4'));var rp=require(_0x50ff('0x5'));var fs=require('fs');var path=require(_0x50ff('0x6'));var rimraf=require(_0x50ff('0x7'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x50ff('0x8')]=function(_0x4d470d,_0x26156a){return _0x4d470d['define']('CmCompany',attributes,{'tableName':_0x50ff('0x9'),'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 6ad14d1..7bd4d0e 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 _0x9ab4=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5e785b,_0x54fee3){var _0x4aa134=function(_0x59c079){while(--_0x59c079){_0x5e785b['push'](_0x5e785b['shift']());}};_0x4aa134(++_0x54fee3);}(_0x9ab4,0x1a7));var _0x49ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ab4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x49ab('0x0'));var util=require(_0x49ab('0x1'));var moment=require(_0x49ab('0x2'));var BPromise=require(_0x49ab('0x3'));var rs=require(_0x49ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ab('0x6'))(_0x49ab('0x7'));var config=require(_0x49ab('0x8'));var jayson=require(_0x49ab('0x9'));var client=jayson[_0x49ab('0xa')][_0x49ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf809f5,_0x4adef8,_0x494587){return new BPromise(function(_0x221551,_0x1f88ec){return client['request'](_0xf809f5,_0x494587)[_0x49ab('0xc')](function(_0x3a8476){logger['info'](_0x49ab('0xd'),_0x4adef8,_0x49ab('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x4adef8,_0x49ab('0xe'),JSON[_0x49ab('0xf')](_0x3a8476));if(_0x3a8476[_0x49ab('0x10')]){if(_0x3a8476[_0x49ab('0x10')][_0x49ab('0x11')]===0x1f4){logger[_0x49ab('0x10')](_0x49ab('0xd'),_0x4adef8,_0x3a8476[_0x49ab('0x10')]['message']);return _0x1f88ec(_0x3a8476['error'][_0x49ab('0x12')]);}logger[_0x49ab('0x10')](_0x49ab('0xd'),_0x4adef8,_0x3a8476['error']['message']);return _0x221551(_0x3a8476[_0x49ab('0x10')][_0x49ab('0x12')]);}else{logger[_0x49ab('0x13')](_0x49ab('0xd'),_0x4adef8,_0x49ab('0xe'));_0x221551(_0x3a8476[_0x49ab('0x14')][_0x49ab('0x12')]);}})[_0x49ab('0x15')](function(_0x36dc09){logger[_0x49ab('0x10')](_0x49ab('0xd'),_0x4adef8,_0x36dc09);_0x1f88ec(_0x36dc09);});});} \ No newline at end of file +var _0xbd89=['message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x382bdd,_0x4e0534){var _0x1f29d8=function(_0x201f49){while(--_0x201f49){_0x382bdd['push'](_0x382bdd['shift']());}};_0x1f29d8(++_0x4e0534);}(_0xbd89,0xa3));var _0x9bd8=function(_0x15243b,_0x340ea5){_0x15243b=_0x15243b-0x0;var _0x337790=_0xbd89[_0x15243b];return _0x337790;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9bd8('0x0'));var BPromise=require(_0x9bd8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bd8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9bd8('0x3'));var logger=require(_0x9bd8('0x4'))(_0x9bd8('0x5'));var config=require(_0x9bd8('0x6'));var jayson=require(_0x9bd8('0x7'));var client=jayson['client'][_0x9bd8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2deed8,_0x16f7de,_0x92d570){return new BPromise(function(_0x1fd911,_0x3e9e4e){return client[_0x9bd8('0x9')](_0x2deed8,_0x92d570)['then'](function(_0x299e3a){logger[_0x9bd8('0xa')](_0x9bd8('0xb'),_0x16f7de,'request\x20sent');logger[_0x9bd8('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x16f7de,_0x9bd8('0xd'),JSON[_0x9bd8('0xe')](_0x299e3a));if(_0x299e3a[_0x9bd8('0xf')]){if(_0x299e3a['error'][_0x9bd8('0x10')]===0x1f4){logger[_0x9bd8('0xf')](_0x9bd8('0xb'),_0x16f7de,_0x299e3a[_0x9bd8('0xf')][_0x9bd8('0x11')]);return _0x3e9e4e(_0x299e3a[_0x9bd8('0xf')][_0x9bd8('0x11')]);}logger[_0x9bd8('0xf')](_0x9bd8('0xb'),_0x16f7de,_0x299e3a[_0x9bd8('0xf')][_0x9bd8('0x11')]);return _0x1fd911(_0x299e3a[_0x9bd8('0xf')][_0x9bd8('0x11')]);}else{logger[_0x9bd8('0xa')]('CmCompany,\x20%s,\x20%s',_0x16f7de,'request\x20sent');_0x1fd911(_0x299e3a[_0x9bd8('0x12')][_0x9bd8('0x11')]);}})[_0x9bd8('0x13')](function(_0x19ca5f){logger['error'](_0x9bd8('0xb'),_0x16f7de,_0x19ca5f);_0x3e9e4e(_0x19ca5f);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 7ef112d..75c5cd8 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 _0xedd9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util'];(function(_0x28517a,_0x2061e6){var _0xe0b7ba=function(_0x4593bd){while(--_0x4593bd){_0x28517a['push'](_0x28517a['shift']());}};_0xe0b7ba(++_0x2061e6);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f938f,_0x51c241){_0x1f938f=_0x1f938f-0x0;var _0x5d701f=_0xedd9[_0x1f938f];return _0x5d701f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./cmCompany.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0xf')]('/:id/contacts',auth[_0x9edd('0x9')](),controller[_0x9edd('0x11')]);router[_0x9edd('0x12')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x13')]);router[_0x9edd('0x14')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0x15')]);module[_0x9edd('0x16')]=router; \ No newline at end of file +var _0x9957=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmCompany.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index f1a1ee9..bf20bd1 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 _0xd4ba=['TEXT','INTEGER','DATE','NOW','lodash','exports','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd4ba,0x131));var _0xad4b=function(_0x2049b1,_0x11fd0c){_0x2049b1=_0x2049b1-0x0;var _0x59b710=_0xd4ba[_0x2049b1];return _0x59b710;};'use strict';var _=require(_0xad4b('0x0'));var Sequelize=require('sequelize');module[_0xad4b('0x1')]={'firstName':{'type':Sequelize[_0xad4b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xad4b('0x2')]},'street':{'type':Sequelize[_0xad4b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xad4b('0x2')]},'country':{'type':Sequelize[_0xad4b('0x2')]},'dateOfBirth':{'type':Sequelize[_0xad4b('0x2')]},'description':{'type':Sequelize[_0xad4b('0x3')]},'phone':{'type':Sequelize[_0xad4b('0x2')]},'mobile':{'type':Sequelize[_0xad4b('0x2')]},'fax':{'type':Sequelize[_0xad4b('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xad4b('0x2')]},'fb_data':{'type':Sequelize[_0xad4b('0x2')]},'twitter':{'type':Sequelize[_0xad4b('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xad4b('0x2')]},'viber':{'type':Sequelize[_0xad4b('0x2')]},'line':{'type':Sequelize[_0xad4b('0x2')]},'wechat':{'type':Sequelize[_0xad4b('0x2')]},'telegram':{'type':Sequelize[_0xad4b('0x2')]},'UserId':{'type':Sequelize[_0xad4b('0x4')]},'priority':{'type':Sequelize[_0xad4b('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xad4b('0x5')],'defaultValue':Sequelize[_0xad4b('0x6')]},'dialTimezone':{'type':Sequelize[_0xad4b('0x2')]},'utcOffset':{'type':Sequelize[_0xad4b('0x4')]}}; \ No newline at end of file +var _0xeb21=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3455a1,_0x1c1eda){var _0x2b42f8=function(_0x103617){while(--_0x103617){_0x3455a1['push'](_0x3455a1['shift']());}};_0x2b42f8(++_0x1c1eda);}(_0xeb21,0x156));var _0x1eb2=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0xeb21[_0x333714];return _0x4c211e;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x1eb2('0x0')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1eb2('0x0')]},'city':{'type':Sequelize[_0x1eb2('0x0')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1eb2('0x1')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1eb2('0x0')]},'fax':{'type':Sequelize[_0x1eb2('0x0')]},'email':{'type':Sequelize[_0x1eb2('0x0')]},'url':{'type':Sequelize[_0x1eb2('0x0')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x1eb2('0x0')]},'twitter':{'type':Sequelize[_0x1eb2('0x0')]},'skype':{'type':Sequelize[_0x1eb2('0x0')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1eb2('0x0')]},'line':{'type':Sequelize[_0x1eb2('0x0')]},'wechat':{'type':Sequelize[_0x1eb2('0x0')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1eb2('0x2')]},'priority':{'type':Sequelize[_0x1eb2('0x2')](0x2)[_0x1eb2('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1eb2('0x4')],'defaultValue':Sequelize[_0x1eb2('0x5')]},'dialTimezone':{'type':Sequelize[_0x1eb2('0x0')]},'utcOffset':{'type':Sequelize[_0x1eb2('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7e4a376..b19ac12 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 _0x24bd=['MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','ListId','findOrCreate','show','color','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','upload','createReadStream','path','parse','meta','import','agent','binding','fork','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','html-pdf','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','set','reject','save','update','destroy','then','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','tools_tags','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','union','User','and','datetime','DATE','type','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','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.phone\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','TagIds','Tags','push','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','values','merge','body','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage'];(function(_0x4fd764,_0x512d40){var _0x4d936b=function(_0x13057d){while(--_0x13057d){_0x4fd764['push'](_0x4fd764['shift']());}};_0x4d936b(++_0x512d40);}(_0x24bd,0x137));var _0xd24b=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x24bd[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0xd24b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd24b('0x1'));var zipdir=require(_0xd24b('0x2'));var jsonpatch=require(_0xd24b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd24b('0x4'));var path=require('path');var sox=require(_0xd24b('0x5'));var csv=require(_0xd24b('0x6'));var ejs=require(_0xd24b('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd24b('0x8'));var crypto=require(_0xd24b('0x9'));var jsforce=require(_0xd24b('0xa'));var deskjs=require(_0xd24b('0xb'));var toCsv=require(_0xd24b('0x6'));var querystring=require(_0xd24b('0xc'));var Papa=require('papaparse');var Redis=require(_0xd24b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd24b('0xe'));var as=require(_0xd24b('0xf'));var hardwareService=require(_0xd24b('0x10'));var logger=require(_0xd24b('0x11'))(_0xd24b('0x12'));var utils=require(_0xd24b('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd24b('0x14')]=_[_0xd24b('0x15')](config[_0xd24b('0x14')],{'host':_0xd24b('0x16'),'port':0x18eb});var socket=require(_0xd24b('0x17'))(new Redis(config[_0xd24b('0x14')]));require('./cmContact.socket')[_0xd24b('0x18')](socket);function respondWithStatusCode(_0x27f8aa,_0x399da9){_0x399da9=_0x399da9||0xcc;return function(_0x20e9fe){if(_0x20e9fe){return _0x27f8aa[_0xd24b('0x19')](_0x399da9);}return _0x27f8aa['status'](_0x399da9)[_0xd24b('0x1a')]();};}function respondWithResult(_0x319ebf,_0x2403e3){_0x2403e3=_0x2403e3||0xc8;return function(_0x37d2df){if(_0x37d2df){return _0x319ebf[_0xd24b('0x1b')](_0x2403e3)[_0xd24b('0x1c')](_0x37d2df);}};}function respondWithFilteredResult(_0x251b22,_0x5d4edc){return function(_0x1d9f93){if(_0x1d9f93){var _0xe5452e=_0x1d9f93[_0xd24b('0x1d')],_0x1ac514=_0x5d4edc[_0xd24b('0x1e')],_0x4e5433=_0x5d4edc[_0xd24b('0x1e')]+_0x5d4edc['limit'],_0xdc8c6e;if(_0x4e5433>=_0xe5452e){_0x4e5433=_0xe5452e;_0xdc8c6e=0xc8;}else{_0xdc8c6e=0xce;}_0x251b22[_0xd24b('0x1b')](_0xdc8c6e);return _0x251b22[_0xd24b('0x1f')]('Content-Range',_0x1ac514+'-'+_0x4e5433+'/'+_0xe5452e)[_0xd24b('0x1c')](_0x1d9f93);}return null;};}function patchUpdates(_0x5e42d6){return function(_0x5d3d46){try{jsonpatch['apply'](_0x5d3d46,_0x5e42d6,!![]);}catch(_0x153010){return BPromise[_0xd24b('0x20')](_0x153010);}return _0x5d3d46[_0xd24b('0x21')]();};}function saveUpdates(_0x17335b,_0x4ff6f5){return function(_0x168df8){if(_0x168df8){return _0x168df8[_0xd24b('0x22')](_0x17335b)['then'](function(_0x2d599c){return _0x2d599c;});}return null;};}function removeEntity(_0x27f37c,_0xe6f87d){return function(_0x535c3e){if(_0x535c3e){return _0x535c3e[_0xd24b('0x23')]()[_0xd24b('0x24')](function(){_0x27f37c[_0xd24b('0x1b')](0xcc)[_0xd24b('0x1a')]();});}};}function handleEntityNotFound(_0x3cdfd8,_0x5925de){return function(_0x4baf07){if(!_0x4baf07){_0x3cdfd8['sendStatus'](0x194);}return _0x4baf07;};}function handleError(_0x239590,_0x13222c){_0x13222c=_0x13222c||0x1f4;return function(_0x3ecbed){logger[_0xd24b('0x25')](_0x3ecbed[_0xd24b('0x26')]);if(_0x3ecbed[_0xd24b('0x27')]){delete _0x3ecbed['name'];}_0x239590[_0xd24b('0x1b')](_0x13222c)[_0xd24b('0x28')](_0x3ecbed);};}exports[_0xd24b('0x29')]=function(_0x251f97,_0x2d0aa2){var _0x12f78e={},_0x37c0e3={},_0x388152={'count':0x0,'rows':[]};return db[_0xd24b('0x2a')][_0xd24b('0x2b')]()[_0xd24b('0x24')](function(_0xc08afa){var _0x171e6a=[];for(var _0x15c471=0x0;_0x15c4710x1){_0x5473ad['or'](_0xd24b('0x68'),qs[_0xd24b('0x69')](_0x345fcc),null);}else{if(qs[_0xd24b('0x6a')](_0x345fcc)){_0x5473ad['or'](_0xd24b('0x6b'),_0x345fcc+'%');_0x5473ad['or'](_0xd24b('0x6c'),_0x345fcc+'%');_0x5473ad['or']('c.mobile\x20LIKE\x20?',_0x345fcc+'%');_0x5473ad['or']('c.fax\x20LIKE\x20?',_0x345fcc+'%');}else if(qs[_0xd24b('0x6d')](_0x345fcc)){_0x5473ad['or']('c.email\x20LIKE\x20?',_0x345fcc+'%');}else{_0x5473ad['or'](_0xd24b('0x6e'),'%'+_0x345fcc+'%');_0x5473ad['or'](_0xd24b('0x6f'),'%'+_0x345fcc+'%');_0x5473ad['or'](_0xd24b('0x70'),'%'+_0x345fcc+'%');}}}}_0x5cd0d0[_0xd24b('0x3f')](_0x5473ad);_0x5cd0d0[_0xd24b('0x71')](_0xd24b('0x72'));var _0x302775={'type':db[_0xd24b('0x73')][_0xd24b('0x74')][_0xd24b('0x75')],'raw':!![]};var _0x53ada1=_0x5cd0d0[_0xd24b('0x76')]()[_0xd24b('0x42')](_0xd24b('0x72'));if(_0x12f78e[_0xd24b('0x3d')]){_0x12f78e['order']['forEach'](function(_0x33dd49){_0x5cd0d0['order']('c.'+_0x33dd49[0x0],_0x33dd49[0x1]===_0xd24b('0x77')?![]:!![]);});}if(!_['isEmpty'](_0x3cc94a)){_0x5cd0d0[_0xd24b('0x78')](_0x248eb9);_0x53ada1[_0xd24b('0x3f')](_0xd24b('0x79'),_0x3cc94a);}BPromise[_0xd24b('0x7a')]()['then'](function(){if(_0x84f59e&&!_[_0xd24b('0x7b')](_0x84f59e['conditions'],[_0xd24b('0x42'),_0xd24b('0x56')])){return _0x251f97['user'][_0xd24b('0x7c')]({'attributes':['id'],'raw':!![]})[_0xd24b('0x24')](function(_0x4c43b9){if(_[_0xd24b('0x60')](_0x4c43b9)){_0x53ada1[_0xd24b('0x3f')](_0xd24b('0x7d'));_0x5cd0d0[_0xd24b('0x3f')](_0xd24b('0x7d'));}else{_0x53ada1[_0xd24b('0x3f')](_0xd24b('0x61'),_[_0xd24b('0x53')](_0x4c43b9,'id'));_0x5cd0d0['where'](_0xd24b('0x61'),_[_0xd24b('0x53')](_0x4c43b9,'id'));}});}else{return;}})[_0xd24b('0x24')](function(){db[_0xd24b('0x7e')]['query'](_0x53ada1[_0xd24b('0x7f')](),_0x302775)['then'](function(_0x2ecae3){_0x388152[_0xd24b('0x1d')]=_0x2ecae3['length'];if(_0x388152[_0xd24b('0x1d')]===0x0)return[];return db[_0xd24b('0x7e')]['query'](_0x5ef9ab[_0xd24b('0x7f')](),_0x302775);})[_0xd24b('0x24')](function(_0x4d4d16){_0x15cdb3=_['keyBy'](_0x4d4d16,'id');_0x302775=_['merge'](_0x302775,{'model':db[_0xd24b('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x251f97['query'][_0xd24b('0x39')]){_0x12f78e[_0xd24b('0x38')][_0xd24b('0x54')](function(_0x560a1f){_0x5cd0d0['field']('c.'+_0x560a1f);});}else{_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x72'));_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x80'));_0x5cd0d0['field']('c.lastName');_0x5cd0d0['field'](_0xd24b('0x81'));_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x82'));_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x83'));_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x84'));_0x5cd0d0[_0xd24b('0x42')](_0xd24b('0x85'));_0x5cd0d0['field'](_0xd24b('0x86'));_0x5cd0d0[_0xd24b('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd24b('0x87'));}if(_0x12f78e[_0xd24b('0x3c')])_0x5cd0d0[_0xd24b('0x3c')](_0x12f78e[_0xd24b('0x3c')]);if(_0x12f78e['offset'])_0x5cd0d0[_0xd24b('0x1e')](_0x12f78e['offset']);return db[_0xd24b('0x7e')][_0xd24b('0x35')](_0x5cd0d0[_0xd24b('0x7f')](),_0x302775);})[_0xd24b('0x24')](function(_0x3260c3){_0x3260c3[_0xd24b('0x54')](function(_0x303676){if(_0x303676['TagIds']){_0x303676[_0xd24b('0x88')]=[];_0x303676['TagIds'][_0xd24b('0x52')](',')['forEach'](function(_0x503abf){_0x303676['Tags'][_0xd24b('0x89')](_0x15cdb3[_0x503abf]);});}delete _0x303676[_0xd24b('0x87')];});_0x388152[_0xd24b('0x8a')]=_0x3260c3;return _0x388152;})[_0xd24b('0x24')](respondWithFilteredResult(_0x2d0aa2,_0x12f78e));});})[_0xd24b('0x8b')](handleError(_0x2d0aa2,null));};exports[_0xd24b('0x23')]=function(_0xc99c2c,_0x278c7d){return db[_0xd24b('0x2a')][_0xd24b('0x4f')]({'where':{'id':_0xc99c2c[_0xd24b('0x8c')]['id']}})['then'](handleEntityNotFound(_0x278c7d,null))[_0xd24b('0x24')](removeEntity(_0x278c7d,null))[_0xd24b('0x8b')](handleError(_0x278c7d,null));};exports['describe']=function(_0x1d7cbd,_0x58dbe1){return db[_0xd24b('0x2a')][_0xd24b('0x2b')]()[_0xd24b('0x24')](function(_0x15082f){delete _0x15082f[_0xd24b('0x8d')];for(var _0x386b62=0x0;_0x386b62=_0x33400d){_0x1f543b=_0x33400d;_0x1540e3=0xc8;}else{_0x1540e3=0xce;}_0x5570ca[_0xc8b4('0x1f')](_0x1540e3);return _0x5570ca[_0xc8b4('0x24')]('Content-Range',_0x41034f+'-'+_0x1f543b+'/'+_0x33400d)['json'](_0x2b3e48);}return null;};}function patchUpdates(_0x175a7f){return function(_0x43ae44){try{jsonpatch[_0xc8b4('0x25')](_0x43ae44,_0x175a7f,!![]);}catch(_0x472511){return BPromise['reject'](_0x472511);}return _0x43ae44['save']();};}function saveUpdates(_0xf7b196,_0x58b00f){return function(_0x4b1aea){if(_0x4b1aea){return _0x4b1aea['update'](_0xf7b196)[_0xc8b4('0x26')](function(_0x405e58){return _0x405e58;});}return null;};}function removeEntity(_0x362926,_0x3082c9){return function(_0x390e74){if(_0x390e74){return _0x390e74[_0xc8b4('0x27')]()[_0xc8b4('0x26')](function(){_0x362926[_0xc8b4('0x1f')](0xcc)[_0xc8b4('0x28')]();});}};}function handleEntityNotFound(_0x6b82fa,_0x1d3a1b){return function(_0x18aff9){if(!_0x18aff9){_0x6b82fa['sendStatus'](0x194);}return _0x18aff9;};}function handleError(_0x467984,_0xeb52fc){_0xeb52fc=_0xeb52fc||0x1f4;return function(_0x296688){logger[_0xc8b4('0x29')](_0x296688[_0xc8b4('0x2a')]);if(_0x296688[_0xc8b4('0x2b')]){delete _0x296688['name'];}_0x467984[_0xc8b4('0x1f')](_0xeb52fc)[_0xc8b4('0x2c')](_0x296688);};}exports[_0xc8b4('0x2d')]=function(_0x11bdb1,_0x503bb7){var _0x42b784={},_0xb5570d={},_0x354f50={'count':0x0,'rows':[]};return db[_0xc8b4('0x2e')]['describe']()[_0xc8b4('0x26')](function(_0x5b97d1){var _0x350953=[];for(var _0x2a5409=0x0;_0x2a54090x1){_0x570233['or'](_0xc8b4('0x6e'),qs[_0xc8b4('0x6f')](_0x721419),null);}else{if(qs[_0xc8b4('0x70')](_0x721419)){_0x570233['or'](_0xc8b4('0x71'),_0x721419+'%');_0x570233['or']('c.phone\x20LIKE\x20?',_0x721419+'%');_0x570233['or'](_0xc8b4('0x72'),_0x721419+'%');_0x570233['or'](_0xc8b4('0x73'),_0x721419+'%');}else if(qs[_0xc8b4('0x74')](_0x721419)){_0x570233['or'](_0xc8b4('0x75'),_0x721419+'%');}else{_0x570233['or']('c.firstName\x20LIKE\x20?','%'+_0x721419+'%');_0x570233['or']('c.lastName\x20LIKE\x20?','%'+_0x721419+'%');_0x570233['or'](_0xc8b4('0x75'),'%'+_0x721419+'%');}}}}_0xa15066[_0xc8b4('0x40')](_0x570233);_0xa15066[_0xc8b4('0x76')](_0xc8b4('0x77'));var _0x45ebf8={'type':db['Sequelize'][_0xc8b4('0x78')][_0xc8b4('0x79')],'raw':!![]};var _0x3b106d=_0xa15066[_0xc8b4('0x7a')]()[_0xc8b4('0x43')](_0xc8b4('0x77'));if(_0x42b784[_0xc8b4('0x3e')]){_0x42b784[_0xc8b4('0x3e')][_0xc8b4('0x56')](function(_0x8c22b8){_0xa15066['order']('c.'+_0x8c22b8[0x0],_0x8c22b8[0x1]===_0xc8b4('0x7b')?![]:!![]);});}if(!_[_0xc8b4('0x63')](_0x3684c6)){_0xa15066[_0xc8b4('0x7c')](_0xfc3ba3);_0x3b106d['where'](_0xc8b4('0x7d'),_0x3684c6);}BPromise[_0xc8b4('0x7e')]()[_0xc8b4('0x26')](function(){if(_0x52949&&!_[_0xc8b4('0x7f')](_0x52949[_0xc8b4('0x51')],[_0xc8b4('0x43'),'User'])){return _0x11bdb1[_0xc8b4('0x80')][_0xc8b4('0x81')]({'attributes':['id'],'raw':!![]})[_0xc8b4('0x26')](function(_0x114fa7){if(_['isEmpty'](_0x114fa7)){_0x3b106d[_0xc8b4('0x40')]('c.ListId\x20IS\x20NULL');_0xa15066[_0xc8b4('0x40')](_0xc8b4('0x82'));}else{_0x3b106d[_0xc8b4('0x40')](_0xc8b4('0x65'),_[_0xc8b4('0x55')](_0x114fa7,'id'));_0xa15066[_0xc8b4('0x40')]('c.ListId\x20IN\x20?',_['map'](_0x114fa7,'id'));}});}else{return;}})['then'](function(){db[_0xc8b4('0x83')][_0xc8b4('0x37')](_0x3b106d[_0xc8b4('0x84')](),_0x45ebf8)[_0xc8b4('0x26')](function(_0x5d1721){_0x354f50['count']=_0x5d1721[_0xc8b4('0x30')];if(_0x354f50['count']===0x0)return[];return db['sequelize'][_0xc8b4('0x37')](_0x50c2b5['toString'](),_0x45ebf8);})[_0xc8b4('0x26')](function(_0x516789){_0x869ef7=_[_0xc8b4('0x85')](_0x516789,'id');_0x45ebf8=_['merge'](_0x45ebf8,{'model':db[_0xc8b4('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11bdb1[_0xc8b4('0x37')][_0xc8b4('0x3b')]){_0x42b784[_0xc8b4('0x3a')]['forEach'](function(_0x5804da){_0xa15066[_0xc8b4('0x43')]('c.'+_0x5804da);});}else{_0xa15066['field']('c.id');_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x86'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x87'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x88'));_0xa15066[_0xc8b4('0x43')]('c.mobile');_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x89'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x8a'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x8b'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x8c'));_0xa15066[_0xc8b4('0x43')](_0xc8b4('0x8d'),'TagIds');}if(_0x42b784[_0xc8b4('0x23')])_0xa15066['limit'](_0x42b784[_0xc8b4('0x23')]);if(_0x42b784[_0xc8b4('0x22')])_0xa15066['offset'](_0x42b784[_0xc8b4('0x22')]);return db[_0xc8b4('0x83')][_0xc8b4('0x37')](_0xa15066[_0xc8b4('0x84')](),_0x45ebf8);})[_0xc8b4('0x26')](function(_0xef189d){_0xef189d[_0xc8b4('0x56')](function(_0x1bf582){if(_0x1bf582[_0xc8b4('0x8e')]){_0x1bf582['Tags']=[];_0x1bf582[_0xc8b4('0x8e')][_0xc8b4('0x54')](',')[_0xc8b4('0x56')](function(_0x4c2b27){_0x1bf582[_0xc8b4('0x8f')]['push'](_0x869ef7[_0x4c2b27]);});}delete _0x1bf582[_0xc8b4('0x8e')];});_0x354f50[_0xc8b4('0x90')]=_0xef189d;return _0x354f50;})[_0xc8b4('0x26')](respondWithFilteredResult(_0x503bb7,_0x42b784));});})['catch'](handleError(_0x503bb7,null));};exports[_0xc8b4('0x27')]=function(_0x1f76b7,_0x12dd11){return db[_0xc8b4('0x2e')][_0xc8b4('0x52')]({'where':{'id':_0x1f76b7[_0xc8b4('0x91')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x12dd11,null))[_0xc8b4('0x26')](removeEntity(_0x12dd11,null))[_0xc8b4('0x92')](handleError(_0x12dd11,null));};exports['describe']=function(_0x55f4de,_0x5580d8){return db['CmContact'][_0xc8b4('0x93')]()[_0xc8b4('0x26')](function(_0x3fe16a){delete _0x3fe16a[_0xc8b4('0x94')];for(var _0x238264=0x0;_0x238264{}\s\\|]/g,'-');_0x54f8b9(null,util['format'](_0xa9c5('0x22'),path[_0xa9c5('0x23')](_0x2d95f8[_0xa9c5('0x21')],path[_0xa9c5('0x24')](_0x2d95f8[_0xa9c5('0x21')])),Date[_0xa9c5('0x25')](),path['extname'](_0x2d95f8['originalname'])));}})});router[_0xa9c5('0x15')](_0xa9c5('0x26'),upload['single'](_0xa9c5('0x27')),controller[_0xa9c5('0x28')]);var upload=multer({'storage':multer[_0xa9c5('0x1d')]({'destination':function(_0x32fc7d,_0x4cbba1,_0x40f08b){_0x40f08b(null,path[_0xa9c5('0x1e')](config['root'],'server/files/tmp'));},'filename':function(_0x242771,_0x4cd5e6,_0x1762ac){_0x4cd5e6[_0xa9c5('0x21')]=_0x4cd5e6['originalname'][_0xa9c5('0x29')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1762ac(null,util[_0xa9c5('0x2a')]('%s-%s%s',path[_0xa9c5('0x23')](_0x4cd5e6[_0xa9c5('0x21')],path[_0xa9c5('0x24')](_0x4cd5e6[_0xa9c5('0x21')])),Date[_0xa9c5('0x25')](),path['extname'](_0x4cd5e6[_0xa9c5('0x21')])));}})});router['post'](_0xa9c5('0x2b'),upload[_0xa9c5('0x2c')](_0xa9c5('0x27')),controller['upload']);router[_0xa9c5('0x15')](_0xa9c5('0x2d'),auth['isAuthenticated'](),controller[_0xa9c5('0x2e')]);router[_0xa9c5('0x2f')](_0xa9c5('0xb'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x30')]);router[_0xa9c5('0x31')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0x32')]);module[_0xa9c5('0x33')]=router; \ No newline at end of file +var _0x7dfd=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','join','root','originalname','replace','format','basename','extname','now','/csv','uploadCsv','server/files/tmp','%s-%s%s','single','file','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getHoppers'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var auth=require(_0xd7df('0x6'));var interaction=require(_0xd7df('0x7'));var config=require(_0xd7df('0x8'));var controller=require(_0xd7df('0x9'));router[_0xd7df('0xa')]('/',auth[_0xd7df('0xb')](),controller[_0xd7df('0xc')]);router[_0xd7df('0xa')](_0xd7df('0xd'),auth[_0xd7df('0xb')](),controller[_0xd7df('0xe')]);router['get'](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x10')]);router[_0xd7df('0xa')]('/:id/tags',auth[_0xd7df('0xb')](),controller['getTags']);router[_0xd7df('0xa')]('/:id/hoppers',auth[_0xd7df('0xb')](),controller[_0xd7df('0x11')]);router[_0xd7df('0xa')](_0xd7df('0x12'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x13')]);router[_0xd7df('0xa')](_0xd7df('0x14'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x15')]);router[_0xd7df('0xa')](_0xd7df('0x16'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x17')]);router[_0xd7df('0x18')](_0xd7df('0x19'),auth[_0xd7df('0xb')](),controller['merge']);router[_0xd7df('0x18')]('/',auth[_0xd7df('0xb')](),controller['create']);router[_0xd7df('0x18')](_0xd7df('0x1a'),auth['isAuthenticated'](),controller[_0xd7df('0x1b')]);router[_0xd7df('0x18')](_0xd7df('0x1c'),auth['isAuthenticated'](),controller[_0xd7df('0x1d')]);var upload=multer({'storage':multer[_0xd7df('0x1e')]({'destination':function(_0x3cea3,_0x5ba653,_0x96d86e){_0x96d86e(null,path[_0xd7df('0x1f')](config[_0xd7df('0x20')],'server/files/tmp'));},'filename':function(_0x4188af,_0x5aecbb,_0x225e33){_0x5aecbb['originalname']=_0x5aecbb[_0xd7df('0x21')][_0xd7df('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x225e33(null,util[_0xd7df('0x23')]('%s-%s%s',path[_0xd7df('0x24')](_0x5aecbb['originalname'],path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])),Date[_0xd7df('0x26')](),path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])));}})});router[_0xd7df('0x18')](_0xd7df('0x27'),upload['single']('file'),controller[_0xd7df('0x28')]);var upload=multer({'storage':multer[_0xd7df('0x1e')]({'destination':function(_0x26047f,_0x459f11,_0x13f190){_0x13f190(null,path[_0xd7df('0x1f')](config[_0xd7df('0x20')],_0xd7df('0x29')));},'filename':function(_0x163904,_0x5c4d17,_0xe53f53){_0x5c4d17[_0xd7df('0x21')]=_0x5c4d17[_0xd7df('0x21')][_0xd7df('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe53f53(null,util[_0xd7df('0x23')](_0xd7df('0x2a'),path[_0xd7df('0x24')](_0x5c4d17[_0xd7df('0x21')],path['extname'](_0x5c4d17['originalname'])),Date['now'](),path['extname'](_0x5c4d17['originalname'])));}})});router[_0xd7df('0x18')]('/upload',upload[_0xd7df('0x2b')](_0xd7df('0x2c')),controller['upload']);router[_0xd7df('0x18')](_0xd7df('0x2d'),auth['isAuthenticated'](),controller[_0xd7df('0x2e')]);router[_0xd7df('0x2f')](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x30')]);router[_0xd7df('0x31')]('/:id',auth[_0xd7df('0xb')](),controller[_0xd7df('0x32')]);module[_0xd7df('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 3121fe5..a498971 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf4e=['INTEGER','STRING','sequelize','exports'];(function(_0x443d97,_0x3c25f5){var _0x36667b=function(_0x452d9f){while(--_0x452d9f){_0x443d97['push'](_0x443d97['shift']());}};_0x36667b(++_0x3c25f5);}(_0xbf4e,0x172));var _0xebf4=function(_0x61b32e,_0x58f7f7){_0x61b32e=_0x61b32e-0x0;var _0x325f88=_0xbf4e[_0x61b32e];return _0x325f88;};'use strict';var Sequelize=require(_0xebf4('0x0'));module[_0xebf4('0x1')]={'CmContactId':{'type':Sequelize[_0xebf4('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xebf4('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xebf4('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xebf4('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xebf4('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x4f0d=['STRING','PHONE','INTEGER'];(function(_0x24be7b,_0x4c13c2){var _0x30e537=function(_0x15b785){while(--_0x15b785){_0x24be7b['push'](_0x24be7b['shift']());}};_0x30e537(++_0x4c13c2);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0x4f0d[_0x5c84a6];return _0xb8c5f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd4f0('0x0')],'defaultValue':_0xd4f0('0x1')},'OrderBy':{'type':Sequelize[_0xd4f0('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 1875769..3221c06 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ff6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','CmContactHasItems','error','stack','send','map','CmContactHasItem','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x4e83fb,_0x55dae0){var _0xff9a0d=function(_0x1d0595){while(--_0x1d0595){_0x4e83fb['push'](_0x4e83fb['shift']());}};_0xff9a0d(++_0x55dae0);}(_0x1ff6,0x1aa));var _0x61ff=function(_0x521dd7,_0x56d270){_0x521dd7=_0x521dd7-0x0;var _0x11c3bf=_0x1ff6[_0x521dd7];return _0x11c3bf;};'use strict';var pdf=require(_0x61ff('0x0'));var emlformat=require(_0x61ff('0x1'));var rimraf=require(_0x61ff('0x2'));var zipdir=require(_0x61ff('0x3'));var jsonpatch=require(_0x61ff('0x4'));var rp=require(_0x61ff('0x5'));var moment=require(_0x61ff('0x6'));var BPromise=require(_0x61ff('0x7'));var Mustache=require(_0x61ff('0x8'));var util=require(_0x61ff('0x9'));var path=require(_0x61ff('0xa'));var sox=require('sox');var csv=require(_0x61ff('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x61ff('0xc'));var squel=require(_0x61ff('0xd'));var crypto=require('crypto');var jsforce=require(_0x61ff('0xe'));var deskjs=require(_0x61ff('0xf'));var toCsv=require(_0x61ff('0xb'));var querystring=require(_0x61ff('0x10'));var Papa=require(_0x61ff('0x11'));var Redis=require(_0x61ff('0x12'));var authService=require(_0x61ff('0x13'));var qs=require(_0x61ff('0x14'));var as=require(_0x61ff('0x15'));var hardwareService=require(_0x61ff('0x16'));var logger=require(_0x61ff('0x17'))(_0x61ff('0x18'));var utils=require(_0x61ff('0x19'));var config=require(_0x61ff('0x1a'));var db=require(_0x61ff('0x1b'))['db'];function respondWithStatusCode(_0x3a87c9,_0x5a91f6){_0x5a91f6=_0x5a91f6||0xcc;return function(_0x4b07fb){if(_0x4b07fb){return _0x3a87c9[_0x61ff('0x1c')](_0x5a91f6);}return _0x3a87c9[_0x61ff('0x1d')](_0x5a91f6)[_0x61ff('0x1e')]();};}function respondWithResult(_0x34ae9e,_0x2e1685){_0x2e1685=_0x2e1685||0xc8;return function(_0x4653da){if(_0x4653da){return _0x34ae9e[_0x61ff('0x1d')](_0x2e1685)[_0x61ff('0x1f')](_0x4653da);}};}function respondWithFilteredResult(_0x5283d5,_0x561f5b){return function(_0x5a768a){if(_0x5a768a){var _0x201d70=_0x5a768a['count'],_0x3fab8a=_0x561f5b[_0x61ff('0x20')],_0x552a68=_0x561f5b[_0x61ff('0x20')]+_0x561f5b[_0x61ff('0x21')],_0x3303ef;if(_0x552a68>=_0x201d70){_0x552a68=_0x201d70;_0x3303ef=0xc8;}else{_0x3303ef=0xce;}_0x5283d5[_0x61ff('0x1d')](_0x3303ef);return _0x5283d5[_0x61ff('0x22')](_0x61ff('0x23'),_0x3fab8a+'-'+_0x552a68+'/'+_0x201d70)['json'](_0x5a768a);}return null;};}function patchUpdates(_0x2665b7){return function(_0x39fefc){try{jsonpatch['apply'](_0x39fefc,_0x2665b7,!![]);}catch(_0x377943){return BPromise[_0x61ff('0x24')](_0x377943);}return _0x39fefc[_0x61ff('0x25')]();};}function saveUpdates(_0x15e9b7,_0x31217f){return function(_0x59700a){if(_0x59700a){return _0x59700a['update'](_0x15e9b7)[_0x61ff('0x26')](function(_0xa83dfa){return _0xa83dfa;});}return null;};}function removeEntity(_0xc90ffe,_0x5d5bd7){return function(_0x47310a){if(_0x47310a){return _0x47310a[_0x61ff('0x27')]()['then'](function(){var _0x1dd845=_0x47310a[_0x61ff('0x28')]({'plain':!![]});var _0xcea299=_0x61ff('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xcea299,'resourceId':_0x1dd845['id']}})[_0x61ff('0x26')](function(){return _0x47310a;});})[_0x61ff('0x26')](function(){_0xc90ffe[_0x61ff('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1c28,_0x56c742){return function(_0x15f07e){if(!_0x15f07e){_0x3f1c28[_0x61ff('0x1c')](0x194);}return _0x15f07e;};}function handleError(_0x57f8bf,_0x4d9f89){_0x4d9f89=_0x4d9f89||0x1f4;return function(_0x127868){logger[_0x61ff('0x2a')](_0x127868[_0x61ff('0x2b')]);if(_0x127868['name']){delete _0x127868['name'];}_0x57f8bf[_0x61ff('0x1d')](_0x4d9f89)[_0x61ff('0x2c')](_0x127868);};}exports['index']=function(_0x3a9e03,_0x33367f){var _0x5a9dfe={},_0x26189a={},_0x2bd3de={'count':0x0,'rows':[]};var _0x2e5453=_[_0x61ff('0x2d')](db[_0x61ff('0x2e')][_0x61ff('0x2f')],function(_0x2665b6){return{'name':_0x2665b6[_0x61ff('0x30')],'type':_0x2665b6[_0x61ff('0x31')]['key']};});_0x26189a[_0x61ff('0x32')]=_[_0x61ff('0x2d')](_0x2e5453,_0x61ff('0x33'));_0x26189a[_0x61ff('0x34')]=_[_0x61ff('0x35')](_0x3a9e03['query']);_0x26189a[_0x61ff('0x36')]=_['intersection'](_0x26189a[_0x61ff('0x32')],_0x26189a[_0x61ff('0x34')]);_0x5a9dfe[_0x61ff('0x37')]=_[_0x61ff('0x38')](_0x26189a[_0x61ff('0x32')],qs['fields'](_0x3a9e03[_0x61ff('0x34')][_0x61ff('0x39')]));_0x5a9dfe[_0x61ff('0x37')]=_0x5a9dfe[_0x61ff('0x37')][_0x61ff('0x3a')]?_0x5a9dfe[_0x61ff('0x37')]:_0x26189a[_0x61ff('0x32')];if(!_0x3a9e03['query']['hasOwnProperty']('nolimit')){_0x5a9dfe[_0x61ff('0x21')]=qs[_0x61ff('0x21')](_0x3a9e03[_0x61ff('0x34')]['limit']);_0x5a9dfe[_0x61ff('0x20')]=qs['offset'](_0x3a9e03[_0x61ff('0x34')][_0x61ff('0x20')]);}_0x5a9dfe['order']=qs[_0x61ff('0x3b')](_0x3a9e03[_0x61ff('0x34')]['sort']);_0x5a9dfe[_0x61ff('0x3c')]=qs[_0x61ff('0x36')](_[_0x61ff('0x3d')](_0x3a9e03['query'],_0x26189a[_0x61ff('0x36')]),_0x2e5453);if(_0x3a9e03[_0x61ff('0x34')][_0x61ff('0x3e')]){_0x5a9dfe['where']=_[_0x61ff('0x3f')](_0x5a9dfe[_0x61ff('0x3c')],{'$or':_[_0x61ff('0x2d')](_0x2e5453,function(_0x331f62){if(_0x331f62[_0x61ff('0x31')]!==_0x61ff('0x40')){var _0x442cf6={};_0x442cf6[_0x331f62[_0x61ff('0x33')]]={'$like':'%'+_0x3a9e03[_0x61ff('0x34')][_0x61ff('0x3e')]+'%'};return _0x442cf6;}})});}_0x5a9dfe=_['merge']({},_0x5a9dfe,_0x3a9e03[_0x61ff('0x41')]);var _0x189e6d={'where':_0x5a9dfe[_0x61ff('0x3c')]};return db['CmContactHasItem'][_0x61ff('0x42')](_0x189e6d)['then'](function(_0x92db5a){_0x2bd3de[_0x61ff('0x42')]=_0x92db5a;if(_0x3a9e03['query'][_0x61ff('0x43')]){_0x5a9dfe[_0x61ff('0x44')]=[{'all':!![]}];}return db[_0x61ff('0x2e')][_0x61ff('0x45')](_0x5a9dfe);})[_0x61ff('0x26')](function(_0x4542ec){_0x2bd3de[_0x61ff('0x46')]=_0x4542ec;return _0x2bd3de;})[_0x61ff('0x26')](respondWithFilteredResult(_0x33367f,_0x5a9dfe))['catch'](handleError(_0x33367f,null));};exports[_0x61ff('0x47')]=function(_0x1a5b93,_0x23d18f){var _0x18e668={'raw':!![],'where':{'id':_0x1a5b93[_0x61ff('0x48')]['id']}},_0x527e3f={};_0x527e3f[_0x61ff('0x32')]=_[_0x61ff('0x35')](db[_0x61ff('0x2e')][_0x61ff('0x2f')]);_0x527e3f[_0x61ff('0x34')]=_[_0x61ff('0x35')](_0x1a5b93[_0x61ff('0x34')]);_0x527e3f[_0x61ff('0x36')]=_['intersection'](_0x527e3f['model'],_0x527e3f[_0x61ff('0x34')]);_0x18e668[_0x61ff('0x37')]=_[_0x61ff('0x38')](_0x527e3f[_0x61ff('0x32')],qs[_0x61ff('0x39')](_0x1a5b93[_0x61ff('0x34')][_0x61ff('0x39')]));_0x18e668['attributes']=_0x18e668[_0x61ff('0x37')][_0x61ff('0x3a')]?_0x18e668[_0x61ff('0x37')]:_0x527e3f['model'];if(_0x1a5b93['query'][_0x61ff('0x43')]){_0x18e668['include']=[{'all':!![]}];}_0x18e668=_[_0x61ff('0x3f')]({},_0x18e668,_0x1a5b93[_0x61ff('0x41')]);return db[_0x61ff('0x2e')][_0x61ff('0x49')](_0x18e668)[_0x61ff('0x26')](handleEntityNotFound(_0x23d18f,null))[_0x61ff('0x26')](respondWithResult(_0x23d18f,null))[_0x61ff('0x4a')](handleError(_0x23d18f,null));};exports[_0x61ff('0x4b')]=function(_0x572055,_0x47a25c){return db[_0x61ff('0x2e')][_0x61ff('0x4b')](_0x572055[_0x61ff('0x4c')],{})[_0x61ff('0x26')](function(_0x5406dc){var _0x449d47=_0x572055[_0x61ff('0x4d')][_0x61ff('0x28')]({'plain':!![]});if(!_0x449d47)throw new Error(_0x61ff('0x4e'));if(_0x449d47[_0x61ff('0x4f')]===_0x61ff('0x4d')){var _0x564186=_0x5406dc[_0x61ff('0x28')]({'plain':!![]});var _0x1f40c4=_0x61ff('0x29');return db[_0x61ff('0x50')][_0x61ff('0x49')]({'where':{'name':_0x1f40c4,'userProfileId':_0x449d47[_0x61ff('0x51')]},'raw':!![]})[_0x61ff('0x26')](function(_0x18feb8){if(_0x18feb8&&_0x18feb8[_0x61ff('0x52')]===0x0){return db[_0x61ff('0x53')][_0x61ff('0x4b')]({'name':_0x564186[_0x61ff('0x33')],'resourceId':_0x564186['id'],'type':_0x18feb8['name'],'sectionId':_0x18feb8['id']},{})[_0x61ff('0x26')](function(){return _0x5406dc;});}else{return _0x5406dc;}})['catch'](function(_0x415527){logger['error'](_0x61ff('0x54'),_0x415527);throw _0x415527;});}return _0x5406dc;})[_0x61ff('0x26')](respondWithResult(_0x47a25c,0xc9))[_0x61ff('0x4a')](handleError(_0x47a25c,null));};exports[_0x61ff('0x55')]=function(_0x28d5de,_0x39f36d){if(_0x28d5de[_0x61ff('0x4c')]['id']){delete _0x28d5de[_0x61ff('0x4c')]['id'];}return db[_0x61ff('0x2e')][_0x61ff('0x49')]({'where':{'id':_0x28d5de[_0x61ff('0x48')]['id']}})[_0x61ff('0x26')](handleEntityNotFound(_0x39f36d,null))[_0x61ff('0x26')](saveUpdates(_0x28d5de['body'],null))[_0x61ff('0x26')](respondWithResult(_0x39f36d,null))['catch'](handleError(_0x39f36d,null));};exports[_0x61ff('0x27')]=function(_0x22cb64,_0x4b8ebe){return db[_0x61ff('0x2e')][_0x61ff('0x49')]({'where':{'id':_0x22cb64[_0x61ff('0x48')]['id']}})[_0x61ff('0x26')](handleEntityNotFound(_0x4b8ebe,null))[_0x61ff('0x26')](removeEntity(_0x4b8ebe,null))['catch'](handleError(_0x4b8ebe,null));}; \ No newline at end of file +var _0x62b9=['filter','merge','options','CmContactHasItem','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','autoAssociation','error','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick'];(function(_0x123c3a,_0x25b178){var _0x50a376=function(_0x57bb48){while(--_0x57bb48){_0x123c3a['push'](_0x123c3a['shift']());}};_0x50a376(++_0x25b178);}(_0x62b9,0xad));var _0x962b=function(_0x49bab4,_0x2539ce){_0x49bab4=_0x49bab4-0x0;var _0x27fe3c=_0x62b9[_0x49bab4];return _0x27fe3c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x962b('0x0'));var jsonpatch=require(_0x962b('0x1'));var rp=require(_0x962b('0x2'));var moment=require(_0x962b('0x3'));var BPromise=require(_0x962b('0x4'));var Mustache=require(_0x962b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x962b('0x6'));var csv=require(_0x962b('0x7'));var ejs=require(_0x962b('0x8'));var fs=require('fs');var _=require(_0x962b('0x9'));var squel=require('squel');var crypto=require(_0x962b('0xa'));var jsforce=require(_0x962b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x962b('0x7'));var querystring=require('querystring');var Papa=require(_0x962b('0xc'));var Redis=require('ioredis');var authService=require(_0x962b('0xd'));var qs=require(_0x962b('0xe'));var as=require(_0x962b('0xf'));var hardwareService=require(_0x962b('0x10'));var logger=require('../../config/logger')(_0x962b('0x11'));var utils=require(_0x962b('0x12'));var config=require(_0x962b('0x13'));var db=require(_0x962b('0x14'))['db'];function respondWithStatusCode(_0x2085d4,_0x327856){_0x327856=_0x327856||0xcc;return function(_0x3cd9cd){if(_0x3cd9cd){return _0x2085d4[_0x962b('0x15')](_0x327856);}return _0x2085d4['status'](_0x327856)[_0x962b('0x16')]();};}function respondWithResult(_0x299405,_0x304f69){_0x304f69=_0x304f69||0xc8;return function(_0x46c4ad){if(_0x46c4ad){return _0x299405[_0x962b('0x17')](_0x304f69)[_0x962b('0x18')](_0x46c4ad);}};}function respondWithFilteredResult(_0x3d2042,_0x4bc086){return function(_0x424288){if(_0x424288){var _0x32b53b=_0x424288[_0x962b('0x19')],_0x662213=_0x4bc086['offset'],_0x260006=_0x4bc086['offset']+_0x4bc086[_0x962b('0x1a')],_0x4b2cd8;if(_0x260006>=_0x32b53b){_0x260006=_0x32b53b;_0x4b2cd8=0xc8;}else{_0x4b2cd8=0xce;}_0x3d2042[_0x962b('0x17')](_0x4b2cd8);return _0x3d2042[_0x962b('0x1b')](_0x962b('0x1c'),_0x662213+'-'+_0x260006+'/'+_0x32b53b)[_0x962b('0x18')](_0x424288);}return null;};}function patchUpdates(_0x599b6a){return function(_0x1c2a9a){try{jsonpatch[_0x962b('0x1d')](_0x1c2a9a,_0x599b6a,!![]);}catch(_0x39913c){return BPromise[_0x962b('0x1e')](_0x39913c);}return _0x1c2a9a['save']();};}function saveUpdates(_0x161f11,_0x44e068){return function(_0x252027){if(_0x252027){return _0x252027[_0x962b('0x1f')](_0x161f11)[_0x962b('0x20')](function(_0x159400){return _0x159400;});}return null;};}function removeEntity(_0x2f92df,_0x3a5616){return function(_0x13a229){if(_0x13a229){return _0x13a229[_0x962b('0x21')]()[_0x962b('0x20')](function(){var _0x201ad2=_0x13a229[_0x962b('0x22')]({'plain':!![]});var _0x3f44db='CmContactHasItems';return db[_0x962b('0x23')][_0x962b('0x21')]({'where':{'type':_0x3f44db,'resourceId':_0x201ad2['id']}})[_0x962b('0x20')](function(){return _0x13a229;});})['then'](function(){_0x2f92df[_0x962b('0x17')](0xcc)[_0x962b('0x16')]();});}};}function handleEntityNotFound(_0x20b2ae,_0x53c0c2){return function(_0x13cafc){if(!_0x13cafc){_0x20b2ae[_0x962b('0x15')](0x194);}return _0x13cafc;};}function handleError(_0x373050,_0x5326e7){_0x5326e7=_0x5326e7||0x1f4;return function(_0x3308d5){logger['error'](_0x3308d5[_0x962b('0x24')]);if(_0x3308d5[_0x962b('0x25')]){delete _0x3308d5['name'];}_0x373050[_0x962b('0x17')](_0x5326e7)[_0x962b('0x26')](_0x3308d5);};}exports['index']=function(_0x9c4bb4,_0x327bac){var _0x320ca4={},_0xacd73d={},_0x46e756={'count':0x0,'rows':[]};var _0x585254=_[_0x962b('0x27')](db['CmContactHasItem'][_0x962b('0x28')],function(_0x117b7c){return{'name':_0x117b7c[_0x962b('0x29')],'type':_0x117b7c[_0x962b('0x2a')][_0x962b('0x2b')]};});_0xacd73d[_0x962b('0x2c')]=_[_0x962b('0x27')](_0x585254,_0x962b('0x25'));_0xacd73d['query']=_[_0x962b('0x2d')](_0x9c4bb4[_0x962b('0x2e')]);_0xacd73d[_0x962b('0x2f')]=_[_0x962b('0x30')](_0xacd73d[_0x962b('0x2c')],_0xacd73d[_0x962b('0x2e')]);_0x320ca4[_0x962b('0x31')]=_[_0x962b('0x30')](_0xacd73d[_0x962b('0x2c')],qs[_0x962b('0x32')](_0x9c4bb4[_0x962b('0x2e')][_0x962b('0x32')]));_0x320ca4[_0x962b('0x31')]=_0x320ca4['attributes'][_0x962b('0x33')]?_0x320ca4[_0x962b('0x31')]:_0xacd73d[_0x962b('0x2c')];if(!_0x9c4bb4[_0x962b('0x2e')]['hasOwnProperty'](_0x962b('0x34'))){_0x320ca4['limit']=qs[_0x962b('0x1a')](_0x9c4bb4['query']['limit']);_0x320ca4['offset']=qs[_0x962b('0x35')](_0x9c4bb4[_0x962b('0x2e')][_0x962b('0x35')]);}_0x320ca4[_0x962b('0x36')]=qs[_0x962b('0x37')](_0x9c4bb4[_0x962b('0x2e')][_0x962b('0x37')]);_0x320ca4[_0x962b('0x38')]=qs[_0x962b('0x2f')](_[_0x962b('0x39')](_0x9c4bb4[_0x962b('0x2e')],_0xacd73d[_0x962b('0x2f')]),_0x585254);if(_0x9c4bb4[_0x962b('0x2e')][_0x962b('0x3a')]){_0x320ca4[_0x962b('0x38')]=_[_0x962b('0x3b')](_0x320ca4['where'],{'$or':_[_0x962b('0x27')](_0x585254,function(_0x4d4a13){if(_0x4d4a13[_0x962b('0x2a')]!=='VIRTUAL'){var _0x11167d={};_0x11167d[_0x4d4a13[_0x962b('0x25')]]={'$like':'%'+_0x9c4bb4[_0x962b('0x2e')]['filter']+'%'};return _0x11167d;}})});}_0x320ca4=_[_0x962b('0x3b')]({},_0x320ca4,_0x9c4bb4[_0x962b('0x3c')]);var _0x1fc8e3={'where':_0x320ca4[_0x962b('0x38')]};return db[_0x962b('0x3d')][_0x962b('0x19')](_0x1fc8e3)[_0x962b('0x20')](function(_0x472266){_0x46e756[_0x962b('0x19')]=_0x472266;if(_0x9c4bb4[_0x962b('0x2e')][_0x962b('0x3e')]){_0x320ca4['include']=[{'all':!![]}];}return db[_0x962b('0x3d')][_0x962b('0x3f')](_0x320ca4);})['then'](function(_0x104a49){_0x46e756[_0x962b('0x40')]=_0x104a49;return _0x46e756;})['then'](respondWithFilteredResult(_0x327bac,_0x320ca4))[_0x962b('0x41')](handleError(_0x327bac,null));};exports[_0x962b('0x42')]=function(_0x367340,_0x4471d4){var _0x1a006a={'raw':!![],'where':{'id':_0x367340[_0x962b('0x43')]['id']}},_0x2b4998={};_0x2b4998[_0x962b('0x2c')]=_[_0x962b('0x2d')](db[_0x962b('0x3d')][_0x962b('0x28')]);_0x2b4998[_0x962b('0x2e')]=_['keys'](_0x367340[_0x962b('0x2e')]);_0x2b4998[_0x962b('0x2f')]=_[_0x962b('0x30')](_0x2b4998['model'],_0x2b4998[_0x962b('0x2e')]);_0x1a006a[_0x962b('0x31')]=_[_0x962b('0x30')](_0x2b4998['model'],qs[_0x962b('0x32')](_0x367340[_0x962b('0x2e')][_0x962b('0x32')]));_0x1a006a[_0x962b('0x31')]=_0x1a006a[_0x962b('0x31')][_0x962b('0x33')]?_0x1a006a[_0x962b('0x31')]:_0x2b4998[_0x962b('0x2c')];if(_0x367340[_0x962b('0x2e')]['includeAll']){_0x1a006a[_0x962b('0x44')]=[{'all':!![]}];}_0x1a006a=_[_0x962b('0x3b')]({},_0x1a006a,_0x367340[_0x962b('0x3c')]);return db[_0x962b('0x3d')][_0x962b('0x45')](_0x1a006a)[_0x962b('0x20')](handleEntityNotFound(_0x4471d4,null))['then'](respondWithResult(_0x4471d4,null))[_0x962b('0x41')](handleError(_0x4471d4,null));};exports[_0x962b('0x46')]=function(_0x25987d,_0x38edf9){return db['CmContactHasItem']['create'](_0x25987d[_0x962b('0x47')],{})[_0x962b('0x20')](function(_0x55476b){var _0x343899=_0x25987d[_0x962b('0x48')][_0x962b('0x22')]({'plain':!![]});if(!_0x343899)throw new Error(_0x962b('0x49'));if(_0x343899['role']===_0x962b('0x48')){var _0xdc3a35=_0x55476b[_0x962b('0x22')]({'plain':!![]});var _0x29609c=_0x962b('0x4a');return db['UserProfileSection'][_0x962b('0x45')]({'where':{'name':_0x29609c,'userProfileId':_0x343899['userProfileId']},'raw':!![]})['then'](function(_0xd2703a){if(_0xd2703a&&_0xd2703a[_0x962b('0x4b')]===0x0){return db[_0x962b('0x23')][_0x962b('0x46')]({'name':_0xdc3a35[_0x962b('0x25')],'resourceId':_0xdc3a35['id'],'type':_0xd2703a['name'],'sectionId':_0xd2703a['id']},{})[_0x962b('0x20')](function(){return _0x55476b;});}else{return _0x55476b;}})[_0x962b('0x41')](function(_0x12676d){logger[_0x962b('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12676d);throw _0x12676d;});}return _0x55476b;})['then'](respondWithResult(_0x38edf9,0xc9))[_0x962b('0x41')](handleError(_0x38edf9,null));};exports[_0x962b('0x1f')]=function(_0x2032ae,_0x21f31f){if(_0x2032ae[_0x962b('0x47')]['id']){delete _0x2032ae[_0x962b('0x47')]['id'];}return db[_0x962b('0x3d')][_0x962b('0x45')]({'where':{'id':_0x2032ae[_0x962b('0x43')]['id']}})[_0x962b('0x20')](handleEntityNotFound(_0x21f31f,null))[_0x962b('0x20')](saveUpdates(_0x2032ae[_0x962b('0x47')],null))['then'](respondWithResult(_0x21f31f,null))[_0x962b('0x41')](handleError(_0x21f31f,null));};exports[_0x962b('0x21')]=function(_0x361e28,_0x382ca8){return db[_0x962b('0x3d')]['find']({'where':{'id':_0x361e28[_0x962b('0x43')]['id']}})[_0x962b('0x20')](handleEntityNotFound(_0x382ca8,null))['then'](removeEntity(_0x382ca8,null))[_0x962b('0x41')](handleError(_0x382ca8,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index e6cf704..46bf125 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84e7=['./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x84e7,0x122));var _0x784e=function(_0x1b5d4d,_0x3dcf70){_0x1b5d4d=_0x1b5d4d-0x0;var _0x4f87f2=_0x84e7[_0x1b5d4d];return _0x4f87f2;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));module[_0x784e('0x8')]=function(_0x133296,_0x48ed22){return _0x133296[_0x784e('0x9')]('CmContactHasItem',attributes,{'tableName':_0x784e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x5de6c9,_0x471538){var _0x4f45f6=function(_0xe0c086){while(--_0xe0c086){_0x5de6c9['push'](_0x5de6c9['shift']());}};_0x4f45f6(++_0x471538);}(_0x687b,0x14a));var _0xb687=function(_0x5bd953,_0x307788){_0x5bd953=_0x5bd953-0x0;var _0x4ac021=_0x687b[_0x5bd953];return _0x4ac021;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 3a4f6e5..5132616 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14c7=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','CmContactHasItem,\x20%s,\x20%s','message'];(function(_0x2bf752,_0xfcadf9){var _0x2ae7a9=function(_0x308b83){while(--_0x308b83){_0x2bf752['push'](_0x2bf752['shift']());}};_0x2ae7a9(++_0xfcadf9);}(_0x14c7,0x1d0));var _0x714c=function(_0xf5c6c0,_0x53cfba){_0xf5c6c0=_0xf5c6c0-0x0;var _0x3cfa76=_0x14c7[_0xf5c6c0];return _0x3cfa76;};'use strict';var _=require(_0x714c('0x0'));var util=require(_0x714c('0x1'));var moment=require(_0x714c('0x2'));var BPromise=require('bluebird');var rs=require(_0x714c('0x3'));var fs=require('fs');var Redis=require(_0x714c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x714c('0x5'));var logger=require(_0x714c('0x6'))(_0x714c('0x7'));var config=require(_0x714c('0x8'));var jayson=require(_0x714c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56650a,_0x32561e,_0x3ad60d){return new BPromise(function(_0x135373,_0x4596d0){return client[_0x714c('0xa')](_0x56650a,_0x3ad60d)[_0x714c('0xb')](function(_0x405dc7){logger[_0x714c('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x32561e,'request\x20sent');logger[_0x714c('0xd')](_0x714c('0xe'),_0x32561e,'request\x20sent',JSON[_0x714c('0xf')](_0x405dc7));if(_0x405dc7[_0x714c('0x10')]){if(_0x405dc7['error']['code']===0x1f4){logger[_0x714c('0x10')](_0x714c('0x11'),_0x32561e,_0x405dc7[_0x714c('0x10')][_0x714c('0x12')]);return _0x4596d0(_0x405dc7[_0x714c('0x10')][_0x714c('0x12')]);}logger['error'](_0x714c('0x11'),_0x32561e,_0x405dc7[_0x714c('0x10')][_0x714c('0x12')]);return _0x135373(_0x405dc7[_0x714c('0x10')][_0x714c('0x12')]);}else{logger[_0x714c('0xc')](_0x714c('0x11'),_0x32561e,_0x714c('0x13'));_0x135373(_0x405dc7[_0x714c('0x14')][_0x714c('0x12')]);}})['catch'](function(_0x59294b){logger[_0x714c('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x32561e,_0x59294b);_0x4596d0(_0x59294b);});});} \ No newline at end of file +var _0xd8e0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x55547d,_0x33d115){var _0x244162=function(_0x454bd4){while(--_0x454bd4){_0x55547d['push'](_0x55547d['shift']());}};_0x244162(++_0x33d115);}(_0xd8e0,0x111));var _0x0d8e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd8e0[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x0d8e('0x0'));var util=require(_0x0d8e('0x1'));var moment=require(_0x0d8e('0x2'));var BPromise=require(_0x0d8e('0x3'));var rs=require(_0x0d8e('0x4'));var fs=require('fs');var Redis=require(_0x0d8e('0x5'));var db=require(_0x0d8e('0x6'))['db'];var utils=require(_0x0d8e('0x7'));var logger=require(_0x0d8e('0x8'))(_0x0d8e('0x9'));var config=require(_0x0d8e('0xa'));var jayson=require(_0x0d8e('0xb'));var client=jayson[_0x0d8e('0xc')][_0x0d8e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x25f147,_0x37a624,_0x43befc){return new BPromise(function(_0x1bf76c,_0x4a714a){return client[_0x0d8e('0xe')](_0x25f147,_0x43befc)[_0x0d8e('0xf')](function(_0xa8436e){logger[_0x0d8e('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x37a624,_0x0d8e('0x11'));logger[_0x0d8e('0x12')](_0x0d8e('0x13'),_0x37a624,_0x0d8e('0x11'),JSON[_0x0d8e('0x14')](_0xa8436e));if(_0xa8436e['error']){if(_0xa8436e[_0x0d8e('0x15')]['code']===0x1f4){logger[_0x0d8e('0x15')](_0x0d8e('0x16'),_0x37a624,_0xa8436e[_0x0d8e('0x15')][_0x0d8e('0x17')]);return _0x4a714a(_0xa8436e[_0x0d8e('0x15')][_0x0d8e('0x17')]);}logger[_0x0d8e('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0x37a624,_0xa8436e['error'][_0x0d8e('0x17')]);return _0x1bf76c(_0xa8436e['error'][_0x0d8e('0x17')]);}else{logger[_0x0d8e('0x10')](_0x0d8e('0x16'),_0x37a624,_0x0d8e('0x11'));_0x1bf76c(_0xa8436e[_0x0d8e('0x18')][_0x0d8e('0x17')]);}})['catch'](function(_0x102ba3){logger[_0x0d8e('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0x37a624,_0x102ba3);_0x4a714a(_0x102ba3);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 9c65871..5017348 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x289e=['create','put','/:id','isAuthenticated','update','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x289e,0xbb));var _0xe289=function(_0x133c35,_0x2226ae){_0x133c35=_0x133c35-0x0;var _0x1e93fa=_0x289e[_0x133c35];return _0x1e93fa;};'use strict';var multer=require('multer');var util=require(_0xe289('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe289('0x1'));var router=express[_0xe289('0x2')]();var auth=require(_0xe289('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe289('0x4'));var controller=require(_0xe289('0x5'));router[_0xe289('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe289('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xe289('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe289('0x8')]);router[_0xe289('0x9')](_0xe289('0xa'),auth[_0xe289('0xb')](),controller[_0xe289('0xc')]);router['delete'](_0xe289('0xa'),auth[_0xe289('0xb')](),controller[_0xe289('0xd')]);module[_0xe289('0xe')]=router; \ No newline at end of file +var _0x8d49=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update','destroy','exports','multer'];(function(_0x442fab,_0x30eabf){var _0x3c1a32=function(_0x5ac7bf){while(--_0x5ac7bf){_0x442fab['push'](_0x442fab['shift']());}};_0x3c1a32(++_0x30eabf);}(_0x8d49,0x11f));var _0x98d4=function(_0x2a1473,_0x14d397){_0x2a1473=_0x2a1473-0x0;var _0x46be48=_0x8d49[_0x2a1473];return _0x46be48;};'use strict';var multer=require(_0x98d4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x98d4('0x1'));var express=require(_0x98d4('0x2'));var router=express['Router']();var auth=require(_0x98d4('0x3'));var interaction=require(_0x98d4('0x4'));var config=require(_0x98d4('0x5'));var controller=require('./cmContactHasItem.controller');router[_0x98d4('0x6')]('/',auth['isAuthenticated'](),controller[_0x98d4('0x7')]);router[_0x98d4('0x6')](_0x98d4('0x8'),auth[_0x98d4('0x9')](),controller['show']);router[_0x98d4('0xa')]('/',auth[_0x98d4('0x9')](),controller[_0x98d4('0xb')]);router[_0x98d4('0xc')](_0x98d4('0x8'),auth[_0x98d4('0x9')](),controller[_0x98d4('0xd')]);router['delete'](_0x98d4('0x8'),auth[_0x98d4('0x9')](),controller[_0x98d4('0xe')]);module[_0x98d4('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js index 0d9786d..c60aeb7 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1aa8=['STRING','sequelize','exports','INTEGER'];(function(_0x4c9116,_0x86f7b4){var _0x117ef0=function(_0x242e0c){while(--_0x242e0c){_0x4c9116['push'](_0x4c9116['shift']());}};_0x117ef0(++_0x86f7b4);}(_0x1aa8,0x109));var _0x81aa=function(_0x4c55bd,_0x161998){_0x4c55bd=_0x4c55bd-0x0;var _0x535043=_0x1aa8[_0x4c55bd];return _0x535043;};'use strict';var Sequelize=require(_0x81aa('0x0'));module[_0x81aa('0x1')]={'CmContactId':{'type':Sequelize[_0x81aa('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0x81aa('0x3')],'defaultValue':'','primaryKey':!![]}}; \ No newline at end of file +var _0xf85c=['INTEGER','STRING','sequelize','exports'];(function(_0x3a7949,_0x5ff89){var _0x56df57=function(_0x35c6f8){while(--_0x35c6f8){_0x3a7949['push'](_0x3a7949['shift']());}};_0x56df57(++_0x5ff89);}(_0xf85c,0x11e));var _0xcf85=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xf85c[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require(_0xcf85('0x0'));module[_0xcf85('0x1')]={'CmContactId':{'type':Sequelize[_0xcf85('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0xcf85('0x3')],'defaultValue':'','primaryKey':!![]}}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js index d6e3215..c9f966d 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dbe=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','CmContactHasPhones','UserProfileResource','then','error','stack','name','send','index','map','CmContactHasPhone','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','squel','jsforce'];(function(_0x2d24e2,_0x38c3af){var _0x330f61=function(_0x15c233){while(--_0x15c233){_0x2d24e2['push'](_0x2d24e2['shift']());}};_0x330f61(++_0x38c3af);}(_0x3dbe,0x1c4));var _0xe3db=function(_0x34fa0f,_0x4e3226){_0x34fa0f=_0x34fa0f-0x0;var _0x40f50f=_0x3dbe[_0x34fa0f];return _0x40f50f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe3db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3db('0x1'));var jsonpatch=require(_0xe3db('0x2'));var rp=require('request-promise');var moment=require(_0xe3db('0x3'));var BPromise=require(_0xe3db('0x4'));var Mustache=require(_0xe3db('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe3db('0x6'));var ejs=require(_0xe3db('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe3db('0x8'));var crypto=require('crypto');var jsforce=require(_0xe3db('0x9'));var deskjs=require(_0xe3db('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe3db('0xb'));var Papa=require('papaparse');var Redis=require(_0xe3db('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe3db('0xd'));var as=require(_0xe3db('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3db('0xf'))(_0xe3db('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5934cf,_0x5a9cae){_0x5a9cae=_0x5a9cae||0xcc;return function(_0x46d37d){if(_0x46d37d){return _0x5934cf['sendStatus'](_0x5a9cae);}return _0x5934cf[_0xe3db('0x11')](_0x5a9cae)[_0xe3db('0x12')]();};}function respondWithResult(_0x4acfc9,_0x1d0055){_0x1d0055=_0x1d0055||0xc8;return function(_0x9bf5e4){if(_0x9bf5e4){return _0x4acfc9[_0xe3db('0x11')](_0x1d0055)[_0xe3db('0x13')](_0x9bf5e4);}};}function respondWithFilteredResult(_0x5e524c,_0x4f0c54){return function(_0x15e5d5){if(_0x15e5d5){var _0x1fd6d1=_0x15e5d5[_0xe3db('0x14')],_0x14f77d=_0x4f0c54[_0xe3db('0x15')],_0x4f4178=_0x4f0c54['offset']+_0x4f0c54[_0xe3db('0x16')],_0x211d03;if(_0x4f4178>=_0x1fd6d1){_0x4f4178=_0x1fd6d1;_0x211d03=0xc8;}else{_0x211d03=0xce;}_0x5e524c[_0xe3db('0x11')](_0x211d03);return _0x5e524c[_0xe3db('0x17')](_0xe3db('0x18'),_0x14f77d+'-'+_0x4f4178+'/'+_0x1fd6d1)['json'](_0x15e5d5);}return null;};}function patchUpdates(_0x4d6f3e){return function(_0x430708){try{jsonpatch[_0xe3db('0x19')](_0x430708,_0x4d6f3e,!![]);}catch(_0x2b826c){return BPromise[_0xe3db('0x1a')](_0x2b826c);}return _0x430708[_0xe3db('0x1b')]();};}function saveUpdates(_0x1e2ce0,_0x3a279){return function(_0x2b7d1c){if(_0x2b7d1c){return _0x2b7d1c[_0xe3db('0x1c')](_0x1e2ce0)['then'](function(_0x4a5b9e){return _0x4a5b9e;});}return null;};}function removeEntity(_0x5c45b2,_0x5297c4){return function(_0x396416){if(_0x396416){return _0x396416[_0xe3db('0x1d')]()['then'](function(){var _0x581b99=_0x396416[_0xe3db('0x1e')]({'plain':!![]});var _0x9a6bea=_0xe3db('0x1f');return db[_0xe3db('0x20')][_0xe3db('0x1d')]({'where':{'type':_0x9a6bea,'resourceId':_0x581b99['id']}})['then'](function(){return _0x396416;});})[_0xe3db('0x21')](function(){_0x5c45b2['status'](0xcc)[_0xe3db('0x12')]();});}};}function handleEntityNotFound(_0x34ffe3,_0x1bdd85){return function(_0x3d6a70){if(!_0x3d6a70){_0x34ffe3['sendStatus'](0x194);}return _0x3d6a70;};}function handleError(_0xcfef41,_0x19a768){_0x19a768=_0x19a768||0x1f4;return function(_0x2928cd){logger[_0xe3db('0x22')](_0x2928cd[_0xe3db('0x23')]);if(_0x2928cd[_0xe3db('0x24')]){delete _0x2928cd['name'];}_0xcfef41[_0xe3db('0x11')](_0x19a768)[_0xe3db('0x25')](_0x2928cd);};}exports[_0xe3db('0x26')]=function(_0x531ae2,_0x3b9c93){var _0x5f08bd={},_0x12b5aa={},_0x3d7dd3={'count':0x0,'rows':[]};var _0x3369b3=_[_0xe3db('0x27')](db[_0xe3db('0x28')][_0xe3db('0x29')],function(_0x10797e){return{'name':_0x10797e[_0xe3db('0x2a')],'type':_0x10797e[_0xe3db('0x2b')][_0xe3db('0x2c')]};});_0x12b5aa[_0xe3db('0x2d')]=_[_0xe3db('0x27')](_0x3369b3,_0xe3db('0x24'));_0x12b5aa[_0xe3db('0x2e')]=_['keys'](_0x531ae2[_0xe3db('0x2e')]);_0x12b5aa['filters']=_['intersection'](_0x12b5aa['model'],_0x12b5aa[_0xe3db('0x2e')]);_0x5f08bd[_0xe3db('0x2f')]=_['intersection'](_0x12b5aa[_0xe3db('0x2d')],qs[_0xe3db('0x30')](_0x531ae2[_0xe3db('0x2e')][_0xe3db('0x30')]));_0x5f08bd['attributes']=_0x5f08bd[_0xe3db('0x2f')][_0xe3db('0x31')]?_0x5f08bd[_0xe3db('0x2f')]:_0x12b5aa[_0xe3db('0x2d')];if(!_0x531ae2[_0xe3db('0x2e')][_0xe3db('0x32')](_0xe3db('0x33'))){_0x5f08bd[_0xe3db('0x16')]=qs[_0xe3db('0x16')](_0x531ae2['query'][_0xe3db('0x16')]);_0x5f08bd[_0xe3db('0x15')]=qs[_0xe3db('0x15')](_0x531ae2[_0xe3db('0x2e')][_0xe3db('0x15')]);}_0x5f08bd['order']=qs[_0xe3db('0x34')](_0x531ae2[_0xe3db('0x2e')][_0xe3db('0x34')]);_0x5f08bd[_0xe3db('0x35')]=qs['filters'](_[_0xe3db('0x36')](_0x531ae2['query'],_0x12b5aa[_0xe3db('0x37')]),_0x3369b3);if(_0x531ae2[_0xe3db('0x2e')][_0xe3db('0x38')]){_0x5f08bd[_0xe3db('0x35')]=_['merge'](_0x5f08bd[_0xe3db('0x35')],{'$or':_[_0xe3db('0x27')](_0x3369b3,function(_0x50c713){if(_0x50c713[_0xe3db('0x2b')]!==_0xe3db('0x39')){var _0x3e698d={};_0x3e698d[_0x50c713[_0xe3db('0x24')]]={'$like':'%'+_0x531ae2[_0xe3db('0x2e')]['filter']+'%'};return _0x3e698d;}})});}_0x5f08bd=_[_0xe3db('0x3a')]({},_0x5f08bd,_0x531ae2[_0xe3db('0x3b')]);var _0x471808={'where':_0x5f08bd[_0xe3db('0x35')]};return db[_0xe3db('0x28')]['count'](_0x471808)[_0xe3db('0x21')](function(_0x261cac){_0x3d7dd3[_0xe3db('0x14')]=_0x261cac;if(_0x531ae2[_0xe3db('0x2e')]['includeAll']){_0x5f08bd[_0xe3db('0x3c')]=[{'all':!![]}];}return db['CmContactHasPhone'][_0xe3db('0x3d')](_0x5f08bd);})[_0xe3db('0x21')](function(_0x3acfaa){_0x3d7dd3[_0xe3db('0x3e')]=_0x3acfaa;return _0x3d7dd3;})[_0xe3db('0x21')](respondWithFilteredResult(_0x3b9c93,_0x5f08bd))[_0xe3db('0x3f')](handleError(_0x3b9c93,null));};exports[_0xe3db('0x40')]=function(_0x31737d,_0x28fd62){var _0x3d432f={'raw':!![],'where':{'id':_0x31737d['params']['id']}},_0x1b9cd8={};_0x1b9cd8['model']=_[_0xe3db('0x41')](db[_0xe3db('0x28')]['rawAttributes']);_0x1b9cd8[_0xe3db('0x2e')]=_[_0xe3db('0x41')](_0x31737d[_0xe3db('0x2e')]);_0x1b9cd8[_0xe3db('0x37')]=_[_0xe3db('0x42')](_0x1b9cd8[_0xe3db('0x2d')],_0x1b9cd8[_0xe3db('0x2e')]);_0x3d432f[_0xe3db('0x2f')]=_['intersection'](_0x1b9cd8['model'],qs[_0xe3db('0x30')](_0x31737d[_0xe3db('0x2e')]['fields']));_0x3d432f[_0xe3db('0x2f')]=_0x3d432f['attributes'][_0xe3db('0x31')]?_0x3d432f[_0xe3db('0x2f')]:_0x1b9cd8[_0xe3db('0x2d')];if(_0x31737d[_0xe3db('0x2e')][_0xe3db('0x43')]){_0x3d432f[_0xe3db('0x3c')]=[{'all':!![]}];}_0x3d432f=_['merge']({},_0x3d432f,_0x31737d[_0xe3db('0x3b')]);return db[_0xe3db('0x28')][_0xe3db('0x44')](_0x3d432f)['then'](handleEntityNotFound(_0x28fd62,null))[_0xe3db('0x21')](respondWithResult(_0x28fd62,null))[_0xe3db('0x3f')](handleError(_0x28fd62,null));};exports[_0xe3db('0x45')]=function(_0x466389,_0x12cffe){return db[_0xe3db('0x28')][_0xe3db('0x45')](_0x466389[_0xe3db('0x46')],{})[_0xe3db('0x21')](function(_0x1554fc){var _0x19e878=_0x466389[_0xe3db('0x47')][_0xe3db('0x1e')]({'plain':!![]});if(!_0x19e878)throw new Error(_0xe3db('0x48'));if(_0x19e878[_0xe3db('0x49')]==='user'){var _0x350f4f=_0x1554fc['get']({'plain':!![]});var _0x381c9c=_0xe3db('0x1f');return db[_0xe3db('0x4a')][_0xe3db('0x44')]({'where':{'name':_0x381c9c,'userProfileId':_0x19e878[_0xe3db('0x4b')]},'raw':!![]})[_0xe3db('0x21')](function(_0x25cb4d){if(_0x25cb4d&&_0x25cb4d['autoAssociation']===0x0){return db[_0xe3db('0x20')][_0xe3db('0x45')]({'name':_0x350f4f['name'],'resourceId':_0x350f4f['id'],'type':_0x25cb4d['name'],'sectionId':_0x25cb4d['id']},{})[_0xe3db('0x21')](function(){return _0x1554fc;});}else{return _0x1554fc;}})[_0xe3db('0x3f')](function(_0x45a9cd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45a9cd);throw _0x45a9cd;});}return _0x1554fc;})['then'](respondWithResult(_0x12cffe,0xc9))[_0xe3db('0x3f')](handleError(_0x12cffe,null));};exports[_0xe3db('0x1c')]=function(_0x4746b2,_0x378584){if(_0x4746b2[_0xe3db('0x46')]['id']){delete _0x4746b2[_0xe3db('0x46')]['id'];}return db['CmContactHasPhone'][_0xe3db('0x44')]({'where':{'id':_0x4746b2['params']['id']}})[_0xe3db('0x21')](handleEntityNotFound(_0x378584,null))[_0xe3db('0x21')](saveUpdates(_0x4746b2[_0xe3db('0x46')],null))['then'](respondWithResult(_0x378584,null))['catch'](handleError(_0x378584,null));};exports[_0xe3db('0x1d')]=function(_0x5b84ec,_0xe237b9){return db[_0xe3db('0x28')][_0xe3db('0x44')]({'where':{'id':_0x5b84ec[_0xe3db('0x4c')]['id']}})[_0xe3db('0x21')](handleEntityNotFound(_0xe237b9,null))[_0xe3db('0x21')](removeEntity(_0xe237b9,null))[_0xe3db('0x3f')](handleError(_0xe237b9,null));}; \ No newline at end of file +var _0x4c1a=['rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','html-pdf','eml-format','rimraf','request-promise','moment','util','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','limit','set','Content-Range','json','apply','reject','save','then','get','CmContactHasPhones','UserProfileResource','destroy','error','stack','name','send','CmContactHasPhone'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x4c1a,0x1b2));var _0xa4c1=function(_0x393255,_0x44b68d){_0x393255=_0x393255-0x0;var _0x2c68c9=_0x4c1a[_0x393255];return _0x2c68c9;};'use strict';var pdf=require(_0xa4c1('0x0'));var emlformat=require(_0xa4c1('0x1'));var rimraf=require(_0xa4c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa4c1('0x3'));var moment=require(_0xa4c1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4c1('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa4c1('0x6'));var fs=require('fs');var _=require(_0xa4c1('0x7'));var squel=require('squel');var crypto=require(_0xa4c1('0x8'));var jsforce=require(_0xa4c1('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa4c1('0xa'));var Papa=require(_0xa4c1('0xb'));var Redis=require(_0xa4c1('0xc'));var authService=require(_0xa4c1('0xd'));var qs=require(_0xa4c1('0xe'));var as=require(_0xa4c1('0xf'));var hardwareService=require(_0xa4c1('0x10'));var logger=require(_0xa4c1('0x11'))('api');var utils=require(_0xa4c1('0x12'));var config=require(_0xa4c1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f7184,_0x2c4bdd){_0x2c4bdd=_0x2c4bdd||0xcc;return function(_0x4e6b26){if(_0x4e6b26){return _0x3f7184['sendStatus'](_0x2c4bdd);}return _0x3f7184['status'](_0x2c4bdd)[_0xa4c1('0x14')]();};}function respondWithResult(_0x208540,_0x4e5d86){_0x4e5d86=_0x4e5d86||0xc8;return function(_0x5928b9){if(_0x5928b9){return _0x208540[_0xa4c1('0x15')](_0x4e5d86)['json'](_0x5928b9);}};}function respondWithFilteredResult(_0x4749cf,_0x30bdda){return function(_0x23f7e0){if(_0x23f7e0){var _0x9ea15=_0x23f7e0['count'],_0x1f9f62=_0x30bdda[_0xa4c1('0x16')],_0x9ab4dd=_0x30bdda[_0xa4c1('0x16')]+_0x30bdda[_0xa4c1('0x17')],_0x51a4a5;if(_0x9ab4dd>=_0x9ea15){_0x9ab4dd=_0x9ea15;_0x51a4a5=0xc8;}else{_0x51a4a5=0xce;}_0x4749cf[_0xa4c1('0x15')](_0x51a4a5);return _0x4749cf[_0xa4c1('0x18')](_0xa4c1('0x19'),_0x1f9f62+'-'+_0x9ab4dd+'/'+_0x9ea15)[_0xa4c1('0x1a')](_0x23f7e0);}return null;};}function patchUpdates(_0x3a8ed6){return function(_0x441236){try{jsonpatch[_0xa4c1('0x1b')](_0x441236,_0x3a8ed6,!![]);}catch(_0xe6f549){return BPromise[_0xa4c1('0x1c')](_0xe6f549);}return _0x441236[_0xa4c1('0x1d')]();};}function saveUpdates(_0x39359c,_0x1da925){return function(_0x965d10){if(_0x965d10){return _0x965d10['update'](_0x39359c)[_0xa4c1('0x1e')](function(_0x237198){return _0x237198;});}return null;};}function removeEntity(_0x2d4ffc,_0x292e33){return function(_0x57d21f){if(_0x57d21f){return _0x57d21f['destroy']()[_0xa4c1('0x1e')](function(){var _0x2db9cf=_0x57d21f[_0xa4c1('0x1f')]({'plain':!![]});var _0x515c59=_0xa4c1('0x20');return db[_0xa4c1('0x21')][_0xa4c1('0x22')]({'where':{'type':_0x515c59,'resourceId':_0x2db9cf['id']}})[_0xa4c1('0x1e')](function(){return _0x57d21f;});})[_0xa4c1('0x1e')](function(){_0x2d4ffc[_0xa4c1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43a103,_0x366a40){return function(_0x1fbcd0){if(!_0x1fbcd0){_0x43a103['sendStatus'](0x194);}return _0x1fbcd0;};}function handleError(_0x3f65a7,_0x234c92){_0x234c92=_0x234c92||0x1f4;return function(_0x3897ed){logger[_0xa4c1('0x23')](_0x3897ed[_0xa4c1('0x24')]);if(_0x3897ed[_0xa4c1('0x25')]){delete _0x3897ed[_0xa4c1('0x25')];}_0x3f65a7['status'](_0x234c92)[_0xa4c1('0x26')](_0x3897ed);};}exports['index']=function(_0x4be8b0,_0x2876af){var _0x2cab7e={},_0x5e6b89={},_0x52cf39={'count':0x0,'rows':[]};var _0x58f297=_['map'](db[_0xa4c1('0x27')][_0xa4c1('0x28')],function(_0x451850){return{'name':_0x451850['fieldName'],'type':_0x451850[_0xa4c1('0x29')][_0xa4c1('0x2a')]};});_0x5e6b89['model']=_[_0xa4c1('0x2b')](_0x58f297,_0xa4c1('0x25'));_0x5e6b89[_0xa4c1('0x2c')]=_[_0xa4c1('0x2d')](_0x4be8b0[_0xa4c1('0x2c')]);_0x5e6b89[_0xa4c1('0x2e')]=_[_0xa4c1('0x2f')](_0x5e6b89[_0xa4c1('0x30')],_0x5e6b89[_0xa4c1('0x2c')]);_0x2cab7e[_0xa4c1('0x31')]=_[_0xa4c1('0x2f')](_0x5e6b89[_0xa4c1('0x30')],qs['fields'](_0x4be8b0['query'][_0xa4c1('0x32')]));_0x2cab7e['attributes']=_0x2cab7e[_0xa4c1('0x31')]['length']?_0x2cab7e['attributes']:_0x5e6b89[_0xa4c1('0x30')];if(!_0x4be8b0[_0xa4c1('0x2c')][_0xa4c1('0x33')](_0xa4c1('0x34'))){_0x2cab7e[_0xa4c1('0x17')]=qs['limit'](_0x4be8b0[_0xa4c1('0x2c')]['limit']);_0x2cab7e[_0xa4c1('0x16')]=qs[_0xa4c1('0x16')](_0x4be8b0[_0xa4c1('0x2c')][_0xa4c1('0x16')]);}_0x2cab7e['order']=qs[_0xa4c1('0x35')](_0x4be8b0[_0xa4c1('0x2c')][_0xa4c1('0x35')]);_0x2cab7e[_0xa4c1('0x36')]=qs[_0xa4c1('0x2e')](_[_0xa4c1('0x37')](_0x4be8b0[_0xa4c1('0x2c')],_0x5e6b89[_0xa4c1('0x2e')]),_0x58f297);if(_0x4be8b0['query'][_0xa4c1('0x38')]){_0x2cab7e[_0xa4c1('0x36')]=_[_0xa4c1('0x39')](_0x2cab7e[_0xa4c1('0x36')],{'$or':_[_0xa4c1('0x2b')](_0x58f297,function(_0x2a394a){if(_0x2a394a['type']!==_0xa4c1('0x3a')){var _0x27694e={};_0x27694e[_0x2a394a[_0xa4c1('0x25')]]={'$like':'%'+_0x4be8b0[_0xa4c1('0x2c')][_0xa4c1('0x38')]+'%'};return _0x27694e;}})});}_0x2cab7e=_['merge']({},_0x2cab7e,_0x4be8b0['options']);var _0x1c1aec={'where':_0x2cab7e['where']};return db[_0xa4c1('0x27')][_0xa4c1('0x3b')](_0x1c1aec)[_0xa4c1('0x1e')](function(_0x3fcecf){_0x52cf39[_0xa4c1('0x3b')]=_0x3fcecf;if(_0x4be8b0[_0xa4c1('0x2c')][_0xa4c1('0x3c')]){_0x2cab7e[_0xa4c1('0x3d')]=[{'all':!![]}];}return db[_0xa4c1('0x27')][_0xa4c1('0x3e')](_0x2cab7e);})[_0xa4c1('0x1e')](function(_0x2523dd){_0x52cf39[_0xa4c1('0x3f')]=_0x2523dd;return _0x52cf39;})[_0xa4c1('0x1e')](respondWithFilteredResult(_0x2876af,_0x2cab7e))[_0xa4c1('0x40')](handleError(_0x2876af,null));};exports[_0xa4c1('0x41')]=function(_0x3c8c6d,_0x5cda11){var _0x3560bb={'raw':!![],'where':{'id':_0x3c8c6d[_0xa4c1('0x42')]['id']}},_0x58bd2e={};_0x58bd2e[_0xa4c1('0x30')]=_[_0xa4c1('0x2d')](db[_0xa4c1('0x27')][_0xa4c1('0x28')]);_0x58bd2e['query']=_[_0xa4c1('0x2d')](_0x3c8c6d['query']);_0x58bd2e[_0xa4c1('0x2e')]=_[_0xa4c1('0x2f')](_0x58bd2e[_0xa4c1('0x30')],_0x58bd2e[_0xa4c1('0x2c')]);_0x3560bb[_0xa4c1('0x31')]=_[_0xa4c1('0x2f')](_0x58bd2e[_0xa4c1('0x30')],qs[_0xa4c1('0x32')](_0x3c8c6d[_0xa4c1('0x2c')][_0xa4c1('0x32')]));_0x3560bb[_0xa4c1('0x31')]=_0x3560bb[_0xa4c1('0x31')][_0xa4c1('0x43')]?_0x3560bb[_0xa4c1('0x31')]:_0x58bd2e[_0xa4c1('0x30')];if(_0x3c8c6d[_0xa4c1('0x2c')][_0xa4c1('0x3c')]){_0x3560bb[_0xa4c1('0x3d')]=[{'all':!![]}];}_0x3560bb=_[_0xa4c1('0x39')]({},_0x3560bb,_0x3c8c6d[_0xa4c1('0x44')]);return db['CmContactHasPhone']['find'](_0x3560bb)[_0xa4c1('0x1e')](handleEntityNotFound(_0x5cda11,null))['then'](respondWithResult(_0x5cda11,null))[_0xa4c1('0x40')](handleError(_0x5cda11,null));};exports['create']=function(_0x3a2d57,_0x2d3b24){return db[_0xa4c1('0x27')][_0xa4c1('0x45')](_0x3a2d57[_0xa4c1('0x46')],{})[_0xa4c1('0x1e')](function(_0x57603f){var _0x2f09af=_0x3a2d57[_0xa4c1('0x47')][_0xa4c1('0x1f')]({'plain':!![]});if(!_0x2f09af)throw new Error(_0xa4c1('0x48'));if(_0x2f09af[_0xa4c1('0x49')]===_0xa4c1('0x47')){var _0x3a6f4d=_0x57603f['get']({'plain':!![]});var _0x5ef981=_0xa4c1('0x20');return db[_0xa4c1('0x4a')][_0xa4c1('0x4b')]({'where':{'name':_0x5ef981,'userProfileId':_0x2f09af[_0xa4c1('0x4c')]},'raw':!![]})[_0xa4c1('0x1e')](function(_0x2fc3ac){if(_0x2fc3ac&&_0x2fc3ac[_0xa4c1('0x4d')]===0x0){return db[_0xa4c1('0x21')][_0xa4c1('0x45')]({'name':_0x3a6f4d[_0xa4c1('0x25')],'resourceId':_0x3a6f4d['id'],'type':_0x2fc3ac[_0xa4c1('0x25')],'sectionId':_0x2fc3ac['id']},{})[_0xa4c1('0x1e')](function(){return _0x57603f;});}else{return _0x57603f;}})[_0xa4c1('0x40')](function(_0x2cadec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cadec);throw _0x2cadec;});}return _0x57603f;})['then'](respondWithResult(_0x2d3b24,0xc9))['catch'](handleError(_0x2d3b24,null));};exports[_0xa4c1('0x4e')]=function(_0x3194a5,_0xf09b3a){if(_0x3194a5['body']['id']){delete _0x3194a5[_0xa4c1('0x46')]['id'];}return db[_0xa4c1('0x27')][_0xa4c1('0x4b')]({'where':{'id':_0x3194a5['params']['id']}})[_0xa4c1('0x1e')](handleEntityNotFound(_0xf09b3a,null))[_0xa4c1('0x1e')](saveUpdates(_0x3194a5['body'],null))['then'](respondWithResult(_0xf09b3a,null))[_0xa4c1('0x40')](handleError(_0xf09b3a,null));};exports['destroy']=function(_0x19386e,_0xe7e5cb){return db[_0xa4c1('0x27')][_0xa4c1('0x4b')]({'where':{'id':_0x19386e[_0xa4c1('0x42')]['id']}})[_0xa4c1('0x1e')](handleEntityNotFound(_0xe7e5cb,null))[_0xa4c1('0x1e')](removeEntity(_0xe7e5cb,null))['catch'](handleError(_0xe7e5cb,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js index d279a6e..8078b81 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.model.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a16=['exports','cm_contact_has_phones','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasPhone.attributes'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x3a16,0x192));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x63a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x63a1('0x1'));var moment=require(_0x63a1('0x2'));var BPromise=require(_0x63a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63a1('0x4'));var rimraf=require(_0x63a1('0x5'));var config=require(_0x63a1('0x6'));var attributes=require(_0x63a1('0x7'));module[_0x63a1('0x8')]=function(_0x392dce,_0x14a8eb){return _0x392dce['define']('CmContactHasPhone',attributes,{'tableName':_0x63a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1404=['exports','define','cm_contact_has_phones','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasPhone.attributes'];(function(_0x382f72,_0x575a83){var _0x5ae106=function(_0x1ee3d7){while(--_0x1ee3d7){_0x382f72['push'](_0x382f72['shift']());}};_0x5ae106(++_0x575a83);}(_0x1404,0x1e3));var _0x4140=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1404[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4140('0x0'));var util=require(_0x4140('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4140('0x2'));var BPromise=require(_0x4140('0x3'));var rp=require(_0x4140('0x4'));var fs=require('fs');var path=require(_0x4140('0x5'));var rimraf=require(_0x4140('0x6'));var config=require(_0x4140('0x7'));var attributes=require(_0x4140('0x8'));module[_0x4140('0x9')]=function(_0x378389,_0x145ee4){return _0x378389[_0x4140('0xa')]('CmContactHasPhone',attributes,{'tableName':_0x4140('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js index dfbb416..1b4d47b 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa378=['code','CmContactHasPhone,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa378,0x8e));var _0x8a37=function(_0x221ee7,_0x4721c5){_0x221ee7=_0x221ee7-0x0;var _0x3ffb93=_0xa378[_0x221ee7];return _0x3ffb93;};'use strict';var _=require('lodash');var util=require(_0x8a37('0x0'));var moment=require(_0x8a37('0x1'));var BPromise=require(_0x8a37('0x2'));var rs=require(_0x8a37('0x3'));var fs=require('fs');var Redis=require(_0x8a37('0x4'));var db=require(_0x8a37('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a37('0x6'))(_0x8a37('0x7'));var config=require(_0x8a37('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8a37('0x9')][_0x8a37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d88,_0x371ae3,_0x49d389){return new BPromise(function(_0x4f47d1,_0xc0e2a7){return client[_0x8a37('0xb')](_0x1b4d88,_0x49d389)[_0x8a37('0xc')](function(_0x3ea9ef){logger[_0x8a37('0xd')]('CmContactHasPhone,\x20%s,\x20%s',_0x371ae3,'request\x20sent');logger[_0x8a37('0xe')](_0x8a37('0xf'),_0x371ae3,_0x8a37('0x10'),JSON[_0x8a37('0x11')](_0x3ea9ef));if(_0x3ea9ef[_0x8a37('0x12')]){if(_0x3ea9ef[_0x8a37('0x12')][_0x8a37('0x13')]===0x1f4){logger[_0x8a37('0x12')](_0x8a37('0x14'),_0x371ae3,_0x3ea9ef[_0x8a37('0x12')][_0x8a37('0x15')]);return _0xc0e2a7(_0x3ea9ef[_0x8a37('0x12')][_0x8a37('0x15')]);}logger[_0x8a37('0x12')](_0x8a37('0x14'),_0x371ae3,_0x3ea9ef[_0x8a37('0x12')][_0x8a37('0x15')]);return _0x4f47d1(_0x3ea9ef[_0x8a37('0x12')][_0x8a37('0x15')]);}else{logger[_0x8a37('0xd')](_0x8a37('0x14'),_0x371ae3,'request\x20sent');_0x4f47d1(_0x3ea9ef['result'][_0x8a37('0x15')]);}})[_0x8a37('0x16')](function(_0x1bb938){logger[_0x8a37('0x12')](_0x8a37('0x14'),_0x371ae3,_0x1bb938);_0xc0e2a7(_0x1bb938);});});} \ No newline at end of file +var _0xd457=['request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasPhone,\x20%s,\x20%s'];(function(_0x3b2397,_0x4d52e8){var _0x4a81ea=function(_0xf92c9e){while(--_0xf92c9e){_0x3b2397['push'](_0x3b2397['shift']());}};_0x4a81ea(++_0x4d52e8);}(_0xd457,0x1e9));var _0x7d45=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xd457[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7d45('0x0'));var util=require(_0x7d45('0x1'));var moment=require(_0x7d45('0x2'));var BPromise=require(_0x7d45('0x3'));var rs=require(_0x7d45('0x4'));var fs=require('fs');var Redis=require(_0x7d45('0x5'));var db=require(_0x7d45('0x6'))['db'];var utils=require(_0x7d45('0x7'));var logger=require(_0x7d45('0x8'))(_0x7d45('0x9'));var config=require(_0x7d45('0xa'));var jayson=require(_0x7d45('0xb'));var client=jayson[_0x7d45('0xc')][_0x7d45('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43d9dd,_0x18ea06,_0x509d62){return new BPromise(function(_0x3fe197,_0xcc9ec4){return client['request'](_0x43d9dd,_0x509d62)[_0x7d45('0xe')](function(_0x409c27){logger[_0x7d45('0xf')](_0x7d45('0x10'),_0x18ea06,_0x7d45('0x11'));logger['debug']('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x18ea06,'request\x20sent',JSON[_0x7d45('0x12')](_0x409c27));if(_0x409c27[_0x7d45('0x13')]){if(_0x409c27[_0x7d45('0x13')][_0x7d45('0x14')]===0x1f4){logger['error'](_0x7d45('0x10'),_0x18ea06,_0x409c27[_0x7d45('0x13')][_0x7d45('0x15')]);return _0xcc9ec4(_0x409c27[_0x7d45('0x13')]['message']);}logger[_0x7d45('0x13')](_0x7d45('0x10'),_0x18ea06,_0x409c27[_0x7d45('0x13')][_0x7d45('0x15')]);return _0x3fe197(_0x409c27['error'][_0x7d45('0x15')]);}else{logger[_0x7d45('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x18ea06,'request\x20sent');_0x3fe197(_0x409c27['result'][_0x7d45('0x15')]);}})[_0x7d45('0x16')](function(_0x4ddf7e){logger[_0x7d45('0x13')](_0x7d45('0x10'),_0x18ea06,_0x4ddf7e);_0xcc9ec4(_0x4ddf7e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js index 0ffc2cb..4be0d9b 100644 --- a/server/api/cmContactHasPhone/index.js +++ b/server/api/cmContactHasPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2831=['/:id','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','isAuthenticated','index','show','create','put'];(function(_0x38a96e,_0x15a25e){var _0x4ef457=function(_0x393a1e){while(--_0x393a1e){_0x38a96e['push'](_0x38a96e['shift']());}};_0x4ef457(++_0x15a25e);}(_0x2831,0x123));var _0x1283=function(_0xbfe61c,_0x13b08a){_0xbfe61c=_0xbfe61c-0x0;var _0x52922e=_0x2831[_0xbfe61c];return _0x52922e;};'use strict';var multer=require('multer');var util=require(_0x1283('0x0'));var path=require(_0x1283('0x1'));var timeout=require(_0x1283('0x2'));var express=require(_0x1283('0x3'));var router=express[_0x1283('0x4')]();var auth=require(_0x1283('0x5'));var interaction=require(_0x1283('0x6'));var config=require(_0x1283('0x7'));var controller=require(_0x1283('0x8'));router[_0x1283('0x9')]('/',auth[_0x1283('0xa')](),controller[_0x1283('0xb')]);router[_0x1283('0x9')]('/:id',auth[_0x1283('0xa')](),controller[_0x1283('0xc')]);router['post']('/',auth[_0x1283('0xa')](),controller[_0x1283('0xd')]);router[_0x1283('0xe')](_0x1283('0xf'),auth[_0x1283('0xa')](),controller[_0x1283('0x10')]);router['delete'](_0x1283('0xf'),auth[_0x1283('0xa')](),controller['destroy']);module[_0x1283('0x11')]=router; \ No newline at end of file +var _0xf1bb=['get','isAuthenticated','index','post','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller'];(function(_0x1512f2,_0x9e4a17){var _0x414707=function(_0x17e28d){while(--_0x17e28d){_0x1512f2['push'](_0x1512f2['shift']());}};_0x414707(++_0x9e4a17);}(_0xf1bb,0xb3));var _0xbf1b=function(_0x4e3c7c,_0x2120bb){_0x4e3c7c=_0x4e3c7c-0x0;var _0x43def5=_0xf1bb[_0x4e3c7c];return _0x43def5;};'use strict';var multer=require(_0xbf1b('0x0'));var util=require(_0xbf1b('0x1'));var path=require(_0xbf1b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf1b('0x3'));var router=express[_0xbf1b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbf1b('0x5'));var config=require(_0xbf1b('0x6'));var controller=require(_0xbf1b('0x7'));router[_0xbf1b('0x8')]('/',auth[_0xbf1b('0x9')](),controller[_0xbf1b('0xa')]);router[_0xbf1b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbf1b('0xb')]('/',auth[_0xbf1b('0x9')](),controller['create']);router[_0xbf1b('0xc')](_0xbf1b('0xd'),auth[_0xbf1b('0x9')](),controller[_0xbf1b('0xe')]);router[_0xbf1b('0xf')](_0xbf1b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf1b('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index e661b38..71593e5 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 _0x1c89=['values','stringify','BOOLEAN','sequelize','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','select','parse'];(function(_0x414032,_0x49f061){var _0x16da4d=function(_0x3a0b15){while(--_0x3a0b15){_0x414032['push'](_0x414032['shift']());}};_0x16da4d(++_0x49f061);}(_0x1c89,0x1df));var _0x91c8=function(_0x5dc0de,_0x25bba4){_0x5dc0de=_0x5dc0de-0x0;var _0x54ba0e=_0x1c89[_0x5dc0de];return _0x54ba0e;};'use strict';var Sequelize=require(_0x91c8('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x91c8('0x1')],'get':function(_0x5b4254){return this[_0x91c8('0x2')](_0x91c8('0x3'));}},'alias':{'type':Sequelize[_0x91c8('0x4')],'allowNull':![],'set':function(_0x4c5dfb){this[_0x91c8('0x5')](_0x91c8('0x3'),_0x4c5dfb?_0x4c5dfb:this['getDataValue'](_0x91c8('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x91c8('0x7')](_0x91c8('0x8')),'get':function(){if(this[_0x91c8('0x2')]('type')===_0x91c8('0x9')){return JSON[_0x91c8('0xa')](this[_0x91c8('0x2')](_0x91c8('0xb')));}else{return this[_0x91c8('0x2')](_0x91c8('0xb'));}},'set':function(_0x286562){if(Array['isArray'](_0x286562)){this[_0x91c8('0x5')](_0x91c8('0xb'),JSON[_0x91c8('0xc')](_0x286562));}else{this['setDataValue']('values',_0x286562);}}},'required':{'type':Sequelize[_0x91c8('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x9ea7=['select','parse','values','isArray','stringify','BOOLEAN','lodash','exports','alias','setDataValue','STRING','TEXT','long','getDataValue'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0x9ea7,0x110));var _0x79ea=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x9ea7[_0x217c2e];return _0x22b7d8;};'use strict';var Sequelize=require('sequelize');var _=require(_0x79ea('0x0'));module[_0x79ea('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x351e11){return this['getDataValue'](_0x79ea('0x2'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x521c9f){this[_0x79ea('0x3')](_0x79ea('0x2'),_0x521c9f?_0x521c9f:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x79ea('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x79ea('0x5')](_0x79ea('0x6')),'get':function(){if(this[_0x79ea('0x7')]('type')===_0x79ea('0x8')){return JSON[_0x79ea('0x9')](this[_0x79ea('0x7')](_0x79ea('0xa')));}else{return this[_0x79ea('0x7')]('values');}},'set':function(_0x6cffdb){if(Array[_0x79ea('0xb')](_0x6cffdb)){this[_0x79ea('0x3')](_0x79ea('0xa'),JSON[_0x79ea('0xc')](_0x6cffdb));}else{this[_0x79ea('0x3')]('values',_0x6cffdb);}}},'required':{'type':Sequelize[_0x79ea('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 6e7bee1..0f8874f 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 _0xc72a=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','body','destroy','find','create','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','send','index','CmCustomField','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes'];(function(_0x53f862,_0x5a76c3){var _0x2e8b3a=function(_0x5cb648){while(--_0x5cb648){_0x53f862['push'](_0x53f862['shift']());}};_0x2e8b3a(++_0x5a76c3);}(_0xc72a,0x188));var _0xac72=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xc72a[_0x2136d5];return _0x3bee2e;};'use strict';var pdf=require(_0xac72('0x0'));var emlformat=require(_0xac72('0x1'));var rimraf=require(_0xac72('0x2'));var zipdir=require(_0xac72('0x3'));var jsonpatch=require(_0xac72('0x4'));var rp=require(_0xac72('0x5'));var moment=require(_0xac72('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac72('0x7'));var path=require('path');var sox=require(_0xac72('0x8'));var csv=require(_0xac72('0x9'));var ejs=require(_0xac72('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xac72('0xb'));var crypto=require('crypto');var jsforce=require(_0xac72('0xc'));var deskjs=require(_0xac72('0xd'));var toCsv=require('to-csv');var querystring=require(_0xac72('0xe'));var Papa=require(_0xac72('0xf'));var Redis=require(_0xac72('0x10'));var authService=require(_0xac72('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xac72('0x12'));var hardwareService=require(_0xac72('0x13'));var logger=require(_0xac72('0x14'))('api');var utils=require(_0xac72('0x15'));var config=require(_0xac72('0x16'));var db=require(_0xac72('0x17'))['db'];function respondWithStatusCode(_0x314a5a,_0xf6427a){_0xf6427a=_0xf6427a||0xcc;return function(_0x4fb7bf){if(_0x4fb7bf){return _0x314a5a[_0xac72('0x18')](_0xf6427a);}return _0x314a5a[_0xac72('0x19')](_0xf6427a)[_0xac72('0x1a')]();};}function respondWithResult(_0xf7214c,_0xaf148){_0xaf148=_0xaf148||0xc8;return function(_0x40186a){if(_0x40186a){return _0xf7214c['status'](_0xaf148)[_0xac72('0x1b')](_0x40186a);}};}function respondWithFilteredResult(_0x30d0d5,_0x143e75){return function(_0x2ed884){if(_0x2ed884){var _0x4c08b1=_0x2ed884[_0xac72('0x1c')],_0x20addc=_0x143e75[_0xac72('0x1d')],_0x2e30c7=_0x143e75[_0xac72('0x1d')]+_0x143e75[_0xac72('0x1e')],_0x382eb9;if(_0x2e30c7>=_0x4c08b1){_0x2e30c7=_0x4c08b1;_0x382eb9=0xc8;}else{_0x382eb9=0xce;}_0x30d0d5['status'](_0x382eb9);return _0x30d0d5[_0xac72('0x1f')](_0xac72('0x20'),_0x20addc+'-'+_0x2e30c7+'/'+_0x4c08b1)[_0xac72('0x1b')](_0x2ed884);}return null;};}function patchUpdates(_0x3bb841){return function(_0x12d9c8){try{jsonpatch[_0xac72('0x21')](_0x12d9c8,_0x3bb841,!![]);}catch(_0x4b16a8){return BPromise[_0xac72('0x22')](_0x4b16a8);}return _0x12d9c8['save']();};}function saveUpdates(_0xf2c64c,_0x33c821){return function(_0x4cdf25){if(_0x4cdf25){return _0x4cdf25[_0xac72('0x23')](_0xf2c64c)['then'](function(_0x17f52a){return _0x17f52a;});}return null;};}function removeEntity(_0x264366,_0x16ed97){return function(_0x4258b7){if(_0x4258b7){return _0x4258b7['destroy']()[_0xac72('0x24')](function(){_0x264366[_0xac72('0x19')](0xcc)[_0xac72('0x1a')]();});}};}function handleEntityNotFound(_0x16f249,_0x2e1fb4){return function(_0x41d038){if(!_0x41d038){_0x16f249[_0xac72('0x18')](0x194);}return _0x41d038;};}function handleError(_0x43ffe5,_0x51d2f8){_0x51d2f8=_0x51d2f8||0x1f4;return function(_0x1444c5){logger[_0xac72('0x25')](_0x1444c5[_0xac72('0x26')]);if(_0x1444c5['name']){delete _0x1444c5['name'];}_0x43ffe5[_0xac72('0x19')](_0x51d2f8)[_0xac72('0x27')](_0x1444c5);};}exports[_0xac72('0x28')]=function(_0xec7229,_0x4dd86e){var _0x772278={},_0x55cbe5={},_0x537efd={'count':0x0,'rows':[]};var _0x172baa=_['map'](db[_0xac72('0x29')][_0xac72('0x2a')],function(_0x3a39d1){return{'name':_0x3a39d1['fieldName'],'type':_0x3a39d1[_0xac72('0x2b')][_0xac72('0x2c')]};});_0x55cbe5['model']=_['differenceBy'](_['map'](_0x172baa,_0xac72('0x2d')),['name']);_0x55cbe5[_0xac72('0x2e')]=_[_0xac72('0x2f')](_0xec7229['query']);_0x55cbe5[_0xac72('0x30')]=_[_0xac72('0x31')](_0x55cbe5[_0xac72('0x32')],_0x55cbe5[_0xac72('0x2e')]);_0x772278['attributes']=_[_0xac72('0x31')](_0x55cbe5[_0xac72('0x32')],qs[_0xac72('0x33')](_0xec7229[_0xac72('0x2e')][_0xac72('0x33')]));_0x772278[_0xac72('0x34')]=_0x772278[_0xac72('0x34')][_0xac72('0x35')]?_0x772278[_0xac72('0x34')]:_0x55cbe5['model'];if(!_0xec7229[_0xac72('0x2e')][_0xac72('0x36')](_0xac72('0x37'))){_0x772278[_0xac72('0x1e')]=qs[_0xac72('0x1e')](_0xec7229[_0xac72('0x2e')][_0xac72('0x1e')]);_0x772278[_0xac72('0x1d')]=qs[_0xac72('0x1d')](_0xec7229[_0xac72('0x2e')]['offset']);}_0x772278[_0xac72('0x38')]=qs[_0xac72('0x39')](_0xec7229[_0xac72('0x2e')][_0xac72('0x39')]);_0x772278[_0xac72('0x3a')]=qs[_0xac72('0x30')](_[_0xac72('0x3b')](_0xec7229[_0xac72('0x2e')],_0x55cbe5[_0xac72('0x30')]),_0x172baa);if(_0xec7229['query'][_0xac72('0x3c')]){_0x772278['where']=_[_0xac72('0x3d')](_0x772278[_0xac72('0x3a')],{'$or':_['map'](_0x172baa,function(_0x3e26c4){if(_0x3e26c4[_0xac72('0x2b')]!==_0xac72('0x3e')){var _0x2913e0={};_0x2913e0[_0x3e26c4[_0xac72('0x2d')]]={'$like':'%'+_0xec7229['query']['filter']+'%'};return _0x2913e0;}})});}_0x772278=_[_0xac72('0x3d')]({},_0x772278,_0xec7229[_0xac72('0x3f')]);var _0x2fc954={'where':_0x772278['where']};return db[_0xac72('0x29')][_0xac72('0x1c')](_0x2fc954)[_0xac72('0x24')](function(_0x290c22){_0x537efd[_0xac72('0x1c')]=_0x290c22;if(_0xec7229[_0xac72('0x2e')]['includeAll']){_0x772278[_0xac72('0x40')]=[{'all':!![]}];}return db[_0xac72('0x29')][_0xac72('0x41')](_0x772278);})[_0xac72('0x24')](function(_0x2a2a6e){_0x537efd[_0xac72('0x42')]=_0x2a2a6e;return _0x537efd;})[_0xac72('0x24')](respondWithFilteredResult(_0x4dd86e,_0x772278))[_0xac72('0x43')](handleError(_0x4dd86e,null));};exports[_0xac72('0x44')]=function(_0x46f556,_0x1e95d1){var _0x1a4c6={'raw':!![],'where':{'id':_0x46f556[_0xac72('0x45')]['id']}},_0x173f9c={};_0x173f9c[_0xac72('0x32')]=_[_0xac72('0x2f')](db[_0xac72('0x29')][_0xac72('0x2a')]);_0x173f9c['query']=_[_0xac72('0x2f')](_0x46f556['query']);_0x173f9c[_0xac72('0x30')]=_[_0xac72('0x31')](_0x173f9c['model'],_0x173f9c['query']);_0x1a4c6['attributes']=_[_0xac72('0x31')](_0x173f9c['model'],qs['fields'](_0x46f556[_0xac72('0x2e')][_0xac72('0x33')]));_0x1a4c6[_0xac72('0x34')]=_0x1a4c6['attributes'][_0xac72('0x35')]?_0x1a4c6[_0xac72('0x34')]:_0x173f9c[_0xac72('0x32')];if(_0x46f556[_0xac72('0x2e')][_0xac72('0x46')]){_0x1a4c6['include']=[{'all':!![]}];}_0x1a4c6=_['merge']({},_0x1a4c6,_0x46f556[_0xac72('0x3f')]);return db[_0xac72('0x29')]['find'](_0x1a4c6)[_0xac72('0x24')](handleEntityNotFound(_0x1e95d1,null))[_0xac72('0x24')](respondWithResult(_0x1e95d1,null))[_0xac72('0x43')](handleError(_0x1e95d1,null));};exports[_0xac72('0x23')]=function(_0xf221ff,_0x1ecccf){if(_0xf221ff['body']['id']){delete _0xf221ff[_0xac72('0x47')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0xf221ff[_0xac72('0x45')]['id']}})[_0xac72('0x24')](handleEntityNotFound(_0x1ecccf,null))[_0xac72('0x24')](saveUpdates(_0xf221ff[_0xac72('0x47')],null))[_0xac72('0x24')](respondWithResult(_0x1ecccf,null))['catch'](handleError(_0x1ecccf,null));};exports[_0xac72('0x48')]=function(_0x2c0796,_0x6a3e23){return db['CmCustomField'][_0xac72('0x49')]({'where':{'id':_0x2c0796[_0xac72('0x45')]['id']}})['then'](handleEntityNotFound(_0x6a3e23,null))[_0xac72('0x24')](removeEntity(_0x6a3e23,null))['catch'](handleError(_0x6a3e23,null));};exports[_0xac72('0x4a')]=function(_0x4ef0ed,_0x2983d7){var _0xa9bf68;return db['sequelize'][_0xac72('0x4b')](function(_0x29e21e){return db['CmCustomField']['create'](_0x4ef0ed['body'],{'transaction':_0x29e21e})[_0xac72('0x24')](function(_0x520218){_0xa9bf68=_0x520218;var _0x1f38d3={'type':db[_0xac72('0x4c')][_0xac72('0x4d')],'transaction':_0x29e21e};switch(_0x4ef0ed[_0xac72('0x47')][_0xac72('0x2b')]){case'text':_0x1f38d3[_0xac72('0x2b')]=db[_0xac72('0x4c')]['TEXT'];break;case _0xac72('0x4e'):_0x1f38d3[_0xac72('0x2b')]=db['Sequelize'][_0xac72('0x4f')];break;case _0xac72('0x50'):_0x1f38d3[_0xac72('0x2b')]=db[_0xac72('0x4c')][_0xac72('0x51')];_0x1f38d3[_0xac72('0x52')]=![];break;default:}return db[_0xac72('0x53')][_0xac72('0x54')][_0xac72('0x55')](_0xac72('0x56'),util[_0xac72('0x57')](_0xac72('0x58'),_0xa9bf68['id']),_0x1f38d3);})[_0xac72('0x24')](function(){return _0xa9bf68;});})[_0xac72('0x24')](respondWithResult(_0x2983d7,0xc9))[_0xac72('0x43')](handleError(_0x2983d7,null));}; \ No newline at end of file +var _0x77b5=['BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','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','limit','apply','reject','save','update','destroy','then','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','merge','filter','options','includeAll','findAll','rows','catch','show','include','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','switch'];(function(_0x319855,_0x55a20d){var _0xfb7f50=function(_0x391c7f){while(--_0x391c7f){_0x319855['push'](_0x319855['shift']());}};_0xfb7f50(++_0x55a20d);}(_0x77b5,0x16f));var _0x577b=function(_0x253d18,_0x414538){_0x253d18=_0x253d18-0x0;var _0x120401=_0x77b5[_0x253d18];return _0x120401;};'use strict';var pdf=require(_0x577b('0x0'));var emlformat=require(_0x577b('0x1'));var rimraf=require(_0x577b('0x2'));var zipdir=require(_0x577b('0x3'));var jsonpatch=require(_0x577b('0x4'));var rp=require('request-promise');var moment=require(_0x577b('0x5'));var BPromise=require(_0x577b('0x6'));var Mustache=require('mustache');var util=require(_0x577b('0x7'));var path=require(_0x577b('0x8'));var sox=require(_0x577b('0x9'));var csv=require(_0x577b('0xa'));var ejs=require(_0x577b('0xb'));var fs=require('fs');var _=require(_0x577b('0xc'));var squel=require(_0x577b('0xd'));var crypto=require(_0x577b('0xe'));var jsforce=require(_0x577b('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x577b('0x10'));var Papa=require('papaparse');var Redis=require(_0x577b('0x11'));var authService=require(_0x577b('0x12'));var qs=require(_0x577b('0x13'));var as=require(_0x577b('0x14'));var hardwareService=require(_0x577b('0x15'));var logger=require(_0x577b('0x16'))(_0x577b('0x17'));var utils=require(_0x577b('0x18'));var config=require(_0x577b('0x19'));var db=require(_0x577b('0x1a'))['db'];function respondWithStatusCode(_0x16ce2f,_0x3b1ea6){_0x3b1ea6=_0x3b1ea6||0xcc;return function(_0x46fbb8){if(_0x46fbb8){return _0x16ce2f[_0x577b('0x1b')](_0x3b1ea6);}return _0x16ce2f[_0x577b('0x1c')](_0x3b1ea6)[_0x577b('0x1d')]();};}function respondWithResult(_0xa26945,_0x54d111){_0x54d111=_0x54d111||0xc8;return function(_0x2c5064){if(_0x2c5064){return _0xa26945[_0x577b('0x1c')](_0x54d111)[_0x577b('0x1e')](_0x2c5064);}};}function respondWithFilteredResult(_0x504237,_0x4117dc){return function(_0x35e86d){if(_0x35e86d){var _0xeaa137=_0x35e86d[_0x577b('0x1f')],_0x59d82c=_0x4117dc['offset'],_0x39c3f9=_0x4117dc['offset']+_0x4117dc[_0x577b('0x20')],_0x454e9f;if(_0x39c3f9>=_0xeaa137){_0x39c3f9=_0xeaa137;_0x454e9f=0xc8;}else{_0x454e9f=0xce;}_0x504237['status'](_0x454e9f);return _0x504237['set']('Content-Range',_0x59d82c+'-'+_0x39c3f9+'/'+_0xeaa137)[_0x577b('0x1e')](_0x35e86d);}return null;};}function patchUpdates(_0x497fab){return function(_0x20ab1a){try{jsonpatch[_0x577b('0x21')](_0x20ab1a,_0x497fab,!![]);}catch(_0x29b1ee){return BPromise[_0x577b('0x22')](_0x29b1ee);}return _0x20ab1a[_0x577b('0x23')]();};}function saveUpdates(_0xec96e3,_0x32b8bb){return function(_0x1cc8c7){if(_0x1cc8c7){return _0x1cc8c7[_0x577b('0x24')](_0xec96e3)['then'](function(_0x576c45){return _0x576c45;});}return null;};}function removeEntity(_0x3688ce,_0x5a629a){return function(_0x17741b){if(_0x17741b){return _0x17741b[_0x577b('0x25')]()[_0x577b('0x26')](function(){_0x3688ce[_0x577b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27811e,_0x42a6ec){return function(_0x338bc2){if(!_0x338bc2){_0x27811e[_0x577b('0x1b')](0x194);}return _0x338bc2;};}function handleError(_0x5030c5,_0x6bbb39){_0x6bbb39=_0x6bbb39||0x1f4;return function(_0x52e826){logger[_0x577b('0x27')](_0x52e826['stack']);if(_0x52e826[_0x577b('0x28')]){delete _0x52e826[_0x577b('0x28')];}_0x5030c5[_0x577b('0x1c')](_0x6bbb39)[_0x577b('0x29')](_0x52e826);};}exports[_0x577b('0x2a')]=function(_0x6ac3a3,_0x168e21){var _0x428752={},_0x5c526b={},_0x4dada3={'count':0x0,'rows':[]};var _0x198694=_['map'](db[_0x577b('0x2b')][_0x577b('0x2c')],function(_0x90b416){return{'name':_0x90b416[_0x577b('0x2d')],'type':_0x90b416[_0x577b('0x2e')][_0x577b('0x2f')]};});_0x5c526b[_0x577b('0x30')]=_[_0x577b('0x31')](_[_0x577b('0x32')](_0x198694,_0x577b('0x28')),[_0x577b('0x28')]);_0x5c526b[_0x577b('0x33')]=_[_0x577b('0x34')](_0x6ac3a3[_0x577b('0x33')]);_0x5c526b[_0x577b('0x35')]=_[_0x577b('0x36')](_0x5c526b[_0x577b('0x30')],_0x5c526b[_0x577b('0x33')]);_0x428752['attributes']=_[_0x577b('0x36')](_0x5c526b[_0x577b('0x30')],qs[_0x577b('0x37')](_0x6ac3a3[_0x577b('0x33')]['fields']));_0x428752['attributes']=_0x428752[_0x577b('0x38')][_0x577b('0x39')]?_0x428752['attributes']:_0x5c526b[_0x577b('0x30')];if(!_0x6ac3a3[_0x577b('0x33')]['hasOwnProperty'](_0x577b('0x3a'))){_0x428752[_0x577b('0x20')]=qs[_0x577b('0x20')](_0x6ac3a3[_0x577b('0x33')][_0x577b('0x20')]);_0x428752['offset']=qs['offset'](_0x6ac3a3['query'][_0x577b('0x3b')]);}_0x428752[_0x577b('0x3c')]=qs[_0x577b('0x3d')](_0x6ac3a3[_0x577b('0x33')]['sort']);_0x428752[_0x577b('0x3e')]=qs[_0x577b('0x35')](_['pick'](_0x6ac3a3['query'],_0x5c526b[_0x577b('0x35')]),_0x198694);if(_0x6ac3a3[_0x577b('0x33')]['filter']){_0x428752[_0x577b('0x3e')]=_[_0x577b('0x3f')](_0x428752[_0x577b('0x3e')],{'$or':_[_0x577b('0x32')](_0x198694,function(_0x31b5e2){if(_0x31b5e2[_0x577b('0x2e')]!=='VIRTUAL'){var _0x40bc17={};_0x40bc17[_0x31b5e2[_0x577b('0x28')]]={'$like':'%'+_0x6ac3a3['query'][_0x577b('0x40')]+'%'};return _0x40bc17;}})});}_0x428752=_[_0x577b('0x3f')]({},_0x428752,_0x6ac3a3[_0x577b('0x41')]);var _0x30e52a={'where':_0x428752[_0x577b('0x3e')]};return db[_0x577b('0x2b')][_0x577b('0x1f')](_0x30e52a)[_0x577b('0x26')](function(_0x37bf75){_0x4dada3[_0x577b('0x1f')]=_0x37bf75;if(_0x6ac3a3['query'][_0x577b('0x42')]){_0x428752['include']=[{'all':!![]}];}return db[_0x577b('0x2b')][_0x577b('0x43')](_0x428752);})[_0x577b('0x26')](function(_0x823469){_0x4dada3[_0x577b('0x44')]=_0x823469;return _0x4dada3;})['then'](respondWithFilteredResult(_0x168e21,_0x428752))[_0x577b('0x45')](handleError(_0x168e21,null));};exports[_0x577b('0x46')]=function(_0x503838,_0x1f86b7){var _0x2ecc01={'raw':!![],'where':{'id':_0x503838['params']['id']}},_0x59d2ac={};_0x59d2ac[_0x577b('0x30')]=_[_0x577b('0x34')](db[_0x577b('0x2b')]['rawAttributes']);_0x59d2ac[_0x577b('0x33')]=_[_0x577b('0x34')](_0x503838[_0x577b('0x33')]);_0x59d2ac[_0x577b('0x35')]=_[_0x577b('0x36')](_0x59d2ac[_0x577b('0x30')],_0x59d2ac[_0x577b('0x33')]);_0x2ecc01[_0x577b('0x38')]=_[_0x577b('0x36')](_0x59d2ac[_0x577b('0x30')],qs[_0x577b('0x37')](_0x503838[_0x577b('0x33')][_0x577b('0x37')]));_0x2ecc01['attributes']=_0x2ecc01[_0x577b('0x38')][_0x577b('0x39')]?_0x2ecc01[_0x577b('0x38')]:_0x59d2ac['model'];if(_0x503838[_0x577b('0x33')][_0x577b('0x42')]){_0x2ecc01[_0x577b('0x47')]=[{'all':!![]}];}_0x2ecc01=_[_0x577b('0x3f')]({},_0x2ecc01,_0x503838[_0x577b('0x41')]);return db[_0x577b('0x2b')][_0x577b('0x48')](_0x2ecc01)[_0x577b('0x26')](handleEntityNotFound(_0x1f86b7,null))[_0x577b('0x26')](respondWithResult(_0x1f86b7,null))[_0x577b('0x45')](handleError(_0x1f86b7,null));};exports[_0x577b('0x24')]=function(_0x2d4091,_0x6b7d1b){if(_0x2d4091[_0x577b('0x49')]['id']){delete _0x2d4091[_0x577b('0x49')]['id'];}return db['CmCustomField'][_0x577b('0x48')]({'where':{'id':_0x2d4091[_0x577b('0x4a')]['id']}})[_0x577b('0x26')](handleEntityNotFound(_0x6b7d1b,null))[_0x577b('0x26')](saveUpdates(_0x2d4091[_0x577b('0x49')],null))[_0x577b('0x26')](respondWithResult(_0x6b7d1b,null))['catch'](handleError(_0x6b7d1b,null));};exports[_0x577b('0x25')]=function(_0x2e2437,_0x11ff55){return db[_0x577b('0x2b')][_0x577b('0x48')]({'where':{'id':_0x2e2437[_0x577b('0x4a')]['id']}})[_0x577b('0x26')](handleEntityNotFound(_0x11ff55,null))[_0x577b('0x26')](removeEntity(_0x11ff55,null))[_0x577b('0x45')](handleError(_0x11ff55,null));};exports[_0x577b('0x4b')]=function(_0x19cba4,_0xa8dde4){var _0x22e27b;return db[_0x577b('0x4c')][_0x577b('0x4d')](function(_0x4c06e8){return db['CmCustomField'][_0x577b('0x4b')](_0x19cba4[_0x577b('0x49')],{'transaction':_0x4c06e8})[_0x577b('0x26')](function(_0x52b4fd){_0x22e27b=_0x52b4fd;var _0x15ec99={'type':db[_0x577b('0x4e')][_0x577b('0x4f')],'transaction':_0x4c06e8};switch(_0x19cba4['body'][_0x577b('0x2e')]){case _0x577b('0x50'):_0x15ec99[_0x577b('0x2e')]=db[_0x577b('0x4e')][_0x577b('0x4f')];break;case _0x577b('0x51'):_0x15ec99[_0x577b('0x2e')]=db[_0x577b('0x4e')]['INTEGER'];break;case _0x577b('0x52'):_0x15ec99['type']=db[_0x577b('0x4e')][_0x577b('0x53')];_0x15ec99[_0x577b('0x54')]=![];break;default:}return db['sequelize'][_0x577b('0x55')][_0x577b('0x56')](_0x577b('0x57'),util[_0x577b('0x58')](_0x577b('0x59'),_0x22e27b['id']),_0x15ec99);})['then'](function(){return _0x22e27b;});})['then'](respondWithResult(_0xa8dde4,0xc9))[_0x577b('0x45')](handleError(_0xa8dde4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8544630..108cb9b 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 _0xb299=['request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x325654,_0x4e6fe1){var _0x994fc7=function(_0x3a0d47){while(--_0x3a0d47){_0x325654['push'](_0x325654['shift']());}};_0x994fc7(++_0x4e6fe1);}(_0xb299,0x19b));var _0x9b29=function(_0x3fb5be,_0x3d8dac){_0x3fb5be=_0x3fb5be-0x0;var _0x3735f1=_0xb299[_0x3fb5be];return _0x3735f1;};'use strict';var _=require(_0x9b29('0x0'));var util=require('util');var logger=require(_0x9b29('0x1'))(_0x9b29('0x2'));var moment=require(_0x9b29('0x3'));var BPromise=require(_0x9b29('0x4'));var rp=require(_0x9b29('0x5'));var fs=require('fs');var path=require(_0x9b29('0x6'));var rimraf=require(_0x9b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b29('0x8'));module[_0x9b29('0x9')]=function(_0x4da7ce,_0x321436){return _0x4da7ce[_0x9b29('0xa')](_0x9b29('0xb'),attributes,{'tableName':_0x9b29('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd23d=['bluebird','request-promise','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','api','moment'];(function(_0x5e794f,_0x4168b2){var _0x521552=function(_0xfb51eb){while(--_0xfb51eb){_0x5e794f['push'](_0x5e794f['shift']());}};_0x521552(++_0x4168b2);}(_0xd23d,0xa0));var _0xdd23=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xd23d[_0x33080e];return _0x407395;};'use strict';var _=require(_0xdd23('0x0'));var util=require(_0xdd23('0x1'));var logger=require(_0xdd23('0x2'))(_0xdd23('0x3'));var moment=require(_0xdd23('0x4'));var BPromise=require(_0xdd23('0x5'));var rp=require(_0xdd23('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd23('0x7'));module[_0xdd23('0x8')]=function(_0x7232e8,_0xa5bdac){return _0x7232e8[_0xdd23('0x9')](_0xdd23('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 7bb08d8..02daea8 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','util'];(function(_0x10ad0e,_0x511c19){var _0x5eecd4=function(_0x62af1){while(--_0x62af1){_0x10ad0e['push'](_0x10ad0e['shift']());}};_0x5eecd4(++_0x511c19);}(_0xedd9,0xfc));var _0x9edd=function(_0x1e5a4c,_0x4edd68){_0x1e5a4c=_0x1e5a4c-0x0;var _0xfafa5e=_0xedd9[_0x1e5a4c];return _0xfafa5e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('CmCustomField,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xb903=['http','request','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','CmCustomField,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b93c5,_0x393266){var _0x1cfab5=function(_0x58c905){while(--_0x58c905){_0x1b93c5['push'](_0x1b93c5['shift']());}};_0x1cfab5(++_0x393266);}(_0xb903,0x185));var _0x3b90=function(_0x2fa7b1,_0x4e906d){_0x2fa7b1=_0x2fa7b1-0x0;var _0x26172d=_0xb903[_0x2fa7b1];return _0x26172d;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('CmCustomField,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e590b1a..4caa966 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 _0x180d=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x180d,0x10f));var _0xd180=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x180d[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0xd180('0x0'));var util=require(_0xd180('0x1'));var path=require(_0xd180('0x2'));var timeout=require('connect-timeout');var express=require(_0xd180('0x3'));var router=express[_0xd180('0x4')]();var auth=require(_0xd180('0x5'));var interaction=require(_0xd180('0x6'));var config=require('../../config/environment');var controller=require(_0xd180('0x7'));router[_0xd180('0x8')]('/',auth[_0xd180('0x9')](),controller[_0xd180('0xa')]);router[_0xd180('0x8')](_0xd180('0xb'),auth[_0xd180('0x9')](),controller[_0xd180('0xc')]);router[_0xd180('0xd')]('/',auth[_0xd180('0x9')](),controller[_0xd180('0xe')]);router[_0xd180('0xf')](_0xd180('0xb'),auth[_0xd180('0x9')](),controller['update']);router['delete'](_0xd180('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd180('0x10')]=router; \ No newline at end of file +var _0x6df9=['/:id','update','multer','util','connect-timeout','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post','put'];(function(_0x84a85,_0x54e55c){var _0x1c2943=function(_0x99a250){while(--_0x99a250){_0x84a85['push'](_0x84a85['shift']());}};_0x1c2943(++_0x54e55c);}(_0x6df9,0x84));var _0x96df=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6df9[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var path=require('path');var timeout=require(_0x96df('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x96df('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x96df('0x4'));var controller=require('./cmCustomField.controller');router[_0x96df('0x5')]('/',auth['isAuthenticated'](),controller[_0x96df('0x6')]);router[_0x96df('0x5')]('/:id',auth[_0x96df('0x7')](),controller[_0x96df('0x8')]);router[_0x96df('0x9')]('/',auth[_0x96df('0x7')](),controller['create']);router[_0x96df('0xa')](_0x96df('0xb'),auth['isAuthenticated'](),controller[_0x96df('0xc')]);router['delete'](_0x96df('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index f76de3f..8cb7f6b 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 _0x0295=['moment','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','DATE','contactListQueue'];(function(_0x4c68ce,_0x42ad78){var _0x224d31=function(_0x516c62){while(--_0x516c62){_0x4c68ce['push'](_0x4c68ce['shift']());}};_0x224d31(++_0x42ad78);}(_0x0295,0x1f0));var _0x5029=function(_0x11b8ae,_0x485fa8){_0x11b8ae=_0x11b8ae-0x0;var _0x35a448=_0x0295[_0x11b8ae];return _0x35a448;};'use strict';var moment=require(_0x5029('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x5029('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5029('0x2')](_0x5029('0x3'))},'countbusyretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5029('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5029('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5029('0x6')]},'priority':{'type':Sequelize[_0x5029('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5029('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5029('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5029('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x5029('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5029('0x1')]}}; \ No newline at end of file +var _0x5fab=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE'];(function(_0x167e60,_0x5ce9d7){var _0x53ef7c=function(_0x442e2b){while(--_0x442e2b){_0x167e60['push'](_0x167e60['shift']());}};_0x53ef7c(++_0x5ce9d7);}(_0x5fab,0x177));var _0xb5fa=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x5fab[_0x371b64];return _0x3cf3b1;};'use strict';var moment=require(_0xb5fa('0x0'));var Sequelize=require(_0xb5fa('0x1'));module['exports']={'phone':{'type':Sequelize[_0xb5fa('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb5fa('0x4')],'defaultValue':moment()[_0xb5fa('0x5')](_0xb5fa('0x6'))},'countbusyretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb5fa('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb5fa('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb5fa('0x7')],'unique':_0xb5fa('0x9')},'UserId':{'type':Sequelize[_0xb5fa('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xb5fa('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb5fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index bcd7062..f558872 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 _0xa185=['set','Content-Range','reject','update','then','destroy','error','stack','name','status','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','VoiceQueueId','Campaign','CampaignId','omit','dataValues','createdAt','statedesc','campaign','membername','UserId','user','deletedat','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','format','direction','prev','isEmpty','hopperIds','priority','scheduledAt','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','getVoiceQueues','YYYY-MM-DD\x20HH:mm:ss','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','html-pdf','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit'];(function(_0x2992d4,_0x524b98){var _0x3a6052=function(_0x520900){while(--_0x520900){_0x2992d4['push'](_0x2992d4['shift']());}};_0x3a6052(++_0x524b98);}(_0xa185,0x78));var _0x5a18=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa185[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x5a18('0x0'));var emlformat=require(_0x5a18('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a18('0x3'));var util=require(_0x5a18('0x4'));var path=require(_0x5a18('0x5'));var sox=require(_0x5a18('0x6'));var csv=require(_0x5a18('0x7'));var ejs=require(_0x5a18('0x8'));var fs=require('fs');var _=require(_0x5a18('0x9'));var squel=require(_0x5a18('0xa'));var crypto=require('crypto');var jsforce=require(_0x5a18('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a18('0x7'));var querystring=require(_0x5a18('0xc'));var Papa=require(_0x5a18('0xd'));var Redis=require(_0x5a18('0xe'));var shared=require('../../config/environment');var authService=require(_0x5a18('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a18('0x10'));var logger=require(_0x5a18('0x11'))(_0x5a18('0x12'));var utils=require(_0x5a18('0x13'));var config=require(_0x5a18('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d96c3,_0x2af205){_0x2af205=_0x2af205||0xcc;return function(_0x4caa77){if(_0x4caa77){return _0x3d96c3[_0x5a18('0x15')](_0x2af205);}return _0x3d96c3['status'](_0x2af205)[_0x5a18('0x16')]();};}function respondWithResult(_0x5dfb8d,_0x2de610){_0x2de610=_0x2de610||0xc8;return function(_0x2c3b54){if(_0x2c3b54){return _0x5dfb8d['status'](_0x2de610)[_0x5a18('0x17')](_0x2c3b54);}};}function respondWithFilteredResult(_0x1a71a2,_0x11c056){return function(_0x523d34){if(_0x523d34){var _0x2bf751=_0x523d34[_0x5a18('0x18')],_0x3505da=_0x11c056['offset'],_0x417e43=_0x11c056[_0x5a18('0x19')]+_0x11c056[_0x5a18('0x1a')],_0x7cb8b3;if(_0x417e43>=_0x2bf751){_0x417e43=_0x2bf751;_0x7cb8b3=0xc8;}else{_0x7cb8b3=0xce;}_0x1a71a2['status'](_0x7cb8b3);return _0x1a71a2[_0x5a18('0x1b')](_0x5a18('0x1c'),_0x3505da+'-'+_0x417e43+'/'+_0x2bf751)[_0x5a18('0x17')](_0x523d34);}return null;};}function patchUpdates(_0x2d07c7){return function(_0x465e48){try{jsonpatch['apply'](_0x465e48,_0x2d07c7,!![]);}catch(_0x43c58d){return BPromise[_0x5a18('0x1d')](_0x43c58d);}return _0x465e48['save']();};}function saveUpdates(_0x1537ea,_0x56cc0a){return function(_0xe35414){if(_0xe35414){return _0xe35414[_0x5a18('0x1e')](_0x1537ea)[_0x5a18('0x1f')](function(_0x2752f6){return _0x2752f6;});}return null;};}function removeEntity(_0x49e7a1,_0x5dc1ff){return function(_0x550498){if(_0x550498){return _0x550498[_0x5a18('0x20')]()[_0x5a18('0x1f')](function(){_0x49e7a1['status'](0xcc)[_0x5a18('0x16')]();});}};}function handleEntityNotFound(_0x3d188d,_0x472933){return function(_0x345f71){if(!_0x345f71){_0x3d188d['sendStatus'](0x194);}return _0x345f71;};}function handleError(_0x458fe2,_0x1ac83f){_0x1ac83f=_0x1ac83f||0x1f4;return function(_0x4f9cf4){logger[_0x5a18('0x21')](_0x4f9cf4[_0x5a18('0x22')]);if(_0x4f9cf4[_0x5a18('0x23')]){delete _0x4f9cf4['name'];}_0x458fe2[_0x5a18('0x24')](_0x1ac83f)[_0x5a18('0x25')](_0x4f9cf4);};}exports[_0x5a18('0x26')]=function(_0x47f1b3,_0x4b372a){var _0x18fb86={},_0x1cf0cd={},_0x1de9fd={'count':0x0,'rows':[]};var _0x3b8444=_[_0x5a18('0x27')](db['CmHopper']['rawAttributes'],function(_0x3701a3){return{'name':_0x3701a3[_0x5a18('0x28')],'type':_0x3701a3[_0x5a18('0x29')][_0x5a18('0x2a')]};});_0x1cf0cd[_0x5a18('0x2b')]=_['map'](_0x3b8444,_0x5a18('0x23'));_0x1cf0cd[_0x5a18('0x2c')]=_[_0x5a18('0x2d')](_0x47f1b3[_0x5a18('0x2c')]);_0x1cf0cd[_0x5a18('0x2e')]=_[_0x5a18('0x2f')](_0x1cf0cd['model'],_0x1cf0cd[_0x5a18('0x2c')]);_0x1cf0cd[_0x5a18('0x2e')]=_[_0x5a18('0x30')](_0x1cf0cd['filters'],[_0x5a18('0x31'),_0x5a18('0x32'),'$gt',_0x5a18('0x33'),_0x5a18('0x34'),_0x5a18('0x35'),_0x5a18('0x36'),_0x5a18('0x37'),'$not',_0x5a18('0x38'),_0x5a18('0x39'),_0x5a18('0x3a'),'$notIn',_0x5a18('0x3b'),_0x5a18('0x3c'),_0x5a18('0x3d'),_0x5a18('0x3e'),_0x5a18('0x3b'),_0x5a18('0x3f'),_0x5a18('0x40'),'$contained',_0x5a18('0x41')]);_0x18fb86[_0x5a18('0x42')]=_['intersection'](_0x1cf0cd[_0x5a18('0x2b')],qs['fields'](_0x47f1b3[_0x5a18('0x2c')][_0x5a18('0x43')]));_0x18fb86['attributes']=_0x18fb86[_0x5a18('0x42')][_0x5a18('0x44')]?_0x18fb86[_0x5a18('0x42')]:_0x1cf0cd[_0x5a18('0x2b')];if(!_0x47f1b3[_0x5a18('0x2c')][_0x5a18('0x45')](_0x5a18('0x46'))){_0x18fb86[_0x5a18('0x1a')]=qs[_0x5a18('0x1a')](_0x47f1b3[_0x5a18('0x2c')][_0x5a18('0x1a')]);_0x18fb86['offset']=qs['offset'](_0x47f1b3['query']['offset']);}_0x18fb86[_0x5a18('0x47')]=qs[_0x5a18('0x48')](_0x47f1b3['query'][_0x5a18('0x48')]);_0x18fb86[_0x5a18('0x49')]=qs[_0x5a18('0x2e')](_['pick'](_0x47f1b3['query'],_0x1cf0cd['filters']),_0x3b8444);if(_0x47f1b3[_0x5a18('0x2c')][_0x5a18('0x4a')]){_0x18fb86[_0x5a18('0x49')]=_[_0x5a18('0x4b')](_0x18fb86[_0x5a18('0x49')],{'$or':_[_0x5a18('0x27')](_0x3b8444,function(_0x5a49a5){if(_0x5a49a5['type']!=='VIRTUAL'){var _0x1e5c3e={};_0x1e5c3e[_0x5a49a5[_0x5a18('0x23')]]={'$like':'%'+_0x47f1b3[_0x5a18('0x2c')]['filter']+'%'};return _0x1e5c3e;}})});}_0x18fb86=_['merge']({},_0x18fb86,_0x47f1b3[_0x5a18('0x4c')]);var _0x5c9cb9={'where':_0x18fb86['where']};return db[_0x5a18('0x4d')][_0x5a18('0x18')](_0x5c9cb9)[_0x5a18('0x1f')](function(_0x3871f8){_0x1de9fd[_0x5a18('0x18')]=_0x3871f8;if(_0x47f1b3[_0x5a18('0x2c')][_0x5a18('0x4e')]){_0x18fb86[_0x5a18('0x4f')]=[{'all':!![]}];}return db['CmHopper'][_0x5a18('0x50')](_0x18fb86);})['then'](function(_0x41211d){_0x1de9fd[_0x5a18('0x51')]=_0x41211d;return _0x1de9fd;})[_0x5a18('0x1f')](respondWithFilteredResult(_0x4b372a,_0x18fb86))[_0x5a18('0x52')](handleError(_0x4b372a,null));};exports[_0x5a18('0x53')]=function(_0x248dbb,_0x4ff546){var _0x2684c2={'raw':!![],'where':{'id':_0x248dbb[_0x5a18('0x54')]['id']}},_0x35140f={};_0x35140f[_0x5a18('0x2b')]=_[_0x5a18('0x2d')](db[_0x5a18('0x4d')][_0x5a18('0x55')]);_0x35140f[_0x5a18('0x2c')]=_[_0x5a18('0x2d')](_0x248dbb[_0x5a18('0x2c')]);_0x35140f[_0x5a18('0x2e')]=_[_0x5a18('0x2f')](_0x35140f['model'],_0x35140f[_0x5a18('0x2c')]);_0x2684c2[_0x5a18('0x42')]=_[_0x5a18('0x2f')](_0x35140f[_0x5a18('0x2b')],qs[_0x5a18('0x43')](_0x248dbb[_0x5a18('0x2c')]['fields']));_0x2684c2[_0x5a18('0x42')]=_0x2684c2['attributes'][_0x5a18('0x44')]?_0x2684c2[_0x5a18('0x42')]:_0x35140f[_0x5a18('0x2b')];if(_0x248dbb[_0x5a18('0x2c')][_0x5a18('0x4e')]){_0x2684c2[_0x5a18('0x4f')]=[{'all':!![]}];}_0x2684c2=_[_0x5a18('0x4b')]({},_0x2684c2,_0x248dbb['options']);return db[_0x5a18('0x4d')][_0x5a18('0x56')](_0x2684c2)[_0x5a18('0x1f')](handleEntityNotFound(_0x4ff546,null))['then'](respondWithResult(_0x4ff546,null))[_0x5a18('0x52')](handleError(_0x4ff546,null));};exports[_0x5a18('0x57')]=function(_0x4135b1,_0x2fb37d){return db[_0x5a18('0x4d')]['create'](_0x4135b1[_0x5a18('0x58')],{})[_0x5a18('0x1f')](respondWithResult(_0x2fb37d,0xc9))['catch'](handleError(_0x2fb37d,null));};exports[_0x5a18('0x1e')]=function(_0x5d4110,_0x14dde9){if(_0x5d4110[_0x5a18('0x58')]['id']){delete _0x5d4110[_0x5a18('0x58')]['id'];}return db[_0x5a18('0x4d')][_0x5a18('0x56')]({'where':{'id':_0x5d4110[_0x5a18('0x54')]['id']}})[_0x5a18('0x1f')](handleEntityNotFound(_0x14dde9,null))[_0x5a18('0x1f')](saveUpdates(_0x5d4110[_0x5a18('0x58')],null))[_0x5a18('0x1f')](respondWithResult(_0x14dde9,null))[_0x5a18('0x52')](handleError(_0x14dde9,null));};exports[_0x5a18('0x59')]=function(_0x119ee6,_0x372e36){return db[_0x5a18('0x4d')][_0x5a18('0x59')]()[_0x5a18('0x1f')](respondWithResult(_0x372e36,null))[_0x5a18('0x52')](handleError(_0x372e36,null));};exports[_0x5a18('0x20')]=function(_0x4db1e3,_0x31c285){var _0x411849;return db[_0x5a18('0x4d')][_0x5a18('0x56')]({'where':{'id':_0x4db1e3['params']['id']}})[_0x5a18('0x1f')](handleEntityNotFound(_0x31c285,null))[_0x5a18('0x1f')](function(_0x383d33){if(_0x383d33){return _0x383d33[_0x5a18('0x20')]()['then'](function(_0x3e030c){return _0x3e030c;});}})[_0x5a18('0x1f')](function(_0x5d35e1){_0x411849=_0x5d35e1;if(_0x5d35e1){if(_0x5d35e1[_0x5a18('0x5a')]||_0x5d35e1['CampaignId']){return db[_0x5d35e1[_0x5a18('0x5a')]?'VoiceQueue':_0x5a18('0x5b')][_0x5a18('0x56')]({'where':{'id':_0x5d35e1['VoiceQueueId']?_0x5d35e1['VoiceQueueId']:_0x5d35e1[_0x5a18('0x5c')]},'attributes':['id',_0x5a18('0x23')],'raw':!![]});}}})[_0x5a18('0x1f')](function(_0x1dd427){var _0x50debe={};if(_0x1dd427){_[_0x5a18('0x4b')](_0x50debe,_[_0x5a18('0x5d')](_0x411849[_0x5a18('0x5e')],[_0x5a18('0x5f'),'updatedAt','id']));_0x50debe['state']=0x15;_0x50debe[_0x5a18('0x60')]='deleted';_0x50debe[_0x5a18('0x61')]=_0x1dd427[_0x5a18('0x23')];_0x50debe[_0x5a18('0x62')]=_0x4db1e3['user'][_0x5a18('0x23')];_0x50debe[_0x5a18('0x63')]=_0x4db1e3[_0x5a18('0x64')]['id'];_0x50debe['deleted']=!![];_0x50debe[_0x5a18('0x65')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x50debe[_0x5a18('0x66')]=_0x411849[_0x5a18('0x67')];_0x50debe[_0x5a18('0x68')]=_0x411849[_0x5a18('0x5a')]?_0x5a18('0x69'):_0x5a18('0x6a');return db[_0x5a18('0x6b')][_0x5a18('0x56')]({'where':{'id':_0x50debe['ContactId']},'attributes':[_0x5a18('0x6c'),_0x5a18('0x6d')]})['then'](function(_0x59be33){if(!_['isNil'](_0x31c285)&&!_['isNil'](_0x59be33[_0x5a18('0x6c')])){_0x50debe['calleridname']=_0x59be33[_0x5a18('0x6c')];if(!_[_0x5a18('0x6e')](_0x59be33[_0x5a18('0x6d')])){_0x50debe[_0x5a18('0x6f')]+='\x20'+_0x59be33['lastName'];}}})[_0x5a18('0x70')](function(){return db[_0x5a18('0x71')][_0x5a18('0x57')](_0x50debe);});}})[_0x5a18('0x1f')](function(){return _0x31c285[_0x5a18('0x24')](0xcc)['end']();})[_0x5a18('0x52')](handleError(_0x31c285,null));};exports[_0x5a18('0x72')]=function(_0x2e2deb,_0x566d21,_0x1d446f){var _0x5e0af2=[];return db['CmContact'][_0x5a18('0x59')]()['then'](function(_0x3ce8f8){_0x5e0af2=_['keys'](_0x3ce8f8);return _0x2e2deb['user']['getVoiceQueues']({'where':{'type':_0x5a18('0x73'),'dialActive':!![],'dialMethod':_0x5a18('0x74')},'attributes':['id',_0x5a18('0x75')],'raw':!![]});})['then'](function(_0x58df71){if(_0x58df71&&_0x58df71['length']){return db[_0x5a18('0x76')]['transaction'](function(_0x5077f6){var _0x2278fa={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5a18('0x77')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x58df71,'id')},'$or':[{'UserId':null},{'UserId':_0x2e2deb[_0x5a18('0x64')]['id']}]};var _0x4c8f23=[];if(_0x2e2deb[_0x5a18('0x58')][_0x5a18('0x78')]&&_0x2e2deb['body'][_0x5a18('0x78')]===_0x5a18('0x79')){if(!_[_0x5a18('0x7a')](_0x2e2deb[_0x5a18('0x58')][_0x5a18('0x7b')])){_0x2278fa['id']={'$in':_0x2e2deb['body']['hopperIds']};}_0x4c8f23=[[_0x5a18('0x7c'),'ASC'],[_0x5a18('0x7d'),_0x58df71[0x0]['dialOrderByScheduledAt']==='ASC'?_0x5a18('0x7e'):_0x5a18('0x7f')],db[_0x5a18('0x76')]['literal'](_0x5a18('0x80')),['id',_0x5a18('0x7e')]];}else{if(!_[_0x5a18('0x7a')](_0x2e2deb['body']['hopperIds'])){_0x2278fa['id']={'$notIn':_0x2e2deb[_0x5a18('0x58')][_0x5a18('0x7b')]};}_0x4c8f23=[[_0x5a18('0x7c'),_0x5a18('0x7e')],[_0x5a18('0x7d'),_0x58df71[0x0][_0x5a18('0x75')]],db[_0x5a18('0x76')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x5a18('0x7f')]];}return db[_0x5a18('0x4d')][_0x5a18('0x81')]({'attributes':['id','scheduledat'],'where':_0x2278fa,'order':_0x4c8f23,'transaction':_0x5077f6,'lock':_0x5077f6[_0x5a18('0x82')][_0x5a18('0x83')],'include':[{'model':db[_0x5a18('0x6b')],'as':_0x5a18('0x84'),'attributes':_0x5e0af2,'include':[{'model':db[_0x5a18('0x85')],'as':'Company','attributes':['id',_0x5a18('0x23')]}]},{'model':db[_0x5a18('0x86')],'as':_0x5a18('0x87'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x5a18('0x88'),'attributes':['id',_0x5a18('0x23'),'dialActive']}]})[_0x5a18('0x1f')](function(_0x47c97e){if(_0x47c97e){return _0x47c97e[_0x5a18('0x1e')]({'UserId':_0x2e2deb['user']['id']},{'transaction':_0x5077f6});}});});}})[_0x5a18('0x1f')](handleEntityNotFound(_0x566d21,null))['then'](respondWithResult(_0x566d21,null))[_0x5a18('0x52')](handleError(_0x566d21,null));};exports['getOpenContacts']=function(_0x3e7303,_0x20d384,_0x1a7e45){return _0x3e7303[_0x5a18('0x64')][_0x5a18('0x89')]({'where':{'type':_0x5a18('0x73'),'dialActive':!![],'dialMethod':_0x5a18('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x465e03){if(_0x465e03&&_0x465e03[_0x5a18('0x44')]){return db[_0x5a18('0x4d')][_0x5a18('0x18')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5a18('0x77')](_0x5a18('0x8a'))},'VoiceQueueId':{'$in':_[_0x5a18('0x27')](_0x465e03,'id')},'$or':[{'UserId':null},{'UserId':_0x3e7303[_0x5a18('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x29bd09){if(!_[_0x5a18('0x6e')](_0x29bd09)&&_[_0x5a18('0x8b')](_0x29bd09)){return _0x20d384[_0x5a18('0x24')](0xc8)[_0x5a18('0x17')]({'contacts':_0x29bd09});}else{logger['error'](_0x5a18('0x8c'),'getOpenContacts',0x194,_0x5a18('0x8d'));_0x20d384[_0x5a18('0x15')](0x194);}})[_0x5a18('0x52')](handleError(_0x20d384,null));};exports[_0x5a18('0x8e')]=function(_0x3867fc,_0xe4fd7d,_0x1021f7){var _0xda2b01=shared[_0x5a18('0x8f')];var _0x58744a=[];_[_0x5a18('0x27')](_0xda2b01,function(_0x158516){_0x58744a[_0x5a18('0x90')]({'id':_0x158516[_0x5a18('0x23')],'name':_0x158516[_0x5a18('0x23')],'utcOffset':_0x158516[_0x5a18('0x91')]});});return _0xe4fd7d['status'](0xc8)['json']({'tz':_0x58744a});};exports[_0x5a18('0x92')]=function(_0x5d8f68,_0x3b7a7f,_0x4e7408){var _0xe4f790=shared[_0x5a18('0x8f')];var _0x1dbc08={};if(!_[_0x5a18('0x6e')](_0xe4f790[_0x5d8f68[_0x5a18('0x58')]['id']]))_0x1dbc08=_0xe4f790[_0x5d8f68[_0x5a18('0x58')]['id']];return _0x3b7a7f[_0x5a18('0x24')](0xc8)[_0x5a18('0x17')](_0x1dbc08);}; \ No newline at end of file +var _0xa4a6=['merge','includeAll','include','findAll','rows','show','keys','length','options','find','catch','create','update','body','params','describe','destroy','VoiceQueueId','CampaignId','omit','dataValues','createdAt','campaign','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','preview','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','filters','intersection','model','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notILike','$overlap','$contains','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x7b1ac1,_0x357625){var _0x290df3=function(_0x1798f2){while(--_0x1798f2){_0x7b1ac1['push'](_0x7b1ac1['shift']());}};_0x290df3(++_0x357625);}(_0xa4a6,0xdf));var _0x6a4a=function(_0x4ffe46,_0x3d3b54){_0x4ffe46=_0x4ffe46-0x0;var _0x1467ef=_0xa4a6[_0x4ffe46];return _0x1467ef;};'use strict';var pdf=require(_0x6a4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6a4a('0x1'));var zipdir=require(_0x6a4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a4a('0x3'));var moment=require(_0x6a4a('0x4'));var BPromise=require(_0x6a4a('0x5'));var Mustache=require(_0x6a4a('0x6'));var util=require('util');var path=require(_0x6a4a('0x7'));var sox=require(_0x6a4a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6a4a('0x9'));var squel=require(_0x6a4a('0xa'));var crypto=require(_0x6a4a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a4a('0xc'));var querystring=require(_0x6a4a('0xd'));var Papa=require(_0x6a4a('0xe'));var Redis=require(_0x6a4a('0xf'));var shared=require(_0x6a4a('0x10'));var authService=require(_0x6a4a('0x11'));var qs=require(_0x6a4a('0x12'));var as=require(_0x6a4a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a4a('0x14'))(_0x6a4a('0x15'));var utils=require(_0x6a4a('0x16'));var config=require('../../config/environment');var db=require(_0x6a4a('0x17'))['db'];function respondWithStatusCode(_0x40fa77,_0x5a505c){_0x5a505c=_0x5a505c||0xcc;return function(_0x1b427b){if(_0x1b427b){return _0x40fa77[_0x6a4a('0x18')](_0x5a505c);}return _0x40fa77['status'](_0x5a505c)['end']();};}function respondWithResult(_0x3ffc92,_0x11c03f){_0x11c03f=_0x11c03f||0xc8;return function(_0x3e6648){if(_0x3e6648){return _0x3ffc92[_0x6a4a('0x19')](_0x11c03f)[_0x6a4a('0x1a')](_0x3e6648);}};}function respondWithFilteredResult(_0x27ecce,_0x13785a){return function(_0x4ab020){if(_0x4ab020){var _0x15bec7=_0x4ab020[_0x6a4a('0x1b')],_0x60e4bc=_0x13785a[_0x6a4a('0x1c')],_0x13d7ba=_0x13785a[_0x6a4a('0x1c')]+_0x13785a[_0x6a4a('0x1d')],_0x1baec5;if(_0x13d7ba>=_0x15bec7){_0x13d7ba=_0x15bec7;_0x1baec5=0xc8;}else{_0x1baec5=0xce;}_0x27ecce['status'](_0x1baec5);return _0x27ecce[_0x6a4a('0x1e')](_0x6a4a('0x1f'),_0x60e4bc+'-'+_0x13d7ba+'/'+_0x15bec7)[_0x6a4a('0x1a')](_0x4ab020);}return null;};}function patchUpdates(_0x5bd4c5){return function(_0x37561b){try{jsonpatch['apply'](_0x37561b,_0x5bd4c5,!![]);}catch(_0x4a9c58){return BPromise[_0x6a4a('0x20')](_0x4a9c58);}return _0x37561b['save']();};}function saveUpdates(_0x468684,_0x12e012){return function(_0x3fdc35){if(_0x3fdc35){return _0x3fdc35['update'](_0x468684)[_0x6a4a('0x21')](function(_0x4f2031){return _0x4f2031;});}return null;};}function removeEntity(_0x1d7ca5,_0x5d9f0b){return function(_0x11dd4c){if(_0x11dd4c){return _0x11dd4c['destroy']()[_0x6a4a('0x21')](function(){_0x1d7ca5[_0x6a4a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5459d7,_0x3ad9c3){return function(_0x1baf49){if(!_0x1baf49){_0x5459d7[_0x6a4a('0x18')](0x194);}return _0x1baf49;};}function handleError(_0x2143fe,_0x1bca6b){_0x1bca6b=_0x1bca6b||0x1f4;return function(_0x5a64ff){logger[_0x6a4a('0x22')](_0x5a64ff[_0x6a4a('0x23')]);if(_0x5a64ff[_0x6a4a('0x24')]){delete _0x5a64ff['name'];}_0x2143fe[_0x6a4a('0x19')](_0x1bca6b)[_0x6a4a('0x25')](_0x5a64ff);};}exports[_0x6a4a('0x26')]=function(_0x39721c,_0x2b20c5){var _0x21a1f3={},_0x1a0c7a={},_0x47b226={'count':0x0,'rows':[]};var _0x44e6b8=_[_0x6a4a('0x27')](db[_0x6a4a('0x28')][_0x6a4a('0x29')],function(_0x564d6c){return{'name':_0x564d6c[_0x6a4a('0x2a')],'type':_0x564d6c[_0x6a4a('0x2b')][_0x6a4a('0x2c')]};});_0x1a0c7a['model']=_[_0x6a4a('0x27')](_0x44e6b8,_0x6a4a('0x24'));_0x1a0c7a['query']=_['keys'](_0x39721c[_0x6a4a('0x2d')]);_0x1a0c7a[_0x6a4a('0x2e')]=_[_0x6a4a('0x2f')](_0x1a0c7a[_0x6a4a('0x30')],_0x1a0c7a[_0x6a4a('0x2d')]);_0x1a0c7a[_0x6a4a('0x2e')]=_[_0x6a4a('0x31')](_0x1a0c7a[_0x6a4a('0x2e')],[_0x6a4a('0x32'),_0x6a4a('0x33'),_0x6a4a('0x34'),_0x6a4a('0x35'),_0x6a4a('0x36'),_0x6a4a('0x37'),_0x6a4a('0x38'),_0x6a4a('0x39'),'$not',_0x6a4a('0x3a'),_0x6a4a('0x3b'),_0x6a4a('0x3c'),_0x6a4a('0x3d'),_0x6a4a('0x3e'),'$notLike','$iLike',_0x6a4a('0x3f'),_0x6a4a('0x3e'),_0x6a4a('0x40'),_0x6a4a('0x41'),'$contained',_0x6a4a('0x42')]);_0x21a1f3[_0x6a4a('0x43')]=_['intersection'](_0x1a0c7a[_0x6a4a('0x30')],qs[_0x6a4a('0x44')](_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x44')]));_0x21a1f3[_0x6a4a('0x43')]=_0x21a1f3[_0x6a4a('0x43')]['length']?_0x21a1f3[_0x6a4a('0x43')]:_0x1a0c7a['model'];if(!_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x45')](_0x6a4a('0x46'))){_0x21a1f3[_0x6a4a('0x1d')]=qs[_0x6a4a('0x1d')](_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x1d')]);_0x21a1f3[_0x6a4a('0x1c')]=qs['offset'](_0x39721c[_0x6a4a('0x2d')]['offset']);}_0x21a1f3[_0x6a4a('0x47')]=qs[_0x6a4a('0x48')](_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x48')]);_0x21a1f3['where']=qs['filters'](_['pick'](_0x39721c[_0x6a4a('0x2d')],_0x1a0c7a[_0x6a4a('0x2e')]),_0x44e6b8);if(_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x49')]){_0x21a1f3[_0x6a4a('0x4a')]=_[_0x6a4a('0x4b')](_0x21a1f3[_0x6a4a('0x4a')],{'$or':_[_0x6a4a('0x27')](_0x44e6b8,function(_0x44a928){if(_0x44a928[_0x6a4a('0x2b')]!=='VIRTUAL'){var _0x40f5b4={};_0x40f5b4[_0x44a928[_0x6a4a('0x24')]]={'$like':'%'+_0x39721c['query'][_0x6a4a('0x49')]+'%'};return _0x40f5b4;}})});}_0x21a1f3=_[_0x6a4a('0x4b')]({},_0x21a1f3,_0x39721c['options']);var _0x5ac6cf={'where':_0x21a1f3[_0x6a4a('0x4a')]};return db[_0x6a4a('0x28')]['count'](_0x5ac6cf)['then'](function(_0x28f7cc){_0x47b226[_0x6a4a('0x1b')]=_0x28f7cc;if(_0x39721c[_0x6a4a('0x2d')][_0x6a4a('0x4c')]){_0x21a1f3[_0x6a4a('0x4d')]=[{'all':!![]}];}return db[_0x6a4a('0x28')][_0x6a4a('0x4e')](_0x21a1f3);})[_0x6a4a('0x21')](function(_0xfd24){_0x47b226[_0x6a4a('0x4f')]=_0xfd24;return _0x47b226;})['then'](respondWithFilteredResult(_0x2b20c5,_0x21a1f3))['catch'](handleError(_0x2b20c5,null));};exports[_0x6a4a('0x50')]=function(_0x2277fb,_0x4e811e){var _0x44a0f4={'raw':!![],'where':{'id':_0x2277fb['params']['id']}},_0x494aa1={};_0x494aa1[_0x6a4a('0x30')]=_[_0x6a4a('0x51')](db[_0x6a4a('0x28')][_0x6a4a('0x29')]);_0x494aa1[_0x6a4a('0x2d')]=_[_0x6a4a('0x51')](_0x2277fb[_0x6a4a('0x2d')]);_0x494aa1[_0x6a4a('0x2e')]=_[_0x6a4a('0x2f')](_0x494aa1[_0x6a4a('0x30')],_0x494aa1['query']);_0x44a0f4['attributes']=_['intersection'](_0x494aa1[_0x6a4a('0x30')],qs[_0x6a4a('0x44')](_0x2277fb[_0x6a4a('0x2d')][_0x6a4a('0x44')]));_0x44a0f4[_0x6a4a('0x43')]=_0x44a0f4[_0x6a4a('0x43')][_0x6a4a('0x52')]?_0x44a0f4[_0x6a4a('0x43')]:_0x494aa1[_0x6a4a('0x30')];if(_0x2277fb[_0x6a4a('0x2d')][_0x6a4a('0x4c')]){_0x44a0f4[_0x6a4a('0x4d')]=[{'all':!![]}];}_0x44a0f4=_[_0x6a4a('0x4b')]({},_0x44a0f4,_0x2277fb[_0x6a4a('0x53')]);return db[_0x6a4a('0x28')][_0x6a4a('0x54')](_0x44a0f4)['then'](handleEntityNotFound(_0x4e811e,null))[_0x6a4a('0x21')](respondWithResult(_0x4e811e,null))[_0x6a4a('0x55')](handleError(_0x4e811e,null));};exports[_0x6a4a('0x56')]=function(_0x6a50c9,_0x108212){return db['CmHopper'][_0x6a4a('0x56')](_0x6a50c9['body'],{})[_0x6a4a('0x21')](respondWithResult(_0x108212,0xc9))[_0x6a4a('0x55')](handleError(_0x108212,null));};exports[_0x6a4a('0x57')]=function(_0x2653d5,_0x20b0d9){if(_0x2653d5[_0x6a4a('0x58')]['id']){delete _0x2653d5['body']['id'];}return db[_0x6a4a('0x28')]['find']({'where':{'id':_0x2653d5[_0x6a4a('0x59')]['id']}})[_0x6a4a('0x21')](handleEntityNotFound(_0x20b0d9,null))[_0x6a4a('0x21')](saveUpdates(_0x2653d5[_0x6a4a('0x58')],null))[_0x6a4a('0x21')](respondWithResult(_0x20b0d9,null))[_0x6a4a('0x55')](handleError(_0x20b0d9,null));};exports[_0x6a4a('0x5a')]=function(_0x47417d,_0x3ccebc){return db[_0x6a4a('0x28')]['describe']()['then'](respondWithResult(_0x3ccebc,null))[_0x6a4a('0x55')](handleError(_0x3ccebc,null));};exports[_0x6a4a('0x5b')]=function(_0x389ac1,_0x29bb58){var _0x5d8539;return db['CmHopper'][_0x6a4a('0x54')]({'where':{'id':_0x389ac1['params']['id']}})['then'](handleEntityNotFound(_0x29bb58,null))[_0x6a4a('0x21')](function(_0x41e791){if(_0x41e791){return _0x41e791[_0x6a4a('0x5b')]()[_0x6a4a('0x21')](function(_0x55c390){return _0x55c390;});}})['then'](function(_0x48e4d5){_0x5d8539=_0x48e4d5;if(_0x48e4d5){if(_0x48e4d5[_0x6a4a('0x5c')]||_0x48e4d5[_0x6a4a('0x5d')]){return db[_0x48e4d5[_0x6a4a('0x5c')]?'VoiceQueue':'Campaign']['find']({'where':{'id':_0x48e4d5[_0x6a4a('0x5c')]?_0x48e4d5[_0x6a4a('0x5c')]:_0x48e4d5['CampaignId']},'attributes':['id',_0x6a4a('0x24')],'raw':!![]});}}})[_0x6a4a('0x21')](function(_0x22f9b7){var _0x3649e6={};if(_0x22f9b7){_[_0x6a4a('0x4b')](_0x3649e6,_[_0x6a4a('0x5e')](_0x5d8539[_0x6a4a('0x5f')],[_0x6a4a('0x60'),'updatedAt','id']));_0x3649e6['state']=0x15;_0x3649e6['statedesc']='deleted';_0x3649e6[_0x6a4a('0x61')]=_0x22f9b7[_0x6a4a('0x24')];_0x3649e6[_0x6a4a('0x62')]=_0x389ac1[_0x6a4a('0x63')][_0x6a4a('0x24')];_0x3649e6['UserId']=_0x389ac1[_0x6a4a('0x63')]['id'];_0x3649e6[_0x6a4a('0x64')]=!![];_0x3649e6[_0x6a4a('0x65')]=moment()[_0x6a4a('0x66')](_0x6a4a('0x67'));_0x3649e6[_0x6a4a('0x68')]=_0x5d8539[_0x6a4a('0x69')];_0x3649e6['campaigntype']=_0x5d8539[_0x6a4a('0x5c')]?_0x6a4a('0x6a'):_0x6a4a('0x6b');return db[_0x6a4a('0x6c')][_0x6a4a('0x54')]({'where':{'id':_0x3649e6['ContactId']},'attributes':[_0x6a4a('0x6d'),_0x6a4a('0x6e')]})['then'](function(_0xa0fa4e){if(!_[_0x6a4a('0x6f')](_0x29bb58)&&!_['isNil'](_0xa0fa4e['firstName'])){_0x3649e6[_0x6a4a('0x70')]=_0xa0fa4e[_0x6a4a('0x6d')];if(!_[_0x6a4a('0x6f')](_0xa0fa4e[_0x6a4a('0x6e')])){_0x3649e6[_0x6a4a('0x70')]+='\x20'+_0xa0fa4e[_0x6a4a('0x6e')];}}})[_0x6a4a('0x71')](function(){return db[_0x6a4a('0x72')][_0x6a4a('0x56')](_0x3649e6);});}})[_0x6a4a('0x21')](function(){return _0x29bb58[_0x6a4a('0x19')](0xcc)[_0x6a4a('0x73')]();})['catch'](handleError(_0x29bb58,null));};exports['getPreview']=function(_0x5ad76d,_0x3bf8de,_0x96019a){var _0x1fdfb7=[];return db[_0x6a4a('0x6c')][_0x6a4a('0x5a')]()[_0x6a4a('0x21')](function(_0x759795){_0x1fdfb7=_[_0x6a4a('0x51')](_0x759795);return _0x5ad76d[_0x6a4a('0x63')][_0x6a4a('0x74')]({'where':{'type':_0x6a4a('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x6a4a('0x76')],'raw':!![]});})['then'](function(_0x282c06){if(_0x282c06&&_0x282c06[_0x6a4a('0x52')]){return db[_0x6a4a('0x77')][_0x6a4a('0x78')](function(_0x50a2cb){var _0x33e62f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a4a('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x282c06,'id')},'$or':[{'UserId':null},{'UserId':_0x5ad76d['user']['id']}]};var _0x53a9f4=[];if(_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x79')]&&_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x79')]===_0x6a4a('0x7a')){if(!_[_0x6a4a('0x7b')](_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x7c')])){_0x33e62f['id']={'$in':_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x7c')]};}_0x53a9f4=[['priority',_0x6a4a('0x7d')],['scheduledAt',_0x282c06[0x0][_0x6a4a('0x76')]===_0x6a4a('0x7d')?_0x6a4a('0x7e'):'ASC'],db[_0x6a4a('0x77')]['literal'](_0x6a4a('0x7f')),['id','DESC']];}else{if(!_[_0x6a4a('0x7b')](_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x7c')])){_0x33e62f['id']={'$notIn':_0x5ad76d[_0x6a4a('0x58')][_0x6a4a('0x7c')]};}_0x53a9f4=[['priority',_0x6a4a('0x7e')],[_0x6a4a('0x80'),_0x282c06[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x6a4a('0x81')](_0x6a4a('0x82')),['id',_0x6a4a('0x7d')]];}return db[_0x6a4a('0x28')][_0x6a4a('0x83')]({'attributes':['id',_0x6a4a('0x84')],'where':_0x33e62f,'order':_0x53a9f4,'transaction':_0x50a2cb,'lock':_0x50a2cb['LOCK'][_0x6a4a('0x85')],'include':[{'model':db[_0x6a4a('0x6c')],'as':_0x6a4a('0x86'),'attributes':_0x1fdfb7,'include':[{'model':db[_0x6a4a('0x87')],'as':_0x6a4a('0x88'),'attributes':['id',_0x6a4a('0x24')]}]},{'model':db[_0x6a4a('0x89')],'as':_0x6a4a('0x8a'),'attributes':['id',_0x6a4a('0x24')]},{'model':db[_0x6a4a('0x8b')],'as':_0x6a4a('0x8c'),'attributes':['id',_0x6a4a('0x24'),_0x6a4a('0x8d')]}]})['then'](function(_0x371e42){if(_0x371e42){return _0x371e42[_0x6a4a('0x57')]({'UserId':_0x5ad76d[_0x6a4a('0x63')]['id']},{'transaction':_0x50a2cb});}});});}})['then'](handleEntityNotFound(_0x3bf8de,null))[_0x6a4a('0x21')](respondWithResult(_0x3bf8de,null))[_0x6a4a('0x55')](handleError(_0x3bf8de,null));};exports['getOpenContacts']=function(_0x1038fd,_0x4463df,_0x5afc6d){return _0x1038fd[_0x6a4a('0x63')][_0x6a4a('0x74')]({'where':{'type':_0x6a4a('0x75'),'dialActive':!![],'dialMethod':_0x6a4a('0x8e')},'attributes':['id'],'raw':!![]})[_0x6a4a('0x21')](function(_0x320a57){if(_0x320a57&&_0x320a57[_0x6a4a('0x52')]){return db[_0x6a4a('0x28')][_0x6a4a('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6a4a('0x67'))},'VoiceQueueId':{'$in':_[_0x6a4a('0x27')](_0x320a57,'id')},'$or':[{'UserId':null},{'UserId':_0x1038fd[_0x6a4a('0x63')]['id']}]}});}return 0x0;})[_0x6a4a('0x21')](function(_0x20b976){if(!_[_0x6a4a('0x6f')](_0x20b976)&&_['isNumber'](_0x20b976)){return _0x4463df[_0x6a4a('0x19')](0xc8)[_0x6a4a('0x1a')]({'contacts':_0x20b976});}else{logger[_0x6a4a('0x22')](_0x6a4a('0x8f'),_0x6a4a('0x90'),0x194,_0x6a4a('0x91'));_0x4463df['sendStatus'](0x194);}})['catch'](handleError(_0x4463df,null));};exports['getTimezones']=function(_0x38d8a0,_0x5c3068,_0x586553){var _0x484053=shared[_0x6a4a('0x92')];var _0x572567=[];_[_0x6a4a('0x27')](_0x484053,function(_0x4d448e){_0x572567[_0x6a4a('0x93')]({'id':_0x4d448e['name'],'name':_0x4d448e[_0x6a4a('0x24')],'utcOffset':_0x4d448e[_0x6a4a('0x94')]});});return _0x5c3068['status'](0xc8)[_0x6a4a('0x1a')]({'tz':_0x572567});};exports['getTimezone']=function(_0x3ffdf8,_0x11d528,_0x47a94c){var _0x5b0574=shared[_0x6a4a('0x92')];var _0x9b71e4={};if(!_['isNil'](_0x5b0574[_0x3ffdf8[_0x6a4a('0x58')]['id']]))_0x9b71e4=_0x5b0574[_0x3ffdf8[_0x6a4a('0x58')]['id']];return _0x11d528[_0x6a4a('0x19')](0xc8)['json'](_0x9b71e4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1320c6c..0bafa9f 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 _0x5075=['../../config/logger','api','moment','bluebird','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util'];(function(_0x54d9af,_0x3808f7){var _0xd4bb86=function(_0xf3f8ac){while(--_0xf3f8ac){_0x54d9af['push'](_0x54d9af['shift']());}};_0xd4bb86(++_0x3808f7);}(_0x5075,0x94));var _0x5507=function(_0x50a864,_0x3303e2){_0x50a864=_0x50a864-0x0;var _0x2fb82f=_0x5075[_0x50a864];return _0x2fb82f;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x6'));var config=require('../../config/environment');var attributes=require(_0x5507('0x7'));module[_0x5507('0x8')]=function(_0x29eebd,_0x422024){return _0x29eebd[_0x5507('0x9')](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5507('0xc')]},{'name':_0x5507('0xd'),'fields':[_0x5507('0xd')]},{'name':_0x5507('0xe'),'fields':[_0x5507('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ac3=['../../config/logger','api','request-promise','../../config/environment','exports','CmHopper','cm_hopper','scheduledat','phone','priority','util'];(function(_0x7fd6f3,_0x22d37b){var _0x42d07e=function(_0x4d3978){while(--_0x4d3978){_0x7fd6f3['push'](_0x7fd6f3['shift']());}};_0x42d07e(++_0x22d37b);}(_0x5ac3,0x112));var _0x35ac=function(_0x24af13,_0x360f78){_0x24af13=_0x24af13-0x0;var _0x38d2e7=_0x5ac3[_0x24af13];return _0x38d2e7;};'use strict';var _=require('lodash');var util=require(_0x35ac('0x0'));var logger=require(_0x35ac('0x1'))(_0x35ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x35ac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x35ac('0x4'));var attributes=require('./cmHopper.attributes');module[_0x35ac('0x5')]=function(_0x3fb080,_0x31d11c){return _0x3fb080['define'](_0x35ac('0x6'),attributes,{'tableName':_0x35ac('0x7'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x35ac('0x8')]},{'name':'phone','fields':[_0x35ac('0x9')]},{'name':'priority','fields':[_0x35ac('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b229da8..0bdd8af 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 _0x7d37=['log','req\x20value','phone\x20value','phone','findOne','getcontactbyohone','getContactByPhone','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowCmHopper','create','body','CreateCmHopper','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','transaction','LOCK','UPDATE','Contact','User','Agent','voicePause','length','includes','UserId','update','sequelize','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','push','all','GetCmHopperPreview','describe','keys','GetContactByPhone'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x7d37,0x1db));var _0x77d3=function(_0x184759,_0x869683){_0x184759=_0x184759-0x0;var _0x455498=_0x7d37[_0x184759];return _0x455498;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x77d3('0x3'));var fs=require('fs');var Redis=require(_0x77d3('0x4'));var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d3('0x6'))(_0x77d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x519c6e,_0x40235d,_0x373da8){return new BPromise(function(_0x5c0108,_0x555390){return client[_0x77d3('0xa')](_0x519c6e,_0x373da8)[_0x77d3('0xb')](function(_0x506caa){logger[_0x77d3('0xc')]('CmHopper,\x20%s,\x20%s',_0x40235d,_0x77d3('0xd'));logger['debug'](_0x77d3('0xe'),_0x40235d,'request\x20sent',JSON[_0x77d3('0xf')](_0x506caa));if(_0x506caa[_0x77d3('0x10')]){if(_0x506caa[_0x77d3('0x10')][_0x77d3('0x11')]===0x1f4){logger[_0x77d3('0x10')](_0x77d3('0x12'),_0x40235d,_0x506caa[_0x77d3('0x10')][_0x77d3('0x13')]);return _0x555390(_0x506caa[_0x77d3('0x10')]['message']);}logger[_0x77d3('0x10')]('CmHopper,\x20%s,\x20%s',_0x40235d,_0x506caa['error']['message']);return _0x5c0108(_0x506caa[_0x77d3('0x10')][_0x77d3('0x13')]);}else{logger[_0x77d3('0xc')](_0x77d3('0x12'),_0x40235d,_0x77d3('0xd'));_0x5c0108(_0x506caa['result'][_0x77d3('0x13')]);}})[_0x77d3('0x14')](function(_0x5e92d8){logger['error'](_0x77d3('0x12'),_0x40235d,_0x5e92d8);_0x555390(_0x5e92d8);});});}exports[_0x77d3('0x15')]=function(_0x60173f){var _0x4500a2=this;return new Promise(function(_0x144656,_0x1378a5){return db[_0x77d3('0x16')][_0x77d3('0x17')]({'raw':_0x60173f[_0x77d3('0x18')]?_0x60173f[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![],'where':_0x60173f[_0x77d3('0x18')]?_0x60173f[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null,'attributes':_0x60173f[_0x77d3('0x18')]?_0x60173f[_0x77d3('0x18')][_0x77d3('0x1b')]||null:null,'limit':_0x60173f[_0x77d3('0x18')]?_0x60173f['options'][_0x77d3('0x1c')]||null:null,'include':_0x60173f[_0x77d3('0x18')]?_0x60173f[_0x77d3('0x18')][_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x60173f[_0x77d3('0x18')][_0x77d3('0x1d')],function(_0x17e9f9){return{'model':db[_0x17e9f9[_0x77d3('0x1f')]],'as':_0x17e9f9['as'],'attributes':_0x17e9f9['attributes'],'include':_0x17e9f9[_0x77d3('0x1d')]?_['map'](_0x17e9f9[_0x77d3('0x1d')],function(_0x443aa6){return{'model':db[_0x443aa6[_0x77d3('0x1f')]],'as':_0x443aa6['as'],'attributes':_0x443aa6[_0x77d3('0x1b')],'include':_0x443aa6[_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x443aa6['include'],function(_0x17c6c6){return{'model':db[_0x17c6c6[_0x77d3('0x1f')]],'as':_0x17c6c6['as'],'attributes':_0x17c6c6[_0x77d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x77d3('0xb')](function(_0x451c1a){logger[_0x77d3('0xc')](_0x77d3('0x15'),_0x60173f);logger[_0x77d3('0x20')](_0x77d3('0x15'),_0x60173f,JSON[_0x77d3('0xf')](_0x451c1a));_0x144656(_0x451c1a);})['catch'](function(_0x3add49){logger[_0x77d3('0x10')]('GetCmHopper',_0x3add49[_0x77d3('0x13')],_0x60173f);_0x1378a5(_0x4500a2[_0x77d3('0x10')](0x1f4,_0x3add49['message']));});});};exports['ShowCmHopper']=function(_0x2f4542){var _0x582575=this;return new Promise(function(_0xb9ebbb,_0x14e933){return db[_0x77d3('0x16')]['find']({'raw':_0x2f4542['options']?_0x2f4542['options'][_0x77d3('0x19')]===undefined?!![]:![]:!![],'where':_0x2f4542[_0x77d3('0x18')]?_0x2f4542[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null,'attributes':_0x2f4542[_0x77d3('0x18')]?_0x2f4542[_0x77d3('0x18')][_0x77d3('0x1b')]||null:null,'include':_0x2f4542[_0x77d3('0x18')]?_0x2f4542['options']['include']?_[_0x77d3('0x1e')](_0x2f4542[_0x77d3('0x18')]['include'],function(_0x5e7a57){return{'model':db[_0x5e7a57['model']],'as':_0x5e7a57['as'],'attributes':_0x5e7a57[_0x77d3('0x1b')],'include':_0x5e7a57[_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x5e7a57[_0x77d3('0x1d')],function(_0x453956){return{'model':db[_0x453956['model']],'as':_0x453956['as'],'attributes':_0x453956['attributes'],'include':_0x453956[_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x453956[_0x77d3('0x1d')],function(_0x248534){return{'model':db[_0x248534[_0x77d3('0x1f')]],'as':_0x248534['as'],'attributes':_0x248534[_0x77d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x77d3('0xb')](function(_0x1bd366){logger[_0x77d3('0xc')](_0x77d3('0x21'),_0x2f4542);logger['debug']('ShowCmHopper',_0x2f4542,JSON[_0x77d3('0xf')](_0x1bd366));_0xb9ebbb(_0x1bd366);})['catch'](function(_0xd34464){logger['error'](_0x77d3('0x21'),_0xd34464['message'],_0x2f4542);_0x14e933(_0x582575[_0x77d3('0x10')](0x1f4,_0xd34464[_0x77d3('0x13')]));});});};exports['CreateCmHopper']=function(_0x443b6b){var _0x4580ee=this;return new Promise(function(_0x519e80,_0x163fa5){return db[_0x77d3('0x16')][_0x77d3('0x22')](_0x443b6b[_0x77d3('0x23')],{'raw':_0x443b6b[_0x77d3('0x18')]?_0x443b6b[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![]})[_0x77d3('0xb')](function(_0x5a12e4){logger[_0x77d3('0xc')](_0x77d3('0x24'),_0x443b6b);logger[_0x77d3('0x20')](_0x77d3('0x24'),_0x443b6b,JSON[_0x77d3('0xf')](_0x5a12e4));_0x519e80(_0x5a12e4);})[_0x77d3('0x14')](function(_0x2986ca){logger[_0x77d3('0x10')](_0x77d3('0x24'),_0x2986ca[_0x77d3('0x13')],_0x443b6b);_0x163fa5(_0x4580ee[_0x77d3('0x10')](0x1f4,_0x2986ca[_0x77d3('0x13')]));});});};exports[_0x77d3('0x25')]=function(_0x23f72e){var _0x553215=this;return new Promise(function(_0x316441,_0x37ea08){return db[_0x77d3('0x16')]['update'](_0x23f72e['body'],{'raw':_0x23f72e['options']?_0x23f72e[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23f72e[_0x77d3('0x18')]?_0x23f72e[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null,'attributes':_0x23f72e[_0x77d3('0x18')]?_0x23f72e['options']['attributes']||null:null,'limit':_0x23f72e[_0x77d3('0x18')]?_0x23f72e[_0x77d3('0x18')][_0x77d3('0x1c')]||null:null})['then'](function(_0x4ef56b){logger[_0x77d3('0xc')](_0x77d3('0x25'),_0x23f72e);logger['debug'](_0x77d3('0x25'),_0x23f72e,JSON['stringify'](_0x4ef56b));_0x316441(_0x4ef56b);})['catch'](function(_0x209dee){logger[_0x77d3('0x10')](_0x77d3('0x25'),_0x209dee[_0x77d3('0x13')],_0x23f72e);_0x37ea08(_0x553215[_0x77d3('0x10')](0x1f4,_0x209dee[_0x77d3('0x13')]));});});};exports[_0x77d3('0x26')]=function(_0xe38d91){var _0x5795c3=this;return new Promise(function(_0x3a08d7,_0x42148b){return db[_0x77d3('0x16')][_0x77d3('0x27')]({'where':_0xe38d91[_0x77d3('0x18')]?_0xe38d91[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null})[_0x77d3('0xb')](function(_0x3ee816){logger[_0x77d3('0xc')]('DestroyCmHopper',_0xe38d91);logger[_0x77d3('0x20')](_0x77d3('0x26'),_0xe38d91,JSON['stringify'](_0x3ee816));_0x3a08d7(_0x3ee816);})['catch'](function(_0x5c2dd6){logger[_0x77d3('0x10')]('DestroyCmHopper',_0x5c2dd6[_0x77d3('0x13')],_0xe38d91);_0x42148b(_0x5795c3[_0x77d3('0x10')](0x1f4,_0x5c2dd6[_0x77d3('0x13')]));});});};exports[_0x77d3('0x28')]=function(_0x33ae34){var _0x53abac=this;return new Promise(function(_0x1b8917,_0x514688){return db[_0x77d3('0x29')]['describe']()['then'](function(_0x3d5def){return db['sequelize'][_0x77d3('0x2a')](function(_0x204d5b){return db['CmHopper'][_0x77d3('0x17')]({'where':_0x33ae34[_0x77d3('0x18')]?_0x33ae34[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null,'attributes':_0x33ae34[_0x77d3('0x18')]?_0x33ae34[_0x77d3('0x18')][_0x77d3('0x1b')]||null:null,'limit':_0x33ae34[_0x77d3('0x18')]?_0x33ae34[_0x77d3('0x18')][_0x77d3('0x1c')]||null:null,'order':_0x33ae34['options']?_0x33ae34[_0x77d3('0x18')]['order']||null:null,'transaction':_0x204d5b,'lock':_0x204d5b[_0x77d3('0x2b')][_0x77d3('0x2c')],'include':[{'model':db['CmContact'],'as':_0x77d3('0x2d'),'attributes':_['keys'](_0x3d5def)},{'model':db[_0x77d3('0x2e')],'as':_0x77d3('0x2f'),'attributes':['id','name',_0x77d3('0x30')]}]})['then'](function(_0x47717d){var _0x1be357=[];var _0x54e798=[];for(var _0x2deccb=0x0;_0x2deccb<_0x47717d[_0x77d3('0x31')];_0x2deccb+=0x1){if(!_0x54e798[_0x77d3('0x32')](_0x47717d[_0x2deccb][_0x77d3('0x33')])){_0x54e798['push'](_0x47717d[_0x2deccb][_0x77d3('0x33')]);_0x1be357['push'](_0x47717d[_0x2deccb][_0x77d3('0x34')](_0x33ae34['body'],{'transaction':_0x204d5b}));}}return BPromise['all'](_0x1be357);});})[_0x77d3('0xb')](function(_0x5906b7){logger[_0x77d3('0xc')](_0x77d3('0x28'),_0x33ae34);logger[_0x77d3('0x20')](_0x77d3('0x28'),_0x33ae34,JSON[_0x77d3('0xf')](_0x5906b7));_0x1b8917(_0x5906b7);})[_0x77d3('0x14')](function(_0x4d194c){logger[_0x77d3('0x10')](_0x77d3('0x28'),_0x4d194c[_0x77d3('0x13')],_0x33ae34);_0x514688(_0x53abac['error'](0x1f4,_0x4d194c[_0x77d3('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x36282f){var _0x28c099=this;return new Promise(function(_0xf358a9,_0x1357b7){return db[_0x77d3('0x35')][_0x77d3('0x2a')](function(_0x5ac0ec){return db[_0x77d3('0x36')][_0x77d3('0x22')](_0x36282f['body'],{'raw':_0x36282f[_0x77d3('0x18')]?_0x36282f[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![],'transaction':_0x5ac0ec})[_0x77d3('0xb')](function(){return db[_0x77d3('0x16')][_0x77d3('0x27')]({'where':_0x36282f[_0x77d3('0x18')]?_0x36282f[_0x77d3('0x18')][_0x77d3('0x1a')]||null:null,'transaction':_0x5ac0ec});});})[_0x77d3('0xb')](function(_0x49509d){logger[_0x77d3('0xc')]('MoveContactManagedDialer',_0x36282f);logger['debug']('MoveContactManagedDialer',_0x36282f,JSON[_0x77d3('0xf')](_0x49509d));_0xf358a9(_0x49509d);})[_0x77d3('0x14')](function(_0x51ec05){logger[_0x77d3('0x10')](_0x77d3('0x37'),_0x51ec05[_0x77d3('0x13')],_0x36282f);_0x1357b7(_0x28c099[_0x77d3('0x10')](0x1f4,_0x51ec05[_0x77d3('0x13')]));});});};exports[_0x77d3('0x38')]=function(_0x353147){var _0x334927=this;return new Promise(function(_0x2c2dc0,_0x4fa657){return db[_0x77d3('0x16')]['findAll']({'raw':_0x353147[_0x77d3('0x18')]?_0x353147[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![],'where':_0x353147[_0x77d3('0x18')]?_0x353147['options'][_0x77d3('0x1a')]||null:null,'attributes':[[db[_0x77d3('0x35')]['fn'](_0x77d3('0x39'),db['sequelize']['fn']('IF',db[_0x77d3('0x35')]['literal'](_0x77d3('0x3a')+util[_0x77d3('0x3b')](_0x77d3('0x3c'),moment()['format'](_0x77d3('0x3d')))+_0x77d3('0x3e')))),'contactsRescheduled']]})[_0x77d3('0xb')](function(_0x4a240d){logger[_0x77d3('0xc')](_0x77d3('0x38'),_0x353147);logger[_0x77d3('0x20')](_0x77d3('0x38'),_0x353147,JSON[_0x77d3('0xf')](_0x4a240d));_0x2c2dc0(_0x4a240d);})[_0x77d3('0x14')](function(_0x18d806){logger[_0x77d3('0x10')]('CountReScheduled',_0x18d806[_0x77d3('0x13')],_0x353147);_0x4fa657(_0x334927[_0x77d3('0x10')](0x1f4,_0x18d806[_0x77d3('0x13')]));});});};exports[_0x77d3('0x3f')]=function(_0x5205ce){var _0x233274=this;return new Promise(function(_0x4cc3ab,_0x3dfa5f){return db[_0x77d3('0x29')]['describe']()[_0x77d3('0xb')](function(_0x17098b){return db[_0x77d3('0x35')][_0x77d3('0x2a')](function(_0x5f5a05){return db['CmHopper'][_0x77d3('0x17')]({'where':_0x5205ce[_0x77d3('0x18')]?_0x5205ce[_0x77d3('0x18')]['where']||null:null,'attributes':_0x5205ce[_0x77d3('0x18')]?_0x5205ce['options'][_0x77d3('0x1b')]||null:null,'limit':0x1,'order':_0x5205ce[_0x77d3('0x18')]?_0x5205ce[_0x77d3('0x18')][_0x77d3('0x40')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5f5a05,'lock':_0x5f5a05[_0x77d3('0x2b')][_0x77d3('0x2c')],'include':_0x5205ce[_0x77d3('0x18')]?_0x5205ce[_0x77d3('0x18')][_0x77d3('0x1d')]?_['map'](_0x5205ce['options'][_0x77d3('0x1d')],function(_0x307726){return{'model':db[_0x307726[_0x77d3('0x1f')]],'as':_0x307726['as'],'attributes':_0x307726[_0x77d3('0x1b')],'include':_0x307726[_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x307726[_0x77d3('0x1d')],function(_0x29a0fa){return{'model':db[_0x29a0fa[_0x77d3('0x1f')]],'as':_0x29a0fa['as'],'attributes':_0x29a0fa['attributes'],'include':_0x29a0fa['include']?_[_0x77d3('0x1e')](_0x29a0fa['include'],function(_0x475fd1){return{'model':db[_0x475fd1[_0x77d3('0x1f')]],'as':_0x475fd1['as'],'attributes':_0x475fd1[_0x77d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x77d3('0xb')](function(_0x8d6bec){var _0x42bdaa=[];for(var _0xa9fcc4=0x0;_0xa9fcc4<_0x8d6bec[_0x77d3('0x31')];_0xa9fcc4+=0x1){_0x42bdaa[_0x77d3('0x41')](_0x8d6bec[_0xa9fcc4][_0x77d3('0x34')](_0x5205ce['body'],{'transaction':_0x5f5a05}));}return BPromise[_0x77d3('0x42')](_0x42bdaa);});})[_0x77d3('0xb')](function(_0x1ad4d7){logger['info']('GetContactRecallMe',_0x5205ce);logger[_0x77d3('0x20')](_0x77d3('0x3f'),_0x5205ce,JSON[_0x77d3('0xf')](_0x1ad4d7));_0x4cc3ab(_0x1ad4d7);})['catch'](function(_0xe13fff){logger['error']('GetContactRecallMe',_0xe13fff[_0x77d3('0x13')],_0x5205ce);_0x3dfa5f(_0x233274[_0x77d3('0x10')](0x1f4,_0xe13fff[_0x77d3('0x13')]));});});});};exports[_0x77d3('0x43')]=function(_0x706e71){var _0x2e42a9=this;return new Promise(function(_0x333deb,_0x444e39){db[_0x77d3('0x29')][_0x77d3('0x44')]()[_0x77d3('0xb')](function(_0x2afce7){return db[_0x77d3('0x16')][_0x77d3('0x17')]({'raw':_0x706e71['options']?_0x706e71[_0x77d3('0x18')][_0x77d3('0x19')]===undefined?!![]:![]:!![],'where':_0x706e71[_0x77d3('0x18')]?_0x706e71['options'][_0x77d3('0x1a')]||null:null,'attributes':_0x706e71[_0x77d3('0x18')]?_0x706e71[_0x77d3('0x18')][_0x77d3('0x1b')]||null:null,'limit':_0x706e71[_0x77d3('0x18')]?_0x706e71[_0x77d3('0x18')][_0x77d3('0x1c')]||null:null,'include':_0x706e71['options']?_0x706e71[_0x77d3('0x18')][_0x77d3('0x1d')]?_['map'](_0x706e71[_0x77d3('0x18')]['include'],function(_0x17041b){return{'model':db[_0x17041b['model']],'as':_0x17041b['as'],'attributes':_0x17041b['as']===_0x77d3('0x2d')?_[_0x77d3('0x45')](_0x2afce7):_0x17041b[_0x77d3('0x1b')],'include':_0x17041b[_0x77d3('0x1d')]?_[_0x77d3('0x1e')](_0x17041b[_0x77d3('0x1d')],function(_0xca6905){return{'model':db[_0xca6905[_0x77d3('0x1f')]],'as':_0xca6905['as'],'attributes':_0xca6905[_0x77d3('0x1b')],'include':_0xca6905['include']?_['map'](_0xca6905[_0x77d3('0x1d')],function(_0x3a2cea){return{'model':db[_0x3a2cea[_0x77d3('0x1f')]],'as':_0x3a2cea['as'],'attributes':_0x3a2cea[_0x77d3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x259893){logger[_0x77d3('0xc')](_0x77d3('0x15'),_0x706e71);logger[_0x77d3('0x20')](_0x77d3('0x15'),_0x706e71,JSON[_0x77d3('0xf')](_0x259893));_0x333deb(_0x259893);})[_0x77d3('0x14')](function(_0x7a963f){logger[_0x77d3('0x10')](_0x77d3('0x15'),_0x7a963f[_0x77d3('0x13')],_0x706e71);_0x444e39(_0x2e42a9[_0x77d3('0x10')](0x1f4,_0x7a963f['message']));});});});};exports[_0x77d3('0x46')]=function(_0x16030d){console[_0x77d3('0x47')](_0x77d3('0x48'),_0x16030d);console['log'](_0x77d3('0x49'),_0x16030d['options'][_0x77d3('0x1a')][_0x77d3('0x4a')]);_this=this;return new Promise(function(_0x19453c,_0x10b769){return db[_0x77d3('0x29')][_0x77d3('0x4b')]({'raw':!![],'where':{'phone':_0x16030d[_0x77d3('0x18')][_0x77d3('0x1a')][_0x77d3('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x77d3('0xb')](function(_0x1d0f90){console['log'](_0x77d3('0x4c'),_0x1d0f90);logger['info']('getContactByPhone',_0x16030d);logger[_0x77d3('0x20')]('getContactByPhone',_0x16030d,JSON[_0x77d3('0xf')](_0x1d0f90));_0x19453c(_0x1d0f90);})[_0x77d3('0x14')](function(_0x5ce533){logger['error'](_0x77d3('0x4d'),_0x5ce533[_0x77d3('0x13')],_0x16030d);_0x10b769(_this[_0x77d3('0x10')](0x1f4,_0x5ce533['message']));});});}; \ No newline at end of file +var _0x7837=['format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','GetContactByPhone','log','req\x20value','phone\x20value','findOne','phone','getContactByPhone','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','model','map','info','ShowCmHopper','find','where','create','CreateCmHopper','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','Contact','keys','User','Agent','name','voicePause','includes','UserId','push','body','all','MoveContactManagedDialer','transaction','CmHopperFinal','`scheduledat`\x20>=\x20'];(function(_0x581bdb,_0x2ed81b){var _0x250669=function(_0x36926e){while(--_0x36926e){_0x581bdb['push'](_0x581bdb['shift']());}};_0x250669(++_0x2ed81b);}(_0x7837,0xf3));var _0x7783=function(_0x44abd1,_0x5246b4){_0x44abd1=_0x44abd1-0x0;var _0x1f68e9=_0x7837[_0x44abd1];return _0x1f68e9;};'use strict';var _=require(_0x7783('0x0'));var util=require(_0x7783('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7783('0x2'));var fs=require('fs');var Redis=require(_0x7783('0x3'));var db=require(_0x7783('0x4'))['db'];var utils=require(_0x7783('0x5'));var logger=require(_0x7783('0x6'))(_0x7783('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7783('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b2e6,_0x277ae3,_0x2bec94){return new BPromise(function(_0x173374,_0x46c8e2){return client[_0x7783('0x9')](_0x59b2e6,_0x2bec94)[_0x7783('0xa')](function(_0x8f7900){logger['info'](_0x7783('0xb'),_0x277ae3,_0x7783('0xc'));logger[_0x7783('0xd')](_0x7783('0xe'),_0x277ae3,_0x7783('0xc'),JSON[_0x7783('0xf')](_0x8f7900));if(_0x8f7900[_0x7783('0x10')]){if(_0x8f7900[_0x7783('0x10')][_0x7783('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x277ae3,_0x8f7900[_0x7783('0x10')]['message']);return _0x46c8e2(_0x8f7900[_0x7783('0x10')]['message']);}logger[_0x7783('0x10')](_0x7783('0xb'),_0x277ae3,_0x8f7900[_0x7783('0x10')][_0x7783('0x12')]);return _0x173374(_0x8f7900['error'][_0x7783('0x12')]);}else{logger['info'](_0x7783('0xb'),_0x277ae3,'request\x20sent');_0x173374(_0x8f7900[_0x7783('0x13')][_0x7783('0x12')]);}})[_0x7783('0x14')](function(_0xef698){logger[_0x7783('0x10')](_0x7783('0xb'),_0x277ae3,_0xef698);_0x46c8e2(_0xef698);});});}exports[_0x7783('0x15')]=function(_0x9e4acf){var _0x2a95b9=this;return new Promise(function(_0x24f950,_0x111e5e){return db[_0x7783('0x16')][_0x7783('0x17')]({'raw':_0x9e4acf[_0x7783('0x18')]?_0x9e4acf[_0x7783('0x18')][_0x7783('0x19')]===undefined?!![]:![]:!![],'where':_0x9e4acf[_0x7783('0x18')]?_0x9e4acf[_0x7783('0x18')]['where']||null:null,'attributes':_0x9e4acf[_0x7783('0x18')]?_0x9e4acf[_0x7783('0x18')][_0x7783('0x1a')]||null:null,'limit':_0x9e4acf[_0x7783('0x18')]?_0x9e4acf['options'][_0x7783('0x1b')]||null:null,'include':_0x9e4acf['options']?_0x9e4acf[_0x7783('0x18')][_0x7783('0x1c')]?_['map'](_0x9e4acf[_0x7783('0x18')][_0x7783('0x1c')],function(_0x5ae057){return{'model':db[_0x5ae057[_0x7783('0x1d')]],'as':_0x5ae057['as'],'attributes':_0x5ae057[_0x7783('0x1a')],'include':_0x5ae057['include']?_['map'](_0x5ae057[_0x7783('0x1c')],function(_0x4066e4){return{'model':db[_0x4066e4['model']],'as':_0x4066e4['as'],'attributes':_0x4066e4[_0x7783('0x1a')],'include':_0x4066e4[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x4066e4[_0x7783('0x1c')],function(_0x3a6294){return{'model':db[_0x3a6294[_0x7783('0x1d')]],'as':_0x3a6294['as'],'attributes':_0x3a6294[_0x7783('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7783('0xa')](function(_0x5b3d0a){logger[_0x7783('0x1f')](_0x7783('0x15'),_0x9e4acf);logger[_0x7783('0xd')]('GetCmHopper',_0x9e4acf,JSON[_0x7783('0xf')](_0x5b3d0a));_0x24f950(_0x5b3d0a);})[_0x7783('0x14')](function(_0x401778){logger[_0x7783('0x10')](_0x7783('0x15'),_0x401778[_0x7783('0x12')],_0x9e4acf);_0x111e5e(_0x2a95b9[_0x7783('0x10')](0x1f4,_0x401778['message']));});});};exports[_0x7783('0x20')]=function(_0x3eaf8e){var _0x3cbe28=this;return new Promise(function(_0x35785a,_0x430b7b){return db[_0x7783('0x16')][_0x7783('0x21')]({'raw':_0x3eaf8e[_0x7783('0x18')]?_0x3eaf8e[_0x7783('0x18')][_0x7783('0x19')]===undefined?!![]:![]:!![],'where':_0x3eaf8e[_0x7783('0x18')]?_0x3eaf8e[_0x7783('0x18')][_0x7783('0x22')]||null:null,'attributes':_0x3eaf8e[_0x7783('0x18')]?_0x3eaf8e[_0x7783('0x18')][_0x7783('0x1a')]||null:null,'include':_0x3eaf8e[_0x7783('0x18')]?_0x3eaf8e['options'][_0x7783('0x1c')]?_['map'](_0x3eaf8e[_0x7783('0x18')][_0x7783('0x1c')],function(_0x270957){return{'model':db[_0x270957[_0x7783('0x1d')]],'as':_0x270957['as'],'attributes':_0x270957['attributes'],'include':_0x270957[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x270957[_0x7783('0x1c')],function(_0x355589){return{'model':db[_0x355589[_0x7783('0x1d')]],'as':_0x355589['as'],'attributes':_0x355589[_0x7783('0x1a')],'include':_0x355589[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x355589[_0x7783('0x1c')],function(_0x369f78){return{'model':db[_0x369f78['model']],'as':_0x369f78['as'],'attributes':_0x369f78[_0x7783('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bb28f){logger['info']('ShowCmHopper',_0x3eaf8e);logger[_0x7783('0xd')](_0x7783('0x20'),_0x3eaf8e,JSON[_0x7783('0xf')](_0x3bb28f));_0x35785a(_0x3bb28f);})['catch'](function(_0x5637d1){logger[_0x7783('0x10')](_0x7783('0x20'),_0x5637d1[_0x7783('0x12')],_0x3eaf8e);_0x430b7b(_0x3cbe28[_0x7783('0x10')](0x1f4,_0x5637d1['message']));});});};exports['CreateCmHopper']=function(_0xd4c25b){var _0x847b56=this;return new Promise(function(_0x2d0eb9,_0x35bc91){return db['CmHopper'][_0x7783('0x23')](_0xd4c25b['body'],{'raw':_0xd4c25b[_0x7783('0x18')]?_0xd4c25b[_0x7783('0x18')][_0x7783('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x26bd30){logger[_0x7783('0x1f')](_0x7783('0x24'),_0xd4c25b);logger[_0x7783('0xd')](_0x7783('0x24'),_0xd4c25b,JSON[_0x7783('0xf')](_0x26bd30));_0x2d0eb9(_0x26bd30);})[_0x7783('0x14')](function(_0xf8c67){logger['error'](_0x7783('0x24'),_0xf8c67[_0x7783('0x12')],_0xd4c25b);_0x35bc91(_0x847b56['error'](0x1f4,_0xf8c67['message']));});});};exports[_0x7783('0x25')]=function(_0x4fe220){var _0x45994b=this;return new Promise(function(_0x4d87a4,_0x14b951){return db[_0x7783('0x16')]['update'](_0x4fe220['body'],{'raw':_0x4fe220['options']?_0x4fe220[_0x7783('0x18')][_0x7783('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe220[_0x7783('0x18')]?_0x4fe220[_0x7783('0x18')][_0x7783('0x22')]||null:null,'attributes':_0x4fe220[_0x7783('0x18')]?_0x4fe220[_0x7783('0x18')][_0x7783('0x1a')]||null:null,'limit':_0x4fe220[_0x7783('0x18')]?_0x4fe220[_0x7783('0x18')][_0x7783('0x1b')]||null:null})[_0x7783('0xa')](function(_0x26f8e7){logger['info']('UpdateCmHopper',_0x4fe220);logger[_0x7783('0xd')](_0x7783('0x25'),_0x4fe220,JSON[_0x7783('0xf')](_0x26f8e7));_0x4d87a4(_0x26f8e7);})[_0x7783('0x14')](function(_0x4daa43){logger['error'](_0x7783('0x25'),_0x4daa43['message'],_0x4fe220);_0x14b951(_0x45994b[_0x7783('0x10')](0x1f4,_0x4daa43[_0x7783('0x12')]));});});};exports['DestroyCmHopper']=function(_0x5e1d34){var _0x45df20=this;return new Promise(function(_0x86cf76,_0x3bbdad){return db[_0x7783('0x16')][_0x7783('0x26')]({'where':_0x5e1d34['options']?_0x5e1d34[_0x7783('0x18')]['where']||null:null})[_0x7783('0xa')](function(_0x17e079){logger[_0x7783('0x1f')](_0x7783('0x27'),_0x5e1d34);logger['debug'](_0x7783('0x27'),_0x5e1d34,JSON[_0x7783('0xf')](_0x17e079));_0x86cf76(_0x17e079);})[_0x7783('0x14')](function(_0x44a447){logger[_0x7783('0x10')](_0x7783('0x27'),_0x44a447[_0x7783('0x12')],_0x5e1d34);_0x3bbdad(_0x45df20[_0x7783('0x10')](0x1f4,_0x44a447[_0x7783('0x12')]));});});};exports[_0x7783('0x28')]=function(_0x1ac51f){var _0xe0a31e=this;return new Promise(function(_0x26ee52,_0x403b45){return db[_0x7783('0x29')][_0x7783('0x2a')]()[_0x7783('0xa')](function(_0x41badb){return db[_0x7783('0x2b')]['transaction'](function(_0x5b5a13){return db[_0x7783('0x16')]['findAll']({'where':_0x1ac51f[_0x7783('0x18')]?_0x1ac51f[_0x7783('0x18')][_0x7783('0x22')]||null:null,'attributes':_0x1ac51f[_0x7783('0x18')]?_0x1ac51f[_0x7783('0x18')][_0x7783('0x1a')]||null:null,'limit':_0x1ac51f[_0x7783('0x18')]?_0x1ac51f[_0x7783('0x18')][_0x7783('0x1b')]||null:null,'order':_0x1ac51f[_0x7783('0x18')]?_0x1ac51f['options'][_0x7783('0x2c')]||null:null,'transaction':_0x5b5a13,'lock':_0x5b5a13['LOCK'][_0x7783('0x2d')],'include':[{'model':db[_0x7783('0x29')],'as':_0x7783('0x2e'),'attributes':_[_0x7783('0x2f')](_0x41badb)},{'model':db[_0x7783('0x30')],'as':_0x7783('0x31'),'attributes':['id',_0x7783('0x32'),_0x7783('0x33')]}]})['then'](function(_0xcb8c04){var _0x4c6094=[];var _0x411086=[];for(var _0x25fd8f=0x0;_0x25fd8f<_0xcb8c04['length'];_0x25fd8f+=0x1){if(!_0x411086[_0x7783('0x34')](_0xcb8c04[_0x25fd8f][_0x7783('0x35')])){_0x411086[_0x7783('0x36')](_0xcb8c04[_0x25fd8f][_0x7783('0x35')]);_0x4c6094[_0x7783('0x36')](_0xcb8c04[_0x25fd8f]['update'](_0x1ac51f[_0x7783('0x37')],{'transaction':_0x5b5a13}));}}return BPromise[_0x7783('0x38')](_0x4c6094);});})[_0x7783('0xa')](function(_0x423499){logger[_0x7783('0x1f')](_0x7783('0x28'),_0x1ac51f);logger[_0x7783('0xd')](_0x7783('0x28'),_0x1ac51f,JSON[_0x7783('0xf')](_0x423499));_0x26ee52(_0x423499);})[_0x7783('0x14')](function(_0x25b63a){logger[_0x7783('0x10')](_0x7783('0x28'),_0x25b63a[_0x7783('0x12')],_0x1ac51f);_0x403b45(_0xe0a31e[_0x7783('0x10')](0x1f4,_0x25b63a[_0x7783('0x12')]));});});});};exports[_0x7783('0x39')]=function(_0x296648){var _0x79f722=this;return new Promise(function(_0x3c70be,_0x3bbd8b){return db[_0x7783('0x2b')][_0x7783('0x3a')](function(_0xcaca10){return db[_0x7783('0x3b')]['create'](_0x296648[_0x7783('0x37')],{'raw':_0x296648[_0x7783('0x18')]?_0x296648['options']['raw']===undefined?!![]:![]:!![],'transaction':_0xcaca10})[_0x7783('0xa')](function(){return db['CmHopper']['destroy']({'where':_0x296648[_0x7783('0x18')]?_0x296648[_0x7783('0x18')][_0x7783('0x22')]||null:null,'transaction':_0xcaca10});});})[_0x7783('0xa')](function(_0x3ebba9){logger[_0x7783('0x1f')](_0x7783('0x39'),_0x296648);logger[_0x7783('0xd')](_0x7783('0x39'),_0x296648,JSON[_0x7783('0xf')](_0x3ebba9));_0x3c70be(_0x3ebba9);})['catch'](function(_0x2a4962){logger[_0x7783('0x10')]('MoveContactManagedDialer',_0x2a4962['message'],_0x296648);_0x3bbd8b(_0x79f722[_0x7783('0x10')](0x1f4,_0x2a4962[_0x7783('0x12')]));});});};exports['CountReScheduled']=function(_0x5cda4e){var _0x31348e=this;return new Promise(function(_0x3b683d,_0x345fa3){return db[_0x7783('0x16')]['findAll']({'raw':_0x5cda4e['options']?_0x5cda4e['options'][_0x7783('0x19')]===undefined?!![]:![]:!![],'where':_0x5cda4e[_0x7783('0x18')]?_0x5cda4e[_0x7783('0x18')][_0x7783('0x22')]||null:null,'attributes':[[db[_0x7783('0x2b')]['fn']('COUNT',db[_0x7783('0x2b')]['fn']('IF',db[_0x7783('0x2b')]['literal'](_0x7783('0x3c')+util[_0x7783('0x3d')](_0x7783('0x3e'),moment()[_0x7783('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x7783('0x3f')))),_0x7783('0x40')]]})[_0x7783('0xa')](function(_0x2de591){logger['info'](_0x7783('0x41'),_0x5cda4e);logger['debug'](_0x7783('0x41'),_0x5cda4e,JSON['stringify'](_0x2de591));_0x3b683d(_0x2de591);})['catch'](function(_0x22d96d){logger['error']('CountReScheduled',_0x22d96d[_0x7783('0x12')],_0x5cda4e);_0x345fa3(_0x31348e[_0x7783('0x10')](0x1f4,_0x22d96d[_0x7783('0x12')]));});});};exports[_0x7783('0x42')]=function(_0x5a8279){var _0x5bec27=this;return new Promise(function(_0xd4e9eb,_0x4c7938){return db['CmContact'][_0x7783('0x2a')]()['then'](function(_0x4d1e39){return db[_0x7783('0x2b')][_0x7783('0x3a')](function(_0x44837b){return db[_0x7783('0x16')]['findAll']({'where':_0x5a8279['options']?_0x5a8279[_0x7783('0x18')][_0x7783('0x22')]||null:null,'attributes':_0x5a8279['options']?_0x5a8279['options'][_0x7783('0x1a')]||null:null,'limit':0x1,'order':_0x5a8279[_0x7783('0x18')]?_0x5a8279[_0x7783('0x18')][_0x7783('0x2c')]||null:null,'group':db[_0x7783('0x16')][_0x7783('0x35')],'transaction':_0x44837b,'lock':_0x44837b[_0x7783('0x43')][_0x7783('0x2d')],'include':_0x5a8279[_0x7783('0x18')]?_0x5a8279[_0x7783('0x18')][_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x5a8279[_0x7783('0x18')]['include'],function(_0x476906){return{'model':db[_0x476906[_0x7783('0x1d')]],'as':_0x476906['as'],'attributes':_0x476906[_0x7783('0x1a')],'include':_0x476906['include']?_[_0x7783('0x1e')](_0x476906[_0x7783('0x1c')],function(_0x58ce24){return{'model':db[_0x58ce24[_0x7783('0x1d')]],'as':_0x58ce24['as'],'attributes':_0x58ce24[_0x7783('0x1a')],'include':_0x58ce24[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x58ce24[_0x7783('0x1c')],function(_0x275bf3){return{'model':db[_0x275bf3[_0x7783('0x1d')]],'as':_0x275bf3['as'],'attributes':_0x275bf3[_0x7783('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7783('0xa')](function(_0x5743c5){var _0x587f90=[];for(var _0x4bcf17=0x0;_0x4bcf17<_0x5743c5['length'];_0x4bcf17+=0x1){_0x587f90[_0x7783('0x36')](_0x5743c5[_0x4bcf17]['update'](_0x5a8279[_0x7783('0x37')],{'transaction':_0x44837b}));}return BPromise[_0x7783('0x38')](_0x587f90);});})[_0x7783('0xa')](function(_0xed68bc){logger[_0x7783('0x1f')](_0x7783('0x42'),_0x5a8279);logger['debug'](_0x7783('0x42'),_0x5a8279,JSON[_0x7783('0xf')](_0xed68bc));_0xd4e9eb(_0xed68bc);})[_0x7783('0x14')](function(_0x28a193){logger['error'](_0x7783('0x42'),_0x28a193[_0x7783('0x12')],_0x5a8279);_0x4c7938(_0x5bec27[_0x7783('0x10')](0x1f4,_0x28a193[_0x7783('0x12')]));});});});};exports[_0x7783('0x44')]=function(_0x278ed2){var _0xcd565f=this;return new Promise(function(_0x1dc6ee,_0x4cc5fa){db['CmContact'][_0x7783('0x2a')]()['then'](function(_0x2cf47b){return db['CmHopper'][_0x7783('0x17')]({'raw':_0x278ed2['options']?_0x278ed2[_0x7783('0x18')][_0x7783('0x19')]===undefined?!![]:![]:!![],'where':_0x278ed2['options']?_0x278ed2['options']['where']||null:null,'attributes':_0x278ed2['options']?_0x278ed2[_0x7783('0x18')][_0x7783('0x1a')]||null:null,'limit':_0x278ed2[_0x7783('0x18')]?_0x278ed2[_0x7783('0x18')][_0x7783('0x1b')]||null:null,'include':_0x278ed2[_0x7783('0x18')]?_0x278ed2[_0x7783('0x18')][_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x278ed2[_0x7783('0x18')]['include'],function(_0x1d26ec){return{'model':db[_0x1d26ec[_0x7783('0x1d')]],'as':_0x1d26ec['as'],'attributes':_0x1d26ec['as']===_0x7783('0x2e')?_[_0x7783('0x2f')](_0x2cf47b):_0x1d26ec[_0x7783('0x1a')],'include':_0x1d26ec[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x1d26ec[_0x7783('0x1c')],function(_0x2471b){return{'model':db[_0x2471b['model']],'as':_0x2471b['as'],'attributes':_0x2471b[_0x7783('0x1a')],'include':_0x2471b[_0x7783('0x1c')]?_[_0x7783('0x1e')](_0x2471b['include'],function(_0x3edf59){return{'model':db[_0x3edf59[_0x7783('0x1d')]],'as':_0x3edf59['as'],'attributes':_0x3edf59[_0x7783('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7783('0xa')](function(_0x56a8b4){logger[_0x7783('0x1f')](_0x7783('0x15'),_0x278ed2);logger[_0x7783('0xd')](_0x7783('0x15'),_0x278ed2,JSON[_0x7783('0xf')](_0x56a8b4));_0x1dc6ee(_0x56a8b4);})[_0x7783('0x14')](function(_0x29da34){logger['error'](_0x7783('0x15'),_0x29da34[_0x7783('0x12')],_0x278ed2);_0x4cc5fa(_0xcd565f[_0x7783('0x10')](0x1f4,_0x29da34[_0x7783('0x12')]));});});});};exports[_0x7783('0x45')]=function(_0x4eae69){console[_0x7783('0x46')](_0x7783('0x47'),_0x4eae69);console[_0x7783('0x46')](_0x7783('0x48'),_0x4eae69['options'][_0x7783('0x22')]['phone']);_this=this;return new Promise(function(_0x1b581c,_0x3edfc9){return db[_0x7783('0x29')][_0x7783('0x49')]({'raw':!![],'where':{'phone':_0x4eae69[_0x7783('0x18')]['where'][_0x7783('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x7783('0xa')](function(_0x484ffb){console['log']('getcontactbyohone',_0x484ffb);logger[_0x7783('0x1f')](_0x7783('0x4b'),_0x4eae69);logger[_0x7783('0xd')](_0x7783('0x4b'),_0x4eae69,JSON[_0x7783('0xf')](_0x484ffb));_0x1b581c(_0x484ffb);})[_0x7783('0x14')](function(_0x4b9011){logger[_0x7783('0x10')](_0x7783('0x4b'),_0x4b9011['message'],_0x4eae69);_0x3edfc9(_this['error'](0x1f4,_0x4b9011[_0x7783('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d3f3658..7efe284 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 _0x3e74=['isAuthenticated','index','describe','/opencontacts','getTimezones','post','/preview','getPreview','getTimezone','put','update','delete','/:id','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopper.controller','get'];(function(_0x449cc7,_0x126558){var _0x3ae2a2=function(_0x325946){while(--_0x325946){_0x449cc7['push'](_0x449cc7['shift']());}};_0x3ae2a2(++_0x126558);}(_0x3e74,0x175));var _0x43e7=function(_0x90cba8,_0x9167f5){_0x90cba8=_0x90cba8-0x0;var _0x38c716=_0x3e74[_0x90cba8];return _0x38c716;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getOpenContacts']);router[_0x43e7('0x6')]('/timezones',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x7')](),controller['create']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller[_0x43e7('0xe')]);router['post']('/timezone',auth[_0x43e7('0x7')](),controller[_0x43e7('0xf')]);router[_0x43e7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')](_0x43e7('0x13'),auth[_0x43e7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb4c7=['post','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','describe','isAuthenticated','getOpenContacts','/timezones','getTimezones','/:id','show','create'];(function(_0x14984d,_0x545d1d){var _0x2fc18f=function(_0x3f69bd){while(--_0x3f69bd){_0x14984d['push'](_0x14984d['shift']());}};_0x2fc18f(++_0x545d1d);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1429ea,_0x3589ab){_0x1429ea=_0x1429ea-0x0;var _0x1ab858=_0xb4c7[_0x1429ea];return _0x1ab858;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var auth=require(_0x7b4c('0x5'));var interaction=require(_0x7b4c('0x6'));var config=require(_0x7b4c('0x7'));var controller=require(_0x7b4c('0x8'));router[_0x7b4c('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xa')]);router[_0x7b4c('0x9')](_0x7b4c('0xb'),auth['isAuthenticated'](),controller[_0x7b4c('0xc')]);router[_0x7b4c('0x9')]('/opencontacts',auth[_0x7b4c('0xd')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0x9')](_0x7b4c('0xf'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x10')]);router[_0x7b4c('0x9')](_0x7b4c('0x11'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x14')](_0x7b4c('0x15'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x16')]);router[_0x7b4c('0x14')](_0x7b4c('0x17'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x18')]);router[_0x7b4c('0x19')]('/:id',auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x1a')]);router[_0x7b4c('0x1b')](_0x7b4c('0x11'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x1c')]);module[_0x7b4c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index b433454..244c417 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce05=['moment','sequelize','exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x41449e,_0x437b3f){var _0x48f063=function(_0x112f38){while(--_0x112f38){_0x41449e['push'](_0x41449e['shift']());}};_0x48f063(++_0x437b3f);}(_0xce05,0xe0));var _0x5ce0=function(_0x288c5f,_0x49d366){_0x288c5f=_0x288c5f-0x0;var _0x3d8eea=_0xce05[_0x288c5f];return _0x3d8eea;};'use strict';var moment=require(_0x5ce0('0x0'));var Sequelize=require(_0x5ce0('0x1'));module[_0x5ce0('0x2')]={'CmHopperId':{'type':Sequelize[_0x5ce0('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5ce0('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5ce0('0x4')],'defaultValue':moment()[_0x5ce0('0x5')](_0x5ce0('0x6'))},'countbusyretry':{'type':Sequelize[_0x5ce0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5ce0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5ce0('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 +var _0x10b4=['DATE','YYYY-MM-DD\x20HH:mm:ss','exports','INTEGER','STRING'];(function(_0x41f239,_0x2141fe){var _0x3e6ce7=function(_0x2281d2){while(--_0x2281d2){_0x41f239['push'](_0x41f239['shift']());}};_0x3e6ce7(++_0x2141fe);}(_0x10b4,0x11a));var _0x410b=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x10b4[_0x1ddedd];return _0xa3e1ac;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x410b('0x0')]={'CmHopperId':{'type':Sequelize[_0x410b('0x1')]},'phone':{'type':Sequelize[_0x410b('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x410b('0x3')],'defaultValue':moment()['format'](_0x410b('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x410b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index afdc7d6..8c090a0 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1730=['error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','get','CmHopperAdditionalPhones','UserProfileResource'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x1730,0x1b0));var _0x0173=function(_0x12c1bd,_0x506035){_0x12c1bd=_0x12c1bd-0x0;var _0x2f6e16=_0x1730[_0x12c1bd];return _0x2f6e16;};'use strict';var pdf=require(_0x0173('0x0'));var emlformat=require(_0x0173('0x1'));var rimraf=require(_0x0173('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0173('0x3'));var moment=require(_0x0173('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0173('0x5'));var path=require(_0x0173('0x6'));var sox=require(_0x0173('0x7'));var csv=require(_0x0173('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0173('0x9'));var squel=require(_0x0173('0xa'));var crypto=require(_0x0173('0xb'));var jsforce=require(_0x0173('0xc'));var deskjs=require(_0x0173('0xd'));var toCsv=require(_0x0173('0x8'));var querystring=require(_0x0173('0xe'));var Papa=require(_0x0173('0xf'));var Redis=require(_0x0173('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0173('0x11'))(_0x0173('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0173('0x13'))['db'];function respondWithStatusCode(_0x2a9945,_0x1bbaaf){_0x1bbaaf=_0x1bbaaf||0xcc;return function(_0x546de6){if(_0x546de6){return _0x2a9945[_0x0173('0x14')](_0x1bbaaf);}return _0x2a9945[_0x0173('0x15')](_0x1bbaaf)[_0x0173('0x16')]();};}function respondWithResult(_0x3d8d58,_0x394010){_0x394010=_0x394010||0xc8;return function(_0x2946f5){if(_0x2946f5){return _0x3d8d58[_0x0173('0x15')](_0x394010)[_0x0173('0x17')](_0x2946f5);}};}function respondWithFilteredResult(_0x47c788,_0x1a83b1){return function(_0x36eb17){if(_0x36eb17){var _0x299148=_0x36eb17[_0x0173('0x18')],_0x4ecd04=_0x1a83b1['offset'],_0x3a8103=_0x1a83b1[_0x0173('0x19')]+_0x1a83b1[_0x0173('0x1a')],_0x2b849d;if(_0x3a8103>=_0x299148){_0x3a8103=_0x299148;_0x2b849d=0xc8;}else{_0x2b849d=0xce;}_0x47c788[_0x0173('0x15')](_0x2b849d);return _0x47c788[_0x0173('0x1b')]('Content-Range',_0x4ecd04+'-'+_0x3a8103+'/'+_0x299148)['json'](_0x36eb17);}return null;};}function patchUpdates(_0xfb035b){return function(_0x1b882b){try{jsonpatch[_0x0173('0x1c')](_0x1b882b,_0xfb035b,!![]);}catch(_0x2882d9){return BPromise[_0x0173('0x1d')](_0x2882d9);}return _0x1b882b['save']();};}function saveUpdates(_0x142807,_0x2acf78){return function(_0x114bd0){if(_0x114bd0){return _0x114bd0[_0x0173('0x1e')](_0x142807)['then'](function(_0x553feb){return _0x553feb;});}return null;};}function removeEntity(_0x1a46bf,_0x13864d){return function(_0x5c2871){if(_0x5c2871){return _0x5c2871[_0x0173('0x1f')]()[_0x0173('0x20')](function(){var _0x5a798f=_0x5c2871[_0x0173('0x21')]({'plain':!![]});var _0x4ca754=_0x0173('0x22');return db[_0x0173('0x23')][_0x0173('0x1f')]({'where':{'type':_0x4ca754,'resourceId':_0x5a798f['id']}})[_0x0173('0x20')](function(){return _0x5c2871;});})[_0x0173('0x20')](function(){_0x1a46bf[_0x0173('0x15')](0xcc)[_0x0173('0x16')]();});}};}function handleEntityNotFound(_0x2f57e2,_0x4475b9){return function(_0x49d1f4){if(!_0x49d1f4){_0x2f57e2['sendStatus'](0x194);}return _0x49d1f4;};}function handleError(_0x11e584,_0x12a7a7){_0x12a7a7=_0x12a7a7||0x1f4;return function(_0x3c363f){logger[_0x0173('0x24')](_0x3c363f['stack']);if(_0x3c363f[_0x0173('0x25')]){delete _0x3c363f[_0x0173('0x25')];}_0x11e584[_0x0173('0x15')](_0x12a7a7)[_0x0173('0x26')](_0x3c363f);};}exports[_0x0173('0x27')]=function(_0x38f337,_0x1c478c){var _0x2aadaa={},_0x830f22={},_0x2a6816={'count':0x0,'rows':[]};var _0x5d505c=_[_0x0173('0x28')](db[_0x0173('0x29')][_0x0173('0x2a')],function(_0x59228a){return{'name':_0x59228a[_0x0173('0x2b')],'type':_0x59228a['type'][_0x0173('0x2c')]};});_0x830f22[_0x0173('0x2d')]=_[_0x0173('0x28')](_0x5d505c,_0x0173('0x25'));_0x830f22['query']=_[_0x0173('0x2e')](_0x38f337[_0x0173('0x2f')]);_0x830f22[_0x0173('0x30')]=_[_0x0173('0x31')](_0x830f22[_0x0173('0x2d')],_0x830f22['query']);_0x2aadaa['attributes']=_[_0x0173('0x31')](_0x830f22[_0x0173('0x2d')],qs['fields'](_0x38f337[_0x0173('0x2f')][_0x0173('0x32')]));_0x2aadaa['attributes']=_0x2aadaa[_0x0173('0x33')][_0x0173('0x34')]?_0x2aadaa['attributes']:_0x830f22['model'];if(!_0x38f337[_0x0173('0x2f')][_0x0173('0x35')](_0x0173('0x36'))){_0x2aadaa[_0x0173('0x1a')]=qs['limit'](_0x38f337['query'][_0x0173('0x1a')]);_0x2aadaa[_0x0173('0x19')]=qs[_0x0173('0x19')](_0x38f337[_0x0173('0x2f')][_0x0173('0x19')]);}_0x2aadaa[_0x0173('0x37')]=qs[_0x0173('0x38')](_0x38f337[_0x0173('0x2f')]['sort']);_0x2aadaa['where']=qs[_0x0173('0x30')](_[_0x0173('0x39')](_0x38f337[_0x0173('0x2f')],_0x830f22[_0x0173('0x30')]),_0x5d505c);if(_0x38f337[_0x0173('0x2f')][_0x0173('0x3a')]){_0x2aadaa[_0x0173('0x3b')]=_[_0x0173('0x3c')](_0x2aadaa[_0x0173('0x3b')],{'$or':_[_0x0173('0x28')](_0x5d505c,function(_0x1cdb5d){if(_0x1cdb5d[_0x0173('0x3d')]!==_0x0173('0x3e')){var _0x36eb79={};_0x36eb79[_0x1cdb5d[_0x0173('0x25')]]={'$like':'%'+_0x38f337[_0x0173('0x2f')]['filter']+'%'};return _0x36eb79;}})});}_0x2aadaa=_[_0x0173('0x3c')]({},_0x2aadaa,_0x38f337[_0x0173('0x3f')]);var _0x21d0bc={'where':_0x2aadaa[_0x0173('0x3b')]};return db[_0x0173('0x29')][_0x0173('0x18')](_0x21d0bc)['then'](function(_0x61793){_0x2a6816[_0x0173('0x18')]=_0x61793;if(_0x38f337['query'][_0x0173('0x40')]){_0x2aadaa[_0x0173('0x41')]=[{'all':!![]}];}return db[_0x0173('0x29')][_0x0173('0x42')](_0x2aadaa);})[_0x0173('0x20')](function(_0x49abc8){_0x2a6816[_0x0173('0x43')]=_0x49abc8;return _0x2a6816;})[_0x0173('0x20')](respondWithFilteredResult(_0x1c478c,_0x2aadaa))[_0x0173('0x44')](handleError(_0x1c478c,null));};exports[_0x0173('0x45')]=function(_0x3b07a6,_0x576d99){var _0x3eb5d4={'raw':!![],'where':{'id':_0x3b07a6['params']['id']}},_0x5ba326={};_0x5ba326[_0x0173('0x2d')]=_['keys'](db[_0x0173('0x29')]['rawAttributes']);_0x5ba326['query']=_['keys'](_0x3b07a6[_0x0173('0x2f')]);_0x5ba326[_0x0173('0x30')]=_[_0x0173('0x31')](_0x5ba326[_0x0173('0x2d')],_0x5ba326[_0x0173('0x2f')]);_0x3eb5d4[_0x0173('0x33')]=_[_0x0173('0x31')](_0x5ba326[_0x0173('0x2d')],qs['fields'](_0x3b07a6['query'][_0x0173('0x32')]));_0x3eb5d4[_0x0173('0x33')]=_0x3eb5d4[_0x0173('0x33')]['length']?_0x3eb5d4[_0x0173('0x33')]:_0x5ba326[_0x0173('0x2d')];if(_0x3b07a6[_0x0173('0x2f')][_0x0173('0x40')]){_0x3eb5d4['include']=[{'all':!![]}];}_0x3eb5d4=_['merge']({},_0x3eb5d4,_0x3b07a6[_0x0173('0x3f')]);return db[_0x0173('0x29')][_0x0173('0x46')](_0x3eb5d4)[_0x0173('0x20')](handleEntityNotFound(_0x576d99,null))[_0x0173('0x20')](respondWithResult(_0x576d99,null))[_0x0173('0x44')](handleError(_0x576d99,null));};exports[_0x0173('0x47')]=function(_0x33e587,_0x4fea06){return db[_0x0173('0x29')][_0x0173('0x47')](_0x33e587['body'],{})[_0x0173('0x20')](function(_0xdd3dca){var _0x234f64=_0x33e587[_0x0173('0x48')][_0x0173('0x21')]({'plain':!![]});if(!_0x234f64)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x234f64['role']===_0x0173('0x48')){var _0x53af5d=_0xdd3dca['get']({'plain':!![]});var _0x19dca6=_0x0173('0x22');return db[_0x0173('0x49')]['find']({'where':{'name':_0x19dca6,'userProfileId':_0x234f64['userProfileId']},'raw':!![]})[_0x0173('0x20')](function(_0x31b471){if(_0x31b471&&_0x31b471[_0x0173('0x4a')]===0x0){return db['UserProfileResource'][_0x0173('0x47')]({'name':_0x53af5d[_0x0173('0x25')],'resourceId':_0x53af5d['id'],'type':_0x31b471[_0x0173('0x25')],'sectionId':_0x31b471['id']},{})[_0x0173('0x20')](function(){return _0xdd3dca;});}else{return _0xdd3dca;}})[_0x0173('0x44')](function(_0x4af1ce){logger['error'](_0x0173('0x4b'),_0x4af1ce);throw _0x4af1ce;});}return _0xdd3dca;})['then'](respondWithResult(_0x4fea06,0xc9))['catch'](handleError(_0x4fea06,null));};exports[_0x0173('0x1e')]=function(_0x125f16,_0x494b57){if(_0x125f16[_0x0173('0x4c')]['id']){delete _0x125f16[_0x0173('0x4c')]['id'];}return db[_0x0173('0x29')][_0x0173('0x46')]({'where':{'id':_0x125f16[_0x0173('0x4d')]['id']}})['then'](handleEntityNotFound(_0x494b57,null))[_0x0173('0x20')](saveUpdates(_0x125f16[_0x0173('0x4c')],null))[_0x0173('0x20')](respondWithResult(_0x494b57,null))['catch'](handleError(_0x494b57,null));};exports[_0x0173('0x1f')]=function(_0x55033b,_0x2729aa){return db[_0x0173('0x29')][_0x0173('0x46')]({'where':{'id':_0x55033b['params']['id']}})[_0x0173('0x20')](handleEntityNotFound(_0x2729aa,null))[_0x0173('0x20')](removeEntity(_0x2729aa,null))[_0x0173('0x44')](handleError(_0x2729aa,null));}; \ No newline at end of file +var _0x22d1=['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','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','UserProfileResource','destroy','end','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x3e229b,_0x346584){var _0x329ad6=function(_0xa2ef02){while(--_0xa2ef02){_0x3e229b['push'](_0x3e229b['shift']());}};_0x329ad6(++_0x346584);}(_0x22d1,0x93));var _0x122d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x22d1[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x122d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x122d('0x1'));var zipdir=require(_0x122d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x122d('0x3'));var moment=require('moment');var BPromise=require(_0x122d('0x4'));var Mustache=require(_0x122d('0x5'));var util=require(_0x122d('0x6'));var path=require(_0x122d('0x7'));var sox=require(_0x122d('0x8'));var csv=require(_0x122d('0x9'));var ejs=require(_0x122d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x122d('0xb'));var crypto=require(_0x122d('0xc'));var jsforce=require(_0x122d('0xd'));var deskjs=require(_0x122d('0xe'));var toCsv=require(_0x122d('0x9'));var querystring=require(_0x122d('0xf'));var Papa=require(_0x122d('0x10'));var Redis=require(_0x122d('0x11'));var authService=require(_0x122d('0x12'));var qs=require(_0x122d('0x13'));var as=require(_0x122d('0x14'));var hardwareService=require(_0x122d('0x15'));var logger=require(_0x122d('0x16'))('api');var utils=require(_0x122d('0x17'));var config=require('../../config/environment');var db=require(_0x122d('0x18'))['db'];function respondWithStatusCode(_0x4b57ca,_0x1c444e){_0x1c444e=_0x1c444e||0xcc;return function(_0x26bd89){if(_0x26bd89){return _0x4b57ca[_0x122d('0x19')](_0x1c444e);}return _0x4b57ca[_0x122d('0x1a')](_0x1c444e)['end']();};}function respondWithResult(_0x297065,_0x208765){_0x208765=_0x208765||0xc8;return function(_0x40a65c){if(_0x40a65c){return _0x297065['status'](_0x208765)['json'](_0x40a65c);}};}function respondWithFilteredResult(_0x1613fb,_0x5ecd45){return function(_0x3f4a54){if(_0x3f4a54){var _0x28cbde=_0x3f4a54[_0x122d('0x1b')],_0x19a52f=_0x5ecd45[_0x122d('0x1c')],_0x41e949=_0x5ecd45[_0x122d('0x1c')]+_0x5ecd45[_0x122d('0x1d')],_0x4c3638;if(_0x41e949>=_0x28cbde){_0x41e949=_0x28cbde;_0x4c3638=0xc8;}else{_0x4c3638=0xce;}_0x1613fb[_0x122d('0x1a')](_0x4c3638);return _0x1613fb['set'](_0x122d('0x1e'),_0x19a52f+'-'+_0x41e949+'/'+_0x28cbde)[_0x122d('0x1f')](_0x3f4a54);}return null;};}function patchUpdates(_0x283aa0){return function(_0x4e3dd4){try{jsonpatch['apply'](_0x4e3dd4,_0x283aa0,!![]);}catch(_0x300466){return BPromise[_0x122d('0x20')](_0x300466);}return _0x4e3dd4[_0x122d('0x21')]();};}function saveUpdates(_0x3a4081,_0x8c887e){return function(_0x7a7ea0){if(_0x7a7ea0){return _0x7a7ea0[_0x122d('0x22')](_0x3a4081)['then'](function(_0xbc84ee){return _0xbc84ee;});}return null;};}function removeEntity(_0x1c749e,_0x1818b8){return function(_0x5651e0){if(_0x5651e0){return _0x5651e0['destroy']()[_0x122d('0x23')](function(){var _0x42c7d3=_0x5651e0['get']({'plain':!![]});var _0x2949ab='CmHopperAdditionalPhones';return db[_0x122d('0x24')][_0x122d('0x25')]({'where':{'type':_0x2949ab,'resourceId':_0x42c7d3['id']}})['then'](function(){return _0x5651e0;});})[_0x122d('0x23')](function(){_0x1c749e[_0x122d('0x1a')](0xcc)[_0x122d('0x26')]();});}};}function handleEntityNotFound(_0x7c909d,_0x1403c9){return function(_0x1a3861){if(!_0x1a3861){_0x7c909d[_0x122d('0x19')](0x194);}return _0x1a3861;};}function handleError(_0x358e14,_0xbf86f){_0xbf86f=_0xbf86f||0x1f4;return function(_0x5bebc0){logger['error'](_0x5bebc0[_0x122d('0x27')]);if(_0x5bebc0[_0x122d('0x28')]){delete _0x5bebc0[_0x122d('0x28')];}_0x358e14[_0x122d('0x1a')](_0xbf86f)['send'](_0x5bebc0);};}exports[_0x122d('0x29')]=function(_0x2a48a6,_0x4bc096){var _0x44918d={},_0x36929d={},_0x26d801={'count':0x0,'rows':[]};var _0x258bcb=_[_0x122d('0x2a')](db[_0x122d('0x2b')][_0x122d('0x2c')],function(_0x177424){return{'name':_0x177424[_0x122d('0x2d')],'type':_0x177424['type'][_0x122d('0x2e')]};});_0x36929d[_0x122d('0x2f')]=_['map'](_0x258bcb,_0x122d('0x28'));_0x36929d['query']=_[_0x122d('0x30')](_0x2a48a6[_0x122d('0x31')]);_0x36929d[_0x122d('0x32')]=_[_0x122d('0x33')](_0x36929d[_0x122d('0x2f')],_0x36929d[_0x122d('0x31')]);_0x44918d[_0x122d('0x34')]=_[_0x122d('0x33')](_0x36929d['model'],qs[_0x122d('0x35')](_0x2a48a6[_0x122d('0x31')][_0x122d('0x35')]));_0x44918d[_0x122d('0x34')]=_0x44918d[_0x122d('0x34')][_0x122d('0x36')]?_0x44918d[_0x122d('0x34')]:_0x36929d[_0x122d('0x2f')];if(!_0x2a48a6[_0x122d('0x31')]['hasOwnProperty']('nolimit')){_0x44918d[_0x122d('0x1d')]=qs['limit'](_0x2a48a6[_0x122d('0x31')][_0x122d('0x1d')]);_0x44918d[_0x122d('0x1c')]=qs[_0x122d('0x1c')](_0x2a48a6['query'][_0x122d('0x1c')]);}_0x44918d[_0x122d('0x37')]=qs[_0x122d('0x38')](_0x2a48a6[_0x122d('0x31')][_0x122d('0x38')]);_0x44918d['where']=qs['filters'](_[_0x122d('0x39')](_0x2a48a6['query'],_0x36929d[_0x122d('0x32')]),_0x258bcb);if(_0x2a48a6[_0x122d('0x31')][_0x122d('0x3a')]){_0x44918d[_0x122d('0x3b')]=_['merge'](_0x44918d[_0x122d('0x3b')],{'$or':_[_0x122d('0x2a')](_0x258bcb,function(_0x16e70c){if(_0x16e70c[_0x122d('0x3c')]!==_0x122d('0x3d')){var _0x135e4f={};_0x135e4f[_0x16e70c['name']]={'$like':'%'+_0x2a48a6[_0x122d('0x31')][_0x122d('0x3a')]+'%'};return _0x135e4f;}})});}_0x44918d=_[_0x122d('0x3e')]({},_0x44918d,_0x2a48a6['options']);var _0x863a87={'where':_0x44918d[_0x122d('0x3b')]};return db[_0x122d('0x2b')]['count'](_0x863a87)[_0x122d('0x23')](function(_0x34bb81){_0x26d801[_0x122d('0x1b')]=_0x34bb81;if(_0x2a48a6[_0x122d('0x31')][_0x122d('0x3f')]){_0x44918d[_0x122d('0x40')]=[{'all':!![]}];}return db[_0x122d('0x2b')][_0x122d('0x41')](_0x44918d);})['then'](function(_0x42ae6d){_0x26d801['rows']=_0x42ae6d;return _0x26d801;})[_0x122d('0x23')](respondWithFilteredResult(_0x4bc096,_0x44918d))[_0x122d('0x42')](handleError(_0x4bc096,null));};exports['show']=function(_0x4a06db,_0x3afe9a){var _0x3bd3ff={'raw':!![],'where':{'id':_0x4a06db[_0x122d('0x43')]['id']}},_0x3bf3ce={};_0x3bf3ce[_0x122d('0x2f')]=_['keys'](db[_0x122d('0x2b')][_0x122d('0x2c')]);_0x3bf3ce[_0x122d('0x31')]=_[_0x122d('0x30')](_0x4a06db[_0x122d('0x31')]);_0x3bf3ce[_0x122d('0x32')]=_[_0x122d('0x33')](_0x3bf3ce[_0x122d('0x2f')],_0x3bf3ce[_0x122d('0x31')]);_0x3bd3ff['attributes']=_['intersection'](_0x3bf3ce[_0x122d('0x2f')],qs['fields'](_0x4a06db[_0x122d('0x31')][_0x122d('0x35')]));_0x3bd3ff['attributes']=_0x3bd3ff[_0x122d('0x34')][_0x122d('0x36')]?_0x3bd3ff[_0x122d('0x34')]:_0x3bf3ce[_0x122d('0x2f')];if(_0x4a06db[_0x122d('0x31')][_0x122d('0x3f')]){_0x3bd3ff[_0x122d('0x40')]=[{'all':!![]}];}_0x3bd3ff=_[_0x122d('0x3e')]({},_0x3bd3ff,_0x4a06db['options']);return db[_0x122d('0x2b')][_0x122d('0x44')](_0x3bd3ff)['then'](handleEntityNotFound(_0x3afe9a,null))[_0x122d('0x23')](respondWithResult(_0x3afe9a,null))[_0x122d('0x42')](handleError(_0x3afe9a,null));};exports[_0x122d('0x45')]=function(_0x4c861d,_0x8e9ea){return db[_0x122d('0x2b')][_0x122d('0x45')](_0x4c861d[_0x122d('0x46')],{})[_0x122d('0x23')](function(_0x4f52b3){var _0x43c264=_0x4c861d['user'][_0x122d('0x47')]({'plain':!![]});if(!_0x43c264)throw new Error(_0x122d('0x48'));if(_0x43c264[_0x122d('0x49')]===_0x122d('0x4a')){var _0x100eb8=_0x4f52b3[_0x122d('0x47')]({'plain':!![]});var _0x45404e=_0x122d('0x4b');return db[_0x122d('0x4c')][_0x122d('0x44')]({'where':{'name':_0x45404e,'userProfileId':_0x43c264['userProfileId']},'raw':!![]})[_0x122d('0x23')](function(_0x21ef3c){if(_0x21ef3c&&_0x21ef3c[_0x122d('0x4d')]===0x0){return db[_0x122d('0x24')][_0x122d('0x45')]({'name':_0x100eb8[_0x122d('0x28')],'resourceId':_0x100eb8['id'],'type':_0x21ef3c[_0x122d('0x28')],'sectionId':_0x21ef3c['id']},{})[_0x122d('0x23')](function(){return _0x4f52b3;});}else{return _0x4f52b3;}})[_0x122d('0x42')](function(_0x377cbe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x377cbe);throw _0x377cbe;});}return _0x4f52b3;})['then'](respondWithResult(_0x8e9ea,0xc9))[_0x122d('0x42')](handleError(_0x8e9ea,null));};exports[_0x122d('0x22')]=function(_0x56ea21,_0x9e42f6){if(_0x56ea21[_0x122d('0x46')]['id']){delete _0x56ea21['body']['id'];}return db['CmHopperAdditionalPhone'][_0x122d('0x44')]({'where':{'id':_0x56ea21[_0x122d('0x43')]['id']}})[_0x122d('0x23')](handleEntityNotFound(_0x9e42f6,null))[_0x122d('0x23')](saveUpdates(_0x56ea21[_0x122d('0x46')],null))['then'](respondWithResult(_0x9e42f6,null))[_0x122d('0x42')](handleError(_0x9e42f6,null));};exports[_0x122d('0x25')]=function(_0x33e5ff,_0x1b832f){return db[_0x122d('0x2b')][_0x122d('0x44')]({'where':{'id':_0x33e5ff[_0x122d('0x43')]['id']}})[_0x122d('0x23')](handleEntityNotFound(_0x1b832f,null))[_0x122d('0x23')](removeEntity(_0x1b832f,null))[_0x122d('0x42')](handleError(_0x1b832f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index c858f42..2ac8d34 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f9f=['define','CmHopperAdditionalPhone','../../config/logger','api','bluebird','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x4d08d8,_0x30ae54){var _0x33e8db=function(_0x292904){while(--_0x292904){_0x4d08d8['push'](_0x4d08d8['shift']());}};_0x33e8db(++_0x30ae54);}(_0x9f9f,0x92));var _0xf9f9=function(_0x19b9e3,_0x4b2f2f){_0x19b9e3=_0x19b9e3-0x0;var _0x4d8b8d=_0x9f9f[_0x19b9e3];return _0x4d8b8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9f9('0x0'))(_0xf9f9('0x1'));var moment=require('moment');var BPromise=require(_0xf9f9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf9f9('0x3'));var config=require(_0xf9f9('0x4'));var attributes=require(_0xf9f9('0x5'));module['exports']=function(_0x43b0d0,_0x4fcedd){return _0x43b0d0[_0xf9f9('0x6')](_0xf9f9('0x7'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d0=['cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','CmHopperAdditionalPhone'];(function(_0x20ce8d,_0x5427f1){var _0x453e98=function(_0x89d4d7){while(--_0x89d4d7){_0x20ce8d['push'](_0x20ce8d['shift']());}};_0x453e98(++_0x5427f1);}(_0xd5d0,0xfe));var _0x0d5d=function(_0x1fef47,_0x53f19e){_0x1fef47=_0x1fef47-0x0;var _0x3e30a1=_0xd5d0[_0x1fef47];return _0x3e30a1;};'use strict';var _=require(_0x0d5d('0x0'));var util=require(_0x0d5d('0x1'));var logger=require(_0x0d5d('0x2'))(_0x0d5d('0x3'));var moment=require(_0x0d5d('0x4'));var BPromise=require(_0x0d5d('0x5'));var rp=require(_0x0d5d('0x6'));var fs=require('fs');var path=require(_0x0d5d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x23635f,_0x23ac47){return _0x23635f[_0x0d5d('0x8')](_0x0d5d('0x9'),attributes,{'tableName':_0x0d5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 9a1d487..e3de914 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x340f=['stringify','error','code','message','result','catch','VerifyAdditionalPhones','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','then','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','entity','ASC','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','ContactId','waitTime','duration','scheduledat','add','minutes','phone','countcongestionretry','createdAt','updatedAt','isNil','hopperToAdd','additionalToHop','sequelize','transaction','update','CmHopper','field','IncrementPreviewCounters','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s'];(function(_0x166658,_0x4f8c11){var _0x2d4711=function(_0x31f7e5){while(--_0x31f7e5){_0x166658['push'](_0x166658['shift']());}};_0x2d4711(++_0x4f8c11);}(_0x340f,0x194));var _0xf340=function(_0xbb8f7a,_0x121227){_0xbb8f7a=_0xbb8f7a-0x0;var _0x2f845e=_0x340f[_0xbb8f7a];return _0x2f845e;};'use strict';var _=require(_0xf340('0x0'));var util=require('util');var moment=require(_0xf340('0x1'));var BPromise=require('bluebird');var rs=require(_0xf340('0x2'));var fs=require('fs');var Redis=require(_0xf340('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf340('0x4'))(_0xf340('0x5'));var config=require(_0xf340('0x6'));var jayson=require(_0xf340('0x7'));var client=jayson[_0xf340('0x8')][_0xf340('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x334b5c,_0x407cc4,_0x1941ac){return new BPromise(function(_0x4ed288,_0x4cf5c7){return client[_0xf340('0xa')](_0x334b5c,_0x1941ac)['then'](function(_0xc4dee3){logger[_0xf340('0xb')](_0xf340('0xc'),_0x407cc4,_0xf340('0xd'));logger[_0xf340('0xe')](_0xf340('0xf'),_0x407cc4,_0xf340('0xd'),JSON[_0xf340('0x10')](_0xc4dee3));if(_0xc4dee3['error']){if(_0xc4dee3[_0xf340('0x11')][_0xf340('0x12')]===0x1f4){logger['error'](_0xf340('0xc'),_0x407cc4,_0xc4dee3[_0xf340('0x11')][_0xf340('0x13')]);return _0x4cf5c7(_0xc4dee3[_0xf340('0x11')][_0xf340('0x13')]);}logger[_0xf340('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x407cc4,_0xc4dee3['error'][_0xf340('0x13')]);return _0x4ed288(_0xc4dee3[_0xf340('0x11')][_0xf340('0x13')]);}else{logger[_0xf340('0xb')](_0xf340('0xc'),_0x407cc4,'request\x20sent');_0x4ed288(_0xc4dee3[_0xf340('0x14')][_0xf340('0x13')]);}})[_0xf340('0x15')](function(_0x4d5f15){logger[_0xf340('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x407cc4,_0x4d5f15);_0x4cf5c7(_0x4d5f15);});});}exports[_0xf340('0x16')]=function(_0x2780b1){var _0x16c131=this;return new Promise(function(_0x316820,_0x4ce5d4){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x2780b1[_0xf340('0x17')]['ContactId'],'ListId':_0x2780b1[_0xf340('0x17')][_0xf340('0x18')],'VoiceQueueId':_0x2780b1[_0xf340('0x17')][_0xf340('0x19')]===undefined?null:_0x2780b1[_0xf340('0x17')]['VoiceQueueId'],'CampaignId':_0x2780b1[_0xf340('0x17')][_0xf340('0x1a')]===undefined?null:_0x2780b1[_0xf340('0x17')]['CampaignId']}})['then'](function(_0xb8393f){if(_0xb8393f!=null){return db[_0xf340('0x1b')][_0xf340('0x1c')]({'raw':!![],'where':{'CmHopperId':_0xb8393f['id'],'OrderBy':{'$gt':_0xb8393f[_0xf340('0x1d')]}},'order':[['OrderBy','ASC']]})[_0xf340('0x1e')](function(_0x5628e8){var _0x2adb73=0x0;if(_0x5628e8){if(_0x5628e8[_0xf340('0x1f')]+_0x5628e8['countcongestionretry']+_0x5628e8[_0xf340('0x20')]+_0x5628e8[_0xf340('0x21')]+_0x5628e8['countdropretry']+_0x5628e8['countabandonedretry']+_0x5628e8[_0xf340('0x22')]+_0x5628e8['countagentrejectretry']<_0x2780b1[_0xf340('0x23')]['dialGlobalMaxRetry'])_0x2adb73=0x1;_0x316820({'additional':_0x2adb73});}else{return db['CmHopperAdditionalPhone'][_0xf340('0x1c')]({'raw':!![],'where':{'CmHopperId':_0xb8393f['id']},'order':[[_0xf340('0x1d'),_0xf340('0x24')]]})[_0xf340('0x1e')](function(_0x4eb0d9){var _0x6025e1=0x0;if(_0x4eb0d9){if(_0x4eb0d9[_0xf340('0x1f')]+_0x4eb0d9['countcongestionretry']+_0x4eb0d9[_0xf340('0x20')]+_0x4eb0d9[_0xf340('0x21')]+_0x4eb0d9[_0xf340('0x25')]+_0x4eb0d9[_0xf340('0x26')]+_0x4eb0d9[_0xf340('0x22')]+_0x4eb0d9[_0xf340('0x27')]<_0x2780b1[_0xf340('0x23')][_0xf340('0x28')])_0x6025e1=0x1;_0x316820({'additional':_0x6025e1});}else{_0x316820({'additional':0x0});}})[_0xf340('0x15')](function(_0x125a4f){logger[_0xf340('0x11')]('VerifyAdditionalPhones',_0x125a4f[_0xf340('0x13')],_0x2780b1);_0x4ce5d4(_0x16c131[_0xf340('0x11')](0x1f4,_0x125a4f[_0xf340('0x13')]));});}})[_0xf340('0x15')](function(_0x40ef9a){logger[_0xf340('0x11')](_0xf340('0x16'),_0x40ef9a['message'],_0x2780b1);_0x4ce5d4(_0x16c131[_0xf340('0x11')](0x1f4,_0x40ef9a[_0xf340('0x13')]));});}else _0x316820({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x3a2bd3){var _0x30a857=this;return new Promise(function(_0x285dff,_0x4492e1){return db['CmHopper'][_0xf340('0x1c')]({'raw':!![],'where':{'ContactId':_0x3a2bd3[_0xf340('0x17')][_0xf340('0x29')],'ListId':_0x3a2bd3[_0xf340('0x17')][_0xf340('0x18')],'VoiceQueueId':_0x3a2bd3[_0xf340('0x17')][_0xf340('0x19')]===undefined?null:_0x3a2bd3[_0xf340('0x17')]['VoiceQueueId'],'CampaignId':_0x3a2bd3['body'][_0xf340('0x1a')]===undefined?null:_0x3a2bd3['body'][_0xf340('0x1a')]}})[_0xf340('0x1e')](function(_0x328e48){if(_0x328e48!=null){return db[_0xf340('0x1b')][_0xf340('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x328e48['id'],'OrderBy':{'$gt':_0x328e48[_0xf340('0x1d')]}},'order':[[_0xf340('0x1d'),_0xf340('0x24')]]})[_0xf340('0x1e')](function(_0x521139){if(_0x521139)return activateAdditionalPhone(_0x328e48,_0x3a2bd3[_0xf340('0x17')],_0x521139,_0x3a2bd3['duration'],_0x3a2bd3[_0xf340('0x2a')])[_0xf340('0x1e')](function(_0x56f16b){_0x285dff(_0x56f16b);});else{return db[_0xf340('0x1b')][_0xf340('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x328e48['id']},'order':[[_0xf340('0x1d'),_0xf340('0x24')]]})[_0xf340('0x1e')](function(_0x1007ce){if(_0x1007ce)return activateAdditionalPhone(_0x328e48,_0x3a2bd3[_0xf340('0x17')],_0x1007ce,_0x3a2bd3[_0xf340('0x2b')],_0x3a2bd3[_0xf340('0x2a')])[_0xf340('0x1e')](function(_0xbe40a6){_0x285dff(_0xbe40a6);});else{_0x285dff({'id':_0x328e48['id'],'phone':''});}})[_0xf340('0x15')](function(_0x4febdf){logger['error'](_0xf340('0x16'),_0x4febdf[_0xf340('0x13')],_0x3a2bd3);_0x4492e1(_0x30a857['error'](0x1f4,_0x4febdf[_0xf340('0x13')]));});}})[_0xf340('0x15')](function(_0x24ba52){logger[_0xf340('0x11')]('VerifyAdditionalPhones',_0x24ba52[_0xf340('0x13')],_0x3a2bd3);_0x4492e1(_0x30a857[_0xf340('0x11')](0x1f4,_0x24ba52[_0xf340('0x13')]));});}else _0x285dff(0x1);});});};function activateAdditionalPhone(_0x53505d,_0x398ac0,_0x12c9e3,_0x3ca323,_0xf3bb15){return new Promise(function(_0x20f3b5,_0x236f73){logger['info'](_0xf340('0x16'),_0x12c9e3);var _0x4957f2;if(moment()>moment(_0x12c9e3[_0xf340('0x2c')])){_0x4957f2=moment()[_0xf340('0x2d')](_0xf3bb15||0x3,_0xf340('0x2e'));}else{if(_0x12c9e3[_0xf340('0x1d')]==0x0){_0x4957f2=moment(_0x12c9e3[_0xf340('0x2c')]);}else{_0x4957f2=moment()[_0xf340('0x2d')](_0xf3bb15||0x3,'minutes');}}var _0x5f4f5b={'phone':_0x53505d[_0xf340('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x53505d[_0xf340('0x1d')])?0x0:_0x53505d[_0xf340('0x1d')],'scheduledat':moment()[_0xf340('0x2d')](_0x3ca323||0x1,'minutes'),'countbusyretry':_0x398ac0[_0xf340('0x1f')],'countcongestionretry':_0x398ac0[_0xf340('0x30')],'countnoanswerretry':_0x398ac0[_0xf340('0x20')],'countnosuchnumberretry':_0x398ac0[_0xf340('0x21')],'countdropretry':_0x398ac0[_0xf340('0x25')],'countabandonedretry':_0x398ac0[_0xf340('0x26')],'countmachineretry':_0x398ac0['countmachineretry'],'countagentrejectretry':_0x398ac0[_0xf340('0x27')],'createdAt':_0x398ac0[_0xf340('0x31')],'updatedAt':_0x398ac0[_0xf340('0x32')]};var _0x2929b3={'CmHopperId':_0x53505d['id'],'phone':_0x12c9e3['phone'],'active':0x0,'OrderBy':_[_0xf340('0x33')](_0x12c9e3['OrderBy'])?0x0:_0x12c9e3[_0xf340('0x1d')],'scheduledat':_0x4957f2,'countbusyretry':_0x12c9e3[_0xf340('0x1f')],'countcongestionretry':_0x12c9e3[_0xf340('0x30')],'countnoanswerretry':_0x12c9e3[_0xf340('0x20')],'countnosuchnumberretry':_0x398ac0[_0xf340('0x21')],'countdropretry':_0x398ac0[_0xf340('0x25')],'countabandonedretry':_0x398ac0[_0xf340('0x26')],'countmachineretry':_0x398ac0[_0xf340('0x22')],'countagentrejectretry':_0x398ac0['countagentrejectretry'],'createdAt':_0x12c9e3[_0xf340('0x31')],'updatedAt':_0x12c9e3[_0xf340('0x32')]};logger[_0xf340('0xb')](_0xf340('0x34'),_0x5f4f5b);logger[_0xf340('0xb')](_0xf340('0x35'),_0x2929b3);return db[_0xf340('0x36')][_0xf340('0x37')](function(_0x17f236){return db[_0xf340('0x1b')][_0xf340('0x38')](_0x5f4f5b,{'where':{'id':_0x12c9e3['id']}},{'transaction':_0x17f236})[_0xf340('0x1e')](function(){return db[_0xf340('0x39')][_0xf340('0x38')](_0x2929b3,{'where':{'id':_0x53505d['id']}},{'transaction':_0x17f236});});})[_0xf340('0x1e')](function(_0x376bee){_0x20f3b5({'id':_0x53505d['id'],'phone':_0x12c9e3['phone']});})[_0xf340('0x15')](function(_0x2b9d8e){logger[_0xf340('0x11')]('VerifyAdditionalPhones',_0x2b9d8e[_0xf340('0x13')],req);_0x236f73(_this[_0xf340('0x11')](0x1f4,_0x2b9d8e[_0xf340('0x13')]));});});}exports['IncrementPreviewCounters']=function(_0x57ec33){var _0x11c8cf=this;return new Promise(function(_0x5c8d5f,_0xa11a7a){return db[_0xf340('0x39')][_0xf340('0x38')](_0x57ec33[_0xf340('0x17')][_0xf340('0x3a')],{'where':{'id':_0x57ec33['body']['id']}})['then'](function(_0x2de5a9){_0x5c8d5f(_0x2de5a9);})[_0xf340('0x15')](function(_0x13efdf){logger[_0xf340('0x11')](_0xf340('0x3b'),_0x13efdf[_0xf340('0x13')],_0x57ec33);_0xa11a7a(_0x11c8cf[_0xf340('0x11')](0x1f4,_0x13efdf[_0xf340('0x13')]));});});}; \ No newline at end of file +var _0xa72e=['catch','CmHopper','ContactId','body','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','countabandonedretry','countagentrejectretry','VerifyAdditionalPhones','ListId','duration','scheduledat','add','minutes','phone','createdAt','updatedAt','isNil','additionalToHop','sequelize','update','IncrementPreviewCounters','field','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa72e,0x8f));var _0xea72=function(_0x564d1a,_0x4e86a9){_0x564d1a=_0x564d1a-0x0;var _0x2aa072=_0xa72e[_0x564d1a];return _0x2aa072;};'use strict';var _=require('lodash');var util=require(_0xea72('0x0'));var moment=require(_0xea72('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea72('0x2'));var logger=require(_0xea72('0x3'))('rpc');var config=require(_0xea72('0x4'));var jayson=require(_0xea72('0x5'));var client=jayson[_0xea72('0x6')][_0xea72('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52b594,_0x5eedf3,_0x3dbf3b){return new BPromise(function(_0x27bc23,_0x584fbf){return client[_0xea72('0x8')](_0x52b594,_0x3dbf3b)[_0xea72('0x9')](function(_0x172eb6){logger[_0xea72('0xa')](_0xea72('0xb'),_0x5eedf3,_0xea72('0xc'));logger[_0xea72('0xd')](_0xea72('0xe'),_0x5eedf3,'request\x20sent',JSON[_0xea72('0xf')](_0x172eb6));if(_0x172eb6[_0xea72('0x10')]){if(_0x172eb6[_0xea72('0x10')][_0xea72('0x11')]===0x1f4){logger[_0xea72('0x10')](_0xea72('0xb'),_0x5eedf3,_0x172eb6['error']['message']);return _0x584fbf(_0x172eb6['error'][_0xea72('0x12')]);}logger[_0xea72('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5eedf3,_0x172eb6['error'][_0xea72('0x12')]);return _0x27bc23(_0x172eb6[_0xea72('0x10')][_0xea72('0x12')]);}else{logger[_0xea72('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5eedf3,'request\x20sent');_0x27bc23(_0x172eb6['result'][_0xea72('0x12')]);}})[_0xea72('0x13')](function(_0x49da44){logger[_0xea72('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5eedf3,_0x49da44);_0x584fbf(_0x49da44);});});}exports['VerifyAdditionalPhones']=function(_0x10d24f){var _0x1de92e=this;return new Promise(function(_0x36f5e1,_0x38f5c3){return db[_0xea72('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x10d24f['body'][_0xea72('0x15')],'ListId':_0x10d24f[_0xea72('0x16')]['ListId'],'VoiceQueueId':_0x10d24f[_0xea72('0x16')][_0xea72('0x17')]===undefined?null:_0x10d24f['body']['VoiceQueueId'],'CampaignId':_0x10d24f[_0xea72('0x16')][_0xea72('0x18')]===undefined?null:_0x10d24f[_0xea72('0x16')][_0xea72('0x18')]}})[_0xea72('0x9')](function(_0xf1b29e){if(_0xf1b29e!=null){return db['CmHopperAdditionalPhone'][_0xea72('0x19')]({'raw':!![],'where':{'CmHopperId':_0xf1b29e['id'],'OrderBy':{'$gt':_0xf1b29e[_0xea72('0x1a')]}},'order':[['OrderBy',_0xea72('0x1b')]]})[_0xea72('0x9')](function(_0x58892d){var _0x47300f=0x0;if(_0x58892d){if(_0x58892d[_0xea72('0x1c')]+_0x58892d['countcongestionretry']+_0x58892d[_0xea72('0x1d')]+_0x58892d[_0xea72('0x1e')]+_0x58892d[_0xea72('0x1f')]+_0x58892d['countabandonedretry']+_0x58892d[_0xea72('0x20')]+_0x58892d['countagentrejectretry']<_0x10d24f[_0xea72('0x21')][_0xea72('0x22')])_0x47300f=0x1;_0x36f5e1({'additional':_0x47300f});}else{return db[_0xea72('0x23')][_0xea72('0x19')]({'raw':!![],'where':{'CmHopperId':_0xf1b29e['id']},'order':[[_0xea72('0x1a'),_0xea72('0x1b')]]})[_0xea72('0x9')](function(_0x349eb0){var _0x2c4dd5=0x0;if(_0x349eb0){if(_0x349eb0['countbusyretry']+_0x349eb0[_0xea72('0x24')]+_0x349eb0[_0xea72('0x1d')]+_0x349eb0[_0xea72('0x1e')]+_0x349eb0[_0xea72('0x1f')]+_0x349eb0[_0xea72('0x25')]+_0x349eb0[_0xea72('0x20')]+_0x349eb0[_0xea72('0x26')]<_0x10d24f['entity'][_0xea72('0x22')])_0x2c4dd5=0x1;_0x36f5e1({'additional':_0x2c4dd5});}else{_0x36f5e1({'additional':0x0});}})[_0xea72('0x13')](function(_0x254ebc){logger[_0xea72('0x10')]('VerifyAdditionalPhones',_0x254ebc['message'],_0x10d24f);_0x38f5c3(_0x1de92e[_0xea72('0x10')](0x1f4,_0x254ebc[_0xea72('0x12')]));});}})[_0xea72('0x13')](function(_0x5913fd){logger[_0xea72('0x10')](_0xea72('0x27'),_0x5913fd[_0xea72('0x12')],_0x10d24f);_0x38f5c3(_0x1de92e[_0xea72('0x10')](0x1f4,_0x5913fd[_0xea72('0x12')]));});}else _0x36f5e1({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x54b304){var _0x372b74=this;return new Promise(function(_0x15ac87,_0x2bab49){return db['CmHopper'][_0xea72('0x19')]({'raw':!![],'where':{'ContactId':_0x54b304[_0xea72('0x16')][_0xea72('0x15')],'ListId':_0x54b304[_0xea72('0x16')][_0xea72('0x28')],'VoiceQueueId':_0x54b304[_0xea72('0x16')][_0xea72('0x17')]===undefined?null:_0x54b304[_0xea72('0x16')][_0xea72('0x17')],'CampaignId':_0x54b304['body']['CampaignId']===undefined?null:_0x54b304[_0xea72('0x16')][_0xea72('0x18')]}})['then'](function(_0x56d807){if(_0x56d807!=null){return db[_0xea72('0x23')][_0xea72('0x19')]({'raw':!![],'where':{'CmHopperId':_0x56d807['id'],'OrderBy':{'$gt':_0x56d807[_0xea72('0x1a')]}},'order':[['OrderBy',_0xea72('0x1b')]]})['then'](function(_0x27c1be){if(_0x27c1be)return activateAdditionalPhone(_0x56d807,_0x54b304[_0xea72('0x16')],_0x27c1be,_0x54b304[_0xea72('0x29')],_0x54b304['waitTime'])['then'](function(_0x3b7c8f){_0x15ac87(_0x3b7c8f);});else{return db[_0xea72('0x23')][_0xea72('0x19')]({'raw':!![],'where':{'CmHopperId':_0x56d807['id']},'order':[[_0xea72('0x1a'),_0xea72('0x1b')]]})[_0xea72('0x9')](function(_0x41974f){if(_0x41974f)return activateAdditionalPhone(_0x56d807,_0x54b304[_0xea72('0x16')],_0x41974f,_0x54b304[_0xea72('0x29')],_0x54b304['waitTime'])[_0xea72('0x9')](function(_0x2b55f1){_0x15ac87(_0x2b55f1);});else{_0x15ac87({'id':_0x56d807['id'],'phone':''});}})[_0xea72('0x13')](function(_0x4c4882){logger[_0xea72('0x10')](_0xea72('0x27'),_0x4c4882[_0xea72('0x12')],_0x54b304);_0x2bab49(_0x372b74[_0xea72('0x10')](0x1f4,_0x4c4882[_0xea72('0x12')]));});}})[_0xea72('0x13')](function(_0x40d52c){logger[_0xea72('0x10')](_0xea72('0x27'),_0x40d52c[_0xea72('0x12')],_0x54b304);_0x2bab49(_0x372b74[_0xea72('0x10')](0x1f4,_0x40d52c[_0xea72('0x12')]));});}else _0x15ac87(0x1);});});};function activateAdditionalPhone(_0x2d1d75,_0x338973,_0x28167c,_0xdd2d20,_0x54886f){return new Promise(function(_0x5c2e41,_0x325a00){logger[_0xea72('0xa')](_0xea72('0x27'),_0x28167c);var _0x52e84a;if(moment()>moment(_0x28167c[_0xea72('0x2a')])){_0x52e84a=moment()[_0xea72('0x2b')](_0x54886f||0x3,_0xea72('0x2c'));}else{if(_0x28167c[_0xea72('0x1a')]==0x0){_0x52e84a=moment(_0x28167c[_0xea72('0x2a')]);}else{_0x52e84a=moment()[_0xea72('0x2b')](_0x54886f||0x3,'minutes');}}var _0x9bf7c9={'phone':_0x2d1d75[_0xea72('0x2d')],'active':0x0,'OrderBy':_['isNil'](_0x2d1d75[_0xea72('0x1a')])?0x0:_0x2d1d75[_0xea72('0x1a')],'scheduledat':moment()[_0xea72('0x2b')](_0xdd2d20||0x1,_0xea72('0x2c')),'countbusyretry':_0x338973['countbusyretry'],'countcongestionretry':_0x338973[_0xea72('0x24')],'countnoanswerretry':_0x338973[_0xea72('0x1d')],'countnosuchnumberretry':_0x338973[_0xea72('0x1e')],'countdropretry':_0x338973[_0xea72('0x1f')],'countabandonedretry':_0x338973[_0xea72('0x25')],'countmachineretry':_0x338973[_0xea72('0x20')],'countagentrejectretry':_0x338973[_0xea72('0x26')],'createdAt':_0x338973[_0xea72('0x2e')],'updatedAt':_0x338973[_0xea72('0x2f')]};var _0xdf24c6={'CmHopperId':_0x2d1d75['id'],'phone':_0x28167c['phone'],'active':0x0,'OrderBy':_[_0xea72('0x30')](_0x28167c[_0xea72('0x1a')])?0x0:_0x28167c[_0xea72('0x1a')],'scheduledat':_0x52e84a,'countbusyretry':_0x28167c[_0xea72('0x1c')],'countcongestionretry':_0x28167c[_0xea72('0x24')],'countnoanswerretry':_0x28167c[_0xea72('0x1d')],'countnosuchnumberretry':_0x338973['countnosuchnumberretry'],'countdropretry':_0x338973[_0xea72('0x1f')],'countabandonedretry':_0x338973[_0xea72('0x25')],'countmachineretry':_0x338973['countmachineretry'],'countagentrejectretry':_0x338973['countagentrejectretry'],'createdAt':_0x28167c[_0xea72('0x2e')],'updatedAt':_0x28167c[_0xea72('0x2f')]};logger[_0xea72('0xa')]('hopperToAdd',_0x9bf7c9);logger[_0xea72('0xa')](_0xea72('0x31'),_0xdf24c6);return db[_0xea72('0x32')]['transaction'](function(_0x3a7533){return db[_0xea72('0x23')][_0xea72('0x33')](_0x9bf7c9,{'where':{'id':_0x28167c['id']}},{'transaction':_0x3a7533})[_0xea72('0x9')](function(){return db[_0xea72('0x14')][_0xea72('0x33')](_0xdf24c6,{'where':{'id':_0x2d1d75['id']}},{'transaction':_0x3a7533});});})[_0xea72('0x9')](function(_0x537d47){_0x5c2e41({'id':_0x2d1d75['id'],'phone':_0x28167c[_0xea72('0x2d')]});})['catch'](function(_0x4d60fe){logger[_0xea72('0x10')](_0xea72('0x27'),_0x4d60fe[_0xea72('0x12')],req);_0x325a00(_this[_0xea72('0x10')](0x1f4,_0x4d60fe[_0xea72('0x12')]));});});}exports[_0xea72('0x34')]=function(_0x39b320){var _0x125f6b=this;return new Promise(function(_0x516c41,_0xf16b0a){return db[_0xea72('0x14')][_0xea72('0x33')](_0x39b320[_0xea72('0x16')][_0xea72('0x35')],{'where':{'id':_0x39b320[_0xea72('0x16')]['id']}})['then'](function(_0x4819af){_0x516c41(_0x4819af);})[_0xea72('0x13')](function(_0xdbbde8){logger[_0xea72('0x10')](_0xea72('0x34'),_0xdbbde8['message'],_0x39b320);_0xf16b0a(_0x125f6b[_0xea72('0x10')](0x1f4,_0xdbbde8['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 804a2ac..ef0f9c4 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['index','get','show','post','put','/:id','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x93821d,_0x49e4d0){var _0x5a98ef=function(_0x15d0d0){while(--_0x15d0d0){_0x93821d['push'](_0x93821d['shift']());}};_0x5a98ef(++_0x49e4d0);}(_0x1883,0x1e8));var _0x3188=function(_0x1e44ac,_0x34b757){_0x1e44ac=_0x1e44ac-0x0;var _0x454c8f=_0x1883[_0x1e44ac];return _0x454c8f;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3188('0x3')]();var auth=require(_0x3188('0x4'));var interaction=require(_0x3188('0x5'));var config=require(_0x3188('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0x3188('0x7')](),controller[_0x3188('0x8')]);router[_0x3188('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3188('0xa')]);router[_0x3188('0xb')]('/',auth[_0x3188('0x7')](),controller['create']);router[_0x3188('0xc')](_0x3188('0xd'),auth[_0x3188('0x7')](),controller['update']);router[_0x3188('0xe')](_0x3188('0xd'),auth[_0x3188('0x7')](),controller['destroy']);module[_0x3188('0xf')]=router; \ No newline at end of file +var _0x142a=['put','/:id','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x369ce9,_0x151dcb){var _0x359c69=function(_0x43ab6a){while(--_0x43ab6a){_0x369ce9['push'](_0x369ce9['shift']());}};_0x359c69(++_0x151dcb);}(_0x142a,0x18b));var _0xa142=function(_0x578f55,_0x4a3b8a){_0x578f55=_0x578f55-0x0;var _0x1acacd=_0x142a[_0x578f55];return _0x1acacd;};'use strict';var multer=require(_0xa142('0x0'));var util=require(_0xa142('0x1'));var path=require(_0xa142('0x2'));var timeout=require(_0xa142('0x3'));var express=require(_0xa142('0x4'));var router=express['Router']();var auth=require(_0xa142('0x5'));var interaction=require(_0xa142('0x6'));var config=require(_0xa142('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xa142('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa142('0x8')]('/:id',auth[_0xa142('0x9')](),controller[_0xa142('0xa')]);router[_0xa142('0xb')]('/',auth[_0xa142('0x9')](),controller[_0xa142('0xc')]);router[_0xa142('0xd')](_0xa142('0xe'),auth['isAuthenticated'](),controller[_0xa142('0xf')]);router['delete'](_0xa142('0xe'),auth[_0xa142('0x9')](),controller['destroy']);module[_0xa142('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 74ffea7..9279c13 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 _0x0d1d=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x409023,_0x2315c4){var _0x23e0e6=function(_0x5b4fae){while(--_0x5b4fae){_0x409023['push'](_0x409023['shift']());}};_0x23e0e6(++_0x2315c4);}(_0x0d1d,0x1c2));var _0xd0d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d1d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd0d1('0x0'));var Sequelize=require(_0xd0d1('0x1'));module[_0xd0d1('0x2')]={'phone':{'type':Sequelize[_0xd0d1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd0d1('0x4')],'unique':_0xd0d1('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd0d1('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xbbf7=['exports','INTEGER','contactListQueue','moment'];(function(_0x53b156,_0x3f16c1){var _0x4086f8=function(_0x11d683){while(--_0x11d683){_0x53b156['push'](_0x53b156['shift']());}};_0x4086f8(++_0x3f16c1);}(_0xbbf7,0xf7));var _0x7bbf=function(_0x36271f,_0x3a5737){_0x36271f=_0x36271f-0x0;var _0x54638=_0xbbf7[_0x36271f];return _0x54638;};'use strict';var moment=require(_0x7bbf('0x0'));var Sequelize=require('sequelize');module[_0x7bbf('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7bbf('0x2')],'unique':_0x7bbf('0x3')},'ListId':{'type':Sequelize[_0x7bbf('0x2')],'unique':_0x7bbf('0x3')},'VoiceQueueId':{'type':Sequelize[_0x7bbf('0x2')],'unique':_0x7bbf('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9fd5714..fc100f9 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','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','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x188feb,_0x523a2a){var _0x4687a5=function(_0x21bdeb){while(--_0x21bdeb){_0x188feb['push'](_0x188feb['shift']());}};_0x4687a5(++_0x523a2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','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','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x10362e,_0x5e1fb7){var _0x182418=function(_0x3a511e){while(--_0x3a511e){_0x10362e['push'](_0x10362e['shift']());}};_0x182418(++_0x5e1fb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 99aa207..2eace64 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api'];(function(_0x2c8d34,_0x3cb468){var _0x4920d9=function(_0x44e2ae){while(--_0x44e2ae){_0x2c8d34['push'](_0x2c8d34['shift']());}};_0x4920d9(++_0x3cb468);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api'];(function(_0x2dcd00,_0x4ad495){var _0x761ae9=function(_0x1e191e){while(--_0x1e191e){_0x2dcd00['push'](_0x2dcd00['shift']());}};_0x761ae9(++_0x4ad495);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index d3d3885..6dc24db 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 _0xb088=['findAll','options','raw','where','attributes','include','model','map','GetCmHopperBlack','debug','catch','UpdateCmHopperBlack','CmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb088,0x19d));var _0x8b08=function(_0x1d44d4,_0x8a3f5b){_0x1d44d4=_0x1d44d4-0x0;var _0x28ea7c=_0xb088[_0x1d44d4];return _0x28ea7c;};'use strict';var _=require(_0x8b08('0x0'));var util=require(_0x8b08('0x1'));var moment=require(_0x8b08('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b08('0x3'));var db=require(_0x8b08('0x4'))['db'];var utils=require(_0x8b08('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8b08('0x6'));var jayson=require(_0x8b08('0x7'));var client=jayson['client'][_0x8b08('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a7648,_0x1ef192,_0x17532d){return new BPromise(function(_0x41746a,_0x5a1d89){return client['request'](_0x4a7648,_0x17532d)[_0x8b08('0x9')](function(_0x3cb164){logger[_0x8b08('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x1ef192,_0x8b08('0xb'));logger['debug'](_0x8b08('0xc'),_0x1ef192,_0x8b08('0xb'),JSON[_0x8b08('0xd')](_0x3cb164));if(_0x3cb164[_0x8b08('0xe')]){if(_0x3cb164[_0x8b08('0xe')][_0x8b08('0xf')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1ef192,_0x3cb164['error'][_0x8b08('0x10')]);return _0x5a1d89(_0x3cb164[_0x8b08('0xe')][_0x8b08('0x10')]);}logger['error'](_0x8b08('0x11'),_0x1ef192,_0x3cb164['error'][_0x8b08('0x10')]);return _0x41746a(_0x3cb164[_0x8b08('0xe')][_0x8b08('0x10')]);}else{logger[_0x8b08('0xa')](_0x8b08('0x11'),_0x1ef192,_0x8b08('0xb'));_0x41746a(_0x3cb164[_0x8b08('0x12')][_0x8b08('0x10')]);}})['catch'](function(_0x414c27){logger[_0x8b08('0xe')](_0x8b08('0x11'),_0x1ef192,_0x414c27);_0x5a1d89(_0x414c27);});});}exports['GetCmHopperBlack']=function(_0x283c5c){var _0x7eb64a=this;return new Promise(function(_0x317cec,_0x27edc7){return db['CmHopperBlack'][_0x8b08('0x13')]({'raw':_0x283c5c[_0x8b08('0x14')]?_0x283c5c[_0x8b08('0x14')][_0x8b08('0x15')]===undefined?!![]:![]:!![],'where':_0x283c5c[_0x8b08('0x14')]?_0x283c5c[_0x8b08('0x14')][_0x8b08('0x16')]||null:null,'attributes':_0x283c5c[_0x8b08('0x14')]?_0x283c5c[_0x8b08('0x14')][_0x8b08('0x17')]||null:null,'limit':_0x283c5c[_0x8b08('0x14')]?_0x283c5c[_0x8b08('0x14')]['limit']||null:null,'include':_0x283c5c[_0x8b08('0x14')]?_0x283c5c[_0x8b08('0x14')][_0x8b08('0x18')]?_['map'](_0x283c5c['options'][_0x8b08('0x18')],function(_0x34c66e){return{'model':db[_0x34c66e[_0x8b08('0x19')]],'as':_0x34c66e['as'],'attributes':_0x34c66e[_0x8b08('0x17')],'include':_0x34c66e['include']?_[_0x8b08('0x1a')](_0x34c66e[_0x8b08('0x18')],function(_0x4fb393){return{'model':db[_0x4fb393[_0x8b08('0x19')]],'as':_0x4fb393['as'],'attributes':_0x4fb393[_0x8b08('0x17')],'include':_0x4fb393['include']?_['map'](_0x4fb393[_0x8b08('0x18')],function(_0xd667){return{'model':db[_0xd667[_0x8b08('0x19')]],'as':_0xd667['as'],'attributes':_0xd667[_0x8b08('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8b08('0x9')](function(_0x1b10ec){logger['info'](_0x8b08('0x1b'),_0x283c5c);logger[_0x8b08('0x1c')](_0x8b08('0x1b'),_0x283c5c,JSON[_0x8b08('0xd')](_0x1b10ec));_0x317cec(_0x1b10ec);})[_0x8b08('0x1d')](function(_0x3c8bc6){logger[_0x8b08('0xe')](_0x8b08('0x1b'),_0x3c8bc6['message'],_0x283c5c);_0x27edc7(_0x7eb64a[_0x8b08('0xe')](0x1f4,_0x3c8bc6[_0x8b08('0x10')]));});});};exports[_0x8b08('0x1e')]=function(_0x59d3e2){var _0x252baa=this;return new Promise(function(_0x38f154,_0x377176){return db[_0x8b08('0x1f')][_0x8b08('0x20')](_0x59d3e2['body'],{'raw':_0x59d3e2[_0x8b08('0x14')]?_0x59d3e2[_0x8b08('0x14')][_0x8b08('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d3e2[_0x8b08('0x14')]?_0x59d3e2['options'][_0x8b08('0x16')]||null:null,'attributes':_0x59d3e2[_0x8b08('0x14')]?_0x59d3e2[_0x8b08('0x14')][_0x8b08('0x17')]||null:null,'limit':_0x59d3e2[_0x8b08('0x14')]?_0x59d3e2[_0x8b08('0x14')][_0x8b08('0x21')]||null:null})[_0x8b08('0x9')](function(_0x3d3eaf){logger[_0x8b08('0xa')](_0x8b08('0x1e'),_0x59d3e2);logger[_0x8b08('0x1c')](_0x8b08('0x1e'),_0x59d3e2,JSON[_0x8b08('0xd')](_0x3d3eaf));_0x38f154(_0x3d3eaf);})[_0x8b08('0x1d')](function(_0x2a2f20){logger[_0x8b08('0xe')]('UpdateCmHopperBlack',_0x2a2f20[_0x8b08('0x10')],_0x59d3e2);_0x377176(_0x252baa[_0x8b08('0xe')](0x1f4,_0x2a2f20[_0x8b08('0x10')]));});});};exports[_0x8b08('0x22')]=function(_0x3571ba){var _0x211f67=this;return new Promise(function(_0x55383c,_0x3b7247){return db['CmHopperBlack'][_0x8b08('0x23')]({'where':_0x3571ba[_0x8b08('0x14')]?_0x3571ba['options'][_0x8b08('0x16')]||null:null})['then'](function(_0x55c500){logger[_0x8b08('0xa')]('DestroyCmHopperBlack',_0x3571ba);logger['debug'](_0x8b08('0x22'),_0x3571ba,JSON['stringify'](_0x55c500));_0x55383c(_0x55c500);})[_0x8b08('0x1d')](function(_0x377158){logger['error'](_0x8b08('0x22'),_0x377158[_0x8b08('0x10')],_0x3571ba);_0x3b7247(_0x211f67['error'](0x1f4,_0x377158['message']));});});}; \ No newline at end of file +var _0x7927=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis'];(function(_0x258dd0,_0x3c68c0){var _0x2b0aa9=function(_0x5bb709){while(--_0x5bb709){_0x258dd0['push'](_0x258dd0['shift']());}};_0x2b0aa9(++_0x3c68c0);}(_0x7927,0x76));var _0x7792=function(_0x7a7f74,_0x461e76){_0x7a7f74=_0x7a7f74-0x0;var _0x58dc13=_0x7927[_0x7a7f74];return _0x58dc13;};'use strict';var _=require(_0x7792('0x0'));var util=require(_0x7792('0x1'));var moment=require(_0x7792('0x2'));var BPromise=require('bluebird');var rs=require(_0x7792('0x3'));var fs=require('fs');var Redis=require(_0x7792('0x4'));var db=require(_0x7792('0x5'))['db'];var utils=require(_0x7792('0x6'));var logger=require(_0x7792('0x7'))(_0x7792('0x8'));var config=require(_0x7792('0x9'));var jayson=require(_0x7792('0xa'));var client=jayson[_0x7792('0xb')][_0x7792('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4db17c,_0x1fe3f5,_0x3e71d1){return new BPromise(function(_0x12467d,_0x47ac04){return client[_0x7792('0xd')](_0x4db17c,_0x3e71d1)[_0x7792('0xe')](function(_0x2b663e){logger[_0x7792('0xf')](_0x7792('0x10'),_0x1fe3f5,_0x7792('0x11'));logger['debug'](_0x7792('0x12'),_0x1fe3f5,_0x7792('0x11'),JSON[_0x7792('0x13')](_0x2b663e));if(_0x2b663e[_0x7792('0x14')]){if(_0x2b663e[_0x7792('0x14')][_0x7792('0x15')]===0x1f4){logger[_0x7792('0x14')](_0x7792('0x10'),_0x1fe3f5,_0x2b663e[_0x7792('0x14')][_0x7792('0x16')]);return _0x47ac04(_0x2b663e['error'][_0x7792('0x16')]);}logger[_0x7792('0x14')](_0x7792('0x10'),_0x1fe3f5,_0x2b663e[_0x7792('0x14')]['message']);return _0x12467d(_0x2b663e[_0x7792('0x14')][_0x7792('0x16')]);}else{logger[_0x7792('0xf')](_0x7792('0x10'),_0x1fe3f5,_0x7792('0x11'));_0x12467d(_0x2b663e[_0x7792('0x17')][_0x7792('0x16')]);}})[_0x7792('0x18')](function(_0x89ebd0){logger[_0x7792('0x14')](_0x7792('0x10'),_0x1fe3f5,_0x89ebd0);_0x47ac04(_0x89ebd0);});});}exports['GetCmHopperBlack']=function(_0x5f5b97){var _0x409b0e=this;return new Promise(function(_0x4fdecf,_0x32c093){return db[_0x7792('0x19')][_0x7792('0x1a')]({'raw':_0x5f5b97[_0x7792('0x1b')]?_0x5f5b97[_0x7792('0x1b')][_0x7792('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f5b97[_0x7792('0x1b')]?_0x5f5b97[_0x7792('0x1b')]['where']||null:null,'attributes':_0x5f5b97[_0x7792('0x1b')]?_0x5f5b97[_0x7792('0x1b')][_0x7792('0x1d')]||null:null,'limit':_0x5f5b97[_0x7792('0x1b')]?_0x5f5b97[_0x7792('0x1b')][_0x7792('0x1e')]||null:null,'include':_0x5f5b97[_0x7792('0x1b')]?_0x5f5b97[_0x7792('0x1b')][_0x7792('0x1f')]?_[_0x7792('0x20')](_0x5f5b97[_0x7792('0x1b')][_0x7792('0x1f')],function(_0x537003){return{'model':db[_0x537003[_0x7792('0x21')]],'as':_0x537003['as'],'attributes':_0x537003[_0x7792('0x1d')],'include':_0x537003['include']?_[_0x7792('0x20')](_0x537003[_0x7792('0x1f')],function(_0x5be645){return{'model':db[_0x5be645[_0x7792('0x21')]],'as':_0x5be645['as'],'attributes':_0x5be645[_0x7792('0x1d')],'include':_0x5be645['include']?_[_0x7792('0x20')](_0x5be645[_0x7792('0x1f')],function(_0x35eab2){return{'model':db[_0x35eab2[_0x7792('0x21')]],'as':_0x35eab2['as'],'attributes':_0x35eab2[_0x7792('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7792('0xe')](function(_0x1acf79){logger[_0x7792('0xf')]('GetCmHopperBlack',_0x5f5b97);logger[_0x7792('0x22')]('GetCmHopperBlack',_0x5f5b97,JSON[_0x7792('0x13')](_0x1acf79));_0x4fdecf(_0x1acf79);})[_0x7792('0x18')](function(_0x365c68){logger['error']('GetCmHopperBlack',_0x365c68[_0x7792('0x16')],_0x5f5b97);_0x32c093(_0x409b0e['error'](0x1f4,_0x365c68[_0x7792('0x16')]));});});};exports[_0x7792('0x23')]=function(_0x4488d7){var _0x3a73ba=this;return new Promise(function(_0x13aaeb,_0x273014){return db[_0x7792('0x19')][_0x7792('0x24')](_0x4488d7[_0x7792('0x25')],{'raw':_0x4488d7[_0x7792('0x1b')]?_0x4488d7[_0x7792('0x1b')][_0x7792('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4488d7['options']?_0x4488d7[_0x7792('0x1b')][_0x7792('0x26')]||null:null,'attributes':_0x4488d7['options']?_0x4488d7[_0x7792('0x1b')][_0x7792('0x1d')]||null:null,'limit':_0x4488d7['options']?_0x4488d7[_0x7792('0x1b')][_0x7792('0x1e')]||null:null})[_0x7792('0xe')](function(_0x187bb5){logger[_0x7792('0xf')]('UpdateCmHopperBlack',_0x4488d7);logger[_0x7792('0x22')]('UpdateCmHopperBlack',_0x4488d7,JSON[_0x7792('0x13')](_0x187bb5));_0x13aaeb(_0x187bb5);})[_0x7792('0x18')](function(_0x41c20e){logger[_0x7792('0x14')](_0x7792('0x23'),_0x41c20e[_0x7792('0x16')],_0x4488d7);_0x273014(_0x3a73ba['error'](0x1f4,_0x41c20e[_0x7792('0x16')]));});});};exports[_0x7792('0x27')]=function(_0x2459d3){var _0x950501=this;return new Promise(function(_0x241301,_0x4f875d){return db[_0x7792('0x19')][_0x7792('0x28')]({'where':_0x2459d3[_0x7792('0x1b')]?_0x2459d3[_0x7792('0x1b')][_0x7792('0x26')]||null:null})['then'](function(_0x59c889){logger[_0x7792('0xf')](_0x7792('0x27'),_0x2459d3);logger['debug']('DestroyCmHopperBlack',_0x2459d3,JSON[_0x7792('0x13')](_0x59c889));_0x241301(_0x59c889);})[_0x7792('0x18')](function(_0x5bf4e0){logger[_0x7792('0x14')](_0x7792('0x27'),_0x5bf4e0[_0x7792('0x16')],_0x2459d3);_0x4f875d(_0x950501[_0x7792('0x14')](0x1f4,_0x5bf4e0[_0x7792('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2825c74..bd64011 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 _0x5fd1=['/:id','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe'];(function(_0x567a35,_0x2773d){var _0x489d53=function(_0x3c5c4e){while(--_0x3c5c4e){_0x567a35['push'](_0x567a35['shift']());}};_0x489d53(++_0x2773d);}(_0x5fd1,0x155));var _0x15fd=function(_0x40e114,_0x278b52){_0x40e114=_0x40e114-0x0;var _0x2e9542=_0x5fd1[_0x40e114];return _0x2e9542;};'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 +var _0x425d=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2e9c6d,_0xbecdb4){var _0x139a4f=function(_0x58566b){while(--_0x58566b){_0x2e9c6d['push'](_0x2e9c6d['shift']());}};_0x139a4f(++_0xbecdb4);}(_0x425d,0x1e0));var _0xd425=function(_0x5cf5fd,_0x4bca34){_0x5cf5fd=_0x5cf5fd-0x0;var _0x4a53ec=_0x425d[_0x5cf5fd];return _0x4a53ec;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var auth=require(_0xd425('0x5'));var interaction=require(_0xd425('0x6'));var config=require(_0xd425('0x7'));var controller=require('./cmHopperBlack.controller');router[_0xd425('0x8')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xa')]);router[_0xd425('0x8')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller['describe']);router[_0xd425('0x8')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xd')]);router[_0xd425('0xe')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0x11')]);module[_0xd425('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5e7716c..da354ce 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 _0xa6da=['exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa6da,0x11c));var _0xaa6d=function(_0x5cd8d8,_0x4bfba4){_0x5cd8d8=_0x5cd8d8-0x0;var _0x47b62e=_0xa6da[_0x5cd8d8];return _0x47b62e;};'use strict';var Sequelize=require(_0xaa6d('0x0'));var moment=require(_0xaa6d('0x1'));module[_0xaa6d('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xaa6d('0x3')]},'scheduledat':{'type':Sequelize[_0xaa6d('0x4')]},'countbusyretry':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xaa6d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xaa6d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xaa6d('0x3')]},'calleridnum':{'type':Sequelize[_0xaa6d('0x3')]},'calleridname':{'type':Sequelize[_0xaa6d('0x3')]},'starttime':{'type':Sequelize[_0xaa6d('0x4')]},'responsetime':{'type':Sequelize[_0xaa6d('0x4')]},'answertime':{'type':Sequelize[_0xaa6d('0x4')]},'droptime':{'type':Sequelize[_0xaa6d('0x4')]},'endtime':{'type':Sequelize[_0xaa6d('0x4')]},'ringtime':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xaa6d('0x3')]},'campaign':{'type':Sequelize[_0xaa6d('0x3')]},'campaigntype':{'type':Sequelize[_0xaa6d('0x3')]},'membername':{'type':Sequelize[_0xaa6d('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xaa6d('0x4')],'set':function(_0x4063f2){var _0x4e48e1=this[_0xaa6d('0x6')](_0xaa6d('0x7'));if(_0x4e48e1&&_0x4063f2){this[_0xaa6d('0x8')](_0xaa6d('0x9'),moment(_0x4063f2)[_0xaa6d('0xa')](moment(_0x4e48e1),'seconds'));}return this['setDataValue'](_0xaa6d('0xb'),_0x4063f2);}},'amd':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xaa6d('0x4')]},'callback':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xaa6d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xaa6d('0x4')]},'deleted':{'type':Sequelize[_0xaa6d('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xaa6d('0x4')]},'recallme':{'type':Sequelize[_0xaa6d('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xaa6d('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xaa6d('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5137=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','INTEGER'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x5137,0xf9));var _0x7513=function(_0x1ab758,_0x3dbede){_0x1ab758=_0x1ab758-0x0;var _0x5788a0=_0x5137[_0x1ab758];return _0x5788a0;};'use strict';var Sequelize=require(_0x7513('0x0'));var moment=require(_0x7513('0x1'));module['exports']={'state':{'type':Sequelize[_0x7513('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7513('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7513('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7513('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x7513('0x3')]},'originatecalleridname':{'type':Sequelize[_0x7513('0x3')]},'calleridnum':{'type':Sequelize[_0x7513('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7513('0x4')]},'responsetime':{'type':Sequelize[_0x7513('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x7513('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7513('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x7513('0x3')]},'campaigntype':{'type':Sequelize[_0x7513('0x3')]},'membername':{'type':Sequelize[_0x7513('0x3')]},'reason':{'type':Sequelize[_0x7513('0x3')]},'disposition':{'type':Sequelize[_0x7513('0x3')]},'dispositionat':{'type':Sequelize[_0x7513('0x4')],'set':function(_0x31c7a4){var _0x3faa8f=this[_0x7513('0x5')](_0x7513('0x6'));if(_0x3faa8f&&_0x31c7a4){this[_0x7513('0x7')](_0x7513('0x8'),moment(_0x31c7a4)[_0x7513('0x9')](moment(_0x3faa8f),'seconds'));}return this[_0x7513('0x7')](_0x7513('0xa'),_0x31c7a4);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7513('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7513('0x4')]},'callback':{'type':Sequelize[_0x7513('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7513('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x7513('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7513('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7513('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7513('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7513('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7513('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7513('0x2')],'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 160030e..9c997d7 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 _0x2b47=['json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','CmHopperFinal','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','keys','include','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','find','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','toString','state\x20=\x204','group','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0x2b47,0x177));var _0x72b4=function(_0x4a484f,_0x2c2892){_0x4a484f=_0x4a484f-0x0;var _0x59f974=_0x2b47[_0x4a484f];return _0x59f974;};'use strict';var pdf=require(_0x72b4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x72b4('0x1'));var zipdir=require(_0x72b4('0x2'));var jsonpatch=require(_0x72b4('0x3'));var rp=require('request-promise');var moment=require(_0x72b4('0x4'));var BPromise=require(_0x72b4('0x5'));var Mustache=require(_0x72b4('0x6'));var util=require(_0x72b4('0x7'));var path=require(_0x72b4('0x8'));var sox=require(_0x72b4('0x9'));var csv=require('to-csv');var ejs=require(_0x72b4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x72b4('0xb'));var crypto=require(_0x72b4('0xc'));var jsforce=require(_0x72b4('0xd'));var deskjs=require(_0x72b4('0xe'));var toCsv=require(_0x72b4('0xf'));var querystring=require(_0x72b4('0x10'));var Papa=require(_0x72b4('0x11'));var Redis=require(_0x72b4('0x12'));var authService=require(_0x72b4('0x13'));var qs=require(_0x72b4('0x14'));var as=require(_0x72b4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72b4('0x16'))(_0x72b4('0x17'));var utils=require(_0x72b4('0x18'));var config=require(_0x72b4('0x19'));var db=require(_0x72b4('0x1a'))['db'];function respondWithStatusCode(_0x2b80f0,_0x19435a){_0x19435a=_0x19435a||0xcc;return function(_0x25cbed){if(_0x25cbed){return _0x2b80f0[_0x72b4('0x1b')](_0x19435a);}return _0x2b80f0[_0x72b4('0x1c')](_0x19435a)[_0x72b4('0x1d')]();};}function respondWithResult(_0x5bafa2,_0x3ae95d){_0x3ae95d=_0x3ae95d||0xc8;return function(_0x2d0b4f){if(_0x2d0b4f){return _0x5bafa2[_0x72b4('0x1c')](_0x3ae95d)[_0x72b4('0x1e')](_0x2d0b4f);}};}function respondWithFilteredResult(_0x5cd685,_0x5c6303){return function(_0x3eff87){if(_0x3eff87){var _0x5c7c36=_0x3eff87[_0x72b4('0x1f')],_0x21ff7d=_0x5c6303[_0x72b4('0x20')],_0x2d4fd0=_0x5c6303[_0x72b4('0x20')]+_0x5c6303[_0x72b4('0x21')],_0x5ac4fc;if(_0x2d4fd0>=_0x5c7c36){_0x2d4fd0=_0x5c7c36;_0x5ac4fc=0xc8;}else{_0x5ac4fc=0xce;}_0x5cd685[_0x72b4('0x1c')](_0x5ac4fc);return _0x5cd685[_0x72b4('0x22')](_0x72b4('0x23'),_0x21ff7d+'-'+_0x2d4fd0+'/'+_0x5c7c36)[_0x72b4('0x1e')](_0x3eff87);}return null;};}function patchUpdates(_0x1a1543){return function(_0x53c344){try{jsonpatch[_0x72b4('0x24')](_0x53c344,_0x1a1543,!![]);}catch(_0x52f908){return BPromise[_0x72b4('0x25')](_0x52f908);}return _0x53c344[_0x72b4('0x26')]();};}function saveUpdates(_0x518fda,_0x13d8d1){return function(_0xc74320){if(_0xc74320){return _0xc74320['update'](_0x518fda)[_0x72b4('0x27')](function(_0x563ddf){return _0x563ddf;});}return null;};}function removeEntity(_0x1f6547,_0x5dce4d){return function(_0x567592){if(_0x567592){return _0x567592[_0x72b4('0x28')]()['then'](function(){_0x1f6547[_0x72b4('0x1c')](0xcc)[_0x72b4('0x1d')]();});}};}function handleEntityNotFound(_0x1da2a5,_0x4f4ce8){return function(_0x3a21d6){if(!_0x3a21d6){_0x1da2a5[_0x72b4('0x1b')](0x194);}return _0x3a21d6;};}function handleError(_0x355d21,_0x48f8e0){_0x48f8e0=_0x48f8e0||0x1f4;return function(_0x2a29d8){logger[_0x72b4('0x29')](_0x2a29d8[_0x72b4('0x2a')]);if(_0x2a29d8[_0x72b4('0x2b')]){delete _0x2a29d8[_0x72b4('0x2b')];}_0x355d21[_0x72b4('0x1c')](_0x48f8e0)[_0x72b4('0x2c')](_0x2a29d8);};}exports['index']=function(_0x3743c8,_0x5d0d20){var _0x32c0ab={},_0x20bcb0={},_0x3489bc={'count':0x0,'rows':[]};var _0x464a4d=_[_0x72b4('0x2d')](db[_0x72b4('0x2e')]['rawAttributes'],function(_0x3a5a55){return{'name':_0x3a5a55[_0x72b4('0x2f')],'type':_0x3a5a55[_0x72b4('0x30')][_0x72b4('0x31')]};});_0x20bcb0[_0x72b4('0x32')]=_[_0x72b4('0x2d')](_0x464a4d,_0x72b4('0x2b'));_0x20bcb0[_0x72b4('0x33')]=_['keys'](_0x3743c8[_0x72b4('0x33')]);_0x20bcb0[_0x72b4('0x34')]=_['intersection'](_0x20bcb0[_0x72b4('0x32')],_0x20bcb0[_0x72b4('0x33')]);_0x32c0ab[_0x72b4('0x35')]=_[_0x72b4('0x36')](_0x20bcb0[_0x72b4('0x32')],qs[_0x72b4('0x37')](_0x3743c8[_0x72b4('0x33')][_0x72b4('0x37')]));_0x32c0ab[_0x72b4('0x35')]=_0x32c0ab[_0x72b4('0x35')][_0x72b4('0x38')]?_0x32c0ab[_0x72b4('0x35')]:_0x20bcb0[_0x72b4('0x32')];if(!_0x3743c8[_0x72b4('0x33')][_0x72b4('0x39')](_0x72b4('0x3a'))){_0x32c0ab['limit']=qs['limit'](_0x3743c8[_0x72b4('0x33')]['limit']);_0x32c0ab[_0x72b4('0x20')]=qs['offset'](_0x3743c8[_0x72b4('0x33')][_0x72b4('0x20')]);}_0x32c0ab[_0x72b4('0x3b')]=qs[_0x72b4('0x3c')](_0x3743c8['query'][_0x72b4('0x3c')]);_0x32c0ab[_0x72b4('0x3d')]=qs[_0x72b4('0x34')](_[_0x72b4('0x3e')](_0x3743c8[_0x72b4('0x33')],_0x20bcb0[_0x72b4('0x34')]),_0x464a4d);if(_0x3743c8[_0x72b4('0x33')][_0x72b4('0x3f')]){_0x32c0ab[_0x72b4('0x3d')]=_['merge'](_0x32c0ab['where'],{'$or':_[_0x72b4('0x2d')](_0x464a4d,function(_0x55a6ab){if(_0x55a6ab['type']!==_0x72b4('0x40')){var _0x5edb79={};_0x5edb79[_0x55a6ab[_0x72b4('0x2b')]]={'$like':'%'+_0x3743c8[_0x72b4('0x33')][_0x72b4('0x3f')]+'%'};return _0x5edb79;}})});}_0x32c0ab=_[_0x72b4('0x41')]({},_0x32c0ab,_0x3743c8[_0x72b4('0x42')]);var _0x5b61e2={'where':_0x32c0ab[_0x72b4('0x3d')]};return db[_0x72b4('0x2e')][_0x72b4('0x1f')](_0x5b61e2)[_0x72b4('0x27')](function(_0xc0e19){_0x3489bc[_0x72b4('0x1f')]=_0xc0e19;if(_0x3743c8[_0x72b4('0x33')][_0x72b4('0x43')]){_0x32c0ab['include']=[{'all':!![]}];}return db[_0x72b4('0x2e')][_0x72b4('0x44')](_0x32c0ab);})['then'](function(_0x466f42){_0x3489bc[_0x72b4('0x45')]=_0x466f42;return _0x3489bc;})[_0x72b4('0x27')](respondWithFilteredResult(_0x5d0d20,_0x32c0ab))[_0x72b4('0x46')](handleError(_0x5d0d20,null));};exports['show']=function(_0x1b8152,_0x982a27){var _0x46d043={'raw':!![],'where':{'id':_0x1b8152[_0x72b4('0x47')]['id']}},_0x1c02ee={};_0x1c02ee['model']=_['keys'](db[_0x72b4('0x2e')][_0x72b4('0x48')]);_0x1c02ee['query']=_[_0x72b4('0x49')](_0x1b8152['query']);_0x1c02ee[_0x72b4('0x34')]=_['intersection'](_0x1c02ee['model'],_0x1c02ee[_0x72b4('0x33')]);_0x46d043[_0x72b4('0x35')]=_['intersection'](_0x1c02ee[_0x72b4('0x32')],qs[_0x72b4('0x37')](_0x1b8152['query'][_0x72b4('0x37')]));_0x46d043[_0x72b4('0x35')]=_0x46d043[_0x72b4('0x35')][_0x72b4('0x38')]?_0x46d043[_0x72b4('0x35')]:_0x1c02ee['model'];if(_0x1b8152['query'][_0x72b4('0x43')]){_0x46d043[_0x72b4('0x4a')]=[{'all':!![]}];}_0x46d043=_[_0x72b4('0x41')]({},_0x46d043,_0x1b8152[_0x72b4('0x42')]);return db[_0x72b4('0x2e')]['find'](_0x46d043)['then'](handleEntityNotFound(_0x982a27,null))[_0x72b4('0x27')](respondWithResult(_0x982a27,null))[_0x72b4('0x46')](handleError(_0x982a27,null));};exports[_0x72b4('0x4b')]=function(_0x28a465,_0x4caeba){return db[_0x72b4('0x2e')][_0x72b4('0x4b')]()[_0x72b4('0x27')](respondWithResult(_0x4caeba,null))[_0x72b4('0x46')](handleError(_0x4caeba,null));};exports['update']=function(_0x12069b,_0x43869d){if(_0x12069b[_0x72b4('0x4c')]['uniqueid']){delete _0x12069b[_0x72b4('0x4c')][_0x72b4('0x4d')];}return db[_0x72b4('0x2e')]['find']({'where':{'uniqueid':_0x12069b['params']['id']}})[_0x72b4('0x27')](handleEntityNotFound(_0x43869d,null))[_0x72b4('0x27')](saveUpdates(_0x12069b['body'],null))[_0x72b4('0x27')](respondWithResult(_0x43869d,null))[_0x72b4('0x46')](handleError(_0x43869d,null));};exports[_0x72b4('0x4e')]=function(_0x31f717,_0xd6edfe,_0x515bcf){return db[_0x72b4('0x2e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x31f717[_0x72b4('0x47')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x72b4('0x4f')]['fn']('IF',db['sequelize'][_0x72b4('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0x72b4('0x51')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x53')))),'noAnswerContacts'],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db['sequelize']['fn']('IF',db[_0x72b4('0x4f')]['literal'](_0x72b4('0x54')))),_0x72b4('0x55')],[db['sequelize']['fn']('COUNT',db[_0x72b4('0x4f')]['fn']('IF',db['sequelize'][_0x72b4('0x50')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db['sequelize']['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x56')))),_0x72b4('0x57')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x58')))),'abandonedContacts'],[db['sequelize']['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db['sequelize'][_0x72b4('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x72b4('0x59')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')]('`state`\x20=\x2019,\x201,\x20null'))),_0x72b4('0x5a')]]})[_0x72b4('0x27')](handleEntityNotFound(_0xd6edfe,null))[_0x72b4('0x27')](respondWithResult(_0xd6edfe,null))[_0x72b4('0x46')](handleError(_0xd6edfe,null));};exports[_0x72b4('0x5b')]=function(_0x291bc3,_0x1a4346,_0x126e09){return db[_0x72b4('0x2e')][_0x72b4('0x44')]({'raw':![],'where':{'CampaignId':_0x291bc3[_0x72b4('0x47')]['id']},'attributes':[[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db['sequelize']['fn']('IF',db[_0x72b4('0x4f')]['literal'](_0x72b4('0x5c')))),'noSuchContacts'],[db['sequelize']['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db['sequelize'][_0x72b4('0x50')](_0x72b4('0x53')))),_0x72b4('0x5d')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x54')))),_0x72b4('0x55')],[db['sequelize']['fn']('COUNT',db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x5e')))),_0x72b4('0x5f')],[db[_0x72b4('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x72b4('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x72b4('0x57')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72b4('0x60')],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x61')))),'reCallContacts'],[db[_0x72b4('0x4f')]['fn'](_0x72b4('0x52'),db[_0x72b4('0x4f')]['fn']('IF',db[_0x72b4('0x4f')][_0x72b4('0x50')](_0x72b4('0x62')))),'answeringMachine']]})[_0x72b4('0x27')](handleEntityNotFound(_0x1a4346,null))[_0x72b4('0x27')](respondWithResult(_0x1a4346,null))['catch'](handleError(_0x1a4346,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0xe693d3,_0x3dccba,_0x2dbf1b){return db['VoiceQueue'][_0x72b4('0x63')]({'where':{'id':_0xe693d3[_0x72b4('0x47')]['id']}})[_0x72b4('0x27')](handleEntityNotFound(_0x3dccba,null))[_0x72b4('0x27')](function(_0x1dd69a){var _0x4a2fc5;if(_0x1dd69a){_0x4a2fc5=squel[_0x72b4('0x64')]()[_0x72b4('0x65')]('cm_hopper')[_0x72b4('0x66')]([_0x72b4('0x67'),_0x72b4('0x68'),_0x72b4('0x69'),_0x72b4('0x6a'),_0x72b4('0x6b'),_0x72b4('0x6c'),_0x72b4('0x6d')],squel['select']()[_0x72b4('0x6e')](_0x72b4('0x6f'),'phone')[_0x72b4('0x6e')](_0x72b4('0x70'),'scheduledAt')[_0x72b4('0x6e')](_0x72b4('0x71'),_0x72b4('0x69'))[_0x72b4('0x6e')]('ANY_VALUE(ListId)',_0x72b4('0x6a'))[_0x72b4('0x6e')](_0x72b4('0x72'),'VoiceQueueId')['field'](_0x72b4('0x70'),_0x72b4('0x6c'))[_0x72b4('0x6e')](_0x72b4('0x70'),_0x72b4('0x6d'))['from'](_0x72b4('0x73'))[_0x72b4('0x3d')](_0x72b4('0x74'),_0xe693d3[_0x72b4('0x47')]['id']['toString']())[_0x72b4('0x3d')](_0x72b4('0x75'),_0xe693d3[_0x72b4('0x4c')][_0x72b4('0x76')]['toString']())[_0x72b4('0x3d')](_0x72b4('0x77'))['where'](_0x72b4('0x78'),squel[_0x72b4('0x79')]()['field'](_0x72b4('0x67'))[_0x72b4('0x7a')](_0x72b4('0x7b'))[_0x72b4('0x3d')](_0x72b4('0x74'),_0xe693d3[_0x72b4('0x47')]['id']['toString']()))['where'](_0x72b4('0x78'),squel['select']()[_0x72b4('0x6e')](_0x72b4('0x7c'))[_0x72b4('0x7a')](_0x72b4('0x73'))[_0x72b4('0x3d')]('VoiceQueueId\x20=\x20?',_0xe693d3[_0x72b4('0x47')]['id'][_0x72b4('0x7d')]())[_0x72b4('0x3d')](_0x72b4('0x7e')))[_0x72b4('0x7f')]('ContactId'))[_0x72b4('0x7d')]();return db[_0x72b4('0x4f')][_0x72b4('0x33')](_0x4a2fc5);}return[];})[_0x72b4('0x27')](respondWithResult(_0x3dccba,null))[_0x72b4('0x46')](handleError(_0x3dccba,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x402e78,_0x35463d,_0x20462b){return db['Campaign'][_0x72b4('0x63')]({'where':{'id':_0x402e78[_0x72b4('0x47')]['id']}})[_0x72b4('0x27')](handleEntityNotFound(_0x35463d,null))[_0x72b4('0x27')](function(_0x2c08b4){var _0x4045d3;if(_0x2c08b4){_0x4045d3=squel[_0x72b4('0x64')]()[_0x72b4('0x65')](_0x72b4('0x7b'))[_0x72b4('0x66')](['phone',_0x72b4('0x68'),_0x72b4('0x69'),_0x72b4('0x6a'),'CampaignId','createdAt',_0x72b4('0x6d')],squel[_0x72b4('0x79')]()['field'](_0x72b4('0x6f'),_0x72b4('0x67'))['field']('NOW()',_0x72b4('0x68'))[_0x72b4('0x6e')](_0x72b4('0x71'),'ContactId')[_0x72b4('0x6e')](_0x72b4('0x80'),_0x72b4('0x6a'))[_0x72b4('0x6e')](_0x72b4('0x81'),_0x72b4('0x82'))[_0x72b4('0x6e')](_0x72b4('0x70'),'createdAt')['field'](_0x72b4('0x70'),_0x72b4('0x6d'))[_0x72b4('0x7a')](_0x72b4('0x73'))['where'](_0x72b4('0x83'),_0x402e78[_0x72b4('0x47')]['id'][_0x72b4('0x7d')]())[_0x72b4('0x3d')](_0x72b4('0x75'),_0x402e78[_0x72b4('0x4c')][_0x72b4('0x76')][_0x72b4('0x7d')]())[_0x72b4('0x3d')](_0x72b4('0x77'))[_0x72b4('0x3d')](_0x72b4('0x78'),squel['select']()[_0x72b4('0x6e')](_0x72b4('0x67'))[_0x72b4('0x7a')](_0x72b4('0x7b'))[_0x72b4('0x3d')](_0x72b4('0x83'),_0x402e78['params']['id'][_0x72b4('0x7d')]()))[_0x72b4('0x3d')](_0x72b4('0x78'),squel['select']()[_0x72b4('0x6e')](_0x72b4('0x7c'))['from'](_0x72b4('0x73'))['where'](_0x72b4('0x83'),_0x402e78[_0x72b4('0x47')]['id'][_0x72b4('0x7d')]())[_0x72b4('0x3d')](_0x72b4('0x7e')))['group'](_0x72b4('0x69')))['toString']();return db[_0x72b4('0x4f')][_0x72b4('0x33')](_0x4045d3);}return[];})['then'](respondWithResult(_0x35463d,null))[_0x72b4('0x46')](handleError(_0x35463d,null));};exports[_0x72b4('0x84')]=function(_0x487ab6,_0x690a0f,_0x424eb9){return db[_0x72b4('0x85')][_0x72b4('0x86')]({'where':{'VoiceQueueId':_0x487ab6[_0x72b4('0x4c')][_0x72b4('0x6b')],'CampaignId':_0x487ab6[_0x72b4('0x4c')][_0x72b4('0x82')],'ContactId':_0x487ab6['body'][_0x72b4('0x69')]}})[_0x72b4('0x27')](handleEntityNotFound(_0x690a0f,null))[_0x72b4('0x27')](function(_0x4dd867){if(_0x4dd867){return _0x4dd867;}return null;})['then'](respondWithResult(_0x690a0f,null))[_0x72b4('0x46')](handleError(_0x690a0f,null));}; \ No newline at end of file +var _0x323f=['json','apply','save','then','destroy','sendStatus','error','stack','name','send','map','CmHopperFinal','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','toString','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/environment','status','end','count','offset','limit','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x323f,0x1ee));var _0xf323=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x323f[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf323('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf323('0x1'));var jsonpatch=require(_0xf323('0x2'));var rp=require(_0xf323('0x3'));var moment=require(_0xf323('0x4'));var BPromise=require(_0xf323('0x5'));var Mustache=require(_0xf323('0x6'));var util=require(_0xf323('0x7'));var path=require(_0xf323('0x8'));var sox=require(_0xf323('0x9'));var csv=require(_0xf323('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0xa'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6a09,_0x7dbd26){_0x7dbd26=_0x7dbd26||0xcc;return function(_0x26eddb){if(_0x26eddb){return _0x1b6a09['sendStatus'](_0x7dbd26);}return _0x1b6a09[_0xf323('0x1b')](_0x7dbd26)[_0xf323('0x1c')]();};}function respondWithResult(_0x367db4,_0x3a829f){_0x3a829f=_0x3a829f||0xc8;return function(_0x22672e){if(_0x22672e){return _0x367db4[_0xf323('0x1b')](_0x3a829f)['json'](_0x22672e);}};}function respondWithFilteredResult(_0x4cc3ce,_0x874219){return function(_0x447517){if(_0x447517){var _0x38fd4c=_0x447517[_0xf323('0x1d')],_0x3858ee=_0x874219[_0xf323('0x1e')],_0x3db58a=_0x874219[_0xf323('0x1e')]+_0x874219[_0xf323('0x1f')],_0x55d87d;if(_0x3db58a>=_0x38fd4c){_0x3db58a=_0x38fd4c;_0x55d87d=0xc8;}else{_0x55d87d=0xce;}_0x4cc3ce['status'](_0x55d87d);return _0x4cc3ce[_0xf323('0x20')](_0xf323('0x21'),_0x3858ee+'-'+_0x3db58a+'/'+_0x38fd4c)[_0xf323('0x22')](_0x447517);}return null;};}function patchUpdates(_0x41b2cb){return function(_0x5955ea){try{jsonpatch[_0xf323('0x23')](_0x5955ea,_0x41b2cb,!![]);}catch(_0x9ce1ba){return BPromise['reject'](_0x9ce1ba);}return _0x5955ea[_0xf323('0x24')]();};}function saveUpdates(_0x44378e,_0x32a942){return function(_0x183ce0){if(_0x183ce0){return _0x183ce0['update'](_0x44378e)[_0xf323('0x25')](function(_0x1831bd){return _0x1831bd;});}return null;};}function removeEntity(_0x1c29d9,_0x52305d){return function(_0x43e467){if(_0x43e467){return _0x43e467[_0xf323('0x26')]()[_0xf323('0x25')](function(){_0x1c29d9[_0xf323('0x1b')](0xcc)[_0xf323('0x1c')]();});}};}function handleEntityNotFound(_0xa3362c,_0x189b23){return function(_0x43bc05){if(!_0x43bc05){_0xa3362c[_0xf323('0x27')](0x194);}return _0x43bc05;};}function handleError(_0x47fb15,_0xf85efe){_0xf85efe=_0xf85efe||0x1f4;return function(_0x308073){logger[_0xf323('0x28')](_0x308073[_0xf323('0x29')]);if(_0x308073[_0xf323('0x2a')]){delete _0x308073[_0xf323('0x2a')];}_0x47fb15['status'](_0xf85efe)[_0xf323('0x2b')](_0x308073);};}exports['index']=function(_0x1570d4,_0x3902eb){var _0x56be0c={},_0x46663b={},_0x3c95ce={'count':0x0,'rows':[]};var _0x2b6254=_[_0xf323('0x2c')](db[_0xf323('0x2d')]['rawAttributes'],function(_0x44c944){return{'name':_0x44c944[_0xf323('0x2e')],'type':_0x44c944[_0xf323('0x2f')][_0xf323('0x30')]};});_0x46663b[_0xf323('0x31')]=_[_0xf323('0x2c')](_0x2b6254,_0xf323('0x2a'));_0x46663b[_0xf323('0x32')]=_[_0xf323('0x33')](_0x1570d4['query']);_0x46663b[_0xf323('0x34')]=_[_0xf323('0x35')](_0x46663b[_0xf323('0x31')],_0x46663b[_0xf323('0x32')]);_0x56be0c[_0xf323('0x36')]=_['intersection'](_0x46663b[_0xf323('0x31')],qs[_0xf323('0x37')](_0x1570d4[_0xf323('0x32')][_0xf323('0x37')]));_0x56be0c[_0xf323('0x36')]=_0x56be0c['attributes'][_0xf323('0x38')]?_0x56be0c[_0xf323('0x36')]:_0x46663b[_0xf323('0x31')];if(!_0x1570d4[_0xf323('0x32')]['hasOwnProperty'](_0xf323('0x39'))){_0x56be0c['limit']=qs[_0xf323('0x1f')](_0x1570d4[_0xf323('0x32')]['limit']);_0x56be0c[_0xf323('0x1e')]=qs['offset'](_0x1570d4[_0xf323('0x32')]['offset']);}_0x56be0c[_0xf323('0x3a')]=qs['sort'](_0x1570d4[_0xf323('0x32')][_0xf323('0x3b')]);_0x56be0c['where']=qs['filters'](_['pick'](_0x1570d4[_0xf323('0x32')],_0x46663b[_0xf323('0x34')]),_0x2b6254);if(_0x1570d4[_0xf323('0x32')][_0xf323('0x3c')]){_0x56be0c[_0xf323('0x3d')]=_['merge'](_0x56be0c['where'],{'$or':_['map'](_0x2b6254,function(_0x365297){if(_0x365297['type']!==_0xf323('0x3e')){var _0x47e7a2={};_0x47e7a2[_0x365297[_0xf323('0x2a')]]={'$like':'%'+_0x1570d4[_0xf323('0x32')][_0xf323('0x3c')]+'%'};return _0x47e7a2;}})});}_0x56be0c=_[_0xf323('0x3f')]({},_0x56be0c,_0x1570d4[_0xf323('0x40')]);var _0x48a6c4={'where':_0x56be0c[_0xf323('0x3d')]};return db[_0xf323('0x2d')][_0xf323('0x1d')](_0x48a6c4)[_0xf323('0x25')](function(_0x455f75){_0x3c95ce[_0xf323('0x1d')]=_0x455f75;if(_0x1570d4[_0xf323('0x32')][_0xf323('0x41')]){_0x56be0c[_0xf323('0x42')]=[{'all':!![]}];}return db[_0xf323('0x2d')][_0xf323('0x43')](_0x56be0c);})[_0xf323('0x25')](function(_0xc48a6e){_0x3c95ce[_0xf323('0x44')]=_0xc48a6e;return _0x3c95ce;})[_0xf323('0x25')](respondWithFilteredResult(_0x3902eb,_0x56be0c))[_0xf323('0x45')](handleError(_0x3902eb,null));};exports['show']=function(_0x502114,_0x1818c4){var _0x16ac6d={'raw':!![],'where':{'id':_0x502114[_0xf323('0x46')]['id']}},_0x2864f7={};_0x2864f7[_0xf323('0x31')]=_[_0xf323('0x33')](db[_0xf323('0x2d')][_0xf323('0x47')]);_0x2864f7[_0xf323('0x32')]=_[_0xf323('0x33')](_0x502114[_0xf323('0x32')]);_0x2864f7[_0xf323('0x34')]=_[_0xf323('0x35')](_0x2864f7['model'],_0x2864f7[_0xf323('0x32')]);_0x16ac6d['attributes']=_['intersection'](_0x2864f7[_0xf323('0x31')],qs['fields'](_0x502114['query'][_0xf323('0x37')]));_0x16ac6d[_0xf323('0x36')]=_0x16ac6d[_0xf323('0x36')][_0xf323('0x38')]?_0x16ac6d[_0xf323('0x36')]:_0x2864f7[_0xf323('0x31')];if(_0x502114[_0xf323('0x32')][_0xf323('0x41')]){_0x16ac6d[_0xf323('0x42')]=[{'all':!![]}];}_0x16ac6d=_[_0xf323('0x3f')]({},_0x16ac6d,_0x502114[_0xf323('0x40')]);return db['CmHopperFinal'][_0xf323('0x48')](_0x16ac6d)['then'](handleEntityNotFound(_0x1818c4,null))[_0xf323('0x25')](respondWithResult(_0x1818c4,null))[_0xf323('0x45')](handleError(_0x1818c4,null));};exports[_0xf323('0x49')]=function(_0x9c525e,_0x542205){return db['CmHopperFinal'][_0xf323('0x49')]()['then'](respondWithResult(_0x542205,null))[_0xf323('0x45')](handleError(_0x542205,null));};exports['update']=function(_0x2204f5,_0x8980f){if(_0x2204f5['body'][_0xf323('0x4a')]){delete _0x2204f5[_0xf323('0x4b')][_0xf323('0x4a')];}return db[_0xf323('0x2d')][_0xf323('0x48')]({'where':{'uniqueid':_0x2204f5[_0xf323('0x46')]['id']}})[_0xf323('0x25')](handleEntityNotFound(_0x8980f,null))[_0xf323('0x25')](saveUpdates(_0x2204f5[_0xf323('0x4b')],null))[_0xf323('0x25')](respondWithResult(_0x8980f,null))[_0xf323('0x45')](handleError(_0x8980f,null));};exports[_0xf323('0x4c')]=function(_0x1b07dc,_0x4e2dbc,_0x108ec1){return db[_0xf323('0x2d')][_0xf323('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x1b07dc[_0xf323('0x46')]['id']},'attributes':[[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db['sequelize']['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')]('`state`\x20=\x200,\x201,\x20null'))),_0xf323('0x50')],[db[_0xf323('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x51')))),_0xf323('0x52')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')]['literal'](_0xf323('0x53')))),_0xf323('0x54')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0xf323('0x55')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x56')))),_0xf323('0x57')],[db[_0xf323('0x4d')]['fn']('COUNT',db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf323('0x58')],[db[_0xf323('0x4d')]['fn']('COUNT',db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')]['literal'](_0xf323('0x59')))),_0xf323('0x5a')],[db['sequelize']['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x5b')))),_0xf323('0x5c')]]})[_0xf323('0x25')](handleEntityNotFound(_0x4e2dbc,null))[_0xf323('0x25')](respondWithResult(_0x4e2dbc,null))[_0xf323('0x45')](handleError(_0x4e2dbc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xd1902b,_0x31942f,_0x4c8e6f){return db[_0xf323('0x2d')][_0xf323('0x43')]({'raw':![],'where':{'CampaignId':_0xd1902b['params']['id']},'attributes':[[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')]['literal'](_0xf323('0x5d')))),_0xf323('0x50')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db['sequelize']['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x51')))),_0xf323('0x52')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x53')))),_0xf323('0x54')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf323('0x55')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xf323('0x57')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db['sequelize']['literal'](_0xf323('0x5e')))),_0xf323('0x58')],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0xf323('0x4d')]['fn'](_0xf323('0x4e'),db[_0xf323('0x4d')]['fn']('IF',db[_0xf323('0x4d')][_0xf323('0x4f')](_0xf323('0x5b')))),'answeringMachine']]})[_0xf323('0x25')](handleEntityNotFound(_0x31942f,null))[_0xf323('0x25')](respondWithResult(_0x31942f,null))['catch'](handleError(_0x31942f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x12853b,_0x2833b1,_0x58c80e){return db[_0xf323('0x5f')][_0xf323('0x48')]({'where':{'id':_0x12853b[_0xf323('0x46')]['id']}})['then'](handleEntityNotFound(_0x2833b1,null))[_0xf323('0x25')](function(_0x5bcdad){var _0x51780e;if(_0x5bcdad){_0x51780e=squel[_0xf323('0x60')]()[_0xf323('0x61')](_0xf323('0x62'))[_0xf323('0x63')]([_0xf323('0x64'),'scheduledAt',_0xf323('0x65'),_0xf323('0x66'),_0xf323('0x67'),_0xf323('0x68'),'updatedAt'],squel[_0xf323('0x69')]()[_0xf323('0x6a')](_0xf323('0x6b'),_0xf323('0x64'))[_0xf323('0x6a')](_0xf323('0x6c'),_0xf323('0x6d'))[_0xf323('0x6a')](_0xf323('0x6e'),'ContactId')[_0xf323('0x6a')](_0xf323('0x6f'),_0xf323('0x66'))['field']('ANY_VALUE(VoiceQueueId)',_0xf323('0x67'))['field'](_0xf323('0x6c'),_0xf323('0x68'))[_0xf323('0x6a')](_0xf323('0x6c'),'updatedAt')[_0xf323('0x70')](_0xf323('0x71'))[_0xf323('0x3d')](_0xf323('0x72'),_0x12853b[_0xf323('0x46')]['id']['toString']())[_0xf323('0x3d')](_0xf323('0x73'),_0x12853b[_0xf323('0x4b')][_0xf323('0x74')]['toString']())['where'](_0xf323('0x75'))[_0xf323('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xf323('0x69')]()['field'](_0xf323('0x64'))[_0xf323('0x70')](_0xf323('0x62'))['where'](_0xf323('0x72'),_0x12853b[_0xf323('0x46')]['id']['toString']()))[_0xf323('0x3d')](_0xf323('0x76'),squel[_0xf323('0x69')]()[_0xf323('0x6a')](_0xf323('0x77'))['from'](_0xf323('0x71'))[_0xf323('0x3d')](_0xf323('0x72'),_0x12853b[_0xf323('0x46')]['id'][_0xf323('0x78')]())['where'](_0xf323('0x79')))['group']('ContactId'))['toString']();return db[_0xf323('0x4d')][_0xf323('0x32')](_0x51780e);}return[];})[_0xf323('0x25')](respondWithResult(_0x2833b1,null))['catch'](handleError(_0x2833b1,null));};exports[_0xf323('0x7a')]=function(_0x25de8a,_0x4d3478,_0x20425f){return db[_0xf323('0x7b')][_0xf323('0x48')]({'where':{'id':_0x25de8a[_0xf323('0x46')]['id']}})[_0xf323('0x25')](handleEntityNotFound(_0x4d3478,null))[_0xf323('0x25')](function(_0x1ecd12){var _0xc3f4d7;if(_0x1ecd12){_0xc3f4d7=squel['insert']()[_0xf323('0x61')](_0xf323('0x62'))[_0xf323('0x63')](['phone','scheduledAt',_0xf323('0x65'),_0xf323('0x66'),_0xf323('0x7c'),_0xf323('0x68'),_0xf323('0x7d')],squel['select']()['field'](_0xf323('0x6b'),_0xf323('0x64'))['field'](_0xf323('0x6c'),_0xf323('0x6d'))['field'](_0xf323('0x6e'),_0xf323('0x65'))[_0xf323('0x6a')](_0xf323('0x6f'),'ListId')[_0xf323('0x6a')](_0xf323('0x7e'),_0xf323('0x7c'))[_0xf323('0x6a')](_0xf323('0x6c'),_0xf323('0x68'))[_0xf323('0x6a')](_0xf323('0x6c'),_0xf323('0x7d'))['from'](_0xf323('0x71'))[_0xf323('0x3d')](_0xf323('0x7f'),_0x25de8a['params']['id'][_0xf323('0x78')]())[_0xf323('0x3d')]('state\x20=\x20?',_0x25de8a['body'][_0xf323('0x74')][_0xf323('0x78')]())[_0xf323('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf323('0x76'),squel['select']()[_0xf323('0x6a')](_0xf323('0x64'))[_0xf323('0x70')](_0xf323('0x62'))['where'](_0xf323('0x7f'),_0x25de8a['params']['id'][_0xf323('0x78')]()))[_0xf323('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xf323('0x69')]()[_0xf323('0x6a')]('calleridnum')[_0xf323('0x70')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x25de8a[_0xf323('0x46')]['id'][_0xf323('0x78')]())[_0xf323('0x3d')](_0xf323('0x79')))[_0xf323('0x80')]('ContactId'))[_0xf323('0x78')]();return db[_0xf323('0x4d')][_0xf323('0x32')](_0xc3f4d7);}return[];})[_0xf323('0x25')](respondWithResult(_0x4d3478,null))[_0xf323('0x45')](handleError(_0x4d3478,null));};exports[_0xf323('0x81')]=function(_0x2a83b3,_0xaaebcc,_0x479124){return db[_0xf323('0x82')][_0xf323('0x83')]({'where':{'VoiceQueueId':_0x2a83b3[_0xf323('0x4b')]['VoiceQueueId'],'CampaignId':_0x2a83b3['body']['CampaignId'],'ContactId':_0x2a83b3[_0xf323('0x4b')][_0xf323('0x65')]}})[_0xf323('0x25')](handleEntityNotFound(_0xaaebcc,null))[_0xf323('0x25')](function(_0xa2b759){if(_0xa2b759){return _0xa2b759;}return null;})[_0xf323('0x25')](respondWithResult(_0xaaebcc,null))[_0xf323('0x45')](handleError(_0xaaebcc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 6149ea3..448479f 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 _0xc041=['request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','bluebird'];(function(_0x347fdf,_0x39e2b8){var _0x2a53b7=function(_0x3d40ff){while(--_0x3d40ff){_0x347fdf['push'](_0x347fdf['shift']());}};_0x2a53b7(++_0x39e2b8);}(_0xc041,0x1ea));var _0x1c04=function(_0x93d86c,_0x54e7ee){_0x93d86c=_0x93d86c-0x0;var _0x58e497=_0xc041[_0x93d86c];return _0x58e497;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var logger=require('../../config/logger')(_0x1c04('0x2'));var moment=require('moment');var BPromise=require(_0x1c04('0x3'));var rp=require(_0x1c04('0x4'));var fs=require('fs');var path=require(_0x1c04('0x5'));var rimraf=require(_0x1c04('0x6'));var config=require(_0x1c04('0x7'));var attributes=require(_0x1c04('0x8'));module['exports']=function(_0x2a7bb2,_0x5acee0){return _0x2a7bb2['define'](_0x1c04('0x9'),attributes,{'tableName':_0x1c04('0xa'),'paranoid':![],'indexes':[{'name':_0x1c04('0xb'),'fields':[_0x1c04('0xb')]},{'name':_0x1c04('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc73e=['exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','rimraf','../../config/environment'];(function(_0x20364d,_0x2aeeff){var _0x376937=function(_0x463934){while(--_0x463934){_0x20364d['push'](_0x20364d['shift']());}};_0x376937(++_0x2aeeff);}(_0xc73e,0x1e9));var _0xec73=function(_0x5d2918,_0x3876fc){_0x5d2918=_0x5d2918-0x0;var _0x4671be=_0xc73e[_0x5d2918];return _0x4671be;};'use strict';var _=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var logger=require('../../config/logger')(_0xec73('0x2'));var moment=require(_0xec73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec73('0x4'));var config=require(_0xec73('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0xec73('0x6')]=function(_0x26598a,_0x3bd154){return _0x26598a[_0xec73('0x7')]('CmHopperFinal',attributes,{'tableName':_0xec73('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xec73('0x9')]},{'name':_0xec73('0xa'),'fields':[_0xec73('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 34f663f..b08db3b 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 _0x9c2b=['CmHopperFinal,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info'];(function(_0x495a2c,_0x47dca7){var _0x4163d4=function(_0x1a17ba){while(--_0x1a17ba){_0x495a2c['push'](_0x495a2c['shift']());}};_0x4163d4(++_0x47dca7);}(_0x9c2b,0x1a5));var _0xb9c2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9c2b[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xb9c2('0x0'));var moment=require('moment');var BPromise=require(_0xb9c2('0x1'));var rs=require(_0xb9c2('0x2'));var fs=require('fs');var Redis=require(_0xb9c2('0x3'));var db=require(_0xb9c2('0x4'))['db'];var utils=require(_0xb9c2('0x5'));var logger=require(_0xb9c2('0x6'))('rpc');var config=require(_0xb9c2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9c2('0x8')][_0xb9c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c2e,_0x2830ec,_0x156740){return new BPromise(function(_0x25d7a7,_0x4011bb){return client['request'](_0x4a2c2e,_0x156740)['then'](function(_0x3d9c98){logger[_0xb9c2('0xa')](_0xb9c2('0xb'),_0x2830ec,'request\x20sent');logger[_0xb9c2('0xc')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2830ec,_0xb9c2('0xd'),JSON[_0xb9c2('0xe')](_0x3d9c98));if(_0x3d9c98['error']){if(_0x3d9c98[_0xb9c2('0xf')]['code']===0x1f4){logger[_0xb9c2('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x2830ec,_0x3d9c98['error'][_0xb9c2('0x10')]);return _0x4011bb(_0x3d9c98[_0xb9c2('0xf')][_0xb9c2('0x10')]);}logger[_0xb9c2('0xf')](_0xb9c2('0xb'),_0x2830ec,_0x3d9c98['error']['message']);return _0x25d7a7(_0x3d9c98['error'][_0xb9c2('0x10')]);}else{logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x2830ec,_0xb9c2('0xd'));_0x25d7a7(_0x3d9c98[_0xb9c2('0x11')][_0xb9c2('0x10')]);}})[_0xb9c2('0x12')](function(_0x1aaaee){logger[_0xb9c2('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x2830ec,_0x1aaaee);_0x4011bb(_0x1aaaee);});});}exports[_0xb9c2('0x13')]=function(_0x3b4115){var _0x5e5aff=this;return new Promise(function(_0x4e67dd,_0x1f50ea){return db[_0xb9c2('0x14')]['create'](_0x3b4115['body'],{'raw':_0x3b4115[_0xb9c2('0x15')]?_0x3b4115['options'][_0xb9c2('0x16')]===undefined?!![]:![]:!![]})[_0xb9c2('0x17')](function(_0x13ae65){logger[_0xb9c2('0xa')](_0xb9c2('0x13'),_0x3b4115);logger[_0xb9c2('0xc')](_0xb9c2('0x13'),_0x3b4115,JSON['stringify'](_0x13ae65));_0x4e67dd(_0x13ae65);})['catch'](function(_0x18745c){logger[_0xb9c2('0xf')](_0xb9c2('0x13'),_0x18745c['message'],_0x3b4115);_0x1f50ea(_0x5e5aff['error'](0x1f4,_0x18745c[_0xb9c2('0x10')]));});});}; \ No newline at end of file +var _0xf84c=['debug','stringify','error','code','CmHopperFinal,\x20%s,\x20%s','message','result','catch','CmHopperFinal','body','options','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent'];(function(_0x3c9a54,_0x13cede){var _0x4b4b40=function(_0x130dce){while(--_0x130dce){_0x3c9a54['push'](_0x3c9a54['shift']());}};_0x4b4b40(++_0x13cede);}(_0xf84c,0x1b5));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf84('0x0'));var util=require(_0xcf84('0x1'));var moment=require(_0xcf84('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf84('0x3'));var fs=require('fs');var Redis=require(_0xcf84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf84('0x5'));var logger=require(_0xcf84('0x6'))(_0xcf84('0x7'));var config=require(_0xcf84('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38c445,_0xd2fc54,_0x27a21d){return new BPromise(function(_0x4299b3,_0x21bb43){return client[_0xcf84('0xa')](_0x38c445,_0x27a21d)['then'](function(_0xf369b5){logger[_0xcf84('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0xd2fc54,_0xcf84('0xc'));logger[_0xcf84('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0xd2fc54,_0xcf84('0xc'),JSON[_0xcf84('0xe')](_0xf369b5));if(_0xf369b5[_0xcf84('0xf')]){if(_0xf369b5[_0xcf84('0xf')][_0xcf84('0x10')]===0x1f4){logger[_0xcf84('0xf')](_0xcf84('0x11'),_0xd2fc54,_0xf369b5[_0xcf84('0xf')][_0xcf84('0x12')]);return _0x21bb43(_0xf369b5[_0xcf84('0xf')][_0xcf84('0x12')]);}logger[_0xcf84('0xf')](_0xcf84('0x11'),_0xd2fc54,_0xf369b5['error'][_0xcf84('0x12')]);return _0x4299b3(_0xf369b5['error'][_0xcf84('0x12')]);}else{logger['info']('CmHopperFinal,\x20%s,\x20%s',_0xd2fc54,'request\x20sent');_0x4299b3(_0xf369b5[_0xcf84('0x13')][_0xcf84('0x12')]);}})[_0xcf84('0x14')](function(_0x12323f){logger[_0xcf84('0xf')](_0xcf84('0x11'),_0xd2fc54,_0x12323f);_0x21bb43(_0x12323f);});});}exports['CreateCmHopperFinal']=function(_0xc83f16){var _0x44bd5a=this;return new Promise(function(_0xb4fdd5,_0x13bf83){return db[_0xcf84('0x15')]['create'](_0xc83f16[_0xcf84('0x16')],{'raw':_0xc83f16[_0xcf84('0x17')]?_0xc83f16[_0xcf84('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ad02c){logger[_0xcf84('0xb')](_0xcf84('0x18'),_0xc83f16);logger[_0xcf84('0xd')](_0xcf84('0x18'),_0xc83f16,JSON[_0xcf84('0xe')](_0x5ad02c));_0xb4fdd5(_0x5ad02c);})[_0xcf84('0x14')](function(_0x34e560){logger['error']('CreateCmHopperFinal',_0x34e560[_0xcf84('0x12')],_0xc83f16);_0x13bf83(_0x44bd5a[_0xcf84('0xf')](0x1f4,_0x34e560[_0xcf84('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6a1c84e..c752bde 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 _0x55e8=['moveContactsIvrCampaignHopperFinal','checkContactHopper','put','multer','util','connect-timeout','Router','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x31d7ca,_0x4984b5){var _0xd03b29=function(_0x332b4e){while(--_0x332b4e){_0x31d7ca['push'](_0x31d7ca['shift']());}};_0xd03b29(++_0x4984b5);}(_0x55e8,0x17d));var _0x855e=function(_0x344796,_0x4cc579){_0x344796=_0x344796-0x0;var _0x187bb5=_0x55e8[_0x344796];return _0x187bb5;};'use strict';var multer=require(_0x855e('0x0'));var util=require(_0x855e('0x1'));var path=require('path');var timeout=require(_0x855e('0x2'));var express=require('express');var router=express[_0x855e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x855e('0x4'));var config=require('../../config/environment');var controller=require(_0x855e('0x5'));router[_0x855e('0x6')]('/',auth[_0x855e('0x7')](),controller[_0x855e('0x8')]);router[_0x855e('0x6')](_0x855e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x855e('0x6')](_0x855e('0xa'),auth[_0x855e('0x7')](),controller['show']);router[_0x855e('0x6')](_0x855e('0xb'),auth[_0x855e('0x7')](),controller[_0x855e('0xc')]);router[_0x855e('0x6')](_0x855e('0xd'),auth[_0x855e('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x855e('0xe')](_0x855e('0xf'),auth[_0x855e('0x7')](),controller[_0x855e('0x10')]);router['post'](_0x855e('0x11'),auth[_0x855e('0x7')](),controller[_0x855e('0x12')]);router[_0x855e('0xe')]('/checkContactHopper',auth[_0x855e('0x7')](),controller[_0x855e('0x13')]);router[_0x855e('0x14')](_0x855e('0xa'),auth[_0x855e('0x7')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x5291=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','/:id','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x5291,0xa6));var _0x1529=function(_0x4a5455,_0x5ca77c){_0x4a5455=_0x4a5455-0x0;var _0x1b6bdd=_0x5291[_0x4a5455];return _0x1b6bdd;};'use strict';var multer=require(_0x1529('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1529('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x1529('0x2'));var interaction=require(_0x1529('0x3'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x1529('0x4')]('/',auth[_0x1529('0x5')](),controller[_0x1529('0x6')]);router['get']('/describe',auth[_0x1529('0x5')](),controller[_0x1529('0x7')]);router[_0x1529('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x1529('0x8')]);router[_0x1529('0x4')](_0x1529('0x9'),auth[_0x1529('0x5')](),controller[_0x1529('0xa')]);router[_0x1529('0x4')](_0x1529('0xb'),auth['isAuthenticated'](),controller[_0x1529('0xc')]);router[_0x1529('0xd')](_0x1529('0xe'),auth['isAuthenticated'](),controller[_0x1529('0xf')]);router[_0x1529('0xd')](_0x1529('0x10'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x1529('0x11'),auth['isAuthenticated'](),controller[_0x1529('0x12')]);router[_0x1529('0x13')](_0x1529('0x14'),auth[_0x1529('0x5')](),controller['update']);module[_0x1529('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7571da2..e64d8b0 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 _0x47a4=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x1c979d,_0x2cb004){var _0x4ad89c=function(_0xb5e234){while(--_0xb5e234){_0x1c979d['push'](_0x1c979d['shift']());}};_0x4ad89c(++_0x2cb004);}(_0x47a4,0x9d));var _0x447a=function(_0x1a6d40,_0x190810){_0x1a6d40=_0x1a6d40-0x0;var _0x348477=_0x47a4[_0x1a6d40];return _0x348477;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x447a('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x447a('0x1')]},'scheduledat':{'type':Sequelize[_0x447a('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x447a('0x1')]},'calleridnum':{'type':Sequelize[_0x447a('0x1')]},'calleridname':{'type':Sequelize[_0x447a('0x1')]},'starttime':{'type':Sequelize[_0x447a('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x447a('0x2')]},'droptime':{'type':Sequelize[_0x447a('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x447a('0x1')]},'campaign':{'type':Sequelize[_0x447a('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x447a('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x447a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x447a('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x447a('0x2')]},'recallme':{'type':Sequelize[_0x447a('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x447a('0x2')]},'edited':{'type':Sequelize[_0x447a('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x447a('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x447a('0x1')]}}; \ No newline at end of file +var _0x35db=['exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x35db,0xf5));var _0xb35d=function(_0x3a6135,_0x6db00e){_0x3a6135=_0x3a6135-0x0;var _0x418f7e=_0x35db[_0x3a6135];return _0x418f7e;};'use strict';var Sequelize=require('sequelize');module[_0xb35d('0x0')]={'state':{'type':Sequelize[_0xb35d('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb35d('0x2')]},'countbusyretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb35d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb35d('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb35d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb35d('0x3')]},'starttime':{'type':Sequelize[_0xb35d('0x2')]},'responsetime':{'type':Sequelize[_0xb35d('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb35d('0x2')]},'endtime':{'type':Sequelize[_0xb35d('0x2')]},'ringtime':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb35d('0x3')]},'campaign':{'type':Sequelize[_0xb35d('0x3')]},'campaigntype':{'type':Sequelize[_0xb35d('0x3')]},'membername':{'type':Sequelize[_0xb35d('0x3')]},'reason':{'type':Sequelize[_0xb35d('0x3')]},'amd':{'type':Sequelize[_0xb35d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb35d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb35d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xb35d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb35d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb35d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb35d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 0f0024c..e54b02c 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 _0x1007=['set','Content-Range','reject','save','update','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','then','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','describe','uniqueid','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x1007,0xc1));var _0x7100=function(_0x5d5951,_0x3b0a0c){_0x5d5951=_0x5d5951-0x0;var _0x5c4e51=_0x1007[_0x5d5951];return _0x5c4e51;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7100('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7100('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7100('0x2'));var BPromise=require(_0x7100('0x3'));var Mustache=require('mustache');var util=require(_0x7100('0x4'));var path=require(_0x7100('0x5'));var sox=require('sox');var csv=require(_0x7100('0x6'));var ejs=require(_0x7100('0x7'));var fs=require('fs');var _=require(_0x7100('0x8'));var squel=require(_0x7100('0x9'));var crypto=require(_0x7100('0xa'));var jsforce=require(_0x7100('0xb'));var deskjs=require(_0x7100('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7100('0xd'));var Papa=require(_0x7100('0xe'));var Redis=require('ioredis');var authService=require(_0x7100('0xf'));var qs=require(_0x7100('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7100('0x11'));var logger=require(_0x7100('0x12'))(_0x7100('0x13'));var utils=require(_0x7100('0x14'));var config=require(_0x7100('0x15'));var db=require(_0x7100('0x16'))['db'];function respondWithStatusCode(_0x416e21,_0x56eedc){_0x56eedc=_0x56eedc||0xcc;return function(_0x2dd9bd){if(_0x2dd9bd){return _0x416e21[_0x7100('0x17')](_0x56eedc);}return _0x416e21[_0x7100('0x18')](_0x56eedc)['end']();};}function respondWithResult(_0x161007,_0xefba3c){_0xefba3c=_0xefba3c||0xc8;return function(_0x4bfdfc){if(_0x4bfdfc){return _0x161007[_0x7100('0x18')](_0xefba3c)[_0x7100('0x19')](_0x4bfdfc);}};}function respondWithFilteredResult(_0x266c46,_0x6953e3){return function(_0x44059){if(_0x44059){var _0x122e6=_0x44059[_0x7100('0x1a')],_0x2caa5f=_0x6953e3[_0x7100('0x1b')],_0x3a269a=_0x6953e3['offset']+_0x6953e3[_0x7100('0x1c')],_0x39ab93;if(_0x3a269a>=_0x122e6){_0x3a269a=_0x122e6;_0x39ab93=0xc8;}else{_0x39ab93=0xce;}_0x266c46[_0x7100('0x18')](_0x39ab93);return _0x266c46[_0x7100('0x1d')](_0x7100('0x1e'),_0x2caa5f+'-'+_0x3a269a+'/'+_0x122e6)[_0x7100('0x19')](_0x44059);}return null;};}function patchUpdates(_0x1be06b){return function(_0x360067){try{jsonpatch['apply'](_0x360067,_0x1be06b,!![]);}catch(_0xe549f2){return BPromise[_0x7100('0x1f')](_0xe549f2);}return _0x360067[_0x7100('0x20')]();};}function saveUpdates(_0x47bf42,_0x2cef25){return function(_0x5b2e86){if(_0x5b2e86){return _0x5b2e86[_0x7100('0x21')](_0x47bf42)['then'](function(_0x1d32a0){return _0x1d32a0;});}return null;};}function removeEntity(_0x502656,_0x537bd4){return function(_0x27a6c2){if(_0x27a6c2){return _0x27a6c2['destroy']()['then'](function(){_0x502656[_0x7100('0x18')](0xcc)[_0x7100('0x22')]();});}};}function handleEntityNotFound(_0x2bac43,_0x106b93){return function(_0x44a266){if(!_0x44a266){_0x2bac43['sendStatus'](0x194);}return _0x44a266;};}function handleError(_0x3afc0d,_0xa565b3){_0xa565b3=_0xa565b3||0x1f4;return function(_0x2eb293){logger[_0x7100('0x23')](_0x2eb293[_0x7100('0x24')]);if(_0x2eb293[_0x7100('0x25')]){delete _0x2eb293[_0x7100('0x25')];}_0x3afc0d[_0x7100('0x18')](_0xa565b3)['send'](_0x2eb293);};}exports[_0x7100('0x26')]=function(_0x3de830,_0x2ff9e7){var _0x56210a={},_0x2a4dcb={},_0x2650d0={'count':0x0,'rows':[]};var _0x595de5=_[_0x7100('0x27')](db[_0x7100('0x28')][_0x7100('0x29')],function(_0x5b02fb){return{'name':_0x5b02fb[_0x7100('0x2a')],'type':_0x5b02fb[_0x7100('0x2b')][_0x7100('0x2c')]};});_0x2a4dcb[_0x7100('0x2d')]=_['map'](_0x595de5,_0x7100('0x25'));_0x2a4dcb[_0x7100('0x2e')]=_[_0x7100('0x2f')](_0x3de830['query']);_0x2a4dcb['filters']=_[_0x7100('0x30')](_0x2a4dcb['model'],_0x2a4dcb[_0x7100('0x2e')]);_0x56210a[_0x7100('0x31')]=_[_0x7100('0x30')](_0x2a4dcb[_0x7100('0x2d')],qs['fields'](_0x3de830[_0x7100('0x2e')][_0x7100('0x32')]));_0x56210a[_0x7100('0x31')]=_0x56210a[_0x7100('0x31')]['length']?_0x56210a['attributes']:_0x2a4dcb[_0x7100('0x2d')];if(!_0x3de830[_0x7100('0x2e')][_0x7100('0x33')]('nolimit')){_0x56210a[_0x7100('0x1c')]=qs[_0x7100('0x1c')](_0x3de830[_0x7100('0x2e')][_0x7100('0x1c')]);_0x56210a[_0x7100('0x1b')]=qs['offset'](_0x3de830[_0x7100('0x2e')][_0x7100('0x1b')]);}_0x56210a[_0x7100('0x34')]=qs[_0x7100('0x35')](_0x3de830[_0x7100('0x2e')]['sort']);_0x56210a['where']=qs[_0x7100('0x36')](_['pick'](_0x3de830[_0x7100('0x2e')],_0x2a4dcb[_0x7100('0x36')]),_0x595de5);if(_0x3de830[_0x7100('0x2e')][_0x7100('0x37')]){_0x56210a[_0x7100('0x38')]=_[_0x7100('0x39')](_0x56210a[_0x7100('0x38')],{'$or':_[_0x7100('0x27')](_0x595de5,function(_0x5439ab){if(_0x5439ab['type']!==_0x7100('0x3a')){var _0x169f3f={};_0x169f3f[_0x5439ab[_0x7100('0x25')]]={'$like':'%'+_0x3de830[_0x7100('0x2e')][_0x7100('0x37')]+'%'};return _0x169f3f;}})});}_0x56210a=_[_0x7100('0x39')]({},_0x56210a,_0x3de830[_0x7100('0x3b')]);var _0xebe411={'where':_0x56210a[_0x7100('0x38')]};return db[_0x7100('0x28')][_0x7100('0x1a')](_0xebe411)[_0x7100('0x3c')](function(_0x384d77){_0x2650d0[_0x7100('0x1a')]=_0x384d77;if(_0x3de830[_0x7100('0x2e')]['includeAll']){_0x56210a[_0x7100('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7100('0x3e')](_0x56210a);})['then'](function(_0xa2524b){_0x2650d0[_0x7100('0x3f')]=_0xa2524b;return _0x2650d0;})[_0x7100('0x3c')](respondWithFilteredResult(_0x2ff9e7,_0x56210a))['catch'](handleError(_0x2ff9e7,null));};exports[_0x7100('0x40')]=function(_0x440481,_0x1f16a9){var _0x4370ef={'raw':!![],'where':{'id':_0x440481[_0x7100('0x41')]['id']}},_0x5b6ab2={};_0x5b6ab2[_0x7100('0x2d')]=_[_0x7100('0x2f')](db[_0x7100('0x28')]['rawAttributes']);_0x5b6ab2[_0x7100('0x2e')]=_[_0x7100('0x2f')](_0x440481[_0x7100('0x2e')]);_0x5b6ab2[_0x7100('0x36')]=_[_0x7100('0x30')](_0x5b6ab2['model'],_0x5b6ab2[_0x7100('0x2e')]);_0x4370ef['attributes']=_[_0x7100('0x30')](_0x5b6ab2[_0x7100('0x2d')],qs[_0x7100('0x32')](_0x440481[_0x7100('0x2e')][_0x7100('0x32')]));_0x4370ef['attributes']=_0x4370ef[_0x7100('0x31')][_0x7100('0x42')]?_0x4370ef[_0x7100('0x31')]:_0x5b6ab2[_0x7100('0x2d')];if(_0x440481[_0x7100('0x2e')][_0x7100('0x43')]){_0x4370ef[_0x7100('0x3d')]=[{'all':!![]}];}_0x4370ef=_[_0x7100('0x39')]({},_0x4370ef,_0x440481['options']);return db[_0x7100('0x28')][_0x7100('0x44')](_0x4370ef)[_0x7100('0x3c')](handleEntityNotFound(_0x1f16a9,null))[_0x7100('0x3c')](respondWithResult(_0x1f16a9,null))[_0x7100('0x45')](handleError(_0x1f16a9,null));};exports[_0x7100('0x46')]=function(_0x3c4442,_0x403eb3){return db[_0x7100('0x28')][_0x7100('0x46')](_0x3c4442[_0x7100('0x47')],{})[_0x7100('0x3c')](respondWithResult(_0x403eb3,0xc9))[_0x7100('0x45')](handleError(_0x403eb3,null));};exports['describe']=function(_0x4a02e8,_0x4748be){return db[_0x7100('0x28')][_0x7100('0x48')]()[_0x7100('0x3c')](respondWithResult(_0x4748be,null))[_0x7100('0x45')](handleError(_0x4748be,null));};exports[_0x7100('0x21')]=function(_0x4b6abb,_0x53932d){if(_0x4b6abb[_0x7100('0x47')][_0x7100('0x49')]){delete _0x4b6abb[_0x7100('0x47')]['uniqueid'];}return db['CmHopperHistory'][_0x7100('0x44')]({'where':{'uniqueid':_0x4b6abb[_0x7100('0x41')]['id']}})[_0x7100('0x3c')](handleEntityNotFound(_0x53932d,null))['then'](saveUpdates(_0x4b6abb[_0x7100('0x47')],null))['then'](respondWithResult(_0x53932d,null))[_0x7100('0x45')](handleError(_0x53932d,null));}; \ No newline at end of file +var _0x84e4=['reject','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','describe','uniqueid','params','html-pdf','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set'];(function(_0x4a1ce4,_0x3ad7a9){var _0x5c3a90=function(_0x529043){while(--_0x529043){_0x4a1ce4['push'](_0x4a1ce4['shift']());}};_0x5c3a90(++_0x3ad7a9);}(_0x84e4,0x1d3));var _0x484e=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x84e4[_0x1e4a8e];return _0x5408f9;};'use strict';var pdf=require(_0x484e('0x0'));var emlformat=require(_0x484e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x484e('0x2'));var BPromise=require(_0x484e('0x3'));var Mustache=require(_0x484e('0x4'));var util=require(_0x484e('0x5'));var path=require(_0x484e('0x6'));var sox=require(_0x484e('0x7'));var csv=require(_0x484e('0x8'));var ejs=require(_0x484e('0x9'));var fs=require('fs');var _=require(_0x484e('0xa'));var squel=require('squel');var crypto=require(_0x484e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x484e('0xc'));var toCsv=require(_0x484e('0x8'));var querystring=require(_0x484e('0xd'));var Papa=require(_0x484e('0xe'));var Redis=require('ioredis');var authService=require(_0x484e('0xf'));var qs=require(_0x484e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x484e('0x11'));var logger=require(_0x484e('0x12'))(_0x484e('0x13'));var utils=require(_0x484e('0x14'));var config=require(_0x484e('0x15'));var db=require(_0x484e('0x16'))['db'];function respondWithStatusCode(_0x21d4ec,_0x3821af){_0x3821af=_0x3821af||0xcc;return function(_0x30ccf5){if(_0x30ccf5){return _0x21d4ec[_0x484e('0x17')](_0x3821af);}return _0x21d4ec[_0x484e('0x18')](_0x3821af)[_0x484e('0x19')]();};}function respondWithResult(_0xc85d97,_0x47cc95){_0x47cc95=_0x47cc95||0xc8;return function(_0x2ee62f){if(_0x2ee62f){return _0xc85d97[_0x484e('0x18')](_0x47cc95)[_0x484e('0x1a')](_0x2ee62f);}};}function respondWithFilteredResult(_0x4c8e28,_0x4ec4f5){return function(_0x2a030c){if(_0x2a030c){var _0xd92952=_0x2a030c['count'],_0x4f83ce=_0x4ec4f5[_0x484e('0x1b')],_0x5e15b2=_0x4ec4f5['offset']+_0x4ec4f5[_0x484e('0x1c')],_0x3408c1;if(_0x5e15b2>=_0xd92952){_0x5e15b2=_0xd92952;_0x3408c1=0xc8;}else{_0x3408c1=0xce;}_0x4c8e28[_0x484e('0x18')](_0x3408c1);return _0x4c8e28[_0x484e('0x1d')]('Content-Range',_0x4f83ce+'-'+_0x5e15b2+'/'+_0xd92952)[_0x484e('0x1a')](_0x2a030c);}return null;};}function patchUpdates(_0x54803c){return function(_0x3a82cb){try{jsonpatch['apply'](_0x3a82cb,_0x54803c,!![]);}catch(_0x2535dd){return BPromise[_0x484e('0x1e')](_0x2535dd);}return _0x3a82cb['save']();};}function saveUpdates(_0x2b1d6a,_0xf8e766){return function(_0x165b92){if(_0x165b92){return _0x165b92[_0x484e('0x1f')](_0x2b1d6a)[_0x484e('0x20')](function(_0x4f375e){return _0x4f375e;});}return null;};}function removeEntity(_0x301153,_0xfc335d){return function(_0xed48e1){if(_0xed48e1){return _0xed48e1['destroy']()[_0x484e('0x20')](function(){_0x301153[_0x484e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1c17,_0x3c08dd){return function(_0x35b4ba){if(!_0x35b4ba){_0x4b1c17[_0x484e('0x17')](0x194);}return _0x35b4ba;};}function handleError(_0xe27043,_0x7efce0){_0x7efce0=_0x7efce0||0x1f4;return function(_0x5a3b70){logger[_0x484e('0x21')](_0x5a3b70[_0x484e('0x22')]);if(_0x5a3b70[_0x484e('0x23')]){delete _0x5a3b70['name'];}_0xe27043[_0x484e('0x18')](_0x7efce0)['send'](_0x5a3b70);};}exports[_0x484e('0x24')]=function(_0x528b72,_0x1634ff){var _0x23f70c={},_0x210748={},_0x3cd371={'count':0x0,'rows':[]};var _0x189dbb=_[_0x484e('0x25')](db[_0x484e('0x26')][_0x484e('0x27')],function(_0x26a9bc){return{'name':_0x26a9bc[_0x484e('0x28')],'type':_0x26a9bc[_0x484e('0x29')][_0x484e('0x2a')]};});_0x210748[_0x484e('0x2b')]=_['map'](_0x189dbb,_0x484e('0x23'));_0x210748[_0x484e('0x2c')]=_['keys'](_0x528b72[_0x484e('0x2c')]);_0x210748[_0x484e('0x2d')]=_[_0x484e('0x2e')](_0x210748[_0x484e('0x2b')],_0x210748[_0x484e('0x2c')]);_0x23f70c['attributes']=_['intersection'](_0x210748[_0x484e('0x2b')],qs[_0x484e('0x2f')](_0x528b72[_0x484e('0x2c')][_0x484e('0x2f')]));_0x23f70c['attributes']=_0x23f70c[_0x484e('0x30')][_0x484e('0x31')]?_0x23f70c[_0x484e('0x30')]:_0x210748[_0x484e('0x2b')];if(!_0x528b72[_0x484e('0x2c')][_0x484e('0x32')]('nolimit')){_0x23f70c[_0x484e('0x1c')]=qs[_0x484e('0x1c')](_0x528b72[_0x484e('0x2c')][_0x484e('0x1c')]);_0x23f70c[_0x484e('0x1b')]=qs[_0x484e('0x1b')](_0x528b72[_0x484e('0x2c')][_0x484e('0x1b')]);}_0x23f70c[_0x484e('0x33')]=qs['sort'](_0x528b72[_0x484e('0x2c')]['sort']);_0x23f70c['where']=qs[_0x484e('0x2d')](_[_0x484e('0x34')](_0x528b72[_0x484e('0x2c')],_0x210748['filters']),_0x189dbb);if(_0x528b72['query'][_0x484e('0x35')]){_0x23f70c['where']=_[_0x484e('0x36')](_0x23f70c[_0x484e('0x37')],{'$or':_[_0x484e('0x25')](_0x189dbb,function(_0x5dd36b){if(_0x5dd36b[_0x484e('0x29')]!==_0x484e('0x38')){var _0xf17ada={};_0xf17ada[_0x5dd36b[_0x484e('0x23')]]={'$like':'%'+_0x528b72['query']['filter']+'%'};return _0xf17ada;}})});}_0x23f70c=_[_0x484e('0x36')]({},_0x23f70c,_0x528b72[_0x484e('0x39')]);var _0x533f56={'where':_0x23f70c[_0x484e('0x37')]};return db[_0x484e('0x26')]['count'](_0x533f56)['then'](function(_0x51452a){_0x3cd371[_0x484e('0x3a')]=_0x51452a;if(_0x528b72[_0x484e('0x2c')][_0x484e('0x3b')]){_0x23f70c['include']=[{'all':!![]}];}return db[_0x484e('0x26')][_0x484e('0x3c')](_0x23f70c);})[_0x484e('0x20')](function(_0x51123f){_0x3cd371[_0x484e('0x3d')]=_0x51123f;return _0x3cd371;})[_0x484e('0x20')](respondWithFilteredResult(_0x1634ff,_0x23f70c))[_0x484e('0x3e')](handleError(_0x1634ff,null));};exports[_0x484e('0x3f')]=function(_0x38be9a,_0x5cfe15){var _0x28479a={'raw':!![],'where':{'id':_0x38be9a['params']['id']}},_0x18d0de={};_0x18d0de['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x18d0de[_0x484e('0x2c')]=_['keys'](_0x38be9a['query']);_0x18d0de[_0x484e('0x2d')]=_['intersection'](_0x18d0de[_0x484e('0x2b')],_0x18d0de['query']);_0x28479a['attributes']=_['intersection'](_0x18d0de[_0x484e('0x2b')],qs[_0x484e('0x2f')](_0x38be9a[_0x484e('0x2c')][_0x484e('0x2f')]));_0x28479a[_0x484e('0x30')]=_0x28479a[_0x484e('0x30')][_0x484e('0x31')]?_0x28479a['attributes']:_0x18d0de[_0x484e('0x2b')];if(_0x38be9a['query'][_0x484e('0x3b')]){_0x28479a[_0x484e('0x40')]=[{'all':!![]}];}_0x28479a=_[_0x484e('0x36')]({},_0x28479a,_0x38be9a['options']);return db[_0x484e('0x26')][_0x484e('0x41')](_0x28479a)[_0x484e('0x20')](handleEntityNotFound(_0x5cfe15,null))['then'](respondWithResult(_0x5cfe15,null))[_0x484e('0x3e')](handleError(_0x5cfe15,null));};exports['create']=function(_0x27342d,_0x41a13){return db[_0x484e('0x26')][_0x484e('0x42')](_0x27342d[_0x484e('0x43')],{})[_0x484e('0x20')](respondWithResult(_0x41a13,0xc9))[_0x484e('0x3e')](handleError(_0x41a13,null));};exports[_0x484e('0x44')]=function(_0x5bc9e3,_0x385097){return db[_0x484e('0x26')][_0x484e('0x44')]()[_0x484e('0x20')](respondWithResult(_0x385097,null))[_0x484e('0x3e')](handleError(_0x385097,null));};exports[_0x484e('0x1f')]=function(_0x1007a8,_0x481c39){if(_0x1007a8[_0x484e('0x43')][_0x484e('0x45')]){delete _0x1007a8[_0x484e('0x43')][_0x484e('0x45')];}return db['CmHopperHistory'][_0x484e('0x41')]({'where':{'uniqueid':_0x1007a8[_0x484e('0x46')]['id']}})[_0x484e('0x20')](handleEntityNotFound(_0x481c39,null))['then'](saveUpdates(_0x1007a8[_0x484e('0x43')],null))['then'](respondWithResult(_0x481c39,null))[_0x484e('0x3e')](handleError(_0x481c39,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7943ac0..825cbaa 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 _0x203f=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x1c03c9,_0xe76eae){var _0x46b403=function(_0xe28728){while(--_0xe28728){_0x1c03c9['push'](_0x1c03c9['shift']());}};_0x46b403(++_0xe76eae);}(_0x203f,0x187));var _0xf203=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x203f[_0x3bef2c];return _0x331503;};'use strict';var _=require(_0xf203('0x0'));var util=require(_0xf203('0x1'));var logger=require(_0xf203('0x2'))(_0xf203('0x3'));var moment=require(_0xf203('0x4'));var BPromise=require(_0xf203('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf203('0x6'));var rimraf=require('rimraf');var config=require(_0xf203('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xf203('0x8')]=function(_0x213525,_0x240cf9){return _0x213525[_0xf203('0x9')](_0xf203('0xa'),attributes,{'tableName':_0xf203('0xb'),'paranoid':![],'indexes':[{'name':_0xf203('0xc'),'fields':[_0xf203('0xc')]},{'name':'uniqueid','fields':[_0xf203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ee2=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes'];(function(_0x568781,_0x38a18b){var _0x1f1d2f=function(_0x2b180c){while(--_0x2b180c){_0x568781['push'](_0x568781['shift']());}};_0x1f1d2f(++_0x38a18b);}(_0x8ee2,0x6c));var _0x28ee=function(_0x3ccbee,_0x4c20e8){_0x3ccbee=_0x3ccbee-0x0;var _0x31883f=_0x8ee2[_0x3ccbee];return _0x31883f;};'use strict';var _=require(_0x28ee('0x0'));var util=require(_0x28ee('0x1'));var logger=require(_0x28ee('0x2'))(_0x28ee('0x3'));var moment=require(_0x28ee('0x4'));var BPromise=require(_0x28ee('0x5'));var rp=require(_0x28ee('0x6'));var fs=require('fs');var path=require(_0x28ee('0x7'));var rimraf=require(_0x28ee('0x8'));var config=require(_0x28ee('0x9'));var attributes=require(_0x28ee('0xa'));module[_0x28ee('0xb')]=function(_0x126b84,_0x4bd4a2){return _0x126b84[_0x28ee('0xc')](_0x28ee('0xd'),attributes,{'tableName':_0x28ee('0xe'),'paranoid':![],'indexes':[{'name':_0x28ee('0xf'),'fields':[_0x28ee('0xf')]},{'name':_0x28ee('0x10'),'fields':[_0x28ee('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6950c03..9c6554c 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 _0x34b7=['stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','outboundReCallsDay','name','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x34b7,0x196));var _0x734b=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x34b7[_0x581960];return _0x4ee892;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateCmHopperHistory',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});};exports[_0x734b('0x1c')]=function(_0x46d432){var _0x26d118=this;return new Promise(function(_0x26eccf,_0x104fff){return db[_0x734b('0x16')][_0x734b('0x1d')]({'raw':_0x46d432[_0x734b('0x19')]?_0x46d432[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![],'where':_0x46d432['options']?_0x46d432['options'][_0x734b('0x1e')]||null:null,'attributes':[[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')][_0x734b('0x20')]('id')),_0x734b('0x21')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')]['literal'](_0x734b('0x23')))),_0x734b('0x24')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')](_0x734b('0x26')))),_0x734b('0x27')],[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')]['literal'](_0x734b('0x28')))),_0x734b('0x29')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x2a'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')](_0x734b('0x2b')))),_0x734b('0x2c')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x2a'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')](_0x734b('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x734b('0x1b')](function(_0x5e2444){logger[_0x734b('0xa')](_0x734b('0x1c'),_0x46d432);logger[_0x734b('0xc')](_0x734b('0x1c'),_0x46d432,JSON[_0x734b('0xe')](_0x5e2444));_0x26eccf(_0x5e2444);})[_0x734b('0x14')](function(_0x55bd2e){logger['error'](_0x734b('0x1c'),_0x55bd2e['message'],_0x46d432);_0x104fff(_0x26d118[_0x734b('0xf')](0x1f4,_0x55bd2e['message']));});});};exports[_0x734b('0x2e')]=function(_0x4b30eb){var _0x1875f1=this;return new Promise(function(_0x5ea4a0,_0x37d891){return db[_0x734b('0x16')][_0x734b('0x1d')]({'raw':_0x4b30eb[_0x734b('0x19')]?_0x4b30eb[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b30eb[_0x734b('0x19')]?_0x4b30eb['options'][_0x734b('0x1e')]||null:null,'attributes':[[_0x734b('0x2f'),'name'],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')]['literal'](_0x734b('0x30')))),_0x734b('0x31')],[db['sequelize']['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db['sequelize'][_0x734b('0x25')](_0x734b('0x32')))),_0x734b('0x33')],[db[_0x734b('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x734b('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x734b('0x34')],[db['sequelize']['fn'](_0x734b('0x22'),db['sequelize']['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')](_0x734b('0x35')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x734b('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x734b('0x25')](_0x734b('0x36')))),'outboundCongestionCallsDay'],[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x734b('0x37')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x734b('0x38')],[db['sequelize']['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db['sequelize'][_0x734b('0x25')](_0x734b('0x39')))),_0x734b('0x3a')],[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db['sequelize'][_0x734b('0x25')](_0x734b('0x3b')))),_0x734b('0x3c')],[db['sequelize']['fn'](_0x734b('0x22'),db['sequelize']['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')]('`state`\x20=\x2014,\x201,\x20null'))),_0x734b('0x3d')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')]['literal'](_0x734b('0x3e')))),'outboundRejectCallsDay'],[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')](_0x734b('0x3f')))),_0x734b('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')]('`state`\x20=\x2020,\x201,\x20null'))),_0x734b('0x41')],[db[_0x734b('0x1f')]['fn']('COUNT',db[_0x734b('0x1f')]['fn']('IF',db[_0x734b('0x1f')][_0x734b('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x734b('0x42')]],'group':[_0x734b('0x2f')]})[_0x734b('0x1b')](function(_0xe605be){logger['info'](_0x734b('0x2e'),_0x4b30eb);logger[_0x734b('0xc')](_0x734b('0x2e'),_0x4b30eb,JSON[_0x734b('0xe')](_0xe605be));_0x5ea4a0(_0xe605be);})['catch'](function(_0x27f0ff){logger['error'](_0x734b('0x2e'),_0x27f0ff[_0x734b('0x12')],_0x4b30eb);_0x37d891(_0x1875f1[_0x734b('0xf')](0x1f4,_0x27f0ff[_0x734b('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x2b9da7){var _0x1af382=this;return new Promise(function(_0x5b9adc,_0x541e70){return db[_0x734b('0x16')]['findAll']({'raw':_0x2b9da7[_0x734b('0x19')]?_0x2b9da7[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b9da7['options']?_0x2b9da7[_0x734b('0x19')]['where']||null:null,'attributes':[[_0x734b('0x2f'),_0x734b('0x43')],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db['sequelize'][_0x734b('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x734b('0x1f')]['fn'](_0x734b('0x22'),db[_0x734b('0x1f')]['fn']('IF',db['sequelize'][_0x734b('0x25')]('`state`\x20=\x204,\x201,\x20null'))),_0x734b('0x44')]],'group':[_0x734b('0x2f')]})[_0x734b('0x1b')](function(_0x257a87){logger['info'](_0x734b('0x45'),_0x2b9da7);logger['debug'](_0x734b('0x45'),_0x2b9da7,JSON[_0x734b('0xe')](_0x257a87));_0x5b9adc(_0x257a87);})[_0x734b('0x14')](function(_0x4dbff2){logger[_0x734b('0xf')](_0x734b('0x45'),_0x4dbff2[_0x734b('0x12')],_0x2b9da7);_0x541e70(_0x1af382[_0x734b('0xf')](0x1f4,_0x4dbff2[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x4cf8=['`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateCmHopperHistory','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout'];(function(_0x5bd445,_0x5e846d){var _0x3ac5ab=function(_0x4b25da){while(--_0x4b25da){_0x5bd445['push'](_0x5bd445['shift']());}};_0x3ac5ab(++_0x5e846d);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0x4cf8[_0x308c00];return _0x2b21b2;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});}exports[_0x84cf('0x18')]=function(_0x1abe2d){var _0x1dad1a=this;return new Promise(function(_0x13ba16,_0xe6b5b6){return db['CmHopperHistory']['create'](_0x1abe2d[_0x84cf('0x19')],{'raw':_0x1abe2d[_0x84cf('0x1a')]?_0x1abe2d[_0x84cf('0x1a')][_0x84cf('0x1b')]===undefined?!![]:![]:!![]})[_0x84cf('0xd')](function(_0x5dda3f){logger[_0x84cf('0xe')](_0x84cf('0x18'),_0x1abe2d);logger[_0x84cf('0x11')](_0x84cf('0x18'),_0x1abe2d,JSON[_0x84cf('0x12')](_0x5dda3f));_0x13ba16(_0x5dda3f);})['catch'](function(_0x42fa45){logger[_0x84cf('0x14')](_0x84cf('0x18'),_0x42fa45[_0x84cf('0x15')],_0x1abe2d);_0xe6b5b6(_0x1dad1a[_0x84cf('0x14')](0x1f4,_0x42fa45[_0x84cf('0x15')]));});});};exports[_0x84cf('0x1c')]=function(_0x4c9d1c){var _0x2b2c90=this;return new Promise(function(_0x26db3f,_0x1c7747){return db[_0x84cf('0x1d')][_0x84cf('0x1e')]({'raw':_0x4c9d1c[_0x84cf('0x1a')]?_0x4c9d1c[_0x84cf('0x1a')][_0x84cf('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c9d1c[_0x84cf('0x1a')]?_0x4c9d1c[_0x84cf('0x1a')]['where']||null:null,'attributes':[[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')][_0x84cf('0x21')]('id')),'predictiveIntervalTotalCalls'],[db[_0x84cf('0x1f')]['fn']('COUNT',db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')](_0x84cf('0x23')))),_0x84cf('0x24')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')](_0x84cf('0x25')))),_0x84cf('0x26')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x84cf('0x22')](_0x84cf('0x27')))),_0x84cf('0x28')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x29'),db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x84cf('0x2a')],[db[_0x84cf('0x1f')]['fn']('AVG',db[_0x84cf('0x1f')]['fn']('IF',db['sequelize'][_0x84cf('0x22')](_0x84cf('0x2b')))),_0x84cf('0x2c')]]})[_0x84cf('0xd')](function(_0x172ce9){logger['info'](_0x84cf('0x1c'),_0x4c9d1c);logger['debug']('AvgHandleTime',_0x4c9d1c,JSON[_0x84cf('0x12')](_0x172ce9));_0x26db3f(_0x172ce9);})[_0x84cf('0x17')](function(_0x4c4676){logger[_0x84cf('0x14')](_0x84cf('0x1c'),_0x4c4676[_0x84cf('0x15')],_0x4c9d1c);_0x1c7747(_0x2b2c90[_0x84cf('0x14')](0x1f4,_0x4c4676[_0x84cf('0x15')]));});});};exports[_0x84cf('0x2d')]=function(_0x56f798){var _0x2d2d4b=this;return new Promise(function(_0xb6d12d,_0x275cac){return db[_0x84cf('0x1d')][_0x84cf('0x1e')]({'raw':_0x56f798[_0x84cf('0x1a')]?_0x56f798['options'][_0x84cf('0x1b')]===undefined?!![]:![]:!![],'where':_0x56f798['options']?_0x56f798[_0x84cf('0x1a')][_0x84cf('0x2e')]||null:null,'attributes':[[_0x84cf('0x2f'),_0x84cf('0x30')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x200,\x201,\x20null'))),_0x84cf('0x31')],[db['sequelize']['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db['sequelize'][_0x84cf('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x84cf('0x32')],[db['sequelize']['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x84cf('0x33')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db[_0x84cf('0x1f')]['literal'](_0x84cf('0x34')))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')]['literal'](_0x84cf('0x35')))),'outboundCongestionCallsDay'],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db[_0x84cf('0x1f')]['literal'](_0x84cf('0x36')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x84cf('0x37')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db['sequelize'][_0x84cf('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x84cf('0x38')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x84cf('0x39')],[db[_0x84cf('0x1f')]['fn']('COUNT',db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')](_0x84cf('0x3a')))),_0x84cf('0x3b')],[db['sequelize']['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db[_0x84cf('0x1f')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x84cf('0x3c')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x84cf('0x22')](_0x84cf('0x3d')))),_0x84cf('0x3b')],[db[_0x84cf('0x1f')]['fn'](_0x84cf('0x20'),db['sequelize']['fn']('IF',db[_0x84cf('0x1f')][_0x84cf('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x84cf('0x3e')]],'group':['campaign']})['then'](function(_0x147194){logger[_0x84cf('0xe')]('GetVoiceQueueHopperHistory',_0x56f798);logger['debug'](_0x84cf('0x2d'),_0x56f798,JSON[_0x84cf('0x12')](_0x147194));_0xb6d12d(_0x147194);})[_0x84cf('0x17')](function(_0x1e2676){logger[_0x84cf('0x14')](_0x84cf('0x2d'),_0x1e2676[_0x84cf('0x15')],_0x56f798);_0x275cac(_0x2d2d4b[_0x84cf('0x14')](0x1f4,_0x1e2676['message']));});});};exports[_0x84cf('0x3f')]=function(_0x11f3cc){var _0x52991f=this;return new Promise(function(_0x5a4003,_0x1537f3){return db[_0x84cf('0x1d')][_0x84cf('0x1e')]({'raw':_0x11f3cc[_0x84cf('0x1a')]?_0x11f3cc[_0x84cf('0x1a')][_0x84cf('0x1b')]===undefined?!![]:![]:!![],'where':_0x11f3cc[_0x84cf('0x1a')]?_0x11f3cc['options'][_0x84cf('0x2e')]||null:null,'attributes':[['campaign',_0x84cf('0x30')],[db['sequelize']['fn'](_0x84cf('0x20'),db[_0x84cf('0x1f')]['col']('id')),_0x84cf('0x40')],[db[_0x84cf('0x1f')]['fn']('COUNT',db[_0x84cf('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x84cf('0x2f')]})[_0x84cf('0xd')](function(_0x10a229){logger[_0x84cf('0xe')]('GetCampaignHopperHistory',_0x11f3cc);logger[_0x84cf('0x11')](_0x84cf('0x3f'),_0x11f3cc,JSON['stringify'](_0x10a229));_0x5a4003(_0x10a229);})[_0x84cf('0x17')](function(_0x293fe9){logger[_0x84cf('0x14')](_0x84cf('0x3f'),_0x293fe9[_0x84cf('0x15')],_0x11f3cc);_0x1537f3(_0x52991f[_0x84cf('0x14')](0x1f4,_0x293fe9[_0x84cf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8a1a4b2..e940b83 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 _0x3ee3=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','post','put','/:id','update','multer'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3ee3,0xa4));var _0x33ee=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3ee3[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x33ee('0x0'));var util=require(_0x33ee('0x1'));var path=require(_0x33ee('0x2'));var timeout=require(_0x33ee('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x33ee('0x4'));var config=require(_0x33ee('0x5'));var controller=require(_0x33ee('0x6'));router[_0x33ee('0x7')]('/',auth[_0x33ee('0x8')](),controller['index']);router['get'](_0x33ee('0x9'),auth[_0x33ee('0x8')](),controller[_0x33ee('0xa')]);router['get']('/:id',auth[_0x33ee('0x8')](),controller['show']);router[_0x33ee('0xb')]('/',auth[_0x33ee('0x8')](),controller['create']);router[_0x33ee('0xc')](_0x33ee('0xd'),auth[_0x33ee('0x8')](),controller[_0x33ee('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3abc=['connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','exports','multer','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3abc,0x166));var _0xc3ab=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x3abc[_0x42f009];return _0x22a1e0;};'use strict';var multer=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var path=require('path');var timeout=require(_0xc3ab('0x2'));var express=require('express');var router=express[_0xc3ab('0x3')]();var auth=require(_0xc3ab('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc3ab('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xc3ab('0x6')]('/',auth['isAuthenticated'](),controller[_0xc3ab('0x7')]);router['get'](_0xc3ab('0x8'),auth[_0xc3ab('0x9')](),controller[_0xc3ab('0xa')]);router[_0xc3ab('0x6')](_0xc3ab('0xb'),auth[_0xc3ab('0x9')](),controller['show']);router[_0xc3ab('0xc')]('/',auth[_0xc3ab('0x9')](),controller[_0xc3ab('0xd')]);router['put'](_0xc3ab('0xb'),auth[_0xc3ab('0x9')](),controller['update']);module[_0xc3ab('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 397d4e1..13b0a77 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 _0xd251=['exports','STRING','sequelize'];(function(_0x1f71ca,_0x48c0a2){var _0x34929f=function(_0x7bb693){while(--_0x7bb693){_0x1f71ca['push'](_0x1f71ca['shift']());}};_0x34929f(++_0x48c0a2);}(_0xd251,0x101));var _0x1d25=function(_0x548126,_0xfd7183){_0x548126=_0x548126-0x0;var _0x1af746=_0xd251[_0x548126];return _0x1af746;};'use strict';var Sequelize=require(_0x1d25('0x0'));module[_0x1d25('0x1')]={'name':{'type':Sequelize[_0x1d25('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x1d25('0x2')]}}; \ No newline at end of file +var _0x4db9=['exports','STRING','sequelize'];(function(_0x4ee917,_0x3ed58){var _0x543b9d=function(_0x52ecdb){while(--_0x52ecdb){_0x4ee917['push'](_0x4ee917['shift']());}};_0x543b9d(++_0x3ed58);}(_0x4db9,0xe3));var _0x94db=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x4db9[_0x16337a];return _0x422365;};'use strict';var Sequelize=require(_0x94db('0x0'));module[_0x94db('0x1')]={'name':{'type':Sequelize[_0x94db('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x94db('0x2')]},'dialPrefix':{'type':Sequelize[_0x94db('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 2a47e5c..a495e46 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 _0x7fb2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','defaults','localhost','register','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','end','stack','name','index','CmList','rawAttributes','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','create','body','role','user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','tags','isArray','join','push','each','omit','success','dataValues','errors','message','CmCustomField','CmContact','CustomFields','format','cf_%d','raw','getContactsCsv','concat','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7fb2,0x80));var _0x27fb=function(_0x549906,_0x32bab6){_0x549906=_0x549906-0x0;var _0xe1abef=_0x7fb2[_0x549906];return _0xe1abef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x27fb('0x0'));var rimraf=require(_0x27fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27fb('0x2'));var rp=require('request-promise');var moment=require(_0x27fb('0x3'));var BPromise=require(_0x27fb('0x4'));var Mustache=require(_0x27fb('0x5'));var util=require(_0x27fb('0x6'));var path=require(_0x27fb('0x7'));var sox=require(_0x27fb('0x8'));var csv=require(_0x27fb('0x9'));var ejs=require(_0x27fb('0xa'));var fs=require('fs');var _=require(_0x27fb('0xb'));var squel=require('squel');var crypto=require(_0x27fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x27fb('0xd'));var toCsv=require(_0x27fb('0x9'));var querystring=require(_0x27fb('0xe'));var Papa=require('papaparse');var Redis=require(_0x27fb('0xf'));var authService=require(_0x27fb('0x10'));var qs=require(_0x27fb('0x11'));var as=require(_0x27fb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x27fb('0x13'));var config=require(_0x27fb('0x14'));var db=require('../../mysqldb')['db'];config[_0x27fb('0x15')]=_[_0x27fb('0x16')](config[_0x27fb('0x15')],{'host':_0x27fb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x27fb('0x18')](socket);function respondWithStatusCode(_0x5b1867,_0x14e89e){_0x14e89e=_0x14e89e||0xcc;return function(_0x153012){if(_0x153012){return _0x5b1867['sendStatus'](_0x14e89e);}return _0x5b1867['status'](_0x14e89e)['end']();};}function respondWithResult(_0x465ddc,_0x35b083){_0x35b083=_0x35b083||0xc8;return function(_0x284560){if(_0x284560){return _0x465ddc[_0x27fb('0x19')](_0x35b083)['json'](_0x284560);}};}function respondWithFilteredResult(_0x192f5d,_0x242686){return function(_0x3777b2){if(_0x3777b2){var _0x526b33=_0x3777b2['count'],_0x3fc689=_0x242686[_0x27fb('0x1a')],_0x4aa286=_0x242686[_0x27fb('0x1a')]+_0x242686[_0x27fb('0x1b')],_0xc33b3a;if(_0x4aa286>=_0x526b33){_0x4aa286=_0x526b33;_0xc33b3a=0xc8;}else{_0xc33b3a=0xce;}_0x192f5d['status'](_0xc33b3a);return _0x192f5d[_0x27fb('0x1c')](_0x27fb('0x1d'),_0x3fc689+'-'+_0x4aa286+'/'+_0x526b33)[_0x27fb('0x1e')](_0x3777b2);}return null;};}function patchUpdates(_0x3decf3){return function(_0x42de90){try{jsonpatch[_0x27fb('0x1f')](_0x42de90,_0x3decf3,!![]);}catch(_0xa29edc){return BPromise[_0x27fb('0x20')](_0xa29edc);}return _0x42de90[_0x27fb('0x21')]();};}function saveUpdates(_0x59d1ba,_0xb74625){return function(_0x29bb23){if(_0x29bb23){return _0x29bb23[_0x27fb('0x22')](_0x59d1ba)['then'](function(_0x3ebf8d){return _0x3ebf8d;});}return null;};}function removeEntity(_0x5c8ab3,_0x4698f8){return function(_0x32de8c){if(_0x32de8c){return _0x32de8c[_0x27fb('0x23')]()[_0x27fb('0x24')](function(){var _0x1831cd=_0x32de8c[_0x27fb('0x25')]({'plain':!![]});var _0x1e3f4e='Lists';return db['UserProfileResource'][_0x27fb('0x23')]({'where':{'type':_0x1e3f4e,'resourceId':_0x1831cd['id']}})[_0x27fb('0x24')](function(){return _0x32de8c;});})[_0x27fb('0x24')](function(){_0x5c8ab3[_0x27fb('0x19')](0xcc)[_0x27fb('0x26')]();});}};}function handleEntityNotFound(_0x28f3f0,_0x536ccc){return function(_0x515bfb){if(!_0x515bfb){_0x28f3f0['sendStatus'](0x194);}return _0x515bfb;};}function handleError(_0x15da27,_0x46de70){_0x46de70=_0x46de70||0x1f4;return function(_0x4fadb3){logger['error'](_0x4fadb3[_0x27fb('0x27')]);if(_0x4fadb3[_0x27fb('0x28')]){delete _0x4fadb3[_0x27fb('0x28')];}_0x15da27[_0x27fb('0x19')](_0x46de70)['send'](_0x4fadb3);};}exports[_0x27fb('0x29')]=function(_0x548195,_0x398e14){var _0x2b5f1a={},_0x37b683={},_0x54611f={'count':0x0,'rows':[]};var _0x467b68=_['map'](db[_0x27fb('0x2a')][_0x27fb('0x2b')],function(_0x1489e5){return{'name':_0x1489e5['fieldName'],'type':_0x1489e5[_0x27fb('0x2c')]['key']};});_0x37b683['model']=_[_0x27fb('0x2d')](_0x467b68,_0x27fb('0x28'));_0x37b683[_0x27fb('0x2e')]=_[_0x27fb('0x2f')](_0x548195[_0x27fb('0x2e')]);_0x37b683[_0x27fb('0x30')]=_[_0x27fb('0x31')](_0x37b683[_0x27fb('0x32')],_0x37b683[_0x27fb('0x2e')]);_0x2b5f1a['attributes']=_[_0x27fb('0x31')](_0x37b683[_0x27fb('0x32')],qs[_0x27fb('0x33')](_0x548195[_0x27fb('0x2e')][_0x27fb('0x33')]));_0x2b5f1a['attributes']=_0x2b5f1a[_0x27fb('0x34')][_0x27fb('0x35')]?_0x2b5f1a[_0x27fb('0x34')]:_0x37b683['model'];if(!_0x548195[_0x27fb('0x2e')][_0x27fb('0x36')]('nolimit')){_0x2b5f1a['limit']=qs[_0x27fb('0x1b')](_0x548195[_0x27fb('0x2e')]['limit']);_0x2b5f1a[_0x27fb('0x1a')]=qs[_0x27fb('0x1a')](_0x548195[_0x27fb('0x2e')][_0x27fb('0x1a')]);}_0x2b5f1a[_0x27fb('0x37')]=qs[_0x27fb('0x38')](_0x548195[_0x27fb('0x2e')][_0x27fb('0x38')]);_0x2b5f1a[_0x27fb('0x39')]=qs[_0x27fb('0x30')](_[_0x27fb('0x3a')](_0x548195[_0x27fb('0x2e')],_0x37b683['filters']),_0x467b68);if(_0x548195['query']['filter']){_0x2b5f1a[_0x27fb('0x39')]=_[_0x27fb('0x3b')](_0x2b5f1a[_0x27fb('0x39')],{'$or':_[_0x27fb('0x2d')](_0x467b68,function(_0x644fb9){if(_0x644fb9[_0x27fb('0x2c')]!==_0x27fb('0x3c')){var _0x17cf8a={};_0x17cf8a[_0x644fb9[_0x27fb('0x28')]]={'$like':'%'+_0x548195[_0x27fb('0x2e')][_0x27fb('0x3d')]+'%'};return _0x17cf8a;}})});}_0x2b5f1a=_['merge']({},_0x2b5f1a,_0x548195[_0x27fb('0x3e')]);var _0x455145={'where':_0x2b5f1a[_0x27fb('0x39')]};return db[_0x27fb('0x2a')][_0x27fb('0x3f')](_0x455145)[_0x27fb('0x24')](function(_0x3efc38){_0x54611f[_0x27fb('0x3f')]=_0x3efc38;if(_0x548195[_0x27fb('0x2e')][_0x27fb('0x40')]){_0x2b5f1a[_0x27fb('0x41')]=[{'all':!![]}];}return db[_0x27fb('0x2a')][_0x27fb('0x42')](_0x2b5f1a);})[_0x27fb('0x24')](function(_0x187bcc){_0x54611f[_0x27fb('0x43')]=_0x187bcc;return _0x54611f;})[_0x27fb('0x24')](respondWithFilteredResult(_0x398e14,_0x2b5f1a))['catch'](handleError(_0x398e14,null));};exports[_0x27fb('0x44')]=function(_0x4f9c89,_0x243203){var _0x15b670={'raw':![],'where':{'id':_0x4f9c89[_0x27fb('0x45')]['id']}},_0x916a97={};_0x916a97['model']=_[_0x27fb('0x2f')](db[_0x27fb('0x2a')]['rawAttributes']);_0x916a97[_0x27fb('0x2e')]=_['keys'](_0x4f9c89[_0x27fb('0x2e')]);_0x916a97[_0x27fb('0x30')]=_[_0x27fb('0x31')](_0x916a97['model'],_0x916a97[_0x27fb('0x2e')]);_0x15b670[_0x27fb('0x34')]=_[_0x27fb('0x31')](_0x916a97['model'],qs['fields'](_0x4f9c89['query'][_0x27fb('0x33')]));_0x15b670[_0x27fb('0x34')]=_0x15b670[_0x27fb('0x34')]['length']?_0x15b670[_0x27fb('0x34')]:_0x916a97['model'];if(_0x4f9c89[_0x27fb('0x2e')]['includeAll']){_0x15b670['include']=[{'all':!![]}];}_0x15b670=_['merge']({},_0x15b670,_0x4f9c89['options']);return db[_0x27fb('0x2a')][_0x27fb('0x46')](_0x15b670)[_0x27fb('0x24')](handleEntityNotFound(_0x243203,null))[_0x27fb('0x24')](respondWithResult(_0x243203,null))['catch'](handleError(_0x243203,null));};exports[_0x27fb('0x47')]=function(_0x4e33bd,_0x3797e3){return db[_0x27fb('0x2a')][_0x27fb('0x47')](_0x4e33bd[_0x27fb('0x48')],{})['then'](function(_0x55272a){var _0x686b57=_0x4e33bd['user'][_0x27fb('0x25')]({'plain':!![]});if(!_0x686b57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x686b57[_0x27fb('0x49')]===_0x27fb('0x4a')){var _0x102b9a=_0x55272a[_0x27fb('0x25')]({'plain':!![]});var _0x23e05c=_0x27fb('0x4b');return db[_0x27fb('0x4c')]['find']({'where':{'name':_0x23e05c,'userProfileId':_0x686b57[_0x27fb('0x4d')]},'raw':!![]})['then'](function(_0xdd6f68){if(_0xdd6f68&&_0xdd6f68[_0x27fb('0x4e')]===0x0){return db[_0x27fb('0x4f')][_0x27fb('0x47')]({'name':_0x102b9a[_0x27fb('0x28')],'resourceId':_0x102b9a['id'],'type':_0xdd6f68[_0x27fb('0x28')],'sectionId':_0xdd6f68['id']},{})[_0x27fb('0x24')](function(){return _0x55272a;});}else{return _0x55272a;}})[_0x27fb('0x50')](function(_0x4e25a6){logger[_0x27fb('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e25a6);throw _0x4e25a6;});}return _0x55272a;})[_0x27fb('0x24')](respondWithResult(_0x3797e3,0xc9))[_0x27fb('0x50')](handleError(_0x3797e3,null));};exports[_0x27fb('0x22')]=function(_0x1c7291,_0x1e5f67){if(_0x1c7291[_0x27fb('0x48')]['id']){delete _0x1c7291[_0x27fb('0x48')]['id'];}return db[_0x27fb('0x2a')][_0x27fb('0x46')]({'where':{'id':_0x1c7291[_0x27fb('0x45')]['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x1e5f67,null))[_0x27fb('0x24')](saveUpdates(_0x1c7291[_0x27fb('0x48')],null))[_0x27fb('0x24')](respondWithResult(_0x1e5f67,null))[_0x27fb('0x50')](handleError(_0x1e5f67,null));};exports[_0x27fb('0x23')]=function(_0x46e53a,_0x21471f){return db[_0x27fb('0x2a')][_0x27fb('0x46')]({'where':{'id':_0x46e53a[_0x27fb('0x45')]['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x21471f,null))['then'](removeEntity(_0x21471f,null))[_0x27fb('0x50')](handleError(_0x21471f,null));};exports['describe']=function(_0x1e5420,_0x1194a7){return db[_0x27fb('0x2a')][_0x27fb('0x52')]()['then'](respondWithResult(_0x1194a7,null))[_0x27fb('0x50')](handleError(_0x1194a7,null));};exports[_0x27fb('0x53')]=function(_0x3191fd,_0x550b38,_0x22961f){if(_0x3191fd[_0x27fb('0x48')]['id']){delete _0x3191fd[_0x27fb('0x48')]['id'];}return db[_0x27fb('0x2a')]['find']({'where':{'id':_0x3191fd[_0x27fb('0x45')]['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x550b38,null))['then'](function(_0x2e4a6e){if(_0x2e4a6e){_0x3191fd[_0x27fb('0x48')][_0x27fb('0x54')]=_0x2e4a6e['id'];return db[_0x27fb('0x55')][_0x27fb('0x47')](_0x3191fd[_0x27fb('0x48')]);}})[_0x27fb('0x24')](respondWithResult(_0x550b38,null))[_0x27fb('0x50')](handleError(_0x550b38,null));};exports[_0x27fb('0x56')]=function(_0x10d562,_0x4e86e7,_0x14851a){var _0x16da95={'raw':![],'where':{}};var _0x289ca6={};var _0x580c40={'count':0x0,'rows':[]};return db[_0x27fb('0x2a')][_0x27fb('0x57')]({'where':{'id':_0x10d562[_0x27fb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e86e7,null))[_0x27fb('0x24')](function(_0x42bcf7){if(_0x42bcf7){_0x289ca6['model']=_['keys'](db[_0x27fb('0x55')][_0x27fb('0x2b')]);_0x289ca6[_0x27fb('0x2e')]=_['keys'](_0x10d562[_0x27fb('0x2e')]);_0x289ca6[_0x27fb('0x30')]=_[_0x27fb('0x31')](_0x289ca6[_0x27fb('0x32')],_0x289ca6[_0x27fb('0x2e')]);_0x16da95[_0x27fb('0x34')]=_['intersection'](_0x289ca6[_0x27fb('0x32')],qs[_0x27fb('0x33')](_0x10d562[_0x27fb('0x2e')][_0x27fb('0x33')]));_0x16da95[_0x27fb('0x34')]=_0x16da95[_0x27fb('0x34')][_0x27fb('0x35')]?_0x16da95[_0x27fb('0x34')]:_0x289ca6['model'];if(!_0x10d562['query'][_0x27fb('0x36')](_0x27fb('0x58'))){_0x16da95[_0x27fb('0x1b')]=qs[_0x27fb('0x1b')](_0x10d562[_0x27fb('0x2e')]['limit']);_0x16da95['offset']=qs[_0x27fb('0x1a')](_0x10d562[_0x27fb('0x2e')][_0x27fb('0x1a')]);}_0x16da95[_0x27fb('0x37')]=qs[_0x27fb('0x38')](_0x10d562[_0x27fb('0x2e')][_0x27fb('0x38')]);_0x16da95[_0x27fb('0x39')]=qs[_0x27fb('0x30')](_[_0x27fb('0x3a')](_0x10d562[_0x27fb('0x2e')],_0x289ca6[_0x27fb('0x30')]));_0x16da95['where'][_0x27fb('0x54')]=_0x42bcf7['id'];if(_0x10d562['query'][_0x27fb('0x3d')]){_0x16da95[_0x27fb('0x39')]=_['merge'](_0x16da95[_0x27fb('0x39')],{'$or':_['map'](_0x16da95[_0x27fb('0x34')],function(_0x19d3b0){var _0x456dc7={};_0x456dc7[_0x19d3b0]={'$like':'%'+_0x10d562[_0x27fb('0x2e')][_0x27fb('0x3d')]+'%'};return _0x456dc7;})});}_0x16da95=_[_0x27fb('0x3b')]({},_0x16da95,_0x10d562[_0x27fb('0x3e')]);return db[_0x27fb('0x55')][_0x27fb('0x3f')]({'where':_0x16da95['where']})['then'](function(_0x4e2ef1){_0x580c40['count']=_0x4e2ef1;if(_0x10d562['query'][_0x27fb('0x40')]){_0x16da95[_0x27fb('0x41')]=[{'all':!![]}];}return db[_0x27fb('0x55')][_0x27fb('0x42')](_0x16da95);})[_0x27fb('0x24')](function(_0x1128e2){_0x580c40['rows']=_0x1128e2;return _0x580c40;});}})['then'](respondWithFilteredResult(_0x4e86e7,_0x16da95))[_0x27fb('0x50')](handleError(_0x4e86e7,null));};exports['removeDispositions']=function(_0xa29712,_0x3c5f0e,_0x2a1563){return db[_0x27fb('0x2a')]['find']({'where':{'id':_0xa29712['params']['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x3c5f0e,null))[_0x27fb('0x24')](function(_0x24dfde){if(_0x24dfde){return _0x24dfde[_0x27fb('0x59')](_0xa29712[_0x27fb('0x2e')][_0x27fb('0x5a')]);}})[_0x27fb('0x24')](respondWithStatusCode(_0x3c5f0e,null))['catch'](handleError(_0x3c5f0e,null));};exports['addContacts']=function(_0x2ae1fa,_0x385b2c,_0x29ba81){return db[_0x27fb('0x2a')]['find']({'where':{'id':_0x2ae1fa['params']['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x385b2c,null))[_0x27fb('0x24')](function(_0x659dcb){if(_0x659dcb){var _0x103430=[];var _0x3e83bb={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x27fb('0x24')](function(_0x1650e8){if(_0x2ae1fa[_0x27fb('0x48')][_0x27fb('0x5b')]&&_[_0x27fb('0x5c')](_0x2ae1fa[_0x27fb('0x48')][_0x27fb('0x5b')])){if(_0x2ae1fa['body'][_0x27fb('0x5b')][_0x27fb('0x35')]){_0x2ae1fa[_0x27fb('0x48')][_0x27fb('0x5b')]=_0x2ae1fa['body'][_0x27fb('0x5b')][_0x27fb('0x5d')](';')+';';}else{_0x2ae1fa[_0x27fb('0x48')][_0x27fb('0x5b')]=null;}}else{_0x2ae1fa['body'][_0x27fb('0x5b')]=null;}if(_0x2ae1fa[_0x27fb('0x48')]&&_[_0x27fb('0x5c')](_0x2ae1fa['body'])){for(var _0x3b73b3=0x0;_0x3b73b3<_0x2ae1fa[_0x27fb('0x48')][_0x27fb('0x35')];_0x3b73b3+=0x1){_0x2ae1fa['body'][_0x3b73b3][_0x27fb('0x54')]=_0x2ae1fa['params']['id'];_0x103430[_0x27fb('0x5e')](_0x2ae1fa['body'][_0x3b73b3]);}return BPromise[_0x27fb('0x5f')](_0x103430,function(_0x39f071){return db['CmContact'][_0x27fb('0x47')](_[_0x27fb('0x60')](_0x39f071,[_0x27fb('0x5a'),'id'])||{},{'fields':_[_0x27fb('0x2f')](_0x1650e8),'raw':!![]})['then'](function(_0x14891d){_0x3e83bb[_0x27fb('0x61')][_0x27fb('0x5e')](_0x14891d[_0x27fb('0x62')]);})[_0x27fb('0x50')](function(_0x4d8ca7){_0x3e83bb[_0x27fb('0x63')][_0x27fb('0x5e')]({'data':_0x39f071,'error':_0x4d8ca7[_0x27fb('0x64')]});});})['then'](function(_0x22b075){return _0x3e83bb;})[_0x27fb('0x50')](function(_0x453bdb){return _0x453bdb;});}else{_0x385b2c[_0x27fb('0x19')](0x190)[_0x27fb('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x27fb('0x24')](respondWithResult(_0x385b2c,null))['catch'](handleError(_0x385b2c,null));};exports['getContacts']=function(_0x48a97b,_0x118a57,_0x368b4a){var _0x2e6e03;return db[_0x27fb('0x2a')][_0x27fb('0x46')]({'where':{'id':_0x48a97b[_0x27fb('0x45')]['id']},'include':[{'model':db[_0x27fb('0x65')],'as':'CustomFields'}]})[_0x27fb('0x24')](handleEntityNotFound(_0x118a57,null))[_0x27fb('0x24')](function(_0xa663b8){if(_0xa663b8){_0x2e6e03=_0xa663b8;return db[_0x27fb('0x66')][_0x27fb('0x2b')];}})[_0x27fb('0x24')](function(_0x3c186b){if(_0x3c186b){var _0x4c186d={};var _0x1ad706={};_0x1ad706[_0x27fb('0x32')]=_['concat'](_[_0x27fb('0x2f')](_0x3c186b),_[_0x27fb('0x2d')](_0x2e6e03[_0x27fb('0x67')],function(_0x85dbb8){return util[_0x27fb('0x68')](_0x27fb('0x69'),_0x85dbb8['id']);}));_0x1ad706[_0x27fb('0x2e')]=_[_0x27fb('0x2f')](_0x48a97b[_0x27fb('0x2e')]);_0x1ad706[_0x27fb('0x30')]=_['intersection'](_0x1ad706[_0x27fb('0x32')],_0x1ad706['query']);_0x4c186d[_0x27fb('0x34')]=_[_0x27fb('0x31')](_0x1ad706['model'],qs[_0x27fb('0x33')](_0x48a97b[_0x27fb('0x2e')][_0x27fb('0x33')]));_0x4c186d[_0x27fb('0x34')]=_0x4c186d[_0x27fb('0x34')][_0x27fb('0x35')]?_0x4c186d[_0x27fb('0x34')]:_0x1ad706[_0x27fb('0x32')];if(!_0x48a97b[_0x27fb('0x2e')][_0x27fb('0x36')]('nolimit')){_0x4c186d['limit']=qs[_0x27fb('0x1b')](_0x48a97b[_0x27fb('0x2e')][_0x27fb('0x1b')]);_0x4c186d['offset']=qs[_0x27fb('0x1a')](_0x48a97b['query'][_0x27fb('0x1a')]);}_0x4c186d[_0x27fb('0x37')]=qs[_0x27fb('0x38')](_0x48a97b[_0x27fb('0x2e')]['sort']);_0x4c186d[_0x27fb('0x39')]=qs[_0x27fb('0x30')](_['pick'](_0x48a97b['query'],_0x1ad706[_0x27fb('0x30')]));_0x4c186d[_0x27fb('0x6a')]=!![];if(_0x48a97b[_0x27fb('0x2e')][_0x27fb('0x3d')]){_0x4c186d['where']=_[_0x27fb('0x3b')](_0x4c186d['where'],{'$or':_['map'](_0x4c186d['attributes'],function(_0x5d2026){var _0x2d7bba={};_0x2d7bba[_0x5d2026]={'$like':'%'+_0x48a97b[_0x27fb('0x2e')][_0x27fb('0x3d')]+'%'};return _0x2d7bba;})});}_0x4c186d=_['merge']({},_0x4c186d,_0x48a97b[_0x27fb('0x3e')]);return _0x2e6e03['getContacts'](_0x4c186d);}})[_0x27fb('0x24')](respondWithResult(_0x118a57,null))['catch'](handleError(_0x118a57,null));};exports[_0x27fb('0x6b')]=function(_0x211d29,_0x2bb207,_0x1b4805){var _0x2d2c35;return db[_0x27fb('0x2a')][_0x27fb('0x46')]({'where':{'id':_0x211d29[_0x27fb('0x45')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x27fb('0x67')}]})[_0x27fb('0x24')](handleEntityNotFound(_0x2bb207,null))[_0x27fb('0x24')](function(_0xa87dc){if(_0xa87dc){_0x2d2c35=_0xa87dc;return db[_0x27fb('0x66')][_0x27fb('0x2b')];}})[_0x27fb('0x24')](function(_0x2b1b79){if(_0x2b1b79){var _0xa9616={};var _0x2af021={};_0x2af021[_0x27fb('0x32')]=_[_0x27fb('0x6c')](_[_0x27fb('0x2f')](_0x2b1b79),_[_0x27fb('0x2d')](_0x2d2c35['CustomFields'],function(_0x254d2f){return util[_0x27fb('0x68')](_0x27fb('0x69'),_0x254d2f['id']);}));_0x2af021[_0x27fb('0x2e')]=_['keys'](_0x211d29['query']);_0x2af021['filters']=_[_0x27fb('0x31')](_0x2af021[_0x27fb('0x32')],_0x2af021[_0x27fb('0x2e')]);_0xa9616['attributes']=_[_0x27fb('0x31')](_0x2af021[_0x27fb('0x32')],qs['fields'](_0x211d29[_0x27fb('0x2e')][_0x27fb('0x33')]));_0xa9616[_0x27fb('0x34')]=_0xa9616[_0x27fb('0x34')][_0x27fb('0x35')]?_0xa9616[_0x27fb('0x34')]:_0x2af021[_0x27fb('0x32')];if(!_0x211d29[_0x27fb('0x2e')][_0x27fb('0x36')]('nolimit')){_0xa9616[_0x27fb('0x1b')]=qs[_0x27fb('0x1b')](_0x211d29[_0x27fb('0x2e')][_0x27fb('0x1b')]);_0xa9616['offset']=qs[_0x27fb('0x1a')](_0x211d29[_0x27fb('0x2e')]['offset']);}_0xa9616[_0x27fb('0x37')]=qs[_0x27fb('0x38')](_0x211d29[_0x27fb('0x2e')][_0x27fb('0x38')]);_0xa9616[_0x27fb('0x39')]=qs['filters'](_[_0x27fb('0x3a')](_0x211d29['query'],_0x2af021[_0x27fb('0x30')]));_0xa9616['raw']=!![];if(_0x211d29[_0x27fb('0x2e')]['filter']){_0xa9616[_0x27fb('0x39')]=_[_0x27fb('0x3b')](_0xa9616[_0x27fb('0x39')],{'$or':_[_0x27fb('0x2d')](_0xa9616[_0x27fb('0x34')],function(_0x5068bf){var _0x4f0636={};_0x4f0636[_0x5068bf]={'$like':'%'+_0x211d29[_0x27fb('0x2e')][_0x27fb('0x3d')]+'%'};return _0x4f0636;})});}_0xa9616=_['merge']({},_0xa9616,_0x211d29['options']);return _0x2d2c35['getContacts'](_0xa9616);}})['then'](function(_0x134ce4){if(!_[_0x27fb('0x6d')](_0x134ce4)){var _0x480681=toCsv(_0x134ce4);var _0x17576a=Date[_0x27fb('0x6e')]();fs[_0x27fb('0x6f')](util[_0x27fb('0x68')](_0x27fb('0x70'),_0x2d2c35['id'],_0x17576a),_0x480681);_0x2bb207['setHeader'](_0x27fb('0x71'),_0x27fb('0x72')+util[_0x27fb('0x68')](_0x27fb('0x73'),_0x2d2c35['id'],_0x17576a));_0x2bb207[_0x27fb('0x74')](_0x27fb('0x75'),_0x27fb('0x76'));return _0x2bb207[_0x27fb('0x77')](util[_0x27fb('0x68')](_0x27fb('0x70'),_0x2d2c35['id'],_0x17576a));}else{return _0x2bb207[_0x27fb('0x78')](0xcc);}})['catch'](handleError(_0x2bb207,null));};exports[_0x27fb('0x79')]=function(_0x56656f,_0x240a27,_0x5bc396){var _0x541802;delete _0x56656f['body']['id'];return db[_0x27fb('0x2a')][_0x27fb('0x57')]({'where':{'id':_0x56656f[_0x27fb('0x45')]['id']}})['then'](handleEntityNotFound(_0x240a27,null))[_0x27fb('0x24')](function(_0x549d9d){if(_0x549d9d){return db[_0x27fb('0x7a')][_0x27fb('0x7b')](function(_0x382312){return db[_0x27fb('0x65')][_0x27fb('0x47')](_0x56656f[_0x27fb('0x48')],{'transaction':_0x382312})[_0x27fb('0x24')](function(_0x541e20){_0x541802=_0x541e20;return _0x549d9d[_0x27fb('0x7c')](_0x541e20,{'transaction':_0x382312});})[_0x27fb('0x24')](function(){var _0x40db20={'type':db[_0x27fb('0x7d')][_0x27fb('0x7e')],'transaction':_0x382312};switch(_0x56656f[_0x27fb('0x48')][_0x27fb('0x2c')]){case _0x27fb('0x7f'):_0x40db20[_0x27fb('0x2c')]=db[_0x27fb('0x7d')][_0x27fb('0x7e')];break;case _0x27fb('0x80'):_0x40db20[_0x27fb('0x2c')]=db[_0x27fb('0x7d')]['INTEGER'];break;case _0x27fb('0x81'):_0x40db20[_0x27fb('0x2c')]=db[_0x27fb('0x7d')][_0x27fb('0x82')];_0x40db20[_0x27fb('0x83')]=![];break;default:}return db[_0x27fb('0x7a')][_0x27fb('0x84')][_0x27fb('0x85')](_0x27fb('0x86'),util[_0x27fb('0x68')]('cf_%s',_0x541802['id']),_0x40db20);})[_0x27fb('0x24')](function(){return _0x541802;});});}})[_0x27fb('0x24')](respondWithResult(_0x240a27,null))[_0x27fb('0x50')](handleError(_0x240a27,null));};exports['getCustomFields']=function(_0x49b8a3,_0x4b7843,_0x3847af){var _0x3faea2={};var _0x3dad98={};var _0x54bca6;var _0xc74920;return db[_0x27fb('0x2a')][_0x27fb('0x57')]({'where':{'id':_0x49b8a3[_0x27fb('0x45')]['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x4b7843,null))[_0x27fb('0x24')](function(_0x594e63){if(_0x594e63){_0x54bca6=_0x594e63;_0x3dad98[_0x27fb('0x32')]=_[_0x27fb('0x2f')](db[_0x27fb('0x65')][_0x27fb('0x2b')]);_0x3dad98[_0x27fb('0x2e')]=_[_0x27fb('0x2f')](_0x49b8a3[_0x27fb('0x2e')]);_0x3dad98[_0x27fb('0x30')]=_[_0x27fb('0x31')](_0x3dad98['model'],_0x3dad98[_0x27fb('0x2e')]);_0x3faea2['attributes']=_[_0x27fb('0x31')](_0x3dad98[_0x27fb('0x32')],qs[_0x27fb('0x33')](_0x49b8a3[_0x27fb('0x2e')][_0x27fb('0x33')]));_0x3faea2[_0x27fb('0x34')]=_0x3faea2[_0x27fb('0x34')]['length']?_0x3faea2[_0x27fb('0x34')]:_0x3dad98['model'];_0x3faea2[_0x27fb('0x37')]=qs['sort'](_0x49b8a3[_0x27fb('0x2e')][_0x27fb('0x38')]);_0x3faea2[_0x27fb('0x39')]=qs['filters'](_['pick'](_0x49b8a3[_0x27fb('0x2e')],_0x3dad98['filters']));_0x3faea2[_0x27fb('0x39')]=_['merge'](_0x3faea2['where'],{'$or':[{'ListId':_0x594e63['id']},{'ListId':null}]});if(_0x49b8a3[_0x27fb('0x2e')][_0x27fb('0x3d')]){_0x3faea2[_0x27fb('0x39')]=_['merge'](_0x3faea2[_0x27fb('0x39')],{'$or':_[_0x27fb('0x2d')](_0x3faea2[_0x27fb('0x34')],function(_0x43f1ad){var _0x54703d={};_0x54703d[_0x43f1ad]={'$like':'%'+_0x49b8a3[_0x27fb('0x2e')]['filter']+'%'};return _0x54703d;})});}_0x3faea2=_[_0x27fb('0x3b')]({},_0x3faea2,_0x49b8a3[_0x27fb('0x3e')]);return db[_0x27fb('0x65')]['findAndCountAll'](_0x3faea2);}})[_0x27fb('0x24')](respondWithResult(_0x4b7843,null))['catch'](handleError(_0x4b7843,null));};exports[_0x27fb('0x87')]=function(_0x31a4b8,_0x2ba0e4,_0x248441){return db[_0x27fb('0x2a')]['find']({'where':{'id':_0x31a4b8['params']['id']}})[_0x27fb('0x24')](handleEntityNotFound(_0x2ba0e4,null))['then'](function(_0x2297da){if(_0x2297da){return _0x2297da[_0x27fb('0x87')](_0x31a4b8[_0x27fb('0x48')]['ids'],_[_0x27fb('0x60')](_0x31a4b8[_0x27fb('0x48')],[_0x27fb('0x5a'),'id'])||{})[_0x27fb('0x88')](function(_0x47fba0){for(var _0x7922fb=0x0;_0x7922fb<_0x31a4b8[_0x27fb('0x48')]['ids'][_0x27fb('0x35')];_0x7922fb+=0x1){socket['emit'](_0x27fb('0x89'),{'UserId':_0x31a4b8[_0x27fb('0x48')][_0x27fb('0x5a')][_0x7922fb],'CmListId':_0x31a4b8[_0x27fb('0x45')]['id']});}return _0x47fba0;});}})[_0x27fb('0x24')](respondWithResult(_0x2ba0e4,null))[_0x27fb('0x50')](handleError(_0x2ba0e4,null));};exports['removeAgents']=function(_0x1e2532,_0x513477,_0x424e66){return db[_0x27fb('0x2a')][_0x27fb('0x46')]({'where':{'id':_0x1e2532[_0x27fb('0x45')]['id']}})['then'](handleEntityNotFound(_0x513477,null))[_0x27fb('0x24')](function(_0x126bf5){if(_0x126bf5){return _0x126bf5[_0x27fb('0x8a')](_0x1e2532[_0x27fb('0x2e')][_0x27fb('0x5a')])['then'](function(){if(_[_0x27fb('0x5c')](_0x1e2532['query']['ids'])){for(var _0x428aea=0x0;_0x428aea<_0x1e2532['query'][_0x27fb('0x5a')][_0x27fb('0x35')];_0x428aea+=0x1){socket['emit'](_0x27fb('0x8b'),{'UserId':Number(_0x1e2532[_0x27fb('0x2e')][_0x27fb('0x5a')][_0x428aea]),'CmListId':Number(_0x1e2532[_0x27fb('0x45')]['id'])});}}else{socket[_0x27fb('0x8c')](_0x27fb('0x8b'),{'UserId':Number(_0x1e2532[_0x27fb('0x2e')][_0x27fb('0x5a')]),'CmListId':Number(_0x1e2532[_0x27fb('0x45')]['id'])});}});}})[_0x27fb('0x24')](respondWithStatusCode(_0x513477,null))[_0x27fb('0x50')](handleError(_0x513477,null));};exports[_0x27fb('0x8d')]=function(_0x1b0318,_0x22db57,_0x21e64a){var _0x5b944b={};var _0x419241={};var _0xc53df1;var _0x49a54e;return db[_0x27fb('0x2a')]['findOne']({'where':{'id':_0x1b0318[_0x27fb('0x45')]['id']}})['then'](handleEntityNotFound(_0x22db57,null))['then'](function(_0x16d6ed){if(_0x16d6ed){_0xc53df1=_0x16d6ed;_0x419241[_0x27fb('0x32')]=_[_0x27fb('0x2f')](db[_0x27fb('0x8e')][_0x27fb('0x2b')]);_0x419241['query']=_[_0x27fb('0x2f')](_0x1b0318[_0x27fb('0x2e')]);_0x419241['filters']=_['intersection'](_0x419241['model'],_0x419241[_0x27fb('0x2e')]);_0x5b944b[_0x27fb('0x34')]=_[_0x27fb('0x31')](_0x419241[_0x27fb('0x32')],qs[_0x27fb('0x33')](_0x1b0318[_0x27fb('0x2e')][_0x27fb('0x33')]));_0x5b944b[_0x27fb('0x34')]=_0x5b944b[_0x27fb('0x34')][_0x27fb('0x35')]?_0x5b944b['attributes']:_0x419241[_0x27fb('0x32')];_0x5b944b[_0x27fb('0x37')]=qs[_0x27fb('0x38')](_0x1b0318[_0x27fb('0x2e')][_0x27fb('0x38')]);_0x5b944b[_0x27fb('0x39')]=qs['filters'](_['pick'](_0x1b0318[_0x27fb('0x2e')],_0x419241[_0x27fb('0x30')]));if(_0x1b0318['query'][_0x27fb('0x3d')]){_0x5b944b[_0x27fb('0x39')]=_[_0x27fb('0x3b')](_0x5b944b[_0x27fb('0x39')],{'$or':_['map'](_0x5b944b[_0x27fb('0x34')],function(_0x202982){var _0x56f103={};_0x56f103[_0x202982]={'$like':'%'+_0x1b0318['query']['filter']+'%'};return _0x56f103;})});}_0x5b944b=_[_0x27fb('0x3b')]({},_0x5b944b,_0x1b0318[_0x27fb('0x3e')]);return _0xc53df1[_0x27fb('0x8d')](_0x5b944b);}})[_0x27fb('0x24')](function(_0x59a0ca){if(_0x59a0ca){_0x49a54e=_0x59a0ca['length'];if(!_0x1b0318[_0x27fb('0x2e')][_0x27fb('0x36')](_0x27fb('0x58'))){_0x5b944b[_0x27fb('0x1b')]=qs[_0x27fb('0x1b')](_0x1b0318[_0x27fb('0x2e')]['limit']);_0x5b944b[_0x27fb('0x1a')]=qs[_0x27fb('0x1a')](_0x1b0318['query'][_0x27fb('0x1a')]);}return _0xc53df1['getAgents'](_0x5b944b);}})[_0x27fb('0x24')](function(_0x5c6267){if(_0x5c6267){return _0x5c6267?{'count':_0x49a54e,'rows':_0x5c6267}:null;}})[_0x27fb('0x24')](respondWithResult(_0x22db57,null))[_0x27fb('0x50')](handleError(_0x22db57,null));}; \ No newline at end of file +var _0x5b27=['emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmList.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','Lists','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','fields','include','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','getDispositions','findOne','Disposition','hasOwnProperty','pick','includeAll','removeDispositions','addContacts','isArray','tags','push','each','CmContact','omit','ids','success','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread'];(function(_0x531a19,_0x43e019){var _0x4845d2=function(_0x4c9b62){while(--_0x4c9b62){_0x531a19['push'](_0x531a19['shift']());}};_0x4845d2(++_0x43e019);}(_0x5b27,0x1ad));var _0x75b2=function(_0x502498,_0x2208a){_0x502498=_0x502498-0x0;var _0x2a75d8=_0x5b27[_0x502498];return _0x2a75d8;};'use strict';var pdf=require(_0x75b2('0x0'));var emlformat=require(_0x75b2('0x1'));var rimraf=require(_0x75b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75b2('0x3'));var moment=require(_0x75b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75b2('0x5'));var util=require(_0x75b2('0x6'));var path=require('path');var sox=require(_0x75b2('0x7'));var csv=require(_0x75b2('0x8'));var ejs=require(_0x75b2('0x9'));var fs=require('fs');var _=require(_0x75b2('0xa'));var squel=require(_0x75b2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x75b2('0xc'));var toCsv=require(_0x75b2('0x8'));var querystring=require(_0x75b2('0xd'));var Papa=require(_0x75b2('0xe'));var Redis=require(_0x75b2('0xf'));var authService=require(_0x75b2('0x10'));var qs=require(_0x75b2('0x11'));var as=require(_0x75b2('0x12'));var hardwareService=require(_0x75b2('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x75b2('0x14'));var db=require(_0x75b2('0x15'))['db'];config['redis']=_[_0x75b2('0x16')](config['redis'],{'host':_0x75b2('0x17'),'port':0x18eb});var socket=require(_0x75b2('0x18'))(new Redis(config[_0x75b2('0x19')]));require(_0x75b2('0x1a'))['register'](socket);function respondWithStatusCode(_0x9f11ef,_0x3bd468){_0x3bd468=_0x3bd468||0xcc;return function(_0x387e69){if(_0x387e69){return _0x9f11ef[_0x75b2('0x1b')](_0x3bd468);}return _0x9f11ef[_0x75b2('0x1c')](_0x3bd468)[_0x75b2('0x1d')]();};}function respondWithResult(_0x15a234,_0x51e1b9){_0x51e1b9=_0x51e1b9||0xc8;return function(_0x172ce1){if(_0x172ce1){return _0x15a234[_0x75b2('0x1c')](_0x51e1b9)[_0x75b2('0x1e')](_0x172ce1);}};}function respondWithFilteredResult(_0x13dacf,_0x2c7ad8){return function(_0x24667f){if(_0x24667f){var _0xdfa184=_0x24667f[_0x75b2('0x1f')],_0x5c34d9=_0x2c7ad8[_0x75b2('0x20')],_0x3c756c=_0x2c7ad8[_0x75b2('0x20')]+_0x2c7ad8[_0x75b2('0x21')],_0x1435a3;if(_0x3c756c>=_0xdfa184){_0x3c756c=_0xdfa184;_0x1435a3=0xc8;}else{_0x1435a3=0xce;}_0x13dacf[_0x75b2('0x1c')](_0x1435a3);return _0x13dacf[_0x75b2('0x22')](_0x75b2('0x23'),_0x5c34d9+'-'+_0x3c756c+'/'+_0xdfa184)[_0x75b2('0x1e')](_0x24667f);}return null;};}function patchUpdates(_0x43ff74){return function(_0x1fb987){try{jsonpatch[_0x75b2('0x24')](_0x1fb987,_0x43ff74,!![]);}catch(_0x87dcde){return BPromise['reject'](_0x87dcde);}return _0x1fb987[_0x75b2('0x25')]();};}function saveUpdates(_0x22f1d7,_0x30dfcd){return function(_0x4d5ca7){if(_0x4d5ca7){return _0x4d5ca7[_0x75b2('0x26')](_0x22f1d7)[_0x75b2('0x27')](function(_0x278b0){return _0x278b0;});}return null;};}function removeEntity(_0x335ec2,_0x2b52f6){return function(_0x3f9cfa){if(_0x3f9cfa){return _0x3f9cfa[_0x75b2('0x28')]()[_0x75b2('0x27')](function(){var _0x8662a=_0x3f9cfa['get']({'plain':!![]});var _0x5dbb92=_0x75b2('0x29');return db[_0x75b2('0x2a')][_0x75b2('0x28')]({'where':{'type':_0x5dbb92,'resourceId':_0x8662a['id']}})['then'](function(){return _0x3f9cfa;});})[_0x75b2('0x27')](function(){_0x335ec2['status'](0xcc)[_0x75b2('0x1d')]();});}};}function handleEntityNotFound(_0x47bfa6,_0x3d1fbc){return function(_0x9e16c0){if(!_0x9e16c0){_0x47bfa6['sendStatus'](0x194);}return _0x9e16c0;};}function handleError(_0xa9f00b,_0x53894b){_0x53894b=_0x53894b||0x1f4;return function(_0x280102){logger[_0x75b2('0x2b')](_0x280102['stack']);if(_0x280102['name']){delete _0x280102[_0x75b2('0x2c')];}_0xa9f00b['status'](_0x53894b)[_0x75b2('0x2d')](_0x280102);};}exports[_0x75b2('0x2e')]=function(_0xfd15da,_0x16f18f){var _0x3ffc40={},_0x40a99c={},_0x2272df={'count':0x0,'rows':[]};var _0x5bf4d4=_[_0x75b2('0x2f')](db[_0x75b2('0x30')][_0x75b2('0x31')],function(_0x4923c9){return{'name':_0x4923c9[_0x75b2('0x32')],'type':_0x4923c9['type'][_0x75b2('0x33')]};});_0x40a99c[_0x75b2('0x34')]=_['map'](_0x5bf4d4,'name');_0x40a99c[_0x75b2('0x35')]=_['keys'](_0xfd15da[_0x75b2('0x35')]);_0x40a99c[_0x75b2('0x36')]=_[_0x75b2('0x37')](_0x40a99c['model'],_0x40a99c[_0x75b2('0x35')]);_0x3ffc40['attributes']=_[_0x75b2('0x37')](_0x40a99c[_0x75b2('0x34')],qs['fields'](_0xfd15da[_0x75b2('0x35')]['fields']));_0x3ffc40[_0x75b2('0x38')]=_0x3ffc40[_0x75b2('0x38')][_0x75b2('0x39')]?_0x3ffc40['attributes']:_0x40a99c[_0x75b2('0x34')];if(!_0xfd15da[_0x75b2('0x35')]['hasOwnProperty'](_0x75b2('0x3a'))){_0x3ffc40[_0x75b2('0x21')]=qs[_0x75b2('0x21')](_0xfd15da[_0x75b2('0x35')][_0x75b2('0x21')]);_0x3ffc40[_0x75b2('0x20')]=qs['offset'](_0xfd15da[_0x75b2('0x35')][_0x75b2('0x20')]);}_0x3ffc40[_0x75b2('0x3b')]=qs[_0x75b2('0x3c')](_0xfd15da[_0x75b2('0x35')][_0x75b2('0x3c')]);_0x3ffc40[_0x75b2('0x3d')]=qs[_0x75b2('0x36')](_['pick'](_0xfd15da[_0x75b2('0x35')],_0x40a99c[_0x75b2('0x36')]),_0x5bf4d4);if(_0xfd15da['query'][_0x75b2('0x3e')]){_0x3ffc40[_0x75b2('0x3d')]=_[_0x75b2('0x3f')](_0x3ffc40[_0x75b2('0x3d')],{'$or':_[_0x75b2('0x2f')](_0x5bf4d4,function(_0x3427c4){if(_0x3427c4['type']!==_0x75b2('0x40')){var _0x2083f0={};_0x2083f0[_0x3427c4['name']]={'$like':'%'+_0xfd15da['query'][_0x75b2('0x3e')]+'%'};return _0x2083f0;}})});}_0x3ffc40=_[_0x75b2('0x3f')]({},_0x3ffc40,_0xfd15da[_0x75b2('0x41')]);var _0x2f37c2={'where':_0x3ffc40[_0x75b2('0x3d')]};return db['CmList'][_0x75b2('0x1f')](_0x2f37c2)[_0x75b2('0x27')](function(_0xa300ad){_0x2272df[_0x75b2('0x1f')]=_0xa300ad;if(_0xfd15da['query']['includeAll']){_0x3ffc40['include']=[{'all':!![]}];}return db['CmList'][_0x75b2('0x42')](_0x3ffc40);})[_0x75b2('0x27')](function(_0x361dc3){_0x2272df[_0x75b2('0x43')]=_0x361dc3;return _0x2272df;})[_0x75b2('0x27')](respondWithFilteredResult(_0x16f18f,_0x3ffc40))['catch'](handleError(_0x16f18f,null));};exports[_0x75b2('0x44')]=function(_0x30739f,_0x1e56c9){var _0x15779f={'raw':![],'where':{'id':_0x30739f[_0x75b2('0x45')]['id']}},_0x1a3353={};_0x1a3353[_0x75b2('0x34')]=_[_0x75b2('0x46')](db[_0x75b2('0x30')][_0x75b2('0x31')]);_0x1a3353[_0x75b2('0x35')]=_[_0x75b2('0x46')](_0x30739f[_0x75b2('0x35')]);_0x1a3353[_0x75b2('0x36')]=_[_0x75b2('0x37')](_0x1a3353[_0x75b2('0x34')],_0x1a3353[_0x75b2('0x35')]);_0x15779f[_0x75b2('0x38')]=_[_0x75b2('0x37')](_0x1a3353[_0x75b2('0x34')],qs[_0x75b2('0x47')](_0x30739f[_0x75b2('0x35')][_0x75b2('0x47')]));_0x15779f[_0x75b2('0x38')]=_0x15779f[_0x75b2('0x38')][_0x75b2('0x39')]?_0x15779f[_0x75b2('0x38')]:_0x1a3353[_0x75b2('0x34')];if(_0x30739f[_0x75b2('0x35')]['includeAll']){_0x15779f[_0x75b2('0x48')]=[{'all':!![]}];}_0x15779f=_[_0x75b2('0x3f')]({},_0x15779f,_0x30739f[_0x75b2('0x41')]);return db[_0x75b2('0x30')][_0x75b2('0x49')](_0x15779f)[_0x75b2('0x27')](handleEntityNotFound(_0x1e56c9,null))[_0x75b2('0x27')](respondWithResult(_0x1e56c9,null))['catch'](handleError(_0x1e56c9,null));};exports[_0x75b2('0x4a')]=function(_0xdb29b1,_0x46be48){return db[_0x75b2('0x30')]['create'](_0xdb29b1[_0x75b2('0x4b')],{})[_0x75b2('0x27')](function(_0x42f7e9){var _0x2885f7=_0xdb29b1['user']['get']({'plain':!![]});if(!_0x2885f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2885f7['role']===_0x75b2('0x4c')){var _0x3bd736=_0x42f7e9[_0x75b2('0x4d')]({'plain':!![]});var _0x50520b=_0x75b2('0x29');return db[_0x75b2('0x4e')][_0x75b2('0x49')]({'where':{'name':_0x50520b,'userProfileId':_0x2885f7[_0x75b2('0x4f')]},'raw':!![]})[_0x75b2('0x27')](function(_0x26147c){if(_0x26147c&&_0x26147c[_0x75b2('0x50')]===0x0){return db[_0x75b2('0x2a')][_0x75b2('0x4a')]({'name':_0x3bd736[_0x75b2('0x2c')],'resourceId':_0x3bd736['id'],'type':_0x26147c[_0x75b2('0x2c')],'sectionId':_0x26147c['id']},{})[_0x75b2('0x27')](function(){return _0x42f7e9;});}else{return _0x42f7e9;}})[_0x75b2('0x51')](function(_0x449295){logger[_0x75b2('0x2b')](_0x75b2('0x52'),_0x449295);throw _0x449295;});}return _0x42f7e9;})[_0x75b2('0x27')](respondWithResult(_0x46be48,0xc9))['catch'](handleError(_0x46be48,null));};exports[_0x75b2('0x26')]=function(_0x1ad134,_0x5ddda3){if(_0x1ad134['body']['id']){delete _0x1ad134[_0x75b2('0x4b')]['id'];}return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x1ad134[_0x75b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ddda3,null))[_0x75b2('0x27')](saveUpdates(_0x1ad134['body'],null))[_0x75b2('0x27')](respondWithResult(_0x5ddda3,null))['catch'](handleError(_0x5ddda3,null));};exports[_0x75b2('0x28')]=function(_0x23a7fc,_0x263a03){return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x23a7fc[_0x75b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x263a03,null))[_0x75b2('0x27')](removeEntity(_0x263a03,null))[_0x75b2('0x51')](handleError(_0x263a03,null));};exports['describe']=function(_0x3f86ce,_0x287a5f){return db['CmList'][_0x75b2('0x53')]()[_0x75b2('0x27')](respondWithResult(_0x287a5f,null))[_0x75b2('0x51')](handleError(_0x287a5f,null));};exports['addDisposition']=function(_0x5357c3,_0x185e19,_0x32f1c8){if(_0x5357c3[_0x75b2('0x4b')]['id']){delete _0x5357c3[_0x75b2('0x4b')]['id'];}return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x5357c3['params']['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x185e19,null))[_0x75b2('0x27')](function(_0x21e27){if(_0x21e27){_0x5357c3[_0x75b2('0x4b')][_0x75b2('0x54')]=_0x21e27['id'];return db['Disposition'][_0x75b2('0x4a')](_0x5357c3[_0x75b2('0x4b')]);}})['then'](respondWithResult(_0x185e19,null))[_0x75b2('0x51')](handleError(_0x185e19,null));};exports[_0x75b2('0x55')]=function(_0x224639,_0x9c7b10,_0x7009da){var _0x350916={'raw':![],'where':{}};var _0x2c5186={};var _0x211747={'count':0x0,'rows':[]};return db[_0x75b2('0x30')][_0x75b2('0x56')]({'where':{'id':_0x224639['params']['id']}})['then'](handleEntityNotFound(_0x9c7b10,null))[_0x75b2('0x27')](function(_0x33de89){if(_0x33de89){_0x2c5186[_0x75b2('0x34')]=_[_0x75b2('0x46')](db[_0x75b2('0x57')][_0x75b2('0x31')]);_0x2c5186[_0x75b2('0x35')]=_[_0x75b2('0x46')](_0x224639[_0x75b2('0x35')]);_0x2c5186[_0x75b2('0x36')]=_[_0x75b2('0x37')](_0x2c5186['model'],_0x2c5186[_0x75b2('0x35')]);_0x350916[_0x75b2('0x38')]=_[_0x75b2('0x37')](_0x2c5186['model'],qs[_0x75b2('0x47')](_0x224639[_0x75b2('0x35')][_0x75b2('0x47')]));_0x350916[_0x75b2('0x38')]=_0x350916[_0x75b2('0x38')][_0x75b2('0x39')]?_0x350916[_0x75b2('0x38')]:_0x2c5186[_0x75b2('0x34')];if(!_0x224639[_0x75b2('0x35')][_0x75b2('0x58')]('nolimit')){_0x350916[_0x75b2('0x21')]=qs[_0x75b2('0x21')](_0x224639[_0x75b2('0x35')][_0x75b2('0x21')]);_0x350916[_0x75b2('0x20')]=qs[_0x75b2('0x20')](_0x224639[_0x75b2('0x35')][_0x75b2('0x20')]);}_0x350916[_0x75b2('0x3b')]=qs[_0x75b2('0x3c')](_0x224639[_0x75b2('0x35')][_0x75b2('0x3c')]);_0x350916[_0x75b2('0x3d')]=qs[_0x75b2('0x36')](_[_0x75b2('0x59')](_0x224639['query'],_0x2c5186[_0x75b2('0x36')]));_0x350916[_0x75b2('0x3d')]['ListId']=_0x33de89['id'];if(_0x224639[_0x75b2('0x35')][_0x75b2('0x3e')]){_0x350916[_0x75b2('0x3d')]=_['merge'](_0x350916['where'],{'$or':_['map'](_0x350916[_0x75b2('0x38')],function(_0x3ee4ec){var _0x1cb36e={};_0x1cb36e[_0x3ee4ec]={'$like':'%'+_0x224639[_0x75b2('0x35')][_0x75b2('0x3e')]+'%'};return _0x1cb36e;})});}_0x350916=_[_0x75b2('0x3f')]({},_0x350916,_0x224639[_0x75b2('0x41')]);return db[_0x75b2('0x57')]['count']({'where':_0x350916[_0x75b2('0x3d')]})[_0x75b2('0x27')](function(_0x3fd462){_0x211747[_0x75b2('0x1f')]=_0x3fd462;if(_0x224639[_0x75b2('0x35')][_0x75b2('0x5a')]){_0x350916[_0x75b2('0x48')]=[{'all':!![]}];}return db[_0x75b2('0x57')]['findAll'](_0x350916);})[_0x75b2('0x27')](function(_0x14b824){_0x211747[_0x75b2('0x43')]=_0x14b824;return _0x211747;});}})[_0x75b2('0x27')](respondWithFilteredResult(_0x9c7b10,_0x350916))[_0x75b2('0x51')](handleError(_0x9c7b10,null));};exports['removeDispositions']=function(_0x1ebb32,_0x849210,_0x57473d){return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x1ebb32[_0x75b2('0x45')]['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x849210,null))[_0x75b2('0x27')](function(_0x5d7374){if(_0x5d7374){return _0x5d7374[_0x75b2('0x5b')](_0x1ebb32[_0x75b2('0x35')]['ids']);}})[_0x75b2('0x27')](respondWithStatusCode(_0x849210,null))[_0x75b2('0x51')](handleError(_0x849210,null));};exports[_0x75b2('0x5c')]=function(_0x5a8099,_0x541572,_0x3a9cf7){return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x5a8099[_0x75b2('0x45')]['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x541572,null))[_0x75b2('0x27')](function(_0x333cd7){if(_0x333cd7){var _0x54db0a=[];var _0x1bf6e1={'success':[],'errors':[]};return db['CmContact'][_0x75b2('0x53')]()[_0x75b2('0x27')](function(_0x181682){if(_0x5a8099['body']['tags']&&_[_0x75b2('0x5d')](_0x5a8099[_0x75b2('0x4b')][_0x75b2('0x5e')])){if(_0x5a8099[_0x75b2('0x4b')][_0x75b2('0x5e')]['length']){_0x5a8099[_0x75b2('0x4b')]['tags']=_0x5a8099[_0x75b2('0x4b')][_0x75b2('0x5e')]['join'](';')+';';}else{_0x5a8099[_0x75b2('0x4b')][_0x75b2('0x5e')]=null;}}else{_0x5a8099['body'][_0x75b2('0x5e')]=null;}if(_0x5a8099[_0x75b2('0x4b')]&&_[_0x75b2('0x5d')](_0x5a8099[_0x75b2('0x4b')])){for(var _0x463818=0x0;_0x463818<_0x5a8099[_0x75b2('0x4b')][_0x75b2('0x39')];_0x463818+=0x1){_0x5a8099['body'][_0x463818][_0x75b2('0x54')]=_0x5a8099[_0x75b2('0x45')]['id'];_0x54db0a[_0x75b2('0x5f')](_0x5a8099['body'][_0x463818]);}return BPromise[_0x75b2('0x60')](_0x54db0a,function(_0x358555){return db[_0x75b2('0x61')][_0x75b2('0x4a')](_[_0x75b2('0x62')](_0x358555,[_0x75b2('0x63'),'id'])||{},{'fields':_['keys'](_0x181682),'raw':!![]})[_0x75b2('0x27')](function(_0x552041){_0x1bf6e1[_0x75b2('0x64')][_0x75b2('0x5f')](_0x552041['dataValues']);})[_0x75b2('0x51')](function(_0x296e26){_0x1bf6e1['errors'][_0x75b2('0x5f')]({'data':_0x358555,'error':_0x296e26['message']});});})['then'](function(_0x25d1b6){return _0x1bf6e1;})[_0x75b2('0x51')](function(_0x4ff831){return _0x4ff831;});}else{_0x541572[_0x75b2('0x1c')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x75b2('0x27')](respondWithResult(_0x541572,null))[_0x75b2('0x51')](handleError(_0x541572,null));};exports[_0x75b2('0x65')]=function(_0x1bde63,_0x3185cc,_0x4a9dfb){var _0x277ca2;return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x1bde63[_0x75b2('0x45')]['id']},'include':[{'model':db[_0x75b2('0x66')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x3185cc,null))[_0x75b2('0x27')](function(_0x2b297e){if(_0x2b297e){_0x277ca2=_0x2b297e;return db['CmContact'][_0x75b2('0x31')];}})['then'](function(_0xa2e848){if(_0xa2e848){var _0xf3d7af={};var _0x142c7a={};_0x142c7a[_0x75b2('0x34')]=_[_0x75b2('0x67')](_[_0x75b2('0x46')](_0xa2e848),_[_0x75b2('0x2f')](_0x277ca2[_0x75b2('0x68')],function(_0x7b6ffa){return util[_0x75b2('0x69')](_0x75b2('0x6a'),_0x7b6ffa['id']);}));_0x142c7a[_0x75b2('0x35')]=_[_0x75b2('0x46')](_0x1bde63['query']);_0x142c7a[_0x75b2('0x36')]=_[_0x75b2('0x37')](_0x142c7a['model'],_0x142c7a[_0x75b2('0x35')]);_0xf3d7af[_0x75b2('0x38')]=_['intersection'](_0x142c7a[_0x75b2('0x34')],qs['fields'](_0x1bde63['query']['fields']));_0xf3d7af[_0x75b2('0x38')]=_0xf3d7af[_0x75b2('0x38')][_0x75b2('0x39')]?_0xf3d7af[_0x75b2('0x38')]:_0x142c7a['model'];if(!_0x1bde63[_0x75b2('0x35')][_0x75b2('0x58')](_0x75b2('0x3a'))){_0xf3d7af['limit']=qs[_0x75b2('0x21')](_0x1bde63[_0x75b2('0x35')][_0x75b2('0x21')]);_0xf3d7af[_0x75b2('0x20')]=qs[_0x75b2('0x20')](_0x1bde63[_0x75b2('0x35')][_0x75b2('0x20')]);}_0xf3d7af[_0x75b2('0x3b')]=qs[_0x75b2('0x3c')](_0x1bde63[_0x75b2('0x35')]['sort']);_0xf3d7af[_0x75b2('0x3d')]=qs[_0x75b2('0x36')](_['pick'](_0x1bde63[_0x75b2('0x35')],_0x142c7a[_0x75b2('0x36')]));_0xf3d7af[_0x75b2('0x6b')]=!![];if(_0x1bde63[_0x75b2('0x35')][_0x75b2('0x3e')]){_0xf3d7af[_0x75b2('0x3d')]=_['merge'](_0xf3d7af[_0x75b2('0x3d')],{'$or':_['map'](_0xf3d7af[_0x75b2('0x38')],function(_0x9ee053){var _0x31202c={};_0x31202c[_0x9ee053]={'$like':'%'+_0x1bde63[_0x75b2('0x35')][_0x75b2('0x3e')]+'%'};return _0x31202c;})});}_0xf3d7af=_[_0x75b2('0x3f')]({},_0xf3d7af,_0x1bde63[_0x75b2('0x41')]);return _0x277ca2[_0x75b2('0x65')](_0xf3d7af);}})['then'](respondWithResult(_0x3185cc,null))[_0x75b2('0x51')](handleError(_0x3185cc,null));};exports[_0x75b2('0x6c')]=function(_0x4304e1,_0x3cd40c,_0x3f3390){var _0x167d5e;return db[_0x75b2('0x30')][_0x75b2('0x49')]({'where':{'id':_0x4304e1[_0x75b2('0x45')]['id']},'include':[{'model':db[_0x75b2('0x66')],'as':'CustomFields'}]})[_0x75b2('0x27')](handleEntityNotFound(_0x3cd40c,null))['then'](function(_0x1fb8cf){if(_0x1fb8cf){_0x167d5e=_0x1fb8cf;return db['CmContact'][_0x75b2('0x31')];}})[_0x75b2('0x27')](function(_0x381a29){if(_0x381a29){var _0x3c169a={};var _0x31b4bf={};_0x31b4bf[_0x75b2('0x34')]=_[_0x75b2('0x67')](_['keys'](_0x381a29),_['map'](_0x167d5e['CustomFields'],function(_0x473246){return util[_0x75b2('0x69')](_0x75b2('0x6a'),_0x473246['id']);}));_0x31b4bf[_0x75b2('0x35')]=_['keys'](_0x4304e1[_0x75b2('0x35')]);_0x31b4bf[_0x75b2('0x36')]=_['intersection'](_0x31b4bf[_0x75b2('0x34')],_0x31b4bf[_0x75b2('0x35')]);_0x3c169a['attributes']=_['intersection'](_0x31b4bf[_0x75b2('0x34')],qs[_0x75b2('0x47')](_0x4304e1['query']['fields']));_0x3c169a[_0x75b2('0x38')]=_0x3c169a[_0x75b2('0x38')]['length']?_0x3c169a[_0x75b2('0x38')]:_0x31b4bf[_0x75b2('0x34')];if(!_0x4304e1[_0x75b2('0x35')][_0x75b2('0x58')](_0x75b2('0x3a'))){_0x3c169a[_0x75b2('0x21')]=qs['limit'](_0x4304e1['query'][_0x75b2('0x21')]);_0x3c169a[_0x75b2('0x20')]=qs[_0x75b2('0x20')](_0x4304e1[_0x75b2('0x35')][_0x75b2('0x20')]);}_0x3c169a[_0x75b2('0x3b')]=qs[_0x75b2('0x3c')](_0x4304e1[_0x75b2('0x35')][_0x75b2('0x3c')]);_0x3c169a[_0x75b2('0x3d')]=qs[_0x75b2('0x36')](_['pick'](_0x4304e1[_0x75b2('0x35')],_0x31b4bf[_0x75b2('0x36')]));_0x3c169a[_0x75b2('0x6b')]=!![];if(_0x4304e1[_0x75b2('0x35')][_0x75b2('0x3e')]){_0x3c169a[_0x75b2('0x3d')]=_[_0x75b2('0x3f')](_0x3c169a[_0x75b2('0x3d')],{'$or':_[_0x75b2('0x2f')](_0x3c169a[_0x75b2('0x38')],function(_0x3122e9){var _0x351b8c={};_0x351b8c[_0x3122e9]={'$like':'%'+_0x4304e1[_0x75b2('0x35')][_0x75b2('0x3e')]+'%'};return _0x351b8c;})});}_0x3c169a=_[_0x75b2('0x3f')]({},_0x3c169a,_0x4304e1[_0x75b2('0x41')]);return _0x167d5e[_0x75b2('0x65')](_0x3c169a);}})[_0x75b2('0x27')](function(_0x92b512){if(!_['isEmpty'](_0x92b512)){var _0x2db169=toCsv(_0x92b512);var _0x134597=Date['now']();fs[_0x75b2('0x6d')](util['format']('/tmp/list_%d_%s.csv',_0x167d5e['id'],_0x134597),_0x2db169);_0x3cd40c[_0x75b2('0x6e')]('Content-disposition',_0x75b2('0x6f')+util[_0x75b2('0x69')](_0x75b2('0x70'),_0x167d5e['id'],_0x134597));_0x3cd40c['setHeader']('Content-type',_0x75b2('0x71'));return _0x3cd40c[_0x75b2('0x72')](util[_0x75b2('0x69')](_0x75b2('0x73'),_0x167d5e['id'],_0x134597));}else{return _0x3cd40c[_0x75b2('0x1b')](0xcc);}})[_0x75b2('0x51')](handleError(_0x3cd40c,null));};exports['addCustomField']=function(_0x837a60,_0x3a2c73,_0x2cf757){var _0x32ea11;delete _0x837a60[_0x75b2('0x4b')]['id'];return db[_0x75b2('0x30')]['findOne']({'where':{'id':_0x837a60[_0x75b2('0x45')]['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x3a2c73,null))[_0x75b2('0x27')](function(_0x1e7a55){if(_0x1e7a55){return db[_0x75b2('0x74')][_0x75b2('0x75')](function(_0x48fd87){return db[_0x75b2('0x66')][_0x75b2('0x4a')](_0x837a60[_0x75b2('0x4b')],{'transaction':_0x48fd87})[_0x75b2('0x27')](function(_0x3c7779){_0x32ea11=_0x3c7779;return _0x1e7a55[_0x75b2('0x76')](_0x3c7779,{'transaction':_0x48fd87});})[_0x75b2('0x27')](function(){var _0x31bfef={'type':db[_0x75b2('0x77')][_0x75b2('0x78')],'transaction':_0x48fd87};switch(_0x837a60[_0x75b2('0x4b')][_0x75b2('0x79')]){case _0x75b2('0x7a'):_0x31bfef[_0x75b2('0x79')]=db['Sequelize']['TEXT'];break;case _0x75b2('0x7b'):_0x31bfef[_0x75b2('0x79')]=db[_0x75b2('0x77')][_0x75b2('0x7c')];break;case _0x75b2('0x7d'):_0x31bfef[_0x75b2('0x79')]=db[_0x75b2('0x77')][_0x75b2('0x7e')];_0x31bfef[_0x75b2('0x7f')]=![];break;default:}return db[_0x75b2('0x74')]['queryInterface'][_0x75b2('0x80')](_0x75b2('0x81'),util['format'](_0x75b2('0x82'),_0x32ea11['id']),_0x31bfef);})[_0x75b2('0x27')](function(){return _0x32ea11;});});}})[_0x75b2('0x27')](respondWithResult(_0x3a2c73,null))[_0x75b2('0x51')](handleError(_0x3a2c73,null));};exports[_0x75b2('0x83')]=function(_0xc7d549,_0x4cf16e,_0x2d63ec){var _0x331459={};var _0x550809={};var _0x285972;var _0x58f3c9;return db[_0x75b2('0x30')][_0x75b2('0x56')]({'where':{'id':_0xc7d549[_0x75b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cf16e,null))[_0x75b2('0x27')](function(_0x1db75f){if(_0x1db75f){_0x285972=_0x1db75f;_0x550809[_0x75b2('0x34')]=_['keys'](db[_0x75b2('0x66')]['rawAttributes']);_0x550809[_0x75b2('0x35')]=_[_0x75b2('0x46')](_0xc7d549[_0x75b2('0x35')]);_0x550809[_0x75b2('0x36')]=_['intersection'](_0x550809[_0x75b2('0x34')],_0x550809['query']);_0x331459[_0x75b2('0x38')]=_['intersection'](_0x550809[_0x75b2('0x34')],qs['fields'](_0xc7d549[_0x75b2('0x35')]['fields']));_0x331459[_0x75b2('0x38')]=_0x331459['attributes']['length']?_0x331459[_0x75b2('0x38')]:_0x550809[_0x75b2('0x34')];_0x331459[_0x75b2('0x3b')]=qs[_0x75b2('0x3c')](_0xc7d549['query']['sort']);_0x331459['where']=qs[_0x75b2('0x36')](_[_0x75b2('0x59')](_0xc7d549['query'],_0x550809['filters']));_0x331459[_0x75b2('0x3d')]=_['merge'](_0x331459[_0x75b2('0x3d')],{'$or':[{'ListId':_0x1db75f['id']},{'ListId':null}]});if(_0xc7d549['query']['filter']){_0x331459[_0x75b2('0x3d')]=_['merge'](_0x331459[_0x75b2('0x3d')],{'$or':_[_0x75b2('0x2f')](_0x331459[_0x75b2('0x38')],function(_0x45122f){var _0x4e33ee={};_0x4e33ee[_0x45122f]={'$like':'%'+_0xc7d549[_0x75b2('0x35')][_0x75b2('0x3e')]+'%'};return _0x4e33ee;})});}_0x331459=_['merge']({},_0x331459,_0xc7d549['options']);return db['CmCustomField'][_0x75b2('0x84')](_0x331459);}})[_0x75b2('0x27')](respondWithResult(_0x4cf16e,null))[_0x75b2('0x51')](handleError(_0x4cf16e,null));};exports[_0x75b2('0x85')]=function(_0xbca901,_0x26270f,_0xf9a53a){return db[_0x75b2('0x30')]['find']({'where':{'id':_0xbca901['params']['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x26270f,null))[_0x75b2('0x27')](function(_0x21263e){if(_0x21263e){return _0x21263e['addAgents'](_0xbca901[_0x75b2('0x4b')][_0x75b2('0x63')],_['omit'](_0xbca901[_0x75b2('0x4b')],[_0x75b2('0x63'),'id'])||{})[_0x75b2('0x86')](function(_0x199799){for(var _0xed6db7=0x0;_0xed6db7<_0xbca901[_0x75b2('0x4b')][_0x75b2('0x63')][_0x75b2('0x39')];_0xed6db7+=0x1){socket[_0x75b2('0x87')](_0x75b2('0x88'),{'UserId':_0xbca901['body'][_0x75b2('0x63')][_0xed6db7],'CmListId':_0xbca901[_0x75b2('0x45')]['id']});}return _0x199799;});}})[_0x75b2('0x27')](respondWithResult(_0x26270f,null))[_0x75b2('0x51')](handleError(_0x26270f,null));};exports['removeAgents']=function(_0x3af114,_0x44918a,_0xfbb643){return db[_0x75b2('0x30')]['find']({'where':{'id':_0x3af114[_0x75b2('0x45')]['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x44918a,null))[_0x75b2('0x27')](function(_0x3e0410){if(_0x3e0410){return _0x3e0410[_0x75b2('0x89')](_0x3af114[_0x75b2('0x35')][_0x75b2('0x63')])['then'](function(){if(_[_0x75b2('0x5d')](_0x3af114[_0x75b2('0x35')][_0x75b2('0x63')])){for(var _0x5e87ad=0x0;_0x5e87ad<_0x3af114[_0x75b2('0x35')][_0x75b2('0x63')][_0x75b2('0x39')];_0x5e87ad+=0x1){socket[_0x75b2('0x87')](_0x75b2('0x8a'),{'UserId':Number(_0x3af114[_0x75b2('0x35')][_0x75b2('0x63')][_0x5e87ad]),'CmListId':Number(_0x3af114[_0x75b2('0x45')]['id'])});}}else{socket['emit'](_0x75b2('0x8a'),{'UserId':Number(_0x3af114[_0x75b2('0x35')][_0x75b2('0x63')]),'CmListId':Number(_0x3af114[_0x75b2('0x45')]['id'])});}});}})[_0x75b2('0x27')](respondWithStatusCode(_0x44918a,null))[_0x75b2('0x51')](handleError(_0x44918a,null));};exports['getAgents']=function(_0x29bf68,_0x1b6607,_0x159ced){var _0xe4bd61={};var _0x1555be={};var _0x5e4ff1;var _0x57bd2d;return db['CmList']['findOne']({'where':{'id':_0x29bf68[_0x75b2('0x45')]['id']}})[_0x75b2('0x27')](handleEntityNotFound(_0x1b6607,null))['then'](function(_0x412ed3){if(_0x412ed3){_0x5e4ff1=_0x412ed3;_0x1555be[_0x75b2('0x34')]=_['keys'](db[_0x75b2('0x8b')][_0x75b2('0x31')]);_0x1555be[_0x75b2('0x35')]=_[_0x75b2('0x46')](_0x29bf68[_0x75b2('0x35')]);_0x1555be[_0x75b2('0x36')]=_[_0x75b2('0x37')](_0x1555be[_0x75b2('0x34')],_0x1555be[_0x75b2('0x35')]);_0xe4bd61[_0x75b2('0x38')]=_['intersection'](_0x1555be[_0x75b2('0x34')],qs[_0x75b2('0x47')](_0x29bf68[_0x75b2('0x35')][_0x75b2('0x47')]));_0xe4bd61[_0x75b2('0x38')]=_0xe4bd61['attributes'][_0x75b2('0x39')]?_0xe4bd61[_0x75b2('0x38')]:_0x1555be['model'];_0xe4bd61['order']=qs[_0x75b2('0x3c')](_0x29bf68[_0x75b2('0x35')][_0x75b2('0x3c')]);_0xe4bd61[_0x75b2('0x3d')]=qs[_0x75b2('0x36')](_[_0x75b2('0x59')](_0x29bf68[_0x75b2('0x35')],_0x1555be[_0x75b2('0x36')]));if(_0x29bf68[_0x75b2('0x35')][_0x75b2('0x3e')]){_0xe4bd61[_0x75b2('0x3d')]=_[_0x75b2('0x3f')](_0xe4bd61[_0x75b2('0x3d')],{'$or':_[_0x75b2('0x2f')](_0xe4bd61[_0x75b2('0x38')],function(_0x18963a){var _0x4b6dcb={};_0x4b6dcb[_0x18963a]={'$like':'%'+_0x29bf68[_0x75b2('0x35')][_0x75b2('0x3e')]+'%'};return _0x4b6dcb;})});}_0xe4bd61=_['merge']({},_0xe4bd61,_0x29bf68[_0x75b2('0x41')]);return _0x5e4ff1[_0x75b2('0x8c')](_0xe4bd61);}})['then'](function(_0x1bd59f){if(_0x1bd59f){_0x57bd2d=_0x1bd59f[_0x75b2('0x39')];if(!_0x29bf68['query'][_0x75b2('0x58')](_0x75b2('0x3a'))){_0xe4bd61[_0x75b2('0x21')]=qs[_0x75b2('0x21')](_0x29bf68[_0x75b2('0x35')][_0x75b2('0x21')]);_0xe4bd61[_0x75b2('0x20')]=qs[_0x75b2('0x20')](_0x29bf68['query'][_0x75b2('0x20')]);}return _0x5e4ff1['getAgents'](_0xe4bd61);}})[_0x75b2('0x27')](function(_0x45c318){if(_0x45c318){return _0x45c318?{'count':_0x57bd2d,'rows':_0x45c318}:null;}})[_0x75b2('0x27')](respondWithResult(_0x1b6607,null))['catch'](handleError(_0x1b6607,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index a7be154..800e80c 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 _0xcb26=['setMaxListeners','remove','emit','hook','exports','../../mysqldb'];(function(_0x5a60b4,_0x31ef03){var _0x152d54=function(_0xbba35b){while(--_0xbba35b){_0x5a60b4['push'](_0x5a60b4['shift']());}};_0x152d54(++_0x31ef03);}(_0xcb26,0x83));var _0x6cb2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb26[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var CmList=require(_0x6cb2('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x6cb2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6cb2('0x2')};function emitEvent(_0x475fb3){return function(_0x496eaf,_0x399220,_0x32a5bd){CmListEvents[_0x6cb2('0x3')](_0x475fb3+':'+_0x496eaf['id'],_0x496eaf);CmListEvents[_0x6cb2('0x3')](_0x475fb3,_0x496eaf);_0x32a5bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x6cb2('0x4')](e,emitEvent(event));}}module[_0x6cb2('0x5')]=CmListEvents; \ No newline at end of file +var _0x6d5e=['update','remove','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x220a4b,_0x6c372b){var _0x3169d6=function(_0x1bdb0c){while(--_0x1bdb0c){_0x220a4b['push'](_0x220a4b['shift']());}};_0x3169d6(++_0x6c372b);}(_0x6d5e,0x181));var _0xe6d5=function(_0x2b06bd,_0x113bf8){_0x2b06bd=_0x2b06bd-0x0;var _0x17c946=_0x6d5e[_0x2b06bd];return _0x17c946;};'use strict';var EventEmitter=require(_0xe6d5('0x0'));var CmList=require(_0xe6d5('0x1'))['db'][_0xe6d5('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xe6d5('0x3')](0x0);var events={'afterCreate':_0xe6d5('0x4'),'afterUpdate':_0xe6d5('0x5'),'afterDestroy':_0xe6d5('0x6')};function emitEvent(_0xec0450){return function(_0x168bc4,_0x382508,_0x2e1520){CmListEvents['emit'](_0xec0450+':'+_0x168bc4['id'],_0x168bc4);CmListEvents[_0xe6d5('0x7')](_0xec0450,_0x168bc4);_0x2e1520(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xe6d5('0x8')](e,emitEvent(event));}}module[_0xe6d5('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index bb089d8..8b442e0 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 _0x2afa=['request-promise','rimraf','../../config/environment','./cmList.attributes','cm_lists','lodash','../../config/logger','api','bluebird'];(function(_0x529ffe,_0x52d358){var _0x239f6f=function(_0x3402a8){while(--_0x3402a8){_0x529ffe['push'](_0x529ffe['shift']());}};_0x239f6f(++_0x52d358);}(_0x2afa,0x11c));var _0xa2af=function(_0x30cc4c,_0x390707){_0x30cc4c=_0x30cc4c-0x0;var _0x376927=_0x2afa[_0x30cc4c];return _0x376927;};'use strict';var _=require(_0xa2af('0x0'));var util=require('util');var logger=require(_0xa2af('0x1'))(_0xa2af('0x2'));var moment=require('moment');var BPromise=require(_0xa2af('0x3'));var rp=require(_0xa2af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2af('0x5'));var config=require(_0xa2af('0x6'));var attributes=require(_0xa2af('0x7'));module['exports']=function(_0x4dbf17,_0x3c98ed){return _0x4dbf17['define']('CmList',attributes,{'tableName':_0xa2af('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9115=['path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fa2e3,_0x2b920c){var _0x5d1d52=function(_0x545d14){while(--_0x545d14){_0x1fa2e3['push'](_0x1fa2e3['shift']());}};_0x5d1d52(++_0x2b920c);}(_0x9115,0x13e));var _0x5911=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9115[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5911('0x0'));var util=require(_0x5911('0x1'));var logger=require(_0x5911('0x2'))(_0x5911('0x3'));var moment=require(_0x5911('0x4'));var BPromise=require(_0x5911('0x5'));var rp=require(_0x5911('0x6'));var fs=require('fs');var path=require(_0x5911('0x7'));var rimraf=require(_0x5911('0x8'));var config=require(_0x5911('0x9'));var attributes=require(_0x5911('0xa'));module['exports']=function(_0x2e9298,_0x3eb108){return _0x2e9298['define'](_0x5911('0xb'),attributes,{'tableName':_0x5911('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index bf49b66..c046b2c 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 _0x5064=['then','CmList,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x45df01,_0x2ca3eb){var _0x2b93cc=function(_0xc104da){while(--_0xc104da){_0x45df01['push'](_0x45df01['shift']());}};_0x2b93cc(++_0x2ca3eb);}(_0x5064,0xbe));var _0x4506=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5064[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4506('0x0'));var util=require(_0x4506('0x1'));var moment=require(_0x4506('0x2'));var BPromise=require(_0x4506('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4506('0x4'));var db=require(_0x4506('0x5'))['db'];var utils=require(_0x4506('0x6'));var logger=require(_0x4506('0x7'))(_0x4506('0x8'));var config=require(_0x4506('0x9'));var jayson=require(_0x4506('0xa'));var client=jayson[_0x4506('0xb')][_0x4506('0xc')]({'port':0x232a});config[_0x4506('0xd')]=_['defaults'](config[_0x4506('0xd')],{'host':_0x4506('0xe'),'port':0x18eb});var socket=require(_0x4506('0xf'))(new Redis(config[_0x4506('0xd')]));require('./cmList.socket')[_0x4506('0x10')](socket);function respondWithRpcPromise(_0x257c48,_0x46fb5c,_0x16dc43){return new BPromise(function(_0x40ec48,_0x53c293){return client[_0x4506('0x11')](_0x257c48,_0x16dc43)[_0x4506('0x12')](function(_0x1b3fd9){logger['info'](_0x4506('0x13'),_0x46fb5c,'request\x20sent');logger[_0x4506('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x46fb5c,_0x4506('0x15'),JSON['stringify'](_0x1b3fd9));if(_0x1b3fd9[_0x4506('0x16')]){if(_0x1b3fd9['error'][_0x4506('0x17')]===0x1f4){logger[_0x4506('0x16')](_0x4506('0x13'),_0x46fb5c,_0x1b3fd9[_0x4506('0x16')][_0x4506('0x18')]);return _0x53c293(_0x1b3fd9[_0x4506('0x16')][_0x4506('0x18')]);}logger[_0x4506('0x16')](_0x4506('0x13'),_0x46fb5c,_0x1b3fd9['error']['message']);return _0x40ec48(_0x1b3fd9[_0x4506('0x16')]['message']);}else{logger[_0x4506('0x19')]('CmList,\x20%s,\x20%s',_0x46fb5c,_0x4506('0x15'));_0x40ec48(_0x1b3fd9['result'][_0x4506('0x18')]);}})['catch'](function(_0x4c52b3){logger[_0x4506('0x16')](_0x4506('0x13'),_0x46fb5c,_0x4c52b3);_0x53c293(_0x4c52b3);});});} \ No newline at end of file +var _0xc6ea=['lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x32deca,_0x212591){var _0x5af2a7=function(_0x1ca58b){while(--_0x1ca58b){_0x32deca['push'](_0x32deca['shift']());}};_0x5af2a7(++_0x212591);}(_0xc6ea,0xc0));var _0xac6e=function(_0x312f73,_0x4e49e7){_0x312f73=_0x312f73-0x0;var _0x43d00d=_0xc6ea[_0x312f73];return _0x43d00d;};'use strict';var _=require(_0xac6e('0x0'));var util=require(_0xac6e('0x1'));var moment=require(_0xac6e('0x2'));var BPromise=require('bluebird');var rs=require(_0xac6e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac6e('0x4'))(_0xac6e('0x5'));var config=require(_0xac6e('0x6'));var jayson=require(_0xac6e('0x7'));var client=jayson['client'][_0xac6e('0x8')]({'port':0x232a});config[_0xac6e('0x9')]=_[_0xac6e('0xa')](config[_0xac6e('0x9')],{'host':_0xac6e('0xb'),'port':0x18eb});var socket=require(_0xac6e('0xc'))(new Redis(config[_0xac6e('0x9')]));require('./cmList.socket')[_0xac6e('0xd')](socket);function respondWithRpcPromise(_0x10bbc1,_0xb9b8d,_0x4c97e9){return new BPromise(function(_0x371011,_0x5e9099){return client[_0xac6e('0xe')](_0x10bbc1,_0x4c97e9)['then'](function(_0x24eeef){logger[_0xac6e('0xf')](_0xac6e('0x10'),_0xb9b8d,_0xac6e('0x11'));logger['debug'](_0xac6e('0x12'),_0xb9b8d,'request\x20sent',JSON[_0xac6e('0x13')](_0x24eeef));if(_0x24eeef[_0xac6e('0x14')]){if(_0x24eeef['error']['code']===0x1f4){logger[_0xac6e('0x14')]('CmList,\x20%s,\x20%s',_0xb9b8d,_0x24eeef['error'][_0xac6e('0x15')]);return _0x5e9099(_0x24eeef[_0xac6e('0x14')][_0xac6e('0x15')]);}logger[_0xac6e('0x14')]('CmList,\x20%s,\x20%s',_0xb9b8d,_0x24eeef[_0xac6e('0x14')][_0xac6e('0x15')]);return _0x371011(_0x24eeef['error']['message']);}else{logger[_0xac6e('0xf')](_0xac6e('0x10'),_0xb9b8d,'request\x20sent');_0x371011(_0x24eeef[_0xac6e('0x16')][_0xac6e('0x15')]);}})[_0xac6e('0x17')](function(_0x170026){logger['error']('CmList,\x20%s,\x20%s',_0xb9b8d,_0x170026);_0x5e9099(_0x170026);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a2c8643..fc967f5 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 _0x0048=['removeListener','length','cmList:','save','remove','emit'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x0048,0x129));var _0x8004=function(_0x46066f,_0x23105c){_0x46066f=_0x46066f-0x0;var _0x411977=_0x0048[_0x46066f];return _0x411977;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x8004('0x0'),_0x8004('0x1'),'update'];function createListener(_0x387444,_0x38c924){return function(_0x5ba96a){_0x38c924[_0x8004('0x2')](_0x387444,_0x5ba96a);};}function removeListener(_0x360fff,_0x14cc27){return function(){CmListEvents[_0x8004('0x3')](_0x360fff,_0x14cc27);};}exports['register']=function(_0x532337){for(var _0x3aaed7=0x0,_0x38871a=events[_0x8004('0x4')];_0x3aaed7<_0x38871a;_0x3aaed7++){var _0x59218a=events[_0x3aaed7];var _0x3c7e57=createListener(_0x8004('0x5')+_0x59218a,_0x532337);CmListEvents['on'](_0x59218a,_0x3c7e57);}}; \ No newline at end of file +var _0x2dc3=['cmList:','save','remove','update','emit','register','length'];(function(_0x44be59,_0x1aa72f){var _0x4c9f02=function(_0x2f0462){while(--_0x2f0462){_0x44be59['push'](_0x44be59['shift']());}};_0x4c9f02(++_0x1aa72f);}(_0x2dc3,0x127));var _0x32dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dc3[_0x14add3];return _0x4a174f;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x32dc('0x0'),_0x32dc('0x1'),_0x32dc('0x2')];function createListener(_0x25b524,_0x2f8a4c){return function(_0x597050){_0x2f8a4c[_0x32dc('0x3')](_0x25b524,_0x597050);};}function removeListener(_0x15c3f6,_0x53b74c){return function(){CmListEvents['removeListener'](_0x15c3f6,_0x53b74c);};}exports[_0x32dc('0x4')]=function(_0x58b6ba){for(var _0x1f59d3=0x0,_0x52336b=events[_0x32dc('0x5')];_0x1f59d3<_0x52336b;_0x1f59d3++){var _0x491a56=events[_0x1f59d3];var _0x49c416=createListener(_0x32dc('0x6')+_0x491a56,_0x58b6ba);CmListEvents['on'](_0x491a56,_0x49c416);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 117eb83..7478153 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 _0xbad4=['/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','isAuthenticated','describe','/:id','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post'];(function(_0x16bb15,_0x42a6da){var _0x49f8c5=function(_0x1d7957){while(--_0x1d7957){_0x16bb15['push'](_0x16bb15['shift']());}};_0x49f8c5(++_0x42a6da);}(_0xbad4,0x175));var _0x4bad=function(_0x50fff0,_0x588fa8){_0x50fff0=_0x50fff0-0x0;var _0x2d792f=_0xbad4[_0x50fff0];return _0x2d792f;};'use strict';var multer=require(_0x4bad('0x0'));var util=require(_0x4bad('0x1'));var path=require(_0x4bad('0x2'));var timeout=require(_0x4bad('0x3'));var express=require(_0x4bad('0x4'));var router=express[_0x4bad('0x5')]();var auth=require(_0x4bad('0x6'));var interaction=require(_0x4bad('0x7'));var config=require(_0x4bad('0x8'));var controller=require(_0x4bad('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4bad('0xa')]);router[_0x4bad('0xb')](_0x4bad('0xc'),auth[_0x4bad('0xd')](),controller[_0x4bad('0xe')]);router[_0x4bad('0xb')](_0x4bad('0xf'),auth[_0x4bad('0xd')](),controller['show']);router[_0x4bad('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4bad('0x10')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x4bad('0x11')]);router[_0x4bad('0xb')](_0x4bad('0x12'),auth[_0x4bad('0xd')](),controller[_0x4bad('0x13')]);router[_0x4bad('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4bad('0x14')]);router['get']('/:id/users',auth[_0x4bad('0xd')](),controller[_0x4bad('0x15')]);router[_0x4bad('0x16')]('/',auth[_0x4bad('0xd')](),controller['create']);router[_0x4bad('0x16')](_0x4bad('0x17'),auth[_0x4bad('0xd')](),controller[_0x4bad('0x18')]);router[_0x4bad('0x16')]('/:id/contacts',auth[_0x4bad('0xd')](),controller[_0x4bad('0x19')]);router[_0x4bad('0x16')](_0x4bad('0x1a'),auth[_0x4bad('0xd')](),controller[_0x4bad('0x1b')]);router[_0x4bad('0x16')]('/:id/users',auth[_0x4bad('0xd')](),controller[_0x4bad('0x1c')]);router[_0x4bad('0x1d')]('/:id',auth[_0x4bad('0xd')](),controller[_0x4bad('0x1e')]);router['delete'](_0x4bad('0xf'),auth[_0x4bad('0xd')](),controller[_0x4bad('0x1f')]);router[_0x4bad('0x20')](_0x4bad('0x17'),auth['isAuthenticated'](),controller[_0x4bad('0x21')]);router[_0x4bad('0x20')]('/:id/users',auth[_0x4bad('0xd')](),controller[_0x4bad('0x22')]);module[_0x4bad('0x23')]=router; \ No newline at end of file +var _0xfd16=['removeDispositions','removeAgents','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getCustomFields','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','destroy','delete'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xfd16,0x113));var _0x6fd1=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xfd16[_0x46d0c9];return _0x174506;};'use strict';var multer=require(_0x6fd1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6fd1('0x1'));var router=express[_0x6fd1('0x2')]();var auth=require(_0x6fd1('0x3'));var interaction=require(_0x6fd1('0x4'));var config=require(_0x6fd1('0x5'));var controller=require(_0x6fd1('0x6'));router[_0x6fd1('0x7')]('/',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x9')]);router[_0x6fd1('0x7')](_0x6fd1('0xa'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xb')]);router[_0x6fd1('0x7')](_0x6fd1('0xc'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xd')]);router[_0x6fd1('0x7')](_0x6fd1('0xe'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xf')]);router[_0x6fd1('0x7')](_0x6fd1('0x10'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x11')]);router['get'](_0x6fd1('0x12'),auth[_0x6fd1('0x8')](),controller['getContactsCsv']);router[_0x6fd1('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x6fd1('0x13')]);router[_0x6fd1('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x6fd1('0x14')]);router[_0x6fd1('0x15')]('/',auth['isAuthenticated'](),controller[_0x6fd1('0x16')]);router['post'](_0x6fd1('0xe'),auth['isAuthenticated'](),controller[_0x6fd1('0x17')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x6fd1('0x18')]);router[_0x6fd1('0x15')](_0x6fd1('0x19'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x1a')]);router[_0x6fd1('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x6fd1('0x1b')]);router['put'](_0x6fd1('0xc'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x1c')]);router['delete']('/:id',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x1d')]);router[_0x6fd1('0x1e')]('/:id/dispositions',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x1f')]);router[_0x6fd1('0x1e')]('/:id/users',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x20')]);module[_0x6fd1('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 781a9c9..e027299 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(_0x3582f0,_0x270a70){var _0x444e47=function(_0x10cc4b){while(--_0x10cc4b){_0x3582f0['push'](_0x3582f0['shift']());}};_0x444e47(++_0x270a70);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x40b6d0,_0x2d4025){var _0x12cd16=function(_0x3eeabb){while(--_0x3eeabb){_0x40b6d0['push'](_0x40b6d0['shift']());}};_0x12cd16(++_0x2d4025);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 06078e3..46bd55f 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 _0x9f7c=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','Condition','find','params','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x45b4f9,_0x176dd9){var _0x54024c=function(_0x4d2918){while(--_0x4d2918){_0x45b4f9['push'](_0x45b4f9['shift']());}};_0x54024c(++_0x176dd9);}(_0x9f7c,0x113));var _0xc9f7=function(_0x2ba4c6,_0x71a3d3){_0x2ba4c6=_0x2ba4c6-0x0;var _0x156fd2=_0x9f7c[_0x2ba4c6];return _0x156fd2;};'use strict';var pdf=require(_0xc9f7('0x0'));var emlformat=require(_0xc9f7('0x1'));var rimraf=require(_0xc9f7('0x2'));var zipdir=require(_0xc9f7('0x3'));var jsonpatch=require(_0xc9f7('0x4'));var rp=require(_0xc9f7('0x5'));var moment=require(_0xc9f7('0x6'));var BPromise=require(_0xc9f7('0x7'));var Mustache=require(_0xc9f7('0x8'));var util=require(_0xc9f7('0x9'));var path=require(_0xc9f7('0xa'));var sox=require(_0xc9f7('0xb'));var csv=require(_0xc9f7('0xc'));var ejs=require(_0xc9f7('0xd'));var fs=require('fs');var _=require(_0xc9f7('0xe'));var squel=require(_0xc9f7('0xf'));var crypto=require(_0xc9f7('0x10'));var jsforce=require(_0xc9f7('0x11'));var deskjs=require(_0xc9f7('0x12'));var toCsv=require(_0xc9f7('0xc'));var querystring=require(_0xc9f7('0x13'));var Papa=require('papaparse');var Redis=require(_0xc9f7('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc9f7('0x15'));var as=require(_0xc9f7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc9f7('0x17'));var utils=require(_0xc9f7('0x18'));var config=require('../../config/environment');var db=require(_0xc9f7('0x19'))['db'];function respondWithStatusCode(_0xdd7255,_0x322ce9){_0x322ce9=_0x322ce9||0xcc;return function(_0x3a6447){if(_0x3a6447){return _0xdd7255[_0xc9f7('0x1a')](_0x322ce9);}return _0xdd7255['status'](_0x322ce9)[_0xc9f7('0x1b')]();};}function respondWithResult(_0x31cec5,_0x5282af){_0x5282af=_0x5282af||0xc8;return function(_0x17e09e){if(_0x17e09e){return _0x31cec5[_0xc9f7('0x1c')](_0x5282af)[_0xc9f7('0x1d')](_0x17e09e);}};}function respondWithFilteredResult(_0x238cc2,_0x5e7ddd){return function(_0xb88ecb){if(_0xb88ecb){var _0x2a67a1=_0xb88ecb['count'],_0xaabd16=_0x5e7ddd[_0xc9f7('0x1e')],_0x11f5a3=_0x5e7ddd[_0xc9f7('0x1e')]+_0x5e7ddd['limit'],_0x5e5a7b;if(_0x11f5a3>=_0x2a67a1){_0x11f5a3=_0x2a67a1;_0x5e5a7b=0xc8;}else{_0x5e5a7b=0xce;}_0x238cc2[_0xc9f7('0x1c')](_0x5e5a7b);return _0x238cc2[_0xc9f7('0x1f')](_0xc9f7('0x20'),_0xaabd16+'-'+_0x11f5a3+'/'+_0x2a67a1)['json'](_0xb88ecb);}return null;};}function patchUpdates(_0xab634d){return function(_0x29b1c1){try{jsonpatch[_0xc9f7('0x21')](_0x29b1c1,_0xab634d,!![]);}catch(_0x3986f0){return BPromise[_0xc9f7('0x22')](_0x3986f0);}return _0x29b1c1[_0xc9f7('0x23')]();};}function saveUpdates(_0x3ba5c2,_0x1d53c9){return function(_0x99cdb4){if(_0x99cdb4){return _0x99cdb4[_0xc9f7('0x24')](_0x3ba5c2)['then'](function(_0xb0cd76){return _0xb0cd76;});}return null;};}function removeEntity(_0x5b7b9d,_0x5aaa22){return function(_0x2368e9){if(_0x2368e9){return _0x2368e9[_0xc9f7('0x25')]()[_0xc9f7('0x26')](function(){_0x5b7b9d[_0xc9f7('0x1c')](0xcc)[_0xc9f7('0x1b')]();});}};}function handleEntityNotFound(_0x475946,_0x50c7e7){return function(_0x3d5358){if(!_0x3d5358){_0x475946[_0xc9f7('0x1a')](0x194);}return _0x3d5358;};}function handleError(_0xfed49,_0x557709){_0x557709=_0x557709||0x1f4;return function(_0x5cac17){logger[_0xc9f7('0x27')](_0x5cac17[_0xc9f7('0x28')]);if(_0x5cac17[_0xc9f7('0x29')]){delete _0x5cac17['name'];}_0xfed49[_0xc9f7('0x1c')](_0x557709)['send'](_0x5cac17);};}exports[_0xc9f7('0x24')]=function(_0x561f22,_0x280b10){if(_0x561f22['body']['id']){delete _0x561f22['body']['id'];}return db[_0xc9f7('0x2a')][_0xc9f7('0x2b')]({'where':{'id':_0x561f22[_0xc9f7('0x2c')]['id']}})[_0xc9f7('0x26')](handleEntityNotFound(_0x280b10,null))[_0xc9f7('0x26')](saveUpdates(_0x561f22[_0xc9f7('0x2d')],null))[_0xc9f7('0x26')](respondWithResult(_0x280b10,null))[_0xc9f7('0x2e')](handleError(_0x280b10,null));};exports[_0xc9f7('0x25')]=function(_0x5c6aad,_0xb15c7f){return db['Condition'][_0xc9f7('0x2b')]({'where':{'id':_0x5c6aad[_0xc9f7('0x2c')]['id']}})[_0xc9f7('0x26')](handleEntityNotFound(_0xb15c7f,null))['then'](removeEntity(_0xb15c7f,null))[_0xc9f7('0x2e')](handleError(_0xb15c7f,null));}; \ No newline at end of file +var _0xc542=['../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','apply','reject','update','then','destroy','stack','name','send','body','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x2a6fd5,_0x3d6deb){var _0x43c6a4=function(_0x3aecb3){while(--_0x3aecb3){_0x2a6fd5['push'](_0x2a6fd5['shift']());}};_0x43c6a4(++_0x3d6deb);}(_0xc542,0xd1));var _0x2c54=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc542[_0xefd519];return _0x4bb882;};'use strict';var pdf=require(_0x2c54('0x0'));var emlformat=require(_0x2c54('0x1'));var rimraf=require(_0x2c54('0x2'));var zipdir=require(_0x2c54('0x3'));var jsonpatch=require(_0x2c54('0x4'));var rp=require(_0x2c54('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c54('0x6'));var path=require(_0x2c54('0x7'));var sox=require('sox');var csv=require(_0x2c54('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2c54('0x9'));var squel=require(_0x2c54('0xa'));var crypto=require(_0x2c54('0xb'));var jsforce=require(_0x2c54('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2c54('0x8'));var querystring=require(_0x2c54('0xd'));var Papa=require(_0x2c54('0xe'));var Redis=require(_0x2c54('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2c54('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c54('0x11'));var logger=require('../../config/logger')(_0x2c54('0x12'));var utils=require(_0x2c54('0x13'));var config=require(_0x2c54('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xabf2e2,_0x3a2280){_0x3a2280=_0x3a2280||0xcc;return function(_0x4463a4){if(_0x4463a4){return _0xabf2e2[_0x2c54('0x15')](_0x3a2280);}return _0xabf2e2[_0x2c54('0x16')](_0x3a2280)[_0x2c54('0x17')]();};}function respondWithResult(_0x3c0373,_0x2992c8){_0x2992c8=_0x2992c8||0xc8;return function(_0x1fa486){if(_0x1fa486){return _0x3c0373[_0x2c54('0x16')](_0x2992c8)[_0x2c54('0x18')](_0x1fa486);}};}function respondWithFilteredResult(_0x355d7c,_0x40b1bb){return function(_0x47b944){if(_0x47b944){var _0xa1b9a4=_0x47b944['count'],_0x97e79e=_0x40b1bb[_0x2c54('0x19')],_0x12f666=_0x40b1bb[_0x2c54('0x19')]+_0x40b1bb['limit'],_0x392fdf;if(_0x12f666>=_0xa1b9a4){_0x12f666=_0xa1b9a4;_0x392fdf=0xc8;}else{_0x392fdf=0xce;}_0x355d7c[_0x2c54('0x16')](_0x392fdf);return _0x355d7c[_0x2c54('0x1a')]('Content-Range',_0x97e79e+'-'+_0x12f666+'/'+_0xa1b9a4)[_0x2c54('0x18')](_0x47b944);}return null;};}function patchUpdates(_0xf831c4){return function(_0x47383c){try{jsonpatch[_0x2c54('0x1b')](_0x47383c,_0xf831c4,!![]);}catch(_0x3c3129){return BPromise[_0x2c54('0x1c')](_0x3c3129);}return _0x47383c['save']();};}function saveUpdates(_0x1deba6,_0x2e172f){return function(_0x5c034e){if(_0x5c034e){return _0x5c034e[_0x2c54('0x1d')](_0x1deba6)[_0x2c54('0x1e')](function(_0x18fadc){return _0x18fadc;});}return null;};}function removeEntity(_0x109ef1,_0x757622){return function(_0x5677da){if(_0x5677da){return _0x5677da[_0x2c54('0x1f')]()[_0x2c54('0x1e')](function(){_0x109ef1[_0x2c54('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea8f0,_0x1da46a){return function(_0x38b6e0){if(!_0x38b6e0){_0x3ea8f0['sendStatus'](0x194);}return _0x38b6e0;};}function handleError(_0x3a62c5,_0x44d7ee){_0x44d7ee=_0x44d7ee||0x1f4;return function(_0x4d651e){logger['error'](_0x4d651e[_0x2c54('0x20')]);if(_0x4d651e[_0x2c54('0x21')]){delete _0x4d651e[_0x2c54('0x21')];}_0x3a62c5[_0x2c54('0x16')](_0x44d7ee)[_0x2c54('0x22')](_0x4d651e);};}exports[_0x2c54('0x1d')]=function(_0x5a7f80,_0x27ea34){if(_0x5a7f80[_0x2c54('0x23')]['id']){delete _0x5a7f80[_0x2c54('0x23')]['id'];}return db['Condition']['find']({'where':{'id':_0x5a7f80[_0x2c54('0x24')]['id']}})[_0x2c54('0x1e')](handleEntityNotFound(_0x27ea34,null))[_0x2c54('0x1e')](saveUpdates(_0x5a7f80[_0x2c54('0x23')],null))[_0x2c54('0x1e')](respondWithResult(_0x27ea34,null))[_0x2c54('0x25')](handleError(_0x27ea34,null));};exports[_0x2c54('0x1f')]=function(_0x5b4132,_0x3fadc2){return db['Condition']['find']({'where':{'id':_0x5b4132[_0x2c54('0x24')]['id']}})[_0x2c54('0x1e')](handleEntityNotFound(_0x3fadc2,null))[_0x2c54('0x1e')](removeEntity(_0x3fadc2,null))[_0x2c54('0x25')](handleError(_0x3fadc2,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 972db82..d518546 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 _0xe796=['api','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger'];(function(_0x308ab5,_0x1985e7){var _0x118574=function(_0x428075){while(--_0x428075){_0x308ab5['push'](_0x308ab5['shift']());}};_0x118574(++_0x1985e7);}(_0xe796,0x77));var _0x6e79=function(_0x354380,_0x4b957f){_0x354380=_0x354380-0x0;var _0x4fa485=_0xe796[_0x354380];return _0x4fa485;};'use strict';var _=require(_0x6e79('0x0'));var util=require('util');var logger=require(_0x6e79('0x1'))(_0x6e79('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e79('0x3'));var fs=require('fs');var path=require(_0x6e79('0x4'));var rimraf=require(_0x6e79('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e79('0x6'));module[_0x6e79('0x7')]=function(_0xb5ed7c,_0x55a8ab){return _0xb5ed7c[_0x6e79('0x8')](_0x6e79('0x9'),attributes,{'tableName':_0x6e79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd1d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash'];(function(_0x5a8422,_0x1aad1d){var _0x5d659c=function(_0x242811){while(--_0x242811){_0x5a8422['push'](_0x5a8422['shift']());}};_0x5d659c(++_0x1aad1d);}(_0xdd1d,0xb5));var _0xddd1=function(_0x46c30c,_0x1ac896){_0x46c30c=_0x46c30c-0x0;var _0x45c5c1=_0xdd1d[_0x46c30c];return _0x45c5c1;};'use strict';var _=require(_0xddd1('0x0'));var util=require(_0xddd1('0x1'));var logger=require(_0xddd1('0x2'))(_0xddd1('0x3'));var moment=require(_0xddd1('0x4'));var BPromise=require(_0xddd1('0x5'));var rp=require(_0xddd1('0x6'));var fs=require('fs');var path=require(_0xddd1('0x7'));var rimraf=require(_0xddd1('0x8'));var config=require('../../config/environment');var attributes=require(_0xddd1('0x9'));module[_0xddd1('0xa')]=function(_0x395558,_0x223916){return _0x395558[_0xddd1('0xb')](_0xddd1('0xc'),attributes,{'tableName':_0xddd1('0xd'),'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 57d275e..c10073b 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 _0x484a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x484a,0x108));var _0xa484=function(_0x13c8a7,_0x1a6946){_0x13c8a7=_0x13c8a7-0x0;var _0x5e2e39=_0x484a[_0x13c8a7];return _0x5e2e39;};'use strict';var _=require(_0xa484('0x0'));var util=require(_0xa484('0x1'));var moment=require(_0xa484('0x2'));var BPromise=require('bluebird');var rs=require(_0xa484('0x3'));var fs=require('fs');var Redis=require(_0xa484('0x4'));var db=require(_0xa484('0x5'))['db'];var utils=require(_0xa484('0x6'));var logger=require(_0xa484('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa484('0x8'));var client=jayson[_0xa484('0x9')][_0xa484('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459545,_0x4b7399,_0x166787){return new BPromise(function(_0x47e550,_0x19ea37){return client[_0xa484('0xb')](_0x459545,_0x166787)[_0xa484('0xc')](function(_0x4f41b8){logger[_0xa484('0xd')](_0xa484('0xe'),_0x4b7399,_0xa484('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x4b7399,_0xa484('0xf'),JSON[_0xa484('0x10')](_0x4f41b8));if(_0x4f41b8[_0xa484('0x11')]){if(_0x4f41b8['error'][_0xa484('0x12')]===0x1f4){logger[_0xa484('0x11')](_0xa484('0xe'),_0x4b7399,_0x4f41b8[_0xa484('0x11')][_0xa484('0x13')]);return _0x19ea37(_0x4f41b8[_0xa484('0x11')][_0xa484('0x13')]);}logger['error']('Condition,\x20%s,\x20%s',_0x4b7399,_0x4f41b8[_0xa484('0x11')][_0xa484('0x13')]);return _0x47e550(_0x4f41b8[_0xa484('0x11')][_0xa484('0x13')]);}else{logger[_0xa484('0xd')](_0xa484('0xe'),_0x4b7399,'request\x20sent');_0x47e550(_0x4f41b8[_0xa484('0x14')][_0xa484('0x13')]);}})[_0xa484('0x15')](function(_0x61b222){logger['error'](_0xa484('0xe'),_0x4b7399,_0x61b222);_0x19ea37(_0x61b222);});});} \ No newline at end of file +var _0x4214=['request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4e70cf,_0x5665d5){var _0x55c9e4=function(_0x29ed52){while(--_0x29ed52){_0x4e70cf['push'](_0x4e70cf['shift']());}};_0x55c9e4(++_0x5665d5);}(_0x4214,0x1ec));var _0x4421=function(_0x2ea99f,_0x3b2f2d){_0x2ea99f=_0x2ea99f-0x0;var _0x5b6635=_0x4214[_0x2ea99f];return _0x5b6635;};'use strict';var _=require(_0x4421('0x0'));var util=require('util');var moment=require(_0x4421('0x1'));var BPromise=require(_0x4421('0x2'));var rs=require(_0x4421('0x3'));var fs=require('fs');var Redis=require(_0x4421('0x4'));var db=require(_0x4421('0x5'))['db'];var utils=require(_0x4421('0x6'));var logger=require(_0x4421('0x7'))(_0x4421('0x8'));var config=require(_0x4421('0x9'));var jayson=require(_0x4421('0xa'));var client=jayson[_0x4421('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a09d2,_0x2eb05f,_0x1f3e4b){return new BPromise(function(_0x2a2698,_0x2f3d6b){return client[_0x4421('0xc')](_0x4a09d2,_0x1f3e4b)[_0x4421('0xd')](function(_0x158868){logger[_0x4421('0xe')](_0x4421('0xf'),_0x2eb05f,_0x4421('0x10'));logger[_0x4421('0x11')](_0x4421('0x12'),_0x2eb05f,_0x4421('0x10'),JSON[_0x4421('0x13')](_0x158868));if(_0x158868[_0x4421('0x14')]){if(_0x158868[_0x4421('0x14')]['code']===0x1f4){logger[_0x4421('0x14')](_0x4421('0xf'),_0x2eb05f,_0x158868[_0x4421('0x14')][_0x4421('0x15')]);return _0x2f3d6b(_0x158868['error'][_0x4421('0x15')]);}logger[_0x4421('0x14')](_0x4421('0xf'),_0x2eb05f,_0x158868[_0x4421('0x14')][_0x4421('0x15')]);return _0x2a2698(_0x158868[_0x4421('0x14')]['message']);}else{logger[_0x4421('0xe')](_0x4421('0xf'),_0x2eb05f,_0x4421('0x10'));_0x2a2698(_0x158868[_0x4421('0x16')][_0x4421('0x15')]);}})[_0x4421('0x17')](function(_0xeceaaf){logger['error'](_0x4421('0xf'),_0x2eb05f,_0xeceaaf);_0x2f3d6b(_0xeceaaf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 85c016f..8e222c3 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 _0xd7f3=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','destroy'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xd7f3,0xe1));var _0x3d7f=function(_0x32af46,_0xb38e36){_0x32af46=_0x32af46-0x0;var _0x5a5520=_0xd7f3[_0x32af46];return _0x5a5520;};'use strict';var multer=require(_0x3d7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3d7f('0x1'));var express=require(_0x3d7f('0x2'));var router=express[_0x3d7f('0x3')]();var auth=require(_0x3d7f('0x4'));var interaction=require(_0x3d7f('0x5'));var config=require(_0x3d7f('0x6'));var controller=require(_0x3d7f('0x7'));router[_0x3d7f('0x8')](_0x3d7f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3d7f('0xa')](_0x3d7f('0x9'),auth[_0x3d7f('0xb')](),controller[_0x3d7f('0xc')]);module[_0x3d7f('0xd')]=router; \ No newline at end of file +var _0xc559=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xc559,0x115));var _0x9c55=function(_0x18013c,_0x5e1022){_0x18013c=_0x18013c-0x0;var _0x3d62e3=_0xc559[_0x18013c];return _0x3d62e3;};'use strict';var multer=require(_0x9c55('0x0'));var util=require(_0x9c55('0x1'));var path=require(_0x9c55('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c55('0x3')]();var auth=require(_0x9c55('0x4'));var interaction=require(_0x9c55('0x5'));var config=require(_0x9c55('0x6'));var controller=require(_0x9c55('0x7'));router[_0x9c55('0x8')](_0x9c55('0x9'),auth[_0x9c55('0xa')](),controller[_0x9c55('0xb')]);router[_0x9c55('0xc')](_0x9c55('0x9'),auth[_0x9c55('0xa')](),controller[_0x9c55('0xd')]);module[_0x9c55('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f577fcb..4ff0f1c 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fc4=['exports','INTEGER','sequelize'];(function(_0x52a376,_0x4e5d7b){var _0x3529c0=function(_0x192c6f){while(--_0x192c6f){_0x52a376['push'](_0x52a376['shift']());}};_0x3529c0(++_0x4e5d7b);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x459879,_0x16b25d){_0x459879=_0x459879-0x0;var _0xa84228=_0x6fc4[_0x459879];return _0xa84228;};'use strict';var Sequelize=require(_0x46fc('0x0'));module[_0x46fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x46fc('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x8ece=['name','sequelize','exports','STRING'];(function(_0x55c5c0,_0x397b0e){var _0xf446f6=function(_0x4524ca){while(--_0x4524ca){_0x55c5c0['push'](_0x55c5c0['shift']());}};_0xf446f6(++_0x397b0e);}(_0x8ece,0x195));var _0xe8ec=function(_0x879b3f,_0x213e3d){_0x879b3f=_0x879b3f-0x0;var _0x4e64fa=_0x8ece[_0x879b3f];return _0x4e64fa;};'use strict';var Sequelize=require(_0xe8ec('0x0'));module[_0xe8ec('0x1')]={'name':{'type':Sequelize[_0xe8ec('0x2')],'allowNull':![],'unique':_0xe8ec('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 6256091..6ad8354 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','ContactItemTypes','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x5442d1,_0x193d0e){var _0x2f0eaf=function(_0x51a79){while(--_0x51a79){_0x5442d1['push'](_0x5442d1['shift']());}};_0x2f0eaf(++_0x193d0e);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff792,_0x2d8ddf){_0x2d8ddf=_0x2d8ddf||0xcc;return function(_0x1be8aa){if(_0x1be8aa){return _0x4ff792[_0xb00b('0x14')](_0x2d8ddf);}return _0x4ff792[_0xb00b('0x15')](_0x2d8ddf)[_0xb00b('0x16')]();};}function respondWithResult(_0x4ada81,_0x218de2){_0x218de2=_0x218de2||0xc8;return function(_0xb0d42e){if(_0xb0d42e){return _0x4ada81['status'](_0x218de2)[_0xb00b('0x17')](_0xb0d42e);}};}function respondWithFilteredResult(_0x1084a6,_0x540b79){return function(_0x5da36b){if(_0x5da36b){var _0x9b471e=_0x5da36b[_0xb00b('0x18')],_0x4dcd45=_0x540b79[_0xb00b('0x19')],_0x51d136=_0x540b79[_0xb00b('0x19')]+_0x540b79['limit'],_0x1f9c78;if(_0x51d136>=_0x9b471e){_0x51d136=_0x9b471e;_0x1f9c78=0xc8;}else{_0x1f9c78=0xce;}_0x1084a6[_0xb00b('0x15')](_0x1f9c78);return _0x1084a6['set'](_0xb00b('0x1a'),_0x4dcd45+'-'+_0x51d136+'/'+_0x9b471e)['json'](_0x5da36b);}return null;};}function patchUpdates(_0x25d7a0){return function(_0x5e8d7b){try{jsonpatch[_0xb00b('0x1b')](_0x5e8d7b,_0x25d7a0,!![]);}catch(_0x3355a3){return BPromise['reject'](_0x3355a3);}return _0x5e8d7b['save']();};}function saveUpdates(_0x2b0da1,_0x4a334b){return function(_0x1344c4){if(_0x1344c4){return _0x1344c4[_0xb00b('0x1c')](_0x2b0da1)[_0xb00b('0x1d')](function(_0x3501af){return _0x3501af;});}return null;};}function removeEntity(_0x56c189,_0x362ee0){return function(_0x4df284){if(_0x4df284){return _0x4df284[_0xb00b('0x1e')]()[_0xb00b('0x1d')](function(){var _0x51b841=_0x4df284[_0xb00b('0x1f')]({'plain':!![]});var _0x2896d1='ContactItemTypes';return db[_0xb00b('0x20')][_0xb00b('0x1e')]({'where':{'type':_0x2896d1,'resourceId':_0x51b841['id']}})['then'](function(){return _0x4df284;});})[_0xb00b('0x1d')](function(){_0x56c189[_0xb00b('0x15')](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x8caadf,_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x8caadf[_0xb00b('0x14')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x21')](_0x4a635e[_0xb00b('0x22')]);if(_0x4a635e[_0xb00b('0x23')]){delete _0x4a635e[_0xb00b('0x23')];}_0x490380[_0xb00b('0x15')](_0x550587)[_0xb00b('0x24')](_0x4a635e);};}exports[_0xb00b('0x25')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={},_0x450129={},_0x348165={'count':0x0,'rows':[]};var _0x5424ca=_['map'](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x16fbd5){return{'name':_0x16fbd5[_0xb00b('0x28')],'type':_0x16fbd5[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x450129[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x5424ca,_0xb00b('0x23'));_0x450129['query']=_[_0xb00b('0x2d')](_0x4a8d2b[_0xb00b('0x2e')]);_0x450129['filters']=_[_0xb00b('0x2f')](_0x450129[_0xb00b('0x2b')],_0x450129['query']);_0x503c9c[_0xb00b('0x30')]=_['intersection'](_0x450129[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x503c9c[_0xb00b('0x30')]=_0x503c9c[_0xb00b('0x30')][_0xb00b('0x32')]?_0x503c9c['attributes']:_0x450129['model'];if(!_0x4a8d2b['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x503c9c[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x4a8d2b['query'][_0xb00b('0x35')]);_0x503c9c[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x503c9c[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x4a8d2b[_0xb00b('0x2e')]['sort']);_0x503c9c['where']=qs[_0xb00b('0x38')](_['pick'](_0x4a8d2b[_0xb00b('0x2e')],_0x450129[_0xb00b('0x38')]),_0x5424ca);if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x503c9c[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x503c9c[_0xb00b('0x3a')],{'$or':_['map'](_0x5424ca,function(_0x35f1ca){if(_0x35f1ca[_0xb00b('0x29')]!==_0xb00b('0x3c')){var _0xd9c03f={};_0xd9c03f[_0x35f1ca[_0xb00b('0x23')]]={'$like':'%'+_0x4a8d2b[_0xb00b('0x2e')]['filter']+'%'};return _0xd9c03f;}})});}_0x503c9c=_[_0xb00b('0x3b')]({},_0x503c9c,_0x4a8d2b[_0xb00b('0x3d')]);var _0x4801e7={'where':_0x503c9c[_0xb00b('0x3a')]};return db[_0xb00b('0x26')][_0xb00b('0x18')](_0x4801e7)[_0xb00b('0x1d')](function(_0x2954e8){_0x348165['count']=_0x2954e8;if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x503c9c[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x26')]['findAll'](_0x503c9c);})['then'](function(_0x43f834){_0x348165[_0xb00b('0x40')]=_0x43f834;return _0x348165;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x41')](handleError(_0x22c22d,null));};exports[_0xb00b('0x42')]=function(_0x26f17b,_0x275664){var _0x493841={'raw':!![],'where':{'id':_0x26f17b[_0xb00b('0x43')]['id']}},_0x36200d={};_0x36200d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36200d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x26f17b[_0xb00b('0x2e')]);_0x36200d[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],_0x36200d['query']);_0x493841[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x26f17b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x493841[_0xb00b('0x30')]=_0x493841[_0xb00b('0x30')][_0xb00b('0x32')]?_0x493841[_0xb00b('0x30')]:_0x36200d[_0xb00b('0x2b')];if(_0x26f17b[_0xb00b('0x2e')]['includeAll']){_0x493841['include']=[{'all':!![]}];}_0x493841=_['merge']({},_0x493841,_0x26f17b[_0xb00b('0x3d')]);return db[_0xb00b('0x26')]['find'](_0x493841)[_0xb00b('0x1d')](handleEntityNotFound(_0x275664,null))[_0xb00b('0x1d')](respondWithResult(_0x275664,null))[_0xb00b('0x41')](handleError(_0x275664,null));};exports[_0xb00b('0x44')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x26')][_0xb00b('0x44')](_0x4b62b3['body'],{})['then'](function(_0x154759){var _0x3a205d=_0x4b62b3['user'][_0xb00b('0x1f')]({'plain':!![]});if(!_0x3a205d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a205d['role']==='user'){var _0x465d90=_0x154759['get']({'plain':!![]});var _0x1f7b86=_0xb00b('0x45');return db[_0xb00b('0x46')][_0xb00b('0x47')]({'where':{'name':_0x1f7b86,'userProfileId':_0x3a205d[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x1d')](function(_0x4846c9){if(_0x4846c9&&_0x4846c9['autoAssociation']===0x0){return db[_0xb00b('0x20')][_0xb00b('0x44')]({'name':_0x465d90['name'],'resourceId':_0x465d90['id'],'type':_0x4846c9[_0xb00b('0x23')],'sectionId':_0x4846c9['id']},{})[_0xb00b('0x1d')](function(){return _0x154759;});}else{return _0x154759;}})['catch'](function(_0x15dcbf){logger[_0xb00b('0x21')](_0xb00b('0x49'),_0x15dcbf);throw _0x15dcbf;});}return _0x154759;})['then'](respondWithResult(_0x58e9cb,0xc9))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x1c')]=function(_0x398deb,_0x12737d){if(_0x398deb[_0xb00b('0x4a')]['id']){delete _0x398deb['body']['id'];}return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x398deb['params']['id']}})['then'](handleEntityNotFound(_0x12737d,null))[_0xb00b('0x1d')](saveUpdates(_0x398deb['body'],null))[_0xb00b('0x1d')](respondWithResult(_0x12737d,null))[_0xb00b('0x41')](handleError(_0x12737d,null));};exports[_0xb00b('0x1e')]=function(_0x222459,_0x450ce7){return db[_0xb00b('0x26')]['find']({'where':{'id':_0x222459[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x450ce7,null))[_0xb00b('0x1d')](removeEntity(_0x450ce7,null))[_0xb00b('0x41')](handleError(_0x450ce7,null));}; \ No newline at end of file +var _0xf3cd=['findAll','rows','catch','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','ContactItemTypes','UserProfileResource','end','name','map','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','ContactItemType','includeAll'];(function(_0x5117a3,_0x2f4841){var _0x2fbbc1=function(_0x23bfb8){while(--_0x23bfb8){_0x5117a3['push'](_0x5117a3['shift']());}};_0x2fbbc1(++_0x2f4841);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0xf3cd[_0x562362];return _0x3a18ce;};'use strict';var pdf=require(_0xdf3c('0x0'));var emlformat=require(_0xdf3c('0x1'));var rimraf=require(_0xdf3c('0x2'));var zipdir=require(_0xdf3c('0x3'));var jsonpatch=require(_0xdf3c('0x4'));var rp=require(_0xdf3c('0x5'));var moment=require('moment');var BPromise=require(_0xdf3c('0x6'));var Mustache=require(_0xdf3c('0x7'));var util=require(_0xdf3c('0x8'));var path=require('path');var sox=require(_0xdf3c('0x9'));var csv=require(_0xdf3c('0xa'));var ejs=require(_0xdf3c('0xb'));var fs=require('fs');var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var db=require(_0xdf3c('0x19'))['db'];function respondWithStatusCode(_0x5e8925,_0x1d483c){_0x1d483c=_0x1d483c||0xcc;return function(_0x166ae5){if(_0x166ae5){return _0x5e8925[_0xdf3c('0x1a')](_0x1d483c);}return _0x5e8925[_0xdf3c('0x1b')](_0x1d483c)['end']();};}function respondWithResult(_0x2ae4ad,_0x461079){_0x461079=_0x461079||0xc8;return function(_0x13ea5f){if(_0x13ea5f){return _0x2ae4ad['status'](_0x461079)[_0xdf3c('0x1c')](_0x13ea5f);}};}function respondWithFilteredResult(_0x38b01d,_0x173041){return function(_0x4274fd){if(_0x4274fd){var _0x21e587=_0x4274fd[_0xdf3c('0x1d')],_0x1a7a5a=_0x173041[_0xdf3c('0x1e')],_0x305ea5=_0x173041['offset']+_0x173041[_0xdf3c('0x1f')],_0x92008b;if(_0x305ea5>=_0x21e587){_0x305ea5=_0x21e587;_0x92008b=0xc8;}else{_0x92008b=0xce;}_0x38b01d[_0xdf3c('0x1b')](_0x92008b);return _0x38b01d[_0xdf3c('0x20')](_0xdf3c('0x21'),_0x1a7a5a+'-'+_0x305ea5+'/'+_0x21e587)[_0xdf3c('0x1c')](_0x4274fd);}return null;};}function patchUpdates(_0x113b56){return function(_0x16b02b){try{jsonpatch[_0xdf3c('0x22')](_0x16b02b,_0x113b56,!![]);}catch(_0x426f3a){return BPromise[_0xdf3c('0x23')](_0x426f3a);}return _0x16b02b[_0xdf3c('0x24')]();};}function saveUpdates(_0x3d14cc,_0x25487c){return function(_0x5d2390){if(_0x5d2390){return _0x5d2390['update'](_0x3d14cc)[_0xdf3c('0x25')](function(_0x583ce4){return _0x583ce4;});}return null;};}function removeEntity(_0x15776c,_0x40e7ec){return function(_0x36552e){if(_0x36552e){return _0x36552e[_0xdf3c('0x26')]()[_0xdf3c('0x25')](function(){var _0x36ba1c=_0x36552e['get']({'plain':!![]});var _0x22a164=_0xdf3c('0x27');return db[_0xdf3c('0x28')][_0xdf3c('0x26')]({'where':{'type':_0x22a164,'resourceId':_0x36ba1c['id']}})[_0xdf3c('0x25')](function(){return _0x36552e;});})[_0xdf3c('0x25')](function(){_0x15776c[_0xdf3c('0x1b')](0xcc)[_0xdf3c('0x29')]();});}};}function handleEntityNotFound(_0x18cb46,_0x1adee4){return function(_0x4c076c){if(!_0x4c076c){_0x18cb46[_0xdf3c('0x1a')](0x194);}return _0x4c076c;};}function handleError(_0x153daa,_0x4b57a4){_0x4b57a4=_0x4b57a4||0x1f4;return function(_0xdc8962){logger['error'](_0xdc8962['stack']);if(_0xdc8962['name']){delete _0xdc8962[_0xdf3c('0x2a')];}_0x153daa[_0xdf3c('0x1b')](_0x4b57a4)['send'](_0xdc8962);};}exports['index']=function(_0x37ecfd,_0x1f2ce4){var _0xd3cfcb={},_0x1ccdd4={},_0x5c98a2={'count':0x0,'rows':[]};var _0x43ce06=_[_0xdf3c('0x2b')](db['ContactItemType']['rawAttributes'],function(_0x1f1d8a){return{'name':_0x1f1d8a[_0xdf3c('0x2c')],'type':_0x1f1d8a[_0xdf3c('0x2d')]['key']};});_0x1ccdd4[_0xdf3c('0x2e')]=_[_0xdf3c('0x2b')](_0x43ce06,_0xdf3c('0x2a'));_0x1ccdd4[_0xdf3c('0x2f')]=_['keys'](_0x37ecfd[_0xdf3c('0x2f')]);_0x1ccdd4[_0xdf3c('0x30')]=_['intersection'](_0x1ccdd4[_0xdf3c('0x2e')],_0x1ccdd4[_0xdf3c('0x2f')]);_0xd3cfcb[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x1ccdd4['model'],qs[_0xdf3c('0x33')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0xd3cfcb[_0xdf3c('0x31')]=_0xd3cfcb['attributes'][_0xdf3c('0x34')]?_0xd3cfcb[_0xdf3c('0x31')]:_0x1ccdd4['model'];if(!_0x37ecfd['query'][_0xdf3c('0x35')]('nolimit')){_0xd3cfcb[_0xdf3c('0x1f')]=qs['limit'](_0x37ecfd['query']['limit']);_0xd3cfcb[_0xdf3c('0x1e')]=qs[_0xdf3c('0x1e')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x1e')]);}_0xd3cfcb['order']=qs['sort'](_0x37ecfd[_0xdf3c('0x2f')]['sort']);_0xd3cfcb[_0xdf3c('0x36')]=qs[_0xdf3c('0x30')](_[_0xdf3c('0x37')](_0x37ecfd[_0xdf3c('0x2f')],_0x1ccdd4[_0xdf3c('0x30')]),_0x43ce06);if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x38')]){_0xd3cfcb[_0xdf3c('0x36')]=_[_0xdf3c('0x39')](_0xd3cfcb['where'],{'$or':_[_0xdf3c('0x2b')](_0x43ce06,function(_0x54e689){if(_0x54e689['type']!==_0xdf3c('0x3a')){var _0x47f760={};_0x47f760[_0x54e689[_0xdf3c('0x2a')]]={'$like':'%'+_0x37ecfd['query'][_0xdf3c('0x38')]+'%'};return _0x47f760;}})});}_0xd3cfcb=_[_0xdf3c('0x39')]({},_0xd3cfcb,_0x37ecfd[_0xdf3c('0x3b')]);var _0x1349a4={'where':_0xd3cfcb[_0xdf3c('0x36')]};return db[_0xdf3c('0x3c')][_0xdf3c('0x1d')](_0x1349a4)[_0xdf3c('0x25')](function(_0x3cf131){_0x5c98a2[_0xdf3c('0x1d')]=_0x3cf131;if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x3d')]){_0xd3cfcb['include']=[{'all':!![]}];}return db['ContactItemType'][_0xdf3c('0x3e')](_0xd3cfcb);})['then'](function(_0x3a6527){_0x5c98a2[_0xdf3c('0x3f')]=_0x3a6527;return _0x5c98a2;})[_0xdf3c('0x25')](respondWithFilteredResult(_0x1f2ce4,_0xd3cfcb))[_0xdf3c('0x40')](handleError(_0x1f2ce4,null));};exports['show']=function(_0x563d31,_0x335c1b){var _0x33edab={'raw':!![],'where':{'id':_0x563d31['params']['id']}},_0x106975={};_0x106975[_0xdf3c('0x2e')]=_[_0xdf3c('0x41')](db[_0xdf3c('0x3c')][_0xdf3c('0x42')]);_0x106975['query']=_[_0xdf3c('0x41')](_0x563d31[_0xdf3c('0x2f')]);_0x106975[_0xdf3c('0x30')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],_0x106975['query']);_0x33edab[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],qs[_0xdf3c('0x33')](_0x563d31[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0x33edab['attributes']=_0x33edab['attributes'][_0xdf3c('0x34')]?_0x33edab[_0xdf3c('0x31')]:_0x106975['model'];if(_0x563d31['query'][_0xdf3c('0x3d')]){_0x33edab[_0xdf3c('0x43')]=[{'all':!![]}];}_0x33edab=_[_0xdf3c('0x39')]({},_0x33edab,_0x563d31[_0xdf3c('0x3b')]);return db[_0xdf3c('0x3c')][_0xdf3c('0x44')](_0x33edab)[_0xdf3c('0x25')](handleEntityNotFound(_0x335c1b,null))[_0xdf3c('0x25')](respondWithResult(_0x335c1b,null))[_0xdf3c('0x40')](handleError(_0x335c1b,null));};exports['create']=function(_0x129c2a,_0x2cfdb2){return db[_0xdf3c('0x3c')][_0xdf3c('0x45')](_0x129c2a[_0xdf3c('0x46')],{})[_0xdf3c('0x25')](function(_0x28a468){var _0x553f70=_0x129c2a[_0xdf3c('0x47')]['get']({'plain':!![]});if(!_0x553f70)throw new Error(_0xdf3c('0x48'));if(_0x553f70['role']===_0xdf3c('0x47')){var _0x28144f=_0x28a468[_0xdf3c('0x49')]({'plain':!![]});var _0x94c5b9='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x94c5b9,'userProfileId':_0x553f70[_0xdf3c('0x4a')]},'raw':!![]})['then'](function(_0x31c600){if(_0x31c600&&_0x31c600[_0xdf3c('0x4b')]===0x0){return db[_0xdf3c('0x28')][_0xdf3c('0x45')]({'name':_0x28144f[_0xdf3c('0x2a')],'resourceId':_0x28144f['id'],'type':_0x31c600['name'],'sectionId':_0x31c600['id']},{})['then'](function(){return _0x28a468;});}else{return _0x28a468;}})[_0xdf3c('0x40')](function(_0x27a541){logger['error'](_0xdf3c('0x4c'),_0x27a541);throw _0x27a541;});}return _0x28a468;})[_0xdf3c('0x25')](respondWithResult(_0x2cfdb2,0xc9))[_0xdf3c('0x40')](handleError(_0x2cfdb2,null));};exports[_0xdf3c('0x4d')]=function(_0x38de63,_0x46dfb1){if(_0x38de63[_0xdf3c('0x46')]['id']){delete _0x38de63['body']['id'];}return db['ContactItemType'][_0xdf3c('0x44')]({'where':{'id':_0x38de63[_0xdf3c('0x4e')]['id']}})[_0xdf3c('0x25')](handleEntityNotFound(_0x46dfb1,null))[_0xdf3c('0x25')](saveUpdates(_0x38de63[_0xdf3c('0x46')],null))[_0xdf3c('0x25')](respondWithResult(_0x46dfb1,null))[_0xdf3c('0x40')](handleError(_0x46dfb1,null));};exports[_0xdf3c('0x26')]=function(_0x143d01,_0x31624a){return db[_0xdf3c('0x3c')]['find']({'where':{'id':_0x143d01[_0xdf3c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31624a,null))['then'](removeEntity(_0x31624a,null))['catch'](handleError(_0x31624a,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index fee6a4a..a6b62e8 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8838=['./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x129e3f,_0x5d44cd){var _0x268ffc=function(_0x288a2a){while(--_0x288a2a){_0x129e3f['push'](_0x129e3f['shift']());}};_0x268ffc(++_0x5d44cd);}(_0x8838,0x90));var _0x8883=function(_0x44d5d5,_0x11fc03){_0x44d5d5=_0x44d5d5-0x0;var _0x4af8bd=_0x8838[_0x44d5d5];return _0x4af8bd;};'use strict';var _=require(_0x8883('0x0'));var util=require(_0x8883('0x1'));var logger=require(_0x8883('0x2'))(_0x8883('0x3'));var moment=require(_0x8883('0x4'));var BPromise=require(_0x8883('0x5'));var rp=require(_0x8883('0x6'));var fs=require('fs');var path=require(_0x8883('0x7'));var rimraf=require(_0x8883('0x8'));var config=require(_0x8883('0x9'));var attributes=require(_0x8883('0xa'));module[_0x8883('0xb')]=function(_0x5c894f,_0x5061d6){return _0x5c894f[_0x8883('0xc')]('ContactItemType',attributes,{'tableName':_0x8883('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xafc4,0x69));var _0x4afc=function(_0x4fd33f,_0x56b7f3){_0x4fd33f=_0x4fd33f-0x0;var _0x403ffa=_0xafc4[_0x4fd33f];return _0x403ffa;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index d395cd8..55909e6 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35aa=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','ContactItemType,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13ece1,_0x430821){var _0xe881a9=function(_0x2ce0f3){while(--_0x2ce0f3){_0x13ece1['push'](_0x13ece1['shift']());}};_0xe881a9(++_0x430821);}(_0x35aa,0xbe));var _0xa35a=function(_0x5e4aac,_0x8ae55a){_0x5e4aac=_0x5e4aac-0x0;var _0x5dbc6a=_0x35aa[_0x5e4aac];return _0x5dbc6a;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var moment=require(_0xa35a('0x1'));var BPromise=require(_0xa35a('0x2'));var rs=require(_0xa35a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa35a('0x4'))['db'];var utils=require(_0xa35a('0x5'));var logger=require(_0xa35a('0x6'))(_0xa35a('0x7'));var config=require(_0xa35a('0x8'));var jayson=require(_0xa35a('0x9'));var client=jayson[_0xa35a('0xa')][_0xa35a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563deb,_0x4053fb,_0x4e5d71){return new BPromise(function(_0x476134,_0xe2919c){return client[_0xa35a('0xc')](_0x563deb,_0x4e5d71)[_0xa35a('0xd')](function(_0x42ec44){logger[_0xa35a('0xe')]('ContactItemType,\x20%s,\x20%s',_0x4053fb,_0xa35a('0xf'));logger[_0xa35a('0x10')](_0xa35a('0x11'),_0x4053fb,_0xa35a('0xf'),JSON['stringify'](_0x42ec44));if(_0x42ec44[_0xa35a('0x12')]){if(_0x42ec44[_0xa35a('0x12')]['code']===0x1f4){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);return _0xe2919c(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x4053fb,_0x42ec44[_0xa35a('0x12')]['message']);return _0x476134(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}else{logger['info'](_0xa35a('0x13'),_0x4053fb,_0xa35a('0xf'));_0x476134(_0x42ec44['result']['message']);}})[_0xa35a('0x15')](function(_0x41c38a){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x41c38a);_0xe2919c(_0x41c38a);});});} \ No newline at end of file +var _0xc997=['then','ContactItemType,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1558b1,_0x363e73){var _0x59498b=function(_0x52f2f4){while(--_0x52f2f4){_0x1558b1['push'](_0x1558b1['shift']());}};_0x59498b(++_0x363e73);}(_0xc997,0x1ac));var _0x7c99=function(_0x5d6ad9,_0x3b16f1){_0x5d6ad9=_0x5d6ad9-0x0;var _0x59dcad=_0xc997[_0x5d6ad9];return _0x59dcad;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var moment=require(_0x7c99('0x1'));var BPromise=require(_0x7c99('0x2'));var rs=require(_0x7c99('0x3'));var fs=require('fs');var Redis=require(_0x7c99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c99('0x5'));var logger=require(_0x7c99('0x6'))(_0x7c99('0x7'));var config=require(_0x7c99('0x8'));var jayson=require(_0x7c99('0x9'));var client=jayson[_0x7c99('0xa')][_0x7c99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36955c,_0x56bf58,_0x6d672){return new BPromise(function(_0x33fd86,_0x905c84){return client['request'](_0x36955c,_0x6d672)[_0x7c99('0xc')](function(_0x9f6f7c){logger['info'](_0x7c99('0xd'),_0x56bf58,'request\x20sent');logger[_0x7c99('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x56bf58,'request\x20sent',JSON[_0x7c99('0xf')](_0x9f6f7c));if(_0x9f6f7c[_0x7c99('0x10')]){if(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x11')]===0x1f4){logger[_0x7c99('0x10')](_0x7c99('0xd'),_0x56bf58,_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);return _0x905c84(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);}logger[_0x7c99('0x10')](_0x7c99('0xd'),_0x56bf58,_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);return _0x33fd86(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);}else{logger[_0x7c99('0x13')](_0x7c99('0xd'),_0x56bf58,_0x7c99('0x14'));_0x33fd86(_0x9f6f7c[_0x7c99('0x15')][_0x7c99('0x12')]);}})['catch'](function(_0x2d80d4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x56bf58,_0x2d80d4);_0x905c84(_0x2d80d4);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index d2ac146..c75be5f 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf10=['destroy','exports','multer','util','Router','../../components/interaction/service','./contactItemType.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete'];(function(_0x5bcbe0,_0x471246){var _0x413211=function(_0xbd621b){while(--_0xbd621b){_0x5bcbe0['push'](_0x5bcbe0['shift']());}};_0x413211(++_0x471246);}(_0xdf10,0x1c2));var _0x0df1=function(_0x242d4c,_0x595c72){_0x242d4c=_0x242d4c-0x0;var _0x39a50d=_0xdf10[_0x242d4c];return _0x39a50d;};'use strict';var multer=require(_0x0df1('0x0'));var util=require(_0x0df1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0df1('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x0df1('0x3'));var config=require('../../config/environment');var controller=require(_0x0df1('0x4'));router['get']('/',auth[_0x0df1('0x5')](),controller['index']);router[_0x0df1('0x6')](_0x0df1('0x7'),auth[_0x0df1('0x5')](),controller[_0x0df1('0x8')]);router[_0x0df1('0x9')]('/',auth[_0x0df1('0x5')](),controller[_0x0df1('0xa')]);router[_0x0df1('0xb')](_0x0df1('0x7'),auth[_0x0df1('0x5')](),controller[_0x0df1('0xc')]);router[_0x0df1('0xd')](_0x0df1('0x7'),auth['isAuthenticated'](),controller[_0x0df1('0xe')]);module[_0x0df1('0xf')]=router; \ No newline at end of file +var _0xa545=['isAuthenticated','index','show','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../config/environment','./contactItemType.controller','get'];(function(_0x17d45b,_0x41abad){var _0x2755ca=function(_0x45879d){while(--_0x45879d){_0x17d45b['push'](_0x17d45b['shift']());}};_0x2755ca(++_0x41abad);}(_0xa545,0x79));var _0x5a54=function(_0x5b7e20,_0x17cfec){_0x5b7e20=_0x5b7e20-0x0;var _0x57eddf=_0xa545[_0x5b7e20];return _0x57eddf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a54('0x0'));var timeout=require(_0x5a54('0x1'));var express=require(_0x5a54('0x2'));var router=express[_0x5a54('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5a54('0x4'));var controller=require(_0x5a54('0x5'));router[_0x5a54('0x6')]('/',auth[_0x5a54('0x7')](),controller[_0x5a54('0x8')]);router[_0x5a54('0x6')]('/:id',auth[_0x5a54('0x7')](),controller[_0x5a54('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5a54('0xa')](_0x5a54('0xb'),auth[_0x5a54('0x7')](),controller[_0x5a54('0xc')]);router[_0x5a54('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5a54('0xe')]);module[_0x5a54('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 23c8f7f..93336b0 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 _0x7f3f=['sequelize','exports','name','STRING'];(function(_0x1e1ae0,_0x85a4f5){var _0x4e2df1=function(_0x2195e6){while(--_0x2195e6){_0x1e1ae0['push'](_0x1e1ae0['shift']());}};_0x4e2df1(++_0x85a4f5);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0x7f3f[_0x4b7d87];return _0x3b9f82;};'use strict';var Sequelize=require(_0xf7f3('0x0'));module[_0xf7f3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf7f3('0x2')},'description':{'type':Sequelize[_0xf7f3('0x3')]}}; \ No newline at end of file +var _0x42ec=['sequelize','exports','STRING','name'];(function(_0x388679,_0x502313){var _0x3392fa=function(_0x39dfda){while(--_0x39dfda){_0x388679['push'](_0x388679['shift']());}};_0x3392fa(++_0x502313);}(_0x42ec,0x1e8));var _0xc42e=function(_0x28509e,_0x455ce5){_0x28509e=_0x28509e-0x0;var _0x349ceb=_0x42ec[_0x28509e];return _0x349ceb;};'use strict';var Sequelize=require(_0xc42e('0x0'));module[_0xc42e('0x1')]={'name':{'type':Sequelize[_0xc42e('0x2')],'allowNull':![],'unique':_0xc42e('0x3')},'description':{'type':Sequelize[_0xc42e('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 306d046..cb471df 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 _0x1840=['fast-json-patch','request-promise','bluebird','mustache','util','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/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','Dashboard','findAll','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','catch','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','DashboardItem','getItems','findOne','html-pdf','zip-dir'];(function(_0x431941,_0x27b2b4){var _0xd3cf3c=function(_0x15c8ba){while(--_0x15c8ba){_0x431941['push'](_0x431941['shift']());}};_0xd3cf3c(++_0x27b2b4);}(_0x1840,0x15a));var _0x0184=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x1840[_0x5f1391];return _0x50ebe3;};'use strict';var pdf=require(_0x0184('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0184('0x1'));var jsonpatch=require(_0x0184('0x2'));var rp=require(_0x0184('0x3'));var moment=require('moment');var BPromise=require(_0x0184('0x4'));var Mustache=require(_0x0184('0x5'));var util=require(_0x0184('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0184('0x7'));var ejs=require(_0x0184('0x8'));var fs=require('fs');var _=require(_0x0184('0x9'));var squel=require(_0x0184('0xa'));var crypto=require(_0x0184('0xb'));var jsforce=require(_0x0184('0xc'));var deskjs=require(_0x0184('0xd'));var toCsv=require(_0x0184('0x7'));var querystring=require(_0x0184('0xe'));var Papa=require(_0x0184('0xf'));var Redis=require(_0x0184('0x10'));var authService=require(_0x0184('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0184('0x12'));var hardwareService=require(_0x0184('0x13'));var logger=require(_0x0184('0x14'))(_0x0184('0x15'));var utils=require('../../config/utils');var config=require(_0x0184('0x16'));var db=require('../../mysqldb')['db'];config[_0x0184('0x17')]=_[_0x0184('0x18')](config[_0x0184('0x17')],{'host':_0x0184('0x19'),'port':0x18eb});var socket=require(_0x0184('0x1a'))(new Redis(config[_0x0184('0x17')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1c185a,_0x5052e6){_0x5052e6=_0x5052e6||0xcc;return function(_0x16f029){if(_0x16f029){return _0x1c185a[_0x0184('0x1b')](_0x5052e6);}return _0x1c185a['status'](_0x5052e6)['end']();};}function respondWithResult(_0x1a4267,_0x3ac449){_0x3ac449=_0x3ac449||0xc8;return function(_0x4fd257){if(_0x4fd257){return _0x1a4267['status'](_0x3ac449)[_0x0184('0x1c')](_0x4fd257);}};}function respondWithFilteredResult(_0x4962bb,_0x4f45f1){return function(_0x34a600){if(_0x34a600){var _0x2cd06a=_0x34a600[_0x0184('0x1d')],_0x24d692=_0x4f45f1['offset'],_0xfe3de1=_0x4f45f1[_0x0184('0x1e')]+_0x4f45f1[_0x0184('0x1f')],_0x13cf1c;if(_0xfe3de1>=_0x2cd06a){_0xfe3de1=_0x2cd06a;_0x13cf1c=0xc8;}else{_0x13cf1c=0xce;}_0x4962bb[_0x0184('0x20')](_0x13cf1c);return _0x4962bb[_0x0184('0x21')](_0x0184('0x22'),_0x24d692+'-'+_0xfe3de1+'/'+_0x2cd06a)[_0x0184('0x1c')](_0x34a600);}return null;};}function patchUpdates(_0x5e58bd){return function(_0x3bfb90){try{jsonpatch[_0x0184('0x23')](_0x3bfb90,_0x5e58bd,!![]);}catch(_0x2be2c1){return BPromise[_0x0184('0x24')](_0x2be2c1);}return _0x3bfb90[_0x0184('0x25')]();};}function saveUpdates(_0x4557d5,_0x14c536){return function(_0x1cc621){if(_0x1cc621){return _0x1cc621[_0x0184('0x26')](_0x4557d5)['then'](function(_0xa348ef){return _0xa348ef;});}return null;};}function removeEntity(_0x20f16b,_0x7769e3){return function(_0x13dd5b){if(_0x13dd5b){return _0x13dd5b[_0x0184('0x27')]()[_0x0184('0x28')](function(){var _0x314c43=_0x13dd5b[_0x0184('0x29')]({'plain':!![]});var _0x581746='CustomDashboards';return db[_0x0184('0x2a')][_0x0184('0x27')]({'where':{'type':_0x581746,'resourceId':_0x314c43['id']}})['then'](function(){return _0x13dd5b;});})[_0x0184('0x28')](function(){_0x20f16b['status'](0xcc)[_0x0184('0x2b')]();});}};}function handleEntityNotFound(_0x5b1854,_0x5c7c11){return function(_0x20e7c9){if(!_0x20e7c9){_0x5b1854[_0x0184('0x1b')](0x194);}return _0x20e7c9;};}function handleError(_0x33a4d2,_0x49b1be){_0x49b1be=_0x49b1be||0x1f4;return function(_0x8a83d9){logger[_0x0184('0x2c')](_0x8a83d9['stack']);if(_0x8a83d9['name']){delete _0x8a83d9[_0x0184('0x2d')];}_0x33a4d2[_0x0184('0x20')](_0x49b1be)['send'](_0x8a83d9);};}exports[_0x0184('0x2e')]=function(_0x47a193,_0xd35bf3){var _0x51b8d7={},_0x5e2999={},_0x15a8cc={'count':0x0,'rows':[]};var _0x2bc965=_['map'](db['Dashboard'][_0x0184('0x2f')],function(_0x13faa9){return{'name':_0x13faa9['fieldName'],'type':_0x13faa9[_0x0184('0x30')][_0x0184('0x31')]};});_0x5e2999[_0x0184('0x32')]=_[_0x0184('0x33')](_0x2bc965,_0x0184('0x2d'));_0x5e2999[_0x0184('0x34')]=_[_0x0184('0x35')](_0x47a193[_0x0184('0x34')]);_0x5e2999['filters']=_[_0x0184('0x36')](_0x5e2999['model'],_0x5e2999[_0x0184('0x34')]);_0x51b8d7[_0x0184('0x37')]=_[_0x0184('0x36')](_0x5e2999[_0x0184('0x32')],qs[_0x0184('0x38')](_0x47a193[_0x0184('0x34')][_0x0184('0x38')]));_0x51b8d7[_0x0184('0x37')]=_0x51b8d7[_0x0184('0x37')][_0x0184('0x39')]?_0x51b8d7[_0x0184('0x37')]:_0x5e2999[_0x0184('0x32')];if(!_0x47a193[_0x0184('0x34')]['hasOwnProperty'](_0x0184('0x3a'))){_0x51b8d7['limit']=qs[_0x0184('0x1f')](_0x47a193[_0x0184('0x34')]['limit']);_0x51b8d7[_0x0184('0x1e')]=qs[_0x0184('0x1e')](_0x47a193['query']['offset']);}_0x51b8d7[_0x0184('0x3b')]=qs[_0x0184('0x3c')](_0x47a193['query'][_0x0184('0x3c')]);_0x51b8d7[_0x0184('0x3d')]=qs[_0x0184('0x3e')](_[_0x0184('0x3f')](_0x47a193[_0x0184('0x34')],_0x5e2999[_0x0184('0x3e')]),_0x2bc965);if(_0x47a193[_0x0184('0x34')]['filter']){_0x51b8d7[_0x0184('0x3d')]=_['merge'](_0x51b8d7[_0x0184('0x3d')],{'$or':_[_0x0184('0x33')](_0x2bc965,function(_0x3a1dc0){if(_0x3a1dc0[_0x0184('0x30')]!==_0x0184('0x40')){var _0x292c1e={};_0x292c1e[_0x3a1dc0['name']]={'$like':'%'+_0x47a193[_0x0184('0x34')][_0x0184('0x41')]+'%'};return _0x292c1e;}})});}_0x51b8d7=_[_0x0184('0x42')]({},_0x51b8d7,_0x47a193[_0x0184('0x43')]);var _0x28dc98={'where':_0x51b8d7['where']};return db['Dashboard'][_0x0184('0x1d')](_0x28dc98)[_0x0184('0x28')](function(_0x1673e8){_0x15a8cc['count']=_0x1673e8;if(_0x47a193['query']['includeAll']){_0x51b8d7['include']=[{'all':!![]}];}return db[_0x0184('0x44')][_0x0184('0x45')](_0x51b8d7);})[_0x0184('0x28')](function(_0x227eb2){_0x15a8cc['rows']=_0x227eb2;return _0x15a8cc;})[_0x0184('0x28')](respondWithFilteredResult(_0xd35bf3,_0x51b8d7))['catch'](handleError(_0xd35bf3,null));};exports[_0x0184('0x46')]=function(_0x3fffc4,_0x1d9a04){var _0xcd0290={'raw':![],'where':{'id':_0x3fffc4['params']['id']}},_0x568146={};_0x568146['model']=_['keys'](db['Dashboard'][_0x0184('0x2f')]);_0x568146['query']=_[_0x0184('0x35')](_0x3fffc4[_0x0184('0x34')]);_0x568146[_0x0184('0x3e')]=_[_0x0184('0x36')](_0x568146[_0x0184('0x32')],_0x568146[_0x0184('0x34')]);_0xcd0290[_0x0184('0x37')]=_[_0x0184('0x36')](_0x568146['model'],qs[_0x0184('0x38')](_0x3fffc4[_0x0184('0x34')][_0x0184('0x38')]));_0xcd0290['attributes']=_0xcd0290['attributes']['length']?_0xcd0290[_0x0184('0x37')]:_0x568146[_0x0184('0x32')];if(_0x3fffc4[_0x0184('0x34')][_0x0184('0x47')]){_0xcd0290['include']=[{'all':!![]}];}_0xcd0290=_[_0x0184('0x42')]({},_0xcd0290,_0x3fffc4[_0x0184('0x43')]);return db[_0x0184('0x44')][_0x0184('0x48')](_0xcd0290)[_0x0184('0x28')](handleEntityNotFound(_0x1d9a04,null))[_0x0184('0x28')](respondWithResult(_0x1d9a04,null))['catch'](handleError(_0x1d9a04,null));};exports[_0x0184('0x49')]=function(_0x47940c,_0x17262e){return db[_0x0184('0x44')][_0x0184('0x49')](_0x47940c[_0x0184('0x4a')],{})[_0x0184('0x28')](function(_0x3122a4){var _0x39a8b4=_0x47940c[_0x0184('0x4b')]['get']({'plain':!![]});if(!_0x39a8b4)throw new Error(_0x0184('0x4c'));if(_0x39a8b4[_0x0184('0x4d')]===_0x0184('0x4b')){var _0x2be3dc=_0x3122a4['get']({'plain':!![]});var _0x59e5b0=_0x0184('0x4e');return db[_0x0184('0x4f')][_0x0184('0x48')]({'where':{'name':_0x59e5b0,'userProfileId':_0x39a8b4[_0x0184('0x50')]},'raw':!![]})[_0x0184('0x28')](function(_0x39dc79){if(_0x39dc79&&_0x39dc79[_0x0184('0x51')]===0x0){return db[_0x0184('0x2a')][_0x0184('0x49')]({'name':_0x2be3dc[_0x0184('0x2d')],'resourceId':_0x2be3dc['id'],'type':_0x39dc79[_0x0184('0x2d')],'sectionId':_0x39dc79['id']},{})['then'](function(){return _0x3122a4;});}else{return _0x3122a4;}})[_0x0184('0x52')](function(_0x1e9d08){logger[_0x0184('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e9d08);throw _0x1e9d08;});}return _0x3122a4;})[_0x0184('0x28')](respondWithResult(_0x17262e,0xc9))['catch'](handleError(_0x17262e,null));};exports[_0x0184('0x53')]=function(_0x1537cb,_0x34b011){var _0x1af623={'where':{'id':_0x1537cb['params']['id']}},_0x1d0a75={};_0x1d0a75[_0x0184('0x32')]=_[_0x0184('0x35')](db[_0x0184('0x44')]['rawAttributes']);_0x1af623[_0x0184('0x37')]=_[_0x0184('0x36')](_0x1d0a75[_0x0184('0x32')],qs[_0x0184('0x38')](_0x1537cb[_0x0184('0x34')][_0x0184('0x38')]));_0x1af623['attributes']=_0x1af623[_0x0184('0x37')]['length']?_0x1af623[_0x0184('0x37')]:_0x1d0a75['model'];if(_0x1537cb[_0x0184('0x34')]['includeAll']){_0x1af623[_0x0184('0x54')]=[{'all':!![]}];}_0x1af623=_[_0x0184('0x42')]({},_0x1af623,_0x1537cb[_0x0184('0x43')]);return db[_0x0184('0x44')][_0x0184('0x48')](_0x1af623)[_0x0184('0x28')](handleEntityNotFound(_0x34b011,null))[_0x0184('0x28')](function(_0x1b6cbb){if(_0x1b6cbb){var _0x32a736=_0x1b6cbb[_0x0184('0x29')]({'plain':!![]});_0x32a736=qs[_0x0184('0x55')](_0x32a736,['id',_0x0184('0x56'),_0x0184('0x57')]);_0x1537cb[_0x0184('0x4a')]=_[_0x0184('0x55')](_0x1537cb[_0x0184('0x4a')],['id',_0x0184('0x56'),'updatedAt']);return db[_0x0184('0x44')][_0x0184('0x49')](_[_0x0184('0x42')](_0x32a736,_0x1537cb['body']),{'include':_0x1537cb['query'][_0x0184('0x47')]?[{'all':!![]}]:undefined})[_0x0184('0x28')](function(_0x282720){var _0x246158=_0x1537cb['user'][_0x0184('0x29')]({'plain':!![]});if(!_0x246158)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x246158[_0x0184('0x4d')]===_0x0184('0x4b')){var _0x1b8790=_0x282720[_0x0184('0x29')]({'plain':!![]});var _0x31b49d='CustomDashboards';return db[_0x0184('0x4f')]['find']({'where':{'name':_0x31b49d,'userProfileId':_0x246158['userProfileId']},'raw':!![]})[_0x0184('0x28')](function(_0x14ed46){if(_0x14ed46&&_0x14ed46['autoAssociation']===0x0){return db['UserProfileResource'][_0x0184('0x49')]({'name':_0x1b8790[_0x0184('0x2d')],'resourceId':_0x1b8790['id'],'type':_0x14ed46[_0x0184('0x2d')],'sectionId':_0x14ed46['id']},{})[_0x0184('0x28')](function(){return _0x282720;});}else{return _0x282720;}})[_0x0184('0x52')](function(_0x14c05b){logger[_0x0184('0x2c')](_0x0184('0x58'),_0x14c05b);throw _0x14c05b;});}return _0x282720;});}})['then'](respondWithResult(_0x34b011,0xc9))['catch'](handleError(_0x34b011,null));};exports[_0x0184('0x26')]=function(_0x41ea24,_0x5772d6){if(_0x41ea24[_0x0184('0x4a')]['id']){delete _0x41ea24[_0x0184('0x4a')]['id'];}return db['Dashboard'][_0x0184('0x48')]({'where':{'id':_0x41ea24[_0x0184('0x59')]['id']}})['then'](handleEntityNotFound(_0x5772d6,null))['then'](saveUpdates(_0x41ea24[_0x0184('0x4a')],null))['then'](respondWithResult(_0x5772d6,null))[_0x0184('0x52')](handleError(_0x5772d6,null));};exports[_0x0184('0x27')]=function(_0xd0322f,_0x4a08ae){return db[_0x0184('0x44')][_0x0184('0x48')]({'where':{'id':_0xd0322f[_0x0184('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a08ae,null))['then'](removeEntity(_0x4a08ae,null))['catch'](handleError(_0x4a08ae,null));};function widgetAttributes(_0x35925d){try{switch(_0x35925d[_0x0184('0x30')]){case'iframe':return[{'name':_0x0184('0x5a'),'value':_0x35925d['attrUrl']||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d[_0x0184('0x5b')][0x0][_0x0184('0x5c')]:undefined)||_0x0184('0x5d')}];case _0x0184('0x5e'):return[{'name':_0x0184('0x5f'),'value':_0x35925d[_0x0184('0x5f')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d['attrs'][0x0][_0x0184('0x5c')]:undefined)||''}];case _0x0184('0x60'):return[{'name':'attrHourFormat','value':_0x35925d[_0x0184('0x61')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d[_0x0184('0x5b')][0x0][_0x0184('0x5c')]:undefined)||_0x0184('0x62')},{'name':_0x0184('0x63'),'value':_0x35925d[_0x0184('0x63')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x1]?_0x35925d[_0x0184('0x5b')][0x1][_0x0184('0x5c')]:undefined)||'0.00'},{'name':_0x0184('0x64'),'value':_0x35925d[_0x0184('0x64')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d['attrs'][0x2]?_0x35925d[_0x0184('0x5b')][0x2][_0x0184('0x5c')]:undefined)||0xc}];case'counter':return[{'name':_0x0184('0x65'),'value':_0x35925d[_0x0184('0x65')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d[_0x0184('0x5b')][0x0][_0x0184('0x5c')]:undefined)||_0x0184('0x66')},{'name':_0x0184('0x67'),'value':_0x35925d['attrVoiceQueues']||(_0x35925d[_0x0184('0x5b')]&&_0x35925d['attrs'][0x1]?_0x35925d['attrs'][0x1]['value']:undefined)||[]},{'name':_0x0184('0x64'),'value':_0x35925d['attrFontSize']||(_0x35925d[_0x0184('0x5b')]&&_0x35925d['attrs'][0x2]?_0x35925d[_0x0184('0x5b')][0x2][_0x0184('0x5c')]:undefined)||0x14}];case _0x0184('0x68'):case _0x0184('0x69'):return[{'name':'attrSerie1','value':_0x35925d[_0x0184('0x6a')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d[_0x0184('0x5b')][0x0][_0x0184('0x5c')]:undefined)||_0x0184('0x66')},{'name':'attrSerie2','value':_0x35925d['attrSerie2']||(_0x35925d[_0x0184('0x5b')]&&_0x35925d['attrs'][0x1]?_0x35925d[_0x0184('0x5b')][0x1][_0x0184('0x5c')]:undefined)||null},{'name':'attrSerie3','value':_0x35925d[_0x0184('0x6b')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d['attrs'][0x2]?_0x35925d[_0x0184('0x5b')][0x2][_0x0184('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x35925d[_0x0184('0x67')]||(_0x35925d['attrs']&&_0x35925d[_0x0184('0x5b')][0x3]?_0x35925d[_0x0184('0x5b')][0x3][_0x0184('0x5c')]:undefined)||[]}];case _0x0184('0x6c'):return[{'name':_0x0184('0x6d'),'type':_0x35925d['reportType']||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d[_0x0184('0x5b')][0x0][_0x0184('0x30')]:undefined)||null,'value':_0x35925d[_0x0184('0x6d')]||(_0x35925d['attrs']&&_0x35925d[_0x0184('0x5b')][0x0]?_0x35925d['attrs'][0x0][_0x0184('0x5c')]:undefined)||null},{'name':_0x0184('0x6e'),'value':_0x35925d[_0x0184('0x6e')]||(_0x35925d[_0x0184('0x5b')]&&_0x35925d[_0x0184('0x5b')][0x1]?_0x35925d['attrs'][0x1][_0x0184('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2bc80c){logger[_0x0184('0x2c')]('widgetAttributes:\x20%s',JSON[_0x0184('0x6f')](_0x2bc80c));return[];}}exports[_0x0184('0x70')]=function(_0x563cd4,_0x432072,_0x2c4579){if(_0x563cd4[_0x0184('0x4a')]['id']){delete _0x563cd4['body']['id'];}return db[_0x0184('0x44')][_0x0184('0x48')]({'where':{'id':_0x563cd4[_0x0184('0x59')]['id']}})[_0x0184('0x28')](handleEntityNotFound(_0x432072,null))['then'](function(_0x1d9faa){if(_0x1d9faa){_0x563cd4[_0x0184('0x4a')]['DashboardId']=_0x1d9faa['id'];_0x563cd4['body'][_0x0184('0x5b')]=widgetAttributes(_0x563cd4[_0x0184('0x4a')]);return db[_0x0184('0x71')][_0x0184('0x49')](_0x563cd4['body']);}})[_0x0184('0x28')](respondWithResult(_0x432072,null))[_0x0184('0x52')](handleError(_0x432072,null));};exports[_0x0184('0x72')]=function(_0x14687c,_0x2714e3,_0x2f94f3){var _0xcc6923={};var _0x507747={};var _0x20fb9d;var _0x431e83;return db[_0x0184('0x44')][_0x0184('0x73')]({'where':{'id':_0x14687c['params']['id']}})['then'](handleEntityNotFound(_0x2714e3,null))[_0x0184('0x28')](function(_0x4a3cf4){if(_0x4a3cf4){_0x20fb9d=_0x4a3cf4;_0x507747['model']=_['keys'](db[_0x0184('0x71')][_0x0184('0x2f')]);_0x507747[_0x0184('0x34')]=_[_0x0184('0x35')](_0x14687c[_0x0184('0x34')]);_0x507747['filters']=_['intersection'](_0x507747['model'],_0x507747[_0x0184('0x34')]);_0xcc6923[_0x0184('0x37')]=_[_0x0184('0x36')](_0x507747[_0x0184('0x32')],qs[_0x0184('0x38')](_0x14687c[_0x0184('0x34')][_0x0184('0x38')]));_0xcc6923[_0x0184('0x37')]=_0xcc6923[_0x0184('0x37')][_0x0184('0x39')]?_0xcc6923[_0x0184('0x37')]:_0x507747[_0x0184('0x32')];_0xcc6923[_0x0184('0x3b')]=qs['sort'](_0x14687c['query'][_0x0184('0x3c')]);_0xcc6923[_0x0184('0x3d')]=qs['filters'](_['pick'](_0x14687c[_0x0184('0x34')],_0x507747['filters']));if(_0x14687c[_0x0184('0x34')][_0x0184('0x41')]){_0xcc6923[_0x0184('0x3d')]=_[_0x0184('0x42')](_0xcc6923[_0x0184('0x3d')],{'$or':_[_0x0184('0x33')](_0xcc6923[_0x0184('0x37')],function(_0x5d7fa7){var _0x124d31={};_0x124d31[_0x5d7fa7]={'$like':'%'+_0x14687c[_0x0184('0x34')]['filter']+'%'};return _0x124d31;})});}_0xcc6923=_[_0x0184('0x42')]({},_0xcc6923,_0x14687c[_0x0184('0x43')]);return _0x20fb9d[_0x0184('0x72')](_0xcc6923);}})[_0x0184('0x28')](function(_0x4e276b){if(_0x4e276b){_0x431e83=_0x4e276b['length'];if(!_0x14687c[_0x0184('0x34')]['hasOwnProperty'](_0x0184('0x3a'))){_0xcc6923[_0x0184('0x1f')]=qs['limit'](_0x14687c['query'][_0x0184('0x1f')]);_0xcc6923[_0x0184('0x1e')]=qs[_0x0184('0x1e')](_0x14687c[_0x0184('0x34')][_0x0184('0x1e')]);}return _0x20fb9d[_0x0184('0x72')](_0xcc6923);}})[_0x0184('0x28')](function(_0xd81298){if(_0xd81298){return _0xd81298?{'count':_0x431e83,'rows':_0xd81298}:null;}})['then'](respondWithResult(_0x2714e3,null))[_0x0184('0x52')](handleError(_0x2714e3,null));}; \ No newline at end of file +var _0xd656=['../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','createdAt','omit','updatedAt','autoAssociation','attrUrl','attrs','value','attrPath','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x52dbd1,_0xe46f69){var _0x58c76a=function(_0x35bff0){while(--_0x35bff0){_0x52dbd1['push'](_0x52dbd1['shift']());}};_0x58c76a(++_0xe46f69);}(_0xd656,0xd1));var _0x6d65=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd656[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x6d65('0x0'));var emlformat=require(_0x6d65('0x1'));var rimraf=require(_0x6d65('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d65('0x3'));var rp=require(_0x6d65('0x4'));var moment=require(_0x6d65('0x5'));var BPromise=require(_0x6d65('0x6'));var Mustache=require('mustache');var util=require(_0x6d65('0x7'));var path=require(_0x6d65('0x8'));var sox=require(_0x6d65('0x9'));var csv=require(_0x6d65('0xa'));var ejs=require(_0x6d65('0xb'));var fs=require('fs');var _=require(_0x6d65('0xc'));var squel=require(_0x6d65('0xd'));var crypto=require(_0x6d65('0xe'));var jsforce=require(_0x6d65('0xf'));var deskjs=require(_0x6d65('0x10'));var toCsv=require(_0x6d65('0xa'));var querystring=require(_0x6d65('0x11'));var Papa=require('papaparse');var Redis=require(_0x6d65('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d65('0x13'));var hardwareService=require(_0x6d65('0x14'));var logger=require('../../config/logger')(_0x6d65('0x15'));var utils=require(_0x6d65('0x16'));var config=require(_0x6d65('0x17'));var db=require('../../mysqldb')['db'];config[_0x6d65('0x18')]=_[_0x6d65('0x19')](config[_0x6d65('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d65('0x1a'))(new Redis(config['redis']));require('./dashboard.socket')[_0x6d65('0x1b')](socket);function respondWithStatusCode(_0x5e7ef7,_0x4e911c){_0x4e911c=_0x4e911c||0xcc;return function(_0x1aaafa){if(_0x1aaafa){return _0x5e7ef7[_0x6d65('0x1c')](_0x4e911c);}return _0x5e7ef7[_0x6d65('0x1d')](_0x4e911c)[_0x6d65('0x1e')]();};}function respondWithResult(_0x35c890,_0x36b128){_0x36b128=_0x36b128||0xc8;return function(_0x149645){if(_0x149645){return _0x35c890[_0x6d65('0x1d')](_0x36b128)[_0x6d65('0x1f')](_0x149645);}};}function respondWithFilteredResult(_0x21ec95,_0x24b184){return function(_0x403957){if(_0x403957){var _0x1a938d=_0x403957[_0x6d65('0x20')],_0x5b0472=_0x24b184['offset'],_0xfbaf35=_0x24b184[_0x6d65('0x21')]+_0x24b184[_0x6d65('0x22')],_0x330c35;if(_0xfbaf35>=_0x1a938d){_0xfbaf35=_0x1a938d;_0x330c35=0xc8;}else{_0x330c35=0xce;}_0x21ec95[_0x6d65('0x1d')](_0x330c35);return _0x21ec95[_0x6d65('0x23')](_0x6d65('0x24'),_0x5b0472+'-'+_0xfbaf35+'/'+_0x1a938d)[_0x6d65('0x1f')](_0x403957);}return null;};}function patchUpdates(_0x57162f){return function(_0x21b2cd){try{jsonpatch[_0x6d65('0x25')](_0x21b2cd,_0x57162f,!![]);}catch(_0x5c0cb4){return BPromise[_0x6d65('0x26')](_0x5c0cb4);}return _0x21b2cd['save']();};}function saveUpdates(_0x3127c8,_0xfbb8de){return function(_0x4238cc){if(_0x4238cc){return _0x4238cc[_0x6d65('0x27')](_0x3127c8)['then'](function(_0x4f1743){return _0x4f1743;});}return null;};}function removeEntity(_0x55a9b,_0xdeb1cd){return function(_0x182b03){if(_0x182b03){return _0x182b03[_0x6d65('0x28')]()[_0x6d65('0x29')](function(){var _0xa39280=_0x182b03[_0x6d65('0x2a')]({'plain':!![]});var _0x145992=_0x6d65('0x2b');return db[_0x6d65('0x2c')][_0x6d65('0x28')]({'where':{'type':_0x145992,'resourceId':_0xa39280['id']}})['then'](function(){return _0x182b03;});})[_0x6d65('0x29')](function(){_0x55a9b[_0x6d65('0x1d')](0xcc)[_0x6d65('0x1e')]();});}};}function handleEntityNotFound(_0x11c54b,_0x285173){return function(_0x37699a){if(!_0x37699a){_0x11c54b[_0x6d65('0x1c')](0x194);}return _0x37699a;};}function handleError(_0x509fd3,_0xf828a6){_0xf828a6=_0xf828a6||0x1f4;return function(_0x152b0c){logger[_0x6d65('0x2d')](_0x152b0c[_0x6d65('0x2e')]);if(_0x152b0c['name']){delete _0x152b0c[_0x6d65('0x2f')];}_0x509fd3[_0x6d65('0x1d')](_0xf828a6)[_0x6d65('0x30')](_0x152b0c);};}exports[_0x6d65('0x31')]=function(_0x57bd05,_0x112cca){var _0x1fa2cc={},_0x5e40d7={},_0x4c1016={'count':0x0,'rows':[]};var _0x45c813=_['map'](db[_0x6d65('0x32')][_0x6d65('0x33')],function(_0x107fb0){return{'name':_0x107fb0[_0x6d65('0x34')],'type':_0x107fb0[_0x6d65('0x35')][_0x6d65('0x36')]};});_0x5e40d7[_0x6d65('0x37')]=_[_0x6d65('0x38')](_0x45c813,_0x6d65('0x2f'));_0x5e40d7[_0x6d65('0x39')]=_['keys'](_0x57bd05[_0x6d65('0x39')]);_0x5e40d7[_0x6d65('0x3a')]=_[_0x6d65('0x3b')](_0x5e40d7[_0x6d65('0x37')],_0x5e40d7['query']);_0x1fa2cc[_0x6d65('0x3c')]=_[_0x6d65('0x3b')](_0x5e40d7[_0x6d65('0x37')],qs['fields'](_0x57bd05['query'][_0x6d65('0x3d')]));_0x1fa2cc[_0x6d65('0x3c')]=_0x1fa2cc[_0x6d65('0x3c')]['length']?_0x1fa2cc[_0x6d65('0x3c')]:_0x5e40d7['model'];if(!_0x57bd05[_0x6d65('0x39')][_0x6d65('0x3e')](_0x6d65('0x3f'))){_0x1fa2cc[_0x6d65('0x22')]=qs[_0x6d65('0x22')](_0x57bd05[_0x6d65('0x39')][_0x6d65('0x22')]);_0x1fa2cc['offset']=qs[_0x6d65('0x21')](_0x57bd05[_0x6d65('0x39')][_0x6d65('0x21')]);}_0x1fa2cc[_0x6d65('0x40')]=qs[_0x6d65('0x41')](_0x57bd05['query'][_0x6d65('0x41')]);_0x1fa2cc['where']=qs[_0x6d65('0x3a')](_[_0x6d65('0x42')](_0x57bd05[_0x6d65('0x39')],_0x5e40d7[_0x6d65('0x3a')]),_0x45c813);if(_0x57bd05[_0x6d65('0x39')][_0x6d65('0x43')]){_0x1fa2cc['where']=_[_0x6d65('0x44')](_0x1fa2cc[_0x6d65('0x45')],{'$or':_[_0x6d65('0x38')](_0x45c813,function(_0x4d647d){if(_0x4d647d['type']!==_0x6d65('0x46')){var _0x31067a={};_0x31067a[_0x4d647d['name']]={'$like':'%'+_0x57bd05[_0x6d65('0x39')]['filter']+'%'};return _0x31067a;}})});}_0x1fa2cc=_[_0x6d65('0x44')]({},_0x1fa2cc,_0x57bd05[_0x6d65('0x47')]);var _0x261a43={'where':_0x1fa2cc[_0x6d65('0x45')]};return db[_0x6d65('0x32')][_0x6d65('0x20')](_0x261a43)[_0x6d65('0x29')](function(_0x42cd3f){_0x4c1016[_0x6d65('0x20')]=_0x42cd3f;if(_0x57bd05[_0x6d65('0x39')][_0x6d65('0x48')]){_0x1fa2cc[_0x6d65('0x49')]=[{'all':!![]}];}return db[_0x6d65('0x32')][_0x6d65('0x4a')](_0x1fa2cc);})[_0x6d65('0x29')](function(_0x1fbf55){_0x4c1016[_0x6d65('0x4b')]=_0x1fbf55;return _0x4c1016;})[_0x6d65('0x29')](respondWithFilteredResult(_0x112cca,_0x1fa2cc))[_0x6d65('0x4c')](handleError(_0x112cca,null));};exports['show']=function(_0x320155,_0x8ef7ae){var _0x2bcaf0={'raw':![],'where':{'id':_0x320155[_0x6d65('0x4d')]['id']}},_0x41a125={};_0x41a125[_0x6d65('0x37')]=_[_0x6d65('0x4e')](db[_0x6d65('0x32')][_0x6d65('0x33')]);_0x41a125[_0x6d65('0x39')]=_[_0x6d65('0x4e')](_0x320155[_0x6d65('0x39')]);_0x41a125[_0x6d65('0x3a')]=_[_0x6d65('0x3b')](_0x41a125[_0x6d65('0x37')],_0x41a125[_0x6d65('0x39')]);_0x2bcaf0[_0x6d65('0x3c')]=_['intersection'](_0x41a125[_0x6d65('0x37')],qs[_0x6d65('0x3d')](_0x320155[_0x6d65('0x39')][_0x6d65('0x3d')]));_0x2bcaf0[_0x6d65('0x3c')]=_0x2bcaf0['attributes'][_0x6d65('0x4f')]?_0x2bcaf0[_0x6d65('0x3c')]:_0x41a125[_0x6d65('0x37')];if(_0x320155[_0x6d65('0x39')][_0x6d65('0x48')]){_0x2bcaf0[_0x6d65('0x49')]=[{'all':!![]}];}_0x2bcaf0=_[_0x6d65('0x44')]({},_0x2bcaf0,_0x320155['options']);return db['Dashboard']['find'](_0x2bcaf0)[_0x6d65('0x29')](handleEntityNotFound(_0x8ef7ae,null))[_0x6d65('0x29')](respondWithResult(_0x8ef7ae,null))['catch'](handleError(_0x8ef7ae,null));};exports[_0x6d65('0x50')]=function(_0x2347bd,_0x393ca8){return db['Dashboard'][_0x6d65('0x50')](_0x2347bd[_0x6d65('0x51')],{})[_0x6d65('0x29')](function(_0x2e8244){var _0x54b1a1=_0x2347bd[_0x6d65('0x52')][_0x6d65('0x2a')]({'plain':!![]});if(!_0x54b1a1)throw new Error(_0x6d65('0x53'));if(_0x54b1a1[_0x6d65('0x54')]===_0x6d65('0x52')){var _0x2c2da7=_0x2e8244[_0x6d65('0x2a')]({'plain':!![]});var _0x243fbc=_0x6d65('0x2b');return db[_0x6d65('0x55')]['find']({'where':{'name':_0x243fbc,'userProfileId':_0x54b1a1[_0x6d65('0x56')]},'raw':!![]})[_0x6d65('0x29')](function(_0x39ec40){if(_0x39ec40&&_0x39ec40['autoAssociation']===0x0){return db[_0x6d65('0x2c')][_0x6d65('0x50')]({'name':_0x2c2da7[_0x6d65('0x2f')],'resourceId':_0x2c2da7['id'],'type':_0x39ec40[_0x6d65('0x2f')],'sectionId':_0x39ec40['id']},{})[_0x6d65('0x29')](function(){return _0x2e8244;});}else{return _0x2e8244;}})[_0x6d65('0x4c')](function(_0x359a5a){logger[_0x6d65('0x2d')](_0x6d65('0x57'),_0x359a5a);throw _0x359a5a;});}return _0x2e8244;})[_0x6d65('0x29')](respondWithResult(_0x393ca8,0xc9))[_0x6d65('0x4c')](handleError(_0x393ca8,null));};exports['clone']=function(_0x406793,_0x3ad970){var _0x4123d6={'where':{'id':_0x406793[_0x6d65('0x4d')]['id']}},_0x5a0660={};_0x5a0660[_0x6d65('0x37')]=_[_0x6d65('0x4e')](db[_0x6d65('0x32')][_0x6d65('0x33')]);_0x4123d6[_0x6d65('0x3c')]=_[_0x6d65('0x3b')](_0x5a0660[_0x6d65('0x37')],qs[_0x6d65('0x3d')](_0x406793[_0x6d65('0x39')][_0x6d65('0x3d')]));_0x4123d6[_0x6d65('0x3c')]=_0x4123d6[_0x6d65('0x3c')][_0x6d65('0x4f')]?_0x4123d6[_0x6d65('0x3c')]:_0x5a0660[_0x6d65('0x37')];if(_0x406793[_0x6d65('0x39')][_0x6d65('0x48')]){_0x4123d6[_0x6d65('0x49')]=[{'all':!![]}];}_0x4123d6=_[_0x6d65('0x44')]({},_0x4123d6,_0x406793['options']);return db['Dashboard'][_0x6d65('0x58')](_0x4123d6)['then'](handleEntityNotFound(_0x3ad970,null))['then'](function(_0x5d8f27){if(_0x5d8f27){var _0x391577=_0x5d8f27[_0x6d65('0x2a')]({'plain':!![]});_0x391577=qs['omit'](_0x391577,['id',_0x6d65('0x59'),'updatedAt']);_0x406793[_0x6d65('0x51')]=_[_0x6d65('0x5a')](_0x406793[_0x6d65('0x51')],['id','createdAt',_0x6d65('0x5b')]);return db[_0x6d65('0x32')][_0x6d65('0x50')](_[_0x6d65('0x44')](_0x391577,_0x406793['body']),{'include':_0x406793['query']['includeAll']?[{'all':!![]}]:undefined})[_0x6d65('0x29')](function(_0xa9c58){var _0x801fb9=_0x406793[_0x6d65('0x52')][_0x6d65('0x2a')]({'plain':!![]});if(!_0x801fb9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x801fb9[_0x6d65('0x54')]===_0x6d65('0x52')){var _0x136c48=_0xa9c58[_0x6d65('0x2a')]({'plain':!![]});var _0x5bc206=_0x6d65('0x2b');return db['UserProfileSection'][_0x6d65('0x58')]({'where':{'name':_0x5bc206,'userProfileId':_0x801fb9[_0x6d65('0x56')]},'raw':!![]})[_0x6d65('0x29')](function(_0x256e67){if(_0x256e67&&_0x256e67[_0x6d65('0x5c')]===0x0){return db['UserProfileResource'][_0x6d65('0x50')]({'name':_0x136c48[_0x6d65('0x2f')],'resourceId':_0x136c48['id'],'type':_0x256e67[_0x6d65('0x2f')],'sectionId':_0x256e67['id']},{})[_0x6d65('0x29')](function(){return _0xa9c58;});}else{return _0xa9c58;}})[_0x6d65('0x4c')](function(_0xfda722){logger[_0x6d65('0x2d')](_0x6d65('0x57'),_0xfda722);throw _0xfda722;});}return _0xa9c58;});}})[_0x6d65('0x29')](respondWithResult(_0x3ad970,0xc9))['catch'](handleError(_0x3ad970,null));};exports[_0x6d65('0x27')]=function(_0x72d726,_0x430eca){if(_0x72d726[_0x6d65('0x51')]['id']){delete _0x72d726[_0x6d65('0x51')]['id'];}return db[_0x6d65('0x32')][_0x6d65('0x58')]({'where':{'id':_0x72d726[_0x6d65('0x4d')]['id']}})['then'](handleEntityNotFound(_0x430eca,null))['then'](saveUpdates(_0x72d726['body'],null))['then'](respondWithResult(_0x430eca,null))[_0x6d65('0x4c')](handleError(_0x430eca,null));};exports[_0x6d65('0x28')]=function(_0x58c65d,_0x14a882){return db[_0x6d65('0x32')][_0x6d65('0x58')]({'where':{'id':_0x58c65d[_0x6d65('0x4d')]['id']}})[_0x6d65('0x29')](handleEntityNotFound(_0x14a882,null))['then'](removeEntity(_0x14a882,null))['catch'](handleError(_0x14a882,null));};function widgetAttributes(_0x288df3){try{switch(_0x288df3['type']){case'iframe':return[{'name':_0x6d65('0x5d'),'value':_0x288df3[_0x6d65('0x5d')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3[_0x6d65('0x5e')][0x0][_0x6d65('0x5f')]:undefined)||'https://'}];case'custom':return[{'name':_0x6d65('0x60'),'value':_0x288df3[_0x6d65('0x60')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3['attrs'][0x0]?_0x288df3[_0x6d65('0x5e')][0x0][_0x6d65('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x6d65('0x61'),'value':_0x288df3[_0x6d65('0x61')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3[_0x6d65('0x5e')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x6d65('0x62'),'value':_0x288df3[_0x6d65('0x62')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3['attrs'][0x1]?_0x288df3[_0x6d65('0x5e')][0x1]['value']:undefined)||'0.00'},{'name':_0x6d65('0x63'),'value':_0x288df3[_0x6d65('0x63')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x2]?_0x288df3[_0x6d65('0x5e')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x288df3[_0x6d65('0x64')]||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3[_0x6d65('0x5e')][0x0][_0x6d65('0x5f')]:undefined)||_0x6d65('0x65')},{'name':_0x6d65('0x66'),'value':_0x288df3['attrVoiceQueues']||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x1]?_0x288df3[_0x6d65('0x5e')][0x1]['value']:undefined)||[]},{'name':_0x6d65('0x63'),'value':_0x288df3[_0x6d65('0x63')]||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x2]?_0x288df3[_0x6d65('0x5e')][0x2][_0x6d65('0x5f')]:undefined)||0x14}];case _0x6d65('0x67'):case _0x6d65('0x68'):return[{'name':_0x6d65('0x69'),'value':_0x288df3[_0x6d65('0x69')]||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3['attrs'][0x0][_0x6d65('0x5f')]:undefined)||'total'},{'name':_0x6d65('0x6a'),'value':_0x288df3[_0x6d65('0x6a')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x1]?_0x288df3[_0x6d65('0x5e')][0x1][_0x6d65('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x288df3[_0x6d65('0x6b')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x2]?_0x288df3['attrs'][0x2][_0x6d65('0x5f')]:undefined)||null},{'name':_0x6d65('0x66'),'value':_0x288df3[_0x6d65('0x66')]||(_0x288df3[_0x6d65('0x5e')]&&_0x288df3[_0x6d65('0x5e')][0x3]?_0x288df3[_0x6d65('0x5e')][0x3][_0x6d65('0x5f')]:undefined)||[]}];case _0x6d65('0x6c'):return[{'name':_0x6d65('0x6d'),'type':_0x288df3['reportType']||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3[_0x6d65('0x5e')][0x0][_0x6d65('0x35')]:undefined)||null,'value':_0x288df3[_0x6d65('0x6d')]||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x0]?_0x288df3[_0x6d65('0x5e')][0x0]['value']:undefined)||null},{'name':_0x6d65('0x6e'),'value':_0x288df3[_0x6d65('0x6e')]||(_0x288df3['attrs']&&_0x288df3[_0x6d65('0x5e')][0x1]?_0x288df3[_0x6d65('0x5e')][0x1][_0x6d65('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2e64a7){logger['error'](_0x6d65('0x6f'),JSON[_0x6d65('0x70')](_0x2e64a7));return[];}}exports['addItem']=function(_0x492ca4,_0x85fd46,_0xc68e98){if(_0x492ca4['body']['id']){delete _0x492ca4[_0x6d65('0x51')]['id'];}return db[_0x6d65('0x32')][_0x6d65('0x58')]({'where':{'id':_0x492ca4[_0x6d65('0x4d')]['id']}})[_0x6d65('0x29')](handleEntityNotFound(_0x85fd46,null))[_0x6d65('0x29')](function(_0xa7bdc8){if(_0xa7bdc8){_0x492ca4['body'][_0x6d65('0x71')]=_0xa7bdc8['id'];_0x492ca4[_0x6d65('0x51')]['attrs']=widgetAttributes(_0x492ca4[_0x6d65('0x51')]);return db[_0x6d65('0x72')][_0x6d65('0x50')](_0x492ca4[_0x6d65('0x51')]);}})['then'](respondWithResult(_0x85fd46,null))[_0x6d65('0x4c')](handleError(_0x85fd46,null));};exports['getItems']=function(_0x1c35ca,_0x54cca7,_0x314cab){var _0x21b944={};var _0x987fb1={};var _0x52d69f;var _0x31ec8e;return db[_0x6d65('0x32')]['findOne']({'where':{'id':_0x1c35ca[_0x6d65('0x4d')]['id']}})[_0x6d65('0x29')](handleEntityNotFound(_0x54cca7,null))[_0x6d65('0x29')](function(_0x28a761){if(_0x28a761){_0x52d69f=_0x28a761;_0x987fb1[_0x6d65('0x37')]=_['keys'](db[_0x6d65('0x72')]['rawAttributes']);_0x987fb1[_0x6d65('0x39')]=_[_0x6d65('0x4e')](_0x1c35ca['query']);_0x987fb1[_0x6d65('0x3a')]=_['intersection'](_0x987fb1[_0x6d65('0x37')],_0x987fb1[_0x6d65('0x39')]);_0x21b944['attributes']=_[_0x6d65('0x3b')](_0x987fb1[_0x6d65('0x37')],qs[_0x6d65('0x3d')](_0x1c35ca['query']['fields']));_0x21b944[_0x6d65('0x3c')]=_0x21b944[_0x6d65('0x3c')]['length']?_0x21b944[_0x6d65('0x3c')]:_0x987fb1[_0x6d65('0x37')];_0x21b944[_0x6d65('0x40')]=qs[_0x6d65('0x41')](_0x1c35ca['query'][_0x6d65('0x41')]);_0x21b944['where']=qs[_0x6d65('0x3a')](_['pick'](_0x1c35ca['query'],_0x987fb1[_0x6d65('0x3a')]));if(_0x1c35ca[_0x6d65('0x39')][_0x6d65('0x43')]){_0x21b944[_0x6d65('0x45')]=_[_0x6d65('0x44')](_0x21b944[_0x6d65('0x45')],{'$or':_[_0x6d65('0x38')](_0x21b944[_0x6d65('0x3c')],function(_0x4fe2c9){var _0x348c70={};_0x348c70[_0x4fe2c9]={'$like':'%'+_0x1c35ca[_0x6d65('0x39')][_0x6d65('0x43')]+'%'};return _0x348c70;})});}_0x21b944=_[_0x6d65('0x44')]({},_0x21b944,_0x1c35ca[_0x6d65('0x47')]);return _0x52d69f['getItems'](_0x21b944);}})[_0x6d65('0x29')](function(_0x20e83e){if(_0x20e83e){_0x31ec8e=_0x20e83e['length'];if(!_0x1c35ca[_0x6d65('0x39')]['hasOwnProperty'](_0x6d65('0x3f'))){_0x21b944[_0x6d65('0x22')]=qs[_0x6d65('0x22')](_0x1c35ca[_0x6d65('0x39')][_0x6d65('0x22')]);_0x21b944[_0x6d65('0x21')]=qs[_0x6d65('0x21')](_0x1c35ca[_0x6d65('0x39')][_0x6d65('0x21')]);}return _0x52d69f[_0x6d65('0x73')](_0x21b944);}})[_0x6d65('0x29')](function(_0x21f01d){if(_0x21f01d){return _0x21f01d?{'count':_0x31ec8e,'rows':_0x21f01d}:null;}})[_0x6d65('0x29')](respondWithResult(_0x54cca7,null))[_0x6d65('0x4c')](handleError(_0x54cca7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 728c942..5e19748 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 _0xa765=['exports','../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x415ff1,_0x909513){var _0x503443=function(_0x28c70c){while(--_0x28c70c){_0x415ff1['push'](_0x415ff1['shift']());}};_0x503443(++_0x909513);}(_0xa765,0x169));var _0x5a76=function(_0x2536dc,_0x3a1eaa){_0x2536dc=_0x2536dc-0x0;var _0x533d30=_0xa765[_0x2536dc];return _0x533d30;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x5a76('0x0'))['db'][_0x5a76('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5a76('0x2')](0x0);var events={'afterCreate':_0x5a76('0x3'),'afterUpdate':_0x5a76('0x4'),'afterDestroy':'remove'};function emitEvent(_0x41573d){return function(_0x1eb471,_0xe1585c,_0x1ea681){DashboardEvents[_0x5a76('0x5')](_0x41573d+':'+_0x1eb471['id'],_0x1eb471);DashboardEvents[_0x5a76('0x5')](_0x41573d,_0x1eb471);_0x1ea681(null);};}for(var e in events){if(events[_0x5a76('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5a76('0x7')]=DashboardEvents; \ No newline at end of file +var _0x1b36=['remove','hasOwnProperty','hook','events','Dashboard','setMaxListeners','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b36,0x163));var _0x61b3=function(_0x204e4f,_0x267345){_0x204e4f=_0x204e4f-0x0;var _0x204189=_0x1b36[_0x204e4f];return _0x204189;};'use strict';var EventEmitter=require(_0x61b3('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x61b3('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x61b3('0x2')](0x0);var events={'afterCreate':_0x61b3('0x3'),'afterUpdate':_0x61b3('0x4'),'afterDestroy':_0x61b3('0x5')};function emitEvent(_0x1ff221){return function(_0xcf1736,_0x53ebb0,_0x16a467){DashboardEvents['emit'](_0x1ff221+':'+_0xcf1736['id'],_0xcf1736);DashboardEvents['emit'](_0x1ff221,_0xcf1736);_0x16a467(null);};}for(var e in events){if(events[_0x61b3('0x6')](e)){var event=events[e];Dashboard[_0x61b3('0x7')](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 e9ecb32..a65b95b 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 _0x85c1=['Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x85c1,0x152));var _0x185c=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x85c1[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x185c('0x0'));var util=require(_0x185c('0x1'));var logger=require(_0x185c('0x2'))('api');var moment=require(_0x185c('0x3'));var BPromise=require(_0x185c('0x4'));var rp=require(_0x185c('0x5'));var fs=require('fs');var path=require(_0x185c('0x6'));var rimraf=require(_0x185c('0x7'));var config=require(_0x185c('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x49bc06,_0x2b26b7){return _0x49bc06[_0x185c('0x9')](_0x185c('0xa'),attributes,{'tableName':_0x185c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18d1=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./dashboard.attributes','exports','Dashboard'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x18d1,0xbe));var _0x118d=function(_0x191794,_0x312278){_0x191794=_0x191794-0x0;var _0x26ae9a=_0x18d1[_0x191794];return _0x26ae9a;};'use strict';var _=require(_0x118d('0x0'));var util=require('util');var logger=require(_0x118d('0x1'))(_0x118d('0x2'));var moment=require(_0x118d('0x3'));var BPromise=require(_0x118d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x118d('0x5'));var rimraf=require('rimraf');var config=require(_0x118d('0x6'));var attributes=require(_0x118d('0x7'));module[_0x118d('0x8')]=function(_0x5adf98,_0x2b59e5){return _0x5adf98['define'](_0x118d('0x9'),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 75998bd..c46741c 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 _0xf8ca=['../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb'];(function(_0x1adf76,_0x828c70){var _0x3ca9ec=function(_0x1aeb0e){while(--_0x1aeb0e){_0x1adf76['push'](_0x1adf76['shift']());}};_0x3ca9ec(++_0x828c70);}(_0xf8ca,0x173));var _0xaf8c=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xf8ca[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xaf8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf8c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf8c('0x2'))['db'];var utils=require(_0xaf8c('0x3'));var logger=require('../../config/logger')(_0xaf8c('0x4'));var config=require('../../config/environment');var jayson=require(_0xaf8c('0x5'));var client=jayson[_0xaf8c('0x6')]['http']({'port':0x232a});config[_0xaf8c('0x7')]=_[_0xaf8c('0x8')](config[_0xaf8c('0x7')],{'host':_0xaf8c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf8c('0x7')]));require('./dashboard.socket')[_0xaf8c('0xa')](socket);function respondWithRpcPromise(_0x45f5b4,_0x57dbae,_0x40ff8a){return new BPromise(function(_0x3d8a57,_0x3cdf07){return client[_0xaf8c('0xb')](_0x45f5b4,_0x40ff8a)[_0xaf8c('0xc')](function(_0x43849b){logger[_0xaf8c('0xd')](_0xaf8c('0xe'),_0x57dbae,_0xaf8c('0xf'));logger[_0xaf8c('0x10')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x57dbae,_0xaf8c('0xf'),JSON[_0xaf8c('0x11')](_0x43849b));if(_0x43849b[_0xaf8c('0x12')]){if(_0x43849b['error']['code']===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x57dbae,_0x43849b[_0xaf8c('0x12')][_0xaf8c('0x13')]);return _0x3cdf07(_0x43849b[_0xaf8c('0x12')]['message']);}logger[_0xaf8c('0x12')](_0xaf8c('0xe'),_0x57dbae,_0x43849b['error']['message']);return _0x3d8a57(_0x43849b[_0xaf8c('0x12')]['message']);}else{logger[_0xaf8c('0xd')](_0xaf8c('0xe'),_0x57dbae,_0xaf8c('0xf'));_0x3d8a57(_0x43849b[_0xaf8c('0x14')][_0xaf8c('0x13')]);}})[_0xaf8c('0x15')](function(_0x38503f){logger[_0xaf8c('0x12')](_0xaf8c('0xe'),_0x57dbae,_0x38503f);_0x3cdf07(_0x38503f);});});} \ No newline at end of file +var _0xe5b1=['info','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','Dashboard,\x20%s,\x20%s'];(function(_0x372fe0,_0x17716b){var _0x4eebd2=function(_0xee7acb){while(--_0xee7acb){_0x372fe0['push'](_0x372fe0['shift']());}};_0x4eebd2(++_0x17716b);}(_0xe5b1,0x1ab));var _0x1e5b=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0xe5b1[_0x36d203];return _0x2f9e62;};'use strict';var _=require(_0x1e5b('0x0'));var util=require(_0x1e5b('0x1'));var moment=require(_0x1e5b('0x2'));var BPromise=require(_0x1e5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1e5b('0x5'))(_0x1e5b('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e5b('0x7'));var client=jayson[_0x1e5b('0x8')]['http']({'port':0x232a});config[_0x1e5b('0x9')]=_[_0x1e5b('0xa')](config[_0x1e5b('0x9')],{'host':_0x1e5b('0xb'),'port':0x18eb});var socket=require(_0x1e5b('0xc'))(new Redis(config[_0x1e5b('0x9')]));require(_0x1e5b('0xd'))['register'](socket);function respondWithRpcPromise(_0x22dddd,_0x38e414,_0x34efe1){return new BPromise(function(_0x5cbc53,_0x1873b5){return client[_0x1e5b('0xe')](_0x22dddd,_0x34efe1)[_0x1e5b('0xf')](function(_0x1df7e0){logger['info']('Dashboard,\x20%s,\x20%s',_0x38e414,_0x1e5b('0x10'));logger[_0x1e5b('0x11')](_0x1e5b('0x12'),_0x38e414,_0x1e5b('0x10'),JSON['stringify'](_0x1df7e0));if(_0x1df7e0[_0x1e5b('0x13')]){if(_0x1df7e0[_0x1e5b('0x13')][_0x1e5b('0x14')]===0x1f4){logger[_0x1e5b('0x13')]('Dashboard,\x20%s,\x20%s',_0x38e414,_0x1df7e0[_0x1e5b('0x13')][_0x1e5b('0x15')]);return _0x1873b5(_0x1df7e0[_0x1e5b('0x13')][_0x1e5b('0x15')]);}logger[_0x1e5b('0x13')](_0x1e5b('0x16'),_0x38e414,_0x1df7e0[_0x1e5b('0x13')][_0x1e5b('0x15')]);return _0x5cbc53(_0x1df7e0[_0x1e5b('0x13')][_0x1e5b('0x15')]);}else{logger[_0x1e5b('0x17')](_0x1e5b('0x16'),_0x38e414,_0x1e5b('0x10'));_0x5cbc53(_0x1df7e0['result']['message']);}})[_0x1e5b('0x18')](function(_0x8d4581){logger[_0x1e5b('0x13')](_0x1e5b('0x16'),_0x38e414,_0x8d4581);_0x1873b5(_0x8d4581);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1b02b72..a7cf433 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 _0x039a=['emit','register','dashboard:','./dashboard.events','remove','update'];(function(_0xfaf5f,_0x27737a){var _0x2adfe4=function(_0x191307){while(--_0x191307){_0xfaf5f['push'](_0xfaf5f['shift']());}};_0x2adfe4(++_0x27737a);}(_0x039a,0xbd));var _0xa039=function(_0x7a84f2,_0x1e1e67){_0x7a84f2=_0x7a84f2-0x0;var _0x2822f0=_0x039a[_0x7a84f2];return _0x2822f0;};'use strict';var DashboardEvents=require(_0xa039('0x0'));var events=['save',_0xa039('0x1'),_0xa039('0x2')];function createListener(_0x161fa1,_0x46e2ff){return function(_0x1912fb){_0x46e2ff[_0xa039('0x3')](_0x161fa1,_0x1912fb);};}function removeListener(_0x4ab4fb,_0x1e4021){return function(){DashboardEvents['removeListener'](_0x4ab4fb,_0x1e4021);};}exports[_0xa039('0x4')]=function(_0x30c3d9){for(var _0x13fe55=0x0,_0xd3e50c=events['length'];_0x13fe55<_0xd3e50c;_0x13fe55++){var _0x23566f=events[_0x13fe55];var _0x3fc5cf=createListener(_0xa039('0x5')+_0x23566f,_0x30c3d9);DashboardEvents['on'](_0x23566f,_0x3fc5cf);}}; \ No newline at end of file +var _0xb32d=['emit','removeListener','length','save','remove','update'];(function(_0x2616cf,_0x5262d6){var _0x15f198=function(_0xa830f9){while(--_0xa830f9){_0x2616cf['push'](_0x2616cf['shift']());}};_0x15f198(++_0x5262d6);}(_0xb32d,0x10b));var _0xdb32=function(_0x2fc960,_0x5219db){_0x2fc960=_0x2fc960-0x0;var _0x3072a7=_0xb32d[_0x2fc960];return _0x3072a7;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xdb32('0x0'),_0xdb32('0x1'),_0xdb32('0x2')];function createListener(_0x2fdccb,_0x17d6b8){return function(_0x37c075){_0x17d6b8[_0xdb32('0x3')](_0x2fdccb,_0x37c075);};}function removeListener(_0x5baf8e,_0x2a8b2a){return function(){DashboardEvents[_0xdb32('0x4')](_0x5baf8e,_0x2a8b2a);};}exports['register']=function(_0xe774d8){for(var _0x4f7c5e=0x0,_0x54ca55=events[_0xdb32('0x5')];_0x4f7c5e<_0x54ca55;_0x4f7c5e++){var _0x25b3cd=events[_0x4f7c5e];var _0x450a81=createListener('dashboard:'+_0x25b3cd,_0xe774d8);DashboardEvents['on'](_0x25b3cd,_0x450a81);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f3ac724..8e87f29 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 _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x3fbcb8,_0x2d576d){var _0x5dbcb8=function(_0x299917){while(--_0x299917){_0x3fbcb8['push'](_0x3fbcb8['shift']());}};_0x5dbcb8(++_0x2d576d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=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(_0x26c5e0,_0x4b9506){var _0x2c9cd4=function(_0x53ac57){while(--_0x53ac57){_0x26c5e0['push'](_0x26c5e0['shift']());}};_0x2c9cd4(++_0x4b9506);}(_0x70e0,0x17b));var _0x070e=function(_0x2f1a0b,_0x392b73){_0x2f1a0b=_0x2f1a0b-0x0;var _0x5de58d=_0x70e0[_0x2f1a0b];return _0x5de58d;};'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 ede9442..7f49d71 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 _0x5479=['setDataValue','stringify','INTEGER','STRING','#2196f3','sequelize','squel','exports','TEXT','parse','getDataValue','attrs'];(function(_0x4e09e6,_0x19d4bb){var _0x2cf1d2=function(_0x1c1be9){while(--_0x1c1be9){_0x4e09e6['push'](_0x4e09e6['shift']());}};_0x2cf1d2(++_0x19d4bb);}(_0x5479,0x1f1));var _0x9547=function(_0x22a49b,_0x5050a9){_0x22a49b=_0x22a49b-0x0;var _0x164f34=_0x5479[_0x22a49b];return _0x164f34;};'use strict';var Sequelize=require(_0x9547('0x0'));var squel=require(_0x9547('0x1'));var _=require('lodash');module[_0x9547('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9547('0x3')]('long'),'get':function(){try{return JSON[_0x9547('0x4')](this[_0x9547('0x5')](_0x9547('0x6')));}catch(_0x347d14){return[];}},'set':function(_0x48dcbf){try{this[_0x9547('0x7')]('attrs',JSON[_0x9547('0x8')](_0x48dcbf));}catch(_0x901c65){this['setDataValue'](_0x9547('0x6'),JSON[_0x9547('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x9547('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9547('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9547('0x9')]},'background':{'type':Sequelize[_0x9547('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9547('0xa')],'allowNull':![],'defaultValue':_0x9547('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa7fa=['stringify','INTEGER','#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','attrs','setDataValue'];(function(_0x107da6,_0x489d04){var _0x46a74c=function(_0xd1b620){while(--_0xd1b620){_0x107da6['push'](_0x107da6['shift']());}};_0x46a74c(++_0x489d04);}(_0xa7fa,0x117));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa7f('0x0'));var squel=require(_0xaa7f('0x1'));var _=require(_0xaa7f('0x2'));module['exports']={'title':{'type':Sequelize[_0xaa7f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xaa7f('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xaa7f('0x4')](_0xaa7f('0x5')),'get':function(){try{return JSON[_0xaa7f('0x6')](this['getDataValue'](_0xaa7f('0x7')));}catch(_0x500f73){return[];}},'set':function(_0x3104f0){try{this[_0xaa7f('0x8')]('attrs',JSON[_0xaa7f('0x9')](_0x3104f0));}catch(_0x1618b5){this['setDataValue'](_0xaa7f('0x7'),JSON[_0xaa7f('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xaa7f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xaa7f('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xaa7f('0xa')]},'background':{'type':Sequelize[_0xaa7f('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xaa7f('0x3')],'allowNull':![],'defaultValue':_0xaa7f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xaa7f('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 638e5db..dc23a7c 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 _0x4515=['attrVoiceQueues','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','limit','set','json','apply','reject','update','destroy','then','error','name','send','params','model','keys','DashboardItem','rawAttributes','filters','intersection','query','attributes','fields','length','include','options','find','catch','type','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric'];(function(_0x28e7a2,_0x50b664){var _0x40b1a9=function(_0x2fb44a){while(--_0x2fb44a){_0x28e7a2['push'](_0x28e7a2['shift']());}};_0x40b1a9(++_0x50b664);}(_0x4515,0x19b));var _0x5451=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4515[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5451('0x0'));var rimraf=require(_0x5451('0x1'));var zipdir=require(_0x5451('0x2'));var jsonpatch=require(_0x5451('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5451('0x4'));var util=require(_0x5451('0x5'));var path=require(_0x5451('0x6'));var sox=require(_0x5451('0x7'));var csv=require(_0x5451('0x8'));var ejs=require(_0x5451('0x9'));var fs=require('fs');var _=require(_0x5451('0xa'));var squel=require(_0x5451('0xb'));var crypto=require(_0x5451('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5451('0x8'));var querystring=require('querystring');var Papa=require(_0x5451('0xd'));var Redis=require(_0x5451('0xe'));var authService=require(_0x5451('0xf'));var qs=require(_0x5451('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5451('0x11'))('api');var utils=require(_0x5451('0x12'));var config=require(_0x5451('0x13'));var db=require('../../mysqldb')['db'];config[_0x5451('0x14')]=_[_0x5451('0x15')](config[_0x5451('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x5451('0x16'))(new Redis(config[_0x5451('0x14')]));require(_0x5451('0x17'))[_0x5451('0x18')](socket);function respondWithStatusCode(_0xfb51c1,_0x54320e){_0x54320e=_0x54320e||0xcc;return function(_0x18deb6){if(_0x18deb6){return _0xfb51c1[_0x5451('0x19')](_0x54320e);}return _0xfb51c1['status'](_0x54320e)[_0x5451('0x1a')]();};}function respondWithResult(_0x3283f3,_0x3ee679){_0x3ee679=_0x3ee679||0xc8;return function(_0xcaeede){if(_0xcaeede){return _0x3283f3[_0x5451('0x1b')](_0x3ee679)['json'](_0xcaeede);}};}function respondWithFilteredResult(_0x4b0283,_0x19e0e0){return function(_0x4fa83b){if(_0x4fa83b){var _0x171b75=_0x4fa83b['count'],_0x484720=_0x19e0e0[_0x5451('0x1c')],_0x344906=_0x19e0e0[_0x5451('0x1c')]+_0x19e0e0[_0x5451('0x1d')],_0x1a0628;if(_0x344906>=_0x171b75){_0x344906=_0x171b75;_0x1a0628=0xc8;}else{_0x1a0628=0xce;}_0x4b0283[_0x5451('0x1b')](_0x1a0628);return _0x4b0283[_0x5451('0x1e')]('Content-Range',_0x484720+'-'+_0x344906+'/'+_0x171b75)[_0x5451('0x1f')](_0x4fa83b);}return null;};}function patchUpdates(_0x51b2a6){return function(_0x3daa90){try{jsonpatch[_0x5451('0x20')](_0x3daa90,_0x51b2a6,!![]);}catch(_0xd17453){return BPromise[_0x5451('0x21')](_0xd17453);}return _0x3daa90['save']();};}function saveUpdates(_0x14bf5c,_0x51ba92){return function(_0x4f2121){if(_0x4f2121){return _0x4f2121[_0x5451('0x22')](_0x14bf5c)['then'](function(_0x3ee749){return _0x3ee749;});}return null;};}function removeEntity(_0x3c2cf9,_0x37e01e){return function(_0x5c3896){if(_0x5c3896){return _0x5c3896[_0x5451('0x23')]()[_0x5451('0x24')](function(){_0x3c2cf9[_0x5451('0x1b')](0xcc)[_0x5451('0x1a')]();});}};}function handleEntityNotFound(_0x244b3a,_0x100718){return function(_0x9edd0b){if(!_0x9edd0b){_0x244b3a['sendStatus'](0x194);}return _0x9edd0b;};}function handleError(_0x253cf5,_0x185b48){_0x185b48=_0x185b48||0x1f4;return function(_0x418e5e){logger[_0x5451('0x25')](_0x418e5e['stack']);if(_0x418e5e['name']){delete _0x418e5e[_0x5451('0x26')];}_0x253cf5[_0x5451('0x1b')](_0x185b48)[_0x5451('0x27')](_0x418e5e);};}exports['show']=function(_0x858a43,_0x48ceed){var _0x3bc157={'raw':![],'where':{'id':_0x858a43[_0x5451('0x28')]['id']}},_0x23bb7a={};_0x23bb7a[_0x5451('0x29')]=_[_0x5451('0x2a')](db[_0x5451('0x2b')][_0x5451('0x2c')]);_0x23bb7a['query']=_[_0x5451('0x2a')](_0x858a43['query']);_0x23bb7a[_0x5451('0x2d')]=_[_0x5451('0x2e')](_0x23bb7a[_0x5451('0x29')],_0x23bb7a[_0x5451('0x2f')]);_0x3bc157[_0x5451('0x30')]=_['intersection'](_0x23bb7a[_0x5451('0x29')],qs[_0x5451('0x31')](_0x858a43[_0x5451('0x2f')][_0x5451('0x31')]));_0x3bc157[_0x5451('0x30')]=_0x3bc157[_0x5451('0x30')][_0x5451('0x32')]?_0x3bc157[_0x5451('0x30')]:_0x23bb7a[_0x5451('0x29')];if(_0x858a43['query']['includeAll']){_0x3bc157[_0x5451('0x33')]=[{'all':!![]}];}_0x3bc157=_['merge']({},_0x3bc157,_0x858a43[_0x5451('0x34')]);return db[_0x5451('0x2b')][_0x5451('0x35')](_0x3bc157)['then'](handleEntityNotFound(_0x48ceed,null))[_0x5451('0x24')](respondWithResult(_0x48ceed,null))[_0x5451('0x36')](handleError(_0x48ceed,null));};exports[_0x5451('0x23')]=function(_0xabe724,_0x1da969){return db['DashboardItem'][_0x5451('0x35')]({'where':{'id':_0xabe724['params']['id']}})[_0x5451('0x24')](handleEntityNotFound(_0x1da969,null))[_0x5451('0x24')](removeEntity(_0x1da969,null))[_0x5451('0x36')](handleError(_0x1da969,null));};function widgetAttributes(_0x5a56d7){try{switch(_0x5a56d7[_0x5451('0x37')]){case'iframe':return[{'name':_0x5451('0x38'),'value':_0x5a56d7[_0x5451('0x38')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x0]?_0x5a56d7[_0x5451('0x39')][0x0]['value']:undefined)||_0x5451('0x3a')}];case'custom':return[{'name':_0x5451('0x3b'),'value':_0x5a56d7[_0x5451('0x3b')]||(_0x5a56d7['attrs']&&_0x5a56d7[_0x5451('0x39')][0x0]?_0x5a56d7['attrs'][0x0][_0x5451('0x3c')]:undefined)||''}];case _0x5451('0x3d'):return[{'name':'attrHourFormat','value':_0x5a56d7[_0x5451('0x3e')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7['attrs'][0x0]?_0x5a56d7[_0x5451('0x39')][0x0][_0x5451('0x3c')]:undefined)||_0x5451('0x3f')},{'name':_0x5451('0x40'),'value':_0x5a56d7['attrTimezone']||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x1]?_0x5a56d7['attrs'][0x1]['value']:undefined)||_0x5451('0x41')},{'name':'attrFontSize','value':_0x5a56d7[_0x5451('0x42')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x2]?_0x5a56d7['attrs'][0x2][_0x5451('0x3c')]:undefined)||0xc}];case _0x5451('0x43'):return[{'name':_0x5451('0x44'),'value':_0x5a56d7['attrMetric']||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7['attrs'][0x0]?_0x5a56d7['attrs'][0x0][_0x5451('0x3c')]:undefined)||'total'},{'name':_0x5451('0x45'),'value':_0x5a56d7[_0x5451('0x45')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x1]?_0x5a56d7['attrs'][0x1]['value']:undefined)||[]},{'name':_0x5451('0x42'),'value':_0x5a56d7[_0x5451('0x42')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x2]?_0x5a56d7['attrs'][0x2][_0x5451('0x3c')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x5451('0x46'),'value':_0x5a56d7[_0x5451('0x46')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x0]?_0x5a56d7['attrs'][0x0]['value']:undefined)||_0x5451('0x47')},{'name':_0x5451('0x48'),'value':_0x5a56d7[_0x5451('0x48')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x1]?_0x5a56d7[_0x5451('0x39')][0x1][_0x5451('0x3c')]:undefined)||null},{'name':'attrSerie3','value':_0x5a56d7[_0x5451('0x49')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7[_0x5451('0x39')][0x2]?_0x5a56d7[_0x5451('0x39')][0x2]['value']:undefined)||null},{'name':_0x5451('0x45'),'value':_0x5a56d7['attrVoiceQueues']||(_0x5a56d7['attrs']&&_0x5a56d7[_0x5451('0x39')][0x3]?_0x5a56d7['attrs'][0x3][_0x5451('0x3c')]:undefined)||[]}];case _0x5451('0x4a'):return[{'name':_0x5451('0x4b'),'type':_0x5a56d7[_0x5451('0x4c')]||(_0x5a56d7['attrs']&&_0x5a56d7['attrs'][0x0]?_0x5a56d7[_0x5451('0x39')][0x0][_0x5451('0x37')]:undefined)||null,'value':_0x5a56d7[_0x5451('0x4b')]||(_0x5a56d7[_0x5451('0x39')]&&_0x5a56d7['attrs'][0x0]?_0x5a56d7[_0x5451('0x39')][0x0]['value']:undefined)||null},{'name':_0x5451('0x4d'),'value':_0x5a56d7[_0x5451('0x4d')]||(_0x5a56d7['attrs']&&_0x5a56d7[_0x5451('0x39')][0x1]?_0x5a56d7[_0x5451('0x39')][0x1][_0x5451('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0xcda955){logger[_0x5451('0x25')]('widgetAttributes:\x20%s',JSON['stringify'](_0xcda955));return[];}}exports[_0x5451('0x4e')]=function(_0x1a6e08,_0x499af0){if(_0x1a6e08[_0x5451('0x4f')]){_0x1a6e08[_0x5451('0x4f')]['attrs']=widgetAttributes(_0x1a6e08[_0x5451('0x4f')]);}return db[_0x5451('0x2b')]['create'](_0x1a6e08[_0x5451('0x4f')],{})[_0x5451('0x24')](respondWithResult(_0x499af0,0xc9))[_0x5451('0x36')](handleError(_0x499af0,null));};exports['update']=function(_0x31dfdc,_0x5ce9e5){if(_0x31dfdc['body']['id']){delete _0x31dfdc[_0x5451('0x4f')]['id'];}_0x31dfdc['body']['attrs']=widgetAttributes(_0x31dfdc['body']);return db['DashboardItem'][_0x5451('0x35')]({'where':{'id':_0x31dfdc[_0x5451('0x28')]['id']}})[_0x5451('0x24')](handleEntityNotFound(_0x5ce9e5,null))[_0x5451('0x24')](saveUpdates(_0x31dfdc[_0x5451('0x4f')],null))[_0x5451('0x24')](respondWithResult(_0x5ce9e5,null))['catch'](handleError(_0x5ce9e5,null));}; \ No newline at end of file +var _0x3a90=['DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','find','catch','type','iframe','attrs','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','value','counter','total','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','./dashboardItem.socket','register','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','show','params','model','keys'];(function(_0x1541ad,_0x3f3311){var _0x330800=function(_0x4d874f){while(--_0x4d874f){_0x1541ad['push'](_0x1541ad['shift']());}};_0x330800(++_0x3f3311);}(_0x3a90,0x133));var _0x03a9=function(_0x2dc1ca,_0xbcf14b){_0x2dc1ca=_0x2dc1ca-0x0;var _0x18b53f=_0x3a90[_0x2dc1ca];return _0x18b53f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x03a9('0x0'));var rimraf=require(_0x03a9('0x1'));var zipdir=require(_0x03a9('0x2'));var jsonpatch=require(_0x03a9('0x3'));var rp=require(_0x03a9('0x4'));var moment=require(_0x03a9('0x5'));var BPromise=require(_0x03a9('0x6'));var Mustache=require(_0x03a9('0x7'));var util=require(_0x03a9('0x8'));var path=require(_0x03a9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03a9('0xa'));var fs=require('fs');var _=require(_0x03a9('0xb'));var squel=require(_0x03a9('0xc'));var crypto=require(_0x03a9('0xd'));var jsforce=require(_0x03a9('0xe'));var deskjs=require(_0x03a9('0xf'));var toCsv=require(_0x03a9('0x10'));var querystring=require(_0x03a9('0x11'));var Papa=require(_0x03a9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03a9('0x13'));var as=require(_0x03a9('0x14'));var hardwareService=require(_0x03a9('0x15'));var logger=require(_0x03a9('0x16'))(_0x03a9('0x17'));var utils=require(_0x03a9('0x18'));var config=require(_0x03a9('0x19'));var db=require(_0x03a9('0x1a'))['db'];config[_0x03a9('0x1b')]=_[_0x03a9('0x1c')](config[_0x03a9('0x1b')],{'host':_0x03a9('0x1d'),'port':0x18eb});var socket=require(_0x03a9('0x1e'))(new Redis(config[_0x03a9('0x1b')]));require(_0x03a9('0x1f'))[_0x03a9('0x20')](socket);function respondWithStatusCode(_0x250838,_0xdd705c){_0xdd705c=_0xdd705c||0xcc;return function(_0x117b5c){if(_0x117b5c){return _0x250838['sendStatus'](_0xdd705c);}return _0x250838['status'](_0xdd705c)['end']();};}function respondWithResult(_0x27395a,_0x330a14){_0x330a14=_0x330a14||0xc8;return function(_0xf5c721){if(_0xf5c721){return _0x27395a[_0x03a9('0x21')](_0x330a14)[_0x03a9('0x22')](_0xf5c721);}};}function respondWithFilteredResult(_0x5b8173,_0x3f9c3a){return function(_0x278d38){if(_0x278d38){var _0x17bbf0=_0x278d38[_0x03a9('0x23')],_0x23a831=_0x3f9c3a[_0x03a9('0x24')],_0x59b999=_0x3f9c3a[_0x03a9('0x24')]+_0x3f9c3a[_0x03a9('0x25')],_0x46b0e5;if(_0x59b999>=_0x17bbf0){_0x59b999=_0x17bbf0;_0x46b0e5=0xc8;}else{_0x46b0e5=0xce;}_0x5b8173['status'](_0x46b0e5);return _0x5b8173[_0x03a9('0x26')](_0x03a9('0x27'),_0x23a831+'-'+_0x59b999+'/'+_0x17bbf0)[_0x03a9('0x22')](_0x278d38);}return null;};}function patchUpdates(_0x23206c){return function(_0x2d03f0){try{jsonpatch['apply'](_0x2d03f0,_0x23206c,!![]);}catch(_0x12de91){return BPromise[_0x03a9('0x28')](_0x12de91);}return _0x2d03f0['save']();};}function saveUpdates(_0x14dd1e,_0x369744){return function(_0x14daaf){if(_0x14daaf){return _0x14daaf[_0x03a9('0x29')](_0x14dd1e)[_0x03a9('0x2a')](function(_0x1dca28){return _0x1dca28;});}return null;};}function removeEntity(_0x3f0d04,_0x4c1610){return function(_0x342576){if(_0x342576){return _0x342576[_0x03a9('0x2b')]()[_0x03a9('0x2a')](function(){_0x3f0d04[_0x03a9('0x21')](0xcc)[_0x03a9('0x2c')]();});}};}function handleEntityNotFound(_0x34c093,_0x5cb342){return function(_0x3f0186){if(!_0x3f0186){_0x34c093['sendStatus'](0x194);}return _0x3f0186;};}function handleError(_0x393698,_0xbb081b){_0xbb081b=_0xbb081b||0x1f4;return function(_0x487b7f){logger[_0x03a9('0x2d')](_0x487b7f[_0x03a9('0x2e')]);if(_0x487b7f[_0x03a9('0x2f')]){delete _0x487b7f[_0x03a9('0x2f')];}_0x393698['status'](_0xbb081b)[_0x03a9('0x30')](_0x487b7f);};}exports[_0x03a9('0x31')]=function(_0x1db68f,_0x111656){var _0x26a5ff={'raw':![],'where':{'id':_0x1db68f[_0x03a9('0x32')]['id']}},_0x345e0c={};_0x345e0c[_0x03a9('0x33')]=_[_0x03a9('0x34')](db[_0x03a9('0x35')][_0x03a9('0x36')]);_0x345e0c[_0x03a9('0x37')]=_[_0x03a9('0x34')](_0x1db68f[_0x03a9('0x37')]);_0x345e0c[_0x03a9('0x38')]=_[_0x03a9('0x39')](_0x345e0c['model'],_0x345e0c[_0x03a9('0x37')]);_0x26a5ff['attributes']=_[_0x03a9('0x39')](_0x345e0c[_0x03a9('0x33')],qs[_0x03a9('0x3a')](_0x1db68f[_0x03a9('0x37')][_0x03a9('0x3a')]));_0x26a5ff[_0x03a9('0x3b')]=_0x26a5ff[_0x03a9('0x3b')][_0x03a9('0x3c')]?_0x26a5ff['attributes']:_0x345e0c['model'];if(_0x1db68f[_0x03a9('0x37')]['includeAll']){_0x26a5ff[_0x03a9('0x3d')]=[{'all':!![]}];}_0x26a5ff=_['merge']({},_0x26a5ff,_0x1db68f[_0x03a9('0x3e')]);return db[_0x03a9('0x35')][_0x03a9('0x3f')](_0x26a5ff)['then'](handleEntityNotFound(_0x111656,null))[_0x03a9('0x2a')](respondWithResult(_0x111656,null))[_0x03a9('0x40')](handleError(_0x111656,null));};exports[_0x03a9('0x2b')]=function(_0x4ada12,_0x3e607b){return db[_0x03a9('0x35')]['find']({'where':{'id':_0x4ada12[_0x03a9('0x32')]['id']}})['then'](handleEntityNotFound(_0x3e607b,null))[_0x03a9('0x2a')](removeEntity(_0x3e607b,null))[_0x03a9('0x40')](handleError(_0x3e607b,null));};function widgetAttributes(_0x160824){try{switch(_0x160824[_0x03a9('0x41')]){case _0x03a9('0x42'):return[{'name':'attrUrl','value':_0x160824['attrUrl']||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824[_0x03a9('0x43')][0x0]['value']:undefined)||'https://'}];case _0x03a9('0x44'):return[{'name':_0x03a9('0x45'),'value':_0x160824[_0x03a9('0x45')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824[_0x03a9('0x43')][0x0]['value']:undefined)||''}];case _0x03a9('0x46'):return[{'name':_0x03a9('0x47'),'value':_0x160824[_0x03a9('0x47')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824[_0x03a9('0x43')][0x0]['value']:undefined)||_0x03a9('0x48')},{'name':_0x03a9('0x49'),'value':_0x160824['attrTimezone']||(_0x160824[_0x03a9('0x43')]&&_0x160824['attrs'][0x1]?_0x160824['attrs'][0x1][_0x03a9('0x4a')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x160824['attrFontSize']||(_0x160824[_0x03a9('0x43')]&&_0x160824['attrs'][0x2]?_0x160824[_0x03a9('0x43')][0x2][_0x03a9('0x4a')]:undefined)||0xc}];case _0x03a9('0x4b'):return[{'name':'attrMetric','value':_0x160824['attrMetric']||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824['attrs'][0x0][_0x03a9('0x4a')]:undefined)||_0x03a9('0x4c')},{'name':'attrVoiceQueues','value':_0x160824[_0x03a9('0x4d')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x1]?_0x160824[_0x03a9('0x43')][0x1]['value']:undefined)||[]},{'name':_0x03a9('0x4e'),'value':_0x160824['attrFontSize']||(_0x160824['attrs']&&_0x160824['attrs'][0x2]?_0x160824[_0x03a9('0x43')][0x2][_0x03a9('0x4a')]:undefined)||0x14}];case'multibar-chart':case _0x03a9('0x4f'):return[{'name':_0x03a9('0x50'),'value':_0x160824['attrSerie1']||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824[_0x03a9('0x43')][0x0][_0x03a9('0x4a')]:undefined)||_0x03a9('0x4c')},{'name':_0x03a9('0x51'),'value':_0x160824['attrSerie2']||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x1]?_0x160824['attrs'][0x1]['value']:undefined)||null},{'name':_0x03a9('0x52'),'value':_0x160824[_0x03a9('0x52')]||(_0x160824[_0x03a9('0x43')]&&_0x160824['attrs'][0x2]?_0x160824['attrs'][0x2]['value']:undefined)||null},{'name':_0x03a9('0x4d'),'value':_0x160824[_0x03a9('0x4d')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x3]?_0x160824['attrs'][0x3][_0x03a9('0x4a')]:undefined)||[]}];case'web-report':return[{'name':_0x03a9('0x53'),'type':_0x160824[_0x03a9('0x54')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824[_0x03a9('0x43')][0x0]['type']:undefined)||null,'value':_0x160824[_0x03a9('0x53')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x0]?_0x160824['attrs'][0x0][_0x03a9('0x4a')]:undefined)||null},{'name':_0x03a9('0x55'),'value':_0x160824[_0x03a9('0x55')]||(_0x160824[_0x03a9('0x43')]&&_0x160824[_0x03a9('0x43')][0x1]?_0x160824['attrs'][0x1][_0x03a9('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x338af6){logger['error'](_0x03a9('0x56'),JSON[_0x03a9('0x57')](_0x338af6));return[];}}exports[_0x03a9('0x58')]=function(_0x14c0d6,_0x485f69){if(_0x14c0d6[_0x03a9('0x59')]){_0x14c0d6['body'][_0x03a9('0x43')]=widgetAttributes(_0x14c0d6['body']);}return db['DashboardItem'][_0x03a9('0x58')](_0x14c0d6[_0x03a9('0x59')],{})[_0x03a9('0x2a')](respondWithResult(_0x485f69,0xc9))['catch'](handleError(_0x485f69,null));};exports['update']=function(_0x1e8353,_0x211c7a){if(_0x1e8353[_0x03a9('0x59')]['id']){delete _0x1e8353[_0x03a9('0x59')]['id'];}_0x1e8353[_0x03a9('0x59')][_0x03a9('0x43')]=widgetAttributes(_0x1e8353[_0x03a9('0x59')]);return db[_0x03a9('0x35')][_0x03a9('0x3f')]({'where':{'id':_0x1e8353[_0x03a9('0x32')]['id']}})[_0x03a9('0x2a')](handleEntityNotFound(_0x211c7a,null))['then'](saveUpdates(_0x1e8353[_0x03a9('0x59')],null))[_0x03a9('0x2a')](respondWithResult(_0x211c7a,null))['catch'](handleError(_0x211c7a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4f10001..9186237 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 _0xf595=['DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1eabd5,_0x2f5dd8){var _0x2f4de8=function(_0x1c36fd){while(--_0x1c36fd){_0x1eabd5['push'](_0x1eabd5['shift']());}};_0x2f4de8(++_0x2f5dd8);}(_0xf595,0x8e));var _0x5f59=function(_0x2e2abe,_0x18c09d){_0x2e2abe=_0x2e2abe-0x0;var _0x54d614=_0xf595[_0x2e2abe];return _0x54d614;};'use strict';var EventEmitter=require(_0x5f59('0x0'));var DashboardItem=require(_0x5f59('0x1'))['db'][_0x5f59('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5f59('0x3')](0x0);var events={'afterCreate':_0x5f59('0x4'),'afterUpdate':'update','afterDestroy':_0x5f59('0x5')};function emitEvent(_0x1d2e2f){return function(_0x4f60af,_0x5152e5,_0x570e6a){DashboardItemEvents[_0x5f59('0x6')](_0x1d2e2f+':'+_0x4f60af['id'],_0x4f60af);DashboardItemEvents[_0x5f59('0x6')](_0x1d2e2f,_0x4f60af);_0x570e6a(null);};}for(var e in events){if(events[_0x5f59('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x5f59('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xcca7=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0xd4a790,_0xa9ce1e){var _0x33fbc4=function(_0xf71451){while(--_0xf71451){_0xd4a790['push'](_0xd4a790['shift']());}};_0x33fbc4(++_0xa9ce1e);}(_0xcca7,0x15b));var _0x7cca=function(_0x4e6fa8,_0x3dde63){_0x4e6fa8=_0x4e6fa8-0x0;var _0x31bf97=_0xcca7[_0x4e6fa8];return _0x31bf97;};'use strict';var EventEmitter=require(_0x7cca('0x0'));var DashboardItem=require(_0x7cca('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7cca('0x2')](0x0);var events={'afterCreate':_0x7cca('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xd94cbc){return function(_0x44e370,_0x309b1c,_0x4a19f4){DashboardItemEvents[_0x7cca('0x4')](_0xd94cbc+':'+_0x44e370['id'],_0x44e370);DashboardItemEvents[_0x7cca('0x4')](_0xd94cbc,_0x44e370);_0x4a19f4(null);};}for(var e in events){if(events[_0x7cca('0x5')](e)){var event=events[e];DashboardItem[_0x7cca('0x6')](e,emitEvent(event));}}module[_0x7cca('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index a7ea458..30481cb 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 _0xe0fc=['moment','bluebird','path','rimraf','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','api'];(function(_0xa028da,_0x218c8f){var _0x50ad7f=function(_0x363c52){while(--_0x363c52){_0xa028da['push'](_0xa028da['shift']());}};_0x50ad7f(++_0x218c8f);}(_0xe0fc,0x8c));var _0xce0f=function(_0x207061,_0xe38cda){_0x207061=_0x207061-0x0;var _0x4a2833=_0xe0fc[_0x207061];return _0x4a2833;};'use strict';var _=require(_0xce0f('0x0'));var util=require('util');var logger=require(_0xce0f('0x1'))(_0xce0f('0x2'));var moment=require(_0xce0f('0x3'));var BPromise=require(_0xce0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce0f('0x5'));var rimraf=require(_0xce0f('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xce0f('0x7')]=function(_0x20bcd4,_0x2e9c65){return _0x20bcd4[_0xce0f('0x8')](_0xce0f('0x9'),attributes,{'tableName':_0xce0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18fb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash'];(function(_0x15c8ac,_0x26811b){var _0xf96485=function(_0x1c97d8){while(--_0x1c97d8){_0x15c8ac['push'](_0x15c8ac['shift']());}};_0xf96485(++_0x26811b);}(_0x18fb,0x144));var _0xb18f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x18fb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb18f('0x0'));var util=require(_0xb18f('0x1'));var logger=require(_0xb18f('0x2'))(_0xb18f('0x3'));var moment=require(_0xb18f('0x4'));var BPromise=require(_0xb18f('0x5'));var rp=require(_0xb18f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb18f('0x7'));var config=require(_0xb18f('0x8'));var attributes=require(_0xb18f('0x9'));module[_0xb18f('0xa')]=function(_0x478f79,_0x274022){return _0x478f79[_0xb18f('0xb')]('DashboardItem',attributes,{'tableName':_0xb18f('0xc'),'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 506c80f..3cd6ddf 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 _0xb3c7=['socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb3c7,0x1ce));var _0x7b3c=function(_0x5e88b5,_0x48a6af){_0x5e88b5=_0x5e88b5-0x0;var _0x4f705b=_0xb3c7[_0x5e88b5];return _0x4f705b;};'use strict';var _=require(_0x7b3c('0x0'));var util=require('util');var moment=require(_0x7b3c('0x1'));var BPromise=require(_0x7b3c('0x2'));var rs=require(_0x7b3c('0x3'));var fs=require('fs');var Redis=require(_0x7b3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b3c('0x5'));var logger=require(_0x7b3c('0x6'))(_0x7b3c('0x7'));var config=require(_0x7b3c('0x8'));var jayson=require(_0x7b3c('0x9'));var client=jayson[_0x7b3c('0xa')][_0x7b3c('0xb')]({'port':0x232a});config['redis']=_[_0x7b3c('0xc')](config[_0x7b3c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b3c('0xe'))(new Redis(config['redis']));require(_0x7b3c('0xf'))[_0x7b3c('0x10')](socket);function respondWithRpcPromise(_0x1e3f27,_0x17bc2a,_0x19886c){return new BPromise(function(_0x21ef9c,_0x2cd00d){return client[_0x7b3c('0x11')](_0x1e3f27,_0x19886c)[_0x7b3c('0x12')](function(_0x31fd86){logger[_0x7b3c('0x13')](_0x7b3c('0x14'),_0x17bc2a,_0x7b3c('0x15'));logger[_0x7b3c('0x16')](_0x7b3c('0x17'),_0x17bc2a,_0x7b3c('0x15'),JSON['stringify'](_0x31fd86));if(_0x31fd86['error']){if(_0x31fd86[_0x7b3c('0x18')]['code']===0x1f4){logger[_0x7b3c('0x18')](_0x7b3c('0x14'),_0x17bc2a,_0x31fd86[_0x7b3c('0x18')][_0x7b3c('0x19')]);return _0x2cd00d(_0x31fd86[_0x7b3c('0x18')][_0x7b3c('0x19')]);}logger[_0x7b3c('0x18')](_0x7b3c('0x14'),_0x17bc2a,_0x31fd86[_0x7b3c('0x18')][_0x7b3c('0x19')]);return _0x21ef9c(_0x31fd86[_0x7b3c('0x18')][_0x7b3c('0x19')]);}else{logger[_0x7b3c('0x13')](_0x7b3c('0x14'),_0x17bc2a,_0x7b3c('0x15'));_0x21ef9c(_0x31fd86[_0x7b3c('0x1a')][_0x7b3c('0x19')]);}})[_0x7b3c('0x1b')](function(_0x3a8db3){logger['error'](_0x7b3c('0x14'),_0x17bc2a,_0x3a8db3);_0x2cd00d(_0x3a8db3);});});} \ No newline at end of file +var _0x7de9=['DashboardItem,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info'];(function(_0x4c2655,_0x1e64ea){var _0xdff5fc=function(_0x4b713f){while(--_0x4b713f){_0x4c2655['push'](_0x4c2655['shift']());}};_0xdff5fc(++_0x1e64ea);}(_0x7de9,0x1b7));var _0x97de=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7de9[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x97de('0x0'));var util=require(_0x97de('0x1'));var moment=require(_0x97de('0x2'));var BPromise=require(_0x97de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97de('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x97de('0x5'));var config=require(_0x97de('0x6'));var jayson=require(_0x97de('0x7'));var client=jayson[_0x97de('0x8')][_0x97de('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x97de('0xa')],{'host':_0x97de('0xb'),'port':0x18eb});var socket=require(_0x97de('0xc'))(new Redis(config[_0x97de('0xa')]));require(_0x97de('0xd'))[_0x97de('0xe')](socket);function respondWithRpcPromise(_0x1f76a0,_0x5843a0,_0x348525){return new BPromise(function(_0x4b5a78,_0x44b5df){return client[_0x97de('0xf')](_0x1f76a0,_0x348525)['then'](function(_0x426bbe){logger[_0x97de('0x10')](_0x97de('0x11'),_0x5843a0,_0x97de('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5843a0,_0x97de('0x12'),JSON['stringify'](_0x426bbe));if(_0x426bbe[_0x97de('0x13')]){if(_0x426bbe[_0x97de('0x13')][_0x97de('0x14')]===0x1f4){logger[_0x97de('0x13')](_0x97de('0x11'),_0x5843a0,_0x426bbe[_0x97de('0x13')][_0x97de('0x15')]);return _0x44b5df(_0x426bbe[_0x97de('0x13')][_0x97de('0x15')]);}logger['error'](_0x97de('0x11'),_0x5843a0,_0x426bbe[_0x97de('0x13')][_0x97de('0x15')]);return _0x4b5a78(_0x426bbe['error']['message']);}else{logger[_0x97de('0x10')](_0x97de('0x11'),_0x5843a0,_0x97de('0x12'));_0x4b5a78(_0x426bbe[_0x97de('0x16')]['message']);}})[_0x97de('0x17')](function(_0x4866b6){logger[_0x97de('0x13')](_0x97de('0x11'),_0x5843a0,_0x4866b6);_0x44b5df(_0x4866b6);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b5c027b..27b1d44 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 _0x82ca=['save','remove','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x14e78b,_0x396cb6){var _0x4d46ec=function(_0xf31200){while(--_0xf31200){_0x14e78b['push'](_0x14e78b['shift']());}};_0x4d46ec(++_0x396cb6);}(_0x82ca,0x167));var _0xa82c=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x82ca[_0x1dd532];return _0x3732aa;};'use strict';var DashboardItemEvents=require(_0xa82c('0x0'));var events=[_0xa82c('0x1'),_0xa82c('0x2'),'update'];function createListener(_0x3ec90f,_0x15f5e2){return function(_0x3cc784){_0x15f5e2['emit'](_0x3ec90f,_0x3cc784);};}function removeListener(_0x1733fa,_0x28837d){return function(){DashboardItemEvents['removeListener'](_0x1733fa,_0x28837d);};}exports[_0xa82c('0x3')]=function(_0x2dd368){for(var _0x16b4ef=0x0,_0x571de6=events[_0xa82c('0x4')];_0x16b4ef<_0x571de6;_0x16b4ef++){var _0x12d5b0=events[_0x16b4ef];var _0x4256b8=createListener(_0xa82c('0x5')+_0x12d5b0,_0x2dd368);DashboardItemEvents['on'](_0x12d5b0,_0x4256b8);}}; \ No newline at end of file +var _0x2672=['length','./dashboardItem.events','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2672,0x1a5));var _0x2267=function(_0xc7dc65,_0x5c2ed5){_0xc7dc65=_0xc7dc65-0x0;var _0x4dfc4a=_0x2672[_0xc7dc65];return _0x4dfc4a;};'use strict';var DashboardItemEvents=require(_0x2267('0x0'));var events=['save',_0x2267('0x1'),_0x2267('0x2')];function createListener(_0x125b20,_0xf9c7c8){return function(_0x26bad8){_0xf9c7c8[_0x2267('0x3')](_0x125b20,_0x26bad8);};}function removeListener(_0x539f0b,_0x4603f7){return function(){DashboardItemEvents[_0x2267('0x4')](_0x539f0b,_0x4603f7);};}exports[_0x2267('0x5')]=function(_0x4e4795){for(var _0x3b10d7=0x0,_0x3c078c=events[_0x2267('0x6')];_0x3b10d7<_0x3c078c;_0x3b10d7++){var _0x4540e8=events[_0x3b10d7];var _0x119ab3=createListener('dashboardItem:'+_0x4540e8,_0x4e4795);DashboardItemEvents['on'](_0x4540e8,_0x119ab3);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d5cc801..8b6c5c8 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 _0x7fbe=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1c6856,_0x8786ba){_0x1c6856=_0x1c6856-0x0;var _0x310ca5=_0x7fbe[_0x1c6856];return _0x310ca5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var auth=require(_0xe7fb('0x4'));var interaction=require(_0xe7fb('0x5'));var config=require(_0xe7fb('0x6'));var controller=require(_0xe7fb('0x7'));router[_0xe7fb('0x8')](_0xe7fb('0x9'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0xc')]('/',auth[_0xe7fb('0xa')](),controller['create']);router[_0xe7fb('0xd')](_0xe7fb('0x9'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xe')]);router['delete']('/:id',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);module[_0xe7fb('0x10')]=router; \ No newline at end of file +var _0x3f8a=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x266f37,_0x59fa36){_0x266f37=_0x266f37-0x0;var _0x4942ff=_0x3f8a[_0x266f37];return _0x4942ff;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')](_0xa3f8('0xa'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xd')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xf')](_0xa3f8('0xa'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router[_0xa3f8('0x11')]('/:id',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d344ff0..51357e6 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 _0xfc14=['exports','STRING','sequelize'];(function(_0x3a6fb0,_0x48f8ba){var _0x521cc5=function(_0x4c2818){while(--_0x4c2818){_0x3a6fb0['push'](_0x3a6fb0['shift']());}};_0x521cc5(++_0x48f8ba);}(_0xfc14,0x15e));var _0x4fc1=function(_0x57a2ec,_0x3abfe4){_0x57a2ec=_0x57a2ec-0x0;var _0x272e8f=_0xfc14[_0x57a2ec];return _0x272e8f;};'use strict';var Sequelize=require(_0x4fc1('0x0'));module[_0x4fc1('0x1')]={'name':{'type':Sequelize[_0x4fc1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x492e=['sequelize','exports','STRING'];(function(_0x74fd11,_0x59eb8b){var _0x45fd91=function(_0x442c0f){while(--_0x442c0f){_0x74fd11['push'](_0x74fd11['shift']());}};_0x45fd91(++_0x59eb8b);}(_0x492e,0x1e3));var _0xe492=function(_0x587922,_0x2974b){_0x587922=_0x587922-0x0;var _0x1be3ff=_0x492e[_0x587922];return _0x1be3ff;};'use strict';var Sequelize=require(_0xe492('0x0'));module[_0xe492('0x1')]={'name':{'type':Sequelize[_0xe492('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 79efe72..dc949be 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 _0xac33=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','Dispositions','destroy','error','name','map','Disposition','rawAttributes','fieldName','key','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','count','includeAll','include','findAll','catch','show','params','keys','intersection','length','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','jsforce','papaparse','ioredis'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xac33,0x125));var _0x3ac3=function(_0x51aebe,_0x2c154a){_0x51aebe=_0x51aebe-0x0;var _0x31b43d=_0xac33[_0x51aebe];return _0x31b43d;};'use strict';var pdf=require(_0x3ac3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3ac3('0x1'));var zipdir=require(_0x3ac3('0x2'));var jsonpatch=require(_0x3ac3('0x3'));var rp=require(_0x3ac3('0x4'));var moment=require(_0x3ac3('0x5'));var BPromise=require(_0x3ac3('0x6'));var Mustache=require('mustache');var util=require(_0x3ac3('0x7'));var path=require(_0x3ac3('0x8'));var sox=require(_0x3ac3('0x9'));var csv=require(_0x3ac3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3ac3('0xb'));var crypto=require('crypto');var jsforce=require(_0x3ac3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3ac3('0xa'));var querystring=require('querystring');var Papa=require(_0x3ac3('0xd'));var Redis=require(_0x3ac3('0xe'));var authService=require(_0x3ac3('0xf'));var qs=require(_0x3ac3('0x10'));var as=require(_0x3ac3('0x11'));var hardwareService=require(_0x3ac3('0x12'));var logger=require('../../config/logger')(_0x3ac3('0x13'));var utils=require('../../config/utils');var config=require(_0x3ac3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57da47,_0x1a8e2e){_0x1a8e2e=_0x1a8e2e||0xcc;return function(_0xa5468){if(_0xa5468){return _0x57da47[_0x3ac3('0x15')](_0x1a8e2e);}return _0x57da47['status'](_0x1a8e2e)[_0x3ac3('0x16')]();};}function respondWithResult(_0x539834,_0x5c7df0){_0x5c7df0=_0x5c7df0||0xc8;return function(_0x26f263){if(_0x26f263){return _0x539834[_0x3ac3('0x17')](_0x5c7df0)['json'](_0x26f263);}};}function respondWithFilteredResult(_0x44dd73,_0x4bf0f0){return function(_0x58bb3f){if(_0x58bb3f){var _0x8a152=_0x58bb3f['count'],_0x505592=_0x4bf0f0['offset'],_0x247202=_0x4bf0f0[_0x3ac3('0x18')]+_0x4bf0f0[_0x3ac3('0x19')],_0x2d5c63;if(_0x247202>=_0x8a152){_0x247202=_0x8a152;_0x2d5c63=0xc8;}else{_0x2d5c63=0xce;}_0x44dd73[_0x3ac3('0x17')](_0x2d5c63);return _0x44dd73[_0x3ac3('0x1a')](_0x3ac3('0x1b'),_0x505592+'-'+_0x247202+'/'+_0x8a152)[_0x3ac3('0x1c')](_0x58bb3f);}return null;};}function patchUpdates(_0x406fb6){return function(_0x30fd8d){try{jsonpatch[_0x3ac3('0x1d')](_0x30fd8d,_0x406fb6,!![]);}catch(_0x1423e2){return BPromise[_0x3ac3('0x1e')](_0x1423e2);}return _0x30fd8d[_0x3ac3('0x1f')]();};}function saveUpdates(_0x234066,_0xad3e87){return function(_0x25068b){if(_0x25068b){return _0x25068b[_0x3ac3('0x20')](_0x234066)[_0x3ac3('0x21')](function(_0x5fea7b){return _0x5fea7b;});}return null;};}function removeEntity(_0x4a83e1,_0x1befb6){return function(_0x417ab1){if(_0x417ab1){return _0x417ab1['destroy']()[_0x3ac3('0x21')](function(){var _0x5a395f=_0x417ab1['get']({'plain':!![]});var _0x4d91bf=_0x3ac3('0x22');return db['UserProfileResource'][_0x3ac3('0x23')]({'where':{'type':_0x4d91bf,'resourceId':_0x5a395f['id']}})[_0x3ac3('0x21')](function(){return _0x417ab1;});})[_0x3ac3('0x21')](function(){_0x4a83e1[_0x3ac3('0x17')](0xcc)[_0x3ac3('0x16')]();});}};}function handleEntityNotFound(_0x269508,_0x170b0f){return function(_0x750faf){if(!_0x750faf){_0x269508[_0x3ac3('0x15')](0x194);}return _0x750faf;};}function handleError(_0x3b42e1,_0x445f52){_0x445f52=_0x445f52||0x1f4;return function(_0x4ea66d){logger[_0x3ac3('0x24')](_0x4ea66d['stack']);if(_0x4ea66d['name']){delete _0x4ea66d[_0x3ac3('0x25')];}_0x3b42e1['status'](_0x445f52)['send'](_0x4ea66d);};}exports['index']=function(_0x37281d,_0x45a9a1){var _0x18ea07={},_0x27bcb9={},_0x4c19e8={'count':0x0,'rows':[]};var _0x3ba4fb=_[_0x3ac3('0x26')](db[_0x3ac3('0x27')][_0x3ac3('0x28')],function(_0x51cf91){return{'name':_0x51cf91[_0x3ac3('0x29')],'type':_0x51cf91['type'][_0x3ac3('0x2a')]};});_0x27bcb9['model']=_[_0x3ac3('0x26')](_0x3ba4fb,_0x3ac3('0x25'));_0x27bcb9[_0x3ac3('0x2b')]=_['keys'](_0x37281d['query']);_0x27bcb9[_0x3ac3('0x2c')]=_['intersection'](_0x27bcb9[_0x3ac3('0x2d')],_0x27bcb9['query']);_0x18ea07[_0x3ac3('0x2e')]=_['intersection'](_0x27bcb9['model'],qs[_0x3ac3('0x2f')](_0x37281d['query'][_0x3ac3('0x2f')]));_0x18ea07[_0x3ac3('0x2e')]=_0x18ea07[_0x3ac3('0x2e')]['length']?_0x18ea07[_0x3ac3('0x2e')]:_0x27bcb9[_0x3ac3('0x2d')];if(!_0x37281d[_0x3ac3('0x2b')][_0x3ac3('0x30')](_0x3ac3('0x31'))){_0x18ea07['limit']=qs[_0x3ac3('0x19')](_0x37281d[_0x3ac3('0x2b')][_0x3ac3('0x19')]);_0x18ea07[_0x3ac3('0x18')]=qs[_0x3ac3('0x18')](_0x37281d['query'][_0x3ac3('0x18')]);}_0x18ea07[_0x3ac3('0x32')]=qs[_0x3ac3('0x33')](_0x37281d[_0x3ac3('0x2b')][_0x3ac3('0x33')]);_0x18ea07[_0x3ac3('0x34')]=qs[_0x3ac3('0x2c')](_['pick'](_0x37281d[_0x3ac3('0x2b')],_0x27bcb9['filters']),_0x3ba4fb);if(_0x37281d['query'][_0x3ac3('0x35')]){_0x18ea07[_0x3ac3('0x34')]=_['merge'](_0x18ea07['where'],{'$or':_[_0x3ac3('0x26')](_0x3ba4fb,function(_0x3d50ff){if(_0x3d50ff[_0x3ac3('0x36')]!=='VIRTUAL'){var _0x46dc2d={};_0x46dc2d[_0x3d50ff[_0x3ac3('0x25')]]={'$like':'%'+_0x37281d[_0x3ac3('0x2b')]['filter']+'%'};return _0x46dc2d;}})});}_0x18ea07=_[_0x3ac3('0x37')]({},_0x18ea07,_0x37281d[_0x3ac3('0x38')]);var _0x413453={'where':_0x18ea07[_0x3ac3('0x34')]};return db['Disposition'][_0x3ac3('0x39')](_0x413453)['then'](function(_0x10f170){_0x4c19e8[_0x3ac3('0x39')]=_0x10f170;if(_0x37281d[_0x3ac3('0x2b')][_0x3ac3('0x3a')]){_0x18ea07[_0x3ac3('0x3b')]=[{'all':!![]}];}return db[_0x3ac3('0x27')][_0x3ac3('0x3c')](_0x18ea07);})[_0x3ac3('0x21')](function(_0x391030){_0x4c19e8['rows']=_0x391030;return _0x4c19e8;})['then'](respondWithFilteredResult(_0x45a9a1,_0x18ea07))[_0x3ac3('0x3d')](handleError(_0x45a9a1,null));};exports[_0x3ac3('0x3e')]=function(_0xc4ff0b,_0x33daf6){var _0x21eb5e={'raw':!![],'where':{'id':_0xc4ff0b[_0x3ac3('0x3f')]['id']}},_0x9d012={};_0x9d012[_0x3ac3('0x2d')]=_['keys'](db[_0x3ac3('0x27')][_0x3ac3('0x28')]);_0x9d012[_0x3ac3('0x2b')]=_[_0x3ac3('0x40')](_0xc4ff0b['query']);_0x9d012[_0x3ac3('0x2c')]=_[_0x3ac3('0x41')](_0x9d012[_0x3ac3('0x2d')],_0x9d012[_0x3ac3('0x2b')]);_0x21eb5e[_0x3ac3('0x2e')]=_[_0x3ac3('0x41')](_0x9d012[_0x3ac3('0x2d')],qs[_0x3ac3('0x2f')](_0xc4ff0b[_0x3ac3('0x2b')][_0x3ac3('0x2f')]));_0x21eb5e[_0x3ac3('0x2e')]=_0x21eb5e[_0x3ac3('0x2e')][_0x3ac3('0x42')]?_0x21eb5e['attributes']:_0x9d012[_0x3ac3('0x2d')];if(_0xc4ff0b[_0x3ac3('0x2b')]['includeAll']){_0x21eb5e['include']=[{'all':!![]}];}_0x21eb5e=_[_0x3ac3('0x37')]({},_0x21eb5e,_0xc4ff0b['options']);return db[_0x3ac3('0x27')]['find'](_0x21eb5e)[_0x3ac3('0x21')](handleEntityNotFound(_0x33daf6,null))[_0x3ac3('0x21')](respondWithResult(_0x33daf6,null))[_0x3ac3('0x3d')](handleError(_0x33daf6,null));};exports[_0x3ac3('0x43')]=function(_0x27d29d,_0x3a12f2){return db[_0x3ac3('0x27')][_0x3ac3('0x43')](_0x27d29d['body'],{})[_0x3ac3('0x21')](function(_0x170a1e){var _0x339bb3=_0x27d29d['user'][_0x3ac3('0x44')]({'plain':!![]});if(!_0x339bb3)throw new Error(_0x3ac3('0x45'));if(_0x339bb3[_0x3ac3('0x46')]==='user'){var _0x4f7a29=_0x170a1e[_0x3ac3('0x44')]({'plain':!![]});var _0x47bad9='Dispositions';return db[_0x3ac3('0x47')][_0x3ac3('0x48')]({'where':{'name':_0x47bad9,'userProfileId':_0x339bb3['userProfileId']},'raw':!![]})['then'](function(_0x9ff83e){if(_0x9ff83e&&_0x9ff83e[_0x3ac3('0x49')]===0x0){return db[_0x3ac3('0x4a')][_0x3ac3('0x43')]({'name':_0x4f7a29['name'],'resourceId':_0x4f7a29['id'],'type':_0x9ff83e['name'],'sectionId':_0x9ff83e['id']},{})[_0x3ac3('0x21')](function(){return _0x170a1e;});}else{return _0x170a1e;}})[_0x3ac3('0x3d')](function(_0x4ec163){logger[_0x3ac3('0x24')](_0x3ac3('0x4b'),_0x4ec163);throw _0x4ec163;});}return _0x170a1e;})['then'](respondWithResult(_0x3a12f2,0xc9))[_0x3ac3('0x3d')](handleError(_0x3a12f2,null));};exports[_0x3ac3('0x20')]=function(_0x300fea,_0x28274e){if(_0x300fea[_0x3ac3('0x4c')]['id']){delete _0x300fea[_0x3ac3('0x4c')]['id'];}return db[_0x3ac3('0x27')]['find']({'where':{'id':_0x300fea[_0x3ac3('0x3f')]['id']}})[_0x3ac3('0x21')](handleEntityNotFound(_0x28274e,null))['then'](saveUpdates(_0x300fea[_0x3ac3('0x4c')],null))['then'](respondWithResult(_0x28274e,null))[_0x3ac3('0x3d')](handleError(_0x28274e,null));};exports['destroy']=function(_0x5e5fe0,_0x10c08e){return db['Disposition']['find']({'where':{'id':_0x5e5fe0[_0x3ac3('0x3f')]['id']}})[_0x3ac3('0x21')](handleEntityNotFound(_0x10c08e,null))['then'](removeEntity(_0x10c08e,null))[_0x3ac3('0x3d')](handleError(_0x10c08e,null));}; \ No newline at end of file +var _0x73ad=['key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','options','Disposition','includeAll','include','rows','catch','keys','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','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','Content-Range','json','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73ad,0x192));var _0xd73a=function(_0x5ab95c,_0x15e598){_0x5ab95c=_0x5ab95c-0x0;var _0x435c64=_0x73ad[_0x5ab95c];return _0x435c64;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd73a('0x0'));var jsonpatch=require(_0xd73a('0x1'));var rp=require('request-promise');var moment=require(_0xd73a('0x2'));var BPromise=require(_0xd73a('0x3'));var Mustache=require(_0xd73a('0x4'));var util=require('util');var path=require(_0xd73a('0x5'));var sox=require(_0xd73a('0x6'));var csv=require(_0xd73a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd73a('0x8'));var crypto=require(_0xd73a('0x9'));var jsforce=require(_0xd73a('0xa'));var deskjs=require(_0xd73a('0xb'));var toCsv=require(_0xd73a('0x7'));var querystring=require(_0xd73a('0xc'));var Papa=require(_0xd73a('0xd'));var Redis=require(_0xd73a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd73a('0xf'));var as=require(_0xd73a('0x10'));var hardwareService=require(_0xd73a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd73a('0x12'));var config=require(_0xd73a('0x13'));var db=require(_0xd73a('0x14'))['db'];function respondWithStatusCode(_0x4c9adf,_0x55de70){_0x55de70=_0x55de70||0xcc;return function(_0x561bfb){if(_0x561bfb){return _0x4c9adf['sendStatus'](_0x55de70);}return _0x4c9adf[_0xd73a('0x15')](_0x55de70)[_0xd73a('0x16')]();};}function respondWithResult(_0x1f1253,_0x1666bb){_0x1666bb=_0x1666bb||0xc8;return function(_0x2c8b2e){if(_0x2c8b2e){return _0x1f1253['status'](_0x1666bb)['json'](_0x2c8b2e);}};}function respondWithFilteredResult(_0x20f148,_0x3256f6){return function(_0x27dd2d){if(_0x27dd2d){var _0x5ea214=_0x27dd2d[_0xd73a('0x17')],_0x490df9=_0x3256f6[_0xd73a('0x18')],_0x224576=_0x3256f6[_0xd73a('0x18')]+_0x3256f6['limit'],_0x1817d0;if(_0x224576>=_0x5ea214){_0x224576=_0x5ea214;_0x1817d0=0xc8;}else{_0x1817d0=0xce;}_0x20f148[_0xd73a('0x15')](_0x1817d0);return _0x20f148['set'](_0xd73a('0x19'),_0x490df9+'-'+_0x224576+'/'+_0x5ea214)[_0xd73a('0x1a')](_0x27dd2d);}return null;};}function patchUpdates(_0x338032){return function(_0x3e9eee){try{jsonpatch['apply'](_0x3e9eee,_0x338032,!![]);}catch(_0x409bb5){return BPromise[_0xd73a('0x1b')](_0x409bb5);}return _0x3e9eee[_0xd73a('0x1c')]();};}function saveUpdates(_0xd10ac9,_0x4adf8c){return function(_0x2d4c88){if(_0x2d4c88){return _0x2d4c88[_0xd73a('0x1d')](_0xd10ac9)['then'](function(_0x516bf6){return _0x516bf6;});}return null;};}function removeEntity(_0x496d13,_0x5e4fc5){return function(_0x129d4d){if(_0x129d4d){return _0x129d4d['destroy']()[_0xd73a('0x1e')](function(){var _0xd9a753=_0x129d4d[_0xd73a('0x1f')]({'plain':!![]});var _0x29df50=_0xd73a('0x20');return db[_0xd73a('0x21')][_0xd73a('0x22')]({'where':{'type':_0x29df50,'resourceId':_0xd9a753['id']}})[_0xd73a('0x1e')](function(){return _0x129d4d;});})[_0xd73a('0x1e')](function(){_0x496d13[_0xd73a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16e9cc,_0x589dc0){return function(_0xd267c5){if(!_0xd267c5){_0x16e9cc['sendStatus'](0x194);}return _0xd267c5;};}function handleError(_0x5dd369,_0x48bd1a){_0x48bd1a=_0x48bd1a||0x1f4;return function(_0x1e42f0){logger[_0xd73a('0x23')](_0x1e42f0[_0xd73a('0x24')]);if(_0x1e42f0[_0xd73a('0x25')]){delete _0x1e42f0[_0xd73a('0x25')];}_0x5dd369[_0xd73a('0x15')](_0x48bd1a)[_0xd73a('0x26')](_0x1e42f0);};}exports['index']=function(_0x164672,_0x81186a){var _0x2156d7={},_0x28d570={},_0x40e485={'count':0x0,'rows':[]};var _0x100e4f=_[_0xd73a('0x27')](db['Disposition'][_0xd73a('0x28')],function(_0x454b1d){return{'name':_0x454b1d['fieldName'],'type':_0x454b1d[_0xd73a('0x29')][_0xd73a('0x2a')]};});_0x28d570[_0xd73a('0x2b')]=_[_0xd73a('0x27')](_0x100e4f,'name');_0x28d570['query']=_['keys'](_0x164672[_0xd73a('0x2c')]);_0x28d570[_0xd73a('0x2d')]=_[_0xd73a('0x2e')](_0x28d570[_0xd73a('0x2b')],_0x28d570['query']);_0x2156d7['attributes']=_['intersection'](_0x28d570[_0xd73a('0x2b')],qs[_0xd73a('0x2f')](_0x164672[_0xd73a('0x2c')][_0xd73a('0x2f')]));_0x2156d7[_0xd73a('0x30')]=_0x2156d7[_0xd73a('0x30')][_0xd73a('0x31')]?_0x2156d7[_0xd73a('0x30')]:_0x28d570['model'];if(!_0x164672['query']['hasOwnProperty'](_0xd73a('0x32'))){_0x2156d7[_0xd73a('0x33')]=qs[_0xd73a('0x33')](_0x164672[_0xd73a('0x2c')]['limit']);_0x2156d7[_0xd73a('0x18')]=qs['offset'](_0x164672[_0xd73a('0x2c')][_0xd73a('0x18')]);}_0x2156d7[_0xd73a('0x34')]=qs[_0xd73a('0x35')](_0x164672['query']['sort']);_0x2156d7[_0xd73a('0x36')]=qs[_0xd73a('0x2d')](_[_0xd73a('0x37')](_0x164672[_0xd73a('0x2c')],_0x28d570['filters']),_0x100e4f);if(_0x164672[_0xd73a('0x2c')]['filter']){_0x2156d7[_0xd73a('0x36')]=_[_0xd73a('0x38')](_0x2156d7['where'],{'$or':_[_0xd73a('0x27')](_0x100e4f,function(_0x42300c){if(_0x42300c[_0xd73a('0x29')]!=='VIRTUAL'){var _0x509b12={};_0x509b12[_0x42300c['name']]={'$like':'%'+_0x164672[_0xd73a('0x2c')]['filter']+'%'};return _0x509b12;}})});}_0x2156d7=_[_0xd73a('0x38')]({},_0x2156d7,_0x164672[_0xd73a('0x39')]);var _0xba0417={'where':_0x2156d7[_0xd73a('0x36')]};return db[_0xd73a('0x3a')][_0xd73a('0x17')](_0xba0417)[_0xd73a('0x1e')](function(_0x19a2f0){_0x40e485[_0xd73a('0x17')]=_0x19a2f0;if(_0x164672[_0xd73a('0x2c')][_0xd73a('0x3b')]){_0x2156d7[_0xd73a('0x3c')]=[{'all':!![]}];}return db[_0xd73a('0x3a')]['findAll'](_0x2156d7);})[_0xd73a('0x1e')](function(_0xc01d7f){_0x40e485[_0xd73a('0x3d')]=_0xc01d7f;return _0x40e485;})['then'](respondWithFilteredResult(_0x81186a,_0x2156d7))[_0xd73a('0x3e')](handleError(_0x81186a,null));};exports['show']=function(_0x4c6715,_0x413e73){var _0x4936cf={'raw':!![],'where':{'id':_0x4c6715['params']['id']}},_0x4bf84a={};_0x4bf84a[_0xd73a('0x2b')]=_[_0xd73a('0x3f')](db[_0xd73a('0x3a')][_0xd73a('0x28')]);_0x4bf84a[_0xd73a('0x2c')]=_[_0xd73a('0x3f')](_0x4c6715[_0xd73a('0x2c')]);_0x4bf84a[_0xd73a('0x2d')]=_['intersection'](_0x4bf84a[_0xd73a('0x2b')],_0x4bf84a['query']);_0x4936cf[_0xd73a('0x30')]=_[_0xd73a('0x2e')](_0x4bf84a[_0xd73a('0x2b')],qs[_0xd73a('0x2f')](_0x4c6715['query'][_0xd73a('0x2f')]));_0x4936cf['attributes']=_0x4936cf['attributes'][_0xd73a('0x31')]?_0x4936cf['attributes']:_0x4bf84a[_0xd73a('0x2b')];if(_0x4c6715[_0xd73a('0x2c')]['includeAll']){_0x4936cf[_0xd73a('0x3c')]=[{'all':!![]}];}_0x4936cf=_[_0xd73a('0x38')]({},_0x4936cf,_0x4c6715[_0xd73a('0x39')]);return db[_0xd73a('0x3a')][_0xd73a('0x40')](_0x4936cf)[_0xd73a('0x1e')](handleEntityNotFound(_0x413e73,null))[_0xd73a('0x1e')](respondWithResult(_0x413e73,null))[_0xd73a('0x3e')](handleError(_0x413e73,null));};exports[_0xd73a('0x41')]=function(_0x197c14,_0x103c8b){return db['Disposition'][_0xd73a('0x41')](_0x197c14[_0xd73a('0x42')],{})['then'](function(_0xb5e7e){var _0x4b0f98=_0x197c14[_0xd73a('0x43')][_0xd73a('0x1f')]({'plain':!![]});if(!_0x4b0f98)throw new Error(_0xd73a('0x44'));if(_0x4b0f98[_0xd73a('0x45')]===_0xd73a('0x43')){var _0x531eef=_0xb5e7e[_0xd73a('0x1f')]({'plain':!![]});var _0x1d320f='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x1d320f,'userProfileId':_0x4b0f98[_0xd73a('0x46')]},'raw':!![]})[_0xd73a('0x1e')](function(_0x4cfc35){if(_0x4cfc35&&_0x4cfc35[_0xd73a('0x47')]===0x0){return db[_0xd73a('0x21')][_0xd73a('0x41')]({'name':_0x531eef[_0xd73a('0x25')],'resourceId':_0x531eef['id'],'type':_0x4cfc35[_0xd73a('0x25')],'sectionId':_0x4cfc35['id']},{})['then'](function(){return _0xb5e7e;});}else{return _0xb5e7e;}})['catch'](function(_0x246711){logger[_0xd73a('0x23')](_0xd73a('0x48'),_0x246711);throw _0x246711;});}return _0xb5e7e;})[_0xd73a('0x1e')](respondWithResult(_0x103c8b,0xc9))['catch'](handleError(_0x103c8b,null));};exports[_0xd73a('0x1d')]=function(_0x376d0a,_0x3002f8){if(_0x376d0a[_0xd73a('0x42')]['id']){delete _0x376d0a[_0xd73a('0x42')]['id'];}return db[_0xd73a('0x3a')]['find']({'where':{'id':_0x376d0a[_0xd73a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3002f8,null))[_0xd73a('0x1e')](saveUpdates(_0x376d0a[_0xd73a('0x42')],null))[_0xd73a('0x1e')](respondWithResult(_0x3002f8,null))['catch'](handleError(_0x3002f8,null));};exports[_0xd73a('0x22')]=function(_0x12e1df,_0x5941e6){return db[_0xd73a('0x3a')][_0xd73a('0x40')]({'where':{'id':_0x12e1df[_0xd73a('0x49')]['id']}})[_0xd73a('0x1e')](handleEntityNotFound(_0x5941e6,null))[_0xd73a('0x1e')](removeEntity(_0x5941e6,null))[_0xd73a('0x3e')](handleError(_0x5941e6,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 431bf5f..573d4bb 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 _0x175c=['moment','request-promise','rimraf','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x175c,0xb2));var _0xc175=function(_0x4bbf02,_0x29f4fe){_0x4bbf02=_0x4bbf02-0x0;var _0x50f4eb=_0x175c[_0x4bbf02];return _0x50f4eb;};'use strict';var _=require(_0xc175('0x0'));var util=require(_0xc175('0x1'));var logger=require(_0xc175('0x2'))(_0xc175('0x3'));var moment=require(_0xc175('0x4'));var BPromise=require('bluebird');var rp=require(_0xc175('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc175('0x6'));var config=require('../../config/environment');var attributes=require(_0xc175('0x7'));module[_0xc175('0x8')]=function(_0x30ca77,_0x10959f){return _0x30ca77[_0xc175('0x9')]('Disposition',attributes,{'tableName':_0xc175('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xc175('0xb'),'fields':[_0xc175('0xc'),_0xc175('0xd')]},{'unique':!![],'name':_0xc175('0xe'),'fields':[_0xc175('0xc'),_0xc175('0xf')]},{'unique':!![],'name':_0xc175('0x10'),'fields':[_0xc175('0xc'),_0xc175('0x11')]},{'unique':!![],'name':_0xc175('0x12'),'fields':['name',_0xc175('0x13')]},{'unique':!![],'name':_0xc175('0x14'),'fields':[_0xc175('0xc'),_0xc175('0x15')]},{'unique':!![],'name':_0xc175('0x16'),'fields':['name',_0xc175('0x17')]},{'unique':!![],'name':_0xc175('0x18'),'fields':[_0xc175('0xc'),_0xc175('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f97=['name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Disposition','name_voice','name','ListId'];(function(_0x4285b7,_0x11f7fb){var _0x8cb0=function(_0x497eb4){while(--_0x497eb4){_0x4285b7['push'](_0x4285b7['shift']());}};_0x8cb0(++_0x11f7fb);}(_0x9f97,0x152));var _0x79f9=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0x9f97[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0x79f9('0x0'));var util=require(_0x79f9('0x1'));var logger=require(_0x79f9('0x2'))('api');var moment=require(_0x79f9('0x3'));var BPromise=require(_0x79f9('0x4'));var rp=require(_0x79f9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79f9('0x6'));var config=require(_0x79f9('0x7'));var attributes=require('./disposition.attributes');module[_0x79f9('0x8')]=function(_0x3909cb,_0x2bead8){return _0x3909cb[_0x79f9('0x9')](_0x79f9('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x79f9('0xb'),'fields':[_0x79f9('0xc'),_0x79f9('0xd')]},{'unique':!![],'name':_0x79f9('0xe'),'fields':['name',_0x79f9('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x79f9('0xc'),_0x79f9('0x10')]},{'unique':!![],'name':_0x79f9('0x11'),'fields':['name',_0x79f9('0x12')]},{'unique':!![],'name':_0x79f9('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x79f9('0x14'),'fields':['name',_0x79f9('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x79f9('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 6e82f37..d1516b1 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 _0xc78c=['info','Disposition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then'];(function(_0x8ae7dc,_0x328c03){var _0x173d09=function(_0x23a6d3){while(--_0x23a6d3){_0x8ae7dc['push'](_0x8ae7dc['shift']());}};_0x173d09(++_0x328c03);}(_0xc78c,0x1ab));var _0xcc78=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc78c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xcc78('0x0'));var util=require(_0xcc78('0x1'));var moment=require('moment');var BPromise=require(_0xcc78('0x2'));var rs=require(_0xcc78('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc78('0x4'))['db'];var utils=require(_0xcc78('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc78('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcc78('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b5072,_0x536e50,_0x247ecd){return new BPromise(function(_0x1d1e80,_0x12c011){return client[_0xcc78('0x8')](_0x2b5072,_0x247ecd)[_0xcc78('0x9')](function(_0xd47069){logger[_0xcc78('0xa')](_0xcc78('0xb'),_0x536e50,_0xcc78('0xc'));logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x536e50,_0xcc78('0xc'),JSON[_0xcc78('0xd')](_0xd47069));if(_0xd47069[_0xcc78('0xe')]){if(_0xd47069[_0xcc78('0xe')][_0xcc78('0xf')]===0x1f4){logger[_0xcc78('0xe')](_0xcc78('0xb'),_0x536e50,_0xd47069['error'][_0xcc78('0x10')]);return _0x12c011(_0xd47069[_0xcc78('0xe')][_0xcc78('0x10')]);}logger[_0xcc78('0xe')](_0xcc78('0xb'),_0x536e50,_0xd47069[_0xcc78('0xe')]['message']);return _0x1d1e80(_0xd47069['error'][_0xcc78('0x10')]);}else{logger['info'](_0xcc78('0xb'),_0x536e50,_0xcc78('0xc'));_0x1d1e80(_0xd47069[_0xcc78('0x11')][_0xcc78('0x10')]);}})[_0xcc78('0x12')](function(_0x41dd78){logger[_0xcc78('0xe')](_0xcc78('0xb'),_0x536e50,_0x41dd78);_0x12c011(_0x41dd78);});});} \ No newline at end of file +var _0x6aa5=['then','request\x20sent','debug','error','message','Disposition,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x501843,_0x96ded9){var _0xee8882=function(_0x49470a){while(--_0x49470a){_0x501843['push'](_0x501843['shift']());}};_0xee8882(++_0x96ded9);}(_0x6aa5,0x190));var _0x56aa=function(_0x57bca5,_0x1fc3a4){_0x57bca5=_0x57bca5-0x0;var _0x58029d=_0x6aa5[_0x57bca5];return _0x58029d;};'use strict';var _=require(_0x56aa('0x0'));var util=require(_0x56aa('0x1'));var moment=require(_0x56aa('0x2'));var BPromise=require(_0x56aa('0x3'));var rs=require(_0x56aa('0x4'));var fs=require('fs');var Redis=require(_0x56aa('0x5'));var db=require(_0x56aa('0x6'))['db'];var utils=require(_0x56aa('0x7'));var logger=require(_0x56aa('0x8'))(_0x56aa('0x9'));var config=require(_0x56aa('0xa'));var jayson=require(_0x56aa('0xb'));var client=jayson[_0x56aa('0xc')][_0x56aa('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xfa2884,_0xc6002,_0x16a95f){return new BPromise(function(_0x92d00b,_0x27329f){return client['request'](_0xfa2884,_0x16a95f)[_0x56aa('0xe')](function(_0x4e159d){logger['info']('Disposition,\x20%s,\x20%s',_0xc6002,_0x56aa('0xf'));logger[_0x56aa('0x10')]('Disposition,\x20%s,\x20%s,\x20%s',_0xc6002,_0x56aa('0xf'),JSON['stringify'](_0x4e159d));if(_0x4e159d[_0x56aa('0x11')]){if(_0x4e159d[_0x56aa('0x11')]['code']===0x1f4){logger[_0x56aa('0x11')]('Disposition,\x20%s,\x20%s',_0xc6002,_0x4e159d['error'][_0x56aa('0x12')]);return _0x27329f(_0x4e159d[_0x56aa('0x11')][_0x56aa('0x12')]);}logger[_0x56aa('0x11')](_0x56aa('0x13'),_0xc6002,_0x4e159d['error'][_0x56aa('0x12')]);return _0x92d00b(_0x4e159d[_0x56aa('0x11')][_0x56aa('0x12')]);}else{logger[_0x56aa('0x14')](_0x56aa('0x13'),_0xc6002,_0x56aa('0xf'));_0x92d00b(_0x4e159d[_0x56aa('0x15')][_0x56aa('0x12')]);}})[_0x56aa('0x16')](function(_0x1f0df3){logger[_0x56aa('0x11')](_0x56aa('0x13'),_0xc6002,_0x1f0df3);_0x27329f(_0x1f0df3);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index f5b0ee4..4f113f5 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 _0x1aab=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy'];(function(_0x318c66,_0x5f5263){var _0x340af5=function(_0x3b22d0){while(--_0x3b22d0){_0x318c66['push'](_0x318c66['shift']());}};_0x340af5(++_0x5f5263);}(_0x1aab,0x122));var _0xb1aa=function(_0x56b029,_0x20c6f4){_0x56b029=_0x56b029-0x0;var _0x15dd11=_0x1aab[_0x56b029];return _0x15dd11;};'use strict';var multer=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var path=require(_0xb1aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1aa('0x3'));var router=express['Router']();var auth=require(_0xb1aa('0x4'));var interaction=require(_0xb1aa('0x5'));var config=require(_0xb1aa('0x6'));var controller=require(_0xb1aa('0x7'));router[_0xb1aa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb1aa('0x8')](_0xb1aa('0x9'),auth[_0xb1aa('0xa')](),controller[_0xb1aa('0xb')]);router[_0xb1aa('0xc')]('/',auth[_0xb1aa('0xa')](),controller[_0xb1aa('0xd')]);router['put'](_0xb1aa('0x9'),auth[_0xb1aa('0xa')](),controller['update']);router[_0xb1aa('0xe')](_0xb1aa('0x9'),auth[_0xb1aa('0xa')](),controller[_0xb1aa('0xf')]);module[_0xb1aa('0x10')]=router; \ No newline at end of file +var _0xba37=['../../config/environment','./disposition.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete','exports','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0xba37,0xb6));var _0x7ba3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xba37[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x7ba3('0x0'));var util=require('util');var path=require(_0x7ba3('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ba3('0x2'));var router=express['Router']();var auth=require(_0x7ba3('0x3'));var interaction=require(_0x7ba3('0x4'));var config=require(_0x7ba3('0x5'));var controller=require(_0x7ba3('0x6'));router[_0x7ba3('0x7')]('/',auth['isAuthenticated'](),controller[_0x7ba3('0x8')]);router['get']('/:id',auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xa')]);router['post']('/',auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xb')]);router[_0x7ba3('0xc')](_0x7ba3('0xd'),auth[_0x7ba3('0x9')](),controller[_0x7ba3('0xe')]);router[_0x7ba3('0xf')](_0x7ba3('0xd'),auth[_0x7ba3('0x9')](),controller['destroy']);module[_0x7ba3('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index e258165..aa50340 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 _0xfddd=['4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','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','2400'];(function(_0x452c43,_0x44f5c8){var _0x25a8de=function(_0x2837ae){while(--_0x2837ae){_0x452c43['push'](_0x452c43['shift']());}};_0x25a8de(++_0x44f5c8);}(_0xfddd,0x14a));var _0xdfdd=function(_0x405a2c,_0x49f67c){_0x405a2c=_0x405a2c-0x0;var _0x51408e=_0xfddd[_0x405a2c];return _0x51408e;};'use strict';var Sequelize=require(_0xdfdd('0x0'));module['exports']={'name':{'type':Sequelize[_0xdfdd('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdfdd('0x1')]},'ecm':{'type':Sequelize[_0xdfdd('0x2')]('yes','no'),'defaultValue':_0xdfdd('0x3')},'headerinfo':{'type':Sequelize[_0xdfdd('0x1')],'defaultValue':_0xdfdd('0x4')},'localstationid':{'type':Sequelize[_0xdfdd('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xdfdd('0x2')](_0xdfdd('0x5'),_0xdfdd('0x6'),_0xdfdd('0x7'),'9600',_0xdfdd('0x8'),_0xdfdd('0x9')),'defaultValue':_0xdfdd('0x6')},'maxrate':{'type':Sequelize[_0xdfdd('0x2')]('2400',_0xdfdd('0x6'),_0xdfdd('0x7'),_0xdfdd('0xa'),_0xdfdd('0x8'),_0xdfdd('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xdfdd('0xb')},'gateway':{'type':Sequelize[_0xdfdd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdfdd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdfdd('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xdfdd('0xd'),_0xdfdd('0xe'),_0xdfdd('0xf'),_0xdfdd('0x10')),'defaultValue':_0xdfdd('0xd')},'key':{'type':Sequelize[_0xdfdd('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdfdd('0x11')],'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[_0xdfdd('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdfdd('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdfdd('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdfdd('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdfdd('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdfdd('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdfdd('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xdfdd('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xdfdd('0x12')],'defaultValue':![],'comment':_0xdfdd('0x14'),'set':function(_0x495f88){if(!_0x495f88)this[_0xdfdd('0x15')](_0xdfdd('0x16'),null);this[_0xdfdd('0x15')](_0xdfdd('0x17'),_0x495f88);}}}; \ No newline at end of file +var _0xac7b=['BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac7b,0x123));var _0xbac7=function(_0x27cd67,_0x38bc73){_0x27cd67=_0x27cd67-0x0;var _0x3bb7ed=_0xac7b[_0x27cd67];return _0x3bb7ed;};'use strict';var Sequelize=require(_0xbac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xbac7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xbac7('0x2'),'no'),'defaultValue':_0xbac7('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xbac7('0x3')},'localstationid':{'type':Sequelize[_0xbac7('0x1')],'unique':_0xbac7('0x4')},'minrate':{'type':Sequelize[_0xbac7('0x5')](_0xbac7('0x6'),_0xbac7('0x7'),_0xbac7('0x8'),_0xbac7('0x9'),_0xbac7('0xa'),'14400'),'defaultValue':_0xbac7('0x7')},'maxrate':{'type':Sequelize[_0xbac7('0x5')](_0xbac7('0x6'),_0xbac7('0x7'),_0xbac7('0x8'),_0xbac7('0x9'),_0xbac7('0xa'),'14400'),'defaultValue':_0xbac7('0xb')},'modem':{'type':Sequelize[_0xbac7('0x1')],'defaultValue':_0xbac7('0xc')},'gateway':{'type':Sequelize[_0xbac7('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbac7('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbac7('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbac7('0x5')](_0xbac7('0xe'),_0xbac7('0xf'),'DADHI','KHOMP'),'defaultValue':_0xbac7('0xe')},'key':{'type':Sequelize[_0xbac7('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbac7('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbac7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbac7('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbac7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbac7('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbac7('0x11')],'defaultValue':![],'comment':_0xbac7('0x12'),'set':function(_0x58d8f5){if(!_0x58d8f5)this[_0xbac7('0x13')](_0xbac7('0x14'),null);this[_0xbac7('0x13')](_0xbac7('0x15'),_0x58d8f5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7853748..a9ddeb3 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 _0xe536=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','limit','set','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','offset','order','sort','where','filter','merge','options','FaxAccount','include','findAll','params','Pause','includeAll','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','Disposition','getDispositions','findOne','rawAttributes','FaxAccountId','rows','removeDispositions','ids','getAnswers','CannedAnswer','pick','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','hasOwnProperty','CmContact','Contact','User','color','tag','addApplications','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','sequelize','transaction','VoiceExtension','bulkCreate','tech','TrunkId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','updatedAt','attachments','join','CheckAfterSend','isNil','from','fax','Contacts','List','ListId','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','removeAgents','userFaxAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x330018,_0x3c933e){var _0x3dc0f8=function(_0x18fd33){while(--_0x18fd33){_0x330018['push'](_0x330018['shift']());}};_0x3dc0f8(++_0x3c933e);}(_0xe536,0xb5));var _0x6e53=function(_0x299f5c,_0x5738dd){_0x299f5c=_0x299f5c-0x0;var _0x5da026=_0xe536[_0x299f5c];return _0x5da026;};'use strict';var pdf=require(_0x6e53('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6e53('0x1'));var zipdir=require(_0x6e53('0x2'));var jsonpatch=require(_0x6e53('0x3'));var rp=require(_0x6e53('0x4'));var moment=require(_0x6e53('0x5'));var BPromise=require(_0x6e53('0x6'));var Mustache=require(_0x6e53('0x7'));var util=require('util');var path=require(_0x6e53('0x8'));var sox=require(_0x6e53('0x9'));var csv=require(_0x6e53('0xa'));var ejs=require(_0x6e53('0xb'));var fs=require('fs');var _=require(_0x6e53('0xc'));var squel=require(_0x6e53('0xd'));var crypto=require(_0x6e53('0xe'));var jsforce=require(_0x6e53('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6e53('0xa'));var querystring=require(_0x6e53('0x10'));var Papa=require('papaparse');var Redis=require(_0x6e53('0x11'));var authService=require(_0x6e53('0x12'));var qs=require(_0x6e53('0x13'));var as=require(_0x6e53('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e53('0x15'))(_0x6e53('0x16'));var utils=require('../../config/utils');var config=require(_0x6e53('0x17'));var db=require(_0x6e53('0x18'))['db'];config[_0x6e53('0x19')]=_[_0x6e53('0x1a')](config[_0x6e53('0x19')],{'host':_0x6e53('0x1b'),'port':0x18eb});var socket=require(_0x6e53('0x1c'))(new Redis(config[_0x6e53('0x19')]));require(_0x6e53('0x1d'))[_0x6e53('0x1e')](socket);var jayson=require(_0x6e53('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x6e53('0x20')][_0x6e53('0x21')]({'port':0x232a});function checkPasswordPattern(_0x915a11,_0x4f2c11,_0x58c717){if(_0x58c717){var _0x169d59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x169d59[_0x6e53('0x22')](_0x4f2c11)){return _0x915a11;}else{throw new db[(_0x6e53('0x23'))][(_0x6e53('0x24'))](_0x6e53('0x25'));}}else{return _0x915a11;}}function respondWithRpcPromise(_0x48bfbb,_0x11dc95,_0x1d64b9,_0x191a9a){return new BPromise(function(_0x169872,_0x4ea8f9){var _0x5583eb=_0x191a9a||client;return _0x5583eb['request'](_0x48bfbb,_0x1d64b9)[_0x6e53('0x26')](function(_0x3a7f26){logger[_0x6e53('0x27')](_0x6e53('0x28'),_0x11dc95,_0x6e53('0x29'));logger[_0x6e53('0x2a')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x11dc95,'request\x20sent',JSON[_0x6e53('0x2b')](_0x3a7f26));if(_0x3a7f26[_0x6e53('0x2c')]){if(_0x3a7f26['error']['code']===0x1f4){logger[_0x6e53('0x2c')](_0x6e53('0x28'),_0x11dc95,_0x3a7f26[_0x6e53('0x2c')][_0x6e53('0x2d')]);return _0x4ea8f9(_0x3a7f26[_0x6e53('0x2c')][_0x6e53('0x2d')]);}logger[_0x6e53('0x2c')](_0x6e53('0x28'),_0x11dc95,_0x3a7f26['error'][_0x6e53('0x2d')]);return _0x169872(_0x3a7f26[_0x6e53('0x2c')][_0x6e53('0x2d')]);}else{logger[_0x6e53('0x27')](_0x6e53('0x28'),_0x11dc95,_0x6e53('0x29'));_0x169872(_0x3a7f26[_0x6e53('0x2e')]['message']);}})[_0x6e53('0x2f')](function(_0x304deb){logger[_0x6e53('0x2c')](_0x6e53('0x28'),_0x11dc95,_0x304deb);_0x4ea8f9(_0x304deb);});});}function respondWithStatusCode(_0x4268e3,_0x3b1f9b){_0x3b1f9b=_0x3b1f9b||0xcc;return function(_0x218414){if(_0x218414){return _0x4268e3[_0x6e53('0x30')](_0x3b1f9b);}return _0x4268e3[_0x6e53('0x31')](_0x3b1f9b)[_0x6e53('0x32')]();};}function respondWithResult(_0x1eddd7,_0x215eb4){_0x215eb4=_0x215eb4||0xc8;return function(_0x343521){if(_0x343521){return _0x1eddd7['status'](_0x215eb4)[_0x6e53('0x33')](_0x343521);}};}function respondWithFilteredResult(_0x206d09,_0x4abaf2){return function(_0x3f4e1f){if(_0x3f4e1f){var _0x2cfc13=_0x3f4e1f[_0x6e53('0x34')],_0x27661d=_0x4abaf2['offset'],_0x503df8=_0x4abaf2['offset']+_0x4abaf2[_0x6e53('0x35')],_0x190eff;if(_0x503df8>=_0x2cfc13){_0x503df8=_0x2cfc13;_0x190eff=0xc8;}else{_0x190eff=0xce;}_0x206d09['status'](_0x190eff);return _0x206d09[_0x6e53('0x36')]('Content-Range',_0x27661d+'-'+_0x503df8+'/'+_0x2cfc13)[_0x6e53('0x33')](_0x3f4e1f);}return null;};}function patchUpdates(_0x30d5a3){return function(_0x4d7039){try{jsonpatch['apply'](_0x4d7039,_0x30d5a3,!![]);}catch(_0x51aaf5){return BPromise[_0x6e53('0x37')](_0x51aaf5);}return _0x4d7039['save']();};}function saveUpdates(_0x5a0256,_0x16d244){return function(_0x2723db){if(_0x2723db){return _0x2723db[_0x6e53('0x38')](_0x5a0256)[_0x6e53('0x26')](function(_0x4ffc31){return _0x4ffc31;});}return null;};}function removeEntity(_0x4e5161,_0x19bfd5){return function(_0x41ccdd){if(_0x41ccdd){return _0x41ccdd[_0x6e53('0x39')]()[_0x6e53('0x26')](function(){var _0x55484d=_0x41ccdd[_0x6e53('0x3a')]({'plain':!![]});var _0xeab5e4=_0x6e53('0x3b');return db[_0x6e53('0x3c')][_0x6e53('0x39')]({'where':{'type':_0xeab5e4,'resourceId':_0x55484d['id']}})['then'](function(){return _0x41ccdd;});})[_0x6e53('0x26')](function(){_0x4e5161[_0x6e53('0x31')](0xcc)[_0x6e53('0x32')]();});}};}function handleEntityNotFound(_0x227166,_0x1bfc42){return function(_0x315946){if(!_0x315946){_0x227166[_0x6e53('0x30')](0x194);}return _0x315946;};}function handleError(_0x133566,_0x281e8e){_0x281e8e=_0x281e8e||0x1f4;return function(_0x2fdf48){logger[_0x6e53('0x2c')](_0x2fdf48[_0x6e53('0x3d')]);if(_0x2fdf48[_0x6e53('0x3e')]){delete _0x2fdf48[_0x6e53('0x3e')];}_0x133566['status'](_0x281e8e)['send'](_0x2fdf48);};}exports[_0x6e53('0x3f')]=function(_0x2888e5,_0x195f90){var _0x481af7={'include':[{'model':db['Pause'],'as':_0x6e53('0x40')}]},_0x4aa4f5={},_0x5282ba={'count':0x0,'rows':[]};var _0xde2c74=_[_0x6e53('0x41')](db['FaxAccount']['rawAttributes'],function(_0x8e02bd){return{'name':_0x8e02bd[_0x6e53('0x42')],'type':_0x8e02bd[_0x6e53('0x43')][_0x6e53('0x44')]};});_0x4aa4f5['model']=_[_0x6e53('0x41')](_0xde2c74,_0x6e53('0x3e'));_0x4aa4f5[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x2888e5['query']);_0x4aa4f5[_0x6e53('0x47')]=_[_0x6e53('0x48')](_0x4aa4f5['model'],_0x4aa4f5[_0x6e53('0x45')]);_0x481af7[_0x6e53('0x49')]=_['intersection'](_0x4aa4f5[_0x6e53('0x4a')],qs[_0x6e53('0x4b')](_0x2888e5[_0x6e53('0x45')][_0x6e53('0x4b')]));_0x481af7[_0x6e53('0x49')]=_0x481af7[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x481af7['attributes']:_0x4aa4f5[_0x6e53('0x4a')];if(!_0x2888e5[_0x6e53('0x45')]['hasOwnProperty'](_0x6e53('0x4d'))){_0x481af7[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x2888e5[_0x6e53('0x45')][_0x6e53('0x35')]);_0x481af7[_0x6e53('0x4e')]=qs[_0x6e53('0x4e')](_0x2888e5[_0x6e53('0x45')]['offset']);}_0x481af7[_0x6e53('0x4f')]=qs['sort'](_0x2888e5['query'][_0x6e53('0x50')]);_0x481af7[_0x6e53('0x51')]=qs['filters'](_['pick'](_0x2888e5[_0x6e53('0x45')],_0x4aa4f5[_0x6e53('0x47')]),_0xde2c74);if(_0x2888e5[_0x6e53('0x45')][_0x6e53('0x52')]){_0x481af7[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x481af7[_0x6e53('0x51')],{'$or':_[_0x6e53('0x41')](_0xde2c74,function(_0x159488){if(_0x159488[_0x6e53('0x43')]!=='VIRTUAL'){var _0x239dab={};_0x239dab[_0x159488[_0x6e53('0x3e')]]={'$like':'%'+_0x2888e5[_0x6e53('0x45')]['filter']+'%'};return _0x239dab;}})});}_0x481af7=_[_0x6e53('0x53')]({},_0x481af7,_0x2888e5[_0x6e53('0x54')]);var _0x2c2876={'where':_0x481af7[_0x6e53('0x51')]};return db[_0x6e53('0x55')][_0x6e53('0x34')](_0x2c2876)[_0x6e53('0x26')](function(_0x3d827b){_0x5282ba[_0x6e53('0x34')]=_0x3d827b;if(_0x2888e5[_0x6e53('0x45')]['includeAll']){_0x481af7[_0x6e53('0x56')]=[{'all':!![]}];}return db[_0x6e53('0x55')][_0x6e53('0x57')](_0x481af7);})[_0x6e53('0x26')](function(_0x247bb1){_0x5282ba['rows']=_0x247bb1;return _0x5282ba;})[_0x6e53('0x26')](respondWithFilteredResult(_0x195f90,_0x481af7))['catch'](handleError(_0x195f90,null));};exports['show']=function(_0x4c2cc1,_0x32a542){var _0x3e4085={'raw':![],'where':{'id':_0x4c2cc1[_0x6e53('0x58')]['id']},'include':[{'model':db[_0x6e53('0x59')],'as':_0x6e53('0x40')}]},_0x4009bb={};_0x4009bb['model']=_['keys'](db['FaxAccount']['rawAttributes']);_0x4009bb[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x4c2cc1[_0x6e53('0x45')]);_0x4009bb[_0x6e53('0x47')]=_[_0x6e53('0x48')](_0x4009bb[_0x6e53('0x4a')],_0x4009bb[_0x6e53('0x45')]);_0x3e4085[_0x6e53('0x49')]=_['intersection'](_0x4009bb['model'],qs['fields'](_0x4c2cc1[_0x6e53('0x45')]['fields']));_0x3e4085['attributes']=_0x3e4085[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x3e4085[_0x6e53('0x49')]:_0x4009bb[_0x6e53('0x4a')];if(_0x4c2cc1[_0x6e53('0x45')][_0x6e53('0x5a')]){_0x3e4085['include']=[{'all':!![]}];}_0x3e4085=_['merge']({},_0x3e4085,_0x4c2cc1[_0x6e53('0x54')]);return db[_0x6e53('0x55')]['find'](_0x3e4085)[_0x6e53('0x26')](handleEntityNotFound(_0x32a542,null))[_0x6e53('0x26')](respondWithResult(_0x32a542,null))['catch'](handleError(_0x32a542,null));};exports['create']=function(_0x3ea727,_0x4059dd){return db[_0x6e53('0x55')][_0x6e53('0x5b')](_0x3ea727[_0x6e53('0x5c')],{})[_0x6e53('0x26')](function(_0x1cb07b){var _0x43c2dd=_0x3ea727[_0x6e53('0x5d')][_0x6e53('0x3a')]({'plain':!![]});if(!_0x43c2dd)throw new Error(_0x6e53('0x5e'));if(_0x43c2dd[_0x6e53('0x5f')]===_0x6e53('0x5d')){var _0xd797e7=_0x1cb07b[_0x6e53('0x3a')]({'plain':!![]});var _0x2522b8=_0x6e53('0x3b');return db[_0x6e53('0x60')][_0x6e53('0x61')]({'where':{'name':_0x2522b8,'userProfileId':_0x43c2dd[_0x6e53('0x62')]},'raw':!![]})[_0x6e53('0x26')](function(_0x53d2e2){if(_0x53d2e2&&_0x53d2e2[_0x6e53('0x63')]===0x0){return db[_0x6e53('0x3c')][_0x6e53('0x5b')]({'name':_0xd797e7[_0x6e53('0x3e')],'resourceId':_0xd797e7['id'],'type':_0x53d2e2[_0x6e53('0x3e')],'sectionId':_0x53d2e2['id']},{})['then'](function(){return _0x1cb07b;});}else{return _0x1cb07b;}})[_0x6e53('0x2f')](function(_0xaa36fc){logger[_0x6e53('0x2c')](_0x6e53('0x64'),_0xaa36fc);throw _0xaa36fc;});}return _0x1cb07b;})[_0x6e53('0x26')](respondWithResult(_0x4059dd,0xc9))[_0x6e53('0x2f')](handleError(_0x4059dd,null));};exports['update']=function(_0x421913,_0x476e7d){if(_0x421913[_0x6e53('0x5c')]['id']){delete _0x421913[_0x6e53('0x5c')]['id'];}return db[_0x6e53('0x55')][_0x6e53('0x61')]({'where':{'id':_0x421913[_0x6e53('0x58')]['id']},'include':[{'model':db[_0x6e53('0x59')],'as':_0x6e53('0x40')}]})[_0x6e53('0x26')](handleEntityNotFound(_0x476e7d,null))[_0x6e53('0x26')](saveUpdates(_0x421913[_0x6e53('0x5c')],null))[_0x6e53('0x26')](respondWithResult(_0x476e7d,null))[_0x6e53('0x2f')](handleError(_0x476e7d,null));};exports[_0x6e53('0x39')]=function(_0x554775,_0xdd2dea){return db[_0x6e53('0x55')][_0x6e53('0x61')]({'where':{'id':_0x554775[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0xdd2dea,null))['then'](removeEntity(_0xdd2dea,null))[_0x6e53('0x2f')](handleError(_0xdd2dea,null));};exports[_0x6e53('0x65')]=function(_0x3a5f5a,_0x967e74){return db[_0x6e53('0x55')][_0x6e53('0x65')]()[_0x6e53('0x26')](respondWithResult(_0x967e74,null))[_0x6e53('0x2f')](handleError(_0x967e74,null));};exports['addDisposition']=function(_0x87fe46,_0x4b3c94,_0x53ae7e){if(_0x87fe46['body']['id']){delete _0x87fe46[_0x6e53('0x5c')]['id'];}return db['FaxAccount'][_0x6e53('0x61')]({'where':{'id':_0x87fe46[_0x6e53('0x58')]['id']}})['then'](handleEntityNotFound(_0x4b3c94,null))[_0x6e53('0x26')](function(_0x2ff649){if(_0x2ff649){_0x87fe46[_0x6e53('0x5c')]['FaxAccountId']=_0x2ff649['id'];return db[_0x6e53('0x66')][_0x6e53('0x5b')](_0x87fe46[_0x6e53('0x5c')]);}})['then'](respondWithResult(_0x4b3c94,null))[_0x6e53('0x2f')](handleError(_0x4b3c94,null));};exports[_0x6e53('0x67')]=function(_0x90b82a,_0x4af79e,_0x3a417f){var _0x1ecc71={'raw':![],'where':{}};var _0x4795a8={};var _0x2c844d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6e53('0x68')]({'where':{'id':_0x90b82a['params']['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x4af79e,null))[_0x6e53('0x26')](function(_0x4cb7a9){if(_0x4cb7a9){_0x4795a8[_0x6e53('0x4a')]=_[_0x6e53('0x46')](db[_0x6e53('0x66')][_0x6e53('0x69')]);_0x4795a8['query']=_[_0x6e53('0x46')](_0x90b82a[_0x6e53('0x45')]);_0x4795a8[_0x6e53('0x47')]=_[_0x6e53('0x48')](_0x4795a8[_0x6e53('0x4a')],_0x4795a8[_0x6e53('0x45')]);_0x1ecc71[_0x6e53('0x49')]=_[_0x6e53('0x48')](_0x4795a8[_0x6e53('0x4a')],qs[_0x6e53('0x4b')](_0x90b82a[_0x6e53('0x45')]['fields']));_0x1ecc71[_0x6e53('0x49')]=_0x1ecc71[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x1ecc71[_0x6e53('0x49')]:_0x4795a8[_0x6e53('0x4a')];if(!_0x90b82a[_0x6e53('0x45')]['hasOwnProperty'](_0x6e53('0x4d'))){_0x1ecc71[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x90b82a[_0x6e53('0x45')][_0x6e53('0x35')]);_0x1ecc71['offset']=qs['offset'](_0x90b82a[_0x6e53('0x45')][_0x6e53('0x4e')]);}_0x1ecc71[_0x6e53('0x4f')]=qs['sort'](_0x90b82a[_0x6e53('0x45')][_0x6e53('0x50')]);_0x1ecc71[_0x6e53('0x51')]=qs[_0x6e53('0x47')](_['pick'](_0x90b82a[_0x6e53('0x45')],_0x4795a8[_0x6e53('0x47')]));_0x1ecc71[_0x6e53('0x51')][_0x6e53('0x6a')]=_0x4cb7a9['id'];if(_0x90b82a['query'][_0x6e53('0x52')]){_0x1ecc71[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x1ecc71['where'],{'$or':_['map'](_0x1ecc71[_0x6e53('0x49')],function(_0x1b9b00){var _0x8a9340={};_0x8a9340[_0x1b9b00]={'$like':'%'+_0x90b82a['query'][_0x6e53('0x52')]+'%'};return _0x8a9340;})});}_0x1ecc71=_['merge']({},_0x1ecc71,_0x90b82a[_0x6e53('0x54')]);return db['Disposition'][_0x6e53('0x34')]({'where':_0x1ecc71['where']})[_0x6e53('0x26')](function(_0x1c30db){_0x2c844d[_0x6e53('0x34')]=_0x1c30db;if(_0x90b82a['query'][_0x6e53('0x5a')]){_0x1ecc71[_0x6e53('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x6e53('0x57')](_0x1ecc71);})[_0x6e53('0x26')](function(_0x4c8b77){_0x2c844d[_0x6e53('0x6b')]=_0x4c8b77;return _0x2c844d;});}})[_0x6e53('0x26')](respondWithFilteredResult(_0x4af79e,_0x1ecc71))['catch'](handleError(_0x4af79e,null));};exports[_0x6e53('0x6c')]=function(_0x285070,_0x45d435,_0x31f35e){return db['FaxAccount'][_0x6e53('0x61')]({'where':{'id':_0x285070[_0x6e53('0x58')]['id']}})['then'](handleEntityNotFound(_0x45d435,null))[_0x6e53('0x26')](function(_0xa34855){if(_0xa34855){return _0xa34855[_0x6e53('0x6c')](_0x285070['query'][_0x6e53('0x6d')]);}})[_0x6e53('0x26')](respondWithStatusCode(_0x45d435,null))[_0x6e53('0x2f')](handleError(_0x45d435,null));};exports['addAnswer']=function(_0x486e3c,_0xd4f19,_0x4ae932){if(_0x486e3c[_0x6e53('0x5c')]['id']){delete _0x486e3c[_0x6e53('0x5c')]['id'];}return db[_0x6e53('0x55')]['find']({'where':{'id':_0x486e3c[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0xd4f19,null))[_0x6e53('0x26')](function(_0x45970e){if(_0x45970e){_0x486e3c[_0x6e53('0x5c')][_0x6e53('0x6a')]=_0x45970e['id'];return db['CannedAnswer'][_0x6e53('0x5b')](_0x486e3c[_0x6e53('0x5c')]);}})['then'](respondWithResult(_0xd4f19,null))['catch'](handleError(_0xd4f19,null));};exports[_0x6e53('0x6e')]=function(_0x17bb05,_0x381e68,_0x4ad79a){var _0x3efd75={'raw':![],'where':{}};var _0x1bedd9={};var _0x2b18d={'count':0x0,'rows':[]};return db[_0x6e53('0x55')][_0x6e53('0x68')]({'where':{'id':_0x17bb05['params']['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x381e68,null))[_0x6e53('0x26')](function(_0x4bb4ab){if(_0x4bb4ab){_0x1bedd9[_0x6e53('0x4a')]=_[_0x6e53('0x46')](db[_0x6e53('0x6f')][_0x6e53('0x69')]);_0x1bedd9[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x17bb05[_0x6e53('0x45')]);_0x1bedd9[_0x6e53('0x47')]=_[_0x6e53('0x48')](_0x1bedd9['model'],_0x1bedd9[_0x6e53('0x45')]);_0x3efd75[_0x6e53('0x49')]=_[_0x6e53('0x48')](_0x1bedd9[_0x6e53('0x4a')],qs['fields'](_0x17bb05[_0x6e53('0x45')]['fields']));_0x3efd75[_0x6e53('0x49')]=_0x3efd75['attributes'][_0x6e53('0x4c')]?_0x3efd75[_0x6e53('0x49')]:_0x1bedd9[_0x6e53('0x4a')];if(!_0x17bb05[_0x6e53('0x45')]['hasOwnProperty']('nolimit')){_0x3efd75[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x17bb05[_0x6e53('0x45')]['limit']);_0x3efd75['offset']=qs[_0x6e53('0x4e')](_0x17bb05['query'][_0x6e53('0x4e')]);}_0x3efd75[_0x6e53('0x4f')]=qs[_0x6e53('0x50')](_0x17bb05[_0x6e53('0x45')][_0x6e53('0x50')]);_0x3efd75[_0x6e53('0x51')]=qs[_0x6e53('0x47')](_[_0x6e53('0x70')](_0x17bb05['query'],_0x1bedd9[_0x6e53('0x47')]));_0x3efd75[_0x6e53('0x51')][_0x6e53('0x6a')]=_0x4bb4ab['id'];if(_0x17bb05['query']['filter']){_0x3efd75['where']=_['merge'](_0x3efd75['where'],{'$or':_[_0x6e53('0x41')](_0x3efd75['attributes'],function(_0x534eb0){var _0x12d709={};_0x12d709[_0x534eb0]={'$like':'%'+_0x17bb05[_0x6e53('0x45')][_0x6e53('0x52')]+'%'};return _0x12d709;})});}_0x3efd75=_[_0x6e53('0x53')]({},_0x3efd75,_0x17bb05[_0x6e53('0x54')]);return db[_0x6e53('0x6f')]['count']({'where':_0x3efd75[_0x6e53('0x51')]})[_0x6e53('0x26')](function(_0x3c2c1e){_0x2b18d[_0x6e53('0x34')]=_0x3c2c1e;if(_0x17bb05['query'][_0x6e53('0x5a')]){_0x3efd75[_0x6e53('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6e53('0x57')](_0x3efd75);})[_0x6e53('0x26')](function(_0x339394){_0x2b18d[_0x6e53('0x6b')]=_0x339394;return _0x2b18d;});}})['then'](respondWithFilteredResult(_0x381e68,_0x3efd75))[_0x6e53('0x2f')](handleError(_0x381e68,null));};exports[_0x6e53('0x71')]=function(_0x365973,_0x176bd2,_0x3a9838){return db[_0x6e53('0x55')][_0x6e53('0x61')]({'where':{'id':_0x365973['params']['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x176bd2,null))[_0x6e53('0x26')](function(_0x218ee4){if(_0x218ee4){return _0x218ee4['removeAnswers'](_0x365973[_0x6e53('0x45')][_0x6e53('0x6d')]);}})['then'](respondWithStatusCode(_0x176bd2,null))[_0x6e53('0x2f')](handleError(_0x176bd2,null));};exports[_0x6e53('0x72')]=function(_0x3de06a,_0x3043d2,_0x12844a){return db[_0x6e53('0x73')]['find']({'where':{'id':_0x3de06a[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x3043d2,null))[_0x6e53('0x26')](function(_0x4ae3e0){if(_0x4ae3e0){return _0x4ae3e0[_0x6e53('0x72')](_0x3de06a[_0x6e53('0x5c')]['ids'],_[_0x6e53('0x74')](_0x3de06a[_0x6e53('0x5c')],['ids','id'])||{});}})[_0x6e53('0x26')](respondWithResult(_0x3043d2,null))[_0x6e53('0x2f')](handleError(_0x3043d2,null));};exports[_0x6e53('0x75')]=function(_0x2a5cf6,_0x53526f,_0x16ba4d){var _0x543f50={'raw':![],'where':{}};var _0x1c9dcc={};var _0x1f6b34={'count':0x0,'rows':[]};return db[_0x6e53('0x55')][_0x6e53('0x68')]({'where':{'id':_0x2a5cf6['params']['id']}})['then'](handleEntityNotFound(_0x53526f,null))[_0x6e53('0x26')](function(_0xae1723){if(_0xae1723){_0x1c9dcc[_0x6e53('0x4a')]=_[_0x6e53('0x46')](db[_0x6e53('0x73')][_0x6e53('0x69')]);_0x1c9dcc[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x2a5cf6['query']);_0x1c9dcc[_0x6e53('0x47')]=_[_0x6e53('0x48')](_0x1c9dcc[_0x6e53('0x4a')],_0x1c9dcc[_0x6e53('0x45')]);_0x543f50['attributes']=_[_0x6e53('0x48')](_0x1c9dcc[_0x6e53('0x4a')],qs[_0x6e53('0x4b')](_0x2a5cf6[_0x6e53('0x45')]['fields']));_0x543f50[_0x6e53('0x49')]=_0x543f50[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x543f50['attributes']:_0x1c9dcc[_0x6e53('0x4a')];if(!_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x76')](_0x6e53('0x4d'))){_0x543f50[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x35')]);_0x543f50['offset']=qs[_0x6e53('0x4e')](_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x4e')]);}_0x543f50[_0x6e53('0x4f')]=qs[_0x6e53('0x50')](_0x2a5cf6['query'][_0x6e53('0x50')]);_0x543f50[_0x6e53('0x51')]=qs[_0x6e53('0x47')](_[_0x6e53('0x70')](_0x2a5cf6['query'],_0x1c9dcc['filters']));_0x543f50[_0x6e53('0x51')][_0x6e53('0x6a')]=_0xae1723['id'];if(_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x52')]){_0x543f50[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x543f50[_0x6e53('0x51')],{'$or':_['map'](_0x543f50['attributes'],function(_0x1afe41){var _0x3c845f={};_0x3c845f[_0x1afe41]={'$like':'%'+_0x2a5cf6['query'][_0x6e53('0x52')]+'%'};return _0x3c845f;})});}_0x543f50=_['merge']({},_0x543f50,_0x2a5cf6[_0x6e53('0x54')]);return db[_0x6e53('0x73')]['count']({'where':_0x543f50[_0x6e53('0x51')]})['then'](function(_0xdf2c68){_0x1f6b34[_0x6e53('0x34')]=_0xdf2c68;if(_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x5a')]){_0x543f50[_0x6e53('0x56')]=[{'model':db[_0x6e53('0x77')],'as':_0x6e53('0x78'),'required':![]},{'model':db[_0x6e53('0x79')],'as':'Owner','attributes':[_0x6e53('0x3e'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x6e53('0x3e'),_0x6e53('0x7a')],'where':_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x7b')]?{'id':_0x2a5cf6[_0x6e53('0x45')][_0x6e53('0x7b')]}:undefined,'required':_0x2a5cf6[_0x6e53('0x45')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x6e53('0x57')](_0x543f50);})[_0x6e53('0x26')](function(_0x1b7742){_0x1f6b34[_0x6e53('0x6b')]=_0x1b7742;return _0x1f6b34;});}})[_0x6e53('0x26')](respondWithFilteredResult(_0x53526f,_0x543f50))[_0x6e53('0x2f')](handleError(_0x53526f,null));};exports[_0x6e53('0x7c')]=function(_0x1d770f,_0x4644a1,_0x34dbc0){return db['FaxAccount'][_0x6e53('0x68')]({'where':{'id':_0x1d770f[_0x6e53('0x58')]['id']}})['then'](handleEntityNotFound(_0x4644a1,null))[_0x6e53('0x26')](function(_0x50688d){if(_0x50688d){return db['sequelize']['transaction'](function(_0x12846d){return db['FaxApplication'][_0x6e53('0x39')]({'where':{'FaxAccountId':_0x1d770f[_0x6e53('0x58')]['id']},'transaction':_0x12846d})[_0x6e53('0x26')](function(_0x16478d){var _0x368779=_['map'](_0x1d770f[_0x6e53('0x5c')],function(_0x571e1b){_0x571e1b[_0x6e53('0x6a')]=_0x1d770f[_0x6e53('0x58')]['id'];return _0x571e1b;});return db[_0x6e53('0x7d')]['bulkCreate'](_0x368779,{'transaction':_0x12846d});});})[_0x6e53('0x26')](function(){return db[_0x6e53('0x7d')][_0x6e53('0x7e')]({'where':{'FaxAccountId':_0x1d770f['params']['id']},'order':_0x6e53('0x7f')});});}})[_0x6e53('0x26')](respondWithResult(_0x4644a1,null))[_0x6e53('0x2f')](handleError(_0x4644a1,null));};exports[_0x6e53('0x80')]=function(_0x11385b,_0x474a25,_0x54fbe5){var _0x252acc={};var _0x5b6313={};var _0x3ae666;var _0x1dcbe5;return db['FaxAccount'][_0x6e53('0x68')]({'where':{'id':_0x11385b[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x474a25,null))['then'](function(_0xf77b02){if(_0xf77b02){_0x3ae666=_0xf77b02;_0x5b6313[_0x6e53('0x4a')]=_[_0x6e53('0x46')](db[_0x6e53('0x7d')]['rawAttributes']);_0x5b6313[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x11385b[_0x6e53('0x45')]);_0x5b6313['filters']=_[_0x6e53('0x48')](_0x5b6313[_0x6e53('0x4a')],_0x5b6313[_0x6e53('0x45')]);_0x252acc[_0x6e53('0x49')]=_['intersection'](_0x5b6313[_0x6e53('0x4a')],qs[_0x6e53('0x4b')](_0x11385b[_0x6e53('0x45')][_0x6e53('0x4b')]));_0x252acc[_0x6e53('0x49')]=_0x252acc[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x252acc[_0x6e53('0x49')]:_0x5b6313['model'];_0x252acc[_0x6e53('0x4f')]=qs[_0x6e53('0x50')](_0x11385b[_0x6e53('0x45')]['sort']);_0x252acc[_0x6e53('0x51')]=qs[_0x6e53('0x47')](_[_0x6e53('0x70')](_0x11385b['query'],_0x5b6313[_0x6e53('0x47')]));if(_0x11385b[_0x6e53('0x45')]['filter']){_0x252acc[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x252acc[_0x6e53('0x51')],{'$or':_[_0x6e53('0x41')](_0x252acc[_0x6e53('0x49')],function(_0x37aaa1){var _0x270707={};_0x270707[_0x37aaa1]={'$like':'%'+_0x11385b[_0x6e53('0x45')][_0x6e53('0x52')]+'%'};return _0x270707;})});}_0x252acc=_[_0x6e53('0x53')]({},_0x252acc,_0x11385b[_0x6e53('0x54')]);return _0x3ae666[_0x6e53('0x80')](_0x252acc);}})['then'](function(_0x5c5b07){if(_0x5c5b07){_0x1dcbe5=_0x5c5b07[_0x6e53('0x4c')];if(!_0x11385b['query'][_0x6e53('0x76')](_0x6e53('0x4d'))){_0x252acc[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x11385b[_0x6e53('0x45')][_0x6e53('0x35')]);_0x252acc[_0x6e53('0x4e')]=qs[_0x6e53('0x4e')](_0x11385b[_0x6e53('0x45')]['offset']);}return _0x3ae666['getApplications'](_0x252acc);}})['then'](function(_0x569f60){if(_0x569f60){return _0x569f60?{'count':_0x1dcbe5,'rows':_0x569f60}:null;}})[_0x6e53('0x26')](respondWithResult(_0x474a25,null))[_0x6e53('0x2f')](handleError(_0x474a25,null));};function Extension(_0x267e6f,_0x42476b,_0x3dcbc9,_0x4b164f){this[_0x6e53('0x81')]=_0x6e53('0x82');this[_0x6e53('0x83')]=_0x267e6f[_0x6e53('0x84')];this[_0x6e53('0x85')]=_0x4b164f;this[_0x6e53('0x43')]='system';this['description']=_0x6e53('0x86');this[_0x6e53('0x6a')]=_0x267e6f['id'];this[_0x6e53('0x7f')]=_0x42476b;this[_0x6e53('0x87')]=_0x3dcbc9;}function createExtensionsReciveFax(_0x1c4dd6){var _0x4678ba=0x1;var _0x1a28cf=[];_0x1a28cf[_0x6e53('0x88')](new Extension(_0x1c4dd6,_0x4678ba,'','Answer'));_0x4678ba+=0x1;_0x1a28cf[_0x6e53('0x88')](new Extension(_0x1c4dd6,_0x4678ba,_0x6e53('0x89'),_0x6e53('0x8a')));_0x4678ba+=0x1;for(var _0xd1826a in _0x1c4dd6){if(_0x1c4dd6[_0x6e53('0x76')](_0xd1826a)&&(_0xd1826a===_0x6e53('0x8b')||_0xd1826a===_0x6e53('0x84')||_0xd1826a===_0x6e53('0x8c')||_0xd1826a===_0x6e53('0x8d')||_0xd1826a===_0x6e53('0x8e')||_0xd1826a===_0x6e53('0x8f')||_0xd1826a==='minrate'||_0xd1826a===_0x6e53('0x90')||_0xd1826a===_0x6e53('0x91'))){_0x1a28cf[_0x6e53('0x88')](new Extension(_0x1c4dd6,_0x4678ba,_0x6e53('0x92')+_0xd1826a+')='+_0x1c4dd6[_0xd1826a],'Set'));_0x4678ba+=0x1;}}_0x1a28cf[_0x6e53('0x88')](new Extension(_0x1c4dd6,_0x4678ba,'6',_0x6e53('0x93')));_0x4678ba+=0x1;_0x1a28cf[_0x6e53('0x88')](new Extension(_0x1c4dd6,_0x4678ba,'/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',_0x6e53('0x94')));_0x4678ba=0x0;return _0x1a28cf;}exports['addAccountApplications']=function(_0x1d2bca,_0x3368b8,_0x380d5a){var _0x4e3d33;return db[_0x6e53('0x95')][_0x6e53('0x96')](function(_0x5ae152){return db['FaxAccount'][_0x6e53('0x5b')](_0x1d2bca[_0x6e53('0x5c')],{'transaction':_0x5ae152})[_0x6e53('0x26')](function(_0x16cf6a){_0x4e3d33=_0x16cf6a[_0x6e53('0x3a')]({'plain':!![]});return db[_0x6e53('0x97')][_0x6e53('0x98')](createExtensionsReciveFax(_0x4e3d33),{'transaction':_0x5ae152});});})['then'](function(){return _0x4e3d33;})[_0x6e53('0x26')](respondWithResult(_0x3368b8,null))[_0x6e53('0x2f')](handleError(_0x3368b8,null));};exports['updateAccountApplications']=function(_0x4c2594,_0x296c75,_0x5caf33){var _0x247b75;return db[_0x6e53('0x95')][_0x6e53('0x96')](function(_0xdd7588){return db[_0x6e53('0x55')][_0x6e53('0x38')](_0x4c2594[_0x6e53('0x5c')],{'where':{'id':_0x4c2594[_0x6e53('0x5c')]['id']},'transaction':_0xdd7588})[_0x6e53('0x26')](function(_0x4a90d3){return db[_0x6e53('0x97')][_0x6e53('0x39')]({'where':{'FaxAccountId':_0x4c2594[_0x6e53('0x5c')]['id']},'transaction':_0xdd7588})[_0x6e53('0x26')](function(_0xbeedbd){return db['VoiceExtension'][_0x6e53('0x98')](createExtensionsReciveFax(_['omit'](_0x4c2594[_0x6e53('0x5c')],[_0x6e53('0x99'),_0x6e53('0x44'),'createdAt','updatedAt',_0x6e53('0x9a'),'ListId'])),{'transaction':_0xdd7588});});});})[_0x6e53('0x26')](function(){return db[_0x6e53('0x55')]['findById'](_0x4c2594[_0x6e53('0x5c')]['id']);})[_0x6e53('0x26')](respondWithResult(_0x296c75,null))[_0x6e53('0x2f')](handleError(_0x296c75,null));};exports[_0x6e53('0x9b')]=function(_0xdd6820,_0x3d3e71,_0x5e6ef5){var _0x473669={'raw':!![],'where':{}};var _0xd70b9b={};var _0x4e19d6={'count':0x0,'rows':[]};return db[_0x6e53('0x55')]['findOne']({'where':{'id':_0xdd6820[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0x3d3e71,null))[_0x6e53('0x26')](function(_0x1d4e04){if(_0x1d4e04){_0xd70b9b[_0x6e53('0x4a')]=_[_0x6e53('0x46')](db['FaxMessage'][_0x6e53('0x69')]);_0xd70b9b[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0xdd6820[_0x6e53('0x45')]);_0xd70b9b['filters']=_['intersection'](_0xd70b9b[_0x6e53('0x4a')],_0xd70b9b[_0x6e53('0x45')]);_0x473669[_0x6e53('0x49')]=_[_0x6e53('0x48')](_0xd70b9b[_0x6e53('0x4a')],qs['fields'](_0xdd6820['query'][_0x6e53('0x4b')]));_0x473669[_0x6e53('0x49')]=_0x473669[_0x6e53('0x49')][_0x6e53('0x4c')]?_0x473669['attributes']:_0xd70b9b[_0x6e53('0x4a')];if(!_0xdd6820['query'][_0x6e53('0x76')](_0x6e53('0x4d'))){_0x473669[_0x6e53('0x35')]=qs['limit'](_0xdd6820[_0x6e53('0x45')]['limit']);_0x473669[_0x6e53('0x4e')]=qs[_0x6e53('0x4e')](_0xdd6820['query'][_0x6e53('0x4e')]);}_0x473669['order']=qs[_0x6e53('0x50')](_0xdd6820[_0x6e53('0x45')][_0x6e53('0x50')]);_0x473669['where']=qs[_0x6e53('0x47')](_[_0x6e53('0x70')](_0xdd6820[_0x6e53('0x45')],_0xd70b9b[_0x6e53('0x47')]));_0x473669[_0x6e53('0x51')][_0x6e53('0x6a')]=_0x1d4e04['id'];if(_0xdd6820[_0x6e53('0x45')]['filter']){_0x473669[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x473669[_0x6e53('0x51')],{'$or':_[_0x6e53('0x41')](_0x473669[_0x6e53('0x49')],function(_0x566e6c){var _0x3f1a49={};_0x3f1a49[_0x566e6c]={'$like':'%'+_0xdd6820[_0x6e53('0x45')][_0x6e53('0x52')]+'%'};return _0x3f1a49;})});}if(_0xdd6820[_0x6e53('0x45')]['$gte']){var _0x1bec15=_0xdd6820[_0x6e53('0x45')][_0x6e53('0x9c')][_0x6e53('0x9d')](',');var _0x4b45e1={};_0x4b45e1[_0x1bec15[0x0]]={'$gte':moment(_0x1bec15[0x1])['format'](_0x6e53('0x9e'))};_0x473669[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0x473669['where'],_0x4b45e1);}_0x473669=_[_0x6e53('0x53')]({},_0x473669,_0xdd6820[_0x6e53('0x54')]);return db[_0x6e53('0x9f')][_0x6e53('0x34')]({'where':_0x473669[_0x6e53('0x51')]})[_0x6e53('0x26')](function(_0x5f3cc7){_0x4e19d6[_0x6e53('0x34')]=_0x5f3cc7;if(_0xdd6820[_0x6e53('0x45')][_0x6e53('0x5a')]){_0x473669[_0x6e53('0x56')]=[{'all':!![]}];}return db[_0x6e53('0x9f')][_0x6e53('0x57')](_0x473669);})[_0x6e53('0x26')](function(_0x2e258c){_0x4e19d6[_0x6e53('0x6b')]=_0x2e258c;return _0x4e19d6;});}})[_0x6e53('0x26')](respondWithFilteredResult(_0x3d3e71,_0x473669))['catch'](handleError(_0x3d3e71,null));};exports['send']=function(_0x30175d,_0x32c482,_0x59f9ee){var _0x69342b,_0x1fef48={},_0x42d9b8;if(_0x30175d[_0x6e53('0x5c')]['to']){_0x42d9b8=_0x30175d[_0x6e53('0x5c')]['to'][0x0];}return db[_0x6e53('0x55')][_0x6e53('0x61')]({'where':{'id':_0x30175d[_0x6e53('0x58')]['id']},'include':[{'model':db[_0x6e53('0xa0')],'as':'List','include':[{'model':db[_0x6e53('0x77')],'as':'Contacts','where':{'fax':_0x42d9b8},'limit':0x1,'order':[[_0x6e53('0xa1'),'DESC']]}]}]})[_0x6e53('0x26')](handleEntityNotFound(_0x32c482,null))[_0x6e53('0x26')](function(_0xd43640){_0x69342b=_0xd43640;if(_0x30175d[_0x6e53('0x5c')]['attachments']&&_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][_0x6e53('0x4c')]){for(var _0x3ecfcb=0x0;_0x3ecfcb<_0x30175d[_0x6e53('0x5c')]['attachments']['length'];_0x3ecfcb+=0x1){_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][_0x3ecfcb]={'filename':_0x30175d[_0x6e53('0x5c')]['attachments'][_0x3ecfcb]['name'],'id':_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][_0x3ecfcb]['id'],'path':path[_0x6e53('0xa3')](config['root'],'server/files/attachments',_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][_0x3ecfcb]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x6e53('0xa4'),{'FaxAccountId':_[_0x6e53('0xa5')](_0x30175d['params']['id'])?undefined:_0x30175d[_0x6e53('0x58')]['id'],'path':_[_0x6e53('0xa5')](_0x30175d['body']['attachments'][0x0][_0x6e53('0x8')])?undefined:_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][0x0]['path'],'fax':_['isNil'](_0x30175d[_0x6e53('0x5c')]['to'][0x0])?undefined:_0x30175d[_0x6e53('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x69342b){if(_[_0x6e53('0xa5')](_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa6')])){_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa6')]=util['format']('\x22%s\x22\x20<%s>',_0x69342b[_0x6e53('0x3e')],_0x69342b[_0x6e53('0xa7')]);}if(_0x69342b['List']){if(_0x69342b['List'][_0x6e53('0xa8')][_0x6e53('0x4c')]){return _0x69342b[_0x6e53('0xa9')][_0x6e53('0xa8')][0x0];}else{return db[_0x6e53('0x77')][_0x6e53('0x5b')](_[_0x6e53('0x1a')](_0x30175d[_0x6e53('0x5c')],{'firstName':_0x30175d[_0x6e53('0x5c')]['to'][0x0],'phone':_0x30175d['body']['to'][0x0],'fax':_0x30175d[_0x6e53('0x5c')]['to'][0x0],'ListId':_0x69342b[_0x6e53('0xaa')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6e53('0xab'));}})['then'](function(_0x41cc33){if(_0x41cc33){return db[_0x6e53('0x73')][_0x6e53('0x61')]({'where':{'ContactId':_0x41cc33['id'],'closed':![],'FaxAccountId':_0x69342b['id']}})[_0x6e53('0x26')](function(_0x128d12){if(_0x128d12){return[_0x128d12,![]];}return db[_0x6e53('0x73')][_0x6e53('0x5b')]({'UserId':_0x30175d['user']['id'],'ContactId':_0x41cc33['id'],'FaxAccountId':_0x69342b['id'],'fax':_0x30175d[_0x6e53('0x5c')]['to'][0x0],'firstMsgDirection':_0x6e53('0xac'),'Messages':[_[_0x6e53('0x53')](_0x30175d[_0x6e53('0x5c')],{'read':![],'body':_0x30175d[_0x6e53('0x5c')]['attachments'][0x0][_0x6e53('0xad')],'FaxAccountId':_0x69342b['id'],'UserId':_0x30175d[_0x6e53('0x5d')]['id'],'ContactId':_0x41cc33['id'],'AttachmentId':_0x30175d['body'][_0x6e53('0xa2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x6e53('0xae')}]})['then'](function(_0x3e7157){return[_0x3e7157,!![]];});});}else{throw new Error(_0x6e53('0xaf'));}})[_0x6e53('0xb0')](function(_0x1e969e,_0x28c3f7){if(_0x28c3f7){return _0x1e969e;}return db[_0x6e53('0x9f')][_0x6e53('0x5b')]({'direction':_0x6e53('0xac'),'read':![],'body':_0x30175d[_0x6e53('0x5c')]['attachments'][0x0][_0x6e53('0xad')],'FaxAccountId':_0x69342b['id'],'FaxInteractionId':_0x1e969e['id'],'UserId':_0x30175d[_0x6e53('0x5d')]['id'],'ContactId':_0x1e969e[_0x6e53('0xb1')],'AttachmentId':_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][0x0]['id']})[_0x6e53('0x26')](function(_0x33a48b){_0x1e969e[_0x6e53('0xb2')][_0x6e53('0xae')]=[];_0x1e969e[_0x6e53('0xb2')][_0x6e53('0xae')]['push'](_0x33a48b[_0x6e53('0xb2')]);return _0x1e969e;});})[_0x6e53('0x26')](function(_0x2b3a5c){respondWithRpcPromise('SendFax',_0x6e53('0xb3'),{'FaxAccountId':_[_0x6e53('0xa5')](_0x30175d['params']['id'])?undefined:_0x30175d['params']['id'],'path':_[_0x6e53('0xa5')](_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][0x0]['path'])?undefined:_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][0x0][_0x6e53('0x8')],'fax':_[_0x6e53('0xa5')](_0x30175d['body']['to'][0x0])?undefined:_0x30175d[_0x6e53('0x5c')]['to'][0x0],'AttachmentId':_0x30175d[_0x6e53('0x5c')][_0x6e53('0xa2')][0x0]['id']},client9002)[_0x6e53('0x26')](function(_0x5ddc77){logger[_0x6e53('0x27')](_0x6e53('0xb4'),_0x5ddc77);})[_0x6e53('0x2f')](function(_0x1e437b){logger[_0x6e53('0x27')](_0x6e53('0xb4'),_0x1e437b);});return _0x2b3a5c;})[_0x6e53('0x26')](respondWithResult(_0x32c482,null))[_0x6e53('0x2f')](handleError(_0x32c482,null));};exports['addAgents']=function(_0x37d062,_0xde26d3,_0x576c35){return db[_0x6e53('0x55')][_0x6e53('0x61')]({'where':{'id':_0x37d062['params']['id']}})['then'](handleEntityNotFound(_0xde26d3,null))[_0x6e53('0x26')](function(_0x1e7bcb){if(_0x1e7bcb){return _0x1e7bcb['addAgents'](_0x37d062[_0x6e53('0x5c')]['ids'],_['omit'](_0x37d062[_0x6e53('0x5c')],[_0x6e53('0x6d'),'id'])||{})['spread'](function(_0x287a3c){for(var _0x2b10a4=0x0;_0x2b10a4<_0x37d062['body'][_0x6e53('0x6d')][_0x6e53('0x4c')];_0x2b10a4+=0x1){socket[_0x6e53('0xb5')]('userFaxAccount:save',{'UserId':_0x37d062[_0x6e53('0x5c')][_0x6e53('0x6d')][_0x2b10a4],'FaxAccountId':_0x37d062[_0x6e53('0x58')]['id']});}return _0x287a3c;});}})[_0x6e53('0x26')](respondWithResult(_0xde26d3,null))[_0x6e53('0x2f')](handleError(_0xde26d3,null));};exports[_0x6e53('0xb6')]=function(_0x205b64,_0x215154,_0x3cf868){return db[_0x6e53('0x55')]['find']({'where':{'id':_0x205b64[_0x6e53('0x58')]['id']}})['then'](handleEntityNotFound(_0x215154,null))[_0x6e53('0x26')](function(_0x29494c){if(_0x29494c){return _0x29494c[_0x6e53('0xb6')](_0x205b64['query'][_0x6e53('0x6d')])[_0x6e53('0x26')](function(){if(_['isArray'](_0x205b64[_0x6e53('0x45')][_0x6e53('0x6d')])){for(var _0x3b720d=0x0;_0x3b720d<_0x205b64['query'][_0x6e53('0x6d')]['length'];_0x3b720d+=0x1){socket[_0x6e53('0xb5')](_0x6e53('0xb7'),{'UserId':Number(_0x205b64[_0x6e53('0x45')][_0x6e53('0x6d')][_0x3b720d]),'FaxAccountId':Number(_0x205b64['params']['id'])});}}else{socket[_0x6e53('0xb5')](_0x6e53('0xb7'),{'UserId':Number(_0x205b64['query']['ids']),'FaxAccountId':Number(_0x205b64['params']['id'])});}});}})['then'](respondWithStatusCode(_0x215154,null))['catch'](handleError(_0x215154,null));};exports['getAgents']=function(_0x171de9,_0xb365cf,_0x2f5872){var _0xc537a={};var _0x535d96={};var _0x534723;var _0x1b6cef;return db['FaxAccount'][_0x6e53('0x68')]({'where':{'id':_0x171de9[_0x6e53('0x58')]['id']}})[_0x6e53('0x26')](handleEntityNotFound(_0xb365cf,null))[_0x6e53('0x26')](function(_0x51df25){if(_0x51df25){_0x534723=_0x51df25;_0x535d96[_0x6e53('0x4a')]=_['keys'](db[_0x6e53('0x79')][_0x6e53('0x69')]);_0x535d96[_0x6e53('0x45')]=_[_0x6e53('0x46')](_0x171de9['query']);_0x535d96['filters']=_[_0x6e53('0x48')](_0x535d96[_0x6e53('0x4a')],_0x535d96[_0x6e53('0x45')]);_0xc537a[_0x6e53('0x49')]=_[_0x6e53('0x48')](_0x535d96[_0x6e53('0x4a')],qs['fields'](_0x171de9[_0x6e53('0x45')][_0x6e53('0x4b')]));_0xc537a[_0x6e53('0x49')]=_0xc537a['attributes'][_0x6e53('0x4c')]?_0xc537a[_0x6e53('0x49')]:_0x535d96[_0x6e53('0x4a')];_0xc537a[_0x6e53('0x4f')]=qs['sort'](_0x171de9[_0x6e53('0x45')][_0x6e53('0x50')]);_0xc537a['where']=qs[_0x6e53('0x47')](_[_0x6e53('0x70')](_0x171de9[_0x6e53('0x45')],_0x535d96[_0x6e53('0x47')]));if(_0x171de9['query'][_0x6e53('0x52')]){_0xc537a[_0x6e53('0x51')]=_[_0x6e53('0x53')](_0xc537a[_0x6e53('0x51')],{'$or':_[_0x6e53('0x41')](_0xc537a['attributes'],function(_0x2ffb68){var _0x254143={};_0x254143[_0x2ffb68]={'$like':'%'+_0x171de9[_0x6e53('0x45')][_0x6e53('0x52')]+'%'};return _0x254143;})});}_0xc537a=_['merge']({},_0xc537a,_0x171de9[_0x6e53('0x54')]);return _0x534723[_0x6e53('0xb8')](_0xc537a);}})[_0x6e53('0x26')](function(_0x27f76e){if(_0x27f76e){_0x1b6cef=_0x27f76e[_0x6e53('0x4c')];if(!_0x171de9['query'][_0x6e53('0x76')]('nolimit')){_0xc537a[_0x6e53('0x35')]=qs[_0x6e53('0x35')](_0x171de9[_0x6e53('0x45')]['limit']);_0xc537a[_0x6e53('0x4e')]=qs[_0x6e53('0x4e')](_0x171de9['query'][_0x6e53('0x4e')]);}return _0x534723[_0x6e53('0xb8')](_0xc537a);}})[_0x6e53('0x26')](function(_0x46e5b2){if(_0x46e5b2){return _0x46e5b2?{'count':_0x1b6cef,'rows':_0x46e5b2}:null;}})[_0x6e53('0x26')](respondWithResult(_0xb365cf,null))[_0x6e53('0x2f')](handleError(_0xb365cf,null));}; \ No newline at end of file +var _0xf186=['priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','sequelize','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','client','http','ValidationError','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','end','status','json','count','offset','limit','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','role','user','UserProfileSection','userProfileId','body','addDisposition','FaxAccountId','hasOwnProperty','sort','pick','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','tag','addApplications','transaction','FaxApplication','findAndCountAll','getApplications','from-voip-provider','system','description'];(function(_0x52f536,_0x452e8b){var _0x2ab576=function(_0x5e2b38){while(--_0x5e2b38){_0x52f536['push'](_0x52f536['shift']());}};_0x2ab576(++_0x452e8b);}(_0xf186,0x1a9));var _0x6f18=function(_0x2fca31,_0x2a89ee){_0x2fca31=_0x2fca31-0x0;var _0x25b65f=_0xf186[_0x2fca31];return _0x25b65f;};'use strict';var pdf=require(_0x6f18('0x0'));var emlformat=require(_0x6f18('0x1'));var rimraf=require(_0x6f18('0x2'));var zipdir=require(_0x6f18('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f18('0x4'));var moment=require(_0x6f18('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6f18('0x6'));var util=require(_0x6f18('0x7'));var path=require(_0x6f18('0x8'));var sox=require(_0x6f18('0x9'));var csv=require('to-csv');var ejs=require(_0x6f18('0xa'));var fs=require('fs');var _=require(_0x6f18('0xb'));var squel=require(_0x6f18('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f18('0xd'));var querystring=require(_0x6f18('0xe'));var Papa=require(_0x6f18('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f18('0x10'));var as=require(_0x6f18('0x11'));var hardwareService=require(_0x6f18('0x12'));var logger=require(_0x6f18('0x13'))(_0x6f18('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6f18('0x15'))['db'];config[_0x6f18('0x16')]=_[_0x6f18('0x17')](config[_0x6f18('0x16')],{'host':_0x6f18('0x18'),'port':0x18eb});var socket=require(_0x6f18('0x19'))(new Redis(config['redis']));require(_0x6f18('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f18('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x6f18('0x1b')][_0x6f18('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x11c316,_0xc07ba0,_0x1a40b3){if(_0x1a40b3){var _0x40c6ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c6ee['test'](_0xc07ba0)){return _0x11c316;}else{throw new db['Sequelize'][(_0x6f18('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 _0x11c316;}}function respondWithRpcPromise(_0x25336f,_0x420443,_0x217692,_0x28c588){return new BPromise(function(_0x1a745e,_0x2dd989){var _0x14b0b4=_0x28c588||client;return _0x14b0b4['request'](_0x25336f,_0x217692)[_0x6f18('0x1e')](function(_0x8535d5){logger[_0x6f18('0x1f')](_0x6f18('0x20'),_0x420443,'request\x20sent');logger[_0x6f18('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x420443,_0x6f18('0x22'),JSON[_0x6f18('0x23')](_0x8535d5));if(_0x8535d5['error']){if(_0x8535d5['error']['code']===0x1f4){logger[_0x6f18('0x24')](_0x6f18('0x20'),_0x420443,_0x8535d5['error'][_0x6f18('0x25')]);return _0x2dd989(_0x8535d5[_0x6f18('0x24')][_0x6f18('0x25')]);}logger[_0x6f18('0x24')](_0x6f18('0x20'),_0x420443,_0x8535d5[_0x6f18('0x24')][_0x6f18('0x25')]);return _0x1a745e(_0x8535d5[_0x6f18('0x24')][_0x6f18('0x25')]);}else{logger['info'](_0x6f18('0x20'),_0x420443,_0x6f18('0x22'));_0x1a745e(_0x8535d5['result'][_0x6f18('0x25')]);}})['catch'](function(_0x58bb27){logger['error']('FaxAccount,\x20%s,\x20%s',_0x420443,_0x58bb27);_0x2dd989(_0x58bb27);});});}function respondWithStatusCode(_0x123af4,_0x37f670){_0x37f670=_0x37f670||0xcc;return function(_0x176f47){if(_0x176f47){return _0x123af4['sendStatus'](_0x37f670);}return _0x123af4['status'](_0x37f670)[_0x6f18('0x26')]();};}function respondWithResult(_0x181c14,_0x273515){_0x273515=_0x273515||0xc8;return function(_0x688bdc){if(_0x688bdc){return _0x181c14[_0x6f18('0x27')](_0x273515)[_0x6f18('0x28')](_0x688bdc);}};}function respondWithFilteredResult(_0x4baf0b,_0x249f3d){return function(_0x553925){if(_0x553925){var _0x216588=_0x553925[_0x6f18('0x29')],_0x16cf88=_0x249f3d[_0x6f18('0x2a')],_0x4635eb=_0x249f3d[_0x6f18('0x2a')]+_0x249f3d[_0x6f18('0x2b')],_0x55bc0b;if(_0x4635eb>=_0x216588){_0x4635eb=_0x216588;_0x55bc0b=0xc8;}else{_0x55bc0b=0xce;}_0x4baf0b['status'](_0x55bc0b);return _0x4baf0b['set'](_0x6f18('0x2c'),_0x16cf88+'-'+_0x4635eb+'/'+_0x216588)[_0x6f18('0x28')](_0x553925);}return null;};}function patchUpdates(_0x171f71){return function(_0x18dcea){try{jsonpatch[_0x6f18('0x2d')](_0x18dcea,_0x171f71,!![]);}catch(_0xcdc6f0){return BPromise[_0x6f18('0x2e')](_0xcdc6f0);}return _0x18dcea[_0x6f18('0x2f')]();};}function saveUpdates(_0x1a6161,_0x272202){return function(_0x2ef951){if(_0x2ef951){return _0x2ef951['update'](_0x1a6161)['then'](function(_0x1a72aa){return _0x1a72aa;});}return null;};}function removeEntity(_0x50f690,_0x413e49){return function(_0x379464){if(_0x379464){return _0x379464[_0x6f18('0x30')]()['then'](function(){var _0x5c3fb6=_0x379464[_0x6f18('0x31')]({'plain':!![]});var _0x38e019=_0x6f18('0x32');return db[_0x6f18('0x33')]['destroy']({'where':{'type':_0x38e019,'resourceId':_0x5c3fb6['id']}})[_0x6f18('0x1e')](function(){return _0x379464;});})[_0x6f18('0x1e')](function(){_0x50f690['status'](0xcc)[_0x6f18('0x26')]();});}};}function handleEntityNotFound(_0x614dd7,_0x5b6fc0){return function(_0x329cdc){if(!_0x329cdc){_0x614dd7[_0x6f18('0x34')](0x194);}return _0x329cdc;};}function handleError(_0x51e851,_0x21f413){_0x21f413=_0x21f413||0x1f4;return function(_0x4a8e9b){logger['error'](_0x4a8e9b['stack']);if(_0x4a8e9b[_0x6f18('0x35')]){delete _0x4a8e9b['name'];}_0x51e851[_0x6f18('0x27')](_0x21f413)[_0x6f18('0x36')](_0x4a8e9b);};}exports['index']=function(_0x260629,_0x314c9b){var _0x5dffe2={'include':[{'model':db[_0x6f18('0x37')],'as':_0x6f18('0x38')}]},_0x438498={},_0x3c9243={'count':0x0,'rows':[]};var _0x1a690c=_[_0x6f18('0x39')](db[_0x6f18('0x3a')][_0x6f18('0x3b')],function(_0x5b28d6){return{'name':_0x5b28d6['fieldName'],'type':_0x5b28d6[_0x6f18('0x3c')][_0x6f18('0x3d')]};});_0x438498[_0x6f18('0x3e')]=_[_0x6f18('0x39')](_0x1a690c,_0x6f18('0x35'));_0x438498[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x260629[_0x6f18('0x3f')]);_0x438498[_0x6f18('0x41')]=_[_0x6f18('0x42')](_0x438498[_0x6f18('0x3e')],_0x438498[_0x6f18('0x3f')]);_0x5dffe2['attributes']=_[_0x6f18('0x42')](_0x438498[_0x6f18('0x3e')],qs['fields'](_0x260629[_0x6f18('0x3f')][_0x6f18('0x43')]));_0x5dffe2[_0x6f18('0x44')]=_0x5dffe2[_0x6f18('0x44')][_0x6f18('0x45')]?_0x5dffe2['attributes']:_0x438498[_0x6f18('0x3e')];if(!_0x260629[_0x6f18('0x3f')]['hasOwnProperty'](_0x6f18('0x46'))){_0x5dffe2[_0x6f18('0x2b')]=qs['limit'](_0x260629['query']['limit']);_0x5dffe2[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x260629[_0x6f18('0x3f')]['offset']);}_0x5dffe2[_0x6f18('0x47')]=qs['sort'](_0x260629[_0x6f18('0x3f')]['sort']);_0x5dffe2[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_['pick'](_0x260629['query'],_0x438498['filters']),_0x1a690c);if(_0x260629[_0x6f18('0x3f')][_0x6f18('0x49')]){_0x5dffe2['where']=_['merge'](_0x5dffe2[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x1a690c,function(_0x5bc990){if(_0x5bc990['type']!==_0x6f18('0x4a')){var _0x5e3a34={};_0x5e3a34[_0x5bc990[_0x6f18('0x35')]]={'$like':'%'+_0x260629['query'][_0x6f18('0x49')]+'%'};return _0x5e3a34;}})});}_0x5dffe2=_['merge']({},_0x5dffe2,_0x260629[_0x6f18('0x4b')]);var _0x58094b={'where':_0x5dffe2[_0x6f18('0x48')]};return db['FaxAccount'][_0x6f18('0x29')](_0x58094b)['then'](function(_0x4804be){_0x3c9243[_0x6f18('0x29')]=_0x4804be;if(_0x260629[_0x6f18('0x3f')][_0x6f18('0x4c')]){_0x5dffe2[_0x6f18('0x4d')]=[{'all':!![]}];}return db[_0x6f18('0x3a')][_0x6f18('0x4e')](_0x5dffe2);})[_0x6f18('0x1e')](function(_0x52c09b){_0x3c9243[_0x6f18('0x4f')]=_0x52c09b;return _0x3c9243;})[_0x6f18('0x1e')](respondWithFilteredResult(_0x314c9b,_0x5dffe2))[_0x6f18('0x50')](handleError(_0x314c9b,null));};exports[_0x6f18('0x51')]=function(_0x100cbd,_0x22403e){var _0x2714a0={'raw':![],'where':{'id':_0x100cbd[_0x6f18('0x52')]['id']},'include':[{'model':db[_0x6f18('0x37')],'as':_0x6f18('0x38')}]},_0x30d5d0={};_0x30d5d0[_0x6f18('0x3e')]=_['keys'](db['FaxAccount'][_0x6f18('0x3b')]);_0x30d5d0[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x100cbd[_0x6f18('0x3f')]);_0x30d5d0[_0x6f18('0x41')]=_[_0x6f18('0x42')](_0x30d5d0[_0x6f18('0x3e')],_0x30d5d0[_0x6f18('0x3f')]);_0x2714a0[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x30d5d0[_0x6f18('0x3e')],qs[_0x6f18('0x43')](_0x100cbd[_0x6f18('0x3f')][_0x6f18('0x43')]));_0x2714a0[_0x6f18('0x44')]=_0x2714a0[_0x6f18('0x44')][_0x6f18('0x45')]?_0x2714a0[_0x6f18('0x44')]:_0x30d5d0[_0x6f18('0x3e')];if(_0x100cbd[_0x6f18('0x3f')][_0x6f18('0x4c')]){_0x2714a0[_0x6f18('0x4d')]=[{'all':!![]}];}_0x2714a0=_[_0x6f18('0x53')]({},_0x2714a0,_0x100cbd[_0x6f18('0x4b')]);return db['FaxAccount'][_0x6f18('0x54')](_0x2714a0)[_0x6f18('0x1e')](handleEntityNotFound(_0x22403e,null))[_0x6f18('0x1e')](respondWithResult(_0x22403e,null))[_0x6f18('0x50')](handleError(_0x22403e,null));};exports[_0x6f18('0x55')]=function(_0x27b6be,_0xcf7c0b){return db[_0x6f18('0x3a')]['create'](_0x27b6be['body'],{})['then'](function(_0xccd20e){var _0x499277=_0x27b6be['user']['get']({'plain':!![]});if(!_0x499277)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x499277[_0x6f18('0x56')]===_0x6f18('0x57')){var _0x6664fa=_0xccd20e[_0x6f18('0x31')]({'plain':!![]});var _0x144417=_0x6f18('0x32');return db[_0x6f18('0x58')][_0x6f18('0x54')]({'where':{'name':_0x144417,'userProfileId':_0x499277[_0x6f18('0x59')]},'raw':!![]})[_0x6f18('0x1e')](function(_0x5938a4){if(_0x5938a4&&_0x5938a4['autoAssociation']===0x0){return db['UserProfileResource'][_0x6f18('0x55')]({'name':_0x6664fa[_0x6f18('0x35')],'resourceId':_0x6664fa['id'],'type':_0x5938a4[_0x6f18('0x35')],'sectionId':_0x5938a4['id']},{})[_0x6f18('0x1e')](function(){return _0xccd20e;});}else{return _0xccd20e;}})['catch'](function(_0x177cff){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x177cff);throw _0x177cff;});}return _0xccd20e;})[_0x6f18('0x1e')](respondWithResult(_0xcf7c0b,0xc9))['catch'](handleError(_0xcf7c0b,null));};exports['update']=function(_0x327a7a,_0x2c7047){if(_0x327a7a[_0x6f18('0x5a')]['id']){delete _0x327a7a[_0x6f18('0x5a')]['id'];}return db[_0x6f18('0x3a')][_0x6f18('0x54')]({'where':{'id':_0x327a7a['params']['id']},'include':[{'model':db['Pause'],'as':_0x6f18('0x38')}]})[_0x6f18('0x1e')](handleEntityNotFound(_0x2c7047,null))['then'](saveUpdates(_0x327a7a[_0x6f18('0x5a')],null))[_0x6f18('0x1e')](respondWithResult(_0x2c7047,null))[_0x6f18('0x50')](handleError(_0x2c7047,null));};exports[_0x6f18('0x30')]=function(_0x30d588,_0x5c425e){return db[_0x6f18('0x3a')][_0x6f18('0x54')]({'where':{'id':_0x30d588[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x5c425e,null))[_0x6f18('0x1e')](removeEntity(_0x5c425e,null))['catch'](handleError(_0x5c425e,null));};exports['describe']=function(_0x302e08,_0x232071){return db['FaxAccount']['describe']()[_0x6f18('0x1e')](respondWithResult(_0x232071,null))[_0x6f18('0x50')](handleError(_0x232071,null));};exports[_0x6f18('0x5b')]=function(_0xda4b97,_0x1f2c80,_0xce9d21){if(_0xda4b97['body']['id']){delete _0xda4b97[_0x6f18('0x5a')]['id'];}return db['FaxAccount'][_0x6f18('0x54')]({'where':{'id':_0xda4b97[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x1f2c80,null))['then'](function(_0x362c34){if(_0x362c34){_0xda4b97[_0x6f18('0x5a')][_0x6f18('0x5c')]=_0x362c34['id'];return db['Disposition'][_0x6f18('0x55')](_0xda4b97[_0x6f18('0x5a')]);}})['then'](respondWithResult(_0x1f2c80,null))[_0x6f18('0x50')](handleError(_0x1f2c80,null));};exports['getDispositions']=function(_0x904fc2,_0x1481be,_0x573526){var _0x5dfedb={'raw':![],'where':{}};var _0x4954f5={};var _0x42ef2d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x904fc2['params']['id']}})['then'](handleEntityNotFound(_0x1481be,null))[_0x6f18('0x1e')](function(_0x5000ab){if(_0x5000ab){_0x4954f5[_0x6f18('0x3e')]=_[_0x6f18('0x40')](db['Disposition']['rawAttributes']);_0x4954f5[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x904fc2[_0x6f18('0x3f')]);_0x4954f5[_0x6f18('0x41')]=_['intersection'](_0x4954f5[_0x6f18('0x3e')],_0x4954f5[_0x6f18('0x3f')]);_0x5dfedb[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x4954f5['model'],qs[_0x6f18('0x43')](_0x904fc2['query'][_0x6f18('0x43')]));_0x5dfedb[_0x6f18('0x44')]=_0x5dfedb[_0x6f18('0x44')][_0x6f18('0x45')]?_0x5dfedb['attributes']:_0x4954f5[_0x6f18('0x3e')];if(!_0x904fc2[_0x6f18('0x3f')][_0x6f18('0x5d')](_0x6f18('0x46'))){_0x5dfedb[_0x6f18('0x2b')]=qs[_0x6f18('0x2b')](_0x904fc2['query'][_0x6f18('0x2b')]);_0x5dfedb[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x904fc2['query'][_0x6f18('0x2a')]);}_0x5dfedb[_0x6f18('0x47')]=qs[_0x6f18('0x5e')](_0x904fc2['query'][_0x6f18('0x5e')]);_0x5dfedb[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x904fc2[_0x6f18('0x3f')],_0x4954f5[_0x6f18('0x41')]));_0x5dfedb[_0x6f18('0x48')][_0x6f18('0x5c')]=_0x5000ab['id'];if(_0x904fc2[_0x6f18('0x3f')]['filter']){_0x5dfedb[_0x6f18('0x48')]=_[_0x6f18('0x53')](_0x5dfedb[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x5dfedb['attributes'],function(_0x4ce2a3){var _0x26b5cd={};_0x26b5cd[_0x4ce2a3]={'$like':'%'+_0x904fc2[_0x6f18('0x3f')]['filter']+'%'};return _0x26b5cd;})});}_0x5dfedb=_[_0x6f18('0x53')]({},_0x5dfedb,_0x904fc2[_0x6f18('0x4b')]);return db[_0x6f18('0x60')]['count']({'where':_0x5dfedb[_0x6f18('0x48')]})['then'](function(_0x585837){_0x42ef2d[_0x6f18('0x29')]=_0x585837;if(_0x904fc2['query']['includeAll']){_0x5dfedb[_0x6f18('0x4d')]=[{'all':!![]}];}return db[_0x6f18('0x60')][_0x6f18('0x4e')](_0x5dfedb);})['then'](function(_0x35f866){_0x42ef2d['rows']=_0x35f866;return _0x42ef2d;});}})[_0x6f18('0x1e')](respondWithFilteredResult(_0x1481be,_0x5dfedb))[_0x6f18('0x50')](handleError(_0x1481be,null));};exports['removeDispositions']=function(_0x4216c5,_0x488416,_0x536b0e){return db[_0x6f18('0x3a')][_0x6f18('0x54')]({'where':{'id':_0x4216c5[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x488416,null))[_0x6f18('0x1e')](function(_0x3ed180){if(_0x3ed180){return _0x3ed180[_0x6f18('0x61')](_0x4216c5['query'][_0x6f18('0x62')]);}})['then'](respondWithStatusCode(_0x488416,null))[_0x6f18('0x50')](handleError(_0x488416,null));};exports[_0x6f18('0x63')]=function(_0x58827f,_0x2e6bc3,_0x282a06){if(_0x58827f[_0x6f18('0x5a')]['id']){delete _0x58827f[_0x6f18('0x5a')]['id'];}return db[_0x6f18('0x3a')][_0x6f18('0x54')]({'where':{'id':_0x58827f['params']['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x2e6bc3,null))[_0x6f18('0x1e')](function(_0x4b2502){if(_0x4b2502){_0x58827f[_0x6f18('0x5a')][_0x6f18('0x5c')]=_0x4b2502['id'];return db[_0x6f18('0x64')][_0x6f18('0x55')](_0x58827f[_0x6f18('0x5a')]);}})[_0x6f18('0x1e')](respondWithResult(_0x2e6bc3,null))['catch'](handleError(_0x2e6bc3,null));};exports[_0x6f18('0x65')]=function(_0x5c01e6,_0x2c91cd,_0x29b98f){var _0x157fe8={'raw':![],'where':{}};var _0x1c1f35={};var _0x436dc5={'count':0x0,'rows':[]};return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x5c01e6[_0x6f18('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c91cd,null))['then'](function(_0x2d590a){if(_0x2d590a){_0x1c1f35[_0x6f18('0x3e')]=_[_0x6f18('0x40')](db[_0x6f18('0x64')][_0x6f18('0x3b')]);_0x1c1f35[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x5c01e6['query']);_0x1c1f35[_0x6f18('0x41')]=_[_0x6f18('0x42')](_0x1c1f35['model'],_0x1c1f35[_0x6f18('0x3f')]);_0x157fe8[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x1c1f35[_0x6f18('0x3e')],qs[_0x6f18('0x43')](_0x5c01e6[_0x6f18('0x3f')]['fields']));_0x157fe8['attributes']=_0x157fe8[_0x6f18('0x44')][_0x6f18('0x45')]?_0x157fe8[_0x6f18('0x44')]:_0x1c1f35['model'];if(!_0x5c01e6[_0x6f18('0x3f')][_0x6f18('0x5d')](_0x6f18('0x46'))){_0x157fe8['limit']=qs[_0x6f18('0x2b')](_0x5c01e6[_0x6f18('0x3f')][_0x6f18('0x2b')]);_0x157fe8['offset']=qs[_0x6f18('0x2a')](_0x5c01e6[_0x6f18('0x3f')]['offset']);}_0x157fe8[_0x6f18('0x47')]=qs[_0x6f18('0x5e')](_0x5c01e6[_0x6f18('0x3f')]['sort']);_0x157fe8[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x5c01e6[_0x6f18('0x3f')],_0x1c1f35[_0x6f18('0x41')]));_0x157fe8['where'][_0x6f18('0x5c')]=_0x2d590a['id'];if(_0x5c01e6[_0x6f18('0x3f')]['filter']){_0x157fe8[_0x6f18('0x48')]=_[_0x6f18('0x53')](_0x157fe8[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x157fe8['attributes'],function(_0xe2b862){var _0x37e554={};_0x37e554[_0xe2b862]={'$like':'%'+_0x5c01e6[_0x6f18('0x3f')]['filter']+'%'};return _0x37e554;})});}_0x157fe8=_[_0x6f18('0x53')]({},_0x157fe8,_0x5c01e6[_0x6f18('0x4b')]);return db[_0x6f18('0x64')]['count']({'where':_0x157fe8[_0x6f18('0x48')]})[_0x6f18('0x1e')](function(_0x599f91){_0x436dc5['count']=_0x599f91;if(_0x5c01e6[_0x6f18('0x3f')][_0x6f18('0x4c')]){_0x157fe8[_0x6f18('0x4d')]=[{'all':!![]}];}return db[_0x6f18('0x64')][_0x6f18('0x4e')](_0x157fe8);})['then'](function(_0x191198){_0x436dc5['rows']=_0x191198;return _0x436dc5;});}})[_0x6f18('0x1e')](respondWithFilteredResult(_0x2c91cd,_0x157fe8))[_0x6f18('0x50')](handleError(_0x2c91cd,null));};exports[_0x6f18('0x67')]=function(_0x5f2107,_0x4c8461,_0x59b907){return db['FaxAccount'][_0x6f18('0x54')]({'where':{'id':_0x5f2107['params']['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x4c8461,null))['then'](function(_0x2b7c01){if(_0x2b7c01){return _0x2b7c01[_0x6f18('0x67')](_0x5f2107[_0x6f18('0x3f')][_0x6f18('0x62')]);}})[_0x6f18('0x1e')](respondWithStatusCode(_0x4c8461,null))[_0x6f18('0x50')](handleError(_0x4c8461,null));};exports[_0x6f18('0x68')]=function(_0x5b038b,_0x151704,_0x1a293c){return db[_0x6f18('0x69')]['find']({'where':{'id':_0x5b038b[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x151704,null))['then'](function(_0x15fbd1){if(_0x15fbd1){return _0x15fbd1[_0x6f18('0x68')](_0x5b038b[_0x6f18('0x5a')][_0x6f18('0x62')],_[_0x6f18('0x6a')](_0x5b038b[_0x6f18('0x5a')],['ids','id'])||{});}})[_0x6f18('0x1e')](respondWithResult(_0x151704,null))[_0x6f18('0x50')](handleError(_0x151704,null));};exports[_0x6f18('0x6b')]=function(_0x1e25b5,_0x494baf,_0x585c31){var _0x379a5e={'raw':![],'where':{}};var _0x41b033={};var _0x315c91={'count':0x0,'rows':[]};return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x1e25b5[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x494baf,null))['then'](function(_0x1046cb){if(_0x1046cb){_0x41b033[_0x6f18('0x3e')]=_[_0x6f18('0x40')](db[_0x6f18('0x69')][_0x6f18('0x3b')]);_0x41b033[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x1e25b5['query']);_0x41b033['filters']=_['intersection'](_0x41b033[_0x6f18('0x3e')],_0x41b033[_0x6f18('0x3f')]);_0x379a5e[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x41b033[_0x6f18('0x3e')],qs[_0x6f18('0x43')](_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x43')]));_0x379a5e[_0x6f18('0x44')]=_0x379a5e['attributes'][_0x6f18('0x45')]?_0x379a5e[_0x6f18('0x44')]:_0x41b033[_0x6f18('0x3e')];if(!_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x5d')](_0x6f18('0x46'))){_0x379a5e[_0x6f18('0x2b')]=qs[_0x6f18('0x2b')](_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x2b')]);_0x379a5e[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x2a')]);}_0x379a5e[_0x6f18('0x47')]=qs[_0x6f18('0x5e')](_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x5e')]);_0x379a5e[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x1e25b5['query'],_0x41b033[_0x6f18('0x41')]));_0x379a5e[_0x6f18('0x48')]['FaxAccountId']=_0x1046cb['id'];if(_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x49')]){_0x379a5e[_0x6f18('0x48')]=_[_0x6f18('0x53')](_0x379a5e[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x379a5e[_0x6f18('0x44')],function(_0x1e444a){var _0x35e31d={};_0x35e31d[_0x1e444a]={'$like':'%'+_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x49')]+'%'};return _0x35e31d;})});}_0x379a5e=_[_0x6f18('0x53')]({},_0x379a5e,_0x1e25b5[_0x6f18('0x4b')]);return db[_0x6f18('0x69')]['count']({'where':_0x379a5e[_0x6f18('0x48')]})['then'](function(_0x33ac52){_0x315c91[_0x6f18('0x29')]=_0x33ac52;if(_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x4c')]){_0x379a5e[_0x6f18('0x4d')]=[{'model':db[_0x6f18('0x6c')],'as':_0x6f18('0x6d'),'required':![]},{'model':db[_0x6f18('0x6e')],'as':_0x6f18('0x6f'),'attributes':[_0x6f18('0x35'),_0x6f18('0x70'),_0x6f18('0x71')],'required':![]},{'model':db['Tag'],'as':_0x6f18('0x72'),'attributes':['id','name','color'],'where':_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x73')]?{'id':_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x73')]}:undefined,'required':_0x1e25b5[_0x6f18('0x3f')][_0x6f18('0x73')]?!![]:![]}];}return db[_0x6f18('0x69')][_0x6f18('0x4e')](_0x379a5e);})['then'](function(_0x3017f6){_0x315c91[_0x6f18('0x4f')]=_0x3017f6;return _0x315c91;});}})['then'](respondWithFilteredResult(_0x494baf,_0x379a5e))[_0x6f18('0x50')](handleError(_0x494baf,null));};exports[_0x6f18('0x74')]=function(_0x32a933,_0x2a67d8,_0x3e8ceb){return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x32a933['params']['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x2a67d8,null))[_0x6f18('0x1e')](function(_0x2a2e17){if(_0x2a2e17){return db['sequelize'][_0x6f18('0x75')](function(_0x128f4d){return db[_0x6f18('0x76')]['destroy']({'where':{'FaxAccountId':_0x32a933[_0x6f18('0x52')]['id']},'transaction':_0x128f4d})['then'](function(_0x5d47f5){var _0x24c7ac=_[_0x6f18('0x39')](_0x32a933[_0x6f18('0x5a')],function(_0x39c8cc){_0x39c8cc[_0x6f18('0x5c')]=_0x32a933[_0x6f18('0x52')]['id'];return _0x39c8cc;});return db[_0x6f18('0x76')]['bulkCreate'](_0x24c7ac,{'transaction':_0x128f4d});});})[_0x6f18('0x1e')](function(){return db[_0x6f18('0x76')][_0x6f18('0x77')]({'where':{'FaxAccountId':_0x32a933[_0x6f18('0x52')]['id']},'order':'priority'});});}})[_0x6f18('0x1e')](respondWithResult(_0x2a67d8,null))[_0x6f18('0x50')](handleError(_0x2a67d8,null));};exports[_0x6f18('0x78')]=function(_0x381eee,_0x1637f1,_0x568336){var _0x78b309={};var _0x6fe0e8={};var _0xe4f412;var _0x159f02;return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x381eee[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x1637f1,null))[_0x6f18('0x1e')](function(_0x34ca4e){if(_0x34ca4e){_0xe4f412=_0x34ca4e;_0x6fe0e8[_0x6f18('0x3e')]=_[_0x6f18('0x40')](db['FaxApplication'][_0x6f18('0x3b')]);_0x6fe0e8['query']=_['keys'](_0x381eee[_0x6f18('0x3f')]);_0x6fe0e8[_0x6f18('0x41')]=_[_0x6f18('0x42')](_0x6fe0e8[_0x6f18('0x3e')],_0x6fe0e8[_0x6f18('0x3f')]);_0x78b309[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x6fe0e8[_0x6f18('0x3e')],qs[_0x6f18('0x43')](_0x381eee['query'][_0x6f18('0x43')]));_0x78b309['attributes']=_0x78b309['attributes'][_0x6f18('0x45')]?_0x78b309[_0x6f18('0x44')]:_0x6fe0e8['model'];_0x78b309['order']=qs['sort'](_0x381eee[_0x6f18('0x3f')]['sort']);_0x78b309[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x381eee[_0x6f18('0x3f')],_0x6fe0e8[_0x6f18('0x41')]));if(_0x381eee[_0x6f18('0x3f')]['filter']){_0x78b309[_0x6f18('0x48')]=_['merge'](_0x78b309[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x78b309[_0x6f18('0x44')],function(_0x5428a3){var _0x404246={};_0x404246[_0x5428a3]={'$like':'%'+_0x381eee[_0x6f18('0x3f')]['filter']+'%'};return _0x404246;})});}_0x78b309=_[_0x6f18('0x53')]({},_0x78b309,_0x381eee[_0x6f18('0x4b')]);return _0xe4f412['getApplications'](_0x78b309);}})[_0x6f18('0x1e')](function(_0xbff092){if(_0xbff092){_0x159f02=_0xbff092[_0x6f18('0x45')];if(!_0x381eee[_0x6f18('0x3f')][_0x6f18('0x5d')](_0x6f18('0x46'))){_0x78b309[_0x6f18('0x2b')]=qs[_0x6f18('0x2b')](_0x381eee[_0x6f18('0x3f')][_0x6f18('0x2b')]);_0x78b309[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x381eee[_0x6f18('0x3f')][_0x6f18('0x2a')]);}return _0xe4f412[_0x6f18('0x78')](_0x78b309);}})[_0x6f18('0x1e')](function(_0x26b05d){if(_0x26b05d){return _0x26b05d?{'count':_0x159f02,'rows':_0x26b05d}:null;}})[_0x6f18('0x1e')](respondWithResult(_0x1637f1,null))[_0x6f18('0x50')](handleError(_0x1637f1,null));};function Extension(_0x1fe9dd,_0x560fdb,_0x379910,_0x456710){this['context']=_0x6f18('0x79');this['exten']=_0x1fe9dd['localstationid'];this['app']=_0x456710;this['type']=_0x6f18('0x7a');this[_0x6f18('0x7b')]='Fax\x20Extension';this[_0x6f18('0x5c')]=_0x1fe9dd['id'];this[_0x6f18('0x7c')]=_0x560fdb;this[_0x6f18('0x7d')]=_0x379910;}function createExtensionsReciveFax(_0x5cb557){var _0x34406e=0x1;var _0x43477a=[];_0x43477a[_0x6f18('0x7e')](new Extension(_0x5cb557,_0x34406e,'',_0x6f18('0x7f')));_0x34406e+=0x1;_0x43477a[_0x6f18('0x7e')](new Extension(_0x5cb557,_0x34406e,_0x6f18('0x80'),_0x6f18('0x81')));_0x34406e+=0x1;for(var _0x2b1d6b in _0x5cb557){if(_0x5cb557[_0x6f18('0x5d')](_0x2b1d6b)&&(_0x2b1d6b===_0x6f18('0x82')||_0x2b1d6b===_0x6f18('0x83')||_0x2b1d6b==='gateway'||_0x2b1d6b==='faxdetect'||_0x2b1d6b===_0x6f18('0x84')||_0x2b1d6b===_0x6f18('0x85')||_0x2b1d6b==='minrate'||_0x2b1d6b===_0x6f18('0x86')||_0x2b1d6b===_0x6f18('0x87'))){_0x43477a[_0x6f18('0x7e')](new Extension(_0x5cb557,_0x34406e,_0x6f18('0x88')+_0x2b1d6b+')='+_0x5cb557[_0x2b1d6b],_0x6f18('0x81')));_0x34406e+=0x1;}}_0x43477a['push'](new Extension(_0x5cb557,_0x34406e,'6',_0x6f18('0x89')));_0x34406e+=0x1;_0x43477a[_0x6f18('0x7e')](new Extension(_0x5cb557,_0x34406e,_0x6f18('0x8a'),_0x6f18('0x8b')));_0x34406e=0x0;return _0x43477a;}exports[_0x6f18('0x8c')]=function(_0x1842e8,_0x4e4f0a,_0x50d33f){var _0x295d0c;return db['sequelize'][_0x6f18('0x75')](function(_0x583e9e){return db[_0x6f18('0x3a')][_0x6f18('0x55')](_0x1842e8['body'],{'transaction':_0x583e9e})['then'](function(_0x4f7988){_0x295d0c=_0x4f7988[_0x6f18('0x31')]({'plain':!![]});return db[_0x6f18('0x8d')][_0x6f18('0x8e')](createExtensionsReciveFax(_0x295d0c),{'transaction':_0x583e9e});});})[_0x6f18('0x1e')](function(){return _0x295d0c;})['then'](respondWithResult(_0x4e4f0a,null))['catch'](handleError(_0x4e4f0a,null));};exports[_0x6f18('0x8f')]=function(_0x2cfe62,_0x478c62,_0x216525){var _0x5ea257;return db[_0x6f18('0x90')]['transaction'](function(_0x2a2c1e){return db[_0x6f18('0x3a')]['update'](_0x2cfe62[_0x6f18('0x5a')],{'where':{'id':_0x2cfe62[_0x6f18('0x5a')]['id']},'transaction':_0x2a2c1e})[_0x6f18('0x1e')](function(_0x327915){return db[_0x6f18('0x8d')][_0x6f18('0x30')]({'where':{'FaxAccountId':_0x2cfe62[_0x6f18('0x5a')]['id']},'transaction':_0x2a2c1e})['then'](function(_0x1fd457){return db['VoiceExtension'][_0x6f18('0x8e')](createExtensionsReciveFax(_[_0x6f18('0x6a')](_0x2cfe62['body'],[_0x6f18('0x91'),_0x6f18('0x3d'),_0x6f18('0x92'),_0x6f18('0x93'),_0x6f18('0x94'),_0x6f18('0x95')])),{'transaction':_0x2a2c1e});});});})[_0x6f18('0x1e')](function(){return db['FaxAccount']['findById'](_0x2cfe62['body']['id']);})[_0x6f18('0x1e')](respondWithResult(_0x478c62,null))[_0x6f18('0x50')](handleError(_0x478c62,null));};exports['getMessages']=function(_0x39a255,_0x430740,_0x5d9525){var _0x4f2495={'raw':!![],'where':{}};var _0x2c7060={};var _0x2f983d={'count':0x0,'rows':[]};return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x39a255[_0x6f18('0x52')]['id']}})['then'](handleEntityNotFound(_0x430740,null))[_0x6f18('0x1e')](function(_0x1478a2){if(_0x1478a2){_0x2c7060[_0x6f18('0x3e')]=_['keys'](db[_0x6f18('0x96')][_0x6f18('0x3b')]);_0x2c7060['query']=_['keys'](_0x39a255[_0x6f18('0x3f')]);_0x2c7060[_0x6f18('0x41')]=_[_0x6f18('0x42')](_0x2c7060[_0x6f18('0x3e')],_0x2c7060[_0x6f18('0x3f')]);_0x4f2495[_0x6f18('0x44')]=_[_0x6f18('0x42')](_0x2c7060[_0x6f18('0x3e')],qs[_0x6f18('0x43')](_0x39a255['query'][_0x6f18('0x43')]));_0x4f2495['attributes']=_0x4f2495[_0x6f18('0x44')][_0x6f18('0x45')]?_0x4f2495[_0x6f18('0x44')]:_0x2c7060[_0x6f18('0x3e')];if(!_0x39a255[_0x6f18('0x3f')][_0x6f18('0x5d')](_0x6f18('0x46'))){_0x4f2495[_0x6f18('0x2b')]=qs[_0x6f18('0x2b')](_0x39a255['query']['limit']);_0x4f2495[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x39a255['query'][_0x6f18('0x2a')]);}_0x4f2495[_0x6f18('0x47')]=qs['sort'](_0x39a255[_0x6f18('0x3f')][_0x6f18('0x5e')]);_0x4f2495[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x39a255['query'],_0x2c7060['filters']));_0x4f2495[_0x6f18('0x48')][_0x6f18('0x5c')]=_0x1478a2['id'];if(_0x39a255[_0x6f18('0x3f')][_0x6f18('0x49')]){_0x4f2495['where']=_['merge'](_0x4f2495[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x4f2495['attributes'],function(_0x2be1d3){var _0x2a782c={};_0x2a782c[_0x2be1d3]={'$like':'%'+_0x39a255[_0x6f18('0x3f')][_0x6f18('0x49')]+'%'};return _0x2a782c;})});}if(_0x39a255[_0x6f18('0x3f')][_0x6f18('0x97')]){var _0x17bff2=_0x39a255[_0x6f18('0x3f')]['$gte']['split'](',');var _0xcf1d8d={};_0xcf1d8d[_0x17bff2[0x0]]={'$gte':moment(_0x17bff2[0x1])[_0x6f18('0x98')](_0x6f18('0x99'))};_0x4f2495[_0x6f18('0x48')]=_[_0x6f18('0x53')](_0x4f2495[_0x6f18('0x48')],_0xcf1d8d);}_0x4f2495=_['merge']({},_0x4f2495,_0x39a255[_0x6f18('0x4b')]);return db[_0x6f18('0x96')]['count']({'where':_0x4f2495[_0x6f18('0x48')]})[_0x6f18('0x1e')](function(_0xf4aab7){_0x2f983d[_0x6f18('0x29')]=_0xf4aab7;if(_0x39a255['query']['includeAll']){_0x4f2495[_0x6f18('0x4d')]=[{'all':!![]}];}return db[_0x6f18('0x96')][_0x6f18('0x4e')](_0x4f2495);})[_0x6f18('0x1e')](function(_0x181665){_0x2f983d[_0x6f18('0x4f')]=_0x181665;return _0x2f983d;});}})[_0x6f18('0x1e')](respondWithFilteredResult(_0x430740,_0x4f2495))[_0x6f18('0x50')](handleError(_0x430740,null));};exports['send']=function(_0x5f0b98,_0x96f5ac,_0xe37ed9){var _0x58c250,_0x342c88={},_0x3838c7;if(_0x5f0b98[_0x6f18('0x5a')]['to']){_0x3838c7=_0x5f0b98[_0x6f18('0x5a')]['to'][0x0];}return db[_0x6f18('0x3a')]['find']({'where':{'id':_0x5f0b98[_0x6f18('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x6f18('0x9a'),'include':[{'model':db[_0x6f18('0x6c')],'as':_0x6f18('0x9b'),'where':{'fax':_0x3838c7},'limit':0x1,'order':[[_0x6f18('0x93'),_0x6f18('0x9c')]]}]}]})[_0x6f18('0x1e')](handleEntityNotFound(_0x96f5ac,null))[_0x6f18('0x1e')](function(_0x32a5cd){_0x58c250=_0x32a5cd;if(_0x5f0b98['body'][_0x6f18('0x9d')]&&_0x5f0b98['body']['attachments'][_0x6f18('0x45')]){for(var _0x2aebce=0x0;_0x2aebce<_0x5f0b98['body'][_0x6f18('0x9d')][_0x6f18('0x45')];_0x2aebce+=0x1){_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][_0x2aebce]={'filename':_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][_0x2aebce][_0x6f18('0x35')],'id':_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][_0x2aebce]['id'],'path':path[_0x6f18('0x9e')](config[_0x6f18('0x9f')],_0x6f18('0xa0'),_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][_0x2aebce][_0x6f18('0xa1')])};}}return respondWithRpcPromise(_0x6f18('0xa2'),_0x6f18('0xa2'),{'FaxAccountId':_[_0x6f18('0xa3')](_0x5f0b98[_0x6f18('0x52')]['id'])?undefined:_0x5f0b98['params']['id'],'path':_[_0x6f18('0xa3')](_0x5f0b98['body']['attachments'][0x0]['path'])?undefined:_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][0x0]['path'],'fax':_[_0x6f18('0xa3')](_0x5f0b98[_0x6f18('0x5a')]['to'][0x0])?undefined:_0x5f0b98['body']['to'][0x0]},client9002);})[_0x6f18('0x1e')](function(){if(_0x58c250){if(_[_0x6f18('0xa3')](_0x5f0b98['body']['from'])){_0x5f0b98['body'][_0x6f18('0xa4')]=util[_0x6f18('0x98')](_0x6f18('0xa5'),_0x58c250[_0x6f18('0x35')],_0x58c250[_0x6f18('0xa6')]);}if(_0x58c250[_0x6f18('0x9a')]){if(_0x58c250[_0x6f18('0x9a')][_0x6f18('0x9b')][_0x6f18('0x45')]){return _0x58c250[_0x6f18('0x9a')][_0x6f18('0x9b')][0x0];}else{return db[_0x6f18('0x6c')][_0x6f18('0x55')](_[_0x6f18('0x17')](_0x5f0b98[_0x6f18('0x5a')],{'firstName':_0x5f0b98[_0x6f18('0x5a')]['to'][0x0],'phone':_0x5f0b98[_0x6f18('0x5a')]['to'][0x0],'fax':_0x5f0b98[_0x6f18('0x5a')]['to'][0x0],'ListId':_0x58c250['ListId']}));}}else{throw new Error(_0x6f18('0xa7'));}}else{throw new Error(_0x6f18('0xa8'));}})[_0x6f18('0x1e')](function(_0xe06988){if(_0xe06988){return db[_0x6f18('0x69')][_0x6f18('0x54')]({'where':{'ContactId':_0xe06988['id'],'closed':![],'FaxAccountId':_0x58c250['id']}})[_0x6f18('0x1e')](function(_0x17a328){if(_0x17a328){return[_0x17a328,![]];}return db[_0x6f18('0x69')][_0x6f18('0x55')]({'UserId':_0x5f0b98['user']['id'],'ContactId':_0xe06988['id'],'FaxAccountId':_0x58c250['id'],'fax':_0x5f0b98[_0x6f18('0x5a')]['to'][0x0],'firstMsgDirection':_0x6f18('0xa9'),'Messages':[_['merge'](_0x5f0b98['body'],{'read':![],'body':_0x5f0b98[_0x6f18('0x5a')]['attachments'][0x0][_0x6f18('0xaa')],'FaxAccountId':_0x58c250['id'],'UserId':_0x5f0b98[_0x6f18('0x57')]['id'],'ContactId':_0xe06988['id'],'AttachmentId':_0x5f0b98['body'][_0x6f18('0x9d')][0x0]['id']})]},{'include':[{'model':db[_0x6f18('0x96')],'as':_0x6f18('0xab')}]})['then'](function(_0x5a410e){return[_0x5a410e,!![]];});});}else{throw new Error(_0x6f18('0xac'));}})[_0x6f18('0xad')](function(_0x5753e1,_0x5f1353){if(_0x5f1353){return _0x5753e1;}return db[_0x6f18('0x96')][_0x6f18('0x55')]({'direction':_0x6f18('0xa9'),'read':![],'body':_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][0x0][_0x6f18('0xaa')],'FaxAccountId':_0x58c250['id'],'FaxInteractionId':_0x5753e1['id'],'UserId':_0x5f0b98[_0x6f18('0x57')]['id'],'ContactId':_0x5753e1[_0x6f18('0xae')],'AttachmentId':_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][0x0]['id']})[_0x6f18('0x1e')](function(_0x519dfc){_0x5753e1['dataValues']['Messages']=[];_0x5753e1[_0x6f18('0xaf')][_0x6f18('0xab')][_0x6f18('0x7e')](_0x519dfc['dataValues']);return _0x5753e1;});})[_0x6f18('0x1e')](function(_0x10fcce){respondWithRpcPromise(_0x6f18('0xb0'),_0x6f18('0xb0'),{'FaxAccountId':_['isNil'](_0x5f0b98[_0x6f18('0x52')]['id'])?undefined:_0x5f0b98[_0x6f18('0x52')]['id'],'path':_[_0x6f18('0xa3')](_0x5f0b98[_0x6f18('0x5a')][_0x6f18('0x9d')][0x0]['path'])?undefined:_0x5f0b98[_0x6f18('0x5a')]['attachments'][0x0][_0x6f18('0x8')],'fax':_[_0x6f18('0xa3')](_0x5f0b98[_0x6f18('0x5a')]['to'][0x0])?undefined:_0x5f0b98['body']['to'][0x0],'AttachmentId':_0x5f0b98['body'][_0x6f18('0x9d')][0x0]['id']},client9002)['then'](function(_0x33bdb8){logger['info'](_0x6f18('0xb1'),_0x33bdb8);})[_0x6f18('0x50')](function(_0x257d17){logger['info'](_0x6f18('0xb1'),_0x257d17);});return _0x10fcce;})['then'](respondWithResult(_0x96f5ac,null))[_0x6f18('0x50')](handleError(_0x96f5ac,null));};exports['addAgents']=function(_0x685e95,_0x43bb23,_0x1ba666){return db[_0x6f18('0x3a')][_0x6f18('0x54')]({'where':{'id':_0x685e95[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x43bb23,null))[_0x6f18('0x1e')](function(_0x3cc484){if(_0x3cc484){return _0x3cc484[_0x6f18('0xb2')](_0x685e95[_0x6f18('0x5a')][_0x6f18('0x62')],_[_0x6f18('0x6a')](_0x685e95[_0x6f18('0x5a')],[_0x6f18('0x62'),'id'])||{})[_0x6f18('0xad')](function(_0x25a754){for(var _0x2935f2=0x0;_0x2935f2<_0x685e95[_0x6f18('0x5a')][_0x6f18('0x62')][_0x6f18('0x45')];_0x2935f2+=0x1){socket[_0x6f18('0xb3')](_0x6f18('0xb4'),{'UserId':_0x685e95[_0x6f18('0x5a')]['ids'][_0x2935f2],'FaxAccountId':_0x685e95[_0x6f18('0x52')]['id']});}return _0x25a754;});}})[_0x6f18('0x1e')](respondWithResult(_0x43bb23,null))['catch'](handleError(_0x43bb23,null));};exports['removeAgents']=function(_0x4c5bd6,_0x30a7e3,_0x48a5b5){return db['FaxAccount'][_0x6f18('0x54')]({'where':{'id':_0x4c5bd6[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x30a7e3,null))[_0x6f18('0x1e')](function(_0x22ab81){if(_0x22ab81){return _0x22ab81['removeAgents'](_0x4c5bd6[_0x6f18('0x3f')][_0x6f18('0x62')])['then'](function(){if(_['isArray'](_0x4c5bd6[_0x6f18('0x3f')][_0x6f18('0x62')])){for(var _0x19b799=0x0;_0x19b799<_0x4c5bd6['query'][_0x6f18('0x62')][_0x6f18('0x45')];_0x19b799+=0x1){socket['emit'](_0x6f18('0xb5'),{'UserId':Number(_0x4c5bd6[_0x6f18('0x3f')]['ids'][_0x19b799]),'FaxAccountId':Number(_0x4c5bd6[_0x6f18('0x52')]['id'])});}}else{socket[_0x6f18('0xb3')]('userFaxAccount:remove',{'UserId':Number(_0x4c5bd6[_0x6f18('0x3f')]['ids']),'FaxAccountId':Number(_0x4c5bd6[_0x6f18('0x52')]['id'])});}});}})[_0x6f18('0x1e')](respondWithStatusCode(_0x30a7e3,null))['catch'](handleError(_0x30a7e3,null));};exports[_0x6f18('0xb6')]=function(_0x3eba7c,_0x43fd1d,_0x4d1b95){var _0x590eed={};var _0x4904de={};var _0x4eff67;var _0x135725;return db[_0x6f18('0x3a')][_0x6f18('0x66')]({'where':{'id':_0x3eba7c[_0x6f18('0x52')]['id']}})[_0x6f18('0x1e')](handleEntityNotFound(_0x43fd1d,null))[_0x6f18('0x1e')](function(_0x26b020){if(_0x26b020){_0x4eff67=_0x26b020;_0x4904de[_0x6f18('0x3e')]=_['keys'](db[_0x6f18('0x6e')][_0x6f18('0x3b')]);_0x4904de[_0x6f18('0x3f')]=_[_0x6f18('0x40')](_0x3eba7c[_0x6f18('0x3f')]);_0x4904de[_0x6f18('0x41')]=_['intersection'](_0x4904de[_0x6f18('0x3e')],_0x4904de['query']);_0x590eed[_0x6f18('0x44')]=_['intersection'](_0x4904de['model'],qs[_0x6f18('0x43')](_0x3eba7c[_0x6f18('0x3f')]['fields']));_0x590eed[_0x6f18('0x44')]=_0x590eed[_0x6f18('0x44')][_0x6f18('0x45')]?_0x590eed[_0x6f18('0x44')]:_0x4904de[_0x6f18('0x3e')];_0x590eed[_0x6f18('0x47')]=qs[_0x6f18('0x5e')](_0x3eba7c['query'][_0x6f18('0x5e')]);_0x590eed[_0x6f18('0x48')]=qs[_0x6f18('0x41')](_[_0x6f18('0x5f')](_0x3eba7c[_0x6f18('0x3f')],_0x4904de[_0x6f18('0x41')]));if(_0x3eba7c[_0x6f18('0x3f')]['filter']){_0x590eed[_0x6f18('0x48')]=_[_0x6f18('0x53')](_0x590eed[_0x6f18('0x48')],{'$or':_[_0x6f18('0x39')](_0x590eed[_0x6f18('0x44')],function(_0x29c085){var _0x2a6704={};_0x2a6704[_0x29c085]={'$like':'%'+_0x3eba7c[_0x6f18('0x3f')][_0x6f18('0x49')]+'%'};return _0x2a6704;})});}_0x590eed=_['merge']({},_0x590eed,_0x3eba7c['options']);return _0x4eff67['getAgents'](_0x590eed);}})['then'](function(_0xdc9f62){if(_0xdc9f62){_0x135725=_0xdc9f62['length'];if(!_0x3eba7c[_0x6f18('0x3f')]['hasOwnProperty'](_0x6f18('0x46'))){_0x590eed[_0x6f18('0x2b')]=qs[_0x6f18('0x2b')](_0x3eba7c[_0x6f18('0x3f')][_0x6f18('0x2b')]);_0x590eed[_0x6f18('0x2a')]=qs[_0x6f18('0x2a')](_0x3eba7c[_0x6f18('0x3f')][_0x6f18('0x2a')]);}return _0x4eff67[_0x6f18('0xb6')](_0x590eed);}})[_0x6f18('0x1e')](function(_0x6e0bdd){if(_0x6e0bdd){return _0x6e0bdd?{'count':_0x135725,'rows':_0x6e0bdd}:null;}})[_0x6f18('0x1e')](respondWithResult(_0x43fd1d,null))[_0x6f18('0x50')](handleError(_0x43fd1d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5d34ca3..f1d6b24 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 _0x4d57=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x245a7d,_0x253c2f){var _0x24789d=function(_0x189e60){while(--_0x189e60){_0x245a7d['push'](_0x245a7d['shift']());}};_0x24789d(++_0x253c2f);}(_0x4d57,0x10f));var _0x74d5=function(_0x5d76a5,_0x1a2f29){_0x5d76a5=_0x5d76a5-0x0;var _0x4b0e54=_0x4d57[_0x5d76a5];return _0x4b0e54;};'use strict';var EventEmitter=require(_0x74d5('0x0'));var FaxAccount=require(_0x74d5('0x1'))['db'][_0x74d5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x74d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74d5('0x4'),'afterDestroy':_0x74d5('0x5')};function emitEvent(_0x22714f){return function(_0x37ae1f,_0x1b573f,_0x5542c7){FaxAccountEvents[_0x74d5('0x6')](_0x22714f+':'+_0x37ae1f['id'],_0x37ae1f);FaxAccountEvents[_0x74d5('0x6')](_0x22714f,_0x37ae1f);_0x5542c7(null);};}for(var e in events){if(events[_0x74d5('0x7')](e)){var event=events[e];FaxAccount[_0x74d5('0x8')](e,emitEvent(event));}}module[_0x74d5('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x5836=['emit','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove'];(function(_0x574de7,_0x24ce60){var _0x568f46=function(_0x516004){while(--_0x516004){_0x574de7['push'](_0x574de7['shift']());}};_0x568f46(++_0x24ce60);}(_0x5836,0x1bc));var _0x6583=function(_0xe22435,_0x27157f){_0xe22435=_0xe22435-0x0;var _0x4fa237=_0x5836[_0xe22435];return _0x4fa237;};'use strict';var EventEmitter=require(_0x6583('0x0'));var FaxAccount=require(_0x6583('0x1'))['db'][_0x6583('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6583('0x3'),'afterUpdate':_0x6583('0x4'),'afterDestroy':_0x6583('0x5')};function emitEvent(_0x1cb512){return function(_0x298343,_0x565d77,_0x326eec){FaxAccountEvents[_0x6583('0x6')](_0x1cb512+':'+_0x298343['id'],_0x298343);FaxAccountEvents['emit'](_0x1cb512,_0x298343);_0x326eec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x6583('0x7')](e,emitEvent(event));}}module[_0x6583('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 59ac730..fae7cc1 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 _0xe4a8=['moment','path','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','util','../../config/logger','api'];(function(_0x419234,_0x1c7ffa){var _0x1d94fb=function(_0x4ca8a9){while(--_0x4ca8a9){_0x419234['push'](_0x419234['shift']());}};_0x1d94fb(++_0x1c7ffa);}(_0xe4a8,0xb1));var _0x8e4a=function(_0x3d35a2,_0x1240da){_0x3d35a2=_0x3d35a2-0x0;var _0x539ed2=_0xe4a8[_0x3d35a2];return _0x539ed2;};'use strict';var _=require('lodash');var util=require(_0x8e4a('0x0'));var logger=require(_0x8e4a('0x1'))(_0x8e4a('0x2'));var moment=require(_0x8e4a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e4a('0x4'));var rimraf=require('rimraf');var config=require(_0x8e4a('0x5'));var attributes=require(_0x8e4a('0x6'));module['exports']=function(_0x920490,_0x88ecc8){return _0x920490[_0x8e4a('0x7')](_0x8e4a('0x8'),attributes,{'tableName':_0x8e4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e0f=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b658,_0x344b6a){var _0x1d17e5=function(_0x1fae07){while(--_0x1fae07){_0x1b658['push'](_0x1b658['shift']());}};_0x1d17e5(++_0x344b6a);}(_0x8e0f,0xdd));var _0xf8e0=function(_0x3df02c,_0x27166c){_0x3df02c=_0x3df02c-0x0;var _0x5cb500=_0x8e0f[_0x3df02c];return _0x5cb500;};'use strict';var _=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var logger=require(_0xf8e0('0x2'))(_0xf8e0('0x3'));var moment=require(_0xf8e0('0x4'));var BPromise=require(_0xf8e0('0x5'));var rp=require(_0xf8e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8e0('0x7'));var attributes=require(_0xf8e0('0x8'));module[_0xf8e0('0x9')]=function(_0x45b5ae,_0x20cb35){return _0x45b5ae[_0xf8e0('0xa')](_0xf8e0('0xb'),attributes,{'tableName':'fax_accounts','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 2fe92e5..ffc6ea7 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 _0x76d5=['defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x10450c,_0x1d874e){var _0x56b43d=function(_0x18ecf2){while(--_0x18ecf2){_0x10450c['push'](_0x10450c['shift']());}};_0x56b43d(++_0x1d874e);}(_0x76d5,0x108));var _0x576d=function(_0x52c48a,_0x3fba71){_0x52c48a=_0x52c48a-0x0;var _0x38556e=_0x76d5[_0x52c48a];return _0x38556e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x576d('0x0'));var BPromise=require(_0x576d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x576d('0x2'));var logger=require(_0x576d('0x3'))(_0x576d('0x4'));var config=require('../../config/environment');var jayson=require(_0x576d('0x5'));var client=jayson[_0x576d('0x6')][_0x576d('0x7')]({'port':0x232c});config[_0x576d('0x8')]=_[_0x576d('0x9')](config['redis'],{'host':_0x576d('0xa'),'port':0x18eb});var socket=require(_0x576d('0xb'))(new Redis(config[_0x576d('0x8')]));require(_0x576d('0xc'))[_0x576d('0xd')](socket);function respondWithRpcPromise(_0x268014,_0x7434ed,_0x2d969b){return new BPromise(function(_0x3feab2,_0x49982f){return client['request'](_0x268014,_0x2d969b)[_0x576d('0xe')](function(_0x2db045){logger[_0x576d('0xf')]('FaxAccount,\x20%s,\x20%s',_0x7434ed,_0x576d('0x10'));logger[_0x576d('0x11')](_0x576d('0x12'),_0x7434ed,_0x576d('0x10'),JSON[_0x576d('0x13')](_0x2db045));if(_0x2db045[_0x576d('0x14')]){if(_0x2db045[_0x576d('0x14')][_0x576d('0x15')]===0x1f4){logger[_0x576d('0x14')](_0x576d('0x16'),_0x7434ed,_0x2db045[_0x576d('0x14')][_0x576d('0x17')]);return _0x49982f(_0x2db045[_0x576d('0x14')][_0x576d('0x17')]);}logger[_0x576d('0x14')](_0x576d('0x16'),_0x7434ed,_0x2db045['error']['message']);return _0x3feab2(_0x2db045[_0x576d('0x14')][_0x576d('0x17')]);}else{logger[_0x576d('0xf')](_0x576d('0x16'),_0x7434ed,_0x576d('0x10'));_0x3feab2(_0x2db045[_0x576d('0x18')]['message']);}})['catch'](function(_0x1fe214){logger['error'](_0x576d('0x16'),_0x7434ed,_0x1fe214);_0x49982f(_0x1fe214);});});}exports['GetFaxAccount']=function(_0x59c481){var _0x452066=this;return new Promise(function(_0x584443,_0x2f74ca){return db['FaxAccount'][_0x576d('0x19')]({'raw':_0x59c481[_0x576d('0x1a')]?_0x59c481['options'][_0x576d('0x1b')]===undefined?!![]:![]:!![],'where':_0x59c481[_0x576d('0x1a')]?_0x59c481[_0x576d('0x1a')][_0x576d('0x1c')]||null:null,'attributes':_0x59c481['options']?_0x59c481[_0x576d('0x1a')][_0x576d('0x1d')]||null:null,'limit':_0x59c481[_0x576d('0x1a')]?_0x59c481[_0x576d('0x1a')][_0x576d('0x1e')]||null:null,'include':_0x59c481['options']?_0x59c481['options'][_0x576d('0x1f')]?_[_0x576d('0x20')](_0x59c481[_0x576d('0x1a')][_0x576d('0x1f')],function(_0x3442d4){return{'model':db[_0x3442d4[_0x576d('0x21')]],'as':_0x3442d4['as'],'attributes':_0x3442d4[_0x576d('0x1d')],'include':_0x3442d4[_0x576d('0x1f')]?_[_0x576d('0x20')](_0x3442d4[_0x576d('0x1f')],function(_0x56a295){return{'model':db[_0x56a295[_0x576d('0x21')]],'as':_0x56a295['as'],'attributes':_0x56a295[_0x576d('0x1d')],'include':_0x56a295[_0x576d('0x1f')]?_[_0x576d('0x20')](_0x56a295[_0x576d('0x1f')],function(_0x29b5ef){return{'model':db[_0x29b5ef[_0x576d('0x21')]],'as':_0x29b5ef['as'],'attributes':_0x29b5ef[_0x576d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x297bf0){logger[_0x576d('0xf')](_0x576d('0x22'),_0x59c481);logger[_0x576d('0x11')](_0x576d('0x22'),_0x59c481,JSON[_0x576d('0x13')](_0x297bf0));_0x584443(_0x297bf0);})['catch'](function(_0x26ab7a){logger[_0x576d('0x14')](_0x576d('0x22'),_0x26ab7a[_0x576d('0x17')],_0x59c481);_0x2f74ca(_0x452066[_0x576d('0x14')](0x1f4,_0x26ab7a['message']));});});};exports['NotifyFaxAccount']=function(_0x201b79,_0x4077aa,_0x30e348){var _0x47a56=this;return new Promise(function(_0x92dcba,_0x1cd630){var _0x4923f1={'body':_0x201b79[_0x576d('0x23')],'channel':_0x576d('0x24')};var _0x5b0236=[];var _0x5da92f=[];var _0x5021a3={};return db[_0x576d('0x25')][_0x576d('0x26')]()[_0x576d('0xe')](function(_0x2083d4){if(!_0x2083d4){throw new db['Sequelize'][(_0x576d('0x27'))](_0x576d('0x28'));}_0x5b0236=_[_0x576d('0x29')](_[_0x576d('0x2a')](_0x2083d4),[_0x576d('0x2b'),_0x576d('0x2c')]);_0x5da92f=_['difference'](_[_0x576d('0x2a')](_0x2083d4),[_0x576d('0x2b'),'updatedAt',_0x576d('0x2d'),_0x576d('0x2e')]);if(_0x201b79['body']['id']){delete _0x201b79[_0x576d('0x23')]['id'];}if(_[_0x576d('0x2f')](_0x201b79[_0x576d('0x23')][_0x576d('0x30')])){throw new db[(_0x576d('0x31'))]['ValidationError'](_0x576d('0x32'));}if(_['isNil'](_0x201b79[_0x576d('0x23')][_0x576d('0x23')])||_0x201b79[_0x576d('0x23')][_0x576d('0x23')]===''){throw new db[(_0x576d('0x31'))][(_0x576d('0x27'))](_0x576d('0x33'));}if(_[_0x576d('0x2f')](_0x201b79[_0x576d('0x23')][_0x576d('0x34')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5da92f);}if(!_['includes'](_0x5da92f,_0x201b79[_0x576d('0x23')][_0x576d('0x34')])){throw new db['Sequelize'][(_0x576d('0x27'))](_0x576d('0x35')+_0x5da92f);}_0x5021a3[_0x201b79[_0x576d('0x23')]['mapKey']]=_0x201b79[_0x576d('0x23')][_0x576d('0x30')];})['then'](function(){return db[_0x576d('0x36')][_0x576d('0x37')]({'where':{'id':_0x201b79[_0x576d('0x38')]['id']},'include':[{'model':db[_0x576d('0x39')],'as':_0x576d('0x3a'),'include':[{'model':db[_0x576d('0x25')],'as':_0x576d('0x3b'),'where':_0x5021a3,'limit':0x1,'order':[['updatedAt',_0x576d('0x3c')]]}]},{'model':db[_0x576d('0x3d')],'as':_0x576d('0x3e')}]});})[_0x576d('0xe')](function(_0x40e43b){if(_0x40e43b&&_0x40e43b[_0x576d('0x3a')]){var _0x26eb69=_0x40e43b[_0x576d('0x3f')]({'plain':!![]});_0x4923f1[_0x576d('0x38')]=_0x26eb69;_0x4923f1['applications']=_0x26eb69[_0x576d('0x3e')];_0x4923f1[_0x576d('0x40')]=_0x26eb69['List'];_0x4923f1[_0x576d('0x41')]=_[_0x576d('0x42')](_0x4923f1['applications'],[_0x576d('0x43')],[_0x576d('0x44')]);if(_0x4923f1['account'][_0x576d('0x3e')]){delete _0x4923f1['account'][_0x576d('0x3e')];}if(_0x4923f1[_0x576d('0x38')]['List']&&_0x4923f1['account'][_0x576d('0x3a')]['Contacts'][_0x576d('0x45')]){return _0x4923f1[_0x576d('0x38')][_0x576d('0x3a')]['Contacts'][0x0];}var _0x1dfd94=_[_0x576d('0x9')](_0x201b79[_0x576d('0x23')],{'firstName':_0x201b79[_0x576d('0x23')]['from'],'ListId':_0x26eb69[_0x576d('0x2e')]});_0x1dfd94[_0x201b79[_0x576d('0x23')]['mapKey']]=_0x201b79[_0x576d('0x23')][_0x576d('0x30')];return db[_0x576d('0x25')][_0x576d('0x46')](_0x1dfd94,{'fields':_0x5b0236,'raw':!![]});}})[_0x576d('0xe')](function(_0x230313){_0x4923f1[_0x576d('0x47')]=_0x230313;if(_0x230313){var _0x515f0b={'ContactId':_0x230313['id'],'FaxAccountId':_0x201b79['account']['id'],'fax':_0x230313[_0x576d('0x24')]};return db[_0x576d('0x48')][_0x576d('0x37')]({'where':{'ContactId':_0x230313['id'],'closed':![],'FaxAccountId':_0x201b79[_0x576d('0x38')]['id']}})['then'](function(_0x2dcee2){if(_0x2dcee2){return[_0x2dcee2,![]];}return db[_0x576d('0x48')][_0x576d('0x46')](_0x515f0b)[_0x576d('0xe')](function(_0x2754b0){return[_0x2754b0,!![]];});});}else{throw new Error(_0x576d('0x49'));}})[_0x576d('0x4a')](function(_0x59998a,_0xe16e47){var _0x3f50dd=_0x59998a[_0x576d('0x3f')]({'plain':!![]});if(_0xe16e47){if(_0x4923f1[_0x576d('0x38')][_0x576d('0x4b')]){_0x4923f1[_0x576d('0x41')][_0x576d('0x4c')]({'id':0x0,'priority':_0x4923f1[_0x576d('0x41')][_0x576d('0x45')]+0x1,'app':_0x576d('0x4d'),'appdata':_0x576d('0x4e'),'interval':_0x576d('0x4f')});}_0x3f50dd[_0x576d('0x50')]=!![];}else{_0x3f50dd[_0x576d('0x50')]=![];}_0x4923f1[_0x576d('0x51')]=_0x3f50dd;return db[_0x576d('0x52')]['create']({'body':_0x201b79[_0x576d('0x23')]['body'],'FaxAccountId':_0x201b79[_0x576d('0x38')]['id'],'FaxInteractionId':_0x59998a['id'],'direction':'in','ContactId':_0x59998a['ContactId'],'AttachmentId':_0x201b79[_0x576d('0x23')]['AttachmentId']});})[_0x576d('0xe')](function(_0x2662b2){_0x4923f1[_0x576d('0x17')]=_0x2662b2;if(_0x4923f1['interaction']['UserId']){return db[_0x576d('0x53')][_0x576d('0x37')]({'attributes':['id','name'],'where':{'id':_0x4923f1[_0x576d('0x51')][_0x576d('0x54')]}})[_0x576d('0xe')](function(_0xd6387b){if(_0xd6387b){_0x4923f1[_0x576d('0x41')][_0x576d('0x55')]({'id':0x0,'priority':0x0,'app':_0x576d('0x56'),'appdata':_0xd6387b[_0x576d('0x57')]+','+(_0x4923f1[_0x576d('0x38')][_0x576d('0x58')]||0xa),'interval':_0x576d('0x4f')});}return respondWithRpcPromise(_0x576d('0x59'),_0x576d('0x5a'),_0x4923f1);});}return respondWithRpcPromise('Start',_0x576d('0x5a'),_0x4923f1);})[_0x576d('0xe')](function(_0x2d2a09){_0x92dcba(_0x2d2a09);})['catch'](function(_0x5a716f){_0x1cd630(_0x47a56[_0x576d('0x14')](0x1f4,_0x5a716f['message']));});});}; \ No newline at end of file +var _0x5c75=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','User','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','map','include','model','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x4bc098,_0x308db8){var _0x3136c0=function(_0x42aa3c){while(--_0x42aa3c){_0x4bc098['push'](_0x4bc098['shift']());}};_0x3136c0(++_0x308db8);}(_0x5c75,0x1ea));var _0x55c7=function(_0x51b8e7,_0x5c70fb){_0x51b8e7=_0x51b8e7-0x0;var _0x81fd25=_0x5c75[_0x51b8e7];return _0x81fd25;};'use strict';var _=require(_0x55c7('0x0'));var util=require(_0x55c7('0x1'));var moment=require(_0x55c7('0x2'));var BPromise=require(_0x55c7('0x3'));var rs=require(_0x55c7('0x4'));var fs=require('fs');var Redis=require(_0x55c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x55c7('0x6'));var logger=require(_0x55c7('0x7'))(_0x55c7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x55c7('0x9')]({'port':0x232c});config['redis']=_[_0x55c7('0xa')](config[_0x55c7('0xb')],{'host':_0x55c7('0xc'),'port':0x18eb});var socket=require(_0x55c7('0xd'))(new Redis(config[_0x55c7('0xb')]));require(_0x55c7('0xe'))[_0x55c7('0xf')](socket);function respondWithRpcPromise(_0x3782b3,_0x4a8609,_0x5d6eda){return new BPromise(function(_0x2e6f7f,_0x15c457){return client[_0x55c7('0x10')](_0x3782b3,_0x5d6eda)[_0x55c7('0x11')](function(_0x205581){logger[_0x55c7('0x12')](_0x55c7('0x13'),_0x4a8609,'request\x20sent');logger[_0x55c7('0x14')](_0x55c7('0x15'),_0x4a8609,'request\x20sent',JSON['stringify'](_0x205581));if(_0x205581[_0x55c7('0x16')]){if(_0x205581[_0x55c7('0x16')][_0x55c7('0x17')]===0x1f4){logger[_0x55c7('0x16')]('FaxAccount,\x20%s,\x20%s',_0x4a8609,_0x205581[_0x55c7('0x16')][_0x55c7('0x18')]);return _0x15c457(_0x205581[_0x55c7('0x16')]['message']);}logger[_0x55c7('0x16')]('FaxAccount,\x20%s,\x20%s',_0x4a8609,_0x205581[_0x55c7('0x16')]['message']);return _0x2e6f7f(_0x205581[_0x55c7('0x16')]['message']);}else{logger[_0x55c7('0x12')](_0x55c7('0x13'),_0x4a8609,'request\x20sent');_0x2e6f7f(_0x205581[_0x55c7('0x19')][_0x55c7('0x18')]);}})[_0x55c7('0x1a')](function(_0x423a83){logger[_0x55c7('0x16')](_0x55c7('0x13'),_0x4a8609,_0x423a83);_0x15c457(_0x423a83);});});}exports[_0x55c7('0x1b')]=function(_0x2ead03){var _0x2ef21d=this;return new Promise(function(_0x46da1f,_0x133b0c){return db[_0x55c7('0x1c')]['findAll']({'raw':_0x2ead03[_0x55c7('0x1d')]?_0x2ead03[_0x55c7('0x1d')][_0x55c7('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ead03[_0x55c7('0x1d')]?_0x2ead03[_0x55c7('0x1d')]['where']||null:null,'attributes':_0x2ead03[_0x55c7('0x1d')]?_0x2ead03['options'][_0x55c7('0x1f')]||null:null,'limit':_0x2ead03[_0x55c7('0x1d')]?_0x2ead03[_0x55c7('0x1d')][_0x55c7('0x20')]||null:null,'include':_0x2ead03[_0x55c7('0x1d')]?_0x2ead03[_0x55c7('0x1d')]['include']?_[_0x55c7('0x21')](_0x2ead03['options'][_0x55c7('0x22')],function(_0x180ad4){return{'model':db[_0x180ad4['model']],'as':_0x180ad4['as'],'attributes':_0x180ad4[_0x55c7('0x1f')],'include':_0x180ad4[_0x55c7('0x22')]?_['map'](_0x180ad4[_0x55c7('0x22')],function(_0x3f4444){return{'model':db[_0x3f4444[_0x55c7('0x23')]],'as':_0x3f4444['as'],'attributes':_0x3f4444['attributes'],'include':_0x3f4444['include']?_[_0x55c7('0x21')](_0x3f4444['include'],function(_0xb5c422){return{'model':db[_0xb5c422[_0x55c7('0x23')]],'as':_0xb5c422['as'],'attributes':_0xb5c422[_0x55c7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x55c7('0x11')](function(_0x176ab4){logger[_0x55c7('0x12')](_0x55c7('0x1b'),_0x2ead03);logger[_0x55c7('0x14')](_0x55c7('0x1b'),_0x2ead03,JSON[_0x55c7('0x24')](_0x176ab4));_0x46da1f(_0x176ab4);})[_0x55c7('0x1a')](function(_0xf58dac){logger[_0x55c7('0x16')](_0x55c7('0x1b'),_0xf58dac['message'],_0x2ead03);_0x133b0c(_0x2ef21d[_0x55c7('0x16')](0x1f4,_0xf58dac[_0x55c7('0x18')]));});});};exports[_0x55c7('0x25')]=function(_0x528606,_0x90b1cf,_0x426033){var _0xe44f23=this;return new Promise(function(_0x1cebfb,_0x206272){var _0x32f56d={'body':_0x528606[_0x55c7('0x26')],'channel':_0x55c7('0x27')};var _0xcf3392=[];var _0x27a77f=[];var _0x3c0dea={};return db[_0x55c7('0x28')]['describe']()[_0x55c7('0x11')](function(_0x6d4dab){if(!_0x6d4dab){throw new db[(_0x55c7('0x29'))]['ValidationError'](_0x55c7('0x2a'));}_0xcf3392=_[_0x55c7('0x2b')](_['keys'](_0x6d4dab),[_0x55c7('0x2c'),'updatedAt']);_0x27a77f=_[_0x55c7('0x2b')](_[_0x55c7('0x2d')](_0x6d4dab),[_0x55c7('0x2c'),_0x55c7('0x2e'),_0x55c7('0x2f'),_0x55c7('0x30')]);if(_0x528606[_0x55c7('0x26')]['id']){delete _0x528606[_0x55c7('0x26')]['id'];}if(_[_0x55c7('0x31')](_0x528606['body']['from'])){throw new db[(_0x55c7('0x29'))]['ValidationError'](_0x55c7('0x32'));}if(_[_0x55c7('0x31')](_0x528606['body'][_0x55c7('0x26')])||_0x528606[_0x55c7('0x26')][_0x55c7('0x26')]===''){throw new db[(_0x55c7('0x29'))][(_0x55c7('0x33'))](_0x55c7('0x34'));}if(_[_0x55c7('0x31')](_0x528606[_0x55c7('0x26')][_0x55c7('0x35')])){throw new db[(_0x55c7('0x29'))][(_0x55c7('0x33'))](_0x55c7('0x36')+_0x27a77f);}if(!_[_0x55c7('0x37')](_0x27a77f,_0x528606[_0x55c7('0x26')][_0x55c7('0x35')])){throw new db['Sequelize'][(_0x55c7('0x33'))](_0x55c7('0x38')+_0x27a77f);}_0x3c0dea[_0x528606['body'][_0x55c7('0x35')]]=_0x528606['body'][_0x55c7('0x39')];})['then'](function(){return db[_0x55c7('0x1c')][_0x55c7('0x3a')]({'where':{'id':_0x528606[_0x55c7('0x3b')]['id']},'include':[{'model':db[_0x55c7('0x3c')],'as':_0x55c7('0x3d'),'include':[{'model':db[_0x55c7('0x28')],'as':_0x55c7('0x3e'),'where':_0x3c0dea,'limit':0x1,'order':[[_0x55c7('0x2e'),_0x55c7('0x3f')]]}]},{'model':db[_0x55c7('0x40')],'as':_0x55c7('0x41')}]});})['then'](function(_0x538da6){if(_0x538da6&&_0x538da6[_0x55c7('0x3d')]){var _0x272d47=_0x538da6[_0x55c7('0x42')]({'plain':!![]});_0x32f56d[_0x55c7('0x3b')]=_0x272d47;_0x32f56d['applications']=_0x272d47[_0x55c7('0x41')];_0x32f56d[_0x55c7('0x43')]=_0x272d47[_0x55c7('0x3d')];_0x32f56d['applications']=_['orderBy'](_0x32f56d[_0x55c7('0x44')],[_0x55c7('0x45')],[_0x55c7('0x46')]);if(_0x32f56d[_0x55c7('0x3b')][_0x55c7('0x41')]){delete _0x32f56d[_0x55c7('0x3b')][_0x55c7('0x41')];}if(_0x32f56d[_0x55c7('0x3b')][_0x55c7('0x3d')]&&_0x32f56d[_0x55c7('0x3b')][_0x55c7('0x3d')]['Contacts'][_0x55c7('0x47')]){return _0x32f56d[_0x55c7('0x3b')][_0x55c7('0x3d')]['Contacts'][0x0];}var _0x10f266=_['defaults'](_0x528606[_0x55c7('0x26')],{'firstName':_0x528606['body'][_0x55c7('0x39')],'ListId':_0x272d47[_0x55c7('0x30')]});_0x10f266[_0x528606[_0x55c7('0x26')]['mapKey']]=_0x528606[_0x55c7('0x26')]['from'];return db[_0x55c7('0x28')][_0x55c7('0x48')](_0x10f266,{'fields':_0xcf3392,'raw':!![]});}})[_0x55c7('0x11')](function(_0x3789c8){_0x32f56d[_0x55c7('0x49')]=_0x3789c8;if(_0x3789c8){var _0x2dd365={'ContactId':_0x3789c8['id'],'FaxAccountId':_0x528606['account']['id'],'fax':_0x3789c8['fax']};return db[_0x55c7('0x4a')][_0x55c7('0x3a')]({'where':{'ContactId':_0x3789c8['id'],'closed':![],'FaxAccountId':_0x528606[_0x55c7('0x3b')]['id']}})[_0x55c7('0x11')](function(_0x4bfa54){if(_0x4bfa54){return[_0x4bfa54,![]];}return db[_0x55c7('0x4a')][_0x55c7('0x48')](_0x2dd365)[_0x55c7('0x11')](function(_0xce5d93){return[_0xce5d93,!![]];});});}else{throw new Error(_0x55c7('0x4b'));}})[_0x55c7('0x4c')](function(_0x5c1e65,_0x105d7e){var _0x52825a=_0x5c1e65[_0x55c7('0x42')]({'plain':!![]});if(_0x105d7e){if(_0x32f56d[_0x55c7('0x3b')]['autoclose']){_0x32f56d[_0x55c7('0x44')][_0x55c7('0x4d')]({'id':0x0,'priority':_0x32f56d[_0x55c7('0x44')][_0x55c7('0x47')]+0x1,'app':_0x55c7('0x4e'),'appdata':_0x55c7('0x4f'),'interval':_0x55c7('0x50')});}_0x52825a[_0x55c7('0x51')]=!![];}else{_0x52825a[_0x55c7('0x51')]=![];}_0x32f56d[_0x55c7('0x52')]=_0x52825a;return db['FaxMessage'][_0x55c7('0x48')]({'body':_0x528606[_0x55c7('0x26')][_0x55c7('0x26')],'FaxAccountId':_0x528606[_0x55c7('0x3b')]['id'],'FaxInteractionId':_0x5c1e65['id'],'direction':'in','ContactId':_0x5c1e65[_0x55c7('0x53')],'AttachmentId':_0x528606[_0x55c7('0x26')]['AttachmentId']});})[_0x55c7('0x11')](function(_0x5676fc){_0x32f56d[_0x55c7('0x18')]=_0x5676fc;if(_0x32f56d[_0x55c7('0x52')]['UserId']){return db[_0x55c7('0x54')][_0x55c7('0x3a')]({'attributes':['id',_0x55c7('0x55')],'where':{'id':_0x32f56d[_0x55c7('0x52')][_0x55c7('0x56')]}})[_0x55c7('0x11')](function(_0x5abd24){if(_0x5abd24){_0x32f56d[_0x55c7('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':_0x55c7('0x57'),'appdata':_0x5abd24[_0x55c7('0x55')]+','+(_0x32f56d[_0x55c7('0x3b')][_0x55c7('0x58')]||0xa),'interval':_0x55c7('0x50')});}return respondWithRpcPromise(_0x55c7('0x59'),_0x55c7('0x5a'),_0x32f56d);});}return respondWithRpcPromise(_0x55c7('0x59'),_0x55c7('0x5a'),_0x32f56d);})['then'](function(_0x1ff893){_0x1cebfb(_0x1ff893);})[_0x55c7('0x1a')](function(_0x925b2c){_0x206272(_0xe44f23['error'](0x1f4,_0x925b2c[_0x55c7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 0904b77..b1bc4fe 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 _0x9536=['length','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x9536,0x179));var _0x6953=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x9536[_0x33032e];return _0x13316b;};'use strict';var FaxAccountEvents=require(_0x6953('0x0'));var events=[_0x6953('0x1'),_0x6953('0x2'),_0x6953('0x3')];function createListener(_0x4d218f,_0xc3e4dd){return function(_0x53b172){_0xc3e4dd[_0x6953('0x4')](_0x4d218f,_0x53b172);};}function removeListener(_0x3c32c7,_0x1dee7c){return function(){FaxAccountEvents[_0x6953('0x5')](_0x3c32c7,_0x1dee7c);};}exports[_0x6953('0x6')]=function(_0x494ac2){for(var _0x2b273e=0x0,_0x2bb026=events[_0x6953('0x7')];_0x2b273e<_0x2bb026;_0x2b273e++){var _0x3e1aff=events[_0x2b273e];var _0x1c8225=createListener('faxAccount:'+_0x3e1aff,_0x494ac2);FaxAccountEvents['on'](_0x3e1aff,_0x1c8225);}}; \ No newline at end of file +var _0x27a0=['length','faxAccount:','save','remove','update','removeListener','register'];(function(_0x584948,_0x196f5b){var _0x28fdb6=function(_0x428bdf){while(--_0x428bdf){_0x584948['push'](_0x584948['shift']());}};_0x28fdb6(++_0x196f5b);}(_0x27a0,0xbf));var _0x027a=function(_0x6789aa,_0xcd8ced){_0x6789aa=_0x6789aa-0x0;var _0xce7265=_0x27a0[_0x6789aa];return _0xce7265;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x027a('0x0'),_0x027a('0x1'),_0x027a('0x2')];function createListener(_0x352dd7,_0x32e5e0){return function(_0x59cd58){_0x32e5e0['emit'](_0x352dd7,_0x59cd58);};}function removeListener(_0x4e8d6b,_0x47cd65){return function(){FaxAccountEvents[_0x027a('0x3')](_0x4e8d6b,_0x47cd65);};}exports[_0x027a('0x4')]=function(_0x137b09){for(var _0x639bec=0x0,_0xe233ed=events[_0x027a('0x5')];_0x639bec<_0xe233ed;_0x639bec++){var _0x550fbb=events[_0x639bec];var _0x3d1429=createListener(_0x027a('0x6')+_0x550fbb,_0x137b09);FaxAccountEvents['on'](_0x550fbb,_0x3d1429);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d36a7b2..be5587b 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 _0x5047=['send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addInteraction','addAccountApplications','/updateaccountapplications','updateAccountApplications'];(function(_0x59dcf0,_0x24b766){var _0x257ac6=function(_0xd10b2e){while(--_0xd10b2e){_0x59dcf0['push'](_0x59dcf0['shift']());}};_0x257ac6(++_0x24b766);}(_0x5047,0x107));var _0x7504=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x5047[_0xabfec4];return _0x7bafa2;};'use strict';var multer=require(_0x7504('0x0'));var util=require(_0x7504('0x1'));var path=require('path');var timeout=require(_0x7504('0x2'));var express=require(_0x7504('0x3'));var router=express[_0x7504('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7504('0x5'));var config=require(_0x7504('0x6'));var controller=require(_0x7504('0x7'));router[_0x7504('0x8')]('/',auth[_0x7504('0x9')](),controller['index']);router['get'](_0x7504('0xa'),auth['isAuthenticated'](),controller[_0x7504('0xb')]);router[_0x7504('0x8')](_0x7504('0xc'),auth[_0x7504('0x9')](),controller[_0x7504('0xd')]);router[_0x7504('0x8')](_0x7504('0xe'),auth[_0x7504('0x9')](),controller[_0x7504('0xf')]);router[_0x7504('0x8')](_0x7504('0x10'),auth['isAuthenticated'](),controller[_0x7504('0x11')]);router[_0x7504('0x8')]('/:id/interactions',auth[_0x7504('0x9')](),controller[_0x7504('0x12')]);router[_0x7504('0x8')](_0x7504('0x13'),auth[_0x7504('0x9')](),controller[_0x7504('0x14')]);router[_0x7504('0x8')](_0x7504('0x15'),auth[_0x7504('0x9')](),controller[_0x7504('0x16')]);router[_0x7504('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x7504('0x17')]);router[_0x7504('0x18')]('/',auth[_0x7504('0x9')](),controller[_0x7504('0x19')]);router[_0x7504('0x18')](_0x7504('0xe'),auth[_0x7504('0x9')](),controller[_0x7504('0x1a')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x7504('0x18')]('/:id/interactions',auth[_0x7504('0x9')](),controller[_0x7504('0x1b')]);router['post'](_0x7504('0x13'),auth[_0x7504('0x9')](),controller['addApplications']);router[_0x7504('0x18')]('/addaccountapplications',auth['isAuthenticated'](),controller[_0x7504('0x1c')]);router['post'](_0x7504('0x1d'),auth[_0x7504('0x9')](),controller[_0x7504('0x1e')]);router['post']('/:id/send',auth[_0x7504('0x9')](),controller[_0x7504('0x1f')]);router[_0x7504('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x7504('0x20')]);router[_0x7504('0x21')]('/:id',auth[_0x7504('0x9')](),controller[_0x7504('0x22')]);router[_0x7504('0x23')](_0x7504('0xc'),auth[_0x7504('0x9')](),controller[_0x7504('0x24')]);router[_0x7504('0x23')](_0x7504('0xe'),auth['isAuthenticated'](),controller[_0x7504('0x25')]);router[_0x7504('0x23')](_0x7504('0x10'),auth[_0x7504('0x9')](),controller[_0x7504('0x26')]);router[_0x7504('0x23')](_0x7504('0x27'),auth[_0x7504('0x9')](),controller[_0x7504('0x28')]);module[_0x7504('0x29')]=router; \ No newline at end of file +var _0x190e=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/interactions','/addaccountapplications','addAccountApplications','/:id/send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x46fc1a,_0x2a398b){var _0x50b5d9=function(_0xad2f43){while(--_0xad2f43){_0x46fc1a['push'](_0x46fc1a['shift']());}};_0x50b5d9(++_0x2a398b);}(_0x190e,0x67));var _0xe190=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x190e[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require(_0xe190('0x0'));var util=require('util');var path=require(_0xe190('0x1'));var timeout=require(_0xe190('0x2'));var express=require(_0xe190('0x3'));var router=express[_0xe190('0x4')]();var auth=require(_0xe190('0x5'));var interaction=require(_0xe190('0x6'));var config=require(_0xe190('0x7'));var controller=require('./faxAccount.controller');router[_0xe190('0x8')]('/',auth[_0xe190('0x9')](),controller[_0xe190('0xa')]);router[_0xe190('0x8')](_0xe190('0xb'),auth[_0xe190('0x9')](),controller[_0xe190('0xc')]);router['get'](_0xe190('0xd'),auth[_0xe190('0x9')](),controller[_0xe190('0xe')]);router[_0xe190('0x8')](_0xe190('0xf'),auth[_0xe190('0x9')](),controller[_0xe190('0x10')]);router[_0xe190('0x8')](_0xe190('0x11'),auth['isAuthenticated'](),controller[_0xe190('0x12')]);router[_0xe190('0x8')]('/:id/interactions',auth[_0xe190('0x9')](),controller[_0xe190('0x13')]);router[_0xe190('0x8')](_0xe190('0x14'),auth[_0xe190('0x9')](),controller['getApplications']);router[_0xe190('0x8')](_0xe190('0x15'),auth[_0xe190('0x9')](),controller[_0xe190('0x16')]);router[_0xe190('0x8')](_0xe190('0x17'),auth['isAuthenticated'](),controller[_0xe190('0x18')]);router[_0xe190('0x19')]('/',auth[_0xe190('0x9')](),controller['create']);router[_0xe190('0x19')](_0xe190('0xf'),auth[_0xe190('0x9')](),controller[_0xe190('0x1a')]);router['post'](_0xe190('0x11'),auth[_0xe190('0x9')](),controller[_0xe190('0x1b')]);router['post'](_0xe190('0x1c'),auth[_0xe190('0x9')](),controller['addInteraction']);router[_0xe190('0x19')](_0xe190('0x14'),auth[_0xe190('0x9')](),controller['addApplications']);router['post'](_0xe190('0x1d'),auth['isAuthenticated'](),controller[_0xe190('0x1e')]);router[_0xe190('0x19')]('/updateaccountapplications',auth[_0xe190('0x9')](),controller['updateAccountApplications']);router[_0xe190('0x19')](_0xe190('0x1f'),auth[_0xe190('0x9')](),controller['send']);router[_0xe190('0x19')](_0xe190('0x17'),auth[_0xe190('0x9')](),controller[_0xe190('0x20')]);router['put'](_0xe190('0xd'),auth['isAuthenticated'](),controller[_0xe190('0x21')]);router[_0xe190('0x22')](_0xe190('0xd'),auth[_0xe190('0x9')](),controller[_0xe190('0x23')]);router[_0xe190('0x22')](_0xe190('0xf'),auth[_0xe190('0x9')](),controller[_0xe190('0x24')]);router[_0xe190('0x22')](_0xe190('0x11'),auth[_0xe190('0x9')](),controller[_0xe190('0x25')]);router[_0xe190('0x22')](_0xe190('0x17'),auth[_0xe190('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c108d59..f65c72a 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 _0x3c54=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x3c54,0x14d));var _0x43c5=function(_0x232e68,_0x2cb287){_0x232e68=_0x232e68-0x0;var _0x11697f=_0x3c54[_0x232e68];return _0x11697f;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'priority':{'type':Sequelize[_0x43c5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x43c5('0x3')],'allowNull':![],'defaultValue':_0x43c5('0x4')},'appdata':{'type':Sequelize[_0x43c5('0x5')]()},'description':{'type':Sequelize[_0x43c5('0x3')]},'interval':{'type':Sequelize[_0x43c5('0x3')],'defaultValue':_0x43c5('0x6')}}; \ No newline at end of file +var _0x08d3=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x52e9d8,_0x35484e){var _0x1d4f72=function(_0x5a7c3b){while(--_0x5a7c3b){_0x52e9d8['push'](_0x52e9d8['shift']());}};_0x1d4f72(++_0x35484e);}(_0x08d3,0x119));var _0x308d=function(_0x5088ad,_0x2aa849){_0x5088ad=_0x5088ad-0x0;var _0x16ec9e=_0x08d3[_0x5088ad];return _0x16ec9e;};'use strict';var Sequelize=require(_0x308d('0x0'));module[_0x308d('0x1')]={'priority':{'type':Sequelize[_0x308d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x308d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x308d('0x3')]},'interval':{'type':Sequelize[_0x308d('0x3')],'defaultValue':_0x308d('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index bab5f2b..49c737a 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 _0x326f=['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','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','filter','options','FaxApplication','include','rows','catch','show','params','includeAll','create','body','update','find','html-pdf'];(function(_0xf50cd6,_0x59bb73){var _0x3bebdb=function(_0x169455){while(--_0x169455){_0xf50cd6['push'](_0xf50cd6['shift']());}};_0x3bebdb(++_0x59bb73);}(_0x326f,0xd1));var _0xf326=function(_0x28e564,_0x2cf9d2){_0x28e564=_0x28e564-0x0;var _0x8da328=_0x326f[_0x28e564];return _0x8da328;};'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'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=_['map'](db['FaxApplication'][_0xf326('0x28')],function(_0x1ae23a){return{'name':_0x1ae23a[_0xf326('0x29')],'type':_0x1ae23a['type'][_0xf326('0x2a')]};});_0x212d5d[_0xf326('0x2b')]=_['map'](_0x1617d2,_0xf326('0x25'));_0x212d5d[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5217d4[_0xf326('0x2c')]);_0x212d5d[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x212d5d[_0xf326('0x2b')],_0x212d5d[_0xf326('0x2c')]);_0xa3c0b[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x212d5d['model'],qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x31')]));_0xa3c0b['attributes']=_0xa3c0b[_0xf326('0x30')][_0xf326('0x32')]?_0xa3c0b[_0xf326('0x30')]:_0x212d5d['model'];if(!_0x5217d4['query'][_0xf326('0x33')](_0xf326('0x34'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x1b')]);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4['query'][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x35')]=qs['sort'](_0x5217d4[_0xf326('0x2c')]['sort']);_0xa3c0b[_0xf326('0x36')]=qs['filters'](_['pick'](_0x5217d4[_0xf326('0x2c')],_0x212d5d['filters']),_0x1617d2);if(_0x5217d4[_0xf326('0x2c')]['filter']){_0xa3c0b[_0xf326('0x36')]=_[_0xf326('0x37')](_0xa3c0b[_0xf326('0x36')],{'$or':_['map'](_0x1617d2,function(_0x3dcc7e){if(_0x3dcc7e[_0xf326('0x38')]!=='VIRTUAL'){var _0x13932b={};_0x13932b[_0x3dcc7e[_0xf326('0x25')]]={'$like':'%'+_0x5217d4[_0xf326('0x2c')][_0xf326('0x39')]+'%'};return _0x13932b;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x3a')]);var _0xb1ef35={'where':_0xa3c0b[_0xf326('0x36')]};return db[_0xf326('0x3b')][_0xf326('0x19')](_0xb1ef35)['then'](function(_0x3e830d){_0x581531[_0xf326('0x19')]=_0x3e830d;if(_0x5217d4['query']['includeAll']){_0xa3c0b[_0xf326('0x3c')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3d')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3e')](handleError(_0x201d28,null));};exports[_0xf326('0x3f')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x40')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x2b')]=_[_0xf326('0x2d')](db[_0xf326('0x3b')][_0xf326('0x28')]);_0x347e7b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x49112d[_0xf326('0x2c')]);_0x347e7b[_0xf326('0x2e')]=_['intersection'](_0x347e7b[_0xf326('0x2b')],_0x347e7b[_0xf326('0x2c')]);_0x45d344[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x347e7b[_0xf326('0x2b')],qs[_0xf326('0x31')](_0x49112d['query'][_0xf326('0x31')]));_0x45d344[_0xf326('0x30')]=_0x45d344['attributes'][_0xf326('0x32')]?_0x45d344[_0xf326('0x30')]:_0x347e7b[_0xf326('0x2b')];if(_0x49112d[_0xf326('0x2c')][_0xf326('0x41')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x3a')]);return db[_0xf326('0x3b')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3e')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x3b')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3e')](handleError(_0x301e65,null));};exports[_0xf326('0x44')]=function(_0x3b90dc,_0x3df9a8){if(_0x3b90dc[_0xf326('0x43')]['id']){delete _0x3b90dc[_0xf326('0x43')]['id'];}return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x3b90dc[_0xf326('0x40')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))['then'](saveUpdates(_0x3b90dc[_0xf326('0x43')],null))[_0xf326('0x22')](respondWithResult(_0x3df9a8,null))[_0xf326('0x3e')](handleError(_0x3df9a8,null));};exports[_0xf326('0x21')]=function(_0x5f1829,_0x10f437){return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x5f1829[_0xf326('0x40')]['id']}})['then'](handleEntityNotFound(_0x10f437,null))[_0xf326('0x22')](removeEntity(_0x10f437,null))[_0xf326('0x3e')](handleError(_0x10f437,null));}; \ No newline at end of file +var _0x1261=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','merge','options','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','update','find','destroy','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','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','error','stack','name','index','FaxApplication','rawAttributes','fieldName','key','map','query','intersection'];(function(_0x1b0900,_0x17d4cc){var _0x25a9af=function(_0x5506b4){while(--_0x5506b4){_0x1b0900['push'](_0x1b0900['shift']());}};_0x25a9af(++_0x17d4cc);}(_0x1261,0x144));var _0x1126=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x1261[_0x2be240];return _0x123543;};'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'];function respondWithStatusCode(_0x1b364a,_0xd26a32){_0xd26a32=_0xd26a32||0xcc;return function(_0x273896){if(_0x273896){return _0x1b364a[_0x1126('0x17')](_0xd26a32);}return _0x1b364a[_0x1126('0x18')](_0xd26a32)[_0x1126('0x19')]();};}function respondWithResult(_0x2048ad,_0x43850b){_0x43850b=_0x43850b||0xc8;return function(_0x53a8f0){if(_0x53a8f0){return _0x2048ad['status'](_0x43850b)[_0x1126('0x1a')](_0x53a8f0);}};}function respondWithFilteredResult(_0x154e20,_0x279455){return function(_0x4be0c6){if(_0x4be0c6){var _0x45149c=_0x4be0c6[_0x1126('0x1b')],_0x4794a7=_0x279455['offset'],_0x35fe9f=_0x279455[_0x1126('0x1c')]+_0x279455[_0x1126('0x1d')],_0x42f379;if(_0x35fe9f>=_0x45149c){_0x35fe9f=_0x45149c;_0x42f379=0xc8;}else{_0x42f379=0xce;}_0x154e20['status'](_0x42f379);return _0x154e20['set'](_0x1126('0x1e'),_0x4794a7+'-'+_0x35fe9f+'/'+_0x45149c)[_0x1126('0x1a')](_0x4be0c6);}return null;};}function patchUpdates(_0x58d11a){return function(_0x548359){try{jsonpatch[_0x1126('0x1f')](_0x548359,_0x58d11a,!![]);}catch(_0x58b109){return BPromise[_0x1126('0x20')](_0x58b109);}return _0x548359[_0x1126('0x21')]();};}function saveUpdates(_0x2f70ac,_0x54400a){return function(_0x2a08ba){if(_0x2a08ba){return _0x2a08ba['update'](_0x2f70ac)['then'](function(_0x30f6b3){return _0x30f6b3;});}return null;};}function removeEntity(_0x3a9bed,_0x25b24b){return function(_0x36d254){if(_0x36d254){return _0x36d254['destroy']()[_0x1126('0x22')](function(){_0x3a9bed[_0x1126('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(!_0x529dd9){_0x2175fa['sendStatus'](0x194);}return _0x529dd9;};}function handleError(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0x1f4;return function(_0x329914){logger[_0x1126('0x23')](_0x329914[_0x1126('0x24')]);if(_0x329914[_0x1126('0x25')]){delete _0x329914[_0x1126('0x25')];}_0x2199d9[_0x1126('0x18')](_0x15bcc3)['send'](_0x329914);};}exports[_0x1126('0x26')]=function(_0x375e59,_0xa293f4){var _0x5ddf63={},_0x541bc9={},_0xeb7d89={'count':0x0,'rows':[]};var _0x39bf0e=_['map'](db[_0x1126('0x27')][_0x1126('0x28')],function(_0x4a334a){return{'name':_0x4a334a[_0x1126('0x29')],'type':_0x4a334a['type'][_0x1126('0x2a')]};});_0x541bc9['model']=_[_0x1126('0x2b')](_0x39bf0e,'name');_0x541bc9[_0x1126('0x2c')]=_['keys'](_0x375e59['query']);_0x541bc9['filters']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],_0x541bc9[_0x1126('0x2c')]);_0x5ddf63['attributes']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],qs['fields'](_0x375e59[_0x1126('0x2c')][_0x1126('0x2f')]));_0x5ddf63[_0x1126('0x30')]=_0x5ddf63[_0x1126('0x30')]['length']?_0x5ddf63['attributes']:_0x541bc9[_0x1126('0x2e')];if(!_0x375e59[_0x1126('0x2c')][_0x1126('0x31')](_0x1126('0x32'))){_0x5ddf63['limit']=qs[_0x1126('0x1d')](_0x375e59[_0x1126('0x2c')][_0x1126('0x1d')]);_0x5ddf63[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x375e59['query'][_0x1126('0x1c')]);}_0x5ddf63[_0x1126('0x33')]=qs[_0x1126('0x34')](_0x375e59[_0x1126('0x2c')]['sort']);_0x5ddf63['where']=qs[_0x1126('0x35')](_[_0x1126('0x36')](_0x375e59['query'],_0x541bc9[_0x1126('0x35')]),_0x39bf0e);if(_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]){_0x5ddf63['where']=_['merge'](_0x5ddf63[_0x1126('0x38')],{'$or':_[_0x1126('0x2b')](_0x39bf0e,function(_0x3aa08f){if(_0x3aa08f[_0x1126('0x39')]!=='VIRTUAL'){var _0x428d3d={};_0x428d3d[_0x3aa08f['name']]={'$like':'%'+_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]+'%'};return _0x428d3d;}})});}_0x5ddf63=_[_0x1126('0x3a')]({},_0x5ddf63,_0x375e59[_0x1126('0x3b')]);var _0x57e5d2={'where':_0x5ddf63['where']};return db[_0x1126('0x27')][_0x1126('0x1b')](_0x57e5d2)[_0x1126('0x22')](function(_0x397e3b){_0xeb7d89[_0x1126('0x1b')]=_0x397e3b;if(_0x375e59[_0x1126('0x2c')][_0x1126('0x3c')]){_0x5ddf63['include']=[{'all':!![]}];}return db[_0x1126('0x27')][_0x1126('0x3d')](_0x5ddf63);})[_0x1126('0x22')](function(_0xf3a0bd){_0xeb7d89[_0x1126('0x3e')]=_0xf3a0bd;return _0xeb7d89;})['then'](respondWithFilteredResult(_0xa293f4,_0x5ddf63))['catch'](handleError(_0xa293f4,null));};exports[_0x1126('0x3f')]=function(_0x219bcc,_0xcee9de){var _0x21c38e={'raw':!![],'where':{'id':_0x219bcc[_0x1126('0x40')]['id']}},_0x18b496={};_0x18b496['model']=_['keys'](db['FaxApplication'][_0x1126('0x28')]);_0x18b496['query']=_[_0x1126('0x41')](_0x219bcc[_0x1126('0x2c')]);_0x18b496[_0x1126('0x35')]=_[_0x1126('0x2d')](_0x18b496['model'],_0x18b496['query']);_0x21c38e[_0x1126('0x30')]=_[_0x1126('0x2d')](_0x18b496[_0x1126('0x2e')],qs['fields'](_0x219bcc[_0x1126('0x2c')]['fields']));_0x21c38e[_0x1126('0x30')]=_0x21c38e['attributes'][_0x1126('0x42')]?_0x21c38e[_0x1126('0x30')]:_0x18b496[_0x1126('0x2e')];if(_0x219bcc['query'][_0x1126('0x3c')]){_0x21c38e[_0x1126('0x43')]=[{'all':!![]}];}_0x21c38e=_[_0x1126('0x3a')]({},_0x21c38e,_0x219bcc['options']);return db['FaxApplication']['find'](_0x21c38e)[_0x1126('0x22')](handleEntityNotFound(_0xcee9de,null))['then'](respondWithResult(_0xcee9de,null))[_0x1126('0x44')](handleError(_0xcee9de,null));};exports['create']=function(_0x2f45b9,_0x323499){return db[_0x1126('0x27')][_0x1126('0x45')](_0x2f45b9[_0x1126('0x46')],{})['then'](respondWithResult(_0x323499,0xc9))[_0x1126('0x44')](handleError(_0x323499,null));};exports[_0x1126('0x47')]=function(_0x5111d3,_0x1a15f8){if(_0x5111d3[_0x1126('0x46')]['id']){delete _0x5111d3['body']['id'];}return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x5111d3['params']['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x1a15f8,null))[_0x1126('0x22')](saveUpdates(_0x5111d3[_0x1126('0x46')],null))['then'](respondWithResult(_0x1a15f8,null))[_0x1126('0x44')](handleError(_0x1a15f8,null));};exports[_0x1126('0x49')]=function(_0x411c89,_0x5878bb){return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x411c89[_0x1126('0x40')]['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x5878bb,null))['then'](removeEntity(_0x5878bb,null))[_0x1126('0x44')](handleError(_0x5878bb,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d30ac8a..04de4aa 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 _0xdb4d=['exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0xdb4d,0x164));var _0xddb4=function(_0x2c5d6f,_0x490f3e){_0x2c5d6f=_0x2c5d6f-0x0;var _0x54d956=_0xdb4d[_0x2c5d6f];return _0x54d956;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var logger=require(_0xddb4('0x2'))(_0xddb4('0x3'));var moment=require('moment');var BPromise=require(_0xddb4('0x4'));var rp=require(_0xddb4('0x5'));var fs=require('fs');var path=require(_0xddb4('0x6'));var rimraf=require(_0xddb4('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xddb4('0x8')]=function(_0x2e84c3,_0x50df9c){return _0x2e84c3[_0xddb4('0x9')]('FaxApplication',attributes,{'tableName':_0xddb4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddb4('0xb'),'collate':_0xddb4('0xc')});}; \ No newline at end of file +var _0x061e=['./faxApplication.attributes','define','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x589353,_0x1baf55){var _0x3f209f=function(_0x3867f1){while(--_0x3867f1){_0x589353['push'](_0x589353['shift']());}};_0x3f209f(++_0x1baf55);}(_0x061e,0x87));var _0xe061=function(_0x502e6a,_0x190001){_0x502e6a=_0x502e6a-0x0;var _0x4f7387=_0x061e[_0x502e6a];return _0x4f7387;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe061('0x0'))(_0xe061('0x1'));var moment=require(_0xe061('0x2'));var BPromise=require(_0xe061('0x3'));var rp=require(_0xe061('0x4'));var fs=require('fs');var path=require(_0xe061('0x5'));var rimraf=require(_0xe061('0x6'));var config=require(_0xe061('0x7'));var attributes=require(_0xe061('0x8'));module['exports']=function(_0x415af5,_0x4205db){return _0x415af5[_0xe061('0x9')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe061('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 10eaf9b..0132f51 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 _0x1546=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateFaxApplication','update','body','options','raw','where','limit','util','moment','bluebird'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x1546,0xba));var _0x6154=function(_0x11dcdd,_0xd66b7f){_0x11dcdd=_0x11dcdd-0x0;var _0x5c2f35=_0x1546[_0x11dcdd];return _0x5c2f35;};'use strict';var _=require('lodash');var util=require(_0x6154('0x0'));var moment=require(_0x6154('0x1'));var BPromise=require(_0x6154('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6154('0x3'));var db=require(_0x6154('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6154('0x5'));var config=require(_0x6154('0x6'));var jayson=require(_0x6154('0x7'));var client=jayson[_0x6154('0x8')][_0x6154('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd54a5f,_0x9567f8,_0x5959d5){return new BPromise(function(_0x3a2a10,_0x3a9d14){return client[_0x6154('0xa')](_0xd54a5f,_0x5959d5)[_0x6154('0xb')](function(_0x18560b){logger[_0x6154('0xc')](_0x6154('0xd'),_0x9567f8,_0x6154('0xe'));logger[_0x6154('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x9567f8,_0x6154('0xe'),JSON[_0x6154('0x10')](_0x18560b));if(_0x18560b[_0x6154('0x11')]){if(_0x18560b[_0x6154('0x11')]['code']===0x1f4){logger['error'](_0x6154('0xd'),_0x9567f8,_0x18560b[_0x6154('0x11')][_0x6154('0x12')]);return _0x3a9d14(_0x18560b[_0x6154('0x11')][_0x6154('0x12')]);}logger[_0x6154('0x11')](_0x6154('0xd'),_0x9567f8,_0x18560b['error'][_0x6154('0x12')]);return _0x3a2a10(_0x18560b[_0x6154('0x11')]['message']);}else{logger[_0x6154('0xc')](_0x6154('0xd'),_0x9567f8,'request\x20sent');_0x3a2a10(_0x18560b['result']['message']);}})[_0x6154('0x13')](function(_0x5e9438){logger[_0x6154('0x11')](_0x6154('0xd'),_0x9567f8,_0x5e9438);_0x3a9d14(_0x5e9438);});});}exports[_0x6154('0x14')]=function(_0x419e2a){var _0x151cbc=this;return new Promise(function(_0x476889,_0x33be7c){return db['FaxApplication'][_0x6154('0x15')](_0x419e2a[_0x6154('0x16')],{'raw':_0x419e2a['options']?_0x419e2a[_0x6154('0x17')][_0x6154('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419e2a[_0x6154('0x17')]?_0x419e2a[_0x6154('0x17')][_0x6154('0x19')]||null:null,'attributes':_0x419e2a['options']?_0x419e2a['options']['attributes']||null:null,'limit':_0x419e2a[_0x6154('0x17')]?_0x419e2a[_0x6154('0x17')][_0x6154('0x1a')]||null:null})[_0x6154('0xb')](function(_0x526262){logger[_0x6154('0xc')](_0x6154('0x14'),_0x419e2a);logger['debug'](_0x6154('0x14'),_0x419e2a,JSON[_0x6154('0x10')](_0x526262));_0x476889(_0x526262);})[_0x6154('0x13')](function(_0x362215){logger[_0x6154('0x11')](_0x6154('0x14'),_0x362215[_0x6154('0x12')],_0x419e2a);_0x33be7c(_0x151cbc[_0x6154('0x11')](0x1f4,_0x362215[_0x6154('0x12')]));});});}; \ No newline at end of file +var _0xaa18=['limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where'];(function(_0x5dcc46,_0x4a3d0d){var _0x59d1da=function(_0x54d760){while(--_0x54d760){_0x5dcc46['push'](_0x5dcc46['shift']());}};_0x59d1da(++_0x4a3d0d);}(_0xaa18,0x9c));var _0x8aa1=function(_0x1813f7,_0xc667c7){_0x1813f7=_0x1813f7-0x0;var _0x55110e=_0xaa18[_0x1813f7];return _0x55110e;};'use strict';var _=require(_0x8aa1('0x0'));var util=require(_0x8aa1('0x1'));var moment=require(_0x8aa1('0x2'));var BPromise=require(_0x8aa1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8aa1('0x4'))['db'];var utils=require(_0x8aa1('0x5'));var logger=require(_0x8aa1('0x6'))(_0x8aa1('0x7'));var config=require(_0x8aa1('0x8'));var jayson=require(_0x8aa1('0x9'));var client=jayson[_0x8aa1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9bc68,_0x11356a,_0x4f21e9){return new BPromise(function(_0x592dea,_0x9b79a2){return client[_0x8aa1('0xb')](_0xc9bc68,_0x4f21e9)[_0x8aa1('0xc')](function(_0x27a1f3){logger[_0x8aa1('0xd')](_0x8aa1('0xe'),_0x11356a,_0x8aa1('0xf'));logger[_0x8aa1('0x10')](_0x8aa1('0x11'),_0x11356a,_0x8aa1('0xf'),JSON[_0x8aa1('0x12')](_0x27a1f3));if(_0x27a1f3[_0x8aa1('0x13')]){if(_0x27a1f3[_0x8aa1('0x13')][_0x8aa1('0x14')]===0x1f4){logger[_0x8aa1('0x13')](_0x8aa1('0xe'),_0x11356a,_0x27a1f3[_0x8aa1('0x13')]['message']);return _0x9b79a2(_0x27a1f3['error']['message']);}logger[_0x8aa1('0x13')]('FaxApplication,\x20%s,\x20%s',_0x11356a,_0x27a1f3[_0x8aa1('0x13')][_0x8aa1('0x15')]);return _0x592dea(_0x27a1f3[_0x8aa1('0x13')][_0x8aa1('0x15')]);}else{logger[_0x8aa1('0xd')](_0x8aa1('0xe'),_0x11356a,_0x8aa1('0xf'));_0x592dea(_0x27a1f3[_0x8aa1('0x16')]['message']);}})[_0x8aa1('0x17')](function(_0x4a059b){logger[_0x8aa1('0x13')]('FaxApplication,\x20%s,\x20%s',_0x11356a,_0x4a059b);_0x9b79a2(_0x4a059b);});});}exports[_0x8aa1('0x18')]=function(_0xfd3d54){var _0x182f2c=this;return new Promise(function(_0x373899,_0x19e803){return db[_0x8aa1('0x19')][_0x8aa1('0x1a')](_0xfd3d54[_0x8aa1('0x1b')],{'raw':_0xfd3d54[_0x8aa1('0x1c')]?_0xfd3d54[_0x8aa1('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfd3d54[_0x8aa1('0x1c')]?_0xfd3d54[_0x8aa1('0x1c')][_0x8aa1('0x1d')]||null:null,'attributes':_0xfd3d54[_0x8aa1('0x1c')]?_0xfd3d54[_0x8aa1('0x1c')]['attributes']||null:null,'limit':_0xfd3d54[_0x8aa1('0x1c')]?_0xfd3d54[_0x8aa1('0x1c')][_0x8aa1('0x1e')]||null:null})[_0x8aa1('0xc')](function(_0xa6d31e){logger[_0x8aa1('0xd')](_0x8aa1('0x18'),_0xfd3d54);logger[_0x8aa1('0x10')](_0x8aa1('0x18'),_0xfd3d54,JSON['stringify'](_0xa6d31e));_0x373899(_0xa6d31e);})[_0x8aa1('0x17')](function(_0x7386ac){logger[_0x8aa1('0x13')](_0x8aa1('0x18'),_0x7386ac[_0x8aa1('0x15')],_0xfd3d54);_0x19e803(_0x182f2c['error'](0x1f4,_0x7386ac[_0x8aa1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a3c64fa..9895f14 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 _0xeda8=['isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x2f0ceb,_0x5bb410){var _0x3a6347=function(_0x59e032){while(--_0x59e032){_0x2f0ceb['push'](_0x2f0ceb['shift']());}};_0x3a6347(++_0x5bb410);}(_0xeda8,0x104));var _0x8eda=function(_0x3856a6,_0x2c760c){_0x3856a6=_0x3856a6-0x0;var _0x1299ca=_0xeda8[_0x3856a6];return _0x1299ca;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var auth=require(_0x8eda('0x5'));var interaction=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var controller=require(_0x8eda('0x8'));router[_0x8eda('0x9')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xb')]);router[_0x8eda('0x9')](_0x8eda('0xc'),auth['isAuthenticated'](),controller[_0x8eda('0xd')]);router[_0x8eda('0xe')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8eda('0x10')](_0x8eda('0xc'),auth[_0x8eda('0xa')](),controller['destroy']);module[_0x8eda('0x11')]=router; \ No newline at end of file +var _0xafc4=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put','update','exports'];(function(_0x2355e8,_0x2c7c45){var _0x49135a=function(_0x4fce50){while(--_0x4fce50){_0x2355e8['push'](_0x2355e8['shift']());}};_0x49135a(++_0x2c7c45);}(_0xafc4,0x69));var _0x4afc=function(_0x3c7857,_0x3688cc){_0x3c7857=_0x3c7857-0x0;var _0x36b4b2=_0xafc4[_0x3c7857];return _0x36b4b2;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var auth=require(_0x4afc('0x4'));var interaction=require(_0x4afc('0x5'));var config=require('../../config/environment');var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4afc('0x6')](),controller[_0x4afc('0x7')]);router[_0x4afc('0x8')](_0x4afc('0x9'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xa')]);router['post']('/',auth[_0x4afc('0x6')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0x9'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xd')]);router['delete']('/:id',auth[_0x4afc('0x6')](),controller['destroy']);module[_0x4afc('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 8e8fc80..b003483 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 _0xa11b=['out','ENUM','exports','BOOLEAN','DATE','STRING'];(function(_0x16a641,_0x3349b6){var _0x21f9cd=function(_0x1a732f){while(--_0x1a732f){_0x16a641['push'](_0x16a641['shift']());}};_0x21f9cd(++_0x3349b6);}(_0xa11b,0x92));var _0xba11=function(_0x18f7fa,_0xe64c9){_0x18f7fa=_0x18f7fa-0x0;var _0x14c598=_0xa11b[_0x18f7fa];return _0x14c598;};'use strict';var Sequelize=require('sequelize');module[_0xba11('0x0')]={'closed':{'type':Sequelize[_0xba11('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xba11('0x2')]},'disposition':{'type':Sequelize[_0xba11('0x3')]},'note':{'type':Sequelize[_0xba11('0x3')]},'read1stAt':{'type':Sequelize[_0xba11('0x2')]},'fax':{'type':Sequelize[_0xba11('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xba11('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xba11('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xba11('0x5')]('in',_0xba11('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb125=['out','ENUM','exports','BOOLEAN','STRING','DATE'];(function(_0x581aae,_0x2b18ee){var _0x539df2=function(_0xbbcb64){while(--_0xbbcb64){_0x581aae['push'](_0x581aae['shift']());}};_0x539df2(++_0x2b18ee);}(_0xb125,0x110));var _0x5b12=function(_0x3b4fb5,_0x3237c8){_0x3b4fb5=_0x3b4fb5-0x0;var _0x184b4a=_0xb125[_0x3b4fb5];return _0x184b4a;};'use strict';var Sequelize=require('sequelize');module[_0x5b12('0x0')]={'closed':{'type':Sequelize[_0x5b12('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5b12('0x2')]},'read1stAt':{'type':Sequelize[_0x5b12('0x3')]},'fax':{'type':Sequelize[_0x5b12('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5b12('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5b12('0x5')]('in',_0x5b12('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 b49f460..7a2d31a 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 _0x29b1=['order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','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','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','rows','params','model','options','create','destroy','describe','addMessage','ids','omit','findOne','FaxMessage','nolimit','pick','format','includeAll','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','Users','map','fullname','Tags','TagIds','forEach','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x35f2c7,_0x1f8cf2){var _0x1a5369=function(_0x4fee24){while(--_0x4fee24){_0x35f2c7['push'](_0x35f2c7['shift']());}};_0x1a5369(++_0x1f8cf2);}(_0x29b1,0x16d));var _0x129b=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x29b1[_0x341e0f];return _0x59555a;};'use strict';var pdf=require(_0x129b('0x0'));var emlformat=require(_0x129b('0x1'));var rimraf=require(_0x129b('0x2'));var zipdir=require(_0x129b('0x3'));var jsonpatch=require(_0x129b('0x4'));var rp=require('request-promise');var moment=require(_0x129b('0x5'));var BPromise=require(_0x129b('0x6'));var Mustache=require(_0x129b('0x7'));var util=require(_0x129b('0x8'));var path=require(_0x129b('0x9'));var sox=require(_0x129b('0xa'));var csv=require(_0x129b('0xb'));var ejs=require(_0x129b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x129b('0xd'));var crypto=require('crypto');var jsforce=require(_0x129b('0xe'));var deskjs=require(_0x129b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x129b('0x10'));var Papa=require(_0x129b('0x11'));var Redis=require('ioredis');var authService=require(_0x129b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x129b('0x13'));var hardwareService=require(_0x129b('0x14'));var logger=require(_0x129b('0x15'))('api');var utils=require(_0x129b('0x16'));var config=require(_0x129b('0x17'));var db=require(_0x129b('0x18'))['db'];config[_0x129b('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x129b('0x1a'))(new Redis(config['redis']));require(_0x129b('0x1b'))[_0x129b('0x1c')](socket);function respondWithStatusCode(_0x17255b,_0x52137c){_0x52137c=_0x52137c||0xcc;return function(_0x41b681){if(_0x41b681){return _0x17255b['sendStatus'](_0x52137c);}return _0x17255b[_0x129b('0x1d')](_0x52137c)[_0x129b('0x1e')]();};}function respondWithResult(_0x17fff2,_0x50d62b){_0x50d62b=_0x50d62b||0xc8;return function(_0x46a6a4){if(_0x46a6a4){return _0x17fff2[_0x129b('0x1d')](_0x50d62b)[_0x129b('0x1f')](_0x46a6a4);}};}function respondWithFilteredResult(_0x2ba58c,_0x30785a){return function(_0x123acc){if(_0x123acc){var _0x135b42=_0x123acc[_0x129b('0x20')],_0x169d4c=_0x30785a[_0x129b('0x21')],_0x299bb5=_0x30785a['offset']+_0x30785a[_0x129b('0x22')],_0xecba14;if(_0x299bb5>=_0x135b42){_0x299bb5=_0x135b42;_0xecba14=0xc8;}else{_0xecba14=0xce;}_0x2ba58c[_0x129b('0x1d')](_0xecba14);return _0x2ba58c[_0x129b('0x23')](_0x129b('0x24'),_0x169d4c+'-'+_0x299bb5+'/'+_0x135b42)[_0x129b('0x1f')](_0x123acc);}return null;};}function patchUpdates(_0x252a69){return function(_0x35bfad){try{jsonpatch[_0x129b('0x25')](_0x35bfad,_0x252a69,!![]);}catch(_0x362c7e){return BPromise[_0x129b('0x26')](_0x362c7e);}return _0x35bfad[_0x129b('0x27')]();};}function saveUpdates(_0x19b23b,_0x491624){return function(_0x29c2e1){if(_0x29c2e1){return _0x29c2e1[_0x129b('0x28')](_0x19b23b)[_0x129b('0x29')](function(_0x1206c9){return _0x1206c9;});}return null;};}function removeEntity(_0x4d4b76,_0x4fedcd){return function(_0x31bccc){if(_0x31bccc){return _0x31bccc['destroy']()[_0x129b('0x29')](function(){_0x4d4b76[_0x129b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5922fe,_0x38788f){return function(_0x1c6d9f){if(!_0x1c6d9f){_0x5922fe[_0x129b('0x2a')](0x194);}return _0x1c6d9f;};}function handleError(_0x10288e,_0x45e6be){_0x45e6be=_0x45e6be||0x1f4;return function(_0x181cde){logger[_0x129b('0x2b')](_0x181cde[_0x129b('0x2c')]);if(_0x181cde['name']){delete _0x181cde[_0x129b('0x2d')];}_0x10288e[_0x129b('0x1d')](_0x45e6be)['send'](_0x181cde);};}function getInteractionUsers(_0x3a852a,_0x519053){return new BPromise(function(_0x4179e1,_0x4d1017){try{if(_0x519053[_0x3a852a['id']]){_0x3a852a[_0x129b('0x2e')]=_[_0x129b('0x2f')](_0x519053[_0x3a852a['id']],function(_0x24eb29){return{'id':_0x24eb29['id'],'fullname':_0x24eb29[_0x129b('0x30')]};});}}catch(_0x917382){_0x4d1017(_0x917382);}_0x4179e1(_0x3a852a);});}function getInteractionTags(_0x1aed6e,_0x296461){return new BPromise(function(_0x2906ef,_0x371e89){try{if(_0x1aed6e['TagIds']){_0x1aed6e[_0x129b('0x31')]=[];_0x1aed6e[_0x129b('0x32')]['split'](',')[_0x129b('0x33')](function(_0x1b0ab7){_0x1aed6e[_0x129b('0x31')]['push'](_0x296461[_0x1b0ab7]);});}delete _0x1aed6e[_0x129b('0x32')];}catch(_0xf2d43){_0x371e89(_0xf2d43);}_0x2906ef(_0x1aed6e);});}function updateFaxInteraction(_0x5c813a,_0x5a1229,_0x2e3b88){return new BPromise(function(_0x4bec4a,_0x333b32){return getInteractionUsers(_0x5c813a,_0x2e3b88)['then'](function(_0x15b01c){return getInteractionTags(_0x15b01c,_0x5a1229);})[_0x129b('0x29')](function(_0x5ba68d){_0x4bec4a(_0x5ba68d);})[_0x129b('0x34')](function(_0x141d8f){_0x333b32(_0x141d8f);});});}exports[_0x129b('0x35')]=function(_0x5bd0f6,_0x1c0e80){var _0x1d0b95={},_0x235d47={},_0x30ff4a={'count':0x0,'rows':[]};var _0x5a6c3e=_['map'](db[_0x129b('0x36')][_0x129b('0x37')],function(_0x52e037){return{'name':_0x52e037[_0x129b('0x38')],'type':_0x52e037[_0x129b('0x39')][_0x129b('0x3a')]};});_0x235d47['model']=_['map'](_0x5a6c3e,_0x129b('0x2d'));_0x235d47[_0x129b('0x3b')]=_[_0x129b('0x3c')](_0x5bd0f6['query']);_0x235d47[_0x129b('0x3d')]=_[_0x129b('0x3e')](_0x235d47['model'],_0x235d47[_0x129b('0x3b')]);_0x1d0b95[_0x129b('0x3f')]=_['intersection'](_0x235d47['model'],qs[_0x129b('0x40')](_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x40')]));_0x1d0b95[_0x129b('0x3f')]=_0x1d0b95[_0x129b('0x3f')][_0x129b('0x41')]?_0x1d0b95[_0x129b('0x3f')]:_0x235d47['model'];if(!_0x5bd0f6['query'][_0x129b('0x42')]('nolimit')){_0x1d0b95[_0x129b('0x22')]=qs[_0x129b('0x22')](_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x22')]);_0x1d0b95[_0x129b('0x21')]=qs[_0x129b('0x21')](_0x5bd0f6['query']['offset']);}_0x1d0b95[_0x129b('0x43')]=qs['sort'](_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x44')]);_0x1d0b95[_0x129b('0x45')]=qs[_0x129b('0x3d')](_['pick'](_0x5bd0f6['query'],_0x235d47['filters']),_0x5a6c3e);var _0x40f8ab=[];var _0x4bbd59=squel[_0x129b('0x46')]()['field']('id')[_0x129b('0x47')]('name')[_0x129b('0x47')](_0x129b('0x48'))[_0x129b('0x49')](_0x129b('0x4a'));var _0x3b901a=squel[_0x129b('0x46')]()['field']('u.id')['field'](_0x129b('0x4b'))[_0x129b('0x47')](_0x129b('0x4c'))['from']('user_has_fax_interactions','ui')[_0x129b('0x4d')](_0x129b('0x4e'),'u',_0x129b('0x4f'));var _0x403d6b=squel[_0x129b('0x46')]()[_0x129b('0x49')]('fax_interactions','i')[_0x129b('0x4d')](_0x129b('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x129b('0x4d')](_0x129b('0x4e'),'o',_0x129b('0x51'))[_0x129b('0x4d')](_0x129b('0x52'),'a',_0x129b('0x53'))[_0x129b('0x4d')](_0x129b('0x54'),'me',_0x129b('0x55'))[_0x129b('0x4d')](_0x129b('0x56'),'it',_0x129b('0x57'))[_0x129b('0x4d')](_0x129b('0x4a'),'t',_0x129b('0x58'));var _0x2c2f02=squel[_0x129b('0x59')]();var _0x38bd1a=[];var _0x15d42e=squel[_0x129b('0x59')]();var _0x4872fc;if(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x5a')]){_0x4872fc=as[_0x129b('0x5b')](_0x5bd0f6[_0x129b('0x3b')]['search']);var _0x59919a=_0x4872fc[_0x129b('0x5c')];for(var _0x1f27ff=0x0;_0x1f27ff<_0x4872fc[_0x129b('0x5d')]['length'];_0x1f27ff++){var _0x484c50=_0x4872fc[_0x129b('0x5d')][_0x1f27ff];var _0x2c8b9c='i';var _0x59e7ed=_[_0x129b('0x5e')](_0x5a6c3e,[_0x129b('0x2d'),_0x484c50[_0x129b('0x47')]]);if(!_0x59e7ed){switch(_0x484c50['field']){case _0x129b('0x5f'):if(_0x484c50[_0x129b('0x60')]==0x1){_0x403d6b[_0x129b('0x61')]('`'+_0x484c50[_0x129b('0x47')]+'`\x20=\x200');}else{_0x403d6b['having']('`'+_0x484c50[_0x129b('0x47')]+_0x129b('0x62'));}break;case _0x129b('0x63'):if(_0x484c50[_0x129b('0x64')]===_0x129b('0x65')){if(_0x484c50['value'][_0x129b('0x66')]('\x20')[_0x129b('0x41')]>0x1){_0x2c2f02[_0x59919a](_0x129b('0x67'),qs[_0x129b('0x68')](_0x484c50[_0x129b('0x60')]),null);}else{var _0x1fb041='%'+_0x484c50[_0x129b('0x60')]+'%';_0x2c2f02[_0x59919a](_0x129b('0x69'),_0x1fb041,_0x1fb041,_0x1fb041);}}else{_0x59e7ed=_[_0x129b('0x5e')](_0x5a6c3e,[_0x129b('0x2d'),_0x129b('0x6a')]);_0x484c50[_0x129b('0x47')]=_0x129b('0x6a');_0x3a7df3=as[_0x129b('0x6b')](_0x2c8b9c,_0x59e7ed[_0x129b('0x39')],_0x484c50);_0x2c2f02[_0x59919a](_0x3a7df3[_0x129b('0x6c')],_0x3a7df3[_0x129b('0x60')]['start'],_0x3a7df3[_0x129b('0x60')][_0x129b('0x1e')]);}break;case _0x129b('0x6d'):var _0x1ef11a=_0x484c50[_0x129b('0x60')][_0x129b('0x66')](',')[_0x129b('0x2f')](function(_0x10f4a5){return Number(_0x10f4a5);});_0x1ef11a['forEach'](function(_0x2ad88c){_0x15d42e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2ad88c+',%');});_0x38bd1a=_[_0x129b('0x6e')](_0x38bd1a,_0x1ef11a);break;case'User':if(_0x484c50['operator']==='$substring'){_0x2c2f02[_0x59919a](_0x129b('0x6f'),'%'+_0x484c50['value']+'%',null);}else{_0x59e7ed=_[_0x129b('0x5e')](_0x5a6c3e,[_0x129b('0x2d'),_0x129b('0x70')]);_0x484c50[_0x129b('0x47')]=_0x129b('0x70');_0x3a7df3=as[_0x129b('0x6b')](_0x2c8b9c,_0x59e7ed[_0x129b('0x39')],_0x484c50);_0x2c2f02[_0x59919a](_0x3a7df3[_0x129b('0x6c')],_0x3a7df3[_0x129b('0x60')][_0x129b('0x71')],_0x3a7df3['value'][_0x129b('0x1e')]);}break;case _0x129b('0x72'):_0x3a7df3=as[_0x129b('0x6b')]('me',null,_0x484c50);_0x2c2f02[_0x59919a](_0x3a7df3['text'],_0x3a7df3['value'][_0x129b('0x71')],_0x3a7df3[_0x129b('0x60')][_0x129b('0x1e')]);break;}}else{var _0x3a7df3=as[_0x129b('0x6b')](_0x2c8b9c,_0x59e7ed[_0x129b('0x39')],_0x484c50);_0x2c2f02[_0x59919a](_0x3a7df3['text'],_0x3a7df3[_0x129b('0x60')][_0x129b('0x71')],_0x3a7df3[_0x129b('0x60')][_0x129b('0x1e')]);}}}else{var _0x58f7b3=_(_0x5bd0f6[_0x129b('0x3b')])[_0x129b('0x3c')]()[_0x129b('0x2f')](function(_0x3c0e16){return _[_0x129b('0x73')](_0x5a6c3e,[_0x129b('0x2d'),_0x3c0e16])?_0x3c0e16:undefined;})['compact']()[_0x129b('0x60')]();if(!_['isEmpty'](_0x58f7b3)){_0x58f7b3[_0x129b('0x33')](function(_0x579722){if(_0x579722===_0x129b('0x74')){_0x403d6b[_0x129b('0x45')](_0x129b('0x75'),[]['concat'](_0x5bd0f6[_0x129b('0x3b')][_0x579722]));}else if(_0x579722===_0x129b('0x76')){var _0x9283c4=JSON['parse'](_0x5bd0f6['query'][_0x579722])[_0x129b('0x77')];var _0x2a263f=JSON['parse'](_0x5bd0f6[_0x129b('0x3b')][_0x579722])[_0x129b('0x78')];_0x403d6b[_0x129b('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9283c4,_0x2a263f);}else{if(_0x5bd0f6[_0x129b('0x3b')][_0x579722]===_0x129b('0x79')){_0x403d6b[_0x129b('0x45')]('i.'+_0x579722+'\x20IS\x20NULL');}else{_0x403d6b[_0x129b('0x45')]('i.'+_0x579722+_0x129b('0x7a'),_0x5bd0f6[_0x129b('0x3b')][_0x579722]);}}});}if(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x7b')]){if(_0x5bd0f6['query'][_0x129b('0x7b')]==0x1){_0x403d6b['having'](_0x129b('0x7c'));}else{_0x403d6b['having'](_0x129b('0x7d'));}}if(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x7e')]){_0x38bd1a=_[_0x129b('0x7f')](_0x5bd0f6['query']['tag'])?_0x5bd0f6['query'][_0x129b('0x7e')]:new Array(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x7e')]);_0x38bd1a['forEach'](function(_0x391165){_0x15d42e['or'](_0x129b('0x80'),'%,'+_0x391165+',%');});}if(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x81')]){var _0x3f18cd=_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x81')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x129b('0x82'));if(qs[_0x129b('0x83')](_0x3f18cd)){_0x2c2f02['or']('i.id\x20LIKE\x20?',_0x3f18cd+'%')['or'](_0x129b('0x84'),_0x3f18cd+'%');}_0x2c2f02['or'](_0x129b('0x85'),_0x3f18cd+'%');}}_0x403d6b[_0x129b('0x45')](_0x2c2f02);_0x403d6b[_0x129b('0x86')](_0x129b('0x87'));var _0x39af9f={'type':db[_0x129b('0x88')][_0x129b('0x89')]['SELECT'],'raw':!![]};var _0x5789a2=_0x403d6b[_0x129b('0x8a')]();_0x5789a2['field'](_0x129b('0x87'));_0x5789a2['field'](_0x129b('0x8b'),_0x129b('0x5f'));if(_0x1d0b95[_0x129b('0x43')]){_0x1d0b95[_0x129b('0x43')][_0x129b('0x33')](function(_0x3b2bf8){_0x403d6b[_0x129b('0x43')]('i.'+_0x3b2bf8[0x0],_0x3b2bf8[0x1]===_0x129b('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x38bd1a)){_0x403d6b[_0x129b('0x61')](_0x15d42e);_0x5789a2[_0x129b('0x45')](_0x129b('0x8d'),_0x38bd1a);}BPromise[_0x129b('0x8e')]()[_0x129b('0x29')](function(){if(!_0x4872fc){if(_0x5bd0f6['query']['FaxAccountId']||_0x5bd0f6['query'][_0x129b('0x8f')])return;_0x5789a2[_0x129b('0x45')](_0x129b('0x90'));_0x403d6b[_0x129b('0x45')](_0x129b('0x90'));return;}return _0x5bd0f6[_0x129b('0x91')][_0x129b('0x92')]({'attributes':['id'],'raw':!![]})[_0x129b('0x29')](function(_0x4042ca){if(_[_0x129b('0x93')](_0x4042ca)){_0x5789a2[_0x129b('0x45')](_0x129b('0x94'));_0x403d6b['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x5789a2[_0x129b('0x45')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x4042ca,'id'));_0x403d6b['where'](_0x129b('0x75'),_[_0x129b('0x2f')](_0x4042ca,'id'));}});})['then'](function(){db[_0x129b('0x95')][_0x129b('0x3b')](_0x5789a2[_0x129b('0x96')](),_0x39af9f)[_0x129b('0x29')](function(_0x407202){_0x30ff4a[_0x129b('0x20')]=_0x407202[_0x129b('0x41')];if(_0x30ff4a[_0x129b('0x20')]===0x0)return[];return db[_0x129b('0x95')]['query'](_0x4bbd59[_0x129b('0x96')](),_0x39af9f)[_0x129b('0x29')](function(_0x549cbe){_0x40f8ab=_[_0x129b('0x97')](_0x549cbe,'id');_0x39af9f=_[_0x129b('0x98')](_0x39af9f,{'model':db[_0x129b('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bd0f6[_0x129b('0x3b')][_0x129b('0x40')]){_0x1d0b95[_0x129b('0x3f')]['forEach'](function(_0x2c2908){_0x403d6b[_0x129b('0x47')]('i.'+_0x2c2908);});}else{_0x403d6b[_0x129b('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x129b('0x5f'));_0x403d6b['field'](_0x129b('0x99'),_0x129b('0x9a'));_0x403d6b[_0x129b('0x47')](_0x129b('0x9b'),'Account.mandatoryDisposition');_0x403d6b[_0x129b('0x47')](_0x129b('0x9c'));_0x403d6b[_0x129b('0x47')](_0x129b('0x9d'),_0x129b('0x9e'));_0x403d6b[_0x129b('0x47')](_0x129b('0x9f'),_0x129b('0xa0'));_0x403d6b['field'](_0x129b('0xa1'),'Contact.email');_0x403d6b[_0x129b('0x47')](_0x129b('0xa2'),'Contact.phone');_0x403d6b[_0x129b('0x47')](_0x129b('0xa3'),_0x129b('0xa4'));_0x403d6b[_0x129b('0x47')](_0x129b('0xa5'),_0x129b('0xa6'));_0x403d6b[_0x129b('0x47')](_0x129b('0xa7'),_0x129b('0xa8'));_0x403d6b[_0x129b('0x47')](_0x129b('0xa9'),_0x129b('0xaa'));_0x403d6b[_0x129b('0x47')](_0x129b('0xab'),_0x129b('0x32'));}if(_0x1d0b95[_0x129b('0x22')])_0x403d6b[_0x129b('0x22')](_0x1d0b95[_0x129b('0x22')]);if(_0x1d0b95['offset'])_0x403d6b[_0x129b('0x21')](_0x1d0b95['offset']);return db['sequelize'][_0x129b('0x3b')](_0x403d6b[_0x129b('0x96')](),_0x39af9f);})[_0x129b('0x29')](function(_0xecf1dd){_0x3b901a[_0x129b('0x45')](_0x129b('0xac'),_[_0x129b('0x2f')](_0xecf1dd,'id'));return db[_0x129b('0x95')][_0x129b('0x3b')](_0x3b901a['toString'](),_0x39af9f)[_0x129b('0x29')](function(_0xb1db3a){var _0x5babd8=_[_0x129b('0xad')](_0xb1db3a,_0x129b('0xae'));var _0x8aab38=[];_0xecf1dd[_0x129b('0x33')](function(_0x2afd6d){_0x8aab38[_0x129b('0xaf')](updateFaxInteraction(_0x2afd6d,_0x40f8ab,_0x5babd8));});return BPromise['all'](_0x8aab38);});});})['then'](function(_0x31fdc1){_0x30ff4a[_0x129b('0xb0')]=_0x31fdc1;return _0x30ff4a;})[_0x129b('0x29')](respondWithFilteredResult(_0x1c0e80,_0x1d0b95));})['catch'](handleError(_0x1c0e80,null));};exports['show']=function(_0x539104,_0x37e6a6){var _0x5ef869={'raw':![],'where':{'id':_0x539104[_0x129b('0xb1')]['id']}},_0x152fe2={};_0x152fe2[_0x129b('0xb2')]=_[_0x129b('0x3c')](db[_0x129b('0x36')][_0x129b('0x37')]);_0x152fe2['query']=_[_0x129b('0x3c')](_0x539104[_0x129b('0x3b')]);_0x152fe2[_0x129b('0x3d')]=_[_0x129b('0x3e')](_0x152fe2[_0x129b('0xb2')],_0x152fe2[_0x129b('0x3b')]);_0x5ef869['attributes']=_['intersection'](_0x152fe2[_0x129b('0xb2')],qs['fields'](_0x539104[_0x129b('0x3b')]['fields']));_0x5ef869[_0x129b('0x3f')]=_0x5ef869[_0x129b('0x3f')][_0x129b('0x41')]?_0x5ef869[_0x129b('0x3f')]:_0x152fe2[_0x129b('0xb2')];if(_0x539104[_0x129b('0x3b')]['includeAll']){_0x5ef869['include']=[{'all':!![]}];}_0x5ef869=_[_0x129b('0x98')]({},_0x5ef869,_0x539104[_0x129b('0xb3')]);return db[_0x129b('0x36')][_0x129b('0x5e')](_0x5ef869)[_0x129b('0x29')](handleEntityNotFound(_0x37e6a6,null))[_0x129b('0x29')](respondWithResult(_0x37e6a6,null))[_0x129b('0x34')](handleError(_0x37e6a6,null));};exports[_0x129b('0xb4')]=function(_0x26aa35,_0x2fc4d9){return db['FaxInteraction'][_0x129b('0xb4')](_0x26aa35[_0x129b('0x72')],{})[_0x129b('0x29')](respondWithResult(_0x2fc4d9,0xc9))[_0x129b('0x34')](handleError(_0x2fc4d9,null));};exports['update']=function(_0x57e6e0,_0x17ef6d){if(_0x57e6e0['body']['id']){delete _0x57e6e0[_0x129b('0x72')]['id'];}return db[_0x129b('0x36')][_0x129b('0x5e')]({'where':{'id':_0x57e6e0['params']['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x17ef6d,null))['then'](saveUpdates(_0x57e6e0[_0x129b('0x72')],null))[_0x129b('0x29')](respondWithResult(_0x17ef6d,null))[_0x129b('0x34')](handleError(_0x17ef6d,null));};exports[_0x129b('0xb5')]=function(_0x332af3,_0x5a1665){return db[_0x129b('0x36')][_0x129b('0x5e')]({'where':{'id':_0x332af3[_0x129b('0xb1')]['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x5a1665,null))['then'](removeEntity(_0x5a1665,null))[_0x129b('0x34')](handleError(_0x5a1665,null));};exports['describe']=function(_0x1cf707,_0x4544a8){return db[_0x129b('0x36')][_0x129b('0xb6')]()[_0x129b('0x29')](respondWithResult(_0x4544a8,null))[_0x129b('0x34')](handleError(_0x4544a8,null));};exports[_0x129b('0xb7')]=function(_0x183aa5,_0x34b095,_0x40c87a){return db['FaxMessage'][_0x129b('0x5e')]({'where':{'id':_0x183aa5[_0x129b('0xb1')]['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x34b095,null))[_0x129b('0x29')](function(_0x71b33b){if(_0x71b33b){return _0x71b33b[_0x129b('0xb7')](_0x183aa5[_0x129b('0x72')][_0x129b('0xb8')],_[_0x129b('0xb9')](_0x183aa5[_0x129b('0x72')],['ids','id'])||{});}})[_0x129b('0x29')](respondWithResult(_0x34b095,null))['catch'](handleError(_0x34b095,null));};exports['getMessages']=function(_0x20f5dc,_0x912fae,_0x2b99ac){var _0x2670f6={'raw':![],'where':{}};var _0x14281b={};var _0x2a02d1={'count':0x0,'rows':[]};return db[_0x129b('0x36')][_0x129b('0xba')]({'where':{'id':_0x20f5dc[_0x129b('0xb1')]['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x912fae,null))[_0x129b('0x29')](function(_0x14ab62){if(_0x14ab62){_0x14281b[_0x129b('0xb2')]=_[_0x129b('0x3c')](db[_0x129b('0xbb')]['rawAttributes']);_0x14281b[_0x129b('0x3b')]=_['keys'](_0x20f5dc['query']);_0x14281b[_0x129b('0x3d')]=_[_0x129b('0x3e')](_0x14281b[_0x129b('0xb2')],_0x14281b[_0x129b('0x3b')]);_0x2670f6['attributes']=_[_0x129b('0x3e')](_0x14281b[_0x129b('0xb2')],qs['fields'](_0x20f5dc[_0x129b('0x3b')]['fields']));_0x2670f6['attributes']=_0x2670f6[_0x129b('0x3f')][_0x129b('0x41')]?_0x2670f6['attributes']:_0x14281b[_0x129b('0xb2')];if(!_0x20f5dc[_0x129b('0x3b')][_0x129b('0x42')](_0x129b('0xbc'))){_0x2670f6[_0x129b('0x22')]=qs[_0x129b('0x22')](_0x20f5dc['query']['limit']);_0x2670f6[_0x129b('0x21')]=qs[_0x129b('0x21')](_0x20f5dc['query'][_0x129b('0x21')]);}_0x2670f6['order']=qs[_0x129b('0x44')](_0x20f5dc[_0x129b('0x3b')][_0x129b('0x44')]);_0x2670f6[_0x129b('0x45')]=qs[_0x129b('0x3d')](_[_0x129b('0xbd')](_0x20f5dc[_0x129b('0x3b')],_0x14281b[_0x129b('0x3d')]));_0x2670f6[_0x129b('0x45')][_0x129b('0xae')]=_0x14ab62['id'];if(_0x20f5dc[_0x129b('0x3b')][_0x129b('0x81')]){_0x2670f6[_0x129b('0x45')]=_[_0x129b('0x98')](_0x2670f6['where'],{'$or':_[_0x129b('0x2f')](_0x2670f6[_0x129b('0x3f')],function(_0x1e01c5){var _0x3591e5={};_0x3591e5[_0x1e01c5]={'$like':'%'+_0x20f5dc[_0x129b('0x3b')][_0x129b('0x81')]+'%'};return _0x3591e5;})});}if(_0x20f5dc[_0x129b('0x3b')][_0x129b('0x77')]){var _0x31304d=_0x20f5dc[_0x129b('0x3b')][_0x129b('0x77')]['split'](',');var _0x42a85e={};_0x42a85e[_0x31304d[0x0]]={'$gte':moment(_0x31304d[0x1])[_0x129b('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2670f6['where']=_[_0x129b('0x98')](_0x2670f6[_0x129b('0x45')],_0x42a85e);}_0x2670f6=_[_0x129b('0x98')]({},_0x2670f6,_0x20f5dc['options']);return db['FaxMessage'][_0x129b('0x20')]({'where':_0x2670f6['where']})[_0x129b('0x29')](function(_0x4a7212){_0x2a02d1[_0x129b('0x20')]=_0x4a7212;if(_0x20f5dc[_0x129b('0x3b')][_0x129b('0xbf')]){_0x2670f6['include']=[{'all':!![]}];}return db[_0x129b('0xbb')]['findAll'](_0x2670f6);})[_0x129b('0x29')](function(_0x4b6de3){_0x2a02d1['rows']=_0x4b6de3;return _0x2a02d1;});}})['then'](respondWithFilteredResult(_0x912fae,_0x2670f6))['catch'](handleError(_0x912fae,null));};exports['addTags']=function(_0x41d49e,_0x5f16b,_0x5351f6){return db[_0x129b('0x36')]['find']({'where':{'id':_0x41d49e[_0x129b('0xb1')]['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x5f16b,null))[_0x129b('0x29')](function(_0x3df772){if(_0x3df772){return _0x3df772[_0x129b('0xc0')](_0x41d49e[_0x129b('0x72')][_0x129b('0xb8')],_[_0x129b('0xb9')](_0x41d49e[_0x129b('0x72')],[_0x129b('0xb8'),'id'])||{})[_0x129b('0xc1')](function(){return db['Tag'][_0x129b('0xc2')]({'attributes':['id',_0x129b('0x2d'),_0x129b('0x48')],'where':{'id':_0x41d49e[_0x129b('0x72')][_0x129b('0xb8')]}});})[_0x129b('0x29')](function(_0x2f61f1){socket[_0x129b('0xc3')](_0x129b('0xc4'),{'id':Number(_0x41d49e[_0x129b('0xb1')]['id']),'tags':_0x2f61f1||[]});return{'id':Number(_0x41d49e[_0x129b('0xb1')]['id']),'tags':_0x2f61f1||[]};});}})[_0x129b('0x29')](respondWithResult(_0x5f16b,null))[_0x129b('0x34')](handleError(_0x5f16b,null));};exports[_0x129b('0xc5')]=function(_0x4e11f1,_0x4917a4,_0x4f9168){return db[_0x129b('0x36')][_0x129b('0x5e')]({'where':{'id':_0x4e11f1[_0x129b('0xb1')]['id']}})[_0x129b('0x29')](handleEntityNotFound(_0x4917a4,null))['then'](function(_0x3e081a){if(_0x3e081a){return _0x3e081a[_0x129b('0xc5')](_0x4e11f1[_0x129b('0x3b')][_0x129b('0xb8')]);}})['then'](respondWithStatusCode(_0x4917a4,null))[_0x129b('0x34')](handleError(_0x4917a4,null));};exports[_0x129b('0xc6')]=function(_0x2351e5,_0x1eec59){var _0x496df1=moment()['unix']()['toString']();var _0x3e5033=path[_0x129b('0xc7')](config[_0x129b('0xc8')],_0x129b('0xc9'),'files',_0x129b('0xca'));var _0x11304d=path[_0x129b('0xc7')](config[_0x129b('0xc8')],_0x129b('0xc9'),_0x129b('0xcb'),_0x129b('0xcc'));var _0x4a8a4f=path[_0x129b('0xc7')](_0x3e5033,_0x496df1);var _0x55ece7=util['format'](_0x129b('0xcd'),_0x2351e5['params']['id'],_0x496df1);var _0x23074c=path[_0x129b('0xc7')](_0x3e5033,_0x55ece7);var _0x524c84=[];_0x524c84[_0x129b('0xaf')]({'model':db[_0x129b('0xce')],'as':_0x129b('0xce'),'raw':!![]});var _0x1a0695=[{'model':db[_0x129b('0xbb')],'as':_0x129b('0xcf'),'attributes':['id','body',_0x129b('0x76')],'include':_0x524c84}];return db['FaxInteraction'][_0x129b('0x5e')]({'where':{'id':_0x2351e5[_0x129b('0xb1')]['id']},'include':_0x1a0695})[_0x129b('0x29')](handleEntityNotFound(_0x1eec59,null))['then'](function(_0x407892){if(_0x407892&&_0x407892[_0x129b('0xcf')]){var _0x5ab83c=_0x407892[_0x129b('0xd0')]({'plain':!![]});fs[_0x129b('0xd1')](_0x4a8a4f);for(var _0x827cf4=0x0;_0x827cf4<_0x5ab83c[_0x129b('0xcf')][_0x129b('0x41')];_0x827cf4++){var _0x11ed5e=_0x5ab83c[_0x129b('0xcf')][_0x827cf4][_0x129b('0xce')];if(_0x11ed5e){var _0x1476dc=path[_0x129b('0xc7')](_0x11304d,_0x11ed5e[_0x129b('0xd2')]);if(fs['existsSync'](_0x1476dc)){fs[_0x129b('0xd3')](_0x1476dc)[_0x129b('0xd4')](fs[_0x129b('0xd5')](path[_0x129b('0xc7')](_0x4a8a4f,_0x11ed5e['basename'])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x12b4b7,_0x4c1035){zipdir(_0x4a8a4f,{'saveTo':_0x23074c},function(_0x1eda62,_0x495fa7){if(_0x1eda62)return _0x4c1035(_0x1eda62);return _0x12b4b7(_0x495fa7);});})[_0x129b('0x29')](function(){return new BPromise(function(_0x189b66,_0x3aa0c3){rimraf(_0x4a8a4f,function(_0x2f963b){if(_0x2f963b)_0x3aa0c3(_0x2f963b);return _0x189b66();});});})[_0x129b('0x29')](function(){return _0x1eec59['download'](_0x23074c,_0x55ece7,function(_0x2a5609){if(_0x2a5609){console[_0x129b('0xd6')]('err',_0x2a5609);}else{fs[_0x129b('0xd7')](_0x23074c);}});});});}else{return _0x1eec59['sendStatus'](0xc8);}})[_0x129b('0x34')](handleError(_0x1eec59,null));}; \ No newline at end of file +var _0xf7b4=['me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','UserId','buildExpression','body','some','isEmpty','i.FaxAccountId\x20IN\x20?','parse','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','keys','includeAll','include','options','create','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','format','Attachment','Messages','mkdirSync','existsSync','pipe','createWriteStream','basename','log','err','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','limit','sort','filters','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7b4,0x152));var _0x4f7b=function(_0x2782d4,_0x2e3755){_0x2782d4=_0x2782d4-0x0;var _0x982e94=_0xf7b4[_0x2782d4];return _0x982e94;};'use strict';var pdf=require(_0x4f7b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f7b('0x1'));var jsonpatch=require(_0x4f7b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f7b('0x3'));var Mustache=require(_0x4f7b('0x4'));var util=require(_0x4f7b('0x5'));var path=require(_0x4f7b('0x6'));var sox=require(_0x4f7b('0x7'));var csv=require(_0x4f7b('0x8'));var ejs=require(_0x4f7b('0x9'));var fs=require('fs');var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x8'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4f7b('0x17')](config[_0x4f7b('0x18')],{'host':_0x4f7b('0x19'),'port':0x18eb});var socket=require(_0x4f7b('0x1a'))(new Redis(config['redis']));require(_0x4f7b('0x1b'))[_0x4f7b('0x1c')](socket);function respondWithStatusCode(_0x407cee,_0x43a51a){_0x43a51a=_0x43a51a||0xcc;return function(_0x339486){if(_0x339486){return _0x407cee[_0x4f7b('0x1d')](_0x43a51a);}return _0x407cee[_0x4f7b('0x1e')](_0x43a51a)[_0x4f7b('0x1f')]();};}function respondWithResult(_0x260667,_0x29fdd5){_0x29fdd5=_0x29fdd5||0xc8;return function(_0x1a28b8){if(_0x1a28b8){return _0x260667[_0x4f7b('0x1e')](_0x29fdd5)['json'](_0x1a28b8);}};}function respondWithFilteredResult(_0x372ea5,_0x496322){return function(_0x5b5ee3){if(_0x5b5ee3){var _0x24e5cf=_0x5b5ee3[_0x4f7b('0x20')],_0x3813da=_0x496322[_0x4f7b('0x21')],_0x519d90=_0x496322[_0x4f7b('0x21')]+_0x496322['limit'],_0x2b34c9;if(_0x519d90>=_0x24e5cf){_0x519d90=_0x24e5cf;_0x2b34c9=0xc8;}else{_0x2b34c9=0xce;}_0x372ea5[_0x4f7b('0x1e')](_0x2b34c9);return _0x372ea5['set'](_0x4f7b('0x22'),_0x3813da+'-'+_0x519d90+'/'+_0x24e5cf)[_0x4f7b('0x23')](_0x5b5ee3);}return null;};}function patchUpdates(_0xa2f54e){return function(_0xdb2df2){try{jsonpatch[_0x4f7b('0x24')](_0xdb2df2,_0xa2f54e,!![]);}catch(_0x203a92){return BPromise[_0x4f7b('0x25')](_0x203a92);}return _0xdb2df2[_0x4f7b('0x26')]();};}function saveUpdates(_0x2a8b50,_0x5508bd){return function(_0x410176){if(_0x410176){return _0x410176[_0x4f7b('0x27')](_0x2a8b50)[_0x4f7b('0x28')](function(_0x5bd43f){return _0x5bd43f;});}return null;};}function removeEntity(_0x150f57,_0x4610a4){return function(_0x5d22f4){if(_0x5d22f4){return _0x5d22f4[_0x4f7b('0x29')]()['then'](function(){_0x150f57[_0x4f7b('0x1e')](0xcc)[_0x4f7b('0x1f')]();});}};}function handleEntityNotFound(_0x23c820,_0x278c41){return function(_0x17aa9d){if(!_0x17aa9d){_0x23c820[_0x4f7b('0x1d')](0x194);}return _0x17aa9d;};}function handleError(_0x181e13,_0x3ad769){_0x3ad769=_0x3ad769||0x1f4;return function(_0x4ec9a3){logger[_0x4f7b('0x2a')](_0x4ec9a3[_0x4f7b('0x2b')]);if(_0x4ec9a3[_0x4f7b('0x2c')]){delete _0x4ec9a3['name'];}_0x181e13[_0x4f7b('0x1e')](_0x3ad769)[_0x4f7b('0x2d')](_0x4ec9a3);};}function getInteractionUsers(_0x1db684,_0x3a56ff){return new BPromise(function(_0x1ccce0,_0x4ebffa){try{if(_0x3a56ff[_0x1db684['id']]){_0x1db684[_0x4f7b('0x2e')]=_[_0x4f7b('0x2f')](_0x3a56ff[_0x1db684['id']],function(_0x9a675c){return{'id':_0x9a675c['id'],'fullname':_0x9a675c['fullname']};});}}catch(_0x7de561){_0x4ebffa(_0x7de561);}_0x1ccce0(_0x1db684);});}function getInteractionTags(_0x5d13a1,_0x4e4828){return new BPromise(function(_0x1a2346,_0x52a5b1){try{if(_0x5d13a1[_0x4f7b('0x30')]){_0x5d13a1[_0x4f7b('0x31')]=[];_0x5d13a1[_0x4f7b('0x30')][_0x4f7b('0x32')](',')[_0x4f7b('0x33')](function(_0x4e5862){_0x5d13a1[_0x4f7b('0x31')][_0x4f7b('0x34')](_0x4e4828[_0x4e5862]);});}delete _0x5d13a1[_0x4f7b('0x30')];}catch(_0x557cd6){_0x52a5b1(_0x557cd6);}_0x1a2346(_0x5d13a1);});}function updateFaxInteraction(_0x1c133d,_0x8d3266,_0x3e7fb4){return new BPromise(function(_0x121923,_0x3c7bd8){return getInteractionUsers(_0x1c133d,_0x3e7fb4)[_0x4f7b('0x28')](function(_0x32e039){return getInteractionTags(_0x32e039,_0x8d3266);})[_0x4f7b('0x28')](function(_0x35f1ed){_0x121923(_0x35f1ed);})[_0x4f7b('0x35')](function(_0x3cdf6d){_0x3c7bd8(_0x3cdf6d);});});}exports[_0x4f7b('0x36')]=function(_0x56e045,_0x2e7640){var _0x5127a2={},_0x2fe94d={},_0x4005ad={'count':0x0,'rows':[]};var _0x579ad4=_[_0x4f7b('0x2f')](db[_0x4f7b('0x37')][_0x4f7b('0x38')],function(_0x584b25){return{'name':_0x584b25[_0x4f7b('0x39')],'type':_0x584b25[_0x4f7b('0x3a')][_0x4f7b('0x3b')]};});_0x2fe94d[_0x4f7b('0x3c')]=_[_0x4f7b('0x2f')](_0x579ad4,_0x4f7b('0x2c'));_0x2fe94d[_0x4f7b('0x3d')]=_['keys'](_0x56e045[_0x4f7b('0x3d')]);_0x2fe94d['filters']=_[_0x4f7b('0x3e')](_0x2fe94d[_0x4f7b('0x3c')],_0x2fe94d[_0x4f7b('0x3d')]);_0x5127a2['attributes']=_[_0x4f7b('0x3e')](_0x2fe94d['model'],qs[_0x4f7b('0x3f')](_0x56e045[_0x4f7b('0x3d')]['fields']));_0x5127a2['attributes']=_0x5127a2[_0x4f7b('0x40')]['length']?_0x5127a2[_0x4f7b('0x40')]:_0x2fe94d[_0x4f7b('0x3c')];if(!_0x56e045['query'][_0x4f7b('0x41')]('nolimit')){_0x5127a2['limit']=qs['limit'](_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x42')]);_0x5127a2[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x56e045['query'][_0x4f7b('0x21')]);}_0x5127a2['order']=qs[_0x4f7b('0x43')](_0x56e045['query'][_0x4f7b('0x43')]);_0x5127a2['where']=qs[_0x4f7b('0x44')](_[_0x4f7b('0x45')](_0x56e045[_0x4f7b('0x3d')],_0x2fe94d[_0x4f7b('0x44')]),_0x579ad4);var _0x2986cd=[];var _0x325cd6=squel[_0x4f7b('0x46')]()[_0x4f7b('0x47')]('id')[_0x4f7b('0x47')](_0x4f7b('0x2c'))[_0x4f7b('0x47')](_0x4f7b('0x48'))[_0x4f7b('0x49')](_0x4f7b('0x4a'));var _0x3a9c34=squel[_0x4f7b('0x46')]()[_0x4f7b('0x47')](_0x4f7b('0x4b'))['field']('u.fullname')[_0x4f7b('0x47')](_0x4f7b('0x4c'))[_0x4f7b('0x49')](_0x4f7b('0x4d'),'ui')['left_join']('users','u',_0x4f7b('0x4e'));var _0xf46a38=squel[_0x4f7b('0x46')]()[_0x4f7b('0x49')]('fax_interactions','i')['left_join'](_0x4f7b('0x4f'),'c',_0x4f7b('0x50'))[_0x4f7b('0x51')](_0x4f7b('0x52'),'o',_0x4f7b('0x53'))['left_join'](_0x4f7b('0x54'),'a',_0x4f7b('0x55'))[_0x4f7b('0x51')]('fax_messages','me',_0x4f7b('0x56'))[_0x4f7b('0x51')](_0x4f7b('0x57'),'it',_0x4f7b('0x58'))[_0x4f7b('0x51')](_0x4f7b('0x4a'),'t',_0x4f7b('0x59'));var _0x2e563f=squel[_0x4f7b('0x5a')]();var _0x1ef931=[];var _0x551531=squel[_0x4f7b('0x5a')]();var _0x45eebf;if(_0x56e045[_0x4f7b('0x3d')]['search']){_0x45eebf=as[_0x4f7b('0x5b')](_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x5c')]);var _0x78829b=_0x45eebf[_0x4f7b('0x5d')];for(var _0x7e624=0x0;_0x7e624<_0x45eebf[_0x4f7b('0x5e')][_0x4f7b('0x5f')];_0x7e624++){var _0x776ce7=_0x45eebf[_0x4f7b('0x5e')][_0x7e624];var _0x4f28b7='i';var _0x21fa9c=_[_0x4f7b('0x60')](_0x579ad4,[_0x4f7b('0x2c'),_0x776ce7['field']]);if(!_0x21fa9c){switch(_0x776ce7[_0x4f7b('0x47')]){case _0x4f7b('0x61'):if(_0x776ce7[_0x4f7b('0x62')]==0x1){_0xf46a38[_0x4f7b('0x63')]('`'+_0x776ce7[_0x4f7b('0x47')]+_0x4f7b('0x64'));}else{_0xf46a38['having']('`'+_0x776ce7[_0x4f7b('0x47')]+_0x4f7b('0x65'));}break;case _0x4f7b('0x66'):if(_0x776ce7['operator']===_0x4f7b('0x67')){if(_0x776ce7[_0x4f7b('0x62')][_0x4f7b('0x32')]('\x20')[_0x4f7b('0x5f')]>0x1){_0x2e563f[_0x78829b](_0x4f7b('0x68'),qs[_0x4f7b('0x69')](_0x776ce7['value']),null);}else{var _0x13bb98='%'+_0x776ce7['value']+'%';_0x2e563f[_0x78829b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x13bb98,_0x13bb98,_0x13bb98);}}else{_0x21fa9c=_['find'](_0x579ad4,[_0x4f7b('0x2c'),_0x4f7b('0x6a')]);_0x776ce7[_0x4f7b('0x47')]='ContactId';_0x8f9464=as['buildExpression'](_0x4f28b7,_0x21fa9c[_0x4f7b('0x3a')],_0x776ce7);_0x2e563f[_0x78829b](_0x8f9464[_0x4f7b('0x6b')],_0x8f9464['value'][_0x4f7b('0x6c')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x1f')]);}break;case _0x4f7b('0x6d'):var _0x567874=_0x776ce7[_0x4f7b('0x62')][_0x4f7b('0x32')](',')[_0x4f7b('0x2f')](function(_0x42b378){return Number(_0x42b378);});_0x567874[_0x4f7b('0x33')](function(_0x3ab7d6){_0x551531['or'](_0x4f7b('0x6e'),'%,'+_0x3ab7d6+',%');});_0x1ef931=_['union'](_0x1ef931,_0x567874);break;case'User':if(_0x776ce7['operator']===_0x4f7b('0x67')){_0x2e563f[_0x78829b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x776ce7['value']+'%',null);}else{_0x21fa9c=_['find'](_0x579ad4,['name',_0x4f7b('0x6f')]);_0x776ce7[_0x4f7b('0x47')]=_0x4f7b('0x6f');_0x8f9464=as[_0x4f7b('0x70')](_0x4f28b7,_0x21fa9c[_0x4f7b('0x3a')],_0x776ce7);_0x2e563f[_0x78829b](_0x8f9464[_0x4f7b('0x6b')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x6c')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x1f')]);}break;case _0x4f7b('0x71'):_0x8f9464=as[_0x4f7b('0x70')]('me',null,_0x776ce7);_0x2e563f[_0x78829b](_0x8f9464[_0x4f7b('0x6b')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x6c')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x1f')]);break;}}else{var _0x8f9464=as['buildExpression'](_0x4f28b7,_0x21fa9c[_0x4f7b('0x3a')],_0x776ce7);_0x2e563f[_0x78829b](_0x8f9464[_0x4f7b('0x6b')],_0x8f9464[_0x4f7b('0x62')][_0x4f7b('0x6c')],_0x8f9464[_0x4f7b('0x62')]['end']);}}}else{var _0x4b9f3a=_(_0x56e045[_0x4f7b('0x3d')])['keys']()[_0x4f7b('0x2f')](function(_0x384a08){return _[_0x4f7b('0x72')](_0x579ad4,[_0x4f7b('0x2c'),_0x384a08])?_0x384a08:undefined;})['compact']()[_0x4f7b('0x62')]();if(!_[_0x4f7b('0x73')](_0x4b9f3a)){_0x4b9f3a[_0x4f7b('0x33')](function(_0x58baa5){if(_0x58baa5==='FaxAccountId'){_0xf46a38['where'](_0x4f7b('0x74'),[]['concat'](_0x56e045['query'][_0x58baa5]));}else if(_0x58baa5==='createdAt'){var _0x28a966=JSON[_0x4f7b('0x75')](_0x56e045[_0x4f7b('0x3d')][_0x58baa5])['$gte'];var _0x6be571=JSON[_0x4f7b('0x75')](_0x56e045['query'][_0x58baa5])['$lte'];_0xf46a38[_0x4f7b('0x76')](_0x4f7b('0x77'),_0x28a966,_0x6be571);}else{if(_0x56e045[_0x4f7b('0x3d')][_0x58baa5]===_0x4f7b('0x78')){_0xf46a38['where']('i.'+_0x58baa5+_0x4f7b('0x79'));}else{_0xf46a38[_0x4f7b('0x76')]('i.'+_0x58baa5+_0x4f7b('0x7a'),_0x56e045[_0x4f7b('0x3d')][_0x58baa5]);}}});}if(_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x7b')]){if(_0x56e045['query'][_0x4f7b('0x7b')]==0x1){_0xf46a38[_0x4f7b('0x63')](_0x4f7b('0x7c'));}else{_0xf46a38[_0x4f7b('0x63')](_0x4f7b('0x7d'));}}if(_0x56e045['query']['tag']){_0x1ef931=_['isArray'](_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x7e')])?_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x7e')]:new Array(_0x56e045[_0x4f7b('0x3d')]['tag']);_0x1ef931[_0x4f7b('0x33')](function(_0x16dbe3){_0x551531['or'](_0x4f7b('0x6e'),'%,'+_0x16dbe3+',%');});}if(_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x7f')]){var _0x41fe64=_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x7f')][_0x4f7b('0x80')]('\x5c','\x5c\x5c')[_0x4f7b('0x80')]('\x27\x27',_0x4f7b('0x81'));if(qs[_0x4f7b('0x82')](_0x41fe64)){_0x2e563f['or'](_0x4f7b('0x83'),_0x41fe64+'%')['or'](_0x4f7b('0x84'),_0x41fe64+'%');}_0x2e563f['or'](_0x4f7b('0x85'),_0x41fe64+'%');}}_0xf46a38[_0x4f7b('0x76')](_0x2e563f);_0xf46a38[_0x4f7b('0x86')](_0x4f7b('0x87'));var _0x531da6={'type':db['Sequelize'][_0x4f7b('0x88')][_0x4f7b('0x89')],'raw':!![]};var _0x38de9f=_0xf46a38[_0x4f7b('0x8a')]();_0x38de9f['field'](_0x4f7b('0x87'));_0x38de9f[_0x4f7b('0x47')](_0x4f7b('0x8b'),_0x4f7b('0x61'));if(_0x5127a2[_0x4f7b('0x8c')]){_0x5127a2[_0x4f7b('0x8c')][_0x4f7b('0x33')](function(_0x35d18a){_0xf46a38[_0x4f7b('0x8c')]('i.'+_0x35d18a[0x0],_0x35d18a[0x1]===_0x4f7b('0x8d')?![]:!![]);});}if(!_[_0x4f7b('0x73')](_0x1ef931)){_0xf46a38[_0x4f7b('0x63')](_0x551531);_0x38de9f[_0x4f7b('0x76')](_0x4f7b('0x8e'),_0x1ef931);}BPromise[_0x4f7b('0x8f')]()['then'](function(){if(!_0x45eebf){if(_0x56e045[_0x4f7b('0x3d')][_0x4f7b('0x90')]||_0x56e045['query']['journey'])return;_0x38de9f[_0x4f7b('0x76')](_0x4f7b('0x91'));_0xf46a38[_0x4f7b('0x76')](_0x4f7b('0x91'));return;}return _0x56e045[_0x4f7b('0x92')][_0x4f7b('0x93')]({'attributes':['id'],'raw':!![]})[_0x4f7b('0x28')](function(_0x48d9c6){if(_['isEmpty'](_0x48d9c6)){_0x38de9f[_0x4f7b('0x76')](_0x4f7b('0x94'));_0xf46a38[_0x4f7b('0x76')](_0x4f7b('0x94'));}else{_0x38de9f['where'](_0x4f7b('0x74'),_[_0x4f7b('0x2f')](_0x48d9c6,'id'));_0xf46a38['where'](_0x4f7b('0x74'),_[_0x4f7b('0x2f')](_0x48d9c6,'id'));}});})['then'](function(){db['sequelize'][_0x4f7b('0x3d')](_0x38de9f['toString'](),_0x531da6)['then'](function(_0x52d71b){_0x4005ad[_0x4f7b('0x20')]=_0x52d71b['length'];if(_0x4005ad[_0x4f7b('0x20')]===0x0)return[];return db[_0x4f7b('0x95')][_0x4f7b('0x3d')](_0x325cd6[_0x4f7b('0x96')](),_0x531da6)[_0x4f7b('0x28')](function(_0xcc4ff2){_0x2986cd=_[_0x4f7b('0x97')](_0xcc4ff2,'id');_0x531da6=_[_0x4f7b('0x98')](_0x531da6,{'model':db[_0x4f7b('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x56e045['query'][_0x4f7b('0x3f')]){_0x5127a2[_0x4f7b('0x40')][_0x4f7b('0x33')](function(_0x40120d){_0xf46a38[_0x4f7b('0x47')]('i.'+_0x40120d);});}else{_0xf46a38[_0x4f7b('0x47')](_0x4f7b('0x8b'),_0x4f7b('0x61'));_0xf46a38['field'](_0x4f7b('0x99'),_0x4f7b('0x9a'));_0xf46a38[_0x4f7b('0x47')]('a.mandatoryDisposition',_0x4f7b('0x9b'));_0xf46a38['field'](_0x4f7b('0x9c'));_0xf46a38[_0x4f7b('0x47')]('c.firstName','Contact.firstName');_0xf46a38[_0x4f7b('0x47')]('c.lastName',_0x4f7b('0x9d'));_0xf46a38['field'](_0x4f7b('0x9e'),_0x4f7b('0x9f'));_0xf46a38[_0x4f7b('0x47')]('c.phone',_0x4f7b('0xa0'));_0xf46a38['field'](_0x4f7b('0xa1'),_0x4f7b('0xa2'));_0xf46a38[_0x4f7b('0x47')](_0x4f7b('0xa3'),_0x4f7b('0xa4'));_0xf46a38[_0x4f7b('0x47')](_0x4f7b('0xa5'),'Owner.fullname');_0xf46a38[_0x4f7b('0x47')]('o.internal','Owner.internal');_0xf46a38['field'](_0x4f7b('0xa6'),'TagIds');}if(_0x5127a2[_0x4f7b('0x42')])_0xf46a38[_0x4f7b('0x42')](_0x5127a2[_0x4f7b('0x42')]);if(_0x5127a2[_0x4f7b('0x21')])_0xf46a38[_0x4f7b('0x21')](_0x5127a2[_0x4f7b('0x21')]);return db[_0x4f7b('0x95')][_0x4f7b('0x3d')](_0xf46a38['toString'](),_0x531da6);})['then'](function(_0x4eec65){_0x3a9c34['where'](_0x4f7b('0xa7'),_[_0x4f7b('0x2f')](_0x4eec65,'id'));return db[_0x4f7b('0x95')]['query'](_0x3a9c34[_0x4f7b('0x96')](),_0x531da6)['then'](function(_0x19a25d){var _0x240781=_['groupBy'](_0x19a25d,_0x4f7b('0xa8'));var _0x192b7b=[];_0x4eec65[_0x4f7b('0x33')](function(_0x4f2d7e){_0x192b7b[_0x4f7b('0x34')](updateFaxInteraction(_0x4f2d7e,_0x2986cd,_0x240781));});return BPromise[_0x4f7b('0xa9')](_0x192b7b);});});})[_0x4f7b('0x28')](function(_0x3927b5){_0x4005ad[_0x4f7b('0xaa')]=_0x3927b5;return _0x4005ad;})[_0x4f7b('0x28')](respondWithFilteredResult(_0x2e7640,_0x5127a2));})[_0x4f7b('0x35')](handleError(_0x2e7640,null));};exports[_0x4f7b('0xab')]=function(_0xd249a,_0x4f2c6e){var _0x147e14={'raw':![],'where':{'id':_0xd249a['params']['id']}},_0x55922a={};_0x55922a[_0x4f7b('0x3c')]=_[_0x4f7b('0xac')](db['FaxInteraction']['rawAttributes']);_0x55922a[_0x4f7b('0x3d')]=_['keys'](_0xd249a[_0x4f7b('0x3d')]);_0x55922a[_0x4f7b('0x44')]=_[_0x4f7b('0x3e')](_0x55922a[_0x4f7b('0x3c')],_0x55922a[_0x4f7b('0x3d')]);_0x147e14[_0x4f7b('0x40')]=_[_0x4f7b('0x3e')](_0x55922a[_0x4f7b('0x3c')],qs['fields'](_0xd249a[_0x4f7b('0x3d')][_0x4f7b('0x3f')]));_0x147e14[_0x4f7b('0x40')]=_0x147e14[_0x4f7b('0x40')][_0x4f7b('0x5f')]?_0x147e14[_0x4f7b('0x40')]:_0x55922a[_0x4f7b('0x3c')];if(_0xd249a['query'][_0x4f7b('0xad')]){_0x147e14[_0x4f7b('0xae')]=[{'all':!![]}];}_0x147e14=_[_0x4f7b('0x98')]({},_0x147e14,_0xd249a[_0x4f7b('0xaf')]);return db[_0x4f7b('0x37')][_0x4f7b('0x60')](_0x147e14)[_0x4f7b('0x28')](handleEntityNotFound(_0x4f2c6e,null))[_0x4f7b('0x28')](respondWithResult(_0x4f2c6e,null))[_0x4f7b('0x35')](handleError(_0x4f2c6e,null));};exports['create']=function(_0x4a00f3,_0x50cf39){return db['FaxInteraction'][_0x4f7b('0xb0')](_0x4a00f3[_0x4f7b('0x71')],{})[_0x4f7b('0x28')](respondWithResult(_0x50cf39,0xc9))[_0x4f7b('0x35')](handleError(_0x50cf39,null));};exports[_0x4f7b('0x27')]=function(_0x672382,_0x11ee6c){if(_0x672382['body']['id']){delete _0x672382[_0x4f7b('0x71')]['id'];}return db[_0x4f7b('0x37')][_0x4f7b('0x60')]({'where':{'id':_0x672382[_0x4f7b('0xb1')]['id']}})['then'](handleEntityNotFound(_0x11ee6c,null))[_0x4f7b('0x28')](saveUpdates(_0x672382[_0x4f7b('0x71')],null))[_0x4f7b('0x28')](respondWithResult(_0x11ee6c,null))['catch'](handleError(_0x11ee6c,null));};exports[_0x4f7b('0x29')]=function(_0x1a95e8,_0x18f0e8){return db[_0x4f7b('0x37')][_0x4f7b('0x60')]({'where':{'id':_0x1a95e8[_0x4f7b('0xb1')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x18f0e8,null))[_0x4f7b('0x28')](removeEntity(_0x18f0e8,null))[_0x4f7b('0x35')](handleError(_0x18f0e8,null));};exports[_0x4f7b('0xb2')]=function(_0x2365a8,_0x8be1ad){return db['FaxInteraction']['describe']()[_0x4f7b('0x28')](respondWithResult(_0x8be1ad,null))['catch'](handleError(_0x8be1ad,null));};exports[_0x4f7b('0xb3')]=function(_0x2eb69a,_0x5917af,_0x411a94){return db[_0x4f7b('0xb4')]['find']({'where':{'id':_0x2eb69a['params']['id']}})['then'](handleEntityNotFound(_0x5917af,null))[_0x4f7b('0x28')](function(_0x5a8bda){if(_0x5a8bda){return _0x5a8bda['addMessage'](_0x2eb69a[_0x4f7b('0x71')][_0x4f7b('0xb5')],_[_0x4f7b('0xb6')](_0x2eb69a[_0x4f7b('0x71')],[_0x4f7b('0xb5'),'id'])||{});}})[_0x4f7b('0x28')](respondWithResult(_0x5917af,null))['catch'](handleError(_0x5917af,null));};exports[_0x4f7b('0xb7')]=function(_0x1ebf36,_0x4daeb1,_0x268f17){var _0x5556b4={'raw':![],'where':{}};var _0x4d5eb3={};var _0x5d8ca3={'count':0x0,'rows':[]};return db[_0x4f7b('0x37')][_0x4f7b('0xb8')]({'where':{'id':_0x1ebf36[_0x4f7b('0xb1')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x4daeb1,null))['then'](function(_0x3e0d84){if(_0x3e0d84){_0x4d5eb3['model']=_['keys'](db['FaxMessage']['rawAttributes']);_0x4d5eb3[_0x4f7b('0x3d')]=_[_0x4f7b('0xac')](_0x1ebf36[_0x4f7b('0x3d')]);_0x4d5eb3[_0x4f7b('0x44')]=_[_0x4f7b('0x3e')](_0x4d5eb3['model'],_0x4d5eb3[_0x4f7b('0x3d')]);_0x5556b4[_0x4f7b('0x40')]=_[_0x4f7b('0x3e')](_0x4d5eb3[_0x4f7b('0x3c')],qs[_0x4f7b('0x3f')](_0x1ebf36[_0x4f7b('0x3d')]['fields']));_0x5556b4[_0x4f7b('0x40')]=_0x5556b4['attributes'][_0x4f7b('0x5f')]?_0x5556b4[_0x4f7b('0x40')]:_0x4d5eb3[_0x4f7b('0x3c')];if(!_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0x41')](_0x4f7b('0xb9'))){_0x5556b4[_0x4f7b('0x42')]=qs[_0x4f7b('0x42')](_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0x42')]);_0x5556b4[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1ebf36['query']['offset']);}_0x5556b4[_0x4f7b('0x8c')]=qs[_0x4f7b('0x43')](_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0x43')]);_0x5556b4[_0x4f7b('0x76')]=qs[_0x4f7b('0x44')](_[_0x4f7b('0x45')](_0x1ebf36[_0x4f7b('0x3d')],_0x4d5eb3[_0x4f7b('0x44')]));_0x5556b4['where']['FaxInteractionId']=_0x3e0d84['id'];if(_0x1ebf36[_0x4f7b('0x3d')]['filter']){_0x5556b4[_0x4f7b('0x76')]=_[_0x4f7b('0x98')](_0x5556b4[_0x4f7b('0x76')],{'$or':_[_0x4f7b('0x2f')](_0x5556b4[_0x4f7b('0x40')],function(_0x538a90){var _0x324ee3={};_0x324ee3[_0x538a90]={'$like':'%'+_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0x7f')]+'%'};return _0x324ee3;})});}if(_0x1ebf36['query'][_0x4f7b('0xba')]){var _0x6bc143=_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0xba')]['split'](',');var _0x229f83={};_0x229f83[_0x6bc143[0x0]]={'$gte':moment(_0x6bc143[0x1])['format'](_0x4f7b('0xbb'))};_0x5556b4[_0x4f7b('0x76')]=_[_0x4f7b('0x98')](_0x5556b4[_0x4f7b('0x76')],_0x229f83);}_0x5556b4=_[_0x4f7b('0x98')]({},_0x5556b4,_0x1ebf36[_0x4f7b('0xaf')]);return db[_0x4f7b('0xb4')][_0x4f7b('0x20')]({'where':_0x5556b4[_0x4f7b('0x76')]})[_0x4f7b('0x28')](function(_0x49c895){_0x5d8ca3[_0x4f7b('0x20')]=_0x49c895;if(_0x1ebf36[_0x4f7b('0x3d')][_0x4f7b('0xad')]){_0x5556b4[_0x4f7b('0xae')]=[{'all':!![]}];}return db[_0x4f7b('0xb4')][_0x4f7b('0xbc')](_0x5556b4);})['then'](function(_0x5561cb){_0x5d8ca3['rows']=_0x5561cb;return _0x5d8ca3;});}})[_0x4f7b('0x28')](respondWithFilteredResult(_0x4daeb1,_0x5556b4))['catch'](handleError(_0x4daeb1,null));};exports[_0x4f7b('0xbd')]=function(_0x4a3b05,_0x2be648,_0xf8c00){return db[_0x4f7b('0x37')][_0x4f7b('0x60')]({'where':{'id':_0x4a3b05['params']['id']}})['then'](handleEntityNotFound(_0x2be648,null))[_0x4f7b('0x28')](function(_0x3c6a13){if(_0x3c6a13){return _0x3c6a13['setTags'](_0x4a3b05['body'][_0x4f7b('0xb5')],_['omit'](_0x4a3b05[_0x4f7b('0x71')],['ids','id'])||{})[_0x4f7b('0xbe')](function(){return db[_0x4f7b('0x6d')][_0x4f7b('0xbc')]({'attributes':['id',_0x4f7b('0x2c'),_0x4f7b('0x48')],'where':{'id':_0x4a3b05[_0x4f7b('0x71')][_0x4f7b('0xb5')]}});})[_0x4f7b('0x28')](function(_0x2f0957){socket[_0x4f7b('0xbf')](_0x4f7b('0xc0'),{'id':Number(_0x4a3b05['params']['id']),'tags':_0x2f0957||[]});return{'id':Number(_0x4a3b05[_0x4f7b('0xb1')]['id']),'tags':_0x2f0957||[]};});}})['then'](respondWithResult(_0x2be648,null))[_0x4f7b('0x35')](handleError(_0x2be648,null));};exports[_0x4f7b('0xc1')]=function(_0x2718c3,_0x1445e4,_0xa64f51){return db['FaxInteraction']['find']({'where':{'id':_0x2718c3[_0x4f7b('0xb1')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x1445e4,null))['then'](function(_0x46f440){if(_0x46f440){return _0x46f440[_0x4f7b('0xc1')](_0x2718c3[_0x4f7b('0x3d')][_0x4f7b('0xb5')]);}})[_0x4f7b('0x28')](respondWithStatusCode(_0x1445e4,null))['catch'](handleError(_0x1445e4,null));};exports[_0x4f7b('0xc2')]=function(_0x240dec,_0x137d9f){var _0xdb78d=moment()[_0x4f7b('0xc3')]()[_0x4f7b('0x96')]();var _0x2d5b9e=path[_0x4f7b('0xc4')](config['root'],_0x4f7b('0xc5'),'files',_0x4f7b('0xc6'));var _0x2fb00f=path['join'](config[_0x4f7b('0xc7')],_0x4f7b('0xc5'),_0x4f7b('0xc8'),_0x4f7b('0xc9'));var _0x20d1b8=path[_0x4f7b('0xc4')](_0x2d5b9e,_0xdb78d);var _0x382592=util[_0x4f7b('0xca')]('transcript-%d-%s.zip',_0x240dec[_0x4f7b('0xb1')]['id'],_0xdb78d);var _0x2480ab=path[_0x4f7b('0xc4')](_0x2d5b9e,_0x382592);var _0x535beb=[];_0x535beb[_0x4f7b('0x34')]({'model':db[_0x4f7b('0xcb')],'as':_0x4f7b('0xcb'),'raw':!![]});var _0x4dfd83=[{'model':db[_0x4f7b('0xb4')],'as':_0x4f7b('0xcc'),'attributes':['id',_0x4f7b('0x71'),'createdAt'],'include':_0x535beb}];return db[_0x4f7b('0x37')]['find']({'where':{'id':_0x240dec[_0x4f7b('0xb1')]['id']},'include':_0x4dfd83})[_0x4f7b('0x28')](handleEntityNotFound(_0x137d9f,null))[_0x4f7b('0x28')](function(_0x3da29a){if(_0x3da29a&&_0x3da29a[_0x4f7b('0xcc')]){var _0x5c8b8c=_0x3da29a['get']({'plain':!![]});fs[_0x4f7b('0xcd')](_0x20d1b8);for(var _0x2a6753=0x0;_0x2a6753<_0x5c8b8c[_0x4f7b('0xcc')]['length'];_0x2a6753++){var _0x5719f2=_0x5c8b8c[_0x4f7b('0xcc')][_0x2a6753]['Attachment'];if(_0x5719f2){var _0x17c0c6=path[_0x4f7b('0xc4')](_0x2fb00f,_0x5719f2['basename']);if(fs[_0x4f7b('0xce')](_0x17c0c6)){fs['createReadStream'](_0x17c0c6)[_0x4f7b('0xcf')](fs[_0x4f7b('0xd0')](path[_0x4f7b('0xc4')](_0x20d1b8,_0x5719f2[_0x4f7b('0xd1')])));}}}return BPromise['resolve']()[_0x4f7b('0x28')](function(){return new BPromise(function(_0x23add2,_0x13104a){zipdir(_0x20d1b8,{'saveTo':_0x2480ab},function(_0x133729,_0xf4a51f){if(_0x133729)return _0x13104a(_0x133729);return _0x23add2(_0xf4a51f);});})[_0x4f7b('0x28')](function(){return new BPromise(function(_0x3b2709,_0x5a7fc5){rimraf(_0x20d1b8,function(_0x17177a){if(_0x17177a)_0x5a7fc5(_0x17177a);return _0x3b2709();});});})[_0x4f7b('0x28')](function(){return _0x137d9f[_0x4f7b('0xc2')](_0x2480ab,_0x382592,function(_0x560214){if(_0x560214){console[_0x4f7b('0xd2')](_0x4f7b('0xd3'),_0x560214);}else{fs['unlinkSync'](_0x2480ab);}});});});}else{return _0x137d9f[_0x4f7b('0x1d')](0xc8);}})[_0x4f7b('0x35')](handleError(_0x137d9f,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d1775cf..1e41f74 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 _0x814b=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x38a3bb,_0x232557){var _0x5a519d=function(_0x182a8c){while(--_0x182a8c){_0x38a3bb['push'](_0x38a3bb['shift']());}};_0x5a519d(++_0x232557);}(_0x814b,0x1a2));var _0xb814=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x814b[_0x4b7895];return _0x264180;};'use strict';var EventEmitter=require(_0xb814('0x0'));var FaxInteraction=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var FaxMessage=require(_0xb814('0x1'))['db'][_0xb814('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb814('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb814('0x5'),'afterDestroy':_0xb814('0x6')};function emitEvent(_0x258866){return function(_0x4237bc,_0x44931c,_0x322a70){_0x4237bc['getUsers']({'attributes':['id'],'raw':!![]})[_0xb814('0x7')](function(_0x2e6272){_0x4237bc['setDataValue'](_0xb814('0x8'),_0x2e6272[_0xb814('0x9')](function(_0x186d5a){return{'id':_0x186d5a['id']};}));return FaxMessage[_0xb814('0xa')]({'where':{'FaxInteractionId':_0x4237bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb814('0x7')](function(_0x21d4a5){_0x4237bc[_0xb814('0xb')](_0xb814('0xc'),_0x21d4a5[_0xb814('0xd')]);FaxInteractionEvents[_0xb814('0xe')](_0x258866+':'+_0x4237bc['id'],_0x4237bc);FaxInteractionEvents[_0xb814('0xe')](_0x258866,_0x4237bc);_0x322a70(null);})['catch'](_0x322a70(null));};}for(var e in events){if(events[_0xb814('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb814('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x110763,_0x2f808e){var _0x2420ff=function(_0x5839ca){while(--_0x5839ca){_0x110763['push'](_0x110763['shift']());}};_0x2420ff(++_0x2f808e);}(_0x7a54,0x106));var _0x47a5=function(_0x4e30ba,_0x4e0409){_0x4e30ba=_0x4e30ba-0x0;var _0xcda3f3=_0x7a54[_0x4e30ba];return _0xcda3f3;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 44d6b44..e895491 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','FaxInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x50d7cc,_0x59b2a2){var _0x1852ff=function(_0x58e021){while(--_0x58e021){_0x50d7cc['push'](_0x50d7cc['shift']());}};_0x1852ff(++_0x59b2a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x554b0e,_0x4d1fa3){var _0x3bdaa9=function(_0x1a7183){while(--_0x1a7183){_0x554b0e['push'](_0x554b0e['shift']());}};_0x3bdaa9(++_0x4d1fa3);}(_0xb903,0x185));var _0x3b90=function(_0x255e17,_0x51b9ab){_0x255e17=_0x255e17-0x0;var _0x1d12e7=_0xb903[_0x255e17];return _0x1d12e7;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('FaxInteraction',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e4c06,_0x42efe8,_0x1b1fbf){if(_0x2e4c06['changed']('closed')){_0x2e4c06['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1b1fbf(null,_0x2e4c06);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 3ff482b..4d4b513 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 _0x9b17=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x5cf55b,_0x4c3b75){var _0x59917b=function(_0x135f28){while(--_0x135f28){_0x5cf55b['push'](_0x5cf55b['shift']());}};_0x59917b(++_0x4c3b75);}(_0x9b17,0xc2));var _0x79b1=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x9b17[_0x56d1b7];return _0x184d91;};'use strict';var _=require(_0x79b1('0x0'));var util=require(_0x79b1('0x1'));var moment=require('moment');var BPromise=require(_0x79b1('0x2'));var rs=require(_0x79b1('0x3'));var fs=require('fs');var Redis=require(_0x79b1('0x4'));var db=require(_0x79b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x79b1('0x6'))(_0x79b1('0x7'));var config=require(_0x79b1('0x8'));var jayson=require(_0x79b1('0x9'));var client=jayson['client'][_0x79b1('0xa')]({'port':0x232a});config['redis']=_[_0x79b1('0xb')](config[_0x79b1('0xc')],{'host':_0x79b1('0xd'),'port':0x18eb});var socket=require(_0x79b1('0xe'))(new Redis(config[_0x79b1('0xc')]));require(_0x79b1('0xf'))[_0x79b1('0x10')](socket);function respondWithRpcPromise(_0x4d45b0,_0xa7682b,_0x5c9e65){return new BPromise(function(_0xdf1237,_0x1b03c7){return client[_0x79b1('0x11')](_0x4d45b0,_0x5c9e65)[_0x79b1('0x12')](function(_0x126558){logger[_0x79b1('0x13')](_0x79b1('0x14'),_0xa7682b,_0x79b1('0x15'));logger[_0x79b1('0x16')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xa7682b,_0x79b1('0x15'),JSON['stringify'](_0x126558));if(_0x126558[_0x79b1('0x17')]){if(_0x126558[_0x79b1('0x17')]['code']===0x1f4){logger[_0x79b1('0x17')](_0x79b1('0x14'),_0xa7682b,_0x126558['error']['message']);return _0x1b03c7(_0x126558['error'][_0x79b1('0x18')]);}logger[_0x79b1('0x17')](_0x79b1('0x14'),_0xa7682b,_0x126558[_0x79b1('0x17')][_0x79b1('0x18')]);return _0xdf1237(_0x126558[_0x79b1('0x17')]['message']);}else{logger[_0x79b1('0x13')](_0x79b1('0x14'),_0xa7682b,'request\x20sent');_0xdf1237(_0x126558['result'][_0x79b1('0x18')]);}})[_0x79b1('0x19')](function(_0x1d7d3b){logger['error'](_0x79b1('0x14'),_0xa7682b,_0x1d7d3b);_0x1b03c7(_0x1d7d3b);});});}exports[_0x79b1('0x1a')]=function(_0x182359){var _0xcb2107=this;return new Promise(function(_0x512722,_0x50984b){return db[_0x79b1('0x1b')][_0x79b1('0x1c')](_0x182359['body'],{'raw':_0x182359[_0x79b1('0x1d')]?_0x182359[_0x79b1('0x1d')][_0x79b1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x182359[_0x79b1('0x1d')]?_0x182359[_0x79b1('0x1d')][_0x79b1('0x1f')]||null:null,'attributes':_0x182359[_0x79b1('0x1d')]?_0x182359[_0x79b1('0x1d')][_0x79b1('0x20')]||null:null,'limit':_0x182359[_0x79b1('0x1d')]?_0x182359['options'][_0x79b1('0x21')]||null:null})[_0x79b1('0x12')](function(_0x48b2f4){logger[_0x79b1('0x13')](_0x79b1('0x1a'),_0x182359);logger[_0x79b1('0x16')]('UpdateFaxInteraction',_0x182359,JSON[_0x79b1('0x22')](_0x48b2f4));_0x512722(_0x48b2f4);})[_0x79b1('0x19')](function(_0x63136b){logger[_0x79b1('0x17')](_0x79b1('0x1a'),_0x63136b[_0x79b1('0x18')],_0x182359);_0x50984b(_0xcb2107[_0x79b1('0x17')](0x1f4,_0x63136b[_0x79b1('0x18')]));});});};exports[_0x79b1('0x23')]=function(_0x55f7fc){return new Promise(function(_0x4da92d,_0xbcba70){return db[_0x79b1('0x1b')][_0x79b1('0x24')]({'where':_0x55f7fc[_0x79b1('0x1d')]?_0x55f7fc[_0x79b1('0x1d')][_0x79b1('0x1f')]||null:null})[_0x79b1('0x12')](function(_0x478ee2){if(_0x478ee2){return _0x478ee2[_0x79b1('0x25')](_0x55f7fc['body'][_0x79b1('0x26')],_[_0x79b1('0x27')](_0x55f7fc['body'],[_0x79b1('0x26'),'id'])||{});}})[_0x79b1('0x28')](function(_0x15b883){logger[_0x79b1('0x13')](_0x79b1('0x29'),_0x55f7fc);logger[_0x79b1('0x16')]('AddTags',_0x55f7fc,JSON[_0x79b1('0x22')](_0x15b883));_0x4da92d(_0x15b883);})[_0x79b1('0x19')](function(_0x257122){logger[_0x79b1('0x17')](_0x79b1('0x29'),_0x257122[_0x79b1('0x18')],_0x55f7fc);_0xbcba70(_this[_0x79b1('0x17')](0x1f4,_0x257122[_0x79b1('0x18')]));});});}; \ No newline at end of file +var _0xa5d5=['raw','attributes','UpdateFaxInteraction','AddTagsToFaxInteraction','find','where','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxInteraction','update','options'];(function(_0x1653b1,_0x35b7d1){var _0x3e0b17=function(_0x5f21fc){while(--_0x5f21fc){_0x1653b1['push'](_0x1653b1['shift']());}};_0x3e0b17(++_0x35b7d1);}(_0xa5d5,0xb3));var _0x5a5d=function(_0x312de7,_0x44f7c7){_0x312de7=_0x312de7-0x0;var _0x5889a2=_0xa5d5[_0x312de7];return _0x5889a2;};'use strict';var _=require(_0x5a5d('0x0'));var util=require(_0x5a5d('0x1'));var moment=require(_0x5a5d('0x2'));var BPromise=require(_0x5a5d('0x3'));var rs=require(_0x5a5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a5d('0x5'))['db'];var utils=require(_0x5a5d('0x6'));var logger=require(_0x5a5d('0x7'))(_0x5a5d('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a5d('0x9'));var client=jayson['client'][_0x5a5d('0xa')]({'port':0x232a});config[_0x5a5d('0xb')]=_[_0x5a5d('0xc')](config[_0x5a5d('0xb')],{'host':_0x5a5d('0xd'),'port':0x18eb});var socket=require(_0x5a5d('0xe'))(new Redis(config[_0x5a5d('0xb')]));require('./faxInteraction.socket')[_0x5a5d('0xf')](socket);function respondWithRpcPromise(_0x5ac8e4,_0x281a66,_0xbb11f0){return new BPromise(function(_0x417719,_0xf6256a){return client[_0x5a5d('0x10')](_0x5ac8e4,_0xbb11f0)[_0x5a5d('0x11')](function(_0x4416f1){logger[_0x5a5d('0x12')](_0x5a5d('0x13'),_0x281a66,_0x5a5d('0x14'));logger['debug'](_0x5a5d('0x15'),_0x281a66,_0x5a5d('0x14'),JSON[_0x5a5d('0x16')](_0x4416f1));if(_0x4416f1[_0x5a5d('0x17')]){if(_0x4416f1[_0x5a5d('0x17')][_0x5a5d('0x18')]===0x1f4){logger['error'](_0x5a5d('0x13'),_0x281a66,_0x4416f1[_0x5a5d('0x17')][_0x5a5d('0x19')]);return _0xf6256a(_0x4416f1[_0x5a5d('0x17')][_0x5a5d('0x19')]);}logger[_0x5a5d('0x17')](_0x5a5d('0x13'),_0x281a66,_0x4416f1[_0x5a5d('0x17')][_0x5a5d('0x19')]);return _0x417719(_0x4416f1[_0x5a5d('0x17')][_0x5a5d('0x19')]);}else{logger[_0x5a5d('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x281a66,'request\x20sent');_0x417719(_0x4416f1[_0x5a5d('0x1a')]['message']);}})[_0x5a5d('0x1b')](function(_0x541bf8){logger[_0x5a5d('0x17')](_0x5a5d('0x13'),_0x281a66,_0x541bf8);_0xf6256a(_0x541bf8);});});}exports['UpdateFaxInteraction']=function(_0x2fb912){var _0x62052f=this;return new Promise(function(_0x22cc96,_0x2966e1){return db[_0x5a5d('0x1c')][_0x5a5d('0x1d')](_0x2fb912['body'],{'raw':_0x2fb912[_0x5a5d('0x1e')]?_0x2fb912[_0x5a5d('0x1e')][_0x5a5d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fb912[_0x5a5d('0x1e')]?_0x2fb912[_0x5a5d('0x1e')]['where']||null:null,'attributes':_0x2fb912[_0x5a5d('0x1e')]?_0x2fb912[_0x5a5d('0x1e')][_0x5a5d('0x20')]||null:null,'limit':_0x2fb912[_0x5a5d('0x1e')]?_0x2fb912[_0x5a5d('0x1e')]['limit']||null:null})['then'](function(_0x15f914){logger[_0x5a5d('0x12')]('UpdateFaxInteraction',_0x2fb912);logger['debug']('UpdateFaxInteraction',_0x2fb912,JSON['stringify'](_0x15f914));_0x22cc96(_0x15f914);})['catch'](function(_0x118d46){logger[_0x5a5d('0x17')](_0x5a5d('0x21'),_0x118d46[_0x5a5d('0x19')],_0x2fb912);_0x2966e1(_0x62052f['error'](0x1f4,_0x118d46[_0x5a5d('0x19')]));});});};exports[_0x5a5d('0x22')]=function(_0x27e419){return new Promise(function(_0x3b6dda,_0x329ddb){return db['FaxInteraction'][_0x5a5d('0x23')]({'where':_0x27e419[_0x5a5d('0x1e')]?_0x27e419[_0x5a5d('0x1e')][_0x5a5d('0x24')]||null:null})[_0x5a5d('0x11')](function(_0x389269){if(_0x389269){return _0x389269[_0x5a5d('0x25')](_0x27e419[_0x5a5d('0x26')][_0x5a5d('0x27')],_['omit'](_0x27e419[_0x5a5d('0x26')],[_0x5a5d('0x27'),'id'])||{});}})[_0x5a5d('0x28')](function(_0x4d034b){logger[_0x5a5d('0x12')](_0x5a5d('0x29'),_0x27e419);logger['debug'](_0x5a5d('0x29'),_0x27e419,JSON[_0x5a5d('0x16')](_0x4d034b));_0x3b6dda(_0x4d034b);})[_0x5a5d('0x1b')](function(_0x37045a){logger[_0x5a5d('0x17')](_0x5a5d('0x29'),_0x37045a[_0x5a5d('0x19')],_0x27e419);_0x329ddb(_this['error'](0x1f4,_0x37045a[_0x5a5d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d1937c3..02b969a 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 _0xa6a7=['emit','faxInteraction:','save','remove','update'];(function(_0x455daa,_0x1f4085){var _0x21eae7=function(_0x20f9a0){while(--_0x20f9a0){_0x455daa['push'](_0x455daa['shift']());}};_0x21eae7(++_0x1f4085);}(_0xa6a7,0x1ce));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x7a6a('0x0'),_0x7a6a('0x1'),_0x7a6a('0x2')];function createListener(_0x3c071b,_0x508260){return function(_0x919d22){_0x508260[_0x7a6a('0x3')](_0x3c071b,_0x919d22);};}function removeListener(_0x220cb5,_0x3880f3){return function(){FaxInteractionEvents['removeListener'](_0x220cb5,_0x3880f3);};}exports['register']=function(_0x25f22b){for(var _0x2605f7=0x0,_0x4cbf95=events['length'];_0x2605f7<_0x4cbf95;_0x2605f7++){var _0x264c90=events[_0x2605f7];var _0x3ca017=createListener(_0x7a6a('0x4')+_0x264c90,_0x25f22b);FaxInteractionEvents['on'](_0x264c90,_0x3ca017);}}; \ No newline at end of file +var _0x5090=['emit','removeListener','register','length','faxInteraction:','save','remove'];(function(_0x125106,_0x1a5f5d){var _0xc1ffd5=function(_0x338ca5){while(--_0x338ca5){_0x125106['push'](_0x125106['shift']());}};_0xc1ffd5(++_0x1a5f5d);}(_0x5090,0x140));var _0x0509=function(_0xb777a5,_0xb478e9){_0xb777a5=_0xb777a5-0x0;var _0x38593f=_0x5090[_0xb777a5];return _0x38593f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0509('0x0'),_0x0509('0x1'),'update'];function createListener(_0x2b4d9e,_0x235f21){return function(_0x5940f6){_0x235f21[_0x0509('0x2')](_0x2b4d9e,_0x5940f6);};}function removeListener(_0x2ba8bc,_0x470118){return function(){FaxInteractionEvents[_0x0509('0x3')](_0x2ba8bc,_0x470118);};}exports[_0x0509('0x4')]=function(_0x4fb0d8){for(var _0x354fed=0x0,_0x5ca66b=events[_0x0509('0x5')];_0x354fed<_0x5ca66b;_0x354fed++){var _0x156c91=events[_0x354fed];var _0x1fcc82=createListener(_0x0509('0x6')+_0x156c91,_0x4fb0d8);FaxInteractionEvents['on'](_0x156c91,_0x1fcc82);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index f7bab4f..58d9606 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 _0x86a8=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x294b6,_0x2907ae){var _0x38bb97=function(_0x5aaa76){while(--_0x5aaa76){_0x294b6['push'](_0x294b6['shift']());}};_0x38bb97(++_0x2907ae);}(_0x86a8,0x1ae));var _0x886a=function(_0xa380d8,_0x306ca2){_0xa380d8=_0xa380d8-0x0;var _0x5b3ade=_0x86a8[_0xa380d8];return _0x5b3ade;};'use strict';var multer=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var path=require(_0x886a('0x2'));var timeout=require(_0x886a('0x3'));var express=require(_0x886a('0x4'));var router=express[_0x886a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x886a('0x6'));var config=require(_0x886a('0x7'));var controller=require('./faxInteraction.controller');router[_0x886a('0x8')]('/',auth[_0x886a('0x9')](),controller['index']);router[_0x886a('0x8')]('/describe',auth[_0x886a('0x9')](),controller['describe']);router[_0x886a('0x8')](_0x886a('0xa'),auth[_0x886a('0x9')](),controller[_0x886a('0xb')]);router[_0x886a('0x8')](_0x886a('0xc'),auth[_0x886a('0x9')](),controller[_0x886a('0xd')]);router[_0x886a('0x8')](_0x886a('0xe'),auth['isAuthenticated'](),controller[_0x886a('0xf')]);router[_0x886a('0x10')]('/',auth[_0x886a('0x9')](),controller[_0x886a('0x11')]);router['post'](_0x886a('0xc'),auth[_0x886a('0x9')](),controller[_0x886a('0x12')]);router[_0x886a('0x10')](_0x886a('0x13'),auth[_0x886a('0x9')](),interaction[_0x886a('0x14')](_0x886a('0x15'),_0x886a('0x16')),controller[_0x886a('0x17')]);router['put'](_0x886a('0xa'),auth[_0x886a('0x9')](),interaction[_0x886a('0x14')](_0x886a('0x15'),'faxinteraction:update'),controller[_0x886a('0x18')]);router[_0x886a('0x19')]('/:id',auth[_0x886a('0x9')](),interaction[_0x886a('0x14')]('fax',_0x886a('0x1a')),controller[_0x886a('0x1b')]);router[_0x886a('0x19')](_0x886a('0x13'),auth[_0x886a('0x9')](),controller['removeTags']);module[_0x886a('0x1c')]=router; \ No newline at end of file +var _0xdecb=['faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x1dcd54,_0x1406f7){var _0x1bff50=function(_0x3eb8e3){while(--_0x3eb8e3){_0x1dcd54['push'](_0x1dcd54['shift']());}};_0x1bff50(++_0x1406f7);}(_0xdecb,0xe2));var _0xbdec=function(_0x10338e,_0x2ca58e){_0x10338e=_0x10338e-0x0;var _0x3c1b5c=_0xdecb[_0x10338e];return _0x3c1b5c;};'use strict';var multer=require('multer');var util=require(_0xbdec('0x0'));var path=require(_0xbdec('0x1'));var timeout=require(_0xbdec('0x2'));var express=require('express');var router=express[_0xbdec('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbdec('0x4'));var config=require(_0xbdec('0x5'));var controller=require(_0xbdec('0x6'));router[_0xbdec('0x7')]('/',auth[_0xbdec('0x8')](),controller[_0xbdec('0x9')]);router[_0xbdec('0x7')]('/describe',auth[_0xbdec('0x8')](),controller[_0xbdec('0xa')]);router[_0xbdec('0x7')](_0xbdec('0xb'),auth[_0xbdec('0x8')](),controller[_0xbdec('0xc')]);router[_0xbdec('0x7')](_0xbdec('0xd'),auth['isAuthenticated'](),controller[_0xbdec('0xe')]);router[_0xbdec('0x7')](_0xbdec('0xf'),auth[_0xbdec('0x8')](),controller['download']);router[_0xbdec('0x10')]('/',auth[_0xbdec('0x8')](),controller[_0xbdec('0x11')]);router['post'](_0xbdec('0xd'),auth[_0xbdec('0x8')](),controller[_0xbdec('0x12')]);router[_0xbdec('0x10')](_0xbdec('0x13'),auth[_0xbdec('0x8')](),interaction[_0xbdec('0x14')](_0xbdec('0x15'),_0xbdec('0x16')),controller[_0xbdec('0x17')]);router[_0xbdec('0x18')](_0xbdec('0xb'),auth['isAuthenticated'](),interaction[_0xbdec('0x14')](_0xbdec('0x15'),_0xbdec('0x19')),controller[_0xbdec('0x1a')]);router[_0xbdec('0x1b')](_0xbdec('0xb'),auth[_0xbdec('0x8')](),interaction[_0xbdec('0x14')](_0xbdec('0x15'),'faxinteraction:destroy'),controller[_0xbdec('0x1c')]);router['delete']('/:id/tags',auth[_0xbdec('0x8')](),controller[_0xbdec('0x1d')]);module[_0xbdec('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index efd5dd5..9894f7f 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 _0x091d=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5d508d,_0x517349){var _0x41c8ae=function(_0x2b87cc){while(--_0x2b87cc){_0x5d508d['push'](_0x5d508d['shift']());}};_0x41c8ae(++_0x517349);}(_0x091d,0x77));var _0xd091=function(_0x2f2cbc,_0x2a8b5e){_0x2f2cbc=_0x2f2cbc-0x0;var _0x6c3238=_0x091d[_0x2f2cbc];return _0x6c3238;};'use strict';var Sequelize=require(_0xd091('0x0'));module['exports']={'body':{'type':Sequelize[_0xd091('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd091('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd091('0x3')]('in',_0xd091('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xd091('0x5')]}}; \ No newline at end of file +var _0x02a4=['DATE','BOOLEAN','ENUM','out'];(function(_0x336f2b,_0x3dedb5){var _0x77f69e=function(_0x33acd0){while(--_0x33acd0){_0x336f2b['push'](_0x336f2b['shift']());}};_0x77f69e(++_0x3dedb5);}(_0x02a4,0xd9));var _0x402a=function(_0x21a387,_0x2fcb26){_0x21a387=_0x21a387-0x0;var _0xb2e63c=_0x02a4[_0x21a387];return _0xb2e63c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x402a('0x0')],'defaultValue':![]},'direction':{'type':Sequelize[_0x402a('0x1')]('in',_0x402a('0x2')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x402a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 4073909..f3e94ad 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 _0xe861=['jayson/promise','client','http','Sequelize','ValidationError','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','name','send','index','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','FaxMessage','includeAll','findAll','rows','catch','rawAttributes','include','find','body','params','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','FaxInteraction','FaxInteractionId','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','fax-interactions','reject','agent','RejectMessage','rejectMessage','SIP/%s','create','findOne','ContactId','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','root','server','attachments','download','basename','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe861,0x1f3));var _0x1e86=function(_0x17d000,_0x104e8e){_0x17d000=_0x17d000-0x0;var _0x4d5cc9=_0xe861[_0x17d000];return _0x4d5cc9;};'use strict';var pdf=require(_0x1e86('0x0'));var emlformat=require(_0x1e86('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1e86('0x2'));var jsonpatch=require(_0x1e86('0x3'));var rp=require(_0x1e86('0x4'));var moment=require(_0x1e86('0x5'));var BPromise=require(_0x1e86('0x6'));var Mustache=require(_0x1e86('0x7'));var util=require(_0x1e86('0x8'));var path=require(_0x1e86('0x9'));var sox=require('sox');var csv=require(_0x1e86('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e86('0xb'));var squel=require(_0x1e86('0xc'));var crypto=require('crypto');var jsforce=require(_0x1e86('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1e86('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1e86('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1e86('0xf'));var hardwareService=require(_0x1e86('0x10'));var logger=require(_0x1e86('0x11'))('api');var utils=require(_0x1e86('0x12'));var config=require('../../config/environment');var db=require(_0x1e86('0x13'))['db'];config[_0x1e86('0x14')]=_[_0x1e86('0x15')](config[_0x1e86('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e86('0x16'))(new Redis(config[_0x1e86('0x14')]));require(_0x1e86('0x17'))[_0x1e86('0x18')](socket);var jayson=require(_0x1e86('0x19'));var client=jayson[_0x1e86('0x1a')][_0x1e86('0x1b')]({'port':0x232c});var client9002=jayson[_0x1e86('0x1a')][_0x1e86('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3f8aa5,_0x25e9fa,_0x2c96fe){if(_0x2c96fe){var _0x7bc1e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7bc1e8['test'](_0x25e9fa)){return _0x3f8aa5;}else{throw new db[(_0x1e86('0x1c'))][(_0x1e86('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 _0x3f8aa5;}}function respondWithRpcPromise(_0x32de7f,_0x227eb9,_0x51dea4,_0x507574){return new BPromise(function(_0x50e827,_0x161819){var _0x433ec4=_0x507574||client;return _0x433ec4[_0x1e86('0x1e')](_0x32de7f,_0x51dea4)['then'](function(_0x55b263){logger[_0x1e86('0x1f')](_0x1e86('0x20'),_0x227eb9,_0x1e86('0x21'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x227eb9,_0x1e86('0x21'),JSON[_0x1e86('0x22')](_0x55b263));if(_0x55b263[_0x1e86('0x23')]){if(_0x55b263[_0x1e86('0x23')]['code']===0x1f4){logger['error'](_0x1e86('0x20'),_0x227eb9,_0x55b263[_0x1e86('0x23')]['message']);return _0x161819(_0x55b263['error'][_0x1e86('0x24')]);}logger[_0x1e86('0x23')](_0x1e86('0x20'),_0x227eb9,_0x55b263[_0x1e86('0x23')][_0x1e86('0x24')]);return _0x50e827(_0x55b263[_0x1e86('0x23')][_0x1e86('0x24')]);}else{logger[_0x1e86('0x1f')](_0x1e86('0x20'),_0x227eb9,_0x1e86('0x21'));_0x50e827(_0x55b263[_0x1e86('0x25')][_0x1e86('0x24')]);}})['catch'](function(_0x2475c3){logger['error'](_0x1e86('0x20'),_0x227eb9,_0x2475c3);_0x161819(_0x2475c3);});});}function respondWithStatusCode(_0x3e7574,_0x540f81){_0x540f81=_0x540f81||0xcc;return function(_0x436ff6){if(_0x436ff6){return _0x3e7574[_0x1e86('0x26')](_0x540f81);}return _0x3e7574['status'](_0x540f81)['end']();};}function respondWithResult(_0x16b1ee,_0x1da9c4){_0x1da9c4=_0x1da9c4||0xc8;return function(_0x32ec70){if(_0x32ec70){return _0x16b1ee[_0x1e86('0x27')](_0x1da9c4)[_0x1e86('0x28')](_0x32ec70);}};}function respondWithFilteredResult(_0x2de231,_0x54dcc5){return function(_0x31745d){if(_0x31745d){var _0x3b4b1b=_0x31745d[_0x1e86('0x29')],_0x56bcc3=_0x54dcc5[_0x1e86('0x2a')],_0x1103bf=_0x54dcc5['offset']+_0x54dcc5[_0x1e86('0x2b')],_0x17645e;if(_0x1103bf>=_0x3b4b1b){_0x1103bf=_0x3b4b1b;_0x17645e=0xc8;}else{_0x17645e=0xce;}_0x2de231[_0x1e86('0x27')](_0x17645e);return _0x2de231[_0x1e86('0x2c')](_0x1e86('0x2d'),_0x56bcc3+'-'+_0x1103bf+'/'+_0x3b4b1b)['json'](_0x31745d);}return null;};}function patchUpdates(_0x9329c7){return function(_0x3d6627){try{jsonpatch[_0x1e86('0x2e')](_0x3d6627,_0x9329c7,!![]);}catch(_0x1a4dc1){return BPromise['reject'](_0x1a4dc1);}return _0x3d6627[_0x1e86('0x2f')]();};}function saveUpdates(_0x3d62bc,_0x2558c8){return function(_0x1c299d){if(_0x1c299d){return _0x1c299d[_0x1e86('0x30')](_0x3d62bc)[_0x1e86('0x31')](function(_0x5afb15){return _0x5afb15;});}return null;};}function removeEntity(_0x469560,_0xc9384a){return function(_0x1c3be0){if(_0x1c3be0){return _0x1c3be0[_0x1e86('0x32')]()[_0x1e86('0x31')](function(){_0x469560[_0x1e86('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e87ca,_0x55c575){return function(_0x420f66){if(!_0x420f66){_0x5e87ca[_0x1e86('0x26')](0x194);}return _0x420f66;};}function handleError(_0x307bb0,_0x2f4565){_0x2f4565=_0x2f4565||0x1f4;return function(_0x269130){logger['error'](_0x269130['stack']);if(_0x269130[_0x1e86('0x33')]){delete _0x269130[_0x1e86('0x33')];}_0x307bb0[_0x1e86('0x27')](_0x2f4565)[_0x1e86('0x34')](_0x269130);};}exports[_0x1e86('0x35')]=function(_0x13265a,_0x463b12){var _0x5c23b9={},_0x1126ee={},_0x4c04be={'count':0x0,'rows':[]};var _0x5a0a99=_['map'](db['FaxMessage']['rawAttributes'],function(_0x422b9f){return{'name':_0x422b9f[_0x1e86('0x36')],'type':_0x422b9f[_0x1e86('0x37')][_0x1e86('0x38')]};});_0x1126ee[_0x1e86('0x39')]=_[_0x1e86('0x3a')](_0x5a0a99,_0x1e86('0x33'));_0x1126ee['query']=_[_0x1e86('0x3b')](_0x13265a[_0x1e86('0x3c')]);_0x1126ee['filters']=_['intersection'](_0x1126ee[_0x1e86('0x39')],_0x1126ee['query']);_0x5c23b9[_0x1e86('0x3d')]=_[_0x1e86('0x3e')](_0x1126ee[_0x1e86('0x39')],qs[_0x1e86('0x3f')](_0x13265a['query'][_0x1e86('0x3f')]));_0x5c23b9[_0x1e86('0x3d')]=_0x5c23b9[_0x1e86('0x3d')][_0x1e86('0x40')]?_0x5c23b9[_0x1e86('0x3d')]:_0x1126ee[_0x1e86('0x39')];if(!_0x13265a['query'][_0x1e86('0x41')]('nolimit')){_0x5c23b9['limit']=qs[_0x1e86('0x2b')](_0x13265a[_0x1e86('0x3c')][_0x1e86('0x2b')]);_0x5c23b9[_0x1e86('0x2a')]=qs[_0x1e86('0x2a')](_0x13265a[_0x1e86('0x3c')][_0x1e86('0x2a')]);}_0x5c23b9[_0x1e86('0x42')]=qs[_0x1e86('0x43')](_0x13265a[_0x1e86('0x3c')]['sort']);_0x5c23b9[_0x1e86('0x44')]=qs[_0x1e86('0x45')](_[_0x1e86('0x46')](_0x13265a['query'],_0x1126ee['filters']),_0x5a0a99);if(_0x13265a[_0x1e86('0x3c')]['filter']){_0x5c23b9['where']=_['merge'](_0x5c23b9[_0x1e86('0x44')],{'$or':_['map'](_0x5a0a99,function(_0x5c9b21){if(_0x5c9b21[_0x1e86('0x37')]!==_0x1e86('0x47')){var _0xd6e2a7={};_0xd6e2a7[_0x5c9b21['name']]={'$like':'%'+_0x13265a[_0x1e86('0x3c')][_0x1e86('0x48')]+'%'};return _0xd6e2a7;}})});}_0x5c23b9=_[_0x1e86('0x49')]({},_0x5c23b9,_0x13265a[_0x1e86('0x4a')]);var _0x3855a2={'where':_0x5c23b9[_0x1e86('0x44')]};return db[_0x1e86('0x4b')][_0x1e86('0x29')](_0x3855a2)[_0x1e86('0x31')](function(_0x3d2ba7){_0x4c04be['count']=_0x3d2ba7;if(_0x13265a[_0x1e86('0x3c')][_0x1e86('0x4c')]){_0x5c23b9['include']=[{'all':!![]}];}return db[_0x1e86('0x4b')][_0x1e86('0x4d')](_0x5c23b9);})[_0x1e86('0x31')](function(_0x50b029){_0x4c04be[_0x1e86('0x4e')]=_0x50b029;return _0x4c04be;})[_0x1e86('0x31')](respondWithFilteredResult(_0x463b12,_0x5c23b9))[_0x1e86('0x4f')](handleError(_0x463b12,null));};exports['show']=function(_0x235bbe,_0x1d79d4){var _0x242d3c={'raw':!![],'where':{'id':_0x235bbe['params']['id']}},_0xc3beac={};_0xc3beac['model']=_['keys'](db[_0x1e86('0x4b')][_0x1e86('0x50')]);_0xc3beac[_0x1e86('0x3c')]=_[_0x1e86('0x3b')](_0x235bbe['query']);_0xc3beac[_0x1e86('0x45')]=_['intersection'](_0xc3beac[_0x1e86('0x39')],_0xc3beac[_0x1e86('0x3c')]);_0x242d3c['attributes']=_[_0x1e86('0x3e')](_0xc3beac[_0x1e86('0x39')],qs[_0x1e86('0x3f')](_0x235bbe[_0x1e86('0x3c')][_0x1e86('0x3f')]));_0x242d3c['attributes']=_0x242d3c[_0x1e86('0x3d')][_0x1e86('0x40')]?_0x242d3c[_0x1e86('0x3d')]:_0xc3beac[_0x1e86('0x39')];if(_0x235bbe['query'][_0x1e86('0x4c')]){_0x242d3c[_0x1e86('0x51')]=[{'all':!![]}];}_0x242d3c=_[_0x1e86('0x49')]({},_0x242d3c,_0x235bbe[_0x1e86('0x4a')]);return db[_0x1e86('0x4b')][_0x1e86('0x52')](_0x242d3c)[_0x1e86('0x31')](handleEntityNotFound(_0x1d79d4,null))[_0x1e86('0x31')](respondWithResult(_0x1d79d4,null))['catch'](handleError(_0x1d79d4,null));};exports[_0x1e86('0x30')]=function(_0x1162ca,_0x51cb95){if(_0x1162ca[_0x1e86('0x53')]['id']){delete _0x1162ca['body']['id'];}return db[_0x1e86('0x4b')][_0x1e86('0x52')]({'where':{'id':_0x1162ca[_0x1e86('0x54')]['id']}})[_0x1e86('0x31')](handleEntityNotFound(_0x51cb95,null))[_0x1e86('0x31')](saveUpdates(_0x1162ca[_0x1e86('0x53')],null))[_0x1e86('0x31')](respondWithResult(_0x51cb95,null))[_0x1e86('0x4f')](handleError(_0x51cb95,null));};exports[_0x1e86('0x32')]=function(_0x215c69,_0xf13028){return db['FaxMessage'][_0x1e86('0x52')]({'where':{'id':_0x215c69[_0x1e86('0x54')]['id']}})[_0x1e86('0x31')](handleEntityNotFound(_0xf13028,null))['then'](removeEntity(_0xf13028,null))[_0x1e86('0x4f')](handleError(_0xf13028,null));};exports['describe']=function(_0x582b68,_0x4cf7c7){return db[_0x1e86('0x4b')][_0x1e86('0x55')]()['then'](respondWithResult(_0x4cf7c7,null))['catch'](handleError(_0x4cf7c7,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x2fc25a,_0x95601a,_0x2ef2a2){var _0x51b22f={'channel':_0x1e86('0x56')};if(_0x2fc25a[_0x1e86('0x53')]['id']){delete _0x2fc25a[_0x1e86('0x53')]['id'];}_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x57')]=!![];_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x58')]=moment()[_0x1e86('0x59')](_0x1e86('0x5a'));_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x5b')]=_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x5b')]||_0x2fc25a[_0x1e86('0x5c')]['id'];return db[_0x1e86('0x4b')][_0x1e86('0x52')]({'where':{'id':_0x2fc25a[_0x1e86('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x1e86('0x5d')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x95601a,null))[_0x1e86('0x31')](saveUpdates(_0x2fc25a['body'],null))[_0x1e86('0x31')](function(_0x439b64){if(_0x439b64){_0x51b22f[_0x1e86('0x24')]=_0x439b64['get']({'plain':!![]});return db[_0x1e86('0x5e')]['find']({'where':{'id':_0x439b64[_0x1e86('0x5f')]}});}return null;})[_0x1e86('0x31')](handleEntityNotFound(_0x95601a,null))[_0x1e86('0x31')](function(_0xa3061d){if(_0xa3061d){return _0xa3061d[_0x1e86('0x30')]({'UserId':_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x5b')],'read1stAt':_['isNil'](_0xa3061d[_0x1e86('0x60')])?moment()[_0x1e86('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x511e9b){if(_0x511e9b){_0x51b22f['interaction']=_0x511e9b[_0x1e86('0x61')]({'plain':!![]});interaction_log['info'](_0x1e86('0x62'),_0x2fc25a[_0x1e86('0x5c')]['id'],_0x2fc25a[_0x1e86('0x5c')][_0x1e86('0x33')],_0x2fc25a[_0x1e86('0x5c')][_0x1e86('0x63')],_0x51b22f[_0x1e86('0x64')]['id'],_0x2fc25a[_0x1e86('0x53')]?JSON[_0x1e86('0x22')](_0x2fc25a[_0x1e86('0x53')]):_0x1e86('0x65'));return respondWithRpcPromise('AcceptMessage',_0x1e86('0x66'),_0x51b22f);}return null;})[_0x1e86('0x31')](function(_0x2a5575){if(_0x2a5575){if(_0x2fc25a[_0x1e86('0x53')][_0x1e86('0x67')]){_0x51b22f[_0x1e86('0x24')][_0x1e86('0x68')]=util[_0x1e86('0x59')]('SIP/%s',_0x2fc25a[_0x1e86('0x5c')][_0x1e86('0x33')]);_0x51b22f[_0x1e86('0x24')][_0x1e86('0x69')]=_0x51b22f['channel'];_0x51b22f[_0x1e86('0x24')][_0x1e86('0x6a')]=_0x1e86('0x6b');return respondWithRpcPromise(_0x1e86('0x6c'),_0x1e86('0x6c'),{'event':_0x1e86('0x6d'),'message':_0x51b22f[_0x1e86('0x24')]},client9002)[_0x1e86('0x31')](function(){return _0x51b22f;});}return _0x51b22f;}return null;})['then'](respondWithResult(_0x95601a,null))[_0x1e86('0x4f')](handleError(_0x95601a,null));};var interaction_log=require('../../config/logger')(_0x1e86('0x6e'));exports[_0x1e86('0x6f')]=function(_0x22e94f,_0x396f27,_0xaee588){var _0x342956={'agent':{},'channel':_0x1e86('0x56')};if(_0x22e94f[_0x1e86('0x53')]['id']){delete _0x22e94f[_0x1e86('0x53')]['id'];}_0x22e94f[_0x1e86('0x53')][_0x1e86('0x5b')]=_0x22e94f[_0x1e86('0x53')][_0x1e86('0x5b')]||_0x22e94f['user']['id'];_0x342956[_0x1e86('0x70')]['id']=_0x22e94f['body']['UserId'];return db['FaxMessage'][_0x1e86('0x52')]({'where':{'id':_0x22e94f['params']['id'],'UserId':null}})[_0x1e86('0x31')](handleEntityNotFound(_0x396f27,null))[_0x1e86('0x31')](function(_0x1b1d0c){if(_0x1b1d0c){_0x342956[_0x1e86('0x24')]=_0x1b1d0c[_0x1e86('0x61')]({'plain':!![]});return db[_0x1e86('0x5e')][_0x1e86('0x52')]({'where':{'id':_0x1b1d0c[_0x1e86('0x5f')]}});}return null;})[_0x1e86('0x31')](handleEntityNotFound(_0x396f27,null))['then'](function(_0x53af97){if(_0x53af97){_0x342956[_0x1e86('0x64')]=_0x53af97[_0x1e86('0x61')]({'plain':!![]});interaction_log[_0x1e86('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x22e94f[_0x1e86('0x5c')]['id'],_0x22e94f[_0x1e86('0x5c')][_0x1e86('0x33')],_0x22e94f['user'][_0x1e86('0x63')],_0x342956['interaction']['id'],_0x22e94f[_0x1e86('0x53')]?JSON[_0x1e86('0x22')](_0x22e94f[_0x1e86('0x53')]):_0x1e86('0x65'));return respondWithRpcPromise(_0x1e86('0x71'),_0x1e86('0x72'),_0x342956);}return null;})[_0x1e86('0x31')](function(_0x18e522){if(_0x18e522){_0x18e522[_0x1e86('0x24')][_0x1e86('0x68')]=util[_0x1e86('0x59')](_0x1e86('0x73'),_0x22e94f['user'][_0x1e86('0x33')]);_0x18e522[_0x1e86('0x24')][_0x1e86('0x69')]=_0x342956['channel'];_0x18e522[_0x1e86('0x24')]['event']=_0x1e86('0x6f');respondWithRpcPromise('EventManager',_0x1e86('0x6c'),{'event':'rejectmessage','message':_0x18e522[_0x1e86('0x24')]},client9002);return _0x342956;}return null;})[_0x1e86('0x31')](respondWithResult(_0x396f27,null))[_0x1e86('0x4f')](handleError(_0x396f27,null));};exports['create']=function(_0x2e84d2,_0x359320){var _0x4ae3ae;return db[_0x1e86('0x4b')][_0x1e86('0x74')](_0x2e84d2['body'],{})[_0x1e86('0x31')](function(_0x28242f){_0x4ae3ae=_0x28242f;return db[_0x1e86('0x5d')][_0x1e86('0x75')]({'where':{'id':_0x4ae3ae[_0x1e86('0x76')]}});})[_0x1e86('0x31')](function(_0x5ea923){if(_[_0x1e86('0x77')](_0x5ea923)){return;}else{_0x4ae3ae[_0x1e86('0x56')]=_0x5ea923[_0x1e86('0x56')];return db[_0x1e86('0x78')][_0x1e86('0x75')]({'where':{'id':_0x4ae3ae[_0x1e86('0x79')]}});}})['then'](function(_0x324973){return respondWithRpcPromise('SendFax',_0x1e86('0x7a'),{'FaxAccountId':_[_0x1e86('0x77')](_0x2e84d2['body'])?undefined:_0x2e84d2[_0x1e86('0x53')][_0x1e86('0x7b')],'path':_['isNil'](_0x324973)?undefined:util['format'](_0x1e86('0x7c'),_0x324973['basename']),'fax':_[_0x1e86('0x77')](_0x4ae3ae[_0x1e86('0x56')])?undefined:_0x4ae3ae[_0x1e86('0x56')],'AttachmentId':_0x4ae3ae[_0x1e86('0x79')]},client9002);})[_0x1e86('0x31')](respondWithResult(_0x359320,0xc9))[_0x1e86('0x4f')](handleError(_0x359320,null));};exports['download']=function(_0x12e975,_0x28d88b){var _0x578660=path[_0x1e86('0x7d')](config[_0x1e86('0x7e')],_0x1e86('0x7f'),'files',_0x1e86('0x80'));return db[_0x1e86('0x4b')]['find']({'where':{'id':_0x12e975[_0x1e86('0x54')]['id']},'include':[{'model':db[_0x1e86('0x78')],'as':_0x1e86('0x78')}]})[_0x1e86('0x31')](handleEntityNotFound(_0x28d88b,null))[_0x1e86('0x31')](function(_0x261fd8){if(_0x261fd8){return _0x28d88b[_0x1e86('0x81')](path[_0x1e86('0x7d')](_0x578660,_0x261fd8[_0x1e86('0x78')][_0x1e86('0x82')]));}})['catch'](handleError(_0x28d88b,null));}; \ No newline at end of file +var _0xfacf=['redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','end','stack','name','send','index','FaxMessage','rawAttributes','type','model','map','query','attributes','intersection','length','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','params','keys','fields','includeAll','find','body','destroy','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','create','ContactId','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','basename','join','server','files','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1ccffc,_0xd63d4c){var _0x109f78=function(_0x28bfbe){while(--_0x28bfbe){_0x1ccffc['push'](_0x1ccffc['shift']());}};_0x109f78(++_0xd63d4c);}(_0xfacf,0x6a));var _0xffac=function(_0x9d1de4,_0xb02c28){_0x9d1de4=_0x9d1de4-0x0;var _0x5efe45=_0xfacf[_0x9d1de4];return _0x5efe45;};'use strict';var pdf=require(_0xffac('0x0'));var emlformat=require(_0xffac('0x1'));var rimraf=require(_0xffac('0x2'));var zipdir=require(_0xffac('0x3'));var jsonpatch=require(_0xffac('0x4'));var rp=require(_0xffac('0x5'));var moment=require('moment');var BPromise=require(_0xffac('0x6'));var Mustache=require(_0xffac('0x7'));var util=require(_0xffac('0x8'));var path=require('path');var sox=require(_0xffac('0x9'));var csv=require(_0xffac('0xa'));var ejs=require(_0xffac('0xb'));var fs=require('fs');var _=require(_0xffac('0xc'));var squel=require(_0xffac('0xd'));var crypto=require(_0xffac('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xffac('0xf'));var toCsv=require(_0xffac('0xa'));var querystring=require(_0xffac('0x10'));var Papa=require(_0xffac('0x11'));var Redis=require(_0xffac('0x12'));var authService=require(_0xffac('0x13'));var qs=require(_0xffac('0x14'));var as=require(_0xffac('0x15'));var hardwareService=require(_0xffac('0x16'));var logger=require(_0xffac('0x17'))('api');var utils=require(_0xffac('0x18'));var config=require(_0xffac('0x19'));var db=require(_0xffac('0x1a'))['db'];config[_0xffac('0x1b')]=_[_0xffac('0x1c')](config[_0xffac('0x1b')],{'host':_0xffac('0x1d'),'port':0x18eb});var socket=require(_0xffac('0x1e'))(new Redis(config['redis']));require(_0xffac('0x1f'))['register'](socket);var jayson=require(_0xffac('0x20'));var client=jayson[_0xffac('0x21')][_0xffac('0x22')]({'port':0x232c});var client9002=jayson[_0xffac('0x21')][_0xffac('0x22')]({'port':0x232a});function checkPasswordPattern(_0x3ae08d,_0x79c49a,_0xa2e3a7){if(_0xa2e3a7){var _0x1199dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1199dc['test'](_0x79c49a)){return _0x3ae08d;}else{throw new db[(_0xffac('0x23'))]['ValidationError'](_0xffac('0x24'));}}else{return _0x3ae08d;}}function respondWithRpcPromise(_0x1f28af,_0x742c7c,_0x53a691,_0x3b4192){return new BPromise(function(_0x51de82,_0x4e034a){var _0x1fabeb=_0x3b4192||client;return _0x1fabeb[_0xffac('0x25')](_0x1f28af,_0x53a691)['then'](function(_0x4d6ea7){logger[_0xffac('0x26')](_0xffac('0x27'),_0x742c7c,_0xffac('0x28'));logger[_0xffac('0x29')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x742c7c,_0xffac('0x28'),JSON[_0xffac('0x2a')](_0x4d6ea7));if(_0x4d6ea7[_0xffac('0x2b')]){if(_0x4d6ea7[_0xffac('0x2b')][_0xffac('0x2c')]===0x1f4){logger[_0xffac('0x2b')](_0xffac('0x27'),_0x742c7c,_0x4d6ea7[_0xffac('0x2b')][_0xffac('0x2d')]);return _0x4e034a(_0x4d6ea7[_0xffac('0x2b')][_0xffac('0x2d')]);}logger['error'](_0xffac('0x27'),_0x742c7c,_0x4d6ea7[_0xffac('0x2b')]['message']);return _0x51de82(_0x4d6ea7[_0xffac('0x2b')][_0xffac('0x2d')]);}else{logger[_0xffac('0x26')](_0xffac('0x27'),_0x742c7c,_0xffac('0x28'));_0x51de82(_0x4d6ea7['result'][_0xffac('0x2d')]);}})[_0xffac('0x2e')](function(_0x134c87){logger['error'](_0xffac('0x27'),_0x742c7c,_0x134c87);_0x4e034a(_0x134c87);});});}function respondWithStatusCode(_0x3d312c,_0x18b355){_0x18b355=_0x18b355||0xcc;return function(_0x349b72){if(_0x349b72){return _0x3d312c[_0xffac('0x2f')](_0x18b355);}return _0x3d312c[_0xffac('0x30')](_0x18b355)['end']();};}function respondWithResult(_0x5121e6,_0x2b1ef3){_0x2b1ef3=_0x2b1ef3||0xc8;return function(_0x4b520b){if(_0x4b520b){return _0x5121e6[_0xffac('0x30')](_0x2b1ef3)[_0xffac('0x31')](_0x4b520b);}};}function respondWithFilteredResult(_0x19c7f0,_0x5ed449){return function(_0x3d3bf9){if(_0x3d3bf9){var _0x67d3dd=_0x3d3bf9[_0xffac('0x32')],_0x46f4a8=_0x5ed449[_0xffac('0x33')],_0x5034df=_0x5ed449['offset']+_0x5ed449[_0xffac('0x34')],_0x13d4d9;if(_0x5034df>=_0x67d3dd){_0x5034df=_0x67d3dd;_0x13d4d9=0xc8;}else{_0x13d4d9=0xce;}_0x19c7f0[_0xffac('0x30')](_0x13d4d9);return _0x19c7f0[_0xffac('0x35')]('Content-Range',_0x46f4a8+'-'+_0x5034df+'/'+_0x67d3dd)[_0xffac('0x31')](_0x3d3bf9);}return null;};}function patchUpdates(_0x17706c){return function(_0x2afb25){try{jsonpatch[_0xffac('0x36')](_0x2afb25,_0x17706c,!![]);}catch(_0x196d81){return BPromise[_0xffac('0x37')](_0x196d81);}return _0x2afb25[_0xffac('0x38')]();};}function saveUpdates(_0x2f2040,_0x1c786b){return function(_0x318a5e){if(_0x318a5e){return _0x318a5e[_0xffac('0x39')](_0x2f2040)[_0xffac('0x3a')](function(_0x2e02ba){return _0x2e02ba;});}return null;};}function removeEntity(_0x4b845a,_0x69a994){return function(_0x3daeba){if(_0x3daeba){return _0x3daeba['destroy']()[_0xffac('0x3a')](function(){_0x4b845a[_0xffac('0x30')](0xcc)[_0xffac('0x3b')]();});}};}function handleEntityNotFound(_0x3eb8cc,_0x48b940){return function(_0x241018){if(!_0x241018){_0x3eb8cc['sendStatus'](0x194);}return _0x241018;};}function handleError(_0x17deca,_0x1794aa){_0x1794aa=_0x1794aa||0x1f4;return function(_0x21cf1e){logger['error'](_0x21cf1e[_0xffac('0x3c')]);if(_0x21cf1e[_0xffac('0x3d')]){delete _0x21cf1e[_0xffac('0x3d')];}_0x17deca['status'](_0x1794aa)[_0xffac('0x3e')](_0x21cf1e);};}exports[_0xffac('0x3f')]=function(_0x16ed6e,_0x3d802d){var _0x5ceb8f={},_0x550116={},_0x2ea828={'count':0x0,'rows':[]};var _0x13e276=_['map'](db[_0xffac('0x40')][_0xffac('0x41')],function(_0x21c96c){return{'name':_0x21c96c['fieldName'],'type':_0x21c96c[_0xffac('0x42')]['key']};});_0x550116[_0xffac('0x43')]=_[_0xffac('0x44')](_0x13e276,_0xffac('0x3d'));_0x550116[_0xffac('0x45')]=_['keys'](_0x16ed6e[_0xffac('0x45')]);_0x550116['filters']=_['intersection'](_0x550116['model'],_0x550116[_0xffac('0x45')]);_0x5ceb8f[_0xffac('0x46')]=_[_0xffac('0x47')](_0x550116[_0xffac('0x43')],qs['fields'](_0x16ed6e[_0xffac('0x45')]['fields']));_0x5ceb8f[_0xffac('0x46')]=_0x5ceb8f[_0xffac('0x46')][_0xffac('0x48')]?_0x5ceb8f['attributes']:_0x550116['model'];if(!_0x16ed6e[_0xffac('0x45')]['hasOwnProperty'](_0xffac('0x49'))){_0x5ceb8f['limit']=qs[_0xffac('0x34')](_0x16ed6e[_0xffac('0x45')][_0xffac('0x34')]);_0x5ceb8f[_0xffac('0x33')]=qs['offset'](_0x16ed6e[_0xffac('0x45')]['offset']);}_0x5ceb8f[_0xffac('0x4a')]=qs[_0xffac('0x4b')](_0x16ed6e[_0xffac('0x45')][_0xffac('0x4b')]);_0x5ceb8f['where']=qs[_0xffac('0x4c')](_[_0xffac('0x4d')](_0x16ed6e[_0xffac('0x45')],_0x550116[_0xffac('0x4c')]),_0x13e276);if(_0x16ed6e[_0xffac('0x45')][_0xffac('0x4e')]){_0x5ceb8f[_0xffac('0x4f')]=_[_0xffac('0x50')](_0x5ceb8f['where'],{'$or':_[_0xffac('0x44')](_0x13e276,function(_0x456044){if(_0x456044[_0xffac('0x42')]!=='VIRTUAL'){var _0x3bd5c6={};_0x3bd5c6[_0x456044[_0xffac('0x3d')]]={'$like':'%'+_0x16ed6e[_0xffac('0x45')][_0xffac('0x4e')]+'%'};return _0x3bd5c6;}})});}_0x5ceb8f=_[_0xffac('0x50')]({},_0x5ceb8f,_0x16ed6e[_0xffac('0x51')]);var _0x2fa91b={'where':_0x5ceb8f[_0xffac('0x4f')]};return db[_0xffac('0x40')][_0xffac('0x32')](_0x2fa91b)[_0xffac('0x3a')](function(_0x5d9adc){_0x2ea828[_0xffac('0x32')]=_0x5d9adc;if(_0x16ed6e[_0xffac('0x45')]['includeAll']){_0x5ceb8f[_0xffac('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xffac('0x53')](_0x5ceb8f);})[_0xffac('0x3a')](function(_0x1dab47){_0x2ea828[_0xffac('0x54')]=_0x1dab47;return _0x2ea828;})[_0xffac('0x3a')](respondWithFilteredResult(_0x3d802d,_0x5ceb8f))[_0xffac('0x2e')](handleError(_0x3d802d,null));};exports['show']=function(_0x2ab61b,_0x3d36c3){var _0x4efdf4={'raw':!![],'where':{'id':_0x2ab61b[_0xffac('0x55')]['id']}},_0x1cd15f={};_0x1cd15f['model']=_['keys'](db['FaxMessage']['rawAttributes']);_0x1cd15f[_0xffac('0x45')]=_[_0xffac('0x56')](_0x2ab61b['query']);_0x1cd15f[_0xffac('0x4c')]=_[_0xffac('0x47')](_0x1cd15f[_0xffac('0x43')],_0x1cd15f[_0xffac('0x45')]);_0x4efdf4[_0xffac('0x46')]=_['intersection'](_0x1cd15f[_0xffac('0x43')],qs[_0xffac('0x57')](_0x2ab61b[_0xffac('0x45')]['fields']));_0x4efdf4[_0xffac('0x46')]=_0x4efdf4[_0xffac('0x46')][_0xffac('0x48')]?_0x4efdf4[_0xffac('0x46')]:_0x1cd15f['model'];if(_0x2ab61b[_0xffac('0x45')][_0xffac('0x58')]){_0x4efdf4[_0xffac('0x52')]=[{'all':!![]}];}_0x4efdf4=_[_0xffac('0x50')]({},_0x4efdf4,_0x2ab61b[_0xffac('0x51')]);return db[_0xffac('0x40')][_0xffac('0x59')](_0x4efdf4)[_0xffac('0x3a')](handleEntityNotFound(_0x3d36c3,null))['then'](respondWithResult(_0x3d36c3,null))[_0xffac('0x2e')](handleError(_0x3d36c3,null));};exports[_0xffac('0x39')]=function(_0x5b3891,_0x545215){if(_0x5b3891[_0xffac('0x5a')]['id']){delete _0x5b3891[_0xffac('0x5a')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x5b3891['params']['id']}})['then'](handleEntityNotFound(_0x545215,null))[_0xffac('0x3a')](saveUpdates(_0x5b3891[_0xffac('0x5a')],null))[_0xffac('0x3a')](respondWithResult(_0x545215,null))[_0xffac('0x2e')](handleError(_0x545215,null));};exports[_0xffac('0x5b')]=function(_0x200e61,_0x2497b1){return db['FaxMessage'][_0xffac('0x59')]({'where':{'id':_0x200e61[_0xffac('0x55')]['id']}})[_0xffac('0x3a')](handleEntityNotFound(_0x2497b1,null))['then'](removeEntity(_0x2497b1,null))['catch'](handleError(_0x2497b1,null));};exports[_0xffac('0x5c')]=function(_0x46114c,_0x368f57){return db[_0xffac('0x40')]['describe']()[_0xffac('0x3a')](respondWithResult(_0x368f57,null))[_0xffac('0x2e')](handleError(_0x368f57,null));};var interaction_log=require('../../config/logger')(_0xffac('0x5d'));exports[_0xffac('0x5e')]=function(_0x28ef22,_0x1c203e,_0x3992a4){var _0x40aebb={'channel':_0xffac('0x5f')};if(_0x28ef22['body']['id']){delete _0x28ef22[_0xffac('0x5a')]['id'];}_0x28ef22[_0xffac('0x5a')][_0xffac('0x60')]=!![];_0x28ef22[_0xffac('0x5a')]['readAt']=moment()[_0xffac('0x61')](_0xffac('0x62'));_0x28ef22[_0xffac('0x5a')][_0xffac('0x63')]=_0x28ef22['body'][_0xffac('0x63')]||_0x28ef22[_0xffac('0x64')]['id'];return db[_0xffac('0x40')][_0xffac('0x59')]({'where':{'id':_0x28ef22[_0xffac('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xffac('0x65')],'as':_0xffac('0x66')}]})[_0xffac('0x3a')](handleEntityNotFound(_0x1c203e,null))[_0xffac('0x3a')](saveUpdates(_0x28ef22['body'],null))[_0xffac('0x3a')](function(_0x2a29b7){if(_0x2a29b7){_0x40aebb[_0xffac('0x2d')]=_0x2a29b7['get']({'plain':!![]});return db[_0xffac('0x67')][_0xffac('0x59')]({'where':{'id':_0x2a29b7[_0xffac('0x68')]}});}return null;})[_0xffac('0x3a')](handleEntityNotFound(_0x1c203e,null))[_0xffac('0x3a')](function(_0xece8ad){if(_0xece8ad){return _0xece8ad[_0xffac('0x39')]({'UserId':_0x28ef22[_0xffac('0x5a')]['UserId'],'read1stAt':_[_0xffac('0x69')](_0xece8ad[_0xffac('0x6a')])?moment()[_0xffac('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xffac('0x3a')](function(_0x1ea365){if(_0x1ea365){_0x40aebb[_0xffac('0x6b')]=_0x1ea365['get']({'plain':!![]});interaction_log['info'](_0xffac('0x6c'),_0x28ef22[_0xffac('0x64')]['id'],_0x28ef22[_0xffac('0x64')][_0xffac('0x3d')],_0x28ef22['user'][_0xffac('0x6d')],_0x40aebb[_0xffac('0x6b')]['id'],_0x28ef22[_0xffac('0x5a')]?JSON['stringify'](_0x28ef22[_0xffac('0x5a')]):'null');return respondWithRpcPromise(_0xffac('0x6e'),'acceptMessage',_0x40aebb);}return null;})[_0xffac('0x3a')](function(_0x20b84b){if(_0x20b84b){if(_0x28ef22[_0xffac('0x5a')]['manual']){_0x40aebb[_0xffac('0x2d')][_0xffac('0x6f')]=util[_0xffac('0x61')](_0xffac('0x70'),_0x28ef22[_0xffac('0x64')][_0xffac('0x3d')]);_0x40aebb[_0xffac('0x2d')]['channel']=_0x40aebb[_0xffac('0x71')];_0x40aebb[_0xffac('0x2d')][_0xffac('0x72')]=_0xffac('0x5e');return respondWithRpcPromise('EventManager',_0xffac('0x73'),{'event':_0xffac('0x74'),'message':_0x40aebb[_0xffac('0x2d')]},client9002)[_0xffac('0x3a')](function(){return _0x40aebb;});}return _0x40aebb;}return null;})[_0xffac('0x3a')](respondWithResult(_0x1c203e,null))[_0xffac('0x2e')](handleError(_0x1c203e,null));};var interaction_log=require(_0xffac('0x17'))(_0xffac('0x5d'));exports['reject']=function(_0x53beff,_0x4be71c,_0x23899f){var _0x466be1={'agent':{},'channel':_0xffac('0x5f')};if(_0x53beff[_0xffac('0x5a')]['id']){delete _0x53beff[_0xffac('0x5a')]['id'];}_0x53beff[_0xffac('0x5a')][_0xffac('0x63')]=_0x53beff['body'][_0xffac('0x63')]||_0x53beff[_0xffac('0x64')]['id'];_0x466be1['agent']['id']=_0x53beff['body'][_0xffac('0x63')];return db['FaxMessage'][_0xffac('0x59')]({'where':{'id':_0x53beff[_0xffac('0x55')]['id'],'UserId':null}})[_0xffac('0x3a')](handleEntityNotFound(_0x4be71c,null))[_0xffac('0x3a')](function(_0x387f82){if(_0x387f82){_0x466be1['message']=_0x387f82[_0xffac('0x75')]({'plain':!![]});return db[_0xffac('0x67')][_0xffac('0x59')]({'where':{'id':_0x387f82[_0xffac('0x68')]}});}return null;})[_0xffac('0x3a')](handleEntityNotFound(_0x4be71c,null))[_0xffac('0x3a')](function(_0x33e18f){if(_0x33e18f){_0x466be1[_0xffac('0x6b')]=_0x33e18f[_0xffac('0x75')]({'plain':!![]});interaction_log['info'](_0xffac('0x76'),_0x53beff[_0xffac('0x64')]['id'],_0x53beff[_0xffac('0x64')][_0xffac('0x3d')],_0x53beff[_0xffac('0x64')][_0xffac('0x6d')],_0x466be1['interaction']['id'],_0x53beff[_0xffac('0x5a')]?JSON['stringify'](_0x53beff[_0xffac('0x5a')]):_0xffac('0x77'));return respondWithRpcPromise('RejectMessage',_0xffac('0x78'),_0x466be1);}return null;})[_0xffac('0x3a')](function(_0xc216e1){if(_0xc216e1){_0xc216e1['message'][_0xffac('0x6f')]=util[_0xffac('0x61')](_0xffac('0x70'),_0x53beff['user'][_0xffac('0x3d')]);_0xc216e1[_0xffac('0x2d')]['channel']=_0x466be1[_0xffac('0x71')];_0xc216e1['message'][_0xffac('0x72')]='reject';respondWithRpcPromise('EventManager',_0xffac('0x73'),{'event':_0xffac('0x79'),'message':_0xc216e1[_0xffac('0x2d')]},client9002);return _0x466be1;}return null;})[_0xffac('0x3a')](respondWithResult(_0x4be71c,null))[_0xffac('0x2e')](handleError(_0x4be71c,null));};exports[_0xffac('0x7a')]=function(_0x4f972f,_0x3b7d04){var _0x4a497e;return db[_0xffac('0x40')][_0xffac('0x7a')](_0x4f972f[_0xffac('0x5a')],{})[_0xffac('0x3a')](function(_0x13fdb4){_0x4a497e=_0x13fdb4;return db[_0xffac('0x65')]['findOne']({'where':{'id':_0x4a497e[_0xffac('0x7b')]}});})[_0xffac('0x3a')](function(_0x53956d){if(_[_0xffac('0x69')](_0x53956d)){return;}else{_0x4a497e[_0xffac('0x5f')]=_0x53956d[_0xffac('0x5f')];return db[_0xffac('0x7c')][_0xffac('0x7d')]({'where':{'id':_0x4a497e[_0xffac('0x7e')]}});}})[_0xffac('0x3a')](function(_0x2970b0){return respondWithRpcPromise('SendFax',_0xffac('0x7f'),{'FaxAccountId':_[_0xffac('0x69')](_0x4f972f[_0xffac('0x5a')])?undefined:_0x4f972f['body'][_0xffac('0x80')],'path':_[_0xffac('0x69')](_0x2970b0)?undefined:util[_0xffac('0x61')]('/var/opt/motion2/server/files/attachments/%s',_0x2970b0[_0xffac('0x81')]),'fax':_[_0xffac('0x69')](_0x4a497e[_0xffac('0x5f')])?undefined:_0x4a497e[_0xffac('0x5f')],'AttachmentId':_0x4a497e['AttachmentId']},client9002);})[_0xffac('0x3a')](respondWithResult(_0x3b7d04,0xc9))['catch'](handleError(_0x3b7d04,null));};exports['download']=function(_0x3d0336,_0x11b278){var _0x432109=path[_0xffac('0x82')](config['root'],_0xffac('0x83'),_0xffac('0x84'),'attachments');return db['FaxMessage'][_0xffac('0x59')]({'where':{'id':_0x3d0336[_0xffac('0x55')]['id']},'include':[{'model':db[_0xffac('0x7c')],'as':_0xffac('0x7c')}]})['then'](handleEntityNotFound(_0x11b278,null))[_0xffac('0x3a')](function(_0x163a78){if(_0x163a78){return _0x11b278['download'](path[_0xffac('0x82')](_0x432109,_0x163a78[_0xffac('0x7c')]['basename']));}})[_0xffac('0x2e')](handleError(_0x11b278,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 409e602..24e6dba 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x2131f2,_0x2a190c){var _0x5a9475=function(_0x19dc3a){while(--_0x19dc3a){_0x2131f2['push'](_0x2131f2['shift']());}};_0x5a9475(++_0x2a190c);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x34e8,0x12c));var _0x834e=function(_0x3b8050,_0x4b2df4){_0x3b8050=_0x3b8050-0x0;var _0x5567d3=_0x34e8[_0x3b8050];return _0x5567d3;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index a01e925..0d55bc2 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 _0x6657=['bluebird','path','rimraf','define','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','FaxInteractionId','then','createdAt','catch','util','../../config/logger','api','moment'];(function(_0x4a921d,_0x519aa8){var _0x470ebb=function(_0x33ce6c){while(--_0x33ce6c){_0x4a921d['push'](_0x4a921d['shift']());}};_0x470ebb(++_0x519aa8);}(_0x6657,0x164));var _0x7665=function(_0x15182d,_0x1f4cfc){_0x15182d=_0x15182d-0x0;var _0x255b75=_0x6657[_0x15182d];return _0x255b75;};'use strict';var _=require('lodash');var util=require(_0x7665('0x0'));var logger=require(_0x7665('0x1'))(_0x7665('0x2'));var moment=require(_0x7665('0x3'));var BPromise=require(_0x7665('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7665('0x5'));var rimraf=require(_0x7665('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module['exports']=function(_0x1cbb6a,_0x3f8866){return _0x1cbb6a[_0x7665('0x7')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x7665('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c0d7b,_0x460996,_0x4bf427){var _0x3675e4=_0x1cbb6a[_0x7665('0x9')];var _0x2ab362=_0x1c0d7b[_0x7665('0xa')]({'plain':!![]});if(_0x2ab362['direction'][_0x7665('0xb')]()==='in'||_0x2ab362[_0x7665('0xc')][_0x7665('0xb')]()===_0x7665('0xd')&&!_0x2ab362[_0x7665('0xe')]&&!_['isNil'](_0x2ab362[_0x7665('0xf')])){_0x3675e4['FaxInteraction']['findOne']({'where':{'id':_0x2ab362[_0x7665('0x10')]}})[_0x7665('0x11')](function(_0x466353){if(_0x466353){_0x466353['update']({'lastMsgAt':_0x2ab362[_0x7665('0x12')],'lastMsgDirection':_0x2ab362[_0x7665('0xc')]['toLowerCase']()});}})[_0x7665('0x13')](function(_0x5bcba5){console['error'](_0x5bcba5);});}_0x4bf427();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x66bc=['out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','FaxMessage','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x66bc,0x113));var _0xc66b=function(_0x2c2baa,_0x10eca2){_0x2c2baa=_0x2c2baa-0x0;var _0x386019=_0x66bc[_0x2c2baa];return _0x386019;};'use strict';var _=require(_0xc66b('0x0'));var util=require('util');var logger=require(_0xc66b('0x1'))(_0xc66b('0x2'));var moment=require('moment');var BPromise=require(_0xc66b('0x3'));var rp=require(_0xc66b('0x4'));var fs=require('fs');var path=require(_0xc66b('0x5'));var rimraf=require(_0xc66b('0x6'));var config=require(_0xc66b('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x26f22a,_0x253f95){return _0x26f22a['define'](_0xc66b('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xc66b('0x9'),'fields':[_0xc66b('0xa')],'type':_0xc66b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29156a,_0x290ab2,_0x12f99c){var _0x2b8a4a=_0x26f22a['models'];var _0x260557=_0x29156a[_0xc66b('0xc')]({'plain':!![]});if(_0x260557[_0xc66b('0xd')]['toLowerCase']()==='in'||_0x260557['direction'][_0xc66b('0xe')]()===_0xc66b('0xf')&&!_0x260557[_0xc66b('0x10')]&&!_[_0xc66b('0x11')](_0x260557[_0xc66b('0x12')])){_0x2b8a4a[_0xc66b('0x13')][_0xc66b('0x14')]({'where':{'id':_0x260557[_0xc66b('0x15')]}})[_0xc66b('0x16')](function(_0x52e722){if(_0x52e722){_0x52e722[_0xc66b('0x17')]({'lastMsgAt':_0x260557[_0xc66b('0x18')],'lastMsgDirection':_0x260557[_0xc66b('0xd')][_0xc66b('0xe')]()});}})[_0xc66b('0x19')](function(_0x1063ea){console[_0xc66b('0x1a')](_0x1063ea);});}_0x12f99c();}},'charset':_0xc66b('0x1b'),'collate':_0xc66b('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index fb7eb56..5791d4f 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 _0xd596=['where','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','update'];(function(_0x5974d3,_0x286c95){var _0x4bd6f8=function(_0xc27f84){while(--_0xc27f84){_0x5974d3['push'](_0x5974d3['shift']());}};_0x4bd6f8(++_0x286c95);}(_0xd596,0x199));var _0x6d59=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xd596[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0x6d59('0x0'));var util=require(_0x6d59('0x1'));var moment=require('moment');var BPromise=require(_0x6d59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d59('0x3'));var db=require(_0x6d59('0x4'))['db'];var utils=require(_0x6d59('0x5'));var logger=require(_0x6d59('0x6'))(_0x6d59('0x7'));var config=require(_0x6d59('0x8'));var jayson=require(_0x6d59('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6d59('0xa')]=_[_0x6d59('0xb')](config[_0x6d59('0xa')],{'host':_0x6d59('0xc'),'port':0x18eb});var socket=require(_0x6d59('0xd'))(new Redis(config[_0x6d59('0xa')]));require(_0x6d59('0xe'))[_0x6d59('0xf')](socket);function respondWithRpcPromise(_0x1c0570,_0x54d123,_0x3d4ee9){return new BPromise(function(_0x128ca3,_0x2bccdc){return client['request'](_0x1c0570,_0x3d4ee9)[_0x6d59('0x10')](function(_0x29c859){logger['info'](_0x6d59('0x11'),_0x54d123,_0x6d59('0x12'));logger[_0x6d59('0x13')](_0x6d59('0x14'),_0x54d123,_0x6d59('0x12'),JSON[_0x6d59('0x15')](_0x29c859));if(_0x29c859[_0x6d59('0x16')]){if(_0x29c859[_0x6d59('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x54d123,_0x29c859[_0x6d59('0x16')]['message']);return _0x2bccdc(_0x29c859[_0x6d59('0x16')][_0x6d59('0x17')]);}logger[_0x6d59('0x16')](_0x6d59('0x11'),_0x54d123,_0x29c859[_0x6d59('0x16')]['message']);return _0x128ca3(_0x29c859['error'][_0x6d59('0x17')]);}else{logger[_0x6d59('0x18')](_0x6d59('0x11'),_0x54d123,'request\x20sent');_0x128ca3(_0x29c859[_0x6d59('0x19')][_0x6d59('0x17')]);}})['catch'](function(_0x337e85){logger[_0x6d59('0x16')]('FaxMessage,\x20%s,\x20%s',_0x54d123,_0x337e85);_0x2bccdc(_0x337e85);});});}exports[_0x6d59('0x1a')]=function(_0x1b0648){var _0x2652ca=this;return new Promise(function(_0x216a83,_0x31b237){return db[_0x6d59('0x1b')][_0x6d59('0x1c')](_0x1b0648[_0x6d59('0x1d')],{'raw':_0x1b0648[_0x6d59('0x1e')]?_0x1b0648[_0x6d59('0x1e')][_0x6d59('0x1f')]===undefined?!![]:![]:!![]})[_0x6d59('0x10')](function(_0x34db7d){logger['info'](_0x6d59('0x1a'),_0x1b0648);logger[_0x6d59('0x13')](_0x6d59('0x1a'),_0x1b0648,JSON['stringify'](_0x34db7d));_0x216a83(_0x34db7d);})[_0x6d59('0x20')](function(_0xb5e377){logger['error'](_0x6d59('0x1a'),_0xb5e377[_0x6d59('0x17')],_0x1b0648);_0x31b237(_0x2652ca[_0x6d59('0x16')](0x1f4,_0xb5e377['message']));});});};exports[_0x6d59('0x21')]=function(_0x19d683){var _0x2a0fc1=this;return new Promise(function(_0x1bac13,_0x1d1ec7){return db[_0x6d59('0x1b')][_0x6d59('0x22')](_0x19d683['body'],{'raw':_0x19d683[_0x6d59('0x1e')]?_0x19d683[_0x6d59('0x1e')][_0x6d59('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d683[_0x6d59('0x1e')]?_0x19d683[_0x6d59('0x1e')][_0x6d59('0x23')]||null:null,'attributes':_0x19d683['options']?_0x19d683[_0x6d59('0x1e')]['attributes']||null:null,'limit':_0x19d683[_0x6d59('0x1e')]?_0x19d683[_0x6d59('0x1e')][_0x6d59('0x24')]||null:null})[_0x6d59('0x10')](function(_0x4b3b65){logger[_0x6d59('0x18')](_0x6d59('0x21'),_0x19d683);logger['debug'](_0x6d59('0x21'),_0x19d683,JSON['stringify'](_0x4b3b65));_0x1bac13(_0x4b3b65);})[_0x6d59('0x20')](function(_0x4ec179){logger['error']('UpdateFaxMessage',_0x4ec179[_0x6d59('0x17')],_0x19d683);_0x1d1ec7(_0x2a0fc1['error'](0x1f4,_0x4ec179['message']));});});}; \ No newline at end of file +var _0x4c33=['FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage','create','body','options','raw','then','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19b4bc,_0x19ff41){var _0x2f596c=function(_0x554cd0){while(--_0x554cd0){_0x19b4bc['push'](_0x19b4bc['shift']());}};_0x2f596c(++_0x19ff41);}(_0x4c33,0x1d9));var _0x34c3=function(_0x4f2523,_0x5c4a82){_0x4f2523=_0x4f2523-0x0;var _0x1b7191=_0x4c33[_0x4f2523];return _0x1b7191;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34c3('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34c3('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x34c3('0x2'))(_0x34c3('0x3'));var config=require(_0x34c3('0x4'));var jayson=require(_0x34c3('0x5'));var client=jayson[_0x34c3('0x6')]['http']({'port':0x232a});config[_0x34c3('0x7')]=_[_0x34c3('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x34c3('0x9'))(new Redis(config['redis']));require(_0x34c3('0xa'))[_0x34c3('0xb')](socket);function respondWithRpcPromise(_0x2c6834,_0xecb2b8,_0x5b5bb9){return new BPromise(function(_0x3abe71,_0x5ae19e){return client[_0x34c3('0xc')](_0x2c6834,_0x5b5bb9)['then'](function(_0x3217f4){logger[_0x34c3('0xd')](_0x34c3('0xe'),_0xecb2b8,_0x34c3('0xf'));logger[_0x34c3('0x10')](_0x34c3('0x11'),_0xecb2b8,_0x34c3('0xf'),JSON[_0x34c3('0x12')](_0x3217f4));if(_0x3217f4[_0x34c3('0x13')]){if(_0x3217f4['error'][_0x34c3('0x14')]===0x1f4){logger[_0x34c3('0x13')]('FaxMessage,\x20%s,\x20%s',_0xecb2b8,_0x3217f4[_0x34c3('0x13')][_0x34c3('0x15')]);return _0x5ae19e(_0x3217f4[_0x34c3('0x13')][_0x34c3('0x15')]);}logger[_0x34c3('0x13')](_0x34c3('0xe'),_0xecb2b8,_0x3217f4['error'][_0x34c3('0x15')]);return _0x3abe71(_0x3217f4['error']['message']);}else{logger['info'](_0x34c3('0xe'),_0xecb2b8,'request\x20sent');_0x3abe71(_0x3217f4['result']['message']);}})[_0x34c3('0x16')](function(_0x368fb3){logger[_0x34c3('0x13')]('FaxMessage,\x20%s,\x20%s',_0xecb2b8,_0x368fb3);_0x5ae19e(_0x368fb3);});});}exports['CreateFaxMessage']=function(_0x217f7e){var _0x350998=this;return new Promise(function(_0x15dbe7,_0x1cc7f0){return db[_0x34c3('0x17')][_0x34c3('0x18')](_0x217f7e[_0x34c3('0x19')],{'raw':_0x217f7e[_0x34c3('0x1a')]?_0x217f7e[_0x34c3('0x1a')][_0x34c3('0x1b')]===undefined?!![]:![]:!![]})[_0x34c3('0x1c')](function(_0x140743){logger[_0x34c3('0xd')](_0x34c3('0x1d'),_0x217f7e);logger[_0x34c3('0x10')](_0x34c3('0x1d'),_0x217f7e,JSON[_0x34c3('0x12')](_0x140743));_0x15dbe7(_0x140743);})[_0x34c3('0x16')](function(_0x4f8468){logger[_0x34c3('0x13')]('CreateFaxMessage',_0x4f8468[_0x34c3('0x15')],_0x217f7e);_0x1cc7f0(_0x350998[_0x34c3('0x13')](0x1f4,_0x4f8468[_0x34c3('0x15')]));});});};exports[_0x34c3('0x1e')]=function(_0x25d5e2){var _0x5ece6b=this;return new Promise(function(_0x99b64c,_0x627d7c){return db[_0x34c3('0x17')][_0x34c3('0x1f')](_0x25d5e2[_0x34c3('0x19')],{'raw':_0x25d5e2['options']?_0x25d5e2[_0x34c3('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25d5e2[_0x34c3('0x1a')]?_0x25d5e2[_0x34c3('0x1a')][_0x34c3('0x20')]||null:null,'attributes':_0x25d5e2['options']?_0x25d5e2[_0x34c3('0x1a')][_0x34c3('0x21')]||null:null,'limit':_0x25d5e2[_0x34c3('0x1a')]?_0x25d5e2[_0x34c3('0x1a')][_0x34c3('0x22')]||null:null})[_0x34c3('0x1c')](function(_0x3b6711){logger['info']('UpdateFaxMessage',_0x25d5e2);logger['debug'](_0x34c3('0x1e'),_0x25d5e2,JSON[_0x34c3('0x12')](_0x3b6711));_0x99b64c(_0x3b6711);})[_0x34c3('0x16')](function(_0x22db01){logger['error'](_0x34c3('0x1e'),_0x22db01['message'],_0x25d5e2);_0x627d7c(_0x5ece6b[_0x34c3('0x13')](0x1f4,_0x22db01[_0x34c3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 23cab17..d79afe6 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 _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 20f576c..3bf8752 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 _0x3fb7=['isAuthenticated','/:id','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x445d29,_0x4e0f15){var _0x18ea65=function(_0x586d82){while(--_0x586d82){_0x445d29['push'](_0x445d29['shift']());}};_0x18ea65(++_0x4e0f15);}(_0x3fb7,0x187));var _0x73fb=function(_0x495c8a,_0x338ed2){_0x495c8a=_0x495c8a-0x0;var _0x40703f=_0x3fb7[_0x495c8a];return _0x40703f;};'use strict';var multer=require(_0x73fb('0x0'));var util=require(_0x73fb('0x1'));var path=require(_0x73fb('0x2'));var timeout=require(_0x73fb('0x3'));var express=require('express');var router=express[_0x73fb('0x4')]();var auth=require(_0x73fb('0x5'));var interaction=require(_0x73fb('0x6'));var config=require(_0x73fb('0x7'));var controller=require('./faxMessage.controller');router[_0x73fb('0x8')]('/',auth[_0x73fb('0x9')](),controller['index']);router[_0x73fb('0x8')]('/describe',auth[_0x73fb('0x9')](),controller['describe']);router['get'](_0x73fb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x73fb('0x8')](_0x73fb('0xb'),auth[_0x73fb('0x9')](),controller['download']);router[_0x73fb('0xc')]('/',auth[_0x73fb('0x9')](),interaction[_0x73fb('0xd')](_0x73fb('0xe'),_0x73fb('0xf')),controller[_0x73fb('0x10')]);router[_0x73fb('0x11')](_0x73fb('0xa'),auth[_0x73fb('0x9')](),controller[_0x73fb('0x12')]);router['put'](_0x73fb('0x13'),auth[_0x73fb('0x9')](),controller['accept']);router[_0x73fb('0x11')](_0x73fb('0x14'),auth[_0x73fb('0x9')](),controller[_0x73fb('0x15')]);router[_0x73fb('0x16')](_0x73fb('0xa'),auth[_0x73fb('0x9')](),controller[_0x73fb('0x17')]);module[_0x73fb('0x18')]=router; \ No newline at end of file +var _0x2fb2=['/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','create','update','/:id/accept','accept','put'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x2fb2,0xc5));var _0x22fb=function(_0x184270,_0x30b091){_0x184270=_0x184270-0x0;var _0x16e988=_0x2fb2[_0x184270];return _0x16e988;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x22fb('0x0'));var timeout=require(_0x22fb('0x1'));var express=require(_0x22fb('0x2'));var router=express['Router']();var auth=require(_0x22fb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x22fb('0x4'));var controller=require('./faxMessage.controller');router[_0x22fb('0x5')]('/',auth[_0x22fb('0x6')](),controller[_0x22fb('0x7')]);router[_0x22fb('0x5')](_0x22fb('0x8'),auth[_0x22fb('0x6')](),controller[_0x22fb('0x9')]);router[_0x22fb('0x5')](_0x22fb('0xa'),auth[_0x22fb('0x6')](),controller[_0x22fb('0xb')]);router[_0x22fb('0x5')]('/:id/download',auth[_0x22fb('0x6')](),controller[_0x22fb('0xc')]);router['post']('/',auth[_0x22fb('0x6')](),interaction[_0x22fb('0xd')]('fax','faxmessage:create'),controller[_0x22fb('0xe')]);router['put'](_0x22fb('0xa'),auth[_0x22fb('0x6')](),controller[_0x22fb('0xf')]);router['put'](_0x22fb('0x10'),auth[_0x22fb('0x6')](),controller[_0x22fb('0x11')]);router[_0x22fb('0x12')](_0x22fb('0x13'),auth[_0x22fb('0x6')](),controller[_0x22fb('0x14')]);router[_0x22fb('0x15')](_0x22fb('0xa'),auth[_0x22fb('0x6')](),controller[_0x22fb('0x16')]);module[_0x22fb('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 6c0c42d..cec7ecc 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 _0xd93a=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xd93a,0xa3));var _0xad93=function(_0x27972b,_0x1bfa25){_0x27972b=_0x27972b-0x0;var _0x3e1db9=_0xd93a[_0x27972b];return _0x3e1db9;};'use strict';var Sequelize=require('sequelize');module[_0xad93('0x0')]={'name':{'type':Sequelize[_0xad93('0x1')],'unique':_0xad93('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xad93('0x1')]},'timeout':{'type':Sequelize[_0xad93('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xad93('0x4'),_0xad93('0x5'),_0xad93('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xad93('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2507=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x16fd18,_0x2ba7e1){var _0x35589d=function(_0x53be3f){while(--_0x53be3f){_0x16fd18['push'](_0x16fd18['shift']());}};_0x35589d(++_0x2ba7e1);}(_0x2507,0x6f));var _0x7250=function(_0x2f0414,_0x4cda2c){_0x2f0414=_0x2f0414-0x0;var _0xc72736=_0x2507[_0x2f0414];return _0xc72736;};'use strict';var Sequelize=require(_0x7250('0x0'));module[_0x7250('0x1')]={'name':{'type':Sequelize[_0x7250('0x2')],'unique':_0x7250('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7250('0x2')]},'timeout':{'type':Sequelize[_0x7250('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7250('0x5')](_0x7250('0x6'),_0x7250('0x7'),_0x7250('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7250('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 0296ad7..d301724 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 _0x58a4=['userProfileId','autoAssociation','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','addTeams','ids','Team','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','sendStatus','status','end','json','offset','set','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','FaxQueue','count','includeAll','findAll','rows','show','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x68be45,_0x2adf77){var _0x17715f=function(_0xa9a71e){while(--_0xa9a71e){_0x68be45['push'](_0x68be45['shift']());}};_0x17715f(++_0x2adf77);}(_0x58a4,0xbf));var _0x458a=function(_0x1ff92d,_0x3bfdeb){_0x1ff92d=_0x1ff92d-0x0;var _0x129a98=_0x58a4[_0x1ff92d];return _0x129a98;};'use strict';var pdf=require(_0x458a('0x0'));var emlformat=require(_0x458a('0x1'));var rimraf=require(_0x458a('0x2'));var zipdir=require(_0x458a('0x3'));var jsonpatch=require(_0x458a('0x4'));var rp=require(_0x458a('0x5'));var moment=require(_0x458a('0x6'));var BPromise=require(_0x458a('0x7'));var Mustache=require(_0x458a('0x8'));var util=require(_0x458a('0x9'));var path=require(_0x458a('0xa'));var sox=require(_0x458a('0xb'));var csv=require(_0x458a('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var db=require(_0x458a('0x18'))['db'];config[_0x458a('0x19')]=_[_0x458a('0x1a')](config[_0x458a('0x19')],{'host':_0x458a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x458a('0x1c'))['register'](socket);function respondWithStatusCode(_0x2c7528,_0x44f683){_0x44f683=_0x44f683||0xcc;return function(_0x10133b){if(_0x10133b){return _0x2c7528[_0x458a('0x1d')](_0x44f683);}return _0x2c7528[_0x458a('0x1e')](_0x44f683)[_0x458a('0x1f')]();};}function respondWithResult(_0x507b0f,_0x4b26be){_0x4b26be=_0x4b26be||0xc8;return function(_0x5c7993){if(_0x5c7993){return _0x507b0f[_0x458a('0x1e')](_0x4b26be)[_0x458a('0x20')](_0x5c7993);}};}function respondWithFilteredResult(_0x3558b9,_0x5c5b41){return function(_0x310569){if(_0x310569){var _0x260c87=_0x310569['count'],_0x18504d=_0x5c5b41['offset'],_0x392986=_0x5c5b41[_0x458a('0x21')]+_0x5c5b41['limit'],_0xa91473;if(_0x392986>=_0x260c87){_0x392986=_0x260c87;_0xa91473=0xc8;}else{_0xa91473=0xce;}_0x3558b9[_0x458a('0x1e')](_0xa91473);return _0x3558b9[_0x458a('0x22')]('Content-Range',_0x18504d+'-'+_0x392986+'/'+_0x260c87)[_0x458a('0x20')](_0x310569);}return null;};}function patchUpdates(_0x55a588){return function(_0x200213){try{jsonpatch[_0x458a('0x23')](_0x200213,_0x55a588,!![]);}catch(_0x59f44c){return BPromise[_0x458a('0x24')](_0x59f44c);}return _0x200213[_0x458a('0x25')]();};}function saveUpdates(_0x5a2bcb,_0xa6b8ff){return function(_0x5ad95a){if(_0x5ad95a){return _0x5ad95a[_0x458a('0x26')](_0x5a2bcb)['then'](function(_0x4080fc){return _0x4080fc;});}return null;};}function removeEntity(_0x5dfc6c,_0x36b08e){return function(_0x911eaf){if(_0x911eaf){return _0x911eaf[_0x458a('0x27')]()[_0x458a('0x28')](function(){var _0x339b95=_0x911eaf[_0x458a('0x29')]({'plain':!![]});var _0x340375=_0x458a('0x2a');return db[_0x458a('0x2b')][_0x458a('0x27')]({'where':{'type':_0x340375,'resourceId':_0x339b95['id']}})[_0x458a('0x28')](function(){return _0x911eaf;});})[_0x458a('0x28')](function(){_0x5dfc6c[_0x458a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb94bd9,_0x112fa6){return function(_0x5f3ac0){if(!_0x5f3ac0){_0xb94bd9['sendStatus'](0x194);}return _0x5f3ac0;};}function handleError(_0x41b23d,_0x596fe2){_0x596fe2=_0x596fe2||0x1f4;return function(_0x33c5d8){logger[_0x458a('0x2c')](_0x33c5d8[_0x458a('0x2d')]);if(_0x33c5d8['name']){delete _0x33c5d8[_0x458a('0x2e')];}_0x41b23d[_0x458a('0x1e')](_0x596fe2)[_0x458a('0x2f')](_0x33c5d8);};}exports['index']=function(_0x47e20d,_0x18c890){var _0x4cf059={},_0x185f1c={},_0x56e0b9={'count':0x0,'rows':[]};var _0x2e0b0c=_[_0x458a('0x30')](db['FaxQueue'][_0x458a('0x31')],function(_0x269f53){return{'name':_0x269f53[_0x458a('0x32')],'type':_0x269f53['type'][_0x458a('0x33')]};});_0x185f1c[_0x458a('0x34')]=_[_0x458a('0x30')](_0x2e0b0c,_0x458a('0x2e'));_0x185f1c[_0x458a('0x35')]=_['keys'](_0x47e20d[_0x458a('0x35')]);_0x185f1c[_0x458a('0x36')]=_[_0x458a('0x37')](_0x185f1c[_0x458a('0x34')],_0x185f1c[_0x458a('0x35')]);_0x4cf059[_0x458a('0x38')]=_['intersection'](_0x185f1c[_0x458a('0x34')],qs[_0x458a('0x39')](_0x47e20d[_0x458a('0x35')][_0x458a('0x39')]));_0x4cf059[_0x458a('0x38')]=_0x4cf059[_0x458a('0x38')][_0x458a('0x3a')]?_0x4cf059[_0x458a('0x38')]:_0x185f1c[_0x458a('0x34')];if(!_0x47e20d['query'][_0x458a('0x3b')](_0x458a('0x3c'))){_0x4cf059[_0x458a('0x3d')]=qs[_0x458a('0x3d')](_0x47e20d[_0x458a('0x35')][_0x458a('0x3d')]);_0x4cf059[_0x458a('0x21')]=qs[_0x458a('0x21')](_0x47e20d[_0x458a('0x35')][_0x458a('0x21')]);}_0x4cf059[_0x458a('0x3e')]=qs[_0x458a('0x3f')](_0x47e20d[_0x458a('0x35')][_0x458a('0x3f')]);_0x4cf059[_0x458a('0x40')]=qs['filters'](_[_0x458a('0x41')](_0x47e20d[_0x458a('0x35')],_0x185f1c[_0x458a('0x36')]),_0x2e0b0c);if(_0x47e20d[_0x458a('0x35')][_0x458a('0x42')]){_0x4cf059[_0x458a('0x40')]=_[_0x458a('0x43')](_0x4cf059[_0x458a('0x40')],{'$or':_[_0x458a('0x30')](_0x2e0b0c,function(_0x44c5ba){if(_0x44c5ba[_0x458a('0x44')]!=='VIRTUAL'){var _0x95c42c={};_0x95c42c[_0x44c5ba[_0x458a('0x2e')]]={'$like':'%'+_0x47e20d['query'][_0x458a('0x42')]+'%'};return _0x95c42c;}})});}_0x4cf059=_[_0x458a('0x43')]({},_0x4cf059,_0x47e20d[_0x458a('0x45')]);var _0x5663b5={'where':_0x4cf059[_0x458a('0x40')]};return db[_0x458a('0x46')][_0x458a('0x47')](_0x5663b5)[_0x458a('0x28')](function(_0xbcd632){_0x56e0b9[_0x458a('0x47')]=_0xbcd632;if(_0x47e20d[_0x458a('0x35')][_0x458a('0x48')]){_0x4cf059['include']=[{'all':!![]}];}return db[_0x458a('0x46')][_0x458a('0x49')](_0x4cf059);})[_0x458a('0x28')](function(_0x5180ae){_0x56e0b9[_0x458a('0x4a')]=_0x5180ae;return _0x56e0b9;})[_0x458a('0x28')](respondWithFilteredResult(_0x18c890,_0x4cf059))['catch'](handleError(_0x18c890,null));};exports[_0x458a('0x4b')]=function(_0x124f64,_0x2be08f){var _0x36c391={'raw':!![],'where':{'id':_0x124f64['params']['id']}},_0xf5d4f3={};_0xf5d4f3['model']=_[_0x458a('0x4c')](db[_0x458a('0x46')][_0x458a('0x31')]);_0xf5d4f3[_0x458a('0x35')]=_['keys'](_0x124f64[_0x458a('0x35')]);_0xf5d4f3[_0x458a('0x36')]=_['intersection'](_0xf5d4f3[_0x458a('0x34')],_0xf5d4f3['query']);_0x36c391[_0x458a('0x38')]=_[_0x458a('0x37')](_0xf5d4f3[_0x458a('0x34')],qs['fields'](_0x124f64[_0x458a('0x35')][_0x458a('0x39')]));_0x36c391[_0x458a('0x38')]=_0x36c391['attributes']['length']?_0x36c391[_0x458a('0x38')]:_0xf5d4f3[_0x458a('0x34')];if(_0x124f64[_0x458a('0x35')]['includeAll']){_0x36c391['include']=[{'all':!![]}];}_0x36c391=_[_0x458a('0x43')]({},_0x36c391,_0x124f64[_0x458a('0x45')]);return db[_0x458a('0x46')][_0x458a('0x4d')](_0x36c391)[_0x458a('0x28')](handleEntityNotFound(_0x2be08f,null))[_0x458a('0x28')](respondWithResult(_0x2be08f,null))[_0x458a('0x4e')](handleError(_0x2be08f,null));};exports[_0x458a('0x4f')]=function(_0xb22232,_0x213f86){return db[_0x458a('0x46')][_0x458a('0x4f')](_0xb22232[_0x458a('0x50')],{})[_0x458a('0x28')](function(_0x1ddc39){var _0x25b44c=_0xb22232['user'][_0x458a('0x29')]({'plain':!![]});if(!_0x25b44c)throw new Error(_0x458a('0x51'));if(_0x25b44c[_0x458a('0x52')]===_0x458a('0x53')){var _0x44670a=_0x1ddc39['get']({'plain':!![]});var _0x4b5093='FaxQueues';return db[_0x458a('0x54')]['find']({'where':{'name':_0x4b5093,'userProfileId':_0x25b44c[_0x458a('0x55')]},'raw':!![]})[_0x458a('0x28')](function(_0x2a35a9){if(_0x2a35a9&&_0x2a35a9[_0x458a('0x56')]===0x0){return db[_0x458a('0x2b')]['create']({'name':_0x44670a['name'],'resourceId':_0x44670a['id'],'type':_0x2a35a9[_0x458a('0x2e')],'sectionId':_0x2a35a9['id']},{})[_0x458a('0x28')](function(){return _0x1ddc39;});}else{return _0x1ddc39;}})[_0x458a('0x4e')](function(_0x8ff0dd){logger[_0x458a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8ff0dd);throw _0x8ff0dd;});}return _0x1ddc39;})[_0x458a('0x28')](respondWithResult(_0x213f86,0xc9))['catch'](handleError(_0x213f86,null));};exports[_0x458a('0x26')]=function(_0x5b428c,_0x3ea8f0){if(_0x5b428c['body']['id']){delete _0x5b428c['body']['id'];}return db['FaxQueue'][_0x458a('0x4d')]({'where':{'id':_0x5b428c[_0x458a('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ea8f0,null))[_0x458a('0x28')](saveUpdates(_0x5b428c[_0x458a('0x50')],null))[_0x458a('0x28')](respondWithResult(_0x3ea8f0,null))['catch'](handleError(_0x3ea8f0,null));};exports[_0x458a('0x27')]=function(_0x212de5,_0x217a97){return db[_0x458a('0x46')][_0x458a('0x4d')]({'where':{'id':_0x212de5[_0x458a('0x57')]['id']}})['then'](handleEntityNotFound(_0x217a97,null))[_0x458a('0x28')](removeEntity(_0x217a97,null))[_0x458a('0x4e')](handleError(_0x217a97,null));};exports[_0x458a('0x58')]=function(_0x39e5b5,_0x3ab86a){return db[_0x458a('0x46')][_0x458a('0x58')]()[_0x458a('0x28')](respondWithResult(_0x3ab86a,null))['catch'](handleError(_0x3ab86a,null));};exports[_0x458a('0x59')]=function(_0x4abe93,_0x1f93ad,_0x2921ba){var _0x222aa4={'raw':!![],'where':{}},_0x42b748={},_0x4da240;return db['FaxQueue'][_0x458a('0x5a')]({'where':{'id':_0x4abe93[_0x458a('0x57')]['id']}})[_0x458a('0x28')](handleEntityNotFound(_0x1f93ad,null))[_0x458a('0x28')](function(_0x1beef7){if(_0x1beef7){_0x4da240=_0x1beef7[_0x458a('0x29')]({'plain':!![]});_0x42b748['model']=_[_0x458a('0x4c')](db[_0x458a('0x5b')]['rawAttributes']);_0x42b748[_0x458a('0x35')]=_['keys'](_0x4abe93[_0x458a('0x35')]);_0x42b748[_0x458a('0x36')]=_[_0x458a('0x37')](_0x42b748[_0x458a('0x34')],_0x42b748[_0x458a('0x35')]);_0x222aa4[_0x458a('0x38')]=_[_0x458a('0x37')](_0x42b748[_0x458a('0x34')],qs['fields'](_0x4abe93[_0x458a('0x35')][_0x458a('0x39')]));_0x222aa4['attributes']=_0x222aa4[_0x458a('0x38')][_0x458a('0x3a')]?_0x222aa4['attributes']:_0x42b748[_0x458a('0x34')];if(!_0x4abe93[_0x458a('0x35')]['hasOwnProperty'](_0x458a('0x3c'))){_0x222aa4[_0x458a('0x3d')]=qs['limit'](_0x4abe93[_0x458a('0x35')][_0x458a('0x3d')]);_0x222aa4[_0x458a('0x21')]=qs[_0x458a('0x21')](_0x4abe93[_0x458a('0x35')][_0x458a('0x21')]);}_0x222aa4[_0x458a('0x3e')]=qs[_0x458a('0x3f')](_0x4abe93['query'][_0x458a('0x3f')]);_0x222aa4[_0x458a('0x40')]=qs[_0x458a('0x36')](_[_0x458a('0x41')](_0x4abe93[_0x458a('0x35')],_0x42b748[_0x458a('0x36')]));_0x222aa4[_0x458a('0x40')][_0x458a('0x5c')]=_0x1beef7['id'];if(_0x4abe93[_0x458a('0x35')][_0x458a('0x42')]){_0x222aa4['where']=_[_0x458a('0x43')](_0x222aa4['where'],{'$or':_[_0x458a('0x30')](_0x222aa4[_0x458a('0x38')],function(_0x3bd686){var _0x2bc158={};_0x2bc158[_0x3bd686]={'$like':'%'+_0x4abe93[_0x458a('0x35')][_0x458a('0x42')]+'%'};return _0x2bc158;})});}_0x222aa4=_[_0x458a('0x43')]({},_0x222aa4,_0x4abe93[_0x458a('0x45')]);return db[_0x458a('0x5b')][_0x458a('0x49')](_0x222aa4);}})[_0x458a('0x28')](function(_0x448cbc){if(_0x448cbc){return db[_0x458a('0x5d')][_0x458a('0x5e')]({'where':{'id':_[_0x458a('0x30')](_0x448cbc,_0x458a('0x5f')),'role':'agent'},'attributes':['id',_0x458a('0x2e'),'faxPause',_0x458a('0x60'),_0x458a('0x61')]});}})['then'](function(_0xdfc430){if(_0xdfc430){return{'count':_0xdfc430[_0x458a('0x47')],'rows':_[_0x458a('0x30')](_0xdfc430['rows'],function(_0x3cf58c){return{'membername':_0x3cf58c[_0x458a('0x2e')],'UserId':_0x3cf58c['id'],'queue_name':_0x4da240[_0x458a('0x2e')],'FaxQueueId':_0x4da240['id'],'interface':util[_0x458a('0x62')](_0x458a('0x63'),_0x458a('0x64'),_0x3cf58c['name']),'penalty':0x0,'paused':_0x3cf58c[_0x458a('0x65')],'createdAt':_0x3cf58c['createdAt'],'updatedAt':_0x3cf58c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x458a('0x28')](respondWithFilteredResult(_0x1f93ad,_0x222aa4))[_0x458a('0x4e')](handleError(_0x1f93ad,null));};exports[_0x458a('0x66')]=function(_0x5e01af,_0xaf6262,_0x434d04){var _0x42eae7={};var _0x5aee0d={};var _0x3d30e2;var _0x32b33d;return db[_0x458a('0x46')][_0x458a('0x5a')]({'where':{'id':_0x5e01af[_0x458a('0x57')]['id']}})[_0x458a('0x28')](handleEntityNotFound(_0xaf6262,null))['then'](function(_0x580c4b){if(_0x580c4b){_0x3d30e2=_0x580c4b;_0x5aee0d['model']=_[_0x458a('0x4c')](db['Team'][_0x458a('0x31')]);_0x5aee0d[_0x458a('0x35')]=_[_0x458a('0x4c')](_0x5e01af[_0x458a('0x35')]);_0x5aee0d[_0x458a('0x36')]=_[_0x458a('0x37')](_0x5aee0d[_0x458a('0x34')],_0x5aee0d['query']);_0x42eae7[_0x458a('0x38')]=_[_0x458a('0x37')](_0x5aee0d['model'],qs[_0x458a('0x39')](_0x5e01af['query'][_0x458a('0x39')]));_0x42eae7['attributes']=_0x42eae7[_0x458a('0x38')][_0x458a('0x3a')]?_0x42eae7[_0x458a('0x38')]:_0x5aee0d[_0x458a('0x34')];_0x42eae7['order']=qs[_0x458a('0x3f')](_0x5e01af[_0x458a('0x35')][_0x458a('0x3f')]);_0x42eae7[_0x458a('0x40')]=qs[_0x458a('0x36')](_[_0x458a('0x41')](_0x5e01af[_0x458a('0x35')],_0x5aee0d[_0x458a('0x36')]));if(_0x5e01af['query'][_0x458a('0x42')]){_0x42eae7[_0x458a('0x40')]=_[_0x458a('0x43')](_0x42eae7[_0x458a('0x40')],{'$or':_['map'](_0x42eae7[_0x458a('0x38')],function(_0x45569b){var _0x579352={};_0x579352[_0x45569b]={'$like':'%'+_0x5e01af[_0x458a('0x35')][_0x458a('0x42')]+'%'};return _0x579352;})});}_0x42eae7=_[_0x458a('0x43')]({},_0x42eae7,_0x5e01af[_0x458a('0x45')]);return _0x3d30e2[_0x458a('0x66')](_0x42eae7);}})['then'](function(_0x34d7a6){if(_0x34d7a6){_0x32b33d=_0x34d7a6[_0x458a('0x3a')];if(!_0x5e01af[_0x458a('0x35')][_0x458a('0x3b')](_0x458a('0x3c'))){_0x42eae7[_0x458a('0x3d')]=qs[_0x458a('0x3d')](_0x5e01af['query'][_0x458a('0x3d')]);_0x42eae7['offset']=qs[_0x458a('0x21')](_0x5e01af[_0x458a('0x35')][_0x458a('0x21')]);}return _0x3d30e2['getTeams'](_0x42eae7);}})[_0x458a('0x28')](function(_0x5a1da2){if(_0x5a1da2){return _0x5a1da2?{'count':_0x32b33d,'rows':_0x5a1da2}:null;}})['then'](respondWithResult(_0xaf6262,null))[_0x458a('0x4e')](handleError(_0xaf6262,null));};exports[_0x458a('0x67')]=function(_0x5464a5,_0x480e71,_0xfc43fc){var _0x1d16c7=_0x5464a5[_0x458a('0x50')][_0x458a('0x68')];return db[_0x458a('0x69')]['findAll']({'where':{'id':_0x1d16c7},'attributes':['id'],'include':[{'model':db[_0x458a('0x5d')],'as':'Agents','attributes':['id',_0x458a('0x2e'),_0x458a('0x6a'),_0x458a('0x6b'),'interface'],'raw':!![]}]})[_0x458a('0x28')](function(_0x358267){if(_0x358267){var _0x4fa39a=_[_0x458a('0x6c')](_0x358267,function(_0x5bf72f){var _0x2c11c8=_0x5bf72f[_0x458a('0x29')]({'plain':!![]});return _0x2c11c8[_0x458a('0x6d')];});return db[_0x458a('0x46')]['find']({'where':{'id':_0x5464a5[_0x458a('0x57')]['id']}})['then'](function(_0x4a97c4){return db[_0x458a('0x6e')][_0x458a('0x6f')](function(_0x28c3e5){return _0x4a97c4[_0x458a('0x67')](_0x1d16c7,{'transaction':_0x28c3e5})[_0x458a('0x28')](function(){return BPromise[_0x458a('0x70')](_0x4fa39a,function(_0x577c45){return db[_0x458a('0x5b')][_0x458a('0x71')]({'where':{'UserId':_0x577c45['id'],'FaxQueueId':_0x5464a5[_0x458a('0x57')]['id']},'transaction':_0x28c3e5});});})[_0x458a('0x28')](function(){_0x4fa39a[_0x458a('0x72')](function(_0x1bff6a){socket['emit'](_0x458a('0x73'),{'UserId':_0x1bff6a['id'],'FaxQueueId':_0x4a97c4['id']});});});});});}})[_0x458a('0x28')](respondWithStatusCode(_0x480e71,null))[_0x458a('0x4e')](handleError(_0x480e71,null));};exports['removeTeams']=function(_0x2903c2,_0x42d2a2,_0x34f513){return db['Team']['findAll']({'where':{'id':_0x2903c2[_0x458a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x42d2a2,null))['then'](function(_0x3f14bf){var _0x5274df=_[_0x458a('0x30')](_0x3f14bf,'id');var _0x457186=[];var _0x2adefe=[];var _0xfcb712=squel[_0x458a('0x74')]();_0xfcb712[_0x458a('0x75')]('tq.TeamId')[_0x458a('0x76')]('team_has_fax_queues','tq')[_0x458a('0x77')]('user_has_teams','ut',_0x458a('0x78'))[_0x458a('0x40')]('FaxQueueId\x20=\x20?',_0x2903c2['params']['id']);for(var _0x4f29d3=0x0;_0x4f29d3<_0x3f14bf[_0x458a('0x3a')];_0x4f29d3+=0x1){let _0x384c46=_0x3f14bf[_0x4f29d3];for(var _0x21d8a9=0x0;_0x21d8a9<_0x384c46[_0x458a('0x6d')][_0x458a('0x3a')];_0x21d8a9+=0x1){let _0x502c02=_0x384c46[_0x458a('0x6d')][_0x21d8a9];var _0x41e32f=_0xfcb712[_0x458a('0x79')]();_0x41e32f[_0x458a('0x40')](_0x458a('0x7a'),_0x502c02['id']);_0x2adefe[_0x458a('0x7b')](db[_0x458a('0x6e')][_0x458a('0x35')](_0x41e32f['toString'](),{'type':db[_0x458a('0x6e')][_0x458a('0x7c')][_0x458a('0x7d')]})[_0x458a('0x28')](function(_0xff15ec){if(_0xff15ec[_0x458a('0x3a')]===0x1){return _0x502c02['id'];}else{var _0x11b3b1=_['every'](_['map'](_0xff15ec,'TeamId'),function(_0x53a93e){return _[_0x458a('0x7e')](_0x5274df,_0x53a93e);});if(_0x11b3b1){return _0x502c02['id'];}}}));}}return BPromise[_0x458a('0x7f')](_0x2adefe)[_0x458a('0x28')](function(_0xc6b04a){_0x457186=_(_0x457186)['union'](_0xc6b04a)[_0x458a('0x80')]()[_0x458a('0x81')]();return db[_0x458a('0x46')][_0x458a('0x4d')]({'where':{'id':_0x2903c2['params']['id']}})['then'](function(_0x18a29b){return db[_0x458a('0x6e')][_0x458a('0x6f')](function(_0x27dbee){return _0x18a29b['removeTeams'](_0x2903c2[_0x458a('0x35')][_0x458a('0x68')],{'transaction':_0x27dbee})[_0x458a('0x28')](function(){if(!_[_0x458a('0x82')](_0x457186)){return _0x18a29b[_0x458a('0x83')](_0x457186,{'transaction':_0x27dbee});}})[_0x458a('0x28')](function(){_0x457186[_0x458a('0x72')](function(_0xd05241){socket[_0x458a('0x84')](_0x458a('0x85'),{'UserId':_0xd05241,'FaxQueueId':_0x18a29b['id']});});});});});});})['then'](respondWithStatusCode(_0x42d2a2,null))['catch'](handleError(_0x42d2a2,null));};exports[_0x458a('0x86')]=function(_0x365b25,_0x39715f,_0x331f5f){return db[_0x458a('0x46')][_0x458a('0x4d')]({'where':{'id':_0x365b25[_0x458a('0x57')]['id']}})['then'](handleEntityNotFound(_0x39715f,null))[_0x458a('0x28')](function(_0x5aa440){if(_0x5aa440){return _0x5aa440[_0x458a('0x86')](_0x365b25[_0x458a('0x50')][_0x458a('0x68')],_['omit'](_0x365b25['body'],[_0x458a('0x68'),'id'])||{})[_0x458a('0x87')](function(_0x241c72){for(var _0x46ee2=0x0;_0x46ee2<_0x365b25[_0x458a('0x50')]['ids'][_0x458a('0x3a')];_0x46ee2+=0x1){socket[_0x458a('0x84')](_0x458a('0x73'),{'UserId':_0x365b25[_0x458a('0x50')][_0x458a('0x68')][_0x46ee2],'FaxQueueId':_0x365b25[_0x458a('0x57')]['id']});}return _0x241c72;});}})[_0x458a('0x28')](respondWithResult(_0x39715f,null))[_0x458a('0x4e')](handleError(_0x39715f,null));};exports[_0x458a('0x83')]=function(_0x52b844,_0x3051d2,_0x543b46){return db[_0x458a('0x46')][_0x458a('0x4d')]({'where':{'id':_0x52b844[_0x458a('0x57')]['id']}})['then'](handleEntityNotFound(_0x3051d2,null))['then'](function(_0x3b7147){if(_0x3b7147){return _0x3b7147['removeAgents'](_0x52b844[_0x458a('0x35')]['ids'])[_0x458a('0x28')](function(){if(_[_0x458a('0x88')](_0x52b844[_0x458a('0x35')]['ids'])){for(var _0x1469d0=0x0;_0x1469d0<_0x52b844[_0x458a('0x35')]['ids'][_0x458a('0x3a')];_0x1469d0+=0x1){socket['emit'](_0x458a('0x85'),{'UserId':Number(_0x52b844[_0x458a('0x35')][_0x458a('0x68')][_0x1469d0]),'FaxQueueId':Number(_0x52b844['params']['id'])});}}else{socket[_0x458a('0x84')](_0x458a('0x85'),{'UserId':Number(_0x52b844[_0x458a('0x35')][_0x458a('0x68')]),'FaxQueueId':Number(_0x52b844[_0x458a('0x57')]['id'])});}});}})[_0x458a('0x28')](respondWithStatusCode(_0x3051d2,null))['catch'](handleError(_0x3051d2,null));};exports[_0x458a('0x89')]=function(_0x396f51,_0x57cd4b,_0x13db18){var _0x187bc8={};var _0x197858={};var _0x48622f;var _0x83eeac;return db[_0x458a('0x46')][_0x458a('0x5a')]({'where':{'id':_0x396f51['params']['id']}})[_0x458a('0x28')](handleEntityNotFound(_0x57cd4b,null))[_0x458a('0x28')](function(_0x16bfbe){if(_0x16bfbe){_0x48622f=_0x16bfbe;_0x197858[_0x458a('0x34')]=_[_0x458a('0x4c')](db[_0x458a('0x5d')][_0x458a('0x31')]);_0x197858[_0x458a('0x35')]=_['keys'](_0x396f51[_0x458a('0x35')]);_0x197858['filters']=_['intersection'](_0x197858[_0x458a('0x34')],_0x197858[_0x458a('0x35')]);_0x187bc8['attributes']=_[_0x458a('0x37')](_0x197858['model'],qs[_0x458a('0x39')](_0x396f51['query'][_0x458a('0x39')]));_0x187bc8[_0x458a('0x38')]=_0x187bc8[_0x458a('0x38')][_0x458a('0x3a')]?_0x187bc8['attributes']:_0x197858[_0x458a('0x34')];_0x187bc8[_0x458a('0x3e')]=qs[_0x458a('0x3f')](_0x396f51['query'][_0x458a('0x3f')]);_0x187bc8[_0x458a('0x40')]=qs[_0x458a('0x36')](_[_0x458a('0x41')](_0x396f51['query'],_0x197858[_0x458a('0x36')]));if(_0x396f51['query']['filter']){_0x187bc8['where']=_[_0x458a('0x43')](_0x187bc8[_0x458a('0x40')],{'$or':_['map'](_0x187bc8[_0x458a('0x38')],function(_0x49297c){var _0x2545eb={};_0x2545eb[_0x49297c]={'$like':'%'+_0x396f51['query'][_0x458a('0x42')]+'%'};return _0x2545eb;})});}_0x187bc8=_['merge']({},_0x187bc8,_0x396f51[_0x458a('0x45')]);return _0x48622f[_0x458a('0x89')](_0x187bc8);}})[_0x458a('0x28')](function(_0x150ae8){if(_0x150ae8){_0x83eeac=_0x150ae8[_0x458a('0x3a')];if(!_0x396f51[_0x458a('0x35')][_0x458a('0x3b')]('nolimit')){_0x187bc8[_0x458a('0x3d')]=qs[_0x458a('0x3d')](_0x396f51[_0x458a('0x35')]['limit']);_0x187bc8['offset']=qs[_0x458a('0x21')](_0x396f51[_0x458a('0x35')][_0x458a('0x21')]);}return _0x48622f[_0x458a('0x89')](_0x187bc8);}})[_0x458a('0x28')](function(_0x4856b4){if(_0x4856b4){return _0x4856b4?{'count':_0x83eeac,'rows':_0x4856b4}:null;}})[_0x458a('0x28')](respondWithResult(_0x57cd4b,null))[_0x458a('0x4e')](handleError(_0x57cd4b,null));}; \ No newline at end of file +var _0x8307=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','faxPause','createdAt','format','SIP','updatedAt','getTeams','findOne','Team','addTeams','User','online','voicePause','flatMap','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','Agents','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','getAgents','options','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x313b44,_0x435e01){var _0xdc1699=function(_0x3cdd9d){while(--_0x3cdd9d){_0x313b44['push'](_0x313b44['shift']());}};_0xdc1699(++_0x435e01);}(_0x8307,0xc4));var _0x7830=function(_0x22a33a,_0x4a7487){_0x22a33a=_0x22a33a-0x0;var _0x2d0a92=_0x8307[_0x22a33a];return _0x2d0a92;};'use strict';var pdf=require(_0x7830('0x0'));var emlformat=require(_0x7830('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7830('0x2'));var jsonpatch=require(_0x7830('0x3'));var rp=require(_0x7830('0x4'));var moment=require('moment');var BPromise=require(_0x7830('0x5'));var Mustache=require(_0x7830('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7830('0x7'));var csv=require('to-csv');var ejs=require(_0x7830('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7830('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7830('0xa'));var toCsv=require(_0x7830('0xb'));var querystring=require('querystring');var Papa=require(_0x7830('0xc'));var Redis=require(_0x7830('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7830('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7830('0xf'))(_0x7830('0x10'));var utils=require(_0x7830('0x11'));var config=require(_0x7830('0x12'));var db=require(_0x7830('0x13'))['db'];config[_0x7830('0x14')]=_[_0x7830('0x15')](config[_0x7830('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7830('0x16'))(new Redis(config[_0x7830('0x14')]));require(_0x7830('0x17'))['register'](socket);function respondWithStatusCode(_0x4dd3e0,_0x5818f6){_0x5818f6=_0x5818f6||0xcc;return function(_0x405533){if(_0x405533){return _0x4dd3e0['sendStatus'](_0x5818f6);}return _0x4dd3e0[_0x7830('0x18')](_0x5818f6)[_0x7830('0x19')]();};}function respondWithResult(_0x29a4bd,_0x38906b){_0x38906b=_0x38906b||0xc8;return function(_0x12f0c8){if(_0x12f0c8){return _0x29a4bd[_0x7830('0x18')](_0x38906b)[_0x7830('0x1a')](_0x12f0c8);}};}function respondWithFilteredResult(_0x316fbe,_0x355c4e){return function(_0x39748e){if(_0x39748e){var _0x3bc49a=_0x39748e[_0x7830('0x1b')],_0x1b4e2a=_0x355c4e['offset'],_0xf5cda=_0x355c4e[_0x7830('0x1c')]+_0x355c4e[_0x7830('0x1d')],_0x12dca0;if(_0xf5cda>=_0x3bc49a){_0xf5cda=_0x3bc49a;_0x12dca0=0xc8;}else{_0x12dca0=0xce;}_0x316fbe[_0x7830('0x18')](_0x12dca0);return _0x316fbe[_0x7830('0x1e')](_0x7830('0x1f'),_0x1b4e2a+'-'+_0xf5cda+'/'+_0x3bc49a)[_0x7830('0x1a')](_0x39748e);}return null;};}function patchUpdates(_0x1eaf27){return function(_0x42ea90){try{jsonpatch['apply'](_0x42ea90,_0x1eaf27,!![]);}catch(_0xbfca57){return BPromise[_0x7830('0x20')](_0xbfca57);}return _0x42ea90[_0x7830('0x21')]();};}function saveUpdates(_0x152213,_0x3ab7d6){return function(_0x549151){if(_0x549151){return _0x549151[_0x7830('0x22')](_0x152213)[_0x7830('0x23')](function(_0x3da993){return _0x3da993;});}return null;};}function removeEntity(_0x56efc3,_0x2f69d3){return function(_0x4ef5ac){if(_0x4ef5ac){return _0x4ef5ac['destroy']()[_0x7830('0x23')](function(){var _0x2b7091=_0x4ef5ac[_0x7830('0x24')]({'plain':!![]});var _0x1fa035=_0x7830('0x25');return db[_0x7830('0x26')][_0x7830('0x27')]({'where':{'type':_0x1fa035,'resourceId':_0x2b7091['id']}})[_0x7830('0x23')](function(){return _0x4ef5ac;});})[_0x7830('0x23')](function(){_0x56efc3[_0x7830('0x18')](0xcc)[_0x7830('0x19')]();});}};}function handleEntityNotFound(_0x17b1c6,_0x5cbfc2){return function(_0x2cc55e){if(!_0x2cc55e){_0x17b1c6[_0x7830('0x28')](0x194);}return _0x2cc55e;};}function handleError(_0x555eab,_0x2a6018){_0x2a6018=_0x2a6018||0x1f4;return function(_0x3b6410){logger['error'](_0x3b6410[_0x7830('0x29')]);if(_0x3b6410[_0x7830('0x2a')]){delete _0x3b6410['name'];}_0x555eab[_0x7830('0x18')](_0x2a6018)[_0x7830('0x2b')](_0x3b6410);};}exports[_0x7830('0x2c')]=function(_0x12debf,_0x461fe){var _0x172bb7={},_0x4f798d={},_0x116fdd={'count':0x0,'rows':[]};var _0x3a5c9c=_[_0x7830('0x2d')](db[_0x7830('0x2e')][_0x7830('0x2f')],function(_0x1f3b8f){return{'name':_0x1f3b8f[_0x7830('0x30')],'type':_0x1f3b8f[_0x7830('0x31')][_0x7830('0x32')]};});_0x4f798d[_0x7830('0x33')]=_[_0x7830('0x2d')](_0x3a5c9c,_0x7830('0x2a'));_0x4f798d[_0x7830('0x34')]=_[_0x7830('0x35')](_0x12debf[_0x7830('0x34')]);_0x4f798d['filters']=_[_0x7830('0x36')](_0x4f798d[_0x7830('0x33')],_0x4f798d['query']);_0x172bb7[_0x7830('0x37')]=_['intersection'](_0x4f798d['model'],qs[_0x7830('0x38')](_0x12debf[_0x7830('0x34')][_0x7830('0x38')]));_0x172bb7[_0x7830('0x37')]=_0x172bb7[_0x7830('0x37')][_0x7830('0x39')]?_0x172bb7[_0x7830('0x37')]:_0x4f798d['model'];if(!_0x12debf[_0x7830('0x34')][_0x7830('0x3a')](_0x7830('0x3b'))){_0x172bb7[_0x7830('0x1d')]=qs[_0x7830('0x1d')](_0x12debf[_0x7830('0x34')]['limit']);_0x172bb7['offset']=qs[_0x7830('0x1c')](_0x12debf[_0x7830('0x34')][_0x7830('0x1c')]);}_0x172bb7[_0x7830('0x3c')]=qs[_0x7830('0x3d')](_0x12debf[_0x7830('0x34')][_0x7830('0x3d')]);_0x172bb7[_0x7830('0x3e')]=qs[_0x7830('0x3f')](_[_0x7830('0x40')](_0x12debf[_0x7830('0x34')],_0x4f798d[_0x7830('0x3f')]),_0x3a5c9c);if(_0x12debf[_0x7830('0x34')][_0x7830('0x41')]){_0x172bb7[_0x7830('0x3e')]=_[_0x7830('0x42')](_0x172bb7['where'],{'$or':_['map'](_0x3a5c9c,function(_0xf5170e){if(_0xf5170e[_0x7830('0x31')]!=='VIRTUAL'){var _0x266a27={};_0x266a27[_0xf5170e[_0x7830('0x2a')]]={'$like':'%'+_0x12debf['query'][_0x7830('0x41')]+'%'};return _0x266a27;}})});}_0x172bb7=_['merge']({},_0x172bb7,_0x12debf['options']);var _0x167411={'where':_0x172bb7['where']};return db['FaxQueue'][_0x7830('0x1b')](_0x167411)[_0x7830('0x23')](function(_0x65bcf2){_0x116fdd['count']=_0x65bcf2;if(_0x12debf[_0x7830('0x34')][_0x7830('0x43')]){_0x172bb7['include']=[{'all':!![]}];}return db[_0x7830('0x2e')][_0x7830('0x44')](_0x172bb7);})[_0x7830('0x23')](function(_0x5cce10){_0x116fdd[_0x7830('0x45')]=_0x5cce10;return _0x116fdd;})[_0x7830('0x23')](respondWithFilteredResult(_0x461fe,_0x172bb7))[_0x7830('0x46')](handleError(_0x461fe,null));};exports[_0x7830('0x47')]=function(_0x3bfaab,_0x525fcc){var _0x3f2a4a={'raw':!![],'where':{'id':_0x3bfaab[_0x7830('0x48')]['id']}},_0x2bcaf1={};_0x2bcaf1[_0x7830('0x33')]=_['keys'](db['FaxQueue'][_0x7830('0x2f')]);_0x2bcaf1[_0x7830('0x34')]=_[_0x7830('0x35')](_0x3bfaab[_0x7830('0x34')]);_0x2bcaf1[_0x7830('0x3f')]=_[_0x7830('0x36')](_0x2bcaf1[_0x7830('0x33')],_0x2bcaf1['query']);_0x3f2a4a[_0x7830('0x37')]=_[_0x7830('0x36')](_0x2bcaf1[_0x7830('0x33')],qs[_0x7830('0x38')](_0x3bfaab[_0x7830('0x34')][_0x7830('0x38')]));_0x3f2a4a[_0x7830('0x37')]=_0x3f2a4a['attributes'][_0x7830('0x39')]?_0x3f2a4a[_0x7830('0x37')]:_0x2bcaf1[_0x7830('0x33')];if(_0x3bfaab[_0x7830('0x34')][_0x7830('0x43')]){_0x3f2a4a[_0x7830('0x49')]=[{'all':!![]}];}_0x3f2a4a=_[_0x7830('0x42')]({},_0x3f2a4a,_0x3bfaab['options']);return db[_0x7830('0x2e')][_0x7830('0x4a')](_0x3f2a4a)['then'](handleEntityNotFound(_0x525fcc,null))[_0x7830('0x23')](respondWithResult(_0x525fcc,null))[_0x7830('0x46')](handleError(_0x525fcc,null));};exports[_0x7830('0x4b')]=function(_0x1e74e0,_0x269854){return db[_0x7830('0x2e')][_0x7830('0x4b')](_0x1e74e0[_0x7830('0x4c')],{})[_0x7830('0x23')](function(_0x357300){var _0x33076e=_0x1e74e0['user'][_0x7830('0x24')]({'plain':!![]});if(!_0x33076e)throw new Error(_0x7830('0x4d'));if(_0x33076e[_0x7830('0x4e')]===_0x7830('0x4f')){var _0x4d2ea4=_0x357300[_0x7830('0x24')]({'plain':!![]});var _0xe8c68d=_0x7830('0x25');return db[_0x7830('0x50')][_0x7830('0x4a')]({'where':{'name':_0xe8c68d,'userProfileId':_0x33076e[_0x7830('0x51')]},'raw':!![]})[_0x7830('0x23')](function(_0x4159be){if(_0x4159be&&_0x4159be['autoAssociation']===0x0){return db[_0x7830('0x26')][_0x7830('0x4b')]({'name':_0x4d2ea4[_0x7830('0x2a')],'resourceId':_0x4d2ea4['id'],'type':_0x4159be[_0x7830('0x2a')],'sectionId':_0x4159be['id']},{})[_0x7830('0x23')](function(){return _0x357300;});}else{return _0x357300;}})[_0x7830('0x46')](function(_0x334e7f){logger[_0x7830('0x52')](_0x7830('0x53'),_0x334e7f);throw _0x334e7f;});}return _0x357300;})[_0x7830('0x23')](respondWithResult(_0x269854,0xc9))[_0x7830('0x46')](handleError(_0x269854,null));};exports[_0x7830('0x22')]=function(_0x35f188,_0x7985bb){if(_0x35f188['body']['id']){delete _0x35f188[_0x7830('0x4c')]['id'];}return db[_0x7830('0x2e')]['find']({'where':{'id':_0x35f188[_0x7830('0x48')]['id']}})['then'](handleEntityNotFound(_0x7985bb,null))[_0x7830('0x23')](saveUpdates(_0x35f188[_0x7830('0x4c')],null))['then'](respondWithResult(_0x7985bb,null))[_0x7830('0x46')](handleError(_0x7985bb,null));};exports['destroy']=function(_0x56f554,_0x2e909c){return db[_0x7830('0x2e')][_0x7830('0x4a')]({'where':{'id':_0x56f554[_0x7830('0x48')]['id']}})[_0x7830('0x23')](handleEntityNotFound(_0x2e909c,null))[_0x7830('0x23')](removeEntity(_0x2e909c,null))[_0x7830('0x46')](handleError(_0x2e909c,null));};exports['describe']=function(_0x23162a,_0x3106fe){return db[_0x7830('0x2e')][_0x7830('0x54')]()[_0x7830('0x23')](respondWithResult(_0x3106fe,null))[_0x7830('0x46')](handleError(_0x3106fe,null));};exports[_0x7830('0x55')]=function(_0x139608,_0x42fef9,_0x19bb5c){var _0x2d20d6={'raw':!![],'where':{}},_0x15a633={},_0x9d9de4;return db[_0x7830('0x2e')]['findOne']({'where':{'id':_0x139608[_0x7830('0x48')]['id']}})[_0x7830('0x23')](handleEntityNotFound(_0x42fef9,null))['then'](function(_0x505238){if(_0x505238){_0x9d9de4=_0x505238['get']({'plain':!![]});_0x15a633[_0x7830('0x33')]=_[_0x7830('0x35')](db[_0x7830('0x56')]['rawAttributes']);_0x15a633[_0x7830('0x34')]=_['keys'](_0x139608[_0x7830('0x34')]);_0x15a633[_0x7830('0x3f')]=_[_0x7830('0x36')](_0x15a633[_0x7830('0x33')],_0x15a633[_0x7830('0x34')]);_0x2d20d6['attributes']=_[_0x7830('0x36')](_0x15a633[_0x7830('0x33')],qs[_0x7830('0x38')](_0x139608[_0x7830('0x34')][_0x7830('0x38')]));_0x2d20d6[_0x7830('0x37')]=_0x2d20d6['attributes'][_0x7830('0x39')]?_0x2d20d6['attributes']:_0x15a633[_0x7830('0x33')];if(!_0x139608[_0x7830('0x34')]['hasOwnProperty'](_0x7830('0x3b'))){_0x2d20d6['limit']=qs[_0x7830('0x1d')](_0x139608[_0x7830('0x34')][_0x7830('0x1d')]);_0x2d20d6[_0x7830('0x1c')]=qs[_0x7830('0x1c')](_0x139608[_0x7830('0x34')]['offset']);}_0x2d20d6[_0x7830('0x3c')]=qs[_0x7830('0x3d')](_0x139608[_0x7830('0x34')]['sort']);_0x2d20d6[_0x7830('0x3e')]=qs[_0x7830('0x3f')](_[_0x7830('0x40')](_0x139608[_0x7830('0x34')],_0x15a633[_0x7830('0x3f')]));_0x2d20d6[_0x7830('0x3e')][_0x7830('0x57')]=_0x505238['id'];if(_0x139608[_0x7830('0x34')][_0x7830('0x41')]){_0x2d20d6[_0x7830('0x3e')]=_['merge'](_0x2d20d6[_0x7830('0x3e')],{'$or':_[_0x7830('0x2d')](_0x2d20d6[_0x7830('0x37')],function(_0x43b768){var _0x51af6a={};_0x51af6a[_0x43b768]={'$like':'%'+_0x139608[_0x7830('0x34')][_0x7830('0x41')]+'%'};return _0x51af6a;})});}_0x2d20d6=_[_0x7830('0x42')]({},_0x2d20d6,_0x139608['options']);return db[_0x7830('0x56')][_0x7830('0x44')](_0x2d20d6);}})[_0x7830('0x23')](function(_0x3a0b0b){if(_0x3a0b0b){return db['User'][_0x7830('0x58')]({'where':{'id':_[_0x7830('0x2d')](_0x3a0b0b,_0x7830('0x59')),'role':_0x7830('0x5a')},'attributes':['id',_0x7830('0x2a'),_0x7830('0x5b'),'updatedAt',_0x7830('0x5c')]});}})[_0x7830('0x23')](function(_0x22c49e){if(_0x22c49e){return{'count':_0x22c49e[_0x7830('0x1b')],'rows':_[_0x7830('0x2d')](_0x22c49e['rows'],function(_0x4f231f){return{'membername':_0x4f231f[_0x7830('0x2a')],'UserId':_0x4f231f['id'],'queue_name':_0x9d9de4[_0x7830('0x2a')],'FaxQueueId':_0x9d9de4['id'],'interface':util[_0x7830('0x5d')]('%s/%s',_0x7830('0x5e'),_0x4f231f['name']),'penalty':0x0,'paused':_0x4f231f[_0x7830('0x5b')],'createdAt':_0x4f231f[_0x7830('0x5c')],'updatedAt':_0x4f231f[_0x7830('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7830('0x23')](respondWithFilteredResult(_0x42fef9,_0x2d20d6))['catch'](handleError(_0x42fef9,null));};exports[_0x7830('0x60')]=function(_0x4ff961,_0x88883f,_0x5415af){var _0x10ac8a={};var _0x4ec3c8={};var _0x276d9c;var _0x71b8a1;return db['FaxQueue'][_0x7830('0x61')]({'where':{'id':_0x4ff961['params']['id']}})[_0x7830('0x23')](handleEntityNotFound(_0x88883f,null))[_0x7830('0x23')](function(_0x263f33){if(_0x263f33){_0x276d9c=_0x263f33;_0x4ec3c8[_0x7830('0x33')]=_[_0x7830('0x35')](db[_0x7830('0x62')][_0x7830('0x2f')]);_0x4ec3c8[_0x7830('0x34')]=_[_0x7830('0x35')](_0x4ff961['query']);_0x4ec3c8[_0x7830('0x3f')]=_[_0x7830('0x36')](_0x4ec3c8['model'],_0x4ec3c8['query']);_0x10ac8a['attributes']=_[_0x7830('0x36')](_0x4ec3c8[_0x7830('0x33')],qs[_0x7830('0x38')](_0x4ff961[_0x7830('0x34')][_0x7830('0x38')]));_0x10ac8a[_0x7830('0x37')]=_0x10ac8a[_0x7830('0x37')]['length']?_0x10ac8a[_0x7830('0x37')]:_0x4ec3c8['model'];_0x10ac8a[_0x7830('0x3c')]=qs['sort'](_0x4ff961[_0x7830('0x34')][_0x7830('0x3d')]);_0x10ac8a[_0x7830('0x3e')]=qs[_0x7830('0x3f')](_['pick'](_0x4ff961[_0x7830('0x34')],_0x4ec3c8[_0x7830('0x3f')]));if(_0x4ff961[_0x7830('0x34')][_0x7830('0x41')]){_0x10ac8a[_0x7830('0x3e')]=_['merge'](_0x10ac8a['where'],{'$or':_[_0x7830('0x2d')](_0x10ac8a['attributes'],function(_0x580c18){var _0xe0f380={};_0xe0f380[_0x580c18]={'$like':'%'+_0x4ff961['query'][_0x7830('0x41')]+'%'};return _0xe0f380;})});}_0x10ac8a=_[_0x7830('0x42')]({},_0x10ac8a,_0x4ff961['options']);return _0x276d9c[_0x7830('0x60')](_0x10ac8a);}})['then'](function(_0x241a5f){if(_0x241a5f){_0x71b8a1=_0x241a5f['length'];if(!_0x4ff961[_0x7830('0x34')][_0x7830('0x3a')](_0x7830('0x3b'))){_0x10ac8a['limit']=qs[_0x7830('0x1d')](_0x4ff961[_0x7830('0x34')]['limit']);_0x10ac8a[_0x7830('0x1c')]=qs['offset'](_0x4ff961[_0x7830('0x34')][_0x7830('0x1c')]);}return _0x276d9c[_0x7830('0x60')](_0x10ac8a);}})['then'](function(_0x27afae){if(_0x27afae){return _0x27afae?{'count':_0x71b8a1,'rows':_0x27afae}:null;}})[_0x7830('0x23')](respondWithResult(_0x88883f,null))[_0x7830('0x46')](handleError(_0x88883f,null));};exports[_0x7830('0x63')]=function(_0x491d44,_0x57b9cb,_0x34aedd){var _0x246977=_0x491d44[_0x7830('0x4c')]['ids'];return db[_0x7830('0x62')][_0x7830('0x44')]({'where':{'id':_0x246977},'attributes':['id'],'include':[{'model':db[_0x7830('0x64')],'as':'Agents','attributes':['id','name',_0x7830('0x65'),_0x7830('0x66'),'interface'],'raw':!![]}]})[_0x7830('0x23')](function(_0x50fcd1){if(_0x50fcd1){var _0x48666d=_[_0x7830('0x67')](_0x50fcd1,function(_0x4dcfe6){var _0x3e16f8=_0x4dcfe6['get']({'plain':!![]});return _0x3e16f8['Agents'];});return db[_0x7830('0x2e')][_0x7830('0x4a')]({'where':{'id':_0x491d44['params']['id']}})['then'](function(_0x4c610b){return db['sequelize'][_0x7830('0x68')](function(_0x37a233){return _0x4c610b[_0x7830('0x63')](_0x246977,{'transaction':_0x37a233})[_0x7830('0x23')](function(){return BPromise['each'](_0x48666d,function(_0x361e9b){return db[_0x7830('0x56')][_0x7830('0x69')]({'where':{'UserId':_0x361e9b['id'],'FaxQueueId':_0x491d44[_0x7830('0x48')]['id']},'transaction':_0x37a233});});})[_0x7830('0x23')](function(){_0x48666d[_0x7830('0x6a')](function(_0xecdac8){socket[_0x7830('0x6b')](_0x7830('0x6c'),{'UserId':_0xecdac8['id'],'FaxQueueId':_0x4c610b['id']});});});});});}})['then'](respondWithStatusCode(_0x57b9cb,null))[_0x7830('0x46')](handleError(_0x57b9cb,null));};exports[_0x7830('0x6d')]=function(_0x68052,_0x3742fd,_0x130b01){return db[_0x7830('0x62')][_0x7830('0x44')]({'where':{'id':_0x68052[_0x7830('0x34')][_0x7830('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7830('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x7830('0x23')](handleEntityNotFound(_0x3742fd,null))[_0x7830('0x23')](function(_0x2ec5d7){var _0xcc7e=_['map'](_0x2ec5d7,'id');var _0x24c1c7=[];var _0x4dfd7c=[];var _0x2751ee=squel[_0x7830('0x70')]();_0x2751ee['field'](_0x7830('0x71'))[_0x7830('0x72')](_0x7830('0x73'),'tq')[_0x7830('0x74')](_0x7830('0x75'),'ut',_0x7830('0x76'))['where'](_0x7830('0x77'),_0x68052[_0x7830('0x48')]['id']);for(var _0x383020=0x0;_0x383020<_0x2ec5d7[_0x7830('0x39')];_0x383020+=0x1){let _0x266004=_0x2ec5d7[_0x383020];for(var _0x48d9e4=0x0;_0x48d9e4<_0x266004[_0x7830('0x6f')]['length'];_0x48d9e4+=0x1){let _0x46299f=_0x266004[_0x7830('0x6f')][_0x48d9e4];var _0x53b342=_0x2751ee['clone']();_0x53b342[_0x7830('0x3e')](_0x7830('0x78'),_0x46299f['id']);_0x4dfd7c[_0x7830('0x79')](db[_0x7830('0x7a')][_0x7830('0x34')](_0x53b342[_0x7830('0x7b')](),{'type':db[_0x7830('0x7a')][_0x7830('0x7c')][_0x7830('0x7d')]})[_0x7830('0x23')](function(_0x4525e6){if(_0x4525e6[_0x7830('0x39')]===0x1){return _0x46299f['id'];}else{var _0x14b8b1=_[_0x7830('0x7e')](_[_0x7830('0x2d')](_0x4525e6,'TeamId'),function(_0x2885ce){return _[_0x7830('0x7f')](_0xcc7e,_0x2885ce);});if(_0x14b8b1){return _0x46299f['id'];}}}));}}return BPromise[_0x7830('0x80')](_0x4dfd7c)[_0x7830('0x23')](function(_0x1010ba){_0x24c1c7=_(_0x24c1c7)[_0x7830('0x81')](_0x1010ba)[_0x7830('0x82')]()[_0x7830('0x83')]();return db[_0x7830('0x2e')]['find']({'where':{'id':_0x68052[_0x7830('0x48')]['id']}})['then'](function(_0x18950c){return db['sequelize'][_0x7830('0x68')](function(_0x558b19){return _0x18950c[_0x7830('0x6d')](_0x68052[_0x7830('0x34')][_0x7830('0x6e')],{'transaction':_0x558b19})['then'](function(){if(!_[_0x7830('0x84')](_0x24c1c7)){return _0x18950c[_0x7830('0x85')](_0x24c1c7,{'transaction':_0x558b19});}})[_0x7830('0x23')](function(){_0x24c1c7[_0x7830('0x6a')](function(_0x17b000){socket[_0x7830('0x6b')](_0x7830('0x86'),{'UserId':_0x17b000,'FaxQueueId':_0x18950c['id']});});});});});});})[_0x7830('0x23')](respondWithStatusCode(_0x3742fd,null))[_0x7830('0x46')](handleError(_0x3742fd,null));};exports[_0x7830('0x87')]=function(_0xa2c6c2,_0x270005,_0x2f83a3){return db[_0x7830('0x2e')][_0x7830('0x4a')]({'where':{'id':_0xa2c6c2[_0x7830('0x48')]['id']}})[_0x7830('0x23')](handleEntityNotFound(_0x270005,null))[_0x7830('0x23')](function(_0x5b0770){if(_0x5b0770){return _0x5b0770[_0x7830('0x87')](_0xa2c6c2['body']['ids'],_[_0x7830('0x88')](_0xa2c6c2[_0x7830('0x4c')],[_0x7830('0x6e'),'id'])||{})['spread'](function(_0x1772ca){for(var _0xdde9b0=0x0;_0xdde9b0<_0xa2c6c2[_0x7830('0x4c')][_0x7830('0x6e')]['length'];_0xdde9b0+=0x1){socket[_0x7830('0x6b')]('userFaxQueue:save',{'UserId':_0xa2c6c2[_0x7830('0x4c')][_0x7830('0x6e')][_0xdde9b0],'FaxQueueId':_0xa2c6c2[_0x7830('0x48')]['id']});}return _0x1772ca;});}})[_0x7830('0x23')](respondWithResult(_0x270005,null))[_0x7830('0x46')](handleError(_0x270005,null));};exports[_0x7830('0x85')]=function(_0xb1473b,_0x415953,_0x38d3a7){return db[_0x7830('0x2e')][_0x7830('0x4a')]({'where':{'id':_0xb1473b[_0x7830('0x48')]['id']}})['then'](handleEntityNotFound(_0x415953,null))[_0x7830('0x23')](function(_0x28742c){if(_0x28742c){return _0x28742c[_0x7830('0x85')](_0xb1473b[_0x7830('0x34')][_0x7830('0x6e')])[_0x7830('0x23')](function(){if(_['isArray'](_0xb1473b[_0x7830('0x34')][_0x7830('0x6e')])){for(var _0xac5aac=0x0;_0xac5aac<_0xb1473b[_0x7830('0x34')]['ids'][_0x7830('0x39')];_0xac5aac+=0x1){socket[_0x7830('0x6b')](_0x7830('0x86'),{'UserId':Number(_0xb1473b[_0x7830('0x34')][_0x7830('0x6e')][_0xac5aac]),'FaxQueueId':Number(_0xb1473b[_0x7830('0x48')]['id'])});}}else{socket[_0x7830('0x6b')](_0x7830('0x86'),{'UserId':Number(_0xb1473b[_0x7830('0x34')][_0x7830('0x6e')]),'FaxQueueId':Number(_0xb1473b[_0x7830('0x48')]['id'])});}});}})[_0x7830('0x23')](respondWithStatusCode(_0x415953,null))['catch'](handleError(_0x415953,null));};exports[_0x7830('0x89')]=function(_0x91a7f,_0x27ab1f,_0x2f11b9){var _0x2182e4={};var _0x9b3af2={};var _0xeec62b;var _0xc219c3;return db[_0x7830('0x2e')][_0x7830('0x61')]({'where':{'id':_0x91a7f[_0x7830('0x48')]['id']}})[_0x7830('0x23')](handleEntityNotFound(_0x27ab1f,null))['then'](function(_0x1a1806){if(_0x1a1806){_0xeec62b=_0x1a1806;_0x9b3af2[_0x7830('0x33')]=_[_0x7830('0x35')](db[_0x7830('0x64')][_0x7830('0x2f')]);_0x9b3af2[_0x7830('0x34')]=_[_0x7830('0x35')](_0x91a7f[_0x7830('0x34')]);_0x9b3af2[_0x7830('0x3f')]=_[_0x7830('0x36')](_0x9b3af2[_0x7830('0x33')],_0x9b3af2['query']);_0x2182e4[_0x7830('0x37')]=_['intersection'](_0x9b3af2['model'],qs['fields'](_0x91a7f[_0x7830('0x34')]['fields']));_0x2182e4[_0x7830('0x37')]=_0x2182e4[_0x7830('0x37')][_0x7830('0x39')]?_0x2182e4['attributes']:_0x9b3af2[_0x7830('0x33')];_0x2182e4['order']=qs[_0x7830('0x3d')](_0x91a7f['query'][_0x7830('0x3d')]);_0x2182e4['where']=qs['filters'](_['pick'](_0x91a7f[_0x7830('0x34')],_0x9b3af2['filters']));if(_0x91a7f[_0x7830('0x34')][_0x7830('0x41')]){_0x2182e4[_0x7830('0x3e')]=_[_0x7830('0x42')](_0x2182e4['where'],{'$or':_['map'](_0x2182e4['attributes'],function(_0x54ed5a){var _0x20eec5={};_0x20eec5[_0x54ed5a]={'$like':'%'+_0x91a7f[_0x7830('0x34')][_0x7830('0x41')]+'%'};return _0x20eec5;})});}_0x2182e4=_[_0x7830('0x42')]({},_0x2182e4,_0x91a7f[_0x7830('0x8a')]);return _0xeec62b[_0x7830('0x89')](_0x2182e4);}})[_0x7830('0x23')](function(_0x2c2268){if(_0x2c2268){_0xc219c3=_0x2c2268[_0x7830('0x39')];if(!_0x91a7f['query'][_0x7830('0x3a')](_0x7830('0x3b'))){_0x2182e4[_0x7830('0x1d')]=qs[_0x7830('0x1d')](_0x91a7f['query'][_0x7830('0x1d')]);_0x2182e4[_0x7830('0x1c')]=qs[_0x7830('0x1c')](_0x91a7f[_0x7830('0x34')][_0x7830('0x1c')]);}return _0xeec62b[_0x7830('0x89')](_0x2182e4);}})[_0x7830('0x23')](function(_0xde240a){if(_0xde240a){return _0xde240a?{'count':_0xc219c3,'rows':_0xde240a}:null;}})[_0x7830('0x23')](respondWithResult(_0x27ab1f,null))[_0x7830('0x46')](handleError(_0x27ab1f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2738f21..cd2b501 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 _0xdc71=['exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x39ccd2,_0x21d13f){var _0x705c8e=function(_0x28ba01){while(--_0x28ba01){_0x39ccd2['push'](_0x39ccd2['shift']());}};_0x705c8e(++_0x21d13f);}(_0xdc71,0xb5));var _0x1dc7=function(_0x4977e8,_0x33dead){_0x4977e8=_0x4977e8-0x0;var _0x4fdc8f=_0xdc71[_0x4977e8];return _0x4fdc8f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x1dc7('0x0'))['db'][_0x1dc7('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1dc7('0x2')](0x0);var events={'afterCreate':_0x1dc7('0x3'),'afterUpdate':_0x1dc7('0x4'),'afterDestroy':_0x1dc7('0x5')};function emitEvent(_0x4f00cd){return function(_0x49b1bc,_0x31326c,_0xf388d2){FaxQueueEvents[_0x1dc7('0x6')](_0x4f00cd+':'+_0x49b1bc['id'],_0x49b1bc);FaxQueueEvents[_0x1dc7('0x6')](_0x4f00cd,_0x49b1bc);_0xf388d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x1dc7('0x7')](e,emitEvent(event));}}module[_0x1dc7('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x0f60=['FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x31460a,_0x25a195){var _0x249161=function(_0x28c617){while(--_0x28c617){_0x31460a['push'](_0x31460a['shift']());}};_0x249161(++_0x25a195);}(_0x0f60,0x107));var _0x00f6=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x0f60[_0x1cd47d];return _0x29d52f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x00f6('0x0'))['db'][_0x00f6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x00f6('0x2')](0x0);var events={'afterCreate':_0x00f6('0x3'),'afterUpdate':_0x00f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5859a8){return function(_0x366bae,_0x521cd4,_0x3bbe99){FaxQueueEvents[_0x00f6('0x5')](_0x5859a8+':'+_0x366bae['id'],_0x366bae);FaxQueueEvents[_0x00f6('0x5')](_0x5859a8,_0x366bae);_0x3bbe99(null);};}for(var e in events){if(events[_0x00f6('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x00f6('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 4298d3e..0497d94 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 _0x1e74=['define','FaxQueue','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports'];(function(_0x29077c,_0x51e78c){var _0x936b02=function(_0x235174){while(--_0x235174){_0x29077c['push'](_0x29077c['shift']());}};_0x936b02(++_0x51e78c);}(_0x1e74,0x86));var _0x41e7=function(_0x213947,_0x13d60d){_0x213947=_0x213947-0x0;var _0x4f70d8=_0x1e74[_0x213947];return _0x4f70d8;};'use strict';var _=require(_0x41e7('0x0'));var util=require(_0x41e7('0x1'));var logger=require(_0x41e7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x41e7('0x3'));var rp=require(_0x41e7('0x4'));var fs=require('fs');var path=require(_0x41e7('0x5'));var rimraf=require(_0x41e7('0x6'));var config=require('../../config/environment');var attributes=require(_0x41e7('0x7'));module[_0x41e7('0x8')]=function(_0x18412a,_0x347c20){return _0x18412a[_0x41e7('0x9')](_0x41e7('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9527=['api','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x798fb3,_0x569a97){var _0x525e46=function(_0x1fb114){while(--_0x1fb114){_0x798fb3['push'](_0x798fb3['shift']());}};_0x525e46(++_0x569a97);}(_0x9527,0xa2));var _0x7952=function(_0x133800,_0x5e6e51){_0x133800=_0x133800-0x0;var _0x47dd37=_0x9527[_0x133800];return _0x47dd37;};'use strict';var _=require(_0x7952('0x0'));var util=require(_0x7952('0x1'));var logger=require(_0x7952('0x2'))(_0x7952('0x3'));var moment=require('moment');var BPromise=require(_0x7952('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7952('0x5'));var rimraf=require(_0x7952('0x6'));var config=require(_0x7952('0x7'));var attributes=require(_0x7952('0x8'));module[_0x7952('0x9')]=function(_0x4ed3c7,_0x284043){return _0x4ed3c7[_0x7952('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 6931ab4..96372ad 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 _0xd0e5=['then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','request'];(function(_0x5e6450,_0x112765){var _0x34071=function(_0x251048){while(--_0x251048){_0x5e6450['push'](_0x5e6450['shift']());}};_0x34071(++_0x112765);}(_0xd0e5,0xa2));var _0x5d0e=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0xd0e5[_0x34eb31];return _0x254994;};'use strict';var _=require(_0x5d0e('0x0'));var util=require(_0x5d0e('0x1'));var moment=require('moment');var BPromise=require(_0x5d0e('0x2'));var rs=require(_0x5d0e('0x3'));var fs=require('fs');var Redis=require(_0x5d0e('0x4'));var db=require(_0x5d0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d0e('0x6'))(_0x5d0e('0x7'));var config=require('../../config/environment');var jayson=require(_0x5d0e('0x8'));var client=jayson[_0x5d0e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5d0e('0xa')](config[_0x5d0e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1cf513,_0x4bd514,_0x331aac){return new BPromise(function(_0x29f185,_0x491eee){return client[_0x5d0e('0xc')](_0x1cf513,_0x331aac)[_0x5d0e('0xd')](function(_0x3d3587){logger[_0x5d0e('0xe')](_0x5d0e('0xf'),_0x4bd514,_0x5d0e('0x10'));logger[_0x5d0e('0x11')](_0x5d0e('0x12'),_0x4bd514,'request\x20sent',JSON[_0x5d0e('0x13')](_0x3d3587));if(_0x3d3587[_0x5d0e('0x14')]){if(_0x3d3587[_0x5d0e('0x14')]['code']===0x1f4){logger[_0x5d0e('0x14')]('FaxQueue,\x20%s,\x20%s',_0x4bd514,_0x3d3587[_0x5d0e('0x14')]['message']);return _0x491eee(_0x3d3587[_0x5d0e('0x14')][_0x5d0e('0x15')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4bd514,_0x3d3587[_0x5d0e('0x14')][_0x5d0e('0x15')]);return _0x29f185(_0x3d3587[_0x5d0e('0x14')][_0x5d0e('0x15')]);}else{logger[_0x5d0e('0xe')](_0x5d0e('0xf'),_0x4bd514,_0x5d0e('0x10'));_0x29f185(_0x3d3587['result'][_0x5d0e('0x15')]);}})[_0x5d0e('0x16')](function(_0x2225dd){logger[_0x5d0e('0x14')](_0x5d0e('0xf'),_0x4bd514,_0x2225dd);_0x491eee(_0x2225dd);});});}exports[_0x5d0e('0x17')]=function(_0x2b41c1){var _0x1f3e0c=this;return new Promise(function(_0x3fa149,_0x4d0653){return db[_0x5d0e('0x18')][_0x5d0e('0x19')]({'raw':_0x2b41c1[_0x5d0e('0x1a')]?_0x2b41c1[_0x5d0e('0x1a')][_0x5d0e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b41c1[_0x5d0e('0x1a')]?_0x2b41c1[_0x5d0e('0x1a')][_0x5d0e('0x1c')]||null:null,'attributes':_0x2b41c1[_0x5d0e('0x1a')]?_0x2b41c1[_0x5d0e('0x1a')][_0x5d0e('0x1d')]||null:null,'limit':_0x2b41c1[_0x5d0e('0x1a')]?_0x2b41c1[_0x5d0e('0x1a')]['limit']||null:null,'include':_0x2b41c1[_0x5d0e('0x1a')]?_0x2b41c1[_0x5d0e('0x1a')][_0x5d0e('0x1e')]?_[_0x5d0e('0x1f')](_0x2b41c1['options'][_0x5d0e('0x1e')],function(_0x25c4fd){return{'model':db[_0x25c4fd['model']],'as':_0x25c4fd['as'],'attributes':_0x25c4fd[_0x5d0e('0x1d')],'include':_0x25c4fd[_0x5d0e('0x1e')]?_['map'](_0x25c4fd['include'],function(_0x2b2c40){return{'model':db[_0x2b2c40[_0x5d0e('0x20')]],'as':_0x2b2c40['as'],'attributes':_0x2b2c40['attributes'],'include':_0x2b2c40['include']?_[_0x5d0e('0x1f')](_0x2b2c40[_0x5d0e('0x1e')],function(_0x30d9e4){return{'model':db[_0x30d9e4[_0x5d0e('0x20')]],'as':_0x30d9e4['as'],'attributes':_0x30d9e4[_0x5d0e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5d0e('0xd')](function(_0x173101){logger['info'](_0x5d0e('0x17'),_0x2b41c1);logger[_0x5d0e('0x11')](_0x5d0e('0x17'),_0x2b41c1,JSON['stringify'](_0x173101));_0x3fa149(_0x173101);})[_0x5d0e('0x16')](function(_0x265b31){logger['error'](_0x5d0e('0x17'),_0x265b31[_0x5d0e('0x15')],_0x2b41c1);_0x4d0653(_0x1f3e0c['error'](0x1f4,_0x265b31['message']));});});};exports[_0x5d0e('0x21')]=function(_0x2ac7f4){var _0x5297af=this;return new Promise(function(_0x13ff1d,_0x2d24f2){return db['FaxQueue'][_0x5d0e('0x22')]({'raw':_0x2ac7f4[_0x5d0e('0x1a')]?_0x2ac7f4[_0x5d0e('0x1a')][_0x5d0e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ac7f4[_0x5d0e('0x1a')]?_0x2ac7f4[_0x5d0e('0x1a')]['where']||null:null,'attributes':_0x2ac7f4[_0x5d0e('0x1a')]?_0x2ac7f4['options'][_0x5d0e('0x1d')]||null:null,'include':_0x2ac7f4[_0x5d0e('0x1a')]?_0x2ac7f4[_0x5d0e('0x1a')]['include']?_[_0x5d0e('0x1f')](_0x2ac7f4[_0x5d0e('0x1a')][_0x5d0e('0x1e')],function(_0x10ceaf){return{'model':db[_0x10ceaf['model']],'as':_0x10ceaf['as'],'attributes':_0x10ceaf[_0x5d0e('0x1d')],'include':_0x10ceaf['include']?_['map'](_0x10ceaf[_0x5d0e('0x1e')],function(_0x14508e){return{'model':db[_0x14508e[_0x5d0e('0x20')]],'as':_0x14508e['as'],'attributes':_0x14508e['attributes'],'include':_0x14508e[_0x5d0e('0x1e')]?_[_0x5d0e('0x1f')](_0x14508e[_0x5d0e('0x1e')],function(_0x539c49){return{'model':db[_0x539c49[_0x5d0e('0x20')]],'as':_0x539c49['as'],'attributes':_0x539c49[_0x5d0e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5d0e('0xd')](function(_0x4dd169){logger['info'](_0x5d0e('0x21'),_0x2ac7f4);logger[_0x5d0e('0x11')]('ShowFaxQueue',_0x2ac7f4,JSON[_0x5d0e('0x13')](_0x4dd169));_0x13ff1d(_0x4dd169);})['catch'](function(_0x1d05be){logger[_0x5d0e('0x14')](_0x5d0e('0x21'),_0x1d05be[_0x5d0e('0x15')],_0x2ac7f4);_0x2d24f2(_0x5297af[_0x5d0e('0x14')](0x1f4,_0x1d05be[_0x5d0e('0x15')]));});});}; \ No newline at end of file +var _0x3e39=['find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','attributes','model','ShowFaxQueue'];(function(_0x4f9fdf,_0x141230){var _0x2ed6bb=function(_0x5ea43a){while(--_0x5ea43a){_0x4f9fdf['push'](_0x4f9fdf['shift']());}};_0x2ed6bb(++_0x141230);}(_0x3e39,0x1cf));var _0x93e3=function(_0x30c76c,_0x1ea650){_0x30c76c=_0x30c76c-0x0;var _0x4119d3=_0x3e39[_0x30c76c];return _0x4119d3;};'use strict';var _=require(_0x93e3('0x0'));var util=require(_0x93e3('0x1'));var moment=require('moment');var BPromise=require(_0x93e3('0x2'));var rs=require(_0x93e3('0x3'));var fs=require('fs');var Redis=require(_0x93e3('0x4'));var db=require(_0x93e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x93e3('0x6'))(_0x93e3('0x7'));var config=require(_0x93e3('0x8'));var jayson=require(_0x93e3('0x9'));var client=jayson[_0x93e3('0xa')][_0x93e3('0xb')]({'port':0x232a});config['redis']=_[_0x93e3('0xc')](config['redis'],{'host':_0x93e3('0xd'),'port':0x18eb});var socket=require(_0x93e3('0xe'))(new Redis(config[_0x93e3('0xf')]));require('./faxQueue.socket')[_0x93e3('0x10')](socket);function respondWithRpcPromise(_0xddaa5,_0x2490e0,_0x32c76d){return new BPromise(function(_0x53355a,_0x58a471){return client[_0x93e3('0x11')](_0xddaa5,_0x32c76d)[_0x93e3('0x12')](function(_0x35a8bf){logger[_0x93e3('0x13')](_0x93e3('0x14'),_0x2490e0,_0x93e3('0x15'));logger[_0x93e3('0x16')](_0x93e3('0x17'),_0x2490e0,_0x93e3('0x15'),JSON[_0x93e3('0x18')](_0x35a8bf));if(_0x35a8bf['error']){if(_0x35a8bf[_0x93e3('0x19')][_0x93e3('0x1a')]===0x1f4){logger['error'](_0x93e3('0x14'),_0x2490e0,_0x35a8bf[_0x93e3('0x19')][_0x93e3('0x1b')]);return _0x58a471(_0x35a8bf[_0x93e3('0x19')][_0x93e3('0x1b')]);}logger[_0x93e3('0x19')](_0x93e3('0x14'),_0x2490e0,_0x35a8bf[_0x93e3('0x19')][_0x93e3('0x1b')]);return _0x53355a(_0x35a8bf[_0x93e3('0x19')][_0x93e3('0x1b')]);}else{logger['info'](_0x93e3('0x14'),_0x2490e0,_0x93e3('0x15'));_0x53355a(_0x35a8bf[_0x93e3('0x1c')][_0x93e3('0x1b')]);}})[_0x93e3('0x1d')](function(_0x1a7de4){logger[_0x93e3('0x19')](_0x93e3('0x14'),_0x2490e0,_0x1a7de4);_0x58a471(_0x1a7de4);});});}exports[_0x93e3('0x1e')]=function(_0x29b4ab){var _0x442dcf=this;return new Promise(function(_0x109acb,_0x4fbbe9){return db[_0x93e3('0x1f')][_0x93e3('0x20')]({'raw':_0x29b4ab[_0x93e3('0x21')]?_0x29b4ab[_0x93e3('0x21')][_0x93e3('0x22')]===undefined?!![]:![]:!![],'where':_0x29b4ab[_0x93e3('0x21')]?_0x29b4ab[_0x93e3('0x21')][_0x93e3('0x23')]||null:null,'attributes':_0x29b4ab[_0x93e3('0x21')]?_0x29b4ab[_0x93e3('0x21')]['attributes']||null:null,'limit':_0x29b4ab[_0x93e3('0x21')]?_0x29b4ab[_0x93e3('0x21')]['limit']||null:null,'include':_0x29b4ab[_0x93e3('0x21')]?_0x29b4ab[_0x93e3('0x21')][_0x93e3('0x24')]?_[_0x93e3('0x25')](_0x29b4ab[_0x93e3('0x21')][_0x93e3('0x24')],function(_0xa88dc2){return{'model':db[_0xa88dc2['model']],'as':_0xa88dc2['as'],'attributes':_0xa88dc2[_0x93e3('0x26')],'include':_0xa88dc2['include']?_[_0x93e3('0x25')](_0xa88dc2['include'],function(_0x361f31){return{'model':db[_0x361f31['model']],'as':_0x361f31['as'],'attributes':_0x361f31[_0x93e3('0x26')],'include':_0x361f31[_0x93e3('0x24')]?_[_0x93e3('0x25')](_0x361f31[_0x93e3('0x24')],function(_0x5e0061){return{'model':db[_0x5e0061[_0x93e3('0x27')]],'as':_0x5e0061['as'],'attributes':_0x5e0061[_0x93e3('0x26')]};}):[]};}):[]};}):[]:[]})[_0x93e3('0x12')](function(_0x444790){logger[_0x93e3('0x13')](_0x93e3('0x1e'),_0x29b4ab);logger[_0x93e3('0x16')]('GetFaxQueue',_0x29b4ab,JSON[_0x93e3('0x18')](_0x444790));_0x109acb(_0x444790);})[_0x93e3('0x1d')](function(_0x2dcbea){logger[_0x93e3('0x19')](_0x93e3('0x1e'),_0x2dcbea['message'],_0x29b4ab);_0x4fbbe9(_0x442dcf[_0x93e3('0x19')](0x1f4,_0x2dcbea[_0x93e3('0x1b')]));});});};exports[_0x93e3('0x28')]=function(_0x1e65b2){var _0x365581=this;return new Promise(function(_0x4b71d7,_0x46b00a){return db[_0x93e3('0x1f')][_0x93e3('0x29')]({'raw':_0x1e65b2[_0x93e3('0x21')]?_0x1e65b2[_0x93e3('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x1e65b2[_0x93e3('0x21')]?_0x1e65b2[_0x93e3('0x21')]['where']||null:null,'attributes':_0x1e65b2['options']?_0x1e65b2[_0x93e3('0x21')]['attributes']||null:null,'include':_0x1e65b2[_0x93e3('0x21')]?_0x1e65b2['options'][_0x93e3('0x24')]?_[_0x93e3('0x25')](_0x1e65b2[_0x93e3('0x21')][_0x93e3('0x24')],function(_0x3a089f){return{'model':db[_0x3a089f['model']],'as':_0x3a089f['as'],'attributes':_0x3a089f[_0x93e3('0x26')],'include':_0x3a089f[_0x93e3('0x24')]?_['map'](_0x3a089f[_0x93e3('0x24')],function(_0x1818c8){return{'model':db[_0x1818c8[_0x93e3('0x27')]],'as':_0x1818c8['as'],'attributes':_0x1818c8['attributes'],'include':_0x1818c8[_0x93e3('0x24')]?_[_0x93e3('0x25')](_0x1818c8[_0x93e3('0x24')],function(_0x9ccdbc){return{'model':db[_0x9ccdbc[_0x93e3('0x27')]],'as':_0x9ccdbc['as'],'attributes':_0x9ccdbc[_0x93e3('0x26')]};}):[]};}):[]};}):[]:[]})[_0x93e3('0x12')](function(_0x580816){logger['info'](_0x93e3('0x28'),_0x1e65b2);logger[_0x93e3('0x16')](_0x93e3('0x28'),_0x1e65b2,JSON[_0x93e3('0x18')](_0x580816));_0x4b71d7(_0x580816);})[_0x93e3('0x1d')](function(_0x48beb2){logger['error'](_0x93e3('0x28'),_0x48beb2[_0x93e3('0x1b')],_0x1e65b2);_0x46b00a(_0x365581[_0x93e3('0x19')](0x1f4,_0x48beb2[_0x93e3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a5d878f..d0c84af 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 _0x0ff0=['./faxQueue.events','emit','removeListener','register','length','faxQueue:'];(function(_0x2bdb3d,_0x358bf7){var _0x27a292=function(_0x9d9458){while(--_0x9d9458){_0x2bdb3d['push'](_0x2bdb3d['shift']());}};_0x27a292(++_0x358bf7);}(_0x0ff0,0x1e0));var _0x00ff=function(_0x48ecb1,_0x530dc8){_0x48ecb1=_0x48ecb1-0x0;var _0x5ccb53=_0x0ff0[_0x48ecb1];return _0x5ccb53;};'use strict';var FaxQueueEvents=require(_0x00ff('0x0'));var events=['save','remove','update'];function createListener(_0x5495ba,_0x5572f3){return function(_0x2e5cf7){_0x5572f3[_0x00ff('0x1')](_0x5495ba,_0x2e5cf7);};}function removeListener(_0x1b922a,_0x169936){return function(){FaxQueueEvents[_0x00ff('0x2')](_0x1b922a,_0x169936);};}exports[_0x00ff('0x3')]=function(_0x683970){for(var _0x20b402=0x0,_0x26978f=events[_0x00ff('0x4')];_0x20b402<_0x26978f;_0x20b402++){var _0x2f574f=events[_0x20b402];var _0x13a1df=createListener(_0x00ff('0x5')+_0x2f574f,_0x683970);FaxQueueEvents['on'](_0x2f574f,_0x13a1df);}}; \ No newline at end of file +var _0xce59=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x33cb35,_0x6240ef){var _0x50a2ac=function(_0x94b55d){while(--_0x94b55d){_0x33cb35['push'](_0x33cb35['shift']());}};_0x50a2ac(++_0x6240ef);}(_0xce59,0x1d4));var _0x9ce5=function(_0x57b4ad,_0x1f4603){_0x57b4ad=_0x57b4ad-0x0;var _0x5063e6=_0xce59[_0x57b4ad];return _0x5063e6;};'use strict';var FaxQueueEvents=require(_0x9ce5('0x0'));var events=[_0x9ce5('0x1'),_0x9ce5('0x2'),'update'];function createListener(_0x14b971,_0xecf9cc){return function(_0x5b6461){_0xecf9cc[_0x9ce5('0x3')](_0x14b971,_0x5b6461);};}function removeListener(_0x3d9588,_0x474413){return function(){FaxQueueEvents[_0x9ce5('0x4')](_0x3d9588,_0x474413);};}exports['register']=function(_0x140c81){for(var _0x15336b=0x0,_0x2693eb=events[_0x9ce5('0x5')];_0x15336b<_0x2693eb;_0x15336b++){var _0x2560e3=events[_0x15336b];var _0x56360b=createListener(_0x9ce5('0x6')+_0x2560e3,_0x140c81);FaxQueueEvents['on'](_0x2560e3,_0x56360b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 72ca507..822cc49 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 _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(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x0b0e[_0x50a448];return _0x5da8c6;};'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 +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a66b7,_0x517636){_0x5a66b7=_0x5a66b7-0x0;var _0x5f56e3=_0xb10b[_0x5a66b7];return _0x5f56e3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);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 2d4e9fb..deb81ac 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 _0xdd06=['sequelize','exports','STRING','DATE','moment'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xdd06,0xdb));var _0x6dd0=function(_0x2608cc,_0x550602){_0x2608cc=_0x2608cc-0x0;var _0x671ece=_0xdd06[_0x2608cc];return _0x671ece;};'use strict';var moment=require(_0x6dd0('0x0'));var Sequelize=require(_0x6dd0('0x1'));module[_0x6dd0('0x2')]={'uniqueid':{'type':Sequelize[_0x6dd0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6dd0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6dd0('0x4')]},'exitAt':{'type':Sequelize[_0x6dd0('0x4')]},'reason':{'type':Sequelize[_0x6dd0('0x3')]}}; \ No newline at end of file +var _0xbf32=['STRING','DATE','moment','exports'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xbf32,0x19a));var _0x2bf3=function(_0x14f2e3,_0x3dcb33){_0x14f2e3=_0x14f2e3-0x0;var _0x13140d=_0xbf32[_0x14f2e3];return _0x13140d;};'use strict';var moment=require(_0x2bf3('0x0'));var Sequelize=require('sequelize');module[_0x2bf3('0x1')]={'uniqueid':{'type':Sequelize[_0x2bf3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2bf3('0x2')]},'joinAt':{'type':Sequelize[_0x2bf3('0x3')]},'leaveAt':{'type':Sequelize[_0x2bf3('0x3')]},'acceptAt':{'type':Sequelize[_0x2bf3('0x3')]},'exitAt':{'type':Sequelize[_0x2bf3('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 c3480bb..e15b0e8 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 _0x69ed=['type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','FaxQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','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','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','fieldName'];(function(_0x47a1eb,_0x55dd48){var _0x101947=function(_0x5d7511){while(--_0x5d7511){_0x47a1eb['push'](_0x47a1eb['shift']());}};_0x101947(++_0x55dd48);}(_0x69ed,0x155));var _0xd69e=function(_0x4c9d81,_0x31d369){_0x4c9d81=_0x4c9d81-0x0;var _0x19900f=_0x69ed[_0x4c9d81];return _0x19900f;};'use strict';var pdf=require(_0xd69e('0x0'));var emlformat=require(_0xd69e('0x1'));var rimraf=require(_0xd69e('0x2'));var zipdir=require(_0xd69e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd69e('0x4'));var moment=require(_0xd69e('0x5'));var BPromise=require(_0xd69e('0x6'));var Mustache=require('mustache');var util=require(_0xd69e('0x7'));var path=require('path');var sox=require(_0xd69e('0x8'));var csv=require('to-csv');var ejs=require(_0xd69e('0x9'));var fs=require('fs');var _=require(_0xd69e('0xa'));var squel=require('squel');var crypto=require(_0xd69e('0xb'));var jsforce=require(_0xd69e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd69e('0xd'));var querystring=require(_0xd69e('0xe'));var Papa=require(_0xd69e('0xf'));var Redis=require(_0xd69e('0x10'));var authService=require(_0xd69e('0x11'));var qs=require(_0xd69e('0x12'));var as=require(_0xd69e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd69e('0x14'))(_0xd69e('0x15'));var utils=require(_0xd69e('0x16'));var config=require(_0xd69e('0x17'));var db=require(_0xd69e('0x18'))['db'];function respondWithStatusCode(_0x21aaea,_0x448bed){_0x448bed=_0x448bed||0xcc;return function(_0x19fa11){if(_0x19fa11){return _0x21aaea[_0xd69e('0x19')](_0x448bed);}return _0x21aaea[_0xd69e('0x1a')](_0x448bed)[_0xd69e('0x1b')]();};}function respondWithResult(_0x30af9a,_0x39260d){_0x39260d=_0x39260d||0xc8;return function(_0x3fc9d8){if(_0x3fc9d8){return _0x30af9a[_0xd69e('0x1a')](_0x39260d)[_0xd69e('0x1c')](_0x3fc9d8);}};}function respondWithFilteredResult(_0x2bd720,_0x115a92){return function(_0x4c4379){if(_0x4c4379){var _0x4434d4=_0x4c4379[_0xd69e('0x1d')],_0x1e4370=_0x115a92[_0xd69e('0x1e')],_0x36bfe2=_0x115a92['offset']+_0x115a92[_0xd69e('0x1f')],_0x3c49b8;if(_0x36bfe2>=_0x4434d4){_0x36bfe2=_0x4434d4;_0x3c49b8=0xc8;}else{_0x3c49b8=0xce;}_0x2bd720[_0xd69e('0x1a')](_0x3c49b8);return _0x2bd720[_0xd69e('0x20')](_0xd69e('0x21'),_0x1e4370+'-'+_0x36bfe2+'/'+_0x4434d4)[_0xd69e('0x1c')](_0x4c4379);}return null;};}function patchUpdates(_0x13c2b1){return function(_0x9b4164){try{jsonpatch['apply'](_0x9b4164,_0x13c2b1,!![]);}catch(_0x10c31a){return BPromise[_0xd69e('0x22')](_0x10c31a);}return _0x9b4164[_0xd69e('0x23')]();};}function saveUpdates(_0x18d1e8,_0x48876c){return function(_0x12c165){if(_0x12c165){return _0x12c165['update'](_0x18d1e8)[_0xd69e('0x24')](function(_0x2c1744){return _0x2c1744;});}return null;};}function removeEntity(_0x1802d6,_0x31b2f3){return function(_0x5b2a6a){if(_0x5b2a6a){return _0x5b2a6a[_0xd69e('0x25')]()['then'](function(){_0x1802d6[_0xd69e('0x1a')](0xcc)[_0xd69e('0x1b')]();});}};}function handleEntityNotFound(_0x50b1ac,_0x458d52){return function(_0x39603d){if(!_0x39603d){_0x50b1ac[_0xd69e('0x19')](0x194);}return _0x39603d;};}function handleError(_0x18a1d9,_0x401893){_0x401893=_0x401893||0x1f4;return function(_0x4189a0){logger[_0xd69e('0x26')](_0x4189a0[_0xd69e('0x27')]);if(_0x4189a0[_0xd69e('0x28')]){delete _0x4189a0[_0xd69e('0x28')];}_0x18a1d9[_0xd69e('0x1a')](_0x401893)[_0xd69e('0x29')](_0x4189a0);};}exports[_0xd69e('0x2a')]=function(_0xbc714,_0x1664ef){var _0x4e86c6={},_0x4e9b82={},_0x52c8fd={'count':0x0,'rows':[]};var _0x135c80=_['map'](db['FaxQueueReport']['rawAttributes'],function(_0x403da6){return{'name':_0x403da6[_0xd69e('0x2b')],'type':_0x403da6[_0xd69e('0x2c')][_0xd69e('0x2d')]};});_0x4e9b82[_0xd69e('0x2e')]=_[_0xd69e('0x2f')](_0x135c80,_0xd69e('0x28'));_0x4e9b82[_0xd69e('0x30')]=_[_0xd69e('0x31')](_0xbc714[_0xd69e('0x30')]);_0x4e9b82['filters']=_[_0xd69e('0x32')](_0x4e9b82[_0xd69e('0x2e')],_0x4e9b82['query']);_0x4e86c6[_0xd69e('0x33')]=_[_0xd69e('0x32')](_0x4e9b82['model'],qs[_0xd69e('0x34')](_0xbc714['query'][_0xd69e('0x34')]));_0x4e86c6['attributes']=_0x4e86c6[_0xd69e('0x33')][_0xd69e('0x35')]?_0x4e86c6[_0xd69e('0x33')]:_0x4e9b82[_0xd69e('0x2e')];if(!_0xbc714[_0xd69e('0x30')][_0xd69e('0x36')](_0xd69e('0x37'))){_0x4e86c6[_0xd69e('0x1f')]=qs[_0xd69e('0x1f')](_0xbc714[_0xd69e('0x30')]['limit']);_0x4e86c6['offset']=qs[_0xd69e('0x1e')](_0xbc714[_0xd69e('0x30')]['offset']);}_0x4e86c6[_0xd69e('0x38')]=qs[_0xd69e('0x39')](_0xbc714['query'][_0xd69e('0x39')]);_0x4e86c6[_0xd69e('0x3a')]=qs[_0xd69e('0x3b')](_[_0xd69e('0x3c')](_0xbc714[_0xd69e('0x30')],_0x4e9b82['filters']),_0x135c80);if(_0xbc714[_0xd69e('0x30')]['filter']){_0x4e86c6[_0xd69e('0x3a')]=_[_0xd69e('0x3d')](_0x4e86c6[_0xd69e('0x3a')],{'$or':_[_0xd69e('0x2f')](_0x135c80,function(_0x21c8c9){if(_0x21c8c9[_0xd69e('0x2c')]!=='VIRTUAL'){var _0x2885fa={};_0x2885fa[_0x21c8c9[_0xd69e('0x28')]]={'$like':'%'+_0xbc714['query'][_0xd69e('0x3e')]+'%'};return _0x2885fa;}})});}_0x4e86c6=_['merge']({},_0x4e86c6,_0xbc714['options']);var _0x20f562={'where':_0x4e86c6['where']};return db[_0xd69e('0x3f')][_0xd69e('0x1d')](_0x20f562)['then'](function(_0x2ba75f){_0x52c8fd[_0xd69e('0x1d')]=_0x2ba75f;if(_0xbc714[_0xd69e('0x30')][_0xd69e('0x40')]){_0x4e86c6[_0xd69e('0x41')]=[{'all':!![]}];}return db[_0xd69e('0x3f')][_0xd69e('0x42')](_0x4e86c6);})[_0xd69e('0x24')](function(_0x27f07f){_0x52c8fd[_0xd69e('0x43')]=_0x27f07f;return _0x52c8fd;})['then'](respondWithFilteredResult(_0x1664ef,_0x4e86c6))[_0xd69e('0x44')](handleError(_0x1664ef,null));};exports[_0xd69e('0x45')]=function(_0x1c4bbd,_0x556c6d){var _0x12b557={'raw':!![],'where':{'id':_0x1c4bbd[_0xd69e('0x46')]['id']}},_0x23b74b={};_0x23b74b[_0xd69e('0x2e')]=_[_0xd69e('0x31')](db[_0xd69e('0x3f')][_0xd69e('0x47')]);_0x23b74b['query']=_[_0xd69e('0x31')](_0x1c4bbd['query']);_0x23b74b[_0xd69e('0x3b')]=_['intersection'](_0x23b74b[_0xd69e('0x2e')],_0x23b74b[_0xd69e('0x30')]);_0x12b557[_0xd69e('0x33')]=_[_0xd69e('0x32')](_0x23b74b[_0xd69e('0x2e')],qs[_0xd69e('0x34')](_0x1c4bbd['query'][_0xd69e('0x34')]));_0x12b557['attributes']=_0x12b557[_0xd69e('0x33')]['length']?_0x12b557[_0xd69e('0x33')]:_0x23b74b[_0xd69e('0x2e')];if(_0x1c4bbd[_0xd69e('0x30')][_0xd69e('0x40')]){_0x12b557[_0xd69e('0x41')]=[{'all':!![]}];}_0x12b557=_[_0xd69e('0x3d')]({},_0x12b557,_0x1c4bbd['options']);return db[_0xd69e('0x3f')][_0xd69e('0x48')](_0x12b557)[_0xd69e('0x24')](handleEntityNotFound(_0x556c6d,null))[_0xd69e('0x24')](respondWithResult(_0x556c6d,null))[_0xd69e('0x44')](handleError(_0x556c6d,null));};exports['create']=function(_0x1284d3,_0xcb5304){return db[_0xd69e('0x3f')][_0xd69e('0x49')](_0x1284d3[_0xd69e('0x4a')],{})[_0xd69e('0x24')](respondWithResult(_0xcb5304,0xc9))['catch'](handleError(_0xcb5304,null));};exports[_0xd69e('0x4b')]=function(_0x5755bd,_0x513d85){if(_0x5755bd['body']['id']){delete _0x5755bd[_0xd69e('0x4a')]['id'];}return db['FaxQueueReport'][_0xd69e('0x48')]({'where':{'id':_0x5755bd['params']['id']}})[_0xd69e('0x24')](handleEntityNotFound(_0x513d85,null))['then'](saveUpdates(_0x5755bd[_0xd69e('0x4a')],null))['then'](respondWithResult(_0x513d85,null))[_0xd69e('0x44')](handleError(_0x513d85,null));};exports[_0xd69e('0x25')]=function(_0x53e4fe,_0x42a8bc){return db[_0xd69e('0x3f')][_0xd69e('0x48')]({'where':{'id':_0x53e4fe['params']['id']}})['then'](handleEntityNotFound(_0x42a8bc,null))['then'](removeEntity(_0x42a8bc,null))['catch'](handleError(_0x42a8bc,null));};exports['describe']=function(_0x372728,_0x216e6a){return db[_0xd69e('0x3f')][_0xd69e('0x4c')]()['then'](respondWithResult(_0x216e6a,null))[_0xd69e('0x44')](handleError(_0x216e6a,null));}; \ No newline at end of file +var _0x95d2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','offset','limit','json','apply','save','destroy','end','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','merge','options','count','then','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4c3900,_0x93767c){var _0x5e3339=function(_0x272435){while(--_0x272435){_0x4c3900['push'](_0x4c3900['shift']());}};_0x5e3339(++_0x93767c);}(_0x95d2,0xcd));var _0x295d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x95d2[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0x295d('0x0'));var emlformat=require(_0x295d('0x1'));var rimraf=require(_0x295d('0x2'));var zipdir=require(_0x295d('0x3'));var jsonpatch=require(_0x295d('0x4'));var rp=require(_0x295d('0x5'));var moment=require(_0x295d('0x6'));var BPromise=require(_0x295d('0x7'));var Mustache=require(_0x295d('0x8'));var util=require(_0x295d('0x9'));var path=require(_0x295d('0xa'));var sox=require(_0x295d('0xb'));var csv=require(_0x295d('0xc'));var ejs=require(_0x295d('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x295d('0xe'));var crypto=require('crypto');var jsforce=require(_0x295d('0xf'));var deskjs=require(_0x295d('0x10'));var toCsv=require(_0x295d('0xc'));var querystring=require(_0x295d('0x11'));var Papa=require(_0x295d('0x12'));var Redis=require(_0x295d('0x13'));var authService=require(_0x295d('0x14'));var qs=require(_0x295d('0x15'));var as=require(_0x295d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x295d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x295d('0x18'));var db=require(_0x295d('0x19'))['db'];function respondWithStatusCode(_0x1546e7,_0x32c4d3){_0x32c4d3=_0x32c4d3||0xcc;return function(_0x5b58c6){if(_0x5b58c6){return _0x1546e7['sendStatus'](_0x32c4d3);}return _0x1546e7[_0x295d('0x1a')](_0x32c4d3)['end']();};}function respondWithResult(_0x4508ea,_0x4d370e){_0x4d370e=_0x4d370e||0xc8;return function(_0x5f5099){if(_0x5f5099){return _0x4508ea[_0x295d('0x1a')](_0x4d370e)['json'](_0x5f5099);}};}function respondWithFilteredResult(_0x164be5,_0x2a0e11){return function(_0x5901a7){if(_0x5901a7){var _0x254b59=_0x5901a7['count'],_0x19e1eb=_0x2a0e11[_0x295d('0x1b')],_0x3b744b=_0x2a0e11[_0x295d('0x1b')]+_0x2a0e11[_0x295d('0x1c')],_0x678237;if(_0x3b744b>=_0x254b59){_0x3b744b=_0x254b59;_0x678237=0xc8;}else{_0x678237=0xce;}_0x164be5[_0x295d('0x1a')](_0x678237);return _0x164be5['set']('Content-Range',_0x19e1eb+'-'+_0x3b744b+'/'+_0x254b59)[_0x295d('0x1d')](_0x5901a7);}return null;};}function patchUpdates(_0x568e44){return function(_0x4ef610){try{jsonpatch[_0x295d('0x1e')](_0x4ef610,_0x568e44,!![]);}catch(_0x18d4a6){return BPromise['reject'](_0x18d4a6);}return _0x4ef610[_0x295d('0x1f')]();};}function saveUpdates(_0x514a71,_0x5740aa){return function(_0x3ddd0a){if(_0x3ddd0a){return _0x3ddd0a['update'](_0x514a71)['then'](function(_0x4c7f91){return _0x4c7f91;});}return null;};}function removeEntity(_0x286f36,_0x40cfd5){return function(_0x5112f4){if(_0x5112f4){return _0x5112f4[_0x295d('0x20')]()['then'](function(){_0x286f36[_0x295d('0x1a')](0xcc)[_0x295d('0x21')]();});}};}function handleEntityNotFound(_0xb05573,_0x2063ba){return function(_0xf99773){if(!_0xf99773){_0xb05573[_0x295d('0x22')](0x194);}return _0xf99773;};}function handleError(_0x5b995b,_0x497d27){_0x497d27=_0x497d27||0x1f4;return function(_0x5767cb){logger[_0x295d('0x23')](_0x5767cb[_0x295d('0x24')]);if(_0x5767cb[_0x295d('0x25')]){delete _0x5767cb[_0x295d('0x25')];}_0x5b995b[_0x295d('0x1a')](_0x497d27)[_0x295d('0x26')](_0x5767cb);};}exports[_0x295d('0x27')]=function(_0xb4c9f9,_0x4f1102){var _0x567ecd={},_0x15a78d={},_0xdd1ac0={'count':0x0,'rows':[]};var _0x1e1f2f=_[_0x295d('0x28')](db[_0x295d('0x29')][_0x295d('0x2a')],function(_0x312584){return{'name':_0x312584[_0x295d('0x2b')],'type':_0x312584[_0x295d('0x2c')][_0x295d('0x2d')]};});_0x15a78d[_0x295d('0x2e')]=_[_0x295d('0x28')](_0x1e1f2f,_0x295d('0x25'));_0x15a78d[_0x295d('0x2f')]=_[_0x295d('0x30')](_0xb4c9f9[_0x295d('0x2f')]);_0x15a78d[_0x295d('0x31')]=_[_0x295d('0x32')](_0x15a78d[_0x295d('0x2e')],_0x15a78d[_0x295d('0x2f')]);_0x567ecd[_0x295d('0x33')]=_['intersection'](_0x15a78d['model'],qs[_0x295d('0x34')](_0xb4c9f9[_0x295d('0x2f')][_0x295d('0x34')]));_0x567ecd['attributes']=_0x567ecd[_0x295d('0x33')][_0x295d('0x35')]?_0x567ecd['attributes']:_0x15a78d[_0x295d('0x2e')];if(!_0xb4c9f9['query']['hasOwnProperty']('nolimit')){_0x567ecd[_0x295d('0x1c')]=qs['limit'](_0xb4c9f9[_0x295d('0x2f')][_0x295d('0x1c')]);_0x567ecd[_0x295d('0x1b')]=qs[_0x295d('0x1b')](_0xb4c9f9['query'][_0x295d('0x1b')]);}_0x567ecd[_0x295d('0x36')]=qs[_0x295d('0x37')](_0xb4c9f9[_0x295d('0x2f')][_0x295d('0x37')]);_0x567ecd[_0x295d('0x38')]=qs[_0x295d('0x31')](_['pick'](_0xb4c9f9['query'],_0x15a78d['filters']),_0x1e1f2f);if(_0xb4c9f9[_0x295d('0x2f')][_0x295d('0x39')]){_0x567ecd[_0x295d('0x38')]=_['merge'](_0x567ecd[_0x295d('0x38')],{'$or':_[_0x295d('0x28')](_0x1e1f2f,function(_0xa643b2){if(_0xa643b2[_0x295d('0x2c')]!==_0x295d('0x3a')){var _0x4f122d={};_0x4f122d[_0xa643b2['name']]={'$like':'%'+_0xb4c9f9['query'][_0x295d('0x39')]+'%'};return _0x4f122d;}})});}_0x567ecd=_[_0x295d('0x3b')]({},_0x567ecd,_0xb4c9f9[_0x295d('0x3c')]);var _0x3fcbbb={'where':_0x567ecd[_0x295d('0x38')]};return db['FaxQueueReport'][_0x295d('0x3d')](_0x3fcbbb)[_0x295d('0x3e')](function(_0xeab74c){_0xdd1ac0[_0x295d('0x3d')]=_0xeab74c;if(_0xb4c9f9[_0x295d('0x2f')][_0x295d('0x3f')]){_0x567ecd[_0x295d('0x40')]=[{'all':!![]}];}return db[_0x295d('0x29')][_0x295d('0x41')](_0x567ecd);})[_0x295d('0x3e')](function(_0x2f4961){_0xdd1ac0[_0x295d('0x42')]=_0x2f4961;return _0xdd1ac0;})[_0x295d('0x3e')](respondWithFilteredResult(_0x4f1102,_0x567ecd))[_0x295d('0x43')](handleError(_0x4f1102,null));};exports[_0x295d('0x44')]=function(_0x261635,_0x300135){var _0x539294={'raw':!![],'where':{'id':_0x261635[_0x295d('0x45')]['id']}},_0x60f991={};_0x60f991[_0x295d('0x2e')]=_[_0x295d('0x30')](db[_0x295d('0x29')][_0x295d('0x2a')]);_0x60f991[_0x295d('0x2f')]=_[_0x295d('0x30')](_0x261635[_0x295d('0x2f')]);_0x60f991['filters']=_['intersection'](_0x60f991[_0x295d('0x2e')],_0x60f991['query']);_0x539294[_0x295d('0x33')]=_['intersection'](_0x60f991[_0x295d('0x2e')],qs['fields'](_0x261635['query'][_0x295d('0x34')]));_0x539294['attributes']=_0x539294[_0x295d('0x33')][_0x295d('0x35')]?_0x539294[_0x295d('0x33')]:_0x60f991['model'];if(_0x261635['query'][_0x295d('0x3f')]){_0x539294[_0x295d('0x40')]=[{'all':!![]}];}_0x539294=_[_0x295d('0x3b')]({},_0x539294,_0x261635[_0x295d('0x3c')]);return db[_0x295d('0x29')]['find'](_0x539294)[_0x295d('0x3e')](handleEntityNotFound(_0x300135,null))[_0x295d('0x3e')](respondWithResult(_0x300135,null))[_0x295d('0x43')](handleError(_0x300135,null));};exports[_0x295d('0x46')]=function(_0x2ec5f6,_0x54c47a){return db['FaxQueueReport'][_0x295d('0x46')](_0x2ec5f6[_0x295d('0x47')],{})[_0x295d('0x3e')](respondWithResult(_0x54c47a,0xc9))[_0x295d('0x43')](handleError(_0x54c47a,null));};exports[_0x295d('0x48')]=function(_0x699a8,_0x414781){if(_0x699a8[_0x295d('0x47')]['id']){delete _0x699a8[_0x295d('0x47')]['id'];}return db[_0x295d('0x29')]['find']({'where':{'id':_0x699a8[_0x295d('0x45')]['id']}})['then'](handleEntityNotFound(_0x414781,null))['then'](saveUpdates(_0x699a8['body'],null))[_0x295d('0x3e')](respondWithResult(_0x414781,null))[_0x295d('0x43')](handleError(_0x414781,null));};exports['destroy']=function(_0x5a3570,_0xd8e628){return db[_0x295d('0x29')][_0x295d('0x49')]({'where':{'id':_0x5a3570[_0x295d('0x45')]['id']}})[_0x295d('0x3e')](handleEntityNotFound(_0xd8e628,null))['then'](removeEntity(_0xd8e628,null))[_0x295d('0x43')](handleError(_0xd8e628,null));};exports[_0x295d('0x4a')]=function(_0x565fe8,_0x362647){return db['FaxQueueReport']['describe']()[_0x295d('0x3e')](respondWithResult(_0x362647,null))[_0x295d('0x43')](handleError(_0x362647,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index dccca6d..f7a9b89 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 _0xa32b=['./faxQueueReport.attributes','exports','FaxQueueReport','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x5cd51d,_0x20d4fa){var _0x444608=function(_0x32a9dc){while(--_0x32a9dc){_0x5cd51d['push'](_0x5cd51d['shift']());}};_0x444608(++_0x20d4fa);}(_0xa32b,0x68));var _0xba32=function(_0x33c090,_0x184b69){_0x33c090=_0x33c090-0x0;var _0x4081df=_0xa32b[_0x33c090];return _0x4081df;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require(_0xba32('0x1'))('api');var moment=require('moment');var BPromise=require(_0xba32('0x2'));var rp=require(_0xba32('0x3'));var fs=require('fs');var path=require(_0xba32('0x4'));var rimraf=require('rimraf');var config=require(_0xba32('0x5'));var attributes=require(_0xba32('0x6'));module[_0xba32('0x7')]=function(_0x312fe7,_0x31dc74){return _0x312fe7['define'](_0xba32('0x8'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xba32('0x9'),'fields':[_0xba32('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15ef=['request-promise','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15ef,0x80));var _0xf15e=function(_0x1b02a6,_0x2d7378){_0x1b02a6=_0x1b02a6-0x0;var _0x5bea08=_0x15ef[_0x1b02a6];return _0x5bea08;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var logger=require(_0xf15e('0x1'))('api');var moment=require(_0xf15e('0x2'));var BPromise=require(_0xf15e('0x3'));var rp=require(_0xf15e('0x4'));var fs=require('fs');var path=require(_0xf15e('0x5'));var rimraf=require(_0xf15e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf15e('0x7'));module[_0xf15e('0x8')]=function(_0x5e96b4,_0x5ba863){return _0x5e96b4[_0xf15e('0x9')](_0xf15e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xf15e('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 4515d58..6179562 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 _0x048d=['FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','UpdateFaxQueueReport','update','where','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b2766,_0x49f4be){var _0x365e8b=function(_0x149117){while(--_0x149117){_0x4b2766['push'](_0x4b2766['shift']());}};_0x365e8b(++_0x49f4be);}(_0x048d,0x185));var _0xd048=function(_0x412b69,_0x19e9b7){_0x412b69=_0x412b69-0x0;var _0x2edc60=_0x048d[_0x412b69];return _0x2edc60;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd048('0x0'));var rs=require(_0xd048('0x1'));var fs=require('fs');var Redis=require(_0xd048('0x2'));var db=require(_0xd048('0x3'))['db'];var utils=require(_0xd048('0x4'));var logger=require(_0xd048('0x5'))('rpc');var config=require(_0xd048('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd048('0x7')][_0xd048('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50e568,_0x292955,_0x4cdd8b){return new BPromise(function(_0x2f4591,_0x3a6d85){return client[_0xd048('0x9')](_0x50e568,_0x4cdd8b)['then'](function(_0x44dace){logger[_0xd048('0xa')](_0xd048('0xb'),_0x292955,_0xd048('0xc'));logger[_0xd048('0xd')](_0xd048('0xe'),_0x292955,_0xd048('0xc'),JSON['stringify'](_0x44dace));if(_0x44dace[_0xd048('0xf')]){if(_0x44dace['error'][_0xd048('0x10')]===0x1f4){logger[_0xd048('0xf')](_0xd048('0xb'),_0x292955,_0x44dace[_0xd048('0xf')][_0xd048('0x11')]);return _0x3a6d85(_0x44dace[_0xd048('0xf')][_0xd048('0x11')]);}logger[_0xd048('0xf')](_0xd048('0xb'),_0x292955,_0x44dace[_0xd048('0xf')]['message']);return _0x2f4591(_0x44dace[_0xd048('0xf')]['message']);}else{logger[_0xd048('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x292955,_0xd048('0xc'));_0x2f4591(_0x44dace[_0xd048('0x12')][_0xd048('0x11')]);}})[_0xd048('0x13')](function(_0xc44b40){logger[_0xd048('0xf')](_0xd048('0xb'),_0x292955,_0xc44b40);_0x3a6d85(_0xc44b40);});});}exports[_0xd048('0x14')]=function(_0x47177e){var _0x5b72fb=this;return new Promise(function(_0x5b5e7d,_0x2944ce){return db[_0xd048('0x15')][_0xd048('0x16')](_0x47177e[_0xd048('0x17')],{'raw':_0x47177e[_0xd048('0x18')]?_0x47177e[_0xd048('0x18')][_0xd048('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xb5d62){logger[_0xd048('0xa')](_0xd048('0x14'),_0x47177e);logger['debug'](_0xd048('0x14'),_0x47177e,JSON[_0xd048('0x1a')](_0xb5d62));_0x5b5e7d(_0xb5d62);})[_0xd048('0x13')](function(_0x40ddee){logger[_0xd048('0xf')](_0xd048('0x14'),_0x40ddee[_0xd048('0x11')],_0x47177e);_0x2944ce(_0x5b72fb[_0xd048('0xf')](0x1f4,_0x40ddee[_0xd048('0x11')]));});});};exports[_0xd048('0x1b')]=function(_0x2edf15){var _0x52ce94=this;return new Promise(function(_0x2a0c86,_0x2a4d7b){return db[_0xd048('0x15')][_0xd048('0x1c')](_0x2edf15['body'],{'raw':_0x2edf15[_0xd048('0x18')]?_0x2edf15['options'][_0xd048('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2edf15[_0xd048('0x18')]?_0x2edf15[_0xd048('0x18')][_0xd048('0x1d')]||null:null,'attributes':_0x2edf15[_0xd048('0x18')]?_0x2edf15[_0xd048('0x18')]['attributes']||null:null,'limit':_0x2edf15[_0xd048('0x18')]?_0x2edf15[_0xd048('0x18')][_0xd048('0x1e')]||null:null})['then'](function(_0x28c715){logger[_0xd048('0xa')](_0xd048('0x1b'),_0x2edf15);logger[_0xd048('0xd')]('UpdateFaxQueueReport',_0x2edf15,JSON[_0xd048('0x1a')](_0x28c715));_0x2a0c86(_0x28c715);})[_0xd048('0x13')](function(_0x5bf2f6){logger[_0xd048('0xf')](_0xd048('0x1b'),_0x5bf2f6[_0xd048('0x11')],_0x2edf15);_0x2a4d7b(_0x52ce94['error'](0x1f4,_0x5bf2f6[_0xd048('0x11')]));});});}; \ No newline at end of file +var _0xd265=['FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x185d8f,_0x16b7f1){var _0x39072b=function(_0x188220){while(--_0x188220){_0x185d8f['push'](_0x185d8f['shift']());}};_0x39072b(++_0x16b7f1);}(_0xd265,0x17d));var _0x5d26=function(_0x4a072e,_0x13f572){_0x4a072e=_0x4a072e-0x0;var _0x25f5f0=_0xd265[_0x4a072e];return _0x25f5f0;};'use strict';var _=require(_0x5d26('0x0'));var util=require('util');var moment=require(_0x5d26('0x1'));var BPromise=require(_0x5d26('0x2'));var rs=require(_0x5d26('0x3'));var fs=require('fs');var Redis=require(_0x5d26('0x4'));var db=require(_0x5d26('0x5'))['db'];var utils=require(_0x5d26('0x6'));var logger=require('../../config/logger')(_0x5d26('0x7'));var config=require(_0x5d26('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5d26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5121e2,_0x11167,_0x3d7f48){return new BPromise(function(_0x59c489,_0x983e85){return client[_0x5d26('0xa')](_0x5121e2,_0x3d7f48)[_0x5d26('0xb')](function(_0x2ac28b){logger[_0x5d26('0xc')](_0x5d26('0xd'),_0x11167,_0x5d26('0xe'));logger['debug'](_0x5d26('0xf'),_0x11167,_0x5d26('0xe'),JSON[_0x5d26('0x10')](_0x2ac28b));if(_0x2ac28b[_0x5d26('0x11')]){if(_0x2ac28b[_0x5d26('0x11')][_0x5d26('0x12')]===0x1f4){logger[_0x5d26('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x11167,_0x2ac28b['error'][_0x5d26('0x13')]);return _0x983e85(_0x2ac28b['error'][_0x5d26('0x13')]);}logger[_0x5d26('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x11167,_0x2ac28b[_0x5d26('0x11')][_0x5d26('0x13')]);return _0x59c489(_0x2ac28b[_0x5d26('0x11')][_0x5d26('0x13')]);}else{logger[_0x5d26('0xc')](_0x5d26('0xd'),_0x11167,_0x5d26('0xe'));_0x59c489(_0x2ac28b[_0x5d26('0x14')][_0x5d26('0x13')]);}})[_0x5d26('0x15')](function(_0x3fdb49){logger[_0x5d26('0x11')](_0x5d26('0xd'),_0x11167,_0x3fdb49);_0x983e85(_0x3fdb49);});});}exports[_0x5d26('0x16')]=function(_0x4425be){var _0x2ba0e7=this;return new Promise(function(_0x5b9975,_0x4b7b52){return db[_0x5d26('0x17')][_0x5d26('0x18')](_0x4425be[_0x5d26('0x19')],{'raw':_0x4425be[_0x5d26('0x1a')]?_0x4425be['options'][_0x5d26('0x1b')]===undefined?!![]:![]:!![]})[_0x5d26('0xb')](function(_0x12ab97){logger['info'](_0x5d26('0x16'),_0x4425be);logger[_0x5d26('0x1c')](_0x5d26('0x16'),_0x4425be,JSON[_0x5d26('0x10')](_0x12ab97));_0x5b9975(_0x12ab97);})[_0x5d26('0x15')](function(_0x133c40){logger[_0x5d26('0x11')](_0x5d26('0x16'),_0x133c40[_0x5d26('0x13')],_0x4425be);_0x4b7b52(_0x2ba0e7[_0x5d26('0x11')](0x1f4,_0x133c40[_0x5d26('0x13')]));});});};exports[_0x5d26('0x1d')]=function(_0x1e7da9){var _0xc179b8=this;return new Promise(function(_0x486fa5,_0x4028fa){return db[_0x5d26('0x17')][_0x5d26('0x1e')](_0x1e7da9[_0x5d26('0x19')],{'raw':_0x1e7da9[_0x5d26('0x1a')]?_0x1e7da9['options'][_0x5d26('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7da9['options']?_0x1e7da9[_0x5d26('0x1a')][_0x5d26('0x1f')]||null:null,'attributes':_0x1e7da9[_0x5d26('0x1a')]?_0x1e7da9['options'][_0x5d26('0x20')]||null:null,'limit':_0x1e7da9[_0x5d26('0x1a')]?_0x1e7da9[_0x5d26('0x1a')]['limit']||null:null})['then'](function(_0x4f0c28){logger['info'](_0x5d26('0x1d'),_0x1e7da9);logger[_0x5d26('0x1c')]('UpdateFaxQueueReport',_0x1e7da9,JSON[_0x5d26('0x10')](_0x4f0c28));_0x486fa5(_0x4f0c28);})[_0x5d26('0x15')](function(_0x5310e0){logger[_0x5d26('0x11')](_0x5d26('0x1d'),_0x5310e0[_0x5d26('0x13')],_0x1e7da9);_0x4028fa(_0xc179b8[_0x5d26('0x11')](0x1f4,_0x5310e0[_0x5d26('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 279f9b4..44bfc1f 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 _0xd723=['path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0xd723,0xfb));var _0x3d72=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd723[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x3d72('0x0'));var util=require('util');var path=require(_0x3d72('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d72('0x2'));var router=express[_0x3d72('0x3')]();var auth=require(_0x3d72('0x4'));var interaction=require(_0x3d72('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x3d72('0x6')]('/',auth[_0x3d72('0x7')](),controller['index']);router[_0x3d72('0x6')](_0x3d72('0x8'),auth['isAuthenticated'](),controller[_0x3d72('0x9')]);router[_0x3d72('0x6')](_0x3d72('0xa'),auth[_0x3d72('0x7')](),controller[_0x3d72('0xb')]);router[_0x3d72('0xc')]('/',auth[_0x3d72('0x7')](),controller['create']);router[_0x3d72('0xd')](_0x3d72('0xa'),auth[_0x3d72('0x7')](),controller[_0x3d72('0xe')]);router[_0x3d72('0xf')]('/:id',auth[_0x3d72('0x7')](),controller[_0x3d72('0x10')]);module[_0x3d72('0x11')]=router; \ No newline at end of file +var _0xa5e4=['/:id','show','put','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xa5e4,0xd7));var _0x4a5e=function(_0x28ed2e,_0x48be94){_0x28ed2e=_0x28ed2e-0x0;var _0x160019=_0xa5e4[_0x28ed2e];return _0x160019;};'use strict';var multer=require(_0x4a5e('0x0'));var util=require('util');var path=require(_0x4a5e('0x1'));var timeout=require(_0x4a5e('0x2'));var express=require(_0x4a5e('0x3'));var router=express['Router']();var auth=require(_0x4a5e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4a5e('0x5'));var controller=require('./faxQueueReport.controller');router[_0x4a5e('0x6')]('/',auth[_0x4a5e('0x7')](),controller[_0x4a5e('0x8')]);router[_0x4a5e('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4a5e('0x9')]);router[_0x4a5e('0x6')](_0x4a5e('0xa'),auth[_0x4a5e('0x7')](),controller[_0x4a5e('0xb')]);router['post']('/',auth[_0x4a5e('0x7')](),controller['create']);router[_0x4a5e('0xc')](_0x4a5e('0xa'),auth[_0x4a5e('0x7')](),controller['update']);router['delete'](_0x4a5e('0xa'),auth[_0x4a5e('0x7')](),controller[_0x4a5e('0xd')]);module[_0x4a5e('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 96f8d09..9a2ec8a 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 _0x2527=['ENUM','account','agent','queue','DATE','NOW','sequelize','exports','STRING'];(function(_0x20ea89,_0x1bfce6){var _0x1f06a8=function(_0xc541ce){while(--_0xc541ce){_0x20ea89['push'](_0x20ea89['shift']());}};_0x1f06a8(++_0x1bfce6);}(_0x2527,0x126));var _0x7252=function(_0x5df5c2,_0x4017fb){_0x5df5c2=_0x5df5c2-0x0;var _0x47e51e=_0x2527[_0x5df5c2];return _0x47e51e;};'use strict';var moment=require('moment');var Sequelize=require(_0x7252('0x0'));module[_0x7252('0x1')]={'uniqueid':{'type':Sequelize[_0x7252('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7252('0x3')](_0x7252('0x4'),_0x7252('0x5'),_0x7252('0x6')),'allowNull':![],'defaultValue':_0x7252('0x6')},'transferredAt':{'type':Sequelize[_0x7252('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x7252('0x8')]}}; \ No newline at end of file +var _0x774f=['moment','sequelize','exports','STRING','ENUM','account','queue','NOW'];(function(_0xd623c4,_0x5c9bb6){var _0x1899a5=function(_0x25186d){while(--_0x25186d){_0xd623c4['push'](_0xd623c4['shift']());}};_0x1899a5(++_0x5c9bb6);}(_0x774f,0xf0));var _0xf774=function(_0x68fdfa,_0x3223c7){_0x68fdfa=_0x68fdfa-0x0;var _0x5281a2=_0x774f[_0x68fdfa];return _0x5281a2;};'use strict';var moment=require(_0xf774('0x0'));var Sequelize=require(_0xf774('0x1'));module[_0xf774('0x2')]={'uniqueid':{'type':Sequelize[_0xf774('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf774('0x4')](_0xf774('0x5'),'agent',_0xf774('0x6')),'allowNull':![],'defaultValue':_0xf774('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf774('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0b483cb..326efc6 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 _0x5f66=['show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x3e2aec,_0x92d747){var _0x25f10c=function(_0x5549fc){while(--_0x5549fc){_0x3e2aec['push'](_0x3e2aec['shift']());}};_0x25f10c(++_0x92d747);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];function respondWithStatusCode(_0x576875,_0x419819){_0x419819=_0x419819||0xcc;return function(_0x4862a5){if(_0x4862a5){return _0x576875[_0x65f6('0x14')](_0x419819);}return _0x576875[_0x65f6('0x15')](_0x419819)[_0x65f6('0x16')]();};}function respondWithResult(_0x217570,_0x369f96){_0x369f96=_0x369f96||0xc8;return function(_0x1d29fd){if(_0x1d29fd){return _0x217570[_0x65f6('0x15')](_0x369f96)[_0x65f6('0x17')](_0x1d29fd);}};}function respondWithFilteredResult(_0x46dbc6,_0x3440af){return function(_0x59154e){if(_0x59154e){var _0x19b9ff=_0x59154e[_0x65f6('0x18')],_0x49a913=_0x3440af[_0x65f6('0x19')],_0x5dd324=_0x3440af[_0x65f6('0x19')]+_0x3440af[_0x65f6('0x1a')],_0x1693e6;if(_0x5dd324>=_0x19b9ff){_0x5dd324=_0x19b9ff;_0x1693e6=0xc8;}else{_0x1693e6=0xce;}_0x46dbc6[_0x65f6('0x15')](_0x1693e6);return _0x46dbc6[_0x65f6('0x1b')](_0x65f6('0x1c'),_0x49a913+'-'+_0x5dd324+'/'+_0x19b9ff)['json'](_0x59154e);}return null;};}function patchUpdates(_0x4d79a1){return function(_0x2d538c){try{jsonpatch['apply'](_0x2d538c,_0x4d79a1,!![]);}catch(_0x4c81f3){return BPromise['reject'](_0x4c81f3);}return _0x2d538c[_0x65f6('0x1d')]();};}function saveUpdates(_0x21ea88,_0x5114a4){return function(_0x39e19f){if(_0x39e19f){return _0x39e19f[_0x65f6('0x1e')](_0x21ea88)[_0x65f6('0x1f')](function(_0x3876ed){return _0x3876ed;});}return null;};}function removeEntity(_0x219ab2,_0xc139c2){return function(_0x581374){if(_0x581374){return _0x581374[_0x65f6('0x20')]()['then'](function(){_0x219ab2['status'](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(!_0x1eeaaa){_0xd173f4[_0x65f6('0x14')](0x194);}return _0x1eeaaa;};}function handleError(_0x2317ce,_0x2774a1){_0x2774a1=_0x2774a1||0x1f4;return function(_0x4f5a69){logger[_0x65f6('0x21')](_0x4f5a69[_0x65f6('0x22')]);if(_0x4f5a69[_0x65f6('0x23')]){delete _0x4f5a69['name'];}_0x2317ce['status'](_0x2774a1)['send'](_0x4f5a69);};}exports[_0x65f6('0x24')]=function(_0x16cde8,_0x4b2292){var _0x296cd9={},_0x28f710={},_0x52277c={'count':0x0,'rows':[]};var _0x325cb4=_[_0x65f6('0x25')](db[_0x65f6('0x26')]['rawAttributes'],function(_0x4ac04b){return{'name':_0x4ac04b['fieldName'],'type':_0x4ac04b[_0x65f6('0x27')][_0x65f6('0x28')]};});_0x28f710[_0x65f6('0x29')]=_[_0x65f6('0x25')](_0x325cb4,_0x65f6('0x23'));_0x28f710[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x16cde8['query']);_0x28f710['filters']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],_0x28f710['query']);_0x296cd9['attributes']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0x296cd9[_0x65f6('0x2e')]=_0x296cd9['attributes'][_0x65f6('0x2f')]?_0x296cd9[_0x65f6('0x2e')]:_0x28f710[_0x65f6('0x29')];if(!_0x16cde8['query'][_0x65f6('0x30')](_0x65f6('0x31'))){_0x296cd9[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x1a')]);_0x296cd9['offset']=qs[_0x65f6('0x19')](_0x16cde8[_0x65f6('0x2a')]['offset']);}_0x296cd9[_0x65f6('0x32')]=qs['sort'](_0x16cde8[_0x65f6('0x2a')]['sort']);_0x296cd9[_0x65f6('0x33')]=qs[_0x65f6('0x34')](_['pick'](_0x16cde8[_0x65f6('0x2a')],_0x28f710[_0x65f6('0x34')]),_0x325cb4);if(_0x16cde8[_0x65f6('0x2a')]['filter']){_0x296cd9['where']=_[_0x65f6('0x35')](_0x296cd9['where'],{'$or':_[_0x65f6('0x25')](_0x325cb4,function(_0x4e6653){if(_0x4e6653[_0x65f6('0x27')]!==_0x65f6('0x36')){var _0x5e97f1={};_0x5e97f1[_0x4e6653[_0x65f6('0x23')]]={'$like':'%'+_0x16cde8['query']['filter']+'%'};return _0x5e97f1;}})});}_0x296cd9=_[_0x65f6('0x35')]({},_0x296cd9,_0x16cde8[_0x65f6('0x37')]);var _0x413956={'where':_0x296cd9[_0x65f6('0x33')]};return db[_0x65f6('0x26')][_0x65f6('0x18')](_0x413956)[_0x65f6('0x1f')](function(_0x1153f1){_0x52277c['count']=_0x1153f1;if(_0x16cde8[_0x65f6('0x2a')]['includeAll']){_0x296cd9[_0x65f6('0x38')]=[{'all':!![]}];}return db[_0x65f6('0x26')][_0x65f6('0x39')](_0x296cd9);})[_0x65f6('0x1f')](function(_0x5ef5c2){_0x52277c[_0x65f6('0x3a')]=_0x5ef5c2;return _0x52277c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x4b2292,_0x296cd9))[_0x65f6('0x3b')](handleError(_0x4b2292,null));};exports[_0x65f6('0x3c')]=function(_0x81fd69,_0x3f6103){var _0xed4c96={'raw':!![],'where':{'id':_0x81fd69[_0x65f6('0x3d')]['id']}},_0x2acca5={};_0x2acca5['model']=_[_0x65f6('0x2b')](db[_0x65f6('0x26')][_0x65f6('0x3e')]);_0x2acca5[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x81fd69[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x34')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],_0x2acca5[_0x65f6('0x2a')]);_0xed4c96[_0x65f6('0x2e')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x81fd69[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0xed4c96['attributes']=_0xed4c96[_0x65f6('0x2e')][_0x65f6('0x2f')]?_0xed4c96[_0x65f6('0x2e')]:_0x2acca5[_0x65f6('0x29')];if(_0x81fd69['query'][_0x65f6('0x3f')]){_0xed4c96[_0x65f6('0x38')]=[{'all':!![]}];}_0xed4c96=_[_0x65f6('0x35')]({},_0xed4c96,_0x81fd69['options']);return db[_0x65f6('0x26')][_0x65f6('0x40')](_0xed4c96)[_0x65f6('0x1f')](handleEntityNotFound(_0x3f6103,null))[_0x65f6('0x1f')](respondWithResult(_0x3f6103,null))['catch'](handleError(_0x3f6103,null));};exports[_0x65f6('0x41')]=function(_0x512527,_0x3f1baa){return db[_0x65f6('0x26')]['create'](_0x512527[_0x65f6('0x42')],{})['then'](respondWithResult(_0x3f1baa,0xc9))[_0x65f6('0x3b')](handleError(_0x3f1baa,null));};exports[_0x65f6('0x1e')]=function(_0x2d1706,_0xc0db01){if(_0x2d1706[_0x65f6('0x42')]['id']){delete _0x2d1706[_0x65f6('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x2d1706[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0xc0db01,null))[_0x65f6('0x1f')](saveUpdates(_0x2d1706[_0x65f6('0x42')],null))[_0x65f6('0x1f')](respondWithResult(_0xc0db01,null))[_0x65f6('0x3b')](handleError(_0xc0db01,null));};exports[_0x65f6('0x20')]=function(_0x41690c,_0x414f49){return db['FaxTransferReport'][_0x65f6('0x40')]({'where':{'id':_0x41690c[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x414f49,null))['then'](removeEntity(_0x414f49,null))[_0x65f6('0x3b')](handleError(_0x414f49,null));};exports[_0x65f6('0x43')]=function(_0x49ba5a,_0x22d745){return db[_0x65f6('0x26')]['describe']()[_0x65f6('0x1f')](respondWithResult(_0x22d745,null))['catch'](handleError(_0x22d745,null));}; \ No newline at end of file +var _0x5f66=['show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x202d0f,_0x9ec743){var _0xfc464c=function(_0x49446b){while(--_0x49446b){_0x202d0f['push'](_0x202d0f['shift']());}};_0xfc464c(++_0x9ec743);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];function respondWithStatusCode(_0x576875,_0x419819){_0x419819=_0x419819||0xcc;return function(_0x4862a5){if(_0x4862a5){return _0x576875[_0x65f6('0x14')](_0x419819);}return _0x576875[_0x65f6('0x15')](_0x419819)[_0x65f6('0x16')]();};}function respondWithResult(_0x217570,_0x369f96){_0x369f96=_0x369f96||0xc8;return function(_0x1d29fd){if(_0x1d29fd){return _0x217570[_0x65f6('0x15')](_0x369f96)[_0x65f6('0x17')](_0x1d29fd);}};}function respondWithFilteredResult(_0x46dbc6,_0x3440af){return function(_0x59154e){if(_0x59154e){var _0x19b9ff=_0x59154e[_0x65f6('0x18')],_0x49a913=_0x3440af[_0x65f6('0x19')],_0x5dd324=_0x3440af[_0x65f6('0x19')]+_0x3440af[_0x65f6('0x1a')],_0x1693e6;if(_0x5dd324>=_0x19b9ff){_0x5dd324=_0x19b9ff;_0x1693e6=0xc8;}else{_0x1693e6=0xce;}_0x46dbc6[_0x65f6('0x15')](_0x1693e6);return _0x46dbc6[_0x65f6('0x1b')](_0x65f6('0x1c'),_0x49a913+'-'+_0x5dd324+'/'+_0x19b9ff)['json'](_0x59154e);}return null;};}function patchUpdates(_0x4d79a1){return function(_0x2d538c){try{jsonpatch['apply'](_0x2d538c,_0x4d79a1,!![]);}catch(_0x4c81f3){return BPromise['reject'](_0x4c81f3);}return _0x2d538c[_0x65f6('0x1d')]();};}function saveUpdates(_0x21ea88,_0x5114a4){return function(_0x39e19f){if(_0x39e19f){return _0x39e19f[_0x65f6('0x1e')](_0x21ea88)[_0x65f6('0x1f')](function(_0x3876ed){return _0x3876ed;});}return null;};}function removeEntity(_0x219ab2,_0xc139c2){return function(_0x581374){if(_0x581374){return _0x581374[_0x65f6('0x20')]()['then'](function(){_0x219ab2['status'](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(!_0x1eeaaa){_0xd173f4[_0x65f6('0x14')](0x194);}return _0x1eeaaa;};}function handleError(_0x2317ce,_0x2774a1){_0x2774a1=_0x2774a1||0x1f4;return function(_0x4f5a69){logger[_0x65f6('0x21')](_0x4f5a69[_0x65f6('0x22')]);if(_0x4f5a69[_0x65f6('0x23')]){delete _0x4f5a69['name'];}_0x2317ce['status'](_0x2774a1)['send'](_0x4f5a69);};}exports[_0x65f6('0x24')]=function(_0x16cde8,_0x4b2292){var _0x296cd9={},_0x28f710={},_0x52277c={'count':0x0,'rows':[]};var _0x325cb4=_[_0x65f6('0x25')](db[_0x65f6('0x26')]['rawAttributes'],function(_0x4ac04b){return{'name':_0x4ac04b['fieldName'],'type':_0x4ac04b[_0x65f6('0x27')][_0x65f6('0x28')]};});_0x28f710[_0x65f6('0x29')]=_[_0x65f6('0x25')](_0x325cb4,_0x65f6('0x23'));_0x28f710[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x16cde8['query']);_0x28f710['filters']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],_0x28f710['query']);_0x296cd9['attributes']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0x296cd9[_0x65f6('0x2e')]=_0x296cd9['attributes'][_0x65f6('0x2f')]?_0x296cd9[_0x65f6('0x2e')]:_0x28f710[_0x65f6('0x29')];if(!_0x16cde8['query'][_0x65f6('0x30')](_0x65f6('0x31'))){_0x296cd9[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x1a')]);_0x296cd9['offset']=qs[_0x65f6('0x19')](_0x16cde8[_0x65f6('0x2a')]['offset']);}_0x296cd9[_0x65f6('0x32')]=qs['sort'](_0x16cde8[_0x65f6('0x2a')]['sort']);_0x296cd9[_0x65f6('0x33')]=qs[_0x65f6('0x34')](_['pick'](_0x16cde8[_0x65f6('0x2a')],_0x28f710[_0x65f6('0x34')]),_0x325cb4);if(_0x16cde8[_0x65f6('0x2a')]['filter']){_0x296cd9['where']=_[_0x65f6('0x35')](_0x296cd9['where'],{'$or':_[_0x65f6('0x25')](_0x325cb4,function(_0x4e6653){if(_0x4e6653[_0x65f6('0x27')]!==_0x65f6('0x36')){var _0x5e97f1={};_0x5e97f1[_0x4e6653[_0x65f6('0x23')]]={'$like':'%'+_0x16cde8['query']['filter']+'%'};return _0x5e97f1;}})});}_0x296cd9=_[_0x65f6('0x35')]({},_0x296cd9,_0x16cde8[_0x65f6('0x37')]);var _0x413956={'where':_0x296cd9[_0x65f6('0x33')]};return db[_0x65f6('0x26')][_0x65f6('0x18')](_0x413956)[_0x65f6('0x1f')](function(_0x1153f1){_0x52277c['count']=_0x1153f1;if(_0x16cde8[_0x65f6('0x2a')]['includeAll']){_0x296cd9[_0x65f6('0x38')]=[{'all':!![]}];}return db[_0x65f6('0x26')][_0x65f6('0x39')](_0x296cd9);})[_0x65f6('0x1f')](function(_0x5ef5c2){_0x52277c[_0x65f6('0x3a')]=_0x5ef5c2;return _0x52277c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x4b2292,_0x296cd9))[_0x65f6('0x3b')](handleError(_0x4b2292,null));};exports[_0x65f6('0x3c')]=function(_0x81fd69,_0x3f6103){var _0xed4c96={'raw':!![],'where':{'id':_0x81fd69[_0x65f6('0x3d')]['id']}},_0x2acca5={};_0x2acca5['model']=_[_0x65f6('0x2b')](db[_0x65f6('0x26')][_0x65f6('0x3e')]);_0x2acca5[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x81fd69[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x34')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],_0x2acca5[_0x65f6('0x2a')]);_0xed4c96[_0x65f6('0x2e')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x81fd69[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0xed4c96['attributes']=_0xed4c96[_0x65f6('0x2e')][_0x65f6('0x2f')]?_0xed4c96[_0x65f6('0x2e')]:_0x2acca5[_0x65f6('0x29')];if(_0x81fd69['query'][_0x65f6('0x3f')]){_0xed4c96[_0x65f6('0x38')]=[{'all':!![]}];}_0xed4c96=_[_0x65f6('0x35')]({},_0xed4c96,_0x81fd69['options']);return db[_0x65f6('0x26')][_0x65f6('0x40')](_0xed4c96)[_0x65f6('0x1f')](handleEntityNotFound(_0x3f6103,null))[_0x65f6('0x1f')](respondWithResult(_0x3f6103,null))['catch'](handleError(_0x3f6103,null));};exports[_0x65f6('0x41')]=function(_0x512527,_0x3f1baa){return db[_0x65f6('0x26')]['create'](_0x512527[_0x65f6('0x42')],{})['then'](respondWithResult(_0x3f1baa,0xc9))[_0x65f6('0x3b')](handleError(_0x3f1baa,null));};exports[_0x65f6('0x1e')]=function(_0x2d1706,_0xc0db01){if(_0x2d1706[_0x65f6('0x42')]['id']){delete _0x2d1706[_0x65f6('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x2d1706[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0xc0db01,null))[_0x65f6('0x1f')](saveUpdates(_0x2d1706[_0x65f6('0x42')],null))[_0x65f6('0x1f')](respondWithResult(_0xc0db01,null))[_0x65f6('0x3b')](handleError(_0xc0db01,null));};exports[_0x65f6('0x20')]=function(_0x41690c,_0x414f49){return db['FaxTransferReport'][_0x65f6('0x40')]({'where':{'id':_0x41690c[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x414f49,null))['then'](removeEntity(_0x414f49,null))[_0x65f6('0x3b')](handleError(_0x414f49,null));};exports[_0x65f6('0x43')]=function(_0x49ba5a,_0x22d745){return db[_0x65f6('0x26')]['describe']()[_0x65f6('0x1f')](respondWithResult(_0x22d745,null))['catch'](handleError(_0x22d745,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b489592..8443e7a 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 _0x959e=['report_fax_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport'];(function(_0x442950,_0x3ec430){var _0x163dac=function(_0x85021){while(--_0x85021){_0x442950['push'](_0x442950['shift']());}};_0x163dac(++_0x3ec430);}(_0x959e,0x1e2));var _0xe959=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x959e[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0xe959('0x0'));var util=require(_0xe959('0x1'));var logger=require(_0xe959('0x2'))('api');var moment=require(_0xe959('0x3'));var BPromise=require(_0xe959('0x4'));var rp=require(_0xe959('0x5'));var fs=require('fs');var path=require(_0xe959('0x6'));var rimraf=require(_0xe959('0x7'));var config=require(_0xe959('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xe959('0x9')]=function(_0x595e3f,_0x29a59a){return _0x595e3f[_0xe959('0xa')](_0xe959('0xb'),attributes,{'tableName':_0xe959('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0419=['moment','bluebird','request-promise','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','../../config/logger','api'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0419,0x153));var _0x9041=function(_0x4b1cd7,_0x27b641){_0x4b1cd7=_0x4b1cd7-0x0;var _0x400e61=_0x0419[_0x4b1cd7];return _0x400e61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9041('0x0'))(_0x9041('0x1'));var moment=require(_0x9041('0x2'));var BPromise=require(_0x9041('0x3'));var rp=require(_0x9041('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9041('0x5'));var attributes=require(_0x9041('0x6'));module[_0x9041('0x7')]=function(_0x1be327,_0x570cdf){return _0x1be327[_0x9041('0x8')](_0x9041('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9041('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 06daf89..1708082 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 _0xc9f9=['../../config/logger','rpc','../../config/environment','http','request','then','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x557400,_0x67f942){var _0x2c7cac=function(_0x4e4f76){while(--_0x4e4f76){_0x557400['push'](_0x557400['shift']());}};_0x2c7cac(++_0x67f942);}(_0xc9f9,0x103));var _0x9c9f=function(_0x29c988,_0x215e5e){_0x29c988=_0x29c988-0x0;var _0x2434b6=_0xc9f9[_0x29c988];return _0x2434b6;};'use strict';var _=require('lodash');var util=require(_0x9c9f('0x0'));var moment=require(_0x9c9f('0x1'));var BPromise=require('bluebird');var rs=require(_0x9c9f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c9f('0x3'))['db'];var utils=require(_0x9c9f('0x4'));var logger=require(_0x9c9f('0x5'))(_0x9c9f('0x6'));var config=require(_0x9c9f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33b946,_0x27b823,_0x4619e0){return new BPromise(function(_0x16bf4c,_0x35d478){return client[_0x9c9f('0x9')](_0x33b946,_0x4619e0)[_0x9c9f('0xa')](function(_0x566e95){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x27b823,'request\x20sent');logger[_0x9c9f('0xb')](_0x9c9f('0xc'),_0x27b823,_0x9c9f('0xd'),JSON[_0x9c9f('0xe')](_0x566e95));if(_0x566e95[_0x9c9f('0xf')]){if(_0x566e95[_0x9c9f('0xf')][_0x9c9f('0x10')]===0x1f4){logger['error'](_0x9c9f('0x11'),_0x27b823,_0x566e95[_0x9c9f('0xf')][_0x9c9f('0x12')]);return _0x35d478(_0x566e95['error'][_0x9c9f('0x12')]);}logger[_0x9c9f('0xf')](_0x9c9f('0x11'),_0x27b823,_0x566e95[_0x9c9f('0xf')][_0x9c9f('0x12')]);return _0x16bf4c(_0x566e95[_0x9c9f('0xf')][_0x9c9f('0x12')]);}else{logger[_0x9c9f('0x13')](_0x9c9f('0x11'),_0x27b823,_0x9c9f('0xd'));_0x16bf4c(_0x566e95[_0x9c9f('0x14')][_0x9c9f('0x12')]);}})[_0x9c9f('0x15')](function(_0x722694){logger['error'](_0x9c9f('0x11'),_0x27b823,_0x722694);_0x35d478(_0x722694);});});} \ No newline at end of file +var _0x0cbb=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3bc7b7,_0x15f4e7){var _0x40c574=function(_0x3202c9){while(--_0x3202c9){_0x3bc7b7['push'](_0x3bc7b7['shift']());}};_0x40c574(++_0x15f4e7);}(_0x0cbb,0x136));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb0cb('0x0'));var moment=require(_0xb0cb('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0cb('0x2'));var fs=require('fs');var Redis=require(_0xb0cb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0cb('0x4'));var logger=require(_0xb0cb('0x5'))(_0xb0cb('0x6'));var config=require(_0xb0cb('0x7'));var jayson=require(_0xb0cb('0x8'));var client=jayson[_0xb0cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x983e78,_0x5444e6,_0x48c400){return new BPromise(function(_0x312c23,_0x37843c){return client[_0xb0cb('0xa')](_0x983e78,_0x48c400)[_0xb0cb('0xb')](function(_0x380ffd){logger[_0xb0cb('0xc')](_0xb0cb('0xd'),_0x5444e6,_0xb0cb('0xe'));logger[_0xb0cb('0xf')](_0xb0cb('0x10'),_0x5444e6,_0xb0cb('0xe'),JSON[_0xb0cb('0x11')](_0x380ffd));if(_0x380ffd[_0xb0cb('0x12')]){if(_0x380ffd[_0xb0cb('0x12')][_0xb0cb('0x13')]===0x1f4){logger['error'](_0xb0cb('0xd'),_0x5444e6,_0x380ffd[_0xb0cb('0x12')]['message']);return _0x37843c(_0x380ffd['error'][_0xb0cb('0x14')]);}logger[_0xb0cb('0x12')](_0xb0cb('0xd'),_0x5444e6,_0x380ffd[_0xb0cb('0x12')]['message']);return _0x312c23(_0x380ffd[_0xb0cb('0x12')][_0xb0cb('0x14')]);}else{logger[_0xb0cb('0xc')](_0xb0cb('0xd'),_0x5444e6,_0xb0cb('0xe'));_0x312c23(_0x380ffd[_0xb0cb('0x15')]['message']);}})[_0xb0cb('0x16')](function(_0x163cbb){logger[_0xb0cb('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x5444e6,_0x163cbb);_0x37843c(_0x163cbb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f8676ff..f957c8f 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 _0xdb0a=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x8f688d,_0x3a6287){var _0x38a2e6=function(_0x495b0f){while(--_0x495b0f){_0x8f688d['push'](_0x8f688d['shift']());}};_0x38a2e6(++_0x3a6287);}(_0xdb0a,0xb9));var _0xadb0=function(_0x2ee877,_0x34bfca){_0x2ee877=_0x2ee877-0x0;var _0x59e86e=_0xdb0a[_0x2ee877];return _0x59e86e;};'use strict';var multer=require(_0xadb0('0x0'));var util=require(_0xadb0('0x1'));var path=require(_0xadb0('0x2'));var timeout=require(_0xadb0('0x3'));var express=require(_0xadb0('0x4'));var router=express[_0xadb0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xadb0('0x6'));var config=require(_0xadb0('0x7'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xadb0('0x8')](),controller['index']);router[_0xadb0('0x9')](_0xadb0('0xa'),auth[_0xadb0('0x8')](),controller[_0xadb0('0xb')]);router[_0xadb0('0x9')](_0xadb0('0xc'),auth[_0xadb0('0x8')](),controller[_0xadb0('0xd')]);router[_0xadb0('0xe')]('/',auth[_0xadb0('0x8')](),controller[_0xadb0('0xf')]);router[_0xadb0('0x10')](_0xadb0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xadb0('0x11')](_0xadb0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xadb0('0x12')]=router; \ No newline at end of file +var _0xa612=['/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x16d8fc,_0x24c1dc){var _0x1fe4d3=function(_0x423986){while(--_0x423986){_0x16d8fc['push'](_0x16d8fc['shift']());}};_0x1fe4d3(++_0x24c1dc);}(_0xa612,0x135));var _0x2a61=function(_0x2053de,_0x537549){_0x2053de=_0x2053de-0x0;var _0x78b0a8=_0xa612[_0x2053de];return _0x78b0a8;};'use strict';var multer=require(_0x2a61('0x0'));var util=require(_0x2a61('0x1'));var path=require(_0x2a61('0x2'));var timeout=require(_0x2a61('0x3'));var express=require(_0x2a61('0x4'));var router=express['Router']();var auth=require(_0x2a61('0x5'));var interaction=require(_0x2a61('0x6'));var config=require(_0x2a61('0x7'));var controller=require('./faxTransferReport.controller');router[_0x2a61('0x8')]('/',auth[_0x2a61('0x9')](),controller[_0x2a61('0xa')]);router[_0x2a61('0x8')](_0x2a61('0xb'),auth[_0x2a61('0x9')](),controller[_0x2a61('0xc')]);router[_0x2a61('0x8')](_0x2a61('0xd'),auth[_0x2a61('0x9')](),controller[_0x2a61('0xe')]);router[_0x2a61('0xf')]('/',auth[_0x2a61('0x9')](),controller['create']);router[_0x2a61('0x10')](_0x2a61('0xd'),auth[_0x2a61('0x9')](),controller[_0x2a61('0x11')]);router['delete'](_0x2a61('0xd'),auth[_0x2a61('0x9')](),controller[_0x2a61('0x12')]);module[_0x2a61('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ee0e715..85213fe 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 _0x5577=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x5577,0x1b4));var _0x7557=function(_0x195c12,_0xd9f818){_0x195c12=_0x195c12-0x0;var _0x559c25=_0x5577[_0x195c12];return _0x559c25;};'use strict';var multer=require(_0x7557('0x0'));var util=require('util');var path=require(_0x7557('0x1'));var timeout=require(_0x7557('0x2'));var express=require('express');var router=express[_0x7557('0x3')]();var auth=require(_0x7557('0x4'));var interaction=require(_0x7557('0x5'));var config=require(_0x7557('0x6'));var controller=require(_0x7557('0x7'));router[_0x7557('0x8')]('/',auth['isAuthenticated'](),controller[_0x7557('0x9')]);router[_0x7557('0x8')](_0x7557('0xa'),auth[_0x7557('0xb')](),controller[_0x7557('0xc')]);router[_0x7557('0x8')](_0x7557('0xd'),auth[_0x7557('0xb')](),controller[_0x7557('0xe')]);router[_0x7557('0x8')](_0x7557('0xf'),auth[_0x7557('0xb')](),controller[_0x7557('0x10')]);router[_0x7557('0x11')]('/',auth[_0x7557('0xb')](),controller['create']);router['post'](_0x7557('0xd'),auth[_0x7557('0xb')](),controller[_0x7557('0x12')]);router[_0x7557('0x13')](_0x7557('0xa'),auth[_0x7557('0xb')](),controller[_0x7557('0x14')]);router[_0x7557('0x15')](_0x7557('0xa'),auth[_0x7557('0xb')](),controller['destroy']);module[_0x7557('0x16')]=router; \ No newline at end of file +var _0x7118=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7118,0x159));var _0x8711=function(_0x22be03,_0x18e77a){_0x22be03=_0x22be03-0x0;var _0x19c887=_0x7118[_0x22be03];return _0x19c887;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8711('0x0'));var timeout=require(_0x8711('0x1'));var express=require('express');var router=express[_0x8711('0x2')]();var auth=require(_0x8711('0x3'));var interaction=require(_0x8711('0x4'));var config=require(_0x8711('0x5'));var controller=require(_0x8711('0x6'));router[_0x8711('0x7')]('/',auth[_0x8711('0x8')](),controller['index']);router[_0x8711('0x7')](_0x8711('0x9'),auth[_0x8711('0x8')](),controller[_0x8711('0xa')]);router[_0x8711('0x7')](_0x8711('0xb'),auth[_0x8711('0x8')](),controller[_0x8711('0xc')]);router[_0x8711('0x7')](_0x8711('0xd'),auth[_0x8711('0x8')](),controller['getFields']);router['post']('/',auth[_0x8711('0x8')](),controller[_0x8711('0xe')]);router[_0x8711('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8711('0x10')]);router[_0x8711('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8711('0x12')]);router[_0x8711('0x13')](_0x8711('0x9'),auth[_0x8711('0x8')](),controller[_0x8711('0x14')]);module[_0x8711('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 08f5315..27fe8bf 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 _0x21c1=['newTab','exports','STRING','ENUM','integrationTab'];(function(_0x1232ec,_0x2df4b1){var _0x4483b4=function(_0x39bfff){while(--_0x39bfff){_0x1232ec['push'](_0x1232ec['shift']());}};_0x4483b4(++_0x2df4b1);}(_0x21c1,0x1c3));var _0x121c=function(_0x4d4ef8,_0x4c9d05){_0x4d4ef8=_0x4d4ef8-0x0;var _0x1137a3=_0x21c1[_0x4d4ef8];return _0x1137a3;};'use strict';var Sequelize=require('sequelize');module[_0x121c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x121c('0x1')]},'username':{'type':Sequelize[_0x121c('0x1')]},'remoteUri':{'type':Sequelize[_0x121c('0x1')]},'authType':{'type':Sequelize[_0x121c('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x121c('0x1')]},'consumerSecret':{'type':Sequelize[_0x121c('0x1')]},'token':{'type':Sequelize[_0x121c('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x121c('0x1')]},'type':{'type':Sequelize[_0x121c('0x2')](_0x121c('0x3'),_0x121c('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x314f=['ENUM','basic','newTab','exports','STRING'];(function(_0x54463c,_0x1a651b){var _0xd2ccbb=function(_0x1aa5d4){while(--_0x1aa5d4){_0x54463c['push'](_0x54463c['shift']());}};_0xd2ccbb(++_0x1a651b);}(_0x314f,0x1cf));var _0xf314=function(_0x4ba7cb,_0x4c1436){_0x4ba7cb=_0x4ba7cb-0x0;var _0xf8c222=_0x314f[_0x4ba7cb];return _0xf8c222;};'use strict';var Sequelize=require('sequelize');module[_0xf314('0x0')]={'name':{'type':Sequelize[_0xf314('0x1')]},'description':{'type':Sequelize[_0xf314('0x1')]},'username':{'type':Sequelize[_0xf314('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf314('0x2')](_0xf314('0x3')),'defaultValue':_0xf314('0x3')},'password':{'type':Sequelize[_0xf314('0x1')]},'consumerKey':{'type':Sequelize[_0xf314('0x1')]},'consumerSecret':{'type':Sequelize[_0xf314('0x1')]},'token':{'type':Sequelize[_0xf314('0x1')]},'tokenSecret':{'type':Sequelize[_0xf314('0x1')]},'serverUrl':{'type':Sequelize[_0xf314('0x1')]},'type':{'type':Sequelize[_0xf314('0x2')]('integrationTab',_0xf314('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 642816c..371de39 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 _0x417d=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','DeskAccount','findAll','show','params','rawAttributes','length','includeAll','include','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','username','_embedded','entries','active','label','statusCode','stringify','Wrong\x20credentials','html-pdf','eml-format'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x417d,0x7c));var _0xd417=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x417d[_0xf71120];return _0xbe2fd3;};'use strict';var pdf=require(_0xd417('0x0'));var emlformat=require(_0xd417('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd417('0x2'));var jsonpatch=require(_0xd417('0x3'));var rp=require(_0xd417('0x4'));var moment=require(_0xd417('0x5'));var BPromise=require(_0xd417('0x6'));var Mustache=require(_0xd417('0x7'));var util=require('util');var path=require(_0xd417('0x8'));var sox=require(_0xd417('0x9'));var csv=require(_0xd417('0xa'));var ejs=require(_0xd417('0xb'));var fs=require('fs');var _=require(_0xd417('0xc'));var squel=require(_0xd417('0xd'));var crypto=require(_0xd417('0xe'));var jsforce=require(_0xd417('0xf'));var deskjs=require(_0xd417('0x10'));var toCsv=require(_0xd417('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd417('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd417('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd417('0x13'))(_0xd417('0x14'));var utils=require(_0xd417('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xd417('0x16'));var jayson=require(_0xd417('0x17'));var client=jayson[_0xd417('0x18')][_0xd417('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3b5975,_0x48b6c0,_0x1c04b3){if(_0x1c04b3){var _0x5cd2dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cd2dc[_0xd417('0x1a')](_0x48b6c0)){return _0x3b5975;}else{throw new db['Sequelize'][(_0xd417('0x1b'))](_0xd417('0x1c'));}}else{return _0x3b5975;}}function respondWithRpcPromise(_0x26f4bd,_0x412902,_0x168251,_0x4aac43){return new BPromise(function(_0x4b3420,_0x33a588){var _0x4f76e9=_0x4aac43||client;return _0x4f76e9[_0xd417('0x1d')](_0x26f4bd,_0x168251)[_0xd417('0x1e')](function(_0x5ff5e6){logger[_0xd417('0x1f')](_0xd417('0x20'),_0x412902,_0xd417('0x21'));logger[_0xd417('0x22')](_0xd417('0x23'),_0x412902,_0xd417('0x21'),JSON['stringify'](_0x5ff5e6));if(_0x5ff5e6[_0xd417('0x24')]){if(_0x5ff5e6[_0xd417('0x24')][_0xd417('0x25')]===0x1f4){logger[_0xd417('0x24')](_0xd417('0x20'),_0x412902,_0x5ff5e6[_0xd417('0x24')][_0xd417('0x26')]);return _0x33a588(_0x5ff5e6[_0xd417('0x24')]['message']);}logger[_0xd417('0x24')]('DeskAccount,\x20%s,\x20%s',_0x412902,_0x5ff5e6[_0xd417('0x24')][_0xd417('0x26')]);return _0x4b3420(_0x5ff5e6[_0xd417('0x24')][_0xd417('0x26')]);}else{logger[_0xd417('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x412902,_0xd417('0x21'));_0x4b3420(_0x5ff5e6[_0xd417('0x27')][_0xd417('0x26')]);}})[_0xd417('0x28')](function(_0x2e07c0){logger[_0xd417('0x24')](_0xd417('0x20'),_0x412902,_0x2e07c0);_0x33a588(_0x2e07c0);});});}function respondWithStatusCode(_0x3add74,_0xdca672){_0xdca672=_0xdca672||0xcc;return function(_0x4d8afe){if(_0x4d8afe){return _0x3add74[_0xd417('0x29')](_0xdca672);}return _0x3add74['status'](_0xdca672)[_0xd417('0x2a')]();};}function respondWithResult(_0x43f510,_0x56a290){_0x56a290=_0x56a290||0xc8;return function(_0x26b09c){if(_0x26b09c){return _0x43f510[_0xd417('0x2b')](_0x56a290)[_0xd417('0x2c')](_0x26b09c);}};}function respondWithFilteredResult(_0x61184e,_0x43a3aa){return function(_0x3a9c1b){if(_0x3a9c1b){var _0x5f40b0=_0x3a9c1b[_0xd417('0x2d')],_0x123e9b=_0x43a3aa['offset'],_0x5712ac=_0x43a3aa[_0xd417('0x2e')]+_0x43a3aa['limit'],_0x5c2ddf;if(_0x5712ac>=_0x5f40b0){_0x5712ac=_0x5f40b0;_0x5c2ddf=0xc8;}else{_0x5c2ddf=0xce;}_0x61184e[_0xd417('0x2b')](_0x5c2ddf);return _0x61184e[_0xd417('0x2f')](_0xd417('0x30'),_0x123e9b+'-'+_0x5712ac+'/'+_0x5f40b0)[_0xd417('0x2c')](_0x3a9c1b);}return null;};}function patchUpdates(_0x3836ce){return function(_0x32ac13){try{jsonpatch[_0xd417('0x31')](_0x32ac13,_0x3836ce,!![]);}catch(_0x1f9158){return BPromise[_0xd417('0x32')](_0x1f9158);}return _0x32ac13[_0xd417('0x33')]();};}function saveUpdates(_0x5a192e,_0x34b53d){return function(_0x176bb5){if(_0x176bb5){return _0x176bb5[_0xd417('0x34')](_0x5a192e)['then'](function(_0x253117){return _0x253117;});}return null;};}function removeEntity(_0x359382,_0x28f311){return function(_0x1ca035){if(_0x1ca035){return _0x1ca035[_0xd417('0x35')]()[_0xd417('0x1e')](function(){_0x359382[_0xd417('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e83c,_0x7d831){return function(_0x2d0121){if(!_0x2d0121){_0x52e83c['sendStatus'](0x194);}return _0x2d0121;};}function handleError(_0x5ccdd9,_0x4705ad){_0x4705ad=_0x4705ad||0x1f4;return function(_0x1e30d5){logger[_0xd417('0x24')](_0x1e30d5[_0xd417('0x36')]);if(_0x1e30d5[_0xd417('0x37')]){delete _0x1e30d5[_0xd417('0x37')];}_0x5ccdd9[_0xd417('0x2b')](_0x4705ad)[_0xd417('0x38')](_0x1e30d5);};}exports['index']=function(_0x2becd1,_0x4072d0){var _0x4577ea={},_0x33a3b7={},_0x39b6f4={'count':0x0,'rows':[]};var _0x3994cf=_[_0xd417('0x39')](db['DeskAccount']['rawAttributes'],function(_0x491e46){return{'name':_0x491e46[_0xd417('0x3a')],'type':_0x491e46[_0xd417('0x3b')][_0xd417('0x3c')]};});_0x33a3b7['model']=_[_0xd417('0x39')](_0x3994cf,_0xd417('0x37'));_0x33a3b7[_0xd417('0x3d')]=_[_0xd417('0x3e')](_0x2becd1[_0xd417('0x3d')]);_0x33a3b7['filters']=_[_0xd417('0x3f')](_0x33a3b7[_0xd417('0x40')],_0x33a3b7[_0xd417('0x3d')]);_0x4577ea['attributes']=_[_0xd417('0x3f')](_0x33a3b7[_0xd417('0x40')],qs[_0xd417('0x41')](_0x2becd1[_0xd417('0x3d')][_0xd417('0x41')]));_0x4577ea['attributes']=_0x4577ea['attributes']['length']?_0x4577ea[_0xd417('0x42')]:_0x33a3b7[_0xd417('0x40')];if(!_0x2becd1['query']['hasOwnProperty']('nolimit')){_0x4577ea[_0xd417('0x43')]=qs[_0xd417('0x43')](_0x2becd1[_0xd417('0x3d')]['limit']);_0x4577ea[_0xd417('0x2e')]=qs[_0xd417('0x2e')](_0x2becd1[_0xd417('0x3d')][_0xd417('0x2e')]);}_0x4577ea[_0xd417('0x44')]=qs[_0xd417('0x45')](_0x2becd1[_0xd417('0x3d')][_0xd417('0x45')]);_0x4577ea[_0xd417('0x46')]=qs[_0xd417('0x47')](_[_0xd417('0x48')](_0x2becd1[_0xd417('0x3d')],_0x33a3b7[_0xd417('0x47')]),_0x3994cf);if(_0x2becd1[_0xd417('0x3d')]['filter']){_0x4577ea[_0xd417('0x46')]=_[_0xd417('0x49')](_0x4577ea[_0xd417('0x46')],{'$or':_[_0xd417('0x39')](_0x3994cf,function(_0x3ae363){if(_0x3ae363['type']!==_0xd417('0x4a')){var _0x3302a0={};_0x3302a0[_0x3ae363[_0xd417('0x37')]]={'$like':'%'+_0x2becd1['query'][_0xd417('0x4b')]+'%'};return _0x3302a0;}})});}_0x4577ea=_[_0xd417('0x49')]({},_0x4577ea,_0x2becd1[_0xd417('0x4c')]);var _0x8c26a3={'where':_0x4577ea[_0xd417('0x46')]};return db[_0xd417('0x4d')][_0xd417('0x2d')](_0x8c26a3)[_0xd417('0x1e')](function(_0x1df541){_0x39b6f4[_0xd417('0x2d')]=_0x1df541;if(_0x2becd1[_0xd417('0x3d')]['includeAll']){_0x4577ea['include']=[{'all':!![]}];}return db[_0xd417('0x4d')][_0xd417('0x4e')](_0x4577ea);})[_0xd417('0x1e')](function(_0x17d023){_0x39b6f4['rows']=_0x17d023;return _0x39b6f4;})[_0xd417('0x1e')](respondWithFilteredResult(_0x4072d0,_0x4577ea))[_0xd417('0x28')](handleError(_0x4072d0,null));};exports[_0xd417('0x4f')]=function(_0x24d6f7,_0x973aab){var _0x91ca76={'raw':![],'where':{'id':_0x24d6f7[_0xd417('0x50')]['id']}},_0x4a304c={};_0x4a304c[_0xd417('0x40')]=_[_0xd417('0x3e')](db[_0xd417('0x4d')][_0xd417('0x51')]);_0x4a304c[_0xd417('0x3d')]=_[_0xd417('0x3e')](_0x24d6f7['query']);_0x4a304c[_0xd417('0x47')]=_[_0xd417('0x3f')](_0x4a304c['model'],_0x4a304c[_0xd417('0x3d')]);_0x91ca76['attributes']=_['intersection'](_0x4a304c[_0xd417('0x40')],qs[_0xd417('0x41')](_0x24d6f7[_0xd417('0x3d')][_0xd417('0x41')]));_0x91ca76[_0xd417('0x42')]=_0x91ca76[_0xd417('0x42')][_0xd417('0x52')]?_0x91ca76[_0xd417('0x42')]:_0x4a304c[_0xd417('0x40')];if(_0x24d6f7[_0xd417('0x3d')][_0xd417('0x53')]){_0x91ca76[_0xd417('0x54')]=[{'all':!![]}];}_0x91ca76=_[_0xd417('0x49')]({},_0x91ca76,_0x24d6f7['options']);return db[_0xd417('0x4d')]['find'](_0x91ca76)[_0xd417('0x1e')](handleEntityNotFound(_0x973aab,null))[_0xd417('0x1e')](respondWithResult(_0x973aab,null))[_0xd417('0x28')](handleError(_0x973aab,null));};exports[_0xd417('0x55')]=function(_0x5af3af,_0x4ad8ab){return db[_0xd417('0x4d')][_0xd417('0x55')](_0x5af3af[_0xd417('0x56')],{})[_0xd417('0x1e')](respondWithResult(_0x4ad8ab,0xc9))[_0xd417('0x28')](handleError(_0x4ad8ab,null));};exports['update']=function(_0x329c0d,_0x3ad6d3){if(_0x329c0d['body']['id']){delete _0x329c0d[_0xd417('0x56')]['id'];}return db['DeskAccount'][_0xd417('0x57')]({'where':{'id':_0x329c0d[_0xd417('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ad6d3,null))[_0xd417('0x1e')](saveUpdates(_0x329c0d[_0xd417('0x56')],null))[_0xd417('0x1e')](respondWithResult(_0x3ad6d3,null))['catch'](handleError(_0x3ad6d3,null));};exports[_0xd417('0x35')]=function(_0x46f629,_0x2fb3eb){return db[_0xd417('0x4d')][_0xd417('0x57')]({'where':{'id':_0x46f629[_0xd417('0x50')]['id']}})[_0xd417('0x1e')](handleEntityNotFound(_0x2fb3eb,null))[_0xd417('0x1e')](removeEntity(_0x2fb3eb,null))['catch'](handleError(_0x2fb3eb,null));};exports[_0xd417('0x58')]=function(_0x407499,_0x8c5507,_0x119fb5){var _0x564286={};var _0x1cfeaa={};var _0x16d81c;var _0x2923d3;return db[_0xd417('0x4d')][_0xd417('0x59')]({'where':{'id':_0x407499['params']['id']}})[_0xd417('0x1e')](handleEntityNotFound(_0x8c5507,null))['then'](function(_0x5ab255){if(_0x5ab255){_0x16d81c=_0x5ab255;_0x1cfeaa['model']=_[_0xd417('0x3e')](db[_0xd417('0x5a')][_0xd417('0x51')]);_0x1cfeaa[_0xd417('0x3d')]=_[_0xd417('0x3e')](_0x407499[_0xd417('0x3d')]);_0x1cfeaa['filters']=_[_0xd417('0x3f')](_0x1cfeaa[_0xd417('0x40')],_0x1cfeaa[_0xd417('0x3d')]);_0x564286[_0xd417('0x42')]=_[_0xd417('0x3f')](_0x1cfeaa[_0xd417('0x40')],qs['fields'](_0x407499['query'][_0xd417('0x41')]));_0x564286[_0xd417('0x42')]=_0x564286['attributes'][_0xd417('0x52')]?_0x564286[_0xd417('0x42')]:_0x1cfeaa['model'];_0x564286[_0xd417('0x44')]=qs[_0xd417('0x45')](_0x407499[_0xd417('0x3d')]['sort']);_0x564286[_0xd417('0x46')]=qs[_0xd417('0x47')](_[_0xd417('0x48')](_0x407499[_0xd417('0x3d')],_0x1cfeaa['filters']));if(_0x407499[_0xd417('0x3d')][_0xd417('0x4b')]){_0x564286['where']=_[_0xd417('0x49')](_0x564286[_0xd417('0x46')],{'$or':_[_0xd417('0x39')](_0x564286[_0xd417('0x42')],function(_0x1f97dc){var _0x35e107={};_0x35e107[_0x1f97dc]={'$like':'%'+_0x407499[_0xd417('0x3d')][_0xd417('0x4b')]+'%'};return _0x35e107;})});}_0x564286=_['merge']({},_0x564286,_0x407499[_0xd417('0x4c')]);return _0x16d81c[_0xd417('0x58')](_0x564286);}})[_0xd417('0x1e')](function(_0x169c15){if(_0x169c15){_0x2923d3=_0x169c15[_0xd417('0x52')];if(!_0x407499['query'][_0xd417('0x5b')](_0xd417('0x5c'))){_0x564286['limit']=qs[_0xd417('0x43')](_0x407499[_0xd417('0x3d')][_0xd417('0x43')]);_0x564286['offset']=qs['offset'](_0x407499[_0xd417('0x3d')][_0xd417('0x2e')]);}return _0x16d81c[_0xd417('0x58')](_0x564286);}})[_0xd417('0x1e')](function(_0xd0e3b){if(_0xd0e3b){return _0xd0e3b?{'count':_0x2923d3,'rows':_0xd0e3b}:null;}})[_0xd417('0x1e')](respondWithResult(_0x8c5507,null))[_0xd417('0x28')](handleError(_0x8c5507,null));};exports[_0xd417('0x5d')]=function(_0x321214,_0x2ce212,_0x2d4441){if(_0x321214[_0xd417('0x56')]['id']){delete _0x321214[_0xd417('0x56')]['id'];}return db[_0xd417('0x4d')][_0xd417('0x59')]({'where':{'id':_0x321214[_0xd417('0x50')]['id']}})[_0xd417('0x1e')](handleEntityNotFound(_0x2ce212,null))[_0xd417('0x1e')](function(_0x48b238){if(_0x48b238){_0x321214[_0xd417('0x56')][_0xd417('0x5e')]=_0x48b238['id'];_0x321214[_0xd417('0x56')]['Subjects']=integrations[_0xd417('0x5f')](_0x321214[_0xd417('0x56')][_0xd417('0x60')],_0x321214[_0xd417('0x56')][_0xd417('0x3b')]);_0x321214[_0xd417('0x56')][_0xd417('0x61')]=integrations[_0xd417('0x62')](_0x321214[_0xd417('0x56')][_0xd417('0x60')],_0x321214[_0xd417('0x56')][_0xd417('0x3b')]);return db['DeskConfiguration'][_0xd417('0x55')](_0x321214[_0xd417('0x56')],{'include':[{'model':db[_0xd417('0x63')],'as':_0xd417('0x64')},{'model':db['DeskField'],'as':_0xd417('0x61')}]});}return null;})[_0xd417('0x1e')](respondWithResult(_0x2ce212,null))['catch'](handleError(_0x2ce212,null));};exports[_0xd417('0x65')]=function(_0x58e13a,_0x2d88cc,_0x56fefa){var _0x316bfa=[{'name':_0xd417('0x66'),'label':_0xd417('0x66'),'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 _0x6e54c5='';return db[_0xd417('0x4d')][_0xd417('0x59')]({'where':{'id':_0x58e13a[_0xd417('0x50')]['id']},'attributes':['id',_0xd417('0x67'),'authType','username',_0xd417('0x68'),_0xd417('0x69'),_0xd417('0x6a'),'token',_0xd417('0x6b')]})[_0xd417('0x1e')](handleEntityNotFound(_0x2d88cc,null))[_0xd417('0x1e')](function(_0x462912){if(_0x462912){_0x6e54c5=_0x462912[_0xd417('0x67')];var _0x2335a2=_0x6e54c5[_0xd417('0x6c')](-0x1);if(_0x2335a2==='/'){_0x6e54c5=_0x6e54c5[_0xd417('0x6d')](0x0,_0x6e54c5[_0xd417('0x6e')](_0x2335a2));}var _0xfbfe63={'method':'GET','uri':util[_0xd417('0x6f')](_0xd417('0x70'),_0x6e54c5),'headers':{'Content-Type':_0xd417('0x71'),'Accept':_0xd417('0x71')},'json':!![]};if(_0x462912['authType']===_0xd417('0x72')){_0xfbfe63[_0xd417('0x73')][_0xd417('0x74')]=util[_0xd417('0x6f')]('Basic\x20%s',new Buffer(util[_0xd417('0x6f')](_0xd417('0x75'),_0x462912[_0xd417('0x76')],_0x462912['password']))['toString']('base64'));}return rp(_0xfbfe63)[_0xd417('0x1e')](function(_0x55fc0f){return _0x316bfa['concat'](_[_0xd417('0x39')](_0x55fc0f[_0xd417('0x77')][_0xd417('0x78')],function(_0x2adf1e){return{'id':_0x2adf1e[_0xd417('0x37')],'name':_0x2adf1e['name'],'type':_0x2adf1e[_0xd417('0x3b')],'active':_0x2adf1e[_0xd417('0x79')],'label':_0x2adf1e[_0xd417('0x7a')],'custom':!![]};}));});}})['then'](function(_0x333e38){return{'count':_0x333e38[_0xd417('0x52')],'rows':_0x333e38};})[_0xd417('0x1e')](respondWithResult(_0x2d88cc,null))[_0xd417('0x28')](function(_0x498ed6){var _0x468339=_0x58e13a[_0xd417('0x3d')][_0xd417('0x1a')]?0x1f4:_0x498ed6[_0xd417('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd417('0x65'),_0x468339,JSON[_0xd417('0x7c')](_0x498ed6));delete _0x498ed6[_0xd417('0x37')];if(_0x468339===0x191){_0x468339=0x190;}_0x2d88cc[_0xd417('0x2b')](_0x468339)[_0xd417('0x38')](_0x58e13a['query'][_0xd417('0x1a')]?{'message':_0xd417('0x7d'),'statusCode':_0x498ed6['statusCode']}:_0x498ed6);});}; \ No newline at end of file +var _0xbfc0=['params','find','create','body','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','remoteUri','slice','substring','lastIndexOf','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','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','DeskAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','set','Content-Range','apply','reject','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xbfc0,0x9e));var _0x0bfc=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xbfc0[_0x450bf9];return _0x268350;};'use strict';var pdf=require(_0x0bfc('0x0'));var emlformat=require(_0x0bfc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0bfc('0x2'));var rp=require(_0x0bfc('0x3'));var moment=require(_0x0bfc('0x4'));var BPromise=require(_0x0bfc('0x5'));var Mustache=require(_0x0bfc('0x6'));var util=require(_0x0bfc('0x7'));var path=require('path');var sox=require(_0x0bfc('0x8'));var csv=require(_0x0bfc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0bfc('0xa'));var crypto=require(_0x0bfc('0xb'));var jsforce=require(_0x0bfc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0bfc('0x9'));var querystring=require(_0x0bfc('0xd'));var Papa=require(_0x0bfc('0xe'));var Redis=require('ioredis');var authService=require(_0x0bfc('0xf'));var qs=require(_0x0bfc('0x10'));var as=require(_0x0bfc('0x11'));var hardwareService=require(_0x0bfc('0x12'));var logger=require(_0x0bfc('0x13'))(_0x0bfc('0x14'));var utils=require(_0x0bfc('0x15'));var config=require('../../config/environment');var db=require(_0x0bfc('0x16'))['db'];var integrations=require(_0x0bfc('0x17'));var jayson=require(_0x0bfc('0x18'));var client=jayson[_0x0bfc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x58afab,_0x167a5d,_0xe8c6a4){if(_0xe8c6a4){var _0x4c7a34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c7a34['test'](_0x167a5d)){return _0x58afab;}else{throw new db['Sequelize'][(_0x0bfc('0x1a'))](_0x0bfc('0x1b'));}}else{return _0x58afab;}}function respondWithRpcPromise(_0xa805ce,_0x10cf7b,_0x418992,_0x47355b){return new BPromise(function(_0x36621c,_0x349efa){var _0x2d1e7a=_0x47355b||client;return _0x2d1e7a['request'](_0xa805ce,_0x418992)[_0x0bfc('0x1c')](function(_0xe1754c){logger['info']('DeskAccount,\x20%s,\x20%s',_0x10cf7b,_0x0bfc('0x1d'));logger[_0x0bfc('0x1e')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x10cf7b,_0x0bfc('0x1d'),JSON[_0x0bfc('0x1f')](_0xe1754c));if(_0xe1754c['error']){if(_0xe1754c[_0x0bfc('0x20')]['code']===0x1f4){logger['error'](_0x0bfc('0x21'),_0x10cf7b,_0xe1754c[_0x0bfc('0x20')][_0x0bfc('0x22')]);return _0x349efa(_0xe1754c['error'][_0x0bfc('0x22')]);}logger['error'](_0x0bfc('0x21'),_0x10cf7b,_0xe1754c[_0x0bfc('0x20')]['message']);return _0x36621c(_0xe1754c['error'][_0x0bfc('0x22')]);}else{logger['info'](_0x0bfc('0x21'),_0x10cf7b,_0x0bfc('0x1d'));_0x36621c(_0xe1754c[_0x0bfc('0x23')][_0x0bfc('0x22')]);}})[_0x0bfc('0x24')](function(_0x53e9fa){logger[_0x0bfc('0x20')]('DeskAccount,\x20%s,\x20%s',_0x10cf7b,_0x53e9fa);_0x349efa(_0x53e9fa);});});}function respondWithStatusCode(_0x29cd96,_0x1bfe02){_0x1bfe02=_0x1bfe02||0xcc;return function(_0x47ba0e){if(_0x47ba0e){return _0x29cd96['sendStatus'](_0x1bfe02);}return _0x29cd96[_0x0bfc('0x25')](_0x1bfe02)[_0x0bfc('0x26')]();};}function respondWithResult(_0x55837d,_0x2b0948){_0x2b0948=_0x2b0948||0xc8;return function(_0x5c9999){if(_0x5c9999){return _0x55837d['status'](_0x2b0948)[_0x0bfc('0x27')](_0x5c9999);}};}function respondWithFilteredResult(_0x395109,_0xcaa60e){return function(_0x4c760b){if(_0x4c760b){var _0x497e18=_0x4c760b['count'],_0x4a500b=_0xcaa60e[_0x0bfc('0x28')],_0x1b4a73=_0xcaa60e[_0x0bfc('0x28')]+_0xcaa60e['limit'],_0x5a7e70;if(_0x1b4a73>=_0x497e18){_0x1b4a73=_0x497e18;_0x5a7e70=0xc8;}else{_0x5a7e70=0xce;}_0x395109['status'](_0x5a7e70);return _0x395109[_0x0bfc('0x29')](_0x0bfc('0x2a'),_0x4a500b+'-'+_0x1b4a73+'/'+_0x497e18)['json'](_0x4c760b);}return null;};}function patchUpdates(_0x4ae125){return function(_0x591db5){try{jsonpatch[_0x0bfc('0x2b')](_0x591db5,_0x4ae125,!![]);}catch(_0x1e1b4d){return BPromise[_0x0bfc('0x2c')](_0x1e1b4d);}return _0x591db5['save']();};}function saveUpdates(_0x178cbb,_0x13b43a){return function(_0xcfdefe){if(_0xcfdefe){return _0xcfdefe['update'](_0x178cbb)[_0x0bfc('0x1c')](function(_0x1a7092){return _0x1a7092;});}return null;};}function removeEntity(_0x3ca707,_0x384e1d){return function(_0x4ab248){if(_0x4ab248){return _0x4ab248[_0x0bfc('0x2d')]()[_0x0bfc('0x1c')](function(){_0x3ca707[_0x0bfc('0x25')](0xcc)[_0x0bfc('0x26')]();});}};}function handleEntityNotFound(_0x2c31d4,_0x45b51f){return function(_0x49a3c5){if(!_0x49a3c5){_0x2c31d4['sendStatus'](0x194);}return _0x49a3c5;};}function handleError(_0x370653,_0xbbf520){_0xbbf520=_0xbbf520||0x1f4;return function(_0x19d578){logger[_0x0bfc('0x20')](_0x19d578[_0x0bfc('0x2e')]);if(_0x19d578[_0x0bfc('0x2f')]){delete _0x19d578[_0x0bfc('0x2f')];}_0x370653[_0x0bfc('0x25')](_0xbbf520)[_0x0bfc('0x30')](_0x19d578);};}exports[_0x0bfc('0x31')]=function(_0xce12b1,_0x27b01c){var _0x5e4d70={},_0x347e8c={},_0x2fed89={'count':0x0,'rows':[]};var _0x1dee6a=_[_0x0bfc('0x32')](db[_0x0bfc('0x33')][_0x0bfc('0x34')],function(_0x51abee){return{'name':_0x51abee['fieldName'],'type':_0x51abee[_0x0bfc('0x35')][_0x0bfc('0x36')]};});_0x347e8c['model']=_['map'](_0x1dee6a,_0x0bfc('0x2f'));_0x347e8c[_0x0bfc('0x37')]=_[_0x0bfc('0x38')](_0xce12b1[_0x0bfc('0x37')]);_0x347e8c[_0x0bfc('0x39')]=_[_0x0bfc('0x3a')](_0x347e8c[_0x0bfc('0x3b')],_0x347e8c[_0x0bfc('0x37')]);_0x5e4d70['attributes']=_[_0x0bfc('0x3a')](_0x347e8c[_0x0bfc('0x3b')],qs['fields'](_0xce12b1[_0x0bfc('0x37')][_0x0bfc('0x3c')]));_0x5e4d70[_0x0bfc('0x3d')]=_0x5e4d70[_0x0bfc('0x3d')][_0x0bfc('0x3e')]?_0x5e4d70[_0x0bfc('0x3d')]:_0x347e8c[_0x0bfc('0x3b')];if(!_0xce12b1[_0x0bfc('0x37')]['hasOwnProperty'](_0x0bfc('0x3f'))){_0x5e4d70['limit']=qs[_0x0bfc('0x40')](_0xce12b1[_0x0bfc('0x37')][_0x0bfc('0x40')]);_0x5e4d70[_0x0bfc('0x28')]=qs[_0x0bfc('0x28')](_0xce12b1[_0x0bfc('0x37')][_0x0bfc('0x28')]);}_0x5e4d70[_0x0bfc('0x41')]=qs[_0x0bfc('0x42')](_0xce12b1[_0x0bfc('0x37')][_0x0bfc('0x42')]);_0x5e4d70['where']=qs[_0x0bfc('0x39')](_[_0x0bfc('0x43')](_0xce12b1[_0x0bfc('0x37')],_0x347e8c[_0x0bfc('0x39')]),_0x1dee6a);if(_0xce12b1['query'][_0x0bfc('0x44')]){_0x5e4d70[_0x0bfc('0x45')]=_[_0x0bfc('0x46')](_0x5e4d70[_0x0bfc('0x45')],{'$or':_[_0x0bfc('0x32')](_0x1dee6a,function(_0x39d1e3){if(_0x39d1e3['type']!==_0x0bfc('0x47')){var _0xa322f6={};_0xa322f6[_0x39d1e3['name']]={'$like':'%'+_0xce12b1['query'][_0x0bfc('0x44')]+'%'};return _0xa322f6;}})});}_0x5e4d70=_[_0x0bfc('0x46')]({},_0x5e4d70,_0xce12b1[_0x0bfc('0x48')]);var _0xc64742={'where':_0x5e4d70[_0x0bfc('0x45')]};return db['DeskAccount'][_0x0bfc('0x49')](_0xc64742)['then'](function(_0x430135){_0x2fed89[_0x0bfc('0x49')]=_0x430135;if(_0xce12b1[_0x0bfc('0x37')][_0x0bfc('0x4a')]){_0x5e4d70[_0x0bfc('0x4b')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x5e4d70);})['then'](function(_0x422f99){_0x2fed89[_0x0bfc('0x4c')]=_0x422f99;return _0x2fed89;})[_0x0bfc('0x1c')](respondWithFilteredResult(_0x27b01c,_0x5e4d70))['catch'](handleError(_0x27b01c,null));};exports[_0x0bfc('0x4d')]=function(_0x2036cb,_0x4d0bb6){var _0x270cc3={'raw':![],'where':{'id':_0x2036cb[_0x0bfc('0x4e')]['id']}},_0x1e4452={};_0x1e4452[_0x0bfc('0x3b')]=_['keys'](db[_0x0bfc('0x33')][_0x0bfc('0x34')]);_0x1e4452[_0x0bfc('0x37')]=_[_0x0bfc('0x38')](_0x2036cb[_0x0bfc('0x37')]);_0x1e4452['filters']=_[_0x0bfc('0x3a')](_0x1e4452[_0x0bfc('0x3b')],_0x1e4452['query']);_0x270cc3['attributes']=_['intersection'](_0x1e4452[_0x0bfc('0x3b')],qs[_0x0bfc('0x3c')](_0x2036cb[_0x0bfc('0x37')][_0x0bfc('0x3c')]));_0x270cc3['attributes']=_0x270cc3[_0x0bfc('0x3d')][_0x0bfc('0x3e')]?_0x270cc3[_0x0bfc('0x3d')]:_0x1e4452[_0x0bfc('0x3b')];if(_0x2036cb[_0x0bfc('0x37')][_0x0bfc('0x4a')]){_0x270cc3[_0x0bfc('0x4b')]=[{'all':!![]}];}_0x270cc3=_['merge']({},_0x270cc3,_0x2036cb[_0x0bfc('0x48')]);return db[_0x0bfc('0x33')][_0x0bfc('0x4f')](_0x270cc3)['then'](handleEntityNotFound(_0x4d0bb6,null))[_0x0bfc('0x1c')](respondWithResult(_0x4d0bb6,null))[_0x0bfc('0x24')](handleError(_0x4d0bb6,null));};exports[_0x0bfc('0x50')]=function(_0x4adda9,_0x4e9d34){return db[_0x0bfc('0x33')][_0x0bfc('0x50')](_0x4adda9[_0x0bfc('0x51')],{})[_0x0bfc('0x1c')](respondWithResult(_0x4e9d34,0xc9))[_0x0bfc('0x24')](handleError(_0x4e9d34,null));};exports['update']=function(_0x37e13c,_0x14f36c){if(_0x37e13c[_0x0bfc('0x51')]['id']){delete _0x37e13c['body']['id'];}return db[_0x0bfc('0x33')]['find']({'where':{'id':_0x37e13c[_0x0bfc('0x4e')]['id']}})[_0x0bfc('0x1c')](handleEntityNotFound(_0x14f36c,null))['then'](saveUpdates(_0x37e13c[_0x0bfc('0x51')],null))[_0x0bfc('0x1c')](respondWithResult(_0x14f36c,null))[_0x0bfc('0x24')](handleError(_0x14f36c,null));};exports[_0x0bfc('0x2d')]=function(_0x1b409a,_0x26d4c2){return db[_0x0bfc('0x33')][_0x0bfc('0x4f')]({'where':{'id':_0x1b409a['params']['id']}})[_0x0bfc('0x1c')](handleEntityNotFound(_0x26d4c2,null))[_0x0bfc('0x1c')](removeEntity(_0x26d4c2,null))['catch'](handleError(_0x26d4c2,null));};exports[_0x0bfc('0x52')]=function(_0x5d2908,_0x50d22f,_0x36331e){var _0x5108a0={};var _0x24fd43={};var _0x10b544;var _0x537672;return db[_0x0bfc('0x33')][_0x0bfc('0x53')]({'where':{'id':_0x5d2908[_0x0bfc('0x4e')]['id']}})[_0x0bfc('0x1c')](handleEntityNotFound(_0x50d22f,null))[_0x0bfc('0x1c')](function(_0x13f4e3){if(_0x13f4e3){_0x10b544=_0x13f4e3;_0x24fd43[_0x0bfc('0x3b')]=_[_0x0bfc('0x38')](db[_0x0bfc('0x54')]['rawAttributes']);_0x24fd43['query']=_[_0x0bfc('0x38')](_0x5d2908[_0x0bfc('0x37')]);_0x24fd43[_0x0bfc('0x39')]=_['intersection'](_0x24fd43[_0x0bfc('0x3b')],_0x24fd43[_0x0bfc('0x37')]);_0x5108a0[_0x0bfc('0x3d')]=_[_0x0bfc('0x3a')](_0x24fd43[_0x0bfc('0x3b')],qs['fields'](_0x5d2908[_0x0bfc('0x37')][_0x0bfc('0x3c')]));_0x5108a0[_0x0bfc('0x3d')]=_0x5108a0[_0x0bfc('0x3d')][_0x0bfc('0x3e')]?_0x5108a0[_0x0bfc('0x3d')]:_0x24fd43[_0x0bfc('0x3b')];_0x5108a0[_0x0bfc('0x41')]=qs[_0x0bfc('0x42')](_0x5d2908[_0x0bfc('0x37')][_0x0bfc('0x42')]);_0x5108a0['where']=qs[_0x0bfc('0x39')](_['pick'](_0x5d2908['query'],_0x24fd43['filters']));if(_0x5d2908[_0x0bfc('0x37')][_0x0bfc('0x44')]){_0x5108a0['where']=_[_0x0bfc('0x46')](_0x5108a0[_0x0bfc('0x45')],{'$or':_[_0x0bfc('0x32')](_0x5108a0[_0x0bfc('0x3d')],function(_0x5408e5){var _0x306ed4={};_0x306ed4[_0x5408e5]={'$like':'%'+_0x5d2908[_0x0bfc('0x37')][_0x0bfc('0x44')]+'%'};return _0x306ed4;})});}_0x5108a0=_['merge']({},_0x5108a0,_0x5d2908[_0x0bfc('0x48')]);return _0x10b544['getConfigurations'](_0x5108a0);}})[_0x0bfc('0x1c')](function(_0x34b02c){if(_0x34b02c){_0x537672=_0x34b02c[_0x0bfc('0x3e')];if(!_0x5d2908['query']['hasOwnProperty'](_0x0bfc('0x3f'))){_0x5108a0['limit']=qs[_0x0bfc('0x40')](_0x5d2908[_0x0bfc('0x37')][_0x0bfc('0x40')]);_0x5108a0[_0x0bfc('0x28')]=qs[_0x0bfc('0x28')](_0x5d2908[_0x0bfc('0x37')]['offset']);}return _0x10b544[_0x0bfc('0x52')](_0x5108a0);}})[_0x0bfc('0x1c')](function(_0x3d0304){if(_0x3d0304){return _0x3d0304?{'count':_0x537672,'rows':_0x3d0304}:null;}})[_0x0bfc('0x1c')](respondWithResult(_0x50d22f,null))[_0x0bfc('0x24')](handleError(_0x50d22f,null));};exports['addConfiguration']=function(_0x3b72de,_0x14a631,_0x39184b){if(_0x3b72de['body']['id']){delete _0x3b72de[_0x0bfc('0x51')]['id'];}return db[_0x0bfc('0x33')][_0x0bfc('0x53')]({'where':{'id':_0x3b72de['params']['id']}})['then'](handleEntityNotFound(_0x14a631,null))['then'](function(_0x351203){if(_0x351203){_0x3b72de['body'][_0x0bfc('0x55')]=_0x351203['id'];_0x3b72de[_0x0bfc('0x51')][_0x0bfc('0x56')]=integrations['getSubjects'](_0x3b72de['body']['channel'],_0x3b72de['body'][_0x0bfc('0x35')]);_0x3b72de[_0x0bfc('0x51')][_0x0bfc('0x57')]=integrations[_0x0bfc('0x58')](_0x3b72de[_0x0bfc('0x51')][_0x0bfc('0x59')],_0x3b72de[_0x0bfc('0x51')][_0x0bfc('0x35')]);return db[_0x0bfc('0x54')][_0x0bfc('0x50')](_0x3b72de['body'],{'include':[{'model':db[_0x0bfc('0x5a')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x0bfc('0x57')}]});}return null;})[_0x0bfc('0x1c')](respondWithResult(_0x14a631,null))[_0x0bfc('0x24')](handleError(_0x14a631,null));};exports[_0x0bfc('0x5b')]=function(_0x2df263,_0x153eec,_0x591892){var _0x24a375=[{'name':'priority','label':_0x0bfc('0x5c'),'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 _0xafd863='';return db[_0x0bfc('0x33')]['findOne']({'where':{'id':_0x2df263['params']['id']},'attributes':['id','remoteUri',_0x0bfc('0x5d'),_0x0bfc('0x5e'),_0x0bfc('0x5f'),_0x0bfc('0x60'),_0x0bfc('0x61'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x153eec,null))[_0x0bfc('0x1c')](function(_0x3a6bf7){if(_0x3a6bf7){_0xafd863=_0x3a6bf7[_0x0bfc('0x62')];var _0x46506e=_0xafd863[_0x0bfc('0x63')](-0x1);if(_0x46506e==='/'){_0xafd863=_0xafd863[_0x0bfc('0x64')](0x0,_0xafd863[_0x0bfc('0x65')](_0x46506e));}var _0x1c5bb7={'method':_0x0bfc('0x66'),'uri':util[_0x0bfc('0x67')]('%s/custom_fields',_0xafd863),'headers':{'Content-Type':'application/json','Accept':_0x0bfc('0x68')},'json':!![]};if(_0x3a6bf7[_0x0bfc('0x5d')]===_0x0bfc('0x69')){_0x1c5bb7['headers'][_0x0bfc('0x6a')]=util['format'](_0x0bfc('0x6b'),new Buffer(util[_0x0bfc('0x67')](_0x0bfc('0x6c'),_0x3a6bf7[_0x0bfc('0x5e')],_0x3a6bf7[_0x0bfc('0x5f')]))[_0x0bfc('0x6d')]('base64'));}return rp(_0x1c5bb7)[_0x0bfc('0x1c')](function(_0xd0218d){return _0x24a375[_0x0bfc('0x6e')](_[_0x0bfc('0x32')](_0xd0218d[_0x0bfc('0x6f')][_0x0bfc('0x70')],function(_0x36531b){return{'id':_0x36531b[_0x0bfc('0x2f')],'name':_0x36531b['name'],'type':_0x36531b['type'],'active':_0x36531b[_0x0bfc('0x71')],'label':_0x36531b[_0x0bfc('0x72')],'custom':!![]};}));});}})[_0x0bfc('0x1c')](function(_0x112530){return{'count':_0x112530['length'],'rows':_0x112530};})[_0x0bfc('0x1c')](respondWithResult(_0x153eec,null))['catch'](function(_0x20f478){var _0x5d7d86=_0x2df263[_0x0bfc('0x37')][_0x0bfc('0x73')]?0x1f4:_0x20f478[_0x0bfc('0x74')]||0x1f4;logger[_0x0bfc('0x20')](_0x0bfc('0x75'),_0x0bfc('0x5b'),_0x5d7d86,JSON[_0x0bfc('0x1f')](_0x20f478));delete _0x20f478['name'];if(_0x5d7d86===0x191){_0x5d7d86=0x190;}_0x153eec[_0x0bfc('0x25')](_0x5d7d86)[_0x0bfc('0x30')](_0x2df263[_0x0bfc('0x37')][_0x0bfc('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x20f478[_0x0bfc('0x74')]}:_0x20f478);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3c8d6eb..b2d3445 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 _0x58fa=['lodash','../../config/logger','api','moment','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x58fa,0x134));var _0xa58f=function(_0x5230bf,_0x3ef407){_0x5230bf=_0x5230bf-0x0;var _0x3d1189=_0x58fa[_0x5230bf];return _0x3d1189;};'use strict';var _=require(_0xa58f('0x0'));var util=require('util');var logger=require(_0xa58f('0x1'))(_0xa58f('0x2'));var moment=require(_0xa58f('0x3'));var BPromise=require(_0xa58f('0x4'));var rp=require(_0xa58f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa58f('0x6'));var integrations=require(_0xa58f('0x7'));module['exports']=function(_0xfaf56,_0x49e2ad){return _0xfaf56[_0xa58f('0x8')](_0xa58f('0x9'),attributes,{'tableName':_0xa58f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x567f=['../../components/integrations/configuration','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x567f,0x123));var _0xf567=function(_0x2cd944,_0x8ba004){_0x2cd944=_0x2cd944-0x0;var _0x39e44e=_0x567f[_0x2cd944];return _0x39e44e;};'use strict';var _=require(_0xf567('0x0'));var util=require(_0xf567('0x1'));var logger=require(_0xf567('0x2'))('api');var moment=require(_0xf567('0x3'));var BPromise=require(_0xf567('0x4'));var rp=require(_0xf567('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf567('0x6'));var config=require(_0xf567('0x7'));var attributes=require(_0xf567('0x8'));var integrations=require(_0xf567('0x9'));module['exports']=function(_0x28c81f,_0x55b774){return _0x28c81f['define'](_0xf567('0xa'),attributes,{'tableName':_0xf567('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 d0289bf..d33ce76 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 _0x35a3=['limit','map','include','model','debug','ShowDeskAccount','find','stringify','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetDeskAccount','DeskAccount','options','where','attributes'];(function(_0x23b6f9,_0x3941a1){var _0x3102c6=function(_0x50b6c2){while(--_0x50b6c2){_0x23b6f9['push'](_0x23b6f9['shift']());}};_0x3102c6(++_0x3941a1);}(_0x35a3,0x1d0));var _0x335a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35a3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x335a('0x0'));var util=require(_0x335a('0x1'));var moment=require(_0x335a('0x2'));var BPromise=require('bluebird');var rs=require(_0x335a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x335a('0x4'))['db'];var utils=require(_0x335a('0x5'));var logger=require(_0x335a('0x6'))(_0x335a('0x7'));var config=require(_0x335a('0x8'));var jayson=require(_0x335a('0x9'));var client=jayson[_0x335a('0xa')][_0x335a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b93f9,_0x24b015,_0x11794c){return new BPromise(function(_0x5d4e7a,_0x39524e){return client[_0x335a('0xc')](_0x2b93f9,_0x11794c)[_0x335a('0xd')](function(_0x2118e3){logger[_0x335a('0xe')](_0x335a('0xf'),_0x24b015,_0x335a('0x10'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x24b015,_0x335a('0x10'),JSON['stringify'](_0x2118e3));if(_0x2118e3[_0x335a('0x11')]){if(_0x2118e3[_0x335a('0x11')][_0x335a('0x12')]===0x1f4){logger[_0x335a('0x11')](_0x335a('0xf'),_0x24b015,_0x2118e3['error'][_0x335a('0x13')]);return _0x39524e(_0x2118e3['error'][_0x335a('0x13')]);}logger['error'](_0x335a('0xf'),_0x24b015,_0x2118e3[_0x335a('0x11')][_0x335a('0x13')]);return _0x5d4e7a(_0x2118e3['error'][_0x335a('0x13')]);}else{logger[_0x335a('0xe')]('DeskAccount,\x20%s,\x20%s',_0x24b015,'request\x20sent');_0x5d4e7a(_0x2118e3[_0x335a('0x14')][_0x335a('0x13')]);}})['catch'](function(_0x23bc49){logger[_0x335a('0x11')](_0x335a('0xf'),_0x24b015,_0x23bc49);_0x39524e(_0x23bc49);});});}exports[_0x335a('0x15')]=function(_0x570723){var _0x29ce13=this;return new Promise(function(_0x2df0d3,_0x4adf8c){return db[_0x335a('0x16')]['findAll']({'raw':_0x570723[_0x335a('0x17')]?_0x570723['options']['raw']===undefined?!![]:![]:!![],'where':_0x570723[_0x335a('0x17')]?_0x570723[_0x335a('0x17')][_0x335a('0x18')]||null:null,'attributes':_0x570723[_0x335a('0x17')]?_0x570723[_0x335a('0x17')][_0x335a('0x19')]||null:null,'limit':_0x570723[_0x335a('0x17')]?_0x570723[_0x335a('0x17')][_0x335a('0x1a')]||null:null,'include':_0x570723['options']?_0x570723[_0x335a('0x17')]['include']?_[_0x335a('0x1b')](_0x570723[_0x335a('0x17')][_0x335a('0x1c')],function(_0x38fe54){return{'model':db[_0x38fe54[_0x335a('0x1d')]],'as':_0x38fe54['as'],'attributes':_0x38fe54[_0x335a('0x19')],'include':_0x38fe54[_0x335a('0x1c')]?_[_0x335a('0x1b')](_0x38fe54[_0x335a('0x1c')],function(_0x110f03){return{'model':db[_0x110f03['model']],'as':_0x110f03['as'],'attributes':_0x110f03[_0x335a('0x19')],'include':_0x110f03['include']?_[_0x335a('0x1b')](_0x110f03[_0x335a('0x1c')],function(_0x344953){return{'model':db[_0x344953[_0x335a('0x1d')]],'as':_0x344953['as'],'attributes':_0x344953[_0x335a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x335a('0xd')](function(_0x4ad270){logger['info'](_0x335a('0x15'),_0x570723);logger[_0x335a('0x1e')]('GetDeskAccount',_0x570723,JSON['stringify'](_0x4ad270));_0x2df0d3(_0x4ad270);})['catch'](function(_0x17cf48){logger[_0x335a('0x11')](_0x335a('0x15'),_0x17cf48[_0x335a('0x13')],_0x570723);_0x4adf8c(_0x29ce13[_0x335a('0x11')](0x1f4,_0x17cf48[_0x335a('0x13')]));});});};exports[_0x335a('0x1f')]=function(_0x5add17){var _0x581e5d=this;return new Promise(function(_0x42d5ab,_0x949b58){return db[_0x335a('0x16')][_0x335a('0x20')]({'raw':_0x5add17[_0x335a('0x17')]?_0x5add17[_0x335a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5add17[_0x335a('0x17')]?_0x5add17[_0x335a('0x17')][_0x335a('0x18')]||null:null,'attributes':_0x5add17[_0x335a('0x17')]?_0x5add17['options'][_0x335a('0x19')]||null:null,'include':_0x5add17[_0x335a('0x17')]?_0x5add17[_0x335a('0x17')][_0x335a('0x1c')]?_[_0x335a('0x1b')](_0x5add17[_0x335a('0x17')][_0x335a('0x1c')],function(_0x3d3221){return{'model':db[_0x3d3221[_0x335a('0x1d')]],'as':_0x3d3221['as'],'attributes':_0x3d3221[_0x335a('0x19')],'include':_0x3d3221['include']?_[_0x335a('0x1b')](_0x3d3221['include'],function(_0xbe4590){return{'model':db[_0xbe4590[_0x335a('0x1d')]],'as':_0xbe4590['as'],'attributes':_0xbe4590[_0x335a('0x19')],'include':_0xbe4590[_0x335a('0x1c')]?_[_0x335a('0x1b')](_0xbe4590[_0x335a('0x1c')],function(_0x2d7533){return{'model':db[_0x2d7533[_0x335a('0x1d')]],'as':_0x2d7533['as'],'attributes':_0x2d7533[_0x335a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x335a('0xd')](function(_0x340b2c){logger[_0x335a('0xe')](_0x335a('0x1f'),_0x5add17);logger[_0x335a('0x1e')](_0x335a('0x1f'),_0x5add17,JSON[_0x335a('0x21')](_0x340b2c));_0x42d5ab(_0x340b2c);})[_0x335a('0x22')](function(_0x153954){logger[_0x335a('0x11')]('ShowDeskAccount',_0x153954[_0x335a('0x13')],_0x5add17);_0x949b58(_0x581e5d['error'](0x1f4,_0x153954[_0x335a('0x13')]));});});}; \ No newline at end of file +var _0x19a7=['error','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19a7,0x15b));var _0x719a=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x19a7[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x719a('0x0'));var moment=require('moment');var BPromise=require(_0x719a('0x1'));var rs=require(_0x719a('0x2'));var fs=require('fs');var Redis=require(_0x719a('0x3'));var db=require(_0x719a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x719a('0x5'))('rpc');var config=require(_0x719a('0x6'));var jayson=require(_0x719a('0x7'));var client=jayson[_0x719a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x463131,_0x520db5,_0x344525){return new BPromise(function(_0xd24ae4,_0xdfd8d6){return client[_0x719a('0x9')](_0x463131,_0x344525)[_0x719a('0xa')](function(_0x10494e){logger[_0x719a('0xb')]('DeskAccount,\x20%s,\x20%s',_0x520db5,_0x719a('0xc'));logger[_0x719a('0xd')](_0x719a('0xe'),_0x520db5,_0x719a('0xc'),JSON[_0x719a('0xf')](_0x10494e));if(_0x10494e['error']){if(_0x10494e[_0x719a('0x10')]['code']===0x1f4){logger[_0x719a('0x10')](_0x719a('0x11'),_0x520db5,_0x10494e[_0x719a('0x10')]['message']);return _0xdfd8d6(_0x10494e[_0x719a('0x10')][_0x719a('0x12')]);}logger[_0x719a('0x10')](_0x719a('0x11'),_0x520db5,_0x10494e['error'][_0x719a('0x12')]);return _0xd24ae4(_0x10494e[_0x719a('0x10')][_0x719a('0x12')]);}else{logger[_0x719a('0xb')](_0x719a('0x11'),_0x520db5,_0x719a('0xc'));_0xd24ae4(_0x10494e[_0x719a('0x13')][_0x719a('0x12')]);}})[_0x719a('0x14')](function(_0x23bc0e){logger[_0x719a('0x10')](_0x719a('0x11'),_0x520db5,_0x23bc0e);_0xdfd8d6(_0x23bc0e);});});}exports['GetDeskAccount']=function(_0x1957a9){var _0x27201=this;return new Promise(function(_0x51364f,_0x445dc7){return db[_0x719a('0x15')][_0x719a('0x16')]({'raw':_0x1957a9[_0x719a('0x17')]?_0x1957a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x1957a9['options']?_0x1957a9[_0x719a('0x17')][_0x719a('0x18')]||null:null,'attributes':_0x1957a9[_0x719a('0x17')]?_0x1957a9[_0x719a('0x17')][_0x719a('0x19')]||null:null,'limit':_0x1957a9[_0x719a('0x17')]?_0x1957a9[_0x719a('0x17')][_0x719a('0x1a')]||null:null,'include':_0x1957a9['options']?_0x1957a9[_0x719a('0x17')][_0x719a('0x1b')]?_[_0x719a('0x1c')](_0x1957a9[_0x719a('0x17')]['include'],function(_0x519a18){return{'model':db[_0x519a18['model']],'as':_0x519a18['as'],'attributes':_0x519a18[_0x719a('0x19')],'include':_0x519a18['include']?_[_0x719a('0x1c')](_0x519a18[_0x719a('0x1b')],function(_0x56ccf0){return{'model':db[_0x56ccf0[_0x719a('0x1d')]],'as':_0x56ccf0['as'],'attributes':_0x56ccf0[_0x719a('0x19')],'include':_0x56ccf0[_0x719a('0x1b')]?_[_0x719a('0x1c')](_0x56ccf0[_0x719a('0x1b')],function(_0x18e967){return{'model':db[_0x18e967[_0x719a('0x1d')]],'as':_0x18e967['as'],'attributes':_0x18e967[_0x719a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x719a('0xa')](function(_0x3e3b3f){logger[_0x719a('0xb')]('GetDeskAccount',_0x1957a9);logger[_0x719a('0xd')](_0x719a('0x1e'),_0x1957a9,JSON[_0x719a('0xf')](_0x3e3b3f));_0x51364f(_0x3e3b3f);})[_0x719a('0x14')](function(_0x53aa6d){logger[_0x719a('0x10')](_0x719a('0x1e'),_0x53aa6d['message'],_0x1957a9);_0x445dc7(_0x27201[_0x719a('0x10')](0x1f4,_0x53aa6d[_0x719a('0x12')]));});});};exports[_0x719a('0x1f')]=function(_0x408ae4){var _0x54567f=this;return new Promise(function(_0x3101f2,_0xf3c498){return db['DeskAccount']['find']({'raw':_0x408ae4[_0x719a('0x17')]?_0x408ae4['options'][_0x719a('0x20')]===undefined?!![]:![]:!![],'where':_0x408ae4[_0x719a('0x17')]?_0x408ae4[_0x719a('0x17')]['where']||null:null,'attributes':_0x408ae4['options']?_0x408ae4[_0x719a('0x17')][_0x719a('0x19')]||null:null,'include':_0x408ae4['options']?_0x408ae4[_0x719a('0x17')][_0x719a('0x1b')]?_[_0x719a('0x1c')](_0x408ae4[_0x719a('0x17')][_0x719a('0x1b')],function(_0x246667){return{'model':db[_0x246667[_0x719a('0x1d')]],'as':_0x246667['as'],'attributes':_0x246667[_0x719a('0x19')],'include':_0x246667[_0x719a('0x1b')]?_[_0x719a('0x1c')](_0x246667[_0x719a('0x1b')],function(_0x3af4fd){return{'model':db[_0x3af4fd[_0x719a('0x1d')]],'as':_0x3af4fd['as'],'attributes':_0x3af4fd['attributes'],'include':_0x3af4fd[_0x719a('0x1b')]?_[_0x719a('0x1c')](_0x3af4fd[_0x719a('0x1b')],function(_0x5831fd){return{'model':db[_0x5831fd['model']],'as':_0x5831fd['as'],'attributes':_0x5831fd[_0x719a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x719a('0xa')](function(_0x472d06){logger['info'](_0x719a('0x1f'),_0x408ae4);logger['debug'](_0x719a('0x1f'),_0x408ae4,JSON[_0x719a('0xf')](_0x472d06));_0x3101f2(_0x472d06);})[_0x719a('0x14')](function(_0x1de724){logger['error']('ShowDeskAccount',_0x1de724[_0x719a('0x12')],_0x408ae4);_0xf3c498(_0x54567f[_0x719a('0x10')](0x1f4,_0x1de724['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index eb1b569..5895fe6 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 _0xceef=['getTags','post','create','update','delete','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags'];(function(_0x35911e,_0x424988){var _0x254042=function(_0x4b19fd){while(--_0x4b19fd){_0x35911e['push'](_0x35911e['shift']());}};_0x254042(++_0x424988);}(_0xceef,0xf6));var _0xfcee=function(_0x304e0e,_0x2654a3){_0x304e0e=_0x304e0e-0x0;var _0x4449c8=_0xceef[_0x304e0e];return _0x4449c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcee('0x0'));var timeout=require(_0xfcee('0x1'));var express=require('express');var router=express[_0xfcee('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcee('0x3'));var config=require(_0xfcee('0x4'));var controller=require('./intDeskConfiguration.controller');router[_0xfcee('0x5')]('/',auth[_0xfcee('0x6')](),controller['index']);router['get'](_0xfcee('0x7'),auth[_0xfcee('0x6')](),controller[_0xfcee('0x8')]);router['get']('/:id/fields',auth[_0xfcee('0x6')](),controller[_0xfcee('0x9')]);router[_0xfcee('0x5')](_0xfcee('0xa'),auth[_0xfcee('0x6')](),controller[_0xfcee('0xb')]);router[_0xfcee('0x5')]('/:id/descriptions',auth[_0xfcee('0x6')](),controller[_0xfcee('0xc')]);router[_0xfcee('0x5')](_0xfcee('0xd'),auth[_0xfcee('0x6')](),controller[_0xfcee('0xe')]);router[_0xfcee('0xf')]('/',auth[_0xfcee('0x6')](),controller[_0xfcee('0x10')]);router['post'](_0xfcee('0xd'),auth[_0xfcee('0x6')](),controller['setTags']);router['put'](_0xfcee('0x7'),auth[_0xfcee('0x6')](),controller[_0xfcee('0x11')]);router[_0xfcee('0x12')](_0xfcee('0x7'),auth[_0xfcee('0x6')](),controller['destroy']);module[_0xfcee('0x13')]=router; \ No newline at end of file +var _0x022a=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3f0ac1,_0x33d10a){var _0x1a2a55=function(_0x3a3db3){while(--_0x3a3db3){_0x3f0ac1['push'](_0x3f0ac1['shift']());}};_0x1a2a55(++_0x33d10a);}(_0x022a,0x1f0));var _0xa022=function(_0x33de79,_0x51888f){_0x33de79=_0x33de79-0x0;var _0x1932fa=_0x022a[_0x33de79];return _0x1932fa;};'use strict';var multer=require(_0xa022('0x0'));var util=require(_0xa022('0x1'));var path=require(_0xa022('0x2'));var timeout=require(_0xa022('0x3'));var express=require(_0xa022('0x4'));var router=express[_0xa022('0x5')]();var auth=require(_0xa022('0x6'));var interaction=require(_0xa022('0x7'));var config=require(_0xa022('0x8'));var controller=require(_0xa022('0x9'));router[_0xa022('0xa')]('/',auth[_0xa022('0xb')](),controller['index']);router[_0xa022('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa022('0xc')]);router[_0xa022('0xa')](_0xa022('0xd'),auth[_0xa022('0xb')](),controller[_0xa022('0xe')]);router[_0xa022('0xa')](_0xa022('0xf'),auth['isAuthenticated'](),controller[_0xa022('0x10')]);router[_0xa022('0xa')](_0xa022('0x11'),auth['isAuthenticated'](),controller[_0xa022('0x12')]);router['get'](_0xa022('0x13'),auth[_0xa022('0xb')](),controller['getTags']);router['post']('/',auth[_0xa022('0xb')](),controller[_0xa022('0x14')]);router[_0xa022('0x15')](_0xa022('0x13'),auth['isAuthenticated'](),controller['setTags']);router[_0xa022('0x16')]('/:id',auth[_0xa022('0xb')](),controller[_0xa022('0x17')]);router[_0xa022('0x18')](_0xa022('0x19'),auth[_0xa022('0xb')](),controller[_0xa022('0x1a')]);module[_0xa022('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ffbe84a..6db8423 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 _0xa27c=['exports','STRING','sequelize'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa27c,0x7a));var _0xca27=function(_0x2ace47,_0x131d93){_0x2ace47=_0x2ace47-0x0;var _0x101a32=_0xa27c[_0x2ace47];return _0x101a32;};'use strict';var Sequelize=require(_0xca27('0x0'));module[_0xca27('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca27('0x2')]}}; \ No newline at end of file +var _0xb804=['exports','STRING','sequelize'];(function(_0x35faff,_0x59cd77){var _0xaa4d94=function(_0x495901){while(--_0x495901){_0x35faff['push'](_0x35faff['shift']());}};_0xaa4d94(++_0x59cd77);}(_0xb804,0xb3));var _0x4b80=function(_0x1c898b,_0x559ff6){_0x1c898b=_0x1c898b-0x0;var _0x54ed0e=_0xb804[_0x1c898b];return _0x54ed0e;};'use strict';var Sequelize=require(_0x4b80('0x0'));module[_0x4b80('0x1')]={'name':{'type':Sequelize[_0x4b80('0x2')]},'description':{'type':Sequelize[_0x4b80('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2425bbd..fb67f7d 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 _0xbe45=['destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','DeskConfiguration','count','includeAll','include','findAll','rows','params','find','create','body','getFields','findOne','DeskField','pick','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','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','request\x20sent','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','Content-Range','reject','save','update'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xbe45,0xf0));var _0x5be4=function(_0x268bc6,_0x39cc42){_0x268bc6=_0x268bc6-0x0;var _0x5e923e=_0xbe45[_0x268bc6];return _0x5e923e;};'use strict';var pdf=require(_0x5be4('0x0'));var emlformat=require(_0x5be4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5be4('0x2'));var jsonpatch=require(_0x5be4('0x3'));var rp=require(_0x5be4('0x4'));var moment=require(_0x5be4('0x5'));var BPromise=require(_0x5be4('0x6'));var Mustache=require(_0x5be4('0x7'));var util=require('util');var path=require(_0x5be4('0x8'));var sox=require(_0x5be4('0x9'));var csv=require(_0x5be4('0xa'));var ejs=require(_0x5be4('0xb'));var fs=require('fs');var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0xa'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5be4('0x18'));var client=jayson[_0x5be4('0x19')][_0x5be4('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5c6615,_0x349610,_0x4a84c5){if(_0x4a84c5){var _0x246d2e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x246d2e[_0x5be4('0x1b')](_0x349610)){return _0x5c6615;}else{throw new db[(_0x5be4('0x1c'))][(_0x5be4('0x1d'))](_0x5be4('0x1e'));}}else{return _0x5c6615;}}function respondWithRpcPromise(_0x3b3dd1,_0x3980fc,_0x5ebe65,_0x3e830e){return new BPromise(function(_0x8466a7,_0x1d7db7){var _0x11e581=_0x3e830e||client;return _0x11e581[_0x5be4('0x1f')](_0x3b3dd1,_0x5ebe65)[_0x5be4('0x20')](function(_0x94f434){logger[_0x5be4('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x3980fc,_0x5be4('0x22'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3980fc,_0x5be4('0x22'),JSON[_0x5be4('0x23')](_0x94f434));if(_0x94f434['error']){if(_0x94f434[_0x5be4('0x24')][_0x5be4('0x25')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3980fc,_0x94f434[_0x5be4('0x24')][_0x5be4('0x26')]);return _0x1d7db7(_0x94f434['error']['message']);}logger[_0x5be4('0x24')](_0x5be4('0x27'),_0x3980fc,_0x94f434[_0x5be4('0x24')][_0x5be4('0x26')]);return _0x8466a7(_0x94f434[_0x5be4('0x24')]['message']);}else{logger[_0x5be4('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x3980fc,_0x5be4('0x22'));_0x8466a7(_0x94f434[_0x5be4('0x28')]['message']);}})[_0x5be4('0x29')](function(_0x2ed4b6){logger['error'](_0x5be4('0x27'),_0x3980fc,_0x2ed4b6);_0x1d7db7(_0x2ed4b6);});});}function respondWithStatusCode(_0x2b2e2c,_0x353a65){_0x353a65=_0x353a65||0xcc;return function(_0x39cf54){if(_0x39cf54){return _0x2b2e2c[_0x5be4('0x2a')](_0x353a65);}return _0x2b2e2c[_0x5be4('0x2b')](_0x353a65)[_0x5be4('0x2c')]();};}function respondWithResult(_0x5b49ea,_0x50e5be){_0x50e5be=_0x50e5be||0xc8;return function(_0x51584f){if(_0x51584f){return _0x5b49ea[_0x5be4('0x2b')](_0x50e5be)[_0x5be4('0x2d')](_0x51584f);}};}function respondWithFilteredResult(_0x5c489e,_0xd88995){return function(_0x15dec0){if(_0x15dec0){var _0x3bd842=_0x15dec0['count'],_0x412ef6=_0xd88995[_0x5be4('0x2e')],_0x16f3bf=_0xd88995[_0x5be4('0x2e')]+_0xd88995['limit'],_0x1e0485;if(_0x16f3bf>=_0x3bd842){_0x16f3bf=_0x3bd842;_0x1e0485=0xc8;}else{_0x1e0485=0xce;}_0x5c489e[_0x5be4('0x2b')](_0x1e0485);return _0x5c489e['set'](_0x5be4('0x2f'),_0x412ef6+'-'+_0x16f3bf+'/'+_0x3bd842)[_0x5be4('0x2d')](_0x15dec0);}return null;};}function patchUpdates(_0x47ecca){return function(_0x33aacb){try{jsonpatch['apply'](_0x33aacb,_0x47ecca,!![]);}catch(_0x50d906){return BPromise[_0x5be4('0x30')](_0x50d906);}return _0x33aacb[_0x5be4('0x31')]();};}function saveUpdates(_0x6e2def,_0x307a3f){return function(_0x3bf96d){if(_0x3bf96d){return _0x3bf96d[_0x5be4('0x32')](_0x6e2def)[_0x5be4('0x20')](function(_0x3fd82f){return _0x3fd82f;});}return null;};}function removeEntity(_0x1fc0bd,_0x3cb75f){return function(_0x24ebf3){if(_0x24ebf3){return _0x24ebf3[_0x5be4('0x33')]()['then'](function(){_0x1fc0bd['status'](0xcc)[_0x5be4('0x2c')]();});}};}function handleEntityNotFound(_0x154d66,_0xba5a1e){return function(_0x2af6c3){if(!_0x2af6c3){_0x154d66['sendStatus'](0x194);}return _0x2af6c3;};}function handleError(_0x2645ce,_0x4ae580){_0x4ae580=_0x4ae580||0x1f4;return function(_0x262550){logger['error'](_0x262550[_0x5be4('0x34')]);if(_0x262550[_0x5be4('0x35')]){delete _0x262550['name'];}_0x2645ce['status'](_0x4ae580)[_0x5be4('0x36')](_0x262550);};}exports['index']=function(_0x48b24a,_0x1b1ee9){var _0x1681ed={},_0x277d36={},_0x55253d={'count':0x0,'rows':[]};var _0x3dc4f9=_[_0x5be4('0x37')](db['DeskConfiguration'][_0x5be4('0x38')],function(_0x46953c){return{'name':_0x46953c[_0x5be4('0x39')],'type':_0x46953c[_0x5be4('0x3a')]['key']};});_0x277d36[_0x5be4('0x3b')]=_[_0x5be4('0x37')](_0x3dc4f9,_0x5be4('0x35'));_0x277d36[_0x5be4('0x3c')]=_[_0x5be4('0x3d')](_0x48b24a[_0x5be4('0x3c')]);_0x277d36[_0x5be4('0x3e')]=_[_0x5be4('0x3f')](_0x277d36['model'],_0x277d36[_0x5be4('0x3c')]);_0x1681ed[_0x5be4('0x40')]=_[_0x5be4('0x3f')](_0x277d36[_0x5be4('0x3b')],qs[_0x5be4('0x41')](_0x48b24a['query'][_0x5be4('0x41')]));_0x1681ed[_0x5be4('0x40')]=_0x1681ed['attributes'][_0x5be4('0x42')]?_0x1681ed[_0x5be4('0x40')]:_0x277d36['model'];if(!_0x48b24a[_0x5be4('0x3c')][_0x5be4('0x43')](_0x5be4('0x44'))){_0x1681ed[_0x5be4('0x45')]=qs[_0x5be4('0x45')](_0x48b24a[_0x5be4('0x3c')][_0x5be4('0x45')]);_0x1681ed[_0x5be4('0x2e')]=qs[_0x5be4('0x2e')](_0x48b24a['query'][_0x5be4('0x2e')]);}_0x1681ed['order']=qs[_0x5be4('0x46')](_0x48b24a[_0x5be4('0x3c')]['sort']);_0x1681ed[_0x5be4('0x47')]=qs['filters'](_['pick'](_0x48b24a[_0x5be4('0x3c')],_0x277d36[_0x5be4('0x3e')]),_0x3dc4f9);if(_0x48b24a[_0x5be4('0x3c')][_0x5be4('0x48')]){_0x1681ed[_0x5be4('0x47')]=_[_0x5be4('0x49')](_0x1681ed[_0x5be4('0x47')],{'$or':_['map'](_0x3dc4f9,function(_0x3ff2a0){if(_0x3ff2a0['type']!==_0x5be4('0x4a')){var _0x518ad5={};_0x518ad5[_0x3ff2a0[_0x5be4('0x35')]]={'$like':'%'+_0x48b24a[_0x5be4('0x3c')]['filter']+'%'};return _0x518ad5;}})});}_0x1681ed=_[_0x5be4('0x49')]({},_0x1681ed,_0x48b24a[_0x5be4('0x4b')]);var _0x1b2171={'where':_0x1681ed['where']};return db[_0x5be4('0x4c')][_0x5be4('0x4d')](_0x1b2171)['then'](function(_0x3b5fc6){_0x55253d['count']=_0x3b5fc6;if(_0x48b24a['query'][_0x5be4('0x4e')]){_0x1681ed[_0x5be4('0x4f')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x5be4('0x50')](_0x1681ed);})['then'](function(_0x5411bf){_0x55253d[_0x5be4('0x51')]=_0x5411bf;return _0x55253d;})[_0x5be4('0x20')](respondWithFilteredResult(_0x1b1ee9,_0x1681ed))[_0x5be4('0x29')](handleError(_0x1b1ee9,null));};exports['show']=function(_0x5a8de6,_0x378ae7){var _0x2fb7cd={'raw':![],'where':{'id':_0x5a8de6[_0x5be4('0x52')]['id']}},_0x117a92={};_0x117a92['model']=_[_0x5be4('0x3d')](db[_0x5be4('0x4c')]['rawAttributes']);_0x117a92[_0x5be4('0x3c')]=_[_0x5be4('0x3d')](_0x5a8de6[_0x5be4('0x3c')]);_0x117a92['filters']=_[_0x5be4('0x3f')](_0x117a92[_0x5be4('0x3b')],_0x117a92[_0x5be4('0x3c')]);_0x2fb7cd[_0x5be4('0x40')]=_[_0x5be4('0x3f')](_0x117a92[_0x5be4('0x3b')],qs[_0x5be4('0x41')](_0x5a8de6[_0x5be4('0x3c')][_0x5be4('0x41')]));_0x2fb7cd[_0x5be4('0x40')]=_0x2fb7cd['attributes'][_0x5be4('0x42')]?_0x2fb7cd['attributes']:_0x117a92[_0x5be4('0x3b')];if(_0x5a8de6[_0x5be4('0x3c')][_0x5be4('0x4e')]){_0x2fb7cd[_0x5be4('0x4f')]=[{'all':!![]}];}_0x2fb7cd=_[_0x5be4('0x49')]({},_0x2fb7cd,_0x5a8de6[_0x5be4('0x4b')]);return db[_0x5be4('0x4c')][_0x5be4('0x53')](_0x2fb7cd)[_0x5be4('0x20')](handleEntityNotFound(_0x378ae7,null))[_0x5be4('0x20')](respondWithResult(_0x378ae7,null))[_0x5be4('0x29')](handleError(_0x378ae7,null));};exports['create']=function(_0x4367fa,_0x1031ea){return db[_0x5be4('0x4c')][_0x5be4('0x54')](_0x4367fa[_0x5be4('0x55')],{})['then'](respondWithResult(_0x1031ea,0xc9))[_0x5be4('0x29')](handleError(_0x1031ea,null));};exports[_0x5be4('0x32')]=function(_0xf454e6,_0x446e59){if(_0xf454e6[_0x5be4('0x55')]['id']){delete _0xf454e6[_0x5be4('0x55')]['id'];}return db[_0x5be4('0x4c')]['find']({'where':{'id':_0xf454e6[_0x5be4('0x52')]['id']}})['then'](handleEntityNotFound(_0x446e59,null))[_0x5be4('0x20')](saveUpdates(_0xf454e6[_0x5be4('0x55')],null))['then'](respondWithResult(_0x446e59,null))[_0x5be4('0x29')](handleError(_0x446e59,null));};exports[_0x5be4('0x33')]=function(_0x3c3ebb,_0xb12df){return db[_0x5be4('0x4c')][_0x5be4('0x53')]({'where':{'id':_0x3c3ebb[_0x5be4('0x52')]['id']}})[_0x5be4('0x20')](handleEntityNotFound(_0xb12df,null))['then'](removeEntity(_0xb12df,null))['catch'](handleError(_0xb12df,null));};exports[_0x5be4('0x56')]=function(_0x4812cf,_0x212f5d,_0x562e1d){var _0x27c570={};var _0x2a5b4f={};var _0x688cc2;var _0x2f94d6;return db[_0x5be4('0x4c')][_0x5be4('0x57')]({'where':{'id':_0x4812cf[_0x5be4('0x52')]['id']}})['then'](handleEntityNotFound(_0x212f5d,null))[_0x5be4('0x20')](function(_0x356e4d){if(_0x356e4d){_0x688cc2=_0x356e4d;_0x2a5b4f['model']=_[_0x5be4('0x3d')](db[_0x5be4('0x58')][_0x5be4('0x38')]);_0x2a5b4f[_0x5be4('0x3c')]=_[_0x5be4('0x3d')](_0x4812cf['query']);_0x2a5b4f[_0x5be4('0x3e')]=_[_0x5be4('0x3f')](_0x2a5b4f[_0x5be4('0x3b')],_0x2a5b4f[_0x5be4('0x3c')]);_0x27c570[_0x5be4('0x40')]=_['intersection'](_0x2a5b4f[_0x5be4('0x3b')],qs['fields'](_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x41')]));_0x27c570[_0x5be4('0x40')]=_0x27c570['attributes'][_0x5be4('0x42')]?_0x27c570[_0x5be4('0x40')]:_0x2a5b4f['model'];_0x27c570['order']=qs[_0x5be4('0x46')](_0x4812cf[_0x5be4('0x3c')]['sort']);_0x27c570[_0x5be4('0x47')]=qs[_0x5be4('0x3e')](_[_0x5be4('0x59')](_0x4812cf[_0x5be4('0x3c')],_0x2a5b4f[_0x5be4('0x3e')]));if(_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x48')]){_0x27c570[_0x5be4('0x47')]=_[_0x5be4('0x49')](_0x27c570[_0x5be4('0x47')],{'$or':_[_0x5be4('0x37')](_0x27c570[_0x5be4('0x40')],function(_0x5a7d62){var _0x1a9443={};_0x1a9443[_0x5a7d62]={'$like':'%'+_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x48')]+'%'};return _0x1a9443;})});}_0x27c570=_[_0x5be4('0x49')]({},_0x27c570,_0x4812cf[_0x5be4('0x4b')]);return _0x688cc2[_0x5be4('0x56')](_0x27c570);}})[_0x5be4('0x20')](function(_0x1011d2){if(_0x1011d2){_0x2f94d6=_0x1011d2[_0x5be4('0x42')];if(!_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x43')]('nolimit')){_0x27c570['limit']=qs[_0x5be4('0x45')](_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x45')]);_0x27c570['offset']=qs['offset'](_0x4812cf[_0x5be4('0x3c')][_0x5be4('0x2e')]);}return _0x688cc2[_0x5be4('0x56')](_0x27c570);}})[_0x5be4('0x20')](function(_0x346d5a){if(_0x346d5a){return _0x346d5a?{'count':_0x2f94d6,'rows':_0x346d5a}:null;}})[_0x5be4('0x20')](respondWithResult(_0x212f5d,null))[_0x5be4('0x29')](handleError(_0x212f5d,null));};exports['getSubjects']=function(_0x21f887,_0x349b46,_0x4a04d1){var _0x3df075={};var _0x578b9c={};var _0x4526c9;var _0x565869;return db['DeskConfiguration']['findOne']({'where':{'id':_0x21f887[_0x5be4('0x52')]['id']}})[_0x5be4('0x20')](handleEntityNotFound(_0x349b46,null))[_0x5be4('0x20')](function(_0xc77b29){if(_0xc77b29){_0x4526c9=_0xc77b29;_0x578b9c['model']=_['keys'](db['DeskField']['rawAttributes']);_0x578b9c['query']=_[_0x5be4('0x3d')](_0x21f887[_0x5be4('0x3c')]);_0x578b9c['filters']=_['intersection'](_0x578b9c[_0x5be4('0x3b')],_0x578b9c[_0x5be4('0x3c')]);_0x3df075[_0x5be4('0x40')]=_[_0x5be4('0x3f')](_0x578b9c[_0x5be4('0x3b')],qs[_0x5be4('0x41')](_0x21f887[_0x5be4('0x3c')][_0x5be4('0x41')]));_0x3df075['attributes']=_0x3df075[_0x5be4('0x40')][_0x5be4('0x42')]?_0x3df075['attributes']:_0x578b9c['model'];_0x3df075[_0x5be4('0x5a')]=qs[_0x5be4('0x46')](_0x21f887['query'][_0x5be4('0x46')]);_0x3df075[_0x5be4('0x47')]=qs[_0x5be4('0x3e')](_[_0x5be4('0x59')](_0x21f887[_0x5be4('0x3c')],_0x578b9c[_0x5be4('0x3e')]));if(_0x21f887[_0x5be4('0x3c')][_0x5be4('0x48')]){_0x3df075[_0x5be4('0x47')]=_['merge'](_0x3df075[_0x5be4('0x47')],{'$or':_[_0x5be4('0x37')](_0x3df075[_0x5be4('0x40')],function(_0x213904){var _0x2ee96c={};_0x2ee96c[_0x213904]={'$like':'%'+_0x21f887['query']['filter']+'%'};return _0x2ee96c;})});}_0x3df075=_[_0x5be4('0x49')]({},_0x3df075,_0x21f887[_0x5be4('0x4b')]);return _0x4526c9[_0x5be4('0x5b')](_0x3df075);}})[_0x5be4('0x20')](function(_0x3c3515){if(_0x3c3515){_0x565869=_0x3c3515[_0x5be4('0x42')];if(!_0x21f887[_0x5be4('0x3c')][_0x5be4('0x43')]('nolimit')){_0x3df075[_0x5be4('0x45')]=qs[_0x5be4('0x45')](_0x21f887[_0x5be4('0x3c')][_0x5be4('0x45')]);_0x3df075[_0x5be4('0x2e')]=qs[_0x5be4('0x2e')](_0x21f887[_0x5be4('0x3c')]['offset']);}return _0x4526c9['getSubjects'](_0x3df075);}})[_0x5be4('0x20')](function(_0x180a69){if(_0x180a69){return _0x180a69?{'count':_0x565869,'rows':_0x180a69}:null;}})[_0x5be4('0x20')](respondWithResult(_0x349b46,null))[_0x5be4('0x29')](handleError(_0x349b46,null));};exports[_0x5be4('0x5c')]=function(_0x416b22,_0x2833d8,_0x2645c8){var _0x4e9aa9={};var _0x105b63={};var _0xa525d;var _0x5d579b;return db['DeskConfiguration'][_0x5be4('0x57')]({'where':{'id':_0x416b22['params']['id']}})['then'](handleEntityNotFound(_0x2833d8,null))['then'](function(_0x41fd91){if(_0x41fd91){_0xa525d=_0x41fd91;_0x105b63[_0x5be4('0x3b')]=_[_0x5be4('0x3d')](db[_0x5be4('0x58')][_0x5be4('0x38')]);_0x105b63['query']=_[_0x5be4('0x3d')](_0x416b22[_0x5be4('0x3c')]);_0x105b63[_0x5be4('0x3e')]=_['intersection'](_0x105b63[_0x5be4('0x3b')],_0x105b63[_0x5be4('0x3c')]);_0x4e9aa9['attributes']=_[_0x5be4('0x3f')](_0x105b63[_0x5be4('0x3b')],qs[_0x5be4('0x41')](_0x416b22[_0x5be4('0x3c')][_0x5be4('0x41')]));_0x4e9aa9[_0x5be4('0x40')]=_0x4e9aa9[_0x5be4('0x40')][_0x5be4('0x42')]?_0x4e9aa9[_0x5be4('0x40')]:_0x105b63['model'];_0x4e9aa9[_0x5be4('0x5a')]=qs[_0x5be4('0x46')](_0x416b22[_0x5be4('0x3c')][_0x5be4('0x46')]);_0x4e9aa9[_0x5be4('0x47')]=qs[_0x5be4('0x3e')](_[_0x5be4('0x59')](_0x416b22[_0x5be4('0x3c')],_0x105b63[_0x5be4('0x3e')]));if(_0x416b22[_0x5be4('0x3c')][_0x5be4('0x48')]){_0x4e9aa9[_0x5be4('0x47')]=_[_0x5be4('0x49')](_0x4e9aa9[_0x5be4('0x47')],{'$or':_[_0x5be4('0x37')](_0x4e9aa9[_0x5be4('0x40')],function(_0x526e03){var _0x4adfb0={};_0x4adfb0[_0x526e03]={'$like':'%'+_0x416b22[_0x5be4('0x3c')][_0x5be4('0x48')]+'%'};return _0x4adfb0;})});}_0x4e9aa9=_[_0x5be4('0x49')]({},_0x4e9aa9,_0x416b22[_0x5be4('0x4b')]);return _0xa525d[_0x5be4('0x5c')](_0x4e9aa9);}})[_0x5be4('0x20')](function(_0x112221){if(_0x112221){_0x5d579b=_0x112221[_0x5be4('0x42')];if(!_0x416b22[_0x5be4('0x3c')][_0x5be4('0x43')](_0x5be4('0x44'))){_0x4e9aa9[_0x5be4('0x45')]=qs[_0x5be4('0x45')](_0x416b22[_0x5be4('0x3c')]['limit']);_0x4e9aa9['offset']=qs[_0x5be4('0x2e')](_0x416b22[_0x5be4('0x3c')][_0x5be4('0x2e')]);}return _0xa525d['getDescriptions'](_0x4e9aa9);}})[_0x5be4('0x20')](function(_0x2fb12c){if(_0x2fb12c){return _0x2fb12c?{'count':_0x5d579b,'rows':_0x2fb12c}:null;}})['then'](respondWithResult(_0x2833d8,null))[_0x5be4('0x29')](handleError(_0x2833d8,null));};exports[_0x5be4('0x5d')]=function(_0x4144ef,_0x3f94ba,_0x2179ae){var _0x214dc7={};var _0x12db5f={};var _0x4ed3e4;var _0x15b875;return db[_0x5be4('0x4c')][_0x5be4('0x57')]({'where':{'id':_0x4144ef[_0x5be4('0x52')]['id']}})[_0x5be4('0x20')](handleEntityNotFound(_0x3f94ba,null))['then'](function(_0x4f5f32){if(_0x4f5f32){_0x4ed3e4=_0x4f5f32;_0x12db5f['model']=_['keys'](db[_0x5be4('0x5e')][_0x5be4('0x38')]);_0x12db5f[_0x5be4('0x3c')]=_['keys'](_0x4144ef['query']);_0x12db5f['filters']=_[_0x5be4('0x3f')](_0x12db5f[_0x5be4('0x3b')],_0x12db5f[_0x5be4('0x3c')]);_0x214dc7[_0x5be4('0x40')]=_[_0x5be4('0x3f')](_0x12db5f[_0x5be4('0x3b')],qs[_0x5be4('0x41')](_0x4144ef[_0x5be4('0x3c')][_0x5be4('0x41')]));_0x214dc7[_0x5be4('0x40')]=_0x214dc7[_0x5be4('0x40')][_0x5be4('0x42')]?_0x214dc7[_0x5be4('0x40')]:_0x12db5f[_0x5be4('0x3b')];_0x214dc7[_0x5be4('0x5a')]=qs[_0x5be4('0x46')](_0x4144ef['query']['sort']);_0x214dc7['where']=qs[_0x5be4('0x3e')](_[_0x5be4('0x59')](_0x4144ef[_0x5be4('0x3c')],_0x12db5f[_0x5be4('0x3e')]));if(_0x4144ef[_0x5be4('0x3c')]['filter']){_0x214dc7['where']=_['merge'](_0x214dc7[_0x5be4('0x47')],{'$or':_['map'](_0x214dc7['attributes'],function(_0x588ff7){var _0x209a67={};_0x209a67[_0x588ff7]={'$like':'%'+_0x4144ef[_0x5be4('0x3c')][_0x5be4('0x48')]+'%'};return _0x209a67;})});}_0x214dc7=_[_0x5be4('0x49')]({},_0x214dc7,_0x4144ef[_0x5be4('0x4b')]);return _0x4ed3e4[_0x5be4('0x5d')](_0x214dc7);}})[_0x5be4('0x20')](function(_0x480f74){if(_0x480f74){_0x15b875=_0x480f74[_0x5be4('0x42')];if(!_0x4144ef[_0x5be4('0x3c')][_0x5be4('0x43')](_0x5be4('0x44'))){_0x214dc7['limit']=qs[_0x5be4('0x45')](_0x4144ef[_0x5be4('0x3c')][_0x5be4('0x45')]);_0x214dc7[_0x5be4('0x2e')]=qs[_0x5be4('0x2e')](_0x4144ef[_0x5be4('0x3c')][_0x5be4('0x2e')]);}return _0x4ed3e4['getTags'](_0x214dc7);}})[_0x5be4('0x20')](function(_0x23a34c){if(_0x23a34c){return _0x23a34c?{'count':_0x15b875,'rows':_0x23a34c}:null;}})['then'](respondWithResult(_0x3f94ba,null))[_0x5be4('0x29')](handleError(_0x3f94ba,null));};exports[_0x5be4('0x5f')]=function(_0x5d909d,_0x1760f9,_0x1ba2ce){if(_0x5d909d['body']['id']){delete _0x5d909d[_0x5be4('0x55')]['id'];}return db[_0x5be4('0x4c')][_0x5be4('0x57')]({'where':{'id':_0x5d909d['params']['id']}})[_0x5be4('0x20')](handleEntityNotFound(_0x1760f9,null))[_0x5be4('0x20')](function(_0x41322c){if(_0x41322c){return _0x41322c[_0x5be4('0x5f')](_0x5d909d['body'][_0x5be4('0x60')]||[]);}return null;})[_0x5be4('0x20')](respondWithResult(_0x1760f9,null))['catch'](handleError(_0x1760f9,null));}; \ No newline at end of file +var _0xf120=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','model','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','keys','find','create','body','params','destroy','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0x244e82,_0x1a31e6){var _0x2e8c36=function(_0x44eb7a){while(--_0x44eb7a){_0x244e82['push'](_0x244e82['shift']());}};_0x2e8c36(++_0x1a31e6);}(_0xf120,0x179));var _0x0f12=function(_0x5dd1d3,_0x51ccf8){_0x5dd1d3=_0x5dd1d3-0x0;var _0x267429=_0xf120[_0x5dd1d3];return _0x267429;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0f12('0x0'));var rimraf=require(_0x0f12('0x1'));var zipdir=require(_0x0f12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f12('0x3'));var moment=require(_0x0f12('0x4'));var BPromise=require(_0x0f12('0x5'));var Mustache=require('mustache');var util=require(_0x0f12('0x6'));var path=require(_0x0f12('0x7'));var sox=require(_0x0f12('0x8'));var csv=require(_0x0f12('0x9'));var ejs=require(_0x0f12('0xa'));var fs=require('fs');var _=require(_0x0f12('0xb'));var squel=require(_0x0f12('0xc'));var crypto=require(_0x0f12('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0f12('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f12('0xf'));var Papa=require(_0x0f12('0x10'));var Redis=require(_0x0f12('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f12('0x12'));var hardwareService=require(_0x0f12('0x13'));var logger=require(_0x0f12('0x14'))(_0x0f12('0x15'));var utils=require(_0x0f12('0x16'));var config=require(_0x0f12('0x17'));var db=require(_0x0f12('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0f12('0x19')][_0x0f12('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb80905,_0x17960e,_0x22f390){if(_0x22f390){var _0xc019be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc019be[_0x0f12('0x1b')](_0x17960e)){return _0xb80905;}else{throw new db[(_0x0f12('0x1c'))][(_0x0f12('0x1d'))](_0x0f12('0x1e'));}}else{return _0xb80905;}}function respondWithRpcPromise(_0x23adc0,_0x3f2716,_0xe61624,_0x27addc){return new BPromise(function(_0xeccb7c,_0x592617){var _0x1db207=_0x27addc||client;return _0x1db207['request'](_0x23adc0,_0xe61624)[_0x0f12('0x1f')](function(_0x3a7041){logger[_0x0f12('0x20')](_0x0f12('0x21'),_0x3f2716,_0x0f12('0x22'));logger[_0x0f12('0x23')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3f2716,_0x0f12('0x22'),JSON['stringify'](_0x3a7041));if(_0x3a7041[_0x0f12('0x24')]){if(_0x3a7041['error']['code']===0x1f4){logger[_0x0f12('0x24')](_0x0f12('0x21'),_0x3f2716,_0x3a7041[_0x0f12('0x24')]['message']);return _0x592617(_0x3a7041[_0x0f12('0x24')]['message']);}logger[_0x0f12('0x24')]('DeskConfiguration,\x20%s,\x20%s',_0x3f2716,_0x3a7041[_0x0f12('0x24')][_0x0f12('0x25')]);return _0xeccb7c(_0x3a7041['error'][_0x0f12('0x25')]);}else{logger[_0x0f12('0x20')](_0x0f12('0x21'),_0x3f2716,_0x0f12('0x22'));_0xeccb7c(_0x3a7041[_0x0f12('0x26')]['message']);}})[_0x0f12('0x27')](function(_0x534b01){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3f2716,_0x534b01);_0x592617(_0x534b01);});});}function respondWithStatusCode(_0xee18d0,_0x247f31){_0x247f31=_0x247f31||0xcc;return function(_0xa67a43){if(_0xa67a43){return _0xee18d0[_0x0f12('0x28')](_0x247f31);}return _0xee18d0['status'](_0x247f31)[_0x0f12('0x29')]();};}function respondWithResult(_0x8917eb,_0xde0ddf){_0xde0ddf=_0xde0ddf||0xc8;return function(_0x5ca297){if(_0x5ca297){return _0x8917eb[_0x0f12('0x2a')](_0xde0ddf)[_0x0f12('0x2b')](_0x5ca297);}};}function respondWithFilteredResult(_0x8f43f9,_0x5cb12b){return function(_0xeee65){if(_0xeee65){var _0x25a5dc=_0xeee65['count'],_0x1521c6=_0x5cb12b['offset'],_0x89add5=_0x5cb12b[_0x0f12('0x2c')]+_0x5cb12b['limit'],_0x1c7d2b;if(_0x89add5>=_0x25a5dc){_0x89add5=_0x25a5dc;_0x1c7d2b=0xc8;}else{_0x1c7d2b=0xce;}_0x8f43f9[_0x0f12('0x2a')](_0x1c7d2b);return _0x8f43f9[_0x0f12('0x2d')](_0x0f12('0x2e'),_0x1521c6+'-'+_0x89add5+'/'+_0x25a5dc)['json'](_0xeee65);}return null;};}function patchUpdates(_0x12a575){return function(_0x45a39a){try{jsonpatch[_0x0f12('0x2f')](_0x45a39a,_0x12a575,!![]);}catch(_0x11a809){return BPromise[_0x0f12('0x30')](_0x11a809);}return _0x45a39a[_0x0f12('0x31')]();};}function saveUpdates(_0x521ce1,_0x2c28e5){return function(_0x3310c4){if(_0x3310c4){return _0x3310c4[_0x0f12('0x32')](_0x521ce1)['then'](function(_0x13807f){return _0x13807f;});}return null;};}function removeEntity(_0x40a279,_0x214e11){return function(_0xf288bb){if(_0xf288bb){return _0xf288bb['destroy']()[_0x0f12('0x1f')](function(){_0x40a279[_0x0f12('0x2a')](0xcc)[_0x0f12('0x29')]();});}};}function handleEntityNotFound(_0x15a629,_0xc7a1f6){return function(_0x7efa57){if(!_0x7efa57){_0x15a629[_0x0f12('0x28')](0x194);}return _0x7efa57;};}function handleError(_0x494ed8,_0x15a508){_0x15a508=_0x15a508||0x1f4;return function(_0x39161c){logger['error'](_0x39161c[_0x0f12('0x33')]);if(_0x39161c[_0x0f12('0x34')]){delete _0x39161c['name'];}_0x494ed8[_0x0f12('0x2a')](_0x15a508)[_0x0f12('0x35')](_0x39161c);};}exports['index']=function(_0x213ffa,_0x5c4f38){var _0x20c6b0={},_0x62f49={},_0x2ed69c={'count':0x0,'rows':[]};var _0x10a7bb=_[_0x0f12('0x36')](db[_0x0f12('0x37')][_0x0f12('0x38')],function(_0x1d48a7){return{'name':_0x1d48a7[_0x0f12('0x39')],'type':_0x1d48a7[_0x0f12('0x3a')]['key']};});_0x62f49[_0x0f12('0x3b')]=_[_0x0f12('0x36')](_0x10a7bb,_0x0f12('0x34'));_0x62f49['query']=_['keys'](_0x213ffa['query']);_0x62f49[_0x0f12('0x3c')]=_[_0x0f12('0x3d')](_0x62f49['model'],_0x62f49['query']);_0x20c6b0[_0x0f12('0x3e')]=_[_0x0f12('0x3d')](_0x62f49[_0x0f12('0x3b')],qs['fields'](_0x213ffa[_0x0f12('0x3f')][_0x0f12('0x40')]));_0x20c6b0['attributes']=_0x20c6b0[_0x0f12('0x3e')][_0x0f12('0x41')]?_0x20c6b0[_0x0f12('0x3e')]:_0x62f49[_0x0f12('0x3b')];if(!_0x213ffa[_0x0f12('0x3f')][_0x0f12('0x42')](_0x0f12('0x43'))){_0x20c6b0['limit']=qs[_0x0f12('0x44')](_0x213ffa['query'][_0x0f12('0x44')]);_0x20c6b0[_0x0f12('0x2c')]=qs['offset'](_0x213ffa[_0x0f12('0x3f')][_0x0f12('0x2c')]);}_0x20c6b0[_0x0f12('0x45')]=qs['sort'](_0x213ffa['query'][_0x0f12('0x46')]);_0x20c6b0[_0x0f12('0x47')]=qs[_0x0f12('0x3c')](_[_0x0f12('0x48')](_0x213ffa['query'],_0x62f49[_0x0f12('0x3c')]),_0x10a7bb);if(_0x213ffa[_0x0f12('0x3f')][_0x0f12('0x49')]){_0x20c6b0[_0x0f12('0x47')]=_['merge'](_0x20c6b0[_0x0f12('0x47')],{'$or':_[_0x0f12('0x36')](_0x10a7bb,function(_0x54ec90){if(_0x54ec90['type']!==_0x0f12('0x4a')){var _0x27f988={};_0x27f988[_0x54ec90[_0x0f12('0x34')]]={'$like':'%'+_0x213ffa['query']['filter']+'%'};return _0x27f988;}})});}_0x20c6b0=_[_0x0f12('0x4b')]({},_0x20c6b0,_0x213ffa[_0x0f12('0x4c')]);var _0x569c2f={'where':_0x20c6b0[_0x0f12('0x47')]};return db['DeskConfiguration'][_0x0f12('0x4d')](_0x569c2f)[_0x0f12('0x1f')](function(_0x5058e7){_0x2ed69c['count']=_0x5058e7;if(_0x213ffa[_0x0f12('0x3f')][_0x0f12('0x4e')]){_0x20c6b0[_0x0f12('0x4f')]=[{'all':!![]}];}return db[_0x0f12('0x37')][_0x0f12('0x50')](_0x20c6b0);})[_0x0f12('0x1f')](function(_0x294314){_0x2ed69c[_0x0f12('0x51')]=_0x294314;return _0x2ed69c;})['then'](respondWithFilteredResult(_0x5c4f38,_0x20c6b0))[_0x0f12('0x27')](handleError(_0x5c4f38,null));};exports['show']=function(_0x9cb463,_0x52f1c2){var _0x4add76={'raw':![],'where':{'id':_0x9cb463['params']['id']}},_0xbbacc1={};_0xbbacc1[_0x0f12('0x3b')]=_[_0x0f12('0x52')](db[_0x0f12('0x37')][_0x0f12('0x38')]);_0xbbacc1['query']=_[_0x0f12('0x52')](_0x9cb463[_0x0f12('0x3f')]);_0xbbacc1[_0x0f12('0x3c')]=_[_0x0f12('0x3d')](_0xbbacc1['model'],_0xbbacc1['query']);_0x4add76[_0x0f12('0x3e')]=_[_0x0f12('0x3d')](_0xbbacc1[_0x0f12('0x3b')],qs[_0x0f12('0x40')](_0x9cb463[_0x0f12('0x3f')]['fields']));_0x4add76['attributes']=_0x4add76['attributes'][_0x0f12('0x41')]?_0x4add76[_0x0f12('0x3e')]:_0xbbacc1[_0x0f12('0x3b')];if(_0x9cb463[_0x0f12('0x3f')][_0x0f12('0x4e')]){_0x4add76[_0x0f12('0x4f')]=[{'all':!![]}];}_0x4add76=_[_0x0f12('0x4b')]({},_0x4add76,_0x9cb463[_0x0f12('0x4c')]);return db[_0x0f12('0x37')][_0x0f12('0x53')](_0x4add76)[_0x0f12('0x1f')](handleEntityNotFound(_0x52f1c2,null))['then'](respondWithResult(_0x52f1c2,null))[_0x0f12('0x27')](handleError(_0x52f1c2,null));};exports[_0x0f12('0x54')]=function(_0x3fe597,_0x3cc93a){return db['DeskConfiguration']['create'](_0x3fe597[_0x0f12('0x55')],{})[_0x0f12('0x1f')](respondWithResult(_0x3cc93a,0xc9))[_0x0f12('0x27')](handleError(_0x3cc93a,null));};exports[_0x0f12('0x32')]=function(_0xff5bdf,_0x15d96e){if(_0xff5bdf[_0x0f12('0x55')]['id']){delete _0xff5bdf[_0x0f12('0x55')]['id'];}return db['DeskConfiguration'][_0x0f12('0x53')]({'where':{'id':_0xff5bdf[_0x0f12('0x56')]['id']}})['then'](handleEntityNotFound(_0x15d96e,null))[_0x0f12('0x1f')](saveUpdates(_0xff5bdf[_0x0f12('0x55')],null))[_0x0f12('0x1f')](respondWithResult(_0x15d96e,null))['catch'](handleError(_0x15d96e,null));};exports[_0x0f12('0x57')]=function(_0x14b337,_0x3b5bf3){return db[_0x0f12('0x37')][_0x0f12('0x53')]({'where':{'id':_0x14b337['params']['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0x3b5bf3,null))['then'](removeEntity(_0x3b5bf3,null))[_0x0f12('0x27')](handleError(_0x3b5bf3,null));};exports['getFields']=function(_0x1c886e,_0x3e64a2,_0x53bc13){var _0x3d9828={};var _0x185e36={};var _0x537fb0;var _0x47474a;return db['DeskConfiguration'][_0x0f12('0x58')]({'where':{'id':_0x1c886e['params']['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0x3e64a2,null))[_0x0f12('0x1f')](function(_0x37ac11){if(_0x37ac11){_0x537fb0=_0x37ac11;_0x185e36['model']=_[_0x0f12('0x52')](db[_0x0f12('0x59')][_0x0f12('0x38')]);_0x185e36['query']=_[_0x0f12('0x52')](_0x1c886e[_0x0f12('0x3f')]);_0x185e36['filters']=_[_0x0f12('0x3d')](_0x185e36[_0x0f12('0x3b')],_0x185e36['query']);_0x3d9828[_0x0f12('0x3e')]=_[_0x0f12('0x3d')](_0x185e36[_0x0f12('0x3b')],qs[_0x0f12('0x40')](_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x40')]));_0x3d9828[_0x0f12('0x3e')]=_0x3d9828[_0x0f12('0x3e')][_0x0f12('0x41')]?_0x3d9828[_0x0f12('0x3e')]:_0x185e36[_0x0f12('0x3b')];_0x3d9828[_0x0f12('0x45')]=qs['sort'](_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x46')]);_0x3d9828[_0x0f12('0x47')]=qs[_0x0f12('0x3c')](_[_0x0f12('0x48')](_0x1c886e['query'],_0x185e36[_0x0f12('0x3c')]));if(_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x49')]){_0x3d9828['where']=_[_0x0f12('0x4b')](_0x3d9828['where'],{'$or':_[_0x0f12('0x36')](_0x3d9828[_0x0f12('0x3e')],function(_0x2d50ae){var _0x517cd5={};_0x517cd5[_0x2d50ae]={'$like':'%'+_0x1c886e['query'][_0x0f12('0x49')]+'%'};return _0x517cd5;})});}_0x3d9828=_['merge']({},_0x3d9828,_0x1c886e[_0x0f12('0x4c')]);return _0x537fb0[_0x0f12('0x5a')](_0x3d9828);}})['then'](function(_0xe3b035){if(_0xe3b035){_0x47474a=_0xe3b035[_0x0f12('0x41')];if(!_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x42')](_0x0f12('0x43'))){_0x3d9828[_0x0f12('0x44')]=qs['limit'](_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x44')]);_0x3d9828[_0x0f12('0x2c')]=qs[_0x0f12('0x2c')](_0x1c886e[_0x0f12('0x3f')][_0x0f12('0x2c')]);}return _0x537fb0[_0x0f12('0x5a')](_0x3d9828);}})[_0x0f12('0x1f')](function(_0x3fb5b0){if(_0x3fb5b0){return _0x3fb5b0?{'count':_0x47474a,'rows':_0x3fb5b0}:null;}})[_0x0f12('0x1f')](respondWithResult(_0x3e64a2,null))[_0x0f12('0x27')](handleError(_0x3e64a2,null));};exports['getSubjects']=function(_0x123983,_0x542643,_0x203b23){var _0x7e9d05={};var _0x3a3553={};var _0x5cce6d;var _0x228abf;return db[_0x0f12('0x37')][_0x0f12('0x58')]({'where':{'id':_0x123983[_0x0f12('0x56')]['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0x542643,null))[_0x0f12('0x1f')](function(_0x3ccf3d){if(_0x3ccf3d){_0x5cce6d=_0x3ccf3d;_0x3a3553[_0x0f12('0x3b')]=_['keys'](db[_0x0f12('0x59')][_0x0f12('0x38')]);_0x3a3553[_0x0f12('0x3f')]=_[_0x0f12('0x52')](_0x123983[_0x0f12('0x3f')]);_0x3a3553[_0x0f12('0x3c')]=_[_0x0f12('0x3d')](_0x3a3553[_0x0f12('0x3b')],_0x3a3553[_0x0f12('0x3f')]);_0x7e9d05['attributes']=_['intersection'](_0x3a3553[_0x0f12('0x3b')],qs[_0x0f12('0x40')](_0x123983[_0x0f12('0x3f')][_0x0f12('0x40')]));_0x7e9d05['attributes']=_0x7e9d05[_0x0f12('0x3e')][_0x0f12('0x41')]?_0x7e9d05[_0x0f12('0x3e')]:_0x3a3553['model'];_0x7e9d05[_0x0f12('0x45')]=qs[_0x0f12('0x46')](_0x123983[_0x0f12('0x3f')][_0x0f12('0x46')]);_0x7e9d05[_0x0f12('0x47')]=qs[_0x0f12('0x3c')](_['pick'](_0x123983[_0x0f12('0x3f')],_0x3a3553[_0x0f12('0x3c')]));if(_0x123983[_0x0f12('0x3f')]['filter']){_0x7e9d05[_0x0f12('0x47')]=_[_0x0f12('0x4b')](_0x7e9d05[_0x0f12('0x47')],{'$or':_[_0x0f12('0x36')](_0x7e9d05[_0x0f12('0x3e')],function(_0x36213a){var _0x5d44db={};_0x5d44db[_0x36213a]={'$like':'%'+_0x123983[_0x0f12('0x3f')][_0x0f12('0x49')]+'%'};return _0x5d44db;})});}_0x7e9d05=_['merge']({},_0x7e9d05,_0x123983[_0x0f12('0x4c')]);return _0x5cce6d[_0x0f12('0x5b')](_0x7e9d05);}})[_0x0f12('0x1f')](function(_0x361df9){if(_0x361df9){_0x228abf=_0x361df9[_0x0f12('0x41')];if(!_0x123983[_0x0f12('0x3f')][_0x0f12('0x42')](_0x0f12('0x43'))){_0x7e9d05['limit']=qs['limit'](_0x123983[_0x0f12('0x3f')][_0x0f12('0x44')]);_0x7e9d05[_0x0f12('0x2c')]=qs[_0x0f12('0x2c')](_0x123983['query']['offset']);}return _0x5cce6d[_0x0f12('0x5b')](_0x7e9d05);}})[_0x0f12('0x1f')](function(_0x597a9b){if(_0x597a9b){return _0x597a9b?{'count':_0x228abf,'rows':_0x597a9b}:null;}})[_0x0f12('0x1f')](respondWithResult(_0x542643,null))['catch'](handleError(_0x542643,null));};exports[_0x0f12('0x5c')]=function(_0x34cbf8,_0xf5b752,_0x4ec86a){var _0x1bc665={};var _0x5a3363={};var _0x5b9505;var _0x36ed6f;return db[_0x0f12('0x37')]['findOne']({'where':{'id':_0x34cbf8[_0x0f12('0x56')]['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0xf5b752,null))[_0x0f12('0x1f')](function(_0x4d8825){if(_0x4d8825){_0x5b9505=_0x4d8825;_0x5a3363['model']=_[_0x0f12('0x52')](db[_0x0f12('0x59')][_0x0f12('0x38')]);_0x5a3363[_0x0f12('0x3f')]=_[_0x0f12('0x52')](_0x34cbf8[_0x0f12('0x3f')]);_0x5a3363['filters']=_[_0x0f12('0x3d')](_0x5a3363[_0x0f12('0x3b')],_0x5a3363[_0x0f12('0x3f')]);_0x1bc665['attributes']=_['intersection'](_0x5a3363[_0x0f12('0x3b')],qs[_0x0f12('0x40')](_0x34cbf8[_0x0f12('0x3f')][_0x0f12('0x40')]));_0x1bc665[_0x0f12('0x3e')]=_0x1bc665[_0x0f12('0x3e')][_0x0f12('0x41')]?_0x1bc665[_0x0f12('0x3e')]:_0x5a3363[_0x0f12('0x3b')];_0x1bc665[_0x0f12('0x45')]=qs['sort'](_0x34cbf8[_0x0f12('0x3f')][_0x0f12('0x46')]);_0x1bc665[_0x0f12('0x47')]=qs[_0x0f12('0x3c')](_[_0x0f12('0x48')](_0x34cbf8[_0x0f12('0x3f')],_0x5a3363[_0x0f12('0x3c')]));if(_0x34cbf8[_0x0f12('0x3f')][_0x0f12('0x49')]){_0x1bc665['where']=_['merge'](_0x1bc665[_0x0f12('0x47')],{'$or':_[_0x0f12('0x36')](_0x1bc665[_0x0f12('0x3e')],function(_0x45f94f){var _0x5c3bbc={};_0x5c3bbc[_0x45f94f]={'$like':'%'+_0x34cbf8['query'][_0x0f12('0x49')]+'%'};return _0x5c3bbc;})});}_0x1bc665=_[_0x0f12('0x4b')]({},_0x1bc665,_0x34cbf8['options']);return _0x5b9505[_0x0f12('0x5c')](_0x1bc665);}})[_0x0f12('0x1f')](function(_0x362830){if(_0x362830){_0x36ed6f=_0x362830[_0x0f12('0x41')];if(!_0x34cbf8[_0x0f12('0x3f')][_0x0f12('0x42')](_0x0f12('0x43'))){_0x1bc665['limit']=qs[_0x0f12('0x44')](_0x34cbf8['query']['limit']);_0x1bc665[_0x0f12('0x2c')]=qs[_0x0f12('0x2c')](_0x34cbf8[_0x0f12('0x3f')][_0x0f12('0x2c')]);}return _0x5b9505[_0x0f12('0x5c')](_0x1bc665);}})['then'](function(_0x683992){if(_0x683992){return _0x683992?{'count':_0x36ed6f,'rows':_0x683992}:null;}})[_0x0f12('0x1f')](respondWithResult(_0xf5b752,null))['catch'](handleError(_0xf5b752,null));};exports[_0x0f12('0x5d')]=function(_0x54f427,_0x51bf0e,_0x459b93){var _0x1a3b5b={};var _0x1e127d={};var _0x198bc;var _0x98fda5;return db['DeskConfiguration'][_0x0f12('0x58')]({'where':{'id':_0x54f427[_0x0f12('0x56')]['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0x51bf0e,null))[_0x0f12('0x1f')](function(_0x5ac359){if(_0x5ac359){_0x198bc=_0x5ac359;_0x1e127d['model']=_[_0x0f12('0x52')](db['Tag'][_0x0f12('0x38')]);_0x1e127d[_0x0f12('0x3f')]=_['keys'](_0x54f427[_0x0f12('0x3f')]);_0x1e127d[_0x0f12('0x3c')]=_[_0x0f12('0x3d')](_0x1e127d['model'],_0x1e127d[_0x0f12('0x3f')]);_0x1a3b5b[_0x0f12('0x3e')]=_[_0x0f12('0x3d')](_0x1e127d[_0x0f12('0x3b')],qs['fields'](_0x54f427[_0x0f12('0x3f')][_0x0f12('0x40')]));_0x1a3b5b[_0x0f12('0x3e')]=_0x1a3b5b[_0x0f12('0x3e')][_0x0f12('0x41')]?_0x1a3b5b[_0x0f12('0x3e')]:_0x1e127d[_0x0f12('0x3b')];_0x1a3b5b[_0x0f12('0x45')]=qs[_0x0f12('0x46')](_0x54f427[_0x0f12('0x3f')][_0x0f12('0x46')]);_0x1a3b5b[_0x0f12('0x47')]=qs['filters'](_[_0x0f12('0x48')](_0x54f427[_0x0f12('0x3f')],_0x1e127d[_0x0f12('0x3c')]));if(_0x54f427[_0x0f12('0x3f')][_0x0f12('0x49')]){_0x1a3b5b[_0x0f12('0x47')]=_['merge'](_0x1a3b5b[_0x0f12('0x47')],{'$or':_['map'](_0x1a3b5b[_0x0f12('0x3e')],function(_0x1786c9){var _0x5a3043={};_0x5a3043[_0x1786c9]={'$like':'%'+_0x54f427[_0x0f12('0x3f')][_0x0f12('0x49')]+'%'};return _0x5a3043;})});}_0x1a3b5b=_[_0x0f12('0x4b')]({},_0x1a3b5b,_0x54f427['options']);return _0x198bc[_0x0f12('0x5d')](_0x1a3b5b);}})[_0x0f12('0x1f')](function(_0xa9d5b6){if(_0xa9d5b6){_0x98fda5=_0xa9d5b6[_0x0f12('0x41')];if(!_0x54f427[_0x0f12('0x3f')][_0x0f12('0x42')](_0x0f12('0x43'))){_0x1a3b5b[_0x0f12('0x44')]=qs[_0x0f12('0x44')](_0x54f427[_0x0f12('0x3f')][_0x0f12('0x44')]);_0x1a3b5b[_0x0f12('0x2c')]=qs[_0x0f12('0x2c')](_0x54f427[_0x0f12('0x3f')][_0x0f12('0x2c')]);}return _0x198bc[_0x0f12('0x5d')](_0x1a3b5b);}})['then'](function(_0x56c268){if(_0x56c268){return _0x56c268?{'count':_0x98fda5,'rows':_0x56c268}:null;}})[_0x0f12('0x1f')](respondWithResult(_0x51bf0e,null))[_0x0f12('0x27')](handleError(_0x51bf0e,null));};exports[_0x0f12('0x5e')]=function(_0x59608c,_0x1734c8,_0x31c6f8){if(_0x59608c[_0x0f12('0x55')]['id']){delete _0x59608c['body']['id'];}return db[_0x0f12('0x37')][_0x0f12('0x58')]({'where':{'id':_0x59608c['params']['id']}})[_0x0f12('0x1f')](handleEntityNotFound(_0x1734c8,null))[_0x0f12('0x1f')](function(_0x57a0c9){if(_0x57a0c9){return _0x57a0c9['setTags'](_0x59608c[_0x0f12('0x55')][_0x0f12('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x1734c8,null))[_0x0f12('0x27')](handleError(_0x1734c8,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f4c4eb7..eef7d82 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 _0x92b0=['bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment'];(function(_0x9ae292,_0x130cef){var _0xadefdd=function(_0x4506a0){while(--_0x4506a0){_0x9ae292['push'](_0x9ae292['shift']());}};_0xadefdd(++_0x130cef);}(_0x92b0,0x128));var _0x092b=function(_0x2d1ce5,_0x231ca1){_0x2d1ce5=_0x2d1ce5-0x0;var _0x4d3365=_0x92b0[_0x2d1ce5];return _0x4d3365;};'use strict';var _=require(_0x092b('0x0'));var util=require(_0x092b('0x1'));var logger=require(_0x092b('0x2'))('api');var moment=require(_0x092b('0x3'));var BPromise=require(_0x092b('0x4'));var rp=require(_0x092b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x092b('0x6'));var config=require('../../config/environment');var attributes=require(_0x092b('0x7'));module[_0x092b('0x8')]=function(_0x4f7cf6,_0x8be119){return _0x4f7cf6[_0x092b('0x9')](_0x092b('0xa'),attributes,{'tableName':_0x092b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1221=['./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','api','moment','bluebird','path','rimraf'];(function(_0x3e3012,_0x46fe06){var _0x5dfc61=function(_0x4737b8){while(--_0x4737b8){_0x3e3012['push'](_0x3e3012['shift']());}};_0x5dfc61(++_0x46fe06);}(_0x1221,0xf4));var _0x1122=function(_0x1e68c8,_0x263eae){_0x1e68c8=_0x1e68c8-0x0;var _0x54f36f=_0x1221[_0x1e68c8];return _0x54f36f;};'use strict';var _=require('lodash');var util=require(_0x1122('0x0'));var logger=require('../../config/logger')(_0x1122('0x1'));var moment=require(_0x1122('0x2'));var BPromise=require(_0x1122('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1122('0x4'));var rimraf=require(_0x1122('0x5'));var config=require('../../config/environment');var attributes=require(_0x1122('0x6'));module[_0x1122('0x7')]=function(_0x58e21c,_0x46fe2b){return _0x58e21c[_0x1122('0x8')]('DeskConfiguration',attributes,{'tableName':_0x1122('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2e6dd87..e7e906b 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 _0x342e=['result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x444a5d,_0x3b2af5){var _0x6827e4=function(_0x36c337){while(--_0x36c337){_0x444a5d['push'](_0x444a5d['shift']());}};_0x6827e4(++_0x3b2af5);}(_0x342e,0xde));var _0xe342=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x342e[_0x3f4dd9];return _0x31c54a;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var moment=require(_0xe342('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe342('0x3'));var db=require(_0xe342('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe342('0x5'));var config=require(_0xe342('0x6'));var jayson=require(_0xe342('0x7'));var client=jayson[_0xe342('0x8')][_0xe342('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e643a,_0x57895b,_0x3457ac){return new BPromise(function(_0x36bb18,_0x54868d){return client['request'](_0x5e643a,_0x3457ac)[_0xe342('0xa')](function(_0x2b2e82){logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));logger[_0xe342('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x57895b,_0xe342('0xd'),JSON[_0xe342('0xf')](_0x2b2e82));if(_0x2b2e82[_0xe342('0x10')]){if(_0x2b2e82[_0xe342('0x10')]['code']===0x1f4){logger[_0xe342('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x57895b,_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);return _0x54868d(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}logger['error'](_0xe342('0xc'),_0x57895b,_0x2b2e82[_0xe342('0x10')]['message']);return _0x36bb18(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}else{logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));_0x36bb18(_0x2b2e82[_0xe342('0x12')][_0xe342('0x11')]);}})[_0xe342('0x13')](function(_0x190a90){logger[_0xe342('0x10')](_0xe342('0xc'),_0x57895b,_0x190a90);_0x54868d(_0x190a90);});});} \ No newline at end of file +var _0x0328=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message'];(function(_0x5f37fe,_0x27c283){var _0x1c4ca7=function(_0x46f75b){while(--_0x46f75b){_0x5f37fe['push'](_0x5f37fe['shift']());}};_0x1c4ca7(++_0x27c283);}(_0x0328,0x172));var _0x8032=function(_0x489136,_0x4d1aaa){_0x489136=_0x489136-0x0;var _0x155a42=_0x0328[_0x489136];return _0x155a42;};'use strict';var _=require(_0x8032('0x0'));var util=require(_0x8032('0x1'));var moment=require(_0x8032('0x2'));var BPromise=require(_0x8032('0x3'));var rs=require(_0x8032('0x4'));var fs=require('fs');var Redis=require(_0x8032('0x5'));var db=require(_0x8032('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8032('0x7'))(_0x8032('0x8'));var config=require(_0x8032('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8032('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2641,_0x37c3b6,_0x1e7e46){return new BPromise(function(_0x5951b1,_0x389071){return client['request'](_0x4e2641,_0x1e7e46)[_0x8032('0xb')](function(_0x484b9e){logger[_0x8032('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x37c3b6,_0x8032('0xd'));logger[_0x8032('0xe')](_0x8032('0xf'),_0x37c3b6,'request\x20sent',JSON[_0x8032('0x10')](_0x484b9e));if(_0x484b9e['error']){if(_0x484b9e[_0x8032('0x11')][_0x8032('0x12')]===0x1f4){logger[_0x8032('0x11')](_0x8032('0x13'),_0x37c3b6,_0x484b9e[_0x8032('0x11')][_0x8032('0x14')]);return _0x389071(_0x484b9e[_0x8032('0x11')][_0x8032('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x37c3b6,_0x484b9e[_0x8032('0x11')][_0x8032('0x14')]);return _0x5951b1(_0x484b9e[_0x8032('0x11')]['message']);}else{logger[_0x8032('0xc')](_0x8032('0x13'),_0x37c3b6,_0x8032('0xd'));_0x5951b1(_0x484b9e[_0x8032('0x15')][_0x8032('0x14')]);}})[_0x8032('0x16')](function(_0x1aebc4){logger[_0x8032('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x37c3b6,_0x1aebc4);_0x389071(_0x1aebc4);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 92abc46..4c39730 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 _0x5cc0=['Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','index','get','isAuthenticated','show','put','/:id','update','delete','exports','util','path','express'];(function(_0x304cf1,_0x18c0ea){var _0x3a0075=function(_0x551db2){while(--_0x551db2){_0x304cf1['push'](_0x304cf1['shift']());}};_0x3a0075(++_0x18c0ea);}(_0x5cc0,0x17d));var _0x05cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5cc0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x05cc('0x0'));var path=require(_0x05cc('0x1'));var timeout=require('connect-timeout');var express=require(_0x05cc('0x2'));var router=express[_0x05cc('0x3')]();var auth=require(_0x05cc('0x4'));var interaction=require(_0x05cc('0x5'));var config=require('../../config/environment');var controller=require(_0x05cc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x05cc('0x7')]);router[_0x05cc('0x8')]('/:id',auth[_0x05cc('0x9')](),controller[_0x05cc('0xa')]);router['post']('/',auth[_0x05cc('0x9')](),controller['create']);router[_0x05cc('0xb')](_0x05cc('0xc'),auth[_0x05cc('0x9')](),controller[_0x05cc('0xd')]);router[_0x05cc('0xe')](_0x05cc('0xc'),auth[_0x05cc('0x9')](),controller['destroy']);module[_0x05cc('0xf')]=router; \ No newline at end of file +var _0xb325=['show','post','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x209521,_0x4837f9){var _0x40ba45=function(_0x555d85){while(--_0x555d85){_0x209521['push'](_0x209521['shift']());}};_0x40ba45(++_0x4837f9);}(_0xb325,0x123));var _0x5b32=function(_0x5500fe,_0x3141de){_0x5500fe=_0x5500fe-0x0;var _0x564dae=_0xb325[_0x5500fe];return _0x564dae;};'use strict';var multer=require('multer');var util=require(_0x5b32('0x0'));var path=require(_0x5b32('0x1'));var timeout=require(_0x5b32('0x2'));var express=require(_0x5b32('0x3'));var router=express[_0x5b32('0x4')]();var auth=require(_0x5b32('0x5'));var interaction=require(_0x5b32('0x6'));var config=require(_0x5b32('0x7'));var controller=require(_0x5b32('0x8'));router[_0x5b32('0x9')]('/',auth[_0x5b32('0xa')](),controller[_0x5b32('0xb')]);router['get'](_0x5b32('0xc'),auth[_0x5b32('0xa')](),controller[_0x5b32('0xd')]);router[_0x5b32('0xe')]('/',auth[_0x5b32('0xa')](),controller['create']);router[_0x5b32('0xf')](_0x5b32('0xc'),auth[_0x5b32('0xa')](),controller[_0x5b32('0x10')]);router[_0x5b32('0x11')](_0x5b32('0xc'),auth[_0x5b32('0xa')](),controller['destroy']);module[_0x5b32('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 25d5969..8bb840c 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 _0x3bc0=['sequelize','exports','string','variable','keyValue','STRING','ENUM','customVariable'];(function(_0x456660,_0x4e2958){var _0x3410d9=function(_0x2066b0){while(--_0x2066b0){_0x456660['push'](_0x456660['shift']());}};_0x3410d9(++_0x4e2958);}(_0x3bc0,0x1c0));var _0x03bc=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x3bc0[_0x4e7d25];return _0x526fe6;};'use strict';var Sequelize=require(_0x03bc('0x0'));module[_0x03bc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x03bc('0x2'),_0x03bc('0x3'),'customVariable',_0x03bc('0x4')),'defaultValue':_0x03bc('0x2')},'content':{'type':Sequelize[_0x03bc('0x5')]},'key':{'type':Sequelize[_0x03bc('0x5')]},'keyType':{'type':Sequelize[_0x03bc('0x6')](_0x03bc('0x2'),'variable',_0x03bc('0x7'))},'keyContent':{'type':Sequelize[_0x03bc('0x5')]},'idField':{'type':Sequelize[_0x03bc('0x5')]},'nameField':{'type':Sequelize[_0x03bc('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x03bc('0x5')]}}; \ No newline at end of file +var _0x387d=['string','variable','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x169d2f,_0x3d0697){var _0x1c7868=function(_0x1a9389){while(--_0x1a9389){_0x169d2f['push'](_0x169d2f['shift']());}};_0x1c7868(++_0x3d0697);}(_0x387d,0x100));var _0xd387=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x387d[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0xd387('0x0'));module['exports']={'type':{'type':Sequelize[_0xd387('0x1')](_0xd387('0x2'),_0xd387('0x3'),'customVariable','keyValue'),'defaultValue':_0xd387('0x2')},'content':{'type':Sequelize[_0xd387('0x4')]},'key':{'type':Sequelize[_0xd387('0x4')]},'keyType':{'type':Sequelize[_0xd387('0x1')]('string',_0xd387('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd387('0x4')]},'idField':{'type':Sequelize[_0xd387('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd387('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd387('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 87a15d4..c0af5a9 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 _0x3327=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','DeskField','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x3327,0x7a));var _0x7332=function(_0x77cf1f,_0x34e1e5){_0x77cf1f=_0x77cf1f-0x0;var _0x2ef0bf=_0x3327[_0x77cf1f];return _0x2ef0bf;};'use strict';var pdf=require(_0x7332('0x0'));var emlformat=require(_0x7332('0x1'));var rimraf=require(_0x7332('0x2'));var zipdir=require(_0x7332('0x3'));var jsonpatch=require(_0x7332('0x4'));var rp=require('request-promise');var moment=require(_0x7332('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7332('0x6'));var path=require(_0x7332('0x7'));var sox=require(_0x7332('0x8'));var csv=require('to-csv');var ejs=require(_0x7332('0x9'));var fs=require('fs');var _=require(_0x7332('0xa'));var squel=require(_0x7332('0xb'));var crypto=require(_0x7332('0xc'));var jsforce=require(_0x7332('0xd'));var deskjs=require(_0x7332('0xe'));var toCsv=require(_0x7332('0xf'));var querystring=require(_0x7332('0x10'));var Papa=require(_0x7332('0x11'));var Redis=require(_0x7332('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7332('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7332('0x14'));var logger=require(_0x7332('0x15'))(_0x7332('0x16'));var utils=require(_0x7332('0x17'));var config=require(_0x7332('0x18'));var db=require(_0x7332('0x19'))['db'];function respondWithStatusCode(_0x101f88,_0x3ad4ec){_0x3ad4ec=_0x3ad4ec||0xcc;return function(_0x5e87d1){if(_0x5e87d1){return _0x101f88[_0x7332('0x1a')](_0x3ad4ec);}return _0x101f88[_0x7332('0x1b')](_0x3ad4ec)['end']();};}function respondWithResult(_0xb51015,_0x241c71){_0x241c71=_0x241c71||0xc8;return function(_0x1d9af0){if(_0x1d9af0){return _0xb51015[_0x7332('0x1b')](_0x241c71)[_0x7332('0x1c')](_0x1d9af0);}};}function respondWithFilteredResult(_0x6133b3,_0x4491f6){return function(_0xe547df){if(_0xe547df){var _0x3887c5=_0xe547df[_0x7332('0x1d')],_0x295058=_0x4491f6[_0x7332('0x1e')],_0x5a3201=_0x4491f6['offset']+_0x4491f6[_0x7332('0x1f')],_0x112b41;if(_0x5a3201>=_0x3887c5){_0x5a3201=_0x3887c5;_0x112b41=0xc8;}else{_0x112b41=0xce;}_0x6133b3[_0x7332('0x1b')](_0x112b41);return _0x6133b3[_0x7332('0x20')](_0x7332('0x21'),_0x295058+'-'+_0x5a3201+'/'+_0x3887c5)['json'](_0xe547df);}return null;};}function patchUpdates(_0x23c71b){return function(_0x234f99){try{jsonpatch[_0x7332('0x22')](_0x234f99,_0x23c71b,!![]);}catch(_0x58ba3f){return BPromise[_0x7332('0x23')](_0x58ba3f);}return _0x234f99[_0x7332('0x24')]();};}function saveUpdates(_0xd74d75,_0x3512a2){return function(_0x5667ed){if(_0x5667ed){return _0x5667ed[_0x7332('0x25')](_0xd74d75)['then'](function(_0x1e8ad1){return _0x1e8ad1;});}return null;};}function removeEntity(_0x31aff5,_0x4a76b7){return function(_0xe3e3ea){if(_0xe3e3ea){return _0xe3e3ea[_0x7332('0x26')]()[_0x7332('0x27')](function(){_0x31aff5[_0x7332('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126461,_0x35d99e){return function(_0x4703cc){if(!_0x4703cc){_0x126461[_0x7332('0x1a')](0x194);}return _0x4703cc;};}function handleError(_0x31b90f,_0x4f7b76){_0x4f7b76=_0x4f7b76||0x1f4;return function(_0x5b66c1){logger[_0x7332('0x28')](_0x5b66c1['stack']);if(_0x5b66c1['name']){delete _0x5b66c1[_0x7332('0x29')];}_0x31b90f[_0x7332('0x1b')](_0x4f7b76)[_0x7332('0x2a')](_0x5b66c1);};}exports[_0x7332('0x2b')]=function(_0x39460c,_0x3a797f){var _0x2ef4d7={},_0x51dafe={},_0x470bb0={'count':0x0,'rows':[]};var _0xd2a5bb=_[_0x7332('0x2c')](db[_0x7332('0x2d')][_0x7332('0x2e')],function(_0x22b973){return{'name':_0x22b973['fieldName'],'type':_0x22b973[_0x7332('0x2f')][_0x7332('0x30')]};});_0x51dafe[_0x7332('0x31')]=_[_0x7332('0x2c')](_0xd2a5bb,_0x7332('0x29'));_0x51dafe['query']=_[_0x7332('0x32')](_0x39460c[_0x7332('0x33')]);_0x51dafe['filters']=_[_0x7332('0x34')](_0x51dafe['model'],_0x51dafe[_0x7332('0x33')]);_0x2ef4d7[_0x7332('0x35')]=_[_0x7332('0x34')](_0x51dafe[_0x7332('0x31')],qs[_0x7332('0x36')](_0x39460c[_0x7332('0x33')]['fields']));_0x2ef4d7[_0x7332('0x35')]=_0x2ef4d7[_0x7332('0x35')][_0x7332('0x37')]?_0x2ef4d7[_0x7332('0x35')]:_0x51dafe['model'];if(!_0x39460c[_0x7332('0x33')][_0x7332('0x38')]('nolimit')){_0x2ef4d7[_0x7332('0x1f')]=qs['limit'](_0x39460c['query'][_0x7332('0x1f')]);_0x2ef4d7[_0x7332('0x1e')]=qs[_0x7332('0x1e')](_0x39460c[_0x7332('0x33')][_0x7332('0x1e')]);}_0x2ef4d7[_0x7332('0x39')]=qs[_0x7332('0x3a')](_0x39460c[_0x7332('0x33')][_0x7332('0x3a')]);_0x2ef4d7[_0x7332('0x3b')]=qs[_0x7332('0x3c')](_[_0x7332('0x3d')](_0x39460c[_0x7332('0x33')],_0x51dafe[_0x7332('0x3c')]),_0xd2a5bb);if(_0x39460c[_0x7332('0x33')][_0x7332('0x3e')]){_0x2ef4d7['where']=_['merge'](_0x2ef4d7[_0x7332('0x3b')],{'$or':_[_0x7332('0x2c')](_0xd2a5bb,function(_0x3e32f2){if(_0x3e32f2['type']!=='VIRTUAL'){var _0x514ca1={};_0x514ca1[_0x3e32f2[_0x7332('0x29')]]={'$like':'%'+_0x39460c[_0x7332('0x33')][_0x7332('0x3e')]+'%'};return _0x514ca1;}})});}_0x2ef4d7=_['merge']({},_0x2ef4d7,_0x39460c[_0x7332('0x3f')]);var _0x100808={'where':_0x2ef4d7[_0x7332('0x3b')]};return db[_0x7332('0x2d')][_0x7332('0x1d')](_0x100808)['then'](function(_0x3d1446){_0x470bb0[_0x7332('0x1d')]=_0x3d1446;if(_0x39460c[_0x7332('0x33')][_0x7332('0x40')]){_0x2ef4d7[_0x7332('0x41')]=[{'all':!![]}];}return db[_0x7332('0x2d')][_0x7332('0x42')](_0x2ef4d7);})[_0x7332('0x27')](function(_0x3c722f){_0x470bb0[_0x7332('0x43')]=_0x3c722f;return _0x470bb0;})['then'](respondWithFilteredResult(_0x3a797f,_0x2ef4d7))[_0x7332('0x44')](handleError(_0x3a797f,null));};exports[_0x7332('0x45')]=function(_0x1544de,_0x580b1c){var _0xea395b={'raw':!![],'where':{'id':_0x1544de[_0x7332('0x46')]['id']}},_0xd6c12b={};_0xd6c12b[_0x7332('0x31')]=_['keys'](db[_0x7332('0x2d')]['rawAttributes']);_0xd6c12b['query']=_[_0x7332('0x32')](_0x1544de['query']);_0xd6c12b[_0x7332('0x3c')]=_[_0x7332('0x34')](_0xd6c12b['model'],_0xd6c12b[_0x7332('0x33')]);_0xea395b[_0x7332('0x35')]=_[_0x7332('0x34')](_0xd6c12b['model'],qs['fields'](_0x1544de['query'][_0x7332('0x36')]));_0xea395b[_0x7332('0x35')]=_0xea395b[_0x7332('0x35')][_0x7332('0x37')]?_0xea395b[_0x7332('0x35')]:_0xd6c12b[_0x7332('0x31')];if(_0x1544de[_0x7332('0x33')]['includeAll']){_0xea395b[_0x7332('0x41')]=[{'all':!![]}];}_0xea395b=_['merge']({},_0xea395b,_0x1544de[_0x7332('0x3f')]);return db[_0x7332('0x2d')][_0x7332('0x47')](_0xea395b)[_0x7332('0x27')](handleEntityNotFound(_0x580b1c,null))['then'](respondWithResult(_0x580b1c,null))[_0x7332('0x44')](handleError(_0x580b1c,null));};exports['create']=function(_0x440536,_0x476a84){return db[_0x7332('0x2d')][_0x7332('0x48')](_0x440536['body'],{})[_0x7332('0x27')](respondWithResult(_0x476a84,0xc9))[_0x7332('0x44')](handleError(_0x476a84,null));};exports[_0x7332('0x25')]=function(_0x388ac2,_0x439d2d){if(_0x388ac2[_0x7332('0x49')]['id']){delete _0x388ac2['body']['id'];}return db[_0x7332('0x2d')]['find']({'where':{'id':_0x388ac2[_0x7332('0x46')]['id']}})['then'](handleEntityNotFound(_0x439d2d,null))[_0x7332('0x27')](saveUpdates(_0x388ac2[_0x7332('0x49')],null))[_0x7332('0x27')](respondWithResult(_0x439d2d,null))[_0x7332('0x44')](handleError(_0x439d2d,null));};exports[_0x7332('0x26')]=function(_0xccd078,_0x21c45d){return db[_0x7332('0x2d')][_0x7332('0x47')]({'where':{'id':_0xccd078['params']['id']}})[_0x7332('0x27')](handleEntityNotFound(_0x21c45d,null))[_0x7332('0x27')](removeEntity(_0x21c45d,null))[_0x7332('0x44')](handleError(_0x21c45d,null));}; \ No newline at end of file +var _0x195b=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','save','then','destroy','error','stack','name','send','map','DeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','catch','show','params','length','includeAll','include','options','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x37bfec,_0x28e8c8){var _0x214043=function(_0x3bca65){while(--_0x3bca65){_0x37bfec['push'](_0x37bfec['shift']());}};_0x214043(++_0x28e8c8);}(_0x195b,0xbf));var _0xb195=function(_0x5d431e,_0x1f8730){_0x5d431e=_0x5d431e-0x0;var _0x18fa88=_0x195b[_0x5d431e];return _0x18fa88;};'use strict';var pdf=require(_0xb195('0x0'));var emlformat=require(_0xb195('0x1'));var rimraf=require(_0xb195('0x2'));var zipdir=require(_0xb195('0x3'));var jsonpatch=require(_0xb195('0x4'));var rp=require(_0xb195('0x5'));var moment=require(_0xb195('0x6'));var BPromise=require(_0xb195('0x7'));var Mustache=require(_0xb195('0x8'));var util=require('util');var path=require('path');var sox=require(_0xb195('0x9'));var csv=require(_0xb195('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb195('0xb'));var crypto=require(_0xb195('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb195('0xd'));var toCsv=require(_0xb195('0xa'));var querystring=require(_0xb195('0xe'));var Papa=require('papaparse');var Redis=require(_0xb195('0xf'));var authService=require(_0xb195('0x10'));var qs=require(_0xb195('0x11'));var as=require(_0xb195('0x12'));var hardwareService=require(_0xb195('0x13'));var logger=require('../../config/logger')(_0xb195('0x14'));var utils=require(_0xb195('0x15'));var config=require(_0xb195('0x16'));var db=require(_0xb195('0x17'))['db'];function respondWithStatusCode(_0x179805,_0x2f856c){_0x2f856c=_0x2f856c||0xcc;return function(_0x2235a5){if(_0x2235a5){return _0x179805[_0xb195('0x18')](_0x2f856c);}return _0x179805['status'](_0x2f856c)[_0xb195('0x19')]();};}function respondWithResult(_0x39b438,_0x28eccd){_0x28eccd=_0x28eccd||0xc8;return function(_0x2e16c2){if(_0x2e16c2){return _0x39b438[_0xb195('0x1a')](_0x28eccd)[_0xb195('0x1b')](_0x2e16c2);}};}function respondWithFilteredResult(_0x14f62e,_0x11db72){return function(_0x290a14){if(_0x290a14){var _0x54a412=_0x290a14[_0xb195('0x1c')],_0x55a3a2=_0x11db72['offset'],_0x47d4b2=_0x11db72[_0xb195('0x1d')]+_0x11db72[_0xb195('0x1e')],_0x2bdf2f;if(_0x47d4b2>=_0x54a412){_0x47d4b2=_0x54a412;_0x2bdf2f=0xc8;}else{_0x2bdf2f=0xce;}_0x14f62e[_0xb195('0x1a')](_0x2bdf2f);return _0x14f62e['set']('Content-Range',_0x55a3a2+'-'+_0x47d4b2+'/'+_0x54a412)[_0xb195('0x1b')](_0x290a14);}return null;};}function patchUpdates(_0x42ad4a){return function(_0x3f0fe7){try{jsonpatch[_0xb195('0x1f')](_0x3f0fe7,_0x42ad4a,!![]);}catch(_0x542cea){return BPromise[_0xb195('0x20')](_0x542cea);}return _0x3f0fe7[_0xb195('0x21')]();};}function saveUpdates(_0x5803bd,_0x1838ba){return function(_0x2dca44){if(_0x2dca44){return _0x2dca44['update'](_0x5803bd)[_0xb195('0x22')](function(_0x3af12d){return _0x3af12d;});}return null;};}function removeEntity(_0x36900b,_0x5e6bea){return function(_0x1e0718){if(_0x1e0718){return _0x1e0718[_0xb195('0x23')]()[_0xb195('0x22')](function(){_0x36900b[_0xb195('0x1a')](0xcc)[_0xb195('0x19')]();});}};}function handleEntityNotFound(_0xae73d5,_0x218fb2){return function(_0xf400d2){if(!_0xf400d2){_0xae73d5[_0xb195('0x18')](0x194);}return _0xf400d2;};}function handleError(_0x4bf9bb,_0x4d5e19){_0x4d5e19=_0x4d5e19||0x1f4;return function(_0x46dfc9){logger[_0xb195('0x24')](_0x46dfc9[_0xb195('0x25')]);if(_0x46dfc9[_0xb195('0x26')]){delete _0x46dfc9[_0xb195('0x26')];}_0x4bf9bb['status'](_0x4d5e19)[_0xb195('0x27')](_0x46dfc9);};}exports['index']=function(_0x3f5aed,_0x142753){var _0x297207={},_0x264a9a={},_0x37a80a={'count':0x0,'rows':[]};var _0x52bf69=_[_0xb195('0x28')](db[_0xb195('0x29')][_0xb195('0x2a')],function(_0x1151e1){return{'name':_0x1151e1['fieldName'],'type':_0x1151e1[_0xb195('0x2b')][_0xb195('0x2c')]};});_0x264a9a[_0xb195('0x2d')]=_[_0xb195('0x28')](_0x52bf69,'name');_0x264a9a['query']=_[_0xb195('0x2e')](_0x3f5aed[_0xb195('0x2f')]);_0x264a9a[_0xb195('0x30')]=_[_0xb195('0x31')](_0x264a9a['model'],_0x264a9a[_0xb195('0x2f')]);_0x297207[_0xb195('0x32')]=_['intersection'](_0x264a9a[_0xb195('0x2d')],qs[_0xb195('0x33')](_0x3f5aed[_0xb195('0x2f')][_0xb195('0x33')]));_0x297207[_0xb195('0x32')]=_0x297207[_0xb195('0x32')]['length']?_0x297207[_0xb195('0x32')]:_0x264a9a[_0xb195('0x2d')];if(!_0x3f5aed[_0xb195('0x2f')]['hasOwnProperty'](_0xb195('0x34'))){_0x297207['limit']=qs[_0xb195('0x1e')](_0x3f5aed[_0xb195('0x2f')]['limit']);_0x297207['offset']=qs[_0xb195('0x1d')](_0x3f5aed[_0xb195('0x2f')][_0xb195('0x1d')]);}_0x297207[_0xb195('0x35')]=qs[_0xb195('0x36')](_0x3f5aed['query'][_0xb195('0x36')]);_0x297207[_0xb195('0x37')]=qs['filters'](_['pick'](_0x3f5aed[_0xb195('0x2f')],_0x264a9a[_0xb195('0x30')]),_0x52bf69);if(_0x3f5aed[_0xb195('0x2f')][_0xb195('0x38')]){_0x297207[_0xb195('0x37')]=_[_0xb195('0x39')](_0x297207['where'],{'$or':_[_0xb195('0x28')](_0x52bf69,function(_0x4705c1){if(_0x4705c1[_0xb195('0x2b')]!==_0xb195('0x3a')){var _0x48f5f0={};_0x48f5f0[_0x4705c1[_0xb195('0x26')]]={'$like':'%'+_0x3f5aed[_0xb195('0x2f')]['filter']+'%'};return _0x48f5f0;}})});}_0x297207=_[_0xb195('0x39')]({},_0x297207,_0x3f5aed['options']);var _0x8c482e={'where':_0x297207[_0xb195('0x37')]};return db['DeskField'][_0xb195('0x1c')](_0x8c482e)[_0xb195('0x22')](function(_0x1beab6){_0x37a80a[_0xb195('0x1c')]=_0x1beab6;if(_0x3f5aed[_0xb195('0x2f')]['includeAll']){_0x297207['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x297207);})[_0xb195('0x22')](function(_0x390cb0){_0x37a80a['rows']=_0x390cb0;return _0x37a80a;})[_0xb195('0x22')](respondWithFilteredResult(_0x142753,_0x297207))[_0xb195('0x3b')](handleError(_0x142753,null));};exports[_0xb195('0x3c')]=function(_0x1a2ea1,_0x464c27){var _0x1a2888={'raw':!![],'where':{'id':_0x1a2ea1[_0xb195('0x3d')]['id']}},_0x2cfbfd={};_0x2cfbfd[_0xb195('0x2d')]=_['keys'](db[_0xb195('0x29')][_0xb195('0x2a')]);_0x2cfbfd['query']=_[_0xb195('0x2e')](_0x1a2ea1[_0xb195('0x2f')]);_0x2cfbfd['filters']=_[_0xb195('0x31')](_0x2cfbfd[_0xb195('0x2d')],_0x2cfbfd[_0xb195('0x2f')]);_0x1a2888['attributes']=_[_0xb195('0x31')](_0x2cfbfd['model'],qs['fields'](_0x1a2ea1[_0xb195('0x2f')][_0xb195('0x33')]));_0x1a2888['attributes']=_0x1a2888[_0xb195('0x32')][_0xb195('0x3e')]?_0x1a2888[_0xb195('0x32')]:_0x2cfbfd[_0xb195('0x2d')];if(_0x1a2ea1[_0xb195('0x2f')][_0xb195('0x3f')]){_0x1a2888[_0xb195('0x40')]=[{'all':!![]}];}_0x1a2888=_[_0xb195('0x39')]({},_0x1a2888,_0x1a2ea1[_0xb195('0x41')]);return db['DeskField'][_0xb195('0x42')](_0x1a2888)[_0xb195('0x22')](handleEntityNotFound(_0x464c27,null))[_0xb195('0x22')](respondWithResult(_0x464c27,null))[_0xb195('0x3b')](handleError(_0x464c27,null));};exports[_0xb195('0x43')]=function(_0x3a6b63,_0x9ed4d9){return db[_0xb195('0x29')][_0xb195('0x43')](_0x3a6b63['body'],{})['then'](respondWithResult(_0x9ed4d9,0xc9))[_0xb195('0x3b')](handleError(_0x9ed4d9,null));};exports[_0xb195('0x44')]=function(_0x53cc3e,_0x49327b){if(_0x53cc3e[_0xb195('0x45')]['id']){delete _0x53cc3e[_0xb195('0x45')]['id'];}return db[_0xb195('0x29')][_0xb195('0x42')]({'where':{'id':_0x53cc3e[_0xb195('0x3d')]['id']}})[_0xb195('0x22')](handleEntityNotFound(_0x49327b,null))[_0xb195('0x22')](saveUpdates(_0x53cc3e[_0xb195('0x45')],null))['then'](respondWithResult(_0x49327b,null))[_0xb195('0x3b')](handleError(_0x49327b,null));};exports[_0xb195('0x23')]=function(_0x31c36a,_0x170b92){return db[_0xb195('0x29')]['find']({'where':{'id':_0x31c36a[_0xb195('0x3d')]['id']}})['then'](handleEntityNotFound(_0x170b92,null))[_0xb195('0x22')](removeEntity(_0x170b92,null))['catch'](handleError(_0x170b92,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 36a8364..7fcf6f7 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 _0xc15f=['desk_unique_index','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','DeskField','int_desk_fields'];(function(_0x210d57,_0x280153){var _0x32a96a=function(_0xbc7a8a){while(--_0xbc7a8a){_0x210d57['push'](_0x210d57['shift']());}};_0x32a96a(++_0x280153);}(_0xc15f,0x113));var _0xfc15=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0xc15f[_0x121d9e];return _0x5df466;};'use strict';var _=require(_0xfc15('0x0'));var util=require(_0xfc15('0x1'));var logger=require('../../config/logger')(_0xfc15('0x2'));var moment=require('moment');var BPromise=require(_0xfc15('0x3'));var rp=require(_0xfc15('0x4'));var fs=require('fs');var path=require(_0xfc15('0x5'));var rimraf=require(_0xfc15('0x6'));var config=require(_0xfc15('0x7'));var attributes=require('./intDeskField.attributes');module[_0xfc15('0x8')]=function(_0x469df3,_0x338e23){return _0x469df3['define'](_0xfc15('0x9'),attributes,{'tableName':_0xfc15('0xa'),'paranoid':![],'indexes':[{'name':_0xfc15('0xb'),'fields':['idField',_0xfc15('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ecb=['lodash','util','moment','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x23416b,_0xd2dbf9){var _0x518984=function(_0x47457a){while(--_0x47457a){_0x23416b['push'](_0x23416b['shift']());}};_0x518984(++_0xd2dbf9);}(_0x9ecb,0x113));var _0xb9ec=function(_0x23e051,_0x2b404f){_0x23e051=_0x23e051-0x0;var _0x44bd79=_0x9ecb[_0x23e051];return _0x44bd79;};'use strict';var _=require(_0xb9ec('0x0'));var util=require(_0xb9ec('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb9ec('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9ec('0x3'));var config=require('../../config/environment');var attributes=require(_0xb9ec('0x4'));module['exports']=function(_0x556602,_0x4031ac){return _0x556602[_0xb9ec('0x5')](_0xb9ec('0x6'),attributes,{'tableName':_0xb9ec('0x7'),'paranoid':![],'indexes':[{'name':_0xb9ec('0x8'),'fields':[_0xb9ec('0x9'),_0xb9ec('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 1a83002..016afb1 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 _0xe290=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f2b69,_0x32d77c){var _0x403a95=function(_0x1a2fe3){while(--_0x1a2fe3){_0x1f2b69['push'](_0x1f2b69['shift']());}};_0x403a95(++_0x32d77c);}(_0xe290,0x10a));var _0x0e29=function(_0x527dc5,_0x1de7e7){_0x527dc5=_0x527dc5-0x0;var _0x216de9=_0xe290[_0x527dc5];return _0x216de9;};'use strict';var _=require('lodash');var util=require(_0x0e29('0x0'));var moment=require(_0x0e29('0x1'));var BPromise=require(_0x0e29('0x2'));var rs=require(_0x0e29('0x3'));var fs=require('fs');var Redis=require(_0x0e29('0x4'));var db=require(_0x0e29('0x5'))['db'];var utils=require(_0x0e29('0x6'));var logger=require(_0x0e29('0x7'))(_0x0e29('0x8'));var config=require('../../config/environment');var jayson=require(_0x0e29('0x9'));var client=jayson[_0x0e29('0xa')][_0x0e29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c7d1,_0x62c112,_0x20c89b){return new BPromise(function(_0x49cb82,_0x191655){return client['request'](_0x18c7d1,_0x20c89b)['then'](function(_0x1d92dc){logger[_0x0e29('0xc')](_0x0e29('0xd'),_0x62c112,_0x0e29('0xe'));logger[_0x0e29('0xf')](_0x0e29('0x10'),_0x62c112,'request\x20sent',JSON[_0x0e29('0x11')](_0x1d92dc));if(_0x1d92dc['error']){if(_0x1d92dc[_0x0e29('0x12')][_0x0e29('0x13')]===0x1f4){logger[_0x0e29('0x12')](_0x0e29('0xd'),_0x62c112,_0x1d92dc[_0x0e29('0x12')]['message']);return _0x191655(_0x1d92dc[_0x0e29('0x12')][_0x0e29('0x14')]);}logger['error'](_0x0e29('0xd'),_0x62c112,_0x1d92dc['error'][_0x0e29('0x14')]);return _0x49cb82(_0x1d92dc['error'][_0x0e29('0x14')]);}else{logger[_0x0e29('0xc')](_0x0e29('0xd'),_0x62c112,_0x0e29('0xe'));_0x49cb82(_0x1d92dc[_0x0e29('0x15')][_0x0e29('0x14')]);}})['catch'](function(_0x44dc40){logger[_0x0e29('0x12')](_0x0e29('0xd'),_0x62c112,_0x44dc40);_0x191655(_0x44dc40);});});} \ No newline at end of file +var _0x6e42=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e42,0x187));var _0x26e4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e42[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x26e4('0x0'));var moment=require(_0x26e4('0x1'));var BPromise=require(_0x26e4('0x2'));var rs=require(_0x26e4('0x3'));var fs=require('fs');var Redis=require(_0x26e4('0x4'));var db=require(_0x26e4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26e4('0x6'));var config=require(_0x26e4('0x7'));var jayson=require(_0x26e4('0x8'));var client=jayson[_0x26e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c19c4,_0x5e7fb0,_0x189e2a){return new BPromise(function(_0x5f5da9,_0x4056c4){return client[_0x26e4('0xa')](_0x5c19c4,_0x189e2a)[_0x26e4('0xb')](function(_0x3fa2e5){logger['info'](_0x26e4('0xc'),_0x5e7fb0,_0x26e4('0xd'));logger[_0x26e4('0xe')](_0x26e4('0xf'),_0x5e7fb0,_0x26e4('0xd'),JSON[_0x26e4('0x10')](_0x3fa2e5));if(_0x3fa2e5[_0x26e4('0x11')]){if(_0x3fa2e5['error'][_0x26e4('0x12')]===0x1f4){logger[_0x26e4('0x11')](_0x26e4('0xc'),_0x5e7fb0,_0x3fa2e5[_0x26e4('0x11')][_0x26e4('0x13')]);return _0x4056c4(_0x3fa2e5[_0x26e4('0x11')][_0x26e4('0x13')]);}logger['error'](_0x26e4('0xc'),_0x5e7fb0,_0x3fa2e5[_0x26e4('0x11')][_0x26e4('0x13')]);return _0x5f5da9(_0x3fa2e5[_0x26e4('0x11')][_0x26e4('0x13')]);}else{logger[_0x26e4('0x14')](_0x26e4('0xc'),_0x5e7fb0,_0x26e4('0xd'));_0x5f5da9(_0x3fa2e5[_0x26e4('0x15')][_0x26e4('0x13')]);}})[_0x26e4('0x16')](function(_0x55896a){logger[_0x26e4('0x11')]('DeskField,\x20%s,\x20%s',_0x5e7fb0,_0x55896a);_0x4056c4(_0x55896a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 5150561..8857dce 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 _0x73a0=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','create','post','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xbec504,_0x223b6c){var _0x511fdb=function(_0x24d887){while(--_0x24d887){_0xbec504['push'](_0xbec504['shift']());}};_0x511fdb(++_0x223b6c);}(_0x73a0,0xca));var _0x073a=function(_0x165931,_0x255e9d){_0x165931=_0x165931-0x0;var _0x581f92=_0x73a0[_0x165931];return _0x581f92;};'use strict';var multer=require(_0x073a('0x0'));var util=require(_0x073a('0x1'));var path=require(_0x073a('0x2'));var timeout=require(_0x073a('0x3'));var express=require('express');var router=express[_0x073a('0x4')]();var auth=require(_0x073a('0x5'));var interaction=require(_0x073a('0x6'));var config=require(_0x073a('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x073a('0x8')]('/',auth[_0x073a('0x9')](),controller[_0x073a('0xa')]);router[_0x073a('0x8')](_0x073a('0xb'),auth[_0x073a('0x9')](),controller[_0x073a('0xc')]);router[_0x073a('0x8')](_0x073a('0xd'),auth[_0x073a('0x9')](),controller['getConfigurations']);router[_0x073a('0x8')]('/:id/fields',auth[_0x073a('0x9')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x073a('0xe')]);router[_0x073a('0xf')](_0x073a('0xd'),auth[_0x073a('0x9')](),controller['addConfiguration']);router[_0x073a('0x10')](_0x073a('0xb'),auth[_0x073a('0x9')](),controller['update']);router[_0x073a('0x11')]('/:id',auth[_0x073a('0x9')](),controller[_0x073a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x59ca=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x59ca,0xc6));var _0xa59c=function(_0x43da46,_0x4373c3){_0x43da46=_0x43da46-0x0;var _0xd7aeb7=_0x59ca[_0x43da46];return _0xd7aeb7;};'use strict';var multer=require(_0xa59c('0x0'));var util=require(_0xa59c('0x1'));var path=require(_0xa59c('0x2'));var timeout=require(_0xa59c('0x3'));var express=require('express');var router=express[_0xa59c('0x4')]();var auth=require(_0xa59c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa59c('0x6'));var controller=require(_0xa59c('0x7'));router['get']('/',auth[_0xa59c('0x8')](),controller[_0xa59c('0x9')]);router['get'](_0xa59c('0xa'),auth['isAuthenticated'](),controller[_0xa59c('0xb')]);router[_0xa59c('0xc')](_0xa59c('0xd'),auth[_0xa59c('0x8')](),controller[_0xa59c('0xe')]);router[_0xa59c('0xc')](_0xa59c('0xf'),auth[_0xa59c('0x8')](),controller[_0xa59c('0x10')]);router['post']('/',auth[_0xa59c('0x8')](),controller[_0xa59c('0x11')]);router['post'](_0xa59c('0xd'),auth['isAuthenticated'](),controller[_0xa59c('0x12')]);router[_0xa59c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa59c('0x14')]);router[_0xa59c('0x15')](_0xa59c('0xa'),auth[_0xa59c('0x8')](),controller[_0xa59c('0x16')]);module[_0xa59c('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 9b657b2..efa0e0d 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 _0xcea9=['STRING','sequelize','exports'];(function(_0x472573,_0xa37628){var _0x3982e6=function(_0x2aeb57){while(--_0x2aeb57){_0x472573['push'](_0x472573['shift']());}};_0x3982e6(++_0xa37628);}(_0xcea9,0x97));var _0x9cea=function(_0x4e50f4,_0x3b3fd6){_0x4e50f4=_0x4e50f4-0x0;var _0x566cc0=_0xcea9[_0x4e50f4];return _0x566cc0;};'use strict';var Sequelize=require(_0x9cea('0x0'));module[_0x9cea('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9cea('0x2')]},'password':{'type':Sequelize[_0x9cea('0x2')]},'remoteUri':{'type':Sequelize[_0x9cea('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9cea('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9cea('0x2')]},'description':{'type':Sequelize[_0x9cea('0x2')]}}; \ No newline at end of file +var _0xb2ac=['exports','STRING','sequelize'];(function(_0x138195,_0x435f33){var _0x3eb89f=function(_0xfa356c){while(--_0xfa356c){_0x138195['push'](_0x138195['shift']());}};_0x3eb89f(++_0x435f33);}(_0xb2ac,0x1c4));var _0xcb2a=function(_0x3004de,_0x45941a){_0x3004de=_0x3004de-0x0;var _0x3c13d3=_0xb2ac[_0x3004de];return _0x3c13d3;};'use strict';var Sequelize=require(_0xcb2a('0x0'));module[_0xcb2a('0x1')]={'name':{'type':Sequelize[_0xcb2a('0x2')]},'username':{'type':Sequelize[_0xcb2a('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcb2a('0x2')]},'tenantId':{'type':Sequelize[_0xcb2a('0x2')]},'clientId':{'type':Sequelize[_0xcb2a('0x2')]},'clientSecret':{'type':Sequelize[_0xcb2a('0x2')]},'serverUrl':{'type':Sequelize[_0xcb2a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 9cd8dc1..2f96448 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 _0xa4a2=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','find','create','body','params','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','Incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','productidname','productserialnumber','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','tenantId','clientId','remoteUri','slice','substring','%s/api/data/v9.0/','POST','/oauth2/token','password','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','Value','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','OptionSet','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type'];(function(_0x382bfd,_0x16241d){var _0x102fc6=function(_0x1d64f6){while(--_0x1d64f6){_0x382bfd['push'](_0x382bfd['shift']());}};_0x102fc6(++_0x16241d);}(_0xa4a2,0x9c));var _0x2a4a=function(_0x62a53a,_0x3ffaf6){_0x62a53a=_0x62a53a-0x0;var _0xf05383=_0xa4a2[_0x62a53a];return _0xf05383;};'use strict';var pdf=require(_0x2a4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2a4a('0x1'));var zipdir=require(_0x2a4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a4a('0x3'));var moment=require(_0x2a4a('0x4'));var BPromise=require(_0x2a4a('0x5'));var Mustache=require(_0x2a4a('0x6'));var util=require('util');var path=require(_0x2a4a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a4a('0x8'));var fs=require('fs');var _=require(_0x2a4a('0x9'));var squel=require(_0x2a4a('0xa'));var crypto=require(_0x2a4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2a4a('0xc'));var toCsv=require(_0x2a4a('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a4a('0xe'));var authService=require(_0x2a4a('0xf'));var qs=require(_0x2a4a('0x10'));var as=require(_0x2a4a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a4a('0x12'))(_0x2a4a('0x13'));var utils=require(_0x2a4a('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x2a4a('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x2a4a('0x16')][_0x2a4a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2aacf3,_0x50c781,_0x51d77a){if(_0x51d77a){var _0x58e560=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58e560[_0x2a4a('0x18')](_0x50c781)){return _0x2aacf3;}else{throw new db[(_0x2a4a('0x19'))]['ValidationError'](_0x2a4a('0x1a'));}}else{return _0x2aacf3;}}function respondWithRpcPromise(_0x2d8263,_0x2df115,_0x4eabb9,_0x26c028){return new BPromise(function(_0x5bc757,_0x5cd1b8){var _0x3af73f=_0x26c028||client;return _0x3af73f['request'](_0x2d8263,_0x4eabb9)['then'](function(_0x4b6429){logger[_0x2a4a('0x1b')](_0x2a4a('0x1c'),_0x2df115,_0x2a4a('0x1d'));logger[_0x2a4a('0x1e')](_0x2a4a('0x1f'),_0x2df115,_0x2a4a('0x1d'),JSON['stringify'](_0x4b6429));if(_0x4b6429[_0x2a4a('0x20')]){if(_0x4b6429[_0x2a4a('0x20')][_0x2a4a('0x21')]===0x1f4){logger[_0x2a4a('0x20')](_0x2a4a('0x1c'),_0x2df115,_0x4b6429[_0x2a4a('0x20')][_0x2a4a('0x22')]);return _0x5cd1b8(_0x4b6429[_0x2a4a('0x20')][_0x2a4a('0x22')]);}logger['error'](_0x2a4a('0x1c'),_0x2df115,_0x4b6429[_0x2a4a('0x20')]['message']);return _0x5bc757(_0x4b6429[_0x2a4a('0x20')]['message']);}else{logger[_0x2a4a('0x1b')](_0x2a4a('0x1c'),_0x2df115,_0x2a4a('0x1d'));_0x5bc757(_0x4b6429[_0x2a4a('0x23')]['message']);}})[_0x2a4a('0x24')](function(_0x4650df){logger['error'](_0x2a4a('0x1c'),_0x2df115,_0x4650df);_0x5cd1b8(_0x4650df);});});}function respondWithStatusCode(_0x2c4051,_0x4a9c58){_0x4a9c58=_0x4a9c58||0xcc;return function(_0x227157){if(_0x227157){return _0x2c4051[_0x2a4a('0x25')](_0x4a9c58);}return _0x2c4051['status'](_0x4a9c58)['end']();};}function respondWithResult(_0x50c97f,_0x521b99){_0x521b99=_0x521b99||0xc8;return function(_0x59c24e){if(_0x59c24e){return _0x50c97f[_0x2a4a('0x26')](_0x521b99)['json'](_0x59c24e);}};}function respondWithFilteredResult(_0x36820f,_0x20a02e){return function(_0x37c65a){if(_0x37c65a){var _0x3b2254=_0x37c65a['count'],_0x2ff087=_0x20a02e[_0x2a4a('0x27')],_0x248d80=_0x20a02e['offset']+_0x20a02e[_0x2a4a('0x28')],_0x4ae583;if(_0x248d80>=_0x3b2254){_0x248d80=_0x3b2254;_0x4ae583=0xc8;}else{_0x4ae583=0xce;}_0x36820f[_0x2a4a('0x26')](_0x4ae583);return _0x36820f[_0x2a4a('0x29')](_0x2a4a('0x2a'),_0x2ff087+'-'+_0x248d80+'/'+_0x3b2254)[_0x2a4a('0x2b')](_0x37c65a);}return null;};}function patchUpdates(_0x13df32){return function(_0x25098e){try{jsonpatch[_0x2a4a('0x2c')](_0x25098e,_0x13df32,!![]);}catch(_0x49f717){return BPromise[_0x2a4a('0x2d')](_0x49f717);}return _0x25098e[_0x2a4a('0x2e')]();};}function saveUpdates(_0x1a7856,_0xf8680c){return function(_0x11a0b1){if(_0x11a0b1){return _0x11a0b1[_0x2a4a('0x2f')](_0x1a7856)[_0x2a4a('0x30')](function(_0x43e59c){return _0x43e59c;});}return null;};}function removeEntity(_0x4151f1,_0x3a2980){return function(_0x558765){if(_0x558765){return _0x558765[_0x2a4a('0x31')]()[_0x2a4a('0x30')](function(){_0x4151f1['status'](0xcc)[_0x2a4a('0x32')]();});}};}function handleEntityNotFound(_0x2ca5e4,_0x8a8ee9){return function(_0x54ca27){if(!_0x54ca27){_0x2ca5e4[_0x2a4a('0x25')](0x194);}return _0x54ca27;};}function handleError(_0x3b68d5,_0x240c07){_0x240c07=_0x240c07||0x1f4;return function(_0x426e8b){logger[_0x2a4a('0x20')](_0x426e8b[_0x2a4a('0x33')]);if(_0x426e8b[_0x2a4a('0x34')]){delete _0x426e8b[_0x2a4a('0x34')];}_0x3b68d5[_0x2a4a('0x26')](_0x240c07)[_0x2a4a('0x35')](_0x426e8b);};}exports[_0x2a4a('0x36')]=function(_0x307d5b,_0x1a8aa8){var _0x4532ab={},_0xee1c3b={},_0x3b37d3={'count':0x0,'rows':[]};var _0x45e2d5=_[_0x2a4a('0x37')](db[_0x2a4a('0x38')][_0x2a4a('0x39')],function(_0x2a965d){return{'name':_0x2a965d[_0x2a4a('0x3a')],'type':_0x2a965d[_0x2a4a('0x3b')][_0x2a4a('0x3c')]};});_0xee1c3b[_0x2a4a('0x3d')]=_[_0x2a4a('0x37')](_0x45e2d5,'name');_0xee1c3b[_0x2a4a('0x3e')]=_[_0x2a4a('0x3f')](_0x307d5b[_0x2a4a('0x3e')]);_0xee1c3b[_0x2a4a('0x40')]=_[_0x2a4a('0x41')](_0xee1c3b[_0x2a4a('0x3d')],_0xee1c3b[_0x2a4a('0x3e')]);_0x4532ab['attributes']=_[_0x2a4a('0x41')](_0xee1c3b['model'],qs[_0x2a4a('0x42')](_0x307d5b['query'][_0x2a4a('0x42')]));_0x4532ab[_0x2a4a('0x43')]=_0x4532ab['attributes'][_0x2a4a('0x44')]?_0x4532ab['attributes']:_0xee1c3b['model'];if(!_0x307d5b['query'][_0x2a4a('0x45')](_0x2a4a('0x46'))){_0x4532ab[_0x2a4a('0x28')]=qs[_0x2a4a('0x28')](_0x307d5b['query']['limit']);_0x4532ab[_0x2a4a('0x27')]=qs['offset'](_0x307d5b[_0x2a4a('0x3e')]['offset']);}_0x4532ab[_0x2a4a('0x47')]=qs[_0x2a4a('0x48')](_0x307d5b['query'][_0x2a4a('0x48')]);_0x4532ab['where']=qs['filters'](_[_0x2a4a('0x49')](_0x307d5b['query'],_0xee1c3b[_0x2a4a('0x40')]),_0x45e2d5);if(_0x307d5b[_0x2a4a('0x3e')]['filter']){_0x4532ab[_0x2a4a('0x4a')]=_[_0x2a4a('0x4b')](_0x4532ab[_0x2a4a('0x4a')],{'$or':_[_0x2a4a('0x37')](_0x45e2d5,function(_0x5eefa1){if(_0x5eefa1[_0x2a4a('0x3b')]!==_0x2a4a('0x4c')){var _0x310e1c={};_0x310e1c[_0x5eefa1[_0x2a4a('0x34')]]={'$like':'%'+_0x307d5b[_0x2a4a('0x3e')][_0x2a4a('0x4d')]+'%'};return _0x310e1c;}})});}_0x4532ab=_['merge']({},_0x4532ab,_0x307d5b[_0x2a4a('0x4e')]);var _0x3db8a2={'where':_0x4532ab['where']};return db['Dynamics365Account'][_0x2a4a('0x4f')](_0x3db8a2)[_0x2a4a('0x30')](function(_0x305843){_0x3b37d3[_0x2a4a('0x4f')]=_0x305843;if(_0x307d5b[_0x2a4a('0x3e')][_0x2a4a('0x50')]){_0x4532ab[_0x2a4a('0x51')]=[{'all':!![]}];}return db[_0x2a4a('0x38')][_0x2a4a('0x52')](_0x4532ab);})[_0x2a4a('0x30')](function(_0x5bae9e){_0x3b37d3[_0x2a4a('0x53')]=_0x5bae9e;return _0x3b37d3;})['then'](respondWithFilteredResult(_0x1a8aa8,_0x4532ab))[_0x2a4a('0x24')](handleError(_0x1a8aa8,null));};exports[_0x2a4a('0x54')]=function(_0x574203,_0x21bfab){var _0x5b57fd={'raw':![],'where':{'id':_0x574203['params']['id']}},_0x402aa5={};_0x402aa5[_0x2a4a('0x3d')]=_[_0x2a4a('0x3f')](db['Dynamics365Account']['rawAttributes']);_0x402aa5[_0x2a4a('0x3e')]=_[_0x2a4a('0x3f')](_0x574203[_0x2a4a('0x3e')]);_0x402aa5['filters']=_[_0x2a4a('0x41')](_0x402aa5[_0x2a4a('0x3d')],_0x402aa5[_0x2a4a('0x3e')]);_0x5b57fd[_0x2a4a('0x43')]=_['intersection'](_0x402aa5['model'],qs[_0x2a4a('0x42')](_0x574203['query']['fields']));_0x5b57fd[_0x2a4a('0x43')]=_0x5b57fd['attributes']['length']?_0x5b57fd[_0x2a4a('0x43')]:_0x402aa5['model'];if(_0x574203[_0x2a4a('0x3e')][_0x2a4a('0x50')]){_0x5b57fd[_0x2a4a('0x51')]=[{'all':!![]}];}_0x5b57fd=_[_0x2a4a('0x4b')]({},_0x5b57fd,_0x574203['options']);return db[_0x2a4a('0x38')][_0x2a4a('0x55')](_0x5b57fd)[_0x2a4a('0x30')](handleEntityNotFound(_0x21bfab,null))[_0x2a4a('0x30')](respondWithResult(_0x21bfab,null))[_0x2a4a('0x24')](handleError(_0x21bfab,null));};exports[_0x2a4a('0x56')]=function(_0x32213f,_0x1f87ad){return db[_0x2a4a('0x38')][_0x2a4a('0x56')](_0x32213f[_0x2a4a('0x57')],{})[_0x2a4a('0x30')](respondWithResult(_0x1f87ad,0xc9))['catch'](handleError(_0x1f87ad,null));};exports[_0x2a4a('0x2f')]=function(_0x2c04f1,_0x48fb26){if(_0x2c04f1[_0x2a4a('0x57')]['id']){delete _0x2c04f1[_0x2a4a('0x57')]['id'];}return db[_0x2a4a('0x38')][_0x2a4a('0x55')]({'where':{'id':_0x2c04f1[_0x2a4a('0x58')]['id']}})[_0x2a4a('0x30')](handleEntityNotFound(_0x48fb26,null))[_0x2a4a('0x30')](saveUpdates(_0x2c04f1[_0x2a4a('0x57')],null))['then'](respondWithResult(_0x48fb26,null))['catch'](handleError(_0x48fb26,null));};exports[_0x2a4a('0x31')]=function(_0x17f97f,_0x50d9d6){return db['Dynamics365Account'][_0x2a4a('0x55')]({'where':{'id':_0x17f97f['params']['id']}})[_0x2a4a('0x30')](handleEntityNotFound(_0x50d9d6,null))[_0x2a4a('0x30')](removeEntity(_0x50d9d6,null))[_0x2a4a('0x24')](handleError(_0x50d9d6,null));};exports[_0x2a4a('0x59')]=function(_0x533b34,_0x1decdf,_0x198fbc){var _0x74ce64={};var _0x380df7={};var _0x412ab2;var _0x55f027;return db['Dynamics365Account'][_0x2a4a('0x5a')]({'where':{'id':_0x533b34[_0x2a4a('0x58')]['id']}})[_0x2a4a('0x30')](handleEntityNotFound(_0x1decdf,null))[_0x2a4a('0x30')](function(_0x297798){if(_0x297798){_0x412ab2=_0x297798;_0x380df7[_0x2a4a('0x3d')]=_[_0x2a4a('0x3f')](db['Dynamics365Configuration'][_0x2a4a('0x39')]);_0x380df7[_0x2a4a('0x3e')]=_[_0x2a4a('0x3f')](_0x533b34[_0x2a4a('0x3e')]);_0x380df7[_0x2a4a('0x40')]=_['intersection'](_0x380df7['model'],_0x380df7[_0x2a4a('0x3e')]);_0x74ce64[_0x2a4a('0x43')]=_[_0x2a4a('0x41')](_0x380df7[_0x2a4a('0x3d')],qs[_0x2a4a('0x42')](_0x533b34[_0x2a4a('0x3e')][_0x2a4a('0x42')]));_0x74ce64[_0x2a4a('0x43')]=_0x74ce64[_0x2a4a('0x43')][_0x2a4a('0x44')]?_0x74ce64[_0x2a4a('0x43')]:_0x380df7[_0x2a4a('0x3d')];_0x74ce64[_0x2a4a('0x47')]=qs['sort'](_0x533b34['query'][_0x2a4a('0x48')]);_0x74ce64['where']=qs['filters'](_[_0x2a4a('0x49')](_0x533b34[_0x2a4a('0x3e')],_0x380df7['filters']));if(_0x533b34[_0x2a4a('0x3e')][_0x2a4a('0x4d')]){_0x74ce64[_0x2a4a('0x4a')]=_['merge'](_0x74ce64['where'],{'$or':_['map'](_0x74ce64['attributes'],function(_0x496bdc){var _0x939654={};_0x939654[_0x496bdc]={'$like':'%'+_0x533b34[_0x2a4a('0x3e')][_0x2a4a('0x4d')]+'%'};return _0x939654;})});}_0x74ce64=_[_0x2a4a('0x4b')]({},_0x74ce64,_0x533b34[_0x2a4a('0x4e')]);return _0x412ab2[_0x2a4a('0x59')](_0x74ce64);}})[_0x2a4a('0x30')](function(_0x3d5b6b){if(_0x3d5b6b){_0x55f027=_0x3d5b6b[_0x2a4a('0x44')];if(!_0x533b34['query']['hasOwnProperty']('nolimit')){_0x74ce64[_0x2a4a('0x28')]=qs[_0x2a4a('0x28')](_0x533b34[_0x2a4a('0x3e')][_0x2a4a('0x28')]);_0x74ce64[_0x2a4a('0x27')]=qs[_0x2a4a('0x27')](_0x533b34[_0x2a4a('0x3e')][_0x2a4a('0x27')]);}return _0x412ab2['getConfigurations'](_0x74ce64);}})[_0x2a4a('0x30')](function(_0xdf5444){if(_0xdf5444){return _0xdf5444?{'count':_0x55f027,'rows':_0xdf5444}:null;}})[_0x2a4a('0x30')](respondWithResult(_0x1decdf,null))['catch'](handleError(_0x1decdf,null));};exports['addConfiguration']=function(_0x3fdf62,_0x3ea9e1,_0x510ba3){if(_0x3fdf62[_0x2a4a('0x57')]['id']){delete _0x3fdf62['body']['id'];}return db[_0x2a4a('0x38')][_0x2a4a('0x5a')]({'where':{'id':_0x3fdf62['params']['id']}})[_0x2a4a('0x30')](handleEntityNotFound(_0x3ea9e1,null))[_0x2a4a('0x30')](function(_0x61dbbe){if(_0x61dbbe){_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x5b')]=_0x61dbbe['id'];_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x5c')]=integrations[_0x2a4a('0x5d')](_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x5e')],_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x3b')]);_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x5f')]=integrations[_0x2a4a('0x60')](_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x5e')],_0x3fdf62[_0x2a4a('0x57')][_0x2a4a('0x3b')]);return db[_0x2a4a('0x61')][_0x2a4a('0x56')](_0x3fdf62[_0x2a4a('0x57')],{'include':[{'model':db['Dynamics365Field'],'as':_0x2a4a('0x5c')},{'model':db[_0x2a4a('0x62')],'as':_0x2a4a('0x5f')}]});}return null;})[_0x2a4a('0x30')](respondWithResult(_0x3ea9e1,null))[_0x2a4a('0x24')](handleError(_0x3ea9e1,null));};exports[_0x2a4a('0x63')]=function(_0x2e2241,_0x50d86e,_0x33c000){var _0x57cc4c=_0x2e2241[_0x2a4a('0x3e')][_0x2a4a('0x64')];var _0x4b5561=_0x57cc4c==='incident'?_0x2a4a('0x65'):_0x2a4a('0x66');var _0x34546f='';var _0x5578ee='';var _0x1978bf='';var _0x21f79d='';var _0x2d9d44='';var _0x4b7c6d='';var _0x449055='';var _0x3ef87c='';var _0x443e54=['title',_0x2a4a('0x67'),_0x2a4a('0x68'),_0x2a4a('0x69'),'caseorigincode',_0x2a4a('0x6a'),_0x2a4a('0x6b'),_0x2a4a('0x6c'),_0x2a4a('0x6d'),'phonecall_activity_parties'];var _0xadc73d=[_0x2a4a('0x6e'),'accountidyominame',_0x2a4a('0x6f'),_0x2a4a('0x70'),_0x2a4a('0x71'),'contactidyominame',_0x2a4a('0x72'),_0x2a4a('0x73'),_0x2a4a('0x74'),_0x2a4a('0x75'),_0x2a4a('0x76'),_0x2a4a('0x77'),'createdon','createdonbehalfbyname',_0x2a4a('0x78'),_0x2a4a('0x79'),_0x2a4a('0x7a'),_0x2a4a('0x7b'),_0x2a4a('0x7c'),_0x2a4a('0x7d'),'entityimage_timestamp',_0x2a4a('0x7e'),_0x2a4a('0x7f'),_0x2a4a('0x80'),_0x2a4a('0x81'),_0x2a4a('0x82'),'importsequencenumber',_0x2a4a('0x83'),_0x2a4a('0x84'),_0x2a4a('0x85'),_0x2a4a('0x86'),_0x2a4a('0x87'),_0x2a4a('0x88'),_0x2a4a('0x89'),_0x2a4a('0x8a'),_0x2a4a('0x8b'),'modifiedonbehalfbyname',_0x2a4a('0x8c'),_0x2a4a('0x8d'),_0x2a4a('0x8e'),_0x2a4a('0x8f'),_0x2a4a('0x90'),_0x2a4a('0x91'),_0x2a4a('0x92'),_0x2a4a('0x93'),'owneridyominame','parentcaseidname',_0x2a4a('0x94'),'primarycontactidyominame','prioritycodename',_0x2a4a('0x95'),_0x2a4a('0x96'),_0x2a4a('0x97'),'resolvebykpiidname',_0x2a4a('0x98'),'responsiblecontactidname',_0x2a4a('0x99'),_0x2a4a('0x9a'),'slainvokedidname',_0x2a4a('0x9b'),'socialprofileidname',_0x2a4a('0x9c'),_0x2a4a('0x9d'),_0x2a4a('0x9e'),_0x2a4a('0x9f'),'timezoneruleversionnumber',_0x2a4a('0xa0'),_0x2a4a('0xa1'),_0x2a4a('0xa2'),'versionnumber'];var _0x3cd12e=_0x443e54[_0x2a4a('0xa3')](_0xadc73d);return db[_0x2a4a('0x38')][_0x2a4a('0x5a')]({'where':{'id':_0x2e2241[_0x2a4a('0x58')]['id']},'attributes':['id',_0x2a4a('0xa4'),'password','remoteUri',_0x2a4a('0xa5'),_0x2a4a('0xa6'),'clientSecret']})[_0x2a4a('0x30')](handleEntityNotFound(_0x50d86e,null))[_0x2a4a('0x30')](function(_0x293790){if(_0x293790){_0x3ef87c=_0x293790[_0x2a4a('0xa7')];var _0x86a09=_0x3ef87c[_0x2a4a('0xa8')](-0x1);if(_0x86a09==='/'){_0x3ef87c=_0x3ef87c[_0x2a4a('0xa9')](0x0,_0x3ef87c['lastIndexOf'](_0x86a09));}_0x449055=util['format'](_0x2a4a('0xaa'),_0x3ef87c);var _0x9e5058={'method':_0x2a4a('0xab'),'uri':'https://login.microsoftonline.com/'+_0x293790[_0x2a4a('0xa5')]+_0x2a4a('0xac'),'form':{'client_id':_0x293790['clientId'],'resource':_0x3ef87c,'username':_0x293790[_0x2a4a('0xa4')],'password':_0x293790[_0x2a4a('0xad')],'grant_type':_0x2a4a('0xad'),'client_secret':_0x293790[_0x2a4a('0xae')]},'json':!![]};return rp(_0x9e5058);}})[_0x2a4a('0x30')](function(_0x241027){_0x4b7c6d=_0x241027[_0x2a4a('0xaf')];var _0x53cad3={'method':_0x2a4a('0xb0'),'uri':encodeURI(_0x449055+_0x2a4a('0xb1')+_0x4b5561+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4b7c6d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x53cad3);})['then'](function(_0x215e11){var _0x45c203=_0x215e11[_0x2a4a('0xb2')][0x0];var _0xc6d5cb=_0x45c203[_0x2a4a('0xb3')];var _0xf47f7c={'method':_0x2a4a('0xb0'),'uri':_0x449055+'EntityDefinitions('+_0xc6d5cb+_0x2a4a('0xb4'),'headers':{'Authorization':_0x2a4a('0xb5')+_0x4b7c6d,'If-None-Match':null,'OData-Version':_0x2a4a('0xb6')},'json':!![]};return rp(_0xf47f7c);})[_0x2a4a('0x30')](function(_0x2c9598){_0x34546f=_0x2c9598;_0x5578ee=_0x34546f[_0x2a4a('0xb7')];_0x5578ee=_[_0x2a4a('0xb8')](_0x5578ee,function(_0x274f69){return!_0x3cd12e[_0x2a4a('0xb9')](_0x274f69[_0x2a4a('0xba')]);});var _0x595c4f=[];var _0x31666f=[];_0x5578ee[_0x2a4a('0xbb')](function(_0x428498){if(_0x428498[_0x2a4a('0xbc')]){var _0x21e6f3=_0x428498[_0x2a4a('0xbc')][_0x2a4a('0xa9')](_0x428498['@odata.type'][_0x2a4a('0xbd')]('.')+0x1);if(_0x21e6f3===_0x2a4a('0xbe')){_0x595c4f['push'](getSelectList(_0x449055,_0x57cc4c,_0x31666f,_0x34546f[_0x2a4a('0xb3')],_0x428498[_0x2a4a('0xb3')],_0x4b7c6d));}}});return Promise[_0x2a4a('0xbf')](_0x595c4f);})['then'](function(_0x4252de){_0x1978bf=_0x4252de[0x0];var _0x316d84=[];var _0x5987f4=[];_0x5578ee[_0x2a4a('0xbb')](function(_0x480f37){if(!_[_0x2a4a('0xc0')](_0x480f37[_0x2a4a('0xbc')])){var _0x5be348=_0x480f37[_0x2a4a('0xbc')]['substring'](_0x480f37['@odata.type'][_0x2a4a('0xbd')]('.')+0x1);if(_0x5be348===_0x2a4a('0xc1')){_0x316d84[_0x2a4a('0xc2')](getBooleanList(_0x449055,_0x57cc4c,_0x5987f4,_0x34546f[_0x2a4a('0xb3')],_0x480f37[_0x2a4a('0xb3')],_0x4b7c6d));}}});return Promise[_0x2a4a('0xbf')](_0x316d84);})[_0x2a4a('0x30')](function(_0x16e276){_0x21f79d=_0x16e276[0x0];var _0x470166=[];var _0x57245e=[];_0x5578ee['forEach'](function(_0x39ec8f){if(_0x39ec8f[_0x2a4a('0xbc')]){var _0x57ece0=_0x39ec8f[_0x2a4a('0xbc')][_0x2a4a('0xa9')](_0x39ec8f[_0x2a4a('0xbc')][_0x2a4a('0xbd')]('.')+0x1);if(_0x57ece0==='StringAttributeMetadata'||_0x57ece0==='DoubleAttributeMetadata'||_0x57ece0==='BigIntAttributeMetadata'||_0x57ece0===_0x2a4a('0xc3')||_0x57ece0===_0x2a4a('0xc4')||_0x57ece0==='DateTimeAttributeMetadata'||_0x57ece0===_0x2a4a('0xc5')||_0x57ece0===_0x2a4a('0xc6')||_0x57ece0===_0x2a4a('0xc7')||_0x57ece0===_0x2a4a('0xc8')){_0x470166[_0x2a4a('0xc2')](getInputList(_0x449055,_0x57cc4c,_0x57ece0,_0x57245e,_0x34546f[_0x2a4a('0xb3')],_0x39ec8f['MetadataId'],_0x4b7c6d));}}});return Promise[_0x2a4a('0xbf')](_0x470166);})['then'](function(_0x561150){_0x2d9d44=_0x561150[0x0];var _0x5978c8=_0x1978bf[_0x2a4a('0xa3')](_0x21f79d)[_0x2a4a('0xa3')](_0x2d9d44);var _0x3732dd={'count':_0x5978c8[_0x2a4a('0x44')],'rows':_0x5978c8};return _0x3732dd;})[_0x2a4a('0x30')](respondWithResult(_0x50d86e,null))[_0x2a4a('0x24')](function(_0x384098){var _0x43d279=_0x2e2241['query'][_0x2a4a('0x18')]?0x1f4:_0x384098[_0x2a4a('0xc9')]||0x1f4;logger[_0x2a4a('0x20')](_0x384098[_0x2a4a('0x33')]);delete _0x384098[_0x2a4a('0x34')];if(_0x43d279===0x191){_0x43d279=0x190;}_0x50d86e['status'](_0x43d279)[_0x2a4a('0x35')](_0x2e2241[_0x2a4a('0x3e')][_0x2a4a('0x18')]?{'message':'Wrong\x20credentials','statusCode':_0x384098[_0x2a4a('0xc9')]}:_0x384098);});};function getSelectList(_0x21f261,_0x17279c,_0x483988,_0x250c15,_0x287bbc,_0x4ac26c){var _0x5e804e={'method':'GET','uri':_0x21f261+_0x2a4a('0xca')+_0x250c15+_0x2a4a('0xcb')+_0x287bbc+_0x2a4a('0xcc')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x2a4a('0xb5')+_0x4ac26c,'If-None-Match':null,'OData-Version':_0x2a4a('0xb6')},'json':!![]};return rp(_0x5e804e)[_0x2a4a('0x30')](function(_0x352f01){var _0x25f9cb=[];var _0x4b6205=_0x352f01['OptionSet'][_0x2a4a('0xcd')];_0x4b6205['forEach'](function(_0x236ef1){_0x25f9cb['push']({'name':_0x236ef1[_0x2a4a('0xce')]['UserLocalizedLabel']['Label'],'value':String(_0x236ef1[_0x2a4a('0xcf')])});});var _0x425c20={'id':_0x17279c+'_'+_0x352f01[_0x2a4a('0xba')],'name':_0x352f01['DisplayName'][_0x2a4a('0xd0')][_0x2a4a('0xce')],'custom':![],'options':_0x25f9cb};_0x483988['push'](_0x425c20);return _0x483988;});}function getBooleanList(_0x475120,_0x2f95aa,_0x5c8c10,_0xfbfaf1,_0x3629ee,_0x216d1b){var _0x215d87={'method':'GET','uri':_0x475120+_0x2a4a('0xca')+_0xfbfaf1+_0x2a4a('0xcb')+_0x3629ee+_0x2a4a('0xd1'),'headers':{'Authorization':'Bearer\x20'+_0x216d1b,'If-None-Match':null,'OData-Version':_0x2a4a('0xb6')},'json':!![]};return rp(_0x215d87)[_0x2a4a('0x30')](function(_0x21f42b){var _0x5a6748=[];_0x5a6748[_0x2a4a('0xc2')]({'name':_0x21f42b['OptionSet']['TrueOption'][_0x2a4a('0xce')]['UserLocalizedLabel']['Label'],'value':_0x2a4a('0xd2')},{'name':_0x21f42b[_0x2a4a('0xd3')][_0x2a4a('0xd4')][_0x2a4a('0xce')][_0x2a4a('0xd0')][_0x2a4a('0xce')],'value':_0x2a4a('0xd5')});var _0x5e9c8e={'id':_0x2f95aa+'_'+_0x21f42b[_0x2a4a('0xba')],'name':_0x21f42b[_0x2a4a('0xd6')]['UserLocalizedLabel'][_0x2a4a('0xce')],'custom':![],'options':_0x5a6748};_0x5c8c10[_0x2a4a('0xc2')](_0x5e9c8e);return _0x5c8c10;});}function getInputList(_0x26bd3b,_0x1946bd,_0x1a948a,_0x509fa3,_0x31e0fd,_0x5cc0a2,_0x54524e){var _0x5d9df2={'method':'GET','uri':_0x26bd3b+_0x2a4a('0xca')+_0x31e0fd+_0x2a4a('0xcb')+_0x5cc0a2+')/Microsoft.Dynamics.CRM.'+_0x1a948a+_0x2a4a('0xd7'),'headers':{'Authorization':_0x2a4a('0xb5')+_0x54524e,'If-None-Match':null,'OData-Version':_0x2a4a('0xb6')},'json':!![]};return rp(_0x5d9df2)[_0x2a4a('0x30')](function(_0x3e2f26){var _0xcccee4={'id':_0x1946bd+'_'+_0x3e2f26[_0x2a4a('0xba')],'name':_0x3e2f26[_0x2a4a('0xd6')]['UserLocalizedLabel']?_0x3e2f26[_0x2a4a('0xd6')][_0x2a4a('0xd0')][_0x2a4a('0xce')]:_0x3e2f26[_0x2a4a('0xba')],'custom':![],'options':[]};_0x509fa3[_0x2a4a('0xc2')](_0xcccee4);return _0x509fa3;});} \ No newline at end of file +var _0xbc6b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','findAll','rows','show','create','body','find','params','getConfigurations','findOne','AccountId','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','Incident','PhoneCall','title','description','customerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','clientId','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','MetadataId','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','save','update','destroy','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','filters','intersection'];(function(_0x2f0583,_0x1c9be2){var _0x41628e=function(_0x71816){while(--_0x71816){_0x2f0583['push'](_0x2f0583['shift']());}};_0x41628e(++_0x1c9be2);}(_0xbc6b,0x97));var _0xbbc6=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xbc6b[_0x49ca18];return _0x145d54;};'use strict';var pdf=require(_0xbbc6('0x0'));var emlformat=require(_0xbbc6('0x1'));var rimraf=require(_0xbbc6('0x2'));var zipdir=require(_0xbbc6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbc6('0x4'));var moment=require('moment');var BPromise=require(_0xbbc6('0x5'));var Mustache=require(_0xbbc6('0x6'));var util=require(_0xbbc6('0x7'));var path=require(_0xbbc6('0x8'));var sox=require(_0xbbc6('0x9'));var csv=require('to-csv');var ejs=require(_0xbbc6('0xa'));var fs=require('fs');var _=require(_0xbbc6('0xb'));var squel=require(_0xbbc6('0xc'));var crypto=require(_0xbbc6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbc6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbbc6('0xf'));var Papa=require(_0xbbc6('0x10'));var Redis=require(_0xbbc6('0x11'));var authService=require(_0xbbc6('0x12'));var qs=require(_0xbbc6('0x13'));var as=require(_0xbbc6('0x14'));var hardwareService=require(_0xbbc6('0x15'));var logger=require('../../config/logger')(_0xbbc6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbbc6('0x17'))['db'];var integrations=require(_0xbbc6('0x18'));var jayson=require(_0xbbc6('0x19'));var client=jayson[_0xbbc6('0x1a')][_0xbbc6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5093bb,_0x5c6a60,_0x429ea6){if(_0x429ea6){var _0x55bdd6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55bdd6[_0xbbc6('0x1c')](_0x5c6a60)){return _0x5093bb;}else{throw new db[(_0xbbc6('0x1d'))][(_0xbbc6('0x1e'))](_0xbbc6('0x1f'));}}else{return _0x5093bb;}}function respondWithRpcPromise(_0x1b715f,_0x116fac,_0xd4daa8,_0x3fe2bc){return new BPromise(function(_0x12bbc4,_0x327648){var _0x32ebf4=_0x3fe2bc||client;return _0x32ebf4['request'](_0x1b715f,_0xd4daa8)[_0xbbc6('0x20')](function(_0x28867c){logger['info'](_0xbbc6('0x21'),_0x116fac,_0xbbc6('0x22'));logger[_0xbbc6('0x23')](_0xbbc6('0x24'),_0x116fac,_0xbbc6('0x22'),JSON[_0xbbc6('0x25')](_0x28867c));if(_0x28867c[_0xbbc6('0x26')]){if(_0x28867c[_0xbbc6('0x26')][_0xbbc6('0x27')]===0x1f4){logger['error'](_0xbbc6('0x21'),_0x116fac,_0x28867c[_0xbbc6('0x26')][_0xbbc6('0x28')]);return _0x327648(_0x28867c[_0xbbc6('0x26')][_0xbbc6('0x28')]);}logger['error'](_0xbbc6('0x21'),_0x116fac,_0x28867c['error']['message']);return _0x12bbc4(_0x28867c['error'][_0xbbc6('0x28')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x116fac,_0xbbc6('0x22'));_0x12bbc4(_0x28867c[_0xbbc6('0x29')][_0xbbc6('0x28')]);}})[_0xbbc6('0x2a')](function(_0x46fa5c){logger[_0xbbc6('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x116fac,_0x46fa5c);_0x327648(_0x46fa5c);});});}function respondWithStatusCode(_0x8eca7d,_0x274318){_0x274318=_0x274318||0xcc;return function(_0x350003){if(_0x350003){return _0x8eca7d['sendStatus'](_0x274318);}return _0x8eca7d[_0xbbc6('0x2b')](_0x274318)[_0xbbc6('0x2c')]();};}function respondWithResult(_0x2b748e,_0x306f8d){_0x306f8d=_0x306f8d||0xc8;return function(_0x2c16b2){if(_0x2c16b2){return _0x2b748e[_0xbbc6('0x2b')](_0x306f8d)[_0xbbc6('0x2d')](_0x2c16b2);}};}function respondWithFilteredResult(_0x18c50f,_0x11d27d){return function(_0x4dc5d0){if(_0x4dc5d0){var _0x16014e=_0x4dc5d0[_0xbbc6('0x2e')],_0xfb23fa=_0x11d27d['offset'],_0x2b6abf=_0x11d27d[_0xbbc6('0x2f')]+_0x11d27d[_0xbbc6('0x30')],_0x3c98c7;if(_0x2b6abf>=_0x16014e){_0x2b6abf=_0x16014e;_0x3c98c7=0xc8;}else{_0x3c98c7=0xce;}_0x18c50f[_0xbbc6('0x2b')](_0x3c98c7);return _0x18c50f['set'](_0xbbc6('0x31'),_0xfb23fa+'-'+_0x2b6abf+'/'+_0x16014e)[_0xbbc6('0x2d')](_0x4dc5d0);}return null;};}function patchUpdates(_0x17c74b){return function(_0x907413){try{jsonpatch['apply'](_0x907413,_0x17c74b,!![]);}catch(_0x2fbb95){return BPromise['reject'](_0x2fbb95);}return _0x907413[_0xbbc6('0x32')]();};}function saveUpdates(_0x509264,_0x3dd3d4){return function(_0x926c49){if(_0x926c49){return _0x926c49[_0xbbc6('0x33')](_0x509264)['then'](function(_0x3a7df1){return _0x3a7df1;});}return null;};}function removeEntity(_0x147b99,_0x4ae715){return function(_0x95e124){if(_0x95e124){return _0x95e124[_0xbbc6('0x34')]()[_0xbbc6('0x20')](function(){_0x147b99[_0xbbc6('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fc977,_0x2755ba){return function(_0x2b47db){if(!_0x2b47db){_0x2fc977[_0xbbc6('0x35')](0x194);}return _0x2b47db;};}function handleError(_0x7ca117,_0x1a2905){_0x1a2905=_0x1a2905||0x1f4;return function(_0x59fff9){logger[_0xbbc6('0x26')](_0x59fff9[_0xbbc6('0x36')]);if(_0x59fff9[_0xbbc6('0x37')]){delete _0x59fff9['name'];}_0x7ca117[_0xbbc6('0x2b')](_0x1a2905)[_0xbbc6('0x38')](_0x59fff9);};}exports[_0xbbc6('0x39')]=function(_0x35352f,_0x148013){var _0x18c589={},_0x3d44b3={},_0x497448={'count':0x0,'rows':[]};var _0x42aa6d=_[_0xbbc6('0x3a')](db[_0xbbc6('0x3b')][_0xbbc6('0x3c')],function(_0x31a027){return{'name':_0x31a027['fieldName'],'type':_0x31a027['type'][_0xbbc6('0x3d')]};});_0x3d44b3[_0xbbc6('0x3e')]=_[_0xbbc6('0x3a')](_0x42aa6d,_0xbbc6('0x37'));_0x3d44b3[_0xbbc6('0x3f')]=_[_0xbbc6('0x40')](_0x35352f['query']);_0x3d44b3[_0xbbc6('0x41')]=_[_0xbbc6('0x42')](_0x3d44b3[_0xbbc6('0x3e')],_0x3d44b3[_0xbbc6('0x3f')]);_0x18c589[_0xbbc6('0x43')]=_['intersection'](_0x3d44b3['model'],qs[_0xbbc6('0x44')](_0x35352f[_0xbbc6('0x3f')][_0xbbc6('0x44')]));_0x18c589[_0xbbc6('0x43')]=_0x18c589[_0xbbc6('0x43')][_0xbbc6('0x45')]?_0x18c589[_0xbbc6('0x43')]:_0x3d44b3[_0xbbc6('0x3e')];if(!_0x35352f['query'][_0xbbc6('0x46')](_0xbbc6('0x47'))){_0x18c589['limit']=qs[_0xbbc6('0x30')](_0x35352f[_0xbbc6('0x3f')][_0xbbc6('0x30')]);_0x18c589['offset']=qs[_0xbbc6('0x2f')](_0x35352f[_0xbbc6('0x3f')][_0xbbc6('0x2f')]);}_0x18c589[_0xbbc6('0x48')]=qs['sort'](_0x35352f['query'][_0xbbc6('0x49')]);_0x18c589[_0xbbc6('0x4a')]=qs[_0xbbc6('0x41')](_[_0xbbc6('0x4b')](_0x35352f[_0xbbc6('0x3f')],_0x3d44b3[_0xbbc6('0x41')]),_0x42aa6d);if(_0x35352f[_0xbbc6('0x3f')]['filter']){_0x18c589[_0xbbc6('0x4a')]=_[_0xbbc6('0x4c')](_0x18c589['where'],{'$or':_[_0xbbc6('0x3a')](_0x42aa6d,function(_0x4875c9){if(_0x4875c9[_0xbbc6('0x4d')]!=='VIRTUAL'){var _0x58e9a4={};_0x58e9a4[_0x4875c9['name']]={'$like':'%'+_0x35352f['query'][_0xbbc6('0x4e')]+'%'};return _0x58e9a4;}})});}_0x18c589=_[_0xbbc6('0x4c')]({},_0x18c589,_0x35352f[_0xbbc6('0x4f')]);var _0x53f70e={'where':_0x18c589['where']};return db[_0xbbc6('0x3b')][_0xbbc6('0x2e')](_0x53f70e)[_0xbbc6('0x20')](function(_0x5bcb1d){_0x497448['count']=_0x5bcb1d;if(_0x35352f[_0xbbc6('0x3f')][_0xbbc6('0x50')]){_0x18c589['include']=[{'all':!![]}];}return db[_0xbbc6('0x3b')][_0xbbc6('0x51')](_0x18c589);})['then'](function(_0x334a84){_0x497448[_0xbbc6('0x52')]=_0x334a84;return _0x497448;})['then'](respondWithFilteredResult(_0x148013,_0x18c589))[_0xbbc6('0x2a')](handleError(_0x148013,null));};exports[_0xbbc6('0x53')]=function(_0x5dace8,_0x2a37e9){var _0x4f3586={'raw':![],'where':{'id':_0x5dace8['params']['id']}},_0x433158={};_0x433158[_0xbbc6('0x3e')]=_['keys'](db['Dynamics365Account'][_0xbbc6('0x3c')]);_0x433158[_0xbbc6('0x3f')]=_[_0xbbc6('0x40')](_0x5dace8['query']);_0x433158['filters']=_[_0xbbc6('0x42')](_0x433158[_0xbbc6('0x3e')],_0x433158['query']);_0x4f3586[_0xbbc6('0x43')]=_[_0xbbc6('0x42')](_0x433158[_0xbbc6('0x3e')],qs['fields'](_0x5dace8[_0xbbc6('0x3f')][_0xbbc6('0x44')]));_0x4f3586[_0xbbc6('0x43')]=_0x4f3586['attributes'][_0xbbc6('0x45')]?_0x4f3586[_0xbbc6('0x43')]:_0x433158[_0xbbc6('0x3e')];if(_0x5dace8[_0xbbc6('0x3f')][_0xbbc6('0x50')]){_0x4f3586['include']=[{'all':!![]}];}_0x4f3586=_[_0xbbc6('0x4c')]({},_0x4f3586,_0x5dace8[_0xbbc6('0x4f')]);return db[_0xbbc6('0x3b')]['find'](_0x4f3586)['then'](handleEntityNotFound(_0x2a37e9,null))['then'](respondWithResult(_0x2a37e9,null))[_0xbbc6('0x2a')](handleError(_0x2a37e9,null));};exports[_0xbbc6('0x54')]=function(_0x422b26,_0xafa9c){return db[_0xbbc6('0x3b')][_0xbbc6('0x54')](_0x422b26['body'],{})['then'](respondWithResult(_0xafa9c,0xc9))[_0xbbc6('0x2a')](handleError(_0xafa9c,null));};exports[_0xbbc6('0x33')]=function(_0x571995,_0x182bf3){if(_0x571995[_0xbbc6('0x55')]['id']){delete _0x571995[_0xbbc6('0x55')]['id'];}return db[_0xbbc6('0x3b')][_0xbbc6('0x56')]({'where':{'id':_0x571995[_0xbbc6('0x57')]['id']}})[_0xbbc6('0x20')](handleEntityNotFound(_0x182bf3,null))['then'](saveUpdates(_0x571995[_0xbbc6('0x55')],null))[_0xbbc6('0x20')](respondWithResult(_0x182bf3,null))['catch'](handleError(_0x182bf3,null));};exports['destroy']=function(_0x18371e,_0x23ad08){return db[_0xbbc6('0x3b')][_0xbbc6('0x56')]({'where':{'id':_0x18371e[_0xbbc6('0x57')]['id']}})[_0xbbc6('0x20')](handleEntityNotFound(_0x23ad08,null))['then'](removeEntity(_0x23ad08,null))[_0xbbc6('0x2a')](handleError(_0x23ad08,null));};exports[_0xbbc6('0x58')]=function(_0x55fad2,_0x3dc7dc,_0x5a722e){var _0x2b1229={};var _0x56a8a2={};var _0x2181de;var _0x1ffb52;return db[_0xbbc6('0x3b')][_0xbbc6('0x59')]({'where':{'id':_0x55fad2[_0xbbc6('0x57')]['id']}})[_0xbbc6('0x20')](handleEntityNotFound(_0x3dc7dc,null))['then'](function(_0xb7f2bd){if(_0xb7f2bd){_0x2181de=_0xb7f2bd;_0x56a8a2[_0xbbc6('0x3e')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x56a8a2[_0xbbc6('0x3f')]=_[_0xbbc6('0x40')](_0x55fad2[_0xbbc6('0x3f')]);_0x56a8a2['filters']=_[_0xbbc6('0x42')](_0x56a8a2[_0xbbc6('0x3e')],_0x56a8a2[_0xbbc6('0x3f')]);_0x2b1229['attributes']=_['intersection'](_0x56a8a2[_0xbbc6('0x3e')],qs['fields'](_0x55fad2[_0xbbc6('0x3f')][_0xbbc6('0x44')]));_0x2b1229[_0xbbc6('0x43')]=_0x2b1229[_0xbbc6('0x43')]['length']?_0x2b1229[_0xbbc6('0x43')]:_0x56a8a2[_0xbbc6('0x3e')];_0x2b1229[_0xbbc6('0x48')]=qs[_0xbbc6('0x49')](_0x55fad2['query'][_0xbbc6('0x49')]);_0x2b1229[_0xbbc6('0x4a')]=qs[_0xbbc6('0x41')](_[_0xbbc6('0x4b')](_0x55fad2['query'],_0x56a8a2[_0xbbc6('0x41')]));if(_0x55fad2['query'][_0xbbc6('0x4e')]){_0x2b1229[_0xbbc6('0x4a')]=_[_0xbbc6('0x4c')](_0x2b1229[_0xbbc6('0x4a')],{'$or':_[_0xbbc6('0x3a')](_0x2b1229[_0xbbc6('0x43')],function(_0x1b9f0a){var _0x1a2f1e={};_0x1a2f1e[_0x1b9f0a]={'$like':'%'+_0x55fad2[_0xbbc6('0x3f')]['filter']+'%'};return _0x1a2f1e;})});}_0x2b1229=_[_0xbbc6('0x4c')]({},_0x2b1229,_0x55fad2['options']);return _0x2181de[_0xbbc6('0x58')](_0x2b1229);}})[_0xbbc6('0x20')](function(_0x54c113){if(_0x54c113){_0x1ffb52=_0x54c113[_0xbbc6('0x45')];if(!_0x55fad2[_0xbbc6('0x3f')][_0xbbc6('0x46')]('nolimit')){_0x2b1229[_0xbbc6('0x30')]=qs[_0xbbc6('0x30')](_0x55fad2[_0xbbc6('0x3f')][_0xbbc6('0x30')]);_0x2b1229[_0xbbc6('0x2f')]=qs[_0xbbc6('0x2f')](_0x55fad2[_0xbbc6('0x3f')]['offset']);}return _0x2181de[_0xbbc6('0x58')](_0x2b1229);}})[_0xbbc6('0x20')](function(_0x1456a4){if(_0x1456a4){return _0x1456a4?{'count':_0x1ffb52,'rows':_0x1456a4}:null;}})[_0xbbc6('0x20')](respondWithResult(_0x3dc7dc,null))[_0xbbc6('0x2a')](handleError(_0x3dc7dc,null));};exports['addConfiguration']=function(_0x5bd085,_0x415777,_0x2efef9){if(_0x5bd085[_0xbbc6('0x55')]['id']){delete _0x5bd085[_0xbbc6('0x55')]['id'];}return db[_0xbbc6('0x3b')][_0xbbc6('0x59')]({'where':{'id':_0x5bd085['params']['id']}})['then'](handleEntityNotFound(_0x415777,null))[_0xbbc6('0x20')](function(_0x5ee217){if(_0x5ee217){_0x5bd085[_0xbbc6('0x55')][_0xbbc6('0x5a')]=_0x5ee217['id'];_0x5bd085['body']['Subjects']=integrations['getSubjects'](_0x5bd085[_0xbbc6('0x55')][_0xbbc6('0x5b')],_0x5bd085[_0xbbc6('0x55')][_0xbbc6('0x4d')]);_0x5bd085[_0xbbc6('0x55')][_0xbbc6('0x5c')]=integrations['getDescriptions'](_0x5bd085[_0xbbc6('0x55')][_0xbbc6('0x5b')],_0x5bd085[_0xbbc6('0x55')]['type']);return db[_0xbbc6('0x5d')][_0xbbc6('0x54')](_0x5bd085['body'],{'include':[{'model':db[_0xbbc6('0x5e')],'as':'Subjects'},{'model':db[_0xbbc6('0x5e')],'as':_0xbbc6('0x5c')}]});}return null;})['then'](respondWithResult(_0x415777,null))[_0xbbc6('0x2a')](handleError(_0x415777,null));};exports[_0xbbc6('0x5f')]=function(_0x18aa8b,_0x10bb43,_0x35354a){var _0x415527=_0x18aa8b['query'][_0xbbc6('0x60')];var _0x431031=_0x415527==='incident'?_0xbbc6('0x61'):_0xbbc6('0x62');var _0x3a2957='';var _0x3b9189='';var _0x407ed6='';var _0x491721='';var _0x59f5ed='';var _0x1363d4='';var _0x4c038b='';var _0x42d147='';var _0x36e122=[_0xbbc6('0x63'),_0xbbc6('0x64'),_0xbbc6('0x65'),'ownerid',_0xbbc6('0x66'),'subject','phonenumber',_0xbbc6('0x67'),_0xbbc6('0x68'),_0xbbc6('0x69')];var _0x5c344c=[_0xbbc6('0x6a'),_0xbbc6('0x6b'),_0xbbc6('0x6c'),_0xbbc6('0x6d'),_0xbbc6('0x6e'),_0xbbc6('0x6f'),_0xbbc6('0x70'),_0xbbc6('0x71'),_0xbbc6('0x72'),_0xbbc6('0x73'),_0xbbc6('0x74'),_0xbbc6('0x75'),_0xbbc6('0x76'),_0xbbc6('0x77'),_0xbbc6('0x78'),_0xbbc6('0x79'),_0xbbc6('0x7a'),_0xbbc6('0x7b'),'emailaddress',_0xbbc6('0x7c'),_0xbbc6('0x7d'),_0xbbc6('0x7e'),'escalatedon',_0xbbc6('0x7f'),'firstresponsebykpiidname',_0xbbc6('0x80'),_0xbbc6('0x81'),_0xbbc6('0x82'),_0xbbc6('0x83'),_0xbbc6('0x84'),_0xbbc6('0x85'),_0xbbc6('0x86'),'modifiedbyexternalpartyyominame',_0xbbc6('0x87'),_0xbbc6('0x88'),_0xbbc6('0x89'),_0xbbc6('0x8a'),_0xbbc6('0x8b'),_0xbbc6('0x8c'),_0xbbc6('0x8d'),_0xbbc6('0x8e'),'onholdtime',_0xbbc6('0x8f'),_0xbbc6('0x90'),'owneridtype',_0xbbc6('0x91'),'parentcaseidname','primarycontactidname',_0xbbc6('0x92'),'prioritycodename',_0xbbc6('0x93'),_0xbbc6('0x94'),_0xbbc6('0x95'),_0xbbc6('0x96'),_0xbbc6('0x97'),_0xbbc6('0x98'),'responsiblecontactidyominame',_0xbbc6('0x99'),_0xbbc6('0x9a'),_0xbbc6('0x9b'),_0xbbc6('0x9c'),'statecode',_0xbbc6('0x9d'),_0xbbc6('0x9e'),'ticketnumber',_0xbbc6('0x9f'),_0xbbc6('0xa0'),_0xbbc6('0xa1'),_0xbbc6('0xa2'),'versionnumber'];var _0x4133dd=_0x36e122[_0xbbc6('0xa3')](_0x5c344c);return db[_0xbbc6('0x3b')][_0xbbc6('0x59')]({'where':{'id':_0x18aa8b[_0xbbc6('0x57')]['id']},'attributes':['id','username',_0xbbc6('0xa4'),_0xbbc6('0xa5'),_0xbbc6('0xa6'),'clientId','clientSecret']})[_0xbbc6('0x20')](handleEntityNotFound(_0x10bb43,null))[_0xbbc6('0x20')](function(_0x4a3c8a){if(_0x4a3c8a){_0x42d147=_0x4a3c8a['remoteUri'];var _0x510931=_0x42d147[_0xbbc6('0xa7')](-0x1);if(_0x510931==='/'){_0x42d147=_0x42d147[_0xbbc6('0xa8')](0x0,_0x42d147[_0xbbc6('0xa9')](_0x510931));}_0x4c038b=util[_0xbbc6('0xaa')](_0xbbc6('0xab'),_0x42d147);var _0x317b5f={'method':_0xbbc6('0xac'),'uri':'https://login.microsoftonline.com/'+_0x4a3c8a[_0xbbc6('0xa6')]+_0xbbc6('0xad'),'form':{'client_id':_0x4a3c8a[_0xbbc6('0xae')],'resource':_0x42d147,'username':_0x4a3c8a['username'],'password':_0x4a3c8a['password'],'grant_type':_0xbbc6('0xa4'),'client_secret':_0x4a3c8a[_0xbbc6('0xaf')]},'json':!![]};return rp(_0x317b5f);}})['then'](function(_0x572b56){_0x1363d4=_0x572b56[_0xbbc6('0xb0')];var _0x3586ea={'method':_0xbbc6('0xb1'),'uri':encodeURI(_0x4c038b+_0xbbc6('0xb2')+_0x431031+'\x27'),'headers':{'Authorization':_0xbbc6('0xb3')+_0x1363d4,'If-None-Match':null,'OData-Version':_0xbbc6('0xb4')},'json':!![]};return rp(_0x3586ea);})[_0xbbc6('0x20')](function(_0x43dd4d){var _0x42a20c=_0x43dd4d[_0xbbc6('0xb5')][0x0];var _0x1ff76c=_0x42a20c['MetadataId'];var _0x2a57cf={'method':_0xbbc6('0xb1'),'uri':_0x4c038b+'EntityDefinitions('+_0x1ff76c+_0xbbc6('0xb6'),'headers':{'Authorization':_0xbbc6('0xb3')+_0x1363d4,'If-None-Match':null,'OData-Version':_0xbbc6('0xb4')},'json':!![]};return rp(_0x2a57cf);})[_0xbbc6('0x20')](function(_0x28093b){_0x3a2957=_0x28093b;_0x3b9189=_0x3a2957[_0xbbc6('0xb7')];_0x3b9189=_[_0xbbc6('0xb8')](_0x3b9189,function(_0x24a850){return!_0x4133dd[_0xbbc6('0xb9')](_0x24a850[_0xbbc6('0xba')]);});var _0x5dc2f7=[];var _0x38387f=[];_0x3b9189[_0xbbc6('0xbb')](function(_0x4bf2e4){if(_0x4bf2e4['@odata.type']){var _0x1d9817=_0x4bf2e4['@odata.type'][_0xbbc6('0xa8')](_0x4bf2e4[_0xbbc6('0xbc')][_0xbbc6('0xa9')]('.')+0x1);if(_0x1d9817===_0xbbc6('0xbd')){_0x5dc2f7['push'](getSelectList(_0x4c038b,_0x415527,_0x38387f,_0x3a2957['MetadataId'],_0x4bf2e4['MetadataId'],_0x1363d4));}}});return Promise[_0xbbc6('0xbe')](_0x5dc2f7);})[_0xbbc6('0x20')](function(_0x4d8e6e){_0x407ed6=_0x4d8e6e[0x0];var _0x8c2d66=[];var _0x4c4b63=[];_0x3b9189[_0xbbc6('0xbb')](function(_0x1f8889){if(!_[_0xbbc6('0xbf')](_0x1f8889[_0xbbc6('0xbc')])){var _0x4b4131=_0x1f8889[_0xbbc6('0xbc')]['substring'](_0x1f8889[_0xbbc6('0xbc')][_0xbbc6('0xa9')]('.')+0x1);if(_0x4b4131==='BooleanAttributeMetadata'){_0x8c2d66['push'](getBooleanList(_0x4c038b,_0x415527,_0x4c4b63,_0x3a2957['MetadataId'],_0x1f8889['MetadataId'],_0x1363d4));}}});return Promise[_0xbbc6('0xbe')](_0x8c2d66);})[_0xbbc6('0x20')](function(_0x27e9d4){_0x491721=_0x27e9d4[0x0];var _0x2d9494=[];var _0x11eef0=[];_0x3b9189[_0xbbc6('0xbb')](function(_0x5d854b){if(_0x5d854b[_0xbbc6('0xbc')]){var _0x4d2f54=_0x5d854b[_0xbbc6('0xbc')][_0xbbc6('0xa8')](_0x5d854b[_0xbbc6('0xbc')][_0xbbc6('0xa9')]('.')+0x1);if(_0x4d2f54==='StringAttributeMetadata'||_0x4d2f54===_0xbbc6('0xc0')||_0x4d2f54===_0xbbc6('0xc1')||_0x4d2f54===_0xbbc6('0xc2')||_0x4d2f54==='MemoAttributeMetadata'||_0x4d2f54===_0xbbc6('0xc3')||_0x4d2f54===_0xbbc6('0xc4')||_0x4d2f54===_0xbbc6('0xc5')||_0x4d2f54===_0xbbc6('0xc6')||_0x4d2f54===_0xbbc6('0xc7')){_0x2d9494[_0xbbc6('0xc8')](getInputList(_0x4c038b,_0x415527,_0x4d2f54,_0x11eef0,_0x3a2957['MetadataId'],_0x5d854b[_0xbbc6('0xc9')],_0x1363d4));}}});return Promise[_0xbbc6('0xbe')](_0x2d9494);})['then'](function(_0x1f3d19){_0x59f5ed=_0x1f3d19[0x0];var _0x45e46a=_0x407ed6[_0xbbc6('0xa3')](_0x491721)[_0xbbc6('0xa3')](_0x59f5ed);var _0xe913f2={'count':_0x45e46a[_0xbbc6('0x45')],'rows':_0x45e46a};return _0xe913f2;})[_0xbbc6('0x20')](respondWithResult(_0x10bb43,null))['catch'](function(_0x35f015){var _0x4b8045=_0x18aa8b[_0xbbc6('0x3f')]['test']?0x1f4:_0x35f015['statusCode']||0x1f4;logger[_0xbbc6('0x26')](_0x35f015[_0xbbc6('0x36')]);delete _0x35f015['name'];if(_0x4b8045===0x191){_0x4b8045=0x190;}_0x10bb43[_0xbbc6('0x2b')](_0x4b8045)[_0xbbc6('0x38')](_0x18aa8b[_0xbbc6('0x3f')][_0xbbc6('0x1c')]?{'message':_0xbbc6('0xca'),'statusCode':_0x35f015[_0xbbc6('0xcb')]}:_0x35f015);});};function getSelectList(_0x1e75f9,_0x51cfb9,_0x9407d8,_0x4d00e0,_0x1d5f44,_0x522258){var _0x42c3eb={'method':_0xbbc6('0xb1'),'uri':_0x1e75f9+_0xbbc6('0xcc')+_0x4d00e0+_0xbbc6('0xcd')+_0x1d5f44+_0xbbc6('0xce')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xbbc6('0xb3')+_0x522258,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x42c3eb)['then'](function(_0x3b84a3){var _0x4d5893=[];var _0x550ec5=_0x3b84a3[_0xbbc6('0xcf')][_0xbbc6('0xd0')];_0x550ec5[_0xbbc6('0xbb')](function(_0x592b64){_0x4d5893[_0xbbc6('0xc8')]({'name':_0x592b64[_0xbbc6('0xd1')][_0xbbc6('0xd2')][_0xbbc6('0xd1')],'value':String(_0x592b64[_0xbbc6('0xd3')])});});var _0x52bfd1={'id':_0x51cfb9+'_'+_0x3b84a3[_0xbbc6('0xba')],'name':_0x3b84a3[_0xbbc6('0xd4')][_0xbbc6('0xd2')][_0xbbc6('0xd1')],'custom':![],'options':_0x4d5893};_0x9407d8[_0xbbc6('0xc8')](_0x52bfd1);return _0x9407d8;});}function getBooleanList(_0x18d67c,_0x1f5ec2,_0x133cfc,_0x1abf7f,_0x18ed73,_0xb6359e){var _0x427ac0={'method':_0xbbc6('0xb1'),'uri':_0x18d67c+_0xbbc6('0xcc')+_0x1abf7f+_0xbbc6('0xcd')+_0x18ed73+_0xbbc6('0xd5'),'headers':{'Authorization':_0xbbc6('0xb3')+_0xb6359e,'If-None-Match':null,'OData-Version':_0xbbc6('0xb4')},'json':!![]};return rp(_0x427ac0)[_0xbbc6('0x20')](function(_0x279c34){var _0xf8d05=[];_0xf8d05[_0xbbc6('0xc8')]({'name':_0x279c34[_0xbbc6('0xcf')][_0xbbc6('0xd6')][_0xbbc6('0xd1')][_0xbbc6('0xd2')][_0xbbc6('0xd1')],'value':'true'},{'name':_0x279c34['OptionSet'][_0xbbc6('0xd7')][_0xbbc6('0xd1')][_0xbbc6('0xd2')]['Label'],'value':_0xbbc6('0xd8')});var _0x101325={'id':_0x1f5ec2+'_'+_0x279c34['LogicalName'],'name':_0x279c34[_0xbbc6('0xd4')][_0xbbc6('0xd2')][_0xbbc6('0xd1')],'custom':![],'options':_0xf8d05};_0x133cfc['push'](_0x101325);return _0x133cfc;});}function getInputList(_0x5d81a9,_0x49ba6d,_0x1b7ac5,_0x4446a5,_0x30a0ff,_0xf8577d,_0x5908cd){var _0x587026={'method':_0xbbc6('0xb1'),'uri':_0x5d81a9+'EntityDefinitions('+_0x30a0ff+_0xbbc6('0xcd')+_0xf8577d+')/Microsoft.Dynamics.CRM.'+_0x1b7ac5+_0xbbc6('0xd9'),'headers':{'Authorization':_0xbbc6('0xb3')+_0x5908cd,'If-None-Match':null,'OData-Version':_0xbbc6('0xb4')},'json':!![]};return rp(_0x587026)[_0xbbc6('0x20')](function(_0x1e48b3){var _0x4b7425={'id':_0x49ba6d+'_'+_0x1e48b3['LogicalName'],'name':_0x1e48b3[_0xbbc6('0xd4')][_0xbbc6('0xd2')]?_0x1e48b3[_0xbbc6('0xd4')]['UserLocalizedLabel']['Label']:_0x1e48b3[_0xbbc6('0xba')],'custom':![],'options':[]};_0x4446a5[_0xbbc6('0xc8')](_0x4b7425);return _0x4446a5;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index ebd29f0..f20834f 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 _0xaa32=['api','moment','request-promise','path','../../components/integrations/configuration','exports','int_dynamics365_accounts','util','../../config/logger'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0xaa32,0xb2));var _0x2aa3=function(_0x52fe08,_0x529536){_0x52fe08=_0x52fe08-0x0;var _0x506424=_0xaa32[_0x52fe08];return _0x506424;};'use strict';var _=require('lodash');var util=require(_0x2aa3('0x0'));var logger=require(_0x2aa3('0x1'))(_0x2aa3('0x2'));var moment=require(_0x2aa3('0x3'));var BPromise=require('bluebird');var rp=require(_0x2aa3('0x4'));var fs=require('fs');var path=require(_0x2aa3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x2aa3('0x6'));module[_0x2aa3('0x7')]=function(_0x59c3bb,_0x574914){return _0x59c3bb['define']('Dynamics365Account',attributes,{'tableName':_0x2aa3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51c5=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes'];(function(_0x1bff6f,_0x2e6453){var _0x43a11c=function(_0x50310a){while(--_0x50310a){_0x1bff6f['push'](_0x1bff6f['shift']());}};_0x43a11c(++_0x2e6453);}(_0x51c5,0xc8));var _0x551c=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x51c5[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x551c('0x0'))(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x551c('0x4'));var rimraf=require(_0x551c('0x5'));var config=require(_0x551c('0x6'));var attributes=require(_0x551c('0x7'));var integrations=require(_0x551c('0x8'));module[_0x551c('0x9')]=function(_0x532235,_0x1c5309){return _0x532235[_0x551c('0xa')](_0x551c('0xb'),attributes,{'tableName':_0x551c('0xc'),'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 c7834c5..bad77de 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 _0xb491=['findAll','options','raw','where','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dynamics365Account'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb491,0x18c));var _0x1b49=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xb491[_0x575a38];return _0x5a7bdd;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var moment=require(_0x1b49('0x2'));var BPromise=require(_0x1b49('0x3'));var rs=require(_0x1b49('0x4'));var fs=require('fs');var Redis=require(_0x1b49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b49('0x6'));var logger=require(_0x1b49('0x7'))('rpc');var config=require(_0x1b49('0x8'));var jayson=require(_0x1b49('0x9'));var client=jayson[_0x1b49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212aee,_0x537b53,_0x4636f4){return new BPromise(function(_0x3d5da7,_0x218fac){return client[_0x1b49('0xb')](_0x212aee,_0x4636f4)[_0x1b49('0xc')](function(_0x153ffc){logger[_0x1b49('0xd')](_0x1b49('0xe'),_0x537b53,_0x1b49('0xf'));logger[_0x1b49('0x10')](_0x1b49('0x11'),_0x537b53,_0x1b49('0xf'),JSON[_0x1b49('0x12')](_0x153ffc));if(_0x153ffc[_0x1b49('0x13')]){if(_0x153ffc['error']['code']===0x1f4){logger[_0x1b49('0x13')](_0x1b49('0xe'),_0x537b53,_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);return _0x218fac(_0x153ffc[_0x1b49('0x13')]['message']);}logger[_0x1b49('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x537b53,_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);return _0x3d5da7(_0x153ffc[_0x1b49('0x13')][_0x1b49('0x14')]);}else{logger['info'](_0x1b49('0xe'),_0x537b53,_0x1b49('0xf'));_0x3d5da7(_0x153ffc[_0x1b49('0x15')][_0x1b49('0x14')]);}})[_0x1b49('0x16')](function(_0x308e8e){logger[_0x1b49('0x13')](_0x1b49('0xe'),_0x537b53,_0x308e8e);_0x218fac(_0x308e8e);});});}exports['GetDynamics365Account']=function(_0x363678){var _0xe47400=this;return new Promise(function(_0x4b9dcd,_0x34282e){return db[_0x1b49('0x17')][_0x1b49('0x18')]({'raw':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1a')]===undefined?!![]:![]:!![],'where':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1b')]||null:null,'attributes':_0x363678[_0x1b49('0x19')]?_0x363678['options']['attributes']||null:null,'limit':_0x363678[_0x1b49('0x19')]?_0x363678[_0x1b49('0x19')][_0x1b49('0x1c')]||null:null,'include':_0x363678[_0x1b49('0x19')]?_0x363678['options'][_0x1b49('0x1d')]?_[_0x1b49('0x1e')](_0x363678['options'][_0x1b49('0x1d')],function(_0x187295){return{'model':db[_0x187295[_0x1b49('0x1f')]],'as':_0x187295['as'],'attributes':_0x187295['attributes'],'include':_0x187295[_0x1b49('0x1d')]?_[_0x1b49('0x1e')](_0x187295[_0x1b49('0x1d')],function(_0x4ab79e){return{'model':db[_0x4ab79e[_0x1b49('0x1f')]],'as':_0x4ab79e['as'],'attributes':_0x4ab79e['attributes'],'include':_0x4ab79e[_0x1b49('0x1d')]?_['map'](_0x4ab79e[_0x1b49('0x1d')],function(_0x469ab0){return{'model':db[_0x469ab0[_0x1b49('0x1f')]],'as':_0x469ab0['as'],'attributes':_0x469ab0['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b49('0xc')](function(_0x4953be){logger['info']('GetDynamics365Account',_0x363678);logger[_0x1b49('0x10')]('GetDynamics365Account',_0x363678,JSON[_0x1b49('0x12')](_0x4953be));_0x4b9dcd(_0x4953be);})[_0x1b49('0x16')](function(_0x512d61){logger[_0x1b49('0x13')](_0x1b49('0x20'),_0x512d61[_0x1b49('0x14')],_0x363678);_0x34282e(_0xe47400[_0x1b49('0x13')](0x1f4,_0x512d61[_0x1b49('0x14')]));});});};exports[_0x1b49('0x21')]=function(_0x2e87dc){var _0x59a859=this;return new Promise(function(_0x42f687,_0xdf5b8f){return db[_0x1b49('0x17')]['find']({'raw':_0x2e87dc['options']?_0x2e87dc[_0x1b49('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2e87dc[_0x1b49('0x19')]?_0x2e87dc['options'][_0x1b49('0x1b')]||null:null,'attributes':_0x2e87dc[_0x1b49('0x19')]?_0x2e87dc[_0x1b49('0x19')][_0x1b49('0x22')]||null:null,'include':_0x2e87dc['options']?_0x2e87dc[_0x1b49('0x19')][_0x1b49('0x1d')]?_[_0x1b49('0x1e')](_0x2e87dc[_0x1b49('0x19')][_0x1b49('0x1d')],function(_0x290a57){return{'model':db[_0x290a57[_0x1b49('0x1f')]],'as':_0x290a57['as'],'attributes':_0x290a57[_0x1b49('0x22')],'include':_0x290a57['include']?_[_0x1b49('0x1e')](_0x290a57['include'],function(_0xfd8a03){return{'model':db[_0xfd8a03[_0x1b49('0x1f')]],'as':_0xfd8a03['as'],'attributes':_0xfd8a03[_0x1b49('0x22')],'include':_0xfd8a03[_0x1b49('0x1d')]?_['map'](_0xfd8a03['include'],function(_0x4df19d){return{'model':db[_0x4df19d[_0x1b49('0x1f')]],'as':_0x4df19d['as'],'attributes':_0x4df19d[_0x1b49('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b44bc){logger[_0x1b49('0xd')](_0x1b49('0x21'),_0x2e87dc);logger[_0x1b49('0x10')](_0x1b49('0x21'),_0x2e87dc,JSON['stringify'](_0x1b44bc));_0x42f687(_0x1b44bc);})[_0x1b49('0x16')](function(_0x4bdc88){logger[_0x1b49('0x13')]('ShowDynamics365Account',_0x4bdc88[_0x1b49('0x14')],_0x2e87dc);_0xdf5b8f(_0x59a859['error'](0x1f4,_0x4bdc88[_0x1b49('0x14')]));});});}; \ No newline at end of file +var _0x4351=['include','map','model','stringify','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes'];(function(_0x5dafc5,_0xddc028){var _0x243905=function(_0x185444){while(--_0x185444){_0x5dafc5['push'](_0x5dafc5['shift']());}};_0x243905(++_0xddc028);}(_0x4351,0x1b5));var _0x1435=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4351[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var moment=require(_0x1435('0x2'));var BPromise=require(_0x1435('0x3'));var rs=require(_0x1435('0x4'));var fs=require('fs');var Redis=require(_0x1435('0x5'));var db=require(_0x1435('0x6'))['db'];var utils=require(_0x1435('0x7'));var logger=require(_0x1435('0x8'))(_0x1435('0x9'));var config=require(_0x1435('0xa'));var jayson=require(_0x1435('0xb'));var client=jayson[_0x1435('0xc')][_0x1435('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x337fd6,_0x56ce86,_0x10760d){return new BPromise(function(_0x5de4b0,_0x4d04c7){return client[_0x1435('0xe')](_0x337fd6,_0x10760d)[_0x1435('0xf')](function(_0x14a9e1){logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,'request\x20sent');logger[_0x1435('0x12')](_0x1435('0x13'),_0x56ce86,'request\x20sent',JSON['stringify'](_0x14a9e1));if(_0x14a9e1[_0x1435('0x14')]){if(_0x14a9e1['error'][_0x1435('0x15')]===0x1f4){logger['error'](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x4d04c7(_0x14a9e1['error'][_0x1435('0x16')]);}logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x5de4b0(_0x14a9e1[_0x1435('0x14')]['message']);}else{logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,_0x1435('0x17'));_0x5de4b0(_0x14a9e1[_0x1435('0x18')][_0x1435('0x16')]);}})[_0x1435('0x19')](function(_0x5ecd){logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x5ecd);_0x4d04c7(_0x5ecd);});});}exports[_0x1435('0x1a')]=function(_0x430367){var _0x19c9fe=this;return new Promise(function(_0x68f503,_0xb6995b){return db[_0x1435('0x1b')]['findAll']({'raw':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x430367[_0x1435('0x1c')]?_0x430367['options'][_0x1435('0x1d')]||null:null,'attributes':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')][_0x1435('0x1e')]||null:null,'limit':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')]['limit']||null:null,'include':_0x430367[_0x1435('0x1c')]?_0x430367[_0x1435('0x1c')][_0x1435('0x1f')]?_[_0x1435('0x20')](_0x430367[_0x1435('0x1c')][_0x1435('0x1f')],function(_0x302831){return{'model':db[_0x302831[_0x1435('0x21')]],'as':_0x302831['as'],'attributes':_0x302831[_0x1435('0x1e')],'include':_0x302831[_0x1435('0x1f')]?_[_0x1435('0x20')](_0x302831['include'],function(_0x523792){return{'model':db[_0x523792[_0x1435('0x21')]],'as':_0x523792['as'],'attributes':_0x523792[_0x1435('0x1e')],'include':_0x523792[_0x1435('0x1f')]?_['map'](_0x523792[_0x1435('0x1f')],function(_0x25cf29){return{'model':db[_0x25cf29[_0x1435('0x21')]],'as':_0x25cf29['as'],'attributes':_0x25cf29[_0x1435('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1435('0xf')](function(_0x5966ef){logger[_0x1435('0x10')](_0x1435('0x1a'),_0x430367);logger[_0x1435('0x12')](_0x1435('0x1a'),_0x430367,JSON[_0x1435('0x22')](_0x5966ef));_0x68f503(_0x5966ef);})[_0x1435('0x19')](function(_0x2e0e72){logger['error'](_0x1435('0x1a'),_0x2e0e72[_0x1435('0x16')],_0x430367);_0xb6995b(_0x19c9fe[_0x1435('0x14')](0x1f4,_0x2e0e72[_0x1435('0x16')]));});});};exports[_0x1435('0x23')]=function(_0x49649f){var _0x38606a=this;return new Promise(function(_0x2ed478,_0xab53ee){return db[_0x1435('0x1b')]['find']({'raw':_0x49649f[_0x1435('0x1c')]?_0x49649f[_0x1435('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x49649f[_0x1435('0x1c')]?_0x49649f['options'][_0x1435('0x1d')]||null:null,'attributes':_0x49649f[_0x1435('0x1c')]?_0x49649f['options'][_0x1435('0x1e')]||null:null,'include':_0x49649f[_0x1435('0x1c')]?_0x49649f['options']['include']?_['map'](_0x49649f[_0x1435('0x1c')]['include'],function(_0x9808e1){return{'model':db[_0x9808e1['model']],'as':_0x9808e1['as'],'attributes':_0x9808e1[_0x1435('0x1e')],'include':_0x9808e1['include']?_[_0x1435('0x20')](_0x9808e1[_0x1435('0x1f')],function(_0x249edc){return{'model':db[_0x249edc[_0x1435('0x21')]],'as':_0x249edc['as'],'attributes':_0x249edc[_0x1435('0x1e')],'include':_0x249edc[_0x1435('0x1f')]?_['map'](_0x249edc[_0x1435('0x1f')],function(_0x138597){return{'model':db[_0x138597[_0x1435('0x21')]],'as':_0x138597['as'],'attributes':_0x138597[_0x1435('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1435('0xf')](function(_0x592e22){logger[_0x1435('0x10')]('ShowDynamics365Account',_0x49649f);logger[_0x1435('0x12')](_0x1435('0x23'),_0x49649f,JSON['stringify'](_0x592e22));_0x2ed478(_0x592e22);})[_0x1435('0x19')](function(_0x2061b9){logger[_0x1435('0x14')](_0x1435('0x23'),_0x2061b9[_0x1435('0x16')],_0x49649f);_0xab53ee(_0x38606a[_0x1435('0x14')](0x1f4,_0x2061b9[_0x1435('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1caaf3f..343c5ce 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 _0x9f33=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9f33,0xaf));var _0x39f3=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0x9f33[_0x524bf9];return _0x550148;};'use strict';var multer=require(_0x39f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x39f3('0x1'));var express=require(_0x39f3('0x2'));var router=express[_0x39f3('0x3')]();var auth=require(_0x39f3('0x4'));var interaction=require(_0x39f3('0x5'));var config=require(_0x39f3('0x6'));var controller=require(_0x39f3('0x7'));router[_0x39f3('0x8')]('/',auth[_0x39f3('0x9')](),controller['index']);router[_0x39f3('0x8')](_0x39f3('0xa'),auth['isAuthenticated'](),controller[_0x39f3('0xb')]);router[_0x39f3('0x8')](_0x39f3('0xc'),auth[_0x39f3('0x9')](),controller['getFields']);router[_0x39f3('0x8')](_0x39f3('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x39f3('0xe'),auth[_0x39f3('0x9')](),controller[_0x39f3('0xf')]);router['post']('/',auth[_0x39f3('0x9')](),controller[_0x39f3('0x10')]);router[_0x39f3('0x11')](_0x39f3('0xa'),auth[_0x39f3('0x9')](),controller[_0x39f3('0x12')]);router[_0x39f3('0x13')](_0x39f3('0xa'),auth[_0x39f3('0x9')](),controller[_0x39f3('0x14')]);module[_0x39f3('0x15')]=router; \ No newline at end of file +var _0x5560=['post','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x5560,0x89));var _0x0556=function(_0x4c6d86,_0x2db9e6){_0x4c6d86=_0x4c6d86-0x0;var _0x376d24=_0x5560[_0x4c6d86];return _0x376d24;};'use strict';var multer=require(_0x0556('0x0'));var util=require(_0x0556('0x1'));var path=require(_0x0556('0x2'));var timeout=require(_0x0556('0x3'));var express=require('express');var router=express[_0x0556('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0556('0x5'));var config=require('../../config/environment');var controller=require(_0x0556('0x6'));router['get']('/',auth[_0x0556('0x7')](),controller[_0x0556('0x8')]);router['get'](_0x0556('0x9'),auth[_0x0556('0x7')](),controller['show']);router[_0x0556('0xa')](_0x0556('0xb'),auth[_0x0556('0x7')](),controller[_0x0556('0xc')]);router[_0x0556('0xa')](_0x0556('0xd'),auth[_0x0556('0x7')](),controller[_0x0556('0xe')]);router['get'](_0x0556('0xf'),auth['isAuthenticated'](),controller[_0x0556('0x10')]);router[_0x0556('0x11')]('/',auth[_0x0556('0x7')](),controller[_0x0556('0x12')]);router[_0x0556('0x13')](_0x0556('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x0556('0x14')](_0x0556('0x9'),auth[_0x0556('0x7')](),controller['destroy']);module[_0x0556('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 86f34ce..e283958 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 _0x9451=['STRING','ENUM','incident','sequelize','exports'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x9451,0x12f));var _0x1945=function(_0x329c8f,_0x2ce78c){_0x329c8f=_0x329c8f-0x0;var _0x1644bd=_0x9451[_0x329c8f];return _0x1644bd;};'use strict';var Sequelize=require(_0x1945('0x0'));module[_0x1945('0x1')]={'name':{'type':Sequelize[_0x1945('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x1945('0x3')](_0x1945('0x4'),'phonecall'),'defaultValue':_0x1945('0x4')}}; \ No newline at end of file +var _0x6c19=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x32dc49,_0x112ae2){var _0x169742=function(_0x3c53d8){while(--_0x3c53d8){_0x32dc49['push'](_0x32dc49['shift']());}};_0x169742(++_0x112ae2);}(_0x6c19,0xaf));var _0x96c1=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x6c19[_0x4e9d3c];return _0x2d0825;};'use strict';var Sequelize=require(_0x96c1('0x0'));module[_0x96c1('0x1')]={'name':{'type':Sequelize[_0x96c1('0x2')]},'description':{'type':Sequelize[_0x96c1('0x2')]},'ticketType':{'type':Sequelize[_0x96c1('0x3')](_0x96c1('0x4'),_0x96c1('0x5')),'defaultValue':_0x96c1('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 400dc3c..30996f6 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 _0x1eb6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../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','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x260a00,_0x2aa098){var _0x33a78b=function(_0x63f550){while(--_0x63f550){_0x260a00['push'](_0x260a00['shift']());}};_0x33a78b(++_0x2aa098);}(_0x1eb6,0xbe));var _0x61eb=function(_0xe5c685,_0x10057f){_0xe5c685=_0xe5c685-0x0;var _0xfb4c85=_0x1eb6[_0xe5c685];return _0xfb4c85;};'use strict';var pdf=require(_0x61eb('0x0'));var emlformat=require(_0x61eb('0x1'));var rimraf=require(_0x61eb('0x2'));var zipdir=require(_0x61eb('0x3'));var jsonpatch=require(_0x61eb('0x4'));var rp=require(_0x61eb('0x5'));var moment=require(_0x61eb('0x6'));var BPromise=require(_0x61eb('0x7'));var Mustache=require(_0x61eb('0x8'));var util=require(_0x61eb('0x9'));var path=require(_0x61eb('0xa'));var sox=require(_0x61eb('0xb'));var csv=require(_0x61eb('0xc'));var ejs=require(_0x61eb('0xd'));var fs=require('fs');var _=require(_0x61eb('0xe'));var squel=require(_0x61eb('0xf'));var crypto=require('crypto');var jsforce=require(_0x61eb('0x10'));var deskjs=require(_0x61eb('0x11'));var toCsv=require(_0x61eb('0xc'));var querystring=require(_0x61eb('0x12'));var Papa=require(_0x61eb('0x13'));var Redis=require('ioredis');var authService=require(_0x61eb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x61eb('0x15'));var hardwareService=require(_0x61eb('0x16'));var logger=require(_0x61eb('0x17'))('api');var utils=require(_0x61eb('0x18'));var config=require('../../config/environment');var db=require(_0x61eb('0x19'))['db'];var jayson=require(_0x61eb('0x1a'));var client=jayson[_0x61eb('0x1b')][_0x61eb('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x598503,_0x5add20,_0x95e6cf){if(_0x95e6cf){var _0x331bd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x331bd7[_0x61eb('0x1d')](_0x5add20)){return _0x598503;}else{throw new db[(_0x61eb('0x1e'))][(_0x61eb('0x1f'))](_0x61eb('0x20'));}}else{return _0x598503;}}function respondWithRpcPromise(_0x60ffd7,_0x5ca957,_0x85da26,_0x5ae79c){return new BPromise(function(_0x864f0c,_0x30f663){var _0x4ff524=_0x5ae79c||client;return _0x4ff524[_0x61eb('0x21')](_0x60ffd7,_0x85da26)['then'](function(_0x4c49aa){logger[_0x61eb('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5ca957,_0x61eb('0x23'));logger[_0x61eb('0x24')](_0x61eb('0x25'),_0x5ca957,_0x61eb('0x23'),JSON[_0x61eb('0x26')](_0x4c49aa));if(_0x4c49aa[_0x61eb('0x27')]){if(_0x4c49aa[_0x61eb('0x27')]['code']===0x1f4){logger[_0x61eb('0x27')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5ca957,_0x4c49aa[_0x61eb('0x27')][_0x61eb('0x28')]);return _0x30f663(_0x4c49aa[_0x61eb('0x27')][_0x61eb('0x28')]);}logger[_0x61eb('0x27')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5ca957,_0x4c49aa['error'][_0x61eb('0x28')]);return _0x864f0c(_0x4c49aa[_0x61eb('0x27')][_0x61eb('0x28')]);}else{logger[_0x61eb('0x22')](_0x61eb('0x29'),_0x5ca957,_0x61eb('0x23'));_0x864f0c(_0x4c49aa[_0x61eb('0x2a')][_0x61eb('0x28')]);}})[_0x61eb('0x2b')](function(_0x18b3e2){logger[_0x61eb('0x27')](_0x61eb('0x29'),_0x5ca957,_0x18b3e2);_0x30f663(_0x18b3e2);});});}function respondWithStatusCode(_0x25d371,_0x28e1e0){_0x28e1e0=_0x28e1e0||0xcc;return function(_0x3af6c6){if(_0x3af6c6){return _0x25d371[_0x61eb('0x2c')](_0x28e1e0);}return _0x25d371[_0x61eb('0x2d')](_0x28e1e0)[_0x61eb('0x2e')]();};}function respondWithResult(_0x3da84e,_0xf56d5d){_0xf56d5d=_0xf56d5d||0xc8;return function(_0xb6ddc3){if(_0xb6ddc3){return _0x3da84e[_0x61eb('0x2d')](_0xf56d5d)['json'](_0xb6ddc3);}};}function respondWithFilteredResult(_0x4b3c4b,_0x5d6696){return function(_0x3e296b){if(_0x3e296b){var _0x5619d1=_0x3e296b[_0x61eb('0x2f')],_0x547bc6=_0x5d6696['offset'],_0x398be7=_0x5d6696[_0x61eb('0x30')]+_0x5d6696[_0x61eb('0x31')],_0x457607;if(_0x398be7>=_0x5619d1){_0x398be7=_0x5619d1;_0x457607=0xc8;}else{_0x457607=0xce;}_0x4b3c4b['status'](_0x457607);return _0x4b3c4b[_0x61eb('0x32')](_0x61eb('0x33'),_0x547bc6+'-'+_0x398be7+'/'+_0x5619d1)['json'](_0x3e296b);}return null;};}function patchUpdates(_0x34379b){return function(_0x42372c){try{jsonpatch[_0x61eb('0x34')](_0x42372c,_0x34379b,!![]);}catch(_0x4127d7){return BPromise[_0x61eb('0x35')](_0x4127d7);}return _0x42372c['save']();};}function saveUpdates(_0x32d8d3,_0x453403){return function(_0x3e8185){if(_0x3e8185){return _0x3e8185[_0x61eb('0x36')](_0x32d8d3)['then'](function(_0x13cfd8){return _0x13cfd8;});}return null;};}function removeEntity(_0x3a4d92,_0x5c8784){return function(_0x3f1393){if(_0x3f1393){return _0x3f1393[_0x61eb('0x37')]()[_0x61eb('0x38')](function(){_0x3a4d92[_0x61eb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407d50,_0x5788f0){return function(_0x592604){if(!_0x592604){_0x407d50[_0x61eb('0x2c')](0x194);}return _0x592604;};}function handleError(_0x939084,_0x10a3c4){_0x10a3c4=_0x10a3c4||0x1f4;return function(_0x116915){logger[_0x61eb('0x27')](_0x116915[_0x61eb('0x39')]);if(_0x116915[_0x61eb('0x3a')]){delete _0x116915[_0x61eb('0x3a')];}_0x939084['status'](_0x10a3c4)['send'](_0x116915);};}exports[_0x61eb('0x3b')]=function(_0x413c0e,_0x223237){var _0xbe771f={},_0x128aee={},_0x7c1407={'count':0x0,'rows':[]};var _0x544044=_[_0x61eb('0x3c')](db[_0x61eb('0x3d')][_0x61eb('0x3e')],function(_0x4360d0){return{'name':_0x4360d0[_0x61eb('0x3f')],'type':_0x4360d0[_0x61eb('0x40')]['key']};});_0x128aee['model']=_[_0x61eb('0x3c')](_0x544044,_0x61eb('0x3a'));_0x128aee['query']=_[_0x61eb('0x41')](_0x413c0e[_0x61eb('0x42')]);_0x128aee[_0x61eb('0x43')]=_[_0x61eb('0x44')](_0x128aee[_0x61eb('0x45')],_0x128aee['query']);_0xbe771f[_0x61eb('0x46')]=_[_0x61eb('0x44')](_0x128aee[_0x61eb('0x45')],qs['fields'](_0x413c0e[_0x61eb('0x42')]['fields']));_0xbe771f[_0x61eb('0x46')]=_0xbe771f[_0x61eb('0x46')][_0x61eb('0x47')]?_0xbe771f[_0x61eb('0x46')]:_0x128aee[_0x61eb('0x45')];if(!_0x413c0e[_0x61eb('0x42')][_0x61eb('0x48')](_0x61eb('0x49'))){_0xbe771f[_0x61eb('0x31')]=qs[_0x61eb('0x31')](_0x413c0e[_0x61eb('0x42')]['limit']);_0xbe771f[_0x61eb('0x30')]=qs[_0x61eb('0x30')](_0x413c0e[_0x61eb('0x42')]['offset']);}_0xbe771f[_0x61eb('0x4a')]=qs[_0x61eb('0x4b')](_0x413c0e[_0x61eb('0x42')][_0x61eb('0x4b')]);_0xbe771f[_0x61eb('0x4c')]=qs[_0x61eb('0x43')](_[_0x61eb('0x4d')](_0x413c0e[_0x61eb('0x42')],_0x128aee['filters']),_0x544044);if(_0x413c0e[_0x61eb('0x42')][_0x61eb('0x4e')]){_0xbe771f[_0x61eb('0x4c')]=_[_0x61eb('0x4f')](_0xbe771f['where'],{'$or':_[_0x61eb('0x3c')](_0x544044,function(_0x3ad987){if(_0x3ad987['type']!==_0x61eb('0x50')){var _0x3723c1={};_0x3723c1[_0x3ad987[_0x61eb('0x3a')]]={'$like':'%'+_0x413c0e[_0x61eb('0x42')]['filter']+'%'};return _0x3723c1;}})});}_0xbe771f=_[_0x61eb('0x4f')]({},_0xbe771f,_0x413c0e[_0x61eb('0x51')]);var _0x3fdf29={'where':_0xbe771f[_0x61eb('0x4c')]};return db[_0x61eb('0x3d')]['count'](_0x3fdf29)[_0x61eb('0x38')](function(_0x387975){_0x7c1407[_0x61eb('0x2f')]=_0x387975;if(_0x413c0e[_0x61eb('0x42')][_0x61eb('0x52')]){_0xbe771f[_0x61eb('0x53')]=[{'all':!![]}];}return db[_0x61eb('0x3d')][_0x61eb('0x54')](_0xbe771f);})['then'](function(_0x1f81cc){_0x7c1407[_0x61eb('0x55')]=_0x1f81cc;return _0x7c1407;})[_0x61eb('0x38')](respondWithFilteredResult(_0x223237,_0xbe771f))[_0x61eb('0x2b')](handleError(_0x223237,null));};exports[_0x61eb('0x56')]=function(_0x4aee96,_0x27b850){var _0x48d96e={'raw':![],'where':{'id':_0x4aee96[_0x61eb('0x57')]['id']}},_0x4b97ad={};_0x4b97ad[_0x61eb('0x45')]=_[_0x61eb('0x41')](db['Dynamics365Configuration'][_0x61eb('0x3e')]);_0x4b97ad[_0x61eb('0x42')]=_[_0x61eb('0x41')](_0x4aee96[_0x61eb('0x42')]);_0x4b97ad[_0x61eb('0x43')]=_['intersection'](_0x4b97ad['model'],_0x4b97ad[_0x61eb('0x42')]);_0x48d96e[_0x61eb('0x46')]=_[_0x61eb('0x44')](_0x4b97ad[_0x61eb('0x45')],qs[_0x61eb('0x58')](_0x4aee96[_0x61eb('0x42')]['fields']));_0x48d96e['attributes']=_0x48d96e[_0x61eb('0x46')][_0x61eb('0x47')]?_0x48d96e[_0x61eb('0x46')]:_0x4b97ad[_0x61eb('0x45')];if(_0x4aee96[_0x61eb('0x42')][_0x61eb('0x52')]){_0x48d96e[_0x61eb('0x53')]=[{'all':!![]}];}_0x48d96e=_[_0x61eb('0x4f')]({},_0x48d96e,_0x4aee96[_0x61eb('0x51')]);return db['Dynamics365Configuration'][_0x61eb('0x59')](_0x48d96e)[_0x61eb('0x38')](handleEntityNotFound(_0x27b850,null))[_0x61eb('0x38')](respondWithResult(_0x27b850,null))[_0x61eb('0x2b')](handleError(_0x27b850,null));};exports[_0x61eb('0x5a')]=function(_0x4f99c4,_0x412650){return db[_0x61eb('0x3d')][_0x61eb('0x5a')](_0x4f99c4['body'],{})[_0x61eb('0x38')](respondWithResult(_0x412650,0xc9))[_0x61eb('0x2b')](handleError(_0x412650,null));};exports[_0x61eb('0x36')]=function(_0x2846c4,_0x35917a){if(_0x2846c4[_0x61eb('0x5b')]['id']){delete _0x2846c4[_0x61eb('0x5b')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x2846c4['params']['id']}})[_0x61eb('0x38')](handleEntityNotFound(_0x35917a,null))[_0x61eb('0x38')](saveUpdates(_0x2846c4[_0x61eb('0x5b')],null))[_0x61eb('0x38')](respondWithResult(_0x35917a,null))[_0x61eb('0x2b')](handleError(_0x35917a,null));};exports[_0x61eb('0x37')]=function(_0x47f66a,_0x3ac257){return db[_0x61eb('0x3d')][_0x61eb('0x59')]({'where':{'id':_0x47f66a[_0x61eb('0x57')]['id']}})[_0x61eb('0x38')](handleEntityNotFound(_0x3ac257,null))[_0x61eb('0x38')](removeEntity(_0x3ac257,null))[_0x61eb('0x2b')](handleError(_0x3ac257,null));};exports[_0x61eb('0x5c')]=function(_0xdf437b,_0x790881,_0x551c37){var _0x359306={};var _0x4488fa={};var _0x34ce3e;var _0x55da0d;return db[_0x61eb('0x3d')][_0x61eb('0x5d')]({'where':{'id':_0xdf437b[_0x61eb('0x57')]['id']}})[_0x61eb('0x38')](handleEntityNotFound(_0x790881,null))[_0x61eb('0x38')](function(_0x2f9591){if(_0x2f9591){_0x34ce3e=_0x2f9591;_0x4488fa[_0x61eb('0x45')]=_[_0x61eb('0x41')](db[_0x61eb('0x5e')][_0x61eb('0x3e')]);_0x4488fa[_0x61eb('0x42')]=_['keys'](_0xdf437b[_0x61eb('0x42')]);_0x4488fa[_0x61eb('0x43')]=_['intersection'](_0x4488fa[_0x61eb('0x45')],_0x4488fa[_0x61eb('0x42')]);_0x359306['attributes']=_[_0x61eb('0x44')](_0x4488fa[_0x61eb('0x45')],qs[_0x61eb('0x58')](_0xdf437b[_0x61eb('0x42')]['fields']));_0x359306[_0x61eb('0x46')]=_0x359306[_0x61eb('0x46')][_0x61eb('0x47')]?_0x359306[_0x61eb('0x46')]:_0x4488fa[_0x61eb('0x45')];_0x359306[_0x61eb('0x4a')]=qs[_0x61eb('0x4b')](_0xdf437b['query'][_0x61eb('0x4b')]);_0x359306[_0x61eb('0x4c')]=qs[_0x61eb('0x43')](_['pick'](_0xdf437b[_0x61eb('0x42')],_0x4488fa[_0x61eb('0x43')]));if(_0xdf437b[_0x61eb('0x42')][_0x61eb('0x4e')]){_0x359306[_0x61eb('0x4c')]=_[_0x61eb('0x4f')](_0x359306[_0x61eb('0x4c')],{'$or':_['map'](_0x359306[_0x61eb('0x46')],function(_0x1a8e04){var _0x455c42={};_0x455c42[_0x1a8e04]={'$like':'%'+_0xdf437b['query'][_0x61eb('0x4e')]+'%'};return _0x455c42;})});}_0x359306=_[_0x61eb('0x4f')]({},_0x359306,_0xdf437b['options']);return _0x34ce3e['getFields'](_0x359306);}})['then'](function(_0x24a7a8){if(_0x24a7a8){_0x55da0d=_0x24a7a8[_0x61eb('0x47')];if(!_0xdf437b[_0x61eb('0x42')]['hasOwnProperty'](_0x61eb('0x49'))){_0x359306[_0x61eb('0x31')]=qs[_0x61eb('0x31')](_0xdf437b[_0x61eb('0x42')][_0x61eb('0x31')]);_0x359306[_0x61eb('0x30')]=qs[_0x61eb('0x30')](_0xdf437b[_0x61eb('0x42')]['offset']);}return _0x34ce3e['getFields'](_0x359306);}})[_0x61eb('0x38')](function(_0x36b1d2){if(_0x36b1d2){return _0x36b1d2?{'count':_0x55da0d,'rows':_0x36b1d2}:null;}})['then'](respondWithResult(_0x790881,null))[_0x61eb('0x2b')](handleError(_0x790881,null));};exports[_0x61eb('0x5f')]=function(_0xeadd10,_0xc93f3e,_0x58cba6){var _0x225ebd={};var _0x4a9947={};var _0x13226e;var _0x50c2aa;return db[_0x61eb('0x3d')][_0x61eb('0x5d')]({'where':{'id':_0xeadd10['params']['id']}})[_0x61eb('0x38')](handleEntityNotFound(_0xc93f3e,null))[_0x61eb('0x38')](function(_0x6782c){if(_0x6782c){_0x13226e=_0x6782c;_0x4a9947[_0x61eb('0x45')]=_[_0x61eb('0x41')](db[_0x61eb('0x5e')][_0x61eb('0x3e')]);_0x4a9947[_0x61eb('0x42')]=_[_0x61eb('0x41')](_0xeadd10[_0x61eb('0x42')]);_0x4a9947[_0x61eb('0x43')]=_[_0x61eb('0x44')](_0x4a9947[_0x61eb('0x45')],_0x4a9947['query']);_0x225ebd[_0x61eb('0x46')]=_[_0x61eb('0x44')](_0x4a9947[_0x61eb('0x45')],qs['fields'](_0xeadd10[_0x61eb('0x42')]['fields']));_0x225ebd[_0x61eb('0x46')]=_0x225ebd[_0x61eb('0x46')]['length']?_0x225ebd[_0x61eb('0x46')]:_0x4a9947['model'];_0x225ebd[_0x61eb('0x4a')]=qs[_0x61eb('0x4b')](_0xeadd10[_0x61eb('0x42')]['sort']);_0x225ebd['where']=qs[_0x61eb('0x43')](_[_0x61eb('0x4d')](_0xeadd10[_0x61eb('0x42')],_0x4a9947[_0x61eb('0x43')]));if(_0xeadd10[_0x61eb('0x42')][_0x61eb('0x4e')]){_0x225ebd[_0x61eb('0x4c')]=_[_0x61eb('0x4f')](_0x225ebd[_0x61eb('0x4c')],{'$or':_['map'](_0x225ebd[_0x61eb('0x46')],function(_0x28e561){var _0x1462a2={};_0x1462a2[_0x28e561]={'$like':'%'+_0xeadd10['query'][_0x61eb('0x4e')]+'%'};return _0x1462a2;})});}_0x225ebd=_['merge']({},_0x225ebd,_0xeadd10[_0x61eb('0x51')]);return _0x13226e[_0x61eb('0x5f')](_0x225ebd);}})['then'](function(_0x136965){if(_0x136965){_0x50c2aa=_0x136965[_0x61eb('0x47')];if(!_0xeadd10[_0x61eb('0x42')]['hasOwnProperty'](_0x61eb('0x49'))){_0x225ebd['limit']=qs[_0x61eb('0x31')](_0xeadd10[_0x61eb('0x42')][_0x61eb('0x31')]);_0x225ebd[_0x61eb('0x30')]=qs[_0x61eb('0x30')](_0xeadd10[_0x61eb('0x42')]['offset']);}return _0x13226e[_0x61eb('0x5f')](_0x225ebd);}})['then'](function(_0x79be45){if(_0x79be45){return _0x79be45?{'count':_0x50c2aa,'rows':_0x79be45}:null;}})[_0x61eb('0x38')](respondWithResult(_0xc93f3e,null))[_0x61eb('0x2b')](handleError(_0xc93f3e,null));};exports[_0x61eb('0x60')]=function(_0x5970d3,_0x3ed674,_0x52b49b){var _0x1320e4={};var _0x16f3bf={};var _0x217530;var _0x4b8a0b;return db[_0x61eb('0x3d')][_0x61eb('0x5d')]({'where':{'id':_0x5970d3[_0x61eb('0x57')]['id']}})[_0x61eb('0x38')](handleEntityNotFound(_0x3ed674,null))['then'](function(_0x572578){if(_0x572578){_0x217530=_0x572578;_0x16f3bf[_0x61eb('0x45')]=_[_0x61eb('0x41')](db[_0x61eb('0x5e')][_0x61eb('0x3e')]);_0x16f3bf[_0x61eb('0x42')]=_[_0x61eb('0x41')](_0x5970d3[_0x61eb('0x42')]);_0x16f3bf[_0x61eb('0x43')]=_['intersection'](_0x16f3bf[_0x61eb('0x45')],_0x16f3bf['query']);_0x1320e4['attributes']=_[_0x61eb('0x44')](_0x16f3bf[_0x61eb('0x45')],qs['fields'](_0x5970d3['query'][_0x61eb('0x58')]));_0x1320e4['attributes']=_0x1320e4[_0x61eb('0x46')][_0x61eb('0x47')]?_0x1320e4[_0x61eb('0x46')]:_0x16f3bf[_0x61eb('0x45')];_0x1320e4[_0x61eb('0x4a')]=qs['sort'](_0x5970d3[_0x61eb('0x42')][_0x61eb('0x4b')]);_0x1320e4[_0x61eb('0x4c')]=qs[_0x61eb('0x43')](_[_0x61eb('0x4d')](_0x5970d3['query'],_0x16f3bf[_0x61eb('0x43')]));if(_0x5970d3[_0x61eb('0x42')]['filter']){_0x1320e4[_0x61eb('0x4c')]=_[_0x61eb('0x4f')](_0x1320e4[_0x61eb('0x4c')],{'$or':_[_0x61eb('0x3c')](_0x1320e4[_0x61eb('0x46')],function(_0x3dc194){var _0x4f57c0={};_0x4f57c0[_0x3dc194]={'$like':'%'+_0x5970d3[_0x61eb('0x42')][_0x61eb('0x4e')]+'%'};return _0x4f57c0;})});}_0x1320e4=_[_0x61eb('0x4f')]({},_0x1320e4,_0x5970d3['options']);return _0x217530[_0x61eb('0x60')](_0x1320e4);}})[_0x61eb('0x38')](function(_0x3da0a1){if(_0x3da0a1){_0x4b8a0b=_0x3da0a1[_0x61eb('0x47')];if(!_0x5970d3[_0x61eb('0x42')]['hasOwnProperty'](_0x61eb('0x49'))){_0x1320e4[_0x61eb('0x31')]=qs[_0x61eb('0x31')](_0x5970d3['query']['limit']);_0x1320e4[_0x61eb('0x30')]=qs[_0x61eb('0x30')](_0x5970d3[_0x61eb('0x42')][_0x61eb('0x30')]);}return _0x217530[_0x61eb('0x60')](_0x1320e4);}})[_0x61eb('0x38')](function(_0x1206f8){if(_0x1206f8){return _0x1206f8?{'count':_0x4b8a0b,'rows':_0x1206f8}:null;}})[_0x61eb('0x38')](respondWithResult(_0x3ed674,null))[_0x61eb('0x2b')](handleError(_0x3ed674,null));}; \ No newline at end of file +var _0x32d4=['VIRTUAL','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','Dynamics365Field','rawAttributes','filter','hasOwnProperty','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','destroy','stack','name','index','map','Dynamics365Configuration','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick'];(function(_0xbf4b2f,_0x6a2f08){var _0x8a1a41=function(_0xc87def){while(--_0xc87def){_0xbf4b2f['push'](_0xbf4b2f['shift']());}};_0x8a1a41(++_0x6a2f08);}(_0x32d4,0x72));var _0x432d=function(_0x41c537,_0x146f80){_0x41c537=_0x41c537-0x0;var _0x30ad13=_0x32d4[_0x41c537];return _0x30ad13;};'use strict';var pdf=require(_0x432d('0x0'));var emlformat=require(_0x432d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x432d('0x2'));var jsonpatch=require(_0x432d('0x3'));var rp=require(_0x432d('0x4'));var moment=require(_0x432d('0x5'));var BPromise=require(_0x432d('0x6'));var Mustache=require(_0x432d('0x7'));var util=require(_0x432d('0x8'));var path=require(_0x432d('0x9'));var sox=require(_0x432d('0xa'));var csv=require(_0x432d('0xb'));var ejs=require(_0x432d('0xc'));var fs=require('fs');var _=require(_0x432d('0xd'));var squel=require(_0x432d('0xe'));var crypto=require(_0x432d('0xf'));var jsforce=require(_0x432d('0x10'));var deskjs=require(_0x432d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x432d('0x12'));var Papa=require(_0x432d('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x432d('0x14'));var as=require(_0x432d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x432d('0x16'));var utils=require(_0x432d('0x17'));var config=require(_0x432d('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x432d('0x19')][_0x432d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x59e6a6,_0x5d983b,_0x4c7cb7){if(_0x4c7cb7){var _0x118666=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x118666[_0x432d('0x1b')](_0x5d983b)){return _0x59e6a6;}else{throw new db[(_0x432d('0x1c'))][(_0x432d('0x1d'))](_0x432d('0x1e'));}}else{return _0x59e6a6;}}function respondWithRpcPromise(_0x1434a8,_0x399af4,_0xdd86e8,_0x799803){return new BPromise(function(_0x83c0a5,_0xe5c600){var _0x1c8ca2=_0x799803||client;return _0x1c8ca2[_0x432d('0x1f')](_0x1434a8,_0xdd86e8)[_0x432d('0x20')](function(_0x28c3d3){logger[_0x432d('0x21')](_0x432d('0x22'),_0x399af4,_0x432d('0x23'));logger[_0x432d('0x24')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x399af4,_0x432d('0x23'),JSON[_0x432d('0x25')](_0x28c3d3));if(_0x28c3d3[_0x432d('0x26')]){if(_0x28c3d3[_0x432d('0x26')][_0x432d('0x27')]===0x1f4){logger['error'](_0x432d('0x22'),_0x399af4,_0x28c3d3[_0x432d('0x26')][_0x432d('0x28')]);return _0xe5c600(_0x28c3d3[_0x432d('0x26')][_0x432d('0x28')]);}logger[_0x432d('0x26')](_0x432d('0x22'),_0x399af4,_0x28c3d3['error'][_0x432d('0x28')]);return _0x83c0a5(_0x28c3d3[_0x432d('0x26')][_0x432d('0x28')]);}else{logger[_0x432d('0x21')](_0x432d('0x22'),_0x399af4,_0x432d('0x23'));_0x83c0a5(_0x28c3d3[_0x432d('0x29')]['message']);}})[_0x432d('0x2a')](function(_0x17e8f3){logger[_0x432d('0x26')](_0x432d('0x22'),_0x399af4,_0x17e8f3);_0xe5c600(_0x17e8f3);});});}function respondWithStatusCode(_0x1a74da,_0x26094b){_0x26094b=_0x26094b||0xcc;return function(_0x35eda6){if(_0x35eda6){return _0x1a74da[_0x432d('0x2b')](_0x26094b);}return _0x1a74da[_0x432d('0x2c')](_0x26094b)[_0x432d('0x2d')]();};}function respondWithResult(_0x4c7692,_0x3803db){_0x3803db=_0x3803db||0xc8;return function(_0xb799ae){if(_0xb799ae){return _0x4c7692['status'](_0x3803db)['json'](_0xb799ae);}};}function respondWithFilteredResult(_0x147856,_0x5b84f6){return function(_0x5b809f){if(_0x5b809f){var _0x273f26=_0x5b809f[_0x432d('0x2e')],_0x3c6feb=_0x5b84f6[_0x432d('0x2f')],_0xc14dda=_0x5b84f6[_0x432d('0x2f')]+_0x5b84f6[_0x432d('0x30')],_0x5e57c1;if(_0xc14dda>=_0x273f26){_0xc14dda=_0x273f26;_0x5e57c1=0xc8;}else{_0x5e57c1=0xce;}_0x147856[_0x432d('0x2c')](_0x5e57c1);return _0x147856[_0x432d('0x31')](_0x432d('0x32'),_0x3c6feb+'-'+_0xc14dda+'/'+_0x273f26)['json'](_0x5b809f);}return null;};}function patchUpdates(_0x440ea9){return function(_0xa60e69){try{jsonpatch['apply'](_0xa60e69,_0x440ea9,!![]);}catch(_0x3a5881){return BPromise['reject'](_0x3a5881);}return _0xa60e69[_0x432d('0x33')]();};}function saveUpdates(_0x4fc4df,_0x4ba15f){return function(_0x489a2d){if(_0x489a2d){return _0x489a2d[_0x432d('0x34')](_0x4fc4df)[_0x432d('0x20')](function(_0xd7c8af){return _0xd7c8af;});}return null;};}function removeEntity(_0x457d6d,_0xae22d0){return function(_0x1a53e5){if(_0x1a53e5){return _0x1a53e5[_0x432d('0x35')]()['then'](function(){_0x457d6d['status'](0xcc)[_0x432d('0x2d')]();});}};}function handleEntityNotFound(_0x323e8a,_0x4fe4b7){return function(_0x157758){if(!_0x157758){_0x323e8a[_0x432d('0x2b')](0x194);}return _0x157758;};}function handleError(_0x33f1b2,_0x241aea){_0x241aea=_0x241aea||0x1f4;return function(_0x131a5f){logger[_0x432d('0x26')](_0x131a5f[_0x432d('0x36')]);if(_0x131a5f['name']){delete _0x131a5f[_0x432d('0x37')];}_0x33f1b2[_0x432d('0x2c')](_0x241aea)['send'](_0x131a5f);};}exports[_0x432d('0x38')]=function(_0x14122b,_0x16df8d){var _0x5ef636={},_0x5f3e44={},_0x2a9113={'count':0x0,'rows':[]};var _0x2acab9=_[_0x432d('0x39')](db[_0x432d('0x3a')]['rawAttributes'],function(_0x52544c){return{'name':_0x52544c[_0x432d('0x3b')],'type':_0x52544c[_0x432d('0x3c')][_0x432d('0x3d')]};});_0x5f3e44[_0x432d('0x3e')]=_[_0x432d('0x39')](_0x2acab9,_0x432d('0x37'));_0x5f3e44['query']=_[_0x432d('0x3f')](_0x14122b[_0x432d('0x40')]);_0x5f3e44[_0x432d('0x41')]=_['intersection'](_0x5f3e44[_0x432d('0x3e')],_0x5f3e44[_0x432d('0x40')]);_0x5ef636[_0x432d('0x42')]=_[_0x432d('0x43')](_0x5f3e44['model'],qs['fields'](_0x14122b[_0x432d('0x40')][_0x432d('0x44')]));_0x5ef636[_0x432d('0x42')]=_0x5ef636[_0x432d('0x42')][_0x432d('0x45')]?_0x5ef636['attributes']:_0x5f3e44[_0x432d('0x3e')];if(!_0x14122b[_0x432d('0x40')]['hasOwnProperty']('nolimit')){_0x5ef636[_0x432d('0x30')]=qs[_0x432d('0x30')](_0x14122b[_0x432d('0x40')][_0x432d('0x30')]);_0x5ef636[_0x432d('0x2f')]=qs[_0x432d('0x2f')](_0x14122b['query'][_0x432d('0x2f')]);}_0x5ef636[_0x432d('0x46')]=qs[_0x432d('0x47')](_0x14122b['query'][_0x432d('0x47')]);_0x5ef636[_0x432d('0x48')]=qs[_0x432d('0x41')](_[_0x432d('0x49')](_0x14122b[_0x432d('0x40')],_0x5f3e44[_0x432d('0x41')]),_0x2acab9);if(_0x14122b['query']['filter']){_0x5ef636[_0x432d('0x48')]=_['merge'](_0x5ef636[_0x432d('0x48')],{'$or':_['map'](_0x2acab9,function(_0xdaaf6f){if(_0xdaaf6f[_0x432d('0x3c')]!==_0x432d('0x4a')){var _0x5c8b75={};_0x5c8b75[_0xdaaf6f['name']]={'$like':'%'+_0x14122b[_0x432d('0x40')]['filter']+'%'};return _0x5c8b75;}})});}_0x5ef636=_[_0x432d('0x4b')]({},_0x5ef636,_0x14122b[_0x432d('0x4c')]);var _0x48a4df={'where':_0x5ef636[_0x432d('0x48')]};return db[_0x432d('0x3a')][_0x432d('0x2e')](_0x48a4df)[_0x432d('0x20')](function(_0xac7532){_0x2a9113[_0x432d('0x2e')]=_0xac7532;if(_0x14122b[_0x432d('0x40')][_0x432d('0x4d')]){_0x5ef636[_0x432d('0x4e')]=[{'all':!![]}];}return db[_0x432d('0x3a')][_0x432d('0x4f')](_0x5ef636);})['then'](function(_0x20b5d0){_0x2a9113[_0x432d('0x50')]=_0x20b5d0;return _0x2a9113;})[_0x432d('0x20')](respondWithFilteredResult(_0x16df8d,_0x5ef636))[_0x432d('0x2a')](handleError(_0x16df8d,null));};exports['show']=function(_0x15fe69,_0x4decd0){var _0x27716e={'raw':![],'where':{'id':_0x15fe69[_0x432d('0x51')]['id']}},_0xfcaff3={};_0xfcaff3[_0x432d('0x3e')]=_['keys'](db[_0x432d('0x3a')]['rawAttributes']);_0xfcaff3[_0x432d('0x40')]=_[_0x432d('0x3f')](_0x15fe69[_0x432d('0x40')]);_0xfcaff3[_0x432d('0x41')]=_['intersection'](_0xfcaff3['model'],_0xfcaff3[_0x432d('0x40')]);_0x27716e['attributes']=_[_0x432d('0x43')](_0xfcaff3['model'],qs[_0x432d('0x44')](_0x15fe69['query'][_0x432d('0x44')]));_0x27716e[_0x432d('0x42')]=_0x27716e[_0x432d('0x42')][_0x432d('0x45')]?_0x27716e[_0x432d('0x42')]:_0xfcaff3[_0x432d('0x3e')];if(_0x15fe69['query'][_0x432d('0x4d')]){_0x27716e['include']=[{'all':!![]}];}_0x27716e=_[_0x432d('0x4b')]({},_0x27716e,_0x15fe69[_0x432d('0x4c')]);return db[_0x432d('0x3a')]['find'](_0x27716e)[_0x432d('0x20')](handleEntityNotFound(_0x4decd0,null))[_0x432d('0x20')](respondWithResult(_0x4decd0,null))[_0x432d('0x2a')](handleError(_0x4decd0,null));};exports[_0x432d('0x52')]=function(_0x741ad,_0x13a36d){return db['Dynamics365Configuration'][_0x432d('0x52')](_0x741ad['body'],{})[_0x432d('0x20')](respondWithResult(_0x13a36d,0xc9))[_0x432d('0x2a')](handleError(_0x13a36d,null));};exports[_0x432d('0x34')]=function(_0x5f1f81,_0x344aaa){if(_0x5f1f81[_0x432d('0x53')]['id']){delete _0x5f1f81['body']['id'];}return db[_0x432d('0x3a')][_0x432d('0x54')]({'where':{'id':_0x5f1f81['params']['id']}})[_0x432d('0x20')](handleEntityNotFound(_0x344aaa,null))['then'](saveUpdates(_0x5f1f81['body'],null))[_0x432d('0x20')](respondWithResult(_0x344aaa,null))[_0x432d('0x2a')](handleError(_0x344aaa,null));};exports[_0x432d('0x35')]=function(_0x16ecfb,_0x2c40a6){return db['Dynamics365Configuration'][_0x432d('0x54')]({'where':{'id':_0x16ecfb[_0x432d('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c40a6,null))[_0x432d('0x20')](removeEntity(_0x2c40a6,null))['catch'](handleError(_0x2c40a6,null));};exports[_0x432d('0x55')]=function(_0x2a3d5c,_0x47c906,_0x57da05){var _0x149ce4={};var _0x13e6a7={};var _0x2981ea;var _0x5ba5b1;return db[_0x432d('0x3a')][_0x432d('0x56')]({'where':{'id':_0x2a3d5c[_0x432d('0x51')]['id']}})[_0x432d('0x20')](handleEntityNotFound(_0x47c906,null))[_0x432d('0x20')](function(_0x4caf17){if(_0x4caf17){_0x2981ea=_0x4caf17;_0x13e6a7[_0x432d('0x3e')]=_[_0x432d('0x3f')](db[_0x432d('0x57')][_0x432d('0x58')]);_0x13e6a7[_0x432d('0x40')]=_['keys'](_0x2a3d5c[_0x432d('0x40')]);_0x13e6a7[_0x432d('0x41')]=_['intersection'](_0x13e6a7[_0x432d('0x3e')],_0x13e6a7[_0x432d('0x40')]);_0x149ce4[_0x432d('0x42')]=_['intersection'](_0x13e6a7[_0x432d('0x3e')],qs[_0x432d('0x44')](_0x2a3d5c[_0x432d('0x40')][_0x432d('0x44')]));_0x149ce4['attributes']=_0x149ce4['attributes'][_0x432d('0x45')]?_0x149ce4[_0x432d('0x42')]:_0x13e6a7['model'];_0x149ce4[_0x432d('0x46')]=qs[_0x432d('0x47')](_0x2a3d5c[_0x432d('0x40')][_0x432d('0x47')]);_0x149ce4['where']=qs[_0x432d('0x41')](_[_0x432d('0x49')](_0x2a3d5c[_0x432d('0x40')],_0x13e6a7[_0x432d('0x41')]));if(_0x2a3d5c[_0x432d('0x40')][_0x432d('0x59')]){_0x149ce4[_0x432d('0x48')]=_[_0x432d('0x4b')](_0x149ce4[_0x432d('0x48')],{'$or':_[_0x432d('0x39')](_0x149ce4[_0x432d('0x42')],function(_0x893d46){var _0x2cdadf={};_0x2cdadf[_0x893d46]={'$like':'%'+_0x2a3d5c[_0x432d('0x40')][_0x432d('0x59')]+'%'};return _0x2cdadf;})});}_0x149ce4=_[_0x432d('0x4b')]({},_0x149ce4,_0x2a3d5c['options']);return _0x2981ea[_0x432d('0x55')](_0x149ce4);}})[_0x432d('0x20')](function(_0x51835c){if(_0x51835c){_0x5ba5b1=_0x51835c[_0x432d('0x45')];if(!_0x2a3d5c[_0x432d('0x40')][_0x432d('0x5a')](_0x432d('0x5b'))){_0x149ce4[_0x432d('0x30')]=qs[_0x432d('0x30')](_0x2a3d5c['query'][_0x432d('0x30')]);_0x149ce4[_0x432d('0x2f')]=qs['offset'](_0x2a3d5c[_0x432d('0x40')][_0x432d('0x2f')]);}return _0x2981ea[_0x432d('0x55')](_0x149ce4);}})[_0x432d('0x20')](function(_0x41a89c){if(_0x41a89c){return _0x41a89c?{'count':_0x5ba5b1,'rows':_0x41a89c}:null;}})[_0x432d('0x20')](respondWithResult(_0x47c906,null))[_0x432d('0x2a')](handleError(_0x47c906,null));};exports[_0x432d('0x5c')]=function(_0x35e652,_0xe05886,_0x1e70d2){var _0x894b0a={};var _0x4588f4={};var _0x2d6a0c;var _0x12423e;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x35e652[_0x432d('0x51')]['id']}})[_0x432d('0x20')](handleEntityNotFound(_0xe05886,null))[_0x432d('0x20')](function(_0x455823){if(_0x455823){_0x2d6a0c=_0x455823;_0x4588f4[_0x432d('0x3e')]=_[_0x432d('0x3f')](db[_0x432d('0x57')][_0x432d('0x58')]);_0x4588f4[_0x432d('0x40')]=_['keys'](_0x35e652[_0x432d('0x40')]);_0x4588f4[_0x432d('0x41')]=_[_0x432d('0x43')](_0x4588f4[_0x432d('0x3e')],_0x4588f4[_0x432d('0x40')]);_0x894b0a[_0x432d('0x42')]=_[_0x432d('0x43')](_0x4588f4[_0x432d('0x3e')],qs[_0x432d('0x44')](_0x35e652[_0x432d('0x40')]['fields']));_0x894b0a['attributes']=_0x894b0a['attributes'][_0x432d('0x45')]?_0x894b0a[_0x432d('0x42')]:_0x4588f4[_0x432d('0x3e')];_0x894b0a[_0x432d('0x46')]=qs['sort'](_0x35e652[_0x432d('0x40')][_0x432d('0x47')]);_0x894b0a[_0x432d('0x48')]=qs[_0x432d('0x41')](_[_0x432d('0x49')](_0x35e652[_0x432d('0x40')],_0x4588f4[_0x432d('0x41')]));if(_0x35e652[_0x432d('0x40')][_0x432d('0x59')]){_0x894b0a['where']=_[_0x432d('0x4b')](_0x894b0a[_0x432d('0x48')],{'$or':_['map'](_0x894b0a[_0x432d('0x42')],function(_0x8502e){var _0xd56c1b={};_0xd56c1b[_0x8502e]={'$like':'%'+_0x35e652['query'][_0x432d('0x59')]+'%'};return _0xd56c1b;})});}_0x894b0a=_[_0x432d('0x4b')]({},_0x894b0a,_0x35e652[_0x432d('0x4c')]);return _0x2d6a0c[_0x432d('0x5c')](_0x894b0a);}})['then'](function(_0x51b465){if(_0x51b465){_0x12423e=_0x51b465[_0x432d('0x45')];if(!_0x35e652[_0x432d('0x40')]['hasOwnProperty'](_0x432d('0x5b'))){_0x894b0a[_0x432d('0x30')]=qs[_0x432d('0x30')](_0x35e652[_0x432d('0x40')][_0x432d('0x30')]);_0x894b0a[_0x432d('0x2f')]=qs['offset'](_0x35e652[_0x432d('0x40')]['offset']);}return _0x2d6a0c[_0x432d('0x5c')](_0x894b0a);}})[_0x432d('0x20')](function(_0x102905){if(_0x102905){return _0x102905?{'count':_0x12423e,'rows':_0x102905}:null;}})['then'](respondWithResult(_0xe05886,null))['catch'](handleError(_0xe05886,null));};exports[_0x432d('0x5d')]=function(_0x8c3c6c,_0x25bcab,_0x4ade98){var _0x4f4c56={};var _0x35ad9f={};var _0x74f228;var _0x5819a3;return db[_0x432d('0x3a')][_0x432d('0x56')]({'where':{'id':_0x8c3c6c['params']['id']}})[_0x432d('0x20')](handleEntityNotFound(_0x25bcab,null))[_0x432d('0x20')](function(_0x224f5c){if(_0x224f5c){_0x74f228=_0x224f5c;_0x35ad9f['model']=_[_0x432d('0x3f')](db[_0x432d('0x57')][_0x432d('0x58')]);_0x35ad9f[_0x432d('0x40')]=_[_0x432d('0x3f')](_0x8c3c6c[_0x432d('0x40')]);_0x35ad9f[_0x432d('0x41')]=_[_0x432d('0x43')](_0x35ad9f[_0x432d('0x3e')],_0x35ad9f[_0x432d('0x40')]);_0x4f4c56[_0x432d('0x42')]=_[_0x432d('0x43')](_0x35ad9f[_0x432d('0x3e')],qs[_0x432d('0x44')](_0x8c3c6c[_0x432d('0x40')][_0x432d('0x44')]));_0x4f4c56[_0x432d('0x42')]=_0x4f4c56[_0x432d('0x42')][_0x432d('0x45')]?_0x4f4c56['attributes']:_0x35ad9f[_0x432d('0x3e')];_0x4f4c56[_0x432d('0x46')]=qs['sort'](_0x8c3c6c[_0x432d('0x40')][_0x432d('0x47')]);_0x4f4c56[_0x432d('0x48')]=qs[_0x432d('0x41')](_[_0x432d('0x49')](_0x8c3c6c[_0x432d('0x40')],_0x35ad9f[_0x432d('0x41')]));if(_0x8c3c6c[_0x432d('0x40')][_0x432d('0x59')]){_0x4f4c56['where']=_['merge'](_0x4f4c56[_0x432d('0x48')],{'$or':_[_0x432d('0x39')](_0x4f4c56[_0x432d('0x42')],function(_0x71d057){var _0x4aec0c={};_0x4aec0c[_0x71d057]={'$like':'%'+_0x8c3c6c['query'][_0x432d('0x59')]+'%'};return _0x4aec0c;})});}_0x4f4c56=_[_0x432d('0x4b')]({},_0x4f4c56,_0x8c3c6c[_0x432d('0x4c')]);return _0x74f228[_0x432d('0x5d')](_0x4f4c56);}})[_0x432d('0x20')](function(_0x34fdca){if(_0x34fdca){_0x5819a3=_0x34fdca[_0x432d('0x45')];if(!_0x8c3c6c[_0x432d('0x40')][_0x432d('0x5a')](_0x432d('0x5b'))){_0x4f4c56[_0x432d('0x30')]=qs['limit'](_0x8c3c6c['query'][_0x432d('0x30')]);_0x4f4c56['offset']=qs['offset'](_0x8c3c6c['query'][_0x432d('0x2f')]);}return _0x74f228[_0x432d('0x5d')](_0x4f4c56);}})[_0x432d('0x20')](function(_0x531f3e){if(_0x531f3e){return _0x531f3e?{'count':_0x5819a3,'rows':_0x531f3e}:null;}})[_0x432d('0x20')](respondWithResult(_0x25bcab,null))[_0x432d('0x2a')](handleError(_0x25bcab,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 352e5dc..e87f86c 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 _0xa6ed=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util'];(function(_0x3439ef,_0x198707){var _0x3c7937=function(_0xaf5100){while(--_0xaf5100){_0x3439ef['push'](_0x3439ef['shift']());}};_0x3c7937(++_0x198707);}(_0xa6ed,0xb4));var _0xda6e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa6ed[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xda6e('0x0'));var util=require(_0xda6e('0x1'));var logger=require(_0xda6e('0x2'))(_0xda6e('0x3'));var moment=require(_0xda6e('0x4'));var BPromise=require(_0xda6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda6e('0x6'));var rimraf=require(_0xda6e('0x7'));var config=require(_0xda6e('0x8'));var attributes=require(_0xda6e('0x9'));module[_0xda6e('0xa')]=function(_0x29a1e7,_0x3815aa){return _0x29a1e7[_0xda6e('0xb')](_0xda6e('0xc'),attributes,{'tableName':_0xda6e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef7b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','util'];(function(_0x4f0837,_0x2ef53b){var _0x30abc4=function(_0xbe1347){while(--_0xbe1347){_0x4f0837['push'](_0x4f0837['shift']());}};_0x30abc4(++_0x2ef53b);}(_0xef7b,0x169));var _0xbef7=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0xef7b[_0x673722];return _0x21249c;};'use strict';var _=require(_0xbef7('0x0'));var util=require(_0xbef7('0x1'));var logger=require(_0xbef7('0x2'))(_0xbef7('0x3'));var moment=require(_0xbef7('0x4'));var BPromise=require(_0xbef7('0x5'));var rp=require(_0xbef7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbef7('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Configuration.attributes');module[_0xbef7('0x8')]=function(_0x49145f,_0x4636f1){return _0x49145f['define'](_0xbef7('0x9'),attributes,{'tableName':_0xbef7('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 5474fc3..1642921 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 _0xf291=['client','http','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0xf291,0x1db));var _0x1f29=function(_0x5d7c9f,_0x278f87){_0x5d7c9f=_0x5d7c9f-0x0;var _0x260dc1=_0xf291[_0x5d7c9f];return _0x260dc1;};'use strict';var _=require(_0x1f29('0x0'));var util=require(_0x1f29('0x1'));var moment=require(_0x1f29('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f29('0x3'));var fs=require('fs');var Redis=require(_0x1f29('0x4'));var db=require(_0x1f29('0x5'))['db'];var utils=require(_0x1f29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1f29('0x7'));var client=jayson[_0x1f29('0x8')][_0x1f29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x173ee6,_0x2b8cc4,_0x3e48ae){return new BPromise(function(_0x3d4ca1,_0x5665b2){return client[_0x1f29('0xa')](_0x173ee6,_0x3e48ae)['then'](function(_0x380a8a){logger['info'](_0x1f29('0xb'),_0x2b8cc4,_0x1f29('0xc'));logger[_0x1f29('0xd')](_0x1f29('0xe'),_0x2b8cc4,'request\x20sent',JSON[_0x1f29('0xf')](_0x380a8a));if(_0x380a8a[_0x1f29('0x10')]){if(_0x380a8a[_0x1f29('0x10')][_0x1f29('0x11')]===0x1f4){logger['error'](_0x1f29('0xb'),_0x2b8cc4,_0x380a8a['error'][_0x1f29('0x12')]);return _0x5665b2(_0x380a8a[_0x1f29('0x10')][_0x1f29('0x12')]);}logger[_0x1f29('0x10')](_0x1f29('0xb'),_0x2b8cc4,_0x380a8a[_0x1f29('0x10')][_0x1f29('0x12')]);return _0x3d4ca1(_0x380a8a['error']['message']);}else{logger[_0x1f29('0x13')](_0x1f29('0xb'),_0x2b8cc4,_0x1f29('0xc'));_0x3d4ca1(_0x380a8a[_0x1f29('0x14')][_0x1f29('0x12')]);}})['catch'](function(_0x11b0ab){logger[_0x1f29('0x10')](_0x1f29('0xb'),_0x2b8cc4,_0x11b0ab);_0x5665b2(_0x11b0ab);});});} \ No newline at end of file +var _0x74b6=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x3d7463,_0x56b9c1){var _0x1fb252=function(_0x2f859c){while(--_0x2f859c){_0x3d7463['push'](_0x3d7463['shift']());}};_0x1fb252(++_0x56b9c1);}(_0x74b6,0x198));var _0x674b=function(_0xcfbbe2,_0x41da32){_0xcfbbe2=_0xcfbbe2-0x0;var _0x318e4f=_0x74b6[_0xcfbbe2];return _0x318e4f;};'use strict';var _=require(_0x674b('0x0'));var util=require(_0x674b('0x1'));var moment=require(_0x674b('0x2'));var BPromise=require('bluebird');var rs=require(_0x674b('0x3'));var fs=require('fs');var Redis=require(_0x674b('0x4'));var db=require(_0x674b('0x5'))['db'];var utils=require(_0x674b('0x6'));var logger=require(_0x674b('0x7'))(_0x674b('0x8'));var config=require(_0x674b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x674b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2f4d,_0x36d7c9,_0x5b6f7c){return new BPromise(function(_0x593fdd,_0x352be7){return client[_0x674b('0xb')](_0x1c2f4d,_0x5b6f7c)[_0x674b('0xc')](function(_0x309c1b){logger[_0x674b('0xd')](_0x674b('0xe'),_0x36d7c9,_0x674b('0xf'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x36d7c9,_0x674b('0xf'),JSON[_0x674b('0x10')](_0x309c1b));if(_0x309c1b[_0x674b('0x11')]){if(_0x309c1b['error'][_0x674b('0x12')]===0x1f4){logger['error'](_0x674b('0xe'),_0x36d7c9,_0x309c1b[_0x674b('0x11')][_0x674b('0x13')]);return _0x352be7(_0x309c1b['error'][_0x674b('0x13')]);}logger[_0x674b('0x11')](_0x674b('0xe'),_0x36d7c9,_0x309c1b[_0x674b('0x11')][_0x674b('0x13')]);return _0x593fdd(_0x309c1b[_0x674b('0x11')][_0x674b('0x13')]);}else{logger[_0x674b('0xd')](_0x674b('0xe'),_0x36d7c9,_0x674b('0xf'));_0x593fdd(_0x309c1b['result'][_0x674b('0x13')]);}})[_0x674b('0x14')](function(_0x7499af){logger['error'](_0x674b('0xe'),_0x36d7c9,_0x7499af);_0x352be7(_0x7499af);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b0587ac..ab40a7e 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(_0x5d253d,_0x3b7676){var _0x3dcfed=function(_0x26e5d3){while(--_0x26e5d3){_0x5d253d['push'](_0x5d253d['shift']());}};_0x3dcfed(++_0x3b7676);}(_0x55ea,0xc9));var _0xa55e=function(_0x3871bb,_0x151b7a){_0x3871bb=_0x3871bb-0x0;var _0x438be8=_0x55ea[_0x3871bb];return _0x438be8;};'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 _0xac55=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x26b968,_0x1d02eb){var _0x418664=function(_0x390822){while(--_0x390822){_0x26b968['push'](_0x26b968['shift']());}};_0x418664(++_0x1d02eb);}(_0xac55,0x1c8));var _0x5ac5=function(_0x185517,_0x49941a){_0x185517=_0x185517-0x0;var _0x4834d8=_0xac55[_0x185517];return _0x4834d8;};'use strict';var multer=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var path=require(_0x5ac5('0x2'));var timeout=require(_0x5ac5('0x3'));var express=require('express');var router=express[_0x5ac5('0x4')]();var auth=require(_0x5ac5('0x5'));var interaction=require(_0x5ac5('0x6'));var config=require(_0x5ac5('0x7'));var controller=require(_0x5ac5('0x8'));router[_0x5ac5('0x9')]('/',auth[_0x5ac5('0xa')](),controller['index']);router['get'](_0x5ac5('0xb'),auth[_0x5ac5('0xa')](),controller[_0x5ac5('0xc')]);router[_0x5ac5('0xd')]('/',auth[_0x5ac5('0xa')](),controller[_0x5ac5('0xe')]);router[_0x5ac5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5ac5('0x10')]);router[_0x5ac5('0x11')]('/:id',auth[_0x5ac5('0xa')](),controller[_0x5ac5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 691db06..9e9589e 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 _0x28c4=['variable','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x18f40e,_0x77e3b5){var _0x67793a=function(_0xc69d6c){while(--_0xc69d6c){_0x18f40e['push'](_0x18f40e['shift']());}};_0x67793a(++_0x77e3b5);}(_0x28c4,0x99));var _0x428c=function(_0x149055,_0x42bd96){_0x149055=_0x149055-0x0;var _0x2862bf=_0x28c4[_0x149055];return _0x2862bf;};'use strict';var Sequelize=require('sequelize');module[_0x428c('0x0')]={'type':{'type':Sequelize[_0x428c('0x1')](_0x428c('0x2'),_0x428c('0x3'),'customVariable','keyValue'),'defaultValue':_0x428c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x428c('0x1')]('string',_0x428c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x428c('0x4')]},'idField':{'type':Sequelize[_0x428c('0x4')]},'nameField':{'type':Sequelize[_0x428c('0x4')]},'customField':{'type':Sequelize[_0x428c('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x428c('0x4')]}}; \ No newline at end of file +var _0x6b61=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x6b61,0x16a));var _0x16b6=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x6b61[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x16b6('0x0'));module['exports']={'type':{'type':Sequelize[_0x16b6('0x1')](_0x16b6('0x2'),_0x16b6('0x3'),_0x16b6('0x4'),_0x16b6('0x5')),'defaultValue':_0x16b6('0x2')},'content':{'type':Sequelize[_0x16b6('0x6')]},'key':{'type':Sequelize[_0x16b6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x16b6('0x2'),_0x16b6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x16b6('0x6')]},'idField':{'type':Sequelize[_0x16b6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x16b6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x16b6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3750266..2430040 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 _0xd9ea=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','rawAttributes','includeAll','include','create','body','params','destroy','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1d4544,_0x1722f5){var _0x3f464d=function(_0x38a201){while(--_0x38a201){_0x1d4544['push'](_0x1d4544['shift']());}};_0x3f464d(++_0x1722f5);}(_0xd9ea,0x1c6));var _0xad9e=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0xd9ea[_0x3f4891];return _0x54f2d8;};'use strict';var pdf=require(_0xad9e('0x0'));var emlformat=require(_0xad9e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xad9e('0x2'));var jsonpatch=require(_0xad9e('0x3'));var rp=require(_0xad9e('0x4'));var moment=require(_0xad9e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xad9e('0x6'));var path=require(_0xad9e('0x7'));var sox=require(_0xad9e('0x8'));var csv=require('to-csv');var ejs=require(_0xad9e('0x9'));var fs=require('fs');var _=require(_0xad9e('0xa'));var squel=require(_0xad9e('0xb'));var crypto=require(_0xad9e('0xc'));var jsforce=require(_0xad9e('0xd'));var deskjs=require(_0xad9e('0xe'));var toCsv=require(_0xad9e('0xf'));var querystring=require(_0xad9e('0x10'));var Papa=require(_0xad9e('0x11'));var Redis=require(_0xad9e('0x12'));var authService=require(_0xad9e('0x13'));var qs=require(_0xad9e('0x14'));var as=require(_0xad9e('0x15'));var hardwareService=require(_0xad9e('0x16'));var logger=require(_0xad9e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xad9e('0x18'));var db=require(_0xad9e('0x19'))['db'];function respondWithStatusCode(_0x384840,_0x59b0bf){_0x59b0bf=_0x59b0bf||0xcc;return function(_0x2b4871){if(_0x2b4871){return _0x384840[_0xad9e('0x1a')](_0x59b0bf);}return _0x384840[_0xad9e('0x1b')](_0x59b0bf)[_0xad9e('0x1c')]();};}function respondWithResult(_0x94684e,_0x2bc675){_0x2bc675=_0x2bc675||0xc8;return function(_0x1229a2){if(_0x1229a2){return _0x94684e['status'](_0x2bc675)[_0xad9e('0x1d')](_0x1229a2);}};}function respondWithFilteredResult(_0x3251ee,_0x57818e){return function(_0x4b2e62){if(_0x4b2e62){var _0x25759b=_0x4b2e62[_0xad9e('0x1e')],_0xd952ec=_0x57818e[_0xad9e('0x1f')],_0x21e04d=_0x57818e[_0xad9e('0x1f')]+_0x57818e['limit'],_0x9eca5e;if(_0x21e04d>=_0x25759b){_0x21e04d=_0x25759b;_0x9eca5e=0xc8;}else{_0x9eca5e=0xce;}_0x3251ee[_0xad9e('0x1b')](_0x9eca5e);return _0x3251ee[_0xad9e('0x20')](_0xad9e('0x21'),_0xd952ec+'-'+_0x21e04d+'/'+_0x25759b)[_0xad9e('0x1d')](_0x4b2e62);}return null;};}function patchUpdates(_0x42b98b){return function(_0x48bfa8){try{jsonpatch[_0xad9e('0x22')](_0x48bfa8,_0x42b98b,!![]);}catch(_0x6e9431){return BPromise['reject'](_0x6e9431);}return _0x48bfa8[_0xad9e('0x23')]();};}function saveUpdates(_0x2aaf5e,_0x3af29e){return function(_0x17dd42){if(_0x17dd42){return _0x17dd42[_0xad9e('0x24')](_0x2aaf5e)[_0xad9e('0x25')](function(_0x37ef45){return _0x37ef45;});}return null;};}function removeEntity(_0x5061c5,_0x383cbf){return function(_0x1ff2f7){if(_0x1ff2f7){return _0x1ff2f7['destroy']()[_0xad9e('0x25')](function(){_0x5061c5[_0xad9e('0x1b')](0xcc)[_0xad9e('0x1c')]();});}};}function handleEntityNotFound(_0x28c347,_0x359bb2){return function(_0x326c43){if(!_0x326c43){_0x28c347[_0xad9e('0x1a')](0x194);}return _0x326c43;};}function handleError(_0x2885e4,_0x18a1b9){_0x18a1b9=_0x18a1b9||0x1f4;return function(_0x22d50e){logger[_0xad9e('0x26')](_0x22d50e[_0xad9e('0x27')]);if(_0x22d50e[_0xad9e('0x28')]){delete _0x22d50e[_0xad9e('0x28')];}_0x2885e4[_0xad9e('0x1b')](_0x18a1b9)[_0xad9e('0x29')](_0x22d50e);};}exports[_0xad9e('0x2a')]=function(_0x8e5fba,_0x5d87e5){var _0x455f87={},_0x568597={},_0x1f74be={'count':0x0,'rows':[]};var _0x357e5e=_[_0xad9e('0x2b')](db[_0xad9e('0x2c')]['rawAttributes'],function(_0x2b26d9){return{'name':_0x2b26d9[_0xad9e('0x2d')],'type':_0x2b26d9[_0xad9e('0x2e')][_0xad9e('0x2f')]};});_0x568597[_0xad9e('0x30')]=_['map'](_0x357e5e,_0xad9e('0x28'));_0x568597[_0xad9e('0x31')]=_[_0xad9e('0x32')](_0x8e5fba[_0xad9e('0x31')]);_0x568597[_0xad9e('0x33')]=_['intersection'](_0x568597[_0xad9e('0x30')],_0x568597['query']);_0x455f87[_0xad9e('0x34')]=_[_0xad9e('0x35')](_0x568597[_0xad9e('0x30')],qs['fields'](_0x8e5fba['query'][_0xad9e('0x36')]));_0x455f87['attributes']=_0x455f87[_0xad9e('0x34')][_0xad9e('0x37')]?_0x455f87[_0xad9e('0x34')]:_0x568597[_0xad9e('0x30')];if(!_0x8e5fba[_0xad9e('0x31')][_0xad9e('0x38')](_0xad9e('0x39'))){_0x455f87['limit']=qs[_0xad9e('0x3a')](_0x8e5fba[_0xad9e('0x31')][_0xad9e('0x3a')]);_0x455f87[_0xad9e('0x1f')]=qs['offset'](_0x8e5fba['query']['offset']);}_0x455f87[_0xad9e('0x3b')]=qs[_0xad9e('0x3c')](_0x8e5fba[_0xad9e('0x31')][_0xad9e('0x3c')]);_0x455f87[_0xad9e('0x3d')]=qs[_0xad9e('0x33')](_[_0xad9e('0x3e')](_0x8e5fba['query'],_0x568597['filters']),_0x357e5e);if(_0x8e5fba[_0xad9e('0x31')][_0xad9e('0x3f')]){_0x455f87['where']=_['merge'](_0x455f87[_0xad9e('0x3d')],{'$or':_[_0xad9e('0x2b')](_0x357e5e,function(_0x23782e){if(_0x23782e['type']!==_0xad9e('0x40')){var _0x4c4cd6={};_0x4c4cd6[_0x23782e[_0xad9e('0x28')]]={'$like':'%'+_0x8e5fba['query'][_0xad9e('0x3f')]+'%'};return _0x4c4cd6;}})});}_0x455f87=_[_0xad9e('0x41')]({},_0x455f87,_0x8e5fba[_0xad9e('0x42')]);var _0x34ecee={'where':_0x455f87[_0xad9e('0x3d')]};return db[_0xad9e('0x2c')][_0xad9e('0x1e')](_0x34ecee)['then'](function(_0x42ec95){_0x1f74be[_0xad9e('0x1e')]=_0x42ec95;if(_0x8e5fba[_0xad9e('0x31')]['includeAll']){_0x455f87['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xad9e('0x43')](_0x455f87);})[_0xad9e('0x25')](function(_0x855fac){_0x1f74be[_0xad9e('0x44')]=_0x855fac;return _0x1f74be;})[_0xad9e('0x25')](respondWithFilteredResult(_0x5d87e5,_0x455f87))[_0xad9e('0x45')](handleError(_0x5d87e5,null));};exports[_0xad9e('0x46')]=function(_0x3efa8f,_0x360ea6){var _0x53dabb={'raw':!![],'where':{'id':_0x3efa8f['params']['id']}},_0x5484d7={};_0x5484d7[_0xad9e('0x30')]=_[_0xad9e('0x32')](db[_0xad9e('0x2c')][_0xad9e('0x47')]);_0x5484d7['query']=_[_0xad9e('0x32')](_0x3efa8f['query']);_0x5484d7['filters']=_[_0xad9e('0x35')](_0x5484d7['model'],_0x5484d7[_0xad9e('0x31')]);_0x53dabb[_0xad9e('0x34')]=_[_0xad9e('0x35')](_0x5484d7[_0xad9e('0x30')],qs[_0xad9e('0x36')](_0x3efa8f[_0xad9e('0x31')]['fields']));_0x53dabb[_0xad9e('0x34')]=_0x53dabb[_0xad9e('0x34')][_0xad9e('0x37')]?_0x53dabb[_0xad9e('0x34')]:_0x5484d7['model'];if(_0x3efa8f[_0xad9e('0x31')][_0xad9e('0x48')]){_0x53dabb[_0xad9e('0x49')]=[{'all':!![]}];}_0x53dabb=_[_0xad9e('0x41')]({},_0x53dabb,_0x3efa8f[_0xad9e('0x42')]);return db[_0xad9e('0x2c')]['find'](_0x53dabb)[_0xad9e('0x25')](handleEntityNotFound(_0x360ea6,null))[_0xad9e('0x25')](respondWithResult(_0x360ea6,null))[_0xad9e('0x45')](handleError(_0x360ea6,null));};exports[_0xad9e('0x4a')]=function(_0x59fcbd,_0x40c1f2){return db[_0xad9e('0x2c')][_0xad9e('0x4a')](_0x59fcbd[_0xad9e('0x4b')],{})[_0xad9e('0x25')](respondWithResult(_0x40c1f2,0xc9))[_0xad9e('0x45')](handleError(_0x40c1f2,null));};exports['update']=function(_0x4b73a2,_0x35bbd2){if(_0x4b73a2[_0xad9e('0x4b')]['id']){delete _0x4b73a2[_0xad9e('0x4b')]['id'];}return db[_0xad9e('0x2c')]['find']({'where':{'id':_0x4b73a2[_0xad9e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35bbd2,null))[_0xad9e('0x25')](saveUpdates(_0x4b73a2[_0xad9e('0x4b')],null))['then'](respondWithResult(_0x35bbd2,null))['catch'](handleError(_0x35bbd2,null));};exports[_0xad9e('0x4d')]=function(_0x47f8a2,_0x3f14cf){return db[_0xad9e('0x2c')][_0xad9e('0x4e')]({'where':{'id':_0x47f8a2[_0xad9e('0x4c')]['id']}})[_0xad9e('0x25')](handleEntityNotFound(_0x3f14cf,null))[_0xad9e('0x25')](removeEntity(_0x3f14cf,null))[_0xad9e('0x45')](handleError(_0x3f14cf,null));}; \ No newline at end of file +var _0x53d0=['index','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','Dynamics365Field','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','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','end','status','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send'];(function(_0x4d2a6e,_0x185f42){var _0x2fa8bf=function(_0x48f9d4){while(--_0x48f9d4){_0x4d2a6e['push'](_0x4d2a6e['shift']());}};_0x2fa8bf(++_0x185f42);}(_0x53d0,0x6c));var _0x053d=function(_0x396a8e,_0x354607){_0x396a8e=_0x396a8e-0x0;var _0xa0d55b=_0x53d0[_0x396a8e];return _0xa0d55b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x053d('0x0'));var rimraf=require(_0x053d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x053d('0x2'));var rp=require('request-promise');var moment=require(_0x053d('0x3'));var BPromise=require(_0x053d('0x4'));var Mustache=require(_0x053d('0x5'));var util=require(_0x053d('0x6'));var path=require(_0x053d('0x7'));var sox=require(_0x053d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x053d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x053d('0xa'));var deskjs=require(_0x053d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x053d('0xc'));var Redis=require(_0x053d('0xd'));var authService=require(_0x053d('0xe'));var qs=require(_0x053d('0xf'));var as=require(_0x053d('0x10'));var hardwareService=require(_0x053d('0x11'));var logger=require(_0x053d('0x12'))(_0x053d('0x13'));var utils=require(_0x053d('0x14'));var config=require(_0x053d('0x15'));var db=require(_0x053d('0x16'))['db'];function respondWithStatusCode(_0x1f4612,_0x210ade){_0x210ade=_0x210ade||0xcc;return function(_0x9674ba){if(_0x9674ba){return _0x1f4612[_0x053d('0x17')](_0x210ade);}return _0x1f4612['status'](_0x210ade)[_0x053d('0x18')]();};}function respondWithResult(_0x25c6a0,_0x34bb8b){_0x34bb8b=_0x34bb8b||0xc8;return function(_0x4a8e7f){if(_0x4a8e7f){return _0x25c6a0[_0x053d('0x19')](_0x34bb8b)[_0x053d('0x1a')](_0x4a8e7f);}};}function respondWithFilteredResult(_0x2f1567,_0x19f02a){return function(_0x4944cc){if(_0x4944cc){var _0x435a3a=_0x4944cc['count'],_0x1f1087=_0x19f02a[_0x053d('0x1b')],_0x33d10b=_0x19f02a[_0x053d('0x1b')]+_0x19f02a[_0x053d('0x1c')],_0x1cb17f;if(_0x33d10b>=_0x435a3a){_0x33d10b=_0x435a3a;_0x1cb17f=0xc8;}else{_0x1cb17f=0xce;}_0x2f1567[_0x053d('0x19')](_0x1cb17f);return _0x2f1567[_0x053d('0x1d')](_0x053d('0x1e'),_0x1f1087+'-'+_0x33d10b+'/'+_0x435a3a)[_0x053d('0x1a')](_0x4944cc);}return null;};}function patchUpdates(_0xcc5069){return function(_0x3e20b5){try{jsonpatch['apply'](_0x3e20b5,_0xcc5069,!![]);}catch(_0x539d4d){return BPromise[_0x053d('0x1f')](_0x539d4d);}return _0x3e20b5[_0x053d('0x20')]();};}function saveUpdates(_0x503b48,_0x2c3d40){return function(_0x67bc8f){if(_0x67bc8f){return _0x67bc8f['update'](_0x503b48)[_0x053d('0x21')](function(_0x211877){return _0x211877;});}return null;};}function removeEntity(_0x4d4fa4,_0x5e4fba){return function(_0x4a7920){if(_0x4a7920){return _0x4a7920[_0x053d('0x22')]()[_0x053d('0x21')](function(){_0x4d4fa4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4252d5,_0x334908){return function(_0x1b94c0){if(!_0x1b94c0){_0x4252d5[_0x053d('0x17')](0x194);}return _0x1b94c0;};}function handleError(_0x196ea2,_0x5657e3){_0x5657e3=_0x5657e3||0x1f4;return function(_0x4f621e){logger[_0x053d('0x23')](_0x4f621e['stack']);if(_0x4f621e[_0x053d('0x24')]){delete _0x4f621e[_0x053d('0x24')];}_0x196ea2[_0x053d('0x19')](_0x5657e3)[_0x053d('0x25')](_0x4f621e);};}exports[_0x053d('0x26')]=function(_0x150f09,_0x51a8ae){var _0x5623cb={},_0x2a245d={},_0x625eae={'count':0x0,'rows':[]};var _0x4d71fb=_['map'](db['Dynamics365Field'][_0x053d('0x27')],function(_0x42b7be){return{'name':_0x42b7be[_0x053d('0x28')],'type':_0x42b7be[_0x053d('0x29')]['key']};});_0x2a245d[_0x053d('0x2a')]=_['map'](_0x4d71fb,_0x053d('0x24'));_0x2a245d[_0x053d('0x2b')]=_[_0x053d('0x2c')](_0x150f09[_0x053d('0x2b')]);_0x2a245d[_0x053d('0x2d')]=_['intersection'](_0x2a245d[_0x053d('0x2a')],_0x2a245d[_0x053d('0x2b')]);_0x5623cb[_0x053d('0x2e')]=_[_0x053d('0x2f')](_0x2a245d[_0x053d('0x2a')],qs[_0x053d('0x30')](_0x150f09[_0x053d('0x2b')][_0x053d('0x30')]));_0x5623cb[_0x053d('0x2e')]=_0x5623cb[_0x053d('0x2e')]['length']?_0x5623cb['attributes']:_0x2a245d[_0x053d('0x2a')];if(!_0x150f09[_0x053d('0x2b')][_0x053d('0x31')](_0x053d('0x32'))){_0x5623cb[_0x053d('0x1c')]=qs[_0x053d('0x1c')](_0x150f09[_0x053d('0x2b')][_0x053d('0x1c')]);_0x5623cb[_0x053d('0x1b')]=qs[_0x053d('0x1b')](_0x150f09[_0x053d('0x2b')][_0x053d('0x1b')]);}_0x5623cb[_0x053d('0x33')]=qs[_0x053d('0x34')](_0x150f09[_0x053d('0x2b')][_0x053d('0x34')]);_0x5623cb[_0x053d('0x35')]=qs[_0x053d('0x2d')](_[_0x053d('0x36')](_0x150f09[_0x053d('0x2b')],_0x2a245d[_0x053d('0x2d')]),_0x4d71fb);if(_0x150f09[_0x053d('0x2b')][_0x053d('0x37')]){_0x5623cb[_0x053d('0x35')]=_[_0x053d('0x38')](_0x5623cb[_0x053d('0x35')],{'$or':_[_0x053d('0x39')](_0x4d71fb,function(_0x5812c9){if(_0x5812c9[_0x053d('0x29')]!==_0x053d('0x3a')){var _0x14db67={};_0x14db67[_0x5812c9[_0x053d('0x24')]]={'$like':'%'+_0x150f09[_0x053d('0x2b')][_0x053d('0x37')]+'%'};return _0x14db67;}})});}_0x5623cb=_[_0x053d('0x38')]({},_0x5623cb,_0x150f09[_0x053d('0x3b')]);var _0x3c0cf5={'where':_0x5623cb[_0x053d('0x35')]};return db[_0x053d('0x3c')]['count'](_0x3c0cf5)[_0x053d('0x21')](function(_0xb54b73){_0x625eae['count']=_0xb54b73;if(_0x150f09[_0x053d('0x2b')]['includeAll']){_0x5623cb[_0x053d('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x053d('0x3e')](_0x5623cb);})[_0x053d('0x21')](function(_0x17ff13){_0x625eae[_0x053d('0x3f')]=_0x17ff13;return _0x625eae;})[_0x053d('0x21')](respondWithFilteredResult(_0x51a8ae,_0x5623cb))[_0x053d('0x40')](handleError(_0x51a8ae,null));};exports[_0x053d('0x41')]=function(_0x8cc108,_0x250834){var _0xac65b8={'raw':!![],'where':{'id':_0x8cc108[_0x053d('0x42')]['id']}},_0x275605={};_0x275605['model']=_[_0x053d('0x2c')](db['Dynamics365Field'][_0x053d('0x27')]);_0x275605[_0x053d('0x2b')]=_['keys'](_0x8cc108[_0x053d('0x2b')]);_0x275605['filters']=_[_0x053d('0x2f')](_0x275605[_0x053d('0x2a')],_0x275605[_0x053d('0x2b')]);_0xac65b8[_0x053d('0x2e')]=_['intersection'](_0x275605[_0x053d('0x2a')],qs['fields'](_0x8cc108[_0x053d('0x2b')][_0x053d('0x30')]));_0xac65b8[_0x053d('0x2e')]=_0xac65b8[_0x053d('0x2e')][_0x053d('0x43')]?_0xac65b8[_0x053d('0x2e')]:_0x275605[_0x053d('0x2a')];if(_0x8cc108['query'][_0x053d('0x44')]){_0xac65b8['include']=[{'all':!![]}];}_0xac65b8=_[_0x053d('0x38')]({},_0xac65b8,_0x8cc108['options']);return db['Dynamics365Field'][_0x053d('0x45')](_0xac65b8)[_0x053d('0x21')](handleEntityNotFound(_0x250834,null))[_0x053d('0x21')](respondWithResult(_0x250834,null))[_0x053d('0x40')](handleError(_0x250834,null));};exports[_0x053d('0x46')]=function(_0x21dae8,_0x1f6b98){return db[_0x053d('0x3c')]['create'](_0x21dae8[_0x053d('0x47')],{})['then'](respondWithResult(_0x1f6b98,0xc9))[_0x053d('0x40')](handleError(_0x1f6b98,null));};exports[_0x053d('0x48')]=function(_0xee8ca1,_0x195d81){if(_0xee8ca1[_0x053d('0x47')]['id']){delete _0xee8ca1['body']['id'];}return db['Dynamics365Field'][_0x053d('0x45')]({'where':{'id':_0xee8ca1[_0x053d('0x42')]['id']}})[_0x053d('0x21')](handleEntityNotFound(_0x195d81,null))[_0x053d('0x21')](saveUpdates(_0xee8ca1[_0x053d('0x47')],null))[_0x053d('0x21')](respondWithResult(_0x195d81,null))['catch'](handleError(_0x195d81,null));};exports[_0x053d('0x22')]=function(_0xa8c17d,_0x37e59e){return db[_0x053d('0x3c')][_0x053d('0x45')]({'where':{'id':_0xa8c17d['params']['id']}})['then'](handleEntityNotFound(_0x37e59e,null))[_0x053d('0x21')](removeEntity(_0x37e59e,null))['catch'](handleError(_0x37e59e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 83e5278..2f6efee 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 _0x169a=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5117d0,_0x2066b7){var _0x1ff076=function(_0x2113bd){while(--_0x2113bd){_0x5117d0['push'](_0x5117d0['shift']());}};_0x1ff076(++_0x2066b7);}(_0x169a,0x11c));var _0xa169=function(_0x47b41e,_0xe6572d){_0x47b41e=_0x47b41e-0x0;var _0x3ebcaa=_0x169a[_0x47b41e];return _0x3ebcaa;};'use strict';var _=require(_0xa169('0x0'));var util=require('util');var logger=require(_0xa169('0x1'))(_0xa169('0x2'));var moment=require(_0xa169('0x3'));var BPromise=require(_0xa169('0x4'));var rp=require(_0xa169('0x5'));var fs=require('fs');var path=require(_0xa169('0x6'));var rimraf=require(_0xa169('0x7'));var config=require(_0xa169('0x8'));var attributes=require(_0xa169('0x9'));module[_0xa169('0xa')]=function(_0x228b3b,_0x2e2355){return _0x228b3b[_0xa169('0xb')](_0xa169('0xc'),attributes,{'tableName':_0xa169('0xd'),'paranoid':![],'indexes':[{'name':_0xa169('0xe'),'fields':['idField',_0xa169('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ab4=['FieldId','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x2bae58,_0x3689a8){var _0x56d462=function(_0x3f230f){while(--_0x3f230f){_0x2bae58['push'](_0x2bae58['shift']());}};_0x56d462(++_0x3689a8);}(_0x1ab4,0x1b1));var _0x41ab=function(_0x383163,_0x4f97a4){_0x383163=_0x383163-0x0;var _0x100818=_0x1ab4[_0x383163];return _0x100818;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41ab('0x0'))('api');var moment=require('moment');var BPromise=require(_0x41ab('0x1'));var rp=require(_0x41ab('0x2'));var fs=require('fs');var path=require(_0x41ab('0x3'));var rimraf=require(_0x41ab('0x4'));var config=require(_0x41ab('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x41ab('0x6')]=function(_0x13ae88,_0x1eacfd){return _0x13ae88[_0x41ab('0x7')]('Dynamics365Field',attributes,{'tableName':_0x41ab('0x8'),'paranoid':![],'indexes':[{'name':_0x41ab('0x9'),'fields':[_0x41ab('0xa'),_0x41ab('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 0902718..1aab5cf 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 _0xc21e=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x2c523a,_0x5ac80f){var _0x3334ca=function(_0x48c686){while(--_0x48c686){_0x2c523a['push'](_0x2c523a['shift']());}};_0x3334ca(++_0x5ac80f);}(_0xc21e,0x1ca));var _0xec21=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc21e[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xec21('0x0'));var moment=require(_0xec21('0x1'));var BPromise=require(_0xec21('0x2'));var rs=require(_0xec21('0x3'));var fs=require('fs');var Redis=require(_0xec21('0x4'));var db=require(_0xec21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var jayson=require(_0xec21('0x9'));var client=jayson[_0xec21('0xa')][_0xec21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x406b66,_0x2f15e7,_0x51f6dc){return new BPromise(function(_0x2b1396,_0x3d74a2){return client[_0xec21('0xc')](_0x406b66,_0x51f6dc)[_0xec21('0xd')](function(_0x4d478){logger['info'](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));logger[_0xec21('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2f15e7,'request\x20sent',JSON[_0xec21('0x11')](_0x4d478));if(_0x4d478[_0xec21('0x12')]){if(_0x4d478['error'][_0xec21('0x13')]===0x1f4){logger[_0xec21('0x12')](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x3d74a2(_0x4d478['error'][_0xec21('0x14')]);}logger['error'](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x2b1396(_0x4d478['error'][_0xec21('0x14')]);}else{logger[_0xec21('0x15')](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));_0x2b1396(_0x4d478[_0xec21('0x16')][_0xec21('0x14')]);}})[_0xec21('0x17')](function(_0x350a53){logger['error'](_0xec21('0xe'),_0x2f15e7,_0x350a53);_0x3d74a2(_0x350a53);});});} \ No newline at end of file +var _0x9536=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s'];(function(_0x2fb907,_0x38d0fb){var _0x14027f=function(_0x3694a4){while(--_0x3694a4){_0x2fb907['push'](_0x2fb907['shift']());}};_0x14027f(++_0x38d0fb);}(_0x9536,0x179));var _0x6953=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x9536[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 6b9a5bd..667120b 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 _0x4c7e=['post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','getFields'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4c7e,0x153));var _0xe4c7=function(_0x125c6b,_0x3396bd){_0x125c6b=_0x125c6b-0x0;var _0x49b36f=_0x4c7e[_0x125c6b];return _0x49b36f;};'use strict';var multer=require('multer');var util=require(_0xe4c7('0x0'));var path=require(_0xe4c7('0x1'));var timeout=require(_0xe4c7('0x2'));var express=require('express');var router=express[_0xe4c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4c7('0x4'));var config=require(_0xe4c7('0x5'));var controller=require(_0xe4c7('0x6'));router[_0xe4c7('0x7')]('/',auth[_0xe4c7('0x8')](),controller['index']);router[_0xe4c7('0x7')](_0xe4c7('0x9'),auth[_0xe4c7('0x8')](),controller[_0xe4c7('0xa')]);router[_0xe4c7('0x7')]('/:id/configurations',auth[_0xe4c7('0x8')](),controller[_0xe4c7('0xb')]);router[_0xe4c7('0x7')]('/:id/fields',auth[_0xe4c7('0x8')](),controller[_0xe4c7('0xc')]);router[_0xe4c7('0xd')]('/',auth['isAuthenticated'](),controller[_0xe4c7('0xe')]);router[_0xe4c7('0xd')](_0xe4c7('0xf'),auth['isAuthenticated'](),controller[_0xe4c7('0x10')]);router[_0xe4c7('0x11')](_0xe4c7('0x9'),auth['isAuthenticated'](),controller[_0xe4c7('0x12')]);router[_0xe4c7('0x13')]('/:id',auth[_0xe4c7('0x8')](),controller[_0xe4c7('0x14')]);module[_0xe4c7('0x15')]=router; \ No newline at end of file +var _0xaa8b=['/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','get'];(function(_0x1c3991,_0x41c24c){var _0x17a7e5=function(_0x1894c0){while(--_0x1894c0){_0x1c3991['push'](_0x1c3991['shift']());}};_0x17a7e5(++_0x41c24c);}(_0xaa8b,0xca));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbaa8('0x0'));var util=require(_0xbaa8('0x1'));var path=require(_0xbaa8('0x2'));var timeout=require(_0xbaa8('0x3'));var express=require(_0xbaa8('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbaa8('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0xbaa8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbaa8('0x6')](_0xbaa8('0x7'),auth[_0xbaa8('0x8')](),controller[_0xbaa8('0x9')]);router['get'](_0xbaa8('0xa'),auth[_0xbaa8('0x8')](),controller['getConfigurations']);router[_0xbaa8('0x6')](_0xbaa8('0xb'),auth[_0xbaa8('0x8')](),controller[_0xbaa8('0xc')]);router[_0xbaa8('0xd')]('/',auth[_0xbaa8('0x8')](),controller['create']);router[_0xbaa8('0xd')](_0xbaa8('0xa'),auth[_0xbaa8('0x8')](),controller[_0xbaa8('0xe')]);router[_0xbaa8('0xf')](_0xbaa8('0x7'),auth[_0xbaa8('0x8')](),controller[_0xbaa8('0x10')]);router[_0xbaa8('0x11')]('/:id',auth[_0xbaa8('0x8')](),controller['destroy']);module[_0xbaa8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index aa24b8e..c962047 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 _0x9a2a=['exports','STRING','remoteUri','sequelize'];(function(_0x12719b,_0xab3b77){var _0x4846d4=function(_0x1b96a3){while(--_0x1b96a3){_0x12719b['push'](_0x12719b['shift']());}};_0x4846d4(++_0xab3b77);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x29bcd1,_0x321aab){_0x29bcd1=_0x29bcd1-0x0;var _0xe7f9cb=_0x9a2a[_0x29bcd1];return _0xe7f9cb;};'use strict';var Sequelize=require(_0xa9a2('0x0'));module[_0xa9a2('0x1')]={'name':{'type':Sequelize[_0xa9a2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0xa9a2('0x2')]},'remoteUri':{'type':Sequelize[_0xa9a2('0x2')],'unique':_0xa9a2('0x3')},'serverUrl':{'type':Sequelize[_0xa9a2('0x2')]}}; \ No newline at end of file +var _0x38b2=['remoteUri','sequelize','exports','STRING','username'];(function(_0x53482e,_0xf69ff6){var _0xd2d619=function(_0x58e70e){while(--_0x58e70e){_0x53482e['push'](_0x53482e['shift']());}};_0xd2d619(++_0xf69ff6);}(_0x38b2,0xf6));var _0x238b=function(_0x3d23e1,_0x2f50f6){_0x3d23e1=_0x3d23e1-0x0;var _0x3cd3bc=_0x38b2[_0x3d23e1];return _0x3cd3bc;};'use strict';var Sequelize=require(_0x238b('0x0'));module[_0x238b('0x1')]={'name':{'type':Sequelize[_0x238b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x238b('0x3')},'apiKey':{'type':Sequelize[_0x238b('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x238b('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 4bee6a1..82ccb74 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 _0xe14b=['apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','priority','group','ticket_type','company','includes','default','custom_text','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','name','index','map','FreshdeskAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri'];(function(_0x2424cd,_0x3c838f){var _0x380ca8=function(_0x2bc0b6){while(--_0x2bc0b6){_0x2424cd['push'](_0x2424cd['shift']());}};_0x380ca8(++_0x3c838f);}(_0xe14b,0x93));var _0xbe14=function(_0x4b3559,_0x49f1af){_0x4b3559=_0x4b3559-0x0;var _0x40ee97=_0xe14b[_0x4b3559];return _0x40ee97;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var integrations=require(_0xbe14('0x15'));var jayson=require(_0xbe14('0x16'));var client=jayson[_0xbe14('0x17')][_0xbe14('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2850cb,_0x16893f,_0xa2cf72){if(_0xa2cf72){var _0x1e4826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e4826[_0xbe14('0x19')](_0x16893f)){return _0x2850cb;}else{throw new db[(_0xbe14('0x1a'))]['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 _0x2850cb;}}function respondWithRpcPromise(_0x3f58f5,_0x3dc4a9,_0xf4ac9,_0x37ce4e){return new BPromise(function(_0x4e8f34,_0x21c789){var _0xe9c3ec=_0x37ce4e||client;return _0xe9c3ec[_0xbe14('0x1b')](_0x3f58f5,_0xf4ac9)[_0xbe14('0x1c')](function(_0x38f1ea){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');logger[_0xbe14('0x1f')](_0xbe14('0x20'),_0x3dc4a9,_0xbe14('0x21'),JSON[_0xbe14('0x22')](_0x38f1ea));if(_0x38f1ea[_0xbe14('0x23')]){if(_0x38f1ea[_0xbe14('0x23')]['code']===0x1f4){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')][_0xbe14('0x24')]);return _0x21c789(_0x38f1ea[_0xbe14('0x23')]['message']);}logger[_0xbe14('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')]['message']);return _0x4e8f34(_0x38f1ea[_0xbe14('0x23')]['message']);}else{logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');_0x4e8f34(_0x38f1ea[_0xbe14('0x25')]['message']);}})[_0xbe14('0x26')](function(_0x4851f8){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x4851f8);_0x21c789(_0x4851f8);});});}function respondWithStatusCode(_0x1ee9c1,_0x39cc81){_0x39cc81=_0x39cc81||0xcc;return function(_0x15ef02){if(_0x15ef02){return _0x1ee9c1[_0xbe14('0x27')](_0x39cc81);}return _0x1ee9c1['status'](_0x39cc81)[_0xbe14('0x28')]();};}function respondWithResult(_0x1ba46a,_0x391556){_0x391556=_0x391556||0xc8;return function(_0x169369){if(_0x169369){return _0x1ba46a['status'](_0x391556)[_0xbe14('0x29')](_0x169369);}};}function respondWithFilteredResult(_0x29fc64,_0x59bf34){return function(_0x3c3613){if(_0x3c3613){var _0x3b3e84=_0x3c3613[_0xbe14('0x2a')],_0x1c7cc7=_0x59bf34[_0xbe14('0x2b')],_0x19252f=_0x59bf34[_0xbe14('0x2b')]+_0x59bf34[_0xbe14('0x2c')],_0x34d648;if(_0x19252f>=_0x3b3e84){_0x19252f=_0x3b3e84;_0x34d648=0xc8;}else{_0x34d648=0xce;}_0x29fc64[_0xbe14('0x2d')](_0x34d648);return _0x29fc64[_0xbe14('0x2e')](_0xbe14('0x2f'),_0x1c7cc7+'-'+_0x19252f+'/'+_0x3b3e84)[_0xbe14('0x29')](_0x3c3613);}return null;};}function patchUpdates(_0x10ae36){return function(_0x223f7a){try{jsonpatch[_0xbe14('0x30')](_0x223f7a,_0x10ae36,!![]);}catch(_0x6ba36c){return BPromise[_0xbe14('0x31')](_0x6ba36c);}return _0x223f7a[_0xbe14('0x32')]();};}function saveUpdates(_0x14e7c4,_0x581e86){return function(_0x2e33e1){if(_0x2e33e1){return _0x2e33e1['update'](_0x14e7c4)['then'](function(_0x46c2d1){return _0x46c2d1;});}return null;};}function removeEntity(_0x4c1e7e,_0x243524){return function(_0x345b0){if(_0x345b0){return _0x345b0['destroy']()['then'](function(){_0x4c1e7e['status'](0xcc)[_0xbe14('0x28')]();});}};}function handleEntityNotFound(_0xa3d24,_0x5f27b6){return function(_0x46c570){if(!_0x46c570){_0xa3d24[_0xbe14('0x27')](0x194);}return _0x46c570;};}function handleError(_0x452635,_0x1aa849){_0x1aa849=_0x1aa849||0x1f4;return function(_0x29c23e){logger['error'](_0x29c23e['stack']);if(_0x29c23e[_0xbe14('0x33')]){delete _0x29c23e['name'];}_0x452635['status'](_0x1aa849)['send'](_0x29c23e);};}exports[_0xbe14('0x34')]=function(_0x393f6b,_0x2bb45){var _0x3dbacb={},_0x172e79={},_0x29356f={'count':0x0,'rows':[]};var _0xcdc50=_[_0xbe14('0x35')](db[_0xbe14('0x36')][_0xbe14('0x37')],function(_0x41652d){return{'name':_0x41652d[_0xbe14('0x38')],'type':_0x41652d['type']['key']};});_0x172e79[_0xbe14('0x39')]=_[_0xbe14('0x35')](_0xcdc50,_0xbe14('0x33'));_0x172e79['query']=_[_0xbe14('0x3a')](_0x393f6b[_0xbe14('0x3b')]);_0x172e79[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],_0x172e79[_0xbe14('0x3b')]);_0x3dbacb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],qs['fields'](_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x3dbacb[_0xbe14('0x3e')]=_0x3dbacb[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x3dbacb[_0xbe14('0x3e')]:_0x172e79['model'];if(!_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x3dbacb[_0xbe14('0x2c')]=qs['limit'](_0x393f6b['query'][_0xbe14('0x2c')]);_0x3dbacb[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x393f6b['query']['offset']);}_0x3dbacb[_0xbe14('0x43')]=qs['sort'](_0x393f6b['query'][_0xbe14('0x44')]);_0x3dbacb[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x393f6b['query'],_0x172e79['filters']),_0xcdc50);if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x3dbacb[_0xbe14('0x45')]=_['merge'](_0x3dbacb[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0xcdc50,function(_0x32f22e){if(_0x32f22e[_0xbe14('0x47')]!=='VIRTUAL'){var _0x4a1a4b={};_0x4a1a4b[_0x32f22e[_0xbe14('0x33')]]={'$like':'%'+_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0x4a1a4b;}})});}_0x3dbacb=_[_0xbe14('0x48')]({},_0x3dbacb,_0x393f6b[_0xbe14('0x49')]);var _0x4f2d95={'where':_0x3dbacb['where']};return db[_0xbe14('0x36')][_0xbe14('0x2a')](_0x4f2d95)[_0xbe14('0x1c')](function(_0x2a3b35){_0x29356f['count']=_0x2a3b35;if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x4a')]){_0x3dbacb['include']=[{'all':!![]}];}return db[_0xbe14('0x36')][_0xbe14('0x4b')](_0x3dbacb);})[_0xbe14('0x1c')](function(_0x36c20c){_0x29356f['rows']=_0x36c20c;return _0x29356f;})['then'](respondWithFilteredResult(_0x2bb45,_0x3dbacb))[_0xbe14('0x26')](handleError(_0x2bb45,null));};exports[_0xbe14('0x4c')]=function(_0x4a1a37,_0x5acf90){var _0xca8cdb={'raw':![],'where':{'id':_0x4a1a37[_0xbe14('0x4d')]['id']}},_0x5d3726={};_0x5d3726[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x36')][_0xbe14('0x37')]);_0x5d3726['query']=_[_0xbe14('0x3a')](_0x4a1a37[_0xbe14('0x3b')]);_0x5d3726[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],_0x5d3726['query']);_0xca8cdb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x4a1a37[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0xca8cdb['attributes']=_0xca8cdb['attributes'][_0xbe14('0x40')]?_0xca8cdb[_0xbe14('0x3e')]:_0x5d3726[_0xbe14('0x39')];if(_0x4a1a37['query']['includeAll']){_0xca8cdb[_0xbe14('0x4e')]=[{'all':!![]}];}_0xca8cdb=_[_0xbe14('0x48')]({},_0xca8cdb,_0x4a1a37['options']);return db[_0xbe14('0x36')][_0xbe14('0x4f')](_0xca8cdb)['then'](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x1c')](respondWithResult(_0x5acf90,null))['catch'](handleError(_0x5acf90,null));};exports[_0xbe14('0x50')]=function(_0x410c59,_0x12a9de){return db['FreshdeskAccount'][_0xbe14('0x50')](_0x410c59[_0xbe14('0x51')],{})['then'](respondWithResult(_0x12a9de,0xc9))[_0xbe14('0x26')](handleError(_0x12a9de,null));};exports[_0xbe14('0x52')]=function(_0x2210cc,_0x20c48d){if(_0x2210cc[_0xbe14('0x51')]['id']){delete _0x2210cc['body']['id'];}return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x2210cc[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x20c48d,null))[_0xbe14('0x1c')](saveUpdates(_0x2210cc[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x20c48d,null))['catch'](handleError(_0x20c48d,null));};exports[_0xbe14('0x53')]=function(_0x1b47a4,_0x941ee2){return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x1b47a4[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x941ee2,null))[_0xbe14('0x1c')](removeEntity(_0x941ee2,null))[_0xbe14('0x26')](handleError(_0x941ee2,null));};exports[_0xbe14('0x54')]=function(_0x358950,_0x4bccfc,_0x56bcd3){var _0x58dd79={};var _0x10c0bc={};var _0x1bfcbf;var _0x2f4e52;return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x358950[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x4bccfc,null))[_0xbe14('0x1c')](function(_0x31d015){if(_0x31d015){_0x1bfcbf=_0x31d015;_0x10c0bc[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x56')][_0xbe14('0x37')]);_0x10c0bc[_0xbe14('0x3b')]=_[_0xbe14('0x3a')](_0x358950[_0xbe14('0x3b')]);_0x10c0bc[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],_0x10c0bc[_0xbe14('0x3b')]);_0x58dd79['attributes']=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x58dd79[_0xbe14('0x3e')]=_0x58dd79[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x58dd79[_0xbe14('0x3e')]:_0x10c0bc[_0xbe14('0x39')];_0x58dd79['order']=qs[_0xbe14('0x44')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x44')]);_0x58dd79[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x358950[_0xbe14('0x3b')],_0x10c0bc[_0xbe14('0x3c')]));if(_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x58dd79[_0xbe14('0x45')]=_['merge'](_0x58dd79[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0x58dd79[_0xbe14('0x3e')],function(_0x29bb26){var _0xaebce8={};_0xaebce8[_0x29bb26]={'$like':'%'+_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0xaebce8;})});}_0x58dd79=_[_0xbe14('0x48')]({},_0x58dd79,_0x358950['options']);return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x2fdf5d){if(_0x2fdf5d){_0x2f4e52=_0x2fdf5d[_0xbe14('0x40')];if(!_0x358950[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x58dd79['limit']=qs['limit'](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2c')]);_0x58dd79[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2b')]);}return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x50e644){if(_0x50e644){return _0x50e644?{'count':_0x2f4e52,'rows':_0x50e644}:null;}})['then'](respondWithResult(_0x4bccfc,null))[_0xbe14('0x26')](handleError(_0x4bccfc,null));};exports[_0xbe14('0x57')]=function(_0x29aa52,_0x57729f,_0x76e91e){if(_0x29aa52[_0xbe14('0x51')]['id']){delete _0x29aa52[_0xbe14('0x51')]['id'];}return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x29aa52[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x57729f,null))['then'](function(_0x43b817){if(_0x43b817){_0x29aa52[_0xbe14('0x51')][_0xbe14('0x58')]=_0x43b817['id'];_0x29aa52[_0xbe14('0x51')][_0xbe14('0x59')]=integrations[_0xbe14('0x5a')](_0x29aa52[_0xbe14('0x51')]['channel'],_0x29aa52[_0xbe14('0x51')][_0xbe14('0x47')]);_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5b')]=integrations[_0xbe14('0x5c')](_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5d')],_0x29aa52[_0xbe14('0x51')]['type']);return db[_0xbe14('0x56')][_0xbe14('0x50')](_0x29aa52[_0xbe14('0x51')],{'include':[{'model':db[_0xbe14('0x5e')],'as':_0xbe14('0x59')},{'model':db[_0xbe14('0x5e')],'as':'Descriptions'}]});}return null;})[_0xbe14('0x1c')](respondWithResult(_0x57729f,null))[_0xbe14('0x26')](handleError(_0x57729f,null));};exports[_0xbe14('0x5f')]=function(_0x1b23a1,_0x508455,_0x7e9e5c){var _0x1578b6='';return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x1b23a1[_0xbe14('0x4d')]['id']},'attributes':['id',_0xbe14('0x60'),_0xbe14('0x61')]})['then'](handleEntityNotFound(_0x508455,null))[_0xbe14('0x1c')](function(_0x589197){if(_0x589197){_0x1578b6=_0x589197[_0xbe14('0x60')];var _0x5d85d3=_0x1578b6[_0xbe14('0x62')](-0x1);if(_0x5d85d3==='/'){_0x1578b6=_0x1578b6[_0xbe14('0x63')](0x0,_0x1578b6[_0xbe14('0x64')](_0x5d85d3));}return rp({'method':'GET','uri':util[_0xbe14('0x65')](_0xbe14('0x66'),_0x1578b6,_0xbe14('0x67')),'headers':{'Authorization':util['format'](_0xbe14('0x68'),new Buffer(util[_0xbe14('0x65')](_0xbe14('0x69'),_0x589197[_0xbe14('0x61')]))['toString'](_0xbe14('0x6a')))},'json':!![]});}})[_0xbe14('0x1c')](function(_0x34f90b){if(_0x34f90b){var _0x2b2e0e=[_0xbe14('0x6b'),_0xbe14('0x6c'),_0xbe14('0x6d'),'description',_0xbe14('0x2d'),_0xbe14('0x6e'),_0xbe14('0x6f'),'source',_0xbe14('0x70'),_0xbe14('0x6f'),_0xbe14('0x71')];_['remove'](_0x34f90b,function(_0xa53262){return _0x2b2e0e[_0xbe14('0x72')](_0xa53262['name'])||!_0xa53262[_0xbe14('0x73')]&&_0xa53262['type']!==_0xbe14('0x74')&&_0xa53262[_0xbe14('0x47')]!=='custom_dropdown';});return{'count':_0x34f90b['length'],'rows':_[_0xbe14('0x35')](_0x34f90b,function(_0x3db955){return{'id':_0x3db955[_0xbe14('0x33')],'name':_0x3db955['label'],'custom':!_0x3db955[_0xbe14('0x73')],'options':_0x3db955[_0xbe14('0x75')]?_[_0xbe14('0x35')](_0x3db955[_0xbe14('0x75')],function(_0x5ee624){return{'name':_['capitalize'](_0x5ee624),'value':_0x5ee624};}):[]};})};}})[_0xbe14('0x1c')](respondWithResult(_0x508455,null))[_0xbe14('0x26')](function(_0xc8d0f6){var _0x215d5b=_0x1b23a1[_0xbe14('0x3b')][_0xbe14('0x19')]?0x1f4:_0xc8d0f6[_0xbe14('0x76')]||0x1f4;logger['error'](_0xbe14('0x77'),'getFields',_0x215d5b,JSON[_0xbe14('0x22')](_0xc8d0f6));delete _0xc8d0f6[_0xbe14('0x33')];if(_0x215d5b===0x191){_0x215d5b=0x190;}_0x508455[_0xbe14('0x2d')](_0x215d5b)[_0xbe14('0x78')](_0x1b23a1['query'][_0xbe14('0x19')]?{'message':_0xbe14('0x79'),'statusCode':_0xc8d0f6[_0xbe14('0x76')]}:_0xc8d0f6);});}; \ No newline at end of file +var _0xa41a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','update','destroy','sendStatus','name','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','FreshdeskConfiguration','map','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject','description','priority','source','ticket_type','company','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce'];(function(_0xc2db1,_0x3aaa66){var _0xd31e47=function(_0x5c10a7){while(--_0x5c10a7){_0xc2db1['push'](_0xc2db1['shift']());}};_0xd31e47(++_0x3aaa66);}(_0xa41a,0x6b));var _0xaa41=function(_0x40e242,_0x1d1a54){_0x40e242=_0x40e242-0x0;var _0x534572=_0xa41a[_0x40e242];return _0x534572;};'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'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaa41('0x18'));var client=jayson['client'][_0xaa41('0x19')]({'port':0x232a});function checkPasswordPattern(_0x12d9e6,_0x2f64bc,_0x889d44){if(_0x889d44){var _0x6f9ade=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6f9ade['test'](_0x2f64bc)){return _0x12d9e6;}else{throw new db[(_0xaa41('0x1a'))][(_0xaa41('0x1b'))](_0xaa41('0x1c'));}}else{return _0x12d9e6;}}function respondWithRpcPromise(_0x1ef7d9,_0x2a6988,_0x2005ae,_0x1e1e02){return new BPromise(function(_0x550ad5,_0x2d868a){var _0x16b930=_0x1e1e02||client;return _0x16b930[_0xaa41('0x1d')](_0x1ef7d9,_0x2005ae)[_0xaa41('0x1e')](function(_0x230a6a){logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));logger[_0xaa41('0x22')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2a6988,'request\x20sent',JSON[_0xaa41('0x23')](_0x230a6a));if(_0x230a6a[_0xaa41('0x24')]){if(_0x230a6a[_0xaa41('0x24')]['code']===0x1f4){logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a['error']['message']);return _0x2d868a(_0x230a6a[_0xaa41('0x24')]['message']);}logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a[_0xaa41('0x24')][_0xaa41('0x25')]);return _0x550ad5(_0x230a6a[_0xaa41('0x24')]['message']);}else{logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));_0x550ad5(_0x230a6a[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x5c3074){logger['error'](_0xaa41('0x20'),_0x2a6988,_0x5c3074);_0x2d868a(_0x5c3074);});});}function respondWithStatusCode(_0x527cac,_0x493a10){_0x493a10=_0x493a10||0xcc;return function(_0x12e362){if(_0x12e362){return _0x527cac['sendStatus'](_0x493a10);}return _0x527cac['status'](_0x493a10)[_0xaa41('0x28')]();};}function respondWithResult(_0x9c8c21,_0x392214){_0x392214=_0x392214||0xc8;return function(_0x632fd2){if(_0x632fd2){return _0x9c8c21[_0xaa41('0x29')](_0x392214)[_0xaa41('0x2a')](_0x632fd2);}};}function respondWithFilteredResult(_0x57ef96,_0x30a174){return function(_0x1f0275){if(_0x1f0275){var _0x63c18c=_0x1f0275[_0xaa41('0x2b')],_0x9a16e3=_0x30a174[_0xaa41('0x2c')],_0x1d8c2b=_0x30a174['offset']+_0x30a174[_0xaa41('0x2d')],_0x4466a3;if(_0x1d8c2b>=_0x63c18c){_0x1d8c2b=_0x63c18c;_0x4466a3=0xc8;}else{_0x4466a3=0xce;}_0x57ef96['status'](_0x4466a3);return _0x57ef96['set'](_0xaa41('0x2e'),_0x9a16e3+'-'+_0x1d8c2b+'/'+_0x63c18c)[_0xaa41('0x2a')](_0x1f0275);}return null;};}function patchUpdates(_0x534a85){return function(_0x392b5d){try{jsonpatch[_0xaa41('0x2f')](_0x392b5d,_0x534a85,!![]);}catch(_0x4e3b44){return BPromise['reject'](_0x4e3b44);}return _0x392b5d['save']();};}function saveUpdates(_0x1cf3da,_0x2f5cc0){return function(_0x2a186e){if(_0x2a186e){return _0x2a186e[_0xaa41('0x30')](_0x1cf3da)['then'](function(_0x289c4a){return _0x289c4a;});}return null;};}function removeEntity(_0x45c8fe,_0x3e0204){return function(_0x4de770){if(_0x4de770){return _0x4de770[_0xaa41('0x31')]()[_0xaa41('0x1e')](function(){_0x45c8fe[_0xaa41('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252c62,_0x374117){return function(_0x57fe1d){if(!_0x57fe1d){_0x252c62[_0xaa41('0x32')](0x194);}return _0x57fe1d;};}function handleError(_0x13b6d4,_0x2298ed){_0x2298ed=_0x2298ed||0x1f4;return function(_0x5cec87){logger[_0xaa41('0x24')](_0x5cec87['stack']);if(_0x5cec87[_0xaa41('0x33')]){delete _0x5cec87[_0xaa41('0x33')];}_0x13b6d4[_0xaa41('0x29')](_0x2298ed)['send'](_0x5cec87);};}exports['index']=function(_0x4cdd42,_0x2dc05a){var _0x2e785f={},_0x1334c8={},_0x224eb3={'count':0x0,'rows':[]};var _0x4fbb92=_['map'](db[_0xaa41('0x34')][_0xaa41('0x35')],function(_0x951e52){return{'name':_0x951e52[_0xaa41('0x36')],'type':_0x951e52[_0xaa41('0x37')][_0xaa41('0x38')]};});_0x1334c8[_0xaa41('0x39')]=_['map'](_0x4fbb92,_0xaa41('0x33'));_0x1334c8[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x4cdd42[_0xaa41('0x3a')]);_0x1334c8['filters']=_['intersection'](_0x1334c8[_0xaa41('0x39')],_0x1334c8[_0xaa41('0x3a')]);_0x2e785f['attributes']=_[_0xaa41('0x3c')](_0x1334c8['model'],qs[_0xaa41('0x3d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x3d')]));_0x2e785f[_0xaa41('0x3e')]=_0x2e785f[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0x2e785f[_0xaa41('0x3e')]:_0x1334c8[_0xaa41('0x39')];if(!_0x4cdd42['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0x2e785f[_0xaa41('0x2d')]=qs[_0xaa41('0x2d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0x2e785f['offset']=qs['offset'](_0x4cdd42[_0xaa41('0x3a')]['offset']);}_0x2e785f[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x43')]);_0x2e785f[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x4cdd42['query'],_0x1334c8[_0xaa41('0x45')]),_0x4fbb92);if(_0x4cdd42['query']['filter']){_0x2e785f[_0xaa41('0x44')]=_['merge'](_0x2e785f['where'],{'$or':_['map'](_0x4fbb92,function(_0x3bad48){if(_0x3bad48['type']!==_0xaa41('0x47')){var _0x198716={};_0x198716[_0x3bad48['name']]={'$like':'%'+_0x4cdd42['query'][_0xaa41('0x48')]+'%'};return _0x198716;}})});}_0x2e785f=_[_0xaa41('0x49')]({},_0x2e785f,_0x4cdd42[_0xaa41('0x4a')]);var _0x2af8ba={'where':_0x2e785f[_0xaa41('0x44')]};return db[_0xaa41('0x34')][_0xaa41('0x2b')](_0x2af8ba)[_0xaa41('0x1e')](function(_0x2fa6ec){_0x224eb3['count']=_0x2fa6ec;if(_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x2e785f[_0xaa41('0x4c')]=[{'all':!![]}];}return db[_0xaa41('0x34')][_0xaa41('0x4d')](_0x2e785f);})[_0xaa41('0x1e')](function(_0x538b12){_0x224eb3[_0xaa41('0x4e')]=_0x538b12;return _0x224eb3;})[_0xaa41('0x1e')](respondWithFilteredResult(_0x2dc05a,_0x2e785f))[_0xaa41('0x27')](handleError(_0x2dc05a,null));};exports[_0xaa41('0x4f')]=function(_0x57d1f6,_0x23bc61){var _0x5787f3={'raw':![],'where':{'id':_0x57d1f6[_0xaa41('0x50')]['id']}},_0x49fedd={};_0x49fedd[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db['FreshdeskAccount'][_0xaa41('0x35')]);_0x49fedd[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x57d1f6['query']);_0x49fedd[_0xaa41('0x45')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],_0x49fedd[_0xaa41('0x3a')]);_0x5787f3[_0xaa41('0x3e')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],qs[_0xaa41('0x3d')](_0x57d1f6['query'][_0xaa41('0x3d')]));_0x5787f3['attributes']=_0x5787f3['attributes'][_0xaa41('0x3f')]?_0x5787f3[_0xaa41('0x3e')]:_0x49fedd[_0xaa41('0x39')];if(_0x57d1f6[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x5787f3[_0xaa41('0x4c')]=[{'all':!![]}];}_0x5787f3=_[_0xaa41('0x49')]({},_0x5787f3,_0x57d1f6[_0xaa41('0x4a')]);return db['FreshdeskAccount'][_0xaa41('0x51')](_0x5787f3)[_0xaa41('0x1e')](handleEntityNotFound(_0x23bc61,null))[_0xaa41('0x1e')](respondWithResult(_0x23bc61,null))['catch'](handleError(_0x23bc61,null));};exports[_0xaa41('0x52')]=function(_0x35f664,_0x4cf674){return db[_0xaa41('0x34')][_0xaa41('0x52')](_0x35f664[_0xaa41('0x53')],{})['then'](respondWithResult(_0x4cf674,0xc9))[_0xaa41('0x27')](handleError(_0x4cf674,null));};exports[_0xaa41('0x30')]=function(_0x4e3b13,_0x49789a){if(_0x4e3b13[_0xaa41('0x53')]['id']){delete _0x4e3b13[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')]['find']({'where':{'id':_0x4e3b13[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x49789a,null))[_0xaa41('0x1e')](saveUpdates(_0x4e3b13[_0xaa41('0x53')],null))[_0xaa41('0x1e')](respondWithResult(_0x49789a,null))['catch'](handleError(_0x49789a,null));};exports[_0xaa41('0x31')]=function(_0x57cb70,_0x555186){return db[_0xaa41('0x34')]['find']({'where':{'id':_0x57cb70[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x555186,null))[_0xaa41('0x1e')](removeEntity(_0x555186,null))['catch'](handleError(_0x555186,null));};exports[_0xaa41('0x54')]=function(_0x41c7f4,_0x36154e,_0x857bbc){var _0xa1f9f9={};var _0x332a3c={};var _0xc56018;var _0x337059;return db[_0xaa41('0x34')]['findOne']({'where':{'id':_0x41c7f4[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x36154e,null))[_0xaa41('0x1e')](function(_0x5a5a55){if(_0x5a5a55){_0xc56018=_0x5a5a55;_0x332a3c[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db[_0xaa41('0x55')][_0xaa41('0x35')]);_0x332a3c[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x41c7f4[_0xaa41('0x3a')]);_0x332a3c['filters']=_['intersection'](_0x332a3c['model'],_0x332a3c['query']);_0xa1f9f9['attributes']=_['intersection'](_0x332a3c[_0xaa41('0x39')],qs['fields'](_0x41c7f4['query'][_0xaa41('0x3d')]));_0xa1f9f9[_0xaa41('0x3e')]=_0xa1f9f9[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0xa1f9f9['attributes']:_0x332a3c[_0xaa41('0x39')];_0xa1f9f9[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x43')]);_0xa1f9f9[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x41c7f4[_0xaa41('0x3a')],_0x332a3c['filters']));if(_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]){_0xa1f9f9['where']=_['merge'](_0xa1f9f9['where'],{'$or':_[_0xaa41('0x56')](_0xa1f9f9['attributes'],function(_0x1eac4a){var _0x5c8028={};_0x5c8028[_0x1eac4a]={'$like':'%'+_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]+'%'};return _0x5c8028;})});}_0xa1f9f9=_['merge']({},_0xa1f9f9,_0x41c7f4[_0xaa41('0x4a')]);return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})[_0xaa41('0x1e')](function(_0x33f5c2){if(_0x33f5c2){_0x337059=_0x33f5c2['length'];if(!_0x41c7f4['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0xa1f9f9['limit']=qs['limit'](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0xa1f9f9[_0xaa41('0x2c')]=qs[_0xaa41('0x2c')](_0x41c7f4[_0xaa41('0x3a')]['offset']);}return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})['then'](function(_0x5062db){if(_0x5062db){return _0x5062db?{'count':_0x337059,'rows':_0x5062db}:null;}})['then'](respondWithResult(_0x36154e,null))[_0xaa41('0x27')](handleError(_0x36154e,null));};exports[_0xaa41('0x57')]=function(_0x436362,_0x5bad74,_0x229297){if(_0x436362[_0xaa41('0x53')]['id']){delete _0x436362[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x436362[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x5bad74,null))['then'](function(_0x1d2978){if(_0x1d2978){_0x436362[_0xaa41('0x53')][_0xaa41('0x59')]=_0x1d2978['id'];_0x436362[_0xaa41('0x53')]['Subjects']=integrations[_0xaa41('0x5a')](_0x436362['body'][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')][_0xaa41('0x37')]);_0x436362[_0xaa41('0x53')]['Descriptions']=integrations[_0xaa41('0x5c')](_0x436362[_0xaa41('0x53')][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')]['type']);return db[_0xaa41('0x55')]['create'](_0x436362[_0xaa41('0x53')],{'include':[{'model':db[_0xaa41('0x5d')],'as':'Subjects'},{'model':db[_0xaa41('0x5d')],'as':_0xaa41('0x5e')}]});}return null;})[_0xaa41('0x1e')](respondWithResult(_0x5bad74,null))[_0xaa41('0x27')](handleError(_0x5bad74,null));};exports[_0xaa41('0x5f')]=function(_0x1338d3,_0x384aba,_0x297ec6){var _0x33b5f4='';return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x1338d3['params']['id']},'attributes':['id',_0xaa41('0x60'),_0xaa41('0x61')]})[_0xaa41('0x1e')](handleEntityNotFound(_0x384aba,null))['then'](function(_0x5ec19b){if(_0x5ec19b){_0x33b5f4=_0x5ec19b[_0xaa41('0x60')];var _0x39da69=_0x33b5f4['slice'](-0x1);if(_0x39da69==='/'){_0x33b5f4=_0x33b5f4[_0xaa41('0x62')](0x0,_0x33b5f4[_0xaa41('0x63')](_0x39da69));}return rp({'method':'GET','uri':util[_0xaa41('0x64')](_0xaa41('0x65'),_0x33b5f4,_0xaa41('0x66')),'headers':{'Authorization':util[_0xaa41('0x64')](_0xaa41('0x67'),new Buffer(util[_0xaa41('0x64')](_0xaa41('0x68'),_0x5ec19b[_0xaa41('0x61')]))['toString']('base64'))},'json':!![]});}})[_0xaa41('0x1e')](function(_0x481db9){if(_0x481db9){var _0x654594=[_0xaa41('0x69'),_0xaa41('0x6a'),'agent',_0xaa41('0x6b'),_0xaa41('0x29'),_0xaa41('0x6c'),'group',_0xaa41('0x6d'),_0xaa41('0x6e'),'group',_0xaa41('0x6f')];_['remove'](_0x481db9,function(_0x53faf4){return _0x654594[_0xaa41('0x70')](_0x53faf4[_0xaa41('0x33')])||!_0x53faf4['default']&&_0x53faf4['type']!==_0xaa41('0x71')&&_0x53faf4[_0xaa41('0x37')]!==_0xaa41('0x72');});return{'count':_0x481db9[_0xaa41('0x3f')],'rows':_['map'](_0x481db9,function(_0x9741a8){return{'id':_0x9741a8[_0xaa41('0x33')],'name':_0x9741a8[_0xaa41('0x73')],'custom':!_0x9741a8['default'],'options':_0x9741a8[_0xaa41('0x74')]?_[_0xaa41('0x56')](_0x9741a8[_0xaa41('0x74')],function(_0x5697b6){return{'name':_[_0xaa41('0x75')](_0x5697b6),'value':_0x5697b6};}):[]};})};}})['then'](respondWithResult(_0x384aba,null))['catch'](function(_0x364d24){var _0x25c4d0=_0x1338d3['query'][_0xaa41('0x76')]?0x1f4:_0x364d24[_0xaa41('0x77')]||0x1f4;logger[_0xaa41('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xaa41('0x5f'),_0x25c4d0,JSON[_0xaa41('0x23')](_0x364d24));delete _0x364d24[_0xaa41('0x33')];if(_0x25c4d0===0x191){_0x25c4d0=0x190;}_0x384aba[_0xaa41('0x29')](_0x25c4d0)[_0xaa41('0x78')](_0x1338d3['query'][_0xaa41('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x364d24[_0xaa41('0x77')]}:_0x364d24);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 4fb2805..e29ccd3 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 _0xe550=['exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xe550,0x1be));var _0x0e55=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe550[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0e55('0x0'));var util=require('util');var logger=require(_0x0e55('0x1'))('api');var moment=require(_0x0e55('0x2'));var BPromise=require(_0x0e55('0x3'));var rp=require(_0x0e55('0x4'));var fs=require('fs');var path=require(_0x0e55('0x5'));var rimraf=require(_0x0e55('0x6'));var config=require(_0x0e55('0x7'));var attributes=require(_0x0e55('0x8'));var integrations=require(_0x0e55('0x9'));module[_0x0e55('0xa')]=function(_0x47827f,_0x4dacdb){return _0x47827f[_0x0e55('0xb')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdeeb=['bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xdeeb,0x17c));var _0xbdee=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xdeeb[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0xbdee('0x0'));var util=require('util');var logger=require(_0xbdee('0x1'))(_0xbdee('0x2'));var moment=require(_0xbdee('0x3'));var BPromise=require(_0xbdee('0x4'));var rp=require(_0xbdee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdee('0x6'));var config=require('../../config/environment');var attributes=require(_0xbdee('0x7'));var integrations=require(_0xbdee('0x8'));module['exports']=function(_0x3fd2d6,_0x449369){return _0x3fd2d6[_0xbdee('0x9')](_0xbdee('0xa'),attributes,{'tableName':_0xbdee('0xb'),'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 267644c..1680911 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 _0x94e7=['map','then','GetFreshdeskAccount','find','where','ShowFreshdeskAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','FreshdeskAccount','findAll','options','raw','attributes','include','model'];(function(_0x284c15,_0x1fde1d){var _0x13918d=function(_0x1ee748){while(--_0x1ee748){_0x284c15['push'](_0x284c15['shift']());}};_0x13918d(++_0x1fde1d);}(_0x94e7,0x1db));var _0x794e=function(_0x396dd5,_0x5b027f){_0x396dd5=_0x396dd5-0x0;var _0x5a0667=_0x94e7[_0x396dd5];return _0x5a0667;};'use strict';var _=require(_0x794e('0x0'));var util=require(_0x794e('0x1'));var moment=require(_0x794e('0x2'));var BPromise=require(_0x794e('0x3'));var rs=require(_0x794e('0x4'));var fs=require('fs');var Redis=require(_0x794e('0x5'));var db=require(_0x794e('0x6'))['db'];var utils=require(_0x794e('0x7'));var logger=require('../../config/logger')(_0x794e('0x8'));var config=require(_0x794e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x794e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12ae19,_0x22a1d9,_0x1cb65a){return new BPromise(function(_0x54942d,_0x9d27de){return client[_0x794e('0xb')](_0x12ae19,_0x1cb65a)['then'](function(_0x31fe0e){logger[_0x794e('0xc')](_0x794e('0xd'),_0x22a1d9,_0x794e('0xe'));logger[_0x794e('0xf')](_0x794e('0x10'),_0x22a1d9,_0x794e('0xe'),JSON[_0x794e('0x11')](_0x31fe0e));if(_0x31fe0e['error']){if(_0x31fe0e['error'][_0x794e('0x12')]===0x1f4){logger[_0x794e('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x22a1d9,_0x31fe0e[_0x794e('0x13')]['message']);return _0x9d27de(_0x31fe0e[_0x794e('0x13')]['message']);}logger[_0x794e('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x22a1d9,_0x31fe0e['error'][_0x794e('0x14')]);return _0x54942d(_0x31fe0e[_0x794e('0x13')]['message']);}else{logger['info'](_0x794e('0xd'),_0x22a1d9,_0x794e('0xe'));_0x54942d(_0x31fe0e[_0x794e('0x15')][_0x794e('0x14')]);}})['catch'](function(_0x4ff728){logger[_0x794e('0x13')](_0x794e('0xd'),_0x22a1d9,_0x4ff728);_0x9d27de(_0x4ff728);});});}exports['GetFreshdeskAccount']=function(_0x4a6752){var _0x2a02b6=this;return new Promise(function(_0x1257d3,_0x5c503b){return db[_0x794e('0x16')][_0x794e('0x17')]({'raw':_0x4a6752[_0x794e('0x18')]?_0x4a6752[_0x794e('0x18')][_0x794e('0x19')]===undefined?!![]:![]:!![],'where':_0x4a6752['options']?_0x4a6752[_0x794e('0x18')]['where']||null:null,'attributes':_0x4a6752['options']?_0x4a6752[_0x794e('0x18')][_0x794e('0x1a')]||null:null,'limit':_0x4a6752[_0x794e('0x18')]?_0x4a6752[_0x794e('0x18')]['limit']||null:null,'include':_0x4a6752[_0x794e('0x18')]?_0x4a6752[_0x794e('0x18')][_0x794e('0x1b')]?_['map'](_0x4a6752[_0x794e('0x18')]['include'],function(_0x30b5dd){return{'model':db[_0x30b5dd[_0x794e('0x1c')]],'as':_0x30b5dd['as'],'attributes':_0x30b5dd[_0x794e('0x1a')],'include':_0x30b5dd['include']?_[_0x794e('0x1d')](_0x30b5dd[_0x794e('0x1b')],function(_0x34519e){return{'model':db[_0x34519e[_0x794e('0x1c')]],'as':_0x34519e['as'],'attributes':_0x34519e[_0x794e('0x1a')],'include':_0x34519e[_0x794e('0x1b')]?_[_0x794e('0x1d')](_0x34519e[_0x794e('0x1b')],function(_0x2c6e26){return{'model':db[_0x2c6e26['model']],'as':_0x2c6e26['as'],'attributes':_0x2c6e26['attributes']};}):[]};}):[]};}):[]:[]})[_0x794e('0x1e')](function(_0x4408bc){logger[_0x794e('0xc')](_0x794e('0x1f'),_0x4a6752);logger[_0x794e('0xf')](_0x794e('0x1f'),_0x4a6752,JSON[_0x794e('0x11')](_0x4408bc));_0x1257d3(_0x4408bc);})['catch'](function(_0x1b7ca3){logger[_0x794e('0x13')]('GetFreshdeskAccount',_0x1b7ca3['message'],_0x4a6752);_0x5c503b(_0x2a02b6[_0x794e('0x13')](0x1f4,_0x1b7ca3[_0x794e('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x15bc9c){var _0x189979=this;return new Promise(function(_0x547828,_0x264db7){return db[_0x794e('0x16')][_0x794e('0x20')]({'raw':_0x15bc9c['options']?_0x15bc9c[_0x794e('0x18')][_0x794e('0x19')]===undefined?!![]:![]:!![],'where':_0x15bc9c[_0x794e('0x18')]?_0x15bc9c[_0x794e('0x18')][_0x794e('0x21')]||null:null,'attributes':_0x15bc9c[_0x794e('0x18')]?_0x15bc9c[_0x794e('0x18')][_0x794e('0x1a')]||null:null,'include':_0x15bc9c[_0x794e('0x18')]?_0x15bc9c[_0x794e('0x18')]['include']?_['map'](_0x15bc9c['options'][_0x794e('0x1b')],function(_0x670f1b){return{'model':db[_0x670f1b[_0x794e('0x1c')]],'as':_0x670f1b['as'],'attributes':_0x670f1b[_0x794e('0x1a')],'include':_0x670f1b[_0x794e('0x1b')]?_['map'](_0x670f1b[_0x794e('0x1b')],function(_0x1f5cfb){return{'model':db[_0x1f5cfb[_0x794e('0x1c')]],'as':_0x1f5cfb['as'],'attributes':_0x1f5cfb[_0x794e('0x1a')],'include':_0x1f5cfb[_0x794e('0x1b')]?_[_0x794e('0x1d')](_0x1f5cfb[_0x794e('0x1b')],function(_0x26479a){return{'model':db[_0x26479a[_0x794e('0x1c')]],'as':_0x26479a['as'],'attributes':_0x26479a[_0x794e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x794e('0x1e')](function(_0x51020f){logger[_0x794e('0xc')](_0x794e('0x22'),_0x15bc9c);logger[_0x794e('0xf')](_0x794e('0x22'),_0x15bc9c,JSON[_0x794e('0x11')](_0x51020f));_0x547828(_0x51020f);})[_0x794e('0x23')](function(_0x1f0253){logger['error'](_0x794e('0x22'),_0x1f0253['message'],_0x15bc9c);_0x264db7(_0x189979[_0x794e('0x13')](0x1f4,_0x1f0253['message']));});});}; \ No newline at end of file +var _0x7400=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount','find','where','lodash','util','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7400,0xcf));var _0x0740=function(_0x30bef2,_0x3d4186){_0x30bef2=_0x30bef2-0x0;var _0x567d67=_0x7400[_0x30bef2];return _0x567d67;};'use strict';var _=require(_0x0740('0x0'));var util=require(_0x0740('0x1'));var moment=require(_0x0740('0x2'));var BPromise=require('bluebird');var rs=require(_0x0740('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0740('0x4'))['db'];var utils=require(_0x0740('0x5'));var logger=require(_0x0740('0x6'))(_0x0740('0x7'));var config=require(_0x0740('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0740('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c9978,_0x54258e,_0x48d5f1){return new BPromise(function(_0x466ee2,_0x5e5fe5){return client['request'](_0x3c9978,_0x48d5f1)[_0x0740('0xa')](function(_0x6e501d){logger[_0x0740('0xb')](_0x0740('0xc'),_0x54258e,_0x0740('0xd'));logger[_0x0740('0xe')](_0x0740('0xf'),_0x54258e,_0x0740('0xd'),JSON[_0x0740('0x10')](_0x6e501d));if(_0x6e501d[_0x0740('0x11')]){if(_0x6e501d[_0x0740('0x11')][_0x0740('0x12')]===0x1f4){logger[_0x0740('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x54258e,_0x6e501d[_0x0740('0x11')][_0x0740('0x13')]);return _0x5e5fe5(_0x6e501d[_0x0740('0x11')][_0x0740('0x13')]);}logger[_0x0740('0x11')](_0x0740('0xc'),_0x54258e,_0x6e501d[_0x0740('0x11')][_0x0740('0x13')]);return _0x466ee2(_0x6e501d['error'][_0x0740('0x13')]);}else{logger[_0x0740('0xb')](_0x0740('0xc'),_0x54258e,_0x0740('0xd'));_0x466ee2(_0x6e501d[_0x0740('0x14')][_0x0740('0x13')]);}})[_0x0740('0x15')](function(_0x2472dc){logger[_0x0740('0x11')](_0x0740('0xc'),_0x54258e,_0x2472dc);_0x5e5fe5(_0x2472dc);});});}exports[_0x0740('0x16')]=function(_0x560360){var _0x148e3a=this;return new Promise(function(_0x62bb01,_0x38baef){return db['FreshdeskAccount'][_0x0740('0x17')]({'raw':_0x560360[_0x0740('0x18')]?_0x560360[_0x0740('0x18')][_0x0740('0x19')]===undefined?!![]:![]:!![],'where':_0x560360['options']?_0x560360[_0x0740('0x18')]['where']||null:null,'attributes':_0x560360['options']?_0x560360[_0x0740('0x18')][_0x0740('0x1a')]||null:null,'limit':_0x560360[_0x0740('0x18')]?_0x560360['options'][_0x0740('0x1b')]||null:null,'include':_0x560360['options']?_0x560360[_0x0740('0x18')][_0x0740('0x1c')]?_[_0x0740('0x1d')](_0x560360[_0x0740('0x18')][_0x0740('0x1c')],function(_0x301cda){return{'model':db[_0x301cda[_0x0740('0x1e')]],'as':_0x301cda['as'],'attributes':_0x301cda[_0x0740('0x1a')],'include':_0x301cda[_0x0740('0x1c')]?_[_0x0740('0x1d')](_0x301cda[_0x0740('0x1c')],function(_0x1ad1b0){return{'model':db[_0x1ad1b0[_0x0740('0x1e')]],'as':_0x1ad1b0['as'],'attributes':_0x1ad1b0['attributes'],'include':_0x1ad1b0[_0x0740('0x1c')]?_[_0x0740('0x1d')](_0x1ad1b0['include'],function(_0x239a28){return{'model':db[_0x239a28['model']],'as':_0x239a28['as'],'attributes':_0x239a28[_0x0740('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0740('0xa')](function(_0x56f046){logger[_0x0740('0xb')]('GetFreshdeskAccount',_0x560360);logger[_0x0740('0xe')](_0x0740('0x16'),_0x560360,JSON[_0x0740('0x10')](_0x56f046));_0x62bb01(_0x56f046);})['catch'](function(_0x4f23a3){logger[_0x0740('0x11')](_0x0740('0x16'),_0x4f23a3[_0x0740('0x13')],_0x560360);_0x38baef(_0x148e3a[_0x0740('0x11')](0x1f4,_0x4f23a3[_0x0740('0x13')]));});});};exports[_0x0740('0x1f')]=function(_0x21dba9){var _0x53cb8a=this;return new Promise(function(_0x299edc,_0x3b4e10){return db[_0x0740('0x20')][_0x0740('0x21')]({'raw':_0x21dba9[_0x0740('0x18')]?_0x21dba9['options'][_0x0740('0x19')]===undefined?!![]:![]:!![],'where':_0x21dba9[_0x0740('0x18')]?_0x21dba9['options'][_0x0740('0x22')]||null:null,'attributes':_0x21dba9[_0x0740('0x18')]?_0x21dba9['options']['attributes']||null:null,'include':_0x21dba9[_0x0740('0x18')]?_0x21dba9[_0x0740('0x18')]['include']?_[_0x0740('0x1d')](_0x21dba9['options'][_0x0740('0x1c')],function(_0x1ceff7){return{'model':db[_0x1ceff7[_0x0740('0x1e')]],'as':_0x1ceff7['as'],'attributes':_0x1ceff7['attributes'],'include':_0x1ceff7['include']?_['map'](_0x1ceff7[_0x0740('0x1c')],function(_0x91a2fb){return{'model':db[_0x91a2fb['model']],'as':_0x91a2fb['as'],'attributes':_0x91a2fb[_0x0740('0x1a')],'include':_0x91a2fb[_0x0740('0x1c')]?_[_0x0740('0x1d')](_0x91a2fb[_0x0740('0x1c')],function(_0x26402e){return{'model':db[_0x26402e[_0x0740('0x1e')]],'as':_0x26402e['as'],'attributes':_0x26402e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0740('0xa')](function(_0x1ae6fd){logger[_0x0740('0xb')](_0x0740('0x1f'),_0x21dba9);logger[_0x0740('0xe')](_0x0740('0x1f'),_0x21dba9,JSON[_0x0740('0x10')](_0x1ae6fd));_0x299edc(_0x1ae6fd);})['catch'](function(_0x3174d4){logger['error'](_0x0740('0x1f'),_0x3174d4[_0x0740('0x13')],_0x21dba9);_0x3b4e10(_0x53cb8a[_0x0740('0x11')](0x1f4,_0x3174d4[_0x0740('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8819600..ab3eecf 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 _0xe6bf=['isAuthenticated','/:id/subjects','getSubjects','/:id/tags','create','post','setTags','update','exports','util','path','express','Router','../../components/interaction/service','index','get','/:id','show','/:id/fields'];(function(_0x5beb3e,_0x387c41){var _0x1ecf0b=function(_0x1820fb){while(--_0x1820fb){_0x5beb3e['push'](_0x5beb3e['shift']());}};_0x1ecf0b(++_0x387c41);}(_0xe6bf,0xa1));var _0xfe6b=function(_0x556081,_0x5c6fb4){_0x556081=_0x556081-0x0;var _0x5872bf=_0xe6bf[_0x556081];return _0x5872bf;};'use strict';var multer=require('multer');var util=require(_0xfe6b('0x0'));var path=require(_0xfe6b('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe6b('0x2'));var router=express[_0xfe6b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfe6b('0x4'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfe6b('0x5')]);router[_0xfe6b('0x6')](_0xfe6b('0x7'),auth['isAuthenticated'](),controller[_0xfe6b('0x8')]);router['get'](_0xfe6b('0x9'),auth[_0xfe6b('0xa')](),controller['getFields']);router[_0xfe6b('0x6')](_0xfe6b('0xb'),auth[_0xfe6b('0xa')](),controller[_0xfe6b('0xc')]);router[_0xfe6b('0x6')]('/:id/descriptions',auth[_0xfe6b('0xa')](),controller['getDescriptions']);router['get'](_0xfe6b('0xd'),auth[_0xfe6b('0xa')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0xfe6b('0xe')]);router[_0xfe6b('0xf')]('/:id/tags',auth[_0xfe6b('0xa')](),controller[_0xfe6b('0x10')]);router['put'](_0xfe6b('0x7'),auth[_0xfe6b('0xa')](),controller[_0xfe6b('0x11')]);router['delete'](_0xfe6b('0x7'),auth[_0xfe6b('0xa')](),controller['destroy']);module[_0xfe6b('0x12')]=router; \ No newline at end of file +var _0x6adb=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6adb,0x93));var _0xb6ad=function(_0x582246,_0xa45179){_0x582246=_0x582246-0x0;var _0x2bcbcd=_0x6adb[_0x582246];return _0x2bcbcd;};'use strict';var multer=require(_0xb6ad('0x0'));var util=require(_0xb6ad('0x1'));var path=require(_0xb6ad('0x2'));var timeout=require(_0xb6ad('0x3'));var express=require(_0xb6ad('0x4'));var router=express[_0xb6ad('0x5')]();var auth=require(_0xb6ad('0x6'));var interaction=require(_0xb6ad('0x7'));var config=require(_0xb6ad('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xb6ad('0x9')]('/',auth[_0xb6ad('0xa')](),controller[_0xb6ad('0xb')]);router[_0xb6ad('0x9')]('/:id',auth[_0xb6ad('0xa')](),controller[_0xb6ad('0xc')]);router[_0xb6ad('0x9')]('/:id/fields',auth[_0xb6ad('0xa')](),controller[_0xb6ad('0xd')]);router[_0xb6ad('0x9')](_0xb6ad('0xe'),auth['isAuthenticated'](),controller[_0xb6ad('0xf')]);router['get'](_0xb6ad('0x10'),auth['isAuthenticated'](),controller[_0xb6ad('0x11')]);router['get'](_0xb6ad('0x12'),auth[_0xb6ad('0xa')](),controller[_0xb6ad('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb6ad('0x14')]);router['post'](_0xb6ad('0x12'),auth[_0xb6ad('0xa')](),controller['setTags']);router['put'](_0xb6ad('0x15'),auth[_0xb6ad('0xa')](),controller['update']);router['delete'](_0xb6ad('0x15'),auth['isAuthenticated'](),controller[_0xb6ad('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index a688135..c9ce75b 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x96c8=['sequelize','STRING'];(function(_0x54696d,_0x478646){var _0x35cf32=function(_0x5e6c7d){while(--_0x5e6c7d){_0x54696d['push'](_0x54696d['shift']());}};_0x35cf32(++_0x478646);}(_0x96c8,0xbe));var _0x896c=function(_0x1aa65b,_0x2c47c9){_0x1aa65b=_0x1aa65b-0x0;var _0x2b507e=_0x96c8[_0x1aa65b];return _0x2b507e;};'use strict';var Sequelize=require(_0x896c('0x0'));module['exports']={'name':{'type':Sequelize[_0x896c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b1ad3ee..18238b5 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 _0x3821=['json','apply','save','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','FreshdeskConfiguration','findAll','catch','show','params','length','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','zip-dir','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/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','count','offset','limit','set','Content-Range'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0x3821,0xf7));var _0x1382=function(_0xdda583,_0x15d170){_0xdda583=_0xdda583-0x0;var _0x204e58=_0x3821[_0xdda583];return _0x204e58;};'use strict';var pdf=require(_0x1382('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1382('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1382('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1382('0x3'));var util=require(_0x1382('0x4'));var path=require(_0x1382('0x5'));var sox=require(_0x1382('0x6'));var csv=require(_0x1382('0x7'));var ejs=require(_0x1382('0x8'));var fs=require('fs');var _=require(_0x1382('0x9'));var squel=require(_0x1382('0xa'));var crypto=require(_0x1382('0xb'));var jsforce=require(_0x1382('0xc'));var deskjs=require(_0x1382('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1382('0xe'));var Papa=require(_0x1382('0xf'));var Redis=require(_0x1382('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1382('0x11'));var as=require(_0x1382('0x12'));var hardwareService=require(_0x1382('0x13'));var logger=require(_0x1382('0x14'))(_0x1382('0x15'));var utils=require(_0x1382('0x16'));var config=require(_0x1382('0x17'));var db=require(_0x1382('0x18'))['db'];var jayson=require(_0x1382('0x19'));var client=jayson[_0x1382('0x1a')][_0x1382('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x518711,_0x4b2cb5,_0x3cb361){if(_0x3cb361){var _0x46f3bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46f3bc['test'](_0x4b2cb5)){return _0x518711;}else{throw new db[(_0x1382('0x1c'))]['ValidationError'](_0x1382('0x1d'));}}else{return _0x518711;}}function respondWithRpcPromise(_0x5dd57f,_0x21ffdd,_0x2ce952,_0x204418){return new BPromise(function(_0x21f436,_0x3d4201){var _0x84f01f=_0x204418||client;return _0x84f01f[_0x1382('0x1e')](_0x5dd57f,_0x2ce952)[_0x1382('0x1f')](function(_0x12b023){logger[_0x1382('0x20')](_0x1382('0x21'),_0x21ffdd,_0x1382('0x22'));logger['debug'](_0x1382('0x23'),_0x21ffdd,_0x1382('0x22'),JSON[_0x1382('0x24')](_0x12b023));if(_0x12b023[_0x1382('0x25')]){if(_0x12b023[_0x1382('0x25')]['code']===0x1f4){logger[_0x1382('0x25')](_0x1382('0x21'),_0x21ffdd,_0x12b023[_0x1382('0x25')][_0x1382('0x26')]);return _0x3d4201(_0x12b023[_0x1382('0x25')][_0x1382('0x26')]);}logger[_0x1382('0x25')](_0x1382('0x21'),_0x21ffdd,_0x12b023[_0x1382('0x25')][_0x1382('0x26')]);return _0x21f436(_0x12b023[_0x1382('0x25')][_0x1382('0x26')]);}else{logger[_0x1382('0x20')](_0x1382('0x21'),_0x21ffdd,_0x1382('0x22'));_0x21f436(_0x12b023[_0x1382('0x27')][_0x1382('0x26')]);}})['catch'](function(_0x4594c6){logger[_0x1382('0x25')](_0x1382('0x21'),_0x21ffdd,_0x4594c6);_0x3d4201(_0x4594c6);});});}function respondWithStatusCode(_0x5716f2,_0xc6bcc2){_0xc6bcc2=_0xc6bcc2||0xcc;return function(_0x39a3fe){if(_0x39a3fe){return _0x5716f2[_0x1382('0x28')](_0xc6bcc2);}return _0x5716f2[_0x1382('0x29')](_0xc6bcc2)['end']();};}function respondWithResult(_0x6cc975,_0x5564d6){_0x5564d6=_0x5564d6||0xc8;return function(_0x3a3998){if(_0x3a3998){return _0x6cc975[_0x1382('0x29')](_0x5564d6)['json'](_0x3a3998);}};}function respondWithFilteredResult(_0x5a5ee4,_0x3bfe14){return function(_0x203a43){if(_0x203a43){var _0x136310=_0x203a43[_0x1382('0x2a')],_0x7740c4=_0x3bfe14[_0x1382('0x2b')],_0x2cf6c8=_0x3bfe14[_0x1382('0x2b')]+_0x3bfe14[_0x1382('0x2c')],_0x253906;if(_0x2cf6c8>=_0x136310){_0x2cf6c8=_0x136310;_0x253906=0xc8;}else{_0x253906=0xce;}_0x5a5ee4[_0x1382('0x29')](_0x253906);return _0x5a5ee4[_0x1382('0x2d')](_0x1382('0x2e'),_0x7740c4+'-'+_0x2cf6c8+'/'+_0x136310)[_0x1382('0x2f')](_0x203a43);}return null;};}function patchUpdates(_0x145fe5){return function(_0xacbed8){try{jsonpatch[_0x1382('0x30')](_0xacbed8,_0x145fe5,!![]);}catch(_0x502020){return BPromise['reject'](_0x502020);}return _0xacbed8[_0x1382('0x31')]();};}function saveUpdates(_0x5e11db,_0x50fbfd){return function(_0x2f26cc){if(_0x2f26cc){return _0x2f26cc[_0x1382('0x32')](_0x5e11db)[_0x1382('0x1f')](function(_0x491ee1){return _0x491ee1;});}return null;};}function removeEntity(_0xa4c182,_0x216900){return function(_0x5f05db){if(_0x5f05db){return _0x5f05db[_0x1382('0x33')]()[_0x1382('0x1f')](function(){_0xa4c182[_0x1382('0x29')](0xcc)[_0x1382('0x34')]();});}};}function handleEntityNotFound(_0x193807,_0x48b0c4){return function(_0x1a90c6){if(!_0x1a90c6){_0x193807[_0x1382('0x28')](0x194);}return _0x1a90c6;};}function handleError(_0x31ebdd,_0x4d413c){_0x4d413c=_0x4d413c||0x1f4;return function(_0x59c242){logger[_0x1382('0x25')](_0x59c242[_0x1382('0x35')]);if(_0x59c242[_0x1382('0x36')]){delete _0x59c242[_0x1382('0x36')];}_0x31ebdd['status'](_0x4d413c)[_0x1382('0x37')](_0x59c242);};}exports['index']=function(_0x27a4a8,_0x31cec2){var _0x14b68c={},_0x68665c={},_0x47844c={'count':0x0,'rows':[]};var _0x2fdcdc=_[_0x1382('0x38')](db['FreshdeskConfiguration'][_0x1382('0x39')],function(_0x2c5285){return{'name':_0x2c5285[_0x1382('0x3a')],'type':_0x2c5285[_0x1382('0x3b')][_0x1382('0x3c')]};});_0x68665c[_0x1382('0x3d')]=_[_0x1382('0x38')](_0x2fdcdc,_0x1382('0x36'));_0x68665c[_0x1382('0x3e')]=_[_0x1382('0x3f')](_0x27a4a8[_0x1382('0x3e')]);_0x68665c[_0x1382('0x40')]=_['intersection'](_0x68665c[_0x1382('0x3d')],_0x68665c[_0x1382('0x3e')]);_0x14b68c[_0x1382('0x41')]=_[_0x1382('0x42')](_0x68665c[_0x1382('0x3d')],qs[_0x1382('0x43')](_0x27a4a8['query'][_0x1382('0x43')]));_0x14b68c[_0x1382('0x41')]=_0x14b68c['attributes']['length']?_0x14b68c[_0x1382('0x41')]:_0x68665c[_0x1382('0x3d')];if(!_0x27a4a8['query'][_0x1382('0x44')](_0x1382('0x45'))){_0x14b68c[_0x1382('0x2c')]=qs[_0x1382('0x2c')](_0x27a4a8['query'][_0x1382('0x2c')]);_0x14b68c[_0x1382('0x2b')]=qs[_0x1382('0x2b')](_0x27a4a8[_0x1382('0x3e')][_0x1382('0x2b')]);}_0x14b68c[_0x1382('0x46')]=qs[_0x1382('0x47')](_0x27a4a8['query'][_0x1382('0x47')]);_0x14b68c[_0x1382('0x48')]=qs[_0x1382('0x40')](_[_0x1382('0x49')](_0x27a4a8[_0x1382('0x3e')],_0x68665c[_0x1382('0x40')]),_0x2fdcdc);if(_0x27a4a8[_0x1382('0x3e')][_0x1382('0x4a')]){_0x14b68c[_0x1382('0x48')]=_['merge'](_0x14b68c[_0x1382('0x48')],{'$or':_['map'](_0x2fdcdc,function(_0x4ea779){if(_0x4ea779[_0x1382('0x3b')]!==_0x1382('0x4b')){var _0x11e364={};_0x11e364[_0x4ea779['name']]={'$like':'%'+_0x27a4a8['query'][_0x1382('0x4a')]+'%'};return _0x11e364;}})});}_0x14b68c=_[_0x1382('0x4c')]({},_0x14b68c,_0x27a4a8[_0x1382('0x4d')]);var _0x1cb125={'where':_0x14b68c[_0x1382('0x48')]};return db['FreshdeskConfiguration']['count'](_0x1cb125)['then'](function(_0x241257){_0x47844c['count']=_0x241257;if(_0x27a4a8[_0x1382('0x3e')][_0x1382('0x4e')]){_0x14b68c[_0x1382('0x4f')]=[{'all':!![]}];}return db[_0x1382('0x50')][_0x1382('0x51')](_0x14b68c);})['then'](function(_0xcd9ebe){_0x47844c['rows']=_0xcd9ebe;return _0x47844c;})['then'](respondWithFilteredResult(_0x31cec2,_0x14b68c))[_0x1382('0x52')](handleError(_0x31cec2,null));};exports[_0x1382('0x53')]=function(_0x4bdca9,_0x220a8){var _0x267b66={'raw':![],'where':{'id':_0x4bdca9[_0x1382('0x54')]['id']}},_0x57e761={};_0x57e761['model']=_[_0x1382('0x3f')](db[_0x1382('0x50')][_0x1382('0x39')]);_0x57e761[_0x1382('0x3e')]=_[_0x1382('0x3f')](_0x4bdca9[_0x1382('0x3e')]);_0x57e761[_0x1382('0x40')]=_[_0x1382('0x42')](_0x57e761[_0x1382('0x3d')],_0x57e761[_0x1382('0x3e')]);_0x267b66[_0x1382('0x41')]=_[_0x1382('0x42')](_0x57e761[_0x1382('0x3d')],qs[_0x1382('0x43')](_0x4bdca9['query'][_0x1382('0x43')]));_0x267b66['attributes']=_0x267b66[_0x1382('0x41')][_0x1382('0x55')]?_0x267b66[_0x1382('0x41')]:_0x57e761[_0x1382('0x3d')];if(_0x4bdca9[_0x1382('0x3e')][_0x1382('0x4e')]){_0x267b66[_0x1382('0x4f')]=[{'all':!![]}];}_0x267b66=_[_0x1382('0x4c')]({},_0x267b66,_0x4bdca9['options']);return db[_0x1382('0x50')][_0x1382('0x56')](_0x267b66)['then'](handleEntityNotFound(_0x220a8,null))[_0x1382('0x1f')](respondWithResult(_0x220a8,null))[_0x1382('0x52')](handleError(_0x220a8,null));};exports[_0x1382('0x57')]=function(_0x1e6487,_0x5212ff){return db[_0x1382('0x50')]['create'](_0x1e6487[_0x1382('0x58')],{})['then'](respondWithResult(_0x5212ff,0xc9))['catch'](handleError(_0x5212ff,null));};exports[_0x1382('0x32')]=function(_0x324a2f,_0x316a11){if(_0x324a2f[_0x1382('0x58')]['id']){delete _0x324a2f[_0x1382('0x58')]['id'];}return db['FreshdeskConfiguration'][_0x1382('0x56')]({'where':{'id':_0x324a2f[_0x1382('0x54')]['id']}})[_0x1382('0x1f')](handleEntityNotFound(_0x316a11,null))['then'](saveUpdates(_0x324a2f[_0x1382('0x58')],null))[_0x1382('0x1f')](respondWithResult(_0x316a11,null))[_0x1382('0x52')](handleError(_0x316a11,null));};exports['destroy']=function(_0x153c9c,_0x1268f5){return db[_0x1382('0x50')][_0x1382('0x56')]({'where':{'id':_0x153c9c['params']['id']}})[_0x1382('0x1f')](handleEntityNotFound(_0x1268f5,null))[_0x1382('0x1f')](removeEntity(_0x1268f5,null))['catch'](handleError(_0x1268f5,null));};exports[_0x1382('0x59')]=function(_0x5f46a2,_0x1aeab2,_0x111c32){var _0x292354={};var _0x215b7f={};var _0x43e779;var _0x3083ab;return db[_0x1382('0x50')][_0x1382('0x5a')]({'where':{'id':_0x5f46a2['params']['id']}})[_0x1382('0x1f')](handleEntityNotFound(_0x1aeab2,null))[_0x1382('0x1f')](function(_0x55e498){if(_0x55e498){_0x43e779=_0x55e498;_0x215b7f[_0x1382('0x3d')]=_['keys'](db[_0x1382('0x5b')]['rawAttributes']);_0x215b7f[_0x1382('0x3e')]=_['keys'](_0x5f46a2[_0x1382('0x3e')]);_0x215b7f[_0x1382('0x40')]=_[_0x1382('0x42')](_0x215b7f[_0x1382('0x3d')],_0x215b7f['query']);_0x292354[_0x1382('0x41')]=_['intersection'](_0x215b7f[_0x1382('0x3d')],qs['fields'](_0x5f46a2['query'][_0x1382('0x43')]));_0x292354[_0x1382('0x41')]=_0x292354[_0x1382('0x41')][_0x1382('0x55')]?_0x292354['attributes']:_0x215b7f['model'];_0x292354[_0x1382('0x46')]=qs[_0x1382('0x47')](_0x5f46a2[_0x1382('0x3e')][_0x1382('0x47')]);_0x292354[_0x1382('0x48')]=qs[_0x1382('0x40')](_[_0x1382('0x49')](_0x5f46a2[_0x1382('0x3e')],_0x215b7f[_0x1382('0x40')]));if(_0x5f46a2[_0x1382('0x3e')][_0x1382('0x4a')]){_0x292354[_0x1382('0x48')]=_[_0x1382('0x4c')](_0x292354[_0x1382('0x48')],{'$or':_[_0x1382('0x38')](_0x292354[_0x1382('0x41')],function(_0x2de8cb){var _0x14914d={};_0x14914d[_0x2de8cb]={'$like':'%'+_0x5f46a2[_0x1382('0x3e')]['filter']+'%'};return _0x14914d;})});}_0x292354=_[_0x1382('0x4c')]({},_0x292354,_0x5f46a2[_0x1382('0x4d')]);return _0x43e779['getFields'](_0x292354);}})['then'](function(_0x33f9bb){if(_0x33f9bb){_0x3083ab=_0x33f9bb['length'];if(!_0x5f46a2[_0x1382('0x3e')][_0x1382('0x44')](_0x1382('0x45'))){_0x292354[_0x1382('0x2c')]=qs['limit'](_0x5f46a2['query']['limit']);_0x292354['offset']=qs[_0x1382('0x2b')](_0x5f46a2['query'][_0x1382('0x2b')]);}return _0x43e779[_0x1382('0x59')](_0x292354);}})[_0x1382('0x1f')](function(_0x2103f2){if(_0x2103f2){return _0x2103f2?{'count':_0x3083ab,'rows':_0x2103f2}:null;}})[_0x1382('0x1f')](respondWithResult(_0x1aeab2,null))[_0x1382('0x52')](handleError(_0x1aeab2,null));};exports[_0x1382('0x5c')]=function(_0x5acc9e,_0x33f1f7,_0x412ff4){var _0x1b02d8={};var _0x17e00c={};var _0x16a7e5;var _0x564fc3;return db[_0x1382('0x50')]['findOne']({'where':{'id':_0x5acc9e['params']['id']}})[_0x1382('0x1f')](handleEntityNotFound(_0x33f1f7,null))[_0x1382('0x1f')](function(_0x2ef0fe){if(_0x2ef0fe){_0x16a7e5=_0x2ef0fe;_0x17e00c[_0x1382('0x3d')]=_[_0x1382('0x3f')](db[_0x1382('0x5b')]['rawAttributes']);_0x17e00c[_0x1382('0x3e')]=_[_0x1382('0x3f')](_0x5acc9e['query']);_0x17e00c[_0x1382('0x40')]=_[_0x1382('0x42')](_0x17e00c['model'],_0x17e00c[_0x1382('0x3e')]);_0x1b02d8[_0x1382('0x41')]=_[_0x1382('0x42')](_0x17e00c[_0x1382('0x3d')],qs[_0x1382('0x43')](_0x5acc9e[_0x1382('0x3e')][_0x1382('0x43')]));_0x1b02d8['attributes']=_0x1b02d8[_0x1382('0x41')]['length']?_0x1b02d8[_0x1382('0x41')]:_0x17e00c['model'];_0x1b02d8[_0x1382('0x46')]=qs[_0x1382('0x47')](_0x5acc9e[_0x1382('0x3e')][_0x1382('0x47')]);_0x1b02d8['where']=qs['filters'](_[_0x1382('0x49')](_0x5acc9e['query'],_0x17e00c[_0x1382('0x40')]));if(_0x5acc9e['query'][_0x1382('0x4a')]){_0x1b02d8[_0x1382('0x48')]=_[_0x1382('0x4c')](_0x1b02d8[_0x1382('0x48')],{'$or':_['map'](_0x1b02d8['attributes'],function(_0xb1cd50){var _0x1bf35f={};_0x1bf35f[_0xb1cd50]={'$like':'%'+_0x5acc9e[_0x1382('0x3e')][_0x1382('0x4a')]+'%'};return _0x1bf35f;})});}_0x1b02d8=_[_0x1382('0x4c')]({},_0x1b02d8,_0x5acc9e[_0x1382('0x4d')]);return _0x16a7e5[_0x1382('0x5c')](_0x1b02d8);}})[_0x1382('0x1f')](function(_0x25ac9f){if(_0x25ac9f){_0x564fc3=_0x25ac9f['length'];if(!_0x5acc9e[_0x1382('0x3e')][_0x1382('0x44')]('nolimit')){_0x1b02d8['limit']=qs[_0x1382('0x2c')](_0x5acc9e[_0x1382('0x3e')][_0x1382('0x2c')]);_0x1b02d8[_0x1382('0x2b')]=qs[_0x1382('0x2b')](_0x5acc9e['query'][_0x1382('0x2b')]);}return _0x16a7e5[_0x1382('0x5c')](_0x1b02d8);}})[_0x1382('0x1f')](function(_0x4c4942){if(_0x4c4942){return _0x4c4942?{'count':_0x564fc3,'rows':_0x4c4942}:null;}})[_0x1382('0x1f')](respondWithResult(_0x33f1f7,null))[_0x1382('0x52')](handleError(_0x33f1f7,null));};exports['getDescriptions']=function(_0x1630db,_0xe2ee95,_0x32df8a){var _0x1d42c9={};var _0x332d97={};var _0x321081;var _0xd24020;return db[_0x1382('0x50')][_0x1382('0x5a')]({'where':{'id':_0x1630db['params']['id']}})['then'](handleEntityNotFound(_0xe2ee95,null))[_0x1382('0x1f')](function(_0x3b72f3){if(_0x3b72f3){_0x321081=_0x3b72f3;_0x332d97[_0x1382('0x3d')]=_[_0x1382('0x3f')](db[_0x1382('0x5b')][_0x1382('0x39')]);_0x332d97[_0x1382('0x3e')]=_[_0x1382('0x3f')](_0x1630db[_0x1382('0x3e')]);_0x332d97['filters']=_[_0x1382('0x42')](_0x332d97[_0x1382('0x3d')],_0x332d97[_0x1382('0x3e')]);_0x1d42c9['attributes']=_[_0x1382('0x42')](_0x332d97[_0x1382('0x3d')],qs[_0x1382('0x43')](_0x1630db['query'][_0x1382('0x43')]));_0x1d42c9[_0x1382('0x41')]=_0x1d42c9[_0x1382('0x41')][_0x1382('0x55')]?_0x1d42c9['attributes']:_0x332d97[_0x1382('0x3d')];_0x1d42c9[_0x1382('0x46')]=qs[_0x1382('0x47')](_0x1630db['query'][_0x1382('0x47')]);_0x1d42c9['where']=qs['filters'](_[_0x1382('0x49')](_0x1630db[_0x1382('0x3e')],_0x332d97[_0x1382('0x40')]));if(_0x1630db['query'][_0x1382('0x4a')]){_0x1d42c9['where']=_['merge'](_0x1d42c9[_0x1382('0x48')],{'$or':_['map'](_0x1d42c9[_0x1382('0x41')],function(_0x42cc5c){var _0x30e3d2={};_0x30e3d2[_0x42cc5c]={'$like':'%'+_0x1630db['query']['filter']+'%'};return _0x30e3d2;})});}_0x1d42c9=_[_0x1382('0x4c')]({},_0x1d42c9,_0x1630db['options']);return _0x321081[_0x1382('0x5d')](_0x1d42c9);}})[_0x1382('0x1f')](function(_0xdedf86){if(_0xdedf86){_0xd24020=_0xdedf86[_0x1382('0x55')];if(!_0x1630db[_0x1382('0x3e')]['hasOwnProperty'](_0x1382('0x45'))){_0x1d42c9[_0x1382('0x2c')]=qs['limit'](_0x1630db[_0x1382('0x3e')][_0x1382('0x2c')]);_0x1d42c9['offset']=qs[_0x1382('0x2b')](_0x1630db['query'][_0x1382('0x2b')]);}return _0x321081[_0x1382('0x5d')](_0x1d42c9);}})[_0x1382('0x1f')](function(_0x47de0b){if(_0x47de0b){return _0x47de0b?{'count':_0xd24020,'rows':_0x47de0b}:null;}})['then'](respondWithResult(_0xe2ee95,null))['catch'](handleError(_0xe2ee95,null));};exports[_0x1382('0x5e')]=function(_0x3ea941,_0x36a458,_0x56a51f){var _0x1af7a6={};var _0x2e5e83={};var _0x5b4da8;var _0x4ef6f3;return db['FreshdeskConfiguration'][_0x1382('0x5a')]({'where':{'id':_0x3ea941[_0x1382('0x54')]['id']}})[_0x1382('0x1f')](handleEntityNotFound(_0x36a458,null))['then'](function(_0x55d2ff){if(_0x55d2ff){_0x5b4da8=_0x55d2ff;_0x2e5e83['model']=_[_0x1382('0x3f')](db[_0x1382('0x5f')][_0x1382('0x39')]);_0x2e5e83[_0x1382('0x3e')]=_['keys'](_0x3ea941[_0x1382('0x3e')]);_0x2e5e83[_0x1382('0x40')]=_[_0x1382('0x42')](_0x2e5e83['model'],_0x2e5e83[_0x1382('0x3e')]);_0x1af7a6[_0x1382('0x41')]=_['intersection'](_0x2e5e83['model'],qs[_0x1382('0x43')](_0x3ea941['query'][_0x1382('0x43')]));_0x1af7a6[_0x1382('0x41')]=_0x1af7a6['attributes']['length']?_0x1af7a6[_0x1382('0x41')]:_0x2e5e83[_0x1382('0x3d')];_0x1af7a6[_0x1382('0x46')]=qs[_0x1382('0x47')](_0x3ea941[_0x1382('0x3e')][_0x1382('0x47')]);_0x1af7a6[_0x1382('0x48')]=qs[_0x1382('0x40')](_[_0x1382('0x49')](_0x3ea941['query'],_0x2e5e83[_0x1382('0x40')]));if(_0x3ea941['query'][_0x1382('0x4a')]){_0x1af7a6[_0x1382('0x48')]=_['merge'](_0x1af7a6[_0x1382('0x48')],{'$or':_[_0x1382('0x38')](_0x1af7a6[_0x1382('0x41')],function(_0x28f87d){var _0x157b99={};_0x157b99[_0x28f87d]={'$like':'%'+_0x3ea941[_0x1382('0x3e')]['filter']+'%'};return _0x157b99;})});}_0x1af7a6=_[_0x1382('0x4c')]({},_0x1af7a6,_0x3ea941['options']);return _0x5b4da8[_0x1382('0x5e')](_0x1af7a6);}})['then'](function(_0x4f021b){if(_0x4f021b){_0x4ef6f3=_0x4f021b[_0x1382('0x55')];if(!_0x3ea941[_0x1382('0x3e')][_0x1382('0x44')]('nolimit')){_0x1af7a6['limit']=qs[_0x1382('0x2c')](_0x3ea941[_0x1382('0x3e')]['limit']);_0x1af7a6[_0x1382('0x2b')]=qs[_0x1382('0x2b')](_0x3ea941[_0x1382('0x3e')][_0x1382('0x2b')]);}return _0x5b4da8[_0x1382('0x5e')](_0x1af7a6);}})[_0x1382('0x1f')](function(_0x49ab8e){if(_0x49ab8e){return _0x49ab8e?{'count':_0x4ef6f3,'rows':_0x49ab8e}:null;}})['then'](respondWithResult(_0x36a458,null))[_0x1382('0x52')](handleError(_0x36a458,null));};exports['setTags']=function(_0x52d0e5,_0x44fe72,_0x3b0f19){if(_0x52d0e5[_0x1382('0x58')]['id']){delete _0x52d0e5[_0x1382('0x58')]['id'];}return db['FreshdeskConfiguration'][_0x1382('0x5a')]({'where':{'id':_0x52d0e5[_0x1382('0x54')]['id']}})['then'](handleEntityNotFound(_0x44fe72,null))[_0x1382('0x1f')](function(_0x50f85a){if(_0x50f85a){return _0x50f85a[_0x1382('0x60')](_0x52d0e5[_0x1382('0x58')][_0x1382('0x61')]||[]);}return null;})[_0x1382('0x1f')](respondWithResult(_0x44fe72,null))[_0x1382('0x52')](handleError(_0x44fe72,null));}; \ No newline at end of file +var _0x3ca4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskConfiguration,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','save','then','destroy','stack','name','send','index','FreshdeskConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','find','create','body','update','findOne','FreshdeskField','rawAttributes','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x3ca4,0x17d));var _0x43ca=function(_0x4d7f31,_0x37375e){_0x4d7f31=_0x4d7f31-0x0;var _0x291b17=_0x3ca4[_0x4d7f31];return _0x291b17;};'use strict';var pdf=require(_0x43ca('0x0'));var emlformat=require(_0x43ca('0x1'));var rimraf=require(_0x43ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43ca('0x3'));var moment=require(_0x43ca('0x4'));var BPromise=require(_0x43ca('0x5'));var Mustache=require(_0x43ca('0x6'));var util=require(_0x43ca('0x7'));var path=require(_0x43ca('0x8'));var sox=require(_0x43ca('0x9'));var csv=require('to-csv');var ejs=require(_0x43ca('0xa'));var fs=require('fs');var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x10'));var querystring=require(_0x43ca('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x12'));var qs=require(_0x43ca('0x13'));var as=require(_0x43ca('0x14'));var hardwareService=require(_0x43ca('0x15'));var logger=require('../../config/logger')(_0x43ca('0x16'));var utils=require(_0x43ca('0x17'));var config=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];var jayson=require(_0x43ca('0x1a'));var client=jayson[_0x43ca('0x1b')][_0x43ca('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ede07,_0x2150be,_0x55cbce){if(_0x55cbce){var _0x22988c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22988c[_0x43ca('0x1d')](_0x2150be)){return _0x2ede07;}else{throw new db['Sequelize'][(_0x43ca('0x1e'))]('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 _0x2ede07;}}function respondWithRpcPromise(_0x316c74,_0x567579,_0xdccc62,_0x1a8bf6){return new BPromise(function(_0x51a517,_0xd306dc){var _0x366180=_0x1a8bf6||client;return _0x366180[_0x43ca('0x1f')](_0x316c74,_0xdccc62)['then'](function(_0x4fb5e4){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x567579,_0x43ca('0x20'));logger[_0x43ca('0x21')](_0x43ca('0x22'),_0x567579,'request\x20sent',JSON[_0x43ca('0x23')](_0x4fb5e4));if(_0x4fb5e4[_0x43ca('0x24')]){if(_0x4fb5e4[_0x43ca('0x24')]['code']===0x1f4){logger[_0x43ca('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x567579,_0x4fb5e4[_0x43ca('0x24')][_0x43ca('0x25')]);return _0xd306dc(_0x4fb5e4[_0x43ca('0x24')]['message']);}logger[_0x43ca('0x24')](_0x43ca('0x26'),_0x567579,_0x4fb5e4[_0x43ca('0x24')][_0x43ca('0x25')]);return _0x51a517(_0x4fb5e4[_0x43ca('0x24')]['message']);}else{logger[_0x43ca('0x27')](_0x43ca('0x26'),_0x567579,'request\x20sent');_0x51a517(_0x4fb5e4[_0x43ca('0x28')][_0x43ca('0x25')]);}})[_0x43ca('0x29')](function(_0x3bc9ae){logger[_0x43ca('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x567579,_0x3bc9ae);_0xd306dc(_0x3bc9ae);});});}function respondWithStatusCode(_0x2da1ec,_0xc07cde){_0xc07cde=_0xc07cde||0xcc;return function(_0x29f2ee){if(_0x29f2ee){return _0x2da1ec[_0x43ca('0x2a')](_0xc07cde);}return _0x2da1ec[_0x43ca('0x2b')](_0xc07cde)[_0x43ca('0x2c')]();};}function respondWithResult(_0x3b2078,_0x428fc0){_0x428fc0=_0x428fc0||0xc8;return function(_0x5aa57c){if(_0x5aa57c){return _0x3b2078['status'](_0x428fc0)['json'](_0x5aa57c);}};}function respondWithFilteredResult(_0x137877,_0x3a2e47){return function(_0x270393){if(_0x270393){var _0x9d09b9=_0x270393[_0x43ca('0x2d')],_0x34dc4f=_0x3a2e47['offset'],_0x36884b=_0x3a2e47[_0x43ca('0x2e')]+_0x3a2e47['limit'],_0xffad2d;if(_0x36884b>=_0x9d09b9){_0x36884b=_0x9d09b9;_0xffad2d=0xc8;}else{_0xffad2d=0xce;}_0x137877['status'](_0xffad2d);return _0x137877[_0x43ca('0x2f')](_0x43ca('0x30'),_0x34dc4f+'-'+_0x36884b+'/'+_0x9d09b9)[_0x43ca('0x31')](_0x270393);}return null;};}function patchUpdates(_0x359b7c){return function(_0x248ec3){try{jsonpatch['apply'](_0x248ec3,_0x359b7c,!![]);}catch(_0x1689cf){return BPromise['reject'](_0x1689cf);}return _0x248ec3[_0x43ca('0x32')]();};}function saveUpdates(_0x58e62f,_0x31fc55){return function(_0x194d00){if(_0x194d00){return _0x194d00['update'](_0x58e62f)[_0x43ca('0x33')](function(_0xce2d1a){return _0xce2d1a;});}return null;};}function removeEntity(_0x3ae919,_0x2a2f8a){return function(_0x46650d){if(_0x46650d){return _0x46650d[_0x43ca('0x34')]()[_0x43ca('0x33')](function(){_0x3ae919['status'](0xcc)[_0x43ca('0x2c')]();});}};}function handleEntityNotFound(_0x5976a3,_0x23e6ba){return function(_0x3ac086){if(!_0x3ac086){_0x5976a3['sendStatus'](0x194);}return _0x3ac086;};}function handleError(_0x33b0b6,_0x5ce3a0){_0x5ce3a0=_0x5ce3a0||0x1f4;return function(_0x49ef94){logger[_0x43ca('0x24')](_0x49ef94[_0x43ca('0x35')]);if(_0x49ef94[_0x43ca('0x36')]){delete _0x49ef94[_0x43ca('0x36')];}_0x33b0b6[_0x43ca('0x2b')](_0x5ce3a0)[_0x43ca('0x37')](_0x49ef94);};}exports[_0x43ca('0x38')]=function(_0x524e5f,_0x43b29b){var _0x67b8b0={},_0x5b8cca={},_0x35d5ff={'count':0x0,'rows':[]};var _0x2372c0=_['map'](db[_0x43ca('0x39')]['rawAttributes'],function(_0x5a4224){return{'name':_0x5a4224[_0x43ca('0x3a')],'type':_0x5a4224[_0x43ca('0x3b')][_0x43ca('0x3c')]};});_0x5b8cca[_0x43ca('0x3d')]=_[_0x43ca('0x3e')](_0x2372c0,_0x43ca('0x36'));_0x5b8cca[_0x43ca('0x3f')]=_[_0x43ca('0x40')](_0x524e5f[_0x43ca('0x3f')]);_0x5b8cca[_0x43ca('0x41')]=_[_0x43ca('0x42')](_0x5b8cca[_0x43ca('0x3d')],_0x5b8cca['query']);_0x67b8b0['attributes']=_[_0x43ca('0x42')](_0x5b8cca[_0x43ca('0x3d')],qs[_0x43ca('0x43')](_0x524e5f['query'][_0x43ca('0x43')]));_0x67b8b0['attributes']=_0x67b8b0[_0x43ca('0x44')]['length']?_0x67b8b0[_0x43ca('0x44')]:_0x5b8cca[_0x43ca('0x3d')];if(!_0x524e5f[_0x43ca('0x3f')][_0x43ca('0x45')](_0x43ca('0x46'))){_0x67b8b0[_0x43ca('0x47')]=qs['limit'](_0x524e5f['query'][_0x43ca('0x47')]);_0x67b8b0[_0x43ca('0x2e')]=qs[_0x43ca('0x2e')](_0x524e5f[_0x43ca('0x3f')][_0x43ca('0x2e')]);}_0x67b8b0[_0x43ca('0x48')]=qs[_0x43ca('0x49')](_0x524e5f[_0x43ca('0x3f')][_0x43ca('0x49')]);_0x67b8b0[_0x43ca('0x4a')]=qs[_0x43ca('0x41')](_[_0x43ca('0x4b')](_0x524e5f[_0x43ca('0x3f')],_0x5b8cca[_0x43ca('0x41')]),_0x2372c0);if(_0x524e5f[_0x43ca('0x3f')][_0x43ca('0x4c')]){_0x67b8b0[_0x43ca('0x4a')]=_[_0x43ca('0x4d')](_0x67b8b0[_0x43ca('0x4a')],{'$or':_[_0x43ca('0x3e')](_0x2372c0,function(_0x21bd31){if(_0x21bd31['type']!==_0x43ca('0x4e')){var _0x1b1e8f={};_0x1b1e8f[_0x21bd31[_0x43ca('0x36')]]={'$like':'%'+_0x524e5f['query'][_0x43ca('0x4c')]+'%'};return _0x1b1e8f;}})});}_0x67b8b0=_[_0x43ca('0x4d')]({},_0x67b8b0,_0x524e5f[_0x43ca('0x4f')]);var _0x3f5bda={'where':_0x67b8b0[_0x43ca('0x4a')]};return db[_0x43ca('0x39')][_0x43ca('0x2d')](_0x3f5bda)[_0x43ca('0x33')](function(_0x475c){_0x35d5ff[_0x43ca('0x2d')]=_0x475c;if(_0x524e5f[_0x43ca('0x3f')]['includeAll']){_0x67b8b0[_0x43ca('0x50')]=[{'all':!![]}];}return db[_0x43ca('0x39')][_0x43ca('0x51')](_0x67b8b0);})['then'](function(_0x4bbf51){_0x35d5ff[_0x43ca('0x52')]=_0x4bbf51;return _0x35d5ff;})['then'](respondWithFilteredResult(_0x43b29b,_0x67b8b0))[_0x43ca('0x29')](handleError(_0x43b29b,null));};exports['show']=function(_0x2ef30e,_0x25e0fd){var _0x45cafd={'raw':![],'where':{'id':_0x2ef30e[_0x43ca('0x53')]['id']}},_0x50b728={};_0x50b728[_0x43ca('0x3d')]=_['keys'](db[_0x43ca('0x39')]['rawAttributes']);_0x50b728['query']=_[_0x43ca('0x40')](_0x2ef30e[_0x43ca('0x3f')]);_0x50b728[_0x43ca('0x41')]=_[_0x43ca('0x42')](_0x50b728[_0x43ca('0x3d')],_0x50b728[_0x43ca('0x3f')]);_0x45cafd['attributes']=_['intersection'](_0x50b728[_0x43ca('0x3d')],qs[_0x43ca('0x43')](_0x2ef30e['query']['fields']));_0x45cafd[_0x43ca('0x44')]=_0x45cafd['attributes'][_0x43ca('0x54')]?_0x45cafd[_0x43ca('0x44')]:_0x50b728[_0x43ca('0x3d')];if(_0x2ef30e['query'][_0x43ca('0x55')]){_0x45cafd[_0x43ca('0x50')]=[{'all':!![]}];}_0x45cafd=_['merge']({},_0x45cafd,_0x2ef30e['options']);return db[_0x43ca('0x39')][_0x43ca('0x56')](_0x45cafd)[_0x43ca('0x33')](handleEntityNotFound(_0x25e0fd,null))[_0x43ca('0x33')](respondWithResult(_0x25e0fd,null))[_0x43ca('0x29')](handleError(_0x25e0fd,null));};exports[_0x43ca('0x57')]=function(_0x4c2c71,_0x591fdb){return db[_0x43ca('0x39')][_0x43ca('0x57')](_0x4c2c71[_0x43ca('0x58')],{})[_0x43ca('0x33')](respondWithResult(_0x591fdb,0xc9))[_0x43ca('0x29')](handleError(_0x591fdb,null));};exports[_0x43ca('0x59')]=function(_0x3aa110,_0xde56cd){if(_0x3aa110[_0x43ca('0x58')]['id']){delete _0x3aa110[_0x43ca('0x58')]['id'];}return db[_0x43ca('0x39')][_0x43ca('0x56')]({'where':{'id':_0x3aa110[_0x43ca('0x53')]['id']}})[_0x43ca('0x33')](handleEntityNotFound(_0xde56cd,null))['then'](saveUpdates(_0x3aa110[_0x43ca('0x58')],null))[_0x43ca('0x33')](respondWithResult(_0xde56cd,null))[_0x43ca('0x29')](handleError(_0xde56cd,null));};exports[_0x43ca('0x34')]=function(_0x40ec30,_0x55c277){return db[_0x43ca('0x39')][_0x43ca('0x56')]({'where':{'id':_0x40ec30['params']['id']}})[_0x43ca('0x33')](handleEntityNotFound(_0x55c277,null))[_0x43ca('0x33')](removeEntity(_0x55c277,null))['catch'](handleError(_0x55c277,null));};exports['getFields']=function(_0x1d6eae,_0x34dc19,_0x43918b){var _0x52f625={};var _0xc63e08={};var _0xd0e5e0;var _0x3f92e2;return db[_0x43ca('0x39')][_0x43ca('0x5a')]({'where':{'id':_0x1d6eae[_0x43ca('0x53')]['id']}})[_0x43ca('0x33')](handleEntityNotFound(_0x34dc19,null))[_0x43ca('0x33')](function(_0x28d2cb){if(_0x28d2cb){_0xd0e5e0=_0x28d2cb;_0xc63e08[_0x43ca('0x3d')]=_['keys'](db[_0x43ca('0x5b')][_0x43ca('0x5c')]);_0xc63e08[_0x43ca('0x3f')]=_[_0x43ca('0x40')](_0x1d6eae[_0x43ca('0x3f')]);_0xc63e08[_0x43ca('0x41')]=_['intersection'](_0xc63e08[_0x43ca('0x3d')],_0xc63e08[_0x43ca('0x3f')]);_0x52f625[_0x43ca('0x44')]=_[_0x43ca('0x42')](_0xc63e08[_0x43ca('0x3d')],qs[_0x43ca('0x43')](_0x1d6eae[_0x43ca('0x3f')][_0x43ca('0x43')]));_0x52f625['attributes']=_0x52f625[_0x43ca('0x44')][_0x43ca('0x54')]?_0x52f625[_0x43ca('0x44')]:_0xc63e08['model'];_0x52f625[_0x43ca('0x48')]=qs[_0x43ca('0x49')](_0x1d6eae['query'][_0x43ca('0x49')]);_0x52f625['where']=qs['filters'](_[_0x43ca('0x4b')](_0x1d6eae[_0x43ca('0x3f')],_0xc63e08[_0x43ca('0x41')]));if(_0x1d6eae[_0x43ca('0x3f')][_0x43ca('0x4c')]){_0x52f625['where']=_[_0x43ca('0x4d')](_0x52f625['where'],{'$or':_[_0x43ca('0x3e')](_0x52f625[_0x43ca('0x44')],function(_0x22623d){var _0x282813={};_0x282813[_0x22623d]={'$like':'%'+_0x1d6eae[_0x43ca('0x3f')][_0x43ca('0x4c')]+'%'};return _0x282813;})});}_0x52f625=_[_0x43ca('0x4d')]({},_0x52f625,_0x1d6eae['options']);return _0xd0e5e0[_0x43ca('0x5d')](_0x52f625);}})[_0x43ca('0x33')](function(_0x3c9844){if(_0x3c9844){_0x3f92e2=_0x3c9844[_0x43ca('0x54')];if(!_0x1d6eae[_0x43ca('0x3f')]['hasOwnProperty'](_0x43ca('0x46'))){_0x52f625[_0x43ca('0x47')]=qs['limit'](_0x1d6eae[_0x43ca('0x3f')][_0x43ca('0x47')]);_0x52f625[_0x43ca('0x2e')]=qs[_0x43ca('0x2e')](_0x1d6eae[_0x43ca('0x3f')][_0x43ca('0x2e')]);}return _0xd0e5e0[_0x43ca('0x5d')](_0x52f625);}})[_0x43ca('0x33')](function(_0x3bcb79){if(_0x3bcb79){return _0x3bcb79?{'count':_0x3f92e2,'rows':_0x3bcb79}:null;}})[_0x43ca('0x33')](respondWithResult(_0x34dc19,null))['catch'](handleError(_0x34dc19,null));};exports[_0x43ca('0x5e')]=function(_0xfdc74a,_0x5661c2,_0x138b31){var _0x304d00={};var _0x1394a2={};var _0x244784;var _0x2568f9;return db['FreshdeskConfiguration'][_0x43ca('0x5a')]({'where':{'id':_0xfdc74a[_0x43ca('0x53')]['id']}})['then'](handleEntityNotFound(_0x5661c2,null))[_0x43ca('0x33')](function(_0x11d403){if(_0x11d403){_0x244784=_0x11d403;_0x1394a2[_0x43ca('0x3d')]=_[_0x43ca('0x40')](db[_0x43ca('0x5b')][_0x43ca('0x5c')]);_0x1394a2[_0x43ca('0x3f')]=_[_0x43ca('0x40')](_0xfdc74a['query']);_0x1394a2['filters']=_[_0x43ca('0x42')](_0x1394a2['model'],_0x1394a2['query']);_0x304d00[_0x43ca('0x44')]=_[_0x43ca('0x42')](_0x1394a2[_0x43ca('0x3d')],qs[_0x43ca('0x43')](_0xfdc74a[_0x43ca('0x3f')][_0x43ca('0x43')]));_0x304d00[_0x43ca('0x44')]=_0x304d00[_0x43ca('0x44')]['length']?_0x304d00['attributes']:_0x1394a2[_0x43ca('0x3d')];_0x304d00[_0x43ca('0x48')]=qs[_0x43ca('0x49')](_0xfdc74a[_0x43ca('0x3f')][_0x43ca('0x49')]);_0x304d00[_0x43ca('0x4a')]=qs[_0x43ca('0x41')](_[_0x43ca('0x4b')](_0xfdc74a[_0x43ca('0x3f')],_0x1394a2[_0x43ca('0x41')]));if(_0xfdc74a[_0x43ca('0x3f')][_0x43ca('0x4c')]){_0x304d00[_0x43ca('0x4a')]=_['merge'](_0x304d00['where'],{'$or':_['map'](_0x304d00[_0x43ca('0x44')],function(_0x27d6c1){var _0x11dea1={};_0x11dea1[_0x27d6c1]={'$like':'%'+_0xfdc74a[_0x43ca('0x3f')][_0x43ca('0x4c')]+'%'};return _0x11dea1;})});}_0x304d00=_[_0x43ca('0x4d')]({},_0x304d00,_0xfdc74a[_0x43ca('0x4f')]);return _0x244784[_0x43ca('0x5e')](_0x304d00);}})[_0x43ca('0x33')](function(_0xf0abf0){if(_0xf0abf0){_0x2568f9=_0xf0abf0['length'];if(!_0xfdc74a['query'][_0x43ca('0x45')](_0x43ca('0x46'))){_0x304d00[_0x43ca('0x47')]=qs[_0x43ca('0x47')](_0xfdc74a['query'][_0x43ca('0x47')]);_0x304d00[_0x43ca('0x2e')]=qs[_0x43ca('0x2e')](_0xfdc74a[_0x43ca('0x3f')][_0x43ca('0x2e')]);}return _0x244784[_0x43ca('0x5e')](_0x304d00);}})[_0x43ca('0x33')](function(_0x2fd878){if(_0x2fd878){return _0x2fd878?{'count':_0x2568f9,'rows':_0x2fd878}:null;}})['then'](respondWithResult(_0x5661c2,null))[_0x43ca('0x29')](handleError(_0x5661c2,null));};exports[_0x43ca('0x5f')]=function(_0x9f61a,_0x2a482a,_0x43d9f9){var _0x29c93b={};var _0x236d95={};var _0x364ab7;var _0x229515;return db[_0x43ca('0x39')][_0x43ca('0x5a')]({'where':{'id':_0x9f61a['params']['id']}})['then'](handleEntityNotFound(_0x2a482a,null))[_0x43ca('0x33')](function(_0x345bff){if(_0x345bff){_0x364ab7=_0x345bff;_0x236d95['model']=_[_0x43ca('0x40')](db[_0x43ca('0x5b')][_0x43ca('0x5c')]);_0x236d95[_0x43ca('0x3f')]=_[_0x43ca('0x40')](_0x9f61a[_0x43ca('0x3f')]);_0x236d95['filters']=_[_0x43ca('0x42')](_0x236d95[_0x43ca('0x3d')],_0x236d95[_0x43ca('0x3f')]);_0x29c93b[_0x43ca('0x44')]=_['intersection'](_0x236d95[_0x43ca('0x3d')],qs[_0x43ca('0x43')](_0x9f61a['query']['fields']));_0x29c93b[_0x43ca('0x44')]=_0x29c93b[_0x43ca('0x44')][_0x43ca('0x54')]?_0x29c93b[_0x43ca('0x44')]:_0x236d95[_0x43ca('0x3d')];_0x29c93b[_0x43ca('0x48')]=qs['sort'](_0x9f61a[_0x43ca('0x3f')][_0x43ca('0x49')]);_0x29c93b[_0x43ca('0x4a')]=qs[_0x43ca('0x41')](_[_0x43ca('0x4b')](_0x9f61a['query'],_0x236d95[_0x43ca('0x41')]));if(_0x9f61a[_0x43ca('0x3f')]['filter']){_0x29c93b[_0x43ca('0x4a')]=_[_0x43ca('0x4d')](_0x29c93b[_0x43ca('0x4a')],{'$or':_[_0x43ca('0x3e')](_0x29c93b[_0x43ca('0x44')],function(_0x268274){var _0x3a88b4={};_0x3a88b4[_0x268274]={'$like':'%'+_0x9f61a['query'][_0x43ca('0x4c')]+'%'};return _0x3a88b4;})});}_0x29c93b=_['merge']({},_0x29c93b,_0x9f61a[_0x43ca('0x4f')]);return _0x364ab7[_0x43ca('0x5f')](_0x29c93b);}})[_0x43ca('0x33')](function(_0x140ce9){if(_0x140ce9){_0x229515=_0x140ce9[_0x43ca('0x54')];if(!_0x9f61a[_0x43ca('0x3f')]['hasOwnProperty'](_0x43ca('0x46'))){_0x29c93b[_0x43ca('0x47')]=qs[_0x43ca('0x47')](_0x9f61a[_0x43ca('0x3f')][_0x43ca('0x47')]);_0x29c93b[_0x43ca('0x2e')]=qs[_0x43ca('0x2e')](_0x9f61a[_0x43ca('0x3f')][_0x43ca('0x2e')]);}return _0x364ab7['getDescriptions'](_0x29c93b);}})[_0x43ca('0x33')](function(_0x19fceb){if(_0x19fceb){return _0x19fceb?{'count':_0x229515,'rows':_0x19fceb}:null;}})['then'](respondWithResult(_0x2a482a,null))[_0x43ca('0x29')](handleError(_0x2a482a,null));};exports['getTags']=function(_0x3c1761,_0x59c2d8,_0xa88d27){var _0x131ef6={};var _0x5b8529={};var _0x29b1d7;var _0x441df6;return db['FreshdeskConfiguration'][_0x43ca('0x5a')]({'where':{'id':_0x3c1761[_0x43ca('0x53')]['id']}})[_0x43ca('0x33')](handleEntityNotFound(_0x59c2d8,null))['then'](function(_0x196cb7){if(_0x196cb7){_0x29b1d7=_0x196cb7;_0x5b8529[_0x43ca('0x3d')]=_[_0x43ca('0x40')](db[_0x43ca('0x60')][_0x43ca('0x5c')]);_0x5b8529['query']=_[_0x43ca('0x40')](_0x3c1761[_0x43ca('0x3f')]);_0x5b8529[_0x43ca('0x41')]=_[_0x43ca('0x42')](_0x5b8529[_0x43ca('0x3d')],_0x5b8529[_0x43ca('0x3f')]);_0x131ef6[_0x43ca('0x44')]=_[_0x43ca('0x42')](_0x5b8529[_0x43ca('0x3d')],qs['fields'](_0x3c1761['query'][_0x43ca('0x43')]));_0x131ef6['attributes']=_0x131ef6[_0x43ca('0x44')][_0x43ca('0x54')]?_0x131ef6['attributes']:_0x5b8529['model'];_0x131ef6[_0x43ca('0x48')]=qs[_0x43ca('0x49')](_0x3c1761[_0x43ca('0x3f')][_0x43ca('0x49')]);_0x131ef6[_0x43ca('0x4a')]=qs[_0x43ca('0x41')](_[_0x43ca('0x4b')](_0x3c1761[_0x43ca('0x3f')],_0x5b8529['filters']));if(_0x3c1761[_0x43ca('0x3f')][_0x43ca('0x4c')]){_0x131ef6['where']=_[_0x43ca('0x4d')](_0x131ef6['where'],{'$or':_['map'](_0x131ef6[_0x43ca('0x44')],function(_0x48b2de){var _0x38516b={};_0x38516b[_0x48b2de]={'$like':'%'+_0x3c1761[_0x43ca('0x3f')][_0x43ca('0x4c')]+'%'};return _0x38516b;})});}_0x131ef6=_[_0x43ca('0x4d')]({},_0x131ef6,_0x3c1761[_0x43ca('0x4f')]);return _0x29b1d7[_0x43ca('0x61')](_0x131ef6);}})[_0x43ca('0x33')](function(_0x10b5c9){if(_0x10b5c9){_0x441df6=_0x10b5c9[_0x43ca('0x54')];if(!_0x3c1761[_0x43ca('0x3f')][_0x43ca('0x45')](_0x43ca('0x46'))){_0x131ef6[_0x43ca('0x47')]=qs['limit'](_0x3c1761['query'][_0x43ca('0x47')]);_0x131ef6['offset']=qs[_0x43ca('0x2e')](_0x3c1761[_0x43ca('0x3f')][_0x43ca('0x2e')]);}return _0x29b1d7[_0x43ca('0x61')](_0x131ef6);}})[_0x43ca('0x33')](function(_0x36376e){if(_0x36376e){return _0x36376e?{'count':_0x441df6,'rows':_0x36376e}:null;}})['then'](respondWithResult(_0x59c2d8,null))['catch'](handleError(_0x59c2d8,null));};exports['setTags']=function(_0x45bca5,_0x1f573b,_0x490642){if(_0x45bca5[_0x43ca('0x58')]['id']){delete _0x45bca5['body']['id'];}return db[_0x43ca('0x39')][_0x43ca('0x5a')]({'where':{'id':_0x45bca5[_0x43ca('0x53')]['id']}})[_0x43ca('0x33')](handleEntityNotFound(_0x1f573b,null))[_0x43ca('0x33')](function(_0x26e9e0){if(_0x26e9e0){return _0x26e9e0[_0x43ca('0x62')](_0x45bca5[_0x43ca('0x58')][_0x43ca('0x63')]||[]);}return null;})['then'](respondWithResult(_0x1f573b,null))[_0x43ca('0x29')](handleError(_0x1f573b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index fb3d5b7..42b44b2 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 _0x1cb9=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x588d59,_0x362e0e){var _0x1b6c21=function(_0x403188){while(--_0x403188){_0x588d59['push'](_0x588d59['shift']());}};_0x1b6c21(++_0x362e0e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3fa88b,_0x23c82e){_0x3fa88b=_0x3fa88b-0x0;var _0x26c5fe=_0x1cb9[_0x3fa88b];return _0x26c5fe;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','int_freshdesk_configurations','lodash'];(function(_0x5189c9,_0xd227b6){var _0x4643b1=function(_0x350b01){while(--_0x350b01){_0x5189c9['push'](_0x5189c9['shift']());}};_0x4643b1(++_0xd227b6);}(_0xabce,0x103));var _0xeabc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xabce[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 8aa78c4..aba5f56 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 _0x60fe=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x30b037,_0x129997){var _0x41bd3e=function(_0x3f9bdd){while(--_0x3f9bdd){_0x30b037['push'](_0x30b037['shift']());}};_0x41bd3e(++_0x129997);}(_0x60fe,0x12e));var _0xe60f=function(_0x4a8b72,_0xb54e90){_0x4a8b72=_0x4a8b72-0x0;var _0x217237=_0x60fe[_0x4a8b72];return _0x217237;};'use strict';var _=require(_0xe60f('0x0'));var util=require('util');var moment=require(_0xe60f('0x1'));var BPromise=require('bluebird');var rs=require(_0xe60f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe60f('0x3'))['db'];var utils=require(_0xe60f('0x4'));var logger=require('../../config/logger')(_0xe60f('0x5'));var config=require(_0xe60f('0x6'));var jayson=require(_0xe60f('0x7'));var client=jayson[_0xe60f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1244c3,_0x58906d,_0x10507c){return new BPromise(function(_0x5de816,_0x1c1cc2){return client[_0xe60f('0x9')](_0x1244c3,_0x10507c)[_0xe60f('0xa')](function(_0x186864){logger[_0xe60f('0xb')](_0xe60f('0xc'),_0x58906d,'request\x20sent');logger[_0xe60f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x58906d,_0xe60f('0xe'),JSON[_0xe60f('0xf')](_0x186864));if(_0x186864[_0xe60f('0x10')]){if(_0x186864['error'][_0xe60f('0x11')]===0x1f4){logger[_0xe60f('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x58906d,_0x186864[_0xe60f('0x10')][_0xe60f('0x12')]);return _0x1c1cc2(_0x186864[_0xe60f('0x10')][_0xe60f('0x12')]);}logger[_0xe60f('0x10')](_0xe60f('0xc'),_0x58906d,_0x186864[_0xe60f('0x10')][_0xe60f('0x12')]);return _0x5de816(_0x186864['error'][_0xe60f('0x12')]);}else{logger[_0xe60f('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x58906d,_0xe60f('0xe'));_0x5de816(_0x186864[_0xe60f('0x13')][_0xe60f('0x12')]);}})[_0xe60f('0x14')](function(_0x520fe8){logger[_0xe60f('0x10')](_0xe60f('0xc'),_0x58906d,_0x520fe8);_0x1c1cc2(_0x520fe8);});});} \ No newline at end of file +var _0x3e62=['error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2017c6,_0x513dc3){var _0x142c0b=function(_0x16d72b){while(--_0x16d72b){_0x2017c6['push'](_0x2017c6['shift']());}};_0x142c0b(++_0x513dc3);}(_0x3e62,0x11a));var _0x23e6=function(_0x4d148c,_0x46d271){_0x4d148c=_0x4d148c-0x0;var _0xf9aff2=_0x3e62[_0x4d148c];return _0xf9aff2;};'use strict';var _=require(_0x23e6('0x0'));var util=require(_0x23e6('0x1'));var moment=require(_0x23e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x23e6('0x3'));var fs=require('fs');var Redis=require(_0x23e6('0x4'));var db=require(_0x23e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23e6('0x6'))(_0x23e6('0x7'));var config=require(_0x23e6('0x8'));var jayson=require(_0x23e6('0x9'));var client=jayson[_0x23e6('0xa')][_0x23e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e7db7,_0x5b49f2,_0x30e24d){return new BPromise(function(_0x4b50db,_0x2b5338){return client[_0x23e6('0xc')](_0x2e7db7,_0x30e24d)['then'](function(_0x8e1a78){logger[_0x23e6('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b49f2,_0x23e6('0xe'));logger['debug'](_0x23e6('0xf'),_0x5b49f2,_0x23e6('0xe'),JSON[_0x23e6('0x10')](_0x8e1a78));if(_0x8e1a78[_0x23e6('0x11')]){if(_0x8e1a78[_0x23e6('0x11')][_0x23e6('0x12')]===0x1f4){logger[_0x23e6('0x11')](_0x23e6('0x13'),_0x5b49f2,_0x8e1a78[_0x23e6('0x11')][_0x23e6('0x14')]);return _0x2b5338(_0x8e1a78[_0x23e6('0x11')]['message']);}logger['error'](_0x23e6('0x13'),_0x5b49f2,_0x8e1a78[_0x23e6('0x11')]['message']);return _0x4b50db(_0x8e1a78[_0x23e6('0x11')][_0x23e6('0x14')]);}else{logger[_0x23e6('0xd')](_0x23e6('0x13'),_0x5b49f2,_0x23e6('0xe'));_0x4b50db(_0x8e1a78[_0x23e6('0x15')][_0x23e6('0x14')]);}})[_0x23e6('0x16')](function(_0x2d74fb){logger[_0x23e6('0x11')](_0x23e6('0x13'),_0x5b49f2,_0x2d74fb);_0x2b5338(_0x2d74fb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0eafcf1..c5cb920 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 _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x221f3f,_0x572f89){var _0x4cee7c=function(_0x474015){while(--_0x474015){_0x221f3f['push'](_0x221f3f['shift']());}};_0x4cee7c(++_0x572f89);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file +var _0xcb91=['post','create','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xcb91[_0x3430aa];return _0x2ac5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0xa')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xb')]);router['put']('/:id',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller['destroy']);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index f525470..a793c1b 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 _0xe14d=['exports','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize'];(function(_0x5e1b4b,_0x3a51cb){var _0x52cbc6=function(_0x4dbdb4){while(--_0x4dbdb4){_0x5e1b4b['push'](_0x5e1b4b['shift']());}};_0x52cbc6(++_0x3a51cb);}(_0xe14d,0x1ee));var _0xde14=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xe14d[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'type':{'type':Sequelize[_0xde14('0x2')](_0xde14('0x3'),'variable',_0xde14('0x4'),_0xde14('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xde14('0x6')]},'key':{'type':Sequelize[_0xde14('0x6')]},'keyType':{'type':Sequelize[_0xde14('0x2')](_0xde14('0x3'),_0xde14('0x7'),_0xde14('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xde14('0x6')]},'customField':{'type':Sequelize[_0xde14('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xde14('0x6')]}}; \ No newline at end of file +var _0x9917=['string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x23c241,_0xfd0316){var _0x545d36=function(_0x3f90a0){while(--_0x3f90a0){_0x23c241['push'](_0x23c241['shift']());}};_0x545d36(++_0xfd0316);}(_0x9917,0xe6));var _0x7991=function(_0x1beca6,_0x5b7024){_0x1beca6=_0x1beca6-0x0;var _0x9b013b=_0x9917[_0x1beca6];return _0x9b013b;};'use strict';var Sequelize=require(_0x7991('0x0'));module['exports']={'type':{'type':Sequelize[_0x7991('0x1')](_0x7991('0x2'),_0x7991('0x3'),'customVariable',_0x7991('0x4')),'defaultValue':_0x7991('0x2')},'content':{'type':Sequelize[_0x7991('0x5')]},'key':{'type':Sequelize[_0x7991('0x5')]},'keyType':{'type':Sequelize[_0x7991('0x1')](_0x7991('0x2'),_0x7991('0x3'),_0x7991('0x6'))},'keyContent':{'type':Sequelize[_0x7991('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7991('0x5')]},'customField':{'type':Sequelize[_0x7991('0x7')],'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 75901ee..5dc8871 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 _0x042d=['body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','count','offset','limit','status','set','Content-Range','apply','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','update'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x042d,0x1e5));var _0xd042=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x042d[_0x44afa4];return _0xcad289;};'use strict';var pdf=require(_0xd042('0x0'));var emlformat=require(_0xd042('0x1'));var rimraf=require(_0xd042('0x2'));var zipdir=require(_0xd042('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd042('0x4'));var moment=require('moment');var BPromise=require(_0xd042('0x5'));var Mustache=require(_0xd042('0x6'));var util=require(_0xd042('0x7'));var path=require(_0xd042('0x8'));var sox=require(_0xd042('0x9'));var csv=require(_0xd042('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd042('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd042('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd042('0xd'));var Papa=require(_0xd042('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd042('0xf'));var as=require(_0xd042('0x10'));var hardwareService=require(_0xd042('0x11'));var logger=require(_0xd042('0x12'))(_0xd042('0x13'));var utils=require('../../config/utils');var config=require(_0xd042('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103600,_0x436f21){_0x436f21=_0x436f21||0xcc;return function(_0x4ab0de){if(_0x4ab0de){return _0x103600[_0xd042('0x15')](_0x436f21);}return _0x103600['status'](_0x436f21)[_0xd042('0x16')]();};}function respondWithResult(_0x5b0fa2,_0x5ac340){_0x5ac340=_0x5ac340||0xc8;return function(_0x21db22){if(_0x21db22){return _0x5b0fa2['status'](_0x5ac340)['json'](_0x21db22);}};}function respondWithFilteredResult(_0x4f64fb,_0x14c9f9){return function(_0x2b2d12){if(_0x2b2d12){var _0xabffc3=_0x2b2d12[_0xd042('0x17')],_0x3679eb=_0x14c9f9[_0xd042('0x18')],_0x3a4cbe=_0x14c9f9['offset']+_0x14c9f9[_0xd042('0x19')],_0x55f1c1;if(_0x3a4cbe>=_0xabffc3){_0x3a4cbe=_0xabffc3;_0x55f1c1=0xc8;}else{_0x55f1c1=0xce;}_0x4f64fb[_0xd042('0x1a')](_0x55f1c1);return _0x4f64fb[_0xd042('0x1b')](_0xd042('0x1c'),_0x3679eb+'-'+_0x3a4cbe+'/'+_0xabffc3)['json'](_0x2b2d12);}return null;};}function patchUpdates(_0x254dd7){return function(_0x5153ef){try{jsonpatch[_0xd042('0x1d')](_0x5153ef,_0x254dd7,!![]);}catch(_0x4225e7){return BPromise['reject'](_0x4225e7);}return _0x5153ef['save']();};}function saveUpdates(_0x20f6ce,_0x584e0f){return function(_0x28037d){if(_0x28037d){return _0x28037d['update'](_0x20f6ce)[_0xd042('0x1e')](function(_0x51be12){return _0x51be12;});}return null;};}function removeEntity(_0x3eeba3,_0x365172){return function(_0xd0d60d){if(_0xd0d60d){return _0xd0d60d['destroy']()[_0xd042('0x1e')](function(){_0x3eeba3[_0xd042('0x1a')](0xcc)[_0xd042('0x16')]();});}};}function handleEntityNotFound(_0x58bc6d,_0x2bbf19){return function(_0x54d269){if(!_0x54d269){_0x58bc6d[_0xd042('0x15')](0x194);}return _0x54d269;};}function handleError(_0x2611ea,_0x196b67){_0x196b67=_0x196b67||0x1f4;return function(_0x52fdd0){logger[_0xd042('0x1f')](_0x52fdd0[_0xd042('0x20')]);if(_0x52fdd0[_0xd042('0x21')]){delete _0x52fdd0[_0xd042('0x21')];}_0x2611ea[_0xd042('0x1a')](_0x196b67)[_0xd042('0x22')](_0x52fdd0);};}exports[_0xd042('0x23')]=function(_0x2d03dd,_0x27775f){var _0x12cbfa={},_0x196b3d={},_0x4fb087={'count':0x0,'rows':[]};var _0x3dbdc2=_[_0xd042('0x24')](db[_0xd042('0x25')][_0xd042('0x26')],function(_0x125632){return{'name':_0x125632[_0xd042('0x27')],'type':_0x125632['type'][_0xd042('0x28')]};});_0x196b3d[_0xd042('0x29')]=_[_0xd042('0x24')](_0x3dbdc2,_0xd042('0x21'));_0x196b3d[_0xd042('0x2a')]=_[_0xd042('0x2b')](_0x2d03dd[_0xd042('0x2a')]);_0x196b3d[_0xd042('0x2c')]=_[_0xd042('0x2d')](_0x196b3d[_0xd042('0x29')],_0x196b3d[_0xd042('0x2a')]);_0x12cbfa['attributes']=_[_0xd042('0x2d')](_0x196b3d[_0xd042('0x29')],qs[_0xd042('0x2e')](_0x2d03dd[_0xd042('0x2a')][_0xd042('0x2e')]));_0x12cbfa[_0xd042('0x2f')]=_0x12cbfa['attributes'][_0xd042('0x30')]?_0x12cbfa[_0xd042('0x2f')]:_0x196b3d[_0xd042('0x29')];if(!_0x2d03dd['query'][_0xd042('0x31')](_0xd042('0x32'))){_0x12cbfa['limit']=qs[_0xd042('0x19')](_0x2d03dd['query'][_0xd042('0x19')]);_0x12cbfa[_0xd042('0x18')]=qs[_0xd042('0x18')](_0x2d03dd[_0xd042('0x2a')][_0xd042('0x18')]);}_0x12cbfa[_0xd042('0x33')]=qs[_0xd042('0x34')](_0x2d03dd['query'][_0xd042('0x34')]);_0x12cbfa[_0xd042('0x35')]=qs[_0xd042('0x2c')](_[_0xd042('0x36')](_0x2d03dd[_0xd042('0x2a')],_0x196b3d[_0xd042('0x2c')]),_0x3dbdc2);if(_0x2d03dd[_0xd042('0x2a')][_0xd042('0x37')]){_0x12cbfa[_0xd042('0x35')]=_['merge'](_0x12cbfa[_0xd042('0x35')],{'$or':_[_0xd042('0x24')](_0x3dbdc2,function(_0x3f604e){if(_0x3f604e['type']!==_0xd042('0x38')){var _0x488f04={};_0x488f04[_0x3f604e[_0xd042('0x21')]]={'$like':'%'+_0x2d03dd['query'][_0xd042('0x37')]+'%'};return _0x488f04;}})});}_0x12cbfa=_[_0xd042('0x39')]({},_0x12cbfa,_0x2d03dd[_0xd042('0x3a')]);var _0x377958={'where':_0x12cbfa[_0xd042('0x35')]};return db[_0xd042('0x25')]['count'](_0x377958)[_0xd042('0x1e')](function(_0x2da574){_0x4fb087['count']=_0x2da574;if(_0x2d03dd[_0xd042('0x2a')][_0xd042('0x3b')]){_0x12cbfa[_0xd042('0x3c')]=[{'all':!![]}];}return db[_0xd042('0x25')]['findAll'](_0x12cbfa);})[_0xd042('0x1e')](function(_0x3a6680){_0x4fb087[_0xd042('0x3d')]=_0x3a6680;return _0x4fb087;})[_0xd042('0x1e')](respondWithFilteredResult(_0x27775f,_0x12cbfa))['catch'](handleError(_0x27775f,null));};exports[_0xd042('0x3e')]=function(_0x43ea75,_0x5bdbb9){var _0x42acbe={'raw':!![],'where':{'id':_0x43ea75['params']['id']}},_0x1236a0={};_0x1236a0[_0xd042('0x29')]=_[_0xd042('0x2b')](db[_0xd042('0x25')][_0xd042('0x26')]);_0x1236a0[_0xd042('0x2a')]=_[_0xd042('0x2b')](_0x43ea75[_0xd042('0x2a')]);_0x1236a0['filters']=_[_0xd042('0x2d')](_0x1236a0[_0xd042('0x29')],_0x1236a0[_0xd042('0x2a')]);_0x42acbe[_0xd042('0x2f')]=_[_0xd042('0x2d')](_0x1236a0[_0xd042('0x29')],qs[_0xd042('0x2e')](_0x43ea75[_0xd042('0x2a')][_0xd042('0x2e')]));_0x42acbe[_0xd042('0x2f')]=_0x42acbe[_0xd042('0x2f')][_0xd042('0x30')]?_0x42acbe[_0xd042('0x2f')]:_0x1236a0[_0xd042('0x29')];if(_0x43ea75[_0xd042('0x2a')]['includeAll']){_0x42acbe[_0xd042('0x3c')]=[{'all':!![]}];}_0x42acbe=_['merge']({},_0x42acbe,_0x43ea75['options']);return db[_0xd042('0x25')][_0xd042('0x3f')](_0x42acbe)['then'](handleEntityNotFound(_0x5bdbb9,null))[_0xd042('0x1e')](respondWithResult(_0x5bdbb9,null))[_0xd042('0x40')](handleError(_0x5bdbb9,null));};exports[_0xd042('0x41')]=function(_0x4bd60a,_0x5a0aad){return db[_0xd042('0x25')][_0xd042('0x41')](_0x4bd60a['body'],{})[_0xd042('0x1e')](respondWithResult(_0x5a0aad,0xc9))[_0xd042('0x40')](handleError(_0x5a0aad,null));};exports[_0xd042('0x42')]=function(_0x2f3069,_0x3b0750){if(_0x2f3069[_0xd042('0x43')]['id']){delete _0x2f3069[_0xd042('0x43')]['id'];}return db['FreshdeskField'][_0xd042('0x3f')]({'where':{'id':_0x2f3069[_0xd042('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b0750,null))['then'](saveUpdates(_0x2f3069['body'],null))[_0xd042('0x1e')](respondWithResult(_0x3b0750,null))[_0xd042('0x40')](handleError(_0x3b0750,null));};exports['destroy']=function(_0xc4004c,_0x23f286){return db['FreshdeskField'][_0xd042('0x3f')]({'where':{'id':_0xc4004c[_0xd042('0x44')]['id']}})[_0xd042('0x1e')](handleEntityNotFound(_0x23f286,null))['then'](removeEntity(_0x23f286,null))['catch'](handleError(_0x23f286,null));}; \ No newline at end of file +var _0xc3e0=['model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','FreshdeskField','include','findAll','catch','params','includeAll','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json','apply','then','destroy','error','stack','name','map','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x425351,_0x695083){var _0x213256=function(_0x1e9335){while(--_0x1e9335){_0x425351['push'](_0x425351['shift']());}};_0x213256(++_0x695083);}(_0xc3e0,0x1cb));var _0x0c3e=function(_0x4021b3,_0x3549e3){_0x4021b3=_0x4021b3-0x0;var _0x2196d8=_0xc3e0[_0x4021b3];return _0x2196d8;};'use strict';var pdf=require(_0x0c3e('0x0'));var emlformat=require(_0x0c3e('0x1'));var rimraf=require(_0x0c3e('0x2'));var zipdir=require(_0x0c3e('0x3'));var jsonpatch=require(_0x0c3e('0x4'));var rp=require('request-promise');var moment=require(_0x0c3e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0c3e('0x6'));var util=require(_0x0c3e('0x7'));var path=require(_0x0c3e('0x8'));var sox=require(_0x0c3e('0x9'));var csv=require(_0x0c3e('0xa'));var ejs=require(_0x0c3e('0xb'));var fs=require('fs');var _=require(_0x0c3e('0xc'));var squel=require(_0x0c3e('0xd'));var crypto=require(_0x0c3e('0xe'));var jsforce=require(_0x0c3e('0xf'));var deskjs=require(_0x0c3e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0c3e('0x11'));var Papa=require(_0x0c3e('0x12'));var Redis=require(_0x0c3e('0x13'));var authService=require(_0x0c3e('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c3e('0x15'))(_0x0c3e('0x16'));var utils=require(_0x0c3e('0x17'));var config=require(_0x0c3e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24dbe9,_0x2160c1){_0x2160c1=_0x2160c1||0xcc;return function(_0x322f68){if(_0x322f68){return _0x24dbe9[_0x0c3e('0x19')](_0x2160c1);}return _0x24dbe9[_0x0c3e('0x1a')](_0x2160c1)['end']();};}function respondWithResult(_0x16b012,_0x5a6b40){_0x5a6b40=_0x5a6b40||0xc8;return function(_0x48c3ae){if(_0x48c3ae){return _0x16b012[_0x0c3e('0x1a')](_0x5a6b40)['json'](_0x48c3ae);}};}function respondWithFilteredResult(_0x19a1ef,_0x2742e7){return function(_0x1cea4e){if(_0x1cea4e){var _0x264d9c=_0x1cea4e[_0x0c3e('0x1b')],_0x49169f=_0x2742e7[_0x0c3e('0x1c')],_0x2019f8=_0x2742e7['offset']+_0x2742e7['limit'],_0x18a071;if(_0x2019f8>=_0x264d9c){_0x2019f8=_0x264d9c;_0x18a071=0xc8;}else{_0x18a071=0xce;}_0x19a1ef['status'](_0x18a071);return _0x19a1ef[_0x0c3e('0x1d')](_0x0c3e('0x1e'),_0x49169f+'-'+_0x2019f8+'/'+_0x264d9c)[_0x0c3e('0x1f')](_0x1cea4e);}return null;};}function patchUpdates(_0x32c8fe){return function(_0x42b955){try{jsonpatch[_0x0c3e('0x20')](_0x42b955,_0x32c8fe,!![]);}catch(_0x10ec4d){return BPromise['reject'](_0x10ec4d);}return _0x42b955['save']();};}function saveUpdates(_0x1a194d,_0x39df40){return function(_0x481b95){if(_0x481b95){return _0x481b95['update'](_0x1a194d)[_0x0c3e('0x21')](function(_0x1eb358){return _0x1eb358;});}return null;};}function removeEntity(_0x5eeb67,_0x1fcb0b){return function(_0x4333dd){if(_0x4333dd){return _0x4333dd[_0x0c3e('0x22')]()[_0x0c3e('0x21')](function(){_0x5eeb67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20067e,_0xfc5404){return function(_0x1a6041){if(!_0x1a6041){_0x20067e[_0x0c3e('0x19')](0x194);}return _0x1a6041;};}function handleError(_0x3df4e1,_0x54e13d){_0x54e13d=_0x54e13d||0x1f4;return function(_0xff2c56){logger[_0x0c3e('0x23')](_0xff2c56[_0x0c3e('0x24')]);if(_0xff2c56[_0x0c3e('0x25')]){delete _0xff2c56[_0x0c3e('0x25')];}_0x3df4e1['status'](_0x54e13d)['send'](_0xff2c56);};}exports['index']=function(_0x157aa8,_0x47e9f5){var _0x47e5de={},_0x450e38={},_0x34b5c8={'count':0x0,'rows':[]};var _0x5b3af2=_[_0x0c3e('0x26')](db['FreshdeskField'][_0x0c3e('0x27')],function(_0x412e9f){return{'name':_0x412e9f[_0x0c3e('0x28')],'type':_0x412e9f['type'][_0x0c3e('0x29')]};});_0x450e38['model']=_[_0x0c3e('0x26')](_0x5b3af2,_0x0c3e('0x25'));_0x450e38[_0x0c3e('0x2a')]=_[_0x0c3e('0x2b')](_0x157aa8[_0x0c3e('0x2a')]);_0x450e38[_0x0c3e('0x2c')]=_['intersection'](_0x450e38[_0x0c3e('0x2d')],_0x450e38[_0x0c3e('0x2a')]);_0x47e5de[_0x0c3e('0x2e')]=_[_0x0c3e('0x2f')](_0x450e38[_0x0c3e('0x2d')],qs[_0x0c3e('0x30')](_0x157aa8[_0x0c3e('0x2a')][_0x0c3e('0x30')]));_0x47e5de['attributes']=_0x47e5de[_0x0c3e('0x2e')][_0x0c3e('0x31')]?_0x47e5de['attributes']:_0x450e38['model'];if(!_0x157aa8[_0x0c3e('0x2a')][_0x0c3e('0x32')](_0x0c3e('0x33'))){_0x47e5de[_0x0c3e('0x34')]=qs[_0x0c3e('0x34')](_0x157aa8[_0x0c3e('0x2a')]['limit']);_0x47e5de['offset']=qs['offset'](_0x157aa8['query'][_0x0c3e('0x1c')]);}_0x47e5de[_0x0c3e('0x35')]=qs[_0x0c3e('0x36')](_0x157aa8['query'][_0x0c3e('0x36')]);_0x47e5de[_0x0c3e('0x37')]=qs[_0x0c3e('0x2c')](_[_0x0c3e('0x38')](_0x157aa8[_0x0c3e('0x2a')],_0x450e38[_0x0c3e('0x2c')]),_0x5b3af2);if(_0x157aa8[_0x0c3e('0x2a')]['filter']){_0x47e5de['where']=_[_0x0c3e('0x39')](_0x47e5de[_0x0c3e('0x37')],{'$or':_[_0x0c3e('0x26')](_0x5b3af2,function(_0x2af41f){if(_0x2af41f[_0x0c3e('0x3a')]!==_0x0c3e('0x3b')){var _0x5f54f1={};_0x5f54f1[_0x2af41f[_0x0c3e('0x25')]]={'$like':'%'+_0x157aa8[_0x0c3e('0x2a')][_0x0c3e('0x3c')]+'%'};return _0x5f54f1;}})});}_0x47e5de=_[_0x0c3e('0x39')]({},_0x47e5de,_0x157aa8[_0x0c3e('0x3d')]);var _0x121a65={'where':_0x47e5de[_0x0c3e('0x37')]};return db[_0x0c3e('0x3e')][_0x0c3e('0x1b')](_0x121a65)[_0x0c3e('0x21')](function(_0x5a7a1b){_0x34b5c8['count']=_0x5a7a1b;if(_0x157aa8[_0x0c3e('0x2a')]['includeAll']){_0x47e5de[_0x0c3e('0x3f')]=[{'all':!![]}];}return db[_0x0c3e('0x3e')][_0x0c3e('0x40')](_0x47e5de);})['then'](function(_0x45fb8e){_0x34b5c8['rows']=_0x45fb8e;return _0x34b5c8;})[_0x0c3e('0x21')](respondWithFilteredResult(_0x47e9f5,_0x47e5de))[_0x0c3e('0x41')](handleError(_0x47e9f5,null));};exports['show']=function(_0x1e9606,_0x448334){var _0x53792b={'raw':!![],'where':{'id':_0x1e9606[_0x0c3e('0x42')]['id']}},_0x1ccc7e={};_0x1ccc7e[_0x0c3e('0x2d')]=_[_0x0c3e('0x2b')](db[_0x0c3e('0x3e')][_0x0c3e('0x27')]);_0x1ccc7e[_0x0c3e('0x2a')]=_[_0x0c3e('0x2b')](_0x1e9606[_0x0c3e('0x2a')]);_0x1ccc7e[_0x0c3e('0x2c')]=_['intersection'](_0x1ccc7e[_0x0c3e('0x2d')],_0x1ccc7e[_0x0c3e('0x2a')]);_0x53792b[_0x0c3e('0x2e')]=_[_0x0c3e('0x2f')](_0x1ccc7e[_0x0c3e('0x2d')],qs[_0x0c3e('0x30')](_0x1e9606[_0x0c3e('0x2a')]['fields']));_0x53792b[_0x0c3e('0x2e')]=_0x53792b['attributes'][_0x0c3e('0x31')]?_0x53792b[_0x0c3e('0x2e')]:_0x1ccc7e[_0x0c3e('0x2d')];if(_0x1e9606[_0x0c3e('0x2a')][_0x0c3e('0x43')]){_0x53792b['include']=[{'all':!![]}];}_0x53792b=_[_0x0c3e('0x39')]({},_0x53792b,_0x1e9606[_0x0c3e('0x3d')]);return db[_0x0c3e('0x3e')][_0x0c3e('0x44')](_0x53792b)[_0x0c3e('0x21')](handleEntityNotFound(_0x448334,null))[_0x0c3e('0x21')](respondWithResult(_0x448334,null))[_0x0c3e('0x41')](handleError(_0x448334,null));};exports[_0x0c3e('0x45')]=function(_0x49fbf5,_0x6031c0){return db[_0x0c3e('0x3e')]['create'](_0x49fbf5[_0x0c3e('0x46')],{})[_0x0c3e('0x21')](respondWithResult(_0x6031c0,0xc9))[_0x0c3e('0x41')](handleError(_0x6031c0,null));};exports[_0x0c3e('0x47')]=function(_0x2682d7,_0x25218e){if(_0x2682d7[_0x0c3e('0x46')]['id']){delete _0x2682d7[_0x0c3e('0x46')]['id'];}return db[_0x0c3e('0x3e')][_0x0c3e('0x44')]({'where':{'id':_0x2682d7[_0x0c3e('0x42')]['id']}})[_0x0c3e('0x21')](handleEntityNotFound(_0x25218e,null))['then'](saveUpdates(_0x2682d7[_0x0c3e('0x46')],null))[_0x0c3e('0x21')](respondWithResult(_0x25218e,null))[_0x0c3e('0x41')](handleError(_0x25218e,null));};exports['destroy']=function(_0x15cd9b,_0x26a7a9){return db[_0x0c3e('0x3e')][_0x0c3e('0x44')]({'where':{'id':_0x15cd9b[_0x0c3e('0x42')]['id']}})[_0x0c3e('0x21')](handleEntityNotFound(_0x26a7a9,null))['then'](removeEntity(_0x26a7a9,null))[_0x0c3e('0x41')](handleError(_0x26a7a9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index c8a4f1c..d38ad7d 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 _0xf7d0=['exports','define','int_freshdesk_fields','util','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0xb4f654,_0x33ce4b){var _0x521323=function(_0x531016){while(--_0x531016){_0xb4f654['push'](_0xb4f654['shift']());}};_0x521323(++_0x33ce4b);}(_0xf7d0,0x139));var _0x0f7d=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0xf7d0[_0xfd495c];return _0x561dd8;};'use strict';var _=require('lodash');var util=require(_0x0f7d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0f7d('0x1'));var BPromise=require(_0x0f7d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f7d('0x3'));var rimraf=require(_0x0f7d('0x4'));var config=require(_0x0f7d('0x5'));var attributes=require(_0x0f7d('0x6'));module[_0x0f7d('0x7')]=function(_0x1fa0ef,_0x1b6b19){return _0x1fa0ef[_0x0f7d('0x8')]('FreshdeskField',attributes,{'tableName':_0x0f7d('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccdc=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x36a460,_0x5ae72f){var _0x1b0f1a=function(_0x32d15c){while(--_0x32d15c){_0x36a460['push'](_0x36a460['shift']());}};_0x1b0f1a(++_0x5ae72f);}(_0xccdc,0x17d));var _0xcccd=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xccdc[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xcccd('0x0'));var util=require(_0xcccd('0x1'));var logger=require(_0xcccd('0x2'))(_0xcccd('0x3'));var moment=require(_0xcccd('0x4'));var BPromise=require(_0xcccd('0x5'));var rp=require(_0xcccd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcccd('0x7'));var config=require(_0xcccd('0x8'));var attributes=require(_0xcccd('0x9'));module[_0xcccd('0xa')]=function(_0x30f9b7,_0x23be42){return _0x30f9b7[_0xcccd('0xb')](_0xcccd('0xc'),attributes,{'tableName':_0xcccd('0xd'),'paranoid':![],'indexes':[{'name':_0xcccd('0xe'),'fields':[_0xcccd('0xf'),_0xcccd('0x10')],'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 73a65f9..e9e2689 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(_0x272474,_0x38f721){_0x272474=_0x272474-0x0;var _0x5ccb3b=_0x7a54[_0x272474];return _0x5ccb3b;};'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 _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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x3c2328,_0x182624){_0x3c2328=_0x3c2328-0x0;var _0x2ef250=_0x7a54[_0x3c2328];return _0x2ef250;};'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 diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2ef9c7b..0991fbd 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 _0x8e6b=['isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8e6b,0x147));var _0xb8e6=function(_0xfac751,_0x4faaba){_0xfac751=_0xfac751-0x0;var _0x7ed761=_0x8e6b[_0xfac751];return _0x7ed761;};'use strict';var multer=require(_0xb8e6('0x0'));var util=require(_0xb8e6('0x1'));var path=require('path');var timeout=require(_0xb8e6('0x2'));var express=require(_0xb8e6('0x3'));var router=express['Router']();var auth=require(_0xb8e6('0x4'));var interaction=require(_0xb8e6('0x5'));var config=require(_0xb8e6('0x6'));var controller=require(_0xb8e6('0x7'));router[_0xb8e6('0x8')]('/',auth[_0xb8e6('0x9')](),controller[_0xb8e6('0xa')]);router[_0xb8e6('0x8')](_0xb8e6('0xb'),auth[_0xb8e6('0x9')](),controller['show']);router[_0xb8e6('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xb8e6('0xc')]);router[_0xb8e6('0x8')](_0xb8e6('0xd'),auth[_0xb8e6('0x9')](),controller[_0xb8e6('0xe')]);router[_0xb8e6('0xf')]('/',auth[_0xb8e6('0x9')](),controller[_0xb8e6('0x10')]);router[_0xb8e6('0xf')](_0xb8e6('0x11'),auth[_0xb8e6('0x9')](),controller[_0xb8e6('0x12')]);router[_0xb8e6('0x13')](_0xb8e6('0xb'),auth[_0xb8e6('0x9')](),controller[_0xb8e6('0x14')]);router[_0xb8e6('0x15')]('/:id',auth[_0xb8e6('0x9')](),controller[_0xb8e6('0x16')]);module[_0xb8e6('0x17')]=router; \ No newline at end of file +var _0xc7b5=['path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xc7b5,0x178));var _0x5c7b=function(_0x33cf90,_0x6b486a){_0x33cf90=_0x33cf90-0x0;var _0x378145=_0xc7b5[_0x33cf90];return _0x378145;};'use strict';var multer=require(_0x5c7b('0x0'));var util=require(_0x5c7b('0x1'));var path=require(_0x5c7b('0x2'));var timeout=require(_0x5c7b('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5c7b('0x4'));var config=require(_0x5c7b('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0x5c7b('0x6')]('/',auth[_0x5c7b('0x7')](),controller['index']);router[_0x5c7b('0x6')](_0x5c7b('0x8'),auth[_0x5c7b('0x7')](),controller[_0x5c7b('0x9')]);router[_0x5c7b('0x6')](_0x5c7b('0xa'),auth['isAuthenticated'](),controller[_0x5c7b('0xb')]);router[_0x5c7b('0x6')](_0x5c7b('0xc'),auth[_0x5c7b('0x7')](),controller[_0x5c7b('0xd')]);router[_0x5c7b('0xe')]('/',auth[_0x5c7b('0x7')](),controller[_0x5c7b('0xf')]);router[_0x5c7b('0xe')](_0x5c7b('0xa'),auth[_0x5c7b('0x7')](),controller[_0x5c7b('0x10')]);router[_0x5c7b('0x11')]('/:id',auth[_0x5c7b('0x7')](),controller[_0x5c7b('0x12')]);router[_0x5c7b('0x13')](_0x5c7b('0x8'),auth[_0x5c7b('0x7')](),controller[_0x5c7b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 096424e..3ebebf0 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 _0x23db=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5cac79,_0x5f272d){var _0x4dba8c=function(_0x66543f){while(--_0x66543f){_0x5cac79['push'](_0x5cac79['shift']());}};_0x4dba8c(++_0x5f272d);}(_0x23db,0x141));var _0xb23d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x23db[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xb23d('0x0'));module[_0xb23d('0x1')]={'name':{'type':Sequelize[_0xb23d('0x2')]},'description':{'type':Sequelize[_0xb23d('0x2')]},'username':{'type':Sequelize[_0xb23d('0x2')],'unique':_0xb23d('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb23d('0x4')},'serverUrl':{'type':Sequelize[_0xb23d('0x2')]}}; \ No newline at end of file +var _0x1c3d=['exports','STRING','username','remoteUri'];(function(_0x13e4ae,_0x549bdd){var _0x4bee51=function(_0x5eaa19){while(--_0x5eaa19){_0x13e4ae['push'](_0x13e4ae['shift']());}};_0x4bee51(++_0x549bdd);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x5d92e8,_0xf7614c){_0x5d92e8=_0x5d92e8-0x0;var _0x313a9f=_0x1c3d[_0x5d92e8];return _0x313a9f;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'name':{'type':Sequelize[_0xd1c3('0x1')]},'description':{'type':Sequelize[_0xd1c3('0x1')]},'username':{'type':Sequelize[_0xd1c3('0x1')],'unique':_0xd1c3('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd1c3('0x3')},'serverUrl':{'type':Sequelize[_0xd1c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 583445c..923e7ae 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 _0x0ddf=['Subjects','getSubjects','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','format','%s%s','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','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','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','json','offset','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','show','params','rawAttributes','include','merge','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId'];(function(_0x1f217d,_0x5bca41){var _0x60a5cc=function(_0x57a58b){while(--_0x57a58b){_0x1f217d['push'](_0x1f217d['shift']());}};_0x60a5cc(++_0x5bca41);}(_0x0ddf,0x1e1));var _0xf0dd=function(_0x39cc6b,_0x3ae477){_0x39cc6b=_0x39cc6b-0x0;var _0x425b94=_0x0ddf[_0x39cc6b];return _0x425b94;};'use strict';var pdf=require(_0xf0dd('0x0'));var emlformat=require(_0xf0dd('0x1'));var rimraf=require(_0xf0dd('0x2'));var zipdir=require(_0xf0dd('0x3'));var jsonpatch=require(_0xf0dd('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0dd('0x5'));var Mustache=require(_0xf0dd('0x6'));var util=require(_0xf0dd('0x7'));var path=require(_0xf0dd('0x8'));var sox=require(_0xf0dd('0x9'));var csv=require(_0xf0dd('0xa'));var ejs=require(_0xf0dd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0dd('0xc'));var crypto=require(_0xf0dd('0xd'));var jsforce=require(_0xf0dd('0xe'));var deskjs=require(_0xf0dd('0xf'));var toCsv=require(_0xf0dd('0xa'));var querystring=require(_0xf0dd('0x10'));var Papa=require(_0xf0dd('0x11'));var Redis=require(_0xf0dd('0x12'));var authService=require(_0xf0dd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf0dd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0dd('0x15'))('api');var utils=require(_0xf0dd('0x16'));var config=require(_0xf0dd('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf0dd('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xf0dd('0x19')][_0xf0dd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x728665,_0x97c176,_0x1725ac){if(_0x1725ac){var _0x4d15ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d15ab['test'](_0x97c176)){return _0x728665;}else{throw new db[(_0xf0dd('0x1b'))][(_0xf0dd('0x1c'))](_0xf0dd('0x1d'));}}else{return _0x728665;}}function respondWithRpcPromise(_0x10d875,_0x4df6dd,_0x73e2c9,_0x3e5d5b){return new BPromise(function(_0x47a60f,_0x34a16c){var _0x1907dc=_0x3e5d5b||client;return _0x1907dc[_0xf0dd('0x1e')](_0x10d875,_0x73e2c9)['then'](function(_0x30dc7d){logger['info'](_0xf0dd('0x1f'),_0x4df6dd,'request\x20sent');logger[_0xf0dd('0x20')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4df6dd,_0xf0dd('0x21'),JSON[_0xf0dd('0x22')](_0x30dc7d));if(_0x30dc7d[_0xf0dd('0x23')]){if(_0x30dc7d[_0xf0dd('0x23')][_0xf0dd('0x24')]===0x1f4){logger[_0xf0dd('0x23')](_0xf0dd('0x1f'),_0x4df6dd,_0x30dc7d['error'][_0xf0dd('0x25')]);return _0x34a16c(_0x30dc7d[_0xf0dd('0x23')][_0xf0dd('0x25')]);}logger[_0xf0dd('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x4df6dd,_0x30dc7d[_0xf0dd('0x23')]['message']);return _0x47a60f(_0x30dc7d[_0xf0dd('0x23')][_0xf0dd('0x25')]);}else{logger[_0xf0dd('0x26')](_0xf0dd('0x1f'),_0x4df6dd,_0xf0dd('0x21'));_0x47a60f(_0x30dc7d[_0xf0dd('0x27')][_0xf0dd('0x25')]);}})[_0xf0dd('0x28')](function(_0x59fbc0){logger['error'](_0xf0dd('0x1f'),_0x4df6dd,_0x59fbc0);_0x34a16c(_0x59fbc0);});});}function respondWithStatusCode(_0xdf8eac,_0x5d2933){_0x5d2933=_0x5d2933||0xcc;return function(_0x598f15){if(_0x598f15){return _0xdf8eac['sendStatus'](_0x5d2933);}return _0xdf8eac[_0xf0dd('0x29')](_0x5d2933)['end']();};}function respondWithResult(_0x268c25,_0x24710b){_0x24710b=_0x24710b||0xc8;return function(_0x1b56c8){if(_0x1b56c8){return _0x268c25[_0xf0dd('0x29')](_0x24710b)[_0xf0dd('0x2a')](_0x1b56c8);}};}function respondWithFilteredResult(_0x2740bc,_0x20b47b){return function(_0x3b4ca0){if(_0x3b4ca0){var _0x4edeee=_0x3b4ca0['count'],_0x4889d0=_0x20b47b[_0xf0dd('0x2b')],_0x1a6972=_0x20b47b[_0xf0dd('0x2b')]+_0x20b47b['limit'],_0x57dc51;if(_0x1a6972>=_0x4edeee){_0x1a6972=_0x4edeee;_0x57dc51=0xc8;}else{_0x57dc51=0xce;}_0x2740bc[_0xf0dd('0x29')](_0x57dc51);return _0x2740bc['set']('Content-Range',_0x4889d0+'-'+_0x1a6972+'/'+_0x4edeee)[_0xf0dd('0x2a')](_0x3b4ca0);}return null;};}function patchUpdates(_0xcb907){return function(_0x25e33c){try{jsonpatch[_0xf0dd('0x2c')](_0x25e33c,_0xcb907,!![]);}catch(_0x2bcec1){return BPromise[_0xf0dd('0x2d')](_0x2bcec1);}return _0x25e33c[_0xf0dd('0x2e')]();};}function saveUpdates(_0x244738,_0x1d589c){return function(_0x49d157){if(_0x49d157){return _0x49d157[_0xf0dd('0x2f')](_0x244738)[_0xf0dd('0x30')](function(_0x1a908e){return _0x1a908e;});}return null;};}function removeEntity(_0x294c7a,_0xe9471){return function(_0x294e9e){if(_0x294e9e){return _0x294e9e[_0xf0dd('0x31')]()[_0xf0dd('0x30')](function(){_0x294c7a[_0xf0dd('0x29')](0xcc)[_0xf0dd('0x32')]();});}};}function handleEntityNotFound(_0x3b1d58,_0x1db536){return function(_0x8c3cea){if(!_0x8c3cea){_0x3b1d58[_0xf0dd('0x33')](0x194);}return _0x8c3cea;};}function handleError(_0x3efeeb,_0x208319){_0x208319=_0x208319||0x1f4;return function(_0x3141f2){logger[_0xf0dd('0x23')](_0x3141f2[_0xf0dd('0x34')]);if(_0x3141f2[_0xf0dd('0x35')]){delete _0x3141f2[_0xf0dd('0x35')];}_0x3efeeb[_0xf0dd('0x29')](_0x208319)[_0xf0dd('0x36')](_0x3141f2);};}exports[_0xf0dd('0x37')]=function(_0xa70d0e,_0x5aa350){var _0x33069f={},_0x5230af={},_0x50cb55={'count':0x0,'rows':[]};var _0x11b462=_[_0xf0dd('0x38')](db['FreshsalesAccount']['rawAttributes'],function(_0x41a8b5){return{'name':_0x41a8b5['fieldName'],'type':_0x41a8b5[_0xf0dd('0x39')][_0xf0dd('0x3a')]};});_0x5230af[_0xf0dd('0x3b')]=_[_0xf0dd('0x38')](_0x11b462,_0xf0dd('0x35'));_0x5230af[_0xf0dd('0x3c')]=_[_0xf0dd('0x3d')](_0xa70d0e[_0xf0dd('0x3c')]);_0x5230af[_0xf0dd('0x3e')]=_[_0xf0dd('0x3f')](_0x5230af['model'],_0x5230af[_0xf0dd('0x3c')]);_0x33069f[_0xf0dd('0x40')]=_[_0xf0dd('0x3f')](_0x5230af[_0xf0dd('0x3b')],qs[_0xf0dd('0x41')](_0xa70d0e['query']['fields']));_0x33069f[_0xf0dd('0x40')]=_0x33069f[_0xf0dd('0x40')][_0xf0dd('0x42')]?_0x33069f[_0xf0dd('0x40')]:_0x5230af['model'];if(!_0xa70d0e[_0xf0dd('0x3c')][_0xf0dd('0x43')]('nolimit')){_0x33069f['limit']=qs['limit'](_0xa70d0e[_0xf0dd('0x3c')][_0xf0dd('0x44')]);_0x33069f[_0xf0dd('0x2b')]=qs[_0xf0dd('0x2b')](_0xa70d0e[_0xf0dd('0x3c')][_0xf0dd('0x2b')]);}_0x33069f[_0xf0dd('0x45')]=qs[_0xf0dd('0x46')](_0xa70d0e[_0xf0dd('0x3c')]['sort']);_0x33069f[_0xf0dd('0x47')]=qs['filters'](_[_0xf0dd('0x48')](_0xa70d0e[_0xf0dd('0x3c')],_0x5230af['filters']),_0x11b462);if(_0xa70d0e[_0xf0dd('0x3c')][_0xf0dd('0x49')]){_0x33069f[_0xf0dd('0x47')]=_['merge'](_0x33069f[_0xf0dd('0x47')],{'$or':_[_0xf0dd('0x38')](_0x11b462,function(_0x198214){if(_0x198214[_0xf0dd('0x39')]!==_0xf0dd('0x4a')){var _0x381393={};_0x381393[_0x198214['name']]={'$like':'%'+_0xa70d0e['query'][_0xf0dd('0x49')]+'%'};return _0x381393;}})});}_0x33069f=_['merge']({},_0x33069f,_0xa70d0e[_0xf0dd('0x4b')]);var _0x4188c2={'where':_0x33069f[_0xf0dd('0x47')]};return db[_0xf0dd('0x4c')]['count'](_0x4188c2)[_0xf0dd('0x30')](function(_0x4121b0){_0x50cb55['count']=_0x4121b0;if(_0xa70d0e[_0xf0dd('0x3c')][_0xf0dd('0x4d')]){_0x33069f['include']=[{'all':!![]}];}return db[_0xf0dd('0x4c')][_0xf0dd('0x4e')](_0x33069f);})['then'](function(_0x3ef280){_0x50cb55[_0xf0dd('0x4f')]=_0x3ef280;return _0x50cb55;})['then'](respondWithFilteredResult(_0x5aa350,_0x33069f))['catch'](handleError(_0x5aa350,null));};exports[_0xf0dd('0x50')]=function(_0x211aad,_0x1b624f){var _0x27b881={'raw':![],'where':{'id':_0x211aad[_0xf0dd('0x51')]['id']}},_0x5d4aa9={};_0x5d4aa9[_0xf0dd('0x3b')]=_[_0xf0dd('0x3d')](db[_0xf0dd('0x4c')][_0xf0dd('0x52')]);_0x5d4aa9[_0xf0dd('0x3c')]=_['keys'](_0x211aad[_0xf0dd('0x3c')]);_0x5d4aa9[_0xf0dd('0x3e')]=_[_0xf0dd('0x3f')](_0x5d4aa9[_0xf0dd('0x3b')],_0x5d4aa9[_0xf0dd('0x3c')]);_0x27b881['attributes']=_[_0xf0dd('0x3f')](_0x5d4aa9[_0xf0dd('0x3b')],qs[_0xf0dd('0x41')](_0x211aad[_0xf0dd('0x3c')]['fields']));_0x27b881[_0xf0dd('0x40')]=_0x27b881[_0xf0dd('0x40')][_0xf0dd('0x42')]?_0x27b881[_0xf0dd('0x40')]:_0x5d4aa9[_0xf0dd('0x3b')];if(_0x211aad[_0xf0dd('0x3c')]['includeAll']){_0x27b881[_0xf0dd('0x53')]=[{'all':!![]}];}_0x27b881=_[_0xf0dd('0x54')]({},_0x27b881,_0x211aad['options']);return db[_0xf0dd('0x4c')][_0xf0dd('0x55')](_0x27b881)[_0xf0dd('0x30')](handleEntityNotFound(_0x1b624f,null))[_0xf0dd('0x30')](respondWithResult(_0x1b624f,null))[_0xf0dd('0x28')](handleError(_0x1b624f,null));};exports['create']=function(_0xf2076f,_0x59c195){return db[_0xf0dd('0x4c')][_0xf0dd('0x56')](_0xf2076f[_0xf0dd('0x57')],{})[_0xf0dd('0x30')](respondWithResult(_0x59c195,0xc9))[_0xf0dd('0x28')](handleError(_0x59c195,null));};exports[_0xf0dd('0x2f')]=function(_0x232baa,_0x896fbb){if(_0x232baa[_0xf0dd('0x57')]['id']){delete _0x232baa[_0xf0dd('0x57')]['id'];}return db[_0xf0dd('0x4c')]['find']({'where':{'id':_0x232baa[_0xf0dd('0x51')]['id']}})[_0xf0dd('0x30')](handleEntityNotFound(_0x896fbb,null))['then'](saveUpdates(_0x232baa[_0xf0dd('0x57')],null))['then'](respondWithResult(_0x896fbb,null))[_0xf0dd('0x28')](handleError(_0x896fbb,null));};exports[_0xf0dd('0x31')]=function(_0x2f6fbb,_0xb69fd5){return db['FreshsalesAccount'][_0xf0dd('0x55')]({'where':{'id':_0x2f6fbb[_0xf0dd('0x51')]['id']}})[_0xf0dd('0x30')](handleEntityNotFound(_0xb69fd5,null))[_0xf0dd('0x30')](removeEntity(_0xb69fd5,null))[_0xf0dd('0x28')](handleError(_0xb69fd5,null));};exports[_0xf0dd('0x58')]=function(_0xa15568,_0x204cca,_0x4e0c33){var _0x26b9f2={};var _0x9aba9b={};var _0x4685c6;var _0x5a4d8d;return db[_0xf0dd('0x4c')][_0xf0dd('0x59')]({'where':{'id':_0xa15568[_0xf0dd('0x51')]['id']}})[_0xf0dd('0x30')](handleEntityNotFound(_0x204cca,null))[_0xf0dd('0x30')](function(_0x131548){if(_0x131548){_0x4685c6=_0x131548;_0x9aba9b[_0xf0dd('0x3b')]=_[_0xf0dd('0x3d')](db[_0xf0dd('0x5a')][_0xf0dd('0x52')]);_0x9aba9b['query']=_[_0xf0dd('0x3d')](_0xa15568[_0xf0dd('0x3c')]);_0x9aba9b['filters']=_[_0xf0dd('0x3f')](_0x9aba9b['model'],_0x9aba9b[_0xf0dd('0x3c')]);_0x26b9f2[_0xf0dd('0x40')]=_[_0xf0dd('0x3f')](_0x9aba9b[_0xf0dd('0x3b')],qs[_0xf0dd('0x41')](_0xa15568['query'][_0xf0dd('0x41')]));_0x26b9f2['attributes']=_0x26b9f2[_0xf0dd('0x40')][_0xf0dd('0x42')]?_0x26b9f2[_0xf0dd('0x40')]:_0x9aba9b[_0xf0dd('0x3b')];_0x26b9f2[_0xf0dd('0x45')]=qs[_0xf0dd('0x46')](_0xa15568[_0xf0dd('0x3c')]['sort']);_0x26b9f2[_0xf0dd('0x47')]=qs[_0xf0dd('0x3e')](_[_0xf0dd('0x48')](_0xa15568[_0xf0dd('0x3c')],_0x9aba9b['filters']));if(_0xa15568[_0xf0dd('0x3c')][_0xf0dd('0x49')]){_0x26b9f2['where']=_[_0xf0dd('0x54')](_0x26b9f2[_0xf0dd('0x47')],{'$or':_[_0xf0dd('0x38')](_0x26b9f2[_0xf0dd('0x40')],function(_0x574f57){var _0x3252af={};_0x3252af[_0x574f57]={'$like':'%'+_0xa15568[_0xf0dd('0x3c')][_0xf0dd('0x49')]+'%'};return _0x3252af;})});}_0x26b9f2=_[_0xf0dd('0x54')]({},_0x26b9f2,_0xa15568[_0xf0dd('0x4b')]);return _0x4685c6['getConfigurations'](_0x26b9f2);}})[_0xf0dd('0x30')](function(_0x5ad01a){if(_0x5ad01a){_0x5a4d8d=_0x5ad01a[_0xf0dd('0x42')];if(!_0xa15568[_0xf0dd('0x3c')]['hasOwnProperty'](_0xf0dd('0x5b'))){_0x26b9f2['limit']=qs[_0xf0dd('0x44')](_0xa15568[_0xf0dd('0x3c')]['limit']);_0x26b9f2[_0xf0dd('0x2b')]=qs[_0xf0dd('0x2b')](_0xa15568[_0xf0dd('0x3c')][_0xf0dd('0x2b')]);}return _0x4685c6[_0xf0dd('0x58')](_0x26b9f2);}})[_0xf0dd('0x30')](function(_0x462b1d){if(_0x462b1d){return _0x462b1d?{'count':_0x5a4d8d,'rows':_0x462b1d}:null;}})[_0xf0dd('0x30')](respondWithResult(_0x204cca,null))[_0xf0dd('0x28')](handleError(_0x204cca,null));};exports[_0xf0dd('0x5c')]=function(_0x6d9143,_0x12f346,_0x113144){if(_0x6d9143[_0xf0dd('0x57')]['id']){delete _0x6d9143['body']['id'];}return db[_0xf0dd('0x4c')]['findOne']({'where':{'id':_0x6d9143[_0xf0dd('0x51')]['id']}})[_0xf0dd('0x30')](handleEntityNotFound(_0x12f346,null))[_0xf0dd('0x30')](function(_0xb6f818){if(_0xb6f818){_0x6d9143['body'][_0xf0dd('0x5d')]=_0xb6f818['id'];_0x6d9143[_0xf0dd('0x57')][_0xf0dd('0x5e')]=integrations[_0xf0dd('0x5f')](_0x6d9143['body']['channel'],_0x6d9143[_0xf0dd('0x57')][_0xf0dd('0x39')]);_0x6d9143[_0xf0dd('0x57')]['Descriptions']=integrations[_0xf0dd('0x60')](_0x6d9143[_0xf0dd('0x57')][_0xf0dd('0x61')],_0x6d9143['body']['type']);return db['FreshsalesConfiguration']['create'](_0x6d9143[_0xf0dd('0x57')],{'include':[{'model':db[_0xf0dd('0x62')],'as':_0xf0dd('0x5e')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xf0dd('0x30')](respondWithResult(_0x12f346,null))[_0xf0dd('0x28')](handleError(_0x12f346,null));};exports[_0xf0dd('0x63')]=function(_0x573950,_0x1b6799,_0x5bfefc){var _0xb35797='';var _0x342a48='';return db[_0xf0dd('0x4c')]['findOne']({'where':{'id':_0x573950[_0xf0dd('0x51')]['id']},'attributes':['id',_0xf0dd('0x64'),_0xf0dd('0x65'),'apiKey']})[_0xf0dd('0x30')](handleEntityNotFound(_0x1b6799,null))[_0xf0dd('0x30')](function(_0x2a07d1){if(_0x2a07d1){_0x342a48=_0x2a07d1[_0xf0dd('0x64')];_0xb35797=_0x2a07d1[_0xf0dd('0x65')];var _0x8ab7e3=_0x2a07d1[_0xf0dd('0x65')][_0xf0dd('0x66')](-0x1);if(_0x8ab7e3==='/'){_0xb35797=_0xb35797[_0xf0dd('0x67')](0x0,_0xb35797[_0xf0dd('0x68')](_0x8ab7e3));}return rp({'method':'GET','uri':util[_0xf0dd('0x69')](_0xf0dd('0x6a'),_0xb35797,'/api/selector/owners'),'headers':{'Authorization':_0xf0dd('0x6b')+_0x2a07d1[_0xf0dd('0x6c')]},'json':!![]});}})[_0xf0dd('0x30')](function(_0x552c6c){if(_0x552c6c){var _0x1c5306=_0x552c6c[_0xf0dd('0x6d')];var _0x1ec62c=![];var _0x3abdb5=null;for(_0x3abdb5=0x0;_0x3abdb5<_0x1c5306[_0xf0dd('0x42')];_0x3abdb5++){if(_0x1c5306[_0x3abdb5][_0xf0dd('0x6e')]===_0x342a48){_0x1ec62c=!![];}}if(_0x1ec62c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf0dd('0x6f')});}}})[_0xf0dd('0x30')](respondWithResult(_0x1b6799,null))['catch'](function(_0x59acb2){var _0x379575=_0x573950[_0xf0dd('0x3c')][_0xf0dd('0x70')]?0x1f4:_0x59acb2[_0xf0dd('0x71')]||0x1f4;logger[_0xf0dd('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xf0dd('0x63'),_0x379575,JSON['stringify'](_0x59acb2));delete _0x59acb2[_0xf0dd('0x35')];if(_0x379575===0x191){_0x379575=0x190;}_0x1b6799[_0xf0dd('0x29')](_0x379575)['send'](_0x573950['query'][_0xf0dd('0x70')]?{'message':_0xf0dd('0x72'),'statusCode':_0x59acb2[_0xf0dd('0x71')]}:_0x59acb2);});}; \ No newline at end of file +var _0xf296=['Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','destroy','stack','name','index','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','FreshsalesAccount','count','include','findAll','rows','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','email'];(function(_0x4a5091,_0x1e61be){var _0x10cbd8=function(_0x3caee7){while(--_0x3caee7){_0x4a5091['push'](_0x4a5091['shift']());}};_0x10cbd8(++_0x1e61be);}(_0xf296,0xec));var _0x6f29=function(_0x23fd1b,_0x469cab){_0x23fd1b=_0x23fd1b-0x0;var _0x304e83=_0xf296[_0x23fd1b];return _0x304e83;};'use strict';var pdf=require(_0x6f29('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f29('0x2'));var rp=require(_0x6f29('0x3'));var moment=require(_0x6f29('0x4'));var BPromise=require(_0x6f29('0x5'));var Mustache=require(_0x6f29('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6f29('0x7'));var csv=require('to-csv');var ejs=require(_0x6f29('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f29('0x9'));var crypto=require('crypto');var jsforce=require(_0x6f29('0xa'));var deskjs=require(_0x6f29('0xb'));var toCsv=require(_0x6f29('0xc'));var querystring=require(_0x6f29('0xd'));var Papa=require(_0x6f29('0xe'));var Redis=require(_0x6f29('0xf'));var authService=require(_0x6f29('0x10'));var qs=require(_0x6f29('0x11'));var as=require(_0x6f29('0x12'));var hardwareService=require(_0x6f29('0x13'));var logger=require(_0x6f29('0x14'))(_0x6f29('0x15'));var utils=require('../../config/utils');var config=require(_0x6f29('0x16'));var db=require(_0x6f29('0x17'))['db'];var integrations=require(_0x6f29('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x6f29('0x19')][_0x6f29('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x896669,_0x4d1571,_0x2db2e7){if(_0x2db2e7){var _0x451e96=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x451e96['test'](_0x4d1571)){return _0x896669;}else{throw new db['Sequelize'][(_0x6f29('0x1b'))](_0x6f29('0x1c'));}}else{return _0x896669;}}function respondWithRpcPromise(_0x5b083d,_0x2b4c32,_0xfcf013,_0x4a127b){return new BPromise(function(_0xff9c84,_0x4e7fa6){var _0x52509f=_0x4a127b||client;return _0x52509f['request'](_0x5b083d,_0xfcf013)[_0x6f29('0x1d')](function(_0x906d67){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x2b4c32,_0x6f29('0x1e'));logger[_0x6f29('0x1f')](_0x6f29('0x20'),_0x2b4c32,_0x6f29('0x1e'),JSON[_0x6f29('0x21')](_0x906d67));if(_0x906d67['error']){if(_0x906d67[_0x6f29('0x22')][_0x6f29('0x23')]===0x1f4){logger[_0x6f29('0x22')](_0x6f29('0x24'),_0x2b4c32,_0x906d67[_0x6f29('0x22')][_0x6f29('0x25')]);return _0x4e7fa6(_0x906d67[_0x6f29('0x22')][_0x6f29('0x25')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x2b4c32,_0x906d67[_0x6f29('0x22')][_0x6f29('0x25')]);return _0xff9c84(_0x906d67[_0x6f29('0x22')][_0x6f29('0x25')]);}else{logger[_0x6f29('0x26')](_0x6f29('0x24'),_0x2b4c32,_0x6f29('0x1e'));_0xff9c84(_0x906d67[_0x6f29('0x27')][_0x6f29('0x25')]);}})[_0x6f29('0x28')](function(_0x36f503){logger['error'](_0x6f29('0x24'),_0x2b4c32,_0x36f503);_0x4e7fa6(_0x36f503);});});}function respondWithStatusCode(_0x371148,_0x10ff85){_0x10ff85=_0x10ff85||0xcc;return function(_0x536440){if(_0x536440){return _0x371148[_0x6f29('0x29')](_0x10ff85);}return _0x371148[_0x6f29('0x2a')](_0x10ff85)[_0x6f29('0x2b')]();};}function respondWithResult(_0x374ddc,_0x3758d7){_0x3758d7=_0x3758d7||0xc8;return function(_0x46b460){if(_0x46b460){return _0x374ddc[_0x6f29('0x2a')](_0x3758d7)[_0x6f29('0x2c')](_0x46b460);}};}function respondWithFilteredResult(_0xa45934,_0x1021d6){return function(_0x543f8e){if(_0x543f8e){var _0x5ca295=_0x543f8e['count'],_0x3fe35d=_0x1021d6[_0x6f29('0x2d')],_0xf4e989=_0x1021d6[_0x6f29('0x2d')]+_0x1021d6['limit'],_0x448877;if(_0xf4e989>=_0x5ca295){_0xf4e989=_0x5ca295;_0x448877=0xc8;}else{_0x448877=0xce;}_0xa45934[_0x6f29('0x2a')](_0x448877);return _0xa45934[_0x6f29('0x2e')](_0x6f29('0x2f'),_0x3fe35d+'-'+_0xf4e989+'/'+_0x5ca295)[_0x6f29('0x2c')](_0x543f8e);}return null;};}function patchUpdates(_0x1e18c4){return function(_0x13517e){try{jsonpatch[_0x6f29('0x30')](_0x13517e,_0x1e18c4,!![]);}catch(_0x2f7c60){return BPromise[_0x6f29('0x31')](_0x2f7c60);}return _0x13517e['save']();};}function saveUpdates(_0x2cda12,_0xb7bca2){return function(_0x357ff1){if(_0x357ff1){return _0x357ff1[_0x6f29('0x32')](_0x2cda12)['then'](function(_0xaa243){return _0xaa243;});}return null;};}function removeEntity(_0x250d41,_0x19123d){return function(_0x21a57b){if(_0x21a57b){return _0x21a57b[_0x6f29('0x33')]()[_0x6f29('0x1d')](function(){_0x250d41[_0x6f29('0x2a')](0xcc)[_0x6f29('0x2b')]();});}};}function handleEntityNotFound(_0x16ec57,_0x1f1b7a){return function(_0x2e4b93){if(!_0x2e4b93){_0x16ec57['sendStatus'](0x194);}return _0x2e4b93;};}function handleError(_0x3fb822,_0x1bbe38){_0x1bbe38=_0x1bbe38||0x1f4;return function(_0x217b7f){logger[_0x6f29('0x22')](_0x217b7f[_0x6f29('0x34')]);if(_0x217b7f['name']){delete _0x217b7f[_0x6f29('0x35')];}_0x3fb822[_0x6f29('0x2a')](_0x1bbe38)['send'](_0x217b7f);};}exports[_0x6f29('0x36')]=function(_0x3e7eda,_0x1c809d){var _0x28fcdc={},_0x28d392={},_0x3bd55c={'count':0x0,'rows':[]};var _0x3834b6=_['map'](db['FreshsalesAccount'][_0x6f29('0x37')],function(_0x293d00){return{'name':_0x293d00[_0x6f29('0x38')],'type':_0x293d00['type'][_0x6f29('0x39')]};});_0x28d392['model']=_[_0x6f29('0x3a')](_0x3834b6,'name');_0x28d392[_0x6f29('0x3b')]=_[_0x6f29('0x3c')](_0x3e7eda['query']);_0x28d392['filters']=_[_0x6f29('0x3d')](_0x28d392[_0x6f29('0x3e')],_0x28d392['query']);_0x28fcdc[_0x6f29('0x3f')]=_[_0x6f29('0x3d')](_0x28d392[_0x6f29('0x3e')],qs[_0x6f29('0x40')](_0x3e7eda['query']['fields']));_0x28fcdc[_0x6f29('0x3f')]=_0x28fcdc[_0x6f29('0x3f')][_0x6f29('0x41')]?_0x28fcdc['attributes']:_0x28d392[_0x6f29('0x3e')];if(!_0x3e7eda[_0x6f29('0x3b')]['hasOwnProperty'](_0x6f29('0x42'))){_0x28fcdc['limit']=qs[_0x6f29('0x43')](_0x3e7eda[_0x6f29('0x3b')][_0x6f29('0x43')]);_0x28fcdc[_0x6f29('0x2d')]=qs[_0x6f29('0x2d')](_0x3e7eda[_0x6f29('0x3b')][_0x6f29('0x2d')]);}_0x28fcdc[_0x6f29('0x44')]=qs[_0x6f29('0x45')](_0x3e7eda['query']['sort']);_0x28fcdc[_0x6f29('0x46')]=qs['filters'](_[_0x6f29('0x47')](_0x3e7eda[_0x6f29('0x3b')],_0x28d392[_0x6f29('0x48')]),_0x3834b6);if(_0x3e7eda[_0x6f29('0x3b')][_0x6f29('0x49')]){_0x28fcdc[_0x6f29('0x46')]=_[_0x6f29('0x4a')](_0x28fcdc[_0x6f29('0x46')],{'$or':_[_0x6f29('0x3a')](_0x3834b6,function(_0x39c26e){if(_0x39c26e[_0x6f29('0x4b')]!==_0x6f29('0x4c')){var _0xe2e936={};_0xe2e936[_0x39c26e[_0x6f29('0x35')]]={'$like':'%'+_0x3e7eda[_0x6f29('0x3b')][_0x6f29('0x49')]+'%'};return _0xe2e936;}})});}_0x28fcdc=_[_0x6f29('0x4a')]({},_0x28fcdc,_0x3e7eda[_0x6f29('0x4d')]);var _0x126392={'where':_0x28fcdc[_0x6f29('0x46')]};return db[_0x6f29('0x4e')][_0x6f29('0x4f')](_0x126392)['then'](function(_0x13b922){_0x3bd55c['count']=_0x13b922;if(_0x3e7eda[_0x6f29('0x3b')]['includeAll']){_0x28fcdc[_0x6f29('0x50')]=[{'all':!![]}];}return db[_0x6f29('0x4e')][_0x6f29('0x51')](_0x28fcdc);})[_0x6f29('0x1d')](function(_0x4af545){_0x3bd55c[_0x6f29('0x52')]=_0x4af545;return _0x3bd55c;})[_0x6f29('0x1d')](respondWithFilteredResult(_0x1c809d,_0x28fcdc))[_0x6f29('0x28')](handleError(_0x1c809d,null));};exports['show']=function(_0x25c1d2,_0x5d2a02){var _0x364d83={'raw':![],'where':{'id':_0x25c1d2['params']['id']}},_0x45352a={};_0x45352a[_0x6f29('0x3e')]=_[_0x6f29('0x3c')](db['FreshsalesAccount'][_0x6f29('0x37')]);_0x45352a['query']=_[_0x6f29('0x3c')](_0x25c1d2[_0x6f29('0x3b')]);_0x45352a['filters']=_[_0x6f29('0x3d')](_0x45352a[_0x6f29('0x3e')],_0x45352a[_0x6f29('0x3b')]);_0x364d83[_0x6f29('0x3f')]=_[_0x6f29('0x3d')](_0x45352a['model'],qs[_0x6f29('0x40')](_0x25c1d2[_0x6f29('0x3b')][_0x6f29('0x40')]));_0x364d83['attributes']=_0x364d83[_0x6f29('0x3f')][_0x6f29('0x41')]?_0x364d83[_0x6f29('0x3f')]:_0x45352a['model'];if(_0x25c1d2['query']['includeAll']){_0x364d83[_0x6f29('0x50')]=[{'all':!![]}];}_0x364d83=_[_0x6f29('0x4a')]({},_0x364d83,_0x25c1d2[_0x6f29('0x4d')]);return db['FreshsalesAccount'][_0x6f29('0x53')](_0x364d83)[_0x6f29('0x1d')](handleEntityNotFound(_0x5d2a02,null))['then'](respondWithResult(_0x5d2a02,null))[_0x6f29('0x28')](handleError(_0x5d2a02,null));};exports[_0x6f29('0x54')]=function(_0x4728ea,_0x39b5ae){return db[_0x6f29('0x4e')][_0x6f29('0x54')](_0x4728ea['body'],{})['then'](respondWithResult(_0x39b5ae,0xc9))[_0x6f29('0x28')](handleError(_0x39b5ae,null));};exports[_0x6f29('0x32')]=function(_0x2e9c97,_0x3101e2){if(_0x2e9c97['body']['id']){delete _0x2e9c97[_0x6f29('0x55')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x2e9c97[_0x6f29('0x56')]['id']}})['then'](handleEntityNotFound(_0x3101e2,null))['then'](saveUpdates(_0x2e9c97[_0x6f29('0x55')],null))[_0x6f29('0x1d')](respondWithResult(_0x3101e2,null))[_0x6f29('0x28')](handleError(_0x3101e2,null));};exports[_0x6f29('0x33')]=function(_0x3b35fa,_0x1b6fac){return db[_0x6f29('0x4e')][_0x6f29('0x53')]({'where':{'id':_0x3b35fa['params']['id']}})[_0x6f29('0x1d')](handleEntityNotFound(_0x1b6fac,null))[_0x6f29('0x1d')](removeEntity(_0x1b6fac,null))[_0x6f29('0x28')](handleError(_0x1b6fac,null));};exports[_0x6f29('0x57')]=function(_0x311f33,_0x400b52,_0x241250){var _0x3ecda0={};var _0x5dc744={};var _0x144953;var _0x2e2c35;return db['FreshsalesAccount'][_0x6f29('0x58')]({'where':{'id':_0x311f33[_0x6f29('0x56')]['id']}})[_0x6f29('0x1d')](handleEntityNotFound(_0x400b52,null))['then'](function(_0xcbea09){if(_0xcbea09){_0x144953=_0xcbea09;_0x5dc744['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x5dc744['query']=_['keys'](_0x311f33['query']);_0x5dc744[_0x6f29('0x48')]=_[_0x6f29('0x3d')](_0x5dc744['model'],_0x5dc744[_0x6f29('0x3b')]);_0x3ecda0['attributes']=_[_0x6f29('0x3d')](_0x5dc744['model'],qs[_0x6f29('0x40')](_0x311f33[_0x6f29('0x3b')]['fields']));_0x3ecda0[_0x6f29('0x3f')]=_0x3ecda0[_0x6f29('0x3f')]['length']?_0x3ecda0['attributes']:_0x5dc744['model'];_0x3ecda0['order']=qs[_0x6f29('0x45')](_0x311f33[_0x6f29('0x3b')]['sort']);_0x3ecda0[_0x6f29('0x46')]=qs[_0x6f29('0x48')](_[_0x6f29('0x47')](_0x311f33['query'],_0x5dc744[_0x6f29('0x48')]));if(_0x311f33[_0x6f29('0x3b')][_0x6f29('0x49')]){_0x3ecda0['where']=_['merge'](_0x3ecda0[_0x6f29('0x46')],{'$or':_[_0x6f29('0x3a')](_0x3ecda0[_0x6f29('0x3f')],function(_0x559294){var _0x2d2096={};_0x2d2096[_0x559294]={'$like':'%'+_0x311f33[_0x6f29('0x3b')][_0x6f29('0x49')]+'%'};return _0x2d2096;})});}_0x3ecda0=_['merge']({},_0x3ecda0,_0x311f33['options']);return _0x144953[_0x6f29('0x57')](_0x3ecda0);}})[_0x6f29('0x1d')](function(_0x19dfb3){if(_0x19dfb3){_0x2e2c35=_0x19dfb3['length'];if(!_0x311f33[_0x6f29('0x3b')]['hasOwnProperty'](_0x6f29('0x42'))){_0x3ecda0[_0x6f29('0x43')]=qs['limit'](_0x311f33['query']['limit']);_0x3ecda0[_0x6f29('0x2d')]=qs['offset'](_0x311f33['query'][_0x6f29('0x2d')]);}return _0x144953[_0x6f29('0x57')](_0x3ecda0);}})[_0x6f29('0x1d')](function(_0x2e8b9b){if(_0x2e8b9b){return _0x2e8b9b?{'count':_0x2e2c35,'rows':_0x2e8b9b}:null;}})[_0x6f29('0x1d')](respondWithResult(_0x400b52,null))[_0x6f29('0x28')](handleError(_0x400b52,null));};exports[_0x6f29('0x59')]=function(_0x4b2dc2,_0x249174,_0x171caf){if(_0x4b2dc2[_0x6f29('0x55')]['id']){delete _0x4b2dc2['body']['id'];}return db[_0x6f29('0x4e')]['findOne']({'where':{'id':_0x4b2dc2[_0x6f29('0x56')]['id']}})['then'](handleEntityNotFound(_0x249174,null))[_0x6f29('0x1d')](function(_0x452cbe){if(_0x452cbe){_0x4b2dc2[_0x6f29('0x55')][_0x6f29('0x5a')]=_0x452cbe['id'];_0x4b2dc2[_0x6f29('0x55')][_0x6f29('0x5b')]=integrations[_0x6f29('0x5c')](_0x4b2dc2['body']['channel'],_0x4b2dc2[_0x6f29('0x55')]['type']);_0x4b2dc2[_0x6f29('0x55')][_0x6f29('0x5d')]=integrations[_0x6f29('0x5e')](_0x4b2dc2[_0x6f29('0x55')][_0x6f29('0x5f')],_0x4b2dc2[_0x6f29('0x55')][_0x6f29('0x4b')]);return db['FreshsalesConfiguration']['create'](_0x4b2dc2['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x6f29('0x5b')},{'model':db[_0x6f29('0x60')],'as':_0x6f29('0x5d')}]});}return null;})[_0x6f29('0x1d')](respondWithResult(_0x249174,null))[_0x6f29('0x28')](handleError(_0x249174,null));};exports[_0x6f29('0x61')]=function(_0x444e06,_0x522d83,_0x2d83dc){var _0x345d72='';var _0x2f77eb='';return db[_0x6f29('0x4e')][_0x6f29('0x58')]({'where':{'id':_0x444e06['params']['id']},'attributes':['id',_0x6f29('0x62'),'remoteUri','apiKey']})[_0x6f29('0x1d')](handleEntityNotFound(_0x522d83,null))['then'](function(_0xd9dbd9){if(_0xd9dbd9){_0x2f77eb=_0xd9dbd9[_0x6f29('0x62')];_0x345d72=_0xd9dbd9['remoteUri'];var _0x1da14c=_0xd9dbd9[_0x6f29('0x63')][_0x6f29('0x64')](-0x1);if(_0x1da14c==='/'){_0x345d72=_0x345d72['substring'](0x0,_0x345d72[_0x6f29('0x65')](_0x1da14c));}return rp({'method':_0x6f29('0x66'),'uri':util[_0x6f29('0x67')](_0x6f29('0x68'),_0x345d72,_0x6f29('0x69')),'headers':{'Authorization':_0x6f29('0x6a')+_0xd9dbd9[_0x6f29('0x6b')]},'json':!![]});}})['then'](function(_0x71303f){if(_0x71303f){var _0x21a2ee=_0x71303f['users'];var _0x3210cb=![];var _0x294ccc=null;for(_0x294ccc=0x0;_0x294ccc<_0x21a2ee[_0x6f29('0x41')];_0x294ccc++){if(_0x21a2ee[_0x294ccc][_0x6f29('0x6c')]===_0x2f77eb){_0x3210cb=!![];}}if(_0x3210cb){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6f29('0x6d')});}}})['then'](respondWithResult(_0x522d83,null))[_0x6f29('0x28')](function(_0x52a697){var _0x204d6d=_0x444e06['query'][_0x6f29('0x6e')]?0x1f4:_0x52a697[_0x6f29('0x6f')]||0x1f4;logger[_0x6f29('0x22')](_0x6f29('0x70'),_0x6f29('0x61'),_0x204d6d,JSON[_0x6f29('0x21')](_0x52a697));delete _0x52a697[_0x6f29('0x35')];if(_0x204d6d===0x191){_0x204d6d=0x190;}_0x522d83['status'](_0x204d6d)[_0x6f29('0x71')](_0x444e06[_0x6f29('0x3b')][_0x6f29('0x6e')]?{'message':_0x6f29('0x72'),'statusCode':_0x52a697[_0x6f29('0x6f')]}:_0x52a697);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 9458543..1cfeb23 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 _0x0faf=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ccc69,_0x347121){var _0x5391e4=function(_0x4d6534){while(--_0x4d6534){_0x5ccc69['push'](_0x5ccc69['shift']());}};_0x5391e4(++_0x347121);}(_0x0faf,0x132));var _0xf0fa=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x0faf[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var fs=require('fs');var path=require(_0xf0fa('0x6'));var rimraf=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var attributes=require(_0xf0fa('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf0fa('0xa')]=function(_0x44ffa0,_0x25b5c4){return _0x44ffa0[_0xf0fa('0xb')](_0xf0fa('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a8=['FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1f2e26,_0x3d985b){var _0x37a06f=function(_0x5968b1){while(--_0x5968b1){_0x1f2e26['push'](_0x1f2e26['shift']());}};_0x37a06f(++_0x3d985b);}(_0x98a8,0x12c));var _0x898a=function(_0x44a694,_0x2e73f6){_0x44a694=_0x44a694-0x0;var _0x2d18f8=_0x98a8[_0x44a694];return _0x2d18f8;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var moment=require(_0x898a('0x4'));var BPromise=require(_0x898a('0x5'));var rp=require(_0x898a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var attributes=require(_0x898a('0x9'));var integrations=require(_0x898a('0xa'));module[_0x898a('0xb')]=function(_0x5d7e59,_0x3aadc2){return _0x5d7e59['define'](_0x898a('0xc'),attributes,{'tableName':'int_freshsales_accounts','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 0715bd8..ecb5c97 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 _0x3014=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshsalesAccount','raw','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x4a75f9,_0x4fd6ff){var _0x48995b=function(_0x4b864b){while(--_0x4b864b){_0x4a75f9['push'](_0x4a75f9['shift']());}};_0x48995b(++_0x4fd6ff);}(_0x3014,0x1d7));var _0x4301=function(_0x8fd434,_0x5e6eae){_0x8fd434=_0x8fd434-0x0;var _0x18ad45=_0x3014[_0x8fd434];return _0x18ad45;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}exports[_0x4301('0x16')]=function(_0x13b229){var _0x5cfa58=this;return new Promise(function(_0xa1cbea,_0x351815){return db[_0x4301('0x17')][_0x4301('0x18')]({'raw':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')][_0x4301('0x1a')]||null:null,'attributes':_0x13b229['options']?_0x13b229[_0x4301('0x19')]['attributes']||null:null,'limit':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')][_0x4301('0x1b')]||null:null,'include':_0x13b229[_0x4301('0x19')]?_0x13b229['options'][_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x13b229['options'][_0x4301('0x1c')],function(_0x5d47d1){return{'model':db[_0x5d47d1[_0x4301('0x1e')]],'as':_0x5d47d1['as'],'attributes':_0x5d47d1[_0x4301('0x1f')],'include':_0x5d47d1[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x5d47d1[_0x4301('0x1c')],function(_0x11fe82){return{'model':db[_0x11fe82[_0x4301('0x1e')]],'as':_0x11fe82['as'],'attributes':_0x11fe82[_0x4301('0x1f')],'include':_0x11fe82[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x11fe82[_0x4301('0x1c')],function(_0x4a60d7){return{'model':db[_0x4a60d7[_0x4301('0x1e')]],'as':_0x4a60d7['as'],'attributes':_0x4a60d7[_0x4301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4301('0xb')](function(_0xe752f0){logger['info'](_0x4301('0x16'),_0x13b229);logger[_0x4301('0xe')](_0x4301('0x16'),_0x13b229,JSON['stringify'](_0xe752f0));_0xa1cbea(_0xe752f0);})[_0x4301('0x15')](function(_0x10a967){logger['error'](_0x4301('0x16'),_0x10a967['message'],_0x13b229);_0x351815(_0x5cfa58[_0x4301('0x11')](0x1f4,_0x10a967[_0x4301('0x13')]));});});};exports[_0x4301('0x20')]=function(_0xebb79b){var _0x4a6a55=this;return new Promise(function(_0x2b4abd,_0x4ee156){return db[_0x4301('0x17')]['find']({'raw':_0xebb79b['options']?_0xebb79b[_0x4301('0x19')][_0x4301('0x21')]===undefined?!![]:![]:!![],'where':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')][_0x4301('0x1a')]||null:null,'attributes':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')]['attributes']||null:null,'include':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')][_0x4301('0x1c')]?_['map'](_0xebb79b['options']['include'],function(_0x861809){return{'model':db[_0x861809[_0x4301('0x1e')]],'as':_0x861809['as'],'attributes':_0x861809[_0x4301('0x1f')],'include':_0x861809['include']?_['map'](_0x861809['include'],function(_0x3d35b6){return{'model':db[_0x3d35b6[_0x4301('0x1e')]],'as':_0x3d35b6['as'],'attributes':_0x3d35b6[_0x4301('0x1f')],'include':_0x3d35b6[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x3d35b6[_0x4301('0x1c')],function(_0x1c3aef){return{'model':db[_0x1c3aef[_0x4301('0x1e')]],'as':_0x1c3aef['as'],'attributes':_0x1c3aef[_0x4301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4301('0xb')](function(_0x380e73){logger['info'](_0x4301('0x20'),_0xebb79b);logger[_0x4301('0xe')]('ShowFreshsalesAccount',_0xebb79b,JSON[_0x4301('0x10')](_0x380e73));_0x2b4abd(_0x380e73);})[_0x4301('0x15')](function(_0x5890e3){logger[_0x4301('0x11')](_0x4301('0x20'),_0x5890e3[_0x4301('0x13')],_0xebb79b);_0x4ee156(_0x4a6a55[_0x4301('0x11')](0x1f4,_0x5890e3[_0x4301('0x13')]));});});}; \ No newline at end of file +var _0x1c52=['FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','options','where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','raw','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9abfb7,_0xf308ae){var _0x35e484=function(_0x247c73){while(--_0x247c73){_0x9abfb7['push'](_0x9abfb7['shift']());}};_0x35e484(++_0xf308ae);}(_0x1c52,0x7c));var _0x21c5=function(_0x18bde,_0x2c4d46){_0x18bde=_0x18bde-0x0;var _0x5f42d7=_0x1c52[_0x18bde];return _0x5f42d7;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});}exports[_0x21c5('0x14')]=function(_0x56696e){var _0x4daf4d=this;return new Promise(function(_0x1bc8a4,_0x4e630f){return db[_0x21c5('0x15')]['findAll']({'raw':_0x56696e[_0x21c5('0x16')]?_0x56696e['options']['raw']===undefined?!![]:![]:!![],'where':_0x56696e[_0x21c5('0x16')]?_0x56696e[_0x21c5('0x16')][_0x21c5('0x17')]||null:null,'attributes':_0x56696e[_0x21c5('0x16')]?_0x56696e[_0x21c5('0x16')][_0x21c5('0x18')]||null:null,'limit':_0x56696e[_0x21c5('0x16')]?_0x56696e[_0x21c5('0x16')][_0x21c5('0x19')]||null:null,'include':_0x56696e['options']?_0x56696e[_0x21c5('0x16')][_0x21c5('0x1a')]?_[_0x21c5('0x1b')](_0x56696e[_0x21c5('0x16')][_0x21c5('0x1a')],function(_0x4bf186){return{'model':db[_0x4bf186[_0x21c5('0x1c')]],'as':_0x4bf186['as'],'attributes':_0x4bf186[_0x21c5('0x18')],'include':_0x4bf186[_0x21c5('0x1a')]?_[_0x21c5('0x1b')](_0x4bf186[_0x21c5('0x1a')],function(_0x4d3215){return{'model':db[_0x4d3215['model']],'as':_0x4d3215['as'],'attributes':_0x4d3215[_0x21c5('0x18')],'include':_0x4d3215[_0x21c5('0x1a')]?_[_0x21c5('0x1b')](_0x4d3215[_0x21c5('0x1a')],function(_0x2ae029){return{'model':db[_0x2ae029[_0x21c5('0x1c')]],'as':_0x2ae029['as'],'attributes':_0x2ae029['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5918df){logger[_0x21c5('0x12')](_0x21c5('0x14'),_0x56696e);logger[_0x21c5('0xe')](_0x21c5('0x14'),_0x56696e,JSON['stringify'](_0x5918df));_0x1bc8a4(_0x5918df);})[_0x21c5('0x1d')](function(_0x428b60){logger[_0x21c5('0xf')](_0x21c5('0x14'),_0x428b60[_0x21c5('0x11')],_0x56696e);_0x4e630f(_0x4daf4d['error'](0x1f4,_0x428b60['message']));});});};exports[_0x21c5('0x1e')]=function(_0x29a15b){var _0x3353b3=this;return new Promise(function(_0x177ca1,_0x39662b){return db[_0x21c5('0x15')][_0x21c5('0x1f')]({'raw':_0x29a15b[_0x21c5('0x16')]?_0x29a15b[_0x21c5('0x16')][_0x21c5('0x20')]===undefined?!![]:![]:!![],'where':_0x29a15b['options']?_0x29a15b['options'][_0x21c5('0x17')]||null:null,'attributes':_0x29a15b['options']?_0x29a15b[_0x21c5('0x16')][_0x21c5('0x18')]||null:null,'include':_0x29a15b[_0x21c5('0x16')]?_0x29a15b[_0x21c5('0x16')]['include']?_[_0x21c5('0x1b')](_0x29a15b['options'][_0x21c5('0x1a')],function(_0x5a3308){return{'model':db[_0x5a3308[_0x21c5('0x1c')]],'as':_0x5a3308['as'],'attributes':_0x5a3308[_0x21c5('0x18')],'include':_0x5a3308[_0x21c5('0x1a')]?_['map'](_0x5a3308[_0x21c5('0x1a')],function(_0x4d52ca){return{'model':db[_0x4d52ca[_0x21c5('0x1c')]],'as':_0x4d52ca['as'],'attributes':_0x4d52ca[_0x21c5('0x18')],'include':_0x4d52ca[_0x21c5('0x1a')]?_['map'](_0x4d52ca[_0x21c5('0x1a')],function(_0x535498){return{'model':db[_0x535498['model']],'as':_0x535498['as'],'attributes':_0x535498[_0x21c5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x21c5('0xb')](function(_0x1a25b7){logger[_0x21c5('0x12')]('ShowFreshsalesAccount',_0x29a15b);logger[_0x21c5('0xe')](_0x21c5('0x1e'),_0x29a15b,JSON[_0x21c5('0x21')](_0x1a25b7));_0x177ca1(_0x1a25b7);})[_0x21c5('0x1d')](function(_0x20ec3a){logger[_0x21c5('0xf')](_0x21c5('0x1e'),_0x20ec3a[_0x21c5('0x11')],_0x29a15b);_0x39662b(_0x3353b3['error'](0x1f4,_0x20ec3a[_0x21c5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5b4c5f4..f66041b 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 _0xb87d=['../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x25ca55,_0x200623){var _0x782660=function(_0x3211ac){while(--_0x3211ac){_0x25ca55['push'](_0x25ca55['shift']());}};_0x782660(++_0x200623);}(_0xb87d,0x96));var _0xdb87=function(_0x55aea4,_0x3370b4){_0x55aea4=_0x55aea4-0x0;var _0x55083a=_0xb87d[_0x55aea4];return _0x55083a;};'use strict';var multer=require(_0xdb87('0x0'));var util=require('util');var path=require(_0xdb87('0x1'));var timeout=require(_0xdb87('0x2'));var express=require(_0xdb87('0x3'));var router=express['Router']();var auth=require(_0xdb87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdb87('0x5'));var controller=require(_0xdb87('0x6'));router[_0xdb87('0x7')]('/',auth[_0xdb87('0x8')](),controller[_0xdb87('0x9')]);router[_0xdb87('0x7')](_0xdb87('0xa'),auth[_0xdb87('0x8')](),controller['show']);router[_0xdb87('0x7')]('/:id/subjects',auth[_0xdb87('0x8')](),controller[_0xdb87('0xb')]);router[_0xdb87('0x7')](_0xdb87('0xc'),auth[_0xdb87('0x8')](),controller[_0xdb87('0xd')]);router[_0xdb87('0x7')](_0xdb87('0xe'),auth[_0xdb87('0x8')](),controller[_0xdb87('0xf')]);router[_0xdb87('0x10')]('/',auth[_0xdb87('0x8')](),controller[_0xdb87('0x11')]);router[_0xdb87('0x12')](_0xdb87('0xa'),auth[_0xdb87('0x8')](),controller[_0xdb87('0x13')]);router[_0xdb87('0x14')](_0xdb87('0xa'),auth[_0xdb87('0x8')](),controller['destroy']);module[_0xdb87('0x15')]=router; \ No newline at end of file +var _0x7cfa=['../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0x7cfa,0x1f1));var _0xa7cf=function(_0x6655a6,_0x25f26f){_0x6655a6=_0x6655a6-0x0;var _0x5ee5a4=_0x7cfa[_0x6655a6];return _0x5ee5a4;};'use strict';var multer=require(_0xa7cf('0x0'));var util=require(_0xa7cf('0x1'));var path=require(_0xa7cf('0x2'));var timeout=require(_0xa7cf('0x3'));var express=require('express');var router=express[_0xa7cf('0x4')]();var auth=require(_0xa7cf('0x5'));var interaction=require(_0xa7cf('0x6'));var config=require(_0xa7cf('0x7'));var controller=require(_0xa7cf('0x8'));router[_0xa7cf('0x9')]('/',auth[_0xa7cf('0xa')](),controller[_0xa7cf('0xb')]);router[_0xa7cf('0x9')](_0xa7cf('0xc'),auth['isAuthenticated'](),controller[_0xa7cf('0xd')]);router[_0xa7cf('0x9')]('/:id/subjects',auth[_0xa7cf('0xa')](),controller['getSubjects']);router['get'](_0xa7cf('0xe'),auth[_0xa7cf('0xa')](),controller[_0xa7cf('0xf')]);router['get']('/:id/fields',auth[_0xa7cf('0xa')](),controller[_0xa7cf('0x10')]);router[_0xa7cf('0x11')]('/',auth[_0xa7cf('0xa')](),controller[_0xa7cf('0x12')]);router[_0xa7cf('0x13')](_0xa7cf('0xc'),auth[_0xa7cf('0xa')](),controller[_0xa7cf('0x14')]);router[_0xa7cf('0x15')](_0xa7cf('0xc'),auth[_0xa7cf('0xa')](),controller[_0xa7cf('0x16')]);module[_0xa7cf('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 ba65026..8f41102 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 _0xdbba=['STRING','exports'];(function(_0x16803b,_0x8b0c06){var _0x2538ac=function(_0x1c82e4){while(--_0x1c82e4){_0x16803b['push'](_0x16803b['shift']());}};_0x2538ac(++_0x8b0c06);}(_0xdbba,0xf5));var _0xadbb=function(_0x376de6,_0x3d4ea7){_0x376de6=_0x376de6-0x0;var _0x6b4fd6=_0xdbba[_0x376de6];return _0x6b4fd6;};'use strict';var Sequelize=require('sequelize');module[_0xadbb('0x0')]={'name':{'type':Sequelize[_0xadbb('0x1')]},'description':{'type':Sequelize[_0xadbb('0x1')]}}; \ No newline at end of file +var _0x85e1=['exports','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x85e1,0x167));var _0x185e=function(_0xfd8e7c,_0x5a4de9){_0xfd8e7c=_0xfd8e7c-0x0;var _0x1c1af1=_0x85e1[_0xfd8e7c];return _0x1c1af1;};'use strict';var Sequelize=require(_0x185e('0x0'));module[_0x185e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e10fb41..1883b0d 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 _0x357c=['../../config/environment','../../mysqldb','jayson/promise','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','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x46b092,_0x5410af){var _0x42c3f8=function(_0x1000c4){while(--_0x1000c4){_0x46b092['push'](_0x46b092['shift']());}};_0x42c3f8(++_0x5410af);}(_0x357c,0x1b1));var _0xc357=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x357c[_0x2706da];return _0x3ba87e;};'use strict';var pdf=require(_0xc357('0x0'));var emlformat=require(_0xc357('0x1'));var rimraf=require(_0xc357('0x2'));var zipdir=require(_0xc357('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc357('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc357('0x5'));var util=require(_0xc357('0x6'));var path=require(_0xc357('0x7'));var sox=require('sox');var csv=require(_0xc357('0x8'));var ejs=require(_0xc357('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc357('0xa'));var crypto=require(_0xc357('0xb'));var jsforce=require(_0xc357('0xc'));var deskjs=require(_0xc357('0xd'));var toCsv=require(_0xc357('0x8'));var querystring=require(_0xc357('0xe'));var Papa=require(_0xc357('0xf'));var Redis=require(_0xc357('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc357('0x11'));var as=require(_0xc357('0x12'));var hardwareService=require(_0xc357('0x13'));var logger=require('../../config/logger')(_0xc357('0x14'));var utils=require(_0xc357('0x15'));var config=require(_0xc357('0x16'));var db=require(_0xc357('0x17'))['db'];var jayson=require(_0xc357('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x9cd170,_0x26ab21,_0x242102){if(_0x242102){var _0x2d5477=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d5477[_0xc357('0x19')](_0x26ab21)){return _0x9cd170;}else{throw new db['Sequelize'][(_0xc357('0x1a'))](_0xc357('0x1b'));}}else{return _0x9cd170;}}function respondWithRpcPromise(_0x242b1f,_0x1019ca,_0x480d21,_0x47adbc){return new BPromise(function(_0x5177fa,_0x40bfb4){var _0x293251=_0x47adbc||client;return _0x293251['request'](_0x242b1f,_0x480d21)[_0xc357('0x1c')](function(_0x1026a9){logger[_0xc357('0x1d')](_0xc357('0x1e'),_0x1019ca,_0xc357('0x1f'));logger[_0xc357('0x20')](_0xc357('0x21'),_0x1019ca,_0xc357('0x1f'),JSON[_0xc357('0x22')](_0x1026a9));if(_0x1026a9[_0xc357('0x23')]){if(_0x1026a9[_0xc357('0x23')]['code']===0x1f4){logger[_0xc357('0x23')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1019ca,_0x1026a9[_0xc357('0x23')][_0xc357('0x24')]);return _0x40bfb4(_0x1026a9[_0xc357('0x23')]['message']);}logger[_0xc357('0x23')](_0xc357('0x1e'),_0x1019ca,_0x1026a9['error'][_0xc357('0x24')]);return _0x5177fa(_0x1026a9['error'][_0xc357('0x24')]);}else{logger[_0xc357('0x1d')](_0xc357('0x1e'),_0x1019ca,_0xc357('0x1f'));_0x5177fa(_0x1026a9['result'][_0xc357('0x24')]);}})[_0xc357('0x25')](function(_0x52ee58){logger[_0xc357('0x23')](_0xc357('0x1e'),_0x1019ca,_0x52ee58);_0x40bfb4(_0x52ee58);});});}function respondWithStatusCode(_0x5edfa8,_0x2b7f64){_0x2b7f64=_0x2b7f64||0xcc;return function(_0x1b8a82){if(_0x1b8a82){return _0x5edfa8['sendStatus'](_0x2b7f64);}return _0x5edfa8[_0xc357('0x26')](_0x2b7f64)[_0xc357('0x27')]();};}function respondWithResult(_0x31e26d,_0x544da5){_0x544da5=_0x544da5||0xc8;return function(_0x3b726d){if(_0x3b726d){return _0x31e26d[_0xc357('0x26')](_0x544da5)[_0xc357('0x28')](_0x3b726d);}};}function respondWithFilteredResult(_0x1ebb38,_0x3936ee){return function(_0x41da32){if(_0x41da32){var _0x13091d=_0x41da32['count'],_0x413fd4=_0x3936ee[_0xc357('0x29')],_0x4f40c6=_0x3936ee[_0xc357('0x29')]+_0x3936ee['limit'],_0x52c1f6;if(_0x4f40c6>=_0x13091d){_0x4f40c6=_0x13091d;_0x52c1f6=0xc8;}else{_0x52c1f6=0xce;}_0x1ebb38[_0xc357('0x26')](_0x52c1f6);return _0x1ebb38['set'](_0xc357('0x2a'),_0x413fd4+'-'+_0x4f40c6+'/'+_0x13091d)['json'](_0x41da32);}return null;};}function patchUpdates(_0x48f75d){return function(_0x179f66){try{jsonpatch['apply'](_0x179f66,_0x48f75d,!![]);}catch(_0x5966d8){return BPromise[_0xc357('0x2b')](_0x5966d8);}return _0x179f66[_0xc357('0x2c')]();};}function saveUpdates(_0x3307bf,_0x1416eb){return function(_0x4fdb12){if(_0x4fdb12){return _0x4fdb12[_0xc357('0x2d')](_0x3307bf)[_0xc357('0x1c')](function(_0xd5d87b){return _0xd5d87b;});}return null;};}function removeEntity(_0x2240d7,_0x9f85c0){return function(_0x3a03c3){if(_0x3a03c3){return _0x3a03c3[_0xc357('0x2e')]()[_0xc357('0x1c')](function(){_0x2240d7[_0xc357('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eebda,_0x1b9ac7){return function(_0x258de9){if(!_0x258de9){_0x4eebda[_0xc357('0x2f')](0x194);}return _0x258de9;};}function handleError(_0x4360cc,_0x15084e){_0x15084e=_0x15084e||0x1f4;return function(_0x42d997){logger[_0xc357('0x23')](_0x42d997[_0xc357('0x30')]);if(_0x42d997[_0xc357('0x31')]){delete _0x42d997[_0xc357('0x31')];}_0x4360cc[_0xc357('0x26')](_0x15084e)[_0xc357('0x32')](_0x42d997);};}exports[_0xc357('0x33')]=function(_0x2d7cfc,_0x3b7f9a){var _0x40b7f1={},_0x4832e1={},_0x582c5b={'count':0x0,'rows':[]};var _0x51017c=_[_0xc357('0x34')](db[_0xc357('0x35')][_0xc357('0x36')],function(_0x20e9b0){return{'name':_0x20e9b0['fieldName'],'type':_0x20e9b0['type'][_0xc357('0x37')]};});_0x4832e1[_0xc357('0x38')]=_[_0xc357('0x34')](_0x51017c,'name');_0x4832e1[_0xc357('0x39')]=_['keys'](_0x2d7cfc['query']);_0x4832e1['filters']=_[_0xc357('0x3a')](_0x4832e1[_0xc357('0x38')],_0x4832e1[_0xc357('0x39')]);_0x40b7f1[_0xc357('0x3b')]=_[_0xc357('0x3a')](_0x4832e1['model'],qs[_0xc357('0x3c')](_0x2d7cfc[_0xc357('0x39')][_0xc357('0x3c')]));_0x40b7f1[_0xc357('0x3b')]=_0x40b7f1['attributes'][_0xc357('0x3d')]?_0x40b7f1[_0xc357('0x3b')]:_0x4832e1[_0xc357('0x38')];if(!_0x2d7cfc[_0xc357('0x39')]['hasOwnProperty'](_0xc357('0x3e'))){_0x40b7f1[_0xc357('0x3f')]=qs['limit'](_0x2d7cfc[_0xc357('0x39')]['limit']);_0x40b7f1['offset']=qs[_0xc357('0x29')](_0x2d7cfc['query']['offset']);}_0x40b7f1[_0xc357('0x40')]=qs['sort'](_0x2d7cfc['query'][_0xc357('0x41')]);_0x40b7f1[_0xc357('0x42')]=qs[_0xc357('0x43')](_[_0xc357('0x44')](_0x2d7cfc[_0xc357('0x39')],_0x4832e1[_0xc357('0x43')]),_0x51017c);if(_0x2d7cfc[_0xc357('0x39')][_0xc357('0x45')]){_0x40b7f1['where']=_[_0xc357('0x46')](_0x40b7f1[_0xc357('0x42')],{'$or':_[_0xc357('0x34')](_0x51017c,function(_0x1c749e){if(_0x1c749e[_0xc357('0x47')]!==_0xc357('0x48')){var _0x33003d={};_0x33003d[_0x1c749e[_0xc357('0x31')]]={'$like':'%'+_0x2d7cfc['query'][_0xc357('0x45')]+'%'};return _0x33003d;}})});}_0x40b7f1=_[_0xc357('0x46')]({},_0x40b7f1,_0x2d7cfc[_0xc357('0x49')]);var _0x4fd596={'where':_0x40b7f1[_0xc357('0x42')]};return db[_0xc357('0x35')][_0xc357('0x4a')](_0x4fd596)['then'](function(_0x47c5fa){_0x582c5b['count']=_0x47c5fa;if(_0x2d7cfc[_0xc357('0x39')][_0xc357('0x4b')]){_0x40b7f1[_0xc357('0x4c')]=[{'all':!![]}];}return db[_0xc357('0x35')][_0xc357('0x4d')](_0x40b7f1);})[_0xc357('0x1c')](function(_0x5e0d84){_0x582c5b[_0xc357('0x4e')]=_0x5e0d84;return _0x582c5b;})[_0xc357('0x1c')](respondWithFilteredResult(_0x3b7f9a,_0x40b7f1))['catch'](handleError(_0x3b7f9a,null));};exports[_0xc357('0x4f')]=function(_0x23bc5a,_0x9632e){var _0x1e6163={'raw':![],'where':{'id':_0x23bc5a[_0xc357('0x50')]['id']}},_0x4dff7f={};_0x4dff7f[_0xc357('0x38')]=_[_0xc357('0x51')](db[_0xc357('0x35')]['rawAttributes']);_0x4dff7f[_0xc357('0x39')]=_[_0xc357('0x51')](_0x23bc5a[_0xc357('0x39')]);_0x4dff7f[_0xc357('0x43')]=_['intersection'](_0x4dff7f['model'],_0x4dff7f['query']);_0x1e6163['attributes']=_['intersection'](_0x4dff7f[_0xc357('0x38')],qs['fields'](_0x23bc5a['query'][_0xc357('0x3c')]));_0x1e6163[_0xc357('0x3b')]=_0x1e6163[_0xc357('0x3b')][_0xc357('0x3d')]?_0x1e6163['attributes']:_0x4dff7f[_0xc357('0x38')];if(_0x23bc5a[_0xc357('0x39')]['includeAll']){_0x1e6163[_0xc357('0x4c')]=[{'all':!![]}];}_0x1e6163=_[_0xc357('0x46')]({},_0x1e6163,_0x23bc5a[_0xc357('0x49')]);return db['FreshsalesConfiguration'][_0xc357('0x52')](_0x1e6163)[_0xc357('0x1c')](handleEntityNotFound(_0x9632e,null))[_0xc357('0x1c')](respondWithResult(_0x9632e,null))[_0xc357('0x25')](handleError(_0x9632e,null));};exports[_0xc357('0x53')]=function(_0x5a9b48,_0x185a18){return db[_0xc357('0x35')][_0xc357('0x53')](_0x5a9b48[_0xc357('0x54')],{})[_0xc357('0x1c')](respondWithResult(_0x185a18,0xc9))['catch'](handleError(_0x185a18,null));};exports[_0xc357('0x2d')]=function(_0x4320ec,_0x3ce096){if(_0x4320ec[_0xc357('0x54')]['id']){delete _0x4320ec[_0xc357('0x54')]['id'];}return db[_0xc357('0x35')][_0xc357('0x52')]({'where':{'id':_0x4320ec['params']['id']}})[_0xc357('0x1c')](handleEntityNotFound(_0x3ce096,null))['then'](saveUpdates(_0x4320ec[_0xc357('0x54')],null))[_0xc357('0x1c')](respondWithResult(_0x3ce096,null))[_0xc357('0x25')](handleError(_0x3ce096,null));};exports[_0xc357('0x2e')]=function(_0x50ca14,_0x266136){return db[_0xc357('0x35')]['find']({'where':{'id':_0x50ca14[_0xc357('0x50')]['id']}})[_0xc357('0x1c')](handleEntityNotFound(_0x266136,null))[_0xc357('0x1c')](removeEntity(_0x266136,null))[_0xc357('0x25')](handleError(_0x266136,null));};exports[_0xc357('0x55')]=function(_0x156f77,_0x37653a,_0x94c19a){var _0x21b65a={};var _0x1c690f={};var _0x29b7f9;var _0x58d1fc;return db[_0xc357('0x35')][_0xc357('0x56')]({'where':{'id':_0x156f77[_0xc357('0x50')]['id']}})['then'](handleEntityNotFound(_0x37653a,null))[_0xc357('0x1c')](function(_0x3816d0){if(_0x3816d0){_0x29b7f9=_0x3816d0;_0x1c690f['model']=_[_0xc357('0x51')](db[_0xc357('0x57')][_0xc357('0x36')]);_0x1c690f[_0xc357('0x39')]=_[_0xc357('0x51')](_0x156f77[_0xc357('0x39')]);_0x1c690f[_0xc357('0x43')]=_['intersection'](_0x1c690f[_0xc357('0x38')],_0x1c690f['query']);_0x21b65a[_0xc357('0x3b')]=_['intersection'](_0x1c690f[_0xc357('0x38')],qs[_0xc357('0x3c')](_0x156f77[_0xc357('0x39')][_0xc357('0x3c')]));_0x21b65a[_0xc357('0x3b')]=_0x21b65a[_0xc357('0x3b')][_0xc357('0x3d')]?_0x21b65a['attributes']:_0x1c690f[_0xc357('0x38')];_0x21b65a['order']=qs[_0xc357('0x41')](_0x156f77[_0xc357('0x39')]['sort']);_0x21b65a[_0xc357('0x42')]=qs[_0xc357('0x43')](_[_0xc357('0x44')](_0x156f77['query'],_0x1c690f[_0xc357('0x43')]));if(_0x156f77[_0xc357('0x39')][_0xc357('0x45')]){_0x21b65a[_0xc357('0x42')]=_['merge'](_0x21b65a['where'],{'$or':_[_0xc357('0x34')](_0x21b65a['attributes'],function(_0x6298fa){var _0x5c122d={};_0x5c122d[_0x6298fa]={'$like':'%'+_0x156f77['query']['filter']+'%'};return _0x5c122d;})});}_0x21b65a=_[_0xc357('0x46')]({},_0x21b65a,_0x156f77[_0xc357('0x49')]);return _0x29b7f9[_0xc357('0x55')](_0x21b65a);}})['then'](function(_0x3f3910){if(_0x3f3910){_0x58d1fc=_0x3f3910[_0xc357('0x3d')];if(!_0x156f77[_0xc357('0x39')][_0xc357('0x58')](_0xc357('0x3e'))){_0x21b65a[_0xc357('0x3f')]=qs[_0xc357('0x3f')](_0x156f77[_0xc357('0x39')][_0xc357('0x3f')]);_0x21b65a['offset']=qs[_0xc357('0x29')](_0x156f77[_0xc357('0x39')][_0xc357('0x29')]);}return _0x29b7f9[_0xc357('0x55')](_0x21b65a);}})['then'](function(_0x2de3e3){if(_0x2de3e3){return _0x2de3e3?{'count':_0x58d1fc,'rows':_0x2de3e3}:null;}})[_0xc357('0x1c')](respondWithResult(_0x37653a,null))[_0xc357('0x25')](handleError(_0x37653a,null));};exports['getDescriptions']=function(_0x30ce8b,_0x15d5ff,_0x4fbadd){var _0x1bb6ac={};var _0x15dd50={};var _0x3fbcdd;var _0x1a641a;return db[_0xc357('0x35')][_0xc357('0x56')]({'where':{'id':_0x30ce8b[_0xc357('0x50')]['id']}})['then'](handleEntityNotFound(_0x15d5ff,null))[_0xc357('0x1c')](function(_0x5524e6){if(_0x5524e6){_0x3fbcdd=_0x5524e6;_0x15dd50[_0xc357('0x38')]=_[_0xc357('0x51')](db['FreshsalesField'][_0xc357('0x36')]);_0x15dd50['query']=_[_0xc357('0x51')](_0x30ce8b[_0xc357('0x39')]);_0x15dd50[_0xc357('0x43')]=_[_0xc357('0x3a')](_0x15dd50[_0xc357('0x38')],_0x15dd50['query']);_0x1bb6ac[_0xc357('0x3b')]=_[_0xc357('0x3a')](_0x15dd50[_0xc357('0x38')],qs[_0xc357('0x3c')](_0x30ce8b[_0xc357('0x39')]['fields']));_0x1bb6ac[_0xc357('0x3b')]=_0x1bb6ac[_0xc357('0x3b')]['length']?_0x1bb6ac[_0xc357('0x3b')]:_0x15dd50[_0xc357('0x38')];_0x1bb6ac[_0xc357('0x40')]=qs[_0xc357('0x41')](_0x30ce8b[_0xc357('0x39')][_0xc357('0x41')]);_0x1bb6ac['where']=qs[_0xc357('0x43')](_[_0xc357('0x44')](_0x30ce8b[_0xc357('0x39')],_0x15dd50['filters']));if(_0x30ce8b[_0xc357('0x39')][_0xc357('0x45')]){_0x1bb6ac[_0xc357('0x42')]=_[_0xc357('0x46')](_0x1bb6ac[_0xc357('0x42')],{'$or':_['map'](_0x1bb6ac[_0xc357('0x3b')],function(_0x330590){var _0x539111={};_0x539111[_0x330590]={'$like':'%'+_0x30ce8b[_0xc357('0x39')][_0xc357('0x45')]+'%'};return _0x539111;})});}_0x1bb6ac=_[_0xc357('0x46')]({},_0x1bb6ac,_0x30ce8b[_0xc357('0x49')]);return _0x3fbcdd[_0xc357('0x59')](_0x1bb6ac);}})[_0xc357('0x1c')](function(_0x169af3){if(_0x169af3){_0x1a641a=_0x169af3['length'];if(!_0x30ce8b[_0xc357('0x39')][_0xc357('0x58')]('nolimit')){_0x1bb6ac[_0xc357('0x3f')]=qs['limit'](_0x30ce8b[_0xc357('0x39')][_0xc357('0x3f')]);_0x1bb6ac[_0xc357('0x29')]=qs[_0xc357('0x29')](_0x30ce8b['query'][_0xc357('0x29')]);}return _0x3fbcdd['getDescriptions'](_0x1bb6ac);}})[_0xc357('0x1c')](function(_0x148569){if(_0x148569){return _0x148569?{'count':_0x1a641a,'rows':_0x148569}:null;}})[_0xc357('0x1c')](respondWithResult(_0x15d5ff,null))[_0xc357('0x25')](handleError(_0x15d5ff,null));};exports['getFields']=function(_0x4627db,_0x3f4dc2,_0x3c676b){var _0x4b7e5e={};var _0x584691={};var _0x22b1c6;var _0x28d0bf;return db[_0xc357('0x35')][_0xc357('0x56')]({'where':{'id':_0x4627db[_0xc357('0x50')]['id']}})[_0xc357('0x1c')](handleEntityNotFound(_0x3f4dc2,null))[_0xc357('0x1c')](function(_0x1a60bb){if(_0x1a60bb){_0x22b1c6=_0x1a60bb;_0x584691['model']=_[_0xc357('0x51')](db[_0xc357('0x57')][_0xc357('0x36')]);_0x584691['query']=_[_0xc357('0x51')](_0x4627db[_0xc357('0x39')]);_0x584691['filters']=_[_0xc357('0x3a')](_0x584691[_0xc357('0x38')],_0x584691[_0xc357('0x39')]);_0x4b7e5e[_0xc357('0x3b')]=_[_0xc357('0x3a')](_0x584691[_0xc357('0x38')],qs['fields'](_0x4627db[_0xc357('0x39')][_0xc357('0x3c')]));_0x4b7e5e[_0xc357('0x3b')]=_0x4b7e5e[_0xc357('0x3b')][_0xc357('0x3d')]?_0x4b7e5e['attributes']:_0x584691['model'];_0x4b7e5e['order']=qs[_0xc357('0x41')](_0x4627db[_0xc357('0x39')][_0xc357('0x41')]);_0x4b7e5e[_0xc357('0x42')]=qs['filters'](_[_0xc357('0x44')](_0x4627db[_0xc357('0x39')],_0x584691[_0xc357('0x43')]));if(_0x4627db['query'][_0xc357('0x45')]){_0x4b7e5e['where']=_[_0xc357('0x46')](_0x4b7e5e[_0xc357('0x42')],{'$or':_[_0xc357('0x34')](_0x4b7e5e[_0xc357('0x3b')],function(_0x121d6f){var _0xe87268={};_0xe87268[_0x121d6f]={'$like':'%'+_0x4627db[_0xc357('0x39')][_0xc357('0x45')]+'%'};return _0xe87268;})});}_0x4b7e5e=_['merge']({},_0x4b7e5e,_0x4627db[_0xc357('0x49')]);return _0x22b1c6[_0xc357('0x5a')](_0x4b7e5e);}})['then'](function(_0x4ec51a){if(_0x4ec51a){_0x28d0bf=_0x4ec51a['length'];if(!_0x4627db[_0xc357('0x39')][_0xc357('0x58')](_0xc357('0x3e'))){_0x4b7e5e[_0xc357('0x3f')]=qs[_0xc357('0x3f')](_0x4627db[_0xc357('0x39')][_0xc357('0x3f')]);_0x4b7e5e[_0xc357('0x29')]=qs[_0xc357('0x29')](_0x4627db[_0xc357('0x39')][_0xc357('0x29')]);}return _0x22b1c6['getFields'](_0x4b7e5e);}})['then'](function(_0x5a09b4){if(_0x5a09b4){return _0x5a09b4?{'count':_0x28d0bf,'rows':_0x5a09b4}:null;}})[_0xc357('0x1c')](respondWithResult(_0x3f4dc2,null))[_0xc357('0x25')](handleError(_0x3f4dc2,null));}; \ No newline at end of file +var _0x74b7=['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','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','find','create','body','update','destroy','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','http','test','Sequelize'];(function(_0x13a725,_0x22f71c){var _0xc282be=function(_0x386c3f){while(--_0x386c3f){_0x13a725['push'](_0x13a725['shift']());}};_0xc282be(++_0x22f71c);}(_0x74b7,0xfe));var _0x774b=function(_0xf6c3f4,_0x43db11){_0xf6c3f4=_0xf6c3f4-0x0;var _0x107519=_0x74b7[_0xf6c3f4];return _0x107519;};'use strict';var pdf=require(_0x774b('0x0'));var emlformat=require(_0x774b('0x1'));var rimraf=require(_0x774b('0x2'));var zipdir=require(_0x774b('0x3'));var jsonpatch=require(_0x774b('0x4'));var rp=require(_0x774b('0x5'));var moment=require(_0x774b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x774b('0x7'));var util=require(_0x774b('0x8'));var path=require(_0x774b('0x9'));var sox=require(_0x774b('0xa'));var csv=require('to-csv');var ejs=require(_0x774b('0xb'));var fs=require('fs');var _=require(_0x774b('0xc'));var squel=require(_0x774b('0xd'));var crypto=require(_0x774b('0xe'));var jsforce=require(_0x774b('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x774b('0x10'));var Redis=require('ioredis');var authService=require(_0x774b('0x11'));var qs=require(_0x774b('0x12'));var as=require(_0x774b('0x13'));var hardwareService=require(_0x774b('0x14'));var logger=require(_0x774b('0x15'))(_0x774b('0x16'));var utils=require('../../config/utils');var config=require(_0x774b('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x774b('0x18'));var client=jayson['client'][_0x774b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x55d02a,_0x4818ed,_0x238e15){if(_0x238e15){var _0x191993=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x191993[_0x774b('0x1a')](_0x4818ed)){return _0x55d02a;}else{throw new db[(_0x774b('0x1b'))][(_0x774b('0x1c'))](_0x774b('0x1d'));}}else{return _0x55d02a;}}function respondWithRpcPromise(_0x285806,_0x329f07,_0x172802,_0x551c13){return new BPromise(function(_0xa850fa,_0xfe793d){var _0x3c8db7=_0x551c13||client;return _0x3c8db7[_0x774b('0x1e')](_0x285806,_0x172802)[_0x774b('0x1f')](function(_0x1d3e50){logger[_0x774b('0x20')](_0x774b('0x21'),_0x329f07,_0x774b('0x22'));logger[_0x774b('0x23')](_0x774b('0x24'),_0x329f07,_0x774b('0x22'),JSON['stringify'](_0x1d3e50));if(_0x1d3e50['error']){if(_0x1d3e50[_0x774b('0x25')][_0x774b('0x26')]===0x1f4){logger[_0x774b('0x25')](_0x774b('0x21'),_0x329f07,_0x1d3e50[_0x774b('0x25')][_0x774b('0x27')]);return _0xfe793d(_0x1d3e50['error'][_0x774b('0x27')]);}logger['error'](_0x774b('0x21'),_0x329f07,_0x1d3e50[_0x774b('0x25')][_0x774b('0x27')]);return _0xa850fa(_0x1d3e50['error'][_0x774b('0x27')]);}else{logger['info'](_0x774b('0x21'),_0x329f07,_0x774b('0x22'));_0xa850fa(_0x1d3e50[_0x774b('0x28')][_0x774b('0x27')]);}})[_0x774b('0x29')](function(_0x2e68c6){logger[_0x774b('0x25')](_0x774b('0x21'),_0x329f07,_0x2e68c6);_0xfe793d(_0x2e68c6);});});}function respondWithStatusCode(_0x2cb2ae,_0xfd0603){_0xfd0603=_0xfd0603||0xcc;return function(_0x288d4e){if(_0x288d4e){return _0x2cb2ae[_0x774b('0x2a')](_0xfd0603);}return _0x2cb2ae['status'](_0xfd0603)[_0x774b('0x2b')]();};}function respondWithResult(_0x3fc157,_0x3ffc4f){_0x3ffc4f=_0x3ffc4f||0xc8;return function(_0x528f6b){if(_0x528f6b){return _0x3fc157[_0x774b('0x2c')](_0x3ffc4f)[_0x774b('0x2d')](_0x528f6b);}};}function respondWithFilteredResult(_0x133839,_0xa4c425){return function(_0x598754){if(_0x598754){var _0x32bf7a=_0x598754[_0x774b('0x2e')],_0x185d05=_0xa4c425['offset'],_0x5b8122=_0xa4c425['offset']+_0xa4c425[_0x774b('0x2f')],_0x19844e;if(_0x5b8122>=_0x32bf7a){_0x5b8122=_0x32bf7a;_0x19844e=0xc8;}else{_0x19844e=0xce;}_0x133839['status'](_0x19844e);return _0x133839['set'](_0x774b('0x30'),_0x185d05+'-'+_0x5b8122+'/'+_0x32bf7a)[_0x774b('0x2d')](_0x598754);}return null;};}function patchUpdates(_0x51cdf3){return function(_0x3c80dd){try{jsonpatch[_0x774b('0x31')](_0x3c80dd,_0x51cdf3,!![]);}catch(_0x1718c3){return BPromise[_0x774b('0x32')](_0x1718c3);}return _0x3c80dd[_0x774b('0x33')]();};}function saveUpdates(_0x67dd0d,_0x1cd845){return function(_0x19574a){if(_0x19574a){return _0x19574a['update'](_0x67dd0d)[_0x774b('0x1f')](function(_0x3eb6e1){return _0x3eb6e1;});}return null;};}function removeEntity(_0x1d2eb5,_0x103a0d){return function(_0x359108){if(_0x359108){return _0x359108['destroy']()[_0x774b('0x1f')](function(){_0x1d2eb5['status'](0xcc)[_0x774b('0x2b')]();});}};}function handleEntityNotFound(_0x194fa7,_0x4f922e){return function(_0x52ffcd){if(!_0x52ffcd){_0x194fa7[_0x774b('0x2a')](0x194);}return _0x52ffcd;};}function handleError(_0x5ccf2f,_0x897f03){_0x897f03=_0x897f03||0x1f4;return function(_0x42c3da){logger['error'](_0x42c3da[_0x774b('0x34')]);if(_0x42c3da['name']){delete _0x42c3da[_0x774b('0x35')];}_0x5ccf2f[_0x774b('0x2c')](_0x897f03)[_0x774b('0x36')](_0x42c3da);};}exports['index']=function(_0x3cad6a,_0x2a4783){var _0x4c3d3d={},_0x58684={},_0x3687c8={'count':0x0,'rows':[]};var _0x457d69=_[_0x774b('0x37')](db[_0x774b('0x38')][_0x774b('0x39')],function(_0x58c056){return{'name':_0x58c056[_0x774b('0x3a')],'type':_0x58c056[_0x774b('0x3b')][_0x774b('0x3c')]};});_0x58684['model']=_[_0x774b('0x37')](_0x457d69,_0x774b('0x35'));_0x58684['query']=_['keys'](_0x3cad6a[_0x774b('0x3d')]);_0x58684[_0x774b('0x3e')]=_[_0x774b('0x3f')](_0x58684[_0x774b('0x40')],_0x58684[_0x774b('0x3d')]);_0x4c3d3d[_0x774b('0x41')]=_[_0x774b('0x3f')](_0x58684[_0x774b('0x40')],qs[_0x774b('0x42')](_0x3cad6a[_0x774b('0x3d')][_0x774b('0x42')]));_0x4c3d3d[_0x774b('0x41')]=_0x4c3d3d[_0x774b('0x41')][_0x774b('0x43')]?_0x4c3d3d['attributes']:_0x58684['model'];if(!_0x3cad6a[_0x774b('0x3d')][_0x774b('0x44')](_0x774b('0x45'))){_0x4c3d3d[_0x774b('0x2f')]=qs[_0x774b('0x2f')](_0x3cad6a[_0x774b('0x3d')][_0x774b('0x2f')]);_0x4c3d3d[_0x774b('0x46')]=qs[_0x774b('0x46')](_0x3cad6a[_0x774b('0x3d')][_0x774b('0x46')]);}_0x4c3d3d[_0x774b('0x47')]=qs[_0x774b('0x48')](_0x3cad6a[_0x774b('0x3d')][_0x774b('0x48')]);_0x4c3d3d[_0x774b('0x49')]=qs[_0x774b('0x3e')](_[_0x774b('0x4a')](_0x3cad6a['query'],_0x58684[_0x774b('0x3e')]),_0x457d69);if(_0x3cad6a[_0x774b('0x3d')][_0x774b('0x4b')]){_0x4c3d3d[_0x774b('0x49')]=_[_0x774b('0x4c')](_0x4c3d3d[_0x774b('0x49')],{'$or':_[_0x774b('0x37')](_0x457d69,function(_0xbcca87){if(_0xbcca87[_0x774b('0x3b')]!==_0x774b('0x4d')){var _0x1d83b4={};_0x1d83b4[_0xbcca87[_0x774b('0x35')]]={'$like':'%'+_0x3cad6a[_0x774b('0x3d')][_0x774b('0x4b')]+'%'};return _0x1d83b4;}})});}_0x4c3d3d=_[_0x774b('0x4c')]({},_0x4c3d3d,_0x3cad6a[_0x774b('0x4e')]);var _0x2f2ccb={'where':_0x4c3d3d[_0x774b('0x49')]};return db[_0x774b('0x38')][_0x774b('0x2e')](_0x2f2ccb)['then'](function(_0x2b61e6){_0x3687c8['count']=_0x2b61e6;if(_0x3cad6a[_0x774b('0x3d')][_0x774b('0x4f')]){_0x4c3d3d['include']=[{'all':!![]}];}return db[_0x774b('0x38')][_0x774b('0x50')](_0x4c3d3d);})['then'](function(_0x296b29){_0x3687c8['rows']=_0x296b29;return _0x3687c8;})['then'](respondWithFilteredResult(_0x2a4783,_0x4c3d3d))[_0x774b('0x29')](handleError(_0x2a4783,null));};exports[_0x774b('0x51')]=function(_0x23a575,_0x214d56){var _0x4dcaff={'raw':![],'where':{'id':_0x23a575[_0x774b('0x52')]['id']}},_0x4b393c={};_0x4b393c[_0x774b('0x40')]=_['keys'](db[_0x774b('0x38')][_0x774b('0x39')]);_0x4b393c[_0x774b('0x3d')]=_[_0x774b('0x53')](_0x23a575[_0x774b('0x3d')]);_0x4b393c[_0x774b('0x3e')]=_['intersection'](_0x4b393c[_0x774b('0x40')],_0x4b393c[_0x774b('0x3d')]);_0x4dcaff['attributes']=_[_0x774b('0x3f')](_0x4b393c[_0x774b('0x40')],qs['fields'](_0x23a575[_0x774b('0x3d')][_0x774b('0x42')]));_0x4dcaff[_0x774b('0x41')]=_0x4dcaff[_0x774b('0x41')][_0x774b('0x43')]?_0x4dcaff[_0x774b('0x41')]:_0x4b393c[_0x774b('0x40')];if(_0x23a575[_0x774b('0x3d')]['includeAll']){_0x4dcaff['include']=[{'all':!![]}];}_0x4dcaff=_[_0x774b('0x4c')]({},_0x4dcaff,_0x23a575[_0x774b('0x4e')]);return db[_0x774b('0x38')][_0x774b('0x54')](_0x4dcaff)['then'](handleEntityNotFound(_0x214d56,null))[_0x774b('0x1f')](respondWithResult(_0x214d56,null))[_0x774b('0x29')](handleError(_0x214d56,null));};exports[_0x774b('0x55')]=function(_0x1a96fb,_0x91b723){return db[_0x774b('0x38')][_0x774b('0x55')](_0x1a96fb[_0x774b('0x56')],{})['then'](respondWithResult(_0x91b723,0xc9))['catch'](handleError(_0x91b723,null));};exports[_0x774b('0x57')]=function(_0x1a8355,_0x49f040){if(_0x1a8355['body']['id']){delete _0x1a8355[_0x774b('0x56')]['id'];}return db[_0x774b('0x38')][_0x774b('0x54')]({'where':{'id':_0x1a8355[_0x774b('0x52')]['id']}})[_0x774b('0x1f')](handleEntityNotFound(_0x49f040,null))[_0x774b('0x1f')](saveUpdates(_0x1a8355['body'],null))[_0x774b('0x1f')](respondWithResult(_0x49f040,null))[_0x774b('0x29')](handleError(_0x49f040,null));};exports[_0x774b('0x58')]=function(_0xbaa269,_0x3346a6){return db[_0x774b('0x38')][_0x774b('0x54')]({'where':{'id':_0xbaa269['params']['id']}})[_0x774b('0x1f')](handleEntityNotFound(_0x3346a6,null))[_0x774b('0x1f')](removeEntity(_0x3346a6,null))[_0x774b('0x29')](handleError(_0x3346a6,null));};exports[_0x774b('0x59')]=function(_0x55f577,_0x22699b,_0x44fd31){var _0xc32a29={};var _0xfcd341={};var _0x42f769;var _0x559cbf;return db[_0x774b('0x38')]['findOne']({'where':{'id':_0x55f577[_0x774b('0x52')]['id']}})[_0x774b('0x1f')](handleEntityNotFound(_0x22699b,null))[_0x774b('0x1f')](function(_0x19733b){if(_0x19733b){_0x42f769=_0x19733b;_0xfcd341[_0x774b('0x40')]=_[_0x774b('0x53')](db[_0x774b('0x5a')][_0x774b('0x39')]);_0xfcd341[_0x774b('0x3d')]=_[_0x774b('0x53')](_0x55f577['query']);_0xfcd341[_0x774b('0x3e')]=_[_0x774b('0x3f')](_0xfcd341[_0x774b('0x40')],_0xfcd341[_0x774b('0x3d')]);_0xc32a29[_0x774b('0x41')]=_[_0x774b('0x3f')](_0xfcd341[_0x774b('0x40')],qs['fields'](_0x55f577[_0x774b('0x3d')][_0x774b('0x42')]));_0xc32a29['attributes']=_0xc32a29[_0x774b('0x41')][_0x774b('0x43')]?_0xc32a29[_0x774b('0x41')]:_0xfcd341['model'];_0xc32a29['order']=qs[_0x774b('0x48')](_0x55f577[_0x774b('0x3d')][_0x774b('0x48')]);_0xc32a29[_0x774b('0x49')]=qs[_0x774b('0x3e')](_[_0x774b('0x4a')](_0x55f577[_0x774b('0x3d')],_0xfcd341[_0x774b('0x3e')]));if(_0x55f577['query']['filter']){_0xc32a29[_0x774b('0x49')]=_[_0x774b('0x4c')](_0xc32a29['where'],{'$or':_[_0x774b('0x37')](_0xc32a29['attributes'],function(_0x56e2ec){var _0x2c1498={};_0x2c1498[_0x56e2ec]={'$like':'%'+_0x55f577[_0x774b('0x3d')][_0x774b('0x4b')]+'%'};return _0x2c1498;})});}_0xc32a29=_[_0x774b('0x4c')]({},_0xc32a29,_0x55f577[_0x774b('0x4e')]);return _0x42f769[_0x774b('0x59')](_0xc32a29);}})['then'](function(_0x13682e){if(_0x13682e){_0x559cbf=_0x13682e[_0x774b('0x43')];if(!_0x55f577[_0x774b('0x3d')]['hasOwnProperty']('nolimit')){_0xc32a29['limit']=qs['limit'](_0x55f577['query']['limit']);_0xc32a29[_0x774b('0x46')]=qs[_0x774b('0x46')](_0x55f577[_0x774b('0x3d')][_0x774b('0x46')]);}return _0x42f769[_0x774b('0x59')](_0xc32a29);}})[_0x774b('0x1f')](function(_0x502cf9){if(_0x502cf9){return _0x502cf9?{'count':_0x559cbf,'rows':_0x502cf9}:null;}})[_0x774b('0x1f')](respondWithResult(_0x22699b,null))[_0x774b('0x29')](handleError(_0x22699b,null));};exports[_0x774b('0x5b')]=function(_0x4ad339,_0x228e5b,_0x186308){var _0x1172af={};var _0xb0bb5={};var _0x442c32;var _0x9cc903;return db[_0x774b('0x38')]['findOne']({'where':{'id':_0x4ad339[_0x774b('0x52')]['id']}})[_0x774b('0x1f')](handleEntityNotFound(_0x228e5b,null))[_0x774b('0x1f')](function(_0x156328){if(_0x156328){_0x442c32=_0x156328;_0xb0bb5[_0x774b('0x40')]=_['keys'](db[_0x774b('0x5a')][_0x774b('0x39')]);_0xb0bb5['query']=_['keys'](_0x4ad339[_0x774b('0x3d')]);_0xb0bb5[_0x774b('0x3e')]=_[_0x774b('0x3f')](_0xb0bb5[_0x774b('0x40')],_0xb0bb5[_0x774b('0x3d')]);_0x1172af[_0x774b('0x41')]=_[_0x774b('0x3f')](_0xb0bb5[_0x774b('0x40')],qs[_0x774b('0x42')](_0x4ad339[_0x774b('0x3d')][_0x774b('0x42')]));_0x1172af[_0x774b('0x41')]=_0x1172af[_0x774b('0x41')][_0x774b('0x43')]?_0x1172af[_0x774b('0x41')]:_0xb0bb5[_0x774b('0x40')];_0x1172af[_0x774b('0x47')]=qs[_0x774b('0x48')](_0x4ad339[_0x774b('0x3d')][_0x774b('0x48')]);_0x1172af[_0x774b('0x49')]=qs['filters'](_['pick'](_0x4ad339[_0x774b('0x3d')],_0xb0bb5[_0x774b('0x3e')]));if(_0x4ad339[_0x774b('0x3d')][_0x774b('0x4b')]){_0x1172af[_0x774b('0x49')]=_[_0x774b('0x4c')](_0x1172af[_0x774b('0x49')],{'$or':_['map'](_0x1172af[_0x774b('0x41')],function(_0x1e1062){var _0x13f4c2={};_0x13f4c2[_0x1e1062]={'$like':'%'+_0x4ad339[_0x774b('0x3d')]['filter']+'%'};return _0x13f4c2;})});}_0x1172af=_['merge']({},_0x1172af,_0x4ad339[_0x774b('0x4e')]);return _0x442c32[_0x774b('0x5b')](_0x1172af);}})['then'](function(_0x283b6e){if(_0x283b6e){_0x9cc903=_0x283b6e['length'];if(!_0x4ad339[_0x774b('0x3d')][_0x774b('0x44')]('nolimit')){_0x1172af[_0x774b('0x2f')]=qs[_0x774b('0x2f')](_0x4ad339['query'][_0x774b('0x2f')]);_0x1172af['offset']=qs[_0x774b('0x46')](_0x4ad339[_0x774b('0x3d')][_0x774b('0x46')]);}return _0x442c32[_0x774b('0x5b')](_0x1172af);}})[_0x774b('0x1f')](function(_0x2304fe){if(_0x2304fe){return _0x2304fe?{'count':_0x9cc903,'rows':_0x2304fe}:null;}})[_0x774b('0x1f')](respondWithResult(_0x228e5b,null))[_0x774b('0x29')](handleError(_0x228e5b,null));};exports['getFields']=function(_0x17c7dc,_0x2be889,_0x386805){var _0x17b5ba={};var _0x3d24a8={};var _0x7b0b9;var _0x73563a;return db['FreshsalesConfiguration'][_0x774b('0x5c')]({'where':{'id':_0x17c7dc[_0x774b('0x52')]['id']}})[_0x774b('0x1f')](handleEntityNotFound(_0x2be889,null))[_0x774b('0x1f')](function(_0xe82c61){if(_0xe82c61){_0x7b0b9=_0xe82c61;_0x3d24a8[_0x774b('0x40')]=_[_0x774b('0x53')](db[_0x774b('0x5a')][_0x774b('0x39')]);_0x3d24a8['query']=_[_0x774b('0x53')](_0x17c7dc[_0x774b('0x3d')]);_0x3d24a8[_0x774b('0x3e')]=_[_0x774b('0x3f')](_0x3d24a8[_0x774b('0x40')],_0x3d24a8['query']);_0x17b5ba[_0x774b('0x41')]=_[_0x774b('0x3f')](_0x3d24a8[_0x774b('0x40')],qs[_0x774b('0x42')](_0x17c7dc['query'][_0x774b('0x42')]));_0x17b5ba[_0x774b('0x41')]=_0x17b5ba[_0x774b('0x41')][_0x774b('0x43')]?_0x17b5ba[_0x774b('0x41')]:_0x3d24a8['model'];_0x17b5ba[_0x774b('0x47')]=qs[_0x774b('0x48')](_0x17c7dc[_0x774b('0x3d')][_0x774b('0x48')]);_0x17b5ba[_0x774b('0x49')]=qs[_0x774b('0x3e')](_[_0x774b('0x4a')](_0x17c7dc[_0x774b('0x3d')],_0x3d24a8[_0x774b('0x3e')]));if(_0x17c7dc['query']['filter']){_0x17b5ba[_0x774b('0x49')]=_[_0x774b('0x4c')](_0x17b5ba[_0x774b('0x49')],{'$or':_[_0x774b('0x37')](_0x17b5ba[_0x774b('0x41')],function(_0x317ea4){var _0x1091f5={};_0x1091f5[_0x317ea4]={'$like':'%'+_0x17c7dc[_0x774b('0x3d')][_0x774b('0x4b')]+'%'};return _0x1091f5;})});}_0x17b5ba=_[_0x774b('0x4c')]({},_0x17b5ba,_0x17c7dc['options']);return _0x7b0b9[_0x774b('0x5d')](_0x17b5ba);}})[_0x774b('0x1f')](function(_0xfb6725){if(_0xfb6725){_0x73563a=_0xfb6725[_0x774b('0x43')];if(!_0x17c7dc[_0x774b('0x3d')][_0x774b('0x44')](_0x774b('0x45'))){_0x17b5ba['limit']=qs[_0x774b('0x2f')](_0x17c7dc[_0x774b('0x3d')][_0x774b('0x2f')]);_0x17b5ba[_0x774b('0x46')]=qs['offset'](_0x17c7dc['query'][_0x774b('0x46')]);}return _0x7b0b9['getFields'](_0x17b5ba);}})[_0x774b('0x1f')](function(_0x31cc6b){if(_0x31cc6b){return _0x31cc6b?{'count':_0x73563a,'rows':_0x31cc6b}:null;}})[_0x774b('0x1f')](respondWithResult(_0x2be889,null))[_0x774b('0x29')](handleError(_0x2be889,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8738d94..4513feb 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 _0xa415=['rimraf','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','path'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xa415,0x73));var _0x5a41=function(_0x4c2b30,_0x52ff82){_0x4c2b30=_0x4c2b30-0x0;var _0x4b3955=_0xa415[_0x4c2b30];return _0x4b3955;};'use strict';var _=require(_0x5a41('0x0'));var util=require(_0x5a41('0x1'));var logger=require('../../config/logger')(_0x5a41('0x2'));var moment=require(_0x5a41('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a41('0x4'));var rimraf=require(_0x5a41('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a41('0x6'));module['exports']=function(_0x1adf1a,_0x519007){return _0x1adf1a[_0x5a41('0x7')](_0x5a41('0x8'),attributes,{'tableName':_0x5a41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcf7=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1e8461,_0x5e1500){var _0x528f4d=function(_0x217227){while(--_0x217227){_0x1e8461['push'](_0x1e8461['shift']());}};_0x528f4d(++_0x5e1500);}(_0xdcf7,0x132));var _0x7dcf=function(_0x1d2950,_0x596539){_0x1d2950=_0x1d2950-0x0;var _0x11df30=_0xdcf7[_0x1d2950];return _0x11df30;};'use strict';var _=require(_0x7dcf('0x0'));var util=require(_0x7dcf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7dcf('0x2'));var BPromise=require(_0x7dcf('0x3'));var rp=require(_0x7dcf('0x4'));var fs=require('fs');var path=require(_0x7dcf('0x5'));var rimraf=require(_0x7dcf('0x6'));var config=require(_0x7dcf('0x7'));var attributes=require(_0x7dcf('0x8'));module[_0x7dcf('0x9')]=function(_0x1a062d,_0x278777){return _0x1a062d['define'](_0x7dcf('0xa'),attributes,{'tableName':_0x7dcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 5146101..1661c60 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 _0x3ce4=['../../config/environment','jayson/promise','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x148316,_0x6c9dc){var _0xdbe95d=function(_0x138a9f){while(--_0x138a9f){_0x148316['push'](_0x148316['shift']());}};_0xdbe95d(++_0x6c9dc);}(_0x3ce4,0xcb));var _0x43ce=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x3ce4[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x43ce('0x0'));var util=require('util');var moment=require(_0x43ce('0x1'));var BPromise=require('bluebird');var rs=require(_0x43ce('0x2'));var fs=require('fs');var Redis=require(_0x43ce('0x3'));var db=require(_0x43ce('0x4'))['db'];var utils=require(_0x43ce('0x5'));var logger=require(_0x43ce('0x6'))('rpc');var config=require(_0x43ce('0x7'));var jayson=require(_0x43ce('0x8'));var client=jayson['client'][_0x43ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51e29b,_0x1f93c9,_0x2fd0e2){return new BPromise(function(_0x189654,_0x20c136){return client['request'](_0x51e29b,_0x2fd0e2)[_0x43ce('0xa')](function(_0x13dbc6){logger[_0x43ce('0xb')](_0x43ce('0xc'),_0x1f93c9,_0x43ce('0xd'));logger[_0x43ce('0xe')](_0x43ce('0xf'),_0x1f93c9,_0x43ce('0xd'),JSON['stringify'](_0x13dbc6));if(_0x13dbc6[_0x43ce('0x10')]){if(_0x13dbc6['error'][_0x43ce('0x11')]===0x1f4){logger[_0x43ce('0x10')](_0x43ce('0xc'),_0x1f93c9,_0x13dbc6[_0x43ce('0x10')][_0x43ce('0x12')]);return _0x20c136(_0x13dbc6[_0x43ce('0x10')][_0x43ce('0x12')]);}logger['error'](_0x43ce('0xc'),_0x1f93c9,_0x13dbc6['error'][_0x43ce('0x12')]);return _0x189654(_0x13dbc6[_0x43ce('0x10')][_0x43ce('0x12')]);}else{logger['info'](_0x43ce('0xc'),_0x1f93c9,_0x43ce('0xd'));_0x189654(_0x13dbc6[_0x43ce('0x13')][_0x43ce('0x12')]);}})[_0x43ce('0x14')](function(_0x34b84b){logger[_0x43ce('0x10')](_0x43ce('0xc'),_0x1f93c9,_0x34b84b);_0x20c136(_0x34b84b);});});} \ No newline at end of file +var _0x44a3=['http','request','then','info','request\x20sent','debug','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1df47c,_0xb33879){var _0x17ffba=function(_0xb036e0){while(--_0xb036e0){_0x1df47c['push'](_0x1df47c['shift']());}};_0x17ffba(++_0xb33879);}(_0x44a3,0x1a9));var _0x344a=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x44a3[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a70b876..5a72f72 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 _0x4066=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','put','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4066,0xb3));var _0x6406=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4066[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x6406('0x0'));var util=require('util');var path=require(_0x6406('0x1'));var timeout=require(_0x6406('0x2'));var express=require('express');var router=express[_0x6406('0x3')]();var auth=require(_0x6406('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6406('0x5'));var controller=require(_0x6406('0x6'));router['get']('/',auth[_0x6406('0x7')](),controller[_0x6406('0x8')]);router[_0x6406('0x9')]('/:id',auth[_0x6406('0x7')](),controller[_0x6406('0xa')]);router['post']('/',auth[_0x6406('0x7')](),controller['create']);router[_0x6406('0xb')](_0x6406('0xc'),auth[_0x6406('0x7')](),controller['update']);router[_0x6406('0xd')](_0x6406('0xc'),auth['isAuthenticated'](),controller[_0x6406('0xe')]);module[_0x6406('0xf')]=router; \ No newline at end of file +var _0xaa90=['Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xaa90,0x1dc));var _0x0aa9=function(_0x16f6c5,_0x4880c2){_0x16f6c5=_0x16f6c5-0x0;var _0x1a8756=_0xaa90[_0x16f6c5];return _0x1a8756;};'use strict';var multer=require(_0x0aa9('0x0'));var util=require(_0x0aa9('0x1'));var path=require(_0x0aa9('0x2'));var timeout=require('connect-timeout');var express=require(_0x0aa9('0x3'));var router=express[_0x0aa9('0x4')]();var auth=require(_0x0aa9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0aa9('0x6'));var controller=require(_0x0aa9('0x7'));router['get']('/',auth[_0x0aa9('0x8')](),controller['index']);router[_0x0aa9('0x9')](_0x0aa9('0xa'),auth[_0x0aa9('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0aa9('0xb')]);router[_0x0aa9('0xc')](_0x0aa9('0xa'),auth[_0x0aa9('0x8')](),controller[_0x0aa9('0xd')]);router['delete'](_0x0aa9('0xa'),auth[_0x0aa9('0x8')](),controller[_0x0aa9('0xe')]);module[_0x0aa9('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e8406de..5d4125b 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 _0x03fe=['ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x5ce233,_0x1313df){var _0xfdfd2e=function(_0x3dac4a){while(--_0x3dac4a){_0x5ce233['push'](_0x5ce233['shift']());}};_0xfdfd2e(++_0x1313df);}(_0x03fe,0x73));var _0xe03f=function(_0x585b8c,_0x4135bc){_0x585b8c=_0x585b8c-0x0;var _0x55b8b5=_0x03fe[_0x585b8c];return _0x55b8b5;};'use strict';var Sequelize=require(_0xe03f('0x0'));module[_0xe03f('0x1')]={'type':{'type':Sequelize[_0xe03f('0x2')](_0xe03f('0x3'),'variable',_0xe03f('0x4'),_0xe03f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe03f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xe03f('0x3'),_0xe03f('0x7'),_0xe03f('0x4'))},'keyContent':{'type':Sequelize[_0xe03f('0x6')]},'idField':{'type':Sequelize[_0xe03f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe03f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe03f('0x6')]}}; \ No newline at end of file +var _0x2632=['variable','keyValue','string','STRING','ENUM','customVariable','exports'];(function(_0xe2c5d0,_0x1b522e){var _0x63bca0=function(_0x4c15d2){while(--_0x4c15d2){_0xe2c5d0['push'](_0xe2c5d0['shift']());}};_0x63bca0(++_0x1b522e);}(_0x2632,0xae));var _0x2263=function(_0x36a52b,_0x4ebaf3){_0x36a52b=_0x36a52b-0x0;var _0x11cc45=_0x2632[_0x36a52b];return _0x11cc45;};'use strict';var Sequelize=require('sequelize');module[_0x2263('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x2263('0x1'),'customVariable',_0x2263('0x2')),'defaultValue':_0x2263('0x3')},'content':{'type':Sequelize[_0x2263('0x4')]},'key':{'type':Sequelize[_0x2263('0x4')]},'keyType':{'type':Sequelize[_0x2263('0x5')]('string',_0x2263('0x1'),_0x2263('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2263('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 60df120..d6bd13a 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 _0x44aa=['reject','save','update','then','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x44aa,0x188));var _0xa44a=function(_0x23ffd2,_0x5a1367){_0x23ffd2=_0x23ffd2-0x0;var _0x167a6f=_0x44aa[_0x23ffd2];return _0x167a6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa44a('0x0'));var rimraf=require(_0xa44a('0x1'));var zipdir=require(_0xa44a('0x2'));var jsonpatch=require(_0xa44a('0x3'));var rp=require(_0xa44a('0x4'));var moment=require(_0xa44a('0x5'));var BPromise=require(_0xa44a('0x6'));var Mustache=require(_0xa44a('0x7'));var util=require(_0xa44a('0x8'));var path=require(_0xa44a('0x9'));var sox=require(_0xa44a('0xa'));var csv=require('to-csv');var ejs=require(_0xa44a('0xb'));var fs=require('fs');var _=require(_0xa44a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa44a('0xd'));var deskjs=require(_0xa44a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa44a('0xf'));var Papa=require(_0xa44a('0x10'));var Redis=require(_0xa44a('0x11'));var authService=require(_0xa44a('0x12'));var qs=require(_0xa44a('0x13'));var as=require(_0xa44a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa44a('0x15'));var utils=require(_0xa44a('0x16'));var config=require(_0xa44a('0x17'));var db=require(_0xa44a('0x18'))['db'];function respondWithStatusCode(_0x18734e,_0x50bd67){_0x50bd67=_0x50bd67||0xcc;return function(_0x394141){if(_0x394141){return _0x18734e[_0xa44a('0x19')](_0x50bd67);}return _0x18734e['status'](_0x50bd67)[_0xa44a('0x1a')]();};}function respondWithResult(_0x47a6e6,_0x1541b8){_0x1541b8=_0x1541b8||0xc8;return function(_0x33a9d8){if(_0x33a9d8){return _0x47a6e6[_0xa44a('0x1b')](_0x1541b8)[_0xa44a('0x1c')](_0x33a9d8);}};}function respondWithFilteredResult(_0x215d0a,_0x48562e){return function(_0x25d601){if(_0x25d601){var _0x17bbb4=_0x25d601[_0xa44a('0x1d')],_0x1d11ee=_0x48562e[_0xa44a('0x1e')],_0x282b30=_0x48562e[_0xa44a('0x1e')]+_0x48562e[_0xa44a('0x1f')],_0x12a726;if(_0x282b30>=_0x17bbb4){_0x282b30=_0x17bbb4;_0x12a726=0xc8;}else{_0x12a726=0xce;}_0x215d0a[_0xa44a('0x1b')](_0x12a726);return _0x215d0a['set'](_0xa44a('0x20'),_0x1d11ee+'-'+_0x282b30+'/'+_0x17bbb4)[_0xa44a('0x1c')](_0x25d601);}return null;};}function patchUpdates(_0x1592e0){return function(_0x232b1d){try{jsonpatch[_0xa44a('0x21')](_0x232b1d,_0x1592e0,!![]);}catch(_0x2c60f2){return BPromise[_0xa44a('0x22')](_0x2c60f2);}return _0x232b1d[_0xa44a('0x23')]();};}function saveUpdates(_0x25a9bd,_0xa24915){return function(_0x242db5){if(_0x242db5){return _0x242db5[_0xa44a('0x24')](_0x25a9bd)[_0xa44a('0x25')](function(_0x293a45){return _0x293a45;});}return null;};}function removeEntity(_0x224dd6,_0x42533a){return function(_0x3751dc){if(_0x3751dc){return _0x3751dc['destroy']()['then'](function(){_0x224dd6[_0xa44a('0x1b')](0xcc)[_0xa44a('0x1a')]();});}};}function handleEntityNotFound(_0x5eaf60,_0x5ab963){return function(_0x52df38){if(!_0x52df38){_0x5eaf60[_0xa44a('0x19')](0x194);}return _0x52df38;};}function handleError(_0x1ec217,_0x1a1829){_0x1a1829=_0x1a1829||0x1f4;return function(_0x190c54){logger['error'](_0x190c54[_0xa44a('0x26')]);if(_0x190c54[_0xa44a('0x27')]){delete _0x190c54[_0xa44a('0x27')];}_0x1ec217[_0xa44a('0x1b')](_0x1a1829)[_0xa44a('0x28')](_0x190c54);};}exports[_0xa44a('0x29')]=function(_0x3c307c,_0x192919){var _0x532704={},_0x1d799b={},_0x23fe7a={'count':0x0,'rows':[]};var _0x40be99=_['map'](db[_0xa44a('0x2a')][_0xa44a('0x2b')],function(_0x452abe){return{'name':_0x452abe[_0xa44a('0x2c')],'type':_0x452abe[_0xa44a('0x2d')][_0xa44a('0x2e')]};});_0x1d799b[_0xa44a('0x2f')]=_[_0xa44a('0x30')](_0x40be99,_0xa44a('0x27'));_0x1d799b[_0xa44a('0x31')]=_[_0xa44a('0x32')](_0x3c307c['query']);_0x1d799b[_0xa44a('0x33')]=_[_0xa44a('0x34')](_0x1d799b['model'],_0x1d799b[_0xa44a('0x31')]);_0x532704[_0xa44a('0x35')]=_[_0xa44a('0x34')](_0x1d799b[_0xa44a('0x2f')],qs['fields'](_0x3c307c[_0xa44a('0x31')][_0xa44a('0x36')]));_0x532704[_0xa44a('0x35')]=_0x532704[_0xa44a('0x35')][_0xa44a('0x37')]?_0x532704[_0xa44a('0x35')]:_0x1d799b['model'];if(!_0x3c307c[_0xa44a('0x31')]['hasOwnProperty']('nolimit')){_0x532704[_0xa44a('0x1f')]=qs[_0xa44a('0x1f')](_0x3c307c[_0xa44a('0x31')][_0xa44a('0x1f')]);_0x532704[_0xa44a('0x1e')]=qs[_0xa44a('0x1e')](_0x3c307c[_0xa44a('0x31')][_0xa44a('0x1e')]);}_0x532704[_0xa44a('0x38')]=qs[_0xa44a('0x39')](_0x3c307c[_0xa44a('0x31')][_0xa44a('0x39')]);_0x532704[_0xa44a('0x3a')]=qs[_0xa44a('0x33')](_['pick'](_0x3c307c[_0xa44a('0x31')],_0x1d799b[_0xa44a('0x33')]),_0x40be99);if(_0x3c307c[_0xa44a('0x31')][_0xa44a('0x3b')]){_0x532704[_0xa44a('0x3a')]=_[_0xa44a('0x3c')](_0x532704[_0xa44a('0x3a')],{'$or':_[_0xa44a('0x30')](_0x40be99,function(_0x1db9f9){if(_0x1db9f9['type']!==_0xa44a('0x3d')){var _0xaf9208={};_0xaf9208[_0x1db9f9[_0xa44a('0x27')]]={'$like':'%'+_0x3c307c['query'][_0xa44a('0x3b')]+'%'};return _0xaf9208;}})});}_0x532704=_[_0xa44a('0x3c')]({},_0x532704,_0x3c307c[_0xa44a('0x3e')]);var _0x32ac0f={'where':_0x532704[_0xa44a('0x3a')]};return db[_0xa44a('0x2a')][_0xa44a('0x1d')](_0x32ac0f)[_0xa44a('0x25')](function(_0x5a63fc){_0x23fe7a[_0xa44a('0x1d')]=_0x5a63fc;if(_0x3c307c[_0xa44a('0x31')][_0xa44a('0x3f')]){_0x532704['include']=[{'all':!![]}];}return db[_0xa44a('0x2a')]['findAll'](_0x532704);})['then'](function(_0x5ae83e){_0x23fe7a[_0xa44a('0x40')]=_0x5ae83e;return _0x23fe7a;})[_0xa44a('0x25')](respondWithFilteredResult(_0x192919,_0x532704))[_0xa44a('0x41')](handleError(_0x192919,null));};exports['show']=function(_0x2467be,_0x5a9bfe){var _0x270291={'raw':!![],'where':{'id':_0x2467be[_0xa44a('0x42')]['id']}},_0x8b9bb4={};_0x8b9bb4[_0xa44a('0x2f')]=_[_0xa44a('0x32')](db[_0xa44a('0x2a')]['rawAttributes']);_0x8b9bb4[_0xa44a('0x31')]=_['keys'](_0x2467be['query']);_0x8b9bb4[_0xa44a('0x33')]=_[_0xa44a('0x34')](_0x8b9bb4[_0xa44a('0x2f')],_0x8b9bb4[_0xa44a('0x31')]);_0x270291[_0xa44a('0x35')]=_[_0xa44a('0x34')](_0x8b9bb4[_0xa44a('0x2f')],qs[_0xa44a('0x36')](_0x2467be[_0xa44a('0x31')][_0xa44a('0x36')]));_0x270291[_0xa44a('0x35')]=_0x270291[_0xa44a('0x35')][_0xa44a('0x37')]?_0x270291[_0xa44a('0x35')]:_0x8b9bb4[_0xa44a('0x2f')];if(_0x2467be[_0xa44a('0x31')][_0xa44a('0x3f')]){_0x270291[_0xa44a('0x43')]=[{'all':!![]}];}_0x270291=_[_0xa44a('0x3c')]({},_0x270291,_0x2467be[_0xa44a('0x3e')]);return db[_0xa44a('0x2a')][_0xa44a('0x44')](_0x270291)['then'](handleEntityNotFound(_0x5a9bfe,null))[_0xa44a('0x25')](respondWithResult(_0x5a9bfe,null))[_0xa44a('0x41')](handleError(_0x5a9bfe,null));};exports['create']=function(_0x2e75fc,_0x2ddb91){return db['FreshsalesField'][_0xa44a('0x45')](_0x2e75fc[_0xa44a('0x46')],{})[_0xa44a('0x25')](respondWithResult(_0x2ddb91,0xc9))[_0xa44a('0x41')](handleError(_0x2ddb91,null));};exports[_0xa44a('0x24')]=function(_0x6bafe1,_0x4fa7d1){if(_0x6bafe1[_0xa44a('0x46')]['id']){delete _0x6bafe1[_0xa44a('0x46')]['id'];}return db['FreshsalesField'][_0xa44a('0x44')]({'where':{'id':_0x6bafe1[_0xa44a('0x42')]['id']}})[_0xa44a('0x25')](handleEntityNotFound(_0x4fa7d1,null))[_0xa44a('0x25')](saveUpdates(_0x6bafe1['body'],null))['then'](respondWithResult(_0x4fa7d1,null))[_0xa44a('0x41')](handleError(_0x4fa7d1,null));};exports['destroy']=function(_0x792506,_0x4cc981){return db[_0xa44a('0x2a')][_0xa44a('0x44')]({'where':{'id':_0x792506[_0xa44a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cc981,null))[_0xa44a('0x25')](removeEntity(_0x4cc981,null))[_0xa44a('0x41')](handleError(_0x4cc981,null));}; \ No newline at end of file +var _0x7cb9=['show','params','includeAll','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x7cb9,0x123));var _0x97cb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7cb9[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x97cb('0x0'));var emlformat=require(_0x97cb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x97cb('0x2'));var jsonpatch=require(_0x97cb('0x3'));var rp=require(_0x97cb('0x4'));var moment=require(_0x97cb('0x5'));var BPromise=require(_0x97cb('0x6'));var Mustache=require(_0x97cb('0x7'));var util=require('util');var path=require('path');var sox=require(_0x97cb('0x8'));var csv=require('to-csv');var ejs=require(_0x97cb('0x9'));var fs=require('fs');var _=require(_0x97cb('0xa'));var squel=require('squel');var crypto=require(_0x97cb('0xb'));var jsforce=require(_0x97cb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97cb('0xd'));var Papa=require(_0x97cb('0xe'));var Redis=require(_0x97cb('0xf'));var authService=require(_0x97cb('0x10'));var qs=require(_0x97cb('0x11'));var as=require(_0x97cb('0x12'));var hardwareService=require(_0x97cb('0x13'));var logger=require(_0x97cb('0x14'))(_0x97cb('0x15'));var utils=require('../../config/utils');var config=require(_0x97cb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15cdf5,_0x27bd90){_0x27bd90=_0x27bd90||0xcc;return function(_0x460631){if(_0x460631){return _0x15cdf5[_0x97cb('0x17')](_0x27bd90);}return _0x15cdf5[_0x97cb('0x18')](_0x27bd90)[_0x97cb('0x19')]();};}function respondWithResult(_0x1c18cc,_0x3796cd){_0x3796cd=_0x3796cd||0xc8;return function(_0x2b8f22){if(_0x2b8f22){return _0x1c18cc[_0x97cb('0x18')](_0x3796cd)['json'](_0x2b8f22);}};}function respondWithFilteredResult(_0x5d0c4a,_0xd8ac33){return function(_0x14936e){if(_0x14936e){var _0xcdf650=_0x14936e[_0x97cb('0x1a')],_0x54da4c=_0xd8ac33[_0x97cb('0x1b')],_0x30db89=_0xd8ac33[_0x97cb('0x1b')]+_0xd8ac33[_0x97cb('0x1c')],_0x3042c8;if(_0x30db89>=_0xcdf650){_0x30db89=_0xcdf650;_0x3042c8=0xc8;}else{_0x3042c8=0xce;}_0x5d0c4a[_0x97cb('0x18')](_0x3042c8);return _0x5d0c4a[_0x97cb('0x1d')]('Content-Range',_0x54da4c+'-'+_0x30db89+'/'+_0xcdf650)[_0x97cb('0x1e')](_0x14936e);}return null;};}function patchUpdates(_0x3a80af){return function(_0x14a3c3){try{jsonpatch['apply'](_0x14a3c3,_0x3a80af,!![]);}catch(_0xf21ccc){return BPromise[_0x97cb('0x1f')](_0xf21ccc);}return _0x14a3c3[_0x97cb('0x20')]();};}function saveUpdates(_0x50bfdf,_0x2d8ccd){return function(_0x2f0e1f){if(_0x2f0e1f){return _0x2f0e1f['update'](_0x50bfdf)[_0x97cb('0x21')](function(_0x3dfcd9){return _0x3dfcd9;});}return null;};}function removeEntity(_0x385253,_0x73d59a){return function(_0x490eb7){if(_0x490eb7){return _0x490eb7[_0x97cb('0x22')]()[_0x97cb('0x21')](function(){_0x385253[_0x97cb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x194bf6,_0x190541){return function(_0x6bde06){if(!_0x6bde06){_0x194bf6[_0x97cb('0x17')](0x194);}return _0x6bde06;};}function handleError(_0x5ba53e,_0x104523){_0x104523=_0x104523||0x1f4;return function(_0x34d748){logger[_0x97cb('0x23')](_0x34d748[_0x97cb('0x24')]);if(_0x34d748[_0x97cb('0x25')]){delete _0x34d748['name'];}_0x5ba53e['status'](_0x104523)[_0x97cb('0x26')](_0x34d748);};}exports['index']=function(_0x57cf01,_0xac05dd){var _0x1e6f18={},_0x5afcac={},_0x56d923={'count':0x0,'rows':[]};var _0x1c672c=_[_0x97cb('0x27')](db[_0x97cb('0x28')][_0x97cb('0x29')],function(_0x198c55){return{'name':_0x198c55[_0x97cb('0x2a')],'type':_0x198c55[_0x97cb('0x2b')]['key']};});_0x5afcac[_0x97cb('0x2c')]=_[_0x97cb('0x27')](_0x1c672c,'name');_0x5afcac[_0x97cb('0x2d')]=_[_0x97cb('0x2e')](_0x57cf01[_0x97cb('0x2d')]);_0x5afcac[_0x97cb('0x2f')]=_[_0x97cb('0x30')](_0x5afcac['model'],_0x5afcac[_0x97cb('0x2d')]);_0x1e6f18[_0x97cb('0x31')]=_[_0x97cb('0x30')](_0x5afcac[_0x97cb('0x2c')],qs[_0x97cb('0x32')](_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x32')]));_0x1e6f18['attributes']=_0x1e6f18['attributes'][_0x97cb('0x33')]?_0x1e6f18[_0x97cb('0x31')]:_0x5afcac[_0x97cb('0x2c')];if(!_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x34')](_0x97cb('0x35'))){_0x1e6f18['limit']=qs['limit'](_0x57cf01['query'][_0x97cb('0x1c')]);_0x1e6f18[_0x97cb('0x1b')]=qs[_0x97cb('0x1b')](_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x1b')]);}_0x1e6f18[_0x97cb('0x36')]=qs['sort'](_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x37')]);_0x1e6f18[_0x97cb('0x38')]=qs[_0x97cb('0x2f')](_[_0x97cb('0x39')](_0x57cf01[_0x97cb('0x2d')],_0x5afcac[_0x97cb('0x2f')]),_0x1c672c);if(_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x3a')]){_0x1e6f18[_0x97cb('0x38')]=_[_0x97cb('0x3b')](_0x1e6f18[_0x97cb('0x38')],{'$or':_[_0x97cb('0x27')](_0x1c672c,function(_0x4802d3){if(_0x4802d3[_0x97cb('0x2b')]!==_0x97cb('0x3c')){var _0x398c73={};_0x398c73[_0x4802d3['name']]={'$like':'%'+_0x57cf01[_0x97cb('0x2d')][_0x97cb('0x3a')]+'%'};return _0x398c73;}})});}_0x1e6f18=_[_0x97cb('0x3b')]({},_0x1e6f18,_0x57cf01[_0x97cb('0x3d')]);var _0x28e267={'where':_0x1e6f18[_0x97cb('0x38')]};return db[_0x97cb('0x28')][_0x97cb('0x1a')](_0x28e267)['then'](function(_0x386c85){_0x56d923[_0x97cb('0x1a')]=_0x386c85;if(_0x57cf01[_0x97cb('0x2d')]['includeAll']){_0x1e6f18['include']=[{'all':!![]}];}return db[_0x97cb('0x28')][_0x97cb('0x3e')](_0x1e6f18);})['then'](function(_0x249aa0){_0x56d923['rows']=_0x249aa0;return _0x56d923;})['then'](respondWithFilteredResult(_0xac05dd,_0x1e6f18))[_0x97cb('0x3f')](handleError(_0xac05dd,null));};exports[_0x97cb('0x40')]=function(_0x22e62b,_0x318013){var _0x9dab61={'raw':!![],'where':{'id':_0x22e62b[_0x97cb('0x41')]['id']}},_0x2c31ba={};_0x2c31ba[_0x97cb('0x2c')]=_['keys'](db[_0x97cb('0x28')]['rawAttributes']);_0x2c31ba[_0x97cb('0x2d')]=_[_0x97cb('0x2e')](_0x22e62b[_0x97cb('0x2d')]);_0x2c31ba[_0x97cb('0x2f')]=_[_0x97cb('0x30')](_0x2c31ba[_0x97cb('0x2c')],_0x2c31ba[_0x97cb('0x2d')]);_0x9dab61[_0x97cb('0x31')]=_[_0x97cb('0x30')](_0x2c31ba[_0x97cb('0x2c')],qs[_0x97cb('0x32')](_0x22e62b[_0x97cb('0x2d')][_0x97cb('0x32')]));_0x9dab61[_0x97cb('0x31')]=_0x9dab61['attributes'][_0x97cb('0x33')]?_0x9dab61[_0x97cb('0x31')]:_0x2c31ba[_0x97cb('0x2c')];if(_0x22e62b[_0x97cb('0x2d')][_0x97cb('0x42')]){_0x9dab61['include']=[{'all':!![]}];}_0x9dab61=_[_0x97cb('0x3b')]({},_0x9dab61,_0x22e62b['options']);return db[_0x97cb('0x28')][_0x97cb('0x43')](_0x9dab61)[_0x97cb('0x21')](handleEntityNotFound(_0x318013,null))[_0x97cb('0x21')](respondWithResult(_0x318013,null))[_0x97cb('0x3f')](handleError(_0x318013,null));};exports[_0x97cb('0x44')]=function(_0x551630,_0x1f2fd0){return db[_0x97cb('0x28')]['create'](_0x551630[_0x97cb('0x45')],{})[_0x97cb('0x21')](respondWithResult(_0x1f2fd0,0xc9))['catch'](handleError(_0x1f2fd0,null));};exports[_0x97cb('0x46')]=function(_0x27d52b,_0x2b44e3){if(_0x27d52b[_0x97cb('0x45')]['id']){delete _0x27d52b['body']['id'];}return db[_0x97cb('0x28')][_0x97cb('0x43')]({'where':{'id':_0x27d52b[_0x97cb('0x41')]['id']}})[_0x97cb('0x21')](handleEntityNotFound(_0x2b44e3,null))[_0x97cb('0x21')](saveUpdates(_0x27d52b[_0x97cb('0x45')],null))[_0x97cb('0x21')](respondWithResult(_0x2b44e3,null))[_0x97cb('0x3f')](handleError(_0x2b44e3,null));};exports[_0x97cb('0x22')]=function(_0x1e1e07,_0x15aef0){return db[_0x97cb('0x28')][_0x97cb('0x43')]({'where':{'id':_0x1e1e07[_0x97cb('0x41')]['id']}})[_0x97cb('0x21')](handleEntityNotFound(_0x15aef0,null))[_0x97cb('0x21')](removeEntity(_0x15aef0,null))[_0x97cb('0x3f')](handleError(_0x15aef0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 0ff0d9f..fee8005 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 _0x3d69=['exports','define','FieldId','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes'];(function(_0x175ed9,_0x4c4e86){var _0x386f03=function(_0x346ccd){while(--_0x346ccd){_0x175ed9['push'](_0x175ed9['shift']());}};_0x386f03(++_0x4c4e86);}(_0x3d69,0xd5));var _0x93d6=function(_0xd1197a,_0x2182a2){_0xd1197a=_0xd1197a-0x0;var _0x97c7bb=_0x3d69[_0xd1197a];return _0x97c7bb;};'use strict';var _=require(_0x93d6('0x0'));var util=require('util');var logger=require(_0x93d6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x93d6('0x2'));var rp=require(_0x93d6('0x3'));var fs=require('fs');var path=require(_0x93d6('0x4'));var rimraf=require(_0x93d6('0x5'));var config=require('../../config/environment');var attributes=require(_0x93d6('0x6'));module[_0x93d6('0x7')]=function(_0x51d441,_0x49f4a9){return _0x51d441[_0x93d6('0x8')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x93d6('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe109=['FieldId','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','idField'];(function(_0x2064b6,_0x49272f){var _0x1ad489=function(_0x4182c1){while(--_0x4182c1){_0x2064b6['push'](_0x2064b6['shift']());}};_0x1ad489(++_0x49272f);}(_0xe109,0x14b));var _0x9e10=function(_0x110cb6,_0x1f6a43){_0x110cb6=_0x110cb6-0x0;var _0x57c099=_0xe109[_0x110cb6];return _0x57c099;};'use strict';var _=require(_0x9e10('0x0'));var util=require('util');var logger=require(_0x9e10('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9e10('0x2'));var rp=require(_0x9e10('0x3'));var fs=require('fs');var path=require(_0x9e10('0x4'));var rimraf=require('rimraf');var config=require(_0x9e10('0x5'));var attributes=require(_0x9e10('0x6'));module[_0x9e10('0x7')]=function(_0x10c633,_0x31250c){return _0x10c633['define'](_0x9e10('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9e10('0x9'),_0x9e10('0xa')],'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 35d56ea..aeca388 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 _0xf9fa=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0xf9fa,0x1b6));var _0xaf9f=function(_0x2989cd,_0x288115){_0x2989cd=_0x2989cd-0x0;var _0x274a8c=_0xf9fa[_0x2989cd];return _0x274a8c;};'use strict';var _=require(_0xaf9f('0x0'));var util=require(_0xaf9f('0x1'));var moment=require(_0xaf9f('0x2'));var BPromise=require(_0xaf9f('0x3'));var rs=require(_0xaf9f('0x4'));var fs=require('fs');var Redis=require(_0xaf9f('0x5'));var db=require(_0xaf9f('0x6'))['db'];var utils=require(_0xaf9f('0x7'));var logger=require('../../config/logger')(_0xaf9f('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf9f('0x9'));var client=jayson[_0xaf9f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235929,_0x278885,_0x332d58){return new BPromise(function(_0x48b0c1,_0x52d695){return client[_0xaf9f('0xb')](_0x235929,_0x332d58)[_0xaf9f('0xc')](function(_0x560b46){logger[_0xaf9f('0xd')](_0xaf9f('0xe'),_0x278885,_0xaf9f('0xf'));logger[_0xaf9f('0x10')](_0xaf9f('0x11'),_0x278885,_0xaf9f('0xf'),JSON[_0xaf9f('0x12')](_0x560b46));if(_0x560b46[_0xaf9f('0x13')]){if(_0x560b46['error'][_0xaf9f('0x14')]===0x1f4){logger[_0xaf9f('0x13')](_0xaf9f('0xe'),_0x278885,_0x560b46['error'][_0xaf9f('0x15')]);return _0x52d695(_0x560b46['error'][_0xaf9f('0x15')]);}logger[_0xaf9f('0x13')](_0xaf9f('0xe'),_0x278885,_0x560b46[_0xaf9f('0x13')][_0xaf9f('0x15')]);return _0x48b0c1(_0x560b46[_0xaf9f('0x13')][_0xaf9f('0x15')]);}else{logger[_0xaf9f('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x278885,'request\x20sent');_0x48b0c1(_0x560b46[_0xaf9f('0x16')][_0xaf9f('0x15')]);}})['catch'](function(_0x364a29){logger[_0xaf9f('0x13')](_0xaf9f('0xe'),_0x278885,_0x364a29);_0x52d695(_0x364a29);});});} \ No newline at end of file +var _0x3f75=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','FreshsalesField,\x20%s,\x20%s','message','result'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0x3f75,0xc8));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f7('0x0'));var util=require('util');var moment=require(_0x53f7('0x1'));var BPromise=require(_0x53f7('0x2'));var rs=require(_0x53f7('0x3'));var fs=require('fs');var Redis=require(_0x53f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53f7('0x5'))(_0x53f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x53f7('0x7'));var client=jayson[_0x53f7('0x8')][_0x53f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197120,_0x5af833,_0x108b7e){return new BPromise(function(_0x4f6384,_0x21a2a7){return client[_0x53f7('0xa')](_0x197120,_0x108b7e)[_0x53f7('0xb')](function(_0x1f1d64){logger[_0x53f7('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x5af833,_0x53f7('0xd'));logger['debug'](_0x53f7('0xe'),_0x5af833,'request\x20sent',JSON['stringify'](_0x1f1d64));if(_0x1f1d64[_0x53f7('0xf')]){if(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x10')]===0x1f4){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);return _0x21a2a7(_0x1f1d64['error'][_0x53f7('0x12')]);}logger['error'](_0x53f7('0x11'),_0x5af833,_0x1f1d64['error'][_0x53f7('0x12')]);return _0x4f6384(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);}else{logger[_0x53f7('0xc')](_0x53f7('0x11'),_0x5af833,_0x53f7('0xd'));_0x4f6384(_0x1f1d64[_0x53f7('0x13')][_0x53f7('0x12')]);}})['catch'](function(_0x120af2){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x120af2);_0x21a2a7(_0x120af2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3d3ba8e..932e1ad 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 _0x6bd9=['index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','../../config/environment','./intSalesforceAccount.controller','get'];(function(_0x3c3b57,_0x5c6241){var _0x630592=function(_0x527535){while(--_0x527535){_0x3c3b57['push'](_0x3c3b57['shift']());}};_0x630592(++_0x5c6241);}(_0x6bd9,0xd5));var _0x96bd=function(_0xb883c3,_0x2f880b){_0xb883c3=_0xb883c3-0x0;var _0x3ed8fb=_0x6bd9[_0xb883c3];return _0x3ed8fb;};'use strict';var multer=require(_0x96bd('0x0'));var util=require(_0x96bd('0x1'));var path=require('path');var timeout=require(_0x96bd('0x2'));var express=require(_0x96bd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x96bd('0x4'));var controller=require(_0x96bd('0x5'));router[_0x96bd('0x6')]('/',auth['isAuthenticated'](),controller[_0x96bd('0x7')]);router['get'](_0x96bd('0x8'),auth[_0x96bd('0x9')](),controller[_0x96bd('0xa')]);router['get']('/:id/configurations',auth[_0x96bd('0x9')](),controller[_0x96bd('0xb')]);router[_0x96bd('0x6')](_0x96bd('0xc'),auth[_0x96bd('0x9')](),controller['getFields']);router[_0x96bd('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96bd('0xd')](_0x96bd('0xe'),auth[_0x96bd('0x9')](),controller[_0x96bd('0xf')]);router[_0x96bd('0x10')](_0x96bd('0x8'),auth['isAuthenticated'](),controller[_0x96bd('0x11')]);router[_0x96bd('0x12')](_0x96bd('0x8'),auth[_0x96bd('0x9')](),controller['destroy']);module[_0x96bd('0x13')]=router; \ No newline at end of file +var _0x0ab2=['multer','util','path','connect-timeout','express','Router','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports'];(function(_0x59c9ba,_0x23db7c){var _0x5db0dc=function(_0x376e80){while(--_0x376e80){_0x59c9ba['push'](_0x59c9ba['shift']());}};_0x5db0dc(++_0x23db7c);}(_0x0ab2,0x9a));var _0x20ab=function(_0x4b75a9,_0x42d2f4){_0x4b75a9=_0x4b75a9-0x0;var _0x2f90b1=_0x0ab2[_0x4b75a9];return _0x2f90b1;};'use strict';var multer=require(_0x20ab('0x0'));var util=require(_0x20ab('0x1'));var path=require(_0x20ab('0x2'));var timeout=require(_0x20ab('0x3'));var express=require(_0x20ab('0x4'));var router=express[_0x20ab('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20ab('0x6'));var controller=require(_0x20ab('0x7'));router[_0x20ab('0x8')]('/',auth[_0x20ab('0x9')](),controller[_0x20ab('0xa')]);router[_0x20ab('0x8')](_0x20ab('0xb'),auth[_0x20ab('0x9')](),controller[_0x20ab('0xc')]);router['get'](_0x20ab('0xd'),auth[_0x20ab('0x9')](),controller[_0x20ab('0xe')]);router['get'](_0x20ab('0xf'),auth[_0x20ab('0x9')](),controller[_0x20ab('0x10')]);router[_0x20ab('0x11')]('/',auth[_0x20ab('0x9')](),controller[_0x20ab('0x12')]);router[_0x20ab('0x11')]('/:id/configurations',auth[_0x20ab('0x9')](),controller[_0x20ab('0x13')]);router['put']('/:id',auth[_0x20ab('0x9')](),controller['update']);router['delete'](_0x20ab('0xb'),auth[_0x20ab('0x9')](),controller[_0x20ab('0x14')]);module[_0x20ab('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e8719ca..f110cf1 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0x2a6d8c,_0x19c800){var _0x31a401=function(_0x2bd376){while(--_0x2bd376){_0x2a6d8c['push'](_0x2a6d8c['shift']());}};_0x31a401(++_0x19c800);}(_0x814b,0x1a2));var _0xb814=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x814b[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')]},'description':{'type':Sequelize[_0xb814('0x2')]},'username':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb814('0x2')]},'clientId':{'type':Sequelize[_0xb814('0x2')]},'clientSecret':{'type':Sequelize[_0xb814('0x2')]},'securityToken':{'type':Sequelize[_0xb814('0x2')]},'serverUrl':{'type':Sequelize[_0xb814('0x2')]},'type':{'type':Sequelize[_0xb814('0x4')]('integrationTab',_0xb814('0x5')),'defaultValue':_0xb814('0x6')}}; \ No newline at end of file +var _0xf494=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x7941ec,_0x4098eb){var _0x3e11d3=function(_0x494437){while(--_0x494437){_0x7941ec['push'](_0x7941ec['shift']());}};_0x3e11d3(++_0x4098eb);}(_0xf494,0x1c6));var _0x4f49=function(_0xeb9477,_0x3b4e0d){_0xeb9477=_0xeb9477-0x0;var _0x5baea4=_0xf494[_0xeb9477];return _0x5baea4;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f49('0x2')],'unique':_0x4f49('0x3')},'remoteUri':{'type':Sequelize[_0x4f49('0x2')]},'password':{'type':Sequelize[_0x4f49('0x2')]},'clientId':{'type':Sequelize[_0x4f49('0x2')]},'clientSecret':{'type':Sequelize[_0x4f49('0x2')]},'securityToken':{'type':Sequelize[_0x4f49('0x2')]},'serverUrl':{'type':Sequelize[_0x4f49('0x2')]},'type':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5'),_0x4f49('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 323196a..f14d558 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 _0x53b9=['mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../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~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','map','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','login','concat','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','isNil','ticketType','Case','Reason','IsEscalated','custom','includes','label','picklistValues','value','boolean','True','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53b9,0x18c));var _0x953b=function(_0x496a3b,_0x471253){_0x496a3b=_0x496a3b-0x0;var _0xafe431=_0x53b9[_0x496a3b];return _0xafe431;};'use strict';var pdf=require(_0x953b('0x0'));var emlformat=require(_0x953b('0x1'));var rimraf=require(_0x953b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x953b('0x3'));var rp=require(_0x953b('0x4'));var moment=require(_0x953b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x953b('0x6'));var util=require(_0x953b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x953b('0x8'));var ejs=require(_0x953b('0x9'));var fs=require('fs');var _=require(_0x953b('0xa'));var squel=require(_0x953b('0xb'));var crypto=require(_0x953b('0xc'));var jsforce=require(_0x953b('0xd'));var deskjs=require(_0x953b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x953b('0xf'));var Papa=require(_0x953b('0x10'));var Redis=require(_0x953b('0x11'));var authService=require(_0x953b('0x12'));var qs=require(_0x953b('0x13'));var as=require(_0x953b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x953b('0x15'));var utils=require(_0x953b('0x16'));var config=require(_0x953b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x953b('0x18'));var jayson=require(_0x953b('0x19'));var client=jayson['client'][_0x953b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2e8907,_0x481b3e,_0xc7ce77){if(_0xc7ce77){var _0x41ed37=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41ed37[_0x953b('0x1b')](_0x481b3e)){return _0x2e8907;}else{throw new db[(_0x953b('0x1c'))]['ValidationError'](_0x953b('0x1d'));}}else{return _0x2e8907;}}function respondWithRpcPromise(_0x36f806,_0xa9e5b2,_0x1ea440,_0x5325b6){return new BPromise(function(_0x165918,_0x5d4459){var _0x620e12=_0x5325b6||client;return _0x620e12[_0x953b('0x1e')](_0x36f806,_0x1ea440)[_0x953b('0x1f')](function(_0x3733d7){logger[_0x953b('0x20')](_0x953b('0x21'),_0xa9e5b2,_0x953b('0x22'));logger[_0x953b('0x23')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xa9e5b2,_0x953b('0x22'),JSON[_0x953b('0x24')](_0x3733d7));if(_0x3733d7['error']){if(_0x3733d7[_0x953b('0x25')][_0x953b('0x26')]===0x1f4){logger[_0x953b('0x25')](_0x953b('0x21'),_0xa9e5b2,_0x3733d7[_0x953b('0x25')][_0x953b('0x27')]);return _0x5d4459(_0x3733d7['error'][_0x953b('0x27')]);}logger['error'](_0x953b('0x21'),_0xa9e5b2,_0x3733d7[_0x953b('0x25')][_0x953b('0x27')]);return _0x165918(_0x3733d7[_0x953b('0x25')][_0x953b('0x27')]);}else{logger[_0x953b('0x20')](_0x953b('0x21'),_0xa9e5b2,_0x953b('0x22'));_0x165918(_0x3733d7['result'][_0x953b('0x27')]);}})[_0x953b('0x28')](function(_0x587bbe){logger['error'](_0x953b('0x21'),_0xa9e5b2,_0x587bbe);_0x5d4459(_0x587bbe);});});}function respondWithStatusCode(_0x44d692,_0x4215ef){_0x4215ef=_0x4215ef||0xcc;return function(_0x54a3f4){if(_0x54a3f4){return _0x44d692[_0x953b('0x29')](_0x4215ef);}return _0x44d692[_0x953b('0x2a')](_0x4215ef)[_0x953b('0x2b')]();};}function respondWithResult(_0x4133d3,_0x1fb88d){_0x1fb88d=_0x1fb88d||0xc8;return function(_0x509aa8){if(_0x509aa8){return _0x4133d3[_0x953b('0x2a')](_0x1fb88d)[_0x953b('0x2c')](_0x509aa8);}};}function respondWithFilteredResult(_0x196a0b,_0x5cb961){return function(_0x5a33f0){if(_0x5a33f0){var _0x49227b=_0x5a33f0['count'],_0x1e6ca0=_0x5cb961[_0x953b('0x2d')],_0x39a7e9=_0x5cb961[_0x953b('0x2d')]+_0x5cb961[_0x953b('0x2e')],_0x29bc19;if(_0x39a7e9>=_0x49227b){_0x39a7e9=_0x49227b;_0x29bc19=0xc8;}else{_0x29bc19=0xce;}_0x196a0b[_0x953b('0x2a')](_0x29bc19);return _0x196a0b[_0x953b('0x2f')](_0x953b('0x30'),_0x1e6ca0+'-'+_0x39a7e9+'/'+_0x49227b)[_0x953b('0x2c')](_0x5a33f0);}return null;};}function patchUpdates(_0x399130){return function(_0x238229){try{jsonpatch[_0x953b('0x31')](_0x238229,_0x399130,!![]);}catch(_0x35c484){return BPromise[_0x953b('0x32')](_0x35c484);}return _0x238229['save']();};}function saveUpdates(_0x41db6d,_0x18c5f4){return function(_0x894c7b){if(_0x894c7b){return _0x894c7b[_0x953b('0x33')](_0x41db6d)[_0x953b('0x1f')](function(_0x592c1b){return _0x592c1b;});}return null;};}function removeEntity(_0x1d3ba2,_0xdeb474){return function(_0x50d5ef){if(_0x50d5ef){return _0x50d5ef[_0x953b('0x34')]()[_0x953b('0x1f')](function(){_0x1d3ba2[_0x953b('0x2a')](0xcc)[_0x953b('0x2b')]();});}};}function handleEntityNotFound(_0x31463e,_0xe4a103){return function(_0x2a6c46){if(!_0x2a6c46){_0x31463e[_0x953b('0x29')](0x194);}return _0x2a6c46;};}function handleError(_0x4b5fb7,_0x24dcd2){_0x24dcd2=_0x24dcd2||0x1f4;return function(_0x1f0f4b){logger[_0x953b('0x25')](_0x1f0f4b[_0x953b('0x35')]);if(_0x1f0f4b[_0x953b('0x36')]){delete _0x1f0f4b[_0x953b('0x36')];}_0x4b5fb7[_0x953b('0x2a')](_0x24dcd2)[_0x953b('0x37')](_0x1f0f4b);};}exports[_0x953b('0x38')]=function(_0x2d5d03,_0x4eb20f){var _0x3c5e31={},_0x1895b9={},_0x4359e6={'count':0x0,'rows':[]};var _0x4276ea=_['map'](db[_0x953b('0x39')][_0x953b('0x3a')],function(_0x2c7bd){return{'name':_0x2c7bd[_0x953b('0x3b')],'type':_0x2c7bd[_0x953b('0x3c')]['key']};});_0x1895b9[_0x953b('0x3d')]=_['map'](_0x4276ea,_0x953b('0x36'));_0x1895b9['query']=_['keys'](_0x2d5d03[_0x953b('0x3e')]);_0x1895b9[_0x953b('0x3f')]=_[_0x953b('0x40')](_0x1895b9[_0x953b('0x3d')],_0x1895b9[_0x953b('0x3e')]);_0x3c5e31['attributes']=_[_0x953b('0x40')](_0x1895b9['model'],qs[_0x953b('0x41')](_0x2d5d03[_0x953b('0x3e')]['fields']));_0x3c5e31['attributes']=_0x3c5e31[_0x953b('0x42')]['length']?_0x3c5e31[_0x953b('0x42')]:_0x1895b9[_0x953b('0x3d')];if(!_0x2d5d03['query']['hasOwnProperty'](_0x953b('0x43'))){_0x3c5e31['limit']=qs[_0x953b('0x2e')](_0x2d5d03['query']['limit']);_0x3c5e31[_0x953b('0x2d')]=qs[_0x953b('0x2d')](_0x2d5d03['query']['offset']);}_0x3c5e31['order']=qs[_0x953b('0x44')](_0x2d5d03[_0x953b('0x3e')]['sort']);_0x3c5e31[_0x953b('0x45')]=qs[_0x953b('0x3f')](_['pick'](_0x2d5d03['query'],_0x1895b9[_0x953b('0x3f')]),_0x4276ea);if(_0x2d5d03['query'][_0x953b('0x46')]){_0x3c5e31[_0x953b('0x45')]=_[_0x953b('0x47')](_0x3c5e31[_0x953b('0x45')],{'$or':_[_0x953b('0x48')](_0x4276ea,function(_0x51c3fd){if(_0x51c3fd[_0x953b('0x3c')]!=='VIRTUAL'){var _0x41338f={};_0x41338f[_0x51c3fd['name']]={'$like':'%'+_0x2d5d03[_0x953b('0x3e')][_0x953b('0x46')]+'%'};return _0x41338f;}})});}_0x3c5e31=_[_0x953b('0x47')]({},_0x3c5e31,_0x2d5d03[_0x953b('0x49')]);var _0x3376ff={'where':_0x3c5e31[_0x953b('0x45')]};return db[_0x953b('0x39')][_0x953b('0x4a')](_0x3376ff)[_0x953b('0x1f')](function(_0x424fc3){_0x4359e6[_0x953b('0x4a')]=_0x424fc3;if(_0x2d5d03[_0x953b('0x3e')][_0x953b('0x4b')]){_0x3c5e31[_0x953b('0x4c')]=[{'all':!![]}];}return db[_0x953b('0x39')]['findAll'](_0x3c5e31);})[_0x953b('0x1f')](function(_0x2f631c){_0x4359e6[_0x953b('0x4d')]=_0x2f631c;return _0x4359e6;})['then'](respondWithFilteredResult(_0x4eb20f,_0x3c5e31))[_0x953b('0x28')](handleError(_0x4eb20f,null));};exports[_0x953b('0x4e')]=function(_0x5e9306,_0x5cf7a6){var _0x4cee4e={'raw':![],'where':{'id':_0x5e9306[_0x953b('0x4f')]['id']}},_0x41b11b={};_0x41b11b[_0x953b('0x3d')]=_[_0x953b('0x50')](db[_0x953b('0x39')][_0x953b('0x3a')]);_0x41b11b[_0x953b('0x3e')]=_['keys'](_0x5e9306[_0x953b('0x3e')]);_0x41b11b[_0x953b('0x3f')]=_[_0x953b('0x40')](_0x41b11b[_0x953b('0x3d')],_0x41b11b[_0x953b('0x3e')]);_0x4cee4e[_0x953b('0x42')]=_[_0x953b('0x40')](_0x41b11b[_0x953b('0x3d')],qs['fields'](_0x5e9306[_0x953b('0x3e')][_0x953b('0x41')]));_0x4cee4e['attributes']=_0x4cee4e[_0x953b('0x42')][_0x953b('0x51')]?_0x4cee4e[_0x953b('0x42')]:_0x41b11b[_0x953b('0x3d')];if(_0x5e9306['query']['includeAll']){_0x4cee4e[_0x953b('0x4c')]=[{'all':!![]}];}_0x4cee4e=_[_0x953b('0x47')]({},_0x4cee4e,_0x5e9306[_0x953b('0x49')]);return db[_0x953b('0x39')][_0x953b('0x52')](_0x4cee4e)['then'](handleEntityNotFound(_0x5cf7a6,null))[_0x953b('0x1f')](respondWithResult(_0x5cf7a6,null))[_0x953b('0x28')](handleError(_0x5cf7a6,null));};exports[_0x953b('0x53')]=function(_0x29adb9,_0x5d6efa){return db['SalesforceAccount'][_0x953b('0x53')](_0x29adb9[_0x953b('0x54')],{})[_0x953b('0x1f')](respondWithResult(_0x5d6efa,0xc9))[_0x953b('0x28')](handleError(_0x5d6efa,null));};exports[_0x953b('0x33')]=function(_0x5a7e3d,_0x5e33ca){if(_0x5a7e3d[_0x953b('0x54')]['id']){delete _0x5a7e3d['body']['id'];}return db[_0x953b('0x39')][_0x953b('0x52')]({'where':{'id':_0x5a7e3d[_0x953b('0x4f')]['id']}})[_0x953b('0x1f')](handleEntityNotFound(_0x5e33ca,null))[_0x953b('0x1f')](saveUpdates(_0x5a7e3d[_0x953b('0x54')],null))['then'](respondWithResult(_0x5e33ca,null))[_0x953b('0x28')](handleError(_0x5e33ca,null));};exports['destroy']=function(_0x2689af,_0x68845e){return db[_0x953b('0x39')]['find']({'where':{'id':_0x2689af[_0x953b('0x4f')]['id']}})[_0x953b('0x1f')](handleEntityNotFound(_0x68845e,null))[_0x953b('0x1f')](removeEntity(_0x68845e,null))[_0x953b('0x28')](handleError(_0x68845e,null));};exports[_0x953b('0x55')]=function(_0x177e82,_0x4a83e0,_0x34155c){var _0x24a5d6={};var _0xf6e193={};var _0x5b9e87;var _0xf8bca9;return db[_0x953b('0x39')][_0x953b('0x56')]({'where':{'id':_0x177e82[_0x953b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a83e0,null))[_0x953b('0x1f')](function(_0x3ae24c){if(_0x3ae24c){_0x5b9e87=_0x3ae24c;_0xf6e193[_0x953b('0x3d')]=_['keys'](db[_0x953b('0x57')][_0x953b('0x3a')]);_0xf6e193['query']=_[_0x953b('0x50')](_0x177e82[_0x953b('0x3e')]);_0xf6e193[_0x953b('0x3f')]=_[_0x953b('0x40')](_0xf6e193[_0x953b('0x3d')],_0xf6e193['query']);_0x24a5d6[_0x953b('0x42')]=_[_0x953b('0x40')](_0xf6e193[_0x953b('0x3d')],qs[_0x953b('0x41')](_0x177e82[_0x953b('0x3e')][_0x953b('0x41')]));_0x24a5d6[_0x953b('0x42')]=_0x24a5d6[_0x953b('0x42')][_0x953b('0x51')]?_0x24a5d6[_0x953b('0x42')]:_0xf6e193[_0x953b('0x3d')];_0x24a5d6['order']=qs[_0x953b('0x44')](_0x177e82[_0x953b('0x3e')][_0x953b('0x44')]);_0x24a5d6[_0x953b('0x45')]=qs[_0x953b('0x3f')](_[_0x953b('0x58')](_0x177e82[_0x953b('0x3e')],_0xf6e193['filters']));if(_0x177e82[_0x953b('0x3e')][_0x953b('0x46')]){_0x24a5d6[_0x953b('0x45')]=_['merge'](_0x24a5d6[_0x953b('0x45')],{'$or':_[_0x953b('0x48')](_0x24a5d6['attributes'],function(_0x1944fe){var _0x1f088e={};_0x1f088e[_0x1944fe]={'$like':'%'+_0x177e82['query'][_0x953b('0x46')]+'%'};return _0x1f088e;})});}_0x24a5d6=_['merge']({},_0x24a5d6,_0x177e82[_0x953b('0x49')]);return _0x5b9e87[_0x953b('0x55')](_0x24a5d6);}})['then'](function(_0x5a6c00){if(_0x5a6c00){_0xf8bca9=_0x5a6c00[_0x953b('0x51')];if(!_0x177e82[_0x953b('0x3e')][_0x953b('0x59')](_0x953b('0x43'))){_0x24a5d6[_0x953b('0x2e')]=qs[_0x953b('0x2e')](_0x177e82[_0x953b('0x3e')][_0x953b('0x2e')]);_0x24a5d6['offset']=qs['offset'](_0x177e82[_0x953b('0x3e')][_0x953b('0x2d')]);}return _0x5b9e87[_0x953b('0x55')](_0x24a5d6);}})[_0x953b('0x1f')](function(_0x476377){if(_0x476377){return _0x476377?{'count':_0xf8bca9,'rows':_0x476377}:null;}})[_0x953b('0x1f')](respondWithResult(_0x4a83e0,null))[_0x953b('0x28')](handleError(_0x4a83e0,null));};exports[_0x953b('0x5a')]=function(_0x6307ed,_0x15995c,_0x27c75b){if(_0x6307ed[_0x953b('0x54')]['id']){delete _0x6307ed[_0x953b('0x54')]['id'];}return db[_0x953b('0x39')]['findOne']({'where':{'id':_0x6307ed['params']['id']}})['then'](handleEntityNotFound(_0x15995c,null))[_0x953b('0x1f')](function(_0x5b4cae){if(_0x5b4cae){_0x6307ed['body']['AccountId']=_0x5b4cae['id'];_0x6307ed[_0x953b('0x54')][_0x953b('0x5b')]=integrations[_0x953b('0x5c')](_0x6307ed[_0x953b('0x54')][_0x953b('0x5d')],_0x6307ed[_0x953b('0x54')][_0x953b('0x3c')]);_0x6307ed[_0x953b('0x54')][_0x953b('0x5e')]=integrations[_0x953b('0x5f')](_0x6307ed[_0x953b('0x54')][_0x953b('0x5d')],_0x6307ed['body'][_0x953b('0x3c')]);return db[_0x953b('0x57')][_0x953b('0x53')](_0x6307ed[_0x953b('0x54')],{'include':[{'model':db['SalesforceField'],'as':_0x953b('0x5b')},{'model':db[_0x953b('0x60')],'as':_0x953b('0x5e')}]});}return null;})[_0x953b('0x1f')](respondWithResult(_0x15995c,null))['catch'](handleError(_0x15995c,null));};exports['getFields']=function(_0x56c31b,_0x35a1ff,_0x415dd5){var _0x2c0f97;var _0x2272bd='';var _0x4146d6=_0x953b('0x61');return db['SalesforceAccount']['findOne']({'where':{'id':_0x56c31b['params']['id']},'attributes':['id',_0x953b('0x62'),_0x953b('0x63'),_0x953b('0x64'),_0x953b('0x65'),_0x953b('0x66'),_0x953b('0x67')]})[_0x953b('0x1f')](handleEntityNotFound(_0x35a1ff,null))[_0x953b('0x1f')](function(_0x5638e9){if(_0x5638e9){_0x2272bd=_0x5638e9[_0x953b('0x62')];var _0x3b295a=_0x2272bd['slice'](-0x1);if(_0x3b295a==='/'){_0x2272bd=_0x2272bd[_0x953b('0x68')](0x0,_0x2272bd[_0x953b('0x69')](_0x3b295a));}_0x2c0f97=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2272bd,'clientId':_0x5638e9['clientId'],'clientSecret':_0x5638e9[_0x953b('0x64')]}});return _0x2c0f97[_0x953b('0x6a')](_0x5638e9[_0x953b('0x65')],_0x5638e9['password'][_0x953b('0x6b')](_0x5638e9['securityToken']));}})['then'](function(_0x53a9b8){if(_0x53a9b8){if(!_['isNil'](_0x56c31b['query']['ticketType'])){_0x4146d6=_0x56c31b[_0x953b('0x3e')]['ticketType'];}return _0x2c0f97['sobject'](_0x4146d6)[_0x953b('0x6c')]();}})[_0x953b('0x1f')](function(_0x4ab8b1){var _0x40282f=[_0x953b('0x6d'),_0x953b('0x6e'),_0x953b('0x6f'),_0x953b('0x70'),_0x953b('0x71'),_0x953b('0x72'),_0x953b('0x73'),_0x953b('0x74')];if(!_[_0x953b('0x75')](_0x56c31b['query'][_0x953b('0x76')])&&_0x56c31b[_0x953b('0x3e')][_0x953b('0x76')]===_0x953b('0x77')){_0x40282f=[_0x953b('0x74'),'Origin',_0x953b('0x78'),_0x953b('0x73'),'Priority',_0x953b('0x79'),'SuppliedName','SuppliedCompany'];}if(_0x4ab8b1){_['remove'](_0x4ab8b1['fields'],function(_0x19edd6){return _0x19edd6[_0x953b('0x7a')]===![]&&!_0x40282f[_0x953b('0x7b')](_0x19edd6[_0x953b('0x36')]);});return{'count':_0x4ab8b1[_0x953b('0x41')][_0x953b('0x51')],'rows':_[_0x953b('0x48')](_0x4ab8b1[_0x953b('0x41')],function(_0x526920){return{'id':_0x526920['name'],'name':_0x526920[_0x953b('0x7c')],'custom':_0x526920[_0x953b('0x7a')],'options':_0x526920[_0x953b('0x7d')]['length']>0x0?_[_0x953b('0x48')](_0x526920[_0x953b('0x7d')],function(_0x44114a){return{'name':_0x44114a['label'],'value':_0x44114a[_0x953b('0x7e')]};}):_0x526920['type']==_0x953b('0x7f')?[{'name':_0x953b('0x80'),'value':_0x953b('0x81')},{'name':_0x953b('0x82'),'value':_0x953b('0x83')}]:[]};})};}})[_0x953b('0x1f')](respondWithResult(_0x35a1ff,null))[_0x953b('0x28')](function(_0x234426){var _0x5bef80=_0x56c31b['query']['test']?0x1f4:_0x234426[_0x953b('0x84')]||0x1f4;logger[_0x953b('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5bef80,JSON['stringify'](_0x234426));delete _0x234426[_0x953b('0x36')];if(_0x5bef80===0x191){_0x5bef80=0x190;}_0x35a1ff[_0x953b('0x2a')](_0x5bef80)[_0x953b('0x37')](_0x56c31b['query'][_0x953b('0x1b')]?{'message':_0x953b('0x85'),'statusCode':_0x234426[_0x953b('0x84')]}:_0x234426);});}; \ No newline at end of file +var _0x3fb7=['value','boolean','True','true','false','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','json','offset','limit','status','reject','save','destroy','stack','name','send','index','map','SalesforceAccount','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','rawAttributes','create','body','find','getConfigurations','SalesforceConfiguration','filter','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','password','securityToken','slice','lastIndexOf','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Origin','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues'];(function(_0x27d513,_0x5c3c57){var _0x25e897=function(_0x66303c){while(--_0x66303c){_0x27d513['push'](_0x27d513['shift']());}};_0x25e897(++_0x5c3c57);}(_0x3fb7,0x8d));var _0x73fb=function(_0x3b18d6,_0x430bc6){_0x3b18d6=_0x3b18d6-0x0;var _0x4e6f22=_0x3fb7[_0x3b18d6];return _0x4e6f22;};'use strict';var pdf=require(_0x73fb('0x0'));var emlformat=require(_0x73fb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x73fb('0x2'));var jsonpatch=require(_0x73fb('0x3'));var rp=require(_0x73fb('0x4'));var moment=require(_0x73fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x73fb('0x6'));var util=require(_0x73fb('0x7'));var path=require(_0x73fb('0x8'));var sox=require('sox');var csv=require(_0x73fb('0x9'));var ejs=require(_0x73fb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x73fb('0xb'));var jsforce=require(_0x73fb('0xc'));var deskjs=require(_0x73fb('0xd'));var toCsv=require(_0x73fb('0x9'));var querystring=require(_0x73fb('0xe'));var Papa=require(_0x73fb('0xf'));var Redis=require(_0x73fb('0x10'));var authService=require(_0x73fb('0x11'));var qs=require(_0x73fb('0x12'));var as=require(_0x73fb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x73fb('0x14'));var utils=require(_0x73fb('0x15'));var config=require(_0x73fb('0x16'));var db=require(_0x73fb('0x17'))['db'];var integrations=require(_0x73fb('0x18'));var jayson=require(_0x73fb('0x19'));var client=jayson[_0x73fb('0x1a')][_0x73fb('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x164149,_0x4d2d78,_0x252851){if(_0x252851){var _0x281e86=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x281e86[_0x73fb('0x1c')](_0x4d2d78)){return _0x164149;}else{throw new db[(_0x73fb('0x1d'))][(_0x73fb('0x1e'))](_0x73fb('0x1f'));}}else{return _0x164149;}}function respondWithRpcPromise(_0x585bf1,_0x5281ee,_0x5a2096,_0x436acb){return new BPromise(function(_0x5b1da9,_0xc22d79){var _0x3d39b5=_0x436acb||client;return _0x3d39b5[_0x73fb('0x20')](_0x585bf1,_0x5a2096)[_0x73fb('0x21')](function(_0x1abaf2){logger['info'](_0x73fb('0x22'),_0x5281ee,_0x73fb('0x23'));logger['debug'](_0x73fb('0x24'),_0x5281ee,_0x73fb('0x23'),JSON[_0x73fb('0x25')](_0x1abaf2));if(_0x1abaf2[_0x73fb('0x26')]){if(_0x1abaf2[_0x73fb('0x26')]['code']===0x1f4){logger[_0x73fb('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x5281ee,_0x1abaf2['error'][_0x73fb('0x27')]);return _0xc22d79(_0x1abaf2[_0x73fb('0x26')][_0x73fb('0x27')]);}logger[_0x73fb('0x26')](_0x73fb('0x22'),_0x5281ee,_0x1abaf2['error'][_0x73fb('0x27')]);return _0x5b1da9(_0x1abaf2[_0x73fb('0x26')][_0x73fb('0x27')]);}else{logger[_0x73fb('0x28')](_0x73fb('0x22'),_0x5281ee,_0x73fb('0x23'));_0x5b1da9(_0x1abaf2[_0x73fb('0x29')][_0x73fb('0x27')]);}})[_0x73fb('0x2a')](function(_0x4c775c){logger[_0x73fb('0x26')](_0x73fb('0x22'),_0x5281ee,_0x4c775c);_0xc22d79(_0x4c775c);});});}function respondWithStatusCode(_0x2b3f77,_0xeffcc1){_0xeffcc1=_0xeffcc1||0xcc;return function(_0x32f246){if(_0x32f246){return _0x2b3f77[_0x73fb('0x2b')](_0xeffcc1);}return _0x2b3f77['status'](_0xeffcc1)[_0x73fb('0x2c')]();};}function respondWithResult(_0x5a0c26,_0x165f7d){_0x165f7d=_0x165f7d||0xc8;return function(_0x186103){if(_0x186103){return _0x5a0c26['status'](_0x165f7d)[_0x73fb('0x2d')](_0x186103);}};}function respondWithFilteredResult(_0x3fede6,_0x42298f){return function(_0x2b76ce){if(_0x2b76ce){var _0x4c6a78=_0x2b76ce['count'],_0x399ba4=_0x42298f[_0x73fb('0x2e')],_0x174651=_0x42298f[_0x73fb('0x2e')]+_0x42298f[_0x73fb('0x2f')],_0x4a67a8;if(_0x174651>=_0x4c6a78){_0x174651=_0x4c6a78;_0x4a67a8=0xc8;}else{_0x4a67a8=0xce;}_0x3fede6[_0x73fb('0x30')](_0x4a67a8);return _0x3fede6['set']('Content-Range',_0x399ba4+'-'+_0x174651+'/'+_0x4c6a78)[_0x73fb('0x2d')](_0x2b76ce);}return null;};}function patchUpdates(_0x5a59e8){return function(_0x1ccfdc){try{jsonpatch['apply'](_0x1ccfdc,_0x5a59e8,!![]);}catch(_0x8d01e3){return BPromise[_0x73fb('0x31')](_0x8d01e3);}return _0x1ccfdc[_0x73fb('0x32')]();};}function saveUpdates(_0x5a2e06,_0x2fa0f6){return function(_0x36404f){if(_0x36404f){return _0x36404f['update'](_0x5a2e06)[_0x73fb('0x21')](function(_0x1da4a9){return _0x1da4a9;});}return null;};}function removeEntity(_0x37ba53,_0x4c81ba){return function(_0x4c60c0){if(_0x4c60c0){return _0x4c60c0[_0x73fb('0x33')]()['then'](function(){_0x37ba53[_0x73fb('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257b9d,_0x3924c6){return function(_0x46c0ee){if(!_0x46c0ee){_0x257b9d[_0x73fb('0x2b')](0x194);}return _0x46c0ee;};}function handleError(_0x45d95b,_0x28a4e0){_0x28a4e0=_0x28a4e0||0x1f4;return function(_0x38b5d0){logger[_0x73fb('0x26')](_0x38b5d0[_0x73fb('0x34')]);if(_0x38b5d0['name']){delete _0x38b5d0[_0x73fb('0x35')];}_0x45d95b[_0x73fb('0x30')](_0x28a4e0)[_0x73fb('0x36')](_0x38b5d0);};}exports[_0x73fb('0x37')]=function(_0x15f4bc,_0x122ffe){var _0x8589fd={},_0x4713e7={},_0x231d23={'count':0x0,'rows':[]};var _0x2c0b84=_[_0x73fb('0x38')](db[_0x73fb('0x39')]['rawAttributes'],function(_0xcb1759){return{'name':_0xcb1759[_0x73fb('0x3a')],'type':_0xcb1759[_0x73fb('0x3b')]['key']};});_0x4713e7['model']=_['map'](_0x2c0b84,_0x73fb('0x35'));_0x4713e7[_0x73fb('0x3c')]=_[_0x73fb('0x3d')](_0x15f4bc[_0x73fb('0x3c')]);_0x4713e7[_0x73fb('0x3e')]=_['intersection'](_0x4713e7[_0x73fb('0x3f')],_0x4713e7[_0x73fb('0x3c')]);_0x8589fd[_0x73fb('0x40')]=_[_0x73fb('0x41')](_0x4713e7[_0x73fb('0x3f')],qs[_0x73fb('0x42')](_0x15f4bc[_0x73fb('0x3c')]['fields']));_0x8589fd['attributes']=_0x8589fd[_0x73fb('0x40')][_0x73fb('0x43')]?_0x8589fd[_0x73fb('0x40')]:_0x4713e7[_0x73fb('0x3f')];if(!_0x15f4bc[_0x73fb('0x3c')][_0x73fb('0x44')](_0x73fb('0x45'))){_0x8589fd[_0x73fb('0x2f')]=qs['limit'](_0x15f4bc[_0x73fb('0x3c')]['limit']);_0x8589fd[_0x73fb('0x2e')]=qs[_0x73fb('0x2e')](_0x15f4bc[_0x73fb('0x3c')]['offset']);}_0x8589fd[_0x73fb('0x46')]=qs['sort'](_0x15f4bc[_0x73fb('0x3c')][_0x73fb('0x47')]);_0x8589fd[_0x73fb('0x48')]=qs['filters'](_[_0x73fb('0x49')](_0x15f4bc['query'],_0x4713e7[_0x73fb('0x3e')]),_0x2c0b84);if(_0x15f4bc[_0x73fb('0x3c')]['filter']){_0x8589fd[_0x73fb('0x48')]=_[_0x73fb('0x4a')](_0x8589fd['where'],{'$or':_[_0x73fb('0x38')](_0x2c0b84,function(_0x55a0a8){if(_0x55a0a8[_0x73fb('0x3b')]!==_0x73fb('0x4b')){var _0x5c82de={};_0x5c82de[_0x55a0a8[_0x73fb('0x35')]]={'$like':'%'+_0x15f4bc['query']['filter']+'%'};return _0x5c82de;}})});}_0x8589fd=_[_0x73fb('0x4a')]({},_0x8589fd,_0x15f4bc[_0x73fb('0x4c')]);var _0x9ec960={'where':_0x8589fd[_0x73fb('0x48')]};return db[_0x73fb('0x39')][_0x73fb('0x4d')](_0x9ec960)[_0x73fb('0x21')](function(_0x895eae){_0x231d23[_0x73fb('0x4d')]=_0x895eae;if(_0x15f4bc[_0x73fb('0x3c')][_0x73fb('0x4e')]){_0x8589fd[_0x73fb('0x4f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x73fb('0x50')](_0x8589fd);})[_0x73fb('0x21')](function(_0x55da4e){_0x231d23['rows']=_0x55da4e;return _0x231d23;})[_0x73fb('0x21')](respondWithFilteredResult(_0x122ffe,_0x8589fd))[_0x73fb('0x2a')](handleError(_0x122ffe,null));};exports[_0x73fb('0x51')]=function(_0xcaf0a6,_0x277e46){var _0x117430={'raw':![],'where':{'id':_0xcaf0a6[_0x73fb('0x52')]['id']}},_0x98f51a={};_0x98f51a[_0x73fb('0x3f')]=_['keys'](db['SalesforceAccount'][_0x73fb('0x53')]);_0x98f51a[_0x73fb('0x3c')]=_['keys'](_0xcaf0a6[_0x73fb('0x3c')]);_0x98f51a[_0x73fb('0x3e')]=_[_0x73fb('0x41')](_0x98f51a[_0x73fb('0x3f')],_0x98f51a['query']);_0x117430['attributes']=_[_0x73fb('0x41')](_0x98f51a[_0x73fb('0x3f')],qs[_0x73fb('0x42')](_0xcaf0a6[_0x73fb('0x3c')]['fields']));_0x117430[_0x73fb('0x40')]=_0x117430[_0x73fb('0x40')]['length']?_0x117430[_0x73fb('0x40')]:_0x98f51a[_0x73fb('0x3f')];if(_0xcaf0a6[_0x73fb('0x3c')][_0x73fb('0x4e')]){_0x117430[_0x73fb('0x4f')]=[{'all':!![]}];}_0x117430=_[_0x73fb('0x4a')]({},_0x117430,_0xcaf0a6[_0x73fb('0x4c')]);return db[_0x73fb('0x39')]['find'](_0x117430)[_0x73fb('0x21')](handleEntityNotFound(_0x277e46,null))[_0x73fb('0x21')](respondWithResult(_0x277e46,null))[_0x73fb('0x2a')](handleError(_0x277e46,null));};exports[_0x73fb('0x54')]=function(_0xb6f3bc,_0x5c80e8){return db[_0x73fb('0x39')][_0x73fb('0x54')](_0xb6f3bc['body'],{})['then'](respondWithResult(_0x5c80e8,0xc9))[_0x73fb('0x2a')](handleError(_0x5c80e8,null));};exports['update']=function(_0x51f07b,_0xd0c22e){if(_0x51f07b[_0x73fb('0x55')]['id']){delete _0x51f07b[_0x73fb('0x55')]['id'];}return db[_0x73fb('0x39')]['find']({'where':{'id':_0x51f07b['params']['id']}})[_0x73fb('0x21')](handleEntityNotFound(_0xd0c22e,null))[_0x73fb('0x21')](saveUpdates(_0x51f07b[_0x73fb('0x55')],null))[_0x73fb('0x21')](respondWithResult(_0xd0c22e,null))[_0x73fb('0x2a')](handleError(_0xd0c22e,null));};exports[_0x73fb('0x33')]=function(_0x585052,_0x51a8c3){return db[_0x73fb('0x39')][_0x73fb('0x56')]({'where':{'id':_0x585052['params']['id']}})['then'](handleEntityNotFound(_0x51a8c3,null))[_0x73fb('0x21')](removeEntity(_0x51a8c3,null))[_0x73fb('0x2a')](handleError(_0x51a8c3,null));};exports[_0x73fb('0x57')]=function(_0x5d2620,_0x10b248,_0x9efca3){var _0x9b3d84={};var _0x722eff={};var _0x3efe6b;var _0x5be624;return db[_0x73fb('0x39')]['findOne']({'where':{'id':_0x5d2620['params']['id']}})[_0x73fb('0x21')](handleEntityNotFound(_0x10b248,null))[_0x73fb('0x21')](function(_0x4eca41){if(_0x4eca41){_0x3efe6b=_0x4eca41;_0x722eff[_0x73fb('0x3f')]=_[_0x73fb('0x3d')](db[_0x73fb('0x58')]['rawAttributes']);_0x722eff[_0x73fb('0x3c')]=_['keys'](_0x5d2620[_0x73fb('0x3c')]);_0x722eff[_0x73fb('0x3e')]=_['intersection'](_0x722eff['model'],_0x722eff[_0x73fb('0x3c')]);_0x9b3d84[_0x73fb('0x40')]=_[_0x73fb('0x41')](_0x722eff[_0x73fb('0x3f')],qs[_0x73fb('0x42')](_0x5d2620[_0x73fb('0x3c')][_0x73fb('0x42')]));_0x9b3d84[_0x73fb('0x40')]=_0x9b3d84[_0x73fb('0x40')][_0x73fb('0x43')]?_0x9b3d84[_0x73fb('0x40')]:_0x722eff['model'];_0x9b3d84[_0x73fb('0x46')]=qs[_0x73fb('0x47')](_0x5d2620['query']['sort']);_0x9b3d84['where']=qs['filters'](_[_0x73fb('0x49')](_0x5d2620['query'],_0x722eff[_0x73fb('0x3e')]));if(_0x5d2620['query'][_0x73fb('0x59')]){_0x9b3d84[_0x73fb('0x48')]=_['merge'](_0x9b3d84[_0x73fb('0x48')],{'$or':_[_0x73fb('0x38')](_0x9b3d84[_0x73fb('0x40')],function(_0x509e42){var _0x3a8b96={};_0x3a8b96[_0x509e42]={'$like':'%'+_0x5d2620['query'][_0x73fb('0x59')]+'%'};return _0x3a8b96;})});}_0x9b3d84=_[_0x73fb('0x4a')]({},_0x9b3d84,_0x5d2620['options']);return _0x3efe6b[_0x73fb('0x57')](_0x9b3d84);}})[_0x73fb('0x21')](function(_0x1e1fbb){if(_0x1e1fbb){_0x5be624=_0x1e1fbb[_0x73fb('0x43')];if(!_0x5d2620[_0x73fb('0x3c')][_0x73fb('0x44')](_0x73fb('0x45'))){_0x9b3d84[_0x73fb('0x2f')]=qs['limit'](_0x5d2620[_0x73fb('0x3c')][_0x73fb('0x2f')]);_0x9b3d84[_0x73fb('0x2e')]=qs['offset'](_0x5d2620['query'][_0x73fb('0x2e')]);}return _0x3efe6b[_0x73fb('0x57')](_0x9b3d84);}})['then'](function(_0x14dd4e){if(_0x14dd4e){return _0x14dd4e?{'count':_0x5be624,'rows':_0x14dd4e}:null;}})['then'](respondWithResult(_0x10b248,null))['catch'](handleError(_0x10b248,null));};exports[_0x73fb('0x5a')]=function(_0x3e5706,_0x4634bb,_0x17ed51){if(_0x3e5706[_0x73fb('0x55')]['id']){delete _0x3e5706[_0x73fb('0x55')]['id'];}return db[_0x73fb('0x39')][_0x73fb('0x5b')]({'where':{'id':_0x3e5706[_0x73fb('0x52')]['id']}})[_0x73fb('0x21')](handleEntityNotFound(_0x4634bb,null))['then'](function(_0x22d150){if(_0x22d150){_0x3e5706['body'][_0x73fb('0x5c')]=_0x22d150['id'];_0x3e5706[_0x73fb('0x55')]['Subjects']=integrations[_0x73fb('0x5d')](_0x3e5706['body'][_0x73fb('0x5e')],_0x3e5706[_0x73fb('0x55')][_0x73fb('0x3b')]);_0x3e5706[_0x73fb('0x55')][_0x73fb('0x5f')]=integrations[_0x73fb('0x60')](_0x3e5706[_0x73fb('0x55')][_0x73fb('0x5e')],_0x3e5706[_0x73fb('0x55')]['type']);return db[_0x73fb('0x58')][_0x73fb('0x54')](_0x3e5706['body'],{'include':[{'model':db[_0x73fb('0x61')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x73fb('0x5f')}]});}return null;})[_0x73fb('0x21')](respondWithResult(_0x4634bb,null))[_0x73fb('0x2a')](handleError(_0x4634bb,null));};exports[_0x73fb('0x62')]=function(_0x2d046b,_0x3ba0ec,_0x283655){var _0x589d2b;var _0x53e272='';var _0x1dbfba=_0x73fb('0x63');return db[_0x73fb('0x39')][_0x73fb('0x5b')]({'where':{'id':_0x2d046b[_0x73fb('0x52')]['id']},'attributes':['id',_0x73fb('0x64'),_0x73fb('0x65'),'clientSecret','username',_0x73fb('0x66'),_0x73fb('0x67')]})['then'](handleEntityNotFound(_0x3ba0ec,null))['then'](function(_0x440a53){if(_0x440a53){_0x53e272=_0x440a53[_0x73fb('0x64')];var _0x25accd=_0x53e272[_0x73fb('0x68')](-0x1);if(_0x25accd==='/'){_0x53e272=_0x53e272['substring'](0x0,_0x53e272[_0x73fb('0x69')](_0x25accd));}_0x589d2b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x53e272,'clientId':_0x440a53['clientId'],'clientSecret':_0x440a53[_0x73fb('0x6a')]}});return _0x589d2b[_0x73fb('0x6b')](_0x440a53[_0x73fb('0x6c')],_0x440a53['password'][_0x73fb('0x6d')](_0x440a53[_0x73fb('0x67')]));}})['then'](function(_0x1299f6){if(_0x1299f6){if(!_[_0x73fb('0x6e')](_0x2d046b['query']['ticketType'])){_0x1dbfba=_0x2d046b[_0x73fb('0x3c')][_0x73fb('0x6f')];}return _0x589d2b[_0x73fb('0x70')](_0x1dbfba)[_0x73fb('0x71')]();}})[_0x73fb('0x21')](function(_0x36b251){var _0x210859=['CallDisposition',_0x73fb('0x72'),_0x73fb('0x73'),_0x73fb('0x74'),_0x73fb('0x75'),_0x73fb('0x76'),_0x73fb('0x77'),_0x73fb('0x78')];if(!_[_0x73fb('0x6e')](_0x2d046b[_0x73fb('0x3c')][_0x73fb('0x6f')])&&_0x2d046b[_0x73fb('0x3c')][_0x73fb('0x6f')]==='Case'){_0x210859=[_0x73fb('0x78'),_0x73fb('0x79'),'Reason',_0x73fb('0x77'),_0x73fb('0x76'),'IsEscalated',_0x73fb('0x7a'),_0x73fb('0x7b')];}if(_0x36b251){_[_0x73fb('0x7c')](_0x36b251['fields'],function(_0x445b98){return _0x445b98[_0x73fb('0x7d')]===![]&&!_0x210859[_0x73fb('0x7e')](_0x445b98['name']);});return{'count':_0x36b251[_0x73fb('0x42')][_0x73fb('0x43')],'rows':_[_0x73fb('0x38')](_0x36b251['fields'],function(_0x143655){return{'id':_0x143655[_0x73fb('0x35')],'name':_0x143655[_0x73fb('0x7f')],'custom':_0x143655[_0x73fb('0x7d')],'options':_0x143655[_0x73fb('0x80')][_0x73fb('0x43')]>0x0?_[_0x73fb('0x38')](_0x143655[_0x73fb('0x80')],function(_0x3e1bd4){return{'name':_0x3e1bd4[_0x73fb('0x7f')],'value':_0x3e1bd4[_0x73fb('0x81')]};}):_0x143655['type']==_0x73fb('0x82')?[{'name':_0x73fb('0x83'),'value':_0x73fb('0x84')},{'name':'False','value':_0x73fb('0x85')}]:[]};})};}})[_0x73fb('0x21')](respondWithResult(_0x3ba0ec,null))[_0x73fb('0x2a')](function(_0x550867){var _0x2dc1e2=_0x2d046b[_0x73fb('0x3c')][_0x73fb('0x1c')]?0x1f4:_0x550867['statusCode']||0x1f4;logger[_0x73fb('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2dc1e2,JSON['stringify'](_0x550867));delete _0x550867[_0x73fb('0x35')];if(_0x2dc1e2===0x191){_0x2dc1e2=0x190;}_0x3ba0ec['status'](_0x2dc1e2)[_0x73fb('0x36')](_0x2d046b[_0x73fb('0x3c')]['test']?{'message':_0x73fb('0x86'),'statusCode':_0x550867['statusCode']}:_0x550867);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 85c6d03..9c2b54b 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 _0x055e=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api'];(function(_0x1ae8a6,_0xf1a03c){var _0x55d641=function(_0x4d4fa2){while(--_0x4d4fa2){_0x1ae8a6['push'](_0x1ae8a6['shift']());}};_0x55d641(++_0xf1a03c);}(_0x055e,0xb3));var _0xe055=function(_0x3bfd67,_0x19f0f7){_0x3bfd67=_0x3bfd67-0x0;var _0xa5095e=_0x055e[_0x3bfd67];return _0xa5095e;};'use strict';var _=require('lodash');var util=require(_0xe055('0x0'));var logger=require(_0xe055('0x1'))(_0xe055('0x2'));var moment=require(_0xe055('0x3'));var BPromise=require('bluebird');var rp=require(_0xe055('0x4'));var fs=require('fs');var path=require(_0xe055('0x5'));var rimraf=require(_0xe055('0x6'));var config=require(_0xe055('0x7'));var attributes=require(_0xe055('0x8'));var integrations=require(_0xe055('0x9'));module['exports']=function(_0x51f69c,_0x14091a){return _0x51f69c[_0xe055('0xa')](_0xe055('0xb'),attributes,{'tableName':_0xe055('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe34a=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x13ccf2,_0x52fbde){var _0x3346b7=function(_0x2b4431){while(--_0x2b4431){_0x13ccf2['push'](_0x13ccf2['shift']());}};_0x3346b7(++_0x52fbde);}(_0xe34a,0x1ee));var _0xae34=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xe34a[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0xae34('0x0'));var util=require('util');var logger=require(_0xae34('0x1'))('api');var moment=require(_0xae34('0x2'));var BPromise=require(_0xae34('0x3'));var rp=require(_0xae34('0x4'));var fs=require('fs');var path=require(_0xae34('0x5'));var rimraf=require(_0xae34('0x6'));var config=require('../../config/environment');var attributes=require(_0xae34('0x7'));var integrations=require(_0xae34('0x8'));module[_0xae34('0x9')]=function(_0x56b7e5,_0x8c41bb){return _0x56b7e5[_0xae34('0xa')](_0xae34('0xb'),attributes,{'tableName':_0xae34('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 3d880de..3214287 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 _0x9bde=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2ccc6c,_0x5666fc){var _0x29632b=function(_0x1b910c){while(--_0x1b910c){_0x2ccc6c['push'](_0x2ccc6c['shift']());}};_0x29632b(++_0x5666fc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x59dc3b,_0x13b432){_0x59dc3b=_0x59dc3b-0x0;var _0x10e9e9=_0x9bde[_0x59dc3b];return _0x10e9e9;};'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')]('SalesforceAccount,\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')]('SalesforceAccount,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('SalesforceAccount,\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')]('SalesforceAccount,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}exports[_0xe9bd('0x16')]=function(_0x3bae08){var _0x34ba2b=this;return new Promise(function(_0x330733,_0x5cf674){return db[_0xe9bd('0x17')]['findAll']({'raw':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08['options'][_0xe9bd('0x19')]===undefined?!![]:![]:!![],'where':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1a')]||null:null,'attributes':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1b')]||null:null,'limit':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1c')]||null:null,'include':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')]['include']?_[_0xe9bd('0x1d')](_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1e')],function(_0xf02209){return{'model':db[_0xf02209['model']],'as':_0xf02209['as'],'attributes':_0xf02209[_0xe9bd('0x1b')],'include':_0xf02209[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0xf02209[_0xe9bd('0x1e')],function(_0x2641be){return{'model':db[_0x2641be[_0xe9bd('0x1f')]],'as':_0x2641be['as'],'attributes':_0x2641be[_0xe9bd('0x1b')],'include':_0x2641be[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x2641be['include'],function(_0x3c211a){return{'model':db[_0x3c211a[_0xe9bd('0x1f')]],'as':_0x3c211a['as'],'attributes':_0x3c211a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9bd('0xb')](function(_0xc25248){logger[_0xe9bd('0xc')](_0xe9bd('0x16'),_0x3bae08);logger[_0xe9bd('0xd')](_0xe9bd('0x16'),_0x3bae08,JSON['stringify'](_0xc25248));_0x330733(_0xc25248);})['catch'](function(_0x1de54c){logger['error'](_0xe9bd('0x16'),_0x1de54c[_0xe9bd('0x12')],_0x3bae08);_0x5cf674(_0x34ba2b[_0xe9bd('0x10')](0x1f4,_0x1de54c[_0xe9bd('0x12')]));});});};exports[_0xe9bd('0x20')]=function(_0x509e36){var _0x4b7bc2=this;return new Promise(function(_0x7f2c5,_0x3b6682){return db[_0xe9bd('0x17')][_0xe9bd('0x21')]({'raw':_0x509e36[_0xe9bd('0x18')]?_0x509e36[_0xe9bd('0x18')][_0xe9bd('0x19')]===undefined?!![]:![]:!![],'where':_0x509e36[_0xe9bd('0x18')]?_0x509e36[_0xe9bd('0x18')]['where']||null:null,'attributes':_0x509e36[_0xe9bd('0x18')]?_0x509e36[_0xe9bd('0x18')][_0xe9bd('0x1b')]||null:null,'include':_0x509e36['options']?_0x509e36['options'][_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x509e36[_0xe9bd('0x18')][_0xe9bd('0x1e')],function(_0x1dda43){return{'model':db[_0x1dda43[_0xe9bd('0x1f')]],'as':_0x1dda43['as'],'attributes':_0x1dda43[_0xe9bd('0x1b')],'include':_0x1dda43[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x1dda43[_0xe9bd('0x1e')],function(_0x46576b){return{'model':db[_0x46576b[_0xe9bd('0x1f')]],'as':_0x46576b['as'],'attributes':_0x46576b[_0xe9bd('0x1b')],'include':_0x46576b[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x46576b[_0xe9bd('0x1e')],function(_0x264ba0){return{'model':db[_0x264ba0[_0xe9bd('0x1f')]],'as':_0x264ba0['as'],'attributes':_0x264ba0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9bd('0xb')](function(_0x32e764){logger['info'](_0xe9bd('0x20'),_0x509e36);logger[_0xe9bd('0xd')]('ShowSalesforceAccount',_0x509e36,JSON['stringify'](_0x32e764));_0x7f2c5(_0x32e764);})[_0xe9bd('0x15')](function(_0xdf43b9){logger['error'](_0xe9bd('0x20'),_0xdf43b9[_0xe9bd('0x12')],_0x509e36);_0x3b6682(_0x4b7bc2[_0xe9bd('0x10')](0x1f4,_0xdf43b9['message']));});});}; \ No newline at end of file +var _0x9c44=['http','request','then','request\x20sent','debug','stringify','code','error','message','SalesforceAccount,\x20%s,\x20%s','info','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','include','model','map','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0xfdffef,_0x202973){var _0x4ad048=function(_0x227cac){while(--_0x227cac){_0xfdffef['push'](_0xfdffef['shift']());}};_0x4ad048(++_0x202973);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['findAll']({'raw':_0x4c3253[_0x49c4('0x17')]?_0x4c3253['options'][_0x49c4('0x18')]===undefined?!![]:![]:!![],'where':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')][_0x49c4('0x19')]||null:null,'attributes':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')][_0x49c4('0x1a')]||null:null,'limit':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')]['limit']||null:null,'include':_0x4c3253['options']?_0x4c3253['options'][_0x49c4('0x1b')]?_['map'](_0x4c3253['options'][_0x49c4('0x1b')],function(_0x15581b){return{'model':db[_0x15581b[_0x49c4('0x1c')]],'as':_0x15581b['as'],'attributes':_0x15581b[_0x49c4('0x1a')],'include':_0x15581b['include']?_['map'](_0x15581b[_0x49c4('0x1b')],function(_0x9cb797){return{'model':db[_0x9cb797['model']],'as':_0x9cb797['as'],'attributes':_0x9cb797[_0x49c4('0x1a')],'include':_0x9cb797[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x9cb797[_0x49c4('0x1b')],function(_0x531d92){return{'model':db[_0x531d92['model']],'as':_0x531d92['as'],'attributes':_0x531d92[_0x49c4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3800b7){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')]('GetSalesforceAccount',_0x4c3253,JSON[_0x49c4('0xd')](_0x3800b7));_0x3c782d(_0x3800b7);})[_0x49c4('0x14')](function(_0x46e04d){logger[_0x49c4('0xf')](_0x49c4('0x15'),_0x46e04d[_0x49c4('0x10')],_0x4c3253);_0x2f82d5(_0x512650[_0x49c4('0xf')](0x1f4,_0x46e04d[_0x49c4('0x10')]));});});};exports[_0x49c4('0x1e')]=function(_0x2cbd88){var _0x46f7ea=this;return new Promise(function(_0x4ea6ea,_0x4f4495){return db['SalesforceAccount'][_0x49c4('0x1f')]({'raw':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x18')]===undefined?!![]:![]:!![],'where':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88['options'][_0x49c4('0x19')]||null:null,'attributes':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x1a')]||null:null,'include':_0x2cbd88['options']?_0x2cbd88['options'][_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x1b')],function(_0xd38540){return{'model':db[_0xd38540['model']],'as':_0xd38540['as'],'attributes':_0xd38540[_0x49c4('0x1a')],'include':_0xd38540[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0xd38540['include'],function(_0x5ba924){return{'model':db[_0x5ba924[_0x49c4('0x1c')]],'as':_0x5ba924['as'],'attributes':_0x5ba924[_0x49c4('0x1a')],'include':_0x5ba924[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x5ba924[_0x49c4('0x1b')],function(_0x2cf897){return{'model':db[_0x2cf897[_0x49c4('0x1c')]],'as':_0x2cf897['as'],'attributes':_0x2cf897[_0x49c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x49c4('0xa')](function(_0x4e0209){logger[_0x49c4('0x12')]('ShowSalesforceAccount',_0x2cbd88);logger[_0x49c4('0xc')](_0x49c4('0x1e'),_0x2cbd88,JSON[_0x49c4('0xd')](_0x4e0209));_0x4ea6ea(_0x4e0209);})[_0x49c4('0x14')](function(_0x4ed4f8){logger[_0x49c4('0xf')](_0x49c4('0x1e'),_0x4ed4f8[_0x49c4('0x10')],_0x2cbd88);_0x4f4495(_0x46f7ea['error'](0x1f4,_0x4ed4f8[_0x49c4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 126f466..2ce2a1f 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 _0x0663=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','getFields'];(function(_0x1546d5,_0x37d591){var _0x1c75fd=function(_0x41b637){while(--_0x41b637){_0x1546d5['push'](_0x1546d5['shift']());}};_0x1c75fd(++_0x37d591);}(_0x0663,0x1eb));var _0x3066=function(_0x1be79d,_0x5e1297){_0x1be79d=_0x1be79d-0x0;var _0xdb530a=_0x0663[_0x1be79d];return _0xdb530a;};'use strict';var multer=require(_0x3066('0x0'));var util=require(_0x3066('0x1'));var path=require(_0x3066('0x2'));var timeout=require(_0x3066('0x3'));var express=require(_0x3066('0x4'));var router=express['Router']();var auth=require(_0x3066('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3066('0x6'));var controller=require(_0x3066('0x7'));router[_0x3066('0x8')]('/',auth[_0x3066('0x9')](),controller[_0x3066('0xa')]);router[_0x3066('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3066('0xb')]);router[_0x3066('0x8')]('/:id/fields',auth[_0x3066('0x9')](),controller[_0x3066('0xc')]);router[_0x3066('0x8')](_0x3066('0xd'),auth[_0x3066('0x9')](),controller[_0x3066('0xe')]);router[_0x3066('0x8')](_0x3066('0xf'),auth[_0x3066('0x9')](),controller[_0x3066('0x10')]);router['post']('/',auth[_0x3066('0x9')](),controller['create']);router['put'](_0x3066('0x11'),auth[_0x3066('0x9')](),controller[_0x3066('0x12')]);router[_0x3066('0x13')](_0x3066('0x11'),auth['isAuthenticated'](),controller[_0x3066('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbddc=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller'];(function(_0x40b577,_0x5153c9){var _0xb3b57b=function(_0x191363){while(--_0x191363){_0x40b577['push'](_0x40b577['shift']());}};_0xb3b57b(++_0x5153c9);}(_0xbddc,0x9f));var _0xcbdd=function(_0x4f31a0,_0x381b9d){_0x4f31a0=_0x4f31a0-0x0;var _0x49d869=_0xbddc[_0x4f31a0];return _0x49d869;};'use strict';var multer=require(_0xcbdd('0x0'));var util=require(_0xcbdd('0x1'));var path=require(_0xcbdd('0x2'));var timeout=require(_0xcbdd('0x3'));var express=require(_0xcbdd('0x4'));var router=express['Router']();var auth=require(_0xcbdd('0x5'));var interaction=require(_0xcbdd('0x6'));var config=require(_0xcbdd('0x7'));var controller=require(_0xcbdd('0x8'));router[_0xcbdd('0x9')]('/',auth[_0xcbdd('0xa')](),controller['index']);router['get'](_0xcbdd('0xb'),auth[_0xcbdd('0xa')](),controller[_0xcbdd('0xc')]);router['get'](_0xcbdd('0xd'),auth['isAuthenticated'](),controller[_0xcbdd('0xe')]);router[_0xcbdd('0x9')](_0xcbdd('0xf'),auth[_0xcbdd('0xa')](),controller[_0xcbdd('0x10')]);router[_0xcbdd('0x9')](_0xcbdd('0x11'),auth['isAuthenticated'](),controller[_0xcbdd('0x12')]);router[_0xcbdd('0x13')]('/',auth['isAuthenticated'](),controller[_0xcbdd('0x14')]);router['put'](_0xcbdd('0xb'),auth['isAuthenticated'](),controller[_0xcbdd('0x15')]);router[_0xcbdd('0x16')](_0xcbdd('0xb'),auth[_0xcbdd('0xa')](),controller[_0xcbdd('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 62af7aa..f56f237 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 _0x27cf=['contact_lead','contact','lead','nothing','sequelize','STRING','ENUM','Task','Case'];(function(_0x48a518,_0xe7a6bd){var _0x5c7c2a=function(_0x27f631){while(--_0x27f631){_0x48a518['push'](_0x48a518['shift']());}};_0x5c7c2a(++_0xe7a6bd);}(_0x27cf,0x79));var _0xf27c=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x27cf[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0xf27c('0x0'));module['exports']={'name':{'type':Sequelize[_0xf27c('0x1')]},'description':{'type':Sequelize[_0xf27c('0x1')]},'ticketType':{'type':Sequelize[_0xf27c('0x2')](_0xf27c('0x3'),_0xf27c('0x4')),'defaultValue':_0xf27c('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf27c('0x5'),_0xf27c('0x6'),_0xf27c('0x7')),'defaultValue':_0xf27c('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0xf27c('0x8'),_0xf27c('0x6'),'lead'),'defaultValue':_0xf27c('0x7')}}; \ No newline at end of file +var _0x8106=['lead','sequelize','STRING','ENUM','Case','Task','contact_lead','contact'];(function(_0x3f48c8,_0x299d53){var _0x4c7512=function(_0x526393){while(--_0x526393){_0x3f48c8['push'](_0x3f48c8['shift']());}};_0x4c7512(++_0x299d53);}(_0x8106,0x109));var _0x6810=function(_0x42e3d2,_0x456864){_0x42e3d2=_0x42e3d2-0x0;var _0x40cf31=_0x8106[_0x42e3d2];return _0x40cf31;};'use strict';var Sequelize=require(_0x6810('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6810('0x1')]},'ticketType':{'type':Sequelize[_0x6810('0x2')]('Task',_0x6810('0x3')),'defaultValue':_0x6810('0x4')},'moduleSearch':{'type':Sequelize[_0x6810('0x2')](_0x6810('0x5'),_0x6810('0x6'),'lead'),'defaultValue':_0x6810('0x5')},'moduleCreate':{'type':Sequelize[_0x6810('0x2')]('nothing','contact',_0x6810('0x7')),'defaultValue':_0x6810('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b6f50ce..fa844dd 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 _0xfbdb=['stringify','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','SalesforceConfiguration','findAll','show','params','filters','options','find','create','body','getFields','findOne','rawAttributes','pick','hasOwnProperty','SalesforceField','getSubjects','getDescriptions','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','../../config/environment','../../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~!@#$%^&-_=+[{]}.','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4c8244,_0x233d0c){var _0x771972=function(_0x44dd52){while(--_0x44dd52){_0x4c8244['push'](_0x4c8244['shift']());}};_0x771972(++_0x233d0c);}(_0xfbdb,0x1ba));var _0xbfbd=function(_0x487b9c,_0x57eca6){_0x487b9c=_0x487b9c-0x0;var _0x21acf7=_0xfbdb[_0x487b9c];return _0x21acf7;};'use strict';var pdf=require(_0xbfbd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbfbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfbd('0x2'));var rp=require(_0xbfbd('0x3'));var moment=require(_0xbfbd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbfbd('0x5'));var util=require(_0xbfbd('0x6'));var path=require(_0xbfbd('0x7'));var sox=require(_0xbfbd('0x8'));var csv=require(_0xbfbd('0x9'));var ejs=require(_0xbfbd('0xa'));var fs=require('fs');var _=require(_0xbfbd('0xb'));var squel=require(_0xbfbd('0xc'));var crypto=require(_0xbfbd('0xd'));var jsforce=require(_0xbfbd('0xe'));var deskjs=require(_0xbfbd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbfbd('0x10'));var Papa=require(_0xbfbd('0x11'));var Redis=require(_0xbfbd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbfbd('0x13'));var as=require(_0xbfbd('0x14'));var hardwareService=require(_0xbfbd('0x15'));var logger=require(_0xbfbd('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xbfbd('0x17'));var db=require(_0xbfbd('0x18'))['db'];var jayson=require(_0xbfbd('0x19'));var client=jayson[_0xbfbd('0x1a')][_0xbfbd('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ce0a8,_0x576b44,_0x53d59c){if(_0x53d59c){var _0x580240=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x580240[_0xbfbd('0x1c')](_0x576b44)){return _0x2ce0a8;}else{throw new db['Sequelize'][(_0xbfbd('0x1d'))](_0xbfbd('0x1e'));}}else{return _0x2ce0a8;}}function respondWithRpcPromise(_0x5c4512,_0x466e65,_0x91dccd,_0x3060ca){return new BPromise(function(_0x1ae3f7,_0x11dc6c){var _0x5854e9=_0x3060ca||client;return _0x5854e9[_0xbfbd('0x1f')](_0x5c4512,_0x91dccd)[_0xbfbd('0x20')](function(_0x4786b8){logger[_0xbfbd('0x21')](_0xbfbd('0x22'),_0x466e65,_0xbfbd('0x23'));logger[_0xbfbd('0x24')](_0xbfbd('0x25'),_0x466e65,_0xbfbd('0x23'),JSON[_0xbfbd('0x26')](_0x4786b8));if(_0x4786b8[_0xbfbd('0x27')]){if(_0x4786b8['error']['code']===0x1f4){logger['error'](_0xbfbd('0x22'),_0x466e65,_0x4786b8[_0xbfbd('0x27')][_0xbfbd('0x28')]);return _0x11dc6c(_0x4786b8['error'][_0xbfbd('0x28')]);}logger[_0xbfbd('0x27')](_0xbfbd('0x22'),_0x466e65,_0x4786b8[_0xbfbd('0x27')][_0xbfbd('0x28')]);return _0x1ae3f7(_0x4786b8[_0xbfbd('0x27')][_0xbfbd('0x28')]);}else{logger[_0xbfbd('0x21')](_0xbfbd('0x22'),_0x466e65,'request\x20sent');_0x1ae3f7(_0x4786b8[_0xbfbd('0x29')]['message']);}})[_0xbfbd('0x2a')](function(_0x21db3e){logger[_0xbfbd('0x27')](_0xbfbd('0x22'),_0x466e65,_0x21db3e);_0x11dc6c(_0x21db3e);});});}function respondWithStatusCode(_0x6fad3a,_0x1ca7f8){_0x1ca7f8=_0x1ca7f8||0xcc;return function(_0x1bbfc7){if(_0x1bbfc7){return _0x6fad3a[_0xbfbd('0x2b')](_0x1ca7f8);}return _0x6fad3a['status'](_0x1ca7f8)[_0xbfbd('0x2c')]();};}function respondWithResult(_0x22d039,_0x41bbdb){_0x41bbdb=_0x41bbdb||0xc8;return function(_0x213182){if(_0x213182){return _0x22d039['status'](_0x41bbdb)[_0xbfbd('0x2d')](_0x213182);}};}function respondWithFilteredResult(_0x4c9bc3,_0x3d4155){return function(_0x60b113){if(_0x60b113){var _0x5ad745=_0x60b113[_0xbfbd('0x2e')],_0x19ac8a=_0x3d4155[_0xbfbd('0x2f')],_0x154aa2=_0x3d4155['offset']+_0x3d4155[_0xbfbd('0x30')],_0x15571f;if(_0x154aa2>=_0x5ad745){_0x154aa2=_0x5ad745;_0x15571f=0xc8;}else{_0x15571f=0xce;}_0x4c9bc3[_0xbfbd('0x31')](_0x15571f);return _0x4c9bc3[_0xbfbd('0x32')](_0xbfbd('0x33'),_0x19ac8a+'-'+_0x154aa2+'/'+_0x5ad745)['json'](_0x60b113);}return null;};}function patchUpdates(_0x462335){return function(_0x7a3fd4){try{jsonpatch[_0xbfbd('0x34')](_0x7a3fd4,_0x462335,!![]);}catch(_0x540245){return BPromise[_0xbfbd('0x35')](_0x540245);}return _0x7a3fd4[_0xbfbd('0x36')]();};}function saveUpdates(_0x34989a,_0x1ee4a2){return function(_0x36944c){if(_0x36944c){return _0x36944c[_0xbfbd('0x37')](_0x34989a)[_0xbfbd('0x20')](function(_0x44aa5d){return _0x44aa5d;});}return null;};}function removeEntity(_0xfa16d4,_0x20cad0){return function(_0x191316){if(_0x191316){return _0x191316[_0xbfbd('0x38')]()[_0xbfbd('0x20')](function(){_0xfa16d4[_0xbfbd('0x31')](0xcc)[_0xbfbd('0x2c')]();});}};}function handleEntityNotFound(_0xe9c86,_0x270921){return function(_0x414aff){if(!_0x414aff){_0xe9c86[_0xbfbd('0x2b')](0x194);}return _0x414aff;};}function handleError(_0x3c0b0a,_0x21437){_0x21437=_0x21437||0x1f4;return function(_0x4ad8ae){logger[_0xbfbd('0x27')](_0x4ad8ae[_0xbfbd('0x39')]);if(_0x4ad8ae[_0xbfbd('0x3a')]){delete _0x4ad8ae[_0xbfbd('0x3a')];}_0x3c0b0a['status'](_0x21437)['send'](_0x4ad8ae);};}exports[_0xbfbd('0x3b')]=function(_0x5e106d,_0x4cd1f0){var _0x2d63e4={},_0x12730e={},_0x513692={'count':0x0,'rows':[]};var _0x30e703=_[_0xbfbd('0x3c')](db['SalesforceConfiguration']['rawAttributes'],function(_0xdddfd1){return{'name':_0xdddfd1['fieldName'],'type':_0xdddfd1['type'][_0xbfbd('0x3d')]};});_0x12730e[_0xbfbd('0x3e')]=_[_0xbfbd('0x3c')](_0x30e703,_0xbfbd('0x3a'));_0x12730e[_0xbfbd('0x3f')]=_[_0xbfbd('0x40')](_0x5e106d[_0xbfbd('0x3f')]);_0x12730e['filters']=_[_0xbfbd('0x41')](_0x12730e['model'],_0x12730e['query']);_0x2d63e4[_0xbfbd('0x42')]=_[_0xbfbd('0x41')](_0x12730e['model'],qs[_0xbfbd('0x43')](_0x5e106d[_0xbfbd('0x3f')][_0xbfbd('0x43')]));_0x2d63e4[_0xbfbd('0x42')]=_0x2d63e4[_0xbfbd('0x42')][_0xbfbd('0x44')]?_0x2d63e4[_0xbfbd('0x42')]:_0x12730e['model'];if(!_0x5e106d[_0xbfbd('0x3f')]['hasOwnProperty'](_0xbfbd('0x45'))){_0x2d63e4[_0xbfbd('0x30')]=qs[_0xbfbd('0x30')](_0x5e106d[_0xbfbd('0x3f')]['limit']);_0x2d63e4[_0xbfbd('0x2f')]=qs[_0xbfbd('0x2f')](_0x5e106d[_0xbfbd('0x3f')][_0xbfbd('0x2f')]);}_0x2d63e4[_0xbfbd('0x46')]=qs[_0xbfbd('0x47')](_0x5e106d['query']['sort']);_0x2d63e4[_0xbfbd('0x48')]=qs['filters'](_['pick'](_0x5e106d[_0xbfbd('0x3f')],_0x12730e['filters']),_0x30e703);if(_0x5e106d[_0xbfbd('0x3f')][_0xbfbd('0x49')]){_0x2d63e4['where']=_[_0xbfbd('0x4a')](_0x2d63e4['where'],{'$or':_[_0xbfbd('0x3c')](_0x30e703,function(_0x456127){if(_0x456127[_0xbfbd('0x4b')]!==_0xbfbd('0x4c')){var _0x41a9e4={};_0x41a9e4[_0x456127['name']]={'$like':'%'+_0x5e106d[_0xbfbd('0x3f')][_0xbfbd('0x49')]+'%'};return _0x41a9e4;}})});}_0x2d63e4=_[_0xbfbd('0x4a')]({},_0x2d63e4,_0x5e106d['options']);var _0x1ac183={'where':_0x2d63e4[_0xbfbd('0x48')]};return db['SalesforceConfiguration'][_0xbfbd('0x2e')](_0x1ac183)[_0xbfbd('0x20')](function(_0x7f8002){_0x513692[_0xbfbd('0x2e')]=_0x7f8002;if(_0x5e106d['query'][_0xbfbd('0x4d')]){_0x2d63e4[_0xbfbd('0x4e')]=[{'all':!![]}];}return db[_0xbfbd('0x4f')][_0xbfbd('0x50')](_0x2d63e4);})['then'](function(_0x16d07a){_0x513692['rows']=_0x16d07a;return _0x513692;})[_0xbfbd('0x20')](respondWithFilteredResult(_0x4cd1f0,_0x2d63e4))[_0xbfbd('0x2a')](handleError(_0x4cd1f0,null));};exports[_0xbfbd('0x51')]=function(_0x18f5ac,_0x145cff){var _0x462eef={'raw':![],'where':{'id':_0x18f5ac[_0xbfbd('0x52')]['id']}},_0x473fc4={};_0x473fc4[_0xbfbd('0x3e')]=_['keys'](db[_0xbfbd('0x4f')]['rawAttributes']);_0x473fc4[_0xbfbd('0x3f')]=_[_0xbfbd('0x40')](_0x18f5ac[_0xbfbd('0x3f')]);_0x473fc4[_0xbfbd('0x53')]=_['intersection'](_0x473fc4[_0xbfbd('0x3e')],_0x473fc4[_0xbfbd('0x3f')]);_0x462eef[_0xbfbd('0x42')]=_['intersection'](_0x473fc4[_0xbfbd('0x3e')],qs[_0xbfbd('0x43')](_0x18f5ac['query'][_0xbfbd('0x43')]));_0x462eef[_0xbfbd('0x42')]=_0x462eef[_0xbfbd('0x42')][_0xbfbd('0x44')]?_0x462eef['attributes']:_0x473fc4[_0xbfbd('0x3e')];if(_0x18f5ac[_0xbfbd('0x3f')][_0xbfbd('0x4d')]){_0x462eef[_0xbfbd('0x4e')]=[{'all':!![]}];}_0x462eef=_['merge']({},_0x462eef,_0x18f5ac[_0xbfbd('0x54')]);return db[_0xbfbd('0x4f')][_0xbfbd('0x55')](_0x462eef)[_0xbfbd('0x20')](handleEntityNotFound(_0x145cff,null))['then'](respondWithResult(_0x145cff,null))['catch'](handleError(_0x145cff,null));};exports[_0xbfbd('0x56')]=function(_0x256652,_0x664fcd){return db[_0xbfbd('0x4f')][_0xbfbd('0x56')](_0x256652[_0xbfbd('0x57')],{})[_0xbfbd('0x20')](respondWithResult(_0x664fcd,0xc9))[_0xbfbd('0x2a')](handleError(_0x664fcd,null));};exports[_0xbfbd('0x37')]=function(_0x4f60da,_0x30dfb0){if(_0x4f60da['body']['id']){delete _0x4f60da[_0xbfbd('0x57')]['id'];}return db[_0xbfbd('0x4f')]['find']({'where':{'id':_0x4f60da[_0xbfbd('0x52')]['id']}})[_0xbfbd('0x20')](handleEntityNotFound(_0x30dfb0,null))[_0xbfbd('0x20')](saveUpdates(_0x4f60da[_0xbfbd('0x57')],null))[_0xbfbd('0x20')](respondWithResult(_0x30dfb0,null))[_0xbfbd('0x2a')](handleError(_0x30dfb0,null));};exports[_0xbfbd('0x38')]=function(_0x4f6cec,_0x349287){return db[_0xbfbd('0x4f')][_0xbfbd('0x55')]({'where':{'id':_0x4f6cec[_0xbfbd('0x52')]['id']}})[_0xbfbd('0x20')](handleEntityNotFound(_0x349287,null))[_0xbfbd('0x20')](removeEntity(_0x349287,null))[_0xbfbd('0x2a')](handleError(_0x349287,null));};exports[_0xbfbd('0x58')]=function(_0x8fb02c,_0x2e539a,_0x5d6105){var _0x5405d1={};var _0x5b08e9={};var _0x537a95;var _0x15550b;return db[_0xbfbd('0x4f')][_0xbfbd('0x59')]({'where':{'id':_0x8fb02c[_0xbfbd('0x52')]['id']}})[_0xbfbd('0x20')](handleEntityNotFound(_0x2e539a,null))[_0xbfbd('0x20')](function(_0x2de5d1){if(_0x2de5d1){_0x537a95=_0x2de5d1;_0x5b08e9[_0xbfbd('0x3e')]=_[_0xbfbd('0x40')](db['SalesforceField'][_0xbfbd('0x5a')]);_0x5b08e9[_0xbfbd('0x3f')]=_[_0xbfbd('0x40')](_0x8fb02c[_0xbfbd('0x3f')]);_0x5b08e9[_0xbfbd('0x53')]=_[_0xbfbd('0x41')](_0x5b08e9[_0xbfbd('0x3e')],_0x5b08e9[_0xbfbd('0x3f')]);_0x5405d1[_0xbfbd('0x42')]=_[_0xbfbd('0x41')](_0x5b08e9['model'],qs[_0xbfbd('0x43')](_0x8fb02c[_0xbfbd('0x3f')][_0xbfbd('0x43')]));_0x5405d1[_0xbfbd('0x42')]=_0x5405d1[_0xbfbd('0x42')]['length']?_0x5405d1['attributes']:_0x5b08e9[_0xbfbd('0x3e')];_0x5405d1[_0xbfbd('0x46')]=qs[_0xbfbd('0x47')](_0x8fb02c[_0xbfbd('0x3f')]['sort']);_0x5405d1[_0xbfbd('0x48')]=qs[_0xbfbd('0x53')](_[_0xbfbd('0x5b')](_0x8fb02c['query'],_0x5b08e9[_0xbfbd('0x53')]));if(_0x8fb02c[_0xbfbd('0x3f')][_0xbfbd('0x49')]){_0x5405d1[_0xbfbd('0x48')]=_['merge'](_0x5405d1[_0xbfbd('0x48')],{'$or':_[_0xbfbd('0x3c')](_0x5405d1[_0xbfbd('0x42')],function(_0x2c18ea){var _0x253f23={};_0x253f23[_0x2c18ea]={'$like':'%'+_0x8fb02c[_0xbfbd('0x3f')][_0xbfbd('0x49')]+'%'};return _0x253f23;})});}_0x5405d1=_['merge']({},_0x5405d1,_0x8fb02c[_0xbfbd('0x54')]);return _0x537a95[_0xbfbd('0x58')](_0x5405d1);}})[_0xbfbd('0x20')](function(_0x333aa5){if(_0x333aa5){_0x15550b=_0x333aa5[_0xbfbd('0x44')];if(!_0x8fb02c[_0xbfbd('0x3f')][_0xbfbd('0x5c')](_0xbfbd('0x45'))){_0x5405d1['limit']=qs[_0xbfbd('0x30')](_0x8fb02c[_0xbfbd('0x3f')]['limit']);_0x5405d1['offset']=qs[_0xbfbd('0x2f')](_0x8fb02c[_0xbfbd('0x3f')]['offset']);}return _0x537a95[_0xbfbd('0x58')](_0x5405d1);}})[_0xbfbd('0x20')](function(_0x44380c){if(_0x44380c){return _0x44380c?{'count':_0x15550b,'rows':_0x44380c}:null;}})[_0xbfbd('0x20')](respondWithResult(_0x2e539a,null))['catch'](handleError(_0x2e539a,null));};exports['getSubjects']=function(_0x5ab3d1,_0x55508c,_0x1cea8a){var _0x2ab727={};var _0xb1ea48={};var _0x39c73b;var _0xdbcc3c;return db[_0xbfbd('0x4f')]['findOne']({'where':{'id':_0x5ab3d1['params']['id']}})['then'](handleEntityNotFound(_0x55508c,null))[_0xbfbd('0x20')](function(_0x46e80a){if(_0x46e80a){_0x39c73b=_0x46e80a;_0xb1ea48[_0xbfbd('0x3e')]=_['keys'](db[_0xbfbd('0x5d')][_0xbfbd('0x5a')]);_0xb1ea48['query']=_[_0xbfbd('0x40')](_0x5ab3d1[_0xbfbd('0x3f')]);_0xb1ea48[_0xbfbd('0x53')]=_[_0xbfbd('0x41')](_0xb1ea48[_0xbfbd('0x3e')],_0xb1ea48['query']);_0x2ab727[_0xbfbd('0x42')]=_[_0xbfbd('0x41')](_0xb1ea48['model'],qs[_0xbfbd('0x43')](_0x5ab3d1[_0xbfbd('0x3f')][_0xbfbd('0x43')]));_0x2ab727['attributes']=_0x2ab727['attributes'][_0xbfbd('0x44')]?_0x2ab727[_0xbfbd('0x42')]:_0xb1ea48['model'];_0x2ab727['order']=qs['sort'](_0x5ab3d1[_0xbfbd('0x3f')][_0xbfbd('0x47')]);_0x2ab727[_0xbfbd('0x48')]=qs['filters'](_[_0xbfbd('0x5b')](_0x5ab3d1[_0xbfbd('0x3f')],_0xb1ea48[_0xbfbd('0x53')]));if(_0x5ab3d1['query'][_0xbfbd('0x49')]){_0x2ab727[_0xbfbd('0x48')]=_[_0xbfbd('0x4a')](_0x2ab727[_0xbfbd('0x48')],{'$or':_[_0xbfbd('0x3c')](_0x2ab727['attributes'],function(_0xc63ebd){var _0x356e5c={};_0x356e5c[_0xc63ebd]={'$like':'%'+_0x5ab3d1[_0xbfbd('0x3f')][_0xbfbd('0x49')]+'%'};return _0x356e5c;})});}_0x2ab727=_[_0xbfbd('0x4a')]({},_0x2ab727,_0x5ab3d1['options']);return _0x39c73b[_0xbfbd('0x5e')](_0x2ab727);}})[_0xbfbd('0x20')](function(_0xe28a75){if(_0xe28a75){_0xdbcc3c=_0xe28a75[_0xbfbd('0x44')];if(!_0x5ab3d1['query'][_0xbfbd('0x5c')](_0xbfbd('0x45'))){_0x2ab727[_0xbfbd('0x30')]=qs['limit'](_0x5ab3d1[_0xbfbd('0x3f')][_0xbfbd('0x30')]);_0x2ab727[_0xbfbd('0x2f')]=qs['offset'](_0x5ab3d1['query']['offset']);}return _0x39c73b['getSubjects'](_0x2ab727);}})[_0xbfbd('0x20')](function(_0x5a479c){if(_0x5a479c){return _0x5a479c?{'count':_0xdbcc3c,'rows':_0x5a479c}:null;}})['then'](respondWithResult(_0x55508c,null))[_0xbfbd('0x2a')](handleError(_0x55508c,null));};exports['getDescriptions']=function(_0x92c919,_0x2a18ad,_0x502a1a){var _0x4b4c44={};var _0x49cb24={};var _0x446fc5;var _0x4ebcb3;return db['SalesforceConfiguration'][_0xbfbd('0x59')]({'where':{'id':_0x92c919[_0xbfbd('0x52')]['id']}})[_0xbfbd('0x20')](handleEntityNotFound(_0x2a18ad,null))['then'](function(_0x316eba){if(_0x316eba){_0x446fc5=_0x316eba;_0x49cb24[_0xbfbd('0x3e')]=_[_0xbfbd('0x40')](db[_0xbfbd('0x5d')][_0xbfbd('0x5a')]);_0x49cb24[_0xbfbd('0x3f')]=_[_0xbfbd('0x40')](_0x92c919[_0xbfbd('0x3f')]);_0x49cb24[_0xbfbd('0x53')]=_[_0xbfbd('0x41')](_0x49cb24['model'],_0x49cb24[_0xbfbd('0x3f')]);_0x4b4c44['attributes']=_['intersection'](_0x49cb24[_0xbfbd('0x3e')],qs[_0xbfbd('0x43')](_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x43')]));_0x4b4c44['attributes']=_0x4b4c44[_0xbfbd('0x42')][_0xbfbd('0x44')]?_0x4b4c44[_0xbfbd('0x42')]:_0x49cb24[_0xbfbd('0x3e')];_0x4b4c44[_0xbfbd('0x46')]=qs['sort'](_0x92c919['query'][_0xbfbd('0x47')]);_0x4b4c44[_0xbfbd('0x48')]=qs['filters'](_[_0xbfbd('0x5b')](_0x92c919['query'],_0x49cb24[_0xbfbd('0x53')]));if(_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x49')]){_0x4b4c44['where']=_[_0xbfbd('0x4a')](_0x4b4c44[_0xbfbd('0x48')],{'$or':_[_0xbfbd('0x3c')](_0x4b4c44[_0xbfbd('0x42')],function(_0x1eb844){var _0x3cbf29={};_0x3cbf29[_0x1eb844]={'$like':'%'+_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x49')]+'%'};return _0x3cbf29;})});}_0x4b4c44=_['merge']({},_0x4b4c44,_0x92c919[_0xbfbd('0x54')]);return _0x446fc5[_0xbfbd('0x5f')](_0x4b4c44);}})['then'](function(_0x43555e){if(_0x43555e){_0x4ebcb3=_0x43555e[_0xbfbd('0x44')];if(!_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x5c')]('nolimit')){_0x4b4c44[_0xbfbd('0x30')]=qs['limit'](_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x30')]);_0x4b4c44[_0xbfbd('0x2f')]=qs[_0xbfbd('0x2f')](_0x92c919[_0xbfbd('0x3f')][_0xbfbd('0x2f')]);}return _0x446fc5['getDescriptions'](_0x4b4c44);}})[_0xbfbd('0x20')](function(_0x3012eb){if(_0x3012eb){return _0x3012eb?{'count':_0x4ebcb3,'rows':_0x3012eb}:null;}})[_0xbfbd('0x20')](respondWithResult(_0x2a18ad,null))[_0xbfbd('0x2a')](handleError(_0x2a18ad,null));}; \ No newline at end of file +var _0x4036=['then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','end','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','catch','show','length','include','merge','find','body','params','findOne','SalesforceField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','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','http','test','Sequelize','ValidationError','request'];(function(_0x391c68,_0x293aeb){var _0x4ca007=function(_0x31af41){while(--_0x31af41){_0x391c68['push'](_0x391c68['shift']());}};_0x4ca007(++_0x293aeb);}(_0x4036,0x160));var _0x6403=function(_0xa9f272,_0x25ddd3){_0xa9f272=_0xa9f272-0x0;var _0x56494f=_0x4036[_0xa9f272];return _0x56494f;};'use strict';var pdf=require(_0x6403('0x0'));var emlformat=require(_0x6403('0x1'));var rimraf=require(_0x6403('0x2'));var zipdir=require(_0x6403('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6403('0x4'));var moment=require(_0x6403('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6403('0x6'));var util=require(_0x6403('0x7'));var path=require(_0x6403('0x8'));var sox=require(_0x6403('0x9'));var csv=require(_0x6403('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6403('0xb'));var crypto=require(_0x6403('0xc'));var jsforce=require(_0x6403('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6403('0xa'));var querystring=require('querystring');var Papa=require(_0x6403('0xe'));var Redis=require(_0x6403('0xf'));var authService=require(_0x6403('0x10'));var qs=require(_0x6403('0x11'));var as=require(_0x6403('0x12'));var hardwareService=require(_0x6403('0x13'));var logger=require(_0x6403('0x14'))(_0x6403('0x15'));var utils=require(_0x6403('0x16'));var config=require(_0x6403('0x17'));var db=require(_0x6403('0x18'))['db'];var jayson=require(_0x6403('0x19'));var client=jayson[_0x6403('0x1a')][_0x6403('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x51f85c,_0x980201,_0x494fe2){if(_0x494fe2){var _0x5e8800=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e8800[_0x6403('0x1c')](_0x980201)){return _0x51f85c;}else{throw new db[(_0x6403('0x1d'))][(_0x6403('0x1e'))]('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 _0x51f85c;}}function respondWithRpcPromise(_0x15a3ec,_0x3de973,_0x497b03,_0x42a72c){return new BPromise(function(_0x62b69b,_0x4b6bcc){var _0x415c0b=_0x42a72c||client;return _0x415c0b[_0x6403('0x1f')](_0x15a3ec,_0x497b03)[_0x6403('0x20')](function(_0x12e0c1){logger['info'](_0x6403('0x21'),_0x3de973,'request\x20sent');logger[_0x6403('0x22')](_0x6403('0x23'),_0x3de973,_0x6403('0x24'),JSON[_0x6403('0x25')](_0x12e0c1));if(_0x12e0c1[_0x6403('0x26')]){if(_0x12e0c1[_0x6403('0x26')][_0x6403('0x27')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3de973,_0x12e0c1[_0x6403('0x26')][_0x6403('0x28')]);return _0x4b6bcc(_0x12e0c1[_0x6403('0x26')][_0x6403('0x28')]);}logger[_0x6403('0x26')](_0x6403('0x21'),_0x3de973,_0x12e0c1[_0x6403('0x26')][_0x6403('0x28')]);return _0x62b69b(_0x12e0c1[_0x6403('0x26')][_0x6403('0x28')]);}else{logger[_0x6403('0x29')](_0x6403('0x21'),_0x3de973,'request\x20sent');_0x62b69b(_0x12e0c1[_0x6403('0x2a')][_0x6403('0x28')]);}})['catch'](function(_0xf7a308){logger[_0x6403('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3de973,_0xf7a308);_0x4b6bcc(_0xf7a308);});});}function respondWithStatusCode(_0x7fcda1,_0x486a1f){_0x486a1f=_0x486a1f||0xcc;return function(_0x954237){if(_0x954237){return _0x7fcda1[_0x6403('0x2b')](_0x486a1f);}return _0x7fcda1[_0x6403('0x2c')](_0x486a1f)['end']();};}function respondWithResult(_0x3c65b7,_0x5b1b9b){_0x5b1b9b=_0x5b1b9b||0xc8;return function(_0x4a983c){if(_0x4a983c){return _0x3c65b7[_0x6403('0x2c')](_0x5b1b9b)[_0x6403('0x2d')](_0x4a983c);}};}function respondWithFilteredResult(_0x15261e,_0x5066f9){return function(_0x5de2ee){if(_0x5de2ee){var _0x59fa08=_0x5de2ee[_0x6403('0x2e')],_0x42ab42=_0x5066f9['offset'],_0x4388e2=_0x5066f9[_0x6403('0x2f')]+_0x5066f9['limit'],_0x5f184c;if(_0x4388e2>=_0x59fa08){_0x4388e2=_0x59fa08;_0x5f184c=0xc8;}else{_0x5f184c=0xce;}_0x15261e[_0x6403('0x2c')](_0x5f184c);return _0x15261e[_0x6403('0x30')](_0x6403('0x31'),_0x42ab42+'-'+_0x4388e2+'/'+_0x59fa08)[_0x6403('0x2d')](_0x5de2ee);}return null;};}function patchUpdates(_0x417c19){return function(_0x209ef1){try{jsonpatch[_0x6403('0x32')](_0x209ef1,_0x417c19,!![]);}catch(_0x5e8145){return BPromise[_0x6403('0x33')](_0x5e8145);}return _0x209ef1['save']();};}function saveUpdates(_0x11cdde,_0x19d54e){return function(_0x5bdbc1){if(_0x5bdbc1){return _0x5bdbc1[_0x6403('0x34')](_0x11cdde)[_0x6403('0x20')](function(_0x4d472f){return _0x4d472f;});}return null;};}function removeEntity(_0x5e038e,_0x42a21b){return function(_0x19723e){if(_0x19723e){return _0x19723e[_0x6403('0x35')]()[_0x6403('0x20')](function(){_0x5e038e[_0x6403('0x2c')](0xcc)[_0x6403('0x36')]();});}};}function handleEntityNotFound(_0x3359f1,_0x319809){return function(_0x4de001){if(!_0x4de001){_0x3359f1['sendStatus'](0x194);}return _0x4de001;};}function handleError(_0x1c4c23,_0x32556e){_0x32556e=_0x32556e||0x1f4;return function(_0x5089a2){logger[_0x6403('0x26')](_0x5089a2[_0x6403('0x37')]);if(_0x5089a2['name']){delete _0x5089a2[_0x6403('0x38')];}_0x1c4c23['status'](_0x32556e)['send'](_0x5089a2);};}exports[_0x6403('0x39')]=function(_0x2a258b,_0x407884){var _0x46e56b={},_0x1fdca3={},_0x269642={'count':0x0,'rows':[]};var _0x4403ad=_[_0x6403('0x3a')](db[_0x6403('0x3b')][_0x6403('0x3c')],function(_0x459e10){return{'name':_0x459e10[_0x6403('0x3d')],'type':_0x459e10['type'][_0x6403('0x3e')]};});_0x1fdca3[_0x6403('0x3f')]=_[_0x6403('0x3a')](_0x4403ad,_0x6403('0x38'));_0x1fdca3[_0x6403('0x40')]=_[_0x6403('0x41')](_0x2a258b[_0x6403('0x40')]);_0x1fdca3[_0x6403('0x42')]=_[_0x6403('0x43')](_0x1fdca3['model'],_0x1fdca3[_0x6403('0x40')]);_0x46e56b['attributes']=_[_0x6403('0x43')](_0x1fdca3[_0x6403('0x3f')],qs[_0x6403('0x44')](_0x2a258b['query'][_0x6403('0x44')]));_0x46e56b[_0x6403('0x45')]=_0x46e56b[_0x6403('0x45')]['length']?_0x46e56b['attributes']:_0x1fdca3['model'];if(!_0x2a258b[_0x6403('0x40')][_0x6403('0x46')](_0x6403('0x47'))){_0x46e56b[_0x6403('0x48')]=qs[_0x6403('0x48')](_0x2a258b[_0x6403('0x40')]['limit']);_0x46e56b[_0x6403('0x2f')]=qs[_0x6403('0x2f')](_0x2a258b[_0x6403('0x40')][_0x6403('0x2f')]);}_0x46e56b[_0x6403('0x49')]=qs[_0x6403('0x4a')](_0x2a258b[_0x6403('0x40')][_0x6403('0x4a')]);_0x46e56b[_0x6403('0x4b')]=qs['filters'](_[_0x6403('0x4c')](_0x2a258b[_0x6403('0x40')],_0x1fdca3[_0x6403('0x42')]),_0x4403ad);if(_0x2a258b[_0x6403('0x40')][_0x6403('0x4d')]){_0x46e56b[_0x6403('0x4b')]=_['merge'](_0x46e56b['where'],{'$or':_['map'](_0x4403ad,function(_0x34e7c0){if(_0x34e7c0[_0x6403('0x4e')]!==_0x6403('0x4f')){var _0x4cfe97={};_0x4cfe97[_0x34e7c0['name']]={'$like':'%'+_0x2a258b['query']['filter']+'%'};return _0x4cfe97;}})});}_0x46e56b=_['merge']({},_0x46e56b,_0x2a258b[_0x6403('0x50')]);var _0x265317={'where':_0x46e56b[_0x6403('0x4b')]};return db[_0x6403('0x3b')]['count'](_0x265317)[_0x6403('0x20')](function(_0x75e5b6){_0x269642[_0x6403('0x2e')]=_0x75e5b6;if(_0x2a258b[_0x6403('0x40')][_0x6403('0x51')]){_0x46e56b['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x6403('0x52')](_0x46e56b);})[_0x6403('0x20')](function(_0x6f7be2){_0x269642['rows']=_0x6f7be2;return _0x269642;})['then'](respondWithFilteredResult(_0x407884,_0x46e56b))[_0x6403('0x53')](handleError(_0x407884,null));};exports[_0x6403('0x54')]=function(_0x550791,_0x285093){var _0x1399b7={'raw':![],'where':{'id':_0x550791['params']['id']}},_0x5133fb={};_0x5133fb['model']=_['keys'](db['SalesforceConfiguration'][_0x6403('0x3c')]);_0x5133fb[_0x6403('0x40')]=_[_0x6403('0x41')](_0x550791[_0x6403('0x40')]);_0x5133fb[_0x6403('0x42')]=_[_0x6403('0x43')](_0x5133fb[_0x6403('0x3f')],_0x5133fb['query']);_0x1399b7[_0x6403('0x45')]=_[_0x6403('0x43')](_0x5133fb['model'],qs['fields'](_0x550791['query'][_0x6403('0x44')]));_0x1399b7['attributes']=_0x1399b7[_0x6403('0x45')][_0x6403('0x55')]?_0x1399b7[_0x6403('0x45')]:_0x5133fb[_0x6403('0x3f')];if(_0x550791[_0x6403('0x40')][_0x6403('0x51')]){_0x1399b7[_0x6403('0x56')]=[{'all':!![]}];}_0x1399b7=_[_0x6403('0x57')]({},_0x1399b7,_0x550791['options']);return db['SalesforceConfiguration'][_0x6403('0x58')](_0x1399b7)[_0x6403('0x20')](handleEntityNotFound(_0x285093,null))[_0x6403('0x20')](respondWithResult(_0x285093,null))['catch'](handleError(_0x285093,null));};exports['create']=function(_0x1f88c1,_0x163a81){return db[_0x6403('0x3b')]['create'](_0x1f88c1[_0x6403('0x59')],{})[_0x6403('0x20')](respondWithResult(_0x163a81,0xc9))['catch'](handleError(_0x163a81,null));};exports[_0x6403('0x34')]=function(_0x18a221,_0x3d6e11){if(_0x18a221[_0x6403('0x59')]['id']){delete _0x18a221['body']['id'];}return db[_0x6403('0x3b')][_0x6403('0x58')]({'where':{'id':_0x18a221[_0x6403('0x5a')]['id']}})[_0x6403('0x20')](handleEntityNotFound(_0x3d6e11,null))[_0x6403('0x20')](saveUpdates(_0x18a221[_0x6403('0x59')],null))['then'](respondWithResult(_0x3d6e11,null))[_0x6403('0x53')](handleError(_0x3d6e11,null));};exports[_0x6403('0x35')]=function(_0x1d62cb,_0x2b7727){return db[_0x6403('0x3b')][_0x6403('0x58')]({'where':{'id':_0x1d62cb[_0x6403('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2b7727,null))[_0x6403('0x20')](removeEntity(_0x2b7727,null))['catch'](handleError(_0x2b7727,null));};exports['getFields']=function(_0x32682c,_0x2aa1c3,_0x1b68d3){var _0x57c1d0={};var _0x2aa6f7={};var _0x929b98;var _0x9898ed;return db['SalesforceConfiguration'][_0x6403('0x5b')]({'where':{'id':_0x32682c[_0x6403('0x5a')]['id']}})[_0x6403('0x20')](handleEntityNotFound(_0x2aa1c3,null))[_0x6403('0x20')](function(_0x8376ae){if(_0x8376ae){_0x929b98=_0x8376ae;_0x2aa6f7[_0x6403('0x3f')]=_['keys'](db[_0x6403('0x5c')][_0x6403('0x3c')]);_0x2aa6f7[_0x6403('0x40')]=_[_0x6403('0x41')](_0x32682c[_0x6403('0x40')]);_0x2aa6f7['filters']=_[_0x6403('0x43')](_0x2aa6f7[_0x6403('0x3f')],_0x2aa6f7[_0x6403('0x40')]);_0x57c1d0[_0x6403('0x45')]=_[_0x6403('0x43')](_0x2aa6f7[_0x6403('0x3f')],qs[_0x6403('0x44')](_0x32682c[_0x6403('0x40')][_0x6403('0x44')]));_0x57c1d0['attributes']=_0x57c1d0[_0x6403('0x45')][_0x6403('0x55')]?_0x57c1d0[_0x6403('0x45')]:_0x2aa6f7['model'];_0x57c1d0[_0x6403('0x49')]=qs[_0x6403('0x4a')](_0x32682c[_0x6403('0x40')][_0x6403('0x4a')]);_0x57c1d0[_0x6403('0x4b')]=qs[_0x6403('0x42')](_[_0x6403('0x4c')](_0x32682c[_0x6403('0x40')],_0x2aa6f7[_0x6403('0x42')]));if(_0x32682c['query'][_0x6403('0x4d')]){_0x57c1d0[_0x6403('0x4b')]=_[_0x6403('0x57')](_0x57c1d0[_0x6403('0x4b')],{'$or':_[_0x6403('0x3a')](_0x57c1d0[_0x6403('0x45')],function(_0x503b0f){var _0x3658e6={};_0x3658e6[_0x503b0f]={'$like':'%'+_0x32682c[_0x6403('0x40')][_0x6403('0x4d')]+'%'};return _0x3658e6;})});}_0x57c1d0=_[_0x6403('0x57')]({},_0x57c1d0,_0x32682c[_0x6403('0x50')]);return _0x929b98[_0x6403('0x5d')](_0x57c1d0);}})['then'](function(_0xb2f28b){if(_0xb2f28b){_0x9898ed=_0xb2f28b[_0x6403('0x55')];if(!_0x32682c[_0x6403('0x40')][_0x6403('0x46')](_0x6403('0x47'))){_0x57c1d0[_0x6403('0x48')]=qs[_0x6403('0x48')](_0x32682c[_0x6403('0x40')][_0x6403('0x48')]);_0x57c1d0['offset']=qs['offset'](_0x32682c[_0x6403('0x40')][_0x6403('0x2f')]);}return _0x929b98[_0x6403('0x5d')](_0x57c1d0);}})[_0x6403('0x20')](function(_0x28343a){if(_0x28343a){return _0x28343a?{'count':_0x9898ed,'rows':_0x28343a}:null;}})['then'](respondWithResult(_0x2aa1c3,null))[_0x6403('0x53')](handleError(_0x2aa1c3,null));};exports[_0x6403('0x5e')]=function(_0x4e1005,_0x5d99c2,_0x24b565){var _0x2cf878={};var _0x2452b6={};var _0x2feeb9;var _0x5487d3;return db[_0x6403('0x3b')][_0x6403('0x5b')]({'where':{'id':_0x4e1005[_0x6403('0x5a')]['id']}})[_0x6403('0x20')](handleEntityNotFound(_0x5d99c2,null))[_0x6403('0x20')](function(_0x303909){if(_0x303909){_0x2feeb9=_0x303909;_0x2452b6[_0x6403('0x3f')]=_[_0x6403('0x41')](db[_0x6403('0x5c')][_0x6403('0x3c')]);_0x2452b6[_0x6403('0x40')]=_[_0x6403('0x41')](_0x4e1005['query']);_0x2452b6[_0x6403('0x42')]=_[_0x6403('0x43')](_0x2452b6['model'],_0x2452b6[_0x6403('0x40')]);_0x2cf878[_0x6403('0x45')]=_['intersection'](_0x2452b6['model'],qs['fields'](_0x4e1005[_0x6403('0x40')][_0x6403('0x44')]));_0x2cf878[_0x6403('0x45')]=_0x2cf878['attributes'][_0x6403('0x55')]?_0x2cf878[_0x6403('0x45')]:_0x2452b6[_0x6403('0x3f')];_0x2cf878[_0x6403('0x49')]=qs[_0x6403('0x4a')](_0x4e1005['query'][_0x6403('0x4a')]);_0x2cf878['where']=qs[_0x6403('0x42')](_['pick'](_0x4e1005[_0x6403('0x40')],_0x2452b6[_0x6403('0x42')]));if(_0x4e1005[_0x6403('0x40')][_0x6403('0x4d')]){_0x2cf878[_0x6403('0x4b')]=_['merge'](_0x2cf878['where'],{'$or':_[_0x6403('0x3a')](_0x2cf878[_0x6403('0x45')],function(_0x383b21){var _0x18e37b={};_0x18e37b[_0x383b21]={'$like':'%'+_0x4e1005[_0x6403('0x40')][_0x6403('0x4d')]+'%'};return _0x18e37b;})});}_0x2cf878=_['merge']({},_0x2cf878,_0x4e1005['options']);return _0x2feeb9['getSubjects'](_0x2cf878);}})['then'](function(_0x4c437d){if(_0x4c437d){_0x5487d3=_0x4c437d['length'];if(!_0x4e1005[_0x6403('0x40')][_0x6403('0x46')](_0x6403('0x47'))){_0x2cf878[_0x6403('0x48')]=qs[_0x6403('0x48')](_0x4e1005[_0x6403('0x40')]['limit']);_0x2cf878[_0x6403('0x2f')]=qs[_0x6403('0x2f')](_0x4e1005[_0x6403('0x40')][_0x6403('0x2f')]);}return _0x2feeb9['getSubjects'](_0x2cf878);}})[_0x6403('0x20')](function(_0x39d684){if(_0x39d684){return _0x39d684?{'count':_0x5487d3,'rows':_0x39d684}:null;}})[_0x6403('0x20')](respondWithResult(_0x5d99c2,null))[_0x6403('0x53')](handleError(_0x5d99c2,null));};exports[_0x6403('0x5f')]=function(_0x1bd278,_0x3063f4,_0x5c81e7){var _0x3f8acd={};var _0x394c91={};var _0x3dd8bc;var _0x52d8e7;return db[_0x6403('0x3b')][_0x6403('0x5b')]({'where':{'id':_0x1bd278[_0x6403('0x5a')]['id']}})[_0x6403('0x20')](handleEntityNotFound(_0x3063f4,null))['then'](function(_0x6a25db){if(_0x6a25db){_0x3dd8bc=_0x6a25db;_0x394c91[_0x6403('0x3f')]=_[_0x6403('0x41')](db[_0x6403('0x5c')][_0x6403('0x3c')]);_0x394c91['query']=_[_0x6403('0x41')](_0x1bd278['query']);_0x394c91['filters']=_['intersection'](_0x394c91[_0x6403('0x3f')],_0x394c91[_0x6403('0x40')]);_0x3f8acd[_0x6403('0x45')]=_[_0x6403('0x43')](_0x394c91[_0x6403('0x3f')],qs[_0x6403('0x44')](_0x1bd278[_0x6403('0x40')]['fields']));_0x3f8acd[_0x6403('0x45')]=_0x3f8acd[_0x6403('0x45')][_0x6403('0x55')]?_0x3f8acd[_0x6403('0x45')]:_0x394c91[_0x6403('0x3f')];_0x3f8acd[_0x6403('0x49')]=qs['sort'](_0x1bd278['query'][_0x6403('0x4a')]);_0x3f8acd[_0x6403('0x4b')]=qs[_0x6403('0x42')](_[_0x6403('0x4c')](_0x1bd278['query'],_0x394c91['filters']));if(_0x1bd278[_0x6403('0x40')][_0x6403('0x4d')]){_0x3f8acd[_0x6403('0x4b')]=_[_0x6403('0x57')](_0x3f8acd[_0x6403('0x4b')],{'$or':_[_0x6403('0x3a')](_0x3f8acd[_0x6403('0x45')],function(_0x11a506){var _0x1de6bf={};_0x1de6bf[_0x11a506]={'$like':'%'+_0x1bd278[_0x6403('0x40')][_0x6403('0x4d')]+'%'};return _0x1de6bf;})});}_0x3f8acd=_[_0x6403('0x57')]({},_0x3f8acd,_0x1bd278['options']);return _0x3dd8bc[_0x6403('0x5f')](_0x3f8acd);}})[_0x6403('0x20')](function(_0x1149ee){if(_0x1149ee){_0x52d8e7=_0x1149ee['length'];if(!_0x1bd278['query'][_0x6403('0x46')](_0x6403('0x47'))){_0x3f8acd[_0x6403('0x48')]=qs['limit'](_0x1bd278['query']['limit']);_0x3f8acd[_0x6403('0x2f')]=qs[_0x6403('0x2f')](_0x1bd278[_0x6403('0x40')]['offset']);}return _0x3dd8bc[_0x6403('0x5f')](_0x3f8acd);}})['then'](function(_0x57ba93){if(_0x57ba93){return _0x57ba93?{'count':_0x52d8e7,'rows':_0x57ba93}:null;}})['then'](respondWithResult(_0x3063f4,null))[_0x6403('0x53')](handleError(_0x3063f4,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 579b573..2cb2990 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 _0xcfe4=['request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfe4,0x181));var _0x4cfe=function(_0x364f7e,_0x49cf4d){_0x364f7e=_0x364f7e-0x0;var _0x5e698b=_0xcfe4[_0x364f7e];return _0x5e698b;};'use strict';var _=require(_0x4cfe('0x0'));var util=require(_0x4cfe('0x1'));var logger=require('../../config/logger')(_0x4cfe('0x2'));var moment=require(_0x4cfe('0x3'));var BPromise=require(_0x4cfe('0x4'));var rp=require(_0x4cfe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cfe('0x6'));var config=require(_0x4cfe('0x7'));var attributes=require(_0x4cfe('0x8'));module[_0x4cfe('0x9')]=function(_0x16f281,_0x4b1ac7){return _0x16f281[_0x4cfe('0xa')](_0x4cfe('0xb'),attributes,{'tableName':_0x4cfe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5d=['request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee5d,0x17c));var _0xdee5=function(_0x135815,_0x1ebe87){_0x135815=_0x135815-0x0;var _0x4ce0b1=_0xee5d[_0x135815];return _0x4ce0b1;};'use strict';var _=require(_0xdee5('0x0'));var util=require(_0xdee5('0x1'));var logger=require(_0xdee5('0x2'))('api');var moment=require(_0xdee5('0x3'));var BPromise=require(_0xdee5('0x4'));var rp=require(_0xdee5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdee5('0x6'));var config=require(_0xdee5('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xdee5('0x8')]=function(_0x2ddd40,_0x3eec95){return _0x2ddd40[_0xdee5('0x9')](_0xdee5('0xa'),attributes,{'tableName':'int_salesforce_configurations','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 45cedd1..604570b 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 _0x0f99=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f99,0x16d));var _0x90f9=function(_0x5d7097,_0x1d914a){_0x5d7097=_0x5d7097-0x0;var _0x38d86e=_0x0f99[_0x5d7097];return _0x38d86e;};'use strict';var _=require(_0x90f9('0x0'));var util=require(_0x90f9('0x1'));var moment=require(_0x90f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90f9('0x3'))['db'];var utils=require(_0x90f9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x90f9('0x5'));var jayson=require(_0x90f9('0x6'));var client=jayson[_0x90f9('0x7')][_0x90f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x594d97,_0x448b56,_0x11a39c){return new BPromise(function(_0x2e0c15,_0x1af93c){return client[_0x90f9('0x9')](_0x594d97,_0x11a39c)[_0x90f9('0xa')](function(_0x44f109){logger[_0x90f9('0xb')](_0x90f9('0xc'),_0x448b56,'request\x20sent');logger[_0x90f9('0xd')](_0x90f9('0xe'),_0x448b56,'request\x20sent',JSON[_0x90f9('0xf')](_0x44f109));if(_0x44f109[_0x90f9('0x10')]){if(_0x44f109[_0x90f9('0x10')][_0x90f9('0x11')]===0x1f4){logger[_0x90f9('0x10')](_0x90f9('0xc'),_0x448b56,_0x44f109['error'][_0x90f9('0x12')]);return _0x1af93c(_0x44f109[_0x90f9('0x10')][_0x90f9('0x12')]);}logger[_0x90f9('0x10')](_0x90f9('0xc'),_0x448b56,_0x44f109['error'][_0x90f9('0x12')]);return _0x2e0c15(_0x44f109[_0x90f9('0x10')][_0x90f9('0x12')]);}else{logger[_0x90f9('0xb')](_0x90f9('0xc'),_0x448b56,_0x90f9('0x13'));_0x2e0c15(_0x44f109[_0x90f9('0x14')]['message']);}})['catch'](function(_0x402ff7){logger[_0x90f9('0x10')](_0x90f9('0xc'),_0x448b56,_0x402ff7);_0x1af93c(_0x402ff7);});});} \ No newline at end of file +var _0xa9fd=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9fd,0x98));var _0xda9f=function(_0x5ab426,_0x385346){_0x5ab426=_0x5ab426-0x0;var _0x2f3592=_0xa9fd[_0x5ab426];return _0x2f3592;};'use strict';var _=require(_0xda9f('0x0'));var util=require(_0xda9f('0x1'));var moment=require('moment');var BPromise=require(_0xda9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda9f('0x4'));var logger=require(_0xda9f('0x5'))(_0xda9f('0x6'));var config=require(_0xda9f('0x7'));var jayson=require(_0xda9f('0x8'));var client=jayson['client'][_0xda9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c4423,_0x11e7de,_0x132f8d){return new BPromise(function(_0x25be63,_0x36d6b9){return client[_0xda9f('0xa')](_0x2c4423,_0x132f8d)[_0xda9f('0xb')](function(_0x2382e6){logger[_0xda9f('0xc')](_0xda9f('0xd'),_0x11e7de,_0xda9f('0xe'));logger[_0xda9f('0xf')](_0xda9f('0x10'),_0x11e7de,'request\x20sent',JSON[_0xda9f('0x11')](_0x2382e6));if(_0x2382e6['error']){if(_0x2382e6['error'][_0xda9f('0x12')]===0x1f4){logger[_0xda9f('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x11e7de,_0x2382e6[_0xda9f('0x13')]['message']);return _0x36d6b9(_0x2382e6['error']['message']);}logger[_0xda9f('0x13')](_0xda9f('0xd'),_0x11e7de,_0x2382e6[_0xda9f('0x13')][_0xda9f('0x14')]);return _0x25be63(_0x2382e6[_0xda9f('0x13')]['message']);}else{logger[_0xda9f('0xc')](_0xda9f('0xd'),_0x11e7de,_0xda9f('0xe'));_0x25be63(_0x2382e6[_0xda9f('0x15')][_0xda9f('0x14')]);}})['catch'](function(_0x3de675){logger[_0xda9f('0x13')](_0xda9f('0xd'),_0x11e7de,_0x3de675);_0x36d6b9(_0x3de675);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 766d534..7657c1c 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 _0x2eb2=['/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x4fed95,_0x3447b4){var _0x2ff081=function(_0x402ee1){while(--_0x402ee1){_0x4fed95['push'](_0x4fed95['shift']());}};_0x2ff081(++_0x3447b4);}(_0x2eb2,0x19f));var _0x22eb=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2eb2[_0x28947d];return _0x12d2ee;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0xc')]('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller['update']);router[_0x22eb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x22eb('0x10')]);module['exports']=router; \ No newline at end of file +var _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x39748d,_0x575a79){var _0x234575=function(_0x481904){while(--_0x481904){_0x39748d['push'](_0x39748d['shift']());}};_0x234575(++_0x575a79);}(_0x038b,0x114));var _0xb038=function(_0x3ec9a2,_0x5a34e9){_0x3ec9a2=_0x3ec9a2-0x0;var _0x29ded8=_0x038b[_0x3ec9a2];return _0x29ded8;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./intSalesforceField.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9bc9473..b5cf210 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 _0x6ced=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0xbd32a2,_0x4d476f){var _0x2f0649=function(_0x22ea69){while(--_0x22ea69){_0xbd32a2['push'](_0xbd32a2['shift']());}};_0x2f0649(++_0x4d476f);}(_0x6ced,0x1d5));var _0xd6ce=function(_0x25c910,_0xd51274){_0x25c910=_0x25c910-0x0;var _0x4f14dc=_0x6ced[_0x25c910];return _0x4f14dc;};'use strict';var Sequelize=require(_0xd6ce('0x0'));module[_0xd6ce('0x1')]={'type':{'type':Sequelize[_0xd6ce('0x2')](_0xd6ce('0x3'),'variable',_0xd6ce('0x4'),_0xd6ce('0x5')),'defaultValue':_0xd6ce('0x3')},'content':{'type':Sequelize[_0xd6ce('0x6')]},'key':{'type':Sequelize[_0xd6ce('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd6ce('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd6ce('0x6')]},'idField':{'type':Sequelize[_0xd6ce('0x6')]},'variableName':{'type':Sequelize[_0xd6ce('0x6')]}}; \ No newline at end of file +var _0xb26c=['STRING','customVariable','sequelize','ENUM','variable','keyValue','string'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xb26c,0x11a));var _0xcb26=function(_0x206ce2,_0x2d674a){_0x206ce2=_0x206ce2-0x0;var _0x30801f=_0xb26c[_0x206ce2];return _0x30801f;};'use strict';var Sequelize=require(_0xcb26('0x0'));module['exports']={'type':{'type':Sequelize[_0xcb26('0x1')]('string',_0xcb26('0x2'),'customVariable',_0xcb26('0x3')),'defaultValue':_0xcb26('0x4')},'content':{'type':Sequelize[_0xcb26('0x5')]},'key':{'type':Sequelize[_0xcb26('0x5')]},'keyType':{'type':Sequelize[_0xcb26('0x1')](_0xcb26('0x4'),_0xcb26('0x2'),_0xcb26('0x6'))},'keyContent':{'type':Sequelize[_0xcb26('0x5')]},'idField':{'type':Sequelize[_0xcb26('0x5')]},'variableName':{'type':Sequelize[_0xcb26('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c1d74cf..6b2fa41 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 _0x4458=['moment','bluebird','util','path','sox','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','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','SalesforceField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x4458,0xdc));var _0x8445=function(_0x31b4b2,_0x5c679b){_0x31b4b2=_0x31b4b2-0x0;var _0x55fa7b=_0x4458[_0x31b4b2];return _0x55fa7b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8445('0x0'));var rimraf=require(_0x8445('0x1'));var zipdir=require(_0x8445('0x2'));var jsonpatch=require(_0x8445('0x3'));var rp=require(_0x8445('0x4'));var moment=require(_0x8445('0x5'));var BPromise=require(_0x8445('0x6'));var Mustache=require('mustache');var util=require(_0x8445('0x7'));var path=require(_0x8445('0x8'));var sox=require(_0x8445('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8445('0xa'));var squel=require(_0x8445('0xb'));var crypto=require(_0x8445('0xc'));var jsforce=require(_0x8445('0xd'));var deskjs=require(_0x8445('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8445('0xf'));var Papa=require(_0x8445('0x10'));var Redis=require(_0x8445('0x11'));var authService=require(_0x8445('0x12'));var qs=require(_0x8445('0x13'));var as=require(_0x8445('0x14'));var hardwareService=require(_0x8445('0x15'));var logger=require(_0x8445('0x16'))('api');var utils=require(_0x8445('0x17'));var config=require(_0x8445('0x18'));var db=require(_0x8445('0x19'))['db'];function respondWithStatusCode(_0x12aaef,_0x17d733){_0x17d733=_0x17d733||0xcc;return function(_0x266e27){if(_0x266e27){return _0x12aaef['sendStatus'](_0x17d733);}return _0x12aaef[_0x8445('0x1a')](_0x17d733)[_0x8445('0x1b')]();};}function respondWithResult(_0x478979,_0x60d955){_0x60d955=_0x60d955||0xc8;return function(_0x120303){if(_0x120303){return _0x478979[_0x8445('0x1a')](_0x60d955)[_0x8445('0x1c')](_0x120303);}};}function respondWithFilteredResult(_0x4578c7,_0x10b3de){return function(_0x1389ae){if(_0x1389ae){var _0x4bca7a=_0x1389ae[_0x8445('0x1d')],_0x4ff79a=_0x10b3de[_0x8445('0x1e')],_0x46a0c0=_0x10b3de[_0x8445('0x1e')]+_0x10b3de[_0x8445('0x1f')],_0x5fa761;if(_0x46a0c0>=_0x4bca7a){_0x46a0c0=_0x4bca7a;_0x5fa761=0xc8;}else{_0x5fa761=0xce;}_0x4578c7['status'](_0x5fa761);return _0x4578c7[_0x8445('0x20')]('Content-Range',_0x4ff79a+'-'+_0x46a0c0+'/'+_0x4bca7a)[_0x8445('0x1c')](_0x1389ae);}return null;};}function patchUpdates(_0x40efd3){return function(_0x2f4f09){try{jsonpatch[_0x8445('0x21')](_0x2f4f09,_0x40efd3,!![]);}catch(_0x18ef52){return BPromise[_0x8445('0x22')](_0x18ef52);}return _0x2f4f09[_0x8445('0x23')]();};}function saveUpdates(_0x3fa901,_0x2a9164){return function(_0x324d31){if(_0x324d31){return _0x324d31[_0x8445('0x24')](_0x3fa901)[_0x8445('0x25')](function(_0x49f269){return _0x49f269;});}return null;};}function removeEntity(_0x47d0ea,_0x1bba89){return function(_0x3ee7a3){if(_0x3ee7a3){return _0x3ee7a3[_0x8445('0x26')]()[_0x8445('0x25')](function(){_0x47d0ea['status'](0xcc)[_0x8445('0x1b')]();});}};}function handleEntityNotFound(_0x34997b,_0x3cffbb){return function(_0x4df301){if(!_0x4df301){_0x34997b[_0x8445('0x27')](0x194);}return _0x4df301;};}function handleError(_0x160c6a,_0x9146ff){_0x9146ff=_0x9146ff||0x1f4;return function(_0xb74739){logger[_0x8445('0x28')](_0xb74739[_0x8445('0x29')]);if(_0xb74739[_0x8445('0x2a')]){delete _0xb74739['name'];}_0x160c6a[_0x8445('0x1a')](_0x9146ff)[_0x8445('0x2b')](_0xb74739);};}exports['index']=function(_0x1c02f5,_0x7d3ffb){var _0x2e1b02={},_0x3e3618={},_0x202140={'count':0x0,'rows':[]};var _0x14987f=_['map'](db[_0x8445('0x2c')][_0x8445('0x2d')],function(_0x6d9865){return{'name':_0x6d9865[_0x8445('0x2e')],'type':_0x6d9865[_0x8445('0x2f')]['key']};});_0x3e3618[_0x8445('0x30')]=_[_0x8445('0x31')](_0x14987f,'name');_0x3e3618[_0x8445('0x32')]=_[_0x8445('0x33')](_0x1c02f5[_0x8445('0x32')]);_0x3e3618[_0x8445('0x34')]=_[_0x8445('0x35')](_0x3e3618[_0x8445('0x30')],_0x3e3618[_0x8445('0x32')]);_0x2e1b02[_0x8445('0x36')]=_['intersection'](_0x3e3618[_0x8445('0x30')],qs[_0x8445('0x37')](_0x1c02f5['query']['fields']));_0x2e1b02[_0x8445('0x36')]=_0x2e1b02[_0x8445('0x36')][_0x8445('0x38')]?_0x2e1b02[_0x8445('0x36')]:_0x3e3618[_0x8445('0x30')];if(!_0x1c02f5[_0x8445('0x32')][_0x8445('0x39')]('nolimit')){_0x2e1b02[_0x8445('0x1f')]=qs[_0x8445('0x1f')](_0x1c02f5[_0x8445('0x32')][_0x8445('0x1f')]);_0x2e1b02[_0x8445('0x1e')]=qs[_0x8445('0x1e')](_0x1c02f5['query']['offset']);}_0x2e1b02['order']=qs['sort'](_0x1c02f5['query'][_0x8445('0x3a')]);_0x2e1b02['where']=qs[_0x8445('0x34')](_[_0x8445('0x3b')](_0x1c02f5['query'],_0x3e3618['filters']),_0x14987f);if(_0x1c02f5[_0x8445('0x32')]['filter']){_0x2e1b02['where']=_['merge'](_0x2e1b02[_0x8445('0x3c')],{'$or':_['map'](_0x14987f,function(_0x1e3e0d){if(_0x1e3e0d[_0x8445('0x2f')]!==_0x8445('0x3d')){var _0x3e3c5d={};_0x3e3c5d[_0x1e3e0d['name']]={'$like':'%'+_0x1c02f5[_0x8445('0x32')][_0x8445('0x3e')]+'%'};return _0x3e3c5d;}})});}_0x2e1b02=_[_0x8445('0x3f')]({},_0x2e1b02,_0x1c02f5[_0x8445('0x40')]);var _0x137623={'where':_0x2e1b02['where']};return db['SalesforceField'][_0x8445('0x1d')](_0x137623)[_0x8445('0x25')](function(_0x5a374a){_0x202140['count']=_0x5a374a;if(_0x1c02f5[_0x8445('0x32')][_0x8445('0x41')]){_0x2e1b02[_0x8445('0x42')]=[{'all':!![]}];}return db['SalesforceField'][_0x8445('0x43')](_0x2e1b02);})[_0x8445('0x25')](function(_0x4a32ca){_0x202140[_0x8445('0x44')]=_0x4a32ca;return _0x202140;})['then'](respondWithFilteredResult(_0x7d3ffb,_0x2e1b02))['catch'](handleError(_0x7d3ffb,null));};exports[_0x8445('0x45')]=function(_0x5c43af,_0x42be3f){var _0x1b5d09={'raw':!![],'where':{'id':_0x5c43af[_0x8445('0x46')]['id']}},_0x511ee7={};_0x511ee7[_0x8445('0x30')]=_[_0x8445('0x33')](db[_0x8445('0x2c')][_0x8445('0x2d')]);_0x511ee7[_0x8445('0x32')]=_[_0x8445('0x33')](_0x5c43af[_0x8445('0x32')]);_0x511ee7[_0x8445('0x34')]=_[_0x8445('0x35')](_0x511ee7[_0x8445('0x30')],_0x511ee7[_0x8445('0x32')]);_0x1b5d09['attributes']=_[_0x8445('0x35')](_0x511ee7[_0x8445('0x30')],qs[_0x8445('0x37')](_0x5c43af['query']['fields']));_0x1b5d09[_0x8445('0x36')]=_0x1b5d09[_0x8445('0x36')]['length']?_0x1b5d09[_0x8445('0x36')]:_0x511ee7['model'];if(_0x5c43af[_0x8445('0x32')][_0x8445('0x41')]){_0x1b5d09[_0x8445('0x42')]=[{'all':!![]}];}_0x1b5d09=_[_0x8445('0x3f')]({},_0x1b5d09,_0x5c43af['options']);return db['SalesforceField'][_0x8445('0x47')](_0x1b5d09)[_0x8445('0x25')](handleEntityNotFound(_0x42be3f,null))[_0x8445('0x25')](respondWithResult(_0x42be3f,null))['catch'](handleError(_0x42be3f,null));};exports['create']=function(_0x51726e,_0x1dc102){return db[_0x8445('0x2c')][_0x8445('0x48')](_0x51726e[_0x8445('0x49')],{})[_0x8445('0x25')](respondWithResult(_0x1dc102,0xc9))[_0x8445('0x4a')](handleError(_0x1dc102,null));};exports[_0x8445('0x24')]=function(_0x8369b3,_0x4101b8){if(_0x8369b3[_0x8445('0x49')]['id']){delete _0x8369b3['body']['id'];}return db[_0x8445('0x2c')][_0x8445('0x47')]({'where':{'id':_0x8369b3[_0x8445('0x46')]['id']}})['then'](handleEntityNotFound(_0x4101b8,null))['then'](saveUpdates(_0x8369b3[_0x8445('0x49')],null))['then'](respondWithResult(_0x4101b8,null))[_0x8445('0x4a')](handleError(_0x4101b8,null));};exports[_0x8445('0x26')]=function(_0x231c41,_0xbae23d){return db[_0x8445('0x2c')][_0x8445('0x47')]({'where':{'id':_0x231c41[_0x8445('0x46')]['id']}})['then'](handleEntityNotFound(_0xbae23d,null))[_0x8445('0x25')](removeEntity(_0xbae23d,null))['catch'](handleError(_0xbae23d,null));}; \ No newline at end of file +var _0xdd34=['end','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','status'];(function(_0x380aa0,_0x421a5f){var _0x4fd55d=function(_0xfcde39){while(--_0xfcde39){_0x380aa0['push'](_0x380aa0['shift']());}};_0x4fd55d(++_0x421a5f);}(_0xdd34,0x1e5));var _0x4dd3=function(_0x34f13f,_0x379558){_0x34f13f=_0x34f13f-0x0;var _0x260789=_0xdd34[_0x34f13f];return _0x260789;};'use strict';var pdf=require(_0x4dd3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4dd3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4dd3('0x2'));var rp=require('request-promise');var moment=require(_0x4dd3('0x3'));var BPromise=require(_0x4dd3('0x4'));var Mustache=require(_0x4dd3('0x5'));var util=require('util');var path=require(_0x4dd3('0x6'));var sox=require('sox');var csv=require(_0x4dd3('0x7'));var ejs=require(_0x4dd3('0x8'));var fs=require('fs');var _=require(_0x4dd3('0x9'));var squel=require(_0x4dd3('0xa'));var crypto=require('crypto');var jsforce=require(_0x4dd3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4dd3('0x7'));var querystring=require(_0x4dd3('0xc'));var Papa=require(_0x4dd3('0xd'));var Redis=require('ioredis');var authService=require(_0x4dd3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4dd3('0xf'));var hardwareService=require(_0x4dd3('0x10'));var logger=require(_0x4dd3('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a308e,_0x1e34b9){_0x1e34b9=_0x1e34b9||0xcc;return function(_0x105a52){if(_0x105a52){return _0x2a308e['sendStatus'](_0x1e34b9);}return _0x2a308e[_0x4dd3('0x12')](_0x1e34b9)[_0x4dd3('0x13')]();};}function respondWithResult(_0x2c979f,_0x12511c){_0x12511c=_0x12511c||0xc8;return function(_0x30b944){if(_0x30b944){return _0x2c979f[_0x4dd3('0x12')](_0x12511c)[_0x4dd3('0x14')](_0x30b944);}};}function respondWithFilteredResult(_0x1958e6,_0x510c40){return function(_0x30fb78){if(_0x30fb78){var _0x17bd32=_0x30fb78[_0x4dd3('0x15')],_0x3a718b=_0x510c40['offset'],_0x16b376=_0x510c40[_0x4dd3('0x16')]+_0x510c40[_0x4dd3('0x17')],_0x5f59cb;if(_0x16b376>=_0x17bd32){_0x16b376=_0x17bd32;_0x5f59cb=0xc8;}else{_0x5f59cb=0xce;}_0x1958e6[_0x4dd3('0x12')](_0x5f59cb);return _0x1958e6[_0x4dd3('0x18')](_0x4dd3('0x19'),_0x3a718b+'-'+_0x16b376+'/'+_0x17bd32)[_0x4dd3('0x14')](_0x30fb78);}return null;};}function patchUpdates(_0x288eb2){return function(_0x34ca59){try{jsonpatch['apply'](_0x34ca59,_0x288eb2,!![]);}catch(_0x3c036c){return BPromise[_0x4dd3('0x1a')](_0x3c036c);}return _0x34ca59['save']();};}function saveUpdates(_0x20bebc,_0x3182cb){return function(_0x1fe538){if(_0x1fe538){return _0x1fe538['update'](_0x20bebc)[_0x4dd3('0x1b')](function(_0x222bdb){return _0x222bdb;});}return null;};}function removeEntity(_0x508ff4,_0x7acfda){return function(_0x2f7e23){if(_0x2f7e23){return _0x2f7e23['destroy']()[_0x4dd3('0x1b')](function(){_0x508ff4['status'](0xcc)[_0x4dd3('0x13')]();});}};}function handleEntityNotFound(_0x37da68,_0xf2a628){return function(_0x3fa045){if(!_0x3fa045){_0x37da68['sendStatus'](0x194);}return _0x3fa045;};}function handleError(_0x53ccb0,_0x12c111){_0x12c111=_0x12c111||0x1f4;return function(_0x1cc327){logger[_0x4dd3('0x1c')](_0x1cc327[_0x4dd3('0x1d')]);if(_0x1cc327['name']){delete _0x1cc327[_0x4dd3('0x1e')];}_0x53ccb0[_0x4dd3('0x12')](_0x12c111)[_0x4dd3('0x1f')](_0x1cc327);};}exports[_0x4dd3('0x20')]=function(_0x139f3b,_0x3eb392){var _0x175c86={},_0x40537c={},_0x21fac8={'count':0x0,'rows':[]};var _0x48e81b=_[_0x4dd3('0x21')](db[_0x4dd3('0x22')]['rawAttributes'],function(_0x36f29e){return{'name':_0x36f29e[_0x4dd3('0x23')],'type':_0x36f29e[_0x4dd3('0x24')][_0x4dd3('0x25')]};});_0x40537c[_0x4dd3('0x26')]=_['map'](_0x48e81b,_0x4dd3('0x1e'));_0x40537c['query']=_[_0x4dd3('0x27')](_0x139f3b[_0x4dd3('0x28')]);_0x40537c[_0x4dd3('0x29')]=_[_0x4dd3('0x2a')](_0x40537c['model'],_0x40537c[_0x4dd3('0x28')]);_0x175c86[_0x4dd3('0x2b')]=_[_0x4dd3('0x2a')](_0x40537c['model'],qs[_0x4dd3('0x2c')](_0x139f3b[_0x4dd3('0x28')][_0x4dd3('0x2c')]));_0x175c86[_0x4dd3('0x2b')]=_0x175c86[_0x4dd3('0x2b')][_0x4dd3('0x2d')]?_0x175c86[_0x4dd3('0x2b')]:_0x40537c[_0x4dd3('0x26')];if(!_0x139f3b[_0x4dd3('0x28')]['hasOwnProperty'](_0x4dd3('0x2e'))){_0x175c86[_0x4dd3('0x17')]=qs[_0x4dd3('0x17')](_0x139f3b[_0x4dd3('0x28')][_0x4dd3('0x17')]);_0x175c86[_0x4dd3('0x16')]=qs['offset'](_0x139f3b[_0x4dd3('0x28')]['offset']);}_0x175c86['order']=qs['sort'](_0x139f3b['query'][_0x4dd3('0x2f')]);_0x175c86[_0x4dd3('0x30')]=qs[_0x4dd3('0x29')](_[_0x4dd3('0x31')](_0x139f3b['query'],_0x40537c['filters']),_0x48e81b);if(_0x139f3b[_0x4dd3('0x28')][_0x4dd3('0x32')]){_0x175c86[_0x4dd3('0x30')]=_[_0x4dd3('0x33')](_0x175c86[_0x4dd3('0x30')],{'$or':_['map'](_0x48e81b,function(_0x5e532f){if(_0x5e532f['type']!==_0x4dd3('0x34')){var _0x12437f={};_0x12437f[_0x5e532f[_0x4dd3('0x1e')]]={'$like':'%'+_0x139f3b[_0x4dd3('0x28')][_0x4dd3('0x32')]+'%'};return _0x12437f;}})});}_0x175c86=_[_0x4dd3('0x33')]({},_0x175c86,_0x139f3b[_0x4dd3('0x35')]);var _0x4cb487={'where':_0x175c86['where']};return db[_0x4dd3('0x22')][_0x4dd3('0x15')](_0x4cb487)[_0x4dd3('0x1b')](function(_0x12a3f){_0x21fac8[_0x4dd3('0x15')]=_0x12a3f;if(_0x139f3b[_0x4dd3('0x28')][_0x4dd3('0x36')]){_0x175c86[_0x4dd3('0x37')]=[{'all':!![]}];}return db[_0x4dd3('0x22')]['findAll'](_0x175c86);})['then'](function(_0x418b0b){_0x21fac8[_0x4dd3('0x38')]=_0x418b0b;return _0x21fac8;})['then'](respondWithFilteredResult(_0x3eb392,_0x175c86))[_0x4dd3('0x39')](handleError(_0x3eb392,null));};exports['show']=function(_0x331ffd,_0x326c09){var _0xd1d7a1={'raw':!![],'where':{'id':_0x331ffd[_0x4dd3('0x3a')]['id']}},_0x28d4a7={};_0x28d4a7[_0x4dd3('0x26')]=_[_0x4dd3('0x27')](db[_0x4dd3('0x22')][_0x4dd3('0x3b')]);_0x28d4a7[_0x4dd3('0x28')]=_[_0x4dd3('0x27')](_0x331ffd[_0x4dd3('0x28')]);_0x28d4a7[_0x4dd3('0x29')]=_['intersection'](_0x28d4a7['model'],_0x28d4a7[_0x4dd3('0x28')]);_0xd1d7a1[_0x4dd3('0x2b')]=_[_0x4dd3('0x2a')](_0x28d4a7[_0x4dd3('0x26')],qs[_0x4dd3('0x2c')](_0x331ffd[_0x4dd3('0x28')][_0x4dd3('0x2c')]));_0xd1d7a1['attributes']=_0xd1d7a1[_0x4dd3('0x2b')][_0x4dd3('0x2d')]?_0xd1d7a1[_0x4dd3('0x2b')]:_0x28d4a7['model'];if(_0x331ffd[_0x4dd3('0x28')][_0x4dd3('0x36')]){_0xd1d7a1['include']=[{'all':!![]}];}_0xd1d7a1=_[_0x4dd3('0x33')]({},_0xd1d7a1,_0x331ffd[_0x4dd3('0x35')]);return db['SalesforceField'][_0x4dd3('0x3c')](_0xd1d7a1)[_0x4dd3('0x1b')](handleEntityNotFound(_0x326c09,null))[_0x4dd3('0x1b')](respondWithResult(_0x326c09,null))['catch'](handleError(_0x326c09,null));};exports[_0x4dd3('0x3d')]=function(_0x1ab1db,_0x2e3a60){return db[_0x4dd3('0x22')][_0x4dd3('0x3d')](_0x1ab1db[_0x4dd3('0x3e')],{})['then'](respondWithResult(_0x2e3a60,0xc9))['catch'](handleError(_0x2e3a60,null));};exports['update']=function(_0xf99a7a,_0x38184f){if(_0xf99a7a[_0x4dd3('0x3e')]['id']){delete _0xf99a7a[_0x4dd3('0x3e')]['id'];}return db[_0x4dd3('0x22')][_0x4dd3('0x3c')]({'where':{'id':_0xf99a7a['params']['id']}})[_0x4dd3('0x1b')](handleEntityNotFound(_0x38184f,null))['then'](saveUpdates(_0xf99a7a[_0x4dd3('0x3e')],null))[_0x4dd3('0x1b')](respondWithResult(_0x38184f,null))[_0x4dd3('0x39')](handleError(_0x38184f,null));};exports['destroy']=function(_0x4c3e4d,_0x4e6cd0){return db['SalesforceField'][_0x4dd3('0x3c')]({'where':{'id':_0x4c3e4d[_0x4dd3('0x3a')]['id']}})[_0x4dd3('0x1b')](handleEntityNotFound(_0x4e6cd0,null))['then'](removeEntity(_0x4e6cd0,null))['catch'](handleError(_0x4e6cd0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a406dda..56d2f23 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 _0xcedf=['api','path','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0xf24612,_0x288e25){var _0x3388ee=function(_0x97ed23){while(--_0x97ed23){_0xf24612['push'](_0xf24612['shift']());}};_0x3388ee(++_0x288e25);}(_0xcedf,0x8c));var _0xfced=function(_0x4ab7db,_0x3f7eb0){_0x4ab7db=_0x4ab7db-0x0;var _0x10a87c=_0xcedf[_0x4ab7db];return _0x10a87c;};'use strict';var _=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var logger=require(_0xfced('0x2'))(_0xfced('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfced('0x4'));var rimraf=require('rimraf');var config=require(_0xfced('0x5'));var attributes=require(_0xfced('0x6'));module[_0xfced('0x7')]=function(_0x5a8a87,_0x43768e){return _0x5a8a87['define'](_0xfced('0x8'),attributes,{'tableName':_0xfced('0x9'),'paranoid':![],'indexes':[{'name':_0xfced('0xa'),'fields':[_0xfced('0xb'),_0xfced('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8716=['./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','FieldId','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x8716,0x165));var _0x6871=function(_0x1be834,_0x3665dc){_0x1be834=_0x1be834-0x0;var _0x2383af=_0x8716[_0x1be834];return _0x2383af;};'use strict';var _=require('lodash');var util=require(_0x6871('0x0'));var logger=require(_0x6871('0x1'))(_0x6871('0x2'));var moment=require(_0x6871('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6871('0x4'));var rimraf=require(_0x6871('0x5'));var config=require(_0x6871('0x6'));var attributes=require(_0x6871('0x7'));module[_0x6871('0x8')]=function(_0x5c4054,_0x2f89bf){return _0x5c4054[_0x6871('0x9')]('SalesforceField',attributes,{'tableName':_0x6871('0xa'),'paranoid':![],'indexes':[{'name':_0x6871('0xb'),'fields':['idField',_0x6871('0xc')],'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 8babb3f..8b81a48 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 _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(_0x19f32f,_0x3ee0b2){var _0xb28978=function(_0x1e18f2){while(--_0x1e18f2){_0x19f32f['push'](_0x19f32f['shift']());}};_0xb28978(++_0x3ee0b2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b8fa9,_0x2e335c){_0x5b8fa9=_0x5b8fa9-0x0;var _0x20a1d5=_0x9bde[_0x5b8fa9];return _0x20a1d5;};'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 +var _0x0713=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d7439,_0x39e962){var _0x549357=function(_0x5454f7){while(--_0x5454f7){_0x2d7439['push'](_0x2d7439['shift']());}};_0x549357(++_0x39e962);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 39d7551..2a2d9a1 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 _0x1928=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','put','update','delete','destroy','exports'];(function(_0x4256b3,_0x4cf9fd){var _0x3ccaa1=function(_0x447881){while(--_0x447881){_0x4256b3['push'](_0x4256b3['shift']());}};_0x3ccaa1(++_0x4cf9fd);}(_0x1928,0x138));var _0x8192=function(_0x3b8373,_0x5d40de){_0x3b8373=_0x3b8373-0x0;var _0x5df40c=_0x1928[_0x3b8373];return _0x5df40c;};'use strict';var multer=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var path=require(_0x8192('0x2'));var timeout=require('connect-timeout');var express=require(_0x8192('0x3'));var router=express[_0x8192('0x4')]();var auth=require(_0x8192('0x5'));var interaction=require(_0x8192('0x6'));var config=require(_0x8192('0x7'));var controller=require(_0x8192('0x8'));router[_0x8192('0x9')]('/',auth[_0x8192('0xa')](),controller[_0x8192('0xb')]);router[_0x8192('0x9')](_0x8192('0xc'),auth[_0x8192('0xa')](),controller[_0x8192('0xd')]);router[_0x8192('0x9')]('/:id/configurations',auth[_0x8192('0xa')](),controller['getConfigurations']);router[_0x8192('0x9')](_0x8192('0xe'),auth[_0x8192('0xa')](),controller[_0x8192('0xf')]);router['post']('/',auth[_0x8192('0xa')](),controller[_0x8192('0x10')]);router[_0x8192('0x11')](_0x8192('0x12'),auth[_0x8192('0xa')](),controller['addConfiguration']);router[_0x8192('0x13')](_0x8192('0xc'),auth[_0x8192('0xa')](),controller[_0x8192('0x14')]);router[_0x8192('0x15')](_0x8192('0xc'),auth[_0x8192('0xa')](),controller[_0x8192('0x16')]);module[_0x8192('0x17')]=router; \ No newline at end of file +var _0xff98=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xff98,0x9c));var _0x8ff9=function(_0x37a710,_0x1f94bc){_0x37a710=_0x37a710-0x0;var _0x400e5f=_0xff98[_0x37a710];return _0x400e5f;};'use strict';var multer=require('multer');var util=require(_0x8ff9('0x0'));var path=require(_0x8ff9('0x1'));var timeout=require(_0x8ff9('0x2'));var express=require(_0x8ff9('0x3'));var router=express['Router']();var auth=require(_0x8ff9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8ff9('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x8ff9('0x6')]('/',auth['isAuthenticated'](),controller[_0x8ff9('0x7')]);router[_0x8ff9('0x6')](_0x8ff9('0x8'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xa')]);router[_0x8ff9('0x6')](_0x8ff9('0xb'),auth[_0x8ff9('0x9')](),controller['getConfigurations']);router[_0x8ff9('0x6')](_0x8ff9('0xc'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xd')]);router[_0x8ff9('0xe')]('/',auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x8ff9('0x10')]);router[_0x8ff9('0x11')](_0x8ff9('0x8'),auth['isAuthenticated'](),controller[_0x8ff9('0x12')]);router[_0x8ff9('0x13')](_0x8ff9('0x8'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0x14')]);module[_0x8ff9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index efdfec0..295ccf2 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 _0x2ed5=['sequelize','exports','STRING','username'];(function(_0x8fce91,_0x5ecbc4){var _0x821764=function(_0x444d1b){while(--_0x444d1b){_0x8fce91['push'](_0x8fce91['shift']());}};_0x821764(++_0x5ecbc4);}(_0x2ed5,0x110));var _0x52ed=function(_0x4db3f7,_0x2ce20a){_0x4db3f7=_0x4db3f7-0x0;var _0x48f720=_0x2ed5[_0x4db3f7];return _0x48f720;};'use strict';var Sequelize=require(_0x52ed('0x0'));module[_0x52ed('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x52ed('0x2')],'unique':_0x52ed('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x52ed('0x2')]},'remoteUri':{'type':Sequelize[_0x52ed('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x52ed('0x2')]}}; \ No newline at end of file +var _0x639e=['STRING','username'];(function(_0x110499,_0x235bcd){var _0x1bbca6=function(_0x5686ab){while(--_0x5686ab){_0x110499['push'](_0x110499['shift']());}};_0x1bbca6(++_0x235bcd);}(_0x639e,0x1ca));var _0xe639=function(_0x1286d5,_0x5c2870){_0x1286d5=_0x1286d5-0x0;var _0x1e06b0=_0x639e[_0x1286d5];return _0x1e06b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe639('0x0')]},'description':{'type':Sequelize[_0xe639('0x0')]},'username':{'type':Sequelize[_0xe639('0x0')],'unique':_0xe639('0x1')},'password':{'type':Sequelize[_0xe639('0x0')]},'email':{'type':Sequelize[_0xe639('0x0')]},'remoteUri':{'type':Sequelize[_0xe639('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe639('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8c59e99..8fc4f18 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 _0x5ec3=['info','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','work_notes','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','incident\x20table\x20objects','assign','includes','internalType','label','all','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','push','concat','send','Wrong\x20credentials','statusCode','True','true','inactive','false','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','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','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message'];(function(_0x2ff88b,_0x559d50){var _0x52bca0=function(_0x395b40){while(--_0x395b40){_0x2ff88b['push'](_0x2ff88b['shift']());}};_0x52bca0(++_0x559d50);}(_0x5ec3,0xa1));var _0x35ec=function(_0x3fa604,_0x4e9e1d){_0x3fa604=_0x3fa604-0x0;var _0x2de423=_0x5ec3[_0x3fa604];return _0x2de423;};'use strict';var pdf=require(_0x35ec('0x0'));var emlformat=require(_0x35ec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35ec('0x2'));var jsonpatch=require(_0x35ec('0x3'));var rp=require(_0x35ec('0x4'));var moment=require(_0x35ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35ec('0x6'));var util=require(_0x35ec('0x7'));var path=require(_0x35ec('0x8'));var sox=require(_0x35ec('0x9'));var csv=require(_0x35ec('0xa'));var ejs=require(_0x35ec('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x35ec('0xc'));var crypto=require(_0x35ec('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x35ec('0xe'));var toCsv=require(_0x35ec('0xa'));var querystring=require(_0x35ec('0xf'));var Papa=require(_0x35ec('0x10'));var Redis=require(_0x35ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35ec('0x12'));var as=require(_0x35ec('0x13'));var hardwareService=require(_0x35ec('0x14'));var logger=require(_0x35ec('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ec('0x16'));var db=require(_0x35ec('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x188b72,_0x87424f,_0x27f067){if(_0x27f067){var _0x376217=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x376217[_0x35ec('0x18')](_0x87424f)){return _0x188b72;}else{throw new db[(_0x35ec('0x19'))][(_0x35ec('0x1a'))](_0x35ec('0x1b'));}}else{return _0x188b72;}}function respondWithRpcPromise(_0x2d3bcb,_0x3a239d,_0x8632c7,_0x201209){return new BPromise(function(_0x444560,_0x242bab){var _0x427fdd=_0x201209||client;return _0x427fdd['request'](_0x2d3bcb,_0x8632c7)[_0x35ec('0x1c')](function(_0x1612e6){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3a239d,_0x35ec('0x1d'));logger[_0x35ec('0x1e')](_0x35ec('0x1f'),_0x3a239d,'request\x20sent',JSON[_0x35ec('0x20')](_0x1612e6));if(_0x1612e6[_0x35ec('0x21')]){if(_0x1612e6[_0x35ec('0x21')][_0x35ec('0x22')]===0x1f4){logger[_0x35ec('0x21')](_0x35ec('0x23'),_0x3a239d,_0x1612e6[_0x35ec('0x21')][_0x35ec('0x24')]);return _0x242bab(_0x1612e6[_0x35ec('0x21')][_0x35ec('0x24')]);}logger[_0x35ec('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x3a239d,_0x1612e6[_0x35ec('0x21')][_0x35ec('0x24')]);return _0x444560(_0x1612e6['error'][_0x35ec('0x24')]);}else{logger[_0x35ec('0x25')](_0x35ec('0x23'),_0x3a239d,'request\x20sent');_0x444560(_0x1612e6[_0x35ec('0x26')]['message']);}})[_0x35ec('0x27')](function(_0x32324d){logger[_0x35ec('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x3a239d,_0x32324d);_0x242bab(_0x32324d);});});}function respondWithStatusCode(_0x4d39df,_0x740d21){_0x740d21=_0x740d21||0xcc;return function(_0x2ff471){if(_0x2ff471){return _0x4d39df[_0x35ec('0x28')](_0x740d21);}return _0x4d39df[_0x35ec('0x29')](_0x740d21)[_0x35ec('0x2a')]();};}function respondWithResult(_0x322d51,_0x541b03){_0x541b03=_0x541b03||0xc8;return function(_0x3c0dc9){if(_0x3c0dc9){return _0x322d51[_0x35ec('0x29')](_0x541b03)['json'](_0x3c0dc9);}};}function respondWithFilteredResult(_0xe88cee,_0x173982){return function(_0x34474e){if(_0x34474e){var _0x271cf1=_0x34474e[_0x35ec('0x2b')],_0x34b61b=_0x173982['offset'],_0x444d90=_0x173982[_0x35ec('0x2c')]+_0x173982[_0x35ec('0x2d')],_0x22eba9;if(_0x444d90>=_0x271cf1){_0x444d90=_0x271cf1;_0x22eba9=0xc8;}else{_0x22eba9=0xce;}_0xe88cee[_0x35ec('0x29')](_0x22eba9);return _0xe88cee[_0x35ec('0x2e')](_0x35ec('0x2f'),_0x34b61b+'-'+_0x444d90+'/'+_0x271cf1)[_0x35ec('0x30')](_0x34474e);}return null;};}function patchUpdates(_0x59b7f5){return function(_0x584649){try{jsonpatch[_0x35ec('0x31')](_0x584649,_0x59b7f5,!![]);}catch(_0x348fc1){return BPromise[_0x35ec('0x32')](_0x348fc1);}return _0x584649[_0x35ec('0x33')]();};}function saveUpdates(_0x393981,_0x9e48f5){return function(_0x72031){if(_0x72031){return _0x72031[_0x35ec('0x34')](_0x393981)[_0x35ec('0x1c')](function(_0x4679d0){return _0x4679d0;});}return null;};}function removeEntity(_0x1e6984,_0xc93638){return function(_0x84b87f){if(_0x84b87f){return _0x84b87f[_0x35ec('0x35')]()[_0x35ec('0x1c')](function(){_0x1e6984['status'](0xcc)[_0x35ec('0x2a')]();});}};}function handleEntityNotFound(_0x2bb39d,_0x52b78d){return function(_0x18d0e7){if(!_0x18d0e7){_0x2bb39d[_0x35ec('0x28')](0x194);}return _0x18d0e7;};}function handleError(_0x111e4b,_0x3e3a82){_0x3e3a82=_0x3e3a82||0x1f4;return function(_0x58da42){logger[_0x35ec('0x21')](_0x58da42[_0x35ec('0x36')]);if(_0x58da42['name']){delete _0x58da42['name'];}_0x111e4b[_0x35ec('0x29')](_0x3e3a82)['send'](_0x58da42);};}exports[_0x35ec('0x37')]=function(_0x21a75c,_0x5c7ca7){var _0x3e47cc={},_0x3d63fb={},_0x412a14={'count':0x0,'rows':[]};var _0x120311=_[_0x35ec('0x38')](db[_0x35ec('0x39')][_0x35ec('0x3a')],function(_0x5c5c75){return{'name':_0x5c5c75[_0x35ec('0x3b')],'type':_0x5c5c75[_0x35ec('0x3c')][_0x35ec('0x3d')]};});_0x3d63fb['model']=_['map'](_0x120311,_0x35ec('0x3e'));_0x3d63fb[_0x35ec('0x3f')]=_[_0x35ec('0x40')](_0x21a75c[_0x35ec('0x3f')]);_0x3d63fb['filters']=_[_0x35ec('0x41')](_0x3d63fb[_0x35ec('0x42')],_0x3d63fb[_0x35ec('0x3f')]);_0x3e47cc['attributes']=_[_0x35ec('0x41')](_0x3d63fb[_0x35ec('0x42')],qs[_0x35ec('0x43')](_0x21a75c['query'][_0x35ec('0x43')]));_0x3e47cc['attributes']=_0x3e47cc[_0x35ec('0x44')][_0x35ec('0x45')]?_0x3e47cc[_0x35ec('0x44')]:_0x3d63fb[_0x35ec('0x42')];if(!_0x21a75c[_0x35ec('0x3f')]['hasOwnProperty'](_0x35ec('0x46'))){_0x3e47cc['limit']=qs[_0x35ec('0x2d')](_0x21a75c[_0x35ec('0x3f')][_0x35ec('0x2d')]);_0x3e47cc[_0x35ec('0x2c')]=qs[_0x35ec('0x2c')](_0x21a75c['query'][_0x35ec('0x2c')]);}_0x3e47cc[_0x35ec('0x47')]=qs[_0x35ec('0x48')](_0x21a75c[_0x35ec('0x3f')][_0x35ec('0x48')]);_0x3e47cc[_0x35ec('0x49')]=qs[_0x35ec('0x4a')](_[_0x35ec('0x4b')](_0x21a75c[_0x35ec('0x3f')],_0x3d63fb[_0x35ec('0x4a')]),_0x120311);if(_0x21a75c[_0x35ec('0x3f')]['filter']){_0x3e47cc[_0x35ec('0x49')]=_[_0x35ec('0x4c')](_0x3e47cc[_0x35ec('0x49')],{'$or':_[_0x35ec('0x38')](_0x120311,function(_0x14d90c){if(_0x14d90c[_0x35ec('0x3c')]!=='VIRTUAL'){var _0x2c4d03={};_0x2c4d03[_0x14d90c['name']]={'$like':'%'+_0x21a75c['query']['filter']+'%'};return _0x2c4d03;}})});}_0x3e47cc=_['merge']({},_0x3e47cc,_0x21a75c[_0x35ec('0x4d')]);var _0x34ae58={'where':_0x3e47cc[_0x35ec('0x49')]};return db[_0x35ec('0x39')][_0x35ec('0x2b')](_0x34ae58)[_0x35ec('0x1c')](function(_0x2f271d){_0x412a14[_0x35ec('0x2b')]=_0x2f271d;if(_0x21a75c['query'][_0x35ec('0x4e')]){_0x3e47cc['include']=[{'all':!![]}];}return db[_0x35ec('0x39')]['findAll'](_0x3e47cc);})[_0x35ec('0x1c')](function(_0x3135cc){_0x412a14['rows']=_0x3135cc;return _0x412a14;})[_0x35ec('0x1c')](respondWithFilteredResult(_0x5c7ca7,_0x3e47cc))['catch'](handleError(_0x5c7ca7,null));};exports['show']=function(_0x551f40,_0x375cb4){var _0x3f6fbb={'raw':![],'where':{'id':_0x551f40['params']['id']}},_0x5e2348={};_0x5e2348[_0x35ec('0x42')]=_['keys'](db[_0x35ec('0x39')][_0x35ec('0x3a')]);_0x5e2348[_0x35ec('0x3f')]=_['keys'](_0x551f40[_0x35ec('0x3f')]);_0x5e2348[_0x35ec('0x4a')]=_['intersection'](_0x5e2348[_0x35ec('0x42')],_0x5e2348[_0x35ec('0x3f')]);_0x3f6fbb[_0x35ec('0x44')]=_[_0x35ec('0x41')](_0x5e2348['model'],qs[_0x35ec('0x43')](_0x551f40[_0x35ec('0x3f')][_0x35ec('0x43')]));_0x3f6fbb[_0x35ec('0x44')]=_0x3f6fbb[_0x35ec('0x44')][_0x35ec('0x45')]?_0x3f6fbb['attributes']:_0x5e2348[_0x35ec('0x42')];if(_0x551f40[_0x35ec('0x3f')][_0x35ec('0x4e')]){_0x3f6fbb[_0x35ec('0x4f')]=[{'all':!![]}];}_0x3f6fbb=_[_0x35ec('0x4c')]({},_0x3f6fbb,_0x551f40[_0x35ec('0x4d')]);return db[_0x35ec('0x39')]['find'](_0x3f6fbb)[_0x35ec('0x1c')](handleEntityNotFound(_0x375cb4,null))[_0x35ec('0x1c')](respondWithResult(_0x375cb4,null))[_0x35ec('0x27')](handleError(_0x375cb4,null));};exports[_0x35ec('0x50')]=function(_0x333419,_0x4f18b9){return db['ServicenowAccount'][_0x35ec('0x50')](_0x333419[_0x35ec('0x51')],{})[_0x35ec('0x1c')](respondWithResult(_0x4f18b9,0xc9))[_0x35ec('0x27')](handleError(_0x4f18b9,null));};exports[_0x35ec('0x34')]=function(_0x15fe64,_0x39071d){if(_0x15fe64['body']['id']){delete _0x15fe64[_0x35ec('0x51')]['id'];}return db[_0x35ec('0x39')][_0x35ec('0x52')]({'where':{'id':_0x15fe64[_0x35ec('0x53')]['id']}})['then'](handleEntityNotFound(_0x39071d,null))[_0x35ec('0x1c')](saveUpdates(_0x15fe64[_0x35ec('0x51')],null))[_0x35ec('0x1c')](respondWithResult(_0x39071d,null))[_0x35ec('0x27')](handleError(_0x39071d,null));};exports[_0x35ec('0x35')]=function(_0x22c62e,_0x441c22){return db[_0x35ec('0x39')]['find']({'where':{'id':_0x22c62e['params']['id']}})['then'](handleEntityNotFound(_0x441c22,null))['then'](removeEntity(_0x441c22,null))[_0x35ec('0x27')](handleError(_0x441c22,null));};exports[_0x35ec('0x54')]=function(_0x33e8ac,_0x1b8f91,_0x5396da){var _0xa8ac8f={};var _0x2dcf99={};var _0x1435aa;var _0x229da6;return db[_0x35ec('0x39')][_0x35ec('0x55')]({'where':{'id':_0x33e8ac['params']['id']}})[_0x35ec('0x1c')](handleEntityNotFound(_0x1b8f91,null))[_0x35ec('0x1c')](function(_0x5be277){if(_0x5be277){_0x1435aa=_0x5be277;_0x2dcf99[_0x35ec('0x42')]=_['keys'](db[_0x35ec('0x56')][_0x35ec('0x3a')]);_0x2dcf99[_0x35ec('0x3f')]=_[_0x35ec('0x40')](_0x33e8ac[_0x35ec('0x3f')]);_0x2dcf99['filters']=_[_0x35ec('0x41')](_0x2dcf99[_0x35ec('0x42')],_0x2dcf99[_0x35ec('0x3f')]);_0xa8ac8f[_0x35ec('0x44')]=_[_0x35ec('0x41')](_0x2dcf99[_0x35ec('0x42')],qs[_0x35ec('0x43')](_0x33e8ac['query']['fields']));_0xa8ac8f['attributes']=_0xa8ac8f['attributes']['length']?_0xa8ac8f[_0x35ec('0x44')]:_0x2dcf99['model'];_0xa8ac8f['order']=qs['sort'](_0x33e8ac[_0x35ec('0x3f')]['sort']);_0xa8ac8f[_0x35ec('0x49')]=qs[_0x35ec('0x4a')](_[_0x35ec('0x4b')](_0x33e8ac[_0x35ec('0x3f')],_0x2dcf99['filters']));if(_0x33e8ac[_0x35ec('0x3f')][_0x35ec('0x57')]){_0xa8ac8f[_0x35ec('0x49')]=_['merge'](_0xa8ac8f[_0x35ec('0x49')],{'$or':_[_0x35ec('0x38')](_0xa8ac8f[_0x35ec('0x44')],function(_0x21f5d1){var _0x57eb47={};_0x57eb47[_0x21f5d1]={'$like':'%'+_0x33e8ac[_0x35ec('0x3f')]['filter']+'%'};return _0x57eb47;})});}_0xa8ac8f=_[_0x35ec('0x4c')]({},_0xa8ac8f,_0x33e8ac[_0x35ec('0x4d')]);return _0x1435aa['getConfigurations'](_0xa8ac8f);}})[_0x35ec('0x1c')](function(_0x3d76c0){if(_0x3d76c0){_0x229da6=_0x3d76c0[_0x35ec('0x45')];if(!_0x33e8ac[_0x35ec('0x3f')][_0x35ec('0x58')](_0x35ec('0x46'))){_0xa8ac8f[_0x35ec('0x2d')]=qs[_0x35ec('0x2d')](_0x33e8ac[_0x35ec('0x3f')][_0x35ec('0x2d')]);_0xa8ac8f[_0x35ec('0x2c')]=qs['offset'](_0x33e8ac[_0x35ec('0x3f')][_0x35ec('0x2c')]);}return _0x1435aa[_0x35ec('0x54')](_0xa8ac8f);}})[_0x35ec('0x1c')](function(_0x5917a8){if(_0x5917a8){return _0x5917a8?{'count':_0x229da6,'rows':_0x5917a8}:null;}})[_0x35ec('0x1c')](respondWithResult(_0x1b8f91,null))[_0x35ec('0x27')](handleError(_0x1b8f91,null));};exports[_0x35ec('0x59')]=function(_0x32b97f,_0x566a57,_0x1808a4){if(_0x32b97f['body']['id']){delete _0x32b97f[_0x35ec('0x51')]['id'];}return db[_0x35ec('0x39')][_0x35ec('0x55')]({'where':{'id':_0x32b97f[_0x35ec('0x53')]['id']}})[_0x35ec('0x1c')](handleEntityNotFound(_0x566a57,null))[_0x35ec('0x1c')](function(_0x4b639d){if(_0x4b639d){_0x32b97f['body'][_0x35ec('0x5a')]=_0x4b639d['id'];_0x32b97f[_0x35ec('0x51')]['Subjects']=integrations[_0x35ec('0x5b')](_0x32b97f[_0x35ec('0x51')][_0x35ec('0x5c')],_0x32b97f[_0x35ec('0x51')]['type']);_0x32b97f[_0x35ec('0x51')]['Descriptions']=integrations[_0x35ec('0x5d')](_0x32b97f[_0x35ec('0x51')][_0x35ec('0x5c')],_0x32b97f[_0x35ec('0x51')][_0x35ec('0x3c')]);return db[_0x35ec('0x56')]['create'](_0x32b97f[_0x35ec('0x51')],{'include':[{'model':db[_0x35ec('0x5e')],'as':'Subjects'},{'model':db[_0x35ec('0x5e')],'as':_0x35ec('0x5f')}]});}return null;})[_0x35ec('0x1c')](respondWithResult(_0x566a57,null))['catch'](handleError(_0x566a57,null));};exports[_0x35ec('0x60')]=function(_0x53b3bc,_0x3a8330,_0x194d53){var _0x3f27dd=[_0x35ec('0x61'),_0x35ec('0x62'),_0x35ec('0x63'),_0x35ec('0x64'),_0x35ec('0x65'),_0x35ec('0x66'),'incident_state','severity',_0x35ec('0x67')];var _0x1fc63b=[_0x35ec('0x68'),_0x35ec('0x61'),'caused_by',_0x35ec('0x69'),_0x35ec('0x6a'),_0x35ec('0x6b'),_0x35ec('0x6c'),_0x35ec('0x62'),_0x35ec('0x6d'),'number',_0x35ec('0x6e'),_0x35ec('0x6f'),_0x35ec('0x70'),'user_input',_0x35ec('0x71'),_0x35ec('0x72'),_0x35ec('0x73'),'sys_created_by',_0x35ec('0x63'),_0x35ec('0x47'),_0x35ec('0x74'),_0x35ec('0x75'),'cmdb_ci',_0x35ec('0x76'),_0x35ec('0x77'),_0x35ec('0x78'),_0x35ec('0x79'),_0x35ec('0x7a'),_0x35ec('0x7b'),_0x35ec('0x7c'),_0x35ec('0x7d'),_0x35ec('0x7e'),_0x35ec('0x7f'),_0x35ec('0x80'),_0x35ec('0x81'),_0x35ec('0x82'),'work_end',_0x35ec('0x83'),_0x35ec('0x84'),_0x35ec('0x85'),'approval_set',_0x35ec('0x64'),_0x35ec('0x86'),'short_description','close_code','correlation_display','delivery_task',_0x35ec('0x87'),_0x35ec('0x88'),_0x35ec('0x89'),_0x35ec('0x8a'),_0x35ec('0x8b'),_0x35ec('0x8c'),_0x35ec('0x66'),_0x35ec('0x8d'),_0x35ec('0x8e'),_0x35ec('0x8f'),_0x35ec('0x90'),'parent_incident',_0x35ec('0x91'),_0x35ec('0x92'),_0x35ec('0x93'),_0x35ec('0x94'),_0x35ec('0x95'),_0x35ec('0x96'),_0x35ec('0x97'),_0x35ec('0x98'),_0x35ec('0x99'),_0x35ec('0x9a'),_0x35ec('0x9b'),_0x35ec('0x9c'),_0x35ec('0x9d'),_0x35ec('0x9e'),_0x35ec('0x9f'),'due_date',_0x35ec('0xa0'),_0x35ec('0xa1'),_0x35ec('0xa2'),_0x35ec('0xa3'),_0x35ec('0xa4'),_0x35ec('0xa5'),_0x35ec('0xa6'),_0x35ec('0x67')];var _0x14509='';var _0x286957='';var _0x1c82d7=[];var _0x404776='';var _0x11f298='';var _0x6e6559=[];var _0x22d23c='';var _0x27d981='';var _0x3f7a02={};var _0x42d319='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x53b3bc[_0x35ec('0x53')]['id']},'attributes':['id',_0x35ec('0xa7'),_0x35ec('0xa8'),_0x35ec('0xa9'),_0x35ec('0xaa'),_0x35ec('0xab')]})[_0x35ec('0x1c')](handleEntityNotFound(_0x3a8330,null))['then'](function(_0x2d56d4){if(_0x2d56d4){_0x42d319=_0x2d56d4[_0x35ec('0xaa')];var _0x66cf19=_0x42d319[_0x35ec('0xac')](-0x1);if(_0x66cf19==='/'){_0x42d319=_0x42d319[_0x35ec('0xad')](0x0,_0x42d319[_0x35ec('0xae')](_0x66cf19));}_0x27d981=util[_0x35ec('0xaf')]('%s/api/now/doc/table/schema/',_0x42d319);_0x22d23c=util[_0x35ec('0xaf')](_0x35ec('0xb0'),_0x42d319);_0x3f7a02={'user':_0x2d56d4[_0x35ec('0xa7')],'pass':_0x2d56d4[_0x35ec('0xa8')]};var _0x5379b4={'method':_0x35ec('0xb1'),'uri':_0x27d981+_0x35ec('0xb2'),'auth':_0x3f7a02,'json':!![]};return rp(_0x5379b4);}})['then'](function(_0x4bd75a){if(_0x4bd75a['result'][_0x35ec('0x45')]>0x0){_0x14509=_0x4bd75a['result'];}console['log'](_0x35ec('0xb3'),_0x14509);_0x6e6559=[];_0x286957=Object[_0x35ec('0xb4')]([],_0x14509);_['remove'](_0x286957,function(_0x354df6){return!_0x3f27dd[_0x35ec('0xb5')](_0x354df6[_0x35ec('0x3e')]);});_0x286957['forEach'](function(_0x593a0b){var _0x38bc12=createFieldObject(_0x22d23c,_0x3f7a02,_0x593a0b[_0x35ec('0xb6')],_0x593a0b['name'],_0x593a0b[_0x35ec('0xb7')],![]);_0x6e6559['push'](_0x38bc12);});return Promise[_0x35ec('0xb8')](_0x6e6559);})['then'](function(_0x158fb0){_0x1c82d7=_0x158fb0;_0x404776=Object[_0x35ec('0xb4')]([],_0x14509);console[_0x35ec('0xb9')]('TCL:\x20_object',_0x14509);_[_0x35ec('0xba')](_0x404776,function(_0xc7e760){return _0x1fc63b['includes'](_0xc7e760[_0x35ec('0x3e')]);});console['log'](_0x35ec('0xbb'),_0x404776);_0x6e6559=[];_0x404776[_0x35ec('0xbc')](function(_0x3035b9){var _0x4bb774=createFieldObject(_0x22d23c,_0x3f7a02,_0x3035b9['internalType'],_0x3035b9['name'],_0x3035b9[_0x35ec('0xb7')],!![]);_0x6e6559[_0x35ec('0xbd')](_0x4bb774);});return Promise[_0x35ec('0xb8')](_0x6e6559);})[_0x35ec('0x1c')](function(_0x3f71ee){_0x11f298=_0x3f71ee;var _0x5b229e=_0x1c82d7[_0x35ec('0xbe')](_0x11f298);return{'count':_0x5b229e[_0x35ec('0x45')],'rows':_0x5b229e};})[_0x35ec('0x1c')](respondWithResult(_0x3a8330,null))['catch'](function(_0x24b998){console['log']('ServiceNow\x20error:\x20'+_0x24b998);var _0x2c069e=_0x53b3bc[_0x35ec('0x3f')][_0x35ec('0x18')]?0x1f4:_0x24b998['statusCode']||0x1f4;logger['error'](_0x24b998[_0x35ec('0x36')]);delete _0x24b998[_0x35ec('0x3e')];if(_0x2c069e===0x191){_0x2c069e=0x190;}_0x3a8330[_0x35ec('0x29')](_0x2c069e)[_0x35ec('0xbf')](_0x53b3bc[_0x35ec('0x3f')][_0x35ec('0x18')]?{'message':_0x35ec('0xc0'),'statusCode':_0x24b998[_0x35ec('0xc1')]}:_0x24b998);});};function createFieldObject(_0x537e54,_0x51665a,_0x5ccf21,_0x2514ba,_0x2eac37,_0xc6f71b){return new Promise(function(_0x3989f8,_0x3dcf8f){var _0x263fb0={'id':_0x2514ba,'name':_0x2eac37,'custom':_0xc6f71b};if(_0x5ccf21==='boolean'){_0x263fb0[_0x35ec('0x4d')]=[{'name':_0x35ec('0xc2'),'value':_0x35ec('0xc3')},{'name':'False','value':'false'}];_0x3989f8(_0x263fb0);}else{var _0x4b70fe={'method':_0x35ec('0xb1'),'uri':_0x537e54+'sys_choice?sysparm_query=name=incident^element='+_0x2514ba,'auth':_0x51665a,'json':!![]};return rp(_0x4b70fe)['then'](function(_0x4021fb){var _0x2edd16=[];if(_0x4021fb[_0x35ec('0x26')][_0x35ec('0x45')]>0x0){_0x4021fb[_0x35ec('0x26')][_0x35ec('0xbc')](function(_0x35205b){if(_0x35205b[_0x35ec('0xc4')]===_0x35ec('0xc5')){var _0x3ca099={'name':_0x35205b[_0x35ec('0xb7')],'value':_0x35205b['value']};_0x2edd16[_0x35ec('0xbd')](_0x3ca099);}});}_0x263fb0[_0x35ec('0x4d')]=_0x2edd16;if(_0x263fb0[_0x35ec('0x4d')][_0x35ec('0x45')]>0x0){_0x3989f8(_0x263fb0);}else{if(_0xc6f71b==![]){_0x3989f8();}else{_0x3989f8(_0x263fb0);}}});}});} \ No newline at end of file +var _0xeb9e=['map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','count','include','findAll','rows','show','params','includeAll','find','create','update','body','findOne','ServicenowConfiguration','pick','options','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','made_sla','hold_reason','subcategory','close_code','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','assign','TCL:\x20_object','push','concat','statusCode','Wrong\x20credentials','boolean','False','false','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','status','json','limit','set','reject','save','destroy','then','end','sendStatus','name','send'];(function(_0x4f4a9b,_0x129af9){var _0x15d63b=function(_0x460666){while(--_0x460666){_0x4f4a9b['push'](_0x4f4a9b['shift']());}};_0x15d63b(++_0x129af9);}(_0xeb9e,0x143));var _0xeeb9=function(_0x11c1ff,_0x47da8b){_0x11c1ff=_0x11c1ff-0x0;var _0x17ca4f=_0xeb9e[_0x11c1ff];return _0x17ca4f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeeb9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeeb9('0x1'));var jsonpatch=require(_0xeeb9('0x2'));var rp=require(_0xeeb9('0x3'));var moment=require(_0xeeb9('0x4'));var BPromise=require(_0xeeb9('0x5'));var Mustache=require(_0xeeb9('0x6'));var util=require(_0xeeb9('0x7'));var path=require(_0xeeb9('0x8'));var sox=require(_0xeeb9('0x9'));var csv=require(_0xeeb9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xeeb9('0xb'));var crypto=require(_0xeeb9('0xc'));var jsforce=require(_0xeeb9('0xd'));var deskjs=require(_0xeeb9('0xe'));var toCsv=require(_0xeeb9('0xa'));var querystring=require('querystring');var Papa=require(_0xeeb9('0xf'));var Redis=require(_0xeeb9('0x10'));var authService=require(_0xeeb9('0x11'));var qs=require(_0xeeb9('0x12'));var as=require(_0xeeb9('0x13'));var hardwareService=require(_0xeeb9('0x14'));var logger=require(_0xeeb9('0x15'))(_0xeeb9('0x16'));var utils=require(_0xeeb9('0x17'));var config=require('../../config/environment');var db=require(_0xeeb9('0x18'))['db'];var integrations=require(_0xeeb9('0x19'));var jayson=require(_0xeeb9('0x1a'));var client=jayson[_0xeeb9('0x1b')][_0xeeb9('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3b1dbc,_0x5f2819,_0x5e6e62){if(_0x5e6e62){var _0x16bb16=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16bb16[_0xeeb9('0x1d')](_0x5f2819)){return _0x3b1dbc;}else{throw new db[(_0xeeb9('0x1e'))]['ValidationError'](_0xeeb9('0x1f'));}}else{return _0x3b1dbc;}}function respondWithRpcPromise(_0x414db5,_0xc08e2,_0x489f22,_0x58dd50){return new BPromise(function(_0x2dee52,_0x5f156f){var _0x31bd47=_0x58dd50||client;return _0x31bd47[_0xeeb9('0x20')](_0x414db5,_0x489f22)['then'](function(_0x437bd4){logger[_0xeeb9('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0xc08e2,_0xeeb9('0x22'));logger['debug'](_0xeeb9('0x23'),_0xc08e2,_0xeeb9('0x22'),JSON[_0xeeb9('0x24')](_0x437bd4));if(_0x437bd4[_0xeeb9('0x25')]){if(_0x437bd4[_0xeeb9('0x25')][_0xeeb9('0x26')]===0x1f4){logger['error'](_0xeeb9('0x27'),_0xc08e2,_0x437bd4[_0xeeb9('0x25')][_0xeeb9('0x28')]);return _0x5f156f(_0x437bd4[_0xeeb9('0x25')]['message']);}logger[_0xeeb9('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0xc08e2,_0x437bd4[_0xeeb9('0x25')][_0xeeb9('0x28')]);return _0x2dee52(_0x437bd4[_0xeeb9('0x25')]['message']);}else{logger[_0xeeb9('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0xc08e2,_0xeeb9('0x22'));_0x2dee52(_0x437bd4[_0xeeb9('0x29')][_0xeeb9('0x28')]);}})[_0xeeb9('0x2a')](function(_0x5d4c6a){logger[_0xeeb9('0x25')](_0xeeb9('0x27'),_0xc08e2,_0x5d4c6a);_0x5f156f(_0x5d4c6a);});});}function respondWithStatusCode(_0x55bc86,_0xd56705){_0xd56705=_0xd56705||0xcc;return function(_0x3cb470){if(_0x3cb470){return _0x55bc86['sendStatus'](_0xd56705);}return _0x55bc86[_0xeeb9('0x2b')](_0xd56705)['end']();};}function respondWithResult(_0x13fc81,_0x193da){_0x193da=_0x193da||0xc8;return function(_0x35dfb2){if(_0x35dfb2){return _0x13fc81[_0xeeb9('0x2b')](_0x193da)[_0xeeb9('0x2c')](_0x35dfb2);}};}function respondWithFilteredResult(_0x40027f,_0x3f6379){return function(_0x5d7d08){if(_0x5d7d08){var _0xe1da9=_0x5d7d08['count'],_0x21a627=_0x3f6379['offset'],_0x48f227=_0x3f6379['offset']+_0x3f6379[_0xeeb9('0x2d')],_0x1f1ec1;if(_0x48f227>=_0xe1da9){_0x48f227=_0xe1da9;_0x1f1ec1=0xc8;}else{_0x1f1ec1=0xce;}_0x40027f[_0xeeb9('0x2b')](_0x1f1ec1);return _0x40027f[_0xeeb9('0x2e')]('Content-Range',_0x21a627+'-'+_0x48f227+'/'+_0xe1da9)[_0xeeb9('0x2c')](_0x5d7d08);}return null;};}function patchUpdates(_0x82517b){return function(_0x20e3df){try{jsonpatch['apply'](_0x20e3df,_0x82517b,!![]);}catch(_0x5d6e7d){return BPromise[_0xeeb9('0x2f')](_0x5d6e7d);}return _0x20e3df[_0xeeb9('0x30')]();};}function saveUpdates(_0x3c692b,_0x4cbb58){return function(_0x5b3bc7){if(_0x5b3bc7){return _0x5b3bc7['update'](_0x3c692b)['then'](function(_0x27894e){return _0x27894e;});}return null;};}function removeEntity(_0x94ba1b,_0x204b21){return function(_0x549d93){if(_0x549d93){return _0x549d93[_0xeeb9('0x31')]()[_0xeeb9('0x32')](function(){_0x94ba1b['status'](0xcc)[_0xeeb9('0x33')]();});}};}function handleEntityNotFound(_0x307d95,_0x411996){return function(_0x15e0b8){if(!_0x15e0b8){_0x307d95[_0xeeb9('0x34')](0x194);}return _0x15e0b8;};}function handleError(_0x56258a,_0x2a708a){_0x2a708a=_0x2a708a||0x1f4;return function(_0x5530ba){logger[_0xeeb9('0x25')](_0x5530ba['stack']);if(_0x5530ba[_0xeeb9('0x35')]){delete _0x5530ba['name'];}_0x56258a['status'](_0x2a708a)[_0xeeb9('0x36')](_0x5530ba);};}exports['index']=function(_0x4f6ff1,_0x493569){var _0x30caba={},_0x1bb120={},_0x3f6d57={'count':0x0,'rows':[]};var _0x3584d3=_[_0xeeb9('0x37')](db[_0xeeb9('0x38')][_0xeeb9('0x39')],function(_0x1c3a6d){return{'name':_0x1c3a6d[_0xeeb9('0x3a')],'type':_0x1c3a6d[_0xeeb9('0x3b')]['key']};});_0x1bb120[_0xeeb9('0x3c')]=_[_0xeeb9('0x37')](_0x3584d3,_0xeeb9('0x35'));_0x1bb120[_0xeeb9('0x3d')]=_[_0xeeb9('0x3e')](_0x4f6ff1[_0xeeb9('0x3d')]);_0x1bb120[_0xeeb9('0x3f')]=_[_0xeeb9('0x40')](_0x1bb120[_0xeeb9('0x3c')],_0x1bb120[_0xeeb9('0x3d')]);_0x30caba[_0xeeb9('0x41')]=_['intersection'](_0x1bb120[_0xeeb9('0x3c')],qs[_0xeeb9('0x42')](_0x4f6ff1['query']['fields']));_0x30caba[_0xeeb9('0x41')]=_0x30caba[_0xeeb9('0x41')][_0xeeb9('0x43')]?_0x30caba[_0xeeb9('0x41')]:_0x1bb120[_0xeeb9('0x3c')];if(!_0x4f6ff1[_0xeeb9('0x3d')][_0xeeb9('0x44')](_0xeeb9('0x45'))){_0x30caba[_0xeeb9('0x2d')]=qs[_0xeeb9('0x2d')](_0x4f6ff1['query'][_0xeeb9('0x2d')]);_0x30caba[_0xeeb9('0x46')]=qs[_0xeeb9('0x46')](_0x4f6ff1[_0xeeb9('0x3d')][_0xeeb9('0x46')]);}_0x30caba[_0xeeb9('0x47')]=qs[_0xeeb9('0x48')](_0x4f6ff1[_0xeeb9('0x3d')][_0xeeb9('0x48')]);_0x30caba[_0xeeb9('0x49')]=qs[_0xeeb9('0x3f')](_['pick'](_0x4f6ff1[_0xeeb9('0x3d')],_0x1bb120[_0xeeb9('0x3f')]),_0x3584d3);if(_0x4f6ff1[_0xeeb9('0x3d')][_0xeeb9('0x4a')]){_0x30caba[_0xeeb9('0x49')]=_[_0xeeb9('0x4b')](_0x30caba[_0xeeb9('0x49')],{'$or':_[_0xeeb9('0x37')](_0x3584d3,function(_0x579273){if(_0x579273[_0xeeb9('0x3b')]!=='VIRTUAL'){var _0x3e8c86={};_0x3e8c86[_0x579273[_0xeeb9('0x35')]]={'$like':'%'+_0x4f6ff1[_0xeeb9('0x3d')][_0xeeb9('0x4a')]+'%'};return _0x3e8c86;}})});}_0x30caba=_['merge']({},_0x30caba,_0x4f6ff1['options']);var _0x2ef659={'where':_0x30caba[_0xeeb9('0x49')]};return db[_0xeeb9('0x38')][_0xeeb9('0x4c')](_0x2ef659)[_0xeeb9('0x32')](function(_0x3b8162){_0x3f6d57[_0xeeb9('0x4c')]=_0x3b8162;if(_0x4f6ff1[_0xeeb9('0x3d')]['includeAll']){_0x30caba[_0xeeb9('0x4d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xeeb9('0x4e')](_0x30caba);})[_0xeeb9('0x32')](function(_0x322b1f){_0x3f6d57[_0xeeb9('0x4f')]=_0x322b1f;return _0x3f6d57;})[_0xeeb9('0x32')](respondWithFilteredResult(_0x493569,_0x30caba))[_0xeeb9('0x2a')](handleError(_0x493569,null));};exports[_0xeeb9('0x50')]=function(_0x17a75d,_0x5cb6e9){var _0x560071={'raw':![],'where':{'id':_0x17a75d[_0xeeb9('0x51')]['id']}},_0x1848e3={};_0x1848e3[_0xeeb9('0x3c')]=_[_0xeeb9('0x3e')](db[_0xeeb9('0x38')][_0xeeb9('0x39')]);_0x1848e3['query']=_[_0xeeb9('0x3e')](_0x17a75d['query']);_0x1848e3[_0xeeb9('0x3f')]=_[_0xeeb9('0x40')](_0x1848e3['model'],_0x1848e3['query']);_0x560071[_0xeeb9('0x41')]=_[_0xeeb9('0x40')](_0x1848e3[_0xeeb9('0x3c')],qs[_0xeeb9('0x42')](_0x17a75d[_0xeeb9('0x3d')]['fields']));_0x560071[_0xeeb9('0x41')]=_0x560071['attributes'][_0xeeb9('0x43')]?_0x560071[_0xeeb9('0x41')]:_0x1848e3[_0xeeb9('0x3c')];if(_0x17a75d[_0xeeb9('0x3d')][_0xeeb9('0x52')]){_0x560071[_0xeeb9('0x4d')]=[{'all':!![]}];}_0x560071=_[_0xeeb9('0x4b')]({},_0x560071,_0x17a75d['options']);return db[_0xeeb9('0x38')][_0xeeb9('0x53')](_0x560071)[_0xeeb9('0x32')](handleEntityNotFound(_0x5cb6e9,null))[_0xeeb9('0x32')](respondWithResult(_0x5cb6e9,null))['catch'](handleError(_0x5cb6e9,null));};exports[_0xeeb9('0x54')]=function(_0x238751,_0x583683){return db['ServicenowAccount'][_0xeeb9('0x54')](_0x238751['body'],{})['then'](respondWithResult(_0x583683,0xc9))[_0xeeb9('0x2a')](handleError(_0x583683,null));};exports[_0xeeb9('0x55')]=function(_0x2e66ed,_0x519d12){if(_0x2e66ed['body']['id']){delete _0x2e66ed['body']['id'];}return db[_0xeeb9('0x38')][_0xeeb9('0x53')]({'where':{'id':_0x2e66ed[_0xeeb9('0x51')]['id']}})['then'](handleEntityNotFound(_0x519d12,null))[_0xeeb9('0x32')](saveUpdates(_0x2e66ed[_0xeeb9('0x56')],null))[_0xeeb9('0x32')](respondWithResult(_0x519d12,null))[_0xeeb9('0x2a')](handleError(_0x519d12,null));};exports['destroy']=function(_0x5064ca,_0x1c8f59){return db['ServicenowAccount']['find']({'where':{'id':_0x5064ca[_0xeeb9('0x51')]['id']}})[_0xeeb9('0x32')](handleEntityNotFound(_0x1c8f59,null))[_0xeeb9('0x32')](removeEntity(_0x1c8f59,null))['catch'](handleError(_0x1c8f59,null));};exports['getConfigurations']=function(_0x1329df,_0x293d1a,_0x49fd7a){var _0x47e388={};var _0x3e4e9e={};var _0x27bd59;var _0x470721;return db[_0xeeb9('0x38')][_0xeeb9('0x57')]({'where':{'id':_0x1329df[_0xeeb9('0x51')]['id']}})[_0xeeb9('0x32')](handleEntityNotFound(_0x293d1a,null))[_0xeeb9('0x32')](function(_0x45601a){if(_0x45601a){_0x27bd59=_0x45601a;_0x3e4e9e['model']=_[_0xeeb9('0x3e')](db[_0xeeb9('0x58')]['rawAttributes']);_0x3e4e9e[_0xeeb9('0x3d')]=_['keys'](_0x1329df[_0xeeb9('0x3d')]);_0x3e4e9e[_0xeeb9('0x3f')]=_['intersection'](_0x3e4e9e[_0xeeb9('0x3c')],_0x3e4e9e[_0xeeb9('0x3d')]);_0x47e388[_0xeeb9('0x41')]=_[_0xeeb9('0x40')](_0x3e4e9e[_0xeeb9('0x3c')],qs['fields'](_0x1329df[_0xeeb9('0x3d')][_0xeeb9('0x42')]));_0x47e388[_0xeeb9('0x41')]=_0x47e388[_0xeeb9('0x41')][_0xeeb9('0x43')]?_0x47e388[_0xeeb9('0x41')]:_0x3e4e9e['model'];_0x47e388[_0xeeb9('0x47')]=qs[_0xeeb9('0x48')](_0x1329df[_0xeeb9('0x3d')]['sort']);_0x47e388['where']=qs[_0xeeb9('0x3f')](_[_0xeeb9('0x59')](_0x1329df['query'],_0x3e4e9e[_0xeeb9('0x3f')]));if(_0x1329df[_0xeeb9('0x3d')][_0xeeb9('0x4a')]){_0x47e388[_0xeeb9('0x49')]=_[_0xeeb9('0x4b')](_0x47e388[_0xeeb9('0x49')],{'$or':_[_0xeeb9('0x37')](_0x47e388[_0xeeb9('0x41')],function(_0x510da9){var _0x597b45={};_0x597b45[_0x510da9]={'$like':'%'+_0x1329df['query'][_0xeeb9('0x4a')]+'%'};return _0x597b45;})});}_0x47e388=_[_0xeeb9('0x4b')]({},_0x47e388,_0x1329df[_0xeeb9('0x5a')]);return _0x27bd59[_0xeeb9('0x5b')](_0x47e388);}})[_0xeeb9('0x32')](function(_0x531c8a){if(_0x531c8a){_0x470721=_0x531c8a[_0xeeb9('0x43')];if(!_0x1329df['query'][_0xeeb9('0x44')]('nolimit')){_0x47e388[_0xeeb9('0x2d')]=qs[_0xeeb9('0x2d')](_0x1329df['query'][_0xeeb9('0x2d')]);_0x47e388[_0xeeb9('0x46')]=qs[_0xeeb9('0x46')](_0x1329df[_0xeeb9('0x3d')]['offset']);}return _0x27bd59[_0xeeb9('0x5b')](_0x47e388);}})[_0xeeb9('0x32')](function(_0x4dcd97){if(_0x4dcd97){return _0x4dcd97?{'count':_0x470721,'rows':_0x4dcd97}:null;}})[_0xeeb9('0x32')](respondWithResult(_0x293d1a,null))[_0xeeb9('0x2a')](handleError(_0x293d1a,null));};exports[_0xeeb9('0x5c')]=function(_0x57273c,_0x1b1575,_0x37b30a){if(_0x57273c[_0xeeb9('0x56')]['id']){delete _0x57273c['body']['id'];}return db['ServicenowAccount'][_0xeeb9('0x57')]({'where':{'id':_0x57273c[_0xeeb9('0x51')]['id']}})[_0xeeb9('0x32')](handleEntityNotFound(_0x1b1575,null))[_0xeeb9('0x32')](function(_0x4a2605){if(_0x4a2605){_0x57273c['body']['AccountId']=_0x4a2605['id'];_0x57273c[_0xeeb9('0x56')][_0xeeb9('0x5d')]=integrations[_0xeeb9('0x5e')](_0x57273c[_0xeeb9('0x56')][_0xeeb9('0x5f')],_0x57273c[_0xeeb9('0x56')][_0xeeb9('0x3b')]);_0x57273c['body'][_0xeeb9('0x60')]=integrations[_0xeeb9('0x61')](_0x57273c[_0xeeb9('0x56')][_0xeeb9('0x5f')],_0x57273c[_0xeeb9('0x56')][_0xeeb9('0x3b')]);return db[_0xeeb9('0x58')][_0xeeb9('0x54')](_0x57273c[_0xeeb9('0x56')],{'include':[{'model':db['ServicenowField'],'as':_0xeeb9('0x5d')},{'model':db['ServicenowField'],'as':_0xeeb9('0x60')}]});}return null;})[_0xeeb9('0x32')](respondWithResult(_0x1b1575,null))[_0xeeb9('0x2a')](handleError(_0x1b1575,null));};exports['getFields']=function(_0x3f2d26,_0x527a29,_0x1af974){var _0x22c268=[_0xeeb9('0x62'),_0xeeb9('0x63'),'knowledge',_0xeeb9('0x64'),_0xeeb9('0x65'),'notify',_0xeeb9('0x66'),'severity',_0xeeb9('0x67')];var _0xeb77ce=[_0xeeb9('0x68'),_0xeeb9('0x62'),_0xeeb9('0x69'),_0xeeb9('0x6a'),_0xeeb9('0x6b'),_0xeeb9('0x6c'),'child_incidents',_0xeeb9('0x63'),_0xeeb9('0x6d'),_0xeeb9('0x6e'),_0xeeb9('0x6f'),_0xeeb9('0x70'),_0xeeb9('0x71'),'user_input',_0xeeb9('0x72'),_0xeeb9('0x73'),'state',_0xeeb9('0x74'),_0xeeb9('0x75'),_0xeeb9('0x47'),_0xeeb9('0x76'),_0xeeb9('0x77'),_0xeeb9('0x78'),_0xeeb9('0x79'),'impact',_0xeeb9('0x7a'),'work_notes_list','business_service',_0xeeb9('0x7b'),_0xeeb9('0x7c'),_0xeeb9('0x7d'),_0xeeb9('0x7e'),_0xeeb9('0x7f'),'opened_at',_0xeeb9('0x80'),_0xeeb9('0x81'),_0xeeb9('0x82'),_0xeeb9('0x83'),'resolved_at',_0xeeb9('0x84'),_0xeeb9('0x85'),_0xeeb9('0x64'),'work_notes',_0xeeb9('0x86'),_0xeeb9('0x65'),_0xeeb9('0x87'),_0xeeb9('0x88'),_0xeeb9('0x89'),'assignment_group','business_stc',_0xeeb9('0x8a'),_0xeeb9('0x8b'),_0xeeb9('0x8c'),'notify','sys_class_name','close_notes',_0xeeb9('0x8d'),'follow_up',_0xeeb9('0x8e'),_0xeeb9('0x8f'),_0xeeb9('0x90'),_0xeeb9('0x91'),_0xeeb9('0x66'),_0xeeb9('0x92'),_0xeeb9('0x93'),_0xeeb9('0x94'),'reassignment_count',_0xeeb9('0x95'),'assigned_to',_0xeeb9('0x96'),_0xeeb9('0x97'),'sla_due',_0xeeb9('0x98'),_0xeeb9('0x99'),_0xeeb9('0x9a'),_0xeeb9('0x9b'),_0xeeb9('0x9c'),_0xeeb9('0x9d'),_0xeeb9('0x9e'),_0xeeb9('0x9f'),_0xeeb9('0xa0'),_0xeeb9('0xa1'),'category'];var _0x1013e1='';var _0x59312d='';var _0x116db3=[];var _0x4b774e='';var _0x512432='';var _0x52d28e=[];var _0x1e37e2='';var _0x28dd16='';var _0x2e1ca1={};var _0x3fad0a='';return db['ServicenowAccount'][_0xeeb9('0x57')]({'where':{'id':_0x3f2d26[_0xeeb9('0x51')]['id']},'attributes':['id',_0xeeb9('0xa2'),_0xeeb9('0xa3'),_0xeeb9('0xa4'),_0xeeb9('0xa5'),'serverUrl']})['then'](handleEntityNotFound(_0x527a29,null))[_0xeeb9('0x32')](function(_0x1e2294){if(_0x1e2294){_0x3fad0a=_0x1e2294['remoteUri'];var _0x3cf848=_0x3fad0a[_0xeeb9('0xa6')](-0x1);if(_0x3cf848==='/'){_0x3fad0a=_0x3fad0a['substring'](0x0,_0x3fad0a['lastIndexOf'](_0x3cf848));}_0x28dd16=util[_0xeeb9('0xa7')](_0xeeb9('0xa8'),_0x3fad0a);_0x1e37e2=util[_0xeeb9('0xa7')](_0xeeb9('0xa9'),_0x3fad0a);_0x2e1ca1={'user':_0x1e2294[_0xeeb9('0xa2')],'pass':_0x1e2294[_0xeeb9('0xa3')]};var _0x111eb2={'method':_0xeeb9('0xaa'),'uri':_0x28dd16+_0xeeb9('0xab'),'auth':_0x2e1ca1,'json':!![]};return rp(_0x111eb2);}})[_0xeeb9('0x32')](function(_0x54614e){if(_0x54614e['result']['length']>0x0){_0x1013e1=_0x54614e[_0xeeb9('0x29')];}console[_0xeeb9('0xac')](_0xeeb9('0xad'),_0x1013e1);_0x52d28e=[];_0x59312d=Object['assign']([],_0x1013e1);_[_0xeeb9('0xae')](_0x59312d,function(_0x585597){return!_0x22c268[_0xeeb9('0xaf')](_0x585597[_0xeeb9('0x35')]);});_0x59312d[_0xeeb9('0xb0')](function(_0x55f88a){var _0x4c8fc=createFieldObject(_0x1e37e2,_0x2e1ca1,_0x55f88a[_0xeeb9('0xb1')],_0x55f88a[_0xeeb9('0x35')],_0x55f88a[_0xeeb9('0xb2')],![]);_0x52d28e['push'](_0x4c8fc);});return Promise[_0xeeb9('0xb3')](_0x52d28e);})[_0xeeb9('0x32')](function(_0x128223){_0x116db3=_0x128223;_0x4b774e=Object[_0xeeb9('0xb4')]([],_0x1013e1);console['log'](_0xeeb9('0xb5'),_0x1013e1);_[_0xeeb9('0xae')](_0x4b774e,function(_0x9662c3){return _0xeb77ce['includes'](_0x9662c3[_0xeeb9('0x35')]);});console[_0xeeb9('0xac')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4b774e);_0x52d28e=[];_0x4b774e['forEach'](function(_0x5ac51d){var _0x35f1dd=createFieldObject(_0x1e37e2,_0x2e1ca1,_0x5ac51d[_0xeeb9('0xb1')],_0x5ac51d[_0xeeb9('0x35')],_0x5ac51d[_0xeeb9('0xb2')],!![]);_0x52d28e[_0xeeb9('0xb6')](_0x35f1dd);});return Promise[_0xeeb9('0xb3')](_0x52d28e);})['then'](function(_0x1d230f){_0x512432=_0x1d230f;var _0xc66da=_0x116db3[_0xeeb9('0xb7')](_0x512432);return{'count':_0xc66da[_0xeeb9('0x43')],'rows':_0xc66da};})[_0xeeb9('0x32')](respondWithResult(_0x527a29,null))[_0xeeb9('0x2a')](function(_0x98dc9e){console[_0xeeb9('0xac')]('ServiceNow\x20error:\x20'+_0x98dc9e);var _0x514b43=_0x3f2d26[_0xeeb9('0x3d')][_0xeeb9('0x1d')]?0x1f4:_0x98dc9e[_0xeeb9('0xb8')]||0x1f4;logger[_0xeeb9('0x25')](_0x98dc9e['stack']);delete _0x98dc9e[_0xeeb9('0x35')];if(_0x514b43===0x191){_0x514b43=0x190;}_0x527a29['status'](_0x514b43)[_0xeeb9('0x36')](_0x3f2d26[_0xeeb9('0x3d')][_0xeeb9('0x1d')]?{'message':_0xeeb9('0xb9'),'statusCode':_0x98dc9e[_0xeeb9('0xb8')]}:_0x98dc9e);});};function createFieldObject(_0x1f3087,_0xcbcfb6,_0x58e3b5,_0x127d2a,_0xf972a7,_0x14f1c2){return new Promise(function(_0x5647fb,_0x5620e5){var _0x3d7131={'id':_0x127d2a,'name':_0xf972a7,'custom':_0x14f1c2};if(_0x58e3b5===_0xeeb9('0xba')){_0x3d7131[_0xeeb9('0x5a')]=[{'name':'True','value':'true'},{'name':_0xeeb9('0xbb'),'value':'false'}];_0x5647fb(_0x3d7131);}else{var _0x3e8d39={'method':'GET','uri':_0x1f3087+'sys_choice?sysparm_query=name=incident^element='+_0x127d2a,'auth':_0xcbcfb6,'json':!![]};return rp(_0x3e8d39)[_0xeeb9('0x32')](function(_0x26f18d){var _0x9e5f79=[];if(_0x26f18d['result'][_0xeeb9('0x43')]>0x0){_0x26f18d[_0xeeb9('0x29')][_0xeeb9('0xb0')](function(_0x3a1d0d){if(_0x3a1d0d['inactive']===_0xeeb9('0xbc')){var _0x5dcf10={'name':_0x3a1d0d['label'],'value':_0x3a1d0d['value']};_0x9e5f79[_0xeeb9('0xb6')](_0x5dcf10);}});}_0x3d7131[_0xeeb9('0x5a')]=_0x9e5f79;if(_0x3d7131['options'][_0xeeb9('0x43')]>0x0){_0x5647fb(_0x3d7131);}else{if(_0x14f1c2==![]){_0x5647fb();}else{_0x5647fb(_0x3d7131);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 80950b2..758afbf 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 _0x4955=['path','rimraf','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x33414d,_0x32021b){var _0x3af72f=function(_0x28c356){while(--_0x28c356){_0x33414d['push'](_0x33414d['shift']());}};_0x3af72f(++_0x32021b);}(_0x4955,0x181));var _0x5495=function(_0x6696,_0x246731){_0x6696=_0x6696-0x0;var _0x32bd72=_0x4955[_0x6696];return _0x32bd72;};'use strict';var _=require(_0x5495('0x0'));var util=require('util');var logger=require(_0x5495('0x1'))('api');var moment=require(_0x5495('0x2'));var BPromise=require(_0x5495('0x3'));var rp=require(_0x5495('0x4'));var fs=require('fs');var path=require(_0x5495('0x5'));var rimraf=require(_0x5495('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x5495('0x7'));module[_0x5495('0x8')]=function(_0x5f53f3,_0x181821){return _0x5f53f3['define']('ServicenowAccount',attributes,{'tableName':_0x5495('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc46e=['rimraf','exports','ServicenowAccount','util','../../config/logger','moment','request-promise'];(function(_0x1f332b,_0x1f28c6){var _0x517bcd=function(_0x55959f){while(--_0x55959f){_0x1f332b['push'](_0x1f332b['shift']());}};_0x517bcd(++_0x1f28c6);}(_0xc46e,0x1c3));var _0xec46=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0xc46e[_0x1df473];return _0x1bdd49;};'use strict';var _=require('lodash');var util=require(_0xec46('0x0'));var logger=require(_0xec46('0x1'))('api');var moment=require(_0xec46('0x2'));var BPromise=require('bluebird');var rp=require(_0xec46('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec46('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xec46('0x5')]=function(_0x29eb8d,_0x4a5a01){return _0x29eb8d['define'](_0xec46('0x6'),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 475cf2f..4692fd8 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 _0x9518=['options','raw','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','request\x20sent','result','GetServicenowAccount','findAll'];(function(_0x2a97f7,_0x465e0c){var _0x13c258=function(_0x1b043d){while(--_0x1b043d){_0x2a97f7['push'](_0x2a97f7['shift']());}};_0x13c258(++_0x465e0c);}(_0x9518,0x115));var _0x8951=function(_0x3b2308,_0x53754c){_0x3b2308=_0x3b2308-0x0;var _0x42a190=_0x9518[_0x3b2308];return _0x42a190;};'use strict';var _=require(_0x8951('0x0'));var util=require(_0x8951('0x1'));var moment=require(_0x8951('0x2'));var BPromise=require(_0x8951('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8951('0x4'));var db=require(_0x8951('0x5'))['db'];var utils=require(_0x8951('0x6'));var logger=require(_0x8951('0x7'))(_0x8951('0x8'));var config=require(_0x8951('0x9'));var jayson=require(_0x8951('0xa'));var client=jayson[_0x8951('0xb')][_0x8951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc69528,_0x2bef74,_0x5a4124){return new BPromise(function(_0x216bdc,_0x56ca45){return client[_0x8951('0xd')](_0xc69528,_0x5a4124)[_0x8951('0xe')](function(_0x23b825){logger[_0x8951('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x2bef74,'request\x20sent');logger[_0x8951('0x10')](_0x8951('0x11'),_0x2bef74,'request\x20sent',JSON[_0x8951('0x12')](_0x23b825));if(_0x23b825['error']){if(_0x23b825[_0x8951('0x13')][_0x8951('0x14')]===0x1f4){logger['error'](_0x8951('0x15'),_0x2bef74,_0x23b825[_0x8951('0x13')]['message']);return _0x56ca45(_0x23b825[_0x8951('0x13')]['message']);}logger[_0x8951('0x13')](_0x8951('0x15'),_0x2bef74,_0x23b825[_0x8951('0x13')][_0x8951('0x16')]);return _0x216bdc(_0x23b825[_0x8951('0x13')][_0x8951('0x16')]);}else{logger[_0x8951('0xf')](_0x8951('0x15'),_0x2bef74,_0x8951('0x17'));_0x216bdc(_0x23b825[_0x8951('0x18')][_0x8951('0x16')]);}})['catch'](function(_0x14cad3){logger[_0x8951('0x13')](_0x8951('0x15'),_0x2bef74,_0x14cad3);_0x56ca45(_0x14cad3);});});}exports[_0x8951('0x19')]=function(_0x51956a){var _0x74bbf9=this;return new Promise(function(_0x17b010,_0x34917a){return db['ServicenowAccount'][_0x8951('0x1a')]({'raw':_0x51956a[_0x8951('0x1b')]?_0x51956a[_0x8951('0x1b')][_0x8951('0x1c')]===undefined?!![]:![]:!![],'where':_0x51956a['options']?_0x51956a[_0x8951('0x1b')][_0x8951('0x1d')]||null:null,'attributes':_0x51956a['options']?_0x51956a[_0x8951('0x1b')][_0x8951('0x1e')]||null:null,'limit':_0x51956a[_0x8951('0x1b')]?_0x51956a[_0x8951('0x1b')][_0x8951('0x1f')]||null:null,'include':_0x51956a[_0x8951('0x1b')]?_0x51956a[_0x8951('0x1b')][_0x8951('0x20')]?_[_0x8951('0x21')](_0x51956a[_0x8951('0x1b')][_0x8951('0x20')],function(_0x2fbd3a){return{'model':db[_0x2fbd3a[_0x8951('0x22')]],'as':_0x2fbd3a['as'],'attributes':_0x2fbd3a[_0x8951('0x1e')],'include':_0x2fbd3a[_0x8951('0x20')]?_[_0x8951('0x21')](_0x2fbd3a[_0x8951('0x20')],function(_0x347441){return{'model':db[_0x347441[_0x8951('0x22')]],'as':_0x347441['as'],'attributes':_0x347441[_0x8951('0x1e')],'include':_0x347441[_0x8951('0x20')]?_['map'](_0x347441['include'],function(_0x2b71d9){return{'model':db[_0x2b71d9['model']],'as':_0x2b71d9['as'],'attributes':_0x2b71d9[_0x8951('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8951('0xe')](function(_0x31a8ad){logger[_0x8951('0xf')]('GetServicenowAccount',_0x51956a);logger[_0x8951('0x10')](_0x8951('0x19'),_0x51956a,JSON[_0x8951('0x12')](_0x31a8ad));_0x17b010(_0x31a8ad);})[_0x8951('0x23')](function(_0x1769bc){logger['error'](_0x8951('0x19'),_0x1769bc[_0x8951('0x16')],_0x51956a);_0x34917a(_0x74bbf9[_0x8951('0x13')](0x1f4,_0x1769bc['message']));});});};exports[_0x8951('0x24')]=function(_0x57df18){var _0x467bcb=this;return new Promise(function(_0x529f97,_0x3a3819){return db['ServicenowAccount'][_0x8951('0x25')]({'raw':_0x57df18[_0x8951('0x1b')]?_0x57df18['options']['raw']===undefined?!![]:![]:!![],'where':_0x57df18['options']?_0x57df18[_0x8951('0x1b')][_0x8951('0x1d')]||null:null,'attributes':_0x57df18[_0x8951('0x1b')]?_0x57df18[_0x8951('0x1b')][_0x8951('0x1e')]||null:null,'include':_0x57df18[_0x8951('0x1b')]?_0x57df18[_0x8951('0x1b')][_0x8951('0x20')]?_['map'](_0x57df18[_0x8951('0x1b')][_0x8951('0x20')],function(_0x1f8464){return{'model':db[_0x1f8464[_0x8951('0x22')]],'as':_0x1f8464['as'],'attributes':_0x1f8464[_0x8951('0x1e')],'include':_0x1f8464[_0x8951('0x20')]?_[_0x8951('0x21')](_0x1f8464['include'],function(_0x3e4771){return{'model':db[_0x3e4771[_0x8951('0x22')]],'as':_0x3e4771['as'],'attributes':_0x3e4771[_0x8951('0x1e')],'include':_0x3e4771[_0x8951('0x20')]?_[_0x8951('0x21')](_0x3e4771['include'],function(_0x28ec4f){return{'model':db[_0x28ec4f['model']],'as':_0x28ec4f['as'],'attributes':_0x28ec4f[_0x8951('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8951('0xe')](function(_0x5f498c){logger[_0x8951('0xf')](_0x8951('0x24'),_0x57df18);logger[_0x8951('0x10')](_0x8951('0x24'),_0x57df18,JSON[_0x8951('0x12')](_0x5f498c));_0x529f97(_0x5f498c);})['catch'](function(_0x782d0d){logger[_0x8951('0x13')](_0x8951('0x24'),_0x782d0d[_0x8951('0x16')],_0x57df18);_0x3a3819(_0x467bcb[_0x8951('0x13')](0x1f4,_0x782d0d[_0x8951('0x16')]));});});}; \ No newline at end of file +var _0xb1b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util'];(function(_0x589b86,_0x413d8f){var _0x5dfe75=function(_0x3f8cc4){while(--_0x3f8cc4){_0x589b86['push'](_0x589b86['shift']());}};_0x5dfe75(++_0x413d8f);}(_0xb1b5,0x1c6));var _0x5b1b=function(_0x1d2d50,_0x49050a){_0x1d2d50=_0x1d2d50-0x0;var _0x2f7f56=_0xb1b5[_0x1d2d50];return _0x2f7f56;};'use strict';var _=require(_0x5b1b('0x0'));var util=require(_0x5b1b('0x1'));var moment=require(_0x5b1b('0x2'));var BPromise=require(_0x5b1b('0x3'));var rs=require(_0x5b1b('0x4'));var fs=require('fs');var Redis=require(_0x5b1b('0x5'));var db=require(_0x5b1b('0x6'))['db'];var utils=require(_0x5b1b('0x7'));var logger=require('../../config/logger')(_0x5b1b('0x8'));var config=require(_0x5b1b('0x9'));var jayson=require(_0x5b1b('0xa'));var client=jayson[_0x5b1b('0xb')][_0x5b1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28fddb,_0x51f1ed,_0x33a8a5){return new BPromise(function(_0x2d0359,_0x1ddc38){return client[_0x5b1b('0xd')](_0x28fddb,_0x33a8a5)[_0x5b1b('0xe')](function(_0x1d9661){logger[_0x5b1b('0xf')](_0x5b1b('0x10'),_0x51f1ed,_0x5b1b('0x11'));logger[_0x5b1b('0x12')](_0x5b1b('0x13'),_0x51f1ed,_0x5b1b('0x11'),JSON[_0x5b1b('0x14')](_0x1d9661));if(_0x1d9661[_0x5b1b('0x15')]){if(_0x1d9661['error'][_0x5b1b('0x16')]===0x1f4){logger[_0x5b1b('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x51f1ed,_0x1d9661['error'][_0x5b1b('0x17')]);return _0x1ddc38(_0x1d9661['error'][_0x5b1b('0x17')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x51f1ed,_0x1d9661[_0x5b1b('0x15')][_0x5b1b('0x17')]);return _0x2d0359(_0x1d9661[_0x5b1b('0x15')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x51f1ed,_0x5b1b('0x11'));_0x2d0359(_0x1d9661[_0x5b1b('0x18')][_0x5b1b('0x17')]);}})[_0x5b1b('0x19')](function(_0x2c51ab){logger['error'](_0x5b1b('0x10'),_0x51f1ed,_0x2c51ab);_0x1ddc38(_0x2c51ab);});});}exports['GetServicenowAccount']=function(_0x5e38da){var _0x180130=this;return new Promise(function(_0x100abb,_0x10693a){return db[_0x5b1b('0x1a')][_0x5b1b('0x1b')]({'raw':_0x5e38da[_0x5b1b('0x1c')]?_0x5e38da[_0x5b1b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5e38da[_0x5b1b('0x1c')]?_0x5e38da['options']['where']||null:null,'attributes':_0x5e38da[_0x5b1b('0x1c')]?_0x5e38da['options'][_0x5b1b('0x1d')]||null:null,'limit':_0x5e38da[_0x5b1b('0x1c')]?_0x5e38da[_0x5b1b('0x1c')][_0x5b1b('0x1e')]||null:null,'include':_0x5e38da[_0x5b1b('0x1c')]?_0x5e38da[_0x5b1b('0x1c')][_0x5b1b('0x1f')]?_[_0x5b1b('0x20')](_0x5e38da[_0x5b1b('0x1c')][_0x5b1b('0x1f')],function(_0x2d41bd){return{'model':db[_0x2d41bd[_0x5b1b('0x21')]],'as':_0x2d41bd['as'],'attributes':_0x2d41bd['attributes'],'include':_0x2d41bd[_0x5b1b('0x1f')]?_[_0x5b1b('0x20')](_0x2d41bd[_0x5b1b('0x1f')],function(_0x50a261){return{'model':db[_0x50a261[_0x5b1b('0x21')]],'as':_0x50a261['as'],'attributes':_0x50a261[_0x5b1b('0x1d')],'include':_0x50a261[_0x5b1b('0x1f')]?_[_0x5b1b('0x20')](_0x50a261['include'],function(_0x48727e){return{'model':db[_0x48727e[_0x5b1b('0x21')]],'as':_0x48727e['as'],'attributes':_0x48727e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b1b('0xe')](function(_0x8561a1){logger[_0x5b1b('0xf')](_0x5b1b('0x22'),_0x5e38da);logger[_0x5b1b('0x12')](_0x5b1b('0x22'),_0x5e38da,JSON[_0x5b1b('0x14')](_0x8561a1));_0x100abb(_0x8561a1);})[_0x5b1b('0x19')](function(_0x16917f){logger[_0x5b1b('0x15')]('GetServicenowAccount',_0x16917f[_0x5b1b('0x17')],_0x5e38da);_0x10693a(_0x180130['error'](0x1f4,_0x16917f[_0x5b1b('0x17')]));});});};exports[_0x5b1b('0x23')]=function(_0x5cccaf){var _0x4df75f=this;return new Promise(function(_0x30523a,_0x1a2bf4){return db[_0x5b1b('0x1a')][_0x5b1b('0x24')]({'raw':_0x5cccaf[_0x5b1b('0x1c')]?_0x5cccaf[_0x5b1b('0x1c')][_0x5b1b('0x25')]===undefined?!![]:![]:!![],'where':_0x5cccaf[_0x5b1b('0x1c')]?_0x5cccaf[_0x5b1b('0x1c')]['where']||null:null,'attributes':_0x5cccaf[_0x5b1b('0x1c')]?_0x5cccaf['options'][_0x5b1b('0x1d')]||null:null,'include':_0x5cccaf[_0x5b1b('0x1c')]?_0x5cccaf[_0x5b1b('0x1c')]['include']?_[_0x5b1b('0x20')](_0x5cccaf[_0x5b1b('0x1c')]['include'],function(_0x31759c){return{'model':db[_0x31759c[_0x5b1b('0x21')]],'as':_0x31759c['as'],'attributes':_0x31759c[_0x5b1b('0x1d')],'include':_0x31759c[_0x5b1b('0x1f')]?_[_0x5b1b('0x20')](_0x31759c[_0x5b1b('0x1f')],function(_0x58becf){return{'model':db[_0x58becf[_0x5b1b('0x21')]],'as':_0x58becf['as'],'attributes':_0x58becf[_0x5b1b('0x1d')],'include':_0x58becf[_0x5b1b('0x1f')]?_[_0x5b1b('0x20')](_0x58becf[_0x5b1b('0x1f')],function(_0x3fd740){return{'model':db[_0x3fd740[_0x5b1b('0x21')]],'as':_0x3fd740['as'],'attributes':_0x3fd740['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b1b('0xe')](function(_0x5ac4e0){logger['info'](_0x5b1b('0x23'),_0x5cccaf);logger['debug'](_0x5b1b('0x23'),_0x5cccaf,JSON['stringify'](_0x5ac4e0));_0x30523a(_0x5ac4e0);})[_0x5b1b('0x19')](function(_0x1c8cf7){logger[_0x5b1b('0x15')](_0x5b1b('0x23'),_0x1c8cf7[_0x5b1b('0x17')],_0x5cccaf);_0x1a2bf4(_0x4df75f['error'](0x1f4,_0x1c8cf7['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 92a3e9a..86d8548 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 _0xaf14=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x101c1a,_0x37f379){var _0x18bb93=function(_0x23a67c){while(--_0x23a67c){_0x101c1a['push'](_0x101c1a['shift']());}};_0x18bb93(++_0x37f379);}(_0xaf14,0x13b));var _0x4af1=function(_0x18b31d,_0x4e9519){_0x18b31d=_0x18b31d-0x0;var _0x112463=_0xaf14[_0x18b31d];return _0x112463;};'use strict';var multer=require(_0x4af1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4af1('0x1'));var express=require(_0x4af1('0x2'));var router=express['Router']();var auth=require(_0x4af1('0x3'));var interaction=require(_0x4af1('0x4'));var config=require(_0x4af1('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0x4af1('0x6')]('/',auth[_0x4af1('0x7')](),controller[_0x4af1('0x8')]);router[_0x4af1('0x6')](_0x4af1('0x9'),auth[_0x4af1('0x7')](),controller[_0x4af1('0xa')]);router[_0x4af1('0x6')](_0x4af1('0xb'),auth[_0x4af1('0x7')](),controller[_0x4af1('0xc')]);router['get'](_0x4af1('0xd'),auth[_0x4af1('0x7')](),controller[_0x4af1('0xe')]);router[_0x4af1('0x6')](_0x4af1('0xf'),auth[_0x4af1('0x7')](),controller[_0x4af1('0x10')]);router[_0x4af1('0x11')]('/',auth[_0x4af1('0x7')](),controller[_0x4af1('0x12')]);router[_0x4af1('0x13')](_0x4af1('0x9'),auth['isAuthenticated'](),controller[_0x4af1('0x14')]);router[_0x4af1('0x15')]('/:id',auth[_0x4af1('0x7')](),controller[_0x4af1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x85b7=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x85b7,0x1a2));var _0x785b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x85b7[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x785b('0x0'));var util=require(_0x785b('0x1'));var path=require('path');var timeout=require(_0x785b('0x2'));var express=require('express');var router=express[_0x785b('0x3')]();var auth=require(_0x785b('0x4'));var interaction=require(_0x785b('0x5'));var config=require('../../config/environment');var controller=require(_0x785b('0x6'));router[_0x785b('0x7')]('/',auth[_0x785b('0x8')](),controller[_0x785b('0x9')]);router['get'](_0x785b('0xa'),auth[_0x785b('0x8')](),controller['show']);router[_0x785b('0x7')](_0x785b('0xb'),auth[_0x785b('0x8')](),controller[_0x785b('0xc')]);router[_0x785b('0x7')](_0x785b('0xd'),auth['isAuthenticated'](),controller[_0x785b('0xe')]);router['get'](_0x785b('0xf'),auth[_0x785b('0x8')](),controller['getDescriptions']);router[_0x785b('0x10')]('/',auth['isAuthenticated'](),controller[_0x785b('0x11')]);router[_0x785b('0x12')]('/:id',auth[_0x785b('0x8')](),controller[_0x785b('0x13')]);router[_0x785b('0x14')](_0x785b('0xa'),auth[_0x785b('0x8')](),controller[_0x785b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index b1fdc04..40882cc 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 _0xc90a=['exports','STRING','sequelize'];(function(_0x499aa7,_0x505149){var _0x233cd4=function(_0x34d83b){while(--_0x34d83b){_0x499aa7['push'](_0x499aa7['shift']());}};_0x233cd4(++_0x505149);}(_0xc90a,0xfb));var _0xac90=function(_0x2bd0d5,_0x4ace31){_0x2bd0d5=_0x2bd0d5-0x0;var _0x3a963e=_0xc90a[_0x2bd0d5];return _0x3a963e;};'use strict';var Sequelize=require(_0xac90('0x0'));module[_0xac90('0x1')]={'name':{'type':Sequelize[_0xac90('0x2')]},'description':{'type':Sequelize[_0xac90('0x2')]}}; \ No newline at end of file +var _0x824a=['exports','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x824a,0x1e4));var _0xa824=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x824a[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0xa824('0x0')]={'name':{'type':Sequelize[_0xa824('0x1')]},'description':{'type':Sequelize[_0xa824('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b98edb5..42ef8e5 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 _0x9c00=['ServicenowConfiguration','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getFields','findOne','pick','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','destroy','stack','name','send','index','map'];(function(_0x330b5a,_0x1cc7ac){var _0x44ebc2=function(_0x24be96){while(--_0x24be96){_0x330b5a['push'](_0x330b5a['shift']());}};_0x44ebc2(++_0x1cc7ac);}(_0x9c00,0x1a0));var _0x09c0=function(_0x36975e,_0x103ce0){_0x36975e=_0x36975e-0x0;var _0x51ded9=_0x9c00[_0x36975e];return _0x51ded9;};'use strict';var pdf=require(_0x09c0('0x0'));var emlformat=require(_0x09c0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09c0('0x2'));var rp=require(_0x09c0('0x3'));var moment=require('moment');var BPromise=require(_0x09c0('0x4'));var Mustache=require(_0x09c0('0x5'));var util=require(_0x09c0('0x6'));var path=require(_0x09c0('0x7'));var sox=require(_0x09c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var db=require(_0x09c0('0x19'))['db'];var jayson=require(_0x09c0('0x1a'));var client=jayson[_0x09c0('0x1b')][_0x09c0('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x331905,_0x6149a8,_0x2a86da){if(_0x2a86da){var _0x342ceb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x342ceb[_0x09c0('0x1d')](_0x6149a8)){return _0x331905;}else{throw new db[(_0x09c0('0x1e'))][(_0x09c0('0x1f'))](_0x09c0('0x20'));}}else{return _0x331905;}}function respondWithRpcPromise(_0x45a265,_0x33c3d6,_0x2fdf11,_0x4ff6b7){return new BPromise(function(_0x590129,_0x558b4f){var _0x42030d=_0x4ff6b7||client;return _0x42030d[_0x09c0('0x21')](_0x45a265,_0x2fdf11)[_0x09c0('0x22')](function(_0x628272){logger['info'](_0x09c0('0x23'),_0x33c3d6,'request\x20sent');logger['debug'](_0x09c0('0x24'),_0x33c3d6,'request\x20sent',JSON[_0x09c0('0x25')](_0x628272));if(_0x628272[_0x09c0('0x26')]){if(_0x628272[_0x09c0('0x26')]['code']===0x1f4){logger[_0x09c0('0x26')](_0x09c0('0x23'),_0x33c3d6,_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);return _0x558b4f(_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);}logger[_0x09c0('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x33c3d6,_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);return _0x590129(_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x33c3d6,_0x09c0('0x28'));_0x590129(_0x628272[_0x09c0('0x29')][_0x09c0('0x27')]);}})[_0x09c0('0x2a')](function(_0x491e6f){logger[_0x09c0('0x26')](_0x09c0('0x23'),_0x33c3d6,_0x491e6f);_0x558b4f(_0x491e6f);});});}function respondWithStatusCode(_0x56d883,_0x2c7202){_0x2c7202=_0x2c7202||0xcc;return function(_0x163a59){if(_0x163a59){return _0x56d883[_0x09c0('0x2b')](_0x2c7202);}return _0x56d883[_0x09c0('0x2c')](_0x2c7202)[_0x09c0('0x2d')]();};}function respondWithResult(_0x1d2d9d,_0x45cc64){_0x45cc64=_0x45cc64||0xc8;return function(_0x35b61c){if(_0x35b61c){return _0x1d2d9d[_0x09c0('0x2c')](_0x45cc64)[_0x09c0('0x2e')](_0x35b61c);}};}function respondWithFilteredResult(_0x46a36a,_0x5e53ac){return function(_0x15a667){if(_0x15a667){var _0x1bdde9=_0x15a667[_0x09c0('0x2f')],_0x53a7b8=_0x5e53ac['offset'],_0x1d09e0=_0x5e53ac[_0x09c0('0x30')]+_0x5e53ac[_0x09c0('0x31')],_0x5aa0b9;if(_0x1d09e0>=_0x1bdde9){_0x1d09e0=_0x1bdde9;_0x5aa0b9=0xc8;}else{_0x5aa0b9=0xce;}_0x46a36a[_0x09c0('0x2c')](_0x5aa0b9);return _0x46a36a[_0x09c0('0x32')]('Content-Range',_0x53a7b8+'-'+_0x1d09e0+'/'+_0x1bdde9)['json'](_0x15a667);}return null;};}function patchUpdates(_0x17c374){return function(_0x38a315){try{jsonpatch[_0x09c0('0x33')](_0x38a315,_0x17c374,!![]);}catch(_0x5c93ca){return BPromise[_0x09c0('0x34')](_0x5c93ca);}return _0x38a315['save']();};}function saveUpdates(_0x350cd3,_0x21755d){return function(_0x16cf08){if(_0x16cf08){return _0x16cf08['update'](_0x350cd3)[_0x09c0('0x22')](function(_0x4574f7){return _0x4574f7;});}return null;};}function removeEntity(_0xbb7685,_0x184c0b){return function(_0x234f07){if(_0x234f07){return _0x234f07[_0x09c0('0x35')]()[_0x09c0('0x22')](function(){_0xbb7685['status'](0xcc)[_0x09c0('0x2d')]();});}};}function handleEntityNotFound(_0x2c19be,_0x2f136c){return function(_0x132f6c){if(!_0x132f6c){_0x2c19be[_0x09c0('0x2b')](0x194);}return _0x132f6c;};}function handleError(_0x50a37e,_0x920e2c){_0x920e2c=_0x920e2c||0x1f4;return function(_0x20349e){logger[_0x09c0('0x26')](_0x20349e[_0x09c0('0x36')]);if(_0x20349e[_0x09c0('0x37')]){delete _0x20349e['name'];}_0x50a37e[_0x09c0('0x2c')](_0x920e2c)[_0x09c0('0x38')](_0x20349e);};}exports[_0x09c0('0x39')]=function(_0x16f81e,_0x419d1c){var _0x3e8b74={},_0x21c48c={},_0x5f50fe={'count':0x0,'rows':[]};var _0x363b5c=_[_0x09c0('0x3a')](db[_0x09c0('0x3b')][_0x09c0('0x3c')],function(_0x453c23){return{'name':_0x453c23['fieldName'],'type':_0x453c23['type']['key']};});_0x21c48c['model']=_[_0x09c0('0x3a')](_0x363b5c,_0x09c0('0x37'));_0x21c48c[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x16f81e[_0x09c0('0x3d')]);_0x21c48c['filters']=_[_0x09c0('0x3f')](_0x21c48c[_0x09c0('0x40')],_0x21c48c['query']);_0x3e8b74[_0x09c0('0x41')]=_['intersection'](_0x21c48c[_0x09c0('0x40')],qs['fields'](_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x3e8b74['attributes']=_0x3e8b74[_0x09c0('0x41')][_0x09c0('0x43')]?_0x3e8b74['attributes']:_0x21c48c[_0x09c0('0x40')];if(!_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x44')](_0x09c0('0x45'))){_0x3e8b74[_0x09c0('0x31')]=qs[_0x09c0('0x31')](_0x16f81e['query'][_0x09c0('0x31')]);_0x3e8b74[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x16f81e['query'][_0x09c0('0x30')]);}_0x3e8b74[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x16f81e['query'][_0x09c0('0x47')]);_0x3e8b74[_0x09c0('0x48')]=qs['filters'](_['pick'](_0x16f81e[_0x09c0('0x3d')],_0x21c48c[_0x09c0('0x49')]),_0x363b5c);if(_0x16f81e['query'][_0x09c0('0x4a')]){_0x3e8b74[_0x09c0('0x48')]=_['merge'](_0x3e8b74[_0x09c0('0x48')],{'$or':_[_0x09c0('0x3a')](_0x363b5c,function(_0x2e7d4f){if(_0x2e7d4f[_0x09c0('0x4b')]!==_0x09c0('0x4c')){var _0x569e02={};_0x569e02[_0x2e7d4f[_0x09c0('0x37')]]={'$like':'%'+_0x16f81e['query']['filter']+'%'};return _0x569e02;}})});}_0x3e8b74=_[_0x09c0('0x4d')]({},_0x3e8b74,_0x16f81e[_0x09c0('0x4e')]);var _0x17876c={'where':_0x3e8b74[_0x09c0('0x48')]};return db[_0x09c0('0x3b')][_0x09c0('0x2f')](_0x17876c)['then'](function(_0x5e239a){_0x5f50fe['count']=_0x5e239a;if(_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x4f')]){_0x3e8b74[_0x09c0('0x50')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x09c0('0x51')](_0x3e8b74);})[_0x09c0('0x22')](function(_0x2016f1){_0x5f50fe[_0x09c0('0x52')]=_0x2016f1;return _0x5f50fe;})[_0x09c0('0x22')](respondWithFilteredResult(_0x419d1c,_0x3e8b74))[_0x09c0('0x2a')](handleError(_0x419d1c,null));};exports[_0x09c0('0x53')]=function(_0x2b3c56,_0x3f6d14){var _0x38085c={'raw':![],'where':{'id':_0x2b3c56[_0x09c0('0x54')]['id']}},_0x1b0198={};_0x1b0198[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db[_0x09c0('0x3b')][_0x09c0('0x3c')]);_0x1b0198[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x2b3c56[_0x09c0('0x3d')]);_0x1b0198[_0x09c0('0x49')]=_['intersection'](_0x1b0198[_0x09c0('0x40')],_0x1b0198[_0x09c0('0x3d')]);_0x38085c[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x1b0198[_0x09c0('0x40')],qs['fields'](_0x2b3c56[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x38085c[_0x09c0('0x41')]=_0x38085c['attributes'][_0x09c0('0x43')]?_0x38085c[_0x09c0('0x41')]:_0x1b0198[_0x09c0('0x40')];if(_0x2b3c56[_0x09c0('0x3d')][_0x09c0('0x4f')]){_0x38085c[_0x09c0('0x50')]=[{'all':!![]}];}_0x38085c=_[_0x09c0('0x4d')]({},_0x38085c,_0x2b3c56['options']);return db[_0x09c0('0x3b')][_0x09c0('0x55')](_0x38085c)[_0x09c0('0x22')](handleEntityNotFound(_0x3f6d14,null))[_0x09c0('0x22')](respondWithResult(_0x3f6d14,null))[_0x09c0('0x2a')](handleError(_0x3f6d14,null));};exports[_0x09c0('0x56')]=function(_0x3ebabb,_0x4987cf){return db['ServicenowConfiguration'][_0x09c0('0x56')](_0x3ebabb[_0x09c0('0x57')],{})[_0x09c0('0x22')](respondWithResult(_0x4987cf,0xc9))['catch'](handleError(_0x4987cf,null));};exports[_0x09c0('0x58')]=function(_0x5b8e7f,_0x2fecec){if(_0x5b8e7f[_0x09c0('0x57')]['id']){delete _0x5b8e7f[_0x09c0('0x57')]['id'];}return db[_0x09c0('0x3b')][_0x09c0('0x55')]({'where':{'id':_0x5b8e7f[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x2fecec,null))['then'](saveUpdates(_0x5b8e7f[_0x09c0('0x57')],null))[_0x09c0('0x22')](respondWithResult(_0x2fecec,null))[_0x09c0('0x2a')](handleError(_0x2fecec,null));};exports[_0x09c0('0x35')]=function(_0x3a6845,_0x219195){return db[_0x09c0('0x3b')][_0x09c0('0x55')]({'where':{'id':_0x3a6845[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x219195,null))[_0x09c0('0x22')](removeEntity(_0x219195,null))['catch'](handleError(_0x219195,null));};exports[_0x09c0('0x59')]=function(_0x3564e6,_0x26dc22,_0x6894c1){var _0x4f3457={};var _0x157520={};var _0x48dae0;var _0x29205f;return db[_0x09c0('0x3b')][_0x09c0('0x5a')]({'where':{'id':_0x3564e6['params']['id']}})['then'](handleEntityNotFound(_0x26dc22,null))[_0x09c0('0x22')](function(_0x36e3b0){if(_0x36e3b0){_0x48dae0=_0x36e3b0;_0x157520[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db['ServicenowField'][_0x09c0('0x3c')]);_0x157520[_0x09c0('0x3d')]=_['keys'](_0x3564e6[_0x09c0('0x3d')]);_0x157520[_0x09c0('0x49')]=_[_0x09c0('0x3f')](_0x157520[_0x09c0('0x40')],_0x157520['query']);_0x4f3457[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x157520[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x4f3457[_0x09c0('0x41')]=_0x4f3457[_0x09c0('0x41')][_0x09c0('0x43')]?_0x4f3457[_0x09c0('0x41')]:_0x157520[_0x09c0('0x40')];_0x4f3457[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x3564e6['query'][_0x09c0('0x47')]);_0x4f3457[_0x09c0('0x48')]=qs[_0x09c0('0x49')](_[_0x09c0('0x5b')](_0x3564e6[_0x09c0('0x3d')],_0x157520['filters']));if(_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x4a')]){_0x4f3457[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x4f3457['where'],{'$or':_[_0x09c0('0x3a')](_0x4f3457[_0x09c0('0x41')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x325013;})});}_0x4f3457=_[_0x09c0('0x4d')]({},_0x4f3457,_0x3564e6[_0x09c0('0x4e')]);return _0x48dae0['getFields'](_0x4f3457);}})[_0x09c0('0x22')](function(_0x302c81){if(_0x302c81){_0x29205f=_0x302c81[_0x09c0('0x43')];if(!_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x44')]('nolimit')){_0x4f3457[_0x09c0('0x31')]=qs[_0x09c0('0x31')](_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x4f3457[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x3564e6['query']['offset']);}return _0x48dae0['getFields'](_0x4f3457);}})['then'](function(_0x7c1cb8){if(_0x7c1cb8){return _0x7c1cb8?{'count':_0x29205f,'rows':_0x7c1cb8}:null;}})[_0x09c0('0x22')](respondWithResult(_0x26dc22,null))[_0x09c0('0x2a')](handleError(_0x26dc22,null));};exports['getSubjects']=function(_0x3306b9,_0x595b73,_0x368108){var _0x14872e={};var _0x5732ae={};var _0x3998ec;var _0x48d41f;return db['ServicenowConfiguration'][_0x09c0('0x5a')]({'where':{'id':_0x3306b9[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x595b73,null))[_0x09c0('0x22')](function(_0x2c34e6){if(_0x2c34e6){_0x3998ec=_0x2c34e6;_0x5732ae[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db[_0x09c0('0x5c')][_0x09c0('0x3c')]);_0x5732ae[_0x09c0('0x3d')]=_['keys'](_0x3306b9[_0x09c0('0x3d')]);_0x5732ae[_0x09c0('0x49')]=_['intersection'](_0x5732ae['model'],_0x5732ae[_0x09c0('0x3d')]);_0x14872e[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x5732ae[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x14872e['attributes']=_0x14872e[_0x09c0('0x41')]['length']?_0x14872e[_0x09c0('0x41')]:_0x5732ae[_0x09c0('0x40')];_0x14872e[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x3306b9[_0x09c0('0x3d')]['sort']);_0x14872e[_0x09c0('0x48')]=qs['filters'](_[_0x09c0('0x5b')](_0x3306b9['query'],_0x5732ae[_0x09c0('0x49')]));if(_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x4a')]){_0x14872e[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x14872e[_0x09c0('0x48')],{'$or':_[_0x09c0('0x3a')](_0x14872e['attributes'],function(_0x4ab50d){var _0x2c29c2={};_0x2c29c2[_0x4ab50d]={'$like':'%'+_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x2c29c2;})});}_0x14872e=_[_0x09c0('0x4d')]({},_0x14872e,_0x3306b9[_0x09c0('0x4e')]);return _0x3998ec[_0x09c0('0x5d')](_0x14872e);}})[_0x09c0('0x22')](function(_0x139c05){if(_0x139c05){_0x48d41f=_0x139c05[_0x09c0('0x43')];if(!_0x3306b9[_0x09c0('0x3d')]['hasOwnProperty']('nolimit')){_0x14872e['limit']=qs[_0x09c0('0x31')](_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x14872e['offset']=qs['offset'](_0x3306b9[_0x09c0('0x3d')]['offset']);}return _0x3998ec[_0x09c0('0x5d')](_0x14872e);}})[_0x09c0('0x22')](function(_0x5c3d6a){if(_0x5c3d6a){return _0x5c3d6a?{'count':_0x48d41f,'rows':_0x5c3d6a}:null;}})[_0x09c0('0x22')](respondWithResult(_0x595b73,null))['catch'](handleError(_0x595b73,null));};exports[_0x09c0('0x5e')]=function(_0x1fd9ce,_0x15a0fe,_0x55dcf1){var _0x2ea30f={};var _0x456adf={};var _0x2a637e;var _0x27012f;return db[_0x09c0('0x3b')][_0x09c0('0x5a')]({'where':{'id':_0x1fd9ce[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x15a0fe,null))[_0x09c0('0x22')](function(_0x26cb1d){if(_0x26cb1d){_0x2a637e=_0x26cb1d;_0x456adf[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db['ServicenowField'][_0x09c0('0x3c')]);_0x456adf[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x1fd9ce[_0x09c0('0x3d')]);_0x456adf[_0x09c0('0x49')]=_['intersection'](_0x456adf[_0x09c0('0x40')],_0x456adf['query']);_0x2ea30f['attributes']=_[_0x09c0('0x3f')](_0x456adf[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x1fd9ce['query'][_0x09c0('0x42')]));_0x2ea30f[_0x09c0('0x41')]=_0x2ea30f[_0x09c0('0x41')][_0x09c0('0x43')]?_0x2ea30f[_0x09c0('0x41')]:_0x456adf[_0x09c0('0x40')];_0x2ea30f['order']=qs[_0x09c0('0x47')](_0x1fd9ce[_0x09c0('0x3d')]['sort']);_0x2ea30f[_0x09c0('0x48')]=qs[_0x09c0('0x49')](_['pick'](_0x1fd9ce[_0x09c0('0x3d')],_0x456adf[_0x09c0('0x49')]));if(_0x1fd9ce[_0x09c0('0x3d')]['filter']){_0x2ea30f[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x2ea30f['where'],{'$or':_[_0x09c0('0x3a')](_0x2ea30f[_0x09c0('0x41')],function(_0x5aa1b6){var _0x42a643={};_0x42a643[_0x5aa1b6]={'$like':'%'+_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x42a643;})});}_0x2ea30f=_[_0x09c0('0x4d')]({},_0x2ea30f,_0x1fd9ce[_0x09c0('0x4e')]);return _0x2a637e['getDescriptions'](_0x2ea30f);}})[_0x09c0('0x22')](function(_0x2bf080){if(_0x2bf080){_0x27012f=_0x2bf080[_0x09c0('0x43')];if(!_0x1fd9ce['query'][_0x09c0('0x44')](_0x09c0('0x45'))){_0x2ea30f[_0x09c0('0x31')]=qs['limit'](_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x2ea30f[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x30')]);}return _0x2a637e[_0x09c0('0x5e')](_0x2ea30f);}})['then'](function(_0x22a245){if(_0x22a245){return _0x22a245?{'count':_0x27012f,'rows':_0x22a245}:null;}})[_0x09c0('0x22')](respondWithResult(_0x15a0fe,null))[_0x09c0('0x2a')](handleError(_0x15a0fe,null));}; \ No newline at end of file +var _0x1775=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','save','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','ServicenowConfiguration','include','rows','show','length','includeAll','find','create','update','body','params','getFields','findOne','ServicenowField','getSubjects','sort','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x12e4b9,_0xe39e09){var _0x3b0438=function(_0x21413c){while(--_0x21413c){_0x12e4b9['push'](_0x12e4b9['shift']());}};_0x3b0438(++_0xe39e09);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5177('0x0'));var rimraf=require(_0x5177('0x1'));var zipdir=require(_0x5177('0x2'));var jsonpatch=require(_0x5177('0x3'));var rp=require(_0x5177('0x4'));var moment=require(_0x5177('0x5'));var BPromise=require(_0x5177('0x6'));var Mustache=require(_0x5177('0x7'));var util=require(_0x5177('0x8'));var path=require(_0x5177('0x9'));var sox=require(_0x5177('0xa'));var csv=require(_0x5177('0xb'));var ejs=require(_0x5177('0xc'));var fs=require('fs');var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xb'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var db=require(_0x5177('0x1a'))['db'];var jayson=require(_0x5177('0x1b'));var client=jayson[_0x5177('0x1c')][_0x5177('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x111e99,_0x299eba,_0x1ab4f1){if(_0x1ab4f1){var _0x2ec90f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ec90f[_0x5177('0x1e')](_0x299eba)){return _0x111e99;}else{throw new db[(_0x5177('0x1f'))][(_0x5177('0x20'))](_0x5177('0x21'));}}else{return _0x111e99;}}function respondWithRpcPromise(_0x29cd2c,_0x31aff8,_0x1b32e6,_0x175ca6){return new BPromise(function(_0x2ab5e5,_0x7dba6f){var _0xe6dcf6=_0x175ca6||client;return _0xe6dcf6['request'](_0x29cd2c,_0x1b32e6)[_0x5177('0x22')](function(_0x41e687){logger[_0x5177('0x23')](_0x5177('0x24'),_0x31aff8,'request\x20sent');logger[_0x5177('0x25')](_0x5177('0x26'),_0x31aff8,_0x5177('0x27'),JSON['stringify'](_0x41e687));if(_0x41e687[_0x5177('0x28')]){if(_0x41e687['error'][_0x5177('0x29')]===0x1f4){logger[_0x5177('0x28')](_0x5177('0x24'),_0x31aff8,_0x41e687[_0x5177('0x28')][_0x5177('0x2a')]);return _0x7dba6f(_0x41e687[_0x5177('0x28')][_0x5177('0x2a')]);}logger[_0x5177('0x28')](_0x5177('0x24'),_0x31aff8,_0x41e687[_0x5177('0x28')][_0x5177('0x2a')]);return _0x2ab5e5(_0x41e687[_0x5177('0x28')]['message']);}else{logger[_0x5177('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x31aff8,_0x5177('0x27'));_0x2ab5e5(_0x41e687[_0x5177('0x2b')][_0x5177('0x2a')]);}})[_0x5177('0x2c')](function(_0x4bc8e2){logger[_0x5177('0x28')]('ServicenowConfiguration,\x20%s,\x20%s',_0x31aff8,_0x4bc8e2);_0x7dba6f(_0x4bc8e2);});});}function respondWithStatusCode(_0x564139,_0x19a0c2){_0x19a0c2=_0x19a0c2||0xcc;return function(_0x15cb93){if(_0x15cb93){return _0x564139['sendStatus'](_0x19a0c2);}return _0x564139[_0x5177('0x2d')](_0x19a0c2)['end']();};}function respondWithResult(_0x231d35,_0x1cbd29){_0x1cbd29=_0x1cbd29||0xc8;return function(_0x58846c){if(_0x58846c){return _0x231d35[_0x5177('0x2d')](_0x1cbd29)[_0x5177('0x2e')](_0x58846c);}};}function respondWithFilteredResult(_0x3c4248,_0x7f86e){return function(_0xe98ff1){if(_0xe98ff1){var _0x1cef5d=_0xe98ff1[_0x5177('0x2f')],_0x5577bb=_0x7f86e[_0x5177('0x30')],_0x498fcd=_0x7f86e[_0x5177('0x30')]+_0x7f86e[_0x5177('0x31')],_0x45cf20;if(_0x498fcd>=_0x1cef5d){_0x498fcd=_0x1cef5d;_0x45cf20=0xc8;}else{_0x45cf20=0xce;}_0x3c4248[_0x5177('0x2d')](_0x45cf20);return _0x3c4248[_0x5177('0x32')](_0x5177('0x33'),_0x5577bb+'-'+_0x498fcd+'/'+_0x1cef5d)['json'](_0xe98ff1);}return null;};}function patchUpdates(_0x42e1db){return function(_0x2233a2){try{jsonpatch['apply'](_0x2233a2,_0x42e1db,!![]);}catch(_0x32bea9){return BPromise['reject'](_0x32bea9);}return _0x2233a2[_0x5177('0x34')]();};}function saveUpdates(_0x1a2c46,_0x1ba51c){return function(_0x5e2e5a){if(_0x5e2e5a){return _0x5e2e5a['update'](_0x1a2c46)[_0x5177('0x22')](function(_0x45ae80){return _0x45ae80;});}return null;};}function removeEntity(_0x6bcb80,_0x3735e9){return function(_0x3f41ad){if(_0x3f41ad){return _0x3f41ad[_0x5177('0x35')]()[_0x5177('0x22')](function(){_0x6bcb80[_0x5177('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x459ac6,_0x1d9afe){return function(_0x570522){if(!_0x570522){_0x459ac6[_0x5177('0x36')](0x194);}return _0x570522;};}function handleError(_0x2a26fc,_0x172196){_0x172196=_0x172196||0x1f4;return function(_0x8727c6){logger[_0x5177('0x28')](_0x8727c6[_0x5177('0x37')]);if(_0x8727c6['name']){delete _0x8727c6[_0x5177('0x38')];}_0x2a26fc[_0x5177('0x2d')](_0x172196)[_0x5177('0x39')](_0x8727c6);};}exports[_0x5177('0x3a')]=function(_0x154296,_0xacaa96){var _0x1bb1e3={},_0x5a5a33={},_0x257350={'count':0x0,'rows':[]};var _0x2ff13b=_['map'](db['ServicenowConfiguration'][_0x5177('0x3b')],function(_0x188cec){return{'name':_0x188cec[_0x5177('0x3c')],'type':_0x188cec[_0x5177('0x3d')][_0x5177('0x3e')]};});_0x5a5a33[_0x5177('0x3f')]=_[_0x5177('0x40')](_0x2ff13b,_0x5177('0x38'));_0x5a5a33[_0x5177('0x41')]=_[_0x5177('0x42')](_0x154296[_0x5177('0x41')]);_0x5a5a33[_0x5177('0x43')]=_[_0x5177('0x44')](_0x5a5a33['model'],_0x5a5a33[_0x5177('0x41')]);_0x1bb1e3[_0x5177('0x45')]=_['intersection'](_0x5a5a33[_0x5177('0x3f')],qs['fields'](_0x154296[_0x5177('0x41')][_0x5177('0x46')]));_0x1bb1e3[_0x5177('0x45')]=_0x1bb1e3['attributes']['length']?_0x1bb1e3[_0x5177('0x45')]:_0x5a5a33[_0x5177('0x3f')];if(!_0x154296[_0x5177('0x41')][_0x5177('0x47')](_0x5177('0x48'))){_0x1bb1e3[_0x5177('0x31')]=qs[_0x5177('0x31')](_0x154296[_0x5177('0x41')]['limit']);_0x1bb1e3[_0x5177('0x30')]=qs['offset'](_0x154296['query'][_0x5177('0x30')]);}_0x1bb1e3[_0x5177('0x49')]=qs['sort'](_0x154296[_0x5177('0x41')]['sort']);_0x1bb1e3['where']=qs[_0x5177('0x43')](_[_0x5177('0x4a')](_0x154296[_0x5177('0x41')],_0x5a5a33[_0x5177('0x43')]),_0x2ff13b);if(_0x154296[_0x5177('0x41')][_0x5177('0x4b')]){_0x1bb1e3[_0x5177('0x4c')]=_['merge'](_0x1bb1e3['where'],{'$or':_[_0x5177('0x40')](_0x2ff13b,function(_0x511dc0){if(_0x511dc0[_0x5177('0x3d')]!==_0x5177('0x4d')){var _0x11b846={};_0x11b846[_0x511dc0[_0x5177('0x38')]]={'$like':'%'+_0x154296['query'][_0x5177('0x4b')]+'%'};return _0x11b846;}})});}_0x1bb1e3=_[_0x5177('0x4e')]({},_0x1bb1e3,_0x154296[_0x5177('0x4f')]);var _0x18b045={'where':_0x1bb1e3[_0x5177('0x4c')]};return db[_0x5177('0x50')][_0x5177('0x2f')](_0x18b045)[_0x5177('0x22')](function(_0x1ada68){_0x257350[_0x5177('0x2f')]=_0x1ada68;if(_0x154296[_0x5177('0x41')]['includeAll']){_0x1bb1e3[_0x5177('0x51')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x1bb1e3);})['then'](function(_0x2f9ff9){_0x257350[_0x5177('0x52')]=_0x2f9ff9;return _0x257350;})['then'](respondWithFilteredResult(_0xacaa96,_0x1bb1e3))[_0x5177('0x2c')](handleError(_0xacaa96,null));};exports[_0x5177('0x53')]=function(_0x208483,_0x4891fe){var _0x1d4ae4={'raw':![],'where':{'id':_0x208483['params']['id']}},_0x5981dc={};_0x5981dc['model']=_[_0x5177('0x42')](db[_0x5177('0x50')][_0x5177('0x3b')]);_0x5981dc['query']=_['keys'](_0x208483[_0x5177('0x41')]);_0x5981dc['filters']=_[_0x5177('0x44')](_0x5981dc[_0x5177('0x3f')],_0x5981dc[_0x5177('0x41')]);_0x1d4ae4[_0x5177('0x45')]=_[_0x5177('0x44')](_0x5981dc[_0x5177('0x3f')],qs[_0x5177('0x46')](_0x208483[_0x5177('0x41')][_0x5177('0x46')]));_0x1d4ae4[_0x5177('0x45')]=_0x1d4ae4[_0x5177('0x45')][_0x5177('0x54')]?_0x1d4ae4[_0x5177('0x45')]:_0x5981dc['model'];if(_0x208483['query'][_0x5177('0x55')]){_0x1d4ae4['include']=[{'all':!![]}];}_0x1d4ae4=_[_0x5177('0x4e')]({},_0x1d4ae4,_0x208483['options']);return db[_0x5177('0x50')][_0x5177('0x56')](_0x1d4ae4)[_0x5177('0x22')](handleEntityNotFound(_0x4891fe,null))['then'](respondWithResult(_0x4891fe,null))['catch'](handleError(_0x4891fe,null));};exports[_0x5177('0x57')]=function(_0x43b5b9,_0x2eb560){return db[_0x5177('0x50')]['create'](_0x43b5b9['body'],{})[_0x5177('0x22')](respondWithResult(_0x2eb560,0xc9))[_0x5177('0x2c')](handleError(_0x2eb560,null));};exports[_0x5177('0x58')]=function(_0x736b13,_0x4ad742){if(_0x736b13[_0x5177('0x59')]['id']){delete _0x736b13[_0x5177('0x59')]['id'];}return db[_0x5177('0x50')]['find']({'where':{'id':_0x736b13[_0x5177('0x5a')]['id']}})[_0x5177('0x22')](handleEntityNotFound(_0x4ad742,null))[_0x5177('0x22')](saveUpdates(_0x736b13['body'],null))[_0x5177('0x22')](respondWithResult(_0x4ad742,null))['catch'](handleError(_0x4ad742,null));};exports[_0x5177('0x35')]=function(_0x39fb92,_0x3268bd){return db['ServicenowConfiguration'][_0x5177('0x56')]({'where':{'id':_0x39fb92[_0x5177('0x5a')]['id']}})[_0x5177('0x22')](handleEntityNotFound(_0x3268bd,null))[_0x5177('0x22')](removeEntity(_0x3268bd,null))[_0x5177('0x2c')](handleError(_0x3268bd,null));};exports[_0x5177('0x5b')]=function(_0x37380c,_0x267599,_0x5ceed2){var _0x5d96ce={};var _0x4b5b6b={};var _0x3bc60b;var _0x18222f;return db[_0x5177('0x50')][_0x5177('0x5c')]({'where':{'id':_0x37380c[_0x5177('0x5a')]['id']}})[_0x5177('0x22')](handleEntityNotFound(_0x267599,null))['then'](function(_0x523531){if(_0x523531){_0x3bc60b=_0x523531;_0x4b5b6b[_0x5177('0x3f')]=_[_0x5177('0x42')](db[_0x5177('0x5d')][_0x5177('0x3b')]);_0x4b5b6b[_0x5177('0x41')]=_[_0x5177('0x42')](_0x37380c[_0x5177('0x41')]);_0x4b5b6b[_0x5177('0x43')]=_[_0x5177('0x44')](_0x4b5b6b['model'],_0x4b5b6b[_0x5177('0x41')]);_0x5d96ce[_0x5177('0x45')]=_['intersection'](_0x4b5b6b[_0x5177('0x3f')],qs[_0x5177('0x46')](_0x37380c['query'][_0x5177('0x46')]));_0x5d96ce[_0x5177('0x45')]=_0x5d96ce[_0x5177('0x45')]['length']?_0x5d96ce[_0x5177('0x45')]:_0x4b5b6b[_0x5177('0x3f')];_0x5d96ce['order']=qs['sort'](_0x37380c[_0x5177('0x41')]['sort']);_0x5d96ce[_0x5177('0x4c')]=qs['filters'](_[_0x5177('0x4a')](_0x37380c[_0x5177('0x41')],_0x4b5b6b['filters']));if(_0x37380c[_0x5177('0x41')][_0x5177('0x4b')]){_0x5d96ce[_0x5177('0x4c')]=_[_0x5177('0x4e')](_0x5d96ce[_0x5177('0x4c')],{'$or':_[_0x5177('0x40')](_0x5d96ce[_0x5177('0x45')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x37380c['query']['filter']+'%'};return _0x26b733;})});}_0x5d96ce=_[_0x5177('0x4e')]({},_0x5d96ce,_0x37380c[_0x5177('0x4f')]);return _0x3bc60b['getFields'](_0x5d96ce);}})[_0x5177('0x22')](function(_0xa889bd){if(_0xa889bd){_0x18222f=_0xa889bd[_0x5177('0x54')];if(!_0x37380c[_0x5177('0x41')][_0x5177('0x47')](_0x5177('0x48'))){_0x5d96ce[_0x5177('0x31')]=qs[_0x5177('0x31')](_0x37380c['query']['limit']);_0x5d96ce[_0x5177('0x30')]=qs[_0x5177('0x30')](_0x37380c[_0x5177('0x41')][_0x5177('0x30')]);}return _0x3bc60b[_0x5177('0x5b')](_0x5d96ce);}})[_0x5177('0x22')](function(_0x4fc289){if(_0x4fc289){return _0x4fc289?{'count':_0x18222f,'rows':_0x4fc289}:null;}})[_0x5177('0x22')](respondWithResult(_0x267599,null))[_0x5177('0x2c')](handleError(_0x267599,null));};exports[_0x5177('0x5e')]=function(_0x46d72e,_0x4aa151,_0x2e26c6){var _0x95f83a={};var _0x124935={};var _0x22da9d;var _0x282cbc;return db['ServicenowConfiguration'][_0x5177('0x5c')]({'where':{'id':_0x46d72e['params']['id']}})[_0x5177('0x22')](handleEntityNotFound(_0x4aa151,null))[_0x5177('0x22')](function(_0x5e3554){if(_0x5e3554){_0x22da9d=_0x5e3554;_0x124935[_0x5177('0x3f')]=_[_0x5177('0x42')](db[_0x5177('0x5d')][_0x5177('0x3b')]);_0x124935['query']=_[_0x5177('0x42')](_0x46d72e[_0x5177('0x41')]);_0x124935[_0x5177('0x43')]=_[_0x5177('0x44')](_0x124935['model'],_0x124935[_0x5177('0x41')]);_0x95f83a[_0x5177('0x45')]=_[_0x5177('0x44')](_0x124935['model'],qs['fields'](_0x46d72e[_0x5177('0x41')][_0x5177('0x46')]));_0x95f83a[_0x5177('0x45')]=_0x95f83a[_0x5177('0x45')][_0x5177('0x54')]?_0x95f83a[_0x5177('0x45')]:_0x124935[_0x5177('0x3f')];_0x95f83a[_0x5177('0x49')]=qs[_0x5177('0x5f')](_0x46d72e['query']['sort']);_0x95f83a['where']=qs[_0x5177('0x43')](_['pick'](_0x46d72e[_0x5177('0x41')],_0x124935[_0x5177('0x43')]));if(_0x46d72e[_0x5177('0x41')][_0x5177('0x4b')]){_0x95f83a[_0x5177('0x4c')]=_['merge'](_0x95f83a[_0x5177('0x4c')],{'$or':_[_0x5177('0x40')](_0x95f83a[_0x5177('0x45')],function(_0x4fce32){var _0x3d845e={};_0x3d845e[_0x4fce32]={'$like':'%'+_0x46d72e['query'][_0x5177('0x4b')]+'%'};return _0x3d845e;})});}_0x95f83a=_[_0x5177('0x4e')]({},_0x95f83a,_0x46d72e['options']);return _0x22da9d[_0x5177('0x5e')](_0x95f83a);}})[_0x5177('0x22')](function(_0x53ccd8){if(_0x53ccd8){_0x282cbc=_0x53ccd8['length'];if(!_0x46d72e[_0x5177('0x41')]['hasOwnProperty'](_0x5177('0x48'))){_0x95f83a[_0x5177('0x31')]=qs['limit'](_0x46d72e[_0x5177('0x41')][_0x5177('0x31')]);_0x95f83a[_0x5177('0x30')]=qs[_0x5177('0x30')](_0x46d72e[_0x5177('0x41')][_0x5177('0x30')]);}return _0x22da9d[_0x5177('0x5e')](_0x95f83a);}})[_0x5177('0x22')](function(_0x488c62){if(_0x488c62){return _0x488c62?{'count':_0x282cbc,'rows':_0x488c62}:null;}})[_0x5177('0x22')](respondWithResult(_0x4aa151,null))['catch'](handleError(_0x4aa151,null));};exports[_0x5177('0x60')]=function(_0x339d5d,_0x46d726,_0x2f9728){var _0x4ea67b={};var _0x154290={};var _0x14f272;var _0x52f8ca;return db[_0x5177('0x50')][_0x5177('0x5c')]({'where':{'id':_0x339d5d['params']['id']}})[_0x5177('0x22')](handleEntityNotFound(_0x46d726,null))['then'](function(_0x3f1aad){if(_0x3f1aad){_0x14f272=_0x3f1aad;_0x154290['model']=_['keys'](db['ServicenowField'][_0x5177('0x3b')]);_0x154290[_0x5177('0x41')]=_[_0x5177('0x42')](_0x339d5d['query']);_0x154290[_0x5177('0x43')]=_[_0x5177('0x44')](_0x154290[_0x5177('0x3f')],_0x154290[_0x5177('0x41')]);_0x4ea67b[_0x5177('0x45')]=_['intersection'](_0x154290[_0x5177('0x3f')],qs[_0x5177('0x46')](_0x339d5d['query'][_0x5177('0x46')]));_0x4ea67b['attributes']=_0x4ea67b[_0x5177('0x45')]['length']?_0x4ea67b[_0x5177('0x45')]:_0x154290[_0x5177('0x3f')];_0x4ea67b[_0x5177('0x49')]=qs[_0x5177('0x5f')](_0x339d5d[_0x5177('0x41')][_0x5177('0x5f')]);_0x4ea67b['where']=qs['filters'](_[_0x5177('0x4a')](_0x339d5d[_0x5177('0x41')],_0x154290[_0x5177('0x43')]));if(_0x339d5d['query'][_0x5177('0x4b')]){_0x4ea67b[_0x5177('0x4c')]=_['merge'](_0x4ea67b[_0x5177('0x4c')],{'$or':_['map'](_0x4ea67b[_0x5177('0x45')],function(_0x134b2f){var _0x451c23={};_0x451c23[_0x134b2f]={'$like':'%'+_0x339d5d['query'][_0x5177('0x4b')]+'%'};return _0x451c23;})});}_0x4ea67b=_['merge']({},_0x4ea67b,_0x339d5d[_0x5177('0x4f')]);return _0x14f272[_0x5177('0x60')](_0x4ea67b);}})['then'](function(_0x5a8146){if(_0x5a8146){_0x52f8ca=_0x5a8146['length'];if(!_0x339d5d[_0x5177('0x41')]['hasOwnProperty'](_0x5177('0x48'))){_0x4ea67b[_0x5177('0x31')]=qs[_0x5177('0x31')](_0x339d5d['query']['limit']);_0x4ea67b['offset']=qs[_0x5177('0x30')](_0x339d5d[_0x5177('0x41')][_0x5177('0x30')]);}return _0x14f272['getDescriptions'](_0x4ea67b);}})[_0x5177('0x22')](function(_0x358c97){if(_0x358c97){return _0x358c97?{'count':_0x52f8ca,'rows':_0x358c97}:null;}})['then'](respondWithResult(_0x46d726,null))[_0x5177('0x2c')](handleError(_0x46d726,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index daac17d..fb2f63c 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 _0x9c9b=['rimraf','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','path'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0x9c9b,0x194));var _0xb9c9=function(_0x22c95d,_0x197acf){_0x22c95d=_0x22c95d-0x0;var _0x4831fe=_0x9c9b[_0x22c95d];return _0x4831fe;};'use strict';var _=require('lodash');var util=require(_0xb9c9('0x0'));var logger=require(_0xb9c9('0x1'))(_0xb9c9('0x2'));var moment=require(_0xb9c9('0x3'));var BPromise=require(_0xb9c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c9('0x5'));var rimraf=require(_0xb9c9('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0xfe4cb4,_0x26bf07){return _0xfe4cb4[_0xb9c9('0x7')](_0xb9c9('0x8'),attributes,{'tableName':_0xb9c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5df=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api'];(function(_0x94ef9f,_0x413203){var _0x1c34ab=function(_0x3af182){while(--_0x3af182){_0x94ef9f['push'](_0x94ef9f['shift']());}};_0x1c34ab(++_0x413203);}(_0xc5df,0x80));var _0xfc5d=function(_0x5c1876,_0x1536a0){_0x5c1876=_0x5c1876-0x0;var _0x117949=_0xc5df[_0x5c1876];return _0x117949;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfc5d('0x0'))(_0xfc5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc5d('0x2'));var fs=require('fs');var path=require(_0xfc5d('0x3'));var rimraf=require(_0xfc5d('0x4'));var config=require(_0xfc5d('0x5'));var attributes=require(_0xfc5d('0x6'));module['exports']=function(_0x1c8057,_0x2df24e){return _0x1c8057[_0xfc5d('0x7')](_0xfc5d('0x8'),attributes,{'tableName':_0xfc5d('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 51cab7e..cd63d28 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 _0xd39e=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug'];(function(_0x551dde,_0x2d9be8){var _0x581414=function(_0x12fce8){while(--_0x12fce8){_0x551dde['push'](_0x551dde['shift']());}};_0x581414(++_0x2d9be8);}(_0xd39e,0xd6));var _0xed39=function(_0x1e691f,_0x215f5f){_0x1e691f=_0x1e691f-0x0;var _0x5b37cb=_0xd39e[_0x1e691f];return _0x5b37cb;};'use strict';var _=require('lodash');var util=require(_0xed39('0x0'));var moment=require(_0xed39('0x1'));var BPromise=require(_0xed39('0x2'));var rs=require(_0xed39('0x3'));var fs=require('fs');var Redis=require(_0xed39('0x4'));var db=require(_0xed39('0x5'))['db'];var utils=require(_0xed39('0x6'));var logger=require(_0xed39('0x7'))(_0xed39('0x8'));var config=require(_0xed39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xed39('0xa')][_0xed39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8be10e,_0x143389,_0x2adf37){return new BPromise(function(_0x39cb2c,_0x3241b3){return client['request'](_0x8be10e,_0x2adf37)[_0xed39('0xc')](function(_0x191d9c){logger[_0xed39('0xd')](_0xed39('0xe'),_0x143389,'request\x20sent');logger[_0xed39('0xf')](_0xed39('0x10'),_0x143389,'request\x20sent',JSON['stringify'](_0x191d9c));if(_0x191d9c[_0xed39('0x11')]){if(_0x191d9c[_0xed39('0x11')][_0xed39('0x12')]===0x1f4){logger[_0xed39('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x143389,_0x191d9c[_0xed39('0x11')][_0xed39('0x13')]);return _0x3241b3(_0x191d9c[_0xed39('0x11')]['message']);}logger['error'](_0xed39('0xe'),_0x143389,_0x191d9c[_0xed39('0x11')][_0xed39('0x13')]);return _0x39cb2c(_0x191d9c[_0xed39('0x11')]['message']);}else{logger[_0xed39('0xd')](_0xed39('0xe'),_0x143389,_0xed39('0x14'));_0x39cb2c(_0x191d9c[_0xed39('0x15')][_0xed39('0x13')]);}})[_0xed39('0x16')](function(_0x2cf710){logger[_0xed39('0x11')](_0xed39('0xe'),_0x143389,_0x2cf710);_0x3241b3(_0x2cf710);});});} \ No newline at end of file +var _0x9a82=['ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info'];(function(_0x4acc51,_0xb1a7c3){var _0x18cf37=function(_0x1f4023){while(--_0x1f4023){_0x4acc51['push'](_0x4acc51['shift']());}};_0x18cf37(++_0xb1a7c3);}(_0x9a82,0x17a));var _0x29a8=function(_0x4cbb4a,_0x532f48){_0x4cbb4a=_0x4cbb4a-0x0;var _0x6f6285=_0x9a82[_0x4cbb4a];return _0x6f6285;};'use strict';var _=require(_0x29a8('0x0'));var util=require('util');var moment=require(_0x29a8('0x1'));var BPromise=require(_0x29a8('0x2'));var rs=require(_0x29a8('0x3'));var fs=require('fs');var Redis=require(_0x29a8('0x4'));var db=require(_0x29a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29a8('0x6'))(_0x29a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29a8('0x8')][_0x29a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12c7f1,_0x1e1f12,_0x3d4066){return new BPromise(function(_0x42f1c2,_0x14aaee){return client[_0x29a8('0xa')](_0x12c7f1,_0x3d4066)[_0x29a8('0xb')](function(_0x9565b8){logger[_0x29a8('0xc')](_0x29a8('0xd'),_0x1e1f12,'request\x20sent');logger[_0x29a8('0xe')](_0x29a8('0xf'),_0x1e1f12,'request\x20sent',JSON[_0x29a8('0x10')](_0x9565b8));if(_0x9565b8[_0x29a8('0x11')]){if(_0x9565b8[_0x29a8('0x11')][_0x29a8('0x12')]===0x1f4){logger[_0x29a8('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1e1f12,_0x9565b8[_0x29a8('0x11')]['message']);return _0x14aaee(_0x9565b8['error'][_0x29a8('0x13')]);}logger[_0x29a8('0x11')](_0x29a8('0xd'),_0x1e1f12,_0x9565b8[_0x29a8('0x11')]['message']);return _0x42f1c2(_0x9565b8[_0x29a8('0x11')]['message']);}else{logger[_0x29a8('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1e1f12,_0x29a8('0x14'));_0x42f1c2(_0x9565b8[_0x29a8('0x15')][_0x29a8('0x13')]);}})[_0x29a8('0x16')](function(_0x342b8e){logger['error'](_0x29a8('0xd'),_0x1e1f12,_0x342b8e);_0x14aaee(_0x342b8e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 5470492..bbc26db 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 _0x5bf2=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','multer','util','path','connect-timeout','Router'];(function(_0x2d6681,_0x3c743f){var _0xe61ddc=function(_0x32ce7d){while(--_0x32ce7d){_0x2d6681['push'](_0x2d6681['shift']());}};_0xe61ddc(++_0x3c743f);}(_0x5bf2,0x8b));var _0x25bf=function(_0x2b07c6,_0x3c5db5){_0x2b07c6=_0x2b07c6-0x0;var _0xb3fbc4=_0x5bf2[_0x2b07c6];return _0xb3fbc4;};'use strict';var multer=require(_0x25bf('0x0'));var util=require(_0x25bf('0x1'));var path=require(_0x25bf('0x2'));var timeout=require(_0x25bf('0x3'));var express=require('express');var router=express[_0x25bf('0x4')]();var auth=require(_0x25bf('0x5'));var interaction=require(_0x25bf('0x6'));var config=require(_0x25bf('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x25bf('0x8')](),controller[_0x25bf('0x9')]);router[_0x25bf('0xa')](_0x25bf('0xb'),auth['isAuthenticated'](),controller[_0x25bf('0xc')]);router[_0x25bf('0xd')]('/',auth[_0x25bf('0x8')](),controller['create']);router[_0x25bf('0xe')](_0x25bf('0xb'),auth[_0x25bf('0x8')](),controller[_0x25bf('0xf')]);router['delete'](_0x25bf('0xb'),auth[_0x25bf('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x25bf=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','destroy','exports'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x25bf,0x11d));var _0xf25b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x25bf[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xf25b('0x0'));var util=require('util');var path=require(_0xf25b('0x1'));var timeout=require(_0xf25b('0x2'));var express=require(_0xf25b('0x3'));var router=express[_0xf25b('0x4')]();var auth=require(_0xf25b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf25b('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xf25b('0x7')](),controller['index']);router['get'](_0xf25b('0x8'),auth[_0xf25b('0x7')](),controller[_0xf25b('0x9')]);router[_0xf25b('0xa')]('/',auth[_0xf25b('0x7')](),controller[_0xf25b('0xb')]);router[_0xf25b('0xc')](_0xf25b('0x8'),auth[_0xf25b('0x7')](),controller['update']);router['delete'](_0xf25b('0x8'),auth[_0xf25b('0x7')](),controller[_0xf25b('0xd')]);module[_0xf25b('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c35382c..5da4ecb 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 _0xdec1=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x5b3d20,_0x155cc5){var _0x4fb5be=function(_0x3b4266){while(--_0x3b4266){_0x5b3d20['push'](_0x5b3d20['shift']());}};_0x4fb5be(++_0x155cc5);}(_0xdec1,0x11d));var _0x1dec=function(_0x1c007c,_0x1a8f4b){_0x1c007c=_0x1c007c-0x0;var _0x4df717=_0xdec1[_0x1c007c];return _0x4df717;};'use strict';var Sequelize=require(_0x1dec('0x0'));module['exports']={'type':{'type':Sequelize[_0x1dec('0x1')](_0x1dec('0x2'),_0x1dec('0x3'),_0x1dec('0x4'),_0x1dec('0x5')),'defaultValue':_0x1dec('0x2')},'content':{'type':Sequelize[_0x1dec('0x6')]},'key':{'type':Sequelize[_0x1dec('0x6')]},'keyType':{'type':Sequelize[_0x1dec('0x1')](_0x1dec('0x2'),_0x1dec('0x3'),_0x1dec('0x4'))},'keyContent':{'type':Sequelize[_0x1dec('0x6')]},'idField':{'type':Sequelize[_0x1dec('0x6')]},'nameField':{'type':Sequelize[_0x1dec('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1dec('0x6')]}}; \ No newline at end of file +var _0x84e1=['variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x42e75c,_0x136223){var _0x42b0b8=function(_0x4bbc58){while(--_0x4bbc58){_0x42e75c['push'](_0x42e75c['shift']());}};_0x42b0b8(++_0x136223);}(_0x84e1,0x1dc));var _0x184e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x84e1[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x184e('0x0'));module[_0x184e('0x1')]={'type':{'type':Sequelize[_0x184e('0x2')](_0x184e('0x3'),_0x184e('0x4'),_0x184e('0x5'),'keyValue'),'defaultValue':_0x184e('0x3')},'content':{'type':Sequelize[_0x184e('0x6')]},'key':{'type':Sequelize[_0x184e('0x6')]},'keyType':{'type':Sequelize[_0x184e('0x2')](_0x184e('0x3'),_0x184e('0x4'),_0x184e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x184e('0x6')]},'nameField':{'type':Sequelize[_0x184e('0x6')]},'customField':{'type':Sequelize[_0x184e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index ab4680f..53dd1c6 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x91d498,_0x482a89){var _0x1e0294=function(_0x214950){while(--_0x214950){_0x91d498['push'](_0x91d498['shift']());}};_0x1e0294(++_0x482a89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x285fff,_0x4fb54f){var _0x44e78f=function(_0x1b64c8){while(--_0x1b64c8){_0x285fff['push'](_0x285fff['shift']());}};_0x44e78f(++_0x4fb54f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3a63599..a2b84c9 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 _0xc9c1=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x32c39d,_0x580359){var _0x5a494d=function(_0x398d76){while(--_0x398d76){_0x32c39d['push'](_0x32c39d['shift']());}};_0x5a494d(++_0x580359);}(_0xc9c1,0x1e8));var _0x1c9c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc9c1[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x1c9c('0x0'));var util=require(_0x1c9c('0x1'));var logger=require(_0x1c9c('0x2'))(_0x1c9c('0x3'));var moment=require('moment');var BPromise=require(_0x1c9c('0x4'));var rp=require(_0x1c9c('0x5'));var fs=require('fs');var path=require(_0x1c9c('0x6'));var rimraf=require(_0x1c9c('0x7'));var config=require(_0x1c9c('0x8'));var attributes=require(_0x1c9c('0x9'));module[_0x1c9c('0xa')]=function(_0x5ce250,_0x36954c){return _0x5ce250[_0x1c9c('0xb')](_0x1c9c('0xc'),attributes,{'tableName':_0x1c9c('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1c9c('0xe'),_0x1c9c('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd5=['path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xaf0996,_0x3ee642){var _0x8fde5a=function(_0x130dc7){while(--_0x130dc7){_0xaf0996['push'](_0xaf0996['shift']());}};_0x8fde5a(++_0x3ee642);}(_0x2bd5,0x14b));var _0x52bd=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0x2bd5[_0x2867a6];return _0x4afc2b;};'use strict';var _=require(_0x52bd('0x0'));var util=require(_0x52bd('0x1'));var logger=require(_0x52bd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x52bd('0x3'));var rp=require(_0x52bd('0x4'));var fs=require('fs');var path=require(_0x52bd('0x5'));var rimraf=require('rimraf');var config=require(_0x52bd('0x6'));var attributes=require(_0x52bd('0x7'));module[_0x52bd('0x8')]=function(_0x28b914,_0x34f666){return _0x28b914[_0x52bd('0x9')](_0x52bd('0xa'),attributes,{'tableName':_0x52bd('0xb'),'paranoid':![],'indexes':[{'name':_0x52bd('0xc'),'fields':[_0x52bd('0xd'),'FieldId'],'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 4ddc4dd..ebc2269 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 _0x48af=['client','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x555552,_0x576279){var _0x5b280d=function(_0x2ef8ef){while(--_0x2ef8ef){_0x555552['push'](_0x555552['shift']());}};_0x5b280d(++_0x576279);}(_0x48af,0xef));var _0xf48a=function(_0x44bcb6,_0x16e9a3){_0x44bcb6=_0x44bcb6-0x0;var _0x49ac0f=_0x48af[_0x44bcb6];return _0x49ac0f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf48a('0x0'));var BPromise=require(_0xf48a('0x1'));var rs=require(_0xf48a('0x2'));var fs=require('fs');var Redis=require(_0xf48a('0x3'));var db=require(_0xf48a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf48a('0x5'))('rpc');var config=require(_0xf48a('0x6'));var jayson=require(_0xf48a('0x7'));var client=jayson[_0xf48a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43374f,_0x1d9dec,_0x4792de){return new BPromise(function(_0x45f0e4,_0x5110f3){return client[_0xf48a('0x9')](_0x43374f,_0x4792de)[_0xf48a('0xa')](function(_0x1fdc00){logger['info'](_0xf48a('0xb'),_0x1d9dec,_0xf48a('0xc'));logger[_0xf48a('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x1d9dec,'request\x20sent',JSON[_0xf48a('0xe')](_0x1fdc00));if(_0x1fdc00[_0xf48a('0xf')]){if(_0x1fdc00[_0xf48a('0xf')][_0xf48a('0x10')]===0x1f4){logger[_0xf48a('0xf')](_0xf48a('0xb'),_0x1d9dec,_0x1fdc00['error'][_0xf48a('0x11')]);return _0x5110f3(_0x1fdc00[_0xf48a('0xf')][_0xf48a('0x11')]);}logger['error'](_0xf48a('0xb'),_0x1d9dec,_0x1fdc00['error'][_0xf48a('0x11')]);return _0x45f0e4(_0x1fdc00[_0xf48a('0xf')][_0xf48a('0x11')]);}else{logger['info'](_0xf48a('0xb'),_0x1d9dec,'request\x20sent');_0x45f0e4(_0x1fdc00['result'][_0xf48a('0x11')]);}})[_0xf48a('0x12')](function(_0x38d16d){logger['error'](_0xf48a('0xb'),_0x1d9dec,_0x38d16d);_0x5110f3(_0x38d16d);});});} \ No newline at end of file +var _0x4391=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x3701e6,_0x8b8714){var _0x119cde=function(_0x25621d){while(--_0x25621d){_0x3701e6['push'](_0x3701e6['shift']());}};_0x119cde(++_0x8b8714);}(_0x4391,0x1e1));var _0x1439=function(_0x41ef68,_0x55fd5a){_0x41ef68=_0x41ef68-0x0;var _0x56e13b=_0x4391[_0x41ef68];return _0x56e13b;};'use strict';var _=require(_0x1439('0x0'));var util=require(_0x1439('0x1'));var moment=require(_0x1439('0x2'));var BPromise=require('bluebird');var rs=require(_0x1439('0x3'));var fs=require('fs');var Redis=require(_0x1439('0x4'));var db=require(_0x1439('0x5'))['db'];var utils=require(_0x1439('0x6'));var logger=require(_0x1439('0x7'))(_0x1439('0x8'));var config=require(_0x1439('0x9'));var jayson=require(_0x1439('0xa'));var client=jayson[_0x1439('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x217883,_0x5053d2,_0x299b86){return new BPromise(function(_0x86e418,_0x40684d){return client[_0x1439('0xc')](_0x217883,_0x299b86)[_0x1439('0xd')](function(_0x150d42){logger[_0x1439('0xe')](_0x1439('0xf'),_0x5053d2,_0x1439('0x10'));logger[_0x1439('0x11')](_0x1439('0x12'),_0x5053d2,_0x1439('0x10'),JSON[_0x1439('0x13')](_0x150d42));if(_0x150d42[_0x1439('0x14')]){if(_0x150d42[_0x1439('0x14')][_0x1439('0x15')]===0x1f4){logger[_0x1439('0x14')](_0x1439('0xf'),_0x5053d2,_0x150d42['error'][_0x1439('0x16')]);return _0x40684d(_0x150d42[_0x1439('0x14')][_0x1439('0x16')]);}logger[_0x1439('0x14')]('ServicenowField,\x20%s,\x20%s',_0x5053d2,_0x150d42[_0x1439('0x14')][_0x1439('0x16')]);return _0x86e418(_0x150d42[_0x1439('0x14')]['message']);}else{logger[_0x1439('0xe')]('ServicenowField,\x20%s,\x20%s',_0x5053d2,_0x1439('0x10'));_0x86e418(_0x150d42[_0x1439('0x17')][_0x1439('0x16')]);}})[_0x1439('0x18')](function(_0x1c9cdd){logger[_0x1439('0x14')](_0x1439('0xf'),_0x5053d2,_0x1c9cdd);_0x40684d(_0x1c9cdd);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index b6793f3..a01e77d 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 _0x9d04=['path','express','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','update','delete','destroy','exports','multer','util'];(function(_0x4cc61d,_0x3fd027){var _0x916589=function(_0x3f8b72){while(--_0x3f8b72){_0x4cc61d['push'](_0x4cc61d['shift']());}};_0x916589(++_0x3fd027);}(_0x9d04,0x18e));var _0x49d0=function(_0x5cb0b7,_0x393d63){_0x5cb0b7=_0x5cb0b7-0x0;var _0x54bbb2=_0x9d04[_0x5cb0b7];return _0x54bbb2;};'use strict';var multer=require(_0x49d0('0x0'));var util=require(_0x49d0('0x1'));var path=require(_0x49d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x49d0('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x49d0('0x4'));var config=require('../../config/environment');var controller=require(_0x49d0('0x5'));router[_0x49d0('0x6')]('/',auth[_0x49d0('0x7')](),controller[_0x49d0('0x8')]);router[_0x49d0('0x6')](_0x49d0('0x9'),auth[_0x49d0('0x7')](),controller[_0x49d0('0xa')]);router[_0x49d0('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x49d0('0xb')]);router[_0x49d0('0x6')](_0x49d0('0xc'),auth[_0x49d0('0x7')](),controller[_0x49d0('0xd')]);router[_0x49d0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49d0('0xe')](_0x49d0('0xf'),auth[_0x49d0('0x7')](),controller['addConfiguration']);router['put'](_0x49d0('0x9'),auth[_0x49d0('0x7')](),controller[_0x49d0('0x10')]);router[_0x49d0('0x11')](_0x49d0('0x9'),auth[_0x49d0('0x7')](),controller[_0x49d0('0x12')]);module[_0x49d0('0x13')]=router; \ No newline at end of file +var _0x76af=['create','post','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields'];(function(_0x49cf27,_0x58ebe3){var _0x4ba57d=function(_0x5952ee){while(--_0x5952ee){_0x49cf27['push'](_0x49cf27['shift']());}};_0x4ba57d(++_0x58ebe3);}(_0x76af,0x1ec));var _0xf76a=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x76af[_0x4d8dc3];return _0x9b03d9;};'use strict';var multer=require(_0xf76a('0x0'));var util=require(_0xf76a('0x1'));var path=require(_0xf76a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf76a('0x3'));var router=express['Router']();var auth=require(_0xf76a('0x4'));var interaction=require(_0xf76a('0x5'));var config=require(_0xf76a('0x6'));var controller=require(_0xf76a('0x7'));router['get']('/',auth[_0xf76a('0x8')](),controller[_0xf76a('0x9')]);router[_0xf76a('0xa')](_0xf76a('0xb'),auth[_0xf76a('0x8')](),controller['show']);router[_0xf76a('0xa')]('/:id/configurations',auth[_0xf76a('0x8')](),controller['getConfigurations']);router['get'](_0xf76a('0xc'),auth[_0xf76a('0x8')](),controller[_0xf76a('0xd')]);router['post']('/',auth[_0xf76a('0x8')](),controller[_0xf76a('0xe')]);router[_0xf76a('0xf')](_0xf76a('0x10'),auth[_0xf76a('0x8')](),controller['addConfiguration']);router[_0xf76a('0x11')](_0xf76a('0xb'),auth['isAuthenticated'](),controller[_0xf76a('0x12')]);router[_0xf76a('0x13')]('/:id',auth[_0xf76a('0x8')](),controller[_0xf76a('0x14')]);module[_0xf76a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 3fa7c74..9beb6bc 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 _0x24ea=['remoteUri','sequelize','STRING','username'];(function(_0x4d3de8,_0x4a8511){var _0xc8aba7=function(_0x434b61){while(--_0x434b61){_0x4d3de8['push'](_0x4d3de8['shift']());}};_0xc8aba7(++_0x4a8511);}(_0x24ea,0x195));var _0xa24e=function(_0x4fe777,_0x40dec8){_0x4fe777=_0x4fe777-0x0;var _0x2a3437=_0x24ea[_0x4fe777];return _0x2a3437;};'use strict';var Sequelize=require(_0xa24e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24e('0x1')]},'description':{'type':Sequelize[_0xa24e('0x1')]},'username':{'type':Sequelize[_0xa24e('0x1')],'unique':_0xa24e('0x2')},'password':{'type':Sequelize[_0xa24e('0x1')]},'remoteUri':{'type':Sequelize[_0xa24e('0x1')],'unique':_0xa24e('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7485=['remoteUri','sequelize','exports','STRING'];(function(_0x562462,_0x2e11c6){var _0x93b448=function(_0x58bfb1){while(--_0x58bfb1){_0x562462['push'](_0x562462['shift']());}};_0x93b448(++_0x2e11c6);}(_0x7485,0x135));var _0x5748=function(_0x34ca56,_0x5c5557){_0x34ca56=_0x34ca56-0x0;var _0x32edc2=_0x7485[_0x34ca56];return _0x32edc2;};'use strict';var Sequelize=require(_0x5748('0x0'));module[_0x5748('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5748('0x2')]},'username':{'type':Sequelize[_0x5748('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5748('0x2')]},'remoteUri':{'type':Sequelize[_0x5748('0x2')],'unique':_0x5748('0x3')},'serverUrl':{'type':Sequelize[_0x5748('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index dad9c49..1a85aa0 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 _0xe1cf=['crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','Content-Range','apply','save','update','name','send','map','SugarcrmAccount','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','Descriptions','channel','SugarcrmConfiguration','SugarcrmField','Subjects','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','values','value','test','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel'];(function(_0xd723,_0x164010){var _0x5179d2=function(_0x43b1cb){while(--_0x43b1cb){_0xd723['push'](_0xd723['shift']());}};_0x5179d2(++_0x164010);}(_0xe1cf,0xed));var _0xfe1c=function(_0x266e7c,_0x36b3d1){_0x266e7c=_0x266e7c-0x0;var _0x529b4d=_0xe1cf[_0x266e7c];return _0x529b4d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe1c('0x0'));var rimraf=require(_0xfe1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe1c('0x2'));var rp=require(_0xfe1c('0x3'));var moment=require(_0xfe1c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe1c('0x5'));var util=require('util');var path=require(_0xfe1c('0x6'));var sox=require(_0xfe1c('0x7'));var csv=require(_0xfe1c('0x8'));var ejs=require(_0xfe1c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe1c('0xa'));var crypto=require(_0xfe1c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe1c('0x8'));var querystring=require(_0xfe1c('0xc'));var Papa=require(_0xfe1c('0xd'));var Redis=require(_0xfe1c('0xe'));var authService=require(_0xfe1c('0xf'));var qs=require(_0xfe1c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe1c('0x11'));var logger=require(_0xfe1c('0x12'))(_0xfe1c('0x13'));var utils=require(_0xfe1c('0x14'));var config=require(_0xfe1c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xfe1c('0x16'));var client=jayson[_0xfe1c('0x17')][_0xfe1c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4d7218,_0x1dc337,_0x654f25){if(_0x654f25){var _0x3100e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3100e5['test'](_0x1dc337)){return _0x4d7218;}else{throw new db[(_0xfe1c('0x19'))]['ValidationError'](_0xfe1c('0x1a'));}}else{return _0x4d7218;}}function respondWithRpcPromise(_0xb9ca7,_0x1a205f,_0x3e98ba,_0x49861f){return new BPromise(function(_0x126885,_0x525bde){var _0x289333=_0x49861f||client;return _0x289333[_0xfe1c('0x1b')](_0xb9ca7,_0x3e98ba)[_0xfe1c('0x1c')](function(_0x2da0eb){logger[_0xfe1c('0x1d')](_0xfe1c('0x1e'),_0x1a205f,_0xfe1c('0x1f'));logger[_0xfe1c('0x20')](_0xfe1c('0x21'),_0x1a205f,'request\x20sent',JSON[_0xfe1c('0x22')](_0x2da0eb));if(_0x2da0eb[_0xfe1c('0x23')]){if(_0x2da0eb[_0xfe1c('0x23')][_0xfe1c('0x24')]===0x1f4){logger['error'](_0xfe1c('0x1e'),_0x1a205f,_0x2da0eb[_0xfe1c('0x23')][_0xfe1c('0x25')]);return _0x525bde(_0x2da0eb[_0xfe1c('0x23')][_0xfe1c('0x25')]);}logger[_0xfe1c('0x23')]('SugarcrmAccount,\x20%s,\x20%s',_0x1a205f,_0x2da0eb[_0xfe1c('0x23')]['message']);return _0x126885(_0x2da0eb[_0xfe1c('0x23')][_0xfe1c('0x25')]);}else{logger[_0xfe1c('0x1d')](_0xfe1c('0x1e'),_0x1a205f,_0xfe1c('0x1f'));_0x126885(_0x2da0eb[_0xfe1c('0x26')][_0xfe1c('0x25')]);}})[_0xfe1c('0x27')](function(_0x1bceb4){logger[_0xfe1c('0x23')](_0xfe1c('0x1e'),_0x1a205f,_0x1bceb4);_0x525bde(_0x1bceb4);});});}function respondWithStatusCode(_0x529d90,_0x336c28){_0x336c28=_0x336c28||0xcc;return function(_0x55a803){if(_0x55a803){return _0x529d90['sendStatus'](_0x336c28);}return _0x529d90[_0xfe1c('0x28')](_0x336c28)[_0xfe1c('0x29')]();};}function respondWithResult(_0x2cbd31,_0x58b503){_0x58b503=_0x58b503||0xc8;return function(_0x4381d3){if(_0x4381d3){return _0x2cbd31['status'](_0x58b503)[_0xfe1c('0x2a')](_0x4381d3);}};}function respondWithFilteredResult(_0x310f8b,_0x32cc8a){return function(_0x160965){if(_0x160965){var _0x559a2e=_0x160965[_0xfe1c('0x2b')],_0x3408df=_0x32cc8a[_0xfe1c('0x2c')],_0x1f51f4=_0x32cc8a[_0xfe1c('0x2c')]+_0x32cc8a['limit'],_0x4837d4;if(_0x1f51f4>=_0x559a2e){_0x1f51f4=_0x559a2e;_0x4837d4=0xc8;}else{_0x4837d4=0xce;}_0x310f8b[_0xfe1c('0x28')](_0x4837d4);return _0x310f8b['set'](_0xfe1c('0x2d'),_0x3408df+'-'+_0x1f51f4+'/'+_0x559a2e)[_0xfe1c('0x2a')](_0x160965);}return null;};}function patchUpdates(_0x432011){return function(_0x598154){try{jsonpatch[_0xfe1c('0x2e')](_0x598154,_0x432011,!![]);}catch(_0x20b45a){return BPromise['reject'](_0x20b45a);}return _0x598154[_0xfe1c('0x2f')]();};}function saveUpdates(_0x4df946,_0x253ea3){return function(_0x15fd30){if(_0x15fd30){return _0x15fd30[_0xfe1c('0x30')](_0x4df946)['then'](function(_0x4bc6e0){return _0x4bc6e0;});}return null;};}function removeEntity(_0x25b683,_0x34a150){return function(_0x40a2a5){if(_0x40a2a5){return _0x40a2a5['destroy']()[_0xfe1c('0x1c')](function(){_0x25b683[_0xfe1c('0x28')](0xcc)[_0xfe1c('0x29')]();});}};}function handleEntityNotFound(_0x281c7e,_0x1e5383){return function(_0x31738e){if(!_0x31738e){_0x281c7e['sendStatus'](0x194);}return _0x31738e;};}function handleError(_0x2f5a9f,_0x5eb5a9){_0x5eb5a9=_0x5eb5a9||0x1f4;return function(_0xc8a7db){logger['error'](_0xc8a7db['stack']);if(_0xc8a7db[_0xfe1c('0x31')]){delete _0xc8a7db['name'];}_0x2f5a9f['status'](_0x5eb5a9)[_0xfe1c('0x32')](_0xc8a7db);};}exports['index']=function(_0x52d1b0,_0x1f084e){var _0x8d03c2={},_0x50c5c2={},_0x521ade={'count':0x0,'rows':[]};var _0x552ed6=_[_0xfe1c('0x33')](db[_0xfe1c('0x34')]['rawAttributes'],function(_0x1c45b0){return{'name':_0x1c45b0[_0xfe1c('0x35')],'type':_0x1c45b0['type']['key']};});_0x50c5c2[_0xfe1c('0x36')]=_[_0xfe1c('0x33')](_0x552ed6,'name');_0x50c5c2[_0xfe1c('0x37')]=_[_0xfe1c('0x38')](_0x52d1b0['query']);_0x50c5c2[_0xfe1c('0x39')]=_[_0xfe1c('0x3a')](_0x50c5c2[_0xfe1c('0x36')],_0x50c5c2['query']);_0x8d03c2[_0xfe1c('0x3b')]=_[_0xfe1c('0x3a')](_0x50c5c2[_0xfe1c('0x36')],qs[_0xfe1c('0x3c')](_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x3c')]));_0x8d03c2['attributes']=_0x8d03c2[_0xfe1c('0x3b')][_0xfe1c('0x3d')]?_0x8d03c2[_0xfe1c('0x3b')]:_0x50c5c2[_0xfe1c('0x36')];if(!_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x3e')](_0xfe1c('0x3f'))){_0x8d03c2[_0xfe1c('0x40')]=qs[_0xfe1c('0x40')](_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x40')]);_0x8d03c2['offset']=qs[_0xfe1c('0x2c')](_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x2c')]);}_0x8d03c2[_0xfe1c('0x41')]=qs[_0xfe1c('0x42')](_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x42')]);_0x8d03c2[_0xfe1c('0x43')]=qs[_0xfe1c('0x39')](_[_0xfe1c('0x44')](_0x52d1b0[_0xfe1c('0x37')],_0x50c5c2[_0xfe1c('0x39')]),_0x552ed6);if(_0x52d1b0['query']['filter']){_0x8d03c2[_0xfe1c('0x43')]=_[_0xfe1c('0x45')](_0x8d03c2[_0xfe1c('0x43')],{'$or':_[_0xfe1c('0x33')](_0x552ed6,function(_0x50b179){if(_0x50b179[_0xfe1c('0x46')]!==_0xfe1c('0x47')){var _0x4a990c={};_0x4a990c[_0x50b179['name']]={'$like':'%'+_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x48')]+'%'};return _0x4a990c;}})});}_0x8d03c2=_[_0xfe1c('0x45')]({},_0x8d03c2,_0x52d1b0[_0xfe1c('0x49')]);var _0x2a160b={'where':_0x8d03c2[_0xfe1c('0x43')]};return db['SugarcrmAccount'][_0xfe1c('0x2b')](_0x2a160b)['then'](function(_0x579252){_0x521ade['count']=_0x579252;if(_0x52d1b0[_0xfe1c('0x37')][_0xfe1c('0x4a')]){_0x8d03c2[_0xfe1c('0x4b')]=[{'all':!![]}];}return db[_0xfe1c('0x34')][_0xfe1c('0x4c')](_0x8d03c2);})[_0xfe1c('0x1c')](function(_0xcef318){_0x521ade[_0xfe1c('0x4d')]=_0xcef318;return _0x521ade;})[_0xfe1c('0x1c')](respondWithFilteredResult(_0x1f084e,_0x8d03c2))[_0xfe1c('0x27')](handleError(_0x1f084e,null));};exports['show']=function(_0x432d6f,_0x11f8e0){var _0x10f072={'raw':![],'where':{'id':_0x432d6f[_0xfe1c('0x4e')]['id']}},_0x57e225={};_0x57e225[_0xfe1c('0x36')]=_[_0xfe1c('0x38')](db[_0xfe1c('0x34')][_0xfe1c('0x4f')]);_0x57e225[_0xfe1c('0x37')]=_[_0xfe1c('0x38')](_0x432d6f['query']);_0x57e225[_0xfe1c('0x39')]=_[_0xfe1c('0x3a')](_0x57e225['model'],_0x57e225['query']);_0x10f072[_0xfe1c('0x3b')]=_['intersection'](_0x57e225[_0xfe1c('0x36')],qs[_0xfe1c('0x3c')](_0x432d6f[_0xfe1c('0x37')]['fields']));_0x10f072[_0xfe1c('0x3b')]=_0x10f072['attributes'][_0xfe1c('0x3d')]?_0x10f072[_0xfe1c('0x3b')]:_0x57e225['model'];if(_0x432d6f[_0xfe1c('0x37')][_0xfe1c('0x4a')]){_0x10f072[_0xfe1c('0x4b')]=[{'all':!![]}];}_0x10f072=_['merge']({},_0x10f072,_0x432d6f[_0xfe1c('0x49')]);return db[_0xfe1c('0x34')][_0xfe1c('0x50')](_0x10f072)[_0xfe1c('0x1c')](handleEntityNotFound(_0x11f8e0,null))[_0xfe1c('0x1c')](respondWithResult(_0x11f8e0,null))[_0xfe1c('0x27')](handleError(_0x11f8e0,null));};exports[_0xfe1c('0x51')]=function(_0x5638ff,_0x25fc65){return db[_0xfe1c('0x34')][_0xfe1c('0x51')](_0x5638ff[_0xfe1c('0x52')],{})['then'](respondWithResult(_0x25fc65,0xc9))[_0xfe1c('0x27')](handleError(_0x25fc65,null));};exports[_0xfe1c('0x30')]=function(_0x183a98,_0x50c50d){if(_0x183a98['body']['id']){delete _0x183a98[_0xfe1c('0x52')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x183a98['params']['id']}})['then'](handleEntityNotFound(_0x50c50d,null))['then'](saveUpdates(_0x183a98[_0xfe1c('0x52')],null))[_0xfe1c('0x1c')](respondWithResult(_0x50c50d,null))['catch'](handleError(_0x50c50d,null));};exports[_0xfe1c('0x53')]=function(_0xc8694c,_0x30e9ad){return db[_0xfe1c('0x34')]['find']({'where':{'id':_0xc8694c[_0xfe1c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30e9ad,null))['then'](removeEntity(_0x30e9ad,null))[_0xfe1c('0x27')](handleError(_0x30e9ad,null));};exports[_0xfe1c('0x54')]=function(_0x17b87e,_0x1feb0e,_0x413586){var _0xed2d35={};var _0x40f6e4={};var _0x4077b2;var _0xd9866c;return db[_0xfe1c('0x34')][_0xfe1c('0x55')]({'where':{'id':_0x17b87e['params']['id']}})[_0xfe1c('0x1c')](handleEntityNotFound(_0x1feb0e,null))['then'](function(_0x2961a8){if(_0x2961a8){_0x4077b2=_0x2961a8;_0x40f6e4[_0xfe1c('0x36')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x40f6e4['query']=_[_0xfe1c('0x38')](_0x17b87e[_0xfe1c('0x37')]);_0x40f6e4['filters']=_[_0xfe1c('0x3a')](_0x40f6e4[_0xfe1c('0x36')],_0x40f6e4[_0xfe1c('0x37')]);_0xed2d35[_0xfe1c('0x3b')]=_[_0xfe1c('0x3a')](_0x40f6e4[_0xfe1c('0x36')],qs['fields'](_0x17b87e[_0xfe1c('0x37')][_0xfe1c('0x3c')]));_0xed2d35[_0xfe1c('0x3b')]=_0xed2d35['attributes'][_0xfe1c('0x3d')]?_0xed2d35['attributes']:_0x40f6e4['model'];_0xed2d35['order']=qs[_0xfe1c('0x42')](_0x17b87e['query'][_0xfe1c('0x42')]);_0xed2d35['where']=qs[_0xfe1c('0x39')](_[_0xfe1c('0x44')](_0x17b87e[_0xfe1c('0x37')],_0x40f6e4['filters']));if(_0x17b87e['query']['filter']){_0xed2d35[_0xfe1c('0x43')]=_[_0xfe1c('0x45')](_0xed2d35[_0xfe1c('0x43')],{'$or':_[_0xfe1c('0x33')](_0xed2d35['attributes'],function(_0x53f46e){var _0x4b6ec2={};_0x4b6ec2[_0x53f46e]={'$like':'%'+_0x17b87e[_0xfe1c('0x37')][_0xfe1c('0x48')]+'%'};return _0x4b6ec2;})});}_0xed2d35=_[_0xfe1c('0x45')]({},_0xed2d35,_0x17b87e['options']);return _0x4077b2[_0xfe1c('0x54')](_0xed2d35);}})[_0xfe1c('0x1c')](function(_0x5acf7b){if(_0x5acf7b){_0xd9866c=_0x5acf7b[_0xfe1c('0x3d')];if(!_0x17b87e[_0xfe1c('0x37')][_0xfe1c('0x3e')](_0xfe1c('0x3f'))){_0xed2d35[_0xfe1c('0x40')]=qs[_0xfe1c('0x40')](_0x17b87e['query'][_0xfe1c('0x40')]);_0xed2d35[_0xfe1c('0x2c')]=qs[_0xfe1c('0x2c')](_0x17b87e[_0xfe1c('0x37')]['offset']);}return _0x4077b2[_0xfe1c('0x54')](_0xed2d35);}})['then'](function(_0x23ac33){if(_0x23ac33){return _0x23ac33?{'count':_0xd9866c,'rows':_0x23ac33}:null;}})['then'](respondWithResult(_0x1feb0e,null))[_0xfe1c('0x27')](handleError(_0x1feb0e,null));};exports['addConfiguration']=function(_0x5544b7,_0x4cf0ed,_0x398c1e){if(_0x5544b7[_0xfe1c('0x52')]['id']){delete _0x5544b7[_0xfe1c('0x52')]['id'];}return db['SugarcrmAccount'][_0xfe1c('0x55')]({'where':{'id':_0x5544b7['params']['id']}})[_0xfe1c('0x1c')](handleEntityNotFound(_0x4cf0ed,null))[_0xfe1c('0x1c')](function(_0x2d76f5){if(_0x2d76f5){_0x5544b7[_0xfe1c('0x52')]['AccountId']=_0x2d76f5['id'];_0x5544b7[_0xfe1c('0x52')]['Subjects']=integrations['getSubjects'](_0x5544b7[_0xfe1c('0x52')]['channel'],_0x5544b7['body'][_0xfe1c('0x46')]);_0x5544b7[_0xfe1c('0x52')][_0xfe1c('0x56')]=integrations['getDescriptions'](_0x5544b7[_0xfe1c('0x52')][_0xfe1c('0x57')],_0x5544b7['body'][_0xfe1c('0x46')]);return db[_0xfe1c('0x58')][_0xfe1c('0x51')](_0x5544b7[_0xfe1c('0x52')],{'include':[{'model':db[_0xfe1c('0x59')],'as':_0xfe1c('0x5a')},{'model':db[_0xfe1c('0x59')],'as':_0xfe1c('0x56')}]});}return null;})[_0xfe1c('0x1c')](respondWithResult(_0x4cf0ed,null))[_0xfe1c('0x27')](handleError(_0x4cf0ed,null));};exports['getFields']=function(_0x533abc,_0x4bb2cc,_0x110c54){var _0x17bc97='';var _0x377851=['id','name',_0xfe1c('0x5b'),_0xfe1c('0x5c'),'description',_0xfe1c('0x5d'),_0xfe1c('0x5e'),_0xfe1c('0x5f'),'parent_id',_0xfe1c('0x60'),_0xfe1c('0x61'),_0xfe1c('0x62')];return db[_0xfe1c('0x34')]['findOne']({'where':{'id':_0x533abc['params']['id']},'attributes':['id',_0xfe1c('0x63'),_0xfe1c('0x64'),_0xfe1c('0x65')]})['then'](handleEntityNotFound(_0x4bb2cc,null))[_0xfe1c('0x1c')](function(_0xcfce14){if(_0xcfce14){_0x17bc97=_0xcfce14[_0xfe1c('0x65')];var _0x24b99a=_0x17bc97[_0xfe1c('0x66')](-0x1);if(_0x24b99a==='/'){_0x17bc97=_0x17bc97[_0xfe1c('0x67')](0x0,_0x17bc97[_0xfe1c('0x68')](_0x24b99a));}return rp({'method':_0xfe1c('0x69'),'uri':util[_0xfe1c('0x6a')](_0xfe1c('0x6b'),_0x17bc97,_0xfe1c('0x6c')),'json':!![],'form':{'method':'login','input_type':_0xfe1c('0x6d'),'response_type':_0xfe1c('0x6d'),'rest_data':JSON[_0xfe1c('0x22')]({'user_auth':{'user_name':_0xcfce14[_0xfe1c('0x63')],'password':_0xcfce14[_0xfe1c('0x64')],'encryption':_0xfe1c('0x6e')},'application':_0xfe1c('0x6f')})}});}})[_0xfe1c('0x1c')](function(_0x312b43){if(_0x312b43&&_0x312b43[_0xfe1c('0x31')]!==_0xfe1c('0x70')&&_0x312b43[_0xfe1c('0x31')]!==_0xfe1c('0x71')){return rp({'method':_0xfe1c('0x69'),'uri':util[_0xfe1c('0x6a')](_0xfe1c('0x6b'),_0x17bc97,_0xfe1c('0x6c')),'json':!![],'form':{'method':_0xfe1c('0x72'),'input_type':_0xfe1c('0x6d'),'response_type':'JSON','rest_data':JSON[_0xfe1c('0x22')]({'session':_0x312b43['id'],'module_name':_0xfe1c('0x73')})}})[_0xfe1c('0x1c')](function(_0x502cd0){if(_0x502cd0){var _0x5be018=_['values'](_0x502cd0[_0xfe1c('0x74')]);_[_0xfe1c('0x75')](_0x5be018,function(_0x2e6143){return _0x377851['includes'](_0x2e6143[_0xfe1c('0x31')]);});return{'count':_0x5be018[_0xfe1c('0x3d')],'rows':_['map'](_0x5be018,function(_0x4fd3a1){return{'id':_0x4fd3a1[_0xfe1c('0x31')],'name':_0x4fd3a1['label'],'custom':_['endsWith'](_0x4fd3a1[_0xfe1c('0x31')],'_c')?!![]:![],'options':_0x4fd3a1[_0xfe1c('0x49')]?_[_0xfe1c('0x33')](_[_0xfe1c('0x76')](_0x4fd3a1[_0xfe1c('0x49')]),function(_0x11166f){return{'name':_0x11166f[_0xfe1c('0x77')],'value':_0x11166f['name']};}):[]};})};}})[_0xfe1c('0x1c')](respondWithResult(_0x4bb2cc,null))[_0xfe1c('0x27')](function(_0x453d8a){var _0x1b76f5=_0x533abc['query'][_0xfe1c('0x78')]?0x1f4:_0x453d8a['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfe1c('0x79'),_0x1b76f5,JSON[_0xfe1c('0x22')](_0x453d8a));delete _0x453d8a[_0xfe1c('0x31')];if(_0x1b76f5===0x191){_0x1b76f5=0x190;}_0x4bb2cc[_0xfe1c('0x28')](_0x1b76f5)[_0xfe1c('0x32')](_0x533abc[_0xfe1c('0x37')][_0xfe1c('0x78')]?{'message':_0xfe1c('0x7a'),'statusCode':_0x453d8a[_0xfe1c('0x7b')]}:_0x453d8a);});}else{var _0x31c6d9=0x1f4;_0x4bb2cc['status'](_0x31c6d9)[_0xfe1c('0x32')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x6a0d=['Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','values','value','statusCode','getFields','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','send','index','map','SugarcrmAccount','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','show','keys','length','options','find','create','body','getConfigurations','findOne','params','addConfiguration'];(function(_0x4bedc5,_0x592e4e){var _0x51c9e0=function(_0x34f5d0){while(--_0x34f5d0){_0x4bedc5['push'](_0x4bedc5['shift']());}};_0x51c9e0(++_0x592e4e);}(_0x6a0d,0x1af));var _0xd6a0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6a0d[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xd6a0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd6a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6a0('0x2'));var rp=require('request-promise');var moment=require(_0xd6a0('0x3'));var BPromise=require(_0xd6a0('0x4'));var Mustache=require(_0xd6a0('0x5'));var util=require(_0xd6a0('0x6'));var path=require(_0xd6a0('0x7'));var sox=require(_0xd6a0('0x8'));var csv=require(_0xd6a0('0x9'));var ejs=require(_0xd6a0('0xa'));var fs=require('fs');var _=require(_0xd6a0('0xb'));var squel=require(_0xd6a0('0xc'));var crypto=require(_0xd6a0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd6a0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6a0('0xf'));var Redis=require('ioredis');var authService=require(_0xd6a0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd6a0('0x11'));var hardwareService=require(_0xd6a0('0x12'));var logger=require('../../config/logger')(_0xd6a0('0x13'));var utils=require(_0xd6a0('0x14'));var config=require(_0xd6a0('0x15'));var db=require(_0xd6a0('0x16'))['db'];var integrations=require(_0xd6a0('0x17'));var jayson=require(_0xd6a0('0x18'));var client=jayson[_0xd6a0('0x19')][_0xd6a0('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5ceb87,_0x83c58a,_0x576cd3){if(_0x576cd3){var _0x5113cb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5113cb[_0xd6a0('0x1b')](_0x83c58a)){return _0x5ceb87;}else{throw new db[(_0xd6a0('0x1c'))]['ValidationError'](_0xd6a0('0x1d'));}}else{return _0x5ceb87;}}function respondWithRpcPromise(_0x1ba462,_0x16f957,_0x99ab4e,_0x57496a){return new BPromise(function(_0x501603,_0x3d3475){var _0x15c308=_0x57496a||client;return _0x15c308[_0xd6a0('0x1e')](_0x1ba462,_0x99ab4e)[_0xd6a0('0x1f')](function(_0x5c9fee){logger[_0xd6a0('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0x16f957,_0xd6a0('0x21'));logger['debug'](_0xd6a0('0x22'),_0x16f957,_0xd6a0('0x21'),JSON['stringify'](_0x5c9fee));if(_0x5c9fee['error']){if(_0x5c9fee[_0xd6a0('0x23')][_0xd6a0('0x24')]===0x1f4){logger[_0xd6a0('0x23')](_0xd6a0('0x25'),_0x16f957,_0x5c9fee['error'][_0xd6a0('0x26')]);return _0x3d3475(_0x5c9fee[_0xd6a0('0x23')][_0xd6a0('0x26')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x16f957,_0x5c9fee[_0xd6a0('0x23')][_0xd6a0('0x26')]);return _0x501603(_0x5c9fee['error'][_0xd6a0('0x26')]);}else{logger['info'](_0xd6a0('0x25'),_0x16f957,_0xd6a0('0x21'));_0x501603(_0x5c9fee[_0xd6a0('0x27')][_0xd6a0('0x26')]);}})[_0xd6a0('0x28')](function(_0x15dc5b){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x16f957,_0x15dc5b);_0x3d3475(_0x15dc5b);});});}function respondWithStatusCode(_0x1621b6,_0x3d1fbe){_0x3d1fbe=_0x3d1fbe||0xcc;return function(_0xf9a745){if(_0xf9a745){return _0x1621b6[_0xd6a0('0x29')](_0x3d1fbe);}return _0x1621b6[_0xd6a0('0x2a')](_0x3d1fbe)[_0xd6a0('0x2b')]();};}function respondWithResult(_0x4c6776,_0x5b7046){_0x5b7046=_0x5b7046||0xc8;return function(_0x9ff4c7){if(_0x9ff4c7){return _0x4c6776[_0xd6a0('0x2a')](_0x5b7046)[_0xd6a0('0x2c')](_0x9ff4c7);}};}function respondWithFilteredResult(_0x3d5ad8,_0x436e27){return function(_0x5af6d0){if(_0x5af6d0){var _0x4db54f=_0x5af6d0[_0xd6a0('0x2d')],_0x548ef5=_0x436e27['offset'],_0x54af6d=_0x436e27[_0xd6a0('0x2e')]+_0x436e27['limit'],_0x341525;if(_0x54af6d>=_0x4db54f){_0x54af6d=_0x4db54f;_0x341525=0xc8;}else{_0x341525=0xce;}_0x3d5ad8[_0xd6a0('0x2a')](_0x341525);return _0x3d5ad8['set'](_0xd6a0('0x2f'),_0x548ef5+'-'+_0x54af6d+'/'+_0x4db54f)[_0xd6a0('0x2c')](_0x5af6d0);}return null;};}function patchUpdates(_0x39ee47){return function(_0x4fe77b){try{jsonpatch[_0xd6a0('0x30')](_0x4fe77b,_0x39ee47,!![]);}catch(_0x573f6e){return BPromise[_0xd6a0('0x31')](_0x573f6e);}return _0x4fe77b[_0xd6a0('0x32')]();};}function saveUpdates(_0x401ea6,_0x1b05ac){return function(_0x438960){if(_0x438960){return _0x438960[_0xd6a0('0x33')](_0x401ea6)[_0xd6a0('0x1f')](function(_0x97778a){return _0x97778a;});}return null;};}function removeEntity(_0x198800,_0x357544){return function(_0x5de607){if(_0x5de607){return _0x5de607[_0xd6a0('0x34')]()[_0xd6a0('0x1f')](function(){_0x198800['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x171827,_0x5461ab){return function(_0x38b99c){if(!_0x38b99c){_0x171827[_0xd6a0('0x29')](0x194);}return _0x38b99c;};}function handleError(_0x25a9fa,_0x484895){_0x484895=_0x484895||0x1f4;return function(_0x22299d){logger[_0xd6a0('0x23')](_0x22299d['stack']);if(_0x22299d['name']){delete _0x22299d['name'];}_0x25a9fa[_0xd6a0('0x2a')](_0x484895)[_0xd6a0('0x35')](_0x22299d);};}exports[_0xd6a0('0x36')]=function(_0x27b691,_0x12fc0a){var _0x5650de={},_0x3a9fa6={},_0x44a0b4={'count':0x0,'rows':[]};var _0x1f4ab2=_[_0xd6a0('0x37')](db[_0xd6a0('0x38')]['rawAttributes'],function(_0x593536){return{'name':_0x593536['fieldName'],'type':_0x593536['type'][_0xd6a0('0x39')]};});_0x3a9fa6[_0xd6a0('0x3a')]=_[_0xd6a0('0x37')](_0x1f4ab2,_0xd6a0('0x3b'));_0x3a9fa6[_0xd6a0('0x3c')]=_['keys'](_0x27b691['query']);_0x3a9fa6[_0xd6a0('0x3d')]=_[_0xd6a0('0x3e')](_0x3a9fa6['model'],_0x3a9fa6[_0xd6a0('0x3c')]);_0x5650de[_0xd6a0('0x3f')]=_[_0xd6a0('0x3e')](_0x3a9fa6['model'],qs[_0xd6a0('0x40')](_0x27b691['query'][_0xd6a0('0x40')]));_0x5650de['attributes']=_0x5650de['attributes']['length']?_0x5650de[_0xd6a0('0x3f')]:_0x3a9fa6[_0xd6a0('0x3a')];if(!_0x27b691[_0xd6a0('0x3c')][_0xd6a0('0x41')](_0xd6a0('0x42'))){_0x5650de[_0xd6a0('0x43')]=qs[_0xd6a0('0x43')](_0x27b691[_0xd6a0('0x3c')][_0xd6a0('0x43')]);_0x5650de['offset']=qs[_0xd6a0('0x2e')](_0x27b691[_0xd6a0('0x3c')][_0xd6a0('0x2e')]);}_0x5650de[_0xd6a0('0x44')]=qs[_0xd6a0('0x45')](_0x27b691[_0xd6a0('0x3c')][_0xd6a0('0x45')]);_0x5650de['where']=qs[_0xd6a0('0x3d')](_[_0xd6a0('0x46')](_0x27b691[_0xd6a0('0x3c')],_0x3a9fa6[_0xd6a0('0x3d')]),_0x1f4ab2);if(_0x27b691['query'][_0xd6a0('0x47')]){_0x5650de[_0xd6a0('0x48')]=_[_0xd6a0('0x49')](_0x5650de['where'],{'$or':_['map'](_0x1f4ab2,function(_0x49728e){if(_0x49728e[_0xd6a0('0x4a')]!==_0xd6a0('0x4b')){var _0x38062d={};_0x38062d[_0x49728e['name']]={'$like':'%'+_0x27b691[_0xd6a0('0x3c')][_0xd6a0('0x47')]+'%'};return _0x38062d;}})});}_0x5650de=_[_0xd6a0('0x49')]({},_0x5650de,_0x27b691['options']);var _0x10bdb3={'where':_0x5650de[_0xd6a0('0x48')]};return db[_0xd6a0('0x38')]['count'](_0x10bdb3)[_0xd6a0('0x1f')](function(_0x2ecaeb){_0x44a0b4[_0xd6a0('0x2d')]=_0x2ecaeb;if(_0x27b691['query'][_0xd6a0('0x4c')]){_0x5650de[_0xd6a0('0x4d')]=[{'all':!![]}];}return db[_0xd6a0('0x38')]['findAll'](_0x5650de);})[_0xd6a0('0x1f')](function(_0x47eefc){_0x44a0b4['rows']=_0x47eefc;return _0x44a0b4;})[_0xd6a0('0x1f')](respondWithFilteredResult(_0x12fc0a,_0x5650de))[_0xd6a0('0x28')](handleError(_0x12fc0a,null));};exports[_0xd6a0('0x4e')]=function(_0x332080,_0xf0c448){var _0x51f687={'raw':![],'where':{'id':_0x332080['params']['id']}},_0x32fbc1={};_0x32fbc1[_0xd6a0('0x3a')]=_[_0xd6a0('0x4f')](db['SugarcrmAccount']['rawAttributes']);_0x32fbc1[_0xd6a0('0x3c')]=_['keys'](_0x332080['query']);_0x32fbc1[_0xd6a0('0x3d')]=_[_0xd6a0('0x3e')](_0x32fbc1[_0xd6a0('0x3a')],_0x32fbc1['query']);_0x51f687['attributes']=_[_0xd6a0('0x3e')](_0x32fbc1[_0xd6a0('0x3a')],qs[_0xd6a0('0x40')](_0x332080['query'][_0xd6a0('0x40')]));_0x51f687[_0xd6a0('0x3f')]=_0x51f687[_0xd6a0('0x3f')][_0xd6a0('0x50')]?_0x51f687[_0xd6a0('0x3f')]:_0x32fbc1['model'];if(_0x332080['query'][_0xd6a0('0x4c')]){_0x51f687['include']=[{'all':!![]}];}_0x51f687=_[_0xd6a0('0x49')]({},_0x51f687,_0x332080[_0xd6a0('0x51')]);return db[_0xd6a0('0x38')][_0xd6a0('0x52')](_0x51f687)[_0xd6a0('0x1f')](handleEntityNotFound(_0xf0c448,null))[_0xd6a0('0x1f')](respondWithResult(_0xf0c448,null))[_0xd6a0('0x28')](handleError(_0xf0c448,null));};exports[_0xd6a0('0x53')]=function(_0x29a306,_0x12ab27){return db[_0xd6a0('0x38')][_0xd6a0('0x53')](_0x29a306[_0xd6a0('0x54')],{})[_0xd6a0('0x1f')](respondWithResult(_0x12ab27,0xc9))['catch'](handleError(_0x12ab27,null));};exports['update']=function(_0xdf7025,_0x31e759){if(_0xdf7025[_0xd6a0('0x54')]['id']){delete _0xdf7025['body']['id'];}return db[_0xd6a0('0x38')][_0xd6a0('0x52')]({'where':{'id':_0xdf7025['params']['id']}})[_0xd6a0('0x1f')](handleEntityNotFound(_0x31e759,null))[_0xd6a0('0x1f')](saveUpdates(_0xdf7025[_0xd6a0('0x54')],null))[_0xd6a0('0x1f')](respondWithResult(_0x31e759,null))[_0xd6a0('0x28')](handleError(_0x31e759,null));};exports[_0xd6a0('0x34')]=function(_0x5ea71e,_0x4c325c){return db[_0xd6a0('0x38')]['find']({'where':{'id':_0x5ea71e['params']['id']}})[_0xd6a0('0x1f')](handleEntityNotFound(_0x4c325c,null))[_0xd6a0('0x1f')](removeEntity(_0x4c325c,null))[_0xd6a0('0x28')](handleError(_0x4c325c,null));};exports[_0xd6a0('0x55')]=function(_0x3685e4,_0x47a1c5,_0x40ebb6){var _0x517318={};var _0x384d5b={};var _0x2c0cdc;var _0x6ff6b9;return db[_0xd6a0('0x38')][_0xd6a0('0x56')]({'where':{'id':_0x3685e4[_0xd6a0('0x57')]['id']}})[_0xd6a0('0x1f')](handleEntityNotFound(_0x47a1c5,null))[_0xd6a0('0x1f')](function(_0x123ddf){if(_0x123ddf){_0x2c0cdc=_0x123ddf;_0x384d5b['model']=_[_0xd6a0('0x4f')](db['SugarcrmConfiguration']['rawAttributes']);_0x384d5b[_0xd6a0('0x3c')]=_[_0xd6a0('0x4f')](_0x3685e4[_0xd6a0('0x3c')]);_0x384d5b[_0xd6a0('0x3d')]=_[_0xd6a0('0x3e')](_0x384d5b[_0xd6a0('0x3a')],_0x384d5b[_0xd6a0('0x3c')]);_0x517318[_0xd6a0('0x3f')]=_[_0xd6a0('0x3e')](_0x384d5b['model'],qs[_0xd6a0('0x40')](_0x3685e4[_0xd6a0('0x3c')][_0xd6a0('0x40')]));_0x517318[_0xd6a0('0x3f')]=_0x517318[_0xd6a0('0x3f')][_0xd6a0('0x50')]?_0x517318[_0xd6a0('0x3f')]:_0x384d5b[_0xd6a0('0x3a')];_0x517318['order']=qs[_0xd6a0('0x45')](_0x3685e4['query']['sort']);_0x517318[_0xd6a0('0x48')]=qs[_0xd6a0('0x3d')](_['pick'](_0x3685e4[_0xd6a0('0x3c')],_0x384d5b[_0xd6a0('0x3d')]));if(_0x3685e4[_0xd6a0('0x3c')]['filter']){_0x517318[_0xd6a0('0x48')]=_['merge'](_0x517318['where'],{'$or':_['map'](_0x517318['attributes'],function(_0x47c689){var _0x2a7a06={};_0x2a7a06[_0x47c689]={'$like':'%'+_0x3685e4['query'][_0xd6a0('0x47')]+'%'};return _0x2a7a06;})});}_0x517318=_[_0xd6a0('0x49')]({},_0x517318,_0x3685e4['options']);return _0x2c0cdc[_0xd6a0('0x55')](_0x517318);}})[_0xd6a0('0x1f')](function(_0x89cc33){if(_0x89cc33){_0x6ff6b9=_0x89cc33[_0xd6a0('0x50')];if(!_0x3685e4[_0xd6a0('0x3c')]['hasOwnProperty']('nolimit')){_0x517318['limit']=qs[_0xd6a0('0x43')](_0x3685e4[_0xd6a0('0x3c')][_0xd6a0('0x43')]);_0x517318[_0xd6a0('0x2e')]=qs[_0xd6a0('0x2e')](_0x3685e4['query']['offset']);}return _0x2c0cdc[_0xd6a0('0x55')](_0x517318);}})[_0xd6a0('0x1f')](function(_0x4ecb2a){if(_0x4ecb2a){return _0x4ecb2a?{'count':_0x6ff6b9,'rows':_0x4ecb2a}:null;}})[_0xd6a0('0x1f')](respondWithResult(_0x47a1c5,null))[_0xd6a0('0x28')](handleError(_0x47a1c5,null));};exports[_0xd6a0('0x58')]=function(_0x4ff7aa,_0x2cff97,_0x3d071a){if(_0x4ff7aa[_0xd6a0('0x54')]['id']){delete _0x4ff7aa[_0xd6a0('0x54')]['id'];}return db[_0xd6a0('0x38')][_0xd6a0('0x56')]({'where':{'id':_0x4ff7aa[_0xd6a0('0x57')]['id']}})[_0xd6a0('0x1f')](handleEntityNotFound(_0x2cff97,null))[_0xd6a0('0x1f')](function(_0x7e2c1b){if(_0x7e2c1b){_0x4ff7aa['body']['AccountId']=_0x7e2c1b['id'];_0x4ff7aa[_0xd6a0('0x54')][_0xd6a0('0x59')]=integrations[_0xd6a0('0x5a')](_0x4ff7aa[_0xd6a0('0x54')]['channel'],_0x4ff7aa[_0xd6a0('0x54')][_0xd6a0('0x4a')]);_0x4ff7aa[_0xd6a0('0x54')][_0xd6a0('0x5b')]=integrations[_0xd6a0('0x5c')](_0x4ff7aa['body'][_0xd6a0('0x5d')],_0x4ff7aa['body'][_0xd6a0('0x4a')]);return db[_0xd6a0('0x5e')][_0xd6a0('0x53')](_0x4ff7aa[_0xd6a0('0x54')],{'include':[{'model':db[_0xd6a0('0x5f')],'as':_0xd6a0('0x59')},{'model':db['SugarcrmField'],'as':_0xd6a0('0x5b')}]});}return null;})['then'](respondWithResult(_0x2cff97,null))[_0xd6a0('0x28')](handleError(_0x2cff97,null));};exports['getFields']=function(_0x3a08ee,_0x557e98,_0x4c1559){var _0x30b0f9='';var _0x565f75=['id','name',_0xd6a0('0x60'),_0xd6a0('0x61'),'description',_0xd6a0('0x62'),_0xd6a0('0x63'),_0xd6a0('0x64'),'parent_id',_0xd6a0('0x65'),_0xd6a0('0x66'),_0xd6a0('0x67')];return db[_0xd6a0('0x38')]['findOne']({'where':{'id':_0x3a08ee['params']['id']},'attributes':['id',_0xd6a0('0x68'),_0xd6a0('0x69'),_0xd6a0('0x6a')]})[_0xd6a0('0x1f')](handleEntityNotFound(_0x557e98,null))[_0xd6a0('0x1f')](function(_0x510650){if(_0x510650){_0x30b0f9=_0x510650['remoteUri'];var _0x34298d=_0x30b0f9[_0xd6a0('0x6b')](-0x1);if(_0x34298d==='/'){_0x30b0f9=_0x30b0f9[_0xd6a0('0x6c')](0x0,_0x30b0f9[_0xd6a0('0x6d')](_0x34298d));}return rp({'method':_0xd6a0('0x6e'),'uri':util[_0xd6a0('0x6f')](_0xd6a0('0x70'),_0x30b0f9,_0xd6a0('0x71')),'json':!![],'form':{'method':_0xd6a0('0x72'),'input_type':'JSON','response_type':_0xd6a0('0x73'),'rest_data':JSON[_0xd6a0('0x74')]({'user_auth':{'user_name':_0x510650[_0xd6a0('0x68')],'password':_0x510650['password'],'encryption':_0xd6a0('0x75')},'application':_0xd6a0('0x76')})}});}})[_0xd6a0('0x1f')](function(_0x4db791){if(_0x4db791&&_0x4db791[_0xd6a0('0x3b')]!=='Invalid\x20Login'&&_0x4db791[_0xd6a0('0x3b')]!==_0xd6a0('0x77')){return rp({'method':_0xd6a0('0x6e'),'uri':util[_0xd6a0('0x6f')](_0xd6a0('0x70'),_0x30b0f9,_0xd6a0('0x71')),'json':!![],'form':{'method':_0xd6a0('0x78'),'input_type':_0xd6a0('0x73'),'response_type':_0xd6a0('0x73'),'rest_data':JSON[_0xd6a0('0x74')]({'session':_0x4db791['id'],'module_name':_0xd6a0('0x79')})}})['then'](function(_0x228e73){if(_0x228e73){var _0x1ea0d3=_['values'](_0x228e73[_0xd6a0('0x7a')]);_[_0xd6a0('0x7b')](_0x1ea0d3,function(_0x57715a){return _0x565f75[_0xd6a0('0x7c')](_0x57715a[_0xd6a0('0x3b')]);});return{'count':_0x1ea0d3[_0xd6a0('0x50')],'rows':_[_0xd6a0('0x37')](_0x1ea0d3,function(_0x1c387d){return{'id':_0x1c387d['name'],'name':_0x1c387d[_0xd6a0('0x7d')],'custom':_['endsWith'](_0x1c387d['name'],'_c')?!![]:![],'options':_0x1c387d[_0xd6a0('0x51')]?_[_0xd6a0('0x37')](_[_0xd6a0('0x7e')](_0x1c387d[_0xd6a0('0x51')]),function(_0x100dae){return{'name':_0x100dae[_0xd6a0('0x7f')],'value':_0x100dae[_0xd6a0('0x3b')]};}):[]};})};}})[_0xd6a0('0x1f')](respondWithResult(_0x557e98,null))[_0xd6a0('0x28')](function(_0x4815a0){var _0x26045b=_0x3a08ee['query'][_0xd6a0('0x1b')]?0x1f4:_0x4815a0[_0xd6a0('0x80')]||0x1f4;logger[_0xd6a0('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xd6a0('0x81'),_0x26045b,JSON['stringify'](_0x4815a0));delete _0x4815a0[_0xd6a0('0x3b')];if(_0x26045b===0x191){_0x26045b=0x190;}_0x557e98['status'](_0x26045b)[_0xd6a0('0x35')](_0x3a08ee[_0xd6a0('0x3c')][_0xd6a0('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x4815a0[_0xd6a0('0x80')]}:_0x4815a0);});}else{var _0x899623=0x1f4;_0x557e98[_0xd6a0('0x2a')](_0x899623)[_0xd6a0('0x35')]({'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 1707665..5bc5fcd 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 _0x942a=['util','../../config/logger','api','moment','bluebird','rimraf','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x40ed25,_0x361e53){var _0x29cca0=function(_0x239ab6){while(--_0x239ab6){_0x40ed25['push'](_0x40ed25['shift']());}};_0x29cca0(++_0x361e53);}(_0x942a,0x196));var _0xa942=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x942a[_0xe4bb3d];return _0xd9e51;};'use strict';var _=require(_0xa942('0x0'));var util=require(_0xa942('0x1'));var logger=require(_0xa942('0x2'))(_0xa942('0x3'));var moment=require(_0xa942('0x4'));var BPromise=require(_0xa942('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa942('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xa942('0x7'));module[_0xa942('0x8')]=function(_0x3bc36b,_0x3a727c){return _0x3bc36b['define'](_0xa942('0x9'),attributes,{'tableName':_0xa942('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x457d=['lodash','util','api','moment','bluebird','path','./intSugarcrmAccount.attributes','exports','SugarcrmAccount'];(function(_0x24cab6,_0x1269d6){var _0x199d3a=function(_0x1ffb93){while(--_0x1ffb93){_0x24cab6['push'](_0x24cab6['shift']());}};_0x199d3a(++_0x1269d6);}(_0x457d,0x18c));var _0xd457=function(_0x2c8df0,_0x32e64b){_0x2c8df0=_0x2c8df0-0x0;var _0x5753b1=_0x457d[_0x2c8df0];return _0x5753b1;};'use strict';var _=require(_0xd457('0x0'));var util=require(_0xd457('0x1'));var logger=require('../../config/logger')(_0xd457('0x2'));var moment=require(_0xd457('0x3'));var BPromise=require(_0xd457('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd457('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd457('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xd457('0x7')]=function(_0x11188a,_0xba7aa6){return _0x11188a['define'](_0xd457('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index add9110..05a0b2d 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 _0x9a78=['raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x546fa4,_0x5dbb18){var _0x25867e=function(_0x2097c9){while(--_0x2097c9){_0x546fa4['push'](_0x546fa4['shift']());}};_0x25867e(++_0x5dbb18);}(_0x9a78,0x171));var _0x89a7=function(_0x1f4be8,_0x59fc4a){_0x1f4be8=_0x1f4be8-0x0;var _0x25a41d=_0x9a78[_0x1f4be8];return _0x25a41d;};'use strict';var _=require(_0x89a7('0x0'));var util=require(_0x89a7('0x1'));var moment=require(_0x89a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x89a7('0x3'));var fs=require('fs');var Redis=require(_0x89a7('0x4'));var db=require(_0x89a7('0x5'))['db'];var utils=require(_0x89a7('0x6'));var logger=require(_0x89a7('0x7'))(_0x89a7('0x8'));var config=require('../../config/environment');var jayson=require(_0x89a7('0x9'));var client=jayson['client'][_0x89a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x326512,_0x331c9b,_0x3a3750){return new BPromise(function(_0x8cd69f,_0x38e60e){return client['request'](_0x326512,_0x3a3750)[_0x89a7('0xb')](function(_0x14ccee){logger[_0x89a7('0xc')](_0x89a7('0xd'),_0x331c9b,'request\x20sent');logger[_0x89a7('0xe')](_0x89a7('0xf'),_0x331c9b,_0x89a7('0x10'),JSON[_0x89a7('0x11')](_0x14ccee));if(_0x14ccee[_0x89a7('0x12')]){if(_0x14ccee[_0x89a7('0x12')][_0x89a7('0x13')]===0x1f4){logger[_0x89a7('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x331c9b,_0x14ccee[_0x89a7('0x12')]['message']);return _0x38e60e(_0x14ccee[_0x89a7('0x12')][_0x89a7('0x14')]);}logger[_0x89a7('0x12')](_0x89a7('0xd'),_0x331c9b,_0x14ccee[_0x89a7('0x12')][_0x89a7('0x14')]);return _0x8cd69f(_0x14ccee['error'][_0x89a7('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x331c9b,_0x89a7('0x10'));_0x8cd69f(_0x14ccee[_0x89a7('0x15')]['message']);}})[_0x89a7('0x16')](function(_0x5cdf8e){logger[_0x89a7('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x331c9b,_0x5cdf8e);_0x38e60e(_0x5cdf8e);});});}exports[_0x89a7('0x17')]=function(_0x2f5405){var _0x410fab=this;return new Promise(function(_0x17b3cb,_0x4c1fe0){return db[_0x89a7('0x18')][_0x89a7('0x19')]({'raw':_0x2f5405[_0x89a7('0x1a')]?_0x2f5405[_0x89a7('0x1a')][_0x89a7('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f5405[_0x89a7('0x1a')]?_0x2f5405[_0x89a7('0x1a')][_0x89a7('0x1c')]||null:null,'attributes':_0x2f5405[_0x89a7('0x1a')]?_0x2f5405[_0x89a7('0x1a')][_0x89a7('0x1d')]||null:null,'limit':_0x2f5405[_0x89a7('0x1a')]?_0x2f5405['options'][_0x89a7('0x1e')]||null:null,'include':_0x2f5405[_0x89a7('0x1a')]?_0x2f5405['options'][_0x89a7('0x1f')]?_[_0x89a7('0x20')](_0x2f5405[_0x89a7('0x1a')][_0x89a7('0x1f')],function(_0x3295bc){return{'model':db[_0x3295bc[_0x89a7('0x21')]],'as':_0x3295bc['as'],'attributes':_0x3295bc[_0x89a7('0x1d')],'include':_0x3295bc['include']?_[_0x89a7('0x20')](_0x3295bc['include'],function(_0x3b3dba){return{'model':db[_0x3b3dba['model']],'as':_0x3b3dba['as'],'attributes':_0x3b3dba['attributes'],'include':_0x3b3dba[_0x89a7('0x1f')]?_['map'](_0x3b3dba[_0x89a7('0x1f')],function(_0x5081f9){return{'model':db[_0x5081f9['model']],'as':_0x5081f9['as'],'attributes':_0x5081f9[_0x89a7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x89a7('0xb')](function(_0x233c7a){logger['info'](_0x89a7('0x17'),_0x2f5405);logger['debug'](_0x89a7('0x17'),_0x2f5405,JSON['stringify'](_0x233c7a));_0x17b3cb(_0x233c7a);})[_0x89a7('0x16')](function(_0x30817b){logger[_0x89a7('0x12')](_0x89a7('0x17'),_0x30817b[_0x89a7('0x14')],_0x2f5405);_0x4c1fe0(_0x410fab['error'](0x1f4,_0x30817b[_0x89a7('0x14')]));});});};exports[_0x89a7('0x22')]=function(_0x7f8f2f){var _0x3aa299=this;return new Promise(function(_0x41e313,_0x16fed2){return db[_0x89a7('0x18')][_0x89a7('0x23')]({'raw':_0x7f8f2f['options']?_0x7f8f2f[_0x89a7('0x1a')][_0x89a7('0x1b')]===undefined?!![]:![]:!![],'where':_0x7f8f2f[_0x89a7('0x1a')]?_0x7f8f2f[_0x89a7('0x1a')]['where']||null:null,'attributes':_0x7f8f2f[_0x89a7('0x1a')]?_0x7f8f2f[_0x89a7('0x1a')][_0x89a7('0x1d')]||null:null,'include':_0x7f8f2f[_0x89a7('0x1a')]?_0x7f8f2f[_0x89a7('0x1a')]['include']?_[_0x89a7('0x20')](_0x7f8f2f['options']['include'],function(_0x3dd95c){return{'model':db[_0x3dd95c[_0x89a7('0x21')]],'as':_0x3dd95c['as'],'attributes':_0x3dd95c[_0x89a7('0x1d')],'include':_0x3dd95c[_0x89a7('0x1f')]?_[_0x89a7('0x20')](_0x3dd95c[_0x89a7('0x1f')],function(_0x35e3e1){return{'model':db[_0x35e3e1[_0x89a7('0x21')]],'as':_0x35e3e1['as'],'attributes':_0x35e3e1[_0x89a7('0x1d')],'include':_0x35e3e1['include']?_[_0x89a7('0x20')](_0x35e3e1['include'],function(_0x4beccf){return{'model':db[_0x4beccf[_0x89a7('0x21')]],'as':_0x4beccf['as'],'attributes':_0x4beccf['attributes']};}):[]};}):[]};}):[]:[]})[_0x89a7('0xb')](function(_0x8bd448){logger[_0x89a7('0xc')]('ShowSugarcrmAccount',_0x7f8f2f);logger[_0x89a7('0xe')](_0x89a7('0x22'),_0x7f8f2f,JSON['stringify'](_0x8bd448));_0x41e313(_0x8bd448);})[_0x89a7('0x16')](function(_0x2475bf){logger['error'](_0x89a7('0x22'),_0x2475bf['message'],_0x7f8f2f);_0x16fed2(_0x3aa299['error'](0x1f4,_0x2475bf['message']));});});}; \ No newline at end of file +var _0x19f2=['SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','stringify','SugarcrmAccount','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','info'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x19f2,0x105));var _0x219f=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x19f2[_0x43371b];return _0x19cd26;};'use strict';var _=require(_0x219f('0x0'));var util=require(_0x219f('0x1'));var moment=require(_0x219f('0x2'));var BPromise=require(_0x219f('0x3'));var rs=require(_0x219f('0x4'));var fs=require('fs');var Redis=require(_0x219f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x219f('0x6'));var logger=require(_0x219f('0x7'))('rpc');var config=require(_0x219f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x219f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e96a8,_0x52f5f2,_0x15de8a){return new BPromise(function(_0x222d04,_0xcceb4f){return client['request'](_0x1e96a8,_0x15de8a)['then'](function(_0x5e1c9a){logger[_0x219f('0xa')](_0x219f('0xb'),_0x52f5f2,'request\x20sent');logger[_0x219f('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x52f5f2,_0x219f('0xd'),JSON['stringify'](_0x5e1c9a));if(_0x5e1c9a[_0x219f('0xe')]){if(_0x5e1c9a[_0x219f('0xe')][_0x219f('0xf')]===0x1f4){logger[_0x219f('0xe')](_0x219f('0xb'),_0x52f5f2,_0x5e1c9a['error'][_0x219f('0x10')]);return _0xcceb4f(_0x5e1c9a[_0x219f('0xe')]['message']);}logger[_0x219f('0xe')](_0x219f('0xb'),_0x52f5f2,_0x5e1c9a[_0x219f('0xe')][_0x219f('0x10')]);return _0x222d04(_0x5e1c9a[_0x219f('0xe')][_0x219f('0x10')]);}else{logger[_0x219f('0xa')](_0x219f('0xb'),_0x52f5f2,_0x219f('0xd'));_0x222d04(_0x5e1c9a[_0x219f('0x11')][_0x219f('0x10')]);}})[_0x219f('0x12')](function(_0xe75b42){logger[_0x219f('0xe')](_0x219f('0xb'),_0x52f5f2,_0xe75b42);_0xcceb4f(_0xe75b42);});});}exports[_0x219f('0x13')]=function(_0x442835){var _0x4537ba=this;return new Promise(function(_0x363efa,_0x55118f){return db['SugarcrmAccount'][_0x219f('0x14')]({'raw':_0x442835[_0x219f('0x15')]?_0x442835[_0x219f('0x15')][_0x219f('0x16')]===undefined?!![]:![]:!![],'where':_0x442835[_0x219f('0x15')]?_0x442835[_0x219f('0x15')][_0x219f('0x17')]||null:null,'attributes':_0x442835[_0x219f('0x15')]?_0x442835[_0x219f('0x15')][_0x219f('0x18')]||null:null,'limit':_0x442835[_0x219f('0x15')]?_0x442835[_0x219f('0x15')][_0x219f('0x19')]||null:null,'include':_0x442835[_0x219f('0x15')]?_0x442835[_0x219f('0x15')]['include']?_[_0x219f('0x1a')](_0x442835[_0x219f('0x15')][_0x219f('0x1b')],function(_0x4f00d7){return{'model':db[_0x4f00d7['model']],'as':_0x4f00d7['as'],'attributes':_0x4f00d7['attributes'],'include':_0x4f00d7[_0x219f('0x1b')]?_[_0x219f('0x1a')](_0x4f00d7[_0x219f('0x1b')],function(_0x1f0ca0){return{'model':db[_0x1f0ca0[_0x219f('0x1c')]],'as':_0x1f0ca0['as'],'attributes':_0x1f0ca0[_0x219f('0x18')],'include':_0x1f0ca0[_0x219f('0x1b')]?_[_0x219f('0x1a')](_0x1f0ca0['include'],function(_0x35ab6b){return{'model':db[_0x35ab6b[_0x219f('0x1c')]],'as':_0x35ab6b['as'],'attributes':_0x35ab6b[_0x219f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x219f('0x1d')](function(_0x368fd7){logger[_0x219f('0xa')](_0x219f('0x13'),_0x442835);logger[_0x219f('0xc')](_0x219f('0x13'),_0x442835,JSON[_0x219f('0x1e')](_0x368fd7));_0x363efa(_0x368fd7);})[_0x219f('0x12')](function(_0x515722){logger[_0x219f('0xe')](_0x219f('0x13'),_0x515722[_0x219f('0x10')],_0x442835);_0x55118f(_0x4537ba[_0x219f('0xe')](0x1f4,_0x515722[_0x219f('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x15f4c0){var _0x564dd7=this;return new Promise(function(_0x210018,_0x56efca){return db[_0x219f('0x1f')][_0x219f('0x20')]({'raw':_0x15f4c0[_0x219f('0x15')]?_0x15f4c0[_0x219f('0x15')][_0x219f('0x16')]===undefined?!![]:![]:!![],'where':_0x15f4c0[_0x219f('0x15')]?_0x15f4c0[_0x219f('0x15')][_0x219f('0x17')]||null:null,'attributes':_0x15f4c0[_0x219f('0x15')]?_0x15f4c0['options'][_0x219f('0x18')]||null:null,'include':_0x15f4c0[_0x219f('0x15')]?_0x15f4c0['options'][_0x219f('0x1b')]?_['map'](_0x15f4c0[_0x219f('0x15')][_0x219f('0x1b')],function(_0x1d278a){return{'model':db[_0x1d278a[_0x219f('0x1c')]],'as':_0x1d278a['as'],'attributes':_0x1d278a['attributes'],'include':_0x1d278a['include']?_[_0x219f('0x1a')](_0x1d278a['include'],function(_0x1949ee){return{'model':db[_0x1949ee[_0x219f('0x1c')]],'as':_0x1949ee['as'],'attributes':_0x1949ee['attributes'],'include':_0x1949ee[_0x219f('0x1b')]?_[_0x219f('0x1a')](_0x1949ee['include'],function(_0x37bc1f){return{'model':db[_0x37bc1f[_0x219f('0x1c')]],'as':_0x37bc1f['as'],'attributes':_0x37bc1f['attributes']};}):[]};}):[]};}):[]:[]})[_0x219f('0x1d')](function(_0xd95196){logger[_0x219f('0xa')]('ShowSugarcrmAccount',_0x15f4c0);logger[_0x219f('0xc')](_0x219f('0x21'),_0x15f4c0,JSON['stringify'](_0xd95196));_0x210018(_0xd95196);})[_0x219f('0x12')](function(_0x12e08c){logger[_0x219f('0xe')](_0x219f('0x21'),_0x12e08c[_0x219f('0x10')],_0x15f4c0);_0x56efca(_0x564dd7[_0x219f('0xe')](0x1f4,_0x12e08c[_0x219f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6572258..45ac6f4 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 _0xbbd1=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xbbd1,0x14d));var _0x1bbd=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0xbbd1[_0x45f111];return _0x483508;};'use strict';var multer=require(_0x1bbd('0x0'));var util=require(_0x1bbd('0x1'));var path=require(_0x1bbd('0x2'));var timeout=require(_0x1bbd('0x3'));var express=require(_0x1bbd('0x4'));var router=express[_0x1bbd('0x5')]();var auth=require(_0x1bbd('0x6'));var interaction=require(_0x1bbd('0x7'));var config=require(_0x1bbd('0x8'));var controller=require(_0x1bbd('0x9'));router[_0x1bbd('0xa')]('/',auth['isAuthenticated'](),controller[_0x1bbd('0xb')]);router[_0x1bbd('0xa')](_0x1bbd('0xc'),auth[_0x1bbd('0xd')](),controller[_0x1bbd('0xe')]);router['get'](_0x1bbd('0xf'),auth['isAuthenticated'](),controller[_0x1bbd('0x10')]);router[_0x1bbd('0xa')](_0x1bbd('0x11'),auth['isAuthenticated'](),controller[_0x1bbd('0x12')]);router['get'](_0x1bbd('0x13'),auth['isAuthenticated'](),controller[_0x1bbd('0x14')]);router[_0x1bbd('0x15')]('/',auth[_0x1bbd('0xd')](),controller['create']);router[_0x1bbd('0x16')](_0x1bbd('0xc'),auth[_0x1bbd('0xd')](),controller[_0x1bbd('0x17')]);router[_0x1bbd('0x18')](_0x1bbd('0xc'),auth['isAuthenticated'](),controller[_0x1bbd('0x19')]);module[_0x1bbd('0x1a')]=router; \ No newline at end of file +var _0x8270=['show','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2cb976,_0x12c013){var _0x3d8412=function(_0x5b3549){while(--_0x5b3549){_0x2cb976['push'](_0x2cb976['shift']());}};_0x3d8412(++_0x12c013);}(_0x8270,0x145));var _0x0827=function(_0x5c5df2,_0x367d02){_0x5c5df2=_0x5c5df2-0x0;var _0x3d6e09=_0x8270[_0x5c5df2];return _0x3d6e09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0827('0x0'));var timeout=require(_0x0827('0x1'));var express=require(_0x0827('0x2'));var router=express[_0x0827('0x3')]();var auth=require(_0x0827('0x4'));var interaction=require(_0x0827('0x5'));var config=require(_0x0827('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x0827('0x7')]('/',auth[_0x0827('0x8')](),controller[_0x0827('0x9')]);router[_0x0827('0x7')](_0x0827('0xa'),auth[_0x0827('0x8')](),controller[_0x0827('0xb')]);router['get']('/:id/fields',auth[_0x0827('0x8')](),controller[_0x0827('0xc')]);router[_0x0827('0x7')](_0x0827('0xd'),auth[_0x0827('0x8')](),controller['getSubjects']);router[_0x0827('0x7')]('/:id/descriptions',auth[_0x0827('0x8')](),controller[_0x0827('0xe')]);router[_0x0827('0xf')]('/',auth[_0x0827('0x8')](),controller[_0x0827('0x10')]);router[_0x0827('0x11')](_0x0827('0xa'),auth[_0x0827('0x8')](),controller[_0x0827('0x12')]);router[_0x0827('0x13')](_0x0827('0xa'),auth[_0x0827('0x8')](),controller['destroy']);module[_0x0827('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index fbb2eba..fd852a6 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 _0x731a=['exports','STRING','sequelize'];(function(_0x41d987,_0x3a172f){var _0xf7c61d=function(_0x1221b0){while(--_0x1221b0){_0x41d987['push'](_0x41d987['shift']());}};_0xf7c61d(++_0x3a172f);}(_0x731a,0x104));var _0xa731=function(_0x294a77,_0x8a359d){_0x294a77=_0x294a77-0x0;var _0x17db6d=_0x731a[_0x294a77];return _0x17db6d;};'use strict';var Sequelize=require(_0xa731('0x0'));module[_0xa731('0x1')]={'name':{'type':Sequelize[_0xa731('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbe9a=['STRING','sequelize'];(function(_0x587c18,_0x77ffeb){var _0x49f312=function(_0x4646cc){while(--_0x4646cc){_0x587c18['push'](_0x587c18['shift']());}};_0x49f312(++_0x77ffeb);}(_0xbe9a,0x15f));var _0xabe9=function(_0x2d67c1,_0x4d7aa8){_0x2d67c1=_0x2d67c1-0x0;var _0x5be8fd=_0xbe9a[_0x2d67c1];return _0x5be8fd;};'use strict';var Sequelize=require(_0xabe9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xabe9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 321d282..8243e9d 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 _0x9407=['lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','options','SugarcrmConfiguration','includeAll','include','findAll','rows','find','create','body','params','getFields','findOne','SugarcrmField','filter','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x55f581,_0x5ec16b){var _0x45b013=function(_0x2f973e){while(--_0x2f973e){_0x55f581['push'](_0x55f581['shift']());}};_0x45b013(++_0x5ec16b);}(_0x9407,0x165));var _0x7940=function(_0x3d0f50,_0x5b1132){_0x3d0f50=_0x3d0f50-0x0;var _0x503258=_0x9407[_0x3d0f50];return _0x503258;};'use strict';var pdf=require(_0x7940('0x0'));var emlformat=require(_0x7940('0x1'));var rimraf=require(_0x7940('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7940('0x3'));var moment=require(_0x7940('0x4'));var BPromise=require(_0x7940('0x5'));var Mustache=require(_0x7940('0x6'));var util=require(_0x7940('0x7'));var path=require('path');var sox=require(_0x7940('0x8'));var csv=require(_0x7940('0x9'));var ejs=require(_0x7940('0xa'));var fs=require('fs');var _=require(_0x7940('0xb'));var squel=require('squel');var crypto=require(_0x7940('0xc'));var jsforce=require(_0x7940('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7940('0x9'));var querystring=require(_0x7940('0xe'));var Papa=require('papaparse');var Redis=require(_0x7940('0xf'));var authService=require(_0x7940('0x10'));var qs=require(_0x7940('0x11'));var as=require(_0x7940('0x12'));var hardwareService=require(_0x7940('0x13'));var logger=require(_0x7940('0x14'))('api');var utils=require(_0x7940('0x15'));var config=require('../../config/environment');var db=require(_0x7940('0x16'))['db'];var jayson=require(_0x7940('0x17'));var client=jayson[_0x7940('0x18')][_0x7940('0x19')]({'port':0x232a});function checkPasswordPattern(_0x116300,_0x4252b8,_0x1d92d4){if(_0x1d92d4){var _0x5809d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5809d3[_0x7940('0x1a')](_0x4252b8)){return _0x116300;}else{throw new db[(_0x7940('0x1b'))][(_0x7940('0x1c'))](_0x7940('0x1d'));}}else{return _0x116300;}}function respondWithRpcPromise(_0x3cfa3c,_0x1860d6,_0x2f392e,_0x43b0a6){return new BPromise(function(_0x3e3e2d,_0x108009){var _0xf432e7=_0x43b0a6||client;return _0xf432e7[_0x7940('0x1e')](_0x3cfa3c,_0x2f392e)[_0x7940('0x1f')](function(_0xd87dcc){logger[_0x7940('0x20')](_0x7940('0x21'),_0x1860d6,_0x7940('0x22'));logger['debug'](_0x7940('0x23'),_0x1860d6,_0x7940('0x22'),JSON['stringify'](_0xd87dcc));if(_0xd87dcc[_0x7940('0x24')]){if(_0xd87dcc[_0x7940('0x24')][_0x7940('0x25')]===0x1f4){logger[_0x7940('0x24')](_0x7940('0x21'),_0x1860d6,_0xd87dcc[_0x7940('0x24')]['message']);return _0x108009(_0xd87dcc[_0x7940('0x24')][_0x7940('0x26')]);}logger['error'](_0x7940('0x21'),_0x1860d6,_0xd87dcc[_0x7940('0x24')][_0x7940('0x26')]);return _0x3e3e2d(_0xd87dcc[_0x7940('0x24')][_0x7940('0x26')]);}else{logger['info'](_0x7940('0x21'),_0x1860d6,'request\x20sent');_0x3e3e2d(_0xd87dcc[_0x7940('0x27')][_0x7940('0x26')]);}})[_0x7940('0x28')](function(_0x2e406d){logger[_0x7940('0x24')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1860d6,_0x2e406d);_0x108009(_0x2e406d);});});}function respondWithStatusCode(_0x4a5a9c,_0x3b07ed){_0x3b07ed=_0x3b07ed||0xcc;return function(_0x438927){if(_0x438927){return _0x4a5a9c[_0x7940('0x29')](_0x3b07ed);}return _0x4a5a9c['status'](_0x3b07ed)['end']();};}function respondWithResult(_0x2a8e53,_0x3e5007){_0x3e5007=_0x3e5007||0xc8;return function(_0x511583){if(_0x511583){return _0x2a8e53[_0x7940('0x2a')](_0x3e5007)['json'](_0x511583);}};}function respondWithFilteredResult(_0x468aae,_0x10cbd1){return function(_0x2d9ec1){if(_0x2d9ec1){var _0x435162=_0x2d9ec1[_0x7940('0x2b')],_0x367240=_0x10cbd1[_0x7940('0x2c')],_0x30b336=_0x10cbd1['offset']+_0x10cbd1[_0x7940('0x2d')],_0x2c2216;if(_0x30b336>=_0x435162){_0x30b336=_0x435162;_0x2c2216=0xc8;}else{_0x2c2216=0xce;}_0x468aae[_0x7940('0x2a')](_0x2c2216);return _0x468aae['set'](_0x7940('0x2e'),_0x367240+'-'+_0x30b336+'/'+_0x435162)[_0x7940('0x2f')](_0x2d9ec1);}return null;};}function patchUpdates(_0x5902d7){return function(_0x3977d0){try{jsonpatch[_0x7940('0x30')](_0x3977d0,_0x5902d7,!![]);}catch(_0x10da57){return BPromise[_0x7940('0x31')](_0x10da57);}return _0x3977d0['save']();};}function saveUpdates(_0x4a710a,_0x6062c7){return function(_0x50948b){if(_0x50948b){return _0x50948b[_0x7940('0x32')](_0x4a710a)[_0x7940('0x1f')](function(_0x48e30a){return _0x48e30a;});}return null;};}function removeEntity(_0x336913,_0x3744b2){return function(_0x56b366){if(_0x56b366){return _0x56b366[_0x7940('0x33')]()[_0x7940('0x1f')](function(){_0x336913['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x343c8d,_0x2d541c){return function(_0x34cf7d){if(!_0x34cf7d){_0x343c8d[_0x7940('0x29')](0x194);}return _0x34cf7d;};}function handleError(_0x35c3f5,_0x309607){_0x309607=_0x309607||0x1f4;return function(_0xd508f0){logger[_0x7940('0x24')](_0xd508f0[_0x7940('0x34')]);if(_0xd508f0[_0x7940('0x35')]){delete _0xd508f0[_0x7940('0x35')];}_0x35c3f5['status'](_0x309607)[_0x7940('0x36')](_0xd508f0);};}exports[_0x7940('0x37')]=function(_0x40df9b,_0x1d35c9){var _0x599cd3={},_0x13dace={},_0x4cb99c={'count':0x0,'rows':[]};var _0x48b665=_[_0x7940('0x38')](db['SugarcrmConfiguration'][_0x7940('0x39')],function(_0x53359f){return{'name':_0x53359f[_0x7940('0x3a')],'type':_0x53359f[_0x7940('0x3b')][_0x7940('0x3c')]};});_0x13dace[_0x7940('0x3d')]=_[_0x7940('0x38')](_0x48b665,_0x7940('0x35'));_0x13dace[_0x7940('0x3e')]=_[_0x7940('0x3f')](_0x40df9b[_0x7940('0x3e')]);_0x13dace[_0x7940('0x40')]=_[_0x7940('0x41')](_0x13dace[_0x7940('0x3d')],_0x13dace[_0x7940('0x3e')]);_0x599cd3[_0x7940('0x42')]=_['intersection'](_0x13dace[_0x7940('0x3d')],qs[_0x7940('0x43')](_0x40df9b[_0x7940('0x3e')][_0x7940('0x43')]));_0x599cd3[_0x7940('0x42')]=_0x599cd3[_0x7940('0x42')][_0x7940('0x44')]?_0x599cd3[_0x7940('0x42')]:_0x13dace[_0x7940('0x3d')];if(!_0x40df9b['query']['hasOwnProperty'](_0x7940('0x45'))){_0x599cd3[_0x7940('0x2d')]=qs['limit'](_0x40df9b[_0x7940('0x3e')][_0x7940('0x2d')]);_0x599cd3[_0x7940('0x2c')]=qs['offset'](_0x40df9b[_0x7940('0x3e')][_0x7940('0x2c')]);}_0x599cd3[_0x7940('0x46')]=qs[_0x7940('0x47')](_0x40df9b[_0x7940('0x3e')]['sort']);_0x599cd3['where']=qs[_0x7940('0x40')](_[_0x7940('0x48')](_0x40df9b[_0x7940('0x3e')],_0x13dace[_0x7940('0x40')]),_0x48b665);if(_0x40df9b['query']['filter']){_0x599cd3['where']=_[_0x7940('0x49')](_0x599cd3[_0x7940('0x4a')],{'$or':_[_0x7940('0x38')](_0x48b665,function(_0x5595c9){if(_0x5595c9['type']!=='VIRTUAL'){var _0x596ce0={};_0x596ce0[_0x5595c9['name']]={'$like':'%'+_0x40df9b[_0x7940('0x3e')]['filter']+'%'};return _0x596ce0;}})});}_0x599cd3=_['merge']({},_0x599cd3,_0x40df9b[_0x7940('0x4b')]);var _0x1769b6={'where':_0x599cd3['where']};return db[_0x7940('0x4c')][_0x7940('0x2b')](_0x1769b6)[_0x7940('0x1f')](function(_0xce4e0c){_0x4cb99c[_0x7940('0x2b')]=_0xce4e0c;if(_0x40df9b['query'][_0x7940('0x4d')]){_0x599cd3[_0x7940('0x4e')]=[{'all':!![]}];}return db[_0x7940('0x4c')][_0x7940('0x4f')](_0x599cd3);})[_0x7940('0x1f')](function(_0x3ba5a0){_0x4cb99c[_0x7940('0x50')]=_0x3ba5a0;return _0x4cb99c;})[_0x7940('0x1f')](respondWithFilteredResult(_0x1d35c9,_0x599cd3))[_0x7940('0x28')](handleError(_0x1d35c9,null));};exports['show']=function(_0x446df0,_0x4c0d8d){var _0x40b716={'raw':![],'where':{'id':_0x446df0['params']['id']}},_0x396221={};_0x396221[_0x7940('0x3d')]=_[_0x7940('0x3f')](db[_0x7940('0x4c')][_0x7940('0x39')]);_0x396221['query']=_[_0x7940('0x3f')](_0x446df0[_0x7940('0x3e')]);_0x396221[_0x7940('0x40')]=_['intersection'](_0x396221[_0x7940('0x3d')],_0x396221[_0x7940('0x3e')]);_0x40b716[_0x7940('0x42')]=_[_0x7940('0x41')](_0x396221['model'],qs[_0x7940('0x43')](_0x446df0['query'][_0x7940('0x43')]));_0x40b716[_0x7940('0x42')]=_0x40b716[_0x7940('0x42')][_0x7940('0x44')]?_0x40b716[_0x7940('0x42')]:_0x396221[_0x7940('0x3d')];if(_0x446df0[_0x7940('0x3e')]['includeAll']){_0x40b716[_0x7940('0x4e')]=[{'all':!![]}];}_0x40b716=_[_0x7940('0x49')]({},_0x40b716,_0x446df0[_0x7940('0x4b')]);return db[_0x7940('0x4c')][_0x7940('0x51')](_0x40b716)[_0x7940('0x1f')](handleEntityNotFound(_0x4c0d8d,null))['then'](respondWithResult(_0x4c0d8d,null))[_0x7940('0x28')](handleError(_0x4c0d8d,null));};exports[_0x7940('0x52')]=function(_0x5777cc,_0x2fad8e){return db[_0x7940('0x4c')][_0x7940('0x52')](_0x5777cc[_0x7940('0x53')],{})[_0x7940('0x1f')](respondWithResult(_0x2fad8e,0xc9))[_0x7940('0x28')](handleError(_0x2fad8e,null));};exports[_0x7940('0x32')]=function(_0x286a90,_0x1bb0f6){if(_0x286a90[_0x7940('0x53')]['id']){delete _0x286a90[_0x7940('0x53')]['id'];}return db[_0x7940('0x4c')][_0x7940('0x51')]({'where':{'id':_0x286a90[_0x7940('0x54')]['id']}})[_0x7940('0x1f')](handleEntityNotFound(_0x1bb0f6,null))[_0x7940('0x1f')](saveUpdates(_0x286a90['body'],null))[_0x7940('0x1f')](respondWithResult(_0x1bb0f6,null))[_0x7940('0x28')](handleError(_0x1bb0f6,null));};exports['destroy']=function(_0x1557fa,_0x5dcecf){return db[_0x7940('0x4c')][_0x7940('0x51')]({'where':{'id':_0x1557fa[_0x7940('0x54')]['id']}})[_0x7940('0x1f')](handleEntityNotFound(_0x5dcecf,null))[_0x7940('0x1f')](removeEntity(_0x5dcecf,null))['catch'](handleError(_0x5dcecf,null));};exports[_0x7940('0x55')]=function(_0x4765ae,_0x49e938,_0x446ed7){var _0x18f510={};var _0x8e4553={};var _0x4744bb;var _0x2506d5;return db[_0x7940('0x4c')][_0x7940('0x56')]({'where':{'id':_0x4765ae[_0x7940('0x54')]['id']}})[_0x7940('0x1f')](handleEntityNotFound(_0x49e938,null))[_0x7940('0x1f')](function(_0x470c97){if(_0x470c97){_0x4744bb=_0x470c97;_0x8e4553[_0x7940('0x3d')]=_[_0x7940('0x3f')](db[_0x7940('0x57')]['rawAttributes']);_0x8e4553[_0x7940('0x3e')]=_['keys'](_0x4765ae[_0x7940('0x3e')]);_0x8e4553[_0x7940('0x40')]=_[_0x7940('0x41')](_0x8e4553['model'],_0x8e4553['query']);_0x18f510[_0x7940('0x42')]=_['intersection'](_0x8e4553[_0x7940('0x3d')],qs[_0x7940('0x43')](_0x4765ae[_0x7940('0x3e')][_0x7940('0x43')]));_0x18f510['attributes']=_0x18f510['attributes'][_0x7940('0x44')]?_0x18f510[_0x7940('0x42')]:_0x8e4553['model'];_0x18f510['order']=qs[_0x7940('0x47')](_0x4765ae[_0x7940('0x3e')][_0x7940('0x47')]);_0x18f510[_0x7940('0x4a')]=qs[_0x7940('0x40')](_[_0x7940('0x48')](_0x4765ae[_0x7940('0x3e')],_0x8e4553[_0x7940('0x40')]));if(_0x4765ae['query'][_0x7940('0x58')]){_0x18f510[_0x7940('0x4a')]=_['merge'](_0x18f510[_0x7940('0x4a')],{'$or':_[_0x7940('0x38')](_0x18f510[_0x7940('0x42')],function(_0x40cb89){var _0x511caa={};_0x511caa[_0x40cb89]={'$like':'%'+_0x4765ae[_0x7940('0x3e')][_0x7940('0x58')]+'%'};return _0x511caa;})});}_0x18f510=_[_0x7940('0x49')]({},_0x18f510,_0x4765ae[_0x7940('0x4b')]);return _0x4744bb[_0x7940('0x55')](_0x18f510);}})[_0x7940('0x1f')](function(_0x390aaf){if(_0x390aaf){_0x2506d5=_0x390aaf[_0x7940('0x44')];if(!_0x4765ae[_0x7940('0x3e')][_0x7940('0x59')](_0x7940('0x45'))){_0x18f510['limit']=qs[_0x7940('0x2d')](_0x4765ae[_0x7940('0x3e')][_0x7940('0x2d')]);_0x18f510['offset']=qs['offset'](_0x4765ae[_0x7940('0x3e')][_0x7940('0x2c')]);}return _0x4744bb['getFields'](_0x18f510);}})[_0x7940('0x1f')](function(_0x472055){if(_0x472055){return _0x472055?{'count':_0x2506d5,'rows':_0x472055}:null;}})[_0x7940('0x1f')](respondWithResult(_0x49e938,null))[_0x7940('0x28')](handleError(_0x49e938,null));};exports['getSubjects']=function(_0x19d55e,_0x37acc8,_0x3dbcbb){var _0x55a7b2={};var _0x97cb43={};var _0x1e51c2;var _0x51e1ca;return db['SugarcrmConfiguration'][_0x7940('0x56')]({'where':{'id':_0x19d55e['params']['id']}})[_0x7940('0x1f')](handleEntityNotFound(_0x37acc8,null))[_0x7940('0x1f')](function(_0x405965){if(_0x405965){_0x1e51c2=_0x405965;_0x97cb43[_0x7940('0x3d')]=_[_0x7940('0x3f')](db[_0x7940('0x57')][_0x7940('0x39')]);_0x97cb43[_0x7940('0x3e')]=_[_0x7940('0x3f')](_0x19d55e[_0x7940('0x3e')]);_0x97cb43['filters']=_[_0x7940('0x41')](_0x97cb43[_0x7940('0x3d')],_0x97cb43[_0x7940('0x3e')]);_0x55a7b2[_0x7940('0x42')]=_[_0x7940('0x41')](_0x97cb43[_0x7940('0x3d')],qs[_0x7940('0x43')](_0x19d55e[_0x7940('0x3e')][_0x7940('0x43')]));_0x55a7b2[_0x7940('0x42')]=_0x55a7b2['attributes'][_0x7940('0x44')]?_0x55a7b2['attributes']:_0x97cb43[_0x7940('0x3d')];_0x55a7b2[_0x7940('0x46')]=qs[_0x7940('0x47')](_0x19d55e[_0x7940('0x3e')][_0x7940('0x47')]);_0x55a7b2[_0x7940('0x4a')]=qs[_0x7940('0x40')](_[_0x7940('0x48')](_0x19d55e[_0x7940('0x3e')],_0x97cb43[_0x7940('0x40')]));if(_0x19d55e[_0x7940('0x3e')][_0x7940('0x58')]){_0x55a7b2[_0x7940('0x4a')]=_['merge'](_0x55a7b2[_0x7940('0x4a')],{'$or':_[_0x7940('0x38')](_0x55a7b2[_0x7940('0x42')],function(_0x2b1d96){var _0x2088b0={};_0x2088b0[_0x2b1d96]={'$like':'%'+_0x19d55e[_0x7940('0x3e')][_0x7940('0x58')]+'%'};return _0x2088b0;})});}_0x55a7b2=_[_0x7940('0x49')]({},_0x55a7b2,_0x19d55e[_0x7940('0x4b')]);return _0x1e51c2[_0x7940('0x5a')](_0x55a7b2);}})[_0x7940('0x1f')](function(_0x184e6e){if(_0x184e6e){_0x51e1ca=_0x184e6e['length'];if(!_0x19d55e[_0x7940('0x3e')][_0x7940('0x59')](_0x7940('0x45'))){_0x55a7b2['limit']=qs[_0x7940('0x2d')](_0x19d55e['query'][_0x7940('0x2d')]);_0x55a7b2[_0x7940('0x2c')]=qs[_0x7940('0x2c')](_0x19d55e[_0x7940('0x3e')]['offset']);}return _0x1e51c2[_0x7940('0x5a')](_0x55a7b2);}})[_0x7940('0x1f')](function(_0x32f1e9){if(_0x32f1e9){return _0x32f1e9?{'count':_0x51e1ca,'rows':_0x32f1e9}:null;}})[_0x7940('0x1f')](respondWithResult(_0x37acc8,null))[_0x7940('0x28')](handleError(_0x37acc8,null));};exports['getDescriptions']=function(_0x38463b,_0x33d439,_0x2d8365){var _0x2971b7={};var _0x426cd2={};var _0xac7927;var _0x1b197e;return db[_0x7940('0x4c')]['findOne']({'where':{'id':_0x38463b[_0x7940('0x54')]['id']}})[_0x7940('0x1f')](handleEntityNotFound(_0x33d439,null))[_0x7940('0x1f')](function(_0x320ef4){if(_0x320ef4){_0xac7927=_0x320ef4;_0x426cd2[_0x7940('0x3d')]=_[_0x7940('0x3f')](db[_0x7940('0x57')][_0x7940('0x39')]);_0x426cd2[_0x7940('0x3e')]=_[_0x7940('0x3f')](_0x38463b['query']);_0x426cd2[_0x7940('0x40')]=_[_0x7940('0x41')](_0x426cd2['model'],_0x426cd2[_0x7940('0x3e')]);_0x2971b7[_0x7940('0x42')]=_['intersection'](_0x426cd2[_0x7940('0x3d')],qs[_0x7940('0x43')](_0x38463b[_0x7940('0x3e')][_0x7940('0x43')]));_0x2971b7[_0x7940('0x42')]=_0x2971b7[_0x7940('0x42')][_0x7940('0x44')]?_0x2971b7[_0x7940('0x42')]:_0x426cd2[_0x7940('0x3d')];_0x2971b7['order']=qs[_0x7940('0x47')](_0x38463b[_0x7940('0x3e')]['sort']);_0x2971b7[_0x7940('0x4a')]=qs[_0x7940('0x40')](_[_0x7940('0x48')](_0x38463b[_0x7940('0x3e')],_0x426cd2['filters']));if(_0x38463b['query'][_0x7940('0x58')]){_0x2971b7[_0x7940('0x4a')]=_[_0x7940('0x49')](_0x2971b7[_0x7940('0x4a')],{'$or':_[_0x7940('0x38')](_0x2971b7[_0x7940('0x42')],function(_0x1d3f71){var _0x43d6c6={};_0x43d6c6[_0x1d3f71]={'$like':'%'+_0x38463b['query'][_0x7940('0x58')]+'%'};return _0x43d6c6;})});}_0x2971b7=_[_0x7940('0x49')]({},_0x2971b7,_0x38463b[_0x7940('0x4b')]);return _0xac7927['getDescriptions'](_0x2971b7);}})[_0x7940('0x1f')](function(_0xc88070){if(_0xc88070){_0x1b197e=_0xc88070[_0x7940('0x44')];if(!_0x38463b[_0x7940('0x3e')][_0x7940('0x59')](_0x7940('0x45'))){_0x2971b7[_0x7940('0x2d')]=qs[_0x7940('0x2d')](_0x38463b[_0x7940('0x3e')][_0x7940('0x2d')]);_0x2971b7[_0x7940('0x2c')]=qs[_0x7940('0x2c')](_0x38463b[_0x7940('0x3e')][_0x7940('0x2c')]);}return _0xac7927[_0x7940('0x5b')](_0x2971b7);}})[_0x7940('0x1f')](function(_0x55b527){if(_0x55b527){return _0x55b527?{'count':_0x1b197e,'rows':_0x55b527}:null;}})[_0x7940('0x1f')](respondWithResult(_0x33d439,null))[_0x7940('0x28')](handleError(_0x33d439,null));}; \ No newline at end of file +var _0x0429=['count','includeAll','include','findAll','show','params','options','create','body','find','getFields','findOne','order','sort','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL'];(function(_0x19653d,_0x3c99da){var _0x45708f=function(_0x29ed17){while(--_0x29ed17){_0x19653d['push'](_0x19653d['shift']());}};_0x45708f(++_0x3c99da);}(_0x0429,0x17d));var _0x9042=function(_0x3d813b,_0x1efd93){_0x3d813b=_0x3d813b-0x0;var _0x3bdaab=_0x0429[_0x3d813b];return _0x3bdaab;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9042('0x0'));var zipdir=require(_0x9042('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9042('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9042('0x3'));var util=require(_0x9042('0x4'));var path=require(_0x9042('0x5'));var sox=require(_0x9042('0x6'));var csv=require('to-csv');var ejs=require(_0x9042('0x7'));var fs=require('fs');var _=require(_0x9042('0x8'));var squel=require(_0x9042('0x9'));var crypto=require('crypto');var jsforce=require(_0x9042('0xa'));var deskjs=require(_0x9042('0xb'));var toCsv=require(_0x9042('0xc'));var querystring=require(_0x9042('0xd'));var Papa=require('papaparse');var Redis=require(_0x9042('0xe'));var authService=require(_0x9042('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9042('0x10'));var hardwareService=require(_0x9042('0x11'));var logger=require(_0x9042('0x12'))(_0x9042('0x13'));var utils=require(_0x9042('0x14'));var config=require(_0x9042('0x15'));var db=require(_0x9042('0x16'))['db'];var jayson=require(_0x9042('0x17'));var client=jayson[_0x9042('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x2a15ce,_0xbb8e95,_0x4bf0b5){if(_0x4bf0b5){var _0x5a503c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a503c['test'](_0xbb8e95)){return _0x2a15ce;}else{throw new db['Sequelize'][(_0x9042('0x19'))](_0x9042('0x1a'));}}else{return _0x2a15ce;}}function respondWithRpcPromise(_0x1da588,_0x482c58,_0x5ebf71,_0x2de9c6){return new BPromise(function(_0x39f12b,_0x253192){var _0x4b1fea=_0x2de9c6||client;return _0x4b1fea[_0x9042('0x1b')](_0x1da588,_0x5ebf71)[_0x9042('0x1c')](function(_0x558a6c){logger[_0x9042('0x1d')](_0x9042('0x1e'),_0x482c58,_0x9042('0x1f'));logger[_0x9042('0x20')](_0x9042('0x21'),_0x482c58,_0x9042('0x1f'),JSON['stringify'](_0x558a6c));if(_0x558a6c[_0x9042('0x22')]){if(_0x558a6c[_0x9042('0x22')][_0x9042('0x23')]===0x1f4){logger[_0x9042('0x22')](_0x9042('0x1e'),_0x482c58,_0x558a6c[_0x9042('0x22')]['message']);return _0x253192(_0x558a6c['error'][_0x9042('0x24')]);}logger['error'](_0x9042('0x1e'),_0x482c58,_0x558a6c['error'][_0x9042('0x24')]);return _0x39f12b(_0x558a6c[_0x9042('0x22')]['message']);}else{logger[_0x9042('0x1d')](_0x9042('0x1e'),_0x482c58,'request\x20sent');_0x39f12b(_0x558a6c[_0x9042('0x25')][_0x9042('0x24')]);}})[_0x9042('0x26')](function(_0x17862d){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x482c58,_0x17862d);_0x253192(_0x17862d);});});}function respondWithStatusCode(_0x55a311,_0x15ec63){_0x15ec63=_0x15ec63||0xcc;return function(_0x5e46b3){if(_0x5e46b3){return _0x55a311['sendStatus'](_0x15ec63);}return _0x55a311['status'](_0x15ec63)[_0x9042('0x27')]();};}function respondWithResult(_0x12144e,_0x41a67c){_0x41a67c=_0x41a67c||0xc8;return function(_0x178c2c){if(_0x178c2c){return _0x12144e[_0x9042('0x28')](_0x41a67c)[_0x9042('0x29')](_0x178c2c);}};}function respondWithFilteredResult(_0x45d3ce,_0x1a5caf){return function(_0x2aa4bb){if(_0x2aa4bb){var _0x153df4=_0x2aa4bb['count'],_0x16c90f=_0x1a5caf[_0x9042('0x2a')],_0x1b46f7=_0x1a5caf['offset']+_0x1a5caf[_0x9042('0x2b')],_0x313392;if(_0x1b46f7>=_0x153df4){_0x1b46f7=_0x153df4;_0x313392=0xc8;}else{_0x313392=0xce;}_0x45d3ce[_0x9042('0x28')](_0x313392);return _0x45d3ce[_0x9042('0x2c')](_0x9042('0x2d'),_0x16c90f+'-'+_0x1b46f7+'/'+_0x153df4)[_0x9042('0x29')](_0x2aa4bb);}return null;};}function patchUpdates(_0x175c42){return function(_0x12d858){try{jsonpatch[_0x9042('0x2e')](_0x12d858,_0x175c42,!![]);}catch(_0x142333){return BPromise['reject'](_0x142333);}return _0x12d858[_0x9042('0x2f')]();};}function saveUpdates(_0x4a78d4,_0x57be88){return function(_0x2c1921){if(_0x2c1921){return _0x2c1921[_0x9042('0x30')](_0x4a78d4)[_0x9042('0x1c')](function(_0x4e3d28){return _0x4e3d28;});}return null;};}function removeEntity(_0xc6368,_0x496383){return function(_0x26438e){if(_0x26438e){return _0x26438e['destroy']()[_0x9042('0x1c')](function(){_0xc6368['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ea19,_0x49a835){return function(_0x329de1){if(!_0x329de1){_0x35ea19[_0x9042('0x31')](0x194);}return _0x329de1;};}function handleError(_0x5bd7d4,_0x376a7c){_0x376a7c=_0x376a7c||0x1f4;return function(_0x399832){logger[_0x9042('0x22')](_0x399832[_0x9042('0x32')]);if(_0x399832[_0x9042('0x33')]){delete _0x399832[_0x9042('0x33')];}_0x5bd7d4[_0x9042('0x28')](_0x376a7c)[_0x9042('0x34')](_0x399832);};}exports[_0x9042('0x35')]=function(_0x15ab5f,_0x2858c9){var _0x11d99e={},_0x442bbf={},_0x6cbd5d={'count':0x0,'rows':[]};var _0x4cf857=_[_0x9042('0x36')](db[_0x9042('0x37')][_0x9042('0x38')],function(_0x49ce06){return{'name':_0x49ce06[_0x9042('0x39')],'type':_0x49ce06['type']['key']};});_0x442bbf[_0x9042('0x3a')]=_[_0x9042('0x36')](_0x4cf857,_0x9042('0x33'));_0x442bbf['query']=_[_0x9042('0x3b')](_0x15ab5f[_0x9042('0x3c')]);_0x442bbf[_0x9042('0x3d')]=_['intersection'](_0x442bbf[_0x9042('0x3a')],_0x442bbf[_0x9042('0x3c')]);_0x11d99e['attributes']=_[_0x9042('0x3e')](_0x442bbf[_0x9042('0x3a')],qs['fields'](_0x15ab5f[_0x9042('0x3c')][_0x9042('0x3f')]));_0x11d99e[_0x9042('0x40')]=_0x11d99e[_0x9042('0x40')][_0x9042('0x41')]?_0x11d99e[_0x9042('0x40')]:_0x442bbf[_0x9042('0x3a')];if(!_0x15ab5f[_0x9042('0x3c')][_0x9042('0x42')](_0x9042('0x43'))){_0x11d99e['limit']=qs[_0x9042('0x2b')](_0x15ab5f[_0x9042('0x3c')]['limit']);_0x11d99e[_0x9042('0x2a')]=qs[_0x9042('0x2a')](_0x15ab5f[_0x9042('0x3c')]['offset']);}_0x11d99e['order']=qs['sort'](_0x15ab5f[_0x9042('0x3c')]['sort']);_0x11d99e[_0x9042('0x44')]=qs[_0x9042('0x3d')](_[_0x9042('0x45')](_0x15ab5f[_0x9042('0x3c')],_0x442bbf[_0x9042('0x3d')]),_0x4cf857);if(_0x15ab5f[_0x9042('0x3c')][_0x9042('0x46')]){_0x11d99e[_0x9042('0x44')]=_[_0x9042('0x47')](_0x11d99e[_0x9042('0x44')],{'$or':_[_0x9042('0x36')](_0x4cf857,function(_0x2dfaa4){if(_0x2dfaa4[_0x9042('0x48')]!==_0x9042('0x49')){var _0x2dc4c5={};_0x2dc4c5[_0x2dfaa4[_0x9042('0x33')]]={'$like':'%'+_0x15ab5f[_0x9042('0x3c')][_0x9042('0x46')]+'%'};return _0x2dc4c5;}})});}_0x11d99e=_[_0x9042('0x47')]({},_0x11d99e,_0x15ab5f['options']);var _0x79dc48={'where':_0x11d99e[_0x9042('0x44')]};return db[_0x9042('0x37')]['count'](_0x79dc48)[_0x9042('0x1c')](function(_0xdd8188){_0x6cbd5d[_0x9042('0x4a')]=_0xdd8188;if(_0x15ab5f[_0x9042('0x3c')][_0x9042('0x4b')]){_0x11d99e[_0x9042('0x4c')]=[{'all':!![]}];}return db[_0x9042('0x37')][_0x9042('0x4d')](_0x11d99e);})[_0x9042('0x1c')](function(_0x74d70c){_0x6cbd5d['rows']=_0x74d70c;return _0x6cbd5d;})['then'](respondWithFilteredResult(_0x2858c9,_0x11d99e))[_0x9042('0x26')](handleError(_0x2858c9,null));};exports[_0x9042('0x4e')]=function(_0x394728,_0x5cdd8a){var _0x594a5e={'raw':![],'where':{'id':_0x394728[_0x9042('0x4f')]['id']}},_0x455654={};_0x455654[_0x9042('0x3a')]=_['keys'](db['SugarcrmConfiguration'][_0x9042('0x38')]);_0x455654[_0x9042('0x3c')]=_[_0x9042('0x3b')](_0x394728[_0x9042('0x3c')]);_0x455654[_0x9042('0x3d')]=_[_0x9042('0x3e')](_0x455654[_0x9042('0x3a')],_0x455654['query']);_0x594a5e[_0x9042('0x40')]=_[_0x9042('0x3e')](_0x455654['model'],qs['fields'](_0x394728[_0x9042('0x3c')]['fields']));_0x594a5e['attributes']=_0x594a5e[_0x9042('0x40')][_0x9042('0x41')]?_0x594a5e[_0x9042('0x40')]:_0x455654['model'];if(_0x394728[_0x9042('0x3c')][_0x9042('0x4b')]){_0x594a5e[_0x9042('0x4c')]=[{'all':!![]}];}_0x594a5e=_[_0x9042('0x47')]({},_0x594a5e,_0x394728[_0x9042('0x50')]);return db[_0x9042('0x37')]['find'](_0x594a5e)[_0x9042('0x1c')](handleEntityNotFound(_0x5cdd8a,null))['then'](respondWithResult(_0x5cdd8a,null))[_0x9042('0x26')](handleError(_0x5cdd8a,null));};exports[_0x9042('0x51')]=function(_0x3c093c,_0x1411b6){return db[_0x9042('0x37')][_0x9042('0x51')](_0x3c093c['body'],{})[_0x9042('0x1c')](respondWithResult(_0x1411b6,0xc9))[_0x9042('0x26')](handleError(_0x1411b6,null));};exports[_0x9042('0x30')]=function(_0x2595a8,_0x3c42fb){if(_0x2595a8[_0x9042('0x52')]['id']){delete _0x2595a8[_0x9042('0x52')]['id'];}return db[_0x9042('0x37')][_0x9042('0x53')]({'where':{'id':_0x2595a8[_0x9042('0x4f')]['id']}})[_0x9042('0x1c')](handleEntityNotFound(_0x3c42fb,null))[_0x9042('0x1c')](saveUpdates(_0x2595a8[_0x9042('0x52')],null))[_0x9042('0x1c')](respondWithResult(_0x3c42fb,null))[_0x9042('0x26')](handleError(_0x3c42fb,null));};exports['destroy']=function(_0x177bfa,_0x38efad){return db[_0x9042('0x37')][_0x9042('0x53')]({'where':{'id':_0x177bfa[_0x9042('0x4f')]['id']}})['then'](handleEntityNotFound(_0x38efad,null))['then'](removeEntity(_0x38efad,null))[_0x9042('0x26')](handleError(_0x38efad,null));};exports[_0x9042('0x54')]=function(_0x502679,_0xd72e2a,_0x55ee97){var _0x4b02b4={};var _0xeeb665={};var _0x17c4f9;var _0x25a175;return db[_0x9042('0x37')][_0x9042('0x55')]({'where':{'id':_0x502679['params']['id']}})[_0x9042('0x1c')](handleEntityNotFound(_0xd72e2a,null))[_0x9042('0x1c')](function(_0x3d95d7){if(_0x3d95d7){_0x17c4f9=_0x3d95d7;_0xeeb665['model']=_[_0x9042('0x3b')](db['SugarcrmField']['rawAttributes']);_0xeeb665['query']=_[_0x9042('0x3b')](_0x502679[_0x9042('0x3c')]);_0xeeb665[_0x9042('0x3d')]=_[_0x9042('0x3e')](_0xeeb665['model'],_0xeeb665[_0x9042('0x3c')]);_0x4b02b4[_0x9042('0x40')]=_[_0x9042('0x3e')](_0xeeb665['model'],qs[_0x9042('0x3f')](_0x502679['query'][_0x9042('0x3f')]));_0x4b02b4[_0x9042('0x40')]=_0x4b02b4['attributes'][_0x9042('0x41')]?_0x4b02b4[_0x9042('0x40')]:_0xeeb665[_0x9042('0x3a')];_0x4b02b4[_0x9042('0x56')]=qs['sort'](_0x502679[_0x9042('0x3c')][_0x9042('0x57')]);_0x4b02b4['where']=qs[_0x9042('0x3d')](_['pick'](_0x502679[_0x9042('0x3c')],_0xeeb665[_0x9042('0x3d')]));if(_0x502679[_0x9042('0x3c')][_0x9042('0x46')]){_0x4b02b4[_0x9042('0x44')]=_[_0x9042('0x47')](_0x4b02b4[_0x9042('0x44')],{'$or':_[_0x9042('0x36')](_0x4b02b4['attributes'],function(_0x2496e4){var _0x542334={};_0x542334[_0x2496e4]={'$like':'%'+_0x502679[_0x9042('0x3c')][_0x9042('0x46')]+'%'};return _0x542334;})});}_0x4b02b4=_[_0x9042('0x47')]({},_0x4b02b4,_0x502679['options']);return _0x17c4f9[_0x9042('0x54')](_0x4b02b4);}})[_0x9042('0x1c')](function(_0x321e0e){if(_0x321e0e){_0x25a175=_0x321e0e['length'];if(!_0x502679[_0x9042('0x3c')][_0x9042('0x42')](_0x9042('0x43'))){_0x4b02b4[_0x9042('0x2b')]=qs[_0x9042('0x2b')](_0x502679[_0x9042('0x3c')][_0x9042('0x2b')]);_0x4b02b4['offset']=qs[_0x9042('0x2a')](_0x502679['query']['offset']);}return _0x17c4f9['getFields'](_0x4b02b4);}})[_0x9042('0x1c')](function(_0x7f8390){if(_0x7f8390){return _0x7f8390?{'count':_0x25a175,'rows':_0x7f8390}:null;}})[_0x9042('0x1c')](respondWithResult(_0xd72e2a,null))['catch'](handleError(_0xd72e2a,null));};exports[_0x9042('0x58')]=function(_0x2a0b3e,_0x4d6792,_0x22591d){var _0xcd3672={};var _0x569b0c={};var _0x583a7e;var _0x52dd69;return db['SugarcrmConfiguration'][_0x9042('0x55')]({'where':{'id':_0x2a0b3e['params']['id']}})['then'](handleEntityNotFound(_0x4d6792,null))[_0x9042('0x1c')](function(_0xf43998){if(_0xf43998){_0x583a7e=_0xf43998;_0x569b0c['model']=_['keys'](db['SugarcrmField'][_0x9042('0x38')]);_0x569b0c[_0x9042('0x3c')]=_[_0x9042('0x3b')](_0x2a0b3e['query']);_0x569b0c[_0x9042('0x3d')]=_['intersection'](_0x569b0c['model'],_0x569b0c[_0x9042('0x3c')]);_0xcd3672[_0x9042('0x40')]=_[_0x9042('0x3e')](_0x569b0c[_0x9042('0x3a')],qs['fields'](_0x2a0b3e[_0x9042('0x3c')][_0x9042('0x3f')]));_0xcd3672[_0x9042('0x40')]=_0xcd3672['attributes'][_0x9042('0x41')]?_0xcd3672[_0x9042('0x40')]:_0x569b0c[_0x9042('0x3a')];_0xcd3672[_0x9042('0x56')]=qs[_0x9042('0x57')](_0x2a0b3e['query'][_0x9042('0x57')]);_0xcd3672[_0x9042('0x44')]=qs['filters'](_['pick'](_0x2a0b3e['query'],_0x569b0c[_0x9042('0x3d')]));if(_0x2a0b3e[_0x9042('0x3c')][_0x9042('0x46')]){_0xcd3672[_0x9042('0x44')]=_[_0x9042('0x47')](_0xcd3672[_0x9042('0x44')],{'$or':_['map'](_0xcd3672['attributes'],function(_0x377c15){var _0x30c420={};_0x30c420[_0x377c15]={'$like':'%'+_0x2a0b3e['query']['filter']+'%'};return _0x30c420;})});}_0xcd3672=_[_0x9042('0x47')]({},_0xcd3672,_0x2a0b3e[_0x9042('0x50')]);return _0x583a7e['getSubjects'](_0xcd3672);}})[_0x9042('0x1c')](function(_0x3ccb38){if(_0x3ccb38){_0x52dd69=_0x3ccb38[_0x9042('0x41')];if(!_0x2a0b3e[_0x9042('0x3c')][_0x9042('0x42')](_0x9042('0x43'))){_0xcd3672[_0x9042('0x2b')]=qs[_0x9042('0x2b')](_0x2a0b3e[_0x9042('0x3c')][_0x9042('0x2b')]);_0xcd3672[_0x9042('0x2a')]=qs['offset'](_0x2a0b3e[_0x9042('0x3c')][_0x9042('0x2a')]);}return _0x583a7e[_0x9042('0x58')](_0xcd3672);}})[_0x9042('0x1c')](function(_0x12b4f7){if(_0x12b4f7){return _0x12b4f7?{'count':_0x52dd69,'rows':_0x12b4f7}:null;}})[_0x9042('0x1c')](respondWithResult(_0x4d6792,null))[_0x9042('0x26')](handleError(_0x4d6792,null));};exports['getDescriptions']=function(_0x1bca34,_0x1b3cd5,_0x149c17){var _0x1582a2={};var _0x5b04ad={};var _0x1e092a;var _0x3790f4;return db[_0x9042('0x37')][_0x9042('0x55')]({'where':{'id':_0x1bca34[_0x9042('0x4f')]['id']}})[_0x9042('0x1c')](handleEntityNotFound(_0x1b3cd5,null))[_0x9042('0x1c')](function(_0x4d41ce){if(_0x4d41ce){_0x1e092a=_0x4d41ce;_0x5b04ad[_0x9042('0x3a')]=_[_0x9042('0x3b')](db[_0x9042('0x59')][_0x9042('0x38')]);_0x5b04ad[_0x9042('0x3c')]=_[_0x9042('0x3b')](_0x1bca34['query']);_0x5b04ad[_0x9042('0x3d')]=_[_0x9042('0x3e')](_0x5b04ad['model'],_0x5b04ad[_0x9042('0x3c')]);_0x1582a2[_0x9042('0x40')]=_[_0x9042('0x3e')](_0x5b04ad['model'],qs['fields'](_0x1bca34['query'][_0x9042('0x3f')]));_0x1582a2[_0x9042('0x40')]=_0x1582a2[_0x9042('0x40')][_0x9042('0x41')]?_0x1582a2['attributes']:_0x5b04ad[_0x9042('0x3a')];_0x1582a2['order']=qs['sort'](_0x1bca34[_0x9042('0x3c')][_0x9042('0x57')]);_0x1582a2[_0x9042('0x44')]=qs['filters'](_[_0x9042('0x45')](_0x1bca34[_0x9042('0x3c')],_0x5b04ad[_0x9042('0x3d')]));if(_0x1bca34[_0x9042('0x3c')][_0x9042('0x46')]){_0x1582a2['where']=_[_0x9042('0x47')](_0x1582a2['where'],{'$or':_[_0x9042('0x36')](_0x1582a2[_0x9042('0x40')],function(_0x50a29c){var _0x458a8a={};_0x458a8a[_0x50a29c]={'$like':'%'+_0x1bca34['query'][_0x9042('0x46')]+'%'};return _0x458a8a;})});}_0x1582a2=_[_0x9042('0x47')]({},_0x1582a2,_0x1bca34[_0x9042('0x50')]);return _0x1e092a[_0x9042('0x5a')](_0x1582a2);}})[_0x9042('0x1c')](function(_0x5ca218){if(_0x5ca218){_0x3790f4=_0x5ca218[_0x9042('0x41')];if(!_0x1bca34[_0x9042('0x3c')]['hasOwnProperty'](_0x9042('0x43'))){_0x1582a2[_0x9042('0x2b')]=qs[_0x9042('0x2b')](_0x1bca34[_0x9042('0x3c')]['limit']);_0x1582a2[_0x9042('0x2a')]=qs[_0x9042('0x2a')](_0x1bca34[_0x9042('0x3c')][_0x9042('0x2a')]);}return _0x1e092a[_0x9042('0x5a')](_0x1582a2);}})[_0x9042('0x1c')](function(_0x153571){if(_0x153571){return _0x153571?{'count':_0x3790f4,'rows':_0x153571}:null;}})[_0x9042('0x1c')](respondWithResult(_0x1b3cd5,null))[_0x9042('0x26')](handleError(_0x1b3cd5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 1b89b3d..e70c464 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 _0x927d=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration'];(function(_0x3ac19e,_0x1f0e26){var _0x33ed11=function(_0x3c17ce){while(--_0x3c17ce){_0x3ac19e['push'](_0x3ac19e['shift']());}};_0x33ed11(++_0x1f0e26);}(_0x927d,0x91));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd927('0x0'));var util=require(_0xd927('0x1'));var logger=require(_0xd927('0x2'))(_0xd927('0x3'));var moment=require(_0xd927('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd927('0x5'));var attributes=require(_0xd927('0x6'));module['exports']=function(_0xfc839f,_0x5ced3e){return _0xfc839f['define'](_0xd927('0x7'),attributes,{'tableName':_0xd927('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd459=['moment','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api'];(function(_0x59ee28,_0x175ae9){var _0x531440=function(_0x66b140){while(--_0x66b140){_0x59ee28['push'](_0x59ee28['shift']());}};_0x531440(++_0x175ae9);}(_0xd459,0x1d6));var _0x9d45=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xd459[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x9d45('0x0'));var util=require('util');var logger=require(_0x9d45('0x1'))(_0x9d45('0x2'));var moment=require(_0x9d45('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d45('0x4'));var config=require(_0x9d45('0x5'));var attributes=require(_0x9d45('0x6'));module[_0x9d45('0x7')]=function(_0x47d0df,_0x412939){return _0x47d0df[_0x9d45('0x8')](_0x9d45('0x9'),attributes,{'tableName':_0x9d45('0xa'),'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 64a900e..275b22c 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 _0xd652=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xd652,0x19c));var _0x2d65=function(_0x2b0ce0,_0x394b3b){_0x2b0ce0=_0x2b0ce0-0x0;var _0x1b042d=_0xd652[_0x2b0ce0];return _0x1b042d;};'use strict';var _=require(_0x2d65('0x0'));var util=require(_0x2d65('0x1'));var moment=require(_0x2d65('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d65('0x3'));var fs=require('fs');var Redis=require(_0x2d65('0x4'));var db=require(_0x2d65('0x5'))['db'];var utils=require(_0x2d65('0x6'));var logger=require('../../config/logger')(_0x2d65('0x7'));var config=require(_0x2d65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2d65('0x9')][_0x2d65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52b8bb,_0x2d525f,_0x3266e2){return new BPromise(function(_0x13a495,_0x2bb8b3){return client[_0x2d65('0xb')](_0x52b8bb,_0x3266e2)[_0x2d65('0xc')](function(_0x2e87da){logger[_0x2d65('0xd')](_0x2d65('0xe'),_0x2d525f,_0x2d65('0xf'));logger[_0x2d65('0x10')](_0x2d65('0x11'),_0x2d525f,'request\x20sent',JSON[_0x2d65('0x12')](_0x2e87da));if(_0x2e87da['error']){if(_0x2e87da[_0x2d65('0x13')]['code']===0x1f4){logger[_0x2d65('0x13')](_0x2d65('0xe'),_0x2d525f,_0x2e87da[_0x2d65('0x13')]['message']);return _0x2bb8b3(_0x2e87da[_0x2d65('0x13')][_0x2d65('0x14')]);}logger[_0x2d65('0x13')](_0x2d65('0xe'),_0x2d525f,_0x2e87da[_0x2d65('0x13')][_0x2d65('0x14')]);return _0x13a495(_0x2e87da[_0x2d65('0x13')][_0x2d65('0x14')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2d525f,'request\x20sent');_0x13a495(_0x2e87da[_0x2d65('0x15')][_0x2d65('0x14')]);}})[_0x2d65('0x16')](function(_0x34d2d7){logger[_0x2d65('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2d525f,_0x34d2d7);_0x2bb8b3(_0x34d2d7);});});} \ No newline at end of file +var _0xc248=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xc248,0xaf));var _0x8c24=function(_0x29af67,_0x428ed5){_0x29af67=_0x29af67-0x0;var _0x42e723=_0xc248[_0x29af67];return _0x42e723;};'use strict';var _=require(_0x8c24('0x0'));var util=require(_0x8c24('0x1'));var moment=require(_0x8c24('0x2'));var BPromise=require(_0x8c24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c24('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c24('0x5'))(_0x8c24('0x6'));var config=require(_0x8c24('0x7'));var jayson=require(_0x8c24('0x8'));var client=jayson[_0x8c24('0x9')][_0x8c24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x309c8a,_0x1d7b7f,_0x19479a){return new BPromise(function(_0x2924ce,_0x1663f7){return client[_0x8c24('0xb')](_0x309c8a,_0x19479a)['then'](function(_0x502b5d){logger[_0x8c24('0xc')](_0x8c24('0xd'),_0x1d7b7f,_0x8c24('0xe'));logger[_0x8c24('0xf')](_0x8c24('0x10'),_0x1d7b7f,_0x8c24('0xe'),JSON['stringify'](_0x502b5d));if(_0x502b5d[_0x8c24('0x11')]){if(_0x502b5d[_0x8c24('0x11')][_0x8c24('0x12')]===0x1f4){logger[_0x8c24('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1d7b7f,_0x502b5d[_0x8c24('0x11')][_0x8c24('0x13')]);return _0x1663f7(_0x502b5d['error'][_0x8c24('0x13')]);}logger[_0x8c24('0x11')](_0x8c24('0xd'),_0x1d7b7f,_0x502b5d[_0x8c24('0x11')]['message']);return _0x2924ce(_0x502b5d['error'][_0x8c24('0x13')]);}else{logger['info'](_0x8c24('0xd'),_0x1d7b7f,_0x8c24('0xe'));_0x2924ce(_0x502b5d[_0x8c24('0x14')][_0x8c24('0x13')]);}})['catch'](function(_0x52af87){logger[_0x8c24('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1d7b7f,_0x52af87);_0x1663f7(_0x52af87);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 3e69153..279fb6c 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 _0x1e7b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x1ee394,_0x566525){var _0xdc4597=function(_0x3ef83f){while(--_0x3ef83f){_0x1ee394['push'](_0x1ee394['shift']());}};_0xdc4597(++_0x566525);}(_0x1e7b,0x12a));var _0xb1e7=function(_0x2db0e0,_0x43c8c0){_0x2db0e0=_0x2db0e0-0x0;var _0x1d78ca=_0x1e7b[_0x2db0e0];return _0x1d78ca;};'use strict';var multer=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var path=require(_0xb1e7('0x2'));var timeout=require(_0xb1e7('0x3'));var express=require(_0xb1e7('0x4'));var router=express['Router']();var auth=require(_0xb1e7('0x5'));var interaction=require(_0xb1e7('0x6'));var config=require(_0xb1e7('0x7'));var controller=require(_0xb1e7('0x8'));router[_0xb1e7('0x9')]('/',auth[_0xb1e7('0xa')](),controller[_0xb1e7('0xb')]);router[_0xb1e7('0x9')](_0xb1e7('0xc'),auth[_0xb1e7('0xa')](),controller[_0xb1e7('0xd')]);router[_0xb1e7('0xe')]('/',auth[_0xb1e7('0xa')](),controller[_0xb1e7('0xf')]);router[_0xb1e7('0x10')](_0xb1e7('0xc'),auth[_0xb1e7('0xa')](),controller[_0xb1e7('0x11')]);router[_0xb1e7('0x12')](_0xb1e7('0xc'),auth['isAuthenticated'](),controller[_0xb1e7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x536a=['put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x3dfb56,_0xfe844d){var _0x5e6e1b=function(_0x4e002f){while(--_0x4e002f){_0x3dfb56['push'](_0x3dfb56['shift']());}};_0x5e6e1b(++_0xfe844d);}(_0x536a,0x136));var _0xa536=function(_0x3a267e,_0x2111e5){_0x3a267e=_0x3a267e-0x0;var _0x5b2063=_0x536a[_0x3a267e];return _0x5b2063;};'use strict';var multer=require(_0xa536('0x0'));var util=require('util');var path=require(_0xa536('0x1'));var timeout=require(_0xa536('0x2'));var express=require(_0xa536('0x3'));var router=express['Router']();var auth=require(_0xa536('0x4'));var interaction=require(_0xa536('0x5'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xa536('0x6')](),controller[_0xa536('0x7')]);router[_0xa536('0x8')](_0xa536('0x9'),auth[_0xa536('0x6')](),controller[_0xa536('0xa')]);router[_0xa536('0xb')]('/',auth[_0xa536('0x6')](),controller[_0xa536('0xc')]);router[_0xa536('0xd')](_0xa536('0x9'),auth[_0xa536('0x6')](),controller[_0xa536('0xe')]);router[_0xa536('0xf')](_0xa536('0x9'),auth[_0xa536('0x6')](),controller[_0xa536('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2ec9c45..ffd9594 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 _0x359a=['string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x22d81b,_0x17039a){var _0xba37c5=function(_0x5b29c8){while(--_0x5b29c8){_0x22d81b['push'](_0x22d81b['shift']());}};_0xba37c5(++_0x17039a);}(_0x359a,0x153));var _0xa359=function(_0x22826c,_0x562e83){_0x22826c=_0x22826c-0x0;var _0x1725a4=_0x359a[_0x22826c];return _0x1725a4;};'use strict';var Sequelize=require(_0xa359('0x0'));module[_0xa359('0x1')]={'type':{'type':Sequelize[_0xa359('0x2')](_0xa359('0x3'),_0xa359('0x4'),'customVariable',_0xa359('0x5')),'defaultValue':_0xa359('0x3')},'content':{'type':Sequelize[_0xa359('0x6')]},'key':{'type':Sequelize[_0xa359('0x6')]},'keyType':{'type':Sequelize[_0xa359('0x2')](_0xa359('0x3'),_0xa359('0x4'),_0xa359('0x7'))},'keyContent':{'type':Sequelize[_0xa359('0x6')]},'idField':{'type':Sequelize[_0xa359('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa359('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a76=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a76,0xde));var _0x62a7=function(_0x1bcaf8,_0x5414c1){_0x1bcaf8=_0x1bcaf8-0x0;var _0x1c660c=_0x2a76[_0x1bcaf8];return _0x1c660c;};'use strict';var Sequelize=require(_0x62a7('0x0'));module[_0x62a7('0x1')]={'type':{'type':Sequelize[_0x62a7('0x2')](_0x62a7('0x3'),_0x62a7('0x4'),_0x62a7('0x5'),_0x62a7('0x6')),'defaultValue':_0x62a7('0x3')},'content':{'type':Sequelize[_0x62a7('0x7')]},'key':{'type':Sequelize[_0x62a7('0x7')]},'keyType':{'type':Sequelize[_0x62a7('0x2')]('string',_0x62a7('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x62a7('0x7')]},'idField':{'type':Sequelize[_0x62a7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x62a7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8bf7694..5e8b93f 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 _0xc7d1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','catch','options','create','body','update','params','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x30b37d,_0x13fc3c){var _0x2cb056=function(_0x43fbcd){while(--_0x43fbcd){_0x30b37d['push'](_0x30b37d['shift']());}};_0x2cb056(++_0x13fc3c);}(_0xc7d1,0x7e));var _0x1c7d=function(_0x49eb51,_0x5405b1){_0x49eb51=_0x49eb51-0x0;var _0x2af309=_0xc7d1[_0x49eb51];return _0x2af309;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1c7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c7d('0x1'));var jsonpatch=require(_0x1c7d('0x2'));var rp=require(_0x1c7d('0x3'));var moment=require('moment');var BPromise=require(_0x1c7d('0x4'));var Mustache=require('mustache');var util=require(_0x1c7d('0x5'));var path=require('path');var sox=require(_0x1c7d('0x6'));var csv=require(_0x1c7d('0x7'));var ejs=require(_0x1c7d('0x8'));var fs=require('fs');var _=require(_0x1c7d('0x9'));var squel=require('squel');var crypto=require(_0x1c7d('0xa'));var jsforce=require(_0x1c7d('0xb'));var deskjs=require(_0x1c7d('0xc'));var toCsv=require(_0x1c7d('0x7'));var querystring=require(_0x1c7d('0xd'));var Papa=require(_0x1c7d('0xe'));var Redis=require(_0x1c7d('0xf'));var authService=require(_0x1c7d('0x10'));var qs=require(_0x1c7d('0x11'));var as=require(_0x1c7d('0x12'));var hardwareService=require(_0x1c7d('0x13'));var logger=require(_0x1c7d('0x14'))(_0x1c7d('0x15'));var utils=require('../../config/utils');var config=require(_0x1c7d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b540,_0x418a40){_0x418a40=_0x418a40||0xcc;return function(_0x542cc7){if(_0x542cc7){return _0x34b540['sendStatus'](_0x418a40);}return _0x34b540[_0x1c7d('0x17')](_0x418a40)[_0x1c7d('0x18')]();};}function respondWithResult(_0x4cdeea,_0x4077f2){_0x4077f2=_0x4077f2||0xc8;return function(_0x1759a8){if(_0x1759a8){return _0x4cdeea['status'](_0x4077f2)[_0x1c7d('0x19')](_0x1759a8);}};}function respondWithFilteredResult(_0x3f9c1d,_0x546101){return function(_0x2a519f){if(_0x2a519f){var _0x46f3d8=_0x2a519f[_0x1c7d('0x1a')],_0x54c76d=_0x546101[_0x1c7d('0x1b')],_0x2922d8=_0x546101[_0x1c7d('0x1b')]+_0x546101[_0x1c7d('0x1c')],_0x2f11d2;if(_0x2922d8>=_0x46f3d8){_0x2922d8=_0x46f3d8;_0x2f11d2=0xc8;}else{_0x2f11d2=0xce;}_0x3f9c1d[_0x1c7d('0x17')](_0x2f11d2);return _0x3f9c1d[_0x1c7d('0x1d')](_0x1c7d('0x1e'),_0x54c76d+'-'+_0x2922d8+'/'+_0x46f3d8)[_0x1c7d('0x19')](_0x2a519f);}return null;};}function patchUpdates(_0x318517){return function(_0x400adf){try{jsonpatch[_0x1c7d('0x1f')](_0x400adf,_0x318517,!![]);}catch(_0x59e924){return BPromise[_0x1c7d('0x20')](_0x59e924);}return _0x400adf['save']();};}function saveUpdates(_0x4bacb7,_0x419dfb){return function(_0xe9190d){if(_0xe9190d){return _0xe9190d['update'](_0x4bacb7)[_0x1c7d('0x21')](function(_0x35661c){return _0x35661c;});}return null;};}function removeEntity(_0x52826c,_0xca9a6d){return function(_0x7f5ec){if(_0x7f5ec){return _0x7f5ec[_0x1c7d('0x22')]()[_0x1c7d('0x21')](function(){_0x52826c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20edc3,_0xb30108){return function(_0x3d68e7){if(!_0x3d68e7){_0x20edc3[_0x1c7d('0x23')](0x194);}return _0x3d68e7;};}function handleError(_0x39f685,_0x3e2cde){_0x3e2cde=_0x3e2cde||0x1f4;return function(_0xe5f5df){logger[_0x1c7d('0x24')](_0xe5f5df[_0x1c7d('0x25')]);if(_0xe5f5df['name']){delete _0xe5f5df['name'];}_0x39f685[_0x1c7d('0x17')](_0x3e2cde)[_0x1c7d('0x26')](_0xe5f5df);};}exports[_0x1c7d('0x27')]=function(_0x261166,_0x2975ff){var _0xb456ba={},_0x527f59={},_0x49b74a={'count':0x0,'rows':[]};var _0x2523d4=_['map'](db[_0x1c7d('0x28')][_0x1c7d('0x29')],function(_0x3cf4e3){return{'name':_0x3cf4e3[_0x1c7d('0x2a')],'type':_0x3cf4e3[_0x1c7d('0x2b')][_0x1c7d('0x2c')]};});_0x527f59[_0x1c7d('0x2d')]=_[_0x1c7d('0x2e')](_0x2523d4,_0x1c7d('0x2f'));_0x527f59[_0x1c7d('0x30')]=_[_0x1c7d('0x31')](_0x261166['query']);_0x527f59[_0x1c7d('0x32')]=_[_0x1c7d('0x33')](_0x527f59['model'],_0x527f59[_0x1c7d('0x30')]);_0xb456ba[_0x1c7d('0x34')]=_[_0x1c7d('0x33')](_0x527f59[_0x1c7d('0x2d')],qs[_0x1c7d('0x35')](_0x261166[_0x1c7d('0x30')][_0x1c7d('0x35')]));_0xb456ba['attributes']=_0xb456ba['attributes'][_0x1c7d('0x36')]?_0xb456ba[_0x1c7d('0x34')]:_0x527f59[_0x1c7d('0x2d')];if(!_0x261166[_0x1c7d('0x30')][_0x1c7d('0x37')](_0x1c7d('0x38'))){_0xb456ba[_0x1c7d('0x1c')]=qs[_0x1c7d('0x1c')](_0x261166['query'][_0x1c7d('0x1c')]);_0xb456ba[_0x1c7d('0x1b')]=qs[_0x1c7d('0x1b')](_0x261166[_0x1c7d('0x30')][_0x1c7d('0x1b')]);}_0xb456ba['order']=qs['sort'](_0x261166['query'][_0x1c7d('0x39')]);_0xb456ba['where']=qs[_0x1c7d('0x32')](_[_0x1c7d('0x3a')](_0x261166['query'],_0x527f59['filters']),_0x2523d4);if(_0x261166['query'][_0x1c7d('0x3b')]){_0xb456ba['where']=_[_0x1c7d('0x3c')](_0xb456ba['where'],{'$or':_[_0x1c7d('0x2e')](_0x2523d4,function(_0x2ad7dc){if(_0x2ad7dc['type']!==_0x1c7d('0x3d')){var _0xd15c98={};_0xd15c98[_0x2ad7dc[_0x1c7d('0x2f')]]={'$like':'%'+_0x261166[_0x1c7d('0x30')][_0x1c7d('0x3b')]+'%'};return _0xd15c98;}})});}_0xb456ba=_[_0x1c7d('0x3c')]({},_0xb456ba,_0x261166['options']);var _0x2489f={'where':_0xb456ba[_0x1c7d('0x3e')]};return db[_0x1c7d('0x28')]['count'](_0x2489f)[_0x1c7d('0x21')](function(_0x135548){_0x49b74a[_0x1c7d('0x1a')]=_0x135548;if(_0x261166[_0x1c7d('0x30')][_0x1c7d('0x3f')]){_0xb456ba[_0x1c7d('0x40')]=[{'all':!![]}];}return db[_0x1c7d('0x28')]['findAll'](_0xb456ba);})[_0x1c7d('0x21')](function(_0x3e2b24){_0x49b74a['rows']=_0x3e2b24;return _0x49b74a;})[_0x1c7d('0x21')](respondWithFilteredResult(_0x2975ff,_0xb456ba))[_0x1c7d('0x41')](handleError(_0x2975ff,null));};exports['show']=function(_0x288b14,_0x49ee71){var _0x33fb9e={'raw':!![],'where':{'id':_0x288b14['params']['id']}},_0x299595={};_0x299595[_0x1c7d('0x2d')]=_['keys'](db[_0x1c7d('0x28')][_0x1c7d('0x29')]);_0x299595[_0x1c7d('0x30')]=_[_0x1c7d('0x31')](_0x288b14[_0x1c7d('0x30')]);_0x299595[_0x1c7d('0x32')]=_[_0x1c7d('0x33')](_0x299595[_0x1c7d('0x2d')],_0x299595['query']);_0x33fb9e[_0x1c7d('0x34')]=_[_0x1c7d('0x33')](_0x299595[_0x1c7d('0x2d')],qs[_0x1c7d('0x35')](_0x288b14[_0x1c7d('0x30')]['fields']));_0x33fb9e[_0x1c7d('0x34')]=_0x33fb9e[_0x1c7d('0x34')]['length']?_0x33fb9e['attributes']:_0x299595[_0x1c7d('0x2d')];if(_0x288b14[_0x1c7d('0x30')][_0x1c7d('0x3f')]){_0x33fb9e[_0x1c7d('0x40')]=[{'all':!![]}];}_0x33fb9e=_[_0x1c7d('0x3c')]({},_0x33fb9e,_0x288b14[_0x1c7d('0x42')]);return db['SugarcrmField']['find'](_0x33fb9e)[_0x1c7d('0x21')](handleEntityNotFound(_0x49ee71,null))[_0x1c7d('0x21')](respondWithResult(_0x49ee71,null))[_0x1c7d('0x41')](handleError(_0x49ee71,null));};exports[_0x1c7d('0x43')]=function(_0x3623b7,_0x59ca26){return db[_0x1c7d('0x28')][_0x1c7d('0x43')](_0x3623b7[_0x1c7d('0x44')],{})[_0x1c7d('0x21')](respondWithResult(_0x59ca26,0xc9))[_0x1c7d('0x41')](handleError(_0x59ca26,null));};exports[_0x1c7d('0x45')]=function(_0x453bab,_0x450b0e){if(_0x453bab['body']['id']){delete _0x453bab['body']['id'];}return db[_0x1c7d('0x28')]['find']({'where':{'id':_0x453bab[_0x1c7d('0x46')]['id']}})[_0x1c7d('0x21')](handleEntityNotFound(_0x450b0e,null))[_0x1c7d('0x21')](saveUpdates(_0x453bab[_0x1c7d('0x44')],null))['then'](respondWithResult(_0x450b0e,null))[_0x1c7d('0x41')](handleError(_0x450b0e,null));};exports[_0x1c7d('0x22')]=function(_0x49320c,_0x40170e){return db[_0x1c7d('0x28')][_0x1c7d('0x47')]({'where':{'id':_0x49320c[_0x1c7d('0x46')]['id']}})[_0x1c7d('0x21')](handleEntityNotFound(_0x40170e,null))['then'](removeEntity(_0x40170e,null))[_0x1c7d('0x41')](handleError(_0x40170e,null));}; \ No newline at end of file +var _0x988e=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','SugarcrmField','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x988e,0x11f));var _0xe988=function(_0x3ee7de,_0x14c627){_0x3ee7de=_0x3ee7de-0x0;var _0x4f6303=_0x988e[_0x3ee7de];return _0x4f6303;};'use strict';var pdf=require(_0xe988('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe988('0x1'));var zipdir=require(_0xe988('0x2'));var jsonpatch=require(_0xe988('0x3'));var rp=require(_0xe988('0x4'));var moment=require(_0xe988('0x5'));var BPromise=require(_0xe988('0x6'));var Mustache=require(_0xe988('0x7'));var util=require(_0xe988('0x8'));var path=require(_0xe988('0x9'));var sox=require(_0xe988('0xa'));var csv=require(_0xe988('0xb'));var ejs=require(_0xe988('0xc'));var fs=require('fs');var _=require(_0xe988('0xd'));var squel=require(_0xe988('0xe'));var crypto=require(_0xe988('0xf'));var jsforce=require(_0xe988('0x10'));var deskjs=require(_0xe988('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe988('0x12'));var Redis=require(_0xe988('0x13'));var authService=require(_0xe988('0x14'));var qs=require(_0xe988('0x15'));var as=require(_0xe988('0x16'));var hardwareService=require(_0xe988('0x17'));var logger=require('../../config/logger')(_0xe988('0x18'));var utils=require('../../config/utils');var config=require(_0xe988('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58f1b7,_0x81876){_0x81876=_0x81876||0xcc;return function(_0x1dbc02){if(_0x1dbc02){return _0x58f1b7[_0xe988('0x1a')](_0x81876);}return _0x58f1b7[_0xe988('0x1b')](_0x81876)[_0xe988('0x1c')]();};}function respondWithResult(_0x38e3d7,_0x3ef049){_0x3ef049=_0x3ef049||0xc8;return function(_0x560ddd){if(_0x560ddd){return _0x38e3d7[_0xe988('0x1b')](_0x3ef049)[_0xe988('0x1d')](_0x560ddd);}};}function respondWithFilteredResult(_0x460f14,_0x5ee682){return function(_0x3a319b){if(_0x3a319b){var _0xf6618e=_0x3a319b['count'],_0x122a21=_0x5ee682[_0xe988('0x1e')],_0x33b762=_0x5ee682[_0xe988('0x1e')]+_0x5ee682[_0xe988('0x1f')],_0x1d4fbe;if(_0x33b762>=_0xf6618e){_0x33b762=_0xf6618e;_0x1d4fbe=0xc8;}else{_0x1d4fbe=0xce;}_0x460f14[_0xe988('0x1b')](_0x1d4fbe);return _0x460f14[_0xe988('0x20')]('Content-Range',_0x122a21+'-'+_0x33b762+'/'+_0xf6618e)[_0xe988('0x1d')](_0x3a319b);}return null;};}function patchUpdates(_0x2c9d9a){return function(_0x3acf4c){try{jsonpatch[_0xe988('0x21')](_0x3acf4c,_0x2c9d9a,!![]);}catch(_0x1e047a){return BPromise[_0xe988('0x22')](_0x1e047a);}return _0x3acf4c['save']();};}function saveUpdates(_0x137e5,_0x1ae206){return function(_0x3fe5bf){if(_0x3fe5bf){return _0x3fe5bf[_0xe988('0x23')](_0x137e5)[_0xe988('0x24')](function(_0x230d01){return _0x230d01;});}return null;};}function removeEntity(_0x5b0842,_0x56271e){return function(_0x4a5846){if(_0x4a5846){return _0x4a5846['destroy']()[_0xe988('0x24')](function(){_0x5b0842[_0xe988('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x79e2bd,_0x16dcc8){return function(_0x19f1c7){if(!_0x19f1c7){_0x79e2bd['sendStatus'](0x194);}return _0x19f1c7;};}function handleError(_0x1bc384,_0x4dcc7d){_0x4dcc7d=_0x4dcc7d||0x1f4;return function(_0xf0a3c1){logger[_0xe988('0x25')](_0xf0a3c1[_0xe988('0x26')]);if(_0xf0a3c1[_0xe988('0x27')]){delete _0xf0a3c1[_0xe988('0x27')];}_0x1bc384[_0xe988('0x1b')](_0x4dcc7d)[_0xe988('0x28')](_0xf0a3c1);};}exports[_0xe988('0x29')]=function(_0x47b9a5,_0x4eacfb){var _0x17f6f4={},_0x3da5a4={},_0x1911d4={'count':0x0,'rows':[]};var _0x327a7d=_[_0xe988('0x2a')](db['SugarcrmField']['rawAttributes'],function(_0x1707b2){return{'name':_0x1707b2[_0xe988('0x2b')],'type':_0x1707b2[_0xe988('0x2c')][_0xe988('0x2d')]};});_0x3da5a4[_0xe988('0x2e')]=_[_0xe988('0x2a')](_0x327a7d,_0xe988('0x27'));_0x3da5a4[_0xe988('0x2f')]=_[_0xe988('0x30')](_0x47b9a5[_0xe988('0x2f')]);_0x3da5a4[_0xe988('0x31')]=_['intersection'](_0x3da5a4[_0xe988('0x2e')],_0x3da5a4['query']);_0x17f6f4['attributes']=_[_0xe988('0x32')](_0x3da5a4['model'],qs[_0xe988('0x33')](_0x47b9a5[_0xe988('0x2f')][_0xe988('0x33')]));_0x17f6f4[_0xe988('0x34')]=_0x17f6f4[_0xe988('0x34')]['length']?_0x17f6f4[_0xe988('0x34')]:_0x3da5a4[_0xe988('0x2e')];if(!_0x47b9a5[_0xe988('0x2f')][_0xe988('0x35')]('nolimit')){_0x17f6f4[_0xe988('0x1f')]=qs[_0xe988('0x1f')](_0x47b9a5['query'][_0xe988('0x1f')]);_0x17f6f4['offset']=qs[_0xe988('0x1e')](_0x47b9a5[_0xe988('0x2f')][_0xe988('0x1e')]);}_0x17f6f4['order']=qs[_0xe988('0x36')](_0x47b9a5['query'][_0xe988('0x36')]);_0x17f6f4['where']=qs[_0xe988('0x31')](_['pick'](_0x47b9a5[_0xe988('0x2f')],_0x3da5a4['filters']),_0x327a7d);if(_0x47b9a5[_0xe988('0x2f')][_0xe988('0x37')]){_0x17f6f4[_0xe988('0x38')]=_[_0xe988('0x39')](_0x17f6f4[_0xe988('0x38')],{'$or':_[_0xe988('0x2a')](_0x327a7d,function(_0x15089f){if(_0x15089f['type']!==_0xe988('0x3a')){var _0x50f087={};_0x50f087[_0x15089f['name']]={'$like':'%'+_0x47b9a5[_0xe988('0x2f')][_0xe988('0x37')]+'%'};return _0x50f087;}})});}_0x17f6f4=_['merge']({},_0x17f6f4,_0x47b9a5[_0xe988('0x3b')]);var _0x52c14e={'where':_0x17f6f4['where']};return db[_0xe988('0x3c')][_0xe988('0x3d')](_0x52c14e)[_0xe988('0x24')](function(_0x1074ce){_0x1911d4['count']=_0x1074ce;if(_0x47b9a5[_0xe988('0x2f')]['includeAll']){_0x17f6f4[_0xe988('0x3e')]=[{'all':!![]}];}return db['SugarcrmField'][_0xe988('0x3f')](_0x17f6f4);})[_0xe988('0x24')](function(_0x305076){_0x1911d4[_0xe988('0x40')]=_0x305076;return _0x1911d4;})[_0xe988('0x24')](respondWithFilteredResult(_0x4eacfb,_0x17f6f4))[_0xe988('0x41')](handleError(_0x4eacfb,null));};exports[_0xe988('0x42')]=function(_0x332c23,_0x484559){var _0x2a3916={'raw':!![],'where':{'id':_0x332c23[_0xe988('0x43')]['id']}},_0xea42be={};_0xea42be['model']=_['keys'](db[_0xe988('0x3c')][_0xe988('0x44')]);_0xea42be['query']=_[_0xe988('0x30')](_0x332c23[_0xe988('0x2f')]);_0xea42be[_0xe988('0x31')]=_['intersection'](_0xea42be[_0xe988('0x2e')],_0xea42be[_0xe988('0x2f')]);_0x2a3916[_0xe988('0x34')]=_[_0xe988('0x32')](_0xea42be[_0xe988('0x2e')],qs[_0xe988('0x33')](_0x332c23[_0xe988('0x2f')]['fields']));_0x2a3916[_0xe988('0x34')]=_0x2a3916['attributes'][_0xe988('0x45')]?_0x2a3916[_0xe988('0x34')]:_0xea42be[_0xe988('0x2e')];if(_0x332c23['query'][_0xe988('0x46')]){_0x2a3916[_0xe988('0x3e')]=[{'all':!![]}];}_0x2a3916=_[_0xe988('0x39')]({},_0x2a3916,_0x332c23[_0xe988('0x3b')]);return db[_0xe988('0x3c')][_0xe988('0x47')](_0x2a3916)[_0xe988('0x24')](handleEntityNotFound(_0x484559,null))['then'](respondWithResult(_0x484559,null))['catch'](handleError(_0x484559,null));};exports[_0xe988('0x48')]=function(_0x1774b4,_0x152ba1){return db[_0xe988('0x3c')][_0xe988('0x48')](_0x1774b4['body'],{})[_0xe988('0x24')](respondWithResult(_0x152ba1,0xc9))[_0xe988('0x41')](handleError(_0x152ba1,null));};exports[_0xe988('0x23')]=function(_0x57cebf,_0x5569fd){if(_0x57cebf[_0xe988('0x49')]['id']){delete _0x57cebf[_0xe988('0x49')]['id'];}return db[_0xe988('0x3c')][_0xe988('0x47')]({'where':{'id':_0x57cebf[_0xe988('0x43')]['id']}})['then'](handleEntityNotFound(_0x5569fd,null))[_0xe988('0x24')](saveUpdates(_0x57cebf['body'],null))['then'](respondWithResult(_0x5569fd,null))[_0xe988('0x41')](handleError(_0x5569fd,null));};exports['destroy']=function(_0x354f55,_0x3d2844){return db[_0xe988('0x3c')][_0xe988('0x47')]({'where':{'id':_0x354f55['params']['id']}})[_0xe988('0x24')](handleEntityNotFound(_0x3d2844,null))[_0xe988('0x24')](removeEntity(_0x3d2844,null))[_0xe988('0x41')](handleError(_0x3d2844,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1a7214a..606d89a 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 _0xee2b=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xee2b,0x1c1));var _0xbee2=function(_0x453dcb,_0x2f260b){_0x453dcb=_0x453dcb-0x0;var _0x1a09e4=_0xee2b[_0x453dcb];return _0x1a09e4;};'use strict';var _=require(_0xbee2('0x0'));var util=require('util');var logger=require(_0xbee2('0x1'))(_0xbee2('0x2'));var moment=require(_0xbee2('0x3'));var BPromise=require(_0xbee2('0x4'));var rp=require(_0xbee2('0x5'));var fs=require('fs');var path=require(_0xbee2('0x6'));var rimraf=require(_0xbee2('0x7'));var config=require(_0xbee2('0x8'));var attributes=require(_0xbee2('0x9'));module[_0xbee2('0xa')]=function(_0x3aec32,_0x252ae1){return _0x3aec32[_0xbee2('0xb')](_0xbee2('0xc'),attributes,{'tableName':_0xbee2('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xbee2('0xe'),_0xbee2('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x06d0=['idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x06d0,0x11a));var _0x006d=function(_0x1e7b2c,_0x2625aa){_0x1e7b2c=_0x1e7b2c-0x0;var _0x53838a=_0x06d0[_0x1e7b2c];return _0x53838a;};'use strict';var _=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var logger=require('../../config/logger')(_0x006d('0x2'));var moment=require(_0x006d('0x3'));var BPromise=require(_0x006d('0x4'));var rp=require(_0x006d('0x5'));var fs=require('fs');var path=require(_0x006d('0x6'));var rimraf=require(_0x006d('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x006d('0x8')]=function(_0x57d8f5,_0x475153){return _0x57d8f5[_0x006d('0x9')](_0x006d('0xa'),attributes,{'tableName':_0x006d('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x006d('0xc'),_0x006d('0xd')],'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 bef4961..9566202 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 _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8603,0x190));var _0x3860=function(_0x50bace,_0x16f8b7){_0x50bace=_0x50bace-0x0;var _0x25dc5e=_0x8603[_0x50bace];return _0x25dc5e;};'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);});});} \ No newline at end of file +var _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x0b0e,0x187));var _0xe0b0=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x0b0e[_0x413aac];return _0x569b11;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ddd9821..39b08c1 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 _0xfd14=['connect-timeout','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','path'];(function(_0x1f7367,_0x2c635e){var _0x5e048f=function(_0x14399d){while(--_0x14399d){_0x1f7367['push'](_0x1f7367['shift']());}};_0x5e048f(++_0x2c635e);}(_0xfd14,0xd9));var _0x4fd1=function(_0xbd0857,_0x46de4f){_0xbd0857=_0xbd0857-0x0;var _0x515b38=_0xfd14[_0xbd0857];return _0x515b38;};'use strict';var multer=require(_0x4fd1('0x0'));var util=require(_0x4fd1('0x1'));var path=require(_0x4fd1('0x2'));var timeout=require(_0x4fd1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4fd1('0x4'));var interaction=require(_0x4fd1('0x5'));var config=require('../../config/environment');var controller=require(_0x4fd1('0x6'));router[_0x4fd1('0x7')]('/',auth[_0x4fd1('0x8')](),controller[_0x4fd1('0x9')]);router[_0x4fd1('0x7')](_0x4fd1('0xa'),auth[_0x4fd1('0x8')](),controller['show']);router[_0x4fd1('0x7')](_0x4fd1('0xb'),auth[_0x4fd1('0x8')](),controller['getConfigurations']);router[_0x4fd1('0x7')](_0x4fd1('0xc'),auth[_0x4fd1('0x8')](),controller[_0x4fd1('0xd')]);router[_0x4fd1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4fd1('0xe')](_0x4fd1('0xb'),auth[_0x4fd1('0x8')](),controller[_0x4fd1('0xf')]);router['put'](_0x4fd1('0xa'),auth[_0x4fd1('0x8')](),controller[_0x4fd1('0x10')]);router[_0x4fd1('0x11')](_0x4fd1('0xa'),auth[_0x4fd1('0x8')](),controller[_0x4fd1('0x12')]);module[_0x4fd1('0x13')]=router; \ No newline at end of file +var _0x1293=['Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3199bb,_0x579f3d){var _0x2efc56=function(_0xee0826){while(--_0xee0826){_0x3199bb['push'](_0x3199bb['shift']());}};_0x2efc56(++_0x579f3d);}(_0x1293,0x154));var _0x3129=function(_0x2a9bf5,_0x117cd7){_0x2a9bf5=_0x2a9bf5-0x0;var _0x55f308=_0x1293[_0x2a9bf5];return _0x55f308;};'use strict';var multer=require(_0x3129('0x0'));var util=require(_0x3129('0x1'));var path=require(_0x3129('0x2'));var timeout=require(_0x3129('0x3'));var express=require(_0x3129('0x4'));var router=express[_0x3129('0x5')]();var auth=require(_0x3129('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3129('0x7'));var controller=require(_0x3129('0x8'));router[_0x3129('0x9')]('/',auth[_0x3129('0xa')](),controller[_0x3129('0xb')]);router[_0x3129('0x9')](_0x3129('0xc'),auth[_0x3129('0xa')](),controller[_0x3129('0xd')]);router['get'](_0x3129('0xe'),auth[_0x3129('0xa')](),controller['getConfigurations']);router[_0x3129('0x9')](_0x3129('0xf'),auth[_0x3129('0xa')](),controller[_0x3129('0x10')]);router[_0x3129('0x11')]('/',auth['isAuthenticated'](),controller[_0x3129('0x12')]);router[_0x3129('0x11')](_0x3129('0xe'),auth[_0x3129('0xa')](),controller[_0x3129('0x13')]);router[_0x3129('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3129('0x15')]);router['delete'](_0x3129('0xc'),auth[_0x3129('0xa')](),controller['destroy']);module[_0x3129('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 b946caf..025c1e8 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 _0xdbf7=['STRING','sequelize'];(function(_0xc2b0f1,_0x56def6){var _0x488933=function(_0x570f15){while(--_0x570f15){_0xc2b0f1['push'](_0xc2b0f1['shift']());}};_0x488933(++_0x56def6);}(_0xdbf7,0x131));var _0x7dbf=function(_0x36c0eb,_0x3890ca){_0x36c0eb=_0x36c0eb-0x0;var _0x1d5727=_0xdbf7[_0x36c0eb];return _0x1d5727;};'use strict';var Sequelize=require(_0x7dbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7dbf('0x1')]},'username':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7dbf('0x1')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4326=['STRING','HelpDesk','sequelize','exports'];(function(_0x15d98f,_0x97fcf6){var _0x2e7f60=function(_0x2f996e){while(--_0x2f996e){_0x15d98f['push'](_0x15d98f['shift']());}};_0x2e7f60(++_0x97fcf6);}(_0x4326,0x1b2));var _0x6432=function(_0x4aa261,_0x213b4b){_0x4aa261=_0x4aa261-0x0;var _0x40f8ad=_0x4326[_0x4aa261];return _0x40f8ad;};'use strict';var Sequelize=require(_0x6432('0x0'));module[_0x6432('0x1')]={'name':{'type':Sequelize[_0x6432('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6432('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6432('0x2')],'allowNull':![],'defaultValue':_0x6432('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6432('0x2')]},'accessKey':{'type':Sequelize[_0x6432('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 457ac1f..cba5a2a 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 _0x7b0a=['picklistValues','value','log','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','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','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','name','send','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','VtigerConfiguration','VtigerField','Subjects','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','token','success','sessionName','reference','owner','includes','remove','editable','false','label','cf_','picklist'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7b0a,0x84));var _0xa7b0=function(_0x22acbd,_0x5687a9){_0x22acbd=_0x22acbd-0x0;var _0x598618=_0x7b0a[_0x22acbd];return _0x598618;};'use strict';var pdf=require(_0xa7b0('0x0'));var emlformat=require(_0xa7b0('0x1'));var rimraf=require(_0xa7b0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa7b0('0x4'));var util=require(_0xa7b0('0x5'));var path=require(_0xa7b0('0x6'));var sox=require(_0xa7b0('0x7'));var csv=require(_0xa7b0('0x8'));var ejs=require(_0xa7b0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa7b0('0xa'));var crypto=require(_0xa7b0('0xb'));var jsforce=require(_0xa7b0('0xc'));var deskjs=require(_0xa7b0('0xd'));var toCsv=require(_0xa7b0('0x8'));var querystring=require(_0xa7b0('0xe'));var Papa=require(_0xa7b0('0xf'));var Redis=require(_0xa7b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa7b0('0x11'));var as=require(_0xa7b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7b0('0x13'))(_0xa7b0('0x14'));var utils=require(_0xa7b0('0x15'));var config=require(_0xa7b0('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xa7b0('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x3677a5,_0x2b053c,_0x54f333){if(_0x54f333){var _0x176d74=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x176d74[_0xa7b0('0x18')](_0x2b053c)){return _0x3677a5;}else{throw new db['Sequelize'][(_0xa7b0('0x19'))](_0xa7b0('0x1a'));}}else{return _0x3677a5;}}function respondWithRpcPromise(_0x3c7a8c,_0x5588e1,_0x5d30d5,_0x162340){return new BPromise(function(_0x14d2ca,_0x18c2b6){var _0x2709ed=_0x162340||client;return _0x2709ed[_0xa7b0('0x1b')](_0x3c7a8c,_0x5d30d5)['then'](function(_0x6a4e33){logger[_0xa7b0('0x1c')](_0xa7b0('0x1d'),_0x5588e1,_0xa7b0('0x1e'));logger[_0xa7b0('0x1f')](_0xa7b0('0x20'),_0x5588e1,_0xa7b0('0x1e'),JSON[_0xa7b0('0x21')](_0x6a4e33));if(_0x6a4e33[_0xa7b0('0x22')]){if(_0x6a4e33['error'][_0xa7b0('0x23')]===0x1f4){logger[_0xa7b0('0x22')](_0xa7b0('0x1d'),_0x5588e1,_0x6a4e33[_0xa7b0('0x22')][_0xa7b0('0x24')]);return _0x18c2b6(_0x6a4e33[_0xa7b0('0x22')][_0xa7b0('0x24')]);}logger[_0xa7b0('0x22')](_0xa7b0('0x1d'),_0x5588e1,_0x6a4e33[_0xa7b0('0x22')][_0xa7b0('0x24')]);return _0x14d2ca(_0x6a4e33[_0xa7b0('0x22')][_0xa7b0('0x24')]);}else{logger['info'](_0xa7b0('0x1d'),_0x5588e1,_0xa7b0('0x1e'));_0x14d2ca(_0x6a4e33[_0xa7b0('0x25')][_0xa7b0('0x24')]);}})[_0xa7b0('0x26')](function(_0x1f2dbe){logger['error'](_0xa7b0('0x1d'),_0x5588e1,_0x1f2dbe);_0x18c2b6(_0x1f2dbe);});});}function respondWithStatusCode(_0x5cde66,_0x119af0){_0x119af0=_0x119af0||0xcc;return function(_0x25919d){if(_0x25919d){return _0x5cde66[_0xa7b0('0x27')](_0x119af0);}return _0x5cde66[_0xa7b0('0x28')](_0x119af0)[_0xa7b0('0x29')]();};}function respondWithResult(_0x3aaaea,_0x3f68c8){_0x3f68c8=_0x3f68c8||0xc8;return function(_0x54444d){if(_0x54444d){return _0x3aaaea[_0xa7b0('0x28')](_0x3f68c8)['json'](_0x54444d);}};}function respondWithFilteredResult(_0x23bfd9,_0x4cf622){return function(_0x5320e3){if(_0x5320e3){var _0x225142=_0x5320e3[_0xa7b0('0x2a')],_0x50e1f2=_0x4cf622[_0xa7b0('0x2b')],_0x5109f9=_0x4cf622[_0xa7b0('0x2b')]+_0x4cf622[_0xa7b0('0x2c')],_0x15b6e0;if(_0x5109f9>=_0x225142){_0x5109f9=_0x225142;_0x15b6e0=0xc8;}else{_0x15b6e0=0xce;}_0x23bfd9[_0xa7b0('0x28')](_0x15b6e0);return _0x23bfd9['set'](_0xa7b0('0x2d'),_0x50e1f2+'-'+_0x5109f9+'/'+_0x225142)[_0xa7b0('0x2e')](_0x5320e3);}return null;};}function patchUpdates(_0x52448d){return function(_0x1bcf8e){try{jsonpatch[_0xa7b0('0x2f')](_0x1bcf8e,_0x52448d,!![]);}catch(_0x171ffd){return BPromise[_0xa7b0('0x30')](_0x171ffd);}return _0x1bcf8e['save']();};}function saveUpdates(_0x5ce7f6,_0xfd4916){return function(_0x4ec470){if(_0x4ec470){return _0x4ec470[_0xa7b0('0x31')](_0x5ce7f6)[_0xa7b0('0x32')](function(_0x2924da){return _0x2924da;});}return null;};}function removeEntity(_0x2e0b38,_0x2385c5){return function(_0x5b74d7){if(_0x5b74d7){return _0x5b74d7[_0xa7b0('0x33')]()[_0xa7b0('0x32')](function(){_0x2e0b38[_0xa7b0('0x28')](0xcc)[_0xa7b0('0x29')]();});}};}function handleEntityNotFound(_0x5df3b5,_0x49f45a){return function(_0xf1b240){if(!_0xf1b240){_0x5df3b5['sendStatus'](0x194);}return _0xf1b240;};}function handleError(_0x104a01,_0x48a9e5){_0x48a9e5=_0x48a9e5||0x1f4;return function(_0x1b1e86){logger[_0xa7b0('0x22')](_0x1b1e86['stack']);if(_0x1b1e86[_0xa7b0('0x34')]){delete _0x1b1e86['name'];}_0x104a01[_0xa7b0('0x28')](_0x48a9e5)[_0xa7b0('0x35')](_0x1b1e86);};}exports['index']=function(_0x543e2d,_0x21feb0){var _0x21fe2d={},_0x33f8c3={},_0x3365aa={'count':0x0,'rows':[]};var _0x1acadb=_['map'](db[_0xa7b0('0x36')][_0xa7b0('0x37')],function(_0x5c8b0f){return{'name':_0x5c8b0f[_0xa7b0('0x38')],'type':_0x5c8b0f[_0xa7b0('0x39')][_0xa7b0('0x3a')]};});_0x33f8c3[_0xa7b0('0x3b')]=_[_0xa7b0('0x3c')](_0x1acadb,'name');_0x33f8c3[_0xa7b0('0x3d')]=_[_0xa7b0('0x3e')](_0x543e2d['query']);_0x33f8c3[_0xa7b0('0x3f')]=_[_0xa7b0('0x40')](_0x33f8c3[_0xa7b0('0x3b')],_0x33f8c3[_0xa7b0('0x3d')]);_0x21fe2d[_0xa7b0('0x41')]=_['intersection'](_0x33f8c3[_0xa7b0('0x3b')],qs[_0xa7b0('0x42')](_0x543e2d[_0xa7b0('0x3d')]['fields']));_0x21fe2d[_0xa7b0('0x41')]=_0x21fe2d['attributes'][_0xa7b0('0x43')]?_0x21fe2d['attributes']:_0x33f8c3[_0xa7b0('0x3b')];if(!_0x543e2d[_0xa7b0('0x3d')]['hasOwnProperty'](_0xa7b0('0x44'))){_0x21fe2d[_0xa7b0('0x2c')]=qs[_0xa7b0('0x2c')](_0x543e2d[_0xa7b0('0x3d')][_0xa7b0('0x2c')]);_0x21fe2d[_0xa7b0('0x2b')]=qs['offset'](_0x543e2d[_0xa7b0('0x3d')][_0xa7b0('0x2b')]);}_0x21fe2d['order']=qs[_0xa7b0('0x45')](_0x543e2d[_0xa7b0('0x3d')][_0xa7b0('0x45')]);_0x21fe2d['where']=qs[_0xa7b0('0x3f')](_[_0xa7b0('0x46')](_0x543e2d[_0xa7b0('0x3d')],_0x33f8c3['filters']),_0x1acadb);if(_0x543e2d[_0xa7b0('0x3d')]['filter']){_0x21fe2d[_0xa7b0('0x47')]=_[_0xa7b0('0x48')](_0x21fe2d[_0xa7b0('0x47')],{'$or':_[_0xa7b0('0x3c')](_0x1acadb,function(_0xaa451e){if(_0xaa451e[_0xa7b0('0x39')]!=='VIRTUAL'){var _0x3b94f6={};_0x3b94f6[_0xaa451e[_0xa7b0('0x34')]]={'$like':'%'+_0x543e2d[_0xa7b0('0x3d')][_0xa7b0('0x49')]+'%'};return _0x3b94f6;}})});}_0x21fe2d=_[_0xa7b0('0x48')]({},_0x21fe2d,_0x543e2d[_0xa7b0('0x4a')]);var _0x20c540={'where':_0x21fe2d['where']};return db[_0xa7b0('0x36')][_0xa7b0('0x2a')](_0x20c540)['then'](function(_0x5766e8){_0x3365aa[_0xa7b0('0x2a')]=_0x5766e8;if(_0x543e2d[_0xa7b0('0x3d')][_0xa7b0('0x4b')]){_0x21fe2d[_0xa7b0('0x4c')]=[{'all':!![]}];}return db[_0xa7b0('0x36')][_0xa7b0('0x4d')](_0x21fe2d);})[_0xa7b0('0x32')](function(_0x113c50){_0x3365aa[_0xa7b0('0x4e')]=_0x113c50;return _0x3365aa;})[_0xa7b0('0x32')](respondWithFilteredResult(_0x21feb0,_0x21fe2d))[_0xa7b0('0x26')](handleError(_0x21feb0,null));};exports[_0xa7b0('0x4f')]=function(_0x2fa0d6,_0x1a0131){var _0x3f5064={'raw':![],'where':{'id':_0x2fa0d6[_0xa7b0('0x50')]['id']}},_0x1131dd={};_0x1131dd['model']=_['keys'](db[_0xa7b0('0x36')][_0xa7b0('0x37')]);_0x1131dd['query']=_[_0xa7b0('0x3e')](_0x2fa0d6[_0xa7b0('0x3d')]);_0x1131dd[_0xa7b0('0x3f')]=_[_0xa7b0('0x40')](_0x1131dd[_0xa7b0('0x3b')],_0x1131dd[_0xa7b0('0x3d')]);_0x3f5064[_0xa7b0('0x41')]=_[_0xa7b0('0x40')](_0x1131dd['model'],qs[_0xa7b0('0x42')](_0x2fa0d6[_0xa7b0('0x3d')][_0xa7b0('0x42')]));_0x3f5064[_0xa7b0('0x41')]=_0x3f5064['attributes']['length']?_0x3f5064[_0xa7b0('0x41')]:_0x1131dd[_0xa7b0('0x3b')];if(_0x2fa0d6[_0xa7b0('0x3d')]['includeAll']){_0x3f5064[_0xa7b0('0x4c')]=[{'all':!![]}];}_0x3f5064=_[_0xa7b0('0x48')]({},_0x3f5064,_0x2fa0d6[_0xa7b0('0x4a')]);return db['VtigerAccount'][_0xa7b0('0x51')](_0x3f5064)[_0xa7b0('0x32')](handleEntityNotFound(_0x1a0131,null))[_0xa7b0('0x32')](respondWithResult(_0x1a0131,null))[_0xa7b0('0x26')](handleError(_0x1a0131,null));};exports[_0xa7b0('0x52')]=function(_0x507270,_0x5121a3){return db[_0xa7b0('0x36')][_0xa7b0('0x52')](_0x507270[_0xa7b0('0x53')],{})[_0xa7b0('0x32')](respondWithResult(_0x5121a3,0xc9))[_0xa7b0('0x26')](handleError(_0x5121a3,null));};exports[_0xa7b0('0x31')]=function(_0x182fb6,_0x3ca1a9){if(_0x182fb6[_0xa7b0('0x53')]['id']){delete _0x182fb6[_0xa7b0('0x53')]['id'];}return db[_0xa7b0('0x36')][_0xa7b0('0x51')]({'where':{'id':_0x182fb6['params']['id']}})['then'](handleEntityNotFound(_0x3ca1a9,null))[_0xa7b0('0x32')](saveUpdates(_0x182fb6[_0xa7b0('0x53')],null))[_0xa7b0('0x32')](respondWithResult(_0x3ca1a9,null))[_0xa7b0('0x26')](handleError(_0x3ca1a9,null));};exports[_0xa7b0('0x33')]=function(_0x4223e4,_0x3c944e){return db[_0xa7b0('0x36')]['find']({'where':{'id':_0x4223e4[_0xa7b0('0x50')]['id']}})[_0xa7b0('0x32')](handleEntityNotFound(_0x3c944e,null))['then'](removeEntity(_0x3c944e,null))['catch'](handleError(_0x3c944e,null));};exports[_0xa7b0('0x54')]=function(_0x28e8da,_0x16692a,_0x131bf4){var _0x28cf3e={};var _0x112a20={};var _0x494dad;var _0x2241f5;return db[_0xa7b0('0x36')][_0xa7b0('0x55')]({'where':{'id':_0x28e8da['params']['id']}})['then'](handleEntityNotFound(_0x16692a,null))[_0xa7b0('0x32')](function(_0x3d5ceb){if(_0x3d5ceb){_0x494dad=_0x3d5ceb;_0x112a20[_0xa7b0('0x3b')]=_[_0xa7b0('0x3e')](db['VtigerConfiguration']['rawAttributes']);_0x112a20[_0xa7b0('0x3d')]=_['keys'](_0x28e8da['query']);_0x112a20[_0xa7b0('0x3f')]=_['intersection'](_0x112a20[_0xa7b0('0x3b')],_0x112a20[_0xa7b0('0x3d')]);_0x28cf3e[_0xa7b0('0x41')]=_[_0xa7b0('0x40')](_0x112a20[_0xa7b0('0x3b')],qs[_0xa7b0('0x42')](_0x28e8da['query']['fields']));_0x28cf3e['attributes']=_0x28cf3e['attributes'][_0xa7b0('0x43')]?_0x28cf3e['attributes']:_0x112a20['model'];_0x28cf3e[_0xa7b0('0x56')]=qs[_0xa7b0('0x45')](_0x28e8da[_0xa7b0('0x3d')][_0xa7b0('0x45')]);_0x28cf3e[_0xa7b0('0x47')]=qs[_0xa7b0('0x3f')](_[_0xa7b0('0x46')](_0x28e8da[_0xa7b0('0x3d')],_0x112a20[_0xa7b0('0x3f')]));if(_0x28e8da[_0xa7b0('0x3d')][_0xa7b0('0x49')]){_0x28cf3e[_0xa7b0('0x47')]=_['merge'](_0x28cf3e[_0xa7b0('0x47')],{'$or':_['map'](_0x28cf3e[_0xa7b0('0x41')],function(_0x3accc3){var _0x51dd35={};_0x51dd35[_0x3accc3]={'$like':'%'+_0x28e8da['query'][_0xa7b0('0x49')]+'%'};return _0x51dd35;})});}_0x28cf3e=_[_0xa7b0('0x48')]({},_0x28cf3e,_0x28e8da[_0xa7b0('0x4a')]);return _0x494dad[_0xa7b0('0x54')](_0x28cf3e);}})[_0xa7b0('0x32')](function(_0x31279f){if(_0x31279f){_0x2241f5=_0x31279f[_0xa7b0('0x43')];if(!_0x28e8da['query'][_0xa7b0('0x57')](_0xa7b0('0x44'))){_0x28cf3e[_0xa7b0('0x2c')]=qs[_0xa7b0('0x2c')](_0x28e8da[_0xa7b0('0x3d')][_0xa7b0('0x2c')]);_0x28cf3e[_0xa7b0('0x2b')]=qs['offset'](_0x28e8da['query']['offset']);}return _0x494dad[_0xa7b0('0x54')](_0x28cf3e);}})[_0xa7b0('0x32')](function(_0x358494){if(_0x358494){return _0x358494?{'count':_0x2241f5,'rows':_0x358494}:null;}})[_0xa7b0('0x32')](respondWithResult(_0x16692a,null))[_0xa7b0('0x26')](handleError(_0x16692a,null));};exports[_0xa7b0('0x58')]=function(_0x72a7ad,_0x326f0a,_0x414eb6){if(_0x72a7ad[_0xa7b0('0x53')]['id']){delete _0x72a7ad[_0xa7b0('0x53')]['id'];}return db[_0xa7b0('0x36')][_0xa7b0('0x55')]({'where':{'id':_0x72a7ad[_0xa7b0('0x50')]['id']}})[_0xa7b0('0x32')](handleEntityNotFound(_0x326f0a,null))[_0xa7b0('0x32')](function(_0x4e8ac6){if(_0x4e8ac6){_0x72a7ad[_0xa7b0('0x53')][_0xa7b0('0x59')]=_0x4e8ac6['id'];_0x72a7ad[_0xa7b0('0x53')]['Subjects']=integrations[_0xa7b0('0x5a')](_0x72a7ad[_0xa7b0('0x53')][_0xa7b0('0x5b')],_0x72a7ad[_0xa7b0('0x53')][_0xa7b0('0x39')]);_0x72a7ad[_0xa7b0('0x53')]['Descriptions']=integrations['getDescriptions'](_0x72a7ad['body'][_0xa7b0('0x5b')],_0x72a7ad[_0xa7b0('0x53')][_0xa7b0('0x39')]);return db[_0xa7b0('0x5c')][_0xa7b0('0x52')](_0x72a7ad[_0xa7b0('0x53')],{'include':[{'model':db[_0xa7b0('0x5d')],'as':_0xa7b0('0x5e')},{'model':db[_0xa7b0('0x5d')],'as':_0xa7b0('0x5f')}]});}return null;})['then'](respondWithResult(_0x326f0a,null))['catch'](handleError(_0x326f0a,null));};var md5=require(_0xa7b0('0x60'));exports['getFields']=function(_0x20ca84,_0xa73488,_0xaef803){var _0x2f09b7=null;var _0x970c87=null;var _0x4264bf=null;var _0x3caf0d=null;var _0x14f143='';return db[_0xa7b0('0x36')][_0xa7b0('0x55')]({'where':{'id':_0x20ca84[_0xa7b0('0x50')]['id']},'attributes':['id',_0xa7b0('0x34'),_0xa7b0('0x61'),_0xa7b0('0x62'),'moduleName',_0xa7b0('0x63'),_0xa7b0('0x64'),_0xa7b0('0x65')]})[_0xa7b0('0x32')](handleEntityNotFound(_0xa73488,null))['then'](function(_0x264afd){if(_0x264afd){_0x2f09b7=_0x264afd[_0xa7b0('0x61')];_0x970c87=_0x264afd[_0xa7b0('0x65')];_0x4264bf=_0x264afd[_0xa7b0('0x66')];_0x14f143=_0x264afd[_0xa7b0('0x63')];var _0x2eaae6=_0x14f143[_0xa7b0('0x67')](-0x1);if(_0x2eaae6==='/'){_0x14f143=_0x14f143['substring'](0x0,_0x14f143[_0xa7b0('0x68')](_0x2eaae6));}_0x3caf0d=util[_0xa7b0('0x69')](_0xa7b0('0x6a'),_0x14f143);var _0x41d562={'method':_0xa7b0('0x6b'),'uri':_0x3caf0d,'qs':{'operation':_0xa7b0('0x6c'),'username':_0x264afd[_0xa7b0('0x61')]},'json':!![]};return rp(_0x41d562);}})[_0xa7b0('0x32')](function(_0x57588e){if(_0x57588e['success']){var _0x4dc2af={'method':_0xa7b0('0x6d'),'uri':_0x3caf0d,'form':{'operation':'login','username':_0x2f09b7,'accessKey':md5(_0x57588e[_0xa7b0('0x25')][_0xa7b0('0x6e')]+_0x970c87)},'json':!![]};return rp(_0x4dc2af);}})[_0xa7b0('0x32')](function(_0x54ebfa){if(_0x54ebfa[_0xa7b0('0x6f')]){var _0x17900f={'method':_0xa7b0('0x6b'),'uri':_0x3caf0d,'qs':{'operation':'describe','username':_0x2f09b7,'sessionName':_0x54ebfa[_0xa7b0('0x25')][_0xa7b0('0x70')],'elementType':_0x4264bf},'json':!![]};return rp(_0x17900f);}})[_0xa7b0('0x32')](function(_0x3a7ab2){if(_0x3a7ab2['success']){var _0x50a185=['autogenerated',_0xa7b0('0x71'),_0xa7b0('0x72')];_['remove'](_0x3a7ab2[_0xa7b0('0x25')][_0xa7b0('0x42')],function(_0x16dcb2){return _0x50a185[_0xa7b0('0x73')](_0x16dcb2[_0xa7b0('0x39')][_0xa7b0('0x34')]);});_[_0xa7b0('0x74')](_0x3a7ab2['result'][_0xa7b0('0x42')],function(_0x5a26ae){return _0x5a26ae[_0xa7b0('0x75')]===_0xa7b0('0x76');});return{'count':_0x3a7ab2['result'][_0xa7b0('0x42')][_0xa7b0('0x43')],'rows':_[_0xa7b0('0x3c')](_0x3a7ab2['result']['fields'],function(_0x66f2f5){return{'id':_0x66f2f5['name'],'name':_0x66f2f5[_0xa7b0('0x77')],'custom':_['startsWith'](_0x66f2f5[_0xa7b0('0x34')],_0xa7b0('0x78'))?!![]:![],'options':_0x66f2f5['type'][_0xa7b0('0x34')]===_0xa7b0('0x79')&&_0x66f2f5[_0xa7b0('0x39')][_0xa7b0('0x7a')]['length']>0x0?_[_0xa7b0('0x3c')](_0x66f2f5[_0xa7b0('0x39')][_0xa7b0('0x7a')],function(_0x5b8dd9){return{'name':_0x5b8dd9[_0xa7b0('0x77')],'value':_0x5b8dd9[_0xa7b0('0x7b')]};}):[]};})};}})['then'](respondWithResult(_0xa73488,null))[_0xa7b0('0x26')](function(_0x3933f2){console[_0xa7b0('0x7c')]('vTiger\x20error:\x20'+_0x3933f2);var _0x569814=_0x20ca84[_0xa7b0('0x3d')][_0xa7b0('0x18')]?0x1f4:_0x3933f2[_0xa7b0('0x7d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x569814,JSON['stringify'](_0x3933f2));delete _0x3933f2[_0xa7b0('0x34')];if(_0x569814===0x191){_0x569814=0x190;}_0xa73488['status'](_0x569814)[_0xa7b0('0x35')](_0x20ca84[_0xa7b0('0x3d')][_0xa7b0('0x18')]?{'message':_0xa7b0('0x7e'),'statusCode':_0x3933f2[_0xa7b0('0x7d')]}:_0x3933f2);});}; \ No newline at end of file +var _0x9ff5=['to-csv','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','offset','limit','set','json','apply','reject','save','destroy','send','VtigerAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','include','findAll','rows','show','params','fields','length','includeAll','find','create','update','body','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','username','description','moduleName','remoteUri','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','token','success','describe','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9ff5,0x74));var _0x59ff=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x9ff5[_0x30c649];return _0x3edfb9;};'use strict';var pdf=require(_0x59ff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x59ff('0x1'));var zipdir=require(_0x59ff('0x2'));var jsonpatch=require(_0x59ff('0x3'));var rp=require(_0x59ff('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x59ff('0x5'));var util=require(_0x59ff('0x6'));var path=require('path');var sox=require(_0x59ff('0x7'));var csv=require(_0x59ff('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x59ff('0x9'));var crypto=require('crypto');var jsforce=require(_0x59ff('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x59ff('0xb'));var Redis=require(_0x59ff('0xc'));var authService=require(_0x59ff('0xd'));var qs=require(_0x59ff('0xe'));var as=require(_0x59ff('0xf'));var hardwareService=require(_0x59ff('0x10'));var logger=require('../../config/logger')(_0x59ff('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x59ff('0x12'))['db'];var integrations=require(_0x59ff('0x13'));var jayson=require(_0x59ff('0x14'));var client=jayson[_0x59ff('0x15')][_0x59ff('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3734e0,_0xb179a5,_0xe1380e){if(_0xe1380e){var _0x4d8db4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d8db4[_0x59ff('0x17')](_0xb179a5)){return _0x3734e0;}else{throw new db[(_0x59ff('0x18'))][(_0x59ff('0x19'))](_0x59ff('0x1a'));}}else{return _0x3734e0;}}function respondWithRpcPromise(_0x53b847,_0x398263,_0x59e88a,_0x1afaf6){return new BPromise(function(_0x2288ac,_0x3f6d55){var _0x3fbf1e=_0x1afaf6||client;return _0x3fbf1e[_0x59ff('0x1b')](_0x53b847,_0x59e88a)[_0x59ff('0x1c')](function(_0xaa9d1c){logger['info'](_0x59ff('0x1d'),_0x398263,_0x59ff('0x1e'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x398263,_0x59ff('0x1e'),JSON[_0x59ff('0x1f')](_0xaa9d1c));if(_0xaa9d1c[_0x59ff('0x20')]){if(_0xaa9d1c[_0x59ff('0x20')][_0x59ff('0x21')]===0x1f4){logger[_0x59ff('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x398263,_0xaa9d1c['error'][_0x59ff('0x22')]);return _0x3f6d55(_0xaa9d1c['error'][_0x59ff('0x22')]);}logger[_0x59ff('0x20')](_0x59ff('0x1d'),_0x398263,_0xaa9d1c[_0x59ff('0x20')][_0x59ff('0x22')]);return _0x2288ac(_0xaa9d1c[_0x59ff('0x20')][_0x59ff('0x22')]);}else{logger[_0x59ff('0x23')](_0x59ff('0x1d'),_0x398263,'request\x20sent');_0x2288ac(_0xaa9d1c[_0x59ff('0x24')][_0x59ff('0x22')]);}})[_0x59ff('0x25')](function(_0x4c7b37){logger[_0x59ff('0x20')](_0x59ff('0x1d'),_0x398263,_0x4c7b37);_0x3f6d55(_0x4c7b37);});});}function respondWithStatusCode(_0x2f8d1c,_0x55d09d){_0x55d09d=_0x55d09d||0xcc;return function(_0x2512dc){if(_0x2512dc){return _0x2f8d1c[_0x59ff('0x26')](_0x55d09d);}return _0x2f8d1c[_0x59ff('0x27')](_0x55d09d)['end']();};}function respondWithResult(_0x1e6fbb,_0x209c0d){_0x209c0d=_0x209c0d||0xc8;return function(_0x1fde06){if(_0x1fde06){return _0x1e6fbb[_0x59ff('0x27')](_0x209c0d)['json'](_0x1fde06);}};}function respondWithFilteredResult(_0x2050f5,_0x4202ae){return function(_0x3fdcc6){if(_0x3fdcc6){var _0x1ba1bd=_0x3fdcc6['count'],_0xa20713=_0x4202ae[_0x59ff('0x28')],_0x24c4c9=_0x4202ae[_0x59ff('0x28')]+_0x4202ae[_0x59ff('0x29')],_0x253ef3;if(_0x24c4c9>=_0x1ba1bd){_0x24c4c9=_0x1ba1bd;_0x253ef3=0xc8;}else{_0x253ef3=0xce;}_0x2050f5['status'](_0x253ef3);return _0x2050f5[_0x59ff('0x2a')]('Content-Range',_0xa20713+'-'+_0x24c4c9+'/'+_0x1ba1bd)[_0x59ff('0x2b')](_0x3fdcc6);}return null;};}function patchUpdates(_0x433561){return function(_0x205c83){try{jsonpatch[_0x59ff('0x2c')](_0x205c83,_0x433561,!![]);}catch(_0x464861){return BPromise[_0x59ff('0x2d')](_0x464861);}return _0x205c83[_0x59ff('0x2e')]();};}function saveUpdates(_0x9e9e30,_0x61417a){return function(_0x165508){if(_0x165508){return _0x165508['update'](_0x9e9e30)[_0x59ff('0x1c')](function(_0x51d978){return _0x51d978;});}return null;};}function removeEntity(_0x45220c,_0x594aeb){return function(_0x4b1b24){if(_0x4b1b24){return _0x4b1b24[_0x59ff('0x2f')]()[_0x59ff('0x1c')](function(){_0x45220c[_0x59ff('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a1c89,_0x247efd){return function(_0x43d151){if(!_0x43d151){_0x8a1c89[_0x59ff('0x26')](0x194);}return _0x43d151;};}function handleError(_0x31b12f,_0x140278){_0x140278=_0x140278||0x1f4;return function(_0x427689){logger[_0x59ff('0x20')](_0x427689['stack']);if(_0x427689['name']){delete _0x427689['name'];}_0x31b12f[_0x59ff('0x27')](_0x140278)[_0x59ff('0x30')](_0x427689);};}exports['index']=function(_0x2ac165,_0x4b5c01){var _0x2241d6={},_0x3ecc1b={},_0x1a21ad={'count':0x0,'rows':[]};var _0x56f3cd=_['map'](db[_0x59ff('0x31')][_0x59ff('0x32')],function(_0x4ce1a7){return{'name':_0x4ce1a7[_0x59ff('0x33')],'type':_0x4ce1a7[_0x59ff('0x34')]['key']};});_0x3ecc1b[_0x59ff('0x35')]=_['map'](_0x56f3cd,_0x59ff('0x36'));_0x3ecc1b[_0x59ff('0x37')]=_[_0x59ff('0x38')](_0x2ac165['query']);_0x3ecc1b[_0x59ff('0x39')]=_[_0x59ff('0x3a')](_0x3ecc1b[_0x59ff('0x35')],_0x3ecc1b[_0x59ff('0x37')]);_0x2241d6[_0x59ff('0x3b')]=_['intersection'](_0x3ecc1b['model'],qs['fields'](_0x2ac165[_0x59ff('0x37')]['fields']));_0x2241d6[_0x59ff('0x3b')]=_0x2241d6[_0x59ff('0x3b')]['length']?_0x2241d6[_0x59ff('0x3b')]:_0x3ecc1b[_0x59ff('0x35')];if(!_0x2ac165[_0x59ff('0x37')]['hasOwnProperty'](_0x59ff('0x3c'))){_0x2241d6[_0x59ff('0x29')]=qs['limit'](_0x2ac165[_0x59ff('0x37')][_0x59ff('0x29')]);_0x2241d6[_0x59ff('0x28')]=qs[_0x59ff('0x28')](_0x2ac165[_0x59ff('0x37')][_0x59ff('0x28')]);}_0x2241d6[_0x59ff('0x3d')]=qs[_0x59ff('0x3e')](_0x2ac165['query']['sort']);_0x2241d6[_0x59ff('0x3f')]=qs[_0x59ff('0x39')](_[_0x59ff('0x40')](_0x2ac165[_0x59ff('0x37')],_0x3ecc1b[_0x59ff('0x39')]),_0x56f3cd);if(_0x2ac165[_0x59ff('0x37')][_0x59ff('0x41')]){_0x2241d6[_0x59ff('0x3f')]=_[_0x59ff('0x42')](_0x2241d6['where'],{'$or':_[_0x59ff('0x43')](_0x56f3cd,function(_0x119bed){if(_0x119bed['type']!==_0x59ff('0x44')){var _0x1362ab={};_0x1362ab[_0x119bed[_0x59ff('0x36')]]={'$like':'%'+_0x2ac165[_0x59ff('0x37')][_0x59ff('0x41')]+'%'};return _0x1362ab;}})});}_0x2241d6=_[_0x59ff('0x42')]({},_0x2241d6,_0x2ac165[_0x59ff('0x45')]);var _0x16305f={'where':_0x2241d6['where']};return db['VtigerAccount'][_0x59ff('0x46')](_0x16305f)[_0x59ff('0x1c')](function(_0x2bcbbd){_0x1a21ad[_0x59ff('0x46')]=_0x2bcbbd;if(_0x2ac165[_0x59ff('0x37')]['includeAll']){_0x2241d6[_0x59ff('0x47')]=[{'all':!![]}];}return db['VtigerAccount'][_0x59ff('0x48')](_0x2241d6);})[_0x59ff('0x1c')](function(_0x159f73){_0x1a21ad[_0x59ff('0x49')]=_0x159f73;return _0x1a21ad;})[_0x59ff('0x1c')](respondWithFilteredResult(_0x4b5c01,_0x2241d6))[_0x59ff('0x25')](handleError(_0x4b5c01,null));};exports[_0x59ff('0x4a')]=function(_0x13fcaf,_0x1eac6d){var _0x2df971={'raw':![],'where':{'id':_0x13fcaf[_0x59ff('0x4b')]['id']}},_0x2c1b3b={};_0x2c1b3b['model']=_[_0x59ff('0x38')](db[_0x59ff('0x31')][_0x59ff('0x32')]);_0x2c1b3b[_0x59ff('0x37')]=_[_0x59ff('0x38')](_0x13fcaf[_0x59ff('0x37')]);_0x2c1b3b[_0x59ff('0x39')]=_['intersection'](_0x2c1b3b[_0x59ff('0x35')],_0x2c1b3b['query']);_0x2df971[_0x59ff('0x3b')]=_['intersection'](_0x2c1b3b['model'],qs[_0x59ff('0x4c')](_0x13fcaf['query'][_0x59ff('0x4c')]));_0x2df971[_0x59ff('0x3b')]=_0x2df971['attributes'][_0x59ff('0x4d')]?_0x2df971['attributes']:_0x2c1b3b[_0x59ff('0x35')];if(_0x13fcaf[_0x59ff('0x37')][_0x59ff('0x4e')]){_0x2df971[_0x59ff('0x47')]=[{'all':!![]}];}_0x2df971=_[_0x59ff('0x42')]({},_0x2df971,_0x13fcaf[_0x59ff('0x45')]);return db[_0x59ff('0x31')][_0x59ff('0x4f')](_0x2df971)[_0x59ff('0x1c')](handleEntityNotFound(_0x1eac6d,null))[_0x59ff('0x1c')](respondWithResult(_0x1eac6d,null))['catch'](handleError(_0x1eac6d,null));};exports['create']=function(_0x2e415d,_0x386709){return db[_0x59ff('0x31')][_0x59ff('0x50')](_0x2e415d['body'],{})['then'](respondWithResult(_0x386709,0xc9))[_0x59ff('0x25')](handleError(_0x386709,null));};exports[_0x59ff('0x51')]=function(_0xb4def0,_0x29871e){if(_0xb4def0[_0x59ff('0x52')]['id']){delete _0xb4def0[_0x59ff('0x52')]['id'];}return db[_0x59ff('0x31')][_0x59ff('0x4f')]({'where':{'id':_0xb4def0[_0x59ff('0x4b')]['id']}})[_0x59ff('0x1c')](handleEntityNotFound(_0x29871e,null))[_0x59ff('0x1c')](saveUpdates(_0xb4def0[_0x59ff('0x52')],null))[_0x59ff('0x1c')](respondWithResult(_0x29871e,null))[_0x59ff('0x25')](handleError(_0x29871e,null));};exports[_0x59ff('0x2f')]=function(_0x4b6045,_0x1b1f0a){return db[_0x59ff('0x31')][_0x59ff('0x4f')]({'where':{'id':_0x4b6045['params']['id']}})[_0x59ff('0x1c')](handleEntityNotFound(_0x1b1f0a,null))[_0x59ff('0x1c')](removeEntity(_0x1b1f0a,null))[_0x59ff('0x25')](handleError(_0x1b1f0a,null));};exports[_0x59ff('0x53')]=function(_0x4df759,_0x3dfcd3,_0xb50d45){var _0x21f62b={};var _0x47a538={};var _0x2b64af;var _0x399a11;return db[_0x59ff('0x31')]['findOne']({'where':{'id':_0x4df759[_0x59ff('0x4b')]['id']}})[_0x59ff('0x1c')](handleEntityNotFound(_0x3dfcd3,null))[_0x59ff('0x1c')](function(_0x2d5969){if(_0x2d5969){_0x2b64af=_0x2d5969;_0x47a538['model']=_[_0x59ff('0x38')](db[_0x59ff('0x54')][_0x59ff('0x32')]);_0x47a538[_0x59ff('0x37')]=_['keys'](_0x4df759[_0x59ff('0x37')]);_0x47a538[_0x59ff('0x39')]=_[_0x59ff('0x3a')](_0x47a538[_0x59ff('0x35')],_0x47a538[_0x59ff('0x37')]);_0x21f62b[_0x59ff('0x3b')]=_[_0x59ff('0x3a')](_0x47a538[_0x59ff('0x35')],qs[_0x59ff('0x4c')](_0x4df759[_0x59ff('0x37')][_0x59ff('0x4c')]));_0x21f62b[_0x59ff('0x3b')]=_0x21f62b[_0x59ff('0x3b')][_0x59ff('0x4d')]?_0x21f62b[_0x59ff('0x3b')]:_0x47a538['model'];_0x21f62b[_0x59ff('0x3d')]=qs[_0x59ff('0x3e')](_0x4df759[_0x59ff('0x37')]['sort']);_0x21f62b['where']=qs[_0x59ff('0x39')](_[_0x59ff('0x40')](_0x4df759[_0x59ff('0x37')],_0x47a538[_0x59ff('0x39')]));if(_0x4df759[_0x59ff('0x37')][_0x59ff('0x41')]){_0x21f62b[_0x59ff('0x3f')]=_['merge'](_0x21f62b['where'],{'$or':_[_0x59ff('0x43')](_0x21f62b[_0x59ff('0x3b')],function(_0x1225d3){var _0x417aff={};_0x417aff[_0x1225d3]={'$like':'%'+_0x4df759[_0x59ff('0x37')]['filter']+'%'};return _0x417aff;})});}_0x21f62b=_[_0x59ff('0x42')]({},_0x21f62b,_0x4df759['options']);return _0x2b64af[_0x59ff('0x53')](_0x21f62b);}})['then'](function(_0xc36e17){if(_0xc36e17){_0x399a11=_0xc36e17[_0x59ff('0x4d')];if(!_0x4df759['query']['hasOwnProperty'](_0x59ff('0x3c'))){_0x21f62b[_0x59ff('0x29')]=qs['limit'](_0x4df759[_0x59ff('0x37')][_0x59ff('0x29')]);_0x21f62b[_0x59ff('0x28')]=qs[_0x59ff('0x28')](_0x4df759['query'][_0x59ff('0x28')]);}return _0x2b64af[_0x59ff('0x53')](_0x21f62b);}})[_0x59ff('0x1c')](function(_0x4d1153){if(_0x4d1153){return _0x4d1153?{'count':_0x399a11,'rows':_0x4d1153}:null;}})['then'](respondWithResult(_0x3dfcd3,null))[_0x59ff('0x25')](handleError(_0x3dfcd3,null));};exports[_0x59ff('0x55')]=function(_0x48f4a4,_0x37ad74,_0x3ad5e3){if(_0x48f4a4[_0x59ff('0x52')]['id']){delete _0x48f4a4[_0x59ff('0x52')]['id'];}return db[_0x59ff('0x31')][_0x59ff('0x56')]({'where':{'id':_0x48f4a4[_0x59ff('0x4b')]['id']}})[_0x59ff('0x1c')](handleEntityNotFound(_0x37ad74,null))[_0x59ff('0x1c')](function(_0x48e658){if(_0x48e658){_0x48f4a4[_0x59ff('0x52')][_0x59ff('0x57')]=_0x48e658['id'];_0x48f4a4['body'][_0x59ff('0x58')]=integrations[_0x59ff('0x59')](_0x48f4a4[_0x59ff('0x52')][_0x59ff('0x5a')],_0x48f4a4[_0x59ff('0x52')][_0x59ff('0x34')]);_0x48f4a4[_0x59ff('0x52')]['Descriptions']=integrations[_0x59ff('0x5b')](_0x48f4a4[_0x59ff('0x52')][_0x59ff('0x5a')],_0x48f4a4['body'][_0x59ff('0x34')]);return db[_0x59ff('0x54')][_0x59ff('0x50')](_0x48f4a4[_0x59ff('0x52')],{'include':[{'model':db[_0x59ff('0x5c')],'as':_0x59ff('0x58')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x37ad74,null))[_0x59ff('0x25')](handleError(_0x37ad74,null));};var md5=require(_0x59ff('0x5d'));exports['getFields']=function(_0x2529f2,_0x28d8b9,_0x46ad84){var _0x3af5ce=null;var _0x5f409b=null;var _0x5ba5e0=null;var _0x1d506e=null;var _0x50e4ca='';return db[_0x59ff('0x31')][_0x59ff('0x56')]({'where':{'id':_0x2529f2[_0x59ff('0x4b')]['id']},'attributes':['id',_0x59ff('0x36'),_0x59ff('0x5e'),_0x59ff('0x5f'),_0x59ff('0x60'),_0x59ff('0x61'),'serverUrl','accessKey']})[_0x59ff('0x1c')](handleEntityNotFound(_0x28d8b9,null))[_0x59ff('0x1c')](function(_0x4cc507){if(_0x4cc507){_0x3af5ce=_0x4cc507['username'];_0x5f409b=_0x4cc507['accessKey'];_0x5ba5e0=_0x4cc507['moduleName'];_0x50e4ca=_0x4cc507[_0x59ff('0x61')];var _0x25525b=_0x50e4ca['slice'](-0x1);if(_0x25525b==='/'){_0x50e4ca=_0x50e4ca[_0x59ff('0x62')](0x0,_0x50e4ca[_0x59ff('0x63')](_0x25525b));}_0x1d506e=util[_0x59ff('0x64')](_0x59ff('0x65'),_0x50e4ca);var _0xbde54e={'method':_0x59ff('0x66'),'uri':_0x1d506e,'qs':{'operation':_0x59ff('0x67'),'username':_0x4cc507['username']},'json':!![]};return rp(_0xbde54e);}})['then'](function(_0x36bcee){if(_0x36bcee['success']){var _0x149c57={'method':'POST','uri':_0x1d506e,'form':{'operation':'login','username':_0x3af5ce,'accessKey':md5(_0x36bcee[_0x59ff('0x24')][_0x59ff('0x68')]+_0x5f409b)},'json':!![]};return rp(_0x149c57);}})['then'](function(_0x343104){if(_0x343104[_0x59ff('0x69')]){var _0x63e06b={'method':_0x59ff('0x66'),'uri':_0x1d506e,'qs':{'operation':_0x59ff('0x6a'),'username':_0x3af5ce,'sessionName':_0x343104[_0x59ff('0x24')]['sessionName'],'elementType':_0x5ba5e0},'json':!![]};return rp(_0x63e06b);}})[_0x59ff('0x1c')](function(_0x1fe895){if(_0x1fe895[_0x59ff('0x69')]){var _0x424d55=[_0x59ff('0x6b'),_0x59ff('0x6c'),_0x59ff('0x6d')];_[_0x59ff('0x6e')](_0x1fe895['result'][_0x59ff('0x4c')],function(_0x30e1cf){return _0x424d55[_0x59ff('0x6f')](_0x30e1cf[_0x59ff('0x34')][_0x59ff('0x36')]);});_[_0x59ff('0x6e')](_0x1fe895['result'][_0x59ff('0x4c')],function(_0x56c39f){return _0x56c39f[_0x59ff('0x70')]===_0x59ff('0x71');});return{'count':_0x1fe895[_0x59ff('0x24')][_0x59ff('0x4c')][_0x59ff('0x4d')],'rows':_[_0x59ff('0x43')](_0x1fe895[_0x59ff('0x24')]['fields'],function(_0xfaaa1d){return{'id':_0xfaaa1d[_0x59ff('0x36')],'name':_0xfaaa1d[_0x59ff('0x72')],'custom':_[_0x59ff('0x73')](_0xfaaa1d[_0x59ff('0x36')],_0x59ff('0x74'))?!![]:![],'options':_0xfaaa1d[_0x59ff('0x34')][_0x59ff('0x36')]==='picklist'&&_0xfaaa1d[_0x59ff('0x34')][_0x59ff('0x75')][_0x59ff('0x4d')]>0x0?_[_0x59ff('0x43')](_0xfaaa1d[_0x59ff('0x34')][_0x59ff('0x75')],function(_0x10e3c4){return{'name':_0x10e3c4[_0x59ff('0x72')],'value':_0x10e3c4['value']};}):[]};})};}})[_0x59ff('0x1c')](respondWithResult(_0x28d8b9,null))[_0x59ff('0x25')](function(_0x22376b){console[_0x59ff('0x76')](_0x59ff('0x77')+_0x22376b);var _0x2d9ae3=_0x2529f2[_0x59ff('0x37')][_0x59ff('0x17')]?0x1f4:_0x22376b[_0x59ff('0x78')]||0x1f4;logger[_0x59ff('0x20')](_0x59ff('0x79'),_0x59ff('0x7a'),_0x2d9ae3,JSON[_0x59ff('0x1f')](_0x22376b));delete _0x22376b['name'];if(_0x2d9ae3===0x191){_0x2d9ae3=0x190;}_0x28d8b9[_0x59ff('0x27')](_0x2d9ae3)[_0x59ff('0x30')](_0x2529f2[_0x59ff('0x37')][_0x59ff('0x17')]?{'message':_0x59ff('0x7b'),'statusCode':_0x22376b['statusCode']}:_0x22376b);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 44d3c13..5f3d444 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 _0x4424=['lodash','api','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x250dd3,_0x3490b3){var _0x3abddf=function(_0x5d1df5){while(--_0x5d1df5){_0x250dd3['push'](_0x250dd3['shift']());}};_0x3abddf(++_0x3490b3);}(_0x4424,0x16b));var _0x4442=function(_0x4040ad,_0x4fcc19){_0x4040ad=_0x4040ad-0x0;var _0x2f5d2e=_0x4424[_0x4040ad];return _0x2f5d2e;};'use strict';var _=require(_0x4442('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4442('0x1'));var moment=require(_0x4442('0x2'));var BPromise=require(_0x4442('0x3'));var rp=require(_0x4442('0x4'));var fs=require('fs');var path=require(_0x4442('0x5'));var rimraf=require(_0x4442('0x6'));var config=require('../../config/environment');var attributes=require(_0x4442('0x7'));var integrations=require(_0x4442('0x8'));module[_0x4442('0x9')]=function(_0x473178,_0x26b559){return _0x473178[_0x4442('0xa')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e0e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0xec9553,_0x4a9a9e){var _0x4f395c=function(_0x3493a6){while(--_0x3493a6){_0xec9553['push'](_0xec9553['shift']());}};_0x4f395c(++_0x4a9a9e);}(_0x8e0e,0x176));var _0xe8e0=function(_0x4b77c1,_0x4c8fdc){_0x4b77c1=_0x4b77c1-0x0;var _0x2a54e6=_0x8e0e[_0x4b77c1];return _0x2a54e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe8e0('0x0'))('api');var moment=require(_0xe8e0('0x1'));var BPromise=require(_0xe8e0('0x2'));var rp=require(_0xe8e0('0x3'));var fs=require('fs');var path=require(_0xe8e0('0x4'));var rimraf=require(_0xe8e0('0x5'));var config=require(_0xe8e0('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xe8e0('0x7'));module[_0xe8e0('0x8')]=function(_0x5cb6ea,_0x184ff8){return _0x5cb6ea[_0xe8e0('0x9')](_0xe8e0('0xa'),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 2626796..4032e84 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 _0x8755=['../../config/environment','jayson/promise','client','http','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfab3e1,_0x2d9028){var _0x5afd4d=function(_0x2f3ac5){while(--_0x2f3ac5){_0xfab3e1['push'](_0xfab3e1['shift']());}};_0x5afd4d(++_0x2d9028);}(_0x8755,0x13b));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5875('0x0'));var util=require(_0x5875('0x1'));var moment=require(_0x5875('0x2'));var BPromise=require(_0x5875('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5875('0x4'));var db=require(_0x5875('0x5'))['db'];var utils=require(_0x5875('0x6'));var logger=require(_0x5875('0x7'))(_0x5875('0x8'));var config=require(_0x5875('0x9'));var jayson=require(_0x5875('0xa'));var client=jayson[_0x5875('0xb')][_0x5875('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cafd6,_0xfc0489,_0x5c60a9){return new BPromise(function(_0xbd6498,_0x282696){return client['request'](_0x5cafd6,_0x5c60a9)['then'](function(_0x531486){logger['info'](_0x5875('0xd'),_0xfc0489,'request\x20sent');logger[_0x5875('0xe')](_0x5875('0xf'),_0xfc0489,_0x5875('0x10'),JSON['stringify'](_0x531486));if(_0x531486['error']){if(_0x531486[_0x5875('0x11')][_0x5875('0x12')]===0x1f4){logger[_0x5875('0x11')](_0x5875('0xd'),_0xfc0489,_0x531486[_0x5875('0x11')][_0x5875('0x13')]);return _0x282696(_0x531486[_0x5875('0x11')][_0x5875('0x13')]);}logger[_0x5875('0x11')]('VtigerAccount,\x20%s,\x20%s',_0xfc0489,_0x531486[_0x5875('0x11')][_0x5875('0x13')]);return _0xbd6498(_0x531486[_0x5875('0x11')]['message']);}else{logger[_0x5875('0x14')](_0x5875('0xd'),_0xfc0489,_0x5875('0x10'));_0xbd6498(_0x531486['result'][_0x5875('0x13')]);}})[_0x5875('0x15')](function(_0xf7a140){logger[_0x5875('0x11')](_0x5875('0xd'),_0xfc0489,_0xf7a140);_0x282696(_0xf7a140);});});}exports[_0x5875('0x16')]=function(_0x3bb45a){var _0x5b843c=this;return new Promise(function(_0x180735,_0x415ad5){return db[_0x5875('0x17')][_0x5875('0x18')]({'raw':_0x3bb45a[_0x5875('0x19')]?_0x3bb45a['options'][_0x5875('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bb45a[_0x5875('0x19')]?_0x3bb45a[_0x5875('0x19')][_0x5875('0x1b')]||null:null,'attributes':_0x3bb45a['options']?_0x3bb45a['options'][_0x5875('0x1c')]||null:null,'limit':_0x3bb45a[_0x5875('0x19')]?_0x3bb45a[_0x5875('0x19')][_0x5875('0x1d')]||null:null,'include':_0x3bb45a['options']?_0x3bb45a['options'][_0x5875('0x1e')]?_[_0x5875('0x1f')](_0x3bb45a['options'][_0x5875('0x1e')],function(_0x284686){return{'model':db[_0x284686['model']],'as':_0x284686['as'],'attributes':_0x284686[_0x5875('0x1c')],'include':_0x284686['include']?_[_0x5875('0x1f')](_0x284686[_0x5875('0x1e')],function(_0x1c5832){return{'model':db[_0x1c5832[_0x5875('0x20')]],'as':_0x1c5832['as'],'attributes':_0x1c5832[_0x5875('0x1c')],'include':_0x1c5832[_0x5875('0x1e')]?_['map'](_0x1c5832[_0x5875('0x1e')],function(_0x2b6922){return{'model':db[_0x2b6922[_0x5875('0x20')]],'as':_0x2b6922['as'],'attributes':_0x2b6922['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ca9ba){logger[_0x5875('0x14')](_0x5875('0x16'),_0x3bb45a);logger['debug'](_0x5875('0x16'),_0x3bb45a,JSON[_0x5875('0x21')](_0x1ca9ba));_0x180735(_0x1ca9ba);})['catch'](function(_0x136404){logger['error']('GetVtigerAccount',_0x136404[_0x5875('0x13')],_0x3bb45a);_0x415ad5(_0x5b843c[_0x5875('0x11')](0x1f4,_0x136404['message']));});});};exports[_0x5875('0x22')]=function(_0x2c58a3){var _0x184c4c=this;return new Promise(function(_0x58d088,_0x4bc404){return db[_0x5875('0x17')][_0x5875('0x23')]({'raw':_0x2c58a3[_0x5875('0x19')]?_0x2c58a3[_0x5875('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2c58a3[_0x5875('0x19')]?_0x2c58a3[_0x5875('0x19')][_0x5875('0x1b')]||null:null,'attributes':_0x2c58a3[_0x5875('0x19')]?_0x2c58a3[_0x5875('0x19')][_0x5875('0x1c')]||null:null,'include':_0x2c58a3[_0x5875('0x19')]?_0x2c58a3[_0x5875('0x19')][_0x5875('0x1e')]?_['map'](_0x2c58a3[_0x5875('0x19')][_0x5875('0x1e')],function(_0x2647b9){return{'model':db[_0x2647b9[_0x5875('0x20')]],'as':_0x2647b9['as'],'attributes':_0x2647b9[_0x5875('0x1c')],'include':_0x2647b9['include']?_['map'](_0x2647b9[_0x5875('0x1e')],function(_0x13d655){return{'model':db[_0x13d655[_0x5875('0x20')]],'as':_0x13d655['as'],'attributes':_0x13d655[_0x5875('0x1c')],'include':_0x13d655[_0x5875('0x1e')]?_['map'](_0x13d655[_0x5875('0x1e')],function(_0x317f94){return{'model':db[_0x317f94[_0x5875('0x20')]],'as':_0x317f94['as'],'attributes':_0x317f94[_0x5875('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6492d0){logger[_0x5875('0x14')](_0x5875('0x22'),_0x2c58a3);logger[_0x5875('0xe')]('ShowVtigerAccount',_0x2c58a3,JSON['stringify'](_0x6492d0));_0x58d088(_0x6492d0);})['catch'](function(_0x1f5433){logger[_0x5875('0x11')](_0x5875('0x22'),_0x1f5433['message'],_0x2c58a3);_0x4bc404(_0x184c4c[_0x5875('0x11')](0x1f4,_0x1f5433[_0x5875('0x13')]));});});}; \ No newline at end of file +var _0x06d0=['../../config/environment','jayson/promise','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','find','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x37a766,_0x5dcc6a){var _0x54ac43=function(_0x4a56b0){while(--_0x4a56b0){_0x37a766['push'](_0x37a766['shift']());}};_0x54ac43(++_0x5dcc6a);}(_0x06d0,0x15b));var _0x006d=function(_0x44c35e,_0x25a75b){_0x44c35e=_0x44c35e-0x0;var _0x2f91eb=_0x06d0[_0x44c35e];return _0x2f91eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x006d('0x0'));var BPromise=require(_0x006d('0x1'));var rs=require(_0x006d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x006d('0x3'));var logger=require(_0x006d('0x4'))('rpc');var config=require(_0x006d('0x5'));var jayson=require(_0x006d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5899cf,_0x3db873,_0x2c816c){return new BPromise(function(_0x33a1cd,_0x3da484){return client['request'](_0x5899cf,_0x2c816c)[_0x006d('0x7')](function(_0x38f0f4){logger[_0x006d('0x8')](_0x006d('0x9'),_0x3db873,'request\x20sent');logger[_0x006d('0xa')](_0x006d('0xb'),_0x3db873,_0x006d('0xc'),JSON[_0x006d('0xd')](_0x38f0f4));if(_0x38f0f4[_0x006d('0xe')]){if(_0x38f0f4[_0x006d('0xe')][_0x006d('0xf')]===0x1f4){logger[_0x006d('0xe')](_0x006d('0x9'),_0x3db873,_0x38f0f4[_0x006d('0xe')]['message']);return _0x3da484(_0x38f0f4[_0x006d('0xe')][_0x006d('0x10')]);}logger[_0x006d('0xe')](_0x006d('0x9'),_0x3db873,_0x38f0f4[_0x006d('0xe')][_0x006d('0x10')]);return _0x33a1cd(_0x38f0f4[_0x006d('0xe')][_0x006d('0x10')]);}else{logger[_0x006d('0x8')](_0x006d('0x9'),_0x3db873,_0x006d('0xc'));_0x33a1cd(_0x38f0f4[_0x006d('0x11')][_0x006d('0x10')]);}})[_0x006d('0x12')](function(_0x197928){logger[_0x006d('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3db873,_0x197928);_0x3da484(_0x197928);});});}exports[_0x006d('0x13')]=function(_0x256a60){var _0x472959=this;return new Promise(function(_0x517bd5,_0x160bf2){return db[_0x006d('0x14')][_0x006d('0x15')]({'raw':_0x256a60[_0x006d('0x16')]?_0x256a60[_0x006d('0x16')][_0x006d('0x17')]===undefined?!![]:![]:!![],'where':_0x256a60['options']?_0x256a60[_0x006d('0x16')][_0x006d('0x18')]||null:null,'attributes':_0x256a60[_0x006d('0x16')]?_0x256a60[_0x006d('0x16')][_0x006d('0x19')]||null:null,'limit':_0x256a60['options']?_0x256a60[_0x006d('0x16')][_0x006d('0x1a')]||null:null,'include':_0x256a60['options']?_0x256a60[_0x006d('0x16')][_0x006d('0x1b')]?_['map'](_0x256a60[_0x006d('0x16')][_0x006d('0x1b')],function(_0x68f054){return{'model':db[_0x68f054['model']],'as':_0x68f054['as'],'attributes':_0x68f054['attributes'],'include':_0x68f054[_0x006d('0x1b')]?_[_0x006d('0x1c')](_0x68f054[_0x006d('0x1b')],function(_0x4d1cdb){return{'model':db[_0x4d1cdb[_0x006d('0x1d')]],'as':_0x4d1cdb['as'],'attributes':_0x4d1cdb[_0x006d('0x19')],'include':_0x4d1cdb[_0x006d('0x1b')]?_[_0x006d('0x1c')](_0x4d1cdb[_0x006d('0x1b')],function(_0x5698b1){return{'model':db[_0x5698b1[_0x006d('0x1d')]],'as':_0x5698b1['as'],'attributes':_0x5698b1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec667){logger['info']('GetVtigerAccount',_0x256a60);logger[_0x006d('0xa')](_0x006d('0x13'),_0x256a60,JSON[_0x006d('0xd')](_0x4ec667));_0x517bd5(_0x4ec667);})[_0x006d('0x12')](function(_0x435678){logger[_0x006d('0xe')]('GetVtigerAccount',_0x435678['message'],_0x256a60);_0x160bf2(_0x472959[_0x006d('0xe')](0x1f4,_0x435678[_0x006d('0x10')]));});});};exports[_0x006d('0x1e')]=function(_0xf2a6ab){var _0x3491b9=this;return new Promise(function(_0x42036f,_0x26144e){return db['VtigerAccount'][_0x006d('0x1f')]({'raw':_0xf2a6ab[_0x006d('0x16')]?_0xf2a6ab[_0x006d('0x16')][_0x006d('0x17')]===undefined?!![]:![]:!![],'where':_0xf2a6ab[_0x006d('0x16')]?_0xf2a6ab[_0x006d('0x16')][_0x006d('0x18')]||null:null,'attributes':_0xf2a6ab[_0x006d('0x16')]?_0xf2a6ab['options'][_0x006d('0x19')]||null:null,'include':_0xf2a6ab[_0x006d('0x16')]?_0xf2a6ab['options'][_0x006d('0x1b')]?_[_0x006d('0x1c')](_0xf2a6ab[_0x006d('0x16')][_0x006d('0x1b')],function(_0x87fac6){return{'model':db[_0x87fac6[_0x006d('0x1d')]],'as':_0x87fac6['as'],'attributes':_0x87fac6[_0x006d('0x19')],'include':_0x87fac6[_0x006d('0x1b')]?_[_0x006d('0x1c')](_0x87fac6[_0x006d('0x1b')],function(_0xb78b8a){return{'model':db[_0xb78b8a[_0x006d('0x1d')]],'as':_0xb78b8a['as'],'attributes':_0xb78b8a[_0x006d('0x19')],'include':_0xb78b8a[_0x006d('0x1b')]?_[_0x006d('0x1c')](_0xb78b8a[_0x006d('0x1b')],function(_0x25dda5){return{'model':db[_0x25dda5[_0x006d('0x1d')]],'as':_0x25dda5['as'],'attributes':_0x25dda5[_0x006d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x006d('0x7')](function(_0x5ac382){logger['info'](_0x006d('0x1e'),_0xf2a6ab);logger['debug'](_0x006d('0x1e'),_0xf2a6ab,JSON[_0x006d('0xd')](_0x5ac382));_0x42036f(_0x5ac382);})[_0x006d('0x12')](function(_0x1750e8){logger[_0x006d('0xe')](_0x006d('0x1e'),_0x1750e8['message'],_0xf2a6ab);_0x26144e(_0x3491b9[_0x006d('0xe')](0x1f4,_0x1750e8[_0x006d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d8363d5..d2f682c 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x53f63a,_0x41db8d){var _0x4e1b9e=function(_0x55466){while(--_0x55466){_0x53f63a['push'](_0x53f63a['shift']());}};_0x4e1b9e(++_0x41db8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d5f7a,_0x189a90){_0x3d5f7a=_0x3d5f7a-0x0;var _0xce3308=_0xb10b[_0x3d5f7a];return _0xce3308;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _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(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8f12c3c..87f58a9 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 _0xebba=['STRING'];(function(_0x4dcd77,_0x4a751b){var _0x41ec65=function(_0x15e872){while(--_0x15e872){_0x4dcd77['push'](_0x4dcd77['shift']());}};_0x41ec65(++_0x4a751b);}(_0xebba,0x187));var _0xaebb=function(_0xd96403,_0x53df02){_0xd96403=_0xd96403-0x0;var _0x4d8e18=_0xebba[_0xd96403];return _0x4d8e18;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaebb('0x0')]}}; \ No newline at end of file +var _0xa2ed=['sequelize','exports','STRING'];(function(_0x8f5608,_0x189f1d){var _0x45931b=function(_0x539215){while(--_0x539215){_0x8f5608['push'](_0x8f5608['shift']());}};_0x45931b(++_0x189f1d);}(_0xa2ed,0x1a1));var _0xda2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xda2e('0x0'));module[_0xda2e('0x1')]={'name':{'type':Sequelize[_0xda2e('0x2')]},'description':{'type':Sequelize[_0xda2e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 32f24b5..83a947f 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 _0x2f9f=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getFields','getSubjects','VtigerField','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','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','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus'];(function(_0xd3f076,_0x447fff){var _0x2ffe1f=function(_0x11f36c){while(--_0x11f36c){_0xd3f076['push'](_0xd3f076['shift']());}};_0x2ffe1f(++_0x447fff);}(_0x2f9f,0x96));var _0xf2f9=function(_0x2e8fe5,_0x2eeb3a){_0x2e8fe5=_0x2e8fe5-0x0;var _0x17dab8=_0x2f9f[_0x2e8fe5];return _0x17dab8;};'use strict';var pdf=require(_0xf2f9('0x0'));var emlformat=require(_0xf2f9('0x1'));var rimraf=require(_0xf2f9('0x2'));var zipdir=require(_0xf2f9('0x3'));var jsonpatch=require(_0xf2f9('0x4'));var rp=require('request-promise');var moment=require(_0xf2f9('0x5'));var BPromise=require(_0xf2f9('0x6'));var Mustache=require(_0xf2f9('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf2f9('0x8'));var csv=require(_0xf2f9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2f9('0xa'));var squel=require(_0xf2f9('0xb'));var crypto=require(_0xf2f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf2f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf2f9('0xe'));var Papa=require(_0xf2f9('0xf'));var Redis=require('ioredis');var authService=require(_0xf2f9('0x10'));var qs=require(_0xf2f9('0x11'));var as=require(_0xf2f9('0x12'));var hardwareService=require(_0xf2f9('0x13'));var logger=require(_0xf2f9('0x14'))(_0xf2f9('0x15'));var utils=require('../../config/utils');var config=require(_0xf2f9('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf2f9('0x17'));var client=jayson[_0xf2f9('0x18')][_0xf2f9('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4f49ad,_0x212de6,_0x18b809){if(_0x18b809){var _0x4872db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4872db[_0xf2f9('0x1a')](_0x212de6)){return _0x4f49ad;}else{throw new db[(_0xf2f9('0x1b'))][(_0xf2f9('0x1c'))](_0xf2f9('0x1d'));}}else{return _0x4f49ad;}}function respondWithRpcPromise(_0x4080ef,_0x7ee9f6,_0x28cc48,_0x1e1a86){return new BPromise(function(_0x1b298c,_0x1a2436){var _0x3ecd9f=_0x1e1a86||client;return _0x3ecd9f[_0xf2f9('0x1e')](_0x4080ef,_0x28cc48)['then'](function(_0x220d7f){logger[_0xf2f9('0x1f')](_0xf2f9('0x20'),_0x7ee9f6,_0xf2f9('0x21'));logger[_0xf2f9('0x22')](_0xf2f9('0x23'),_0x7ee9f6,'request\x20sent',JSON[_0xf2f9('0x24')](_0x220d7f));if(_0x220d7f[_0xf2f9('0x25')]){if(_0x220d7f[_0xf2f9('0x25')][_0xf2f9('0x26')]===0x1f4){logger['error'](_0xf2f9('0x20'),_0x7ee9f6,_0x220d7f[_0xf2f9('0x25')][_0xf2f9('0x27')]);return _0x1a2436(_0x220d7f['error'][_0xf2f9('0x27')]);}logger['error'](_0xf2f9('0x20'),_0x7ee9f6,_0x220d7f['error'][_0xf2f9('0x27')]);return _0x1b298c(_0x220d7f[_0xf2f9('0x25')][_0xf2f9('0x27')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x7ee9f6,_0xf2f9('0x21'));_0x1b298c(_0x220d7f[_0xf2f9('0x28')]['message']);}})['catch'](function(_0x535502){logger['error'](_0xf2f9('0x20'),_0x7ee9f6,_0x535502);_0x1a2436(_0x535502);});});}function respondWithStatusCode(_0x3bd94f,_0x182b98){_0x182b98=_0x182b98||0xcc;return function(_0x446e4d){if(_0x446e4d){return _0x3bd94f[_0xf2f9('0x29')](_0x182b98);}return _0x3bd94f[_0xf2f9('0x2a')](_0x182b98)[_0xf2f9('0x2b')]();};}function respondWithResult(_0x381fc3,_0x387eb3){_0x387eb3=_0x387eb3||0xc8;return function(_0x3a4833){if(_0x3a4833){return _0x381fc3[_0xf2f9('0x2a')](_0x387eb3)[_0xf2f9('0x2c')](_0x3a4833);}};}function respondWithFilteredResult(_0x3a276,_0x178bbd){return function(_0x5b51b7){if(_0x5b51b7){var _0x30e8d3=_0x5b51b7[_0xf2f9('0x2d')],_0x398d12=_0x178bbd[_0xf2f9('0x2e')],_0x369283=_0x178bbd['offset']+_0x178bbd[_0xf2f9('0x2f')],_0x4f7c03;if(_0x369283>=_0x30e8d3){_0x369283=_0x30e8d3;_0x4f7c03=0xc8;}else{_0x4f7c03=0xce;}_0x3a276[_0xf2f9('0x2a')](_0x4f7c03);return _0x3a276[_0xf2f9('0x30')](_0xf2f9('0x31'),_0x398d12+'-'+_0x369283+'/'+_0x30e8d3)[_0xf2f9('0x2c')](_0x5b51b7);}return null;};}function patchUpdates(_0x22c8dc){return function(_0x4a307c){try{jsonpatch[_0xf2f9('0x32')](_0x4a307c,_0x22c8dc,!![]);}catch(_0x5bdacc){return BPromise[_0xf2f9('0x33')](_0x5bdacc);}return _0x4a307c['save']();};}function saveUpdates(_0x3bbb5b,_0x38cf77){return function(_0x31a59a){if(_0x31a59a){return _0x31a59a[_0xf2f9('0x34')](_0x3bbb5b)[_0xf2f9('0x35')](function(_0x16b7e7){return _0x16b7e7;});}return null;};}function removeEntity(_0x3808ce,_0x51f433){return function(_0x4d0f50){if(_0x4d0f50){return _0x4d0f50[_0xf2f9('0x36')]()['then'](function(){_0x3808ce[_0xf2f9('0x2a')](0xcc)[_0xf2f9('0x2b')]();});}};}function handleEntityNotFound(_0xfd26b9,_0x577a14){return function(_0x462e67){if(!_0x462e67){_0xfd26b9['sendStatus'](0x194);}return _0x462e67;};}function handleError(_0x534a2a,_0x4692db){_0x4692db=_0x4692db||0x1f4;return function(_0x1652c4){logger[_0xf2f9('0x25')](_0x1652c4[_0xf2f9('0x37')]);if(_0x1652c4[_0xf2f9('0x38')]){delete _0x1652c4[_0xf2f9('0x38')];}_0x534a2a['status'](_0x4692db)[_0xf2f9('0x39')](_0x1652c4);};}exports[_0xf2f9('0x3a')]=function(_0x4f1992,_0x86dfb8){var _0x30d761={},_0x723c58={},_0x3b8f38={'count':0x0,'rows':[]};var _0x405b07=_[_0xf2f9('0x3b')](db[_0xf2f9('0x3c')][_0xf2f9('0x3d')],function(_0x5e08b0){return{'name':_0x5e08b0[_0xf2f9('0x3e')],'type':_0x5e08b0[_0xf2f9('0x3f')][_0xf2f9('0x40')]};});_0x723c58[_0xf2f9('0x41')]=_[_0xf2f9('0x3b')](_0x405b07,_0xf2f9('0x38'));_0x723c58[_0xf2f9('0x42')]=_[_0xf2f9('0x43')](_0x4f1992[_0xf2f9('0x42')]);_0x723c58['filters']=_[_0xf2f9('0x44')](_0x723c58[_0xf2f9('0x41')],_0x723c58[_0xf2f9('0x42')]);_0x30d761[_0xf2f9('0x45')]=_[_0xf2f9('0x44')](_0x723c58['model'],qs[_0xf2f9('0x46')](_0x4f1992[_0xf2f9('0x42')]['fields']));_0x30d761[_0xf2f9('0x45')]=_0x30d761['attributes'][_0xf2f9('0x47')]?_0x30d761['attributes']:_0x723c58['model'];if(!_0x4f1992[_0xf2f9('0x42')][_0xf2f9('0x48')](_0xf2f9('0x49'))){_0x30d761['limit']=qs[_0xf2f9('0x2f')](_0x4f1992['query'][_0xf2f9('0x2f')]);_0x30d761[_0xf2f9('0x2e')]=qs[_0xf2f9('0x2e')](_0x4f1992[_0xf2f9('0x42')][_0xf2f9('0x2e')]);}_0x30d761[_0xf2f9('0x4a')]=qs[_0xf2f9('0x4b')](_0x4f1992[_0xf2f9('0x42')]['sort']);_0x30d761[_0xf2f9('0x4c')]=qs[_0xf2f9('0x4d')](_[_0xf2f9('0x4e')](_0x4f1992[_0xf2f9('0x42')],_0x723c58['filters']),_0x405b07);if(_0x4f1992['query'][_0xf2f9('0x4f')]){_0x30d761['where']=_[_0xf2f9('0x50')](_0x30d761[_0xf2f9('0x4c')],{'$or':_['map'](_0x405b07,function(_0x8a7c56){if(_0x8a7c56[_0xf2f9('0x3f')]!=='VIRTUAL'){var _0x22ae98={};_0x22ae98[_0x8a7c56[_0xf2f9('0x38')]]={'$like':'%'+_0x4f1992[_0xf2f9('0x42')][_0xf2f9('0x4f')]+'%'};return _0x22ae98;}})});}_0x30d761=_[_0xf2f9('0x50')]({},_0x30d761,_0x4f1992[_0xf2f9('0x51')]);var _0x1762e2={'where':_0x30d761[_0xf2f9('0x4c')]};return db[_0xf2f9('0x3c')][_0xf2f9('0x2d')](_0x1762e2)[_0xf2f9('0x35')](function(_0x58c426){_0x3b8f38[_0xf2f9('0x2d')]=_0x58c426;if(_0x4f1992[_0xf2f9('0x42')][_0xf2f9('0x52')]){_0x30d761[_0xf2f9('0x53')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x30d761);})[_0xf2f9('0x35')](function(_0xf5edc2){_0x3b8f38[_0xf2f9('0x54')]=_0xf5edc2;return _0x3b8f38;})[_0xf2f9('0x35')](respondWithFilteredResult(_0x86dfb8,_0x30d761))[_0xf2f9('0x55')](handleError(_0x86dfb8,null));};exports[_0xf2f9('0x56')]=function(_0x69e026,_0x269b8a){var _0xe4279a={'raw':![],'where':{'id':_0x69e026[_0xf2f9('0x57')]['id']}},_0x5a02da={};_0x5a02da[_0xf2f9('0x41')]=_[_0xf2f9('0x43')](db[_0xf2f9('0x3c')][_0xf2f9('0x3d')]);_0x5a02da['query']=_['keys'](_0x69e026[_0xf2f9('0x42')]);_0x5a02da[_0xf2f9('0x4d')]=_[_0xf2f9('0x44')](_0x5a02da[_0xf2f9('0x41')],_0x5a02da[_0xf2f9('0x42')]);_0xe4279a[_0xf2f9('0x45')]=_[_0xf2f9('0x44')](_0x5a02da['model'],qs[_0xf2f9('0x46')](_0x69e026['query'][_0xf2f9('0x46')]));_0xe4279a[_0xf2f9('0x45')]=_0xe4279a[_0xf2f9('0x45')][_0xf2f9('0x47')]?_0xe4279a[_0xf2f9('0x45')]:_0x5a02da[_0xf2f9('0x41')];if(_0x69e026[_0xf2f9('0x42')][_0xf2f9('0x52')]){_0xe4279a[_0xf2f9('0x53')]=[{'all':!![]}];}_0xe4279a=_['merge']({},_0xe4279a,_0x69e026[_0xf2f9('0x51')]);return db['VtigerConfiguration'][_0xf2f9('0x58')](_0xe4279a)['then'](handleEntityNotFound(_0x269b8a,null))[_0xf2f9('0x35')](respondWithResult(_0x269b8a,null))['catch'](handleError(_0x269b8a,null));};exports[_0xf2f9('0x59')]=function(_0x4eb8a6,_0x1ae40e){return db[_0xf2f9('0x3c')]['create'](_0x4eb8a6['body'],{})[_0xf2f9('0x35')](respondWithResult(_0x1ae40e,0xc9))['catch'](handleError(_0x1ae40e,null));};exports['update']=function(_0x54a343,_0x37fe27){if(_0x54a343['body']['id']){delete _0x54a343[_0xf2f9('0x5a')]['id'];}return db['VtigerConfiguration'][_0xf2f9('0x58')]({'where':{'id':_0x54a343[_0xf2f9('0x57')]['id']}})[_0xf2f9('0x35')](handleEntityNotFound(_0x37fe27,null))[_0xf2f9('0x35')](saveUpdates(_0x54a343[_0xf2f9('0x5a')],null))['then'](respondWithResult(_0x37fe27,null))[_0xf2f9('0x55')](handleError(_0x37fe27,null));};exports[_0xf2f9('0x36')]=function(_0x27170b,_0x49baf7){return db[_0xf2f9('0x3c')][_0xf2f9('0x58')]({'where':{'id':_0x27170b['params']['id']}})['then'](handleEntityNotFound(_0x49baf7,null))[_0xf2f9('0x35')](removeEntity(_0x49baf7,null))['catch'](handleError(_0x49baf7,null));};exports['getFields']=function(_0x5ea255,_0x548590,_0x1d02ae){var _0x1d5c5d={};var _0x548d0c={};var _0x1c8010;var _0x5d66fe;return db[_0xf2f9('0x3c')]['findOne']({'where':{'id':_0x5ea255[_0xf2f9('0x57')]['id']}})[_0xf2f9('0x35')](handleEntityNotFound(_0x548590,null))['then'](function(_0x4bd3c9){if(_0x4bd3c9){_0x1c8010=_0x4bd3c9;_0x548d0c[_0xf2f9('0x41')]=_['keys'](db['VtigerField']['rawAttributes']);_0x548d0c['query']=_[_0xf2f9('0x43')](_0x5ea255[_0xf2f9('0x42')]);_0x548d0c[_0xf2f9('0x4d')]=_[_0xf2f9('0x44')](_0x548d0c[_0xf2f9('0x41')],_0x548d0c['query']);_0x1d5c5d[_0xf2f9('0x45')]=_[_0xf2f9('0x44')](_0x548d0c[_0xf2f9('0x41')],qs[_0xf2f9('0x46')](_0x5ea255[_0xf2f9('0x42')][_0xf2f9('0x46')]));_0x1d5c5d[_0xf2f9('0x45')]=_0x1d5c5d[_0xf2f9('0x45')][_0xf2f9('0x47')]?_0x1d5c5d['attributes']:_0x548d0c[_0xf2f9('0x41')];_0x1d5c5d['order']=qs['sort'](_0x5ea255[_0xf2f9('0x42')][_0xf2f9('0x4b')]);_0x1d5c5d[_0xf2f9('0x4c')]=qs[_0xf2f9('0x4d')](_[_0xf2f9('0x4e')](_0x5ea255[_0xf2f9('0x42')],_0x548d0c['filters']));if(_0x5ea255[_0xf2f9('0x42')]['filter']){_0x1d5c5d[_0xf2f9('0x4c')]=_['merge'](_0x1d5c5d[_0xf2f9('0x4c')],{'$or':_[_0xf2f9('0x3b')](_0x1d5c5d['attributes'],function(_0x41b09d){var _0x3e761d={};_0x3e761d[_0x41b09d]={'$like':'%'+_0x5ea255['query'][_0xf2f9('0x4f')]+'%'};return _0x3e761d;})});}_0x1d5c5d=_[_0xf2f9('0x50')]({},_0x1d5c5d,_0x5ea255[_0xf2f9('0x51')]);return _0x1c8010['getFields'](_0x1d5c5d);}})[_0xf2f9('0x35')](function(_0x1e8758){if(_0x1e8758){_0x5d66fe=_0x1e8758['length'];if(!_0x5ea255[_0xf2f9('0x42')][_0xf2f9('0x48')](_0xf2f9('0x49'))){_0x1d5c5d[_0xf2f9('0x2f')]=qs['limit'](_0x5ea255['query'][_0xf2f9('0x2f')]);_0x1d5c5d['offset']=qs[_0xf2f9('0x2e')](_0x5ea255[_0xf2f9('0x42')]['offset']);}return _0x1c8010[_0xf2f9('0x5b')](_0x1d5c5d);}})['then'](function(_0x18bea2){if(_0x18bea2){return _0x18bea2?{'count':_0x5d66fe,'rows':_0x18bea2}:null;}})['then'](respondWithResult(_0x548590,null))[_0xf2f9('0x55')](handleError(_0x548590,null));};exports[_0xf2f9('0x5c')]=function(_0x548a07,_0x314e92,_0x5f0782){var _0x42d535={};var _0xc8647e={};var _0x3af972;var _0x59bcb3;return db[_0xf2f9('0x3c')]['findOne']({'where':{'id':_0x548a07['params']['id']}})[_0xf2f9('0x35')](handleEntityNotFound(_0x314e92,null))[_0xf2f9('0x35')](function(_0x24d16e){if(_0x24d16e){_0x3af972=_0x24d16e;_0xc8647e[_0xf2f9('0x41')]=_['keys'](db[_0xf2f9('0x5d')]['rawAttributes']);_0xc8647e[_0xf2f9('0x42')]=_['keys'](_0x548a07[_0xf2f9('0x42')]);_0xc8647e[_0xf2f9('0x4d')]=_[_0xf2f9('0x44')](_0xc8647e['model'],_0xc8647e[_0xf2f9('0x42')]);_0x42d535[_0xf2f9('0x45')]=_[_0xf2f9('0x44')](_0xc8647e[_0xf2f9('0x41')],qs[_0xf2f9('0x46')](_0x548a07['query'][_0xf2f9('0x46')]));_0x42d535[_0xf2f9('0x45')]=_0x42d535['attributes'][_0xf2f9('0x47')]?_0x42d535[_0xf2f9('0x45')]:_0xc8647e[_0xf2f9('0x41')];_0x42d535['order']=qs[_0xf2f9('0x4b')](_0x548a07[_0xf2f9('0x42')]['sort']);_0x42d535[_0xf2f9('0x4c')]=qs[_0xf2f9('0x4d')](_[_0xf2f9('0x4e')](_0x548a07[_0xf2f9('0x42')],_0xc8647e[_0xf2f9('0x4d')]));if(_0x548a07[_0xf2f9('0x42')]['filter']){_0x42d535['where']=_[_0xf2f9('0x50')](_0x42d535[_0xf2f9('0x4c')],{'$or':_[_0xf2f9('0x3b')](_0x42d535[_0xf2f9('0x45')],function(_0x4395f9){var _0x1a1710={};_0x1a1710[_0x4395f9]={'$like':'%'+_0x548a07[_0xf2f9('0x42')][_0xf2f9('0x4f')]+'%'};return _0x1a1710;})});}_0x42d535=_[_0xf2f9('0x50')]({},_0x42d535,_0x548a07['options']);return _0x3af972[_0xf2f9('0x5c')](_0x42d535);}})['then'](function(_0x34c510){if(_0x34c510){_0x59bcb3=_0x34c510[_0xf2f9('0x47')];if(!_0x548a07['query']['hasOwnProperty'](_0xf2f9('0x49'))){_0x42d535[_0xf2f9('0x2f')]=qs[_0xf2f9('0x2f')](_0x548a07[_0xf2f9('0x42')][_0xf2f9('0x2f')]);_0x42d535[_0xf2f9('0x2e')]=qs[_0xf2f9('0x2e')](_0x548a07[_0xf2f9('0x42')][_0xf2f9('0x2e')]);}return _0x3af972[_0xf2f9('0x5c')](_0x42d535);}})[_0xf2f9('0x35')](function(_0x6febdb){if(_0x6febdb){return _0x6febdb?{'count':_0x59bcb3,'rows':_0x6febdb}:null;}})[_0xf2f9('0x35')](respondWithResult(_0x314e92,null))[_0xf2f9('0x55')](handleError(_0x314e92,null));};exports[_0xf2f9('0x5e')]=function(_0x416e4d,_0x178e79,_0x45b6a7){var _0x5a62e5={};var _0x479f74={};var _0x30cd12;var _0x4ad43b;return db[_0xf2f9('0x3c')][_0xf2f9('0x5f')]({'where':{'id':_0x416e4d[_0xf2f9('0x57')]['id']}})[_0xf2f9('0x35')](handleEntityNotFound(_0x178e79,null))[_0xf2f9('0x35')](function(_0x309e93){if(_0x309e93){_0x30cd12=_0x309e93;_0x479f74[_0xf2f9('0x41')]=_[_0xf2f9('0x43')](db['VtigerField']['rawAttributes']);_0x479f74[_0xf2f9('0x42')]=_['keys'](_0x416e4d[_0xf2f9('0x42')]);_0x479f74[_0xf2f9('0x4d')]=_[_0xf2f9('0x44')](_0x479f74[_0xf2f9('0x41')],_0x479f74[_0xf2f9('0x42')]);_0x5a62e5['attributes']=_[_0xf2f9('0x44')](_0x479f74['model'],qs[_0xf2f9('0x46')](_0x416e4d[_0xf2f9('0x42')][_0xf2f9('0x46')]));_0x5a62e5[_0xf2f9('0x45')]=_0x5a62e5[_0xf2f9('0x45')][_0xf2f9('0x47')]?_0x5a62e5[_0xf2f9('0x45')]:_0x479f74['model'];_0x5a62e5[_0xf2f9('0x4a')]=qs[_0xf2f9('0x4b')](_0x416e4d[_0xf2f9('0x42')][_0xf2f9('0x4b')]);_0x5a62e5['where']=qs[_0xf2f9('0x4d')](_[_0xf2f9('0x4e')](_0x416e4d['query'],_0x479f74['filters']));if(_0x416e4d[_0xf2f9('0x42')][_0xf2f9('0x4f')]){_0x5a62e5[_0xf2f9('0x4c')]=_[_0xf2f9('0x50')](_0x5a62e5['where'],{'$or':_[_0xf2f9('0x3b')](_0x5a62e5[_0xf2f9('0x45')],function(_0x11c91c){var _0x1c6e25={};_0x1c6e25[_0x11c91c]={'$like':'%'+_0x416e4d['query'][_0xf2f9('0x4f')]+'%'};return _0x1c6e25;})});}_0x5a62e5=_[_0xf2f9('0x50')]({},_0x5a62e5,_0x416e4d[_0xf2f9('0x51')]);return _0x30cd12[_0xf2f9('0x5e')](_0x5a62e5);}})[_0xf2f9('0x35')](function(_0x33032a){if(_0x33032a){_0x4ad43b=_0x33032a['length'];if(!_0x416e4d[_0xf2f9('0x42')][_0xf2f9('0x48')](_0xf2f9('0x49'))){_0x5a62e5[_0xf2f9('0x2f')]=qs[_0xf2f9('0x2f')](_0x416e4d[_0xf2f9('0x42')]['limit']);_0x5a62e5[_0xf2f9('0x2e')]=qs[_0xf2f9('0x2e')](_0x416e4d[_0xf2f9('0x42')][_0xf2f9('0x2e')]);}return _0x30cd12['getDescriptions'](_0x5a62e5);}})['then'](function(_0x92e216){if(_0x92e216){return _0x92e216?{'count':_0x4ad43b,'rows':_0x92e216}:null;}})['then'](respondWithResult(_0x178e79,null))[_0xf2f9('0x55')](handleError(_0x178e79,null));}; \ No newline at end of file +var _0x20ea=['lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','request','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','find','create','body','getFields','findOne','VtigerField','getSubjects','length','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x21e9bb,_0x1db195){var _0x5303f7=function(_0x30dd13){while(--_0x30dd13){_0x21e9bb['push'](_0x21e9bb['shift']());}};_0x5303f7(++_0x1db195);}(_0x20ea,0x1c5));var _0xa20e=function(_0x2df46e,_0x433fee){_0x2df46e=_0x2df46e-0x0;var _0x50a139=_0x20ea[_0x2df46e];return _0x50a139;};'use strict';var pdf=require(_0xa20e('0x0'));var emlformat=require(_0xa20e('0x1'));var rimraf=require(_0xa20e('0x2'));var zipdir=require(_0xa20e('0x3'));var jsonpatch=require(_0xa20e('0x4'));var rp=require(_0xa20e('0x5'));var moment=require(_0xa20e('0x6'));var BPromise=require(_0xa20e('0x7'));var Mustache=require(_0xa20e('0x8'));var util=require(_0xa20e('0x9'));var path=require(_0xa20e('0xa'));var sox=require('sox');var csv=require(_0xa20e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa20e('0xc'));var squel=require('squel');var crypto=require(_0xa20e('0xd'));var jsforce=require(_0xa20e('0xe'));var deskjs=require(_0xa20e('0xf'));var toCsv=require(_0xa20e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa20e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa20e('0x11'));var as=require(_0xa20e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa20e('0x13'))(_0xa20e('0x14'));var utils=require(_0xa20e('0x15'));var config=require(_0xa20e('0x16'));var db=require(_0xa20e('0x17'))['db'];var jayson=require(_0xa20e('0x18'));var client=jayson[_0xa20e('0x19')][_0xa20e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1c343d,_0x36395e,_0x10e9ab){if(_0x10e9ab){var _0x3ef9af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ef9af['test'](_0x36395e)){return _0x1c343d;}else{throw new db[(_0xa20e('0x1b'))][(_0xa20e('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 _0x1c343d;}}function respondWithRpcPromise(_0x4a1153,_0x4c0e80,_0x3e4ae7,_0x44dcb4){return new BPromise(function(_0x728a92,_0x3e8a69){var _0x1faf59=_0x44dcb4||client;return _0x1faf59[_0xa20e('0x1d')](_0x4a1153,_0x3e4ae7)['then'](function(_0x33be4a){logger['info'](_0xa20e('0x1e'),_0x4c0e80,'request\x20sent');logger['debug'](_0xa20e('0x1f'),_0x4c0e80,_0xa20e('0x20'),JSON['stringify'](_0x33be4a));if(_0x33be4a['error']){if(_0x33be4a['error'][_0xa20e('0x21')]===0x1f4){logger[_0xa20e('0x22')](_0xa20e('0x1e'),_0x4c0e80,_0x33be4a[_0xa20e('0x22')][_0xa20e('0x23')]);return _0x3e8a69(_0x33be4a[_0xa20e('0x22')][_0xa20e('0x23')]);}logger[_0xa20e('0x22')](_0xa20e('0x1e'),_0x4c0e80,_0x33be4a[_0xa20e('0x22')][_0xa20e('0x23')]);return _0x728a92(_0x33be4a[_0xa20e('0x22')][_0xa20e('0x23')]);}else{logger[_0xa20e('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x4c0e80,_0xa20e('0x20'));_0x728a92(_0x33be4a[_0xa20e('0x25')][_0xa20e('0x23')]);}})[_0xa20e('0x26')](function(_0x21c768){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4c0e80,_0x21c768);_0x3e8a69(_0x21c768);});});}function respondWithStatusCode(_0xddd8a7,_0x31857f){_0x31857f=_0x31857f||0xcc;return function(_0x4e5159){if(_0x4e5159){return _0xddd8a7[_0xa20e('0x27')](_0x31857f);}return _0xddd8a7[_0xa20e('0x28')](_0x31857f)[_0xa20e('0x29')]();};}function respondWithResult(_0x4c1c4a,_0x215a3a){_0x215a3a=_0x215a3a||0xc8;return function(_0x38894d){if(_0x38894d){return _0x4c1c4a[_0xa20e('0x28')](_0x215a3a)[_0xa20e('0x2a')](_0x38894d);}};}function respondWithFilteredResult(_0x2d3b5b,_0x1e8be6){return function(_0x14a18e){if(_0x14a18e){var _0xae9aee=_0x14a18e[_0xa20e('0x2b')],_0x1f4a6a=_0x1e8be6[_0xa20e('0x2c')],_0x5e603e=_0x1e8be6[_0xa20e('0x2c')]+_0x1e8be6[_0xa20e('0x2d')],_0x391ab5;if(_0x5e603e>=_0xae9aee){_0x5e603e=_0xae9aee;_0x391ab5=0xc8;}else{_0x391ab5=0xce;}_0x2d3b5b['status'](_0x391ab5);return _0x2d3b5b[_0xa20e('0x2e')](_0xa20e('0x2f'),_0x1f4a6a+'-'+_0x5e603e+'/'+_0xae9aee)['json'](_0x14a18e);}return null;};}function patchUpdates(_0x2ef680){return function(_0x22bd8a){try{jsonpatch[_0xa20e('0x30')](_0x22bd8a,_0x2ef680,!![]);}catch(_0x3f3a53){return BPromise['reject'](_0x3f3a53);}return _0x22bd8a[_0xa20e('0x31')]();};}function saveUpdates(_0x4fcd18,_0x366ffc){return function(_0x4927df){if(_0x4927df){return _0x4927df[_0xa20e('0x32')](_0x4fcd18)[_0xa20e('0x33')](function(_0xc1f286){return _0xc1f286;});}return null;};}function removeEntity(_0x528641,_0x1c51f6){return function(_0xa54554){if(_0xa54554){return _0xa54554[_0xa20e('0x34')]()['then'](function(){_0x528641['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53280f,_0x6904e5){return function(_0x25ea61){if(!_0x25ea61){_0x53280f['sendStatus'](0x194);}return _0x25ea61;};}function handleError(_0x5b127c,_0x152f35){_0x152f35=_0x152f35||0x1f4;return function(_0xe05ede){logger[_0xa20e('0x22')](_0xe05ede[_0xa20e('0x35')]);if(_0xe05ede['name']){delete _0xe05ede[_0xa20e('0x36')];}_0x5b127c[_0xa20e('0x28')](_0x152f35)[_0xa20e('0x37')](_0xe05ede);};}exports['index']=function(_0x6d880b,_0x4cd507){var _0x29ee1e={},_0x33dd95={},_0x20a114={'count':0x0,'rows':[]};var _0x4e6002=_[_0xa20e('0x38')](db[_0xa20e('0x39')][_0xa20e('0x3a')],function(_0x2c5628){return{'name':_0x2c5628[_0xa20e('0x3b')],'type':_0x2c5628[_0xa20e('0x3c')]['key']};});_0x33dd95[_0xa20e('0x3d')]=_[_0xa20e('0x38')](_0x4e6002,'name');_0x33dd95['query']=_[_0xa20e('0x3e')](_0x6d880b[_0xa20e('0x3f')]);_0x33dd95[_0xa20e('0x40')]=_[_0xa20e('0x41')](_0x33dd95[_0xa20e('0x3d')],_0x33dd95['query']);_0x29ee1e[_0xa20e('0x42')]=_[_0xa20e('0x41')](_0x33dd95['model'],qs['fields'](_0x6d880b[_0xa20e('0x3f')][_0xa20e('0x43')]));_0x29ee1e[_0xa20e('0x42')]=_0x29ee1e[_0xa20e('0x42')]['length']?_0x29ee1e[_0xa20e('0x42')]:_0x33dd95[_0xa20e('0x3d')];if(!_0x6d880b[_0xa20e('0x3f')][_0xa20e('0x44')](_0xa20e('0x45'))){_0x29ee1e['limit']=qs[_0xa20e('0x2d')](_0x6d880b['query']['limit']);_0x29ee1e[_0xa20e('0x2c')]=qs[_0xa20e('0x2c')](_0x6d880b[_0xa20e('0x3f')][_0xa20e('0x2c')]);}_0x29ee1e[_0xa20e('0x46')]=qs['sort'](_0x6d880b[_0xa20e('0x3f')][_0xa20e('0x47')]);_0x29ee1e['where']=qs[_0xa20e('0x40')](_[_0xa20e('0x48')](_0x6d880b[_0xa20e('0x3f')],_0x33dd95[_0xa20e('0x40')]),_0x4e6002);if(_0x6d880b[_0xa20e('0x3f')]['filter']){_0x29ee1e[_0xa20e('0x49')]=_[_0xa20e('0x4a')](_0x29ee1e[_0xa20e('0x49')],{'$or':_['map'](_0x4e6002,function(_0x378c3e){if(_0x378c3e[_0xa20e('0x3c')]!==_0xa20e('0x4b')){var _0x94acee={};_0x94acee[_0x378c3e['name']]={'$like':'%'+_0x6d880b[_0xa20e('0x3f')][_0xa20e('0x4c')]+'%'};return _0x94acee;}})});}_0x29ee1e=_[_0xa20e('0x4a')]({},_0x29ee1e,_0x6d880b[_0xa20e('0x4d')]);var _0x3e550d={'where':_0x29ee1e[_0xa20e('0x49')]};return db[_0xa20e('0x39')][_0xa20e('0x2b')](_0x3e550d)[_0xa20e('0x33')](function(_0x2934da){_0x20a114['count']=_0x2934da;if(_0x6d880b[_0xa20e('0x3f')]['includeAll']){_0x29ee1e[_0xa20e('0x4e')]=[{'all':!![]}];}return db[_0xa20e('0x39')][_0xa20e('0x4f')](_0x29ee1e);})[_0xa20e('0x33')](function(_0x34e7c8){_0x20a114[_0xa20e('0x50')]=_0x34e7c8;return _0x20a114;})[_0xa20e('0x33')](respondWithFilteredResult(_0x4cd507,_0x29ee1e))[_0xa20e('0x26')](handleError(_0x4cd507,null));};exports[_0xa20e('0x51')]=function(_0x20ee32,_0x26ab10){var _0x4af8e0={'raw':![],'where':{'id':_0x20ee32[_0xa20e('0x52')]['id']}},_0x3de36b={};_0x3de36b[_0xa20e('0x3d')]=_[_0xa20e('0x3e')](db[_0xa20e('0x39')][_0xa20e('0x3a')]);_0x3de36b['query']=_[_0xa20e('0x3e')](_0x20ee32[_0xa20e('0x3f')]);_0x3de36b[_0xa20e('0x40')]=_[_0xa20e('0x41')](_0x3de36b[_0xa20e('0x3d')],_0x3de36b['query']);_0x4af8e0[_0xa20e('0x42')]=_[_0xa20e('0x41')](_0x3de36b[_0xa20e('0x3d')],qs[_0xa20e('0x43')](_0x20ee32[_0xa20e('0x3f')][_0xa20e('0x43')]));_0x4af8e0[_0xa20e('0x42')]=_0x4af8e0[_0xa20e('0x42')]['length']?_0x4af8e0[_0xa20e('0x42')]:_0x3de36b[_0xa20e('0x3d')];if(_0x20ee32['query'][_0xa20e('0x53')]){_0x4af8e0[_0xa20e('0x4e')]=[{'all':!![]}];}_0x4af8e0=_[_0xa20e('0x4a')]({},_0x4af8e0,_0x20ee32[_0xa20e('0x4d')]);return db[_0xa20e('0x39')][_0xa20e('0x54')](_0x4af8e0)[_0xa20e('0x33')](handleEntityNotFound(_0x26ab10,null))[_0xa20e('0x33')](respondWithResult(_0x26ab10,null))[_0xa20e('0x26')](handleError(_0x26ab10,null));};exports['create']=function(_0x5c7cb5,_0x13a7ee){return db[_0xa20e('0x39')][_0xa20e('0x55')](_0x5c7cb5['body'],{})[_0xa20e('0x33')](respondWithResult(_0x13a7ee,0xc9))[_0xa20e('0x26')](handleError(_0x13a7ee,null));};exports[_0xa20e('0x32')]=function(_0xf72634,_0x49e666){if(_0xf72634[_0xa20e('0x56')]['id']){delete _0xf72634[_0xa20e('0x56')]['id'];}return db[_0xa20e('0x39')][_0xa20e('0x54')]({'where':{'id':_0xf72634['params']['id']}})[_0xa20e('0x33')](handleEntityNotFound(_0x49e666,null))[_0xa20e('0x33')](saveUpdates(_0xf72634[_0xa20e('0x56')],null))[_0xa20e('0x33')](respondWithResult(_0x49e666,null))[_0xa20e('0x26')](handleError(_0x49e666,null));};exports[_0xa20e('0x34')]=function(_0xb79f21,_0x48e9ab){return db[_0xa20e('0x39')][_0xa20e('0x54')]({'where':{'id':_0xb79f21[_0xa20e('0x52')]['id']}})[_0xa20e('0x33')](handleEntityNotFound(_0x48e9ab,null))[_0xa20e('0x33')](removeEntity(_0x48e9ab,null))[_0xa20e('0x26')](handleError(_0x48e9ab,null));};exports[_0xa20e('0x57')]=function(_0x5710c8,_0x27ef80,_0x16736b){var _0x5afc64={};var _0x43ba69={};var _0x12f8c;var _0x37edef;return db[_0xa20e('0x39')][_0xa20e('0x58')]({'where':{'id':_0x5710c8[_0xa20e('0x52')]['id']}})[_0xa20e('0x33')](handleEntityNotFound(_0x27ef80,null))['then'](function(_0x519167){if(_0x519167){_0x12f8c=_0x519167;_0x43ba69[_0xa20e('0x3d')]=_[_0xa20e('0x3e')](db[_0xa20e('0x59')]['rawAttributes']);_0x43ba69[_0xa20e('0x3f')]=_[_0xa20e('0x3e')](_0x5710c8[_0xa20e('0x3f')]);_0x43ba69[_0xa20e('0x40')]=_[_0xa20e('0x41')](_0x43ba69[_0xa20e('0x3d')],_0x43ba69[_0xa20e('0x3f')]);_0x5afc64[_0xa20e('0x42')]=_[_0xa20e('0x41')](_0x43ba69['model'],qs[_0xa20e('0x43')](_0x5710c8[_0xa20e('0x3f')][_0xa20e('0x43')]));_0x5afc64[_0xa20e('0x42')]=_0x5afc64[_0xa20e('0x42')]['length']?_0x5afc64[_0xa20e('0x42')]:_0x43ba69[_0xa20e('0x3d')];_0x5afc64[_0xa20e('0x46')]=qs['sort'](_0x5710c8[_0xa20e('0x3f')][_0xa20e('0x47')]);_0x5afc64['where']=qs[_0xa20e('0x40')](_[_0xa20e('0x48')](_0x5710c8[_0xa20e('0x3f')],_0x43ba69[_0xa20e('0x40')]));if(_0x5710c8[_0xa20e('0x3f')][_0xa20e('0x4c')]){_0x5afc64[_0xa20e('0x49')]=_[_0xa20e('0x4a')](_0x5afc64['where'],{'$or':_['map'](_0x5afc64[_0xa20e('0x42')],function(_0x3ca0e5){var _0x1b45de={};_0x1b45de[_0x3ca0e5]={'$like':'%'+_0x5710c8[_0xa20e('0x3f')]['filter']+'%'};return _0x1b45de;})});}_0x5afc64=_['merge']({},_0x5afc64,_0x5710c8[_0xa20e('0x4d')]);return _0x12f8c[_0xa20e('0x57')](_0x5afc64);}})['then'](function(_0x4974b5){if(_0x4974b5){_0x37edef=_0x4974b5['length'];if(!_0x5710c8[_0xa20e('0x3f')][_0xa20e('0x44')](_0xa20e('0x45'))){_0x5afc64[_0xa20e('0x2d')]=qs[_0xa20e('0x2d')](_0x5710c8[_0xa20e('0x3f')]['limit']);_0x5afc64[_0xa20e('0x2c')]=qs['offset'](_0x5710c8['query'][_0xa20e('0x2c')]);}return _0x12f8c[_0xa20e('0x57')](_0x5afc64);}})[_0xa20e('0x33')](function(_0x13fa0e){if(_0x13fa0e){return _0x13fa0e?{'count':_0x37edef,'rows':_0x13fa0e}:null;}})['then'](respondWithResult(_0x27ef80,null))[_0xa20e('0x26')](handleError(_0x27ef80,null));};exports[_0xa20e('0x5a')]=function(_0x1a459e,_0x30891b,_0x57d98e){var _0x4071c5={};var _0x5975fe={};var _0x4fcbe6;var _0x3a52bd;return db[_0xa20e('0x39')]['findOne']({'where':{'id':_0x1a459e['params']['id']}})[_0xa20e('0x33')](handleEntityNotFound(_0x30891b,null))[_0xa20e('0x33')](function(_0x52de8e){if(_0x52de8e){_0x4fcbe6=_0x52de8e;_0x5975fe['model']=_[_0xa20e('0x3e')](db[_0xa20e('0x59')][_0xa20e('0x3a')]);_0x5975fe[_0xa20e('0x3f')]=_['keys'](_0x1a459e[_0xa20e('0x3f')]);_0x5975fe['filters']=_['intersection'](_0x5975fe['model'],_0x5975fe[_0xa20e('0x3f')]);_0x4071c5[_0xa20e('0x42')]=_[_0xa20e('0x41')](_0x5975fe[_0xa20e('0x3d')],qs['fields'](_0x1a459e[_0xa20e('0x3f')][_0xa20e('0x43')]));_0x4071c5[_0xa20e('0x42')]=_0x4071c5[_0xa20e('0x42')][_0xa20e('0x5b')]?_0x4071c5[_0xa20e('0x42')]:_0x5975fe[_0xa20e('0x3d')];_0x4071c5[_0xa20e('0x46')]=qs[_0xa20e('0x47')](_0x1a459e[_0xa20e('0x3f')]['sort']);_0x4071c5[_0xa20e('0x49')]=qs[_0xa20e('0x40')](_[_0xa20e('0x48')](_0x1a459e['query'],_0x5975fe[_0xa20e('0x40')]));if(_0x1a459e['query'][_0xa20e('0x4c')]){_0x4071c5[_0xa20e('0x49')]=_['merge'](_0x4071c5[_0xa20e('0x49')],{'$or':_[_0xa20e('0x38')](_0x4071c5[_0xa20e('0x42')],function(_0x10c40d){var _0x14dafc={};_0x14dafc[_0x10c40d]={'$like':'%'+_0x1a459e[_0xa20e('0x3f')][_0xa20e('0x4c')]+'%'};return _0x14dafc;})});}_0x4071c5=_[_0xa20e('0x4a')]({},_0x4071c5,_0x1a459e[_0xa20e('0x4d')]);return _0x4fcbe6['getSubjects'](_0x4071c5);}})[_0xa20e('0x33')](function(_0xd2b121){if(_0xd2b121){_0x3a52bd=_0xd2b121[_0xa20e('0x5b')];if(!_0x1a459e['query'][_0xa20e('0x44')](_0xa20e('0x45'))){_0x4071c5['limit']=qs['limit'](_0x1a459e[_0xa20e('0x3f')][_0xa20e('0x2d')]);_0x4071c5[_0xa20e('0x2c')]=qs['offset'](_0x1a459e[_0xa20e('0x3f')][_0xa20e('0x2c')]);}return _0x4fcbe6[_0xa20e('0x5a')](_0x4071c5);}})['then'](function(_0x38f890){if(_0x38f890){return _0x38f890?{'count':_0x3a52bd,'rows':_0x38f890}:null;}})[_0xa20e('0x33')](respondWithResult(_0x30891b,null))[_0xa20e('0x26')](handleError(_0x30891b,null));};exports['getDescriptions']=function(_0x237659,_0xbb08f6,_0x1fd5a4){var _0x264934={};var _0x30396d={};var _0x2b76da;var _0x5f5719;return db[_0xa20e('0x39')][_0xa20e('0x58')]({'where':{'id':_0x237659['params']['id']}})[_0xa20e('0x33')](handleEntityNotFound(_0xbb08f6,null))[_0xa20e('0x33')](function(_0x154e92){if(_0x154e92){_0x2b76da=_0x154e92;_0x30396d[_0xa20e('0x3d')]=_[_0xa20e('0x3e')](db[_0xa20e('0x59')][_0xa20e('0x3a')]);_0x30396d['query']=_['keys'](_0x237659[_0xa20e('0x3f')]);_0x30396d[_0xa20e('0x40')]=_[_0xa20e('0x41')](_0x30396d[_0xa20e('0x3d')],_0x30396d[_0xa20e('0x3f')]);_0x264934[_0xa20e('0x42')]=_[_0xa20e('0x41')](_0x30396d[_0xa20e('0x3d')],qs[_0xa20e('0x43')](_0x237659[_0xa20e('0x3f')][_0xa20e('0x43')]));_0x264934[_0xa20e('0x42')]=_0x264934[_0xa20e('0x42')][_0xa20e('0x5b')]?_0x264934[_0xa20e('0x42')]:_0x30396d[_0xa20e('0x3d')];_0x264934['order']=qs['sort'](_0x237659[_0xa20e('0x3f')][_0xa20e('0x47')]);_0x264934[_0xa20e('0x49')]=qs[_0xa20e('0x40')](_[_0xa20e('0x48')](_0x237659[_0xa20e('0x3f')],_0x30396d[_0xa20e('0x40')]));if(_0x237659[_0xa20e('0x3f')][_0xa20e('0x4c')]){_0x264934['where']=_['merge'](_0x264934[_0xa20e('0x49')],{'$or':_[_0xa20e('0x38')](_0x264934['attributes'],function(_0x37a478){var _0x4db919={};_0x4db919[_0x37a478]={'$like':'%'+_0x237659['query'][_0xa20e('0x4c')]+'%'};return _0x4db919;})});}_0x264934=_[_0xa20e('0x4a')]({},_0x264934,_0x237659[_0xa20e('0x4d')]);return _0x2b76da['getDescriptions'](_0x264934);}})[_0xa20e('0x33')](function(_0x131a2b){if(_0x131a2b){_0x5f5719=_0x131a2b[_0xa20e('0x5b')];if(!_0x237659['query'][_0xa20e('0x44')](_0xa20e('0x45'))){_0x264934['limit']=qs[_0xa20e('0x2d')](_0x237659[_0xa20e('0x3f')][_0xa20e('0x2d')]);_0x264934[_0xa20e('0x2c')]=qs['offset'](_0x237659[_0xa20e('0x3f')][_0xa20e('0x2c')]);}return _0x2b76da[_0xa20e('0x5c')](_0x264934);}})[_0xa20e('0x33')](function(_0x4a263d){if(_0x4a263d){return _0x4a263d?{'count':_0x5f5719,'rows':_0x4a263d}:null;}})[_0xa20e('0x33')](respondWithResult(_0xbb08f6,null))['catch'](handleError(_0xbb08f6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d4887fd..16b511f 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 _0x728c=['moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger'];(function(_0x2a90f9,_0x520722){var _0x3b606f=function(_0x4e8686){while(--_0x4e8686){_0x2a90f9['push'](_0x2a90f9['shift']());}};_0x3b606f(++_0x520722);}(_0x728c,0x1c6));var _0xc728=function(_0x3578a7,_0x2d8fc6){_0x3578a7=_0x3578a7-0x0;var _0x1377b3=_0x728c[_0x3578a7];return _0x1377b3;};'use strict';var _=require(_0xc728('0x0'));var util=require('util');var logger=require(_0xc728('0x1'))('api');var moment=require(_0xc728('0x2'));var BPromise=require(_0xc728('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc728('0x4'));var rimraf=require(_0xc728('0x5'));var config=require(_0xc728('0x6'));var attributes=require(_0xc728('0x7'));module[_0xc728('0x8')]=function(_0x2da47e,_0x2fb26a){return _0x2da47e[_0xc728('0x9')](_0xc728('0xa'),attributes,{'tableName':_0xc728('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9db=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xc9db,0x79));var _0xbc9d=function(_0x4525ed,_0x4cda81){_0x4525ed=_0x4525ed-0x0;var _0x96aa84=_0xc9db[_0x4525ed];return _0x96aa84;};'use strict';var _=require('lodash');var util=require(_0xbc9d('0x0'));var logger=require(_0xbc9d('0x1'))(_0xbc9d('0x2'));var moment=require(_0xbc9d('0x3'));var BPromise=require(_0xbc9d('0x4'));var rp=require(_0xbc9d('0x5'));var fs=require('fs');var path=require(_0xbc9d('0x6'));var rimraf=require(_0xbc9d('0x7'));var config=require(_0xbc9d('0x8'));var attributes=require(_0xbc9d('0x9'));module['exports']=function(_0x25907a,_0x109626){return _0x25907a['define'](_0xbc9d('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 2e118d4..27c95a7 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 _0xcc8e=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcc8e,0x127));var _0xecc8=function(_0x152305,_0x18f49c){_0x152305=_0x152305-0x0;var _0x2c59a3=_0xcc8e[_0x152305];return _0x2c59a3;};'use strict';var _=require(_0xecc8('0x0'));var util=require('util');var moment=require(_0xecc8('0x1'));var BPromise=require('bluebird');var rs=require(_0xecc8('0x2'));var fs=require('fs');var Redis=require(_0xecc8('0x3'));var db=require(_0xecc8('0x4'))['db'];var utils=require(_0xecc8('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xecc8('0x6'));var jayson=require(_0xecc8('0x7'));var client=jayson[_0xecc8('0x8')][_0xecc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x103c2a,_0x19e0c9,_0x579288){return new BPromise(function(_0x47e071,_0x1152e9){return client[_0xecc8('0xa')](_0x103c2a,_0x579288)[_0xecc8('0xb')](function(_0x38f1dc){logger[_0xecc8('0xc')](_0xecc8('0xd'),_0x19e0c9,_0xecc8('0xe'));logger[_0xecc8('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x19e0c9,_0xecc8('0xe'),JSON[_0xecc8('0x10')](_0x38f1dc));if(_0x38f1dc[_0xecc8('0x11')]){if(_0x38f1dc[_0xecc8('0x11')][_0xecc8('0x12')]===0x1f4){logger[_0xecc8('0x11')](_0xecc8('0xd'),_0x19e0c9,_0x38f1dc[_0xecc8('0x11')][_0xecc8('0x13')]);return _0x1152e9(_0x38f1dc[_0xecc8('0x11')][_0xecc8('0x13')]);}logger[_0xecc8('0x11')](_0xecc8('0xd'),_0x19e0c9,_0x38f1dc['error']['message']);return _0x47e071(_0x38f1dc[_0xecc8('0x11')]['message']);}else{logger[_0xecc8('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x19e0c9,_0xecc8('0xe'));_0x47e071(_0x38f1dc['result'][_0xecc8('0x13')]);}})['catch'](function(_0x5a58a2){logger[_0xecc8('0x11')](_0xecc8('0xd'),_0x19e0c9,_0x5a58a2);_0x1152e9(_0x5a58a2);});});} \ No newline at end of file +var _0x2655=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5c6272,_0xd82df5){var _0x19c236=function(_0x332352){while(--_0x332352){_0x5c6272['push'](_0x5c6272['shift']());}};_0x19c236(++_0xd82df5);}(_0x2655,0xb9));var _0x5265=function(_0x5cb32f,_0x1f8632){_0x5cb32f=_0x5cb32f-0x0;var _0x1bd969=_0x2655[_0x5cb32f];return _0x1bd969;};'use strict';var _=require(_0x5265('0x0'));var util=require(_0x5265('0x1'));var moment=require('moment');var BPromise=require(_0x5265('0x2'));var rs=require(_0x5265('0x3'));var fs=require('fs');var Redis=require(_0x5265('0x4'));var db=require(_0x5265('0x5'))['db'];var utils=require(_0x5265('0x6'));var logger=require(_0x5265('0x7'))(_0x5265('0x8'));var config=require(_0x5265('0x9'));var jayson=require(_0x5265('0xa'));var client=jayson[_0x5265('0xb')][_0x5265('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3aeb86,_0x2901d0,_0x3b7109){return new BPromise(function(_0x446f0d,_0x29ae5b){return client[_0x5265('0xd')](_0x3aeb86,_0x3b7109)[_0x5265('0xe')](function(_0x57ec3f){logger[_0x5265('0xf')](_0x5265('0x10'),_0x2901d0,_0x5265('0x11'));logger[_0x5265('0x12')](_0x5265('0x13'),_0x2901d0,_0x5265('0x11'),JSON[_0x5265('0x14')](_0x57ec3f));if(_0x57ec3f['error']){if(_0x57ec3f['error'][_0x5265('0x15')]===0x1f4){logger[_0x5265('0x16')](_0x5265('0x10'),_0x2901d0,_0x57ec3f['error']['message']);return _0x29ae5b(_0x57ec3f[_0x5265('0x16')]['message']);}logger['error'](_0x5265('0x10'),_0x2901d0,_0x57ec3f['error'][_0x5265('0x17')]);return _0x446f0d(_0x57ec3f[_0x5265('0x16')][_0x5265('0x17')]);}else{logger['info'](_0x5265('0x10'),_0x2901d0,'request\x20sent');_0x446f0d(_0x57ec3f['result'][_0x5265('0x17')]);}})[_0x5265('0x18')](function(_0x4b2b07){logger[_0x5265('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x2901d0,_0x4b2b07);_0x29ae5b(_0x4b2b07);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 99a2106..51bec80 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 _0x73ab=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','multer','util'];(function(_0x3697f4,_0x735974){var _0x3bd8cd=function(_0x3dda4a){while(--_0x3dda4a){_0x3697f4['push'](_0x3697f4['shift']());}};_0x3bd8cd(++_0x735974);}(_0x73ab,0x1a7));var _0xb73a=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x73ab[_0x2179f1];return _0x176ec9;};'use strict';var multer=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var path=require('path');var timeout=require(_0xb73a('0x2'));var express=require(_0xb73a('0x3'));var router=express['Router']();var auth=require(_0xb73a('0x4'));var interaction=require(_0xb73a('0x5'));var config=require(_0xb73a('0x6'));var controller=require(_0xb73a('0x7'));router[_0xb73a('0x8')]('/',auth[_0xb73a('0x9')](),controller[_0xb73a('0xa')]);router['get'](_0xb73a('0xb'),auth[_0xb73a('0x9')](),controller[_0xb73a('0xc')]);router[_0xb73a('0xd')]('/',auth[_0xb73a('0x9')](),controller[_0xb73a('0xe')]);router[_0xb73a('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb73a('0x10')](_0xb73a('0xb'),auth[_0xb73a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdd32=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','exports','multer','path','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdd32,0xfc));var _0x2dd3=function(_0xb4bdb1,_0x25269c){_0xb4bdb1=_0xb4bdb1-0x0;var _0x259f46=_0xdd32[_0xb4bdb1];return _0x259f46;};'use strict';var multer=require(_0x2dd3('0x0'));var util=require('util');var path=require(_0x2dd3('0x1'));var timeout=require('connect-timeout');var express=require(_0x2dd3('0x2'));var router=express['Router']();var auth=require(_0x2dd3('0x3'));var interaction=require(_0x2dd3('0x4'));var config=require(_0x2dd3('0x5'));var controller=require(_0x2dd3('0x6'));router[_0x2dd3('0x7')]('/',auth[_0x2dd3('0x8')](),controller[_0x2dd3('0x9')]);router['get']('/:id',auth[_0x2dd3('0x8')](),controller[_0x2dd3('0xa')]);router['post']('/',auth[_0x2dd3('0x8')](),controller[_0x2dd3('0xb')]);router[_0x2dd3('0xc')](_0x2dd3('0xd'),auth['isAuthenticated'](),controller[_0x2dd3('0xe')]);router['delete'](_0x2dd3('0xd'),auth[_0x2dd3('0x8')](),controller[_0x2dd3('0xf')]);module[_0x2dd3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 3f958bf..1d6c694 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 _0xf3cd=['customVariable','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5f36cd,_0x37d4c9){_0x5f36cd=_0x5f36cd-0x0;var _0x49832a=_0xf3cd[_0x5f36cd];return _0x49832a;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'type':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3'),_0xdf3c('0x4'),_0xdf3c('0x5'),'keyValue'),'defaultValue':_0xdf3c('0x3')},'content':{'type':Sequelize[_0xdf3c('0x6')]},'key':{'type':Sequelize[_0xdf3c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xdf3c('0x3'),_0xdf3c('0x4'),_0xdf3c('0x5'))},'keyContent':{'type':Sequelize[_0xdf3c('0x6')]},'idField':{'type':Sequelize[_0xdf3c('0x6')]},'nameField':{'type':Sequelize[_0xdf3c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdf3c('0x6')]}}; \ No newline at end of file +var _0x9865=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1d908b,_0x4abdba){var _0x13559a=function(_0x4bb5f7){while(--_0x4bb5f7){_0x1d908b['push'](_0x1d908b['shift']());}};_0x13559a(++_0x4abdba);}(_0x9865,0x1ba));var _0x5986=function(_0x4f8780,_0x26afec){_0x4f8780=_0x4f8780-0x0;var _0x5a3dfd=_0x9865[_0x4f8780];return _0x5a3dfd;};'use strict';var Sequelize=require(_0x5986('0x0'));module[_0x5986('0x1')]={'type':{'type':Sequelize[_0x5986('0x2')](_0x5986('0x3'),_0x5986('0x4'),_0x5986('0x5'),_0x5986('0x6')),'defaultValue':_0x5986('0x3')},'content':{'type':Sequelize[_0x5986('0x7')]},'key':{'type':Sequelize[_0x5986('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5986('0x3'),_0x5986('0x4'),_0x5986('0x5'))},'keyContent':{'type':Sequelize[_0x5986('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5986('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f2acb24..a1b72aa 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 _0xd624=['html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','VtigerField','count','findAll','rows','show','params','length','includeAll','include','catch','create','body','update','find'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xd624,0x124));var _0x4d62=function(_0x92ec44,_0x48bdb6){_0x92ec44=_0x92ec44-0x0;var _0x341b89=_0xd624[_0x92ec44];return _0x341b89;};'use strict';var pdf=require(_0x4d62('0x0'));var emlformat=require(_0x4d62('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d62('0x3'));var Mustache=require(_0x4d62('0x4'));var util=require(_0x4d62('0x5'));var path=require(_0x4d62('0x6'));var sox=require(_0x4d62('0x7'));var csv=require(_0x4d62('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4d62('0x9'));var crypto=require(_0x4d62('0xa'));var jsforce=require(_0x4d62('0xb'));var deskjs=require(_0x4d62('0xc'));var toCsv=require(_0x4d62('0x8'));var querystring=require('querystring');var Papa=require(_0x4d62('0xd'));var Redis=require(_0x4d62('0xe'));var authService=require(_0x4d62('0xf'));var qs=require(_0x4d62('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d62('0x11'));var logger=require(_0x4d62('0x12'))(_0x4d62('0x13'));var utils=require(_0x4d62('0x14'));var config=require(_0x4d62('0x15'));var db=require(_0x4d62('0x16'))['db'];function respondWithStatusCode(_0x277538,_0xc94193){_0xc94193=_0xc94193||0xcc;return function(_0x3d30a7){if(_0x3d30a7){return _0x277538[_0x4d62('0x17')](_0xc94193);}return _0x277538[_0x4d62('0x18')](_0xc94193)[_0x4d62('0x19')]();};}function respondWithResult(_0x530fb5,_0x117c68){_0x117c68=_0x117c68||0xc8;return function(_0x409910){if(_0x409910){return _0x530fb5[_0x4d62('0x18')](_0x117c68)['json'](_0x409910);}};}function respondWithFilteredResult(_0x31af1d,_0x1f3b54){return function(_0x142396){if(_0x142396){var _0x5e2cee=_0x142396['count'],_0x4974f4=_0x1f3b54['offset'],_0x36b786=_0x1f3b54[_0x4d62('0x1a')]+_0x1f3b54[_0x4d62('0x1b')],_0x1a7c65;if(_0x36b786>=_0x5e2cee){_0x36b786=_0x5e2cee;_0x1a7c65=0xc8;}else{_0x1a7c65=0xce;}_0x31af1d['status'](_0x1a7c65);return _0x31af1d[_0x4d62('0x1c')](_0x4d62('0x1d'),_0x4974f4+'-'+_0x36b786+'/'+_0x5e2cee)[_0x4d62('0x1e')](_0x142396);}return null;};}function patchUpdates(_0x1736f9){return function(_0x12e82e){try{jsonpatch[_0x4d62('0x1f')](_0x12e82e,_0x1736f9,!![]);}catch(_0x268ece){return BPromise[_0x4d62('0x20')](_0x268ece);}return _0x12e82e[_0x4d62('0x21')]();};}function saveUpdates(_0x3e656e,_0x494a8f){return function(_0x5d9e64){if(_0x5d9e64){return _0x5d9e64['update'](_0x3e656e)[_0x4d62('0x22')](function(_0x1cafd9){return _0x1cafd9;});}return null;};}function removeEntity(_0x5af192,_0x5a0796){return function(_0x3a5e4f){if(_0x3a5e4f){return _0x3a5e4f[_0x4d62('0x23')]()[_0x4d62('0x22')](function(){_0x5af192['status'](0xcc)[_0x4d62('0x19')]();});}};}function handleEntityNotFound(_0x30c443,_0x1a7ee9){return function(_0x57987b){if(!_0x57987b){_0x30c443[_0x4d62('0x17')](0x194);}return _0x57987b;};}function handleError(_0x1c7bc6,_0x4d4b94){_0x4d4b94=_0x4d4b94||0x1f4;return function(_0x16cff5){logger[_0x4d62('0x24')](_0x16cff5[_0x4d62('0x25')]);if(_0x16cff5[_0x4d62('0x26')]){delete _0x16cff5[_0x4d62('0x26')];}_0x1c7bc6[_0x4d62('0x18')](_0x4d4b94)[_0x4d62('0x27')](_0x16cff5);};}exports[_0x4d62('0x28')]=function(_0x181fe6,_0x474c69){var _0xb5036e={},_0x54536c={},_0x5c13aa={'count':0x0,'rows':[]};var _0x5174da=_[_0x4d62('0x29')](db['VtigerField'][_0x4d62('0x2a')],function(_0x2b76af){return{'name':_0x2b76af[_0x4d62('0x2b')],'type':_0x2b76af['type'][_0x4d62('0x2c')]};});_0x54536c['model']=_['map'](_0x5174da,_0x4d62('0x26'));_0x54536c['query']=_[_0x4d62('0x2d')](_0x181fe6[_0x4d62('0x2e')]);_0x54536c[_0x4d62('0x2f')]=_[_0x4d62('0x30')](_0x54536c[_0x4d62('0x31')],_0x54536c[_0x4d62('0x2e')]);_0xb5036e[_0x4d62('0x32')]=_[_0x4d62('0x30')](_0x54536c['model'],qs[_0x4d62('0x33')](_0x181fe6[_0x4d62('0x2e')][_0x4d62('0x33')]));_0xb5036e['attributes']=_0xb5036e[_0x4d62('0x32')]['length']?_0xb5036e['attributes']:_0x54536c['model'];if(!_0x181fe6[_0x4d62('0x2e')]['hasOwnProperty']('nolimit')){_0xb5036e['limit']=qs['limit'](_0x181fe6[_0x4d62('0x2e')][_0x4d62('0x1b')]);_0xb5036e[_0x4d62('0x1a')]=qs[_0x4d62('0x1a')](_0x181fe6[_0x4d62('0x2e')][_0x4d62('0x1a')]);}_0xb5036e[_0x4d62('0x34')]=qs[_0x4d62('0x35')](_0x181fe6[_0x4d62('0x2e')]['sort']);_0xb5036e[_0x4d62('0x36')]=qs['filters'](_['pick'](_0x181fe6['query'],_0x54536c[_0x4d62('0x2f')]),_0x5174da);if(_0x181fe6[_0x4d62('0x2e')][_0x4d62('0x37')]){_0xb5036e[_0x4d62('0x36')]=_[_0x4d62('0x38')](_0xb5036e[_0x4d62('0x36')],{'$or':_['map'](_0x5174da,function(_0x33bf61){if(_0x33bf61['type']!==_0x4d62('0x39')){var _0x19c094={};_0x19c094[_0x33bf61[_0x4d62('0x26')]]={'$like':'%'+_0x181fe6[_0x4d62('0x2e')]['filter']+'%'};return _0x19c094;}})});}_0xb5036e=_[_0x4d62('0x38')]({},_0xb5036e,_0x181fe6[_0x4d62('0x3a')]);var _0x4ccbe2={'where':_0xb5036e['where']};return db[_0x4d62('0x3b')][_0x4d62('0x3c')](_0x4ccbe2)[_0x4d62('0x22')](function(_0x550ca0){_0x5c13aa['count']=_0x550ca0;if(_0x181fe6['query']['includeAll']){_0xb5036e['include']=[{'all':!![]}];}return db['VtigerField'][_0x4d62('0x3d')](_0xb5036e);})[_0x4d62('0x22')](function(_0x3633e9){_0x5c13aa[_0x4d62('0x3e')]=_0x3633e9;return _0x5c13aa;})[_0x4d62('0x22')](respondWithFilteredResult(_0x474c69,_0xb5036e))['catch'](handleError(_0x474c69,null));};exports[_0x4d62('0x3f')]=function(_0x39a729,_0x50dd27){var _0x178d83={'raw':!![],'where':{'id':_0x39a729[_0x4d62('0x40')]['id']}},_0xda7aeb={};_0xda7aeb[_0x4d62('0x31')]=_[_0x4d62('0x2d')](db[_0x4d62('0x3b')]['rawAttributes']);_0xda7aeb[_0x4d62('0x2e')]=_['keys'](_0x39a729[_0x4d62('0x2e')]);_0xda7aeb[_0x4d62('0x2f')]=_['intersection'](_0xda7aeb[_0x4d62('0x31')],_0xda7aeb['query']);_0x178d83[_0x4d62('0x32')]=_[_0x4d62('0x30')](_0xda7aeb[_0x4d62('0x31')],qs[_0x4d62('0x33')](_0x39a729[_0x4d62('0x2e')]['fields']));_0x178d83[_0x4d62('0x32')]=_0x178d83[_0x4d62('0x32')][_0x4d62('0x41')]?_0x178d83[_0x4d62('0x32')]:_0xda7aeb[_0x4d62('0x31')];if(_0x39a729[_0x4d62('0x2e')][_0x4d62('0x42')]){_0x178d83[_0x4d62('0x43')]=[{'all':!![]}];}_0x178d83=_[_0x4d62('0x38')]({},_0x178d83,_0x39a729[_0x4d62('0x3a')]);return db[_0x4d62('0x3b')]['find'](_0x178d83)['then'](handleEntityNotFound(_0x50dd27,null))[_0x4d62('0x22')](respondWithResult(_0x50dd27,null))[_0x4d62('0x44')](handleError(_0x50dd27,null));};exports[_0x4d62('0x45')]=function(_0x3a8591,_0x2924fb){return db['VtigerField']['create'](_0x3a8591[_0x4d62('0x46')],{})[_0x4d62('0x22')](respondWithResult(_0x2924fb,0xc9))[_0x4d62('0x44')](handleError(_0x2924fb,null));};exports[_0x4d62('0x47')]=function(_0x3a8c7e,_0x514d3c){if(_0x3a8c7e['body']['id']){delete _0x3a8c7e[_0x4d62('0x46')]['id'];}return db['VtigerField'][_0x4d62('0x48')]({'where':{'id':_0x3a8c7e[_0x4d62('0x40')]['id']}})[_0x4d62('0x22')](handleEntityNotFound(_0x514d3c,null))['then'](saveUpdates(_0x3a8c7e[_0x4d62('0x46')],null))[_0x4d62('0x22')](respondWithResult(_0x514d3c,null))[_0x4d62('0x44')](handleError(_0x514d3c,null));};exports[_0x4d62('0x23')]=function(_0x315797,_0x2fc33e){return db[_0x4d62('0x3b')][_0x4d62('0x48')]({'where':{'id':_0x315797[_0x4d62('0x40')]['id']}})[_0x4d62('0x22')](handleEntityNotFound(_0x2fc33e,null))[_0x4d62('0x22')](removeEntity(_0x2fc33e,null))['catch'](handleError(_0x2fc33e,null));}; \ No newline at end of file +var _0xf403=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','error','send','index','map','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','include','VtigerField','show','params','includeAll','find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse'];(function(_0x36b151,_0x3a9fe1){var _0x533440=function(_0x2b4113){while(--_0x2b4113){_0x36b151['push'](_0x36b151['shift']());}};_0x533440(++_0x3a9fe1);}(_0xf403,0x1d3));var _0x3f40=function(_0x485a97,_0x1b1bf5){_0x485a97=_0x485a97-0x0;var _0x4e930d=_0xf403[_0x485a97];return _0x4e930d;};'use strict';var pdf=require(_0x3f40('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f40('0x1'));var zipdir=require(_0x3f40('0x2'));var jsonpatch=require(_0x3f40('0x3'));var rp=require(_0x3f40('0x4'));var moment=require(_0x3f40('0x5'));var BPromise=require(_0x3f40('0x6'));var Mustache=require(_0x3f40('0x7'));var util=require(_0x3f40('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3f40('0x9'));var ejs=require(_0x3f40('0xa'));var fs=require('fs');var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var db=require(_0x3f40('0x16'))['db'];function respondWithStatusCode(_0x5b54cf,_0x332635){_0x332635=_0x332635||0xcc;return function(_0x509c02){if(_0x509c02){return _0x5b54cf[_0x3f40('0x17')](_0x332635);}return _0x5b54cf[_0x3f40('0x18')](_0x332635)[_0x3f40('0x19')]();};}function respondWithResult(_0x316bdc,_0x569c6e){_0x569c6e=_0x569c6e||0xc8;return function(_0x2b2bfe){if(_0x2b2bfe){return _0x316bdc[_0x3f40('0x18')](_0x569c6e)[_0x3f40('0x1a')](_0x2b2bfe);}};}function respondWithFilteredResult(_0x1c9144,_0x232241){return function(_0x4e28b9){if(_0x4e28b9){var _0x2e51ed=_0x4e28b9['count'],_0x3d11c9=_0x232241[_0x3f40('0x1b')],_0x535f85=_0x232241[_0x3f40('0x1b')]+_0x232241[_0x3f40('0x1c')],_0x4ef80e;if(_0x535f85>=_0x2e51ed){_0x535f85=_0x2e51ed;_0x4ef80e=0xc8;}else{_0x4ef80e=0xce;}_0x1c9144[_0x3f40('0x18')](_0x4ef80e);return _0x1c9144[_0x3f40('0x1d')]('Content-Range',_0x3d11c9+'-'+_0x535f85+'/'+_0x2e51ed)[_0x3f40('0x1a')](_0x4e28b9);}return null;};}function patchUpdates(_0xaab367){return function(_0x464b26){try{jsonpatch[_0x3f40('0x1e')](_0x464b26,_0xaab367,!![]);}catch(_0x3129e2){return BPromise['reject'](_0x3129e2);}return _0x464b26[_0x3f40('0x1f')]();};}function saveUpdates(_0x5ae5d7,_0x12aabf){return function(_0x32b945){if(_0x32b945){return _0x32b945[_0x3f40('0x20')](_0x5ae5d7)[_0x3f40('0x21')](function(_0x628816){return _0x628816;});}return null;};}function removeEntity(_0x4aa559,_0x27f5a5){return function(_0x379b4e){if(_0x379b4e){return _0x379b4e[_0x3f40('0x22')]()[_0x3f40('0x21')](function(){_0x4aa559[_0x3f40('0x18')](0xcc)[_0x3f40('0x19')]();});}};}function handleEntityNotFound(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(!_0x59eb32){_0x4e1f47[_0x3f40('0x17')](0x194);}return _0x59eb32;};}function handleError(_0x4fed43,_0x2bc437){_0x2bc437=_0x2bc437||0x1f4;return function(_0x487b51){logger[_0x3f40('0x23')](_0x487b51['stack']);if(_0x487b51['name']){delete _0x487b51['name'];}_0x4fed43[_0x3f40('0x18')](_0x2bc437)[_0x3f40('0x24')](_0x487b51);};}exports[_0x3f40('0x25')]=function(_0x257833,_0x5b1079){var _0x300665={},_0x47ec1c={},_0x319997={'count':0x0,'rows':[]};var _0xbaf5d4=_[_0x3f40('0x26')](db['VtigerField'][_0x3f40('0x27')],function(_0x4b5ef7){return{'name':_0x4b5ef7[_0x3f40('0x28')],'type':_0x4b5ef7['type']['key']};});_0x47ec1c[_0x3f40('0x29')]=_[_0x3f40('0x26')](_0xbaf5d4,_0x3f40('0x2a'));_0x47ec1c[_0x3f40('0x2b')]=_[_0x3f40('0x2c')](_0x257833[_0x3f40('0x2b')]);_0x47ec1c[_0x3f40('0x2d')]=_[_0x3f40('0x2e')](_0x47ec1c['model'],_0x47ec1c[_0x3f40('0x2b')]);_0x300665[_0x3f40('0x2f')]=_[_0x3f40('0x2e')](_0x47ec1c[_0x3f40('0x29')],qs[_0x3f40('0x30')](_0x257833['query'][_0x3f40('0x30')]));_0x300665[_0x3f40('0x2f')]=_0x300665[_0x3f40('0x2f')]['length']?_0x300665[_0x3f40('0x2f')]:_0x47ec1c[_0x3f40('0x29')];if(!_0x257833[_0x3f40('0x2b')][_0x3f40('0x31')](_0x3f40('0x32'))){_0x300665[_0x3f40('0x1c')]=qs[_0x3f40('0x1c')](_0x257833[_0x3f40('0x2b')][_0x3f40('0x1c')]);_0x300665[_0x3f40('0x1b')]=qs[_0x3f40('0x1b')](_0x257833[_0x3f40('0x2b')][_0x3f40('0x1b')]);}_0x300665[_0x3f40('0x33')]=qs[_0x3f40('0x34')](_0x257833[_0x3f40('0x2b')][_0x3f40('0x34')]);_0x300665[_0x3f40('0x35')]=qs[_0x3f40('0x2d')](_[_0x3f40('0x36')](_0x257833[_0x3f40('0x2b')],_0x47ec1c[_0x3f40('0x2d')]),_0xbaf5d4);if(_0x257833[_0x3f40('0x2b')][_0x3f40('0x37')]){_0x300665[_0x3f40('0x35')]=_[_0x3f40('0x38')](_0x300665[_0x3f40('0x35')],{'$or':_[_0x3f40('0x26')](_0xbaf5d4,function(_0x411c98){if(_0x411c98[_0x3f40('0x39')]!=='VIRTUAL'){var _0x554a5c={};_0x554a5c[_0x411c98[_0x3f40('0x2a')]]={'$like':'%'+_0x257833[_0x3f40('0x2b')][_0x3f40('0x37')]+'%'};return _0x554a5c;}})});}_0x300665=_[_0x3f40('0x38')]({},_0x300665,_0x257833[_0x3f40('0x3a')]);var _0x215d00={'where':_0x300665[_0x3f40('0x35')]};return db['VtigerField'][_0x3f40('0x3b')](_0x215d00)['then'](function(_0x229bff){_0x319997[_0x3f40('0x3b')]=_0x229bff;if(_0x257833[_0x3f40('0x2b')]['includeAll']){_0x300665[_0x3f40('0x3c')]=[{'all':!![]}];}return db[_0x3f40('0x3d')]['findAll'](_0x300665);})[_0x3f40('0x21')](function(_0x180305){_0x319997['rows']=_0x180305;return _0x319997;})[_0x3f40('0x21')](respondWithFilteredResult(_0x5b1079,_0x300665))['catch'](handleError(_0x5b1079,null));};exports[_0x3f40('0x3e')]=function(_0x53ac15,_0x557f27){var _0x8e89a={'raw':!![],'where':{'id':_0x53ac15[_0x3f40('0x3f')]['id']}},_0x4bf783={};_0x4bf783[_0x3f40('0x29')]=_[_0x3f40('0x2c')](db[_0x3f40('0x3d')]['rawAttributes']);_0x4bf783[_0x3f40('0x2b')]=_['keys'](_0x53ac15[_0x3f40('0x2b')]);_0x4bf783[_0x3f40('0x2d')]=_[_0x3f40('0x2e')](_0x4bf783['model'],_0x4bf783['query']);_0x8e89a[_0x3f40('0x2f')]=_[_0x3f40('0x2e')](_0x4bf783[_0x3f40('0x29')],qs[_0x3f40('0x30')](_0x53ac15[_0x3f40('0x2b')][_0x3f40('0x30')]));_0x8e89a[_0x3f40('0x2f')]=_0x8e89a[_0x3f40('0x2f')]['length']?_0x8e89a[_0x3f40('0x2f')]:_0x4bf783['model'];if(_0x53ac15['query'][_0x3f40('0x40')]){_0x8e89a[_0x3f40('0x3c')]=[{'all':!![]}];}_0x8e89a=_[_0x3f40('0x38')]({},_0x8e89a,_0x53ac15[_0x3f40('0x3a')]);return db[_0x3f40('0x3d')][_0x3f40('0x41')](_0x8e89a)[_0x3f40('0x21')](handleEntityNotFound(_0x557f27,null))[_0x3f40('0x21')](respondWithResult(_0x557f27,null))[_0x3f40('0x42')](handleError(_0x557f27,null));};exports[_0x3f40('0x43')]=function(_0x3a504e,_0x10678b){return db[_0x3f40('0x3d')][_0x3f40('0x43')](_0x3a504e['body'],{})[_0x3f40('0x21')](respondWithResult(_0x10678b,0xc9))['catch'](handleError(_0x10678b,null));};exports[_0x3f40('0x20')]=function(_0x2f16d6,_0x50b268){if(_0x2f16d6[_0x3f40('0x44')]['id']){delete _0x2f16d6[_0x3f40('0x44')]['id'];}return db[_0x3f40('0x3d')][_0x3f40('0x41')]({'where':{'id':_0x2f16d6[_0x3f40('0x3f')]['id']}})[_0x3f40('0x21')](handleEntityNotFound(_0x50b268,null))[_0x3f40('0x21')](saveUpdates(_0x2f16d6[_0x3f40('0x44')],null))[_0x3f40('0x21')](respondWithResult(_0x50b268,null))[_0x3f40('0x42')](handleError(_0x50b268,null));};exports[_0x3f40('0x22')]=function(_0x364773,_0x1cfe4f){return db[_0x3f40('0x3d')][_0x3f40('0x41')]({'where':{'id':_0x364773[_0x3f40('0x3f')]['id']}})[_0x3f40('0x21')](handleEntityNotFound(_0x1cfe4f,null))[_0x3f40('0x21')](removeEntity(_0x1cfe4f,null))[_0x3f40('0x42')](handleError(_0x1cfe4f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5e72869..c00fe28 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 _0xf3cd=['int_vtiger_fields','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VtigerField'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5aa20c,_0x28b6ca){_0x5aa20c=_0x5aa20c-0x0;var _0x5d0a3a=_0xf3cd[_0x5aa20c];return _0x5d0a3a;};'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('./intVtigerField.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xdf3c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['request-promise','path','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x00bb,0x1d8));var _0xb00b=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x00bb[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[{'name':_0xb00b('0xb'),'fields':[_0xb00b('0xc'),_0xb00b('0xd')],'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 893a8bb..7afd097 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 _0x1d21=['../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x1d21,0x158));var _0x11d2=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0x1d21[_0x1602fb];return _0x461831;};'use strict';var _=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var moment=require(_0x11d2('0x2'));var BPromise=require(_0x11d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11d2('0x4'));var db=require(_0x11d2('0x5'))['db'];var utils=require(_0x11d2('0x6'));var logger=require(_0x11d2('0x7'))('rpc');var config=require(_0x11d2('0x8'));var jayson=require(_0x11d2('0x9'));var client=jayson[_0x11d2('0xa')][_0x11d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb6ca,_0x185dc4,_0x3a3713){return new BPromise(function(_0x4d8792,_0xd6d34c){return client[_0x11d2('0xc')](_0x1eb6ca,_0x3a3713)['then'](function(_0x3109ab){logger['info'](_0x11d2('0xd'),_0x185dc4,_0x11d2('0xe'));logger['debug'](_0x11d2('0xf'),_0x185dc4,_0x11d2('0xe'),JSON[_0x11d2('0x10')](_0x3109ab));if(_0x3109ab[_0x11d2('0x11')]){if(_0x3109ab['error']['code']===0x1f4){logger[_0x11d2('0x11')](_0x11d2('0xd'),_0x185dc4,_0x3109ab[_0x11d2('0x11')]['message']);return _0xd6d34c(_0x3109ab[_0x11d2('0x11')][_0x11d2('0x12')]);}logger[_0x11d2('0x11')](_0x11d2('0xd'),_0x185dc4,_0x3109ab['error'][_0x11d2('0x12')]);return _0x4d8792(_0x3109ab[_0x11d2('0x11')]['message']);}else{logger[_0x11d2('0x13')](_0x11d2('0xd'),_0x185dc4,_0x11d2('0xe'));_0x4d8792(_0x3109ab[_0x11d2('0x14')][_0x11d2('0x12')]);}})[_0x11d2('0x15')](function(_0x3e75f4){logger[_0x11d2('0x11')](_0x11d2('0xd'),_0x185dc4,_0x3e75f4);_0xd6d34c(_0x3e75f4);});});} \ No newline at end of file +var _0x30fc=['VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45b457,_0x576da6){var _0x4eb5f8=function(_0x27e4b7){while(--_0x27e4b7){_0x45b457['push'](_0x45b457['shift']());}};_0x4eb5f8(++_0x576da6);}(_0x30fc,0x64));var _0xc30f=function(_0x3412e0,_0x5c4e4f){_0x3412e0=_0x3412e0-0x0;var _0x479b68=_0x30fc[_0x3412e0];return _0x479b68;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var moment=require('moment');var BPromise=require(_0xc30f('0x2'));var rs=require(_0xc30f('0x3'));var fs=require('fs');var Redis=require(_0xc30f('0x4'));var db=require(_0xc30f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc30f('0x6'))(_0xc30f('0x7'));var config=require(_0xc30f('0x8'));var jayson=require(_0xc30f('0x9'));var client=jayson[_0xc30f('0xa')][_0xc30f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54c174,_0x23528c,_0x325a64){return new BPromise(function(_0x33a769,_0x3d2167){return client[_0xc30f('0xc')](_0x54c174,_0x325a64)[_0xc30f('0xd')](function(_0x436059){logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,'request\x20sent');logger[_0xc30f('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x23528c,_0xc30f('0x11'),JSON[_0xc30f('0x12')](_0x436059));if(_0x436059[_0xc30f('0x13')]){if(_0x436059[_0xc30f('0x13')][_0xc30f('0x14')]===0x1f4){logger[_0xc30f('0x13')]('VtigerField,\x20%s,\x20%s',_0x23528c,_0x436059['error'][_0xc30f('0x15')]);return _0x3d2167(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}logger[_0xc30f('0x13')]('VtigerField,\x20%s,\x20%s',_0x23528c,_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);return _0x33a769(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}else{logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,_0xc30f('0x11'));_0x33a769(_0x436059['result']['message']);}})[_0xc30f('0x16')](function(_0x1b02c5){logger[_0xc30f('0x13')](_0xc30f('0xf'),_0x23528c,_0x1b02c5);_0x3d2167(_0x1b02c5);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0e7e6c7..2ceb511 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 _0x46f4=['../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','/:id','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x46f4,0xb9));var _0x446f=function(_0x22c242,_0x3182a6){_0x22c242=_0x22c242-0x0;var _0x48ba73=_0x46f4[_0x22c242];return _0x48ba73;};'use strict';var multer=require(_0x446f('0x0'));var util=require('util');var path=require(_0x446f('0x1'));var timeout=require(_0x446f('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x446f('0x3'));var interaction=require(_0x446f('0x4'));var config=require(_0x446f('0x5'));var controller=require(_0x446f('0x6'));router[_0x446f('0x7')]('/',auth[_0x446f('0x8')](),controller['index']);router[_0x446f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x446f('0x9')]);router[_0x446f('0x7')](_0x446f('0xa'),auth[_0x446f('0x8')](),controller[_0x446f('0xb')]);router[_0x446f('0x7')](_0x446f('0xc'),auth[_0x446f('0x8')](),controller[_0x446f('0xd')]);router['post']('/',auth[_0x446f('0x8')](),controller['create']);router['post'](_0x446f('0xa'),auth[_0x446f('0x8')](),controller[_0x446f('0xe')]);router[_0x446f('0xf')](_0x446f('0x10'),auth[_0x446f('0x8')](),controller['update']);router['delete'](_0x446f('0x10'),auth[_0x446f('0x8')](),controller[_0x446f('0x11')]);module[_0x446f('0x12')]=router; \ No newline at end of file +var _0xc5a3=['/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id'];(function(_0x542a5d,_0x27e6c8){var _0x251378=function(_0x295247){while(--_0x295247){_0x542a5d['push'](_0x542a5d['shift']());}};_0x251378(++_0x27e6c8);}(_0xc5a3,0x121));var _0x3c5a=function(_0x22d8b6,_0x368a0b){_0x22d8b6=_0x22d8b6-0x0;var _0x10315c=_0xc5a3[_0x22d8b6];return _0x10315c;};'use strict';var multer=require(_0x3c5a('0x0'));var util=require(_0x3c5a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c5a('0x2'));var router=express[_0x3c5a('0x3')]();var auth=require(_0x3c5a('0x4'));var interaction=require(_0x3c5a('0x5'));var config=require(_0x3c5a('0x6'));var controller=require(_0x3c5a('0x7'));router[_0x3c5a('0x8')]('/',auth[_0x3c5a('0x9')](),controller['index']);router[_0x3c5a('0x8')](_0x3c5a('0xa'),auth[_0x3c5a('0x9')](),controller['show']);router['get'](_0x3c5a('0xb'),auth[_0x3c5a('0x9')](),controller['getConfigurations']);router[_0x3c5a('0x8')](_0x3c5a('0xc'),auth[_0x3c5a('0x9')](),controller['getFields']);router[_0x3c5a('0xd')]('/',auth['isAuthenticated'](),controller[_0x3c5a('0xe')]);router[_0x3c5a('0xd')](_0x3c5a('0xb'),auth[_0x3c5a('0x9')](),controller[_0x3c5a('0xf')]);router[_0x3c5a('0x10')](_0x3c5a('0xa'),auth['isAuthenticated'](),controller[_0x3c5a('0x11')]);router[_0x3c5a('0x12')]('/:id',auth[_0x3c5a('0x9')](),controller['destroy']);module[_0x3c5a('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 6d215cb..f32fae3 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 _0xdf28=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports'];(function(_0x9ab7c8,_0x10bf61){var _0x55d83c=function(_0x48ab72){while(--_0x48ab72){_0x9ab7c8['push'](_0x9ab7c8['shift']());}};_0x55d83c(++_0x10bf61);}(_0xdf28,0x142));var _0x8df2=function(_0x53cf89,_0x437980){_0x53cf89=_0x53cf89-0x0;var _0x4928de=_0xdf28[_0x53cf89];return _0x4928de;};'use strict';var Sequelize=require(_0x8df2('0x0'));module[_0x8df2('0x1')]={'name':{'type':Sequelize[_0x8df2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x8df2('0x3')},'password':{'type':Sequelize[_0x8df2('0x2')]},'token':{'type':Sequelize[_0x8df2('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8df2('0x4')},'authType':{'type':Sequelize[_0x8df2('0x5')](_0x8df2('0x6'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8df2('0x5')](_0x8df2('0x7'),_0x8df2('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x98b7=['sequelize','exports','STRING','remoteUri','password','token','integrationTab','newTab'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x98b7,0xc0));var _0x798b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x98b7[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x798b('0x0'));module[_0x798b('0x1')]={'name':{'type':Sequelize[_0x798b('0x2')]},'description':{'type':Sequelize[_0x798b('0x2')]},'username':{'type':Sequelize[_0x798b('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x798b('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x798b('0x2')],'unique':_0x798b('0x3')},'authType':{'type':Sequelize['ENUM'](_0x798b('0x4'),_0x798b('0x5')),'defaultValue':_0x798b('0x4')},'serverUrl':{'type':Sequelize[_0x798b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x798b('0x6'),_0x798b('0x7')),'defaultValue':_0x798b('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 4150629..2297afb 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 _0x30ee=['%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','username','base64','token','toString','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','order','addConfiguration','AccountId','getSubjects','channel','ZendeskField','Descriptions','getFields','authType','remoteUri','slice','substring','GET','format'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0x30ee,0x1a3));var _0xe30e=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x30ee[_0x383627];return _0x2c16a0;};'use strict';var pdf=require(_0xe30e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe30e('0x1'));var jsonpatch=require(_0xe30e('0x2'));var rp=require(_0xe30e('0x3'));var moment=require(_0xe30e('0x4'));var BPromise=require(_0xe30e('0x5'));var Mustache=require(_0xe30e('0x6'));var util=require(_0xe30e('0x7'));var path=require(_0xe30e('0x8'));var sox=require(_0xe30e('0x9'));var csv=require(_0xe30e('0xa'));var ejs=require(_0xe30e('0xb'));var fs=require('fs');var _=require(_0xe30e('0xc'));var squel=require(_0xe30e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe30e('0xe'));var deskjs=require(_0xe30e('0xf'));var toCsv=require(_0xe30e('0xa'));var querystring=require(_0xe30e('0x10'));var Papa=require(_0xe30e('0x11'));var Redis=require(_0xe30e('0x12'));var authService=require(_0xe30e('0x13'));var qs=require(_0xe30e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe30e('0x15'))(_0xe30e('0x16'));var utils=require(_0xe30e('0x17'));var config=require(_0xe30e('0x18'));var db=require(_0xe30e('0x19'))['db'];var integrations=require(_0xe30e('0x1a'));var jayson=require(_0xe30e('0x1b'));var client=jayson[_0xe30e('0x1c')][_0xe30e('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2cb923,_0x57b44e,_0x57085c){if(_0x57085c){var _0x11b6c1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11b6c1[_0xe30e('0x1e')](_0x57b44e)){return _0x2cb923;}else{throw new db[(_0xe30e('0x1f'))][(_0xe30e('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 _0x2cb923;}}function respondWithRpcPromise(_0x2cf371,_0x319eb1,_0x15118d,_0x1a0be5){return new BPromise(function(_0x30972d,_0xe8a803){var _0x232a98=_0x1a0be5||client;return _0x232a98['request'](_0x2cf371,_0x15118d)[_0xe30e('0x21')](function(_0xf71025){logger['info'](_0xe30e('0x22'),_0x319eb1,_0xe30e('0x23'));logger[_0xe30e('0x24')](_0xe30e('0x25'),_0x319eb1,_0xe30e('0x23'),JSON[_0xe30e('0x26')](_0xf71025));if(_0xf71025[_0xe30e('0x27')]){if(_0xf71025['error'][_0xe30e('0x28')]===0x1f4){logger['error'](_0xe30e('0x22'),_0x319eb1,_0xf71025[_0xe30e('0x27')][_0xe30e('0x29')]);return _0xe8a803(_0xf71025[_0xe30e('0x27')][_0xe30e('0x29')]);}logger[_0xe30e('0x27')](_0xe30e('0x22'),_0x319eb1,_0xf71025['error']['message']);return _0x30972d(_0xf71025[_0xe30e('0x27')]['message']);}else{logger[_0xe30e('0x2a')]('ZendeskAccount,\x20%s,\x20%s',_0x319eb1,_0xe30e('0x23'));_0x30972d(_0xf71025[_0xe30e('0x2b')][_0xe30e('0x29')]);}})['catch'](function(_0xe46f6){logger['error'](_0xe30e('0x22'),_0x319eb1,_0xe46f6);_0xe8a803(_0xe46f6);});});}function respondWithStatusCode(_0x23c58e,_0x3c3724){_0x3c3724=_0x3c3724||0xcc;return function(_0x56a804){if(_0x56a804){return _0x23c58e[_0xe30e('0x2c')](_0x3c3724);}return _0x23c58e[_0xe30e('0x2d')](_0x3c3724)[_0xe30e('0x2e')]();};}function respondWithResult(_0x8cff7f,_0x4dd9c2){_0x4dd9c2=_0x4dd9c2||0xc8;return function(_0x3c7d66){if(_0x3c7d66){return _0x8cff7f['status'](_0x4dd9c2)[_0xe30e('0x2f')](_0x3c7d66);}};}function respondWithFilteredResult(_0x5eed3f,_0x62e4c){return function(_0x43565c){if(_0x43565c){var _0x5718fc=_0x43565c[_0xe30e('0x30')],_0x105cbe=_0x62e4c[_0xe30e('0x31')],_0x5e2f79=_0x62e4c[_0xe30e('0x31')]+_0x62e4c[_0xe30e('0x32')],_0x5bbd29;if(_0x5e2f79>=_0x5718fc){_0x5e2f79=_0x5718fc;_0x5bbd29=0xc8;}else{_0x5bbd29=0xce;}_0x5eed3f['status'](_0x5bbd29);return _0x5eed3f[_0xe30e('0x33')](_0xe30e('0x34'),_0x105cbe+'-'+_0x5e2f79+'/'+_0x5718fc)[_0xe30e('0x2f')](_0x43565c);}return null;};}function patchUpdates(_0x9bb103){return function(_0x3b9d14){try{jsonpatch['apply'](_0x3b9d14,_0x9bb103,!![]);}catch(_0x37770f){return BPromise[_0xe30e('0x35')](_0x37770f);}return _0x3b9d14[_0xe30e('0x36')]();};}function saveUpdates(_0x296866,_0x5974b7){return function(_0x11ba39){if(_0x11ba39){return _0x11ba39[_0xe30e('0x37')](_0x296866)[_0xe30e('0x21')](function(_0x4528cd){return _0x4528cd;});}return null;};}function removeEntity(_0x19abad,_0xcb6b47){return function(_0x106ab7){if(_0x106ab7){return _0x106ab7['destroy']()[_0xe30e('0x21')](function(){_0x19abad['status'](0xcc)[_0xe30e('0x2e')]();});}};}function handleEntityNotFound(_0xc2feb5,_0x532ce7){return function(_0x1d7a13){if(!_0x1d7a13){_0xc2feb5[_0xe30e('0x2c')](0x194);}return _0x1d7a13;};}function handleError(_0x195c53,_0x43523c){_0x43523c=_0x43523c||0x1f4;return function(_0x3d2c40){logger[_0xe30e('0x27')](_0x3d2c40[_0xe30e('0x38')]);if(_0x3d2c40[_0xe30e('0x39')]){delete _0x3d2c40[_0xe30e('0x39')];}_0x195c53['status'](_0x43523c)['send'](_0x3d2c40);};}exports[_0xe30e('0x3a')]=function(_0xf0aa37,_0x201ccd){var _0x4a6b58={},_0x40bd24={},_0x3cd97a={'count':0x0,'rows':[]};var _0x516682=_[_0xe30e('0x3b')](db[_0xe30e('0x3c')][_0xe30e('0x3d')],function(_0x5596da){return{'name':_0x5596da[_0xe30e('0x3e')],'type':_0x5596da['type'][_0xe30e('0x3f')]};});_0x40bd24[_0xe30e('0x40')]=_[_0xe30e('0x3b')](_0x516682,_0xe30e('0x39'));_0x40bd24[_0xe30e('0x41')]=_['keys'](_0xf0aa37[_0xe30e('0x41')]);_0x40bd24[_0xe30e('0x42')]=_['intersection'](_0x40bd24[_0xe30e('0x40')],_0x40bd24['query']);_0x4a6b58[_0xe30e('0x43')]=_[_0xe30e('0x44')](_0x40bd24[_0xe30e('0x40')],qs[_0xe30e('0x45')](_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x45')]));_0x4a6b58[_0xe30e('0x43')]=_0x4a6b58[_0xe30e('0x43')][_0xe30e('0x46')]?_0x4a6b58['attributes']:_0x40bd24[_0xe30e('0x40')];if(!_0xf0aa37['query'][_0xe30e('0x47')](_0xe30e('0x48'))){_0x4a6b58[_0xe30e('0x32')]=qs['limit'](_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x32')]);_0x4a6b58['offset']=qs[_0xe30e('0x31')](_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x31')]);}_0x4a6b58['order']=qs[_0xe30e('0x49')](_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x49')]);_0x4a6b58[_0xe30e('0x4a')]=qs[_0xe30e('0x42')](_[_0xe30e('0x4b')](_0xf0aa37[_0xe30e('0x41')],_0x40bd24['filters']),_0x516682);if(_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x4c')]){_0x4a6b58[_0xe30e('0x4a')]=_[_0xe30e('0x4d')](_0x4a6b58[_0xe30e('0x4a')],{'$or':_[_0xe30e('0x3b')](_0x516682,function(_0x1b063d){if(_0x1b063d[_0xe30e('0x4e')]!==_0xe30e('0x4f')){var _0x749652={};_0x749652[_0x1b063d['name']]={'$like':'%'+_0xf0aa37[_0xe30e('0x41')][_0xe30e('0x4c')]+'%'};return _0x749652;}})});}_0x4a6b58=_[_0xe30e('0x4d')]({},_0x4a6b58,_0xf0aa37[_0xe30e('0x50')]);var _0x233632={'where':_0x4a6b58[_0xe30e('0x4a')]};return db[_0xe30e('0x3c')][_0xe30e('0x30')](_0x233632)[_0xe30e('0x21')](function(_0x353e00){_0x3cd97a[_0xe30e('0x30')]=_0x353e00;if(_0xf0aa37['query']['includeAll']){_0x4a6b58[_0xe30e('0x51')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x4a6b58);})[_0xe30e('0x21')](function(_0x1f9109){_0x3cd97a[_0xe30e('0x52')]=_0x1f9109;return _0x3cd97a;})[_0xe30e('0x21')](respondWithFilteredResult(_0x201ccd,_0x4a6b58))['catch'](handleError(_0x201ccd,null));};exports[_0xe30e('0x53')]=function(_0xb42f2d,_0x5bfebf){var _0x4a8462={'raw':![],'where':{'id':_0xb42f2d[_0xe30e('0x54')]['id']}},_0xc5e94c={};_0xc5e94c[_0xe30e('0x40')]=_[_0xe30e('0x55')](db['ZendeskAccount'][_0xe30e('0x3d')]);_0xc5e94c[_0xe30e('0x41')]=_[_0xe30e('0x55')](_0xb42f2d[_0xe30e('0x41')]);_0xc5e94c[_0xe30e('0x42')]=_[_0xe30e('0x44')](_0xc5e94c[_0xe30e('0x40')],_0xc5e94c[_0xe30e('0x41')]);_0x4a8462[_0xe30e('0x43')]=_['intersection'](_0xc5e94c[_0xe30e('0x40')],qs[_0xe30e('0x45')](_0xb42f2d['query'][_0xe30e('0x45')]));_0x4a8462[_0xe30e('0x43')]=_0x4a8462[_0xe30e('0x43')][_0xe30e('0x46')]?_0x4a8462[_0xe30e('0x43')]:_0xc5e94c[_0xe30e('0x40')];if(_0xb42f2d[_0xe30e('0x41')][_0xe30e('0x56')]){_0x4a8462[_0xe30e('0x51')]=[{'all':!![]}];}_0x4a8462=_['merge']({},_0x4a8462,_0xb42f2d[_0xe30e('0x50')]);return db[_0xe30e('0x3c')][_0xe30e('0x57')](_0x4a8462)[_0xe30e('0x21')](handleEntityNotFound(_0x5bfebf,null))[_0xe30e('0x21')](respondWithResult(_0x5bfebf,null))[_0xe30e('0x58')](handleError(_0x5bfebf,null));};exports[_0xe30e('0x59')]=function(_0x1787c3,_0x18fe4b){return db[_0xe30e('0x3c')][_0xe30e('0x59')](_0x1787c3[_0xe30e('0x5a')],{})[_0xe30e('0x21')](respondWithResult(_0x18fe4b,0xc9))['catch'](handleError(_0x18fe4b,null));};exports[_0xe30e('0x37')]=function(_0x312104,_0x514c9f){if(_0x312104[_0xe30e('0x5a')]['id']){delete _0x312104['body']['id'];}return db[_0xe30e('0x3c')][_0xe30e('0x57')]({'where':{'id':_0x312104['params']['id']}})[_0xe30e('0x21')](handleEntityNotFound(_0x514c9f,null))[_0xe30e('0x21')](saveUpdates(_0x312104[_0xe30e('0x5a')],null))[_0xe30e('0x21')](respondWithResult(_0x514c9f,null))[_0xe30e('0x58')](handleError(_0x514c9f,null));};exports[_0xe30e('0x5b')]=function(_0x3e79c0,_0x2a30c7){return db[_0xe30e('0x3c')][_0xe30e('0x57')]({'where':{'id':_0x3e79c0['params']['id']}})['then'](handleEntityNotFound(_0x2a30c7,null))['then'](removeEntity(_0x2a30c7,null))[_0xe30e('0x58')](handleError(_0x2a30c7,null));};exports[_0xe30e('0x5c')]=function(_0xa1466c,_0x2b41c5,_0x240666){var _0x322753={};var _0xb1ed00={};var _0x410e2b;var _0x40b428;return db[_0xe30e('0x3c')][_0xe30e('0x5d')]({'where':{'id':_0xa1466c[_0xe30e('0x54')]['id']}})[_0xe30e('0x21')](handleEntityNotFound(_0x2b41c5,null))[_0xe30e('0x21')](function(_0x3191d4){if(_0x3191d4){_0x410e2b=_0x3191d4;_0xb1ed00[_0xe30e('0x40')]=_['keys'](db[_0xe30e('0x5e')][_0xe30e('0x3d')]);_0xb1ed00['query']=_[_0xe30e('0x55')](_0xa1466c[_0xe30e('0x41')]);_0xb1ed00[_0xe30e('0x42')]=_[_0xe30e('0x44')](_0xb1ed00[_0xe30e('0x40')],_0xb1ed00[_0xe30e('0x41')]);_0x322753['attributes']=_[_0xe30e('0x44')](_0xb1ed00[_0xe30e('0x40')],qs[_0xe30e('0x45')](_0xa1466c[_0xe30e('0x41')][_0xe30e('0x45')]));_0x322753['attributes']=_0x322753[_0xe30e('0x43')]['length']?_0x322753[_0xe30e('0x43')]:_0xb1ed00[_0xe30e('0x40')];_0x322753[_0xe30e('0x5f')]=qs['sort'](_0xa1466c[_0xe30e('0x41')]['sort']);_0x322753[_0xe30e('0x4a')]=qs[_0xe30e('0x42')](_[_0xe30e('0x4b')](_0xa1466c[_0xe30e('0x41')],_0xb1ed00[_0xe30e('0x42')]));if(_0xa1466c[_0xe30e('0x41')][_0xe30e('0x4c')]){_0x322753[_0xe30e('0x4a')]=_[_0xe30e('0x4d')](_0x322753[_0xe30e('0x4a')],{'$or':_[_0xe30e('0x3b')](_0x322753['attributes'],function(_0x3b3616){var _0x150fab={};_0x150fab[_0x3b3616]={'$like':'%'+_0xa1466c[_0xe30e('0x41')][_0xe30e('0x4c')]+'%'};return _0x150fab;})});}_0x322753=_[_0xe30e('0x4d')]({},_0x322753,_0xa1466c[_0xe30e('0x50')]);return _0x410e2b[_0xe30e('0x5c')](_0x322753);}})[_0xe30e('0x21')](function(_0x4e3a2c){if(_0x4e3a2c){_0x40b428=_0x4e3a2c[_0xe30e('0x46')];if(!_0xa1466c[_0xe30e('0x41')][_0xe30e('0x47')]('nolimit')){_0x322753[_0xe30e('0x32')]=qs[_0xe30e('0x32')](_0xa1466c[_0xe30e('0x41')][_0xe30e('0x32')]);_0x322753[_0xe30e('0x31')]=qs[_0xe30e('0x31')](_0xa1466c['query'][_0xe30e('0x31')]);}return _0x410e2b[_0xe30e('0x5c')](_0x322753);}})[_0xe30e('0x21')](function(_0x4bf09b){if(_0x4bf09b){return _0x4bf09b?{'count':_0x40b428,'rows':_0x4bf09b}:null;}})['then'](respondWithResult(_0x2b41c5,null))[_0xe30e('0x58')](handleError(_0x2b41c5,null));};exports[_0xe30e('0x60')]=function(_0x576277,_0x5ea696,_0x34a8a0){if(_0x576277[_0xe30e('0x5a')]['id']){delete _0x576277[_0xe30e('0x5a')]['id'];}return db[_0xe30e('0x3c')][_0xe30e('0x5d')]({'where':{'id':_0x576277[_0xe30e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ea696,null))['then'](function(_0x2d18d4){if(_0x2d18d4){_0x576277[_0xe30e('0x5a')][_0xe30e('0x61')]=_0x2d18d4['id'];_0x576277[_0xe30e('0x5a')]['Subjects']=integrations[_0xe30e('0x62')](_0x576277[_0xe30e('0x5a')][_0xe30e('0x63')],_0x576277[_0xe30e('0x5a')]['type']);_0x576277['body']['Descriptions']=integrations['getDescriptions'](_0x576277['body']['channel'],_0x576277[_0xe30e('0x5a')][_0xe30e('0x4e')]);return db['ZendeskConfiguration']['create'](_0x576277[_0xe30e('0x5a')],{'include':[{'model':db[_0xe30e('0x64')],'as':'Subjects'},{'model':db[_0xe30e('0x64')],'as':_0xe30e('0x65')}]});}return null;})[_0xe30e('0x21')](respondWithResult(_0x5ea696,null))['catch'](handleError(_0x5ea696,null));};exports[_0xe30e('0x66')]=function(_0x2f1534,_0x5dd590,_0x741715){var _0x50bf8b='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x2f1534[_0xe30e('0x54')]['id']},'attributes':['id','username','password','token',_0xe30e('0x67'),_0xe30e('0x68')]})['then'](handleEntityNotFound(_0x5dd590,null))[_0xe30e('0x21')](function(_0x44710e){if(_0x44710e){_0x50bf8b=_0x44710e['remoteUri'];var _0x38f755=_0x50bf8b[_0xe30e('0x69')](-0x1);if(_0x38f755==='/'){_0x50bf8b=_0x50bf8b[_0xe30e('0x6a')](0x0,_0x50bf8b['lastIndexOf'](_0x38f755));}var _0x18395c={'method':_0xe30e('0x6b'),'uri':util[_0xe30e('0x6c')](_0xe30e('0x6d'),_0x50bf8b,_0xe30e('0x6e')),'json':!![]};switch(_0x44710e[_0xe30e('0x67')]){case _0xe30e('0x6f'):_0x18395c[_0xe30e('0x70')]={'Authorization':util['format'](_0xe30e('0x71'),new Buffer(util[_0xe30e('0x6c')](_0xe30e('0x72'),_0x44710e[_0xe30e('0x73')],_0x44710e['password']))['toString'](_0xe30e('0x74')))};break;case _0xe30e('0x75'):_0x18395c[_0xe30e('0x70')]={'Authorization':util['format'](_0xe30e('0x71'),new Buffer(util[_0xe30e('0x6c')]('%s/token:%s',_0x44710e[_0xe30e('0x73')],_0x44710e[_0xe30e('0x75')]))[_0xe30e('0x76')]('base64'))};break;default:throw new db[(_0xe30e('0x1f'))][(_0xe30e('0x20'))](_0xe30e('0x77'));}return rp(_0x18395c);}})[_0xe30e('0x21')](function(_0xa0cb98){if(_0xa0cb98){var _0x40338f=[_0xe30e('0x78'),_0xe30e('0x79'),_0xe30e('0x7a'),_0xe30e('0x7b')];_[_0xe30e('0x7c')](_0xa0cb98[_0xe30e('0x6e')],function(_0x2d15e5){return _0x40338f[_0xe30e('0x7d')](_0x2d15e5[_0xe30e('0x4e')]);});return{'count':_0xa0cb98[_0xe30e('0x6e')][_0xe30e('0x46')],'rows':_[_0xe30e('0x3b')](_0xa0cb98[_0xe30e('0x6e')],function(_0x3974e5){return{'id':_0x3974e5['id'],'name':_0x3974e5['position']>0x7?_0x3974e5[_0xe30e('0x7e')]:_0x3974e5[_0xe30e('0x4e')],'custom':_0x3974e5['position']>0x7?!![]:![],'options':_0x3974e5[_0xe30e('0x7f')]?_0x3974e5[_0xe30e('0x7f')]:_0x3974e5['custom_field_options']?_0x3974e5[_0xe30e('0x80')]:[]};})};}})[_0xe30e('0x21')](respondWithResult(_0x5dd590,null))[_0xe30e('0x58')](function(_0x2bc605){var _0x20c96d=_0x2f1534[_0xe30e('0x41')]['test']?0x1f4:_0x2bc605['statusCode']||0x1f4;logger[_0xe30e('0x27')](_0xe30e('0x81'),_0xe30e('0x66'),_0x20c96d,JSON[_0xe30e('0x26')](_0x2bc605));delete _0x2bc605[_0xe30e('0x39')];if(_0x20c96d===0x191){_0x20c96d=0x190;}_0x5dd590[_0xe30e('0x2d')](_0x20c96d)[_0xe30e('0x82')](_0x2f1534[_0xe30e('0x41')][_0xe30e('0x1e')]?{'message':_0xe30e('0x83'),'statusCode':_0x2bc605['statusCode']}:_0x2bc605);});}; \ No newline at end of file +var _0x31d3=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','../../components/integrations/configuration','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','set','reject','save','update','stack','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','options','find','create','body','params','destroy','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','position','title','system_field_options','custom_field_options','statusCode','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv'];(function(_0x17e006,_0x10b1b2){var _0x49453f=function(_0x55556c){while(--_0x55556c){_0x17e006['push'](_0x17e006['shift']());}};_0x49453f(++_0x10b1b2);}(_0x31d3,0x159));var _0x331d=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x31d3[_0x44a3b0];return _0x39e6f6;};'use strict';var pdf=require(_0x331d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x331d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x331d('0x2'));var rp=require('request-promise');var moment=require(_0x331d('0x3'));var BPromise=require(_0x331d('0x4'));var Mustache=require(_0x331d('0x5'));var util=require(_0x331d('0x6'));var path=require(_0x331d('0x7'));var sox=require(_0x331d('0x8'));var csv=require('to-csv');var ejs=require(_0x331d('0x9'));var fs=require('fs');var _=require(_0x331d('0xa'));var squel=require(_0x331d('0xb'));var crypto=require(_0x331d('0xc'));var jsforce=require(_0x331d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x331d('0xe'));var querystring=require(_0x331d('0xf'));var Papa=require(_0x331d('0x10'));var Redis=require(_0x331d('0x11'));var authService=require(_0x331d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x331d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x331d('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x331d('0x15'))['db'];var integrations=require(_0x331d('0x16'));var jayson=require('jayson/promise');var client=jayson['client'][_0x331d('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1a1877,_0x31f410,_0x50b8ee){if(_0x50b8ee){var _0x979b59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x979b59[_0x331d('0x18')](_0x31f410)){return _0x1a1877;}else{throw new db[(_0x331d('0x19'))]['ValidationError'](_0x331d('0x1a'));}}else{return _0x1a1877;}}function respondWithRpcPromise(_0x2a4a0d,_0x3534f6,_0x27e7c5,_0x1f18b4){return new BPromise(function(_0x4ca3bf,_0x59cc9d){var _0x2879f7=_0x1f18b4||client;return _0x2879f7['request'](_0x2a4a0d,_0x27e7c5)[_0x331d('0x1b')](function(_0x480e88){logger['info'](_0x331d('0x1c'),_0x3534f6,_0x331d('0x1d'));logger[_0x331d('0x1e')](_0x331d('0x1f'),_0x3534f6,_0x331d('0x1d'),JSON['stringify'](_0x480e88));if(_0x480e88[_0x331d('0x20')]){if(_0x480e88[_0x331d('0x20')][_0x331d('0x21')]===0x1f4){logger['error'](_0x331d('0x1c'),_0x3534f6,_0x480e88['error'][_0x331d('0x22')]);return _0x59cc9d(_0x480e88[_0x331d('0x20')]['message']);}logger[_0x331d('0x20')](_0x331d('0x1c'),_0x3534f6,_0x480e88['error'][_0x331d('0x22')]);return _0x4ca3bf(_0x480e88[_0x331d('0x20')][_0x331d('0x22')]);}else{logger[_0x331d('0x23')](_0x331d('0x1c'),_0x3534f6,_0x331d('0x1d'));_0x4ca3bf(_0x480e88[_0x331d('0x24')]['message']);}})[_0x331d('0x25')](function(_0xbd0bdf){logger[_0x331d('0x20')](_0x331d('0x1c'),_0x3534f6,_0xbd0bdf);_0x59cc9d(_0xbd0bdf);});});}function respondWithStatusCode(_0x5ee113,_0x202035){_0x202035=_0x202035||0xcc;return function(_0xce1d78){if(_0xce1d78){return _0x5ee113[_0x331d('0x26')](_0x202035);}return _0x5ee113[_0x331d('0x27')](_0x202035)[_0x331d('0x28')]();};}function respondWithResult(_0xb783d3,_0x249874){_0x249874=_0x249874||0xc8;return function(_0x7c9a64){if(_0x7c9a64){return _0xb783d3['status'](_0x249874)[_0x331d('0x29')](_0x7c9a64);}};}function respondWithFilteredResult(_0x5acada,_0xd6ec8){return function(_0x1dba34){if(_0x1dba34){var _0x2b06b1=_0x1dba34[_0x331d('0x2a')],_0x506faf=_0xd6ec8[_0x331d('0x2b')],_0x528bf5=_0xd6ec8['offset']+_0xd6ec8['limit'],_0x5c1c87;if(_0x528bf5>=_0x2b06b1){_0x528bf5=_0x2b06b1;_0x5c1c87=0xc8;}else{_0x5c1c87=0xce;}_0x5acada['status'](_0x5c1c87);return _0x5acada[_0x331d('0x2c')]('Content-Range',_0x506faf+'-'+_0x528bf5+'/'+_0x2b06b1)['json'](_0x1dba34);}return null;};}function patchUpdates(_0x526d44){return function(_0x534f03){try{jsonpatch['apply'](_0x534f03,_0x526d44,!![]);}catch(_0x32529b){return BPromise[_0x331d('0x2d')](_0x32529b);}return _0x534f03[_0x331d('0x2e')]();};}function saveUpdates(_0x5b1061,_0x2222e2){return function(_0x481857){if(_0x481857){return _0x481857[_0x331d('0x2f')](_0x5b1061)['then'](function(_0x5b7e88){return _0x5b7e88;});}return null;};}function removeEntity(_0x5b3877,_0x250821){return function(_0x3e5e3f){if(_0x3e5e3f){return _0x3e5e3f['destroy']()['then'](function(){_0x5b3877['status'](0xcc)[_0x331d('0x28')]();});}};}function handleEntityNotFound(_0x50ea3f,_0x22e342){return function(_0x1e274c){if(!_0x1e274c){_0x50ea3f[_0x331d('0x26')](0x194);}return _0x1e274c;};}function handleError(_0x9d6b96,_0x3c1ed7){_0x3c1ed7=_0x3c1ed7||0x1f4;return function(_0x4cfe80){logger[_0x331d('0x20')](_0x4cfe80[_0x331d('0x30')]);if(_0x4cfe80[_0x331d('0x31')]){delete _0x4cfe80[_0x331d('0x31')];}_0x9d6b96[_0x331d('0x27')](_0x3c1ed7)[_0x331d('0x32')](_0x4cfe80);};}exports['index']=function(_0x165820,_0x1f0968){var _0xc1b3f2={},_0x3da6ff={},_0x2b20d6={'count':0x0,'rows':[]};var _0x469601=_[_0x331d('0x33')](db[_0x331d('0x34')][_0x331d('0x35')],function(_0x53c0b1){return{'name':_0x53c0b1[_0x331d('0x36')],'type':_0x53c0b1[_0x331d('0x37')]['key']};});_0x3da6ff[_0x331d('0x38')]=_[_0x331d('0x33')](_0x469601,'name');_0x3da6ff['query']=_[_0x331d('0x39')](_0x165820[_0x331d('0x3a')]);_0x3da6ff[_0x331d('0x3b')]=_[_0x331d('0x3c')](_0x3da6ff[_0x331d('0x38')],_0x3da6ff[_0x331d('0x3a')]);_0xc1b3f2[_0x331d('0x3d')]=_[_0x331d('0x3c')](_0x3da6ff[_0x331d('0x38')],qs[_0x331d('0x3e')](_0x165820['query'][_0x331d('0x3e')]));_0xc1b3f2[_0x331d('0x3d')]=_0xc1b3f2[_0x331d('0x3d')][_0x331d('0x3f')]?_0xc1b3f2[_0x331d('0x3d')]:_0x3da6ff[_0x331d('0x38')];if(!_0x165820[_0x331d('0x3a')][_0x331d('0x40')](_0x331d('0x41'))){_0xc1b3f2['limit']=qs[_0x331d('0x42')](_0x165820[_0x331d('0x3a')][_0x331d('0x42')]);_0xc1b3f2[_0x331d('0x2b')]=qs['offset'](_0x165820['query'][_0x331d('0x2b')]);}_0xc1b3f2[_0x331d('0x43')]=qs[_0x331d('0x44')](_0x165820['query']['sort']);_0xc1b3f2['where']=qs[_0x331d('0x3b')](_[_0x331d('0x45')](_0x165820[_0x331d('0x3a')],_0x3da6ff[_0x331d('0x3b')]),_0x469601);if(_0x165820['query'][_0x331d('0x46')]){_0xc1b3f2['where']=_[_0x331d('0x47')](_0xc1b3f2['where'],{'$or':_[_0x331d('0x33')](_0x469601,function(_0x3185ca){if(_0x3185ca[_0x331d('0x37')]!==_0x331d('0x48')){var _0x5d8be={};_0x5d8be[_0x3185ca[_0x331d('0x31')]]={'$like':'%'+_0x165820[_0x331d('0x3a')][_0x331d('0x46')]+'%'};return _0x5d8be;}})});}_0xc1b3f2=_[_0x331d('0x47')]({},_0xc1b3f2,_0x165820['options']);var _0x373aa6={'where':_0xc1b3f2[_0x331d('0x49')]};return db['ZendeskAccount'][_0x331d('0x2a')](_0x373aa6)[_0x331d('0x1b')](function(_0x5e3f6c){_0x2b20d6[_0x331d('0x2a')]=_0x5e3f6c;if(_0x165820[_0x331d('0x3a')][_0x331d('0x4a')]){_0xc1b3f2[_0x331d('0x4b')]=[{'all':!![]}];}return db[_0x331d('0x34')][_0x331d('0x4c')](_0xc1b3f2);})[_0x331d('0x1b')](function(_0x4d0527){_0x2b20d6['rows']=_0x4d0527;return _0x2b20d6;})[_0x331d('0x1b')](respondWithFilteredResult(_0x1f0968,_0xc1b3f2))[_0x331d('0x25')](handleError(_0x1f0968,null));};exports['show']=function(_0x2a5726,_0x44c989){var _0xa5aa29={'raw':![],'where':{'id':_0x2a5726['params']['id']}},_0x2ea35a={};_0x2ea35a[_0x331d('0x38')]=_['keys'](db[_0x331d('0x34')][_0x331d('0x35')]);_0x2ea35a[_0x331d('0x3a')]=_[_0x331d('0x39')](_0x2a5726[_0x331d('0x3a')]);_0x2ea35a[_0x331d('0x3b')]=_[_0x331d('0x3c')](_0x2ea35a['model'],_0x2ea35a[_0x331d('0x3a')]);_0xa5aa29[_0x331d('0x3d')]=_[_0x331d('0x3c')](_0x2ea35a[_0x331d('0x38')],qs[_0x331d('0x3e')](_0x2a5726[_0x331d('0x3a')][_0x331d('0x3e')]));_0xa5aa29['attributes']=_0xa5aa29[_0x331d('0x3d')]['length']?_0xa5aa29[_0x331d('0x3d')]:_0x2ea35a[_0x331d('0x38')];if(_0x2a5726[_0x331d('0x3a')][_0x331d('0x4a')]){_0xa5aa29[_0x331d('0x4b')]=[{'all':!![]}];}_0xa5aa29=_[_0x331d('0x47')]({},_0xa5aa29,_0x2a5726[_0x331d('0x4d')]);return db[_0x331d('0x34')][_0x331d('0x4e')](_0xa5aa29)[_0x331d('0x1b')](handleEntityNotFound(_0x44c989,null))['then'](respondWithResult(_0x44c989,null))['catch'](handleError(_0x44c989,null));};exports['create']=function(_0x37d45e,_0x5036e8){return db[_0x331d('0x34')][_0x331d('0x4f')](_0x37d45e['body'],{})[_0x331d('0x1b')](respondWithResult(_0x5036e8,0xc9))[_0x331d('0x25')](handleError(_0x5036e8,null));};exports[_0x331d('0x2f')]=function(_0x209d20,_0x2ee748){if(_0x209d20[_0x331d('0x50')]['id']){delete _0x209d20[_0x331d('0x50')]['id'];}return db['ZendeskAccount'][_0x331d('0x4e')]({'where':{'id':_0x209d20[_0x331d('0x51')]['id']}})[_0x331d('0x1b')](handleEntityNotFound(_0x2ee748,null))[_0x331d('0x1b')](saveUpdates(_0x209d20[_0x331d('0x50')],null))['then'](respondWithResult(_0x2ee748,null))[_0x331d('0x25')](handleError(_0x2ee748,null));};exports[_0x331d('0x52')]=function(_0x38c8ec,_0x290a5b){return db['ZendeskAccount']['find']({'where':{'id':_0x38c8ec['params']['id']}})['then'](handleEntityNotFound(_0x290a5b,null))[_0x331d('0x1b')](removeEntity(_0x290a5b,null))[_0x331d('0x25')](handleError(_0x290a5b,null));};exports[_0x331d('0x53')]=function(_0x120665,_0xff2370,_0x59e4c7){var _0x4cef51={};var _0x5128f1={};var _0x43a0f5;var _0x29841a;return db[_0x331d('0x34')]['findOne']({'where':{'id':_0x120665[_0x331d('0x51')]['id']}})['then'](handleEntityNotFound(_0xff2370,null))[_0x331d('0x1b')](function(_0x29d5b9){if(_0x29d5b9){_0x43a0f5=_0x29d5b9;_0x5128f1[_0x331d('0x38')]=_['keys'](db[_0x331d('0x54')][_0x331d('0x35')]);_0x5128f1['query']=_[_0x331d('0x39')](_0x120665['query']);_0x5128f1[_0x331d('0x3b')]=_['intersection'](_0x5128f1['model'],_0x5128f1[_0x331d('0x3a')]);_0x4cef51['attributes']=_[_0x331d('0x3c')](_0x5128f1['model'],qs[_0x331d('0x3e')](_0x120665[_0x331d('0x3a')][_0x331d('0x3e')]));_0x4cef51[_0x331d('0x3d')]=_0x4cef51['attributes'][_0x331d('0x3f')]?_0x4cef51['attributes']:_0x5128f1[_0x331d('0x38')];_0x4cef51['order']=qs[_0x331d('0x44')](_0x120665[_0x331d('0x3a')]['sort']);_0x4cef51['where']=qs[_0x331d('0x3b')](_[_0x331d('0x45')](_0x120665[_0x331d('0x3a')],_0x5128f1['filters']));if(_0x120665[_0x331d('0x3a')]['filter']){_0x4cef51[_0x331d('0x49')]=_[_0x331d('0x47')](_0x4cef51[_0x331d('0x49')],{'$or':_[_0x331d('0x33')](_0x4cef51['attributes'],function(_0x3953de){var _0x558fda={};_0x558fda[_0x3953de]={'$like':'%'+_0x120665['query'][_0x331d('0x46')]+'%'};return _0x558fda;})});}_0x4cef51=_['merge']({},_0x4cef51,_0x120665[_0x331d('0x4d')]);return _0x43a0f5['getConfigurations'](_0x4cef51);}})[_0x331d('0x1b')](function(_0x2068c5){if(_0x2068c5){_0x29841a=_0x2068c5['length'];if(!_0x120665[_0x331d('0x3a')][_0x331d('0x40')](_0x331d('0x41'))){_0x4cef51[_0x331d('0x42')]=qs[_0x331d('0x42')](_0x120665['query'][_0x331d('0x42')]);_0x4cef51[_0x331d('0x2b')]=qs[_0x331d('0x2b')](_0x120665[_0x331d('0x3a')][_0x331d('0x2b')]);}return _0x43a0f5['getConfigurations'](_0x4cef51);}})['then'](function(_0x534365){if(_0x534365){return _0x534365?{'count':_0x29841a,'rows':_0x534365}:null;}})[_0x331d('0x1b')](respondWithResult(_0xff2370,null))['catch'](handleError(_0xff2370,null));};exports[_0x331d('0x55')]=function(_0x1a3404,_0x422585,_0x5bab7c){if(_0x1a3404[_0x331d('0x50')]['id']){delete _0x1a3404['body']['id'];}return db['ZendeskAccount'][_0x331d('0x56')]({'where':{'id':_0x1a3404['params']['id']}})[_0x331d('0x1b')](handleEntityNotFound(_0x422585,null))[_0x331d('0x1b')](function(_0x455474){if(_0x455474){_0x1a3404['body'][_0x331d('0x57')]=_0x455474['id'];_0x1a3404[_0x331d('0x50')][_0x331d('0x58')]=integrations[_0x331d('0x59')](_0x1a3404['body'][_0x331d('0x5a')],_0x1a3404[_0x331d('0x50')][_0x331d('0x37')]);_0x1a3404[_0x331d('0x50')]['Descriptions']=integrations[_0x331d('0x5b')](_0x1a3404[_0x331d('0x50')][_0x331d('0x5a')],_0x1a3404[_0x331d('0x50')]['type']);return db[_0x331d('0x54')][_0x331d('0x4f')](_0x1a3404[_0x331d('0x50')],{'include':[{'model':db[_0x331d('0x5c')],'as':'Subjects'},{'model':db[_0x331d('0x5c')],'as':_0x331d('0x5d')}]});}return null;})[_0x331d('0x1b')](respondWithResult(_0x422585,null))[_0x331d('0x25')](handleError(_0x422585,null));};exports[_0x331d('0x5e')]=function(_0x43e4b4,_0xb8c9fa,_0xd6d7aa){var _0x571da4='';return db[_0x331d('0x34')][_0x331d('0x56')]({'where':{'id':_0x43e4b4['params']['id']},'attributes':['id',_0x331d('0x5f'),_0x331d('0x60'),'token',_0x331d('0x61'),_0x331d('0x62')]})[_0x331d('0x1b')](handleEntityNotFound(_0xb8c9fa,null))[_0x331d('0x1b')](function(_0x26cfcc){if(_0x26cfcc){_0x571da4=_0x26cfcc['remoteUri'];var _0x1908aa=_0x571da4[_0x331d('0x63')](-0x1);if(_0x1908aa==='/'){_0x571da4=_0x571da4[_0x331d('0x64')](0x0,_0x571da4[_0x331d('0x65')](_0x1908aa));}var _0x30dc4c={'method':'GET','uri':util[_0x331d('0x66')]('%s/%s',_0x571da4,_0x331d('0x67')),'json':!![]};switch(_0x26cfcc['authType']){case _0x331d('0x60'):_0x30dc4c[_0x331d('0x68')]={'Authorization':util[_0x331d('0x66')](_0x331d('0x69'),new Buffer(util['format'](_0x331d('0x6a'),_0x26cfcc[_0x331d('0x5f')],_0x26cfcc['password']))[_0x331d('0x6b')]('base64'))};break;case _0x331d('0x6c'):_0x30dc4c[_0x331d('0x68')]={'Authorization':util[_0x331d('0x66')](_0x331d('0x69'),new Buffer(util[_0x331d('0x66')](_0x331d('0x6d'),_0x26cfcc[_0x331d('0x5f')],_0x26cfcc['token']))[_0x331d('0x6b')]('base64'))};break;default:throw new db[(_0x331d('0x19'))][(_0x331d('0x6e'))](_0x331d('0x6f'));}return rp(_0x30dc4c);}})[_0x331d('0x1b')](function(_0x2effa4){if(_0x2effa4){var _0x3ebc5b=[_0x331d('0x70'),_0x331d('0x71'),'group','assignee'];_[_0x331d('0x72')](_0x2effa4['ticket_fields'],function(_0x17d6b9){return _0x3ebc5b['includes'](_0x17d6b9[_0x331d('0x37')]);});return{'count':_0x2effa4[_0x331d('0x67')][_0x331d('0x3f')],'rows':_[_0x331d('0x33')](_0x2effa4['ticket_fields'],function(_0x5908d2){return{'id':_0x5908d2['id'],'name':_0x5908d2[_0x331d('0x73')]>0x7?_0x5908d2[_0x331d('0x74')]:_0x5908d2[_0x331d('0x37')],'custom':_0x5908d2[_0x331d('0x73')]>0x7?!![]:![],'options':_0x5908d2[_0x331d('0x75')]?_0x5908d2[_0x331d('0x75')]:_0x5908d2[_0x331d('0x76')]?_0x5908d2[_0x331d('0x76')]:[]};})};}})[_0x331d('0x1b')](respondWithResult(_0xb8c9fa,null))['catch'](function(_0x15eaaa){var _0x143dd0=_0x43e4b4[_0x331d('0x3a')][_0x331d('0x18')]?0x1f4:_0x15eaaa[_0x331d('0x77')]||0x1f4;logger[_0x331d('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x331d('0x5e'),_0x143dd0,JSON['stringify'](_0x15eaaa));delete _0x15eaaa[_0x331d('0x31')];if(_0x143dd0===0x191){_0x143dd0=0x190;}_0xb8c9fa[_0x331d('0x27')](_0x143dd0)['send'](_0x43e4b4[_0x331d('0x3a')][_0x331d('0x18')]?{'message':'Wrong\x20credentials','statusCode':_0x15eaaa[_0x331d('0x77')]}:_0x15eaaa);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b1b3f08..5f6b899 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 _0xeb49=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskAccount.attributes','exports'];(function(_0x29ee89,_0x145bc6){var _0x1e7b09=function(_0x3a20e7){while(--_0x3a20e7){_0x29ee89['push'](_0x29ee89['shift']());}};_0x1e7b09(++_0x145bc6);}(_0xeb49,0x188));var _0x9eb4=function(_0x4fb871,_0x136c1c){_0x4fb871=_0x4fb871-0x0;var _0x29b8db=_0xeb49[_0x4fb871];return _0x29b8db;};'use strict';var _=require(_0x9eb4('0x0'));var util=require('util');var logger=require(_0x9eb4('0x1'))('api');var moment=require(_0x9eb4('0x2'));var BPromise=require(_0x9eb4('0x3'));var rp=require(_0x9eb4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9eb4('0x5'));var attributes=require(_0x9eb4('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x9eb4('0x7')]=function(_0x1b9dad,_0x26bf7a){return _0x1b9dad['define'](_0x9eb4('0x8'),attributes,{'tableName':_0x9eb4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf50d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x39e6a2,_0x135e83){var _0x433bd1=function(_0x3b8ee6){while(--_0x3b8ee6){_0x39e6a2['push'](_0x39e6a2['shift']());}};_0x433bd1(++_0x135e83);}(_0xf50d,0x99));var _0xdf50=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xf50d[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var util=require(_0xdf50('0x0'));var logger=require(_0xdf50('0x1'))(_0xdf50('0x2'));var moment=require(_0xdf50('0x3'));var BPromise=require(_0xdf50('0x4'));var rp=require(_0xdf50('0x5'));var fs=require('fs');var path=require(_0xdf50('0x6'));var rimraf=require(_0xdf50('0x7'));var config=require(_0xdf50('0x8'));var attributes=require(_0xdf50('0x9'));var integrations=require(_0xdf50('0xa'));module['exports']=function(_0x3f1a6a,_0x30014d){return _0x3f1a6a[_0xdf50('0xb')](_0xdf50('0xc'),attributes,{'tableName':_0xdf50('0xd'),'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 a8ca245..c77d22a 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 _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x593354,_0x5cfd81){var _0x13996b=function(_0x306d51){while(--_0x306d51){_0x593354['push'](_0x593354['shift']());}};_0x13996b(++_0x5cfd81);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 3a50502..efcc4a5 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 _0xdc69=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update'];(function(_0x756417,_0x29428a){var _0x41dd70=function(_0x3a068a){while(--_0x3a068a){_0x756417['push'](_0x756417['shift']());}};_0x41dd70(++_0x29428a);}(_0xdc69,0x122));var _0x9dc6=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0xdc69[_0x12b8ec];return _0x21af77;};'use strict';var multer=require('multer');var util=require(_0x9dc6('0x0'));var path=require('path');var timeout=require(_0x9dc6('0x1'));var express=require(_0x9dc6('0x2'));var router=express[_0x9dc6('0x3')]();var auth=require(_0x9dc6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9dc6('0x5'));var controller=require(_0x9dc6('0x6'));router[_0x9dc6('0x7')]('/',auth[_0x9dc6('0x8')](),controller['index']);router['get']('/:id',auth[_0x9dc6('0x8')](),controller[_0x9dc6('0x9')]);router['get']('/:id/fields',auth[_0x9dc6('0x8')](),controller['getFields']);router[_0x9dc6('0x7')](_0x9dc6('0xa'),auth[_0x9dc6('0x8')](),controller[_0x9dc6('0xb')]);router[_0x9dc6('0x7')](_0x9dc6('0xc'),auth[_0x9dc6('0x8')](),controller[_0x9dc6('0xd')]);router[_0x9dc6('0x7')](_0x9dc6('0xe'),auth[_0x9dc6('0x8')](),controller[_0x9dc6('0xf')]);router[_0x9dc6('0x10')]('/',auth['isAuthenticated'](),controller[_0x9dc6('0x11')]);router['post']('/:id/tags',auth[_0x9dc6('0x8')](),controller[_0x9dc6('0x12')]);router[_0x9dc6('0x13')](_0x9dc6('0x14'),auth[_0x9dc6('0x8')](),controller[_0x9dc6('0x15')]);router[_0x9dc6('0x16')]('/:id',auth[_0x9dc6('0x8')](),controller[_0x9dc6('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0476=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','update','destroy','multer','util','path','../../components/interaction/service','../../config/environment','get','/:id','/:id/fields','isAuthenticated'];(function(_0x53cb08,_0x2e0c8a){var _0x5ebf25=function(_0x143456){while(--_0x143456){_0x53cb08['push'](_0x53cb08['shift']());}};_0x5ebf25(++_0x2e0c8a);}(_0x0476,0x69));var _0x6047=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x0476[_0x9c3c56];return _0x2dd782;};'use strict';var multer=require(_0x6047('0x0'));var util=require(_0x6047('0x1'));var path=require(_0x6047('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6047('0x3'));var config=require(_0x6047('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0x6047('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6047('0x5')](_0x6047('0x6'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6047('0x7'),auth[_0x6047('0x8')](),controller['getFields']);router[_0x6047('0x5')](_0x6047('0x9'),auth[_0x6047('0x8')](),controller[_0x6047('0xa')]);router['get'](_0x6047('0xb'),auth[_0x6047('0x8')](),controller[_0x6047('0xc')]);router[_0x6047('0x5')]('/:id/tags',auth[_0x6047('0x8')](),controller[_0x6047('0xd')]);router['post']('/',auth[_0x6047('0x8')](),controller[_0x6047('0xe')]);router[_0x6047('0xf')](_0x6047('0x10'),auth[_0x6047('0x8')](),controller['setTags']);router['put']('/:id',auth[_0x6047('0x8')](),controller[_0x6047('0x11')]);router['delete']('/:id',auth[_0x6047('0x8')](),controller[_0x6047('0x12')]);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 0b6c63c..1890e54 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 _0x5c22=['sequelize','STRING'];(function(_0x1fbd44,_0x4d9c98){var _0x19e60d=function(_0x1ba943){while(--_0x1ba943){_0x1fbd44['push'](_0x1fbd44['shift']());}};_0x19e60d(++_0x4d9c98);}(_0x5c22,0x94));var _0x25c2=function(_0x39c6b0,_0x110ca4){_0x39c6b0=_0x39c6b0-0x0;var _0x3b0110=_0x5c22[_0x39c6b0];return _0x3b0110;};'use strict';var Sequelize=require(_0x25c2('0x0'));module['exports']={'name':{'type':Sequelize[_0x25c2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6c2=['sequelize','STRING'];(function(_0x4bfbda,_0x332198){var _0x3811c8=function(_0x3233c7){while(--_0x3233c7){_0x4bfbda['push'](_0x4bfbda['shift']());}};_0x3811c8(++_0x332198);}(_0xf6c2,0x1ca));var _0x2f6c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf6c2[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x2f6c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f6c('0x1')]},'description':{'type':Sequelize[_0x2f6c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index fbdd218..5514f68 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 _0x22b4=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','create','body','find','destroy','getFields','order','pick','getSubjects','findOne','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x22b4,0x184));var _0x422b=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x22b4[_0x1b6c6d];return _0x290d9d;};'use strict';var pdf=require(_0x422b('0x0'));var emlformat=require(_0x422b('0x1'));var rimraf=require(_0x422b('0x2'));var zipdir=require(_0x422b('0x3'));var jsonpatch=require(_0x422b('0x4'));var rp=require(_0x422b('0x5'));var moment=require(_0x422b('0x6'));var BPromise=require(_0x422b('0x7'));var Mustache=require(_0x422b('0x8'));var util=require('util');var path=require(_0x422b('0x9'));var sox=require(_0x422b('0xa'));var csv=require('to-csv');var ejs=require(_0x422b('0xb'));var fs=require('fs');var _=require(_0x422b('0xc'));var squel=require(_0x422b('0xd'));var crypto=require(_0x422b('0xe'));var jsforce=require(_0x422b('0xf'));var deskjs=require(_0x422b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x422b('0x11'));var Papa=require('papaparse');var Redis=require(_0x422b('0x12'));var authService=require(_0x422b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x422b('0x14'));var hardwareService=require(_0x422b('0x15'));var logger=require(_0x422b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x422b('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x422b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5e9f69,_0x4757e1,_0x19af7f){if(_0x19af7f){var _0x35374a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35374a[_0x422b('0x19')](_0x4757e1)){return _0x5e9f69;}else{throw new db[(_0x422b('0x1a'))]['ValidationError'](_0x422b('0x1b'));}}else{return _0x5e9f69;}}function respondWithRpcPromise(_0x4909b5,_0x1ccb6f,_0x3e2b11,_0x422cff){return new BPromise(function(_0x5ba547,_0x20053f){var _0x52c686=_0x422cff||client;return _0x52c686[_0x422b('0x1c')](_0x4909b5,_0x3e2b11)['then'](function(_0x414888){logger[_0x422b('0x1d')](_0x422b('0x1e'),_0x1ccb6f,_0x422b('0x1f'));logger[_0x422b('0x20')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1ccb6f,'request\x20sent',JSON[_0x422b('0x21')](_0x414888));if(_0x414888['error']){if(_0x414888['error'][_0x422b('0x22')]===0x1f4){logger['error'](_0x422b('0x1e'),_0x1ccb6f,_0x414888[_0x422b('0x23')][_0x422b('0x24')]);return _0x20053f(_0x414888[_0x422b('0x23')]['message']);}logger['error'](_0x422b('0x1e'),_0x1ccb6f,_0x414888[_0x422b('0x23')]['message']);return _0x5ba547(_0x414888[_0x422b('0x23')]['message']);}else{logger['info'](_0x422b('0x1e'),_0x1ccb6f,_0x422b('0x1f'));_0x5ba547(_0x414888[_0x422b('0x25')]['message']);}})[_0x422b('0x26')](function(_0x55dd7b){logger[_0x422b('0x23')](_0x422b('0x1e'),_0x1ccb6f,_0x55dd7b);_0x20053f(_0x55dd7b);});});}function respondWithStatusCode(_0x1e97d5,_0x414ddb){_0x414ddb=_0x414ddb||0xcc;return function(_0x48c53a){if(_0x48c53a){return _0x1e97d5[_0x422b('0x27')](_0x414ddb);}return _0x1e97d5[_0x422b('0x28')](_0x414ddb)['end']();};}function respondWithResult(_0x3685bf,_0x8e4abf){_0x8e4abf=_0x8e4abf||0xc8;return function(_0xa1ec3){if(_0xa1ec3){return _0x3685bf['status'](_0x8e4abf)[_0x422b('0x29')](_0xa1ec3);}};}function respondWithFilteredResult(_0x687ddf,_0x36c6e9){return function(_0x121d3a){if(_0x121d3a){var _0x343280=_0x121d3a[_0x422b('0x2a')],_0x4a1533=_0x36c6e9['offset'],_0x14794f=_0x36c6e9[_0x422b('0x2b')]+_0x36c6e9[_0x422b('0x2c')],_0x1fd700;if(_0x14794f>=_0x343280){_0x14794f=_0x343280;_0x1fd700=0xc8;}else{_0x1fd700=0xce;}_0x687ddf[_0x422b('0x28')](_0x1fd700);return _0x687ddf[_0x422b('0x2d')](_0x422b('0x2e'),_0x4a1533+'-'+_0x14794f+'/'+_0x343280)[_0x422b('0x29')](_0x121d3a);}return null;};}function patchUpdates(_0x5d7d66){return function(_0x150e17){try{jsonpatch[_0x422b('0x2f')](_0x150e17,_0x5d7d66,!![]);}catch(_0x191ef2){return BPromise[_0x422b('0x30')](_0x191ef2);}return _0x150e17[_0x422b('0x31')]();};}function saveUpdates(_0x4444aa,_0x3f2328){return function(_0x892398){if(_0x892398){return _0x892398[_0x422b('0x32')](_0x4444aa)[_0x422b('0x33')](function(_0x3be23d){return _0x3be23d;});}return null;};}function removeEntity(_0x4f9ffa,_0x86fede){return function(_0x35c359){if(_0x35c359){return _0x35c359['destroy']()[_0x422b('0x33')](function(){_0x4f9ffa['status'](0xcc)[_0x422b('0x34')]();});}};}function handleEntityNotFound(_0x3bd00b,_0x5669e4){return function(_0x1f9d2f){if(!_0x1f9d2f){_0x3bd00b[_0x422b('0x27')](0x194);}return _0x1f9d2f;};}function handleError(_0x1f53fb,_0x57cff4){_0x57cff4=_0x57cff4||0x1f4;return function(_0x92614){logger[_0x422b('0x23')](_0x92614[_0x422b('0x35')]);if(_0x92614['name']){delete _0x92614[_0x422b('0x36')];}_0x1f53fb[_0x422b('0x28')](_0x57cff4)['send'](_0x92614);};}exports[_0x422b('0x37')]=function(_0x38ad6d,_0x4da13e){var _0x20c538={},_0x4580c4={},_0x2424be={'count':0x0,'rows':[]};var _0x5dbf51=_['map'](db[_0x422b('0x38')][_0x422b('0x39')],function(_0x5211b6){return{'name':_0x5211b6[_0x422b('0x3a')],'type':_0x5211b6[_0x422b('0x3b')][_0x422b('0x3c')]};});_0x4580c4['model']=_[_0x422b('0x3d')](_0x5dbf51,_0x422b('0x36'));_0x4580c4[_0x422b('0x3e')]=_[_0x422b('0x3f')](_0x38ad6d[_0x422b('0x3e')]);_0x4580c4[_0x422b('0x40')]=_[_0x422b('0x41')](_0x4580c4[_0x422b('0x42')],_0x4580c4['query']);_0x20c538[_0x422b('0x43')]=_[_0x422b('0x41')](_0x4580c4[_0x422b('0x42')],qs['fields'](_0x38ad6d[_0x422b('0x3e')][_0x422b('0x44')]));_0x20c538['attributes']=_0x20c538[_0x422b('0x43')][_0x422b('0x45')]?_0x20c538['attributes']:_0x4580c4[_0x422b('0x42')];if(!_0x38ad6d[_0x422b('0x3e')][_0x422b('0x46')](_0x422b('0x47'))){_0x20c538[_0x422b('0x2c')]=qs[_0x422b('0x2c')](_0x38ad6d[_0x422b('0x3e')][_0x422b('0x2c')]);_0x20c538[_0x422b('0x2b')]=qs[_0x422b('0x2b')](_0x38ad6d[_0x422b('0x3e')]['offset']);}_0x20c538['order']=qs[_0x422b('0x48')](_0x38ad6d[_0x422b('0x3e')]['sort']);_0x20c538[_0x422b('0x49')]=qs[_0x422b('0x40')](_['pick'](_0x38ad6d[_0x422b('0x3e')],_0x4580c4[_0x422b('0x40')]),_0x5dbf51);if(_0x38ad6d[_0x422b('0x3e')][_0x422b('0x4a')]){_0x20c538[_0x422b('0x49')]=_[_0x422b('0x4b')](_0x20c538[_0x422b('0x49')],{'$or':_[_0x422b('0x3d')](_0x5dbf51,function(_0xa86ca3){if(_0xa86ca3[_0x422b('0x3b')]!==_0x422b('0x4c')){var _0x2f9362={};_0x2f9362[_0xa86ca3[_0x422b('0x36')]]={'$like':'%'+_0x38ad6d[_0x422b('0x3e')][_0x422b('0x4a')]+'%'};return _0x2f9362;}})});}_0x20c538=_[_0x422b('0x4b')]({},_0x20c538,_0x38ad6d[_0x422b('0x4d')]);var _0x3e03b8={'where':_0x20c538[_0x422b('0x49')]};return db[_0x422b('0x38')][_0x422b('0x2a')](_0x3e03b8)[_0x422b('0x33')](function(_0x3b411b){_0x2424be[_0x422b('0x2a')]=_0x3b411b;if(_0x38ad6d['query'][_0x422b('0x4e')]){_0x20c538['include']=[{'all':!![]}];}return db[_0x422b('0x38')]['findAll'](_0x20c538);})['then'](function(_0x456f77){_0x2424be[_0x422b('0x4f')]=_0x456f77;return _0x2424be;})['then'](respondWithFilteredResult(_0x4da13e,_0x20c538))[_0x422b('0x26')](handleError(_0x4da13e,null));};exports[_0x422b('0x50')]=function(_0x4f03aa,_0x220f44){var _0x550963={'raw':![],'where':{'id':_0x4f03aa[_0x422b('0x51')]['id']}},_0x163aa3={};_0x163aa3['model']=_[_0x422b('0x3f')](db['ZendeskConfiguration'][_0x422b('0x39')]);_0x163aa3[_0x422b('0x3e')]=_[_0x422b('0x3f')](_0x4f03aa[_0x422b('0x3e')]);_0x163aa3['filters']=_[_0x422b('0x41')](_0x163aa3[_0x422b('0x42')],_0x163aa3[_0x422b('0x3e')]);_0x550963[_0x422b('0x43')]=_[_0x422b('0x41')](_0x163aa3[_0x422b('0x42')],qs[_0x422b('0x44')](_0x4f03aa[_0x422b('0x3e')][_0x422b('0x44')]));_0x550963[_0x422b('0x43')]=_0x550963[_0x422b('0x43')][_0x422b('0x45')]?_0x550963[_0x422b('0x43')]:_0x163aa3['model'];if(_0x4f03aa[_0x422b('0x3e')]['includeAll']){_0x550963[_0x422b('0x52')]=[{'all':!![]}];}_0x550963=_[_0x422b('0x4b')]({},_0x550963,_0x4f03aa[_0x422b('0x4d')]);return db[_0x422b('0x38')]['find'](_0x550963)[_0x422b('0x33')](handleEntityNotFound(_0x220f44,null))[_0x422b('0x33')](respondWithResult(_0x220f44,null))['catch'](handleError(_0x220f44,null));};exports['create']=function(_0x469db2,_0x53927d){return db[_0x422b('0x38')][_0x422b('0x53')](_0x469db2['body'],{})[_0x422b('0x33')](respondWithResult(_0x53927d,0xc9))[_0x422b('0x26')](handleError(_0x53927d,null));};exports[_0x422b('0x32')]=function(_0x178e14,_0x3fc11e){if(_0x178e14[_0x422b('0x54')]['id']){delete _0x178e14['body']['id'];}return db[_0x422b('0x38')][_0x422b('0x55')]({'where':{'id':_0x178e14[_0x422b('0x51')]['id']}})['then'](handleEntityNotFound(_0x3fc11e,null))[_0x422b('0x33')](saveUpdates(_0x178e14['body'],null))['then'](respondWithResult(_0x3fc11e,null))['catch'](handleError(_0x3fc11e,null));};exports[_0x422b('0x56')]=function(_0x51ad72,_0x4c1799){return db[_0x422b('0x38')][_0x422b('0x55')]({'where':{'id':_0x51ad72[_0x422b('0x51')]['id']}})[_0x422b('0x33')](handleEntityNotFound(_0x4c1799,null))['then'](removeEntity(_0x4c1799,null))[_0x422b('0x26')](handleError(_0x4c1799,null));};exports[_0x422b('0x57')]=function(_0x2c3945,_0x340df8,_0x1380b3){var _0x4d48f4={};var _0x855634={};var _0x174102;var _0x35b2ee;return db[_0x422b('0x38')]['findOne']({'where':{'id':_0x2c3945[_0x422b('0x51')]['id']}})['then'](handleEntityNotFound(_0x340df8,null))[_0x422b('0x33')](function(_0x1e2068){if(_0x1e2068){_0x174102=_0x1e2068;_0x855634[_0x422b('0x42')]=_[_0x422b('0x3f')](db['ZendeskField'][_0x422b('0x39')]);_0x855634[_0x422b('0x3e')]=_[_0x422b('0x3f')](_0x2c3945[_0x422b('0x3e')]);_0x855634[_0x422b('0x40')]=_['intersection'](_0x855634[_0x422b('0x42')],_0x855634[_0x422b('0x3e')]);_0x4d48f4['attributes']=_[_0x422b('0x41')](_0x855634['model'],qs[_0x422b('0x44')](_0x2c3945[_0x422b('0x3e')][_0x422b('0x44')]));_0x4d48f4[_0x422b('0x43')]=_0x4d48f4[_0x422b('0x43')][_0x422b('0x45')]?_0x4d48f4[_0x422b('0x43')]:_0x855634[_0x422b('0x42')];_0x4d48f4[_0x422b('0x58')]=qs[_0x422b('0x48')](_0x2c3945['query'][_0x422b('0x48')]);_0x4d48f4['where']=qs[_0x422b('0x40')](_[_0x422b('0x59')](_0x2c3945[_0x422b('0x3e')],_0x855634[_0x422b('0x40')]));if(_0x2c3945[_0x422b('0x3e')][_0x422b('0x4a')]){_0x4d48f4[_0x422b('0x49')]=_[_0x422b('0x4b')](_0x4d48f4[_0x422b('0x49')],{'$or':_[_0x422b('0x3d')](_0x4d48f4[_0x422b('0x43')],function(_0x35a851){var _0x291590={};_0x291590[_0x35a851]={'$like':'%'+_0x2c3945[_0x422b('0x3e')][_0x422b('0x4a')]+'%'};return _0x291590;})});}_0x4d48f4=_[_0x422b('0x4b')]({},_0x4d48f4,_0x2c3945[_0x422b('0x4d')]);return _0x174102['getFields'](_0x4d48f4);}})[_0x422b('0x33')](function(_0x12e3e3){if(_0x12e3e3){_0x35b2ee=_0x12e3e3[_0x422b('0x45')];if(!_0x2c3945[_0x422b('0x3e')]['hasOwnProperty'](_0x422b('0x47'))){_0x4d48f4[_0x422b('0x2c')]=qs['limit'](_0x2c3945[_0x422b('0x3e')][_0x422b('0x2c')]);_0x4d48f4[_0x422b('0x2b')]=qs[_0x422b('0x2b')](_0x2c3945[_0x422b('0x3e')][_0x422b('0x2b')]);}return _0x174102['getFields'](_0x4d48f4);}})['then'](function(_0x251158){if(_0x251158){return _0x251158?{'count':_0x35b2ee,'rows':_0x251158}:null;}})[_0x422b('0x33')](respondWithResult(_0x340df8,null))['catch'](handleError(_0x340df8,null));};exports[_0x422b('0x5a')]=function(_0x4f41cd,_0x454b35,_0xb09eaf){var _0x77cc8a={};var _0x572fba={};var _0x247be5;var _0x3461da;return db[_0x422b('0x38')][_0x422b('0x5b')]({'where':{'id':_0x4f41cd[_0x422b('0x51')]['id']}})[_0x422b('0x33')](handleEntityNotFound(_0x454b35,null))['then'](function(_0x8f8f1){if(_0x8f8f1){_0x247be5=_0x8f8f1;_0x572fba['model']=_[_0x422b('0x3f')](db[_0x422b('0x5c')][_0x422b('0x39')]);_0x572fba[_0x422b('0x3e')]=_['keys'](_0x4f41cd['query']);_0x572fba[_0x422b('0x40')]=_['intersection'](_0x572fba[_0x422b('0x42')],_0x572fba[_0x422b('0x3e')]);_0x77cc8a['attributes']=_[_0x422b('0x41')](_0x572fba[_0x422b('0x42')],qs['fields'](_0x4f41cd[_0x422b('0x3e')][_0x422b('0x44')]));_0x77cc8a[_0x422b('0x43')]=_0x77cc8a[_0x422b('0x43')][_0x422b('0x45')]?_0x77cc8a[_0x422b('0x43')]:_0x572fba[_0x422b('0x42')];_0x77cc8a['order']=qs[_0x422b('0x48')](_0x4f41cd[_0x422b('0x3e')][_0x422b('0x48')]);_0x77cc8a[_0x422b('0x49')]=qs[_0x422b('0x40')](_[_0x422b('0x59')](_0x4f41cd['query'],_0x572fba[_0x422b('0x40')]));if(_0x4f41cd['query'][_0x422b('0x4a')]){_0x77cc8a[_0x422b('0x49')]=_[_0x422b('0x4b')](_0x77cc8a[_0x422b('0x49')],{'$or':_[_0x422b('0x3d')](_0x77cc8a[_0x422b('0x43')],function(_0x2ddfa8){var _0x24ea51={};_0x24ea51[_0x2ddfa8]={'$like':'%'+_0x4f41cd[_0x422b('0x3e')][_0x422b('0x4a')]+'%'};return _0x24ea51;})});}_0x77cc8a=_[_0x422b('0x4b')]({},_0x77cc8a,_0x4f41cd[_0x422b('0x4d')]);return _0x247be5[_0x422b('0x5a')](_0x77cc8a);}})['then'](function(_0x26510e){if(_0x26510e){_0x3461da=_0x26510e[_0x422b('0x45')];if(!_0x4f41cd['query']['hasOwnProperty'](_0x422b('0x47'))){_0x77cc8a['limit']=qs['limit'](_0x4f41cd[_0x422b('0x3e')][_0x422b('0x2c')]);_0x77cc8a[_0x422b('0x2b')]=qs[_0x422b('0x2b')](_0x4f41cd[_0x422b('0x3e')][_0x422b('0x2b')]);}return _0x247be5[_0x422b('0x5a')](_0x77cc8a);}})['then'](function(_0x4d75a5){if(_0x4d75a5){return _0x4d75a5?{'count':_0x3461da,'rows':_0x4d75a5}:null;}})[_0x422b('0x33')](respondWithResult(_0x454b35,null))[_0x422b('0x26')](handleError(_0x454b35,null));};exports[_0x422b('0x5d')]=function(_0x2d22e6,_0x363b40,_0x28edad){var _0x3d47bb={};var _0x1e0162={};var _0x364398;var _0x49431f;return db[_0x422b('0x38')][_0x422b('0x5b')]({'where':{'id':_0x2d22e6['params']['id']}})[_0x422b('0x33')](handleEntityNotFound(_0x363b40,null))['then'](function(_0x220162){if(_0x220162){_0x364398=_0x220162;_0x1e0162[_0x422b('0x42')]=_[_0x422b('0x3f')](db[_0x422b('0x5c')][_0x422b('0x39')]);_0x1e0162[_0x422b('0x3e')]=_['keys'](_0x2d22e6[_0x422b('0x3e')]);_0x1e0162[_0x422b('0x40')]=_[_0x422b('0x41')](_0x1e0162['model'],_0x1e0162[_0x422b('0x3e')]);_0x3d47bb[_0x422b('0x43')]=_[_0x422b('0x41')](_0x1e0162['model'],qs[_0x422b('0x44')](_0x2d22e6[_0x422b('0x3e')]['fields']));_0x3d47bb['attributes']=_0x3d47bb['attributes'][_0x422b('0x45')]?_0x3d47bb[_0x422b('0x43')]:_0x1e0162[_0x422b('0x42')];_0x3d47bb[_0x422b('0x58')]=qs[_0x422b('0x48')](_0x2d22e6[_0x422b('0x3e')][_0x422b('0x48')]);_0x3d47bb[_0x422b('0x49')]=qs[_0x422b('0x40')](_[_0x422b('0x59')](_0x2d22e6[_0x422b('0x3e')],_0x1e0162[_0x422b('0x40')]));if(_0x2d22e6[_0x422b('0x3e')][_0x422b('0x4a')]){_0x3d47bb[_0x422b('0x49')]=_['merge'](_0x3d47bb[_0x422b('0x49')],{'$or':_['map'](_0x3d47bb[_0x422b('0x43')],function(_0x88c0ed){var _0x281ab1={};_0x281ab1[_0x88c0ed]={'$like':'%'+_0x2d22e6[_0x422b('0x3e')][_0x422b('0x4a')]+'%'};return _0x281ab1;})});}_0x3d47bb=_['merge']({},_0x3d47bb,_0x2d22e6[_0x422b('0x4d')]);return _0x364398['getDescriptions'](_0x3d47bb);}})[_0x422b('0x33')](function(_0x3a336b){if(_0x3a336b){_0x49431f=_0x3a336b[_0x422b('0x45')];if(!_0x2d22e6[_0x422b('0x3e')][_0x422b('0x46')](_0x422b('0x47'))){_0x3d47bb['limit']=qs[_0x422b('0x2c')](_0x2d22e6[_0x422b('0x3e')]['limit']);_0x3d47bb[_0x422b('0x2b')]=qs['offset'](_0x2d22e6[_0x422b('0x3e')]['offset']);}return _0x364398[_0x422b('0x5d')](_0x3d47bb);}})[_0x422b('0x33')](function(_0x4c2c82){if(_0x4c2c82){return _0x4c2c82?{'count':_0x49431f,'rows':_0x4c2c82}:null;}})[_0x422b('0x33')](respondWithResult(_0x363b40,null))[_0x422b('0x26')](handleError(_0x363b40,null));};exports[_0x422b('0x5e')]=function(_0x1f0e05,_0x458a93,_0x2c8bb9){var _0x506fa8={};var _0x572c88={};var _0x584cf9;var _0x1506e4;return db[_0x422b('0x38')][_0x422b('0x5b')]({'where':{'id':_0x1f0e05[_0x422b('0x51')]['id']}})[_0x422b('0x33')](handleEntityNotFound(_0x458a93,null))[_0x422b('0x33')](function(_0x585cc6){if(_0x585cc6){_0x584cf9=_0x585cc6;_0x572c88['model']=_[_0x422b('0x3f')](db[_0x422b('0x5f')][_0x422b('0x39')]);_0x572c88[_0x422b('0x3e')]=_[_0x422b('0x3f')](_0x1f0e05[_0x422b('0x3e')]);_0x572c88[_0x422b('0x40')]=_[_0x422b('0x41')](_0x572c88[_0x422b('0x42')],_0x572c88[_0x422b('0x3e')]);_0x506fa8[_0x422b('0x43')]=_[_0x422b('0x41')](_0x572c88[_0x422b('0x42')],qs[_0x422b('0x44')](_0x1f0e05['query'][_0x422b('0x44')]));_0x506fa8[_0x422b('0x43')]=_0x506fa8[_0x422b('0x43')]['length']?_0x506fa8[_0x422b('0x43')]:_0x572c88[_0x422b('0x42')];_0x506fa8[_0x422b('0x58')]=qs[_0x422b('0x48')](_0x1f0e05['query'][_0x422b('0x48')]);_0x506fa8['where']=qs['filters'](_['pick'](_0x1f0e05[_0x422b('0x3e')],_0x572c88[_0x422b('0x40')]));if(_0x1f0e05[_0x422b('0x3e')][_0x422b('0x4a')]){_0x506fa8[_0x422b('0x49')]=_[_0x422b('0x4b')](_0x506fa8[_0x422b('0x49')],{'$or':_[_0x422b('0x3d')](_0x506fa8[_0x422b('0x43')],function(_0x66cfcb){var _0x9784da={};_0x9784da[_0x66cfcb]={'$like':'%'+_0x1f0e05['query'][_0x422b('0x4a')]+'%'};return _0x9784da;})});}_0x506fa8=_[_0x422b('0x4b')]({},_0x506fa8,_0x1f0e05['options']);return _0x584cf9[_0x422b('0x5e')](_0x506fa8);}})[_0x422b('0x33')](function(_0x28e935){if(_0x28e935){_0x1506e4=_0x28e935[_0x422b('0x45')];if(!_0x1f0e05['query'][_0x422b('0x46')](_0x422b('0x47'))){_0x506fa8[_0x422b('0x2c')]=qs[_0x422b('0x2c')](_0x1f0e05[_0x422b('0x3e')][_0x422b('0x2c')]);_0x506fa8['offset']=qs[_0x422b('0x2b')](_0x1f0e05[_0x422b('0x3e')][_0x422b('0x2b')]);}return _0x584cf9[_0x422b('0x5e')](_0x506fa8);}})[_0x422b('0x33')](function(_0x290b15){if(_0x290b15){return _0x290b15?{'count':_0x1506e4,'rows':_0x290b15}:null;}})['then'](respondWithResult(_0x458a93,null))['catch'](handleError(_0x458a93,null));};exports['setTags']=function(_0xc3d3ac,_0x5961fb,_0x26b57a){if(_0xc3d3ac[_0x422b('0x54')]['id']){delete _0xc3d3ac[_0x422b('0x54')]['id'];}return db['ZendeskConfiguration'][_0x422b('0x5b')]({'where':{'id':_0xc3d3ac['params']['id']}})[_0x422b('0x33')](handleEntityNotFound(_0x5961fb,null))['then'](function(_0x56449c){if(_0x56449c){return _0x56449c[_0x422b('0x60')](_0xc3d3ac['body'][_0x422b('0x61')]||[]);}return null;})[_0x422b('0x33')](respondWithResult(_0x5961fb,null))[_0x422b('0x26')](handleError(_0x5961fb,null));}; \ No newline at end of file +var _0xf3f2=['json','apply','reject','destroy','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','keys','intersection','include','find','create','update','body','params','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../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','then','info','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','offset','limit','set'];(function(_0x3295fe,_0x3420ee){var _0x567b95=function(_0x322565){while(--_0x322565){_0x3295fe['push'](_0x3295fe['shift']());}};_0x567b95(++_0x3420ee);}(_0xf3f2,0x145));var _0x2f3f=function(_0x1b1ca4,_0x18d595){_0x1b1ca4=_0x1b1ca4-0x0;var _0x28040c=_0xf3f2[_0x1b1ca4];return _0x28040c;};'use strict';var pdf=require(_0x2f3f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f3f('0x1'));var rp=require(_0x2f3f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2f3f('0x3'));var util=require('util');var path=require(_0x2f3f('0x4'));var sox=require(_0x2f3f('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2f3f('0x6'));var squel=require(_0x2f3f('0x7'));var crypto=require(_0x2f3f('0x8'));var jsforce=require(_0x2f3f('0x9'));var deskjs=require(_0x2f3f('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2f3f('0xb'));var Redis=require(_0x2f3f('0xc'));var authService=require(_0x2f3f('0xd'));var qs=require(_0x2f3f('0xe'));var as=require(_0x2f3f('0xf'));var hardwareService=require(_0x2f3f('0x10'));var logger=require('../../config/logger')(_0x2f3f('0x11'));var utils=require(_0x2f3f('0x12'));var config=require(_0x2f3f('0x13'));var db=require(_0x2f3f('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2f3f('0x15')][_0x2f3f('0x16')]({'port':0x232a});function checkPasswordPattern(_0x17ad24,_0x36b0e0,_0x363106){if(_0x363106){var _0x200a7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x200a7a[_0x2f3f('0x17')](_0x36b0e0)){return _0x17ad24;}else{throw new db['Sequelize'][(_0x2f3f('0x18'))](_0x2f3f('0x19'));}}else{return _0x17ad24;}}function respondWithRpcPromise(_0x384eb9,_0x83dfa8,_0x21dfe0,_0x784b00){return new BPromise(function(_0x5148d6,_0x4ba575){var _0x38bf01=_0x784b00||client;return _0x38bf01[_0x2f3f('0x1a')](_0x384eb9,_0x21dfe0)[_0x2f3f('0x1b')](function(_0x4708a5){logger[_0x2f3f('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x83dfa8,'request\x20sent');logger['debug'](_0x2f3f('0x1d'),_0x83dfa8,_0x2f3f('0x1e'),JSON[_0x2f3f('0x1f')](_0x4708a5));if(_0x4708a5[_0x2f3f('0x20')]){if(_0x4708a5[_0x2f3f('0x20')][_0x2f3f('0x21')]===0x1f4){logger[_0x2f3f('0x20')]('ZendeskConfiguration,\x20%s,\x20%s',_0x83dfa8,_0x4708a5['error'][_0x2f3f('0x22')]);return _0x4ba575(_0x4708a5[_0x2f3f('0x20')][_0x2f3f('0x22')]);}logger[_0x2f3f('0x20')](_0x2f3f('0x23'),_0x83dfa8,_0x4708a5['error']['message']);return _0x5148d6(_0x4708a5['error'][_0x2f3f('0x22')]);}else{logger[_0x2f3f('0x1c')](_0x2f3f('0x23'),_0x83dfa8,_0x2f3f('0x1e'));_0x5148d6(_0x4708a5[_0x2f3f('0x24')][_0x2f3f('0x22')]);}})[_0x2f3f('0x25')](function(_0x146bf7){logger[_0x2f3f('0x20')](_0x2f3f('0x23'),_0x83dfa8,_0x146bf7);_0x4ba575(_0x146bf7);});});}function respondWithStatusCode(_0x5e4bd7,_0x319d06){_0x319d06=_0x319d06||0xcc;return function(_0x4ad1e5){if(_0x4ad1e5){return _0x5e4bd7[_0x2f3f('0x26')](_0x319d06);}return _0x5e4bd7[_0x2f3f('0x27')](_0x319d06)['end']();};}function respondWithResult(_0x4832e6,_0xc7eada){_0xc7eada=_0xc7eada||0xc8;return function(_0x1d81cf){if(_0x1d81cf){return _0x4832e6['status'](_0xc7eada)['json'](_0x1d81cf);}};}function respondWithFilteredResult(_0xfa94e7,_0x110fd1){return function(_0x4f08af){if(_0x4f08af){var _0x444e63=_0x4f08af['count'],_0x5925de=_0x110fd1[_0x2f3f('0x28')],_0x53a046=_0x110fd1['offset']+_0x110fd1[_0x2f3f('0x29')],_0x14be6e;if(_0x53a046>=_0x444e63){_0x53a046=_0x444e63;_0x14be6e=0xc8;}else{_0x14be6e=0xce;}_0xfa94e7['status'](_0x14be6e);return _0xfa94e7[_0x2f3f('0x2a')]('Content-Range',_0x5925de+'-'+_0x53a046+'/'+_0x444e63)[_0x2f3f('0x2b')](_0x4f08af);}return null;};}function patchUpdates(_0x17e259){return function(_0xd8bcd9){try{jsonpatch[_0x2f3f('0x2c')](_0xd8bcd9,_0x17e259,!![]);}catch(_0x353d67){return BPromise[_0x2f3f('0x2d')](_0x353d67);}return _0xd8bcd9['save']();};}function saveUpdates(_0x2332aa,_0x281ca6){return function(_0x43cdce){if(_0x43cdce){return _0x43cdce['update'](_0x2332aa)[_0x2f3f('0x1b')](function(_0x4a9a3e){return _0x4a9a3e;});}return null;};}function removeEntity(_0x4e5acf,_0x5d6ce7){return function(_0x144ca9){if(_0x144ca9){return _0x144ca9[_0x2f3f('0x2e')]()[_0x2f3f('0x1b')](function(){_0x4e5acf[_0x2f3f('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5efe65,_0x1797d2){return function(_0x5a6b47){if(!_0x5a6b47){_0x5efe65['sendStatus'](0x194);}return _0x5a6b47;};}function handleError(_0x193d88,_0x334f8c){_0x334f8c=_0x334f8c||0x1f4;return function(_0x160bc4){logger[_0x2f3f('0x20')](_0x160bc4[_0x2f3f('0x2f')]);if(_0x160bc4[_0x2f3f('0x30')]){delete _0x160bc4[_0x2f3f('0x30')];}_0x193d88[_0x2f3f('0x27')](_0x334f8c)[_0x2f3f('0x31')](_0x160bc4);};}exports[_0x2f3f('0x32')]=function(_0xab738b,_0x5857f3){var _0x285ea0={},_0x50e7b8={},_0x55c9b9={'count':0x0,'rows':[]};var _0x3b3388=_['map'](db[_0x2f3f('0x33')][_0x2f3f('0x34')],function(_0x2e1273){return{'name':_0x2e1273[_0x2f3f('0x35')],'type':_0x2e1273[_0x2f3f('0x36')]['key']};});_0x50e7b8[_0x2f3f('0x37')]=_[_0x2f3f('0x38')](_0x3b3388,'name');_0x50e7b8['query']=_['keys'](_0xab738b['query']);_0x50e7b8[_0x2f3f('0x39')]=_['intersection'](_0x50e7b8[_0x2f3f('0x37')],_0x50e7b8[_0x2f3f('0x3a')]);_0x285ea0[_0x2f3f('0x3b')]=_['intersection'](_0x50e7b8[_0x2f3f('0x37')],qs[_0x2f3f('0x3c')](_0xab738b[_0x2f3f('0x3a')][_0x2f3f('0x3c')]));_0x285ea0[_0x2f3f('0x3b')]=_0x285ea0[_0x2f3f('0x3b')][_0x2f3f('0x3d')]?_0x285ea0['attributes']:_0x50e7b8['model'];if(!_0xab738b['query'][_0x2f3f('0x3e')](_0x2f3f('0x3f'))){_0x285ea0['limit']=qs[_0x2f3f('0x29')](_0xab738b[_0x2f3f('0x3a')]['limit']);_0x285ea0[_0x2f3f('0x28')]=qs[_0x2f3f('0x28')](_0xab738b['query'][_0x2f3f('0x28')]);}_0x285ea0['order']=qs[_0x2f3f('0x40')](_0xab738b[_0x2f3f('0x3a')][_0x2f3f('0x40')]);_0x285ea0['where']=qs[_0x2f3f('0x39')](_[_0x2f3f('0x41')](_0xab738b['query'],_0x50e7b8[_0x2f3f('0x39')]),_0x3b3388);if(_0xab738b[_0x2f3f('0x3a')]['filter']){_0x285ea0[_0x2f3f('0x42')]=_[_0x2f3f('0x43')](_0x285ea0[_0x2f3f('0x42')],{'$or':_[_0x2f3f('0x38')](_0x3b3388,function(_0x49ba17){if(_0x49ba17[_0x2f3f('0x36')]!==_0x2f3f('0x44')){var _0x549d32={};_0x549d32[_0x49ba17['name']]={'$like':'%'+_0xab738b[_0x2f3f('0x3a')][_0x2f3f('0x45')]+'%'};return _0x549d32;}})});}_0x285ea0=_[_0x2f3f('0x43')]({},_0x285ea0,_0xab738b[_0x2f3f('0x46')]);var _0x501f71={'where':_0x285ea0[_0x2f3f('0x42')]};return db[_0x2f3f('0x33')][_0x2f3f('0x47')](_0x501f71)[_0x2f3f('0x1b')](function(_0x20167f){_0x55c9b9['count']=_0x20167f;if(_0xab738b[_0x2f3f('0x3a')][_0x2f3f('0x48')]){_0x285ea0['include']=[{'all':!![]}];}return db[_0x2f3f('0x33')][_0x2f3f('0x49')](_0x285ea0);})[_0x2f3f('0x1b')](function(_0x10ca54){_0x55c9b9[_0x2f3f('0x4a')]=_0x10ca54;return _0x55c9b9;})[_0x2f3f('0x1b')](respondWithFilteredResult(_0x5857f3,_0x285ea0))['catch'](handleError(_0x5857f3,null));};exports['show']=function(_0xb5d73b,_0x24e35c){var _0x5517dd={'raw':![],'where':{'id':_0xb5d73b['params']['id']}},_0x274de3={};_0x274de3[_0x2f3f('0x37')]=_['keys'](db[_0x2f3f('0x33')]['rawAttributes']);_0x274de3[_0x2f3f('0x3a')]=_[_0x2f3f('0x4b')](_0xb5d73b[_0x2f3f('0x3a')]);_0x274de3[_0x2f3f('0x39')]=_[_0x2f3f('0x4c')](_0x274de3['model'],_0x274de3[_0x2f3f('0x3a')]);_0x5517dd[_0x2f3f('0x3b')]=_[_0x2f3f('0x4c')](_0x274de3[_0x2f3f('0x37')],qs[_0x2f3f('0x3c')](_0xb5d73b['query'][_0x2f3f('0x3c')]));_0x5517dd['attributes']=_0x5517dd[_0x2f3f('0x3b')][_0x2f3f('0x3d')]?_0x5517dd[_0x2f3f('0x3b')]:_0x274de3[_0x2f3f('0x37')];if(_0xb5d73b['query']['includeAll']){_0x5517dd[_0x2f3f('0x4d')]=[{'all':!![]}];}_0x5517dd=_['merge']({},_0x5517dd,_0xb5d73b[_0x2f3f('0x46')]);return db['ZendeskConfiguration'][_0x2f3f('0x4e')](_0x5517dd)[_0x2f3f('0x1b')](handleEntityNotFound(_0x24e35c,null))['then'](respondWithResult(_0x24e35c,null))[_0x2f3f('0x25')](handleError(_0x24e35c,null));};exports[_0x2f3f('0x4f')]=function(_0x12e156,_0x38669f){return db[_0x2f3f('0x33')][_0x2f3f('0x4f')](_0x12e156['body'],{})['then'](respondWithResult(_0x38669f,0xc9))[_0x2f3f('0x25')](handleError(_0x38669f,null));};exports[_0x2f3f('0x50')]=function(_0x425f20,_0x15d333){if(_0x425f20[_0x2f3f('0x51')]['id']){delete _0x425f20[_0x2f3f('0x51')]['id'];}return db[_0x2f3f('0x33')]['find']({'where':{'id':_0x425f20[_0x2f3f('0x52')]['id']}})[_0x2f3f('0x1b')](handleEntityNotFound(_0x15d333,null))[_0x2f3f('0x1b')](saveUpdates(_0x425f20[_0x2f3f('0x51')],null))[_0x2f3f('0x1b')](respondWithResult(_0x15d333,null))[_0x2f3f('0x25')](handleError(_0x15d333,null));};exports['destroy']=function(_0xcb11a2,_0x25bb01){return db['ZendeskConfiguration'][_0x2f3f('0x4e')]({'where':{'id':_0xcb11a2['params']['id']}})[_0x2f3f('0x1b')](handleEntityNotFound(_0x25bb01,null))[_0x2f3f('0x1b')](removeEntity(_0x25bb01,null))['catch'](handleError(_0x25bb01,null));};exports[_0x2f3f('0x53')]=function(_0xfe094d,_0x3b9f6c,_0x1d09ff){var _0x41953f={};var _0x4b61e2={};var _0x25696e;var _0x5b8453;return db[_0x2f3f('0x33')][_0x2f3f('0x54')]({'where':{'id':_0xfe094d[_0x2f3f('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b9f6c,null))['then'](function(_0x16c205){if(_0x16c205){_0x25696e=_0x16c205;_0x4b61e2[_0x2f3f('0x37')]=_[_0x2f3f('0x4b')](db[_0x2f3f('0x55')][_0x2f3f('0x34')]);_0x4b61e2[_0x2f3f('0x3a')]=_[_0x2f3f('0x4b')](_0xfe094d['query']);_0x4b61e2['filters']=_[_0x2f3f('0x4c')](_0x4b61e2[_0x2f3f('0x37')],_0x4b61e2[_0x2f3f('0x3a')]);_0x41953f[_0x2f3f('0x3b')]=_[_0x2f3f('0x4c')](_0x4b61e2[_0x2f3f('0x37')],qs[_0x2f3f('0x3c')](_0xfe094d['query'][_0x2f3f('0x3c')]));_0x41953f[_0x2f3f('0x3b')]=_0x41953f['attributes']['length']?_0x41953f[_0x2f3f('0x3b')]:_0x4b61e2['model'];_0x41953f[_0x2f3f('0x56')]=qs['sort'](_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x40')]);_0x41953f[_0x2f3f('0x42')]=qs[_0x2f3f('0x39')](_[_0x2f3f('0x41')](_0xfe094d[_0x2f3f('0x3a')],_0x4b61e2[_0x2f3f('0x39')]));if(_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x45')]){_0x41953f[_0x2f3f('0x42')]=_[_0x2f3f('0x43')](_0x41953f[_0x2f3f('0x42')],{'$or':_[_0x2f3f('0x38')](_0x41953f[_0x2f3f('0x3b')],function(_0x2ffd3a){var _0x2939e1={};_0x2939e1[_0x2ffd3a]={'$like':'%'+_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x45')]+'%'};return _0x2939e1;})});}_0x41953f=_[_0x2f3f('0x43')]({},_0x41953f,_0xfe094d[_0x2f3f('0x46')]);return _0x25696e[_0x2f3f('0x53')](_0x41953f);}})[_0x2f3f('0x1b')](function(_0x4c9dd8){if(_0x4c9dd8){_0x5b8453=_0x4c9dd8[_0x2f3f('0x3d')];if(!_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x3e')](_0x2f3f('0x3f'))){_0x41953f[_0x2f3f('0x29')]=qs[_0x2f3f('0x29')](_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x29')]);_0x41953f[_0x2f3f('0x28')]=qs[_0x2f3f('0x28')](_0xfe094d[_0x2f3f('0x3a')][_0x2f3f('0x28')]);}return _0x25696e[_0x2f3f('0x53')](_0x41953f);}})[_0x2f3f('0x1b')](function(_0x32f6a8){if(_0x32f6a8){return _0x32f6a8?{'count':_0x5b8453,'rows':_0x32f6a8}:null;}})[_0x2f3f('0x1b')](respondWithResult(_0x3b9f6c,null))[_0x2f3f('0x25')](handleError(_0x3b9f6c,null));};exports[_0x2f3f('0x57')]=function(_0xb26712,_0x3830b4,_0x45c1b5){var _0x19a0b6={};var _0x239354={};var _0x23ad00;var _0x3bc0b9;return db[_0x2f3f('0x33')][_0x2f3f('0x54')]({'where':{'id':_0xb26712[_0x2f3f('0x52')]['id']}})[_0x2f3f('0x1b')](handleEntityNotFound(_0x3830b4,null))[_0x2f3f('0x1b')](function(_0xa40e1){if(_0xa40e1){_0x23ad00=_0xa40e1;_0x239354['model']=_['keys'](db[_0x2f3f('0x55')][_0x2f3f('0x34')]);_0x239354[_0x2f3f('0x3a')]=_['keys'](_0xb26712[_0x2f3f('0x3a')]);_0x239354['filters']=_[_0x2f3f('0x4c')](_0x239354[_0x2f3f('0x37')],_0x239354[_0x2f3f('0x3a')]);_0x19a0b6[_0x2f3f('0x3b')]=_['intersection'](_0x239354[_0x2f3f('0x37')],qs[_0x2f3f('0x3c')](_0xb26712[_0x2f3f('0x3a')][_0x2f3f('0x3c')]));_0x19a0b6[_0x2f3f('0x3b')]=_0x19a0b6[_0x2f3f('0x3b')][_0x2f3f('0x3d')]?_0x19a0b6['attributes']:_0x239354['model'];_0x19a0b6[_0x2f3f('0x56')]=qs[_0x2f3f('0x40')](_0xb26712[_0x2f3f('0x3a')]['sort']);_0x19a0b6[_0x2f3f('0x42')]=qs[_0x2f3f('0x39')](_['pick'](_0xb26712[_0x2f3f('0x3a')],_0x239354[_0x2f3f('0x39')]));if(_0xb26712[_0x2f3f('0x3a')]['filter']){_0x19a0b6['where']=_[_0x2f3f('0x43')](_0x19a0b6['where'],{'$or':_[_0x2f3f('0x38')](_0x19a0b6[_0x2f3f('0x3b')],function(_0x5c81b0){var _0x53bb1a={};_0x53bb1a[_0x5c81b0]={'$like':'%'+_0xb26712[_0x2f3f('0x3a')][_0x2f3f('0x45')]+'%'};return _0x53bb1a;})});}_0x19a0b6=_[_0x2f3f('0x43')]({},_0x19a0b6,_0xb26712[_0x2f3f('0x46')]);return _0x23ad00[_0x2f3f('0x57')](_0x19a0b6);}})[_0x2f3f('0x1b')](function(_0x2040ab){if(_0x2040ab){_0x3bc0b9=_0x2040ab['length'];if(!_0xb26712[_0x2f3f('0x3a')]['hasOwnProperty'](_0x2f3f('0x3f'))){_0x19a0b6[_0x2f3f('0x29')]=qs[_0x2f3f('0x29')](_0xb26712['query'][_0x2f3f('0x29')]);_0x19a0b6['offset']=qs['offset'](_0xb26712[_0x2f3f('0x3a')][_0x2f3f('0x28')]);}return _0x23ad00[_0x2f3f('0x57')](_0x19a0b6);}})['then'](function(_0x21a68e){if(_0x21a68e){return _0x21a68e?{'count':_0x3bc0b9,'rows':_0x21a68e}:null;}})['then'](respondWithResult(_0x3830b4,null))[_0x2f3f('0x25')](handleError(_0x3830b4,null));};exports['getDescriptions']=function(_0x1b1105,_0x5c8648,_0x3cd710){var _0x390423={};var _0x1dc6ca={};var _0x2466a1;var _0x138eb9;return db[_0x2f3f('0x33')][_0x2f3f('0x54')]({'where':{'id':_0x1b1105[_0x2f3f('0x52')]['id']}})[_0x2f3f('0x1b')](handleEntityNotFound(_0x5c8648,null))[_0x2f3f('0x1b')](function(_0xb1a6fe){if(_0xb1a6fe){_0x2466a1=_0xb1a6fe;_0x1dc6ca['model']=_['keys'](db[_0x2f3f('0x55')][_0x2f3f('0x34')]);_0x1dc6ca[_0x2f3f('0x3a')]=_[_0x2f3f('0x4b')](_0x1b1105['query']);_0x1dc6ca[_0x2f3f('0x39')]=_[_0x2f3f('0x4c')](_0x1dc6ca['model'],_0x1dc6ca[_0x2f3f('0x3a')]);_0x390423[_0x2f3f('0x3b')]=_[_0x2f3f('0x4c')](_0x1dc6ca[_0x2f3f('0x37')],qs[_0x2f3f('0x3c')](_0x1b1105['query'][_0x2f3f('0x3c')]));_0x390423[_0x2f3f('0x3b')]=_0x390423['attributes']['length']?_0x390423[_0x2f3f('0x3b')]:_0x1dc6ca[_0x2f3f('0x37')];_0x390423[_0x2f3f('0x56')]=qs[_0x2f3f('0x40')](_0x1b1105['query']['sort']);_0x390423[_0x2f3f('0x42')]=qs[_0x2f3f('0x39')](_[_0x2f3f('0x41')](_0x1b1105[_0x2f3f('0x3a')],_0x1dc6ca[_0x2f3f('0x39')]));if(_0x1b1105[_0x2f3f('0x3a')]['filter']){_0x390423[_0x2f3f('0x42')]=_[_0x2f3f('0x43')](_0x390423['where'],{'$or':_[_0x2f3f('0x38')](_0x390423[_0x2f3f('0x3b')],function(_0x524803){var _0x1445ac={};_0x1445ac[_0x524803]={'$like':'%'+_0x1b1105['query'][_0x2f3f('0x45')]+'%'};return _0x1445ac;})});}_0x390423=_[_0x2f3f('0x43')]({},_0x390423,_0x1b1105[_0x2f3f('0x46')]);return _0x2466a1[_0x2f3f('0x58')](_0x390423);}})[_0x2f3f('0x1b')](function(_0x1a192e){if(_0x1a192e){_0x138eb9=_0x1a192e[_0x2f3f('0x3d')];if(!_0x1b1105['query']['hasOwnProperty'](_0x2f3f('0x3f'))){_0x390423[_0x2f3f('0x29')]=qs[_0x2f3f('0x29')](_0x1b1105[_0x2f3f('0x3a')][_0x2f3f('0x29')]);_0x390423[_0x2f3f('0x28')]=qs[_0x2f3f('0x28')](_0x1b1105['query'][_0x2f3f('0x28')]);}return _0x2466a1[_0x2f3f('0x58')](_0x390423);}})[_0x2f3f('0x1b')](function(_0x55fb6b){if(_0x55fb6b){return _0x55fb6b?{'count':_0x138eb9,'rows':_0x55fb6b}:null;}})[_0x2f3f('0x1b')](respondWithResult(_0x5c8648,null))['catch'](handleError(_0x5c8648,null));};exports[_0x2f3f('0x59')]=function(_0x3cd4a9,_0x2c8770,_0x371a0e){var _0x5de488={};var _0x3e3dbb={};var _0x14e6a9;var _0x314167;return db[_0x2f3f('0x33')][_0x2f3f('0x54')]({'where':{'id':_0x3cd4a9[_0x2f3f('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c8770,null))[_0x2f3f('0x1b')](function(_0x3fd459){if(_0x3fd459){_0x14e6a9=_0x3fd459;_0x3e3dbb['model']=_[_0x2f3f('0x4b')](db[_0x2f3f('0x5a')][_0x2f3f('0x34')]);_0x3e3dbb[_0x2f3f('0x3a')]=_[_0x2f3f('0x4b')](_0x3cd4a9[_0x2f3f('0x3a')]);_0x3e3dbb[_0x2f3f('0x39')]=_[_0x2f3f('0x4c')](_0x3e3dbb[_0x2f3f('0x37')],_0x3e3dbb[_0x2f3f('0x3a')]);_0x5de488[_0x2f3f('0x3b')]=_[_0x2f3f('0x4c')](_0x3e3dbb[_0x2f3f('0x37')],qs['fields'](_0x3cd4a9[_0x2f3f('0x3a')]['fields']));_0x5de488[_0x2f3f('0x3b')]=_0x5de488['attributes']['length']?_0x5de488['attributes']:_0x3e3dbb[_0x2f3f('0x37')];_0x5de488[_0x2f3f('0x56')]=qs[_0x2f3f('0x40')](_0x3cd4a9[_0x2f3f('0x3a')][_0x2f3f('0x40')]);_0x5de488[_0x2f3f('0x42')]=qs[_0x2f3f('0x39')](_[_0x2f3f('0x41')](_0x3cd4a9[_0x2f3f('0x3a')],_0x3e3dbb[_0x2f3f('0x39')]));if(_0x3cd4a9[_0x2f3f('0x3a')]['filter']){_0x5de488[_0x2f3f('0x42')]=_[_0x2f3f('0x43')](_0x5de488[_0x2f3f('0x42')],{'$or':_[_0x2f3f('0x38')](_0x5de488['attributes'],function(_0x30d7c2){var _0x40792e={};_0x40792e[_0x30d7c2]={'$like':'%'+_0x3cd4a9['query'][_0x2f3f('0x45')]+'%'};return _0x40792e;})});}_0x5de488=_['merge']({},_0x5de488,_0x3cd4a9[_0x2f3f('0x46')]);return _0x14e6a9[_0x2f3f('0x59')](_0x5de488);}})[_0x2f3f('0x1b')](function(_0x384584){if(_0x384584){_0x314167=_0x384584['length'];if(!_0x3cd4a9['query']['hasOwnProperty'](_0x2f3f('0x3f'))){_0x5de488[_0x2f3f('0x29')]=qs[_0x2f3f('0x29')](_0x3cd4a9[_0x2f3f('0x3a')][_0x2f3f('0x29')]);_0x5de488[_0x2f3f('0x28')]=qs['offset'](_0x3cd4a9[_0x2f3f('0x3a')]['offset']);}return _0x14e6a9[_0x2f3f('0x59')](_0x5de488);}})['then'](function(_0x411874){if(_0x411874){return _0x411874?{'count':_0x314167,'rows':_0x411874}:null;}})[_0x2f3f('0x1b')](respondWithResult(_0x2c8770,null))['catch'](handleError(_0x2c8770,null));};exports[_0x2f3f('0x5b')]=function(_0x511f3a,_0x3ddcf1,_0x4d7ba4){if(_0x511f3a['body']['id']){delete _0x511f3a[_0x2f3f('0x51')]['id'];}return db[_0x2f3f('0x33')][_0x2f3f('0x54')]({'where':{'id':_0x511f3a[_0x2f3f('0x52')]['id']}})[_0x2f3f('0x1b')](handleEntityNotFound(_0x3ddcf1,null))['then'](function(_0x34e7c4){if(_0x34e7c4){return _0x34e7c4[_0x2f3f('0x5b')](_0x511f3a[_0x2f3f('0x51')]['ids']||[]);}return null;})[_0x2f3f('0x1b')](respondWithResult(_0x3ddcf1,null))['catch'](handleError(_0x3ddcf1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index d78ddfb..8e39748 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 _0xaad2=['ZendeskConfiguration','int_zendesk_configurations','lodash','moment','path','rimraf','exports','define'];(function(_0x3d1a05,_0x59d24a){var _0x44d517=function(_0x2ccee9){while(--_0x2ccee9){_0x3d1a05['push'](_0x3d1a05['shift']());}};_0x44d517(++_0x59d24a);}(_0xaad2,0x18a));var _0x2aad=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xaad2[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x2aad('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2aad('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aad('0x2'));var rimraf=require(_0x2aad('0x3'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x2aad('0x4')]=function(_0x49cf8d,_0x4e8c44){return _0x49cf8d[_0x2aad('0x5')](_0x2aad('0x6'),attributes,{'tableName':_0x2aad('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x610c=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x610c,0xd8));var _0xc610=function(_0x235e7e,_0x5079e9){_0x235e7e=_0x235e7e-0x0;var _0x30410e=_0x610c[_0x235e7e];return _0x30410e;};'use strict';var _=require(_0xc610('0x0'));var util=require(_0xc610('0x1'));var logger=require('../../config/logger')(_0xc610('0x2'));var moment=require(_0xc610('0x3'));var BPromise=require('bluebird');var rp=require(_0xc610('0x4'));var fs=require('fs');var path=require(_0xc610('0x5'));var rimraf=require(_0xc610('0x6'));var config=require(_0xc610('0x7'));var attributes=require(_0xc610('0x8'));module[_0xc610('0x9')]=function(_0x139d04,_0x1b7ff3){return _0x139d04[_0xc610('0xa')](_0xc610('0xb'),attributes,{'tableName':'int_zendesk_configurations','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 a5e2b76..83bb671 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 _0xf407=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','ZendeskConfiguration,\x20%s,\x20%s','catch','util','moment'];(function(_0xc2099f,_0x27a4af){var _0x3df993=function(_0x12f597){while(--_0x12f597){_0xc2099f['push'](_0xc2099f['shift']());}};_0x3df993(++_0x27a4af);}(_0xf407,0xd0));var _0x7f40=function(_0x4a7a57,_0x1164a2){_0x4a7a57=_0x4a7a57-0x0;var _0x4717de=_0xf407[_0x4a7a57];return _0x4717de;};'use strict';var _=require('lodash');var util=require(_0x7f40('0x0'));var moment=require(_0x7f40('0x1'));var BPromise=require(_0x7f40('0x2'));var rs=require(_0x7f40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f40('0x4'))['db'];var utils=require(_0x7f40('0x5'));var logger=require(_0x7f40('0x6'))(_0x7f40('0x7'));var config=require(_0x7f40('0x8'));var jayson=require(_0x7f40('0x9'));var client=jayson[_0x7f40('0xa')][_0x7f40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6ee6,_0x4548ba,_0x30f153){return new BPromise(function(_0xb3022,_0x1a660b){return client[_0x7f40('0xc')](_0x4a6ee6,_0x30f153)[_0x7f40('0xd')](function(_0x1caadd){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4548ba,_0x7f40('0xe'));logger[_0x7f40('0xf')](_0x7f40('0x10'),_0x4548ba,_0x7f40('0xe'),JSON['stringify'](_0x1caadd));if(_0x1caadd[_0x7f40('0x11')]){if(_0x1caadd[_0x7f40('0x11')]['code']===0x1f4){logger[_0x7f40('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4548ba,_0x1caadd[_0x7f40('0x11')][_0x7f40('0x12')]);return _0x1a660b(_0x1caadd[_0x7f40('0x11')][_0x7f40('0x12')]);}logger[_0x7f40('0x11')](_0x7f40('0x13'),_0x4548ba,_0x1caadd['error'][_0x7f40('0x12')]);return _0xb3022(_0x1caadd[_0x7f40('0x11')]['message']);}else{logger['info'](_0x7f40('0x13'),_0x4548ba,'request\x20sent');_0xb3022(_0x1caadd['result'][_0x7f40('0x12')]);}})[_0x7f40('0x14')](function(_0x1c8912){logger['error'](_0x7f40('0x13'),_0x4548ba,_0x1c8912);_0x1a660b(_0x1c8912);});});} \ No newline at end of file +var _0xd83e=['ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xd83e,0x77));var _0xed83=function(_0x1a86d0,_0x568502){_0x1a86d0=_0x1a86d0-0x0;var _0x58a7ee=_0xd83e[_0x1a86d0];return _0x58a7ee;};'use strict';var _=require(_0xed83('0x0'));var util=require(_0xed83('0x1'));var moment=require(_0xed83('0x2'));var BPromise=require(_0xed83('0x3'));var rs=require(_0xed83('0x4'));var fs=require('fs');var Redis=require(_0xed83('0x5'));var db=require(_0xed83('0x6'))['db'];var utils=require(_0xed83('0x7'));var logger=require(_0xed83('0x8'))(_0xed83('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed83('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb770,_0x23925a,_0xa57647){return new BPromise(function(_0x32e491,_0x5508d7){return client['request'](_0x3eb770,_0xa57647)[_0xed83('0xb')](function(_0x486c97){logger[_0xed83('0xc')](_0xed83('0xd'),_0x23925a,'request\x20sent');logger[_0xed83('0xe')](_0xed83('0xf'),_0x23925a,_0xed83('0x10'),JSON[_0xed83('0x11')](_0x486c97));if(_0x486c97[_0xed83('0x12')]){if(_0x486c97[_0xed83('0x12')][_0xed83('0x13')]===0x1f4){logger['error'](_0xed83('0xd'),_0x23925a,_0x486c97['error'][_0xed83('0x14')]);return _0x5508d7(_0x486c97[_0xed83('0x12')][_0xed83('0x14')]);}logger[_0xed83('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x23925a,_0x486c97[_0xed83('0x12')]['message']);return _0x32e491(_0x486c97['error']['message']);}else{logger[_0xed83('0xc')](_0xed83('0xd'),_0x23925a,_0xed83('0x10'));_0x32e491(_0x486c97['result'][_0xed83('0x14')]);}})[_0xed83('0x15')](function(_0x1defce){logger['error'](_0xed83('0xd'),_0x23925a,_0x1defce);_0x5508d7(_0x1defce);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 357e006..8f250f5 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 _0xab9e=['/:id','update','delete','destroy','exports','multer','util','express','../../components/auth/service','./intZendeskField.controller','get','isAuthenticated','show','post','create'];(function(_0x19485f,_0x4f8d0f){var _0xc4f5d9=function(_0x576169){while(--_0x576169){_0x19485f['push'](_0x19485f['shift']());}};_0xc4f5d9(++_0x4f8d0f);}(_0xab9e,0x6e));var _0xeab9=function(_0x2d40de,_0x3434be){_0x2d40de=_0x2d40de-0x0;var _0x3cb15e=_0xab9e[_0x2d40de];return _0x3cb15e;};'use strict';var multer=require(_0xeab9('0x0'));var util=require(_0xeab9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeab9('0x2'));var router=express['Router']();var auth=require(_0xeab9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeab9('0x4'));router[_0xeab9('0x5')]('/',auth[_0xeab9('0x6')](),controller['index']);router['get']('/:id',auth[_0xeab9('0x6')](),controller[_0xeab9('0x7')]);router[_0xeab9('0x8')]('/',auth[_0xeab9('0x6')](),controller[_0xeab9('0x9')]);router['put'](_0xeab9('0xa'),auth[_0xeab9('0x6')](),controller[_0xeab9('0xb')]);router[_0xeab9('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xeab9('0xd')]);module[_0xeab9('0xe')]=router; \ No newline at end of file +var _0xb713=['get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller'];(function(_0x2c6b21,_0x530ac6){var _0x7b6022=function(_0x1da2d7){while(--_0x1da2d7){_0x2c6b21['push'](_0x2c6b21['shift']());}};_0x7b6022(++_0x530ac6);}(_0xb713,0x183));var _0x3b71=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0xb713[_0x1fc4e2];return _0x2ba184;};'use strict';var multer=require(_0x3b71('0x0'));var util=require(_0x3b71('0x1'));var path=require(_0x3b71('0x2'));var timeout=require(_0x3b71('0x3'));var express=require(_0x3b71('0x4'));var router=express[_0x3b71('0x5')]();var auth=require(_0x3b71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3b71('0x7'));var controller=require(_0x3b71('0x8'));router[_0x3b71('0x9')]('/',auth[_0x3b71('0xa')](),controller[_0x3b71('0xb')]);router[_0x3b71('0x9')](_0x3b71('0xc'),auth[_0x3b71('0xa')](),controller[_0x3b71('0xd')]);router[_0x3b71('0xe')]('/',auth[_0x3b71('0xa')](),controller[_0x3b71('0xf')]);router['put'](_0x3b71('0xc'),auth[_0x3b71('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3b71('0xa')](),controller[_0x3b71('0x10')]);module[_0x3b71('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2724424..34c9cb4 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 _0xd449=['ENUM','variable','customVariable','sequelize','string','STRING'];(function(_0x184890,_0x257f1b){var _0x5727d4=function(_0x3b8f9f){while(--_0x3b8f9f){_0x184890['push'](_0x184890['shift']());}};_0x5727d4(++_0x257f1b);}(_0xd449,0x153));var _0x9d44=function(_0x437b02,_0x34b630){_0x437b02=_0x437b02-0x0;var _0xf8c681=_0xd449[_0x437b02];return _0xf8c681;};'use strict';var Sequelize=require(_0x9d44('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue'),'defaultValue':_0x9d44('0x1')},'content':{'type':Sequelize[_0x9d44('0x2')]},'key':{'type':Sequelize[_0x9d44('0x2')]},'keyType':{'type':Sequelize[_0x9d44('0x3')]('string',_0x9d44('0x4'),_0x9d44('0x5'))},'keyContent':{'type':Sequelize[_0x9d44('0x2')]},'idField':{'type':Sequelize[_0x9d44('0x2')]},'nameField':{'type':Sequelize[_0x9d44('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d44('0x2')]}}; \ No newline at end of file +var _0x2367=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2367,0x7f));var _0x7236=function(_0x644000,_0x47a728){_0x644000=_0x644000-0x0;var _0x39a2b6=_0x2367[_0x644000];return _0x39a2b6;};'use strict';var Sequelize=require(_0x7236('0x0'));module[_0x7236('0x1')]={'type':{'type':Sequelize[_0x7236('0x2')]('string',_0x7236('0x3'),_0x7236('0x4'),_0x7236('0x5')),'defaultValue':_0x7236('0x6')},'content':{'type':Sequelize[_0x7236('0x7')]},'key':{'type':Sequelize[_0x7236('0x7')]},'keyType':{'type':Sequelize[_0x7236('0x2')](_0x7236('0x6'),_0x7236('0x3'),_0x7236('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7236('0x7')]},'nameField':{'type':Sequelize[_0x7236('0x7')]},'customField':{'type':Sequelize[_0x7236('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7236('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2306473..5e8b6dd 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 _0x98ef=['filter','options','includeAll','params','ZendeskField','include','merge','find','catch','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x98ef,0x1b6));var _0xf98e=function(_0x542a89,_0x2e4b8a){_0x542a89=_0x542a89-0x0;var _0x267439=_0x98ef[_0x542a89];return _0x267439;};'use strict';var pdf=require(_0xf98e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf98e('0x1'));var zipdir=require(_0xf98e('0x2'));var jsonpatch=require(_0xf98e('0x3'));var rp=require(_0xf98e('0x4'));var moment=require(_0xf98e('0x5'));var BPromise=require(_0xf98e('0x6'));var Mustache=require(_0xf98e('0x7'));var util=require(_0xf98e('0x8'));var path=require('path');var sox=require(_0xf98e('0x9'));var csv=require('to-csv');var ejs=require(_0xf98e('0xa'));var fs=require('fs');var _=require(_0xf98e('0xb'));var squel=require('squel');var crypto=require(_0xf98e('0xc'));var jsforce=require(_0xf98e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf98e('0xe'));var querystring=require(_0xf98e('0xf'));var Papa=require(_0xf98e('0x10'));var Redis=require('ioredis');var authService=require(_0xf98e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf98e('0x12'));var logger=require(_0xf98e('0x13'))(_0xf98e('0x14'));var utils=require(_0xf98e('0x15'));var config=require(_0xf98e('0x16'));var db=require(_0xf98e('0x17'))['db'];function respondWithStatusCode(_0x22671f,_0x496fec){_0x496fec=_0x496fec||0xcc;return function(_0x3c513e){if(_0x3c513e){return _0x22671f[_0xf98e('0x18')](_0x496fec);}return _0x22671f[_0xf98e('0x19')](_0x496fec)[_0xf98e('0x1a')]();};}function respondWithResult(_0x20c457,_0x222ac5){_0x222ac5=_0x222ac5||0xc8;return function(_0x2440e5){if(_0x2440e5){return _0x20c457[_0xf98e('0x19')](_0x222ac5)[_0xf98e('0x1b')](_0x2440e5);}};}function respondWithFilteredResult(_0x1aecc3,_0x3ba602){return function(_0x2bc476){if(_0x2bc476){var _0x73d19a=_0x2bc476[_0xf98e('0x1c')],_0x2ac005=_0x3ba602[_0xf98e('0x1d')],_0x1ee871=_0x3ba602[_0xf98e('0x1d')]+_0x3ba602[_0xf98e('0x1e')],_0x36a8ea;if(_0x1ee871>=_0x73d19a){_0x1ee871=_0x73d19a;_0x36a8ea=0xc8;}else{_0x36a8ea=0xce;}_0x1aecc3[_0xf98e('0x19')](_0x36a8ea);return _0x1aecc3[_0xf98e('0x1f')](_0xf98e('0x20'),_0x2ac005+'-'+_0x1ee871+'/'+_0x73d19a)[_0xf98e('0x1b')](_0x2bc476);}return null;};}function patchUpdates(_0x59a543){return function(_0x78ce5e){try{jsonpatch[_0xf98e('0x21')](_0x78ce5e,_0x59a543,!![]);}catch(_0x2b577f){return BPromise[_0xf98e('0x22')](_0x2b577f);}return _0x78ce5e['save']();};}function saveUpdates(_0x4c99b0,_0x1a9703){return function(_0x166013){if(_0x166013){return _0x166013['update'](_0x4c99b0)[_0xf98e('0x23')](function(_0x19d192){return _0x19d192;});}return null;};}function removeEntity(_0x3231c9,_0x1c5097){return function(_0x2164ed){if(_0x2164ed){return _0x2164ed[_0xf98e('0x24')]()[_0xf98e('0x23')](function(){_0x3231c9['status'](0xcc)[_0xf98e('0x1a')]();});}};}function handleEntityNotFound(_0x39ed3d,_0x47b1c4){return function(_0x12373a){if(!_0x12373a){_0x39ed3d[_0xf98e('0x18')](0x194);}return _0x12373a;};}function handleError(_0x7afe55,_0x274b6e){_0x274b6e=_0x274b6e||0x1f4;return function(_0x2c3833){logger['error'](_0x2c3833[_0xf98e('0x25')]);if(_0x2c3833[_0xf98e('0x26')]){delete _0x2c3833['name'];}_0x7afe55[_0xf98e('0x19')](_0x274b6e)[_0xf98e('0x27')](_0x2c3833);};}exports['index']=function(_0x4a7dcc,_0x2a6ed9){var _0xb727ac={},_0x12788c={},_0x9e458f={'count':0x0,'rows':[]};var _0xe5741a=_[_0xf98e('0x28')](db['ZendeskField'][_0xf98e('0x29')],function(_0x462a16){return{'name':_0x462a16['fieldName'],'type':_0x462a16[_0xf98e('0x2a')][_0xf98e('0x2b')]};});_0x12788c[_0xf98e('0x2c')]=_[_0xf98e('0x28')](_0xe5741a,'name');_0x12788c['query']=_[_0xf98e('0x2d')](_0x4a7dcc[_0xf98e('0x2e')]);_0x12788c[_0xf98e('0x2f')]=_[_0xf98e('0x30')](_0x12788c[_0xf98e('0x2c')],_0x12788c[_0xf98e('0x2e')]);_0xb727ac[_0xf98e('0x31')]=_[_0xf98e('0x30')](_0x12788c['model'],qs[_0xf98e('0x32')](_0x4a7dcc['query'][_0xf98e('0x32')]));_0xb727ac[_0xf98e('0x31')]=_0xb727ac[_0xf98e('0x31')][_0xf98e('0x33')]?_0xb727ac['attributes']:_0x12788c[_0xf98e('0x2c')];if(!_0x4a7dcc[_0xf98e('0x2e')][_0xf98e('0x34')](_0xf98e('0x35'))){_0xb727ac[_0xf98e('0x1e')]=qs['limit'](_0x4a7dcc[_0xf98e('0x2e')]['limit']);_0xb727ac[_0xf98e('0x1d')]=qs[_0xf98e('0x1d')](_0x4a7dcc[_0xf98e('0x2e')][_0xf98e('0x1d')]);}_0xb727ac[_0xf98e('0x36')]=qs[_0xf98e('0x37')](_0x4a7dcc[_0xf98e('0x2e')][_0xf98e('0x37')]);_0xb727ac[_0xf98e('0x38')]=qs[_0xf98e('0x2f')](_[_0xf98e('0x39')](_0x4a7dcc[_0xf98e('0x2e')],_0x12788c[_0xf98e('0x2f')]),_0xe5741a);if(_0x4a7dcc[_0xf98e('0x2e')]['filter']){_0xb727ac[_0xf98e('0x38')]=_['merge'](_0xb727ac[_0xf98e('0x38')],{'$or':_[_0xf98e('0x28')](_0xe5741a,function(_0x2de666){if(_0x2de666[_0xf98e('0x2a')]!==_0xf98e('0x3a')){var _0x4f9a33={};_0x4f9a33[_0x2de666[_0xf98e('0x26')]]={'$like':'%'+_0x4a7dcc[_0xf98e('0x2e')][_0xf98e('0x3b')]+'%'};return _0x4f9a33;}})});}_0xb727ac=_['merge']({},_0xb727ac,_0x4a7dcc[_0xf98e('0x3c')]);var _0x11a4b7={'where':_0xb727ac['where']};return db['ZendeskField']['count'](_0x11a4b7)[_0xf98e('0x23')](function(_0x59ee7f){_0x9e458f[_0xf98e('0x1c')]=_0x59ee7f;if(_0x4a7dcc[_0xf98e('0x2e')][_0xf98e('0x3d')]){_0xb727ac['include']=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0xb727ac);})[_0xf98e('0x23')](function(_0x41c14f){_0x9e458f['rows']=_0x41c14f;return _0x9e458f;})['then'](respondWithFilteredResult(_0x2a6ed9,_0xb727ac))['catch'](handleError(_0x2a6ed9,null));};exports['show']=function(_0x4eb7ee,_0x4e2dc8){var _0xcf866d={'raw':!![],'where':{'id':_0x4eb7ee[_0xf98e('0x3e')]['id']}},_0x381f0e={};_0x381f0e['model']=_[_0xf98e('0x2d')](db[_0xf98e('0x3f')][_0xf98e('0x29')]);_0x381f0e[_0xf98e('0x2e')]=_[_0xf98e('0x2d')](_0x4eb7ee[_0xf98e('0x2e')]);_0x381f0e['filters']=_['intersection'](_0x381f0e[_0xf98e('0x2c')],_0x381f0e[_0xf98e('0x2e')]);_0xcf866d[_0xf98e('0x31')]=_[_0xf98e('0x30')](_0x381f0e[_0xf98e('0x2c')],qs[_0xf98e('0x32')](_0x4eb7ee[_0xf98e('0x2e')]['fields']));_0xcf866d[_0xf98e('0x31')]=_0xcf866d[_0xf98e('0x31')][_0xf98e('0x33')]?_0xcf866d[_0xf98e('0x31')]:_0x381f0e[_0xf98e('0x2c')];if(_0x4eb7ee[_0xf98e('0x2e')][_0xf98e('0x3d')]){_0xcf866d[_0xf98e('0x40')]=[{'all':!![]}];}_0xcf866d=_[_0xf98e('0x41')]({},_0xcf866d,_0x4eb7ee[_0xf98e('0x3c')]);return db['ZendeskField'][_0xf98e('0x42')](_0xcf866d)[_0xf98e('0x23')](handleEntityNotFound(_0x4e2dc8,null))[_0xf98e('0x23')](respondWithResult(_0x4e2dc8,null))[_0xf98e('0x43')](handleError(_0x4e2dc8,null));};exports[_0xf98e('0x44')]=function(_0x2b3c65,_0x11efcb){return db[_0xf98e('0x3f')][_0xf98e('0x44')](_0x2b3c65[_0xf98e('0x45')],{})[_0xf98e('0x23')](respondWithResult(_0x11efcb,0xc9))[_0xf98e('0x43')](handleError(_0x11efcb,null));};exports[_0xf98e('0x46')]=function(_0x5b6cad,_0x502280){if(_0x5b6cad[_0xf98e('0x45')]['id']){delete _0x5b6cad[_0xf98e('0x45')]['id'];}return db[_0xf98e('0x3f')][_0xf98e('0x42')]({'where':{'id':_0x5b6cad[_0xf98e('0x3e')]['id']}})[_0xf98e('0x23')](handleEntityNotFound(_0x502280,null))[_0xf98e('0x23')](saveUpdates(_0x5b6cad['body'],null))[_0xf98e('0x23')](respondWithResult(_0x502280,null))[_0xf98e('0x43')](handleError(_0x502280,null));};exports[_0xf98e('0x24')]=function(_0x151961,_0x3c979f){return db[_0xf98e('0x3f')][_0xf98e('0x42')]({'where':{'id':_0x151961[_0xf98e('0x3e')]['id']}})[_0xf98e('0x23')](handleEntityNotFound(_0x3c979f,null))['then'](removeEntity(_0x3c979f,null))[_0xf98e('0x43')](handleError(_0x3c979f,null));}; \ No newline at end of file +var _0x4a5a=['then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','rows','show','params','keys','include','find','catch','create','body','html-pdf','eml-format','request-promise','bluebird','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x2a2305,_0x3b637e){var _0x2c9567=function(_0x5b8476){while(--_0x5b8476){_0x2a2305['push'](_0x2a2305['shift']());}};_0x2c9567(++_0x3b637e);}(_0x4a5a,0x16e));var _0xa4a5=function(_0x2ed544,_0x268e05){_0x2ed544=_0x2ed544-0x0;var _0x370ffe=_0x4a5a[_0x2ed544];return _0x370ffe;};'use strict';var pdf=require(_0xa4a5('0x0'));var emlformat=require(_0xa4a5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa4a5('0x2'));var moment=require('moment');var BPromise=require(_0xa4a5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa4a5('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa4a5('0x5'));var crypto=require(_0xa4a5('0x6'));var jsforce=require(_0xa4a5('0x7'));var deskjs=require(_0xa4a5('0x8'));var toCsv=require(_0xa4a5('0x4'));var querystring=require(_0xa4a5('0x9'));var Papa=require(_0xa4a5('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa4a5('0xb'));var hardwareService=require(_0xa4a5('0xc'));var logger=require(_0xa4a5('0xd'))(_0xa4a5('0xe'));var utils=require('../../config/utils');var config=require(_0xa4a5('0xf'));var db=require(_0xa4a5('0x10'))['db'];function respondWithStatusCode(_0x35e273,_0x11ab48){_0x11ab48=_0x11ab48||0xcc;return function(_0x384dfa){if(_0x384dfa){return _0x35e273[_0xa4a5('0x11')](_0x11ab48);}return _0x35e273[_0xa4a5('0x12')](_0x11ab48)[_0xa4a5('0x13')]();};}function respondWithResult(_0x1d7eb6,_0x33a67a){_0x33a67a=_0x33a67a||0xc8;return function(_0x3ee642){if(_0x3ee642){return _0x1d7eb6[_0xa4a5('0x12')](_0x33a67a)[_0xa4a5('0x14')](_0x3ee642);}};}function respondWithFilteredResult(_0x2804fe,_0xeef2b6){return function(_0x5d8838){if(_0x5d8838){var _0x2cf924=_0x5d8838[_0xa4a5('0x15')],_0x595a7a=_0xeef2b6[_0xa4a5('0x16')],_0x9ade16=_0xeef2b6[_0xa4a5('0x16')]+_0xeef2b6[_0xa4a5('0x17')],_0x2f81ad;if(_0x9ade16>=_0x2cf924){_0x9ade16=_0x2cf924;_0x2f81ad=0xc8;}else{_0x2f81ad=0xce;}_0x2804fe[_0xa4a5('0x12')](_0x2f81ad);return _0x2804fe[_0xa4a5('0x18')](_0xa4a5('0x19'),_0x595a7a+'-'+_0x9ade16+'/'+_0x2cf924)[_0xa4a5('0x14')](_0x5d8838);}return null;};}function patchUpdates(_0x2f042d){return function(_0x4d5bb8){try{jsonpatch[_0xa4a5('0x1a')](_0x4d5bb8,_0x2f042d,!![]);}catch(_0x2bd0ad){return BPromise[_0xa4a5('0x1b')](_0x2bd0ad);}return _0x4d5bb8[_0xa4a5('0x1c')]();};}function saveUpdates(_0x2aaead,_0x11fa7d){return function(_0x58daef){if(_0x58daef){return _0x58daef[_0xa4a5('0x1d')](_0x2aaead)[_0xa4a5('0x1e')](function(_0x174168){return _0x174168;});}return null;};}function removeEntity(_0x4560f1,_0x5d7a3b){return function(_0x4a8e8d){if(_0x4a8e8d){return _0x4a8e8d[_0xa4a5('0x1f')]()[_0xa4a5('0x1e')](function(){_0x4560f1[_0xa4a5('0x12')](0xcc)[_0xa4a5('0x13')]();});}};}function handleEntityNotFound(_0x134d95,_0x81d74d){return function(_0x203b13){if(!_0x203b13){_0x134d95[_0xa4a5('0x11')](0x194);}return _0x203b13;};}function handleError(_0x43488a,_0x4b480d){_0x4b480d=_0x4b480d||0x1f4;return function(_0x287d70){logger[_0xa4a5('0x20')](_0x287d70[_0xa4a5('0x21')]);if(_0x287d70[_0xa4a5('0x22')]){delete _0x287d70[_0xa4a5('0x22')];}_0x43488a[_0xa4a5('0x12')](_0x4b480d)['send'](_0x287d70);};}exports[_0xa4a5('0x23')]=function(_0x335ecf,_0x41b78e){var _0x694457={},_0x310f7={},_0x528d31={'count':0x0,'rows':[]};var _0x2c5cd1=_[_0xa4a5('0x24')](db[_0xa4a5('0x25')][_0xa4a5('0x26')],function(_0xa0ef26){return{'name':_0xa0ef26[_0xa4a5('0x27')],'type':_0xa0ef26[_0xa4a5('0x28')]['key']};});_0x310f7[_0xa4a5('0x29')]=_[_0xa4a5('0x24')](_0x2c5cd1,_0xa4a5('0x22'));_0x310f7[_0xa4a5('0x2a')]=_['keys'](_0x335ecf[_0xa4a5('0x2a')]);_0x310f7[_0xa4a5('0x2b')]=_[_0xa4a5('0x2c')](_0x310f7[_0xa4a5('0x29')],_0x310f7[_0xa4a5('0x2a')]);_0x694457[_0xa4a5('0x2d')]=_[_0xa4a5('0x2c')](_0x310f7[_0xa4a5('0x29')],qs[_0xa4a5('0x2e')](_0x335ecf[_0xa4a5('0x2a')]['fields']));_0x694457['attributes']=_0x694457[_0xa4a5('0x2d')][_0xa4a5('0x2f')]?_0x694457[_0xa4a5('0x2d')]:_0x310f7[_0xa4a5('0x29')];if(!_0x335ecf[_0xa4a5('0x2a')]['hasOwnProperty'](_0xa4a5('0x30'))){_0x694457[_0xa4a5('0x17')]=qs[_0xa4a5('0x17')](_0x335ecf[_0xa4a5('0x2a')]['limit']);_0x694457[_0xa4a5('0x16')]=qs[_0xa4a5('0x16')](_0x335ecf[_0xa4a5('0x2a')][_0xa4a5('0x16')]);}_0x694457[_0xa4a5('0x31')]=qs[_0xa4a5('0x32')](_0x335ecf[_0xa4a5('0x2a')]['sort']);_0x694457['where']=qs[_0xa4a5('0x2b')](_[_0xa4a5('0x33')](_0x335ecf[_0xa4a5('0x2a')],_0x310f7[_0xa4a5('0x2b')]),_0x2c5cd1);if(_0x335ecf[_0xa4a5('0x2a')][_0xa4a5('0x34')]){_0x694457[_0xa4a5('0x35')]=_[_0xa4a5('0x36')](_0x694457[_0xa4a5('0x35')],{'$or':_[_0xa4a5('0x24')](_0x2c5cd1,function(_0x3de6c9){if(_0x3de6c9[_0xa4a5('0x28')]!=='VIRTUAL'){var _0x1a7e92={};_0x1a7e92[_0x3de6c9[_0xa4a5('0x22')]]={'$like':'%'+_0x335ecf[_0xa4a5('0x2a')][_0xa4a5('0x34')]+'%'};return _0x1a7e92;}})});}_0x694457=_['merge']({},_0x694457,_0x335ecf[_0xa4a5('0x37')]);var _0x368025={'where':_0x694457[_0xa4a5('0x35')]};return db[_0xa4a5('0x25')][_0xa4a5('0x15')](_0x368025)[_0xa4a5('0x1e')](function(_0x404759){_0x528d31[_0xa4a5('0x15')]=_0x404759;if(_0x335ecf[_0xa4a5('0x2a')][_0xa4a5('0x38')]){_0x694457['include']=[{'all':!![]}];}return db[_0xa4a5('0x25')]['findAll'](_0x694457);})['then'](function(_0x4c61fd){_0x528d31[_0xa4a5('0x39')]=_0x4c61fd;return _0x528d31;})['then'](respondWithFilteredResult(_0x41b78e,_0x694457))['catch'](handleError(_0x41b78e,null));};exports[_0xa4a5('0x3a')]=function(_0x168530,_0x20e820){var _0x4bae48={'raw':!![],'where':{'id':_0x168530[_0xa4a5('0x3b')]['id']}},_0xd9c06b={};_0xd9c06b['model']=_['keys'](db[_0xa4a5('0x25')][_0xa4a5('0x26')]);_0xd9c06b[_0xa4a5('0x2a')]=_[_0xa4a5('0x3c')](_0x168530[_0xa4a5('0x2a')]);_0xd9c06b[_0xa4a5('0x2b')]=_[_0xa4a5('0x2c')](_0xd9c06b[_0xa4a5('0x29')],_0xd9c06b[_0xa4a5('0x2a')]);_0x4bae48['attributes']=_[_0xa4a5('0x2c')](_0xd9c06b['model'],qs['fields'](_0x168530[_0xa4a5('0x2a')]['fields']));_0x4bae48[_0xa4a5('0x2d')]=_0x4bae48[_0xa4a5('0x2d')]['length']?_0x4bae48[_0xa4a5('0x2d')]:_0xd9c06b[_0xa4a5('0x29')];if(_0x168530[_0xa4a5('0x2a')][_0xa4a5('0x38')]){_0x4bae48[_0xa4a5('0x3d')]=[{'all':!![]}];}_0x4bae48=_[_0xa4a5('0x36')]({},_0x4bae48,_0x168530[_0xa4a5('0x37')]);return db[_0xa4a5('0x25')][_0xa4a5('0x3e')](_0x4bae48)['then'](handleEntityNotFound(_0x20e820,null))[_0xa4a5('0x1e')](respondWithResult(_0x20e820,null))[_0xa4a5('0x3f')](handleError(_0x20e820,null));};exports['create']=function(_0x2dd062,_0x24c9d8){return db[_0xa4a5('0x25')][_0xa4a5('0x40')](_0x2dd062[_0xa4a5('0x41')],{})['then'](respondWithResult(_0x24c9d8,0xc9))[_0xa4a5('0x3f')](handleError(_0x24c9d8,null));};exports['update']=function(_0x588982,_0x2d0cc2){if(_0x588982['body']['id']){delete _0x588982['body']['id'];}return db[_0xa4a5('0x25')][_0xa4a5('0x3e')]({'where':{'id':_0x588982[_0xa4a5('0x3b')]['id']}})[_0xa4a5('0x1e')](handleEntityNotFound(_0x2d0cc2,null))[_0xa4a5('0x1e')](saveUpdates(_0x588982[_0xa4a5('0x41')],null))[_0xa4a5('0x1e')](respondWithResult(_0x2d0cc2,null))['catch'](handleError(_0x2d0cc2,null));};exports[_0xa4a5('0x1f')]=function(_0x181948,_0x40dc9c){return db[_0xa4a5('0x25')][_0xa4a5('0x3e')]({'where':{'id':_0x181948[_0xa4a5('0x3b')]['id']}})[_0xa4a5('0x1e')](handleEntityNotFound(_0x40dc9c,null))[_0xa4a5('0x1e')](removeEntity(_0x40dc9c,null))[_0xa4a5('0x3f')](handleError(_0x40dc9c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 54220ae..d5810ae 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 _0x1752=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1752,0xa5));var _0x2175=function(_0x22fb7a,_0xc5e0c7){_0x22fb7a=_0x22fb7a-0x0;var _0x1049d1=_0x1752[_0x22fb7a];return _0x1049d1;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var logger=require(_0x2175('0x1'))(_0x2175('0x2'));var moment=require(_0x2175('0x3'));var BPromise=require(_0x2175('0x4'));var rp=require(_0x2175('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2175('0x6'));var config=require(_0x2175('0x7'));var attributes=require(_0x2175('0x8'));module[_0x2175('0x9')]=function(_0x222868,_0x27ff0b){return _0x222868[_0x2175('0xa')](_0x2175('0xb'),attributes,{'tableName':_0x2175('0xc'),'paranoid':![],'indexes':[{'name':_0x2175('0xd'),'fields':['idField',_0x2175('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x878f=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11d2e6,_0x48c9b3){var _0x3c81da=function(_0x565120){while(--_0x565120){_0x11d2e6['push'](_0x11d2e6['shift']());}};_0x3c81da(++_0x48c9b3);}(_0x878f,0x173));var _0xf878=function(_0x49b4a3,_0x447dd6){_0x49b4a3=_0x49b4a3-0x0;var _0x3cf3c7=_0x878f[_0x49b4a3];return _0x3cf3c7;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xf878('0xd')],'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 aafa576..4ae1c86 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 _0xd0ec=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x231103,_0x57b8c0){var _0x3c4718=function(_0x51411c){while(--_0x51411c){_0x231103['push'](_0x231103['shift']());}};_0x3c4718(++_0x57b8c0);}(_0xd0ec,0x14d));var _0xcd0e=function(_0x4cc5be,_0x428734){_0x4cc5be=_0x4cc5be-0x0;var _0x543e21=_0xd0ec[_0x4cc5be];return _0x543e21;};'use strict';var _=require(_0xcd0e('0x0'));var util=require(_0xcd0e('0x1'));var moment=require(_0xcd0e('0x2'));var BPromise=require(_0xcd0e('0x3'));var rs=require(_0xcd0e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd0e('0x5'))(_0xcd0e('0x6'));var config=require(_0xcd0e('0x7'));var jayson=require(_0xcd0e('0x8'));var client=jayson[_0xcd0e('0x9')][_0xcd0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477854,_0x47753b,_0x39d5c3){return new BPromise(function(_0xfd2989,_0x4829af){return client[_0xcd0e('0xb')](_0x477854,_0x39d5c3)[_0xcd0e('0xc')](function(_0x2812b8){logger[_0xcd0e('0xd')](_0xcd0e('0xe'),_0x47753b,_0xcd0e('0xf'));logger['debug'](_0xcd0e('0x10'),_0x47753b,_0xcd0e('0xf'),JSON[_0xcd0e('0x11')](_0x2812b8));if(_0x2812b8['error']){if(_0x2812b8[_0xcd0e('0x12')][_0xcd0e('0x13')]===0x1f4){logger[_0xcd0e('0x12')](_0xcd0e('0xe'),_0x47753b,_0x2812b8[_0xcd0e('0x12')][_0xcd0e('0x14')]);return _0x4829af(_0x2812b8[_0xcd0e('0x12')][_0xcd0e('0x14')]);}logger[_0xcd0e('0x12')]('ZendeskField,\x20%s,\x20%s',_0x47753b,_0x2812b8[_0xcd0e('0x12')][_0xcd0e('0x14')]);return _0xfd2989(_0x2812b8['error'][_0xcd0e('0x14')]);}else{logger[_0xcd0e('0xd')](_0xcd0e('0xe'),_0x47753b,_0xcd0e('0xf'));_0xfd2989(_0x2812b8[_0xcd0e('0x15')][_0xcd0e('0x14')]);}})[_0xcd0e('0x16')](function(_0x178488){logger['error'](_0xcd0e('0xe'),_0x47753b,_0x178488);_0x4829af(_0x178488);});});} \ No newline at end of file +var _0xc8e5=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','code','ZendeskField,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2bef0c,_0x4b30f1){var _0x16ccd3=function(_0x12ab66){while(--_0x12ab66){_0x2bef0c['push'](_0x2bef0c['shift']());}};_0x16ccd3(++_0x4b30f1);}(_0xc8e5,0x1db));var _0x5c8e=function(_0x2e82e1,_0x4b0601){_0x2e82e1=_0x2e82e1-0x0;var _0x5a51fb=_0xc8e5[_0x2e82e1];return _0x5a51fb;};'use strict';var _=require(_0x5c8e('0x0'));var util=require(_0x5c8e('0x1'));var moment=require(_0x5c8e('0x2'));var BPromise=require(_0x5c8e('0x3'));var rs=require(_0x5c8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5c8e('0x5'))(_0x5c8e('0x6'));var config=require(_0x5c8e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5c8e('0x8')][_0x5c8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f4a70,_0x167864,_0x17dd74){return new BPromise(function(_0x1e9495,_0x5efedb){return client['request'](_0x2f4a70,_0x17dd74)[_0x5c8e('0xa')](function(_0x599e43){logger[_0x5c8e('0xb')]('ZendeskField,\x20%s,\x20%s',_0x167864,_0x5c8e('0xc'));logger[_0x5c8e('0xd')](_0x5c8e('0xe'),_0x167864,_0x5c8e('0xc'),JSON['stringify'](_0x599e43));if(_0x599e43['error']){if(_0x599e43['error'][_0x5c8e('0xf')]===0x1f4){logger['error'](_0x5c8e('0x10'),_0x167864,_0x599e43[_0x5c8e('0x11')][_0x5c8e('0x12')]);return _0x5efedb(_0x599e43[_0x5c8e('0x11')][_0x5c8e('0x12')]);}logger[_0x5c8e('0x11')](_0x5c8e('0x10'),_0x167864,_0x599e43['error'][_0x5c8e('0x12')]);return _0x1e9495(_0x599e43[_0x5c8e('0x11')][_0x5c8e('0x12')]);}else{logger[_0x5c8e('0xb')](_0x5c8e('0x10'),_0x167864,'request\x20sent');_0x1e9495(_0x599e43['result']['message']);}})[_0x5c8e('0x13')](function(_0x307e88){logger[_0x5c8e('0x11')]('ZendeskField,\x20%s,\x20%s',_0x167864,_0x307e88);_0x5efedb(_0x307e88);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 281da3f..5a5c2b1 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 _0x4763=['/:id/fields','post','create','addConfiguration','put','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','getConfigurations'];(function(_0xd93e8f,_0x23363f){var _0x505025=function(_0x5ce1b1){while(--_0x5ce1b1){_0xd93e8f['push'](_0xd93e8f['shift']());}};_0x505025(++_0x23363f);}(_0x4763,0x16f));var _0x3476=function(_0x206477,_0x81c2be){_0x206477=_0x206477-0x0;var _0x3a0992=_0x4763[_0x206477];return _0x3a0992;};'use strict';var multer=require('multer');var util=require(_0x3476('0x0'));var path=require(_0x3476('0x1'));var timeout=require(_0x3476('0x2'));var express=require(_0x3476('0x3'));var router=express[_0x3476('0x4')]();var auth=require(_0x3476('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3476('0x6'));var controller=require(_0x3476('0x7'));router[_0x3476('0x8')]('/',auth[_0x3476('0x9')](),controller['index']);router[_0x3476('0x8')]('/:id',auth[_0x3476('0x9')](),controller['show']);router[_0x3476('0x8')]('/:id/configurations',auth[_0x3476('0x9')](),controller[_0x3476('0xa')]);router[_0x3476('0x8')](_0x3476('0xb'),auth[_0x3476('0x9')](),controller['getFields']);router[_0x3476('0xc')]('/',auth[_0x3476('0x9')](),controller[_0x3476('0xd')]);router[_0x3476('0xc')]('/:id/configurations',auth[_0x3476('0x9')](),controller[_0x3476('0xe')]);router[_0x3476('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3476('0x10'),auth[_0x3476('0x9')](),controller['destroy']);module[_0x3476('0x11')]=router; \ No newline at end of file +var _0xca46=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x1baf7e,_0x3d4ef8){var _0x19c0a9=function(_0x154652){while(--_0x154652){_0x1baf7e['push'](_0x1baf7e['shift']());}};_0x19c0a9(++_0x3d4ef8);}(_0xca46,0x1e4));var _0x6ca4=function(_0x5064ec,_0x34fe4d){_0x5064ec=_0x5064ec-0x0;var _0x2317f1=_0xca46[_0x5064ec];return _0x2317f1;};'use strict';var multer=require('multer');var util=require(_0x6ca4('0x0'));var path=require(_0x6ca4('0x1'));var timeout=require(_0x6ca4('0x2'));var express=require(_0x6ca4('0x3'));var router=express[_0x6ca4('0x4')]();var auth=require(_0x6ca4('0x5'));var interaction=require(_0x6ca4('0x6'));var config=require(_0x6ca4('0x7'));var controller=require(_0x6ca4('0x8'));router[_0x6ca4('0x9')]('/',auth[_0x6ca4('0xa')](),controller['index']);router['get'](_0x6ca4('0xb'),auth[_0x6ca4('0xa')](),controller['show']);router[_0x6ca4('0x9')]('/:id/configurations',auth[_0x6ca4('0xa')](),controller[_0x6ca4('0xc')]);router[_0x6ca4('0x9')](_0x6ca4('0xd'),auth['isAuthenticated'](),controller[_0x6ca4('0xe')]);router[_0x6ca4('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6ca4('0x10'),auth[_0x6ca4('0xa')](),controller[_0x6ca4('0x11')]);router[_0x6ca4('0x12')](_0x6ca4('0xb'),auth[_0x6ca4('0xa')](),controller[_0x6ca4('0x13')]);router[_0x6ca4('0x14')](_0x6ca4('0xb'),auth['isAuthenticated'](),controller[_0x6ca4('0x15')]);module[_0x6ca4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 1b57953..ffcf40c 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 _0x4fcd=['STRING','sequelize','exports'];(function(_0x131d0a,_0x14523d){var _0x1bdb23=function(_0x1ac99f){while(--_0x1ac99f){_0x131d0a['push'](_0x131d0a['shift']());}};_0x1bdb23(++_0x14523d);}(_0x4fcd,0xc1));var _0xd4fc=function(_0x2613ae,_0x182ecd){_0x2613ae=_0x2613ae-0x0;var _0x36c1fe=_0x4fcd[_0x2613ae];return _0x36c1fe;};'use strict';var Sequelize=require(_0xd4fc('0x0'));module[_0xd4fc('0x1')]={'name':{'type':Sequelize[_0xd4fc('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd4fc('0x2')]},'zone':{'type':Sequelize[_0xd4fc('0x2')]},'clientId':{'type':Sequelize[_0xd4fc('0x2')]},'clientSecret':{'type':Sequelize[_0xd4fc('0x2')]},'serverUrl':{'type':Sequelize[_0xd4fc('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xd4fc('0x2')]}}; \ No newline at end of file +var _0x70eb=['STRING'];(function(_0x117f29,_0x19912c){var _0x1e5177=function(_0x4519ea){while(--_0x4519ea){_0x117f29['push'](_0x117f29['shift']());}};_0x1e5177(++_0x19912c);}(_0x70eb,0x153));var _0xb70e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x70eb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb70e('0x0')]},'description':{'type':Sequelize[_0xb70e('0x0')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb70e('0x0')]},'clientId':{'type':Sequelize[_0xb70e('0x0')]},'clientSecret':{'type':Sequelize[_0xb70e('0x0')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xb70e('0x0')]},'refreshToken':{'type':Sequelize[_0xb70e('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 8050db9..1cfe1e8 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 _0xad48=['lodash','squel','crypto','desk.js','to-csv','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','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','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','apply','save','update','destroy','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','params','keys','length','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Result','Call_Type','includes','api_name','system_mandatory','data_type','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x58d620,_0x31a57f){var _0x32d4cc=function(_0x31d483){while(--_0x31d483){_0x58d620['push'](_0x58d620['shift']());}};_0x32d4cc(++_0x31a57f);}(_0xad48,0x101));var _0x8ad4=function(_0x1b6fd0,_0xe625fe){_0x1b6fd0=_0x1b6fd0-0x0;var _0x3bea01=_0xad48[_0x1b6fd0];return _0x3bea01;};'use strict';var pdf=require(_0x8ad4('0x0'));var emlformat=require(_0x8ad4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ad4('0x2'));var rp=require('request-promise');var moment=require(_0x8ad4('0x3'));var BPromise=require(_0x8ad4('0x4'));var Mustache=require(_0x8ad4('0x5'));var util=require(_0x8ad4('0x6'));var path=require(_0x8ad4('0x7'));var sox=require(_0x8ad4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8ad4('0x9'));var squel=require(_0x8ad4('0xa'));var crypto=require(_0x8ad4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8ad4('0xc'));var toCsv=require(_0x8ad4('0xd'));var querystring=require(_0x8ad4('0xe'));var Papa=require(_0x8ad4('0xf'));var Redis=require(_0x8ad4('0x10'));var authService=require(_0x8ad4('0x11'));var qs=require(_0x8ad4('0x12'));var as=require(_0x8ad4('0x13'));var hardwareService=require(_0x8ad4('0x14'));var logger=require(_0x8ad4('0x15'))('api');var utils=require(_0x8ad4('0x16'));var config=require(_0x8ad4('0x17'));var db=require(_0x8ad4('0x18'))['db'];var integrations=require(_0x8ad4('0x19'));var jayson=require(_0x8ad4('0x1a'));var client=jayson[_0x8ad4('0x1b')][_0x8ad4('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5815b6,_0x416502,_0x635d42){if(_0x635d42){var _0x6dc061=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6dc061[_0x8ad4('0x1d')](_0x416502)){return _0x5815b6;}else{throw new db[(_0x8ad4('0x1e'))][(_0x8ad4('0x1f'))](_0x8ad4('0x20'));}}else{return _0x5815b6;}}function respondWithRpcPromise(_0x92231b,_0x45067b,_0x4717a5,_0x4f52b6){return new BPromise(function(_0x1671f1,_0x1b53da){var _0x20b66c=_0x4f52b6||client;return _0x20b66c[_0x8ad4('0x21')](_0x92231b,_0x4717a5)[_0x8ad4('0x22')](function(_0x4763dd){logger[_0x8ad4('0x23')](_0x8ad4('0x24'),_0x45067b,_0x8ad4('0x25'));logger['debug'](_0x8ad4('0x26'),_0x45067b,_0x8ad4('0x25'),JSON[_0x8ad4('0x27')](_0x4763dd));if(_0x4763dd['error']){if(_0x4763dd[_0x8ad4('0x28')][_0x8ad4('0x29')]===0x1f4){logger['error'](_0x8ad4('0x24'),_0x45067b,_0x4763dd[_0x8ad4('0x28')][_0x8ad4('0x2a')]);return _0x1b53da(_0x4763dd[_0x8ad4('0x28')][_0x8ad4('0x2a')]);}logger[_0x8ad4('0x28')](_0x8ad4('0x24'),_0x45067b,_0x4763dd['error'][_0x8ad4('0x2a')]);return _0x1671f1(_0x4763dd['error'][_0x8ad4('0x2a')]);}else{logger[_0x8ad4('0x23')](_0x8ad4('0x24'),_0x45067b,_0x8ad4('0x25'));_0x1671f1(_0x4763dd['result'][_0x8ad4('0x2a')]);}})['catch'](function(_0x2f1136){logger[_0x8ad4('0x28')]('ZohoAccount,\x20%s,\x20%s',_0x45067b,_0x2f1136);_0x1b53da(_0x2f1136);});});}function respondWithStatusCode(_0x26e241,_0x5e999f){_0x5e999f=_0x5e999f||0xcc;return function(_0x95dd6){if(_0x95dd6){return _0x26e241[_0x8ad4('0x2b')](_0x5e999f);}return _0x26e241[_0x8ad4('0x2c')](_0x5e999f)[_0x8ad4('0x2d')]();};}function respondWithResult(_0x737c5c,_0x15cc8e){_0x15cc8e=_0x15cc8e||0xc8;return function(_0x163c00){if(_0x163c00){return _0x737c5c[_0x8ad4('0x2c')](_0x15cc8e)[_0x8ad4('0x2e')](_0x163c00);}};}function respondWithFilteredResult(_0x40dd9c,_0x220dfe){return function(_0x42ec2a){if(_0x42ec2a){var _0x4b0d70=_0x42ec2a[_0x8ad4('0x2f')],_0x1f47da=_0x220dfe['offset'],_0xb29852=_0x220dfe[_0x8ad4('0x30')]+_0x220dfe[_0x8ad4('0x31')],_0x4ce3de;if(_0xb29852>=_0x4b0d70){_0xb29852=_0x4b0d70;_0x4ce3de=0xc8;}else{_0x4ce3de=0xce;}_0x40dd9c[_0x8ad4('0x2c')](_0x4ce3de);return _0x40dd9c['set']('Content-Range',_0x1f47da+'-'+_0xb29852+'/'+_0x4b0d70)[_0x8ad4('0x2e')](_0x42ec2a);}return null;};}function patchUpdates(_0x496ebc){return function(_0x5cb2ba){try{jsonpatch[_0x8ad4('0x32')](_0x5cb2ba,_0x496ebc,!![]);}catch(_0x196c77){return BPromise['reject'](_0x196c77);}return _0x5cb2ba[_0x8ad4('0x33')]();};}function saveUpdates(_0x14009c,_0x167608){return function(_0x416514){if(_0x416514){return _0x416514[_0x8ad4('0x34')](_0x14009c)['then'](function(_0x488361){return _0x488361;});}return null;};}function removeEntity(_0xcfb327,_0x46b9a5){return function(_0x2051f1){if(_0x2051f1){return _0x2051f1[_0x8ad4('0x35')]()[_0x8ad4('0x22')](function(){_0xcfb327[_0x8ad4('0x2c')](0xcc)[_0x8ad4('0x2d')]();});}};}function handleEntityNotFound(_0x556b63,_0x1a4e77){return function(_0x1ca518){if(!_0x1ca518){_0x556b63[_0x8ad4('0x2b')](0x194);}return _0x1ca518;};}function handleError(_0x1cd42c,_0x531714){_0x531714=_0x531714||0x1f4;return function(_0x325b81){logger[_0x8ad4('0x28')](_0x325b81['stack']);if(_0x325b81[_0x8ad4('0x36')]){delete _0x325b81['name'];}_0x1cd42c[_0x8ad4('0x2c')](_0x531714)[_0x8ad4('0x37')](_0x325b81);};}exports[_0x8ad4('0x38')]=function(_0x12e098,_0x4ee53c){var _0xf1b9c2={},_0x58fc07={},_0x2abe93={'count':0x0,'rows':[]};var _0x2993a3=_['map'](db[_0x8ad4('0x39')][_0x8ad4('0x3a')],function(_0x4098e9){return{'name':_0x4098e9[_0x8ad4('0x3b')],'type':_0x4098e9[_0x8ad4('0x3c')][_0x8ad4('0x3d')]};});_0x58fc07[_0x8ad4('0x3e')]=_[_0x8ad4('0x3f')](_0x2993a3,'name');_0x58fc07[_0x8ad4('0x40')]=_['keys'](_0x12e098[_0x8ad4('0x40')]);_0x58fc07[_0x8ad4('0x41')]=_[_0x8ad4('0x42')](_0x58fc07['model'],_0x58fc07[_0x8ad4('0x40')]);_0xf1b9c2[_0x8ad4('0x43')]=_[_0x8ad4('0x42')](_0x58fc07['model'],qs[_0x8ad4('0x44')](_0x12e098[_0x8ad4('0x40')][_0x8ad4('0x44')]));_0xf1b9c2[_0x8ad4('0x43')]=_0xf1b9c2[_0x8ad4('0x43')]['length']?_0xf1b9c2[_0x8ad4('0x43')]:_0x58fc07[_0x8ad4('0x3e')];if(!_0x12e098['query'][_0x8ad4('0x45')](_0x8ad4('0x46'))){_0xf1b9c2[_0x8ad4('0x31')]=qs[_0x8ad4('0x31')](_0x12e098[_0x8ad4('0x40')]['limit']);_0xf1b9c2['offset']=qs['offset'](_0x12e098['query'][_0x8ad4('0x30')]);}_0xf1b9c2[_0x8ad4('0x47')]=qs[_0x8ad4('0x48')](_0x12e098['query']['sort']);_0xf1b9c2[_0x8ad4('0x49')]=qs[_0x8ad4('0x41')](_[_0x8ad4('0x4a')](_0x12e098['query'],_0x58fc07[_0x8ad4('0x41')]),_0x2993a3);if(_0x12e098[_0x8ad4('0x40')][_0x8ad4('0x4b')]){_0xf1b9c2[_0x8ad4('0x49')]=_[_0x8ad4('0x4c')](_0xf1b9c2[_0x8ad4('0x49')],{'$or':_[_0x8ad4('0x3f')](_0x2993a3,function(_0x1f73e6){if(_0x1f73e6[_0x8ad4('0x3c')]!=='VIRTUAL'){var _0x57804c={};_0x57804c[_0x1f73e6[_0x8ad4('0x36')]]={'$like':'%'+_0x12e098[_0x8ad4('0x40')][_0x8ad4('0x4b')]+'%'};return _0x57804c;}})});}_0xf1b9c2=_['merge']({},_0xf1b9c2,_0x12e098[_0x8ad4('0x4d')]);var _0x10cc2c={'where':_0xf1b9c2[_0x8ad4('0x49')]};return db[_0x8ad4('0x39')][_0x8ad4('0x2f')](_0x10cc2c)[_0x8ad4('0x22')](function(_0x225086){_0x2abe93[_0x8ad4('0x2f')]=_0x225086;if(_0x12e098[_0x8ad4('0x40')]['includeAll']){_0xf1b9c2[_0x8ad4('0x4e')]=[{'all':!![]}];}return db[_0x8ad4('0x39')][_0x8ad4('0x4f')](_0xf1b9c2);})[_0x8ad4('0x22')](function(_0x4b85ef){_0x2abe93['rows']=_0x4b85ef;return _0x2abe93;})[_0x8ad4('0x22')](respondWithFilteredResult(_0x4ee53c,_0xf1b9c2))[_0x8ad4('0x50')](handleError(_0x4ee53c,null));};exports['show']=function(_0x2a0add,_0x5f334f){var _0x37abf8={'raw':![],'where':{'id':_0x2a0add[_0x8ad4('0x51')]['id']}},_0x43ea8b={};_0x43ea8b[_0x8ad4('0x3e')]=_[_0x8ad4('0x52')](db['ZohoAccount']['rawAttributes']);_0x43ea8b[_0x8ad4('0x40')]=_[_0x8ad4('0x52')](_0x2a0add['query']);_0x43ea8b[_0x8ad4('0x41')]=_[_0x8ad4('0x42')](_0x43ea8b[_0x8ad4('0x3e')],_0x43ea8b[_0x8ad4('0x40')]);_0x37abf8[_0x8ad4('0x43')]=_[_0x8ad4('0x42')](_0x43ea8b[_0x8ad4('0x3e')],qs['fields'](_0x2a0add[_0x8ad4('0x40')][_0x8ad4('0x44')]));_0x37abf8[_0x8ad4('0x43')]=_0x37abf8[_0x8ad4('0x43')][_0x8ad4('0x53')]?_0x37abf8['attributes']:_0x43ea8b[_0x8ad4('0x3e')];if(_0x2a0add[_0x8ad4('0x40')]['includeAll']){_0x37abf8[_0x8ad4('0x4e')]=[{'all':!![]}];}_0x37abf8=_[_0x8ad4('0x4c')]({},_0x37abf8,_0x2a0add[_0x8ad4('0x4d')]);return db['ZohoAccount'][_0x8ad4('0x54')](_0x37abf8)[_0x8ad4('0x22')](handleEntityNotFound(_0x5f334f,null))['then'](respondWithResult(_0x5f334f,null))[_0x8ad4('0x50')](handleError(_0x5f334f,null));};exports[_0x8ad4('0x55')]=function(_0x38d71f,_0x304274){return db[_0x8ad4('0x39')][_0x8ad4('0x55')](_0x38d71f['body'],{})[_0x8ad4('0x22')](respondWithResult(_0x304274,0xc9))[_0x8ad4('0x50')](handleError(_0x304274,null));};exports['update']=function(_0x38c2c5,_0x38e589){if(_0x38c2c5[_0x8ad4('0x56')]['id']){delete _0x38c2c5[_0x8ad4('0x56')]['id'];}return db[_0x8ad4('0x39')][_0x8ad4('0x54')]({'where':{'id':_0x38c2c5['params']['id']}})[_0x8ad4('0x22')](handleEntityNotFound(_0x38e589,null))[_0x8ad4('0x22')](saveUpdates(_0x38c2c5[_0x8ad4('0x56')],null))['then'](respondWithResult(_0x38e589,null))[_0x8ad4('0x50')](handleError(_0x38e589,null));};exports[_0x8ad4('0x35')]=function(_0x1001f4,_0x48e36d){return db[_0x8ad4('0x39')][_0x8ad4('0x54')]({'where':{'id':_0x1001f4[_0x8ad4('0x51')]['id']}})[_0x8ad4('0x22')](handleEntityNotFound(_0x48e36d,null))[_0x8ad4('0x22')](removeEntity(_0x48e36d,null))[_0x8ad4('0x50')](handleError(_0x48e36d,null));};exports[_0x8ad4('0x57')]=function(_0x26f937,_0x1068d2,_0x5823a8){var _0x5ef2d7={};var _0x167584={};var _0x483526;var _0x15e890;return db['ZohoAccount'][_0x8ad4('0x58')]({'where':{'id':_0x26f937[_0x8ad4('0x51')]['id']}})['then'](handleEntityNotFound(_0x1068d2,null))[_0x8ad4('0x22')](function(_0xb6136b){if(_0xb6136b){_0x483526=_0xb6136b;_0x167584[_0x8ad4('0x3e')]=_[_0x8ad4('0x52')](db['ZohoConfiguration']['rawAttributes']);_0x167584[_0x8ad4('0x40')]=_[_0x8ad4('0x52')](_0x26f937['query']);_0x167584[_0x8ad4('0x41')]=_[_0x8ad4('0x42')](_0x167584[_0x8ad4('0x3e')],_0x167584['query']);_0x5ef2d7[_0x8ad4('0x43')]=_[_0x8ad4('0x42')](_0x167584[_0x8ad4('0x3e')],qs[_0x8ad4('0x44')](_0x26f937[_0x8ad4('0x40')][_0x8ad4('0x44')]));_0x5ef2d7[_0x8ad4('0x43')]=_0x5ef2d7['attributes'][_0x8ad4('0x53')]?_0x5ef2d7[_0x8ad4('0x43')]:_0x167584[_0x8ad4('0x3e')];_0x5ef2d7[_0x8ad4('0x47')]=qs[_0x8ad4('0x48')](_0x26f937[_0x8ad4('0x40')]['sort']);_0x5ef2d7[_0x8ad4('0x49')]=qs[_0x8ad4('0x41')](_[_0x8ad4('0x4a')](_0x26f937['query'],_0x167584[_0x8ad4('0x41')]));if(_0x26f937[_0x8ad4('0x40')][_0x8ad4('0x4b')]){_0x5ef2d7[_0x8ad4('0x49')]=_[_0x8ad4('0x4c')](_0x5ef2d7[_0x8ad4('0x49')],{'$or':_[_0x8ad4('0x3f')](_0x5ef2d7[_0x8ad4('0x43')],function(_0x42ee4b){var _0x432971={};_0x432971[_0x42ee4b]={'$like':'%'+_0x26f937['query'][_0x8ad4('0x4b')]+'%'};return _0x432971;})});}_0x5ef2d7=_[_0x8ad4('0x4c')]({},_0x5ef2d7,_0x26f937[_0x8ad4('0x4d')]);return _0x483526[_0x8ad4('0x57')](_0x5ef2d7);}})[_0x8ad4('0x22')](function(_0x4883ee){if(_0x4883ee){_0x15e890=_0x4883ee[_0x8ad4('0x53')];if(!_0x26f937[_0x8ad4('0x40')][_0x8ad4('0x45')]('nolimit')){_0x5ef2d7['limit']=qs[_0x8ad4('0x31')](_0x26f937['query'][_0x8ad4('0x31')]);_0x5ef2d7[_0x8ad4('0x30')]=qs['offset'](_0x26f937['query'][_0x8ad4('0x30')]);}return _0x483526['getConfigurations'](_0x5ef2d7);}})[_0x8ad4('0x22')](function(_0x7edce5){if(_0x7edce5){return _0x7edce5?{'count':_0x15e890,'rows':_0x7edce5}:null;}})['then'](respondWithResult(_0x1068d2,null))['catch'](handleError(_0x1068d2,null));};exports[_0x8ad4('0x59')]=function(_0x46b34d,_0xb817f1,_0x5eda34){if(_0x46b34d[_0x8ad4('0x56')]['id']){delete _0x46b34d[_0x8ad4('0x56')]['id'];}return db[_0x8ad4('0x39')][_0x8ad4('0x58')]({'where':{'id':_0x46b34d['params']['id']}})[_0x8ad4('0x22')](handleEntityNotFound(_0xb817f1,null))[_0x8ad4('0x22')](function(_0x550a61){if(_0x550a61){_0x46b34d[_0x8ad4('0x56')][_0x8ad4('0x5a')]=_0x550a61['id'];_0x46b34d['body'][_0x8ad4('0x5b')]=integrations[_0x8ad4('0x5c')](_0x46b34d[_0x8ad4('0x56')][_0x8ad4('0x5d')],_0x46b34d[_0x8ad4('0x56')][_0x8ad4('0x3c')]);_0x46b34d[_0x8ad4('0x56')][_0x8ad4('0x5e')]=integrations[_0x8ad4('0x5f')](_0x46b34d[_0x8ad4('0x56')]['channel'],_0x46b34d[_0x8ad4('0x56')]['type']);return db[_0x8ad4('0x60')][_0x8ad4('0x55')](_0x46b34d[_0x8ad4('0x56')],{'include':[{'model':db[_0x8ad4('0x61')],'as':_0x8ad4('0x5b')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x8ad4('0x22')](respondWithResult(_0xb817f1,null))['catch'](handleError(_0xb817f1,null));};function getAccessToken(_0x20648f){return new Promise(function(_0x448d6b,_0x25e4a3){var _0x9e0787;switch(_0x20648f[_0x8ad4('0x62')]){case'US':_0x9e0787='https://accounts.zoho.com';break;case'AU':_0x9e0787=_0x8ad4('0x63');break;case'EU':_0x9e0787=_0x8ad4('0x64');break;case'IN':_0x9e0787=_0x8ad4('0x65');break;case'CN':_0x9e0787=_0x8ad4('0x66');break;default:_0x9e0787=_0x8ad4('0x64');break;}var _0x5e7c4f={'method':_0x8ad4('0x67'),'uri':_0x9e0787+_0x8ad4('0x68'),'qs':{'refresh_token':_0x20648f[_0x8ad4('0x69')],'client_id':_0x20648f[_0x8ad4('0x6a')],'client_secret':_0x20648f[_0x8ad4('0x6b')],'grant_type':_0x8ad4('0x6c')},'json':!![]};return rp(_0x5e7c4f)[_0x8ad4('0x22')](function(_0x19778c){if(_0x19778c[_0x8ad4('0x6d')]){_0x448d6b(_0x19778c['access_token']);}else{_0x25e4a3(_0x8ad4('0x6e'));}})[_0x8ad4('0x50')](function(_0x58b03f){_0x25e4a3(_0x58b03f);});});}exports[_0x8ad4('0x6f')]=function(_0x536f55,_0x396885,_0x29c355){var _0x22c400,_0x4d2cdd,_0x5de7bc,_0x90fe27,_0x3785b5;return db[_0x8ad4('0x39')][_0x8ad4('0x58')]({'where':{'id':_0x536f55['params']['id']},'attributes':['id',_0x8ad4('0x70'),_0x8ad4('0x62'),_0x8ad4('0x6a'),_0x8ad4('0x6b'),_0x8ad4('0x71'),_0x8ad4('0x29'),_0x8ad4('0x69')]})[_0x8ad4('0x22')](handleEntityNotFound(_0x396885,null))[_0x8ad4('0x22')](function(_0x25e6aa){_0x3785b5=_0x25e6aa;_0x22c400=_0x3785b5[_0x8ad4('0x70')];_0x4d2cdd=_0x22c400===_0x8ad4('0x72')?'eu':'com';_0x5de7bc=_0x3785b5[_0x8ad4('0x71')];var _0x4f8580=_0x5de7bc['slice'](-0x1);if(_0x4f8580==='/'||_0x4f8580==='\x5c'||_0x4f8580===':'){_0x5de7bc=_0x5de7bc['substring'](0x0,_0x5de7bc[_0x8ad4('0x73')](_0x4f8580));}if(!_0x3785b5[_0x8ad4('0x69')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3785b5);})['then'](function(_0x147ed2){if(_0x147ed2){return rp({'method':'GET','uri':util[_0x8ad4('0x74')](_0x8ad4('0x75'),_0x4d2cdd),'qs':{'module':_0x8ad4('0x76')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x147ed2},'json':!![]});}})[_0x8ad4('0x22')](function(_0x457038){if(_0x457038){if(_0x457038['response']&&_0x457038[_0x8ad4('0x77')][_0x8ad4('0x28')]){throw new Error(_0x457038['response'][_0x8ad4('0x28')]['message']);}var _0x37148e=[];var _0x1a144f=[];var _0x14574d=[_0x8ad4('0x78'),_0x8ad4('0x79'),_0x8ad4('0x7a'),_0x8ad4('0x7b'),'Call_Duration',_0x8ad4('0x7c'),'Call_Start_Time',_0x8ad4('0x7d')];_0x1a144f=_['remove'](_0x457038[_0x8ad4('0x44')],function(_0x3617aa){return _0x14574d[_0x8ad4('0x7e')](_0x3617aa[_0x8ad4('0x7f')]);});for(var _0x2d8689=0x0;_0x2d8689<_0x1a144f[_0x8ad4('0x53')];_0x2d8689++){if(_0x1a144f[_0x2d8689][_0x8ad4('0x80')]===![]){_0x37148e['push']({'id':_0x1a144f[_0x2d8689]['id'],'name':_0x1a144f[_0x2d8689]['display_label'],'custom':_0x1a144f[_0x2d8689]['custom_field'],'options':_0x1a144f[_0x2d8689][_0x8ad4('0x81')]==='picklist'&&_0x1a144f[_0x2d8689]['pick_list_values'][_0x8ad4('0x53')]>-0x1?_['map'](_0x1a144f[_0x2d8689]['pick_list_values'],function(_0x21409c){return{'name':_0x21409c,'value':_0x21409c};}):[]});}}return{'count':_0x37148e['length'],'rows':_0x37148e};}else{return{'count':0x0,'rows':[]};}})[_0x8ad4('0x22')](respondWithResult(_0x396885,null))[_0x8ad4('0x50')](function(_0x3e9130){var _0x3a67f9=_0x536f55[_0x8ad4('0x40')][_0x8ad4('0x1d')]?0x1f4:_0x3e9130[_0x8ad4('0x82')]||0x1f4;logger['error'](_0x8ad4('0x83'),'getFields',_0x3a67f9,JSON[_0x8ad4('0x27')](_0x3e9130));delete _0x3e9130[_0x8ad4('0x36')];if(_0x3a67f9===0x191){_0x3a67f9=0x190;}_0x396885[_0x8ad4('0x2c')](_0x3a67f9)[_0x8ad4('0x37')](_0x536f55[_0x8ad4('0x40')]['test']?{'message':_0x8ad4('0x84'),'statusCode':_0x3e9130[_0x8ad4('0x82')]}:_0x3e9130);});}; \ No newline at end of file +var _0x66fc=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ZohoAccount','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken','zoho.eu','com','slice','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','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','stack','name','index','map','fieldName','type','key','query','keys'];(function(_0x107cda,_0x1c2918){var _0x157b81=function(_0x4b984a){while(--_0x4b984a){_0x107cda['push'](_0x107cda['shift']());}};_0x157b81(++_0x1c2918);}(_0x66fc,0xe0));var _0xc66f=function(_0x5073b4,_0x4ba5b0){_0x5073b4=_0x5073b4-0x0;var _0x283fd2=_0x66fc[_0x5073b4];return _0x283fd2;};'use strict';var pdf=require(_0xc66f('0x0'));var emlformat=require(_0xc66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc66f('0x2'));var jsonpatch=require(_0xc66f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc66f('0x4'));var Mustache=require(_0xc66f('0x5'));var util=require(_0xc66f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc66f('0x7'));var ejs=require(_0xc66f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc66f('0x9'));var crypto=require('crypto');var jsforce=require(_0xc66f('0xa'));var deskjs=require(_0xc66f('0xb'));var toCsv=require(_0xc66f('0x7'));var querystring=require('querystring');var Papa=require(_0xc66f('0xc'));var Redis=require('ioredis');var authService=require(_0xc66f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc66f('0xe'));var hardwareService=require(_0xc66f('0xf'));var logger=require(_0xc66f('0x10'))(_0xc66f('0x11'));var utils=require(_0xc66f('0x12'));var config=require(_0xc66f('0x13'));var db=require(_0xc66f('0x14'))['db'];var integrations=require(_0xc66f('0x15'));var jayson=require(_0xc66f('0x16'));var client=jayson[_0xc66f('0x17')][_0xc66f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2c88f3,_0x11bdab,_0x4a445a){if(_0x4a445a){var _0x3fe9fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fe9fd[_0xc66f('0x19')](_0x11bdab)){return _0x2c88f3;}else{throw new db['Sequelize'][(_0xc66f('0x1a'))](_0xc66f('0x1b'));}}else{return _0x2c88f3;}}function respondWithRpcPromise(_0x415813,_0x4ac3a3,_0x33b9c4,_0x380d4d){return new BPromise(function(_0x2b7fdb,_0x5b0ef8){var _0x526d01=_0x380d4d||client;return _0x526d01[_0xc66f('0x1c')](_0x415813,_0x33b9c4)[_0xc66f('0x1d')](function(_0x18496f){logger[_0xc66f('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0x4ac3a3,'request\x20sent');logger['debug'](_0xc66f('0x1f'),_0x4ac3a3,_0xc66f('0x20'),JSON[_0xc66f('0x21')](_0x18496f));if(_0x18496f[_0xc66f('0x22')]){if(_0x18496f[_0xc66f('0x22')]['code']===0x1f4){logger[_0xc66f('0x22')](_0xc66f('0x23'),_0x4ac3a3,_0x18496f[_0xc66f('0x22')][_0xc66f('0x24')]);return _0x5b0ef8(_0x18496f[_0xc66f('0x22')]['message']);}logger[_0xc66f('0x22')](_0xc66f('0x23'),_0x4ac3a3,_0x18496f[_0xc66f('0x22')]['message']);return _0x2b7fdb(_0x18496f['error'][_0xc66f('0x24')]);}else{logger[_0xc66f('0x1e')](_0xc66f('0x23'),_0x4ac3a3,_0xc66f('0x20'));_0x2b7fdb(_0x18496f['result'][_0xc66f('0x24')]);}})['catch'](function(_0x3b0926){logger['error'](_0xc66f('0x23'),_0x4ac3a3,_0x3b0926);_0x5b0ef8(_0x3b0926);});});}function respondWithStatusCode(_0x966f8c,_0x3c50e2){_0x3c50e2=_0x3c50e2||0xcc;return function(_0x1bf38d){if(_0x1bf38d){return _0x966f8c[_0xc66f('0x25')](_0x3c50e2);}return _0x966f8c[_0xc66f('0x26')](_0x3c50e2)[_0xc66f('0x27')]();};}function respondWithResult(_0x36ad13,_0x3fb112){_0x3fb112=_0x3fb112||0xc8;return function(_0x4bf2e6){if(_0x4bf2e6){return _0x36ad13[_0xc66f('0x26')](_0x3fb112)[_0xc66f('0x28')](_0x4bf2e6);}};}function respondWithFilteredResult(_0x28cdc8,_0x4c4c09){return function(_0x5c5df7){if(_0x5c5df7){var _0x50d022=_0x5c5df7[_0xc66f('0x29')],_0x149ea6=_0x4c4c09['offset'],_0x8e3484=_0x4c4c09[_0xc66f('0x2a')]+_0x4c4c09[_0xc66f('0x2b')],_0x3263ff;if(_0x8e3484>=_0x50d022){_0x8e3484=_0x50d022;_0x3263ff=0xc8;}else{_0x3263ff=0xce;}_0x28cdc8['status'](_0x3263ff);return _0x28cdc8[_0xc66f('0x2c')]('Content-Range',_0x149ea6+'-'+_0x8e3484+'/'+_0x50d022)[_0xc66f('0x28')](_0x5c5df7);}return null;};}function patchUpdates(_0x3e9175){return function(_0x2add14){try{jsonpatch[_0xc66f('0x2d')](_0x2add14,_0x3e9175,!![]);}catch(_0x28bb81){return BPromise['reject'](_0x28bb81);}return _0x2add14[_0xc66f('0x2e')]();};}function saveUpdates(_0x2dbb54,_0x226e93){return function(_0x21b5be){if(_0x21b5be){return _0x21b5be[_0xc66f('0x2f')](_0x2dbb54)[_0xc66f('0x1d')](function(_0x36ae5d){return _0x36ae5d;});}return null;};}function removeEntity(_0x2b4c23,_0xdc29ce){return function(_0x5ee3f9){if(_0x5ee3f9){return _0x5ee3f9[_0xc66f('0x30')]()['then'](function(){_0x2b4c23[_0xc66f('0x26')](0xcc)[_0xc66f('0x27')]();});}};}function handleEntityNotFound(_0x193960,_0x5a7ffb){return function(_0x26141c){if(!_0x26141c){_0x193960[_0xc66f('0x25')](0x194);}return _0x26141c;};}function handleError(_0x48c64b,_0x465ce5){_0x465ce5=_0x465ce5||0x1f4;return function(_0x29868f){logger[_0xc66f('0x22')](_0x29868f[_0xc66f('0x31')]);if(_0x29868f[_0xc66f('0x32')]){delete _0x29868f[_0xc66f('0x32')];}_0x48c64b[_0xc66f('0x26')](_0x465ce5)['send'](_0x29868f);};}exports[_0xc66f('0x33')]=function(_0x5f86db,_0x18fabd){var _0x203de6={},_0x313f51={},_0x48e486={'count':0x0,'rows':[]};var _0x591182=_[_0xc66f('0x34')](db['ZohoAccount']['rawAttributes'],function(_0x411e0e){return{'name':_0x411e0e[_0xc66f('0x35')],'type':_0x411e0e[_0xc66f('0x36')][_0xc66f('0x37')]};});_0x313f51['model']=_['map'](_0x591182,_0xc66f('0x32'));_0x313f51[_0xc66f('0x38')]=_[_0xc66f('0x39')](_0x5f86db[_0xc66f('0x38')]);_0x313f51['filters']=_[_0xc66f('0x3a')](_0x313f51[_0xc66f('0x3b')],_0x313f51['query']);_0x203de6[_0xc66f('0x3c')]=_[_0xc66f('0x3a')](_0x313f51[_0xc66f('0x3b')],qs[_0xc66f('0x3d')](_0x5f86db[_0xc66f('0x38')][_0xc66f('0x3d')]));_0x203de6[_0xc66f('0x3c')]=_0x203de6[_0xc66f('0x3c')][_0xc66f('0x3e')]?_0x203de6[_0xc66f('0x3c')]:_0x313f51[_0xc66f('0x3b')];if(!_0x5f86db['query'][_0xc66f('0x3f')](_0xc66f('0x40'))){_0x203de6[_0xc66f('0x2b')]=qs['limit'](_0x5f86db['query'][_0xc66f('0x2b')]);_0x203de6['offset']=qs[_0xc66f('0x2a')](_0x5f86db[_0xc66f('0x38')][_0xc66f('0x2a')]);}_0x203de6[_0xc66f('0x41')]=qs[_0xc66f('0x42')](_0x5f86db['query'][_0xc66f('0x42')]);_0x203de6[_0xc66f('0x43')]=qs[_0xc66f('0x44')](_['pick'](_0x5f86db[_0xc66f('0x38')],_0x313f51[_0xc66f('0x44')]),_0x591182);if(_0x5f86db[_0xc66f('0x38')][_0xc66f('0x45')]){_0x203de6['where']=_[_0xc66f('0x46')](_0x203de6[_0xc66f('0x43')],{'$or':_[_0xc66f('0x34')](_0x591182,function(_0x5b33aa){if(_0x5b33aa[_0xc66f('0x36')]!==_0xc66f('0x47')){var _0x178dd4={};_0x178dd4[_0x5b33aa[_0xc66f('0x32')]]={'$like':'%'+_0x5f86db[_0xc66f('0x38')][_0xc66f('0x45')]+'%'};return _0x178dd4;}})});}_0x203de6=_[_0xc66f('0x46')]({},_0x203de6,_0x5f86db[_0xc66f('0x48')]);var _0x44e8ad={'where':_0x203de6[_0xc66f('0x43')]};return db[_0xc66f('0x49')][_0xc66f('0x29')](_0x44e8ad)['then'](function(_0x2b9d9b){_0x48e486[_0xc66f('0x29')]=_0x2b9d9b;if(_0x5f86db[_0xc66f('0x38')]['includeAll']){_0x203de6['include']=[{'all':!![]}];}return db[_0xc66f('0x49')][_0xc66f('0x4a')](_0x203de6);})[_0xc66f('0x1d')](function(_0x148c6b){_0x48e486[_0xc66f('0x4b')]=_0x148c6b;return _0x48e486;})['then'](respondWithFilteredResult(_0x18fabd,_0x203de6))[_0xc66f('0x4c')](handleError(_0x18fabd,null));};exports[_0xc66f('0x4d')]=function(_0x54b852,_0x4c2e10){var _0x43e3f2={'raw':![],'where':{'id':_0x54b852[_0xc66f('0x4e')]['id']}},_0x5e8b25={};_0x5e8b25['model']=_[_0xc66f('0x39')](db[_0xc66f('0x49')][_0xc66f('0x4f')]);_0x5e8b25[_0xc66f('0x38')]=_[_0xc66f('0x39')](_0x54b852[_0xc66f('0x38')]);_0x5e8b25[_0xc66f('0x44')]=_[_0xc66f('0x3a')](_0x5e8b25[_0xc66f('0x3b')],_0x5e8b25[_0xc66f('0x38')]);_0x43e3f2[_0xc66f('0x3c')]=_[_0xc66f('0x3a')](_0x5e8b25[_0xc66f('0x3b')],qs[_0xc66f('0x3d')](_0x54b852[_0xc66f('0x38')]['fields']));_0x43e3f2['attributes']=_0x43e3f2['attributes'][_0xc66f('0x3e')]?_0x43e3f2['attributes']:_0x5e8b25[_0xc66f('0x3b')];if(_0x54b852[_0xc66f('0x38')][_0xc66f('0x50')]){_0x43e3f2[_0xc66f('0x51')]=[{'all':!![]}];}_0x43e3f2=_['merge']({},_0x43e3f2,_0x54b852[_0xc66f('0x48')]);return db[_0xc66f('0x49')][_0xc66f('0x52')](_0x43e3f2)['then'](handleEntityNotFound(_0x4c2e10,null))[_0xc66f('0x1d')](respondWithResult(_0x4c2e10,null))[_0xc66f('0x4c')](handleError(_0x4c2e10,null));};exports[_0xc66f('0x53')]=function(_0x2e9035,_0x26bc8b){return db[_0xc66f('0x49')][_0xc66f('0x53')](_0x2e9035[_0xc66f('0x54')],{})[_0xc66f('0x1d')](respondWithResult(_0x26bc8b,0xc9))[_0xc66f('0x4c')](handleError(_0x26bc8b,null));};exports[_0xc66f('0x2f')]=function(_0x4cf01a,_0x503b68){if(_0x4cf01a[_0xc66f('0x54')]['id']){delete _0x4cf01a[_0xc66f('0x54')]['id'];}return db[_0xc66f('0x49')][_0xc66f('0x52')]({'where':{'id':_0x4cf01a[_0xc66f('0x4e')]['id']}})[_0xc66f('0x1d')](handleEntityNotFound(_0x503b68,null))[_0xc66f('0x1d')](saveUpdates(_0x4cf01a['body'],null))[_0xc66f('0x1d')](respondWithResult(_0x503b68,null))[_0xc66f('0x4c')](handleError(_0x503b68,null));};exports[_0xc66f('0x30')]=function(_0x4f0330,_0x4aadec){return db[_0xc66f('0x49')]['find']({'where':{'id':_0x4f0330[_0xc66f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4aadec,null))[_0xc66f('0x1d')](removeEntity(_0x4aadec,null))['catch'](handleError(_0x4aadec,null));};exports['getConfigurations']=function(_0x3fcc5e,_0x56dfe9,_0x45f397){var _0xee61bd={};var _0x4da2da={};var _0x433a83;var _0x52ea9a;return db[_0xc66f('0x49')][_0xc66f('0x55')]({'where':{'id':_0x3fcc5e[_0xc66f('0x4e')]['id']}})[_0xc66f('0x1d')](handleEntityNotFound(_0x56dfe9,null))[_0xc66f('0x1d')](function(_0x5759a5){if(_0x5759a5){_0x433a83=_0x5759a5;_0x4da2da['model']=_[_0xc66f('0x39')](db['ZohoConfiguration'][_0xc66f('0x4f')]);_0x4da2da[_0xc66f('0x38')]=_[_0xc66f('0x39')](_0x3fcc5e[_0xc66f('0x38')]);_0x4da2da['filters']=_[_0xc66f('0x3a')](_0x4da2da[_0xc66f('0x3b')],_0x4da2da[_0xc66f('0x38')]);_0xee61bd[_0xc66f('0x3c')]=_['intersection'](_0x4da2da[_0xc66f('0x3b')],qs[_0xc66f('0x3d')](_0x3fcc5e[_0xc66f('0x38')][_0xc66f('0x3d')]));_0xee61bd['attributes']=_0xee61bd[_0xc66f('0x3c')][_0xc66f('0x3e')]?_0xee61bd['attributes']:_0x4da2da[_0xc66f('0x3b')];_0xee61bd[_0xc66f('0x41')]=qs[_0xc66f('0x42')](_0x3fcc5e['query'][_0xc66f('0x42')]);_0xee61bd[_0xc66f('0x43')]=qs[_0xc66f('0x44')](_[_0xc66f('0x56')](_0x3fcc5e['query'],_0x4da2da[_0xc66f('0x44')]));if(_0x3fcc5e[_0xc66f('0x38')]['filter']){_0xee61bd[_0xc66f('0x43')]=_['merge'](_0xee61bd[_0xc66f('0x43')],{'$or':_['map'](_0xee61bd['attributes'],function(_0x3558d6){var _0x58b325={};_0x58b325[_0x3558d6]={'$like':'%'+_0x3fcc5e['query'][_0xc66f('0x45')]+'%'};return _0x58b325;})});}_0xee61bd=_['merge']({},_0xee61bd,_0x3fcc5e['options']);return _0x433a83['getConfigurations'](_0xee61bd);}})[_0xc66f('0x1d')](function(_0x371f03){if(_0x371f03){_0x52ea9a=_0x371f03[_0xc66f('0x3e')];if(!_0x3fcc5e[_0xc66f('0x38')]['hasOwnProperty'](_0xc66f('0x40'))){_0xee61bd[_0xc66f('0x2b')]=qs[_0xc66f('0x2b')](_0x3fcc5e['query']['limit']);_0xee61bd[_0xc66f('0x2a')]=qs['offset'](_0x3fcc5e['query']['offset']);}return _0x433a83['getConfigurations'](_0xee61bd);}})['then'](function(_0x2c2fa0){if(_0x2c2fa0){return _0x2c2fa0?{'count':_0x52ea9a,'rows':_0x2c2fa0}:null;}})[_0xc66f('0x1d')](respondWithResult(_0x56dfe9,null))[_0xc66f('0x4c')](handleError(_0x56dfe9,null));};exports[_0xc66f('0x57')]=function(_0x456d23,_0x38e34e,_0x198b00){if(_0x456d23[_0xc66f('0x54')]['id']){delete _0x456d23[_0xc66f('0x54')]['id'];}return db[_0xc66f('0x49')]['findOne']({'where':{'id':_0x456d23[_0xc66f('0x4e')]['id']}})[_0xc66f('0x1d')](handleEntityNotFound(_0x38e34e,null))['then'](function(_0x176266){if(_0x176266){_0x456d23[_0xc66f('0x54')][_0xc66f('0x58')]=_0x176266['id'];_0x456d23[_0xc66f('0x54')][_0xc66f('0x59')]=integrations[_0xc66f('0x5a')](_0x456d23[_0xc66f('0x54')][_0xc66f('0x5b')],_0x456d23[_0xc66f('0x54')][_0xc66f('0x36')]);_0x456d23[_0xc66f('0x54')][_0xc66f('0x5c')]=integrations[_0xc66f('0x5d')](_0x456d23['body'][_0xc66f('0x5b')],_0x456d23[_0xc66f('0x54')][_0xc66f('0x36')]);return db['ZohoConfiguration'][_0xc66f('0x53')](_0x456d23['body'],{'include':[{'model':db[_0xc66f('0x5e')],'as':_0xc66f('0x59')},{'model':db[_0xc66f('0x5e')],'as':_0xc66f('0x5c')}]});}return null;})['then'](respondWithResult(_0x38e34e,null))[_0xc66f('0x4c')](handleError(_0x38e34e,null));};function getAccessToken(_0xa7ffd8){return new Promise(function(_0x3e89e9,_0xb66273){var _0x344c92;switch(_0xa7ffd8[_0xc66f('0x5f')]){case'US':_0x344c92=_0xc66f('0x60');break;case'AU':_0x344c92=_0xc66f('0x61');break;case'EU':_0x344c92=_0xc66f('0x62');break;case'IN':_0x344c92='https://accounts.zoho.in';break;case'CN':_0x344c92=_0xc66f('0x63');break;default:_0x344c92=_0xc66f('0x62');break;}var _0x121831={'method':_0xc66f('0x64'),'uri':_0x344c92+_0xc66f('0x65'),'qs':{'refresh_token':_0xa7ffd8['refreshToken'],'client_id':_0xa7ffd8[_0xc66f('0x66')],'client_secret':_0xa7ffd8[_0xc66f('0x67')],'grant_type':_0xc66f('0x68')},'json':!![]};return rp(_0x121831)[_0xc66f('0x1d')](function(_0x5e8fd1){if(_0x5e8fd1['access_token']){_0x3e89e9(_0x5e8fd1[_0xc66f('0x69')]);}else{_0xb66273(_0xc66f('0x6a'));}})['catch'](function(_0x136bfd){_0xb66273(_0x136bfd);});});}exports['getFields']=function(_0x165be9,_0x17aa55,_0x510b40){var _0x1764dc,_0x3fd91e,_0x59f66c,_0x22d92d,_0x5e74d7;return db[_0xc66f('0x49')][_0xc66f('0x55')]({'where':{'id':_0x165be9[_0xc66f('0x4e')]['id']},'attributes':['id',_0xc66f('0x6b'),_0xc66f('0x5f'),'clientId','clientSecret',_0xc66f('0x6c'),_0xc66f('0x6d'),_0xc66f('0x6e')]})[_0xc66f('0x1d')](handleEntityNotFound(_0x17aa55,null))[_0xc66f('0x1d')](function(_0x3d05ac){_0x5e74d7=_0x3d05ac;_0x1764dc=_0x5e74d7[_0xc66f('0x6b')];_0x3fd91e=_0x1764dc===_0xc66f('0x6f')?'eu':_0xc66f('0x70');_0x59f66c=_0x5e74d7[_0xc66f('0x6c')];var _0x1442d2=_0x59f66c[_0xc66f('0x71')](-0x1);if(_0x1442d2==='/'||_0x1442d2==='\x5c'||_0x1442d2===':'){_0x59f66c=_0x59f66c['substring'](0x0,_0x59f66c[_0xc66f('0x72')](_0x1442d2));}if(!_0x5e74d7[_0xc66f('0x6e')]){throw new Error(_0xc66f('0x73'));}return getAccessToken(_0x5e74d7);})['then'](function(_0x2b14d2){if(_0x2b14d2){return rp({'method':_0xc66f('0x74'),'uri':util[_0xc66f('0x75')](_0xc66f('0x76'),_0x3fd91e),'qs':{'module':_0xc66f('0x77')},'headers':{'Authorization':_0xc66f('0x78')+_0x2b14d2},'json':!![]});}})[_0xc66f('0x1d')](function(_0x50a26a){if(_0x50a26a){if(_0x50a26a[_0xc66f('0x79')]&&_0x50a26a[_0xc66f('0x79')][_0xc66f('0x22')]){throw new Error(_0x50a26a[_0xc66f('0x79')][_0xc66f('0x22')][_0xc66f('0x24')]);}var _0x2713d7=[];var _0x1f51ae=[];var _0x4ff50c=[_0xc66f('0x7a'),_0xc66f('0x7b'),_0xc66f('0x7c'),_0xc66f('0x7d'),_0xc66f('0x7e'),_0xc66f('0x7f'),_0xc66f('0x80'),_0xc66f('0x81')];_0x1f51ae=_['remove'](_0x50a26a[_0xc66f('0x3d')],function(_0x459b2b){return _0x4ff50c[_0xc66f('0x82')](_0x459b2b[_0xc66f('0x83')]);});for(var _0x4ce033=0x0;_0x4ce033<_0x1f51ae[_0xc66f('0x3e')];_0x4ce033++){if(_0x1f51ae[_0x4ce033][_0xc66f('0x84')]===![]){_0x2713d7[_0xc66f('0x85')]({'id':_0x1f51ae[_0x4ce033]['id'],'name':_0x1f51ae[_0x4ce033][_0xc66f('0x86')],'custom':_0x1f51ae[_0x4ce033][_0xc66f('0x87')],'options':_0x1f51ae[_0x4ce033]['data_type']===_0xc66f('0x88')&&_0x1f51ae[_0x4ce033][_0xc66f('0x89')][_0xc66f('0x3e')]>-0x1?_[_0xc66f('0x34')](_0x1f51ae[_0x4ce033][_0xc66f('0x89')],function(_0x30e5d2){return{'name':_0x30e5d2,'value':_0x30e5d2};}):[]});}}return{'count':_0x2713d7['length'],'rows':_0x2713d7};}else{return{'count':0x0,'rows':[]};}})[_0xc66f('0x1d')](respondWithResult(_0x17aa55,null))[_0xc66f('0x4c')](function(_0x596d18){var _0x1628fe=_0x165be9[_0xc66f('0x38')][_0xc66f('0x19')]?0x1f4:_0x596d18[_0xc66f('0x8a')]||0x1f4;logger[_0xc66f('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1628fe,JSON[_0xc66f('0x21')](_0x596d18));delete _0x596d18[_0xc66f('0x32')];if(_0x1628fe===0x191){_0x1628fe=0x190;}_0x17aa55['status'](_0x1628fe)[_0xc66f('0x8b')](_0x165be9['query'][_0xc66f('0x19')]?{'message':_0xc66f('0x8c'),'statusCode':_0x596d18[_0xc66f('0x8a')]}:_0x596d18);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e585a9d..777ecf5 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 _0x4d4d=['exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','serverUrl','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','code','substring','/oauth/v2/token','authorization_code','catch','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x4d4d,0xa0));var _0xd4d4=function(_0x5a6a93,_0x1a9039){_0x5a6a93=_0x5a6a93-0x0;var _0x4e0a43=_0x4d4d[_0x5a6a93];return _0x4e0a43;};'use strict';var _=require(_0xd4d4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd4d4('0x1'));var moment=require('moment');var BPromise=require(_0xd4d4('0x2'));var rp=require(_0xd4d4('0x3'));var fs=require('fs');var path=require(_0xd4d4('0x4'));var rimraf=require(_0xd4d4('0x5'));var config=require(_0xd4d4('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xd4d4('0x7'));module[_0xd4d4('0x8')]=function(_0xe36b4,_0x2841d1){return _0xe36b4[_0xd4d4('0x9')](_0xd4d4('0xa'),attributes,{'tableName':_0xd4d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15df62,_0x34362c,_0x286d96){if(_0x15df62[_0xd4d4('0xc')](_0xd4d4('0xd'))||_0x15df62[_0xd4d4('0xc')]('serverUrl')||_0x15df62[_0xd4d4('0xc')](_0xd4d4('0xe'))||_0x15df62[_0xd4d4('0xc')](_0xd4d4('0xf'))||_0x15df62[_0xd4d4('0xc')]('code')||_0x15df62[_0xd4d4('0xc')]('host')){var _0x58264a,_0xfaf8bc;_0x58264a=_0x15df62[_0xd4d4('0x10')];var _0x384af1=_0x58264a[_0xd4d4('0x11')](-0x1);if(_0x384af1==='/'||_0x384af1==='\x5c'||_0x384af1===':'){_0x58264a=_0x58264a['substring'](0x0,_0x58264a[_0xd4d4('0x12')](_0x384af1));}switch(_0x15df62['zone']){case'US':_0xfaf8bc=_0xd4d4('0x13');break;case'AU':_0xfaf8bc=_0xd4d4('0x14');break;case'IN':_0xfaf8bc=_0xd4d4('0x15');break;case'CN':_0xfaf8bc=_0xd4d4('0x16');break;default:_0xfaf8bc=_0xd4d4('0x17');break;}var _0x5f245f={'method':_0xd4d4('0x18'),'uri':_0xfaf8bc+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x15df62[_0xd4d4('0xe')],'client_secret':_0x15df62[_0xd4d4('0xf')],'redirect_uri':_0x15df62[_0xd4d4('0x10')],'code':_0x15df62['code']},'headers':{'Content-Type':_0xd4d4('0x19')}};return rp(_0x5f245f)[_0xd4d4('0x1a')](function(_0x275198){var _0x2df154=JSON[_0xd4d4('0x1b')](_0x275198);if(_0x2df154[_0xd4d4('0x1c')]){_0x15df62[_0xd4d4('0x1d')]=_0x2df154[_0xd4d4('0x1c')];logger[_0xd4d4('0x1e')](util[_0xd4d4('0x1f')](_0xd4d4('0x20'),_0x15df62[_0xd4d4('0x21')],_0x15df62['id']));}else{logger[_0xd4d4('0x22')](util[_0xd4d4('0x1f')](_0xd4d4('0x23'),_0x15df62['name'],_0x15df62['id']),util[_0xd4d4('0x24')](_0x2df154,{'showHidden':![],'depth':null}));}return _0x286d96(null,_0x34362c);})['catch'](function(_0x3251d1){logger['error'](util['format'](_0xd4d4('0x23'),_0x15df62[_0xd4d4('0x21')],_0x15df62['id']),util[_0xd4d4('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x286d96(_0x3251d1);});}else{return _0x286d96(null,_0x34362c);}},'beforeUpdate':function(_0x47f040,_0x4548d8,_0x4a76b2){if(_0x47f040[_0xd4d4('0xc')]('zone')||_0x47f040[_0xd4d4('0xc')](_0xd4d4('0x10'))||_0x47f040[_0xd4d4('0xc')](_0xd4d4('0xe'))||_0x47f040[_0xd4d4('0xc')](_0xd4d4('0xf'))||_0x47f040[_0xd4d4('0xc')](_0xd4d4('0x25'))||_0x47f040[_0xd4d4('0xc')]('host')){var _0x51978b,_0x2d9cf8;_0x51978b=_0x47f040[_0xd4d4('0x10')];var _0x1bddd0=_0x51978b['slice'](-0x1);if(_0x1bddd0==='/'||_0x1bddd0==='\x5c'||_0x1bddd0===':'){_0x51978b=_0x51978b[_0xd4d4('0x26')](0x0,_0x51978b[_0xd4d4('0x12')](_0x1bddd0));}switch(_0x47f040['zone']){case'US':_0x2d9cf8=_0xd4d4('0x13');break;case'AU':_0x2d9cf8='https://accounts.zoho.com.au';break;case'IN':_0x2d9cf8=_0xd4d4('0x15');break;case'CN':_0x2d9cf8=_0xd4d4('0x16');break;default:_0x2d9cf8='https://accounts.zoho.eu';break;}var _0xe9f698={'method':'POST','uri':_0x2d9cf8+_0xd4d4('0x27'),'form':{'grant_type':_0xd4d4('0x28'),'client_id':_0x47f040[_0xd4d4('0xe')],'client_secret':_0x47f040[_0xd4d4('0xf')],'redirect_uri':_0x47f040[_0xd4d4('0x10')],'code':_0x47f040[_0xd4d4('0x25')]},'headers':{'Content-Type':_0xd4d4('0x19')}};return rp(_0xe9f698)[_0xd4d4('0x1a')](function(_0xd08e7b){var _0x484bd0=JSON[_0xd4d4('0x1b')](_0xd08e7b);if(_0x484bd0[_0xd4d4('0x1c')]){_0x47f040[_0xd4d4('0x1d')]=_0x484bd0[_0xd4d4('0x1c')];logger[_0xd4d4('0x1e')](util['format'](_0xd4d4('0x20'),_0x47f040[_0xd4d4('0x21')],_0x47f040['id']));}else{logger[_0xd4d4('0x22')](util['format'](_0xd4d4('0x23'),_0x47f040[_0xd4d4('0x21')],_0x47f040['id']),util[_0xd4d4('0x24')](_0x484bd0,{'showHidden':![],'depth':null}));}return _0x4a76b2(null,_0x4548d8);})[_0xd4d4('0x29')](function(_0x27a90d){logger[_0xd4d4('0x22')](util[_0xd4d4('0x1f')](_0xd4d4('0x23'),_0x47f040[_0xd4d4('0x21')],_0x47f040['id']),util[_0xd4d4('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a76b2(_0x27a90d);});}else{return _0x4a76b2(null,_0x4548d8);}}}});}; \ No newline at end of file +var _0x2dab=['authorization_code','clientSecret','code','application/x-www-form-urlencoded','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','catch','inspect','https://accounts.zoho.eu','then','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token'];(function(_0x448774,_0x45ddc7){var _0x46b2f6=function(_0x1dee94){while(--_0x1dee94){_0x448774['push'](_0x448774['shift']());}};_0x46b2f6(++_0x45ddc7);}(_0x2dab,0x1ab));var _0xb2da=function(_0xbd9f,_0x723914){_0xbd9f=_0xbd9f-0x0;var _0x47ce6f=_0x2dab[_0xbd9f];return _0x47ce6f;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var logger=require('../../config/logger')(_0xb2da('0x2'));var moment=require(_0xb2da('0x3'));var BPromise=require(_0xb2da('0x4'));var rp=require(_0xb2da('0x5'));var fs=require('fs');var path=require(_0xb2da('0x6'));var rimraf=require('rimraf');var config=require(_0xb2da('0x7'));var attributes=require(_0xb2da('0x8'));var integrations=require(_0xb2da('0x9'));module['exports']=function(_0x41a220,_0x1a501a){return _0x41a220['define'](_0xb2da('0xa'),attributes,{'tableName':_0xb2da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x416b54,_0x5386a7,_0x45ff51){if(_0x416b54['changed'](_0xb2da('0xc'))||_0x416b54[_0xb2da('0xd')](_0xb2da('0xe'))||_0x416b54[_0xb2da('0xd')](_0xb2da('0xf'))||_0x416b54['changed']('clientSecret')||_0x416b54['changed']('code')||_0x416b54[_0xb2da('0xd')](_0xb2da('0x10'))){var _0x147b75,_0x3c3cc4;_0x147b75=_0x416b54[_0xb2da('0xe')];var _0x509128=_0x147b75[_0xb2da('0x11')](-0x1);if(_0x509128==='/'||_0x509128==='\x5c'||_0x509128===':'){_0x147b75=_0x147b75['substring'](0x0,_0x147b75['lastIndexOf'](_0x509128));}switch(_0x416b54[_0xb2da('0xc')]){case'US':_0x3c3cc4=_0xb2da('0x12');break;case'AU':_0x3c3cc4=_0xb2da('0x13');break;case'IN':_0x3c3cc4=_0xb2da('0x14');break;case'CN':_0x3c3cc4=_0xb2da('0x15');break;default:_0x3c3cc4='https://accounts.zoho.eu';break;}var _0x263a2f={'method':_0xb2da('0x16'),'uri':_0x3c3cc4+_0xb2da('0x17'),'form':{'grant_type':_0xb2da('0x18'),'client_id':_0x416b54[_0xb2da('0xf')],'client_secret':_0x416b54[_0xb2da('0x19')],'redirect_uri':_0x416b54[_0xb2da('0xe')],'code':_0x416b54[_0xb2da('0x1a')]},'headers':{'Content-Type':_0xb2da('0x1b')}};return rp(_0x263a2f)['then'](function(_0xa3ad20){var _0xbab83e=JSON[_0xb2da('0x1c')](_0xa3ad20);if(_0xbab83e[_0xb2da('0x1d')]){_0x416b54[_0xb2da('0x1e')]=_0xbab83e['refresh_token'];logger[_0xb2da('0x1f')](util[_0xb2da('0x20')](_0xb2da('0x21'),_0x416b54['name'],_0x416b54['id']));}else{logger[_0xb2da('0x22')](util[_0xb2da('0x20')](_0xb2da('0x23'),_0x416b54[_0xb2da('0x24')],_0x416b54['id']),util['inspect'](_0xbab83e,{'showHidden':![],'depth':null}));}return _0x45ff51(null,_0x5386a7);})[_0xb2da('0x25')](function(_0x3a01ca){logger[_0xb2da('0x22')](util[_0xb2da('0x20')](_0xb2da('0x23'),_0x416b54[_0xb2da('0x24')],_0x416b54['id']),util[_0xb2da('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x45ff51(_0x3a01ca);});}else{return _0x45ff51(null,_0x5386a7);}},'beforeUpdate':function(_0x21911c,_0x2f041f,_0x38cd34){if(_0x21911c['changed'](_0xb2da('0xc'))||_0x21911c[_0xb2da('0xd')](_0xb2da('0xe'))||_0x21911c[_0xb2da('0xd')](_0xb2da('0xf'))||_0x21911c[_0xb2da('0xd')](_0xb2da('0x19'))||_0x21911c[_0xb2da('0xd')](_0xb2da('0x1a'))||_0x21911c['changed'](_0xb2da('0x10'))){var _0x5d8715,_0x1fb47e;_0x5d8715=_0x21911c['serverUrl'];var _0x2c4a5a=_0x5d8715['slice'](-0x1);if(_0x2c4a5a==='/'||_0x2c4a5a==='\x5c'||_0x2c4a5a===':'){_0x5d8715=_0x5d8715['substring'](0x0,_0x5d8715['lastIndexOf'](_0x2c4a5a));}switch(_0x21911c['zone']){case'US':_0x1fb47e=_0xb2da('0x12');break;case'AU':_0x1fb47e=_0xb2da('0x13');break;case'IN':_0x1fb47e=_0xb2da('0x14');break;case'CN':_0x1fb47e=_0xb2da('0x15');break;default:_0x1fb47e=_0xb2da('0x27');break;}var _0x49fac4={'method':'POST','uri':_0x1fb47e+_0xb2da('0x17'),'form':{'grant_type':_0xb2da('0x18'),'client_id':_0x21911c['clientId'],'client_secret':_0x21911c['clientSecret'],'redirect_uri':_0x21911c['serverUrl'],'code':_0x21911c[_0xb2da('0x1a')]},'headers':{'Content-Type':_0xb2da('0x1b')}};return rp(_0x49fac4)[_0xb2da('0x28')](function(_0x4a931d){var _0x755969=JSON[_0xb2da('0x1c')](_0x4a931d);if(_0x755969[_0xb2da('0x1d')]){_0x21911c['refreshToken']=_0x755969[_0xb2da('0x1d')];logger['info'](util[_0xb2da('0x20')](_0xb2da('0x21'),_0x21911c[_0xb2da('0x24')],_0x21911c['id']));}else{logger['error'](util[_0xb2da('0x20')](_0xb2da('0x23'),_0x21911c[_0xb2da('0x24')],_0x21911c['id']),util[_0xb2da('0x26')](_0x755969,{'showHidden':![],'depth':null}));}return _0x38cd34(null,_0x2f041f);})[_0xb2da('0x25')](function(_0x1a561b){logger[_0xb2da('0x22')](util[_0xb2da('0x20')](_0xb2da('0x23'),_0x21911c[_0xb2da('0x24')],_0x21911c['id']),util[_0xb2da('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x38cd34(_0x1a561b);});}else{return _0x38cd34(null,_0x2f041f);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 409c3be..918720b 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 _0x3cdd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','ZohoAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','limit','include','map','model','attributes','stringify','ShowZohoAccount','find','raw'];(function(_0x5c1a64,_0x4d8fcd){var _0x49ecd0=function(_0xfb8f58){while(--_0xfb8f58){_0x5c1a64['push'](_0x5c1a64['shift']());}};_0x49ecd0(++_0x4d8fcd);}(_0x3cdd,0xe0));var _0xd3cd=function(_0x2685ca,_0x58bd8c){_0x2685ca=_0x2685ca-0x0;var _0x668910=_0x3cdd[_0x2685ca];return _0x668910;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd3cd('0x0'));var BPromise=require(_0xd3cd('0x1'));var rs=require(_0xd3cd('0x2'));var fs=require('fs');var Redis=require(_0xd3cd('0x3'));var db=require(_0xd3cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3cd('0x5'))(_0xd3cd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd3cd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6bee,_0x2a96c0,_0x319710){return new BPromise(function(_0x42bd50,_0x1d970d){return client['request'](_0x1d6bee,_0x319710)[_0xd3cd('0x8')](function(_0x3ae791){logger[_0xd3cd('0x9')]('ZohoAccount,\x20%s,\x20%s',_0x2a96c0,'request\x20sent');logger[_0xd3cd('0xa')](_0xd3cd('0xb'),_0x2a96c0,'request\x20sent',JSON['stringify'](_0x3ae791));if(_0x3ae791[_0xd3cd('0xc')]){if(_0x3ae791[_0xd3cd('0xc')]['code']===0x1f4){logger[_0xd3cd('0xc')](_0xd3cd('0xd'),_0x2a96c0,_0x3ae791['error']['message']);return _0x1d970d(_0x3ae791[_0xd3cd('0xc')]['message']);}logger['error'](_0xd3cd('0xd'),_0x2a96c0,_0x3ae791[_0xd3cd('0xc')][_0xd3cd('0xe')]);return _0x42bd50(_0x3ae791[_0xd3cd('0xc')][_0xd3cd('0xe')]);}else{logger['info'](_0xd3cd('0xd'),_0x2a96c0,_0xd3cd('0xf'));_0x42bd50(_0x3ae791[_0xd3cd('0x10')][_0xd3cd('0xe')]);}})[_0xd3cd('0x11')](function(_0x582645){logger[_0xd3cd('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2a96c0,_0x582645);_0x1d970d(_0x582645);});});}exports[_0xd3cd('0x12')]=function(_0x2d2c4a){var _0x5e2e76=this;return new Promise(function(_0x2a8c94,_0x2dfc4c){return db[_0xd3cd('0x13')][_0xd3cd('0x14')]({'raw':_0x2d2c4a['options']?_0x2d2c4a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d2c4a[_0xd3cd('0x15')]?_0x2d2c4a[_0xd3cd('0x15')][_0xd3cd('0x16')]||null:null,'attributes':_0x2d2c4a[_0xd3cd('0x15')]?_0x2d2c4a[_0xd3cd('0x15')]['attributes']||null:null,'limit':_0x2d2c4a[_0xd3cd('0x15')]?_0x2d2c4a[_0xd3cd('0x15')][_0xd3cd('0x17')]||null:null,'include':_0x2d2c4a[_0xd3cd('0x15')]?_0x2d2c4a[_0xd3cd('0x15')][_0xd3cd('0x18')]?_[_0xd3cd('0x19')](_0x2d2c4a[_0xd3cd('0x15')]['include'],function(_0x2d9897){return{'model':db[_0x2d9897[_0xd3cd('0x1a')]],'as':_0x2d9897['as'],'attributes':_0x2d9897['attributes'],'include':_0x2d9897[_0xd3cd('0x18')]?_[_0xd3cd('0x19')](_0x2d9897[_0xd3cd('0x18')],function(_0x246f68){return{'model':db[_0x246f68[_0xd3cd('0x1a')]],'as':_0x246f68['as'],'attributes':_0x246f68[_0xd3cd('0x1b')],'include':_0x246f68[_0xd3cd('0x18')]?_[_0xd3cd('0x19')](_0x246f68[_0xd3cd('0x18')],function(_0x30e3d3){return{'model':db[_0x30e3d3[_0xd3cd('0x1a')]],'as':_0x30e3d3['as'],'attributes':_0x30e3d3[_0xd3cd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3cd('0x8')](function(_0x406c8c){logger[_0xd3cd('0x9')]('GetZohoAccount',_0x2d2c4a);logger[_0xd3cd('0xa')]('GetZohoAccount',_0x2d2c4a,JSON[_0xd3cd('0x1c')](_0x406c8c));_0x2a8c94(_0x406c8c);})[_0xd3cd('0x11')](function(_0x131655){logger[_0xd3cd('0xc')](_0xd3cd('0x12'),_0x131655[_0xd3cd('0xe')],_0x2d2c4a);_0x2dfc4c(_0x5e2e76[_0xd3cd('0xc')](0x1f4,_0x131655[_0xd3cd('0xe')]));});});};exports[_0xd3cd('0x1d')]=function(_0xe00be8){var _0xe94211=this;return new Promise(function(_0x189299,_0x1b7048){return db[_0xd3cd('0x13')][_0xd3cd('0x1e')]({'raw':_0xe00be8[_0xd3cd('0x15')]?_0xe00be8['options'][_0xd3cd('0x1f')]===undefined?!![]:![]:!![],'where':_0xe00be8['options']?_0xe00be8[_0xd3cd('0x15')][_0xd3cd('0x16')]||null:null,'attributes':_0xe00be8['options']?_0xe00be8[_0xd3cd('0x15')][_0xd3cd('0x1b')]||null:null,'include':_0xe00be8[_0xd3cd('0x15')]?_0xe00be8[_0xd3cd('0x15')][_0xd3cd('0x18')]?_[_0xd3cd('0x19')](_0xe00be8[_0xd3cd('0x15')][_0xd3cd('0x18')],function(_0x1efafd){return{'model':db[_0x1efafd[_0xd3cd('0x1a')]],'as':_0x1efafd['as'],'attributes':_0x1efafd[_0xd3cd('0x1b')],'include':_0x1efafd['include']?_[_0xd3cd('0x19')](_0x1efafd['include'],function(_0x38d4bd){return{'model':db[_0x38d4bd['model']],'as':_0x38d4bd['as'],'attributes':_0x38d4bd[_0xd3cd('0x1b')],'include':_0x38d4bd[_0xd3cd('0x18')]?_[_0xd3cd('0x19')](_0x38d4bd[_0xd3cd('0x18')],function(_0x5bc990){return{'model':db[_0x5bc990['model']],'as':_0x5bc990['as'],'attributes':_0x5bc990['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3cd('0x8')](function(_0x4d0ae3){logger[_0xd3cd('0x9')](_0xd3cd('0x1d'),_0xe00be8);logger[_0xd3cd('0xa')](_0xd3cd('0x1d'),_0xe00be8,JSON[_0xd3cd('0x1c')](_0x4d0ae3));_0x189299(_0x4d0ae3);})[_0xd3cd('0x11')](function(_0xd79a5b){logger[_0xd3cd('0xc')](_0xd3cd('0x1d'),_0xd79a5b[_0xd3cd('0xe')],_0xe00be8);_0x1b7048(_0xe94211[_0xd3cd('0xc')](0x1f4,_0xd79a5b[_0xd3cd('0xe')]));});});}; \ No newline at end of file +var _0x7428=['debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','raw','where','attributes','limit','include','model','map','GetZohoAccount','ShowZohoAccount','ZohoAccount','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x7428,0x1aa));var _0x8742=function(_0x5f0413,_0x32d5fe){_0x5f0413=_0x5f0413-0x0;var _0x297f26=_0x7428[_0x5f0413];return _0x297f26;};'use strict';var _=require(_0x8742('0x0'));var util=require(_0x8742('0x1'));var moment=require(_0x8742('0x2'));var BPromise=require(_0x8742('0x3'));var rs=require(_0x8742('0x4'));var fs=require('fs');var Redis=require(_0x8742('0x5'));var db=require(_0x8742('0x6'))['db'];var utils=require(_0x8742('0x7'));var logger=require(_0x8742('0x8'))(_0x8742('0x9'));var config=require(_0x8742('0xa'));var jayson=require(_0x8742('0xb'));var client=jayson[_0x8742('0xc')][_0x8742('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20d128,_0x1a40bb,_0xd786c2){return new BPromise(function(_0x1e0c72,_0x3f26fa){return client[_0x8742('0xe')](_0x20d128,_0xd786c2)['then'](function(_0x13f581){logger[_0x8742('0xf')](_0x8742('0x10'),_0x1a40bb,_0x8742('0x11'));logger[_0x8742('0x12')](_0x8742('0x13'),_0x1a40bb,_0x8742('0x11'),JSON[_0x8742('0x14')](_0x13f581));if(_0x13f581[_0x8742('0x15')]){if(_0x13f581['error'][_0x8742('0x16')]===0x1f4){logger['error'](_0x8742('0x10'),_0x1a40bb,_0x13f581['error'][_0x8742('0x17')]);return _0x3f26fa(_0x13f581['error']['message']);}logger[_0x8742('0x15')](_0x8742('0x10'),_0x1a40bb,_0x13f581['error'][_0x8742('0x17')]);return _0x1e0c72(_0x13f581[_0x8742('0x15')][_0x8742('0x17')]);}else{logger[_0x8742('0xf')](_0x8742('0x10'),_0x1a40bb,_0x8742('0x11'));_0x1e0c72(_0x13f581['result'][_0x8742('0x17')]);}})[_0x8742('0x18')](function(_0x1e1be3){logger['error'](_0x8742('0x10'),_0x1a40bb,_0x1e1be3);_0x3f26fa(_0x1e1be3);});});}exports['GetZohoAccount']=function(_0x1fcf0b){var _0x42f02e=this;return new Promise(function(_0x500667,_0x5e22e8){return db['ZohoAccount']['findAll']({'raw':_0x1fcf0b[_0x8742('0x19')]?_0x1fcf0b[_0x8742('0x19')][_0x8742('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fcf0b[_0x8742('0x19')]?_0x1fcf0b['options'][_0x8742('0x1b')]||null:null,'attributes':_0x1fcf0b['options']?_0x1fcf0b[_0x8742('0x19')][_0x8742('0x1c')]||null:null,'limit':_0x1fcf0b[_0x8742('0x19')]?_0x1fcf0b[_0x8742('0x19')][_0x8742('0x1d')]||null:null,'include':_0x1fcf0b[_0x8742('0x19')]?_0x1fcf0b[_0x8742('0x19')][_0x8742('0x1e')]?_['map'](_0x1fcf0b[_0x8742('0x19')][_0x8742('0x1e')],function(_0x1fa861){return{'model':db[_0x1fa861[_0x8742('0x1f')]],'as':_0x1fa861['as'],'attributes':_0x1fa861[_0x8742('0x1c')],'include':_0x1fa861['include']?_[_0x8742('0x20')](_0x1fa861[_0x8742('0x1e')],function(_0x14d781){return{'model':db[_0x14d781['model']],'as':_0x14d781['as'],'attributes':_0x14d781['attributes'],'include':_0x14d781[_0x8742('0x1e')]?_['map'](_0x14d781[_0x8742('0x1e')],function(_0x66d52f){return{'model':db[_0x66d52f[_0x8742('0x1f')]],'as':_0x66d52f['as'],'attributes':_0x66d52f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40025f){logger['info'](_0x8742('0x21'),_0x1fcf0b);logger[_0x8742('0x12')](_0x8742('0x21'),_0x1fcf0b,JSON['stringify'](_0x40025f));_0x500667(_0x40025f);})['catch'](function(_0x3d9bc4){logger[_0x8742('0x15')]('GetZohoAccount',_0x3d9bc4[_0x8742('0x17')],_0x1fcf0b);_0x5e22e8(_0x42f02e[_0x8742('0x15')](0x1f4,_0x3d9bc4[_0x8742('0x17')]));});});};exports[_0x8742('0x22')]=function(_0x31a1e0){var _0x50055d=this;return new Promise(function(_0x52e784,_0x5aec15){return db[_0x8742('0x23')]['find']({'raw':_0x31a1e0[_0x8742('0x19')]?_0x31a1e0[_0x8742('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x31a1e0[_0x8742('0x19')]?_0x31a1e0[_0x8742('0x19')][_0x8742('0x1b')]||null:null,'attributes':_0x31a1e0[_0x8742('0x19')]?_0x31a1e0[_0x8742('0x19')][_0x8742('0x1c')]||null:null,'include':_0x31a1e0[_0x8742('0x19')]?_0x31a1e0[_0x8742('0x19')]['include']?_['map'](_0x31a1e0[_0x8742('0x19')][_0x8742('0x1e')],function(_0x32a9c6){return{'model':db[_0x32a9c6['model']],'as':_0x32a9c6['as'],'attributes':_0x32a9c6['attributes'],'include':_0x32a9c6['include']?_[_0x8742('0x20')](_0x32a9c6[_0x8742('0x1e')],function(_0xcf10){return{'model':db[_0xcf10[_0x8742('0x1f')]],'as':_0xcf10['as'],'attributes':_0xcf10[_0x8742('0x1c')],'include':_0xcf10[_0x8742('0x1e')]?_[_0x8742('0x20')](_0xcf10[_0x8742('0x1e')],function(_0x30fb20){return{'model':db[_0x30fb20[_0x8742('0x1f')]],'as':_0x30fb20['as'],'attributes':_0x30fb20[_0x8742('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8742('0x24')](function(_0x5ea6f3){logger['info'](_0x8742('0x22'),_0x31a1e0);logger['debug']('ShowZohoAccount',_0x31a1e0,JSON[_0x8742('0x14')](_0x5ea6f3));_0x52e784(_0x5ea6f3);})[_0x8742('0x18')](function(_0x4e98b3){logger['error'](_0x8742('0x22'),_0x4e98b3[_0x8742('0x17')],_0x31a1e0);_0x5aec15(_0x50055d[_0x8742('0x15')](0x1f4,_0x4e98b3['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index acbaa34..06d45f7 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 _0xb16f=['put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','/:id','show','/:id/fields','isAuthenticated','getSubjects','get','/:id/descriptions','getDescriptions','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb16f,0xf6));var _0xfb16=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0xb16f[_0x37756b];return _0x46efec;};'use strict';var multer=require(_0xfb16('0x0'));var util=require(_0xfb16('0x1'));var path=require(_0xfb16('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb16('0x3'));var router=express[_0xfb16('0x4')]();var auth=require(_0xfb16('0x5'));var interaction=require(_0xfb16('0x6'));var config=require('../../config/environment');var controller=require(_0xfb16('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfb16('0x8'),auth['isAuthenticated'](),controller[_0xfb16('0x9')]);router['get'](_0xfb16('0xa'),auth[_0xfb16('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xfb16('0xb')](),controller[_0xfb16('0xc')]);router[_0xfb16('0xd')](_0xfb16('0xe'),auth[_0xfb16('0xb')](),controller[_0xfb16('0xf')]);router[_0xfb16('0x10')]('/',auth[_0xfb16('0xb')](),controller[_0xfb16('0x11')]);router[_0xfb16('0x12')](_0xfb16('0x8'),auth['isAuthenticated'](),controller[_0xfb16('0x13')]);router['delete']('/:id',auth[_0xfb16('0xb')](),controller[_0xfb16('0x14')]);module[_0xfb16('0x15')]=router; \ No newline at end of file +var _0xf17f=['util','path','express','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','delete','destroy','exports','multer'];(function(_0x9a23df,_0x2edc93){var _0x44c94e=function(_0xb17494){while(--_0xb17494){_0x9a23df['push'](_0x9a23df['shift']());}};_0x44c94e(++_0x2edc93);}(_0xf17f,0x113));var _0xff17=function(_0x5cc5dc,_0x1af669){_0x5cc5dc=_0x5cc5dc-0x0;var _0x421a9c=_0xf17f[_0x5cc5dc];return _0x421a9c;};'use strict';var multer=require(_0xff17('0x0'));var util=require(_0xff17('0x1'));var path=require(_0xff17('0x2'));var timeout=require('connect-timeout');var express=require(_0xff17('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xff17('0x4'));var config=require(_0xff17('0x5'));var controller=require(_0xff17('0x6'));router[_0xff17('0x7')]('/',auth['isAuthenticated'](),controller[_0xff17('0x8')]);router[_0xff17('0x7')]('/:id',auth[_0xff17('0x9')](),controller[_0xff17('0xa')]);router['get'](_0xff17('0xb'),auth[_0xff17('0x9')](),controller[_0xff17('0xc')]);router['get'](_0xff17('0xd'),auth[_0xff17('0x9')](),controller[_0xff17('0xe')]);router['get'](_0xff17('0xf'),auth[_0xff17('0x9')](),controller[_0xff17('0x10')]);router[_0xff17('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xff17('0x12')](_0xff17('0x13'),auth[_0xff17('0x9')](),controller['update']);router[_0xff17('0x14')](_0xff17('0x13'),auth['isAuthenticated'](),controller[_0xff17('0x15')]);module[_0xff17('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 03318ba..0b1d1ce 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 _0x1cf8=['lead','contact','nothing','contact_lead','STRING','sequelize','ENUM'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0x1cf8,0x147));var _0x81cf=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0x1cf8[_0x4f3242];return _0x49844f;};'use strict';var Sequelize=require(_0x81cf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x81cf('0x1')](_0x81cf('0x2'),_0x81cf('0x3'),_0x81cf('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x81cf('0x1')](_0x81cf('0x5'),'contact',_0x81cf('0x2')),'defaultValue':_0x81cf('0x5')},'description':{'type':Sequelize[_0x81cf('0x6')]}}; \ No newline at end of file +var _0xa0ea=['STRING','ENUM','lead','nothing','contact_lead','exports'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xa0ea,0x14f));var _0xaa0e=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xa0ea[_0x28669c];return _0x4a3af6;};'use strict';var Sequelize=require('sequelize');module[_0xaa0e('0x0')]={'name':{'type':Sequelize[_0xaa0e('0x1')]},'moduleCreate':{'type':Sequelize[_0xaa0e('0x2')](_0xaa0e('0x3'),'contact',_0xaa0e('0x4')),'defaultValue':_0xaa0e('0x3')},'moduleSearch':{'type':Sequelize[_0xaa0e('0x2')]('contact_lead','contact',_0xaa0e('0x3')),'defaultValue':_0xaa0e('0x5')},'description':{'type':Sequelize[_0xaa0e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 44061ae..837fa53 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 _0xb4f4=['error','message','info','result','sendStatus','status','end','count','offset','Content-Range','json','reject','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','then','rows','show','keys','options','find','catch','create','body','params','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','fast-json-patch','moment','mustache','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','ValidationError','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x2118af,_0x5bf739){var _0x1f14a5=function(_0x2432fe){while(--_0x2432fe){_0x2118af['push'](_0x2118af['shift']());}};_0x1f14a5(++_0x5bf739);}(_0xb4f4,0x8d));var _0x4b4f=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xb4f4[_0x1b6c6d];return _0x290d9d;};'use strict';var pdf=require(_0x4b4f('0x0'));var emlformat=require(_0x4b4f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b4f('0x2'));var rp=require('request-promise');var moment=require(_0x4b4f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4b4f('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4b4f('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4b4f('0x6'));var crypto=require(_0x4b4f('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x4b4f('0x8'));var toCsv=require(_0x4b4f('0x5'));var querystring=require(_0x4b4f('0x9'));var Papa=require(_0x4b4f('0xa'));var Redis=require(_0x4b4f('0xb'));var authService=require(_0x4b4f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4b4f('0xd'));var hardwareService=require(_0x4b4f('0xe'));var logger=require('../../config/logger')(_0x4b4f('0xf'));var utils=require(_0x4b4f('0x10'));var config=require('../../config/environment');var db=require(_0x4b4f('0x11'))['db'];var jayson=require(_0x4b4f('0x12'));var client=jayson[_0x4b4f('0x13')][_0x4b4f('0x14')]({'port':0x232a});function checkPasswordPattern(_0xfa6754,_0x242073,_0x44cb2f){if(_0x44cb2f){var _0x322292=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x322292[_0x4b4f('0x15')](_0x242073)){return _0xfa6754;}else{throw new db['Sequelize'][(_0x4b4f('0x16'))]('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 _0xfa6754;}}function respondWithRpcPromise(_0x138c5c,_0x434b4a,_0x4f2363,_0x58fa51){return new BPromise(function(_0x1db451,_0x1dc345){var _0x1d1692=_0x58fa51||client;return _0x1d1692['request'](_0x138c5c,_0x4f2363)['then'](function(_0x37969a){logger['info'](_0x4b4f('0x17'),_0x434b4a,_0x4b4f('0x18'));logger[_0x4b4f('0x19')](_0x4b4f('0x1a'),_0x434b4a,'request\x20sent',JSON[_0x4b4f('0x1b')](_0x37969a));if(_0x37969a['error']){if(_0x37969a['error'][_0x4b4f('0x1c')]===0x1f4){logger['error'](_0x4b4f('0x17'),_0x434b4a,_0x37969a[_0x4b4f('0x1d')]['message']);return _0x1dc345(_0x37969a[_0x4b4f('0x1d')][_0x4b4f('0x1e')]);}logger[_0x4b4f('0x1d')](_0x4b4f('0x17'),_0x434b4a,_0x37969a['error'][_0x4b4f('0x1e')]);return _0x1db451(_0x37969a['error'][_0x4b4f('0x1e')]);}else{logger[_0x4b4f('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x434b4a,_0x4b4f('0x18'));_0x1db451(_0x37969a[_0x4b4f('0x20')]['message']);}})['catch'](function(_0x2cf20a){logger[_0x4b4f('0x1d')](_0x4b4f('0x17'),_0x434b4a,_0x2cf20a);_0x1dc345(_0x2cf20a);});});}function respondWithStatusCode(_0x4272af,_0x3844aa){_0x3844aa=_0x3844aa||0xcc;return function(_0x5053ae){if(_0x5053ae){return _0x4272af[_0x4b4f('0x21')](_0x3844aa);}return _0x4272af[_0x4b4f('0x22')](_0x3844aa)[_0x4b4f('0x23')]();};}function respondWithResult(_0x52c12d,_0x165b85){_0x165b85=_0x165b85||0xc8;return function(_0x1d5d32){if(_0x1d5d32){return _0x52c12d['status'](_0x165b85)['json'](_0x1d5d32);}};}function respondWithFilteredResult(_0x155e6d,_0x2ec5a5){return function(_0x42634b){if(_0x42634b){var _0x5719ab=_0x42634b[_0x4b4f('0x24')],_0xa27d73=_0x2ec5a5['offset'],_0x1df1d9=_0x2ec5a5[_0x4b4f('0x25')]+_0x2ec5a5['limit'],_0x25e9c7;if(_0x1df1d9>=_0x5719ab){_0x1df1d9=_0x5719ab;_0x25e9c7=0xc8;}else{_0x25e9c7=0xce;}_0x155e6d['status'](_0x25e9c7);return _0x155e6d['set'](_0x4b4f('0x26'),_0xa27d73+'-'+_0x1df1d9+'/'+_0x5719ab)[_0x4b4f('0x27')](_0x42634b);}return null;};}function patchUpdates(_0x23ebdc){return function(_0x155a05){try{jsonpatch['apply'](_0x155a05,_0x23ebdc,!![]);}catch(_0x53e105){return BPromise[_0x4b4f('0x28')](_0x53e105);}return _0x155a05['save']();};}function saveUpdates(_0x23edfc,_0x5c2028){return function(_0x3e06f8){if(_0x3e06f8){return _0x3e06f8['update'](_0x23edfc)['then'](function(_0x233384){return _0x233384;});}return null;};}function removeEntity(_0x5a25cd,_0xab427c){return function(_0x11d2eb){if(_0x11d2eb){return _0x11d2eb[_0x4b4f('0x29')]()['then'](function(){_0x5a25cd['status'](0xcc)[_0x4b4f('0x23')]();});}};}function handleEntityNotFound(_0x5bfa66,_0x38b0ea){return function(_0x4d8c90){if(!_0x4d8c90){_0x5bfa66[_0x4b4f('0x21')](0x194);}return _0x4d8c90;};}function handleError(_0x14c48a,_0x2f168b){_0x2f168b=_0x2f168b||0x1f4;return function(_0x5ab920){logger[_0x4b4f('0x1d')](_0x5ab920[_0x4b4f('0x2a')]);if(_0x5ab920[_0x4b4f('0x2b')]){delete _0x5ab920[_0x4b4f('0x2b')];}_0x14c48a['status'](_0x2f168b)[_0x4b4f('0x2c')](_0x5ab920);};}exports[_0x4b4f('0x2d')]=function(_0x254b33,_0x2cdb1d){var _0x14bdc5={},_0x3a2052={},_0x51ba3b={'count':0x0,'rows':[]};var _0x8e1def=_[_0x4b4f('0x2e')](db[_0x4b4f('0x2f')][_0x4b4f('0x30')],function(_0x4a64e3){return{'name':_0x4a64e3[_0x4b4f('0x31')],'type':_0x4a64e3['type']['key']};});_0x3a2052[_0x4b4f('0x32')]=_['map'](_0x8e1def,_0x4b4f('0x2b'));_0x3a2052[_0x4b4f('0x33')]=_['keys'](_0x254b33[_0x4b4f('0x33')]);_0x3a2052[_0x4b4f('0x34')]=_[_0x4b4f('0x35')](_0x3a2052[_0x4b4f('0x32')],_0x3a2052[_0x4b4f('0x33')]);_0x14bdc5['attributes']=_[_0x4b4f('0x35')](_0x3a2052['model'],qs[_0x4b4f('0x36')](_0x254b33[_0x4b4f('0x33')][_0x4b4f('0x36')]));_0x14bdc5[_0x4b4f('0x37')]=_0x14bdc5[_0x4b4f('0x37')][_0x4b4f('0x38')]?_0x14bdc5[_0x4b4f('0x37')]:_0x3a2052[_0x4b4f('0x32')];if(!_0x254b33[_0x4b4f('0x33')]['hasOwnProperty']('nolimit')){_0x14bdc5[_0x4b4f('0x39')]=qs['limit'](_0x254b33[_0x4b4f('0x33')][_0x4b4f('0x39')]);_0x14bdc5[_0x4b4f('0x25')]=qs[_0x4b4f('0x25')](_0x254b33[_0x4b4f('0x33')][_0x4b4f('0x25')]);}_0x14bdc5[_0x4b4f('0x3a')]=qs['sort'](_0x254b33[_0x4b4f('0x33')][_0x4b4f('0x3b')]);_0x14bdc5[_0x4b4f('0x3c')]=qs[_0x4b4f('0x34')](_[_0x4b4f('0x3d')](_0x254b33[_0x4b4f('0x33')],_0x3a2052[_0x4b4f('0x34')]),_0x8e1def);if(_0x254b33['query'][_0x4b4f('0x3e')]){_0x14bdc5['where']=_[_0x4b4f('0x3f')](_0x14bdc5[_0x4b4f('0x3c')],{'$or':_[_0x4b4f('0x2e')](_0x8e1def,function(_0x1280f0){if(_0x1280f0[_0x4b4f('0x40')]!=='VIRTUAL'){var _0x407894={};_0x407894[_0x1280f0['name']]={'$like':'%'+_0x254b33[_0x4b4f('0x33')]['filter']+'%'};return _0x407894;}})});}_0x14bdc5=_['merge']({},_0x14bdc5,_0x254b33['options']);var _0x4533a1={'where':_0x14bdc5[_0x4b4f('0x3c')]};return db[_0x4b4f('0x2f')][_0x4b4f('0x24')](_0x4533a1)['then'](function(_0x256dc8){_0x51ba3b[_0x4b4f('0x24')]=_0x256dc8;if(_0x254b33['query'][_0x4b4f('0x41')]){_0x14bdc5[_0x4b4f('0x42')]=[{'all':!![]}];}return db[_0x4b4f('0x2f')][_0x4b4f('0x43')](_0x14bdc5);})[_0x4b4f('0x44')](function(_0x28ed1a){_0x51ba3b[_0x4b4f('0x45')]=_0x28ed1a;return _0x51ba3b;})[_0x4b4f('0x44')](respondWithFilteredResult(_0x2cdb1d,_0x14bdc5))['catch'](handleError(_0x2cdb1d,null));};exports[_0x4b4f('0x46')]=function(_0x42ac8c,_0x2c38fe){var _0x553a56={'raw':![],'where':{'id':_0x42ac8c['params']['id']}},_0x5f40c2={};_0x5f40c2[_0x4b4f('0x32')]=_[_0x4b4f('0x47')](db[_0x4b4f('0x2f')][_0x4b4f('0x30')]);_0x5f40c2[_0x4b4f('0x33')]=_[_0x4b4f('0x47')](_0x42ac8c[_0x4b4f('0x33')]);_0x5f40c2[_0x4b4f('0x34')]=_['intersection'](_0x5f40c2[_0x4b4f('0x32')],_0x5f40c2[_0x4b4f('0x33')]);_0x553a56[_0x4b4f('0x37')]=_[_0x4b4f('0x35')](_0x5f40c2[_0x4b4f('0x32')],qs['fields'](_0x42ac8c[_0x4b4f('0x33')]['fields']));_0x553a56[_0x4b4f('0x37')]=_0x553a56[_0x4b4f('0x37')][_0x4b4f('0x38')]?_0x553a56[_0x4b4f('0x37')]:_0x5f40c2[_0x4b4f('0x32')];if(_0x42ac8c[_0x4b4f('0x33')]['includeAll']){_0x553a56['include']=[{'all':!![]}];}_0x553a56=_[_0x4b4f('0x3f')]({},_0x553a56,_0x42ac8c[_0x4b4f('0x48')]);return db[_0x4b4f('0x2f')][_0x4b4f('0x49')](_0x553a56)[_0x4b4f('0x44')](handleEntityNotFound(_0x2c38fe,null))['then'](respondWithResult(_0x2c38fe,null))[_0x4b4f('0x4a')](handleError(_0x2c38fe,null));};exports['create']=function(_0x40fcf6,_0x597ea1){return db[_0x4b4f('0x2f')][_0x4b4f('0x4b')](_0x40fcf6[_0x4b4f('0x4c')],{})[_0x4b4f('0x44')](respondWithResult(_0x597ea1,0xc9))[_0x4b4f('0x4a')](handleError(_0x597ea1,null));};exports['update']=function(_0x1bdfdc,_0x4f469a){if(_0x1bdfdc[_0x4b4f('0x4c')]['id']){delete _0x1bdfdc[_0x4b4f('0x4c')]['id'];}return db[_0x4b4f('0x2f')][_0x4b4f('0x49')]({'where':{'id':_0x1bdfdc['params']['id']}})[_0x4b4f('0x44')](handleEntityNotFound(_0x4f469a,null))[_0x4b4f('0x44')](saveUpdates(_0x1bdfdc['body'],null))[_0x4b4f('0x44')](respondWithResult(_0x4f469a,null))[_0x4b4f('0x4a')](handleError(_0x4f469a,null));};exports[_0x4b4f('0x29')]=function(_0x59646e,_0x33d6b3){return db[_0x4b4f('0x2f')][_0x4b4f('0x49')]({'where':{'id':_0x59646e[_0x4b4f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33d6b3,null))[_0x4b4f('0x44')](removeEntity(_0x33d6b3,null))[_0x4b4f('0x4a')](handleError(_0x33d6b3,null));};exports[_0x4b4f('0x4e')]=function(_0x377598,_0x40e002,_0x1a058e){var _0x35d016={};var _0x2f31ed={};var _0x2d561f;var _0x4da63c;return db['ZohoConfiguration'][_0x4b4f('0x4f')]({'where':{'id':_0x377598['params']['id']}})[_0x4b4f('0x44')](handleEntityNotFound(_0x40e002,null))[_0x4b4f('0x44')](function(_0x3e602f){if(_0x3e602f){_0x2d561f=_0x3e602f;_0x2f31ed['model']=_['keys'](db[_0x4b4f('0x50')][_0x4b4f('0x30')]);_0x2f31ed[_0x4b4f('0x33')]=_[_0x4b4f('0x47')](_0x377598['query']);_0x2f31ed[_0x4b4f('0x34')]=_[_0x4b4f('0x35')](_0x2f31ed['model'],_0x2f31ed[_0x4b4f('0x33')]);_0x35d016[_0x4b4f('0x37')]=_['intersection'](_0x2f31ed[_0x4b4f('0x32')],qs[_0x4b4f('0x36')](_0x377598[_0x4b4f('0x33')][_0x4b4f('0x36')]));_0x35d016[_0x4b4f('0x37')]=_0x35d016['attributes'][_0x4b4f('0x38')]?_0x35d016['attributes']:_0x2f31ed[_0x4b4f('0x32')];_0x35d016['order']=qs['sort'](_0x377598[_0x4b4f('0x33')][_0x4b4f('0x3b')]);_0x35d016['where']=qs[_0x4b4f('0x34')](_['pick'](_0x377598[_0x4b4f('0x33')],_0x2f31ed['filters']));if(_0x377598[_0x4b4f('0x33')][_0x4b4f('0x3e')]){_0x35d016['where']=_[_0x4b4f('0x3f')](_0x35d016['where'],{'$or':_[_0x4b4f('0x2e')](_0x35d016['attributes'],function(_0x1d1639){var _0x16b0c9={};_0x16b0c9[_0x1d1639]={'$like':'%'+_0x377598[_0x4b4f('0x33')][_0x4b4f('0x3e')]+'%'};return _0x16b0c9;})});}_0x35d016=_[_0x4b4f('0x3f')]({},_0x35d016,_0x377598[_0x4b4f('0x48')]);return _0x2d561f[_0x4b4f('0x4e')](_0x35d016);}})[_0x4b4f('0x44')](function(_0x139191){if(_0x139191){_0x4da63c=_0x139191[_0x4b4f('0x38')];if(!_0x377598[_0x4b4f('0x33')][_0x4b4f('0x51')]('nolimit')){_0x35d016[_0x4b4f('0x39')]=qs['limit'](_0x377598[_0x4b4f('0x33')]['limit']);_0x35d016[_0x4b4f('0x25')]=qs['offset'](_0x377598['query']['offset']);}return _0x2d561f[_0x4b4f('0x4e')](_0x35d016);}})['then'](function(_0x4085d2){if(_0x4085d2){return _0x4085d2?{'count':_0x4da63c,'rows':_0x4085d2}:null;}})[_0x4b4f('0x44')](respondWithResult(_0x40e002,null))['catch'](handleError(_0x40e002,null));};exports[_0x4b4f('0x52')]=function(_0xf77aa3,_0x33318c,_0x2e170d){var _0x4316b2={};var _0x248207={};var _0x531d54;var _0x672f71;return db[_0x4b4f('0x2f')][_0x4b4f('0x4f')]({'where':{'id':_0xf77aa3['params']['id']}})[_0x4b4f('0x44')](handleEntityNotFound(_0x33318c,null))[_0x4b4f('0x44')](function(_0x8e1c01){if(_0x8e1c01){_0x531d54=_0x8e1c01;_0x248207[_0x4b4f('0x32')]=_[_0x4b4f('0x47')](db[_0x4b4f('0x50')][_0x4b4f('0x30')]);_0x248207[_0x4b4f('0x33')]=_[_0x4b4f('0x47')](_0xf77aa3['query']);_0x248207[_0x4b4f('0x34')]=_[_0x4b4f('0x35')](_0x248207[_0x4b4f('0x32')],_0x248207['query']);_0x4316b2[_0x4b4f('0x37')]=_[_0x4b4f('0x35')](_0x248207['model'],qs[_0x4b4f('0x36')](_0xf77aa3['query']['fields']));_0x4316b2[_0x4b4f('0x37')]=_0x4316b2[_0x4b4f('0x37')][_0x4b4f('0x38')]?_0x4316b2[_0x4b4f('0x37')]:_0x248207[_0x4b4f('0x32')];_0x4316b2[_0x4b4f('0x3a')]=qs['sort'](_0xf77aa3['query']['sort']);_0x4316b2['where']=qs['filters'](_[_0x4b4f('0x3d')](_0xf77aa3[_0x4b4f('0x33')],_0x248207['filters']));if(_0xf77aa3[_0x4b4f('0x33')][_0x4b4f('0x3e')]){_0x4316b2[_0x4b4f('0x3c')]=_[_0x4b4f('0x3f')](_0x4316b2[_0x4b4f('0x3c')],{'$or':_[_0x4b4f('0x2e')](_0x4316b2['attributes'],function(_0x3ebf25){var _0x1fc01d={};_0x1fc01d[_0x3ebf25]={'$like':'%'+_0xf77aa3[_0x4b4f('0x33')][_0x4b4f('0x3e')]+'%'};return _0x1fc01d;})});}_0x4316b2=_[_0x4b4f('0x3f')]({},_0x4316b2,_0xf77aa3[_0x4b4f('0x48')]);return _0x531d54['getSubjects'](_0x4316b2);}})[_0x4b4f('0x44')](function(_0x250221){if(_0x250221){_0x672f71=_0x250221['length'];if(!_0xf77aa3[_0x4b4f('0x33')][_0x4b4f('0x51')](_0x4b4f('0x53'))){_0x4316b2['limit']=qs['limit'](_0xf77aa3[_0x4b4f('0x33')][_0x4b4f('0x39')]);_0x4316b2[_0x4b4f('0x25')]=qs[_0x4b4f('0x25')](_0xf77aa3[_0x4b4f('0x33')][_0x4b4f('0x25')]);}return _0x531d54[_0x4b4f('0x52')](_0x4316b2);}})[_0x4b4f('0x44')](function(_0x4c318e){if(_0x4c318e){return _0x4c318e?{'count':_0x672f71,'rows':_0x4c318e}:null;}})[_0x4b4f('0x44')](respondWithResult(_0x33318c,null))[_0x4b4f('0x4a')](handleError(_0x33318c,null));};exports[_0x4b4f('0x54')]=function(_0x8f0ca9,_0xe512f1,_0x4a1b12){var _0x5a9f0e={};var _0x332189={};var _0x787dac;var _0x29294f;return db['ZohoConfiguration'][_0x4b4f('0x4f')]({'where':{'id':_0x8f0ca9[_0x4b4f('0x4d')]['id']}})[_0x4b4f('0x44')](handleEntityNotFound(_0xe512f1,null))[_0x4b4f('0x44')](function(_0x326bd5){if(_0x326bd5){_0x787dac=_0x326bd5;_0x332189[_0x4b4f('0x32')]=_[_0x4b4f('0x47')](db[_0x4b4f('0x50')][_0x4b4f('0x30')]);_0x332189[_0x4b4f('0x33')]=_[_0x4b4f('0x47')](_0x8f0ca9[_0x4b4f('0x33')]);_0x332189[_0x4b4f('0x34')]=_[_0x4b4f('0x35')](_0x332189['model'],_0x332189['query']);_0x5a9f0e[_0x4b4f('0x37')]=_[_0x4b4f('0x35')](_0x332189[_0x4b4f('0x32')],qs['fields'](_0x8f0ca9['query'][_0x4b4f('0x36')]));_0x5a9f0e[_0x4b4f('0x37')]=_0x5a9f0e['attributes'][_0x4b4f('0x38')]?_0x5a9f0e[_0x4b4f('0x37')]:_0x332189['model'];_0x5a9f0e[_0x4b4f('0x3a')]=qs[_0x4b4f('0x3b')](_0x8f0ca9[_0x4b4f('0x33')][_0x4b4f('0x3b')]);_0x5a9f0e['where']=qs['filters'](_[_0x4b4f('0x3d')](_0x8f0ca9[_0x4b4f('0x33')],_0x332189[_0x4b4f('0x34')]));if(_0x8f0ca9[_0x4b4f('0x33')][_0x4b4f('0x3e')]){_0x5a9f0e[_0x4b4f('0x3c')]=_[_0x4b4f('0x3f')](_0x5a9f0e[_0x4b4f('0x3c')],{'$or':_[_0x4b4f('0x2e')](_0x5a9f0e[_0x4b4f('0x37')],function(_0x3b997e){var _0x4aeb99={};_0x4aeb99[_0x3b997e]={'$like':'%'+_0x8f0ca9['query'][_0x4b4f('0x3e')]+'%'};return _0x4aeb99;})});}_0x5a9f0e=_[_0x4b4f('0x3f')]({},_0x5a9f0e,_0x8f0ca9[_0x4b4f('0x48')]);return _0x787dac[_0x4b4f('0x54')](_0x5a9f0e);}})[_0x4b4f('0x44')](function(_0x18bd91){if(_0x18bd91){_0x29294f=_0x18bd91[_0x4b4f('0x38')];if(!_0x8f0ca9['query']['hasOwnProperty'](_0x4b4f('0x53'))){_0x5a9f0e[_0x4b4f('0x39')]=qs[_0x4b4f('0x39')](_0x8f0ca9[_0x4b4f('0x33')]['limit']);_0x5a9f0e['offset']=qs[_0x4b4f('0x25')](_0x8f0ca9[_0x4b4f('0x33')][_0x4b4f('0x25')]);}return _0x787dac[_0x4b4f('0x54')](_0x5a9f0e);}})[_0x4b4f('0x44')](function(_0x3e664a){if(_0x3e664a){return _0x3e664a?{'count':_0x29294f,'rows':_0x3e664a}:null;}})[_0x4b4f('0x44')](respondWithResult(_0xe512f1,null))[_0x4b4f('0x4a')](handleError(_0xe512f1,null));}; \ No newline at end of file +var _0x5019=['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','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','include','merge','find','create','body','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x5124c2,_0xdaada5){var _0x14b401=function(_0x1a1fec){while(--_0x1a1fec){_0x5124c2['push'](_0x5124c2['shift']());}};_0x14b401(++_0xdaada5);}(_0x5019,0x1c5));var _0x9501=function(_0x2c39b1,_0x147749){_0x2c39b1=_0x2c39b1-0x0;var _0x183ebe=_0x5019[_0x2c39b1];return _0x183ebe;};'use strict';var pdf=require(_0x9501('0x0'));var emlformat=require(_0x9501('0x1'));var rimraf=require(_0x9501('0x2'));var zipdir=require(_0x9501('0x3'));var jsonpatch=require(_0x9501('0x4'));var rp=require(_0x9501('0x5'));var moment=require('moment');var BPromise=require(_0x9501('0x6'));var Mustache=require(_0x9501('0x7'));var util=require(_0x9501('0x8'));var path=require(_0x9501('0x9'));var sox=require(_0x9501('0xa'));var csv=require(_0x9501('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9501('0xc'));var squel=require(_0x9501('0xd'));var crypto=require('crypto');var jsforce=require(_0x9501('0xe'));var deskjs=require(_0x9501('0xf'));var toCsv=require(_0x9501('0xb'));var querystring=require(_0x9501('0x10'));var Papa=require('papaparse');var Redis=require(_0x9501('0x11'));var authService=require(_0x9501('0x12'));var qs=require(_0x9501('0x13'));var as=require(_0x9501('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9501('0x15'))(_0x9501('0x16'));var utils=require(_0x9501('0x17'));var config=require(_0x9501('0x18'));var db=require(_0x9501('0x19'))['db'];var jayson=require(_0x9501('0x1a'));var client=jayson[_0x9501('0x1b')][_0x9501('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x534740,_0x53edca,_0x1b242b){if(_0x1b242b){var _0x38caff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38caff['test'](_0x53edca)){return _0x534740;}else{throw new db[(_0x9501('0x1d'))][(_0x9501('0x1e'))](_0x9501('0x1f'));}}else{return _0x534740;}}function respondWithRpcPromise(_0xa1e3ec,_0x22c1a7,_0x142adc,_0x5700ed){return new BPromise(function(_0x3265a9,_0x230467){var _0x445b23=_0x5700ed||client;return _0x445b23[_0x9501('0x20')](_0xa1e3ec,_0x142adc)[_0x9501('0x21')](function(_0x325120){logger['info'](_0x9501('0x22'),_0x22c1a7,_0x9501('0x23'));logger['debug'](_0x9501('0x24'),_0x22c1a7,_0x9501('0x23'),JSON[_0x9501('0x25')](_0x325120));if(_0x325120[_0x9501('0x26')]){if(_0x325120['error'][_0x9501('0x27')]===0x1f4){logger[_0x9501('0x26')](_0x9501('0x22'),_0x22c1a7,_0x325120[_0x9501('0x26')][_0x9501('0x28')]);return _0x230467(_0x325120['error']['message']);}logger[_0x9501('0x26')](_0x9501('0x22'),_0x22c1a7,_0x325120[_0x9501('0x26')]['message']);return _0x3265a9(_0x325120[_0x9501('0x26')][_0x9501('0x28')]);}else{logger[_0x9501('0x29')](_0x9501('0x22'),_0x22c1a7,_0x9501('0x23'));_0x3265a9(_0x325120[_0x9501('0x2a')][_0x9501('0x28')]);}})['catch'](function(_0x5b5c3d){logger[_0x9501('0x26')]('ZohoConfiguration,\x20%s,\x20%s',_0x22c1a7,_0x5b5c3d);_0x230467(_0x5b5c3d);});});}function respondWithStatusCode(_0x29a258,_0x4632ad){_0x4632ad=_0x4632ad||0xcc;return function(_0x59f51e){if(_0x59f51e){return _0x29a258[_0x9501('0x2b')](_0x4632ad);}return _0x29a258['status'](_0x4632ad)[_0x9501('0x2c')]();};}function respondWithResult(_0x4992a0,_0x50823c){_0x50823c=_0x50823c||0xc8;return function(_0x345bb7){if(_0x345bb7){return _0x4992a0[_0x9501('0x2d')](_0x50823c)[_0x9501('0x2e')](_0x345bb7);}};}function respondWithFilteredResult(_0x1fc06a,_0x2f3026){return function(_0x1589a8){if(_0x1589a8){var _0x2afc49=_0x1589a8[_0x9501('0x2f')],_0x38a7b7=_0x2f3026[_0x9501('0x30')],_0x859178=_0x2f3026['offset']+_0x2f3026[_0x9501('0x31')],_0x4f91e4;if(_0x859178>=_0x2afc49){_0x859178=_0x2afc49;_0x4f91e4=0xc8;}else{_0x4f91e4=0xce;}_0x1fc06a[_0x9501('0x2d')](_0x4f91e4);return _0x1fc06a[_0x9501('0x32')](_0x9501('0x33'),_0x38a7b7+'-'+_0x859178+'/'+_0x2afc49)[_0x9501('0x2e')](_0x1589a8);}return null;};}function patchUpdates(_0x2de7e7){return function(_0x3d555f){try{jsonpatch['apply'](_0x3d555f,_0x2de7e7,!![]);}catch(_0x3f645c){return BPromise[_0x9501('0x34')](_0x3f645c);}return _0x3d555f[_0x9501('0x35')]();};}function saveUpdates(_0xade705,_0x1ac783){return function(_0x28e7ba){if(_0x28e7ba){return _0x28e7ba[_0x9501('0x36')](_0xade705)['then'](function(_0xa3421d){return _0xa3421d;});}return null;};}function removeEntity(_0x2db02e,_0x460606){return function(_0x494489){if(_0x494489){return _0x494489[_0x9501('0x37')]()[_0x9501('0x21')](function(){_0x2db02e[_0x9501('0x2d')](0xcc)[_0x9501('0x2c')]();});}};}function handleEntityNotFound(_0x23a660,_0x53618d){return function(_0x231a7c){if(!_0x231a7c){_0x23a660[_0x9501('0x2b')](0x194);}return _0x231a7c;};}function handleError(_0x131e39,_0x10205c){_0x10205c=_0x10205c||0x1f4;return function(_0x55903b){logger[_0x9501('0x26')](_0x55903b['stack']);if(_0x55903b['name']){delete _0x55903b[_0x9501('0x38')];}_0x131e39['status'](_0x10205c)[_0x9501('0x39')](_0x55903b);};}exports[_0x9501('0x3a')]=function(_0x4d5a57,_0x95b1ea){var _0x1c5420={},_0x53eaaa={},_0x15631c={'count':0x0,'rows':[]};var _0xef06ec=_['map'](db[_0x9501('0x3b')][_0x9501('0x3c')],function(_0x211cbf){return{'name':_0x211cbf['fieldName'],'type':_0x211cbf[_0x9501('0x3d')][_0x9501('0x3e')]};});_0x53eaaa[_0x9501('0x3f')]=_['map'](_0xef06ec,_0x9501('0x38'));_0x53eaaa[_0x9501('0x40')]=_[_0x9501('0x41')](_0x4d5a57[_0x9501('0x40')]);_0x53eaaa[_0x9501('0x42')]=_[_0x9501('0x43')](_0x53eaaa['model'],_0x53eaaa[_0x9501('0x40')]);_0x1c5420['attributes']=_[_0x9501('0x43')](_0x53eaaa[_0x9501('0x3f')],qs[_0x9501('0x44')](_0x4d5a57[_0x9501('0x40')][_0x9501('0x44')]));_0x1c5420[_0x9501('0x45')]=_0x1c5420[_0x9501('0x45')][_0x9501('0x46')]?_0x1c5420[_0x9501('0x45')]:_0x53eaaa[_0x9501('0x3f')];if(!_0x4d5a57['query'][_0x9501('0x47')]('nolimit')){_0x1c5420[_0x9501('0x31')]=qs['limit'](_0x4d5a57[_0x9501('0x40')][_0x9501('0x31')]);_0x1c5420[_0x9501('0x30')]=qs['offset'](_0x4d5a57['query'][_0x9501('0x30')]);}_0x1c5420[_0x9501('0x48')]=qs[_0x9501('0x49')](_0x4d5a57[_0x9501('0x40')][_0x9501('0x49')]);_0x1c5420[_0x9501('0x4a')]=qs[_0x9501('0x42')](_[_0x9501('0x4b')](_0x4d5a57[_0x9501('0x40')],_0x53eaaa['filters']),_0xef06ec);if(_0x4d5a57['query']['filter']){_0x1c5420[_0x9501('0x4a')]=_['merge'](_0x1c5420[_0x9501('0x4a')],{'$or':_[_0x9501('0x4c')](_0xef06ec,function(_0xb16480){if(_0xb16480['type']!==_0x9501('0x4d')){var _0x453680={};_0x453680[_0xb16480['name']]={'$like':'%'+_0x4d5a57[_0x9501('0x40')][_0x9501('0x4e')]+'%'};return _0x453680;}})});}_0x1c5420=_['merge']({},_0x1c5420,_0x4d5a57[_0x9501('0x4f')]);var _0x216388={'where':_0x1c5420['where']};return db[_0x9501('0x3b')][_0x9501('0x2f')](_0x216388)['then'](function(_0x5a072f){_0x15631c[_0x9501('0x2f')]=_0x5a072f;if(_0x4d5a57[_0x9501('0x40')]['includeAll']){_0x1c5420['include']=[{'all':!![]}];}return db[_0x9501('0x3b')][_0x9501('0x50')](_0x1c5420);})[_0x9501('0x21')](function(_0x792c3c){_0x15631c['rows']=_0x792c3c;return _0x15631c;})[_0x9501('0x21')](respondWithFilteredResult(_0x95b1ea,_0x1c5420))[_0x9501('0x51')](handleError(_0x95b1ea,null));};exports[_0x9501('0x52')]=function(_0x753099,_0x52f83a){var _0x28441a={'raw':![],'where':{'id':_0x753099[_0x9501('0x53')]['id']}},_0x584af2={};_0x584af2[_0x9501('0x3f')]=_[_0x9501('0x41')](db[_0x9501('0x3b')][_0x9501('0x3c')]);_0x584af2[_0x9501('0x40')]=_[_0x9501('0x41')](_0x753099[_0x9501('0x40')]);_0x584af2['filters']=_['intersection'](_0x584af2[_0x9501('0x3f')],_0x584af2['query']);_0x28441a['attributes']=_[_0x9501('0x43')](_0x584af2[_0x9501('0x3f')],qs[_0x9501('0x44')](_0x753099['query'][_0x9501('0x44')]));_0x28441a['attributes']=_0x28441a[_0x9501('0x45')][_0x9501('0x46')]?_0x28441a[_0x9501('0x45')]:_0x584af2[_0x9501('0x3f')];if(_0x753099['query'][_0x9501('0x54')]){_0x28441a[_0x9501('0x55')]=[{'all':!![]}];}_0x28441a=_[_0x9501('0x56')]({},_0x28441a,_0x753099['options']);return db[_0x9501('0x3b')][_0x9501('0x57')](_0x28441a)[_0x9501('0x21')](handleEntityNotFound(_0x52f83a,null))[_0x9501('0x21')](respondWithResult(_0x52f83a,null))['catch'](handleError(_0x52f83a,null));};exports[_0x9501('0x58')]=function(_0xf8191,_0xe5bd03){return db[_0x9501('0x3b')][_0x9501('0x58')](_0xf8191[_0x9501('0x59')],{})[_0x9501('0x21')](respondWithResult(_0xe5bd03,0xc9))[_0x9501('0x51')](handleError(_0xe5bd03,null));};exports[_0x9501('0x36')]=function(_0x495cdf,_0x34298d){if(_0x495cdf['body']['id']){delete _0x495cdf[_0x9501('0x59')]['id'];}return db[_0x9501('0x3b')][_0x9501('0x57')]({'where':{'id':_0x495cdf['params']['id']}})['then'](handleEntityNotFound(_0x34298d,null))['then'](saveUpdates(_0x495cdf[_0x9501('0x59')],null))[_0x9501('0x21')](respondWithResult(_0x34298d,null))[_0x9501('0x51')](handleError(_0x34298d,null));};exports[_0x9501('0x37')]=function(_0x1d516e,_0x45015d){return db[_0x9501('0x3b')]['find']({'where':{'id':_0x1d516e['params']['id']}})[_0x9501('0x21')](handleEntityNotFound(_0x45015d,null))['then'](removeEntity(_0x45015d,null))[_0x9501('0x51')](handleError(_0x45015d,null));};exports[_0x9501('0x5a')]=function(_0x5ce43f,_0x15c2ab,_0x552ac5){var _0x2d4f98={};var _0x26e2b2={};var _0x5e45d7;var _0x844f5c;return db['ZohoConfiguration'][_0x9501('0x5b')]({'where':{'id':_0x5ce43f[_0x9501('0x53')]['id']}})['then'](handleEntityNotFound(_0x15c2ab,null))[_0x9501('0x21')](function(_0x405121){if(_0x405121){_0x5e45d7=_0x405121;_0x26e2b2['model']=_['keys'](db[_0x9501('0x5c')][_0x9501('0x3c')]);_0x26e2b2[_0x9501('0x40')]=_[_0x9501('0x41')](_0x5ce43f[_0x9501('0x40')]);_0x26e2b2['filters']=_['intersection'](_0x26e2b2[_0x9501('0x3f')],_0x26e2b2[_0x9501('0x40')]);_0x2d4f98['attributes']=_[_0x9501('0x43')](_0x26e2b2[_0x9501('0x3f')],qs[_0x9501('0x44')](_0x5ce43f[_0x9501('0x40')]['fields']));_0x2d4f98[_0x9501('0x45')]=_0x2d4f98[_0x9501('0x45')][_0x9501('0x46')]?_0x2d4f98['attributes']:_0x26e2b2[_0x9501('0x3f')];_0x2d4f98['order']=qs[_0x9501('0x49')](_0x5ce43f[_0x9501('0x40')]['sort']);_0x2d4f98[_0x9501('0x4a')]=qs['filters'](_[_0x9501('0x4b')](_0x5ce43f[_0x9501('0x40')],_0x26e2b2[_0x9501('0x42')]));if(_0x5ce43f[_0x9501('0x40')]['filter']){_0x2d4f98[_0x9501('0x4a')]=_[_0x9501('0x56')](_0x2d4f98['where'],{'$or':_[_0x9501('0x4c')](_0x2d4f98[_0x9501('0x45')],function(_0x4acc94){var _0x4e53ae={};_0x4e53ae[_0x4acc94]={'$like':'%'+_0x5ce43f[_0x9501('0x40')][_0x9501('0x4e')]+'%'};return _0x4e53ae;})});}_0x2d4f98=_['merge']({},_0x2d4f98,_0x5ce43f['options']);return _0x5e45d7[_0x9501('0x5a')](_0x2d4f98);}})[_0x9501('0x21')](function(_0x5bbf8d){if(_0x5bbf8d){_0x844f5c=_0x5bbf8d[_0x9501('0x46')];if(!_0x5ce43f[_0x9501('0x40')][_0x9501('0x47')]('nolimit')){_0x2d4f98[_0x9501('0x31')]=qs[_0x9501('0x31')](_0x5ce43f[_0x9501('0x40')][_0x9501('0x31')]);_0x2d4f98[_0x9501('0x30')]=qs['offset'](_0x5ce43f[_0x9501('0x40')][_0x9501('0x30')]);}return _0x5e45d7[_0x9501('0x5a')](_0x2d4f98);}})[_0x9501('0x21')](function(_0x508d40){if(_0x508d40){return _0x508d40?{'count':_0x844f5c,'rows':_0x508d40}:null;}})['then'](respondWithResult(_0x15c2ab,null))['catch'](handleError(_0x15c2ab,null));};exports[_0x9501('0x5d')]=function(_0xecb1d1,_0x58e78b,_0x284e6c){var _0x3436f7={};var _0x29f092={};var _0x5612ba;var _0x2d827c;return db['ZohoConfiguration'][_0x9501('0x5b')]({'where':{'id':_0xecb1d1[_0x9501('0x53')]['id']}})['then'](handleEntityNotFound(_0x58e78b,null))[_0x9501('0x21')](function(_0x25dbd1){if(_0x25dbd1){_0x5612ba=_0x25dbd1;_0x29f092[_0x9501('0x3f')]=_[_0x9501('0x41')](db[_0x9501('0x5c')][_0x9501('0x3c')]);_0x29f092[_0x9501('0x40')]=_[_0x9501('0x41')](_0xecb1d1[_0x9501('0x40')]);_0x29f092[_0x9501('0x42')]=_['intersection'](_0x29f092['model'],_0x29f092[_0x9501('0x40')]);_0x3436f7['attributes']=_[_0x9501('0x43')](_0x29f092['model'],qs['fields'](_0xecb1d1[_0x9501('0x40')][_0x9501('0x44')]));_0x3436f7[_0x9501('0x45')]=_0x3436f7[_0x9501('0x45')][_0x9501('0x46')]?_0x3436f7['attributes']:_0x29f092[_0x9501('0x3f')];_0x3436f7[_0x9501('0x48')]=qs['sort'](_0xecb1d1[_0x9501('0x40')][_0x9501('0x49')]);_0x3436f7['where']=qs[_0x9501('0x42')](_['pick'](_0xecb1d1[_0x9501('0x40')],_0x29f092[_0x9501('0x42')]));if(_0xecb1d1[_0x9501('0x40')][_0x9501('0x4e')]){_0x3436f7[_0x9501('0x4a')]=_[_0x9501('0x56')](_0x3436f7[_0x9501('0x4a')],{'$or':_[_0x9501('0x4c')](_0x3436f7[_0x9501('0x45')],function(_0x2f9807){var _0x153d7c={};_0x153d7c[_0x2f9807]={'$like':'%'+_0xecb1d1['query'][_0x9501('0x4e')]+'%'};return _0x153d7c;})});}_0x3436f7=_[_0x9501('0x56')]({},_0x3436f7,_0xecb1d1[_0x9501('0x4f')]);return _0x5612ba[_0x9501('0x5d')](_0x3436f7);}})[_0x9501('0x21')](function(_0x59ad19){if(_0x59ad19){_0x2d827c=_0x59ad19['length'];if(!_0xecb1d1['query']['hasOwnProperty'](_0x9501('0x5e'))){_0x3436f7[_0x9501('0x31')]=qs[_0x9501('0x31')](_0xecb1d1[_0x9501('0x40')][_0x9501('0x31')]);_0x3436f7[_0x9501('0x30')]=qs[_0x9501('0x30')](_0xecb1d1[_0x9501('0x40')][_0x9501('0x30')]);}return _0x5612ba[_0x9501('0x5d')](_0x3436f7);}})['then'](function(_0x24e9f8){if(_0x24e9f8){return _0x24e9f8?{'count':_0x2d827c,'rows':_0x24e9f8}:null;}})['then'](respondWithResult(_0x58e78b,null))['catch'](handleError(_0x58e78b,null));};exports[_0x9501('0x5f')]=function(_0x39a69b,_0x3af0ed,_0x4a3e04){var _0x7f4620={};var _0x10baaf={};var _0x4911d9;var _0x4d3a75;return db[_0x9501('0x3b')][_0x9501('0x5b')]({'where':{'id':_0x39a69b['params']['id']}})[_0x9501('0x21')](handleEntityNotFound(_0x3af0ed,null))[_0x9501('0x21')](function(_0x369dfa){if(_0x369dfa){_0x4911d9=_0x369dfa;_0x10baaf[_0x9501('0x3f')]=_[_0x9501('0x41')](db[_0x9501('0x5c')][_0x9501('0x3c')]);_0x10baaf[_0x9501('0x40')]=_[_0x9501('0x41')](_0x39a69b['query']);_0x10baaf[_0x9501('0x42')]=_['intersection'](_0x10baaf[_0x9501('0x3f')],_0x10baaf[_0x9501('0x40')]);_0x7f4620[_0x9501('0x45')]=_[_0x9501('0x43')](_0x10baaf[_0x9501('0x3f')],qs[_0x9501('0x44')](_0x39a69b[_0x9501('0x40')][_0x9501('0x44')]));_0x7f4620[_0x9501('0x45')]=_0x7f4620['attributes']['length']?_0x7f4620[_0x9501('0x45')]:_0x10baaf['model'];_0x7f4620[_0x9501('0x48')]=qs[_0x9501('0x49')](_0x39a69b[_0x9501('0x40')]['sort']);_0x7f4620[_0x9501('0x4a')]=qs[_0x9501('0x42')](_[_0x9501('0x4b')](_0x39a69b[_0x9501('0x40')],_0x10baaf['filters']));if(_0x39a69b[_0x9501('0x40')]['filter']){_0x7f4620[_0x9501('0x4a')]=_[_0x9501('0x56')](_0x7f4620[_0x9501('0x4a')],{'$or':_['map'](_0x7f4620[_0x9501('0x45')],function(_0x433eaf){var _0x371944={};_0x371944[_0x433eaf]={'$like':'%'+_0x39a69b['query'][_0x9501('0x4e')]+'%'};return _0x371944;})});}_0x7f4620=_[_0x9501('0x56')]({},_0x7f4620,_0x39a69b[_0x9501('0x4f')]);return _0x4911d9['getDescriptions'](_0x7f4620);}})[_0x9501('0x21')](function(_0x45d0f7){if(_0x45d0f7){_0x4d3a75=_0x45d0f7[_0x9501('0x46')];if(!_0x39a69b['query'][_0x9501('0x47')](_0x9501('0x5e'))){_0x7f4620[_0x9501('0x31')]=qs[_0x9501('0x31')](_0x39a69b['query'][_0x9501('0x31')]);_0x7f4620[_0x9501('0x30')]=qs[_0x9501('0x30')](_0x39a69b['query'][_0x9501('0x30')]);}return _0x4911d9[_0x9501('0x5f')](_0x7f4620);}})[_0x9501('0x21')](function(_0x31e7a6){if(_0x31e7a6){return _0x31e7a6?{'count':_0x4d3a75,'rows':_0x31e7a6}:null;}})['then'](respondWithResult(_0x3af0ed,null))[_0x9501('0x51')](handleError(_0x3af0ed,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 70a166c..48e3c92 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 _0x2503=['./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xc4c5c1,_0x1a3304){var _0x4abc73=function(_0x1cab89){while(--_0x1cab89){_0xc4c5c1['push'](_0xc4c5c1['shift']());}};_0x4abc73(++_0x1a3304);}(_0x2503,0x197));var _0x3250=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2503[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3250('0x0'));var util=require(_0x3250('0x1'));var logger=require(_0x3250('0x2'))(_0x3250('0x3'));var moment=require(_0x3250('0x4'));var BPromise=require('bluebird');var rp=require(_0x3250('0x5'));var fs=require('fs');var path=require(_0x3250('0x6'));var rimraf=require(_0x3250('0x7'));var config=require(_0x3250('0x8'));var attributes=require(_0x3250('0x9'));module[_0x3250('0xa')]=function(_0x56421b,_0x2710f9){return _0x56421b['define'](_0x3250('0xb'),attributes,{'tableName':_0x3250('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9ea=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','api','moment','bluebird','request-promise'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe9ea,0xb0));var _0xae9e=function(_0x4c5543,_0x586124){_0x4c5543=_0x4c5543-0x0;var _0x10aed2=_0xe9ea[_0x4c5543];return _0x10aed2;};'use strict';var _=require(_0xae9e('0x0'));var util=require(_0xae9e('0x1'));var logger=require('../../config/logger')(_0xae9e('0x2'));var moment=require(_0xae9e('0x3'));var BPromise=require(_0xae9e('0x4'));var rp=require(_0xae9e('0x5'));var fs=require('fs');var path=require(_0xae9e('0x6'));var rimraf=require(_0xae9e('0x7'));var config=require(_0xae9e('0x8'));var attributes=require(_0xae9e('0x9'));module[_0xae9e('0xa')]=function(_0x13391f,_0x29e3be){return _0x13391f[_0xae9e('0xb')](_0xae9e('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 2f44db0..41b2cc4 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 _0x2167=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x29228b,_0x4801be){var _0x2acdce=function(_0x5356a2){while(--_0x5356a2){_0x29228b['push'](_0x29228b['shift']());}};_0x2acdce(++_0x4801be);}(_0x2167,0xe3));var _0x7216=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x2167[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require(_0x7216('0x0'));var moment=require(_0x7216('0x1'));var BPromise=require(_0x7216('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7216('0x3'));var db=require(_0x7216('0x4'))['db'];var utils=require(_0x7216('0x5'));var logger=require('../../config/logger')(_0x7216('0x6'));var config=require(_0x7216('0x7'));var jayson=require(_0x7216('0x8'));var client=jayson['client'][_0x7216('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1948d8,_0xe049a7,_0x55fdec){return new BPromise(function(_0x3e4b42,_0x30006d){return client[_0x7216('0xa')](_0x1948d8,_0x55fdec)[_0x7216('0xb')](function(_0x3e221d){logger[_0x7216('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0xe049a7,_0x7216('0xd'));logger[_0x7216('0xe')](_0x7216('0xf'),_0xe049a7,'request\x20sent',JSON[_0x7216('0x10')](_0x3e221d));if(_0x3e221d[_0x7216('0x11')]){if(_0x3e221d['error']['code']===0x1f4){logger[_0x7216('0x11')](_0x7216('0x12'),_0xe049a7,_0x3e221d[_0x7216('0x11')][_0x7216('0x13')]);return _0x30006d(_0x3e221d[_0x7216('0x11')]['message']);}logger[_0x7216('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0xe049a7,_0x3e221d[_0x7216('0x11')][_0x7216('0x13')]);return _0x3e4b42(_0x3e221d[_0x7216('0x11')][_0x7216('0x13')]);}else{logger[_0x7216('0xc')](_0x7216('0x12'),_0xe049a7,_0x7216('0xd'));_0x3e4b42(_0x3e221d[_0x7216('0x14')][_0x7216('0x13')]);}})[_0x7216('0x15')](function(_0x1cbbc3){logger[_0x7216('0x11')](_0x7216('0x12'),_0xe049a7,_0x1cbbc3);_0x30006d(_0x1cbbc3);});});} \ No newline at end of file +var _0xa198=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x25a9f9,_0x1c6c37){var _0x3d0d38=function(_0x2a64fc){while(--_0x2a64fc){_0x25a9f9['push'](_0x25a9f9['shift']());}};_0x3d0d38(++_0x1c6c37);}(_0xa198,0x108));var _0x8a19=function(_0x5f025e,_0x4553ef){_0x5f025e=_0x5f025e-0x0;var _0x3745ab=_0xa198[_0x5f025e];return _0x3745ab;};'use strict';var _=require(_0x8a19('0x0'));var util=require(_0x8a19('0x1'));var moment=require(_0x8a19('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a19('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a19('0x4'))['db'];var utils=require(_0x8a19('0x5'));var logger=require(_0x8a19('0x6'))(_0x8a19('0x7'));var config=require(_0x8a19('0x8'));var jayson=require(_0x8a19('0x9'));var client=jayson[_0x8a19('0xa')][_0x8a19('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d724d,_0x4bbae4,_0x37b73e){return new BPromise(function(_0x29432e,_0x19e8a5){return client[_0x8a19('0xc')](_0x1d724d,_0x37b73e)[_0x8a19('0xd')](function(_0x3737f1){logger[_0x8a19('0xe')](_0x8a19('0xf'),_0x4bbae4,'request\x20sent');logger[_0x8a19('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4bbae4,_0x8a19('0x11'),JSON[_0x8a19('0x12')](_0x3737f1));if(_0x3737f1['error']){if(_0x3737f1[_0x8a19('0x13')][_0x8a19('0x14')]===0x1f4){logger[_0x8a19('0x13')](_0x8a19('0xf'),_0x4bbae4,_0x3737f1[_0x8a19('0x13')][_0x8a19('0x15')]);return _0x19e8a5(_0x3737f1[_0x8a19('0x13')][_0x8a19('0x15')]);}logger[_0x8a19('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x4bbae4,_0x3737f1['error'][_0x8a19('0x15')]);return _0x29432e(_0x3737f1[_0x8a19('0x13')][_0x8a19('0x15')]);}else{logger[_0x8a19('0xe')](_0x8a19('0xf'),_0x4bbae4,'request\x20sent');_0x29432e(_0x3737f1['result'][_0x8a19('0x15')]);}})[_0x8a19('0x16')](function(_0x14db91){logger[_0x8a19('0x13')](_0x8a19('0xf'),_0x4bbae4,_0x14db91);_0x19e8a5(_0x14db91);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 303bb61..d18acde 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 _0x5b12=['index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intZohoField.controller'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0x5b12,0xa3));var _0x25b1=function(_0x424641,_0x4988dc){_0x424641=_0x424641-0x0;var _0x32396e=_0x5b12[_0x424641];return _0x32396e;};'use strict';var multer=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var path=require(_0x25b1('0x2'));var timeout=require('connect-timeout');var express=require(_0x25b1('0x3'));var router=express['Router']();var auth=require(_0x25b1('0x4'));var interaction=require(_0x25b1('0x5'));var config=require('../../config/environment');var controller=require(_0x25b1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x25b1('0x7')]);router['get']('/:id',auth[_0x25b1('0x8')](),controller[_0x25b1('0x9')]);router[_0x25b1('0xa')]('/',auth[_0x25b1('0x8')](),controller[_0x25b1('0xb')]);router[_0x25b1('0xc')](_0x25b1('0xd'),auth[_0x25b1('0x8')](),controller['update']);router[_0x25b1('0xe')](_0x25b1('0xd'),auth[_0x25b1('0x8')](),controller[_0x25b1('0xf')]);module[_0x25b1('0x10')]=router; \ No newline at end of file +var _0xa456=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','multer'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa456,0x142));var _0x6a45=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xa456[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var auth=require(_0x6a45('0x5'));var interaction=require(_0x6a45('0x6'));var config=require('../../config/environment');var controller=require(_0x6a45('0x7'));router[_0x6a45('0x8')]('/',auth[_0x6a45('0x9')](),controller[_0x6a45('0xa')]);router['get'](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller[_0x6a45('0xc')]);router[_0x6a45('0xd')]('/',auth[_0x6a45('0x9')](),controller['create']);router[_0x6a45('0xe')]('/:id',auth[_0x6a45('0x9')](),controller[_0x6a45('0xf')]);router[_0x6a45('0x10')](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ba5d282..cf89cb9 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 _0xbf07=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x2a275d,_0x4641a9){var _0x1d00ab=function(_0xd36c0){while(--_0xd36c0){_0x2a275d['push'](_0x2a275d['shift']());}};_0x1d00ab(++_0x4641a9);}(_0xbf07,0x77));var _0x7bf0=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xbf07[_0x26b5ff];return _0x58603e;};'use strict';var Sequelize=require(_0x7bf0('0x0'));module[_0x7bf0('0x1')]={'type':{'type':Sequelize[_0x7bf0('0x2')](_0x7bf0('0x3'),'variable',_0x7bf0('0x4'),_0x7bf0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7bf0('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x7bf0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7bf0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7bf0('0x6')]}}; \ No newline at end of file +var _0x2367=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2367,0x7f));var _0x7236=function(_0x4b36f2,_0x47e2e0){_0x4b36f2=_0x4b36f2-0x0;var _0x1a2599=_0x2367[_0x4b36f2];return _0x1a2599;};'use strict';var Sequelize=require(_0x7236('0x0'));module[_0x7236('0x1')]={'type':{'type':Sequelize[_0x7236('0x2')]('string',_0x7236('0x3'),_0x7236('0x4'),_0x7236('0x5')),'defaultValue':_0x7236('0x6')},'content':{'type':Sequelize[_0x7236('0x7')]},'key':{'type':Sequelize[_0x7236('0x7')]},'keyType':{'type':Sequelize[_0x7236('0x2')](_0x7236('0x6'),_0x7236('0x3'),_0x7236('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7236('0x7')]},'nameField':{'type':Sequelize[_0x7236('0x7')]},'customField':{'type':Sequelize[_0x7236('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7236('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0275986..36f3aa7 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x22cf86,_0x9ecba2){var _0x2d1ea9=function(_0x44b259){while(--_0x44b259){_0x22cf86['push'](_0x22cf86['shift']());}};_0x2d1ea9(++_0x9ecba2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x348b08,_0x5d7a46){var _0x484999=function(_0x5ddbac){while(--_0x5ddbac){_0x348b08['push'](_0x348b08['shift']());}};_0x484999(++_0x5d7a46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8255dd6..a939258 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 _0x7335=['zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','int_zoho_fields'];(function(_0x26bf6a,_0x12478f){var _0x3522c7=function(_0xe1fb6f){while(--_0xe1fb6f){_0x26bf6a['push'](_0x26bf6a['shift']());}};_0x3522c7(++_0x12478f);}(_0x7335,0x14d));var _0x5733=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7335[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x5733('0x0'));var util=require(_0x5733('0x1'));var logger=require(_0x5733('0x2'))(_0x5733('0x3'));var moment=require(_0x5733('0x4'));var BPromise=require(_0x5733('0x5'));var rp=require(_0x5733('0x6'));var fs=require('fs');var path=require(_0x5733('0x7'));var rimraf=require('rimraf');var config=require(_0x5733('0x8'));var attributes=require(_0x5733('0x9'));module[_0x5733('0xa')]=function(_0x3d436c,_0xdb16cd){return _0x3d436c['define']('ZohoField',attributes,{'tableName':_0x5733('0xb'),'paranoid':![],'indexes':[{'name':_0x5733('0xc'),'fields':[_0x5733('0xd'),_0x5733('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaaee=['zoho_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0xaaee,0x132));var _0xeaae=function(_0x15ea25,_0x432486){_0x15ea25=_0x15ea25-0x0;var _0x546969=_0xaaee[_0x15ea25];return _0x546969;};'use strict';var _=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var logger=require(_0xeaae('0x2'))(_0xeaae('0x3'));var moment=require(_0xeaae('0x4'));var BPromise=require('bluebird');var rp=require(_0xeaae('0x5'));var fs=require('fs');var path=require(_0xeaae('0x6'));var rimraf=require(_0xeaae('0x7'));var config=require(_0xeaae('0x8'));var attributes=require(_0xeaae('0x9'));module[_0xeaae('0xa')]=function(_0xb5ad89,_0x491e4){return _0xb5ad89[_0xeaae('0xb')](_0xeaae('0xc'),attributes,{'tableName':_0xeaae('0xd'),'paranoid':![],'indexes':[{'name':_0xeaae('0xe'),'fields':['idField',_0xeaae('0xf')],'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 b68ead6..7a66295 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','ZohoField,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x119457,_0x1d6c85){var _0x51dd16=function(_0x500ced){while(--_0x500ced){_0x119457['push'](_0x119457['shift']());}};_0x51dd16(++_0x1d6c85);}(_0x3e74,0x175));var _0x43e7=function(_0x81ad27,_0x149192){_0x81ad27=_0x81ad27-0x0;var _0x26bb24=_0x3e74[_0x81ad27];return _0x26bb24;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('ZohoField,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('ZohoField,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x9c5a=['http','then','ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x404a5c,_0x5799d6){var _0x15d846=function(_0x14cfa6){while(--_0x14cfa6){_0x404a5c['push'](_0x404a5c['shift']());}};_0x15d846(++_0x5799d6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3c9d21,_0x541d98){_0x3c9d21=_0x3c9d21-0x0;var _0xa27de8=_0x9c5a[_0x3c9d21];return _0xa27de8;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var moment=require('moment');var BPromise=require(_0xa9c5('0x2'));var rs=require(_0xa9c5('0x3'));var fs=require('fs');var Redis=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9c5('0x6'))(_0xa9c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9c5('0x8'));var client=jayson['client'][_0xa9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3df556,_0x4cb597,_0x4b6db6){return new BPromise(function(_0x3d6b50,_0x16f331){return client['request'](_0x3df556,_0x4b6db6)[_0xa9c5('0xa')](function(_0x97f9e2){logger['info'](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x4cb597,_0xa9c5('0xc'),JSON[_0xa9c5('0xd')](_0x97f9e2));if(_0x97f9e2[_0xa9c5('0xe')]){if(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0xf')]===0x1f4){logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x16f331(_0x97f9e2[_0xa9c5('0xe')]['message']);}logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x3d6b50(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);}else{logger[_0xa9c5('0x11')](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));_0x3d6b50(_0x97f9e2[_0xa9c5('0x12')]['message']);}})[_0xa9c5('0x13')](function(_0xd85c32){logger[_0xa9c5('0xe')]('ZohoField,\x20%s,\x20%s',_0x4cb597,_0xd85c32);_0x16f331(_0xd85c32);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index d34f5c9..7993640 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 _0xcb08=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x572598,_0x49d08d){var _0x430373=function(_0x329eb9){while(--_0x329eb9){_0x572598['push'](_0x572598['shift']());}};_0x430373(++_0x49d08d);}(_0xcb08,0x1be));var _0x8cb0=function(_0x192430,_0x569442){_0x192430=_0x192430-0x0;var _0x5166e3=_0xcb08[_0x192430];return _0x5166e3;};'use strict';var multer=require(_0x8cb0('0x0'));var util=require(_0x8cb0('0x1'));var path=require(_0x8cb0('0x2'));var timeout=require(_0x8cb0('0x3'));var express=require(_0x8cb0('0x4'));var router=express[_0x8cb0('0x5')]();var auth=require(_0x8cb0('0x6'));var interaction=require(_0x8cb0('0x7'));var config=require(_0x8cb0('0x8'));module[_0x8cb0('0x9')]=router; \ No newline at end of file +var _0x3a00=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x4846f3,_0x5ed340){var _0x4586aa=function(_0x1f2839){while(--_0x1f2839){_0x4846f3['push'](_0x4846f3['shift']());}};_0x4586aa(++_0x5ed340);}(_0x3a00,0xfc));var _0x03a0=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x3a00[_0x20fb02];return _0x24a33e;};'use strict';var multer=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var path=require(_0x03a0('0x2'));var timeout=require(_0x03a0('0x3'));var express=require(_0x03a0('0x4'));var router=express[_0x03a0('0x5')]();var auth=require(_0x03a0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x03a0('0x7'));module[_0x03a0('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7ed1cc6..7a995e6 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 _0x5a66=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x15ad95,_0x566009){var _0x439717=function(_0x5b73a1){while(--_0x5b73a1){_0x15ad95['push'](_0x15ad95['shift']());}};_0x439717(++_0x566009);}(_0x5a66,0x1f4));var _0x65a6=function(_0x3b4922,_0x2fa365){_0x3b4922=_0x3b4922-0x0;var _0x239729=_0x5a66[_0x3b4922];return _0x239729;};'use strict';var Sequelize=require(_0x65a6('0x0'));module[_0x65a6('0x1')]={'name':{'type':Sequelize[_0x65a6('0x2')],'allowNull':![],'unique':_0x65a6('0x3')},'version':{'type':Sequelize[_0x65a6('0x2')],'allowNull':![],'unique':_0x65a6('0x3')},'main':{'type':Sequelize[_0x65a6('0x2')],'defaultValue':_0x65a6('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x65a6('0x2')]},'type':{'type':Sequelize[_0x65a6('0x2')]},'size':{'type':Sequelize[_0x65a6('0x5')]},'active':{'type':Sequelize[_0x65a6('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x65a6('0x2')]},'logo':{'type':Sequelize[_0x65a6('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x65a6('0x7')},'description':{'type':Sequelize[_0x65a6('0x2')]},'title':{'type':Sequelize[_0x65a6('0x2')]},'remoteUri':{'type':Sequelize[_0x65a6('0x2')]},'link':{'type':Sequelize[_0x65a6('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa5c7=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x3035df,_0x13d656){var _0x3c2852=function(_0x249371){while(--_0x249371){_0x3035df['push'](_0x3035df['shift']());}};_0x3c2852(++_0x13d656);}(_0xa5c7,0xfb));var _0x7a5c=function(_0x4df5a5,_0x5adcca){_0x4df5a5=_0x4df5a5-0x0;var _0x3e1167=_0xa5c7[_0x4df5a5];return _0x3e1167;};'use strict';var Sequelize=require(_0x7a5c('0x0'));module[_0x7a5c('0x1')]={'name':{'type':Sequelize[_0x7a5c('0x2')],'allowNull':![],'unique':_0x7a5c('0x3')},'version':{'type':Sequelize[_0x7a5c('0x2')],'allowNull':![],'unique':_0x7a5c('0x3')},'main':{'type':Sequelize[_0x7a5c('0x2')],'defaultValue':_0x7a5c('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x7a5c('0x2')]},'type':{'type':Sequelize[_0x7a5c('0x2')]},'size':{'type':Sequelize[_0x7a5c('0x5')]},'active':{'type':Sequelize[_0x7a5c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x7a5c('0x2')]},'logo':{'type':Sequelize[_0x7a5c('0x2')]},'state':{'type':Sequelize[_0x7a5c('0x2')],'unique':_0x7a5c('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7a5c('0x2')]},'link':{'type':Sequelize[_0x7a5c('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d15d1ce..bc58ff7 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 _0xc78b=['key','query','filters','intersection','model','attributes','length','nolimit','limit','sort','where','pick','filter','includeAll','include','findAll','params','keys','fields','merge','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type'];(function(_0x5dd1cb,_0x5b15b4){var _0x170f6f=function(_0x121ae9){while(--_0x121ae9){_0x5dd1cb['push'](_0x5dd1cb['shift']());}};_0x170f6f(++_0x5b15b4);}(_0xc78b,0xed));var _0xbc78=function(_0x3d7a58,_0x409a0d){_0x3d7a58=_0x3d7a58-0x0;var _0x2a5fa7=_0xc78b[_0x3d7a58];return _0x2a5fa7;};'use strict';var pdf=require(_0xbc78('0x0'));var emlformat=require(_0xbc78('0x1'));var rimraf=require(_0xbc78('0x2'));var zipdir=require(_0xbc78('0x3'));var jsonpatch=require(_0xbc78('0x4'));var rp=require(_0xbc78('0x5'));var moment=require(_0xbc78('0x6'));var BPromise=require(_0xbc78('0x7'));var Mustache=require(_0xbc78('0x8'));var util=require('util');var path=require(_0xbc78('0x9'));var sox=require(_0xbc78('0xa'));var csv=require('to-csv');var ejs=require(_0xbc78('0xb'));var fs=require('fs');var _=require(_0xbc78('0xc'));var squel=require(_0xbc78('0xd'));var crypto=require(_0xbc78('0xe'));var jsforce=require(_0xbc78('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbc78('0x10'));var querystring=require(_0xbc78('0x11'));var Papa=require(_0xbc78('0x12'));var Redis=require('ioredis');var authService=require(_0xbc78('0x13'));var qs=require(_0xbc78('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc78('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbc78('0x16'));var config=require(_0xbc78('0x17'));var db=require(_0xbc78('0x18'))['db'];function respondWithStatusCode(_0x443e0c,_0x2d5eb4){_0x2d5eb4=_0x2d5eb4||0xcc;return function(_0x405540){if(_0x405540){return _0x443e0c[_0xbc78('0x19')](_0x2d5eb4);}return _0x443e0c[_0xbc78('0x1a')](_0x2d5eb4)['end']();};}function respondWithResult(_0x5e7b26,_0x103830){_0x103830=_0x103830||0xc8;return function(_0x5b7784){if(_0x5b7784){return _0x5e7b26['status'](_0x103830)[_0xbc78('0x1b')](_0x5b7784);}};}function respondWithFilteredResult(_0x593abb,_0x1cb230){return function(_0x5511c7){if(_0x5511c7){var _0x533c9b=_0x5511c7[_0xbc78('0x1c')],_0x292eb0=_0x1cb230[_0xbc78('0x1d')],_0x484673=_0x1cb230['offset']+_0x1cb230['limit'],_0x597c4f;if(_0x484673>=_0x533c9b){_0x484673=_0x533c9b;_0x597c4f=0xc8;}else{_0x597c4f=0xce;}_0x593abb['status'](_0x597c4f);return _0x593abb[_0xbc78('0x1e')](_0xbc78('0x1f'),_0x292eb0+'-'+_0x484673+'/'+_0x533c9b)[_0xbc78('0x1b')](_0x5511c7);}return null;};}function patchUpdates(_0x2897f3){return function(_0x35acec){try{jsonpatch[_0xbc78('0x20')](_0x35acec,_0x2897f3,!![]);}catch(_0x289a66){return BPromise['reject'](_0x289a66);}return _0x35acec['save']();};}function saveUpdates(_0x1bbc65,_0x3b65a5){return function(_0x13da65){if(_0x13da65){return _0x13da65[_0xbc78('0x21')](_0x1bbc65)[_0xbc78('0x22')](function(_0x44a826){return _0x44a826;});}return null;};}function removeEntity(_0x4a6b5a,_0x46fb4d){return function(_0x33f4c5){if(_0x33f4c5){return _0x33f4c5[_0xbc78('0x23')]()[_0xbc78('0x22')](function(){_0x4a6b5a[_0xbc78('0x1a')](0xcc)[_0xbc78('0x24')]();});}};}function handleEntityNotFound(_0x4ddcd0,_0x5b64f3){return function(_0x4bbe81){if(!_0x4bbe81){_0x4ddcd0[_0xbc78('0x19')](0x194);}return _0x4bbe81;};}function handleError(_0x2870eb,_0x569830){_0x569830=_0x569830||0x1f4;return function(_0x1506b9){logger[_0xbc78('0x25')](_0x1506b9[_0xbc78('0x26')]);if(_0x1506b9['name']){delete _0x1506b9[_0xbc78('0x27')];}_0x2870eb[_0xbc78('0x1a')](_0x569830)[_0xbc78('0x28')](_0x1506b9);};}exports[_0xbc78('0x29')]=function(_0x1d4f85,_0x12c904){var _0x350c77={},_0x531168={},_0x15fdbe={'count':0x0,'rows':[]};var _0x556fd8=_[_0xbc78('0x2a')](db[_0xbc78('0x2b')][_0xbc78('0x2c')],function(_0x1b8691){return{'name':_0x1b8691[_0xbc78('0x2d')],'type':_0x1b8691[_0xbc78('0x2e')][_0xbc78('0x2f')]};});_0x531168['model']=_[_0xbc78('0x2a')](_0x556fd8,_0xbc78('0x27'));_0x531168['query']=_['keys'](_0x1d4f85[_0xbc78('0x30')]);_0x531168[_0xbc78('0x31')]=_[_0xbc78('0x32')](_0x531168[_0xbc78('0x33')],_0x531168[_0xbc78('0x30')]);_0x350c77[_0xbc78('0x34')]=_[_0xbc78('0x32')](_0x531168[_0xbc78('0x33')],qs['fields'](_0x1d4f85['query']['fields']));_0x350c77[_0xbc78('0x34')]=_0x350c77['attributes'][_0xbc78('0x35')]?_0x350c77[_0xbc78('0x34')]:_0x531168['model'];if(!_0x1d4f85['query']['hasOwnProperty'](_0xbc78('0x36'))){_0x350c77[_0xbc78('0x37')]=qs[_0xbc78('0x37')](_0x1d4f85['query'][_0xbc78('0x37')]);_0x350c77[_0xbc78('0x1d')]=qs[_0xbc78('0x1d')](_0x1d4f85[_0xbc78('0x30')][_0xbc78('0x1d')]);}_0x350c77['order']=qs[_0xbc78('0x38')](_0x1d4f85[_0xbc78('0x30')][_0xbc78('0x38')]);_0x350c77[_0xbc78('0x39')]=qs[_0xbc78('0x31')](_[_0xbc78('0x3a')](_0x1d4f85[_0xbc78('0x30')],_0x531168['filters']),_0x556fd8);if(_0x1d4f85[_0xbc78('0x30')][_0xbc78('0x3b')]){_0x350c77[_0xbc78('0x39')]=_['merge'](_0x350c77[_0xbc78('0x39')],{'$or':_[_0xbc78('0x2a')](_0x556fd8,function(_0x59c722){if(_0x59c722[_0xbc78('0x2e')]!=='VIRTUAL'){var _0x478ce6={};_0x478ce6[_0x59c722[_0xbc78('0x27')]]={'$like':'%'+_0x1d4f85[_0xbc78('0x30')][_0xbc78('0x3b')]+'%'};return _0x478ce6;}})});}_0x350c77=_['merge']({},_0x350c77,_0x1d4f85['options']);var _0x1b85e3={'where':_0x350c77[_0xbc78('0x39')]};return db['Integration'][_0xbc78('0x1c')](_0x1b85e3)['then'](function(_0x1061c7){_0x15fdbe['count']=_0x1061c7;if(_0x1d4f85['query'][_0xbc78('0x3c')]){_0x350c77[_0xbc78('0x3d')]=[{'all':!![]}];}return db[_0xbc78('0x2b')][_0xbc78('0x3e')](_0x350c77);})[_0xbc78('0x22')](function(_0x52a625){_0x15fdbe['rows']=_0x52a625;return _0x15fdbe;})[_0xbc78('0x22')](respondWithFilteredResult(_0x12c904,_0x350c77))['catch'](handleError(_0x12c904,null));};exports['show']=function(_0x2cc292,_0x7d6f37){var _0x59ed45={'raw':![],'where':{'id':_0x2cc292[_0xbc78('0x3f')]['id']}},_0x7fc525={};_0x7fc525[_0xbc78('0x33')]=_[_0xbc78('0x40')](db[_0xbc78('0x2b')][_0xbc78('0x2c')]);_0x7fc525[_0xbc78('0x30')]=_['keys'](_0x2cc292[_0xbc78('0x30')]);_0x7fc525[_0xbc78('0x31')]=_[_0xbc78('0x32')](_0x7fc525[_0xbc78('0x33')],_0x7fc525[_0xbc78('0x30')]);_0x59ed45[_0xbc78('0x34')]=_['intersection'](_0x7fc525['model'],qs[_0xbc78('0x41')](_0x2cc292[_0xbc78('0x30')]['fields']));_0x59ed45[_0xbc78('0x34')]=_0x59ed45['attributes']['length']?_0x59ed45[_0xbc78('0x34')]:_0x7fc525[_0xbc78('0x33')];if(_0x2cc292[_0xbc78('0x30')][_0xbc78('0x3c')]){_0x59ed45[_0xbc78('0x3d')]=[{'all':!![]}];}_0x59ed45=_[_0xbc78('0x42')]({},_0x59ed45,_0x2cc292['options']);return db[_0xbc78('0x2b')]['find'](_0x59ed45)['then'](handleEntityNotFound(_0x7d6f37,null))[_0xbc78('0x22')](respondWithResult(_0x7d6f37,null))[_0xbc78('0x43')](handleError(_0x7d6f37,null));};exports[_0xbc78('0x44')]=function(_0x5b02f7,_0x211a1e){return db[_0xbc78('0x2b')][_0xbc78('0x44')](_0x5b02f7[_0xbc78('0x45')],{})[_0xbc78('0x22')](respondWithResult(_0x211a1e,0xc9))[_0xbc78('0x43')](handleError(_0x211a1e,null));};exports['update']=function(_0x5761a1,_0x55f229){if(_0x5761a1[_0xbc78('0x45')]['id']){delete _0x5761a1[_0xbc78('0x45')]['id'];}return db['Integration'][_0xbc78('0x46')]({'where':{'id':_0x5761a1[_0xbc78('0x3f')]['id']}})['then'](handleEntityNotFound(_0x55f229,null))[_0xbc78('0x22')](saveUpdates(_0x5761a1['body'],null))['then'](respondWithResult(_0x55f229,null))[_0xbc78('0x43')](handleError(_0x55f229,null));};exports[_0xbc78('0x23')]=function(_0x76de1e,_0x5b7586){return db[_0xbc78('0x2b')][_0xbc78('0x46')]({'where':{'id':_0x76de1e[_0xbc78('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5b7586,null))[_0xbc78('0x22')](removeEntity(_0x5b7586,null))[_0xbc78('0x43')](handleError(_0x5b7586,null));}; \ No newline at end of file +var _0x91a2=['hasOwnProperty','nolimit','offset','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','update','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','json','apply','reject','then','error','stack','name','send','index','map','Integration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x56f0bb,_0x5dd638){var _0x2c10f9=function(_0x385b6e){while(--_0x385b6e){_0x56f0bb['push'](_0x56f0bb['shift']());}};_0x2c10f9(++_0x5dd638);}(_0x91a2,0x14b));var _0x291a=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x91a2[_0x4f431d];return _0x4f31e1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x291a('0x0'));var rimraf=require(_0x291a('0x1'));var zipdir=require(_0x291a('0x2'));var jsonpatch=require(_0x291a('0x3'));var rp=require(_0x291a('0x4'));var moment=require(_0x291a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x291a('0x6'));var util=require(_0x291a('0x7'));var path=require(_0x291a('0x8'));var sox=require(_0x291a('0x9'));var csv=require(_0x291a('0xa'));var ejs=require(_0x291a('0xb'));var fs=require('fs');var _=require(_0x291a('0xc'));var squel=require(_0x291a('0xd'));var crypto=require(_0x291a('0xe'));var jsforce=require(_0x291a('0xf'));var deskjs=require(_0x291a('0x10'));var toCsv=require(_0x291a('0xa'));var querystring=require(_0x291a('0x11'));var Papa=require(_0x291a('0x12'));var Redis=require(_0x291a('0x13'));var authService=require(_0x291a('0x14'));var qs=require(_0x291a('0x15'));var as=require(_0x291a('0x16'));var hardwareService=require(_0x291a('0x17'));var logger=require(_0x291a('0x18'))('api');var utils=require(_0x291a('0x19'));var config=require('../../config/environment');var db=require(_0x291a('0x1a'))['db'];function respondWithStatusCode(_0x1da9d3,_0x3ce102){_0x3ce102=_0x3ce102||0xcc;return function(_0x6a8ce){if(_0x6a8ce){return _0x1da9d3[_0x291a('0x1b')](_0x3ce102);}return _0x1da9d3[_0x291a('0x1c')](_0x3ce102)[_0x291a('0x1d')]();};}function respondWithResult(_0x57b186,_0x594f9c){_0x594f9c=_0x594f9c||0xc8;return function(_0x637d71){if(_0x637d71){return _0x57b186[_0x291a('0x1c')](_0x594f9c)['json'](_0x637d71);}};}function respondWithFilteredResult(_0x1c4b30,_0xa05171){return function(_0x3c0266){if(_0x3c0266){var _0x19d5bf=_0x3c0266[_0x291a('0x1e')],_0x10c4f8=_0xa05171['offset'],_0x5675b0=_0xa05171['offset']+_0xa05171[_0x291a('0x1f')],_0x5a603d;if(_0x5675b0>=_0x19d5bf){_0x5675b0=_0x19d5bf;_0x5a603d=0xc8;}else{_0x5a603d=0xce;}_0x1c4b30[_0x291a('0x1c')](_0x5a603d);return _0x1c4b30[_0x291a('0x20')]('Content-Range',_0x10c4f8+'-'+_0x5675b0+'/'+_0x19d5bf)[_0x291a('0x21')](_0x3c0266);}return null;};}function patchUpdates(_0x40d54b){return function(_0x3383c2){try{jsonpatch[_0x291a('0x22')](_0x3383c2,_0x40d54b,!![]);}catch(_0x45582b){return BPromise[_0x291a('0x23')](_0x45582b);}return _0x3383c2['save']();};}function saveUpdates(_0x975d62,_0x1ad9fd){return function(_0x3094ff){if(_0x3094ff){return _0x3094ff['update'](_0x975d62)[_0x291a('0x24')](function(_0x2bbe12){return _0x2bbe12;});}return null;};}function removeEntity(_0x2c960f,_0x57adc7){return function(_0x5475fb){if(_0x5475fb){return _0x5475fb['destroy']()[_0x291a('0x24')](function(){_0x2c960f[_0x291a('0x1c')](0xcc)[_0x291a('0x1d')]();});}};}function handleEntityNotFound(_0x344631,_0x52d626){return function(_0x2ce388){if(!_0x2ce388){_0x344631['sendStatus'](0x194);}return _0x2ce388;};}function handleError(_0x3dfe4a,_0x2d9bfd){_0x2d9bfd=_0x2d9bfd||0x1f4;return function(_0x57b180){logger[_0x291a('0x25')](_0x57b180[_0x291a('0x26')]);if(_0x57b180['name']){delete _0x57b180[_0x291a('0x27')];}_0x3dfe4a[_0x291a('0x1c')](_0x2d9bfd)[_0x291a('0x28')](_0x57b180);};}exports[_0x291a('0x29')]=function(_0x19ecd1,_0x2fadb4){var _0x3b7359={},_0x1aabd3={},_0x42951e={'count':0x0,'rows':[]};var _0x1f2f05=_[_0x291a('0x2a')](db[_0x291a('0x2b')]['rawAttributes'],function(_0x461f87){return{'name':_0x461f87[_0x291a('0x2c')],'type':_0x461f87[_0x291a('0x2d')][_0x291a('0x2e')]};});_0x1aabd3[_0x291a('0x2f')]=_[_0x291a('0x2a')](_0x1f2f05,'name');_0x1aabd3[_0x291a('0x30')]=_[_0x291a('0x31')](_0x19ecd1['query']);_0x1aabd3['filters']=_[_0x291a('0x32')](_0x1aabd3['model'],_0x1aabd3['query']);_0x3b7359[_0x291a('0x33')]=_[_0x291a('0x32')](_0x1aabd3[_0x291a('0x2f')],qs['fields'](_0x19ecd1[_0x291a('0x30')][_0x291a('0x34')]));_0x3b7359[_0x291a('0x33')]=_0x3b7359[_0x291a('0x33')][_0x291a('0x35')]?_0x3b7359[_0x291a('0x33')]:_0x1aabd3['model'];if(!_0x19ecd1[_0x291a('0x30')][_0x291a('0x36')](_0x291a('0x37'))){_0x3b7359['limit']=qs[_0x291a('0x1f')](_0x19ecd1[_0x291a('0x30')][_0x291a('0x1f')]);_0x3b7359['offset']=qs[_0x291a('0x38')](_0x19ecd1['query'][_0x291a('0x38')]);}_0x3b7359['order']=qs[_0x291a('0x39')](_0x19ecd1[_0x291a('0x30')][_0x291a('0x39')]);_0x3b7359[_0x291a('0x3a')]=qs['filters'](_[_0x291a('0x3b')](_0x19ecd1['query'],_0x1aabd3[_0x291a('0x3c')]),_0x1f2f05);if(_0x19ecd1[_0x291a('0x30')][_0x291a('0x3d')]){_0x3b7359[_0x291a('0x3a')]=_['merge'](_0x3b7359[_0x291a('0x3a')],{'$or':_[_0x291a('0x2a')](_0x1f2f05,function(_0x2aff7e){if(_0x2aff7e[_0x291a('0x2d')]!==_0x291a('0x3e')){var _0x554cb1={};_0x554cb1[_0x2aff7e['name']]={'$like':'%'+_0x19ecd1[_0x291a('0x30')]['filter']+'%'};return _0x554cb1;}})});}_0x3b7359=_[_0x291a('0x3f')]({},_0x3b7359,_0x19ecd1[_0x291a('0x40')]);var _0x53ca38={'where':_0x3b7359['where']};return db['Integration'][_0x291a('0x1e')](_0x53ca38)['then'](function(_0x3b73ee){_0x42951e[_0x291a('0x1e')]=_0x3b73ee;if(_0x19ecd1[_0x291a('0x30')][_0x291a('0x41')]){_0x3b7359[_0x291a('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x3b7359);})[_0x291a('0x24')](function(_0x4dd0b0){_0x42951e[_0x291a('0x43')]=_0x4dd0b0;return _0x42951e;})[_0x291a('0x24')](respondWithFilteredResult(_0x2fadb4,_0x3b7359))[_0x291a('0x44')](handleError(_0x2fadb4,null));};exports[_0x291a('0x45')]=function(_0x25e9f1,_0x241d05){var _0x20be4a={'raw':![],'where':{'id':_0x25e9f1['params']['id']}},_0x4f57fc={};_0x4f57fc['model']=_[_0x291a('0x31')](db[_0x291a('0x2b')][_0x291a('0x46')]);_0x4f57fc[_0x291a('0x30')]=_[_0x291a('0x31')](_0x25e9f1[_0x291a('0x30')]);_0x4f57fc[_0x291a('0x3c')]=_['intersection'](_0x4f57fc[_0x291a('0x2f')],_0x4f57fc['query']);_0x20be4a[_0x291a('0x33')]=_[_0x291a('0x32')](_0x4f57fc[_0x291a('0x2f')],qs[_0x291a('0x34')](_0x25e9f1['query'][_0x291a('0x34')]));_0x20be4a[_0x291a('0x33')]=_0x20be4a[_0x291a('0x33')][_0x291a('0x35')]?_0x20be4a[_0x291a('0x33')]:_0x4f57fc[_0x291a('0x2f')];if(_0x25e9f1[_0x291a('0x30')]['includeAll']){_0x20be4a[_0x291a('0x42')]=[{'all':!![]}];}_0x20be4a=_[_0x291a('0x3f')]({},_0x20be4a,_0x25e9f1['options']);return db[_0x291a('0x2b')][_0x291a('0x47')](_0x20be4a)[_0x291a('0x24')](handleEntityNotFound(_0x241d05,null))[_0x291a('0x24')](respondWithResult(_0x241d05,null))[_0x291a('0x44')](handleError(_0x241d05,null));};exports[_0x291a('0x48')]=function(_0x13910c,_0x4ae175){return db[_0x291a('0x2b')]['create'](_0x13910c[_0x291a('0x49')],{})['then'](respondWithResult(_0x4ae175,0xc9))[_0x291a('0x44')](handleError(_0x4ae175,null));};exports[_0x291a('0x4a')]=function(_0x3bde8c,_0x164684){if(_0x3bde8c[_0x291a('0x49')]['id']){delete _0x3bde8c[_0x291a('0x49')]['id'];}return db['Integration']['find']({'where':{'id':_0x3bde8c['params']['id']}})[_0x291a('0x24')](handleEntityNotFound(_0x164684,null))[_0x291a('0x24')](saveUpdates(_0x3bde8c[_0x291a('0x49')],null))[_0x291a('0x24')](respondWithResult(_0x164684,null))[_0x291a('0x44')](handleError(_0x164684,null));};exports[_0x291a('0x4b')]=function(_0x43f5fb,_0x6aaf69){return db[_0x291a('0x2b')][_0x291a('0x47')]({'where':{'id':_0x43f5fb[_0x291a('0x4c')]['id']}})[_0x291a('0x24')](handleEntityNotFound(_0x6aaf69,null))[_0x291a('0x24')](removeEntity(_0x6aaf69,null))[_0x291a('0x44')](handleError(_0x6aaf69,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 954c2f2..0ac1415 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 _0xfdcc=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','util','../../config/logger'];(function(_0x39971e,_0x4b7c5b){var _0x208ce0=function(_0x16e7ae){while(--_0x16e7ae){_0x39971e['push'](_0x39971e['shift']());}};_0x208ce0(++_0x4b7c5b);}(_0xfdcc,0x1b6));var _0xcfdc=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0xfdcc[_0x2aee2f];return _0x19337f;};'use strict';var _=require('lodash');var util=require(_0xcfdc('0x0'));var logger=require(_0xcfdc('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcfdc('0x2'));var rp=require(_0xcfdc('0x3'));var fs=require('fs');var path=require(_0xcfdc('0x4'));var rimraf=require(_0xcfdc('0x5'));var config=require(_0xcfdc('0x6'));var attributes=require(_0xcfdc('0x7'));module[_0xcfdc('0x8')]=function(_0x40b92c,_0x174a8a){return _0x40b92c['define'](_0xcfdc('0x9'),attributes,{'tableName':_0xcfdc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6af=['integrations','lodash','../../config/logger','api','moment','path','../../config/environment','./integration.attributes','Integration'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0xa6af,0x121));var _0xfa6a=function(_0x5acff5,_0x452767){_0x5acff5=_0x5acff5-0x0;var _0x6952a4=_0xa6af[_0x5acff5];return _0x6952a4;};'use strict';var _=require(_0xfa6a('0x0'));var util=require('util');var logger=require(_0xfa6a('0x1'))(_0xfa6a('0x2'));var moment=require(_0xfa6a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa6a('0x4'));var rimraf=require('rimraf');var config=require(_0xfa6a('0x5'));var attributes=require(_0xfa6a('0x6'));module['exports']=function(_0x1b0288,_0x3a363e){return _0x1b0288['define'](_0xfa6a('0x7'),attributes,{'tableName':_0xfa6a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 3635a52..67d83f0 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 _0x653d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x653d,0x133));var _0xd653=function(_0x5148b1,_0xf065ee){_0x5148b1=_0x5148b1-0x0;var _0x5a82a8=_0x653d[_0x5148b1];return _0x5a82a8;};'use strict';var _=require('lodash');var util=require(_0xd653('0x0'));var moment=require(_0xd653('0x1'));var BPromise=require(_0xd653('0x2'));var rs=require(_0xd653('0x3'));var fs=require('fs');var Redis=require(_0xd653('0x4'));var db=require(_0xd653('0x5'))['db'];var utils=require(_0xd653('0x6'));var logger=require(_0xd653('0x7'))(_0xd653('0x8'));var config=require(_0xd653('0x9'));var jayson=require(_0xd653('0xa'));var client=jayson[_0xd653('0xb')][_0xd653('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bf7a1,_0x490041,_0x5cbb43){return new BPromise(function(_0x378ba9,_0x5b46f9){return client[_0xd653('0xd')](_0x2bf7a1,_0x5cbb43)[_0xd653('0xe')](function(_0x5234e0){logger[_0xd653('0xf')](_0xd653('0x10'),_0x490041,_0xd653('0x11'));logger['debug'](_0xd653('0x12'),_0x490041,'request\x20sent',JSON[_0xd653('0x13')](_0x5234e0));if(_0x5234e0[_0xd653('0x14')]){if(_0x5234e0[_0xd653('0x14')][_0xd653('0x15')]===0x1f4){logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x5234e0[_0xd653('0x14')]['message']);return _0x5b46f9(_0x5234e0['error'][_0xd653('0x16')]);}logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x5234e0[_0xd653('0x14')][_0xd653('0x16')]);return _0x378ba9(_0x5234e0[_0xd653('0x14')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x490041,_0xd653('0x11'));_0x378ba9(_0x5234e0[_0xd653('0x17')][_0xd653('0x16')]);}})['catch'](function(_0x2a4d7f){logger[_0xd653('0x14')](_0xd653('0x10'),_0x490041,_0x2a4d7f);_0x5b46f9(_0x2a4d7f);});});} \ No newline at end of file +var _0x5a96=['debug','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','request\x20sent'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x5a96,0xbc));var _0x65a9=function(_0x205742,_0x4ad437){_0x205742=_0x205742-0x0;var _0x222ab9=_0x5a96[_0x205742];return _0x222ab9;};'use strict';var _=require(_0x65a9('0x0'));var util=require(_0x65a9('0x1'));var moment=require('moment');var BPromise=require(_0x65a9('0x2'));var rs=require(_0x65a9('0x3'));var fs=require('fs');var Redis=require(_0x65a9('0x4'));var db=require(_0x65a9('0x5'))['db'];var utils=require(_0x65a9('0x6'));var logger=require(_0x65a9('0x7'))('rpc');var config=require(_0x65a9('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x596d73,_0x94fce1,_0x107fea){return new BPromise(function(_0x5ae332,_0x3330b9){return client['request'](_0x596d73,_0x107fea)[_0x65a9('0x9')](function(_0x3d6166){logger[_0x65a9('0xa')]('Integration,\x20%s,\x20%s',_0x94fce1,_0x65a9('0xb'));logger[_0x65a9('0xc')](_0x65a9('0xd'),_0x94fce1,_0x65a9('0xb'),JSON['stringify'](_0x3d6166));if(_0x3d6166[_0x65a9('0xe')]){if(_0x3d6166['error'][_0x65a9('0xf')]===0x1f4){logger[_0x65a9('0xe')](_0x65a9('0x10'),_0x94fce1,_0x3d6166['error']['message']);return _0x3330b9(_0x3d6166[_0x65a9('0xe')][_0x65a9('0x11')]);}logger['error']('Integration,\x20%s,\x20%s',_0x94fce1,_0x3d6166[_0x65a9('0xe')][_0x65a9('0x11')]);return _0x5ae332(_0x3d6166[_0x65a9('0xe')][_0x65a9('0x11')]);}else{logger[_0x65a9('0xa')]('Integration,\x20%s,\x20%s',_0x94fce1,'request\x20sent');_0x5ae332(_0x3d6166[_0x65a9('0x12')][_0x65a9('0x11')]);}})[_0x65a9('0x13')](function(_0x131414){logger[_0x65a9('0xe')](_0x65a9('0x10'),_0x94fce1,_0x131414);_0x3330b9(_0x131414);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index dadfd89..6a6812f 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 _0x4f3c=['../../config/environment','./integrationReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x51363e,_0x46a245){var _0x98b230=function(_0x277f2f){while(--_0x277f2f){_0x51363e['push'](_0x51363e['shift']());}};_0x98b230(++_0x46a245);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x2493a8,_0x5a240d){_0x2493a8=_0x2493a8-0x0;var _0x2b06c9=_0x4f3c[_0x2493a8];return _0x2b06c9;};'use strict';var multer=require(_0xc4f3('0x0'));var util=require(_0xc4f3('0x1'));var path=require(_0xc4f3('0x2'));var timeout=require(_0xc4f3('0x3'));var express=require(_0xc4f3('0x4'));var router=express[_0xc4f3('0x5')]();var auth=require(_0xc4f3('0x6'));var interaction=require(_0xc4f3('0x7'));var config=require(_0xc4f3('0x8'));var controller=require(_0xc4f3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc4f3('0xa')]);router[_0xc4f3('0xb')](_0xc4f3('0xc'),auth[_0xc4f3('0xd')](),controller[_0xc4f3('0xe')]);router[_0xc4f3('0xb')](_0xc4f3('0xf'),auth[_0xc4f3('0xd')](),controller[_0xc4f3('0x10')]);router[_0xc4f3('0x11')]('/',auth['isAuthenticated'](),controller[_0xc4f3('0x12')]);router['put']('/:id',auth[_0xc4f3('0xd')](),controller['update']);router[_0xc4f3('0x13')](_0xc4f3('0xf'),auth[_0xc4f3('0xd')](),controller['destroy']);module[_0xc4f3('0x14')]=router; \ No newline at end of file +var _0xceb0=['describe','/:id','show','post','update','delete','exports','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x5cafed,_0x35f48c){var _0x8affd6=function(_0x46ca7d){while(--_0x46ca7d){_0x5cafed['push'](_0x5cafed['shift']());}};_0x8affd6(++_0x35f48c);}(_0xceb0,0x173));var _0x0ceb=function(_0x3fcd19,_0x50e7a7){_0x3fcd19=_0x3fcd19-0x0;var _0xce0008=_0xceb0[_0x3fcd19];return _0xce0008;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ceb('0x0'));var router=express['Router']();var auth=require(_0x0ceb('0x1'));var interaction=require(_0x0ceb('0x2'));var config=require(_0x0ceb('0x3'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x0ceb('0x4')](),controller[_0x0ceb('0x5')]);router[_0x0ceb('0x6')]('/describe',auth[_0x0ceb('0x4')](),controller[_0x0ceb('0x7')]);router['get'](_0x0ceb('0x8'),auth['isAuthenticated'](),controller[_0x0ceb('0x9')]);router[_0x0ceb('0xa')]('/',auth[_0x0ceb('0x4')](),controller['create']);router['put'](_0x0ceb('0x8'),auth[_0x0ceb('0x4')](),controller[_0x0ceb('0xb')]);router[_0x0ceb('0xc')](_0x0ceb('0x8'),auth[_0x0ceb('0x4')](),controller['destroy']);module[_0x0ceb('0xd')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 3e4f20f..bb8a258 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 _0xaa84=['TEXT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE'];(function(_0x50102a,_0x134e4f){var _0x22e707=function(_0x380971){while(--_0x380971){_0x50102a['push'](_0x50102a['shift']());}};_0x22e707(++_0x134e4f);}(_0xaa84,0x11c));var _0x4aa8=function(_0x38cf84,_0x445013){_0x38cf84=_0x38cf84-0x0;var _0x469f28=_0xaa84[_0x38cf84];return _0x469f28;};'use strict';var Sequelize=require(_0x4aa8('0x0'));module[_0x4aa8('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x4aa8('0x2')]},'exitStatus':{'type':Sequelize[_0x4aa8('0x2')]},'ticketId':{'type':Sequelize[_0x4aa8('0x2')]},'integrationId':{'type':Sequelize[_0x4aa8('0x3')]},'contacts':{'type':Sequelize[_0x4aa8('0x2')]},'uniqueid':{'type':Sequelize[_0x4aa8('0x2')]},'calleridnum':{'type':Sequelize[_0x4aa8('0x2')]},'calleridname':{'type':Sequelize[_0x4aa8('0x2')]},'queue':{'type':Sequelize[_0x4aa8('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4aa8('0x3')]},'agentcomplete':{'type':Sequelize[_0x4aa8('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4aa8('0x5')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4aa8('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4aa8('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x4aa8('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4aa8('0x5')]},'agentdump':{'type':Sequelize[_0x4aa8('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4aa8('0x5')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4aa8('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4aa8('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4aa8('0x2')]},'connectedlinename':{'type':Sequelize[_0x4aa8('0x2')]},'language':{'type':Sequelize[_0x4aa8('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4aa8('0x2')]},'priority':{'type':Sequelize[_0x4aa8('0x2')]},'destchannel':{'type':Sequelize[_0x4aa8('0x2')]},'destchannelstate':{'type':Sequelize[_0x4aa8('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4aa8('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4aa8('0x2')]},'destcalleridname':{'type':Sequelize[_0x4aa8('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x4aa8('0x2')]},'destlanguage':{'type':Sequelize[_0x4aa8('0x2')]},'destaccountcode':{'type':Sequelize[_0x4aa8('0x2')]},'destcontext':{'type':Sequelize[_0x4aa8('0x2')]},'destexten':{'type':Sequelize[_0x4aa8('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4aa8('0x2')]},'messageId':{'type':Sequelize[_0x4aa8('0x2')]},'inReplyTo':{'type':Sequelize[_0x4aa8('0x2')]},'subject':{'type':Sequelize[_0x4aa8('0x2')]},'from':{'type':Sequelize[_0x4aa8('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x4aa8('0x6')]},'html':{'type':Sequelize[_0x4aa8('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT',_0x4aa8('0x7'),_0x4aa8('0x8'),_0x4aa8('0x9'))},'url':{'type':Sequelize[_0x4aa8('0x2')]},'app':{'type':Sequelize[_0x4aa8('0x2')]},'appdata':{'type':Sequelize[_0x4aa8('0x2')]},'projectId':{'type':Sequelize[_0x4aa8('0x3')]}}; \ No newline at end of file +var _0x45c1=['TEXT','ENUM','SENT','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x22e05f,_0x755c98){var _0x29231d=function(_0x5b63b1){while(--_0x5b63b1){_0x22e05f['push'](_0x22e05f['shift']());}};_0x29231d(++_0x755c98);}(_0x45c1,0x1a8));var _0x145c=function(_0x300bf8,_0x36051b){_0x300bf8=_0x300bf8-0x0;var _0x3fdfa7=_0x45c1[_0x300bf8];return _0x3fdfa7;};'use strict';var Sequelize=require(_0x145c('0x0'));module[_0x145c('0x1')]={'integration':{'type':Sequelize[_0x145c('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x145c('0x2')]},'ticketId':{'type':Sequelize[_0x145c('0x2')]},'integrationId':{'type':Sequelize[_0x145c('0x3')]},'contacts':{'type':Sequelize[_0x145c('0x2')]},'uniqueid':{'type':Sequelize[_0x145c('0x2')]},'calleridnum':{'type':Sequelize[_0x145c('0x2')]},'calleridname':{'type':Sequelize[_0x145c('0x2')]},'queue':{'type':Sequelize[_0x145c('0x2')]},'interface':{'type':Sequelize[_0x145c('0x2')]},'membername':{'type':Sequelize[_0x145c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x145c('0x4')]},'agentconnectAt':{'type':Sequelize[_0x145c('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x145c('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x145c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x145c('0x3')]},'reason':{'type':Sequelize[_0x145c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x145c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x145c('0x4')]},'agentdump':{'type':Sequelize[_0x145c('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x145c('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x145c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x145c('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x145c('0x2')]},'language':{'type':Sequelize[_0x145c('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x145c('0x2')]},'exten':{'type':Sequelize[_0x145c('0x2')]},'priority':{'type':Sequelize[_0x145c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x145c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x145c('0x2')]},'destcalleridname':{'type':Sequelize[_0x145c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x145c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x145c('0x2')]},'destlanguage':{'type':Sequelize[_0x145c('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x145c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x145c('0x2')]},'messageId':{'type':Sequelize[_0x145c('0x2')]},'inReplyTo':{'type':Sequelize[_0x145c('0x2')]},'subject':{'type':Sequelize[_0x145c('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x145c('0x2')]},'cc':{'type':Sequelize[_0x145c('0x2')]},'attachment':{'type':Sequelize[_0x145c('0x6')]},'html':{'type':Sequelize[_0x145c('0x6')]},'text':{'type':Sequelize[_0x145c('0x6')]},'status':{'type':Sequelize[_0x145c('0x7')](_0x145c('0x8'),'SENDING',_0x145c('0x9'),'FAILED')},'url':{'type':Sequelize[_0x145c('0x2')]},'app':{'type':Sequelize[_0x145c('0x2')]},'appdata':{'type':Sequelize[_0x145c('0x2')]},'projectId':{'type':Sequelize[_0x145c('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d352c79..a4bf38b 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 _0x8cc6=['body','describe','html-pdf','zip-dir','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create'];(function(_0x166106,_0x1061af){var _0x599192=function(_0x438bef){while(--_0x438bef){_0x166106['push'](_0x166106['shift']());}};_0x599192(++_0x1061af);}(_0x8cc6,0x122));var _0x68cc=function(_0x3e2f7c,_0x1930e4){_0x3e2f7c=_0x3e2f7c-0x0;var _0x12df2e=_0x8cc6[_0x3e2f7c];return _0x12df2e;};'use strict';var pdf=require(_0x68cc('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x68cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68cc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x68cc('0x3'));var util=require(_0x68cc('0x4'));var path=require('path');var sox=require(_0x68cc('0x5'));var csv=require(_0x68cc('0x6'));var ejs=require(_0x68cc('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x68cc('0x8'));var crypto=require(_0x68cc('0x9'));var jsforce=require(_0x68cc('0xa'));var deskjs=require(_0x68cc('0xb'));var toCsv=require(_0x68cc('0x6'));var querystring=require(_0x68cc('0xc'));var Papa=require(_0x68cc('0xd'));var Redis=require('ioredis');var authService=require(_0x68cc('0xe'));var qs=require(_0x68cc('0xf'));var as=require(_0x68cc('0x10'));var hardwareService=require(_0x68cc('0x11'));var logger=require(_0x68cc('0x12'))(_0x68cc('0x13'));var utils=require(_0x68cc('0x14'));var config=require('../../config/environment');var db=require(_0x68cc('0x15'))['db'];function respondWithStatusCode(_0x382d56,_0xfafc0d){_0xfafc0d=_0xfafc0d||0xcc;return function(_0x3cc129){if(_0x3cc129){return _0x382d56[_0x68cc('0x16')](_0xfafc0d);}return _0x382d56['status'](_0xfafc0d)[_0x68cc('0x17')]();};}function respondWithResult(_0x3db23f,_0x47477a){_0x47477a=_0x47477a||0xc8;return function(_0x5df097){if(_0x5df097){return _0x3db23f[_0x68cc('0x18')](_0x47477a)[_0x68cc('0x19')](_0x5df097);}};}function respondWithFilteredResult(_0x5642de,_0x2e5bf5){return function(_0x3b4481){if(_0x3b4481){var _0x36bc68=_0x3b4481[_0x68cc('0x1a')],_0x250c03=_0x2e5bf5['offset'],_0x5840d1=_0x2e5bf5['offset']+_0x2e5bf5[_0x68cc('0x1b')],_0x148f12;if(_0x5840d1>=_0x36bc68){_0x5840d1=_0x36bc68;_0x148f12=0xc8;}else{_0x148f12=0xce;}_0x5642de[_0x68cc('0x18')](_0x148f12);return _0x5642de[_0x68cc('0x1c')]('Content-Range',_0x250c03+'-'+_0x5840d1+'/'+_0x36bc68)[_0x68cc('0x19')](_0x3b4481);}return null;};}function patchUpdates(_0x423114){return function(_0x547435){try{jsonpatch['apply'](_0x547435,_0x423114,!![]);}catch(_0x4b1b3c){return BPromise[_0x68cc('0x1d')](_0x4b1b3c);}return _0x547435[_0x68cc('0x1e')]();};}function saveUpdates(_0x746ae7,_0x369cd8){return function(_0xc2c911){if(_0xc2c911){return _0xc2c911[_0x68cc('0x1f')](_0x746ae7)[_0x68cc('0x20')](function(_0x1cd94b){return _0x1cd94b;});}return null;};}function removeEntity(_0x2e5b3a,_0x409f71){return function(_0x2ad2eb){if(_0x2ad2eb){return _0x2ad2eb[_0x68cc('0x21')]()[_0x68cc('0x20')](function(){_0x2e5b3a[_0x68cc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b588,_0x21e2a8){return function(_0x359808){if(!_0x359808){_0x13b588['sendStatus'](0x194);}return _0x359808;};}function handleError(_0x3a06a0,_0x5c69d4){_0x5c69d4=_0x5c69d4||0x1f4;return function(_0x10b245){logger[_0x68cc('0x22')](_0x10b245[_0x68cc('0x23')]);if(_0x10b245[_0x68cc('0x24')]){delete _0x10b245[_0x68cc('0x24')];}_0x3a06a0['status'](_0x5c69d4)[_0x68cc('0x25')](_0x10b245);};}exports[_0x68cc('0x26')]=function(_0x931a90,_0x5c0d72){var _0x1a32eb={},_0x138ccd={},_0x186c26={'count':0x0,'rows':[]};var _0x380fd6=_[_0x68cc('0x27')](db[_0x68cc('0x28')][_0x68cc('0x29')],function(_0x2515ed){return{'name':_0x2515ed[_0x68cc('0x2a')],'type':_0x2515ed[_0x68cc('0x2b')][_0x68cc('0x2c')]};});_0x138ccd['model']=_[_0x68cc('0x27')](_0x380fd6,_0x68cc('0x24'));_0x138ccd[_0x68cc('0x2d')]=_['keys'](_0x931a90[_0x68cc('0x2d')]);_0x138ccd[_0x68cc('0x2e')]=_[_0x68cc('0x2f')](_0x138ccd[_0x68cc('0x30')],_0x138ccd[_0x68cc('0x2d')]);_0x1a32eb[_0x68cc('0x31')]=_['intersection'](_0x138ccd[_0x68cc('0x30')],qs[_0x68cc('0x32')](_0x931a90[_0x68cc('0x2d')][_0x68cc('0x32')]));_0x1a32eb[_0x68cc('0x31')]=_0x1a32eb[_0x68cc('0x31')][_0x68cc('0x33')]?_0x1a32eb[_0x68cc('0x31')]:_0x138ccd[_0x68cc('0x30')];if(!_0x931a90[_0x68cc('0x2d')][_0x68cc('0x34')]('nolimit')){_0x1a32eb[_0x68cc('0x1b')]=qs[_0x68cc('0x1b')](_0x931a90[_0x68cc('0x2d')][_0x68cc('0x1b')]);_0x1a32eb['offset']=qs[_0x68cc('0x35')](_0x931a90['query'][_0x68cc('0x35')]);}_0x1a32eb['order']=qs[_0x68cc('0x36')](_0x931a90[_0x68cc('0x2d')]['sort']);_0x1a32eb[_0x68cc('0x37')]=qs[_0x68cc('0x2e')](_[_0x68cc('0x38')](_0x931a90[_0x68cc('0x2d')],_0x138ccd['filters']),_0x380fd6);if(_0x931a90[_0x68cc('0x2d')][_0x68cc('0x39')]){_0x1a32eb[_0x68cc('0x37')]=_[_0x68cc('0x3a')](_0x1a32eb['where'],{'$or':_['map'](_0x380fd6,function(_0x7300a1){if(_0x7300a1[_0x68cc('0x2b')]!==_0x68cc('0x3b')){var _0xd8ab11={};_0xd8ab11[_0x7300a1[_0x68cc('0x24')]]={'$like':'%'+_0x931a90[_0x68cc('0x2d')][_0x68cc('0x39')]+'%'};return _0xd8ab11;}})});}_0x1a32eb=_[_0x68cc('0x3a')]({},_0x1a32eb,_0x931a90[_0x68cc('0x3c')]);var _0x1f2bc3={'where':_0x1a32eb['where']};return db[_0x68cc('0x28')][_0x68cc('0x1a')](_0x1f2bc3)[_0x68cc('0x20')](function(_0x144c85){_0x186c26[_0x68cc('0x1a')]=_0x144c85;if(_0x931a90[_0x68cc('0x2d')][_0x68cc('0x3d')]){_0x1a32eb[_0x68cc('0x3e')]=[{'all':!![]}];}return db[_0x68cc('0x28')]['findAll'](_0x1a32eb);})[_0x68cc('0x20')](function(_0x4f78a9){_0x186c26[_0x68cc('0x3f')]=_0x4f78a9;return _0x186c26;})[_0x68cc('0x20')](respondWithFilteredResult(_0x5c0d72,_0x1a32eb))[_0x68cc('0x40')](handleError(_0x5c0d72,null));};exports[_0x68cc('0x41')]=function(_0x2db064,_0x4a9b12){var _0x46b6db={'raw':![],'where':{'id':_0x2db064[_0x68cc('0x42')]['id']}},_0x1bb9cf={};_0x1bb9cf[_0x68cc('0x30')]=_[_0x68cc('0x43')](db['IntegrationReport'][_0x68cc('0x29')]);_0x1bb9cf[_0x68cc('0x2d')]=_[_0x68cc('0x43')](_0x2db064['query']);_0x1bb9cf[_0x68cc('0x2e')]=_[_0x68cc('0x2f')](_0x1bb9cf[_0x68cc('0x30')],_0x1bb9cf['query']);_0x46b6db[_0x68cc('0x31')]=_[_0x68cc('0x2f')](_0x1bb9cf[_0x68cc('0x30')],qs['fields'](_0x2db064['query'][_0x68cc('0x32')]));_0x46b6db[_0x68cc('0x31')]=_0x46b6db[_0x68cc('0x31')][_0x68cc('0x33')]?_0x46b6db[_0x68cc('0x31')]:_0x1bb9cf[_0x68cc('0x30')];if(_0x2db064['query'][_0x68cc('0x3d')]){_0x46b6db[_0x68cc('0x3e')]=[{'all':!![]}];}_0x46b6db=_[_0x68cc('0x3a')]({},_0x46b6db,_0x2db064[_0x68cc('0x3c')]);return db[_0x68cc('0x28')][_0x68cc('0x44')](_0x46b6db)[_0x68cc('0x20')](handleEntityNotFound(_0x4a9b12,null))[_0x68cc('0x20')](respondWithResult(_0x4a9b12,null))[_0x68cc('0x40')](handleError(_0x4a9b12,null));};exports[_0x68cc('0x45')]=function(_0x28274b,_0x5163db){return db[_0x68cc('0x28')][_0x68cc('0x45')](_0x28274b['body'],{})[_0x68cc('0x20')](respondWithResult(_0x5163db,0xc9))[_0x68cc('0x40')](handleError(_0x5163db,null));};exports['update']=function(_0x2692d4,_0x49011c){if(_0x2692d4[_0x68cc('0x46')]['id']){delete _0x2692d4[_0x68cc('0x46')]['id'];}return db[_0x68cc('0x28')][_0x68cc('0x44')]({'where':{'id':_0x2692d4[_0x68cc('0x42')]['id']}})[_0x68cc('0x20')](handleEntityNotFound(_0x49011c,null))[_0x68cc('0x20')](saveUpdates(_0x2692d4[_0x68cc('0x46')],null))['then'](respondWithResult(_0x49011c,null))[_0x68cc('0x40')](handleError(_0x49011c,null));};exports[_0x68cc('0x21')]=function(_0x24c0c7,_0xccca7f){return db['IntegrationReport'][_0x68cc('0x44')]({'where':{'id':_0x24c0c7['params']['id']}})[_0x68cc('0x20')](handleEntityNotFound(_0xccca7f,null))[_0x68cc('0x20')](removeEntity(_0xccca7f,null))[_0x68cc('0x40')](handleError(_0xccca7f,null));};exports[_0x68cc('0x47')]=function(_0xaaaa5c,_0x5f276d){return db[_0x68cc('0x28')][_0x68cc('0x47')]()[_0x68cc('0x20')](respondWithResult(_0x5f276d,null))[_0x68cc('0x40')](handleError(_0x5f276d,null));}; \ No newline at end of file +var _0xb8fb=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','IntegrationReport','count','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','error','stack','name','send','map'];(function(_0x1c2b50,_0x1601ac){var _0x4eff41=function(_0x10d80d){while(--_0x10d80d){_0x1c2b50['push'](_0x1c2b50['shift']());}};_0x4eff41(++_0x1601ac);}(_0xb8fb,0x6f));var _0xbb8f=function(_0x55a156,_0x536bc8){_0x55a156=_0x55a156-0x0;var _0x52339c=_0xb8fb[_0x55a156];return _0x52339c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb8f('0x0'));var rimraf=require(_0xbb8f('0x1'));var zipdir=require(_0xbb8f('0x2'));var jsonpatch=require(_0xbb8f('0x3'));var rp=require(_0xbb8f('0x4'));var moment=require(_0xbb8f('0x5'));var BPromise=require(_0xbb8f('0x6'));var Mustache=require('mustache');var util=require(_0xbb8f('0x7'));var path=require(_0xbb8f('0x8'));var sox=require(_0xbb8f('0x9'));var csv=require(_0xbb8f('0xa'));var ejs=require(_0xbb8f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb8f('0xc'));var crypto=require('crypto');var jsforce=require(_0xbb8f('0xd'));var deskjs=require(_0xbb8f('0xe'));var toCsv=require(_0xbb8f('0xa'));var querystring=require(_0xbb8f('0xf'));var Papa=require(_0xbb8f('0x10'));var Redis=require(_0xbb8f('0x11'));var authService=require(_0xbb8f('0x12'));var qs=require(_0xbb8f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb8f('0x14'));var logger=require(_0xbb8f('0x15'))('api');var utils=require(_0xbb8f('0x16'));var config=require(_0xbb8f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509cfd,_0x3c354e){_0x3c354e=_0x3c354e||0xcc;return function(_0x2c64ab){if(_0x2c64ab){return _0x509cfd[_0xbb8f('0x18')](_0x3c354e);}return _0x509cfd['status'](_0x3c354e)[_0xbb8f('0x19')]();};}function respondWithResult(_0x768b16,_0x442b6c){_0x442b6c=_0x442b6c||0xc8;return function(_0x17708a){if(_0x17708a){return _0x768b16[_0xbb8f('0x1a')](_0x442b6c)[_0xbb8f('0x1b')](_0x17708a);}};}function respondWithFilteredResult(_0x46e307,_0xc94719){return function(_0x395b84){if(_0x395b84){var _0x22042b=_0x395b84['count'],_0x389917=_0xc94719[_0xbb8f('0x1c')],_0x4e6b5b=_0xc94719[_0xbb8f('0x1c')]+_0xc94719[_0xbb8f('0x1d')],_0x2ee127;if(_0x4e6b5b>=_0x22042b){_0x4e6b5b=_0x22042b;_0x2ee127=0xc8;}else{_0x2ee127=0xce;}_0x46e307['status'](_0x2ee127);return _0x46e307['set'](_0xbb8f('0x1e'),_0x389917+'-'+_0x4e6b5b+'/'+_0x22042b)[_0xbb8f('0x1b')](_0x395b84);}return null;};}function patchUpdates(_0x35bad3){return function(_0x22be72){try{jsonpatch['apply'](_0x22be72,_0x35bad3,!![]);}catch(_0xacd5e9){return BPromise[_0xbb8f('0x1f')](_0xacd5e9);}return _0x22be72[_0xbb8f('0x20')]();};}function saveUpdates(_0x349955,_0x58f3cb){return function(_0x34270e){if(_0x34270e){return _0x34270e[_0xbb8f('0x21')](_0x349955)['then'](function(_0x3a0494){return _0x3a0494;});}return null;};}function removeEntity(_0x1db4cb,_0x36b01f){return function(_0x29d789){if(_0x29d789){return _0x29d789['destroy']()['then'](function(){_0x1db4cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x237f69,_0x48e18c){return function(_0x1c8b4a){if(!_0x1c8b4a){_0x237f69[_0xbb8f('0x18')](0x194);}return _0x1c8b4a;};}function handleError(_0x27f7ec,_0x1260db){_0x1260db=_0x1260db||0x1f4;return function(_0x3f0b71){logger[_0xbb8f('0x22')](_0x3f0b71[_0xbb8f('0x23')]);if(_0x3f0b71[_0xbb8f('0x24')]){delete _0x3f0b71[_0xbb8f('0x24')];}_0x27f7ec[_0xbb8f('0x1a')](_0x1260db)[_0xbb8f('0x25')](_0x3f0b71);};}exports['index']=function(_0x340c45,_0x241cdc){var _0x1077b2={},_0x466561={},_0x589d22={'count':0x0,'rows':[]};var _0x429a52=_[_0xbb8f('0x26')](db['IntegrationReport'][_0xbb8f('0x27')],function(_0x4a33d1){return{'name':_0x4a33d1[_0xbb8f('0x28')],'type':_0x4a33d1[_0xbb8f('0x29')][_0xbb8f('0x2a')]};});_0x466561[_0xbb8f('0x2b')]=_[_0xbb8f('0x26')](_0x429a52,_0xbb8f('0x24'));_0x466561['query']=_[_0xbb8f('0x2c')](_0x340c45[_0xbb8f('0x2d')]);_0x466561['filters']=_[_0xbb8f('0x2e')](_0x466561['model'],_0x466561['query']);_0x1077b2[_0xbb8f('0x2f')]=_[_0xbb8f('0x2e')](_0x466561['model'],qs[_0xbb8f('0x30')](_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x30')]));_0x1077b2['attributes']=_0x1077b2[_0xbb8f('0x2f')][_0xbb8f('0x31')]?_0x1077b2['attributes']:_0x466561[_0xbb8f('0x2b')];if(!_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x32')](_0xbb8f('0x33'))){_0x1077b2[_0xbb8f('0x1d')]=qs['limit'](_0x340c45[_0xbb8f('0x2d')]['limit']);_0x1077b2[_0xbb8f('0x1c')]=qs[_0xbb8f('0x1c')](_0x340c45[_0xbb8f('0x2d')]['offset']);}_0x1077b2[_0xbb8f('0x34')]=qs[_0xbb8f('0x35')](_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x35')]);_0x1077b2[_0xbb8f('0x36')]=qs[_0xbb8f('0x37')](_[_0xbb8f('0x38')](_0x340c45[_0xbb8f('0x2d')],_0x466561[_0xbb8f('0x37')]),_0x429a52);if(_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x39')]){_0x1077b2['where']=_[_0xbb8f('0x3a')](_0x1077b2[_0xbb8f('0x36')],{'$or':_[_0xbb8f('0x26')](_0x429a52,function(_0x56d624){if(_0x56d624[_0xbb8f('0x29')]!==_0xbb8f('0x3b')){var _0x5281f4={};_0x5281f4[_0x56d624[_0xbb8f('0x24')]]={'$like':'%'+_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x39')]+'%'};return _0x5281f4;}})});}_0x1077b2=_[_0xbb8f('0x3a')]({},_0x1077b2,_0x340c45['options']);var _0x2be2a1={'where':_0x1077b2[_0xbb8f('0x36')]};return db[_0xbb8f('0x3c')][_0xbb8f('0x3d')](_0x2be2a1)[_0xbb8f('0x3e')](function(_0x27a359){_0x589d22['count']=_0x27a359;if(_0x340c45[_0xbb8f('0x2d')][_0xbb8f('0x3f')]){_0x1077b2[_0xbb8f('0x40')]=[{'all':!![]}];}return db[_0xbb8f('0x3c')][_0xbb8f('0x41')](_0x1077b2);})[_0xbb8f('0x3e')](function(_0x21b673){_0x589d22[_0xbb8f('0x42')]=_0x21b673;return _0x589d22;})['then'](respondWithFilteredResult(_0x241cdc,_0x1077b2))[_0xbb8f('0x43')](handleError(_0x241cdc,null));};exports[_0xbb8f('0x44')]=function(_0x3e0191,_0x25df89){var _0x572a04={'raw':![],'where':{'id':_0x3e0191['params']['id']}},_0x10e9bf={};_0x10e9bf[_0xbb8f('0x2b')]=_[_0xbb8f('0x2c')](db[_0xbb8f('0x3c')][_0xbb8f('0x27')]);_0x10e9bf[_0xbb8f('0x2d')]=_['keys'](_0x3e0191[_0xbb8f('0x2d')]);_0x10e9bf[_0xbb8f('0x37')]=_[_0xbb8f('0x2e')](_0x10e9bf[_0xbb8f('0x2b')],_0x10e9bf['query']);_0x572a04[_0xbb8f('0x2f')]=_['intersection'](_0x10e9bf[_0xbb8f('0x2b')],qs[_0xbb8f('0x30')](_0x3e0191[_0xbb8f('0x2d')][_0xbb8f('0x30')]));_0x572a04[_0xbb8f('0x2f')]=_0x572a04['attributes'][_0xbb8f('0x31')]?_0x572a04['attributes']:_0x10e9bf['model'];if(_0x3e0191[_0xbb8f('0x2d')][_0xbb8f('0x3f')]){_0x572a04['include']=[{'all':!![]}];}_0x572a04=_[_0xbb8f('0x3a')]({},_0x572a04,_0x3e0191[_0xbb8f('0x45')]);return db[_0xbb8f('0x3c')][_0xbb8f('0x46')](_0x572a04)['then'](handleEntityNotFound(_0x25df89,null))[_0xbb8f('0x3e')](respondWithResult(_0x25df89,null))[_0xbb8f('0x43')](handleError(_0x25df89,null));};exports[_0xbb8f('0x47')]=function(_0x52b8cf,_0x1ef76c){return db[_0xbb8f('0x3c')][_0xbb8f('0x47')](_0x52b8cf[_0xbb8f('0x48')],{})[_0xbb8f('0x3e')](respondWithResult(_0x1ef76c,0xc9))[_0xbb8f('0x43')](handleError(_0x1ef76c,null));};exports[_0xbb8f('0x21')]=function(_0x2d63a7,_0xee6d15){if(_0x2d63a7['body']['id']){delete _0x2d63a7[_0xbb8f('0x48')]['id'];}return db[_0xbb8f('0x3c')]['find']({'where':{'id':_0x2d63a7['params']['id']}})['then'](handleEntityNotFound(_0xee6d15,null))[_0xbb8f('0x3e')](saveUpdates(_0x2d63a7[_0xbb8f('0x48')],null))[_0xbb8f('0x3e')](respondWithResult(_0xee6d15,null))[_0xbb8f('0x43')](handleError(_0xee6d15,null));};exports['destroy']=function(_0x59f73a,_0x594101){return db['IntegrationReport'][_0xbb8f('0x46')]({'where':{'id':_0x59f73a[_0xbb8f('0x49')]['id']}})[_0xbb8f('0x3e')](handleEntityNotFound(_0x594101,null))[_0xbb8f('0x3e')](removeEntity(_0x594101,null))[_0xbb8f('0x43')](handleError(_0x594101,null));};exports[_0xbb8f('0x4a')]=function(_0x1dfa60,_0x46a5aa){return db[_0xbb8f('0x3c')][_0xbb8f('0x4a')]()[_0xbb8f('0x3e')](respondWithResult(_0x46a5aa,null))[_0xbb8f('0x43')](handleError(_0x46a5aa,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d1a3810..682bd8f 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 _0x5fb8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5fb8,0xe8));var _0x85fb=function(_0x54ff38,_0x17fe73){_0x54ff38=_0x54ff38-0x0;var _0x24dab6=_0x5fb8[_0x54ff38];return _0x24dab6;};'use strict';var _=require(_0x85fb('0x0'));var util=require(_0x85fb('0x1'));var logger=require(_0x85fb('0x2'))('api');var moment=require(_0x85fb('0x3'));var BPromise=require(_0x85fb('0x4'));var rp=require(_0x85fb('0x5'));var fs=require('fs');var path=require(_0x85fb('0x6'));var rimraf=require(_0x85fb('0x7'));var config=require(_0x85fb('0x8'));var attributes=require(_0x85fb('0x9'));module['exports']=function(_0x59fc4d,_0x53e36a){return _0x59fc4d[_0x85fb('0xa')](_0x85fb('0xb'),attributes,{'tableName':_0x85fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9614=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','define','IntegrationReport','report_integration'];(function(_0x27aa01,_0x28e0cc){var _0x50d6fa=function(_0x3bdd11){while(--_0x3bdd11){_0x27aa01['push'](_0x27aa01['shift']());}};_0x50d6fa(++_0x28e0cc);}(_0x9614,0x84));var _0x4961=function(_0x47a491,_0x45e171){_0x47a491=_0x47a491-0x0;var _0x3b176b=_0x9614[_0x47a491];return _0x3b176b;};'use strict';var _=require(_0x4961('0x0'));var util=require('util');var logger=require(_0x4961('0x1'))(_0x4961('0x2'));var moment=require(_0x4961('0x3'));var BPromise=require(_0x4961('0x4'));var rp=require(_0x4961('0x5'));var fs=require('fs');var path=require(_0x4961('0x6'));var rimraf=require(_0x4961('0x7'));var config=require('../../config/environment');var attributes=require(_0x4961('0x8'));module['exports']=function(_0x27f2a0,_0x2746c0){return _0x27f2a0[_0x4961('0x9')](_0x4961('0xa'),attributes,{'tableName':_0x4961('0xb'),'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 8ce3a8b..706f7e6 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x23cc76,_0x9c756b){var _0x2f5c13=function(_0x57c44b){while(--_0x57c44b){_0x23cc76['push'](_0x23cc76['shift']());}};_0x2f5c13(++_0x9c756b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x588381,_0x2b030e){var _0x53e245=function(_0x368a8f){while(--_0x368a8f){_0x588381['push'](_0x588381['shift']());}};_0x53e245(++_0x2b030e);}(_0xb10b,0x12a));var _0xbb10=function(_0xc01d2,_0x29f146){_0xc01d2=_0xc01d2-0x0;var _0x17f297=_0xb10b[_0xc01d2];return _0x17f297;};'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/interval/index.js b/server/api/interval/index.js index 4612f7a..4678072 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 _0x55ca=['/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x55ca,0x126));var _0xa55c=function(_0x5e33f6,_0x2e18e6){_0x5e33f6=_0x5e33f6-0x0;var _0x20cb0f=_0x55ca[_0x5e33f6];return _0x20cb0f;};'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('0x6')]('/:id/sub_intervals',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0xd')](_0xa55c('0x10'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file +var _0x55ca=['/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x55ca,0x126));var _0xa55c=function(_0x5c1449,_0x2af4b4){_0x5c1449=_0x5c1449-0x0;var _0x270473=_0x55ca[_0x5c1449];return _0x270473;};'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('0x6')]('/:id/sub_intervals',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0xd')](_0xa55c('0x10'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index d1f7b91..fb830e0 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 _0xe538=['sequelize','exports','STRING'];(function(_0x39d0f7,_0x4fcdf0){var _0x498cfa=function(_0x3152bf){while(--_0x3152bf){_0x39d0f7['push'](_0x39d0f7['shift']());}};_0x498cfa(++_0x4fcdf0);}(_0xe538,0x198));var _0x8e53=function(_0x3f127b,_0x986b51){_0x3f127b=_0x3f127b-0x0;var _0x23ed00=_0xe538[_0x3f127b];return _0x23ed00;};'use strict';var Sequelize=require(_0x8e53('0x0'));module[_0x8e53('0x1')]={'name':{'type':Sequelize[_0x8e53('0x2')]},'description':{'type':Sequelize[_0x8e53('0x2')]},'interval':{'type':Sequelize[_0x8e53('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x71c6=['exports','STRING','sequelize'];(function(_0x1f9b5e,_0x25e84b){var _0x4b3295=function(_0x1b7d79){while(--_0x1b7d79){_0x1f9b5e['push'](_0x1f9b5e['shift']());}};_0x4b3295(++_0x25e84b);}(_0x71c6,0x1c4));var _0x671c=function(_0xcfc461,_0x5227e4){_0xcfc461=_0xcfc461-0x0;var _0x1f9038=_0x71c6[_0xcfc461];return _0x1f9038;};'use strict';var Sequelize=require(_0x671c('0x0'));module[_0x671c('0x1')]={'name':{'type':Sequelize[_0x671c('0x2')]},'description':{'type':Sequelize[_0x671c('0x2')]},'interval':{'type':Sequelize[_0x671c('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e55a1b7..5f9d0cf 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 _0xd7f5=['status','json','count','offset','limit','set','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','map','Interval','rawAttributes','fieldName','type','query','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','addInterval','IntervalId','getIntervals','filter','nolimit','addIntervals','findOne','transaction','bulkCreate','findAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end'];(function(_0x2a64b1,_0x575846){var _0x4ed9e3=function(_0x9b35fe){while(--_0x9b35fe){_0x2a64b1['push'](_0x2a64b1['shift']());}};_0x4ed9e3(++_0x575846);}(_0xd7f5,0x93));var _0x5d7f=function(_0x4cd226,_0x489a22){_0x4cd226=_0x4cd226-0x0;var _0x19c008=_0xd7f5[_0x4cd226];return _0x19c008;};'use strict';var pdf=require(_0x5d7f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5d7f('0x1'));var zipdir=require(_0x5d7f('0x2'));var jsonpatch=require(_0x5d7f('0x3'));var rp=require(_0x5d7f('0x4'));var moment=require(_0x5d7f('0x5'));var BPromise=require(_0x5d7f('0x6'));var Mustache=require(_0x5d7f('0x7'));var util=require(_0x5d7f('0x8'));var path=require(_0x5d7f('0x9'));var sox=require(_0x5d7f('0xa'));var csv=require(_0x5d7f('0xb'));var ejs=require(_0x5d7f('0xc'));var fs=require('fs');var _=require(_0x5d7f('0xd'));var squel=require(_0x5d7f('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d7f('0xf'));var toCsv=require(_0x5d7f('0xb'));var querystring=require(_0x5d7f('0x10'));var Papa=require('papaparse');var Redis=require(_0x5d7f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5d7f('0x12'));var as=require(_0x5d7f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d7f('0x14'))(_0x5d7f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5d7f('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x584f76,_0x31e657){_0x31e657=_0x31e657||0xcc;return function(_0x5b623f){if(_0x5b623f){return _0x584f76[_0x5d7f('0x17')](_0x31e657);}return _0x584f76['status'](_0x31e657)[_0x5d7f('0x18')]();};}function respondWithResult(_0x14d4bf,_0x20fafa){_0x20fafa=_0x20fafa||0xc8;return function(_0x118eda){if(_0x118eda){return _0x14d4bf[_0x5d7f('0x19')](_0x20fafa)[_0x5d7f('0x1a')](_0x118eda);}};}function respondWithFilteredResult(_0x91f0e3,_0x287de3){return function(_0x41c8cc){if(_0x41c8cc){var _0xd0fe7d=_0x41c8cc[_0x5d7f('0x1b')],_0x38f972=_0x287de3[_0x5d7f('0x1c')],_0xae28b9=_0x287de3['offset']+_0x287de3[_0x5d7f('0x1d')],_0x2e4194;if(_0xae28b9>=_0xd0fe7d){_0xae28b9=_0xd0fe7d;_0x2e4194=0xc8;}else{_0x2e4194=0xce;}_0x91f0e3[_0x5d7f('0x19')](_0x2e4194);return _0x91f0e3[_0x5d7f('0x1e')]('Content-Range',_0x38f972+'-'+_0xae28b9+'/'+_0xd0fe7d)[_0x5d7f('0x1a')](_0x41c8cc);}return null;};}function patchUpdates(_0x2e38d6){return function(_0x294670){try{jsonpatch['apply'](_0x294670,_0x2e38d6,!![]);}catch(_0x585959){return BPromise[_0x5d7f('0x1f')](_0x585959);}return _0x294670[_0x5d7f('0x20')]();};}function saveUpdates(_0x343ae8,_0x1ad4b0){return function(_0x276386){if(_0x276386){return _0x276386[_0x5d7f('0x21')](_0x343ae8)[_0x5d7f('0x22')](function(_0x4d0aca){return _0x4d0aca;});}return null;};}function removeEntity(_0x32a895,_0x256d82){return function(_0x4c23c8){if(_0x4c23c8){return _0x4c23c8[_0x5d7f('0x23')]()[_0x5d7f('0x22')](function(){var _0x5a9c80=_0x4c23c8[_0x5d7f('0x24')]({'plain':!![]});var _0x54bae4=_0x5d7f('0x25');return db[_0x5d7f('0x26')]['destroy']({'where':{'type':_0x54bae4,'resourceId':_0x5a9c80['id']}})['then'](function(){return _0x4c23c8;});})[_0x5d7f('0x22')](function(){_0x32a895[_0x5d7f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x219e10,_0x30a30f){return function(_0x1027ed){if(!_0x1027ed){_0x219e10[_0x5d7f('0x17')](0x194);}return _0x1027ed;};}function handleError(_0x18df35,_0x4a2bef){_0x4a2bef=_0x4a2bef||0x1f4;return function(_0x1c9e34){logger[_0x5d7f('0x27')](_0x1c9e34[_0x5d7f('0x28')]);if(_0x1c9e34[_0x5d7f('0x29')]){delete _0x1c9e34['name'];}_0x18df35[_0x5d7f('0x19')](_0x4a2bef)['send'](_0x1c9e34);};}exports['index']=function(_0x5001eb,_0x2791c0){var _0x2c443e={},_0x603ff4={},_0x483a6e={'count':0x0,'rows':[]};var _0x59c5ec=_[_0x5d7f('0x2a')](db[_0x5d7f('0x2b')][_0x5d7f('0x2c')],function(_0x9d7a10){return{'name':_0x9d7a10[_0x5d7f('0x2d')],'type':_0x9d7a10[_0x5d7f('0x2e')]['key']};});_0x603ff4['model']=_[_0x5d7f('0x2a')](_0x59c5ec,_0x5d7f('0x29'));_0x603ff4['query']=_['keys'](_0x5001eb[_0x5d7f('0x2f')]);_0x603ff4['filters']=_[_0x5d7f('0x30')](_0x603ff4['model'],_0x603ff4[_0x5d7f('0x2f')]);_0x2c443e[_0x5d7f('0x31')]=_[_0x5d7f('0x30')](_0x603ff4[_0x5d7f('0x32')],qs[_0x5d7f('0x33')](_0x5001eb['query'][_0x5d7f('0x33')]));_0x2c443e[_0x5d7f('0x31')]=_0x2c443e[_0x5d7f('0x31')]['length']?_0x2c443e[_0x5d7f('0x31')]:_0x603ff4['model'];if(!_0x5001eb[_0x5d7f('0x2f')][_0x5d7f('0x34')]('nolimit')){_0x2c443e[_0x5d7f('0x1d')]=qs[_0x5d7f('0x1d')](_0x5001eb[_0x5d7f('0x2f')][_0x5d7f('0x1d')]);_0x2c443e[_0x5d7f('0x1c')]=qs[_0x5d7f('0x1c')](_0x5001eb[_0x5d7f('0x2f')]['offset']);}_0x2c443e[_0x5d7f('0x35')]=qs[_0x5d7f('0x36')](_0x5001eb['query'][_0x5d7f('0x36')]);_0x2c443e[_0x5d7f('0x37')]=qs[_0x5d7f('0x38')](_[_0x5d7f('0x39')](_0x5001eb[_0x5d7f('0x2f')],_0x603ff4[_0x5d7f('0x38')]),_0x59c5ec);if(_0x5001eb[_0x5d7f('0x2f')]['filter']){_0x2c443e[_0x5d7f('0x37')]=_[_0x5d7f('0x3a')](_0x2c443e['where'],{'$or':_['map'](_0x59c5ec,function(_0x27e30c){if(_0x27e30c['type']!==_0x5d7f('0x3b')){var _0x27debf={};_0x27debf[_0x27e30c[_0x5d7f('0x29')]]={'$like':'%'+_0x5001eb[_0x5d7f('0x2f')]['filter']+'%'};return _0x27debf;}})});}_0x2c443e=_['merge']({},_0x2c443e,_0x5001eb[_0x5d7f('0x3c')]);var _0x441e4b={'where':_0x2c443e[_0x5d7f('0x37')]};return db['Interval'][_0x5d7f('0x1b')](_0x441e4b)[_0x5d7f('0x22')](function(_0x40f9df){_0x483a6e[_0x5d7f('0x1b')]=_0x40f9df;if(_0x5001eb['query'][_0x5d7f('0x3d')]){_0x2c443e['include']=[{'all':!![]}];}return db[_0x5d7f('0x2b')]['findAll'](_0x2c443e);})[_0x5d7f('0x22')](function(_0xaa378a){_0x483a6e[_0x5d7f('0x3e')]=_0xaa378a;return _0x483a6e;})[_0x5d7f('0x22')](respondWithFilteredResult(_0x2791c0,_0x2c443e))[_0x5d7f('0x3f')](handleError(_0x2791c0,null));};exports[_0x5d7f('0x40')]=function(_0x18175d,_0x4775a9){var _0x2899f8={'raw':!![],'where':{'id':_0x18175d[_0x5d7f('0x41')]['id']}},_0x4d30d1={};_0x4d30d1[_0x5d7f('0x32')]=_[_0x5d7f('0x42')](db[_0x5d7f('0x2b')][_0x5d7f('0x2c')]);_0x4d30d1['query']=_[_0x5d7f('0x42')](_0x18175d[_0x5d7f('0x2f')]);_0x4d30d1['filters']=_['intersection'](_0x4d30d1[_0x5d7f('0x32')],_0x4d30d1[_0x5d7f('0x2f')]);_0x2899f8[_0x5d7f('0x31')]=_[_0x5d7f('0x30')](_0x4d30d1[_0x5d7f('0x32')],qs[_0x5d7f('0x33')](_0x18175d['query'][_0x5d7f('0x33')]));_0x2899f8['attributes']=_0x2899f8[_0x5d7f('0x31')][_0x5d7f('0x43')]?_0x2899f8[_0x5d7f('0x31')]:_0x4d30d1[_0x5d7f('0x32')];if(_0x18175d[_0x5d7f('0x2f')][_0x5d7f('0x3d')]){_0x2899f8['include']=[{'all':!![]}];}_0x2899f8=_[_0x5d7f('0x3a')]({},_0x2899f8,_0x18175d['options']);return db[_0x5d7f('0x2b')]['find'](_0x2899f8)[_0x5d7f('0x22')](handleEntityNotFound(_0x4775a9,null))[_0x5d7f('0x22')](respondWithResult(_0x4775a9,null))['catch'](handleError(_0x4775a9,null));};exports[_0x5d7f('0x44')]=function(_0x5240e2,_0x343d1e){return db['Interval'][_0x5d7f('0x44')](_0x5240e2[_0x5d7f('0x45')],{})[_0x5d7f('0x22')](function(_0x2d46d5){var _0x16a165=_0x5240e2[_0x5d7f('0x46')][_0x5d7f('0x24')]({'plain':!![]});if(!_0x16a165)throw new Error(_0x5d7f('0x47'));if(_0x16a165[_0x5d7f('0x48')]===_0x5d7f('0x46')){var _0x17bba1=_0x2d46d5[_0x5d7f('0x24')]({'plain':!![]});var _0x449ab8=_0x5d7f('0x25');return db[_0x5d7f('0x49')][_0x5d7f('0x4a')]({'where':{'name':_0x449ab8,'userProfileId':_0x16a165[_0x5d7f('0x4b')]},'raw':!![]})[_0x5d7f('0x22')](function(_0x51efe9){if(_0x51efe9&&_0x51efe9['autoAssociation']===0x0){return db['UserProfileResource'][_0x5d7f('0x44')]({'name':_0x17bba1['name'],'resourceId':_0x17bba1['id'],'type':_0x51efe9[_0x5d7f('0x29')],'sectionId':_0x51efe9['id']},{})[_0x5d7f('0x22')](function(){return _0x2d46d5;});}else{return _0x2d46d5;}})['catch'](function(_0x16926b){logger[_0x5d7f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16926b);throw _0x16926b;});}return _0x2d46d5;})['then'](respondWithResult(_0x343d1e,0xc9))[_0x5d7f('0x3f')](handleError(_0x343d1e,null));};exports[_0x5d7f('0x21')]=function(_0x9d1e45,_0x2d1f8a){if(_0x9d1e45[_0x5d7f('0x45')]['id']){delete _0x9d1e45['body']['id'];}return db[_0x5d7f('0x2b')][_0x5d7f('0x4a')]({'where':{'id':_0x9d1e45['params']['id']}})['then'](handleEntityNotFound(_0x2d1f8a,null))['then'](saveUpdates(_0x9d1e45['body'],null))['then'](respondWithResult(_0x2d1f8a,null))[_0x5d7f('0x3f')](handleError(_0x2d1f8a,null));};exports[_0x5d7f('0x23')]=function(_0x44989b,_0x32045f){return db[_0x5d7f('0x2b')][_0x5d7f('0x4a')]({'where':{'id':_0x44989b[_0x5d7f('0x41')]['id']}})[_0x5d7f('0x22')](handleEntityNotFound(_0x32045f,null))[_0x5d7f('0x22')](removeEntity(_0x32045f,null))['catch'](handleError(_0x32045f,null));};exports[_0x5d7f('0x4c')]=function(_0x322439,_0x3a0052,_0x1ad33a){if(_0x322439['body']['id']){delete _0x322439['body']['id'];}return db['Interval'][_0x5d7f('0x4a')]({'where':{'id':_0x322439[_0x5d7f('0x41')]['id']}})[_0x5d7f('0x22')](handleEntityNotFound(_0x3a0052,null))[_0x5d7f('0x22')](function(_0x23c454){if(_0x23c454){_0x322439['body'][_0x5d7f('0x4d')]=_0x23c454['id'];return db[_0x5d7f('0x2b')][_0x5d7f('0x44')](_0x322439[_0x5d7f('0x45')]);}})[_0x5d7f('0x22')](respondWithResult(_0x3a0052,null))[_0x5d7f('0x3f')](handleError(_0x3a0052,null));};exports[_0x5d7f('0x4e')]=function(_0x366faf,_0x578da5,_0x57507b){var _0x2e29b0={};var _0x211be9={};var _0x43dcc4;var _0x29bdd2;return db['Interval']['findOne']({'where':{'id':_0x366faf[_0x5d7f('0x41')]['id']}})[_0x5d7f('0x22')](handleEntityNotFound(_0x578da5,null))['then'](function(_0x35e6f7){if(_0x35e6f7){_0x43dcc4=_0x35e6f7;_0x211be9['model']=_[_0x5d7f('0x42')](db['Interval'][_0x5d7f('0x2c')]);_0x211be9[_0x5d7f('0x2f')]=_[_0x5d7f('0x42')](_0x366faf[_0x5d7f('0x2f')]);_0x211be9[_0x5d7f('0x38')]=_[_0x5d7f('0x30')](_0x211be9['model'],_0x211be9[_0x5d7f('0x2f')]);_0x2e29b0[_0x5d7f('0x31')]=_['intersection'](_0x211be9[_0x5d7f('0x32')],qs['fields'](_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x33')]));_0x2e29b0['attributes']=_0x2e29b0[_0x5d7f('0x31')][_0x5d7f('0x43')]?_0x2e29b0[_0x5d7f('0x31')]:_0x211be9[_0x5d7f('0x32')];_0x2e29b0['order']=qs[_0x5d7f('0x36')](_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x36')]);_0x2e29b0[_0x5d7f('0x37')]=qs[_0x5d7f('0x38')](_[_0x5d7f('0x39')](_0x366faf[_0x5d7f('0x2f')],_0x211be9[_0x5d7f('0x38')]));if(_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x4f')]){_0x2e29b0[_0x5d7f('0x37')]=_['merge'](_0x2e29b0[_0x5d7f('0x37')],{'$or':_[_0x5d7f('0x2a')](_0x2e29b0[_0x5d7f('0x31')],function(_0x12ed88){var _0x2e4544={};_0x2e4544[_0x12ed88]={'$like':'%'+_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x4f')]+'%'};return _0x2e4544;})});}_0x2e29b0=_[_0x5d7f('0x3a')]({},_0x2e29b0,_0x366faf['options']);return _0x43dcc4[_0x5d7f('0x4e')](_0x2e29b0);}})[_0x5d7f('0x22')](function(_0x4ce96c){if(_0x4ce96c){_0x29bdd2=_0x4ce96c['length'];if(!_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x34')](_0x5d7f('0x50'))){_0x2e29b0[_0x5d7f('0x1d')]=qs[_0x5d7f('0x1d')](_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x1d')]);_0x2e29b0[_0x5d7f('0x1c')]=qs['offset'](_0x366faf[_0x5d7f('0x2f')][_0x5d7f('0x1c')]);}return _0x43dcc4[_0x5d7f('0x4e')](_0x2e29b0);}})[_0x5d7f('0x22')](function(_0x13df7d){if(_0x13df7d){return _0x13df7d?{'count':_0x29bdd2,'rows':_0x13df7d}:null;}})[_0x5d7f('0x22')](respondWithResult(_0x578da5,null))['catch'](handleError(_0x578da5,null));};exports[_0x5d7f('0x51')]=function(_0x3fd207,_0x2efd16,_0x335741){return db['Interval'][_0x5d7f('0x52')]({'where':{'id':_0x3fd207[_0x5d7f('0x41')]['id']}})[_0x5d7f('0x22')](handleEntityNotFound(_0x2efd16,null))['then'](function(_0x30a3e9){if(_0x30a3e9){return db['sequelize'][_0x5d7f('0x53')](function(_0x4793ae){return db[_0x5d7f('0x2b')][_0x5d7f('0x23')]({'where':{'IntervalId':_0x3fd207[_0x5d7f('0x41')]['id']},'transaction':_0x4793ae})[_0x5d7f('0x22')](function(_0x17ad79){var _0x47ad43=_['map'](_0x3fd207[_0x5d7f('0x45')],function(_0x3dddb9){delete _0x3dddb9['id'];_0x3dddb9['IntervalId']=_0x3fd207[_0x5d7f('0x41')]['id'];return _0x3dddb9;});return db[_0x5d7f('0x2b')][_0x5d7f('0x54')](_0x47ad43,{'transaction':_0x4793ae});});})[_0x5d7f('0x22')](function(){return db['Interval'][_0x5d7f('0x55')]({'where':{'IntervalId':_0x3fd207['params']['id']}});});}})['then'](respondWithResult(_0x2efd16,null))[_0x5d7f('0x3f')](handleError(_0x2efd16,null));}; \ No newline at end of file +var _0x99b8=['findAll','rows','catch','show','params','keys','create','body','user','role','get','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','order','addIntervals','transaction','bulkCreate','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Interval','includeAll','include'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x99b8,0x17a));var _0x899b=function(_0x5f4b10,_0xc0167e){_0x5f4b10=_0x5f4b10-0x0;var _0x537828=_0x99b8[_0x5f4b10];return _0x537828;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x899b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x899b('0x1'));var rp=require('request-promise');var moment=require(_0x899b('0x2'));var BPromise=require(_0x899b('0x3'));var Mustache=require(_0x899b('0x4'));var util=require(_0x899b('0x5'));var path=require(_0x899b('0x6'));var sox=require('sox');var csv=require(_0x899b('0x7'));var ejs=require(_0x899b('0x8'));var fs=require('fs');var _=require(_0x899b('0x9'));var squel=require(_0x899b('0xa'));var crypto=require(_0x899b('0xb'));var jsforce=require(_0x899b('0xc'));var deskjs=require(_0x899b('0xd'));var toCsv=require(_0x899b('0x7'));var querystring=require(_0x899b('0xe'));var Papa=require(_0x899b('0xf'));var Redis=require(_0x899b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x899b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x899b('0x12'));var logger=require('../../config/logger')(_0x899b('0x13'));var utils=require(_0x899b('0x14'));var config=require(_0x899b('0x15'));var db=require(_0x899b('0x16'))['db'];var extensions=require(_0x899b('0x17'));function respondWithStatusCode(_0x28f5c9,_0xcef35a){_0xcef35a=_0xcef35a||0xcc;return function(_0x2f6bdb){if(_0x2f6bdb){return _0x28f5c9[_0x899b('0x18')](_0xcef35a);}return _0x28f5c9['status'](_0xcef35a)[_0x899b('0x19')]();};}function respondWithResult(_0x17a3b9,_0x1121da){_0x1121da=_0x1121da||0xc8;return function(_0x508878){if(_0x508878){return _0x17a3b9[_0x899b('0x1a')](_0x1121da)[_0x899b('0x1b')](_0x508878);}};}function respondWithFilteredResult(_0x52dac1,_0x28aa33){return function(_0x3559d5){if(_0x3559d5){var _0x4eebd9=_0x3559d5[_0x899b('0x1c')],_0x49bb76=_0x28aa33[_0x899b('0x1d')],_0x72e3aa=_0x28aa33[_0x899b('0x1d')]+_0x28aa33[_0x899b('0x1e')],_0x1ba5a4;if(_0x72e3aa>=_0x4eebd9){_0x72e3aa=_0x4eebd9;_0x1ba5a4=0xc8;}else{_0x1ba5a4=0xce;}_0x52dac1['status'](_0x1ba5a4);return _0x52dac1[_0x899b('0x1f')](_0x899b('0x20'),_0x49bb76+'-'+_0x72e3aa+'/'+_0x4eebd9)[_0x899b('0x1b')](_0x3559d5);}return null;};}function patchUpdates(_0x5bf1f8){return function(_0x174daa){try{jsonpatch[_0x899b('0x21')](_0x174daa,_0x5bf1f8,!![]);}catch(_0x54dfbd){return BPromise[_0x899b('0x22')](_0x54dfbd);}return _0x174daa[_0x899b('0x23')]();};}function saveUpdates(_0xbe16e8,_0x569180){return function(_0x449692){if(_0x449692){return _0x449692[_0x899b('0x24')](_0xbe16e8)[_0x899b('0x25')](function(_0x259320){return _0x259320;});}return null;};}function removeEntity(_0x181a38,_0x2dfbc4){return function(_0x451d27){if(_0x451d27){return _0x451d27[_0x899b('0x26')]()[_0x899b('0x25')](function(){var _0x248bcc=_0x451d27['get']({'plain':!![]});var _0x4bf0ce=_0x899b('0x27');return db['UserProfileResource'][_0x899b('0x26')]({'where':{'type':_0x4bf0ce,'resourceId':_0x248bcc['id']}})[_0x899b('0x25')](function(){return _0x451d27;});})[_0x899b('0x25')](function(){_0x181a38['status'](0xcc)[_0x899b('0x19')]();});}};}function handleEntityNotFound(_0x29b203,_0x1188d2){return function(_0x25b2b3){if(!_0x25b2b3){_0x29b203[_0x899b('0x18')](0x194);}return _0x25b2b3;};}function handleError(_0x3d064c,_0x26016c){_0x26016c=_0x26016c||0x1f4;return function(_0x2edda8){logger[_0x899b('0x28')](_0x2edda8[_0x899b('0x29')]);if(_0x2edda8[_0x899b('0x2a')]){delete _0x2edda8['name'];}_0x3d064c['status'](_0x26016c)['send'](_0x2edda8);};}exports['index']=function(_0x2ad619,_0x4e22e9){var _0x4a8961={},_0x3db035={},_0x3ea219={'count':0x0,'rows':[]};var _0x42706b=_[_0x899b('0x2b')](db['Interval'][_0x899b('0x2c')],function(_0x403f3e){return{'name':_0x403f3e[_0x899b('0x2d')],'type':_0x403f3e[_0x899b('0x2e')][_0x899b('0x2f')]};});_0x3db035[_0x899b('0x30')]=_[_0x899b('0x2b')](_0x42706b,_0x899b('0x2a'));_0x3db035[_0x899b('0x31')]=_['keys'](_0x2ad619[_0x899b('0x31')]);_0x3db035[_0x899b('0x32')]=_[_0x899b('0x33')](_0x3db035[_0x899b('0x30')],_0x3db035['query']);_0x4a8961[_0x899b('0x34')]=_[_0x899b('0x33')](_0x3db035[_0x899b('0x30')],qs[_0x899b('0x35')](_0x2ad619['query'][_0x899b('0x35')]));_0x4a8961[_0x899b('0x34')]=_0x4a8961[_0x899b('0x34')][_0x899b('0x36')]?_0x4a8961['attributes']:_0x3db035[_0x899b('0x30')];if(!_0x2ad619[_0x899b('0x31')][_0x899b('0x37')](_0x899b('0x38'))){_0x4a8961[_0x899b('0x1e')]=qs['limit'](_0x2ad619['query'][_0x899b('0x1e')]);_0x4a8961['offset']=qs['offset'](_0x2ad619['query']['offset']);}_0x4a8961['order']=qs[_0x899b('0x39')](_0x2ad619[_0x899b('0x31')]['sort']);_0x4a8961['where']=qs['filters'](_[_0x899b('0x3a')](_0x2ad619['query'],_0x3db035[_0x899b('0x32')]),_0x42706b);if(_0x2ad619[_0x899b('0x31')][_0x899b('0x3b')]){_0x4a8961[_0x899b('0x3c')]=_[_0x899b('0x3d')](_0x4a8961['where'],{'$or':_[_0x899b('0x2b')](_0x42706b,function(_0x579e9b){if(_0x579e9b[_0x899b('0x2e')]!==_0x899b('0x3e')){var _0x222669={};_0x222669[_0x579e9b[_0x899b('0x2a')]]={'$like':'%'+_0x2ad619['query']['filter']+'%'};return _0x222669;}})});}_0x4a8961=_['merge']({},_0x4a8961,_0x2ad619[_0x899b('0x3f')]);var _0x33e072={'where':_0x4a8961[_0x899b('0x3c')]};return db[_0x899b('0x40')]['count'](_0x33e072)[_0x899b('0x25')](function(_0x4f1e15){_0x3ea219[_0x899b('0x1c')]=_0x4f1e15;if(_0x2ad619[_0x899b('0x31')][_0x899b('0x41')]){_0x4a8961[_0x899b('0x42')]=[{'all':!![]}];}return db[_0x899b('0x40')][_0x899b('0x43')](_0x4a8961);})[_0x899b('0x25')](function(_0x177845){_0x3ea219[_0x899b('0x44')]=_0x177845;return _0x3ea219;})[_0x899b('0x25')](respondWithFilteredResult(_0x4e22e9,_0x4a8961))[_0x899b('0x45')](handleError(_0x4e22e9,null));};exports[_0x899b('0x46')]=function(_0x19b25a,_0x396255){var _0x55de39={'raw':!![],'where':{'id':_0x19b25a[_0x899b('0x47')]['id']}},_0x5ae5ba={};_0x5ae5ba['model']=_[_0x899b('0x48')](db[_0x899b('0x40')]['rawAttributes']);_0x5ae5ba[_0x899b('0x31')]=_[_0x899b('0x48')](_0x19b25a[_0x899b('0x31')]);_0x5ae5ba[_0x899b('0x32')]=_[_0x899b('0x33')](_0x5ae5ba[_0x899b('0x30')],_0x5ae5ba['query']);_0x55de39[_0x899b('0x34')]=_[_0x899b('0x33')](_0x5ae5ba['model'],qs['fields'](_0x19b25a[_0x899b('0x31')]['fields']));_0x55de39[_0x899b('0x34')]=_0x55de39[_0x899b('0x34')][_0x899b('0x36')]?_0x55de39[_0x899b('0x34')]:_0x5ae5ba[_0x899b('0x30')];if(_0x19b25a[_0x899b('0x31')][_0x899b('0x41')]){_0x55de39['include']=[{'all':!![]}];}_0x55de39=_[_0x899b('0x3d')]({},_0x55de39,_0x19b25a['options']);return db[_0x899b('0x40')]['find'](_0x55de39)[_0x899b('0x25')](handleEntityNotFound(_0x396255,null))[_0x899b('0x25')](respondWithResult(_0x396255,null))[_0x899b('0x45')](handleError(_0x396255,null));};exports[_0x899b('0x49')]=function(_0xa8077f,_0x22889b){return db['Interval']['create'](_0xa8077f[_0x899b('0x4a')],{})['then'](function(_0x352f6d){var _0x5ddbd8=_0xa8077f[_0x899b('0x4b')]['get']({'plain':!![]});if(!_0x5ddbd8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ddbd8[_0x899b('0x4c')]===_0x899b('0x4b')){var _0x4f5d26=_0x352f6d[_0x899b('0x4d')]({'plain':!![]});var _0x352eaa=_0x899b('0x27');return db['UserProfileSection'][_0x899b('0x4e')]({'where':{'name':_0x352eaa,'userProfileId':_0x5ddbd8['userProfileId']},'raw':!![]})[_0x899b('0x25')](function(_0x5544db){if(_0x5544db&&_0x5544db[_0x899b('0x4f')]===0x0){return db[_0x899b('0x50')]['create']({'name':_0x4f5d26[_0x899b('0x2a')],'resourceId':_0x4f5d26['id'],'type':_0x5544db[_0x899b('0x2a')],'sectionId':_0x5544db['id']},{})[_0x899b('0x25')](function(){return _0x352f6d;});}else{return _0x352f6d;}})[_0x899b('0x45')](function(_0x47b263){logger[_0x899b('0x28')](_0x899b('0x51'),_0x47b263);throw _0x47b263;});}return _0x352f6d;})['then'](respondWithResult(_0x22889b,0xc9))[_0x899b('0x45')](handleError(_0x22889b,null));};exports[_0x899b('0x24')]=function(_0x6e586a,_0x342fe0){if(_0x6e586a[_0x899b('0x4a')]['id']){delete _0x6e586a['body']['id'];}return db[_0x899b('0x40')][_0x899b('0x4e')]({'where':{'id':_0x6e586a['params']['id']}})[_0x899b('0x25')](handleEntityNotFound(_0x342fe0,null))[_0x899b('0x25')](saveUpdates(_0x6e586a['body'],null))[_0x899b('0x25')](respondWithResult(_0x342fe0,null))[_0x899b('0x45')](handleError(_0x342fe0,null));};exports[_0x899b('0x26')]=function(_0x2d1290,_0x52f8f9){return db[_0x899b('0x40')][_0x899b('0x4e')]({'where':{'id':_0x2d1290[_0x899b('0x47')]['id']}})['then'](handleEntityNotFound(_0x52f8f9,null))[_0x899b('0x25')](removeEntity(_0x52f8f9,null))[_0x899b('0x45')](handleError(_0x52f8f9,null));};exports['addInterval']=function(_0x464246,_0x2d4e07,_0x3ae986){if(_0x464246[_0x899b('0x4a')]['id']){delete _0x464246[_0x899b('0x4a')]['id'];}return db[_0x899b('0x40')][_0x899b('0x4e')]({'where':{'id':_0x464246[_0x899b('0x47')]['id']}})[_0x899b('0x25')](handleEntityNotFound(_0x2d4e07,null))[_0x899b('0x25')](function(_0x2861b6){if(_0x2861b6){_0x464246[_0x899b('0x4a')][_0x899b('0x52')]=_0x2861b6['id'];return db[_0x899b('0x40')][_0x899b('0x49')](_0x464246[_0x899b('0x4a')]);}})['then'](respondWithResult(_0x2d4e07,null))[_0x899b('0x45')](handleError(_0x2d4e07,null));};exports[_0x899b('0x53')]=function(_0x5c0dff,_0x5921e3,_0x9eb141){var _0x3630de={};var _0x33a6ab={};var _0x3971d5;var _0x1170dc;return db[_0x899b('0x40')][_0x899b('0x54')]({'where':{'id':_0x5c0dff[_0x899b('0x47')]['id']}})[_0x899b('0x25')](handleEntityNotFound(_0x5921e3,null))[_0x899b('0x25')](function(_0x188863){if(_0x188863){_0x3971d5=_0x188863;_0x33a6ab[_0x899b('0x30')]=_[_0x899b('0x48')](db[_0x899b('0x40')]['rawAttributes']);_0x33a6ab[_0x899b('0x31')]=_['keys'](_0x5c0dff[_0x899b('0x31')]);_0x33a6ab['filters']=_['intersection'](_0x33a6ab[_0x899b('0x30')],_0x33a6ab[_0x899b('0x31')]);_0x3630de[_0x899b('0x34')]=_[_0x899b('0x33')](_0x33a6ab[_0x899b('0x30')],qs[_0x899b('0x35')](_0x5c0dff['query'][_0x899b('0x35')]));_0x3630de[_0x899b('0x34')]=_0x3630de[_0x899b('0x34')][_0x899b('0x36')]?_0x3630de[_0x899b('0x34')]:_0x33a6ab[_0x899b('0x30')];_0x3630de[_0x899b('0x55')]=qs[_0x899b('0x39')](_0x5c0dff[_0x899b('0x31')][_0x899b('0x39')]);_0x3630de[_0x899b('0x3c')]=qs[_0x899b('0x32')](_[_0x899b('0x3a')](_0x5c0dff['query'],_0x33a6ab['filters']));if(_0x5c0dff[_0x899b('0x31')][_0x899b('0x3b')]){_0x3630de['where']=_[_0x899b('0x3d')](_0x3630de[_0x899b('0x3c')],{'$or':_[_0x899b('0x2b')](_0x3630de[_0x899b('0x34')],function(_0x469ec7){var _0x14346c={};_0x14346c[_0x469ec7]={'$like':'%'+_0x5c0dff[_0x899b('0x31')][_0x899b('0x3b')]+'%'};return _0x14346c;})});}_0x3630de=_['merge']({},_0x3630de,_0x5c0dff[_0x899b('0x3f')]);return _0x3971d5['getIntervals'](_0x3630de);}})[_0x899b('0x25')](function(_0x1c9a0b){if(_0x1c9a0b){_0x1170dc=_0x1c9a0b[_0x899b('0x36')];if(!_0x5c0dff['query']['hasOwnProperty'](_0x899b('0x38'))){_0x3630de[_0x899b('0x1e')]=qs[_0x899b('0x1e')](_0x5c0dff[_0x899b('0x31')]['limit']);_0x3630de[_0x899b('0x1d')]=qs[_0x899b('0x1d')](_0x5c0dff[_0x899b('0x31')][_0x899b('0x1d')]);}return _0x3971d5[_0x899b('0x53')](_0x3630de);}})[_0x899b('0x25')](function(_0x579eb7){if(_0x579eb7){return _0x579eb7?{'count':_0x1170dc,'rows':_0x579eb7}:null;}})[_0x899b('0x25')](respondWithResult(_0x5921e3,null))[_0x899b('0x45')](handleError(_0x5921e3,null));};exports[_0x899b('0x56')]=function(_0x15a48d,_0x369a42,_0x165ffc){return db[_0x899b('0x40')][_0x899b('0x54')]({'where':{'id':_0x15a48d[_0x899b('0x47')]['id']}})[_0x899b('0x25')](handleEntityNotFound(_0x369a42,null))[_0x899b('0x25')](function(_0x7cda0e){if(_0x7cda0e){return db['sequelize'][_0x899b('0x57')](function(_0x2e3512){return db[_0x899b('0x40')][_0x899b('0x26')]({'where':{'IntervalId':_0x15a48d[_0x899b('0x47')]['id']},'transaction':_0x2e3512})['then'](function(_0x19634e){var _0x174ccf=_['map'](_0x15a48d[_0x899b('0x4a')],function(_0x368146){delete _0x368146['id'];_0x368146[_0x899b('0x52')]=_0x15a48d[_0x899b('0x47')]['id'];return _0x368146;});return db[_0x899b('0x40')][_0x899b('0x58')](_0x174ccf,{'transaction':_0x2e3512});});})['then'](function(){return db[_0x899b('0x40')][_0x899b('0x43')]({'where':{'IntervalId':_0x15a48d['params']['id']}});});}})[_0x899b('0x25')](respondWithResult(_0x369a42,null))['catch'](handleError(_0x369a42,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 12ad9c8..4cbfb58 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 _0x61a5=['api','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','../../config/logger'];(function(_0x1c913d,_0x42beef){var _0x1c78b0=function(_0x12f1ef){while(--_0x12f1ef){_0x1c913d['push'](_0x1c913d['shift']());}};_0x1c78b0(++_0x42beef);}(_0x61a5,0x19e));var _0x561a=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0x61a5[_0xffd1b5];return _0x3176d6;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var logger=require(_0x561a('0x1'))(_0x561a('0x2'));var moment=require('moment');var BPromise=require(_0x561a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x561a('0x4'));var rimraf=require(_0x561a('0x5'));var config=require(_0x561a('0x6'));var attributes=require(_0x561a('0x7'));var extensions=require(_0x561a('0x8'));module[_0x561a('0x9')]=function(_0x1e2ce1,_0x2a763a){return _0x1e2ce1['define'](_0x561a('0xa'),attributes,{'tableName':_0x561a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe056b2,_0x5cd4f6){extensions[_0x561a('0xc')](_0x1e2ce1,_0xe056b2);},'afterBulkCreate':function(_0x2a0fdb,_0x5a4e9b,_0x44b705){_0x44b705();extensions[_0x561a('0xc')](_0x1e2ce1,_0x2a0fdb[0x0]);},'afterUpdate':function(_0x139208,_0x41a34a){extensions['rewrite'](_0x1e2ce1,_0x139208);},'afterDestroy':function(_0x52759e,_0x20c1f8){extensions[_0x561a('0xc')](_0x1e2ce1,_0x52759e);}}});}; \ No newline at end of file +var _0x50c1=['path','rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite','lodash','../../config/logger','moment','bluebird'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0x50c1,0x1b6));var _0x150c=function(_0xf48e4f,_0xf3ad9a){_0xf48e4f=_0xf48e4f-0x0;var _0x551087=_0x50c1[_0xf48e4f];return _0x551087;};'use strict';var _=require(_0x150c('0x0'));var util=require('util');var logger=require(_0x150c('0x1'))('api');var moment=require(_0x150c('0x2'));var BPromise=require(_0x150c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x150c('0x4'));var rimraf=require(_0x150c('0x5'));var config=require(_0x150c('0x6'));var attributes=require(_0x150c('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x150c('0x8')]=function(_0x11317c,_0x4ae5a9){return _0x11317c[_0x150c('0x9')](_0x150c('0xa'),attributes,{'tableName':_0x150c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x337c30,_0x51f6fc){extensions[_0x150c('0xc')](_0x11317c,_0x337c30);},'afterBulkCreate':function(_0x155526,_0x10959d,_0x3bb377){_0x3bb377();extensions[_0x150c('0xc')](_0x11317c,_0x155526[0x0]);},'afterUpdate':function(_0x33781b,_0x176356){extensions['rewrite'](_0x11317c,_0x33781b);},'afterDestroy':function(_0x30c973,_0x4d96ed){extensions['rewrite'](_0x11317c,_0x30c973);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index fba8d38..75026c6 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 _0x3e94=['message','info','result','GetInterval','Interval','findAll','options','raw','where','limit','map','include','model','attributes','then','catch','find','ShowInterval','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','Interval,\x20%s,\x20%s'];(function(_0xa7efcc,_0x5600bf){var _0x2e6497=function(_0x91e738){while(--_0x91e738){_0xa7efcc['push'](_0xa7efcc['shift']());}};_0x2e6497(++_0x5600bf);}(_0x3e94,0x1e6));var _0x43e9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3e94[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43e9('0x2'));var fs=require('fs');var Redis=require(_0x43e9('0x3'));var db=require(_0x43e9('0x4'))['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))('rpc');var config=require(_0x43e9('0x7'));var jayson=require(_0x43e9('0x8'));var client=jayson[_0x43e9('0x9')][_0x43e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40045a,_0x4fc2f0,_0x4c8fcf){return new BPromise(function(_0x2aea7b,_0x1840c3){return client['request'](_0x40045a,_0x4c8fcf)['then'](function(_0x5e3a9b){logger['info']('Interval,\x20%s,\x20%s',_0x4fc2f0,_0x43e9('0xb'));logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x4fc2f0,_0x43e9('0xb'),JSON[_0x43e9('0xe')](_0x5e3a9b));if(_0x5e3a9b[_0x43e9('0xf')]){if(_0x5e3a9b[_0x43e9('0xf')][_0x43e9('0x10')]===0x1f4){logger['error'](_0x43e9('0x11'),_0x4fc2f0,_0x5e3a9b[_0x43e9('0xf')][_0x43e9('0x12')]);return _0x1840c3(_0x5e3a9b[_0x43e9('0xf')][_0x43e9('0x12')]);}logger[_0x43e9('0xf')](_0x43e9('0x11'),_0x4fc2f0,_0x5e3a9b[_0x43e9('0xf')][_0x43e9('0x12')]);return _0x2aea7b(_0x5e3a9b[_0x43e9('0xf')]['message']);}else{logger[_0x43e9('0x13')]('Interval,\x20%s,\x20%s',_0x4fc2f0,_0x43e9('0xb'));_0x2aea7b(_0x5e3a9b[_0x43e9('0x14')][_0x43e9('0x12')]);}})['catch'](function(_0x2e6376){logger[_0x43e9('0xf')](_0x43e9('0x11'),_0x4fc2f0,_0x2e6376);_0x1840c3(_0x2e6376);});});}exports[_0x43e9('0x15')]=function(_0x2e4179){var _0x544a07=this;return new Promise(function(_0xdde161,_0x1dd6e4){return db[_0x43e9('0x16')][_0x43e9('0x17')]({'raw':_0x2e4179[_0x43e9('0x18')]?_0x2e4179[_0x43e9('0x18')][_0x43e9('0x19')]===undefined?!![]:![]:!![],'where':_0x2e4179[_0x43e9('0x18')]?_0x2e4179[_0x43e9('0x18')][_0x43e9('0x1a')]||null:null,'attributes':_0x2e4179[_0x43e9('0x18')]?_0x2e4179[_0x43e9('0x18')]['attributes']||null:null,'limit':_0x2e4179[_0x43e9('0x18')]?_0x2e4179['options'][_0x43e9('0x1b')]||null:null,'include':_0x2e4179[_0x43e9('0x18')]?_0x2e4179[_0x43e9('0x18')]['include']?_[_0x43e9('0x1c')](_0x2e4179[_0x43e9('0x18')][_0x43e9('0x1d')],function(_0x1e5d31){return{'model':db[_0x1e5d31[_0x43e9('0x1e')]],'as':_0x1e5d31['as'],'attributes':_0x1e5d31['attributes'],'include':_0x1e5d31[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x1e5d31[_0x43e9('0x1d')],function(_0x29348e){return{'model':db[_0x29348e[_0x43e9('0x1e')]],'as':_0x29348e['as'],'attributes':_0x29348e[_0x43e9('0x1f')],'include':_0x29348e['include']?_[_0x43e9('0x1c')](_0x29348e['include'],function(_0x3a34cd){return{'model':db[_0x3a34cd[_0x43e9('0x1e')]],'as':_0x3a34cd['as'],'attributes':_0x3a34cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e9('0x20')](function(_0x2e445c){logger[_0x43e9('0x13')]('GetInterval',_0x2e4179);logger[_0x43e9('0xc')]('GetInterval',_0x2e4179,JSON[_0x43e9('0xe')](_0x2e445c));_0xdde161(_0x2e445c);})[_0x43e9('0x21')](function(_0x2a8cee){logger[_0x43e9('0xf')]('GetInterval',_0x2a8cee[_0x43e9('0x12')],_0x2e4179);_0x1dd6e4(_0x544a07['error'](0x1f4,_0x2a8cee[_0x43e9('0x12')]));});});};exports['ShowInterval']=function(_0xbf7fcc){var _0x4683f1=this;return new Promise(function(_0x422251,_0x41b50c){return db[_0x43e9('0x16')][_0x43e9('0x22')]({'raw':_0xbf7fcc[_0x43e9('0x18')]?_0xbf7fcc[_0x43e9('0x18')][_0x43e9('0x19')]===undefined?!![]:![]:!![],'where':_0xbf7fcc[_0x43e9('0x18')]?_0xbf7fcc['options'][_0x43e9('0x1a')]||null:null,'attributes':_0xbf7fcc[_0x43e9('0x18')]?_0xbf7fcc[_0x43e9('0x18')][_0x43e9('0x1f')]||null:null,'include':_0xbf7fcc['options']?_0xbf7fcc[_0x43e9('0x18')][_0x43e9('0x1d')]?_['map'](_0xbf7fcc[_0x43e9('0x18')]['include'],function(_0x4364a8){return{'model':db[_0x4364a8[_0x43e9('0x1e')]],'as':_0x4364a8['as'],'attributes':_0x4364a8['attributes'],'include':_0x4364a8[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x4364a8[_0x43e9('0x1d')],function(_0x24e9d5){return{'model':db[_0x24e9d5[_0x43e9('0x1e')]],'as':_0x24e9d5['as'],'attributes':_0x24e9d5[_0x43e9('0x1f')],'include':_0x24e9d5[_0x43e9('0x1d')]?_['map'](_0x24e9d5[_0x43e9('0x1d')],function(_0x50a216){return{'model':db[_0x50a216[_0x43e9('0x1e')]],'as':_0x50a216['as'],'attributes':_0x50a216['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e9('0x20')](function(_0x31eee7){logger['info'](_0x43e9('0x23'),_0xbf7fcc);logger['debug'](_0x43e9('0x23'),_0xbf7fcc,JSON[_0x43e9('0xe')](_0x31eee7));_0x422251(_0x31eee7);})[_0x43e9('0x21')](function(_0x1b62ac){logger['error'](_0x43e9('0x23'),_0x1b62ac[_0x43e9('0x12')],_0xbf7fcc);_0x41b50c(_0x4683f1[_0x43e9('0xf')](0x1f4,_0x1b62ac[_0x43e9('0x12')]));});});}; \ No newline at end of file +var _0xba98=['message','result','GetInterval','options','raw','where','attributes','include','map','model','catch','ShowInterval','Interval','find','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','Interval,\x20%s,\x20%s'];(function(_0x3e74d4,_0xfeb53){var _0x38adee=function(_0x563c28){while(--_0x563c28){_0x3e74d4['push'](_0x3e74d4['shift']());}};_0x38adee(++_0xfeb53);}(_0xba98,0xbe));var _0x8ba9=function(_0x86368e,_0xc560fe){_0x86368e=_0x86368e-0x0;var _0x213d24=_0xba98[_0x86368e];return _0x213d24;};'use strict';var _=require(_0x8ba9('0x0'));var util=require('util');var moment=require(_0x8ba9('0x1'));var BPromise=require(_0x8ba9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ba9('0x3'));var db=require(_0x8ba9('0x4'))['db'];var utils=require(_0x8ba9('0x5'));var logger=require(_0x8ba9('0x6'))(_0x8ba9('0x7'));var config=require(_0x8ba9('0x8'));var jayson=require(_0x8ba9('0x9'));var client=jayson[_0x8ba9('0xa')][_0x8ba9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff204,_0x199cff,_0x5e8506){return new BPromise(function(_0x205101,_0x1cfea7){return client[_0x8ba9('0xc')](_0x3ff204,_0x5e8506)[_0x8ba9('0xd')](function(_0xf6b245){logger[_0x8ba9('0xe')]('Interval,\x20%s,\x20%s',_0x199cff,_0x8ba9('0xf'));logger['debug']('Interval,\x20%s,\x20%s,\x20%s',_0x199cff,_0x8ba9('0xf'),JSON[_0x8ba9('0x10')](_0xf6b245));if(_0xf6b245[_0x8ba9('0x11')]){if(_0xf6b245[_0x8ba9('0x11')][_0x8ba9('0x12')]===0x1f4){logger[_0x8ba9('0x11')](_0x8ba9('0x13'),_0x199cff,_0xf6b245[_0x8ba9('0x11')][_0x8ba9('0x14')]);return _0x1cfea7(_0xf6b245[_0x8ba9('0x11')]['message']);}logger['error'](_0x8ba9('0x13'),_0x199cff,_0xf6b245[_0x8ba9('0x11')]['message']);return _0x205101(_0xf6b245[_0x8ba9('0x11')][_0x8ba9('0x14')]);}else{logger[_0x8ba9('0xe')](_0x8ba9('0x13'),_0x199cff,'request\x20sent');_0x205101(_0xf6b245[_0x8ba9('0x15')][_0x8ba9('0x14')]);}})['catch'](function(_0x29926a){logger[_0x8ba9('0x11')]('Interval,\x20%s,\x20%s',_0x199cff,_0x29926a);_0x1cfea7(_0x29926a);});});}exports[_0x8ba9('0x16')]=function(_0x330de7){var _0x527464=this;return new Promise(function(_0xb42a64,_0x246288){return db['Interval']['findAll']({'raw':_0x330de7['options']?_0x330de7[_0x8ba9('0x17')][_0x8ba9('0x18')]===undefined?!![]:![]:!![],'where':_0x330de7[_0x8ba9('0x17')]?_0x330de7['options'][_0x8ba9('0x19')]||null:null,'attributes':_0x330de7['options']?_0x330de7[_0x8ba9('0x17')][_0x8ba9('0x1a')]||null:null,'limit':_0x330de7[_0x8ba9('0x17')]?_0x330de7[_0x8ba9('0x17')]['limit']||null:null,'include':_0x330de7[_0x8ba9('0x17')]?_0x330de7['options'][_0x8ba9('0x1b')]?_[_0x8ba9('0x1c')](_0x330de7[_0x8ba9('0x17')][_0x8ba9('0x1b')],function(_0x59a2e6){return{'model':db[_0x59a2e6[_0x8ba9('0x1d')]],'as':_0x59a2e6['as'],'attributes':_0x59a2e6[_0x8ba9('0x1a')],'include':_0x59a2e6[_0x8ba9('0x1b')]?_[_0x8ba9('0x1c')](_0x59a2e6['include'],function(_0x1f39bd){return{'model':db[_0x1f39bd[_0x8ba9('0x1d')]],'as':_0x1f39bd['as'],'attributes':_0x1f39bd['attributes'],'include':_0x1f39bd[_0x8ba9('0x1b')]?_['map'](_0x1f39bd['include'],function(_0x55dbc3){return{'model':db[_0x55dbc3[_0x8ba9('0x1d')]],'as':_0x55dbc3['as'],'attributes':_0x55dbc3['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ba9('0xd')](function(_0x38931d){logger['info']('GetInterval',_0x330de7);logger['debug'](_0x8ba9('0x16'),_0x330de7,JSON['stringify'](_0x38931d));_0xb42a64(_0x38931d);})[_0x8ba9('0x1e')](function(_0x1ffb6b){logger[_0x8ba9('0x11')]('GetInterval',_0x1ffb6b[_0x8ba9('0x14')],_0x330de7);_0x246288(_0x527464[_0x8ba9('0x11')](0x1f4,_0x1ffb6b[_0x8ba9('0x14')]));});});};exports[_0x8ba9('0x1f')]=function(_0x569393){var _0x5a8932=this;return new Promise(function(_0x2c9e05,_0x57030c){return db[_0x8ba9('0x20')][_0x8ba9('0x21')]({'raw':_0x569393['options']?_0x569393['options'][_0x8ba9('0x18')]===undefined?!![]:![]:!![],'where':_0x569393[_0x8ba9('0x17')]?_0x569393['options'][_0x8ba9('0x19')]||null:null,'attributes':_0x569393[_0x8ba9('0x17')]?_0x569393['options']['attributes']||null:null,'include':_0x569393[_0x8ba9('0x17')]?_0x569393[_0x8ba9('0x17')][_0x8ba9('0x1b')]?_['map'](_0x569393[_0x8ba9('0x17')][_0x8ba9('0x1b')],function(_0x4d9f18){return{'model':db[_0x4d9f18[_0x8ba9('0x1d')]],'as':_0x4d9f18['as'],'attributes':_0x4d9f18[_0x8ba9('0x1a')],'include':_0x4d9f18[_0x8ba9('0x1b')]?_['map'](_0x4d9f18[_0x8ba9('0x1b')],function(_0x132abc){return{'model':db[_0x132abc[_0x8ba9('0x1d')]],'as':_0x132abc['as'],'attributes':_0x132abc[_0x8ba9('0x1a')],'include':_0x132abc[_0x8ba9('0x1b')]?_[_0x8ba9('0x1c')](_0x132abc[_0x8ba9('0x1b')],function(_0x49d795){return{'model':db[_0x49d795['model']],'as':_0x49d795['as'],'attributes':_0x49d795[_0x8ba9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x184c3b){logger[_0x8ba9('0xe')](_0x8ba9('0x1f'),_0x569393);logger[_0x8ba9('0x22')](_0x8ba9('0x1f'),_0x569393,JSON[_0x8ba9('0x10')](_0x184c3b));_0x2c9e05(_0x184c3b);})[_0x8ba9('0x1e')](function(_0x2d7fc4){logger[_0x8ba9('0x11')]('ShowInterval',_0x2d7fc4[_0x8ba9('0x14')],_0x569393);_0x57030c(_0x5a8932['error'](0x1f4,_0x2d7fc4[_0x8ba9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ded5326..56fef7a 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 _0xe85c=['send','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe85c,0x103));var _0xce85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe85c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xce85('0x0'));var router=express[_0xce85('0x1')]();var auth=require(_0xce85('0x2'));var controller=require(_0xce85('0x3'));router[_0xce85('0x4')]('/',auth['isAuthenticated'](),controller[_0xce85('0x5')]);module['exports']=router; \ No newline at end of file +var _0x320f=['../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports','express','Router'];(function(_0x487bd5,_0x15f486){var _0x3e32bf=function(_0x3a4d49){while(--_0x3a4d49){_0x487bd5['push'](_0x487bd5['shift']());}};_0x3e32bf(++_0x15f486);}(_0x320f,0x11e));var _0xf320=function(_0x458043,_0x23b1ea){_0x458043=_0x458043-0x0;var _0x1a1635=_0x320f[_0x458043];return _0x1a1635;};'use strict';var express=require(_0xf320('0x0'));var router=express[_0xf320('0x1')]();var auth=require(_0xf320('0x2'));var controller=require(_0xf320('0x3'));router[_0xf320('0x4')]('/',auth[_0xf320('0x5')](),controller[_0xf320('0x6')]);module[_0xf320('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b60dc98..3c074b1 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 _0x92f7=['api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','Basic\x20','toString','request','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','https'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x92f7,0xa7));var _0x792f=function(_0xd281e2,_0x5b9fc4){_0xd281e2=_0xd281e2-0x0;var _0xfbc4e1=_0x92f7[_0xd281e2];return _0xfbc4e1;};'use strict';var BPromise=require('bluebird');var https=require(_0x792f('0x0'));var logger=require('../../config/logger')(_0x792f('0x1'));var USERNAME='support';var PASSWORD=_0x792f('0x2');function openIssue(_0x553b22,_0x3b5981){var _0x35e47f={'fields':{'project':{'key':_0x553b22[_0x792f('0x3')]||_0x792f('0x4')},'summary':(_0x553b22[_0x792f('0x5')]||_0x792f('0x6'))+_0x792f('0x7')+_0x553b22['ip'],'description':_0x553b22['description']||JSON[_0x792f('0x8')](_0x553b22),'issuetype':{'name':_0x553b22[_0x792f('0x9')]||_0x792f('0xa')}}};_0x35e47f[_0x792f('0xb')][_0x792f('0xc')]=_0x553b22[_0x792f('0xd')];_0x35e47f[_0x792f('0xb')]['customfield_11501']=_0x553b22[_0x792f('0xe')];_0x35e47f[_0x792f('0xb')][_0x792f('0xf')]=_0x553b22[_0x792f('0x10')];_0x35e47f[_0x792f('0xb')][_0x792f('0x11')]=_0x553b22[_0x792f('0x12')];_0x35e47f[_0x792f('0xb')]['customfield_11504']=_0x553b22[_0x792f('0x13')];_0x35e47f[_0x792f('0xb')][_0x792f('0x14')]=_0x553b22['ip'];var _0x4d8811={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x792f('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x792f('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x792f('0x17')]('base64')}};var _0x218914=JSON['stringify'](_0x35e47f);var _0x547b6f=https[_0x792f('0x18')](_0x4d8811,function(_0x181f79){_0x181f79[_0x792f('0x19')](_0x792f('0x1a'));var _0x57d23d='';_0x181f79['on'](_0x792f('0x1b'),function(_0x4447c6){_0x57d23d+=_0x4447c6;});_0x181f79['on'](_0x792f('0x1c'),function(){if(_0x3b5981){return _0x3b5981[_0x792f('0x1d')](_0x181f79['statusCode'])[_0x792f('0x1e')](JSON[_0x792f('0x1f')](_0x57d23d));}});});_0x547b6f['on'](_0x792f('0x20'),function(_0x36a7fe){if(_0x3b5981){return _0x3b5981[_0x792f('0x1d')](0x1f4)[_0x792f('0x1e')]({'errors':[{'message':_0x792f('0x21'),'type':'api.jira'}]});}});_0x547b6f['write'](_0x218914);_0x547b6f[_0x792f('0x1c')]();}exports[_0x792f('0x22')]=openIssue;exports[_0x792f('0x23')]=function(_0x3f0ee1,_0x33a580){_0x3f0ee1[_0x792f('0x24')]['ip']=_0x3f0ee1[_0x792f('0x25')][_0x792f('0x26')]||_0x3f0ee1['connection'][_0x792f('0x27')]||_0x3f0ee1[_0x792f('0x28')]['remoteAddress']||_0x3f0ee1[_0x792f('0x29')][_0x792f('0x28')][_0x792f('0x27')];return openIssue(_0x3f0ee1['body'],_0x33a580);}; \ No newline at end of file +var _0x08b3=['fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','base64','request','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','x-forwarded-for','remoteAddress','connection','socket','https','api','key','MOTGUI','summary','Report','\x20from\x20','issuetype','Bug'];(function(_0xb8a668,_0x1868ce){var _0x52e5a6=function(_0x9f2b90){while(--_0x9f2b90){_0xb8a668['push'](_0xb8a668['shift']());}};_0x52e5a6(++_0x1868ce);}(_0x08b3,0x15f));var _0x308b=function(_0x46ad0c,_0x353776){_0x46ad0c=_0x46ad0c-0x0;var _0x4ceac2=_0x08b3[_0x46ad0c];return _0x4ceac2;};'use strict';var BPromise=require('bluebird');var https=require(_0x308b('0x0'));var logger=require('../../config/logger')(_0x308b('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x589e3f,_0xcb822a){var _0x724384={'fields':{'project':{'key':_0x589e3f[_0x308b('0x2')]||_0x308b('0x3')},'summary':(_0x589e3f[_0x308b('0x4')]||_0x308b('0x5'))+_0x308b('0x6')+_0x589e3f['ip'],'description':_0x589e3f['description']||JSON['stringify'](_0x589e3f),'issuetype':{'name':_0x589e3f[_0x308b('0x7')]||_0x308b('0x8')}}};_0x724384[_0x308b('0x9')][_0x308b('0xa')]=_0x589e3f['email'];_0x724384['fields'][_0x308b('0xb')]=_0x589e3f[_0x308b('0xc')];_0x724384[_0x308b('0x9')][_0x308b('0xd')]=_0x589e3f[_0x308b('0xe')];_0x724384[_0x308b('0x9')][_0x308b('0xf')]=_0x589e3f[_0x308b('0x10')];_0x724384[_0x308b('0x9')][_0x308b('0x11')]=_0x589e3f[_0x308b('0x12')];_0x724384['fields'][_0x308b('0x13')]=_0x589e3f['ip'];var _0x592884={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x308b('0x14'),'method':_0x308b('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x308b('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x308b('0x17'))}};var _0x5b3180=JSON['stringify'](_0x724384);var _0x2234cb=https[_0x308b('0x18')](_0x592884,function(_0x1c614b){_0x1c614b['setEncoding']('utf8');var _0x40ae8e='';_0x1c614b['on'](_0x308b('0x19'),function(_0x21dd36){_0x40ae8e+=_0x21dd36;});_0x1c614b['on'](_0x308b('0x1a'),function(){if(_0xcb822a){return _0xcb822a[_0x308b('0x1b')](_0x1c614b['statusCode'])[_0x308b('0x1c')](JSON[_0x308b('0x1d')](_0x40ae8e));}});});_0x2234cb['on'](_0x308b('0x1e'),function(_0x2ad5a2){if(_0xcb822a){return _0xcb822a[_0x308b('0x1b')](0x1f4)[_0x308b('0x1c')]({'errors':[{'message':_0x308b('0x1f'),'type':_0x308b('0x20')}]});}});_0x2234cb[_0x308b('0x21')](_0x5b3180);_0x2234cb[_0x308b('0x1a')]();}exports[_0x308b('0x22')]=openIssue;exports['send']=function(_0x7cbbd2,_0x1568bd){_0x7cbbd2[_0x308b('0x23')]['ip']=_0x7cbbd2['headers'][_0x308b('0x24')]||_0x7cbbd2['connection'][_0x308b('0x25')]||_0x7cbbd2['socket'][_0x308b('0x25')]||_0x7cbbd2[_0x308b('0x26')][_0x308b('0x27')][_0x308b('0x25')];return openIssue(_0x7cbbd2[_0x308b('0x23')],_0x1568bd);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5215416..cab68d0 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 _0xe2d3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x55a2c4,_0x1c540a){var _0x2526bf=function(_0x4d8a40){while(--_0x4d8a40){_0x55a2c4['push'](_0x55a2c4['shift']());}};_0x2526bf(++_0x1c540a);}(_0xe2d3,0x13a));var _0x3e2d=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0xe2d3[_0x35e92e];return _0x1205a8;};'use strict';var multer=require(_0x3e2d('0x0'));var util=require(_0x3e2d('0x1'));var path=require(_0x3e2d('0x2'));var timeout=require(_0x3e2d('0x3'));var express=require(_0x3e2d('0x4'));var router=express[_0x3e2d('0x5')]();var auth=require(_0x3e2d('0x6'));var interaction=require(_0x3e2d('0x7'));var config=require(_0x3e2d('0x8'));var controller=require(_0x3e2d('0x9'));router[_0x3e2d('0xa')]('/',auth[_0x3e2d('0xb')](),controller[_0x3e2d('0xc')]);router[_0x3e2d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3e2d('0xd')]);router[_0x3e2d('0xa')](_0x3e2d('0xe'),auth['isAuthenticated'](),controller[_0x3e2d('0xf')]);router['post']('/',auth[_0x3e2d('0xb')](),controller[_0x3e2d('0x10')]);router['put'](_0x3e2d('0xe'),auth['isAuthenticated'](),controller[_0x3e2d('0x11')]);router[_0x3e2d('0x12')](_0x3e2d('0xe'),auth[_0x3e2d('0xb')](),controller[_0x3e2d('0x13')]);module[_0x3e2d('0x14')]=router; \ No newline at end of file +var _0x52f6=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2e6871,_0x208763){var _0x2c5773=function(_0x3aebbe){while(--_0x3aebbe){_0x2e6871['push'](_0x2e6871['shift']());}};_0x2c5773(++_0x208763);}(_0x52f6,0xed));var _0x652f=function(_0x52eb49,_0xa84c7b){_0x52eb49=_0x52eb49-0x0;var _0x1b10ba=_0x52f6[_0x52eb49];return _0x1b10ba;};'use strict';var multer=require(_0x652f('0x0'));var util=require(_0x652f('0x1'));var path=require(_0x652f('0x2'));var timeout=require(_0x652f('0x3'));var express=require(_0x652f('0x4'));var router=express['Router']();var auth=require(_0x652f('0x5'));var interaction=require(_0x652f('0x6'));var config=require(_0x652f('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x652f('0x8')]('/',auth[_0x652f('0x9')](),controller[_0x652f('0xa')]);router[_0x652f('0x8')](_0x652f('0xb'),auth[_0x652f('0x9')](),controller[_0x652f('0xc')]);router[_0x652f('0x8')](_0x652f('0xd'),auth[_0x652f('0x9')](),controller[_0x652f('0xe')]);router[_0x652f('0xf')]('/',auth['isAuthenticated'](),controller[_0x652f('0x10')]);router[_0x652f('0x11')](_0x652f('0xd'),auth[_0x652f('0x9')](),controller[_0x652f('0x12')]);router[_0x652f('0x13')]('/:id',auth[_0x652f('0x9')](),controller[_0x652f('0x14')]);module[_0x652f('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7ffe260..490507e 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 _0xd0c2=['long','exports','STRING'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0xd0c2,0x76));var _0x2d0c=function(_0x199f47,_0x4adae0){_0x199f47=_0x199f47-0x0;var _0x31a9cb=_0xd0c2[_0x199f47];return _0x31a9cb;};'use strict';var Sequelize=require('sequelize');module[_0x2d0c('0x0')]={'question':{'type':Sequelize[_0x2d0c('0x1')]},'answer':{'type':Sequelize['TEXT'](_0x2d0c('0x2'))},'membername':{'type':Sequelize[_0x2d0c('0x1')]},'projectname':{'type':Sequelize[_0x2d0c('0x1')]},'queue':{'type':Sequelize[_0x2d0c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2d0c('0x1')]},'calleridnum':{'type':Sequelize[_0x2d0c('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa023=['long','sequelize','STRING','TEXT'];(function(_0xf9b858,_0x16c53e){var _0x3088ef=function(_0x3bc272){while(--_0x3bc272){_0xf9b858['push'](_0xf9b858['shift']());}};_0x3088ef(++_0x16c53e);}(_0xa023,0x1bd));var _0x3a02=function(_0x42a6b9,_0x164483){_0x42a6b9=_0x42a6b9-0x0;var _0x420139=_0xa023[_0x42a6b9];return _0x420139;};'use strict';var Sequelize=require(_0x3a02('0x0'));module['exports']={'question':{'type':Sequelize[_0x3a02('0x1')]},'answer':{'type':Sequelize[_0x3a02('0x2')](_0x3a02('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x3a02('0x1')]},'queue':{'type':Sequelize[_0x3a02('0x1')]},'uniqueid':{'type':Sequelize[_0x3a02('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3a02('0x1')]},'questionId':{'type':Sequelize[_0x3a02('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 24932aa..75ef844 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 _0x97e2=['ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','JscriptyAnswerReport','includeAll','catch','show','length','create','body','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox'];(function(_0xd3f37c,_0x3e890d){var _0x3463f2=function(_0x5d0380){while(--_0x5d0380){_0xd3f37c['push'](_0xd3f37c['shift']());}};_0x3463f2(++_0x3e890d);}(_0x97e2,0x15b));var _0x297e=function(_0x13fc19,_0x26a311){_0x13fc19=_0x13fc19-0x0;var _0x25afcf=_0x97e2[_0x13fc19];return _0x25afcf;};'use strict';var pdf=require(_0x297e('0x0'));var emlformat=require(_0x297e('0x1'));var rimraf=require(_0x297e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x297e('0x3'));var rp=require('request-promise');var moment=require(_0x297e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x297e('0x5'));var path=require(_0x297e('0x6'));var sox=require(_0x297e('0x7'));var csv=require('to-csv');var ejs=require(_0x297e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x297e('0x9'));var crypto=require(_0x297e('0xa'));var jsforce=require(_0x297e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x297e('0xc'));var querystring=require('querystring');var Papa=require(_0x297e('0xd'));var Redis=require(_0x297e('0xe'));var authService=require(_0x297e('0xf'));var qs=require(_0x297e('0x10'));var as=require(_0x297e('0x11'));var hardwareService=require(_0x297e('0x12'));var logger=require('../../config/logger')(_0x297e('0x13'));var utils=require(_0x297e('0x14'));var config=require(_0x297e('0x15'));var db=require(_0x297e('0x16'))['db'];function respondWithStatusCode(_0x40973b,_0x1ec216){_0x1ec216=_0x1ec216||0xcc;return function(_0x433f76){if(_0x433f76){return _0x40973b[_0x297e('0x17')](_0x1ec216);}return _0x40973b['status'](_0x1ec216)['end']();};}function respondWithResult(_0x11bd41,_0x3f2e8b){_0x3f2e8b=_0x3f2e8b||0xc8;return function(_0x3baa24){if(_0x3baa24){return _0x11bd41['status'](_0x3f2e8b)['json'](_0x3baa24);}};}function respondWithFilteredResult(_0x18394f,_0x1ec667){return function(_0x5bb3f2){if(_0x5bb3f2){var _0x15920a=_0x5bb3f2[_0x297e('0x18')],_0x4be273=_0x1ec667[_0x297e('0x19')],_0xc173eb=_0x1ec667[_0x297e('0x19')]+_0x1ec667[_0x297e('0x1a')],_0x386618;if(_0xc173eb>=_0x15920a){_0xc173eb=_0x15920a;_0x386618=0xc8;}else{_0x386618=0xce;}_0x18394f[_0x297e('0x1b')](_0x386618);return _0x18394f[_0x297e('0x1c')]('Content-Range',_0x4be273+'-'+_0xc173eb+'/'+_0x15920a)[_0x297e('0x1d')](_0x5bb3f2);}return null;};}function patchUpdates(_0x27ca00){return function(_0xe9d29c){try{jsonpatch[_0x297e('0x1e')](_0xe9d29c,_0x27ca00,!![]);}catch(_0x5b6ca1){return BPromise[_0x297e('0x1f')](_0x5b6ca1);}return _0xe9d29c[_0x297e('0x20')]();};}function saveUpdates(_0x2d37bf,_0x271873){return function(_0x364256){if(_0x364256){return _0x364256[_0x297e('0x21')](_0x2d37bf)[_0x297e('0x22')](function(_0x290df6){return _0x290df6;});}return null;};}function removeEntity(_0x42324d,_0x1c537c){return function(_0x464033){if(_0x464033){return _0x464033[_0x297e('0x23')]()['then'](function(){_0x42324d[_0x297e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc8f728,_0x447393){return function(_0x106ca8){if(!_0x106ca8){_0xc8f728['sendStatus'](0x194);}return _0x106ca8;};}function handleError(_0x123a04,_0x5e53c4){_0x5e53c4=_0x5e53c4||0x1f4;return function(_0x59ea4e){logger['error'](_0x59ea4e[_0x297e('0x24')]);if(_0x59ea4e[_0x297e('0x25')]){delete _0x59ea4e['name'];}_0x123a04[_0x297e('0x1b')](_0x5e53c4)['send'](_0x59ea4e);};}exports[_0x297e('0x26')]=function(_0x18bac1,_0x2dbd6f){var _0x559322={},_0x3727bd={},_0x587551={'count':0x0,'rows':[]};var _0x1620d8=_[_0x297e('0x27')](db['JscriptyAnswerReport'][_0x297e('0x28')],function(_0xdf909a){return{'name':_0xdf909a[_0x297e('0x29')],'type':_0xdf909a[_0x297e('0x2a')][_0x297e('0x2b')]};});_0x3727bd['model']=_[_0x297e('0x27')](_0x1620d8,_0x297e('0x25'));_0x3727bd[_0x297e('0x2c')]=_[_0x297e('0x2d')](_0x18bac1['query']);_0x3727bd[_0x297e('0x2e')]=_[_0x297e('0x2f')](_0x3727bd[_0x297e('0x30')],_0x3727bd[_0x297e('0x2c')]);_0x559322[_0x297e('0x31')]=_[_0x297e('0x2f')](_0x3727bd['model'],qs['fields'](_0x18bac1['query'][_0x297e('0x32')]));_0x559322[_0x297e('0x31')]=_0x559322[_0x297e('0x31')]['length']?_0x559322[_0x297e('0x31')]:_0x3727bd['model'];if(!_0x18bac1['query'][_0x297e('0x33')](_0x297e('0x34'))){_0x559322[_0x297e('0x1a')]=qs['limit'](_0x18bac1[_0x297e('0x2c')][_0x297e('0x1a')]);_0x559322[_0x297e('0x19')]=qs['offset'](_0x18bac1[_0x297e('0x2c')][_0x297e('0x19')]);}_0x559322[_0x297e('0x35')]=qs['sort'](_0x18bac1[_0x297e('0x2c')][_0x297e('0x36')]);_0x559322['where']=qs[_0x297e('0x2e')](_[_0x297e('0x37')](_0x18bac1[_0x297e('0x2c')],_0x3727bd['filters']),_0x1620d8);if(_0x18bac1['query'][_0x297e('0x38')]){_0x559322['where']=_[_0x297e('0x39')](_0x559322[_0x297e('0x3a')],{'$or':_[_0x297e('0x27')](_0x1620d8,function(_0x285f49){if(_0x285f49[_0x297e('0x2a')]!==_0x297e('0x3b')){var _0x3baf61={};_0x3baf61[_0x285f49[_0x297e('0x25')]]={'$like':'%'+_0x18bac1['query']['filter']+'%'};return _0x3baf61;}})});}_0x559322=_[_0x297e('0x39')]({},_0x559322,_0x18bac1[_0x297e('0x3c')]);var _0x46cab7={'where':_0x559322[_0x297e('0x3a')]};return db[_0x297e('0x3d')][_0x297e('0x18')](_0x46cab7)[_0x297e('0x22')](function(_0x36c886){_0x587551[_0x297e('0x18')]=_0x36c886;if(_0x18bac1[_0x297e('0x2c')][_0x297e('0x3e')]){_0x559322['include']=[{'all':!![]}];}return db[_0x297e('0x3d')]['findAll'](_0x559322);})[_0x297e('0x22')](function(_0x3fa5e2){_0x587551['rows']=_0x3fa5e2;return _0x587551;})[_0x297e('0x22')](respondWithFilteredResult(_0x2dbd6f,_0x559322))[_0x297e('0x3f')](handleError(_0x2dbd6f,null));};exports[_0x297e('0x40')]=function(_0x1c5405,_0x19731d){var _0x2f52f9={'raw':!![],'where':{'id':_0x1c5405['params']['id']}},_0x5174d0={};_0x5174d0[_0x297e('0x30')]=_[_0x297e('0x2d')](db[_0x297e('0x3d')][_0x297e('0x28')]);_0x5174d0[_0x297e('0x2c')]=_['keys'](_0x1c5405['query']);_0x5174d0[_0x297e('0x2e')]=_[_0x297e('0x2f')](_0x5174d0[_0x297e('0x30')],_0x5174d0[_0x297e('0x2c')]);_0x2f52f9['attributes']=_[_0x297e('0x2f')](_0x5174d0[_0x297e('0x30')],qs[_0x297e('0x32')](_0x1c5405[_0x297e('0x2c')][_0x297e('0x32')]));_0x2f52f9[_0x297e('0x31')]=_0x2f52f9[_0x297e('0x31')][_0x297e('0x41')]?_0x2f52f9['attributes']:_0x5174d0[_0x297e('0x30')];if(_0x1c5405[_0x297e('0x2c')]['includeAll']){_0x2f52f9['include']=[{'all':!![]}];}_0x2f52f9=_[_0x297e('0x39')]({},_0x2f52f9,_0x1c5405['options']);return db[_0x297e('0x3d')]['find'](_0x2f52f9)[_0x297e('0x22')](handleEntityNotFound(_0x19731d,null))['then'](respondWithResult(_0x19731d,null))[_0x297e('0x3f')](handleError(_0x19731d,null));};exports[_0x297e('0x42')]=function(_0x218318,_0x319dd1){return db[_0x297e('0x3d')][_0x297e('0x42')](_0x218318[_0x297e('0x43')],{})[_0x297e('0x22')](respondWithResult(_0x319dd1,0xc9))['catch'](handleError(_0x319dd1,null));};exports[_0x297e('0x21')]=function(_0x4bd76e,_0x30ba93){if(_0x4bd76e[_0x297e('0x43')]['id']){delete _0x4bd76e[_0x297e('0x43')]['id'];}return db[_0x297e('0x3d')][_0x297e('0x44')]({'where':{'id':_0x4bd76e['params']['id']}})[_0x297e('0x22')](handleEntityNotFound(_0x30ba93,null))[_0x297e('0x22')](saveUpdates(_0x4bd76e[_0x297e('0x43')],null))[_0x297e('0x22')](respondWithResult(_0x30ba93,null))[_0x297e('0x3f')](handleError(_0x30ba93,null));};exports[_0x297e('0x23')]=function(_0xf5930,_0x2965c9){return db[_0x297e('0x3d')][_0x297e('0x44')]({'where':{'id':_0xf5930[_0x297e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2965c9,null))[_0x297e('0x22')](removeEntity(_0x2965c9,null))[_0x297e('0x3f')](handleError(_0x2965c9,null));};exports[_0x297e('0x46')]=function(_0x24f7fc,_0x25b2c9){return db[_0x297e('0x3d')][_0x297e('0x46')]()[_0x297e('0x22')](respondWithResult(_0x25b2c9,null))[_0x297e('0x3f')](handleError(_0x25b2c9,null));}; \ No newline at end of file +var _0x886d=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','catch','show','intersection','length','options','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x28c4db,_0x2ccd05){var _0x5907ed=function(_0x1d83c2){while(--_0x1d83c2){_0x28c4db['push'](_0x28c4db['shift']());}};_0x5907ed(++_0x2ccd05);}(_0x886d,0xc4));var _0xd886=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x886d[_0x3e182f];return _0x23edc9;};'use strict';var pdf=require(_0xd886('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd886('0x1'));var zipdir=require(_0xd886('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd886('0x3'));var moment=require(_0xd886('0x4'));var BPromise=require(_0xd886('0x5'));var Mustache=require(_0xd886('0x6'));var util=require(_0xd886('0x7'));var path=require('path');var sox=require(_0xd886('0x8'));var csv=require(_0xd886('0x9'));var ejs=require(_0xd886('0xa'));var fs=require('fs');var _=require(_0xd886('0xb'));var squel=require(_0xd886('0xc'));var crypto=require('crypto');var jsforce=require(_0xd886('0xd'));var deskjs=require(_0xd886('0xe'));var toCsv=require(_0xd886('0x9'));var querystring=require('querystring');var Papa=require(_0xd886('0xf'));var Redis=require(_0xd886('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd886('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd886('0x12'));var logger=require(_0xd886('0x13'))(_0xd886('0x14'));var utils=require(_0xd886('0x15'));var config=require(_0xd886('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12ed93,_0x1a7fc6){_0x1a7fc6=_0x1a7fc6||0xcc;return function(_0xbe36b2){if(_0xbe36b2){return _0x12ed93[_0xd886('0x17')](_0x1a7fc6);}return _0x12ed93[_0xd886('0x18')](_0x1a7fc6)[_0xd886('0x19')]();};}function respondWithResult(_0x32b934,_0x197d43){_0x197d43=_0x197d43||0xc8;return function(_0x1ccbff){if(_0x1ccbff){return _0x32b934['status'](_0x197d43)[_0xd886('0x1a')](_0x1ccbff);}};}function respondWithFilteredResult(_0x2fd11b,_0x40a14e){return function(_0x34ae71){if(_0x34ae71){var _0x13c322=_0x34ae71['count'],_0x7944=_0x40a14e[_0xd886('0x1b')],_0x36b59f=_0x40a14e[_0xd886('0x1b')]+_0x40a14e[_0xd886('0x1c')],_0x7930bf;if(_0x36b59f>=_0x13c322){_0x36b59f=_0x13c322;_0x7930bf=0xc8;}else{_0x7930bf=0xce;}_0x2fd11b[_0xd886('0x18')](_0x7930bf);return _0x2fd11b[_0xd886('0x1d')]('Content-Range',_0x7944+'-'+_0x36b59f+'/'+_0x13c322)[_0xd886('0x1a')](_0x34ae71);}return null;};}function patchUpdates(_0x39debe){return function(_0xb15f0b){try{jsonpatch['apply'](_0xb15f0b,_0x39debe,!![]);}catch(_0x3fcfca){return BPromise[_0xd886('0x1e')](_0x3fcfca);}return _0xb15f0b[_0xd886('0x1f')]();};}function saveUpdates(_0x34e58a,_0xb9f8b2){return function(_0x546d24){if(_0x546d24){return _0x546d24[_0xd886('0x20')](_0x34e58a)[_0xd886('0x21')](function(_0x48fb0b){return _0x48fb0b;});}return null;};}function removeEntity(_0x10ec9a,_0x294fc3){return function(_0x3b17e8){if(_0x3b17e8){return _0x3b17e8['destroy']()[_0xd886('0x21')](function(){_0x10ec9a[_0xd886('0x18')](0xcc)[_0xd886('0x19')]();});}};}function handleEntityNotFound(_0x4c8a81,_0x529d3f){return function(_0x5742d9){if(!_0x5742d9){_0x4c8a81[_0xd886('0x17')](0x194);}return _0x5742d9;};}function handleError(_0x5af013,_0x51908c){_0x51908c=_0x51908c||0x1f4;return function(_0x4f2eee){logger[_0xd886('0x22')](_0x4f2eee[_0xd886('0x23')]);if(_0x4f2eee['name']){delete _0x4f2eee[_0xd886('0x24')];}_0x5af013[_0xd886('0x18')](_0x51908c)[_0xd886('0x25')](_0x4f2eee);};}exports[_0xd886('0x26')]=function(_0x545376,_0xe125f7){var _0x354058={},_0x1e07c3={},_0x1ae743={'count':0x0,'rows':[]};var _0x579c88=_[_0xd886('0x27')](db[_0xd886('0x28')][_0xd886('0x29')],function(_0x28aa6a){return{'name':_0x28aa6a[_0xd886('0x2a')],'type':_0x28aa6a[_0xd886('0x2b')][_0xd886('0x2c')]};});_0x1e07c3[_0xd886('0x2d')]=_[_0xd886('0x27')](_0x579c88,_0xd886('0x24'));_0x1e07c3[_0xd886('0x2e')]=_[_0xd886('0x2f')](_0x545376[_0xd886('0x2e')]);_0x1e07c3[_0xd886('0x30')]=_['intersection'](_0x1e07c3['model'],_0x1e07c3[_0xd886('0x2e')]);_0x354058[_0xd886('0x31')]=_['intersection'](_0x1e07c3['model'],qs[_0xd886('0x32')](_0x545376['query'][_0xd886('0x32')]));_0x354058[_0xd886('0x31')]=_0x354058[_0xd886('0x31')]['length']?_0x354058[_0xd886('0x31')]:_0x1e07c3[_0xd886('0x2d')];if(!_0x545376[_0xd886('0x2e')][_0xd886('0x33')]('nolimit')){_0x354058[_0xd886('0x1c')]=qs[_0xd886('0x1c')](_0x545376[_0xd886('0x2e')][_0xd886('0x1c')]);_0x354058[_0xd886('0x1b')]=qs[_0xd886('0x1b')](_0x545376['query'][_0xd886('0x1b')]);}_0x354058[_0xd886('0x34')]=qs[_0xd886('0x35')](_0x545376[_0xd886('0x2e')][_0xd886('0x35')]);_0x354058[_0xd886('0x36')]=qs['filters'](_[_0xd886('0x37')](_0x545376['query'],_0x1e07c3[_0xd886('0x30')]),_0x579c88);if(_0x545376[_0xd886('0x2e')][_0xd886('0x38')]){_0x354058[_0xd886('0x36')]=_[_0xd886('0x39')](_0x354058['where'],{'$or':_[_0xd886('0x27')](_0x579c88,function(_0x4d88d6){if(_0x4d88d6['type']!=='VIRTUAL'){var _0x2724d0={};_0x2724d0[_0x4d88d6[_0xd886('0x24')]]={'$like':'%'+_0x545376[_0xd886('0x2e')][_0xd886('0x38')]+'%'};return _0x2724d0;}})});}_0x354058=_[_0xd886('0x39')]({},_0x354058,_0x545376['options']);var _0x3e5d65={'where':_0x354058[_0xd886('0x36')]};return db[_0xd886('0x28')][_0xd886('0x3a')](_0x3e5d65)[_0xd886('0x21')](function(_0x5c5196){_0x1ae743[_0xd886('0x3a')]=_0x5c5196;if(_0x545376['query'][_0xd886('0x3b')]){_0x354058[_0xd886('0x3c')]=[{'all':!![]}];}return db[_0xd886('0x28')][_0xd886('0x3d')](_0x354058);})[_0xd886('0x21')](function(_0x34cf68){_0x1ae743['rows']=_0x34cf68;return _0x1ae743;})[_0xd886('0x21')](respondWithFilteredResult(_0xe125f7,_0x354058))[_0xd886('0x3e')](handleError(_0xe125f7,null));};exports[_0xd886('0x3f')]=function(_0x1090ce,_0x1a8533){var _0x273157={'raw':!![],'where':{'id':_0x1090ce['params']['id']}},_0x3c6337={};_0x3c6337['model']=_[_0xd886('0x2f')](db[_0xd886('0x28')][_0xd886('0x29')]);_0x3c6337[_0xd886('0x2e')]=_[_0xd886('0x2f')](_0x1090ce[_0xd886('0x2e')]);_0x3c6337['filters']=_[_0xd886('0x40')](_0x3c6337['model'],_0x3c6337[_0xd886('0x2e')]);_0x273157['attributes']=_['intersection'](_0x3c6337['model'],qs['fields'](_0x1090ce[_0xd886('0x2e')][_0xd886('0x32')]));_0x273157[_0xd886('0x31')]=_0x273157['attributes'][_0xd886('0x41')]?_0x273157[_0xd886('0x31')]:_0x3c6337[_0xd886('0x2d')];if(_0x1090ce[_0xd886('0x2e')][_0xd886('0x3b')]){_0x273157['include']=[{'all':!![]}];}_0x273157=_[_0xd886('0x39')]({},_0x273157,_0x1090ce[_0xd886('0x42')]);return db['JscriptyAnswerReport'][_0xd886('0x43')](_0x273157)['then'](handleEntityNotFound(_0x1a8533,null))[_0xd886('0x21')](respondWithResult(_0x1a8533,null))[_0xd886('0x3e')](handleError(_0x1a8533,null));};exports[_0xd886('0x44')]=function(_0x722593,_0x35cd31){return db[_0xd886('0x28')][_0xd886('0x44')](_0x722593[_0xd886('0x45')],{})['then'](respondWithResult(_0x35cd31,0xc9))['catch'](handleError(_0x35cd31,null));};exports['update']=function(_0x521c98,_0x521fb3){if(_0x521c98[_0xd886('0x45')]['id']){delete _0x521c98[_0xd886('0x45')]['id'];}return db[_0xd886('0x28')]['find']({'where':{'id':_0x521c98['params']['id']}})[_0xd886('0x21')](handleEntityNotFound(_0x521fb3,null))[_0xd886('0x21')](saveUpdates(_0x521c98[_0xd886('0x45')],null))[_0xd886('0x21')](respondWithResult(_0x521fb3,null))[_0xd886('0x3e')](handleError(_0x521fb3,null));};exports['destroy']=function(_0x1a3e25,_0x4b4afb){return db[_0xd886('0x28')][_0xd886('0x43')]({'where':{'id':_0x1a3e25['params']['id']}})['then'](handleEntityNotFound(_0x4b4afb,null))[_0xd886('0x21')](removeEntity(_0x4b4afb,null))[_0xd886('0x3e')](handleError(_0x4b4afb,null));};exports[_0xd886('0x46')]=function(_0x510a2f,_0x25f192){return db[_0xd886('0x28')][_0xd886('0x46')]()[_0xd886('0x21')](respondWithResult(_0x25f192,null))[_0xd886('0x3e')](handleError(_0x25f192,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6630c26..01bf6e8 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 _0x20d4=['define','report_jscripty_answers','util','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x4b1473,_0x570c61){var _0x4eb602=function(_0x4ee4ab){while(--_0x4ee4ab){_0x4b1473['push'](_0x4b1473['shift']());}};_0x4eb602(++_0x570c61);}(_0x20d4,0xac));var _0x420d=function(_0x1fa102,_0x34e385){_0x1fa102=_0x1fa102-0x0;var _0x5d683e=_0x20d4[_0x1fa102];return _0x5d683e;};'use strict';var _=require('lodash');var util=require(_0x420d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x420d('0x1'));var rp=require(_0x420d('0x2'));var fs=require('fs');var path=require(_0x420d('0x3'));var rimraf=require(_0x420d('0x4'));var config=require(_0x420d('0x5'));var attributes=require(_0x420d('0x6'));module[_0x420d('0x7')]=function(_0x2ff88d,_0x44e1f8){return _0x2ff88d[_0x420d('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x420d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eed=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x34596a,_0x4f5372){var _0x1695ec=function(_0x5d0080){while(--_0x5d0080){_0x34596a['push'](_0x34596a['shift']());}};_0x1695ec(++_0x4f5372);}(_0x3eed,0x162));var _0xd3ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3eed[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3ee('0x0'));var util=require(_0xd3ee('0x1'));var logger=require('../../config/logger')(_0xd3ee('0x2'));var moment=require(_0xd3ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3ee('0x4'));var fs=require('fs');var path=require(_0xd3ee('0x5'));var rimraf=require(_0xd3ee('0x6'));var config=require(_0xd3ee('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x1aeeb7,_0x525b7a){return _0x1aeeb7[_0xd3ee('0x8')](_0xd3ee('0x9'),attributes,{'tableName':_0xd3ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 6a83986..ebd7e5b 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 _0x3aa7=['client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3aa7,0x173));var _0x73aa=function(_0x1d4074,_0x14dd79){_0x1d4074=_0x1d4074-0x0;var _0x258fc1=_0x3aa7[_0x1d4074];return _0x258fc1;};'use strict';var _=require('lodash');var util=require(_0x73aa('0x0'));var moment=require(_0x73aa('0x1'));var BPromise=require(_0x73aa('0x2'));var rs=require(_0x73aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x73aa('0x4'));var logger=require(_0x73aa('0x5'))(_0x73aa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x73aa('0x7')][_0x73aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x165736,_0x4e443b,_0x2492e8){return new BPromise(function(_0x503764,_0x59bd2d){return client[_0x73aa('0x9')](_0x165736,_0x2492e8)['then'](function(_0xa8c218){logger['info'](_0x73aa('0xa'),_0x4e443b,_0x73aa('0xb'));logger[_0x73aa('0xc')](_0x73aa('0xd'),_0x4e443b,_0x73aa('0xb'),JSON[_0x73aa('0xe')](_0xa8c218));if(_0xa8c218[_0x73aa('0xf')]){if(_0xa8c218[_0x73aa('0xf')][_0x73aa('0x10')]===0x1f4){logger['error'](_0x73aa('0xa'),_0x4e443b,_0xa8c218['error'][_0x73aa('0x11')]);return _0x59bd2d(_0xa8c218[_0x73aa('0xf')]['message']);}logger['error'](_0x73aa('0xa'),_0x4e443b,_0xa8c218[_0x73aa('0xf')][_0x73aa('0x11')]);return _0x503764(_0xa8c218[_0x73aa('0xf')][_0x73aa('0x11')]);}else{logger[_0x73aa('0x12')](_0x73aa('0xa'),_0x4e443b,_0x73aa('0xb'));_0x503764(_0xa8c218[_0x73aa('0x13')][_0x73aa('0x11')]);}})[_0x73aa('0x14')](function(_0x27b0f1){logger[_0x73aa('0xf')](_0x73aa('0xa'),_0x4e443b,_0x27b0f1);_0x59bd2d(_0x27b0f1);});});} \ No newline at end of file +var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4539ca,_0x3a07cd){var _0x552d4a=function(_0x5413d1){while(--_0x5413d1){_0x4539ca['push'](_0x4539ca['shift']());}};_0x552d4a(++_0x3a07cd);}(_0x9348,0x10d));var _0x8934=function(_0x5cbe77,_0x47d45d){_0x5cbe77=_0x5cbe77-0x0;var _0x546a1e=_0x9348[_0x5cbe77];return _0x546a1e;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index fba6e7b..1572943 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 _0xc7b8=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','30s','getSummary','post','create','/:id/clone','clone','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xf65805,_0x4a113b){var _0x564b8f=function(_0x3dd3c3){while(--_0x3dd3c3){_0xf65805['push'](_0xf65805['shift']());}};_0x564b8f(++_0x4a113b);}(_0xc7b8,0x119));var _0x8c7b=function(_0x2bbcd7,_0x15203a){_0x2bbcd7=_0x2bbcd7-0x0;var _0x42f5ff=_0xc7b8[_0x2bbcd7];return _0x42f5ff;};'use strict';var multer=require(_0x8c7b('0x0'));var util=require(_0x8c7b('0x1'));var path=require('path');var timeout=require(_0x8c7b('0x2'));var express=require(_0x8c7b('0x3'));var router=express[_0x8c7b('0x4')]();var auth=require(_0x8c7b('0x5'));var interaction=require(_0x8c7b('0x6'));var config=require(_0x8c7b('0x7'));var controller=require('./jscriptyProject.controller');router[_0x8c7b('0x8')]('/',auth[_0x8c7b('0x9')](),controller[_0x8c7b('0xa')]);router[_0x8c7b('0x8')](_0x8c7b('0xb'),auth[_0x8c7b('0x9')](),controller[_0x8c7b('0xc')]);router['get'](_0x8c7b('0xd'),auth[_0x8c7b('0x9')](),controller['getSessions']);router[_0x8c7b('0x8')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x8c7b('0x8')]('/:id/summary',auth[_0x8c7b('0x9')](),timeout(_0x8c7b('0xe')),controller[_0x8c7b('0xf')]);router[_0x8c7b('0x10')]('/',auth['isAuthenticated'](),controller[_0x8c7b('0x11')]);router[_0x8c7b('0x10')](_0x8c7b('0x12'),auth[_0x8c7b('0x9')](),controller[_0x8c7b('0x13')]);router['put'](_0x8c7b('0xb'),auth[_0x8c7b('0x9')](),controller[_0x8c7b('0x14')]);router[_0x8c7b('0x15')](_0x8c7b('0xb'),auth['isAuthenticated'](),controller[_0x8c7b('0x16')]);module[_0x8c7b('0x17')]=router; \ No newline at end of file +var _0x8ffd=['../../components/auth/service','./jscriptyProject.controller','isAuthenticated','index','/:id','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','exports','multer','path','express','Router'];(function(_0x370d20,_0x4d7c3c){var _0x35cf78=function(_0x33d5c9){while(--_0x33d5c9){_0x370d20['push'](_0x370d20['shift']());}};_0x35cf78(++_0x4d7c3c);}(_0x8ffd,0x18c));var _0xd8ff=function(_0xeb7786,_0x53a053){_0xeb7786=_0xeb7786-0x0;var _0x120bbc=_0x8ffd[_0xeb7786];return _0x120bbc;};'use strict';var multer=require(_0xd8ff('0x0'));var util=require('util');var path=require(_0xd8ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8ff('0x2'));var router=express[_0xd8ff('0x3')]();var auth=require(_0xd8ff('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8ff('0x5'));router['get']('/',auth[_0xd8ff('0x6')](),controller[_0xd8ff('0x7')]);router['get'](_0xd8ff('0x8'),auth[_0xd8ff('0x6')](),controller[_0xd8ff('0x9')]);router[_0xd8ff('0xa')](_0xd8ff('0xb'),auth[_0xd8ff('0x6')](),controller[_0xd8ff('0xc')]);router['get'](_0xd8ff('0xd'),auth[_0xd8ff('0x6')](),controller[_0xd8ff('0xe')]);router[_0xd8ff('0xa')](_0xd8ff('0xf'),auth[_0xd8ff('0x6')](),timeout('30s'),controller[_0xd8ff('0x10')]);router[_0xd8ff('0x11')]('/',auth[_0xd8ff('0x6')](),controller[_0xd8ff('0x12')]);router[_0xd8ff('0x11')](_0xd8ff('0x13'),auth[_0xd8ff('0x6')](),controller[_0xd8ff('0x14')]);router[_0xd8ff('0x15')](_0xd8ff('0x8'),auth['isAuthenticated'](),controller[_0xd8ff('0x16')]);router[_0xd8ff('0x17')]('/:id',auth[_0xd8ff('0x6')](),controller['destroy']);module[_0xd8ff('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5cf1df4..112364f 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 _0xa2b0=['sequelize','util','exports','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa2b0,0xff));var _0x0a2b=function(_0x247d19,_0x1dcde0){_0x247d19=_0x247d19-0x0;var _0x1ed62e=_0xa2b0[_0x247d19];return _0x1ed62e;};'use strict';var Sequelize=require(_0x0a2b('0x0'));var _=require('lodash');var util=require(_0x0a2b('0x1'));module[_0x0a2b('0x2')]={'name':{'type':Sequelize[_0x0a2b('0x3')],'unique':_0x0a2b('0x4')},'description':{'type':Sequelize[_0x0a2b('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x0a2b('0x5')),'set':function(_0x33faba){if(_[_0x0a2b('0x6')](_0x33faba)){this[_0x0a2b('0x7')](_0x0a2b('0x8'),JSON[_0x0a2b('0x9')](_0x33faba));}else if(_[_0x0a2b('0xa')](_0x33faba)){this[_0x0a2b('0x7')](_0x0a2b('0x8'),_0x33faba);}else{this['setDataValue'](_0x0a2b('0x8'),util[_0x0a2b('0xb')](_0x0a2b('0xc'),this[_0x0a2b('0xd')](_0x0a2b('0x4'))||'',this[_0x0a2b('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0a2b('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x6e52=['exports','STRING','TEXT','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize','lodash'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x6e52,0x166));var _0x26e5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e52[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x26e5('0x0'));var _=require(_0x26e5('0x1'));var util=require('util');module[_0x26e5('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x26e5('0x3')]},'formData':{'type':Sequelize[_0x26e5('0x4')]('long'),'set':function(_0x5d0051){if(_[_0x26e5('0x5')](_0x5d0051)){this['setDataValue'](_0x26e5('0x6'),JSON[_0x26e5('0x7')](_0x5d0051));}else if(_[_0x26e5('0x8')](_0x5d0051)){this[_0x26e5('0x9')](_0x26e5('0x6'),_0x5d0051);}else{this[_0x26e5('0x9')]('formData',util[_0x26e5('0xa')](_0x26e5('0xb'),this[_0x26e5('0xc')](_0x26e5('0xd'))||'',this[_0x26e5('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x26e5('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9387ce5..5799aa7 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 _0x1b91=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','get','Projects','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileResource','getSessions','findOne','JscriptySessionReport','nolimit','sort','ProjectId','JscriptyAnswerReport','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0xec884c,_0x3b9d53){var _0x40598a=function(_0x5a2b78){while(--_0x5a2b78){_0xec884c['push'](_0xec884c['shift']());}};_0x40598a(++_0x3b9d53);}(_0x1b91,0xd5));var _0x11b9=function(_0x179921,_0x4b027f){_0x179921=_0x179921-0x0;var _0x687776=_0x1b91[_0x179921];return _0x687776;};'use strict';var pdf=require(_0x11b9('0x0'));var emlformat=require(_0x11b9('0x1'));var rimraf=require(_0x11b9('0x2'));var zipdir=require(_0x11b9('0x3'));var jsonpatch=require(_0x11b9('0x4'));var rp=require(_0x11b9('0x5'));var moment=require('moment');var BPromise=require(_0x11b9('0x6'));var Mustache=require(_0x11b9('0x7'));var util=require('util');var path=require('path');var sox=require(_0x11b9('0x8'));var csv=require(_0x11b9('0x9'));var ejs=require(_0x11b9('0xa'));var fs=require('fs');var _=require(_0x11b9('0xb'));var squel=require(_0x11b9('0xc'));var crypto=require('crypto');var jsforce=require(_0x11b9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x11b9('0xe'));var Papa=require(_0x11b9('0xf'));var Redis=require(_0x11b9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x11b9('0x11'));var as=require(_0x11b9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11b9('0x13'))(_0x11b9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x11b9('0x15'))['db'];function respondWithStatusCode(_0x42c20f,_0x2fd65a){_0x2fd65a=_0x2fd65a||0xcc;return function(_0x46f3c4){if(_0x46f3c4){return _0x42c20f[_0x11b9('0x16')](_0x2fd65a);}return _0x42c20f[_0x11b9('0x17')](_0x2fd65a)[_0x11b9('0x18')]();};}function respondWithResult(_0xc56b99,_0x4d6e36){_0x4d6e36=_0x4d6e36||0xc8;return function(_0x5f26f3){if(_0x5f26f3){return _0xc56b99[_0x11b9('0x17')](_0x4d6e36)[_0x11b9('0x19')](_0x5f26f3);}};}function respondWithFilteredResult(_0x45a98e,_0x3f072e){return function(_0x6f4c4b){if(_0x6f4c4b){var _0x53e193=_0x6f4c4b[_0x11b9('0x1a')],_0x22ae5f=_0x3f072e['offset'],_0x4d9ad9=_0x3f072e[_0x11b9('0x1b')]+_0x3f072e['limit'],_0x443b89;if(_0x4d9ad9>=_0x53e193){_0x4d9ad9=_0x53e193;_0x443b89=0xc8;}else{_0x443b89=0xce;}_0x45a98e['status'](_0x443b89);return _0x45a98e[_0x11b9('0x1c')](_0x11b9('0x1d'),_0x22ae5f+'-'+_0x4d9ad9+'/'+_0x53e193)[_0x11b9('0x19')](_0x6f4c4b);}return null;};}function patchUpdates(_0x2b81a4){return function(_0x29ba04){try{jsonpatch['apply'](_0x29ba04,_0x2b81a4,!![]);}catch(_0x4bf089){return BPromise['reject'](_0x4bf089);}return _0x29ba04[_0x11b9('0x1e')]();};}function saveUpdates(_0x5ec702,_0x5991be){return function(_0x158c51){if(_0x158c51){return _0x158c51[_0x11b9('0x1f')](_0x5ec702)[_0x11b9('0x20')](function(_0x4a2e96){return _0x4a2e96;});}return null;};}function removeEntity(_0x2c6c08,_0x2acb18){return function(_0x3266e5){if(_0x3266e5){return _0x3266e5[_0x11b9('0x21')]()[_0x11b9('0x20')](function(){var _0x5b3a21=_0x3266e5[_0x11b9('0x22')]({'plain':!![]});var _0x3b9524=_0x11b9('0x23');return db['UserProfileResource'][_0x11b9('0x21')]({'where':{'type':_0x3b9524,'resourceId':_0x5b3a21['id']}})[_0x11b9('0x20')](function(){return _0x3266e5;});})[_0x11b9('0x20')](function(){_0x2c6c08[_0x11b9('0x17')](0xcc)[_0x11b9('0x18')]();});}};}function handleEntityNotFound(_0x48c953,_0xfe7724){return function(_0x48ef9b){if(!_0x48ef9b){_0x48c953[_0x11b9('0x16')](0x194);}return _0x48ef9b;};}function handleError(_0x2407ed,_0x2e4c8c){_0x2e4c8c=_0x2e4c8c||0x1f4;return function(_0x55ed42){logger[_0x11b9('0x24')](_0x55ed42['stack']);if(_0x55ed42['name']){delete _0x55ed42[_0x11b9('0x25')];}_0x2407ed[_0x11b9('0x17')](_0x2e4c8c)[_0x11b9('0x26')](_0x55ed42);};}exports[_0x11b9('0x27')]=function(_0x389b55,_0x2d9ccb){var _0x5f11ba={},_0xeedd67={},_0xed6631={'count':0x0,'rows':[]};var _0xcb2830=_[_0x11b9('0x28')](db[_0x11b9('0x29')][_0x11b9('0x2a')],function(_0x595597){return{'name':_0x595597[_0x11b9('0x2b')],'type':_0x595597['type'][_0x11b9('0x2c')]};});_0xeedd67['model']=_[_0x11b9('0x28')](_0xcb2830,_0x11b9('0x25'));_0xeedd67['query']=_[_0x11b9('0x2d')](_0x389b55[_0x11b9('0x2e')]);_0xeedd67['filters']=_[_0x11b9('0x2f')](_0xeedd67[_0x11b9('0x30')],_0xeedd67[_0x11b9('0x2e')]);_0x5f11ba[_0x11b9('0x31')]=_[_0x11b9('0x2f')](_0xeedd67[_0x11b9('0x30')],qs[_0x11b9('0x32')](_0x389b55[_0x11b9('0x2e')]['fields']));_0x5f11ba[_0x11b9('0x31')]=_0x5f11ba[_0x11b9('0x31')][_0x11b9('0x33')]?_0x5f11ba[_0x11b9('0x31')]:_0xeedd67[_0x11b9('0x30')];if(!_0x389b55['query'][_0x11b9('0x34')]('nolimit')){_0x5f11ba['limit']=qs[_0x11b9('0x35')](_0x389b55[_0x11b9('0x2e')]['limit']);_0x5f11ba['offset']=qs[_0x11b9('0x1b')](_0x389b55[_0x11b9('0x2e')][_0x11b9('0x1b')]);}_0x5f11ba[_0x11b9('0x36')]=qs['sort'](_0x389b55[_0x11b9('0x2e')]['sort']);_0x5f11ba[_0x11b9('0x37')]=qs[_0x11b9('0x38')](_[_0x11b9('0x39')](_0x389b55['query'],_0xeedd67[_0x11b9('0x38')]),_0xcb2830);if(_0x389b55[_0x11b9('0x2e')][_0x11b9('0x3a')]){_0x5f11ba[_0x11b9('0x37')]=_[_0x11b9('0x3b')](_0x5f11ba[_0x11b9('0x37')],{'$or':_['map'](_0xcb2830,function(_0x25d1b4){if(_0x25d1b4['type']!==_0x11b9('0x3c')){var _0x31df22={};_0x31df22[_0x25d1b4[_0x11b9('0x25')]]={'$like':'%'+_0x389b55[_0x11b9('0x2e')][_0x11b9('0x3a')]+'%'};return _0x31df22;}})});}_0x5f11ba=_[_0x11b9('0x3b')]({},_0x5f11ba,_0x389b55[_0x11b9('0x3d')]);var _0x33daa3={'where':_0x5f11ba[_0x11b9('0x37')]};return db[_0x11b9('0x29')][_0x11b9('0x1a')](_0x33daa3)[_0x11b9('0x20')](function(_0xaedfbe){_0xed6631[_0x11b9('0x1a')]=_0xaedfbe;if(_0x389b55[_0x11b9('0x2e')][_0x11b9('0x3e')]){_0x5f11ba[_0x11b9('0x3f')]=[{'all':!![]}];}return db[_0x11b9('0x29')][_0x11b9('0x40')](_0x5f11ba);})['then'](function(_0x4d0ef2){_0xed6631[_0x11b9('0x41')]=_0x4d0ef2;return _0xed6631;})[_0x11b9('0x20')](respondWithFilteredResult(_0x2d9ccb,_0x5f11ba))[_0x11b9('0x42')](handleError(_0x2d9ccb,null));};exports[_0x11b9('0x43')]=function(_0x3da8af,_0x5c384f){var _0x2144ac={'raw':![],'where':{'id':_0x3da8af[_0x11b9('0x44')]['id']}},_0x1016dd={};_0x1016dd[_0x11b9('0x30')]=_['keys'](db['JscriptyProject'][_0x11b9('0x2a')]);_0x1016dd[_0x11b9('0x2e')]=_[_0x11b9('0x2d')](_0x3da8af['query']);_0x1016dd[_0x11b9('0x38')]=_['intersection'](_0x1016dd[_0x11b9('0x30')],_0x1016dd[_0x11b9('0x2e')]);_0x2144ac[_0x11b9('0x31')]=_[_0x11b9('0x2f')](_0x1016dd[_0x11b9('0x30')],qs[_0x11b9('0x32')](_0x3da8af[_0x11b9('0x2e')]['fields']));_0x2144ac[_0x11b9('0x31')]=_0x2144ac[_0x11b9('0x31')][_0x11b9('0x33')]?_0x2144ac[_0x11b9('0x31')]:_0x1016dd[_0x11b9('0x30')];if(_0x3da8af[_0x11b9('0x2e')]['includeAll']){_0x2144ac['include']=[{'all':!![]}];}_0x2144ac=_['merge']({},_0x2144ac,_0x3da8af[_0x11b9('0x3d')]);return db['JscriptyProject'][_0x11b9('0x45')](_0x2144ac)[_0x11b9('0x20')](handleEntityNotFound(_0x5c384f,null))[_0x11b9('0x20')](respondWithResult(_0x5c384f,null))['catch'](handleError(_0x5c384f,null));};exports[_0x11b9('0x46')]=function(_0x125fe2,_0x5d02ef){return db[_0x11b9('0x29')][_0x11b9('0x46')](_0x125fe2[_0x11b9('0x47')],{})[_0x11b9('0x20')](function(_0x3d4088){var _0x279a9e=_0x125fe2[_0x11b9('0x48')][_0x11b9('0x22')]({'plain':!![]});if(!_0x279a9e)throw new Error(_0x11b9('0x49'));if(_0x279a9e['role']===_0x11b9('0x48')){var _0x1a0615=_0x3d4088[_0x11b9('0x22')]({'plain':!![]});var _0x55eecf=_0x11b9('0x23');return db[_0x11b9('0x4a')][_0x11b9('0x45')]({'where':{'name':_0x55eecf,'userProfileId':_0x279a9e['userProfileId']},'raw':!![]})[_0x11b9('0x20')](function(_0x5d7f74){if(_0x5d7f74&&_0x5d7f74[_0x11b9('0x4b')]===0x0){return db['UserProfileResource'][_0x11b9('0x46')]({'name':_0x1a0615['name'],'resourceId':_0x1a0615['id'],'type':_0x5d7f74[_0x11b9('0x25')],'sectionId':_0x5d7f74['id']},{})[_0x11b9('0x20')](function(){return _0x3d4088;});}else{return _0x3d4088;}})[_0x11b9('0x42')](function(_0xfa2af9){logger[_0x11b9('0x24')](_0x11b9('0x4c'),_0xfa2af9);throw _0xfa2af9;});}return _0x3d4088;})['then'](respondWithResult(_0x5d02ef,0xc9))[_0x11b9('0x42')](handleError(_0x5d02ef,null));};exports[_0x11b9('0x4d')]=function(_0x4e54b7,_0x51f5d7){var _0x2953ba={'where':{'id':_0x4e54b7[_0x11b9('0x44')]['id']}},_0x442708={};_0x442708['model']=_['keys'](db[_0x11b9('0x29')][_0x11b9('0x2a')]);_0x2953ba[_0x11b9('0x31')]=_[_0x11b9('0x2f')](_0x442708[_0x11b9('0x30')],qs[_0x11b9('0x32')](_0x4e54b7[_0x11b9('0x2e')][_0x11b9('0x32')]));_0x2953ba[_0x11b9('0x31')]=_0x2953ba[_0x11b9('0x31')][_0x11b9('0x33')]?_0x2953ba[_0x11b9('0x31')]:_0x442708[_0x11b9('0x30')];if(_0x4e54b7[_0x11b9('0x2e')][_0x11b9('0x3e')]){_0x2953ba[_0x11b9('0x3f')]=[{'all':!![]}];}_0x2953ba=_[_0x11b9('0x3b')]({},_0x2953ba,_0x4e54b7[_0x11b9('0x3d')]);return db[_0x11b9('0x29')]['find'](_0x2953ba)['then'](handleEntityNotFound(_0x51f5d7,null))['then'](function(_0x132aa3){if(_0x132aa3){var _0x15e9fb=_0x132aa3['get']({'plain':!![]});_0x15e9fb=qs[_0x11b9('0x4e')](_0x15e9fb,['id',_0x11b9('0x4f'),_0x11b9('0x50')]);_0x4e54b7['body']=_[_0x11b9('0x4e')](_0x4e54b7['body'],['id','createdAt',_0x11b9('0x50')]);return db[_0x11b9('0x29')][_0x11b9('0x46')](_[_0x11b9('0x3b')](_0x15e9fb,_0x4e54b7[_0x11b9('0x47')]),{'include':_0x4e54b7[_0x11b9('0x2e')][_0x11b9('0x3e')]?[{'all':!![]}]:undefined})[_0x11b9('0x20')](function(_0x220541){var _0x1bb184=_0x4e54b7[_0x11b9('0x48')][_0x11b9('0x22')]({'plain':!![]});if(!_0x1bb184)throw new Error(_0x11b9('0x49'));if(_0x1bb184[_0x11b9('0x51')]===_0x11b9('0x48')){var _0x5a3f69=_0x220541[_0x11b9('0x22')]({'plain':!![]});var _0x22ca73='Projects';return db[_0x11b9('0x4a')][_0x11b9('0x45')]({'where':{'name':_0x22ca73,'userProfileId':_0x1bb184['userProfileId']},'raw':!![]})['then'](function(_0x60a352){if(_0x60a352&&_0x60a352[_0x11b9('0x4b')]===0x0){return db[_0x11b9('0x52')][_0x11b9('0x46')]({'name':_0x5a3f69[_0x11b9('0x25')],'resourceId':_0x5a3f69['id'],'type':_0x60a352[_0x11b9('0x25')],'sectionId':_0x60a352['id']},{})[_0x11b9('0x20')](function(){return _0x220541;});}else{return _0x220541;}})[_0x11b9('0x42')](function(_0x29f016){logger['error'](_0x11b9('0x4c'),_0x29f016);throw _0x29f016;});}return _0x220541;});}})[_0x11b9('0x20')](respondWithResult(_0x51f5d7,0xc9))[_0x11b9('0x42')](handleError(_0x51f5d7,null));};exports[_0x11b9('0x1f')]=function(_0x5ce78c,_0x57a964){if(_0x5ce78c[_0x11b9('0x47')]['id']){delete _0x5ce78c[_0x11b9('0x47')]['id'];}return db[_0x11b9('0x29')][_0x11b9('0x45')]({'where':{'id':_0x5ce78c[_0x11b9('0x44')]['id']}})[_0x11b9('0x20')](handleEntityNotFound(_0x57a964,null))[_0x11b9('0x20')](saveUpdates(_0x5ce78c[_0x11b9('0x47')],null))[_0x11b9('0x20')](respondWithResult(_0x57a964,null))[_0x11b9('0x42')](handleError(_0x57a964,null));};exports[_0x11b9('0x21')]=function(_0x5deff7,_0x39ad6d){return db['JscriptyProject']['find']({'where':{'id':_0x5deff7[_0x11b9('0x44')]['id']}})[_0x11b9('0x20')](handleEntityNotFound(_0x39ad6d,null))[_0x11b9('0x20')](removeEntity(_0x39ad6d,null))[_0x11b9('0x42')](handleError(_0x39ad6d,null));};exports[_0x11b9('0x53')]=function(_0x1725cf,_0x49bc01,_0x559cc0){var _0x49f4d1={'raw':!![],'where':{}};var _0x1c01b4={};var _0x492a94={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x11b9('0x54')]({'where':{'id':_0x1725cf[_0x11b9('0x44')]['id']}})[_0x11b9('0x20')](handleEntityNotFound(_0x49bc01,null))[_0x11b9('0x20')](function(_0xa26c4){if(_0xa26c4){_0x1c01b4[_0x11b9('0x30')]=_['keys'](db[_0x11b9('0x55')][_0x11b9('0x2a')]);_0x1c01b4[_0x11b9('0x2e')]=_[_0x11b9('0x2d')](_0x1725cf[_0x11b9('0x2e')]);_0x1c01b4[_0x11b9('0x38')]=_[_0x11b9('0x2f')](_0x1c01b4['model'],_0x1c01b4[_0x11b9('0x2e')]);_0x49f4d1['attributes']=_[_0x11b9('0x2f')](_0x1c01b4[_0x11b9('0x30')],qs[_0x11b9('0x32')](_0x1725cf[_0x11b9('0x2e')]['fields']));_0x49f4d1[_0x11b9('0x31')]=_0x49f4d1['attributes'][_0x11b9('0x33')]?_0x49f4d1[_0x11b9('0x31')]:_0x1c01b4['model'];if(!_0x1725cf[_0x11b9('0x2e')][_0x11b9('0x34')](_0x11b9('0x56'))){_0x49f4d1['limit']=qs[_0x11b9('0x35')](_0x1725cf[_0x11b9('0x2e')]['limit']);_0x49f4d1['offset']=qs[_0x11b9('0x1b')](_0x1725cf[_0x11b9('0x2e')][_0x11b9('0x1b')]);}_0x49f4d1[_0x11b9('0x36')]=qs['sort'](_0x1725cf[_0x11b9('0x2e')][_0x11b9('0x57')]);_0x49f4d1['where']=qs[_0x11b9('0x38')](_['pick'](_0x1725cf[_0x11b9('0x2e')],_0x1c01b4['filters']));_0x49f4d1['where'][_0x11b9('0x58')]=_0xa26c4['id'];if(_0x1725cf[_0x11b9('0x2e')][_0x11b9('0x3a')]){_0x49f4d1[_0x11b9('0x37')]=_[_0x11b9('0x3b')](_0x49f4d1[_0x11b9('0x37')],{'$or':_[_0x11b9('0x28')](_0x49f4d1[_0x11b9('0x31')],function(_0x311718){var _0x592102={};_0x592102[_0x311718]={'$like':'%'+_0x1725cf['query'][_0x11b9('0x3a')]+'%'};return _0x592102;})});}_0x49f4d1=_[_0x11b9('0x3b')]({},_0x49f4d1,_0x1725cf[_0x11b9('0x3d')]);return db[_0x11b9('0x55')][_0x11b9('0x1a')]({'where':_0x49f4d1[_0x11b9('0x37')]})['then'](function(_0x4912e9){_0x492a94[_0x11b9('0x1a')]=_0x4912e9;if(_0x1725cf[_0x11b9('0x2e')]['includeAll']){_0x49f4d1[_0x11b9('0x3f')]=[{'all':!![]}];}return db[_0x11b9('0x55')][_0x11b9('0x40')](_0x49f4d1);})['then'](function(_0xc5173c){_0x492a94[_0x11b9('0x41')]=_0xc5173c;return _0x492a94;});}})['then'](respondWithFilteredResult(_0x49bc01,_0x49f4d1))['catch'](handleError(_0x49bc01,null));};exports['getAnswers']=function(_0x18878a,_0x213d2a,_0x14626f){var _0x32607b={'raw':!![],'where':{}};var _0x4b7fd7={};var _0x840e68={'count':0x0,'rows':[]};return db[_0x11b9('0x29')]['findOne']({'where':{'id':_0x18878a[_0x11b9('0x44')]['id']}})[_0x11b9('0x20')](handleEntityNotFound(_0x213d2a,null))[_0x11b9('0x20')](function(_0x39eed1){if(_0x39eed1){_0x4b7fd7[_0x11b9('0x30')]=_[_0x11b9('0x2d')](db[_0x11b9('0x59')][_0x11b9('0x2a')]);_0x4b7fd7[_0x11b9('0x2e')]=_[_0x11b9('0x2d')](_0x18878a[_0x11b9('0x2e')]);_0x4b7fd7[_0x11b9('0x38')]=_['intersection'](_0x4b7fd7[_0x11b9('0x30')],_0x4b7fd7[_0x11b9('0x2e')]);_0x32607b[_0x11b9('0x31')]=_[_0x11b9('0x2f')](_0x4b7fd7[_0x11b9('0x30')],qs['fields'](_0x18878a[_0x11b9('0x2e')][_0x11b9('0x32')]));_0x32607b['attributes']=_0x32607b[_0x11b9('0x31')]['length']?_0x32607b['attributes']:_0x4b7fd7[_0x11b9('0x30')];if(!_0x18878a[_0x11b9('0x2e')][_0x11b9('0x34')](_0x11b9('0x56'))){_0x32607b[_0x11b9('0x35')]=qs[_0x11b9('0x35')](_0x18878a['query']['limit']);_0x32607b['offset']=qs[_0x11b9('0x1b')](_0x18878a[_0x11b9('0x2e')][_0x11b9('0x1b')]);}_0x32607b[_0x11b9('0x36')]=qs[_0x11b9('0x57')](_0x18878a[_0x11b9('0x2e')][_0x11b9('0x57')]);_0x32607b[_0x11b9('0x37')]=qs[_0x11b9('0x38')](_[_0x11b9('0x39')](_0x18878a[_0x11b9('0x2e')],_0x4b7fd7[_0x11b9('0x38')]));_0x32607b[_0x11b9('0x37')][_0x11b9('0x58')]=_0x39eed1['id'];if(_0x18878a['query'][_0x11b9('0x3a')]){_0x32607b[_0x11b9('0x37')]=_[_0x11b9('0x3b')](_0x32607b['where'],{'$or':_[_0x11b9('0x28')](_0x32607b['attributes'],function(_0x2ca3ea){var _0x37deed={};_0x37deed[_0x2ca3ea]={'$like':'%'+_0x18878a[_0x11b9('0x2e')][_0x11b9('0x3a')]+'%'};return _0x37deed;})});}_0x32607b=_[_0x11b9('0x3b')]({},_0x32607b,_0x18878a[_0x11b9('0x3d')]);return db['JscriptyAnswerReport']['count']({'where':_0x32607b['where']})[_0x11b9('0x20')](function(_0x250b26){_0x840e68[_0x11b9('0x1a')]=_0x250b26;if(_0x18878a[_0x11b9('0x2e')][_0x11b9('0x3e')]){_0x32607b['include']=[{'all':!![]}];}return db[_0x11b9('0x59')][_0x11b9('0x40')](_0x32607b);})[_0x11b9('0x20')](function(_0x3a2166){_0x840e68['rows']=_0x3a2166;return _0x840e68;});}})[_0x11b9('0x20')](respondWithFilteredResult(_0x213d2a,_0x32607b))[_0x11b9('0x42')](handleError(_0x213d2a,null));};function char(_0x11dce5){return'number'===typeof _0x11dce5?String['fromCharCode'][_0x11b9('0x5a')](null,arguments):_0x11dce5;}function needsEncapsulation(_0x2c471c){return!!_0x2c471c&&(_0x2c471c[_0x11b9('0x5b')]()['indexOf'](char(0xd))>=0x0||_0x2c471c[_0x11b9('0x5b')]()[_0x11b9('0x5c')](char(0xa))>=0x0||_0x2c471c[_0x11b9('0x5b')]()[_0x11b9('0x5c')](char(0x2c))>=0x0||_0x2c471c['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x54e864){var _0x45ddfc=char(0x22),_0x3250aa='\x5c'+char(0x22),_0xda31a8=_0x54e864[_0x11b9('0x5b')]()[_0x11b9('0x5d')](new RegExp(_0x45ddfc,'g'),_0x3250aa);return _0x45ddfc+_0xda31a8+_0x45ddfc;}exports[_0x11b9('0x5e')]=function(_0xae4f05,_0x3b5578,_0x457ac1){var _0x2db9f9,_0x216053;var _0x20a8cb={'where':{'ProjectId':_0xae4f05[_0x11b9('0x44')]['id']}};if(_0xae4f05['query'][_0x11b9('0x5f')]){_0x20a8cb[_0x11b9('0x37')]['starttime']=JSON[_0x11b9('0x60')](_0xae4f05[_0x11b9('0x2e')][_0x11b9('0x5f')]);}return db[_0x11b9('0x55')][_0x11b9('0x40')](_0x20a8cb)[_0x11b9('0x20')](handleEntityNotFound(_0x3b5578,null))[_0x11b9('0x20')](function(_0x17156a){if(_0x17156a){_0x2db9f9=_0x17156a;return db[_0x11b9('0x61')]['findAll']({'where':{'SessionId':{'$in':_[_0x11b9('0x28')](_0x2db9f9,'id')},'ProjectId':_0xae4f05['params']['id']},'order':_0x11b9('0x62')});}})[_0x11b9('0x20')](handleEntityNotFound(_0x3b5578,null))[_0x11b9('0x20')](function(_0x2a8e33){if(_0x2a8e33){_0x216053=_0x2a8e33;var _0x338554={};for(var _0x39a9b1=0x0,_0x1d4046=_0x216053['length'];_0x39a9b1<_0x1d4046;_0x39a9b1++){if(!_0x338554[_0x11b9('0x34')](_0x216053[_0x39a9b1][_0x11b9('0x63')])){_0x338554[_0x216053[_0x39a9b1][_0x11b9('0x63')]]=needsEncapsulation(_0x216053[_0x39a9b1][_0x11b9('0x64')])?encapsulate(_0x216053[_0x39a9b1]['question']):_0x216053[_0x39a9b1][_0x11b9('0x64')];}}var _0x27b970=[],_0x2b9969={};for(var _0x55feb9=0x0,_0x496330=_0x2db9f9['length'];_0x55feb9<_0x496330;_0x55feb9++){_0x2b9969={'ProjectId':_0xae4f05['params']['id'],'SessionId':_0x2db9f9[_0x55feb9]['id'],'StartTime':moment(_0x2db9f9[_0x55feb9][_0x11b9('0x65')])[_0x11b9('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3b5022=0x0,_0x1da190=_0x216053[_0x11b9('0x33')];_0x3b5022<_0x1da190;_0x3b5022++){if(_0x216053[_0x3b5022][_0x11b9('0x67')]==_0x2db9f9[_0x55feb9]['id']&&_0x338554[_0x11b9('0x34')](_0x216053[_0x3b5022][_0x11b9('0x63')])){_0x2b9969[_0x338554[_0x216053[_0x3b5022][_0x11b9('0x63')]]]=_0x216053[_0x3b5022][_0x11b9('0x68')];}}for(var _0x522296 in _0x338554){if(!_0x2b9969[_0x11b9('0x34')](_0x338554[_0x522296])){_0x2b9969[_0x338554[_0x522296]]=null;}}_0x27b970[_0x11b9('0x69')](_0x2b9969);}return _0x27b970;}})['then'](function(_0x326ba9){if(!_[_0x11b9('0x6a')](_0x326ba9)){var _0x3555ec=toCsv(_0x326ba9);var _0x373023=Date['now']();fs[_0x11b9('0x6b')](util[_0x11b9('0x66')](_0x11b9('0x6c'),_0xae4f05['params']['id'],_0x373023),_0x3555ec);_0x3b5578[_0x11b9('0x6d')](_0x11b9('0x6e'),_0x11b9('0x6f')+util[_0x11b9('0x66')](_0x11b9('0x70'),_0xae4f05[_0x11b9('0x44')]['id'],_0x373023));_0x3b5578[_0x11b9('0x6d')]('Content-type',_0x11b9('0x71'));return _0x3b5578[_0x11b9('0x72')](util[_0x11b9('0x66')](_0x11b9('0x6c'),_0xae4f05['params']['id'],_0x373023));}else{return _0x3b5578['sendStatus'](0xcc);}})[_0x11b9('0x42')](handleError(_0x3b5578,null));}; \ No newline at end of file +var _0x3514=['attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','update','then','destroy','Projects','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','get','createdAt','updatedAt','omit','role','error','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','starttime','-createdAt','questionId','question','format','SessionId','answer','push','writeFileSync','setHeader','Content-disposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3514,0xe5));var _0x4351=function(_0x507cdc,_0x42b97a){_0x507cdc=_0x507cdc-0x0;var _0x2c1828=_0x3514[_0x507cdc];return _0x2c1828;};'use strict';var pdf=require(_0x4351('0x0'));var emlformat=require(_0x4351('0x1'));var rimraf=require(_0x4351('0x2'));var zipdir=require(_0x4351('0x3'));var jsonpatch=require(_0x4351('0x4'));var rp=require('request-promise');var moment=require(_0x4351('0x5'));var BPromise=require(_0x4351('0x6'));var Mustache=require(_0x4351('0x7'));var util=require(_0x4351('0x8'));var path=require(_0x4351('0x9'));var sox=require('sox');var csv=require(_0x4351('0xa'));var ejs=require(_0x4351('0xb'));var fs=require('fs');var _=require(_0x4351('0xc'));var squel=require(_0x4351('0xd'));var crypto=require('crypto');var jsforce=require(_0x4351('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4351('0xa'));var querystring=require(_0x4351('0xf'));var Papa=require(_0x4351('0x10'));var Redis=require(_0x4351('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4351('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4351('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4351('0x14'))['db'];function respondWithStatusCode(_0x2f17f0,_0x482a32){_0x482a32=_0x482a32||0xcc;return function(_0x5aee4f){if(_0x5aee4f){return _0x2f17f0[_0x4351('0x15')](_0x482a32);}return _0x2f17f0[_0x4351('0x16')](_0x482a32)[_0x4351('0x17')]();};}function respondWithResult(_0x3827dc,_0x335d0f){_0x335d0f=_0x335d0f||0xc8;return function(_0xd0abec){if(_0xd0abec){return _0x3827dc['status'](_0x335d0f)['json'](_0xd0abec);}};}function respondWithFilteredResult(_0x543eb6,_0x259304){return function(_0x3dd9df){if(_0x3dd9df){var _0x3e51b5=_0x3dd9df[_0x4351('0x18')],_0x3063a6=_0x259304[_0x4351('0x19')],_0x50503e=_0x259304[_0x4351('0x19')]+_0x259304['limit'],_0x1a39f9;if(_0x50503e>=_0x3e51b5){_0x50503e=_0x3e51b5;_0x1a39f9=0xc8;}else{_0x1a39f9=0xce;}_0x543eb6[_0x4351('0x16')](_0x1a39f9);return _0x543eb6[_0x4351('0x1a')]('Content-Range',_0x3063a6+'-'+_0x50503e+'/'+_0x3e51b5)[_0x4351('0x1b')](_0x3dd9df);}return null;};}function patchUpdates(_0x310974){return function(_0x2db330){try{jsonpatch[_0x4351('0x1c')](_0x2db330,_0x310974,!![]);}catch(_0x4e696e){return BPromise[_0x4351('0x1d')](_0x4e696e);}return _0x2db330['save']();};}function saveUpdates(_0x3b65a2,_0x19aed7){return function(_0x56035b){if(_0x56035b){return _0x56035b[_0x4351('0x1e')](_0x3b65a2)[_0x4351('0x1f')](function(_0xce7580){return _0xce7580;});}return null;};}function removeEntity(_0x2d0ca2,_0xa5335f){return function(_0x534641){if(_0x534641){return _0x534641[_0x4351('0x20')]()[_0x4351('0x1f')](function(){var _0x259ba6=_0x534641['get']({'plain':!![]});var _0x24c673=_0x4351('0x21');return db[_0x4351('0x22')][_0x4351('0x20')]({'where':{'type':_0x24c673,'resourceId':_0x259ba6['id']}})[_0x4351('0x1f')](function(){return _0x534641;});})[_0x4351('0x1f')](function(){_0x2d0ca2[_0x4351('0x16')](0xcc)[_0x4351('0x17')]();});}};}function handleEntityNotFound(_0x40d182,_0xf75786){return function(_0xd66146){if(!_0xd66146){_0x40d182[_0x4351('0x15')](0x194);}return _0xd66146;};}function handleError(_0x444f81,_0x334cef){_0x334cef=_0x334cef||0x1f4;return function(_0x5e9e1f){logger['error'](_0x5e9e1f[_0x4351('0x23')]);if(_0x5e9e1f[_0x4351('0x24')]){delete _0x5e9e1f[_0x4351('0x24')];}_0x444f81[_0x4351('0x16')](_0x334cef)[_0x4351('0x25')](_0x5e9e1f);};}exports[_0x4351('0x26')]=function(_0x513a63,_0xa60246){var _0x553075={},_0x11a6c3={},_0x29276f={'count':0x0,'rows':[]};var _0x1516be=_['map'](db['JscriptyProject'][_0x4351('0x27')],function(_0x598bfc){return{'name':_0x598bfc[_0x4351('0x28')],'type':_0x598bfc[_0x4351('0x29')]['key']};});_0x11a6c3[_0x4351('0x2a')]=_['map'](_0x1516be,_0x4351('0x24'));_0x11a6c3[_0x4351('0x2b')]=_[_0x4351('0x2c')](_0x513a63[_0x4351('0x2b')]);_0x11a6c3['filters']=_[_0x4351('0x2d')](_0x11a6c3[_0x4351('0x2a')],_0x11a6c3[_0x4351('0x2b')]);_0x553075[_0x4351('0x2e')]=_['intersection'](_0x11a6c3[_0x4351('0x2a')],qs[_0x4351('0x2f')](_0x513a63[_0x4351('0x2b')][_0x4351('0x2f')]));_0x553075[_0x4351('0x2e')]=_0x553075['attributes'][_0x4351('0x30')]?_0x553075[_0x4351('0x2e')]:_0x11a6c3['model'];if(!_0x513a63[_0x4351('0x2b')][_0x4351('0x31')](_0x4351('0x32'))){_0x553075[_0x4351('0x33')]=qs[_0x4351('0x33')](_0x513a63[_0x4351('0x2b')][_0x4351('0x33')]);_0x553075[_0x4351('0x19')]=qs[_0x4351('0x19')](_0x513a63['query'][_0x4351('0x19')]);}_0x553075[_0x4351('0x34')]=qs['sort'](_0x513a63[_0x4351('0x2b')][_0x4351('0x35')]);_0x553075['where']=qs[_0x4351('0x36')](_[_0x4351('0x37')](_0x513a63['query'],_0x11a6c3[_0x4351('0x36')]),_0x1516be);if(_0x513a63['query'][_0x4351('0x38')]){_0x553075[_0x4351('0x39')]=_[_0x4351('0x3a')](_0x553075[_0x4351('0x39')],{'$or':_[_0x4351('0x3b')](_0x1516be,function(_0x5d52a4){if(_0x5d52a4[_0x4351('0x29')]!==_0x4351('0x3c')){var _0x3c7443={};_0x3c7443[_0x5d52a4[_0x4351('0x24')]]={'$like':'%'+_0x513a63['query']['filter']+'%'};return _0x3c7443;}})});}_0x553075=_['merge']({},_0x553075,_0x513a63[_0x4351('0x3d')]);var _0x4d3f87={'where':_0x553075['where']};return db[_0x4351('0x3e')][_0x4351('0x18')](_0x4d3f87)['then'](function(_0x550151){_0x29276f[_0x4351('0x18')]=_0x550151;if(_0x513a63[_0x4351('0x2b')][_0x4351('0x3f')]){_0x553075[_0x4351('0x40')]=[{'all':!![]}];}return db[_0x4351('0x3e')]['findAll'](_0x553075);})['then'](function(_0x300cb3){_0x29276f[_0x4351('0x41')]=_0x300cb3;return _0x29276f;})[_0x4351('0x1f')](respondWithFilteredResult(_0xa60246,_0x553075))[_0x4351('0x42')](handleError(_0xa60246,null));};exports[_0x4351('0x43')]=function(_0x501235,_0x21d9c8){var _0x518460={'raw':![],'where':{'id':_0x501235[_0x4351('0x44')]['id']}},_0x400a4d={};_0x400a4d[_0x4351('0x2a')]=_['keys'](db[_0x4351('0x3e')][_0x4351('0x27')]);_0x400a4d[_0x4351('0x2b')]=_[_0x4351('0x2c')](_0x501235[_0x4351('0x2b')]);_0x400a4d[_0x4351('0x36')]=_[_0x4351('0x2d')](_0x400a4d[_0x4351('0x2a')],_0x400a4d[_0x4351('0x2b')]);_0x518460[_0x4351('0x2e')]=_[_0x4351('0x2d')](_0x400a4d['model'],qs[_0x4351('0x2f')](_0x501235[_0x4351('0x2b')][_0x4351('0x2f')]));_0x518460[_0x4351('0x2e')]=_0x518460[_0x4351('0x2e')]['length']?_0x518460['attributes']:_0x400a4d[_0x4351('0x2a')];if(_0x501235[_0x4351('0x2b')][_0x4351('0x3f')]){_0x518460[_0x4351('0x40')]=[{'all':!![]}];}_0x518460=_[_0x4351('0x3a')]({},_0x518460,_0x501235['options']);return db[_0x4351('0x3e')]['find'](_0x518460)[_0x4351('0x1f')](handleEntityNotFound(_0x21d9c8,null))[_0x4351('0x1f')](respondWithResult(_0x21d9c8,null))[_0x4351('0x42')](handleError(_0x21d9c8,null));};exports[_0x4351('0x45')]=function(_0x5687cf,_0x58f5ad){return db['JscriptyProject']['create'](_0x5687cf[_0x4351('0x46')],{})['then'](function(_0x168316){var _0x51b565=_0x5687cf[_0x4351('0x47')]['get']({'plain':!![]});if(!_0x51b565)throw new Error(_0x4351('0x48'));if(_0x51b565['role']===_0x4351('0x47')){var _0x212a72=_0x168316['get']({'plain':!![]});var _0x3da02a='Projects';return db[_0x4351('0x49')][_0x4351('0x4a')]({'where':{'name':_0x3da02a,'userProfileId':_0x51b565['userProfileId']},'raw':!![]})[_0x4351('0x1f')](function(_0x415512){if(_0x415512&&_0x415512[_0x4351('0x4b')]===0x0){return db[_0x4351('0x22')][_0x4351('0x45')]({'name':_0x212a72['name'],'resourceId':_0x212a72['id'],'type':_0x415512[_0x4351('0x24')],'sectionId':_0x415512['id']},{})[_0x4351('0x1f')](function(){return _0x168316;});}else{return _0x168316;}})[_0x4351('0x42')](function(_0x38f260){logger['error'](_0x4351('0x4c'),_0x38f260);throw _0x38f260;});}return _0x168316;})[_0x4351('0x1f')](respondWithResult(_0x58f5ad,0xc9))[_0x4351('0x42')](handleError(_0x58f5ad,null));};exports[_0x4351('0x4d')]=function(_0x2a9318,_0x2ff167){var _0x3a1467={'where':{'id':_0x2a9318['params']['id']}},_0x1eb4b2={};_0x1eb4b2[_0x4351('0x2a')]=_[_0x4351('0x2c')](db['JscriptyProject']['rawAttributes']);_0x3a1467['attributes']=_['intersection'](_0x1eb4b2[_0x4351('0x2a')],qs[_0x4351('0x2f')](_0x2a9318[_0x4351('0x2b')][_0x4351('0x2f')]));_0x3a1467[_0x4351('0x2e')]=_0x3a1467[_0x4351('0x2e')][_0x4351('0x30')]?_0x3a1467[_0x4351('0x2e')]:_0x1eb4b2[_0x4351('0x2a')];if(_0x2a9318[_0x4351('0x2b')]['includeAll']){_0x3a1467[_0x4351('0x40')]=[{'all':!![]}];}_0x3a1467=_[_0x4351('0x3a')]({},_0x3a1467,_0x2a9318[_0x4351('0x3d')]);return db['JscriptyProject'][_0x4351('0x4a')](_0x3a1467)[_0x4351('0x1f')](handleEntityNotFound(_0x2ff167,null))[_0x4351('0x1f')](function(_0x4aa82a){if(_0x4aa82a){var _0x3a97ae=_0x4aa82a[_0x4351('0x4e')]({'plain':!![]});_0x3a97ae=qs['omit'](_0x3a97ae,['id',_0x4351('0x4f'),_0x4351('0x50')]);_0x2a9318[_0x4351('0x46')]=_[_0x4351('0x51')](_0x2a9318[_0x4351('0x46')],['id',_0x4351('0x4f'),_0x4351('0x50')]);return db[_0x4351('0x3e')][_0x4351('0x45')](_[_0x4351('0x3a')](_0x3a97ae,_0x2a9318[_0x4351('0x46')]),{'include':_0x2a9318[_0x4351('0x2b')][_0x4351('0x3f')]?[{'all':!![]}]:undefined})[_0x4351('0x1f')](function(_0x4bc045){var _0x4f437b=_0x2a9318[_0x4351('0x47')][_0x4351('0x4e')]({'plain':!![]});if(!_0x4f437b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f437b[_0x4351('0x52')]===_0x4351('0x47')){var _0x4b4885=_0x4bc045[_0x4351('0x4e')]({'plain':!![]});var _0x98968c=_0x4351('0x21');return db['UserProfileSection'][_0x4351('0x4a')]({'where':{'name':_0x98968c,'userProfileId':_0x4f437b['userProfileId']},'raw':!![]})[_0x4351('0x1f')](function(_0x17dd04){if(_0x17dd04&&_0x17dd04[_0x4351('0x4b')]===0x0){return db['UserProfileResource'][_0x4351('0x45')]({'name':_0x4b4885[_0x4351('0x24')],'resourceId':_0x4b4885['id'],'type':_0x17dd04[_0x4351('0x24')],'sectionId':_0x17dd04['id']},{})['then'](function(){return _0x4bc045;});}else{return _0x4bc045;}})['catch'](function(_0x7c7a8f){logger[_0x4351('0x53')](_0x4351('0x4c'),_0x7c7a8f);throw _0x7c7a8f;});}return _0x4bc045;});}})[_0x4351('0x1f')](respondWithResult(_0x2ff167,0xc9))[_0x4351('0x42')](handleError(_0x2ff167,null));};exports[_0x4351('0x1e')]=function(_0x37c768,_0xc93f6d){if(_0x37c768['body']['id']){delete _0x37c768[_0x4351('0x46')]['id'];}return db[_0x4351('0x3e')][_0x4351('0x4a')]({'where':{'id':_0x37c768[_0x4351('0x44')]['id']}})[_0x4351('0x1f')](handleEntityNotFound(_0xc93f6d,null))['then'](saveUpdates(_0x37c768[_0x4351('0x46')],null))[_0x4351('0x1f')](respondWithResult(_0xc93f6d,null))[_0x4351('0x42')](handleError(_0xc93f6d,null));};exports[_0x4351('0x20')]=function(_0x5923cb,_0x228223){return db['JscriptyProject'][_0x4351('0x4a')]({'where':{'id':_0x5923cb[_0x4351('0x44')]['id']}})[_0x4351('0x1f')](handleEntityNotFound(_0x228223,null))[_0x4351('0x1f')](removeEntity(_0x228223,null))[_0x4351('0x42')](handleError(_0x228223,null));};exports[_0x4351('0x54')]=function(_0x2fef46,_0x15ea9a,_0x193769){var _0x34a359={'raw':!![],'where':{}};var _0x439f65={};var _0x57aeb8={'count':0x0,'rows':[]};return db[_0x4351('0x3e')][_0x4351('0x55')]({'where':{'id':_0x2fef46['params']['id']}})[_0x4351('0x1f')](handleEntityNotFound(_0x15ea9a,null))['then'](function(_0x4621d3){if(_0x4621d3){_0x439f65[_0x4351('0x2a')]=_[_0x4351('0x2c')](db[_0x4351('0x56')][_0x4351('0x27')]);_0x439f65[_0x4351('0x2b')]=_['keys'](_0x2fef46[_0x4351('0x2b')]);_0x439f65[_0x4351('0x36')]=_[_0x4351('0x2d')](_0x439f65[_0x4351('0x2a')],_0x439f65[_0x4351('0x2b')]);_0x34a359['attributes']=_[_0x4351('0x2d')](_0x439f65['model'],qs['fields'](_0x2fef46[_0x4351('0x2b')][_0x4351('0x2f')]));_0x34a359[_0x4351('0x2e')]=_0x34a359['attributes'][_0x4351('0x30')]?_0x34a359[_0x4351('0x2e')]:_0x439f65[_0x4351('0x2a')];if(!_0x2fef46['query'][_0x4351('0x31')](_0x4351('0x32'))){_0x34a359['limit']=qs['limit'](_0x2fef46[_0x4351('0x2b')][_0x4351('0x33')]);_0x34a359[_0x4351('0x19')]=qs[_0x4351('0x19')](_0x2fef46['query'][_0x4351('0x19')]);}_0x34a359[_0x4351('0x34')]=qs[_0x4351('0x35')](_0x2fef46[_0x4351('0x2b')][_0x4351('0x35')]);_0x34a359[_0x4351('0x39')]=qs[_0x4351('0x36')](_['pick'](_0x2fef46['query'],_0x439f65[_0x4351('0x36')]));_0x34a359[_0x4351('0x39')][_0x4351('0x57')]=_0x4621d3['id'];if(_0x2fef46['query'][_0x4351('0x38')]){_0x34a359['where']=_[_0x4351('0x3a')](_0x34a359['where'],{'$or':_[_0x4351('0x3b')](_0x34a359['attributes'],function(_0x24eaa8){var _0x151ca6={};_0x151ca6[_0x24eaa8]={'$like':'%'+_0x2fef46[_0x4351('0x2b')][_0x4351('0x38')]+'%'};return _0x151ca6;})});}_0x34a359=_['merge']({},_0x34a359,_0x2fef46[_0x4351('0x3d')]);return db[_0x4351('0x56')][_0x4351('0x18')]({'where':_0x34a359[_0x4351('0x39')]})[_0x4351('0x1f')](function(_0x5cac55){_0x57aeb8[_0x4351('0x18')]=_0x5cac55;if(_0x2fef46[_0x4351('0x2b')][_0x4351('0x3f')]){_0x34a359[_0x4351('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4351('0x58')](_0x34a359);})[_0x4351('0x1f')](function(_0x1c8979){_0x57aeb8[_0x4351('0x41')]=_0x1c8979;return _0x57aeb8;});}})['then'](respondWithFilteredResult(_0x15ea9a,_0x34a359))[_0x4351('0x42')](handleError(_0x15ea9a,null));};exports[_0x4351('0x59')]=function(_0x3fde54,_0x3e0551,_0x5bf397){var _0x2c3ac4={'raw':!![],'where':{}};var _0x27aa3a={};var _0x111752={'count':0x0,'rows':[]};return db[_0x4351('0x3e')][_0x4351('0x55')]({'where':{'id':_0x3fde54[_0x4351('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e0551,null))[_0x4351('0x1f')](function(_0xd68f3a){if(_0xd68f3a){_0x27aa3a['model']=_[_0x4351('0x2c')](db[_0x4351('0x5a')][_0x4351('0x27')]);_0x27aa3a[_0x4351('0x2b')]=_['keys'](_0x3fde54[_0x4351('0x2b')]);_0x27aa3a[_0x4351('0x36')]=_[_0x4351('0x2d')](_0x27aa3a['model'],_0x27aa3a[_0x4351('0x2b')]);_0x2c3ac4[_0x4351('0x2e')]=_[_0x4351('0x2d')](_0x27aa3a[_0x4351('0x2a')],qs[_0x4351('0x2f')](_0x3fde54[_0x4351('0x2b')][_0x4351('0x2f')]));_0x2c3ac4[_0x4351('0x2e')]=_0x2c3ac4[_0x4351('0x2e')][_0x4351('0x30')]?_0x2c3ac4['attributes']:_0x27aa3a['model'];if(!_0x3fde54[_0x4351('0x2b')][_0x4351('0x31')](_0x4351('0x32'))){_0x2c3ac4[_0x4351('0x33')]=qs[_0x4351('0x33')](_0x3fde54[_0x4351('0x2b')]['limit']);_0x2c3ac4[_0x4351('0x19')]=qs[_0x4351('0x19')](_0x3fde54['query']['offset']);}_0x2c3ac4[_0x4351('0x34')]=qs[_0x4351('0x35')](_0x3fde54[_0x4351('0x2b')][_0x4351('0x35')]);_0x2c3ac4[_0x4351('0x39')]=qs['filters'](_['pick'](_0x3fde54[_0x4351('0x2b')],_0x27aa3a[_0x4351('0x36')]));_0x2c3ac4[_0x4351('0x39')][_0x4351('0x57')]=_0xd68f3a['id'];if(_0x3fde54[_0x4351('0x2b')][_0x4351('0x38')]){_0x2c3ac4['where']=_[_0x4351('0x3a')](_0x2c3ac4[_0x4351('0x39')],{'$or':_[_0x4351('0x3b')](_0x2c3ac4[_0x4351('0x2e')],function(_0x11e918){var _0x116f94={};_0x116f94[_0x11e918]={'$like':'%'+_0x3fde54[_0x4351('0x2b')][_0x4351('0x38')]+'%'};return _0x116f94;})});}_0x2c3ac4=_['merge']({},_0x2c3ac4,_0x3fde54['options']);return db[_0x4351('0x5a')]['count']({'where':_0x2c3ac4[_0x4351('0x39')]})[_0x4351('0x1f')](function(_0x84a135){_0x111752['count']=_0x84a135;if(_0x3fde54[_0x4351('0x2b')][_0x4351('0x3f')]){_0x2c3ac4[_0x4351('0x40')]=[{'all':!![]}];}return db[_0x4351('0x5a')][_0x4351('0x58')](_0x2c3ac4);})[_0x4351('0x1f')](function(_0x182454){_0x111752[_0x4351('0x41')]=_0x182454;return _0x111752;});}})['then'](respondWithFilteredResult(_0x3e0551,_0x2c3ac4))['catch'](handleError(_0x3e0551,null));};function char(_0x2fd066){return _0x4351('0x5b')===typeof _0x2fd066?String[_0x4351('0x5c')][_0x4351('0x1c')](null,arguments):_0x2fd066;}function needsEncapsulation(_0x3a9d07){return!!_0x3a9d07&&(_0x3a9d07[_0x4351('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x3a9d07[_0x4351('0x5d')]()[_0x4351('0x5e')](char(0xa))>=0x0||_0x3a9d07[_0x4351('0x5d')]()[_0x4351('0x5e')](char(0x2c))>=0x0||_0x3a9d07['toString']()[_0x4351('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x2e79dc){var _0x59647b=char(0x22),_0xcf0882='\x5c'+char(0x22),_0x242d15=_0x2e79dc[_0x4351('0x5d')]()[_0x4351('0x5f')](new RegExp(_0x59647b,'g'),_0xcf0882);return _0x59647b+_0x242d15+_0x59647b;}exports['getSummary']=function(_0x4fc09f,_0x1910ad,_0x15eedc){var _0x4dac9e,_0x2cefb8;var _0x5f325e={'where':{'ProjectId':_0x4fc09f[_0x4351('0x44')]['id']}};if(_0x4fc09f[_0x4351('0x2b')]['startTime']){_0x5f325e[_0x4351('0x39')][_0x4351('0x60')]=JSON['parse'](_0x4fc09f[_0x4351('0x2b')]['startTime']);}return db[_0x4351('0x56')]['findAll'](_0x5f325e)['then'](handleEntityNotFound(_0x1910ad,null))['then'](function(_0x3220ca){if(_0x3220ca){_0x4dac9e=_0x3220ca;return db['JscriptyQuestionReport'][_0x4351('0x58')]({'where':{'SessionId':{'$in':_[_0x4351('0x3b')](_0x4dac9e,'id')},'ProjectId':_0x4fc09f[_0x4351('0x44')]['id']},'order':_0x4351('0x61')});}})['then'](handleEntityNotFound(_0x1910ad,null))[_0x4351('0x1f')](function(_0x3cc840){if(_0x3cc840){_0x2cefb8=_0x3cc840;var _0xadc4ad={};for(var _0x286a01=0x0,_0x2332b5=_0x2cefb8[_0x4351('0x30')];_0x286a01<_0x2332b5;_0x286a01++){if(!_0xadc4ad[_0x4351('0x31')](_0x2cefb8[_0x286a01][_0x4351('0x62')])){_0xadc4ad[_0x2cefb8[_0x286a01][_0x4351('0x62')]]=needsEncapsulation(_0x2cefb8[_0x286a01][_0x4351('0x63')])?encapsulate(_0x2cefb8[_0x286a01]['question']):_0x2cefb8[_0x286a01]['question'];}}var _0x11df1d=[],_0x430d98={};for(var _0x35d0f1=0x0,_0x28431d=_0x4dac9e['length'];_0x35d0f1<_0x28431d;_0x35d0f1++){_0x430d98={'ProjectId':_0x4fc09f[_0x4351('0x44')]['id'],'SessionId':_0x4dac9e[_0x35d0f1]['id'],'StartTime':moment(_0x4dac9e[_0x35d0f1]['starttime'])[_0x4351('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x491fd7=0x0,_0x1233be=_0x2cefb8[_0x4351('0x30')];_0x491fd7<_0x1233be;_0x491fd7++){if(_0x2cefb8[_0x491fd7][_0x4351('0x65')]==_0x4dac9e[_0x35d0f1]['id']&&_0xadc4ad[_0x4351('0x31')](_0x2cefb8[_0x491fd7][_0x4351('0x62')])){_0x430d98[_0xadc4ad[_0x2cefb8[_0x491fd7][_0x4351('0x62')]]]=_0x2cefb8[_0x491fd7][_0x4351('0x66')];}}for(var _0x2e571a in _0xadc4ad){if(!_0x430d98['hasOwnProperty'](_0xadc4ad[_0x2e571a])){_0x430d98[_0xadc4ad[_0x2e571a]]=null;}}_0x11df1d[_0x4351('0x67')](_0x430d98);}return _0x11df1d;}})[_0x4351('0x1f')](function(_0x2ec366){if(!_['isEmpty'](_0x2ec366)){var _0x580f52=toCsv(_0x2ec366);var _0x560369=Date['now']();fs[_0x4351('0x68')](util[_0x4351('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4fc09f[_0x4351('0x44')]['id'],_0x560369),_0x580f52);_0x1910ad[_0x4351('0x69')](_0x4351('0x6a'),_0x4351('0x6b')+util[_0x4351('0x64')](_0x4351('0x6c'),_0x4fc09f[_0x4351('0x44')]['id'],_0x560369));_0x1910ad[_0x4351('0x69')](_0x4351('0x6d'),_0x4351('0x6e'));return _0x1910ad['download'](util[_0x4351('0x64')](_0x4351('0x6f'),_0x4fc09f[_0x4351('0x44')]['id'],_0x560369));}else{return _0x1910ad[_0x4351('0x15')](0xcc);}})[_0x4351('0x42')](handleError(_0x1910ad,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index fbdcd55..ce7470d 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 _0xcd38=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2336ea,_0x46e872){var _0x216bf9=function(_0x14a50d){while(--_0x14a50d){_0x2336ea['push'](_0x2336ea['shift']());}};_0x216bf9(++_0x46e872);}(_0xcd38,0x6c));var _0x8cd3=function(_0x2ad4fe,_0x159fce){_0x2ad4fe=_0x2ad4fe-0x0;var _0x5ac8b4=_0xcd38[_0x2ad4fe];return _0x5ac8b4;};'use strict';var _=require(_0x8cd3('0x0'));var util=require(_0x8cd3('0x1'));var logger=require(_0x8cd3('0x2'))(_0x8cd3('0x3'));var moment=require(_0x8cd3('0x4'));var BPromise=require(_0x8cd3('0x5'));var rp=require(_0x8cd3('0x6'));var fs=require('fs');var path=require(_0x8cd3('0x7'));var rimraf=require('rimraf');var config=require(_0x8cd3('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x8cd3('0x9')]=function(_0x145c4f,_0x2292b){return _0x145c4f[_0x8cd3('0xa')](_0x8cd3('0xb'),attributes,{'tableName':_0x8cd3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd57=['rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3397a4,_0x55b680){var _0x31183b=function(_0x3bf808){while(--_0x3bf808){_0x3397a4['push'](_0x3397a4['shift']());}};_0x31183b(++_0x55b680);}(_0xdd57,0x18c));var _0x7dd5=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xdd57[_0x5cbf0e];return _0x1c76f8;};'use strict';var _=require(_0x7dd5('0x0'));var util=require(_0x7dd5('0x1'));var logger=require(_0x7dd5('0x2'))(_0x7dd5('0x3'));var moment=require(_0x7dd5('0x4'));var BPromise=require(_0x7dd5('0x5'));var rp=require(_0x7dd5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7dd5('0x7'));var config=require(_0x7dd5('0x8'));var attributes=require(_0x7dd5('0x9'));module['exports']=function(_0x18778f,_0x38a738){return _0x18778f[_0x7dd5('0xa')](_0x7dd5('0xb'),attributes,{'tableName':_0x7dd5('0xc'),'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 2c6d4cb..1d31372 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 _0x86e9=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util'];(function(_0x37be66,_0x100346){var _0x3885f4=function(_0x194207){while(--_0x194207){_0x37be66['push'](_0x37be66['shift']());}};_0x3885f4(++_0x100346);}(_0x86e9,0x148));var _0x986e=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x86e9[_0x14f8ef];return _0x3b97f6;};'use strict';var _=require(_0x986e('0x0'));var util=require(_0x986e('0x1'));var moment=require(_0x986e('0x2'));var BPromise=require(_0x986e('0x3'));var rs=require(_0x986e('0x4'));var fs=require('fs');var Redis=require(_0x986e('0x5'));var db=require(_0x986e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x986e('0x7'));var config=require(_0x986e('0x8'));var jayson=require(_0x986e('0x9'));var client=jayson[_0x986e('0xa')][_0x986e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d9c58,_0xf42b52,_0x2d6cfe){return new BPromise(function(_0x27bede,_0x43609d){return client[_0x986e('0xc')](_0x2d9c58,_0x2d6cfe)[_0x986e('0xd')](function(_0x33ae91){logger[_0x986e('0xe')](_0x986e('0xf'),_0xf42b52,_0x986e('0x10'));logger[_0x986e('0x11')](_0x986e('0x12'),_0xf42b52,_0x986e('0x10'),JSON['stringify'](_0x33ae91));if(_0x33ae91[_0x986e('0x13')]){if(_0x33ae91[_0x986e('0x13')]['code']===0x1f4){logger[_0x986e('0x13')]('JscriptyProject,\x20%s,\x20%s',_0xf42b52,_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);return _0x43609d(_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);}logger[_0x986e('0x13')](_0x986e('0xf'),_0xf42b52,_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);return _0x27bede(_0x33ae91['error']['message']);}else{logger[_0x986e('0xe')]('JscriptyProject,\x20%s,\x20%s',_0xf42b52,'request\x20sent');_0x27bede(_0x33ae91['result'][_0x986e('0x14')]);}})[_0x986e('0x15')](function(_0x4569ba){logger[_0x986e('0x13')](_0x986e('0xf'),_0xf42b52,_0x4569ba);_0x43609d(_0x4569ba);});});} \ No newline at end of file +var _0x890b=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyProject,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x16fed8,_0x38177c){var _0x49ad66=function(_0xb36c1f){while(--_0xb36c1f){_0x16fed8['push'](_0x16fed8['shift']());}};_0x49ad66(++_0x38177c);}(_0x890b,0x12b));var _0xb890=function(_0x27b1a0,_0x4de944){_0x27b1a0=_0x27b1a0-0x0;var _0x4a9df9=_0x890b[_0x27b1a0];return _0x4a9df9;};'use strict';var _=require(_0xb890('0x0'));var util=require('util');var moment=require(_0xb890('0x1'));var BPromise=require(_0xb890('0x2'));var rs=require(_0xb890('0x3'));var fs=require('fs');var Redis=require(_0xb890('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb890('0x5'))('rpc');var config=require(_0xb890('0x6'));var jayson=require(_0xb890('0x7'));var client=jayson[_0xb890('0x8')][_0xb890('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41468b,_0x1bbcb2,_0x290824){return new BPromise(function(_0x47729d,_0x1f7159){return client[_0xb890('0xa')](_0x41468b,_0x290824)['then'](function(_0x4c3665){logger[_0xb890('0xb')](_0xb890('0xc'),_0x1bbcb2,'request\x20sent');logger[_0xb890('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x1bbcb2,_0xb890('0xe'),JSON[_0xb890('0xf')](_0x4c3665));if(_0x4c3665['error']){if(_0x4c3665[_0xb890('0x10')][_0xb890('0x11')]===0x1f4){logger['error'](_0xb890('0xc'),_0x1bbcb2,_0x4c3665[_0xb890('0x10')][_0xb890('0x12')]);return _0x1f7159(_0x4c3665[_0xb890('0x10')][_0xb890('0x12')]);}logger['error'](_0xb890('0xc'),_0x1bbcb2,_0x4c3665[_0xb890('0x10')]['message']);return _0x47729d(_0x4c3665['error'][_0xb890('0x12')]);}else{logger[_0xb890('0xb')](_0xb890('0xc'),_0x1bbcb2,_0xb890('0xe'));_0x47729d(_0x4c3665[_0xb890('0x13')][_0xb890('0x12')]);}})[_0xb890('0x14')](function(_0x590e5a){logger['error'](_0xb890('0xc'),_0x1bbcb2,_0x590e5a);_0x1f7159(_0x590e5a);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9aa9eb6..d3da6ba 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 _0xaf9a=['create','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x266f87,_0x5b5086){var _0x1ce676=function(_0x55014e){while(--_0x55014e){_0x266f87['push'](_0x266f87['shift']());}};_0x1ce676(++_0x5b5086);}(_0xaf9a,0x9b));var _0xaaf9=function(_0x396034,_0x3842d8){_0x396034=_0x396034-0x0;var _0x393894=_0xaf9a[_0x396034];return _0x393894;};'use strict';var multer=require(_0xaaf9('0x0'));var util=require('util');var path=require(_0xaaf9('0x1'));var timeout=require('connect-timeout');var express=require(_0xaaf9('0x2'));var router=express[_0xaaf9('0x3')]();var auth=require(_0xaaf9('0x4'));var interaction=require(_0xaaf9('0x5'));var config=require(_0xaaf9('0x6'));var controller=require(_0xaaf9('0x7'));router[_0xaaf9('0x8')]('/',auth['isAuthenticated'](),controller[_0xaaf9('0x9')]);router[_0xaaf9('0x8')](_0xaaf9('0xa'),auth['isAuthenticated'](),controller[_0xaaf9('0xb')]);router[_0xaaf9('0x8')](_0xaaf9('0xc'),auth[_0xaaf9('0xd')](),controller[_0xaaf9('0xe')]);router[_0xaaf9('0xf')]('/',auth[_0xaaf9('0xd')](),controller[_0xaaf9('0x10')]);router['put'](_0xaaf9('0xc'),auth[_0xaaf9('0xd')](),controller['update']);router[_0xaaf9('0x11')](_0xaaf9('0xc'),auth[_0xaaf9('0xd')](),controller[_0xaaf9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x585f=['/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x585f,0x184));var _0xf585=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x585f[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xf585('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf585('0x1'));var express=require(_0xf585('0x2'));var router=express[_0xf585('0x3')]();var auth=require(_0xf585('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf585('0x5'));var controller=require(_0xf585('0x6'));router['get']('/',auth[_0xf585('0x7')](),controller['index']);router[_0xf585('0x8')](_0xf585('0x9'),auth[_0xf585('0x7')](),controller[_0xf585('0xa')]);router['get'](_0xf585('0xb'),auth[_0xf585('0x7')](),controller[_0xf585('0xc')]);router[_0xf585('0xd')]('/',auth[_0xf585('0x7')](),controller[_0xf585('0xe')]);router[_0xf585('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf585('0x10')](_0xf585('0xb'),auth[_0xf585('0x7')](),controller[_0xf585('0x11')]);module[_0xf585('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 63f9cd7..a7c999a 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 _0x51d9=['sequelize','exports','STRING','TEXT','long'];(function(_0x159c66,_0x23a8d3){var _0x1d2cb8=function(_0x1068a0){while(--_0x1068a0){_0x159c66['push'](_0x159c66['shift']());}};_0x1d2cb8(++_0x23a8d3);}(_0x51d9,0x1a9));var _0x951d=function(_0x4a9bfe,_0x3bb585){_0x4a9bfe=_0x4a9bfe-0x0;var _0xd8f755=_0x51d9[_0x4a9bfe];return _0xd8f755;};'use strict';var Sequelize=require(_0x951d('0x0'));module[_0x951d('0x1')]={'question':{'type':Sequelize[_0x951d('0x2')]},'answer':{'type':Sequelize[_0x951d('0x3')](_0x951d('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x951d('0x2')]},'queue':{'type':Sequelize[_0x951d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x951d('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7c98=['TEXT','long','STRING','sequelize','exports'];(function(_0x426807,_0xe15ced){var _0x5d83b5=function(_0x2c6d1c){while(--_0x2c6d1c){_0x426807['push'](_0x426807['shift']());}};_0x5d83b5(++_0xe15ced);}(_0x7c98,0x8a));var _0x87c9=function(_0x455fea,_0x51f808){_0x455fea=_0x455fea-0x0;var _0x32f39b=_0x7c98[_0x455fea];return _0x32f39b;};'use strict';var Sequelize=require(_0x87c9('0x0'));module[_0x87c9('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x87c9('0x2')](_0x87c9('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x87c9('0x4')]},'calleridname':{'type':Sequelize[_0x87c9('0x4')]},'calleridnum':{'type':Sequelize[_0x87c9('0x4')]},'questionId':{'type':Sequelize[_0x87c9('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 003cf18..f39752a 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 _0xd36d=['eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','name','send','index','JscriptyQuestionReport','rawAttributes','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','describe','html-pdf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd36d,0x1c6));var _0xdd36=function(_0x1d06f2,_0x1e3a1c){_0x1d06f2=_0x1d06f2-0x0;var _0x197585=_0xd36d[_0x1d06f2];return _0x197585;};'use strict';var pdf=require(_0xdd36('0x0'));var emlformat=require(_0xdd36('0x1'));var rimraf=require(_0xdd36('0x2'));var zipdir=require(_0xdd36('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd36('0x4'));var moment=require('moment');var BPromise=require(_0xdd36('0x5'));var Mustache=require(_0xdd36('0x6'));var util=require(_0xdd36('0x7'));var path=require(_0xdd36('0x8'));var sox=require('sox');var csv=require(_0xdd36('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd36('0xa'));var squel=require(_0xdd36('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdd36('0xc'));var authService=require(_0xdd36('0xd'));var qs=require(_0xdd36('0xe'));var as=require(_0xdd36('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd36('0x10'))('api');var utils=require(_0xdd36('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137bc4,_0x275fd3){_0x275fd3=_0x275fd3||0xcc;return function(_0x3573ff){if(_0x3573ff){return _0x137bc4[_0xdd36('0x12')](_0x275fd3);}return _0x137bc4[_0xdd36('0x13')](_0x275fd3)[_0xdd36('0x14')]();};}function respondWithResult(_0x172b42,_0x4f650f){_0x4f650f=_0x4f650f||0xc8;return function(_0x495f1f){if(_0x495f1f){return _0x172b42['status'](_0x4f650f)[_0xdd36('0x15')](_0x495f1f);}};}function respondWithFilteredResult(_0x54b717,_0x515177){return function(_0x63c86f){if(_0x63c86f){var _0x25bf9b=_0x63c86f[_0xdd36('0x16')],_0x18b51d=_0x515177[_0xdd36('0x17')],_0x296d57=_0x515177[_0xdd36('0x17')]+_0x515177[_0xdd36('0x18')],_0x5917ba;if(_0x296d57>=_0x25bf9b){_0x296d57=_0x25bf9b;_0x5917ba=0xc8;}else{_0x5917ba=0xce;}_0x54b717[_0xdd36('0x13')](_0x5917ba);return _0x54b717['set'](_0xdd36('0x19'),_0x18b51d+'-'+_0x296d57+'/'+_0x25bf9b)[_0xdd36('0x15')](_0x63c86f);}return null;};}function patchUpdates(_0x48ceb4){return function(_0x4b565e){try{jsonpatch['apply'](_0x4b565e,_0x48ceb4,!![]);}catch(_0x4ddca8){return BPromise[_0xdd36('0x1a')](_0x4ddca8);}return _0x4b565e['save']();};}function saveUpdates(_0x120433,_0x1b203b){return function(_0x2a00a0){if(_0x2a00a0){return _0x2a00a0[_0xdd36('0x1b')](_0x120433)[_0xdd36('0x1c')](function(_0x1a4e6e){return _0x1a4e6e;});}return null;};}function removeEntity(_0x3b7850,_0x4924cc){return function(_0x57b526){if(_0x57b526){return _0x57b526[_0xdd36('0x1d')]()[_0xdd36('0x1c')](function(){_0x3b7850[_0xdd36('0x13')](0xcc)[_0xdd36('0x14')]();});}};}function handleEntityNotFound(_0x4fb7b8,_0x7ba246){return function(_0x84d937){if(!_0x84d937){_0x4fb7b8['sendStatus'](0x194);}return _0x84d937;};}function handleError(_0x4e5b7f,_0x35b33b){_0x35b33b=_0x35b33b||0x1f4;return function(_0x4b0d07){logger[_0xdd36('0x1e')](_0x4b0d07['stack']);if(_0x4b0d07[_0xdd36('0x1f')]){delete _0x4b0d07['name'];}_0x4e5b7f[_0xdd36('0x13')](_0x35b33b)[_0xdd36('0x20')](_0x4b0d07);};}exports[_0xdd36('0x21')]=function(_0x33a51a,_0x2bb775){var _0x3f3d55={},_0x2509be={},_0x2ee09c={'count':0x0,'rows':[]};var _0x427d77=_['map'](db[_0xdd36('0x22')][_0xdd36('0x23')],function(_0x471292){return{'name':_0x471292['fieldName'],'type':_0x471292['type']['key']};});_0x2509be[_0xdd36('0x24')]=_[_0xdd36('0x25')](_0x427d77,'name');_0x2509be[_0xdd36('0x26')]=_[_0xdd36('0x27')](_0x33a51a[_0xdd36('0x26')]);_0x2509be[_0xdd36('0x28')]=_['intersection'](_0x2509be[_0xdd36('0x24')],_0x2509be[_0xdd36('0x26')]);_0x3f3d55[_0xdd36('0x29')]=_['intersection'](_0x2509be['model'],qs['fields'](_0x33a51a['query'][_0xdd36('0x2a')]));_0x3f3d55['attributes']=_0x3f3d55[_0xdd36('0x29')][_0xdd36('0x2b')]?_0x3f3d55[_0xdd36('0x29')]:_0x2509be['model'];if(!_0x33a51a[_0xdd36('0x26')]['hasOwnProperty'](_0xdd36('0x2c'))){_0x3f3d55['limit']=qs[_0xdd36('0x18')](_0x33a51a[_0xdd36('0x26')][_0xdd36('0x18')]);_0x3f3d55[_0xdd36('0x17')]=qs[_0xdd36('0x17')](_0x33a51a[_0xdd36('0x26')]['offset']);}_0x3f3d55[_0xdd36('0x2d')]=qs[_0xdd36('0x2e')](_0x33a51a[_0xdd36('0x26')][_0xdd36('0x2e')]);_0x3f3d55[_0xdd36('0x2f')]=qs[_0xdd36('0x28')](_[_0xdd36('0x30')](_0x33a51a[_0xdd36('0x26')],_0x2509be[_0xdd36('0x28')]),_0x427d77);if(_0x33a51a[_0xdd36('0x26')]['filter']){_0x3f3d55[_0xdd36('0x2f')]=_[_0xdd36('0x31')](_0x3f3d55['where'],{'$or':_[_0xdd36('0x25')](_0x427d77,function(_0x4b05d7){if(_0x4b05d7[_0xdd36('0x32')]!==_0xdd36('0x33')){var _0xa36a38={};_0xa36a38[_0x4b05d7[_0xdd36('0x1f')]]={'$like':'%'+_0x33a51a['query']['filter']+'%'};return _0xa36a38;}})});}_0x3f3d55=_['merge']({},_0x3f3d55,_0x33a51a[_0xdd36('0x34')]);var _0xb05d6c={'where':_0x3f3d55['where']};return db[_0xdd36('0x22')][_0xdd36('0x16')](_0xb05d6c)[_0xdd36('0x1c')](function(_0x24df73){_0x2ee09c[_0xdd36('0x16')]=_0x24df73;if(_0x33a51a[_0xdd36('0x26')][_0xdd36('0x35')]){_0x3f3d55[_0xdd36('0x36')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xdd36('0x37')](_0x3f3d55);})[_0xdd36('0x1c')](function(_0x46f254){_0x2ee09c[_0xdd36('0x38')]=_0x46f254;return _0x2ee09c;})[_0xdd36('0x1c')](respondWithFilteredResult(_0x2bb775,_0x3f3d55))[_0xdd36('0x39')](handleError(_0x2bb775,null));};exports[_0xdd36('0x3a')]=function(_0x30ef06,_0x1f29ec){var _0x341f9c={'raw':!![],'where':{'id':_0x30ef06['params']['id']}},_0x2b6440={};_0x2b6440['model']=_[_0xdd36('0x27')](db[_0xdd36('0x22')][_0xdd36('0x23')]);_0x2b6440['query']=_['keys'](_0x30ef06[_0xdd36('0x26')]);_0x2b6440['filters']=_[_0xdd36('0x3b')](_0x2b6440[_0xdd36('0x24')],_0x2b6440[_0xdd36('0x26')]);_0x341f9c[_0xdd36('0x29')]=_['intersection'](_0x2b6440[_0xdd36('0x24')],qs[_0xdd36('0x2a')](_0x30ef06['query'][_0xdd36('0x2a')]));_0x341f9c[_0xdd36('0x29')]=_0x341f9c[_0xdd36('0x29')][_0xdd36('0x2b')]?_0x341f9c[_0xdd36('0x29')]:_0x2b6440['model'];if(_0x30ef06[_0xdd36('0x26')][_0xdd36('0x35')]){_0x341f9c[_0xdd36('0x36')]=[{'all':!![]}];}_0x341f9c=_[_0xdd36('0x31')]({},_0x341f9c,_0x30ef06[_0xdd36('0x34')]);return db[_0xdd36('0x22')][_0xdd36('0x3c')](_0x341f9c)[_0xdd36('0x1c')](handleEntityNotFound(_0x1f29ec,null))[_0xdd36('0x1c')](respondWithResult(_0x1f29ec,null))['catch'](handleError(_0x1f29ec,null));};exports[_0xdd36('0x3d')]=function(_0xbf72ca,_0x46393f){return db[_0xdd36('0x22')][_0xdd36('0x3d')](_0xbf72ca['body'],{})['then'](respondWithResult(_0x46393f,0xc9))[_0xdd36('0x39')](handleError(_0x46393f,null));};exports['update']=function(_0x40d803,_0x23f828){if(_0x40d803[_0xdd36('0x3e')]['id']){delete _0x40d803[_0xdd36('0x3e')]['id'];}return db[_0xdd36('0x22')][_0xdd36('0x3c')]({'where':{'id':_0x40d803[_0xdd36('0x3f')]['id']}})[_0xdd36('0x1c')](handleEntityNotFound(_0x23f828,null))['then'](saveUpdates(_0x40d803[_0xdd36('0x3e')],null))['then'](respondWithResult(_0x23f828,null))['catch'](handleError(_0x23f828,null));};exports[_0xdd36('0x1d')]=function(_0x3dadc0,_0x170e73){return db['JscriptyQuestionReport'][_0xdd36('0x3c')]({'where':{'id':_0x3dadc0[_0xdd36('0x3f')]['id']}})[_0xdd36('0x1c')](handleEntityNotFound(_0x170e73,null))[_0xdd36('0x1c')](removeEntity(_0x170e73,null))['catch'](handleError(_0x170e73,null));};exports[_0xdd36('0x40')]=function(_0x6e7bf4,_0x47ea86){return db[_0xdd36('0x22')]['describe']()[_0xdd36('0x1c')](respondWithResult(_0x47ea86,null))[_0xdd36('0x39')](handleError(_0x47ea86,null));}; \ No newline at end of file +var _0x7486=['update','then','destroy','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','name','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','filters','pick','filter','merge','options','include','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','sendStatus','end','status','count','set','Content-Range','json','reject'];(function(_0x18588,_0x5e1235){var _0x5a21b2=function(_0x24fcf7){while(--_0x24fcf7){_0x18588['push'](_0x18588['shift']());}};_0x5a21b2(++_0x5e1235);}(_0x7486,0xf4));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x6748('0x0'));var emlformat=require(_0x6748('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6748('0x2'));var jsonpatch=require(_0x6748('0x3'));var rp=require('request-promise');var moment=require(_0x6748('0x4'));var BPromise=require(_0x6748('0x5'));var Mustache=require('mustache');var util=require(_0x6748('0x6'));var path=require(_0x6748('0x7'));var sox=require('sox');var csv=require(_0x6748('0x8'));var ejs=require(_0x6748('0x9'));var fs=require('fs');var _=require(_0x6748('0xa'));var squel=require(_0x6748('0xb'));var crypto=require(_0x6748('0xc'));var jsforce=require(_0x6748('0xd'));var deskjs=require(_0x6748('0xe'));var toCsv=require(_0x6748('0x8'));var querystring=require(_0x6748('0xf'));var Papa=require(_0x6748('0x10'));var Redis=require(_0x6748('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6748('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6748('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x585403,_0x39fd00){_0x39fd00=_0x39fd00||0xcc;return function(_0x59aeda){if(_0x59aeda){return _0x585403[_0x6748('0x14')](_0x39fd00);}return _0x585403['status'](_0x39fd00)[_0x6748('0x15')]();};}function respondWithResult(_0x7865ed,_0x478563){_0x478563=_0x478563||0xc8;return function(_0x1fa626){if(_0x1fa626){return _0x7865ed[_0x6748('0x16')](_0x478563)['json'](_0x1fa626);}};}function respondWithFilteredResult(_0x57bcfd,_0xb40ad8){return function(_0x5b04b3){if(_0x5b04b3){var _0x482800=_0x5b04b3[_0x6748('0x17')],_0x51483a=_0xb40ad8['offset'],_0x5265a8=_0xb40ad8['offset']+_0xb40ad8['limit'],_0x3689d8;if(_0x5265a8>=_0x482800){_0x5265a8=_0x482800;_0x3689d8=0xc8;}else{_0x3689d8=0xce;}_0x57bcfd['status'](_0x3689d8);return _0x57bcfd[_0x6748('0x18')](_0x6748('0x19'),_0x51483a+'-'+_0x5265a8+'/'+_0x482800)[_0x6748('0x1a')](_0x5b04b3);}return null;};}function patchUpdates(_0x19d24d){return function(_0x1b63fe){try{jsonpatch['apply'](_0x1b63fe,_0x19d24d,!![]);}catch(_0x370913){return BPromise[_0x6748('0x1b')](_0x370913);}return _0x1b63fe['save']();};}function saveUpdates(_0x22eeaa,_0x54e87f){return function(_0x4b7bea){if(_0x4b7bea){return _0x4b7bea[_0x6748('0x1c')](_0x22eeaa)[_0x6748('0x1d')](function(_0x11320a){return _0x11320a;});}return null;};}function removeEntity(_0x533cda,_0x21b48e){return function(_0x492cc8){if(_0x492cc8){return _0x492cc8[_0x6748('0x1e')]()[_0x6748('0x1d')](function(){_0x533cda['status'](0xcc)[_0x6748('0x15')]();});}};}function handleEntityNotFound(_0x4ab7d1,_0x5c181f){return function(_0x8318c5){if(!_0x8318c5){_0x4ab7d1[_0x6748('0x14')](0x194);}return _0x8318c5;};}function handleError(_0x3d6c23,_0x3bdb9f){_0x3bdb9f=_0x3bdb9f||0x1f4;return function(_0x33e9c6){logger[_0x6748('0x1f')](_0x33e9c6[_0x6748('0x20')]);if(_0x33e9c6['name']){delete _0x33e9c6['name'];}_0x3d6c23[_0x6748('0x16')](_0x3bdb9f)[_0x6748('0x21')](_0x33e9c6);};}exports[_0x6748('0x22')]=function(_0x3f8ead,_0x5f448c){var _0x26ed1a={},_0xbbd255={},_0x286d82={'count':0x0,'rows':[]};var _0x424f1b=_[_0x6748('0x23')](db[_0x6748('0x24')][_0x6748('0x25')],function(_0x839d19){return{'name':_0x839d19['fieldName'],'type':_0x839d19[_0x6748('0x26')][_0x6748('0x27')]};});_0xbbd255[_0x6748('0x28')]=_['map'](_0x424f1b,_0x6748('0x29'));_0xbbd255['query']=_[_0x6748('0x2a')](_0x3f8ead[_0x6748('0x2b')]);_0xbbd255['filters']=_['intersection'](_0xbbd255[_0x6748('0x28')],_0xbbd255['query']);_0x26ed1a[_0x6748('0x2c')]=_[_0x6748('0x2d')](_0xbbd255['model'],qs[_0x6748('0x2e')](_0x3f8ead[_0x6748('0x2b')]['fields']));_0x26ed1a['attributes']=_0x26ed1a['attributes'][_0x6748('0x2f')]?_0x26ed1a[_0x6748('0x2c')]:_0xbbd255[_0x6748('0x28')];if(!_0x3f8ead[_0x6748('0x2b')][_0x6748('0x30')](_0x6748('0x31'))){_0x26ed1a[_0x6748('0x32')]=qs[_0x6748('0x32')](_0x3f8ead[_0x6748('0x2b')][_0x6748('0x32')]);_0x26ed1a[_0x6748('0x33')]=qs['offset'](_0x3f8ead[_0x6748('0x2b')][_0x6748('0x33')]);}_0x26ed1a['order']=qs[_0x6748('0x34')](_0x3f8ead[_0x6748('0x2b')][_0x6748('0x34')]);_0x26ed1a[_0x6748('0x35')]=qs[_0x6748('0x36')](_[_0x6748('0x37')](_0x3f8ead[_0x6748('0x2b')],_0xbbd255[_0x6748('0x36')]),_0x424f1b);if(_0x3f8ead[_0x6748('0x2b')][_0x6748('0x38')]){_0x26ed1a[_0x6748('0x35')]=_[_0x6748('0x39')](_0x26ed1a[_0x6748('0x35')],{'$or':_[_0x6748('0x23')](_0x424f1b,function(_0x1cae11){if(_0x1cae11['type']!=='VIRTUAL'){var _0x4e3e03={};_0x4e3e03[_0x1cae11[_0x6748('0x29')]]={'$like':'%'+_0x3f8ead[_0x6748('0x2b')][_0x6748('0x38')]+'%'};return _0x4e3e03;}})});}_0x26ed1a=_[_0x6748('0x39')]({},_0x26ed1a,_0x3f8ead[_0x6748('0x3a')]);var _0x201c48={'where':_0x26ed1a[_0x6748('0x35')]};return db[_0x6748('0x24')][_0x6748('0x17')](_0x201c48)[_0x6748('0x1d')](function(_0x429b97){_0x286d82[_0x6748('0x17')]=_0x429b97;if(_0x3f8ead[_0x6748('0x2b')]['includeAll']){_0x26ed1a[_0x6748('0x3b')]=[{'all':!![]}];}return db[_0x6748('0x24')]['findAll'](_0x26ed1a);})[_0x6748('0x1d')](function(_0x5eda3b){_0x286d82[_0x6748('0x3c')]=_0x5eda3b;return _0x286d82;})['then'](respondWithFilteredResult(_0x5f448c,_0x26ed1a))[_0x6748('0x3d')](handleError(_0x5f448c,null));};exports[_0x6748('0x3e')]=function(_0x5e675e,_0x158768){var _0x12e312={'raw':!![],'where':{'id':_0x5e675e[_0x6748('0x3f')]['id']}},_0x4444d1={};_0x4444d1[_0x6748('0x28')]=_['keys'](db[_0x6748('0x24')][_0x6748('0x25')]);_0x4444d1[_0x6748('0x2b')]=_[_0x6748('0x2a')](_0x5e675e['query']);_0x4444d1['filters']=_[_0x6748('0x2d')](_0x4444d1['model'],_0x4444d1[_0x6748('0x2b')]);_0x12e312[_0x6748('0x2c')]=_['intersection'](_0x4444d1[_0x6748('0x28')],qs[_0x6748('0x2e')](_0x5e675e[_0x6748('0x2b')][_0x6748('0x2e')]));_0x12e312[_0x6748('0x2c')]=_0x12e312[_0x6748('0x2c')][_0x6748('0x2f')]?_0x12e312[_0x6748('0x2c')]:_0x4444d1[_0x6748('0x28')];if(_0x5e675e[_0x6748('0x2b')]['includeAll']){_0x12e312[_0x6748('0x3b')]=[{'all':!![]}];}_0x12e312=_[_0x6748('0x39')]({},_0x12e312,_0x5e675e[_0x6748('0x3a')]);return db[_0x6748('0x24')]['find'](_0x12e312)[_0x6748('0x1d')](handleEntityNotFound(_0x158768,null))[_0x6748('0x1d')](respondWithResult(_0x158768,null))[_0x6748('0x3d')](handleError(_0x158768,null));};exports[_0x6748('0x40')]=function(_0x5841f5,_0x2895e4){return db['JscriptyQuestionReport'][_0x6748('0x40')](_0x5841f5[_0x6748('0x41')],{})[_0x6748('0x1d')](respondWithResult(_0x2895e4,0xc9))['catch'](handleError(_0x2895e4,null));};exports['update']=function(_0x403195,_0x5caec0){if(_0x403195[_0x6748('0x41')]['id']){delete _0x403195[_0x6748('0x41')]['id'];}return db[_0x6748('0x24')][_0x6748('0x42')]({'where':{'id':_0x403195['params']['id']}})[_0x6748('0x1d')](handleEntityNotFound(_0x5caec0,null))[_0x6748('0x1d')](saveUpdates(_0x403195['body'],null))[_0x6748('0x1d')](respondWithResult(_0x5caec0,null))[_0x6748('0x3d')](handleError(_0x5caec0,null));};exports[_0x6748('0x1e')]=function(_0x1fac0c,_0x1cf259){return db[_0x6748('0x24')]['find']({'where':{'id':_0x1fac0c[_0x6748('0x3f')]['id']}})[_0x6748('0x1d')](handleEntityNotFound(_0x1cf259,null))[_0x6748('0x1d')](removeEntity(_0x1cf259,null))['catch'](handleError(_0x1cf259,null));};exports['describe']=function(_0x5ac7ab,_0x2798bd){return db[_0x6748('0x24')][_0x6748('0x43')]()[_0x6748('0x1d')](respondWithResult(_0x2798bd,null))[_0x6748('0x3d')](handleError(_0x2798bd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 53b7eb9..8523284 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 _0xc361=['path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','lodash','../../config/logger','api','moment','request-promise'];(function(_0x13e0c6,_0x28f847){var _0x479450=function(_0xfb5f95){while(--_0xfb5f95){_0x13e0c6['push'](_0x13e0c6['shift']());}};_0x479450(++_0x28f847);}(_0xc361,0x8a));var _0x1c36=function(_0x54d8c4,_0x4d19cf){_0x54d8c4=_0x54d8c4-0x0;var _0x3568f4=_0xc361[_0x54d8c4];return _0x3568f4;};'use strict';var _=require(_0x1c36('0x0'));var util=require('util');var logger=require(_0x1c36('0x1'))(_0x1c36('0x2'));var moment=require(_0x1c36('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c36('0x4'));var fs=require('fs');var path=require(_0x1c36('0x5'));var rimraf=require(_0x1c36('0x6'));var config=require(_0x1c36('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x1c36('0x8')]=function(_0x1b7cce,_0x5effb5){return _0x1b7cce[_0x1c36('0x9')](_0x1c36('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47f2=['bluebird','request-promise','path','rimraf','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47f2,0xec));var _0x247f=function(_0x15ba03,_0x18bcc6){_0x15ba03=_0x15ba03-0x0;var _0x51da14=_0x47f2[_0x15ba03];return _0x51da14;};'use strict';var _=require('lodash');var util=require(_0x247f('0x0'));var logger=require(_0x247f('0x1'))(_0x247f('0x2'));var moment=require(_0x247f('0x3'));var BPromise=require(_0x247f('0x4'));var rp=require(_0x247f('0x5'));var fs=require('fs');var path=require(_0x247f('0x6'));var rimraf=require(_0x247f('0x7'));var config=require(_0x247f('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x247f('0x9')]=function(_0x4b2a0e,_0x143c32){return _0x4b2a0e['define'](_0x247f('0xa'),attributes,{'tableName':_0x247f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 42be203..96a777d 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 _0x7285=['then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7285,0x82));var _0x5728=function(_0x102106,_0x2f75c9){_0x102106=_0x102106-0x0;var _0x29b019=_0x7285[_0x102106];return _0x29b019;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5728('0x0'));var BPromise=require(_0x5728('0x1'));var rs=require(_0x5728('0x2'));var fs=require('fs');var Redis=require(_0x5728('0x3'));var db=require(_0x5728('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5728('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5728('0x6'));var client=jayson[_0x5728('0x7')][_0x5728('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bf52,_0x7241a4,_0x51c8d2){return new BPromise(function(_0x593d98,_0x422b6d){return client[_0x5728('0x9')](_0x12bf52,_0x51c8d2)[_0x5728('0xa')](function(_0x4e7af9){logger['info'](_0x5728('0xb'),_0x7241a4,_0x5728('0xc'));logger[_0x5728('0xd')](_0x5728('0xe'),_0x7241a4,_0x5728('0xc'),JSON[_0x5728('0xf')](_0x4e7af9));if(_0x4e7af9[_0x5728('0x10')]){if(_0x4e7af9[_0x5728('0x10')]['code']===0x1f4){logger[_0x5728('0x10')](_0x5728('0xb'),_0x7241a4,_0x4e7af9[_0x5728('0x10')][_0x5728('0x11')]);return _0x422b6d(_0x4e7af9[_0x5728('0x10')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x7241a4,_0x4e7af9[_0x5728('0x10')]['message']);return _0x593d98(_0x4e7af9[_0x5728('0x10')][_0x5728('0x11')]);}else{logger[_0x5728('0x12')](_0x5728('0xb'),_0x7241a4,_0x5728('0xc'));_0x593d98(_0x4e7af9[_0x5728('0x13')]['message']);}})['catch'](function(_0x530f47){logger[_0x5728('0x10')](_0x5728('0xb'),_0x7241a4,_0x530f47);_0x422b6d(_0x530f47);});});} \ No newline at end of file +var _0x9cbf=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9cbf,0x124));var _0xf9cb=function(_0x15f1ad,_0x452be1){_0x15f1ad=_0x15f1ad-0x0;var _0x2ad951=_0x9cbf[_0x15f1ad];return _0x2ad951;};'use strict';var _=require(_0xf9cb('0x0'));var util=require(_0xf9cb('0x1'));var moment=require(_0xf9cb('0x2'));var BPromise=require(_0xf9cb('0x3'));var rs=require(_0xf9cb('0x4'));var fs=require('fs');var Redis=require(_0xf9cb('0x5'));var db=require(_0xf9cb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf9cb('0x7'));var config=require(_0xf9cb('0x8'));var jayson=require(_0xf9cb('0x9'));var client=jayson[_0xf9cb('0xa')][_0xf9cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50089e,_0x25dccc,_0x54ed18){return new BPromise(function(_0x39ec71,_0x5ebd8f){return client[_0xf9cb('0xc')](_0x50089e,_0x54ed18)[_0xf9cb('0xd')](function(_0x1c0503){logger[_0xf9cb('0xe')](_0xf9cb('0xf'),_0x25dccc,_0xf9cb('0x10'));logger['debug'](_0xf9cb('0x11'),_0x25dccc,_0xf9cb('0x10'),JSON['stringify'](_0x1c0503));if(_0x1c0503[_0xf9cb('0x12')]){if(_0x1c0503[_0xf9cb('0x12')][_0xf9cb('0x13')]===0x1f4){logger[_0xf9cb('0x12')](_0xf9cb('0xf'),_0x25dccc,_0x1c0503['error'][_0xf9cb('0x14')]);return _0x5ebd8f(_0x1c0503['error'][_0xf9cb('0x14')]);}logger[_0xf9cb('0x12')](_0xf9cb('0xf'),_0x25dccc,_0x1c0503[_0xf9cb('0x12')]['message']);return _0x39ec71(_0x1c0503['error'][_0xf9cb('0x14')]);}else{logger[_0xf9cb('0xe')](_0xf9cb('0xf'),_0x25dccc,'request\x20sent');_0x39ec71(_0x1c0503[_0xf9cb('0x15')][_0xf9cb('0x14')]);}})[_0xf9cb('0x16')](function(_0x3f4144){logger[_0xf9cb('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x25dccc,_0x3f4144);_0x5ebd8f(_0x3f4144);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 027266f..cdef273 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 _0x07c3=['show','/:id/questions','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x07c3,0x1bf));var _0x307c=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x07c3[_0x503950];return _0x1657a9;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require(_0x307c('0x4'));var router=express[_0x307c('0x5')]();var auth=require(_0x307c('0x6'));var interaction=require(_0x307c('0x7'));var config=require('../../config/environment');var controller=require(_0x307c('0x8'));router[_0x307c('0x9')]('/',auth[_0x307c('0xa')](),controller[_0x307c('0xb')]);router[_0x307c('0x9')](_0x307c('0xc'),auth[_0x307c('0xa')](),controller[_0x307c('0xd')]);router[_0x307c('0x9')](_0x307c('0xe'),auth[_0x307c('0xa')](),controller[_0x307c('0xf')]);router[_0x307c('0x9')](_0x307c('0x10'),auth[_0x307c('0xa')](),controller['getQuestions']);router[_0x307c('0x11')]('/',auth[_0x307c('0xa')](),controller[_0x307c('0x12')]);router[_0x307c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x307c('0x14')]);router['delete'](_0x307c('0xe'),auth[_0x307c('0xa')](),controller['destroy']);module[_0x307c('0x15')]=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','index','isAuthenticated','describe','show','getQuestions','post','create','/:id','update','delete','multer','util','path'];(function(_0x30fd47,_0x389d3a){var _0x517e73=function(_0x6169b0){while(--_0x6169b0){_0x30fd47['push'](_0x30fd47['shift']());}};_0x517e73(++_0x389d3a);}(_0xb138,0x1dd));var _0x8b13=function(_0x5edfa6,_0x3732c9){_0x5edfa6=_0x5edfa6-0x0;var _0x19379f=_0xb138[_0x5edfa6];return _0x19379f;};'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')]('/describe',auth[_0x8b13('0xb')](),controller[_0x8b13('0xc')]);router[_0x8b13('0x9')]('/:id',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['get']('/:id/questions',auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);router[_0x8b13('0xf')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0x10')]);router['put'](_0x8b13('0x11'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x12')]);router[_0x8b13('0x13')](_0x8b13('0x11'),auth[_0x8b13('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 029b458..0a67571 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 _0xca0d=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','endtime'];(function(_0x5aa86d,_0x619a5c){var _0x377da0=function(_0x344cf6){while(--_0x344cf6){_0x5aa86d['push'](_0x5aa86d['shift']());}};_0x377da0(++_0x619a5c);}(_0xca0d,0x10c));var _0xdca0=function(_0x493efe,_0x3a60ba){_0x493efe=_0x493efe-0x0;var _0x554a59=_0xca0d[_0x493efe];return _0x554a59;};'use strict';var moment=require(_0xdca0('0x0'));var Sequelize=require('sequelize');module[_0xdca0('0x1')]={'starttime':{'type':Sequelize[_0xdca0('0x2')],'set':function(_0x1affdb){this[_0xdca0('0x3')]('starttime',_0x1affdb);this[_0xdca0('0x3')](_0xdca0('0x4'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdca0('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdca0('0x5')]},'calleridname':{'type':Sequelize[_0xdca0('0x5')]},'calleridnum':{'type':Sequelize[_0xdca0('0x5')]},'completed':{'type':Sequelize[_0xdca0('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x45e8=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','DATE','setDataValue','starttime','format'];(function(_0x2dfd0e,_0x13739e){var _0x343af6=function(_0x206e2f){while(--_0x206e2f){_0x2dfd0e['push'](_0x2dfd0e['shift']());}};_0x343af6(++_0x13739e);}(_0x45e8,0x1a3));var _0x845e=function(_0x16295e,_0x4a9b05){_0x16295e=_0x16295e-0x0;var _0x2d9e54=_0x45e8[_0x16295e];return _0x2d9e54;};'use strict';var moment=require(_0x845e('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x845e('0x1')],'set':function(_0x5c5343){this[_0x845e('0x2')](_0x845e('0x3'),_0x5c5343);this[_0x845e('0x2')]('endtime',moment()[_0x845e('0x4')](_0x845e('0x5')));}},'endtime':{'type':Sequelize[_0x845e('0x1')]},'membername':{'type':Sequelize[_0x845e('0x6')]},'projectname':{'type':Sequelize[_0x845e('0x6')]},'queue':{'type':Sequelize[_0x845e('0x6')]},'uniqueid':{'type':Sequelize[_0x845e('0x6')]},'calleridname':{'type':Sequelize[_0x845e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x845e('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c31da9f..6a5b4f5 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 _0xb1ed=['json','apply','save','update','then','error','stack','send','index','map','JscriptySessionReport','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','params','rawAttributes','create','body','find','describe','getQuestions','findOne','hasOwnProperty','nolimit','pick','JscriptyQuestionReport','include','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','status','set'];(function(_0xc52b54,_0x217e40){var _0x2864e8=function(_0x5d9e1f){while(--_0x5d9e1f){_0xc52b54['push'](_0xc52b54['shift']());}};_0x2864e8(++_0x217e40);}(_0xb1ed,0xce));var _0xdb1e=function(_0x319f60,_0x4f36b0){_0x319f60=_0x319f60-0x0;var _0x1d4491=_0xb1ed[_0x319f60];return _0x1d4491;};'use strict';var pdf=require(_0xdb1e('0x0'));var emlformat=require(_0xdb1e('0x1'));var rimraf=require(_0xdb1e('0x2'));var zipdir=require(_0xdb1e('0x3'));var jsonpatch=require(_0xdb1e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb1e('0x5'));var Mustache=require(_0xdb1e('0x6'));var util=require(_0xdb1e('0x7'));var path=require(_0xdb1e('0x8'));var sox=require(_0xdb1e('0x9'));var csv=require('to-csv');var ejs=require(_0xdb1e('0xa'));var fs=require('fs');var _=require(_0xdb1e('0xb'));var squel=require(_0xdb1e('0xc'));var crypto=require(_0xdb1e('0xd'));var jsforce=require(_0xdb1e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdb1e('0xf'));var querystring=require(_0xdb1e('0x10'));var Papa=require(_0xdb1e('0x11'));var Redis=require(_0xdb1e('0x12'));var authService=require(_0xdb1e('0x13'));var qs=require(_0xdb1e('0x14'));var as=require(_0xdb1e('0x15'));var hardwareService=require(_0xdb1e('0x16'));var logger=require(_0xdb1e('0x17'))(_0xdb1e('0x18'));var utils=require(_0xdb1e('0x19'));var config=require(_0xdb1e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e5fa,_0x358e35){_0x358e35=_0x358e35||0xcc;return function(_0xb8c31b){if(_0xb8c31b){return _0x29e5fa[_0xdb1e('0x1b')](_0x358e35);}return _0x29e5fa['status'](_0x358e35)[_0xdb1e('0x1c')]();};}function respondWithResult(_0x438291,_0x47e5b9){_0x47e5b9=_0x47e5b9||0xc8;return function(_0x16da1d){if(_0x16da1d){return _0x438291['status'](_0x47e5b9)['json'](_0x16da1d);}};}function respondWithFilteredResult(_0x13824d,_0x4761a8){return function(_0x40cbd9){if(_0x40cbd9){var _0x4432e6=_0x40cbd9[_0xdb1e('0x1d')],_0x7ce2db=_0x4761a8[_0xdb1e('0x1e')],_0x29ef8a=_0x4761a8[_0xdb1e('0x1e')]+_0x4761a8[_0xdb1e('0x1f')],_0x544c6d;if(_0x29ef8a>=_0x4432e6){_0x29ef8a=_0x4432e6;_0x544c6d=0xc8;}else{_0x544c6d=0xce;}_0x13824d[_0xdb1e('0x20')](_0x544c6d);return _0x13824d[_0xdb1e('0x21')]('Content-Range',_0x7ce2db+'-'+_0x29ef8a+'/'+_0x4432e6)[_0xdb1e('0x22')](_0x40cbd9);}return null;};}function patchUpdates(_0x14ebff){return function(_0x421de2){try{jsonpatch[_0xdb1e('0x23')](_0x421de2,_0x14ebff,!![]);}catch(_0xd3dc54){return BPromise['reject'](_0xd3dc54);}return _0x421de2[_0xdb1e('0x24')]();};}function saveUpdates(_0x1c0b0e,_0x331e8c){return function(_0xd46b57){if(_0xd46b57){return _0xd46b57[_0xdb1e('0x25')](_0x1c0b0e)[_0xdb1e('0x26')](function(_0x2681c5){return _0x2681c5;});}return null;};}function removeEntity(_0xa14458,_0x211d57){return function(_0x597994){if(_0x597994){return _0x597994['destroy']()[_0xdb1e('0x26')](function(){_0xa14458[_0xdb1e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27e4bd,_0x276269){return function(_0x45129a){if(!_0x45129a){_0x27e4bd[_0xdb1e('0x1b')](0x194);}return _0x45129a;};}function handleError(_0x147ceb,_0x230187){_0x230187=_0x230187||0x1f4;return function(_0x52b27e){logger[_0xdb1e('0x27')](_0x52b27e[_0xdb1e('0x28')]);if(_0x52b27e['name']){delete _0x52b27e['name'];}_0x147ceb[_0xdb1e('0x20')](_0x230187)[_0xdb1e('0x29')](_0x52b27e);};}exports[_0xdb1e('0x2a')]=function(_0x2bf9e4,_0x256bd1){var _0x105b19={},_0x4f9a28={},_0x1fb2a8={'count':0x0,'rows':[]};var _0x4226f0=_[_0xdb1e('0x2b')](db[_0xdb1e('0x2c')]['rawAttributes'],function(_0x4f16da){return{'name':_0x4f16da[_0xdb1e('0x2d')],'type':_0x4f16da[_0xdb1e('0x2e')][_0xdb1e('0x2f')]};});_0x4f9a28[_0xdb1e('0x30')]=_['map'](_0x4226f0,_0xdb1e('0x31'));_0x4f9a28['query']=_[_0xdb1e('0x32')](_0x2bf9e4[_0xdb1e('0x33')]);_0x4f9a28[_0xdb1e('0x34')]=_[_0xdb1e('0x35')](_0x4f9a28[_0xdb1e('0x30')],_0x4f9a28[_0xdb1e('0x33')]);_0x105b19[_0xdb1e('0x36')]=_[_0xdb1e('0x35')](_0x4f9a28[_0xdb1e('0x30')],qs[_0xdb1e('0x37')](_0x2bf9e4[_0xdb1e('0x33')][_0xdb1e('0x37')]));_0x105b19[_0xdb1e('0x36')]=_0x105b19[_0xdb1e('0x36')][_0xdb1e('0x38')]?_0x105b19[_0xdb1e('0x36')]:_0x4f9a28[_0xdb1e('0x30')];if(!_0x2bf9e4['query']['hasOwnProperty']('nolimit')){_0x105b19[_0xdb1e('0x1f')]=qs['limit'](_0x2bf9e4[_0xdb1e('0x33')][_0xdb1e('0x1f')]);_0x105b19[_0xdb1e('0x1e')]=qs[_0xdb1e('0x1e')](_0x2bf9e4['query']['offset']);}_0x105b19[_0xdb1e('0x39')]=qs[_0xdb1e('0x3a')](_0x2bf9e4[_0xdb1e('0x33')][_0xdb1e('0x3a')]);_0x105b19[_0xdb1e('0x3b')]=qs['filters'](_['pick'](_0x2bf9e4[_0xdb1e('0x33')],_0x4f9a28[_0xdb1e('0x34')]),_0x4226f0);if(_0x2bf9e4[_0xdb1e('0x33')]['filter']){_0x105b19['where']=_[_0xdb1e('0x3c')](_0x105b19['where'],{'$or':_[_0xdb1e('0x2b')](_0x4226f0,function(_0x3aaa2f){if(_0x3aaa2f[_0xdb1e('0x2e')]!==_0xdb1e('0x3d')){var _0x553c57={};_0x553c57[_0x3aaa2f['name']]={'$like':'%'+_0x2bf9e4[_0xdb1e('0x33')][_0xdb1e('0x3e')]+'%'};return _0x553c57;}})});}_0x105b19=_[_0xdb1e('0x3c')]({},_0x105b19,_0x2bf9e4['options']);var _0x4e031f={'where':_0x105b19['where']};return db[_0xdb1e('0x2c')][_0xdb1e('0x1d')](_0x4e031f)[_0xdb1e('0x26')](function(_0x3a2968){_0x1fb2a8[_0xdb1e('0x1d')]=_0x3a2968;if(_0x2bf9e4['query'][_0xdb1e('0x3f')]){_0x105b19['include']=[{'all':!![]}];}return db[_0xdb1e('0x2c')]['findAll'](_0x105b19);})[_0xdb1e('0x26')](function(_0x4c6164){_0x1fb2a8[_0xdb1e('0x40')]=_0x4c6164;return _0x1fb2a8;})['then'](respondWithFilteredResult(_0x256bd1,_0x105b19))[_0xdb1e('0x41')](handleError(_0x256bd1,null));};exports['show']=function(_0x5b65ec,_0x23d174){var _0xb55974={'raw':!![],'where':{'id':_0x5b65ec[_0xdb1e('0x42')]['id']}},_0x51b98e={};_0x51b98e[_0xdb1e('0x30')]=_[_0xdb1e('0x32')](db[_0xdb1e('0x2c')][_0xdb1e('0x43')]);_0x51b98e[_0xdb1e('0x33')]=_[_0xdb1e('0x32')](_0x5b65ec['query']);_0x51b98e[_0xdb1e('0x34')]=_[_0xdb1e('0x35')](_0x51b98e[_0xdb1e('0x30')],_0x51b98e[_0xdb1e('0x33')]);_0xb55974['attributes']=_[_0xdb1e('0x35')](_0x51b98e[_0xdb1e('0x30')],qs[_0xdb1e('0x37')](_0x5b65ec[_0xdb1e('0x33')]['fields']));_0xb55974[_0xdb1e('0x36')]=_0xb55974[_0xdb1e('0x36')][_0xdb1e('0x38')]?_0xb55974[_0xdb1e('0x36')]:_0x51b98e[_0xdb1e('0x30')];if(_0x5b65ec[_0xdb1e('0x33')][_0xdb1e('0x3f')]){_0xb55974['include']=[{'all':!![]}];}_0xb55974=_[_0xdb1e('0x3c')]({},_0xb55974,_0x5b65ec['options']);return db[_0xdb1e('0x2c')]['find'](_0xb55974)[_0xdb1e('0x26')](handleEntityNotFound(_0x23d174,null))[_0xdb1e('0x26')](respondWithResult(_0x23d174,null))[_0xdb1e('0x41')](handleError(_0x23d174,null));};exports[_0xdb1e('0x44')]=function(_0x385661,_0xbbdf87){return db['JscriptySessionReport'][_0xdb1e('0x44')](_0x385661['body'],{})[_0xdb1e('0x26')](respondWithResult(_0xbbdf87,0xc9))[_0xdb1e('0x41')](handleError(_0xbbdf87,null));};exports['update']=function(_0x39dcea,_0x298a07){if(_0x39dcea[_0xdb1e('0x45')]['id']){delete _0x39dcea[_0xdb1e('0x45')]['id'];}return db[_0xdb1e('0x2c')]['find']({'where':{'id':_0x39dcea[_0xdb1e('0x42')]['id']}})[_0xdb1e('0x26')](handleEntityNotFound(_0x298a07,null))[_0xdb1e('0x26')](saveUpdates(_0x39dcea[_0xdb1e('0x45')],null))[_0xdb1e('0x26')](respondWithResult(_0x298a07,null))[_0xdb1e('0x41')](handleError(_0x298a07,null));};exports['destroy']=function(_0x39b475,_0x542da9){return db[_0xdb1e('0x2c')][_0xdb1e('0x46')]({'where':{'id':_0x39b475[_0xdb1e('0x42')]['id']}})['then'](handleEntityNotFound(_0x542da9,null))[_0xdb1e('0x26')](removeEntity(_0x542da9,null))[_0xdb1e('0x41')](handleError(_0x542da9,null));};exports[_0xdb1e('0x47')]=function(_0x44aacf,_0x4d12cd){return db[_0xdb1e('0x2c')]['describe']()[_0xdb1e('0x26')](respondWithResult(_0x4d12cd,null))[_0xdb1e('0x41')](handleError(_0x4d12cd,null));};exports[_0xdb1e('0x48')]=function(_0x49fd34,_0x3c9880,_0x2e4083){var _0x3fa1e4={'raw':!![],'where':{}};var _0x1636cb={};var _0x30f228={'count':0x0,'rows':[]};return db[_0xdb1e('0x2c')][_0xdb1e('0x49')]({'where':{'id':_0x49fd34[_0xdb1e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c9880,null))[_0xdb1e('0x26')](function(_0x18ae58){if(_0x18ae58){_0x1636cb[_0xdb1e('0x30')]=_[_0xdb1e('0x32')](db['JscriptyQuestionReport'][_0xdb1e('0x43')]);_0x1636cb[_0xdb1e('0x33')]=_[_0xdb1e('0x32')](_0x49fd34[_0xdb1e('0x33')]);_0x1636cb['filters']=_[_0xdb1e('0x35')](_0x1636cb['model'],_0x1636cb[_0xdb1e('0x33')]);_0x3fa1e4[_0xdb1e('0x36')]=_[_0xdb1e('0x35')](_0x1636cb[_0xdb1e('0x30')],qs[_0xdb1e('0x37')](_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x37')]));_0x3fa1e4[_0xdb1e('0x36')]=_0x3fa1e4['attributes'][_0xdb1e('0x38')]?_0x3fa1e4[_0xdb1e('0x36')]:_0x1636cb[_0xdb1e('0x30')];if(!_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x4a')](_0xdb1e('0x4b'))){_0x3fa1e4['limit']=qs['limit'](_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x1f')]);_0x3fa1e4[_0xdb1e('0x1e')]=qs[_0xdb1e('0x1e')](_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x1e')]);}_0x3fa1e4['order']=qs[_0xdb1e('0x3a')](_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x3a')]);_0x3fa1e4[_0xdb1e('0x3b')]=qs['filters'](_[_0xdb1e('0x4c')](_0x49fd34[_0xdb1e('0x33')],_0x1636cb[_0xdb1e('0x34')]));_0x3fa1e4[_0xdb1e('0x3b')]['SessionId']=_0x18ae58['id'];if(_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x3e')]){_0x3fa1e4[_0xdb1e('0x3b')]=_[_0xdb1e('0x3c')](_0x3fa1e4[_0xdb1e('0x3b')],{'$or':_[_0xdb1e('0x2b')](_0x3fa1e4[_0xdb1e('0x36')],function(_0x1eb424){var _0x1210a6={};_0x1210a6[_0x1eb424]={'$like':'%'+_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x3e')]+'%'};return _0x1210a6;})});}_0x3fa1e4=_[_0xdb1e('0x3c')]({},_0x3fa1e4,_0x49fd34['options']);return db[_0xdb1e('0x4d')][_0xdb1e('0x1d')]({'where':_0x3fa1e4[_0xdb1e('0x3b')]})['then'](function(_0x3834e0){_0x30f228[_0xdb1e('0x1d')]=_0x3834e0;if(_0x49fd34[_0xdb1e('0x33')][_0xdb1e('0x3f')]){_0x3fa1e4[_0xdb1e('0x4e')]=[{'all':!![]}];}return db[_0xdb1e('0x4d')][_0xdb1e('0x4f')](_0x3fa1e4);})['then'](function(_0x434958){_0x30f228[_0xdb1e('0x40')]=_0x434958;return _0x30f228;});}})[_0xdb1e('0x26')](respondWithFilteredResult(_0x3c9880,_0x3fa1e4))[_0xdb1e('0x41')](handleError(_0x3c9880,null));}; \ No newline at end of file +var _0x416b=['pick','SessionId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../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','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','count','includeAll','findAll','rows','catch','show','include','options','create','body','find','params','findOne','JscriptyQuestionReport'];(function(_0x59ae7b,_0x15f21b){var _0xd73afa=function(_0x4ce5d5){while(--_0x4ce5d5){_0x59ae7b['push'](_0x59ae7b['shift']());}};_0xd73afa(++_0x15f21b);}(_0x416b,0xa2));var _0xb416=function(_0x590f0c,_0x1f7002){_0x590f0c=_0x590f0c-0x0;var _0x2de6e0=_0x416b[_0x590f0c];return _0x2de6e0;};'use strict';var pdf=require(_0xb416('0x0'));var emlformat=require(_0xb416('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb416('0x2'));var jsonpatch=require(_0xb416('0x3'));var rp=require(_0xb416('0x4'));var moment=require(_0xb416('0x5'));var BPromise=require(_0xb416('0x6'));var Mustache=require(_0xb416('0x7'));var util=require(_0xb416('0x8'));var path=require(_0xb416('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb416('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb416('0xb'));var deskjs=require(_0xb416('0xc'));var toCsv=require(_0xb416('0xd'));var querystring=require(_0xb416('0xe'));var Papa=require(_0xb416('0xf'));var Redis=require('ioredis');var authService=require(_0xb416('0x10'));var qs=require(_0xb416('0x11'));var as=require(_0xb416('0x12'));var hardwareService=require(_0xb416('0x13'));var logger=require('../../config/logger')(_0xb416('0x14'));var utils=require(_0xb416('0x15'));var config=require(_0xb416('0x16'));var db=require(_0xb416('0x17'))['db'];function respondWithStatusCode(_0x4625d7,_0x13ef53){_0x13ef53=_0x13ef53||0xcc;return function(_0x5334cd){if(_0x5334cd){return _0x4625d7[_0xb416('0x18')](_0x13ef53);}return _0x4625d7[_0xb416('0x19')](_0x13ef53)[_0xb416('0x1a')]();};}function respondWithResult(_0x1ab26a,_0x4c602e){_0x4c602e=_0x4c602e||0xc8;return function(_0x3c8201){if(_0x3c8201){return _0x1ab26a[_0xb416('0x19')](_0x4c602e)['json'](_0x3c8201);}};}function respondWithFilteredResult(_0xb68a4c,_0xea74fb){return function(_0x115f9d){if(_0x115f9d){var _0x1bc366=_0x115f9d['count'],_0x21ec9e=_0xea74fb['offset'],_0x3e9c5b=_0xea74fb[_0xb416('0x1b')]+_0xea74fb[_0xb416('0x1c')],_0x131b35;if(_0x3e9c5b>=_0x1bc366){_0x3e9c5b=_0x1bc366;_0x131b35=0xc8;}else{_0x131b35=0xce;}_0xb68a4c[_0xb416('0x19')](_0x131b35);return _0xb68a4c[_0xb416('0x1d')](_0xb416('0x1e'),_0x21ec9e+'-'+_0x3e9c5b+'/'+_0x1bc366)[_0xb416('0x1f')](_0x115f9d);}return null;};}function patchUpdates(_0x17e08c){return function(_0x35fe62){try{jsonpatch[_0xb416('0x20')](_0x35fe62,_0x17e08c,!![]);}catch(_0x1892f1){return BPromise[_0xb416('0x21')](_0x1892f1);}return _0x35fe62[_0xb416('0x22')]();};}function saveUpdates(_0x39ff3e,_0x33a6e6){return function(_0x477923){if(_0x477923){return _0x477923[_0xb416('0x23')](_0x39ff3e)[_0xb416('0x24')](function(_0x7a749a){return _0x7a749a;});}return null;};}function removeEntity(_0x2b38cb,_0x21a024){return function(_0x2dbcdf){if(_0x2dbcdf){return _0x2dbcdf[_0xb416('0x25')]()['then'](function(){_0x2b38cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d80ff,_0x1174c2){return function(_0x1d94da){if(!_0x1d94da){_0x1d80ff[_0xb416('0x18')](0x194);}return _0x1d94da;};}function handleError(_0x120ebc,_0x4f1d07){_0x4f1d07=_0x4f1d07||0x1f4;return function(_0x1cd246){logger[_0xb416('0x26')](_0x1cd246['stack']);if(_0x1cd246[_0xb416('0x27')]){delete _0x1cd246[_0xb416('0x27')];}_0x120ebc[_0xb416('0x19')](_0x4f1d07)[_0xb416('0x28')](_0x1cd246);};}exports[_0xb416('0x29')]=function(_0x1c458b,_0x1840a8){var _0x52b1fc={},_0x31af27={},_0x2b433f={'count':0x0,'rows':[]};var _0x50dc0e=_[_0xb416('0x2a')](db[_0xb416('0x2b')][_0xb416('0x2c')],function(_0x12b51a){return{'name':_0x12b51a[_0xb416('0x2d')],'type':_0x12b51a[_0xb416('0x2e')][_0xb416('0x2f')]};});_0x31af27['model']=_[_0xb416('0x2a')](_0x50dc0e,_0xb416('0x27'));_0x31af27[_0xb416('0x30')]=_[_0xb416('0x31')](_0x1c458b[_0xb416('0x30')]);_0x31af27[_0xb416('0x32')]=_['intersection'](_0x31af27[_0xb416('0x33')],_0x31af27[_0xb416('0x30')]);_0x52b1fc[_0xb416('0x34')]=_[_0xb416('0x35')](_0x31af27[_0xb416('0x33')],qs[_0xb416('0x36')](_0x1c458b[_0xb416('0x30')][_0xb416('0x36')]));_0x52b1fc[_0xb416('0x34')]=_0x52b1fc[_0xb416('0x34')][_0xb416('0x37')]?_0x52b1fc[_0xb416('0x34')]:_0x31af27[_0xb416('0x33')];if(!_0x1c458b[_0xb416('0x30')][_0xb416('0x38')](_0xb416('0x39'))){_0x52b1fc['limit']=qs[_0xb416('0x1c')](_0x1c458b[_0xb416('0x30')][_0xb416('0x1c')]);_0x52b1fc[_0xb416('0x1b')]=qs[_0xb416('0x1b')](_0x1c458b[_0xb416('0x30')][_0xb416('0x1b')]);}_0x52b1fc[_0xb416('0x3a')]=qs[_0xb416('0x3b')](_0x1c458b[_0xb416('0x30')][_0xb416('0x3b')]);_0x52b1fc['where']=qs['filters'](_['pick'](_0x1c458b[_0xb416('0x30')],_0x31af27[_0xb416('0x32')]),_0x50dc0e);if(_0x1c458b[_0xb416('0x30')][_0xb416('0x3c')]){_0x52b1fc[_0xb416('0x3d')]=_['merge'](_0x52b1fc[_0xb416('0x3d')],{'$or':_[_0xb416('0x2a')](_0x50dc0e,function(_0x1e4803){if(_0x1e4803['type']!==_0xb416('0x3e')){var _0x20c99c={};_0x20c99c[_0x1e4803[_0xb416('0x27')]]={'$like':'%'+_0x1c458b[_0xb416('0x30')][_0xb416('0x3c')]+'%'};return _0x20c99c;}})});}_0x52b1fc=_[_0xb416('0x3f')]({},_0x52b1fc,_0x1c458b['options']);var _0x76ef27={'where':_0x52b1fc[_0xb416('0x3d')]};return db[_0xb416('0x2b')][_0xb416('0x40')](_0x76ef27)['then'](function(_0x4fe123){_0x2b433f[_0xb416('0x40')]=_0x4fe123;if(_0x1c458b['query'][_0xb416('0x41')]){_0x52b1fc['include']=[{'all':!![]}];}return db[_0xb416('0x2b')][_0xb416('0x42')](_0x52b1fc);})[_0xb416('0x24')](function(_0x75e116){_0x2b433f[_0xb416('0x43')]=_0x75e116;return _0x2b433f;})[_0xb416('0x24')](respondWithFilteredResult(_0x1840a8,_0x52b1fc))[_0xb416('0x44')](handleError(_0x1840a8,null));};exports[_0xb416('0x45')]=function(_0x38da78,_0x2f7461){var _0x3525b4={'raw':!![],'where':{'id':_0x38da78['params']['id']}},_0x5d38f6={};_0x5d38f6[_0xb416('0x33')]=_[_0xb416('0x31')](db[_0xb416('0x2b')][_0xb416('0x2c')]);_0x5d38f6[_0xb416('0x30')]=_['keys'](_0x38da78[_0xb416('0x30')]);_0x5d38f6[_0xb416('0x32')]=_['intersection'](_0x5d38f6['model'],_0x5d38f6['query']);_0x3525b4[_0xb416('0x34')]=_[_0xb416('0x35')](_0x5d38f6[_0xb416('0x33')],qs[_0xb416('0x36')](_0x38da78[_0xb416('0x30')][_0xb416('0x36')]));_0x3525b4['attributes']=_0x3525b4[_0xb416('0x34')][_0xb416('0x37')]?_0x3525b4[_0xb416('0x34')]:_0x5d38f6[_0xb416('0x33')];if(_0x38da78[_0xb416('0x30')]['includeAll']){_0x3525b4[_0xb416('0x46')]=[{'all':!![]}];}_0x3525b4=_[_0xb416('0x3f')]({},_0x3525b4,_0x38da78[_0xb416('0x47')]);return db['JscriptySessionReport']['find'](_0x3525b4)['then'](handleEntityNotFound(_0x2f7461,null))['then'](respondWithResult(_0x2f7461,null))[_0xb416('0x44')](handleError(_0x2f7461,null));};exports[_0xb416('0x48')]=function(_0x4e1c06,_0x42be0a){return db[_0xb416('0x2b')][_0xb416('0x48')](_0x4e1c06[_0xb416('0x49')],{})['then'](respondWithResult(_0x42be0a,0xc9))['catch'](handleError(_0x42be0a,null));};exports[_0xb416('0x23')]=function(_0x5568c7,_0x5aff2b){if(_0x5568c7['body']['id']){delete _0x5568c7['body']['id'];}return db[_0xb416('0x2b')][_0xb416('0x4a')]({'where':{'id':_0x5568c7[_0xb416('0x4b')]['id']}})[_0xb416('0x24')](handleEntityNotFound(_0x5aff2b,null))['then'](saveUpdates(_0x5568c7['body'],null))[_0xb416('0x24')](respondWithResult(_0x5aff2b,null))[_0xb416('0x44')](handleError(_0x5aff2b,null));};exports[_0xb416('0x25')]=function(_0x1c8f4a,_0x37612f){return db[_0xb416('0x2b')][_0xb416('0x4a')]({'where':{'id':_0x1c8f4a[_0xb416('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37612f,null))[_0xb416('0x24')](removeEntity(_0x37612f,null))['catch'](handleError(_0x37612f,null));};exports['describe']=function(_0x28e179,_0x42d11c){return db[_0xb416('0x2b')]['describe']()[_0xb416('0x24')](respondWithResult(_0x42d11c,null))[_0xb416('0x44')](handleError(_0x42d11c,null));};exports['getQuestions']=function(_0x36b977,_0x4dade9,_0x4ba75d){var _0x42b9f0={'raw':!![],'where':{}};var _0x5ad0a7={};var _0x2f60ee={'count':0x0,'rows':[]};return db[_0xb416('0x2b')][_0xb416('0x4c')]({'where':{'id':_0x36b977[_0xb416('0x4b')]['id']}})[_0xb416('0x24')](handleEntityNotFound(_0x4dade9,null))[_0xb416('0x24')](function(_0x5a8bd7){if(_0x5a8bd7){_0x5ad0a7[_0xb416('0x33')]=_['keys'](db[_0xb416('0x4d')][_0xb416('0x2c')]);_0x5ad0a7[_0xb416('0x30')]=_[_0xb416('0x31')](_0x36b977['query']);_0x5ad0a7[_0xb416('0x32')]=_['intersection'](_0x5ad0a7[_0xb416('0x33')],_0x5ad0a7[_0xb416('0x30')]);_0x42b9f0[_0xb416('0x34')]=_[_0xb416('0x35')](_0x5ad0a7[_0xb416('0x33')],qs[_0xb416('0x36')](_0x36b977[_0xb416('0x30')][_0xb416('0x36')]));_0x42b9f0[_0xb416('0x34')]=_0x42b9f0[_0xb416('0x34')][_0xb416('0x37')]?_0x42b9f0['attributes']:_0x5ad0a7[_0xb416('0x33')];if(!_0x36b977[_0xb416('0x30')]['hasOwnProperty'](_0xb416('0x39'))){_0x42b9f0[_0xb416('0x1c')]=qs[_0xb416('0x1c')](_0x36b977['query'][_0xb416('0x1c')]);_0x42b9f0[_0xb416('0x1b')]=qs[_0xb416('0x1b')](_0x36b977[_0xb416('0x30')]['offset']);}_0x42b9f0[_0xb416('0x3a')]=qs[_0xb416('0x3b')](_0x36b977[_0xb416('0x30')][_0xb416('0x3b')]);_0x42b9f0[_0xb416('0x3d')]=qs[_0xb416('0x32')](_[_0xb416('0x4e')](_0x36b977[_0xb416('0x30')],_0x5ad0a7['filters']));_0x42b9f0['where'][_0xb416('0x4f')]=_0x5a8bd7['id'];if(_0x36b977[_0xb416('0x30')]['filter']){_0x42b9f0[_0xb416('0x3d')]=_['merge'](_0x42b9f0[_0xb416('0x3d')],{'$or':_[_0xb416('0x2a')](_0x42b9f0[_0xb416('0x34')],function(_0x441248){var _0x43ddca={};_0x43ddca[_0x441248]={'$like':'%'+_0x36b977['query']['filter']+'%'};return _0x43ddca;})});}_0x42b9f0=_[_0xb416('0x3f')]({},_0x42b9f0,_0x36b977[_0xb416('0x47')]);return db[_0xb416('0x4d')][_0xb416('0x40')]({'where':_0x42b9f0[_0xb416('0x3d')]})[_0xb416('0x24')](function(_0x575d1d){_0x2f60ee[_0xb416('0x40')]=_0x575d1d;if(_0x36b977[_0xb416('0x30')]['includeAll']){_0x42b9f0[_0xb416('0x46')]=[{'all':!![]}];}return db[_0xb416('0x4d')][_0xb416('0x42')](_0x42b9f0);})[_0xb416('0x24')](function(_0x400600){_0x2f60ee[_0xb416('0x43')]=_0x400600;return _0x2f60ee;});}})[_0xb416('0x24')](respondWithFilteredResult(_0x4dade9,_0x42b9f0))[_0xb416('0x44')](handleError(_0x4dade9,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 9f02564..0d7396e 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 _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport'];(function(_0x7cc8f7,_0xa90d24){var _0x1ecf25=function(_0x336b0c){while(--_0x336b0c){_0x7cc8f7['push'](_0x7cc8f7['shift']());}};_0x1ecf25(++_0xa90d24);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 54c2482..8ba7b57 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 _0xa666=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa666,0x6c));var _0x6a66=function(_0x1aa2b0,_0x1114da){_0x1aa2b0=_0x1aa2b0-0x0;var _0x2e34ba=_0xa666[_0x1aa2b0];return _0x2e34ba;};'use strict';var _=require(_0x6a66('0x0'));var util=require(_0x6a66('0x1'));var moment=require(_0x6a66('0x2'));var BPromise=require(_0x6a66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a66('0x4'));var db=require(_0x6a66('0x5'))['db'];var utils=require(_0x6a66('0x6'));var logger=require('../../config/logger')(_0x6a66('0x7'));var config=require(_0x6a66('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a66('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ebb8c,_0x2a78c1,_0x4b957d){return new BPromise(function(_0x39e1b7,_0x1f678a){return client['request'](_0x2ebb8c,_0x4b957d)['then'](function(_0x4e4069){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2a78c1,_0x6a66('0xa'));logger['debug'](_0x6a66('0xb'),_0x2a78c1,'request\x20sent',JSON['stringify'](_0x4e4069));if(_0x4e4069['error']){if(_0x4e4069['error']['code']===0x1f4){logger[_0x6a66('0xc')](_0x6a66('0xd'),_0x2a78c1,_0x4e4069[_0x6a66('0xc')][_0x6a66('0xe')]);return _0x1f678a(_0x4e4069[_0x6a66('0xc')][_0x6a66('0xe')]);}logger[_0x6a66('0xc')](_0x6a66('0xd'),_0x2a78c1,_0x4e4069[_0x6a66('0xc')]['message']);return _0x39e1b7(_0x4e4069[_0x6a66('0xc')]['message']);}else{logger[_0x6a66('0xf')](_0x6a66('0xd'),_0x2a78c1,'request\x20sent');_0x39e1b7(_0x4e4069[_0x6a66('0x10')][_0x6a66('0xe')]);}})[_0x6a66('0x11')](function(_0x3f7abc){logger['error'](_0x6a66('0xd'),_0x2a78c1,_0x3f7abc);_0x1f678a(_0x3f7abc);});});} \ No newline at end of file +var _0xc632=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x1e7869,_0x2b8cb0){var _0x4ae90f=function(_0xb07099){while(--_0xb07099){_0x1e7869['push'](_0x1e7869['shift']());}};_0x4ae90f(++_0x2b8cb0);}(_0xc632,0xf0));var _0x2c63=function(_0x467f42,_0x1504ae){_0x467f42=_0x467f42-0x0;var _0x496d53=_0xc632[_0x467f42];return _0x496d53;};'use strict';var _=require(_0x2c63('0x0'));var util=require(_0x2c63('0x1'));var moment=require(_0x2c63('0x2'));var BPromise=require(_0x2c63('0x3'));var rs=require(_0x2c63('0x4'));var fs=require('fs');var Redis=require(_0x2c63('0x5'));var db=require(_0x2c63('0x6'))['db'];var utils=require(_0x2c63('0x7'));var logger=require(_0x2c63('0x8'))(_0x2c63('0x9'));var config=require(_0x2c63('0xa'));var jayson=require(_0x2c63('0xb'));var client=jayson[_0x2c63('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b049,_0x16f1d3,_0xfe4e1c){return new BPromise(function(_0x3cb763,_0x387be9){return client['request'](_0x13b049,_0xfe4e1c)['then'](function(_0x1ae757){logger[_0x2c63('0xd')](_0x2c63('0xe'),_0x16f1d3,_0x2c63('0xf'));logger['debug'](_0x2c63('0x10'),_0x16f1d3,'request\x20sent',JSON[_0x2c63('0x11')](_0x1ae757));if(_0x1ae757[_0x2c63('0x12')]){if(_0x1ae757[_0x2c63('0x12')][_0x2c63('0x13')]===0x1f4){logger[_0x2c63('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x16f1d3,_0x1ae757[_0x2c63('0x12')][_0x2c63('0x14')]);return _0x387be9(_0x1ae757[_0x2c63('0x12')]['message']);}logger['error'](_0x2c63('0xe'),_0x16f1d3,_0x1ae757['error'][_0x2c63('0x14')]);return _0x3cb763(_0x1ae757[_0x2c63('0x12')]['message']);}else{logger[_0x2c63('0xd')](_0x2c63('0xe'),_0x16f1d3,_0x2c63('0xf'));_0x3cb763(_0x1ae757['result'][_0x2c63('0x14')]);}})[_0x2c63('0x15')](function(_0x4efdd4){logger[_0x2c63('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x16f1d3,_0x4efdd4);_0x387be9(_0x4efdd4);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6d809ff..c7bef09 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 _0x8f10=['Router','../../components/auth/service','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2382b7,_0x271ef2){var _0x4ea157=function(_0x13209c){while(--_0x13209c){_0x2382b7['push'](_0x2382b7['shift']());}};_0x4ea157(++_0x271ef2);}(_0x8f10,0x6b));var _0x08f1=function(_0x23b8c7,_0x4da4cd){_0x23b8c7=_0x23b8c7-0x0;var _0x521897=_0x8f10[_0x23b8c7];return _0x521897;};'use strict';var multer=require(_0x08f1('0x0'));var util=require(_0x08f1('0x1'));var path=require(_0x08f1('0x2'));var timeout=require(_0x08f1('0x3'));var express=require(_0x08f1('0x4'));var router=express[_0x08f1('0x5')]();var auth=require(_0x08f1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08f1('0x7'));router[_0x08f1('0x8')]('/',controller[_0x08f1('0x9')]);router['put'](_0x08f1('0xa'),auth[_0x08f1('0xb')](),controller[_0x08f1('0xc')]);module[_0x08f1('0xd')]=router; \ No newline at end of file +var _0x8763=['exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','isAuthenticated'];(function(_0xcb1441,_0x3f0b47){var _0x21ac18=function(_0x5ebd1a){while(--_0x5ebd1a){_0xcb1441['push'](_0xcb1441['shift']());}};_0x21ac18(++_0x3f0b47);}(_0x8763,0x1ae));var _0x3876=function(_0xee7e4c,_0x593dbb){_0xee7e4c=_0xee7e4c-0x0;var _0x3e3e0f=_0x8763[_0xee7e4c];return _0x3e3e0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3876('0x0'));var timeout=require('connect-timeout');var express=require(_0x3876('0x1'));var router=express[_0x3876('0x2')]();var auth=require(_0x3876('0x3'));var interaction=require(_0x3876('0x4'));var config=require(_0x3876('0x5'));var controller=require(_0x3876('0x6'));router[_0x3876('0x7')]('/',controller[_0x3876('0x8')]);router['put']('/:id',auth[_0x3876('0x9')](),controller['update']);module[_0x3876('0xa')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index a1c20fa..d082990 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 _0x5fab=['exports','STRING','INTEGER','sequelize'];(function(_0xefa0ef,_0x4d4621){var _0x4adcb7=function(_0xe2eba2){while(--_0xe2eba2){_0xefa0ef['push'](_0xefa0ef['shift']());}};_0x4adcb7(++_0x4d4621);}(_0x5fab,0x177));var _0xb5fa=function(_0x5a89ea,_0x436388){_0x5a89ea=_0x5a89ea-0x0;var _0x21193d=_0x5fab[_0x5a89ea];return _0x21193d;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb5fa('0x2')]},'data2':{'type':Sequelize[_0xb5fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x326f=['STRING','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x326f,0xd1));var _0xf326=function(_0x25ccea,_0x4f40a2){_0x25ccea=_0x25ccea-0x0;var _0x5e5b40=_0x326f[_0x25ccea];return _0x5e5b40;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xf326('0x1')]},'data2':{'type':Sequelize[_0xf326('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xf326('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index e7744c0..746cc6c 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 _0xf9fd=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','model','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto'];(function(_0x16325c,_0x5a5e78){var _0x4daabc=function(_0x4b341){while(--_0x4b341){_0x16325c['push'](_0x16325c['shift']());}};_0x4daabc(++_0x5a5e78);}(_0xf9fd,0x18a));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xdf9f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf9f('0x1'));var jsonpatch=require(_0xdf9f('0x2'));var rp=require('request-promise');var moment=require(_0xdf9f('0x3'));var BPromise=require(_0xdf9f('0x4'));var Mustache=require(_0xdf9f('0x5'));var util=require(_0xdf9f('0x6'));var path=require(_0xdf9f('0x7'));var sox=require(_0xdf9f('0x8'));var csv=require(_0xdf9f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf9f('0xa'));var squel=require('squel');var crypto=require(_0xdf9f('0xb'));var jsforce=require(_0xdf9f('0xc'));var deskjs=require(_0xdf9f('0xd'));var toCsv=require(_0xdf9f('0x9'));var querystring=require(_0xdf9f('0xe'));var Papa=require('papaparse');var Redis=require(_0xdf9f('0xf'));var authService=require(_0xdf9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdf9f('0x11'));var hardwareService=require(_0xdf9f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xdf9f('0x13'));var config=require(_0xdf9f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c57f4,_0x41c73f){_0x41c73f=_0x41c73f||0xcc;return function(_0x2c6d7a){if(_0x2c6d7a){return _0x3c57f4[_0xdf9f('0x15')](_0x41c73f);}return _0x3c57f4['status'](_0x41c73f)[_0xdf9f('0x16')]();};}function respondWithResult(_0x3f246c,_0x45e023){_0x45e023=_0x45e023||0xc8;return function(_0x2d8b77){if(_0x2d8b77){return _0x3f246c[_0xdf9f('0x17')](_0x45e023)[_0xdf9f('0x18')](_0x2d8b77);}};}function respondWithFilteredResult(_0x26010f,_0xe13578){return function(_0x4962d0){if(_0x4962d0){var _0x11aea3=_0x4962d0[_0xdf9f('0x19')],_0x1382b0=_0xe13578[_0xdf9f('0x1a')],_0x5e3648=_0xe13578[_0xdf9f('0x1a')]+_0xe13578[_0xdf9f('0x1b')],_0x2bb0fd;if(_0x5e3648>=_0x11aea3){_0x5e3648=_0x11aea3;_0x2bb0fd=0xc8;}else{_0x2bb0fd=0xce;}_0x26010f[_0xdf9f('0x17')](_0x2bb0fd);return _0x26010f[_0xdf9f('0x1c')](_0xdf9f('0x1d'),_0x1382b0+'-'+_0x5e3648+'/'+_0x11aea3)[_0xdf9f('0x18')](_0x4962d0);}return null;};}function patchUpdates(_0x41954f){return function(_0x1aa284){try{jsonpatch[_0xdf9f('0x1e')](_0x1aa284,_0x41954f,!![]);}catch(_0x34f924){return BPromise[_0xdf9f('0x1f')](_0x34f924);}return _0x1aa284[_0xdf9f('0x20')]();};}function saveUpdates(_0x55b663,_0x8a406f){return function(_0x4f992c){if(_0x4f992c){return _0x4f992c[_0xdf9f('0x21')](_0x55b663)[_0xdf9f('0x22')](function(_0x1dd87b){return _0x1dd87b;});}return null;};}function removeEntity(_0x55799e,_0x1ce5ff){return function(_0x43630e){if(_0x43630e){return _0x43630e[_0xdf9f('0x23')]()[_0xdf9f('0x22')](function(){_0x55799e[_0xdf9f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x332df1,_0x281a78){return function(_0x2a22ce){if(!_0x2a22ce){_0x332df1[_0xdf9f('0x15')](0x194);}return _0x2a22ce;};}function handleError(_0x512b8d,_0x3ae43a){_0x3ae43a=_0x3ae43a||0x1f4;return function(_0x4a7998){logger[_0xdf9f('0x24')](_0x4a7998[_0xdf9f('0x25')]);if(_0x4a7998['name']){delete _0x4a7998['name'];}_0x512b8d['status'](_0x3ae43a)[_0xdf9f('0x26')](_0x4a7998);};}var utilLicense=require('../../config/license/util');exports[_0xdf9f('0x27')]=function(_0x2e7762,_0x144b74){var _0xcfb22f={'raw':!![],'where':{'id':0x1}},_0xcd4aa1={};_0xcd4aa1[_0xdf9f('0x28')]=_['keys'](db[_0xdf9f('0x29')][_0xdf9f('0x2a')]);_0xcd4aa1[_0xdf9f('0x2b')]=_['keys'](_0x2e7762[_0xdf9f('0x2b')]);_0xcd4aa1['filters']=_[_0xdf9f('0x2c')](_0xcd4aa1[_0xdf9f('0x28')],_0xcd4aa1[_0xdf9f('0x2b')]);_0xcfb22f[_0xdf9f('0x2d')]=_['intersection'](_0xcd4aa1[_0xdf9f('0x28')],qs[_0xdf9f('0x2e')](_0x2e7762[_0xdf9f('0x2b')]['fields']));_0xcfb22f['attributes']=_0xcfb22f[_0xdf9f('0x2d')][_0xdf9f('0x2f')]?_0xcfb22f[_0xdf9f('0x2d')]:_0xcd4aa1[_0xdf9f('0x28')];_0xcfb22f=_[_0xdf9f('0x30')]({},_0xcfb22f,_0x2e7762[_0xdf9f('0x31')]);return utilLicense[_0xdf9f('0x32')](_0xcfb22f)['then'](respondWithResult(_0x144b74,null))[_0xdf9f('0x33')](handleError(_0x144b74,null));};exports[_0xdf9f('0x21')]=function(_0x20cc83,_0x15ea17){if(_0x20cc83[_0xdf9f('0x34')]['id']){delete _0x20cc83[_0xdf9f('0x34')]['id'];}return db['License'][_0xdf9f('0x35')]({'where':{'id':_0x20cc83[_0xdf9f('0x36')]['id']}})['then'](handleEntityNotFound(_0x15ea17,null))['then'](function(_0x15e216){var _0x1c62e3=_0x15e216[_0xdf9f('0x37')]({'plain':!![]});return utilLicense[_0xdf9f('0x38')](_0x1c62e3,_0x20cc83['body'][_0xdf9f('0x39')]);})['then'](function(_0x25e4b9){if(!_0x25e4b9['demo']){return saveUpdates(_0x20cc83[_0xdf9f('0x34')],null);}return _0x25e4b9;})['then'](respondWithResult(_0x15ea17,null))[_0xdf9f('0x33')](handleError(_0x15ea17,null));}; \ No newline at end of file +var _0x1790=['key','demo','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','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','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','catch','update','body','find','params','get','checkLicense'];(function(_0x48a8b1,_0x430af6){var _0x9d7125=function(_0x2b833e){while(--_0x2b833e){_0x48a8b1['push'](_0x48a8b1['shift']());}};_0x9d7125(++_0x430af6);}(_0x1790,0x142));var _0x0179=function(_0x1f1e1c,_0x32535d){_0x1f1e1c=_0x1f1e1c-0x0;var _0xe830e3=_0x1790[_0x1f1e1c];return _0xe830e3;};'use strict';var pdf=require(_0x0179('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0179('0x1'));var zipdir=require(_0x0179('0x2'));var jsonpatch=require(_0x0179('0x3'));var rp=require(_0x0179('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0179('0x5'));var util=require('util');var path=require(_0x0179('0x6'));var sox=require(_0x0179('0x7'));var csv=require(_0x0179('0x8'));var ejs=require(_0x0179('0x9'));var fs=require('fs');var _=require(_0x0179('0xa'));var squel=require('squel');var crypto=require(_0x0179('0xb'));var jsforce=require(_0x0179('0xc'));var deskjs=require(_0x0179('0xd'));var toCsv=require(_0x0179('0x8'));var querystring=require(_0x0179('0xe'));var Papa=require(_0x0179('0xf'));var Redis=require(_0x0179('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0179('0x11'));var hardwareService=require(_0x0179('0x12'));var logger=require(_0x0179('0x13'))(_0x0179('0x14'));var utils=require(_0x0179('0x15'));var config=require(_0x0179('0x16'));var db=require(_0x0179('0x17'))['db'];function respondWithStatusCode(_0x4ca098,_0x37bde5){_0x37bde5=_0x37bde5||0xcc;return function(_0x1e6875){if(_0x1e6875){return _0x4ca098[_0x0179('0x18')](_0x37bde5);}return _0x4ca098[_0x0179('0x19')](_0x37bde5)['end']();};}function respondWithResult(_0x77726a,_0x27b377){_0x27b377=_0x27b377||0xc8;return function(_0x16d230){if(_0x16d230){return _0x77726a[_0x0179('0x19')](_0x27b377)[_0x0179('0x1a')](_0x16d230);}};}function respondWithFilteredResult(_0x142d64,_0x1054ed){return function(_0x21b81e){if(_0x21b81e){var _0xa42a2e=_0x21b81e[_0x0179('0x1b')],_0x525f4a=_0x1054ed['offset'],_0x8c34fc=_0x1054ed[_0x0179('0x1c')]+_0x1054ed[_0x0179('0x1d')],_0x32567b;if(_0x8c34fc>=_0xa42a2e){_0x8c34fc=_0xa42a2e;_0x32567b=0xc8;}else{_0x32567b=0xce;}_0x142d64[_0x0179('0x19')](_0x32567b);return _0x142d64[_0x0179('0x1e')](_0x0179('0x1f'),_0x525f4a+'-'+_0x8c34fc+'/'+_0xa42a2e)['json'](_0x21b81e);}return null;};}function patchUpdates(_0x3dd5b6){return function(_0x350258){try{jsonpatch[_0x0179('0x20')](_0x350258,_0x3dd5b6,!![]);}catch(_0x15d013){return BPromise[_0x0179('0x21')](_0x15d013);}return _0x350258[_0x0179('0x22')]();};}function saveUpdates(_0x3dc4c0,_0x39fcee){return function(_0x386603){if(_0x386603){return _0x386603['update'](_0x3dc4c0)['then'](function(_0xb433ab){return _0xb433ab;});}return null;};}function removeEntity(_0x5c6c5f,_0x5d5280){return function(_0x152147){if(_0x152147){return _0x152147[_0x0179('0x23')]()[_0x0179('0x24')](function(){_0x5c6c5f[_0x0179('0x19')](0xcc)[_0x0179('0x25')]();});}};}function handleEntityNotFound(_0xea006d,_0x123c51){return function(_0x53d4ad){if(!_0x53d4ad){_0xea006d['sendStatus'](0x194);}return _0x53d4ad;};}function handleError(_0x5d8615,_0x40567a){_0x40567a=_0x40567a||0x1f4;return function(_0x328945){logger['error'](_0x328945[_0x0179('0x26')]);if(_0x328945[_0x0179('0x27')]){delete _0x328945[_0x0179('0x27')];}_0x5d8615[_0x0179('0x19')](_0x40567a)[_0x0179('0x28')](_0x328945);};}var utilLicense=require(_0x0179('0x29'));exports[_0x0179('0x2a')]=function(_0x8d5cb7,_0x285456){var _0x4c0a66={'raw':!![],'where':{'id':0x1}},_0x158da3={};_0x158da3[_0x0179('0x2b')]=_[_0x0179('0x2c')](db[_0x0179('0x2d')][_0x0179('0x2e')]);_0x158da3[_0x0179('0x2f')]=_['keys'](_0x8d5cb7[_0x0179('0x2f')]);_0x158da3[_0x0179('0x30')]=_[_0x0179('0x31')](_0x158da3[_0x0179('0x2b')],_0x158da3[_0x0179('0x2f')]);_0x4c0a66['attributes']=_['intersection'](_0x158da3['model'],qs[_0x0179('0x32')](_0x8d5cb7[_0x0179('0x2f')][_0x0179('0x32')]));_0x4c0a66[_0x0179('0x33')]=_0x4c0a66[_0x0179('0x33')][_0x0179('0x34')]?_0x4c0a66[_0x0179('0x33')]:_0x158da3[_0x0179('0x2b')];_0x4c0a66=_['merge']({},_0x4c0a66,_0x8d5cb7[_0x0179('0x35')]);return utilLicense[_0x0179('0x36')](_0x4c0a66)['then'](respondWithResult(_0x285456,null))[_0x0179('0x37')](handleError(_0x285456,null));};exports[_0x0179('0x38')]=function(_0x11844b,_0x2e8cea){if(_0x11844b['body']['id']){delete _0x11844b[_0x0179('0x39')]['id'];}return db[_0x0179('0x2d')][_0x0179('0x3a')]({'where':{'id':_0x11844b[_0x0179('0x3b')]['id']}})[_0x0179('0x24')](handleEntityNotFound(_0x2e8cea,null))[_0x0179('0x24')](function(_0x4a6949){var _0x58cf08=_0x4a6949[_0x0179('0x3c')]({'plain':!![]});return utilLicense[_0x0179('0x3d')](_0x58cf08,_0x11844b[_0x0179('0x39')][_0x0179('0x3e')]);})[_0x0179('0x24')](function(_0x556312){if(!_0x556312[_0x0179('0x3f')]){return saveUpdates(_0x11844b[_0x0179('0x39')],null);}return _0x556312;})['then'](respondWithResult(_0x2e8cea,null))[_0x0179('0x37')](handleError(_0x2e8cea,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 80c80bd..aaeb2a7 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x309385,_0x3ab38f){var _0x45b0f5=function(_0x4fa7e0){while(--_0x4fa7e0){_0x309385['push'](_0x309385['shift']());}};_0x45b0f5(++_0x3ab38f);}(_0xb10b,0x12a));var _0xbb10=function(_0x298510,_0x21b06b){_0x298510=_0x298510-0x0;var _0x51f279=_0xb10b[_0x298510];return _0x51f279;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('License',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','license','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1a3d47,_0x107544){var _0x454caa=function(_0x46b636){while(--_0x46b636){_0x1a3d47['push'](_0x1a3d47['shift']());}};_0x454caa(++_0x107544);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./license.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('License',attributes,{'tableName':_0x0d8b('0x8'),'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 2e67c44..69a4e0f 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 _0x4a3c=['info','License,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a4751,_0x2b4e4e){var _0x30db8e=function(_0x6443b){while(--_0x6443b){_0x4a4751['push'](_0x4a4751['shift']());}};_0x30db8e(++_0x2b4e4e);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x46adf1,_0x1288f9){_0x46adf1=_0x46adf1-0x0;var _0x322ee2=_0x4a3c[_0x46adf1];return _0x322ee2;};'use strict';var _=require(_0xc4a3('0x0'));var util=require('util');var moment=require(_0xc4a3('0x1'));var BPromise=require(_0xc4a3('0x2'));var rs=require(_0xc4a3('0x3'));var fs=require('fs');var Redis=require(_0xc4a3('0x4'));var db=require(_0xc4a3('0x5'))['db'];var utils=require(_0xc4a3('0x6'));var logger=require(_0xc4a3('0x7'))('rpc');var config=require(_0xc4a3('0x8'));var jayson=require(_0xc4a3('0x9'));var client=jayson[_0xc4a3('0xa')][_0xc4a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1c84,_0x49fa26,_0x596b01){return new BPromise(function(_0xc11c29,_0x58bdcd){return client[_0xc4a3('0xc')](_0x4b1c84,_0x596b01)[_0xc4a3('0xd')](function(_0x1e7f27){logger[_0xc4a3('0xe')](_0xc4a3('0xf'),_0x49fa26,_0xc4a3('0x10'));logger[_0xc4a3('0x11')]('License,\x20%s,\x20%s,\x20%s',_0x49fa26,'request\x20sent',JSON['stringify'](_0x1e7f27));if(_0x1e7f27['error']){if(_0x1e7f27['error']['code']===0x1f4){logger['error'](_0xc4a3('0xf'),_0x49fa26,_0x1e7f27[_0xc4a3('0x12')][_0xc4a3('0x13')]);return _0x58bdcd(_0x1e7f27[_0xc4a3('0x12')]['message']);}logger[_0xc4a3('0x12')](_0xc4a3('0xf'),_0x49fa26,_0x1e7f27['error'][_0xc4a3('0x13')]);return _0xc11c29(_0x1e7f27[_0xc4a3('0x12')][_0xc4a3('0x13')]);}else{logger[_0xc4a3('0xe')](_0xc4a3('0xf'),_0x49fa26,_0xc4a3('0x10'));_0xc11c29(_0x1e7f27[_0xc4a3('0x14')][_0xc4a3('0x13')]);}})[_0xc4a3('0x15')](function(_0x584b6d){logger[_0xc4a3('0x12')](_0xc4a3('0xf'),_0x49fa26,_0x584b6d);_0x58bdcd(_0x584b6d);});});} \ No newline at end of file +var _0x7d80=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x7d80,0x17a));var _0x07d8=function(_0x10019b,_0x453c47){_0x10019b=_0x10019b-0x0;var _0xeea1bb=_0x7d80[_0x10019b];return _0xeea1bb;};'use strict';var _=require('lodash');var util=require(_0x07d8('0x0'));var moment=require(_0x07d8('0x1'));var BPromise=require(_0x07d8('0x2'));var rs=require(_0x07d8('0x3'));var fs=require('fs');var Redis=require(_0x07d8('0x4'));var db=require(_0x07d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x07d8('0x6'))('rpc');var config=require(_0x07d8('0x7'));var jayson=require(_0x07d8('0x8'));var client=jayson[_0x07d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9c64,_0x1be62a,_0x4b1625){return new BPromise(function(_0x52c68d,_0x510267){return client[_0x07d8('0xa')](_0x5e9c64,_0x4b1625)[_0x07d8('0xb')](function(_0x52a662){logger[_0x07d8('0xc')](_0x07d8('0xd'),_0x1be62a,_0x07d8('0xe'));logger[_0x07d8('0xf')](_0x07d8('0x10'),_0x1be62a,_0x07d8('0xe'),JSON[_0x07d8('0x11')](_0x52a662));if(_0x52a662['error']){if(_0x52a662[_0x07d8('0x12')][_0x07d8('0x13')]===0x1f4){logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);return _0x510267(_0x52a662[_0x07d8('0x12')]['message']);}logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);return _0x52c68d(_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);}else{logger['info'](_0x07d8('0xd'),_0x1be62a,_0x07d8('0xe'));_0x52c68d(_0x52a662[_0x07d8('0x15')][_0x07d8('0x14')]);}})[_0x07d8('0x16')](function(_0x4ea297){logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x4ea297);_0x510267(_0x4ea297);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 3a8c52d..7b7f672 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 _0xbea3=['addInteraction','addApplications','/:id/send','/:id/users','addAgents','update','delete','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','create','addSmtp'];(function(_0x124096,_0xbb4341){var _0x123aed=function(_0x4db081){while(--_0x4db081){_0x124096['push'](_0x124096['shift']());}};_0x123aed(++_0xbb4341);}(_0xbea3,0x163));var _0x3bea=function(_0x4fc643,_0x952539){_0x4fc643=_0x4fc643-0x0;var _0x36373b=_0xbea3[_0x4fc643];return _0x36373b;};'use strict';var multer=require(_0x3bea('0x0'));var util=require(_0x3bea('0x1'));var path=require('path');var timeout=require(_0x3bea('0x2'));var express=require('express');var router=express[_0x3bea('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3bea('0x4'));var config=require(_0x3bea('0x5'));var controller=require('./mailAccount.controller');router[_0x3bea('0x6')]('/',auth[_0x3bea('0x7')](),controller[_0x3bea('0x8')]);router[_0x3bea('0x6')](_0x3bea('0x9'),auth[_0x3bea('0x7')](),controller[_0x3bea('0xa')]);router[_0x3bea('0x6')](_0x3bea('0xb'),auth[_0x3bea('0x7')](),controller['show']);router[_0x3bea('0x6')](_0x3bea('0xc'),auth[_0x3bea('0x7')](),controller[_0x3bea('0xd')]);router[_0x3bea('0x6')](_0x3bea('0xe'),auth['isAuthenticated'](),controller[_0x3bea('0xf')]);router[_0x3bea('0x6')](_0x3bea('0x10'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x11')]);router[_0x3bea('0x6')](_0x3bea('0x12'),auth[_0x3bea('0x7')](),controller['getSmtp']);router[_0x3bea('0x6')](_0x3bea('0x13'),auth['isAuthenticated'](),controller[_0x3bea('0x14')]);router[_0x3bea('0x6')](_0x3bea('0x15'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x16')]);router[_0x3bea('0x6')](_0x3bea('0x17'),auth['isAuthenticated'](),controller[_0x3bea('0x18')]);router['get'](_0x3bea('0x19'),auth['isAuthenticated'](),controller[_0x3bea('0x1a')]);router[_0x3bea('0x6')]('/:id/users',auth[_0x3bea('0x7')](),controller[_0x3bea('0x1b')]);router[_0x3bea('0x1c')](_0x3bea('0xc'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x1d')]);router[_0x3bea('0x1c')](_0x3bea('0xe'),auth[_0x3bea('0x7')](),controller['addAnswer']);router[_0x3bea('0x1c')]('/',auth[_0x3bea('0x7')](),controller[_0x3bea('0x1e')]);router[_0x3bea('0x1c')](_0x3bea('0x10'),auth['isAuthenticated'](),controller['addImap']);router['post'](_0x3bea('0x12'),auth['isAuthenticated'](),controller[_0x3bea('0x1f')]);router[_0x3bea('0x1c')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x3bea('0x20')]);router['post']('/:id/applications',auth[_0x3bea('0x7')](),controller[_0x3bea('0x21')]);router[_0x3bea('0x1c')](_0x3bea('0x22'),auth['isAuthenticated'](),controller['send']);router['post'](_0x3bea('0x23'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x24')]);router['put'](_0x3bea('0xb'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x25')]);router[_0x3bea('0x26')](_0x3bea('0xc'),auth[_0x3bea('0x7')](),controller['removeDispositions']);router[_0x3bea('0x26')](_0x3bea('0xe'),auth[_0x3bea('0x7')](),controller['removeAnswers']);router[_0x3bea('0x26')](_0x3bea('0x10'),auth['isAuthenticated'](),controller['removeImap']);router['delete'](_0x3bea('0x12'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x27')]);router['delete'](_0x3bea('0xb'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x28')]);router[_0x3bea('0x26')](_0x3bea('0x23'),auth[_0x3bea('0x7')](),controller[_0x3bea('0x29')]);module[_0x3bea('0x2a')]=router; \ No newline at end of file +var _0x5b22=['addDisposition','post','/:id/canned_answers','addAnswer','/:id/in_servers','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','/describe','describe','/:id','show','get','/:id/dispositions','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x230bd1,_0x5a2e9a){var _0x526919=function(_0x26b641){while(--_0x26b641){_0x230bd1['push'](_0x230bd1['shift']());}};_0x526919(++_0x5a2e9a);}(_0x5b22,0xb7));var _0x25b2=function(_0x17f9c4,_0x5328c1){_0x17f9c4=_0x17f9c4-0x0;var _0x447e90=_0x5b22[_0x17f9c4];return _0x447e90;};'use strict';var multer=require('multer');var util=require(_0x25b2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x25b2('0x1'));var router=express[_0x25b2('0x2')]();var auth=require(_0x25b2('0x3'));var interaction=require(_0x25b2('0x4'));var config=require(_0x25b2('0x5'));var controller=require(_0x25b2('0x6'));router['get']('/',auth[_0x25b2('0x7')](),controller['index']);router['get'](_0x25b2('0x8'),auth['isAuthenticated'](),controller[_0x25b2('0x9')]);router['get'](_0x25b2('0xa'),auth[_0x25b2('0x7')](),controller[_0x25b2('0xb')]);router[_0x25b2('0xc')](_0x25b2('0xd'),auth[_0x25b2('0x7')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x25b2('0x7')](),controller[_0x25b2('0xe')]);router['get']('/:id/in_servers',auth[_0x25b2('0x7')](),controller[_0x25b2('0xf')]);router[_0x25b2('0xc')](_0x25b2('0x10'),auth['isAuthenticated'](),controller[_0x25b2('0x11')]);router[_0x25b2('0xc')](_0x25b2('0x12'),auth[_0x25b2('0x7')](),controller['getInteractions']);router['get'](_0x25b2('0x13'),auth['isAuthenticated'](),controller[_0x25b2('0x14')]);router[_0x25b2('0xc')](_0x25b2('0x15'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x16')]);router[_0x25b2('0xc')](_0x25b2('0x17'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x18')]);router['get'](_0x25b2('0x19'),auth['isAuthenticated'](),controller[_0x25b2('0x1a')]);router['post'](_0x25b2('0xd'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x1b')]);router[_0x25b2('0x1c')](_0x25b2('0x1d'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x1e')]);router[_0x25b2('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x25b2('0x1c')](_0x25b2('0x1f'),auth[_0x25b2('0x7')](),controller['addImap']);router[_0x25b2('0x1c')](_0x25b2('0x10'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x25b2('0x1c')]('/:id/interactions',auth[_0x25b2('0x7')](),controller['addInteraction']);router['post'](_0x25b2('0x13'),auth[_0x25b2('0x7')](),controller['addApplications']);router['post']('/:id/send',auth[_0x25b2('0x7')](),controller[_0x25b2('0x20')]);router[_0x25b2('0x1c')](_0x25b2('0x19'),auth['isAuthenticated'](),controller[_0x25b2('0x21')]);router[_0x25b2('0x22')](_0x25b2('0xa'),auth['isAuthenticated'](),controller[_0x25b2('0x23')]);router['delete'](_0x25b2('0xd'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x24')]);router[_0x25b2('0x25')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x25b2('0x26')]);router[_0x25b2('0x25')](_0x25b2('0x1f'),auth['isAuthenticated'](),controller[_0x25b2('0x27')]);router['delete'](_0x25b2('0x10'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x28')]);router['delete'](_0x25b2('0xa'),auth[_0x25b2('0x7')](),controller[_0x25b2('0x29')]);router['delete'](_0x25b2('0x19'),auth['isAuthenticated'](),controller['removeAgents']);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 328d599..2b22e27 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 _0xe93b=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x404976,_0x535bd6){var _0x4c40a8=function(_0x34a381){while(--_0x34a381){_0x404976['push'](_0x404976['shift']());}};_0x4c40a8(++_0x535bd6);}(_0xe93b,0x8b));var _0xbe93=function(_0xd35870,_0x3ffeff){_0xd35870=_0xd35870-0x0;var _0xff1509=_0xe93b[_0xd35870];return _0xff1509;};'use strict';var Sequelize=require(_0xbe93('0x0'));module[_0xbe93('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xbe93('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbe93('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xbe93('0x4')]},'markAsUnread':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe93('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xbe93('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbe93('0x4')],'defaultValue':function(){return _0xbe93('0x7');}},'notificationSound':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe93('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe93('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe93('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe93('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xbe93('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xbe93('0x3')],'defaultValue':![],'comment':_0xbe93('0xa'),'set':function(_0x5b8a39){if(!_0x5b8a39)this[_0xbe93('0xb')](_0xbe93('0xc'),null);this[_0xbe93('0xb')](_0xbe93('0xd'),_0x5b8a39);}}}; \ No newline at end of file +var _0x92b8=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','TEXT','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x1c0b89,_0x41617b){var _0x84ccd4=function(_0x15849e){while(--_0x15849e){_0x1c0b89['push'](_0x1c0b89['shift']());}};_0x84ccd4(++_0x41617b);}(_0x92b8,0x16a));var _0x892b=function(_0x57d469,_0x26d449){_0x57d469=_0x57d469-0x0;var _0x16371e=_0x92b8[_0x57d469];return _0x16371e;};'use strict';var Sequelize=require(_0x892b('0x0'));module[_0x892b('0x1')]={'description':{'type':Sequelize[_0x892b('0x2')]},'name':{'type':Sequelize[_0x892b('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x892b('0x3')]},'markAsUnread':{'type':Sequelize[_0x892b('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x892b('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x892b('0x3')],'defaultValue':function(){return _0x892b('0x5');}},'notificationSound':{'type':Sequelize[_0x892b('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x892b('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x892b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x892b('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x892b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x892b('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x892b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x892b('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x892b('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x892b('0x4')],'defaultValue':![],'comment':_0x892b('0x8'),'set':function(_0x5be4c6){if(!_0x5be4c6)this[_0x892b('0x9')](_0x892b('0xa'),null);this[_0x892b('0x9')](_0x892b('0xb'),_0x5be4c6);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 1cac457..cdb4411 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 _0x1e4f=['removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','defaults','redis','socket.io-emitter','./mailAccount.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','MailServerIn','Imap','Smtp','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','params','MailServerOut','rawAttributes','body','find','Pause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','active','description','isNil','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','cservice','role','get','UserProfileSection','MailAccounts','autoAssociation','getImap','addImap','setImap','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','tag','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','server/files/attachments','basename','service','auth','secure','SendMail','List\x20not\x20found','List','subject','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit'];(function(_0x2bf659,_0x3abc58){var _0x324128=function(_0x470fce){while(--_0x470fce){_0x2bf659['push'](_0x2bf659['shift']());}};_0x324128(++_0x3abc58);}(_0x1e4f,0x178));var _0xf1e4=function(_0x5c3fac,_0x5f0267){_0x5c3fac=_0x5c3fac-0x0;var _0x382099=_0x1e4f[_0x5c3fac];return _0x382099;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1e4('0x0'));var rimraf=require(_0xf1e4('0x1'));var zipdir=require(_0xf1e4('0x2'));var jsonpatch=require(_0xf1e4('0x3'));var rp=require(_0xf1e4('0x4'));var moment=require('moment');var BPromise=require(_0xf1e4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf1e4('0x6'));var sox=require(_0xf1e4('0x7'));var csv=require(_0xf1e4('0x8'));var ejs=require(_0xf1e4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf1e4('0xa'));var jsforce=require(_0xf1e4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1e4('0x8'));var querystring=require(_0xf1e4('0xc'));var Papa=require(_0xf1e4('0xd'));var Redis=require(_0xf1e4('0xe'));var authService=require(_0xf1e4('0xf'));var qs=require(_0xf1e4('0x10'));var as=require(_0xf1e4('0x11'));var hardwareService=require(_0xf1e4('0x12'));var logger=require(_0xf1e4('0x13'))('api');var utils=require(_0xf1e4('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf1e4('0x15')](config[_0xf1e4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1e4('0x17'))(new Redis(config['redis']));require(_0xf1e4('0x18'))[_0xf1e4('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf1e4('0x1a')][_0xf1e4('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x2c8509,_0x1b6940,_0xedb37e){if(_0xedb37e){var _0x510b27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x510b27[_0xf1e4('0x1c')](_0x1b6940)){return _0x2c8509;}else{throw new db[(_0xf1e4('0x1d'))][(_0xf1e4('0x1e'))](_0xf1e4('0x1f'));}}else{return _0x2c8509;}}function respondWithRpcPromise(_0x5e8631,_0x446678,_0x395bbc,_0x11f52c){return new BPromise(function(_0x3636a9,_0x3d1c2e){var _0x265537=_0x11f52c||client;return _0x265537[_0xf1e4('0x20')](_0x5e8631,_0x395bbc)[_0xf1e4('0x21')](function(_0x5ae31e){logger[_0xf1e4('0x22')](_0xf1e4('0x23'),_0x446678,'request\x20sent');logger[_0xf1e4('0x24')](_0xf1e4('0x25'),_0x446678,_0xf1e4('0x26'),JSON[_0xf1e4('0x27')](_0x5ae31e));if(_0x5ae31e[_0xf1e4('0x28')]){if(_0x5ae31e['error'][_0xf1e4('0x29')]===0x1f4){logger[_0xf1e4('0x28')]('MailAccount,\x20%s,\x20%s',_0x446678,_0x5ae31e[_0xf1e4('0x28')][_0xf1e4('0x2a')]);return _0x3d1c2e(_0x5ae31e[_0xf1e4('0x28')][_0xf1e4('0x2a')]);}logger[_0xf1e4('0x28')](_0xf1e4('0x23'),_0x446678,_0x5ae31e[_0xf1e4('0x28')][_0xf1e4('0x2a')]);return _0x3636a9(_0x5ae31e[_0xf1e4('0x28')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x446678,_0xf1e4('0x26'));_0x3636a9(_0x5ae31e['result'][_0xf1e4('0x2a')]);}})[_0xf1e4('0x2b')](function(_0x3544c0){logger[_0xf1e4('0x28')](_0xf1e4('0x23'),_0x446678,_0x3544c0);_0x3d1c2e(_0x3544c0);});});}function respondWithStatusCode(_0x1bc4bc,_0x186cbf){_0x186cbf=_0x186cbf||0xcc;return function(_0x105a9a){if(_0x105a9a){return _0x1bc4bc[_0xf1e4('0x2c')](_0x186cbf);}return _0x1bc4bc[_0xf1e4('0x2d')](_0x186cbf)[_0xf1e4('0x2e')]();};}function respondWithResult(_0x3e2361,_0x53ea20){_0x53ea20=_0x53ea20||0xc8;return function(_0xa76b10){if(_0xa76b10){return _0x3e2361[_0xf1e4('0x2d')](_0x53ea20)[_0xf1e4('0x2f')](_0xa76b10);}};}function respondWithFilteredResult(_0x4b8b69,_0x3b624f){return function(_0x2b0aff){if(_0x2b0aff){var _0x9d2162=_0x2b0aff[_0xf1e4('0x30')],_0x2877a7=_0x3b624f[_0xf1e4('0x31')],_0x2a4a4f=_0x3b624f[_0xf1e4('0x31')]+_0x3b624f[_0xf1e4('0x32')],_0x525da5;if(_0x2a4a4f>=_0x9d2162){_0x2a4a4f=_0x9d2162;_0x525da5=0xc8;}else{_0x525da5=0xce;}_0x4b8b69[_0xf1e4('0x2d')](_0x525da5);return _0x4b8b69[_0xf1e4('0x33')](_0xf1e4('0x34'),_0x2877a7+'-'+_0x2a4a4f+'/'+_0x9d2162)[_0xf1e4('0x2f')](_0x2b0aff);}return null;};}function patchUpdates(_0x220091){return function(_0x374d89){try{jsonpatch[_0xf1e4('0x35')](_0x374d89,_0x220091,!![]);}catch(_0x965005){return BPromise[_0xf1e4('0x36')](_0x965005);}return _0x374d89[_0xf1e4('0x37')]();};}function saveUpdates(_0x5028d0,_0x3541b2){return function(_0x191f59){if(_0x191f59){return _0x191f59[_0xf1e4('0x38')](_0x5028d0)['then'](function(_0x562862){return _0x562862;});}return null;};}function removeEntity(_0x4b587e,_0x35b23a){return function(_0x38ce96){if(_0x38ce96){return _0x38ce96[_0xf1e4('0x39')]()['then'](function(){var _0x1aeee8=_0x38ce96['get']({'plain':!![]});var _0x527149='MailAccounts';return db['UserProfileResource'][_0xf1e4('0x39')]({'where':{'type':_0x527149,'resourceId':_0x1aeee8['id']}})[_0xf1e4('0x21')](function(){return _0x38ce96;});})[_0xf1e4('0x21')](function(){_0x4b587e[_0xf1e4('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a49ab,_0x412176){return function(_0x1eb56f){if(!_0x1eb56f){_0x1a49ab[_0xf1e4('0x2c')](0x194);}return _0x1eb56f;};}function handleError(_0x4ed9e8,_0x5e5bff){_0x5e5bff=_0x5e5bff||0x1f4;return function(_0x2b1e39){logger[_0xf1e4('0x28')](_0x2b1e39[_0xf1e4('0x3a')]);if(_0x2b1e39[_0xf1e4('0x3b')]){delete _0x2b1e39['name'];}_0x4ed9e8['status'](_0x5e5bff)[_0xf1e4('0x3c')](_0x2b1e39);};}exports['index']=function(_0x558090,_0x5face5){var _0x37e9d5={'include':[{'model':db[_0xf1e4('0x3d')],'as':_0xf1e4('0x3e')},{'model':db['MailServerOut'],'as':_0xf1e4('0x3f')},{'model':db['Pause'],'as':_0xf1e4('0x40')}]},_0x1f4457={},_0x24ba4a={'count':0x0,'rows':[]};var _0x5c6787=_[_0xf1e4('0x41')](db['MailAccount']['rawAttributes'],function(_0x180857){return{'name':_0x180857[_0xf1e4('0x42')],'type':_0x180857[_0xf1e4('0x43')][_0xf1e4('0x44')]};});_0x1f4457[_0xf1e4('0x45')]=_['map'](_0x5c6787,_0xf1e4('0x3b'));_0x1f4457[_0xf1e4('0x46')]=_[_0xf1e4('0x47')](_0x558090[_0xf1e4('0x46')]);_0x1f4457[_0xf1e4('0x48')]=_[_0xf1e4('0x49')](_0x1f4457[_0xf1e4('0x45')],_0x1f4457[_0xf1e4('0x46')]);_0x37e9d5[_0xf1e4('0x4a')]=_[_0xf1e4('0x49')](_0x1f4457[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x558090[_0xf1e4('0x46')][_0xf1e4('0x4b')]));_0x37e9d5[_0xf1e4('0x4a')]=_0x37e9d5[_0xf1e4('0x4a')][_0xf1e4('0x4c')]?_0x37e9d5['attributes']:_0x1f4457[_0xf1e4('0x45')];if(!_0x558090[_0xf1e4('0x46')][_0xf1e4('0x4d')](_0xf1e4('0x4e'))){_0x37e9d5[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x558090[_0xf1e4('0x46')][_0xf1e4('0x32')]);_0x37e9d5[_0xf1e4('0x31')]=qs[_0xf1e4('0x31')](_0x558090[_0xf1e4('0x46')][_0xf1e4('0x31')]);}_0x37e9d5[_0xf1e4('0x4f')]=qs[_0xf1e4('0x50')](_0x558090[_0xf1e4('0x46')][_0xf1e4('0x50')]);_0x37e9d5['where']=qs[_0xf1e4('0x48')](_[_0xf1e4('0x51')](_0x558090[_0xf1e4('0x46')],_0x1f4457[_0xf1e4('0x48')]),_0x5c6787);if(_0x558090[_0xf1e4('0x46')][_0xf1e4('0x52')]){_0x37e9d5[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0x37e9d5[_0xf1e4('0x53')],{'$or':_['map'](_0x5c6787,function(_0x1cf7f9){if(_0x1cf7f9[_0xf1e4('0x43')]!==_0xf1e4('0x55')){var _0x1b74a6={};_0x1b74a6[_0x1cf7f9['name']]={'$like':'%'+_0x558090[_0xf1e4('0x46')][_0xf1e4('0x52')]+'%'};return _0x1b74a6;}})});}_0x37e9d5=_[_0xf1e4('0x54')]({},_0x37e9d5,_0x558090[_0xf1e4('0x56')]);var _0x5ecede={'where':_0x37e9d5[_0xf1e4('0x53')]};return db[_0xf1e4('0x57')][_0xf1e4('0x30')](_0x5ecede)['then'](function(_0x5b6158){_0x24ba4a[_0xf1e4('0x30')]=_0x5b6158;if(_0x558090[_0xf1e4('0x46')][_0xf1e4('0x58')]){_0x37e9d5[_0xf1e4('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0xf1e4('0x5a')](_0x37e9d5);})[_0xf1e4('0x21')](function(_0x1b373b){_0x24ba4a[_0xf1e4('0x5b')]=_0x1b373b;return _0x24ba4a;})[_0xf1e4('0x21')](respondWithFilteredResult(_0x5face5,_0x37e9d5))['catch'](handleError(_0x5face5,null));};exports[_0xf1e4('0x5c')]=function(_0x431392,_0x3edce7){var _0x44d3eb={'raw':![],'where':{'id':_0x431392[_0xf1e4('0x5d')]['id']},'include':[{'model':db[_0xf1e4('0x3d')],'as':_0xf1e4('0x3e')},{'model':db[_0xf1e4('0x5e')],'as':_0xf1e4('0x3f')},{'model':db['Pause'],'as':_0xf1e4('0x40')}]},_0x104fe7={};_0x104fe7[_0xf1e4('0x45')]=_[_0xf1e4('0x47')](db[_0xf1e4('0x57')][_0xf1e4('0x5f')]);_0x104fe7[_0xf1e4('0x46')]=_[_0xf1e4('0x47')](_0x431392[_0xf1e4('0x46')]);_0x104fe7[_0xf1e4('0x48')]=_['intersection'](_0x104fe7['model'],_0x104fe7[_0xf1e4('0x46')]);_0x44d3eb[_0xf1e4('0x4a')]=_[_0xf1e4('0x49')](_0x104fe7[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x431392[_0xf1e4('0x46')][_0xf1e4('0x4b')]));_0x44d3eb[_0xf1e4('0x4a')]=_0x44d3eb[_0xf1e4('0x4a')]['length']?_0x44d3eb[_0xf1e4('0x4a')]:_0x104fe7[_0xf1e4('0x45')];if(_0x431392[_0xf1e4('0x46')][_0xf1e4('0x58')]){_0x44d3eb[_0xf1e4('0x59')]=[{'all':!![]}];}_0x44d3eb=_[_0xf1e4('0x54')]({},_0x44d3eb,_0x431392['options']);return db[_0xf1e4('0x57')]['find'](_0x44d3eb)['then'](handleEntityNotFound(_0x3edce7,null))['then'](respondWithResult(_0x3edce7,null))[_0xf1e4('0x2b')](handleError(_0x3edce7,null));};exports[_0xf1e4('0x38')]=function(_0x965e6d,_0x1e807b){if(_0x965e6d[_0xf1e4('0x60')]['id']){delete _0x965e6d[_0xf1e4('0x60')]['id'];}return db[_0xf1e4('0x57')][_0xf1e4('0x61')]({'where':{'id':_0x965e6d[_0xf1e4('0x5d')]['id']},'include':[{'model':db[_0xf1e4('0x3d')],'as':'Imap'},{'model':db[_0xf1e4('0x5e')],'as':'Smtp'},{'model':db[_0xf1e4('0x62')],'as':_0xf1e4('0x40')}]})[_0xf1e4('0x21')](handleEntityNotFound(_0x1e807b,null))[_0xf1e4('0x21')](saveUpdates(_0x965e6d[_0xf1e4('0x60')],null))[_0xf1e4('0x21')](function(_0x16d797){if(_0x16d797&&_0x965e6d['body']['Imap']){return db[_0xf1e4('0x3d')][_0xf1e4('0x38')](_0x965e6d[_0xf1e4('0x60')][_0xf1e4('0x3e')],{'where':{'MailAccountId':_0x16d797['id']}})['then'](function(){return _0x16d797;});}return _0x16d797;})[_0xf1e4('0x21')](function(_0x27c8d7){if(_0x27c8d7&&_0x965e6d['body'][_0xf1e4('0x3f')]){return db[_0xf1e4('0x5e')][_0xf1e4('0x38')](_0x965e6d[_0xf1e4('0x60')]['Smtp'],{'where':{'MailAccountId':_0x27c8d7['id']}})[_0xf1e4('0x21')](function(){return _0x27c8d7;});}return _0x27c8d7;})[_0xf1e4('0x21')](respondWithResult(_0x1e807b,null))['catch'](handleError(_0x1e807b,null));};exports['describe']=function(_0x21d5be,_0x356638){return db['MailAccount'][_0xf1e4('0x63')]()[_0xf1e4('0x21')](respondWithResult(_0x356638,null))[_0xf1e4('0x2b')](handleError(_0x356638,null));};exports[_0xf1e4('0x64')]=function(_0x2c4ae8,_0x23d9cc,_0x352a30){if(_0x2c4ae8['body']['id']){delete _0x2c4ae8[_0xf1e4('0x60')]['id'];}return db['MailAccount'][_0xf1e4('0x61')]({'where':{'id':_0x2c4ae8[_0xf1e4('0x5d')]['id']}})['then'](handleEntityNotFound(_0x23d9cc,null))[_0xf1e4('0x21')](function(_0x1a22c){if(_0x1a22c){_0x2c4ae8['body'][_0xf1e4('0x65')]=_0x1a22c['id'];return db[_0xf1e4('0x66')][_0xf1e4('0x67')](_0x2c4ae8['body']);}})[_0xf1e4('0x21')](respondWithResult(_0x23d9cc,null))[_0xf1e4('0x2b')](handleError(_0x23d9cc,null));};exports[_0xf1e4('0x68')]=function(_0x5aef6d,_0x598190,_0x36b23c){var _0x5a2822={'raw':![],'where':{}};var _0x1a1b25={};var _0x4b0487={'count':0x0,'rows':[]};return db[_0xf1e4('0x57')][_0xf1e4('0x69')]({'where':{'id':_0x5aef6d['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x598190,null))[_0xf1e4('0x21')](function(_0x3b5d6a){if(_0x3b5d6a){_0x1a1b25[_0xf1e4('0x45')]=_[_0xf1e4('0x47')](db[_0xf1e4('0x66')][_0xf1e4('0x5f')]);_0x1a1b25[_0xf1e4('0x46')]=_[_0xf1e4('0x47')](_0x5aef6d['query']);_0x1a1b25[_0xf1e4('0x48')]=_['intersection'](_0x1a1b25[_0xf1e4('0x45')],_0x1a1b25[_0xf1e4('0x46')]);_0x5a2822['attributes']=_[_0xf1e4('0x49')](_0x1a1b25[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x5aef6d[_0xf1e4('0x46')][_0xf1e4('0x4b')]));_0x5a2822[_0xf1e4('0x4a')]=_0x5a2822[_0xf1e4('0x4a')][_0xf1e4('0x4c')]?_0x5a2822[_0xf1e4('0x4a')]:_0x1a1b25[_0xf1e4('0x45')];if(!_0x5aef6d[_0xf1e4('0x46')]['hasOwnProperty'](_0xf1e4('0x4e'))){_0x5a2822[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x5aef6d['query'][_0xf1e4('0x32')]);_0x5a2822[_0xf1e4('0x31')]=qs['offset'](_0x5aef6d[_0xf1e4('0x46')]['offset']);}_0x5a2822[_0xf1e4('0x4f')]=qs['sort'](_0x5aef6d[_0xf1e4('0x46')][_0xf1e4('0x50')]);_0x5a2822[_0xf1e4('0x53')]=qs[_0xf1e4('0x48')](_[_0xf1e4('0x51')](_0x5aef6d['query'],_0x1a1b25[_0xf1e4('0x48')]));_0x5a2822[_0xf1e4('0x53')][_0xf1e4('0x65')]=_0x3b5d6a['id'];if(_0x5aef6d['query'][_0xf1e4('0x52')]){_0x5a2822[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0x5a2822['where'],{'$or':_[_0xf1e4('0x41')](_0x5a2822['attributes'],function(_0x59faa8){var _0x154906={};_0x154906[_0x59faa8]={'$like':'%'+_0x5aef6d[_0xf1e4('0x46')][_0xf1e4('0x52')]+'%'};return _0x154906;})});}_0x5a2822=_[_0xf1e4('0x54')]({},_0x5a2822,_0x5aef6d[_0xf1e4('0x56')]);return db[_0xf1e4('0x66')][_0xf1e4('0x30')]({'where':_0x5a2822[_0xf1e4('0x53')]})['then'](function(_0xa1ff06){_0x4b0487[_0xf1e4('0x30')]=_0xa1ff06;if(_0x5aef6d[_0xf1e4('0x46')]['includeAll']){_0x5a2822[_0xf1e4('0x59')]=[{'all':!![]}];}return db[_0xf1e4('0x66')][_0xf1e4('0x5a')](_0x5a2822);})['then'](function(_0x71af76){_0x4b0487['rows']=_0x71af76;return _0x4b0487;});}})[_0xf1e4('0x21')](respondWithFilteredResult(_0x598190,_0x5a2822))[_0xf1e4('0x2b')](handleError(_0x598190,null));};exports[_0xf1e4('0x6a')]=function(_0x525eda,_0x4a5cc4,_0x4e3efc){return db[_0xf1e4('0x57')][_0xf1e4('0x61')]({'where':{'id':_0x525eda[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x4a5cc4,null))[_0xf1e4('0x21')](function(_0x35a729){if(_0x35a729){return _0x35a729[_0xf1e4('0x6a')](_0x525eda[_0xf1e4('0x46')][_0xf1e4('0x6b')]);}})[_0xf1e4('0x21')](respondWithStatusCode(_0x4a5cc4,null))['catch'](handleError(_0x4a5cc4,null));};exports[_0xf1e4('0x6c')]=function(_0x185f64,_0xe546ee,_0x4ade0c){if(_0x185f64[_0xf1e4('0x60')]['id']){delete _0x185f64[_0xf1e4('0x60')]['id'];}return db['MailAccount'][_0xf1e4('0x61')]({'where':{'id':_0x185f64[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0xe546ee,null))[_0xf1e4('0x21')](function(_0x5e49ca){if(_0x5e49ca){_0x185f64[_0xf1e4('0x60')][_0xf1e4('0x65')]=_0x5e49ca['id'];return db[_0xf1e4('0x6d')][_0xf1e4('0x67')](_0x185f64['body']);}})['then'](respondWithResult(_0xe546ee,null))[_0xf1e4('0x2b')](handleError(_0xe546ee,null));};exports['getAnswers']=function(_0x35a1dd,_0x549413,_0x285584){var _0x5fabba={'raw':![],'where':{}};var _0x31305a={};var _0x25f2df={'count':0x0,'rows':[]};return db[_0xf1e4('0x57')][_0xf1e4('0x69')]({'where':{'id':_0x35a1dd['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x549413,null))[_0xf1e4('0x21')](function(_0x306ea8){if(_0x306ea8){_0x31305a[_0xf1e4('0x45')]=_['keys'](db[_0xf1e4('0x6d')]['rawAttributes']);_0x31305a[_0xf1e4('0x46')]=_['keys'](_0x35a1dd['query']);_0x31305a[_0xf1e4('0x48')]=_['intersection'](_0x31305a[_0xf1e4('0x45')],_0x31305a[_0xf1e4('0x46')]);_0x5fabba[_0xf1e4('0x4a')]=_['intersection'](_0x31305a[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x35a1dd[_0xf1e4('0x46')][_0xf1e4('0x4b')]));_0x5fabba[_0xf1e4('0x4a')]=_0x5fabba['attributes'][_0xf1e4('0x4c')]?_0x5fabba['attributes']:_0x31305a[_0xf1e4('0x45')];if(!_0x35a1dd[_0xf1e4('0x46')][_0xf1e4('0x4d')](_0xf1e4('0x4e'))){_0x5fabba[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x35a1dd['query'][_0xf1e4('0x32')]);_0x5fabba[_0xf1e4('0x31')]=qs[_0xf1e4('0x31')](_0x35a1dd[_0xf1e4('0x46')][_0xf1e4('0x31')]);}_0x5fabba[_0xf1e4('0x4f')]=qs['sort'](_0x35a1dd[_0xf1e4('0x46')][_0xf1e4('0x50')]);_0x5fabba[_0xf1e4('0x53')]=qs[_0xf1e4('0x48')](_[_0xf1e4('0x51')](_0x35a1dd['query'],_0x31305a[_0xf1e4('0x48')]));_0x5fabba['where']['MailAccountId']=_0x306ea8['id'];if(_0x35a1dd['query'][_0xf1e4('0x52')]){_0x5fabba[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0x5fabba[_0xf1e4('0x53')],{'$or':_[_0xf1e4('0x41')](_0x5fabba['attributes'],function(_0x1ecb6f){var _0x562dc5={};_0x562dc5[_0x1ecb6f]={'$like':'%'+_0x35a1dd['query']['filter']+'%'};return _0x562dc5;})});}_0x5fabba=_[_0xf1e4('0x54')]({},_0x5fabba,_0x35a1dd['options']);return db[_0xf1e4('0x6d')][_0xf1e4('0x30')]({'where':_0x5fabba[_0xf1e4('0x53')]})[_0xf1e4('0x21')](function(_0x29f666){_0x25f2df[_0xf1e4('0x30')]=_0x29f666;if(_0x35a1dd[_0xf1e4('0x46')][_0xf1e4('0x58')]){_0x5fabba[_0xf1e4('0x59')]=[{'all':!![]}];}return db[_0xf1e4('0x6d')][_0xf1e4('0x5a')](_0x5fabba);})[_0xf1e4('0x21')](function(_0x2c2064){_0x25f2df[_0xf1e4('0x5b')]=_0x2c2064;return _0x25f2df;});}})['then'](respondWithFilteredResult(_0x549413,_0x5fabba))['catch'](handleError(_0x549413,null));};exports['removeAnswers']=function(_0x45920e,_0x5ef120,_0x80030e){return db[_0xf1e4('0x57')][_0xf1e4('0x61')]({'where':{'id':_0x45920e['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x5ef120,null))[_0xf1e4('0x21')](function(_0x475e3e){if(_0x475e3e){return _0x475e3e[_0xf1e4('0x6e')](_0x45920e[_0xf1e4('0x46')][_0xf1e4('0x6b')]);}})[_0xf1e4('0x21')](respondWithStatusCode(_0x5ef120,null))['catch'](handleError(_0x5ef120,null));};exports['create']=function(_0x3262e6,_0x5e1deb){var _0x224884={'name':_0x3262e6['body'][_0xf1e4('0x3b')],'key':_0x3262e6[_0xf1e4('0x60')]['key'],'email':_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x6f')],'ListId':_0x3262e6[_0xf1e4('0x60')]['ListId'],'active':!_['isNil'](_0x3262e6['body']['active'])?_0x3262e6['body'][_0xf1e4('0x70')]:!![],'description':_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xf1e4('0x72')](_0x3262e6[_0xf1e4('0x60')]['cservice'])){if(_0x3262e6['body'][_0xf1e4('0x73')]){_0x224884[_0xf1e4('0x3e')]['user']=_0x224884[_0xf1e4('0x3f')][_0xf1e4('0x74')]=_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x75')];_0x224884[_0xf1e4('0x3e')][_0xf1e4('0x76')]=_0x224884[_0xf1e4('0x3f')][_0xf1e4('0x77')]=_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x78')];}else{_0x224884[_0xf1e4('0x3e')][_0xf1e4('0x79')]=_0x224884[_0xf1e4('0x3f')][_0xf1e4('0x79')]=![];}_0x224884[_0xf1e4('0x3e')][_0xf1e4('0x7a')]=_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x3e')][_0xf1e4('0x7a')];_0x224884[_0xf1e4('0x3e')][_0xf1e4('0x7b')]=_0x3262e6['body'][_0xf1e4('0x3e')][_0xf1e4('0x7b')];_0x224884[_0xf1e4('0x3f')][_0xf1e4('0x7a')]=_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x3f')][_0xf1e4('0x7a')];_0x224884['Smtp'][_0xf1e4('0x7b')]=_0x3262e6[_0xf1e4('0x60')]['Smtp']['port'];}else{_0x224884['Imap']['service']=_0x224884[_0xf1e4('0x3f')]['service']=_0x3262e6['body'][_0xf1e4('0x7c')];_0x224884[_0xf1e4('0x3e')][_0xf1e4('0x74')]=_0x224884[_0xf1e4('0x3f')][_0xf1e4('0x74')]=_0x3262e6[_0xf1e4('0x60')][_0xf1e4('0x75')];_0x224884[_0xf1e4('0x3e')]['password']=_0x224884[_0xf1e4('0x3f')]['pass']=_0x3262e6['body'][_0xf1e4('0x78')];}return db[_0xf1e4('0x57')][_0xf1e4('0x67')](_0x224884,{'include':[{'model':db[_0xf1e4('0x5e')],'as':_0xf1e4('0x3f')},{'model':db[_0xf1e4('0x3d')],'as':_0xf1e4('0x3e')}]})[_0xf1e4('0x21')](function(_0x301ff0){var _0x2d7894=_0x3262e6['user']['get']({'plain':!![]});if(!_0x2d7894)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d7894[_0xf1e4('0x7d')]==='user'){var _0x549ba7=_0x301ff0[_0xf1e4('0x7e')]({'plain':!![]});return db[_0xf1e4('0x7f')][_0xf1e4('0x61')]({'where':{'name':_0xf1e4('0x80'),'userProfileId':_0x2d7894['userProfileId']},'raw':!![]})[_0xf1e4('0x21')](function(_0x1ee0c1){if(_0x1ee0c1&&_0x1ee0c1[_0xf1e4('0x81')]===0x0){return db['UserProfileResource'][_0xf1e4('0x67')]({'name':_0x549ba7[_0xf1e4('0x3b')],'resourceId':_0x549ba7['id'],'type':_0x1ee0c1[_0xf1e4('0x3b')],'sectionId':_0x1ee0c1['id']},{})[_0xf1e4('0x21')](function(){return _0x301ff0;});}else{return _0x301ff0;}})[_0xf1e4('0x2b')](function(_0x286271){logger[_0xf1e4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286271);throw _0x286271;});}return _0x301ff0;})[_0xf1e4('0x21')](respondWithResult(_0x5e1deb,0xc9))[_0xf1e4('0x2b')](handleError(_0x5e1deb,null));};exports[_0xf1e4('0x82')]=function(_0x17ad6b,_0xb30090,_0x10aaba){return db[_0xf1e4('0x57')]['findOne']({'where':{'id':_0x17ad6b[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0xb30090,null))[_0xf1e4('0x21')](function(_0x1b52c0){if(_0x1b52c0){return _0x1b52c0[_0xf1e4('0x82')]();}return null;})['then'](respondWithResult(_0xb30090,null))['catch'](handleError(_0xb30090,null));};exports[_0xf1e4('0x83')]=function(_0x45ec13,_0x12b2a9,_0x2ef585){if(_0x45ec13[_0xf1e4('0x60')]['id']){delete _0x45ec13[_0xf1e4('0x60')]['id'];}return db['MailAccount'][_0xf1e4('0x61')]({'where':{'id':_0x45ec13[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x12b2a9,null))[_0xf1e4('0x21')](function(_0x35855f){if(_0x35855f){_0x45ec13[_0xf1e4('0x60')][_0xf1e4('0x65')]=_0x35855f['id'];return db[_0xf1e4('0x3d')][_0xf1e4('0x67')](_0x45ec13[_0xf1e4('0x60')]);}})[_0xf1e4('0x21')](respondWithResult(_0x12b2a9,null))[_0xf1e4('0x2b')](handleError(_0x12b2a9,null));};exports['removeImap']=function(_0x3b3ce3,_0x59f0fc,_0x2c7ae0){return db['MailAccount']['findOne']({'where':{'id':_0x3b3ce3[_0xf1e4('0x5d')]['id']}})['then'](handleEntityNotFound(_0x59f0fc,null))['then'](function(_0xaaab79){if(_0xaaab79){return _0xaaab79[_0xf1e4('0x84')](null);}return null;})[_0xf1e4('0x21')](respondWithStatusCode(_0x59f0fc,null))['catch'](handleError(_0x59f0fc,null));};exports['getSmtp']=function(_0x230866,_0x49615e,_0x543323){return db['MailAccount'][_0xf1e4('0x69')]({'where':{'id':_0x230866['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x49615e,null))[_0xf1e4('0x21')](function(_0x46ff51){if(_0x46ff51){return _0x46ff51['getSmtp']();}return null;})[_0xf1e4('0x21')](respondWithResult(_0x49615e,null))[_0xf1e4('0x2b')](handleError(_0x49615e,null));};exports[_0xf1e4('0x85')]=function(_0x54642a,_0x12b801,_0x512b9f){if(_0x54642a[_0xf1e4('0x60')]['id']){delete _0x54642a[_0xf1e4('0x60')]['id'];}return db[_0xf1e4('0x57')]['find']({'where':{'id':_0x54642a[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x12b801,null))[_0xf1e4('0x21')](function(_0x49eac3){if(_0x49eac3){_0x54642a[_0xf1e4('0x60')]['MailAccountId']=_0x49eac3['id'];return db[_0xf1e4('0x5e')]['create'](_0x54642a[_0xf1e4('0x60')]);}})['then'](respondWithResult(_0x12b801,null))[_0xf1e4('0x2b')](handleError(_0x12b801,null));};exports[_0xf1e4('0x86')]=function(_0x4dca2c,_0xd11a44,_0x4408cf){return db[_0xf1e4('0x57')]['findOne']({'where':{'id':_0x4dca2c['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0xd11a44,null))[_0xf1e4('0x21')](function(_0x481b79){if(_0x481b79){return _0x481b79[_0xf1e4('0x87')](null);}return null;})[_0xf1e4('0x21')](respondWithStatusCode(_0xd11a44,null))[_0xf1e4('0x2b')](handleError(_0xd11a44,null));};exports[_0xf1e4('0x88')]=function(_0x23093a,_0x2da06c,_0x141215){return db[_0xf1e4('0x89')]['find']({'where':{'id':_0x23093a[_0xf1e4('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2da06c,null))['then'](function(_0x109d37){if(_0x109d37){return _0x109d37[_0xf1e4('0x88')](_0x23093a[_0xf1e4('0x60')][_0xf1e4('0x6b')],_[_0xf1e4('0x8a')](_0x23093a[_0xf1e4('0x60')],[_0xf1e4('0x6b'),'id'])||{});}})[_0xf1e4('0x21')](respondWithResult(_0x2da06c,null))[_0xf1e4('0x2b')](handleError(_0x2da06c,null));};exports['getInteractions']=function(_0x4d913a,_0x19bf74,_0x593ffa){var _0x13838b={'raw':![],'where':{}};var _0x19b6d0={};var _0x547c6a={'count':0x0,'rows':[]};return db[_0xf1e4('0x57')][_0xf1e4('0x69')]({'where':{'id':_0x4d913a[_0xf1e4('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19bf74,null))[_0xf1e4('0x21')](function(_0x12e334){if(_0x12e334){_0x19b6d0[_0xf1e4('0x45')]=_[_0xf1e4('0x47')](db[_0xf1e4('0x89')][_0xf1e4('0x5f')]);_0x19b6d0[_0xf1e4('0x46')]=_['keys'](_0x4d913a[_0xf1e4('0x46')]);_0x19b6d0[_0xf1e4('0x48')]=_[_0xf1e4('0x49')](_0x19b6d0['model'],_0x19b6d0[_0xf1e4('0x46')]);_0x13838b[_0xf1e4('0x4a')]=_[_0xf1e4('0x49')](_0x19b6d0['model'],qs[_0xf1e4('0x4b')](_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x4b')]));_0x13838b[_0xf1e4('0x4a')]=_0x13838b['attributes'][_0xf1e4('0x4c')]?_0x13838b[_0xf1e4('0x4a')]:_0x19b6d0[_0xf1e4('0x45')];if(!_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x4d')](_0xf1e4('0x4e'))){_0x13838b[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x4d913a['query'][_0xf1e4('0x32')]);_0x13838b[_0xf1e4('0x31')]=qs[_0xf1e4('0x31')](_0x4d913a['query'][_0xf1e4('0x31')]);}_0x13838b[_0xf1e4('0x4f')]=qs[_0xf1e4('0x50')](_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x50')]);_0x13838b['where']=qs['filters'](_['pick'](_0x4d913a[_0xf1e4('0x46')],_0x19b6d0[_0xf1e4('0x48')]));_0x13838b['where'][_0xf1e4('0x65')]=_0x12e334['id'];if(_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x52')]){_0x13838b[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0x13838b[_0xf1e4('0x53')],{'$or':_[_0xf1e4('0x41')](_0x13838b['attributes'],function(_0x36f28){var _0x324a49={};_0x324a49[_0x36f28]={'$like':'%'+_0x4d913a['query'][_0xf1e4('0x52')]+'%'};return _0x324a49;})});}_0x13838b=_['merge']({},_0x13838b,_0x4d913a[_0xf1e4('0x56')]);return db[_0xf1e4('0x89')][_0xf1e4('0x30')]({'where':_0x13838b[_0xf1e4('0x53')]})[_0xf1e4('0x21')](function(_0x36396f){_0x547c6a[_0xf1e4('0x30')]=_0x36396f;if(_0x4d913a['query']['includeAll']){_0x13838b[_0xf1e4('0x59')]=[{'model':db[_0xf1e4('0x8b')],'as':_0xf1e4('0x8c'),'required':![]},{'model':db[_0xf1e4('0x8d')],'as':_0xf1e4('0x8e'),'attributes':[_0xf1e4('0x3b'),_0xf1e4('0x8f'),_0xf1e4('0x90')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xf1e4('0x3b'),'color'],'where':_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x91')]?{'id':_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x91')]}:undefined,'required':_0x4d913a[_0xf1e4('0x46')][_0xf1e4('0x91')]?!![]:![]}];}return db[_0xf1e4('0x89')][_0xf1e4('0x5a')](_0x13838b);})['then'](function(_0x457f55){_0x547c6a[_0xf1e4('0x5b')]=_0x457f55;return _0x547c6a;});}})['then'](respondWithFilteredResult(_0x19bf74,_0x13838b))[_0xf1e4('0x2b')](handleError(_0x19bf74,null));};exports['addApplications']=function(_0x5d25a2,_0x507812,_0x7df5a0){return db[_0xf1e4('0x57')]['findOne']({'where':{'id':_0x5d25a2['params']['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x507812,null))['then'](function(_0xef1834){if(_0xef1834){return db['sequelize']['transaction'](function(_0x3bb84d){return db[_0xf1e4('0x92')]['destroy']({'where':{'MailAccountId':_0x5d25a2[_0xf1e4('0x5d')]['id']},'transaction':_0x3bb84d})[_0xf1e4('0x21')](function(_0x2c1adb){var _0x4fd531=_[_0xf1e4('0x41')](_0x5d25a2['body'],function(_0x362bb7){_0x362bb7[_0xf1e4('0x65')]=_0x5d25a2[_0xf1e4('0x5d')]['id'];return _0x362bb7;});return db[_0xf1e4('0x92')][_0xf1e4('0x93')](_0x4fd531,{'transaction':_0x3bb84d});});})[_0xf1e4('0x21')](function(){return db['MailApplication'][_0xf1e4('0x94')]({'where':{'MailAccountId':_0x5d25a2[_0xf1e4('0x5d')]['id']},'order':_0xf1e4('0x95')});});}})[_0xf1e4('0x21')](respondWithResult(_0x507812,null))[_0xf1e4('0x2b')](handleError(_0x507812,null));};exports[_0xf1e4('0x96')]=function(_0x2065cd,_0x5bc004,_0x52f59f){var _0x225e2e={};var _0x2a80b5={};var _0x814318;var _0x4f343e;return db[_0xf1e4('0x57')]['findOne']({'where':{'id':_0x2065cd[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x5bc004,null))[_0xf1e4('0x21')](function(_0x5d21ec){if(_0x5d21ec){_0x814318=_0x5d21ec;_0x2a80b5['model']=_['keys'](db[_0xf1e4('0x92')][_0xf1e4('0x5f')]);_0x2a80b5[_0xf1e4('0x46')]=_['keys'](_0x2065cd[_0xf1e4('0x46')]);_0x2a80b5[_0xf1e4('0x48')]=_[_0xf1e4('0x49')](_0x2a80b5['model'],_0x2a80b5[_0xf1e4('0x46')]);_0x225e2e[_0xf1e4('0x4a')]=_[_0xf1e4('0x49')](_0x2a80b5[_0xf1e4('0x45')],qs['fields'](_0x2065cd['query'][_0xf1e4('0x4b')]));_0x225e2e['attributes']=_0x225e2e[_0xf1e4('0x4a')][_0xf1e4('0x4c')]?_0x225e2e[_0xf1e4('0x4a')]:_0x2a80b5[_0xf1e4('0x45')];_0x225e2e[_0xf1e4('0x4f')]=qs[_0xf1e4('0x50')](_0x2065cd[_0xf1e4('0x46')]['sort']);_0x225e2e[_0xf1e4('0x53')]=qs['filters'](_['pick'](_0x2065cd[_0xf1e4('0x46')],_0x2a80b5['filters']));if(_0x2065cd['query'][_0xf1e4('0x52')]){_0x225e2e[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0x225e2e[_0xf1e4('0x53')],{'$or':_[_0xf1e4('0x41')](_0x225e2e[_0xf1e4('0x4a')],function(_0x1c2950){var _0x2ab609={};_0x2ab609[_0x1c2950]={'$like':'%'+_0x2065cd[_0xf1e4('0x46')][_0xf1e4('0x52')]+'%'};return _0x2ab609;})});}_0x225e2e=_[_0xf1e4('0x54')]({},_0x225e2e,_0x2065cd[_0xf1e4('0x56')]);return _0x814318['getApplications'](_0x225e2e);}})['then'](function(_0x4f3ab9){if(_0x4f3ab9){_0x4f343e=_0x4f3ab9['length'];if(!_0x2065cd['query']['hasOwnProperty']('nolimit')){_0x225e2e['limit']=qs[_0xf1e4('0x32')](_0x2065cd['query'][_0xf1e4('0x32')]);_0x225e2e[_0xf1e4('0x31')]=qs['offset'](_0x2065cd['query']['offset']);}return _0x814318['getApplications'](_0x225e2e);}})[_0xf1e4('0x21')](function(_0x4ef043){if(_0x4ef043){return _0x4ef043?{'count':_0x4f343e,'rows':_0x4ef043}:null;}})[_0xf1e4('0x21')](respondWithResult(_0x5bc004,null))['catch'](handleError(_0x5bc004,null));};exports[_0xf1e4('0x97')]=function(_0x40d050,_0x418f02,_0x487d40){var _0xb568d8={'raw':!![],'where':{}};var _0x50d0bc={};var _0x27b587={'count':0x0,'rows':[]};return db[_0xf1e4('0x57')][_0xf1e4('0x69')]({'where':{'id':_0x40d050[_0xf1e4('0x5d')]['id']}})['then'](handleEntityNotFound(_0x418f02,null))[_0xf1e4('0x21')](function(_0x3b5cbe){if(_0x3b5cbe){_0x50d0bc[_0xf1e4('0x45')]=_[_0xf1e4('0x47')](db[_0xf1e4('0x98')][_0xf1e4('0x5f')]);_0x50d0bc[_0xf1e4('0x46')]=_['keys'](_0x40d050[_0xf1e4('0x46')]);_0x50d0bc[_0xf1e4('0x48')]=_['intersection'](_0x50d0bc[_0xf1e4('0x45')],_0x50d0bc[_0xf1e4('0x46')]);_0xb568d8[_0xf1e4('0x4a')]=_[_0xf1e4('0x49')](_0x50d0bc[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x40d050[_0xf1e4('0x46')]['fields']));_0xb568d8[_0xf1e4('0x4a')]=_0xb568d8['attributes'][_0xf1e4('0x4c')]?_0xb568d8[_0xf1e4('0x4a')]:_0x50d0bc['model'];if(!_0x40d050[_0xf1e4('0x46')]['hasOwnProperty']('nolimit')){_0xb568d8[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x40d050[_0xf1e4('0x46')][_0xf1e4('0x32')]);_0xb568d8[_0xf1e4('0x31')]=qs[_0xf1e4('0x31')](_0x40d050[_0xf1e4('0x46')]['offset']);}_0xb568d8[_0xf1e4('0x4f')]=qs[_0xf1e4('0x50')](_0x40d050[_0xf1e4('0x46')]['sort']);_0xb568d8['where']=qs[_0xf1e4('0x48')](_['pick'](_0x40d050[_0xf1e4('0x46')],_0x50d0bc[_0xf1e4('0x48')]));_0xb568d8['where']['MailAccountId']=_0x3b5cbe['id'];if(_0x40d050[_0xf1e4('0x46')][_0xf1e4('0x52')]){_0xb568d8['where']=_[_0xf1e4('0x54')](_0xb568d8[_0xf1e4('0x53')],{'$or':_[_0xf1e4('0x41')](_0xb568d8[_0xf1e4('0x4a')],function(_0xb57390){var _0x3ff7f1={};_0x3ff7f1[_0xb57390]={'$like':'%'+_0x40d050[_0xf1e4('0x46')][_0xf1e4('0x52')]+'%'};return _0x3ff7f1;})});}if(_0x40d050['query'][_0xf1e4('0x99')]){var _0x5473bd=_0x40d050[_0xf1e4('0x46')][_0xf1e4('0x99')][_0xf1e4('0x9a')](',');var _0x18873a={};_0x18873a[_0x5473bd[0x0]]={'$gte':moment(_0x5473bd[0x1])['format'](_0xf1e4('0x9b'))};_0xb568d8[_0xf1e4('0x53')]=_[_0xf1e4('0x54')](_0xb568d8[_0xf1e4('0x53')],_0x18873a);}_0xb568d8=_['merge']({},_0xb568d8,_0x40d050['options']);return db['MailMessage'][_0xf1e4('0x30')]({'where':_0xb568d8['where']})[_0xf1e4('0x21')](function(_0x396837){_0x27b587[_0xf1e4('0x30')]=_0x396837;if(_0x40d050['query'][_0xf1e4('0x58')]){_0xb568d8[_0xf1e4('0x59')]=[{'all':!![]}];}return db[_0xf1e4('0x98')][_0xf1e4('0x5a')](_0xb568d8);})[_0xf1e4('0x21')](function(_0x4c3b5a){_0x27b587[_0xf1e4('0x5b')]=_0x4c3b5a;return _0x27b587;});}})[_0xf1e4('0x21')](respondWithFilteredResult(_0x418f02,_0xb568d8))[_0xf1e4('0x2b')](handleError(_0x418f02,null));};exports[_0xf1e4('0x3c')]=function(_0x331d4d,_0x1edebb,_0x3899b6){var _0x483e65,_0x29eea5={},_0x4d4bfa;if(_0x331d4d['body']['to']){_0x4d4bfa=_0x331d4d[_0xf1e4('0x60')]['to']['split'](',')[0x0];}return db[_0xf1e4('0x57')][_0xf1e4('0x61')]({'where':{'id':_0x331d4d[_0xf1e4('0x5d')]['id']},'include':[{'model':db[_0xf1e4('0x9c')],'as':'List','include':[{'model':db[_0xf1e4('0x8b')],'as':_0xf1e4('0x9d'),'where':{'email':_0x4d4bfa},'limit':0x1,'order':[[_0xf1e4('0x9e'),_0xf1e4('0x9f')]]}]},{'model':db[_0xf1e4('0x5e')],'as':_0xf1e4('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1edebb,null))[_0xf1e4('0x21')](function(_0x3d0c5d){if(_0x3d0c5d){_0x483e65=_0x3d0c5d;if(_0x3d0c5d[_0xf1e4('0x3f')]){if(_[_0xf1e4('0x72')](_0x331d4d[_0xf1e4('0x60')]['from'])){_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa0')]=util[_0xf1e4('0xa1')](_0xf1e4('0xa2'),_0x3d0c5d[_0xf1e4('0x3b')],_0x3d0c5d[_0xf1e4('0x6f')]||_0x3d0c5d['Smtp']['user']);}if(_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa3')]&&_0x331d4d['body'][_0xf1e4('0xa3')][_0xf1e4('0x4c')]){for(var _0x18d55f=0x0;_0x18d55f<_0x331d4d['body']['attachments'][_0xf1e4('0x4c')];_0x18d55f+=0x1){_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa3')][_0x18d55f]={'filename':_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa3')][_0x18d55f][_0xf1e4('0x3b')],'path':path[_0xf1e4('0xa4')](config['root'],_0xf1e4('0xa5'),_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa3')][_0x18d55f][_0xf1e4('0xa6')])};}}var _0x4f26c2={'tls':{'rejectUnauthorized':![]}};if(_[_0xf1e4('0x72')](_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0xa7')])){if(_0x3d0c5d[_0xf1e4('0x3f')]['authentication']){_0x4f26c2[_0xf1e4('0xa8')]={'user':_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0x74')],'pass':_0x3d0c5d['Smtp'][_0xf1e4('0x77')]};}_0x4f26c2[_0xf1e4('0x7a')]=_0x3d0c5d['Smtp']['host'];_0x4f26c2[_0xf1e4('0x7b')]=_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0x7b')];_0x4f26c2[_0xf1e4('0xa9')]=_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0xa9')];}else{_0x4f26c2[_0xf1e4('0xa7')]=_0x3d0c5d['Smtp'][_0xf1e4('0xa7')];_0x4f26c2[_0xf1e4('0xa8')]={'user':_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0x74')],'pass':_0x3d0c5d[_0xf1e4('0x3f')][_0xf1e4('0x77')]};}return respondWithRpcPromise(_0xf1e4('0xaa'),'sendMail',{'account':_0x4f26c2,'message':_0x331d4d['body']});}else{throw new Error(_0xf1e4('0xab'));}}})[_0xf1e4('0x21')](function(_0x452f1b){if(_0x452f1b){_0x29eea5=_0x452f1b;if(_0x483e65[_0xf1e4('0xac')]){if(_0x483e65[_0xf1e4('0xac')]['Contacts'][_0xf1e4('0x4c')]){return _0x483e65[_0xf1e4('0xac')][_0xf1e4('0x9d')][0x0];}else{return db[_0xf1e4('0x8b')]['create'](_[_0xf1e4('0x15')](_0x331d4d[_0xf1e4('0x60')],{'firstName':_0x331d4d[_0xf1e4('0x60')]['to'],'email':_0x331d4d[_0xf1e4('0x60')]['to'],'phone':_0x331d4d[_0xf1e4('0x60')]['to'],'ListId':_0x483e65['ListId']}));}}else{throw new Error(_0xf1e4('0xab'));}}})['then'](function(_0xaf4131){if(_0xaf4131){var _0x245ffc={'UserId':_0x331d4d[_0xf1e4('0x74')]['id'],'ContactId':_0xaf4131['id'],'MailAccountId':_0x483e65['id'],'inReplyTo':_0x29eea5['messageId'],'to':_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xa0')],'cc':_0x331d4d[_0xf1e4('0x60')]['cc'],'subject':_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0xad')],'attach':_0x331d4d[_0xf1e4('0x60')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x331d4d[_0xf1e4('0x60')][_0xf1e4('0x60')],'Messages':[_[_0xf1e4('0x54')](_0x331d4d[_0xf1e4('0x60')],{'messageId':_0x29eea5['messageId'],'sentAt':moment()[_0xf1e4('0xa1')](_0xf1e4('0x9b')),'read':!![],'MailAccountId':_0x483e65['id'],'UserId':_0x331d4d[_0xf1e4('0x74')]['id'],'ContactId':_0xaf4131['id']})]};if(_0x331d4d[_0xf1e4('0x60')]['Interaction']){_0x245ffc=_[_0xf1e4('0x54')](_0x245ffc,_0x331d4d['body'][_0xf1e4('0xae')]);}return db[_0xf1e4('0x89')][_0xf1e4('0x67')](_0x245ffc,{'include':[{'model':db['MailMessage'],'as':_0xf1e4('0xaf')}]});}})[_0xf1e4('0x21')](respondWithResult(_0x1edebb,null))['catch'](handleError(_0x1edebb,null));};exports[_0xf1e4('0xb0')]=function(_0x57c721,_0x45b5ac,_0x1c6df7){return db['MailAccount']['find']({'where':{'id':_0x57c721[_0xf1e4('0x5d')]['id']},'include':[{'model':db[_0xf1e4('0x5e')],'as':_0xf1e4('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x45b5ac,null))['then'](function(_0x12210a){if(_0x12210a&&_0x12210a['Smtp']){var _0x5d924e={'id':_0x12210a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x12210a[_0xf1e4('0x3f')][_0xf1e4('0xa7')]){_0x5d924e['service']=_0x12210a[_0xf1e4('0x3f')]['service'];}else{_0x5d924e[_0xf1e4('0x7a')]=_0x12210a[_0xf1e4('0x3f')][_0xf1e4('0x7a')];_0x5d924e[_0xf1e4('0x7b')]=_0x12210a[_0xf1e4('0x3f')][_0xf1e4('0x7b')];_0x5d924e['secure']=_0x12210a[_0xf1e4('0x3f')][_0xf1e4('0xa9')];}if(_0x12210a['Smtp'][_0xf1e4('0x79')]){_0x5d924e['auth']={'user':_0x12210a[_0xf1e4('0x3f')][_0xf1e4('0x74')],'pass':_0x12210a[_0xf1e4('0x3f')]['pass']};}return respondWithRpcPromise(_0xf1e4('0xb1'),_0xf1e4('0xb0'),{'account':_0x5d924e});}})['then'](respondWithResult(_0x45b5ac,null))[_0xf1e4('0x2b')](handleError(_0x45b5ac,null));};exports[_0xf1e4('0x39')]=function(_0x25e7c8,_0x273831){return db[_0xf1e4('0x57')][_0xf1e4('0x61')]({'where':{'id':_0x25e7c8[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x273831,null))[_0xf1e4('0x21')](function(_0x498ef4){if(_0x498ef4&&_0x498ef4[_0xf1e4('0xa7')]){throw new db['Sequelize']['ValidationError'](_0xf1e4('0xb2'));}return _0x498ef4;})[_0xf1e4('0x21')](removeEntity(_0x273831,null))['catch'](handleError(_0x273831,null));};exports[_0xf1e4('0xb3')]=function(_0x3188f0,_0x37e7c6,_0x3f7dae){return db['MailAccount'][_0xf1e4('0x61')]({'where':{'id':_0x3188f0['params']['id']}})['then'](handleEntityNotFound(_0x37e7c6,null))[_0xf1e4('0x21')](function(_0x33baed){if(_0x33baed){return _0x33baed[_0xf1e4('0xb3')](_0x3188f0['body'][_0xf1e4('0x6b')],_[_0xf1e4('0x8a')](_0x3188f0['body'],[_0xf1e4('0x6b'),'id'])||{})[_0xf1e4('0xb4')](function(_0xe123c5){for(var _0x331d49=0x0;_0x331d49<_0x3188f0[_0xf1e4('0x60')][_0xf1e4('0x6b')][_0xf1e4('0x4c')];_0x331d49+=0x1){socket[_0xf1e4('0xb5')]('userMailAccount:save',{'UserId':_0x3188f0[_0xf1e4('0x60')][_0xf1e4('0x6b')][_0x331d49],'MailAccountId':_0x3188f0[_0xf1e4('0x5d')]['id']});}return _0xe123c5;});}})[_0xf1e4('0x21')](respondWithResult(_0x37e7c6,null))['catch'](handleError(_0x37e7c6,null));};exports[_0xf1e4('0xb6')]=function(_0xdfb120,_0x159354,_0x14b03b){return db[_0xf1e4('0x57')]['find']({'where':{'id':_0xdfb120[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x159354,null))[_0xf1e4('0x21')](function(_0x4973ee){if(_0x4973ee){return _0x4973ee[_0xf1e4('0xb6')](_0xdfb120['query'][_0xf1e4('0x6b')])[_0xf1e4('0x21')](function(){if(_[_0xf1e4('0xb7')](_0xdfb120[_0xf1e4('0x46')][_0xf1e4('0x6b')])){for(var _0x49b396=0x0;_0x49b396<_0xdfb120[_0xf1e4('0x46')][_0xf1e4('0x6b')]['length'];_0x49b396+=0x1){socket[_0xf1e4('0xb5')](_0xf1e4('0xb8'),{'UserId':Number(_0xdfb120[_0xf1e4('0x46')][_0xf1e4('0x6b')][_0x49b396]),'MailAccountId':Number(_0xdfb120[_0xf1e4('0x5d')]['id'])});}}else{socket[_0xf1e4('0xb5')]('userMailAccount:remove',{'UserId':Number(_0xdfb120[_0xf1e4('0x46')][_0xf1e4('0x6b')]),'MailAccountId':Number(_0xdfb120[_0xf1e4('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x159354,null))[_0xf1e4('0x2b')](handleError(_0x159354,null));};exports[_0xf1e4('0xb9')]=function(_0x247322,_0x5534eb,_0x28f10a){var _0x1d4b22={};var _0x260298={};var _0x16b019;var _0x3dea8b;return db[_0xf1e4('0x57')]['findOne']({'where':{'id':_0x247322[_0xf1e4('0x5d')]['id']}})[_0xf1e4('0x21')](handleEntityNotFound(_0x5534eb,null))[_0xf1e4('0x21')](function(_0x18f610){if(_0x18f610){_0x16b019=_0x18f610;_0x260298[_0xf1e4('0x45')]=_[_0xf1e4('0x47')](db[_0xf1e4('0x8d')][_0xf1e4('0x5f')]);_0x260298['query']=_[_0xf1e4('0x47')](_0x247322[_0xf1e4('0x46')]);_0x260298[_0xf1e4('0x48')]=_[_0xf1e4('0x49')](_0x260298[_0xf1e4('0x45')],_0x260298[_0xf1e4('0x46')]);_0x1d4b22['attributes']=_['intersection'](_0x260298[_0xf1e4('0x45')],qs[_0xf1e4('0x4b')](_0x247322['query'][_0xf1e4('0x4b')]));_0x1d4b22[_0xf1e4('0x4a')]=_0x1d4b22['attributes'][_0xf1e4('0x4c')]?_0x1d4b22[_0xf1e4('0x4a')]:_0x260298[_0xf1e4('0x45')];_0x1d4b22[_0xf1e4('0x4f')]=qs[_0xf1e4('0x50')](_0x247322[_0xf1e4('0x46')][_0xf1e4('0x50')]);_0x1d4b22[_0xf1e4('0x53')]=qs[_0xf1e4('0x48')](_[_0xf1e4('0x51')](_0x247322['query'],_0x260298[_0xf1e4('0x48')]));if(_0x247322[_0xf1e4('0x46')][_0xf1e4('0x52')]){_0x1d4b22['where']=_[_0xf1e4('0x54')](_0x1d4b22['where'],{'$or':_[_0xf1e4('0x41')](_0x1d4b22[_0xf1e4('0x4a')],function(_0x8ef00c){var _0x194d90={};_0x194d90[_0x8ef00c]={'$like':'%'+_0x247322[_0xf1e4('0x46')][_0xf1e4('0x52')]+'%'};return _0x194d90;})});}_0x1d4b22=_[_0xf1e4('0x54')]({},_0x1d4b22,_0x247322[_0xf1e4('0x56')]);return _0x16b019[_0xf1e4('0xb9')](_0x1d4b22);}})['then'](function(_0x976775){if(_0x976775){_0x3dea8b=_0x976775['length'];if(!_0x247322[_0xf1e4('0x46')][_0xf1e4('0x4d')](_0xf1e4('0x4e'))){_0x1d4b22[_0xf1e4('0x32')]=qs[_0xf1e4('0x32')](_0x247322[_0xf1e4('0x46')][_0xf1e4('0x32')]);_0x1d4b22[_0xf1e4('0x31')]=qs[_0xf1e4('0x31')](_0x247322[_0xf1e4('0x46')]['offset']);}return _0x16b019[_0xf1e4('0xb9')](_0x1d4b22);}})[_0xf1e4('0x21')](function(_0x28d873){if(_0x28d873){return _0x28d873?{'count':_0x3dea8b,'rows':_0x28d873}:null;}})[_0xf1e4('0x21')](respondWithResult(_0x5534eb,null))[_0xf1e4('0x2b')](handleError(_0x5534eb,null));}; \ No newline at end of file +var _0x97d3=['params','find','body','Pause','describe','addDisposition','Disposition','create','findOne','rawAttributes','hasOwnProperty','nolimit','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','isNil','active','description','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','cservice','role','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','fullname','internal','Tag','color','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3d2efb,_0x2da24c){var _0x2f3462=function(_0x5d1f8b){while(--_0x5d1f8b){_0x3d2efb['push'](_0x3d2efb['shift']());}};_0x2f3462(++_0x2da24c);}(_0x97d3,0x1dd));var _0x397d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x97d3[_0x4b2436];return _0x4f5ab2;};'use strict';var pdf=require(_0x397d('0x0'));var emlformat=require(_0x397d('0x1'));var rimraf=require(_0x397d('0x2'));var zipdir=require(_0x397d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x397d('0x4'));var moment=require(_0x397d('0x5'));var BPromise=require(_0x397d('0x6'));var Mustache=require(_0x397d('0x7'));var util=require(_0x397d('0x8'));var path=require(_0x397d('0x9'));var sox=require(_0x397d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x397d('0xb'));var squel=require('squel');var crypto=require(_0x397d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x397d('0xd'));var toCsv=require(_0x397d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x397d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x397d('0x10'));var as=require(_0x397d('0x11'));var hardwareService=require(_0x397d('0x12'));var logger=require(_0x397d('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x397d('0x14'))['db'];config['redis']=_['defaults'](config[_0x397d('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x397d('0x16'))(new Redis(config[_0x397d('0x15')]));require(_0x397d('0x17'))[_0x397d('0x18')](socket);var jayson=require(_0x397d('0x19'));var client=jayson[_0x397d('0x1a')][_0x397d('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x2d5bf9,_0x3a8140,_0x33d9b5){if(_0x33d9b5){var _0x31695a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31695a[_0x397d('0x1c')](_0x3a8140)){return _0x2d5bf9;}else{throw new db['Sequelize']['ValidationError'](_0x397d('0x1d'));}}else{return _0x2d5bf9;}}function respondWithRpcPromise(_0x12f684,_0x1672bb,_0x77b83c,_0x5669fb){return new BPromise(function(_0xed3ae7,_0x582367){var _0x2bb10c=_0x5669fb||client;return _0x2bb10c['request'](_0x12f684,_0x77b83c)['then'](function(_0x5c58e0){logger[_0x397d('0x1e')]('MailAccount,\x20%s,\x20%s',_0x1672bb,_0x397d('0x1f'));logger[_0x397d('0x20')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1672bb,_0x397d('0x1f'),JSON[_0x397d('0x21')](_0x5c58e0));if(_0x5c58e0['error']){if(_0x5c58e0[_0x397d('0x22')]['code']===0x1f4){logger[_0x397d('0x22')](_0x397d('0x23'),_0x1672bb,_0x5c58e0[_0x397d('0x22')][_0x397d('0x24')]);return _0x582367(_0x5c58e0[_0x397d('0x22')][_0x397d('0x24')]);}logger[_0x397d('0x22')](_0x397d('0x23'),_0x1672bb,_0x5c58e0[_0x397d('0x22')][_0x397d('0x24')]);return _0xed3ae7(_0x5c58e0['error'][_0x397d('0x24')]);}else{logger[_0x397d('0x1e')]('MailAccount,\x20%s,\x20%s',_0x1672bb,'request\x20sent');_0xed3ae7(_0x5c58e0[_0x397d('0x25')][_0x397d('0x24')]);}})['catch'](function(_0x556a1d){logger[_0x397d('0x22')](_0x397d('0x23'),_0x1672bb,_0x556a1d);_0x582367(_0x556a1d);});});}function respondWithStatusCode(_0x23917a,_0xffc1d6){_0xffc1d6=_0xffc1d6||0xcc;return function(_0x57e6b0){if(_0x57e6b0){return _0x23917a[_0x397d('0x26')](_0xffc1d6);}return _0x23917a[_0x397d('0x27')](_0xffc1d6)[_0x397d('0x28')]();};}function respondWithResult(_0x302ac3,_0x3878df){_0x3878df=_0x3878df||0xc8;return function(_0x39caeb){if(_0x39caeb){return _0x302ac3[_0x397d('0x27')](_0x3878df)[_0x397d('0x29')](_0x39caeb);}};}function respondWithFilteredResult(_0x41ff76,_0xe14d63){return function(_0x50c9fa){if(_0x50c9fa){var _0x4ab0b3=_0x50c9fa[_0x397d('0x2a')],_0x23b902=_0xe14d63[_0x397d('0x2b')],_0x16f33c=_0xe14d63[_0x397d('0x2b')]+_0xe14d63[_0x397d('0x2c')],_0x155f14;if(_0x16f33c>=_0x4ab0b3){_0x16f33c=_0x4ab0b3;_0x155f14=0xc8;}else{_0x155f14=0xce;}_0x41ff76[_0x397d('0x27')](_0x155f14);return _0x41ff76[_0x397d('0x2d')](_0x397d('0x2e'),_0x23b902+'-'+_0x16f33c+'/'+_0x4ab0b3)[_0x397d('0x29')](_0x50c9fa);}return null;};}function patchUpdates(_0xa4ec2){return function(_0x33e349){try{jsonpatch[_0x397d('0x2f')](_0x33e349,_0xa4ec2,!![]);}catch(_0x58bcb5){return BPromise[_0x397d('0x30')](_0x58bcb5);}return _0x33e349[_0x397d('0x31')]();};}function saveUpdates(_0x4f09a0,_0x14091c){return function(_0x5e8a97){if(_0x5e8a97){return _0x5e8a97[_0x397d('0x32')](_0x4f09a0)[_0x397d('0x33')](function(_0x536623){return _0x536623;});}return null;};}function removeEntity(_0x40397f,_0x14a775){return function(_0x1e6e9c){if(_0x1e6e9c){return _0x1e6e9c['destroy']()[_0x397d('0x33')](function(){var _0xa3729e=_0x1e6e9c[_0x397d('0x34')]({'plain':!![]});var _0x2815cc='MailAccounts';return db['UserProfileResource'][_0x397d('0x35')]({'where':{'type':_0x2815cc,'resourceId':_0xa3729e['id']}})[_0x397d('0x33')](function(){return _0x1e6e9c;});})['then'](function(){_0x40397f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaeb3a8,_0xab6673){return function(_0x20162a){if(!_0x20162a){_0xaeb3a8[_0x397d('0x26')](0x194);}return _0x20162a;};}function handleError(_0x132941,_0x1cf963){_0x1cf963=_0x1cf963||0x1f4;return function(_0x24d981){logger[_0x397d('0x22')](_0x24d981[_0x397d('0x36')]);if(_0x24d981[_0x397d('0x37')]){delete _0x24d981[_0x397d('0x37')];}_0x132941[_0x397d('0x27')](_0x1cf963)[_0x397d('0x38')](_0x24d981);};}exports[_0x397d('0x39')]=function(_0x261bc5,_0x189b92){var _0x52c1d8={'include':[{'model':db[_0x397d('0x3a')],'as':_0x397d('0x3b')},{'model':db[_0x397d('0x3c')],'as':_0x397d('0x3d')},{'model':db['Pause'],'as':_0x397d('0x3e')}]},_0x5b51fe={},_0x38a350={'count':0x0,'rows':[]};var _0x1cbbc5=_[_0x397d('0x3f')](db[_0x397d('0x40')]['rawAttributes'],function(_0x7b5085){return{'name':_0x7b5085[_0x397d('0x41')],'type':_0x7b5085[_0x397d('0x42')][_0x397d('0x43')]};});_0x5b51fe[_0x397d('0x44')]=_['map'](_0x1cbbc5,'name');_0x5b51fe[_0x397d('0x45')]=_[_0x397d('0x46')](_0x261bc5[_0x397d('0x45')]);_0x5b51fe['filters']=_[_0x397d('0x47')](_0x5b51fe['model'],_0x5b51fe['query']);_0x52c1d8['attributes']=_[_0x397d('0x47')](_0x5b51fe[_0x397d('0x44')],qs[_0x397d('0x48')](_0x261bc5[_0x397d('0x45')][_0x397d('0x48')]));_0x52c1d8[_0x397d('0x49')]=_0x52c1d8['attributes'][_0x397d('0x4a')]?_0x52c1d8['attributes']:_0x5b51fe[_0x397d('0x44')];if(!_0x261bc5[_0x397d('0x45')]['hasOwnProperty']('nolimit')){_0x52c1d8[_0x397d('0x2c')]=qs[_0x397d('0x2c')](_0x261bc5[_0x397d('0x45')][_0x397d('0x2c')]);_0x52c1d8[_0x397d('0x2b')]=qs[_0x397d('0x2b')](_0x261bc5['query'][_0x397d('0x2b')]);}_0x52c1d8[_0x397d('0x4b')]=qs[_0x397d('0x4c')](_0x261bc5[_0x397d('0x45')]['sort']);_0x52c1d8[_0x397d('0x4d')]=qs[_0x397d('0x4e')](_[_0x397d('0x4f')](_0x261bc5[_0x397d('0x45')],_0x5b51fe[_0x397d('0x4e')]),_0x1cbbc5);if(_0x261bc5[_0x397d('0x45')][_0x397d('0x50')]){_0x52c1d8[_0x397d('0x4d')]=_['merge'](_0x52c1d8[_0x397d('0x4d')],{'$or':_['map'](_0x1cbbc5,function(_0x4e59d3){if(_0x4e59d3[_0x397d('0x42')]!==_0x397d('0x51')){var _0x22e3e2={};_0x22e3e2[_0x4e59d3['name']]={'$like':'%'+_0x261bc5[_0x397d('0x45')]['filter']+'%'};return _0x22e3e2;}})});}_0x52c1d8=_[_0x397d('0x52')]({},_0x52c1d8,_0x261bc5[_0x397d('0x53')]);var _0x14337f={'where':_0x52c1d8[_0x397d('0x4d')]};return db[_0x397d('0x40')][_0x397d('0x2a')](_0x14337f)[_0x397d('0x33')](function(_0x37294c){_0x38a350[_0x397d('0x2a')]=_0x37294c;if(_0x261bc5[_0x397d('0x45')][_0x397d('0x54')]){_0x52c1d8[_0x397d('0x55')]=[{'all':!![]}];}return db[_0x397d('0x40')][_0x397d('0x56')](_0x52c1d8);})['then'](function(_0x3596d8){_0x38a350[_0x397d('0x57')]=_0x3596d8;return _0x38a350;})[_0x397d('0x33')](respondWithFilteredResult(_0x189b92,_0x52c1d8))[_0x397d('0x58')](handleError(_0x189b92,null));};exports[_0x397d('0x59')]=function(_0x7d7c7c,_0x33b9ed){var _0x358723={'raw':![],'where':{'id':_0x7d7c7c[_0x397d('0x5a')]['id']},'include':[{'model':db[_0x397d('0x3a')],'as':_0x397d('0x3b')},{'model':db[_0x397d('0x3c')],'as':_0x397d('0x3d')},{'model':db['Pause'],'as':_0x397d('0x3e')}]},_0x535b65={};_0x535b65['model']=_[_0x397d('0x46')](db[_0x397d('0x40')]['rawAttributes']);_0x535b65['query']=_[_0x397d('0x46')](_0x7d7c7c[_0x397d('0x45')]);_0x535b65[_0x397d('0x4e')]=_['intersection'](_0x535b65['model'],_0x535b65[_0x397d('0x45')]);_0x358723[_0x397d('0x49')]=_[_0x397d('0x47')](_0x535b65[_0x397d('0x44')],qs[_0x397d('0x48')](_0x7d7c7c[_0x397d('0x45')][_0x397d('0x48')]));_0x358723[_0x397d('0x49')]=_0x358723[_0x397d('0x49')]['length']?_0x358723[_0x397d('0x49')]:_0x535b65[_0x397d('0x44')];if(_0x7d7c7c[_0x397d('0x45')][_0x397d('0x54')]){_0x358723['include']=[{'all':!![]}];}_0x358723=_['merge']({},_0x358723,_0x7d7c7c[_0x397d('0x53')]);return db[_0x397d('0x40')][_0x397d('0x5b')](_0x358723)[_0x397d('0x33')](handleEntityNotFound(_0x33b9ed,null))[_0x397d('0x33')](respondWithResult(_0x33b9ed,null))[_0x397d('0x58')](handleError(_0x33b9ed,null));};exports[_0x397d('0x32')]=function(_0xa06fc6,_0x26f5a0){if(_0xa06fc6['body']['id']){delete _0xa06fc6[_0x397d('0x5c')]['id'];}return db['MailAccount'][_0x397d('0x5b')]({'where':{'id':_0xa06fc6['params']['id']},'include':[{'model':db[_0x397d('0x3a')],'as':_0x397d('0x3b')},{'model':db[_0x397d('0x3c')],'as':_0x397d('0x3d')},{'model':db[_0x397d('0x5d')],'as':_0x397d('0x3e')}]})[_0x397d('0x33')](handleEntityNotFound(_0x26f5a0,null))[_0x397d('0x33')](saveUpdates(_0xa06fc6[_0x397d('0x5c')],null))[_0x397d('0x33')](function(_0x217131){if(_0x217131&&_0xa06fc6['body'][_0x397d('0x3b')]){return db[_0x397d('0x3a')][_0x397d('0x32')](_0xa06fc6[_0x397d('0x5c')]['Imap'],{'where':{'MailAccountId':_0x217131['id']}})[_0x397d('0x33')](function(){return _0x217131;});}return _0x217131;})[_0x397d('0x33')](function(_0x1349b5){if(_0x1349b5&&_0xa06fc6[_0x397d('0x5c')][_0x397d('0x3d')]){return db[_0x397d('0x3c')][_0x397d('0x32')](_0xa06fc6['body']['Smtp'],{'where':{'MailAccountId':_0x1349b5['id']}})[_0x397d('0x33')](function(){return _0x1349b5;});}return _0x1349b5;})[_0x397d('0x33')](respondWithResult(_0x26f5a0,null))[_0x397d('0x58')](handleError(_0x26f5a0,null));};exports[_0x397d('0x5e')]=function(_0x51e116,_0x1361ff){return db[_0x397d('0x40')][_0x397d('0x5e')]()[_0x397d('0x33')](respondWithResult(_0x1361ff,null))[_0x397d('0x58')](handleError(_0x1361ff,null));};exports[_0x397d('0x5f')]=function(_0x10b485,_0x49e7ae,_0x180297){if(_0x10b485[_0x397d('0x5c')]['id']){delete _0x10b485[_0x397d('0x5c')]['id'];}return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x10b485[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x49e7ae,null))[_0x397d('0x33')](function(_0x3428b8){if(_0x3428b8){_0x10b485[_0x397d('0x5c')]['MailAccountId']=_0x3428b8['id'];return db[_0x397d('0x60')][_0x397d('0x61')](_0x10b485[_0x397d('0x5c')]);}})['then'](respondWithResult(_0x49e7ae,null))['catch'](handleError(_0x49e7ae,null));};exports['getDispositions']=function(_0xb4fcc5,_0x3da694,_0x18fe53){var _0x530eb7={'raw':![],'where':{}};var _0x236796={};var _0x3ccb6f={'count':0x0,'rows':[]};return db['MailAccount'][_0x397d('0x62')]({'where':{'id':_0xb4fcc5[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x3da694,null))[_0x397d('0x33')](function(_0x2a0cd2){if(_0x2a0cd2){_0x236796[_0x397d('0x44')]=_[_0x397d('0x46')](db['Disposition'][_0x397d('0x63')]);_0x236796['query']=_[_0x397d('0x46')](_0xb4fcc5[_0x397d('0x45')]);_0x236796[_0x397d('0x4e')]=_[_0x397d('0x47')](_0x236796[_0x397d('0x44')],_0x236796[_0x397d('0x45')]);_0x530eb7[_0x397d('0x49')]=_['intersection'](_0x236796[_0x397d('0x44')],qs[_0x397d('0x48')](_0xb4fcc5[_0x397d('0x45')][_0x397d('0x48')]));_0x530eb7['attributes']=_0x530eb7[_0x397d('0x49')][_0x397d('0x4a')]?_0x530eb7[_0x397d('0x49')]:_0x236796[_0x397d('0x44')];if(!_0xb4fcc5['query'][_0x397d('0x64')](_0x397d('0x65'))){_0x530eb7[_0x397d('0x2c')]=qs[_0x397d('0x2c')](_0xb4fcc5[_0x397d('0x45')]['limit']);_0x530eb7[_0x397d('0x2b')]=qs[_0x397d('0x2b')](_0xb4fcc5['query'][_0x397d('0x2b')]);}_0x530eb7['order']=qs[_0x397d('0x4c')](_0xb4fcc5[_0x397d('0x45')][_0x397d('0x4c')]);_0x530eb7[_0x397d('0x4d')]=qs[_0x397d('0x4e')](_[_0x397d('0x4f')](_0xb4fcc5[_0x397d('0x45')],_0x236796[_0x397d('0x4e')]));_0x530eb7[_0x397d('0x4d')][_0x397d('0x66')]=_0x2a0cd2['id'];if(_0xb4fcc5['query'][_0x397d('0x50')]){_0x530eb7[_0x397d('0x4d')]=_[_0x397d('0x52')](_0x530eb7[_0x397d('0x4d')],{'$or':_[_0x397d('0x3f')](_0x530eb7[_0x397d('0x49')],function(_0x367b50){var _0x5e9e12={};_0x5e9e12[_0x367b50]={'$like':'%'+_0xb4fcc5[_0x397d('0x45')][_0x397d('0x50')]+'%'};return _0x5e9e12;})});}_0x530eb7=_['merge']({},_0x530eb7,_0xb4fcc5['options']);return db[_0x397d('0x60')][_0x397d('0x2a')]({'where':_0x530eb7[_0x397d('0x4d')]})['then'](function(_0x50fd9a){_0x3ccb6f[_0x397d('0x2a')]=_0x50fd9a;if(_0xb4fcc5['query'][_0x397d('0x54')]){_0x530eb7[_0x397d('0x55')]=[{'all':!![]}];}return db[_0x397d('0x60')][_0x397d('0x56')](_0x530eb7);})['then'](function(_0x5df40a){_0x3ccb6f[_0x397d('0x57')]=_0x5df40a;return _0x3ccb6f;});}})[_0x397d('0x33')](respondWithFilteredResult(_0x3da694,_0x530eb7))['catch'](handleError(_0x3da694,null));};exports['removeDispositions']=function(_0x3bbd07,_0x41144c,_0x476038){return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x3bbd07[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x41144c,null))[_0x397d('0x33')](function(_0x4ffe1e){if(_0x4ffe1e){return _0x4ffe1e[_0x397d('0x67')](_0x3bbd07[_0x397d('0x45')][_0x397d('0x68')]);}})[_0x397d('0x33')](respondWithStatusCode(_0x41144c,null))['catch'](handleError(_0x41144c,null));};exports[_0x397d('0x69')]=function(_0x1d9290,_0x5234ec,_0x432aad){if(_0x1d9290['body']['id']){delete _0x1d9290[_0x397d('0x5c')]['id'];}return db[_0x397d('0x40')]['find']({'where':{'id':_0x1d9290[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x5234ec,null))[_0x397d('0x33')](function(_0x3673bf){if(_0x3673bf){_0x1d9290[_0x397d('0x5c')][_0x397d('0x66')]=_0x3673bf['id'];return db[_0x397d('0x6a')][_0x397d('0x61')](_0x1d9290[_0x397d('0x5c')]);}})[_0x397d('0x33')](respondWithResult(_0x5234ec,null))[_0x397d('0x58')](handleError(_0x5234ec,null));};exports[_0x397d('0x6b')]=function(_0xeb6a68,_0x3823b8,_0x4a6de4){var _0x552110={'raw':![],'where':{}};var _0x56d2dd={};var _0x5ad851={'count':0x0,'rows':[]};return db['MailAccount'][_0x397d('0x62')]({'where':{'id':_0xeb6a68['params']['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x3823b8,null))[_0x397d('0x33')](function(_0x80981d){if(_0x80981d){_0x56d2dd['model']=_[_0x397d('0x46')](db[_0x397d('0x6a')][_0x397d('0x63')]);_0x56d2dd['query']=_[_0x397d('0x46')](_0xeb6a68[_0x397d('0x45')]);_0x56d2dd['filters']=_[_0x397d('0x47')](_0x56d2dd[_0x397d('0x44')],_0x56d2dd[_0x397d('0x45')]);_0x552110[_0x397d('0x49')]=_['intersection'](_0x56d2dd['model'],qs['fields'](_0xeb6a68['query'][_0x397d('0x48')]));_0x552110[_0x397d('0x49')]=_0x552110[_0x397d('0x49')][_0x397d('0x4a')]?_0x552110[_0x397d('0x49')]:_0x56d2dd['model'];if(!_0xeb6a68['query'][_0x397d('0x64')]('nolimit')){_0x552110[_0x397d('0x2c')]=qs['limit'](_0xeb6a68[_0x397d('0x45')]['limit']);_0x552110[_0x397d('0x2b')]=qs[_0x397d('0x2b')](_0xeb6a68[_0x397d('0x45')][_0x397d('0x2b')]);}_0x552110[_0x397d('0x4b')]=qs[_0x397d('0x4c')](_0xeb6a68[_0x397d('0x45')][_0x397d('0x4c')]);_0x552110[_0x397d('0x4d')]=qs['filters'](_[_0x397d('0x4f')](_0xeb6a68[_0x397d('0x45')],_0x56d2dd[_0x397d('0x4e')]));_0x552110[_0x397d('0x4d')]['MailAccountId']=_0x80981d['id'];if(_0xeb6a68[_0x397d('0x45')]['filter']){_0x552110[_0x397d('0x4d')]=_[_0x397d('0x52')](_0x552110[_0x397d('0x4d')],{'$or':_[_0x397d('0x3f')](_0x552110[_0x397d('0x49')],function(_0x5ce6db){var _0x747816={};_0x747816[_0x5ce6db]={'$like':'%'+_0xeb6a68['query']['filter']+'%'};return _0x747816;})});}_0x552110=_[_0x397d('0x52')]({},_0x552110,_0xeb6a68[_0x397d('0x53')]);return db[_0x397d('0x6a')][_0x397d('0x2a')]({'where':_0x552110[_0x397d('0x4d')]})['then'](function(_0x19554c){_0x5ad851['count']=_0x19554c;if(_0xeb6a68['query'][_0x397d('0x54')]){_0x552110[_0x397d('0x55')]=[{'all':!![]}];}return db[_0x397d('0x6a')][_0x397d('0x56')](_0x552110);})[_0x397d('0x33')](function(_0xbbae3){_0x5ad851['rows']=_0xbbae3;return _0x5ad851;});}})[_0x397d('0x33')](respondWithFilteredResult(_0x3823b8,_0x552110))[_0x397d('0x58')](handleError(_0x3823b8,null));};exports[_0x397d('0x6c')]=function(_0x4e296a,_0x2a4a1c,_0x588336){return db[_0x397d('0x40')]['find']({'where':{'id':_0x4e296a[_0x397d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2a4a1c,null))[_0x397d('0x33')](function(_0x551b6e){if(_0x551b6e){return _0x551b6e[_0x397d('0x6c')](_0x4e296a[_0x397d('0x45')]['ids']);}})[_0x397d('0x33')](respondWithStatusCode(_0x2a4a1c,null))[_0x397d('0x58')](handleError(_0x2a4a1c,null));};exports[_0x397d('0x61')]=function(_0x264cb8,_0x8e29f5){var _0x592f98={'name':_0x264cb8[_0x397d('0x5c')][_0x397d('0x37')],'key':_0x264cb8['body'][_0x397d('0x43')],'email':_0x264cb8['body']['email'],'ListId':_0x264cb8['body'][_0x397d('0x6d')],'active':!_[_0x397d('0x6e')](_0x264cb8['body'][_0x397d('0x6f')])?_0x264cb8['body'][_0x397d('0x6f')]:!![],'description':_0x264cb8[_0x397d('0x5c')][_0x397d('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x397d('0x6e')](_0x264cb8[_0x397d('0x5c')]['cservice'])){if(_0x264cb8[_0x397d('0x5c')][_0x397d('0x71')]){_0x592f98[_0x397d('0x3b')][_0x397d('0x72')]=_0x592f98[_0x397d('0x3d')][_0x397d('0x72')]=_0x264cb8[_0x397d('0x5c')][_0x397d('0x73')];_0x592f98[_0x397d('0x3b')]['password']=_0x592f98[_0x397d('0x3d')][_0x397d('0x74')]=_0x264cb8[_0x397d('0x5c')][_0x397d('0x75')];}else{_0x592f98[_0x397d('0x3b')][_0x397d('0x76')]=_0x592f98[_0x397d('0x3d')][_0x397d('0x76')]=![];}_0x592f98[_0x397d('0x3b')][_0x397d('0x77')]=_0x264cb8[_0x397d('0x5c')][_0x397d('0x3b')][_0x397d('0x77')];_0x592f98[_0x397d('0x3b')][_0x397d('0x78')]=_0x264cb8[_0x397d('0x5c')][_0x397d('0x3b')]['port'];_0x592f98[_0x397d('0x3d')]['host']=_0x264cb8[_0x397d('0x5c')]['Smtp'][_0x397d('0x77')];_0x592f98[_0x397d('0x3d')]['port']=_0x264cb8[_0x397d('0x5c')][_0x397d('0x3d')][_0x397d('0x78')];}else{_0x592f98['Imap'][_0x397d('0x79')]=_0x592f98['Smtp']['service']=_0x264cb8['body'][_0x397d('0x7a')];_0x592f98[_0x397d('0x3b')][_0x397d('0x72')]=_0x592f98[_0x397d('0x3d')][_0x397d('0x72')]=_0x264cb8[_0x397d('0x5c')][_0x397d('0x73')];_0x592f98['Imap']['password']=_0x592f98[_0x397d('0x3d')]['pass']=_0x264cb8['body'][_0x397d('0x75')];}return db[_0x397d('0x40')][_0x397d('0x61')](_0x592f98,{'include':[{'model':db[_0x397d('0x3c')],'as':_0x397d('0x3d')},{'model':db['MailServerIn'],'as':_0x397d('0x3b')}]})['then'](function(_0xc1196e){var _0x56fcf5=_0x264cb8[_0x397d('0x72')][_0x397d('0x34')]({'plain':!![]});if(!_0x56fcf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56fcf5[_0x397d('0x7b')]===_0x397d('0x72')){var _0x4fd466=_0xc1196e['get']({'plain':!![]});return db[_0x397d('0x7c')]['find']({'where':{'name':_0x397d('0x7d'),'userProfileId':_0x56fcf5['userProfileId']},'raw':!![]})[_0x397d('0x33')](function(_0x56ffd0){if(_0x56ffd0&&_0x56ffd0[_0x397d('0x7e')]===0x0){return db['UserProfileResource'][_0x397d('0x61')]({'name':_0x4fd466[_0x397d('0x37')],'resourceId':_0x4fd466['id'],'type':_0x56ffd0[_0x397d('0x37')],'sectionId':_0x56ffd0['id']},{})['then'](function(){return _0xc1196e;});}else{return _0xc1196e;}})[_0x397d('0x58')](function(_0xc07dd5){logger[_0x397d('0x22')](_0x397d('0x7f'),_0xc07dd5);throw _0xc07dd5;});}return _0xc1196e;})['then'](respondWithResult(_0x8e29f5,0xc9))['catch'](handleError(_0x8e29f5,null));};exports[_0x397d('0x80')]=function(_0x2aff4d,_0x2aa5a7,_0x216e5d){return db['MailAccount'][_0x397d('0x62')]({'where':{'id':_0x2aff4d[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x2aa5a7,null))['then'](function(_0x1650bb){if(_0x1650bb){return _0x1650bb[_0x397d('0x80')]();}return null;})[_0x397d('0x33')](respondWithResult(_0x2aa5a7,null))[_0x397d('0x58')](handleError(_0x2aa5a7,null));};exports['addImap']=function(_0x5cb322,_0x50a3ee,_0xbf5168){if(_0x5cb322[_0x397d('0x5c')]['id']){delete _0x5cb322['body']['id'];}return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x5cb322[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x50a3ee,null))[_0x397d('0x33')](function(_0x5da399){if(_0x5da399){_0x5cb322['body'][_0x397d('0x66')]=_0x5da399['id'];return db['MailServerIn']['create'](_0x5cb322[_0x397d('0x5c')]);}})[_0x397d('0x33')](respondWithResult(_0x50a3ee,null))[_0x397d('0x58')](handleError(_0x50a3ee,null));};exports[_0x397d('0x81')]=function(_0x4add1b,_0x169ec6,_0x2d7685){return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x4add1b[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x169ec6,null))[_0x397d('0x33')](function(_0x1e8a84){if(_0x1e8a84){return _0x1e8a84[_0x397d('0x82')](null);}return null;})[_0x397d('0x33')](respondWithStatusCode(_0x169ec6,null))[_0x397d('0x58')](handleError(_0x169ec6,null));};exports['getSmtp']=function(_0x522658,_0x2afd5a,_0x258d72){return db[_0x397d('0x40')]['findOne']({'where':{'id':_0x522658[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x2afd5a,null))[_0x397d('0x33')](function(_0x2eaa8b){if(_0x2eaa8b){return _0x2eaa8b[_0x397d('0x83')]();}return null;})[_0x397d('0x33')](respondWithResult(_0x2afd5a,null))['catch'](handleError(_0x2afd5a,null));};exports['addSmtp']=function(_0xc6e5a9,_0x16b82e,_0x21676d){if(_0xc6e5a9[_0x397d('0x5c')]['id']){delete _0xc6e5a9['body']['id'];}return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0xc6e5a9[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x16b82e,null))['then'](function(_0x1511d7){if(_0x1511d7){_0xc6e5a9[_0x397d('0x5c')][_0x397d('0x66')]=_0x1511d7['id'];return db[_0x397d('0x3c')][_0x397d('0x61')](_0xc6e5a9[_0x397d('0x5c')]);}})[_0x397d('0x33')](respondWithResult(_0x16b82e,null))[_0x397d('0x58')](handleError(_0x16b82e,null));};exports['removeSmtp']=function(_0x3379a8,_0x464e30,_0x47396a){return db[_0x397d('0x40')]['findOne']({'where':{'id':_0x3379a8[_0x397d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x464e30,null))[_0x397d('0x33')](function(_0x17ffa2){if(_0x17ffa2){return _0x17ffa2[_0x397d('0x84')](null);}return null;})[_0x397d('0x33')](respondWithStatusCode(_0x464e30,null))[_0x397d('0x58')](handleError(_0x464e30,null));};exports[_0x397d('0x85')]=function(_0x3744b5,_0x2fbe54,_0x1136bb){return db[_0x397d('0x86')][_0x397d('0x5b')]({'where':{'id':_0x3744b5[_0x397d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2fbe54,null))[_0x397d('0x33')](function(_0x292dfb){if(_0x292dfb){return _0x292dfb[_0x397d('0x85')](_0x3744b5[_0x397d('0x5c')][_0x397d('0x68')],_[_0x397d('0x87')](_0x3744b5[_0x397d('0x5c')],[_0x397d('0x68'),'id'])||{});}})['then'](respondWithResult(_0x2fbe54,null))[_0x397d('0x58')](handleError(_0x2fbe54,null));};exports['getInteractions']=function(_0x4a4e7f,_0x46fbe1,_0x29a8c7){var _0x3dcef0={'raw':![],'where':{}};var _0x2c8ed7={};var _0x4fafa3={'count':0x0,'rows':[]};return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x4a4e7f['params']['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x46fbe1,null))['then'](function(_0x218a9b){if(_0x218a9b){_0x2c8ed7[_0x397d('0x44')]=_[_0x397d('0x46')](db['MailInteraction'][_0x397d('0x63')]);_0x2c8ed7[_0x397d('0x45')]=_['keys'](_0x4a4e7f[_0x397d('0x45')]);_0x2c8ed7[_0x397d('0x4e')]=_[_0x397d('0x47')](_0x2c8ed7[_0x397d('0x44')],_0x2c8ed7[_0x397d('0x45')]);_0x3dcef0[_0x397d('0x49')]=_[_0x397d('0x47')](_0x2c8ed7[_0x397d('0x44')],qs[_0x397d('0x48')](_0x4a4e7f[_0x397d('0x45')]['fields']));_0x3dcef0[_0x397d('0x49')]=_0x3dcef0['attributes'][_0x397d('0x4a')]?_0x3dcef0['attributes']:_0x2c8ed7[_0x397d('0x44')];if(!_0x4a4e7f['query'][_0x397d('0x64')](_0x397d('0x65'))){_0x3dcef0[_0x397d('0x2c')]=qs['limit'](_0x4a4e7f['query'][_0x397d('0x2c')]);_0x3dcef0['offset']=qs[_0x397d('0x2b')](_0x4a4e7f[_0x397d('0x45')][_0x397d('0x2b')]);}_0x3dcef0[_0x397d('0x4b')]=qs[_0x397d('0x4c')](_0x4a4e7f[_0x397d('0x45')][_0x397d('0x4c')]);_0x3dcef0[_0x397d('0x4d')]=qs['filters'](_['pick'](_0x4a4e7f[_0x397d('0x45')],_0x2c8ed7[_0x397d('0x4e')]));_0x3dcef0[_0x397d('0x4d')][_0x397d('0x66')]=_0x218a9b['id'];if(_0x4a4e7f[_0x397d('0x45')][_0x397d('0x50')]){_0x3dcef0['where']=_[_0x397d('0x52')](_0x3dcef0['where'],{'$or':_[_0x397d('0x3f')](_0x3dcef0['attributes'],function(_0x147c6c){var _0x23a823={};_0x23a823[_0x147c6c]={'$like':'%'+_0x4a4e7f[_0x397d('0x45')][_0x397d('0x50')]+'%'};return _0x23a823;})});}_0x3dcef0=_[_0x397d('0x52')]({},_0x3dcef0,_0x4a4e7f[_0x397d('0x53')]);return db[_0x397d('0x86')][_0x397d('0x2a')]({'where':_0x3dcef0[_0x397d('0x4d')]})[_0x397d('0x33')](function(_0x48975c){_0x4fafa3['count']=_0x48975c;if(_0x4a4e7f[_0x397d('0x45')][_0x397d('0x54')]){_0x3dcef0[_0x397d('0x55')]=[{'model':db['CmContact'],'as':_0x397d('0x88'),'required':![]},{'model':db[_0x397d('0x89')],'as':'Owner','attributes':[_0x397d('0x37'),_0x397d('0x8a'),_0x397d('0x8b')],'required':![]},{'model':db[_0x397d('0x8c')],'as':'Tags','attributes':['id',_0x397d('0x37'),_0x397d('0x8d')],'where':_0x4a4e7f[_0x397d('0x45')][_0x397d('0x8e')]?{'id':_0x4a4e7f['query'][_0x397d('0x8e')]}:undefined,'required':_0x4a4e7f[_0x397d('0x45')][_0x397d('0x8e')]?!![]:![]}];}return db['MailInteraction'][_0x397d('0x56')](_0x3dcef0);})[_0x397d('0x33')](function(_0x50e50b){_0x4fafa3[_0x397d('0x57')]=_0x50e50b;return _0x4fafa3;});}})['then'](respondWithFilteredResult(_0x46fbe1,_0x3dcef0))[_0x397d('0x58')](handleError(_0x46fbe1,null));};exports[_0x397d('0x8f')]=function(_0x3488a8,_0x224e7f,_0x3790ef){return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x3488a8['params']['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x224e7f,null))[_0x397d('0x33')](function(_0x1d46f8){if(_0x1d46f8){return db['sequelize'][_0x397d('0x90')](function(_0x555f21){return db[_0x397d('0x91')]['destroy']({'where':{'MailAccountId':_0x3488a8[_0x397d('0x5a')]['id']},'transaction':_0x555f21})[_0x397d('0x33')](function(_0x2094a6){var _0x5f3734=_['map'](_0x3488a8[_0x397d('0x5c')],function(_0x4c6ae1){_0x4c6ae1[_0x397d('0x66')]=_0x3488a8[_0x397d('0x5a')]['id'];return _0x4c6ae1;});return db[_0x397d('0x91')][_0x397d('0x92')](_0x5f3734,{'transaction':_0x555f21});});})[_0x397d('0x33')](function(){return db[_0x397d('0x91')][_0x397d('0x93')]({'where':{'MailAccountId':_0x3488a8[_0x397d('0x5a')]['id']},'order':_0x397d('0x94')});});}})[_0x397d('0x33')](respondWithResult(_0x224e7f,null))['catch'](handleError(_0x224e7f,null));};exports[_0x397d('0x95')]=function(_0x1356d4,_0x2f3db2,_0x27ba8b){var _0x2101a8={};var _0x524882={};var _0x5cfb51;var _0x46b5e4;return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x1356d4[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x2f3db2,null))[_0x397d('0x33')](function(_0x44c8e0){if(_0x44c8e0){_0x5cfb51=_0x44c8e0;_0x524882['model']=_[_0x397d('0x46')](db[_0x397d('0x91')][_0x397d('0x63')]);_0x524882[_0x397d('0x45')]=_[_0x397d('0x46')](_0x1356d4['query']);_0x524882[_0x397d('0x4e')]=_[_0x397d('0x47')](_0x524882['model'],_0x524882[_0x397d('0x45')]);_0x2101a8['attributes']=_[_0x397d('0x47')](_0x524882[_0x397d('0x44')],qs['fields'](_0x1356d4[_0x397d('0x45')][_0x397d('0x48')]));_0x2101a8['attributes']=_0x2101a8[_0x397d('0x49')][_0x397d('0x4a')]?_0x2101a8['attributes']:_0x524882['model'];_0x2101a8['order']=qs[_0x397d('0x4c')](_0x1356d4[_0x397d('0x45')][_0x397d('0x4c')]);_0x2101a8[_0x397d('0x4d')]=qs[_0x397d('0x4e')](_['pick'](_0x1356d4[_0x397d('0x45')],_0x524882[_0x397d('0x4e')]));if(_0x1356d4[_0x397d('0x45')][_0x397d('0x50')]){_0x2101a8[_0x397d('0x4d')]=_[_0x397d('0x52')](_0x2101a8[_0x397d('0x4d')],{'$or':_[_0x397d('0x3f')](_0x2101a8[_0x397d('0x49')],function(_0x57f376){var _0x300b9c={};_0x300b9c[_0x57f376]={'$like':'%'+_0x1356d4['query'][_0x397d('0x50')]+'%'};return _0x300b9c;})});}_0x2101a8=_[_0x397d('0x52')]({},_0x2101a8,_0x1356d4['options']);return _0x5cfb51[_0x397d('0x95')](_0x2101a8);}})['then'](function(_0x373131){if(_0x373131){_0x46b5e4=_0x373131[_0x397d('0x4a')];if(!_0x1356d4['query'][_0x397d('0x64')]('nolimit')){_0x2101a8[_0x397d('0x2c')]=qs['limit'](_0x1356d4[_0x397d('0x45')][_0x397d('0x2c')]);_0x2101a8['offset']=qs['offset'](_0x1356d4['query'][_0x397d('0x2b')]);}return _0x5cfb51[_0x397d('0x95')](_0x2101a8);}})[_0x397d('0x33')](function(_0x5a6f6e){if(_0x5a6f6e){return _0x5a6f6e?{'count':_0x46b5e4,'rows':_0x5a6f6e}:null;}})[_0x397d('0x33')](respondWithResult(_0x2f3db2,null))[_0x397d('0x58')](handleError(_0x2f3db2,null));};exports['getMessages']=function(_0x1870c0,_0x5475a9,_0x25b3dc){var _0x2a2b1c={'raw':!![],'where':{}};var _0x40d0e4={};var _0x27f1e4={'count':0x0,'rows':[]};return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x1870c0[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x5475a9,null))[_0x397d('0x33')](function(_0x2a0785){if(_0x2a0785){_0x40d0e4[_0x397d('0x44')]=_[_0x397d('0x46')](db[_0x397d('0x96')]['rawAttributes']);_0x40d0e4[_0x397d('0x45')]=_[_0x397d('0x46')](_0x1870c0[_0x397d('0x45')]);_0x40d0e4[_0x397d('0x4e')]=_[_0x397d('0x47')](_0x40d0e4[_0x397d('0x44')],_0x40d0e4[_0x397d('0x45')]);_0x2a2b1c[_0x397d('0x49')]=_[_0x397d('0x47')](_0x40d0e4[_0x397d('0x44')],qs[_0x397d('0x48')](_0x1870c0['query']['fields']));_0x2a2b1c['attributes']=_0x2a2b1c[_0x397d('0x49')][_0x397d('0x4a')]?_0x2a2b1c[_0x397d('0x49')]:_0x40d0e4[_0x397d('0x44')];if(!_0x1870c0[_0x397d('0x45')]['hasOwnProperty']('nolimit')){_0x2a2b1c[_0x397d('0x2c')]=qs[_0x397d('0x2c')](_0x1870c0[_0x397d('0x45')][_0x397d('0x2c')]);_0x2a2b1c['offset']=qs[_0x397d('0x2b')](_0x1870c0[_0x397d('0x45')][_0x397d('0x2b')]);}_0x2a2b1c[_0x397d('0x4b')]=qs[_0x397d('0x4c')](_0x1870c0[_0x397d('0x45')][_0x397d('0x4c')]);_0x2a2b1c[_0x397d('0x4d')]=qs['filters'](_[_0x397d('0x4f')](_0x1870c0[_0x397d('0x45')],_0x40d0e4[_0x397d('0x4e')]));_0x2a2b1c[_0x397d('0x4d')][_0x397d('0x66')]=_0x2a0785['id'];if(_0x1870c0[_0x397d('0x45')][_0x397d('0x50')]){_0x2a2b1c['where']=_['merge'](_0x2a2b1c[_0x397d('0x4d')],{'$or':_[_0x397d('0x3f')](_0x2a2b1c['attributes'],function(_0x1d9a8e){var _0x11d3be={};_0x11d3be[_0x1d9a8e]={'$like':'%'+_0x1870c0[_0x397d('0x45')][_0x397d('0x50')]+'%'};return _0x11d3be;})});}if(_0x1870c0[_0x397d('0x45')]['$gte']){var _0x1e3d79=_0x1870c0['query']['$gte'][_0x397d('0x97')](',');var _0x23c32e={};_0x23c32e[_0x1e3d79[0x0]]={'$gte':moment(_0x1e3d79[0x1])[_0x397d('0x98')](_0x397d('0x99'))};_0x2a2b1c[_0x397d('0x4d')]=_[_0x397d('0x52')](_0x2a2b1c[_0x397d('0x4d')],_0x23c32e);}_0x2a2b1c=_['merge']({},_0x2a2b1c,_0x1870c0[_0x397d('0x53')]);return db['MailMessage'][_0x397d('0x2a')]({'where':_0x2a2b1c['where']})[_0x397d('0x33')](function(_0x44d318){_0x27f1e4[_0x397d('0x2a')]=_0x44d318;if(_0x1870c0[_0x397d('0x45')]['includeAll']){_0x2a2b1c[_0x397d('0x55')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x2a2b1c);})[_0x397d('0x33')](function(_0x228f05){_0x27f1e4[_0x397d('0x57')]=_0x228f05;return _0x27f1e4;});}})['then'](respondWithFilteredResult(_0x5475a9,_0x2a2b1c))[_0x397d('0x58')](handleError(_0x5475a9,null));};exports[_0x397d('0x38')]=function(_0x58a1c6,_0x48aabd,_0x5549e9){var _0x329444,_0x2617ac={},_0x11c08c;if(_0x58a1c6[_0x397d('0x5c')]['to']){_0x11c08c=_0x58a1c6['body']['to']['split'](',')[0x0];}return db[_0x397d('0x40')]['find']({'where':{'id':_0x58a1c6[_0x397d('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x397d('0x9a'),'include':[{'model':db[_0x397d('0x9b')],'as':_0x397d('0x9c'),'where':{'email':_0x11c08c},'limit':0x1,'order':[[_0x397d('0x9d'),_0x397d('0x9e')]]}]},{'model':db[_0x397d('0x3c')],'as':_0x397d('0x3d'),'raw':!![]}]})[_0x397d('0x33')](handleEntityNotFound(_0x48aabd,null))[_0x397d('0x33')](function(_0x2a1756){if(_0x2a1756){_0x329444=_0x2a1756;if(_0x2a1756[_0x397d('0x3d')]){if(_[_0x397d('0x6e')](_0x58a1c6[_0x397d('0x5c')][_0x397d('0x9f')])){_0x58a1c6[_0x397d('0x5c')][_0x397d('0x9f')]=util[_0x397d('0x98')](_0x397d('0xa0'),_0x2a1756[_0x397d('0x37')],_0x2a1756[_0x397d('0xa1')]||_0x2a1756['Smtp']['user']);}if(_0x58a1c6[_0x397d('0x5c')][_0x397d('0xa2')]&&_0x58a1c6[_0x397d('0x5c')][_0x397d('0xa2')][_0x397d('0x4a')]){for(var _0x421ff3=0x0;_0x421ff3<_0x58a1c6['body'][_0x397d('0xa2')][_0x397d('0x4a')];_0x421ff3+=0x1){_0x58a1c6['body'][_0x397d('0xa2')][_0x421ff3]={'filename':_0x58a1c6[_0x397d('0x5c')][_0x397d('0xa2')][_0x421ff3]['name'],'path':path['join'](config[_0x397d('0xa3')],_0x397d('0xa4'),_0x58a1c6[_0x397d('0x5c')][_0x397d('0xa2')][_0x421ff3][_0x397d('0xa5')])};}}var _0x473a6d={'tls':{'rejectUnauthorized':![]}};if(_[_0x397d('0x6e')](_0x2a1756[_0x397d('0x3d')][_0x397d('0x79')])){if(_0x2a1756['Smtp'][_0x397d('0x76')]){_0x473a6d[_0x397d('0xa6')]={'user':_0x2a1756['Smtp'][_0x397d('0x72')],'pass':_0x2a1756[_0x397d('0x3d')]['pass']};}_0x473a6d[_0x397d('0x77')]=_0x2a1756['Smtp'][_0x397d('0x77')];_0x473a6d[_0x397d('0x78')]=_0x2a1756[_0x397d('0x3d')][_0x397d('0x78')];_0x473a6d['secure']=_0x2a1756['Smtp'][_0x397d('0xa7')];}else{_0x473a6d['service']=_0x2a1756['Smtp']['service'];_0x473a6d[_0x397d('0xa6')]={'user':_0x2a1756[_0x397d('0x3d')]['user'],'pass':_0x2a1756[_0x397d('0x3d')][_0x397d('0x74')]};}return respondWithRpcPromise(_0x397d('0xa8'),_0x397d('0xa9'),{'account':_0x473a6d,'message':_0x58a1c6[_0x397d('0x5c')]});}else{throw new Error(_0x397d('0xaa'));}}})[_0x397d('0x33')](function(_0x3682ef){if(_0x3682ef){_0x2617ac=_0x3682ef;if(_0x329444[_0x397d('0x9a')]){if(_0x329444['List'][_0x397d('0x9c')][_0x397d('0x4a')]){return _0x329444[_0x397d('0x9a')][_0x397d('0x9c')][0x0];}else{return db[_0x397d('0x9b')][_0x397d('0x61')](_[_0x397d('0xab')](_0x58a1c6[_0x397d('0x5c')],{'firstName':_0x58a1c6['body']['to'],'email':_0x58a1c6[_0x397d('0x5c')]['to'],'phone':_0x58a1c6[_0x397d('0x5c')]['to'],'ListId':_0x329444['ListId']}));}}else{throw new Error(_0x397d('0xaa'));}}})[_0x397d('0x33')](function(_0x7ad1df){if(_0x7ad1df){var _0x383d2d={'UserId':_0x58a1c6['user']['id'],'ContactId':_0x7ad1df['id'],'MailAccountId':_0x329444['id'],'inReplyTo':_0x2617ac[_0x397d('0xac')],'to':_0x58a1c6[_0x397d('0x5c')]['from'],'cc':_0x58a1c6[_0x397d('0x5c')]['cc'],'subject':_0x58a1c6[_0x397d('0x5c')][_0x397d('0xad')],'attach':_0x58a1c6[_0x397d('0x5c')][_0x397d('0xae')],'firstMsgDirection':_0x397d('0xaf'),'lastMsgAt':moment()[_0x397d('0x98')](_0x397d('0x99')),'lastMsgDirection':'out','lastMsgBody':_0x58a1c6[_0x397d('0x5c')]['body'],'Messages':[_[_0x397d('0x52')](_0x58a1c6[_0x397d('0x5c')],{'messageId':_0x2617ac['messageId'],'sentAt':moment()[_0x397d('0x98')](_0x397d('0x99')),'read':!![],'MailAccountId':_0x329444['id'],'UserId':_0x58a1c6[_0x397d('0x72')]['id'],'ContactId':_0x7ad1df['id']})]};if(_0x58a1c6[_0x397d('0x5c')][_0x397d('0xb0')]){_0x383d2d=_[_0x397d('0x52')](_0x383d2d,_0x58a1c6[_0x397d('0x5c')][_0x397d('0xb0')]);}return db[_0x397d('0x86')][_0x397d('0x61')](_0x383d2d,{'include':[{'model':db['MailMessage'],'as':_0x397d('0xb1')}]});}})[_0x397d('0x33')](respondWithResult(_0x48aabd,null))[_0x397d('0x58')](handleError(_0x48aabd,null));};exports[_0x397d('0xb2')]=function(_0x8ad2ae,_0x4929cd,_0x5cbe8d){return db[_0x397d('0x40')]['find']({'where':{'id':_0x8ad2ae[_0x397d('0x5a')]['id']},'include':[{'model':db[_0x397d('0x3c')],'as':'Smtp','raw':!![]}]})[_0x397d('0x33')](handleEntityNotFound(_0x4929cd,null))[_0x397d('0x33')](function(_0x2e49d5){if(_0x2e49d5&&_0x2e49d5[_0x397d('0x3d')]){var _0x2480ee={'id':_0x2e49d5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e49d5[_0x397d('0x3d')]['service']){_0x2480ee['service']=_0x2e49d5['Smtp'][_0x397d('0x79')];}else{_0x2480ee['host']=_0x2e49d5['Smtp']['host'];_0x2480ee[_0x397d('0x78')]=_0x2e49d5[_0x397d('0x3d')][_0x397d('0x78')];_0x2480ee[_0x397d('0xa7')]=_0x2e49d5[_0x397d('0x3d')][_0x397d('0xa7')];}if(_0x2e49d5[_0x397d('0x3d')]['authentication']){_0x2480ee['auth']={'user':_0x2e49d5[_0x397d('0x3d')][_0x397d('0x72')],'pass':_0x2e49d5[_0x397d('0x3d')][_0x397d('0x74')]};}return respondWithRpcPromise(_0x397d('0xb3'),_0x397d('0xb2'),{'account':_0x2480ee});}})[_0x397d('0x33')](respondWithResult(_0x4929cd,null))[_0x397d('0x58')](handleError(_0x4929cd,null));};exports['destroy']=function(_0x3df58e,_0x2aed1c){return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x3df58e['params']['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x2aed1c,null))[_0x397d('0x33')](function(_0x5a88b9){if(_0x5a88b9&&_0x5a88b9[_0x397d('0x79')]){throw new db[(_0x397d('0xb4'))][(_0x397d('0xb5'))](_0x397d('0xb6'));}return _0x5a88b9;})[_0x397d('0x33')](removeEntity(_0x2aed1c,null))[_0x397d('0x58')](handleError(_0x2aed1c,null));};exports[_0x397d('0xb7')]=function(_0x5b9d3f,_0x5c3bc9,_0x1a2ebd){return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x5b9d3f[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x5c3bc9,null))[_0x397d('0x33')](function(_0x30ff00){if(_0x30ff00){return _0x30ff00['addAgents'](_0x5b9d3f[_0x397d('0x5c')][_0x397d('0x68')],_['omit'](_0x5b9d3f[_0x397d('0x5c')],[_0x397d('0x68'),'id'])||{})['spread'](function(_0x1df5b2){for(var _0xf9867e=0x0;_0xf9867e<_0x5b9d3f[_0x397d('0x5c')][_0x397d('0x68')][_0x397d('0x4a')];_0xf9867e+=0x1){socket[_0x397d('0xb8')]('userMailAccount:save',{'UserId':_0x5b9d3f[_0x397d('0x5c')][_0x397d('0x68')][_0xf9867e],'MailAccountId':_0x5b9d3f['params']['id']});}return _0x1df5b2;});}})[_0x397d('0x33')](respondWithResult(_0x5c3bc9,null))[_0x397d('0x58')](handleError(_0x5c3bc9,null));};exports[_0x397d('0xb9')]=function(_0x1b3c43,_0x460ee5,_0x5db7af){return db[_0x397d('0x40')][_0x397d('0x5b')]({'where':{'id':_0x1b3c43[_0x397d('0x5a')]['id']}})[_0x397d('0x33')](handleEntityNotFound(_0x460ee5,null))[_0x397d('0x33')](function(_0x223519){if(_0x223519){return _0x223519['removeAgents'](_0x1b3c43[_0x397d('0x45')][_0x397d('0x68')])[_0x397d('0x33')](function(){if(_[_0x397d('0xba')](_0x1b3c43[_0x397d('0x45')]['ids'])){for(var _0x4f4362=0x0;_0x4f4362<_0x1b3c43['query'][_0x397d('0x68')][_0x397d('0x4a')];_0x4f4362+=0x1){socket[_0x397d('0xb8')](_0x397d('0xbb'),{'UserId':Number(_0x1b3c43[_0x397d('0x45')][_0x397d('0x68')][_0x4f4362]),'MailAccountId':Number(_0x1b3c43[_0x397d('0x5a')]['id'])});}}else{socket[_0x397d('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x1b3c43['query'][_0x397d('0x68')]),'MailAccountId':Number(_0x1b3c43[_0x397d('0x5a')]['id'])});}});}})[_0x397d('0x33')](respondWithStatusCode(_0x460ee5,null))[_0x397d('0x58')](handleError(_0x460ee5,null));};exports['getAgents']=function(_0x4418b4,_0x909df1,_0x5d34df){var _0x2c5e95={};var _0x5af1f6={};var _0x1df08a;var _0x8b9036;return db[_0x397d('0x40')][_0x397d('0x62')]({'where':{'id':_0x4418b4[_0x397d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x909df1,null))[_0x397d('0x33')](function(_0x4c3958){if(_0x4c3958){_0x1df08a=_0x4c3958;_0x5af1f6[_0x397d('0x44')]=_[_0x397d('0x46')](db['User'][_0x397d('0x63')]);_0x5af1f6[_0x397d('0x45')]=_['keys'](_0x4418b4['query']);_0x5af1f6[_0x397d('0x4e')]=_[_0x397d('0x47')](_0x5af1f6['model'],_0x5af1f6[_0x397d('0x45')]);_0x2c5e95[_0x397d('0x49')]=_[_0x397d('0x47')](_0x5af1f6[_0x397d('0x44')],qs[_0x397d('0x48')](_0x4418b4[_0x397d('0x45')][_0x397d('0x48')]));_0x2c5e95[_0x397d('0x49')]=_0x2c5e95['attributes'][_0x397d('0x4a')]?_0x2c5e95[_0x397d('0x49')]:_0x5af1f6[_0x397d('0x44')];_0x2c5e95[_0x397d('0x4b')]=qs[_0x397d('0x4c')](_0x4418b4[_0x397d('0x45')][_0x397d('0x4c')]);_0x2c5e95['where']=qs['filters'](_['pick'](_0x4418b4[_0x397d('0x45')],_0x5af1f6[_0x397d('0x4e')]));if(_0x4418b4[_0x397d('0x45')]['filter']){_0x2c5e95['where']=_[_0x397d('0x52')](_0x2c5e95[_0x397d('0x4d')],{'$or':_[_0x397d('0x3f')](_0x2c5e95[_0x397d('0x49')],function(_0x12d0ba){var _0xe96de8={};_0xe96de8[_0x12d0ba]={'$like':'%'+_0x4418b4[_0x397d('0x45')][_0x397d('0x50')]+'%'};return _0xe96de8;})});}_0x2c5e95=_[_0x397d('0x52')]({},_0x2c5e95,_0x4418b4['options']);return _0x1df08a[_0x397d('0xbc')](_0x2c5e95);}})[_0x397d('0x33')](function(_0x15cfa0){if(_0x15cfa0){_0x8b9036=_0x15cfa0[_0x397d('0x4a')];if(!_0x4418b4[_0x397d('0x45')]['hasOwnProperty']('nolimit')){_0x2c5e95[_0x397d('0x2c')]=qs[_0x397d('0x2c')](_0x4418b4[_0x397d('0x45')][_0x397d('0x2c')]);_0x2c5e95['offset']=qs[_0x397d('0x2b')](_0x4418b4[_0x397d('0x45')]['offset']);}return _0x1df08a[_0x397d('0xbc')](_0x2c5e95);}})[_0x397d('0x33')](function(_0x4ddba5){if(_0x4ddba5){return _0x4ddba5?{'count':_0x8b9036,'rows':_0x4ddba5}:null;}})[_0x397d('0x33')](respondWithResult(_0x909df1,null))['catch'](handleError(_0x909df1,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8c229cb..da3bc9d 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 _0x9f17=['MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9f17,0xc4));var _0x79f1=function(_0x4005db,_0x3d7bfd){_0x4005db=_0x4005db-0x0;var _0x341c5f=_0x9f17[_0x4005db];return _0x341c5f;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x79f1('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x79f1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79f1('0x2'),'afterDestroy':_0x79f1('0x3')};function emitEvent(_0x1616f){return function(_0x48f008,_0x1ae098,_0x24ff8e){MailAccountEvents[_0x79f1('0x4')](_0x1616f+':'+_0x48f008['id'],_0x48f008);MailAccountEvents[_0x79f1('0x4')](_0x1616f,_0x48f008);_0x24ff8e(null);};}for(var e in events){if(events[_0x79f1('0x5')](e)){var event=events[e];MailAccount[_0x79f1('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x6ecc=['hook','exports','../../mysqldb','MailAccount','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x23ae45,_0xddbdcf){var _0x3c2d02=function(_0x395a3e){while(--_0x395a3e){_0x23ae45['push'](_0x23ae45['shift']());}};_0x3c2d02(++_0xddbdcf);}(_0x6ecc,0xca));var _0xc6ec=function(_0x4298b,_0xd55b53){_0x4298b=_0x4298b-0x0;var _0x4bb1ee=_0x6ecc[_0x4298b];return _0x4bb1ee;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc6ec('0x0'))['db'][_0xc6ec('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc6ec('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc6ec('0x3')};function emitEvent(_0x268fb8){return function(_0x2ba914,_0x24b74a,_0x127734){MailAccountEvents[_0xc6ec('0x4')](_0x268fb8+':'+_0x2ba914['id'],_0x2ba914);MailAccountEvents[_0xc6ec('0x4')](_0x268fb8,_0x2ba914);_0x127734(null);};}for(var e in events){if(events[_0xc6ec('0x5')](e)){var event=events[e];MailAccount[_0xc6ec('0x6')](e,emitEvent(event));}}module[_0xc6ec('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 8ddda97..e151d66 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 _0x919b=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x3342ee,_0x2ba4ce){var _0xfa5dda=function(_0x1e595c){while(--_0x1e595c){_0x3342ee['push'](_0x3342ee['shift']());}};_0xfa5dda(++_0x2ba4ce);}(_0x919b,0x1ba));var _0xb919=function(_0x75699f,_0x1b02c3){_0x75699f=_0x75699f-0x0;var _0x137423=_0x919b[_0x75699f];return _0x137423;};'use strict';var _=require(_0xb919('0x0'));var util=require(_0xb919('0x1'));var logger=require('../../config/logger')(_0xb919('0x2'));var moment=require(_0xb919('0x3'));var BPromise=require('bluebird');var rp=require(_0xb919('0x4'));var fs=require('fs');var path=require(_0xb919('0x5'));var rimraf=require(_0xb919('0x6'));var config=require(_0xb919('0x7'));var attributes=require(_0xb919('0x8'));module[_0xb919('0x9')]=function(_0x2df793,_0x34c333){return _0x2df793[_0xb919('0xa')](_0xb919('0xb'),attributes,{'tableName':_0xb919('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eed=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3eed,0x153));var _0xd3ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3eed[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd3ee('0x0'));var logger=require('../../config/logger')(_0xd3ee('0x1'));var moment=require(_0xd3ee('0x2'));var BPromise=require(_0xd3ee('0x3'));var rp=require(_0xd3ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3ee('0x5'));var config=require(_0xd3ee('0x6'));var attributes=require(_0xd3ee('0x7'));module['exports']=function(_0x4794dc,_0x131a2e){return _0x4794dc[_0xd3ee('0x8')](_0xd3ee('0x9'),attributes,{'tableName':'mail_accounts','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 0bcbcb5..cecba32 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 _0x04b8=['catch','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','priority','asc','autoclose','length','*,*,*,*','CmContact','create','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread','format','created','contact','originTo','originCc','bcc','Attachments','interaction','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x5c107d,_0x155dbe){var _0x3eaf06=function(_0x348dd6){while(--_0x348dd6){_0x5c107d['push'](_0x5c107d['shift']());}};_0x3eaf06(++_0x155dbe);}(_0x04b8,0x159));var _0x804b=function(_0x250635,_0x2f621b){_0x250635=_0x250635-0x0;var _0x4f0688=_0x04b8[_0x250635];return _0x4f0688;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232c});config[_0x804b('0x9')]=_[_0x804b('0xa')](config['redis'],{'host':_0x804b('0xb'),'port':0x18eb});var socket=require(_0x804b('0xc'))(new Redis(config['redis']));require(_0x804b('0xd'))[_0x804b('0xe')](socket);function respondWithRpcPromise(_0x222487,_0x22c59a,_0x1c5c15){return new BPromise(function(_0x5c1a40,_0x22c98d){return client[_0x804b('0xf')](_0x222487,_0x1c5c15)[_0x804b('0x10')](function(_0x7029e7){logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,'request\x20sent');logger[_0x804b('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x22c59a,_0x804b('0x14'),JSON[_0x804b('0x15')](_0x7029e7));if(_0x7029e7[_0x804b('0x16')]){if(_0x7029e7[_0x804b('0x16')]['code']===0x1f4){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);return _0x22c98d(_0x7029e7['error'][_0x804b('0x17')]);}logger[_0x804b('0x16')]('MailAccount,\x20%s,\x20%s',_0x22c59a,_0x7029e7[_0x804b('0x16')]['message']);return _0x5c1a40(_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);}else{logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,_0x804b('0x14'));_0x5c1a40(_0x7029e7['result'][_0x804b('0x17')]);}})['catch'](function(_0x247380){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x247380);_0x22c98d(_0x247380);});});}exports[_0x804b('0x18')]=function(_0x5b2357){var _0x2892b8=this;return new Promise(function(_0x1e29a7,_0x427166){return db[_0x804b('0x19')][_0x804b('0x1a')]({'raw':_0x5b2357[_0x804b('0x1b')]?_0x5b2357[_0x804b('0x1b')][_0x804b('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b2357[_0x804b('0x1b')]?_0x5b2357[_0x804b('0x1b')][_0x804b('0x1d')]||null:null,'attributes':_0x5b2357['options']?_0x5b2357[_0x804b('0x1b')][_0x804b('0x1e')]||null:null,'limit':_0x5b2357['options']?_0x5b2357[_0x804b('0x1b')][_0x804b('0x1f')]||null:null,'include':_0x5b2357[_0x804b('0x1b')]?_0x5b2357[_0x804b('0x1b')][_0x804b('0x20')]?_['map'](_0x5b2357[_0x804b('0x1b')][_0x804b('0x20')],function(_0x4e7266){return{'model':db[_0x4e7266[_0x804b('0x21')]],'as':_0x4e7266['as'],'attributes':_0x4e7266[_0x804b('0x1e')],'include':_0x4e7266[_0x804b('0x20')]?_[_0x804b('0x22')](_0x4e7266[_0x804b('0x20')],function(_0x5cc1dd){return{'model':db[_0x5cc1dd[_0x804b('0x21')]],'as':_0x5cc1dd['as'],'attributes':_0x5cc1dd[_0x804b('0x1e')],'include':_0x5cc1dd[_0x804b('0x20')]?_[_0x804b('0x22')](_0x5cc1dd[_0x804b('0x20')],function(_0x4a6079){return{'model':db[_0x4a6079[_0x804b('0x21')]],'as':_0x4a6079['as'],'attributes':_0x4a6079[_0x804b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x804b('0x10')](function(_0x5c7026){logger[_0x804b('0x11')](_0x804b('0x18'),_0x5b2357);logger[_0x804b('0x13')]('GetMailAccount',_0x5b2357,JSON[_0x804b('0x15')](_0x5c7026));_0x1e29a7(_0x5c7026);})[_0x804b('0x23')](function(_0x5e8f85){logger[_0x804b('0x16')](_0x804b('0x18'),_0x5e8f85[_0x804b('0x17')],_0x5b2357);_0x427166(_0x2892b8[_0x804b('0x16')](0x1f4,_0x5e8f85[_0x804b('0x17')]));});});};exports[_0x804b('0x24')]=function(_0x551792){var _0x3b0692=this;return new Promise(function(_0xc3e8e,_0x16e460){return db[_0x804b('0x19')][_0x804b('0x25')]({'raw':_0x551792[_0x804b('0x1b')]?_0x551792[_0x804b('0x1b')][_0x804b('0x1c')]===undefined?!![]:![]:!![],'where':_0x551792[_0x804b('0x1b')]?_0x551792[_0x804b('0x1b')][_0x804b('0x1d')]||null:null,'attributes':_0x551792[_0x804b('0x1b')]?_0x551792[_0x804b('0x1b')][_0x804b('0x1e')]||null:null,'include':_0x551792[_0x804b('0x1b')]?_0x551792[_0x804b('0x1b')][_0x804b('0x20')]?_[_0x804b('0x22')](_0x551792[_0x804b('0x1b')][_0x804b('0x20')],function(_0xa9d773){return{'model':db[_0xa9d773[_0x804b('0x21')]],'as':_0xa9d773['as'],'attributes':_0xa9d773[_0x804b('0x1e')],'include':_0xa9d773[_0x804b('0x20')]?_[_0x804b('0x22')](_0xa9d773['include'],function(_0x4dde32){return{'model':db[_0x4dde32['model']],'as':_0x4dde32['as'],'attributes':_0x4dde32[_0x804b('0x1e')],'include':_0x4dde32[_0x804b('0x20')]?_[_0x804b('0x22')](_0x4dde32['include'],function(_0x5918f2){return{'model':db[_0x5918f2['model']],'as':_0x5918f2['as'],'attributes':_0x5918f2[_0x804b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x804b('0x10')](function(_0x43cbdf){logger[_0x804b('0x11')](_0x804b('0x24'),_0x551792);logger[_0x804b('0x13')](_0x804b('0x24'),_0x551792,JSON[_0x804b('0x15')](_0x43cbdf));_0xc3e8e(_0x43cbdf);})[_0x804b('0x23')](function(_0x1d8398){logger[_0x804b('0x16')](_0x804b('0x24'),_0x1d8398[_0x804b('0x17')],_0x551792);_0x16e460(_0x3b0692['error'](0x1f4,_0x1d8398[_0x804b('0x17')]));});});};exports[_0x804b('0x26')]=function(_0xb877d6){var _0x3d6d8a=this;return new Promise(function(_0x62cfee,_0x48e61d){var _0x5d337d={'body':_0xb877d6[_0x804b('0x27')],'channel':_0x804b('0x28')};var _0xbaa118=_['difference'](_[_0x804b('0x29')](db['CmContact'][_0x804b('0x2a')]),[_0x804b('0x2b'),_0x804b('0x2c'),_0x804b('0x2d'),_0x804b('0x2e')]);var _0x13b986=![];if(_0xb877d6[_0x804b('0x27')]['id']){delete _0xb877d6['body']['id'];}if(_[_0x804b('0x2f')](_0xb877d6[_0x804b('0x27')][_0x804b('0x30')])){return _0x48e61d(_0x3d6d8a[_0x804b('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x804b('0x2f')](_0xb877d6[_0x804b('0x27')][_0x804b('0x27')])||_0xb877d6[_0x804b('0x27')][_0x804b('0x27')]===''){return _0x48e61d(_0x3d6d8a[_0x804b('0x16')](0x1f4,_0x804b('0x31')));}if(_[_0x804b('0x2f')](_0xb877d6['body'][_0x804b('0x32')])){return _0x48e61d(_0x3d6d8a['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbaa118));}if(!_['includes'](_0xbaa118,_0xb877d6[_0x804b('0x27')]['mapKey'])){return _0x48e61d(_0x3d6d8a[_0x804b('0x16')](0x1f4,_0x804b('0x33')+_0xbaa118));}var _0x1eda0a={};_0x1eda0a[_0xb877d6[_0x804b('0x27')]['mapKey']]=_0xb877d6[_0x804b('0x27')][_0x804b('0x30')];return db[_0x804b('0x19')]['find']({'where':{'id':_0xb877d6[_0x804b('0x34')]['id']},'include':[{'model':db[_0x804b('0x35')],'as':_0x804b('0x36'),'include':[{'model':db['CmContact'],'as':_0x804b('0x37'),'where':_0x1eda0a,'limit':0x1,'order':[[_0x804b('0x2c'),_0x804b('0x38')]]}]},{'model':db[_0x804b('0x39')],'as':_0x804b('0x3a')},{'model':db[_0x804b('0x3b')],'as':_0x804b('0x3c')}]})[_0x804b('0x10')](function(_0x1d3e73){if(_0x1d3e73&&_0x1d3e73[_0x804b('0x36')]){var _0x376ece=_0x1d3e73[_0x804b('0x3d')]({'plain':!![]});_0x5d337d[_0x804b('0x34')]=_[_0x804b('0x3e')](_0x376ece,['Applications','List']);_0x5d337d[_0x804b('0x3f')]=_0x376ece[_0x804b('0x3a')];_0x5d337d[_0x804b('0x40')]=_0x376ece[_0x804b('0x36')];_0x5d337d[_0x804b('0x3f')]=_['orderBy'](_0x5d337d[_0x804b('0x3f')],[_0x804b('0x41')],[_0x804b('0x42')]);if(_0x5d337d[_0x804b('0x34')]&&_0x5d337d[_0x804b('0x34')][_0x804b('0x43')]){_0x5d337d['applications']['push']({'id':0x0,'priority':_0x5d337d[_0x804b('0x3f')][_0x804b('0x44')]+0x1,'app':'close','appdata':'autoclose','interval':_0x804b('0x45')});}if(_0x5d337d[_0x804b('0x34')][_0x804b('0x3a')]){delete _0x5d337d['account'][_0x804b('0x3a')];}if(_0x5d337d[_0x804b('0x34')]['List']){delete _0x5d337d[_0x804b('0x34')]['List'];}if(_0x376ece[_0x804b('0x36')]['Contacts'][_0x804b('0x44')]){return _0x376ece[_0x804b('0x36')]['Contacts'][0x0];}var _0x2f9360=_['defaults'](_0xb877d6[_0x804b('0x27')],{'firstName':_0xb877d6[_0x804b('0x27')][_0x804b('0x30')],'ListId':_0x376ece[_0x804b('0x2e')]});_0x2f9360[_0xb877d6[_0x804b('0x27')][_0x804b('0x32')]]=_0xb877d6[_0x804b('0x27')][_0x804b('0x30')];return db[_0x804b('0x46')][_0x804b('0x47')](_0x2f9360);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x13fb5c){_0x5d337d['contact']=_0x13fb5c;if(_0x13fb5c){if(!_0xb877d6['body'][_0x804b('0x17')][_0x804b('0x48')]){_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['messageId']=rs['generate']()+'\x20'+_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x30')];}var _0x6005bf={'ContactId':_0x13fb5c['id'],'MailAccountId':_0xb877d6[_0x804b('0x34')]['id'],'inReplyTo':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x48')],'to':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x30')],'cc':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['cc'],'subject':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x49')],'attach':_0xb877d6['body'][_0x804b('0x17')][_0x804b('0x4a')],'lastMsgAt':moment()['format'](_0x804b('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xb877d6[_0x804b('0x27')][_0x804b('0x27')]};return db[_0x804b('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0xb877d6[_0x804b('0x34')]['id']},'include':[{'model':db[_0x804b('0x4d')],'as':'Messages','attributes':[_0x804b('0x48')],'where':{'messageId':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['inReplyTo']}}]})[_0x804b('0x10')](function(_0x313b76){if(_0x313b76){return[_0x313b76,![]];}return db[_0x804b('0x4c')][_0x804b('0x47')](_0x6005bf)[_0x804b('0x10')](function(_0x555d2e){return[_0x555d2e,!![]];});});}else{throw new Error(_0x804b('0x4e'));}})[_0x804b('0x4f')](function(_0x3c043e,_0x33f78d){if(_0x3c043e){_0x13b986=_0x33f78d;if(!_0x33f78d){return _0x3c043e['update']({'inReplyTo':_0xb877d6['body'][_0x804b('0x17')]['messageId'],'to':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x30')],'cc':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['cc'],'subject':_0xb877d6['body'][_0x804b('0x17')][_0x804b('0x49')],'attach':_0x3c043e[_0x804b('0x4a')]?_0x3c043e['attach']:_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0x804b('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x804b('0x50')](_0x804b('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xb877d6['body'][_0x804b('0x27')]});}else{return _0x3c043e;}}})[_0x804b('0x10')](function(_0xaedaf6){_0x5d337d['interaction']=_0xaedaf6[_0x804b('0x3d')]({'plain':!![]});_0x5d337d['interaction'][_0x804b('0x51')]=_0x13b986;return db[_0x804b('0x4d')][_0x804b('0x47')]({'body':_0xb877d6[_0x804b('0x27')]['body'],'MailAccountId':_0xb877d6[_0x804b('0x34')]['id'],'MailInteractionId':_0xaedaf6['id'],'direction':'in','ContactId':_0x5d337d[_0x804b('0x52')]['id'],'messageId':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x48')],'from':_0xb877d6[_0x804b('0x27')]['message'][_0x804b('0x30')],'to':_0xb877d6[_0x804b('0x27')]['message']['to'],'cc':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['cc'],'subject':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['subject'],'attach':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['attach'],'Attachments':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')]['attachments'],'originTo':_0xb877d6[_0x804b('0x27')]['message'][_0x804b('0x53')],'originCc':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x54')],'bcc':_0xb877d6[_0x804b('0x27')][_0x804b('0x17')][_0x804b('0x55')]},{'include':[{'model':db['Attachment'],'as':_0x804b('0x56')}]});})['then'](function(_0x18fdd5){_0x5d337d[_0x804b('0x17')]=_0x18fdd5;if(_0x5d337d[_0x804b('0x57')][_0x804b('0x58')]){return db[_0x804b('0x59')][_0x804b('0x25')]({'attributes':['id',_0x804b('0x5a')],'where':{'id':_0x5d337d[_0x804b('0x57')][_0x804b('0x58')]}})[_0x804b('0x10')](function(_0x38e199){if(_0x38e199){_0x5d337d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x804b('0x5b'),'appdata':_0x38e199[_0x804b('0x5a')]+','+(_0x5d337d[_0x804b('0x34')][_0x804b('0x5c')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x804b('0x5d'),_0x804b('0x5e'),_0x5d337d);});}return respondWithRpcPromise(_0x804b('0x5d'),_0x804b('0x5e'),_0x5d337d);})[_0x804b('0x10')](function(_0x1ba4ba){_0x62cfee(_0x1ba4ba);})[_0x804b('0x23')](function(_0x3185c3){_0x48e61d(_0x3d6d8a[_0x804b('0x16')](0x1f4,_0x3185c3[_0x804b('0x17')]));});});}; \ No newline at end of file +var _0x45ea=['UserId','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','GetMailAccount','MailAccount','options','where','limit','map','include','model','attributes','stringify','ShowMailAccount','raw','then','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','MailApplication','Smtp','get','Applications','list','applications','orderBy','priority','asc','autoclose','push','close','defaults','create','List\x20not\x20found','messageId','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','originTo','Attachments'];(function(_0x5b47cb,_0x21cfc4){var _0x1e615b=function(_0xd18fb){while(--_0xd18fb){_0x5b47cb['push'](_0x5b47cb['shift']());}};_0x1e615b(++_0x21cfc4);}(_0x45ea,0x1f0));var _0xa45e=function(_0x4223a,_0x234025){_0x4223a=_0x4223a-0x0;var _0x13ec8b=_0x45ea[_0x4223a];return _0x13ec8b;};'use strict';var _=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var moment=require(_0xa45e('0x2'));var BPromise=require(_0xa45e('0x3'));var rs=require(_0xa45e('0x4'));var fs=require('fs');var Redis=require(_0xa45e('0x5'));var db=require(_0xa45e('0x6'))['db'];var utils=require(_0xa45e('0x7'));var logger=require(_0xa45e('0x8'))(_0xa45e('0x9'));var config=require(_0xa45e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa45e('0xb')][_0xa45e('0xc')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0xa45e('0xd'),'port':0x18eb});var socket=require(_0xa45e('0xe'))(new Redis(config[_0xa45e('0xf')]));require(_0xa45e('0x10'))[_0xa45e('0x11')](socket);function respondWithRpcPromise(_0x5ea77f,_0x506435,_0x193fe6){return new BPromise(function(_0x28aa8e,_0x17788b){return client[_0xa45e('0x12')](_0x5ea77f,_0x193fe6)['then'](function(_0x14f158){logger['info'](_0xa45e('0x13'),_0x506435,_0xa45e('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x506435,_0xa45e('0x14'),JSON['stringify'](_0x14f158));if(_0x14f158[_0xa45e('0x15')]){if(_0x14f158['error']['code']===0x1f4){logger['error'](_0xa45e('0x13'),_0x506435,_0x14f158['error'][_0xa45e('0x16')]);return _0x17788b(_0x14f158[_0xa45e('0x15')][_0xa45e('0x16')]);}logger[_0xa45e('0x15')](_0xa45e('0x13'),_0x506435,_0x14f158['error'][_0xa45e('0x16')]);return _0x28aa8e(_0x14f158[_0xa45e('0x15')][_0xa45e('0x16')]);}else{logger[_0xa45e('0x17')](_0xa45e('0x13'),_0x506435,'request\x20sent');_0x28aa8e(_0x14f158[_0xa45e('0x18')][_0xa45e('0x16')]);}})[_0xa45e('0x19')](function(_0x2579ff){logger[_0xa45e('0x15')](_0xa45e('0x13'),_0x506435,_0x2579ff);_0x17788b(_0x2579ff);});});}exports[_0xa45e('0x1a')]=function(_0x2e8c81){var _0x49dae2=this;return new Promise(function(_0x14e2db,_0xcf43bd){return db[_0xa45e('0x1b')]['findAll']({'raw':_0x2e8c81['options']?_0x2e8c81[_0xa45e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2e8c81[_0xa45e('0x1c')]?_0x2e8c81[_0xa45e('0x1c')][_0xa45e('0x1d')]||null:null,'attributes':_0x2e8c81[_0xa45e('0x1c')]?_0x2e8c81[_0xa45e('0x1c')]['attributes']||null:null,'limit':_0x2e8c81[_0xa45e('0x1c')]?_0x2e8c81['options'][_0xa45e('0x1e')]||null:null,'include':_0x2e8c81[_0xa45e('0x1c')]?_0x2e8c81['options']['include']?_[_0xa45e('0x1f')](_0x2e8c81['options'][_0xa45e('0x20')],function(_0x252957){return{'model':db[_0x252957[_0xa45e('0x21')]],'as':_0x252957['as'],'attributes':_0x252957['attributes'],'include':_0x252957['include']?_[_0xa45e('0x1f')](_0x252957[_0xa45e('0x20')],function(_0x228ec8){return{'model':db[_0x228ec8[_0xa45e('0x21')]],'as':_0x228ec8['as'],'attributes':_0x228ec8[_0xa45e('0x22')],'include':_0x228ec8['include']?_[_0xa45e('0x1f')](_0x228ec8[_0xa45e('0x20')],function(_0x5e2a58){return{'model':db[_0x5e2a58[_0xa45e('0x21')]],'as':_0x5e2a58['as'],'attributes':_0x5e2a58['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d4527){logger[_0xa45e('0x17')]('GetMailAccount',_0x2e8c81);logger['debug'](_0xa45e('0x1a'),_0x2e8c81,JSON[_0xa45e('0x23')](_0x1d4527));_0x14e2db(_0x1d4527);})[_0xa45e('0x19')](function(_0x4867a4){logger[_0xa45e('0x15')](_0xa45e('0x1a'),_0x4867a4[_0xa45e('0x16')],_0x2e8c81);_0xcf43bd(_0x49dae2[_0xa45e('0x15')](0x1f4,_0x4867a4['message']));});});};exports[_0xa45e('0x24')]=function(_0xf92852){var _0x4f54d3=this;return new Promise(function(_0x59801d,_0x1d23a){return db[_0xa45e('0x1b')]['find']({'raw':_0xf92852[_0xa45e('0x1c')]?_0xf92852[_0xa45e('0x1c')][_0xa45e('0x25')]===undefined?!![]:![]:!![],'where':_0xf92852['options']?_0xf92852[_0xa45e('0x1c')][_0xa45e('0x1d')]||null:null,'attributes':_0xf92852[_0xa45e('0x1c')]?_0xf92852['options'][_0xa45e('0x22')]||null:null,'include':_0xf92852[_0xa45e('0x1c')]?_0xf92852[_0xa45e('0x1c')][_0xa45e('0x20')]?_[_0xa45e('0x1f')](_0xf92852[_0xa45e('0x1c')][_0xa45e('0x20')],function(_0x3d1d2a){return{'model':db[_0x3d1d2a[_0xa45e('0x21')]],'as':_0x3d1d2a['as'],'attributes':_0x3d1d2a[_0xa45e('0x22')],'include':_0x3d1d2a[_0xa45e('0x20')]?_[_0xa45e('0x1f')](_0x3d1d2a[_0xa45e('0x20')],function(_0x52bad1){return{'model':db[_0x52bad1['model']],'as':_0x52bad1['as'],'attributes':_0x52bad1[_0xa45e('0x22')],'include':_0x52bad1[_0xa45e('0x20')]?_[_0xa45e('0x1f')](_0x52bad1[_0xa45e('0x20')],function(_0x3c2957){return{'model':db[_0x3c2957[_0xa45e('0x21')]],'as':_0x3c2957['as'],'attributes':_0x3c2957['attributes']};}):[]};}):[]};}):[]:[]})[_0xa45e('0x26')](function(_0x38fe69){logger['info'](_0xa45e('0x24'),_0xf92852);logger['debug'](_0xa45e('0x24'),_0xf92852,JSON['stringify'](_0x38fe69));_0x59801d(_0x38fe69);})[_0xa45e('0x19')](function(_0x241a0c){logger[_0xa45e('0x15')](_0xa45e('0x24'),_0x241a0c[_0xa45e('0x16')],_0xf92852);_0x1d23a(_0x4f54d3[_0xa45e('0x15')](0x1f4,_0x241a0c[_0xa45e('0x16')]));});});};exports[_0xa45e('0x27')]=function(_0x416da0){var _0x3c4bf6=this;return new Promise(function(_0x424890,_0x32753b){var _0x107f28={'body':_0x416da0[_0xa45e('0x28')],'channel':_0xa45e('0x29')};var _0x1db5db=_[_0xa45e('0x2a')](_[_0xa45e('0x2b')](db[_0xa45e('0x2c')][_0xa45e('0x2d')]),[_0xa45e('0x2e'),_0xa45e('0x2f'),_0xa45e('0x30'),_0xa45e('0x31')]);var _0x4b2c3b=![];if(_0x416da0[_0xa45e('0x28')]['id']){delete _0x416da0[_0xa45e('0x28')]['id'];}if(_[_0xa45e('0x32')](_0x416da0['body'][_0xa45e('0x33')])){return _0x32753b(_0x3c4bf6['error'](0x1f4,_0xa45e('0x34')));}if(_['isNil'](_0x416da0[_0xa45e('0x28')][_0xa45e('0x28')])||_0x416da0[_0xa45e('0x28')]['body']===''){return _0x32753b(_0x3c4bf6['error'](0x1f4,_0xa45e('0x35')));}if(_[_0xa45e('0x32')](_0x416da0[_0xa45e('0x28')][_0xa45e('0x36')])){return _0x32753b(_0x3c4bf6[_0xa45e('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1db5db));}if(!_[_0xa45e('0x37')](_0x1db5db,_0x416da0[_0xa45e('0x28')][_0xa45e('0x36')])){return _0x32753b(_0x3c4bf6[_0xa45e('0x15')](0x1f4,_0xa45e('0x38')+_0x1db5db));}var _0x1be378={};_0x1be378[_0x416da0[_0xa45e('0x28')]['mapKey']]=_0x416da0[_0xa45e('0x28')][_0xa45e('0x33')];return db[_0xa45e('0x1b')][_0xa45e('0x39')]({'where':{'id':_0x416da0[_0xa45e('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0xa45e('0x3b'),'include':[{'model':db['CmContact'],'as':_0xa45e('0x3c'),'where':_0x1be378,'limit':0x1,'order':[[_0xa45e('0x2f'),'DESC']]}]},{'model':db[_0xa45e('0x3d')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xa45e('0x3e')}]})[_0xa45e('0x26')](function(_0x42b714){if(_0x42b714&&_0x42b714[_0xa45e('0x3b')]){var _0x46d847=_0x42b714[_0xa45e('0x3f')]({'plain':!![]});_0x107f28[_0xa45e('0x3a')]=_['omit'](_0x46d847,[_0xa45e('0x40'),_0xa45e('0x3b')]);_0x107f28['applications']=_0x46d847['Applications'];_0x107f28[_0xa45e('0x41')]=_0x46d847[_0xa45e('0x3b')];_0x107f28[_0xa45e('0x42')]=_[_0xa45e('0x43')](_0x107f28[_0xa45e('0x42')],[_0xa45e('0x44')],[_0xa45e('0x45')]);if(_0x107f28[_0xa45e('0x3a')]&&_0x107f28[_0xa45e('0x3a')][_0xa45e('0x46')]){_0x107f28['applications'][_0xa45e('0x47')]({'id':0x0,'priority':_0x107f28[_0xa45e('0x42')]['length']+0x1,'app':_0xa45e('0x48'),'appdata':_0xa45e('0x46'),'interval':'*,*,*,*'});}if(_0x107f28[_0xa45e('0x3a')]['Applications']){delete _0x107f28[_0xa45e('0x3a')][_0xa45e('0x40')];}if(_0x107f28[_0xa45e('0x3a')][_0xa45e('0x3b')]){delete _0x107f28[_0xa45e('0x3a')][_0xa45e('0x3b')];}if(_0x46d847[_0xa45e('0x3b')][_0xa45e('0x3c')]['length']){return _0x46d847[_0xa45e('0x3b')][_0xa45e('0x3c')][0x0];}var _0x270c4d=_[_0xa45e('0x49')](_0x416da0[_0xa45e('0x28')],{'firstName':_0x416da0[_0xa45e('0x28')][_0xa45e('0x33')],'ListId':_0x46d847['ListId']});_0x270c4d[_0x416da0['body'][_0xa45e('0x36')]]=_0x416da0[_0xa45e('0x28')][_0xa45e('0x33')];return db[_0xa45e('0x2c')][_0xa45e('0x4a')](_0x270c4d);}else{throw new Error(_0xa45e('0x4b'));}})[_0xa45e('0x26')](function(_0x3cbc5f){_0x107f28['contact']=_0x3cbc5f;if(_0x3cbc5f){if(!_0x416da0['body'][_0xa45e('0x16')][_0xa45e('0x4c')]){_0x416da0['body'][_0xa45e('0x16')][_0xa45e('0x4c')]=rs['generate']()+'\x20'+_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x33')];}var _0x3bdf2e={'ContactId':_0x3cbc5f['id'],'MailAccountId':_0x416da0[_0xa45e('0x3a')]['id'],'inReplyTo':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['messageId'],'to':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x33')],'cc':_0x416da0[_0xa45e('0x28')]['message']['cc'],'subject':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['subject'],'attach':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x4d')],'lastMsgAt':moment()[_0xa45e('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x416da0['body']['body']};return db[_0xa45e('0x4f')][_0xa45e('0x39')]({'where':{'closed':![],'MailAccountId':_0x416da0[_0xa45e('0x3a')]['id']},'include':[{'model':db[_0xa45e('0x50')],'as':_0xa45e('0x51'),'attributes':[_0xa45e('0x4c')],'where':{'messageId':_0x416da0[_0xa45e('0x28')]['message'][_0xa45e('0x52')]}}]})[_0xa45e('0x26')](function(_0x1c6829){if(_0x1c6829){return[_0x1c6829,![]];}return db[_0xa45e('0x4f')]['create'](_0x3bdf2e)[_0xa45e('0x26')](function(_0x2662f3){return[_0x2662f3,!![]];});});}else{throw new Error(_0xa45e('0x53'));}})[_0xa45e('0x54')](function(_0x1658de,_0x5c9252){if(_0x1658de){_0x4b2c3b=_0x5c9252;if(!_0x5c9252){return _0x1658de[_0xa45e('0x55')]({'inReplyTo':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['messageId'],'to':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x33')],'cc':_0x416da0[_0xa45e('0x28')]['message']['cc'],'subject':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x56')],'attach':_0x1658de[_0xa45e('0x4d')]?_0x1658de[_0xa45e('0x4d')]:_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x4d')],'substatus':null,'substatusAt':moment()[_0xa45e('0x4e')](_0xa45e('0x57')),'lastMsgAt':moment()['format'](_0xa45e('0x57')),'lastMsgDirection':'in','lastMsgBody':_0x416da0['body'][_0xa45e('0x28')]});}else{return _0x1658de;}}})[_0xa45e('0x26')](function(_0x5775a4){_0x107f28[_0xa45e('0x58')]=_0x5775a4[_0xa45e('0x3f')]({'plain':!![]});_0x107f28[_0xa45e('0x58')]['created']=_0x4b2c3b;return db[_0xa45e('0x50')][_0xa45e('0x4a')]({'body':_0x416da0[_0xa45e('0x28')]['body'],'MailAccountId':_0x416da0[_0xa45e('0x3a')]['id'],'MailInteractionId':_0x5775a4['id'],'direction':'in','ContactId':_0x107f28[_0xa45e('0x59')]['id'],'messageId':_0x416da0['body'][_0xa45e('0x16')][_0xa45e('0x4c')],'from':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x33')],'to':_0x416da0[_0xa45e('0x28')]['message']['to'],'cc':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['cc'],'subject':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')][_0xa45e('0x56')],'attach':_0x416da0['body'][_0xa45e('0x16')][_0xa45e('0x4d')],'Attachments':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['attachments'],'originTo':_0x416da0['body'][_0xa45e('0x16')][_0xa45e('0x5a')],'originCc':_0x416da0[_0xa45e('0x28')][_0xa45e('0x16')]['originCc'],'bcc':_0x416da0[_0xa45e('0x28')]['message']['bcc']},{'include':[{'model':db['Attachment'],'as':_0xa45e('0x5b')}]});})['then'](function(_0x2913a0){_0x107f28['message']=_0x2913a0;if(_0x107f28[_0xa45e('0x58')][_0xa45e('0x5c')]){return db['User'][_0xa45e('0x39')]({'attributes':['id','name'],'where':{'id':_0x107f28[_0xa45e('0x58')][_0xa45e('0x5c')]}})[_0xa45e('0x26')](function(_0x47b7af){if(_0x47b7af){_0x107f28[_0xa45e('0x42')][_0xa45e('0x5d')]({'id':0x0,'priority':0x0,'app':_0xa45e('0x5e'),'appdata':_0x47b7af['name']+','+(_0x107f28[_0xa45e('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0xa45e('0x5f')});}return respondWithRpcPromise(_0xa45e('0x60'),_0xa45e('0x61'),_0x107f28);});}return respondWithRpcPromise(_0xa45e('0x60'),_0xa45e('0x61'),_0x107f28);})[_0xa45e('0x26')](function(_0x3aaf18){_0x424890(_0x3aaf18);})[_0xa45e('0x19')](function(_0x327cbc){_0x32753b(_0x3c4bf6[_0xa45e('0x15')](0x1f4,_0x327cbc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 9bddcdd..c2df503 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 _0x31f0=['emit','removeListener','mailAccount:','./mailAccount.events','remove'];(function(_0x55b9ec,_0x41377a){var _0x515f6f=function(_0x14a2bd){while(--_0x14a2bd){_0x55b9ec['push'](_0x55b9ec['shift']());}};_0x515f6f(++_0x41377a);}(_0x31f0,0xb7));var _0x031f=function(_0x6f0aba,_0x46b6a4){_0x6f0aba=_0x6f0aba-0x0;var _0x52d519=_0x31f0[_0x6f0aba];return _0x52d519;};'use strict';var MailAccountEvents=require(_0x031f('0x0'));var events=['save',_0x031f('0x1'),'update'];function createListener(_0x3747a5,_0x2021ea){return function(_0x2b04d4){_0x2021ea[_0x031f('0x2')](_0x3747a5,_0x2b04d4);};}function removeListener(_0x526a45,_0x3c0612){return function(){MailAccountEvents[_0x031f('0x3')](_0x526a45,_0x3c0612);};}exports['register']=function(_0x4c0f94){for(var _0x56328c=0x0,_0x3dc98e=events['length'];_0x56328c<_0x3dc98e;_0x56328c++){var _0x365f59=events[_0x56328c];var _0x4300b4=createListener(_0x031f('0x4')+_0x365f59,_0x4c0f94);MailAccountEvents['on'](_0x365f59,_0x4300b4);}}; \ No newline at end of file +var _0xaa3f=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x3464a7,_0x2a8a6b){var _0x275d1f=function(_0x547dae){while(--_0x547dae){_0x3464a7['push'](_0x3464a7['shift']());}};_0x275d1f(++_0x2a8a6b);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4f7418,_0x423267){_0x4f7418=_0x4f7418-0x0;var _0x392e0b=_0xaa3f[_0x4f7418];return _0x392e0b;};'use strict';var MailAccountEvents=require(_0xfaa3('0x0'));var events=[_0xfaa3('0x1'),_0xfaa3('0x2'),_0xfaa3('0x3')];function createListener(_0x1ebbfb,_0x1da39b){return function(_0x408343){_0x1da39b[_0xfaa3('0x4')](_0x1ebbfb,_0x408343);};}function removeListener(_0x32f4e1,_0x5123a3){return function(){MailAccountEvents['removeListener'](_0x32f4e1,_0x5123a3);};}exports[_0xfaa3('0x5')]=function(_0x4bac92){for(var _0x3d09aa=0x0,_0xeecce5=events[_0xfaa3('0x6')];_0x3d09aa<_0xeecce5;_0x3d09aa++){var _0xbf270c=events[_0x3d09aa];var _0x328d5f=createListener(_0xfaa3('0x7')+_0xbf270c,_0x4bac92);MailAccountEvents['on'](_0xbf270c,_0x328d5f);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f9c507d..fa63c2e 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 _0x0972=['delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0972,0x64));var _0x2097=function(_0x39ba28,_0x1d49f3){_0x39ba28=_0x39ba28-0x0;var _0x39caca=_0x0972[_0x39ba28];return _0x39caca;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')](_0x2097('0x7'),auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0xa')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xb')]);router[_0x2097('0xc')](_0x2097('0x7'),auth[_0x2097('0x8')](),controller['destroy']);module[_0x2097('0xd')]=router; \ No newline at end of file +var _0x69d3=['express','Router','../../config/environment','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x69d3,0xda));var _0x369d=function(_0x53a2ea,_0x25e22d){_0x53a2ea=_0x53a2ea-0x0;var _0x488038=_0x69d3[_0x53a2ea];return _0x488038;};'use strict';var multer=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var path=require(_0x369d('0x2'));var timeout=require('connect-timeout');var express=require(_0x369d('0x3'));var router=express[_0x369d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x369d('0x5'));var controller=require('./mailApplication.controller');router['get'](_0x369d('0x6'),auth[_0x369d('0x7')](),controller[_0x369d('0x8')]);router[_0x369d('0x9')](_0x369d('0x6'),auth[_0x369d('0x7')](),controller[_0x369d('0xa')]);router[_0x369d('0xb')](_0x369d('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x369d('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 33925f4..72d13b1 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 _0x243d=['INTEGER','STRING','noop'];(function(_0x3cf718,_0x474b79){var _0x28e526=function(_0x43865b){while(--_0x43865b){_0x3cf718['push'](_0x3cf718['shift']());}};_0x28e526(++_0x474b79);}(_0x243d,0xc6));var _0xd243=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x243d[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd243('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xd243('0x1')],'allowNull':![],'defaultValue':_0xd243('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd243('0x1')]},'interval':{'type':Sequelize[_0xd243('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd755=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x502691,_0x21d839){var _0x2a5d07=function(_0x1f9775){while(--_0x1f9775){_0x502691['push'](_0x502691['shift']());}};_0x2a5d07(++_0x21d839);}(_0xd755,0x1e9));var _0x5d75=function(_0x529870,_0x975245){_0x529870=_0x529870-0x0;var _0x39435f=_0xd755[_0x529870];return _0x39435f;};'use strict';var Sequelize=require(_0x5d75('0x0'));module[_0x5d75('0x1')]={'priority':{'type':Sequelize[_0x5d75('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5d75('0x3')],'allowNull':![],'defaultValue':_0x5d75('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5d75('0x3')]},'interval':{'type':Sequelize[_0x5d75('0x3')],'defaultValue':_0x5d75('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index de7d6d2..0c145c0 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 _0x0748=['status','json','count','offset','limit','Content-Range','save','update','sendStatus','error','stack','name','send','params','model','keys','rawAttributes','intersection','query','fields','attributes','includeAll','include','merge','options','MailApplication','find','then','catch','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x498889,_0x547993){var _0xd6cb2d=function(_0x50b51a){while(--_0x50b51a){_0x498889['push'](_0x498889['shift']());}};_0xd6cb2d(++_0x547993);}(_0x0748,0xc7));var _0x8074=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x0748[_0xbe200f];return _0x192597;};'use strict';var pdf=require(_0x8074('0x0'));var emlformat=require(_0x8074('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8074('0x2'));var jsonpatch=require(_0x8074('0x3'));var rp=require(_0x8074('0x4'));var moment=require(_0x8074('0x5'));var BPromise=require(_0x8074('0x6'));var Mustache=require('mustache');var util=require(_0x8074('0x7'));var path=require(_0x8074('0x8'));var sox=require(_0x8074('0x9'));var csv=require('to-csv');var ejs=require(_0x8074('0xa'));var fs=require('fs');var _=require(_0x8074('0xb'));var squel=require('squel');var crypto=require(_0x8074('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8074('0xd'));var querystring=require(_0x8074('0xe'));var Papa=require(_0x8074('0xf'));var Redis=require(_0x8074('0x10'));var authService=require(_0x8074('0x11'));var qs=require(_0x8074('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8074('0x13'));var logger=require(_0x8074('0x14'))(_0x8074('0x15'));var utils=require(_0x8074('0x16'));var config=require(_0x8074('0x17'));var db=require(_0x8074('0x18'))['db'];function respondWithStatusCode(_0x596136,_0x5dba05){_0x5dba05=_0x5dba05||0xcc;return function(_0x59d9ae){if(_0x59d9ae){return _0x596136['sendStatus'](_0x5dba05);}return _0x596136[_0x8074('0x19')](_0x5dba05)['end']();};}function respondWithResult(_0x1a0eaa,_0x50a643){_0x50a643=_0x50a643||0xc8;return function(_0x15866e){if(_0x15866e){return _0x1a0eaa[_0x8074('0x19')](_0x50a643)[_0x8074('0x1a')](_0x15866e);}};}function respondWithFilteredResult(_0x36205e,_0x5574cd){return function(_0x3a24e1){if(_0x3a24e1){var _0x2e99b5=_0x3a24e1[_0x8074('0x1b')],_0x3e21ca=_0x5574cd[_0x8074('0x1c')],_0x45e157=_0x5574cd[_0x8074('0x1c')]+_0x5574cd[_0x8074('0x1d')],_0x287d48;if(_0x45e157>=_0x2e99b5){_0x45e157=_0x2e99b5;_0x287d48=0xc8;}else{_0x287d48=0xce;}_0x36205e['status'](_0x287d48);return _0x36205e['set'](_0x8074('0x1e'),_0x3e21ca+'-'+_0x45e157+'/'+_0x2e99b5)['json'](_0x3a24e1);}return null;};}function patchUpdates(_0x68de51){return function(_0x128cd0){try{jsonpatch['apply'](_0x128cd0,_0x68de51,!![]);}catch(_0x6996c8){return BPromise['reject'](_0x6996c8);}return _0x128cd0[_0x8074('0x1f')]();};}function saveUpdates(_0x302294,_0xdfa50e){return function(_0x526aaa){if(_0x526aaa){return _0x526aaa[_0x8074('0x20')](_0x302294)['then'](function(_0x5d7fb7){return _0x5d7fb7;});}return null;};}function removeEntity(_0x145d16,_0x3afbe4){return function(_0x32bbc7){if(_0x32bbc7){return _0x32bbc7['destroy']()['then'](function(){_0x145d16[_0x8074('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54c935,_0x4ababb){return function(_0x4c53a7){if(!_0x4c53a7){_0x54c935[_0x8074('0x21')](0x194);}return _0x4c53a7;};}function handleError(_0x5c0077,_0x67ca42){_0x67ca42=_0x67ca42||0x1f4;return function(_0x2b7a80){logger[_0x8074('0x22')](_0x2b7a80[_0x8074('0x23')]);if(_0x2b7a80['name']){delete _0x2b7a80[_0x8074('0x24')];}_0x5c0077[_0x8074('0x19')](_0x67ca42)[_0x8074('0x25')](_0x2b7a80);};}exports['show']=function(_0x26b80c,_0x1c3476){var _0x485ffe={'raw':!![],'where':{'id':_0x26b80c[_0x8074('0x26')]['id']}},_0x497802={};_0x497802[_0x8074('0x27')]=_[_0x8074('0x28')](db['MailApplication'][_0x8074('0x29')]);_0x497802['query']=_['keys'](_0x26b80c['query']);_0x497802['filters']=_[_0x8074('0x2a')](_0x497802['model'],_0x497802[_0x8074('0x2b')]);_0x485ffe['attributes']=_['intersection'](_0x497802[_0x8074('0x27')],qs['fields'](_0x26b80c[_0x8074('0x2b')][_0x8074('0x2c')]));_0x485ffe[_0x8074('0x2d')]=_0x485ffe[_0x8074('0x2d')]['length']?_0x485ffe[_0x8074('0x2d')]:_0x497802['model'];if(_0x26b80c[_0x8074('0x2b')][_0x8074('0x2e')]){_0x485ffe[_0x8074('0x2f')]=[{'all':!![]}];}_0x485ffe=_[_0x8074('0x30')]({},_0x485ffe,_0x26b80c[_0x8074('0x31')]);return db[_0x8074('0x32')][_0x8074('0x33')](_0x485ffe)['then'](handleEntityNotFound(_0x1c3476,null))[_0x8074('0x34')](respondWithResult(_0x1c3476,null))[_0x8074('0x35')](handleError(_0x1c3476,null));};exports[_0x8074('0x20')]=function(_0x33e893,_0x171731){if(_0x33e893[_0x8074('0x36')]['id']){delete _0x33e893[_0x8074('0x36')]['id'];}return db[_0x8074('0x32')][_0x8074('0x33')]({'where':{'id':_0x33e893['params']['id']}})[_0x8074('0x34')](handleEntityNotFound(_0x171731,null))['then'](saveUpdates(_0x33e893[_0x8074('0x36')],null))[_0x8074('0x34')](respondWithResult(_0x171731,null))[_0x8074('0x35')](handleError(_0x171731,null));};exports[_0x8074('0x37')]=function(_0x43c9ef,_0x347475){return db[_0x8074('0x32')]['find']({'where':{'id':_0x43c9ef[_0x8074('0x26')]['id']}})[_0x8074('0x34')](handleEntityNotFound(_0x347475,null))[_0x8074('0x34')](removeEntity(_0x347475,null))['catch'](handleError(_0x347475,null));}; \ No newline at end of file +var _0x38d3=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','set','Content-Range','reject','save','update','then','destroy','status','end','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x7bd372,_0x3ca8e9){var _0x3df313=function(_0x44d6c0){while(--_0x44d6c0){_0x7bd372['push'](_0x7bd372['shift']());}};_0x3df313(++_0x3ca8e9);}(_0x38d3,0x1a7));var _0x338d=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x38d3[_0x4c7fb5];return _0x2e10ac;};'use strict';var pdf=require(_0x338d('0x0'));var emlformat=require(_0x338d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x338d('0x2'));var jsonpatch=require(_0x338d('0x3'));var rp=require(_0x338d('0x4'));var moment=require(_0x338d('0x5'));var BPromise=require(_0x338d('0x6'));var Mustache=require(_0x338d('0x7'));var util=require(_0x338d('0x8'));var path=require(_0x338d('0x9'));var sox=require(_0x338d('0xa'));var csv=require('to-csv');var ejs=require(_0x338d('0xb'));var fs=require('fs');var _=require(_0x338d('0xc'));var squel=require(_0x338d('0xd'));var crypto=require(_0x338d('0xe'));var jsforce=require(_0x338d('0xf'));var deskjs=require(_0x338d('0x10'));var toCsv=require(_0x338d('0x11'));var querystring=require('querystring');var Papa=require(_0x338d('0x12'));var Redis=require(_0x338d('0x13'));var authService=require(_0x338d('0x14'));var qs=require(_0x338d('0x15'));var as=require(_0x338d('0x16'));var hardwareService=require(_0x338d('0x17'));var logger=require('../../config/logger')(_0x338d('0x18'));var utils=require(_0x338d('0x19'));var config=require(_0x338d('0x1a'));var db=require(_0x338d('0x1b'))['db'];function respondWithStatusCode(_0x20a2f3,_0x6f23c2){_0x6f23c2=_0x6f23c2||0xcc;return function(_0x3a4b99){if(_0x3a4b99){return _0x20a2f3[_0x338d('0x1c')](_0x6f23c2);}return _0x20a2f3['status'](_0x6f23c2)['end']();};}function respondWithResult(_0x4c9397,_0x1259d4){_0x1259d4=_0x1259d4||0xc8;return function(_0x1e9895){if(_0x1e9895){return _0x4c9397['status'](_0x1259d4)[_0x338d('0x1d')](_0x1e9895);}};}function respondWithFilteredResult(_0x5d42a6,_0x33b0d7){return function(_0x36b054){if(_0x36b054){var _0x366514=_0x36b054[_0x338d('0x1e')],_0x4c5e67=_0x33b0d7['offset'],_0x4d79c6=_0x33b0d7[_0x338d('0x1f')]+_0x33b0d7['limit'],_0x4c90f5;if(_0x4d79c6>=_0x366514){_0x4d79c6=_0x366514;_0x4c90f5=0xc8;}else{_0x4c90f5=0xce;}_0x5d42a6['status'](_0x4c90f5);return _0x5d42a6[_0x338d('0x20')](_0x338d('0x21'),_0x4c5e67+'-'+_0x4d79c6+'/'+_0x366514)[_0x338d('0x1d')](_0x36b054);}return null;};}function patchUpdates(_0x2c1e24){return function(_0x1ca2a0){try{jsonpatch['apply'](_0x1ca2a0,_0x2c1e24,!![]);}catch(_0x34198e){return BPromise[_0x338d('0x22')](_0x34198e);}return _0x1ca2a0[_0x338d('0x23')]();};}function saveUpdates(_0x51d50f,_0x4213b0){return function(_0x4547d1){if(_0x4547d1){return _0x4547d1[_0x338d('0x24')](_0x51d50f)[_0x338d('0x25')](function(_0x37f7bf){return _0x37f7bf;});}return null;};}function removeEntity(_0xf54afd,_0xbd099e){return function(_0x3ff406){if(_0x3ff406){return _0x3ff406[_0x338d('0x26')]()[_0x338d('0x25')](function(){_0xf54afd[_0x338d('0x27')](0xcc)[_0x338d('0x28')]();});}};}function handleEntityNotFound(_0x4e859f,_0xef4cf7){return function(_0x2a2877){if(!_0x2a2877){_0x4e859f[_0x338d('0x1c')](0x194);}return _0x2a2877;};}function handleError(_0x5dddeb,_0x583c1d){_0x583c1d=_0x583c1d||0x1f4;return function(_0x5e67d7){logger['error'](_0x5e67d7[_0x338d('0x29')]);if(_0x5e67d7[_0x338d('0x2a')]){delete _0x5e67d7[_0x338d('0x2a')];}_0x5dddeb[_0x338d('0x27')](_0x583c1d)[_0x338d('0x2b')](_0x5e67d7);};}exports[_0x338d('0x2c')]=function(_0x2e3240,_0x2e50ec){var _0x3b8fd6={'raw':!![],'where':{'id':_0x2e3240['params']['id']}},_0x2696ed={};_0x2696ed[_0x338d('0x2d')]=_[_0x338d('0x2e')](db[_0x338d('0x2f')]['rawAttributes']);_0x2696ed[_0x338d('0x30')]=_[_0x338d('0x2e')](_0x2e3240['query']);_0x2696ed[_0x338d('0x31')]=_['intersection'](_0x2696ed[_0x338d('0x2d')],_0x2696ed[_0x338d('0x30')]);_0x3b8fd6[_0x338d('0x32')]=_[_0x338d('0x33')](_0x2696ed[_0x338d('0x2d')],qs[_0x338d('0x34')](_0x2e3240['query'][_0x338d('0x34')]));_0x3b8fd6[_0x338d('0x32')]=_0x3b8fd6['attributes'][_0x338d('0x35')]?_0x3b8fd6[_0x338d('0x32')]:_0x2696ed[_0x338d('0x2d')];if(_0x2e3240[_0x338d('0x30')][_0x338d('0x36')]){_0x3b8fd6[_0x338d('0x37')]=[{'all':!![]}];}_0x3b8fd6=_[_0x338d('0x38')]({},_0x3b8fd6,_0x2e3240[_0x338d('0x39')]);return db[_0x338d('0x2f')][_0x338d('0x3a')](_0x3b8fd6)[_0x338d('0x25')](handleEntityNotFound(_0x2e50ec,null))[_0x338d('0x25')](respondWithResult(_0x2e50ec,null))[_0x338d('0x3b')](handleError(_0x2e50ec,null));};exports['update']=function(_0x595557,_0xcfb62){if(_0x595557[_0x338d('0x3c')]['id']){delete _0x595557[_0x338d('0x3c')]['id'];}return db[_0x338d('0x2f')][_0x338d('0x3a')]({'where':{'id':_0x595557['params']['id']}})['then'](handleEntityNotFound(_0xcfb62,null))[_0x338d('0x25')](saveUpdates(_0x595557['body'],null))[_0x338d('0x25')](respondWithResult(_0xcfb62,null))[_0x338d('0x3b')](handleError(_0xcfb62,null));};exports[_0x338d('0x26')]=function(_0x3b004f,_0x22a5a9){return db[_0x338d('0x2f')][_0x338d('0x3a')]({'where':{'id':_0x3b004f[_0x338d('0x3d')]['id']}})[_0x338d('0x25')](handleEntityNotFound(_0x22a5a9,null))[_0x338d('0x25')](removeEntity(_0x22a5a9,null))[_0x338d('0x3b')](handleError(_0x22a5a9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 5fe6805..7d289dc 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 _0x0624=['bluebird','request-promise','path','rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0x0624,0x141));var _0x4062=function(_0x86c946,_0x44b63b){_0x86c946=_0x86c946-0x0;var _0x210b09=_0x0624[_0x86c946];return _0x210b09;};'use strict';var _=require(_0x4062('0x0'));var util=require(_0x4062('0x1'));var logger=require(_0x4062('0x2'))('api');var moment=require(_0x4062('0x3'));var BPromise=require(_0x4062('0x4'));var rp=require(_0x4062('0x5'));var fs=require('fs');var path=require(_0x4062('0x6'));var rimraf=require(_0x4062('0x7'));var config=require(_0x4062('0x8'));var attributes=require('./mailApplication.attributes');module[_0x4062('0x9')]=function(_0x23d907,_0x16987f){return _0x23d907['define'](_0x4062('0xa'),attributes,{'tableName':_0x4062('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4062('0xc')});}; \ No newline at end of file +var _0xb799=['./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a8f95,_0x214d9f){var _0x2eedf9=function(_0x147a80){while(--_0x147a80){_0x5a8f95['push'](_0x5a8f95['shift']());}};_0x2eedf9(++_0x214d9f);}(_0xb799,0x18d));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b79('0x0'));var util=require(_0x9b79('0x1'));var logger=require(_0x9b79('0x2'))('api');var moment=require(_0x9b79('0x3'));var BPromise=require(_0x9b79('0x4'));var rp=require(_0x9b79('0x5'));var fs=require('fs');var path=require(_0x9b79('0x6'));var rimraf=require(_0x9b79('0x7'));var config=require(_0x9b79('0x8'));var attributes=require(_0x9b79('0x9'));module[_0x9b79('0xa')]=function(_0x48fb0c,_0x35b5c2){return _0x48fb0c[_0x9b79('0xb')](_0x9b79('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b79('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9eb0839..70c9ae7 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 _0x0756=['attributes','limit','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','code','MailApplication,\x20%s,\x20%s','error','message','result','UpdateMailApplication','MailApplication','update','body','options'];(function(_0x5e1954,_0x28fe51){var _0x1fadc0=function(_0x56a8d7){while(--_0x56a8d7){_0x5e1954['push'](_0x5e1954['shift']());}};_0x1fadc0(++_0x28fe51);}(_0x0756,0xb8));var _0x6075=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0756[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x6075('0x0'));var util=require(_0x6075('0x1'));var moment=require('moment');var BPromise=require(_0x6075('0x2'));var rs=require(_0x6075('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6075('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6075('0x5'))(_0x6075('0x6'));var config=require(_0x6075('0x7'));var jayson=require(_0x6075('0x8'));var client=jayson[_0x6075('0x9')][_0x6075('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcdda96,_0x4cab72,_0x543b21){return new BPromise(function(_0x340a7a,_0x3a602e){return client[_0x6075('0xb')](_0xcdda96,_0x543b21)[_0x6075('0xc')](function(_0x4a0f4c){logger['info']('MailApplication,\x20%s,\x20%s',_0x4cab72,_0x6075('0xd'));logger[_0x6075('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x4cab72,_0x6075('0xd'),JSON[_0x6075('0xf')](_0x4a0f4c));if(_0x4a0f4c['error']){if(_0x4a0f4c['error'][_0x6075('0x10')]===0x1f4){logger['error'](_0x6075('0x11'),_0x4cab72,_0x4a0f4c[_0x6075('0x12')][_0x6075('0x13')]);return _0x3a602e(_0x4a0f4c[_0x6075('0x12')][_0x6075('0x13')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x4cab72,_0x4a0f4c[_0x6075('0x12')][_0x6075('0x13')]);return _0x340a7a(_0x4a0f4c[_0x6075('0x12')][_0x6075('0x13')]);}else{logger['info'](_0x6075('0x11'),_0x4cab72,_0x6075('0xd'));_0x340a7a(_0x4a0f4c[_0x6075('0x14')][_0x6075('0x13')]);}})['catch'](function(_0xf0d1a1){logger[_0x6075('0x12')](_0x6075('0x11'),_0x4cab72,_0xf0d1a1);_0x3a602e(_0xf0d1a1);});});}exports[_0x6075('0x15')]=function(_0x521710){var _0x478d84=this;return new Promise(function(_0x2c58f5,_0x42c54a){return db[_0x6075('0x16')][_0x6075('0x17')](_0x521710[_0x6075('0x18')],{'raw':_0x521710[_0x6075('0x19')]?_0x521710[_0x6075('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x521710[_0x6075('0x19')]?_0x521710[_0x6075('0x19')]['where']||null:null,'attributes':_0x521710[_0x6075('0x19')]?_0x521710['options'][_0x6075('0x1a')]||null:null,'limit':_0x521710[_0x6075('0x19')]?_0x521710[_0x6075('0x19')][_0x6075('0x1b')]||null:null})[_0x6075('0xc')](function(_0x392810){logger[_0x6075('0x1c')]('UpdateMailApplication',_0x521710);logger['debug'](_0x6075('0x15'),_0x521710,JSON[_0x6075('0xf')](_0x392810));_0x2c58f5(_0x392810);})[_0x6075('0x1d')](function(_0x1e1a93){logger[_0x6075('0x12')](_0x6075('0x15'),_0x1e1a93[_0x6075('0x13')],_0x521710);_0x42c54a(_0x478d84['error'](0x1f4,_0x1e1a93[_0x6075('0x13')]));});});}; \ No newline at end of file +var _0xf8da=['error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0xf8da,0x123));var _0xaf8d=function(_0xf6d992,_0x376473){_0xf6d992=_0xf6d992-0x0;var _0x5605b9=_0xf8da[_0xf6d992];return _0x5605b9;};'use strict';var _=require(_0xaf8d('0x0'));var util=require(_0xaf8d('0x1'));var moment=require(_0xaf8d('0x2'));var BPromise=require(_0xaf8d('0x3'));var rs=require(_0xaf8d('0x4'));var fs=require('fs');var Redis=require(_0xaf8d('0x5'));var db=require(_0xaf8d('0x6'))['db'];var utils=require(_0xaf8d('0x7'));var logger=require(_0xaf8d('0x8'))('rpc');var config=require(_0xaf8d('0x9'));var jayson=require(_0xaf8d('0xa'));var client=jayson[_0xaf8d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdee126,_0x487c3d,_0x4b28a2){return new BPromise(function(_0x1ae9fc,_0x5db01a){return client[_0xaf8d('0xc')](_0xdee126,_0x4b28a2)[_0xaf8d('0xd')](function(_0x5bc497){logger[_0xaf8d('0xe')](_0xaf8d('0xf'),_0x487c3d,_0xaf8d('0x10'));logger[_0xaf8d('0x11')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x487c3d,_0xaf8d('0x10'),JSON[_0xaf8d('0x12')](_0x5bc497));if(_0x5bc497[_0xaf8d('0x13')]){if(_0x5bc497[_0xaf8d('0x13')][_0xaf8d('0x14')]===0x1f4){logger[_0xaf8d('0x13')]('MailApplication,\x20%s,\x20%s',_0x487c3d,_0x5bc497[_0xaf8d('0x13')][_0xaf8d('0x15')]);return _0x5db01a(_0x5bc497['error'][_0xaf8d('0x15')]);}logger[_0xaf8d('0x13')]('MailApplication,\x20%s,\x20%s',_0x487c3d,_0x5bc497['error'][_0xaf8d('0x15')]);return _0x1ae9fc(_0x5bc497['error'][_0xaf8d('0x15')]);}else{logger[_0xaf8d('0xe')](_0xaf8d('0xf'),_0x487c3d,_0xaf8d('0x10'));_0x1ae9fc(_0x5bc497[_0xaf8d('0x16')][_0xaf8d('0x15')]);}})[_0xaf8d('0x17')](function(_0x300060){logger[_0xaf8d('0x13')](_0xaf8d('0xf'),_0x487c3d,_0x300060);_0x5db01a(_0x300060);});});}exports[_0xaf8d('0x18')]=function(_0xdf0af7){var _0x2f22b=this;return new Promise(function(_0x2db9cd,_0x42d889){return db['MailApplication'][_0xaf8d('0x19')](_0xdf0af7[_0xaf8d('0x1a')],{'raw':_0xdf0af7[_0xaf8d('0x1b')]?_0xdf0af7['options'][_0xaf8d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf0af7[_0xaf8d('0x1b')]?_0xdf0af7[_0xaf8d('0x1b')][_0xaf8d('0x1d')]||null:null,'attributes':_0xdf0af7['options']?_0xdf0af7[_0xaf8d('0x1b')]['attributes']||null:null,'limit':_0xdf0af7[_0xaf8d('0x1b')]?_0xdf0af7[_0xaf8d('0x1b')][_0xaf8d('0x1e')]||null:null})[_0xaf8d('0xd')](function(_0x227c1a){logger[_0xaf8d('0xe')](_0xaf8d('0x18'),_0xdf0af7);logger[_0xaf8d('0x11')]('UpdateMailApplication',_0xdf0af7,JSON[_0xaf8d('0x12')](_0x227c1a));_0x2db9cd(_0x227c1a);})[_0xaf8d('0x17')](function(_0x8441d4){logger[_0xaf8d('0x13')]('UpdateMailApplication',_0x8441d4[_0xaf8d('0x15')],_0xdf0af7);_0x42d889(_0x2f22b[_0xaf8d('0x13')](0x1f4,_0x8441d4[_0xaf8d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d0ebe17..2a651e3 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 _0x55db=['destroy','delete','/:id/tags','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy'];(function(_0xfa716b,_0x1fa236){var _0xe946ab=function(_0x495c2e){while(--_0x495c2e){_0xfa716b['push'](_0xfa716b['shift']());}};_0xe946ab(++_0x1fa236);}(_0x55db,0x1b5));var _0xb55d=function(_0x27143d,_0x157388){_0x27143d=_0x27143d-0x0;var _0x2ab2cc=_0x55db[_0x27143d];return _0x2ab2cc;};'use strict';var multer=require('multer');var util=require(_0xb55d('0x0'));var path=require(_0xb55d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb55d('0x2'));var router=express[_0xb55d('0x3')]();var auth=require(_0xb55d('0x4'));var interaction=require(_0xb55d('0x5'));var config=require('../../config/environment');var controller=require(_0xb55d('0x6'));router['get']('/',auth[_0xb55d('0x7')](),controller[_0xb55d('0x8')]);router[_0xb55d('0x9')](_0xb55d('0xa'),auth[_0xb55d('0x7')](),controller[_0xb55d('0xb')]);router[_0xb55d('0x9')](_0xb55d('0xc'),auth[_0xb55d('0x7')](),controller[_0xb55d('0xd')]);router[_0xb55d('0x9')](_0xb55d('0xe'),auth[_0xb55d('0x7')](),controller[_0xb55d('0xf')]);router[_0xb55d('0x9')](_0xb55d('0x10'),auth[_0xb55d('0x7')](),controller[_0xb55d('0x11')]);router['post']('/',auth[_0xb55d('0x7')](),controller[_0xb55d('0x12')]);router[_0xb55d('0x13')](_0xb55d('0xe'),auth[_0xb55d('0x7')](),controller[_0xb55d('0x14')]);router['post']('/:id/tags',auth[_0xb55d('0x7')](),interaction['tracked'](_0xb55d('0x15'),_0xb55d('0x16')),controller[_0xb55d('0x17')]);router['put'](_0xb55d('0xc'),auth[_0xb55d('0x7')](),interaction[_0xb55d('0x18')]('mail',_0xb55d('0x19')),controller[_0xb55d('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xb55d('0x15'),_0xb55d('0x1b')),controller[_0xb55d('0x1c')]);router[_0xb55d('0x1d')](_0xb55d('0x1e'),auth[_0xb55d('0x7')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x7c09=['removeTags','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete'];(function(_0x184ed,_0x542f8a){var _0x4746f2=function(_0x70dc01){while(--_0x70dc01){_0x184ed['push'](_0x184ed['shift']());}};_0x4746f2(++_0x542f8a);}(_0x7c09,0x102));var _0x97c0=function(_0x36ecbc,_0x15fee1){_0x36ecbc=_0x36ecbc-0x0;var _0x1c54a4=_0x7c09[_0x36ecbc];return _0x1c54a4;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var auth=require(_0x97c0('0x4'));var interaction=require(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var controller=require(_0x97c0('0x7'));router[_0x97c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x97c0('0x9'),auth[_0x97c0('0xa')](),controller[_0x97c0('0xb')]);router[_0x97c0('0x8')](_0x97c0('0xc'),auth['isAuthenticated'](),controller[_0x97c0('0xd')]);router['get'](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller['getMessages']);router['get'](_0x97c0('0xf'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x10')]);router[_0x97c0('0x11')]('/',auth[_0x97c0('0xa')](),controller[_0x97c0('0x12')]);router[_0x97c0('0x11')](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x13')]);router[_0x97c0('0x11')](_0x97c0('0x14'),auth[_0x97c0('0xa')](),interaction['tracked'](_0x97c0('0x15'),_0x97c0('0x16')),controller[_0x97c0('0x17')]);router['put'](_0x97c0('0xc'),auth[_0x97c0('0xa')](),interaction[_0x97c0('0x18')](_0x97c0('0x15'),_0x97c0('0x19')),controller[_0x97c0('0x1a')]);router['delete'](_0x97c0('0xc'),auth[_0x97c0('0xa')](),interaction['tracked'](_0x97c0('0x15'),_0x97c0('0x1b')),controller[_0x97c0('0x1c')]);router[_0x97c0('0x1d')](_0x97c0('0x14'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x1e')]);module[_0x97c0('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 473f57b..9412eb1 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 _0x4016=['iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','out','sequelize'];(function(_0x5388b2,_0x15a377){var _0x7e028=function(_0x54ae79){while(--_0x54ae79){_0x5388b2['push'](_0x5388b2['shift']());}};_0x7e028(++_0x15a377);}(_0x4016,0x1e5));var _0x6401=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4016[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x6401('0x0'));var iconv=require(_0x6401('0x1'));module[_0x6401('0x2')]={'closed':{'type':Sequelize[_0x6401('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6401('0x4')]},'inReplyTo':{'type':Sequelize[_0x6401('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6401('0x4')]},'cc':{'type':Sequelize[_0x6401('0x5')](_0x6401('0x6'))},'subject':{'type':Sequelize[_0x6401('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6401('0x7')]},'substatus':{'type':Sequelize[_0x6401('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6401('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x6401('0x5')]('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x6401('0x6'))}}; \ No newline at end of file +var _0xdd70=['BOOLEAN','DATE','STRING','long','TEXT','ENUM','out','sequelize','iconv','exports'];(function(_0x50519e,_0x37a9f7){var _0x1dccbe=function(_0x349f28){while(--_0x349f28){_0x50519e['push'](_0x50519e['shift']());}};_0x1dccbe(++_0x37a9f7);}(_0xdd70,0x13d));var _0x0dd7=function(_0x502826,_0x1482d2){_0x502826=_0x502826-0x0;var _0x4357d9=_0xdd70[_0x502826];return _0x4357d9;};'use strict';var Sequelize=require(_0x0dd7('0x0'));var iconv=require(_0x0dd7('0x1'));module[_0x0dd7('0x2')]={'closed':{'type':Sequelize[_0x0dd7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0dd7('0x4')]},'disposition':{'type':Sequelize[_0x0dd7('0x5')]},'note':{'type':Sequelize[_0x0dd7('0x5')]},'inReplyTo':{'type':Sequelize[_0x0dd7('0x5')](0x1fe)},'to':{'type':Sequelize[_0x0dd7('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x0dd7('0x6'))},'subject':{'type':Sequelize[_0x0dd7('0x7')]()},'attach':{'type':Sequelize[_0x0dd7('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0dd7('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0dd7('0x8')]('in',_0x0dd7('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0dd7('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0dd7('0x8')]('in',_0x0dd7('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x0dd7('0x6'))},'lastMsgText':{'type':Sequelize[_0x0dd7('0x7')](_0x0dd7('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index cafdcd0..e03112d 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 _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`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?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x53b0bd,_0x4b528a){var _0xa421fc=function(_0x53666a){while(--_0x53666a){_0x53b0bd['push'](_0x53b0bd['shift']());}};_0xa421fc(++_0x4b528a);}(_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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file +var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`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?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x1f5778,_0x59a676){var _0xe02b4e=function(_0x1ad744){while(--_0x1ad744){_0x1f5778['push'](_0x1f5778['shift']());}};_0xe02b4e(++_0x59a676);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 194a22b..393abdd 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 _0x0b71=['../../mysqldb','MailMessage','save','update','setDataValue','map','findAll','then','length','catch','hasOwnProperty','exports','events'];(function(_0x5df571,_0x1d309e){var _0x7dbe84=function(_0x10ce42){while(--_0x10ce42){_0x5df571['push'](_0x5df571['shift']());}};_0x7dbe84(++_0x1d309e);}(_0x0b71,0xdc));var _0x10b7=function(_0x212721,_0x1c0edc){_0x212721=_0x212721-0x0;var _0x369f08=_0x0b71[_0x212721];return _0x369f08;};'use strict';var EventEmitter=require(_0x10b7('0x0'));var MailInteraction=require(_0x10b7('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x10b7('0x1'))['db'][_0x10b7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x10b7('0x3'),'afterUpdate':_0x10b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x19649c){return function(_0x56986d,_0xd7b7d5,_0x2a2852){_0x56986d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x9fde2d){_0x56986d[_0x10b7('0x5')]('Users',_0x9fde2d[_0x10b7('0x6')](function(_0x520e4c){return{'id':_0x520e4c['id']};}));return MailMessage[_0x10b7('0x7')]({'where':{'MailInteractionId':_0x56986d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x10b7('0x8')](function(_0x5809f7){_0x56986d[_0x10b7('0x5')]('unreadMessages',_0x5809f7[_0x10b7('0x9')]);MailInteractionEvents['emit'](_0x19649c+':'+_0x56986d['id'],_0x56986d);MailInteractionEvents['emit'](_0x19649c,_0x56986d);_0x2a2852(null);})[_0x10b7('0xa')](_0x2a2852(null));};}for(var e in events){if(events[_0x10b7('0xb')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x10b7('0xc')]=MailInteractionEvents; \ No newline at end of file +var _0x6f31=['events','../../mysqldb','setMaxListeners','save','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty','exports'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x6f31,0x1c8));var _0x16f3=function(_0x56b7da,_0x3e46f4){_0x56b7da=_0x56b7da-0x0;var _0x1d22b5=_0x6f31[_0x56b7da];return _0x1d22b5;};'use strict';var EventEmitter=require(_0x16f3('0x0'));var MailInteraction=require(_0x16f3('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x16f3('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x16f3('0x2')](0x0);var events={'afterCreate':_0x16f3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8b2af3){return function(_0x442c34,_0xbc7607,_0x1fc4ad){_0x442c34['getUsers']({'attributes':['id'],'raw':!![]})[_0x16f3('0x4')](function(_0xf33c2a){_0x442c34[_0x16f3('0x5')](_0x16f3('0x6'),_0xf33c2a['map'](function(_0x6d2376){return{'id':_0x6d2376['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x442c34['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16f3('0x4')](function(_0x18c3f2){_0x442c34[_0x16f3('0x5')](_0x16f3('0x7'),_0x18c3f2['length']);MailInteractionEvents['emit'](_0x8b2af3+':'+_0x442c34['id'],_0x442c34);MailInteractionEvents[_0x16f3('0x8')](_0x8b2af3,_0x442c34);_0x1fc4ad(null);})[_0x16f3('0x9')](_0x1fc4ad(null));};}for(var e in events){if(events[_0x16f3('0xa')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x16f3('0xb')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 672c2b7..413c359 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 _0x9957=['api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','get','MailMessage','update','lodash','util','../../config/logger'];(function(_0x495fcf,_0xdfdee){var _0x481d42=function(_0xce7157){while(--_0xce7157){_0x495fcf['push'](_0x495fcf['shift']());}};_0x481d42(++_0xdfdee);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa2e5f0,_0x3116fb,_0x18c8a3){if(_0xa2e5f0[_0x7995('0xe')]){_0xa2e5f0[_0x7995('0xf')]=moment()[_0x7995('0x10')](_0x7995('0x11'));}if(_0xa2e5f0['closed']){_0xa2e5f0[_0x7995('0x12')]=moment()[_0x7995('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x18c8a3(null,_0x3116fb);},'beforeUpdate':function(_0xb0c872,_0x2cb37a,_0x19a27e){if(_0xb0c872[_0x7995('0x13')](_0x7995('0xe'))){_0xb0c872[_0x7995('0xf')]=_0xb0c872[_0x7995('0xe')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xb0c872[_0x7995('0x13')](_0x7995('0x14'))){_0xb0c872[_0x7995('0x12')]=moment()[_0x7995('0x10')](_0x7995('0x11'));_0xb0c872[_0x7995('0xe')]=null;_0xb0c872[_0x7995('0xf')]=null;}_0x19a27e(null,_0xb0c872);},'afterUpdate':function(_0x41cbf0,_0x5377e5,_0x2eeacc){var _0x565d97=_0x137b6b[_0x7995('0x15')];var _0x37f297=_0x41cbf0[_0x7995('0x16')]({'plain':!![]});if(_0x37f297[_0x7995('0x14')]){return _0x565d97[_0x7995('0x17')][_0x7995('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x37f297['id']}})['then'](function(){_0x2eeacc();})['catch'](function(_0x2536c8){_0x2eeacc(_0x2536c8);});}else{_0x2eeacc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci'];(function(_0x1820c9,_0x2f7885){var _0x3598e9=function(_0xb43ddf){while(--_0xb43ddf){_0x1820c9['push'](_0x1820c9['shift']());}};_0x3598e9(++_0x2f7885);}(_0x34e8,0x12c));var _0x834e=function(_0x25518c,_0x10d617){_0x25518c=_0x25518c-0x0;var _0x294bda=_0x34e8[_0x25518c];return _0x294bda;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xe'),'to'],'type':_0x834e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23501c,_0x363786,_0x1af45a){if(_0x23501c[_0x834e('0x10')]){_0x23501c[_0x834e('0x11')]=moment()[_0x834e('0x12')](_0x834e('0x13'));}if(_0x23501c[_0x834e('0x14')]){_0x23501c[_0x834e('0x15')]=moment()[_0x834e('0x12')](_0x834e('0x13'));}_0x1af45a(null,_0x363786);},'beforeUpdate':function(_0x2fd95c,_0x538bb3,_0x5e5b6d){if(_0x2fd95c[_0x834e('0x16')]('substatus')){_0x2fd95c[_0x834e('0x11')]=_0x2fd95c[_0x834e('0x10')]?moment()[_0x834e('0x12')](_0x834e('0x13')):null;}if(_0x2fd95c['changed'](_0x834e('0x14'))){_0x2fd95c[_0x834e('0x15')]=moment()['format'](_0x834e('0x13'));_0x2fd95c['substatus']=null;_0x2fd95c[_0x834e('0x11')]=null;}_0x5e5b6d(null,_0x2fd95c);},'afterUpdate':function(_0x36d443,_0x478afe,_0x43ac41){var _0x22106e=_0x4a2018[_0x834e('0x17')];var _0x50b3f6=_0x36d443[_0x834e('0x18')]({'plain':!![]});if(_0x50b3f6[_0x834e('0x14')]){return _0x22106e[_0x834e('0x19')][_0x834e('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x50b3f6['id']}})[_0x834e('0x1b')](function(){_0x43ac41();})[_0x834e('0x1c')](function(_0x1dd214){_0x43ac41(_0x1dd214);});}else{_0x43ac41();}}},'charset':'utf8mb4','collate':_0x834e('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 505e26e..ea17ed2 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 _0x94d2=['attributes','limit','then','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where'];(function(_0x27a2e2,_0x320a19){var _0x340c65=function(_0x5db77c){while(--_0x5db77c){_0x27a2e2['push'](_0x27a2e2['shift']());}};_0x340c65(++_0x320a19);}(_0x94d2,0x1cd));var _0x294d=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x94d2[_0x1b02bb];return _0x131245;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x294d('0xa')],{'host':_0x294d('0xb'),'port':0x18eb});var socket=require(_0x294d('0xc'))(new Redis(config[_0x294d('0xa')]));require(_0x294d('0xd'))['register'](socket);function respondWithRpcPromise(_0x7931bb,_0x297494,_0x53d5f5){return new BPromise(function(_0x20af48,_0x18fde9){return client['request'](_0x7931bb,_0x53d5f5)['then'](function(_0x165330){logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,'request\x20sent');logger[_0x294d('0x10')](_0x294d('0x11'),_0x297494,_0x294d('0x12'),JSON[_0x294d('0x13')](_0x165330));if(_0x165330['error']){if(_0x165330[_0x294d('0x14')]['code']===0x1f4){logger['error'](_0x294d('0xf'),_0x297494,_0x165330[_0x294d('0x14')][_0x294d('0x15')]);return _0x18fde9(_0x165330[_0x294d('0x14')]['message']);}logger[_0x294d('0x14')]('MailInteraction,\x20%s,\x20%s',_0x297494,_0x165330['error']['message']);return _0x20af48(_0x165330['error'][_0x294d('0x15')]);}else{logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,_0x294d('0x12'));_0x20af48(_0x165330[_0x294d('0x16')][_0x294d('0x15')]);}})[_0x294d('0x17')](function(_0x9a7c6a){logger['error'](_0x294d('0xf'),_0x297494,_0x9a7c6a);_0x18fde9(_0x9a7c6a);});});}exports[_0x294d('0x18')]=function(_0x578e13){var _0xa9338a=this;return new Promise(function(_0x19cee1,_0x429da3){return db[_0x294d('0x19')][_0x294d('0x1a')](_0x578e13[_0x294d('0x1b')],{'raw':_0x578e13[_0x294d('0x1c')]?_0x578e13[_0x294d('0x1c')][_0x294d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x578e13[_0x294d('0x1c')]?_0x578e13[_0x294d('0x1c')][_0x294d('0x1e')]||null:null,'attributes':_0x578e13[_0x294d('0x1c')]?_0x578e13[_0x294d('0x1c')][_0x294d('0x1f')]||null:null,'limit':_0x578e13['options']?_0x578e13['options'][_0x294d('0x20')]||null:null})[_0x294d('0x21')](function(_0x10fb2e){logger[_0x294d('0xe')](_0x294d('0x18'),_0x578e13);logger[_0x294d('0x10')]('UpdateMailInteraction',_0x578e13,JSON[_0x294d('0x13')](_0x10fb2e));_0x19cee1(_0x10fb2e);})['catch'](function(_0x4670ae){logger[_0x294d('0x14')](_0x294d('0x18'),_0x4670ae[_0x294d('0x15')],_0x578e13);_0x429da3(_0xa9338a[_0x294d('0x14')](0x1f4,_0x4670ae[_0x294d('0x15')]));});});};exports[_0x294d('0x22')]=function(_0x4ad67d){return new Promise(function(_0xc15349,_0x2b2072){return db[_0x294d('0x19')][_0x294d('0x23')]({'where':_0x4ad67d[_0x294d('0x1c')]?_0x4ad67d[_0x294d('0x1c')][_0x294d('0x1e')]||null:null})[_0x294d('0x21')](function(_0x4d68ff){if(_0x4d68ff){return _0x4d68ff[_0x294d('0x24')](_0x4ad67d[_0x294d('0x1b')][_0x294d('0x25')],_[_0x294d('0x26')](_0x4ad67d['body'],['ids','id'])||{});}})[_0x294d('0x27')](function(_0x5da8f){logger[_0x294d('0xe')](_0x294d('0x28'),_0x4ad67d);logger[_0x294d('0x10')](_0x294d('0x28'),_0x4ad67d,JSON[_0x294d('0x13')](_0x5da8f));_0xc15349(_0x5da8f);})[_0x294d('0x17')](function(_0x28557a){logger['error'](_0x294d('0x28'),_0x28557a[_0x294d('0x15')],_0x4ad67d);_0x2b2072(_this[_0x294d('0x14')](0x1f4,_0x28557a['message']));});});}; \ No newline at end of file +var _0xc99a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','debug','request\x20sent','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','MailInteraction','options','raw','where','attributes','limit','info','UpdateMailInteraction','AddTagsToMailInteraction','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x4b37ca,_0x1a9858){var _0x32f5b7=function(_0x127c38){while(--_0x127c38){_0x4b37ca['push'](_0x4b37ca['shift']());}};_0x32f5b7(++_0x1a9858);}(_0xc99a,0x7c));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac99('0x0'));var util=require(_0xac99('0x1'));var moment=require(_0xac99('0x2'));var BPromise=require(_0xac99('0x3'));var rs=require(_0xac99('0x4'));var fs=require('fs');var Redis=require(_0xac99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xac99('0x6'));var logger=require(_0xac99('0x7'))(_0xac99('0x8'));var config=require(_0xac99('0x9'));var jayson=require(_0xac99('0xa'));var client=jayson[_0xac99('0xb')][_0xac99('0xc')]({'port':0x232a});config[_0xac99('0xd')]=_[_0xac99('0xe')](config[_0xac99('0xd')],{'host':_0xac99('0xf'),'port':0x18eb});var socket=require(_0xac99('0x10'))(new Redis(config['redis']));require(_0xac99('0x11'))[_0xac99('0x12')](socket);function respondWithRpcPromise(_0x4d60a9,_0x400b24,_0x8c503){return new BPromise(function(_0x140e6d,_0x34f665){return client['request'](_0x4d60a9,_0x8c503)[_0xac99('0x13')](function(_0x2b675d){logger['info']('MailInteraction,\x20%s,\x20%s',_0x400b24,'request\x20sent');logger[_0xac99('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x400b24,_0xac99('0x15'),JSON[_0xac99('0x16')](_0x2b675d));if(_0x2b675d[_0xac99('0x17')]){if(_0x2b675d[_0xac99('0x17')][_0xac99('0x18')]===0x1f4){logger[_0xac99('0x17')]('MailInteraction,\x20%s,\x20%s',_0x400b24,_0x2b675d[_0xac99('0x17')]['message']);return _0x34f665(_0x2b675d['error'][_0xac99('0x19')]);}logger[_0xac99('0x17')]('MailInteraction,\x20%s,\x20%s',_0x400b24,_0x2b675d[_0xac99('0x17')][_0xac99('0x19')]);return _0x140e6d(_0x2b675d[_0xac99('0x17')]['message']);}else{logger['info'](_0xac99('0x1a'),_0x400b24,_0xac99('0x15'));_0x140e6d(_0x2b675d[_0xac99('0x1b')][_0xac99('0x19')]);}})[_0xac99('0x1c')](function(_0xd5fb9e){logger[_0xac99('0x17')]('MailInteraction,\x20%s,\x20%s',_0x400b24,_0xd5fb9e);_0x34f665(_0xd5fb9e);});});}exports['UpdateMailInteraction']=function(_0x2e65cd){var _0xa28347=this;return new Promise(function(_0x4ecd83,_0x1cb8fc){return db[_0xac99('0x1d')]['update'](_0x2e65cd['body'],{'raw':_0x2e65cd[_0xac99('0x1e')]?_0x2e65cd[_0xac99('0x1e')][_0xac99('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e65cd[_0xac99('0x1e')]?_0x2e65cd[_0xac99('0x1e')][_0xac99('0x20')]||null:null,'attributes':_0x2e65cd[_0xac99('0x1e')]?_0x2e65cd[_0xac99('0x1e')][_0xac99('0x21')]||null:null,'limit':_0x2e65cd['options']?_0x2e65cd[_0xac99('0x1e')][_0xac99('0x22')]||null:null})[_0xac99('0x13')](function(_0x2791e0){logger[_0xac99('0x23')](_0xac99('0x24'),_0x2e65cd);logger['debug'](_0xac99('0x24'),_0x2e65cd,JSON[_0xac99('0x16')](_0x2791e0));_0x4ecd83(_0x2791e0);})[_0xac99('0x1c')](function(_0x33b0d9){logger['error'](_0xac99('0x24'),_0x33b0d9['message'],_0x2e65cd);_0x1cb8fc(_0xa28347[_0xac99('0x17')](0x1f4,_0x33b0d9[_0xac99('0x19')]));});});};exports[_0xac99('0x25')]=function(_0x597063){return new Promise(function(_0x4d2d79,_0x353630){return db['MailInteraction']['find']({'where':_0x597063[_0xac99('0x1e')]?_0x597063[_0xac99('0x1e')]['where']||null:null})['then'](function(_0x5e8923){if(_0x5e8923){return _0x5e8923['addTags'](_0x597063[_0xac99('0x26')][_0xac99('0x27')],_[_0xac99('0x28')](_0x597063['body'],['ids','id'])||{});}})[_0xac99('0x29')](function(_0x3b6cee){logger['info'](_0xac99('0x2a'),_0x597063);logger[_0xac99('0x14')](_0xac99('0x2a'),_0x597063,JSON[_0xac99('0x16')](_0x3b6cee));_0x4d2d79(_0x3b6cee);})[_0xac99('0x1c')](function(_0x68cbf7){logger[_0xac99('0x17')](_0xac99('0x2a'),_0x68cbf7['message'],_0x597063);_0x353630(_this[_0xac99('0x17')](0x1f4,_0x68cbf7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1df2cdb..07efedc 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 _0x1100=['mailInteraction:','save','remove','update','emit','removeListener','length'];(function(_0x4b9669,_0x229723){var _0x5de66a=function(_0x151b58){while(--_0x151b58){_0x4b9669['push'](_0x4b9669['shift']());}};_0x5de66a(++_0x229723);}(_0x1100,0x166));var _0x0110=function(_0x34b052,_0x2270be){_0x34b052=_0x34b052-0x0;var _0x25ccf3=_0x1100[_0x34b052];return _0x25ccf3;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x0110('0x0'),_0x0110('0x1'),_0x0110('0x2')];function createListener(_0x931378,_0x2b7b2f){return function(_0xab0820){_0x2b7b2f[_0x0110('0x3')](_0x931378,_0xab0820);};}function removeListener(_0x5cd92e,_0x56ba05){return function(){MailInteractionEvents[_0x0110('0x4')](_0x5cd92e,_0x56ba05);};}exports['register']=function(_0x5de2ba){for(var _0x27ffe7=0x0,_0x48375b=events[_0x0110('0x5')];_0x27ffe7<_0x48375b;_0x27ffe7++){var _0x6b182c=events[_0x27ffe7];var _0x42bd84=createListener(_0x0110('0x6')+_0x6b182c,_0x5de2ba);MailInteractionEvents['on'](_0x6b182c,_0x42bd84);}}; \ No newline at end of file +var _0x667c=['register','length','mailInteraction:','remove','emit','removeListener'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x667c,0xc9));var _0xc667=function(_0xaceb00,_0x127f7b){_0xaceb00=_0xaceb00-0x0;var _0x104bfa=_0x667c[_0xaceb00];return _0x104bfa;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xc667('0x0'),'update'];function createListener(_0x9c53fe,_0x4af4af){return function(_0xba0c5f){_0x4af4af[_0xc667('0x1')](_0x9c53fe,_0xba0c5f);};}function removeListener(_0x325168,_0x229ede){return function(){MailInteractionEvents[_0xc667('0x2')](_0x325168,_0x229ede);};}exports[_0xc667('0x3')]=function(_0x22b6d3){for(var _0x2689ee=0x0,_0x21b2ed=events[_0xc667('0x4')];_0x2689ee<_0x21b2ed;_0x2689ee++){var _0x208cfa=events[_0x2689ee];var _0x57e817=createListener(_0xc667('0x5')+_0x208cfa,_0x22b6d3);MailInteractionEvents['on'](_0x208cfa,_0x57e817);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c43e036..edd5743 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(_0x54d4be,_0x35ae6e){var _0x131067=function(_0x4502be){while(--_0x4502be){_0x54d4be['push'](_0x54d4be['shift']());}};_0x131067(++_0x35ae6e);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x92cc3e,_0x3a682f){_0x92cc3e=_0x92cc3e-0x0;var _0x3c5f02=_0xd6d6[_0x92cc3e];return _0x3c5f02;};'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 _0x7217=['mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail'];(function(_0x8b7a70,_0x48b455){var _0x3aaebe=function(_0x5af519){while(--_0x5af519){_0x8b7a70['push'](_0x8b7a70['shift']());}};_0x3aaebe(++_0x48b455);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0x7')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller['download']);router[_0x7721('0xf')]('/',auth[_0x7721('0x8')](),interaction[_0x7721('0x10')](_0x7721('0x11'),_0x7721('0x12')),controller[_0x7721('0x13')]);router[_0x7721('0x14')](_0x7721('0xc'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x14')]('/:id/accept',auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);router[_0x7721('0x14')](_0x7721('0x17'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router[_0x7721('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7721('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b2ade5a..180df6b 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 _0xb7e2=['out','STRING','TEXT','DATE','INTEGER','BOOLEAN','sequelize','exports','long','medium','ENUM'];(function(_0x3fb780,_0x540d09){var _0x49bcf4=function(_0x122b11){while(--_0x122b11){_0x3fb780['push'](_0x3fb780['shift']());}};_0x49bcf4(++_0x540d09);}(_0xb7e2,0x103));var _0x2b7e=function(_0x325bb1,_0x2913d8){_0x325bb1=_0x325bb1-0x0;var _0x5b2ee4=_0xb7e2[_0x325bb1];return _0x5b2ee4;};'use strict';var Sequelize=require(_0x2b7e('0x0'));var _=require('lodash');module[_0x2b7e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2b7e('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2b7e('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b7e('0x4')]('in',_0x2b7e('0x5')),'defaultValue':_0x2b7e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2b7e('0x6')](0x1fe)},'from':{'type':Sequelize[_0x2b7e('0x6')]},'to':{'type':Sequelize[_0x2b7e('0x7')]('long')},'cc':{'type':Sequelize[_0x2b7e('0x7')](_0x2b7e('0x2'))},'bcc':{'type':Sequelize[_0x2b7e('0x7')]('long')},'subject':{'type':Sequelize[_0x2b7e('0x7')]},'sentAt':{'type':Sequelize[_0x2b7e('0x8')]},'attach':{'type':Sequelize[_0x2b7e('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2b7e('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2b7e('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x2b7e('0x7')](_0x2b7e('0x2'))}}; \ No newline at end of file +var _0xf0f4=['long','TEXT','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','lodash'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xf0f4,0x182));var _0x4f0f=function(_0x497287,_0x11d321){_0x497287=_0x497287-0x0;var _0x6764a1=_0xf0f4[_0x497287];return _0x6764a1;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4f0f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4f0f('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4f0f('0x2')]('medium')},'read':{'type':Sequelize[_0x4f0f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f0f('0x4')]('in',_0x4f0f('0x5')),'defaultValue':_0x4f0f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4f0f('0x6')](0x1fe)},'from':{'type':Sequelize[_0x4f0f('0x6')]},'to':{'type':Sequelize[_0x4f0f('0x2')]('long')},'cc':{'type':Sequelize[_0x4f0f('0x2')](_0x4f0f('0x1'))},'bcc':{'type':Sequelize[_0x4f0f('0x2')]('long')},'subject':{'type':Sequelize[_0x4f0f('0x2')]},'sentAt':{'type':Sequelize[_0x4f0f('0x7')]},'attach':{'type':Sequelize[_0x4f0f('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4f0f('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4f0f('0x7')]},'originTo':{'type':Sequelize[_0x4f0f('0x2')](_0x4f0f('0x1'))},'originCc':{'type':Sequelize[_0x4f0f('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 eea2f2f..696b7b3 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 _0x1e6c=['end','name','send','map','MailMessage','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','describe','create','out','secret','split','findOne','MailAccountId','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','UserId','Contact','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','mail-interactions','agent','role','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','headers','existsSync','push','readFileSync','writeFileSync','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1e6c,0x11a));var _0xc1e6=function(_0xf394a,_0x20d1dd){_0xf394a=_0xf394a-0x0;var _0xde580f=_0x1e6c[_0xf394a];return _0xde580f;};'use strict';var pdf=require(_0xc1e6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc1e6('0x1'));var zipdir=require(_0xc1e6('0x2'));var jsonpatch=require(_0xc1e6('0x3'));var rp=require(_0xc1e6('0x4'));var moment=require(_0xc1e6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc1e6('0x6'));var path=require(_0xc1e6('0x7'));var sox=require(_0xc1e6('0x8'));var csv=require(_0xc1e6('0x9'));var ejs=require(_0xc1e6('0xa'));var fs=require('fs');var _=require(_0xc1e6('0xb'));var squel=require(_0xc1e6('0xc'));var crypto=require('crypto');var jsforce=require(_0xc1e6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc1e6('0x9'));var querystring=require('querystring');var Papa=require(_0xc1e6('0xe'));var Redis=require(_0xc1e6('0xf'));var authService=require(_0xc1e6('0x10'));var qs=require(_0xc1e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1e6('0x12'))(_0xc1e6('0x13'));var utils=require(_0xc1e6('0x14'));var config=require('../../config/environment');var db=require(_0xc1e6('0x15'))['db'];config[_0xc1e6('0x16')]=_[_0xc1e6('0x17')](config[_0xc1e6('0x16')],{'host':_0xc1e6('0x18'),'port':0x18eb});var socket=require(_0xc1e6('0x19'))(new Redis(config[_0xc1e6('0x16')]));require(_0xc1e6('0x1a'))[_0xc1e6('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc1e6('0x1c')][_0xc1e6('0x1d')]({'port':0x232c});var client9003=jayson[_0xc1e6('0x1c')][_0xc1e6('0x1d')]({'port':0x232b});var client9002=jayson[_0xc1e6('0x1c')][_0xc1e6('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xb850be,_0x2ee6cf,_0x32dc7a){if(_0x32dc7a){var _0x3f975c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f975c['test'](_0x2ee6cf)){return _0xb850be;}else{throw new db[(_0xc1e6('0x1e'))][(_0xc1e6('0x1f'))](_0xc1e6('0x20'));}}else{return _0xb850be;}}function respondWithRpcPromise(_0x2864a6,_0x5d9dc4,_0x5adebf,_0x50240d){return new BPromise(function(_0x149205,_0x1b9e95){var _0x2515ef=_0x50240d||client;return _0x2515ef[_0xc1e6('0x21')](_0x2864a6,_0x5adebf)[_0xc1e6('0x22')](function(_0x1b4983){logger[_0xc1e6('0x23')]('MailMessage,\x20%s,\x20%s',_0x5d9dc4,_0xc1e6('0x24'));logger['debug'](_0xc1e6('0x25'),_0x5d9dc4,_0xc1e6('0x24'),JSON['stringify'](_0x1b4983));if(_0x1b4983['error']){if(_0x1b4983[_0xc1e6('0x26')][_0xc1e6('0x27')]===0x1f4){logger[_0xc1e6('0x26')](_0xc1e6('0x28'),_0x5d9dc4,_0x1b4983[_0xc1e6('0x26')]['message']);return _0x1b9e95(_0x1b4983[_0xc1e6('0x26')][_0xc1e6('0x29')]);}logger[_0xc1e6('0x26')](_0xc1e6('0x28'),_0x5d9dc4,_0x1b4983[_0xc1e6('0x26')]['message']);return _0x149205(_0x1b4983[_0xc1e6('0x26')][_0xc1e6('0x29')]);}else{logger[_0xc1e6('0x23')](_0xc1e6('0x28'),_0x5d9dc4,_0xc1e6('0x24'));_0x149205(_0x1b4983['result'][_0xc1e6('0x29')]);}})['catch'](function(_0x9a2272){logger['error'](_0xc1e6('0x28'),_0x5d9dc4,_0x9a2272);_0x1b9e95(_0x9a2272);});});}function respondWithStatusCode(_0x5d4adc,_0x8c8fb9){_0x8c8fb9=_0x8c8fb9||0xcc;return function(_0x48f9f3){if(_0x48f9f3){return _0x5d4adc[_0xc1e6('0x2a')](_0x8c8fb9);}return _0x5d4adc[_0xc1e6('0x2b')](_0x8c8fb9)['end']();};}function respondWithResult(_0x29f894,_0x4d503a){_0x4d503a=_0x4d503a||0xc8;return function(_0x43a9da){if(_0x43a9da){return _0x29f894['status'](_0x4d503a)[_0xc1e6('0x2c')](_0x43a9da);}};}function respondWithFilteredResult(_0x26a8ca,_0x12a815){return function(_0x485d99){if(_0x485d99){var _0x2d4d24=_0x485d99[_0xc1e6('0x2d')],_0x123d98=_0x12a815[_0xc1e6('0x2e')],_0x15d0db=_0x12a815['offset']+_0x12a815[_0xc1e6('0x2f')],_0x454aaf;if(_0x15d0db>=_0x2d4d24){_0x15d0db=_0x2d4d24;_0x454aaf=0xc8;}else{_0x454aaf=0xce;}_0x26a8ca[_0xc1e6('0x2b')](_0x454aaf);return _0x26a8ca['set'](_0xc1e6('0x30'),_0x123d98+'-'+_0x15d0db+'/'+_0x2d4d24)['json'](_0x485d99);}return null;};}function patchUpdates(_0x3b8c86){return function(_0x25ed48){try{jsonpatch[_0xc1e6('0x31')](_0x25ed48,_0x3b8c86,!![]);}catch(_0x4bce33){return BPromise[_0xc1e6('0x32')](_0x4bce33);}return _0x25ed48[_0xc1e6('0x33')]();};}function saveUpdates(_0x22c379,_0xe7af73){return function(_0x26c81a){if(_0x26c81a){return _0x26c81a[_0xc1e6('0x34')](_0x22c379)[_0xc1e6('0x22')](function(_0x4e24fe){return _0x4e24fe;});}return null;};}function removeEntity(_0x307e82,_0x51c773){return function(_0x122149){if(_0x122149){return _0x122149[_0xc1e6('0x35')]()['then'](function(){_0x307e82[_0xc1e6('0x2b')](0xcc)[_0xc1e6('0x36')]();});}};}function handleEntityNotFound(_0x34f526,_0x13d65e){return function(_0x2d1a47){if(!_0x2d1a47){_0x34f526[_0xc1e6('0x2a')](0x194);}return _0x2d1a47;};}function handleError(_0x5258c4,_0x477e1c){_0x477e1c=_0x477e1c||0x1f4;return function(_0x2fb8ae){logger[_0xc1e6('0x26')](_0x2fb8ae['stack']);if(_0x2fb8ae[_0xc1e6('0x37')]){delete _0x2fb8ae['name'];}_0x5258c4[_0xc1e6('0x2b')](_0x477e1c)[_0xc1e6('0x38')](_0x2fb8ae);};}exports['index']=function(_0x48d192,_0x82c3cb){var _0x1f897f={},_0x174de9={},_0x36b5a9={'count':0x0,'rows':[]};var _0x3c188d=_[_0xc1e6('0x39')](db[_0xc1e6('0x3a')][_0xc1e6('0x3b')],function(_0x4843a8){return{'name':_0x4843a8[_0xc1e6('0x3c')],'type':_0x4843a8['type']['key']};});_0x174de9[_0xc1e6('0x3d')]=_[_0xc1e6('0x39')](_0x3c188d,_0xc1e6('0x37'));_0x174de9['query']=_['keys'](_0x48d192[_0xc1e6('0x3e')]);_0x174de9[_0xc1e6('0x3f')]=_['intersection'](_0x174de9['model'],_0x174de9[_0xc1e6('0x3e')]);_0x1f897f[_0xc1e6('0x40')]=_[_0xc1e6('0x41')](_0x174de9[_0xc1e6('0x3d')],qs['fields'](_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x42')]));_0x1f897f[_0xc1e6('0x40')]=_0x1f897f['attributes'][_0xc1e6('0x43')]?_0x1f897f[_0xc1e6('0x40')]:_0x174de9[_0xc1e6('0x3d')];if(!_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x44')](_0xc1e6('0x45'))){_0x1f897f['limit']=qs[_0xc1e6('0x2f')](_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x2f')]);_0x1f897f[_0xc1e6('0x2e')]=qs[_0xc1e6('0x2e')](_0x48d192['query'][_0xc1e6('0x2e')]);}_0x1f897f[_0xc1e6('0x46')]=qs[_0xc1e6('0x47')](_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x47')]);_0x1f897f[_0xc1e6('0x48')]=qs[_0xc1e6('0x3f')](_[_0xc1e6('0x49')](_0x48d192['query'],_0x174de9[_0xc1e6('0x3f')]),_0x3c188d);if(_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x4a')]){_0x1f897f[_0xc1e6('0x48')]=_[_0xc1e6('0x4b')](_0x1f897f['where'],{'$or':_['map'](_0x3c188d,function(_0x562ec7){if(_0x562ec7[_0xc1e6('0x4c')]!=='VIRTUAL'){var _0x41d535={};_0x41d535[_0x562ec7[_0xc1e6('0x37')]]={'$like':'%'+_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x4a')]+'%'};return _0x41d535;}})});}_0x1f897f=_[_0xc1e6('0x4b')]({},_0x1f897f,_0x48d192[_0xc1e6('0x4d')]);var _0xc53145={'where':_0x1f897f[_0xc1e6('0x48')]};return db['MailMessage'][_0xc1e6('0x2d')](_0xc53145)[_0xc1e6('0x22')](function(_0x2583b6){_0x36b5a9[_0xc1e6('0x2d')]=_0x2583b6;if(_0x48d192[_0xc1e6('0x3e')][_0xc1e6('0x4e')]){_0x1f897f[_0xc1e6('0x4f')]=[{'all':!![]}];}return db[_0xc1e6('0x3a')][_0xc1e6('0x50')](_0x1f897f);})['then'](function(_0x1de344){_0x36b5a9[_0xc1e6('0x51')]=_0x1de344;return _0x36b5a9;})[_0xc1e6('0x22')](respondWithFilteredResult(_0x82c3cb,_0x1f897f))[_0xc1e6('0x52')](handleError(_0x82c3cb,null));};exports[_0xc1e6('0x53')]=function(_0x393436,_0x368335){var _0x4f7ce4={'raw':!![],'where':{'id':_0x393436[_0xc1e6('0x54')]['id']}},_0x23fd84={};_0x23fd84[_0xc1e6('0x3d')]=_[_0xc1e6('0x55')](db[_0xc1e6('0x3a')]['rawAttributes']);_0x23fd84[_0xc1e6('0x3e')]=_[_0xc1e6('0x55')](_0x393436[_0xc1e6('0x3e')]);_0x23fd84[_0xc1e6('0x3f')]=_[_0xc1e6('0x41')](_0x23fd84['model'],_0x23fd84['query']);_0x4f7ce4['attributes']=_['intersection'](_0x23fd84[_0xc1e6('0x3d')],qs[_0xc1e6('0x42')](_0x393436['query'][_0xc1e6('0x42')]));_0x4f7ce4['attributes']=_0x4f7ce4['attributes'][_0xc1e6('0x43')]?_0x4f7ce4[_0xc1e6('0x40')]:_0x23fd84[_0xc1e6('0x3d')];if(_0x393436['query'][_0xc1e6('0x4e')]){_0x4f7ce4['include']=[{'all':!![]}];}_0x4f7ce4=_[_0xc1e6('0x4b')]({},_0x4f7ce4,_0x393436[_0xc1e6('0x4d')]);return db[_0xc1e6('0x3a')][_0xc1e6('0x56')](_0x4f7ce4)[_0xc1e6('0x22')](handleEntityNotFound(_0x368335,null))[_0xc1e6('0x22')](respondWithResult(_0x368335,null))[_0xc1e6('0x52')](handleError(_0x368335,null));};exports[_0xc1e6('0x34')]=function(_0x29400e,_0x2de3c3){if(_0x29400e[_0xc1e6('0x57')]['id']){delete _0x29400e[_0xc1e6('0x57')]['id'];}return db[_0xc1e6('0x3a')][_0xc1e6('0x56')]({'where':{'id':_0x29400e[_0xc1e6('0x54')]['id']}})[_0xc1e6('0x22')](handleEntityNotFound(_0x2de3c3,null))['then'](saveUpdates(_0x29400e[_0xc1e6('0x57')],null))['then'](respondWithResult(_0x2de3c3,null))[_0xc1e6('0x52')](handleError(_0x2de3c3,null));};exports[_0xc1e6('0x35')]=function(_0x2e5a7b,_0x311efc){return db[_0xc1e6('0x3a')][_0xc1e6('0x56')]({'where':{'id':_0x2e5a7b['params']['id']}})[_0xc1e6('0x22')](handleEntityNotFound(_0x311efc,null))[_0xc1e6('0x22')](removeEntity(_0x311efc,null))[_0xc1e6('0x52')](handleError(_0x311efc,null));};exports[_0xc1e6('0x58')]=function(_0x18bf2b,_0x4abc9f){return db['MailMessage'][_0xc1e6('0x58')]()['then'](respondWithResult(_0x4abc9f,null))[_0xc1e6('0x52')](handleError(_0x4abc9f,null));};exports[_0xc1e6('0x59')]=function(_0x26ef77,_0x1b9063){return db[_0xc1e6('0x3a')]['create'](_0x26ef77[_0xc1e6('0x57')])[_0xc1e6('0x22')](function(_0x609c06){if(_0x609c06){if(_0x609c06['direction']===_0xc1e6('0x5a')&&!_0x609c06[_0xc1e6('0x5b')]){var _0x6c558e,_0x32114e,_0x2fbe5a;if(_0x26ef77['body']['to']){_0x32114e=_0x26ef77[_0xc1e6('0x57')]['to'][_0xc1e6('0x5c')](',')[0x0];}return db['MailAccount'][_0xc1e6('0x5d')]({'where':{'id':_0x609c06[_0xc1e6('0x5e')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc1e6('0x5f')],'as':_0xc1e6('0x60'),'where':{'email':_0x32114e},'limit':0x1,'order':[[_0xc1e6('0x61'),_0xc1e6('0x62')]]}]},{'model':db[_0xc1e6('0x63')],'as':_0xc1e6('0x64'),'raw':!![]}]})[_0xc1e6('0x22')](function(_0x36c8c7){_0x6c558e=_0x36c8c7;if(_0x6c558e&&_0x6c558e['Smtp']){var _0x1fd8ca={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x65')])){_0x1fd8ca['host']=_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x66')];_0x1fd8ca[_0xc1e6('0x67')]=_0x6c558e['Smtp']['port'];_0x1fd8ca['secure']=_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x68')];if(_0x6c558e['Smtp'][_0xc1e6('0x69')]){_0x1fd8ca[_0xc1e6('0x6a')]={'user':_0x6c558e['Smtp'][_0xc1e6('0x6b')],'pass':_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x6c')]};}}else{_0x1fd8ca[_0xc1e6('0x65')]=_0x6c558e[_0xc1e6('0x64')]['service'];_0x1fd8ca[_0xc1e6('0x6a')]={'user':_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x6b')],'pass':_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x6c')]};_0x1fd8ca['secure']=_0x6c558e[_0xc1e6('0x64')][_0xc1e6('0x68')];}if(_0x26ef77[_0xc1e6('0x57')]['attachments']&&_0x26ef77[_0xc1e6('0x57')][_0xc1e6('0x6d')][_0xc1e6('0x43')]){for(var _0xefb261=0x0;_0xefb261<_0x26ef77[_0xc1e6('0x57')][_0xc1e6('0x6d')][_0xc1e6('0x43')];_0xefb261+=0x1){_0x26ef77[_0xc1e6('0x57')]['attachments'][_0xefb261]={'filename':_0x26ef77[_0xc1e6('0x57')]['attachments'][_0xefb261][_0xc1e6('0x37')],'path':path[_0xc1e6('0x6e')](config[_0xc1e6('0x6f')],_0xc1e6('0x70'),_0x26ef77['body'][_0xc1e6('0x6d')][_0xefb261][_0xc1e6('0x71')])};}}_0x2fbe5a={'account':_0x1fd8ca,'message':_0x26ef77['body']};return;}})[_0xc1e6('0x22')](function(){if(_0x6c558e[_0xc1e6('0x72')]){if(_0x6c558e['List']['Contacts'][_0xc1e6('0x43')]){return _0x6c558e[_0xc1e6('0x72')][_0xc1e6('0x60')][0x0];}else{return db[_0xc1e6('0x5f')][_0xc1e6('0x59')](_[_0xc1e6('0x17')](_0x26ef77[_0xc1e6('0x57')],{'firstName':_0x26ef77[_0xc1e6('0x57')]['to'],'email':_0x26ef77[_0xc1e6('0x57')]['to'],'phone':_0x26ef77[_0xc1e6('0x57')]['to'],'ListId':_0x6c558e['ListId']}));}}else{throw new Error(_0xc1e6('0x73'));}})[_0xc1e6('0x22')](function(){if(_0x2fbe5a){return respondWithRpcPromise(_0xc1e6('0x74'),_0xc1e6('0x75'),_0x2fbe5a,client9003)[_0xc1e6('0x22')](function(_0x45da8e){return _0x609c06[_0xc1e6('0x34')]({'read':!![],'messageId':_0x45da8e[_0xc1e6('0x76')],'sentAt':moment()[_0xc1e6('0x77')](_0xc1e6('0x78'))});})[_0xc1e6('0x52')](function(_0x3c2a28){logger[_0xc1e6('0x26')]('%s',JSON[_0xc1e6('0x79')](_0x3c2a28));return _0x609c06;});}return _0x609c06;});}return _0x609c06;}})[_0xc1e6('0x22')](respondWithResult(_0x1b9063,0xc9))[_0xc1e6('0x52')](handleError(_0x1b9063,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports['accept']=function(_0x3c9a5f,_0xd4fb19,_0x1657ce){var _0x4a7b2f={'channel':_0xc1e6('0x7a')};if(_0x3c9a5f[_0xc1e6('0x57')]['id']){delete _0x3c9a5f['body']['id'];}_0x3c9a5f[_0xc1e6('0x57')][_0xc1e6('0x7b')]=!![];_0x3c9a5f[_0xc1e6('0x57')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3c9a5f['body'][_0xc1e6('0x7c')]=_0x3c9a5f[_0xc1e6('0x57')][_0xc1e6('0x7c')]||_0x3c9a5f[_0xc1e6('0x6b')]['id'];return db[_0xc1e6('0x3a')]['find']({'where':{'id':_0x3c9a5f[_0xc1e6('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xc1e6('0x5f')],'as':_0xc1e6('0x7d')}]})[_0xc1e6('0x22')](handleEntityNotFound(_0xd4fb19,null))[_0xc1e6('0x22')](saveUpdates(_0x3c9a5f[_0xc1e6('0x57')],null))[_0xc1e6('0x22')](function(_0xa9e176){if(_0xa9e176){_0x4a7b2f[_0xc1e6('0x29')]=_0xa9e176[_0xc1e6('0x7e')]({'plain':!![]});return db[_0xc1e6('0x7f')][_0xc1e6('0x56')]({'where':{'id':_0xa9e176[_0xc1e6('0x80')]}});}return null;})[_0xc1e6('0x22')](handleEntityNotFound(_0xd4fb19,null))[_0xc1e6('0x22')](function(_0x1383dd){if(_0x1383dd){return _0x1383dd[_0xc1e6('0x34')]({'UserId':_0x3c9a5f[_0xc1e6('0x57')]['UserId'],'read1stAt':_[_0xc1e6('0x81')](_0x1383dd['read1stAt'])?moment()['format'](_0xc1e6('0x78')):undefined});}return null;})[_0xc1e6('0x22')](function(_0x4bae49){if(_0x4bae49){_0x4a7b2f[_0xc1e6('0x82')]=_0x4bae49[_0xc1e6('0x7e')]({'plain':!![]});interaction_log[_0xc1e6('0x23')](_0xc1e6('0x83'),_0x3c9a5f[_0xc1e6('0x6b')]['id'],_0x3c9a5f[_0xc1e6('0x6b')][_0xc1e6('0x37')],_0x3c9a5f['user']['role'],_0x4a7b2f['interaction']['id'],_0x3c9a5f[_0xc1e6('0x57')]?JSON[_0xc1e6('0x79')](_0x3c9a5f[_0xc1e6('0x57')]):_0xc1e6('0x84'));return respondWithRpcPromise(_0xc1e6('0x85'),_0xc1e6('0x86'),_0x4a7b2f);}return null;})[_0xc1e6('0x22')](function(_0x13333d){if(_0x13333d){if(_0x3c9a5f[_0xc1e6('0x57')][_0xc1e6('0x87')]){_0x4a7b2f['message'][_0xc1e6('0x88')]=util[_0xc1e6('0x77')](_0xc1e6('0x89'),_0x3c9a5f[_0xc1e6('0x6b')][_0xc1e6('0x37')]);_0x4a7b2f[_0xc1e6('0x29')][_0xc1e6('0x8a')]=_0x4a7b2f[_0xc1e6('0x8a')];_0x4a7b2f[_0xc1e6('0x29')][_0xc1e6('0x8b')]=_0xc1e6('0x8c');return respondWithRpcPromise(_0xc1e6('0x8d'),_0xc1e6('0x8d'),{'event':'acceptmessage','message':_0x4a7b2f['message']},client9002)[_0xc1e6('0x22')](function(){return _0x4a7b2f;});}return _0x4a7b2f;}return null;})[_0xc1e6('0x22')](respondWithResult(_0xd4fb19,null))[_0xc1e6('0x52')](handleError(_0xd4fb19,null));};var interaction_log=require(_0xc1e6('0x12'))(_0xc1e6('0x8e'));exports[_0xc1e6('0x32')]=function(_0x1c3f06,_0x3aa69a,_0x4f8fe4){var _0x1650da={'agent':{},'channel':'mail'};if(_0x1c3f06[_0xc1e6('0x57')]['id']){delete _0x1c3f06['body']['id'];}_0x1c3f06[_0xc1e6('0x57')][_0xc1e6('0x7c')]=_0x1c3f06[_0xc1e6('0x57')][_0xc1e6('0x7c')]||_0x1c3f06[_0xc1e6('0x6b')]['id'];_0x1650da[_0xc1e6('0x8f')]['id']=_0x1c3f06['body'][_0xc1e6('0x7c')];return db[_0xc1e6('0x3a')][_0xc1e6('0x56')]({'where':{'id':_0x1c3f06['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3aa69a,null))[_0xc1e6('0x22')](function(_0x3935d3){if(_0x3935d3){_0x1650da['message']=_0x3935d3[_0xc1e6('0x7e')]({'plain':!![]});return db[_0xc1e6('0x7f')][_0xc1e6('0x56')]({'where':{'id':_0x3935d3['MailInteractionId']}});}return null;})[_0xc1e6('0x22')](handleEntityNotFound(_0x3aa69a,null))[_0xc1e6('0x22')](function(_0x3a3164){if(_0x3a3164){_0x1650da['interaction']=_0x3a3164[_0xc1e6('0x7e')]({'plain':!![]});interaction_log[_0xc1e6('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c3f06[_0xc1e6('0x6b')]['id'],_0x1c3f06[_0xc1e6('0x6b')]['name'],_0x1c3f06[_0xc1e6('0x6b')][_0xc1e6('0x90')],_0x1650da['interaction']['id'],_0x1c3f06['body']?JSON[_0xc1e6('0x79')](_0x1c3f06['body']):_0xc1e6('0x84'));return respondWithRpcPromise(_0xc1e6('0x91'),_0xc1e6('0x92'),_0x1650da);}return null;})[_0xc1e6('0x22')](function(_0x1e07ea){if(_0x1e07ea){_0x1e07ea[_0xc1e6('0x29')]['interface']=util[_0xc1e6('0x77')]('SIP/%s',_0x1c3f06['user'][_0xc1e6('0x37')]);_0x1e07ea['message'][_0xc1e6('0x8a')]=_0x1650da[_0xc1e6('0x8a')];_0x1e07ea[_0xc1e6('0x29')]['event']='reject';respondWithRpcPromise(_0xc1e6('0x8d'),_0xc1e6('0x8d'),{'event':_0xc1e6('0x93'),'message':_0x1e07ea[_0xc1e6('0x29')]},client9002);return _0x1650da;}return null;})[_0xc1e6('0x22')](respondWithResult(_0x3aa69a,null))[_0xc1e6('0x52')](handleError(_0x3aa69a,null));};exports[_0xc1e6('0x94')]=function(_0x2a1e21,_0x26950c){var _0x21afa9=moment()[_0xc1e6('0x95')]()[_0xc1e6('0x96')]();var _0x51bf5b=path[_0xc1e6('0x6e')](config[_0xc1e6('0x6f')],_0xc1e6('0x97'),_0xc1e6('0x98'),_0xc1e6('0x99'));var _0x551d46=path[_0xc1e6('0x6e')](config[_0xc1e6('0x6f')],'server',_0xc1e6('0x98'),'attachments');var _0x4f8f05=util[_0xc1e6('0x77')](_0xc1e6('0x9a'),_0x21afa9);return db['MailMessage'][_0xc1e6('0x56')]({'where':{'id':_0x2a1e21['params']['id']},'attributes':['id',_0xc1e6('0x57'),_0xc1e6('0x9b'),'to','cc',_0xc1e6('0x9c'),_0xc1e6('0x9d'),_0xc1e6('0x9e')],'include':_0x2a1e21[_0xc1e6('0x3e')][_0xc1e6('0x6d')]?[{'model':db[_0xc1e6('0x9f')],'as':_0xc1e6('0xa0')}]:undefined})[_0xc1e6('0x22')](handleEntityNotFound(_0x26950c,null))[_0xc1e6('0x22')](function(_0x20a6db){if(_0x20a6db){var _0x5ba11e=_0x20a6db;var _0x5a266c={'from':_0x5ba11e[_0xc1e6('0x9b')],'to':_0x5ba11e['to'],'subject':_0x5ba11e[_0xc1e6('0x9d')],'html':_0x5ba11e['body'],'headers':{'Date':moment(_0x5ba11e['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x20a6db['cc']){_0x5a266c[_0xc1e6('0xa1')]['Cc']=_0x20a6db['cc'];}if(_0x20a6db['bcc']){_0x5a266c[_0xc1e6('0xa1')]['Bcc']=_0x20a6db[_0xc1e6('0x9c')];}return new BPromise(function(_0x5ce7be,_0x3bf907){if(_0x20a6db[_0xc1e6('0xa0')]){for(var _0xb00638=0x0;_0xb00638<_0x20a6db[_0xc1e6('0xa0')]['length'];_0xb00638++){var _0x1ea7dc=_0x20a6db[_0xc1e6('0xa0')][_0xb00638];var _0xde0837=path[_0xc1e6('0x6e')](_0x551d46,_0x1ea7dc[_0xc1e6('0x71')]);if(fs[_0xc1e6('0xa2')](_0xde0837)){_0x5a266c[_0xc1e6('0x6d')][_0xc1e6('0xa3')]({'name':_0x1ea7dc['name'],'contentType':_0x1ea7dc[_0xc1e6('0x4c')],'data':fs[_0xc1e6('0xa4')](_0xde0837)});}}}emlformat['build'](_0x5a266c,function(_0x2e8f25,_0xb9589a){if(_0x2e8f25)return _0x3bf907(_0x2e8f25);fs[_0xc1e6('0xa5')](path[_0xc1e6('0x6e')](_0x51bf5b,_0x4f8f05),_0xb9589a);return _0x5ce7be(_0xb9589a);});});}})[_0xc1e6('0x22')](function(_0x3712ab){if(_0x3712ab){return _0x26950c['download'](path[_0xc1e6('0x6e')](_0x51bf5b,_0x4f8f05),_0x4f8f05,function(_0x5f3ac8){if(_0x5f3ac8){console[_0xc1e6('0xa6')]('err',_0x5f3ac8);}else{fs[_0xc1e6('0xa7')](path['join'](_0x51bf5b,_0x4f8f05));}});}})[_0xc1e6('0x52')](handleError(_0x26950c,null));}; \ No newline at end of file +var _0xe181=['filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','body','find','describe','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','user','pass','auth','attachments','root','server/files/attachments','basename','List','Contacts','create','List\x20not\x20found','SendMail','sendMail','update','messageId','format','mail-interactions','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','from','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','defaults','socket.io-emitter','./mailMessage.socket','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','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','destroy','name','MailMessage','rawAttributes','fieldName','key','map','keys','query','attributes','intersection','model','fields','length','nolimit','order','sort','where'];(function(_0x2335e6,_0x1bade8){var _0x370a50=function(_0x12d7cf){while(--_0x12d7cf){_0x2335e6['push'](_0x2335e6['shift']());}};_0x370a50(++_0x1bade8);}(_0xe181,0x68));var _0x1e18=function(_0x367577,_0x3c0484){_0x367577=_0x367577-0x0;var _0x1865c6=_0xe181[_0x367577];return _0x1865c6;};'use strict';var pdf=require(_0x1e18('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1e18('0x1'));var zipdir=require(_0x1e18('0x2'));var jsonpatch=require(_0x1e18('0x3'));var rp=require(_0x1e18('0x4'));var moment=require(_0x1e18('0x5'));var BPromise=require(_0x1e18('0x6'));var Mustache=require(_0x1e18('0x7'));var util=require('util');var path=require(_0x1e18('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1e18('0x9'));var fs=require('fs');var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var db=require(_0x1e18('0x19'))['db'];config[_0x1e18('0x1a')]=_[_0x1e18('0x1b')](config[_0x1e18('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e18('0x1c'))(new Redis(config['redis']));require(_0x1e18('0x1d'))['register'](socket);var jayson=require(_0x1e18('0x1e'));var client=jayson[_0x1e18('0x1f')][_0x1e18('0x20')]({'port':0x232c});var client9003=jayson[_0x1e18('0x1f')][_0x1e18('0x20')]({'port':0x232b});var client9002=jayson[_0x1e18('0x1f')][_0x1e18('0x20')]({'port':0x232a});function checkPasswordPattern(_0x33fea1,_0x134863,_0x3f5f61){if(_0x3f5f61){var _0x12ef98=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12ef98[_0x1e18('0x21')](_0x134863)){return _0x33fea1;}else{throw new db[(_0x1e18('0x22'))][(_0x1e18('0x23'))](_0x1e18('0x24'));}}else{return _0x33fea1;}}function respondWithRpcPromise(_0x5b2888,_0x1c91d2,_0x17f558,_0xea095a){return new BPromise(function(_0x16fa70,_0x2834ee){var _0x25ee60=_0xea095a||client;return _0x25ee60[_0x1e18('0x25')](_0x5b2888,_0x17f558)[_0x1e18('0x26')](function(_0x2e849d){logger[_0x1e18('0x27')](_0x1e18('0x28'),_0x1c91d2,_0x1e18('0x29'));logger[_0x1e18('0x2a')](_0x1e18('0x2b'),_0x1c91d2,_0x1e18('0x29'),JSON[_0x1e18('0x2c')](_0x2e849d));if(_0x2e849d[_0x1e18('0x2d')]){if(_0x2e849d['error'][_0x1e18('0x2e')]===0x1f4){logger[_0x1e18('0x2d')](_0x1e18('0x28'),_0x1c91d2,_0x2e849d['error'][_0x1e18('0x2f')]);return _0x2834ee(_0x2e849d[_0x1e18('0x2d')][_0x1e18('0x2f')]);}logger[_0x1e18('0x2d')]('MailMessage,\x20%s,\x20%s',_0x1c91d2,_0x2e849d['error'][_0x1e18('0x2f')]);return _0x16fa70(_0x2e849d['error']['message']);}else{logger['info'](_0x1e18('0x28'),_0x1c91d2,_0x1e18('0x29'));_0x16fa70(_0x2e849d[_0x1e18('0x30')][_0x1e18('0x2f')]);}})[_0x1e18('0x31')](function(_0x38fca8){logger[_0x1e18('0x2d')](_0x1e18('0x28'),_0x1c91d2,_0x38fca8);_0x2834ee(_0x38fca8);});});}function respondWithStatusCode(_0xa0f951,_0x193e7b){_0x193e7b=_0x193e7b||0xcc;return function(_0x1015a3){if(_0x1015a3){return _0xa0f951[_0x1e18('0x32')](_0x193e7b);}return _0xa0f951[_0x1e18('0x33')](_0x193e7b)[_0x1e18('0x34')]();};}function respondWithResult(_0x558d01,_0x57000b){_0x57000b=_0x57000b||0xc8;return function(_0x562170){if(_0x562170){return _0x558d01[_0x1e18('0x33')](_0x57000b)[_0x1e18('0x35')](_0x562170);}};}function respondWithFilteredResult(_0x1f75cd,_0x230bb1){return function(_0x2828dc){if(_0x2828dc){var _0x93dd11=_0x2828dc[_0x1e18('0x36')],_0x2d47c8=_0x230bb1[_0x1e18('0x37')],_0x799f2=_0x230bb1['offset']+_0x230bb1[_0x1e18('0x38')],_0x541b5e;if(_0x799f2>=_0x93dd11){_0x799f2=_0x93dd11;_0x541b5e=0xc8;}else{_0x541b5e=0xce;}_0x1f75cd[_0x1e18('0x33')](_0x541b5e);return _0x1f75cd[_0x1e18('0x39')]('Content-Range',_0x2d47c8+'-'+_0x799f2+'/'+_0x93dd11)[_0x1e18('0x35')](_0x2828dc);}return null;};}function patchUpdates(_0x5597ab){return function(_0x53a239){try{jsonpatch['apply'](_0x53a239,_0x5597ab,!![]);}catch(_0xa4fe9e){return BPromise['reject'](_0xa4fe9e);}return _0x53a239[_0x1e18('0x3a')]();};}function saveUpdates(_0x3733d5,_0x3b7556){return function(_0x5c7d0f){if(_0x5c7d0f){return _0x5c7d0f['update'](_0x3733d5)[_0x1e18('0x26')](function(_0x3a7779){return _0x3a7779;});}return null;};}function removeEntity(_0x1dea56,_0x24eecf){return function(_0x28ef51){if(_0x28ef51){return _0x28ef51[_0x1e18('0x3b')]()[_0x1e18('0x26')](function(){_0x1dea56[_0x1e18('0x33')](0xcc)[_0x1e18('0x34')]();});}};}function handleEntityNotFound(_0xe1d2e2,_0x33e134){return function(_0x142a17){if(!_0x142a17){_0xe1d2e2['sendStatus'](0x194);}return _0x142a17;};}function handleError(_0x51d59f,_0x3a007e){_0x3a007e=_0x3a007e||0x1f4;return function(_0x267213){logger[_0x1e18('0x2d')](_0x267213['stack']);if(_0x267213[_0x1e18('0x3c')]){delete _0x267213['name'];}_0x51d59f[_0x1e18('0x33')](_0x3a007e)['send'](_0x267213);};}exports['index']=function(_0x3e8641,_0x11e13d){var _0x32db86={},_0x206b44={},_0x248485={'count':0x0,'rows':[]};var _0x39e504=_['map'](db[_0x1e18('0x3d')][_0x1e18('0x3e')],function(_0x395868){return{'name':_0x395868[_0x1e18('0x3f')],'type':_0x395868['type'][_0x1e18('0x40')]};});_0x206b44['model']=_[_0x1e18('0x41')](_0x39e504,_0x1e18('0x3c'));_0x206b44['query']=_[_0x1e18('0x42')](_0x3e8641[_0x1e18('0x43')]);_0x206b44['filters']=_['intersection'](_0x206b44['model'],_0x206b44[_0x1e18('0x43')]);_0x32db86[_0x1e18('0x44')]=_[_0x1e18('0x45')](_0x206b44[_0x1e18('0x46')],qs[_0x1e18('0x47')](_0x3e8641[_0x1e18('0x43')][_0x1e18('0x47')]));_0x32db86[_0x1e18('0x44')]=_0x32db86[_0x1e18('0x44')][_0x1e18('0x48')]?_0x32db86[_0x1e18('0x44')]:_0x206b44['model'];if(!_0x3e8641[_0x1e18('0x43')]['hasOwnProperty'](_0x1e18('0x49'))){_0x32db86[_0x1e18('0x38')]=qs['limit'](_0x3e8641['query']['limit']);_0x32db86[_0x1e18('0x37')]=qs[_0x1e18('0x37')](_0x3e8641['query'][_0x1e18('0x37')]);}_0x32db86[_0x1e18('0x4a')]=qs['sort'](_0x3e8641['query'][_0x1e18('0x4b')]);_0x32db86[_0x1e18('0x4c')]=qs[_0x1e18('0x4d')](_[_0x1e18('0x4e')](_0x3e8641[_0x1e18('0x43')],_0x206b44[_0x1e18('0x4d')]),_0x39e504);if(_0x3e8641[_0x1e18('0x43')][_0x1e18('0x4f')]){_0x32db86[_0x1e18('0x4c')]=_[_0x1e18('0x50')](_0x32db86['where'],{'$or':_['map'](_0x39e504,function(_0x3d1850){if(_0x3d1850[_0x1e18('0x51')]!==_0x1e18('0x52')){var _0x2a692c={};_0x2a692c[_0x3d1850[_0x1e18('0x3c')]]={'$like':'%'+_0x3e8641[_0x1e18('0x43')][_0x1e18('0x4f')]+'%'};return _0x2a692c;}})});}_0x32db86=_['merge']({},_0x32db86,_0x3e8641['options']);var _0x54cd71={'where':_0x32db86[_0x1e18('0x4c')]};return db[_0x1e18('0x3d')][_0x1e18('0x36')](_0x54cd71)[_0x1e18('0x26')](function(_0x3e5418){_0x248485[_0x1e18('0x36')]=_0x3e5418;if(_0x3e8641[_0x1e18('0x43')][_0x1e18('0x53')]){_0x32db86[_0x1e18('0x54')]=[{'all':!![]}];}return db[_0x1e18('0x3d')][_0x1e18('0x55')](_0x32db86);})[_0x1e18('0x26')](function(_0x46f264){_0x248485[_0x1e18('0x56')]=_0x46f264;return _0x248485;})[_0x1e18('0x26')](respondWithFilteredResult(_0x11e13d,_0x32db86))[_0x1e18('0x31')](handleError(_0x11e13d,null));};exports[_0x1e18('0x57')]=function(_0x1540f4,_0x56e30b){var _0x11d573={'raw':!![],'where':{'id':_0x1540f4[_0x1e18('0x58')]['id']}},_0x5d4cbb={};_0x5d4cbb[_0x1e18('0x46')]=_[_0x1e18('0x42')](db[_0x1e18('0x3d')][_0x1e18('0x3e')]);_0x5d4cbb['query']=_['keys'](_0x1540f4[_0x1e18('0x43')]);_0x5d4cbb[_0x1e18('0x4d')]=_['intersection'](_0x5d4cbb[_0x1e18('0x46')],_0x5d4cbb[_0x1e18('0x43')]);_0x11d573[_0x1e18('0x44')]=_['intersection'](_0x5d4cbb[_0x1e18('0x46')],qs[_0x1e18('0x47')](_0x1540f4[_0x1e18('0x43')][_0x1e18('0x47')]));_0x11d573[_0x1e18('0x44')]=_0x11d573['attributes'][_0x1e18('0x48')]?_0x11d573['attributes']:_0x5d4cbb['model'];if(_0x1540f4[_0x1e18('0x43')][_0x1e18('0x53')]){_0x11d573[_0x1e18('0x54')]=[{'all':!![]}];}_0x11d573=_[_0x1e18('0x50')]({},_0x11d573,_0x1540f4[_0x1e18('0x59')]);return db[_0x1e18('0x3d')]['find'](_0x11d573)[_0x1e18('0x26')](handleEntityNotFound(_0x56e30b,null))[_0x1e18('0x26')](respondWithResult(_0x56e30b,null))[_0x1e18('0x31')](handleError(_0x56e30b,null));};exports['update']=function(_0x2a8c69,_0x939d13){if(_0x2a8c69['body']['id']){delete _0x2a8c69[_0x1e18('0x5a')]['id'];}return db['MailMessage'][_0x1e18('0x5b')]({'where':{'id':_0x2a8c69[_0x1e18('0x58')]['id']}})[_0x1e18('0x26')](handleEntityNotFound(_0x939d13,null))[_0x1e18('0x26')](saveUpdates(_0x2a8c69[_0x1e18('0x5a')],null))[_0x1e18('0x26')](respondWithResult(_0x939d13,null))[_0x1e18('0x31')](handleError(_0x939d13,null));};exports[_0x1e18('0x3b')]=function(_0x567d8f,_0x3ab3b8){return db[_0x1e18('0x3d')]['find']({'where':{'id':_0x567d8f[_0x1e18('0x58')]['id']}})['then'](handleEntityNotFound(_0x3ab3b8,null))['then'](removeEntity(_0x3ab3b8,null))[_0x1e18('0x31')](handleError(_0x3ab3b8,null));};exports[_0x1e18('0x5c')]=function(_0x426a33,_0xf272cb){return db['MailMessage'][_0x1e18('0x5c')]()[_0x1e18('0x26')](respondWithResult(_0xf272cb,null))[_0x1e18('0x31')](handleError(_0xf272cb,null));};exports['create']=function(_0x48bcc3,_0x19590a){return db['MailMessage']['create'](_0x48bcc3[_0x1e18('0x5a')])[_0x1e18('0x26')](function(_0x16b888){if(_0x16b888){if(_0x16b888[_0x1e18('0x5d')]===_0x1e18('0x5e')&&!_0x16b888[_0x1e18('0x5f')]){var _0x164780,_0x154cb9,_0x25cc15;if(_0x48bcc3[_0x1e18('0x5a')]['to']){_0x154cb9=_0x48bcc3[_0x1e18('0x5a')]['to'][_0x1e18('0x60')](',')[0x0];}return db[_0x1e18('0x61')][_0x1e18('0x62')]({'where':{'id':_0x16b888[_0x1e18('0x63')]},'include':[{'model':db[_0x1e18('0x64')],'as':'List','include':[{'model':db[_0x1e18('0x65')],'as':'Contacts','where':{'email':_0x154cb9},'limit':0x1,'order':[[_0x1e18('0x66'),_0x1e18('0x67')]]}]},{'model':db[_0x1e18('0x68')],'as':_0x1e18('0x69'),'raw':!![]}]})['then'](function(_0x404ac4){_0x164780=_0x404ac4;if(_0x164780&&_0x164780['Smtp']){var _0x57a472={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x164780['Smtp'][_0x1e18('0x6a')])){_0x57a472[_0x1e18('0x6b')]=_0x164780[_0x1e18('0x69')][_0x1e18('0x6b')];_0x57a472[_0x1e18('0x6c')]=_0x164780[_0x1e18('0x69')][_0x1e18('0x6c')];_0x57a472['secure']=_0x164780[_0x1e18('0x69')][_0x1e18('0x6d')];if(_0x164780[_0x1e18('0x69')]['authentication']){_0x57a472['auth']={'user':_0x164780['Smtp'][_0x1e18('0x6e')],'pass':_0x164780[_0x1e18('0x69')][_0x1e18('0x6f')]};}}else{_0x57a472['service']=_0x164780[_0x1e18('0x69')][_0x1e18('0x6a')];_0x57a472[_0x1e18('0x70')]={'user':_0x164780[_0x1e18('0x69')]['user'],'pass':_0x164780[_0x1e18('0x69')]['pass']};_0x57a472[_0x1e18('0x6d')]=_0x164780[_0x1e18('0x69')]['secure'];}if(_0x48bcc3[_0x1e18('0x5a')][_0x1e18('0x71')]&&_0x48bcc3[_0x1e18('0x5a')][_0x1e18('0x71')][_0x1e18('0x48')]){for(var _0x22d89c=0x0;_0x22d89c<_0x48bcc3[_0x1e18('0x5a')][_0x1e18('0x71')][_0x1e18('0x48')];_0x22d89c+=0x1){_0x48bcc3[_0x1e18('0x5a')]['attachments'][_0x22d89c]={'filename':_0x48bcc3['body'][_0x1e18('0x71')][_0x22d89c]['name'],'path':path['join'](config[_0x1e18('0x72')],_0x1e18('0x73'),_0x48bcc3[_0x1e18('0x5a')][_0x1e18('0x71')][_0x22d89c][_0x1e18('0x74')])};}}_0x25cc15={'account':_0x57a472,'message':_0x48bcc3['body']};return;}})[_0x1e18('0x26')](function(){if(_0x164780[_0x1e18('0x75')]){if(_0x164780[_0x1e18('0x75')]['Contacts'][_0x1e18('0x48')]){return _0x164780[_0x1e18('0x75')][_0x1e18('0x76')][0x0];}else{return db[_0x1e18('0x65')][_0x1e18('0x77')](_['defaults'](_0x48bcc3[_0x1e18('0x5a')],{'firstName':_0x48bcc3[_0x1e18('0x5a')]['to'],'email':_0x48bcc3[_0x1e18('0x5a')]['to'],'phone':_0x48bcc3[_0x1e18('0x5a')]['to'],'ListId':_0x164780['ListId']}));}}else{throw new Error(_0x1e18('0x78'));}})[_0x1e18('0x26')](function(){if(_0x25cc15){return respondWithRpcPromise(_0x1e18('0x79'),_0x1e18('0x7a'),_0x25cc15,client9003)[_0x1e18('0x26')](function(_0x3b0870){return _0x16b888[_0x1e18('0x7b')]({'read':!![],'messageId':_0x3b0870[_0x1e18('0x7c')],'sentAt':moment()[_0x1e18('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1e18('0x31')](function(_0x261626){logger[_0x1e18('0x2d')]('%s',JSON['stringify'](_0x261626));return _0x16b888;});}return _0x16b888;});}return _0x16b888;}})[_0x1e18('0x26')](respondWithResult(_0x19590a,0xc9))[_0x1e18('0x31')](handleError(_0x19590a,null));};var interaction_log=require('../../config/logger')(_0x1e18('0x7e'));exports['accept']=function(_0x2866be,_0x509e67,_0x15e099){var _0xb3f2bd={'channel':_0x1e18('0x7f')};if(_0x2866be['body']['id']){delete _0x2866be[_0x1e18('0x5a')]['id'];}_0x2866be[_0x1e18('0x5a')][_0x1e18('0x80')]=!![];_0x2866be['body'][_0x1e18('0x81')]=moment()[_0x1e18('0x7d')](_0x1e18('0x82'));_0x2866be[_0x1e18('0x5a')][_0x1e18('0x83')]=_0x2866be[_0x1e18('0x5a')]['UserId']||_0x2866be[_0x1e18('0x6e')]['id'];return db[_0x1e18('0x3d')][_0x1e18('0x5b')]({'where':{'id':_0x2866be[_0x1e18('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x1e18('0x65')],'as':_0x1e18('0x84')}]})[_0x1e18('0x26')](handleEntityNotFound(_0x509e67,null))[_0x1e18('0x26')](saveUpdates(_0x2866be[_0x1e18('0x5a')],null))[_0x1e18('0x26')](function(_0x221683){if(_0x221683){_0xb3f2bd[_0x1e18('0x2f')]=_0x221683[_0x1e18('0x85')]({'plain':!![]});return db['MailInteraction'][_0x1e18('0x5b')]({'where':{'id':_0x221683[_0x1e18('0x86')]}});}return null;})[_0x1e18('0x26')](handleEntityNotFound(_0x509e67,null))[_0x1e18('0x26')](function(_0x3c4670){if(_0x3c4670){return _0x3c4670[_0x1e18('0x7b')]({'UserId':_0x2866be[_0x1e18('0x5a')][_0x1e18('0x83')],'read1stAt':_[_0x1e18('0x87')](_0x3c4670[_0x1e18('0x88')])?moment()[_0x1e18('0x7d')](_0x1e18('0x82')):undefined});}return null;})['then'](function(_0x29fc56){if(_0x29fc56){_0xb3f2bd[_0x1e18('0x89')]=_0x29fc56['get']({'plain':!![]});interaction_log[_0x1e18('0x27')](_0x1e18('0x8a'),_0x2866be['user']['id'],_0x2866be[_0x1e18('0x6e')][_0x1e18('0x3c')],_0x2866be[_0x1e18('0x6e')]['role'],_0xb3f2bd[_0x1e18('0x89')]['id'],_0x2866be[_0x1e18('0x5a')]?JSON[_0x1e18('0x2c')](_0x2866be[_0x1e18('0x5a')]):_0x1e18('0x8b'));return respondWithRpcPromise(_0x1e18('0x8c'),_0x1e18('0x8d'),_0xb3f2bd);}return null;})[_0x1e18('0x26')](function(_0x2c3d3b){if(_0x2c3d3b){if(_0x2866be[_0x1e18('0x5a')][_0x1e18('0x8e')]){_0xb3f2bd[_0x1e18('0x2f')][_0x1e18('0x8f')]=util[_0x1e18('0x7d')]('SIP/%s',_0x2866be[_0x1e18('0x6e')]['name']);_0xb3f2bd[_0x1e18('0x2f')][_0x1e18('0x90')]=_0xb3f2bd[_0x1e18('0x90')];_0xb3f2bd['message'][_0x1e18('0x91')]=_0x1e18('0x92');return respondWithRpcPromise(_0x1e18('0x93'),_0x1e18('0x93'),{'event':_0x1e18('0x94'),'message':_0xb3f2bd['message']},client9002)[_0x1e18('0x26')](function(){return _0xb3f2bd;});}return _0xb3f2bd;}return null;})[_0x1e18('0x26')](respondWithResult(_0x509e67,null))[_0x1e18('0x31')](handleError(_0x509e67,null));};var interaction_log=require(_0x1e18('0x15'))('mail-interactions');exports[_0x1e18('0x95')]=function(_0x4a7015,_0x44bd99,_0x278cae){var _0x379dcf={'agent':{},'channel':_0x1e18('0x7f')};if(_0x4a7015['body']['id']){delete _0x4a7015['body']['id'];}_0x4a7015['body']['UserId']=_0x4a7015[_0x1e18('0x5a')][_0x1e18('0x83')]||_0x4a7015[_0x1e18('0x6e')]['id'];_0x379dcf['agent']['id']=_0x4a7015[_0x1e18('0x5a')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x4a7015[_0x1e18('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44bd99,null))['then'](function(_0x33c4bf){if(_0x33c4bf){_0x379dcf[_0x1e18('0x2f')]=_0x33c4bf[_0x1e18('0x85')]({'plain':!![]});return db[_0x1e18('0x96')][_0x1e18('0x5b')]({'where':{'id':_0x33c4bf[_0x1e18('0x86')]}});}return null;})[_0x1e18('0x26')](handleEntityNotFound(_0x44bd99,null))[_0x1e18('0x26')](function(_0x5a79e6){if(_0x5a79e6){_0x379dcf[_0x1e18('0x89')]=_0x5a79e6[_0x1e18('0x85')]({'plain':!![]});interaction_log[_0x1e18('0x27')](_0x1e18('0x97'),_0x4a7015[_0x1e18('0x6e')]['id'],_0x4a7015[_0x1e18('0x6e')]['name'],_0x4a7015[_0x1e18('0x6e')][_0x1e18('0x98')],_0x379dcf[_0x1e18('0x89')]['id'],_0x4a7015[_0x1e18('0x5a')]?JSON[_0x1e18('0x2c')](_0x4a7015[_0x1e18('0x5a')]):_0x1e18('0x8b'));return respondWithRpcPromise(_0x1e18('0x99'),_0x1e18('0x9a'),_0x379dcf);}return null;})[_0x1e18('0x26')](function(_0x31d491){if(_0x31d491){_0x31d491[_0x1e18('0x2f')]['interface']=util['format'](_0x1e18('0x9b'),_0x4a7015[_0x1e18('0x6e')][_0x1e18('0x3c')]);_0x31d491[_0x1e18('0x2f')][_0x1e18('0x90')]=_0x379dcf[_0x1e18('0x90')];_0x31d491[_0x1e18('0x2f')][_0x1e18('0x91')]=_0x1e18('0x95');respondWithRpcPromise(_0x1e18('0x93'),'EventManager',{'event':_0x1e18('0x9c'),'message':_0x31d491[_0x1e18('0x2f')]},client9002);return _0x379dcf;}return null;})[_0x1e18('0x26')](respondWithResult(_0x44bd99,null))[_0x1e18('0x31')](handleError(_0x44bd99,null));};exports[_0x1e18('0x9d')]=function(_0x10b4ad,_0x12fb2f){var _0x2fe625=moment()[_0x1e18('0x9e')]()[_0x1e18('0x9f')]();var _0x37e4f0=path[_0x1e18('0xa0')](config[_0x1e18('0x72')],_0x1e18('0xa1'),_0x1e18('0xa2'),_0x1e18('0xa3'));var _0x4659f1=path[_0x1e18('0xa0')](config[_0x1e18('0x72')],_0x1e18('0xa1'),'files',_0x1e18('0x71'));var _0x15bb32=util['format'](_0x1e18('0xa4'),_0x2fe625);return db[_0x1e18('0x3d')][_0x1e18('0x5b')]({'where':{'id':_0x10b4ad['params']['id']},'attributes':['id',_0x1e18('0x5a'),'from','to','cc',_0x1e18('0xa5'),'subject',_0x1e18('0xa6')],'include':_0x10b4ad['query'][_0x1e18('0x71')]?[{'model':db[_0x1e18('0xa7')],'as':'Attachments'}]:undefined})[_0x1e18('0x26')](handleEntityNotFound(_0x12fb2f,null))['then'](function(_0x5a877a){if(_0x5a877a){var _0x173bf1=_0x5a877a;var _0x57d3b9={'from':_0x173bf1[_0x1e18('0xa8')],'to':_0x173bf1['to'],'subject':_0x173bf1[_0x1e18('0xa9')],'html':_0x173bf1[_0x1e18('0x5a')],'headers':{'Date':moment(_0x173bf1[_0x1e18('0xa6')])[_0x1e18('0x7d')](_0x1e18('0xaa'))},'attachments':[]};if(_0x5a877a['cc']){_0x57d3b9[_0x1e18('0xab')]['Cc']=_0x5a877a['cc'];}if(_0x5a877a[_0x1e18('0xa5')]){_0x57d3b9[_0x1e18('0xab')][_0x1e18('0xac')]=_0x5a877a[_0x1e18('0xa5')];}return new BPromise(function(_0x12fcfe,_0x9d417e){if(_0x5a877a[_0x1e18('0xad')]){for(var _0x4f1e4=0x0;_0x4f1e4<_0x5a877a[_0x1e18('0xad')]['length'];_0x4f1e4++){var _0x4cf7d0=_0x5a877a[_0x1e18('0xad')][_0x4f1e4];var _0x311179=path[_0x1e18('0xa0')](_0x4659f1,_0x4cf7d0[_0x1e18('0x74')]);if(fs[_0x1e18('0xae')](_0x311179)){_0x57d3b9[_0x1e18('0x71')][_0x1e18('0xaf')]({'name':_0x4cf7d0[_0x1e18('0x3c')],'contentType':_0x4cf7d0[_0x1e18('0x51')],'data':fs[_0x1e18('0xb0')](_0x311179)});}}}emlformat[_0x1e18('0xb1')](_0x57d3b9,function(_0x2152df,_0x49d600){if(_0x2152df)return _0x9d417e(_0x2152df);fs[_0x1e18('0xb2')](path['join'](_0x37e4f0,_0x15bb32),_0x49d600);return _0x12fcfe(_0x49d600);});});}})[_0x1e18('0x26')](function(_0x3d8a1b){if(_0x3d8a1b){return _0x12fb2f['download'](path[_0x1e18('0xa0')](_0x37e4f0,_0x15bb32),_0x15bb32,function(_0x45074f){if(_0x45074f){console[_0x1e18('0xb3')]('err',_0x45074f);}else{fs[_0x1e18('0xb4')](path[_0x1e18('0xa0')](_0x37e4f0,_0x15bb32));}});}})[_0x1e18('0x31')](handleError(_0x12fb2f,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 84d72a1..6befefd 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 _0xccc9=['emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove'];(function(_0x43390f,_0xe82743){var _0x1b5924=function(_0x142e86){while(--_0x142e86){_0x43390f['push'](_0x43390f['shift']());}};_0x1b5924(++_0xe82743);}(_0xccc9,0xff));var _0x9ccc=function(_0x3d75fa,_0x23dd66){_0x3d75fa=_0x3d75fa-0x0;var _0xe23aad=_0xccc9[_0x3d75fa];return _0xe23aad;};'use strict';var EventEmitter=require(_0x9ccc('0x0'));var MailMessage=require(_0x9ccc('0x1'))['db'][_0x9ccc('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9ccc('0x3')](0x0);var events={'afterCreate':_0x9ccc('0x4'),'afterUpdate':'update','afterDestroy':_0x9ccc('0x5')};function emitEvent(_0x4660bc){return function(_0x1f4cb5,_0x86cc2b,_0x10440a){MailMessageEvents[_0x9ccc('0x6')](_0x4660bc+':'+_0x1f4cb5['id'],_0x1f4cb5);MailMessageEvents[_0x9ccc('0x6')](_0x4660bc,_0x1f4cb5);_0x10440a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x9ccc('0x7')](e,emitEvent(event));}}module[_0x9ccc('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x65f2=['hook','exports','events','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x413602,_0x5da93b){var _0x30e02b=function(_0x52fc2f){while(--_0x52fc2f){_0x413602['push'](_0x413602['shift']());}};_0x30e02b(++_0x5da93b);}(_0x65f2,0xf2));var _0x265f=function(_0x479be4,_0x230761){_0x479be4=_0x479be4-0x0;var _0x495f72=_0x65f2[_0x479be4];return _0x495f72;};'use strict';var EventEmitter=require(_0x265f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x265f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x265f('0x2')](0x0);var events={'afterCreate':_0x265f('0x3'),'afterUpdate':_0x265f('0x4'),'afterDestroy':_0x265f('0x5')};function emitEvent(_0x363de5){return function(_0x3deadb,_0x21ece4,_0x187972){MailMessageEvents['emit'](_0x363de5+':'+_0x3deadb['id'],_0x3deadb);MailMessageEvents[_0x265f('0x6')](_0x363de5,_0x3deadb);_0x187972(null);};}for(var e in events){if(events[_0x265f('0x7')](e)){var event=events[e];MailMessage[_0x265f('0x8')](e,emitEvent(event));}}module[_0x265f('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 39e27eb..28470e1 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 _0x667b=['findOne','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction'];(function(_0x1340ee,_0x14a779){var _0x3ef3e7=function(_0x87247){while(--_0x87247){_0x1340ee['push'](_0x1340ee['shift']());}};_0x3ef3e7(++_0x14a779);}(_0x667b,0xb2));var _0xb667=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x667b[_0x8560d3];return _0x33b1b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb667('0x0'))(_0xb667('0x1'));var moment=require(_0xb667('0x2'));var BPromise=require(_0xb667('0x3'));var rp=require(_0xb667('0x4'));var htmlToText=require(_0xb667('0x5'));var fs=require('fs');var path=require(_0xb667('0x6'));var rimraf=require(_0xb667('0x7'));var config=require(_0xb667('0x8'));var attributes=require(_0xb667('0x9'));module[_0xb667('0xa')]=function(_0x50f531,_0x14d311){return _0x50f531['define'](_0xb667('0xb'),attributes,{'tableName':_0xb667('0xc'),'paranoid':![],'indexes':[{'name':_0xb667('0xd'),'fields':[_0xb667('0xd')]},{'name':_0xb667('0xe'),'fields':[_0xb667('0xf'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40d74a,_0x560df1,_0x28792e){if(_0x40d74a[_0xb667('0x10')]){_0x40d74a[_0xb667('0xf')]=htmlToText[_0xb667('0x11')](_0x40d74a[_0xb667('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x28792e(null,_0x560df1);},'afterCreate':function(_0x236665,_0x51b088,_0x13f40b){var _0x2927ef=_0x50f531[_0xb667('0x12')];var _0x1638ac=_0x236665['get']({'plain':!![]});if(_0x1638ac[_0xb667('0x13')][_0xb667('0x14')]()==='in'||_0x1638ac['direction'][_0xb667('0x14')]()===_0xb667('0x15')&&!_0x1638ac[_0xb667('0x16')]&&!_[_0xb667('0x17')](_0x1638ac[_0xb667('0x18')])){_0x2927ef[_0xb667('0x19')][_0xb667('0x1a')]({'where':{'id':_0x1638ac[_0xb667('0x1b')]}})[_0xb667('0x1c')](function(_0x22fbbe){if(_0x22fbbe){_0x22fbbe[_0xb667('0x1d')]({'lastMsgAt':_0x1638ac['createdAt'],'lastMsgDirection':_0x1638ac[_0xb667('0x13')][_0xb667('0x14')](),'lastMsgBody':_0x1638ac[_0xb667('0x10')]});}})[_0xb667('0x1e')](function(_0x3d5ffe){console[_0xb667('0x1f')](_0x3d5ffe);});}_0x13f40b();}},'charset':_0xb667('0x20'),'collate':_0xb667('0x21')});}; \ No newline at end of file +var _0xae90=['FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','define','mail_messages','messageId','fti_mail_messages','subject'];(function(_0x2553d8,_0x34ee11){var _0x565cf1=function(_0x2d3852){while(--_0x2d3852){_0x2553d8['push'](_0x2553d8['shift']());}};_0x565cf1(++_0x34ee11);}(_0xae90,0x170));var _0x0ae9=function(_0x3cd321,_0x3b2f29){_0x3cd321=_0x3cd321-0x0;var _0x95963=_0xae90[_0x3cd321];return _0x95963;};'use strict';var _=require(_0x0ae9('0x0'));var util=require(_0x0ae9('0x1'));var logger=require(_0x0ae9('0x2'))(_0x0ae9('0x3'));var moment=require(_0x0ae9('0x4'));var BPromise=require(_0x0ae9('0x5'));var rp=require(_0x0ae9('0x6'));var htmlToText=require(_0x0ae9('0x7'));var fs=require('fs');var path=require(_0x0ae9('0x8'));var rimraf=require(_0x0ae9('0x9'));var config=require(_0x0ae9('0xa'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0xd4eb0e,_0x4055bd){return _0xd4eb0e[_0x0ae9('0xb')]('MailMessage',attributes,{'tableName':_0x0ae9('0xc'),'paranoid':![],'indexes':[{'name':_0x0ae9('0xd'),'fields':['messageId']},{'name':_0x0ae9('0xe'),'fields':['plainBody',_0x0ae9('0xf')],'type':_0x0ae9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x266c4d,_0x5208c6,_0x1d2e36){if(_0x266c4d[_0x0ae9('0x11')]){_0x266c4d['plainBody']=htmlToText[_0x0ae9('0x12')](_0x266c4d[_0x0ae9('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1d2e36(null,_0x5208c6);},'afterCreate':function(_0x2bba2d,_0x48d98a,_0x3868e6){var _0x28037d=_0xd4eb0e['models'];var _0x50cfa2=_0x2bba2d[_0x0ae9('0x13')]({'plain':!![]});if(_0x50cfa2[_0x0ae9('0x14')][_0x0ae9('0x15')]()==='in'||_0x50cfa2[_0x0ae9('0x14')][_0x0ae9('0x15')]()===_0x0ae9('0x16')&&!_0x50cfa2[_0x0ae9('0x17')]&&!_[_0x0ae9('0x18')](_0x50cfa2[_0x0ae9('0x19')])){_0x28037d[_0x0ae9('0x1a')]['findOne']({'where':{'id':_0x50cfa2['MailInteractionId']}})[_0x0ae9('0x1b')](function(_0x3e796d){if(_0x3e796d){_0x3e796d['update']({'lastMsgAt':_0x50cfa2[_0x0ae9('0x1c')],'lastMsgDirection':_0x50cfa2[_0x0ae9('0x14')]['toLowerCase'](),'lastMsgBody':_0x50cfa2[_0x0ae9('0x11')]});}})[_0x0ae9('0x1d')](function(_0x308d8b){console['error'](_0x308d8b);});}_0x3868e6();}},'charset':_0x0ae9('0x1e'),'collate':_0x0ae9('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index c432aa0..4c0e659 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 _0xf072=['request','then','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','CreateMailMessage','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xf072,0x1cf));var _0x2f07=function(_0x39485f,_0x17c637){_0x39485f=_0x39485f-0x0;var _0x1dc8fb=_0xf072[_0x39485f];return _0x1dc8fb;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});config[_0x2f07('0xb')]=_[_0x2f07('0xc')](config[_0x2f07('0xb')],{'host':_0x2f07('0xd'),'port':0x18eb});var socket=require(_0x2f07('0xe'))(new Redis(config[_0x2f07('0xb')]));require(_0x2f07('0xf'))[_0x2f07('0x10')](socket);function respondWithRpcPromise(_0x1a3848,_0x18fe13,_0x14e237){return new BPromise(function(_0x564260,_0xdb2783){return client[_0x2f07('0x11')](_0x1a3848,_0x14e237)[_0x2f07('0x12')](function(_0x3525be){logger['info']('MailMessage,\x20%s,\x20%s',_0x18fe13,_0x2f07('0x13'));logger[_0x2f07('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x18fe13,_0x2f07('0x13'),JSON[_0x2f07('0x15')](_0x3525be));if(_0x3525be[_0x2f07('0x16')]){if(_0x3525be['error'][_0x2f07('0x17')]===0x1f4){logger[_0x2f07('0x16')](_0x2f07('0x18'),_0x18fe13,_0x3525be[_0x2f07('0x16')][_0x2f07('0x19')]);return _0xdb2783(_0x3525be[_0x2f07('0x16')]['message']);}logger[_0x2f07('0x16')]('MailMessage,\x20%s,\x20%s',_0x18fe13,_0x3525be[_0x2f07('0x16')][_0x2f07('0x19')]);return _0x564260(_0x3525be[_0x2f07('0x16')][_0x2f07('0x19')]);}else{logger[_0x2f07('0x1a')](_0x2f07('0x18'),_0x18fe13,_0x2f07('0x13'));_0x564260(_0x3525be[_0x2f07('0x1b')]['message']);}})[_0x2f07('0x1c')](function(_0x4e35fd){logger[_0x2f07('0x16')](_0x2f07('0x18'),_0x18fe13,_0x4e35fd);_0xdb2783(_0x4e35fd);});});}exports[_0x2f07('0x1d')]=function(_0xd944d6){var _0x2ef47d=this;return new Promise(function(_0x5267e1,_0x45df73){return db['MailMessage']['create'](_0xd944d6['body'],{'raw':_0xd944d6[_0x2f07('0x1e')]?_0xd944d6['options'][_0x2f07('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x354ee2){logger[_0x2f07('0x1a')](_0x2f07('0x1d'),_0xd944d6);logger[_0x2f07('0x14')]('CreateMailMessage',_0xd944d6,JSON[_0x2f07('0x15')](_0x354ee2));_0x5267e1(_0x354ee2);})[_0x2f07('0x1c')](function(_0x37c42a){logger['error'](_0x2f07('0x1d'),_0x37c42a[_0x2f07('0x19')],_0xd944d6);_0x45df73(_0x2ef47d['error'](0x1f4,_0x37c42a[_0x2f07('0x19')]));});});}; \ No newline at end of file +var _0x9c48=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','debug','lodash','util','moment','randomstring'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c48,0xa1));var _0x89c4=function(_0x196ee8,_0xdb9c49){_0x196ee8=_0x196ee8-0x0;var _0x24bba1=_0x9c48[_0x196ee8];return _0x24bba1;};'use strict';var _=require(_0x89c4('0x0'));var util=require(_0x89c4('0x1'));var moment=require(_0x89c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x89c4('0x3'));var fs=require('fs');var Redis=require(_0x89c4('0x4'));var db=require(_0x89c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x89c4('0x6'));var config=require(_0x89c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x89c4('0x8')][_0x89c4('0x9')]({'port':0x232a});config[_0x89c4('0xa')]=_[_0x89c4('0xb')](config[_0x89c4('0xa')],{'host':_0x89c4('0xc'),'port':0x18eb});var socket=require(_0x89c4('0xd'))(new Redis(config[_0x89c4('0xa')]));require(_0x89c4('0xe'))[_0x89c4('0xf')](socket);function respondWithRpcPromise(_0x1b330a,_0x417d40,_0x2e8dc4){return new BPromise(function(_0xd445,_0x1a3823){return client[_0x89c4('0x10')](_0x1b330a,_0x2e8dc4)[_0x89c4('0x11')](function(_0x3b8322){logger[_0x89c4('0x12')](_0x89c4('0x13'),_0x417d40,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x417d40,_0x89c4('0x14'),JSON[_0x89c4('0x15')](_0x3b8322));if(_0x3b8322[_0x89c4('0x16')]){if(_0x3b8322[_0x89c4('0x16')][_0x89c4('0x17')]===0x1f4){logger[_0x89c4('0x16')](_0x89c4('0x13'),_0x417d40,_0x3b8322['error'][_0x89c4('0x18')]);return _0x1a3823(_0x3b8322[_0x89c4('0x16')][_0x89c4('0x18')]);}logger[_0x89c4('0x16')]('MailMessage,\x20%s,\x20%s',_0x417d40,_0x3b8322[_0x89c4('0x16')][_0x89c4('0x18')]);return _0xd445(_0x3b8322[_0x89c4('0x16')]['message']);}else{logger[_0x89c4('0x12')]('MailMessage,\x20%s,\x20%s',_0x417d40,_0x89c4('0x14'));_0xd445(_0x3b8322[_0x89c4('0x19')]['message']);}})[_0x89c4('0x1a')](function(_0x4ca31e){logger['error'](_0x89c4('0x13'),_0x417d40,_0x4ca31e);_0x1a3823(_0x4ca31e);});});}exports[_0x89c4('0x1b')]=function(_0x5cb1a9){var _0x4accf6=this;return new Promise(function(_0x1303ca,_0x5b8a37){return db[_0x89c4('0x1c')][_0x89c4('0x1d')](_0x5cb1a9['body'],{'raw':_0x5cb1a9[_0x89c4('0x1e')]?_0x5cb1a9[_0x89c4('0x1e')][_0x89c4('0x1f')]===undefined?!![]:![]:!![]})[_0x89c4('0x11')](function(_0x15ad38){logger[_0x89c4('0x12')]('CreateMailMessage',_0x5cb1a9);logger[_0x89c4('0x20')](_0x89c4('0x1b'),_0x5cb1a9,JSON['stringify'](_0x15ad38));_0x1303ca(_0x15ad38);})[_0x89c4('0x1a')](function(_0x222915){logger[_0x89c4('0x16')](_0x89c4('0x1b'),_0x222915[_0x89c4('0x18')],_0x5cb1a9);_0x5b8a37(_0x4accf6[_0x89c4('0x16')](0x1f4,_0x222915['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 5d6fd0d..a6b7328 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 _0xcac6=['register','length','mailMessage:','save','remove','update','emit','removeListener'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xcac6,0xa3));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x6cac('0x0'),_0x6cac('0x1'),_0x6cac('0x2')];function createListener(_0x73a7f7,_0x52fc3b){return function(_0x50a4ed){_0x52fc3b[_0x6cac('0x3')](_0x73a7f7,_0x50a4ed);};}function removeListener(_0x431603,_0x2810e7){return function(){MailMessageEvents[_0x6cac('0x4')](_0x431603,_0x2810e7);};}exports[_0x6cac('0x5')]=function(_0x44b83d){for(var _0x11700d=0x0,_0x51a850=events[_0x6cac('0x6')];_0x11700d<_0x51a850;_0x11700d++){var _0x21c42a=events[_0x11700d];var _0x353359=createListener(_0x6cac('0x7')+_0x21c42a,_0x44b83d);MailMessageEvents['on'](_0x21c42a,_0x353359);}}; \ No newline at end of file +var _0x60a9=['emit','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x2ff52,_0x5634cb){var _0x517f75=function(_0x34b8ee){while(--_0x34b8ee){_0x2ff52['push'](_0x2ff52['shift']());}};_0x517f75(++_0x5634cb);}(_0x60a9,0x1b9));var _0x960a=function(_0x3578ec,_0x2a031c){_0x3578ec=_0x3578ec-0x0;var _0x214345=_0x60a9[_0x3578ec];return _0x214345;};'use strict';var MailMessageEvents=require(_0x960a('0x0'));var events=[_0x960a('0x1'),_0x960a('0x2'),'update'];function createListener(_0x477994,_0x2ecfec){return function(_0x57fd2f){_0x2ecfec[_0x960a('0x3')](_0x477994,_0x57fd2f);};}function removeListener(_0x240679,_0x485c90){return function(){MailMessageEvents['removeListener'](_0x240679,_0x485c90);};}exports['register']=function(_0x42e87f){for(var _0x490a75=0x0,_0x40ed56=events[_0x960a('0x4')];_0x490a75<_0x40ed56;_0x490a75++){var _0x4377ad=events[_0x490a75];var _0x4339f6=createListener(_0x960a('0x5')+_0x4377ad,_0x42e87f);MailMessageEvents['on'](_0x4377ad,_0x4339f6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 46207de..6509053 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 _0x091c=['./mailQueue.controller','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x162a95,_0x9dfb1f){var _0x54cd40=function(_0x249ed1){while(--_0x249ed1){_0x162a95['push'](_0x162a95['shift']());}};_0x54cd40(++_0x9dfb1f);}(_0x091c,0xbc));var _0xc091=function(_0x1f8413,_0x18f221){_0x1f8413=_0x1f8413-0x0;var _0x133870=_0x091c[_0x1f8413];return _0x133870;};'use strict';var multer=require('multer');var util=require(_0xc091('0x0'));var path=require(_0xc091('0x1'));var timeout=require(_0xc091('0x2'));var express=require(_0xc091('0x3'));var router=express[_0xc091('0x4')]();var auth=require(_0xc091('0x5'));var interaction=require(_0xc091('0x6'));var config=require(_0xc091('0x7'));var controller=require(_0xc091('0x8'));router[_0xc091('0x9')]('/',auth['isAuthenticated'](),controller[_0xc091('0xa')]);router['get']('/describe',auth[_0xc091('0xb')](),controller['describe']);router[_0xc091('0x9')](_0xc091('0xc'),auth['isAuthenticated'](),controller[_0xc091('0xd')]);router['get'](_0xc091('0xe'),auth[_0xc091('0xb')](),controller[_0xc091('0xf')]);router[_0xc091('0x9')](_0xc091('0x10'),auth[_0xc091('0xb')](),controller[_0xc091('0x11')]);router[_0xc091('0x9')](_0xc091('0x12'),auth[_0xc091('0xb')](),controller['getAgents']);router[_0xc091('0x13')]('/',auth['isAuthenticated'](),controller[_0xc091('0x14')]);router[_0xc091('0x13')](_0xc091('0x10'),auth[_0xc091('0xb')](),controller['addTeams']);router[_0xc091('0x13')](_0xc091('0x12'),auth[_0xc091('0xb')](),controller[_0xc091('0x15')]);router[_0xc091('0x16')](_0xc091('0xc'),auth[_0xc091('0xb')](),controller[_0xc091('0x17')]);router[_0xc091('0x18')]('/:id',auth[_0xc091('0xb')](),controller[_0xc091('0x19')]);router[_0xc091('0x18')](_0xc091('0x10'),auth[_0xc091('0xb')](),controller['removeTeams']);router['delete'](_0xc091('0x12'),auth[_0xc091('0xb')](),controller[_0xc091('0x1a')]);module[_0xc091('0x1b')]=router; \ No newline at end of file +var _0x9d99=['get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','path','connect-timeout','Router','../../config/environment'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x9d99,0xcc));var _0x99d9=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x9d99[_0x3b1b23];return _0x1efc85;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99d9('0x0'));var timeout=require(_0x99d9('0x1'));var express=require('express');var router=express[_0x99d9('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x99d9('0x3'));var controller=require('./mailQueue.controller');router[_0x99d9('0x4')]('/',auth[_0x99d9('0x5')](),controller['index']);router[_0x99d9('0x4')](_0x99d9('0x6'),auth[_0x99d9('0x5')](),controller[_0x99d9('0x7')]);router[_0x99d9('0x4')](_0x99d9('0x8'),auth['isAuthenticated'](),controller[_0x99d9('0x9')]);router[_0x99d9('0x4')](_0x99d9('0xa'),auth[_0x99d9('0x5')](),controller[_0x99d9('0xb')]);router[_0x99d9('0x4')](_0x99d9('0xc'),auth[_0x99d9('0x5')](),controller[_0x99d9('0xd')]);router[_0x99d9('0x4')](_0x99d9('0xe'),auth[_0x99d9('0x5')](),controller[_0x99d9('0xf')]);router[_0x99d9('0x10')]('/',auth[_0x99d9('0x5')](),controller[_0x99d9('0x11')]);router[_0x99d9('0x10')](_0x99d9('0xc'),auth[_0x99d9('0x5')](),controller[_0x99d9('0x12')]);router[_0x99d9('0x10')](_0x99d9('0xe'),auth[_0x99d9('0x5')](),controller[_0x99d9('0x13')]);router[_0x99d9('0x14')](_0x99d9('0x8'),auth[_0x99d9('0x5')](),controller[_0x99d9('0x15')]);router[_0x99d9('0x16')](_0x99d9('0x8'),auth[_0x99d9('0x5')](),controller[_0x99d9('0x17')]);router[_0x99d9('0x16')]('/:id/teams',auth[_0x99d9('0x5')](),controller['removeTeams']);router[_0x99d9('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x99d9('0x18')]);module[_0x99d9('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 68708b6..e0a0c05 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 _0x1b30=['name','STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x1b30,0x1b0));var _0x01b3=function(_0x3a98b2,_0x216bf6){_0x3a98b2=_0x3a98b2-0x0;var _0x1e0a6c=_0x1b30[_0x3a98b2];return _0x1e0a6c;};'use strict';var Sequelize=require(_0x01b3('0x0'));module[_0x01b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x01b3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01b3('0x3')]},'timeout':{'type':Sequelize[_0x01b3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01b3('0x5')](_0x01b3('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x5c21=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x5d156b,_0xe2635d){var _0x1ef3fa=function(_0x5f1079){while(--_0x5f1079){_0x5d156b['push'](_0x5d156b['shift']());}};_0x1ef3fa(++_0xe2635d);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x15c2('0x0')]={'name':{'type':Sequelize[_0x15c2('0x1')],'unique':_0x15c2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15c2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15c2('0x3')](_0x15c2('0x4'),_0x15c2('0x5'),_0x15c2('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f34dfd7..c7b666f 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 _0x892a=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MailQueues','destroy','error','stack','name','map','MailQueue','rawAttributes','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','findAndCountAll','updatedAt','createdAt','rows','format','%s/%s','SIP','mailPause','getTeams','Team','ids','findAll','User','Agents','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','value','removeAgents','emit','addAgents','spread','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format'];(function(_0x4f0f27,_0x51deba){var _0x2ce661=function(_0x52a20f){while(--_0x52a20f){_0x4f0f27['push'](_0x4f0f27['shift']());}};_0x2ce661(++_0x51deba);}(_0x892a,0x18d));var _0xa892=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0x892a[_0x5e9876];return _0x576c48;};'use strict';var pdf=require(_0xa892('0x0'));var emlformat=require(_0xa892('0x1'));var rimraf=require(_0xa892('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa892('0x3'));var rp=require(_0xa892('0x4'));var moment=require(_0xa892('0x5'));var BPromise=require(_0xa892('0x6'));var Mustache=require(_0xa892('0x7'));var util=require(_0xa892('0x8'));var path=require(_0xa892('0x9'));var sox=require('sox');var csv=require(_0xa892('0xa'));var ejs=require(_0xa892('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa892('0xc'));var jsforce=require(_0xa892('0xd'));var deskjs=require(_0xa892('0xe'));var toCsv=require(_0xa892('0xa'));var querystring=require(_0xa892('0xf'));var Papa=require(_0xa892('0x10'));var Redis=require(_0xa892('0x11'));var authService=require(_0xa892('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa892('0x13'));var hardwareService=require(_0xa892('0x14'));var logger=require(_0xa892('0x15'))('api');var utils=require(_0xa892('0x16'));var config=require(_0xa892('0x17'));var db=require('../../mysqldb')['db'];config[_0xa892('0x18')]=_['defaults'](config[_0xa892('0x18')],{'host':_0xa892('0x19'),'port':0x18eb});var socket=require(_0xa892('0x1a'))(new Redis(config[_0xa892('0x18')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x53a809,_0x3fe4b8){_0x3fe4b8=_0x3fe4b8||0xcc;return function(_0x381ce5){if(_0x381ce5){return _0x53a809['sendStatus'](_0x3fe4b8);}return _0x53a809[_0xa892('0x1b')](_0x3fe4b8)[_0xa892('0x1c')]();};}function respondWithResult(_0x5b575c,_0x1b1bd6){_0x1b1bd6=_0x1b1bd6||0xc8;return function(_0xa5d284){if(_0xa5d284){return _0x5b575c[_0xa892('0x1b')](_0x1b1bd6)[_0xa892('0x1d')](_0xa5d284);}};}function respondWithFilteredResult(_0x19dca6,_0x4a8175){return function(_0x5a7cbc){if(_0x5a7cbc){var _0x2bd993=_0x5a7cbc['count'],_0x316f71=_0x4a8175[_0xa892('0x1e')],_0x5c9f54=_0x4a8175[_0xa892('0x1e')]+_0x4a8175[_0xa892('0x1f')],_0x5c4c94;if(_0x5c9f54>=_0x2bd993){_0x5c9f54=_0x2bd993;_0x5c4c94=0xc8;}else{_0x5c4c94=0xce;}_0x19dca6[_0xa892('0x1b')](_0x5c4c94);return _0x19dca6[_0xa892('0x20')](_0xa892('0x21'),_0x316f71+'-'+_0x5c9f54+'/'+_0x2bd993)['json'](_0x5a7cbc);}return null;};}function patchUpdates(_0x4fc9a0){return function(_0x4b2dad){try{jsonpatch[_0xa892('0x22')](_0x4b2dad,_0x4fc9a0,!![]);}catch(_0x5616c2){return BPromise[_0xa892('0x23')](_0x5616c2);}return _0x4b2dad[_0xa892('0x24')]();};}function saveUpdates(_0x166fda,_0x4c11f6){return function(_0x1779c5){if(_0x1779c5){return _0x1779c5[_0xa892('0x25')](_0x166fda)['then'](function(_0x1ba9b8){return _0x1ba9b8;});}return null;};}function removeEntity(_0x70f6c3,_0x242738){return function(_0x1c36fe){if(_0x1c36fe){return _0x1c36fe['destroy']()[_0xa892('0x26')](function(){var _0x51a8a0=_0x1c36fe[_0xa892('0x27')]({'plain':!![]});var _0x5e3082=_0xa892('0x28');return db['UserProfileResource'][_0xa892('0x29')]({'where':{'type':_0x5e3082,'resourceId':_0x51a8a0['id']}})['then'](function(){return _0x1c36fe;});})[_0xa892('0x26')](function(){_0x70f6c3[_0xa892('0x1b')](0xcc)[_0xa892('0x1c')]();});}};}function handleEntityNotFound(_0x2737f1,_0x1936cf){return function(_0x2dd743){if(!_0x2dd743){_0x2737f1['sendStatus'](0x194);}return _0x2dd743;};}function handleError(_0x42b603,_0x960041){_0x960041=_0x960041||0x1f4;return function(_0x523b50){logger[_0xa892('0x2a')](_0x523b50[_0xa892('0x2b')]);if(_0x523b50[_0xa892('0x2c')]){delete _0x523b50[_0xa892('0x2c')];}_0x42b603[_0xa892('0x1b')](_0x960041)['send'](_0x523b50);};}exports['index']=function(_0x2ecd5f,_0x599509){var _0x19fbf0={},_0xf78c5a={},_0x4b5e40={'count':0x0,'rows':[]};var _0x23f5a9=_[_0xa892('0x2d')](db[_0xa892('0x2e')][_0xa892('0x2f')],function(_0x156b19){return{'name':_0x156b19['fieldName'],'type':_0x156b19['type']['key']};});_0xf78c5a[_0xa892('0x30')]=_[_0xa892('0x2d')](_0x23f5a9,_0xa892('0x2c'));_0xf78c5a['query']=_['keys'](_0x2ecd5f['query']);_0xf78c5a[_0xa892('0x31')]=_[_0xa892('0x32')](_0xf78c5a[_0xa892('0x30')],_0xf78c5a[_0xa892('0x33')]);_0x19fbf0[_0xa892('0x34')]=_['intersection'](_0xf78c5a[_0xa892('0x30')],qs[_0xa892('0x35')](_0x2ecd5f[_0xa892('0x33')][_0xa892('0x35')]));_0x19fbf0[_0xa892('0x34')]=_0x19fbf0[_0xa892('0x34')][_0xa892('0x36')]?_0x19fbf0['attributes']:_0xf78c5a[_0xa892('0x30')];if(!_0x2ecd5f[_0xa892('0x33')][_0xa892('0x37')](_0xa892('0x38'))){_0x19fbf0['limit']=qs[_0xa892('0x1f')](_0x2ecd5f[_0xa892('0x33')][_0xa892('0x1f')]);_0x19fbf0[_0xa892('0x1e')]=qs[_0xa892('0x1e')](_0x2ecd5f[_0xa892('0x33')][_0xa892('0x1e')]);}_0x19fbf0['order']=qs[_0xa892('0x39')](_0x2ecd5f[_0xa892('0x33')][_0xa892('0x39')]);_0x19fbf0['where']=qs[_0xa892('0x31')](_[_0xa892('0x3a')](_0x2ecd5f['query'],_0xf78c5a[_0xa892('0x31')]),_0x23f5a9);if(_0x2ecd5f[_0xa892('0x33')][_0xa892('0x3b')]){_0x19fbf0[_0xa892('0x3c')]=_[_0xa892('0x3d')](_0x19fbf0[_0xa892('0x3c')],{'$or':_[_0xa892('0x2d')](_0x23f5a9,function(_0x1cbde9){if(_0x1cbde9[_0xa892('0x3e')]!==_0xa892('0x3f')){var _0x5c9873={};_0x5c9873[_0x1cbde9[_0xa892('0x2c')]]={'$like':'%'+_0x2ecd5f['query'][_0xa892('0x3b')]+'%'};return _0x5c9873;}})});}_0x19fbf0=_[_0xa892('0x3d')]({},_0x19fbf0,_0x2ecd5f[_0xa892('0x40')]);var _0x2d9c9c={'where':_0x19fbf0[_0xa892('0x3c')]};return db[_0xa892('0x2e')][_0xa892('0x41')](_0x2d9c9c)['then'](function(_0x126089){_0x4b5e40[_0xa892('0x41')]=_0x126089;if(_0x2ecd5f[_0xa892('0x33')][_0xa892('0x42')]){_0x19fbf0[_0xa892('0x43')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x19fbf0);})[_0xa892('0x26')](function(_0x4d6511){_0x4b5e40['rows']=_0x4d6511;return _0x4b5e40;})[_0xa892('0x26')](respondWithFilteredResult(_0x599509,_0x19fbf0))[_0xa892('0x44')](handleError(_0x599509,null));};exports[_0xa892('0x45')]=function(_0x541c3c,_0x89b23c){var _0x4dd44f={'raw':!![],'where':{'id':_0x541c3c[_0xa892('0x46')]['id']}},_0x4a7965={};_0x4a7965[_0xa892('0x30')]=_['keys'](db[_0xa892('0x2e')]['rawAttributes']);_0x4a7965[_0xa892('0x33')]=_[_0xa892('0x47')](_0x541c3c['query']);_0x4a7965[_0xa892('0x31')]=_[_0xa892('0x32')](_0x4a7965[_0xa892('0x30')],_0x4a7965[_0xa892('0x33')]);_0x4dd44f[_0xa892('0x34')]=_[_0xa892('0x32')](_0x4a7965[_0xa892('0x30')],qs['fields'](_0x541c3c[_0xa892('0x33')][_0xa892('0x35')]));_0x4dd44f[_0xa892('0x34')]=_0x4dd44f[_0xa892('0x34')][_0xa892('0x36')]?_0x4dd44f[_0xa892('0x34')]:_0x4a7965[_0xa892('0x30')];if(_0x541c3c[_0xa892('0x33')][_0xa892('0x42')]){_0x4dd44f[_0xa892('0x43')]=[{'all':!![]}];}_0x4dd44f=_[_0xa892('0x3d')]({},_0x4dd44f,_0x541c3c[_0xa892('0x40')]);return db[_0xa892('0x2e')]['find'](_0x4dd44f)['then'](handleEntityNotFound(_0x89b23c,null))[_0xa892('0x26')](respondWithResult(_0x89b23c,null))['catch'](handleError(_0x89b23c,null));};exports[_0xa892('0x48')]=function(_0x550d96,_0x303007){return db[_0xa892('0x2e')][_0xa892('0x48')](_0x550d96[_0xa892('0x49')],{})[_0xa892('0x26')](function(_0x7fd582){var _0x163ab0=_0x550d96[_0xa892('0x4a')][_0xa892('0x27')]({'plain':!![]});if(!_0x163ab0)throw new Error(_0xa892('0x4b'));if(_0x163ab0['role']===_0xa892('0x4a')){var _0x2b7058=_0x7fd582[_0xa892('0x27')]({'plain':!![]});var _0x149fc5=_0xa892('0x28');return db[_0xa892('0x4c')][_0xa892('0x4d')]({'where':{'name':_0x149fc5,'userProfileId':_0x163ab0['userProfileId']},'raw':!![]})[_0xa892('0x26')](function(_0x545547){if(_0x545547&&_0x545547['autoAssociation']===0x0){return db[_0xa892('0x4e')][_0xa892('0x48')]({'name':_0x2b7058[_0xa892('0x2c')],'resourceId':_0x2b7058['id'],'type':_0x545547[_0xa892('0x2c')],'sectionId':_0x545547['id']},{})[_0xa892('0x26')](function(){return _0x7fd582;});}else{return _0x7fd582;}})[_0xa892('0x44')](function(_0x4ac33f){logger['error'](_0xa892('0x4f'),_0x4ac33f);throw _0x4ac33f;});}return _0x7fd582;})[_0xa892('0x26')](respondWithResult(_0x303007,0xc9))[_0xa892('0x44')](handleError(_0x303007,null));};exports[_0xa892('0x25')]=function(_0x576e63,_0x69f172){if(_0x576e63['body']['id']){delete _0x576e63[_0xa892('0x49')]['id'];}return db[_0xa892('0x2e')][_0xa892('0x4d')]({'where':{'id':_0x576e63[_0xa892('0x46')]['id']}})[_0xa892('0x26')](handleEntityNotFound(_0x69f172,null))['then'](saveUpdates(_0x576e63[_0xa892('0x49')],null))['then'](respondWithResult(_0x69f172,null))[_0xa892('0x44')](handleError(_0x69f172,null));};exports[_0xa892('0x29')]=function(_0x48bc91,_0x2adf4c){return db[_0xa892('0x2e')]['find']({'where':{'id':_0x48bc91['params']['id']}})[_0xa892('0x26')](handleEntityNotFound(_0x2adf4c,null))[_0xa892('0x26')](removeEntity(_0x2adf4c,null))[_0xa892('0x44')](handleError(_0x2adf4c,null));};exports[_0xa892('0x50')]=function(_0x27abe5,_0x213c36){return db[_0xa892('0x2e')]['describe']()[_0xa892('0x26')](respondWithResult(_0x213c36,null))[_0xa892('0x44')](handleError(_0x213c36,null));};exports[_0xa892('0x51')]=function(_0x1b45cc,_0x2ac9f3,_0x460246){var _0x46ed73={'raw':!![],'where':{}},_0x27acb5={},_0x4296ad;return db['MailQueue'][_0xa892('0x52')]({'where':{'id':_0x1b45cc['params']['id']}})[_0xa892('0x26')](handleEntityNotFound(_0x2ac9f3,null))[_0xa892('0x26')](function(_0x5a5fc1){if(_0x5a5fc1){_0x4296ad=_0x5a5fc1['get']({'plain':!![]});_0x27acb5[_0xa892('0x30')]=_[_0xa892('0x47')](db[_0xa892('0x53')][_0xa892('0x2f')]);_0x27acb5[_0xa892('0x33')]=_[_0xa892('0x47')](_0x1b45cc[_0xa892('0x33')]);_0x27acb5[_0xa892('0x31')]=_[_0xa892('0x32')](_0x27acb5[_0xa892('0x30')],_0x27acb5['query']);_0x46ed73[_0xa892('0x34')]=_[_0xa892('0x32')](_0x27acb5[_0xa892('0x30')],qs[_0xa892('0x35')](_0x1b45cc[_0xa892('0x33')][_0xa892('0x35')]));_0x46ed73['attributes']=_0x46ed73[_0xa892('0x34')][_0xa892('0x36')]?_0x46ed73[_0xa892('0x34')]:_0x27acb5['model'];if(!_0x1b45cc['query'][_0xa892('0x37')](_0xa892('0x38'))){_0x46ed73[_0xa892('0x1f')]=qs[_0xa892('0x1f')](_0x1b45cc[_0xa892('0x33')][_0xa892('0x1f')]);_0x46ed73['offset']=qs[_0xa892('0x1e')](_0x1b45cc[_0xa892('0x33')][_0xa892('0x1e')]);}_0x46ed73[_0xa892('0x54')]=qs[_0xa892('0x39')](_0x1b45cc['query']['sort']);_0x46ed73[_0xa892('0x3c')]=qs[_0xa892('0x31')](_['pick'](_0x1b45cc['query'],_0x27acb5[_0xa892('0x31')]));_0x46ed73[_0xa892('0x3c')][_0xa892('0x55')]=_0x5a5fc1['id'];if(_0x1b45cc[_0xa892('0x33')][_0xa892('0x3b')]){_0x46ed73[_0xa892('0x3c')]=_[_0xa892('0x3d')](_0x46ed73['where'],{'$or':_[_0xa892('0x2d')](_0x46ed73[_0xa892('0x34')],function(_0x1f5ef9){var _0x5f017d={};_0x5f017d[_0x1f5ef9]={'$like':'%'+_0x1b45cc['query'][_0xa892('0x3b')]+'%'};return _0x5f017d;})});}_0x46ed73=_[_0xa892('0x3d')]({},_0x46ed73,_0x1b45cc['options']);return db[_0xa892('0x53')]['findAll'](_0x46ed73);}})[_0xa892('0x26')](function(_0x206a3d){if(_0x206a3d){return db['User'][_0xa892('0x56')]({'where':{'id':_[_0xa892('0x2d')](_0x206a3d,'UserId'),'role':'agent'},'attributes':['id',_0xa892('0x2c'),'mailPause',_0xa892('0x57'),_0xa892('0x58')]});}})[_0xa892('0x26')](function(_0x2d5fb8){if(_0x2d5fb8){return{'count':_0x2d5fb8[_0xa892('0x41')],'rows':_[_0xa892('0x2d')](_0x2d5fb8[_0xa892('0x59')],function(_0x4c2f58){return{'membername':_0x4c2f58[_0xa892('0x2c')],'UserId':_0x4c2f58['id'],'queue_name':_0x4296ad[_0xa892('0x2c')],'MailQueueId':_0x4296ad['id'],'interface':util[_0xa892('0x5a')](_0xa892('0x5b'),_0xa892('0x5c'),_0x4c2f58[_0xa892('0x2c')]),'penalty':0x0,'paused':_0x4c2f58[_0xa892('0x5d')],'createdAt':_0x4c2f58[_0xa892('0x58')],'updatedAt':_0x4c2f58[_0xa892('0x57')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa892('0x26')](respondWithFilteredResult(_0x2ac9f3,_0x46ed73))[_0xa892('0x44')](handleError(_0x2ac9f3,null));};exports[_0xa892('0x5e')]=function(_0x159223,_0x8d29d4,_0x541f89){var _0x3aaa33={};var _0x1040cb={};var _0x1b06c4;var _0x3d2384;return db['MailQueue'][_0xa892('0x52')]({'where':{'id':_0x159223['params']['id']}})[_0xa892('0x26')](handleEntityNotFound(_0x8d29d4,null))[_0xa892('0x26')](function(_0x46c3fa){if(_0x46c3fa){_0x1b06c4=_0x46c3fa;_0x1040cb['model']=_[_0xa892('0x47')](db[_0xa892('0x5f')][_0xa892('0x2f')]);_0x1040cb[_0xa892('0x33')]=_[_0xa892('0x47')](_0x159223[_0xa892('0x33')]);_0x1040cb['filters']=_[_0xa892('0x32')](_0x1040cb[_0xa892('0x30')],_0x1040cb['query']);_0x3aaa33[_0xa892('0x34')]=_[_0xa892('0x32')](_0x1040cb['model'],qs[_0xa892('0x35')](_0x159223[_0xa892('0x33')]['fields']));_0x3aaa33[_0xa892('0x34')]=_0x3aaa33['attributes']['length']?_0x3aaa33[_0xa892('0x34')]:_0x1040cb[_0xa892('0x30')];_0x3aaa33[_0xa892('0x54')]=qs[_0xa892('0x39')](_0x159223[_0xa892('0x33')]['sort']);_0x3aaa33[_0xa892('0x3c')]=qs[_0xa892('0x31')](_['pick'](_0x159223[_0xa892('0x33')],_0x1040cb['filters']));if(_0x159223[_0xa892('0x33')]['filter']){_0x3aaa33['where']=_[_0xa892('0x3d')](_0x3aaa33['where'],{'$or':_['map'](_0x3aaa33[_0xa892('0x34')],function(_0xe8d551){var _0x31cbb9={};_0x31cbb9[_0xe8d551]={'$like':'%'+_0x159223[_0xa892('0x33')]['filter']+'%'};return _0x31cbb9;})});}_0x3aaa33=_['merge']({},_0x3aaa33,_0x159223['options']);return _0x1b06c4[_0xa892('0x5e')](_0x3aaa33);}})[_0xa892('0x26')](function(_0x189612){if(_0x189612){_0x3d2384=_0x189612[_0xa892('0x36')];if(!_0x159223[_0xa892('0x33')][_0xa892('0x37')](_0xa892('0x38'))){_0x3aaa33[_0xa892('0x1f')]=qs['limit'](_0x159223[_0xa892('0x33')][_0xa892('0x1f')]);_0x3aaa33[_0xa892('0x1e')]=qs[_0xa892('0x1e')](_0x159223[_0xa892('0x33')][_0xa892('0x1e')]);}return _0x1b06c4['getTeams'](_0x3aaa33);}})['then'](function(_0x590025){if(_0x590025){return _0x590025?{'count':_0x3d2384,'rows':_0x590025}:null;}})[_0xa892('0x26')](respondWithResult(_0x8d29d4,null))[_0xa892('0x44')](handleError(_0x8d29d4,null));};exports['addTeams']=function(_0x45b33b,_0x48f0ad,_0x5a8ca0){var _0x412824=_0x45b33b[_0xa892('0x49')][_0xa892('0x60')];return db[_0xa892('0x5f')][_0xa892('0x61')]({'where':{'id':_0x412824},'attributes':['id'],'include':[{'model':db[_0xa892('0x62')],'as':_0xa892('0x63'),'attributes':['id',_0xa892('0x2c'),'online',_0xa892('0x64'),_0xa892('0x65')],'raw':!![]}]})[_0xa892('0x26')](function(_0x343159){if(_0x343159){var _0x47ab7a=_[_0xa892('0x66')](_0x343159,function(_0x2627ca){var _0x54a21c=_0x2627ca[_0xa892('0x27')]({'plain':!![]});return _0x54a21c[_0xa892('0x63')];});return db['MailQueue'][_0xa892('0x4d')]({'where':{'id':_0x45b33b[_0xa892('0x46')]['id']}})[_0xa892('0x26')](function(_0x98f48c){return db['sequelize'][_0xa892('0x67')](function(_0x466c93){return _0x98f48c[_0xa892('0x68')](_0x412824,{'transaction':_0x466c93})[_0xa892('0x26')](function(){return BPromise[_0xa892('0x69')](_0x47ab7a,function(_0x1af6c0){return db[_0xa892('0x53')][_0xa892('0x6a')]({'where':{'UserId':_0x1af6c0['id'],'MailQueueId':_0x45b33b[_0xa892('0x46')]['id']},'transaction':_0x466c93});});})[_0xa892('0x26')](function(){_0x47ab7a[_0xa892('0x6b')](function(_0xfb691d){socket['emit'](_0xa892('0x6c'),{'UserId':_0xfb691d['id'],'MailQueueId':_0x98f48c['id']});});});});});}})['then'](respondWithStatusCode(_0x48f0ad,null))[_0xa892('0x44')](handleError(_0x48f0ad,null));};exports[_0xa892('0x6d')]=function(_0x3ae352,_0x49beb5,_0x9b4b9d){return db[_0xa892('0x5f')][_0xa892('0x61')]({'where':{'id':_0x3ae352[_0xa892('0x33')][_0xa892('0x60')]},'attributes':['id'],'include':[{'model':db[_0xa892('0x62')],'as':_0xa892('0x63'),'attributes':['id'],'raw':!![]}]})[_0xa892('0x26')](handleEntityNotFound(_0x49beb5,null))[_0xa892('0x26')](function(_0xb45c11){var _0x308db4=_[_0xa892('0x2d')](_0xb45c11,'id');var _0x168527=[];var _0x3357ee=[];var _0x3b16ef=squel[_0xa892('0x6e')]();_0x3b16ef['field'](_0xa892('0x6f'))['from'](_0xa892('0x70'),'tq')[_0xa892('0x71')](_0xa892('0x72'),'ut',_0xa892('0x73'))[_0xa892('0x3c')]('MailQueueId\x20=\x20?',_0x3ae352[_0xa892('0x46')]['id']);for(var _0xcd139=0x0;_0xcd139<_0xb45c11[_0xa892('0x36')];_0xcd139+=0x1){let _0x4909ca=_0xb45c11[_0xcd139];for(var _0x5b0f68=0x0;_0x5b0f68<_0x4909ca[_0xa892('0x63')][_0xa892('0x36')];_0x5b0f68+=0x1){let _0x892ee3=_0x4909ca[_0xa892('0x63')][_0x5b0f68];var _0x70a1d6=_0x3b16ef['clone']();_0x70a1d6[_0xa892('0x3c')]('ut.UserId\x20=\x20?',_0x892ee3['id']);_0x3357ee[_0xa892('0x74')](db[_0xa892('0x75')]['query'](_0x70a1d6[_0xa892('0x76')](),{'type':db['sequelize']['QueryTypes'][_0xa892('0x77')]})[_0xa892('0x26')](function(_0x1ddc52){if(_0x1ddc52[_0xa892('0x36')]===0x1){return _0x892ee3['id'];}else{var _0x2e0a42=_[_0xa892('0x78')](_[_0xa892('0x2d')](_0x1ddc52,_0xa892('0x79')),function(_0x41b704){return _[_0xa892('0x7a')](_0x308db4,_0x41b704);});if(_0x2e0a42){return _0x892ee3['id'];}}}));}}return BPromise[_0xa892('0x7b')](_0x3357ee)[_0xa892('0x26')](function(_0x186d0b){_0x168527=_(_0x168527)[_0xa892('0x7c')](_0x186d0b)['compact']()[_0xa892('0x7d')]();return db[_0xa892('0x2e')][_0xa892('0x4d')]({'where':{'id':_0x3ae352[_0xa892('0x46')]['id']}})[_0xa892('0x26')](function(_0x49ec71){return db[_0xa892('0x75')][_0xa892('0x67')](function(_0xfab168){return _0x49ec71[_0xa892('0x6d')](_0x3ae352['query']['ids'],{'transaction':_0xfab168})[_0xa892('0x26')](function(){if(!_['isEmpty'](_0x168527)){return _0x49ec71[_0xa892('0x7e')](_0x168527,{'transaction':_0xfab168});}})[_0xa892('0x26')](function(){_0x168527[_0xa892('0x6b')](function(_0x4d5c2f){socket[_0xa892('0x7f')]('userMailQueue:remove',{'UserId':_0x4d5c2f,'MailQueueId':_0x49ec71['id']});});});});});});})[_0xa892('0x26')](respondWithStatusCode(_0x49beb5,null))['catch'](handleError(_0x49beb5,null));};exports[_0xa892('0x80')]=function(_0x456b18,_0x161ce6,_0x3098bd){return db[_0xa892('0x2e')]['find']({'where':{'id':_0x456b18['params']['id']}})['then'](handleEntityNotFound(_0x161ce6,null))[_0xa892('0x26')](function(_0x272b5b){if(_0x272b5b){return _0x272b5b[_0xa892('0x80')](_0x456b18[_0xa892('0x49')]['ids'],_['omit'](_0x456b18[_0xa892('0x49')],['ids','id'])||{})[_0xa892('0x81')](function(_0x17f512){for(var _0x37e58d=0x0;_0x37e58d<_0x456b18[_0xa892('0x49')]['ids'][_0xa892('0x36')];_0x37e58d+=0x1){socket[_0xa892('0x7f')](_0xa892('0x6c'),{'UserId':_0x456b18['body'][_0xa892('0x60')][_0x37e58d],'MailQueueId':_0x456b18[_0xa892('0x46')]['id']});}return _0x17f512;});}})[_0xa892('0x26')](respondWithResult(_0x161ce6,null))[_0xa892('0x44')](handleError(_0x161ce6,null));};exports[_0xa892('0x7e')]=function(_0xd783f0,_0x139c75,_0x21c835){return db[_0xa892('0x2e')][_0xa892('0x4d')]({'where':{'id':_0xd783f0[_0xa892('0x46')]['id']}})['then'](handleEntityNotFound(_0x139c75,null))[_0xa892('0x26')](function(_0x3b4f37){if(_0x3b4f37){return _0x3b4f37[_0xa892('0x7e')](_0xd783f0[_0xa892('0x33')][_0xa892('0x60')])[_0xa892('0x26')](function(){if(_[_0xa892('0x82')](_0xd783f0[_0xa892('0x33')][_0xa892('0x60')])){for(var _0x566989=0x0;_0x566989<_0xd783f0[_0xa892('0x33')][_0xa892('0x60')][_0xa892('0x36')];_0x566989+=0x1){socket[_0xa892('0x7f')](_0xa892('0x83'),{'UserId':Number(_0xd783f0['query'][_0xa892('0x60')][_0x566989]),'MailQueueId':Number(_0xd783f0[_0xa892('0x46')]['id'])});}}else{socket[_0xa892('0x7f')](_0xa892('0x83'),{'UserId':Number(_0xd783f0[_0xa892('0x33')][_0xa892('0x60')]),'MailQueueId':Number(_0xd783f0[_0xa892('0x46')]['id'])});}});}})[_0xa892('0x26')](respondWithStatusCode(_0x139c75,null))[_0xa892('0x44')](handleError(_0x139c75,null));};exports['getAgents']=function(_0x50a1b1,_0x44f8e2,_0x246400){var _0x5c1f4f={};var _0x1fb77c={};var _0x5ec71b;var _0xd1c28a;return db[_0xa892('0x2e')][_0xa892('0x52')]({'where':{'id':_0x50a1b1[_0xa892('0x46')]['id']}})['then'](handleEntityNotFound(_0x44f8e2,null))['then'](function(_0x27320b){if(_0x27320b){_0x5ec71b=_0x27320b;_0x1fb77c[_0xa892('0x30')]=_[_0xa892('0x47')](db[_0xa892('0x62')][_0xa892('0x2f')]);_0x1fb77c[_0xa892('0x33')]=_['keys'](_0x50a1b1['query']);_0x1fb77c[_0xa892('0x31')]=_[_0xa892('0x32')](_0x1fb77c[_0xa892('0x30')],_0x1fb77c[_0xa892('0x33')]);_0x5c1f4f[_0xa892('0x34')]=_[_0xa892('0x32')](_0x1fb77c[_0xa892('0x30')],qs['fields'](_0x50a1b1[_0xa892('0x33')][_0xa892('0x35')]));_0x5c1f4f[_0xa892('0x34')]=_0x5c1f4f[_0xa892('0x34')]['length']?_0x5c1f4f[_0xa892('0x34')]:_0x1fb77c[_0xa892('0x30')];_0x5c1f4f[_0xa892('0x54')]=qs[_0xa892('0x39')](_0x50a1b1['query'][_0xa892('0x39')]);_0x5c1f4f[_0xa892('0x3c')]=qs[_0xa892('0x31')](_[_0xa892('0x3a')](_0x50a1b1['query'],_0x1fb77c['filters']));if(_0x50a1b1['query']['filter']){_0x5c1f4f['where']=_[_0xa892('0x3d')](_0x5c1f4f[_0xa892('0x3c')],{'$or':_[_0xa892('0x2d')](_0x5c1f4f[_0xa892('0x34')],function(_0x221ab1){var _0x480569={};_0x480569[_0x221ab1]={'$like':'%'+_0x50a1b1[_0xa892('0x33')][_0xa892('0x3b')]+'%'};return _0x480569;})});}_0x5c1f4f=_[_0xa892('0x3d')]({},_0x5c1f4f,_0x50a1b1[_0xa892('0x40')]);return _0x5ec71b[_0xa892('0x84')](_0x5c1f4f);}})[_0xa892('0x26')](function(_0xac9714){if(_0xac9714){_0xd1c28a=_0xac9714[_0xa892('0x36')];if(!_0x50a1b1[_0xa892('0x33')]['hasOwnProperty'](_0xa892('0x38'))){_0x5c1f4f[_0xa892('0x1f')]=qs[_0xa892('0x1f')](_0x50a1b1['query']['limit']);_0x5c1f4f['offset']=qs['offset'](_0x50a1b1[_0xa892('0x33')][_0xa892('0x1e')]);}return _0x5ec71b[_0xa892('0x84')](_0x5c1f4f);}})[_0xa892('0x26')](function(_0x5cc638){if(_0x5cc638){return _0x5cc638?{'count':_0xd1c28a,'rows':_0x5cc638}:null;}})[_0xa892('0x26')](respondWithResult(_0x44f8e2,null))[_0xa892('0x44')](handleError(_0x44f8e2,null));}; \ No newline at end of file +var _0xf2b5=['push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','name','count','rows','catch','show','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','nolimit','order','MailQueueId','findAll','User','findAndCountAll','agent','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','select','tq.TeamId','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0x1c6635,_0x151785){var _0x271fab=function(_0x3fb91d){while(--_0x3fb91d){_0x1c6635['push'](_0x1c6635['shift']());}};_0x271fab(++_0x151785);}(_0xf2b5,0x124));var _0x5f2b=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xf2b5[_0x1526e1];return _0x249a1e;};'use strict';var pdf=require(_0x5f2b('0x0'));var emlformat=require(_0x5f2b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f2b('0x3'));var Mustache=require(_0x5f2b('0x4'));var util=require(_0x5f2b('0x5'));var path=require('path');var sox=require(_0x5f2b('0x6'));var csv=require(_0x5f2b('0x7'));var ejs=require(_0x5f2b('0x8'));var fs=require('fs');var _=require(_0x5f2b('0x9'));var squel=require('squel');var crypto=require(_0x5f2b('0xa'));var jsforce=require(_0x5f2b('0xb'));var deskjs=require(_0x5f2b('0xc'));var toCsv=require(_0x5f2b('0x7'));var querystring=require(_0x5f2b('0xd'));var Papa=require(_0x5f2b('0xe'));var Redis=require(_0x5f2b('0xf'));var authService=require(_0x5f2b('0x10'));var qs=require(_0x5f2b('0x11'));var as=require(_0x5f2b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f2b('0x13'));var utils=require(_0x5f2b('0x14'));var config=require(_0x5f2b('0x15'));var db=require(_0x5f2b('0x16'))['db'];config[_0x5f2b('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f2b('0x18'))(new Redis(config[_0x5f2b('0x17')]));require(_0x5f2b('0x19'))['register'](socket);function respondWithStatusCode(_0x3e5bcc,_0x4f31ab){_0x4f31ab=_0x4f31ab||0xcc;return function(_0x1a583a){if(_0x1a583a){return _0x3e5bcc['sendStatus'](_0x4f31ab);}return _0x3e5bcc[_0x5f2b('0x1a')](_0x4f31ab)[_0x5f2b('0x1b')]();};}function respondWithResult(_0x55b75f,_0x554634){_0x554634=_0x554634||0xc8;return function(_0x1c2394){if(_0x1c2394){return _0x55b75f[_0x5f2b('0x1a')](_0x554634)[_0x5f2b('0x1c')](_0x1c2394);}};}function respondWithFilteredResult(_0x2862dd,_0x66c3){return function(_0x540cc5){if(_0x540cc5){var _0x39c221=_0x540cc5['count'],_0x2b1d5d=_0x66c3[_0x5f2b('0x1d')],_0x5765fb=_0x66c3[_0x5f2b('0x1d')]+_0x66c3[_0x5f2b('0x1e')],_0x39242e;if(_0x5765fb>=_0x39c221){_0x5765fb=_0x39c221;_0x39242e=0xc8;}else{_0x39242e=0xce;}_0x2862dd['status'](_0x39242e);return _0x2862dd['set'](_0x5f2b('0x1f'),_0x2b1d5d+'-'+_0x5765fb+'/'+_0x39c221)[_0x5f2b('0x1c')](_0x540cc5);}return null;};}function patchUpdates(_0x358974){return function(_0xbef87){try{jsonpatch['apply'](_0xbef87,_0x358974,!![]);}catch(_0x5967d9){return BPromise[_0x5f2b('0x20')](_0x5967d9);}return _0xbef87[_0x5f2b('0x21')]();};}function saveUpdates(_0x3cc564,_0x405d03){return function(_0x3fd59f){if(_0x3fd59f){return _0x3fd59f[_0x5f2b('0x22')](_0x3cc564)[_0x5f2b('0x23')](function(_0x3e2601){return _0x3e2601;});}return null;};}function removeEntity(_0x38ad8a,_0x6d9aa8){return function(_0x291372){if(_0x291372){return _0x291372[_0x5f2b('0x24')]()[_0x5f2b('0x23')](function(){var _0x281d4e=_0x291372[_0x5f2b('0x25')]({'plain':!![]});var _0x444301=_0x5f2b('0x26');return db[_0x5f2b('0x27')][_0x5f2b('0x24')]({'where':{'type':_0x444301,'resourceId':_0x281d4e['id']}})[_0x5f2b('0x23')](function(){return _0x291372;});})['then'](function(){_0x38ad8a['status'](0xcc)[_0x5f2b('0x1b')]();});}};}function handleEntityNotFound(_0x398021,_0x68806a){return function(_0x1ec83f){if(!_0x1ec83f){_0x398021[_0x5f2b('0x28')](0x194);}return _0x1ec83f;};}function handleError(_0xccb70d,_0x3d5cfa){_0x3d5cfa=_0x3d5cfa||0x1f4;return function(_0x37971d){logger[_0x5f2b('0x29')](_0x37971d[_0x5f2b('0x2a')]);if(_0x37971d['name']){delete _0x37971d['name'];}_0xccb70d[_0x5f2b('0x1a')](_0x3d5cfa)['send'](_0x37971d);};}exports[_0x5f2b('0x2b')]=function(_0x3eb996,_0x4f53cb){var _0x24d0a9={},_0x347832={},_0x4cbbd2={'count':0x0,'rows':[]};var _0x4f219f=_[_0x5f2b('0x2c')](db[_0x5f2b('0x2d')][_0x5f2b('0x2e')],function(_0x380a81){return{'name':_0x380a81[_0x5f2b('0x2f')],'type':_0x380a81['type'][_0x5f2b('0x30')]};});_0x347832[_0x5f2b('0x31')]=_[_0x5f2b('0x2c')](_0x4f219f,'name');_0x347832[_0x5f2b('0x32')]=_[_0x5f2b('0x33')](_0x3eb996['query']);_0x347832[_0x5f2b('0x34')]=_[_0x5f2b('0x35')](_0x347832['model'],_0x347832[_0x5f2b('0x32')]);_0x24d0a9[_0x5f2b('0x36')]=_[_0x5f2b('0x35')](_0x347832[_0x5f2b('0x31')],qs[_0x5f2b('0x37')](_0x3eb996[_0x5f2b('0x32')][_0x5f2b('0x37')]));_0x24d0a9['attributes']=_0x24d0a9[_0x5f2b('0x36')][_0x5f2b('0x38')]?_0x24d0a9[_0x5f2b('0x36')]:_0x347832[_0x5f2b('0x31')];if(!_0x3eb996[_0x5f2b('0x32')][_0x5f2b('0x39')]('nolimit')){_0x24d0a9[_0x5f2b('0x1e')]=qs[_0x5f2b('0x1e')](_0x3eb996[_0x5f2b('0x32')][_0x5f2b('0x1e')]);_0x24d0a9[_0x5f2b('0x1d')]=qs[_0x5f2b('0x1d')](_0x3eb996['query'][_0x5f2b('0x1d')]);}_0x24d0a9['order']=qs[_0x5f2b('0x3a')](_0x3eb996[_0x5f2b('0x32')][_0x5f2b('0x3a')]);_0x24d0a9[_0x5f2b('0x3b')]=qs[_0x5f2b('0x34')](_[_0x5f2b('0x3c')](_0x3eb996[_0x5f2b('0x32')],_0x347832['filters']),_0x4f219f);if(_0x3eb996[_0x5f2b('0x32')][_0x5f2b('0x3d')]){_0x24d0a9[_0x5f2b('0x3b')]=_[_0x5f2b('0x3e')](_0x24d0a9['where'],{'$or':_[_0x5f2b('0x2c')](_0x4f219f,function(_0x5b1f25){if(_0x5b1f25[_0x5f2b('0x3f')]!==_0x5f2b('0x40')){var _0x3d0efa={};_0x3d0efa[_0x5b1f25[_0x5f2b('0x41')]]={'$like':'%'+_0x3eb996[_0x5f2b('0x32')]['filter']+'%'};return _0x3d0efa;}})});}_0x24d0a9=_[_0x5f2b('0x3e')]({},_0x24d0a9,_0x3eb996['options']);var _0x35a94e={'where':_0x24d0a9['where']};return db[_0x5f2b('0x2d')][_0x5f2b('0x42')](_0x35a94e)[_0x5f2b('0x23')](function(_0x5ec603){_0x4cbbd2[_0x5f2b('0x42')]=_0x5ec603;if(_0x3eb996[_0x5f2b('0x32')]['includeAll']){_0x24d0a9['include']=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x24d0a9);})[_0x5f2b('0x23')](function(_0x315c9b){_0x4cbbd2[_0x5f2b('0x43')]=_0x315c9b;return _0x4cbbd2;})[_0x5f2b('0x23')](respondWithFilteredResult(_0x4f53cb,_0x24d0a9))[_0x5f2b('0x44')](handleError(_0x4f53cb,null));};exports[_0x5f2b('0x45')]=function(_0x29e264,_0xd2672a){var _0x497427={'raw':!![],'where':{'id':_0x29e264['params']['id']}},_0x15c54e={};_0x15c54e[_0x5f2b('0x31')]=_[_0x5f2b('0x33')](db[_0x5f2b('0x2d')][_0x5f2b('0x2e')]);_0x15c54e[_0x5f2b('0x32')]=_['keys'](_0x29e264[_0x5f2b('0x32')]);_0x15c54e[_0x5f2b('0x34')]=_['intersection'](_0x15c54e[_0x5f2b('0x31')],_0x15c54e[_0x5f2b('0x32')]);_0x497427[_0x5f2b('0x36')]=_[_0x5f2b('0x35')](_0x15c54e[_0x5f2b('0x31')],qs[_0x5f2b('0x37')](_0x29e264['query'][_0x5f2b('0x37')]));_0x497427[_0x5f2b('0x36')]=_0x497427['attributes'][_0x5f2b('0x38')]?_0x497427['attributes']:_0x15c54e[_0x5f2b('0x31')];if(_0x29e264[_0x5f2b('0x32')]['includeAll']){_0x497427[_0x5f2b('0x46')]=[{'all':!![]}];}_0x497427=_[_0x5f2b('0x3e')]({},_0x497427,_0x29e264[_0x5f2b('0x47')]);return db[_0x5f2b('0x2d')][_0x5f2b('0x48')](_0x497427)[_0x5f2b('0x23')](handleEntityNotFound(_0xd2672a,null))[_0x5f2b('0x23')](respondWithResult(_0xd2672a,null))[_0x5f2b('0x44')](handleError(_0xd2672a,null));};exports[_0x5f2b('0x49')]=function(_0x1cabf1,_0x107b13){return db[_0x5f2b('0x2d')]['create'](_0x1cabf1[_0x5f2b('0x4a')],{})['then'](function(_0xbb2fa9){var _0x1d6630=_0x1cabf1['user'][_0x5f2b('0x25')]({'plain':!![]});if(!_0x1d6630)throw new Error(_0x5f2b('0x4b'));if(_0x1d6630[_0x5f2b('0x4c')]===_0x5f2b('0x4d')){var _0x4910f6=_0xbb2fa9[_0x5f2b('0x25')]({'plain':!![]});var _0x4dab7f=_0x5f2b('0x26');return db[_0x5f2b('0x4e')][_0x5f2b('0x48')]({'where':{'name':_0x4dab7f,'userProfileId':_0x1d6630[_0x5f2b('0x4f')]},'raw':!![]})['then'](function(_0x21e6b4){if(_0x21e6b4&&_0x21e6b4[_0x5f2b('0x50')]===0x0){return db[_0x5f2b('0x27')][_0x5f2b('0x49')]({'name':_0x4910f6[_0x5f2b('0x41')],'resourceId':_0x4910f6['id'],'type':_0x21e6b4[_0x5f2b('0x41')],'sectionId':_0x21e6b4['id']},{})[_0x5f2b('0x23')](function(){return _0xbb2fa9;});}else{return _0xbb2fa9;}})[_0x5f2b('0x44')](function(_0x43a367){logger['error'](_0x5f2b('0x51'),_0x43a367);throw _0x43a367;});}return _0xbb2fa9;})[_0x5f2b('0x23')](respondWithResult(_0x107b13,0xc9))[_0x5f2b('0x44')](handleError(_0x107b13,null));};exports['update']=function(_0x211740,_0x4f8ae9){if(_0x211740[_0x5f2b('0x4a')]['id']){delete _0x211740[_0x5f2b('0x4a')]['id'];}return db[_0x5f2b('0x2d')][_0x5f2b('0x48')]({'where':{'id':_0x211740[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x4f8ae9,null))['then'](saveUpdates(_0x211740[_0x5f2b('0x4a')],null))[_0x5f2b('0x23')](respondWithResult(_0x4f8ae9,null))[_0x5f2b('0x44')](handleError(_0x4f8ae9,null));};exports[_0x5f2b('0x24')]=function(_0xae754e,_0x3e44a6){return db['MailQueue'][_0x5f2b('0x48')]({'where':{'id':_0xae754e[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x3e44a6,null))[_0x5f2b('0x23')](removeEntity(_0x3e44a6,null))[_0x5f2b('0x44')](handleError(_0x3e44a6,null));};exports[_0x5f2b('0x53')]=function(_0x2908ac,_0x9eb8d9){return db[_0x5f2b('0x2d')]['describe']()[_0x5f2b('0x23')](respondWithResult(_0x9eb8d9,null))[_0x5f2b('0x44')](handleError(_0x9eb8d9,null));};exports[_0x5f2b('0x54')]=function(_0x50367b,_0x59eb4a,_0x434592){var _0x446cec={'raw':!![],'where':{}},_0x4df257={},_0x41cd34;return db['MailQueue'][_0x5f2b('0x55')]({'where':{'id':_0x50367b[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x59eb4a,null))[_0x5f2b('0x23')](function(_0x163c3a){if(_0x163c3a){_0x41cd34=_0x163c3a['get']({'plain':!![]});_0x4df257[_0x5f2b('0x31')]=_['keys'](db[_0x5f2b('0x56')]['rawAttributes']);_0x4df257[_0x5f2b('0x32')]=_[_0x5f2b('0x33')](_0x50367b[_0x5f2b('0x32')]);_0x4df257[_0x5f2b('0x34')]=_['intersection'](_0x4df257[_0x5f2b('0x31')],_0x4df257[_0x5f2b('0x32')]);_0x446cec[_0x5f2b('0x36')]=_[_0x5f2b('0x35')](_0x4df257['model'],qs[_0x5f2b('0x37')](_0x50367b[_0x5f2b('0x32')][_0x5f2b('0x37')]));_0x446cec[_0x5f2b('0x36')]=_0x446cec[_0x5f2b('0x36')][_0x5f2b('0x38')]?_0x446cec[_0x5f2b('0x36')]:_0x4df257[_0x5f2b('0x31')];if(!_0x50367b[_0x5f2b('0x32')][_0x5f2b('0x39')](_0x5f2b('0x57'))){_0x446cec[_0x5f2b('0x1e')]=qs['limit'](_0x50367b['query'][_0x5f2b('0x1e')]);_0x446cec[_0x5f2b('0x1d')]=qs[_0x5f2b('0x1d')](_0x50367b['query'][_0x5f2b('0x1d')]);}_0x446cec[_0x5f2b('0x58')]=qs[_0x5f2b('0x3a')](_0x50367b[_0x5f2b('0x32')]['sort']);_0x446cec['where']=qs[_0x5f2b('0x34')](_['pick'](_0x50367b[_0x5f2b('0x32')],_0x4df257[_0x5f2b('0x34')]));_0x446cec[_0x5f2b('0x3b')][_0x5f2b('0x59')]=_0x163c3a['id'];if(_0x50367b[_0x5f2b('0x32')]['filter']){_0x446cec[_0x5f2b('0x3b')]=_[_0x5f2b('0x3e')](_0x446cec['where'],{'$or':_[_0x5f2b('0x2c')](_0x446cec['attributes'],function(_0x400f16){var _0x2b9f68={};_0x2b9f68[_0x400f16]={'$like':'%'+_0x50367b[_0x5f2b('0x32')]['filter']+'%'};return _0x2b9f68;})});}_0x446cec=_[_0x5f2b('0x3e')]({},_0x446cec,_0x50367b[_0x5f2b('0x47')]);return db['UserMailQueue'][_0x5f2b('0x5a')](_0x446cec);}})['then'](function(_0xbe0bca){if(_0xbe0bca){return db[_0x5f2b('0x5b')][_0x5f2b('0x5c')]({'where':{'id':_[_0x5f2b('0x2c')](_0xbe0bca,'UserId'),'role':_0x5f2b('0x5d')},'attributes':['id','name','mailPause','updatedAt',_0x5f2b('0x5e')]});}})[_0x5f2b('0x23')](function(_0x5eb337){if(_0x5eb337){return{'count':_0x5eb337[_0x5f2b('0x42')],'rows':_[_0x5f2b('0x2c')](_0x5eb337[_0x5f2b('0x43')],function(_0x231424){return{'membername':_0x231424[_0x5f2b('0x41')],'UserId':_0x231424['id'],'queue_name':_0x41cd34[_0x5f2b('0x41')],'MailQueueId':_0x41cd34['id'],'interface':util['format'](_0x5f2b('0x5f'),_0x5f2b('0x60'),_0x231424['name']),'penalty':0x0,'paused':_0x231424['mailPause'],'createdAt':_0x231424[_0x5f2b('0x5e')],'updatedAt':_0x231424[_0x5f2b('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5f2b('0x23')](respondWithFilteredResult(_0x59eb4a,_0x446cec))[_0x5f2b('0x44')](handleError(_0x59eb4a,null));};exports['getTeams']=function(_0x592109,_0x350772,_0x216b4e){var _0x4da5d7={};var _0x5ece1d={};var _0x286263;var _0x123e86;return db[_0x5f2b('0x2d')][_0x5f2b('0x55')]({'where':{'id':_0x592109['params']['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x350772,null))['then'](function(_0x3a7e44){if(_0x3a7e44){_0x286263=_0x3a7e44;_0x5ece1d[_0x5f2b('0x31')]=_['keys'](db[_0x5f2b('0x62')]['rawAttributes']);_0x5ece1d[_0x5f2b('0x32')]=_[_0x5f2b('0x33')](_0x592109['query']);_0x5ece1d['filters']=_['intersection'](_0x5ece1d['model'],_0x5ece1d[_0x5f2b('0x32')]);_0x4da5d7['attributes']=_['intersection'](_0x5ece1d[_0x5f2b('0x31')],qs[_0x5f2b('0x37')](_0x592109[_0x5f2b('0x32')]['fields']));_0x4da5d7[_0x5f2b('0x36')]=_0x4da5d7[_0x5f2b('0x36')][_0x5f2b('0x38')]?_0x4da5d7[_0x5f2b('0x36')]:_0x5ece1d[_0x5f2b('0x31')];_0x4da5d7[_0x5f2b('0x58')]=qs['sort'](_0x592109[_0x5f2b('0x32')][_0x5f2b('0x3a')]);_0x4da5d7[_0x5f2b('0x3b')]=qs['filters'](_[_0x5f2b('0x3c')](_0x592109[_0x5f2b('0x32')],_0x5ece1d[_0x5f2b('0x34')]));if(_0x592109[_0x5f2b('0x32')][_0x5f2b('0x3d')]){_0x4da5d7[_0x5f2b('0x3b')]=_[_0x5f2b('0x3e')](_0x4da5d7[_0x5f2b('0x3b')],{'$or':_[_0x5f2b('0x2c')](_0x4da5d7[_0x5f2b('0x36')],function(_0xa4ec54){var _0x3a616f={};_0x3a616f[_0xa4ec54]={'$like':'%'+_0x592109[_0x5f2b('0x32')]['filter']+'%'};return _0x3a616f;})});}_0x4da5d7=_[_0x5f2b('0x3e')]({},_0x4da5d7,_0x592109[_0x5f2b('0x47')]);return _0x286263['getTeams'](_0x4da5d7);}})[_0x5f2b('0x23')](function(_0x499436){if(_0x499436){_0x123e86=_0x499436[_0x5f2b('0x38')];if(!_0x592109['query'][_0x5f2b('0x39')](_0x5f2b('0x57'))){_0x4da5d7['limit']=qs[_0x5f2b('0x1e')](_0x592109[_0x5f2b('0x32')][_0x5f2b('0x1e')]);_0x4da5d7[_0x5f2b('0x1d')]=qs[_0x5f2b('0x1d')](_0x592109[_0x5f2b('0x32')][_0x5f2b('0x1d')]);}return _0x286263[_0x5f2b('0x63')](_0x4da5d7);}})[_0x5f2b('0x23')](function(_0x226449){if(_0x226449){return _0x226449?{'count':_0x123e86,'rows':_0x226449}:null;}})[_0x5f2b('0x23')](respondWithResult(_0x350772,null))['catch'](handleError(_0x350772,null));};exports[_0x5f2b('0x64')]=function(_0xb0385c,_0x210c38,_0x250435){var _0xff8cf=_0xb0385c[_0x5f2b('0x4a')][_0x5f2b('0x65')];return db[_0x5f2b('0x62')]['findAll']({'where':{'id':_0xff8cf},'attributes':['id'],'include':[{'model':db[_0x5f2b('0x5b')],'as':_0x5f2b('0x66'),'attributes':['id',_0x5f2b('0x41'),_0x5f2b('0x67'),_0x5f2b('0x68'),_0x5f2b('0x69')],'raw':!![]}]})[_0x5f2b('0x23')](function(_0x554b78){if(_0x554b78){var _0xc36298=_[_0x5f2b('0x6a')](_0x554b78,function(_0x2008af){var _0x33cc69=_0x2008af[_0x5f2b('0x25')]({'plain':!![]});return _0x33cc69[_0x5f2b('0x66')];});return db['MailQueue'][_0x5f2b('0x48')]({'where':{'id':_0xb0385c[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](function(_0x3173fa){return db['sequelize'][_0x5f2b('0x6b')](function(_0x3204c2){return _0x3173fa['addTeams'](_0xff8cf,{'transaction':_0x3204c2})[_0x5f2b('0x23')](function(){return BPromise[_0x5f2b('0x6c')](_0xc36298,function(_0x105c93){return db['UserMailQueue'][_0x5f2b('0x6d')]({'where':{'UserId':_0x105c93['id'],'MailQueueId':_0xb0385c[_0x5f2b('0x52')]['id']},'transaction':_0x3204c2});});})['then'](function(){_0xc36298[_0x5f2b('0x6e')](function(_0x16c7da){socket[_0x5f2b('0x6f')](_0x5f2b('0x70'),{'UserId':_0x16c7da['id'],'MailQueueId':_0x3173fa['id']});});});});});}})[_0x5f2b('0x23')](respondWithStatusCode(_0x210c38,null))[_0x5f2b('0x44')](handleError(_0x210c38,null));};exports['removeTeams']=function(_0x50e861,_0x510f96,_0x5d05d3){return db[_0x5f2b('0x62')][_0x5f2b('0x5a')]({'where':{'id':_0x50e861[_0x5f2b('0x32')][_0x5f2b('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5f2b('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5f2b('0x23')](handleEntityNotFound(_0x510f96,null))[_0x5f2b('0x23')](function(_0x412d60){var _0x3577b4=_[_0x5f2b('0x2c')](_0x412d60,'id');var _0x34697e=[];var _0x55e684=[];var _0x39ed00=squel[_0x5f2b('0x71')]();_0x39ed00['field'](_0x5f2b('0x72'))['from'](_0x5f2b('0x73'),'tq')['join']('user_has_teams','ut',_0x5f2b('0x74'))['where'](_0x5f2b('0x75'),_0x50e861[_0x5f2b('0x52')]['id']);for(var _0x1bf189=0x0;_0x1bf189<_0x412d60[_0x5f2b('0x38')];_0x1bf189+=0x1){let _0x364f53=_0x412d60[_0x1bf189];for(var _0x45f7d8=0x0;_0x45f7d8<_0x364f53[_0x5f2b('0x66')][_0x5f2b('0x38')];_0x45f7d8+=0x1){let _0x524956=_0x364f53[_0x5f2b('0x66')][_0x45f7d8];var _0x36a63b=_0x39ed00['clone']();_0x36a63b[_0x5f2b('0x3b')](_0x5f2b('0x76'),_0x524956['id']);_0x55e684[_0x5f2b('0x77')](db[_0x5f2b('0x78')][_0x5f2b('0x32')](_0x36a63b[_0x5f2b('0x79')](),{'type':db[_0x5f2b('0x78')][_0x5f2b('0x7a')][_0x5f2b('0x7b')]})[_0x5f2b('0x23')](function(_0x1ee983){if(_0x1ee983[_0x5f2b('0x38')]===0x1){return _0x524956['id'];}else{var _0x46d341=_[_0x5f2b('0x7c')](_[_0x5f2b('0x2c')](_0x1ee983,'TeamId'),function(_0x4eff60){return _[_0x5f2b('0x7d')](_0x3577b4,_0x4eff60);});if(_0x46d341){return _0x524956['id'];}}}));}}return BPromise[_0x5f2b('0x7e')](_0x55e684)[_0x5f2b('0x23')](function(_0x352082){_0x34697e=_(_0x34697e)[_0x5f2b('0x7f')](_0x352082)['compact']()[_0x5f2b('0x80')]();return db['MailQueue'][_0x5f2b('0x48')]({'where':{'id':_0x50e861[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](function(_0x20a23d){return db[_0x5f2b('0x78')][_0x5f2b('0x6b')](function(_0x40ba62){return _0x20a23d['removeTeams'](_0x50e861[_0x5f2b('0x32')][_0x5f2b('0x65')],{'transaction':_0x40ba62})[_0x5f2b('0x23')](function(){if(!_[_0x5f2b('0x81')](_0x34697e)){return _0x20a23d[_0x5f2b('0x82')](_0x34697e,{'transaction':_0x40ba62});}})['then'](function(){_0x34697e['forEach'](function(_0x2dd0e0){socket[_0x5f2b('0x6f')](_0x5f2b('0x83'),{'UserId':_0x2dd0e0,'MailQueueId':_0x20a23d['id']});});});});});});})['then'](respondWithStatusCode(_0x510f96,null))[_0x5f2b('0x44')](handleError(_0x510f96,null));};exports['addAgents']=function(_0x98076b,_0x3357c4,_0x2e6028){return db[_0x5f2b('0x2d')][_0x5f2b('0x48')]({'where':{'id':_0x98076b[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x3357c4,null))['then'](function(_0x77503d){if(_0x77503d){return _0x77503d[_0x5f2b('0x84')](_0x98076b[_0x5f2b('0x4a')][_0x5f2b('0x65')],_[_0x5f2b('0x85')](_0x98076b['body'],[_0x5f2b('0x65'),'id'])||{})[_0x5f2b('0x86')](function(_0x3b1373){for(var _0x3c7c08=0x0;_0x3c7c08<_0x98076b['body'][_0x5f2b('0x65')]['length'];_0x3c7c08+=0x1){socket['emit'](_0x5f2b('0x70'),{'UserId':_0x98076b[_0x5f2b('0x4a')][_0x5f2b('0x65')][_0x3c7c08],'MailQueueId':_0x98076b['params']['id']});}return _0x3b1373;});}})[_0x5f2b('0x23')](respondWithResult(_0x3357c4,null))[_0x5f2b('0x44')](handleError(_0x3357c4,null));};exports[_0x5f2b('0x82')]=function(_0x5ebe71,_0x54c4d9,_0x12a7bb){return db['MailQueue'][_0x5f2b('0x48')]({'where':{'id':_0x5ebe71[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x54c4d9,null))['then'](function(_0x3f3d3f){if(_0x3f3d3f){return _0x3f3d3f[_0x5f2b('0x82')](_0x5ebe71[_0x5f2b('0x32')][_0x5f2b('0x65')])[_0x5f2b('0x23')](function(){if(_[_0x5f2b('0x87')](_0x5ebe71[_0x5f2b('0x32')][_0x5f2b('0x65')])){for(var _0xee15fd=0x0;_0xee15fd<_0x5ebe71[_0x5f2b('0x32')][_0x5f2b('0x65')]['length'];_0xee15fd+=0x1){socket[_0x5f2b('0x6f')](_0x5f2b('0x83'),{'UserId':Number(_0x5ebe71[_0x5f2b('0x32')]['ids'][_0xee15fd]),'MailQueueId':Number(_0x5ebe71['params']['id'])});}}else{socket[_0x5f2b('0x6f')](_0x5f2b('0x83'),{'UserId':Number(_0x5ebe71[_0x5f2b('0x32')][_0x5f2b('0x65')]),'MailQueueId':Number(_0x5ebe71['params']['id'])});}});}})[_0x5f2b('0x23')](respondWithStatusCode(_0x54c4d9,null))[_0x5f2b('0x44')](handleError(_0x54c4d9,null));};exports['getAgents']=function(_0x5c515a,_0x13b1b7,_0x321d2a){var _0x3caee5={};var _0x3ba8b6={};var _0x30e8fd;var _0x64c227;return db[_0x5f2b('0x2d')][_0x5f2b('0x55')]({'where':{'id':_0x5c515a[_0x5f2b('0x52')]['id']}})[_0x5f2b('0x23')](handleEntityNotFound(_0x13b1b7,null))['then'](function(_0x4d2088){if(_0x4d2088){_0x30e8fd=_0x4d2088;_0x3ba8b6[_0x5f2b('0x31')]=_[_0x5f2b('0x33')](db[_0x5f2b('0x5b')]['rawAttributes']);_0x3ba8b6[_0x5f2b('0x32')]=_[_0x5f2b('0x33')](_0x5c515a[_0x5f2b('0x32')]);_0x3ba8b6[_0x5f2b('0x34')]=_['intersection'](_0x3ba8b6[_0x5f2b('0x31')],_0x3ba8b6[_0x5f2b('0x32')]);_0x3caee5['attributes']=_['intersection'](_0x3ba8b6[_0x5f2b('0x31')],qs['fields'](_0x5c515a[_0x5f2b('0x32')][_0x5f2b('0x37')]));_0x3caee5[_0x5f2b('0x36')]=_0x3caee5['attributes']['length']?_0x3caee5[_0x5f2b('0x36')]:_0x3ba8b6['model'];_0x3caee5[_0x5f2b('0x58')]=qs['sort'](_0x5c515a['query'][_0x5f2b('0x3a')]);_0x3caee5[_0x5f2b('0x3b')]=qs['filters'](_[_0x5f2b('0x3c')](_0x5c515a[_0x5f2b('0x32')],_0x3ba8b6[_0x5f2b('0x34')]));if(_0x5c515a[_0x5f2b('0x32')][_0x5f2b('0x3d')]){_0x3caee5['where']=_[_0x5f2b('0x3e')](_0x3caee5[_0x5f2b('0x3b')],{'$or':_['map'](_0x3caee5[_0x5f2b('0x36')],function(_0x5ed588){var _0x2cb3f3={};_0x2cb3f3[_0x5ed588]={'$like':'%'+_0x5c515a[_0x5f2b('0x32')]['filter']+'%'};return _0x2cb3f3;})});}_0x3caee5=_[_0x5f2b('0x3e')]({},_0x3caee5,_0x5c515a[_0x5f2b('0x47')]);return _0x30e8fd[_0x5f2b('0x88')](_0x3caee5);}})['then'](function(_0x3cb8b6){if(_0x3cb8b6){_0x64c227=_0x3cb8b6['length'];if(!_0x5c515a[_0x5f2b('0x32')][_0x5f2b('0x39')](_0x5f2b('0x57'))){_0x3caee5[_0x5f2b('0x1e')]=qs['limit'](_0x5c515a[_0x5f2b('0x32')]['limit']);_0x3caee5[_0x5f2b('0x1d')]=qs[_0x5f2b('0x1d')](_0x5c515a['query']['offset']);}return _0x30e8fd['getAgents'](_0x3caee5);}})[_0x5f2b('0x23')](function(_0x2d5d06){if(_0x2d5d06){return _0x2d5d06?{'count':_0x64c227,'rows':_0x2d5d06}:null;}})[_0x5f2b('0x23')](respondWithResult(_0x13b1b7,null))[_0x5f2b('0x44')](handleError(_0x13b1b7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index cd9c77c..84009f3 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 _0x2eeb=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x2eeb,0x96));var _0xb2ee=function(_0x2568b3,_0x1b598b){_0x2568b3=_0x2568b3-0x0;var _0x1918aa=_0x2eeb[_0x2568b3];return _0x1918aa;};'use strict';var EventEmitter=require(_0xb2ee('0x0'));var MailQueue=require(_0xb2ee('0x1'))['db'][_0xb2ee('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb2ee('0x3')](0x0);var events={'afterCreate':_0xb2ee('0x4'),'afterUpdate':_0xb2ee('0x5'),'afterDestroy':_0xb2ee('0x6')};function emitEvent(_0x2670ba){return function(_0x575d6a,_0x3cf0c3,_0x53113b){MailQueueEvents[_0xb2ee('0x7')](_0x2670ba+':'+_0x575d6a['id'],_0x575d6a);MailQueueEvents[_0xb2ee('0x7')](_0x2670ba,_0x575d6a);_0x53113b(null);};}for(var e in events){if(events[_0xb2ee('0x8')](e)){var event=events[e];MailQueue[_0xb2ee('0x9')](e,emitEvent(event));}}module[_0xb2ee('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x185d=['MailQueue','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x185d,0xa0));var _0xd185=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x185d[_0x3c4737];return _0x2bb926;};'use strict';var EventEmitter=require(_0xd185('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xd185('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd185('0x2')](0x0);var events={'afterCreate':_0xd185('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1899c1){return function(_0x452f97,_0x3ed48e,_0x4e23db){MailQueueEvents[_0xd185('0x4')](_0x1899c1+':'+_0x452f97['id'],_0x452f97);MailQueueEvents['emit'](_0x1899c1,_0x452f97);_0x4e23db(null);};}for(var e in events){if(events[_0xd185('0x5')](e)){var event=events[e];MailQueue[_0xd185('0x6')](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 157a2a5..5e3b7ab 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 _0xaad2=['../../config/environment','./mailQueue.attributes','define','MailQueue','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x228cc2,_0x258735){var _0x3b1c56=function(_0x1407d5){while(--_0x1407d5){_0x228cc2['push'](_0x228cc2['shift']());}};_0x3b1c56(++_0x258735);}(_0xaad2,0x1a6));var _0x2aad=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0xaad2[_0x187718];return _0x29ddf4;};'use strict';var _=require('lodash');var util=require(_0x2aad('0x0'));var logger=require(_0x2aad('0x1'))(_0x2aad('0x2'));var moment=require(_0x2aad('0x3'));var BPromise=require('bluebird');var rp=require(_0x2aad('0x4'));var fs=require('fs');var path=require(_0x2aad('0x5'));var rimraf=require(_0x2aad('0x6'));var config=require(_0x2aad('0x7'));var attributes=require(_0x2aad('0x8'));module['exports']=function(_0x3d569a,_0x46b05d){return _0x3d569a[_0x2aad('0x9')](_0x2aad('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','MailQueue','mail_queues'];(function(_0xabb8a1,_0x5ed479){var _0x9a4673=function(_0x44ed09){while(--_0x44ed09){_0xabb8a1['push'](_0xabb8a1['shift']());}};_0x9a4673(++_0x5ed479);}(_0x6f5d,0x174));var _0xd6f5=function(_0x3d3b9c,_0x4f87df){_0x3d3b9c=_0x3d3b9c-0x0;var _0x15d961=_0x6f5d[_0x3d3b9c];return _0x15d961;};'use strict';var _=require(_0xd6f5('0x0'));var util=require(_0xd6f5('0x1'));var logger=require(_0xd6f5('0x2'))(_0xd6f5('0x3'));var moment=require(_0xd6f5('0x4'));var BPromise=require(_0xd6f5('0x5'));var rp=require(_0xd6f5('0x6'));var fs=require('fs');var path=require(_0xd6f5('0x7'));var rimraf=require(_0xd6f5('0x8'));var config=require('../../config/environment');var attributes=require(_0xd6f5('0x9'));module['exports']=function(_0x41ba17,_0x6258ef){return _0x41ba17['define'](_0xd6f5('0xa'),attributes,{'tableName':_0xd6f5('0xb'),'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 3bb8c28..48635cd 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 _0xf4c6=['then','debug','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xf4c6,0x1b2));var _0x6f4c=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xf4c6[_0x28b0a4];return _0x105ce6;};'use strict';var _=require(_0x6f4c('0x0'));var util=require(_0x6f4c('0x1'));var moment=require(_0x6f4c('0x2'));var BPromise=require(_0x6f4c('0x3'));var rs=require(_0x6f4c('0x4'));var fs=require('fs');var Redis=require(_0x6f4c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f4c('0x6'));var logger=require(_0x6f4c('0x7'))(_0x6f4c('0x8'));var config=require(_0x6f4c('0x9'));var jayson=require(_0x6f4c('0xa'));var client=jayson[_0x6f4c('0xb')]['http']({'port':0x232a});config['redis']=_[_0x6f4c('0xc')](config['redis'],{'host':_0x6f4c('0xd'),'port':0x18eb});var socket=require(_0x6f4c('0xe'))(new Redis(config[_0x6f4c('0xf')]));require(_0x6f4c('0x10'))[_0x6f4c('0x11')](socket);function respondWithRpcPromise(_0x4cb5cf,_0x8a71f8,_0x223f9a){return new BPromise(function(_0x2bbd10,_0x47c9a3){return client[_0x6f4c('0x12')](_0x4cb5cf,_0x223f9a)['then'](function(_0x5ade13){logger[_0x6f4c('0x13')](_0x6f4c('0x14'),_0x8a71f8,'request\x20sent');logger['debug'](_0x6f4c('0x15'),_0x8a71f8,_0x6f4c('0x16'),JSON[_0x6f4c('0x17')](_0x5ade13));if(_0x5ade13[_0x6f4c('0x18')]){if(_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x19')]===0x1f4){logger[_0x6f4c('0x18')](_0x6f4c('0x14'),_0x8a71f8,_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);return _0x47c9a3(_0x5ade13[_0x6f4c('0x18')]['message']);}logger['error'](_0x6f4c('0x14'),_0x8a71f8,_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);return _0x2bbd10(_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);}else{logger[_0x6f4c('0x13')](_0x6f4c('0x14'),_0x8a71f8,_0x6f4c('0x16'));_0x2bbd10(_0x5ade13[_0x6f4c('0x1b')]['message']);}})[_0x6f4c('0x1c')](function(_0x3fdb34){logger['error'](_0x6f4c('0x14'),_0x8a71f8,_0x3fdb34);_0x47c9a3(_0x3fdb34);});});}exports[_0x6f4c('0x1d')]=function(_0x2e229a){var _0x1b076e=this;return new Promise(function(_0x3c4388,_0x2ca5d0){return db[_0x6f4c('0x1e')]['findAll']({'raw':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x20')]===undefined?!![]:![]:!![],'where':_0x2e229a['options']?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x21')]||null:null,'attributes':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x22')]||null:null,'limit':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x23')]||null:null,'include':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x24')]?_['map'](_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x24')],function(_0x1c9fd7){return{'model':db[_0x1c9fd7[_0x6f4c('0x25')]],'as':_0x1c9fd7['as'],'attributes':_0x1c9fd7[_0x6f4c('0x22')],'include':_0x1c9fd7['include']?_[_0x6f4c('0x26')](_0x1c9fd7[_0x6f4c('0x24')],function(_0x659de0){return{'model':db[_0x659de0['model']],'as':_0x659de0['as'],'attributes':_0x659de0['attributes'],'include':_0x659de0[_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x659de0[_0x6f4c('0x24')],function(_0x5e3097){return{'model':db[_0x5e3097['model']],'as':_0x5e3097['as'],'attributes':_0x5e3097[_0x6f4c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6f4c('0x27')](function(_0x44b4fd){logger['info'](_0x6f4c('0x1d'),_0x2e229a);logger[_0x6f4c('0x28')]('GetMailQueue',_0x2e229a,JSON[_0x6f4c('0x17')](_0x44b4fd));_0x3c4388(_0x44b4fd);})[_0x6f4c('0x1c')](function(_0x11bec6){logger[_0x6f4c('0x18')](_0x6f4c('0x1d'),_0x11bec6[_0x6f4c('0x1a')],_0x2e229a);_0x2ca5d0(_0x1b076e['error'](0x1f4,_0x11bec6['message']));});});};exports['ShowMailQueue']=function(_0x37843e){var _0x4fc70c=this;return new Promise(function(_0x484f23,_0x7f0f99){return db[_0x6f4c('0x1e')][_0x6f4c('0x29')]({'raw':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x21')]||null:null,'attributes':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x22')]||null:null,'include':_0x37843e['options']?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x37843e['options'][_0x6f4c('0x24')],function(_0x4324db){return{'model':db[_0x4324db[_0x6f4c('0x25')]],'as':_0x4324db['as'],'attributes':_0x4324db[_0x6f4c('0x22')],'include':_0x4324db[_0x6f4c('0x24')]?_['map'](_0x4324db['include'],function(_0x229e7d){return{'model':db[_0x229e7d[_0x6f4c('0x25')]],'as':_0x229e7d['as'],'attributes':_0x229e7d['attributes'],'include':_0x229e7d[_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x229e7d['include'],function(_0x5cf511){return{'model':db[_0x5cf511[_0x6f4c('0x25')]],'as':_0x5cf511['as'],'attributes':_0x5cf511[_0x6f4c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6f4c('0x27')](function(_0x31ff10){logger[_0x6f4c('0x13')](_0x6f4c('0x2a'),_0x37843e);logger[_0x6f4c('0x28')]('ShowMailQueue',_0x37843e,JSON[_0x6f4c('0x17')](_0x31ff10));_0x484f23(_0x31ff10);})[_0x6f4c('0x1c')](function(_0x380057){logger['error'](_0x6f4c('0x2a'),_0x380057[_0x6f4c('0x1a')],_0x37843e);_0x7f0f99(_0x4fc70c[_0x6f4c('0x18')](0x1f4,_0x380057[_0x6f4c('0x1a')]));});});}; \ No newline at end of file +var _0x2450=['GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','./mailQueue.socket','register','then','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','request\x20sent','catch'];(function(_0x9d8eef,_0x3e044e){var _0x410abc=function(_0x3b979a){while(--_0x3b979a){_0x9d8eef['push'](_0x9d8eef['shift']());}};_0x410abc(++_0x3e044e);}(_0x2450,0x117));var _0x0245=function(_0x2d6d7b,_0x183ff8){_0x2d6d7b=_0x2d6d7b-0x0;var _0x4372c5=_0x2450[_0x2d6d7b];return _0x4372c5;};'use strict';var _=require(_0x0245('0x0'));var util=require(_0x0245('0x1'));var moment=require(_0x0245('0x2'));var BPromise=require(_0x0245('0x3'));var rs=require(_0x0245('0x4'));var fs=require('fs');var Redis=require(_0x0245('0x5'));var db=require(_0x0245('0x6'))['db'];var utils=require(_0x0245('0x7'));var logger=require(_0x0245('0x8'))(_0x0245('0x9'));var config=require('../../config/environment');var jayson=require(_0x0245('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0245('0xb')]=_[_0x0245('0xc')](config[_0x0245('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0245('0xd'))(new Redis(config[_0x0245('0xb')]));require(_0x0245('0xe'))[_0x0245('0xf')](socket);function respondWithRpcPromise(_0x370bda,_0x36244c,_0x315a20){return new BPromise(function(_0x4a68c4,_0x44aecc){return client['request'](_0x370bda,_0x315a20)[_0x0245('0x10')](function(_0x3ab98f){logger['info']('MailQueue,\x20%s,\x20%s',_0x36244c,'request\x20sent');logger[_0x0245('0x11')](_0x0245('0x12'),_0x36244c,'request\x20sent',JSON[_0x0245('0x13')](_0x3ab98f));if(_0x3ab98f[_0x0245('0x14')]){if(_0x3ab98f[_0x0245('0x14')]['code']===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x36244c,_0x3ab98f[_0x0245('0x14')]['message']);return _0x44aecc(_0x3ab98f[_0x0245('0x14')]['message']);}logger[_0x0245('0x14')](_0x0245('0x15'),_0x36244c,_0x3ab98f['error']['message']);return _0x4a68c4(_0x3ab98f[_0x0245('0x14')][_0x0245('0x16')]);}else{logger['info'](_0x0245('0x15'),_0x36244c,_0x0245('0x17'));_0x4a68c4(_0x3ab98f['result'][_0x0245('0x16')]);}})[_0x0245('0x18')](function(_0x4f2e2f){logger[_0x0245('0x14')](_0x0245('0x15'),_0x36244c,_0x4f2e2f);_0x44aecc(_0x4f2e2f);});});}exports[_0x0245('0x19')]=function(_0x300ff4){var _0x542d07=this;return new Promise(function(_0x4c1940,_0x5c0768){return db[_0x0245('0x1a')][_0x0245('0x1b')]({'raw':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1d')]===undefined?!![]:![]:!![],'where':_0x300ff4['options']?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1e')]||null:null,'attributes':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')]['attributes']||null:null,'limit':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1f')]||null:null,'include':_0x300ff4['options']?_0x300ff4[_0x0245('0x1c')][_0x0245('0x20')]?_[_0x0245('0x21')](_0x300ff4[_0x0245('0x1c')]['include'],function(_0x2aa36e){return{'model':db[_0x2aa36e[_0x0245('0x22')]],'as':_0x2aa36e['as'],'attributes':_0x2aa36e['attributes'],'include':_0x2aa36e[_0x0245('0x20')]?_[_0x0245('0x21')](_0x2aa36e[_0x0245('0x20')],function(_0x4ca51b){return{'model':db[_0x4ca51b['model']],'as':_0x4ca51b['as'],'attributes':_0x4ca51b[_0x0245('0x23')],'include':_0x4ca51b['include']?_['map'](_0x4ca51b[_0x0245('0x20')],function(_0x4479a2){return{'model':db[_0x4479a2[_0x0245('0x22')]],'as':_0x4479a2['as'],'attributes':_0x4479a2[_0x0245('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0245('0x10')](function(_0x264adf){logger[_0x0245('0x24')](_0x0245('0x19'),_0x300ff4);logger[_0x0245('0x11')]('GetMailQueue',_0x300ff4,JSON[_0x0245('0x13')](_0x264adf));_0x4c1940(_0x264adf);})[_0x0245('0x18')](function(_0x58d88b){logger[_0x0245('0x14')]('GetMailQueue',_0x58d88b[_0x0245('0x16')],_0x300ff4);_0x5c0768(_0x542d07[_0x0245('0x14')](0x1f4,_0x58d88b[_0x0245('0x16')]));});});};exports[_0x0245('0x25')]=function(_0x28fe9f){var _0x2cd6ad=this;return new Promise(function(_0x5174ad,_0x113176){return db[_0x0245('0x1a')]['find']({'raw':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x1d')]===undefined?!![]:![]:!![],'where':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x1e')]||null:null,'attributes':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x23')]||null:null,'include':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f['options'][_0x0245('0x20')]?_['map'](_0x28fe9f[_0x0245('0x1c')]['include'],function(_0x429053){return{'model':db[_0x429053[_0x0245('0x22')]],'as':_0x429053['as'],'attributes':_0x429053[_0x0245('0x23')],'include':_0x429053[_0x0245('0x20')]?_[_0x0245('0x21')](_0x429053[_0x0245('0x20')],function(_0x2a697d){return{'model':db[_0x2a697d[_0x0245('0x22')]],'as':_0x2a697d['as'],'attributes':_0x2a697d[_0x0245('0x23')],'include':_0x2a697d[_0x0245('0x20')]?_[_0x0245('0x21')](_0x2a697d['include'],function(_0x3a0d31){return{'model':db[_0x3a0d31[_0x0245('0x22')]],'as':_0x3a0d31['as'],'attributes':_0x3a0d31[_0x0245('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0245('0x10')](function(_0x5e4e6d){logger['info']('ShowMailQueue',_0x28fe9f);logger['debug']('ShowMailQueue',_0x28fe9f,JSON['stringify'](_0x5e4e6d));_0x5174ad(_0x5e4e6d);})['catch'](function(_0x4f6dbb){logger[_0x0245('0x14')](_0x0245('0x25'),_0x4f6dbb[_0x0245('0x16')],_0x28fe9f);_0x113176(_0x2cd6ad[_0x0245('0x14')](0x1f4,_0x4f6dbb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 95f9ea9..7d4a0a3 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 _0xe79c=['emit','removeListener','register','length','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe79c,0x172));var _0xce79=function(_0x1d847e,_0x49f32f){_0x1d847e=_0x1d847e-0x0;var _0x353bea=_0xe79c[_0x1d847e];return _0x353bea;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xce79('0x0'),'remove',_0xce79('0x1')];function createListener(_0x335d12,_0x181380){return function(_0x5020e6){_0x181380[_0xce79('0x2')](_0x335d12,_0x5020e6);};}function removeListener(_0x35f978,_0xf03a2d){return function(){MailQueueEvents[_0xce79('0x3')](_0x35f978,_0xf03a2d);};}exports[_0xce79('0x4')]=function(_0xade333){for(var _0x25cd84=0x0,_0x49a8fb=events[_0xce79('0x5')];_0x25cd84<_0x49a8fb;_0x25cd84++){var _0x56fd80=events[_0x25cd84];var _0x1ff25c=createListener('mailQueue:'+_0x56fd80,_0xade333);MailQueueEvents['on'](_0x56fd80,_0x1ff25c);}}; \ No newline at end of file +var _0x6fb8=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6fb8,0x1e4));var _0x86fb=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x6fb8[_0xf04c6d];return _0x4a804e;};'use strict';var MailQueueEvents=require(_0x86fb('0x0'));var events=[_0x86fb('0x1'),_0x86fb('0x2'),_0x86fb('0x3')];function createListener(_0x5385ec,_0x201fed){return function(_0x47863c){_0x201fed[_0x86fb('0x4')](_0x5385ec,_0x47863c);};}function removeListener(_0x4356a3,_0x37ede3){return function(){MailQueueEvents[_0x86fb('0x5')](_0x4356a3,_0x37ede3);};}exports[_0x86fb('0x6')]=function(_0x76516b){for(var _0x46ed3d=0x0,_0x10f795=events[_0x86fb('0x7')];_0x46ed3d<_0x10f795;_0x46ed3d++){var _0x876206=events[_0x46ed3d];var _0x1b3854=createListener(_0x86fb('0x8')+_0x876206,_0x76516b);MailQueueEvents['on'](_0x876206,_0x1b3854);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 6a9c3d2..ecd7585 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 _0x60d7=['get','/describe','isAuthenticated','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x60d7,0x115));var _0x760d=function(_0x3504ed,_0x18df7b){_0x3504ed=_0x3504ed-0x0;var _0x5ae5ec=_0x60d7[_0x3504ed];return _0x5ae5ec;};'use strict';var multer=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var path=require(_0x760d('0x2'));var timeout=require(_0x760d('0x3'));var express=require(_0x760d('0x4'));var router=express[_0x760d('0x5')]();var auth=require(_0x760d('0x6'));var interaction=require(_0x760d('0x7'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x760d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x760d('0x8')](_0x760d('0x9'),auth[_0x760d('0xa')](),controller[_0x760d('0xb')]);router[_0x760d('0x8')]('/:id',auth[_0x760d('0xa')](),controller[_0x760d('0xc')]);router['post']('/',auth[_0x760d('0xa')](),controller['create']);router[_0x760d('0xd')](_0x760d('0xe'),auth[_0x760d('0xa')](),controller[_0x760d('0xf')]);router[_0x760d('0x10')](_0x760d('0xe'),auth[_0x760d('0xa')](),controller[_0x760d('0x11')]);module[_0x760d('0x12')]=router; \ No newline at end of file +var _0xa330=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x5b84e6,_0x3e15f1){var _0x1d6d12=function(_0x11b80c){while(--_0x11b80c){_0x5b84e6['push'](_0x5b84e6['shift']());}};_0x1d6d12(++_0x3e15f1);}(_0xa330,0x1be));var _0x0a33=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa330[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0x0a33('0x0'));var util=require('util');var path=require(_0x0a33('0x1'));var timeout=require(_0x0a33('0x2'));var express=require(_0x0a33('0x3'));var router=express[_0x0a33('0x4')]();var auth=require(_0x0a33('0x5'));var interaction=require(_0x0a33('0x6'));var config=require('../../config/environment');var controller=require(_0x0a33('0x7'));router['get']('/',auth[_0x0a33('0x8')](),controller[_0x0a33('0x9')]);router[_0x0a33('0xa')](_0x0a33('0xb'),auth[_0x0a33('0x8')](),controller[_0x0a33('0xc')]);router[_0x0a33('0xa')](_0x0a33('0xd'),auth[_0x0a33('0x8')](),controller['show']);router[_0x0a33('0xe')]('/',auth['isAuthenticated'](),controller[_0x0a33('0xf')]);router[_0x0a33('0x10')](_0x0a33('0xd'),auth[_0x0a33('0x8')](),controller[_0x0a33('0x11')]);router[_0x0a33('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0a33('0x13')]);module[_0x0a33('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 07f0752..cfa3abf 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 _0x7e48=['DATE','sequelize'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x7e48,0x103));var _0x87e4=function(_0x366587,_0x582b77){_0x366587=_0x366587-0x0;var _0xa53909=_0x7e48[_0x366587];return _0xa53909;};'use strict';var moment=require('moment');var Sequelize=require(_0x87e4('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x87e4('0x1')]},'leaveAt':{'type':Sequelize[_0x87e4('0x1')]},'acceptAt':{'type':Sequelize[_0x87e4('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8324=['STRING','DATE','moment','sequelize','exports'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x8324,0xed));var _0x4832=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x8324[_0x40822a];return _0x357420;};'use strict';var moment=require(_0x4832('0x0'));var Sequelize=require(_0x4832('0x1'));module[_0x4832('0x2')]={'uniqueid':{'type':Sequelize[_0x4832('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4832('0x3')]},'joinAt':{'type':Sequelize[_0x4832('0x4')]},'leaveAt':{'type':Sequelize[_0x4832('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 47b530b..4c5ce56 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 _0xad8f=['mustache','path','sox','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4fdb70,_0x98d2ea){var _0x3f0a4c=function(_0x4a7db0){while(--_0x4a7db0){_0x4fdb70['push'](_0x4fdb70['shift']());}};_0x3f0a4c(++_0x98d2ea);}(_0xad8f,0xd9));var _0xfad8=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xad8f[_0x29b609];return _0x54c952;};'use strict';var pdf=require(_0xfad8('0x0'));var emlformat=require(_0xfad8('0x1'));var rimraf=require(_0xfad8('0x2'));var zipdir=require(_0xfad8('0x3'));var jsonpatch=require(_0xfad8('0x4'));var rp=require(_0xfad8('0x5'));var moment=require(_0xfad8('0x6'));var BPromise=require(_0xfad8('0x7'));var Mustache=require(_0xfad8('0x8'));var util=require('util');var path=require(_0xfad8('0x9'));var sox=require(_0xfad8('0xa'));var csv=require('to-csv');var ejs=require(_0xfad8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfad8('0xc'));var crypto=require(_0xfad8('0xd'));var jsforce=require(_0xfad8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfad8('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfad8('0x10'));var authService=require(_0xfad8('0x11'));var qs=require(_0xfad8('0x12'));var as=require(_0xfad8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfad8('0x14'))(_0xfad8('0x15'));var utils=require(_0xfad8('0x16'));var config=require(_0xfad8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35852e,_0xbde44b){_0xbde44b=_0xbde44b||0xcc;return function(_0x583ade){if(_0x583ade){return _0x35852e['sendStatus'](_0xbde44b);}return _0x35852e[_0xfad8('0x18')](_0xbde44b)[_0xfad8('0x19')]();};}function respondWithResult(_0x2aacd4,_0x431b6e){_0x431b6e=_0x431b6e||0xc8;return function(_0x4ccb1f){if(_0x4ccb1f){return _0x2aacd4['status'](_0x431b6e)[_0xfad8('0x1a')](_0x4ccb1f);}};}function respondWithFilteredResult(_0x16a9f4,_0xc7db90){return function(_0x320512){if(_0x320512){var _0x1cb1ea=_0x320512[_0xfad8('0x1b')],_0x2ddb3e=_0xc7db90[_0xfad8('0x1c')],_0x2fcc96=_0xc7db90[_0xfad8('0x1c')]+_0xc7db90[_0xfad8('0x1d')],_0xa7b022;if(_0x2fcc96>=_0x1cb1ea){_0x2fcc96=_0x1cb1ea;_0xa7b022=0xc8;}else{_0xa7b022=0xce;}_0x16a9f4['status'](_0xa7b022);return _0x16a9f4[_0xfad8('0x1e')](_0xfad8('0x1f'),_0x2ddb3e+'-'+_0x2fcc96+'/'+_0x1cb1ea)[_0xfad8('0x1a')](_0x320512);}return null;};}function patchUpdates(_0x31a1f7){return function(_0x199ae2){try{jsonpatch[_0xfad8('0x20')](_0x199ae2,_0x31a1f7,!![]);}catch(_0x1bf126){return BPromise[_0xfad8('0x21')](_0x1bf126);}return _0x199ae2[_0xfad8('0x22')]();};}function saveUpdates(_0x1e4299,_0x225852){return function(_0x5cd0ce){if(_0x5cd0ce){return _0x5cd0ce[_0xfad8('0x23')](_0x1e4299)['then'](function(_0x23c9cf){return _0x23c9cf;});}return null;};}function removeEntity(_0xf8002,_0x25e327){return function(_0x2c89ba){if(_0x2c89ba){return _0x2c89ba[_0xfad8('0x24')]()[_0xfad8('0x25')](function(){_0xf8002[_0xfad8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8aa5,_0x55105f){return function(_0x7083b0){if(!_0x7083b0){_0x4a8aa5[_0xfad8('0x26')](0x194);}return _0x7083b0;};}function handleError(_0x50d4a4,_0x59eb1a){_0x59eb1a=_0x59eb1a||0x1f4;return function(_0x4f032a){logger[_0xfad8('0x27')](_0x4f032a[_0xfad8('0x28')]);if(_0x4f032a[_0xfad8('0x29')]){delete _0x4f032a[_0xfad8('0x29')];}_0x50d4a4[_0xfad8('0x18')](_0x59eb1a)[_0xfad8('0x2a')](_0x4f032a);};}exports[_0xfad8('0x2b')]=function(_0x5551d1,_0x3eb1fe){var _0x53f70a={},_0x13ab1f={},_0x8c46fb={'count':0x0,'rows':[]};var _0x5181a7=_[_0xfad8('0x2c')](db[_0xfad8('0x2d')][_0xfad8('0x2e')],function(_0x4d846a){return{'name':_0x4d846a['fieldName'],'type':_0x4d846a[_0xfad8('0x2f')][_0xfad8('0x30')]};});_0x13ab1f[_0xfad8('0x31')]=_['map'](_0x5181a7,_0xfad8('0x29'));_0x13ab1f[_0xfad8('0x32')]=_['keys'](_0x5551d1[_0xfad8('0x32')]);_0x13ab1f[_0xfad8('0x33')]=_[_0xfad8('0x34')](_0x13ab1f[_0xfad8('0x31')],_0x13ab1f['query']);_0x53f70a[_0xfad8('0x35')]=_[_0xfad8('0x34')](_0x13ab1f[_0xfad8('0x31')],qs[_0xfad8('0x36')](_0x5551d1[_0xfad8('0x32')][_0xfad8('0x36')]));_0x53f70a[_0xfad8('0x35')]=_0x53f70a[_0xfad8('0x35')][_0xfad8('0x37')]?_0x53f70a[_0xfad8('0x35')]:_0x13ab1f[_0xfad8('0x31')];if(!_0x5551d1[_0xfad8('0x32')][_0xfad8('0x38')](_0xfad8('0x39'))){_0x53f70a[_0xfad8('0x1d')]=qs[_0xfad8('0x1d')](_0x5551d1[_0xfad8('0x32')]['limit']);_0x53f70a[_0xfad8('0x1c')]=qs[_0xfad8('0x1c')](_0x5551d1[_0xfad8('0x32')][_0xfad8('0x1c')]);}_0x53f70a['order']=qs[_0xfad8('0x3a')](_0x5551d1[_0xfad8('0x32')][_0xfad8('0x3a')]);_0x53f70a[_0xfad8('0x3b')]=qs[_0xfad8('0x33')](_[_0xfad8('0x3c')](_0x5551d1['query'],_0x13ab1f[_0xfad8('0x33')]),_0x5181a7);if(_0x5551d1[_0xfad8('0x32')][_0xfad8('0x3d')]){_0x53f70a[_0xfad8('0x3b')]=_['merge'](_0x53f70a[_0xfad8('0x3b')],{'$or':_[_0xfad8('0x2c')](_0x5181a7,function(_0x3d591c){if(_0x3d591c[_0xfad8('0x2f')]!==_0xfad8('0x3e')){var _0x4543bf={};_0x4543bf[_0x3d591c['name']]={'$like':'%'+_0x5551d1[_0xfad8('0x32')][_0xfad8('0x3d')]+'%'};return _0x4543bf;}})});}_0x53f70a=_['merge']({},_0x53f70a,_0x5551d1[_0xfad8('0x3f')]);var _0x2ec793={'where':_0x53f70a[_0xfad8('0x3b')]};return db[_0xfad8('0x2d')]['count'](_0x2ec793)[_0xfad8('0x25')](function(_0x443f2e){_0x8c46fb[_0xfad8('0x1b')]=_0x443f2e;if(_0x5551d1[_0xfad8('0x32')]['includeAll']){_0x53f70a[_0xfad8('0x40')]=[{'all':!![]}];}return db[_0xfad8('0x2d')][_0xfad8('0x41')](_0x53f70a);})[_0xfad8('0x25')](function(_0x5cba54){_0x8c46fb['rows']=_0x5cba54;return _0x8c46fb;})[_0xfad8('0x25')](respondWithFilteredResult(_0x3eb1fe,_0x53f70a))[_0xfad8('0x42')](handleError(_0x3eb1fe,null));};exports[_0xfad8('0x43')]=function(_0x2d18cc,_0x43a74c){var _0x3b4906={'raw':!![],'where':{'id':_0x2d18cc[_0xfad8('0x44')]['id']}},_0x58384b={};_0x58384b[_0xfad8('0x31')]=_[_0xfad8('0x45')](db['MailQueueReport']['rawAttributes']);_0x58384b[_0xfad8('0x32')]=_['keys'](_0x2d18cc[_0xfad8('0x32')]);_0x58384b[_0xfad8('0x33')]=_['intersection'](_0x58384b['model'],_0x58384b['query']);_0x3b4906[_0xfad8('0x35')]=_[_0xfad8('0x34')](_0x58384b[_0xfad8('0x31')],qs[_0xfad8('0x36')](_0x2d18cc[_0xfad8('0x32')][_0xfad8('0x36')]));_0x3b4906[_0xfad8('0x35')]=_0x3b4906[_0xfad8('0x35')][_0xfad8('0x37')]?_0x3b4906['attributes']:_0x58384b[_0xfad8('0x31')];if(_0x2d18cc['query'][_0xfad8('0x46')]){_0x3b4906[_0xfad8('0x40')]=[{'all':!![]}];}_0x3b4906=_['merge']({},_0x3b4906,_0x2d18cc['options']);return db[_0xfad8('0x2d')][_0xfad8('0x47')](_0x3b4906)[_0xfad8('0x25')](handleEntityNotFound(_0x43a74c,null))[_0xfad8('0x25')](respondWithResult(_0x43a74c,null))[_0xfad8('0x42')](handleError(_0x43a74c,null));};exports[_0xfad8('0x48')]=function(_0x35bb7,_0x4291a9){return db[_0xfad8('0x2d')][_0xfad8('0x48')](_0x35bb7['body'],{})[_0xfad8('0x25')](respondWithResult(_0x4291a9,0xc9))[_0xfad8('0x42')](handleError(_0x4291a9,null));};exports[_0xfad8('0x23')]=function(_0x1cb111,_0x355fe8){if(_0x1cb111[_0xfad8('0x49')]['id']){delete _0x1cb111[_0xfad8('0x49')]['id'];}return db[_0xfad8('0x2d')]['find']({'where':{'id':_0x1cb111[_0xfad8('0x44')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x355fe8,null))[_0xfad8('0x25')](saveUpdates(_0x1cb111[_0xfad8('0x49')],null))[_0xfad8('0x25')](respondWithResult(_0x355fe8,null))[_0xfad8('0x42')](handleError(_0x355fe8,null));};exports[_0xfad8('0x24')]=function(_0x310f5f,_0x47bedd){return db['MailQueueReport']['find']({'where':{'id':_0x310f5f[_0xfad8('0x44')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x47bedd,null))[_0xfad8('0x25')](removeEntity(_0x47bedd,null))[_0xfad8('0x42')](handleError(_0x47bedd,null));};exports[_0xfad8('0x4a')]=function(_0x3f451f,_0xbca7c5){return db[_0xfad8('0x2d')]['describe']()[_0xfad8('0x25')](respondWithResult(_0xbca7c5,null))[_0xfad8('0x42')](handleError(_0xbca7c5,null));}; \ No newline at end of file +var _0x374f=['moment','bluebird','mustache','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','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','MailQueueReport','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x7e6bb2,_0x559c4b){var _0x3b7a3c=function(_0x33c1d6){while(--_0x33c1d6){_0x7e6bb2['push'](_0x7e6bb2['shift']());}};_0x3b7a3c(++_0x559c4b);}(_0x374f,0x13f));var _0xf374=function(_0x552694,_0x310ead){_0x552694=_0x552694-0x0;var _0x741c5e=_0x374f[_0x552694];return _0x741c5e;};'use strict';var pdf=require(_0xf374('0x0'));var emlformat=require(_0xf374('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf374('0x2'));var jsonpatch=require(_0xf374('0x3'));var rp=require(_0xf374('0x4'));var moment=require(_0xf374('0x5'));var BPromise=require(_0xf374('0x6'));var Mustache=require(_0xf374('0x7'));var util=require(_0xf374('0x8'));var path=require(_0xf374('0x9'));var sox=require(_0xf374('0xa'));var csv=require(_0xf374('0xb'));var ejs=require(_0xf374('0xc'));var fs=require('fs');var _=require(_0xf374('0xd'));var squel=require(_0xf374('0xe'));var crypto=require(_0xf374('0xf'));var jsforce=require(_0xf374('0x10'));var deskjs=require(_0xf374('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf374('0x12'));var Papa=require(_0xf374('0x13'));var Redis=require(_0xf374('0x14'));var authService=require(_0xf374('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf374('0x16'));var hardwareService=require(_0xf374('0x17'));var logger=require(_0xf374('0x18'))(_0xf374('0x19'));var utils=require(_0xf374('0x1a'));var config=require(_0xf374('0x1b'));var db=require(_0xf374('0x1c'))['db'];function respondWithStatusCode(_0x1576eb,_0x2fe28e){_0x2fe28e=_0x2fe28e||0xcc;return function(_0x25f4c0){if(_0x25f4c0){return _0x1576eb[_0xf374('0x1d')](_0x2fe28e);}return _0x1576eb[_0xf374('0x1e')](_0x2fe28e)['end']();};}function respondWithResult(_0xf13324,_0x12983f){_0x12983f=_0x12983f||0xc8;return function(_0x1d580e){if(_0x1d580e){return _0xf13324[_0xf374('0x1e')](_0x12983f)[_0xf374('0x1f')](_0x1d580e);}};}function respondWithFilteredResult(_0x5e301e,_0x36e19e){return function(_0x106c95){if(_0x106c95){var _0x4f3f78=_0x106c95[_0xf374('0x20')],_0x3fe252=_0x36e19e[_0xf374('0x21')],_0x2ea529=_0x36e19e['offset']+_0x36e19e[_0xf374('0x22')],_0x2779f1;if(_0x2ea529>=_0x4f3f78){_0x2ea529=_0x4f3f78;_0x2779f1=0xc8;}else{_0x2779f1=0xce;}_0x5e301e[_0xf374('0x1e')](_0x2779f1);return _0x5e301e[_0xf374('0x23')]('Content-Range',_0x3fe252+'-'+_0x2ea529+'/'+_0x4f3f78)['json'](_0x106c95);}return null;};}function patchUpdates(_0xe2081){return function(_0x5d316f){try{jsonpatch[_0xf374('0x24')](_0x5d316f,_0xe2081,!![]);}catch(_0x1d68d0){return BPromise[_0xf374('0x25')](_0x1d68d0);}return _0x5d316f[_0xf374('0x26')]();};}function saveUpdates(_0x2c4632,_0x4a45c1){return function(_0xc99a43){if(_0xc99a43){return _0xc99a43[_0xf374('0x27')](_0x2c4632)['then'](function(_0xb8e9ad){return _0xb8e9ad;});}return null;};}function removeEntity(_0x2545c7,_0x34f811){return function(_0x39b3e0){if(_0x39b3e0){return _0x39b3e0[_0xf374('0x28')]()[_0xf374('0x29')](function(){_0x2545c7[_0xf374('0x1e')](0xcc)[_0xf374('0x2a')]();});}};}function handleEntityNotFound(_0x48e06a,_0xeb9fc6){return function(_0x5d611e){if(!_0x5d611e){_0x48e06a[_0xf374('0x1d')](0x194);}return _0x5d611e;};}function handleError(_0x4253f0,_0x12ed7f){_0x12ed7f=_0x12ed7f||0x1f4;return function(_0x19d2f9){logger[_0xf374('0x2b')](_0x19d2f9[_0xf374('0x2c')]);if(_0x19d2f9[_0xf374('0x2d')]){delete _0x19d2f9[_0xf374('0x2d')];}_0x4253f0[_0xf374('0x1e')](_0x12ed7f)[_0xf374('0x2e')](_0x19d2f9);};}exports[_0xf374('0x2f')]=function(_0x5ebf3a,_0x2fa124){var _0x2f6aa1={},_0x596a07={},_0x51bd30={'count':0x0,'rows':[]};var _0x2e78bb=_[_0xf374('0x30')](db['MailQueueReport'][_0xf374('0x31')],function(_0x428154){return{'name':_0x428154[_0xf374('0x32')],'type':_0x428154['type']['key']};});_0x596a07[_0xf374('0x33')]=_[_0xf374('0x30')](_0x2e78bb,_0xf374('0x2d'));_0x596a07[_0xf374('0x34')]=_[_0xf374('0x35')](_0x5ebf3a[_0xf374('0x34')]);_0x596a07[_0xf374('0x36')]=_[_0xf374('0x37')](_0x596a07['model'],_0x596a07[_0xf374('0x34')]);_0x2f6aa1[_0xf374('0x38')]=_[_0xf374('0x37')](_0x596a07[_0xf374('0x33')],qs['fields'](_0x5ebf3a[_0xf374('0x34')][_0xf374('0x39')]));_0x2f6aa1[_0xf374('0x38')]=_0x2f6aa1[_0xf374('0x38')]['length']?_0x2f6aa1[_0xf374('0x38')]:_0x596a07[_0xf374('0x33')];if(!_0x5ebf3a['query'][_0xf374('0x3a')]('nolimit')){_0x2f6aa1[_0xf374('0x22')]=qs[_0xf374('0x22')](_0x5ebf3a[_0xf374('0x34')][_0xf374('0x22')]);_0x2f6aa1[_0xf374('0x21')]=qs[_0xf374('0x21')](_0x5ebf3a[_0xf374('0x34')][_0xf374('0x21')]);}_0x2f6aa1[_0xf374('0x3b')]=qs[_0xf374('0x3c')](_0x5ebf3a['query'][_0xf374('0x3c')]);_0x2f6aa1[_0xf374('0x3d')]=qs['filters'](_[_0xf374('0x3e')](_0x5ebf3a[_0xf374('0x34')],_0x596a07[_0xf374('0x36')]),_0x2e78bb);if(_0x5ebf3a['query'][_0xf374('0x3f')]){_0x2f6aa1[_0xf374('0x3d')]=_[_0xf374('0x40')](_0x2f6aa1[_0xf374('0x3d')],{'$or':_[_0xf374('0x30')](_0x2e78bb,function(_0x36f96b){if(_0x36f96b[_0xf374('0x41')]!==_0xf374('0x42')){var _0x1f7731={};_0x1f7731[_0x36f96b[_0xf374('0x2d')]]={'$like':'%'+_0x5ebf3a['query']['filter']+'%'};return _0x1f7731;}})});}_0x2f6aa1=_[_0xf374('0x40')]({},_0x2f6aa1,_0x5ebf3a[_0xf374('0x43')]);var _0x35eff6={'where':_0x2f6aa1['where']};return db['MailQueueReport'][_0xf374('0x20')](_0x35eff6)[_0xf374('0x29')](function(_0xe17db){_0x51bd30[_0xf374('0x20')]=_0xe17db;if(_0x5ebf3a[_0xf374('0x34')][_0xf374('0x44')]){_0x2f6aa1[_0xf374('0x45')]=[{'all':!![]}];}return db['MailQueueReport'][_0xf374('0x46')](_0x2f6aa1);})['then'](function(_0x5b9596){_0x51bd30[_0xf374('0x47')]=_0x5b9596;return _0x51bd30;})[_0xf374('0x29')](respondWithFilteredResult(_0x2fa124,_0x2f6aa1))['catch'](handleError(_0x2fa124,null));};exports[_0xf374('0x48')]=function(_0x216637,_0x4bcf7d){var _0x5bde7c={'raw':!![],'where':{'id':_0x216637['params']['id']}},_0xe5b4dc={};_0xe5b4dc[_0xf374('0x33')]=_['keys'](db['MailQueueReport'][_0xf374('0x31')]);_0xe5b4dc[_0xf374('0x34')]=_[_0xf374('0x35')](_0x216637[_0xf374('0x34')]);_0xe5b4dc[_0xf374('0x36')]=_[_0xf374('0x37')](_0xe5b4dc['model'],_0xe5b4dc['query']);_0x5bde7c['attributes']=_[_0xf374('0x37')](_0xe5b4dc[_0xf374('0x33')],qs[_0xf374('0x39')](_0x216637[_0xf374('0x34')][_0xf374('0x39')]));_0x5bde7c[_0xf374('0x38')]=_0x5bde7c[_0xf374('0x38')][_0xf374('0x49')]?_0x5bde7c[_0xf374('0x38')]:_0xe5b4dc[_0xf374('0x33')];if(_0x216637[_0xf374('0x34')]['includeAll']){_0x5bde7c[_0xf374('0x45')]=[{'all':!![]}];}_0x5bde7c=_[_0xf374('0x40')]({},_0x5bde7c,_0x216637[_0xf374('0x43')]);return db[_0xf374('0x4a')][_0xf374('0x4b')](_0x5bde7c)[_0xf374('0x29')](handleEntityNotFound(_0x4bcf7d,null))['then'](respondWithResult(_0x4bcf7d,null))[_0xf374('0x4c')](handleError(_0x4bcf7d,null));};exports[_0xf374('0x4d')]=function(_0x4f93cd,_0x36f828){return db['MailQueueReport'][_0xf374('0x4d')](_0x4f93cd[_0xf374('0x4e')],{})[_0xf374('0x29')](respondWithResult(_0x36f828,0xc9))['catch'](handleError(_0x36f828,null));};exports['update']=function(_0xfb9de2,_0x10adfb){if(_0xfb9de2[_0xf374('0x4e')]['id']){delete _0xfb9de2['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0xfb9de2[_0xf374('0x4f')]['id']}})[_0xf374('0x29')](handleEntityNotFound(_0x10adfb,null))[_0xf374('0x29')](saveUpdates(_0xfb9de2[_0xf374('0x4e')],null))[_0xf374('0x29')](respondWithResult(_0x10adfb,null))['catch'](handleError(_0x10adfb,null));};exports['destroy']=function(_0x4402c0,_0x529aac){return db[_0xf374('0x4a')][_0xf374('0x4b')]({'where':{'id':_0x4402c0[_0xf374('0x4f')]['id']}})[_0xf374('0x29')](handleEntityNotFound(_0x529aac,null))[_0xf374('0x29')](removeEntity(_0x529aac,null))[_0xf374('0x4c')](handleError(_0x529aac,null));};exports['describe']=function(_0x5048a1,_0x474351){return db[_0xf374('0x4a')][_0xf374('0x50')]()[_0xf374('0x29')](respondWithResult(_0x474351,null))[_0xf374('0x4c')](handleError(_0x474351,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b148d21..66d58b2 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 _0x4af8=['path','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','moment','bluebird','request-promise'];(function(_0x132a19,_0x26fae6){var _0x33bf22=function(_0xf80837){while(--_0xf80837){_0x132a19['push'](_0x132a19['shift']());}};_0x33bf22(++_0x26fae6);}(_0x4af8,0x1ad));var _0x84af=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4af8[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x84af('0x0'));var BPromise=require(_0x84af('0x1'));var rp=require(_0x84af('0x2'));var fs=require('fs');var path=require(_0x84af('0x3'));var rimraf=require('rimraf');var config=require(_0x84af('0x4'));var attributes=require(_0x84af('0x5'));module['exports']=function(_0x37c4f9,_0x3971f1){return _0x37c4f9['define'](_0x84af('0x6'),attributes,{'tableName':_0x84af('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x04d5=['exports','define','MailQueueReport','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x04d5,0xe1));var _0x504d=function(_0x21dcbd,_0xb9e194){_0x21dcbd=_0x21dcbd-0x0;var _0xee924b=_0x04d5[_0x21dcbd];return _0xee924b;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var logger=require('../../config/logger')(_0x504d('0x2'));var moment=require(_0x504d('0x3'));var BPromise=require(_0x504d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x504d('0x5'));var rimraf=require(_0x504d('0x6'));var config=require(_0x504d('0x7'));var attributes=require(_0x504d('0x8'));module[_0x504d('0x9')]=function(_0x535671,_0x289d44){return _0x535671[_0x504d('0xa')](_0x504d('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x504d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index e181990..ceb0cc4 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 _0x7096=['then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','UpdateMailQueueReport','update','where','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5596f3,_0x47ce95){var _0x4da3da=function(_0x325482){while(--_0x325482){_0x5596f3['push'](_0x5596f3['shift']());}};_0x4da3da(++_0x47ce95);}(_0x7096,0x10c));var _0x6709=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7096[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['create'](_0x235a54[_0x6709('0x18')],{'raw':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c4971){logger[_0x6709('0xc')](_0x6709('0x16'),_0x235a54);logger[_0x6709('0xf')](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x3c4971));_0x9c1fd8(_0x3c4971);})[_0x6709('0x15')](function(_0x17763d){logger[_0x6709('0x11')](_0x6709('0x16'),_0x17763d[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e[_0x6709('0x11')](0x1f4,_0x17763d['message']));});});};exports[_0x6709('0x1b')]=function(_0x81138e){var _0x2bcc73=this;return new Promise(function(_0x5c7982,_0x2e3483){return db[_0x6709('0x17')][_0x6709('0x1c')](_0x81138e[_0x6709('0x18')],{'raw':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1d')]||null:null,'attributes':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1e')]||null:null,'limit':_0x81138e['options']?_0x81138e[_0x6709('0x19')]['limit']||null:null})[_0x6709('0xb')](function(_0x3cd555){logger['info'](_0x6709('0x1b'),_0x81138e);logger['debug'](_0x6709('0x1b'),_0x81138e,JSON[_0x6709('0x10')](_0x3cd555));_0x5c7982(_0x3cd555);})['catch'](function(_0x1a9eea){logger['error'](_0x6709('0x1b'),_0x1a9eea[_0x6709('0x13')],_0x81138e);_0x2e3483(_0x2bcc73['error'](0x1f4,_0x1a9eea['message']));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailQueueReport','body','raw','stringify','MailQueueReport','update','options','where','attributes','limit','UpdateMailQueueReport','lodash','util'];(function(_0x4553e8,_0x480e3c){var _0x99e41=function(_0x4cf964){while(--_0x4cf964){_0x4553e8['push'](_0x4553e8['shift']());}};_0x99e41(++_0x480e3c);}(_0x814b,0x1a2));var _0xb814=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x814b[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['MailQueueReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateMailQueueReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 117c38e..30f82a0 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 _0x2605=['../../components/interaction/service','../../config/environment','exports','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3a1cfe,_0x56db3e){var _0x1d6ff8=function(_0x4b7e54){while(--_0x4b7e54){_0x3a1cfe['push'](_0x3a1cfe['shift']());}};_0x1d6ff8(++_0x56db3e);}(_0x2605,0xc7));var _0x5260=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0x2605[_0x30faee];return _0x3a90ab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5260('0x0'));var express=require(_0x5260('0x1'));var router=express[_0x5260('0x2')]();var auth=require(_0x5260('0x3'));var interaction=require(_0x5260('0x4'));var config=require(_0x5260('0x5'));module[_0x5260('0x6')]=router; \ No newline at end of file +var _0x20a3=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','express','Router'];(function(_0x1f9398,_0x136e5c){var _0x4cc1d8=function(_0x35f681){while(--_0x35f681){_0x1f9398['push'](_0x1f9398['shift']());}};_0x4cc1d8(++_0x136e5c);}(_0x20a3,0x1c4));var _0x320a=function(_0xdaca47,_0x2e098a){_0xdaca47=_0xdaca47-0x0;var _0xa08d8a=_0x20a3[_0xdaca47];return _0xa08d8a;};'use strict';var multer=require('multer');var util=require(_0x320a('0x0'));var path=require(_0x320a('0x1'));var timeout=require('connect-timeout');var express=require(_0x320a('0x2'));var router=express[_0x320a('0x3')]();var auth=require(_0x320a('0x4'));var interaction=require(_0x320a('0x5'));var config=require(_0x320a('0x6'));module[_0x320a('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8266e06..c2a67db 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 _0x861f=['sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x33a764,_0x2fa127){var _0x3afb83=function(_0x337fb4){while(--_0x337fb4){_0x33a764['push'](_0x33a764['shift']());}};_0x3afb83(++_0x2fa127);}(_0x861f,0xba));var _0xf861=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0x861f[_0x2fbcf6];return _0x3e7265;};'use strict';var Sequelize=require(_0xf861('0x0'));module[_0xf861('0x1')]={'description':{'type':Sequelize[_0xf861('0x2')]},'host':{'type':Sequelize[_0xf861('0x2')]},'authentication':{'type':Sequelize[_0xf861('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf861('0x2')],'unique':_0xf861('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf861('0x5')]},'tls':{'type':Sequelize[_0xf861('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf861('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf861('0x2')]}}; \ No newline at end of file +var _0x994c=['INBOX','exports','STRING','INTEGER','BOOLEAN'];(function(_0x431fac,_0x3fcd5d){var _0x5af77e=function(_0x471598){while(--_0x471598){_0x431fac['push'](_0x431fac['shift']());}};_0x5af77e(++_0x3fcd5d);}(_0x994c,0x97));var _0xc994=function(_0x2e0fed,_0xe54484){_0x2e0fed=_0x2e0fed-0x0;var _0x476227=_0x994c[_0x2e0fed];return _0x476227;};'use strict';var Sequelize=require('sequelize');module[_0xc994('0x0')]={'description':{'type':Sequelize[_0xc994('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xc994('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc994('0x2')]},'tls':{'type':Sequelize[_0xc994('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc994('0x1')],'defaultValue':_0xc994('0x4')},'connTimeout':{'type':Sequelize[_0xc994('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc994('0x2')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5c0cf72..bcbae2d 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 _0x66da=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','path'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x66da,0x16f));var _0xa66d=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x66da[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0xa66d('0x0'));var util=require(_0xa66d('0x1'));var logger=require(_0xa66d('0x2'))(_0xa66d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa66d('0x4'));var rimraf=require(_0xa66d('0x5'));var config=require(_0xa66d('0x6'));var attributes=require(_0xa66d('0x7'));module[_0xa66d('0x8')]=function(_0x4ee440,_0x142a69){return _0x4ee440[_0xa66d('0x9')](_0xa66d('0xa'),attributes,{'tableName':_0xa66d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3ff=['path','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xf3ff,0xae));var _0xff3f=function(_0x3ec988,_0x1d95f3){_0x3ec988=_0x3ec988-0x0;var _0x2fc0b9=_0xf3ff[_0x3ec988];return _0x2fc0b9;};'use strict';var _=require(_0xff3f('0x0'));var util=require('util');var logger=require(_0xff3f('0x1'))(_0xff3f('0x2'));var moment=require(_0xff3f('0x3'));var BPromise=require(_0xff3f('0x4'));var rp=require(_0xff3f('0x5'));var fs=require('fs');var path=require(_0xff3f('0x6'));var rimraf=require('rimraf');var config=require(_0xff3f('0x7'));var attributes=require(_0xff3f('0x8'));module[_0xff3f('0x9')]=function(_0x56208b,_0x3591f9){return _0x56208b[_0xff3f('0xa')]('MailServerIn',attributes,{'tableName':_0xff3f('0xb'),'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 01b5f3f..ddafb5c 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 _0xc611=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','lodash','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc611,0x1aa));var _0x1c61=function(_0x50e1d3,_0x1bead5){_0x50e1d3=_0x50e1d3-0x0;var _0x1fdf4d=_0xc611[_0x50e1d3];return _0x1fdf4d;};'use strict';var _=require(_0x1c61('0x0'));var util=require('util');var moment=require(_0x1c61('0x1'));var BPromise=require(_0x1c61('0x2'));var rs=require(_0x1c61('0x3'));var fs=require('fs');var Redis=require(_0x1c61('0x4'));var db=require(_0x1c61('0x5'))['db'];var utils=require(_0x1c61('0x6'));var logger=require(_0x1c61('0x7'))(_0x1c61('0x8'));var config=require(_0x1c61('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1c61('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e917b,_0x4e6885,_0x5e7e58){return new BPromise(function(_0xf58c06,_0x40af6e){return client[_0x1c61('0xb')](_0x8e917b,_0x5e7e58)[_0x1c61('0xc')](function(_0x21591c){logger[_0x1c61('0xd')](_0x1c61('0xe'),_0x4e6885,'request\x20sent');logger[_0x1c61('0xf')](_0x1c61('0x10'),_0x4e6885,_0x1c61('0x11'),JSON[_0x1c61('0x12')](_0x21591c));if(_0x21591c[_0x1c61('0x13')]){if(_0x21591c[_0x1c61('0x13')][_0x1c61('0x14')]===0x1f4){logger[_0x1c61('0x13')](_0x1c61('0xe'),_0x4e6885,_0x21591c['error'][_0x1c61('0x15')]);return _0x40af6e(_0x21591c[_0x1c61('0x13')]['message']);}logger['error'](_0x1c61('0xe'),_0x4e6885,_0x21591c[_0x1c61('0x13')]['message']);return _0xf58c06(_0x21591c[_0x1c61('0x13')][_0x1c61('0x15')]);}else{logger[_0x1c61('0xd')](_0x1c61('0xe'),_0x4e6885,_0x1c61('0x11'));_0xf58c06(_0x21591c[_0x1c61('0x16')]['message']);}})['catch'](function(_0x2a0ba5){logger[_0x1c61('0x13')](_0x1c61('0xe'),_0x4e6885,_0x2a0ba5);_0x40af6e(_0x2a0ba5);});});}exports[_0x1c61('0x17')]=function(_0x52f9ad){var _0x348214=this;return new Promise(function(_0x193ed2,_0x3bccf2){return db[_0x1c61('0x18')][_0x1c61('0x19')]({'raw':_0x52f9ad[_0x1c61('0x1a')]?_0x52f9ad[_0x1c61('0x1a')][_0x1c61('0x1b')]===undefined?!![]:![]:!![],'where':_0x52f9ad[_0x1c61('0x1a')]?_0x52f9ad[_0x1c61('0x1a')]['where']||null:null,'attributes':_0x52f9ad[_0x1c61('0x1a')]?_0x52f9ad['options'][_0x1c61('0x1c')]||null:null,'limit':_0x52f9ad[_0x1c61('0x1a')]?_0x52f9ad[_0x1c61('0x1a')][_0x1c61('0x1d')]||null:null,'include':_0x52f9ad[_0x1c61('0x1a')]?_0x52f9ad['options'][_0x1c61('0x1e')]?_['map'](_0x52f9ad[_0x1c61('0x1a')][_0x1c61('0x1e')],function(_0x1d72fc){return{'model':db[_0x1d72fc['model']],'as':_0x1d72fc['as'],'attributes':_0x1d72fc[_0x1c61('0x1c')],'include':_0x1d72fc[_0x1c61('0x1e')]?_['map'](_0x1d72fc['include'],function(_0x35ef5f){return{'model':db[_0x35ef5f['model']],'as':_0x35ef5f['as'],'attributes':_0x35ef5f['attributes'],'include':_0x35ef5f[_0x1c61('0x1e')]?_[_0x1c61('0x1f')](_0x35ef5f[_0x1c61('0x1e')],function(_0xc29eeb){return{'model':db[_0xc29eeb[_0x1c61('0x20')]],'as':_0xc29eeb['as'],'attributes':_0xc29eeb['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c61('0xc')](function(_0x27a570){logger[_0x1c61('0xd')]('GetMailServerIn',_0x52f9ad);logger[_0x1c61('0xf')]('GetMailServerIn',_0x52f9ad,JSON[_0x1c61('0x12')](_0x27a570));_0x193ed2(_0x27a570);})['catch'](function(_0x37482a){logger[_0x1c61('0x13')](_0x1c61('0x17'),_0x37482a['message'],_0x52f9ad);_0x3bccf2(_0x348214['error'](0x1f4,_0x37482a['message']));});});}; \ No newline at end of file +var _0x2810=['include','map','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit'];(function(_0x155c9d,_0x3dd022){var _0xacabfa=function(_0x3ebc16){while(--_0x3ebc16){_0x155c9d['push'](_0x155c9d['shift']());}};_0xacabfa(++_0x3dd022);}(_0x2810,0xb8));var _0x0281=function(_0x1cfc70,_0x183723){_0x1cfc70=_0x1cfc70-0x0;var _0xe6955d=_0x2810[_0x1cfc70];return _0xe6955d;};'use strict';var _=require(_0x0281('0x0'));var util=require(_0x0281('0x1'));var moment=require(_0x0281('0x2'));var BPromise=require('bluebird');var rs=require(_0x0281('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0281('0x4'))['db'];var utils=require(_0x0281('0x5'));var logger=require(_0x0281('0x6'))(_0x0281('0x7'));var config=require(_0x0281('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0281('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1010b4,_0x4178ef,_0x4a6d4c){return new BPromise(function(_0x489d5b,_0x3f5899){return client['request'](_0x1010b4,_0x4a6d4c)[_0x0281('0xa')](function(_0x4bd422){logger[_0x0281('0xb')](_0x0281('0xc'),_0x4178ef,_0x0281('0xd'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4178ef,_0x0281('0xd'),JSON[_0x0281('0xe')](_0x4bd422));if(_0x4bd422[_0x0281('0xf')]){if(_0x4bd422[_0x0281('0xf')][_0x0281('0x10')]===0x1f4){logger['error'](_0x0281('0xc'),_0x4178ef,_0x4bd422[_0x0281('0xf')][_0x0281('0x11')]);return _0x3f5899(_0x4bd422['error'][_0x0281('0x11')]);}logger[_0x0281('0xf')](_0x0281('0xc'),_0x4178ef,_0x4bd422[_0x0281('0xf')][_0x0281('0x11')]);return _0x489d5b(_0x4bd422['error'][_0x0281('0x11')]);}else{logger[_0x0281('0xb')]('MailServerIn,\x20%s,\x20%s',_0x4178ef,_0x0281('0xd'));_0x489d5b(_0x4bd422[_0x0281('0x12')][_0x0281('0x11')]);}})['catch'](function(_0x4f28b7){logger['error'](_0x0281('0xc'),_0x4178ef,_0x4f28b7);_0x3f5899(_0x4f28b7);});});}exports[_0x0281('0x13')]=function(_0x143944){var _0x86790e=this;return new Promise(function(_0x2f39d7,_0x3df8ab){return db[_0x0281('0x14')][_0x0281('0x15')]({'raw':_0x143944[_0x0281('0x16')]?_0x143944['options'][_0x0281('0x17')]===undefined?!![]:![]:!![],'where':_0x143944['options']?_0x143944[_0x0281('0x16')]['where']||null:null,'attributes':_0x143944[_0x0281('0x16')]?_0x143944['options'][_0x0281('0x18')]||null:null,'limit':_0x143944[_0x0281('0x16')]?_0x143944['options'][_0x0281('0x19')]||null:null,'include':_0x143944['options']?_0x143944[_0x0281('0x16')][_0x0281('0x1a')]?_[_0x0281('0x1b')](_0x143944[_0x0281('0x16')][_0x0281('0x1a')],function(_0x2fb3e5){return{'model':db[_0x2fb3e5[_0x0281('0x1c')]],'as':_0x2fb3e5['as'],'attributes':_0x2fb3e5['attributes'],'include':_0x2fb3e5[_0x0281('0x1a')]?_[_0x0281('0x1b')](_0x2fb3e5[_0x0281('0x1a')],function(_0x167631){return{'model':db[_0x167631[_0x0281('0x1c')]],'as':_0x167631['as'],'attributes':_0x167631['attributes'],'include':_0x167631['include']?_[_0x0281('0x1b')](_0x167631['include'],function(_0x19a628){return{'model':db[_0x19a628[_0x0281('0x1c')]],'as':_0x19a628['as'],'attributes':_0x19a628[_0x0281('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0281('0xa')](function(_0x2b00e6){logger[_0x0281('0xb')](_0x0281('0x13'),_0x143944);logger[_0x0281('0x1d')](_0x0281('0x13'),_0x143944,JSON[_0x0281('0xe')](_0x2b00e6));_0x2f39d7(_0x2b00e6);})['catch'](function(_0x220563){logger[_0x0281('0xf')](_0x0281('0x13'),_0x220563['message'],_0x143944);_0x3df8ab(_0x86790e[_0x0281('0xf')](0x1f4,_0x220563['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c020fbb..3b5cd6c 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 _0x088a=['update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x088a,0xa4));var _0xa088=function(_0x56fe68,_0x40fdef){_0x56fe68=_0x56fe68-0x0;var _0x1eeb3b=_0x088a[_0x56fe68];return _0x1eeb3b;};'use strict';var multer=require('multer');var util=require(_0xa088('0x0'));var path=require(_0xa088('0x1'));var timeout=require(_0xa088('0x2'));var express=require(_0xa088('0x3'));var router=express[_0xa088('0x4')]();var auth=require(_0xa088('0x5'));var interaction=require(_0xa088('0x6'));var config=require(_0xa088('0x7'));var controller=require(_0xa088('0x8'));router[_0xa088('0x9')]('/',auth[_0xa088('0xa')](),controller[_0xa088('0xb')]);router[_0xa088('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa088('0xc')]);router[_0xa088('0xd')]('/',auth['isAuthenticated'](),controller[_0xa088('0xe')]);router[_0xa088('0xf')]('/:id',auth[_0xa088('0xa')](),controller[_0xa088('0x10')]);router[_0xa088('0x11')]('/:id',auth[_0xa088('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb544=['index','/:id','show','post','create','put','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated'];(function(_0x77e934,_0x5372c3){var _0x1779a9=function(_0x471ca5){while(--_0x471ca5){_0x77e934['push'](_0x77e934['shift']());}};_0x1779a9(++_0x5372c3);}(_0xb544,0x1b1));var _0x4b54=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb544[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x4b54('0x0'));var util=require(_0x4b54('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4b54('0x2'));var router=express[_0x4b54('0x3')]();var auth=require(_0x4b54('0x4'));var interaction=require(_0x4b54('0x5'));var config=require('../../config/environment');var controller=require(_0x4b54('0x6'));router[_0x4b54('0x7')]('/',auth[_0x4b54('0x8')](),controller[_0x4b54('0x9')]);router[_0x4b54('0x7')](_0x4b54('0xa'),auth[_0x4b54('0x8')](),controller[_0x4b54('0xb')]);router[_0x4b54('0xc')]('/',auth['isAuthenticated'](),controller[_0x4b54('0xd')]);router[_0x4b54('0xe')](_0x4b54('0xa'),auth[_0x4b54('0x8')](),controller['update']);router['delete']('/:id',auth[_0x4b54('0x8')](),controller[_0x4b54('0xf')]);module[_0x4b54('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0618cdb..1cf2cfd 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 _0xdbfa=['INTEGER','BOOLEAN','STRING'];(function(_0x1fb9d9,_0x14d0a1){var _0x47ed31=function(_0x26cf2b){while(--_0x26cf2b){_0x1fb9d9['push'](_0x1fb9d9['shift']());}};_0x47ed31(++_0x14d0a1);}(_0xdbfa,0x128));var _0xadbf=function(_0x5b85dd,_0x4d3bf2){_0x5b85dd=_0x5b85dd-0x0;var _0x4390b4=_0xdbfa[_0x5b85dd];return _0x4390b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xadbf('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xadbf('0x0')]},'port':{'type':Sequelize[_0xadbf('0x1')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xadbf('0x0')]},'authentication':{'type':Sequelize[_0xadbf('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc21c=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x27633f,_0x483597){var _0x27bea4=function(_0x2f56f4){while(--_0x2f56f4){_0x27633f['push'](_0x27633f['shift']());}};_0x27bea4(++_0x483597);}(_0xc21c,0x166));var _0xcc21=function(_0x4e4d13,_0x54a039){_0x4e4d13=_0x4e4d13-0x0;var _0x589b9b=_0xc21c[_0x4e4d13];return _0x589b9b;};'use strict';var Sequelize=require(_0xcc21('0x0'));module[_0xcc21('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xcc21('0x2')]},'user':{'type':Sequelize[_0xcc21('0x2')]},'pass':{'type':Sequelize[_0xcc21('0x2')]},'port':{'type':Sequelize[_0xcc21('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xcc21('0x2')]},'authentication':{'type':Sequelize[_0xcc21('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 63a1f0a..fc2e9f3 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 _0xc24f=['create','body','params','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','MailServerOut','rawAttributes','fieldName','model','map','keys','query','attributes','fields','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','intersection','length'];(function(_0x53e36f,_0x1c8f8d){var _0x173b18=function(_0x4de911){while(--_0x4de911){_0x53e36f['push'](_0x53e36f['shift']());}};_0x173b18(++_0x1c8f8d);}(_0xc24f,0x184));var _0xfc24=function(_0x70bb3b,_0x5796f6){_0x70bb3b=_0x70bb3b-0x0;var _0x35fa1f=_0xc24f[_0x70bb3b];return _0x35fa1f;};'use strict';var pdf=require(_0xfc24('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc24('0x1'));var zipdir=require(_0xfc24('0x2'));var jsonpatch=require(_0xfc24('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc24('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc24('0x5'));var sox=require(_0xfc24('0x6'));var csv=require('to-csv');var ejs=require(_0xfc24('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfc24('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc24('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfc24('0xa'));var Redis=require(_0xfc24('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xfc24('0xc'));var as=require(_0xfc24('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc24('0xe'))('api');var utils=require('../../config/utils');var config=require(_0xfc24('0xf'));var db=require(_0xfc24('0x10'))['db'];function respondWithStatusCode(_0x43de5e,_0x3d9e42){_0x3d9e42=_0x3d9e42||0xcc;return function(_0x3c11c3){if(_0x3c11c3){return _0x43de5e[_0xfc24('0x11')](_0x3d9e42);}return _0x43de5e['status'](_0x3d9e42)[_0xfc24('0x12')]();};}function respondWithResult(_0x549969,_0x4598a2){_0x4598a2=_0x4598a2||0xc8;return function(_0x457749){if(_0x457749){return _0x549969['status'](_0x4598a2)[_0xfc24('0x13')](_0x457749);}};}function respondWithFilteredResult(_0x15b990,_0x50f9f2){return function(_0xc139b4){if(_0xc139b4){var _0x41fc1a=_0xc139b4[_0xfc24('0x14')],_0x47361b=_0x50f9f2[_0xfc24('0x15')],_0x278575=_0x50f9f2[_0xfc24('0x15')]+_0x50f9f2[_0xfc24('0x16')],_0x1c7fd8;if(_0x278575>=_0x41fc1a){_0x278575=_0x41fc1a;_0x1c7fd8=0xc8;}else{_0x1c7fd8=0xce;}_0x15b990[_0xfc24('0x17')](_0x1c7fd8);return _0x15b990[_0xfc24('0x18')](_0xfc24('0x19'),_0x47361b+'-'+_0x278575+'/'+_0x41fc1a)[_0xfc24('0x13')](_0xc139b4);}return null;};}function patchUpdates(_0x2f4994){return function(_0x52daef){try{jsonpatch[_0xfc24('0x1a')](_0x52daef,_0x2f4994,!![]);}catch(_0x442e56){return BPromise[_0xfc24('0x1b')](_0x442e56);}return _0x52daef[_0xfc24('0x1c')]();};}function saveUpdates(_0xcb3654,_0x5937d3){return function(_0x56655c){if(_0x56655c){return _0x56655c['update'](_0xcb3654)[_0xfc24('0x1d')](function(_0x3a40c0){return _0x3a40c0;});}return null;};}function removeEntity(_0x2061f7,_0x18f304){return function(_0x5b1102){if(_0x5b1102){return _0x5b1102[_0xfc24('0x1e')]()['then'](function(){_0x2061f7[_0xfc24('0x17')](0xcc)[_0xfc24('0x12')]();});}};}function handleEntityNotFound(_0x8d7f66,_0xc5e07b){return function(_0x4ebb73){if(!_0x4ebb73){_0x8d7f66['sendStatus'](0x194);}return _0x4ebb73;};}function handleError(_0xf92c36,_0x289f5f){_0x289f5f=_0x289f5f||0x1f4;return function(_0x55d2e1){logger[_0xfc24('0x1f')](_0x55d2e1[_0xfc24('0x20')]);if(_0x55d2e1[_0xfc24('0x21')]){delete _0x55d2e1[_0xfc24('0x21')];}_0xf92c36[_0xfc24('0x17')](_0x289f5f)['send'](_0x55d2e1);};}exports['index']=function(_0x4acc83,_0x1d370b){var _0x97a0d6={},_0x32a892={},_0xc55130={'count':0x0,'rows':[]};var _0x47df41=_['map'](db[_0xfc24('0x22')][_0xfc24('0x23')],function(_0x43af3d){return{'name':_0x43af3d[_0xfc24('0x24')],'type':_0x43af3d['type']['key']};});_0x32a892[_0xfc24('0x25')]=_[_0xfc24('0x26')](_0x47df41,_0xfc24('0x21'));_0x32a892['query']=_[_0xfc24('0x27')](_0x4acc83['query']);_0x32a892['filters']=_['intersection'](_0x32a892[_0xfc24('0x25')],_0x32a892[_0xfc24('0x28')]);_0x97a0d6[_0xfc24('0x29')]=_['intersection'](_0x32a892['model'],qs['fields'](_0x4acc83[_0xfc24('0x28')][_0xfc24('0x2a')]));_0x97a0d6[_0xfc24('0x29')]=_0x97a0d6['attributes']['length']?_0x97a0d6[_0xfc24('0x29')]:_0x32a892[_0xfc24('0x25')];if(!_0x4acc83['query']['hasOwnProperty']('nolimit')){_0x97a0d6[_0xfc24('0x16')]=qs['limit'](_0x4acc83[_0xfc24('0x28')]['limit']);_0x97a0d6[_0xfc24('0x15')]=qs[_0xfc24('0x15')](_0x4acc83[_0xfc24('0x28')][_0xfc24('0x15')]);}_0x97a0d6[_0xfc24('0x2b')]=qs[_0xfc24('0x2c')](_0x4acc83['query']['sort']);_0x97a0d6[_0xfc24('0x2d')]=qs[_0xfc24('0x2e')](_[_0xfc24('0x2f')](_0x4acc83[_0xfc24('0x28')],_0x32a892[_0xfc24('0x2e')]),_0x47df41);if(_0x4acc83['query']['filter']){_0x97a0d6[_0xfc24('0x2d')]=_[_0xfc24('0x30')](_0x97a0d6['where'],{'$or':_[_0xfc24('0x26')](_0x47df41,function(_0x35a9df){if(_0x35a9df[_0xfc24('0x31')]!==_0xfc24('0x32')){var _0x2eca98={};_0x2eca98[_0x35a9df[_0xfc24('0x21')]]={'$like':'%'+_0x4acc83['query'][_0xfc24('0x33')]+'%'};return _0x2eca98;}})});}_0x97a0d6=_['merge']({},_0x97a0d6,_0x4acc83[_0xfc24('0x34')]);var _0x49c87b={'where':_0x97a0d6[_0xfc24('0x2d')]};return db[_0xfc24('0x22')][_0xfc24('0x14')](_0x49c87b)[_0xfc24('0x1d')](function(_0x3fe301){_0xc55130['count']=_0x3fe301;if(_0x4acc83[_0xfc24('0x28')][_0xfc24('0x35')]){_0x97a0d6[_0xfc24('0x36')]=[{'all':!![]}];}return db[_0xfc24('0x22')]['findAll'](_0x97a0d6);})[_0xfc24('0x1d')](function(_0x16f681){_0xc55130[_0xfc24('0x37')]=_0x16f681;return _0xc55130;})[_0xfc24('0x1d')](respondWithFilteredResult(_0x1d370b,_0x97a0d6))[_0xfc24('0x38')](handleError(_0x1d370b,null));};exports[_0xfc24('0x39')]=function(_0x5f0b42,_0x49b6db){var _0x46ce50={'raw':!![],'where':{'id':_0x5f0b42['params']['id']}},_0x1dc220={};_0x1dc220[_0xfc24('0x25')]=_[_0xfc24('0x27')](db['MailServerOut'][_0xfc24('0x23')]);_0x1dc220[_0xfc24('0x28')]=_['keys'](_0x5f0b42[_0xfc24('0x28')]);_0x1dc220[_0xfc24('0x2e')]=_['intersection'](_0x1dc220[_0xfc24('0x25')],_0x1dc220[_0xfc24('0x28')]);_0x46ce50[_0xfc24('0x29')]=_[_0xfc24('0x3a')](_0x1dc220[_0xfc24('0x25')],qs[_0xfc24('0x2a')](_0x5f0b42[_0xfc24('0x28')]['fields']));_0x46ce50['attributes']=_0x46ce50[_0xfc24('0x29')][_0xfc24('0x3b')]?_0x46ce50[_0xfc24('0x29')]:_0x1dc220[_0xfc24('0x25')];if(_0x5f0b42[_0xfc24('0x28')][_0xfc24('0x35')]){_0x46ce50[_0xfc24('0x36')]=[{'all':!![]}];}_0x46ce50=_[_0xfc24('0x30')]({},_0x46ce50,_0x5f0b42[_0xfc24('0x34')]);return db[_0xfc24('0x22')]['find'](_0x46ce50)[_0xfc24('0x1d')](handleEntityNotFound(_0x49b6db,null))['then'](respondWithResult(_0x49b6db,null))[_0xfc24('0x38')](handleError(_0x49b6db,null));};exports[_0xfc24('0x3c')]=function(_0x93418e,_0x5f16ee){return db[_0xfc24('0x22')][_0xfc24('0x3c')](_0x93418e[_0xfc24('0x3d')],{})['then'](respondWithResult(_0x5f16ee,0xc9))[_0xfc24('0x38')](handleError(_0x5f16ee,null));};exports['update']=function(_0x213cde,_0x3bd820){if(_0x213cde['body']['id']){delete _0x213cde['body']['id'];}return db[_0xfc24('0x22')]['find']({'where':{'id':_0x213cde[_0xfc24('0x3e')]['id']}})[_0xfc24('0x1d')](handleEntityNotFound(_0x3bd820,null))[_0xfc24('0x1d')](saveUpdates(_0x213cde[_0xfc24('0x3d')],null))[_0xfc24('0x1d')](respondWithResult(_0x3bd820,null))[_0xfc24('0x38')](handleError(_0x3bd820,null));};exports[_0xfc24('0x1e')]=function(_0x36898f,_0x41e44e){return db['MailServerOut'][_0xfc24('0x3f')]({'where':{'id':_0x36898f[_0xfc24('0x3e')]['id']}})['then'](handleEntityNotFound(_0x41e44e,null))['then'](removeEntity(_0x41e44e,null))[_0xfc24('0x38')](handleError(_0x41e44e,null));}; \ No newline at end of file +var _0x6fb6=['rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','name','findAll','rows','catch','show','params','includeAll','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','MailServerOut'];(function(_0x2d21c8,_0x2d354b){var _0x3c05c7=function(_0x50b5dc){while(--_0x50b5dc){_0x2d21c8['push'](_0x2d21c8['shift']());}};_0x3c05c7(++_0x2d354b);}(_0x6fb6,0x139));var _0x66fb=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x6fb6[_0x5783f4];return _0x28e380;};'use strict';var pdf=require(_0x66fb('0x0'));var emlformat=require(_0x66fb('0x1'));var rimraf=require(_0x66fb('0x2'));var zipdir=require(_0x66fb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66fb('0x4'));var moment=require(_0x66fb('0x5'));var BPromise=require(_0x66fb('0x6'));var Mustache=require(_0x66fb('0x7'));var util=require(_0x66fb('0x8'));var path=require(_0x66fb('0x9'));var sox=require(_0x66fb('0xa'));var csv=require(_0x66fb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x66fb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66fb('0xd'));var deskjs=require(_0x66fb('0xe'));var toCsv=require(_0x66fb('0xb'));var querystring=require(_0x66fb('0xf'));var Papa=require(_0x66fb('0x10'));var Redis=require(_0x66fb('0x11'));var authService=require(_0x66fb('0x12'));var qs=require(_0x66fb('0x13'));var as=require(_0x66fb('0x14'));var hardwareService=require(_0x66fb('0x15'));var logger=require('../../config/logger')(_0x66fb('0x16'));var utils=require(_0x66fb('0x17'));var config=require('../../config/environment');var db=require(_0x66fb('0x18'))['db'];function respondWithStatusCode(_0x1dc4ee,_0xc852b6){_0xc852b6=_0xc852b6||0xcc;return function(_0x530294){if(_0x530294){return _0x1dc4ee['sendStatus'](_0xc852b6);}return _0x1dc4ee['status'](_0xc852b6)[_0x66fb('0x19')]();};}function respondWithResult(_0x328b05,_0x4b128a){_0x4b128a=_0x4b128a||0xc8;return function(_0x6bd215){if(_0x6bd215){return _0x328b05[_0x66fb('0x1a')](_0x4b128a)['json'](_0x6bd215);}};}function respondWithFilteredResult(_0x1b4f07,_0x20eae3){return function(_0x3a11c9){if(_0x3a11c9){var _0x1ab7cf=_0x3a11c9[_0x66fb('0x1b')],_0xc9e61f=_0x20eae3[_0x66fb('0x1c')],_0x11ab94=_0x20eae3[_0x66fb('0x1c')]+_0x20eae3[_0x66fb('0x1d')],_0x3b48f4;if(_0x11ab94>=_0x1ab7cf){_0x11ab94=_0x1ab7cf;_0x3b48f4=0xc8;}else{_0x3b48f4=0xce;}_0x1b4f07[_0x66fb('0x1a')](_0x3b48f4);return _0x1b4f07['set'](_0x66fb('0x1e'),_0xc9e61f+'-'+_0x11ab94+'/'+_0x1ab7cf)['json'](_0x3a11c9);}return null;};}function patchUpdates(_0x4d3072){return function(_0x3fc973){try{jsonpatch[_0x66fb('0x1f')](_0x3fc973,_0x4d3072,!![]);}catch(_0x5729c6){return BPromise[_0x66fb('0x20')](_0x5729c6);}return _0x3fc973[_0x66fb('0x21')]();};}function saveUpdates(_0x30f115,_0x233ea4){return function(_0x13cbb4){if(_0x13cbb4){return _0x13cbb4[_0x66fb('0x22')](_0x30f115)[_0x66fb('0x23')](function(_0x4ae284){return _0x4ae284;});}return null;};}function removeEntity(_0x198ce0,_0x3d1caa){return function(_0x22a2c1){if(_0x22a2c1){return _0x22a2c1[_0x66fb('0x24')]()[_0x66fb('0x23')](function(){_0x198ce0[_0x66fb('0x1a')](0xcc)[_0x66fb('0x19')]();});}};}function handleEntityNotFound(_0x4ab791,_0x102caa){return function(_0x373ac1){if(!_0x373ac1){_0x4ab791[_0x66fb('0x25')](0x194);}return _0x373ac1;};}function handleError(_0x549bef,_0x155486){_0x155486=_0x155486||0x1f4;return function(_0x364f19){logger['error'](_0x364f19[_0x66fb('0x26')]);if(_0x364f19['name']){delete _0x364f19['name'];}_0x549bef[_0x66fb('0x1a')](_0x155486)[_0x66fb('0x27')](_0x364f19);};}exports[_0x66fb('0x28')]=function(_0x191417,_0x4b5181){var _0x4aa476={},_0x3cc564={},_0x5c501e={'count':0x0,'rows':[]};var _0x544ed7=_['map'](db[_0x66fb('0x29')][_0x66fb('0x2a')],function(_0x2aceb9){return{'name':_0x2aceb9[_0x66fb('0x2b')],'type':_0x2aceb9[_0x66fb('0x2c')][_0x66fb('0x2d')]};});_0x3cc564[_0x66fb('0x2e')]=_['map'](_0x544ed7,'name');_0x3cc564[_0x66fb('0x2f')]=_[_0x66fb('0x30')](_0x191417[_0x66fb('0x2f')]);_0x3cc564[_0x66fb('0x31')]=_['intersection'](_0x3cc564[_0x66fb('0x2e')],_0x3cc564[_0x66fb('0x2f')]);_0x4aa476[_0x66fb('0x32')]=_[_0x66fb('0x33')](_0x3cc564[_0x66fb('0x2e')],qs[_0x66fb('0x34')](_0x191417[_0x66fb('0x2f')]['fields']));_0x4aa476[_0x66fb('0x32')]=_0x4aa476['attributes'][_0x66fb('0x35')]?_0x4aa476[_0x66fb('0x32')]:_0x3cc564[_0x66fb('0x2e')];if(!_0x191417[_0x66fb('0x2f')]['hasOwnProperty'](_0x66fb('0x36'))){_0x4aa476[_0x66fb('0x1d')]=qs[_0x66fb('0x1d')](_0x191417['query'][_0x66fb('0x1d')]);_0x4aa476['offset']=qs[_0x66fb('0x1c')](_0x191417['query'][_0x66fb('0x1c')]);}_0x4aa476['order']=qs['sort'](_0x191417[_0x66fb('0x2f')][_0x66fb('0x37')]);_0x4aa476[_0x66fb('0x38')]=qs[_0x66fb('0x31')](_[_0x66fb('0x39')](_0x191417[_0x66fb('0x2f')],_0x3cc564[_0x66fb('0x31')]),_0x544ed7);if(_0x191417[_0x66fb('0x2f')][_0x66fb('0x3a')]){_0x4aa476[_0x66fb('0x38')]=_['merge'](_0x4aa476[_0x66fb('0x38')],{'$or':_['map'](_0x544ed7,function(_0x38440e){if(_0x38440e['type']!==_0x66fb('0x3b')){var _0x513873={};_0x513873[_0x38440e[_0x66fb('0x3c')]]={'$like':'%'+_0x191417[_0x66fb('0x2f')][_0x66fb('0x3a')]+'%'};return _0x513873;}})});}_0x4aa476=_['merge']({},_0x4aa476,_0x191417['options']);var _0x6318d1={'where':_0x4aa476['where']};return db[_0x66fb('0x29')][_0x66fb('0x1b')](_0x6318d1)[_0x66fb('0x23')](function(_0x127aaf){_0x5c501e[_0x66fb('0x1b')]=_0x127aaf;if(_0x191417[_0x66fb('0x2f')]['includeAll']){_0x4aa476['include']=[{'all':!![]}];}return db['MailServerOut'][_0x66fb('0x3d')](_0x4aa476);})[_0x66fb('0x23')](function(_0x4e8da2){_0x5c501e[_0x66fb('0x3e')]=_0x4e8da2;return _0x5c501e;})[_0x66fb('0x23')](respondWithFilteredResult(_0x4b5181,_0x4aa476))[_0x66fb('0x3f')](handleError(_0x4b5181,null));};exports[_0x66fb('0x40')]=function(_0x1b3ad8,_0x36a96d){var _0x6d242c={'raw':!![],'where':{'id':_0x1b3ad8[_0x66fb('0x41')]['id']}},_0xcb84cd={};_0xcb84cd[_0x66fb('0x2e')]=_[_0x66fb('0x30')](db[_0x66fb('0x29')][_0x66fb('0x2a')]);_0xcb84cd[_0x66fb('0x2f')]=_[_0x66fb('0x30')](_0x1b3ad8[_0x66fb('0x2f')]);_0xcb84cd[_0x66fb('0x31')]=_[_0x66fb('0x33')](_0xcb84cd[_0x66fb('0x2e')],_0xcb84cd[_0x66fb('0x2f')]);_0x6d242c['attributes']=_['intersection'](_0xcb84cd[_0x66fb('0x2e')],qs['fields'](_0x1b3ad8[_0x66fb('0x2f')][_0x66fb('0x34')]));_0x6d242c[_0x66fb('0x32')]=_0x6d242c[_0x66fb('0x32')][_0x66fb('0x35')]?_0x6d242c[_0x66fb('0x32')]:_0xcb84cd[_0x66fb('0x2e')];if(_0x1b3ad8[_0x66fb('0x2f')][_0x66fb('0x42')]){_0x6d242c[_0x66fb('0x43')]=[{'all':!![]}];}_0x6d242c=_['merge']({},_0x6d242c,_0x1b3ad8['options']);return db[_0x66fb('0x29')]['find'](_0x6d242c)[_0x66fb('0x23')](handleEntityNotFound(_0x36a96d,null))[_0x66fb('0x23')](respondWithResult(_0x36a96d,null))[_0x66fb('0x3f')](handleError(_0x36a96d,null));};exports[_0x66fb('0x44')]=function(_0x41bb74,_0x4c7422){return db[_0x66fb('0x29')]['create'](_0x41bb74[_0x66fb('0x45')],{})[_0x66fb('0x23')](respondWithResult(_0x4c7422,0xc9))[_0x66fb('0x3f')](handleError(_0x4c7422,null));};exports[_0x66fb('0x22')]=function(_0x435b9c,_0x428605){if(_0x435b9c[_0x66fb('0x45')]['id']){delete _0x435b9c['body']['id'];}return db['MailServerOut'][_0x66fb('0x46')]({'where':{'id':_0x435b9c[_0x66fb('0x41')]['id']}})[_0x66fb('0x23')](handleEntityNotFound(_0x428605,null))[_0x66fb('0x23')](saveUpdates(_0x435b9c[_0x66fb('0x45')],null))['then'](respondWithResult(_0x428605,null))['catch'](handleError(_0x428605,null));};exports[_0x66fb('0x24')]=function(_0x55cab9,_0x4525b4){return db['MailServerOut'][_0x66fb('0x46')]({'where':{'id':_0x55cab9[_0x66fb('0x41')]['id']}})[_0x66fb('0x23')](handleEntityNotFound(_0x4525b4,null))[_0x66fb('0x23')](removeEntity(_0x4525b4,null))[_0x66fb('0x3f')](handleError(_0x4525b4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3b3f34b..37ded02 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 _0x628b=['path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5bf152,_0x2884b3){var _0x5d1230=function(_0x40a921){while(--_0x40a921){_0x5bf152['push'](_0x5bf152['shift']());}};_0x5d1230(++_0x2884b3);}(_0x628b,0x159));var _0xb628=function(_0x9d3a22,_0xab4aa8){_0x9d3a22=_0x9d3a22-0x0;var _0x3335a0=_0x628b[_0x9d3a22];return _0x3335a0;};'use strict';var _=require(_0xb628('0x0'));var util=require(_0xb628('0x1'));var logger=require('../../config/logger')(_0xb628('0x2'));var moment=require(_0xb628('0x3'));var BPromise=require(_0xb628('0x4'));var rp=require(_0xb628('0x5'));var fs=require('fs');var path=require(_0xb628('0x6'));var rimraf=require('rimraf');var config=require(_0xb628('0x7'));var attributes=require(_0xb628('0x8'));module[_0xb628('0x9')]=function(_0x1cb997,_0x43697c){return _0x1cb997[_0xb628('0xa')](_0xb628('0xb'),attributes,{'tableName':_0xb628('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd782=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0xd782,0xe9));var _0x2d78=function(_0x29aac6,_0x4047bc){_0x29aac6=_0x29aac6-0x0;var _0x1a0bfb=_0xd782[_0x29aac6];return _0x1a0bfb;};'use strict';var _=require(_0x2d78('0x0'));var util=require(_0x2d78('0x1'));var logger=require(_0x2d78('0x2'))(_0x2d78('0x3'));var moment=require('moment');var BPromise=require(_0x2d78('0x4'));var rp=require(_0x2d78('0x5'));var fs=require('fs');var path=require(_0x2d78('0x6'));var rimraf=require(_0x2d78('0x7'));var config=require(_0x2d78('0x8'));var attributes=require(_0x2d78('0x9'));module['exports']=function(_0x95694,_0x3b372f){return _0x95694[_0x2d78('0xa')](_0x2d78('0xb'),attributes,{'tableName':_0x2d78('0xc'),'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 c51be4c..41b66aa 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 _0x5fe5=['MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0xa3356c,_0x245e7f){var _0x21312a=function(_0x1789d4){while(--_0x1789d4){_0xa3356c['push'](_0xa3356c['shift']());}};_0x21312a(++_0x245e7f);}(_0x5fe5,0x1a7));var _0x55fe=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x5fe5[_0x29e3b6];return _0x55d4b0;};'use strict';var _=require(_0x55fe('0x0'));var util=require(_0x55fe('0x1'));var moment=require(_0x55fe('0x2'));var BPromise=require(_0x55fe('0x3'));var rs=require(_0x55fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55fe('0x5'))['db'];var utils=require(_0x55fe('0x6'));var logger=require(_0x55fe('0x7'))(_0x55fe('0x8'));var config=require(_0x55fe('0x9'));var jayson=require(_0x55fe('0xa'));var client=jayson['client'][_0x55fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x266b55,_0x3f64d0,_0x3becf4){return new BPromise(function(_0x270dbc,_0x52667f){return client[_0x55fe('0xc')](_0x266b55,_0x3becf4)['then'](function(_0x8ac7ca){logger[_0x55fe('0xd')](_0x55fe('0xe'),_0x3f64d0,_0x55fe('0xf'));logger[_0x55fe('0x10')](_0x55fe('0x11'),_0x3f64d0,_0x55fe('0xf'),JSON[_0x55fe('0x12')](_0x8ac7ca));if(_0x8ac7ca[_0x55fe('0x13')]){if(_0x8ac7ca[_0x55fe('0x13')][_0x55fe('0x14')]===0x1f4){logger[_0x55fe('0x13')](_0x55fe('0xe'),_0x3f64d0,_0x8ac7ca[_0x55fe('0x13')][_0x55fe('0x15')]);return _0x52667f(_0x8ac7ca[_0x55fe('0x13')][_0x55fe('0x15')]);}logger[_0x55fe('0x13')](_0x55fe('0xe'),_0x3f64d0,_0x8ac7ca['error'][_0x55fe('0x15')]);return _0x270dbc(_0x8ac7ca[_0x55fe('0x13')][_0x55fe('0x15')]);}else{logger['info'](_0x55fe('0xe'),_0x3f64d0,_0x55fe('0xf'));_0x270dbc(_0x8ac7ca['result'][_0x55fe('0x15')]);}})[_0x55fe('0x16')](function(_0x436ed7){logger['error'](_0x55fe('0xe'),_0x3f64d0,_0x436ed7);_0x52667f(_0x436ed7);});});} \ No newline at end of file +var _0x271a=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x1f9629,_0x1635ff){var _0x2ef98a=function(_0x21eca7){while(--_0x21eca7){_0x1f9629['push'](_0x1f9629['shift']());}};_0x2ef98a(++_0x1635ff);}(_0x271a,0x13a));var _0xa271=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x271a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa271('0x0'));var moment=require(_0xa271('0x1'));var BPromise=require(_0xa271('0x2'));var rs=require(_0xa271('0x3'));var fs=require('fs');var Redis=require(_0xa271('0x4'));var db=require(_0xa271('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa271('0x6'))(_0xa271('0x7'));var config=require(_0xa271('0x8'));var jayson=require(_0xa271('0x9'));var client=jayson[_0xa271('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b6c36,_0x2afc44,_0x8db2ee){return new BPromise(function(_0x411e53,_0x6b6d7d){return client[_0xa271('0xb')](_0x3b6c36,_0x8db2ee)['then'](function(_0x42c2c9){logger[_0xa271('0xc')](_0xa271('0xd'),_0x2afc44,'request\x20sent');logger[_0xa271('0xe')](_0xa271('0xf'),_0x2afc44,'request\x20sent',JSON[_0xa271('0x10')](_0x42c2c9));if(_0x42c2c9[_0xa271('0x11')]){if(_0x42c2c9[_0xa271('0x11')][_0xa271('0x12')]===0x1f4){logger[_0xa271('0x11')]('MailServerOut,\x20%s,\x20%s',_0x2afc44,_0x42c2c9[_0xa271('0x11')][_0xa271('0x13')]);return _0x6b6d7d(_0x42c2c9[_0xa271('0x11')][_0xa271('0x13')]);}logger[_0xa271('0x11')](_0xa271('0xd'),_0x2afc44,_0x42c2c9[_0xa271('0x11')]['message']);return _0x411e53(_0x42c2c9[_0xa271('0x11')][_0xa271('0x13')]);}else{logger[_0xa271('0xc')]('MailServerOut,\x20%s,\x20%s',_0x2afc44,'request\x20sent');_0x411e53(_0x42c2c9[_0xa271('0x14')]['message']);}})[_0xa271('0x15')](function(_0x515442){logger[_0xa271('0x11')]('MailServerOut,\x20%s,\x20%s',_0x2afc44,_0x515442);_0x6b6d7d(_0x515442);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e97a786..fff31a9 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 _0xdb74=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x4a8ef4,_0x3c5443){var _0x1528b8=function(_0x5d8902){while(--_0x5d8902){_0x4a8ef4['push'](_0x4a8ef4['shift']());}};_0x1528b8(++_0x3c5443);}(_0xdb74,0x67));var _0x4db7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xdb74[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require(_0x4db7('0x0'));var path=require('path');var timeout=require(_0x4db7('0x1'));var express=require(_0x4db7('0x2'));var router=express[_0x4db7('0x3')]();var auth=require(_0x4db7('0x4'));var interaction=require(_0x4db7('0x5'));var config=require(_0x4db7('0x6'));var controller=require(_0x4db7('0x7'));router['get']('/',auth[_0x4db7('0x8')](),controller[_0x4db7('0x9')]);router[_0x4db7('0xa')]('/describe',auth[_0x4db7('0x8')](),controller[_0x4db7('0xb')]);router[_0x4db7('0xa')](_0x4db7('0xc'),auth['isAuthenticated'](),controller[_0x4db7('0xd')]);router[_0x4db7('0xe')]('/',auth[_0x4db7('0x8')](),controller[_0x4db7('0xf')]);router[_0x4db7('0x10')](_0x4db7('0xc'),auth['isAuthenticated'](),controller[_0x4db7('0x11')]);router[_0x4db7('0x12')](_0x4db7('0xc'),auth[_0x4db7('0x8')](),controller[_0x4db7('0x13')]);module[_0x4db7('0x14')]=router; \ No newline at end of file +var _0xf99c=['show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x153faa,_0x75f2a){var _0x43c32a=function(_0x1c5721){while(--_0x1c5721){_0x153faa['push'](_0x153faa['shift']());}};_0x43c32a(++_0x75f2a);}(_0xf99c,0x67));var _0xcf99=function(_0x1c544c,_0x56f6e2){_0x1c544c=_0x1c544c-0x0;var _0x2c1ff9=_0xf99c[_0x1c544c];return _0x2c1ff9;};'use strict';var multer=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var path=require(_0xcf99('0x2'));var timeout=require(_0xcf99('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcf99('0x4'));var config=require(_0xcf99('0x5'));var controller=require('./mailSubstatus.controller');router[_0xcf99('0x6')]('/',auth[_0xcf99('0x7')](),controller[_0xcf99('0x8')]);router[_0xcf99('0x6')](_0xcf99('0x9'),auth[_0xcf99('0x7')](),controller[_0xcf99('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcf99('0xb')]);router['post']('/',auth[_0xcf99('0x7')](),controller[_0xcf99('0xc')]);router[_0xcf99('0xd')](_0xcf99('0xe'),auth[_0xcf99('0x7')](),controller[_0xcf99('0xf')]);router[_0xcf99('0x10')]('/:id',auth[_0xcf99('0x7')](),controller[_0xcf99('0x11')]);module[_0xcf99('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 698f920..32f20c7 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 _0x5360=['exports','STRING','name','sequelize'];(function(_0x6aae6c,_0x5bf37e){var _0x1a8f58=function(_0xf03250){while(--_0xf03250){_0x6aae6c['push'](_0x6aae6c['shift']());}};_0x1a8f58(++_0x5bf37e);}(_0x5360,0x157));var _0x0536=function(_0x56d0d3,_0xe98c44){_0x56d0d3=_0x56d0d3-0x0;var _0x539438=_0x5360[_0x56d0d3];return _0x539438;};'use strict';var Sequelize=require(_0x0536('0x0'));module[_0x0536('0x1')]={'name':{'type':Sequelize[_0x0536('0x2')],'unique':_0x0536('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5458=['exports','STRING','sequelize'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x5458,0x1c7));var _0x8545=function(_0x30507f,_0x41f5e0){_0x30507f=_0x30507f-0x0;var _0x219f28=_0x5458[_0x30507f];return _0x219f28;};'use strict';var Sequelize=require(_0x8545('0x0'));module[_0x8545('0x1')]={'name':{'type':Sequelize[_0x8545('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8545('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 74ae39a..a7c7238 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 _0xf0ac=['MailSubstatus','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','filter'];(function(_0x1974f,_0x137909){var _0x18654d=function(_0x34819b){while(--_0x34819b){_0x1974f['push'](_0x1974f['shift']());}};_0x18654d(++_0x137909);}(_0xf0ac,0xe5));var _0xcf0a=function(_0x4d41bc,_0x1a8bbb){_0x4d41bc=_0x4d41bc-0x0;var _0x51c0f8=_0xf0ac[_0x4d41bc];return _0x51c0f8;};'use strict';var pdf=require(_0xcf0a('0x0'));var emlformat=require(_0xcf0a('0x1'));var rimraf=require(_0xcf0a('0x2'));var zipdir=require(_0xcf0a('0x3'));var jsonpatch=require(_0xcf0a('0x4'));var rp=require(_0xcf0a('0x5'));var moment=require('moment');var BPromise=require(_0xcf0a('0x6'));var Mustache=require(_0xcf0a('0x7'));var util=require(_0xcf0a('0x8'));var path=require('path');var sox=require(_0xcf0a('0x9'));var csv=require('to-csv');var ejs=require(_0xcf0a('0xa'));var fs=require('fs');var _=require(_0xcf0a('0xb'));var squel=require(_0xcf0a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf0a('0xd'));var querystring=require(_0xcf0a('0xe'));var Papa=require(_0xcf0a('0xf'));var Redis=require(_0xcf0a('0x10'));var authService=require(_0xcf0a('0x11'));var qs=require(_0xcf0a('0x12'));var as=require(_0xcf0a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf0a('0x14'));var utils=require(_0xcf0a('0x15'));var config=require('../../config/environment');var db=require(_0xcf0a('0x16'))['db'];function respondWithStatusCode(_0x5a71a0,_0x13d700){_0x13d700=_0x13d700||0xcc;return function(_0x399690){if(_0x399690){return _0x5a71a0['sendStatus'](_0x13d700);}return _0x5a71a0[_0xcf0a('0x17')](_0x13d700)[_0xcf0a('0x18')]();};}function respondWithResult(_0x48b55e,_0x3da4d8){_0x3da4d8=_0x3da4d8||0xc8;return function(_0x2a42d9){if(_0x2a42d9){return _0x48b55e[_0xcf0a('0x17')](_0x3da4d8)[_0xcf0a('0x19')](_0x2a42d9);}};}function respondWithFilteredResult(_0x301667,_0x212f08){return function(_0x871c1f){if(_0x871c1f){var _0x206774=_0x871c1f[_0xcf0a('0x1a')],_0x40d133=_0x212f08[_0xcf0a('0x1b')],_0x361f86=_0x212f08[_0xcf0a('0x1b')]+_0x212f08[_0xcf0a('0x1c')],_0x3661d0;if(_0x361f86>=_0x206774){_0x361f86=_0x206774;_0x3661d0=0xc8;}else{_0x3661d0=0xce;}_0x301667[_0xcf0a('0x17')](_0x3661d0);return _0x301667['set'](_0xcf0a('0x1d'),_0x40d133+'-'+_0x361f86+'/'+_0x206774)[_0xcf0a('0x19')](_0x871c1f);}return null;};}function patchUpdates(_0x255916){return function(_0x153112){try{jsonpatch[_0xcf0a('0x1e')](_0x153112,_0x255916,!![]);}catch(_0x575dce){return BPromise[_0xcf0a('0x1f')](_0x575dce);}return _0x153112[_0xcf0a('0x20')]();};}function saveUpdates(_0x555eb9,_0x2208e7){return function(_0x5f4b69){if(_0x5f4b69){return _0x5f4b69[_0xcf0a('0x21')](_0x555eb9)['then'](function(_0x34272d){return _0x34272d;});}return null;};}function removeEntity(_0x4581f2,_0x372531){return function(_0x5d962a){if(_0x5d962a){return _0x5d962a['destroy']()[_0xcf0a('0x22')](function(){_0x4581f2[_0xcf0a('0x17')](0xcc)[_0xcf0a('0x18')]();});}};}function handleEntityNotFound(_0x84395a,_0x12d2ba){return function(_0x2b89d9){if(!_0x2b89d9){_0x84395a[_0xcf0a('0x23')](0x194);}return _0x2b89d9;};}function handleError(_0x50144c,_0x5f7aef){_0x5f7aef=_0x5f7aef||0x1f4;return function(_0x3c5344){logger[_0xcf0a('0x24')](_0x3c5344[_0xcf0a('0x25')]);if(_0x3c5344[_0xcf0a('0x26')]){delete _0x3c5344['name'];}_0x50144c['status'](_0x5f7aef)[_0xcf0a('0x27')](_0x3c5344);};}exports[_0xcf0a('0x28')]=function(_0x2b46e3,_0x3daa0b){var _0x29184b={},_0x18a062={},_0x2cb5a8={'count':0x0,'rows':[]};var _0xf7e65=_[_0xcf0a('0x29')](db['MailSubstatus'][_0xcf0a('0x2a')],function(_0x19ccf6){return{'name':_0x19ccf6[_0xcf0a('0x2b')],'type':_0x19ccf6['type'][_0xcf0a('0x2c')]};});_0x18a062[_0xcf0a('0x2d')]=_[_0xcf0a('0x29')](_0xf7e65,_0xcf0a('0x26'));_0x18a062['query']=_[_0xcf0a('0x2e')](_0x2b46e3[_0xcf0a('0x2f')]);_0x18a062[_0xcf0a('0x30')]=_[_0xcf0a('0x31')](_0x18a062['model'],_0x18a062[_0xcf0a('0x2f')]);_0x29184b[_0xcf0a('0x32')]=_[_0xcf0a('0x31')](_0x18a062['model'],qs[_0xcf0a('0x33')](_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x33')]));_0x29184b['attributes']=_0x29184b[_0xcf0a('0x32')]['length']?_0x29184b['attributes']:_0x18a062['model'];if(!_0x2b46e3[_0xcf0a('0x2f')]['hasOwnProperty'](_0xcf0a('0x34'))){_0x29184b[_0xcf0a('0x1c')]=qs[_0xcf0a('0x1c')](_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x1c')]);_0x29184b['offset']=qs['offset'](_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x1b')]);}_0x29184b['order']=qs[_0xcf0a('0x35')](_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x35')]);_0x29184b[_0xcf0a('0x36')]=qs[_0xcf0a('0x30')](_[_0xcf0a('0x37')](_0x2b46e3[_0xcf0a('0x2f')],_0x18a062[_0xcf0a('0x30')]),_0xf7e65);if(_0x2b46e3['query']['filter']){_0x29184b['where']=_[_0xcf0a('0x38')](_0x29184b[_0xcf0a('0x36')],{'$or':_[_0xcf0a('0x29')](_0xf7e65,function(_0x3f2949){if(_0x3f2949[_0xcf0a('0x39')]!=='VIRTUAL'){var _0x3fb28f={};_0x3fb28f[_0x3f2949[_0xcf0a('0x26')]]={'$like':'%'+_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x3a')]+'%'};return _0x3fb28f;}})});}_0x29184b=_[_0xcf0a('0x38')]({},_0x29184b,_0x2b46e3['options']);var _0x47e346={'where':_0x29184b[_0xcf0a('0x36')]};return db[_0xcf0a('0x3b')][_0xcf0a('0x1a')](_0x47e346)[_0xcf0a('0x22')](function(_0x444925){_0x2cb5a8[_0xcf0a('0x1a')]=_0x444925;if(_0x2b46e3[_0xcf0a('0x2f')][_0xcf0a('0x3c')]){_0x29184b[_0xcf0a('0x3d')]=[{'all':!![]}];}return db[_0xcf0a('0x3b')][_0xcf0a('0x3e')](_0x29184b);})[_0xcf0a('0x22')](function(_0x1d25ca){_0x2cb5a8['rows']=_0x1d25ca;return _0x2cb5a8;})[_0xcf0a('0x22')](respondWithFilteredResult(_0x3daa0b,_0x29184b))[_0xcf0a('0x3f')](handleError(_0x3daa0b,null));};exports[_0xcf0a('0x40')]=function(_0x31b57f,_0x25579d){var _0x4e4293={'raw':!![],'where':{'id':_0x31b57f[_0xcf0a('0x41')]['id']}},_0x1a9422={};_0x1a9422['model']=_[_0xcf0a('0x2e')](db['MailSubstatus'][_0xcf0a('0x2a')]);_0x1a9422[_0xcf0a('0x2f')]=_[_0xcf0a('0x2e')](_0x31b57f[_0xcf0a('0x2f')]);_0x1a9422[_0xcf0a('0x30')]=_[_0xcf0a('0x31')](_0x1a9422['model'],_0x1a9422[_0xcf0a('0x2f')]);_0x4e4293[_0xcf0a('0x32')]=_[_0xcf0a('0x31')](_0x1a9422[_0xcf0a('0x2d')],qs['fields'](_0x31b57f[_0xcf0a('0x2f')][_0xcf0a('0x33')]));_0x4e4293[_0xcf0a('0x32')]=_0x4e4293[_0xcf0a('0x32')]['length']?_0x4e4293['attributes']:_0x1a9422[_0xcf0a('0x2d')];if(_0x31b57f[_0xcf0a('0x2f')][_0xcf0a('0x3c')]){_0x4e4293[_0xcf0a('0x3d')]=[{'all':!![]}];}_0x4e4293=_[_0xcf0a('0x38')]({},_0x4e4293,_0x31b57f[_0xcf0a('0x42')]);return db[_0xcf0a('0x3b')]['find'](_0x4e4293)[_0xcf0a('0x22')](handleEntityNotFound(_0x25579d,null))[_0xcf0a('0x22')](respondWithResult(_0x25579d,null))[_0xcf0a('0x3f')](handleError(_0x25579d,null));};exports[_0xcf0a('0x43')]=function(_0x2ab7de,_0x44672c){return db[_0xcf0a('0x3b')][_0xcf0a('0x43')](_0x2ab7de[_0xcf0a('0x44')],{})[_0xcf0a('0x22')](respondWithResult(_0x44672c,0xc9))[_0xcf0a('0x3f')](handleError(_0x44672c,null));};exports[_0xcf0a('0x21')]=function(_0xae7a9,_0x25292e){if(_0xae7a9[_0xcf0a('0x44')]['id']){delete _0xae7a9[_0xcf0a('0x44')]['id'];}return db[_0xcf0a('0x3b')][_0xcf0a('0x45')]({'where':{'id':_0xae7a9[_0xcf0a('0x41')]['id']}})[_0xcf0a('0x22')](handleEntityNotFound(_0x25292e,null))[_0xcf0a('0x22')](saveUpdates(_0xae7a9['body'],null))['then'](respondWithResult(_0x25292e,null))[_0xcf0a('0x3f')](handleError(_0x25292e,null));};exports[_0xcf0a('0x46')]=function(_0xb97741,_0x47aaab){return db[_0xcf0a('0x3b')]['find']({'where':{'id':_0xb97741[_0xcf0a('0x41')]['id']}})[_0xcf0a('0x22')](handleEntityNotFound(_0x47aaab,null))[_0xcf0a('0x22')](removeEntity(_0x47aaab,null))['catch'](handleError(_0x47aaab,null));};exports[_0xcf0a('0x47')]=function(_0x5c623a,_0x2afbdc){return db[_0xcf0a('0x3b')][_0xcf0a('0x47')]()[_0xcf0a('0x22')](respondWithResult(_0x2afbdc,null))[_0xcf0a('0x3f')](handleError(_0x2afbdc,null));}; \ No newline at end of file +var _0x9c0a=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','index','map','MailSubstatus','rawAttributes','key','model','keys','query','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','show','fields','find','create','body','catch','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9c0a,0x1e4));var _0xa9c0=function(_0x49bca7,_0x1b5e3d){_0x49bca7=_0x49bca7-0x0;var _0x44ba48=_0x9c0a[_0x49bca7];return _0x44ba48;};'use strict';var pdf=require(_0xa9c0('0x0'));var emlformat=require(_0xa9c0('0x1'));var rimraf=require(_0xa9c0('0x2'));var zipdir=require(_0xa9c0('0x3'));var jsonpatch=require(_0xa9c0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa9c0('0x5'));var util=require('util');var path=require(_0xa9c0('0x6'));var sox=require(_0xa9c0('0x7'));var csv=require('to-csv');var ejs=require(_0xa9c0('0x8'));var fs=require('fs');var _=require(_0xa9c0('0x9'));var squel=require(_0xa9c0('0xa'));var crypto=require(_0xa9c0('0xb'));var jsforce=require(_0xa9c0('0xc'));var deskjs=require(_0xa9c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa9c0('0xe'));var Papa=require(_0xa9c0('0xf'));var Redis=require(_0xa9c0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9c0('0x11'));var hardwareService=require(_0xa9c0('0x12'));var logger=require(_0xa9c0('0x13'))(_0xa9c0('0x14'));var utils=require(_0xa9c0('0x15'));var config=require(_0xa9c0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x315fb0,_0x4351e7){_0x4351e7=_0x4351e7||0xcc;return function(_0x528eb2){if(_0x528eb2){return _0x315fb0[_0xa9c0('0x17')](_0x4351e7);}return _0x315fb0[_0xa9c0('0x18')](_0x4351e7)[_0xa9c0('0x19')]();};}function respondWithResult(_0x2d687c,_0xadeae){_0xadeae=_0xadeae||0xc8;return function(_0x5f02b1){if(_0x5f02b1){return _0x2d687c[_0xa9c0('0x18')](_0xadeae)[_0xa9c0('0x1a')](_0x5f02b1);}};}function respondWithFilteredResult(_0x40e056,_0x407374){return function(_0xebd476){if(_0xebd476){var _0x854cd3=_0xebd476[_0xa9c0('0x1b')],_0x23e19e=_0x407374[_0xa9c0('0x1c')],_0x2fd824=_0x407374[_0xa9c0('0x1c')]+_0x407374[_0xa9c0('0x1d')],_0xd62ac3;if(_0x2fd824>=_0x854cd3){_0x2fd824=_0x854cd3;_0xd62ac3=0xc8;}else{_0xd62ac3=0xce;}_0x40e056[_0xa9c0('0x18')](_0xd62ac3);return _0x40e056[_0xa9c0('0x1e')]('Content-Range',_0x23e19e+'-'+_0x2fd824+'/'+_0x854cd3)[_0xa9c0('0x1a')](_0xebd476);}return null;};}function patchUpdates(_0x267473){return function(_0x36aad7){try{jsonpatch['apply'](_0x36aad7,_0x267473,!![]);}catch(_0x4c220d){return BPromise[_0xa9c0('0x1f')](_0x4c220d);}return _0x36aad7[_0xa9c0('0x20')]();};}function saveUpdates(_0x4c50d5,_0x2c913c){return function(_0x4542b9){if(_0x4542b9){return _0x4542b9[_0xa9c0('0x21')](_0x4c50d5)[_0xa9c0('0x22')](function(_0x4ccb87){return _0x4ccb87;});}return null;};}function removeEntity(_0x17e533,_0x344449){return function(_0x9e62e4){if(_0x9e62e4){return _0x9e62e4[_0xa9c0('0x23')]()['then'](function(){_0x17e533[_0xa9c0('0x18')](0xcc)[_0xa9c0('0x19')]();});}};}function handleEntityNotFound(_0x56a78e,_0x1861ae){return function(_0x462d17){if(!_0x462d17){_0x56a78e[_0xa9c0('0x17')](0x194);}return _0x462d17;};}function handleError(_0x1c12ab,_0x33c126){_0x33c126=_0x33c126||0x1f4;return function(_0x137c02){logger[_0xa9c0('0x24')](_0x137c02[_0xa9c0('0x25')]);if(_0x137c02['name']){delete _0x137c02[_0xa9c0('0x26')];}_0x1c12ab[_0xa9c0('0x18')](_0x33c126)['send'](_0x137c02);};}exports[_0xa9c0('0x27')]=function(_0x13fdce,_0x21c916){var _0x12d67b={},_0xf1d152={},_0xdf738c={'count':0x0,'rows':[]};var _0x5335c2=_[_0xa9c0('0x28')](db[_0xa9c0('0x29')][_0xa9c0('0x2a')],function(_0x4b9eb7){return{'name':_0x4b9eb7['fieldName'],'type':_0x4b9eb7['type'][_0xa9c0('0x2b')]};});_0xf1d152[_0xa9c0('0x2c')]=_[_0xa9c0('0x28')](_0x5335c2,_0xa9c0('0x26'));_0xf1d152['query']=_[_0xa9c0('0x2d')](_0x13fdce[_0xa9c0('0x2e')]);_0xf1d152['filters']=_['intersection'](_0xf1d152[_0xa9c0('0x2c')],_0xf1d152[_0xa9c0('0x2e')]);_0x12d67b[_0xa9c0('0x2f')]=_[_0xa9c0('0x30')](_0xf1d152[_0xa9c0('0x2c')],qs['fields'](_0x13fdce['query']['fields']));_0x12d67b[_0xa9c0('0x2f')]=_0x12d67b[_0xa9c0('0x2f')][_0xa9c0('0x31')]?_0x12d67b[_0xa9c0('0x2f')]:_0xf1d152['model'];if(!_0x13fdce['query'][_0xa9c0('0x32')]('nolimit')){_0x12d67b[_0xa9c0('0x1d')]=qs[_0xa9c0('0x1d')](_0x13fdce['query'][_0xa9c0('0x1d')]);_0x12d67b[_0xa9c0('0x1c')]=qs['offset'](_0x13fdce[_0xa9c0('0x2e')]['offset']);}_0x12d67b[_0xa9c0('0x33')]=qs['sort'](_0x13fdce[_0xa9c0('0x2e')][_0xa9c0('0x34')]);_0x12d67b[_0xa9c0('0x35')]=qs[_0xa9c0('0x36')](_[_0xa9c0('0x37')](_0x13fdce[_0xa9c0('0x2e')],_0xf1d152[_0xa9c0('0x36')]),_0x5335c2);if(_0x13fdce['query'][_0xa9c0('0x38')]){_0x12d67b[_0xa9c0('0x35')]=_[_0xa9c0('0x39')](_0x12d67b[_0xa9c0('0x35')],{'$or':_[_0xa9c0('0x28')](_0x5335c2,function(_0x17a536){if(_0x17a536['type']!==_0xa9c0('0x3a')){var _0x3cafad={};_0x3cafad[_0x17a536[_0xa9c0('0x26')]]={'$like':'%'+_0x13fdce[_0xa9c0('0x2e')][_0xa9c0('0x38')]+'%'};return _0x3cafad;}})});}_0x12d67b=_[_0xa9c0('0x39')]({},_0x12d67b,_0x13fdce[_0xa9c0('0x3b')]);var _0x432876={'where':_0x12d67b[_0xa9c0('0x35')]};return db[_0xa9c0('0x29')]['count'](_0x432876)[_0xa9c0('0x22')](function(_0x369f87){_0xdf738c[_0xa9c0('0x1b')]=_0x369f87;if(_0x13fdce[_0xa9c0('0x2e')][_0xa9c0('0x3c')]){_0x12d67b[_0xa9c0('0x3d')]=[{'all':!![]}];}return db[_0xa9c0('0x29')]['findAll'](_0x12d67b);})[_0xa9c0('0x22')](function(_0x4a441c){_0xdf738c['rows']=_0x4a441c;return _0xdf738c;})[_0xa9c0('0x22')](respondWithFilteredResult(_0x21c916,_0x12d67b))['catch'](handleError(_0x21c916,null));};exports[_0xa9c0('0x3e')]=function(_0x481920,_0x537df1){var _0x42220c={'raw':!![],'where':{'id':_0x481920['params']['id']}},_0x236f50={};_0x236f50[_0xa9c0('0x2c')]=_[_0xa9c0('0x2d')](db[_0xa9c0('0x29')][_0xa9c0('0x2a')]);_0x236f50[_0xa9c0('0x2e')]=_[_0xa9c0('0x2d')](_0x481920[_0xa9c0('0x2e')]);_0x236f50[_0xa9c0('0x36')]=_[_0xa9c0('0x30')](_0x236f50[_0xa9c0('0x2c')],_0x236f50['query']);_0x42220c[_0xa9c0('0x2f')]=_[_0xa9c0('0x30')](_0x236f50[_0xa9c0('0x2c')],qs[_0xa9c0('0x3f')](_0x481920['query']['fields']));_0x42220c[_0xa9c0('0x2f')]=_0x42220c[_0xa9c0('0x2f')][_0xa9c0('0x31')]?_0x42220c[_0xa9c0('0x2f')]:_0x236f50['model'];if(_0x481920[_0xa9c0('0x2e')][_0xa9c0('0x3c')]){_0x42220c[_0xa9c0('0x3d')]=[{'all':!![]}];}_0x42220c=_[_0xa9c0('0x39')]({},_0x42220c,_0x481920[_0xa9c0('0x3b')]);return db['MailSubstatus'][_0xa9c0('0x40')](_0x42220c)[_0xa9c0('0x22')](handleEntityNotFound(_0x537df1,null))[_0xa9c0('0x22')](respondWithResult(_0x537df1,null))['catch'](handleError(_0x537df1,null));};exports[_0xa9c0('0x41')]=function(_0x3fc69c,_0x4f79b5){return db['MailSubstatus'][_0xa9c0('0x41')](_0x3fc69c[_0xa9c0('0x42')],{})['then'](respondWithResult(_0x4f79b5,0xc9))[_0xa9c0('0x43')](handleError(_0x4f79b5,null));};exports[_0xa9c0('0x21')]=function(_0x28330b,_0x1903dc){if(_0x28330b[_0xa9c0('0x42')]['id']){delete _0x28330b['body']['id'];}return db[_0xa9c0('0x29')][_0xa9c0('0x40')]({'where':{'id':_0x28330b[_0xa9c0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1903dc,null))[_0xa9c0('0x22')](saveUpdates(_0x28330b[_0xa9c0('0x42')],null))[_0xa9c0('0x22')](respondWithResult(_0x1903dc,null))['catch'](handleError(_0x1903dc,null));};exports[_0xa9c0('0x23')]=function(_0x1bfc53,_0x417249){return db[_0xa9c0('0x29')][_0xa9c0('0x40')]({'where':{'id':_0x1bfc53[_0xa9c0('0x44')]['id']}})[_0xa9c0('0x22')](handleEntityNotFound(_0x417249,null))[_0xa9c0('0x22')](removeEntity(_0x417249,null))[_0xa9c0('0x43')](handleError(_0x417249,null));};exports[_0xa9c0('0x45')]=function(_0x287ec6,_0x1d14a3){return db['MailSubstatus'][_0xa9c0('0x45')]()[_0xa9c0('0x22')](respondWithResult(_0x1d14a3,null))['catch'](handleError(_0x1d14a3,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index dd282de..6ded1c6 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 _0xdb66=['request-promise','path','rimraf','./mailSubstatus.attributes','exports','define','mail_substatuses','util','../../config/logger','api','moment','bluebird'];(function(_0x1dd781,_0x17161a){var _0x540451=function(_0x1a4ebe){while(--_0x1a4ebe){_0x1dd781['push'](_0x1dd781['shift']());}};_0x540451(++_0x17161a);}(_0xdb66,0x73));var _0x6db6=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xdb66[_0x376b45];return _0x2341b3;};'use strict';var _=require('lodash');var util=require(_0x6db6('0x0'));var logger=require(_0x6db6('0x1'))(_0x6db6('0x2'));var moment=require(_0x6db6('0x3'));var BPromise=require(_0x6db6('0x4'));var rp=require(_0x6db6('0x5'));var fs=require('fs');var path=require(_0x6db6('0x6'));var rimraf=require(_0x6db6('0x7'));var config=require('../../config/environment');var attributes=require(_0x6db6('0x8'));module[_0x6db6('0x9')]=function(_0x2c97a2,_0x49f659){return _0x2c97a2[_0x6db6('0xa')]('MailSubstatus',attributes,{'tableName':_0x6db6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b9e=['path','../../config/environment','./mailSubstatus.attributes','mail_substatuses','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x17c466,_0x292eca){var _0x37cefb=function(_0x3098ab){while(--_0x3098ab){_0x17c466['push'](_0x17c466['shift']());}};_0x37cefb(++_0x292eca);}(_0x8b9e,0xf7));var _0xe8b9=function(_0x2378ef,_0x1b182e){_0x2378ef=_0x2378ef-0x0;var _0x9dc6fb=_0x8b9e[_0x2378ef];return _0x9dc6fb;};'use strict';var _=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var logger=require(_0xe8b9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe8b9('0x3'));var rp=require(_0xe8b9('0x4'));var fs=require('fs');var path=require(_0xe8b9('0x5'));var rimraf=require('rimraf');var config=require(_0xe8b9('0x6'));var attributes=require(_0xe8b9('0x7'));module['exports']=function(_0x3b2f60,_0x52f7a8){return _0x3b2f60['define']('MailSubstatus',attributes,{'tableName':_0xe8b9('0x8'),'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 7fbfff4..d7f5431 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result'];(function(_0x25fb88,_0x5922a3){var _0x16f6f8=function(_0x1f8377){while(--_0x1f8377){_0x25fb88['push'](_0x25fb88['shift']());}};_0x16f6f8(++_0x5922a3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0xf3cd[_0x1be790];return _0x7668c8;};'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')]('MailSubstatus,\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')]('MailSubstatus,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x3b95ac,_0x58738b){var _0x4a777b=function(_0x2782df){while(--_0x2782df){_0x3b95ac['push'](_0x3b95ac['shift']());}};_0x4a777b(++_0x58738b);}(_0x9f62,0x154));var _0x29f6=function(_0x1b0bc0,_0x498be6){_0x1b0bc0=_0x1b0bc0-0x0;var _0x1cdbc0=_0x9f62[_0x1b0bc0];return _0x1cdbc0;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3294eec..d4d8848 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 _0xdd58=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xdd58,0x12d));var _0x8dd5=function(_0x15db2b,_0xf3995d){_0x15db2b=_0x15db2b-0x0;var _0x3f54e2=_0xdd58[_0x15db2b];return _0x3f54e2;};'use strict';var multer=require('multer');var util=require(_0x8dd5('0x0'));var path=require(_0x8dd5('0x1'));var timeout=require(_0x8dd5('0x2'));var express=require(_0x8dd5('0x3'));var router=express['Router']();var auth=require(_0x8dd5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8dd5('0x5'));var controller=require(_0x8dd5('0x6'));router[_0x8dd5('0x7')]('/',auth[_0x8dd5('0x8')](),controller['index']);router['get']('/describe',auth[_0x8dd5('0x8')](),controller[_0x8dd5('0x9')]);router['get'](_0x8dd5('0xa'),auth['isAuthenticated'](),controller[_0x8dd5('0xb')]);router[_0x8dd5('0xc')]('/',auth[_0x8dd5('0x8')](),controller[_0x8dd5('0xd')]);router[_0x8dd5('0xe')](_0x8dd5('0xa'),auth['isAuthenticated'](),controller[_0x8dd5('0xf')]);router['delete'](_0x8dd5('0xa'),auth['isAuthenticated'](),controller[_0x8dd5('0x10')]);module[_0x8dd5('0x11')]=router; \ No newline at end of file +var _0x66eb=['util','path','connect-timeout','express','Router','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','update','delete','destroy','exports','multer'];(function(_0x3a83ef,_0x2f9c2c){var _0x4c8131=function(_0x2396c5){while(--_0x2396c5){_0x3a83ef['push'](_0x3a83ef['shift']());}};_0x4c8131(++_0x2f9c2c);}(_0x66eb,0xa9));var _0xb66e=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x66eb[_0x50a004];return _0x5e9992;};'use strict';var multer=require(_0xb66e('0x0'));var util=require(_0xb66e('0x1'));var path=require(_0xb66e('0x2'));var timeout=require(_0xb66e('0x3'));var express=require(_0xb66e('0x4'));var router=express[_0xb66e('0x5')]();var auth=require(_0xb66e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb66e('0x7'));router[_0xb66e('0x8')]('/',auth[_0xb66e('0x9')](),controller[_0xb66e('0xa')]);router[_0xb66e('0x8')](_0xb66e('0xb'),auth[_0xb66e('0x9')](),controller['describe']);router[_0xb66e('0x8')](_0xb66e('0xc'),auth[_0xb66e('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb66e('0xc'),auth[_0xb66e('0x9')](),controller[_0xb66e('0xd')]);router[_0xb66e('0xe')]('/:id',auth[_0xb66e('0x9')](),controller[_0xb66e('0xf')]);module[_0xb66e('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 47c9de8..8f097d1 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 _0xc6e9=['sequelize','exports','ENUM','agent','queue','NOW','moment'];(function(_0x3984cc,_0x1c4850){var _0x3242dc=function(_0x3eb90e){while(--_0x3eb90e){_0x3984cc['push'](_0x3984cc['shift']());}};_0x3242dc(++_0x1c4850);}(_0xc6e9,0x172));var _0x9c6e=function(_0x253e1b,_0x448910){_0x253e1b=_0x253e1b-0x0;var _0x3ae787=_0xc6e9[_0x253e1b];return _0x3ae787;};'use strict';var moment=require(_0x9c6e('0x0'));var Sequelize=require(_0x9c6e('0x1'));module[_0x9c6e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9c6e('0x3')]('account',_0x9c6e('0x4'),_0x9c6e('0x5')),'allowNull':![],'defaultValue':_0x9c6e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9c6e('0x6')]}}; \ No newline at end of file +var _0x991f=['sequelize','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x1a0db7,_0x596058){var _0x3c5f30=function(_0x4cbe71){while(--_0x4cbe71){_0x1a0db7['push'](_0x1a0db7['shift']());}};_0x3c5f30(++_0x596058);}(_0x991f,0x77));var _0xf991=function(_0x44d0d3,_0xb79a05){_0x44d0d3=_0x44d0d3-0x0;var _0x4d4a0a=_0x991f[_0x44d0d3];return _0x4d4a0a;};'use strict';var moment=require(_0xf991('0x0'));var Sequelize=require(_0xf991('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf991('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf991('0x3')](_0xf991('0x4'),_0xf991('0x5'),_0xf991('0x6')),'allowNull':![],'defaultValue':_0xf991('0x6')},'transferredAt':{'type':Sequelize[_0xf991('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index f7e2d60..3534312 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 _0x499c=['model','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','findAll','rows','catch','include','find','create','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','map','keys','query','intersection','attributes'];(function(_0xc4d8b0,_0x572cc3){var _0x796e24=function(_0xe702f2){while(--_0xe702f2){_0xc4d8b0['push'](_0xc4d8b0['shift']());}};_0x796e24(++_0x572cc3);}(_0x499c,0xfa));var _0xc499=function(_0x2ccbf4,_0x230c9e){_0x2ccbf4=_0x2ccbf4-0x0;var _0x5782dc=_0x499c[_0x2ccbf4];return _0x5782dc;};'use strict';var pdf=require(_0xc499('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc499('0x1'));var jsonpatch=require(_0xc499('0x2'));var rp=require(_0xc499('0x3'));var moment=require(_0xc499('0x4'));var BPromise=require(_0xc499('0x5'));var Mustache=require(_0xc499('0x6'));var util=require(_0xc499('0x7'));var path=require('path');var sox=require(_0xc499('0x8'));var csv=require(_0xc499('0x9'));var ejs=require(_0xc499('0xa'));var fs=require('fs');var _=require(_0xc499('0xb'));var squel=require(_0xc499('0xc'));var crypto=require(_0xc499('0xd'));var jsforce=require(_0xc499('0xe'));var deskjs=require(_0xc499('0xf'));var toCsv=require(_0xc499('0x9'));var querystring=require('querystring');var Papa=require(_0xc499('0x10'));var Redis=require(_0xc499('0x11'));var authService=require(_0xc499('0x12'));var qs=require(_0xc499('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc499('0x14'));var logger=require('../../config/logger')(_0xc499('0x15'));var utils=require(_0xc499('0x16'));var config=require(_0xc499('0x17'));var db=require(_0xc499('0x18'))['db'];function respondWithStatusCode(_0x2f2d39,_0x799152){_0x799152=_0x799152||0xcc;return function(_0x46fe8a){if(_0x46fe8a){return _0x2f2d39['sendStatus'](_0x799152);}return _0x2f2d39[_0xc499('0x19')](_0x799152)[_0xc499('0x1a')]();};}function respondWithResult(_0x395551,_0x50c7da){_0x50c7da=_0x50c7da||0xc8;return function(_0x3d205b){if(_0x3d205b){return _0x395551[_0xc499('0x19')](_0x50c7da)[_0xc499('0x1b')](_0x3d205b);}};}function respondWithFilteredResult(_0x210f1a,_0x2aa595){return function(_0x278fbe){if(_0x278fbe){var _0x233b8f=_0x278fbe[_0xc499('0x1c')],_0x5e4a81=_0x2aa595[_0xc499('0x1d')],_0x39c876=_0x2aa595[_0xc499('0x1d')]+_0x2aa595[_0xc499('0x1e')],_0xc769cb;if(_0x39c876>=_0x233b8f){_0x39c876=_0x233b8f;_0xc769cb=0xc8;}else{_0xc769cb=0xce;}_0x210f1a[_0xc499('0x19')](_0xc769cb);return _0x210f1a[_0xc499('0x1f')](_0xc499('0x20'),_0x5e4a81+'-'+_0x39c876+'/'+_0x233b8f)['json'](_0x278fbe);}return null;};}function patchUpdates(_0x241d0e){return function(_0x39e438){try{jsonpatch[_0xc499('0x21')](_0x39e438,_0x241d0e,!![]);}catch(_0x14d6ca){return BPromise[_0xc499('0x22')](_0x14d6ca);}return _0x39e438[_0xc499('0x23')]();};}function saveUpdates(_0x2151eb,_0x161588){return function(_0x23a1ad){if(_0x23a1ad){return _0x23a1ad[_0xc499('0x24')](_0x2151eb)[_0xc499('0x25')](function(_0x2f2897){return _0x2f2897;});}return null;};}function removeEntity(_0x4f0718,_0x279680){return function(_0xb1d95){if(_0xb1d95){return _0xb1d95[_0xc499('0x26')]()[_0xc499('0x25')](function(){_0x4f0718[_0xc499('0x19')](0xcc)[_0xc499('0x1a')]();});}};}function handleEntityNotFound(_0xb570ec,_0xbb8763){return function(_0x15133d){if(!_0x15133d){_0xb570ec[_0xc499('0x27')](0x194);}return _0x15133d;};}function handleError(_0x45363d,_0x3e926a){_0x3e926a=_0x3e926a||0x1f4;return function(_0x13beb6){logger[_0xc499('0x28')](_0x13beb6[_0xc499('0x29')]);if(_0x13beb6[_0xc499('0x2a')]){delete _0x13beb6[_0xc499('0x2a')];}_0x45363d['status'](_0x3e926a)[_0xc499('0x2b')](_0x13beb6);};}exports[_0xc499('0x2c')]=function(_0x449643,_0x21eaf7){var _0x2b4c97={},_0x247f11={},_0x264a04={'count':0x0,'rows':[]};var _0x58ba34=_['map'](db[_0xc499('0x2d')][_0xc499('0x2e')],function(_0x30247d){return{'name':_0x30247d[_0xc499('0x2f')],'type':_0x30247d[_0xc499('0x30')]['key']};});_0x247f11['model']=_[_0xc499('0x31')](_0x58ba34,_0xc499('0x2a'));_0x247f11['query']=_[_0xc499('0x32')](_0x449643[_0xc499('0x33')]);_0x247f11['filters']=_[_0xc499('0x34')](_0x247f11['model'],_0x247f11[_0xc499('0x33')]);_0x2b4c97[_0xc499('0x35')]=_['intersection'](_0x247f11[_0xc499('0x36')],qs[_0xc499('0x37')](_0x449643[_0xc499('0x33')]['fields']));_0x2b4c97[_0xc499('0x35')]=_0x2b4c97[_0xc499('0x35')][_0xc499('0x38')]?_0x2b4c97[_0xc499('0x35')]:_0x247f11[_0xc499('0x36')];if(!_0x449643[_0xc499('0x33')][_0xc499('0x39')](_0xc499('0x3a'))){_0x2b4c97[_0xc499('0x1e')]=qs[_0xc499('0x1e')](_0x449643[_0xc499('0x33')][_0xc499('0x1e')]);_0x2b4c97[_0xc499('0x1d')]=qs[_0xc499('0x1d')](_0x449643[_0xc499('0x33')]['offset']);}_0x2b4c97['order']=qs[_0xc499('0x3b')](_0x449643['query'][_0xc499('0x3b')]);_0x2b4c97['where']=qs['filters'](_[_0xc499('0x3c')](_0x449643['query'],_0x247f11[_0xc499('0x3d')]),_0x58ba34);if(_0x449643[_0xc499('0x33')][_0xc499('0x3e')]){_0x2b4c97[_0xc499('0x3f')]=_['merge'](_0x2b4c97[_0xc499('0x3f')],{'$or':_[_0xc499('0x31')](_0x58ba34,function(_0x2186da){if(_0x2186da[_0xc499('0x30')]!=='VIRTUAL'){var _0x50931f={};_0x50931f[_0x2186da[_0xc499('0x2a')]]={'$like':'%'+_0x449643[_0xc499('0x33')][_0xc499('0x3e')]+'%'};return _0x50931f;}})});}_0x2b4c97=_[_0xc499('0x40')]({},_0x2b4c97,_0x449643[_0xc499('0x41')]);var _0x2d0982={'where':_0x2b4c97[_0xc499('0x3f')]};return db[_0xc499('0x2d')][_0xc499('0x1c')](_0x2d0982)[_0xc499('0x25')](function(_0x366aad){_0x264a04['count']=_0x366aad;if(_0x449643[_0xc499('0x33')][_0xc499('0x42')]){_0x2b4c97['include']=[{'all':!![]}];}return db[_0xc499('0x2d')][_0xc499('0x43')](_0x2b4c97);})['then'](function(_0x237643){_0x264a04[_0xc499('0x44')]=_0x237643;return _0x264a04;})[_0xc499('0x25')](respondWithFilteredResult(_0x21eaf7,_0x2b4c97))[_0xc499('0x45')](handleError(_0x21eaf7,null));};exports['show']=function(_0x219330,_0x5ee025){var _0x17d532={'raw':!![],'where':{'id':_0x219330['params']['id']}},_0x2c625c={};_0x2c625c[_0xc499('0x36')]=_[_0xc499('0x32')](db[_0xc499('0x2d')][_0xc499('0x2e')]);_0x2c625c[_0xc499('0x33')]=_[_0xc499('0x32')](_0x219330[_0xc499('0x33')]);_0x2c625c[_0xc499('0x3d')]=_[_0xc499('0x34')](_0x2c625c[_0xc499('0x36')],_0x2c625c[_0xc499('0x33')]);_0x17d532[_0xc499('0x35')]=_[_0xc499('0x34')](_0x2c625c[_0xc499('0x36')],qs[_0xc499('0x37')](_0x219330[_0xc499('0x33')][_0xc499('0x37')]));_0x17d532[_0xc499('0x35')]=_0x17d532[_0xc499('0x35')][_0xc499('0x38')]?_0x17d532[_0xc499('0x35')]:_0x2c625c['model'];if(_0x219330[_0xc499('0x33')][_0xc499('0x42')]){_0x17d532[_0xc499('0x46')]=[{'all':!![]}];}_0x17d532=_[_0xc499('0x40')]({},_0x17d532,_0x219330[_0xc499('0x41')]);return db[_0xc499('0x2d')][_0xc499('0x47')](_0x17d532)[_0xc499('0x25')](handleEntityNotFound(_0x5ee025,null))[_0xc499('0x25')](respondWithResult(_0x5ee025,null))[_0xc499('0x45')](handleError(_0x5ee025,null));};exports['create']=function(_0x29dbeb,_0x135b3b){return db[_0xc499('0x2d')][_0xc499('0x48')](_0x29dbeb[_0xc499('0x49')],{})[_0xc499('0x25')](respondWithResult(_0x135b3b,0xc9))[_0xc499('0x45')](handleError(_0x135b3b,null));};exports[_0xc499('0x24')]=function(_0x4ad62d,_0x362c96){if(_0x4ad62d['body']['id']){delete _0x4ad62d[_0xc499('0x49')]['id'];}return db[_0xc499('0x2d')][_0xc499('0x47')]({'where':{'id':_0x4ad62d[_0xc499('0x4a')]['id']}})[_0xc499('0x25')](handleEntityNotFound(_0x362c96,null))[_0xc499('0x25')](saveUpdates(_0x4ad62d[_0xc499('0x49')],null))[_0xc499('0x25')](respondWithResult(_0x362c96,null))['catch'](handleError(_0x362c96,null));};exports[_0xc499('0x26')]=function(_0x277ba7,_0x1aadf9){return db[_0xc499('0x2d')][_0xc499('0x47')]({'where':{'id':_0x277ba7[_0xc499('0x4a')]['id']}})[_0xc499('0x25')](handleEntityNotFound(_0x1aadf9,null))[_0xc499('0x25')](removeEntity(_0x1aadf9,null))[_0xc499('0x45')](handleError(_0x1aadf9,null));};exports[_0xc499('0x4b')]=function(_0x1d4004,_0x3f7f7d){return db[_0xc499('0x2d')][_0xc499('0x4b')]()[_0xc499('0x25')](respondWithResult(_0x3f7f7d,null))['catch'](handleError(_0x3f7f7d,null));}; \ No newline at end of file +var _0x6173=['offset','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','intersection','model','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','describe','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x6173,0x167));var _0x3617=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6173[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x3617('0x0'));var emlformat=require(_0x3617('0x1'));var rimraf=require(_0x3617('0x2'));var zipdir=require(_0x3617('0x3'));var jsonpatch=require(_0x3617('0x4'));var rp=require(_0x3617('0x5'));var moment=require(_0x3617('0x6'));var BPromise=require(_0x3617('0x7'));var Mustache=require(_0x3617('0x8'));var util=require(_0x3617('0x9'));var path=require(_0x3617('0xa'));var sox=require('sox');var csv=require(_0x3617('0xb'));var ejs=require(_0x3617('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3617('0xd'));var crypto=require('crypto');var jsforce=require(_0x3617('0xe'));var deskjs=require(_0x3617('0xf'));var toCsv=require(_0x3617('0xb'));var querystring=require(_0x3617('0x10'));var Papa=require(_0x3617('0x11'));var Redis=require(_0x3617('0x12'));var authService=require(_0x3617('0x13'));var qs=require(_0x3617('0x14'));var as=require(_0x3617('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3617('0x16'))(_0x3617('0x17'));var utils=require(_0x3617('0x18'));var config=require(_0x3617('0x19'));var db=require(_0x3617('0x1a'))['db'];function respondWithStatusCode(_0x102f07,_0x331c2d){_0x331c2d=_0x331c2d||0xcc;return function(_0x408cb9){if(_0x408cb9){return _0x102f07[_0x3617('0x1b')](_0x331c2d);}return _0x102f07[_0x3617('0x1c')](_0x331c2d)[_0x3617('0x1d')]();};}function respondWithResult(_0x46da2d,_0x31bca){_0x31bca=_0x31bca||0xc8;return function(_0x503287){if(_0x503287){return _0x46da2d[_0x3617('0x1c')](_0x31bca)['json'](_0x503287);}};}function respondWithFilteredResult(_0x2cfc2e,_0x5f557c){return function(_0x20086b){if(_0x20086b){var _0x10837d=_0x20086b[_0x3617('0x1e')],_0x4feb4a=_0x5f557c[_0x3617('0x1f')],_0x29623b=_0x5f557c['offset']+_0x5f557c['limit'],_0x57d83b;if(_0x29623b>=_0x10837d){_0x29623b=_0x10837d;_0x57d83b=0xc8;}else{_0x57d83b=0xce;}_0x2cfc2e[_0x3617('0x1c')](_0x57d83b);return _0x2cfc2e[_0x3617('0x20')](_0x3617('0x21'),_0x4feb4a+'-'+_0x29623b+'/'+_0x10837d)[_0x3617('0x22')](_0x20086b);}return null;};}function patchUpdates(_0x2a7baf){return function(_0x349a83){try{jsonpatch[_0x3617('0x23')](_0x349a83,_0x2a7baf,!![]);}catch(_0x17655e){return BPromise['reject'](_0x17655e);}return _0x349a83['save']();};}function saveUpdates(_0x413e8a,_0x10c3c4){return function(_0x309d25){if(_0x309d25){return _0x309d25[_0x3617('0x24')](_0x413e8a)[_0x3617('0x25')](function(_0xaeba8b){return _0xaeba8b;});}return null;};}function removeEntity(_0x39a700,_0x964145){return function(_0x266a1f){if(_0x266a1f){return _0x266a1f[_0x3617('0x26')]()['then'](function(){_0x39a700[_0x3617('0x1c')](0xcc)[_0x3617('0x1d')]();});}};}function handleEntityNotFound(_0x36b3fa,_0x370f06){return function(_0x1bf2bc){if(!_0x1bf2bc){_0x36b3fa[_0x3617('0x1b')](0x194);}return _0x1bf2bc;};}function handleError(_0x47fb48,_0x57e718){_0x57e718=_0x57e718||0x1f4;return function(_0x4057ea){logger[_0x3617('0x27')](_0x4057ea[_0x3617('0x28')]);if(_0x4057ea[_0x3617('0x29')]){delete _0x4057ea['name'];}_0x47fb48['status'](_0x57e718)[_0x3617('0x2a')](_0x4057ea);};}exports['index']=function(_0x329858,_0x24d2b9){var _0x376e42={},_0x32ee81={},_0x574fc3={'count':0x0,'rows':[]};var _0x408932=_[_0x3617('0x2b')](db[_0x3617('0x2c')][_0x3617('0x2d')],function(_0x44e868){return{'name':_0x44e868[_0x3617('0x2e')],'type':_0x44e868[_0x3617('0x2f')][_0x3617('0x30')]};});_0x32ee81['model']=_['map'](_0x408932,_0x3617('0x29'));_0x32ee81['query']=_['keys'](_0x329858['query']);_0x32ee81['filters']=_[_0x3617('0x31')](_0x32ee81[_0x3617('0x32')],_0x32ee81[_0x3617('0x33')]);_0x376e42['attributes']=_[_0x3617('0x31')](_0x32ee81[_0x3617('0x32')],qs[_0x3617('0x34')](_0x329858[_0x3617('0x33')][_0x3617('0x34')]));_0x376e42[_0x3617('0x35')]=_0x376e42[_0x3617('0x35')][_0x3617('0x36')]?_0x376e42[_0x3617('0x35')]:_0x32ee81[_0x3617('0x32')];if(!_0x329858['query'][_0x3617('0x37')]('nolimit')){_0x376e42['limit']=qs['limit'](_0x329858[_0x3617('0x33')][_0x3617('0x38')]);_0x376e42[_0x3617('0x1f')]=qs['offset'](_0x329858[_0x3617('0x33')][_0x3617('0x1f')]);}_0x376e42[_0x3617('0x39')]=qs[_0x3617('0x3a')](_0x329858[_0x3617('0x33')][_0x3617('0x3a')]);_0x376e42[_0x3617('0x3b')]=qs[_0x3617('0x3c')](_[_0x3617('0x3d')](_0x329858[_0x3617('0x33')],_0x32ee81[_0x3617('0x3c')]),_0x408932);if(_0x329858[_0x3617('0x33')][_0x3617('0x3e')]){_0x376e42[_0x3617('0x3b')]=_['merge'](_0x376e42[_0x3617('0x3b')],{'$or':_['map'](_0x408932,function(_0xdb3043){if(_0xdb3043[_0x3617('0x2f')]!==_0x3617('0x3f')){var _0x15cdaf={};_0x15cdaf[_0xdb3043[_0x3617('0x29')]]={'$like':'%'+_0x329858['query'][_0x3617('0x3e')]+'%'};return _0x15cdaf;}})});}_0x376e42=_[_0x3617('0x40')]({},_0x376e42,_0x329858[_0x3617('0x41')]);var _0x38ef15={'where':_0x376e42[_0x3617('0x3b')]};return db[_0x3617('0x2c')][_0x3617('0x1e')](_0x38ef15)['then'](function(_0xa0093a){_0x574fc3[_0x3617('0x1e')]=_0xa0093a;if(_0x329858[_0x3617('0x33')]['includeAll']){_0x376e42[_0x3617('0x42')]=[{'all':!![]}];}return db[_0x3617('0x2c')][_0x3617('0x43')](_0x376e42);})['then'](function(_0x34fb15){_0x574fc3[_0x3617('0x44')]=_0x34fb15;return _0x574fc3;})[_0x3617('0x25')](respondWithFilteredResult(_0x24d2b9,_0x376e42))['catch'](handleError(_0x24d2b9,null));};exports[_0x3617('0x45')]=function(_0x59e5fc,_0x144166){var _0x56827a={'raw':!![],'where':{'id':_0x59e5fc[_0x3617('0x46')]['id']}},_0x51e97e={};_0x51e97e[_0x3617('0x32')]=_[_0x3617('0x47')](db[_0x3617('0x2c')]['rawAttributes']);_0x51e97e[_0x3617('0x33')]=_[_0x3617('0x47')](_0x59e5fc[_0x3617('0x33')]);_0x51e97e[_0x3617('0x3c')]=_['intersection'](_0x51e97e['model'],_0x51e97e['query']);_0x56827a[_0x3617('0x35')]=_[_0x3617('0x31')](_0x51e97e['model'],qs[_0x3617('0x34')](_0x59e5fc['query']['fields']));_0x56827a[_0x3617('0x35')]=_0x56827a['attributes'][_0x3617('0x36')]?_0x56827a['attributes']:_0x51e97e[_0x3617('0x32')];if(_0x59e5fc['query'][_0x3617('0x48')]){_0x56827a['include']=[{'all':!![]}];}_0x56827a=_[_0x3617('0x40')]({},_0x56827a,_0x59e5fc[_0x3617('0x41')]);return db[_0x3617('0x2c')]['find'](_0x56827a)['then'](handleEntityNotFound(_0x144166,null))['then'](respondWithResult(_0x144166,null))[_0x3617('0x49')](handleError(_0x144166,null));};exports[_0x3617('0x4a')]=function(_0x53e6df,_0x3807bd){return db[_0x3617('0x2c')]['create'](_0x53e6df[_0x3617('0x4b')],{})['then'](respondWithResult(_0x3807bd,0xc9))[_0x3617('0x49')](handleError(_0x3807bd,null));};exports['update']=function(_0x4758f7,_0xa002a2){if(_0x4758f7['body']['id']){delete _0x4758f7[_0x3617('0x4b')]['id'];}return db['MailTransferReport'][_0x3617('0x4c')]({'where':{'id':_0x4758f7[_0x3617('0x46')]['id']}})[_0x3617('0x25')](handleEntityNotFound(_0xa002a2,null))['then'](saveUpdates(_0x4758f7[_0x3617('0x4b')],null))[_0x3617('0x25')](respondWithResult(_0xa002a2,null))[_0x3617('0x49')](handleError(_0xa002a2,null));};exports['destroy']=function(_0x4f397b,_0x2a34fc){return db[_0x3617('0x2c')]['find']({'where':{'id':_0x4f397b[_0x3617('0x46')]['id']}})[_0x3617('0x25')](handleEntityNotFound(_0x2a34fc,null))['then'](removeEntity(_0x2a34fc,null))['catch'](handleError(_0x2a34fc,null));};exports['describe']=function(_0x11e351,_0x300f05){return db[_0x3617('0x2c')][_0x3617('0x4d')]()[_0x3617('0x25')](respondWithResult(_0x300f05,null))[_0x3617('0x49')](handleError(_0x300f05,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index de81bad..e21cd7a 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 _0x5c5a=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f9325,_0x5e346a){var _0x3cf883=function(_0x4de006){while(--_0x4de006){_0x3f9325['push'](_0x3f9325['shift']());}};_0x3cf883(++_0x5e346a);}(_0x5c5a,0xad));var _0xa5c5=function(_0x33581f,_0x597af5){_0x33581f=_0x33581f-0x0;var _0x3ab6fb=_0x5c5a[_0x33581f];return _0x3ab6fb;};'use strict';var _=require(_0xa5c5('0x0'));var util=require(_0xa5c5('0x1'));var logger=require(_0xa5c5('0x2'))(_0xa5c5('0x3'));var moment=require(_0xa5c5('0x4'));var BPromise=require(_0xa5c5('0x5'));var rp=require(_0xa5c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5c5('0x7'));var config=require(_0xa5c5('0x8'));var attributes=require(_0xa5c5('0x9'));module[_0xa5c5('0xa')]=function(_0x55bd6c,_0x37c422){return _0x55bd6c[_0xa5c5('0xb')](_0xa5c5('0xc'),attributes,{'tableName':_0xa5c5('0xd'),'paranoid':![],'indexes':[{'name':_0xa5c5('0xe'),'fields':[_0xa5c5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xdbf5,0x1dd));var _0x5dbf=function(_0x3ea15a,_0x516c17){_0x3ea15a=_0x3ea15a-0x0;var _0xe63ea9=_0xdbf5[_0x3ea15a];return _0xe63ea9;};'use strict';var _=require(_0x5dbf('0x0'));var util=require('util');var logger=require(_0x5dbf('0x1'))(_0x5dbf('0x2'));var moment=require(_0x5dbf('0x3'));var BPromise=require(_0x5dbf('0x4'));var rp=require(_0x5dbf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var attributes=require(_0x5dbf('0x8'));module[_0x5dbf('0x9')]=function(_0x4fde62,_0x41e6d7){return _0x4fde62['define'](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':_0x5dbf('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 61fc7a1..47a3124 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 _0x62cc=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x501c32,_0x2f24c9){var _0x9bd372=function(_0x34c2be){while(--_0x34c2be){_0x501c32['push'](_0x501c32['shift']());}};_0x9bd372(++_0x2f24c9);}(_0x62cc,0x8a));var _0xc62c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62cc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var moment=require('moment');var BPromise=require(_0xc62c('0x2'));var rs=require(_0xc62c('0x3'));var fs=require('fs');var Redis=require(_0xc62c('0x4'));var db=require(_0xc62c('0x5'))['db'];var utils=require(_0xc62c('0x6'));var logger=require(_0xc62c('0x7'))(_0xc62c('0x8'));var config=require(_0xc62c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc62c('0xa')][_0xc62c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d0013,_0x4bcb8d,_0x50691e){return new BPromise(function(_0x3365c5,_0x8e369a){return client[_0xc62c('0xc')](_0x2d0013,_0x50691e)[_0xc62c('0xd')](function(_0x6f76f7){logger[_0xc62c('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x4bcb8d,_0xc62c('0xf'));logger[_0xc62c('0x10')](_0xc62c('0x11'),_0x4bcb8d,_0xc62c('0xf'),JSON[_0xc62c('0x12')](_0x6f76f7));if(_0x6f76f7[_0xc62c('0x13')]){if(_0x6f76f7[_0xc62c('0x13')]['code']===0x1f4){logger['error'](_0xc62c('0x14'),_0x4bcb8d,_0x6f76f7['error'][_0xc62c('0x15')]);return _0x8e369a(_0x6f76f7[_0xc62c('0x13')][_0xc62c('0x15')]);}logger[_0xc62c('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4bcb8d,_0x6f76f7[_0xc62c('0x13')]['message']);return _0x3365c5(_0x6f76f7['error']['message']);}else{logger[_0xc62c('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x4bcb8d,_0xc62c('0xf'));_0x3365c5(_0x6f76f7[_0xc62c('0x16')]['message']);}})[_0xc62c('0x17')](function(_0xbb7e26){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4bcb8d,_0xbb7e26);_0x8e369a(_0xbb7e26);});});} \ No newline at end of file +var _0xb432=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','util'];(function(_0x2f2ed0,_0x1c6435){var _0x250b0d=function(_0x1909c1){while(--_0x1909c1){_0x2f2ed0['push'](_0x2f2ed0['shift']());}};_0x250b0d(++_0x1c6435);}(_0xb432,0xbc));var _0x2b43=function(_0x48354e,_0x497f46){_0x48354e=_0x48354e-0x0;var _0x3c411a=_0xb432[_0x48354e];return _0x3c411a;};'use strict';var _=require('lodash');var util=require(_0x2b43('0x0'));var moment=require(_0x2b43('0x1'));var BPromise=require(_0x2b43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b43('0x3'));var db=require(_0x2b43('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b43('0x5'))('rpc');var config=require(_0x2b43('0x6'));var jayson=require(_0x2b43('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x597634,_0x3316e3,_0x5f3d76){return new BPromise(function(_0x4502f5,_0x1e5ee9){return client[_0x2b43('0x8')](_0x597634,_0x5f3d76)[_0x2b43('0x9')](function(_0x3b52be){logger[_0x2b43('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x3316e3,'request\x20sent');logger[_0x2b43('0xb')](_0x2b43('0xc'),_0x3316e3,_0x2b43('0xd'),JSON[_0x2b43('0xe')](_0x3b52be));if(_0x3b52be['error']){if(_0x3b52be[_0x2b43('0xf')][_0x2b43('0x10')]===0x1f4){logger[_0x2b43('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x3316e3,_0x3b52be[_0x2b43('0xf')][_0x2b43('0x11')]);return _0x1e5ee9(_0x3b52be['error'][_0x2b43('0x11')]);}logger[_0x2b43('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x3316e3,_0x3b52be[_0x2b43('0xf')][_0x2b43('0x11')]);return _0x4502f5(_0x3b52be[_0x2b43('0xf')][_0x2b43('0x11')]);}else{logger[_0x2b43('0xa')](_0x2b43('0x12'),_0x3316e3,_0x2b43('0xd'));_0x4502f5(_0x3b52be[_0x2b43('0x13')][_0x2b43('0x11')]);}})[_0x2b43('0x14')](function(_0x561def){logger[_0x2b43('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x3316e3,_0x561def);_0x1e5ee9(_0x561def);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index ba98336..44b5af2 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 _0x7034=['../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x7034,0xd6));var _0x4703=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x7034[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x4703('0x0'));var util=require(_0x4703('0x1'));var path=require(_0x4703('0x2'));var timeout=require(_0x4703('0x3'));var express=require(_0x4703('0x4'));var router=express[_0x4703('0x5')]();var auth=require(_0x4703('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4703('0x7'));var controller=require('./memberReport.controller');router[_0x4703('0x8')]('/',auth['isAuthenticated'](),controller[_0x4703('0x9')]);router[_0x4703('0x8')](_0x4703('0xa'),auth[_0x4703('0xb')](),controller[_0x4703('0xc')]);router[_0x4703('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4703('0xd')]);router[_0x4703('0xe')]('/',auth[_0x4703('0xb')](),controller[_0x4703('0xf')]);router[_0x4703('0x10')](_0x4703('0x11'),auth[_0x4703('0xb')](),controller[_0x4703('0x12')]);router[_0x4703('0x13')](_0x4703('0x11'),auth[_0x4703('0xb')](),controller[_0x4703('0x14')]);module[_0x4703('0x15')]=router; \ No newline at end of file +var _0x0801=['get','isAuthenticated','index','/describe','describe','show','post','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./memberReport.controller'];(function(_0x1d8a63,_0x5b111e){var _0x6ee2ac=function(_0x1b3750){while(--_0x1b3750){_0x1d8a63['push'](_0x1d8a63['shift']());}};_0x6ee2ac(++_0x5b111e);}(_0x0801,0x6b));var _0x1080=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0801[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x1080('0x0'));var util=require('util');var path=require(_0x1080('0x1'));var timeout=require(_0x1080('0x2'));var express=require('express');var router=express[_0x1080('0x3')]();var auth=require(_0x1080('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1080('0x5'));var controller=require(_0x1080('0x6'));router[_0x1080('0x7')]('/',auth[_0x1080('0x8')](),controller[_0x1080('0x9')]);router[_0x1080('0x7')](_0x1080('0xa'),auth[_0x1080('0x8')](),controller[_0x1080('0xb')]);router[_0x1080('0x7')]('/:id',auth[_0x1080('0x8')](),controller[_0x1080('0xc')]);router[_0x1080('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x1080('0x8')](),controller[_0x1080('0xe')]);router[_0x1080('0xf')](_0x1080('0x10'),auth[_0x1080('0x8')](),controller[_0x1080('0x11')]);module[_0x1080('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f98cd9d..51a78a9 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 _0xbcee=['talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x35a521,_0x117bef){var _0xf6d2ef=function(_0x4284b){while(--_0x4284b){_0x35a521['push'](_0x35a521['shift']());}};_0xf6d2ef(++_0x117bef);}(_0xbcee,0x172));var _0xebce=function(_0x644caa,_0x154713){_0x644caa=_0x644caa-0x0;var _0x5c29f2=_0xbcee[_0x644caa];return _0x5c29f2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xebce('0x0'));module[_0xebce('0x1')]={'channel':{'type':Sequelize[_0xebce('0x2')]},'membername':{'type':Sequelize[_0xebce('0x2')]},'interface':{'type':Sequelize[_0xebce('0x2')]},'type':{'type':Sequelize[_0xebce('0x2')],'defaultValue':_0xebce('0x3'),'comment':_0xebce('0x4')},'duration':{'type':Sequelize[_0xebce('0x5')]},'enterAt':{'type':Sequelize[_0xebce('0x6')]},'exitAt':{'type':Sequelize[_0xebce('0x6')],'set':function(_0xef832a){var _0x209674=moment(_0xef832a);var _0xf7a07b=moment(this[_0xebce('0x7')]('enterAt'));var _0x3d24cb=_0x209674['diff'](_0xf7a07b,'seconds');this[_0xebce('0x8')](_0xebce('0x9'),_0xef832a);this['setDataValue'](_0xebce('0xa'),_0x3d24cb||null);}},'data1':{'type':Sequelize[_0xebce('0x2')],'comment':_0xebce('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xebce('0xc')},'data3':{'type':Sequelize[_0xebce('0x2')],'comment':_0xebce('0xd')},'data4':{'type':Sequelize[_0xebce('0x2')],'comment':_0xebce('0xe')},'data5':{'type':Sequelize[_0xebce('0x2')],'comment':_0xebce('0xf')},'role':{'type':Sequelize[_0xebce('0x2')]},'internal':{'type':Sequelize[_0xebce('0x5')]},'uniqueid':{'type':Sequelize[_0xebce('0x2')]}}; \ No newline at end of file +var _0xe520=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports'];(function(_0x1a7d3f,_0x5666b8){var _0x3d5670=function(_0x5d1204){while(--_0x5d1204){_0x1a7d3f['push'](_0x1a7d3f['shift']());}};_0x3d5670(++_0x5666b8);}(_0xe520,0xeb));var _0x0e52=function(_0x18281a,_0x2b788a){_0x18281a=_0x18281a-0x0;var _0x23f94e=_0xe520[_0x18281a];return _0x23f94e;};'use strict';var Sequelize=require(_0x0e52('0x0'));var moment=require(_0x0e52('0x1'));module[_0x0e52('0x2')]={'channel':{'type':Sequelize[_0x0e52('0x3')]},'membername':{'type':Sequelize[_0x0e52('0x3')]},'interface':{'type':Sequelize[_0x0e52('0x3')]},'type':{'type':Sequelize[_0x0e52('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x0e52('0x4')},'duration':{'type':Sequelize[_0x0e52('0x5')]},'enterAt':{'type':Sequelize[_0x0e52('0x6')]},'exitAt':{'type':Sequelize[_0x0e52('0x6')],'set':function(_0x273a58){var _0x2086d6=moment(_0x273a58);var _0x26d998=moment(this[_0x0e52('0x7')](_0x0e52('0x8')));var _0x50928d=_0x2086d6[_0x0e52('0x9')](_0x26d998,_0x0e52('0xa'));this[_0x0e52('0xb')](_0x0e52('0xc'),_0x273a58);this[_0x0e52('0xb')]('duration',_0x50928d||null);}},'data1':{'type':Sequelize[_0x0e52('0x3')],'comment':_0x0e52('0xd')},'data2':{'type':Sequelize[_0x0e52('0x3')],'comment':_0x0e52('0xe')},'data3':{'type':Sequelize[_0x0e52('0x3')],'comment':_0x0e52('0xf')},'data4':{'type':Sequelize[_0x0e52('0x3')],'comment':_0x0e52('0x10')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0e52('0x3')]},'internal':{'type':Sequelize[_0x0e52('0x5')]},'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 333de62..c3c643b 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 _0xd6c2=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','MemberReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','fields','includeAll','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit'];(function(_0x55d639,_0x421644){var _0x26044f=function(_0x56a99c){while(--_0x56a99c){_0x55d639['push'](_0x55d639['shift']());}};_0x26044f(++_0x421644);}(_0xd6c2,0xba));var _0x2d6c=function(_0xc6c14e,_0x4c3e78){_0xc6c14e=_0xc6c14e-0x0;var _0x13dd0e=_0xd6c2[_0xc6c14e];return _0x13dd0e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2d6c('0x0'));var rimraf=require(_0x2d6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6c('0x2'));var rp=require(_0x2d6c('0x3'));var moment=require('moment');var BPromise=require(_0x2d6c('0x4'));var Mustache=require('mustache');var util=require(_0x2d6c('0x5'));var path=require(_0x2d6c('0x6'));var sox=require('sox');var csv=require(_0x2d6c('0x7'));var ejs=require(_0x2d6c('0x8'));var fs=require('fs');var _=require(_0x2d6c('0x9'));var squel=require(_0x2d6c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2d6c('0xb'));var toCsv=require(_0x2d6c('0x7'));var querystring=require(_0x2d6c('0xc'));var Papa=require('papaparse');var Redis=require(_0x2d6c('0xd'));var authService=require(_0x2d6c('0xe'));var qs=require(_0x2d6c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d6c('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x2d6c('0x11'));var config=require(_0x2d6c('0x12'));var db=require(_0x2d6c('0x13'))['db'];function respondWithStatusCode(_0x1aae4e,_0xdba3e2){_0xdba3e2=_0xdba3e2||0xcc;return function(_0x53b550){if(_0x53b550){return _0x1aae4e[_0x2d6c('0x14')](_0xdba3e2);}return _0x1aae4e[_0x2d6c('0x15')](_0xdba3e2)['end']();};}function respondWithResult(_0x39b5e9,_0x11c07d){_0x11c07d=_0x11c07d||0xc8;return function(_0x5a8dfc){if(_0x5a8dfc){return _0x39b5e9[_0x2d6c('0x15')](_0x11c07d)['json'](_0x5a8dfc);}};}function respondWithFilteredResult(_0x56c435,_0xce13aa){return function(_0xbc594a){if(_0xbc594a){var _0x9af6b0=_0xbc594a['count'],_0x2d80e6=_0xce13aa[_0x2d6c('0x16')],_0x11f477=_0xce13aa['offset']+_0xce13aa[_0x2d6c('0x17')],_0x465965;if(_0x11f477>=_0x9af6b0){_0x11f477=_0x9af6b0;_0x465965=0xc8;}else{_0x465965=0xce;}_0x56c435['status'](_0x465965);return _0x56c435[_0x2d6c('0x18')](_0x2d6c('0x19'),_0x2d80e6+'-'+_0x11f477+'/'+_0x9af6b0)[_0x2d6c('0x1a')](_0xbc594a);}return null;};}function patchUpdates(_0x30dc0a){return function(_0x32f6a1){try{jsonpatch[_0x2d6c('0x1b')](_0x32f6a1,_0x30dc0a,!![]);}catch(_0x29013a){return BPromise[_0x2d6c('0x1c')](_0x29013a);}return _0x32f6a1[_0x2d6c('0x1d')]();};}function saveUpdates(_0x34d3b6,_0x30a404){return function(_0x3119f9){if(_0x3119f9){return _0x3119f9[_0x2d6c('0x1e')](_0x34d3b6)[_0x2d6c('0x1f')](function(_0x265b5b){return _0x265b5b;});}return null;};}function removeEntity(_0x2e14d1,_0x469b8f){return function(_0x502606){if(_0x502606){return _0x502606[_0x2d6c('0x20')]()['then'](function(){_0x2e14d1[_0x2d6c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x219456,_0x4b6e03){return function(_0x46f7d7){if(!_0x46f7d7){_0x219456[_0x2d6c('0x14')](0x194);}return _0x46f7d7;};}function handleError(_0x40b519,_0x177937){_0x177937=_0x177937||0x1f4;return function(_0x326c90){logger[_0x2d6c('0x21')](_0x326c90[_0x2d6c('0x22')]);if(_0x326c90['name']){delete _0x326c90[_0x2d6c('0x23')];}_0x40b519[_0x2d6c('0x15')](_0x177937)['send'](_0x326c90);};}exports[_0x2d6c('0x24')]=function(_0x4102c4,_0x5b9041){var _0x35ec35={},_0x5d063d={},_0x5d008f={'count':0x0,'rows':[]};var _0x28b48e=_['map'](db[_0x2d6c('0x25')][_0x2d6c('0x26')],function(_0x139cd2){return{'name':_0x139cd2['fieldName'],'type':_0x139cd2[_0x2d6c('0x27')][_0x2d6c('0x28')]};});_0x5d063d[_0x2d6c('0x29')]=_[_0x2d6c('0x2a')](_0x28b48e,_0x2d6c('0x23'));_0x5d063d[_0x2d6c('0x2b')]=_[_0x2d6c('0x2c')](_0x4102c4['query']);_0x5d063d[_0x2d6c('0x2d')]=_[_0x2d6c('0x2e')](_0x5d063d[_0x2d6c('0x29')],_0x5d063d[_0x2d6c('0x2b')]);_0x35ec35[_0x2d6c('0x2f')]=_[_0x2d6c('0x2e')](_0x5d063d[_0x2d6c('0x29')],qs['fields'](_0x4102c4[_0x2d6c('0x2b')]['fields']));_0x35ec35[_0x2d6c('0x2f')]=_0x35ec35[_0x2d6c('0x2f')]['length']?_0x35ec35[_0x2d6c('0x2f')]:_0x5d063d[_0x2d6c('0x29')];if(!_0x4102c4[_0x2d6c('0x2b')][_0x2d6c('0x30')](_0x2d6c('0x31'))){_0x35ec35[_0x2d6c('0x17')]=qs[_0x2d6c('0x17')](_0x4102c4[_0x2d6c('0x2b')][_0x2d6c('0x17')]);_0x35ec35[_0x2d6c('0x16')]=qs[_0x2d6c('0x16')](_0x4102c4['query'][_0x2d6c('0x16')]);}_0x35ec35['order']=qs[_0x2d6c('0x32')](_0x4102c4[_0x2d6c('0x2b')][_0x2d6c('0x32')]);_0x35ec35[_0x2d6c('0x33')]=qs['filters'](_[_0x2d6c('0x34')](_0x4102c4['query'],_0x5d063d[_0x2d6c('0x2d')]),_0x28b48e);if(_0x4102c4[_0x2d6c('0x2b')][_0x2d6c('0x35')]){_0x35ec35[_0x2d6c('0x33')]=_[_0x2d6c('0x36')](_0x35ec35[_0x2d6c('0x33')],{'$or':_['map'](_0x28b48e,function(_0x5150b2){if(_0x5150b2[_0x2d6c('0x27')]!==_0x2d6c('0x37')){var _0x3775c7={};_0x3775c7[_0x5150b2[_0x2d6c('0x23')]]={'$like':'%'+_0x4102c4[_0x2d6c('0x2b')][_0x2d6c('0x35')]+'%'};return _0x3775c7;}})});}_0x35ec35=_[_0x2d6c('0x36')]({},_0x35ec35,_0x4102c4[_0x2d6c('0x38')]);var _0x5bba2e={'where':_0x35ec35['where']};return db[_0x2d6c('0x25')][_0x2d6c('0x39')](_0x5bba2e)[_0x2d6c('0x1f')](function(_0x5cda46){_0x5d008f[_0x2d6c('0x39')]=_0x5cda46;if(_0x4102c4['query']['includeAll']){_0x35ec35[_0x2d6c('0x3a')]=[{'all':!![]}];}return db[_0x2d6c('0x25')][_0x2d6c('0x3b')](_0x35ec35);})[_0x2d6c('0x1f')](function(_0x10702c){_0x5d008f[_0x2d6c('0x3c')]=_0x10702c;return _0x5d008f;})[_0x2d6c('0x1f')](respondWithFilteredResult(_0x5b9041,_0x35ec35))[_0x2d6c('0x3d')](handleError(_0x5b9041,null));};exports[_0x2d6c('0x3e')]=function(_0x347866,_0x58c425){var _0xc86f43={'raw':!![],'where':{'id':_0x347866['params']['id']}},_0x7d1e01={};_0x7d1e01[_0x2d6c('0x29')]=_[_0x2d6c('0x2c')](db[_0x2d6c('0x25')][_0x2d6c('0x26')]);_0x7d1e01['query']=_[_0x2d6c('0x2c')](_0x347866['query']);_0x7d1e01['filters']=_[_0x2d6c('0x2e')](_0x7d1e01['model'],_0x7d1e01[_0x2d6c('0x2b')]);_0xc86f43[_0x2d6c('0x2f')]=_['intersection'](_0x7d1e01[_0x2d6c('0x29')],qs[_0x2d6c('0x3f')](_0x347866['query']['fields']));_0xc86f43['attributes']=_0xc86f43[_0x2d6c('0x2f')]['length']?_0xc86f43[_0x2d6c('0x2f')]:_0x7d1e01['model'];if(_0x347866[_0x2d6c('0x2b')][_0x2d6c('0x40')]){_0xc86f43['include']=[{'all':!![]}];}_0xc86f43=_['merge']({},_0xc86f43,_0x347866['options']);return db[_0x2d6c('0x25')]['find'](_0xc86f43)[_0x2d6c('0x1f')](handleEntityNotFound(_0x58c425,null))['then'](respondWithResult(_0x58c425,null))[_0x2d6c('0x3d')](handleError(_0x58c425,null));};exports[_0x2d6c('0x41')]=function(_0x507063,_0x5686b6){return db[_0x2d6c('0x25')][_0x2d6c('0x41')](_0x507063['body'],{})['then'](respondWithResult(_0x5686b6,0xc9))['catch'](handleError(_0x5686b6,null));};exports[_0x2d6c('0x1e')]=function(_0x2504db,_0x5a270b){if(_0x2504db[_0x2d6c('0x42')]['id']){delete _0x2504db[_0x2d6c('0x42')]['id'];}return db['MemberReport'][_0x2d6c('0x43')]({'where':{'id':_0x2504db[_0x2d6c('0x44')]['id']}})[_0x2d6c('0x1f')](handleEntityNotFound(_0x5a270b,null))[_0x2d6c('0x1f')](saveUpdates(_0x2504db[_0x2d6c('0x42')],null))[_0x2d6c('0x1f')](respondWithResult(_0x5a270b,null))[_0x2d6c('0x3d')](handleError(_0x5a270b,null));};exports['destroy']=function(_0x5ad0fc,_0x41836d){return db['MemberReport'][_0x2d6c('0x43')]({'where':{'id':_0x5ad0fc[_0x2d6c('0x44')]['id']}})[_0x2d6c('0x1f')](handleEntityNotFound(_0x41836d,null))[_0x2d6c('0x1f')](removeEntity(_0x41836d,null))[_0x2d6c('0x3d')](handleError(_0x41836d,null));};exports['describe']=function(_0x2189bb,_0x23fb35){return db[_0x2d6c('0x25')][_0x2d6c('0x45')]()[_0x2d6c('0x1f')](respondWithResult(_0x23fb35,null))[_0x2d6c('0x3d')](handleError(_0x23fb35,null));}; \ No newline at end of file +var _0x80f5=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','then','destroy','end','error','stack','name','send','index','map','MemberReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','update','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2f2169,_0x2539fa){var _0x494f41=function(_0x4aa546){while(--_0x4aa546){_0x2f2169['push'](_0x2f2169['shift']());}};_0x494f41(++_0x2539fa);}(_0x80f5,0x1e5));var _0x580f=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x80f5[_0x3b3a82];return _0x267063;};'use strict';var pdf=require(_0x580f('0x0'));var emlformat=require(_0x580f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x580f('0x2'));var jsonpatch=require(_0x580f('0x3'));var rp=require(_0x580f('0x4'));var moment=require(_0x580f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x580f('0x6'));var util=require(_0x580f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x580f('0x8'));var ejs=require(_0x580f('0x9'));var fs=require('fs');var _=require(_0x580f('0xa'));var squel=require(_0x580f('0xb'));var crypto=require(_0x580f('0xc'));var jsforce=require(_0x580f('0xd'));var deskjs=require(_0x580f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x580f('0xf'));var Papa=require(_0x580f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x580f('0x11'));var hardwareService=require(_0x580f('0x12'));var logger=require(_0x580f('0x13'))(_0x580f('0x14'));var utils=require(_0x580f('0x15'));var config=require('../../config/environment');var db=require(_0x580f('0x16'))['db'];function respondWithStatusCode(_0x2998d3,_0x2e137c){_0x2e137c=_0x2e137c||0xcc;return function(_0x3c2e3a){if(_0x3c2e3a){return _0x2998d3[_0x580f('0x17')](_0x2e137c);}return _0x2998d3['status'](_0x2e137c)['end']();};}function respondWithResult(_0x4cffaf,_0x1fb507){_0x1fb507=_0x1fb507||0xc8;return function(_0x432227){if(_0x432227){return _0x4cffaf[_0x580f('0x18')](_0x1fb507)[_0x580f('0x19')](_0x432227);}};}function respondWithFilteredResult(_0x23a995,_0x39052c){return function(_0x4bb60c){if(_0x4bb60c){var _0xc09dcc=_0x4bb60c[_0x580f('0x1a')],_0x16e0b3=_0x39052c[_0x580f('0x1b')],_0x5d941a=_0x39052c[_0x580f('0x1b')]+_0x39052c[_0x580f('0x1c')],_0x329b83;if(_0x5d941a>=_0xc09dcc){_0x5d941a=_0xc09dcc;_0x329b83=0xc8;}else{_0x329b83=0xce;}_0x23a995[_0x580f('0x18')](_0x329b83);return _0x23a995[_0x580f('0x1d')](_0x580f('0x1e'),_0x16e0b3+'-'+_0x5d941a+'/'+_0xc09dcc)[_0x580f('0x19')](_0x4bb60c);}return null;};}function patchUpdates(_0x381643){return function(_0x1a2a79){try{jsonpatch['apply'](_0x1a2a79,_0x381643,!![]);}catch(_0x21d65a){return BPromise['reject'](_0x21d65a);}return _0x1a2a79[_0x580f('0x1f')]();};}function saveUpdates(_0x46ef43,_0x149ef0){return function(_0xbcc1ff){if(_0xbcc1ff){return _0xbcc1ff['update'](_0x46ef43)[_0x580f('0x20')](function(_0x30d114){return _0x30d114;});}return null;};}function removeEntity(_0x14aee4,_0x45bf68){return function(_0x2b6938){if(_0x2b6938){return _0x2b6938[_0x580f('0x21')]()['then'](function(){_0x14aee4[_0x580f('0x18')](0xcc)[_0x580f('0x22')]();});}};}function handleEntityNotFound(_0xc36fe2,_0x53af48){return function(_0x45d5e5){if(!_0x45d5e5){_0xc36fe2['sendStatus'](0x194);}return _0x45d5e5;};}function handleError(_0x3efd56,_0x29bdbb){_0x29bdbb=_0x29bdbb||0x1f4;return function(_0x23dacd){logger[_0x580f('0x23')](_0x23dacd[_0x580f('0x24')]);if(_0x23dacd[_0x580f('0x25')]){delete _0x23dacd[_0x580f('0x25')];}_0x3efd56[_0x580f('0x18')](_0x29bdbb)[_0x580f('0x26')](_0x23dacd);};}exports[_0x580f('0x27')]=function(_0x6b53da,_0x32aef3){var _0xf86be3={},_0x4f9cd7={},_0x371fa3={'count':0x0,'rows':[]};var _0x234e45=_[_0x580f('0x28')](db[_0x580f('0x29')][_0x580f('0x2a')],function(_0x4a3eb7){return{'name':_0x4a3eb7['fieldName'],'type':_0x4a3eb7[_0x580f('0x2b')]['key']};});_0x4f9cd7[_0x580f('0x2c')]=_[_0x580f('0x28')](_0x234e45,'name');_0x4f9cd7[_0x580f('0x2d')]=_[_0x580f('0x2e')](_0x6b53da[_0x580f('0x2d')]);_0x4f9cd7[_0x580f('0x2f')]=_[_0x580f('0x30')](_0x4f9cd7[_0x580f('0x2c')],_0x4f9cd7['query']);_0xf86be3[_0x580f('0x31')]=_[_0x580f('0x30')](_0x4f9cd7[_0x580f('0x2c')],qs[_0x580f('0x32')](_0x6b53da[_0x580f('0x2d')]['fields']));_0xf86be3[_0x580f('0x31')]=_0xf86be3[_0x580f('0x31')]['length']?_0xf86be3['attributes']:_0x4f9cd7[_0x580f('0x2c')];if(!_0x6b53da[_0x580f('0x2d')][_0x580f('0x33')]('nolimit')){_0xf86be3[_0x580f('0x1c')]=qs[_0x580f('0x1c')](_0x6b53da[_0x580f('0x2d')][_0x580f('0x1c')]);_0xf86be3[_0x580f('0x1b')]=qs[_0x580f('0x1b')](_0x6b53da['query']['offset']);}_0xf86be3[_0x580f('0x34')]=qs[_0x580f('0x35')](_0x6b53da[_0x580f('0x2d')][_0x580f('0x35')]);_0xf86be3[_0x580f('0x36')]=qs[_0x580f('0x2f')](_[_0x580f('0x37')](_0x6b53da[_0x580f('0x2d')],_0x4f9cd7[_0x580f('0x2f')]),_0x234e45);if(_0x6b53da[_0x580f('0x2d')][_0x580f('0x38')]){_0xf86be3[_0x580f('0x36')]=_[_0x580f('0x39')](_0xf86be3[_0x580f('0x36')],{'$or':_[_0x580f('0x28')](_0x234e45,function(_0x1dd6a8){if(_0x1dd6a8[_0x580f('0x2b')]!=='VIRTUAL'){var _0x3de897={};_0x3de897[_0x1dd6a8[_0x580f('0x25')]]={'$like':'%'+_0x6b53da[_0x580f('0x2d')][_0x580f('0x38')]+'%'};return _0x3de897;}})});}_0xf86be3=_[_0x580f('0x39')]({},_0xf86be3,_0x6b53da[_0x580f('0x3a')]);var _0x4728da={'where':_0xf86be3[_0x580f('0x36')]};return db[_0x580f('0x29')][_0x580f('0x1a')](_0x4728da)[_0x580f('0x20')](function(_0x273052){_0x371fa3[_0x580f('0x1a')]=_0x273052;if(_0x6b53da[_0x580f('0x2d')]['includeAll']){_0xf86be3[_0x580f('0x3b')]=[{'all':!![]}];}return db[_0x580f('0x29')][_0x580f('0x3c')](_0xf86be3);})['then'](function(_0x49def5){_0x371fa3[_0x580f('0x3d')]=_0x49def5;return _0x371fa3;})['then'](respondWithFilteredResult(_0x32aef3,_0xf86be3))[_0x580f('0x3e')](handleError(_0x32aef3,null));};exports[_0x580f('0x3f')]=function(_0x596107,_0x584437){var _0x1107ec={'raw':!![],'where':{'id':_0x596107[_0x580f('0x40')]['id']}},_0x2769b7={};_0x2769b7[_0x580f('0x2c')]=_[_0x580f('0x2e')](db[_0x580f('0x29')]['rawAttributes']);_0x2769b7[_0x580f('0x2d')]=_[_0x580f('0x2e')](_0x596107[_0x580f('0x2d')]);_0x2769b7['filters']=_[_0x580f('0x30')](_0x2769b7[_0x580f('0x2c')],_0x2769b7['query']);_0x1107ec[_0x580f('0x31')]=_[_0x580f('0x30')](_0x2769b7['model'],qs[_0x580f('0x32')](_0x596107[_0x580f('0x2d')]['fields']));_0x1107ec[_0x580f('0x31')]=_0x1107ec[_0x580f('0x31')][_0x580f('0x41')]?_0x1107ec['attributes']:_0x2769b7[_0x580f('0x2c')];if(_0x596107[_0x580f('0x2d')][_0x580f('0x42')]){_0x1107ec[_0x580f('0x3b')]=[{'all':!![]}];}_0x1107ec=_['merge']({},_0x1107ec,_0x596107['options']);return db['MemberReport']['find'](_0x1107ec)[_0x580f('0x20')](handleEntityNotFound(_0x584437,null))[_0x580f('0x20')](respondWithResult(_0x584437,null))[_0x580f('0x3e')](handleError(_0x584437,null));};exports[_0x580f('0x43')]=function(_0x51ab9f,_0x2c24cf){return db['MemberReport'][_0x580f('0x43')](_0x51ab9f['body'],{})[_0x580f('0x20')](respondWithResult(_0x2c24cf,0xc9))['catch'](handleError(_0x2c24cf,null));};exports[_0x580f('0x44')]=function(_0x225572,_0x1ab8fc){if(_0x225572['body']['id']){delete _0x225572[_0x580f('0x45')]['id'];}return db[_0x580f('0x29')][_0x580f('0x46')]({'where':{'id':_0x225572[_0x580f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ab8fc,null))['then'](saveUpdates(_0x225572[_0x580f('0x45')],null))[_0x580f('0x20')](respondWithResult(_0x1ab8fc,null))[_0x580f('0x3e')](handleError(_0x1ab8fc,null));};exports[_0x580f('0x21')]=function(_0x54e5ca,_0x12fb14){return db['MemberReport'][_0x580f('0x46')]({'where':{'id':_0x54e5ca[_0x580f('0x40')]['id']}})[_0x580f('0x20')](handleEntityNotFound(_0x12fb14,null))[_0x580f('0x20')](removeEntity(_0x12fb14,null))['catch'](handleError(_0x12fb14,null));};exports[_0x580f('0x47')]=function(_0xa4200a,_0x219466){return db[_0x580f('0x29')][_0x580f('0x47')]()[_0x580f('0x20')](respondWithResult(_0x219466,null))[_0x580f('0x3e')](handleError(_0x219466,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index df43a74..626c298 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 _0xcca7=['api','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','report_member','membername_interface','membername','interface','lodash','util','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xcca7,0x1aa));var _0x7cca=function(_0x19d40b,_0x84b75b){_0x19d40b=_0x19d40b-0x0;var _0x5f3ede=_0xcca7[_0x19d40b];return _0x5f3ede;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('MemberReport',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[{'name':_0x7cca('0xa'),'fields':[_0x7cca('0xb'),_0x7cca('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6d6=['membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x23d1f9,_0x257def){var _0x1e85b1=function(_0x50432f){while(--_0x50432f){_0x23d1f9['push'](_0x23d1f9['shift']());}};_0x1e85b1(++_0x257def);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x38ea6b,_0x3883f4){_0x38ea6b=_0x38ea6b-0x0;var _0x370ca5=_0xd6d6[_0x38ea6b];return _0x370ca5;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[{'name':_0x6d6d('0xe'),'fields':[_0x6d6d('0xf'),_0x6d6d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ba2a2f1..35214b2 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 _0x4f7b=['CreateMemberReport','create','raw','UpdateMemberReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MemberReport','findAll','options','attributes','limit','include','map','model','GetMemberReport','debug'];(function(_0x27be20,_0xb053be){var _0x5379ed=function(_0x3f43b3){while(--_0x3f43b3){_0x27be20['push'](_0x27be20['shift']());}};_0x5379ed(++_0xb053be);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x2ac1d,_0x321fea){_0x2ac1d=_0x2ac1d-0x0;var _0x269ca6=_0x4f7b[_0x2ac1d];return _0x269ca6;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}exports['GetMemberReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')]({'raw':_0x53b135[_0xb4f7('0x19')]?_0x53b135['options']['raw']===undefined?!![]:![]:!![],'where':_0x53b135[_0xb4f7('0x19')]?_0x53b135[_0xb4f7('0x19')]['where']||null:null,'attributes':_0x53b135[_0xb4f7('0x19')]?_0x53b135[_0xb4f7('0x19')][_0xb4f7('0x1a')]||null:null,'limit':_0x53b135[_0xb4f7('0x19')]?_0x53b135['options'][_0xb4f7('0x1b')]||null:null,'include':_0x53b135['options']?_0x53b135[_0xb4f7('0x19')][_0xb4f7('0x1c')]?_[_0xb4f7('0x1d')](_0x53b135[_0xb4f7('0x19')][_0xb4f7('0x1c')],function(_0xbdee98){return{'model':db[_0xbdee98['model']],'as':_0xbdee98['as'],'attributes':_0xbdee98[_0xb4f7('0x1a')],'include':_0xbdee98[_0xb4f7('0x1c')]?_[_0xb4f7('0x1d')](_0xbdee98[_0xb4f7('0x1c')],function(_0x2ec8d4){return{'model':db[_0x2ec8d4[_0xb4f7('0x1e')]],'as':_0x2ec8d4['as'],'attributes':_0x2ec8d4['attributes'],'include':_0x2ec8d4[_0xb4f7('0x1c')]?_[_0xb4f7('0x1d')](_0x2ec8d4[_0xb4f7('0x1c')],function(_0x1f385d){return{'model':db[_0x1f385d[_0xb4f7('0x1e')]],'as':_0x1f385d['as'],'attributes':_0x1f385d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4f7('0xc')](function(_0x2757f9){logger['info'](_0xb4f7('0x1f'),_0x53b135);logger[_0xb4f7('0x20')](_0xb4f7('0x1f'),_0x53b135,JSON[_0xb4f7('0x11')](_0x2757f9));_0x22e273(_0x2757f9);})['catch'](function(_0x2cb1b3){logger[_0xb4f7('0x12')](_0xb4f7('0x1f'),_0x2cb1b3[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7['error'](0x1f4,_0x2cb1b3['message']));});});};exports[_0xb4f7('0x21')]=function(_0x54f33b){var _0x30c8c0=this;return new Promise(function(_0x2d61f0,_0x4d21a1){return db['MemberReport'][_0xb4f7('0x22')](_0x54f33b['body'],{'raw':_0x54f33b[_0xb4f7('0x19')]?_0x54f33b[_0xb4f7('0x19')][_0xb4f7('0x23')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x47365e){logger[_0xb4f7('0xd')](_0xb4f7('0x21'),_0x54f33b);logger['debug']('CreateMemberReport',_0x54f33b,JSON[_0xb4f7('0x11')](_0x47365e));_0x2d61f0(_0x47365e);})[_0xb4f7('0x16')](function(_0x5951a3){logger[_0xb4f7('0x12')]('CreateMemberReport',_0x5951a3[_0xb4f7('0x14')],_0x54f33b);_0x4d21a1(_0x30c8c0[_0xb4f7('0x12')](0x1f4,_0x5951a3[_0xb4f7('0x14')]));});});};exports[_0xb4f7('0x24')]=function(_0x36bf43){var _0x2c2ea4=this;return new Promise(function(_0x1172c9,_0x9ac24c){return db[_0xb4f7('0x17')][_0xb4f7('0x25')](_0x36bf43['body'],{'raw':_0x36bf43[_0xb4f7('0x19')]?_0x36bf43[_0xb4f7('0x19')][_0xb4f7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36bf43[_0xb4f7('0x19')]?_0x36bf43[_0xb4f7('0x19')][_0xb4f7('0x26')]||null:null,'attributes':_0x36bf43[_0xb4f7('0x19')]?_0x36bf43[_0xb4f7('0x19')][_0xb4f7('0x1a')]||null:null,'limit':_0x36bf43['options']?_0x36bf43[_0xb4f7('0x19')][_0xb4f7('0x1b')]||null:null})[_0xb4f7('0xc')](function(_0x16eb19){logger[_0xb4f7('0xd')]('UpdateMemberReport',_0x36bf43);logger['debug']('UpdateMemberReport',_0x36bf43,JSON[_0xb4f7('0x11')](_0x16eb19));_0x1172c9(_0x16eb19);})[_0xb4f7('0x16')](function(_0x5c59a0){logger[_0xb4f7('0x12')](_0xb4f7('0x24'),_0x5c59a0[_0xb4f7('0x14')],_0x36bf43);_0x9ac24c(_0x2c2ea4[_0xb4f7('0x12')](0x1f4,_0x5c59a0['message']));});});}; \ No newline at end of file +var _0x4266=['code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','CreateMemberReport','create','UpdateMemberReport','update','body','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4266,0x118));var _0x6426=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4266[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x6426('0x0'));var util=require('util');var moment=require(_0x6426('0x1'));var BPromise=require(_0x6426('0x2'));var rs=require(_0x6426('0x3'));var fs=require('fs');var Redis=require(_0x6426('0x4'));var db=require(_0x6426('0x5'))['db'];var utils=require(_0x6426('0x6'));var logger=require(_0x6426('0x7'))(_0x6426('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6426('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45a3db,_0x28ab09,_0x4435c6){return new BPromise(function(_0x4cd726,_0x2b9a3f){return client['request'](_0x45a3db,_0x4435c6)[_0x6426('0xa')](function(_0x4229a4){logger[_0x6426('0xb')]('MemberReport,\x20%s,\x20%s',_0x28ab09,'request\x20sent');logger[_0x6426('0xc')](_0x6426('0xd'),_0x28ab09,_0x6426('0xe'),JSON['stringify'](_0x4229a4));if(_0x4229a4[_0x6426('0xf')]){if(_0x4229a4[_0x6426('0xf')][_0x6426('0x10')]===0x1f4){logger['error'](_0x6426('0x11'),_0x28ab09,_0x4229a4['error'][_0x6426('0x12')]);return _0x2b9a3f(_0x4229a4['error']['message']);}logger['error'](_0x6426('0x11'),_0x28ab09,_0x4229a4['error']['message']);return _0x4cd726(_0x4229a4[_0x6426('0xf')]['message']);}else{logger[_0x6426('0xb')]('MemberReport,\x20%s,\x20%s',_0x28ab09,_0x6426('0xe'));_0x4cd726(_0x4229a4['result']['message']);}})[_0x6426('0x13')](function(_0x21c82c){logger[_0x6426('0xf')](_0x6426('0x11'),_0x28ab09,_0x21c82c);_0x2b9a3f(_0x21c82c);});});}exports[_0x6426('0x14')]=function(_0x3d9306){var _0x3f3151=this;return new Promise(function(_0x37d240,_0x57f36e){return db[_0x6426('0x15')][_0x6426('0x16')]({'raw':_0x3d9306[_0x6426('0x17')]?_0x3d9306[_0x6426('0x17')][_0x6426('0x18')]===undefined?!![]:![]:!![],'where':_0x3d9306[_0x6426('0x17')]?_0x3d9306[_0x6426('0x17')][_0x6426('0x19')]||null:null,'attributes':_0x3d9306[_0x6426('0x17')]?_0x3d9306[_0x6426('0x17')][_0x6426('0x1a')]||null:null,'limit':_0x3d9306[_0x6426('0x17')]?_0x3d9306[_0x6426('0x17')][_0x6426('0x1b')]||null:null,'include':_0x3d9306[_0x6426('0x17')]?_0x3d9306['options'][_0x6426('0x1c')]?_[_0x6426('0x1d')](_0x3d9306[_0x6426('0x17')][_0x6426('0x1c')],function(_0x99d95b){return{'model':db[_0x99d95b[_0x6426('0x1e')]],'as':_0x99d95b['as'],'attributes':_0x99d95b[_0x6426('0x1a')],'include':_0x99d95b['include']?_['map'](_0x99d95b['include'],function(_0x191339){return{'model':db[_0x191339['model']],'as':_0x191339['as'],'attributes':_0x191339['attributes'],'include':_0x191339[_0x6426('0x1c')]?_['map'](_0x191339['include'],function(_0x1860e4){return{'model':db[_0x1860e4[_0x6426('0x1e')]],'as':_0x1860e4['as'],'attributes':_0x1860e4[_0x6426('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6426('0xa')](function(_0x3ebaba){logger['info'](_0x6426('0x14'),_0x3d9306);logger[_0x6426('0xc')](_0x6426('0x14'),_0x3d9306,JSON[_0x6426('0x1f')](_0x3ebaba));_0x37d240(_0x3ebaba);})[_0x6426('0x13')](function(_0x1cc44a){logger[_0x6426('0xf')](_0x6426('0x14'),_0x1cc44a[_0x6426('0x12')],_0x3d9306);_0x57f36e(_0x3f3151[_0x6426('0xf')](0x1f4,_0x1cc44a[_0x6426('0x12')]));});});};exports[_0x6426('0x20')]=function(_0x354b77){var _0x1b5e89=this;return new Promise(function(_0x3813af,_0x518f72){return db[_0x6426('0x15')][_0x6426('0x21')](_0x354b77['body'],{'raw':_0x354b77[_0x6426('0x17')]?_0x354b77['options']['raw']===undefined?!![]:![]:!![]})[_0x6426('0xa')](function(_0x4d094d){logger[_0x6426('0xb')](_0x6426('0x20'),_0x354b77);logger['debug']('CreateMemberReport',_0x354b77,JSON['stringify'](_0x4d094d));_0x3813af(_0x4d094d);})[_0x6426('0x13')](function(_0x5f3ab4){logger[_0x6426('0xf')]('CreateMemberReport',_0x5f3ab4[_0x6426('0x12')],_0x354b77);_0x518f72(_0x1b5e89[_0x6426('0xf')](0x1f4,_0x5f3ab4[_0x6426('0x12')]));});});};exports[_0x6426('0x22')]=function(_0x1035de){var _0x4e0d44=this;return new Promise(function(_0x355228,_0x499077){return db[_0x6426('0x15')][_0x6426('0x23')](_0x1035de[_0x6426('0x24')],{'raw':_0x1035de[_0x6426('0x17')]?_0x1035de[_0x6426('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1035de[_0x6426('0x17')]?_0x1035de['options'][_0x6426('0x19')]||null:null,'attributes':_0x1035de[_0x6426('0x17')]?_0x1035de['options']['attributes']||null:null,'limit':_0x1035de['options']?_0x1035de['options']['limit']||null:null})['then'](function(_0x638463){logger[_0x6426('0xb')](_0x6426('0x22'),_0x1035de);logger[_0x6426('0xc')](_0x6426('0x22'),_0x1035de,JSON[_0x6426('0x1f')](_0x638463));_0x355228(_0x638463);})[_0x6426('0x13')](function(_0x1e149e){logger[_0x6426('0xf')]('UpdateMemberReport',_0x1e149e[_0x6426('0x12')],_0x1035de);_0x499077(_0x4e0d44['error'](0x1f4,_0x1e149e[_0x6426('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 8e4b089..67b0926 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 _0x5c00=['index','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x5a4127,_0xe4dd78){var _0x6db786=function(_0x1bfa0f){while(--_0x1bfa0f){_0x5a4127['push'](_0x5a4127['shift']());}};_0x6db786(++_0xe4dd78);}(_0x5c00,0x17e));var _0x05c0=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0x5c00[_0x3e36b6];return _0x4a3a36;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',controller[_0x05c0('0x8')]);module[_0x05c0('0x9')]=router; \ No newline at end of file +var _0x065e=['./migration.controller','get','exports','multer','express','Router','../../components/auth/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x065e,0x1a7));var _0xe065=function(_0xd9d9fe,_0x3c55d5){_0xd9d9fe=_0xd9d9fe-0x0;var _0x32b000=_0x065e[_0xd9d9fe];return _0x32b000;};'use strict';var multer=require(_0xe065('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe065('0x1'));var router=express[_0xe065('0x2')]();var auth=require(_0xe065('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe065('0x4'));router[_0xe065('0x5')]('/',controller['index']);module[_0xe065('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index a617b3c..57d19e7 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 _0x7e17=['STRING','version','exports'];(function(_0x1ca02d,_0x3e7b18){var _0x1269f8=function(_0x279f19){while(--_0x279f19){_0x1ca02d['push'](_0x1ca02d['shift']());}};_0x1269f8(++_0x3e7b18);}(_0x7e17,0x89));var _0x77e1=function(_0x5e2be0,_0x51090e){_0x5e2be0=_0x5e2be0-0x0;var _0x23d711=_0x7e17[_0x5e2be0];return _0x23d711;};'use strict';var Sequelize=require('sequelize');module[_0x77e1('0x0')]={'version':{'type':Sequelize[_0x77e1('0x1')],'unique':_0x77e1('0x2')}}; \ No newline at end of file +var _0xcf25=['exports'];(function(_0x53e22d,_0x3c9f57){var _0x20435a=function(_0x4ba015){while(--_0x4ba015){_0x53e22d['push'](_0x53e22d['shift']());}};_0x20435a(++_0x3c9f57);}(_0xcf25,0x110));var _0x5cf2=function(_0x25c290,_0x5441ca){_0x25c290=_0x25c290-0x0;var _0x41a4d6=_0xcf25[_0x25c290];return _0x41a4d6;};'use strict';var Sequelize=require('sequelize');module[_0x5cf2('0x0')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cb366da..4303ad3 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 _0xe706=['type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','Migration','include','findAll','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0xe706[_0x2d2258];return _0x18e155;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['Migration'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]),_0x114344);if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));}; \ No newline at end of file +var _0xedd9=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','Migration','includeAll','catch'];(function(_0x4505cb,_0x135d7d){var _0x188f78=function(_0x4837c6){while(--_0x4837c6){_0x4505cb['push'](_0x4505cb['shift']());}};_0x188f78(++_0x135d7d);}(_0xedd9,0xfc));var _0x9edd=function(_0x28ebcb,_0x207b3d){_0x28ebcb=_0x28ebcb-0x0;var _0xf64f2e=_0xedd9[_0x28ebcb];return _0xf64f2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={},_0x57a2cc={},_0x214d0a={'count':0x0,'rows':[]};var _0x257a26=_[_0x9edd('0x27')](db['Migration'][_0x9edd('0x28')],function(_0x28cfae){return{'name':_0x28cfae[_0x9edd('0x29')],'type':_0x28cfae[_0x9edd('0x2a')]['key']};});_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x27')](_0x257a26,_0x9edd('0x2c'));_0x57a2cc[_0x9edd('0x2d')]=_[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2d')]);_0x57a2cc[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x57a2cc[_0x9edd('0x2b')],_0x57a2cc[_0x9edd('0x2d')]);_0x4fe471[_0x9edd('0x31')]=_[_0x9edd('0x30')](_0x57a2cc[_0x9edd('0x2b')],qs[_0x9edd('0x32')](_0x25e135[_0x9edd('0x2d')]['fields']));_0x4fe471[_0x9edd('0x31')]=_0x4fe471[_0x9edd('0x31')][_0x9edd('0x33')]?_0x4fe471['attributes']:_0x57a2cc[_0x9edd('0x2b')];if(!_0x25e135[_0x9edd('0x2d')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x4fe471[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x25e135[_0x9edd('0x2d')][_0x9edd('0x1d')]);_0x4fe471[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x25e135[_0x9edd('0x2d')][_0x9edd('0x1c')]);}_0x4fe471[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x25e135['query'][_0x9edd('0x37')]);_0x4fe471['where']=qs[_0x9edd('0x2f')](_[_0x9edd('0x38')](_0x25e135[_0x9edd('0x2d')],_0x57a2cc[_0x9edd('0x2f')]),_0x257a26);if(_0x25e135[_0x9edd('0x2d')]['filter']){_0x4fe471[_0x9edd('0x39')]=_[_0x9edd('0x3a')](_0x4fe471[_0x9edd('0x39')],{'$or':_[_0x9edd('0x27')](_0x257a26,function(_0x1be77f){if(_0x1be77f[_0x9edd('0x2a')]!==_0x9edd('0x3b')){var _0x1cbbac={};_0x1cbbac[_0x1be77f[_0x9edd('0x2c')]]={'$like':'%'+_0x25e135[_0x9edd('0x2d')]['filter']+'%'};return _0x1cbbac;}})});}_0x4fe471=_[_0x9edd('0x3a')]({},_0x4fe471,_0x25e135['options']);var _0x3ef1d5={'where':_0x4fe471['where']};return db[_0x9edd('0x3c')][_0x9edd('0x1b')](_0x3ef1d5)[_0x9edd('0x21')](function(_0x479661){_0x214d0a[_0x9edd('0x1b')]=_0x479661;if(_0x25e135[_0x9edd('0x2d')][_0x9edd('0x3d')]){_0x4fe471['include']=[{'all':!![]}];}return db[_0x9edd('0x3c')]['findAll'](_0x4fe471);})[_0x9edd('0x21')](function(_0xfbc492){_0x214d0a['rows']=_0xfbc492;return _0x214d0a;})[_0x9edd('0x21')](respondWithFilteredResult(_0x3c2227,_0x4fe471))[_0x9edd('0x3e')](handleError(_0x3c2227,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e3577fc..44a7656 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 _0x5ce1=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x28fc62,_0x4af771){var _0x4e2bef=function(_0x5b75b7){while(--_0x5b75b7){_0x28fc62['push'](_0x28fc62['shift']());}};_0x4e2bef(++_0x4af771);}(_0x5ce1,0x1e7));var _0x15ce=function(_0x3517d9,_0x1e6703){_0x3517d9=_0x3517d9-0x0;var _0x29a2f4=_0x5ce1[_0x3517d9];return _0x29a2f4;};'use strict';var _=require(_0x15ce('0x0'));var util=require(_0x15ce('0x1'));var logger=require(_0x15ce('0x2'))(_0x15ce('0x3'));var moment=require(_0x15ce('0x4'));var BPromise=require(_0x15ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15ce('0x6'));var rimraf=require(_0x15ce('0x7'));var config=require(_0x15ce('0x8'));var attributes=require(_0x15ce('0x9'));module[_0x15ce('0xa')]=function(_0x1cf0a2,_0xbf7efd){return _0x1cf0a2[_0x15ce('0xb')](_0x15ce('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x342e=['bluebird','request-promise','../../config/environment','./migration.attributes','exports','migrations','lodash','util','../../config/logger'];(function(_0x5b0779,_0x40d92a){var _0x2d8671=function(_0x5cd62d){while(--_0x5cd62d){_0x5b0779['push'](_0x5b0779['shift']());}};_0x2d8671(++_0x40d92a);}(_0x342e,0xde));var _0xe342=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x342e[_0x2a2166];return _0x3bcf50;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe342('0x3'));var rp=require(_0xe342('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe342('0x5'));var attributes=require(_0xe342('0x6'));module[_0xe342('0x7')]=function(_0x590e9,_0x164e21){return _0x590e9['define']('Migration',attributes,{'tableName':_0xe342('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 051cbd4..3920ce4 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 _0xdb89=['http','request','then','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x674941,_0x43e51e){var _0x1420e9=function(_0x3f065d){while(--_0x3f065d){_0x674941['push'](_0x674941['shift']());}};_0x1420e9(++_0x43e51e);}(_0xdb89,0xda));var _0x9db8=function(_0x26daf4,_0x351a1b){_0x26daf4=_0x26daf4-0x0;var _0x1ccfe0=_0xdb89[_0x26daf4];return _0x1ccfe0;};'use strict';var _=require(_0x9db8('0x0'));var util=require(_0x9db8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9db8('0x2'));var fs=require('fs');var Redis=require(_0x9db8('0x3'));var db=require(_0x9db8('0x4'))['db'];var utils=require(_0x9db8('0x5'));var logger=require(_0x9db8('0x6'))(_0x9db8('0x7'));var config=require(_0x9db8('0x8'));var jayson=require(_0x9db8('0x9'));var client=jayson['client'][_0x9db8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4752c8,_0x415729,_0x3584dd){return new BPromise(function(_0x5ba844,_0x129e7b){return client[_0x9db8('0xb')](_0x4752c8,_0x3584dd)[_0x9db8('0xc')](function(_0x407197){logger['info'](_0x9db8('0xd'),_0x415729,_0x9db8('0xe'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x415729,_0x9db8('0xe'),JSON[_0x9db8('0xf')](_0x407197));if(_0x407197[_0x9db8('0x10')]){if(_0x407197[_0x9db8('0x10')][_0x9db8('0x11')]===0x1f4){logger[_0x9db8('0x10')]('Migration,\x20%s,\x20%s',_0x415729,_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);return _0x129e7b(_0x407197['error']['message']);}logger[_0x9db8('0x10')](_0x9db8('0xd'),_0x415729,_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);return _0x5ba844(_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x415729,_0x9db8('0xe'));_0x5ba844(_0x407197['result'][_0x9db8('0x12')]);}})['catch'](function(_0x1aa9db){logger[_0x9db8('0x10')](_0x9db8('0xd'),_0x415729,_0x1aa9db);_0x129e7b(_0x1aa9db);});});} \ No newline at end of file +var _0x0294=['request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x16ce46,_0x3d3268){var _0x5d76b0=function(_0x8ec3fd){while(--_0x8ec3fd){_0x16ce46['push'](_0x16ce46['shift']());}};_0x5d76b0(++_0x3d3268);}(_0x0294,0xb3));var _0x4029=function(_0x17ff81,_0x4da158){_0x17ff81=_0x17ff81-0x0;var _0x431729=_0x0294[_0x17ff81];return _0x431729;};'use strict';var _=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var moment=require(_0x4029('0x2'));var BPromise=require('bluebird');var rs=require(_0x4029('0x3'));var fs=require('fs');var Redis=require(_0x4029('0x4'));var db=require(_0x4029('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4029('0x6'));var config=require(_0x4029('0x7'));var jayson=require(_0x4029('0x8'));var client=jayson['client'][_0x4029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ad3d6,_0x30ef1e,_0x3dbe90){return new BPromise(function(_0x173520,_0x3ba92e){return client[_0x4029('0xa')](_0x2ad3d6,_0x3dbe90)[_0x4029('0xb')](function(_0x415904){logger[_0x4029('0xc')]('Migration,\x20%s,\x20%s',_0x30ef1e,'request\x20sent');logger[_0x4029('0xd')](_0x4029('0xe'),_0x30ef1e,_0x4029('0xf'),JSON['stringify'](_0x415904));if(_0x415904[_0x4029('0x10')]){if(_0x415904[_0x4029('0x10')]['code']===0x1f4){logger['error'](_0x4029('0x11'),_0x30ef1e,_0x415904['error'][_0x4029('0x12')]);return _0x3ba92e(_0x415904[_0x4029('0x10')]['message']);}logger[_0x4029('0x10')](_0x4029('0x11'),_0x30ef1e,_0x415904['error'][_0x4029('0x12')]);return _0x173520(_0x415904[_0x4029('0x10')][_0x4029('0x12')]);}else{logger['info'](_0x4029('0x11'),_0x30ef1e,_0x4029('0xf'));_0x173520(_0x415904[_0x4029('0x13')]['message']);}})[_0x4029('0x14')](function(_0x5c229d){logger[_0x4029('0x10')](_0x4029('0x11'),_0x30ef1e,_0x5c229d);_0x3ba92e(_0x5c229d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ae49396..30c87c3 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 _0x0d56=['index','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0d56,0x113));var _0x60d5=function(_0x4ef826,_0x2e0ac8){_0x4ef826=_0x4ef826-0x0;var _0x154b8=_0x0d56[_0x4ef826];return _0x154b8;};'use strict';var multer=require(_0x60d5('0x0'));var util=require(_0x60d5('0x1'));var path=require(_0x60d5('0x2'));var timeout=require(_0x60d5('0x3'));var express=require(_0x60d5('0x4'));var router=express[_0x60d5('0x5')]();var auth=require(_0x60d5('0x6'));var interaction=require(_0x60d5('0x7'));var config=require(_0x60d5('0x8'));var controller=require('./network.controller');router[_0x60d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x60d5('0xa')]);router[_0x60d5('0x9')](_0x60d5('0xb'),auth[_0x60d5('0xc')](),controller[_0x60d5('0xd')]);router[_0x60d5('0xe')]('/',auth['isAuthenticated'](),controller[_0x60d5('0xf')]);router[_0x60d5('0x10')](_0x60d5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x60d5('0x11')](_0x60d5('0xb'),auth[_0x60d5('0xc')](),controller[_0x60d5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x743d=['exports','path','connect-timeout','express','Router','../../components/interaction/service','./network.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1127ca,_0x368825){var _0x197c62=function(_0x33454c){while(--_0x33454c){_0x1127ca['push'](_0x1127ca['shift']());}};_0x197c62(++_0x368825);}(_0x743d,0xa1));var _0xd743=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x743d[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd743('0x0'));var timeout=require(_0xd743('0x1'));var express=require(_0xd743('0x2'));var router=express[_0xd743('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd743('0x4'));var config=require('../../config/environment');var controller=require(_0xd743('0x5'));router['get']('/',auth[_0xd743('0x6')](),controller['index']);router['get'](_0xd743('0x7'),auth[_0xd743('0x6')](),controller[_0xd743('0x8')]);router[_0xd743('0x9')]('/',auth[_0xd743('0x6')](),controller[_0xd743('0xa')]);router[_0xd743('0xb')]('/:id',auth[_0xd743('0x6')](),controller[_0xd743('0xc')]);router[_0xd743('0xd')](_0xd743('0x7'),auth[_0xd743('0x6')](),controller[_0xd743('0xe')]);module[_0xd743('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 439359b..f69bc0b 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(_0x30c7ea,_0x500126){var _0x3657c9=function(_0x20d92f){while(--_0x20d92f){_0x30c7ea['push'](_0x30c7ea['shift']());}};_0x3657c9(++_0x500126);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x32c443,_0x5d1502){var _0x2636e9=function(_0x21ee9f){while(--_0x21ee9f){_0x32c443['push'](_0x32c443['shift']());}};_0x2636e9(++_0x5d1502);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 00b77c7..0734dca 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 _0xd582=['catch','show','params','find','create','sequelize','transaction','type','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','root','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','update','format','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','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','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','json','count','offset','limit','apply','reject','save','end','stack','name','status','send','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Network','findAll','rows'];(function(_0x5cfc23,_0x4484dc){var _0x4261be=function(_0x4cf9f4){while(--_0x4cf9f4){_0x5cfc23['push'](_0x5cfc23['shift']());}};_0x4261be(++_0x4484dc);}(_0xd582,0xff));var _0x2d58=function(_0x255840,_0x411b6e){_0x255840=_0x255840-0x0;var _0x40dad5=_0xd582[_0x255840];return _0x40dad5;};'use strict';var pdf=require(_0x2d58('0x0'));var emlformat=require(_0x2d58('0x1'));var rimraf=require(_0x2d58('0x2'));var zipdir=require(_0x2d58('0x3'));var jsonpatch=require(_0x2d58('0x4'));var rp=require(_0x2d58('0x5'));var moment=require(_0x2d58('0x6'));var BPromise=require(_0x2d58('0x7'));var Mustache=require(_0x2d58('0x8'));var util=require(_0x2d58('0x9'));var path=require(_0x2d58('0xa'));var sox=require(_0x2d58('0xb'));var csv=require(_0x2d58('0xc'));var ejs=require(_0x2d58('0xd'));var fs=require('fs');var _=require(_0x2d58('0xe'));var squel=require(_0x2d58('0xf'));var crypto=require(_0x2d58('0x10'));var jsforce=require(_0x2d58('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x2d58('0xc'));var querystring=require(_0x2d58('0x12'));var Papa=require('papaparse');var Redis=require(_0x2d58('0x13'));var authService=require(_0x2d58('0x14'));var qs=require(_0x2d58('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d58('0x16'));var logger=require(_0x2d58('0x17'))(_0x2d58('0x18'));var utils=require(_0x2d58('0x19'));var config=require(_0x2d58('0x1a'));var db=require(_0x2d58('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2d58('0x1c')][_0x2d58('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x8cbe17,_0x5484e0,_0x30d23e){if(_0x30d23e){var _0x505518=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x505518['test'](_0x5484e0)){return _0x8cbe17;}else{throw new db[(_0x2d58('0x1e'))][(_0x2d58('0x1f'))](_0x2d58('0x20'));}}else{return _0x8cbe17;}}function respondWithRpcPromise(_0x55c27e,_0x2add1d,_0x267712,_0x7d3804){return new BPromise(function(_0x393e5e,_0x35cc0e){var _0x493998=_0x7d3804||client;return _0x493998[_0x2d58('0x21')](_0x55c27e,_0x267712)[_0x2d58('0x22')](function(_0x10e188){logger[_0x2d58('0x23')](_0x2d58('0x24'),_0x2add1d,_0x2d58('0x25'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x2add1d,_0x2d58('0x25'),JSON[_0x2d58('0x26')](_0x10e188));if(_0x10e188[_0x2d58('0x27')]){if(_0x10e188['error'][_0x2d58('0x28')]===0x1f4){logger[_0x2d58('0x27')](_0x2d58('0x24'),_0x2add1d,_0x10e188[_0x2d58('0x27')]['message']);return _0x35cc0e(_0x10e188[_0x2d58('0x27')]['message']);}logger[_0x2d58('0x27')](_0x2d58('0x24'),_0x2add1d,_0x10e188[_0x2d58('0x27')][_0x2d58('0x29')]);return _0x393e5e(_0x10e188[_0x2d58('0x27')][_0x2d58('0x29')]);}else{logger[_0x2d58('0x23')](_0x2d58('0x24'),_0x2add1d,'request\x20sent');_0x393e5e(_0x10e188['result']['message']);}})['catch'](function(_0x4c9441){logger[_0x2d58('0x27')](_0x2d58('0x24'),_0x2add1d,_0x4c9441);_0x35cc0e(_0x4c9441);});});}function respondWithStatusCode(_0x439eec,_0x3a0f2e){_0x3a0f2e=_0x3a0f2e||0xcc;return function(_0x5939fc){if(_0x5939fc){return _0x439eec[_0x2d58('0x2a')](_0x3a0f2e);}return _0x439eec['status'](_0x3a0f2e)['end']();};}function respondWithResult(_0x4e8b21,_0x27bc8b){_0x27bc8b=_0x27bc8b||0xc8;return function(_0x4c23e2){if(_0x4c23e2){return _0x4e8b21['status'](_0x27bc8b)[_0x2d58('0x2b')](_0x4c23e2);}};}function respondWithFilteredResult(_0x389405,_0x37f56e){return function(_0x316566){if(_0x316566){var _0x40960f=_0x316566[_0x2d58('0x2c')],_0x4fbfa4=_0x37f56e[_0x2d58('0x2d')],_0x3f14b2=_0x37f56e[_0x2d58('0x2d')]+_0x37f56e[_0x2d58('0x2e')],_0x3da94d;if(_0x3f14b2>=_0x40960f){_0x3f14b2=_0x40960f;_0x3da94d=0xc8;}else{_0x3da94d=0xce;}_0x389405['status'](_0x3da94d);return _0x389405['set']('Content-Range',_0x4fbfa4+'-'+_0x3f14b2+'/'+_0x40960f)['json'](_0x316566);}return null;};}function patchUpdates(_0xf09ea5){return function(_0x4a03cf){try{jsonpatch[_0x2d58('0x2f')](_0x4a03cf,_0xf09ea5,!![]);}catch(_0x4e3491){return BPromise[_0x2d58('0x30')](_0x4e3491);}return _0x4a03cf[_0x2d58('0x31')]();};}function saveUpdates(_0x513a53,_0x50159b){return function(_0x19be1e){if(_0x19be1e){return _0x19be1e['update'](_0x513a53)['then'](function(_0x40b222){return _0x40b222;});}return null;};}function removeEntity(_0x595def,_0x562825){return function(_0x214c60){if(_0x214c60){return _0x214c60['destroy']()['then'](function(){_0x595def['status'](0xcc)[_0x2d58('0x32')]();});}};}function handleEntityNotFound(_0x573afc,_0x2dfef8){return function(_0x55f50e){if(!_0x55f50e){_0x573afc[_0x2d58('0x2a')](0x194);}return _0x55f50e;};}function handleError(_0x86ffc1,_0x20a409){_0x20a409=_0x20a409||0x1f4;return function(_0xb41113){logger[_0x2d58('0x27')](_0xb41113[_0x2d58('0x33')]);if(_0xb41113['name']){delete _0xb41113[_0x2d58('0x34')];}_0x86ffc1[_0x2d58('0x35')](_0x20a409)[_0x2d58('0x36')](_0xb41113);};}exports['index']=function(_0x3dcc17,_0x1e8111){var _0x51a135={},_0x10b67d={},_0x3b79c2={'count':0x0,'rows':[]};var _0x3714dc=_[_0x2d58('0x37')](db['Network'][_0x2d58('0x38')],function(_0x3296ed){return{'name':_0x3296ed[_0x2d58('0x39')],'type':_0x3296ed['type'][_0x2d58('0x3a')]};});_0x10b67d[_0x2d58('0x3b')]=_[_0x2d58('0x37')](_0x3714dc,_0x2d58('0x34'));_0x10b67d['query']=_[_0x2d58('0x3c')](_0x3dcc17[_0x2d58('0x3d')]);_0x10b67d['filters']=_[_0x2d58('0x3e')](_0x10b67d[_0x2d58('0x3b')],_0x10b67d[_0x2d58('0x3d')]);_0x51a135[_0x2d58('0x3f')]=_[_0x2d58('0x3e')](_0x10b67d[_0x2d58('0x3b')],qs[_0x2d58('0x40')](_0x3dcc17[_0x2d58('0x3d')][_0x2d58('0x40')]));_0x51a135['attributes']=_0x51a135[_0x2d58('0x3f')][_0x2d58('0x41')]?_0x51a135[_0x2d58('0x3f')]:_0x10b67d[_0x2d58('0x3b')];if(!_0x3dcc17['query'][_0x2d58('0x42')](_0x2d58('0x43'))){_0x51a135[_0x2d58('0x2e')]=qs[_0x2d58('0x2e')](_0x3dcc17['query'][_0x2d58('0x2e')]);_0x51a135['offset']=qs[_0x2d58('0x2d')](_0x3dcc17['query'][_0x2d58('0x2d')]);}_0x51a135[_0x2d58('0x44')]=qs[_0x2d58('0x45')](_0x3dcc17[_0x2d58('0x3d')][_0x2d58('0x45')]);_0x51a135[_0x2d58('0x46')]=qs[_0x2d58('0x47')](_[_0x2d58('0x48')](_0x3dcc17['query'],_0x10b67d[_0x2d58('0x47')]),_0x3714dc);if(_0x3dcc17[_0x2d58('0x3d')][_0x2d58('0x49')]){_0x51a135[_0x2d58('0x46')]=_[_0x2d58('0x4a')](_0x51a135[_0x2d58('0x46')],{'$or':_['map'](_0x3714dc,function(_0x1e6165){if(_0x1e6165['type']!=='VIRTUAL'){var _0x23c36c={};_0x23c36c[_0x1e6165[_0x2d58('0x34')]]={'$like':'%'+_0x3dcc17[_0x2d58('0x3d')][_0x2d58('0x49')]+'%'};return _0x23c36c;}})});}_0x51a135=_['merge']({},_0x51a135,_0x3dcc17[_0x2d58('0x4b')]);var _0x314870={'where':_0x51a135[_0x2d58('0x46')]};return db['Network'][_0x2d58('0x2c')](_0x314870)[_0x2d58('0x22')](function(_0x13d9be){_0x3b79c2[_0x2d58('0x2c')]=_0x13d9be;if(_0x3dcc17[_0x2d58('0x3d')][_0x2d58('0x4c')]){_0x51a135[_0x2d58('0x4d')]=[{'all':!![]}];}return db[_0x2d58('0x4e')][_0x2d58('0x4f')](_0x51a135);})[_0x2d58('0x22')](function(_0x5d3036){_0x3b79c2[_0x2d58('0x50')]=_0x5d3036;return _0x3b79c2;})[_0x2d58('0x22')](respondWithFilteredResult(_0x1e8111,_0x51a135))[_0x2d58('0x51')](handleError(_0x1e8111,null));};exports[_0x2d58('0x52')]=function(_0xa0d2a1,_0x2e1e70){var _0x38bd1b={'raw':!![],'where':{'id':_0xa0d2a1[_0x2d58('0x53')]['id']}},_0x298b78={};_0x298b78[_0x2d58('0x3b')]=_[_0x2d58('0x3c')](db[_0x2d58('0x4e')][_0x2d58('0x38')]);_0x298b78[_0x2d58('0x3d')]=_[_0x2d58('0x3c')](_0xa0d2a1['query']);_0x298b78[_0x2d58('0x47')]=_[_0x2d58('0x3e')](_0x298b78[_0x2d58('0x3b')],_0x298b78[_0x2d58('0x3d')]);_0x38bd1b[_0x2d58('0x3f')]=_[_0x2d58('0x3e')](_0x298b78[_0x2d58('0x3b')],qs[_0x2d58('0x40')](_0xa0d2a1[_0x2d58('0x3d')][_0x2d58('0x40')]));_0x38bd1b['attributes']=_0x38bd1b[_0x2d58('0x3f')][_0x2d58('0x41')]?_0x38bd1b[_0x2d58('0x3f')]:_0x298b78[_0x2d58('0x3b')];if(_0xa0d2a1['query'][_0x2d58('0x4c')]){_0x38bd1b[_0x2d58('0x4d')]=[{'all':!![]}];}_0x38bd1b=_['merge']({},_0x38bd1b,_0xa0d2a1[_0x2d58('0x4b')]);return db['Network'][_0x2d58('0x54')](_0x38bd1b)['then'](handleEntityNotFound(_0x2e1e70,null))[_0x2d58('0x22')](respondWithResult(_0x2e1e70,null))[_0x2d58('0x51')](handleError(_0x2e1e70,null));};exports[_0x2d58('0x55')]=function(_0x5a1639,_0x58e6a1,_0x5a2203){var _0xa6810b;return db[_0x2d58('0x56')][_0x2d58('0x57')](function(_0x2558b4){return db[_0x2d58('0x4e')][_0x2d58('0x55')](_0x5a1639['body'],{'raw':!![]})[_0x2d58('0x22')](function(_0x3b281f){_0xa6810b=_0x3b281f;return db[_0x2d58('0x4e')]['findAll']({'where':{'type':_0x5a1639['body']['type']},'raw':!![]});})[_0x2d58('0x22')](function(_0xe112ec){if(_0xa6810b[_0x2d58('0x58')][_0x2d58('0x59')]()==_0x2d58('0x5a')){var _0x20da55=fs[_0x2d58('0x5b')](path['join'](config['root'],_0x2d58('0x5c')),_0x2d58('0x5d'));var _0x41253b=ejs[_0x2d58('0x5e')](_0x20da55,{'networks':_0xe112ec||[]});fs[_0x2d58('0x5f')](_0x2d58('0x60'),_0x41253b);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x55'),{'module':'res_stun_monitor.so'});}else if(_0xa6810b['type']['toUpperCase']()==_0x2d58('0x62')){var _0x4bd170=fs[_0x2d58('0x5b')](path[_0x2d58('0x63')](config['root'],_0x2d58('0x64')),'utf8');var _0x31024f=ejs[_0x2d58('0x5e')](_0x4bd170,{'networks':_0xe112ec||[]});fs['writeFileSync'](_0x2d58('0x65'),_0x31024f);return respondWithRpcPromise(_0x2d58('0x61'),'create',{'module':_0x2d58('0x66')});}else{var _0x54a6a0=fs[_0x2d58('0x5b')](path[_0x2d58('0x63')](config[_0x2d58('0x67')],_0x2d58('0x68')),_0x2d58('0x5d'));var _0xbc3016=ejs[_0x2d58('0x5e')](_0x54a6a0,{'networks':_0xe112ec||[]});fs[_0x2d58('0x5f')](util['format'](_0x2d58('0x69'),_0x5a1639[_0x2d58('0x6a')][_0x2d58('0x58')][_0x2d58('0x6b')]()),_0xbc3016);return respondWithRpcPromise(_0x2d58('0x61'),'create',{'module':_0x2d58('0x6c')});}return null;})[_0x2d58('0x22')](function(){return _0xa6810b;});})[_0x2d58('0x22')](respondWithResult(_0x58e6a1,0xc9))[_0x2d58('0x51')](handleError(_0x58e6a1,null));};exports[_0x2d58('0x6d')]=function(_0x28660a,_0x29b7c6,_0x2b108d){var _0x1f0781;return db[_0x2d58('0x56')][_0x2d58('0x57')](function(_0x1f674b){return db[_0x2d58('0x4e')][_0x2d58('0x54')]({'where':{'id':_0x28660a[_0x2d58('0x53')]['id']}})[_0x2d58('0x22')](handleEntityNotFound(_0x29b7c6,null))['then'](saveUpdates(_0x28660a[_0x2d58('0x6a')],null))[_0x2d58('0x22')](function(_0x27601e){if(_0x27601e){_0x1f0781=_0x27601e;return db[_0x2d58('0x4e')][_0x2d58('0x4f')]({'where':{'type':_0x1f0781[_0x2d58('0x58')]},'raw':!![]});}return null;})[_0x2d58('0x22')](function(_0x3b1edb){if(_0x1f0781[_0x2d58('0x58')]['toUpperCase']()==_0x2d58('0x5a')){var _0x3e0552=fs['readFileSync'](path[_0x2d58('0x63')](config[_0x2d58('0x67')],_0x2d58('0x5c')),_0x2d58('0x5d'));var _0x37011a=ejs[_0x2d58('0x5e')](_0x3e0552,{'networks':_0x3b1edb||[]});fs[_0x2d58('0x5f')](_0x2d58('0x60'),_0x37011a);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x6d'),{'module':_0x2d58('0x66')});}else if(_0x1f0781[_0x2d58('0x58')][_0x2d58('0x59')]()=='TURN'){var _0x14b674=fs[_0x2d58('0x5b')](path['join'](config[_0x2d58('0x67')],_0x2d58('0x64')),_0x2d58('0x5d'));var _0x43e91e=ejs['render'](_0x14b674,{'networks':_0x3b1edb||[]});fs['writeFileSync'](_0x2d58('0x65'),_0x43e91e);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x6d'),{'module':_0x2d58('0x66')});}else{var _0x3f9b42=fs[_0x2d58('0x5b')](path[_0x2d58('0x63')](config[_0x2d58('0x67')],'server/files/templates/network.ejs'),_0x2d58('0x5d'));var _0x2f47d1=ejs[_0x2d58('0x5e')](_0x3f9b42,{'networks':_0x3b1edb||[]});fs[_0x2d58('0x5f')](util[_0x2d58('0x6e')](_0x2d58('0x69'),_0x28660a['body']['type']['toLowerCase']()),_0x2f47d1);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x6d'),{'module':_0x2d58('0x6c')});}return null;})['then'](function(_0x393870){if(_0x393870){return _0x1f0781;}return null;});})[_0x2d58('0x22')](respondWithResult(_0x29b7c6,null))[_0x2d58('0x51')](handleError(_0x29b7c6,null));};exports[_0x2d58('0x6f')]=function(_0x40a2c7,_0x413a04,_0x759df6){var _0x43f299;return db[_0x2d58('0x4e')][_0x2d58('0x54')]({'where':{'id':_0x40a2c7[_0x2d58('0x53')]['id']}})[_0x2d58('0x22')](function(_0x42de67){_0x43f299=_0x42de67;return _0x42de67;})['then'](handleEntityNotFound(_0x413a04,null))['then'](removeEntity(_0x413a04,null))[_0x2d58('0x22')](function(){if(_0x43f299){return db[_0x2d58('0x4e')][_0x2d58('0x4f')]({'where':{'type':_0x43f299[_0x2d58('0x58')]},'raw':!![]});}})['then'](function(_0x8a2176){if(_0x43f299[_0x2d58('0x58')]['toUpperCase']()==_0x2d58('0x5a')){var _0x2e2010=fs[_0x2d58('0x5b')](path[_0x2d58('0x63')](config[_0x2d58('0x67')],_0x2d58('0x5c')),_0x2d58('0x5d'));var _0x53f7ed=ejs[_0x2d58('0x5e')](_0x2e2010,{'networks':_0x8a2176||[]});fs[_0x2d58('0x5f')](_0x2d58('0x60'),_0x53f7ed);return respondWithRpcPromise('Reload',_0x2d58('0x6f'),{'module':'res_stun_monitor.so'});}else if(_0x43f299['type'][_0x2d58('0x59')]()==_0x2d58('0x62')){var _0x3ad275=fs['readFileSync'](path[_0x2d58('0x63')](config[_0x2d58('0x67')],_0x2d58('0x64')),'utf8');var _0x43c5f9=ejs[_0x2d58('0x5e')](_0x3ad275,{'networks':_0x8a2176||[]});fs[_0x2d58('0x5f')](_0x2d58('0x65'),_0x43c5f9);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x6f'),{'module':_0x2d58('0x66')});}else{var _0x488b6f=fs[_0x2d58('0x5b')](path[_0x2d58('0x63')](config[_0x2d58('0x67')],'server/files/templates/network.ejs'),'utf8');var _0x437118=ejs[_0x2d58('0x5e')](_0x488b6f,{'networks':_0x8a2176||[]});fs['writeFileSync'](util[_0x2d58('0x6e')](_0x2d58('0x69'),_0x40a2c7[_0x2d58('0x6a')][_0x2d58('0x58')][_0x2d58('0x6b')]()),_0x437118);return respondWithRpcPromise(_0x2d58('0x61'),_0x2d58('0x6f'),{'module':'chan_sip.so'});}return null;})[_0x2d58('0x51')](handleError(_0x413a04,null));}; \ No newline at end of file +var _0x2004=['result','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','then','stack','name','send','map','Network','fieldName','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','sequelize','body','type','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','transaction','format','destroy','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','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~!@#$%^&-_=+[{]}.','info','debug','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message'];(function(_0xf5e300,_0x2343d4){var _0x3f0978=function(_0x4382bc){while(--_0x4382bc){_0xf5e300['push'](_0xf5e300['shift']());}};_0x3f0978(++_0x2343d4);}(_0x2004,0xac));var _0x4200=function(_0xa65cc,_0x3ffcd5){_0xa65cc=_0xa65cc-0x0;var _0x22a2d4=_0x2004[_0xa65cc];return _0x22a2d4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4200('0x0'));var rimraf=require(_0x4200('0x1'));var zipdir=require(_0x4200('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4200('0x3'));var moment=require(_0x4200('0x4'));var BPromise=require(_0x4200('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4200('0x6'));var sox=require(_0x4200('0x7'));var csv=require(_0x4200('0x8'));var ejs=require(_0x4200('0x9'));var fs=require('fs');var _=require(_0x4200('0xa'));var squel=require(_0x4200('0xb'));var crypto=require(_0x4200('0xc'));var jsforce=require(_0x4200('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4200('0x8'));var querystring=require(_0x4200('0xe'));var Papa=require(_0x4200('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4200('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4200('0x11'));var logger=require(_0x4200('0x12'))('api');var utils=require(_0x4200('0x13'));var config=require('../../config/environment');var db=require(_0x4200('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x4200('0x15')]({'port':0x232a});function checkPasswordPattern(_0x123c25,_0xc3eb6b,_0x3abb2e){if(_0x3abb2e){var _0x2e3b15=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e3b15[_0x4200('0x16')](_0xc3eb6b)){return _0x123c25;}else{throw new db[(_0x4200('0x17'))][(_0x4200('0x18'))](_0x4200('0x19'));}}else{return _0x123c25;}}function respondWithRpcPromise(_0x4fb68f,_0x388335,_0x3d877c,_0x5c9bc5){return new BPromise(function(_0x160747,_0xf69d4d){var _0x1515ab=_0x5c9bc5||client;return _0x1515ab['request'](_0x4fb68f,_0x3d877c)['then'](function(_0x2b9ae4){logger[_0x4200('0x1a')]('Network,\x20%s,\x20%s',_0x388335,'request\x20sent');logger[_0x4200('0x1b')]('Network,\x20%s,\x20%s,\x20%s',_0x388335,_0x4200('0x1c'),JSON[_0x4200('0x1d')](_0x2b9ae4));if(_0x2b9ae4[_0x4200('0x1e')]){if(_0x2b9ae4['error'][_0x4200('0x1f')]===0x1f4){logger[_0x4200('0x1e')](_0x4200('0x20'),_0x388335,_0x2b9ae4[_0x4200('0x1e')]['message']);return _0xf69d4d(_0x2b9ae4[_0x4200('0x1e')][_0x4200('0x21')]);}logger[_0x4200('0x1e')](_0x4200('0x20'),_0x388335,_0x2b9ae4['error'][_0x4200('0x21')]);return _0x160747(_0x2b9ae4[_0x4200('0x1e')][_0x4200('0x21')]);}else{logger['info'](_0x4200('0x20'),_0x388335,_0x4200('0x1c'));_0x160747(_0x2b9ae4[_0x4200('0x22')][_0x4200('0x21')]);}})['catch'](function(_0x5ef023){logger[_0x4200('0x1e')](_0x4200('0x20'),_0x388335,_0x5ef023);_0xf69d4d(_0x5ef023);});});}function respondWithStatusCode(_0x23596c,_0x584fa8){_0x584fa8=_0x584fa8||0xcc;return function(_0x45c961){if(_0x45c961){return _0x23596c[_0x4200('0x23')](_0x584fa8);}return _0x23596c[_0x4200('0x24')](_0x584fa8)[_0x4200('0x25')]();};}function respondWithResult(_0xd97cad,_0xdcf1ae){_0xdcf1ae=_0xdcf1ae||0xc8;return function(_0x402b7f){if(_0x402b7f){return _0xd97cad[_0x4200('0x24')](_0xdcf1ae)['json'](_0x402b7f);}};}function respondWithFilteredResult(_0x34ad30,_0x3c1f62){return function(_0x324898){if(_0x324898){var _0x49381a=_0x324898['count'],_0x2916e8=_0x3c1f62['offset'],_0x4e2bb8=_0x3c1f62[_0x4200('0x26')]+_0x3c1f62[_0x4200('0x27')],_0x1f2992;if(_0x4e2bb8>=_0x49381a){_0x4e2bb8=_0x49381a;_0x1f2992=0xc8;}else{_0x1f2992=0xce;}_0x34ad30['status'](_0x1f2992);return _0x34ad30[_0x4200('0x28')](_0x4200('0x29'),_0x2916e8+'-'+_0x4e2bb8+'/'+_0x49381a)[_0x4200('0x2a')](_0x324898);}return null;};}function patchUpdates(_0x30cd43){return function(_0x4efa5a){try{jsonpatch['apply'](_0x4efa5a,_0x30cd43,!![]);}catch(_0x3ddc78){return BPromise[_0x4200('0x2b')](_0x3ddc78);}return _0x4efa5a[_0x4200('0x2c')]();};}function saveUpdates(_0x5b4b50,_0xbb499a){return function(_0x57085a){if(_0x57085a){return _0x57085a['update'](_0x5b4b50)[_0x4200('0x2d')](function(_0x144700){return _0x144700;});}return null;};}function removeEntity(_0xc34f8e,_0x1b6a72){return function(_0x265104){if(_0x265104){return _0x265104['destroy']()[_0x4200('0x2d')](function(){_0xc34f8e[_0x4200('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x227dbf,_0x3858b5){return function(_0x23ac43){if(!_0x23ac43){_0x227dbf[_0x4200('0x23')](0x194);}return _0x23ac43;};}function handleError(_0x543c33,_0x353569){_0x353569=_0x353569||0x1f4;return function(_0x416050){logger['error'](_0x416050[_0x4200('0x2e')]);if(_0x416050[_0x4200('0x2f')]){delete _0x416050['name'];}_0x543c33[_0x4200('0x24')](_0x353569)[_0x4200('0x30')](_0x416050);};}exports['index']=function(_0x44ad90,_0x25c05f){var _0x5713c6={},_0x53c1c6={},_0x585c49={'count':0x0,'rows':[]};var _0x3a99bc=_[_0x4200('0x31')](db[_0x4200('0x32')]['rawAttributes'],function(_0x41a646){return{'name':_0x41a646[_0x4200('0x33')],'type':_0x41a646['type']['key']};});_0x53c1c6['model']=_[_0x4200('0x31')](_0x3a99bc,'name');_0x53c1c6[_0x4200('0x34')]=_[_0x4200('0x35')](_0x44ad90['query']);_0x53c1c6[_0x4200('0x36')]=_[_0x4200('0x37')](_0x53c1c6[_0x4200('0x38')],_0x53c1c6[_0x4200('0x34')]);_0x5713c6[_0x4200('0x39')]=_['intersection'](_0x53c1c6[_0x4200('0x38')],qs[_0x4200('0x3a')](_0x44ad90[_0x4200('0x34')][_0x4200('0x3a')]));_0x5713c6[_0x4200('0x39')]=_0x5713c6['attributes']['length']?_0x5713c6[_0x4200('0x39')]:_0x53c1c6['model'];if(!_0x44ad90['query']['hasOwnProperty'](_0x4200('0x3b'))){_0x5713c6[_0x4200('0x27')]=qs[_0x4200('0x27')](_0x44ad90[_0x4200('0x34')][_0x4200('0x27')]);_0x5713c6[_0x4200('0x26')]=qs['offset'](_0x44ad90[_0x4200('0x34')][_0x4200('0x26')]);}_0x5713c6[_0x4200('0x3c')]=qs['sort'](_0x44ad90[_0x4200('0x34')][_0x4200('0x3d')]);_0x5713c6[_0x4200('0x3e')]=qs[_0x4200('0x36')](_[_0x4200('0x3f')](_0x44ad90['query'],_0x53c1c6['filters']),_0x3a99bc);if(_0x44ad90[_0x4200('0x34')][_0x4200('0x40')]){_0x5713c6[_0x4200('0x3e')]=_['merge'](_0x5713c6[_0x4200('0x3e')],{'$or':_['map'](_0x3a99bc,function(_0xfe9cf2){if(_0xfe9cf2['type']!=='VIRTUAL'){var _0x2d0902={};_0x2d0902[_0xfe9cf2[_0x4200('0x2f')]]={'$like':'%'+_0x44ad90[_0x4200('0x34')][_0x4200('0x40')]+'%'};return _0x2d0902;}})});}_0x5713c6=_[_0x4200('0x41')]({},_0x5713c6,_0x44ad90['options']);var _0x564ed4={'where':_0x5713c6[_0x4200('0x3e')]};return db[_0x4200('0x32')]['count'](_0x564ed4)['then'](function(_0x13ccb2){_0x585c49['count']=_0x13ccb2;if(_0x44ad90[_0x4200('0x34')][_0x4200('0x42')]){_0x5713c6[_0x4200('0x43')]=[{'all':!![]}];}return db[_0x4200('0x32')][_0x4200('0x44')](_0x5713c6);})[_0x4200('0x2d')](function(_0x457241){_0x585c49[_0x4200('0x45')]=_0x457241;return _0x585c49;})[_0x4200('0x2d')](respondWithFilteredResult(_0x25c05f,_0x5713c6))[_0x4200('0x46')](handleError(_0x25c05f,null));};exports[_0x4200('0x47')]=function(_0x4b6e7e,_0x5320f9){var _0xc36e2={'raw':!![],'where':{'id':_0x4b6e7e[_0x4200('0x48')]['id']}},_0x1f3855={};_0x1f3855['model']=_[_0x4200('0x35')](db[_0x4200('0x32')]['rawAttributes']);_0x1f3855[_0x4200('0x34')]=_[_0x4200('0x35')](_0x4b6e7e[_0x4200('0x34')]);_0x1f3855[_0x4200('0x36')]=_['intersection'](_0x1f3855[_0x4200('0x38')],_0x1f3855[_0x4200('0x34')]);_0xc36e2[_0x4200('0x39')]=_[_0x4200('0x37')](_0x1f3855['model'],qs['fields'](_0x4b6e7e[_0x4200('0x34')][_0x4200('0x3a')]));_0xc36e2[_0x4200('0x39')]=_0xc36e2[_0x4200('0x39')][_0x4200('0x49')]?_0xc36e2[_0x4200('0x39')]:_0x1f3855[_0x4200('0x38')];if(_0x4b6e7e['query'][_0x4200('0x42')]){_0xc36e2[_0x4200('0x43')]=[{'all':!![]}];}_0xc36e2=_[_0x4200('0x41')]({},_0xc36e2,_0x4b6e7e[_0x4200('0x4a')]);return db[_0x4200('0x32')][_0x4200('0x4b')](_0xc36e2)[_0x4200('0x2d')](handleEntityNotFound(_0x5320f9,null))[_0x4200('0x2d')](respondWithResult(_0x5320f9,null))[_0x4200('0x46')](handleError(_0x5320f9,null));};exports[_0x4200('0x4c')]=function(_0xc26a07,_0x3f277d,_0x14dd72){var _0xdd1b70;return db[_0x4200('0x4d')]['transaction'](function(_0x585fa8){return db[_0x4200('0x32')][_0x4200('0x4c')](_0xc26a07[_0x4200('0x4e')],{'raw':!![]})[_0x4200('0x2d')](function(_0x5de984){_0xdd1b70=_0x5de984;return db[_0x4200('0x32')][_0x4200('0x44')]({'where':{'type':_0xc26a07[_0x4200('0x4e')][_0x4200('0x4f')]},'raw':!![]});})[_0x4200('0x2d')](function(_0x22b28c){if(_0xdd1b70['type'][_0x4200('0x50')]()==_0x4200('0x51')){var _0x59c465=fs['readFileSync'](path[_0x4200('0x52')](config[_0x4200('0x53')],_0x4200('0x54')),_0x4200('0x55'));var _0x3feb06=ejs['render'](_0x59c465,{'networks':_0x22b28c||[]});fs[_0x4200('0x56')](_0x4200('0x57'),_0x3feb06);return respondWithRpcPromise(_0x4200('0x58'),'create',{'module':_0x4200('0x59')});}else if(_0xdd1b70[_0x4200('0x4f')][_0x4200('0x50')]()==_0x4200('0x5a')){var _0x559cb3=fs['readFileSync'](path[_0x4200('0x52')](config[_0x4200('0x53')],_0x4200('0x5b')),_0x4200('0x55'));var _0x1d114f=ejs[_0x4200('0x5c')](_0x559cb3,{'networks':_0x22b28c||[]});fs[_0x4200('0x56')](_0x4200('0x5d'),_0x1d114f);return respondWithRpcPromise(_0x4200('0x58'),_0x4200('0x4c'),{'module':_0x4200('0x59')});}else{var _0xf3f0b2=fs[_0x4200('0x5e')](path[_0x4200('0x52')](config[_0x4200('0x53')],_0x4200('0x5f')),_0x4200('0x55'));var _0x2313c9=ejs[_0x4200('0x5c')](_0xf3f0b2,{'networks':_0x22b28c||[]});fs['writeFileSync'](util['format'](_0x4200('0x60'),_0xc26a07[_0x4200('0x4e')][_0x4200('0x4f')][_0x4200('0x61')]()),_0x2313c9);return respondWithRpcPromise(_0x4200('0x58'),'create',{'module':'chan_sip.so'});}return null;})[_0x4200('0x2d')](function(){return _0xdd1b70;});})['then'](respondWithResult(_0x3f277d,0xc9))[_0x4200('0x46')](handleError(_0x3f277d,null));};exports[_0x4200('0x62')]=function(_0x38849b,_0x1e83d2,_0x18a5b0){var _0x3180eb;return db[_0x4200('0x4d')][_0x4200('0x63')](function(_0x33920d){return db[_0x4200('0x32')]['find']({'where':{'id':_0x38849b[_0x4200('0x48')]['id']}})[_0x4200('0x2d')](handleEntityNotFound(_0x1e83d2,null))['then'](saveUpdates(_0x38849b[_0x4200('0x4e')],null))['then'](function(_0x4129d1){if(_0x4129d1){_0x3180eb=_0x4129d1;return db[_0x4200('0x32')]['findAll']({'where':{'type':_0x3180eb[_0x4200('0x4f')]},'raw':!![]});}return null;})[_0x4200('0x2d')](function(_0x263435){if(_0x3180eb[_0x4200('0x4f')][_0x4200('0x50')]()==_0x4200('0x51')){var _0x6f296d=fs[_0x4200('0x5e')](path['join'](config[_0x4200('0x53')],_0x4200('0x54')),_0x4200('0x55'));var _0x26fcdc=ejs[_0x4200('0x5c')](_0x6f296d,{'networks':_0x263435||[]});fs[_0x4200('0x56')]('/etc/asterisk/stun_xcally.conf',_0x26fcdc);return respondWithRpcPromise(_0x4200('0x58'),_0x4200('0x62'),{'module':'res_stun_monitor.so'});}else if(_0x3180eb['type']['toUpperCase']()==_0x4200('0x5a')){var _0x4cf249=fs['readFileSync'](path['join'](config[_0x4200('0x53')],'server/files/templates/turn_multiple.ejs'),_0x4200('0x55'));var _0x38a9f1=ejs['render'](_0x4cf249,{'networks':_0x263435||[]});fs['writeFileSync'](_0x4200('0x5d'),_0x38a9f1);return respondWithRpcPromise('Reload',_0x4200('0x62'),{'module':'res_stun_monitor.so'});}else{var _0x55fa61=fs[_0x4200('0x5e')](path[_0x4200('0x52')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x1eb35e=ejs[_0x4200('0x5c')](_0x55fa61,{'networks':_0x263435||[]});fs['writeFileSync'](util[_0x4200('0x64')](_0x4200('0x60'),_0x38849b[_0x4200('0x4e')][_0x4200('0x4f')][_0x4200('0x61')]()),_0x1eb35e);return respondWithRpcPromise(_0x4200('0x58'),_0x4200('0x62'),{'module':'chan_sip.so'});}return null;})[_0x4200('0x2d')](function(_0xb0299f){if(_0xb0299f){return _0x3180eb;}return null;});})[_0x4200('0x2d')](respondWithResult(_0x1e83d2,null))[_0x4200('0x46')](handleError(_0x1e83d2,null));};exports[_0x4200('0x65')]=function(_0x49276a,_0x49163b,_0x23968b){var _0x4e9aed;return db[_0x4200('0x32')]['find']({'where':{'id':_0x49276a['params']['id']}})[_0x4200('0x2d')](function(_0x18464c){_0x4e9aed=_0x18464c;return _0x18464c;})[_0x4200('0x2d')](handleEntityNotFound(_0x49163b,null))['then'](removeEntity(_0x49163b,null))[_0x4200('0x2d')](function(){if(_0x4e9aed){return db[_0x4200('0x32')][_0x4200('0x44')]({'where':{'type':_0x4e9aed['type']},'raw':!![]});}})[_0x4200('0x2d')](function(_0xa684d5){if(_0x4e9aed['type'][_0x4200('0x50')]()==_0x4200('0x51')){var _0x127e0e=fs['readFileSync'](path[_0x4200('0x52')](config[_0x4200('0x53')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x37257c=ejs['render'](_0x127e0e,{'networks':_0xa684d5||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x37257c);return respondWithRpcPromise(_0x4200('0x58'),_0x4200('0x65'),{'module':_0x4200('0x59')});}else if(_0x4e9aed[_0x4200('0x4f')][_0x4200('0x50')]()==_0x4200('0x5a')){var _0x1d3858=fs[_0x4200('0x5e')](path[_0x4200('0x52')](config[_0x4200('0x53')],_0x4200('0x5b')),'utf8');var _0x4215c8=ejs[_0x4200('0x5c')](_0x1d3858,{'networks':_0xa684d5||[]});fs[_0x4200('0x56')](_0x4200('0x5d'),_0x4215c8);return respondWithRpcPromise('Reload',_0x4200('0x65'),{'module':_0x4200('0x59')});}else{var _0x721abe=fs[_0x4200('0x5e')](path[_0x4200('0x52')](config[_0x4200('0x53')],_0x4200('0x5f')),_0x4200('0x55'));var _0x2643d3=ejs[_0x4200('0x5c')](_0x721abe,{'networks':_0xa684d5||[]});fs[_0x4200('0x56')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x49276a[_0x4200('0x4e')]['type'][_0x4200('0x61')]()),_0x2643d3);return respondWithRpcPromise('Reload',_0x4200('0x65'),{'module':_0x4200('0x66')});}return null;})[_0x4200('0x46')](handleError(_0x49163b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index bf05385..127d76f 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 _0x39cb=['network','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','define','Network'];(function(_0x297999,_0x48a4bc){var _0x2abdfa=function(_0x2184cf){while(--_0x2184cf){_0x297999['push'](_0x297999['shift']());}};_0x2abdfa(++_0x48a4bc);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var moment=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb39c('0x4'));var rimraf=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var attributes=require(_0xb39c('0x7'));module[_0xb39c('0x8')]=function(_0x4ae4cf,_0x32cdcd){return _0x4ae4cf[_0xb39c('0x9')](_0xb39c('0xa'),attributes,{'tableName':_0xb39c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util'];(function(_0x47d6d2,_0x3a5997){var _0x5dd88a=function(_0x47c979){while(--_0x47c979){_0x47d6d2['push'](_0x47d6d2['shift']());}};_0x5dd88a(++_0x3a5997);}(_0xa8a8,0xec));var _0x8a8a=function(_0x344499,_0x5ecb12){_0x344499=_0x344499-0x0;var _0x2deeef=_0xa8a8[_0x344499];return _0x2deeef;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'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 365cae9..357ba7f 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 _0xb4a3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','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'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0xb4a3,0x72));var _0x3b4a=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xb4a3[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x3b4a('0x0'));var util=require('util');var moment=require(_0x3b4a('0x1'));var BPromise=require(_0x3b4a('0x2'));var rs=require(_0x3b4a('0x3'));var fs=require('fs');var Redis=require(_0x3b4a('0x4'));var db=require(_0x3b4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b4a('0x6'))(_0x3b4a('0x7'));var config=require('../../config/environment');var jayson=require(_0x3b4a('0x8'));var client=jayson[_0x3b4a('0x9')][_0x3b4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8b6cfc,_0x2ed021,_0x4b427f){return new BPromise(function(_0x11bd6e,_0x48eb2a){return client[_0x3b4a('0xb')](_0x8b6cfc,_0x4b427f)['then'](function(_0x4bb56d){logger['info'](_0x3b4a('0xc'),_0x2ed021,_0x3b4a('0xd'));logger[_0x3b4a('0xe')](_0x3b4a('0xf'),_0x2ed021,_0x3b4a('0xd'),JSON[_0x3b4a('0x10')](_0x4bb56d));if(_0x4bb56d['error']){if(_0x4bb56d[_0x3b4a('0x11')][_0x3b4a('0x12')]===0x1f4){logger[_0x3b4a('0x11')]('Network,\x20%s,\x20%s',_0x2ed021,_0x4bb56d[_0x3b4a('0x11')]['message']);return _0x48eb2a(_0x4bb56d[_0x3b4a('0x11')]['message']);}logger[_0x3b4a('0x11')](_0x3b4a('0xc'),_0x2ed021,_0x4bb56d['error'][_0x3b4a('0x13')]);return _0x11bd6e(_0x4bb56d[_0x3b4a('0x11')][_0x3b4a('0x13')]);}else{logger[_0x3b4a('0x14')](_0x3b4a('0xc'),_0x2ed021,_0x3b4a('0xd'));_0x11bd6e(_0x4bb56d[_0x3b4a('0x15')][_0x3b4a('0x13')]);}})[_0x3b4a('0x16')](function(_0x4daac6){logger[_0x3b4a('0x11')](_0x3b4a('0xc'),_0x2ed021,_0x4daac6);_0x48eb2a(_0x4daac6);});});} \ No newline at end of file +var _0x335e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x335e,0xb3));var _0xe335=function(_0x34e25c,_0x142eb9){_0x34e25c=_0x34e25c-0x0;var _0xeceeba=_0x335e[_0x34e25c];return _0xeceeba;};'use strict';var _=require(_0xe335('0x0'));var util=require(_0xe335('0x1'));var moment=require(_0xe335('0x2'));var BPromise=require(_0xe335('0x3'));var rs=require(_0xe335('0x4'));var fs=require('fs');var Redis=require(_0xe335('0x5'));var db=require(_0xe335('0x6'))['db'];var utils=require(_0xe335('0x7'));var logger=require(_0xe335('0x8'))(_0xe335('0x9'));var config=require('../../config/environment');var jayson=require(_0xe335('0xa'));var client=jayson[_0xe335('0xb')][_0xe335('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cece6,_0x56ace3,_0x29f436){return new BPromise(function(_0x587a9c,_0x5ecf50){return client[_0xe335('0xd')](_0x2cece6,_0x29f436)[_0xe335('0xe')](function(_0x43fb93){logger[_0xe335('0xf')](_0xe335('0x10'),_0x56ace3,_0xe335('0x11'));logger[_0xe335('0x12')](_0xe335('0x13'),_0x56ace3,_0xe335('0x11'),JSON[_0xe335('0x14')](_0x43fb93));if(_0x43fb93[_0xe335('0x15')]){if(_0x43fb93[_0xe335('0x15')]['code']===0x1f4){logger[_0xe335('0x15')](_0xe335('0x10'),_0x56ace3,_0x43fb93['error']['message']);return _0x5ecf50(_0x43fb93['error'][_0xe335('0x16')]);}logger[_0xe335('0x15')](_0xe335('0x10'),_0x56ace3,_0x43fb93[_0xe335('0x15')][_0xe335('0x16')]);return _0x587a9c(_0x43fb93[_0xe335('0x15')][_0xe335('0x16')]);}else{logger[_0xe335('0xf')](_0xe335('0x10'),_0x56ace3,_0xe335('0x11'));_0x587a9c(_0x43fb93['result']['message']);}})['catch'](function(_0x448653){logger[_0xe335('0x15')](_0xe335('0x10'),_0x56ace3,_0x448653);_0x5ecf50(_0x448653);});});} \ No newline at end of file diff --git a/server/api/notification/index.js b/server/api/notification/index.js index d45dd35..5c22d0d 100644 --- a/server/api/notification/index.js +++ b/server/api/notification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeafe=['../../components/auth/service','../../components/interaction/service','../../config/environment','./notification.controller','isAuthenticated','sendNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1a9362,_0x435d63){var _0x4e0573=function(_0x580ef3){while(--_0x580ef3){_0x1a9362['push'](_0x1a9362['shift']());}};_0x4e0573(++_0x435d63);}(_0xeafe,0x180));var _0xeeaf=function(_0xa7a62f,_0x355c91){_0xa7a62f=_0xa7a62f-0x0;var _0x3d1641=_0xeafe[_0xa7a62f];return _0x3d1641;};'use strict';var multer=require(_0xeeaf('0x0'));var util=require(_0xeeaf('0x1'));var path=require(_0xeeaf('0x2'));var timeout=require(_0xeeaf('0x3'));var express=require(_0xeeaf('0x4'));var router=express[_0xeeaf('0x5')]();var auth=require(_0xeeaf('0x6'));var interaction=require(_0xeeaf('0x7'));var config=require(_0xeeaf('0x8'));var controller=require(_0xeeaf('0x9'));router['post']('/',auth[_0xeeaf('0xa')](),controller[_0xeeaf('0xb')]);module[_0xeeaf('0xc')]=router; \ No newline at end of file +var _0xbf75=['connect-timeout','Router','../../config/environment','post','sendNotification','exports','multer','util'];(function(_0x5ede1a,_0x51e4d0){var _0x9b0761=function(_0x3cf50b){while(--_0x3cf50b){_0x5ede1a['push'](_0x5ede1a['shift']());}};_0x9b0761(++_0x51e4d0);}(_0xbf75,0x166));var _0x5bf7=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbf75[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x5bf7('0x0'));var util=require(_0x5bf7('0x1'));var path=require('path');var timeout=require(_0x5bf7('0x2'));var express=require('express');var router=express[_0x5bf7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bf7('0x4'));var controller=require('./notification.controller');router[_0x5bf7('0x5')]('/',auth['isAuthenticated'](),controller[_0x5bf7('0x6')]);module[_0x5bf7('0x7')]=router; \ No newline at end of file diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js index cf43542..71ac665 100644 --- a/server/api/notification/notification.attributes.js +++ b/server/api/notification/notification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cf7=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x44d902,_0x376b4e){var _0x27aa72=function(_0x5059fd){while(--_0x5059fd){_0x44d902['push'](_0x44d902['shift']());}};_0x27aa72(++_0x376b4e);}(_0x7cf7,0x1af));var _0x77cf=function(_0x58328e,_0x7ab78d){_0x58328e=_0x58328e-0x0;var _0x2484f2=_0x7cf7[_0x58328e];return _0x2484f2;};'use strict';var Sequelize=require(_0x77cf('0x0'));module[_0x77cf('0x1')]={'body':{'type':Sequelize[_0x77cf('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x77cf('0x2')]},'recipientsDescription':{'type':Sequelize[_0x77cf('0x3')]},'beep':{'type':Sequelize[_0x77cf('0x4')]}}; \ No newline at end of file +var _0xb733=['TEXT','STRING','sequelize','exports'];(function(_0x184cc6,_0x4961ee){var _0x3f7435=function(_0x448fed){while(--_0x448fed){_0x184cc6['push'](_0x184cc6['shift']());}};_0x3f7435(++_0x4961ee);}(_0xb733,0xe6));var _0x3b73=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb733[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x3b73('0x0'));module[_0x3b73('0x1')]={'body':{'type':Sequelize[_0x3b73('0x2')]},'senderName':{'type':Sequelize[_0x3b73('0x3')]},'recipientsId':{'type':Sequelize[_0x3b73('0x2')]},'recipientsDescription':{'type':Sequelize[_0x3b73('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js index 47d45f7..ecd6f7c 100644 --- a/server/api/notification/notification.controller.js +++ b/server/api/notification/notification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bbc=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./notification.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','sendNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','Notification','create','emit','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','forEach','startCase','User','union','ids','queue','replace','push','all','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x5b2a35,_0x4814b6){var _0x5ce1e0=function(_0x1464d9){while(--_0x1464d9){_0x5b2a35['push'](_0x5b2a35['shift']());}};_0x5ce1e0(++_0x4814b6);}(_0x0bbc,0xaf));var _0xc0bb=function(_0x41063b,_0x530d6b){_0x41063b=_0x41063b-0x0;var _0xc692dc=_0x0bbc[_0x41063b];return _0xc692dc;};'use strict';var pdf=require(_0xc0bb('0x0'));var emlformat=require(_0xc0bb('0x1'));var rimraf=require(_0xc0bb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0bb('0x3'));var rp=require(_0xc0bb('0x4'));var moment=require(_0xc0bb('0x5'));var BPromise=require(_0xc0bb('0x6'));var Mustache=require(_0xc0bb('0x7'));var util=require('util');var path=require(_0xc0bb('0x8'));var sox=require(_0xc0bb('0x9'));var csv=require(_0xc0bb('0xa'));var ejs=require(_0xc0bb('0xb'));var fs=require('fs');var _=require(_0xc0bb('0xc'));var squel=require('squel');var crypto=require(_0xc0bb('0xd'));var jsforce=require(_0xc0bb('0xe'));var deskjs=require(_0xc0bb('0xf'));var toCsv=require(_0xc0bb('0xa'));var querystring=require(_0xc0bb('0x10'));var Papa=require(_0xc0bb('0x11'));var Redis=require('ioredis');var authService=require(_0xc0bb('0x12'));var qs=require(_0xc0bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0bb('0x14'));var logger=require(_0xc0bb('0x15'))(_0xc0bb('0x16'));var utils=require(_0xc0bb('0x17'));var config=require(_0xc0bb('0x18'));var db=require('../../mysqldb')['db'];config[_0xc0bb('0x19')]=_[_0xc0bb('0x1a')](config[_0xc0bb('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0bb('0x1b'))(new Redis(config[_0xc0bb('0x19')]));require(_0xc0bb('0x1c'))[_0xc0bb('0x1d')](socket);function respondWithStatusCode(_0x5ac473,_0x519f8d){_0x519f8d=_0x519f8d||0xcc;return function(_0x42f145){if(_0x42f145){return _0x5ac473[_0xc0bb('0x1e')](_0x519f8d);}return _0x5ac473[_0xc0bb('0x1f')](_0x519f8d)[_0xc0bb('0x20')]();};}function respondWithResult(_0x19879f,_0x4a190a){_0x4a190a=_0x4a190a||0xc8;return function(_0x2efe58){if(_0x2efe58){return _0x19879f[_0xc0bb('0x1f')](_0x4a190a)[_0xc0bb('0x21')](_0x2efe58);}};}function respondWithFilteredResult(_0x1b9cd5,_0x287313){return function(_0x613b26){if(_0x613b26){var _0x57172f=_0x613b26[_0xc0bb('0x22')],_0x3e9643=_0x287313[_0xc0bb('0x23')],_0xf89b18=_0x287313[_0xc0bb('0x23')]+_0x287313[_0xc0bb('0x24')],_0x2e55c1;if(_0xf89b18>=_0x57172f){_0xf89b18=_0x57172f;_0x2e55c1=0xc8;}else{_0x2e55c1=0xce;}_0x1b9cd5['status'](_0x2e55c1);return _0x1b9cd5[_0xc0bb('0x25')](_0xc0bb('0x26'),_0x3e9643+'-'+_0xf89b18+'/'+_0x57172f)[_0xc0bb('0x21')](_0x613b26);}return null;};}function patchUpdates(_0x459f55){return function(_0x644312){try{jsonpatch['apply'](_0x644312,_0x459f55,!![]);}catch(_0x17edcb){return BPromise['reject'](_0x17edcb);}return _0x644312[_0xc0bb('0x27')]();};}function saveUpdates(_0x425bbf,_0x11c293){return function(_0x33cc45){if(_0x33cc45){return _0x33cc45['update'](_0x425bbf)[_0xc0bb('0x28')](function(_0x36b478){return _0x36b478;});}return null;};}function removeEntity(_0x2ff248,_0xe3e298){return function(_0x3fe298){if(_0x3fe298){return _0x3fe298[_0xc0bb('0x29')]()[_0xc0bb('0x28')](function(){_0x2ff248['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de21f,_0x21797e){return function(_0x3eb82a){if(!_0x3eb82a){_0x3de21f[_0xc0bb('0x1e')](0x194);}return _0x3eb82a;};}function handleError(_0x4a875c,_0x2a8bae){_0x2a8bae=_0x2a8bae||0x1f4;return function(_0x3999a9){logger[_0xc0bb('0x2a')](_0x3999a9[_0xc0bb('0x2b')]);if(_0x3999a9[_0xc0bb('0x2c')]){delete _0x3999a9['name'];}_0x4a875c[_0xc0bb('0x1f')](_0x2a8bae)['send'](_0x3999a9);};}exports[_0xc0bb('0x2d')]=function(_0x5305a9,_0x269f25,_0x213719){if(!_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x2f')]('text')&&!_0x5305a9[_0xc0bb('0x2e')]['hasOwnProperty'](_0xc0bb('0x30'))){throw new db[(_0xc0bb('0x31'))][(_0xc0bb('0x32'))](_0xc0bb('0x33'));}else{if(_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x2f')](_0xc0bb('0x30'))&&!_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x2f')]('view')){throw new db[(_0xc0bb('0x31'))][(_0xc0bb('0x32'))](_0xc0bb('0x34'));}if(!_0x5305a9['body'][_0xc0bb('0x2f')](_0xc0bb('0x35'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4543eb=JSON[_0xc0bb('0x36')](_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x35')]);}catch(_0x395ff1){logger[_0xc0bb('0x2a')](_0x395ff1);throw new db[(_0xc0bb('0x31'))]['ValidationError'](_0xc0bb('0x37'));}var _0x176dc7=[_0xc0bb('0x38'),_0xc0bb('0x39'),'mailqueue',_0xc0bb('0x3a'),'smsqueue','voicequeue','whatsappqueue',_0xc0bb('0x3b'),_0xc0bb('0x3c')];if(_[_0xc0bb('0x3d')](_0x4543eb,function(_0x3b1e22){return!_[_0xc0bb('0x3e')](_0x176dc7,_0x3b1e22[_0xc0bb('0x3f')][_0xc0bb('0x40')]());})){throw new db[(_0xc0bb('0x31'))][(_0xc0bb('0x32'))](_0xc0bb('0x41'));}}}var _0x1f723b={};_0x1f723b['senderName']=_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x2f')](_0xc0bb('0x42'))?_0x5305a9['body'][_0xc0bb('0x42')]:_0x5305a9['user'][_0xc0bb('0x43')];_0x1f723b[_0xc0bb('0x44')]=_['isEmpty'](_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x44')])?null:_0x5305a9[_0xc0bb('0x2e')]['recipientsDescription'];_0x1f723b[_0xc0bb('0x45')]=_0x5305a9[_0xc0bb('0x2e')][_0xc0bb('0x45')]||![];_0x1f723b[_0xc0bb('0x46')]=_0x5305a9[_0xc0bb('0x3c')]['id'];return getContent(_0x5305a9[_0xc0bb('0x2e')])[_0xc0bb('0x28')](function(_0x5d4496){_0x1f723b['body']=_0x5d4496;return getRecipients(_0x4543eb);})[_0xc0bb('0x28')](function(_0x57b626){_0x1f723b[_0xc0bb('0x47')]=_[_0xc0bb('0x48')](_0x57b626)[_0xc0bb('0x49')](',');return db[_0xc0bb('0x4a')][_0xc0bb('0x4b')](function(_0x1aaba7){return db[_0xc0bb('0x4c')][_0xc0bb('0x4d')](_0x1f723b,{'raw':!![],'transaction':_0x1aaba7})[_0xc0bb('0x28')](function(_0x29f23d){var _0x15141b={'sender':_0x1f723b['senderName'],'description':_0x1f723b[_0xc0bb('0x44')],'content':_0x1f723b['body'],'beep':_0x1f723b[_0xc0bb('0x45')]};_0x57b626['forEach'](function(_0x451374){_0x15141b['recipient']=_0x451374;socket[_0xc0bb('0x4e')]('notification:send',_0x15141b);});return _0x29f23d;});});})[_0xc0bb('0x28')](respondWithResult(_0x269f25,0xc9))[_0xc0bb('0x4f')](handleError(_0x269f25,null));};function getContent(_0x5c1210){return new BPromise(function(_0x5ea7e1,_0x71e5f5){if(_0x5c1210[_0xc0bb('0x50')]){_0x5ea7e1(_0x5c1210[_0xc0bb('0x50')]);return;}return db[_0xc0bb('0x51')][_0xc0bb('0x52')]({'attributes':[_0xc0bb('0x53')],'where':{'id':_0x5c1210['TemplateId']},'raw':!![]})[_0xc0bb('0x28')](function(_0x3d1317){if(!_0x3d1317)throw new db[(_0xc0bb('0x31'))][(_0xc0bb('0x32'))](_0xc0bb('0x54'));var _0x39035a=Mustache[_0xc0bb('0x55')](_0x3d1317['html'],_0x5c1210[_0xc0bb('0x56')]);_0x5ea7e1(_0x39035a);})[_0xc0bb('0x4f')](function(_0x2a3e70){_0x71e5f5(_0x2a3e70);});});}function getRecipients(_0x510856){return new BPromise(function(_0xeb6d42,_0x508eb5){var _0x4c6e6c=[];var _0x5f2dbd=[];_0x510856[_0xc0bb('0x57')](function(_0xabca37){var _0x228314=_[_0xc0bb('0x58')](_0xabca37[_0xc0bb('0x3f')][_0xc0bb('0x40')]());if(_0x228314===_0xc0bb('0x59')){_0x4c6e6c=_[_0xc0bb('0x5a')](_0x4c6e6c,_0xabca37[_0xc0bb('0x5b')]);}else{if(_[_0xc0bb('0x3e')](_0x228314,_0xc0bb('0x5c')))_0x228314=_0x228314[_0xc0bb('0x5d')](_0xc0bb('0x5c'),'Queue');_0xabca37[_0xc0bb('0x5b')][_0xc0bb('0x57')](function(_0x324458){_0x5f2dbd[_0xc0bb('0x5e')](getAgents(_0x228314,_0x324458));});}});return BPromise[_0xc0bb('0x5f')](_0x5f2dbd)['then'](function(_0x5233f8){_0x4c6e6c=_[_0xc0bb('0x5a')](_0x4c6e6c,_['flatten'](_0x5233f8));_0xeb6d42(_0x4c6e6c);})[_0xc0bb('0x4f')](function(_0x3f8ca2){_0x508eb5(_0x3f8ca2);});});}function getAgents(_0x3283fc,_0x12ab61){return new BPromise(function(_0x4808ed,_0x55a6ce){return db[_0x3283fc][_0xc0bb('0x52')]({'where':{'id':_0x12ab61}})['then'](function(_0x59b68d){return _0x59b68d['getAgents']({'attributes':['id'],'raw':!![]})[_0xc0bb('0x28')](function(_0xe3d3c0){var _0x4ea444=_['map'](_0xe3d3c0,'id');_0x4808ed(_0x4ea444);});})['catch'](function(_0x2d2247){_0x55a6ce(_0x2d2247);});});} \ No newline at end of file +var _0xb4ff=['push','all','union','flatten','getAgents','map','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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','./notification.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','sendNotification','hasOwnProperty','text','body','TemplateId','ValidationError','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','Notification','create','forEach','recipient','notification:send','catch','Template','findOne','html','startCase','model','replace','Queue','ids'];(function(_0x521d9b,_0x4fa607){var _0x22eecc=function(_0x245e28){while(--_0x245e28){_0x521d9b['push'](_0x521d9b['shift']());}};_0x22eecc(++_0x4fa607);}(_0xb4ff,0x6c));var _0xfb4f=function(_0x22c1ae,_0xa0db40){_0x22c1ae=_0x22c1ae-0x0;var _0x2ccdac=_0xb4ff[_0x22c1ae];return _0x2ccdac;};'use strict';var pdf=require(_0xfb4f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfb4f('0x1'));var zipdir=require(_0xfb4f('0x2'));var jsonpatch=require(_0xfb4f('0x3'));var rp=require(_0xfb4f('0x4'));var moment=require(_0xfb4f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfb4f('0x6'));var util=require(_0xfb4f('0x7'));var path=require(_0xfb4f('0x8'));var sox=require('sox');var csv=require(_0xfb4f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfb4f('0xa'));var squel=require(_0xfb4f('0xb'));var crypto=require(_0xfb4f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfb4f('0xd'));var toCsv=require(_0xfb4f('0x9'));var querystring=require(_0xfb4f('0xe'));var Papa=require(_0xfb4f('0xf'));var Redis=require(_0xfb4f('0x10'));var authService=require(_0xfb4f('0x11'));var qs=require(_0xfb4f('0x12'));var as=require(_0xfb4f('0x13'));var hardwareService=require(_0xfb4f('0x14'));var logger=require(_0xfb4f('0x15'))(_0xfb4f('0x16'));var utils=require('../../config/utils');var config=require(_0xfb4f('0x17'));var db=require(_0xfb4f('0x18'))['db'];config[_0xfb4f('0x19')]=_[_0xfb4f('0x1a')](config[_0xfb4f('0x19')],{'host':_0xfb4f('0x1b'),'port':0x18eb});var socket=require(_0xfb4f('0x1c'))(new Redis(config[_0xfb4f('0x19')]));require(_0xfb4f('0x1d'))[_0xfb4f('0x1e')](socket);function respondWithStatusCode(_0x73ed96,_0x453466){_0x453466=_0x453466||0xcc;return function(_0x3af07f){if(_0x3af07f){return _0x73ed96['sendStatus'](_0x453466);}return _0x73ed96[_0xfb4f('0x1f')](_0x453466)[_0xfb4f('0x20')]();};}function respondWithResult(_0x17ecbf,_0x1d674e){_0x1d674e=_0x1d674e||0xc8;return function(_0x59c8d7){if(_0x59c8d7){return _0x17ecbf[_0xfb4f('0x1f')](_0x1d674e)[_0xfb4f('0x21')](_0x59c8d7);}};}function respondWithFilteredResult(_0x16ef28,_0x3fd0bf){return function(_0x4cbf62){if(_0x4cbf62){var _0x265388=_0x4cbf62[_0xfb4f('0x22')],_0x1a45ee=_0x3fd0bf[_0xfb4f('0x23')],_0x39ff56=_0x3fd0bf[_0xfb4f('0x23')]+_0x3fd0bf[_0xfb4f('0x24')],_0x177d29;if(_0x39ff56>=_0x265388){_0x39ff56=_0x265388;_0x177d29=0xc8;}else{_0x177d29=0xce;}_0x16ef28[_0xfb4f('0x1f')](_0x177d29);return _0x16ef28[_0xfb4f('0x25')](_0xfb4f('0x26'),_0x1a45ee+'-'+_0x39ff56+'/'+_0x265388)[_0xfb4f('0x21')](_0x4cbf62);}return null;};}function patchUpdates(_0x31624c){return function(_0x5f167d){try{jsonpatch[_0xfb4f('0x27')](_0x5f167d,_0x31624c,!![]);}catch(_0x5e4c04){return BPromise[_0xfb4f('0x28')](_0x5e4c04);}return _0x5f167d[_0xfb4f('0x29')]();};}function saveUpdates(_0x228fcc,_0x28e1fc){return function(_0x4a77d1){if(_0x4a77d1){return _0x4a77d1[_0xfb4f('0x2a')](_0x228fcc)['then'](function(_0x489be4){return _0x489be4;});}return null;};}function removeEntity(_0x45c64a,_0x4e0c98){return function(_0x345ab3){if(_0x345ab3){return _0x345ab3[_0xfb4f('0x2b')]()[_0xfb4f('0x2c')](function(){_0x45c64a[_0xfb4f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x81ef94,_0x11668c){return function(_0x2ccacf){if(!_0x2ccacf){_0x81ef94[_0xfb4f('0x2d')](0x194);}return _0x2ccacf;};}function handleError(_0x1e8745,_0x1c36b4){_0x1c36b4=_0x1c36b4||0x1f4;return function(_0x1b521d){logger[_0xfb4f('0x2e')](_0x1b521d[_0xfb4f('0x2f')]);if(_0x1b521d[_0xfb4f('0x30')]){delete _0x1b521d[_0xfb4f('0x30')];}_0x1e8745[_0xfb4f('0x1f')](_0x1c36b4)[_0xfb4f('0x31')](_0x1b521d);};}exports[_0xfb4f('0x32')]=function(_0x483f16,_0x116e9c,_0x524612){if(!_0x483f16['body'][_0xfb4f('0x33')](_0xfb4f('0x34'))&&!_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x33')](_0xfb4f('0x36'))){throw new db['Sequelize'][(_0xfb4f('0x37'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x33')](_0xfb4f('0x36'))&&!_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x33')](_0xfb4f('0x38'))){throw new db[(_0xfb4f('0x39'))][(_0xfb4f('0x37'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x483f16['body'][_0xfb4f('0x33')](_0xfb4f('0x3a'))){throw new db[(_0xfb4f('0x39'))][(_0xfb4f('0x37'))](_0xfb4f('0x3b'));}else{try{var _0x21ce14=JSON['parse'](_0x483f16['body'][_0xfb4f('0x3a')]);}catch(_0xd04907){logger[_0xfb4f('0x2e')](_0xd04907);throw new db[(_0xfb4f('0x39'))][(_0xfb4f('0x37'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x3aa88e=[_0xfb4f('0x3c'),_0xfb4f('0x3d'),_0xfb4f('0x3e'),_0xfb4f('0x3f'),'smsqueue',_0xfb4f('0x40'),'whatsappqueue',_0xfb4f('0x41'),_0xfb4f('0x42')];if(_[_0xfb4f('0x43')](_0x21ce14,function(_0x285c5f){return!_[_0xfb4f('0x44')](_0x3aa88e,_0x285c5f['model'][_0xfb4f('0x45')]());})){throw new db[(_0xfb4f('0x39'))][(_0xfb4f('0x37'))](_0xfb4f('0x46'));}}}var _0x5106f1={};_0x5106f1['senderName']=_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x33')](_0xfb4f('0x47'))?_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x47')]:_0x483f16[_0xfb4f('0x42')][_0xfb4f('0x48')];_0x5106f1[_0xfb4f('0x49')]=_[_0xfb4f('0x4a')](_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x49')])?null:_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x49')];_0x5106f1[_0xfb4f('0x4b')]=_0x483f16[_0xfb4f('0x35')][_0xfb4f('0x4b')]||![];_0x5106f1[_0xfb4f('0x4c')]=_0x483f16[_0xfb4f('0x42')]['id'];return getContent(_0x483f16[_0xfb4f('0x35')])[_0xfb4f('0x2c')](function(_0xe257d9){_0x5106f1[_0xfb4f('0x35')]=_0xe257d9;return getRecipients(_0x21ce14);})['then'](function(_0x5ec32a){_0x5106f1[_0xfb4f('0x4d')]=_[_0xfb4f('0x4e')](_0x5ec32a)[_0xfb4f('0x4f')](',');return db[_0xfb4f('0x50')][_0xfb4f('0x51')](function(_0x1ace02){return db[_0xfb4f('0x52')][_0xfb4f('0x53')](_0x5106f1,{'raw':!![],'transaction':_0x1ace02})[_0xfb4f('0x2c')](function(_0x371220){var _0x16691d={'sender':_0x5106f1[_0xfb4f('0x47')],'description':_0x5106f1['recipientsDescription'],'content':_0x5106f1[_0xfb4f('0x35')],'beep':_0x5106f1['beep']};_0x5ec32a[_0xfb4f('0x54')](function(_0x4491e1){_0x16691d[_0xfb4f('0x55')]=_0x4491e1;socket['emit'](_0xfb4f('0x56'),_0x16691d);});return _0x371220;});});})[_0xfb4f('0x2c')](respondWithResult(_0x116e9c,0xc9))[_0xfb4f('0x57')](handleError(_0x116e9c,null));};function getContent(_0x28db42){return new BPromise(function(_0x4b5309,_0x13a1e4){if(_0x28db42[_0xfb4f('0x34')]){_0x4b5309(_0x28db42['text']);return;}return db[_0xfb4f('0x58')][_0xfb4f('0x59')]({'attributes':[_0xfb4f('0x5a')],'where':{'id':_0x28db42[_0xfb4f('0x36')]},'raw':!![]})['then'](function(_0x85699a){if(!_0x85699a)throw new db[(_0xfb4f('0x39'))][(_0xfb4f('0x37'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x19e895=Mustache['render'](_0x85699a['html'],_0x28db42[_0xfb4f('0x38')]);_0x4b5309(_0x19e895);})[_0xfb4f('0x57')](function(_0x1688a3){_0x13a1e4(_0x1688a3);});});}function getRecipients(_0x2dd7a6){return new BPromise(function(_0x1dbfc9,_0x164b1d){var _0x420ab0=[];var _0x60bd3f=[];_0x2dd7a6[_0xfb4f('0x54')](function(_0x486b56){var _0x33a0ab=_[_0xfb4f('0x5b')](_0x486b56[_0xfb4f('0x5c')][_0xfb4f('0x45')]());if(_0x33a0ab==='User'){_0x420ab0=_['union'](_0x420ab0,_0x486b56['ids']);}else{if(_[_0xfb4f('0x44')](_0x33a0ab,'queue'))_0x33a0ab=_0x33a0ab[_0xfb4f('0x5d')]('queue',_0xfb4f('0x5e'));_0x486b56[_0xfb4f('0x5f')][_0xfb4f('0x54')](function(_0x4773f3){_0x60bd3f[_0xfb4f('0x60')](getAgents(_0x33a0ab,_0x4773f3));});}});return BPromise[_0xfb4f('0x61')](_0x60bd3f)[_0xfb4f('0x2c')](function(_0x1cd8f2){_0x420ab0=_[_0xfb4f('0x62')](_0x420ab0,_[_0xfb4f('0x63')](_0x1cd8f2));_0x1dbfc9(_0x420ab0);})[_0xfb4f('0x57')](function(_0x306c2f){_0x164b1d(_0x306c2f);});});}function getAgents(_0x434459,_0x1cf4e3){return new BPromise(function(_0x4944bf,_0x223975){return db[_0x434459][_0xfb4f('0x59')]({'where':{'id':_0x1cf4e3}})[_0xfb4f('0x2c')](function(_0xae7600){return _0xae7600[_0xfb4f('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0xba2d30){var _0x253589=_[_0xfb4f('0x65')](_0xba2d30,'id');_0x4944bf(_0x253589);});})[_0xfb4f('0x57')](function(_0x36559e){_0x223975(_0x36559e);});});} \ No newline at end of file diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js index 2392ce6..7b3c4bb 100644 --- a/server/api/notification/notification.events.js +++ b/server/api/notification/notification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['Notification','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x42621b,_0x129717){var _0x35abaa=function(_0x3ff9ca){while(--_0x3ff9ca){_0x42621b['push'](_0x42621b['shift']());}};_0x35abaa(++_0x129717);}(_0xdb28,0x106));var _0x8db2=function(_0x1b89df,_0x280f9d){_0x1b89df=_0x1b89df-0x0;var _0xe52db3=_0xdb28[_0x1b89df];return _0xe52db3;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Notification=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){NotificationEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);NotificationEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=NotificationEvents; \ No newline at end of file +var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x383ba8,_0x2c13c8){var _0x7b8cf6=function(_0x3cd829){while(--_0x3cd829){_0x383ba8['push'](_0x383ba8['shift']());}};_0x7b8cf6(++_0x2c13c8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require('events');var Notification=require(_0x65f6('0x0'))['db']['Notification'];var NotificationEvents=new EventEmitter();NotificationEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){NotificationEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);NotificationEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=NotificationEvents; \ No newline at end of file diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js index a0d20aa..b2d1ca6 100644 --- a/server/api/notification/notification.model.js +++ b/server/api/notification/notification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x087b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./notification.attributes','exports','define','Notification','notifications'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x087b,0x11a));var _0xb087=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x087b[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb087('0xc'),'collate':_0xb087('0xd')});}; \ No newline at end of file +var _0xe605=['exports','define','notifications','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./notification.attributes'];(function(_0xd50eea,_0xa69d90){var _0x34fbe8=function(_0x5b2ebb){while(--_0x5b2ebb){_0xd50eea['push'](_0xd50eea['shift']());}};_0x34fbe8(++_0xa69d90);}(_0xe605,0x92));var _0x5e60=function(_0x2a55e4,_0x340e31){_0x2a55e4=_0x2a55e4-0x0;var _0x4f3539=_0xe605[_0x2a55e4];return _0x4f3539;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var fs=require('fs');var path=require(_0x5e60('0x6'));var rimraf=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var attributes=require(_0x5e60('0x9'));module[_0x5e60('0xa')]=function(_0xc41535,_0x1d4a08){return _0xc41535[_0x5e60('0xb')]('Notification',attributes,{'tableName':_0x5e60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js index b63bf63..c8df839 100644 --- a/server/api/notification/notification.rpc.js +++ b/server/api/notification/notification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb432=['../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./notification.socket','register','request','then','info','Notification,\x20%s,\x20%s','request\x20sent','Notification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x5a201f,_0x215377){var _0x51a936=function(_0x36d274){while(--_0x36d274){_0x5a201f['push'](_0x5a201f['shift']());}};_0x51a936(++_0x215377);}(_0xb432,0x1d7));var _0x2b43=function(_0x474418,_0x342efb){_0x474418=_0x474418-0x0;var _0x5307a7=_0xb432[_0x474418];return _0x5307a7;};'use strict';var _=require('lodash');var util=require(_0x2b43('0x0'));var moment=require('moment');var BPromise=require(_0x2b43('0x1'));var rs=require(_0x2b43('0x2'));var fs=require('fs');var Redis=require(_0x2b43('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b43('0x4'));var logger=require('../../config/logger')(_0x2b43('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b43('0x6'));var client=jayson[_0x2b43('0x7')][_0x2b43('0x8')]({'port':0x232a});config[_0x2b43('0x9')]=_['defaults'](config['redis'],{'host':_0x2b43('0xa'),'port':0x18eb});var socket=require(_0x2b43('0xb'))(new Redis(config[_0x2b43('0x9')]));require(_0x2b43('0xc'))[_0x2b43('0xd')](socket);function respondWithRpcPromise(_0x13322c,_0x341c1c,_0x40d5c6){return new BPromise(function(_0x2b4673,_0x301434){return client[_0x2b43('0xe')](_0x13322c,_0x40d5c6)[_0x2b43('0xf')](function(_0x5514ee){logger[_0x2b43('0x10')](_0x2b43('0x11'),_0x341c1c,_0x2b43('0x12'));logger['debug'](_0x2b43('0x13'),_0x341c1c,'request\x20sent',JSON[_0x2b43('0x14')](_0x5514ee));if(_0x5514ee[_0x2b43('0x15')]){if(_0x5514ee[_0x2b43('0x15')][_0x2b43('0x16')]===0x1f4){logger[_0x2b43('0x15')](_0x2b43('0x11'),_0x341c1c,_0x5514ee[_0x2b43('0x15')][_0x2b43('0x17')]);return _0x301434(_0x5514ee[_0x2b43('0x15')][_0x2b43('0x17')]);}logger['error'](_0x2b43('0x11'),_0x341c1c,_0x5514ee['error'][_0x2b43('0x17')]);return _0x2b4673(_0x5514ee[_0x2b43('0x15')]['message']);}else{logger[_0x2b43('0x10')]('Notification,\x20%s,\x20%s',_0x341c1c,_0x2b43('0x12'));_0x2b4673(_0x5514ee[_0x2b43('0x18')][_0x2b43('0x17')]);}})['catch'](function(_0x1a45b0){logger[_0x2b43('0x15')]('Notification,\x20%s,\x20%s',_0x341c1c,_0x1a45b0);_0x301434(_0x1a45b0);});});} \ No newline at end of file +var _0x12a4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./notification.socket','register','request','then','info','Notification,\x20%s,\x20%s','request\x20sent','Notification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x17558f,_0x42f9f5){var _0x4a81a5=function(_0x14ec0a){while(--_0x14ec0a){_0x17558f['push'](_0x17558f['shift']());}};_0x4a81a5(++_0x42f9f5);}(_0x12a4,0xef));var _0x412a=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x12a4[_0x2fe689];return _0x35ea44;};'use strict';var _=require(_0x412a('0x0'));var util=require(_0x412a('0x1'));var moment=require(_0x412a('0x2'));var BPromise=require(_0x412a('0x3'));var rs=require(_0x412a('0x4'));var fs=require('fs');var Redis=require(_0x412a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x412a('0x6'));var logger=require(_0x412a('0x7'))(_0x412a('0x8'));var config=require(_0x412a('0x9'));var jayson=require(_0x412a('0xa'));var client=jayson[_0x412a('0xb')][_0x412a('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x412a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x412a('0xe')]));require(_0x412a('0xf'))[_0x412a('0x10')](socket);function respondWithRpcPromise(_0x36bf7d,_0x3038ac,_0x16f716){return new BPromise(function(_0xf1bc45,_0x930f15){return client[_0x412a('0x11')](_0x36bf7d,_0x16f716)[_0x412a('0x12')](function(_0x4bfd68){logger[_0x412a('0x13')](_0x412a('0x14'),_0x3038ac,_0x412a('0x15'));logger['debug'](_0x412a('0x16'),_0x3038ac,_0x412a('0x15'),JSON[_0x412a('0x17')](_0x4bfd68));if(_0x4bfd68[_0x412a('0x18')]){if(_0x4bfd68[_0x412a('0x18')]['code']===0x1f4){logger[_0x412a('0x18')](_0x412a('0x14'),_0x3038ac,_0x4bfd68[_0x412a('0x18')][_0x412a('0x19')]);return _0x930f15(_0x4bfd68[_0x412a('0x18')][_0x412a('0x19')]);}logger[_0x412a('0x18')](_0x412a('0x14'),_0x3038ac,_0x4bfd68['error'][_0x412a('0x19')]);return _0xf1bc45(_0x4bfd68['error'][_0x412a('0x19')]);}else{logger[_0x412a('0x13')]('Notification,\x20%s,\x20%s',_0x3038ac,_0x412a('0x15'));_0xf1bc45(_0x4bfd68[_0x412a('0x1a')][_0x412a('0x19')]);}})['catch'](function(_0x2db984){logger['error']('Notification,\x20%s,\x20%s',_0x3038ac,_0x2db984);_0x930f15(_0x2db984);});});} \ No newline at end of file diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js index 975ce3b..66894fb 100644 --- a/server/api/notification/notification.socket.js +++ b/server/api/notification/notification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97c8=['remove','update','emit','removeListener','length','./notification.events','save'];(function(_0x1d895d,_0x3e5c93){var _0x2dae23=function(_0x443cd0){while(--_0x443cd0){_0x1d895d['push'](_0x1d895d['shift']());}};_0x2dae23(++_0x3e5c93);}(_0x97c8,0xd7));var _0x897c=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0x97c8[_0xb47dc0];return _0x57f0b0;};'use strict';var NotificationEvents=require(_0x897c('0x0'));var events=[_0x897c('0x1'),_0x897c('0x2'),_0x897c('0x3')];function createListener(_0x4b9bfd,_0x24d615){return function(_0x2a5eb5){_0x24d615[_0x897c('0x4')](_0x4b9bfd,_0x2a5eb5);};}function removeListener(_0x5db900,_0x21adfd){return function(){NotificationEvents[_0x897c('0x5')](_0x5db900,_0x21adfd);};}exports['register']=function(_0x45b5a5){for(var _0x4890a4=0x0,_0x14ced=events[_0x897c('0x6')];_0x4890a4<_0x14ced;_0x4890a4++){var _0xc3c2a=events[_0x4890a4];var _0x1fd705=createListener('notification:'+_0xc3c2a,_0x45b5a5);NotificationEvents['on'](_0xc3c2a,_0x1fd705);}}; \ No newline at end of file +var _0xc507=['remove','update','removeListener','register','length','./notification.events','save'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xc507,0xde));var _0x7c50=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0xc507[_0x445c98];return _0x2fe913;};'use strict';var NotificationEvents=require(_0x7c50('0x0'));var events=[_0x7c50('0x1'),_0x7c50('0x2'),_0x7c50('0x3')];function createListener(_0x1eae30,_0xa36d1f){return function(_0x28cb44){_0xa36d1f['emit'](_0x1eae30,_0x28cb44);};}function removeListener(_0x22635b,_0x125192){return function(){NotificationEvents[_0x7c50('0x4')](_0x22635b,_0x125192);};}exports[_0x7c50('0x5')]=function(_0x2bdcdb){for(var _0x1533f4=0x0,_0x400113=events[_0x7c50('0x6')];_0x1533f4<_0x400113;_0x1533f4++){var _0x40eda6=events[_0x1533f4];var _0x46e53f=createListener('notification:'+_0x40eda6,_0x2bdcdb);NotificationEvents['on'](_0x40eda6,_0x46e53f);}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index ce67dc4..7cce1bb 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 _0xfad5=['get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','/:id/users','post','create','/:id/canned_answers','notify','addApplications','addAgents','/:id/send','send','/:id','update','delete','removeDispositions','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0xd38ba1,_0x302247){var _0x1dd2a9=function(_0x41ad2e){while(--_0x41ad2e){_0xd38ba1['push'](_0xd38ba1['shift']());}};_0x1dd2a9(++_0x302247);}(_0xfad5,0x162));var _0x5fad=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xfad5[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x5fad('0x0'));var util=require('util');var path=require(_0x5fad('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5fad('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5fad('0x3'));var config=require(_0x5fad('0x4'));var controller=require(_0x5fad('0x5'));router[_0x5fad('0x6')]('/',auth[_0x5fad('0x7')](),controller['index']);router['get'](_0x5fad('0x8'),auth[_0x5fad('0x7')](),controller[_0x5fad('0x9')]);router[_0x5fad('0x6')]('/:id',auth[_0x5fad('0x7')](),controller[_0x5fad('0xa')]);router[_0x5fad('0x6')](_0x5fad('0xb'),auth[_0x5fad('0x7')](),controller[_0x5fad('0xc')]);router[_0x5fad('0x6')]('/:id/canned_answers',auth[_0x5fad('0x7')](),controller[_0x5fad('0xd')]);router['get'](_0x5fad('0xe'),auth[_0x5fad('0x7')](),controller['getApplications']);router[_0x5fad('0x6')](_0x5fad('0xf'),auth[_0x5fad('0x7')](),controller['getInteractions']);router['get'](_0x5fad('0x10'),auth[_0x5fad('0x7')](),controller['getAgents']);router[_0x5fad('0x11')]('/',auth[_0x5fad('0x7')](),controller[_0x5fad('0x12')]);router[_0x5fad('0x11')](_0x5fad('0xb'),auth[_0x5fad('0x7')](),controller['addDisposition']);router[_0x5fad('0x11')](_0x5fad('0x13'),auth[_0x5fad('0x7')](),controller['addAnswer']);router[_0x5fad('0x11')]('/:id/notify',controller[_0x5fad('0x14')]);router[_0x5fad('0x11')](_0x5fad('0xe'),auth[_0x5fad('0x7')](),controller[_0x5fad('0x15')]);router['post'](_0x5fad('0x10'),auth[_0x5fad('0x7')](),controller[_0x5fad('0x16')]);router[_0x5fad('0x11')](_0x5fad('0x17'),auth['isAuthenticated'](),controller[_0x5fad('0x18')]);router['put'](_0x5fad('0x19'),auth[_0x5fad('0x7')](),controller[_0x5fad('0x1a')]);router[_0x5fad('0x1b')](_0x5fad('0x19'),auth[_0x5fad('0x7')](),controller['destroy']);router['delete'](_0x5fad('0xb'),auth['isAuthenticated'](),controller[_0x5fad('0x1c')]);router[_0x5fad('0x1b')]('/:id/canned_answers',auth[_0x5fad('0x7')](),controller['removeAnswers']);router[_0x5fad('0x1b')](_0x5fad('0x10'),auth[_0x5fad('0x7')](),controller['removeAgents']);module[_0x5fad('0x1d')]=router; \ No newline at end of file +var _0xdb34=['addAnswer','/:id/notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeAnswers','/:id/users','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/applications','/:id/interactions','getInteractions','post','addDisposition','/:id/canned_answers'];(function(_0x18ebff,_0xc7b689){var _0x59a7e6=function(_0x4bce25){while(--_0x4bce25){_0x18ebff['push'](_0x18ebff['shift']());}};_0x59a7e6(++_0xc7b689);}(_0xdb34,0x98));var _0x4db3=function(_0x38faf6,_0x47aa41){_0x38faf6=_0x38faf6-0x0;var _0x4d2c88=_0xdb34[_0x38faf6];return _0x4d2c88;};'use strict';var multer=require(_0x4db3('0x0'));var util=require(_0x4db3('0x1'));var path=require('path');var timeout=require(_0x4db3('0x2'));var express=require(_0x4db3('0x3'));var router=express[_0x4db3('0x4')]();var auth=require(_0x4db3('0x5'));var interaction=require(_0x4db3('0x6'));var config=require(_0x4db3('0x7'));var controller=require(_0x4db3('0x8'));router[_0x4db3('0x9')]('/',auth[_0x4db3('0xa')](),controller[_0x4db3('0xb')]);router['get'](_0x4db3('0xc'),auth[_0x4db3('0xa')](),controller[_0x4db3('0xd')]);router[_0x4db3('0x9')](_0x4db3('0xe'),auth[_0x4db3('0xa')](),controller[_0x4db3('0xf')]);router[_0x4db3('0x9')](_0x4db3('0x10'),auth[_0x4db3('0xa')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x4db3('0xa')](),controller['getAnswers']);router[_0x4db3('0x9')](_0x4db3('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0x4db3('0x9')](_0x4db3('0x12'),auth[_0x4db3('0xa')](),controller[_0x4db3('0x13')]);router[_0x4db3('0x9')]('/:id/users',auth[_0x4db3('0xa')](),controller['getAgents']);router[_0x4db3('0x14')]('/',auth[_0x4db3('0xa')](),controller['create']);router[_0x4db3('0x14')](_0x4db3('0x10'),auth[_0x4db3('0xa')](),controller[_0x4db3('0x15')]);router['post'](_0x4db3('0x16'),auth[_0x4db3('0xa')](),controller[_0x4db3('0x17')]);router[_0x4db3('0x14')](_0x4db3('0x18'),controller['notify']);router['post'](_0x4db3('0x11'),auth[_0x4db3('0xa')](),controller[_0x4db3('0x19')]);router[_0x4db3('0x14')]('/:id/users',auth[_0x4db3('0xa')](),controller[_0x4db3('0x1a')]);router[_0x4db3('0x14')](_0x4db3('0x1b'),auth['isAuthenticated'](),controller['send']);router[_0x4db3('0x1c')](_0x4db3('0xe'),auth[_0x4db3('0xa')](),controller[_0x4db3('0x1d')]);router[_0x4db3('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x4db3('0x1f')]);router[_0x4db3('0x1e')](_0x4db3('0x10'),auth[_0x4db3('0xa')](),controller['removeDispositions']);router[_0x4db3('0x1e')](_0x4db3('0x16'),auth['isAuthenticated'](),controller[_0x4db3('0x20')]);router[_0x4db3('0x1e')](_0x4db3('0x21'),auth[_0x4db3('0xa')](),controller['removeAgents']);module[_0x4db3('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 6e44283..3fb77ef 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 _0x1763=['STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1763,0x151));var _0x3176=function(_0x4d1120,_0x57f789){_0x4d1120=_0x4d1120-0x0;var _0x350c20=_0x1763[_0x4d1120];return _0x350c20;};'use strict';var Sequelize=require(_0x3176('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x3176('0x1')],'unique':_0x3176('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3176('0x1')]},'token':{'type':Sequelize[_0x3176('0x1')],'defaultValue':function(){return rs[_0x3176('0x3')]();}},'replyUri':{'type':Sequelize[_0x3176('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3176('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3176('0x4')],'defaultValue':function(){return _0x3176('0x5');}},'notificationSound':{'type':Sequelize[_0x3176('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3176('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3176('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3176('0x1')]},'queueTransfer':{'type':Sequelize[_0x3176('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3176('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3176('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3176('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x3176('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3176('0x6')],'defaultValue':![],'comment':_0x3176('0x9'),'set':function(_0x189859){if(!_0x189859)this[_0x3176('0xa')](_0x3176('0xb'),null);this['setDataValue'](_0x3176('0xc'),_0x189859);}}}; \ No newline at end of file +var _0x26a3=['STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x1c6667,_0x568ae2){var _0x2e76d8=function(_0x41d950){while(--_0x41d950){_0x1c6667['push'](_0x1c6667['shift']());}};_0x2e76d8(++_0x568ae2);}(_0x26a3,0x1d1));var _0x326a=function(_0x1bdd7d,_0x49bc49){_0x1bdd7d=_0x1bdd7d-0x0;var _0x288b3e=_0x26a3[_0x1bdd7d];return _0x288b3e;};'use strict';var Sequelize=require(_0x326a('0x0'));var rs=require(_0x326a('0x1'));module[_0x326a('0x2')]={'name':{'type':Sequelize[_0x326a('0x3')],'unique':_0x326a('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x326a('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x326a('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x326a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x326a('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x326a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x326a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x326a('0x3')]},'queueTransfer':{'type':Sequelize[_0x326a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x326a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x326a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x326a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x326a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x326a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x326a('0x6')],'defaultValue':![],'comment':_0x326a('0x9'),'set':function(_0x230764){if(!_0x230764)this['setDataValue'](_0x326a('0xa'),null);this[_0x326a('0xb')](_0x326a('0xc'),_0x230764);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4f26472..ef42671 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 _0x52f6=['include','findAll','rows','show','params','Pause','mandatoryDispositionPause','keys','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','UserProfileResource','find','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','DESC','Applications','applications','list','priority','account','Contacts','defaults','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','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','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','OpenchannelAccount','includeAll'];(function(_0x557f1c,_0x477821){var _0x5edf28=function(_0x5f537e){while(--_0x5f537e){_0x557f1c['push'](_0x557f1c['shift']());}};_0x5edf28(++_0x477821);}(_0x52f6,0x67));var _0x652f=function(_0x2dfeab,_0x16502d){_0x2dfeab=_0x2dfeab-0x0;var _0xe23120=_0x52f6[_0x2dfeab];return _0xe23120;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x652f('0x0'));var rimraf=require(_0x652f('0x1'));var zipdir=require(_0x652f('0x2'));var jsonpatch=require(_0x652f('0x3'));var rp=require('request-promise');var moment=require(_0x652f('0x4'));var BPromise=require(_0x652f('0x5'));var Mustache=require('mustache');var util=require(_0x652f('0x6'));var path=require(_0x652f('0x7'));var sox=require(_0x652f('0x8'));var csv=require('to-csv');var ejs=require(_0x652f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x652f('0xa'));var crypto=require(_0x652f('0xb'));var jsforce=require(_0x652f('0xc'));var deskjs=require(_0x652f('0xd'));var toCsv=require(_0x652f('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x652f('0xf'));var authService=require(_0x652f('0x10'));var qs=require(_0x652f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x652f('0x12'));var logger=require(_0x652f('0x13'))(_0x652f('0x14'));var utils=require(_0x652f('0x15'));var config=require(_0x652f('0x16'));var db=require(_0x652f('0x17'))['db'];config[_0x652f('0x18')]=_['defaults'](config[_0x652f('0x18')],{'host':_0x652f('0x19'),'port':0x18eb});var socket=require(_0x652f('0x1a'))(new Redis(config[_0x652f('0x18')]));require(_0x652f('0x1b'))['register'](socket);var jayson=require(_0x652f('0x1c'));var client=jayson[_0x652f('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x652f('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4bc80c,_0xbb3903,_0x2ec3c9){if(_0x2ec3c9){var _0x1cbc31=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cbc31[_0x652f('0x1f')](_0xbb3903)){return _0x4bc80c;}else{throw new db[(_0x652f('0x20'))]['ValidationError'](_0x652f('0x21'));}}else{return _0x4bc80c;}}function respondWithRpcPromise(_0x3dca97,_0xeb411,_0x1b2c2f,_0x311a22){return new BPromise(function(_0xca2fbc,_0x1f04da){var _0x18da69=_0x311a22||client;return _0x18da69[_0x652f('0x22')](_0x3dca97,_0x1b2c2f)[_0x652f('0x23')](function(_0x40764e){logger['info'](_0x652f('0x24'),_0xeb411,_0x652f('0x25'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xeb411,_0x652f('0x25'),JSON[_0x652f('0x26')](_0x40764e));if(_0x40764e[_0x652f('0x27')]){if(_0x40764e[_0x652f('0x27')][_0x652f('0x28')]===0x1f4){logger[_0x652f('0x27')](_0x652f('0x24'),_0xeb411,_0x40764e[_0x652f('0x27')]['message']);return _0x1f04da(_0x40764e[_0x652f('0x27')][_0x652f('0x29')]);}logger[_0x652f('0x27')](_0x652f('0x24'),_0xeb411,_0x40764e['error'][_0x652f('0x29')]);return _0xca2fbc(_0x40764e[_0x652f('0x27')][_0x652f('0x29')]);}else{logger['info'](_0x652f('0x24'),_0xeb411,_0x652f('0x25'));_0xca2fbc(_0x40764e['result'][_0x652f('0x29')]);}})[_0x652f('0x2a')](function(_0x4c67fd){logger[_0x652f('0x27')](_0x652f('0x24'),_0xeb411,_0x4c67fd);_0x1f04da(_0x4c67fd);});});}function respondWithStatusCode(_0x1cbcfd,_0x43f96f){_0x43f96f=_0x43f96f||0xcc;return function(_0x22bd9c){if(_0x22bd9c){return _0x1cbcfd[_0x652f('0x2b')](_0x43f96f);}return _0x1cbcfd[_0x652f('0x2c')](_0x43f96f)['end']();};}function respondWithResult(_0x2e3940,_0x365cd4){_0x365cd4=_0x365cd4||0xc8;return function(_0x12364f){if(_0x12364f){return _0x2e3940[_0x652f('0x2c')](_0x365cd4)[_0x652f('0x2d')](_0x12364f);}};}function respondWithFilteredResult(_0x38a562,_0x3d5189){return function(_0xab1fe7){if(_0xab1fe7){var _0x28958e=_0xab1fe7[_0x652f('0x2e')],_0x55322e=_0x3d5189['offset'],_0x64b78=_0x3d5189[_0x652f('0x2f')]+_0x3d5189[_0x652f('0x30')],_0x76dcfb;if(_0x64b78>=_0x28958e){_0x64b78=_0x28958e;_0x76dcfb=0xc8;}else{_0x76dcfb=0xce;}_0x38a562[_0x652f('0x2c')](_0x76dcfb);return _0x38a562[_0x652f('0x31')](_0x652f('0x32'),_0x55322e+'-'+_0x64b78+'/'+_0x28958e)[_0x652f('0x2d')](_0xab1fe7);}return null;};}function patchUpdates(_0x4206da){return function(_0x4df3ce){try{jsonpatch[_0x652f('0x33')](_0x4df3ce,_0x4206da,!![]);}catch(_0x5c7d31){return BPromise[_0x652f('0x34')](_0x5c7d31);}return _0x4df3ce[_0x652f('0x35')]();};}function saveUpdates(_0xa807f4,_0x2f6a7e){return function(_0x2d84dc){if(_0x2d84dc){return _0x2d84dc[_0x652f('0x36')](_0xa807f4)[_0x652f('0x23')](function(_0x418edc){return _0x418edc;});}return null;};}function removeEntity(_0x302b15,_0x446b53){return function(_0x11fb60){if(_0x11fb60){return _0x11fb60['destroy']()[_0x652f('0x23')](function(){var _0x36ee17=_0x11fb60[_0x652f('0x37')]({'plain':!![]});var _0x42b789='OpenchannelAccounts';return db['UserProfileResource'][_0x652f('0x38')]({'where':{'type':_0x42b789,'resourceId':_0x36ee17['id']}})[_0x652f('0x23')](function(){return _0x11fb60;});})[_0x652f('0x23')](function(){_0x302b15[_0x652f('0x2c')](0xcc)[_0x652f('0x39')]();});}};}function handleEntityNotFound(_0x4903ad,_0x44909a){return function(_0x11275c){if(!_0x11275c){_0x4903ad['sendStatus'](0x194);}return _0x11275c;};}function handleError(_0x169f31,_0x31dba4){_0x31dba4=_0x31dba4||0x1f4;return function(_0x271d8b){logger[_0x652f('0x27')](_0x271d8b[_0x652f('0x3a')]);if(_0x271d8b[_0x652f('0x3b')]){delete _0x271d8b[_0x652f('0x3b')];}_0x169f31[_0x652f('0x2c')](_0x31dba4)[_0x652f('0x3c')](_0x271d8b);};}exports['index']=function(_0x3b64dd,_0x5afec5){var _0x51c83c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ff64f={},_0x3a976c={'count':0x0,'rows':[]};var _0x14c3f6=_[_0x652f('0x3d')](db['OpenchannelAccount'][_0x652f('0x3e')],function(_0x5a7e62){return{'name':_0x5a7e62['fieldName'],'type':_0x5a7e62[_0x652f('0x3f')][_0x652f('0x40')]};});_0x3ff64f[_0x652f('0x41')]=_[_0x652f('0x3d')](_0x14c3f6,_0x652f('0x3b'));_0x3ff64f[_0x652f('0x42')]=_['keys'](_0x3b64dd[_0x652f('0x42')]);_0x3ff64f['filters']=_['intersection'](_0x3ff64f['model'],_0x3ff64f['query']);_0x51c83c[_0x652f('0x43')]=_[_0x652f('0x44')](_0x3ff64f['model'],qs[_0x652f('0x45')](_0x3b64dd[_0x652f('0x42')][_0x652f('0x45')]));_0x51c83c[_0x652f('0x43')]=_0x51c83c[_0x652f('0x43')]['length']?_0x51c83c['attributes']:_0x3ff64f[_0x652f('0x41')];if(!_0x3b64dd[_0x652f('0x42')][_0x652f('0x46')](_0x652f('0x47'))){_0x51c83c[_0x652f('0x30')]=qs[_0x652f('0x30')](_0x3b64dd[_0x652f('0x42')][_0x652f('0x30')]);_0x51c83c[_0x652f('0x2f')]=qs[_0x652f('0x2f')](_0x3b64dd[_0x652f('0x42')][_0x652f('0x2f')]);}_0x51c83c[_0x652f('0x48')]=qs['sort'](_0x3b64dd[_0x652f('0x42')][_0x652f('0x49')]);_0x51c83c['where']=qs[_0x652f('0x4a')](_[_0x652f('0x4b')](_0x3b64dd[_0x652f('0x42')],_0x3ff64f['filters']),_0x14c3f6);if(_0x3b64dd[_0x652f('0x42')][_0x652f('0x4c')]){_0x51c83c[_0x652f('0x4d')]=_[_0x652f('0x4e')](_0x51c83c[_0x652f('0x4d')],{'$or':_[_0x652f('0x3d')](_0x14c3f6,function(_0x6793b){if(_0x6793b[_0x652f('0x3f')]!==_0x652f('0x4f')){var _0x499fc1={};_0x499fc1[_0x6793b[_0x652f('0x3b')]]={'$like':'%'+_0x3b64dd['query'][_0x652f('0x4c')]+'%'};return _0x499fc1;}})});}_0x51c83c=_[_0x652f('0x4e')]({},_0x51c83c,_0x3b64dd['options']);var _0x2571cc={'where':_0x51c83c[_0x652f('0x4d')]};return db[_0x652f('0x50')][_0x652f('0x2e')](_0x2571cc)[_0x652f('0x23')](function(_0x48ffbb){_0x3a976c[_0x652f('0x2e')]=_0x48ffbb;if(_0x3b64dd['query'][_0x652f('0x51')]){_0x51c83c[_0x652f('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x652f('0x53')](_0x51c83c);})[_0x652f('0x23')](function(_0x515110){_0x3a976c[_0x652f('0x54')]=_0x515110;return _0x3a976c;})['then'](respondWithFilteredResult(_0x5afec5,_0x51c83c))[_0x652f('0x2a')](handleError(_0x5afec5,null));};exports[_0x652f('0x55')]=function(_0x1bc7fd,_0x2c1f44){var _0x45b018={'raw':![],'where':{'id':_0x1bc7fd[_0x652f('0x56')]['id']},'include':[{'model':db[_0x652f('0x57')],'as':_0x652f('0x58')}]},_0x1dca89={};_0x1dca89[_0x652f('0x41')]=_[_0x652f('0x59')](db['OpenchannelAccount'][_0x652f('0x3e')]);_0x1dca89['query']=_['keys'](_0x1bc7fd[_0x652f('0x42')]);_0x1dca89[_0x652f('0x4a')]=_[_0x652f('0x44')](_0x1dca89[_0x652f('0x41')],_0x1dca89[_0x652f('0x42')]);_0x45b018[_0x652f('0x43')]=_['intersection'](_0x1dca89[_0x652f('0x41')],qs['fields'](_0x1bc7fd[_0x652f('0x42')]['fields']));_0x45b018[_0x652f('0x43')]=_0x45b018[_0x652f('0x43')][_0x652f('0x5a')]?_0x45b018[_0x652f('0x43')]:_0x1dca89[_0x652f('0x41')];if(_0x1bc7fd['query'][_0x652f('0x51')]){_0x45b018[_0x652f('0x52')]=[{'all':!![]}];}_0x45b018=_[_0x652f('0x4e')]({},_0x45b018,_0x1bc7fd[_0x652f('0x5b')]);return db[_0x652f('0x50')]['find'](_0x45b018)[_0x652f('0x23')](handleEntityNotFound(_0x2c1f44,null))[_0x652f('0x23')](respondWithResult(_0x2c1f44,null))['catch'](handleError(_0x2c1f44,null));};exports[_0x652f('0x5c')]=function(_0x51d0e6,_0x30045c){return db[_0x652f('0x50')][_0x652f('0x5c')](_0x51d0e6[_0x652f('0x5d')],{})[_0x652f('0x23')](function(_0x53a01d){var _0x2ce35e=_0x51d0e6[_0x652f('0x5e')]['get']({'plain':!![]});if(!_0x2ce35e)throw new Error(_0x652f('0x5f'));if(_0x2ce35e[_0x652f('0x60')]===_0x652f('0x5e')){var _0x479c3f=_0x53a01d[_0x652f('0x37')]({'plain':!![]});var _0x408c01=_0x652f('0x61');return db[_0x652f('0x62')]['find']({'where':{'name':_0x408c01,'userProfileId':_0x2ce35e[_0x652f('0x63')]},'raw':!![]})[_0x652f('0x23')](function(_0x47ebcd){if(_0x47ebcd&&_0x47ebcd['autoAssociation']===0x0){return db[_0x652f('0x64')][_0x652f('0x5c')]({'name':_0x479c3f[_0x652f('0x3b')],'resourceId':_0x479c3f['id'],'type':_0x47ebcd[_0x652f('0x3b')],'sectionId':_0x47ebcd['id']},{})[_0x652f('0x23')](function(){return _0x53a01d;});}else{return _0x53a01d;}})['catch'](function(_0x9cee20){logger[_0x652f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9cee20);throw _0x9cee20;});}return _0x53a01d;})[_0x652f('0x23')](respondWithResult(_0x30045c,0xc9))[_0x652f('0x2a')](handleError(_0x30045c,null));};exports[_0x652f('0x36')]=function(_0x4a2532,_0x2eb044){if(_0x4a2532['body']['id']){delete _0x4a2532[_0x652f('0x5d')]['id'];}return db['OpenchannelAccount'][_0x652f('0x65')]({'where':{'id':_0x4a2532[_0x652f('0x56')]['id']},'include':[{'model':db[_0x652f('0x57')],'as':_0x652f('0x58')}]})[_0x652f('0x23')](handleEntityNotFound(_0x2eb044,null))[_0x652f('0x23')](saveUpdates(_0x4a2532[_0x652f('0x5d')],null))[_0x652f('0x23')](respondWithResult(_0x2eb044,null))[_0x652f('0x2a')](handleError(_0x2eb044,null));};exports[_0x652f('0x38')]=function(_0x387fd6,_0x4eb170){return db[_0x652f('0x50')]['find']({'where':{'id':_0x387fd6[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x4eb170,null))[_0x652f('0x23')](removeEntity(_0x4eb170,null))[_0x652f('0x2a')](handleError(_0x4eb170,null));};exports[_0x652f('0x66')]=function(_0x1294c4,_0xdc8568){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0xdc8568,null))[_0x652f('0x2a')](handleError(_0xdc8568,null));};exports['addDisposition']=function(_0x35454d,_0x2724e2,_0x5a7985){if(_0x35454d['body']['id']){delete _0x35454d[_0x652f('0x5d')]['id'];}return db[_0x652f('0x50')]['find']({'where':{'id':_0x35454d[_0x652f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2724e2,null))[_0x652f('0x23')](function(_0xa7fbe0){if(_0xa7fbe0){_0x35454d['body'][_0x652f('0x67')]=_0xa7fbe0['id'];return db[_0x652f('0x68')][_0x652f('0x5c')](_0x35454d[_0x652f('0x5d')]);}})['then'](respondWithResult(_0x2724e2,null))[_0x652f('0x2a')](handleError(_0x2724e2,null));};exports[_0x652f('0x69')]=function(_0x3c6ca2,_0x262ff5,_0x55b5f9){var _0x1b5ab3={'raw':![],'where':{}};var _0x460444={};var _0x2b6bac={'count':0x0,'rows':[]};return db[_0x652f('0x50')][_0x652f('0x6a')]({'where':{'id':_0x3c6ca2[_0x652f('0x56')]['id']}})['then'](handleEntityNotFound(_0x262ff5,null))[_0x652f('0x23')](function(_0x18344c){if(_0x18344c){_0x460444[_0x652f('0x41')]=_[_0x652f('0x59')](db[_0x652f('0x68')][_0x652f('0x3e')]);_0x460444[_0x652f('0x42')]=_['keys'](_0x3c6ca2['query']);_0x460444[_0x652f('0x4a')]=_[_0x652f('0x44')](_0x460444[_0x652f('0x41')],_0x460444[_0x652f('0x42')]);_0x1b5ab3[_0x652f('0x43')]=_[_0x652f('0x44')](_0x460444[_0x652f('0x41')],qs['fields'](_0x3c6ca2[_0x652f('0x42')]['fields']));_0x1b5ab3[_0x652f('0x43')]=_0x1b5ab3[_0x652f('0x43')][_0x652f('0x5a')]?_0x1b5ab3['attributes']:_0x460444[_0x652f('0x41')];if(!_0x3c6ca2['query'][_0x652f('0x46')](_0x652f('0x47'))){_0x1b5ab3[_0x652f('0x30')]=qs[_0x652f('0x30')](_0x3c6ca2[_0x652f('0x42')][_0x652f('0x30')]);_0x1b5ab3[_0x652f('0x2f')]=qs['offset'](_0x3c6ca2[_0x652f('0x42')][_0x652f('0x2f')]);}_0x1b5ab3[_0x652f('0x48')]=qs[_0x652f('0x49')](_0x3c6ca2[_0x652f('0x42')]['sort']);_0x1b5ab3[_0x652f('0x4d')]=qs[_0x652f('0x4a')](_['pick'](_0x3c6ca2[_0x652f('0x42')],_0x460444[_0x652f('0x4a')]));_0x1b5ab3['where'][_0x652f('0x6b')]=_0x18344c['id'];if(_0x3c6ca2[_0x652f('0x42')]['filter']){_0x1b5ab3[_0x652f('0x4d')]=_[_0x652f('0x4e')](_0x1b5ab3[_0x652f('0x4d')],{'$or':_['map'](_0x1b5ab3[_0x652f('0x43')],function(_0x1458f0){var _0x76031a={};_0x76031a[_0x1458f0]={'$like':'%'+_0x3c6ca2[_0x652f('0x42')][_0x652f('0x4c')]+'%'};return _0x76031a;})});}_0x1b5ab3=_[_0x652f('0x4e')]({},_0x1b5ab3,_0x3c6ca2[_0x652f('0x5b')]);return db['Disposition']['count']({'where':_0x1b5ab3[_0x652f('0x4d')]})[_0x652f('0x23')](function(_0x2a10ec){_0x2b6bac[_0x652f('0x2e')]=_0x2a10ec;if(_0x3c6ca2[_0x652f('0x42')][_0x652f('0x51')]){_0x1b5ab3['include']=[{'all':!![]}];}return db[_0x652f('0x68')][_0x652f('0x53')](_0x1b5ab3);})[_0x652f('0x23')](function(_0x719105){_0x2b6bac[_0x652f('0x54')]=_0x719105;return _0x2b6bac;});}})[_0x652f('0x23')](respondWithFilteredResult(_0x262ff5,_0x1b5ab3))[_0x652f('0x2a')](handleError(_0x262ff5,null));};exports[_0x652f('0x6c')]=function(_0x59a223,_0x1e3162,_0x50c082){return db['OpenchannelAccount']['find']({'where':{'id':_0x59a223['params']['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x1e3162,null))['then'](function(_0x252b26){if(_0x252b26){return _0x252b26[_0x652f('0x6c')](_0x59a223['query'][_0x652f('0x6d')]);}})[_0x652f('0x23')](respondWithStatusCode(_0x1e3162,null))[_0x652f('0x2a')](handleError(_0x1e3162,null));};exports['addAnswer']=function(_0x2ec9fb,_0xa9de66,_0x1ce239){if(_0x2ec9fb[_0x652f('0x5d')]['id']){delete _0x2ec9fb[_0x652f('0x5d')]['id'];}return db['OpenchannelAccount'][_0x652f('0x65')]({'where':{'id':_0x2ec9fb[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0xa9de66,null))[_0x652f('0x23')](function(_0x3b018b){if(_0x3b018b){_0x2ec9fb[_0x652f('0x5d')][_0x652f('0x6b')]=_0x3b018b['id'];return db[_0x652f('0x6e')][_0x652f('0x5c')](_0x2ec9fb[_0x652f('0x5d')]);}})[_0x652f('0x23')](respondWithResult(_0xa9de66,null))[_0x652f('0x2a')](handleError(_0xa9de66,null));};exports[_0x652f('0x6f')]=function(_0x57e2ce,_0x209ea2,_0x5ab2dc){var _0x20cec1={'raw':![],'where':{}};var _0x95a591={};var _0x1bec4d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x652f('0x6a')]({'where':{'id':_0x57e2ce['params']['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x209ea2,null))['then'](function(_0x2a4de5){if(_0x2a4de5){_0x95a591[_0x652f('0x41')]=_[_0x652f('0x59')](db[_0x652f('0x6e')][_0x652f('0x3e')]);_0x95a591[_0x652f('0x42')]=_['keys'](_0x57e2ce[_0x652f('0x42')]);_0x95a591['filters']=_[_0x652f('0x44')](_0x95a591[_0x652f('0x41')],_0x95a591['query']);_0x20cec1[_0x652f('0x43')]=_[_0x652f('0x44')](_0x95a591[_0x652f('0x41')],qs[_0x652f('0x45')](_0x57e2ce['query'][_0x652f('0x45')]));_0x20cec1[_0x652f('0x43')]=_0x20cec1[_0x652f('0x43')][_0x652f('0x5a')]?_0x20cec1[_0x652f('0x43')]:_0x95a591[_0x652f('0x41')];if(!_0x57e2ce['query']['hasOwnProperty'](_0x652f('0x47'))){_0x20cec1[_0x652f('0x30')]=qs[_0x652f('0x30')](_0x57e2ce[_0x652f('0x42')][_0x652f('0x30')]);_0x20cec1[_0x652f('0x2f')]=qs[_0x652f('0x2f')](_0x57e2ce[_0x652f('0x42')][_0x652f('0x2f')]);}_0x20cec1[_0x652f('0x48')]=qs[_0x652f('0x49')](_0x57e2ce[_0x652f('0x42')][_0x652f('0x49')]);_0x20cec1['where']=qs[_0x652f('0x4a')](_['pick'](_0x57e2ce[_0x652f('0x42')],_0x95a591[_0x652f('0x4a')]));_0x20cec1[_0x652f('0x4d')][_0x652f('0x6b')]=_0x2a4de5['id'];if(_0x57e2ce[_0x652f('0x42')][_0x652f('0x4c')]){_0x20cec1['where']=_['merge'](_0x20cec1[_0x652f('0x4d')],{'$or':_[_0x652f('0x3d')](_0x20cec1[_0x652f('0x43')],function(_0x83a136){var _0x154522={};_0x154522[_0x83a136]={'$like':'%'+_0x57e2ce[_0x652f('0x42')][_0x652f('0x4c')]+'%'};return _0x154522;})});}_0x20cec1=_[_0x652f('0x4e')]({},_0x20cec1,_0x57e2ce[_0x652f('0x5b')]);return db['CannedAnswer'][_0x652f('0x2e')]({'where':_0x20cec1['where']})['then'](function(_0x51a977){_0x1bec4d[_0x652f('0x2e')]=_0x51a977;if(_0x57e2ce['query']['includeAll']){_0x20cec1[_0x652f('0x52')]=[{'all':!![]}];}return db[_0x652f('0x6e')]['findAll'](_0x20cec1);})[_0x652f('0x23')](function(_0x23b300){_0x1bec4d['rows']=_0x23b300;return _0x1bec4d;});}})['then'](respondWithFilteredResult(_0x209ea2,_0x20cec1))[_0x652f('0x2a')](handleError(_0x209ea2,null));};exports[_0x652f('0x70')]=function(_0x2a8f99,_0x1b42e8,_0x559b67){return db[_0x652f('0x50')][_0x652f('0x65')]({'where':{'id':_0x2a8f99[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x1b42e8,null))[_0x652f('0x23')](function(_0x22c296){if(_0x22c296){return _0x22c296[_0x652f('0x70')](_0x2a8f99[_0x652f('0x42')][_0x652f('0x6d')]);}})[_0x652f('0x23')](respondWithStatusCode(_0x1b42e8,null))['catch'](handleError(_0x1b42e8,null));};exports['notify']=function(_0x172d71,_0x398bbc,_0x473723){var _0x201df1={'body':_0x172d71['body'],'channel':_0x652f('0x71')};var _0x50f0bb=[];var _0x2f75aa=[];var _0x5f25e5={};var _0x5ae74a=![];return db[_0x652f('0x72')][_0x652f('0x66')]()[_0x652f('0x23')](function(_0x14ab37){if(!_0x14ab37){throw new db[(_0x652f('0x20'))][(_0x652f('0x73'))](_0x652f('0x74'));}_0x50f0bb=_['difference'](_[_0x652f('0x59')](_0x14ab37),['createdAt',_0x652f('0x75')]);_0x2f75aa=_[_0x652f('0x76')](_[_0x652f('0x59')](_0x14ab37),['createdAt','updatedAt',_0x652f('0x77'),_0x652f('0x78')]);if(_0x172d71[_0x652f('0x5d')]['id']){delete _0x172d71[_0x652f('0x5d')]['id'];}if(_[_0x652f('0x79')](_0x172d71['body']['from'])){throw new db[(_0x652f('0x20'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x172d71[_0x652f('0x5d')][_0x652f('0x5d')])||_0x172d71[_0x652f('0x5d')][_0x652f('0x5d')]===''){throw new db['Sequelize'][(_0x652f('0x73'))](_0x652f('0x7a'));}if(_[_0x652f('0x79')](_0x172d71['body'][_0x652f('0x7b')])){throw new db[(_0x652f('0x20'))]['ValidationError'](_0x652f('0x7c')+_0x2f75aa);}if(!_[_0x652f('0x7d')](_0x2f75aa,_0x172d71[_0x652f('0x5d')]['mapKey'])){throw new db[(_0x652f('0x20'))][(_0x652f('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f75aa);}_0x5f25e5[_0x172d71[_0x652f('0x5d')][_0x652f('0x7b')]]=_0x172d71[_0x652f('0x5d')][_0x652f('0x7e')];})[_0x652f('0x23')](function(){return db['OpenchannelAccount'][_0x652f('0x65')]({'where':{'id':_0x172d71[_0x652f('0x56')]['id']},'include':[{'model':db[_0x652f('0x7f')],'as':_0x652f('0x80'),'include':[{'model':db[_0x652f('0x72')],'as':'Contacts','where':_0x5f25e5,'limit':0x1,'order':[[_0x652f('0x75'),_0x652f('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0x652f('0x82')}]});})['then'](handleEntityNotFound(_0x398bbc,null))[_0x652f('0x23')](function(_0x2a96d8){if(_0x2a96d8&&_0x2a96d8[_0x652f('0x80')]){_0x201df1['account']=_0x2a96d8;_0x201df1[_0x652f('0x83')]=_0x2a96d8[_0x652f('0x82')];_0x201df1[_0x652f('0x84')]=_0x2a96d8[_0x652f('0x80')];_0x201df1['applications']=_['orderBy'](_0x201df1[_0x652f('0x83')],[_0x652f('0x85')],['asc']);if(_0x201df1[_0x652f('0x86')][_0x652f('0x82')]){delete _0x201df1[_0x652f('0x86')]['Applications'];}if(_0x201df1[_0x652f('0x86')][_0x652f('0x80')]&&_0x201df1[_0x652f('0x86')][_0x652f('0x80')][_0x652f('0x87')][_0x652f('0x5a')]){return _0x201df1[_0x652f('0x86')][_0x652f('0x80')][_0x652f('0x87')][0x0];}var _0xd265a2=_[_0x652f('0x88')](_0x172d71[_0x652f('0x5d')],{'firstName':_0x172d71[_0x652f('0x5d')][_0x652f('0x7e')],'ListId':_0x2a96d8[_0x652f('0x78')]});_0xd265a2[_0x172d71['body']['mapKey']]=_0x172d71[_0x652f('0x5d')][_0x652f('0x7e')];return db[_0x652f('0x72')]['create'](_0xd265a2,{'fields':_0x50f0bb,'raw':!![]});}})[_0x652f('0x23')](handleEntityNotFound(_0x398bbc,null))['then'](function(_0x368b56){_0x201df1['contact']=_0x368b56;if(_0x368b56){var _0x4fc160={'ContactId':_0x368b56['id'],'OpenchannelAccountId':_0x172d71['params']['id'],'from':(_0x368b56[_0x652f('0x89')]||'')+'\x20'+(_0x368b56[_0x652f('0x8a')]||'')};var _0x5dbb39={'OpenchannelAccountId':_0x172d71['params']['id'],'closed':![]};if(_0x172d71[_0x652f('0x5d')][_0x652f('0x8b')]){_0x5dbb39[_0x652f('0x8b')]=_0x172d71[_0x652f('0x5d')][_0x652f('0x8b')];return db[_0x652f('0x8c')][_0x652f('0x65')]({'where':_0x5dbb39})['then'](function(_0x51667f){if(_0x51667f){return[_0x51667f,![]];}_0x4fc160['threadId']=_0x172d71[_0x652f('0x5d')]['threadId'];_0x4fc160[_0x652f('0x8d')]=_0x172d71[_0x652f('0x5d')][_0x652f('0x8d')];return db[_0x652f('0x8c')][_0x652f('0x5c')](_0x4fc160)[_0x652f('0x23')](function(_0x460f24){return[_0x460f24,!![]];});});}else{_0x5dbb39['threadId']=null;}_0x5dbb39[_0x652f('0x8e')]=_0x368b56['id'];return db[_0x652f('0x8c')][_0x652f('0x65')]({'where':_0x5dbb39})[_0x652f('0x23')](function(_0x46513b){if(_0x46513b){return[_0x46513b,![]];}return db[_0x652f('0x8c')]['create'](_0x4fc160)[_0x652f('0x23')](function(_0x57e9f2){return[_0x57e9f2,!![]];});});}})[_0x652f('0x8f')](function(_0x11b0cd,_0x4d93d4){if(_0x11b0cd){_0x5ae74a=_0x4d93d4;if(!_0x4d93d4){var _0x31e4d5={'from':(_0x201df1[_0x652f('0x90')][_0x652f('0x89')]||'')+'\x20'+(_0x201df1[_0x652f('0x90')][_0x652f('0x8a')]||'')};if(_0x172d71[_0x652f('0x5d')]['threadId']&&_0x172d71[_0x652f('0x5d')]['messageId']&&_0x172d71['body'][_0x652f('0x8b')]!=_0x172d71['body'][_0x652f('0x91')]){_0x31e4d5[_0x652f('0x8b')]=_0x172d71[_0x652f('0x5d')][_0x652f('0x91')];}return _0x11b0cd['update'](_0x31e4d5);}else{return _0x11b0cd;}}})[_0x652f('0x23')](function(_0x2dfeba){_0x201df1[_0x652f('0x92')]=_0x2dfeba[_0x652f('0x37')]({'plain':!![]});_0x201df1[_0x652f('0x92')][_0x652f('0x93')]=_0x5ae74a;if(_0x201df1[_0x652f('0x92')]['created']){if(_0x201df1[_0x652f('0x86')]['autoclose']){_0x201df1[_0x652f('0x83')][_0x652f('0x94')]({'id':0x0,'priority':_0x201df1['applications'][_0x652f('0x5a')]+0x1,'app':_0x652f('0x95'),'appdata':_0x652f('0x96'),'interval':_0x652f('0x97')});}}return db['OpenchannelMessage']['create']({'body':_0x172d71[_0x652f('0x5d')][_0x652f('0x5d')],'OpenchannelAccountId':_0x172d71[_0x652f('0x56')]['id'],'OpenchannelInteractionId':_0x2dfeba['id'],'direction':'in','ContactId':_0x201df1[_0x652f('0x90')]['id'],'AttachmentId':_0x172d71[_0x652f('0x5d')][_0x652f('0x98')]});})['then'](function(_0x2cd928){_0x201df1[_0x652f('0x29')]=_0x2cd928;if(_0x201df1[_0x652f('0x92')][_0x652f('0x99')]){return db[_0x652f('0x9a')][_0x652f('0x65')]({'attributes':['id',_0x652f('0x3b')],'where':{'id':_0x201df1[_0x652f('0x92')][_0x652f('0x99')]}})[_0x652f('0x23')](function(_0x372cbd){if(_0x372cbd){_0x201df1['applications'][_0x652f('0x9b')]({'id':0x0,'priority':0x0,'app':_0x652f('0x9c'),'appdata':_0x372cbd[_0x652f('0x3b')]+','+(_0x201df1['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x201df1[_0x652f('0x9d')]=![];}return respondWithRpcPromise(_0x652f('0x9e'),_0x652f('0x9f'),_0x201df1);});}return respondWithRpcPromise(_0x652f('0x9e'),_0x652f('0x9f'),_0x201df1);})[_0x652f('0x23')](function(_0x3c548f){respondWithRpcPromise(_0x652f('0xa0'),'EventManager',{'event':_0x652f('0xa1'),'message':_0x3c548f},client9002);return _0x3c548f;})[_0x652f('0x23')](respondWithResult(_0x398bbc,null))[_0x652f('0x2a')](handleError(_0x398bbc,null));};exports[_0x652f('0xa2')]=function(_0x6e3f51,_0x20fb1d,_0x4a3b3e){return db['OpenchannelAccount'][_0x652f('0x6a')]({'where':{'id':_0x6e3f51['params']['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x20fb1d,null))[_0x652f('0x23')](function(_0x45e60c){if(_0x45e60c){return db[_0x652f('0xa3')][_0x652f('0xa4')](function(_0x531edd){return db[_0x652f('0xa5')][_0x652f('0x38')]({'where':{'OpenchannelAccountId':_0x6e3f51[_0x652f('0x56')]['id']},'transaction':_0x531edd})[_0x652f('0x23')](function(_0x1e9613){var _0x1bb43d=_[_0x652f('0x3d')](_0x6e3f51[_0x652f('0x5d')],function(_0x5d7eff){_0x5d7eff[_0x652f('0x6b')]=_0x6e3f51['params']['id'];return _0x5d7eff;});return db[_0x652f('0xa5')][_0x652f('0xa6')](_0x1bb43d,{'transaction':_0x531edd});});})['then'](function(){return db[_0x652f('0xa5')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x6e3f51['params']['id']},'order':_0x652f('0x85')});});}})[_0x652f('0x23')](respondWithResult(_0x20fb1d,null))[_0x652f('0x2a')](handleError(_0x20fb1d,null));};exports[_0x652f('0xa7')]=function(_0x57159b,_0x1c0231,_0x47208f){var _0x17597c={};var _0x39312f={};var _0x2ed5b8;var _0x489348;return db[_0x652f('0x50')]['findOne']({'where':{'id':_0x57159b[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x1c0231,null))[_0x652f('0x23')](function(_0x9921b5){if(_0x9921b5){_0x2ed5b8=_0x9921b5;_0x39312f['model']=_[_0x652f('0x59')](db['OpenchannelApplication'][_0x652f('0x3e')]);_0x39312f[_0x652f('0x42')]=_[_0x652f('0x59')](_0x57159b['query']);_0x39312f['filters']=_[_0x652f('0x44')](_0x39312f[_0x652f('0x41')],_0x39312f['query']);_0x17597c['attributes']=_['intersection'](_0x39312f['model'],qs[_0x652f('0x45')](_0x57159b[_0x652f('0x42')][_0x652f('0x45')]));_0x17597c[_0x652f('0x43')]=_0x17597c[_0x652f('0x43')]['length']?_0x17597c[_0x652f('0x43')]:_0x39312f[_0x652f('0x41')];_0x17597c['order']=qs[_0x652f('0x49')](_0x57159b[_0x652f('0x42')]['sort']);_0x17597c[_0x652f('0x4d')]=qs['filters'](_['pick'](_0x57159b[_0x652f('0x42')],_0x39312f[_0x652f('0x4a')]));if(_0x57159b[_0x652f('0x42')][_0x652f('0x4c')]){_0x17597c['where']=_[_0x652f('0x4e')](_0x17597c['where'],{'$or':_['map'](_0x17597c[_0x652f('0x43')],function(_0x1c6aa9){var _0x3f0a27={};_0x3f0a27[_0x1c6aa9]={'$like':'%'+_0x57159b[_0x652f('0x42')][_0x652f('0x4c')]+'%'};return _0x3f0a27;})});}_0x17597c=_['merge']({},_0x17597c,_0x57159b[_0x652f('0x5b')]);return _0x2ed5b8[_0x652f('0xa7')](_0x17597c);}})['then'](function(_0x5d26b1){if(_0x5d26b1){_0x489348=_0x5d26b1[_0x652f('0x5a')];if(!_0x57159b['query'][_0x652f('0x46')](_0x652f('0x47'))){_0x17597c['limit']=qs[_0x652f('0x30')](_0x57159b[_0x652f('0x42')][_0x652f('0x30')]);_0x17597c[_0x652f('0x2f')]=qs[_0x652f('0x2f')](_0x57159b[_0x652f('0x42')][_0x652f('0x2f')]);}return _0x2ed5b8['getApplications'](_0x17597c);}})[_0x652f('0x23')](function(_0x50b56c){if(_0x50b56c){return _0x50b56c?{'count':_0x489348,'rows':_0x50b56c}:null;}})[_0x652f('0x23')](respondWithResult(_0x1c0231,null))[_0x652f('0x2a')](handleError(_0x1c0231,null));};exports[_0x652f('0xa8')]=function(_0x15fd7d,_0x506005,_0x10b6a2){var _0x3d016={'raw':![],'where':{}};var _0x88a4f9={};var _0x976a92={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x15fd7d[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x506005,null))[_0x652f('0x23')](function(_0x3bf14c){if(_0x3bf14c){_0x88a4f9['model']=_['keys'](db[_0x652f('0x8c')][_0x652f('0x3e')]);_0x88a4f9['query']=_[_0x652f('0x59')](_0x15fd7d[_0x652f('0x42')]);_0x88a4f9[_0x652f('0x4a')]=_[_0x652f('0x44')](_0x88a4f9[_0x652f('0x41')],_0x88a4f9['query']);_0x3d016[_0x652f('0x43')]=_['intersection'](_0x88a4f9[_0x652f('0x41')],qs[_0x652f('0x45')](_0x15fd7d[_0x652f('0x42')]['fields']));_0x3d016[_0x652f('0x43')]=_0x3d016[_0x652f('0x43')][_0x652f('0x5a')]?_0x3d016['attributes']:_0x88a4f9[_0x652f('0x41')];if(!_0x15fd7d[_0x652f('0x42')][_0x652f('0x46')]('nolimit')){_0x3d016[_0x652f('0x30')]=qs[_0x652f('0x30')](_0x15fd7d[_0x652f('0x42')]['limit']);_0x3d016['offset']=qs[_0x652f('0x2f')](_0x15fd7d[_0x652f('0x42')][_0x652f('0x2f')]);}_0x3d016[_0x652f('0x48')]=qs[_0x652f('0x49')](_0x15fd7d['query'][_0x652f('0x49')]);_0x3d016[_0x652f('0x4d')]=qs[_0x652f('0x4a')](_[_0x652f('0x4b')](_0x15fd7d[_0x652f('0x42')],_0x88a4f9[_0x652f('0x4a')]));_0x3d016[_0x652f('0x4d')]['OpenchannelAccountId']=_0x3bf14c['id'];if(_0x15fd7d['query'][_0x652f('0x4c')]){_0x3d016['where']=_['merge'](_0x3d016[_0x652f('0x4d')],{'$or':_['map'](_0x3d016[_0x652f('0x43')],function(_0x525c03){var _0x22e963={};_0x22e963[_0x525c03]={'$like':'%'+_0x15fd7d['query']['filter']+'%'};return _0x22e963;})});}_0x3d016=_[_0x652f('0x4e')]({},_0x3d016,_0x15fd7d['options']);return db[_0x652f('0x8c')]['count']({'where':_0x3d016[_0x652f('0x4d')]})[_0x652f('0x23')](function(_0x386c43){_0x976a92[_0x652f('0x2e')]=_0x386c43;if(_0x15fd7d['query'][_0x652f('0x51')]){_0x3d016[_0x652f('0x52')]=[{'model':db[_0x652f('0x72')],'as':_0x652f('0xa9'),'required':![]},{'model':db[_0x652f('0x9a')],'as':_0x652f('0xaa'),'attributes':['name',_0x652f('0xab'),_0x652f('0xac')],'required':![]},{'model':db[_0x652f('0xad')],'as':'Tags','attributes':['id',_0x652f('0x3b'),'color'],'where':_0x15fd7d[_0x652f('0x42')][_0x652f('0xae')]?{'id':_0x15fd7d['query'][_0x652f('0xae')]}:undefined,'required':_0x15fd7d[_0x652f('0x42')][_0x652f('0xae')]?!![]:![]}];}return db[_0x652f('0x8c')][_0x652f('0x53')](_0x3d016);})[_0x652f('0x23')](function(_0x119a0e){_0x976a92[_0x652f('0x54')]=_0x119a0e;return _0x976a92;});}})['then'](respondWithFilteredResult(_0x506005,_0x3d016))[_0x652f('0x2a')](handleError(_0x506005,null));};exports['addAgents']=function(_0x31a41a,_0x4b238e,_0x4d95a2){return db[_0x652f('0x50')][_0x652f('0x65')]({'where':{'id':_0x31a41a['params']['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x4b238e,null))[_0x652f('0x23')](function(_0xe290d4){if(_0xe290d4){return _0xe290d4[_0x652f('0xaf')](_0x31a41a[_0x652f('0x5d')][_0x652f('0x6d')],_[_0x652f('0xb0')](_0x31a41a[_0x652f('0x5d')],[_0x652f('0x6d'),'id'])||{})[_0x652f('0x8f')](function(_0x7a4c83){for(var _0x58e219=0x0;_0x58e219<_0x31a41a[_0x652f('0x5d')][_0x652f('0x6d')]['length'];_0x58e219+=0x1){socket[_0x652f('0xb1')]('userOpenchannelAccount:save',{'UserId':_0x31a41a[_0x652f('0x5d')]['ids'][_0x58e219],'OpenchannelAccountId':_0x31a41a[_0x652f('0x56')]['id']});}return _0x7a4c83;});}})[_0x652f('0x23')](respondWithResult(_0x4b238e,null))[_0x652f('0x2a')](handleError(_0x4b238e,null));};exports['removeAgents']=function(_0x5a49f8,_0x2c0086,_0x38bac6){return db[_0x652f('0x50')]['find']({'where':{'id':_0x5a49f8['params']['id']}})['then'](handleEntityNotFound(_0x2c0086,null))['then'](function(_0x3e2815){if(_0x3e2815){return _0x3e2815[_0x652f('0xb2')](_0x5a49f8[_0x652f('0x42')][_0x652f('0x6d')])[_0x652f('0x23')](function(){if(_[_0x652f('0xb3')](_0x5a49f8[_0x652f('0x42')][_0x652f('0x6d')])){for(var _0xc89381=0x0;_0xc89381<_0x5a49f8[_0x652f('0x42')][_0x652f('0x6d')][_0x652f('0x5a')];_0xc89381+=0x1){socket[_0x652f('0xb1')](_0x652f('0xb4'),{'UserId':Number(_0x5a49f8['query'][_0x652f('0x6d')][_0xc89381]),'OpenchannelAccountId':Number(_0x5a49f8[_0x652f('0x56')]['id'])});}}else{socket[_0x652f('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5a49f8[_0x652f('0x42')][_0x652f('0x6d')]),'OpenchannelAccountId':Number(_0x5a49f8[_0x652f('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c0086,null))['catch'](handleError(_0x2c0086,null));};exports['getAgents']=function(_0x2e1c6d,_0x29beb5,_0x2c6f65){var _0x50f8ba={};var _0x90dd40={};var _0x1c5dc2;var _0x3e6177;return db['OpenchannelAccount'][_0x652f('0x6a')]({'where':{'id':_0x2e1c6d[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x29beb5,null))['then'](function(_0x3e5fb6){if(_0x3e5fb6){_0x1c5dc2=_0x3e5fb6;_0x90dd40[_0x652f('0x41')]=_[_0x652f('0x59')](db[_0x652f('0x9a')]['rawAttributes']);_0x90dd40[_0x652f('0x42')]=_[_0x652f('0x59')](_0x2e1c6d[_0x652f('0x42')]);_0x90dd40['filters']=_[_0x652f('0x44')](_0x90dd40[_0x652f('0x41')],_0x90dd40['query']);_0x50f8ba[_0x652f('0x43')]=_[_0x652f('0x44')](_0x90dd40['model'],qs['fields'](_0x2e1c6d[_0x652f('0x42')]['fields']));_0x50f8ba[_0x652f('0x43')]=_0x50f8ba[_0x652f('0x43')][_0x652f('0x5a')]?_0x50f8ba['attributes']:_0x90dd40[_0x652f('0x41')];_0x50f8ba['order']=qs['sort'](_0x2e1c6d['query'][_0x652f('0x49')]);_0x50f8ba[_0x652f('0x4d')]=qs[_0x652f('0x4a')](_['pick'](_0x2e1c6d[_0x652f('0x42')],_0x90dd40[_0x652f('0x4a')]));if(_0x2e1c6d[_0x652f('0x42')][_0x652f('0x4c')]){_0x50f8ba['where']=_[_0x652f('0x4e')](_0x50f8ba[_0x652f('0x4d')],{'$or':_['map'](_0x50f8ba[_0x652f('0x43')],function(_0x3c1439){var _0x2c6465={};_0x2c6465[_0x3c1439]={'$like':'%'+_0x2e1c6d[_0x652f('0x42')][_0x652f('0x4c')]+'%'};return _0x2c6465;})});}_0x50f8ba=_[_0x652f('0x4e')]({},_0x50f8ba,_0x2e1c6d['options']);return _0x1c5dc2[_0x652f('0xb5')](_0x50f8ba);}})[_0x652f('0x23')](function(_0x507815){if(_0x507815){_0x3e6177=_0x507815[_0x652f('0x5a')];if(!_0x2e1c6d[_0x652f('0x42')]['hasOwnProperty'](_0x652f('0x47'))){_0x50f8ba[_0x652f('0x30')]=qs[_0x652f('0x30')](_0x2e1c6d['query'][_0x652f('0x30')]);_0x50f8ba[_0x652f('0x2f')]=qs[_0x652f('0x2f')](_0x2e1c6d['query'][_0x652f('0x2f')]);}return _0x1c5dc2[_0x652f('0xb5')](_0x50f8ba);}})[_0x652f('0x23')](function(_0x33fcd0){if(_0x33fcd0){return _0x33fcd0?{'count':_0x3e6177,'rows':_0x33fcd0}:null;}})['then'](respondWithResult(_0x29beb5,null))['catch'](handleError(_0x29beb5,null));};exports[_0x652f('0x3c')]=function(_0xe44549,_0x225cf2,_0x384917){var _0x2c3146,_0x10073c,_0x55329f;if(_[_0x652f('0x79')](_0xe44549[_0x652f('0x5d')][_0x652f('0x5d')])||_0xe44549[_0x652f('0x5d')][_0x652f('0x5d')]===''){throw new db[(_0x652f('0x20'))][(_0x652f('0x73'))](_0x652f('0x7a'));}if(_['isNil'](_0xe44549[_0x652f('0x5d')]['to'])){}_0x2c3146=_0xe44549['body']['to'];return db['OpenchannelAccount'][_0x652f('0x6a')]({'where':{'id':_0xe44549[_0x652f('0x56')]['id']}})[_0x652f('0x23')](handleEntityNotFound(_0x225cf2,null))[_0x652f('0x23')](function(_0x5e370e){if(_0x5e370e){return db[_0x652f('0x50')][_0x652f('0x65')]({'where':{'id':_0x5e370e['id']},'include':[{'model':db[_0x652f('0x7f')],'as':'List','include':[{'model':db[_0x652f('0x72')],'as':_0x652f('0x87'),'where':{[_0x5e370e[_0x652f('0x7b')]]:_0x2c3146},'limit':0x1,'order':[['updatedAt',_0x652f('0x81')]]}]}]})[_0x652f('0x23')](handleEntityNotFound(_0x225cf2,null))[_0x652f('0x23')](function(_0x490176){if(_0x490176&&_0x490176[_0x652f('0x80')]){_0x10073c=_0x490176[_0x652f('0x37')]({'plain':!![]});if(_0x10073c[_0x652f('0x80')]&&_0x10073c['List'][_0x652f('0x87')]['length']){return _0x10073c[_0x652f('0x80')]['Contacts'][0x0];}return db[_0x652f('0x72')][_0x652f('0x5c')](_[_0x652f('0x88')](_0xe44549[_0x652f('0x5d')],{'firstName':_0x2c3146,[_0x490176[_0x652f('0x7b')]]:_0x2c3146,'phone':_0x2c3146,'ListId':_0x10073c['ListId']}));}})[_0x652f('0x23')](handleEntityNotFound(_0x225cf2,null))[_0x652f('0x23')](function(_0x16fe42){if(_0x16fe42){_0x55329f=_0x16fe42;return db[_0x652f('0x8c')]['find']({'where':{'ContactId':_0x55329f['id'],'closed':![],'OpenchannelAccountId':_0x10073c['id']}})['then'](function(_0x3975cc){if(_0x3975cc){return[_0x3975cc,![]];}return db[_0x652f('0x8c')][_0x652f('0x5c')]({'UserId':_0xe44549['user']['id'],'ContactId':_0x55329f['id'],'OpenchannelAccountId':_0x10073c['id'],'lastMsgDirection':_0x652f('0xb6'),'Messages':[_[_0x652f('0x4e')](_0xe44549[_0x652f('0x5d')],{'read':![],'body':_0xe44549['body'][_0x652f('0x5d')],'OpenchannelAccountId':_0x10073c['id'],'UserId':_0xe44549[_0x652f('0x5e')]['id'],'ContactId':_0x55329f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x652f('0xb7')}]})['then'](function(_0x231def){return[_0x231def,!![]];});});}})[_0x652f('0x8f')](function(_0x19be3d,_0x4fd204){if(_0x4fd204){return _0x19be3d;}return db['OpenchannelMessage'][_0x652f('0x5c')](_['merge'](_0xe44549[_0x652f('0x5d')],{'read':![],'body':_0xe44549['body'][_0x652f('0x5d')],'OpenchannelAccountId':_0x10073c['id'],'OpenchannelInteractionId':_0x19be3d['id'],'UserId':_0xe44549[_0x652f('0x5e')]['id'],'ContactId':_0x55329f['id']}))['then'](function(_0x19ffd4){_0x19be3d[_0x652f('0xb8')]['Messages']=[];_0x19be3d['dataValues'][_0x652f('0xb7')][_0x652f('0x94')](_0x19ffd4[_0x652f('0xb8')]);return _0x19be3d;});});}})[_0x652f('0x23')](respondWithResult(_0x225cf2,null))[_0x652f('0x2a')](handleError(_0x225cf2,null));}; \ No newline at end of file +var _0x8dcf=['account','applications','list','orderBy','priority','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','transaction','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','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','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','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','order','OpenchannelAccountId','options','removeDispositions','getAnswers','CannedAnswer','length','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','Contacts','DESC','OpenchannelApplication','Applications','List'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8dcf,0x1aa));var _0xf8dc=function(_0x216a04,_0xdb1e7a){_0x216a04=_0x216a04-0x0;var _0x375dba=_0x8dcf[_0x216a04];return _0x375dba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf8dc('0x0'));var rimraf=require(_0xf8dc('0x1'));var zipdir=require(_0xf8dc('0x2'));var jsonpatch=require(_0xf8dc('0x3'));var rp=require(_0xf8dc('0x4'));var moment=require(_0xf8dc('0x5'));var BPromise=require(_0xf8dc('0x6'));var Mustache=require(_0xf8dc('0x7'));var util=require(_0xf8dc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf8dc('0x9'));var ejs=require(_0xf8dc('0xa'));var fs=require('fs');var _=require(_0xf8dc('0xb'));var squel=require(_0xf8dc('0xc'));var crypto=require('crypto');var jsforce=require(_0xf8dc('0xd'));var deskjs=require(_0xf8dc('0xe'));var toCsv=require(_0xf8dc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8dc('0xf'));var authService=require(_0xf8dc('0x10'));var qs=require(_0xf8dc('0x11'));var as=require(_0xf8dc('0x12'));var hardwareService=require(_0xf8dc('0x13'));var logger=require(_0xf8dc('0x14'))(_0xf8dc('0x15'));var utils=require(_0xf8dc('0x16'));var config=require(_0xf8dc('0x17'));var db=require(_0xf8dc('0x18'))['db'];config[_0xf8dc('0x19')]=_[_0xf8dc('0x1a')](config[_0xf8dc('0x19')],{'host':_0xf8dc('0x1b'),'port':0x18eb});var socket=require(_0xf8dc('0x1c'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xf8dc('0x1d'));var client=jayson[_0xf8dc('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xf8dc('0x1e')][_0xf8dc('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x5b8597,_0x12ea0e,_0x4cb545){if(_0x4cb545){var _0x1e6a99=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e6a99[_0xf8dc('0x20')](_0x12ea0e)){return _0x5b8597;}else{throw new db[(_0xf8dc('0x21'))]['ValidationError'](_0xf8dc('0x22'));}}else{return _0x5b8597;}}function respondWithRpcPromise(_0x5f4ad9,_0x2968d9,_0x424948,_0xc96ad){return new BPromise(function(_0x1acfec,_0x39f29f){var _0x5c7440=_0xc96ad||client;return _0x5c7440[_0xf8dc('0x23')](_0x5f4ad9,_0x424948)[_0xf8dc('0x24')](function(_0x1def92){logger[_0xf8dc('0x25')](_0xf8dc('0x26'),_0x2968d9,'request\x20sent');logger[_0xf8dc('0x27')](_0xf8dc('0x28'),_0x2968d9,_0xf8dc('0x29'),JSON[_0xf8dc('0x2a')](_0x1def92));if(_0x1def92[_0xf8dc('0x2b')]){if(_0x1def92[_0xf8dc('0x2b')][_0xf8dc('0x2c')]===0x1f4){logger[_0xf8dc('0x2b')](_0xf8dc('0x26'),_0x2968d9,_0x1def92[_0xf8dc('0x2b')][_0xf8dc('0x2d')]);return _0x39f29f(_0x1def92[_0xf8dc('0x2b')][_0xf8dc('0x2d')]);}logger[_0xf8dc('0x2b')](_0xf8dc('0x26'),_0x2968d9,_0x1def92[_0xf8dc('0x2b')]['message']);return _0x1acfec(_0x1def92[_0xf8dc('0x2b')]['message']);}else{logger['info'](_0xf8dc('0x26'),_0x2968d9,_0xf8dc('0x29'));_0x1acfec(_0x1def92['result'][_0xf8dc('0x2d')]);}})[_0xf8dc('0x2e')](function(_0x2fbd1e){logger[_0xf8dc('0x2b')](_0xf8dc('0x26'),_0x2968d9,_0x2fbd1e);_0x39f29f(_0x2fbd1e);});});}function respondWithStatusCode(_0x1769ff,_0x1b724d){_0x1b724d=_0x1b724d||0xcc;return function(_0x537df2){if(_0x537df2){return _0x1769ff[_0xf8dc('0x2f')](_0x1b724d);}return _0x1769ff[_0xf8dc('0x30')](_0x1b724d)[_0xf8dc('0x31')]();};}function respondWithResult(_0x44d59e,_0x2abe50){_0x2abe50=_0x2abe50||0xc8;return function(_0x151a60){if(_0x151a60){return _0x44d59e[_0xf8dc('0x30')](_0x2abe50)[_0xf8dc('0x32')](_0x151a60);}};}function respondWithFilteredResult(_0x25c289,_0x267007){return function(_0x20ad46){if(_0x20ad46){var _0xde30e2=_0x20ad46[_0xf8dc('0x33')],_0x2e3c47=_0x267007[_0xf8dc('0x34')],_0x4be92d=_0x267007[_0xf8dc('0x34')]+_0x267007['limit'],_0xc009bf;if(_0x4be92d>=_0xde30e2){_0x4be92d=_0xde30e2;_0xc009bf=0xc8;}else{_0xc009bf=0xce;}_0x25c289[_0xf8dc('0x30')](_0xc009bf);return _0x25c289[_0xf8dc('0x35')](_0xf8dc('0x36'),_0x2e3c47+'-'+_0x4be92d+'/'+_0xde30e2)['json'](_0x20ad46);}return null;};}function patchUpdates(_0x262969){return function(_0x5f150a){try{jsonpatch[_0xf8dc('0x37')](_0x5f150a,_0x262969,!![]);}catch(_0x32a284){return BPromise[_0xf8dc('0x38')](_0x32a284);}return _0x5f150a[_0xf8dc('0x39')]();};}function saveUpdates(_0xc60249,_0x59b41e){return function(_0x51b95f){if(_0x51b95f){return _0x51b95f[_0xf8dc('0x3a')](_0xc60249)[_0xf8dc('0x24')](function(_0x12d625){return _0x12d625;});}return null;};}function removeEntity(_0x2e6a10,_0x37c5fe){return function(_0x51f26e){if(_0x51f26e){return _0x51f26e[_0xf8dc('0x3b')]()['then'](function(){var _0x4af55d=_0x51f26e['get']({'plain':!![]});var _0x384f2e='OpenchannelAccounts';return db[_0xf8dc('0x3c')][_0xf8dc('0x3b')]({'where':{'type':_0x384f2e,'resourceId':_0x4af55d['id']}})[_0xf8dc('0x24')](function(){return _0x51f26e;});})['then'](function(){_0x2e6a10[_0xf8dc('0x30')](0xcc)[_0xf8dc('0x31')]();});}};}function handleEntityNotFound(_0x39542a,_0x76c538){return function(_0x1ef0f9){if(!_0x1ef0f9){_0x39542a[_0xf8dc('0x2f')](0x194);}return _0x1ef0f9;};}function handleError(_0x1bb8d9,_0x2936ee){_0x2936ee=_0x2936ee||0x1f4;return function(_0x221676){logger[_0xf8dc('0x2b')](_0x221676['stack']);if(_0x221676[_0xf8dc('0x3d')]){delete _0x221676[_0xf8dc('0x3d')];}_0x1bb8d9[_0xf8dc('0x30')](_0x2936ee)['send'](_0x221676);};}exports['index']=function(_0x4d33a1,_0x1cc766){var _0x3f6d72={'include':[{'model':db[_0xf8dc('0x3e')],'as':_0xf8dc('0x3f')}]},_0x21134b={},_0x55b9d7={'count':0x0,'rows':[]};var _0x5705f7=_[_0xf8dc('0x40')](db[_0xf8dc('0x41')][_0xf8dc('0x42')],function(_0x5a0ef8){return{'name':_0x5a0ef8[_0xf8dc('0x43')],'type':_0x5a0ef8['type']['key']};});_0x21134b[_0xf8dc('0x44')]=_[_0xf8dc('0x40')](_0x5705f7,'name');_0x21134b[_0xf8dc('0x45')]=_['keys'](_0x4d33a1[_0xf8dc('0x45')]);_0x21134b[_0xf8dc('0x46')]=_['intersection'](_0x21134b[_0xf8dc('0x44')],_0x21134b['query']);_0x3f6d72[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0x21134b[_0xf8dc('0x44')],qs[_0xf8dc('0x49')](_0x4d33a1[_0xf8dc('0x45')][_0xf8dc('0x49')]));_0x3f6d72[_0xf8dc('0x47')]=_0x3f6d72[_0xf8dc('0x47')]['length']?_0x3f6d72['attributes']:_0x21134b[_0xf8dc('0x44')];if(!_0x4d33a1[_0xf8dc('0x45')][_0xf8dc('0x4a')](_0xf8dc('0x4b'))){_0x3f6d72[_0xf8dc('0x4c')]=qs['limit'](_0x4d33a1['query']['limit']);_0x3f6d72[_0xf8dc('0x34')]=qs[_0xf8dc('0x34')](_0x4d33a1[_0xf8dc('0x45')][_0xf8dc('0x34')]);}_0x3f6d72['order']=qs[_0xf8dc('0x4d')](_0x4d33a1['query'][_0xf8dc('0x4d')]);_0x3f6d72[_0xf8dc('0x4e')]=qs[_0xf8dc('0x46')](_[_0xf8dc('0x4f')](_0x4d33a1[_0xf8dc('0x45')],_0x21134b[_0xf8dc('0x46')]),_0x5705f7);if(_0x4d33a1[_0xf8dc('0x45')][_0xf8dc('0x50')]){_0x3f6d72['where']=_[_0xf8dc('0x51')](_0x3f6d72[_0xf8dc('0x4e')],{'$or':_['map'](_0x5705f7,function(_0x141af2){if(_0x141af2['type']!==_0xf8dc('0x52')){var _0x237b09={};_0x237b09[_0x141af2['name']]={'$like':'%'+_0x4d33a1['query'][_0xf8dc('0x50')]+'%'};return _0x237b09;}})});}_0x3f6d72=_[_0xf8dc('0x51')]({},_0x3f6d72,_0x4d33a1['options']);var _0x407c83={'where':_0x3f6d72[_0xf8dc('0x4e')]};return db[_0xf8dc('0x41')][_0xf8dc('0x33')](_0x407c83)['then'](function(_0x4f1303){_0x55b9d7[_0xf8dc('0x33')]=_0x4f1303;if(_0x4d33a1[_0xf8dc('0x45')][_0xf8dc('0x53')]){_0x3f6d72[_0xf8dc('0x54')]=[{'all':!![]}];}return db[_0xf8dc('0x41')][_0xf8dc('0x55')](_0x3f6d72);})['then'](function(_0x3fab07){_0x55b9d7[_0xf8dc('0x56')]=_0x3fab07;return _0x55b9d7;})['then'](respondWithFilteredResult(_0x1cc766,_0x3f6d72))['catch'](handleError(_0x1cc766,null));};exports[_0xf8dc('0x57')]=function(_0x5bb62a,_0x312f42){var _0x3369f3={'raw':![],'where':{'id':_0x5bb62a[_0xf8dc('0x58')]['id']},'include':[{'model':db[_0xf8dc('0x3e')],'as':_0xf8dc('0x3f')}]},_0x5e6021={};_0x5e6021[_0xf8dc('0x44')]=_[_0xf8dc('0x59')](db[_0xf8dc('0x41')][_0xf8dc('0x42')]);_0x5e6021[_0xf8dc('0x45')]=_[_0xf8dc('0x59')](_0x5bb62a[_0xf8dc('0x45')]);_0x5e6021[_0xf8dc('0x46')]=_[_0xf8dc('0x48')](_0x5e6021['model'],_0x5e6021[_0xf8dc('0x45')]);_0x3369f3[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0x5e6021['model'],qs[_0xf8dc('0x49')](_0x5bb62a[_0xf8dc('0x45')]['fields']));_0x3369f3['attributes']=_0x3369f3[_0xf8dc('0x47')]['length']?_0x3369f3[_0xf8dc('0x47')]:_0x5e6021[_0xf8dc('0x44')];if(_0x5bb62a['query'][_0xf8dc('0x53')]){_0x3369f3[_0xf8dc('0x54')]=[{'all':!![]}];}_0x3369f3=_['merge']({},_0x3369f3,_0x5bb62a['options']);return db[_0xf8dc('0x41')][_0xf8dc('0x5a')](_0x3369f3)[_0xf8dc('0x24')](handleEntityNotFound(_0x312f42,null))[_0xf8dc('0x24')](respondWithResult(_0x312f42,null))[_0xf8dc('0x2e')](handleError(_0x312f42,null));};exports['create']=function(_0x160d12,_0xc404a5){return db[_0xf8dc('0x41')][_0xf8dc('0x5b')](_0x160d12['body'],{})[_0xf8dc('0x24')](function(_0x32004e){var _0x4657ea=_0x160d12['user'][_0xf8dc('0x5c')]({'plain':!![]});if(!_0x4657ea)throw new Error(_0xf8dc('0x5d'));if(_0x4657ea[_0xf8dc('0x5e')]===_0xf8dc('0x5f')){var _0x5eac5b=_0x32004e['get']({'plain':!![]});var _0x1cecfc=_0xf8dc('0x60');return db['UserProfileSection'][_0xf8dc('0x5a')]({'where':{'name':_0x1cecfc,'userProfileId':_0x4657ea['userProfileId']},'raw':!![]})[_0xf8dc('0x24')](function(_0x2d4f47){if(_0x2d4f47&&_0x2d4f47[_0xf8dc('0x61')]===0x0){return db['UserProfileResource'][_0xf8dc('0x5b')]({'name':_0x5eac5b['name'],'resourceId':_0x5eac5b['id'],'type':_0x2d4f47['name'],'sectionId':_0x2d4f47['id']},{})[_0xf8dc('0x24')](function(){return _0x32004e;});}else{return _0x32004e;}})[_0xf8dc('0x2e')](function(_0x499c20){logger[_0xf8dc('0x2b')](_0xf8dc('0x62'),_0x499c20);throw _0x499c20;});}return _0x32004e;})[_0xf8dc('0x24')](respondWithResult(_0xc404a5,0xc9))['catch'](handleError(_0xc404a5,null));};exports[_0xf8dc('0x3a')]=function(_0x40403a,_0x13bb3a){if(_0x40403a['body']['id']){delete _0x40403a[_0xf8dc('0x63')]['id'];}return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0x40403a[_0xf8dc('0x58')]['id']},'include':[{'model':db[_0xf8dc('0x3e')],'as':_0xf8dc('0x3f')}]})[_0xf8dc('0x24')](handleEntityNotFound(_0x13bb3a,null))[_0xf8dc('0x24')](saveUpdates(_0x40403a[_0xf8dc('0x63')],null))['then'](respondWithResult(_0x13bb3a,null))[_0xf8dc('0x2e')](handleError(_0x13bb3a,null));};exports[_0xf8dc('0x3b')]=function(_0x2ab3d9,_0x30a013){return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0x2ab3d9['params']['id']}})['then'](handleEntityNotFound(_0x30a013,null))[_0xf8dc('0x24')](removeEntity(_0x30a013,null))[_0xf8dc('0x2e')](handleError(_0x30a013,null));};exports[_0xf8dc('0x64')]=function(_0x29d350,_0x58e594){return db[_0xf8dc('0x41')][_0xf8dc('0x64')]()[_0xf8dc('0x24')](respondWithResult(_0x58e594,null))[_0xf8dc('0x2e')](handleError(_0x58e594,null));};exports[_0xf8dc('0x65')]=function(_0x6ce961,_0xdff28f,_0x26eb16){if(_0x6ce961[_0xf8dc('0x63')]['id']){delete _0x6ce961[_0xf8dc('0x63')]['id'];}return db[_0xf8dc('0x41')]['find']({'where':{'id':_0x6ce961['params']['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0xdff28f,null))[_0xf8dc('0x24')](function(_0x372fc6){if(_0x372fc6){_0x6ce961[_0xf8dc('0x63')][_0xf8dc('0x66')]=_0x372fc6['id'];return db[_0xf8dc('0x67')][_0xf8dc('0x5b')](_0x6ce961['body']);}})[_0xf8dc('0x24')](respondWithResult(_0xdff28f,null))[_0xf8dc('0x2e')](handleError(_0xdff28f,null));};exports[_0xf8dc('0x68')]=function(_0x19df2d,_0x5adeab,_0x22c918){var _0x2adcea={'raw':![],'where':{}};var _0x2afc45={};var _0x382b4a={'count':0x0,'rows':[]};return db[_0xf8dc('0x41')]['findOne']({'where':{'id':_0x19df2d[_0xf8dc('0x58')]['id']}})['then'](handleEntityNotFound(_0x5adeab,null))[_0xf8dc('0x24')](function(_0x1c6eae){if(_0x1c6eae){_0x2afc45['model']=_[_0xf8dc('0x59')](db['Disposition'][_0xf8dc('0x42')]);_0x2afc45['query']=_[_0xf8dc('0x59')](_0x19df2d[_0xf8dc('0x45')]);_0x2afc45[_0xf8dc('0x46')]=_[_0xf8dc('0x48')](_0x2afc45[_0xf8dc('0x44')],_0x2afc45[_0xf8dc('0x45')]);_0x2adcea[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0x2afc45['model'],qs[_0xf8dc('0x49')](_0x19df2d[_0xf8dc('0x45')]['fields']));_0x2adcea[_0xf8dc('0x47')]=_0x2adcea[_0xf8dc('0x47')]['length']?_0x2adcea[_0xf8dc('0x47')]:_0x2afc45['model'];if(!_0x19df2d[_0xf8dc('0x45')][_0xf8dc('0x4a')](_0xf8dc('0x4b'))){_0x2adcea[_0xf8dc('0x4c')]=qs[_0xf8dc('0x4c')](_0x19df2d[_0xf8dc('0x45')][_0xf8dc('0x4c')]);_0x2adcea[_0xf8dc('0x34')]=qs[_0xf8dc('0x34')](_0x19df2d[_0xf8dc('0x45')][_0xf8dc('0x34')]);}_0x2adcea[_0xf8dc('0x69')]=qs[_0xf8dc('0x4d')](_0x19df2d[_0xf8dc('0x45')][_0xf8dc('0x4d')]);_0x2adcea[_0xf8dc('0x4e')]=qs[_0xf8dc('0x46')](_['pick'](_0x19df2d[_0xf8dc('0x45')],_0x2afc45['filters']));_0x2adcea['where'][_0xf8dc('0x6a')]=_0x1c6eae['id'];if(_0x19df2d[_0xf8dc('0x45')]['filter']){_0x2adcea['where']=_[_0xf8dc('0x51')](_0x2adcea['where'],{'$or':_['map'](_0x2adcea[_0xf8dc('0x47')],function(_0x590b42){var _0x2243ca={};_0x2243ca[_0x590b42]={'$like':'%'+_0x19df2d['query'][_0xf8dc('0x50')]+'%'};return _0x2243ca;})});}_0x2adcea=_[_0xf8dc('0x51')]({},_0x2adcea,_0x19df2d[_0xf8dc('0x6b')]);return db['Disposition'][_0xf8dc('0x33')]({'where':_0x2adcea['where']})[_0xf8dc('0x24')](function(_0x3fd2cf){_0x382b4a[_0xf8dc('0x33')]=_0x3fd2cf;if(_0x19df2d['query']['includeAll']){_0x2adcea[_0xf8dc('0x54')]=[{'all':!![]}];}return db[_0xf8dc('0x67')][_0xf8dc('0x55')](_0x2adcea);})[_0xf8dc('0x24')](function(_0x4dbd75){_0x382b4a['rows']=_0x4dbd75;return _0x382b4a;});}})[_0xf8dc('0x24')](respondWithFilteredResult(_0x5adeab,_0x2adcea))['catch'](handleError(_0x5adeab,null));};exports[_0xf8dc('0x6c')]=function(_0x1e8102,_0x436738,_0x4ba040){return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0x1e8102[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x436738,null))['then'](function(_0x54423e){if(_0x54423e){return _0x54423e[_0xf8dc('0x6c')](_0x1e8102[_0xf8dc('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x436738,null))[_0xf8dc('0x2e')](handleError(_0x436738,null));};exports['addAnswer']=function(_0x41d07e,_0x31e0a0,_0x41afb5){if(_0x41d07e['body']['id']){delete _0x41d07e[_0xf8dc('0x63')]['id'];}return db['OpenchannelAccount'][_0xf8dc('0x5a')]({'where':{'id':_0x41d07e['params']['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x31e0a0,null))['then'](function(_0x4f1107){if(_0x4f1107){_0x41d07e[_0xf8dc('0x63')][_0xf8dc('0x6a')]=_0x4f1107['id'];return db['CannedAnswer'][_0xf8dc('0x5b')](_0x41d07e['body']);}})['then'](respondWithResult(_0x31e0a0,null))[_0xf8dc('0x2e')](handleError(_0x31e0a0,null));};exports[_0xf8dc('0x6d')]=function(_0x4b6a41,_0x237130,_0x59f632){var _0x3349c7={'raw':![],'where':{}};var _0xc2962f={};var _0x3c7945={'count':0x0,'rows':[]};return db[_0xf8dc('0x41')]['findOne']({'where':{'id':_0x4b6a41[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x237130,null))[_0xf8dc('0x24')](function(_0x3daefd){if(_0x3daefd){_0xc2962f[_0xf8dc('0x44')]=_[_0xf8dc('0x59')](db[_0xf8dc('0x6e')]['rawAttributes']);_0xc2962f[_0xf8dc('0x45')]=_[_0xf8dc('0x59')](_0x4b6a41[_0xf8dc('0x45')]);_0xc2962f[_0xf8dc('0x46')]=_[_0xf8dc('0x48')](_0xc2962f[_0xf8dc('0x44')],_0xc2962f[_0xf8dc('0x45')]);_0x3349c7[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0xc2962f['model'],qs[_0xf8dc('0x49')](_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x49')]));_0x3349c7[_0xf8dc('0x47')]=_0x3349c7['attributes'][_0xf8dc('0x6f')]?_0x3349c7['attributes']:_0xc2962f['model'];if(!_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x4a')](_0xf8dc('0x4b'))){_0x3349c7[_0xf8dc('0x4c')]=qs['limit'](_0x4b6a41[_0xf8dc('0x45')]['limit']);_0x3349c7[_0xf8dc('0x34')]=qs[_0xf8dc('0x34')](_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x34')]);}_0x3349c7[_0xf8dc('0x69')]=qs[_0xf8dc('0x4d')](_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x4d')]);_0x3349c7[_0xf8dc('0x4e')]=qs['filters'](_[_0xf8dc('0x4f')](_0x4b6a41[_0xf8dc('0x45')],_0xc2962f[_0xf8dc('0x46')]));_0x3349c7['where'][_0xf8dc('0x6a')]=_0x3daefd['id'];if(_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x50')]){_0x3349c7[_0xf8dc('0x4e')]=_[_0xf8dc('0x51')](_0x3349c7[_0xf8dc('0x4e')],{'$or':_[_0xf8dc('0x40')](_0x3349c7[_0xf8dc('0x47')],function(_0x2d7543){var _0x45acc6={};_0x45acc6[_0x2d7543]={'$like':'%'+_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x50')]+'%'};return _0x45acc6;})});}_0x3349c7=_[_0xf8dc('0x51')]({},_0x3349c7,_0x4b6a41[_0xf8dc('0x6b')]);return db[_0xf8dc('0x6e')][_0xf8dc('0x33')]({'where':_0x3349c7['where']})[_0xf8dc('0x24')](function(_0x5604d0){_0x3c7945[_0xf8dc('0x33')]=_0x5604d0;if(_0x4b6a41[_0xf8dc('0x45')][_0xf8dc('0x53')]){_0x3349c7[_0xf8dc('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf8dc('0x55')](_0x3349c7);})['then'](function(_0x4f6ea6){_0x3c7945['rows']=_0x4f6ea6;return _0x3c7945;});}})[_0xf8dc('0x24')](respondWithFilteredResult(_0x237130,_0x3349c7))['catch'](handleError(_0x237130,null));};exports[_0xf8dc('0x70')]=function(_0x1aed90,_0x3f346d,_0x120e8a){return db[_0xf8dc('0x41')]['find']({'where':{'id':_0x1aed90[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x3f346d,null))[_0xf8dc('0x24')](function(_0x4a1d23){if(_0x4a1d23){return _0x4a1d23[_0xf8dc('0x70')](_0x1aed90[_0xf8dc('0x45')][_0xf8dc('0x71')]);}})[_0xf8dc('0x24')](respondWithStatusCode(_0x3f346d,null))[_0xf8dc('0x2e')](handleError(_0x3f346d,null));};exports[_0xf8dc('0x72')]=function(_0x338b8e,_0xaa9d6c,_0x44b2c6){var _0x1322a8={'body':_0x338b8e[_0xf8dc('0x63')],'channel':_0xf8dc('0x73')};var _0x31b8d3=[];var _0x354b60=[];var _0x5a2604={};var _0x3ae360=![];return db[_0xf8dc('0x74')]['describe']()[_0xf8dc('0x24')](function(_0x41804b){if(!_0x41804b){throw new db[(_0xf8dc('0x21'))][(_0xf8dc('0x75'))]('no\x20available\x20attributes');}_0x31b8d3=_[_0xf8dc('0x76')](_['keys'](_0x41804b),[_0xf8dc('0x77'),_0xf8dc('0x78')]);_0x354b60=_[_0xf8dc('0x76')](_[_0xf8dc('0x59')](_0x41804b),['createdAt',_0xf8dc('0x78'),'CompanyId',_0xf8dc('0x79')]);if(_0x338b8e['body']['id']){delete _0x338b8e['body']['id'];}if(_['isNil'](_0x338b8e[_0xf8dc('0x63')]['from'])){throw new db[(_0xf8dc('0x21'))][(_0xf8dc('0x75'))]('from\x20is\x20mandatory');}if(_[_0xf8dc('0x7a')](_0x338b8e['body']['body'])||_0x338b8e['body'][_0xf8dc('0x63')]===''){throw new db[(_0xf8dc('0x21'))][(_0xf8dc('0x75'))](_0xf8dc('0x7b'));}if(_['isNil'](_0x338b8e[_0xf8dc('0x63')]['mapKey'])){throw new db['Sequelize'][(_0xf8dc('0x75'))](_0xf8dc('0x7c')+_0x354b60);}if(!_[_0xf8dc('0x7d')](_0x354b60,_0x338b8e[_0xf8dc('0x63')]['mapKey'])){throw new db[(_0xf8dc('0x21'))]['ValidationError'](_0xf8dc('0x7e')+_0x354b60);}_0x5a2604[_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x7f')]]=_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x80')];})['then'](function(){return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0x338b8e[_0xf8dc('0x58')]['id']},'include':[{'model':db[_0xf8dc('0x81')],'as':'List','include':[{'model':db[_0xf8dc('0x74')],'as':_0xf8dc('0x82'),'where':_0x5a2604,'limit':0x1,'order':[[_0xf8dc('0x78'),_0xf8dc('0x83')]]}]},{'model':db[_0xf8dc('0x84')],'as':_0xf8dc('0x85')}]});})[_0xf8dc('0x24')](handleEntityNotFound(_0xaa9d6c,null))[_0xf8dc('0x24')](function(_0x45fc50){if(_0x45fc50&&_0x45fc50[_0xf8dc('0x86')]){_0x1322a8[_0xf8dc('0x87')]=_0x45fc50;_0x1322a8[_0xf8dc('0x88')]=_0x45fc50['Applications'];_0x1322a8[_0xf8dc('0x89')]=_0x45fc50[_0xf8dc('0x86')];_0x1322a8[_0xf8dc('0x88')]=_[_0xf8dc('0x8a')](_0x1322a8[_0xf8dc('0x88')],[_0xf8dc('0x8b')],['asc']);if(_0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x85')]){delete _0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x85')];}if(_0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x86')]&&_0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x86')][_0xf8dc('0x82')]['length']){return _0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x86')]['Contacts'][0x0];}var _0x350072=_['defaults'](_0x338b8e[_0xf8dc('0x63')],{'firstName':_0x338b8e[_0xf8dc('0x63')]['from'],'ListId':_0x45fc50['ListId']});_0x350072[_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x7f')]]=_0x338b8e['body']['from'];return db[_0xf8dc('0x74')]['create'](_0x350072,{'fields':_0x31b8d3,'raw':!![]});}})[_0xf8dc('0x24')](handleEntityNotFound(_0xaa9d6c,null))['then'](function(_0x4bff18){_0x1322a8[_0xf8dc('0x8c')]=_0x4bff18;if(_0x4bff18){var _0x22fabd={'ContactId':_0x4bff18['id'],'OpenchannelAccountId':_0x338b8e[_0xf8dc('0x58')]['id'],'from':(_0x4bff18[_0xf8dc('0x8d')]||'')+'\x20'+(_0x4bff18['lastName']||'')};var _0x148eaf={'OpenchannelAccountId':_0x338b8e[_0xf8dc('0x58')]['id'],'closed':![]};if(_0x338b8e[_0xf8dc('0x63')]['threadId']){_0x148eaf[_0xf8dc('0x8e')]=_0x338b8e['body'][_0xf8dc('0x8e')];return db[_0xf8dc('0x8f')]['find']({'where':_0x148eaf})[_0xf8dc('0x24')](function(_0x157113){if(_0x157113){return[_0x157113,![]];}_0x22fabd[_0xf8dc('0x8e')]=_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x8e')];_0x22fabd['externalUrl']=_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x90')];return db[_0xf8dc('0x8f')][_0xf8dc('0x5b')](_0x22fabd)['then'](function(_0x4b0757){return[_0x4b0757,!![]];});});}else{_0x148eaf[_0xf8dc('0x8e')]=null;}_0x148eaf[_0xf8dc('0x91')]=_0x4bff18['id'];return db[_0xf8dc('0x8f')][_0xf8dc('0x5a')]({'where':_0x148eaf})[_0xf8dc('0x24')](function(_0x287bba){if(_0x287bba){return[_0x287bba,![]];}return db[_0xf8dc('0x8f')][_0xf8dc('0x5b')](_0x22fabd)[_0xf8dc('0x24')](function(_0xd79f70){return[_0xd79f70,!![]];});});}})[_0xf8dc('0x92')](function(_0x5dd986,_0x575832){if(_0x5dd986){_0x3ae360=_0x575832;if(!_0x575832){var _0x1c9bbd={'from':(_0x1322a8[_0xf8dc('0x8c')][_0xf8dc('0x8d')]||'')+'\x20'+(_0x1322a8[_0xf8dc('0x8c')]['lastName']||'')};if(_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x8e')]&&_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x93')]&&_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x8e')]!=_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x93')]){_0x1c9bbd[_0xf8dc('0x8e')]=_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x93')];}return _0x5dd986[_0xf8dc('0x3a')](_0x1c9bbd);}else{return _0x5dd986;}}})['then'](function(_0x17e9f4){_0x1322a8[_0xf8dc('0x94')]=_0x17e9f4[_0xf8dc('0x5c')]({'plain':!![]});_0x1322a8[_0xf8dc('0x94')][_0xf8dc('0x95')]=_0x3ae360;if(_0x1322a8[_0xf8dc('0x94')][_0xf8dc('0x95')]){if(_0x1322a8[_0xf8dc('0x87')]['autoclose']){_0x1322a8[_0xf8dc('0x88')][_0xf8dc('0x96')]({'id':0x0,'priority':_0x1322a8[_0xf8dc('0x88')][_0xf8dc('0x6f')]+0x1,'app':'close','appdata':_0xf8dc('0x97'),'interval':_0xf8dc('0x98')});}}return db[_0xf8dc('0x99')]['create']({'body':_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x63')],'OpenchannelAccountId':_0x338b8e[_0xf8dc('0x58')]['id'],'OpenchannelInteractionId':_0x17e9f4['id'],'direction':'in','ContactId':_0x1322a8['contact']['id'],'AttachmentId':_0x338b8e[_0xf8dc('0x63')][_0xf8dc('0x9a')]});})['then'](function(_0x1e6260){_0x1322a8[_0xf8dc('0x2d')]=_0x1e6260;if(_0x1322a8[_0xf8dc('0x94')][_0xf8dc('0x9b')]){return db[_0xf8dc('0x9c')][_0xf8dc('0x5a')]({'attributes':['id',_0xf8dc('0x3d')],'where':{'id':_0x1322a8[_0xf8dc('0x94')][_0xf8dc('0x9b')]}})[_0xf8dc('0x24')](function(_0x4823ff){if(_0x4823ff){_0x1322a8['applications'][_0xf8dc('0x9d')]({'id':0x0,'priority':0x0,'app':_0xf8dc('0x9e'),'appdata':_0x4823ff[_0xf8dc('0x3d')]+','+(_0x1322a8[_0xf8dc('0x87')][_0xf8dc('0x9f')]||0xa),'interval':_0xf8dc('0x98')});_0x1322a8[_0xf8dc('0xa0')]=![];}return respondWithRpcPromise(_0xf8dc('0xa1'),'startRouting',_0x1322a8);});}return respondWithRpcPromise(_0xf8dc('0xa1'),_0xf8dc('0xa2'),_0x1322a8);})[_0xf8dc('0x24')](function(_0x9b3ea4){respondWithRpcPromise(_0xf8dc('0xa3'),_0xf8dc('0xa3'),{'event':_0xf8dc('0x72'),'message':_0x9b3ea4},client9002);return _0x9b3ea4;})[_0xf8dc('0x24')](respondWithResult(_0xaa9d6c,null))[_0xf8dc('0x2e')](handleError(_0xaa9d6c,null));};exports[_0xf8dc('0xa4')]=function(_0x32e376,_0x260cce,_0x534d1f){return db['OpenchannelAccount'][_0xf8dc('0xa5')]({'where':{'id':_0x32e376[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x260cce,null))['then'](function(_0x59516f){if(_0x59516f){return db['sequelize'][_0xf8dc('0xa6')](function(_0x2773ea){return db[_0xf8dc('0x84')][_0xf8dc('0x3b')]({'where':{'OpenchannelAccountId':_0x32e376[_0xf8dc('0x58')]['id']},'transaction':_0x2773ea})[_0xf8dc('0x24')](function(_0x1a4426){var _0xe33981=_[_0xf8dc('0x40')](_0x32e376[_0xf8dc('0x63')],function(_0x30c73a){_0x30c73a[_0xf8dc('0x6a')]=_0x32e376[_0xf8dc('0x58')]['id'];return _0x30c73a;});return db[_0xf8dc('0x84')]['bulkCreate'](_0xe33981,{'transaction':_0x2773ea});});})[_0xf8dc('0x24')](function(){return db[_0xf8dc('0x84')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x32e376[_0xf8dc('0x58')]['id']},'order':_0xf8dc('0x8b')});});}})[_0xf8dc('0x24')](respondWithResult(_0x260cce,null))['catch'](handleError(_0x260cce,null));};exports[_0xf8dc('0xa7')]=function(_0x2ef0ca,_0x4ea957,_0x4e5bb0){var _0x3217b7={};var _0xe19d1e={};var _0x5eab09;var _0x445842;return db[_0xf8dc('0x41')][_0xf8dc('0xa5')]({'where':{'id':_0x2ef0ca[_0xf8dc('0x58')]['id']}})['then'](handleEntityNotFound(_0x4ea957,null))[_0xf8dc('0x24')](function(_0xa7448){if(_0xa7448){_0x5eab09=_0xa7448;_0xe19d1e['model']=_[_0xf8dc('0x59')](db[_0xf8dc('0x84')][_0xf8dc('0x42')]);_0xe19d1e[_0xf8dc('0x45')]=_['keys'](_0x2ef0ca['query']);_0xe19d1e[_0xf8dc('0x46')]=_[_0xf8dc('0x48')](_0xe19d1e[_0xf8dc('0x44')],_0xe19d1e[_0xf8dc('0x45')]);_0x3217b7[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0xe19d1e[_0xf8dc('0x44')],qs[_0xf8dc('0x49')](_0x2ef0ca['query'][_0xf8dc('0x49')]));_0x3217b7['attributes']=_0x3217b7[_0xf8dc('0x47')][_0xf8dc('0x6f')]?_0x3217b7[_0xf8dc('0x47')]:_0xe19d1e[_0xf8dc('0x44')];_0x3217b7[_0xf8dc('0x69')]=qs['sort'](_0x2ef0ca['query'][_0xf8dc('0x4d')]);_0x3217b7[_0xf8dc('0x4e')]=qs[_0xf8dc('0x46')](_['pick'](_0x2ef0ca['query'],_0xe19d1e[_0xf8dc('0x46')]));if(_0x2ef0ca[_0xf8dc('0x45')][_0xf8dc('0x50')]){_0x3217b7[_0xf8dc('0x4e')]=_[_0xf8dc('0x51')](_0x3217b7[_0xf8dc('0x4e')],{'$or':_[_0xf8dc('0x40')](_0x3217b7[_0xf8dc('0x47')],function(_0x368e54){var _0x4a0319={};_0x4a0319[_0x368e54]={'$like':'%'+_0x2ef0ca[_0xf8dc('0x45')][_0xf8dc('0x50')]+'%'};return _0x4a0319;})});}_0x3217b7=_[_0xf8dc('0x51')]({},_0x3217b7,_0x2ef0ca[_0xf8dc('0x6b')]);return _0x5eab09[_0xf8dc('0xa7')](_0x3217b7);}})[_0xf8dc('0x24')](function(_0x5d2561){if(_0x5d2561){_0x445842=_0x5d2561[_0xf8dc('0x6f')];if(!_0x2ef0ca[_0xf8dc('0x45')][_0xf8dc('0x4a')](_0xf8dc('0x4b'))){_0x3217b7['limit']=qs[_0xf8dc('0x4c')](_0x2ef0ca[_0xf8dc('0x45')][_0xf8dc('0x4c')]);_0x3217b7[_0xf8dc('0x34')]=qs[_0xf8dc('0x34')](_0x2ef0ca['query'][_0xf8dc('0x34')]);}return _0x5eab09[_0xf8dc('0xa7')](_0x3217b7);}})['then'](function(_0x3b5a8f){if(_0x3b5a8f){return _0x3b5a8f?{'count':_0x445842,'rows':_0x3b5a8f}:null;}})[_0xf8dc('0x24')](respondWithResult(_0x4ea957,null))[_0xf8dc('0x2e')](handleError(_0x4ea957,null));};exports[_0xf8dc('0xa8')]=function(_0x5f557f,_0x2b53ed,_0x34807a){var _0x1784b8={'raw':![],'where':{}};var _0x5497e7={};var _0x1713b0={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf8dc('0xa5')]({'where':{'id':_0x5f557f['params']['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x2b53ed,null))[_0xf8dc('0x24')](function(_0xf8112a){if(_0xf8112a){_0x5497e7[_0xf8dc('0x44')]=_[_0xf8dc('0x59')](db[_0xf8dc('0x8f')][_0xf8dc('0x42')]);_0x5497e7[_0xf8dc('0x45')]=_['keys'](_0x5f557f[_0xf8dc('0x45')]);_0x5497e7['filters']=_['intersection'](_0x5497e7[_0xf8dc('0x44')],_0x5497e7['query']);_0x1784b8[_0xf8dc('0x47')]=_['intersection'](_0x5497e7['model'],qs[_0xf8dc('0x49')](_0x5f557f['query'][_0xf8dc('0x49')]));_0x1784b8[_0xf8dc('0x47')]=_0x1784b8[_0xf8dc('0x47')][_0xf8dc('0x6f')]?_0x1784b8['attributes']:_0x5497e7[_0xf8dc('0x44')];if(!_0x5f557f[_0xf8dc('0x45')][_0xf8dc('0x4a')](_0xf8dc('0x4b'))){_0x1784b8['limit']=qs[_0xf8dc('0x4c')](_0x5f557f[_0xf8dc('0x45')][_0xf8dc('0x4c')]);_0x1784b8['offset']=qs[_0xf8dc('0x34')](_0x5f557f[_0xf8dc('0x45')][_0xf8dc('0x34')]);}_0x1784b8[_0xf8dc('0x69')]=qs[_0xf8dc('0x4d')](_0x5f557f[_0xf8dc('0x45')]['sort']);_0x1784b8['where']=qs[_0xf8dc('0x46')](_[_0xf8dc('0x4f')](_0x5f557f[_0xf8dc('0x45')],_0x5497e7['filters']));_0x1784b8['where'][_0xf8dc('0x6a')]=_0xf8112a['id'];if(_0x5f557f['query'][_0xf8dc('0x50')]){_0x1784b8[_0xf8dc('0x4e')]=_[_0xf8dc('0x51')](_0x1784b8[_0xf8dc('0x4e')],{'$or':_['map'](_0x1784b8[_0xf8dc('0x47')],function(_0x1629e3){var _0x5ea46c={};_0x5ea46c[_0x1629e3]={'$like':'%'+_0x5f557f[_0xf8dc('0x45')]['filter']+'%'};return _0x5ea46c;})});}_0x1784b8=_[_0xf8dc('0x51')]({},_0x1784b8,_0x5f557f[_0xf8dc('0x6b')]);return db[_0xf8dc('0x8f')]['count']({'where':_0x1784b8['where']})[_0xf8dc('0x24')](function(_0x5ef417){_0x1713b0[_0xf8dc('0x33')]=_0x5ef417;if(_0x5f557f[_0xf8dc('0x45')]['includeAll']){_0x1784b8[_0xf8dc('0x54')]=[{'model':db[_0xf8dc('0x74')],'as':'Contact','required':![]},{'model':db[_0xf8dc('0x9c')],'as':_0xf8dc('0xa9'),'attributes':[_0xf8dc('0x3d'),_0xf8dc('0xaa'),_0xf8dc('0xab')],'required':![]},{'model':db[_0xf8dc('0xac')],'as':_0xf8dc('0xad'),'attributes':['id',_0xf8dc('0x3d'),_0xf8dc('0xae')],'where':_0x5f557f[_0xf8dc('0x45')][_0xf8dc('0xaf')]?{'id':_0x5f557f['query'][_0xf8dc('0xaf')]}:undefined,'required':_0x5f557f[_0xf8dc('0x45')][_0xf8dc('0xaf')]?!![]:![]}];}return db[_0xf8dc('0x8f')][_0xf8dc('0x55')](_0x1784b8);})['then'](function(_0x5b2513){_0x1713b0['rows']=_0x5b2513;return _0x1713b0;});}})[_0xf8dc('0x24')](respondWithFilteredResult(_0x2b53ed,_0x1784b8))[_0xf8dc('0x2e')](handleError(_0x2b53ed,null));};exports[_0xf8dc('0xb0')]=function(_0x389664,_0x4453f5,_0x2db0c2){return db[_0xf8dc('0x41')]['find']({'where':{'id':_0x389664[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x4453f5,null))['then'](function(_0x400fe4){if(_0x400fe4){return _0x400fe4[_0xf8dc('0xb0')](_0x389664[_0xf8dc('0x63')][_0xf8dc('0x71')],_[_0xf8dc('0xb1')](_0x389664[_0xf8dc('0x63')],[_0xf8dc('0x71'),'id'])||{})['spread'](function(_0x260f4f){for(var _0x5684b4=0x0;_0x5684b4<_0x389664[_0xf8dc('0x63')][_0xf8dc('0x71')][_0xf8dc('0x6f')];_0x5684b4+=0x1){socket[_0xf8dc('0xb2')]('userOpenchannelAccount:save',{'UserId':_0x389664[_0xf8dc('0x63')]['ids'][_0x5684b4],'OpenchannelAccountId':_0x389664['params']['id']});}return _0x260f4f;});}})[_0xf8dc('0x24')](respondWithResult(_0x4453f5,null))['catch'](handleError(_0x4453f5,null));};exports['removeAgents']=function(_0xdda1ca,_0xdbd7e1,_0x360d70){return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0xdda1ca[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0xdbd7e1,null))['then'](function(_0xd431c0){if(_0xd431c0){return _0xd431c0[_0xf8dc('0xb3')](_0xdda1ca[_0xf8dc('0x45')][_0xf8dc('0x71')])[_0xf8dc('0x24')](function(){if(_[_0xf8dc('0xb4')](_0xdda1ca[_0xf8dc('0x45')][_0xf8dc('0x71')])){for(var _0x26c8cd=0x0;_0x26c8cd<_0xdda1ca['query'][_0xf8dc('0x71')][_0xf8dc('0x6f')];_0x26c8cd+=0x1){socket[_0xf8dc('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0xdda1ca[_0xf8dc('0x45')][_0xf8dc('0x71')][_0x26c8cd]),'OpenchannelAccountId':Number(_0xdda1ca[_0xf8dc('0x58')]['id'])});}}else{socket[_0xf8dc('0xb2')](_0xf8dc('0xb5'),{'UserId':Number(_0xdda1ca[_0xf8dc('0x45')][_0xf8dc('0x71')]),'OpenchannelAccountId':Number(_0xdda1ca[_0xf8dc('0x58')]['id'])});}});}})[_0xf8dc('0x24')](respondWithStatusCode(_0xdbd7e1,null))[_0xf8dc('0x2e')](handleError(_0xdbd7e1,null));};exports[_0xf8dc('0xb6')]=function(_0x4c5aa3,_0x397956,_0xf47db2){var _0x1ee95a={};var _0x2cae36={};var _0x3b3186;var _0x542627;return db[_0xf8dc('0x41')]['findOne']({'where':{'id':_0x4c5aa3[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x397956,null))[_0xf8dc('0x24')](function(_0xf6e629){if(_0xf6e629){_0x3b3186=_0xf6e629;_0x2cae36[_0xf8dc('0x44')]=_[_0xf8dc('0x59')](db[_0xf8dc('0x9c')]['rawAttributes']);_0x2cae36[_0xf8dc('0x45')]=_['keys'](_0x4c5aa3[_0xf8dc('0x45')]);_0x2cae36[_0xf8dc('0x46')]=_[_0xf8dc('0x48')](_0x2cae36['model'],_0x2cae36['query']);_0x1ee95a[_0xf8dc('0x47')]=_[_0xf8dc('0x48')](_0x2cae36[_0xf8dc('0x44')],qs[_0xf8dc('0x49')](_0x4c5aa3[_0xf8dc('0x45')]['fields']));_0x1ee95a[_0xf8dc('0x47')]=_0x1ee95a[_0xf8dc('0x47')]['length']?_0x1ee95a[_0xf8dc('0x47')]:_0x2cae36['model'];_0x1ee95a[_0xf8dc('0x69')]=qs['sort'](_0x4c5aa3['query']['sort']);_0x1ee95a[_0xf8dc('0x4e')]=qs[_0xf8dc('0x46')](_[_0xf8dc('0x4f')](_0x4c5aa3[_0xf8dc('0x45')],_0x2cae36[_0xf8dc('0x46')]));if(_0x4c5aa3['query']['filter']){_0x1ee95a[_0xf8dc('0x4e')]=_['merge'](_0x1ee95a['where'],{'$or':_[_0xf8dc('0x40')](_0x1ee95a[_0xf8dc('0x47')],function(_0x4f2e43){var _0x3ec243={};_0x3ec243[_0x4f2e43]={'$like':'%'+_0x4c5aa3[_0xf8dc('0x45')][_0xf8dc('0x50')]+'%'};return _0x3ec243;})});}_0x1ee95a=_[_0xf8dc('0x51')]({},_0x1ee95a,_0x4c5aa3[_0xf8dc('0x6b')]);return _0x3b3186[_0xf8dc('0xb6')](_0x1ee95a);}})[_0xf8dc('0x24')](function(_0x346619){if(_0x346619){_0x542627=_0x346619['length'];if(!_0x4c5aa3[_0xf8dc('0x45')]['hasOwnProperty'](_0xf8dc('0x4b'))){_0x1ee95a['limit']=qs[_0xf8dc('0x4c')](_0x4c5aa3['query'][_0xf8dc('0x4c')]);_0x1ee95a[_0xf8dc('0x34')]=qs['offset'](_0x4c5aa3[_0xf8dc('0x45')]['offset']);}return _0x3b3186[_0xf8dc('0xb6')](_0x1ee95a);}})[_0xf8dc('0x24')](function(_0x47b5f8){if(_0x47b5f8){return _0x47b5f8?{'count':_0x542627,'rows':_0x47b5f8}:null;}})[_0xf8dc('0x24')](respondWithResult(_0x397956,null))[_0xf8dc('0x2e')](handleError(_0x397956,null));};exports[_0xf8dc('0xb7')]=function(_0x2f1fc3,_0x3fe02c,_0x52c00d){var _0x182451,_0x1f6c36,_0x4f61c9;if(_['isNil'](_0x2f1fc3[_0xf8dc('0x63')][_0xf8dc('0x63')])||_0x2f1fc3[_0xf8dc('0x63')][_0xf8dc('0x63')]===''){throw new db[(_0xf8dc('0x21'))][(_0xf8dc('0x75'))](_0xf8dc('0x7b'));}if(_['isNil'](_0x2f1fc3[_0xf8dc('0x63')]['to'])){}_0x182451=_0x2f1fc3[_0xf8dc('0x63')]['to'];return db['OpenchannelAccount'][_0xf8dc('0xa5')]({'where':{'id':_0x2f1fc3[_0xf8dc('0x58')]['id']}})[_0xf8dc('0x24')](handleEntityNotFound(_0x3fe02c,null))[_0xf8dc('0x24')](function(_0x5ecec6){if(_0x5ecec6){return db[_0xf8dc('0x41')][_0xf8dc('0x5a')]({'where':{'id':_0x5ecec6['id']},'include':[{'model':db[_0xf8dc('0x81')],'as':_0xf8dc('0x86'),'include':[{'model':db[_0xf8dc('0x74')],'as':_0xf8dc('0x82'),'where':{[_0x5ecec6[_0xf8dc('0x7f')]]:_0x182451},'limit':0x1,'order':[[_0xf8dc('0x78'),_0xf8dc('0x83')]]}]}]})[_0xf8dc('0x24')](handleEntityNotFound(_0x3fe02c,null))['then'](function(_0x1a36d3){if(_0x1a36d3&&_0x1a36d3['List']){_0x1f6c36=_0x1a36d3[_0xf8dc('0x5c')]({'plain':!![]});if(_0x1f6c36[_0xf8dc('0x86')]&&_0x1f6c36[_0xf8dc('0x86')]['Contacts'][_0xf8dc('0x6f')]){return _0x1f6c36[_0xf8dc('0x86')][_0xf8dc('0x82')][0x0];}return db[_0xf8dc('0x74')][_0xf8dc('0x5b')](_[_0xf8dc('0x1a')](_0x2f1fc3[_0xf8dc('0x63')],{'firstName':_0x182451,[_0x1a36d3[_0xf8dc('0x7f')]]:_0x182451,'phone':_0x182451,'ListId':_0x1f6c36[_0xf8dc('0x79')]}));}})[_0xf8dc('0x24')](handleEntityNotFound(_0x3fe02c,null))[_0xf8dc('0x24')](function(_0x2fc271){if(_0x2fc271){_0x4f61c9=_0x2fc271;return db[_0xf8dc('0x8f')][_0xf8dc('0x5a')]({'where':{'ContactId':_0x4f61c9['id'],'closed':![],'OpenchannelAccountId':_0x1f6c36['id']}})[_0xf8dc('0x24')](function(_0x289223){if(_0x289223){return[_0x289223,![]];}return db['OpenchannelInteraction'][_0xf8dc('0x5b')]({'UserId':_0x2f1fc3[_0xf8dc('0x5f')]['id'],'ContactId':_0x4f61c9['id'],'OpenchannelAccountId':_0x1f6c36['id'],'lastMsgDirection':_0xf8dc('0xb8'),'Messages':[_[_0xf8dc('0x51')](_0x2f1fc3['body'],{'read':![],'body':_0x2f1fc3[_0xf8dc('0x63')][_0xf8dc('0x63')],'OpenchannelAccountId':_0x1f6c36['id'],'UserId':_0x2f1fc3['user']['id'],'ContactId':_0x4f61c9['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xf8dc('0xb9')}]})[_0xf8dc('0x24')](function(_0x2a5f30){return[_0x2a5f30,!![]];});});}})[_0xf8dc('0x92')](function(_0x45a111,_0xc76d50){if(_0xc76d50){return _0x45a111;}return db[_0xf8dc('0x99')][_0xf8dc('0x5b')](_['merge'](_0x2f1fc3[_0xf8dc('0x63')],{'read':![],'body':_0x2f1fc3[_0xf8dc('0x63')][_0xf8dc('0x63')],'OpenchannelAccountId':_0x1f6c36['id'],'OpenchannelInteractionId':_0x45a111['id'],'UserId':_0x2f1fc3[_0xf8dc('0x5f')]['id'],'ContactId':_0x4f61c9['id']}))[_0xf8dc('0x24')](function(_0x271058){_0x45a111['dataValues'][_0xf8dc('0xb9')]=[];_0x45a111[_0xf8dc('0xba')][_0xf8dc('0xb9')][_0xf8dc('0x96')](_0x271058[_0xf8dc('0xba')]);return _0x45a111;});});}})[_0xf8dc('0x24')](respondWithResult(_0x3fe02c,null))['catch'](handleError(_0x3fe02c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 963ef28..14eecac 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 _0x6ce0=['events','save','update','remove','emit','exports'];(function(_0x35700c,_0x3d37ff){var _0x17199c=function(_0x1be5a2){while(--_0x1be5a2){_0x35700c['push'](_0x35700c['shift']());}};_0x17199c(++_0x3d37ff);}(_0x6ce0,0x11a));var _0x06ce=function(_0x12bc0d,_0x1e40ca){_0x12bc0d=_0x12bc0d-0x0;var _0x18cf40=_0x6ce0[_0x12bc0d];return _0x18cf40;};'use strict';var EventEmitter=require(_0x06ce('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x06ce('0x1'),'afterUpdate':_0x06ce('0x2'),'afterDestroy':_0x06ce('0x3')};function emitEvent(_0x114feb){return function(_0x4bbeef,_0x499fc6,_0x14e123){OpenchannelAccountEvents[_0x06ce('0x4')](_0x114feb+':'+_0x4bbeef['id'],_0x4bbeef);OpenchannelAccountEvents[_0x06ce('0x4')](_0x114feb,_0x4bbeef);_0x14e123(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x06ce('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xaae0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xaae0,0x68));var _0x0aae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaae0[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x0aae('0x0'));var OpenchannelAccount=require(_0x0aae('0x1'))['db'][_0x0aae('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0aae('0x3'),'afterUpdate':_0x0aae('0x4'),'afterDestroy':_0x0aae('0x5')};function emitEvent(_0x3cf1b6){return function(_0x558af6,_0x55a9e7,_0x2d26e2){OpenchannelAccountEvents[_0x0aae('0x6')](_0x3cf1b6+':'+_0x558af6['id'],_0x558af6);OpenchannelAccountEvents[_0x0aae('0x6')](_0x3cf1b6,_0x558af6);_0x2d26e2(null);};}for(var e in events){if(events[_0x0aae('0x7')](e)){var event=events[e];OpenchannelAccount[_0x0aae('0x8')](e,emitEvent(event));}}module[_0x0aae('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 129d5a4..3bc1507 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 _0x5d47=['define','OpenchannelAccount','openchannel_accounts','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelAccount.attributes','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x5d47,0x10b));var _0x75d4=function(_0x21d96f,_0x361373){_0x21d96f=_0x21d96f-0x0;var _0x53e23f=_0x5d47[_0x21d96f];return _0x53e23f;};'use strict';var _=require(_0x75d4('0x0'));var util=require('util');var logger=require(_0x75d4('0x1'))('api');var moment=require(_0x75d4('0x2'));var BPromise=require(_0x75d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75d4('0x4'));var rimraf=require('rimraf');var config=require(_0x75d4('0x5'));var attributes=require(_0x75d4('0x6'));module[_0x75d4('0x7')]=function(_0x1512da,_0x339f36){return _0x1512da[_0x75d4('0x8')](_0x75d4('0x9'),attributes,{'tableName':_0x75d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3988=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x24c572,_0x1b0501){var _0x26dd5d=function(_0x23b6fd){while(--_0x23b6fd){_0x24c572['push'](_0x24c572['shift']());}};_0x26dd5d(++_0x1b0501);}(_0x3988,0x1f4));var _0x8398=function(_0x1738d9,_0x47507a){_0x1738d9=_0x1738d9-0x0;var _0x48db10=_0x3988[_0x1738d9];return _0x48db10;};'use strict';var _=require(_0x8398('0x0'));var util=require(_0x8398('0x1'));var logger=require('../../config/logger')(_0x8398('0x2'));var moment=require(_0x8398('0x3'));var BPromise=require(_0x8398('0x4'));var rp=require(_0x8398('0x5'));var fs=require('fs');var path=require(_0x8398('0x6'));var rimraf=require('rimraf');var config=require(_0x8398('0x7'));var attributes=require(_0x8398('0x8'));module[_0x8398('0x9')]=function(_0xab04bc,_0x584ac1){return _0xab04bc[_0x8398('0xa')](_0x8398('0xb'),attributes,{'tableName':_0x8398('0xc'),'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 3a21acc..0df28c1 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 _0x50fd=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','info'];(function(_0x20f22f,_0x12f7b2){var _0x4e15ab=function(_0x1851dd){while(--_0x1851dd){_0x20f22f['push'](_0x20f22f['shift']());}};_0x4e15ab(++_0x12f7b2);}(_0x50fd,0x8c));var _0xd50f=function(_0x4f6ca4,_0x3c49f9){_0x4f6ca4=_0x4f6ca4-0x0;var _0x2c5a6d=_0x50fd[_0x4f6ca4];return _0x2c5a6d;};'use strict';var _=require(_0xd50f('0x0'));var util=require('util');var moment=require(_0xd50f('0x1'));var BPromise=require('bluebird');var rs=require(_0xd50f('0x2'));var fs=require('fs');var Redis=require(_0xd50f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd50f('0x4'));var logger=require(_0xd50f('0x5'))(_0xd50f('0x6'));var config=require(_0xd50f('0x7'));var jayson=require(_0xd50f('0x8'));var client=jayson[_0xd50f('0x9')]['http']({'port':0x232a});config[_0xd50f('0xa')]=_['defaults'](config[_0xd50f('0xa')],{'host':_0xd50f('0xb'),'port':0x18eb});var socket=require(_0xd50f('0xc'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xd50f('0xd')](socket);function respondWithRpcPromise(_0x197384,_0x44e56f,_0x2b45e5){return new BPromise(function(_0x267054,_0x202eaa){return client[_0xd50f('0xe')](_0x197384,_0x2b45e5)['then'](function(_0x9e9938){logger[_0xd50f('0xf')](_0xd50f('0x10'),_0x44e56f,_0xd50f('0x11'));logger[_0xd50f('0x12')](_0xd50f('0x13'),_0x44e56f,_0xd50f('0x11'),JSON[_0xd50f('0x14')](_0x9e9938));if(_0x9e9938[_0xd50f('0x15')]){if(_0x9e9938['error'][_0xd50f('0x16')]===0x1f4){logger['error'](_0xd50f('0x10'),_0x44e56f,_0x9e9938[_0xd50f('0x15')]['message']);return _0x202eaa(_0x9e9938[_0xd50f('0x15')]['message']);}logger[_0xd50f('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x44e56f,_0x9e9938['error']['message']);return _0x267054(_0x9e9938[_0xd50f('0x15')][_0xd50f('0x17')]);}else{logger['info'](_0xd50f('0x10'),_0x44e56f,_0xd50f('0x11'));_0x267054(_0x9e9938[_0xd50f('0x18')][_0xd50f('0x17')]);}})[_0xd50f('0x19')](function(_0x50cf05){logger[_0xd50f('0x15')](_0xd50f('0x10'),_0x44e56f,_0x50cf05);_0x202eaa(_0x50cf05);});});} \ No newline at end of file +var _0xc358=['../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x2d4ede,_0x1212c3){var _0x39da2c=function(_0x46daf0){while(--_0x46daf0){_0x2d4ede['push'](_0x2d4ede['shift']());}};_0x39da2c(++_0x1212c3);}(_0xc358,0x194));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c35('0x0'));var BPromise=require(_0x8c35('0x1'));var rs=require(_0x8c35('0x2'));var fs=require('fs');var Redis=require(_0x8c35('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c35('0x4'))('rpc');var config=require(_0x8c35('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8c35('0x6')][_0x8c35('0x7')]({'port':0x232a});config['redis']=_[_0x8c35('0x8')](config[_0x8c35('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c35('0xa'))(new Redis(config['redis']));require(_0x8c35('0xb'))[_0x8c35('0xc')](socket);function respondWithRpcPromise(_0x2c5afd,_0x4095c1,_0x234d49){return new BPromise(function(_0x35e6e5,_0x99e31b){return client[_0x8c35('0xd')](_0x2c5afd,_0x234d49)[_0x8c35('0xe')](function(_0x5dd05f){logger[_0x8c35('0xf')](_0x8c35('0x10'),_0x4095c1,_0x8c35('0x11'));logger['debug'](_0x8c35('0x12'),_0x4095c1,'request\x20sent',JSON[_0x8c35('0x13')](_0x5dd05f));if(_0x5dd05f[_0x8c35('0x14')]){if(_0x5dd05f['error']['code']===0x1f4){logger['error'](_0x8c35('0x10'),_0x4095c1,_0x5dd05f[_0x8c35('0x14')][_0x8c35('0x15')]);return _0x99e31b(_0x5dd05f[_0x8c35('0x14')][_0x8c35('0x15')]);}logger[_0x8c35('0x14')](_0x8c35('0x10'),_0x4095c1,_0x5dd05f[_0x8c35('0x14')][_0x8c35('0x15')]);return _0x35e6e5(_0x5dd05f['error'][_0x8c35('0x15')]);}else{logger[_0x8c35('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x4095c1,_0x8c35('0x11'));_0x35e6e5(_0x5dd05f[_0x8c35('0x16')]['message']);}})[_0x8c35('0x17')](function(_0xe76f16){logger[_0x8c35('0x14')](_0x8c35('0x10'),_0x4095c1,_0xe76f16);_0x99e31b(_0xe76f16);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 81059a9..ec91a77 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 _0x08d7=['./openchannelAccount.events','save','update','emit','removeListener','length','openchannelAccount:'];(function(_0x4e8601,_0x209e83){var _0x2e3773=function(_0x2e3925){while(--_0x2e3925){_0x4e8601['push'](_0x4e8601['shift']());}};_0x2e3773(++_0x209e83);}(_0x08d7,0x188));var _0x708d=function(_0x386078,_0x49ad4f){_0x386078=_0x386078-0x0;var _0xd6675c=_0x08d7[_0x386078];return _0xd6675c;};'use strict';var OpenchannelAccountEvents=require(_0x708d('0x0'));var events=[_0x708d('0x1'),'remove',_0x708d('0x2')];function createListener(_0x5ee643,_0x4f88c6){return function(_0x5f2e11){_0x4f88c6[_0x708d('0x3')](_0x5ee643,_0x5f2e11);};}function removeListener(_0x5884a1,_0x498301){return function(){OpenchannelAccountEvents[_0x708d('0x4')](_0x5884a1,_0x498301);};}exports['register']=function(_0x3766cb){for(var _0x291646=0x0,_0x43da87=events[_0x708d('0x5')];_0x291646<_0x43da87;_0x291646++){var _0x5ad6d3=events[_0x291646];var _0x1b28e5=createListener(_0x708d('0x6')+_0x5ad6d3,_0x3766cb);OpenchannelAccountEvents['on'](_0x5ad6d3,_0x1b28e5);}}; \ No newline at end of file +var _0xb126=['save','remove','emit','removeListener','register','length','./openchannelAccount.events'];(function(_0x3c6975,_0x518aad){var _0x45c44a=function(_0x3f1920){while(--_0x3f1920){_0x3c6975['push'](_0x3c6975['shift']());}};_0x45c44a(++_0x518aad);}(_0xb126,0x92));var _0x6b12=function(_0x4fd28a,_0x5b64bc){_0x4fd28a=_0x4fd28a-0x0;var _0x124ae4=_0xb126[_0x4fd28a];return _0x124ae4;};'use strict';var OpenchannelAccountEvents=require(_0x6b12('0x0'));var events=[_0x6b12('0x1'),_0x6b12('0x2'),'update'];function createListener(_0x470ad8,_0x2c6779){return function(_0x2d1de6){_0x2c6779[_0x6b12('0x3')](_0x470ad8,_0x2d1de6);};}function removeListener(_0xc4713b,_0x2f63d0){return function(){OpenchannelAccountEvents[_0x6b12('0x4')](_0xc4713b,_0x2f63d0);};}exports[_0x6b12('0x5')]=function(_0x346bd6){for(var _0x1dee40=0x0,_0x5e7caa=events[_0x6b12('0x6')];_0x1dee40<_0x5e7caa;_0x1dee40++){var _0x1b1720=events[_0x1dee40];var _0x155983=createListener('openchannelAccount:'+_0x1b1720,_0x346bd6);OpenchannelAccountEvents['on'](_0x1b1720,_0x155983);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 3deab5b..b0fd668 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 _0x38ce=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4dddcc,_0x5dae19){var _0x2e9da1=function(_0x141fc0){while(--_0x141fc0){_0x4dddcc['push'](_0x4dddcc['shift']());}};_0x2e9da1(++_0x5dae19);}(_0x38ce,0x14f));var _0xe38c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x38ce[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xe38c('0x0'));var util=require(_0xe38c('0x1'));var path=require('path');var timeout=require(_0xe38c('0x2'));var express=require(_0xe38c('0x3'));var router=express[_0xe38c('0x4')]();var auth=require(_0xe38c('0x5'));var interaction=require(_0xe38c('0x6'));var config=require(_0xe38c('0x7'));var controller=require(_0xe38c('0x8'));router[_0xe38c('0x9')]('/',auth[_0xe38c('0xa')](),controller[_0xe38c('0xb')]);router['get'](_0xe38c('0xc'),auth[_0xe38c('0xa')](),controller['show']);router['post']('/',auth[_0xe38c('0xa')](),controller[_0xe38c('0xd')]);router[_0xe38c('0xe')](_0xe38c('0xc'),auth[_0xe38c('0xa')](),controller[_0xe38c('0xf')]);router[_0xe38c('0x10')](_0xe38c('0xc'),auth[_0xe38c('0xa')](),controller[_0xe38c('0x11')]);module[_0xe38c('0x12')]=router; \ No newline at end of file +var _0xb13b=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','update'];(function(_0x5b4937,_0xa0f1cc){var _0x9c58f9=function(_0x3c4a35){while(--_0x3c4a35){_0x5b4937['push'](_0x5b4937['shift']());}};_0x9c58f9(++_0xa0f1cc);}(_0xb13b,0x101));var _0xbb13=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb13b[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xbb13('0x0'));var util=require(_0xbb13('0x1'));var path=require(_0xbb13('0x2'));var timeout=require(_0xbb13('0x3'));var express=require(_0xbb13('0x4'));var router=express[_0xbb13('0x5')]();var auth=require(_0xbb13('0x6'));var interaction=require(_0xbb13('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xbb13('0x8')]('/',auth[_0xbb13('0x9')](),controller[_0xbb13('0xa')]);router[_0xbb13('0x8')](_0xbb13('0xb'),auth[_0xbb13('0x9')](),controller['show']);router['post']('/',auth[_0xbb13('0x9')](),controller['create']);router['put'](_0xbb13('0xb'),auth['isAuthenticated'](),controller[_0xbb13('0xc')]);router[_0xbb13('0xd')](_0xbb13('0xb'),auth[_0xbb13('0x9')](),controller['destroy']);module[_0xbb13('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d18ba8d..ec1d43b 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 _0xfafe=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfafe,0x1e3));var _0xefaf=function(_0x4c117d,_0xf11d85){_0x4c117d=_0x4c117d-0x0;var _0x1d1319=_0xfafe[_0x4c117d];return _0x1d1319;};'use strict';var Sequelize=require(_0xefaf('0x0'));module[_0xefaf('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xefaf('0x2')],'allowNull':![],'defaultValue':_0xefaf('0x3')},'appdata':{'type':Sequelize[_0xefaf('0x4')]()},'description':{'type':Sequelize[_0xefaf('0x2')]},'interval':{'type':Sequelize[_0xefaf('0x2')],'defaultValue':_0xefaf('0x5')}}; \ No newline at end of file +var _0xe29d=['INTEGER','TEXT','STRING','*,*,*,*','exports'];(function(_0x61fcfd,_0x49852b){var _0x56abb0=function(_0x5d61fa){while(--_0x5d61fa){_0x61fcfd['push'](_0x61fcfd['shift']());}};_0x56abb0(++_0x49852b);}(_0xe29d,0x15d));var _0xde29=function(_0x1aa406,_0x402066){_0x1aa406=_0x1aa406-0x0;var _0x462ebb=_0xe29d[_0x1aa406];return _0x462ebb;};'use strict';var Sequelize=require('sequelize');module[_0xde29('0x0')]={'priority':{'type':Sequelize[_0xde29('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xde29('0x2')]()},'description':{'type':Sequelize[_0xde29('0x3')]},'interval':{'type':Sequelize[_0xde29('0x3')],'defaultValue':_0xde29('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 2098ccb..a1b043b 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 _0xdb74=['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','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x404eb2,_0x165be2){var _0x3f04b8=function(_0x5c7fa){while(--_0x5c7fa){_0x404eb2['push'](_0x404eb2['shift']());}};_0x3f04b8(++_0x165be2);}(_0xdb74,0xe1));var _0x4db7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xdb74[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4db7('0x0'));var zipdir=require(_0x4db7('0x1'));var jsonpatch=require(_0x4db7('0x2'));var rp=require('request-promise');var moment=require(_0x4db7('0x3'));var BPromise=require(_0x4db7('0x4'));var Mustache=require(_0x4db7('0x5'));var util=require(_0x4db7('0x6'));var path=require(_0x4db7('0x7'));var sox=require(_0x4db7('0x8'));var csv=require(_0x4db7('0x9'));var ejs=require(_0x4db7('0xa'));var fs=require('fs');var _=require(_0x4db7('0xb'));var squel=require(_0x4db7('0xc'));var crypto=require(_0x4db7('0xd'));var jsforce=require(_0x4db7('0xe'));var deskjs=require(_0x4db7('0xf'));var toCsv=require(_0x4db7('0x9'));var querystring=require(_0x4db7('0x10'));var Papa=require(_0x4db7('0x11'));var Redis=require(_0x4db7('0x12'));var authService=require(_0x4db7('0x13'));var qs=require(_0x4db7('0x14'));var as=require(_0x4db7('0x15'));var hardwareService=require(_0x4db7('0x16'));var logger=require(_0x4db7('0x17'))(_0x4db7('0x18'));var utils=require(_0x4db7('0x19'));var config=require('../../config/environment');var db=require(_0x4db7('0x1a'))['db'];function respondWithStatusCode(_0x179f07,_0x4922af){_0x4922af=_0x4922af||0xcc;return function(_0x10dd23){if(_0x10dd23){return _0x179f07['sendStatus'](_0x4922af);}return _0x179f07[_0x4db7('0x1b')](_0x4922af)[_0x4db7('0x1c')]();};}function respondWithResult(_0x4dbc03,_0x4f7176){_0x4f7176=_0x4f7176||0xc8;return function(_0x16c7d1){if(_0x16c7d1){return _0x4dbc03[_0x4db7('0x1b')](_0x4f7176)[_0x4db7('0x1d')](_0x16c7d1);}};}function respondWithFilteredResult(_0x45498d,_0x22a4f7){return function(_0x300796){if(_0x300796){var _0x5522b2=_0x300796[_0x4db7('0x1e')],_0x15300e=_0x22a4f7[_0x4db7('0x1f')],_0x55fda8=_0x22a4f7[_0x4db7('0x1f')]+_0x22a4f7[_0x4db7('0x20')],_0x38b566;if(_0x55fda8>=_0x5522b2){_0x55fda8=_0x5522b2;_0x38b566=0xc8;}else{_0x38b566=0xce;}_0x45498d[_0x4db7('0x1b')](_0x38b566);return _0x45498d[_0x4db7('0x21')](_0x4db7('0x22'),_0x15300e+'-'+_0x55fda8+'/'+_0x5522b2)[_0x4db7('0x1d')](_0x300796);}return null;};}function patchUpdates(_0x4d4c7d){return function(_0x5b88a){try{jsonpatch[_0x4db7('0x23')](_0x5b88a,_0x4d4c7d,!![]);}catch(_0x2c919f){return BPromise[_0x4db7('0x24')](_0x2c919f);}return _0x5b88a[_0x4db7('0x25')]();};}function saveUpdates(_0x4e694b,_0x5bdd71){return function(_0x126741){if(_0x126741){return _0x126741[_0x4db7('0x26')](_0x4e694b)[_0x4db7('0x27')](function(_0x179322){return _0x179322;});}return null;};}function removeEntity(_0x3b08b7,_0x3f2fe3){return function(_0x3fcdc6){if(_0x3fcdc6){return _0x3fcdc6[_0x4db7('0x28')]()[_0x4db7('0x27')](function(){_0x3b08b7[_0x4db7('0x1b')](0xcc)[_0x4db7('0x1c')]();});}};}function handleEntityNotFound(_0x344d04,_0x2eaab2){return function(_0x5c947f){if(!_0x5c947f){_0x344d04[_0x4db7('0x29')](0x194);}return _0x5c947f;};}function handleError(_0x3fa28a,_0x16bebc){_0x16bebc=_0x16bebc||0x1f4;return function(_0x506a9d){logger[_0x4db7('0x2a')](_0x506a9d[_0x4db7('0x2b')]);if(_0x506a9d[_0x4db7('0x2c')]){delete _0x506a9d[_0x4db7('0x2c')];}_0x3fa28a[_0x4db7('0x1b')](_0x16bebc)[_0x4db7('0x2d')](_0x506a9d);};}exports[_0x4db7('0x2e')]=function(_0x4b3b36,_0x51f090){var _0x449f57={},_0x3f9ec2={},_0xec6b99={'count':0x0,'rows':[]};var _0x53dc06=_[_0x4db7('0x2f')](db['OpenchannelApplication'][_0x4db7('0x30')],function(_0x5367a4){return{'name':_0x5367a4['fieldName'],'type':_0x5367a4[_0x4db7('0x31')][_0x4db7('0x32')]};});_0x3f9ec2[_0x4db7('0x33')]=_['map'](_0x53dc06,_0x4db7('0x2c'));_0x3f9ec2[_0x4db7('0x34')]=_[_0x4db7('0x35')](_0x4b3b36[_0x4db7('0x34')]);_0x3f9ec2[_0x4db7('0x36')]=_['intersection'](_0x3f9ec2[_0x4db7('0x33')],_0x3f9ec2['query']);_0x449f57['attributes']=_['intersection'](_0x3f9ec2[_0x4db7('0x33')],qs[_0x4db7('0x37')](_0x4b3b36[_0x4db7('0x34')][_0x4db7('0x37')]));_0x449f57[_0x4db7('0x38')]=_0x449f57['attributes'][_0x4db7('0x39')]?_0x449f57[_0x4db7('0x38')]:_0x3f9ec2[_0x4db7('0x33')];if(!_0x4b3b36[_0x4db7('0x34')][_0x4db7('0x3a')]('nolimit')){_0x449f57[_0x4db7('0x20')]=qs['limit'](_0x4b3b36[_0x4db7('0x34')]['limit']);_0x449f57[_0x4db7('0x1f')]=qs[_0x4db7('0x1f')](_0x4b3b36[_0x4db7('0x34')][_0x4db7('0x1f')]);}_0x449f57[_0x4db7('0x3b')]=qs[_0x4db7('0x3c')](_0x4b3b36[_0x4db7('0x34')][_0x4db7('0x3c')]);_0x449f57[_0x4db7('0x3d')]=qs['filters'](_[_0x4db7('0x3e')](_0x4b3b36[_0x4db7('0x34')],_0x3f9ec2[_0x4db7('0x36')]),_0x53dc06);if(_0x4b3b36['query'][_0x4db7('0x3f')]){_0x449f57[_0x4db7('0x3d')]=_[_0x4db7('0x40')](_0x449f57[_0x4db7('0x3d')],{'$or':_[_0x4db7('0x2f')](_0x53dc06,function(_0x5bea1b){if(_0x5bea1b[_0x4db7('0x31')]!==_0x4db7('0x41')){var _0x2a8e2b={};_0x2a8e2b[_0x5bea1b[_0x4db7('0x2c')]]={'$like':'%'+_0x4b3b36[_0x4db7('0x34')][_0x4db7('0x3f')]+'%'};return _0x2a8e2b;}})});}_0x449f57=_[_0x4db7('0x40')]({},_0x449f57,_0x4b3b36[_0x4db7('0x42')]);var _0x2f87ec={'where':_0x449f57[_0x4db7('0x3d')]};return db[_0x4db7('0x43')]['count'](_0x2f87ec)['then'](function(_0x42b2ab){_0xec6b99[_0x4db7('0x1e')]=_0x42b2ab;if(_0x4b3b36['query'][_0x4db7('0x44')]){_0x449f57[_0x4db7('0x45')]=[{'all':!![]}];}return db[_0x4db7('0x43')][_0x4db7('0x46')](_0x449f57);})['then'](function(_0x3b1034){_0xec6b99[_0x4db7('0x47')]=_0x3b1034;return _0xec6b99;})[_0x4db7('0x27')](respondWithFilteredResult(_0x51f090,_0x449f57))['catch'](handleError(_0x51f090,null));};exports[_0x4db7('0x48')]=function(_0x59bb12,_0x56cf51){var _0x40ed51={'raw':!![],'where':{'id':_0x59bb12[_0x4db7('0x49')]['id']}},_0x5da198={};_0x5da198[_0x4db7('0x33')]=_[_0x4db7('0x35')](db['OpenchannelApplication'][_0x4db7('0x30')]);_0x5da198[_0x4db7('0x34')]=_[_0x4db7('0x35')](_0x59bb12[_0x4db7('0x34')]);_0x5da198[_0x4db7('0x36')]=_[_0x4db7('0x4a')](_0x5da198['model'],_0x5da198[_0x4db7('0x34')]);_0x40ed51[_0x4db7('0x38')]=_[_0x4db7('0x4a')](_0x5da198[_0x4db7('0x33')],qs[_0x4db7('0x37')](_0x59bb12['query'][_0x4db7('0x37')]));_0x40ed51[_0x4db7('0x38')]=_0x40ed51['attributes']['length']?_0x40ed51[_0x4db7('0x38')]:_0x5da198[_0x4db7('0x33')];if(_0x59bb12[_0x4db7('0x34')][_0x4db7('0x44')]){_0x40ed51['include']=[{'all':!![]}];}_0x40ed51=_['merge']({},_0x40ed51,_0x59bb12[_0x4db7('0x42')]);return db[_0x4db7('0x43')]['find'](_0x40ed51)[_0x4db7('0x27')](handleEntityNotFound(_0x56cf51,null))['then'](respondWithResult(_0x56cf51,null))[_0x4db7('0x4b')](handleError(_0x56cf51,null));};exports[_0x4db7('0x4c')]=function(_0x2c73af,_0x3c0f7e){return db[_0x4db7('0x43')][_0x4db7('0x4c')](_0x2c73af[_0x4db7('0x4d')],{})[_0x4db7('0x27')](respondWithResult(_0x3c0f7e,0xc9))[_0x4db7('0x4b')](handleError(_0x3c0f7e,null));};exports['update']=function(_0x191458,_0x426322){if(_0x191458[_0x4db7('0x4d')]['id']){delete _0x191458[_0x4db7('0x4d')]['id'];}return db[_0x4db7('0x43')][_0x4db7('0x4e')]({'where':{'id':_0x191458[_0x4db7('0x49')]['id']}})['then'](handleEntityNotFound(_0x426322,null))[_0x4db7('0x27')](saveUpdates(_0x191458[_0x4db7('0x4d')],null))['then'](respondWithResult(_0x426322,null))[_0x4db7('0x4b')](handleError(_0x426322,null));};exports[_0x4db7('0x28')]=function(_0x2ee49b,_0x21c284){return db[_0x4db7('0x43')][_0x4db7('0x4e')]({'where':{'id':_0x2ee49b[_0x4db7('0x49')]['id']}})[_0x4db7('0x27')](handleEntityNotFound(_0x21c284,null))[_0x4db7('0x27')](removeEntity(_0x21c284,null))[_0x4db7('0x4b')](handleError(_0x21c284,null));}; \ No newline at end of file +var _0x148f=['sendStatus','error','name','send','map','OpenchannelApplication','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','findAll','catch','show','params','keys','rawAttributes','include','create','body','find','html-pdf','rimraf','zip-dir','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/logger','api','../../config/utils','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','then'];(function(_0x19d5f6,_0x212563){var _0x2b2138=function(_0x100e90){while(--_0x100e90){_0x19d5f6['push'](_0x19d5f6['shift']());}};_0x2b2138(++_0x212563);}(_0x148f,0xab));var _0xf148=function(_0x496a35,_0x49ce17){_0x496a35=_0x496a35-0x0;var _0x9157f0=_0x148f[_0x496a35];return _0x9157f0;};'use strict';var pdf=require(_0xf148('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf148('0x1'));var zipdir=require(_0xf148('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf148('0x3'));var moment=require(_0xf148('0x4'));var BPromise=require(_0xf148('0x5'));var Mustache=require(_0xf148('0x6'));var util=require(_0xf148('0x7'));var path=require(_0xf148('0x8'));var sox=require(_0xf148('0x9'));var csv=require(_0xf148('0xa'));var ejs=require(_0xf148('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf148('0xc'));var crypto=require(_0xf148('0xd'));var jsforce=require(_0xf148('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf148('0xa'));var querystring=require('querystring');var Papa=require(_0xf148('0xf'));var Redis=require(_0xf148('0x10'));var authService=require(_0xf148('0x11'));var qs=require(_0xf148('0x12'));var as=require(_0xf148('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf148('0x14'))(_0xf148('0x15'));var utils=require(_0xf148('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49fc15,_0x32700a){_0x32700a=_0x32700a||0xcc;return function(_0xc9f8ee){if(_0xc9f8ee){return _0x49fc15['sendStatus'](_0x32700a);}return _0x49fc15[_0xf148('0x17')](_0x32700a)[_0xf148('0x18')]();};}function respondWithResult(_0xd7c2ef,_0xc60164){_0xc60164=_0xc60164||0xc8;return function(_0x3d601a){if(_0x3d601a){return _0xd7c2ef[_0xf148('0x17')](_0xc60164)['json'](_0x3d601a);}};}function respondWithFilteredResult(_0x4492fe,_0x59a239){return function(_0x1e8626){if(_0x1e8626){var _0x1ea323=_0x1e8626[_0xf148('0x19')],_0x1b4ce5=_0x59a239[_0xf148('0x1a')],_0x400eef=_0x59a239[_0xf148('0x1a')]+_0x59a239[_0xf148('0x1b')],_0x5089c3;if(_0x400eef>=_0x1ea323){_0x400eef=_0x1ea323;_0x5089c3=0xc8;}else{_0x5089c3=0xce;}_0x4492fe['status'](_0x5089c3);return _0x4492fe[_0xf148('0x1c')]('Content-Range',_0x1b4ce5+'-'+_0x400eef+'/'+_0x1ea323)[_0xf148('0x1d')](_0x1e8626);}return null;};}function patchUpdates(_0x5bf32d){return function(_0x28472a){try{jsonpatch[_0xf148('0x1e')](_0x28472a,_0x5bf32d,!![]);}catch(_0x3469fd){return BPromise[_0xf148('0x1f')](_0x3469fd);}return _0x28472a[_0xf148('0x20')]();};}function saveUpdates(_0x47ecec,_0x574361){return function(_0x5e4aac){if(_0x5e4aac){return _0x5e4aac[_0xf148('0x21')](_0x47ecec)['then'](function(_0x9f1bf6){return _0x9f1bf6;});}return null;};}function removeEntity(_0x49e451,_0x1284bb){return function(_0x29999d){if(_0x29999d){return _0x29999d[_0xf148('0x22')]()[_0xf148('0x23')](function(){_0x49e451[_0xf148('0x17')](0xcc)[_0xf148('0x18')]();});}};}function handleEntityNotFound(_0x2a15d7,_0x7e4066){return function(_0x32b7a2){if(!_0x32b7a2){_0x2a15d7[_0xf148('0x24')](0x194);}return _0x32b7a2;};}function handleError(_0xef2070,_0x225033){_0x225033=_0x225033||0x1f4;return function(_0x4d2f77){logger[_0xf148('0x25')](_0x4d2f77['stack']);if(_0x4d2f77[_0xf148('0x26')]){delete _0x4d2f77[_0xf148('0x26')];}_0xef2070[_0xf148('0x17')](_0x225033)[_0xf148('0x27')](_0x4d2f77);};}exports['index']=function(_0x10bfc9,_0x197fc5){var _0xc49b55={},_0x12e56c={},_0x46e75f={'count':0x0,'rows':[]};var _0xa82218=_[_0xf148('0x28')](db[_0xf148('0x29')]['rawAttributes'],function(_0x5e5bb1){return{'name':_0x5e5bb1['fieldName'],'type':_0x5e5bb1[_0xf148('0x2a')][_0xf148('0x2b')]};});_0x12e56c[_0xf148('0x2c')]=_[_0xf148('0x28')](_0xa82218,_0xf148('0x26'));_0x12e56c[_0xf148('0x2d')]=_['keys'](_0x10bfc9[_0xf148('0x2d')]);_0x12e56c['filters']=_[_0xf148('0x2e')](_0x12e56c[_0xf148('0x2c')],_0x12e56c['query']);_0xc49b55[_0xf148('0x2f')]=_['intersection'](_0x12e56c['model'],qs[_0xf148('0x30')](_0x10bfc9[_0xf148('0x2d')]['fields']));_0xc49b55['attributes']=_0xc49b55[_0xf148('0x2f')][_0xf148('0x31')]?_0xc49b55['attributes']:_0x12e56c['model'];if(!_0x10bfc9[_0xf148('0x2d')][_0xf148('0x32')](_0xf148('0x33'))){_0xc49b55[_0xf148('0x1b')]=qs[_0xf148('0x1b')](_0x10bfc9[_0xf148('0x2d')][_0xf148('0x1b')]);_0xc49b55[_0xf148('0x1a')]=qs[_0xf148('0x1a')](_0x10bfc9[_0xf148('0x2d')][_0xf148('0x1a')]);}_0xc49b55['order']=qs[_0xf148('0x34')](_0x10bfc9[_0xf148('0x2d')][_0xf148('0x34')]);_0xc49b55[_0xf148('0x35')]=qs[_0xf148('0x36')](_['pick'](_0x10bfc9[_0xf148('0x2d')],_0x12e56c[_0xf148('0x36')]),_0xa82218);if(_0x10bfc9[_0xf148('0x2d')][_0xf148('0x37')]){_0xc49b55['where']=_[_0xf148('0x38')](_0xc49b55['where'],{'$or':_[_0xf148('0x28')](_0xa82218,function(_0x2d5ab1){if(_0x2d5ab1[_0xf148('0x2a')]!=='VIRTUAL'){var _0x570423={};_0x570423[_0x2d5ab1[_0xf148('0x26')]]={'$like':'%'+_0x10bfc9[_0xf148('0x2d')][_0xf148('0x37')]+'%'};return _0x570423;}})});}_0xc49b55=_[_0xf148('0x38')]({},_0xc49b55,_0x10bfc9[_0xf148('0x39')]);var _0x558025={'where':_0xc49b55[_0xf148('0x35')]};return db[_0xf148('0x29')][_0xf148('0x19')](_0x558025)[_0xf148('0x23')](function(_0x5955f1){_0x46e75f['count']=_0x5955f1;if(_0x10bfc9[_0xf148('0x2d')][_0xf148('0x3a')]){_0xc49b55['include']=[{'all':!![]}];}return db[_0xf148('0x29')][_0xf148('0x3b')](_0xc49b55);})['then'](function(_0x3ae3ba){_0x46e75f['rows']=_0x3ae3ba;return _0x46e75f;})[_0xf148('0x23')](respondWithFilteredResult(_0x197fc5,_0xc49b55))[_0xf148('0x3c')](handleError(_0x197fc5,null));};exports[_0xf148('0x3d')]=function(_0x482ea1,_0x462b72){var _0x5e6894={'raw':!![],'where':{'id':_0x482ea1[_0xf148('0x3e')]['id']}},_0x8c2e2d={};_0x8c2e2d[_0xf148('0x2c')]=_[_0xf148('0x3f')](db[_0xf148('0x29')][_0xf148('0x40')]);_0x8c2e2d[_0xf148('0x2d')]=_[_0xf148('0x3f')](_0x482ea1['query']);_0x8c2e2d['filters']=_[_0xf148('0x2e')](_0x8c2e2d[_0xf148('0x2c')],_0x8c2e2d[_0xf148('0x2d')]);_0x5e6894[_0xf148('0x2f')]=_[_0xf148('0x2e')](_0x8c2e2d[_0xf148('0x2c')],qs['fields'](_0x482ea1[_0xf148('0x2d')][_0xf148('0x30')]));_0x5e6894[_0xf148('0x2f')]=_0x5e6894[_0xf148('0x2f')]['length']?_0x5e6894[_0xf148('0x2f')]:_0x8c2e2d[_0xf148('0x2c')];if(_0x482ea1[_0xf148('0x2d')][_0xf148('0x3a')]){_0x5e6894[_0xf148('0x41')]=[{'all':!![]}];}_0x5e6894=_[_0xf148('0x38')]({},_0x5e6894,_0x482ea1[_0xf148('0x39')]);return db['OpenchannelApplication']['find'](_0x5e6894)[_0xf148('0x23')](handleEntityNotFound(_0x462b72,null))[_0xf148('0x23')](respondWithResult(_0x462b72,null))[_0xf148('0x3c')](handleError(_0x462b72,null));};exports['create']=function(_0x2b3f58,_0x2ab52d){return db[_0xf148('0x29')][_0xf148('0x42')](_0x2b3f58[_0xf148('0x43')],{})['then'](respondWithResult(_0x2ab52d,0xc9))[_0xf148('0x3c')](handleError(_0x2ab52d,null));};exports[_0xf148('0x21')]=function(_0x1ff8a0,_0x5c872e){if(_0x1ff8a0['body']['id']){delete _0x1ff8a0[_0xf148('0x43')]['id'];}return db[_0xf148('0x29')][_0xf148('0x44')]({'where':{'id':_0x1ff8a0['params']['id']}})['then'](handleEntityNotFound(_0x5c872e,null))[_0xf148('0x23')](saveUpdates(_0x1ff8a0[_0xf148('0x43')],null))[_0xf148('0x23')](respondWithResult(_0x5c872e,null))[_0xf148('0x3c')](handleError(_0x5c872e,null));};exports[_0xf148('0x22')]=function(_0xbfab40,_0x3d44f7){return db[_0xf148('0x29')][_0xf148('0x44')]({'where':{'id':_0xbfab40[_0xf148('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3d44f7,null))[_0xf148('0x23')](removeEntity(_0x3d44f7,null))[_0xf148('0x3c')](handleError(_0x3d44f7,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1dca47f..5d485e6 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 _0x6b18=['lodash','api','bluebird','../../config/environment','./openchannelApplication.attributes','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x575934,_0x4a6760){var _0x109a3d=function(_0x1c20a1){while(--_0x1c20a1){_0x575934['push'](_0x575934['shift']());}};_0x109a3d(++_0x4a6760);}(_0x6b18,0x80));var _0x86b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b18[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x86b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x86b1('0x1'));var moment=require('moment');var BPromise=require(_0x86b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x86b1('0x3'));var attributes=require(_0x86b1('0x4'));module['exports']=function(_0x536ca6,_0x3c42ff){return _0x536ca6['define']('OpenchannelApplication',attributes,{'tableName':_0x86b1('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x86b1('0x6'),'collate':_0x86b1('0x7')});}; \ No newline at end of file +var _0xf035=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27b72d,_0x3f7a03){var _0x2b0687=function(_0x221a21){while(--_0x221a21){_0x27b72d['push'](_0x27b72d['shift']());}};_0x2b0687(++_0x3f7a03);}(_0xf035,0x117));var _0x5f03=function(_0x2b46dd,_0x5e8703){_0x2b46dd=_0x2b46dd-0x0;var _0x3552f8=_0xf035[_0x2b46dd];return _0x3552f8;};'use strict';var _=require(_0x5f03('0x0'));var util=require('util');var logger=require(_0x5f03('0x1'))(_0x5f03('0x2'));var moment=require(_0x5f03('0x3'));var BPromise=require(_0x5f03('0x4'));var rp=require(_0x5f03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f03('0x6'));var config=require(_0x5f03('0x7'));var attributes=require(_0x5f03('0x8'));module[_0x5f03('0x9')]=function(_0x4644a3,_0x58059c){return _0x4644a3[_0x5f03('0xa')](_0x5f03('0xb'),attributes,{'tableName':_0x5f03('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f03('0xd'),'collate':_0x5f03('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f7f168b..1dab2db 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 _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(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}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 +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(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}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 6a25bc1..1488721 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 _0xedd8=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','describe','/:id','/:id/messages','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xedd8,0x14a));var _0x8edd=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0xedd8[_0x54381d];return _0x5308a7;};'use strict';var multer=require(_0x8edd('0x0'));var util=require(_0x8edd('0x1'));var path=require(_0x8edd('0x2'));var timeout=require(_0x8edd('0x3'));var express=require('express');var router=express[_0x8edd('0x4')]();var auth=require(_0x8edd('0x5'));var interaction=require(_0x8edd('0x6'));var config=require(_0x8edd('0x7'));var controller=require(_0x8edd('0x8'));router[_0x8edd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8edd('0x9')](_0x8edd('0xa'),auth[_0x8edd('0xb')](),controller[_0x8edd('0xc')]);router[_0x8edd('0x9')](_0x8edd('0xd'),auth[_0x8edd('0xb')](),controller['show']);router[_0x8edd('0x9')](_0x8edd('0xe'),auth[_0x8edd('0xb')](),controller['getMessages']);router[_0x8edd('0x9')]('/:id/download',auth[_0x8edd('0xb')](),controller['download']);router[_0x8edd('0xf')]('/',auth[_0x8edd('0xb')](),controller['create']);router[_0x8edd('0xf')](_0x8edd('0xe'),auth[_0x8edd('0xb')](),controller[_0x8edd('0x10')]);router[_0x8edd('0xf')](_0x8edd('0x11'),auth[_0x8edd('0xb')](),interaction[_0x8edd('0x12')](_0x8edd('0x13'),_0x8edd('0x14')),controller['addTags']);router[_0x8edd('0x15')](_0x8edd('0xd'),auth[_0x8edd('0xb')](),interaction[_0x8edd('0x12')]('openchannel',_0x8edd('0x16')),controller[_0x8edd('0x17')]);router[_0x8edd('0x18')](_0x8edd('0xd'),auth[_0x8edd('0xb')](),interaction[_0x8edd('0x12')](_0x8edd('0x13'),'openchannelinteraction:destroy'),controller[_0x8edd('0x19')]);router[_0x8edd('0x18')](_0x8edd('0x11'),auth[_0x8edd('0xb')](),controller[_0x8edd('0x1a')]);module[_0x8edd('0x1b')]=router; \ No newline at end of file +var _0x2322=['create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','/:id','isAuthenticated','getMessages','/:id/download','post'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x2322,0xfe));var _0x2232=function(_0x364f09,_0x551aa3){_0x364f09=_0x364f09-0x0;var _0x45c1a6=_0x2322[_0x364f09];return _0x45c1a6;};'use strict';var multer=require(_0x2232('0x0'));var util=require(_0x2232('0x1'));var path=require(_0x2232('0x2'));var timeout=require(_0x2232('0x3'));var express=require('express');var router=express[_0x2232('0x4')]();var auth=require(_0x2232('0x5'));var interaction=require(_0x2232('0x6'));var config=require(_0x2232('0x7'));var controller=require(_0x2232('0x8'));router[_0x2232('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2232('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2232('0x9')](_0x2232('0xb'),auth[_0x2232('0xc')](),controller['show']);router['get']('/:id/messages',auth[_0x2232('0xc')](),controller[_0x2232('0xd')]);router[_0x2232('0x9')](_0x2232('0xe'),auth[_0x2232('0xc')](),controller['download']);router[_0x2232('0xf')]('/',auth[_0x2232('0xc')](),controller[_0x2232('0x10')]);router[_0x2232('0xf')](_0x2232('0x11'),auth['isAuthenticated'](),controller[_0x2232('0x12')]);router['post'](_0x2232('0x13'),auth[_0x2232('0xc')](),interaction[_0x2232('0x14')](_0x2232('0x15'),_0x2232('0x16')),controller[_0x2232('0x17')]);router[_0x2232('0x18')](_0x2232('0xb'),auth[_0x2232('0xc')](),interaction[_0x2232('0x14')]('openchannel',_0x2232('0x19')),controller[_0x2232('0x1a')]);router[_0x2232('0x1b')](_0x2232('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x2232('0x15'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0x2232('0x13'),auth[_0x2232('0xc')](),controller[_0x2232('0x1c')]);module[_0x2232('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index aa6558c..d72f100 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 _0x4d39=['DATE','ENUM','sequelize','exports','BOOLEAN','STRING'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x4d39,0xc8));var _0x94d3=function(_0x20be99,_0x38fc8a){_0x20be99=_0x20be99-0x0;var _0x4e7449=_0x4d39[_0x20be99];return _0x4e7449;};'use strict';var Sequelize=require(_0x94d3('0x0'));module[_0x94d3('0x1')]={'closed':{'type':Sequelize[_0x94d3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x94d3('0x3')]},'read1stAt':{'type':Sequelize[_0x94d3('0x4')]},'threadId':{'type':Sequelize[_0x94d3('0x3')]},'externalUrl':{'type':Sequelize[_0x94d3('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x94d3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x94d3('0x3')]}}; \ No newline at end of file +var _0xde62=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x7d5793,_0x4657ae){var _0xaa00c4=function(_0x4afa39){while(--_0x4afa39){_0x7d5793['push'](_0x7d5793['shift']());}};_0xaa00c4(++_0x4657ae);}(_0xde62,0x95));var _0x2de6=function(_0x226020,_0x42479a){_0x226020=_0x226020-0x0;var _0x48d325=_0xde62[_0x226020];return _0x48d325;};'use strict';var Sequelize=require(_0x2de6('0x0'));module[_0x2de6('0x1')]={'closed':{'type':Sequelize[_0x2de6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2de6('0x3')]},'disposition':{'type':Sequelize[_0x2de6('0x4')]},'note':{'type':Sequelize[_0x2de6('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2de6('0x4')]},'externalUrl':{'type':Sequelize[_0x2de6('0x4')]},'lastMsgAt':{'type':Sequelize[_0x2de6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2de6('0x5')]('in',_0x2de6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2de6('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 8a9fa9f..103e659 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 _0x69b4=['o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','show','includeAll','include','options','find','create','params','describe','addMessage','OpenchannelMessage','ids','getMessages','sort','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','Tag','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','get','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\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','Openchannel','YYYY-MM-DD','N.A.','closed','Public','Private','Messages','basename','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','field','color','from','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','OpenchannelAccountId','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax'];(function(_0x162a16,_0x20c857){var _0x35144f=function(_0x2f7834){while(--_0x2f7834){_0x162a16['push'](_0x162a16['shift']());}};_0x35144f(++_0x20c857);}(_0x69b4,0x133));var _0x469b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x69b4[_0x465028];return _0xb783d4;};'use strict';var pdf=require(_0x469b('0x0'));var emlformat=require(_0x469b('0x1'));var rimraf=require(_0x469b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x469b('0x3'));var rp=require(_0x469b('0x4'));var moment=require(_0x469b('0x5'));var BPromise=require(_0x469b('0x6'));var Mustache=require(_0x469b('0x7'));var util=require(_0x469b('0x8'));var path=require(_0x469b('0x9'));var sox=require(_0x469b('0xa'));var csv=require(_0x469b('0xb'));var ejs=require(_0x469b('0xc'));var fs=require('fs');var _=require(_0x469b('0xd'));var squel=require('squel');var crypto=require(_0x469b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x469b('0xf'));var toCsv=require(_0x469b('0xb'));var querystring=require(_0x469b('0x10'));var Papa=require(_0x469b('0x11'));var Redis=require('ioredis');var authService=require(_0x469b('0x12'));var qs=require(_0x469b('0x13'));var as=require(_0x469b('0x14'));var hardwareService=require(_0x469b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x469b('0x16'));var db=require(_0x469b('0x17'))['db'];config['redis']=_[_0x469b('0x18')](config[_0x469b('0x19')],{'host':_0x469b('0x1a'),'port':0x18eb});var socket=require(_0x469b('0x1b'))(new Redis(config[_0x469b('0x19')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3d392e,_0x28745e){_0x28745e=_0x28745e||0xcc;return function(_0x57cebe){if(_0x57cebe){return _0x3d392e[_0x469b('0x1c')](_0x28745e);}return _0x3d392e[_0x469b('0x1d')](_0x28745e)['end']();};}function respondWithResult(_0x5c359a,_0x5f0b5f){_0x5f0b5f=_0x5f0b5f||0xc8;return function(_0x51838d){if(_0x51838d){return _0x5c359a[_0x469b('0x1d')](_0x5f0b5f)[_0x469b('0x1e')](_0x51838d);}};}function respondWithFilteredResult(_0x2eaa20,_0x303238){return function(_0x37bbf6){if(_0x37bbf6){var _0x1b4a87=_0x37bbf6[_0x469b('0x1f')],_0x4cb5f8=_0x303238[_0x469b('0x20')],_0x45d8e2=_0x303238[_0x469b('0x20')]+_0x303238['limit'],_0x1e6527;if(_0x45d8e2>=_0x1b4a87){_0x45d8e2=_0x1b4a87;_0x1e6527=0xc8;}else{_0x1e6527=0xce;}_0x2eaa20[_0x469b('0x1d')](_0x1e6527);return _0x2eaa20[_0x469b('0x21')](_0x469b('0x22'),_0x4cb5f8+'-'+_0x45d8e2+'/'+_0x1b4a87)[_0x469b('0x1e')](_0x37bbf6);}return null;};}function patchUpdates(_0x53aad8){return function(_0x43a1eb){try{jsonpatch[_0x469b('0x23')](_0x43a1eb,_0x53aad8,!![]);}catch(_0x37e049){return BPromise[_0x469b('0x24')](_0x37e049);}return _0x43a1eb[_0x469b('0x25')]();};}function saveUpdates(_0x4f4ad3,_0x226a3a){return function(_0x4075bf){if(_0x4075bf){return _0x4075bf[_0x469b('0x26')](_0x4f4ad3)[_0x469b('0x27')](function(_0x268866){return _0x268866;});}return null;};}function removeEntity(_0x488058,_0x4866e4){return function(_0x70ab0){if(_0x70ab0){return _0x70ab0[_0x469b('0x28')]()[_0x469b('0x27')](function(){_0x488058[_0x469b('0x1d')](0xcc)[_0x469b('0x29')]();});}};}function handleEntityNotFound(_0x406f3f,_0x327a35){return function(_0x1f06ae){if(!_0x1f06ae){_0x406f3f['sendStatus'](0x194);}return _0x1f06ae;};}function handleError(_0x1aef4d,_0x220b69){_0x220b69=_0x220b69||0x1f4;return function(_0x31f298){logger[_0x469b('0x2a')](_0x31f298[_0x469b('0x2b')]);if(_0x31f298[_0x469b('0x2c')]){delete _0x31f298[_0x469b('0x2c')];}_0x1aef4d['status'](_0x220b69)[_0x469b('0x2d')](_0x31f298);};}function getInteractionUsers(_0x370947,_0x2aa10f){return new BPromise(function(_0x39ae53,_0x2569f8){try{if(_0x2aa10f[_0x370947['id']]){_0x370947[_0x469b('0x2e')]=_[_0x469b('0x2f')](_0x2aa10f[_0x370947['id']],function(_0x440c3c){return{'id':_0x440c3c['id'],'fullname':_0x440c3c[_0x469b('0x30')]};});}}catch(_0x5cb714){_0x2569f8(_0x5cb714);}_0x39ae53(_0x370947);});}function getInteractionTags(_0x27e239,_0x4a2fda){return new BPromise(function(_0x3af0de,_0x2aba99){try{if(_0x27e239[_0x469b('0x31')]){_0x27e239['Tags']=[];_0x27e239['TagIds'][_0x469b('0x32')](',')[_0x469b('0x33')](function(_0x3c7a93){_0x27e239[_0x469b('0x34')][_0x469b('0x35')](_0x4a2fda[_0x3c7a93]);});}delete _0x27e239[_0x469b('0x31')];}catch(_0x3dbe16){_0x2aba99(_0x3dbe16);}_0x3af0de(_0x27e239);});}function updateOpenchannelInteraction(_0xd52ac3,_0x222285,_0x337698){return new BPromise(function(_0x191aad,_0x21c62a){return getInteractionUsers(_0xd52ac3,_0x337698)['then'](function(_0x5c699b){return getInteractionTags(_0x5c699b,_0x222285);})[_0x469b('0x27')](function(_0x4d3539){_0x191aad(_0x4d3539);})['catch'](function(_0x13076a){_0x21c62a(_0x13076a);});});}exports[_0x469b('0x36')]=function(_0x433139,_0x28f5c1){var _0xa3be40={},_0x161f02={},_0x3fb683={'count':0x0,'rows':[]};var _0x187cee=_['map'](db[_0x469b('0x37')][_0x469b('0x38')],function(_0x38a159){return{'name':_0x38a159['fieldName'],'type':_0x38a159[_0x469b('0x39')][_0x469b('0x3a')]};});_0x161f02[_0x469b('0x3b')]=_['map'](_0x187cee,_0x469b('0x2c'));_0x161f02[_0x469b('0x3c')]=_[_0x469b('0x3d')](_0x433139[_0x469b('0x3c')]);_0x161f02[_0x469b('0x3e')]=_[_0x469b('0x3f')](_0x161f02[_0x469b('0x3b')],_0x161f02['query']);_0xa3be40[_0x469b('0x40')]=_[_0x469b('0x3f')](_0x161f02[_0x469b('0x3b')],qs[_0x469b('0x41')](_0x433139[_0x469b('0x3c')][_0x469b('0x41')]));_0xa3be40[_0x469b('0x40')]=_0xa3be40[_0x469b('0x40')][_0x469b('0x42')]?_0xa3be40['attributes']:_0x161f02[_0x469b('0x3b')];if(!_0x433139[_0x469b('0x3c')][_0x469b('0x43')](_0x469b('0x44'))){_0xa3be40['limit']=qs[_0x469b('0x45')](_0x433139[_0x469b('0x3c')]['limit']);_0xa3be40[_0x469b('0x20')]=qs[_0x469b('0x20')](_0x433139[_0x469b('0x3c')]['offset']);}_0xa3be40[_0x469b('0x46')]=qs['sort'](_0x433139[_0x469b('0x3c')]['sort']);_0xa3be40[_0x469b('0x47')]=qs[_0x469b('0x3e')](_[_0x469b('0x48')](_0x433139['query'],_0x161f02[_0x469b('0x3e')]),_0x187cee);var _0x2b68e5=[];var _0x41a411=squel['select']()[_0x469b('0x49')]('id')[_0x469b('0x49')](_0x469b('0x2c'))[_0x469b('0x49')](_0x469b('0x4a'))[_0x469b('0x4b')]('tools_tags');var _0x48d582=squel[_0x469b('0x4c')]()[_0x469b('0x49')](_0x469b('0x4d'))[_0x469b('0x49')](_0x469b('0x4e'))[_0x469b('0x49')](_0x469b('0x4f'))['from'](_0x469b('0x50'),'ui')[_0x469b('0x51')](_0x469b('0x52'),'u',_0x469b('0x53'));var _0x57a247=squel[_0x469b('0x4c')]()['from'](_0x469b('0x54'),'i')[_0x469b('0x51')]('cm_contacts','c',_0x469b('0x55'))['left_join']('users','o',_0x469b('0x56'))['left_join'](_0x469b('0x57'),'a',_0x469b('0x58'))[_0x469b('0x51')](_0x469b('0x59'),'me',_0x469b('0x5a'))[_0x469b('0x51')](_0x469b('0x5b'),'it',_0x469b('0x5c'))[_0x469b('0x51')](_0x469b('0x5d'),'t',_0x469b('0x5e'));var _0x5570e3=squel[_0x469b('0x5f')]();var _0x1217de=[];var _0x485785=squel[_0x469b('0x5f')]();var _0x5d8c10;if(_0x433139[_0x469b('0x3c')]['search']){_0x5d8c10=as[_0x469b('0x60')](_0x433139[_0x469b('0x3c')][_0x469b('0x61')]);var _0x21714a=_0x5d8c10['sqlOperator'];for(var _0x2654ef=0x0;_0x2654ef<_0x5d8c10[_0x469b('0x62')]['length'];_0x2654ef++){var _0x45d2b0=_0x5d8c10[_0x469b('0x62')][_0x2654ef];var _0x13b79e='i';var _0x4e5fe=_['find'](_0x187cee,[_0x469b('0x2c'),_0x45d2b0[_0x469b('0x49')]]);if(!_0x4e5fe){switch(_0x45d2b0[_0x469b('0x49')]){case _0x469b('0x63'):if(_0x45d2b0[_0x469b('0x64')]==0x1){_0x57a247[_0x469b('0x65')]('`'+_0x45d2b0[_0x469b('0x49')]+_0x469b('0x66'));}else{_0x57a247['having']('`'+_0x45d2b0[_0x469b('0x49')]+'`\x20>\x200');}break;case _0x469b('0x67'):if(_0x45d2b0[_0x469b('0x68')]==='$substring'){if(_0x45d2b0[_0x469b('0x64')][_0x469b('0x32')]('\x20')[_0x469b('0x42')]>0x1){_0x5570e3[_0x21714a](_0x469b('0x69'),qs[_0x469b('0x6a')](_0x45d2b0[_0x469b('0x64')]),null);}else{var _0x2245fd='%'+_0x45d2b0[_0x469b('0x64')]+'%';_0x5570e3[_0x21714a](_0x469b('0x6b'),_0x2245fd,_0x2245fd,_0x2245fd);}}else{_0x4e5fe=_['find'](_0x187cee,['name',_0x469b('0x6c')]);_0x45d2b0[_0x469b('0x49')]=_0x469b('0x6c');_0x3e6fb1=as[_0x469b('0x6d')](_0x13b79e,_0x4e5fe[_0x469b('0x39')],_0x45d2b0);_0x5570e3[_0x21714a](_0x3e6fb1[_0x469b('0x6e')],_0x3e6fb1[_0x469b('0x64')][_0x469b('0x6f')],_0x3e6fb1[_0x469b('0x64')]['end']);}break;case'Tag':var _0x48ed28=_0x45d2b0['value']['split'](',')[_0x469b('0x2f')](function(_0x41a090){return Number(_0x41a090);});_0x48ed28[_0x469b('0x33')](function(_0x2c9ba5){_0x485785['or'](_0x469b('0x70'),'%,'+_0x2c9ba5+',%');});_0x1217de=_['union'](_0x1217de,_0x48ed28);break;case _0x469b('0x71'):if(_0x45d2b0['operator']==='$substring'){_0x5570e3[_0x21714a](_0x469b('0x72'),'%'+_0x45d2b0[_0x469b('0x64')]+'%',null);}else{_0x4e5fe=_['find'](_0x187cee,['name','UserId']);_0x45d2b0[_0x469b('0x49')]=_0x469b('0x73');_0x3e6fb1=as[_0x469b('0x6d')](_0x13b79e,_0x4e5fe[_0x469b('0x39')],_0x45d2b0);_0x5570e3[_0x21714a](_0x3e6fb1[_0x469b('0x6e')],_0x3e6fb1['value'][_0x469b('0x6f')],_0x3e6fb1[_0x469b('0x64')][_0x469b('0x29')]);}break;case _0x469b('0x74'):_0x3e6fb1=as['buildExpression']('me',null,_0x45d2b0);_0x5570e3[_0x21714a](_0x3e6fb1[_0x469b('0x6e')],_0x3e6fb1['value'][_0x469b('0x6f')],_0x3e6fb1[_0x469b('0x64')]['end']);break;}}else{var _0x3e6fb1=as[_0x469b('0x6d')](_0x13b79e,_0x4e5fe[_0x469b('0x39')],_0x45d2b0);_0x5570e3[_0x21714a](_0x3e6fb1[_0x469b('0x6e')],_0x3e6fb1[_0x469b('0x64')]['start'],_0x3e6fb1['value']['end']);}}}else{var _0x248bd1=_(_0x433139[_0x469b('0x3c')])[_0x469b('0x3d')]()[_0x469b('0x2f')](function(_0x2b4ab7){return _[_0x469b('0x75')](_0x187cee,['name',_0x2b4ab7])?_0x2b4ab7:undefined;})['compact']()[_0x469b('0x64')]();if(!_[_0x469b('0x76')](_0x248bd1)){_0x248bd1[_0x469b('0x33')](function(_0x3ce40e){if(_0x3ce40e==='OpenchannelAccountId'){_0x57a247[_0x469b('0x47')](_0x469b('0x77'),[][_0x469b('0x78')](_0x433139[_0x469b('0x3c')][_0x3ce40e]));}else if(_0x3ce40e===_0x469b('0x79')){var _0x2953f9=JSON[_0x469b('0x7a')](_0x433139['query'][_0x3ce40e])[_0x469b('0x7b')];var _0x14c904=JSON[_0x469b('0x7a')](_0x433139['query'][_0x3ce40e])[_0x469b('0x7c')];_0x57a247[_0x469b('0x47')](_0x469b('0x7d'),_0x2953f9,_0x14c904);}else{if(_0x433139[_0x469b('0x3c')][_0x3ce40e]===_0x469b('0x7e')){_0x57a247[_0x469b('0x47')]('i.'+_0x3ce40e+'\x20IS\x20NULL');}else{_0x57a247[_0x469b('0x47')]('i.'+_0x3ce40e+_0x469b('0x7f'),_0x433139[_0x469b('0x3c')][_0x3ce40e]);}}});}if(_0x433139[_0x469b('0x3c')][_0x469b('0x80')]){if(_0x433139[_0x469b('0x3c')][_0x469b('0x80')]==0x1){_0x57a247['having'](_0x469b('0x81'));}else{_0x57a247['having'](_0x469b('0x82'));}}if(_0x433139[_0x469b('0x3c')][_0x469b('0x83')]){_0x1217de=_[_0x469b('0x84')](_0x433139['query']['tag'])?_0x433139['query'][_0x469b('0x83')]:new Array(_0x433139[_0x469b('0x3c')][_0x469b('0x83')]);_0x1217de[_0x469b('0x33')](function(_0x40dca3){_0x485785['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40dca3+',%');});}if(_0x433139[_0x469b('0x3c')]['filter']){var _0xb8178a=_0x433139[_0x469b('0x3c')][_0x469b('0x85')][_0x469b('0x86')]('\x5c','\x5c\x5c')[_0x469b('0x86')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x469b('0x87')](_0xb8178a)){_0x5570e3['or'](_0x469b('0x88'),_0xb8178a+'%');}else{_0x5570e3['or'](_0x469b('0x89'),qs['getFullTextValue'](_0xb8178a))['or'](_0x469b('0x8a'),_0xb8178a+'%')['or'](_0x469b('0x8b'),_0xb8178a+'%');}}}_0x57a247[_0x469b('0x47')](_0x5570e3);_0x57a247[_0x469b('0x8c')](_0x469b('0x8d'));var _0x252c64={'type':db[_0x469b('0x8e')]['QueryTypes'][_0x469b('0x8f')],'raw':!![]};var _0x1508bf=_0x57a247[_0x469b('0x90')]();_0x1508bf[_0x469b('0x49')](_0x469b('0x8d'));_0x1508bf[_0x469b('0x49')](_0x469b('0x91'),_0x469b('0x63'));if(_0xa3be40['order']){_0xa3be40[_0x469b('0x46')]['forEach'](function(_0x387011){_0x57a247[_0x469b('0x46')]('i.'+_0x387011[0x0],_0x387011[0x1]===_0x469b('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x1217de)){_0x57a247[_0x469b('0x65')](_0x485785);_0x1508bf[_0x469b('0x47')]('t.id\x20IN\x20?',_0x1217de);}BPromise['resolve']()[_0x469b('0x27')](function(){if(!_0x5d8c10){if(_0x433139[_0x469b('0x3c')][_0x469b('0x93')]||_0x433139[_0x469b('0x3c')][_0x469b('0x94')])return;_0x1508bf['where'](_0x469b('0x95'));_0x57a247[_0x469b('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x433139[_0x469b('0x96')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x469b('0x27')](function(_0x189bd1){if(_[_0x469b('0x76')](_0x189bd1)){_0x1508bf[_0x469b('0x47')](_0x469b('0x97'));_0x57a247[_0x469b('0x47')](_0x469b('0x97'));}else{_0x1508bf[_0x469b('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x189bd1,'id'));_0x57a247[_0x469b('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x469b('0x2f')](_0x189bd1,'id'));}});})[_0x469b('0x27')](function(){db[_0x469b('0x98')][_0x469b('0x3c')](_0x1508bf[_0x469b('0x99')](),_0x252c64)[_0x469b('0x27')](function(_0x136b88){_0x3fb683[_0x469b('0x1f')]=_0x136b88[_0x469b('0x42')];if(_0x3fb683['count']===0x0)return[];return db[_0x469b('0x98')]['query'](_0x41a411[_0x469b('0x99')](),_0x252c64)[_0x469b('0x27')](function(_0x2b989e){_0x2b68e5=_[_0x469b('0x9a')](_0x2b989e,'id');_0x252c64=_[_0x469b('0x9b')](_0x252c64,{'model':db[_0x469b('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x433139[_0x469b('0x3c')][_0x469b('0x41')]){_0xa3be40[_0x469b('0x40')][_0x469b('0x33')](function(_0x1e5d04){_0x57a247[_0x469b('0x49')]('i.'+_0x1e5d04);});}else{_0x57a247[_0x469b('0x49')](_0x469b('0x91'),'unreadMessages');_0x57a247[_0x469b('0x49')](_0x469b('0x9c'),_0x469b('0x9d'));_0x57a247[_0x469b('0x49')](_0x469b('0x9e'),'Account.mandatoryDisposition');_0x57a247[_0x469b('0x49')](_0x469b('0x9f'));_0x57a247[_0x469b('0x49')](_0x469b('0xa0'),_0x469b('0xa1'));_0x57a247[_0x469b('0x49')](_0x469b('0xa2'),_0x469b('0xa3'));_0x57a247['field'](_0x469b('0xa4'),_0x469b('0xa5'));_0x57a247['field'](_0x469b('0xa6'),_0x469b('0xa7'));_0x57a247[_0x469b('0x49')]('c.mobile','Contact.mobile');_0x57a247[_0x469b('0x49')](_0x469b('0xa8'),'Contact.fax');_0x57a247[_0x469b('0x49')](_0x469b('0xa9'),_0x469b('0xaa'));_0x57a247[_0x469b('0x49')](_0x469b('0xab'),'Owner.internal');_0x57a247[_0x469b('0x49')](_0x469b('0xac'),_0x469b('0x31'));}if(_0xa3be40[_0x469b('0x45')])_0x57a247[_0x469b('0x45')](_0xa3be40[_0x469b('0x45')]);if(_0xa3be40[_0x469b('0x20')])_0x57a247[_0x469b('0x20')](_0xa3be40['offset']);return db[_0x469b('0x98')]['query'](_0x57a247[_0x469b('0x99')](),_0x252c64);})[_0x469b('0x27')](function(_0x73943e){_0x48d582['where'](_0x469b('0xad'),_[_0x469b('0x2f')](_0x73943e,'id'));return db['sequelize'][_0x469b('0x3c')](_0x48d582['toString'](),_0x252c64)[_0x469b('0x27')](function(_0x3b9af6){var _0x696394=_[_0x469b('0xae')](_0x3b9af6,_0x469b('0xaf'));var _0x9c079c=[];_0x73943e[_0x469b('0x33')](function(_0x326e73){_0x9c079c['push'](updateOpenchannelInteraction(_0x326e73,_0x2b68e5,_0x696394));});return BPromise[_0x469b('0xb0')](_0x9c079c);});});})[_0x469b('0x27')](function(_0x4c90dc){_0x3fb683[_0x469b('0xb1')]=_0x4c90dc;return _0x3fb683;})[_0x469b('0x27')](respondWithFilteredResult(_0x28f5c1,_0xa3be40));})[_0x469b('0xb2')](handleError(_0x28f5c1,null));};exports[_0x469b('0xb3')]=function(_0xd7a55f,_0x2c07cc){var _0x5c69f7={'raw':![],'where':{'id':_0xd7a55f['params']['id']}},_0x469c25={};_0x469c25[_0x469b('0x3b')]=_[_0x469b('0x3d')](db['OpenchannelInteraction'][_0x469b('0x38')]);_0x469c25['query']=_[_0x469b('0x3d')](_0xd7a55f[_0x469b('0x3c')]);_0x469c25[_0x469b('0x3e')]=_[_0x469b('0x3f')](_0x469c25['model'],_0x469c25[_0x469b('0x3c')]);_0x5c69f7[_0x469b('0x40')]=_[_0x469b('0x3f')](_0x469c25[_0x469b('0x3b')],qs['fields'](_0xd7a55f[_0x469b('0x3c')][_0x469b('0x41')]));_0x5c69f7[_0x469b('0x40')]=_0x5c69f7[_0x469b('0x40')][_0x469b('0x42')]?_0x5c69f7['attributes']:_0x469c25[_0x469b('0x3b')];if(_0xd7a55f['query'][_0x469b('0xb4')]){_0x5c69f7[_0x469b('0xb5')]=[{'all':!![]}];}_0x5c69f7=_['merge']({},_0x5c69f7,_0xd7a55f[_0x469b('0xb6')]);return db[_0x469b('0x37')][_0x469b('0xb7')](_0x5c69f7)[_0x469b('0x27')](handleEntityNotFound(_0x2c07cc,null))[_0x469b('0x27')](respondWithResult(_0x2c07cc,null))[_0x469b('0xb2')](handleError(_0x2c07cc,null));};exports[_0x469b('0xb8')]=function(_0x6b6944,_0x61f4a5){return db['OpenchannelInteraction'][_0x469b('0xb8')](_0x6b6944['body'],{})['then'](respondWithResult(_0x61f4a5,0xc9))[_0x469b('0xb2')](handleError(_0x61f4a5,null));};exports[_0x469b('0x26')]=function(_0x28d53f,_0x21850b){if(_0x28d53f['body']['id']){delete _0x28d53f[_0x469b('0x74')]['id'];}return db[_0x469b('0x37')]['find']({'where':{'id':_0x28d53f[_0x469b('0xb9')]['id']}})[_0x469b('0x27')](handleEntityNotFound(_0x21850b,null))[_0x469b('0x27')](saveUpdates(_0x28d53f[_0x469b('0x74')],null))[_0x469b('0x27')](respondWithResult(_0x21850b,null))[_0x469b('0xb2')](handleError(_0x21850b,null));};exports['destroy']=function(_0x3bbf58,_0x234ca5){return db[_0x469b('0x37')]['find']({'where':{'id':_0x3bbf58[_0x469b('0xb9')]['id']}})['then'](handleEntityNotFound(_0x234ca5,null))['then'](removeEntity(_0x234ca5,null))[_0x469b('0xb2')](handleError(_0x234ca5,null));};exports[_0x469b('0xba')]=function(_0x23c9e0,_0x582de8){return db[_0x469b('0x37')][_0x469b('0xba')]()['then'](respondWithResult(_0x582de8,null))['catch'](handleError(_0x582de8,null));};exports[_0x469b('0xbb')]=function(_0x408a59,_0x275ac6,_0x27ca85){return db[_0x469b('0xbc')][_0x469b('0xb7')]({'where':{'id':_0x408a59[_0x469b('0xb9')]['id']}})[_0x469b('0x27')](handleEntityNotFound(_0x275ac6,null))[_0x469b('0x27')](function(_0x3aa147){if(_0x3aa147){return _0x3aa147[_0x469b('0xbb')](_0x408a59[_0x469b('0x74')][_0x469b('0xbd')],_['omit'](_0x408a59[_0x469b('0x74')],['ids','id'])||{});}})[_0x469b('0x27')](respondWithResult(_0x275ac6,null))[_0x469b('0xb2')](handleError(_0x275ac6,null));};exports[_0x469b('0xbe')]=function(_0x52f609,_0x2a86fb,_0x35815a){var _0x182b2c={'raw':![],'where':{}};var _0x42d738={};var _0x26eb7c={'count':0x0,'rows':[]};return db[_0x469b('0x37')]['findOne']({'where':{'id':_0x52f609['params']['id']}})['then'](handleEntityNotFound(_0x2a86fb,null))[_0x469b('0x27')](function(_0x22c8ef){if(_0x22c8ef){_0x42d738[_0x469b('0x3b')]=_[_0x469b('0x3d')](db[_0x469b('0xbc')][_0x469b('0x38')]);_0x42d738[_0x469b('0x3c')]=_['keys'](_0x52f609[_0x469b('0x3c')]);_0x42d738[_0x469b('0x3e')]=_[_0x469b('0x3f')](_0x42d738[_0x469b('0x3b')],_0x42d738[_0x469b('0x3c')]);_0x182b2c[_0x469b('0x40')]=_['intersection'](_0x42d738[_0x469b('0x3b')],qs[_0x469b('0x41')](_0x52f609[_0x469b('0x3c')][_0x469b('0x41')]));_0x182b2c[_0x469b('0x40')]=_0x182b2c[_0x469b('0x40')]['length']?_0x182b2c['attributes']:_0x42d738[_0x469b('0x3b')];if(!_0x52f609[_0x469b('0x3c')][_0x469b('0x43')]('nolimit')){_0x182b2c[_0x469b('0x45')]=qs['limit'](_0x52f609['query'][_0x469b('0x45')]);_0x182b2c[_0x469b('0x20')]=qs[_0x469b('0x20')](_0x52f609[_0x469b('0x3c')][_0x469b('0x20')]);}_0x182b2c[_0x469b('0x46')]=qs[_0x469b('0xbf')](_0x52f609[_0x469b('0x3c')][_0x469b('0xbf')]);_0x182b2c[_0x469b('0x47')]=qs['filters'](_['pick'](_0x52f609[_0x469b('0x3c')],_0x42d738[_0x469b('0x3e')]));_0x182b2c[_0x469b('0x47')]['OpenchannelInteractionId']=_0x22c8ef['id'];if(_0x52f609[_0x469b('0x3c')][_0x469b('0x85')]){_0x182b2c[_0x469b('0x47')]=_[_0x469b('0x9b')](_0x182b2c[_0x469b('0x47')],{'$or':_[_0x469b('0x2f')](_0x182b2c[_0x469b('0x40')],function(_0x5745e2){var _0x1d8630={};_0x1d8630[_0x5745e2]={'$like':'%'+_0x52f609[_0x469b('0x3c')][_0x469b('0x85')]+'%'};return _0x1d8630;})});}if(_0x52f609[_0x469b('0x3c')][_0x469b('0x7b')]){var _0x352cd1=_0x52f609['query'][_0x469b('0x7b')][_0x469b('0x32')](',');var _0x1b8ef7={};_0x1b8ef7[_0x352cd1[0x0]]={'$gte':moment(_0x352cd1[0x1])[_0x469b('0xc0')](_0x469b('0xc1'))};_0x182b2c['where']=_[_0x469b('0x9b')](_0x182b2c[_0x469b('0x47')],_0x1b8ef7);}_0x182b2c=_[_0x469b('0x9b')]({},_0x182b2c,_0x52f609[_0x469b('0xb6')]);return db[_0x469b('0xbc')][_0x469b('0x1f')]({'where':_0x182b2c[_0x469b('0x47')]})[_0x469b('0x27')](function(_0x24ed22){_0x26eb7c['count']=_0x24ed22;if(_0x52f609[_0x469b('0x3c')][_0x469b('0xb4')]){_0x182b2c['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x469b('0xc2')](_0x182b2c);})['then'](function(_0x511e8d){_0x26eb7c['rows']=_0x511e8d;return _0x26eb7c;});}})[_0x469b('0x27')](respondWithFilteredResult(_0x2a86fb,_0x182b2c))[_0x469b('0xb2')](handleError(_0x2a86fb,null));};exports['addTags']=function(_0x539589,_0x30f2c0,_0x491167){return db[_0x469b('0x37')][_0x469b('0xb7')]({'where':{'id':_0x539589[_0x469b('0xb9')]['id']}})[_0x469b('0x27')](handleEntityNotFound(_0x30f2c0,null))[_0x469b('0x27')](function(_0x3f0bea){if(_0x3f0bea){return _0x3f0bea[_0x469b('0xc3')](_0x539589[_0x469b('0x74')][_0x469b('0xbd')],_[_0x469b('0xc4')](_0x539589[_0x469b('0x74')],[_0x469b('0xbd'),'id'])||{})['spread'](function(){return db[_0x469b('0xc5')][_0x469b('0xc2')]({'attributes':['id',_0x469b('0x2c'),_0x469b('0x4a')],'where':{'id':_0x539589[_0x469b('0x74')]['ids']}});})['then'](function(_0x2af8b7){socket['emit'](_0x469b('0xc6'),{'id':Number(_0x539589[_0x469b('0xb9')]['id']),'tags':_0x2af8b7||[]});return{'id':Number(_0x539589[_0x469b('0xb9')]['id']),'tags':_0x2af8b7||[]};});}})[_0x469b('0x27')](respondWithResult(_0x30f2c0,null))[_0x469b('0xb2')](handleError(_0x30f2c0,null));};exports[_0x469b('0xc7')]=function(_0x3728f5,_0x405249,_0x4d8b2d){return db[_0x469b('0x37')][_0x469b('0xb7')]({'where':{'id':_0x3728f5['params']['id']}})[_0x469b('0x27')](handleEntityNotFound(_0x405249,null))['then'](function(_0x16f239){if(_0x16f239){return _0x16f239[_0x469b('0xc7')](_0x3728f5[_0x469b('0x3c')][_0x469b('0xbd')]);}})[_0x469b('0x27')](respondWithStatusCode(_0x405249,null))[_0x469b('0xb2')](handleError(_0x405249,null));};exports[_0x469b('0xc8')]=function(_0x570146,_0x4d7468){var _0x1074a6=moment()[_0x469b('0xc9')]()[_0x469b('0x99')]();var _0x10b2a6=path[_0x469b('0xca')](config[_0x469b('0xcb')],_0x469b('0xcc'),_0x469b('0xcd'),'tmp');var _0x2ba748=path[_0x469b('0xca')](config[_0x469b('0xcb')],_0x469b('0xcc'),'files',_0x469b('0xce'));var _0x379290=path['join'](_0x10b2a6,_0x1074a6);var _0xa59730=util['format'](_0x469b('0xcf'),_0x570146[_0x469b('0xb9')]['id'],_0x1074a6);var _0x3d0fab=path[_0x469b('0xca')](_0x10b2a6,_0xa59730);var _0x8d301c=[];_0x8d301c[_0x469b('0x35')]({'model':db[_0x469b('0x71')],'as':_0x469b('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x8d301c[_0x469b('0x35')]({'model':db['CmContact'],'as':_0x469b('0x67'),'attributes':['id',_0x469b('0xd0'),_0x469b('0xd1')],'raw':!![]});if(_0x570146[_0x469b('0x3c')][_0x469b('0xce')]){_0x8d301c[_0x469b('0x35')]({'model':db[_0x469b('0xd2')],'as':_0x469b('0xd2'),'raw':!![]});}var _0x5e702e=[{'model':db[_0x469b('0xbc')],'as':'Messages','attributes':['id',_0x469b('0x74'),'createdAt',_0x469b('0xd3'),'secret',_0x469b('0x80')],'include':_0x8d301c}];_0x5e702e[_0x469b('0x35')]({'model':db[_0x469b('0xd4')],'as':_0x469b('0xd5'),'attributes':['id',_0x469b('0x2c')]});_0x5e702e['push']({'model':db[_0x469b('0x71')],'as':_0x469b('0xd6'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x469b('0xb7')]({'where':{'id':_0x570146[_0x469b('0xb9')]['id']},'include':_0x5e702e})['then'](handleEntityNotFound(_0x4d7468,null))[_0x469b('0x27')](function(_0x433608){if(_0x433608){var _0x537749=_0x433608[_0x469b('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x379290);var _0x16b12a={'format':'A4','border':'10px','header':{'height':_0x469b('0xd8'),'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':'30px','contents':{'default':util[_0x469b('0xc0')](_0x469b('0xd9'),util[_0x469b('0xc0')](_0x469b('0xda'),_0x469b('0xdb'),_0x537749['id']),moment()[_0x469b('0xc0')](_0x469b('0xdc'))['toString']())}}};var _0xf525d2={'channel':'Openchannel','account':_0x537749['Account'][_0x469b('0x2c')],'agent':_0x537749[_0x469b('0xd6')]?_0x537749[_0x469b('0xd6')][_0x469b('0x30')]:_0x469b('0xdd'),'createdAt':moment(_0x537749[_0x469b('0x79')])[_0x469b('0xc0')](_0x469b('0xc1'))[_0x469b('0x99')](),'closedAt':_0x537749[_0x469b('0xde')]?moment(_0x537749['closedAt'])['format'](_0x469b('0xc1'))['toString']():'','disposition':_0x537749['disposition'],'visibility':_0x537749['threadId']?_0x469b('0xdf'):_0x469b('0xe0'),'messages':_(_0x537749[_0x469b('0xe1')])[_0x469b('0x85')]({'secret':![]})[_0x469b('0x2f')](function(_0x523021){if(_0x523021[_0x469b('0xd2')]){var _0x411b6a=path['join'](_0x2ba748,_0x523021[_0x469b('0xd2')][_0x469b('0xe2')]);if(fs['existsSync'](_0x411b6a)){fs[_0x469b('0xe3')](_0x411b6a)[_0x469b('0xe4')](fs['createWriteStream'](path[_0x469b('0xca')](_0x379290,_0x523021[_0x469b('0xd2')]['basename'])));}}return{'date':moment(_0x523021[_0x469b('0x79')])[_0x469b('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x523021[_0x469b('0xd3')]===_0x469b('0xe5')?_0x523021[_0x469b('0x71')]?_0x523021[_0x469b('0x71')][_0x469b('0x30')]:_0x469b('0xe6'):_0x523021[_0x469b('0x67')][_0x469b('0xd0')]+(_0x523021[_0x469b('0x67')]['lastName']?'\x20'+_0x523021[_0x469b('0x67')]['lastName']:''),'body':_0x523021[_0x469b('0xd2')]?_0x523021[_0x469b('0xd2')][_0x469b('0xe2')]:_0x523021['body'],'direction':_0x523021[_0x469b('0xd3')]===_0x469b('0xe5')?'A':'C','secret':_0x523021['secret'],'read':_0x523021[_0x469b('0x80')],'attachment':_0x523021[_0x469b('0xd2')]};})[_0x469b('0x64')]()};return ejs[_0x469b('0xe7')](path[_0x469b('0xca')](config[_0x469b('0xcb')],'server',_0x469b('0xe8'),_0x469b('0xe9')),{'interaction':_0xf525d2})[_0x469b('0x27')](function(_0x5a0d39){return new BPromise(function(_0x555a19,_0x228191){pdf[_0x469b('0xb8')](_0x5a0d39,_0x16b12a)[_0x469b('0xea')](path[_0x469b('0xca')](_0x379290,'transcript-'+_0x537749['id']+'-'+_0x1074a6+_0x469b('0xeb')),function(_0x47f1fd,_0x1bde46){if(_0x47f1fd)return _0x228191(_0x47f1fd);_0x555a19(_0x1bde46);});});})[_0x469b('0x27')](function(){return new BPromise(function(_0x1cc6e7,_0x1f5317){zipdir(_0x379290,{'saveTo':_0x3d0fab},function(_0x7ace00,_0x3f51bd){if(_0x7ace00)return _0x1f5317(_0x7ace00);return _0x1cc6e7(_0x3f51bd);});})[_0x469b('0x27')](function(){return new BPromise(function(_0x17c20c,_0x383a78){rimraf(_0x379290,function(_0x1fb3e9){if(_0x1fb3e9)_0x383a78(_0x1fb3e9);return _0x17c20c();});});})[_0x469b('0x27')](function(){return _0x4d7468['download'](_0x3d0fab,_0xa59730,function(_0x3dbbb2){if(_0x3dbbb2){console[_0x469b('0xec')](_0x469b('0xed'),_0x3dbbb2);}else{fs['unlinkSync'](_0x3d0fab);}});});});}else{return _0x4d7468[_0x469b('0x1c')](0xc8);}})['catch'](handleError(_0x4d7468,null));}; \ No newline at end of file +var _0xbb7f=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','push','catch','index','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','forEach','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','include','options','find','create','params','describe','addMessage','OpenchannelMessage','omit','ids','findOne','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','openchannelInteractionTags:save','removeTags','download','join','root','files','tmp','transcript-%d-%s.zip','User','firstName','lastName','attachments','Attachment','secret','OpenchannelAccount','Account','Owner','get','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','\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','Openchannel','YYYY-MM-DD','closed','closedAt','Public','Private','Messages','existsSync','createWriteStream','direction','basename','renderFile','server','views','downloadInteraction.html','toFile','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x24324d,_0x344af5){var _0x4f2b22=function(_0x2b3c2e){while(--_0x2b3c2e){_0x24324d['push'](_0x24324d['shift']());}};_0x4f2b22(++_0x344af5);}(_0xbb7f,0xe3));var _0xfbb7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb7f[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xfbb7('0x0'));var emlformat=require(_0xfbb7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfbb7('0x2'));var jsonpatch=require(_0xfbb7('0x3'));var rp=require(_0xfbb7('0x4'));var moment=require('moment');var BPromise=require(_0xfbb7('0x5'));var Mustache=require(_0xfbb7('0x6'));var util=require(_0xfbb7('0x7'));var path=require(_0xfbb7('0x8'));var sox=require('sox');var csv=require(_0xfbb7('0x9'));var ejs=require(_0xfbb7('0xa'));var fs=require('fs');var _=require(_0xfbb7('0xb'));var squel=require(_0xfbb7('0xc'));var crypto=require(_0xfbb7('0xd'));var jsforce=require(_0xfbb7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfbb7('0x9'));var querystring=require(_0xfbb7('0xf'));var Papa=require(_0xfbb7('0x10'));var Redis=require(_0xfbb7('0x11'));var authService=require(_0xfbb7('0x12'));var qs=require(_0xfbb7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbb7('0x14'));var logger=require(_0xfbb7('0x15'))(_0xfbb7('0x16'));var utils=require(_0xfbb7('0x17'));var config=require(_0xfbb7('0x18'));var db=require('../../mysqldb')['db'];config[_0xfbb7('0x19')]=_['defaults'](config[_0xfbb7('0x19')],{'host':_0xfbb7('0x1a'),'port':0x18eb});var socket=require(_0xfbb7('0x1b'))(new Redis(config[_0xfbb7('0x19')]));require(_0xfbb7('0x1c'))[_0xfbb7('0x1d')](socket);function respondWithStatusCode(_0x5b3fd5,_0x33c8f8){_0x33c8f8=_0x33c8f8||0xcc;return function(_0x1c87f2){if(_0x1c87f2){return _0x5b3fd5[_0xfbb7('0x1e')](_0x33c8f8);}return _0x5b3fd5[_0xfbb7('0x1f')](_0x33c8f8)[_0xfbb7('0x20')]();};}function respondWithResult(_0x11c690,_0x467d6a){_0x467d6a=_0x467d6a||0xc8;return function(_0xf86d47){if(_0xf86d47){return _0x11c690[_0xfbb7('0x1f')](_0x467d6a)[_0xfbb7('0x21')](_0xf86d47);}};}function respondWithFilteredResult(_0x2ea117,_0x36c9ad){return function(_0x5d7863){if(_0x5d7863){var _0x4462ad=_0x5d7863[_0xfbb7('0x22')],_0x9e8916=_0x36c9ad[_0xfbb7('0x23')],_0x386649=_0x36c9ad[_0xfbb7('0x23')]+_0x36c9ad['limit'],_0x395f91;if(_0x386649>=_0x4462ad){_0x386649=_0x4462ad;_0x395f91=0xc8;}else{_0x395f91=0xce;}_0x2ea117['status'](_0x395f91);return _0x2ea117[_0xfbb7('0x24')](_0xfbb7('0x25'),_0x9e8916+'-'+_0x386649+'/'+_0x4462ad)[_0xfbb7('0x21')](_0x5d7863);}return null;};}function patchUpdates(_0x1e2f95){return function(_0x559bca){try{jsonpatch[_0xfbb7('0x26')](_0x559bca,_0x1e2f95,!![]);}catch(_0x202a3b){return BPromise[_0xfbb7('0x27')](_0x202a3b);}return _0x559bca[_0xfbb7('0x28')]();};}function saveUpdates(_0x1ffbe4,_0x245bd0){return function(_0x5a337e){if(_0x5a337e){return _0x5a337e[_0xfbb7('0x29')](_0x1ffbe4)[_0xfbb7('0x2a')](function(_0x2a0c6b){return _0x2a0c6b;});}return null;};}function removeEntity(_0x39ce6e,_0x1beed3){return function(_0x44e563){if(_0x44e563){return _0x44e563[_0xfbb7('0x2b')]()[_0xfbb7('0x2a')](function(){_0x39ce6e[_0xfbb7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11d615,_0x2f1be7){return function(_0x14d13f){if(!_0x14d13f){_0x11d615['sendStatus'](0x194);}return _0x14d13f;};}function handleError(_0x2cec5e,_0x301d88){_0x301d88=_0x301d88||0x1f4;return function(_0x9c5735){logger[_0xfbb7('0x2c')](_0x9c5735[_0xfbb7('0x2d')]);if(_0x9c5735[_0xfbb7('0x2e')]){delete _0x9c5735[_0xfbb7('0x2e')];}_0x2cec5e[_0xfbb7('0x1f')](_0x301d88)[_0xfbb7('0x2f')](_0x9c5735);};}function getInteractionUsers(_0x50f15f,_0x16797b){return new BPromise(function(_0x3657d5,_0x26460e){try{if(_0x16797b[_0x50f15f['id']]){_0x50f15f['Users']=_[_0xfbb7('0x30')](_0x16797b[_0x50f15f['id']],function(_0x551ae0){return{'id':_0x551ae0['id'],'fullname':_0x551ae0[_0xfbb7('0x31')]};});}}catch(_0x23c3ab){_0x26460e(_0x23c3ab);}_0x3657d5(_0x50f15f);});}function getInteractionTags(_0x7f1ee8,_0x1e403b){return new BPromise(function(_0x3a86f0,_0xd435d8){try{if(_0x7f1ee8[_0xfbb7('0x32')]){_0x7f1ee8[_0xfbb7('0x33')]=[];_0x7f1ee8['TagIds']['split'](',')['forEach'](function(_0x5d72a9){_0x7f1ee8[_0xfbb7('0x33')][_0xfbb7('0x34')](_0x1e403b[_0x5d72a9]);});}delete _0x7f1ee8[_0xfbb7('0x32')];}catch(_0x5eb7bd){_0xd435d8(_0x5eb7bd);}_0x3a86f0(_0x7f1ee8);});}function updateOpenchannelInteraction(_0x3994ac,_0xcbaffd,_0xb18fd8){return new BPromise(function(_0x532979,_0x3db56c){return getInteractionUsers(_0x3994ac,_0xb18fd8)[_0xfbb7('0x2a')](function(_0x56a762){return getInteractionTags(_0x56a762,_0xcbaffd);})[_0xfbb7('0x2a')](function(_0x3b701d){_0x532979(_0x3b701d);})[_0xfbb7('0x35')](function(_0x3f14be){_0x3db56c(_0x3f14be);});});}exports[_0xfbb7('0x36')]=function(_0x554876,_0x5c022a){var _0x19b9c6={},_0x22efe5={},_0x16390a={'count':0x0,'rows':[]};var _0x55c513=_[_0xfbb7('0x30')](db['OpenchannelInteraction'][_0xfbb7('0x37')],function(_0x1370cd){return{'name':_0x1370cd[_0xfbb7('0x38')],'type':_0x1370cd[_0xfbb7('0x39')]['key']};});_0x22efe5[_0xfbb7('0x3a')]=_[_0xfbb7('0x30')](_0x55c513,'name');_0x22efe5['query']=_[_0xfbb7('0x3b')](_0x554876[_0xfbb7('0x3c')]);_0x22efe5[_0xfbb7('0x3d')]=_[_0xfbb7('0x3e')](_0x22efe5[_0xfbb7('0x3a')],_0x22efe5[_0xfbb7('0x3c')]);_0x19b9c6[_0xfbb7('0x3f')]=_[_0xfbb7('0x3e')](_0x22efe5['model'],qs[_0xfbb7('0x40')](_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x40')]));_0x19b9c6[_0xfbb7('0x3f')]=_0x19b9c6[_0xfbb7('0x3f')]['length']?_0x19b9c6['attributes']:_0x22efe5[_0xfbb7('0x3a')];if(!_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x41')](_0xfbb7('0x42'))){_0x19b9c6[_0xfbb7('0x43')]=qs['limit'](_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x43')]);_0x19b9c6['offset']=qs[_0xfbb7('0x23')](_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x23')]);}_0x19b9c6[_0xfbb7('0x44')]=qs['sort'](_0x554876['query']['sort']);_0x19b9c6[_0xfbb7('0x45')]=qs[_0xfbb7('0x3d')](_[_0xfbb7('0x46')](_0x554876[_0xfbb7('0x3c')],_0x22efe5[_0xfbb7('0x3d')]),_0x55c513);var _0x2e6309=[];var _0x37c27f=squel[_0xfbb7('0x47')]()[_0xfbb7('0x48')]('id')[_0xfbb7('0x48')](_0xfbb7('0x2e'))['field'](_0xfbb7('0x49'))[_0xfbb7('0x4a')]('tools_tags');var _0x39de9e=squel['select']()[_0xfbb7('0x48')](_0xfbb7('0x4b'))[_0xfbb7('0x48')]('u.fullname')[_0xfbb7('0x48')](_0xfbb7('0x4c'))[_0xfbb7('0x4a')](_0xfbb7('0x4d'),'ui')[_0xfbb7('0x4e')](_0xfbb7('0x4f'),'u',_0xfbb7('0x50'));var _0x254242=squel['select']()[_0xfbb7('0x4a')]('openchannel_interactions','i')[_0xfbb7('0x4e')](_0xfbb7('0x51'),'c',_0xfbb7('0x52'))[_0xfbb7('0x4e')](_0xfbb7('0x4f'),'o',_0xfbb7('0x53'))['left_join'](_0xfbb7('0x54'),'a',_0xfbb7('0x55'))[_0xfbb7('0x4e')](_0xfbb7('0x56'),'me',_0xfbb7('0x57'))[_0xfbb7('0x4e')](_0xfbb7('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xfbb7('0x4e')](_0xfbb7('0x59'),'t',_0xfbb7('0x5a'));var _0x596c1e=squel[_0xfbb7('0x5b')]();var _0x25dc4e=[];var _0x8f0c31=squel['expr']();var _0xb17b7;if(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x5c')]){_0xb17b7=as['parseSearch'](_0x554876[_0xfbb7('0x3c')]['search']);var _0x3f67c7=_0xb17b7['sqlOperator'];for(var _0x1f40ff=0x0;_0x1f40ff<_0xb17b7[_0xfbb7('0x5d')][_0xfbb7('0x5e')];_0x1f40ff++){var _0x73b7ac=_0xb17b7[_0xfbb7('0x5d')][_0x1f40ff];var _0x4f242f='i';var _0x4f00e8=_['find'](_0x55c513,[_0xfbb7('0x2e'),_0x73b7ac[_0xfbb7('0x48')]]);if(!_0x4f00e8){switch(_0x73b7ac[_0xfbb7('0x48')]){case _0xfbb7('0x5f'):if(_0x73b7ac[_0xfbb7('0x60')]==0x1){_0x254242[_0xfbb7('0x61')]('`'+_0x73b7ac[_0xfbb7('0x48')]+_0xfbb7('0x62'));}else{_0x254242['having']('`'+_0x73b7ac['field']+_0xfbb7('0x63'));}break;case _0xfbb7('0x64'):if(_0x73b7ac[_0xfbb7('0x65')]===_0xfbb7('0x66')){if(_0x73b7ac['value'][_0xfbb7('0x67')]('\x20')[_0xfbb7('0x5e')]>0x1){_0x596c1e[_0x3f67c7](_0xfbb7('0x68'),qs['getFullTextValue'](_0x73b7ac[_0xfbb7('0x60')]),null);}else{var _0x509e7c='%'+_0x73b7ac[_0xfbb7('0x60')]+'%';_0x596c1e[_0x3f67c7](_0xfbb7('0x69'),_0x509e7c,_0x509e7c,_0x509e7c);}}else{_0x4f00e8=_['find'](_0x55c513,[_0xfbb7('0x2e'),'ContactId']);_0x73b7ac[_0xfbb7('0x48')]=_0xfbb7('0x6a');_0x583186=as[_0xfbb7('0x6b')](_0x4f242f,_0x4f00e8['type'],_0x73b7ac);_0x596c1e[_0x3f67c7](_0x583186[_0xfbb7('0x6c')],_0x583186['value'][_0xfbb7('0x6d')],_0x583186['value']['end']);}break;case _0xfbb7('0x6e'):var _0xfa5c51=_0x73b7ac['value'][_0xfbb7('0x67')](',')[_0xfbb7('0x30')](function(_0x56ddde){return Number(_0x56ddde);});_0xfa5c51['forEach'](function(_0x388d00){_0x8f0c31['or'](_0xfbb7('0x6f'),'%,'+_0x388d00+',%');});_0x25dc4e=_[_0xfbb7('0x70')](_0x25dc4e,_0xfa5c51);break;case'User':if(_0x73b7ac[_0xfbb7('0x65')]===_0xfbb7('0x66')){_0x596c1e[_0x3f67c7](_0xfbb7('0x71'),'%'+_0x73b7ac[_0xfbb7('0x60')]+'%',null);}else{_0x4f00e8=_['find'](_0x55c513,[_0xfbb7('0x2e'),_0xfbb7('0x72')]);_0x73b7ac['field']=_0xfbb7('0x72');_0x583186=as['buildExpression'](_0x4f242f,_0x4f00e8[_0xfbb7('0x39')],_0x73b7ac);_0x596c1e[_0x3f67c7](_0x583186[_0xfbb7('0x6c')],_0x583186['value'][_0xfbb7('0x6d')],_0x583186[_0xfbb7('0x60')][_0xfbb7('0x20')]);}break;case _0xfbb7('0x73'):_0x583186=as[_0xfbb7('0x6b')]('me',null,_0x73b7ac);_0x596c1e[_0x3f67c7](_0x583186[_0xfbb7('0x6c')],_0x583186[_0xfbb7('0x60')][_0xfbb7('0x6d')],_0x583186['value']['end']);break;}}else{var _0x583186=as[_0xfbb7('0x6b')](_0x4f242f,_0x4f00e8[_0xfbb7('0x39')],_0x73b7ac);_0x596c1e[_0x3f67c7](_0x583186[_0xfbb7('0x6c')],_0x583186[_0xfbb7('0x60')][_0xfbb7('0x6d')],_0x583186[_0xfbb7('0x60')][_0xfbb7('0x20')]);}}}else{var _0x1cc0e1=_(_0x554876['query'])['keys']()[_0xfbb7('0x30')](function(_0x1c6e1a){return _[_0xfbb7('0x74')](_0x55c513,[_0xfbb7('0x2e'),_0x1c6e1a])?_0x1c6e1a:undefined;})[_0xfbb7('0x75')]()[_0xfbb7('0x60')]();if(!_[_0xfbb7('0x76')](_0x1cc0e1)){_0x1cc0e1[_0xfbb7('0x77')](function(_0x30fbc6){if(_0x30fbc6===_0xfbb7('0x78')){_0x254242['where'](_0xfbb7('0x79'),[][_0xfbb7('0x7a')](_0x554876[_0xfbb7('0x3c')][_0x30fbc6]));}else if(_0x30fbc6===_0xfbb7('0x7b')){var _0x20f626=JSON[_0xfbb7('0x7c')](_0x554876[_0xfbb7('0x3c')][_0x30fbc6])['$gte'];var _0x494a06=JSON['parse'](_0x554876['query'][_0x30fbc6])[_0xfbb7('0x7d')];_0x254242[_0xfbb7('0x45')](_0xfbb7('0x7e'),_0x20f626,_0x494a06);}else{if(_0x554876[_0xfbb7('0x3c')][_0x30fbc6]===_0xfbb7('0x7f')){_0x254242['where']('i.'+_0x30fbc6+'\x20IS\x20NULL');}else{_0x254242[_0xfbb7('0x45')]('i.'+_0x30fbc6+_0xfbb7('0x80'),_0x554876['query'][_0x30fbc6]);}}});}if(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x81')]){if(_0x554876['query']['read']==0x1){_0x254242[_0xfbb7('0x61')]('`unreadMessages`\x20=\x200');}else{_0x254242['having']('`unreadMessages`\x20>\x200');}}if(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x82')]){_0x25dc4e=_[_0xfbb7('0x83')](_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x82')])?_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x82')]:new Array(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x82')]);_0x25dc4e[_0xfbb7('0x77')](function(_0x51202a){_0x8f0c31['or'](_0xfbb7('0x6f'),'%,'+_0x51202a+',%');});}if(_0x554876['query'][_0xfbb7('0x84')]){var _0x298dfc=_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x84')][_0xfbb7('0x85')]('\x5c','\x5c\x5c')[_0xfbb7('0x85')]('\x27\x27',_0xfbb7('0x86'));if(qs[_0xfbb7('0x87')](_0x298dfc)){_0x596c1e['or'](_0xfbb7('0x88'),_0x298dfc+'%');}else{_0x596c1e['or'](_0xfbb7('0x89'),qs[_0xfbb7('0x8a')](_0x298dfc))['or'](_0xfbb7('0x8b'),_0x298dfc+'%')['or'](_0xfbb7('0x8c'),_0x298dfc+'%');}}}_0x254242[_0xfbb7('0x45')](_0x596c1e);_0x254242[_0xfbb7('0x8d')](_0xfbb7('0x8e'));var _0x4adda7={'type':db[_0xfbb7('0x8f')][_0xfbb7('0x90')][_0xfbb7('0x91')],'raw':!![]};var _0xfd28ff=_0x254242[_0xfbb7('0x92')]();_0xfd28ff[_0xfbb7('0x48')](_0xfbb7('0x8e'));_0xfd28ff[_0xfbb7('0x48')](_0xfbb7('0x93'),_0xfbb7('0x5f'));if(_0x19b9c6[_0xfbb7('0x44')]){_0x19b9c6[_0xfbb7('0x44')][_0xfbb7('0x77')](function(_0x1152d6){_0x254242['order']('i.'+_0x1152d6[0x0],_0x1152d6[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfbb7('0x76')](_0x25dc4e)){_0x254242[_0xfbb7('0x61')](_0x8f0c31);_0xfd28ff[_0xfbb7('0x45')](_0xfbb7('0x94'),_0x25dc4e);}BPromise[_0xfbb7('0x95')]()[_0xfbb7('0x2a')](function(){if(!_0xb17b7){if(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x78')]||_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x96')])return;_0xfd28ff[_0xfbb7('0x45')](_0xfbb7('0x97'));_0x254242['where'](_0xfbb7('0x97'));return;}return _0x554876[_0xfbb7('0x98')][_0xfbb7('0x99')]({'attributes':['id'],'raw':!![]})[_0xfbb7('0x2a')](function(_0x4d47eb){if(_[_0xfbb7('0x76')](_0x4d47eb)){_0xfd28ff[_0xfbb7('0x45')](_0xfbb7('0x9a'));_0x254242['where'](_0xfbb7('0x9a'));}else{_0xfd28ff['where'](_0xfbb7('0x79'),_[_0xfbb7('0x30')](_0x4d47eb,'id'));_0x254242[_0xfbb7('0x45')](_0xfbb7('0x79'),_['map'](_0x4d47eb,'id'));}});})[_0xfbb7('0x2a')](function(){db[_0xfbb7('0x9b')][_0xfbb7('0x3c')](_0xfd28ff[_0xfbb7('0x9c')](),_0x4adda7)[_0xfbb7('0x2a')](function(_0x50ad8a){_0x16390a['count']=_0x50ad8a[_0xfbb7('0x5e')];if(_0x16390a[_0xfbb7('0x22')]===0x0)return[];return db[_0xfbb7('0x9b')][_0xfbb7('0x3c')](_0x37c27f[_0xfbb7('0x9c')](),_0x4adda7)[_0xfbb7('0x2a')](function(_0x4051b6){_0x2e6309=_['keyBy'](_0x4051b6,'id');_0x4adda7=_[_0xfbb7('0x9d')](_0x4adda7,{'model':db[_0xfbb7('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x554876[_0xfbb7('0x3c')][_0xfbb7('0x40')]){_0x19b9c6[_0xfbb7('0x3f')][_0xfbb7('0x77')](function(_0x13ebcb){_0x254242[_0xfbb7('0x48')]('i.'+_0x13ebcb);});}else{_0x254242[_0xfbb7('0x48')](_0xfbb7('0x93'),_0xfbb7('0x5f'));_0x254242['field'](_0xfbb7('0x9f'),'Account.key');_0x254242[_0xfbb7('0x48')](_0xfbb7('0xa0'),_0xfbb7('0xa1'));_0x254242[_0xfbb7('0x48')](_0xfbb7('0xa2'));_0x254242['field'](_0xfbb7('0xa3'),_0xfbb7('0xa4'));_0x254242[_0xfbb7('0x48')](_0xfbb7('0xa5'),_0xfbb7('0xa6'));_0x254242['field'](_0xfbb7('0xa7'),_0xfbb7('0xa8'));_0x254242[_0xfbb7('0x48')](_0xfbb7('0xa9'),_0xfbb7('0xaa'));_0x254242['field'](_0xfbb7('0xab'),'Contact.mobile');_0x254242['field'](_0xfbb7('0xac'),_0xfbb7('0xad'));_0x254242[_0xfbb7('0x48')]('o.fullname',_0xfbb7('0xae'));_0x254242[_0xfbb7('0x48')]('o.internal',_0xfbb7('0xaf'));_0x254242[_0xfbb7('0x48')](_0xfbb7('0xb0'),_0xfbb7('0x32'));}if(_0x19b9c6[_0xfbb7('0x43')])_0x254242[_0xfbb7('0x43')](_0x19b9c6[_0xfbb7('0x43')]);if(_0x19b9c6[_0xfbb7('0x23')])_0x254242['offset'](_0x19b9c6[_0xfbb7('0x23')]);return db[_0xfbb7('0x9b')][_0xfbb7('0x3c')](_0x254242[_0xfbb7('0x9c')](),_0x4adda7);})['then'](function(_0x518a7f){_0x39de9e[_0xfbb7('0x45')](_0xfbb7('0xb1'),_[_0xfbb7('0x30')](_0x518a7f,'id'));return db[_0xfbb7('0x9b')][_0xfbb7('0x3c')](_0x39de9e[_0xfbb7('0x9c')](),_0x4adda7)[_0xfbb7('0x2a')](function(_0x41bd5e){var _0x5e582b=_[_0xfbb7('0xb2')](_0x41bd5e,_0xfbb7('0xb3'));var _0x5f16ca=[];_0x518a7f[_0xfbb7('0x77')](function(_0x4bd292){_0x5f16ca[_0xfbb7('0x34')](updateOpenchannelInteraction(_0x4bd292,_0x2e6309,_0x5e582b));});return BPromise['all'](_0x5f16ca);});});})[_0xfbb7('0x2a')](function(_0x1a621c){_0x16390a[_0xfbb7('0xb4')]=_0x1a621c;return _0x16390a;})[_0xfbb7('0x2a')](respondWithFilteredResult(_0x5c022a,_0x19b9c6));})[_0xfbb7('0x35')](handleError(_0x5c022a,null));};exports[_0xfbb7('0xb5')]=function(_0x105806,_0xb120d7){var _0x2a1c2a={'raw':![],'where':{'id':_0x105806['params']['id']}},_0x411416={};_0x411416[_0xfbb7('0x3a')]=_[_0xfbb7('0x3b')](db['OpenchannelInteraction']['rawAttributes']);_0x411416[_0xfbb7('0x3c')]=_[_0xfbb7('0x3b')](_0x105806[_0xfbb7('0x3c')]);_0x411416['filters']=_[_0xfbb7('0x3e')](_0x411416[_0xfbb7('0x3a')],_0x411416['query']);_0x2a1c2a['attributes']=_['intersection'](_0x411416['model'],qs[_0xfbb7('0x40')](_0x105806[_0xfbb7('0x3c')]['fields']));_0x2a1c2a[_0xfbb7('0x3f')]=_0x2a1c2a[_0xfbb7('0x3f')][_0xfbb7('0x5e')]?_0x2a1c2a[_0xfbb7('0x3f')]:_0x411416[_0xfbb7('0x3a')];if(_0x105806['query']['includeAll']){_0x2a1c2a[_0xfbb7('0xb6')]=[{'all':!![]}];}_0x2a1c2a=_[_0xfbb7('0x9d')]({},_0x2a1c2a,_0x105806[_0xfbb7('0xb7')]);return db['OpenchannelInteraction'][_0xfbb7('0xb8')](_0x2a1c2a)[_0xfbb7('0x2a')](handleEntityNotFound(_0xb120d7,null))[_0xfbb7('0x2a')](respondWithResult(_0xb120d7,null))['catch'](handleError(_0xb120d7,null));};exports[_0xfbb7('0xb9')]=function(_0x13965c,_0x1a0553){return db[_0xfbb7('0x9e')][_0xfbb7('0xb9')](_0x13965c[_0xfbb7('0x73')],{})[_0xfbb7('0x2a')](respondWithResult(_0x1a0553,0xc9))['catch'](handleError(_0x1a0553,null));};exports[_0xfbb7('0x29')]=function(_0x4d4702,_0x5c63db){if(_0x4d4702[_0xfbb7('0x73')]['id']){delete _0x4d4702[_0xfbb7('0x73')]['id'];}return db[_0xfbb7('0x9e')][_0xfbb7('0xb8')]({'where':{'id':_0x4d4702['params']['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x5c63db,null))[_0xfbb7('0x2a')](saveUpdates(_0x4d4702[_0xfbb7('0x73')],null))[_0xfbb7('0x2a')](respondWithResult(_0x5c63db,null))[_0xfbb7('0x35')](handleError(_0x5c63db,null));};exports[_0xfbb7('0x2b')]=function(_0x5b28b5,_0x930d46){return db[_0xfbb7('0x9e')][_0xfbb7('0xb8')]({'where':{'id':_0x5b28b5[_0xfbb7('0xba')]['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x930d46,null))[_0xfbb7('0x2a')](removeEntity(_0x930d46,null))[_0xfbb7('0x35')](handleError(_0x930d46,null));};exports[_0xfbb7('0xbb')]=function(_0x559a54,_0x1c25aa){return db[_0xfbb7('0x9e')][_0xfbb7('0xbb')]()[_0xfbb7('0x2a')](respondWithResult(_0x1c25aa,null))[_0xfbb7('0x35')](handleError(_0x1c25aa,null));};exports[_0xfbb7('0xbc')]=function(_0x2df3d7,_0x51a12e,_0x482c53){return db[_0xfbb7('0xbd')][_0xfbb7('0xb8')]({'where':{'id':_0x2df3d7[_0xfbb7('0xba')]['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x51a12e,null))[_0xfbb7('0x2a')](function(_0x542349){if(_0x542349){return _0x542349[_0xfbb7('0xbc')](_0x2df3d7[_0xfbb7('0x73')]['ids'],_[_0xfbb7('0xbe')](_0x2df3d7[_0xfbb7('0x73')],[_0xfbb7('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x51a12e,null))[_0xfbb7('0x35')](handleError(_0x51a12e,null));};exports['getMessages']=function(_0x49eed5,_0x8feaa7,_0x49d9a4){var _0x1027e3={'raw':![],'where':{}};var _0x4ada90={};var _0xa2543={'count':0x0,'rows':[]};return db[_0xfbb7('0x9e')][_0xfbb7('0xc0')]({'where':{'id':_0x49eed5[_0xfbb7('0xba')]['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x8feaa7,null))['then'](function(_0x4f1ea6){if(_0x4f1ea6){_0x4ada90[_0xfbb7('0x3a')]=_['keys'](db['OpenchannelMessage'][_0xfbb7('0x37')]);_0x4ada90['query']=_[_0xfbb7('0x3b')](_0x49eed5['query']);_0x4ada90[_0xfbb7('0x3d')]=_[_0xfbb7('0x3e')](_0x4ada90[_0xfbb7('0x3a')],_0x4ada90[_0xfbb7('0x3c')]);_0x1027e3['attributes']=_[_0xfbb7('0x3e')](_0x4ada90['model'],qs[_0xfbb7('0x40')](_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0x40')]));_0x1027e3[_0xfbb7('0x3f')]=_0x1027e3[_0xfbb7('0x3f')][_0xfbb7('0x5e')]?_0x1027e3[_0xfbb7('0x3f')]:_0x4ada90['model'];if(!_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0x41')](_0xfbb7('0x42'))){_0x1027e3['limit']=qs['limit'](_0x49eed5[_0xfbb7('0x3c')]['limit']);_0x1027e3[_0xfbb7('0x23')]=qs[_0xfbb7('0x23')](_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0x23')]);}_0x1027e3[_0xfbb7('0x44')]=qs['sort'](_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0xc1')]);_0x1027e3[_0xfbb7('0x45')]=qs[_0xfbb7('0x3d')](_[_0xfbb7('0x46')](_0x49eed5[_0xfbb7('0x3c')],_0x4ada90[_0xfbb7('0x3d')]));_0x1027e3['where'][_0xfbb7('0xb3')]=_0x4f1ea6['id'];if(_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0x84')]){_0x1027e3[_0xfbb7('0x45')]=_[_0xfbb7('0x9d')](_0x1027e3[_0xfbb7('0x45')],{'$or':_['map'](_0x1027e3['attributes'],function(_0x4b56cc){var _0x4a6959={};_0x4a6959[_0x4b56cc]={'$like':'%'+_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0x84')]+'%'};return _0x4a6959;})});}if(_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0xc2')]){var _0x2d2191=_0x49eed5[_0xfbb7('0x3c')]['$gte'][_0xfbb7('0x67')](',');var _0x3af0a8={};_0x3af0a8[_0x2d2191[0x0]]={'$gte':moment(_0x2d2191[0x1])[_0xfbb7('0xc3')](_0xfbb7('0xc4'))};_0x1027e3[_0xfbb7('0x45')]=_[_0xfbb7('0x9d')](_0x1027e3[_0xfbb7('0x45')],_0x3af0a8);}_0x1027e3=_[_0xfbb7('0x9d')]({},_0x1027e3,_0x49eed5[_0xfbb7('0xb7')]);return db['OpenchannelMessage']['count']({'where':_0x1027e3[_0xfbb7('0x45')]})['then'](function(_0x21a0e2){_0xa2543[_0xfbb7('0x22')]=_0x21a0e2;if(_0x49eed5[_0xfbb7('0x3c')][_0xfbb7('0xc5')]){_0x1027e3['include']=[{'all':!![]}];}return db[_0xfbb7('0xbd')][_0xfbb7('0xc6')](_0x1027e3);})['then'](function(_0x51df4d){_0xa2543['rows']=_0x51df4d;return _0xa2543;});}})['then'](respondWithFilteredResult(_0x8feaa7,_0x1027e3))[_0xfbb7('0x35')](handleError(_0x8feaa7,null));};exports['addTags']=function(_0x12dae7,_0x11603a,_0xce73c8){return db[_0xfbb7('0x9e')][_0xfbb7('0xb8')]({'where':{'id':_0x12dae7[_0xfbb7('0xba')]['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x11603a,null))['then'](function(_0x243138){if(_0x243138){return _0x243138[_0xfbb7('0xc7')](_0x12dae7['body'][_0xfbb7('0xbf')],_['omit'](_0x12dae7['body'],[_0xfbb7('0xbf'),'id'])||{})['spread'](function(){return db[_0xfbb7('0x6e')][_0xfbb7('0xc6')]({'attributes':['id','name',_0xfbb7('0x49')],'where':{'id':_0x12dae7[_0xfbb7('0x73')][_0xfbb7('0xbf')]}});})[_0xfbb7('0x2a')](function(_0x1fb274){socket['emit'](_0xfbb7('0xc8'),{'id':Number(_0x12dae7[_0xfbb7('0xba')]['id']),'tags':_0x1fb274||[]});return{'id':Number(_0x12dae7['params']['id']),'tags':_0x1fb274||[]};});}})[_0xfbb7('0x2a')](respondWithResult(_0x11603a,null))[_0xfbb7('0x35')](handleError(_0x11603a,null));};exports[_0xfbb7('0xc9')]=function(_0x469ffa,_0x4ae17d,_0xa7494f){return db[_0xfbb7('0x9e')][_0xfbb7('0xb8')]({'where':{'id':_0x469ffa[_0xfbb7('0xba')]['id']}})[_0xfbb7('0x2a')](handleEntityNotFound(_0x4ae17d,null))[_0xfbb7('0x2a')](function(_0x3627af){if(_0x3627af){return _0x3627af[_0xfbb7('0xc9')](_0x469ffa[_0xfbb7('0x3c')]['ids']);}})[_0xfbb7('0x2a')](respondWithStatusCode(_0x4ae17d,null))['catch'](handleError(_0x4ae17d,null));};exports[_0xfbb7('0xca')]=function(_0xc2a026,_0x4efb5b){var _0x8cba00=moment()['unix']()[_0xfbb7('0x9c')]();var _0x16fce0=path[_0xfbb7('0xcb')](config[_0xfbb7('0xcc')],'server',_0xfbb7('0xcd'),_0xfbb7('0xce'));var _0x241f09=path['join'](config[_0xfbb7('0xcc')],'server','files','attachments');var _0x154754=path[_0xfbb7('0xcb')](_0x16fce0,_0x8cba00);var _0x3bbe9e=util[_0xfbb7('0xc3')](_0xfbb7('0xcf'),_0xc2a026['params']['id'],_0x8cba00);var _0x2fb25d=path[_0xfbb7('0xcb')](_0x16fce0,_0x3bbe9e);var _0x2adf8b=[];_0x2adf8b[_0xfbb7('0x34')]({'model':db[_0xfbb7('0xd0')],'as':'User','attributes':['id',_0xfbb7('0x31')],'raw':!![]});_0x2adf8b['push']({'model':db['CmContact'],'as':_0xfbb7('0x64'),'attributes':['id',_0xfbb7('0xd1'),_0xfbb7('0xd2')],'raw':!![]});if(_0xc2a026[_0xfbb7('0x3c')][_0xfbb7('0xd3')]){_0x2adf8b[_0xfbb7('0x34')]({'model':db[_0xfbb7('0xd4')],'as':_0xfbb7('0xd4'),'raw':!![]});}var _0x2637b3=[{'model':db[_0xfbb7('0xbd')],'as':'Messages','attributes':['id',_0xfbb7('0x73'),_0xfbb7('0x7b'),'direction',_0xfbb7('0xd5'),_0xfbb7('0x81')],'include':_0x2adf8b}];_0x2637b3['push']({'model':db[_0xfbb7('0xd6')],'as':_0xfbb7('0xd7'),'attributes':['id','name']});_0x2637b3[_0xfbb7('0x34')]({'model':db[_0xfbb7('0xd0')],'as':_0xfbb7('0xd8'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xfbb7('0xb8')]({'where':{'id':_0xc2a026['params']['id']},'include':_0x2637b3})[_0xfbb7('0x2a')](handleEntityNotFound(_0x4efb5b,null))[_0xfbb7('0x2a')](function(_0x13e566){if(_0x13e566){var _0x57ecff=_0x13e566[_0xfbb7('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x154754);var _0x588727={'format':'A4','border':_0xfbb7('0xda'),'header':{'height':_0xfbb7('0xdb'),'contents':{'first':_0xfbb7('0xdc')}},'footer':{'height':'30px','contents':{'default':util[_0xfbb7('0xc3')](_0xfbb7('0xdd'),util[_0xfbb7('0xc3')](_0xfbb7('0xde'),_0xfbb7('0xdf'),_0x57ecff['id']),moment()[_0xfbb7('0xc3')](_0xfbb7('0xe0'))[_0xfbb7('0x9c')]())}}};var _0x404785={'channel':_0xfbb7('0xdf'),'account':_0x57ecff[_0xfbb7('0xd7')][_0xfbb7('0x2e')],'agent':_0x57ecff[_0xfbb7('0xd8')]?_0x57ecff[_0xfbb7('0xd8')][_0xfbb7('0x31')]:'N.A.','createdAt':moment(_0x57ecff[_0xfbb7('0x7b')])[_0xfbb7('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfbb7('0x9c')](),'closedAt':_0x57ecff[_0xfbb7('0xe1')]?moment(_0x57ecff[_0xfbb7('0xe2')])['format'](_0xfbb7('0xc4'))['toString']():'','disposition':_0x57ecff['disposition'],'visibility':_0x57ecff['threadId']?_0xfbb7('0xe3'):_0xfbb7('0xe4'),'messages':_(_0x57ecff[_0xfbb7('0xe5')])['filter']({'secret':![]})['map'](function(_0x3e76bb){if(_0x3e76bb[_0xfbb7('0xd4')]){var _0x5dabed=path[_0xfbb7('0xcb')](_0x241f09,_0x3e76bb[_0xfbb7('0xd4')]['basename']);if(fs[_0xfbb7('0xe6')](_0x5dabed)){fs['createReadStream'](_0x5dabed)['pipe'](fs[_0xfbb7('0xe7')](path['join'](_0x154754,_0x3e76bb[_0xfbb7('0xd4')]['basename'])));}}return{'date':moment(_0x3e76bb[_0xfbb7('0x7b')])[_0xfbb7('0xc3')](_0xfbb7('0xc4'))['toString'](),'sender':_0x3e76bb[_0xfbb7('0xe8')]==='out'?_0x3e76bb[_0xfbb7('0xd0')]?_0x3e76bb['User'][_0xfbb7('0x31')]:'System':_0x3e76bb[_0xfbb7('0x64')][_0xfbb7('0xd1')]+(_0x3e76bb[_0xfbb7('0x64')][_0xfbb7('0xd2')]?'\x20'+_0x3e76bb['Contact'][_0xfbb7('0xd2')]:''),'body':_0x3e76bb['Attachment']?_0x3e76bb[_0xfbb7('0xd4')][_0xfbb7('0xe9')]:_0x3e76bb[_0xfbb7('0x73')],'direction':_0x3e76bb[_0xfbb7('0xe8')]==='out'?'A':'C','secret':_0x3e76bb['secret'],'read':_0x3e76bb[_0xfbb7('0x81')],'attachment':_0x3e76bb[_0xfbb7('0xd4')]};})[_0xfbb7('0x60')]()};return ejs[_0xfbb7('0xea')](path[_0xfbb7('0xcb')](config['root'],_0xfbb7('0xeb'),_0xfbb7('0xec'),_0xfbb7('0xed')),{'interaction':_0x404785})[_0xfbb7('0x2a')](function(_0x5ce972){return new BPromise(function(_0x272e8d,_0x24bede){pdf[_0xfbb7('0xb9')](_0x5ce972,_0x588727)[_0xfbb7('0xee')](path[_0xfbb7('0xcb')](_0x154754,'transcript-'+_0x57ecff['id']+'-'+_0x8cba00+'.pdf'),function(_0x1e0c8e,_0x104b02){if(_0x1e0c8e)return _0x24bede(_0x1e0c8e);_0x272e8d(_0x104b02);});});})[_0xfbb7('0x2a')](function(){return new BPromise(function(_0x389c4f,_0x3b63d6){zipdir(_0x154754,{'saveTo':_0x2fb25d},function(_0x526585,_0x15aa7f){if(_0x526585)return _0x3b63d6(_0x526585);return _0x389c4f(_0x15aa7f);});})['then'](function(){return new BPromise(function(_0x4cc702,_0x46c175){rimraf(_0x154754,function(_0x2ee316){if(_0x2ee316)_0x46c175(_0x2ee316);return _0x4cc702();});});})['then'](function(){return _0x4efb5b['download'](_0x2fb25d,_0x3bbe9e,function(_0x5d4e07){if(_0x5d4e07){console[_0xfbb7('0xef')](_0xfbb7('0xf0'),_0x5d4e07);}else{fs['unlinkSync'](_0x2fb25d);}});});});}else{return _0x4efb5b['sendStatus'](0xc8);}})[_0xfbb7('0x35')](handleError(_0x4efb5b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1d7976b..0389dac 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 _0x4c48=['getUsers','then','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update'];(function(_0x1aac4a,_0x5aa689){var _0x29f4b8=function(_0x530a56){while(--_0x530a56){_0x1aac4a['push'](_0x1aac4a['shift']());}};_0x29f4b8(++_0x5aa689);}(_0x4c48,0x18f));var _0x84c4=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x4c48[_0x3f4cd0];return _0x3f9f01;};'use strict';var EventEmitter=require(_0x84c4('0x0'));var OpenchannelInteraction=require(_0x84c4('0x1'))['db'][_0x84c4('0x2')];var OpenchannelMessage=require(_0x84c4('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x84c4('0x3')](0x0);var events={'afterCreate':_0x84c4('0x4'),'afterUpdate':_0x84c4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3e5deb){return function(_0x4d2088,_0x1f95a3,_0x5adade){_0x4d2088[_0x84c4('0x6')]({'attributes':['id'],'raw':!![]})[_0x84c4('0x7')](function(_0x416da6){_0x4d2088['setDataValue']('Users',_0x416da6[_0x84c4('0x8')](function(_0x13372f){return{'id':_0x13372f['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4d2088['id'],'direction':'in','read':![]},'raw':!![]});})[_0x84c4('0x7')](function(_0x59adca){_0x4d2088['setDataValue'](_0x84c4('0x9'),_0x59adca[_0x84c4('0xa')]);OpenchannelInteractionEvents[_0x84c4('0xb')](_0x3e5deb+':'+_0x4d2088['id'],_0x4d2088);OpenchannelInteractionEvents[_0x84c4('0xb')](_0x3e5deb,_0x4d2088);_0x5adade(null);})[_0x84c4('0xc')](_0x5adade(null));};}for(var e in events){if(events[_0x84c4('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x84c4('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x340f=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x77405e,_0x56e84e){var _0x1c49f1=function(_0x233c1e){while(--_0x233c1e){_0x77405e['push'](_0x77405e['shift']());}};_0x1c49f1(++_0x56e84e);}(_0x340f,0x156));var _0xf340=function(_0x4ee19a,_0x1c7ec0){_0x4ee19a=_0x4ee19a-0x0;var _0x322b2e=_0x340f[_0x4ee19a];return _0x322b2e;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xf340('0x0'))['db'][_0xf340('0x1')];var OpenchannelMessage=require(_0xf340('0x0'))['db'][_0xf340('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf340('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf340('0x4'),'afterDestroy':_0xf340('0x5')};function emitEvent(_0x239287){return function(_0x206e4a,_0x12bbac,_0x1ca405){_0x206e4a[_0xf340('0x6')]({'attributes':['id'],'raw':!![]})[_0xf340('0x7')](function(_0x12e633){_0x206e4a[_0xf340('0x8')](_0xf340('0x9'),_0x12e633['map'](function(_0x4cba1a){return{'id':_0x4cba1a['id']};}));return OpenchannelMessage[_0xf340('0xa')]({'where':{'OpenchannelInteractionId':_0x206e4a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf340('0x7')](function(_0xe24838){_0x206e4a[_0xf340('0x8')](_0xf340('0xb'),_0xe24838[_0xf340('0xc')]);OpenchannelInteractionEvents['emit'](_0x239287+':'+_0x206e4a['id'],_0x206e4a);OpenchannelInteractionEvents[_0xf340('0xd')](_0x239287,_0x206e4a);_0x1ca405(null);})[_0xf340('0xe')](_0x1ca405(null));};}for(var e in events){if(events[_0xf340('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xf340('0x10')](e,emitEvent(event));}}module[_0xf340('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f2533d5..9cabe1e 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 _0x6a49=['path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6a49,0x19a));var _0x96a4=function(_0x1bcadf,_0x12b827){_0x1bcadf=_0x1bcadf-0x0;var _0x39ed2c=_0x6a49[_0x1bcadf];return _0x39ed2c;};'use strict';var _=require(_0x96a4('0x0'));var util=require(_0x96a4('0x1'));var logger=require(_0x96a4('0x2'))(_0x96a4('0x3'));var moment=require(_0x96a4('0x4'));var BPromise=require(_0x96a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96a4('0x6'));var rimraf=require(_0x96a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x96a4('0x8'));module[_0x96a4('0x9')]=function(_0x37c4c0,_0x20e8ed){return _0x37c4c0[_0x96a4('0xa')](_0x96a4('0xb'),attributes,{'tableName':_0x96a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a2e55,_0x5c6ef9,_0xe02d9c){if(_0x1a2e55[_0x96a4('0xd')](_0x96a4('0xe'))){_0x1a2e55['closedAt']=moment()[_0x96a4('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xe02d9c(null,_0x1a2e55);}}});}; \ No newline at end of file +var _0x3946=['OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x88c91a,_0x5066ee){var _0x1c86f2=function(_0x413fa1){while(--_0x413fa1){_0x88c91a['push'](_0x88c91a['shift']());}};_0x1c86f2(++_0x5066ee);}(_0x3946,0x114));var _0x6394=function(_0x454912,_0x59ea1f){_0x454912=_0x454912-0x0;var _0x1b11dc=_0x3946[_0x454912];return _0x1b11dc;};'use strict';var _=require('lodash');var util=require(_0x6394('0x0'));var logger=require(_0x6394('0x1'))('api');var moment=require(_0x6394('0x2'));var BPromise=require(_0x6394('0x3'));var rp=require(_0x6394('0x4'));var fs=require('fs');var path=require(_0x6394('0x5'));var rimraf=require(_0x6394('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x6394('0x7')]=function(_0x1635af,_0x1ad0e4){return _0x1635af[_0x6394('0x8')](_0x6394('0x9'),attributes,{'tableName':_0x6394('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x332963,_0xc9a7a0,_0x439802){if(_0x332963[_0x6394('0xb')](_0x6394('0xc'))){_0x332963[_0x6394('0xd')]=moment()['format'](_0x6394('0xe'));}_0x439802(null,_0x332963);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7032634..3039038 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 _0x74d3=['message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31892c,_0x53c36a){var _0x5ead51=function(_0x1b4802){while(--_0x1b4802){_0x31892c['push'](_0x31892c['shift']());}};_0x5ead51(++_0x53c36a);}(_0x74d3,0x15c));var _0x374d=function(_0x36770e,_0x152503){_0x36770e=_0x36770e-0x0;var _0x30d73b=_0x74d3[_0x36770e];return _0x30d73b;};'use strict';var _=require(_0x374d('0x0'));var util=require(_0x374d('0x1'));var moment=require(_0x374d('0x2'));var BPromise=require(_0x374d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x374d('0x4'));var db=require(_0x374d('0x5'))['db'];var utils=require(_0x374d('0x6'));var logger=require('../../config/logger')(_0x374d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x374d('0x8')][_0x374d('0x9')]({'port':0x232a});config[_0x374d('0xa')]=_['defaults'](config[_0x374d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x374d('0xb'))(new Redis(config[_0x374d('0xa')]));require(_0x374d('0xc'))['register'](socket);function respondWithRpcPromise(_0x339eb1,_0x35512d,_0x279046){return new BPromise(function(_0x370125,_0x4d3135){return client['request'](_0x339eb1,_0x279046)[_0x374d('0xd')](function(_0x46d61e){logger[_0x374d('0xe')](_0x374d('0xf'),_0x35512d,_0x374d('0x10'));logger['debug'](_0x374d('0x11'),_0x35512d,'request\x20sent',JSON[_0x374d('0x12')](_0x46d61e));if(_0x46d61e[_0x374d('0x13')]){if(_0x46d61e[_0x374d('0x13')][_0x374d('0x14')]===0x1f4){logger[_0x374d('0x13')](_0x374d('0xf'),_0x35512d,_0x46d61e['error'][_0x374d('0x15')]);return _0x4d3135(_0x46d61e[_0x374d('0x13')][_0x374d('0x15')]);}logger['error'](_0x374d('0xf'),_0x35512d,_0x46d61e['error'][_0x374d('0x15')]);return _0x370125(_0x46d61e['error'][_0x374d('0x15')]);}else{logger[_0x374d('0xe')](_0x374d('0xf'),_0x35512d,_0x374d('0x10'));_0x370125(_0x46d61e[_0x374d('0x16')][_0x374d('0x15')]);}})[_0x374d('0x17')](function(_0x4a979d){logger[_0x374d('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x35512d,_0x4a979d);_0x4d3135(_0x4a979d);});});}exports[_0x374d('0x18')]=function(_0x3deb2b){var _0x45506c=this;return new Promise(function(_0x482b5a,_0x19efdd){return db[_0x374d('0x19')][_0x374d('0x1a')](_0x3deb2b[_0x374d('0x1b')],{'raw':_0x3deb2b[_0x374d('0x1c')]?_0x3deb2b[_0x374d('0x1c')][_0x374d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3deb2b[_0x374d('0x1c')]?_0x3deb2b[_0x374d('0x1c')]['where']||null:null,'attributes':_0x3deb2b['options']?_0x3deb2b[_0x374d('0x1c')][_0x374d('0x1e')]||null:null,'limit':_0x3deb2b[_0x374d('0x1c')]?_0x3deb2b['options'][_0x374d('0x1f')]||null:null})[_0x374d('0xd')](function(_0x5c0110){logger[_0x374d('0xe')]('UpdateOpenchannelInteraction',_0x3deb2b);logger[_0x374d('0x20')](_0x374d('0x18'),_0x3deb2b,JSON['stringify'](_0x5c0110));_0x482b5a(_0x5c0110);})[_0x374d('0x17')](function(_0x4ccdf0){logger[_0x374d('0x13')](_0x374d('0x18'),_0x4ccdf0[_0x374d('0x15')],_0x3deb2b);_0x19efdd(_0x45506c[_0x374d('0x13')](0x1f4,_0x4ccdf0[_0x374d('0x15')]));});});};exports[_0x374d('0x21')]=function(_0x5dadcf){return new Promise(function(_0x4f2bef,_0x80310a){return db[_0x374d('0x19')][_0x374d('0x22')]({'where':_0x5dadcf[_0x374d('0x1c')]?_0x5dadcf[_0x374d('0x1c')][_0x374d('0x23')]||null:null})[_0x374d('0xd')](function(_0x7d06c4){if(_0x7d06c4){return _0x7d06c4[_0x374d('0x24')](_0x5dadcf[_0x374d('0x1b')][_0x374d('0x25')],_[_0x374d('0x26')](_0x5dadcf['body'],['ids','id'])||{});}})[_0x374d('0x27')](function(_0x4592db){logger[_0x374d('0xe')](_0x374d('0x28'),_0x5dadcf);logger[_0x374d('0x20')](_0x374d('0x28'),_0x5dadcf,JSON[_0x374d('0x12')](_0x4592db));_0x4f2bef(_0x4592db);})[_0x374d('0x17')](function(_0xfde0f0){logger[_0x374d('0x13')](_0x374d('0x28'),_0xfde0f0['message'],_0x5dadcf);_0x80310a(_this[_0x374d('0x13')](0x1f4,_0xfde0f0[_0x374d('0x15')]));});});}; \ No newline at end of file +var _0xcf7d=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','spread','AddTags','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x5b4160,_0x739196){var _0x295148=function(_0x10c69b){while(--_0x10c69b){_0x5b4160['push'](_0x5b4160['shift']());}};_0x295148(++_0x739196);}(_0xcf7d,0x1bb));var _0xdcf7=function(_0x21bad5,_0x454a1c){_0x21bad5=_0x21bad5-0x0;var _0x559b56=_0xcf7d[_0x21bad5];return _0x559b56;};'use strict';var _=require('lodash');var util=require(_0xdcf7('0x0'));var moment=require('moment');var BPromise=require(_0xdcf7('0x1'));var rs=require(_0xdcf7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcf7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcf7('0x4'));var config=require(_0xdcf7('0x5'));var jayson=require(_0xdcf7('0x6'));var client=jayson[_0xdcf7('0x7')][_0xdcf7('0x8')]({'port':0x232a});config[_0xdcf7('0x9')]=_['defaults'](config[_0xdcf7('0x9')],{'host':_0xdcf7('0xa'),'port':0x18eb});var socket=require(_0xdcf7('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xdcf7('0xc')](socket);function respondWithRpcPromise(_0x468921,_0x12c176,_0x39238e){return new BPromise(function(_0x5da3e6,_0x153df7){return client[_0xdcf7('0xd')](_0x468921,_0x39238e)[_0xdcf7('0xe')](function(_0x14184d){logger[_0xdcf7('0xf')](_0xdcf7('0x10'),_0x12c176,'request\x20sent');logger[_0xdcf7('0x11')](_0xdcf7('0x12'),_0x12c176,_0xdcf7('0x13'),JSON[_0xdcf7('0x14')](_0x14184d));if(_0x14184d[_0xdcf7('0x15')]){if(_0x14184d['error']['code']===0x1f4){logger[_0xdcf7('0x15')](_0xdcf7('0x10'),_0x12c176,_0x14184d[_0xdcf7('0x15')][_0xdcf7('0x16')]);return _0x153df7(_0x14184d[_0xdcf7('0x15')][_0xdcf7('0x16')]);}logger[_0xdcf7('0x15')](_0xdcf7('0x10'),_0x12c176,_0x14184d[_0xdcf7('0x15')][_0xdcf7('0x16')]);return _0x5da3e6(_0x14184d[_0xdcf7('0x15')][_0xdcf7('0x16')]);}else{logger[_0xdcf7('0xf')](_0xdcf7('0x10'),_0x12c176,_0xdcf7('0x13'));_0x5da3e6(_0x14184d[_0xdcf7('0x17')][_0xdcf7('0x16')]);}})[_0xdcf7('0x18')](function(_0x18f4eb){logger[_0xdcf7('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x12c176,_0x18f4eb);_0x153df7(_0x18f4eb);});});}exports[_0xdcf7('0x19')]=function(_0x32204d){var _0x53b111=this;return new Promise(function(_0x4990e7,_0x337d6c){return db[_0xdcf7('0x1a')][_0xdcf7('0x1b')](_0x32204d['body'],{'raw':_0x32204d[_0xdcf7('0x1c')]?_0x32204d[_0xdcf7('0x1c')][_0xdcf7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32204d[_0xdcf7('0x1c')]?_0x32204d[_0xdcf7('0x1c')][_0xdcf7('0x1e')]||null:null,'attributes':_0x32204d[_0xdcf7('0x1c')]?_0x32204d[_0xdcf7('0x1c')]['attributes']||null:null,'limit':_0x32204d[_0xdcf7('0x1c')]?_0x32204d[_0xdcf7('0x1c')][_0xdcf7('0x1f')]||null:null})[_0xdcf7('0xe')](function(_0x507985){logger[_0xdcf7('0xf')]('UpdateOpenchannelInteraction',_0x32204d);logger[_0xdcf7('0x11')](_0xdcf7('0x19'),_0x32204d,JSON[_0xdcf7('0x14')](_0x507985));_0x4990e7(_0x507985);})[_0xdcf7('0x18')](function(_0x5b8363){logger[_0xdcf7('0x15')]('UpdateOpenchannelInteraction',_0x5b8363[_0xdcf7('0x16')],_0x32204d);_0x337d6c(_0x53b111['error'](0x1f4,_0x5b8363['message']));});});};exports[_0xdcf7('0x20')]=function(_0x213a9f){return new Promise(function(_0x34b97,_0x3b202b){return db['OpenchannelInteraction'][_0xdcf7('0x21')]({'where':_0x213a9f[_0xdcf7('0x1c')]?_0x213a9f[_0xdcf7('0x1c')][_0xdcf7('0x1e')]||null:null})[_0xdcf7('0xe')](function(_0x25d211){if(_0x25d211){return _0x25d211[_0xdcf7('0x22')](_0x213a9f[_0xdcf7('0x23')][_0xdcf7('0x24')],_['omit'](_0x213a9f[_0xdcf7('0x23')],['ids','id'])||{});}})[_0xdcf7('0x25')](function(_0x27c22d){logger['info'](_0xdcf7('0x26'),_0x213a9f);logger['debug']('AddTags',_0x213a9f,JSON[_0xdcf7('0x14')](_0x27c22d));_0x34b97(_0x27c22d);})[_0xdcf7('0x18')](function(_0xb5412d){logger[_0xdcf7('0x15')](_0xdcf7('0x26'),_0xb5412d[_0xdcf7('0x16')],_0x213a9f);_0x3b202b(_this[_0xdcf7('0x15')](0x1f4,_0xb5412d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 7868253..c5917bf 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 _0xabce=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','update','emit'];(function(_0x3cfe4e,_0x3e2fed){var _0x22e983=function(_0x75f797){while(--_0x75f797){_0x3cfe4e['push'](_0x3cfe4e['shift']());}};_0x22e983(++_0x3e2fed);}(_0xabce,0x19a));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'use strict';var OpenchannelInteractionEvents=require(_0xeabc('0x0'));var events=['save','remove',_0xeabc('0x1')];function createListener(_0x1f5aa0,_0x57a767){return function(_0x2c1171){_0x57a767[_0xeabc('0x2')](_0x1f5aa0,_0x2c1171);};}function removeListener(_0x19d7bb,_0x550ba3){return function(){OpenchannelInteractionEvents[_0xeabc('0x3')](_0x19d7bb,_0x550ba3);};}exports[_0xeabc('0x4')]=function(_0x2342cb){for(var _0x37afc3=0x0,_0x35ad8e=events[_0xeabc('0x5')];_0x37afc3<_0x35ad8e;_0x37afc3++){var _0x109b20=events[_0x37afc3];var _0xaf0a2f=createListener(_0xeabc('0x6')+_0x109b20,_0x2342cb);OpenchannelInteractionEvents['on'](_0x109b20,_0xaf0a2f);}}; \ No newline at end of file +var _0xbacf=['save','remove','update','emit','register','length','./openchannelInteraction.events'];(function(_0x148acb,_0x2694f7){var _0x3b9378=function(_0x5bb255){while(--_0x5bb255){_0x148acb['push'](_0x148acb['shift']());}};_0x3b9378(++_0x2694f7);}(_0xbacf,0x1b8));var _0xfbac=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xbacf[_0x1e8b1e];return _0x4a0fde;};'use strict';var OpenchannelInteractionEvents=require(_0xfbac('0x0'));var events=[_0xfbac('0x1'),_0xfbac('0x2'),_0xfbac('0x3')];function createListener(_0x5ec3af,_0x453c65){return function(_0x14741f){_0x453c65[_0xfbac('0x4')](_0x5ec3af,_0x14741f);};}function removeListener(_0x42c69e,_0x4a0812){return function(){OpenchannelInteractionEvents['removeListener'](_0x42c69e,_0x4a0812);};}exports[_0xfbac('0x5')]=function(_0x576cfe){for(var _0x40d8ae=0x0,_0x3f4068=events[_0xfbac('0x6')];_0x40d8ae<_0x3f4068;_0x40d8ae++){var _0x4197a7=events[_0x40d8ae];var _0x352696=createListener('openchannelInteraction:'+_0x4197a7,_0x576cfe);OpenchannelInteractionEvents['on'](_0x4197a7,_0x352696);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 90ed253..ffc8095 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 _0xda69=['Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','openchannel','openchannelmessage:create','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','express'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xda69,0x1de));var _0x9da6=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xda69[_0x46ae5a];return _0x434986;};'use strict';var multer=require(_0x9da6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9da6('0x1'));var router=express[_0x9da6('0x2')]();var auth=require(_0x9da6('0x3'));var interaction=require(_0x9da6('0x4'));var config=require('../../config/environment');var controller=require(_0x9da6('0x5'));router['get']('/',auth[_0x9da6('0x6')](),controller[_0x9da6('0x7')]);router[_0x9da6('0x8')](_0x9da6('0x9'),auth[_0x9da6('0x6')](),controller[_0x9da6('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9da6('0x6')](),interaction['tracked'](_0x9da6('0xb'),_0x9da6('0xc')),controller['create']);router['put']('/:id',auth[_0x9da6('0x6')](),controller['update']);router[_0x9da6('0xd')](_0x9da6('0xe'),auth['isAuthenticated'](),controller[_0x9da6('0xf')]);router[_0x9da6('0xd')]('/:id/reject',auth['isAuthenticated'](),controller[_0x9da6('0x10')]);router[_0x9da6('0x11')](_0x9da6('0x12'),auth[_0x9da6('0x6')](),controller[_0x9da6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2239=['reject','delete','destroy','exports','util','connect-timeout','express','Router','get','isAuthenticated','/describe','/:id','show','post','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject'];(function(_0x3b70ed,_0x22dd15){var _0x5744db=function(_0xa90613){while(--_0xa90613){_0x3b70ed['push'](_0x3b70ed['shift']());}};_0x5744db(++_0x22dd15);}(_0x2239,0x1d2));var _0x9223=function(_0x3a18b5,_0x365cea){_0x3a18b5=_0x3a18b5-0x0;var _0x4cb74b=_0x2239[_0x3a18b5];return _0x4cb74b;};'use strict';var multer=require('multer');var util=require(_0x9223('0x0'));var path=require('path');var timeout=require(_0x9223('0x1'));var express=require(_0x9223('0x2'));var router=express[_0x9223('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelMessage.controller');router[_0x9223('0x4')]('/',auth[_0x9223('0x5')](),controller['index']);router[_0x9223('0x4')](_0x9223('0x6'),auth[_0x9223('0x5')](),controller['describe']);router[_0x9223('0x4')](_0x9223('0x7'),auth[_0x9223('0x5')](),controller[_0x9223('0x8')]);router[_0x9223('0x9')]('/',auth[_0x9223('0x5')](),interaction['tracked'](_0x9223('0xa'),_0x9223('0xb')),controller[_0x9223('0xc')]);router['put'](_0x9223('0x7'),auth[_0x9223('0x5')](),controller[_0x9223('0xd')]);router[_0x9223('0xe')](_0x9223('0xf'),auth['isAuthenticated'](),controller[_0x9223('0x10')]);router[_0x9223('0xe')](_0x9223('0x11'),auth['isAuthenticated'](),controller[_0x9223('0x12')]);router[_0x9223('0x13')](_0x9223('0x7'),auth[_0x9223('0x5')](),controller[_0x9223('0x14')]);module[_0x9223('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index ec02f6c..e2b5626 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 _0x2d96=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x42af0e,_0x421d97){var _0x52ae0b=function(_0x37ee91){while(--_0x37ee91){_0x42af0e['push'](_0x42af0e['shift']());}};_0x52ae0b(++_0x421d97);}(_0x2d96,0x81));var _0x62d9=function(_0x546bf5,_0x52fc92){_0x546bf5=_0x546bf5-0x0;var _0x5632c8=_0x2d96[_0x546bf5];return _0x5632c8;};'use strict';var Sequelize=require(_0x62d9('0x0'));module[_0x62d9('0x1')]={'body':{'type':Sequelize[_0x62d9('0x2')](_0x62d9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x62d9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x62d9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x62d9('0x5')),'defaultValue':_0x62d9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x62d9('0x6')]}}; \ No newline at end of file +var _0x3398=['medium','BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x38e76d,_0x1c5cbc){var _0x455156=function(_0x1fdb55){while(--_0x1fdb55){_0x38e76d['push'](_0x38e76d['shift']());}};_0x455156(++_0x1c5cbc);}(_0x3398,0x1d2));var _0x8339=function(_0x48000b,_0x14bcac){_0x48000b=_0x48000b-0x0;var _0x43d09b=_0x3398[_0x48000b];return _0x43d09b;};'use strict';var Sequelize=require(_0x8339('0x0'));module[_0x8339('0x1')]={'body':{'type':Sequelize[_0x8339('0x2')](_0x8339('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8339('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8339('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8339('0x5')]('in',_0x8339('0x6')),'defaultValue':_0x8339('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 5b9e479..393aae1 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 _0x3344=['reject','save','update','destroy','stack','name','send','map','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','OpenchannelMessage','findAll','rows','show','params','rawAttributes','keys','length','include','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','sox','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','defaults','localhost','redis','./openchannelMessage.socket','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','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x383339,_0x3d185b){var _0x1f5132=function(_0x4dfa59){while(--_0x4dfa59){_0x383339['push'](_0x383339['shift']());}};_0x1f5132(++_0x3d185b);}(_0x3344,0x13e));var _0x4334=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3344[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x4334('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4334('0x1'));var jsonpatch=require(_0x4334('0x2'));var rp=require('request-promise');var moment=require(_0x4334('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4334('0x4'));var util=require(_0x4334('0x5'));var path=require('path');var sox=require(_0x4334('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4334('0x7'));var squel=require(_0x4334('0x8'));var crypto=require(_0x4334('0x9'));var jsforce=require(_0x4334('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4334('0xb'));var Papa=require(_0x4334('0xc'));var Redis=require(_0x4334('0xd'));var authService=require(_0x4334('0xe'));var qs=require(_0x4334('0xf'));var as=require(_0x4334('0x10'));var hardwareService=require(_0x4334('0x11'));var logger=require(_0x4334('0x12'))('api');var utils=require(_0x4334('0x13'));var config=require(_0x4334('0x14'));var db=require(_0x4334('0x15'))['db'];config['redis']=_[_0x4334('0x16')](config['redis'],{'host':_0x4334('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4334('0x18')]));require(_0x4334('0x19'))['register'](socket);var jayson=require(_0x4334('0x1a'));var client=jayson[_0x4334('0x1b')][_0x4334('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x4334('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x21bef7,_0x420f7b,_0x46f26f){if(_0x46f26f){var _0xd45c06=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd45c06[_0x4334('0x1d')](_0x420f7b)){return _0x21bef7;}else{throw new db['Sequelize'][(_0x4334('0x1e'))](_0x4334('0x1f'));}}else{return _0x21bef7;}}function respondWithRpcPromise(_0x2a22f9,_0xea1d6c,_0x697327,_0x336e72){return new BPromise(function(_0x2e15fb,_0x3147d0){var _0x16cc20=_0x336e72||client;return _0x16cc20['request'](_0x2a22f9,_0x697327)[_0x4334('0x20')](function(_0x5811d6){logger['info'](_0x4334('0x21'),_0xea1d6c,'request\x20sent');logger[_0x4334('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xea1d6c,_0x4334('0x23'),JSON[_0x4334('0x24')](_0x5811d6));if(_0x5811d6[_0x4334('0x25')]){if(_0x5811d6[_0x4334('0x25')][_0x4334('0x26')]===0x1f4){logger[_0x4334('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0xea1d6c,_0x5811d6[_0x4334('0x25')][_0x4334('0x27')]);return _0x3147d0(_0x5811d6[_0x4334('0x25')][_0x4334('0x27')]);}logger[_0x4334('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0xea1d6c,_0x5811d6['error'][_0x4334('0x27')]);return _0x2e15fb(_0x5811d6['error'][_0x4334('0x27')]);}else{logger[_0x4334('0x28')](_0x4334('0x21'),_0xea1d6c,_0x4334('0x23'));_0x2e15fb(_0x5811d6[_0x4334('0x29')][_0x4334('0x27')]);}})[_0x4334('0x2a')](function(_0x4be8df){logger[_0x4334('0x25')](_0x4334('0x21'),_0xea1d6c,_0x4be8df);_0x3147d0(_0x4be8df);});});}function respondWithStatusCode(_0x230878,_0x427d01){_0x427d01=_0x427d01||0xcc;return function(_0x47de9e){if(_0x47de9e){return _0x230878['sendStatus'](_0x427d01);}return _0x230878[_0x4334('0x2b')](_0x427d01)[_0x4334('0x2c')]();};}function respondWithResult(_0x5220be,_0x58d377){_0x58d377=_0x58d377||0xc8;return function(_0xce3a4e){if(_0xce3a4e){return _0x5220be[_0x4334('0x2b')](_0x58d377)[_0x4334('0x2d')](_0xce3a4e);}};}function respondWithFilteredResult(_0x1b22f0,_0x2b6082){return function(_0x53f69d){if(_0x53f69d){var _0x4f990e=_0x53f69d[_0x4334('0x2e')],_0x556ac8=_0x2b6082[_0x4334('0x2f')],_0x2ddd55=_0x2b6082['offset']+_0x2b6082['limit'],_0x3be374;if(_0x2ddd55>=_0x4f990e){_0x2ddd55=_0x4f990e;_0x3be374=0xc8;}else{_0x3be374=0xce;}_0x1b22f0[_0x4334('0x2b')](_0x3be374);return _0x1b22f0[_0x4334('0x30')](_0x4334('0x31'),_0x556ac8+'-'+_0x2ddd55+'/'+_0x4f990e)[_0x4334('0x2d')](_0x53f69d);}return null;};}function patchUpdates(_0x23bcfd){return function(_0x193f2a){try{jsonpatch[_0x4334('0x32')](_0x193f2a,_0x23bcfd,!![]);}catch(_0x5065bc){return BPromise[_0x4334('0x33')](_0x5065bc);}return _0x193f2a[_0x4334('0x34')]();};}function saveUpdates(_0xfa813d,_0x435727){return function(_0xbcd524){if(_0xbcd524){return _0xbcd524[_0x4334('0x35')](_0xfa813d)[_0x4334('0x20')](function(_0x5435c2){return _0x5435c2;});}return null;};}function removeEntity(_0x3211d2,_0x278840){return function(_0xd2bdb8){if(_0xd2bdb8){return _0xd2bdb8[_0x4334('0x36')]()[_0x4334('0x20')](function(){_0x3211d2[_0x4334('0x2b')](0xcc)[_0x4334('0x2c')]();});}};}function handleEntityNotFound(_0x505917,_0x4140ec){return function(_0x46059e){if(!_0x46059e){_0x505917['sendStatus'](0x194);}return _0x46059e;};}function handleError(_0x4bbeb6,_0x54a82e){_0x54a82e=_0x54a82e||0x1f4;return function(_0x3879cc){logger['error'](_0x3879cc[_0x4334('0x37')]);if(_0x3879cc[_0x4334('0x38')]){delete _0x3879cc[_0x4334('0x38')];}_0x4bbeb6[_0x4334('0x2b')](_0x54a82e)[_0x4334('0x39')](_0x3879cc);};}exports['index']=function(_0xec6566,_0x4f929e){var _0x502eab={},_0x199257={},_0x4128f6={'count':0x0,'rows':[]};var _0x4e1504=_[_0x4334('0x3a')](db['OpenchannelMessage']['rawAttributes'],function(_0x1d4bdb){return{'name':_0x1d4bdb['fieldName'],'type':_0x1d4bdb[_0x4334('0x3b')]['key']};});_0x199257[_0x4334('0x3c')]=_[_0x4334('0x3a')](_0x4e1504,_0x4334('0x38'));_0x199257[_0x4334('0x3d')]=_['keys'](_0xec6566[_0x4334('0x3d')]);_0x199257[_0x4334('0x3e')]=_[_0x4334('0x3f')](_0x199257[_0x4334('0x3c')],_0x199257[_0x4334('0x3d')]);_0x502eab['attributes']=_[_0x4334('0x3f')](_0x199257[_0x4334('0x3c')],qs[_0x4334('0x40')](_0xec6566[_0x4334('0x3d')][_0x4334('0x40')]));_0x502eab[_0x4334('0x41')]=_0x502eab['attributes']['length']?_0x502eab[_0x4334('0x41')]:_0x199257[_0x4334('0x3c')];if(!_0xec6566[_0x4334('0x3d')][_0x4334('0x42')](_0x4334('0x43'))){_0x502eab[_0x4334('0x44')]=qs[_0x4334('0x44')](_0xec6566[_0x4334('0x3d')][_0x4334('0x44')]);_0x502eab[_0x4334('0x2f')]=qs['offset'](_0xec6566['query']['offset']);}_0x502eab[_0x4334('0x45')]=qs[_0x4334('0x46')](_0xec6566[_0x4334('0x3d')][_0x4334('0x46')]);_0x502eab[_0x4334('0x47')]=qs['filters'](_[_0x4334('0x48')](_0xec6566[_0x4334('0x3d')],_0x199257[_0x4334('0x3e')]),_0x4e1504);if(_0xec6566[_0x4334('0x3d')][_0x4334('0x49')]){_0x502eab[_0x4334('0x47')]=_[_0x4334('0x4a')](_0x502eab['where'],{'$or':_[_0x4334('0x3a')](_0x4e1504,function(_0x438402){if(_0x438402[_0x4334('0x3b')]!==_0x4334('0x4b')){var _0x27f2e0={};_0x27f2e0[_0x438402[_0x4334('0x38')]]={'$like':'%'+_0xec6566[_0x4334('0x3d')][_0x4334('0x49')]+'%'};return _0x27f2e0;}})});}_0x502eab=_[_0x4334('0x4a')]({},_0x502eab,_0xec6566[_0x4334('0x4c')]);var _0x20916b={'where':_0x502eab[_0x4334('0x47')]};return db['OpenchannelMessage'][_0x4334('0x2e')](_0x20916b)[_0x4334('0x20')](function(_0x598ddf){_0x4128f6[_0x4334('0x2e')]=_0x598ddf;if(_0xec6566[_0x4334('0x3d')][_0x4334('0x4d')]){_0x502eab['include']=[{'all':!![]}];}return db[_0x4334('0x4e')][_0x4334('0x4f')](_0x502eab);})[_0x4334('0x20')](function(_0x40a6b1){_0x4128f6[_0x4334('0x50')]=_0x40a6b1;return _0x4128f6;})['then'](respondWithFilteredResult(_0x4f929e,_0x502eab))[_0x4334('0x2a')](handleError(_0x4f929e,null));};exports[_0x4334('0x51')]=function(_0x415e37,_0x3db05f){var _0x86f974={'raw':!![],'where':{'id':_0x415e37[_0x4334('0x52')]['id']}},_0x9ba25f={};_0x9ba25f['model']=_['keys'](db[_0x4334('0x4e')][_0x4334('0x53')]);_0x9ba25f[_0x4334('0x3d')]=_[_0x4334('0x54')](_0x415e37[_0x4334('0x3d')]);_0x9ba25f[_0x4334('0x3e')]=_['intersection'](_0x9ba25f['model'],_0x9ba25f['query']);_0x86f974[_0x4334('0x41')]=_[_0x4334('0x3f')](_0x9ba25f['model'],qs[_0x4334('0x40')](_0x415e37[_0x4334('0x3d')][_0x4334('0x40')]));_0x86f974['attributes']=_0x86f974[_0x4334('0x41')][_0x4334('0x55')]?_0x86f974[_0x4334('0x41')]:_0x9ba25f[_0x4334('0x3c')];if(_0x415e37['query'][_0x4334('0x4d')]){_0x86f974[_0x4334('0x56')]=[{'all':!![]}];}_0x86f974=_[_0x4334('0x4a')]({},_0x86f974,_0x415e37[_0x4334('0x4c')]);return db[_0x4334('0x4e')][_0x4334('0x57')](_0x86f974)[_0x4334('0x20')](handleEntityNotFound(_0x3db05f,null))[_0x4334('0x20')](respondWithResult(_0x3db05f,null))[_0x4334('0x2a')](handleError(_0x3db05f,null));};exports[_0x4334('0x58')]=function(_0x53eb81,_0x3ba184){return db[_0x4334('0x4e')][_0x4334('0x58')](_0x53eb81[_0x4334('0x59')],{})[_0x4334('0x20')](respondWithResult(_0x3ba184,0xc9))['catch'](handleError(_0x3ba184,null));};exports[_0x4334('0x35')]=function(_0x18838c,_0x47cd86){if(_0x18838c[_0x4334('0x59')]['id']){delete _0x18838c['body']['id'];}return db[_0x4334('0x4e')][_0x4334('0x57')]({'where':{'id':_0x18838c[_0x4334('0x52')]['id']}})['then'](handleEntityNotFound(_0x47cd86,null))['then'](saveUpdates(_0x18838c[_0x4334('0x59')],null))['then'](respondWithResult(_0x47cd86,null))[_0x4334('0x2a')](handleError(_0x47cd86,null));};exports[_0x4334('0x36')]=function(_0x4ac844,_0x1a2fd9){return db[_0x4334('0x4e')][_0x4334('0x57')]({'where':{'id':_0x4ac844[_0x4334('0x52')]['id']}})['then'](handleEntityNotFound(_0x1a2fd9,null))['then'](removeEntity(_0x1a2fd9,null))[_0x4334('0x2a')](handleError(_0x1a2fd9,null));};exports['describe']=function(_0x49859c,_0x35e24f){return db[_0x4334('0x4e')][_0x4334('0x5a')]()[_0x4334('0x20')](respondWithResult(_0x35e24f,null))[_0x4334('0x2a')](handleError(_0x35e24f,null));};var interaction_log=require(_0x4334('0x12'))(_0x4334('0x5b'));exports[_0x4334('0x5c')]=function(_0x57dbb8,_0x77a212,_0x42b879){var _0x1ce0bc={'channel':_0x4334('0x5d')};if(_0x57dbb8[_0x4334('0x59')]['id']){delete _0x57dbb8[_0x4334('0x59')]['id'];}_0x57dbb8['body'][_0x4334('0x5e')]=!![];_0x57dbb8[_0x4334('0x59')][_0x4334('0x5f')]=moment()[_0x4334('0x60')](_0x4334('0x61'));_0x57dbb8[_0x4334('0x59')]['UserId']=_0x57dbb8[_0x4334('0x59')][_0x4334('0x62')]||_0x57dbb8[_0x4334('0x63')]['id'];return db[_0x4334('0x4e')][_0x4334('0x57')]({'where':{'id':_0x57dbb8[_0x4334('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x4334('0x64')],'as':_0x4334('0x65')}]})[_0x4334('0x20')](handleEntityNotFound(_0x77a212,null))[_0x4334('0x20')](saveUpdates(_0x57dbb8[_0x4334('0x59')],null))[_0x4334('0x20')](function(_0x468a1d){if(_0x468a1d){_0x1ce0bc[_0x4334('0x27')]=_0x468a1d['get']({'plain':!![]});return db[_0x4334('0x66')][_0x4334('0x57')]({'where':{'id':_0x468a1d[_0x4334('0x67')]}});}return null;})[_0x4334('0x20')](handleEntityNotFound(_0x77a212,null))['then'](function(_0x17b623){if(_0x17b623){return _0x17b623[_0x4334('0x35')]({'UserId':_0x57dbb8['body'][_0x4334('0x62')],'read1stAt':_[_0x4334('0x68')](_0x17b623[_0x4334('0x69')])?moment()[_0x4334('0x60')](_0x4334('0x61')):undefined});}return null;})[_0x4334('0x20')](function(_0x375983){if(_0x375983){_0x1ce0bc[_0x4334('0x6a')]=_0x375983[_0x4334('0x6b')]({'plain':!![]});interaction_log[_0x4334('0x28')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57dbb8['user']['id'],_0x57dbb8[_0x4334('0x63')][_0x4334('0x38')],_0x57dbb8[_0x4334('0x63')][_0x4334('0x6c')],_0x1ce0bc['interaction']['id'],_0x57dbb8['body']?JSON['stringify'](_0x57dbb8[_0x4334('0x59')]):_0x4334('0x6d'));return respondWithRpcPromise(_0x4334('0x6e'),_0x4334('0x6f'),_0x1ce0bc);}return null;})['then'](function(_0x6a0a0a){if(_0x6a0a0a){if(_0x57dbb8[_0x4334('0x59')]['manual']){_0x1ce0bc['message'][_0x4334('0x70')]=util['format'](_0x4334('0x71'),_0x57dbb8[_0x4334('0x63')][_0x4334('0x38')]);_0x1ce0bc[_0x4334('0x27')]['channel']=_0x1ce0bc[_0x4334('0x72')];_0x1ce0bc[_0x4334('0x27')][_0x4334('0x73')]=_0x4334('0x5c');return respondWithRpcPromise(_0x4334('0x74'),_0x4334('0x74'),{'event':_0x4334('0x75'),'message':_0x1ce0bc[_0x4334('0x27')]},client9002)[_0x4334('0x20')](function(){return _0x1ce0bc;});}return _0x1ce0bc;}return null;})[_0x4334('0x20')](respondWithResult(_0x77a212,null))[_0x4334('0x2a')](handleError(_0x77a212,null));};var interaction_log=require(_0x4334('0x12'))(_0x4334('0x5b'));exports[_0x4334('0x33')]=function(_0x4292b3,_0x2c4f1d,_0x17d629){var _0x288f57={'agent':{},'channel':_0x4334('0x5d')};if(_0x4292b3[_0x4334('0x59')]['id']){delete _0x4292b3[_0x4334('0x59')]['id'];}_0x4292b3[_0x4334('0x59')]['UserId']=_0x4292b3[_0x4334('0x59')][_0x4334('0x62')]||_0x4292b3['user']['id'];_0x288f57[_0x4334('0x76')]['id']=_0x4292b3['body'][_0x4334('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4292b3[_0x4334('0x52')]['id'],'UserId':null}})[_0x4334('0x20')](handleEntityNotFound(_0x2c4f1d,null))[_0x4334('0x20')](function(_0x5afb7d){if(_0x5afb7d){_0x288f57[_0x4334('0x27')]=_0x5afb7d['get']({'plain':!![]});return db[_0x4334('0x66')][_0x4334('0x57')]({'where':{'id':_0x5afb7d[_0x4334('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x2c4f1d,null))['then'](function(_0x40a082){if(_0x40a082){_0x288f57[_0x4334('0x6a')]=_0x40a082[_0x4334('0x6b')]({'plain':!![]});interaction_log['info'](_0x4334('0x77'),_0x4292b3[_0x4334('0x63')]['id'],_0x4292b3[_0x4334('0x63')][_0x4334('0x38')],_0x4292b3[_0x4334('0x63')][_0x4334('0x6c')],_0x288f57[_0x4334('0x6a')]['id'],_0x4292b3[_0x4334('0x59')]?JSON[_0x4334('0x24')](_0x4292b3[_0x4334('0x59')]):'null');return respondWithRpcPromise(_0x4334('0x78'),_0x4334('0x79'),_0x288f57);}return null;})[_0x4334('0x20')](function(_0x5a3249){if(_0x5a3249){_0x5a3249['message'][_0x4334('0x70')]=util['format']('SIP/%s',_0x4292b3['user']['name']);_0x5a3249[_0x4334('0x27')][_0x4334('0x72')]=_0x288f57['channel'];_0x5a3249[_0x4334('0x27')]['event']=_0x4334('0x33');respondWithRpcPromise('EventManager',_0x4334('0x74'),{'event':_0x4334('0x7a'),'message':_0x5a3249['message']},client9002);return _0x288f57;}return null;})['then'](respondWithResult(_0x2c4f1d,null))[_0x4334('0x2a')](handleError(_0x2c4f1d,null));}; \ No newline at end of file +var _0x907a=['save','update','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','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','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','end','status','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x30c48d,_0x25e828){var _0x2c64aa=function(_0x244ae6){while(--_0x244ae6){_0x30c48d['push'](_0x30c48d['shift']());}};_0x2c64aa(++_0x25e828);}(_0x907a,0x142));var _0xa907=function(_0x19eddf,_0x3b50cf){_0x19eddf=_0x19eddf-0x0;var _0x1c10f6=_0x907a[_0x19eddf];return _0x1c10f6;};'use strict';var pdf=require(_0xa907('0x0'));var emlformat=require(_0xa907('0x1'));var rimraf=require(_0xa907('0x2'));var zipdir=require(_0xa907('0x3'));var jsonpatch=require(_0xa907('0x4'));var rp=require('request-promise');var moment=require(_0xa907('0x5'));var BPromise=require(_0xa907('0x6'));var Mustache=require(_0xa907('0x7'));var util=require(_0xa907('0x8'));var path=require(_0xa907('0x9'));var sox=require('sox');var csv=require(_0xa907('0xa'));var ejs=require(_0xa907('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa907('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa907('0xd'));var Papa=require(_0xa907('0xe'));var Redis=require('ioredis');var authService=require(_0xa907('0xf'));var qs=require(_0xa907('0x10'));var as=require(_0xa907('0x11'));var hardwareService=require(_0xa907('0x12'));var logger=require(_0xa907('0x13'))(_0xa907('0x14'));var utils=require(_0xa907('0x15'));var config=require(_0xa907('0x16'));var db=require(_0xa907('0x17'))['db'];config['redis']=_[_0xa907('0x18')](config[_0xa907('0x19')],{'host':_0xa907('0x1a'),'port':0x18eb});var socket=require(_0xa907('0x1b'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xa907('0x1c')](socket);var jayson=require(_0xa907('0x1d'));var client=jayson[_0xa907('0x1e')][_0xa907('0x1f')]({'port':0x232c});var client9002=jayson[_0xa907('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x1b8be7,_0xbec05d,_0x124850){if(_0x124850){var _0x1c22ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c22ad[_0xa907('0x20')](_0xbec05d)){return _0x1b8be7;}else{throw new db[(_0xa907('0x21'))][(_0xa907('0x22'))](_0xa907('0x23'));}}else{return _0x1b8be7;}}function respondWithRpcPromise(_0x26c4e7,_0x567ab7,_0x49e764,_0x152360){return new BPromise(function(_0x13f220,_0x420252){var _0x2127db=_0x152360||client;return _0x2127db[_0xa907('0x24')](_0x26c4e7,_0x49e764)[_0xa907('0x25')](function(_0x10d81a){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x567ab7,'request\x20sent');logger[_0xa907('0x26')](_0xa907('0x27'),_0x567ab7,_0xa907('0x28'),JSON[_0xa907('0x29')](_0x10d81a));if(_0x10d81a[_0xa907('0x2a')]){if(_0x10d81a[_0xa907('0x2a')][_0xa907('0x2b')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x567ab7,_0x10d81a[_0xa907('0x2a')][_0xa907('0x2c')]);return _0x420252(_0x10d81a['error'][_0xa907('0x2c')]);}logger['error'](_0xa907('0x2d'),_0x567ab7,_0x10d81a['error'][_0xa907('0x2c')]);return _0x13f220(_0x10d81a['error'][_0xa907('0x2c')]);}else{logger[_0xa907('0x2e')](_0xa907('0x2d'),_0x567ab7,'request\x20sent');_0x13f220(_0x10d81a['result']['message']);}})['catch'](function(_0x571d4b){logger[_0xa907('0x2a')](_0xa907('0x2d'),_0x567ab7,_0x571d4b);_0x420252(_0x571d4b);});});}function respondWithStatusCode(_0x231ac8,_0xcecc93){_0xcecc93=_0xcecc93||0xcc;return function(_0x3250bd){if(_0x3250bd){return _0x231ac8['sendStatus'](_0xcecc93);}return _0x231ac8['status'](_0xcecc93)[_0xa907('0x2f')]();};}function respondWithResult(_0x2e284c,_0x2f6519){_0x2f6519=_0x2f6519||0xc8;return function(_0x251df){if(_0x251df){return _0x2e284c[_0xa907('0x30')](_0x2f6519)[_0xa907('0x31')](_0x251df);}};}function respondWithFilteredResult(_0x4831fc,_0x47b3fe){return function(_0x3502a8){if(_0x3502a8){var _0x33283f=_0x3502a8[_0xa907('0x32')],_0x216174=_0x47b3fe[_0xa907('0x33')],_0x1b4f6c=_0x47b3fe[_0xa907('0x33')]+_0x47b3fe[_0xa907('0x34')],_0x1a0edc;if(_0x1b4f6c>=_0x33283f){_0x1b4f6c=_0x33283f;_0x1a0edc=0xc8;}else{_0x1a0edc=0xce;}_0x4831fc[_0xa907('0x30')](_0x1a0edc);return _0x4831fc['set'](_0xa907('0x35'),_0x216174+'-'+_0x1b4f6c+'/'+_0x33283f)[_0xa907('0x31')](_0x3502a8);}return null;};}function patchUpdates(_0x501f9a){return function(_0x1e794f){try{jsonpatch[_0xa907('0x36')](_0x1e794f,_0x501f9a,!![]);}catch(_0x914fc5){return BPromise[_0xa907('0x37')](_0x914fc5);}return _0x1e794f[_0xa907('0x38')]();};}function saveUpdates(_0x241b0b,_0xec6a37){return function(_0x399a57){if(_0x399a57){return _0x399a57[_0xa907('0x39')](_0x241b0b)[_0xa907('0x25')](function(_0x474c90){return _0x474c90;});}return null;};}function removeEntity(_0x322c83,_0x3d464c){return function(_0x34a670){if(_0x34a670){return _0x34a670[_0xa907('0x3a')]()['then'](function(){_0x322c83[_0xa907('0x30')](0xcc)[_0xa907('0x2f')]();});}};}function handleEntityNotFound(_0xb09d9e,_0x5289c6){return function(_0x4bfa62){if(!_0x4bfa62){_0xb09d9e[_0xa907('0x3b')](0x194);}return _0x4bfa62;};}function handleError(_0x50c5e2,_0x287ebb){_0x287ebb=_0x287ebb||0x1f4;return function(_0x288b43){logger[_0xa907('0x2a')](_0x288b43[_0xa907('0x3c')]);if(_0x288b43[_0xa907('0x3d')]){delete _0x288b43[_0xa907('0x3d')];}_0x50c5e2[_0xa907('0x30')](_0x287ebb)[_0xa907('0x3e')](_0x288b43);};}exports[_0xa907('0x3f')]=function(_0x343abd,_0x365052){var _0x435ace={},_0x52745c={},_0x386083={'count':0x0,'rows':[]};var _0x323ea9=_[_0xa907('0x40')](db[_0xa907('0x41')][_0xa907('0x42')],function(_0x1a8ac0){return{'name':_0x1a8ac0[_0xa907('0x43')],'type':_0x1a8ac0['type']['key']};});_0x52745c[_0xa907('0x44')]=_[_0xa907('0x40')](_0x323ea9,_0xa907('0x3d'));_0x52745c['query']=_['keys'](_0x343abd[_0xa907('0x45')]);_0x52745c[_0xa907('0x46')]=_[_0xa907('0x47')](_0x52745c[_0xa907('0x44')],_0x52745c['query']);_0x435ace[_0xa907('0x48')]=_['intersection'](_0x52745c[_0xa907('0x44')],qs[_0xa907('0x49')](_0x343abd[_0xa907('0x45')][_0xa907('0x49')]));_0x435ace['attributes']=_0x435ace['attributes'][_0xa907('0x4a')]?_0x435ace[_0xa907('0x48')]:_0x52745c[_0xa907('0x44')];if(!_0x343abd[_0xa907('0x45')][_0xa907('0x4b')](_0xa907('0x4c'))){_0x435ace[_0xa907('0x34')]=qs[_0xa907('0x34')](_0x343abd[_0xa907('0x45')][_0xa907('0x34')]);_0x435ace[_0xa907('0x33')]=qs[_0xa907('0x33')](_0x343abd[_0xa907('0x45')][_0xa907('0x33')]);}_0x435ace[_0xa907('0x4d')]=qs[_0xa907('0x4e')](_0x343abd['query'][_0xa907('0x4e')]);_0x435ace[_0xa907('0x4f')]=qs[_0xa907('0x46')](_[_0xa907('0x50')](_0x343abd[_0xa907('0x45')],_0x52745c[_0xa907('0x46')]),_0x323ea9);if(_0x343abd[_0xa907('0x45')][_0xa907('0x51')]){_0x435ace[_0xa907('0x4f')]=_[_0xa907('0x52')](_0x435ace['where'],{'$or':_[_0xa907('0x40')](_0x323ea9,function(_0x56222a){if(_0x56222a[_0xa907('0x53')]!==_0xa907('0x54')){var _0x411b56={};_0x411b56[_0x56222a[_0xa907('0x3d')]]={'$like':'%'+_0x343abd[_0xa907('0x45')][_0xa907('0x51')]+'%'};return _0x411b56;}})});}_0x435ace=_[_0xa907('0x52')]({},_0x435ace,_0x343abd[_0xa907('0x55')]);var _0x4cb9c0={'where':_0x435ace[_0xa907('0x4f')]};return db[_0xa907('0x41')][_0xa907('0x32')](_0x4cb9c0)[_0xa907('0x25')](function(_0x371dea){_0x386083[_0xa907('0x32')]=_0x371dea;if(_0x343abd[_0xa907('0x45')][_0xa907('0x56')]){_0x435ace[_0xa907('0x57')]=[{'all':!![]}];}return db[_0xa907('0x41')][_0xa907('0x58')](_0x435ace);})[_0xa907('0x25')](function(_0x32ed85){_0x386083['rows']=_0x32ed85;return _0x386083;})[_0xa907('0x25')](respondWithFilteredResult(_0x365052,_0x435ace))['catch'](handleError(_0x365052,null));};exports[_0xa907('0x59')]=function(_0x4e2d15,_0x23c617){var _0x4c7a80={'raw':!![],'where':{'id':_0x4e2d15[_0xa907('0x5a')]['id']}},_0x130b2e={};_0x130b2e['model']=_[_0xa907('0x5b')](db[_0xa907('0x41')][_0xa907('0x42')]);_0x130b2e[_0xa907('0x45')]=_[_0xa907('0x5b')](_0x4e2d15[_0xa907('0x45')]);_0x130b2e[_0xa907('0x46')]=_['intersection'](_0x130b2e[_0xa907('0x44')],_0x130b2e[_0xa907('0x45')]);_0x4c7a80[_0xa907('0x48')]=_[_0xa907('0x47')](_0x130b2e[_0xa907('0x44')],qs[_0xa907('0x49')](_0x4e2d15['query'][_0xa907('0x49')]));_0x4c7a80[_0xa907('0x48')]=_0x4c7a80[_0xa907('0x48')][_0xa907('0x4a')]?_0x4c7a80[_0xa907('0x48')]:_0x130b2e['model'];if(_0x4e2d15['query']['includeAll']){_0x4c7a80['include']=[{'all':!![]}];}_0x4c7a80=_[_0xa907('0x52')]({},_0x4c7a80,_0x4e2d15[_0xa907('0x55')]);return db['OpenchannelMessage'][_0xa907('0x5c')](_0x4c7a80)['then'](handleEntityNotFound(_0x23c617,null))['then'](respondWithResult(_0x23c617,null))[_0xa907('0x5d')](handleError(_0x23c617,null));};exports[_0xa907('0x5e')]=function(_0xddc52b,_0x38bea9){return db[_0xa907('0x41')][_0xa907('0x5e')](_0xddc52b[_0xa907('0x5f')],{})[_0xa907('0x25')](respondWithResult(_0x38bea9,0xc9))[_0xa907('0x5d')](handleError(_0x38bea9,null));};exports[_0xa907('0x39')]=function(_0x446a68,_0xbebdf5){if(_0x446a68[_0xa907('0x5f')]['id']){delete _0x446a68['body']['id'];}return db[_0xa907('0x41')][_0xa907('0x5c')]({'where':{'id':_0x446a68[_0xa907('0x5a')]['id']}})[_0xa907('0x25')](handleEntityNotFound(_0xbebdf5,null))[_0xa907('0x25')](saveUpdates(_0x446a68[_0xa907('0x5f')],null))[_0xa907('0x25')](respondWithResult(_0xbebdf5,null))[_0xa907('0x5d')](handleError(_0xbebdf5,null));};exports[_0xa907('0x3a')]=function(_0x3c560c,_0x1ed8f1){return db['OpenchannelMessage'][_0xa907('0x5c')]({'where':{'id':_0x3c560c[_0xa907('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ed8f1,null))[_0xa907('0x25')](removeEntity(_0x1ed8f1,null))['catch'](handleError(_0x1ed8f1,null));};exports[_0xa907('0x60')]=function(_0x3a8a2f,_0x4de9b5){return db[_0xa907('0x41')][_0xa907('0x60')]()[_0xa907('0x25')](respondWithResult(_0x4de9b5,null))[_0xa907('0x5d')](handleError(_0x4de9b5,null));};var interaction_log=require(_0xa907('0x13'))(_0xa907('0x61'));exports['accept']=function(_0x16d4e6,_0x5996ed,_0x5bd076){var _0x194dc1={'channel':_0xa907('0x62')};if(_0x16d4e6[_0xa907('0x5f')]['id']){delete _0x16d4e6[_0xa907('0x5f')]['id'];}_0x16d4e6['body'][_0xa907('0x63')]=!![];_0x16d4e6[_0xa907('0x5f')][_0xa907('0x64')]=moment()[_0xa907('0x65')](_0xa907('0x66'));_0x16d4e6[_0xa907('0x5f')][_0xa907('0x67')]=_0x16d4e6[_0xa907('0x5f')][_0xa907('0x67')]||_0x16d4e6['user']['id'];return db[_0xa907('0x41')][_0xa907('0x5c')]({'where':{'id':_0x16d4e6[_0xa907('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xa907('0x68')],'as':_0xa907('0x69')}]})[_0xa907('0x25')](handleEntityNotFound(_0x5996ed,null))[_0xa907('0x25')](saveUpdates(_0x16d4e6[_0xa907('0x5f')],null))[_0xa907('0x25')](function(_0x550471){if(_0x550471){_0x194dc1[_0xa907('0x2c')]=_0x550471[_0xa907('0x6a')]({'plain':!![]});return db[_0xa907('0x6b')][_0xa907('0x5c')]({'where':{'id':_0x550471[_0xa907('0x6c')]}});}return null;})[_0xa907('0x25')](handleEntityNotFound(_0x5996ed,null))[_0xa907('0x25')](function(_0x1eb65b){if(_0x1eb65b){return _0x1eb65b[_0xa907('0x39')]({'UserId':_0x16d4e6[_0xa907('0x5f')]['UserId'],'read1stAt':_[_0xa907('0x6d')](_0x1eb65b['read1stAt'])?moment()[_0xa907('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2f6126){if(_0x2f6126){_0x194dc1[_0xa907('0x6e')]=_0x2f6126[_0xa907('0x6a')]({'plain':!![]});interaction_log[_0xa907('0x2e')](_0xa907('0x6f'),_0x16d4e6[_0xa907('0x70')]['id'],_0x16d4e6[_0xa907('0x70')][_0xa907('0x3d')],_0x16d4e6['user'][_0xa907('0x71')],_0x194dc1[_0xa907('0x6e')]['id'],_0x16d4e6['body']?JSON[_0xa907('0x29')](_0x16d4e6['body']):'null');return respondWithRpcPromise(_0xa907('0x72'),_0xa907('0x73'),_0x194dc1);}return null;})[_0xa907('0x25')](function(_0x2734e8){if(_0x2734e8){if(_0x16d4e6[_0xa907('0x5f')][_0xa907('0x74')]){_0x194dc1[_0xa907('0x2c')][_0xa907('0x75')]=util[_0xa907('0x65')](_0xa907('0x76'),_0x16d4e6[_0xa907('0x70')][_0xa907('0x3d')]);_0x194dc1[_0xa907('0x2c')]['channel']=_0x194dc1[_0xa907('0x77')];_0x194dc1[_0xa907('0x2c')][_0xa907('0x78')]='accept';return respondWithRpcPromise(_0xa907('0x79'),_0xa907('0x79'),{'event':'acceptmessage','message':_0x194dc1['message']},client9002)[_0xa907('0x25')](function(){return _0x194dc1;});}return _0x194dc1;}return null;})['then'](respondWithResult(_0x5996ed,null))[_0xa907('0x5d')](handleError(_0x5996ed,null));};var interaction_log=require(_0xa907('0x13'))('openchannel-interactions');exports['reject']=function(_0x476a5c,_0x1516b6,_0x15b4c7){var _0x5b9271={'agent':{},'channel':_0xa907('0x62')};if(_0x476a5c[_0xa907('0x5f')]['id']){delete _0x476a5c[_0xa907('0x5f')]['id'];}_0x476a5c[_0xa907('0x5f')][_0xa907('0x67')]=_0x476a5c[_0xa907('0x5f')][_0xa907('0x67')]||_0x476a5c[_0xa907('0x70')]['id'];_0x5b9271[_0xa907('0x7a')]['id']=_0x476a5c[_0xa907('0x5f')][_0xa907('0x67')];return db[_0xa907('0x41')][_0xa907('0x5c')]({'where':{'id':_0x476a5c['params']['id'],'UserId':null}})[_0xa907('0x25')](handleEntityNotFound(_0x1516b6,null))[_0xa907('0x25')](function(_0x4f2f67){if(_0x4f2f67){_0x5b9271[_0xa907('0x2c')]=_0x4f2f67['get']({'plain':!![]});return db[_0xa907('0x6b')][_0xa907('0x5c')]({'where':{'id':_0x4f2f67['OpenchannelInteractionId']}});}return null;})[_0xa907('0x25')](handleEntityNotFound(_0x1516b6,null))[_0xa907('0x25')](function(_0x473108){if(_0x473108){_0x5b9271[_0xa907('0x6e')]=_0x473108[_0xa907('0x6a')]({'plain':!![]});interaction_log[_0xa907('0x2e')](_0xa907('0x7b'),_0x476a5c[_0xa907('0x70')]['id'],_0x476a5c['user'][_0xa907('0x3d')],_0x476a5c[_0xa907('0x70')][_0xa907('0x71')],_0x5b9271[_0xa907('0x6e')]['id'],_0x476a5c[_0xa907('0x5f')]?JSON[_0xa907('0x29')](_0x476a5c[_0xa907('0x5f')]):'null');return respondWithRpcPromise('RejectMessage',_0xa907('0x7c'),_0x5b9271);}return null;})['then'](function(_0x5f55e0){if(_0x5f55e0){_0x5f55e0[_0xa907('0x2c')]['interface']=util[_0xa907('0x65')]('SIP/%s',_0x476a5c[_0xa907('0x70')][_0xa907('0x3d')]);_0x5f55e0[_0xa907('0x2c')][_0xa907('0x77')]=_0x5b9271[_0xa907('0x77')];_0x5f55e0[_0xa907('0x2c')][_0xa907('0x78')]=_0xa907('0x37');respondWithRpcPromise(_0xa907('0x79'),'EventManager',{'event':_0xa907('0x7d'),'message':_0x5f55e0['message']},client9002);return _0x5b9271;}return null;})['then'](respondWithResult(_0x1516b6,null))['catch'](handleError(_0x1516b6,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 461bddd..e78be25 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 _0xdba3=['emit','hasOwnProperty','events','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xdba3,0x1de));var _0x3dba=function(_0x2b48d6,_0x4e4b2b){_0x2b48d6=_0x2b48d6-0x0;var _0x46cd9b=_0xdba3[_0x2b48d6];return _0x46cd9b;};'use strict';var EventEmitter=require(_0x3dba('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3dba('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3dba('0x2')](0x0);var events={'afterCreate':_0x3dba('0x3'),'afterUpdate':'update','afterDestroy':_0x3dba('0x4')};function emitEvent(_0xbbddd){return function(_0x1ac4e8,_0x3ac335,_0x2136f3){OpenchannelMessageEvents[_0x3dba('0x5')](_0xbbddd+':'+_0x1ac4e8['id'],_0x1ac4e8);OpenchannelMessageEvents['emit'](_0xbbddd,_0x1ac4e8);_0x2136f3(null);};}for(var e in events){if(events[_0x3dba('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x0cf6=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x155458,_0x178ff2){var _0x2ce9f9=function(_0x149953){while(--_0x149953){_0x155458['push'](_0x155458['shift']());}};_0x2ce9f9(++_0x178ff2);}(_0x0cf6,0x77));var _0x60cf=function(_0x4afb4a,_0x25d8aa){_0x4afb4a=_0x4afb4a-0x0;var _0x3991b9=_0x0cf6[_0x4afb4a];return _0x3991b9;};'use strict';var EventEmitter=require(_0x60cf('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x60cf('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x60cf('0x2')](0x0);var events={'afterCreate':_0x60cf('0x3'),'afterUpdate':_0x60cf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x462503){return function(_0x1cf899,_0x4a5193,_0x107f81){OpenchannelMessageEvents['emit'](_0x462503+':'+_0x1cf899['id'],_0x1cf899);OpenchannelMessageEvents[_0x60cf('0x5')](_0x462503,_0x1cf899);_0x107f81(null);};}for(var e in events){if(events[_0x60cf('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x60cf('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 522950f..41bb2f0 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 _0x92f0=['replyUri','Interaction','omit','POST','method','GET','body','afterCreate','threadId','finally','utf8mb4','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','OpenchannelInteraction','Interactions','Contact','info','format','Forwarding\x20message\x20%d\x20to\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92f0,0x10d));var _0x092f=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0x92f0[_0x158e3b];return _0x551a1d;};'use strict';var _=require('lodash');var util=require(_0x092f('0x0'));var logger=require(_0x092f('0x1'))('api');var moment=require(_0x092f('0x2'));var BPromise=require(_0x092f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x092f('0x4'));var config=require(_0x092f('0x5'));var attributes=require(_0x092f('0x6'));module[_0x092f('0x7')]=function(_0x2996b0,_0x2b6dcb){return _0x2996b0['define'](_0x092f('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x092f('0x9'),'fields':['body'],'type':_0x092f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x513796,_0x1e70e5,_0x517a36){var _0x2f073a=_0x2996b0[_0x092f('0xb')];var _0x32bc71=_0x513796['get']({'plain':!![]});if(_0x32bc71[_0x092f('0xc')][_0x092f('0xd')]()==='in'||_0x32bc71[_0x092f('0xc')][_0x092f('0xd')]()===_0x092f('0xe')&&!_0x32bc71['secret']&&!_[_0x092f('0xf')](_0x32bc71[_0x092f('0x10')])){_0x2f073a['OpenchannelInteraction'][_0x092f('0x11')]({'where':{'id':_0x32bc71[_0x092f('0x12')]}})[_0x092f('0x13')](function(_0x3df148){if(_0x3df148){_0x3df148[_0x092f('0x14')]({'lastMsgAt':_0x32bc71[_0x092f('0x15')],'lastMsgDirection':_0x32bc71[_0x092f('0xc')][_0x092f('0xd')]()});}})['catch'](function(_0x352456){console[_0x092f('0x16')](_0x352456);});}if(_0x32bc71[_0x092f('0xc')]===_0x092f('0xe')&&!_0x32bc71['secret']){var _0x530214;_0x2f073a[_0x092f('0x17')][_0x092f('0x18')]()[_0x092f('0x13')](function(_0x3dcdee){return _0x2f073a[_0x092f('0x19')]['find']({'where':{'id':_0x32bc71['OpenchannelAccountId']},'include':[{'model':_0x2f073a[_0x092f('0x1a')],'as':_0x092f('0x1b'),'where':{'id':_0x32bc71[_0x092f('0x12')]},'limit':0x1,'include':[{'model':_0x2f073a[_0x092f('0x17')],'as':_0x092f('0x1c'),'attributes':_['keys'](_0x3dcdee)}]}]});})[_0x092f('0x13')](function(_0x4a7114){_0x530214=_0x4a7114['get']({'plain':!![]});if(_0x530214&&_0x530214['replyUri']){logger[_0x092f('0x1d')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x092f('0x1e')](_0x092f('0x1f'),_0x32bc71['id'],_0x530214[_0x092f('0x20')]));if(_0x530214['Interactions']&&_0x530214[_0x092f('0x1b')]['length']){_0x32bc71[_0x092f('0x21')]=_[_0x092f('0x22')](_0x530214[_0x092f('0x1b')][0x0],_0x092f('0x1c'));_0x32bc71[_0x092f('0x1c')]=_0x530214[_0x092f('0x1b')][0x0][_0x092f('0x1c')];}var _0x1e70e5={'method':_0x092f('0x23'),'uri':encodeURI(_0x530214[_0x092f('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1e70e5[_0x092f('0x24')]){case _0x092f('0x25'):_0x1e70e5['qs']=_0x32bc71;break;case _0x092f('0x23'):_0x1e70e5[_0x092f('0x26')]=_0x32bc71;break;}return rp(_0x1e70e5)['then'](function(_0x2c0524){logger[_0x092f('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x092f('0x27'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x32bc71['id'],_0x530214[_0x092f('0x20')]));if(_0x2c0524[_0x092f('0x26')][_0x092f('0x28')]&&_0x2c0524[_0x092f('0x26')]['threadId']!=_0x32bc71[_0x092f('0x21')]['threadId']){return _0x2f073a[_0x092f('0x1a')][_0x092f('0x14')]({'threadId':_0x2c0524[_0x092f('0x26')][_0x092f('0x28')]},{'logging':!![],'where':{'id':_0x32bc71[_0x092f('0x21')]['id']}});}else{return;}})[_0x092f('0x13')](function(){return _0x513796['update']({'read':!![]});})['catch'](function(_0x4f74c8){logger[_0x092f('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x092f('0x27'),util['inspect'](_0x4f74c8,{'showHidden':![],'depth':null}));_0x517a36();});}else{_0x517a36();}})[_0x092f('0x29')](function(){_0x517a36();});}else{_0x517a36();}}},'charset':_0x092f('0x2a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf006=['CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','OpenchannelInteractionId'];(function(_0x203759,_0x3ea351){var _0x32866f=function(_0x1fe82a){while(--_0x1fe82a){_0x203759['push'](_0x203759['shift']());}};_0x32866f(++_0x3ea351);}(_0xf006,0x146));var _0x6f00=function(_0x584c47,_0x3f9cc8){_0x584c47=_0x584c47-0x0;var _0x25a81b=_0xf006[_0x584c47];return _0x25a81b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('OpenchannelMessage',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[{'name':_0x6f00('0x8'),'fields':[_0x6f00('0x9')],'type':_0x6f00('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x286d32,_0x3001c6,_0x44b63c){var _0x1e0720=_0x141e71[_0x6f00('0xb')];var _0x3e6a41=_0x286d32[_0x6f00('0xc')]({'plain':!![]});if(_0x3e6a41[_0x6f00('0xd')][_0x6f00('0xe')]()==='in'||_0x3e6a41['direction'][_0x6f00('0xe')]()===_0x6f00('0xf')&&!_0x3e6a41[_0x6f00('0x10')]&&!_[_0x6f00('0x11')](_0x3e6a41[_0x6f00('0x12')])){_0x1e0720['OpenchannelInteraction'][_0x6f00('0x13')]({'where':{'id':_0x3e6a41['OpenchannelInteractionId']}})[_0x6f00('0x14')](function(_0x5047f5){if(_0x5047f5){_0x5047f5[_0x6f00('0x15')]({'lastMsgAt':_0x3e6a41[_0x6f00('0x16')],'lastMsgDirection':_0x3e6a41[_0x6f00('0xd')][_0x6f00('0xe')]()});}})[_0x6f00('0x17')](function(_0x411203){console[_0x6f00('0x18')](_0x411203);});}if(_0x3e6a41[_0x6f00('0xd')]===_0x6f00('0xf')&&!_0x3e6a41['secret']){var _0x14b15d;_0x1e0720['CmContact']['describe']()[_0x6f00('0x14')](function(_0x6cf83f){return _0x1e0720[_0x6f00('0x19')][_0x6f00('0x1a')]({'where':{'id':_0x3e6a41[_0x6f00('0x1b')]},'include':[{'model':_0x1e0720[_0x6f00('0x1c')],'as':_0x6f00('0x1d'),'where':{'id':_0x3e6a41[_0x6f00('0x1e')]},'limit':0x1,'include':[{'model':_0x1e0720[_0x6f00('0x1f')],'as':_0x6f00('0x20'),'attributes':_[_0x6f00('0x21')](_0x6cf83f)}]}]});})[_0x6f00('0x14')](function(_0x4e11de){_0x14b15d=_0x4e11de['get']({'plain':!![]});if(_0x14b15d&&_0x14b15d['replyUri']){logger[_0x6f00('0x22')](_0x6f00('0x23'),_0x6f00('0x24'),util['format'](_0x6f00('0x25'),_0x3e6a41['id'],_0x14b15d[_0x6f00('0x26')]));if(_0x14b15d[_0x6f00('0x1d')]&&_0x14b15d[_0x6f00('0x1d')][_0x6f00('0x27')]){_0x3e6a41[_0x6f00('0x28')]=_[_0x6f00('0x29')](_0x14b15d[_0x6f00('0x1d')][0x0],'Contact');_0x3e6a41[_0x6f00('0x20')]=_0x14b15d[_0x6f00('0x1d')][0x0][_0x6f00('0x20')];}var _0x3001c6={'method':_0x6f00('0x2a'),'uri':encodeURI(_0x14b15d['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3001c6[_0x6f00('0x2b')]){case'GET':_0x3001c6['qs']=_0x3e6a41;break;case _0x6f00('0x2a'):_0x3001c6[_0x6f00('0x9')]=_0x3e6a41;break;}return rp(_0x3001c6)[_0x6f00('0x14')](function(_0x1f84a6){logger[_0x6f00('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x6f00('0x24'),util[_0x6f00('0x2c')](_0x6f00('0x2d'),_0x3e6a41['id'],_0x14b15d[_0x6f00('0x26')]));if(_0x1f84a6[_0x6f00('0x9')][_0x6f00('0x2e')]&&_0x1f84a6[_0x6f00('0x9')][_0x6f00('0x2e')]!=_0x3e6a41[_0x6f00('0x28')][_0x6f00('0x2e')]){return _0x1e0720[_0x6f00('0x1c')][_0x6f00('0x15')]({'threadId':_0x1f84a6[_0x6f00('0x9')][_0x6f00('0x2e')]},{'logging':!![],'where':{'id':_0x3e6a41['Interaction']['id']}});}else{return;}})['then'](function(){return _0x286d32['update']({'read':!![]});})['catch'](function(_0x522d4f){logger['error'](_0x6f00('0x23'),'afterCreate',util[_0x6f00('0x2f')](_0x522d4f,{'showHidden':![],'depth':null}));_0x44b63c();});}else{_0x44b63c();}})[_0x6f00('0x30')](function(){_0x44b63c();});}else{_0x44b63c();}}},'charset':_0x6f00('0x31'),'collate':_0x6f00('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9af8669..a744f8a 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 _0xf105=['client','http','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','create','body','options','raw','CreateOpenchannelMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1f4bf4,_0x4e0104){var _0x56859d=function(_0x245883){while(--_0x245883){_0x1f4bf4['push'](_0x1f4bf4['shift']());}};_0x56859d(++_0x4e0104);}(_0xf105,0x1b0));var _0x5f10=function(_0x3dee63,_0x4e96f2){_0x3dee63=_0x3dee63-0x0;var _0x5deed9=_0xf105[_0x3dee63];return _0x5deed9;};'use strict';var _=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var moment=require(_0x5f10('0x2'));var BPromise=require(_0x5f10('0x3'));var rs=require(_0x5f10('0x4'));var fs=require('fs');var Redis=require(_0x5f10('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f10('0x6'));var logger=require('../../config/logger')(_0x5f10('0x7'));var config=require(_0x5f10('0x8'));var jayson=require(_0x5f10('0x9'));var client=jayson[_0x5f10('0xa')][_0x5f10('0xb')]({'port':0x232a});config[_0x5f10('0xc')]=_[_0x5f10('0xd')](config[_0x5f10('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f10('0xe'))(new Redis(config[_0x5f10('0xc')]));require(_0x5f10('0xf'))[_0x5f10('0x10')](socket);function respondWithRpcPromise(_0x1b5463,_0x6dc96e,_0x540d92){return new BPromise(function(_0x1009b9,_0x3fd8eb){return client[_0x5f10('0x11')](_0x1b5463,_0x540d92)[_0x5f10('0x12')](function(_0x20fad6){logger[_0x5f10('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x6dc96e,_0x5f10('0x14'));logger[_0x5f10('0x15')](_0x5f10('0x16'),_0x6dc96e,_0x5f10('0x14'),JSON['stringify'](_0x20fad6));if(_0x20fad6['error']){if(_0x20fad6[_0x5f10('0x17')][_0x5f10('0x18')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6dc96e,_0x20fad6[_0x5f10('0x17')]['message']);return _0x3fd8eb(_0x20fad6['error']['message']);}logger[_0x5f10('0x17')](_0x5f10('0x19'),_0x6dc96e,_0x20fad6['error'][_0x5f10('0x1a')]);return _0x1009b9(_0x20fad6[_0x5f10('0x17')]['message']);}else{logger[_0x5f10('0x13')](_0x5f10('0x19'),_0x6dc96e,_0x5f10('0x14'));_0x1009b9(_0x20fad6[_0x5f10('0x1b')]['message']);}})['catch'](function(_0x40c679){logger[_0x5f10('0x17')](_0x5f10('0x19'),_0x6dc96e,_0x40c679);_0x3fd8eb(_0x40c679);});});}exports['CreateOpenchannelMessage']=function(_0x1a5ac4){var _0x1230e0=this;return new Promise(function(_0x4e7cf1,_0x3983f0){return db['OpenchannelMessage'][_0x5f10('0x1c')](_0x1a5ac4[_0x5f10('0x1d')],{'raw':_0x1a5ac4[_0x5f10('0x1e')]?_0x1a5ac4[_0x5f10('0x1e')][_0x5f10('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5407a6){logger[_0x5f10('0x13')](_0x5f10('0x20'),_0x1a5ac4);logger[_0x5f10('0x15')](_0x5f10('0x20'),_0x1a5ac4,JSON[_0x5f10('0x21')](_0x5407a6));_0x4e7cf1(_0x5407a6);})['catch'](function(_0x3aa6a3){logger[_0x5f10('0x17')](_0x5f10('0x20'),_0x3aa6a3[_0x5f10('0x1a')],_0x1a5ac4);_0x3983f0(_0x1230e0['error'](0x1f4,_0x3aa6a3['message']));});});}; \ No newline at end of file +var _0xfb11=['error','code','message','result','catch','OpenchannelMessage','create','options','CreateOpenchannelMessage','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4f60a8,_0x252bc6){var _0x4f011a=function(_0x2beefc){while(--_0x2beefc){_0x4f60a8['push'](_0x4f60a8['shift']());}};_0x4f011a(++_0x252bc6);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xfb11[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});config['redis']=_[_0x1fb1('0x9')](config[_0x1fb1('0xa')],{'host':_0x1fb1('0xb'),'port':0x18eb});var socket=require(_0x1fb1('0xc'))(new Redis(config[_0x1fb1('0xa')]));require(_0x1fb1('0xd'))[_0x1fb1('0xe')](socket);function respondWithRpcPromise(_0x416625,_0x377aae,_0x15d392){return new BPromise(function(_0x5bb066,_0x232036){return client['request'](_0x416625,_0x15d392)[_0x1fb1('0xf')](function(_0x58b66e){logger[_0x1fb1('0x10')](_0x1fb1('0x11'),_0x377aae,_0x1fb1('0x12'));logger[_0x1fb1('0x13')](_0x1fb1('0x14'),_0x377aae,_0x1fb1('0x12'),JSON['stringify'](_0x58b66e));if(_0x58b66e[_0x1fb1('0x15')]){if(_0x58b66e[_0x1fb1('0x15')][_0x1fb1('0x16')]===0x1f4){logger[_0x1fb1('0x15')](_0x1fb1('0x11'),_0x377aae,_0x58b66e[_0x1fb1('0x15')][_0x1fb1('0x17')]);return _0x232036(_0x58b66e[_0x1fb1('0x15')][_0x1fb1('0x17')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x377aae,_0x58b66e[_0x1fb1('0x15')][_0x1fb1('0x17')]);return _0x5bb066(_0x58b66e[_0x1fb1('0x15')]['message']);}else{logger[_0x1fb1('0x10')](_0x1fb1('0x11'),_0x377aae,_0x1fb1('0x12'));_0x5bb066(_0x58b66e[_0x1fb1('0x18')][_0x1fb1('0x17')]);}})[_0x1fb1('0x19')](function(_0x10df7b){logger[_0x1fb1('0x15')](_0x1fb1('0x11'),_0x377aae,_0x10df7b);_0x232036(_0x10df7b);});});}exports['CreateOpenchannelMessage']=function(_0xa6d7b8){var _0x55ba5b=this;return new Promise(function(_0x55e75e,_0xdf9c1b){return db[_0x1fb1('0x1a')][_0x1fb1('0x1b')](_0xa6d7b8['body'],{'raw':_0xa6d7b8[_0x1fb1('0x1c')]?_0xa6d7b8['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x31178c){logger[_0x1fb1('0x10')](_0x1fb1('0x1d'),_0xa6d7b8);logger[_0x1fb1('0x13')](_0x1fb1('0x1d'),_0xa6d7b8,JSON['stringify'](_0x31178c));_0x55e75e(_0x31178c);})[_0x1fb1('0x19')](function(_0x204c7c){logger[_0x1fb1('0x15')](_0x1fb1('0x1d'),_0x204c7c[_0x1fb1('0x17')],_0xa6d7b8);_0xdf9c1b(_0x55ba5b[_0x1fb1('0x15')](0x1f4,_0x204c7c[_0x1fb1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f63e7b0..0a1501f 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(_0x42e803,_0x5b3e49){var _0x3b73f2=function(_0x2cecc4){while(--_0x2cecc4){_0x42e803['push'](_0x42e803['shift']());}};_0x3b73f2(++_0x5b3e49);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0xcb91[_0x246115];return _0x385878;};'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 _0xcb91=['remove','update','emit','removeListener','register'];(function(_0x48b1d4,_0x38a59e){var _0x341707=function(_0x286cb2){while(--_0x286cb2){_0x48b1d4['push'](_0x48b1d4['shift']());}};_0x341707(++_0x38a59e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xcb91[_0x40be86];return _0xda3c3b;};'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 diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 045dbdd..8351787 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 _0x737d=['get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','multer','util','../../components/auth/service','../../config/environment'];(function(_0x3f1ee0,_0x30762f){var _0x41f93c=function(_0x7c397d){while(--_0x7c397d){_0x3f1ee0['push'](_0x3f1ee0['shift']());}};_0x41f93c(++_0x30762f);}(_0x737d,0xbc));var _0xd737=function(_0x28eb00,_0x3d546f){_0x28eb00=_0x28eb00-0x0;var _0x273831=_0x737d[_0x28eb00];return _0x273831;};'use strict';var multer=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xd737('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd737('0x3'));var controller=require('./openchannelQueue.controller');router[_0xd737('0x4')]('/',auth[_0xd737('0x5')](),controller[_0xd737('0x6')]);router[_0xd737('0x4')](_0xd737('0x7'),auth[_0xd737('0x5')](),controller[_0xd737('0x8')]);router[_0xd737('0x4')](_0xd737('0x9'),auth[_0xd737('0x5')](),controller['show']);router[_0xd737('0x4')](_0xd737('0xa'),auth['isAuthenticated'](),controller[_0xd737('0xb')]);router[_0xd737('0x4')]('/:id/teams',auth[_0xd737('0x5')](),controller[_0xd737('0xc')]);router['get'](_0xd737('0xd'),auth['isAuthenticated'](),controller[_0xd737('0xe')]);router[_0xd737('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd737('0xf')](_0xd737('0x10'),auth['isAuthenticated'](),controller[_0xd737('0x11')]);router[_0xd737('0xf')](_0xd737('0xd'),auth[_0xd737('0x5')](),controller[_0xd737('0x12')]);router[_0xd737('0x13')](_0xd737('0x9'),auth[_0xd737('0x5')](),controller['update']);router['delete'](_0xd737('0x9'),auth[_0xd737('0x5')](),controller[_0xd737('0x14')]);router[_0xd737('0x15')](_0xd737('0x10'),auth[_0xd737('0x5')](),controller[_0xd737('0x16')]);router[_0xd737('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xd737('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2e65=['getTeams','/:id/users','create','addTeams','post','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x161f02,_0x16d857){var _0x263ac6=function(_0x283208){while(--_0x283208){_0x161f02['push'](_0x161f02['shift']());}};_0x263ac6(++_0x16d857);}(_0x2e65,0x193));var _0x52e6=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x2e65[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var path=require(_0x52e6('0x2'));var timeout=require(_0x52e6('0x3'));var express=require(_0x52e6('0x4'));var router=express[_0x52e6('0x5')]();var auth=require(_0x52e6('0x6'));var interaction=require(_0x52e6('0x7'));var config=require('../../config/environment');var controller=require(_0x52e6('0x8'));router[_0x52e6('0x9')]('/',auth[_0x52e6('0xa')](),controller[_0x52e6('0xb')]);router[_0x52e6('0x9')](_0x52e6('0xc'),auth[_0x52e6('0xa')](),controller[_0x52e6('0xd')]);router[_0x52e6('0x9')](_0x52e6('0xe'),auth['isAuthenticated'](),controller[_0x52e6('0xf')]);router[_0x52e6('0x9')]('/:id/members',auth[_0x52e6('0xa')](),controller['getMembers']);router['get'](_0x52e6('0x10'),auth[_0x52e6('0xa')](),controller[_0x52e6('0x11')]);router[_0x52e6('0x9')](_0x52e6('0x12'),auth[_0x52e6('0xa')](),controller['getAgents']);router['post']('/',auth[_0x52e6('0xa')](),controller[_0x52e6('0x13')]);router['post'](_0x52e6('0x10'),auth[_0x52e6('0xa')](),controller[_0x52e6('0x14')]);router[_0x52e6('0x15')](_0x52e6('0x12'),auth[_0x52e6('0xa')](),controller[_0x52e6('0x16')]);router[_0x52e6('0x17')](_0x52e6('0xe'),auth[_0x52e6('0xa')](),controller[_0x52e6('0x18')]);router[_0x52e6('0x19')](_0x52e6('0xe'),auth[_0x52e6('0xa')](),controller['destroy']);router[_0x52e6('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x52e6('0x1a')]);router[_0x52e6('0x19')](_0x52e6('0x12'),auth['isAuthenticated'](),controller[_0x52e6('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5dadd91..98aac56 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 _0x9666=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x38c3c2,_0x44b430){var _0x4a1fed=function(_0x4f4b56){while(--_0x4f4b56){_0x38c3c2['push'](_0x38c3c2['shift']());}};_0x4a1fed(++_0x44b430);}(_0x9666,0x17a));var _0x6966=function(_0x13b880,_0x7bd56c){_0x13b880=_0x13b880-0x0;var _0x2bee77=_0x9666[_0x13b880];return _0x2bee77;};'use strict';var Sequelize=require(_0x6966('0x0'));module[_0x6966('0x1')]={'name':{'type':Sequelize[_0x6966('0x2')],'unique':_0x6966('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6966('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6966('0x5')](_0x6966('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x8af6=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x50f4f0,_0x663943){var _0xab0583=function(_0x5e2262){while(--_0x5e2262){_0x50f4f0['push'](_0x50f4f0['shift']());}};_0xab0583(++_0x663943);}(_0x8af6,0x76));var _0x68af=function(_0x558e3b,_0x39cca8){_0x558e3b=_0x558e3b-0x0;var _0x3d2a43=_0x8af6[_0x558e3b];return _0x3d2a43;};'use strict';var Sequelize=require(_0x68af('0x0'));module[_0x68af('0x1')]={'name':{'type':Sequelize[_0x68af('0x2')],'unique':_0x68af('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x68af('0x2')]},'timeout':{'type':Sequelize[_0x68af('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x68af('0x5')](_0x68af('0x6'),_0x68af('0x7'),_0x68af('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a2d50fe..6c3d013 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 _0x27ea=['team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','isArray','findOne','html-pdf','eml-format','rimraf','fast-json-patch','moment','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','get','OpenchannelQueues','sendStatus','error','name','send','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','nolimit','order','OpenchannelQueueId','User','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0x1bd5b3,_0x1d5c64){var _0x5a9c4d=function(_0x5742b4){while(--_0x5742b4){_0x1bd5b3['push'](_0x1bd5b3['shift']());}};_0x5a9c4d(++_0x1d5c64);}(_0x27ea,0xa6));var _0xa27e=function(_0x25d9a9,_0x483979){_0x25d9a9=_0x25d9a9-0x0;var _0x3d3b53=_0x27ea[_0x25d9a9];return _0x3d3b53;};'use strict';var pdf=require(_0xa27e('0x0'));var emlformat=require(_0xa27e('0x1'));var rimraf=require(_0xa27e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa27e('0x3'));var rp=require('request-promise');var moment=require(_0xa27e('0x4'));var BPromise=require(_0xa27e('0x5'));var Mustache=require(_0xa27e('0x6'));var util=require(_0xa27e('0x7'));var path=require('path');var sox=require(_0xa27e('0x8'));var csv=require(_0xa27e('0x9'));var ejs=require(_0xa27e('0xa'));var fs=require('fs');var _=require(_0xa27e('0xb'));var squel=require(_0xa27e('0xc'));var crypto=require(_0xa27e('0xd'));var jsforce=require(_0xa27e('0xe'));var deskjs=require(_0xa27e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa27e('0x10'));var Papa=require(_0xa27e('0x11'));var Redis=require(_0xa27e('0x12'));var authService=require(_0xa27e('0x13'));var qs=require(_0xa27e('0x14'));var as=require(_0xa27e('0x15'));var hardwareService=require(_0xa27e('0x16'));var logger=require(_0xa27e('0x17'))(_0xa27e('0x18'));var utils=require(_0xa27e('0x19'));var config=require(_0xa27e('0x1a'));var db=require(_0xa27e('0x1b'))['db'];config[_0xa27e('0x1c')]=_[_0xa27e('0x1d')](config[_0xa27e('0x1c')],{'host':_0xa27e('0x1e'),'port':0x18eb});var socket=require(_0xa27e('0x1f'))(new Redis(config[_0xa27e('0x1c')]));require('./openchannelQueue.socket')[_0xa27e('0x20')](socket);function respondWithStatusCode(_0x1fb046,_0x48c3c8){_0x48c3c8=_0x48c3c8||0xcc;return function(_0x529a23){if(_0x529a23){return _0x1fb046['sendStatus'](_0x48c3c8);}return _0x1fb046[_0xa27e('0x21')](_0x48c3c8)[_0xa27e('0x22')]();};}function respondWithResult(_0x57a249,_0x4cbff3){_0x4cbff3=_0x4cbff3||0xc8;return function(_0x13abc0){if(_0x13abc0){return _0x57a249['status'](_0x4cbff3)[_0xa27e('0x23')](_0x13abc0);}};}function respondWithFilteredResult(_0xc39678,_0x30240c){return function(_0xa7583f){if(_0xa7583f){var _0x5645cf=_0xa7583f[_0xa27e('0x24')],_0x29e688=_0x30240c[_0xa27e('0x25')],_0x78bffa=_0x30240c[_0xa27e('0x25')]+_0x30240c['limit'],_0xe9f7;if(_0x78bffa>=_0x5645cf){_0x78bffa=_0x5645cf;_0xe9f7=0xc8;}else{_0xe9f7=0xce;}_0xc39678[_0xa27e('0x21')](_0xe9f7);return _0xc39678[_0xa27e('0x26')](_0xa27e('0x27'),_0x29e688+'-'+_0x78bffa+'/'+_0x5645cf)[_0xa27e('0x23')](_0xa7583f);}return null;};}function patchUpdates(_0x27e7a3){return function(_0x1cb95b){try{jsonpatch[_0xa27e('0x28')](_0x1cb95b,_0x27e7a3,!![]);}catch(_0x526298){return BPromise[_0xa27e('0x29')](_0x526298);}return _0x1cb95b[_0xa27e('0x2a')]();};}function saveUpdates(_0x1052f1,_0x3808d8){return function(_0x74796a){if(_0x74796a){return _0x74796a['update'](_0x1052f1)['then'](function(_0x39a866){return _0x39a866;});}return null;};}function removeEntity(_0x160f3a,_0x5cbc7c){return function(_0x20ff21){if(_0x20ff21){return _0x20ff21[_0xa27e('0x2b')]()[_0xa27e('0x2c')](function(){var _0x4f642c=_0x20ff21[_0xa27e('0x2d')]({'plain':!![]});var _0x3936ea=_0xa27e('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x3936ea,'resourceId':_0x4f642c['id']}})['then'](function(){return _0x20ff21;});})['then'](function(){_0x160f3a[_0xa27e('0x21')](0xcc)[_0xa27e('0x22')]();});}};}function handleEntityNotFound(_0x45cb10,_0x261c28){return function(_0x50ee49){if(!_0x50ee49){_0x45cb10[_0xa27e('0x2f')](0x194);}return _0x50ee49;};}function handleError(_0x2b36ba,_0x1a63a2){_0x1a63a2=_0x1a63a2||0x1f4;return function(_0x44432){logger[_0xa27e('0x30')](_0x44432['stack']);if(_0x44432[_0xa27e('0x31')]){delete _0x44432[_0xa27e('0x31')];}_0x2b36ba['status'](_0x1a63a2)[_0xa27e('0x32')](_0x44432);};}exports['index']=function(_0x270e5d,_0x56ddfd){var _0x1399aa={},_0x4a6de7={},_0xe40a30={'count':0x0,'rows':[]};var _0x2e4c44=_['map'](db[_0xa27e('0x33')][_0xa27e('0x34')],function(_0x51e717){return{'name':_0x51e717[_0xa27e('0x35')],'type':_0x51e717[_0xa27e('0x36')][_0xa27e('0x37')]};});_0x4a6de7[_0xa27e('0x38')]=_[_0xa27e('0x39')](_0x2e4c44,_0xa27e('0x31'));_0x4a6de7['query']=_['keys'](_0x270e5d[_0xa27e('0x3a')]);_0x4a6de7[_0xa27e('0x3b')]=_[_0xa27e('0x3c')](_0x4a6de7[_0xa27e('0x38')],_0x4a6de7[_0xa27e('0x3a')]);_0x1399aa['attributes']=_[_0xa27e('0x3c')](_0x4a6de7['model'],qs[_0xa27e('0x3d')](_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x3d')]));_0x1399aa[_0xa27e('0x3e')]=_0x1399aa[_0xa27e('0x3e')][_0xa27e('0x3f')]?_0x1399aa[_0xa27e('0x3e')]:_0x4a6de7[_0xa27e('0x38')];if(!_0x270e5d['query'][_0xa27e('0x40')]('nolimit')){_0x1399aa[_0xa27e('0x41')]=qs[_0xa27e('0x41')](_0x270e5d[_0xa27e('0x3a')]['limit']);_0x1399aa[_0xa27e('0x25')]=qs[_0xa27e('0x25')](_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x25')]);}_0x1399aa['order']=qs[_0xa27e('0x42')](_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x42')]);_0x1399aa[_0xa27e('0x43')]=qs['filters'](_[_0xa27e('0x44')](_0x270e5d[_0xa27e('0x3a')],_0x4a6de7[_0xa27e('0x3b')]),_0x2e4c44);if(_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x45')]){_0x1399aa[_0xa27e('0x43')]=_[_0xa27e('0x46')](_0x1399aa['where'],{'$or':_[_0xa27e('0x39')](_0x2e4c44,function(_0x3d4445){if(_0x3d4445['type']!==_0xa27e('0x47')){var _0x3a3bba={};_0x3a3bba[_0x3d4445[_0xa27e('0x31')]]={'$like':'%'+_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x45')]+'%'};return _0x3a3bba;}})});}_0x1399aa=_['merge']({},_0x1399aa,_0x270e5d['options']);var _0x4b3a4f={'where':_0x1399aa['where']};return db['OpenchannelQueue'][_0xa27e('0x24')](_0x4b3a4f)['then'](function(_0x31688d){_0xe40a30['count']=_0x31688d;if(_0x270e5d[_0xa27e('0x3a')][_0xa27e('0x48')]){_0x1399aa['include']=[{'all':!![]}];}return db[_0xa27e('0x33')][_0xa27e('0x49')](_0x1399aa);})['then'](function(_0x3fb30a){_0xe40a30[_0xa27e('0x4a')]=_0x3fb30a;return _0xe40a30;})[_0xa27e('0x2c')](respondWithFilteredResult(_0x56ddfd,_0x1399aa))[_0xa27e('0x4b')](handleError(_0x56ddfd,null));};exports[_0xa27e('0x4c')]=function(_0x201e8c,_0x4eabbb){var _0x1fe492={'raw':!![],'where':{'id':_0x201e8c[_0xa27e('0x4d')]['id']}},_0x247624={};_0x247624[_0xa27e('0x38')]=_[_0xa27e('0x4e')](db[_0xa27e('0x33')][_0xa27e('0x34')]);_0x247624[_0xa27e('0x3a')]=_['keys'](_0x201e8c[_0xa27e('0x3a')]);_0x247624[_0xa27e('0x3b')]=_['intersection'](_0x247624[_0xa27e('0x38')],_0x247624[_0xa27e('0x3a')]);_0x1fe492['attributes']=_['intersection'](_0x247624[_0xa27e('0x38')],qs[_0xa27e('0x3d')](_0x201e8c[_0xa27e('0x3a')]['fields']));_0x1fe492['attributes']=_0x1fe492[_0xa27e('0x3e')]['length']?_0x1fe492['attributes']:_0x247624[_0xa27e('0x38')];if(_0x201e8c[_0xa27e('0x3a')]['includeAll']){_0x1fe492[_0xa27e('0x4f')]=[{'all':!![]}];}_0x1fe492=_['merge']({},_0x1fe492,_0x201e8c[_0xa27e('0x50')]);return db[_0xa27e('0x33')][_0xa27e('0x51')](_0x1fe492)[_0xa27e('0x2c')](handleEntityNotFound(_0x4eabbb,null))[_0xa27e('0x2c')](respondWithResult(_0x4eabbb,null))['catch'](handleError(_0x4eabbb,null));};exports[_0xa27e('0x52')]=function(_0x2870a8,_0x1c6186){return db[_0xa27e('0x33')][_0xa27e('0x52')](_0x2870a8[_0xa27e('0x53')],{})[_0xa27e('0x2c')](function(_0x4c7620){var _0x29636b=_0x2870a8['user'][_0xa27e('0x2d')]({'plain':!![]});if(!_0x29636b)throw new Error(_0xa27e('0x54'));if(_0x29636b[_0xa27e('0x55')]==='user'){var _0x5ea8d1=_0x4c7620[_0xa27e('0x2d')]({'plain':!![]});var _0x39aa4c=_0xa27e('0x2e');return db[_0xa27e('0x56')][_0xa27e('0x51')]({'where':{'name':_0x39aa4c,'userProfileId':_0x29636b[_0xa27e('0x57')]},'raw':!![]})[_0xa27e('0x2c')](function(_0x32bb45){if(_0x32bb45&&_0x32bb45[_0xa27e('0x58')]===0x0){return db[_0xa27e('0x59')][_0xa27e('0x52')]({'name':_0x5ea8d1[_0xa27e('0x31')],'resourceId':_0x5ea8d1['id'],'type':_0x32bb45[_0xa27e('0x31')],'sectionId':_0x32bb45['id']},{})['then'](function(){return _0x4c7620;});}else{return _0x4c7620;}})['catch'](function(_0x3f3c56){logger[_0xa27e('0x30')](_0xa27e('0x5a'),_0x3f3c56);throw _0x3f3c56;});}return _0x4c7620;})['then'](respondWithResult(_0x1c6186,0xc9))[_0xa27e('0x4b')](handleError(_0x1c6186,null));};exports[_0xa27e('0x5b')]=function(_0x4b0750,_0x151a31){if(_0x4b0750[_0xa27e('0x53')]['id']){delete _0x4b0750[_0xa27e('0x53')]['id'];}return db[_0xa27e('0x33')][_0xa27e('0x51')]({'where':{'id':_0x4b0750[_0xa27e('0x4d')]['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0x151a31,null))[_0xa27e('0x2c')](saveUpdates(_0x4b0750[_0xa27e('0x53')],null))[_0xa27e('0x2c')](respondWithResult(_0x151a31,null))[_0xa27e('0x4b')](handleError(_0x151a31,null));};exports['destroy']=function(_0x5701aa,_0xe5bfc5){return db[_0xa27e('0x33')][_0xa27e('0x51')]({'where':{'id':_0x5701aa[_0xa27e('0x4d')]['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0xe5bfc5,null))[_0xa27e('0x2c')](removeEntity(_0xe5bfc5,null))[_0xa27e('0x4b')](handleError(_0xe5bfc5,null));};exports[_0xa27e('0x5c')]=function(_0x1f5b61,_0x17bb68){return db[_0xa27e('0x33')][_0xa27e('0x5c')]()['then'](respondWithResult(_0x17bb68,null))[_0xa27e('0x4b')](handleError(_0x17bb68,null));};exports[_0xa27e('0x5d')]=function(_0xb078ce,_0x3742cd,_0x3f74ae){var _0x59676f={'raw':!![],'where':{}},_0x2e21af={},_0x1f9e2f;return db[_0xa27e('0x33')]['findOne']({'where':{'id':_0xb078ce[_0xa27e('0x4d')]['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0x3742cd,null))[_0xa27e('0x2c')](function(_0x63fcf0){if(_0x63fcf0){_0x1f9e2f=_0x63fcf0[_0xa27e('0x2d')]({'plain':!![]});_0x2e21af['model']=_[_0xa27e('0x4e')](db['UserOpenchannelQueue'][_0xa27e('0x34')]);_0x2e21af['query']=_[_0xa27e('0x4e')](_0xb078ce[_0xa27e('0x3a')]);_0x2e21af[_0xa27e('0x3b')]=_[_0xa27e('0x3c')](_0x2e21af[_0xa27e('0x38')],_0x2e21af['query']);_0x59676f[_0xa27e('0x3e')]=_['intersection'](_0x2e21af[_0xa27e('0x38')],qs[_0xa27e('0x3d')](_0xb078ce[_0xa27e('0x3a')]['fields']));_0x59676f[_0xa27e('0x3e')]=_0x59676f[_0xa27e('0x3e')]['length']?_0x59676f[_0xa27e('0x3e')]:_0x2e21af[_0xa27e('0x38')];if(!_0xb078ce[_0xa27e('0x3a')][_0xa27e('0x40')](_0xa27e('0x5e'))){_0x59676f[_0xa27e('0x41')]=qs[_0xa27e('0x41')](_0xb078ce[_0xa27e('0x3a')]['limit']);_0x59676f[_0xa27e('0x25')]=qs[_0xa27e('0x25')](_0xb078ce[_0xa27e('0x3a')][_0xa27e('0x25')]);}_0x59676f[_0xa27e('0x5f')]=qs[_0xa27e('0x42')](_0xb078ce[_0xa27e('0x3a')][_0xa27e('0x42')]);_0x59676f[_0xa27e('0x43')]=qs['filters'](_[_0xa27e('0x44')](_0xb078ce[_0xa27e('0x3a')],_0x2e21af[_0xa27e('0x3b')]));_0x59676f['where'][_0xa27e('0x60')]=_0x63fcf0['id'];if(_0xb078ce[_0xa27e('0x3a')]['filter']){_0x59676f[_0xa27e('0x43')]=_[_0xa27e('0x46')](_0x59676f['where'],{'$or':_[_0xa27e('0x39')](_0x59676f[_0xa27e('0x3e')],function(_0x15a8e3){var _0x1ed08b={};_0x1ed08b[_0x15a8e3]={'$like':'%'+_0xb078ce[_0xa27e('0x3a')][_0xa27e('0x45')]+'%'};return _0x1ed08b;})});}_0x59676f=_[_0xa27e('0x46')]({},_0x59676f,_0xb078ce[_0xa27e('0x50')]);return db['UserOpenchannelQueue'][_0xa27e('0x49')](_0x59676f);}})[_0xa27e('0x2c')](function(_0x292578){if(_0x292578){return db[_0xa27e('0x61')]['findAndCountAll']({'where':{'id':_[_0xa27e('0x39')](_0x292578,_0xa27e('0x62')),'role':_0xa27e('0x63')},'attributes':['id',_0xa27e('0x31'),_0xa27e('0x64'),'updatedAt',_0xa27e('0x65')]});}})[_0xa27e('0x2c')](function(_0x18336c){if(_0x18336c){return{'count':_0x18336c[_0xa27e('0x24')],'rows':_[_0xa27e('0x39')](_0x18336c[_0xa27e('0x4a')],function(_0x8dc2be){return{'membername':_0x8dc2be[_0xa27e('0x31')],'UserId':_0x8dc2be['id'],'queue_name':_0x1f9e2f[_0xa27e('0x31')],'OpenchannelQueueId':_0x1f9e2f['id'],'interface':util[_0xa27e('0x66')](_0xa27e('0x67'),_0xa27e('0x68'),_0x8dc2be[_0xa27e('0x31')]),'penalty':0x0,'paused':_0x8dc2be[_0xa27e('0x64')],'createdAt':_0x8dc2be[_0xa27e('0x65')],'updatedAt':_0x8dc2be[_0xa27e('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa27e('0x2c')](respondWithFilteredResult(_0x3742cd,_0x59676f))[_0xa27e('0x4b')](handleError(_0x3742cd,null));};exports['getTeams']=function(_0x475278,_0x59f640,_0x2e31b2){var _0x290692={};var _0x19105a={};var _0x3796e3;var _0x254969;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x475278[_0xa27e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x59f640,null))[_0xa27e('0x2c')](function(_0x419dea){if(_0x419dea){_0x3796e3=_0x419dea;_0x19105a[_0xa27e('0x38')]=_[_0xa27e('0x4e')](db[_0xa27e('0x6a')][_0xa27e('0x34')]);_0x19105a[_0xa27e('0x3a')]=_[_0xa27e('0x4e')](_0x475278[_0xa27e('0x3a')]);_0x19105a[_0xa27e('0x3b')]=_[_0xa27e('0x3c')](_0x19105a['model'],_0x19105a[_0xa27e('0x3a')]);_0x290692['attributes']=_[_0xa27e('0x3c')](_0x19105a[_0xa27e('0x38')],qs[_0xa27e('0x3d')](_0x475278['query'][_0xa27e('0x3d')]));_0x290692[_0xa27e('0x3e')]=_0x290692['attributes']['length']?_0x290692[_0xa27e('0x3e')]:_0x19105a[_0xa27e('0x38')];_0x290692[_0xa27e('0x5f')]=qs[_0xa27e('0x42')](_0x475278[_0xa27e('0x3a')][_0xa27e('0x42')]);_0x290692[_0xa27e('0x43')]=qs[_0xa27e('0x3b')](_['pick'](_0x475278[_0xa27e('0x3a')],_0x19105a[_0xa27e('0x3b')]));if(_0x475278['query'][_0xa27e('0x45')]){_0x290692[_0xa27e('0x43')]=_[_0xa27e('0x46')](_0x290692[_0xa27e('0x43')],{'$or':_['map'](_0x290692[_0xa27e('0x3e')],function(_0x5da29d){var _0x5156da={};_0x5156da[_0x5da29d]={'$like':'%'+_0x475278[_0xa27e('0x3a')]['filter']+'%'};return _0x5156da;})});}_0x290692=_[_0xa27e('0x46')]({},_0x290692,_0x475278[_0xa27e('0x50')]);return _0x3796e3[_0xa27e('0x6b')](_0x290692);}})[_0xa27e('0x2c')](function(_0x460ac6){if(_0x460ac6){_0x254969=_0x460ac6['length'];if(!_0x475278[_0xa27e('0x3a')][_0xa27e('0x40')](_0xa27e('0x5e'))){_0x290692['limit']=qs[_0xa27e('0x41')](_0x475278['query'][_0xa27e('0x41')]);_0x290692[_0xa27e('0x25')]=qs['offset'](_0x475278['query'][_0xa27e('0x25')]);}return _0x3796e3[_0xa27e('0x6b')](_0x290692);}})[_0xa27e('0x2c')](function(_0x516684){if(_0x516684){return _0x516684?{'count':_0x254969,'rows':_0x516684}:null;}})['then'](respondWithResult(_0x59f640,null))['catch'](handleError(_0x59f640,null));};exports[_0xa27e('0x6c')]=function(_0x55df37,_0x2e36db,_0x36d0ad){var _0x11ed2f=_0x55df37[_0xa27e('0x53')][_0xa27e('0x6d')];return db[_0xa27e('0x6a')][_0xa27e('0x49')]({'where':{'id':_0x11ed2f},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa27e('0x6e'),'attributes':['id','name',_0xa27e('0x6f'),_0xa27e('0x70'),'interface'],'raw':!![]}]})[_0xa27e('0x2c')](function(_0x43e00e){if(_0x43e00e){var _0x46edf2=_[_0xa27e('0x71')](_0x43e00e,function(_0x63b008){var _0x5d714d=_0x63b008[_0xa27e('0x2d')]({'plain':!![]});return _0x5d714d['Agents'];});return db['OpenchannelQueue'][_0xa27e('0x51')]({'where':{'id':_0x55df37['params']['id']}})[_0xa27e('0x2c')](function(_0x5b3c35){return db[_0xa27e('0x72')]['transaction'](function(_0x26e51d){return _0x5b3c35['addTeams'](_0x11ed2f,{'transaction':_0x26e51d})[_0xa27e('0x2c')](function(){return BPromise[_0xa27e('0x73')](_0x46edf2,function(_0x5dc314){return db['UserOpenchannelQueue'][_0xa27e('0x74')]({'where':{'UserId':_0x5dc314['id'],'OpenchannelQueueId':_0x55df37[_0xa27e('0x4d')]['id']},'transaction':_0x26e51d});});})[_0xa27e('0x2c')](function(){_0x46edf2['forEach'](function(_0xd2cef5){socket['emit'](_0xa27e('0x75'),{'UserId':_0xd2cef5['id'],'OpenchannelQueueId':_0x5b3c35['id']});});});});});}})[_0xa27e('0x2c')](respondWithStatusCode(_0x2e36db,null))[_0xa27e('0x4b')](handleError(_0x2e36db,null));};exports[_0xa27e('0x76')]=function(_0x21fc7e,_0x30a6b9,_0x58dec3){return db[_0xa27e('0x6a')][_0xa27e('0x49')]({'where':{'id':_0x21fc7e['query'][_0xa27e('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xa27e('0x61')],'as':_0xa27e('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x30a6b9,null))['then'](function(_0x8a229a){var _0x31347f=_[_0xa27e('0x39')](_0x8a229a,'id');var _0x13efce=[];var _0x2fa0fd=[];var _0x46149f=squel[_0xa27e('0x77')]();_0x46149f[_0xa27e('0x78')](_0xa27e('0x79'))['from'](_0xa27e('0x7a'),'tq')['join'](_0xa27e('0x7b'),'ut',_0xa27e('0x7c'))[_0xa27e('0x43')](_0xa27e('0x7d'),_0x21fc7e[_0xa27e('0x4d')]['id']);for(var _0x59831a=0x0;_0x59831a<_0x8a229a[_0xa27e('0x3f')];_0x59831a+=0x1){let _0x132d12=_0x8a229a[_0x59831a];for(var _0x1d6e0b=0x0;_0x1d6e0b<_0x132d12[_0xa27e('0x6e')]['length'];_0x1d6e0b+=0x1){let _0x233ce2=_0x132d12[_0xa27e('0x6e')][_0x1d6e0b];var _0x464a19=_0x46149f['clone']();_0x464a19[_0xa27e('0x43')]('ut.UserId\x20=\x20?',_0x233ce2['id']);_0x2fa0fd[_0xa27e('0x7e')](db[_0xa27e('0x72')][_0xa27e('0x3a')](_0x464a19[_0xa27e('0x7f')](),{'type':db['sequelize'][_0xa27e('0x80')][_0xa27e('0x81')]})['then'](function(_0x23b9d4){if(_0x23b9d4[_0xa27e('0x3f')]===0x1){return _0x233ce2['id'];}else{var _0x4e81ed=_[_0xa27e('0x82')](_['map'](_0x23b9d4,_0xa27e('0x83')),function(_0x283bd1){return _['includes'](_0x31347f,_0x283bd1);});if(_0x4e81ed){return _0x233ce2['id'];}}}));}}return BPromise[_0xa27e('0x84')](_0x2fa0fd)[_0xa27e('0x2c')](function(_0x3506c5){_0x13efce=_(_0x13efce)[_0xa27e('0x85')](_0x3506c5)[_0xa27e('0x86')]()[_0xa27e('0x87')]();return db[_0xa27e('0x33')][_0xa27e('0x51')]({'where':{'id':_0x21fc7e['params']['id']}})['then'](function(_0x321577){return db[_0xa27e('0x72')][_0xa27e('0x88')](function(_0x53113d){return _0x321577[_0xa27e('0x76')](_0x21fc7e['query'][_0xa27e('0x6d')],{'transaction':_0x53113d})['then'](function(){if(!_['isEmpty'](_0x13efce)){return _0x321577[_0xa27e('0x89')](_0x13efce,{'transaction':_0x53113d});}})[_0xa27e('0x2c')](function(){_0x13efce['forEach'](function(_0x253e66){socket[_0xa27e('0x8a')](_0xa27e('0x8b'),{'UserId':_0x253e66,'OpenchannelQueueId':_0x321577['id']});});});});});});})[_0xa27e('0x2c')](respondWithStatusCode(_0x30a6b9,null))['catch'](handleError(_0x30a6b9,null));};exports[_0xa27e('0x8c')]=function(_0x264ad0,_0x5b468a,_0x1dc112){return db[_0xa27e('0x33')][_0xa27e('0x51')]({'where':{'id':_0x264ad0[_0xa27e('0x4d')]['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0x5b468a,null))[_0xa27e('0x2c')](function(_0x563d4a){if(_0x563d4a){return _0x563d4a[_0xa27e('0x8c')](_0x264ad0['body'][_0xa27e('0x6d')],_['omit'](_0x264ad0[_0xa27e('0x53')],[_0xa27e('0x6d'),'id'])||{})[_0xa27e('0x8d')](function(_0x142fac){for(var _0x2d03a7=0x0;_0x2d03a7<_0x264ad0[_0xa27e('0x53')][_0xa27e('0x6d')]['length'];_0x2d03a7+=0x1){socket[_0xa27e('0x8a')](_0xa27e('0x75'),{'UserId':_0x264ad0[_0xa27e('0x53')][_0xa27e('0x6d')][_0x2d03a7],'OpenchannelQueueId':_0x264ad0['params']['id']});}return _0x142fac;});}})['then'](respondWithResult(_0x5b468a,null))[_0xa27e('0x4b')](handleError(_0x5b468a,null));};exports[_0xa27e('0x89')]=function(_0x5befa1,_0x2be594,_0x45843f){return db['OpenchannelQueue'][_0xa27e('0x51')]({'where':{'id':_0x5befa1[_0xa27e('0x4d')]['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0x2be594,null))[_0xa27e('0x2c')](function(_0x1a4622){if(_0x1a4622){return _0x1a4622['removeAgents'](_0x5befa1[_0xa27e('0x3a')][_0xa27e('0x6d')])['then'](function(){if(_[_0xa27e('0x8e')](_0x5befa1[_0xa27e('0x3a')][_0xa27e('0x6d')])){for(var _0x5c0f65=0x0;_0x5c0f65<_0x5befa1[_0xa27e('0x3a')][_0xa27e('0x6d')]['length'];_0x5c0f65+=0x1){socket[_0xa27e('0x8a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5befa1[_0xa27e('0x3a')][_0xa27e('0x6d')][_0x5c0f65]),'OpenchannelQueueId':Number(_0x5befa1[_0xa27e('0x4d')]['id'])});}}else{socket[_0xa27e('0x8a')](_0xa27e('0x8b'),{'UserId':Number(_0x5befa1['query'][_0xa27e('0x6d')]),'OpenchannelQueueId':Number(_0x5befa1[_0xa27e('0x4d')]['id'])});}});}})[_0xa27e('0x2c')](respondWithStatusCode(_0x2be594,null))[_0xa27e('0x4b')](handleError(_0x2be594,null));};exports['getAgents']=function(_0x610d27,_0x372961,_0x5c32fa){var _0x1b6bc4={};var _0x67f706={};var _0x15d8cd;var _0x1e3f4e;return db[_0xa27e('0x33')][_0xa27e('0x8f')]({'where':{'id':_0x610d27['params']['id']}})[_0xa27e('0x2c')](handleEntityNotFound(_0x372961,null))[_0xa27e('0x2c')](function(_0x3e2e48){if(_0x3e2e48){_0x15d8cd=_0x3e2e48;_0x67f706[_0xa27e('0x38')]=_[_0xa27e('0x4e')](db['User'][_0xa27e('0x34')]);_0x67f706[_0xa27e('0x3a')]=_[_0xa27e('0x4e')](_0x610d27[_0xa27e('0x3a')]);_0x67f706['filters']=_[_0xa27e('0x3c')](_0x67f706[_0xa27e('0x38')],_0x67f706['query']);_0x1b6bc4['attributes']=_[_0xa27e('0x3c')](_0x67f706[_0xa27e('0x38')],qs['fields'](_0x610d27[_0xa27e('0x3a')][_0xa27e('0x3d')]));_0x1b6bc4[_0xa27e('0x3e')]=_0x1b6bc4[_0xa27e('0x3e')][_0xa27e('0x3f')]?_0x1b6bc4[_0xa27e('0x3e')]:_0x67f706[_0xa27e('0x38')];_0x1b6bc4[_0xa27e('0x5f')]=qs[_0xa27e('0x42')](_0x610d27['query']['sort']);_0x1b6bc4['where']=qs[_0xa27e('0x3b')](_['pick'](_0x610d27[_0xa27e('0x3a')],_0x67f706[_0xa27e('0x3b')]));if(_0x610d27[_0xa27e('0x3a')][_0xa27e('0x45')]){_0x1b6bc4[_0xa27e('0x43')]=_[_0xa27e('0x46')](_0x1b6bc4[_0xa27e('0x43')],{'$or':_[_0xa27e('0x39')](_0x1b6bc4[_0xa27e('0x3e')],function(_0x26e38e){var _0x6e6a94={};_0x6e6a94[_0x26e38e]={'$like':'%'+_0x610d27[_0xa27e('0x3a')]['filter']+'%'};return _0x6e6a94;})});}_0x1b6bc4=_[_0xa27e('0x46')]({},_0x1b6bc4,_0x610d27['options']);return _0x15d8cd['getAgents'](_0x1b6bc4);}})['then'](function(_0x8ae821){if(_0x8ae821){_0x1e3f4e=_0x8ae821[_0xa27e('0x3f')];if(!_0x610d27[_0xa27e('0x3a')]['hasOwnProperty']('nolimit')){_0x1b6bc4[_0xa27e('0x41')]=qs['limit'](_0x610d27[_0xa27e('0x3a')]['limit']);_0x1b6bc4['offset']=qs[_0xa27e('0x25')](_0x610d27[_0xa27e('0x3a')]['offset']);}return _0x15d8cd['getAgents'](_0x1b6bc4);}})[_0xa27e('0x2c')](function(_0x2849a9){if(_0x2849a9){return _0x2849a9?{'count':_0x1e3f4e,'rows':_0x2849a9}:null;}})[_0xa27e('0x2c')](respondWithResult(_0x372961,null))['catch'](handleError(_0x372961,null));}; \ No newline at end of file +var _0x5357=['include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelQueues','UserProfileSection','userProfileId','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','limit','OpenchannelQueueId','findAll','UserId','agent','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','all','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','Content-Range','reject','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll'];(function(_0x187dc6,_0x510cc6){var _0x358fce=function(_0x1100d6){while(--_0x1100d6){_0x187dc6['push'](_0x187dc6['shift']());}};_0x358fce(++_0x510cc6);}(_0x5357,0xd4));var _0x7535=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5357[_0x513aa5];return _0x1a1a7c;};'use strict';var pdf=require(_0x7535('0x0'));var emlformat=require(_0x7535('0x1'));var rimraf=require(_0x7535('0x2'));var zipdir=require(_0x7535('0x3'));var jsonpatch=require(_0x7535('0x4'));var rp=require(_0x7535('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7535('0x6'));var util=require(_0x7535('0x7'));var path=require('path');var sox=require(_0x7535('0x8'));var csv=require(_0x7535('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7535('0xa'));var squel=require(_0x7535('0xb'));var crypto=require(_0x7535('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7535('0xd'));var toCsv=require(_0x7535('0x9'));var querystring=require('querystring');var Papa=require(_0x7535('0xe'));var Redis=require(_0x7535('0xf'));var authService=require(_0x7535('0x10'));var qs=require(_0x7535('0x11'));var as=require(_0x7535('0x12'));var hardwareService=require(_0x7535('0x13'));var logger=require(_0x7535('0x14'))(_0x7535('0x15'));var utils=require(_0x7535('0x16'));var config=require(_0x7535('0x17'));var db=require(_0x7535('0x18'))['db'];config[_0x7535('0x19')]=_[_0x7535('0x1a')](config['redis'],{'host':_0x7535('0x1b'),'port':0x18eb});var socket=require(_0x7535('0x1c'))(new Redis(config[_0x7535('0x19')]));require('./openchannelQueue.socket')[_0x7535('0x1d')](socket);function respondWithStatusCode(_0xd779ea,_0x5569c0){_0x5569c0=_0x5569c0||0xcc;return function(_0x28ad08){if(_0x28ad08){return _0xd779ea[_0x7535('0x1e')](_0x5569c0);}return _0xd779ea[_0x7535('0x1f')](_0x5569c0)[_0x7535('0x20')]();};}function respondWithResult(_0x5cfd1c,_0x3a2699){_0x3a2699=_0x3a2699||0xc8;return function(_0x3c2fa9){if(_0x3c2fa9){return _0x5cfd1c[_0x7535('0x1f')](_0x3a2699)[_0x7535('0x21')](_0x3c2fa9);}};}function respondWithFilteredResult(_0x7c6d08,_0x9065da){return function(_0x48141e){if(_0x48141e){var _0x2d41b5=_0x48141e[_0x7535('0x22')],_0x15ac8f=_0x9065da[_0x7535('0x23')],_0x18a1e4=_0x9065da['offset']+_0x9065da['limit'],_0x4c023d;if(_0x18a1e4>=_0x2d41b5){_0x18a1e4=_0x2d41b5;_0x4c023d=0xc8;}else{_0x4c023d=0xce;}_0x7c6d08[_0x7535('0x1f')](_0x4c023d);return _0x7c6d08['set'](_0x7535('0x24'),_0x15ac8f+'-'+_0x18a1e4+'/'+_0x2d41b5)[_0x7535('0x21')](_0x48141e);}return null;};}function patchUpdates(_0x2a19fe){return function(_0x10d137){try{jsonpatch['apply'](_0x10d137,_0x2a19fe,!![]);}catch(_0x10c398){return BPromise[_0x7535('0x25')](_0x10c398);}return _0x10d137['save']();};}function saveUpdates(_0x2b1c90,_0x5ac38f){return function(_0x31ac9c){if(_0x31ac9c){return _0x31ac9c[_0x7535('0x26')](_0x2b1c90)[_0x7535('0x27')](function(_0x44fe4a){return _0x44fe4a;});}return null;};}function removeEntity(_0x4715c9,_0x500746){return function(_0x44c67c){if(_0x44c67c){return _0x44c67c[_0x7535('0x28')]()['then'](function(){var _0x41ec6f=_0x44c67c['get']({'plain':!![]});var _0x39a7ed='OpenchannelQueues';return db[_0x7535('0x29')][_0x7535('0x28')]({'where':{'type':_0x39a7ed,'resourceId':_0x41ec6f['id']}})['then'](function(){return _0x44c67c;});})[_0x7535('0x27')](function(){_0x4715c9['status'](0xcc)[_0x7535('0x20')]();});}};}function handleEntityNotFound(_0x34d0aa,_0x4042ec){return function(_0x568630){if(!_0x568630){_0x34d0aa[_0x7535('0x1e')](0x194);}return _0x568630;};}function handleError(_0x58078a,_0x767089){_0x767089=_0x767089||0x1f4;return function(_0x3fd546){logger[_0x7535('0x2a')](_0x3fd546[_0x7535('0x2b')]);if(_0x3fd546[_0x7535('0x2c')]){delete _0x3fd546[_0x7535('0x2c')];}_0x58078a[_0x7535('0x1f')](_0x767089)[_0x7535('0x2d')](_0x3fd546);};}exports[_0x7535('0x2e')]=function(_0x44d324,_0x349e94){var _0x1afa7b={},_0x2a9247={},_0x5b92c8={'count':0x0,'rows':[]};var _0x1dce66=_[_0x7535('0x2f')](db[_0x7535('0x30')][_0x7535('0x31')],function(_0x33c66f){return{'name':_0x33c66f[_0x7535('0x32')],'type':_0x33c66f[_0x7535('0x33')]['key']};});_0x2a9247[_0x7535('0x34')]=_['map'](_0x1dce66,'name');_0x2a9247[_0x7535('0x35')]=_[_0x7535('0x36')](_0x44d324['query']);_0x2a9247['filters']=_['intersection'](_0x2a9247[_0x7535('0x34')],_0x2a9247[_0x7535('0x35')]);_0x1afa7b[_0x7535('0x37')]=_[_0x7535('0x38')](_0x2a9247['model'],qs[_0x7535('0x39')](_0x44d324['query']['fields']));_0x1afa7b[_0x7535('0x37')]=_0x1afa7b[_0x7535('0x37')]['length']?_0x1afa7b[_0x7535('0x37')]:_0x2a9247[_0x7535('0x34')];if(!_0x44d324[_0x7535('0x35')][_0x7535('0x3a')]('nolimit')){_0x1afa7b['limit']=qs['limit'](_0x44d324['query']['limit']);_0x1afa7b['offset']=qs[_0x7535('0x23')](_0x44d324[_0x7535('0x35')]['offset']);}_0x1afa7b[_0x7535('0x3b')]=qs[_0x7535('0x3c')](_0x44d324[_0x7535('0x35')]['sort']);_0x1afa7b['where']=qs[_0x7535('0x3d')](_[_0x7535('0x3e')](_0x44d324['query'],_0x2a9247['filters']),_0x1dce66);if(_0x44d324['query'][_0x7535('0x3f')]){_0x1afa7b[_0x7535('0x40')]=_[_0x7535('0x41')](_0x1afa7b[_0x7535('0x40')],{'$or':_[_0x7535('0x2f')](_0x1dce66,function(_0x4eca71){if(_0x4eca71['type']!=='VIRTUAL'){var _0xd569ef={};_0xd569ef[_0x4eca71['name']]={'$like':'%'+_0x44d324['query']['filter']+'%'};return _0xd569ef;}})});}_0x1afa7b=_[_0x7535('0x41')]({},_0x1afa7b,_0x44d324[_0x7535('0x42')]);var _0x212e48={'where':_0x1afa7b['where']};return db[_0x7535('0x30')][_0x7535('0x22')](_0x212e48)[_0x7535('0x27')](function(_0x3fd0f6){_0x5b92c8['count']=_0x3fd0f6;if(_0x44d324[_0x7535('0x35')][_0x7535('0x43')]){_0x1afa7b[_0x7535('0x44')]=[{'all':!![]}];}return db[_0x7535('0x30')]['findAll'](_0x1afa7b);})[_0x7535('0x27')](function(_0x45d89b){_0x5b92c8[_0x7535('0x45')]=_0x45d89b;return _0x5b92c8;})[_0x7535('0x27')](respondWithFilteredResult(_0x349e94,_0x1afa7b))[_0x7535('0x46')](handleError(_0x349e94,null));};exports[_0x7535('0x47')]=function(_0x32b759,_0x238b93){var _0x3c4432={'raw':!![],'where':{'id':_0x32b759[_0x7535('0x48')]['id']}},_0x507521={};_0x507521['model']=_[_0x7535('0x36')](db[_0x7535('0x30')][_0x7535('0x31')]);_0x507521[_0x7535('0x35')]=_[_0x7535('0x36')](_0x32b759[_0x7535('0x35')]);_0x507521[_0x7535('0x3d')]=_[_0x7535('0x38')](_0x507521[_0x7535('0x34')],_0x507521[_0x7535('0x35')]);_0x3c4432[_0x7535('0x37')]=_[_0x7535('0x38')](_0x507521[_0x7535('0x34')],qs['fields'](_0x32b759[_0x7535('0x35')][_0x7535('0x39')]));_0x3c4432[_0x7535('0x37')]=_0x3c4432['attributes'][_0x7535('0x49')]?_0x3c4432['attributes']:_0x507521[_0x7535('0x34')];if(_0x32b759['query'][_0x7535('0x43')]){_0x3c4432[_0x7535('0x44')]=[{'all':!![]}];}_0x3c4432=_[_0x7535('0x41')]({},_0x3c4432,_0x32b759[_0x7535('0x42')]);return db[_0x7535('0x30')][_0x7535('0x4a')](_0x3c4432)['then'](handleEntityNotFound(_0x238b93,null))['then'](respondWithResult(_0x238b93,null))[_0x7535('0x46')](handleError(_0x238b93,null));};exports[_0x7535('0x4b')]=function(_0x104cf0,_0x2dcd1a){return db['OpenchannelQueue'][_0x7535('0x4b')](_0x104cf0[_0x7535('0x4c')],{})[_0x7535('0x27')](function(_0x42fd41){var _0x5652de=_0x104cf0[_0x7535('0x4d')]['get']({'plain':!![]});if(!_0x5652de)throw new Error(_0x7535('0x4e'));if(_0x5652de[_0x7535('0x4f')]===_0x7535('0x4d')){var _0x5ef563=_0x42fd41[_0x7535('0x50')]({'plain':!![]});var _0x2cfd5b=_0x7535('0x51');return db[_0x7535('0x52')][_0x7535('0x4a')]({'where':{'name':_0x2cfd5b,'userProfileId':_0x5652de[_0x7535('0x53')]},'raw':!![]})[_0x7535('0x27')](function(_0x124728){if(_0x124728&&_0x124728['autoAssociation']===0x0){return db[_0x7535('0x29')][_0x7535('0x4b')]({'name':_0x5ef563['name'],'resourceId':_0x5ef563['id'],'type':_0x124728[_0x7535('0x2c')],'sectionId':_0x124728['id']},{})[_0x7535('0x27')](function(){return _0x42fd41;});}else{return _0x42fd41;}})[_0x7535('0x46')](function(_0x30aac8){logger[_0x7535('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30aac8);throw _0x30aac8;});}return _0x42fd41;})[_0x7535('0x27')](respondWithResult(_0x2dcd1a,0xc9))[_0x7535('0x46')](handleError(_0x2dcd1a,null));};exports['update']=function(_0xcab48b,_0x26f36c){if(_0xcab48b[_0x7535('0x4c')]['id']){delete _0xcab48b[_0x7535('0x4c')]['id'];}return db[_0x7535('0x30')][_0x7535('0x4a')]({'where':{'id':_0xcab48b[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0x26f36c,null))['then'](saveUpdates(_0xcab48b[_0x7535('0x4c')],null))['then'](respondWithResult(_0x26f36c,null))[_0x7535('0x46')](handleError(_0x26f36c,null));};exports['destroy']=function(_0x3bb739,_0x1f37f7){return db[_0x7535('0x30')][_0x7535('0x4a')]({'where':{'id':_0x3bb739[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0x1f37f7,null))[_0x7535('0x27')](removeEntity(_0x1f37f7,null))['catch'](handleError(_0x1f37f7,null));};exports[_0x7535('0x54')]=function(_0x982681,_0x431e5f){return db[_0x7535('0x30')]['describe']()[_0x7535('0x27')](respondWithResult(_0x431e5f,null))['catch'](handleError(_0x431e5f,null));};exports[_0x7535('0x55')]=function(_0x51f3e5,_0xe7ddec,_0x555057){var _0x2f8c32={'raw':!![],'where':{}},_0x36e49a={},_0x5e53a0;return db['OpenchannelQueue'][_0x7535('0x56')]({'where':{'id':_0x51f3e5[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0xe7ddec,null))[_0x7535('0x27')](function(_0x23e11e){if(_0x23e11e){_0x5e53a0=_0x23e11e[_0x7535('0x50')]({'plain':!![]});_0x36e49a['model']=_[_0x7535('0x36')](db[_0x7535('0x57')]['rawAttributes']);_0x36e49a[_0x7535('0x35')]=_['keys'](_0x51f3e5[_0x7535('0x35')]);_0x36e49a[_0x7535('0x3d')]=_[_0x7535('0x38')](_0x36e49a[_0x7535('0x34')],_0x36e49a['query']);_0x2f8c32[_0x7535('0x37')]=_[_0x7535('0x38')](_0x36e49a[_0x7535('0x34')],qs['fields'](_0x51f3e5[_0x7535('0x35')]['fields']));_0x2f8c32[_0x7535('0x37')]=_0x2f8c32[_0x7535('0x37')][_0x7535('0x49')]?_0x2f8c32[_0x7535('0x37')]:_0x36e49a[_0x7535('0x34')];if(!_0x51f3e5['query'][_0x7535('0x3a')](_0x7535('0x58'))){_0x2f8c32[_0x7535('0x59')]=qs[_0x7535('0x59')](_0x51f3e5[_0x7535('0x35')][_0x7535('0x59')]);_0x2f8c32[_0x7535('0x23')]=qs['offset'](_0x51f3e5[_0x7535('0x35')][_0x7535('0x23')]);}_0x2f8c32[_0x7535('0x3b')]=qs['sort'](_0x51f3e5[_0x7535('0x35')][_0x7535('0x3c')]);_0x2f8c32[_0x7535('0x40')]=qs[_0x7535('0x3d')](_['pick'](_0x51f3e5[_0x7535('0x35')],_0x36e49a[_0x7535('0x3d')]));_0x2f8c32[_0x7535('0x40')][_0x7535('0x5a')]=_0x23e11e['id'];if(_0x51f3e5['query'][_0x7535('0x3f')]){_0x2f8c32[_0x7535('0x40')]=_[_0x7535('0x41')](_0x2f8c32['where'],{'$or':_[_0x7535('0x2f')](_0x2f8c32['attributes'],function(_0x1c28a5){var _0xeb94f7={};_0xeb94f7[_0x1c28a5]={'$like':'%'+_0x51f3e5['query']['filter']+'%'};return _0xeb94f7;})});}_0x2f8c32=_[_0x7535('0x41')]({},_0x2f8c32,_0x51f3e5[_0x7535('0x42')]);return db[_0x7535('0x57')][_0x7535('0x5b')](_0x2f8c32);}})[_0x7535('0x27')](function(_0x326e79){if(_0x326e79){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x326e79,_0x7535('0x5c')),'role':_0x7535('0x5d')},'attributes':['id','name','openchannelPause',_0x7535('0x5e'),'createdAt']});}})['then'](function(_0x257d63){if(_0x257d63){return{'count':_0x257d63[_0x7535('0x22')],'rows':_[_0x7535('0x2f')](_0x257d63[_0x7535('0x45')],function(_0x582933){return{'membername':_0x582933[_0x7535('0x2c')],'UserId':_0x582933['id'],'queue_name':_0x5e53a0[_0x7535('0x2c')],'OpenchannelQueueId':_0x5e53a0['id'],'interface':util[_0x7535('0x5f')](_0x7535('0x60'),'SIP',_0x582933['name']),'penalty':0x0,'paused':_0x582933['openchannelPause'],'createdAt':_0x582933[_0x7535('0x61')],'updatedAt':_0x582933[_0x7535('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7535('0x27')](respondWithFilteredResult(_0xe7ddec,_0x2f8c32))[_0x7535('0x46')](handleError(_0xe7ddec,null));};exports[_0x7535('0x62')]=function(_0x446cfa,_0x3e2309,_0x58eb77){var _0x308721={};var _0x3bd759={};var _0x15e5fb;var _0x3c0155;return db[_0x7535('0x30')][_0x7535('0x56')]({'where':{'id':_0x446cfa[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0x3e2309,null))[_0x7535('0x27')](function(_0xf6c210){if(_0xf6c210){_0x15e5fb=_0xf6c210;_0x3bd759[_0x7535('0x34')]=_[_0x7535('0x36')](db[_0x7535('0x63')][_0x7535('0x31')]);_0x3bd759[_0x7535('0x35')]=_[_0x7535('0x36')](_0x446cfa[_0x7535('0x35')]);_0x3bd759['filters']=_[_0x7535('0x38')](_0x3bd759[_0x7535('0x34')],_0x3bd759['query']);_0x308721['attributes']=_[_0x7535('0x38')](_0x3bd759[_0x7535('0x34')],qs[_0x7535('0x39')](_0x446cfa[_0x7535('0x35')][_0x7535('0x39')]));_0x308721[_0x7535('0x37')]=_0x308721[_0x7535('0x37')][_0x7535('0x49')]?_0x308721[_0x7535('0x37')]:_0x3bd759[_0x7535('0x34')];_0x308721[_0x7535('0x3b')]=qs[_0x7535('0x3c')](_0x446cfa[_0x7535('0x35')][_0x7535('0x3c')]);_0x308721[_0x7535('0x40')]=qs[_0x7535('0x3d')](_[_0x7535('0x3e')](_0x446cfa[_0x7535('0x35')],_0x3bd759['filters']));if(_0x446cfa[_0x7535('0x35')][_0x7535('0x3f')]){_0x308721['where']=_[_0x7535('0x41')](_0x308721[_0x7535('0x40')],{'$or':_[_0x7535('0x2f')](_0x308721['attributes'],function(_0x5a94c0){var _0x19815c={};_0x19815c[_0x5a94c0]={'$like':'%'+_0x446cfa['query'][_0x7535('0x3f')]+'%'};return _0x19815c;})});}_0x308721=_[_0x7535('0x41')]({},_0x308721,_0x446cfa[_0x7535('0x42')]);return _0x15e5fb[_0x7535('0x62')](_0x308721);}})[_0x7535('0x27')](function(_0x1b3f32){if(_0x1b3f32){_0x3c0155=_0x1b3f32[_0x7535('0x49')];if(!_0x446cfa[_0x7535('0x35')]['hasOwnProperty'](_0x7535('0x58'))){_0x308721[_0x7535('0x59')]=qs[_0x7535('0x59')](_0x446cfa[_0x7535('0x35')][_0x7535('0x59')]);_0x308721[_0x7535('0x23')]=qs[_0x7535('0x23')](_0x446cfa[_0x7535('0x35')]['offset']);}return _0x15e5fb['getTeams'](_0x308721);}})[_0x7535('0x27')](function(_0x1777b4){if(_0x1777b4){return _0x1777b4?{'count':_0x3c0155,'rows':_0x1777b4}:null;}})[_0x7535('0x27')](respondWithResult(_0x3e2309,null))[_0x7535('0x46')](handleError(_0x3e2309,null));};exports[_0x7535('0x64')]=function(_0x3f68cd,_0x4678c1,_0x1c9c9d){var _0x2fed4c=_0x3f68cd[_0x7535('0x4c')][_0x7535('0x65')];return db[_0x7535('0x63')][_0x7535('0x5b')]({'where':{'id':_0x2fed4c},'attributes':['id'],'include':[{'model':db[_0x7535('0x66')],'as':_0x7535('0x67'),'attributes':['id',_0x7535('0x2c'),'online',_0x7535('0x68'),_0x7535('0x69')],'raw':!![]}]})[_0x7535('0x27')](function(_0x362746){if(_0x362746){var _0x39cb25=_[_0x7535('0x6a')](_0x362746,function(_0x4ac5f4){var _0x43e582=_0x4ac5f4[_0x7535('0x50')]({'plain':!![]});return _0x43e582[_0x7535('0x67')];});return db[_0x7535('0x30')]['find']({'where':{'id':_0x3f68cd[_0x7535('0x48')]['id']}})['then'](function(_0x324ded){return db['sequelize']['transaction'](function(_0x317009){return _0x324ded[_0x7535('0x64')](_0x2fed4c,{'transaction':_0x317009})[_0x7535('0x27')](function(){return BPromise[_0x7535('0x6b')](_0x39cb25,function(_0x1a7ff6){return db[_0x7535('0x57')][_0x7535('0x6c')]({'where':{'UserId':_0x1a7ff6['id'],'OpenchannelQueueId':_0x3f68cd[_0x7535('0x48')]['id']},'transaction':_0x317009});});})[_0x7535('0x27')](function(){_0x39cb25[_0x7535('0x6d')](function(_0x2bc68a){socket[_0x7535('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x2bc68a['id'],'OpenchannelQueueId':_0x324ded['id']});});});});});}})[_0x7535('0x27')](respondWithStatusCode(_0x4678c1,null))[_0x7535('0x46')](handleError(_0x4678c1,null));};exports[_0x7535('0x6f')]=function(_0x47f14b,_0x2eec8d,_0x4b6ab1){return db[_0x7535('0x63')][_0x7535('0x5b')]({'where':{'id':_0x47f14b['query'][_0x7535('0x65')]},'attributes':['id'],'include':[{'model':db[_0x7535('0x66')],'as':_0x7535('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2eec8d,null))[_0x7535('0x27')](function(_0x7dab8c){var _0x388153=_[_0x7535('0x2f')](_0x7dab8c,'id');var _0x35df50=[];var _0x5880cb=[];var _0x341390=squel[_0x7535('0x70')]();_0x341390[_0x7535('0x71')](_0x7535('0x72'))[_0x7535('0x73')]('team_has_openchannel_queues','tq')['join'](_0x7535('0x74'),'ut',_0x7535('0x75'))[_0x7535('0x40')](_0x7535('0x76'),_0x47f14b['params']['id']);for(var _0x58085c=0x0;_0x58085c<_0x7dab8c[_0x7535('0x49')];_0x58085c+=0x1){let _0x56b9b3=_0x7dab8c[_0x58085c];for(var _0xd94726=0x0;_0xd94726<_0x56b9b3['Agents'][_0x7535('0x49')];_0xd94726+=0x1){let _0x2f364e=_0x56b9b3[_0x7535('0x67')][_0xd94726];var _0x47502c=_0x341390[_0x7535('0x77')]();_0x47502c[_0x7535('0x40')](_0x7535('0x78'),_0x2f364e['id']);_0x5880cb[_0x7535('0x79')](db[_0x7535('0x7a')][_0x7535('0x35')](_0x47502c[_0x7535('0x7b')](),{'type':db[_0x7535('0x7a')][_0x7535('0x7c')]['SELECT']})[_0x7535('0x27')](function(_0x8c29a1){if(_0x8c29a1[_0x7535('0x49')]===0x1){return _0x2f364e['id'];}else{var _0xd8e6f1=_[_0x7535('0x7d')](_['map'](_0x8c29a1,'TeamId'),function(_0x4e11ec){return _[_0x7535('0x7e')](_0x388153,_0x4e11ec);});if(_0xd8e6f1){return _0x2f364e['id'];}}}));}}return BPromise[_0x7535('0x7f')](_0x5880cb)['then'](function(_0x58a383){_0x35df50=_(_0x35df50)['union'](_0x58a383)[_0x7535('0x80')]()[_0x7535('0x81')]();return db[_0x7535('0x30')][_0x7535('0x4a')]({'where':{'id':_0x47f14b[_0x7535('0x48')]['id']}})[_0x7535('0x27')](function(_0x10ce8e){return db[_0x7535('0x7a')][_0x7535('0x82')](function(_0x153959){return _0x10ce8e['removeTeams'](_0x47f14b[_0x7535('0x35')][_0x7535('0x65')],{'transaction':_0x153959})[_0x7535('0x27')](function(){if(!_[_0x7535('0x83')](_0x35df50)){return _0x10ce8e[_0x7535('0x84')](_0x35df50,{'transaction':_0x153959});}})[_0x7535('0x27')](function(){_0x35df50[_0x7535('0x6d')](function(_0x309c6b){socket['emit'](_0x7535('0x85'),{'UserId':_0x309c6b,'OpenchannelQueueId':_0x10ce8e['id']});});});});});});})['then'](respondWithStatusCode(_0x2eec8d,null))[_0x7535('0x46')](handleError(_0x2eec8d,null));};exports['addAgents']=function(_0x468eb8,_0x59de0d,_0x5017d0){return db['OpenchannelQueue'][_0x7535('0x4a')]({'where':{'id':_0x468eb8['params']['id']}})['then'](handleEntityNotFound(_0x59de0d,null))[_0x7535('0x27')](function(_0x37ead6){if(_0x37ead6){return _0x37ead6[_0x7535('0x86')](_0x468eb8['body']['ids'],_[_0x7535('0x87')](_0x468eb8[_0x7535('0x4c')],[_0x7535('0x65'),'id'])||{})[_0x7535('0x88')](function(_0x55c51c){for(var _0x5f53bb=0x0;_0x5f53bb<_0x468eb8[_0x7535('0x4c')][_0x7535('0x65')][_0x7535('0x49')];_0x5f53bb+=0x1){socket[_0x7535('0x6e')](_0x7535('0x89'),{'UserId':_0x468eb8['body'][_0x7535('0x65')][_0x5f53bb],'OpenchannelQueueId':_0x468eb8[_0x7535('0x48')]['id']});}return _0x55c51c;});}})['then'](respondWithResult(_0x59de0d,null))[_0x7535('0x46')](handleError(_0x59de0d,null));};exports[_0x7535('0x84')]=function(_0x29b77f,_0x4d252f,_0x106399){return db['OpenchannelQueue']['find']({'where':{'id':_0x29b77f[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0x4d252f,null))[_0x7535('0x27')](function(_0x66bd02){if(_0x66bd02){return _0x66bd02[_0x7535('0x84')](_0x29b77f[_0x7535('0x35')][_0x7535('0x65')])['then'](function(){if(_[_0x7535('0x8a')](_0x29b77f[_0x7535('0x35')]['ids'])){for(var _0x12f5d2=0x0;_0x12f5d2<_0x29b77f[_0x7535('0x35')][_0x7535('0x65')][_0x7535('0x49')];_0x12f5d2+=0x1){socket[_0x7535('0x6e')](_0x7535('0x85'),{'UserId':Number(_0x29b77f[_0x7535('0x35')][_0x7535('0x65')][_0x12f5d2]),'OpenchannelQueueId':Number(_0x29b77f[_0x7535('0x48')]['id'])});}}else{socket[_0x7535('0x6e')](_0x7535('0x85'),{'UserId':Number(_0x29b77f[_0x7535('0x35')][_0x7535('0x65')]),'OpenchannelQueueId':Number(_0x29b77f['params']['id'])});}});}})[_0x7535('0x27')](respondWithStatusCode(_0x4d252f,null))['catch'](handleError(_0x4d252f,null));};exports[_0x7535('0x8b')]=function(_0x2ea586,_0x58505f,_0x35f9e1){var _0x442e61={};var _0x33cc21={};var _0x447cc7;var _0x27a5ed;return db[_0x7535('0x30')][_0x7535('0x56')]({'where':{'id':_0x2ea586[_0x7535('0x48')]['id']}})[_0x7535('0x27')](handleEntityNotFound(_0x58505f,null))['then'](function(_0x5b9fa6){if(_0x5b9fa6){_0x447cc7=_0x5b9fa6;_0x33cc21[_0x7535('0x34')]=_[_0x7535('0x36')](db['User']['rawAttributes']);_0x33cc21[_0x7535('0x35')]=_['keys'](_0x2ea586[_0x7535('0x35')]);_0x33cc21['filters']=_['intersection'](_0x33cc21[_0x7535('0x34')],_0x33cc21[_0x7535('0x35')]);_0x442e61[_0x7535('0x37')]=_[_0x7535('0x38')](_0x33cc21[_0x7535('0x34')],qs[_0x7535('0x39')](_0x2ea586[_0x7535('0x35')][_0x7535('0x39')]));_0x442e61[_0x7535('0x37')]=_0x442e61[_0x7535('0x37')][_0x7535('0x49')]?_0x442e61[_0x7535('0x37')]:_0x33cc21[_0x7535('0x34')];_0x442e61[_0x7535('0x3b')]=qs[_0x7535('0x3c')](_0x2ea586[_0x7535('0x35')][_0x7535('0x3c')]);_0x442e61[_0x7535('0x40')]=qs['filters'](_[_0x7535('0x3e')](_0x2ea586[_0x7535('0x35')],_0x33cc21[_0x7535('0x3d')]));if(_0x2ea586[_0x7535('0x35')][_0x7535('0x3f')]){_0x442e61['where']=_['merge'](_0x442e61[_0x7535('0x40')],{'$or':_[_0x7535('0x2f')](_0x442e61[_0x7535('0x37')],function(_0x59d5ab){var _0x43871e={};_0x43871e[_0x59d5ab]={'$like':'%'+_0x2ea586[_0x7535('0x35')][_0x7535('0x3f')]+'%'};return _0x43871e;})});}_0x442e61=_['merge']({},_0x442e61,_0x2ea586['options']);return _0x447cc7[_0x7535('0x8b')](_0x442e61);}})[_0x7535('0x27')](function(_0x206146){if(_0x206146){_0x27a5ed=_0x206146['length'];if(!_0x2ea586[_0x7535('0x35')]['hasOwnProperty'](_0x7535('0x58'))){_0x442e61[_0x7535('0x59')]=qs[_0x7535('0x59')](_0x2ea586['query'][_0x7535('0x59')]);_0x442e61[_0x7535('0x23')]=qs[_0x7535('0x23')](_0x2ea586['query'][_0x7535('0x23')]);}return _0x447cc7[_0x7535('0x8b')](_0x442e61);}})['then'](function(_0x39f065){if(_0x39f065){return _0x39f065?{'count':_0x27a5ed,'rows':_0x39f065}:null;}})[_0x7535('0x27')](respondWithResult(_0x58505f,null))[_0x7535('0x46')](handleError(_0x58505f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 01bbefe..86bbf84 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 _0xb5a9=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x20a107,_0x5a1b5c){var _0x19bdbd=function(_0x459f9f){while(--_0x459f9f){_0x20a107['push'](_0x20a107['shift']());}};_0x19bdbd(++_0x5a1b5c);}(_0xb5a9,0x168));var _0x9b5a=function(_0x1c1e1b,_0x5af1cc){_0x1c1e1b=_0x1c1e1b-0x0;var _0xe20220=_0xb5a9[_0x1c1e1b];return _0xe20220;};'use strict';var EventEmitter=require(_0x9b5a('0x0'));var OpenchannelQueue=require(_0x9b5a('0x1'))['db'][_0x9b5a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9b5a('0x3')](0x0);var events={'afterCreate':_0x9b5a('0x4'),'afterUpdate':_0x9b5a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38738c){return function(_0x56a3f0,_0x24e45f,_0x28cc79){OpenchannelQueueEvents[_0x9b5a('0x6')](_0x38738c+':'+_0x56a3f0['id'],_0x56a3f0);OpenchannelQueueEvents[_0x9b5a('0x6')](_0x38738c,_0x56a3f0);_0x28cc79(null);};}for(var e in events){if(events[_0x9b5a('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xecbf=['hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners','save','remove','emit'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xecbf,0x174));var _0xfecb=function(_0x21df10,_0x468422){_0x21df10=_0x21df10-0x0;var _0x36a51b=_0xecbf[_0x21df10];return _0x36a51b;};'use strict';var EventEmitter=require(_0xfecb('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xfecb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfecb('0x2')](0x0);var events={'afterCreate':_0xfecb('0x3'),'afterUpdate':'update','afterDestroy':_0xfecb('0x4')};function emitEvent(_0x5515f2){return function(_0xf45e30,_0x30cddf,_0x2f9b81){OpenchannelQueueEvents[_0xfecb('0x5')](_0x5515f2+':'+_0xf45e30['id'],_0xf45e30);OpenchannelQueueEvents[_0xfecb('0x5')](_0x5515f2,_0xf45e30);_0x2f9b81(null);};}for(var e in events){if(events[_0xfecb('0x6')](e)){var event=events[e];OpenchannelQueue[_0xfecb('0x7')](e,emitEvent(event));}}module[_0xfecb('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 5d423f0..9753540 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 _0x8b34=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','util','../../config/logger','api'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x8b34,0x7f));var _0x48b3=function(_0xe15891,_0x6112a0){_0xe15891=_0xe15891-0x0;var _0x4b7f96=_0x8b34[_0xe15891];return _0x4b7f96;};'use strict';var _=require('lodash');var util=require(_0x48b3('0x0'));var logger=require(_0x48b3('0x1'))(_0x48b3('0x2'));var moment=require(_0x48b3('0x3'));var BPromise=require(_0x48b3('0x4'));var rp=require(_0x48b3('0x5'));var fs=require('fs');var path=require(_0x48b3('0x6'));var rimraf=require(_0x48b3('0x7'));var config=require(_0x48b3('0x8'));var attributes=require(_0x48b3('0x9'));module[_0x48b3('0xa')]=function(_0x56b9d0,_0x44ae40){return _0x56b9d0[_0x48b3('0xb')](_0x48b3('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bc1=['bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','../../config/logger','api'];(function(_0x394efb,_0x19132c){var _0x202f70=function(_0x3d71ff){while(--_0x3d71ff){_0x394efb['push'](_0x394efb['shift']());}};_0x202f70(++_0x19132c);}(_0x8bc1,0x10b));var _0x18bc=function(_0x406b02,_0x9b864a){_0x406b02=_0x406b02-0x0;var _0x4b96b4=_0x8bc1[_0x406b02];return _0x4b96b4;};'use strict';var _=require(_0x18bc('0x0'));var util=require('util');var logger=require(_0x18bc('0x1'))(_0x18bc('0x2'));var moment=require('moment');var BPromise=require(_0x18bc('0x3'));var rp=require(_0x18bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x18bc('0x5'));var attributes=require(_0x18bc('0x6'));module[_0x18bc('0x7')]=function(_0x74fa19,_0x2afbcb){return _0x74fa19[_0x18bc('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x18bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 6189f3a..18112ce 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 _0xec67=['jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','OpenchannelQueue','find','where','ShowOpenchannelQueue','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0xec67,0x1cd));var _0x7ec6=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xec67[_0x4eafed];return _0x159c85;};'use strict';var _=require('lodash');var util=require(_0x7ec6('0x0'));var moment=require('moment');var BPromise=require(_0x7ec6('0x1'));var rs=require(_0x7ec6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ec6('0x3'))['db'];var utils=require(_0x7ec6('0x4'));var logger=require(_0x7ec6('0x5'))('rpc');var config=require(_0x7ec6('0x6'));var jayson=require(_0x7ec6('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7ec6('0x8')]=_[_0x7ec6('0x9')](config[_0x7ec6('0x8')],{'host':_0x7ec6('0xa'),'port':0x18eb});var socket=require(_0x7ec6('0xb'))(new Redis(config['redis']));require(_0x7ec6('0xc'))[_0x7ec6('0xd')](socket);function respondWithRpcPromise(_0x6937cd,_0x3c9ef7,_0x181105){return new BPromise(function(_0x10dd33,_0x4e9e2a){return client['request'](_0x6937cd,_0x181105)[_0x7ec6('0xe')](function(_0x9e60c7){logger[_0x7ec6('0xf')](_0x7ec6('0x10'),_0x3c9ef7,_0x7ec6('0x11'));logger[_0x7ec6('0x12')](_0x7ec6('0x13'),_0x3c9ef7,'request\x20sent',JSON[_0x7ec6('0x14')](_0x9e60c7));if(_0x9e60c7[_0x7ec6('0x15')]){if(_0x9e60c7[_0x7ec6('0x15')][_0x7ec6('0x16')]===0x1f4){logger[_0x7ec6('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c9ef7,_0x9e60c7[_0x7ec6('0x15')][_0x7ec6('0x17')]);return _0x4e9e2a(_0x9e60c7['error'][_0x7ec6('0x17')]);}logger['error'](_0x7ec6('0x10'),_0x3c9ef7,_0x9e60c7[_0x7ec6('0x15')][_0x7ec6('0x17')]);return _0x10dd33(_0x9e60c7[_0x7ec6('0x15')][_0x7ec6('0x17')]);}else{logger[_0x7ec6('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c9ef7,_0x7ec6('0x11'));_0x10dd33(_0x9e60c7[_0x7ec6('0x18')][_0x7ec6('0x17')]);}})[_0x7ec6('0x19')](function(_0xecd124){logger[_0x7ec6('0x15')](_0x7ec6('0x10'),_0x3c9ef7,_0xecd124);_0x4e9e2a(_0xecd124);});});}exports[_0x7ec6('0x1a')]=function(_0x281501){var _0x41e216=this;return new Promise(function(_0x4644d0,_0x39522c){return db['OpenchannelQueue'][_0x7ec6('0x1b')]({'raw':_0x281501[_0x7ec6('0x1c')]?_0x281501[_0x7ec6('0x1c')][_0x7ec6('0x1d')]===undefined?!![]:![]:!![],'where':_0x281501[_0x7ec6('0x1c')]?_0x281501[_0x7ec6('0x1c')]['where']||null:null,'attributes':_0x281501[_0x7ec6('0x1c')]?_0x281501[_0x7ec6('0x1c')][_0x7ec6('0x1e')]||null:null,'limit':_0x281501[_0x7ec6('0x1c')]?_0x281501[_0x7ec6('0x1c')][_0x7ec6('0x1f')]||null:null,'include':_0x281501[_0x7ec6('0x1c')]?_0x281501[_0x7ec6('0x1c')][_0x7ec6('0x20')]?_[_0x7ec6('0x21')](_0x281501['options'][_0x7ec6('0x20')],function(_0x1961c4){return{'model':db[_0x1961c4['model']],'as':_0x1961c4['as'],'attributes':_0x1961c4[_0x7ec6('0x1e')],'include':_0x1961c4[_0x7ec6('0x20')]?_[_0x7ec6('0x21')](_0x1961c4[_0x7ec6('0x20')],function(_0x99d1fa){return{'model':db[_0x99d1fa[_0x7ec6('0x22')]],'as':_0x99d1fa['as'],'attributes':_0x99d1fa[_0x7ec6('0x1e')],'include':_0x99d1fa[_0x7ec6('0x20')]?_[_0x7ec6('0x21')](_0x99d1fa[_0x7ec6('0x20')],function(_0xed07fd){return{'model':db[_0xed07fd[_0x7ec6('0x22')]],'as':_0xed07fd['as'],'attributes':_0xed07fd[_0x7ec6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ec6('0xe')](function(_0xe382b2){logger[_0x7ec6('0xf')](_0x7ec6('0x1a'),_0x281501);logger[_0x7ec6('0x12')](_0x7ec6('0x1a'),_0x281501,JSON[_0x7ec6('0x14')](_0xe382b2));_0x4644d0(_0xe382b2);})['catch'](function(_0x5d824a){logger[_0x7ec6('0x15')]('GetOpenchannelQueue',_0x5d824a[_0x7ec6('0x17')],_0x281501);_0x39522c(_0x41e216[_0x7ec6('0x15')](0x1f4,_0x5d824a['message']));});});};exports['ShowOpenchannelQueue']=function(_0x4c1911){var _0x1e787e=this;return new Promise(function(_0x1755ca,_0x489cda){return db[_0x7ec6('0x23')][_0x7ec6('0x24')]({'raw':_0x4c1911[_0x7ec6('0x1c')]?_0x4c1911[_0x7ec6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4c1911[_0x7ec6('0x1c')]?_0x4c1911[_0x7ec6('0x1c')][_0x7ec6('0x25')]||null:null,'attributes':_0x4c1911[_0x7ec6('0x1c')]?_0x4c1911[_0x7ec6('0x1c')][_0x7ec6('0x1e')]||null:null,'include':_0x4c1911[_0x7ec6('0x1c')]?_0x4c1911[_0x7ec6('0x1c')][_0x7ec6('0x20')]?_[_0x7ec6('0x21')](_0x4c1911[_0x7ec6('0x1c')][_0x7ec6('0x20')],function(_0x31431b){return{'model':db[_0x31431b[_0x7ec6('0x22')]],'as':_0x31431b['as'],'attributes':_0x31431b[_0x7ec6('0x1e')],'include':_0x31431b[_0x7ec6('0x20')]?_['map'](_0x31431b['include'],function(_0x3e3c6b){return{'model':db[_0x3e3c6b[_0x7ec6('0x22')]],'as':_0x3e3c6b['as'],'attributes':_0x3e3c6b[_0x7ec6('0x1e')],'include':_0x3e3c6b[_0x7ec6('0x20')]?_['map'](_0x3e3c6b[_0x7ec6('0x20')],function(_0xfe4407){return{'model':db[_0xfe4407[_0x7ec6('0x22')]],'as':_0xfe4407['as'],'attributes':_0xfe4407[_0x7ec6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ec6('0xe')](function(_0x5e2621){logger['info'](_0x7ec6('0x26'),_0x4c1911);logger['debug']('ShowOpenchannelQueue',_0x4c1911,JSON[_0x7ec6('0x14')](_0x5e2621));_0x1755ca(_0x5e2621);})[_0x7ec6('0x19')](function(_0x592f8c){logger[_0x7ec6('0x15')](_0x7ec6('0x26'),_0x592f8c[_0x7ec6('0x17')],_0x4c1911);_0x489cda(_0x1e787e[_0x7ec6('0x15')](0x1f4,_0x592f8c[_0x7ec6('0x17')]));});});}; \ No newline at end of file +var _0xce73=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','model','include','map','debug','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x5769e0,_0x4b4ca8){var _0x5b89e3=function(_0x3a9b24){while(--_0x3a9b24){_0x5769e0['push'](_0x5769e0['shift']());}};_0x5b89e3(++_0x4b4ca8);}(_0xce73,0x90));var _0x3ce7=function(_0x5833d2,_0xdd23dc){_0x5833d2=_0x5833d2-0x0;var _0x5910fa=_0xce73[_0x5833d2];return _0x5910fa;};'use strict';var _=require(_0x3ce7('0x0'));var util=require(_0x3ce7('0x1'));var moment=require(_0x3ce7('0x2'));var BPromise=require(_0x3ce7('0x3'));var rs=require(_0x3ce7('0x4'));var fs=require('fs');var Redis=require(_0x3ce7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ce7('0x6'))(_0x3ce7('0x7'));var config=require(_0x3ce7('0x8'));var jayson=require(_0x3ce7('0x9'));var client=jayson[_0x3ce7('0xa')][_0x3ce7('0xb')]({'port':0x232a});config[_0x3ce7('0xc')]=_['defaults'](config['redis'],{'host':_0x3ce7('0xd'),'port':0x18eb});var socket=require(_0x3ce7('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x3ce7('0xf')](socket);function respondWithRpcPromise(_0x599332,_0x7a3a10,_0x27b8f2){return new BPromise(function(_0x50221c,_0x3ccd9c){return client[_0x3ce7('0x10')](_0x599332,_0x27b8f2)[_0x3ce7('0x11')](function(_0x3f1d3f){logger[_0x3ce7('0x12')](_0x3ce7('0x13'),_0x7a3a10,_0x3ce7('0x14'));logger['debug'](_0x3ce7('0x15'),_0x7a3a10,_0x3ce7('0x14'),JSON[_0x3ce7('0x16')](_0x3f1d3f));if(_0x3f1d3f['error']){if(_0x3f1d3f[_0x3ce7('0x17')][_0x3ce7('0x18')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x7a3a10,_0x3f1d3f[_0x3ce7('0x17')]['message']);return _0x3ccd9c(_0x3f1d3f['error'][_0x3ce7('0x19')]);}logger[_0x3ce7('0x17')](_0x3ce7('0x13'),_0x7a3a10,_0x3f1d3f[_0x3ce7('0x17')]['message']);return _0x50221c(_0x3f1d3f[_0x3ce7('0x17')][_0x3ce7('0x19')]);}else{logger[_0x3ce7('0x12')](_0x3ce7('0x13'),_0x7a3a10,_0x3ce7('0x14'));_0x50221c(_0x3f1d3f[_0x3ce7('0x1a')][_0x3ce7('0x19')]);}})[_0x3ce7('0x1b')](function(_0x1b6805){logger[_0x3ce7('0x17')](_0x3ce7('0x13'),_0x7a3a10,_0x1b6805);_0x3ccd9c(_0x1b6805);});});}exports[_0x3ce7('0x1c')]=function(_0x297151){var _0x4ae426=this;return new Promise(function(_0x4a0fb0,_0x3fa699){return db['OpenchannelQueue'][_0x3ce7('0x1d')]({'raw':_0x297151[_0x3ce7('0x1e')]?_0x297151[_0x3ce7('0x1e')][_0x3ce7('0x1f')]===undefined?!![]:![]:!![],'where':_0x297151[_0x3ce7('0x1e')]?_0x297151[_0x3ce7('0x1e')][_0x3ce7('0x20')]||null:null,'attributes':_0x297151[_0x3ce7('0x1e')]?_0x297151[_0x3ce7('0x1e')][_0x3ce7('0x21')]||null:null,'limit':_0x297151['options']?_0x297151['options']['limit']||null:null,'include':_0x297151[_0x3ce7('0x1e')]?_0x297151[_0x3ce7('0x1e')]['include']?_['map'](_0x297151[_0x3ce7('0x1e')]['include'],function(_0x222d98){return{'model':db[_0x222d98[_0x3ce7('0x22')]],'as':_0x222d98['as'],'attributes':_0x222d98[_0x3ce7('0x21')],'include':_0x222d98[_0x3ce7('0x23')]?_[_0x3ce7('0x24')](_0x222d98[_0x3ce7('0x23')],function(_0x516bb3){return{'model':db[_0x516bb3[_0x3ce7('0x22')]],'as':_0x516bb3['as'],'attributes':_0x516bb3['attributes'],'include':_0x516bb3['include']?_[_0x3ce7('0x24')](_0x516bb3[_0x3ce7('0x23')],function(_0x48cbb2){return{'model':db[_0x48cbb2['model']],'as':_0x48cbb2['as'],'attributes':_0x48cbb2[_0x3ce7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3ce7('0x11')](function(_0x2a8ce4){logger[_0x3ce7('0x12')](_0x3ce7('0x1c'),_0x297151);logger[_0x3ce7('0x25')](_0x3ce7('0x1c'),_0x297151,JSON[_0x3ce7('0x16')](_0x2a8ce4));_0x4a0fb0(_0x2a8ce4);})['catch'](function(_0x322f96){logger[_0x3ce7('0x17')](_0x3ce7('0x1c'),_0x322f96[_0x3ce7('0x19')],_0x297151);_0x3fa699(_0x4ae426[_0x3ce7('0x17')](0x1f4,_0x322f96[_0x3ce7('0x19')]));});});};exports[_0x3ce7('0x26')]=function(_0x420dab){var _0x5eb04d=this;return new Promise(function(_0x45b660,_0x5a1fe3){return db[_0x3ce7('0x27')]['find']({'raw':_0x420dab['options']?_0x420dab[_0x3ce7('0x1e')][_0x3ce7('0x1f')]===undefined?!![]:![]:!![],'where':_0x420dab['options']?_0x420dab['options'][_0x3ce7('0x20')]||null:null,'attributes':_0x420dab['options']?_0x420dab['options'][_0x3ce7('0x21')]||null:null,'include':_0x420dab[_0x3ce7('0x1e')]?_0x420dab[_0x3ce7('0x1e')][_0x3ce7('0x23')]?_[_0x3ce7('0x24')](_0x420dab[_0x3ce7('0x1e')][_0x3ce7('0x23')],function(_0x561294){return{'model':db[_0x561294[_0x3ce7('0x22')]],'as':_0x561294['as'],'attributes':_0x561294[_0x3ce7('0x21')],'include':_0x561294[_0x3ce7('0x23')]?_[_0x3ce7('0x24')](_0x561294[_0x3ce7('0x23')],function(_0x30e06f){return{'model':db[_0x30e06f[_0x3ce7('0x22')]],'as':_0x30e06f['as'],'attributes':_0x30e06f['attributes'],'include':_0x30e06f[_0x3ce7('0x23')]?_[_0x3ce7('0x24')](_0x30e06f[_0x3ce7('0x23')],function(_0x480732){return{'model':db[_0x480732[_0x3ce7('0x22')]],'as':_0x480732['as'],'attributes':_0x480732[_0x3ce7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3ce7('0x11')](function(_0xdccec6){logger[_0x3ce7('0x12')]('ShowOpenchannelQueue',_0x420dab);logger['debug'](_0x3ce7('0x26'),_0x420dab,JSON[_0x3ce7('0x16')](_0xdccec6));_0x45b660(_0xdccec6);})['catch'](function(_0x511a3a){logger[_0x3ce7('0x17')](_0x3ce7('0x26'),_0x511a3a[_0x3ce7('0x19')],_0x420dab);_0x5a1fe3(_0x5eb04d[_0x3ce7('0x17')](0x1f4,_0x511a3a[_0x3ce7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 81dd54c..da54c1b 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 _0x0c8f=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','removeListener'];(function(_0x332c09,_0x29169d){var _0x36867a=function(_0x582526){while(--_0x582526){_0x332c09['push'](_0x332c09['shift']());}};_0x36867a(++_0x29169d);}(_0x0c8f,0x1eb));var _0xf0c8=function(_0xb398eb,_0x14a3f5){_0xb398eb=_0xb398eb-0x0;var _0x325386=_0x0c8f[_0xb398eb];return _0x325386;};'use strict';var OpenchannelQueueEvents=require(_0xf0c8('0x0'));var events=[_0xf0c8('0x1'),_0xf0c8('0x2'),_0xf0c8('0x3')];function createListener(_0x28e3bf,_0x351ff5){return function(_0x5b79b2){_0x351ff5['emit'](_0x28e3bf,_0x5b79b2);};}function removeListener(_0x5dc8e1,_0x5e522d){return function(){OpenchannelQueueEvents[_0xf0c8('0x4')](_0x5dc8e1,_0x5e522d);};}exports[_0xf0c8('0x5')]=function(_0x4ef4c5){for(var _0x190d49=0x0,_0x547acb=events[_0xf0c8('0x6')];_0x190d49<_0x547acb;_0x190d49++){var _0xa7737a=events[_0x190d49];var _0x14df98=createListener(_0xf0c8('0x7')+_0xa7737a,_0x4ef4c5);OpenchannelQueueEvents['on'](_0xa7737a,_0x14df98);}}; \ No newline at end of file +var _0x2cf4=['emit','register','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0xa6f516,_0x5a541b){var _0x37cae2=function(_0x5a2a6a){while(--_0x5a2a6a){_0xa6f516['push'](_0xa6f516['shift']());}};_0x37cae2(++_0x5a541b);}(_0x2cf4,0xac));var _0x42cf=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x2cf4[_0x421e36];return _0x20b3e3;};'use strict';var OpenchannelQueueEvents=require(_0x42cf('0x0'));var events=[_0x42cf('0x1'),_0x42cf('0x2'),'update'];function createListener(_0x1526d1,_0x86a3){return function(_0x4f6d94){_0x86a3[_0x42cf('0x3')](_0x1526d1,_0x4f6d94);};}function removeListener(_0x2fc699,_0x256574){return function(){OpenchannelQueueEvents['removeListener'](_0x2fc699,_0x256574);};}exports[_0x42cf('0x4')]=function(_0x2b2ea6){for(var _0x4ba0c4=0x0,_0x464560=events[_0x42cf('0x5')];_0x4ba0c4<_0x464560;_0x4ba0c4++){var _0x289752=events[_0x4ba0c4];var _0xf44568=createListener(_0x42cf('0x6')+_0x289752,_0x2b2ea6);OpenchannelQueueEvents['on'](_0x289752,_0xf44568);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index c136b03..1868253 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 _0x416d=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','exports','multer'];(function(_0x339df0,_0x31fa8d){var _0x166059=function(_0x5c1688){while(--_0x5c1688){_0x339df0['push'](_0x339df0['shift']());}};_0x166059(++_0x31fa8d);}(_0x416d,0x7d));var _0xd416=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0x416d[_0x229128];return _0x1875b9;};'use strict';var multer=require(_0xd416('0x0'));var util=require(_0xd416('0x1'));var path=require(_0xd416('0x2'));var timeout=require(_0xd416('0x3'));var express=require('express');var router=express[_0xd416('0x4')]();var auth=require(_0xd416('0x5'));var interaction=require(_0xd416('0x6'));var config=require(_0xd416('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0xd416('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd416('0x8')](_0xd416('0x9'),auth[_0xd416('0xa')](),controller[_0xd416('0xb')]);router[_0xd416('0x8')](_0xd416('0xc'),auth[_0xd416('0xa')](),controller[_0xd416('0xd')]);router[_0xd416('0xe')]('/',auth[_0xd416('0xa')](),controller['create']);router[_0xd416('0xf')](_0xd416('0xc'),auth[_0xd416('0xa')](),controller[_0xd416('0x10')]);router['delete'](_0xd416('0xc'),auth[_0xd416('0xa')](),controller['destroy']);module[_0xd416('0x11')]=router; \ No newline at end of file +var _0x3cc9=['put','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x5b5977,_0x47ca7d){var _0x361510=function(_0x33e110){while(--_0x33e110){_0x5b5977['push'](_0x5b5977['shift']());}};_0x361510(++_0x47ca7d);}(_0x3cc9,0x82));var _0x93cc=function(_0x225735,_0x14814e){_0x225735=_0x225735-0x0;var _0x2fa441=_0x3cc9[_0x225735];return _0x2fa441;};'use strict';var multer=require('multer');var util=require(_0x93cc('0x0'));var path=require(_0x93cc('0x1'));var timeout=require(_0x93cc('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x93cc('0x3'));var config=require(_0x93cc('0x4'));var controller=require('./openchannelQueueReport.controller');router[_0x93cc('0x5')]('/',auth[_0x93cc('0x6')](),controller[_0x93cc('0x7')]);router['get'](_0x93cc('0x8'),auth[_0x93cc('0x6')](),controller[_0x93cc('0x9')]);router[_0x93cc('0x5')](_0x93cc('0xa'),auth[_0x93cc('0x6')](),controller[_0x93cc('0xb')]);router[_0x93cc('0xc')]('/',auth[_0x93cc('0x6')](),controller[_0x93cc('0xd')]);router[_0x93cc('0xe')](_0x93cc('0xa'),auth[_0x93cc('0x6')](),controller['update']);router[_0x93cc('0xf')](_0x93cc('0xa'),auth[_0x93cc('0x6')](),controller[_0x93cc('0x10')]);module[_0x93cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 780406b..ffa38ce 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 _0x2ed5=['DATE','sequelize','exports','STRING'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x2ed5,0xa5));var _0x52ed=function(_0x4512dc,_0x1640f9){_0x4512dc=_0x4512dc-0x0;var _0x334ad2=_0x2ed5[_0x4512dc];return _0x334ad2;};'use strict';var moment=require('moment');var Sequelize=require(_0x52ed('0x0'));module[_0x52ed('0x1')]={'uniqueid':{'type':Sequelize[_0x52ed('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x52ed('0x2')]},'joinAt':{'type':Sequelize[_0x52ed('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x52ed('0x3')]},'exitAt':{'type':Sequelize[_0x52ed('0x3')]},'reason':{'type':Sequelize[_0x52ed('0x2')]}}; \ No newline at end of file +var _0xe614=['moment','STRING','DATE'];(function(_0x3e15c2,_0x1a805a){var _0x357e55=function(_0x1d104f){while(--_0x1d104f){_0x3e15c2['push'](_0x3e15c2['shift']());}};_0x357e55(++_0x1a805a);}(_0xe614,0x192));var _0x4e61=function(_0x3ada25,_0x330cba){_0x3ada25=_0x3ada25-0x0;var _0x58a078=_0xe614[_0x3ada25];return _0x58a078;};'use strict';var moment=require(_0x4e61('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4e61('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x4e61('0x1')]},'joinAt':{'type':Sequelize[_0x4e61('0x2')]},'leaveAt':{'type':Sequelize[_0x4e61('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4e61('0x2')]},'reason':{'type':Sequelize[_0x4e61('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2e355ed..cbfdd6d 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 _0x61f1=['findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include'];(function(_0x58da6d,_0x391410){var _0x44f62a=function(_0x1d7f9a){while(--_0x1d7f9a){_0x58da6d['push'](_0x58da6d['shift']());}};_0x44f62a(++_0x391410);}(_0x61f1,0x18a));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x161f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x161f('0x1'));var jsonpatch=require(_0x161f('0x2'));var rp=require(_0x161f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x161f('0x4'));var util=require(_0x161f('0x5'));var path=require('path');var sox=require(_0x161f('0x6'));var csv=require(_0x161f('0x7'));var ejs=require(_0x161f('0x8'));var fs=require('fs');var _=require(_0x161f('0x9'));var squel=require(_0x161f('0xa'));var crypto=require('crypto');var jsforce=require(_0x161f('0xb'));var deskjs=require(_0x161f('0xc'));var toCsv=require(_0x161f('0x7'));var querystring=require(_0x161f('0xd'));var Papa=require(_0x161f('0xe'));var Redis=require(_0x161f('0xf'));var authService=require(_0x161f('0x10'));var qs=require(_0x161f('0x11'));var as=require(_0x161f('0x12'));var hardwareService=require(_0x161f('0x13'));var logger=require(_0x161f('0x14'))('api');var utils=require(_0x161f('0x15'));var config=require(_0x161f('0x16'));var db=require(_0x161f('0x17'))['db'];function respondWithStatusCode(_0x3dd047,_0x113346){_0x113346=_0x113346||0xcc;return function(_0x4b0917){if(_0x4b0917){return _0x3dd047[_0x161f('0x18')](_0x113346);}return _0x3dd047[_0x161f('0x19')](_0x113346)[_0x161f('0x1a')]();};}function respondWithResult(_0x15d84f,_0x4b34db){_0x4b34db=_0x4b34db||0xc8;return function(_0xc6108b){if(_0xc6108b){return _0x15d84f[_0x161f('0x19')](_0x4b34db)[_0x161f('0x1b')](_0xc6108b);}};}function respondWithFilteredResult(_0x17fcd7,_0x4470d9){return function(_0x1ceffb){if(_0x1ceffb){var _0x594742=_0x1ceffb[_0x161f('0x1c')],_0x486261=_0x4470d9['offset'],_0x3270f3=_0x4470d9[_0x161f('0x1d')]+_0x4470d9[_0x161f('0x1e')],_0x49dffc;if(_0x3270f3>=_0x594742){_0x3270f3=_0x594742;_0x49dffc=0xc8;}else{_0x49dffc=0xce;}_0x17fcd7[_0x161f('0x19')](_0x49dffc);return _0x17fcd7['set'](_0x161f('0x1f'),_0x486261+'-'+_0x3270f3+'/'+_0x594742)['json'](_0x1ceffb);}return null;};}function patchUpdates(_0x1eb321){return function(_0x1d271b){try{jsonpatch[_0x161f('0x20')](_0x1d271b,_0x1eb321,!![]);}catch(_0x5958b4){return BPromise[_0x161f('0x21')](_0x5958b4);}return _0x1d271b[_0x161f('0x22')]();};}function saveUpdates(_0x2ddab0,_0x3a3a61){return function(_0x1153ce){if(_0x1153ce){return _0x1153ce[_0x161f('0x23')](_0x2ddab0)[_0x161f('0x24')](function(_0x41970d){return _0x41970d;});}return null;};}function removeEntity(_0x1be23b,_0x5a92b8){return function(_0x3ae0dc){if(_0x3ae0dc){return _0x3ae0dc[_0x161f('0x25')]()[_0x161f('0x24')](function(){_0x1be23b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xca1a9f,_0xaf2a44){return function(_0x161d91){if(!_0x161d91){_0xca1a9f[_0x161f('0x18')](0x194);}return _0x161d91;};}function handleError(_0x2a1f5f,_0x48b084){_0x48b084=_0x48b084||0x1f4;return function(_0x27d38a){logger[_0x161f('0x26')](_0x27d38a[_0x161f('0x27')]);if(_0x27d38a['name']){delete _0x27d38a[_0x161f('0x28')];}_0x2a1f5f[_0x161f('0x19')](_0x48b084)[_0x161f('0x29')](_0x27d38a);};}exports[_0x161f('0x2a')]=function(_0xd50351,_0x2470ba){var _0x561025={},_0x168b66={},_0x625125={'count':0x0,'rows':[]};var _0x2851fa=_[_0x161f('0x2b')](db[_0x161f('0x2c')][_0x161f('0x2d')],function(_0x589793){return{'name':_0x589793[_0x161f('0x2e')],'type':_0x589793[_0x161f('0x2f')][_0x161f('0x30')]};});_0x168b66['model']=_[_0x161f('0x2b')](_0x2851fa,_0x161f('0x28'));_0x168b66[_0x161f('0x31')]=_[_0x161f('0x32')](_0xd50351[_0x161f('0x31')]);_0x168b66[_0x161f('0x33')]=_[_0x161f('0x34')](_0x168b66[_0x161f('0x35')],_0x168b66['query']);_0x561025['attributes']=_[_0x161f('0x34')](_0x168b66[_0x161f('0x35')],qs[_0x161f('0x36')](_0xd50351['query']['fields']));_0x561025['attributes']=_0x561025[_0x161f('0x37')][_0x161f('0x38')]?_0x561025['attributes']:_0x168b66[_0x161f('0x35')];if(!_0xd50351[_0x161f('0x31')][_0x161f('0x39')](_0x161f('0x3a'))){_0x561025['limit']=qs[_0x161f('0x1e')](_0xd50351['query'][_0x161f('0x1e')]);_0x561025[_0x161f('0x1d')]=qs[_0x161f('0x1d')](_0xd50351[_0x161f('0x31')][_0x161f('0x1d')]);}_0x561025[_0x161f('0x3b')]=qs[_0x161f('0x3c')](_0xd50351[_0x161f('0x31')][_0x161f('0x3c')]);_0x561025[_0x161f('0x3d')]=qs['filters'](_[_0x161f('0x3e')](_0xd50351['query'],_0x168b66[_0x161f('0x33')]),_0x2851fa);if(_0xd50351[_0x161f('0x31')]['filter']){_0x561025[_0x161f('0x3d')]=_[_0x161f('0x3f')](_0x561025[_0x161f('0x3d')],{'$or':_[_0x161f('0x2b')](_0x2851fa,function(_0x56959d){if(_0x56959d[_0x161f('0x2f')]!==_0x161f('0x40')){var _0x4a590a={};_0x4a590a[_0x56959d['name']]={'$like':'%'+_0xd50351['query'][_0x161f('0x41')]+'%'};return _0x4a590a;}})});}_0x561025=_[_0x161f('0x3f')]({},_0x561025,_0xd50351['options']);var _0x39434f={'where':_0x561025['where']};return db['OpenchannelQueueReport'][_0x161f('0x1c')](_0x39434f)[_0x161f('0x24')](function(_0x259300){_0x625125['count']=_0x259300;if(_0xd50351[_0x161f('0x31')][_0x161f('0x42')]){_0x561025[_0x161f('0x43')]=[{'all':!![]}];}return db[_0x161f('0x2c')][_0x161f('0x44')](_0x561025);})[_0x161f('0x24')](function(_0x14f9b1){_0x625125[_0x161f('0x45')]=_0x14f9b1;return _0x625125;})[_0x161f('0x24')](respondWithFilteredResult(_0x2470ba,_0x561025))[_0x161f('0x46')](handleError(_0x2470ba,null));};exports[_0x161f('0x47')]=function(_0xfcccdb,_0x1b07fd){var _0x49a60b={'raw':!![],'where':{'id':_0xfcccdb[_0x161f('0x48')]['id']}},_0x5e6aae={};_0x5e6aae[_0x161f('0x35')]=_[_0x161f('0x32')](db[_0x161f('0x2c')]['rawAttributes']);_0x5e6aae[_0x161f('0x31')]=_[_0x161f('0x32')](_0xfcccdb[_0x161f('0x31')]);_0x5e6aae[_0x161f('0x33')]=_[_0x161f('0x34')](_0x5e6aae[_0x161f('0x35')],_0x5e6aae[_0x161f('0x31')]);_0x49a60b['attributes']=_[_0x161f('0x34')](_0x5e6aae[_0x161f('0x35')],qs['fields'](_0xfcccdb['query'][_0x161f('0x36')]));_0x49a60b['attributes']=_0x49a60b[_0x161f('0x37')][_0x161f('0x38')]?_0x49a60b[_0x161f('0x37')]:_0x5e6aae[_0x161f('0x35')];if(_0xfcccdb[_0x161f('0x31')][_0x161f('0x42')]){_0x49a60b[_0x161f('0x43')]=[{'all':!![]}];}_0x49a60b=_[_0x161f('0x3f')]({},_0x49a60b,_0xfcccdb['options']);return db[_0x161f('0x2c')][_0x161f('0x49')](_0x49a60b)[_0x161f('0x24')](handleEntityNotFound(_0x1b07fd,null))[_0x161f('0x24')](respondWithResult(_0x1b07fd,null))[_0x161f('0x46')](handleError(_0x1b07fd,null));};exports[_0x161f('0x4a')]=function(_0x481c01,_0x3c909c){return db[_0x161f('0x2c')][_0x161f('0x4a')](_0x481c01[_0x161f('0x4b')],{})[_0x161f('0x24')](respondWithResult(_0x3c909c,0xc9))['catch'](handleError(_0x3c909c,null));};exports['update']=function(_0x5d8ef8,_0x565dae){if(_0x5d8ef8[_0x161f('0x4b')]['id']){delete _0x5d8ef8['body']['id'];}return db[_0x161f('0x2c')]['find']({'where':{'id':_0x5d8ef8[_0x161f('0x48')]['id']}})[_0x161f('0x24')](handleEntityNotFound(_0x565dae,null))[_0x161f('0x24')](saveUpdates(_0x5d8ef8['body'],null))[_0x161f('0x24')](respondWithResult(_0x565dae,null))[_0x161f('0x46')](handleError(_0x565dae,null));};exports['destroy']=function(_0x5d5d54,_0x3b51b8){return db['OpenchannelQueueReport'][_0x161f('0x49')]({'where':{'id':_0x5d5d54['params']['id']}})[_0x161f('0x24')](handleEntityNotFound(_0x3b51b8,null))[_0x161f('0x24')](removeEntity(_0x3b51b8,null))[_0x161f('0x46')](handleError(_0x3b51b8,null));};exports[_0x161f('0x4c')]=function(_0x14cea7,_0x1eb15d){return db[_0x161f('0x2c')][_0x161f('0x4c')]()[_0x161f('0x24')](respondWithResult(_0x1eb15d,null))[_0x161f('0x46')](handleError(_0x1eb15d,null));}; \ No newline at end of file +var _0xe16a=['rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelQueueReport','count','includeAll','include','findAll','rows','params'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xe16a,0x122));var _0xae16=function(_0x473f81,_0x76c1b3){_0x473f81=_0x473f81-0x0;var _0x5877a8=_0xe16a[_0x473f81];return _0x5877a8;};'use strict';var pdf=require(_0xae16('0x0'));var emlformat=require(_0xae16('0x1'));var rimraf=require(_0xae16('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae16('0x3'));var rp=require(_0xae16('0x4'));var moment=require(_0xae16('0x5'));var BPromise=require(_0xae16('0x6'));var Mustache=require(_0xae16('0x7'));var util=require('util');var path=require(_0xae16('0x8'));var sox=require(_0xae16('0x9'));var csv=require(_0xae16('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xae16('0xb'));var squel=require('squel');var crypto=require(_0xae16('0xc'));var jsforce=require(_0xae16('0xd'));var deskjs=require(_0xae16('0xe'));var toCsv=require(_0xae16('0xa'));var querystring=require(_0xae16('0xf'));var Papa=require(_0xae16('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae16('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xae16('0x12'));var db=require(_0xae16('0x13'))['db'];function respondWithStatusCode(_0x305c5c,_0x6c34ed){_0x6c34ed=_0x6c34ed||0xcc;return function(_0x4b4f73){if(_0x4b4f73){return _0x305c5c[_0xae16('0x14')](_0x6c34ed);}return _0x305c5c[_0xae16('0x15')](_0x6c34ed)['end']();};}function respondWithResult(_0x7b104a,_0x4e2302){_0x4e2302=_0x4e2302||0xc8;return function(_0x502686){if(_0x502686){return _0x7b104a[_0xae16('0x15')](_0x4e2302)[_0xae16('0x16')](_0x502686);}};}function respondWithFilteredResult(_0x11c428,_0x584879){return function(_0x4483d4){if(_0x4483d4){var _0x1c847d=_0x4483d4['count'],_0x347e6f=_0x584879[_0xae16('0x17')],_0x194469=_0x584879[_0xae16('0x17')]+_0x584879[_0xae16('0x18')],_0x695a27;if(_0x194469>=_0x1c847d){_0x194469=_0x1c847d;_0x695a27=0xc8;}else{_0x695a27=0xce;}_0x11c428[_0xae16('0x15')](_0x695a27);return _0x11c428[_0xae16('0x19')](_0xae16('0x1a'),_0x347e6f+'-'+_0x194469+'/'+_0x1c847d)['json'](_0x4483d4);}return null;};}function patchUpdates(_0x9099d0){return function(_0xc9441c){try{jsonpatch['apply'](_0xc9441c,_0x9099d0,!![]);}catch(_0x3f773a){return BPromise[_0xae16('0x1b')](_0x3f773a);}return _0xc9441c['save']();};}function saveUpdates(_0x2afd02,_0x268823){return function(_0xfbf99f){if(_0xfbf99f){return _0xfbf99f[_0xae16('0x1c')](_0x2afd02)[_0xae16('0x1d')](function(_0x4de06c){return _0x4de06c;});}return null;};}function removeEntity(_0x2b4e19,_0x487951){return function(_0xecd816){if(_0xecd816){return _0xecd816[_0xae16('0x1e')]()['then'](function(){_0x2b4e19[_0xae16('0x15')](0xcc)[_0xae16('0x1f')]();});}};}function handleEntityNotFound(_0x4dcdea,_0xbf4f6a){return function(_0x319a0c){if(!_0x319a0c){_0x4dcdea['sendStatus'](0x194);}return _0x319a0c;};}function handleError(_0x1d721f,_0x56ab00){_0x56ab00=_0x56ab00||0x1f4;return function(_0x2b5fcf){logger[_0xae16('0x20')](_0x2b5fcf[_0xae16('0x21')]);if(_0x2b5fcf[_0xae16('0x22')]){delete _0x2b5fcf[_0xae16('0x22')];}_0x1d721f[_0xae16('0x15')](_0x56ab00)[_0xae16('0x23')](_0x2b5fcf);};}exports[_0xae16('0x24')]=function(_0x503c29,_0x2de15e){var _0x1f20bb={},_0x44bd89={},_0x16e58f={'count':0x0,'rows':[]};var _0xe7fe68=_[_0xae16('0x25')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x55e05f){return{'name':_0x55e05f[_0xae16('0x26')],'type':_0x55e05f[_0xae16('0x27')][_0xae16('0x28')]};});_0x44bd89[_0xae16('0x29')]=_['map'](_0xe7fe68,_0xae16('0x22'));_0x44bd89[_0xae16('0x2a')]=_[_0xae16('0x2b')](_0x503c29[_0xae16('0x2a')]);_0x44bd89[_0xae16('0x2c')]=_[_0xae16('0x2d')](_0x44bd89[_0xae16('0x29')],_0x44bd89[_0xae16('0x2a')]);_0x1f20bb['attributes']=_[_0xae16('0x2d')](_0x44bd89[_0xae16('0x29')],qs[_0xae16('0x2e')](_0x503c29[_0xae16('0x2a')][_0xae16('0x2e')]));_0x1f20bb[_0xae16('0x2f')]=_0x1f20bb[_0xae16('0x2f')][_0xae16('0x30')]?_0x1f20bb[_0xae16('0x2f')]:_0x44bd89['model'];if(!_0x503c29[_0xae16('0x2a')][_0xae16('0x31')]('nolimit')){_0x1f20bb[_0xae16('0x18')]=qs[_0xae16('0x18')](_0x503c29['query'][_0xae16('0x18')]);_0x1f20bb[_0xae16('0x17')]=qs[_0xae16('0x17')](_0x503c29[_0xae16('0x2a')][_0xae16('0x17')]);}_0x1f20bb[_0xae16('0x32')]=qs[_0xae16('0x33')](_0x503c29[_0xae16('0x2a')][_0xae16('0x33')]);_0x1f20bb['where']=qs[_0xae16('0x2c')](_[_0xae16('0x34')](_0x503c29[_0xae16('0x2a')],_0x44bd89['filters']),_0xe7fe68);if(_0x503c29['query'][_0xae16('0x35')]){_0x1f20bb[_0xae16('0x36')]=_[_0xae16('0x37')](_0x1f20bb[_0xae16('0x36')],{'$or':_[_0xae16('0x25')](_0xe7fe68,function(_0x4e1c71){if(_0x4e1c71[_0xae16('0x27')]!==_0xae16('0x38')){var _0x1feaa2={};_0x1feaa2[_0x4e1c71['name']]={'$like':'%'+_0x503c29[_0xae16('0x2a')][_0xae16('0x35')]+'%'};return _0x1feaa2;}})});}_0x1f20bb=_['merge']({},_0x1f20bb,_0x503c29[_0xae16('0x39')]);var _0x48f496={'where':_0x1f20bb['where']};return db[_0xae16('0x3a')]['count'](_0x48f496)[_0xae16('0x1d')](function(_0x352668){_0x16e58f[_0xae16('0x3b')]=_0x352668;if(_0x503c29['query'][_0xae16('0x3c')]){_0x1f20bb[_0xae16('0x3d')]=[{'all':!![]}];}return db[_0xae16('0x3a')][_0xae16('0x3e')](_0x1f20bb);})[_0xae16('0x1d')](function(_0x5dbcf3){_0x16e58f[_0xae16('0x3f')]=_0x5dbcf3;return _0x16e58f;})[_0xae16('0x1d')](respondWithFilteredResult(_0x2de15e,_0x1f20bb))['catch'](handleError(_0x2de15e,null));};exports['show']=function(_0x3c58eb,_0x74fbd2){var _0x4e1038={'raw':!![],'where':{'id':_0x3c58eb[_0xae16('0x40')]['id']}},_0x34b282={};_0x34b282['model']=_[_0xae16('0x2b')](db[_0xae16('0x3a')][_0xae16('0x41')]);_0x34b282[_0xae16('0x2a')]=_[_0xae16('0x2b')](_0x3c58eb[_0xae16('0x2a')]);_0x34b282[_0xae16('0x2c')]=_[_0xae16('0x2d')](_0x34b282[_0xae16('0x29')],_0x34b282[_0xae16('0x2a')]);_0x4e1038['attributes']=_['intersection'](_0x34b282[_0xae16('0x29')],qs[_0xae16('0x2e')](_0x3c58eb[_0xae16('0x2a')][_0xae16('0x2e')]));_0x4e1038[_0xae16('0x2f')]=_0x4e1038['attributes']['length']?_0x4e1038[_0xae16('0x2f')]:_0x34b282[_0xae16('0x29')];if(_0x3c58eb[_0xae16('0x2a')][_0xae16('0x3c')]){_0x4e1038[_0xae16('0x3d')]=[{'all':!![]}];}_0x4e1038=_[_0xae16('0x37')]({},_0x4e1038,_0x3c58eb[_0xae16('0x39')]);return db[_0xae16('0x3a')][_0xae16('0x42')](_0x4e1038)[_0xae16('0x1d')](handleEntityNotFound(_0x74fbd2,null))[_0xae16('0x1d')](respondWithResult(_0x74fbd2,null))[_0xae16('0x43')](handleError(_0x74fbd2,null));};exports[_0xae16('0x44')]=function(_0x5da44e,_0x47b0f4){return db[_0xae16('0x3a')][_0xae16('0x44')](_0x5da44e['body'],{})[_0xae16('0x1d')](respondWithResult(_0x47b0f4,0xc9))['catch'](handleError(_0x47b0f4,null));};exports[_0xae16('0x1c')]=function(_0xee4816,_0xe6ce1b){if(_0xee4816[_0xae16('0x45')]['id']){delete _0xee4816[_0xae16('0x45')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0xee4816['params']['id']}})[_0xae16('0x1d')](handleEntityNotFound(_0xe6ce1b,null))[_0xae16('0x1d')](saveUpdates(_0xee4816['body'],null))[_0xae16('0x1d')](respondWithResult(_0xe6ce1b,null))[_0xae16('0x43')](handleError(_0xe6ce1b,null));};exports[_0xae16('0x1e')]=function(_0x2ac26b,_0x5ea553){return db[_0xae16('0x3a')]['find']({'where':{'id':_0x2ac26b[_0xae16('0x40')]['id']}})[_0xae16('0x1d')](handleEntityNotFound(_0x5ea553,null))[_0xae16('0x1d')](removeEntity(_0x5ea553,null))['catch'](handleError(_0x5ea553,null));};exports['describe']=function(_0x57d952,_0x3593f7){return db['OpenchannelQueueReport'][_0xae16('0x46')]()['then'](respondWithResult(_0x3593f7,null))[_0xae16('0x43')](handleError(_0x3593f7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 09e748c..6d4e447 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 _0xfada=['request-promise','path','rimraf','./openchannelQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x3d4f17,_0x558cb8){var _0x196c0e=function(_0x301fba){while(--_0x301fba){_0x3d4f17['push'](_0x3d4f17['shift']());}};_0x196c0e(++_0x558cb8);}(_0xfada,0xbb));var _0xafad=function(_0x3534a8,_0x4daad0){_0x3534a8=_0x3534a8-0x0;var _0x7831bc=_0xfada[_0x3534a8];return _0x7831bc;};'use strict';var _=require(_0xafad('0x0'));var util=require(_0xafad('0x1'));var logger=require(_0xafad('0x2'))(_0xafad('0x3'));var moment=require('moment');var BPromise=require(_0xafad('0x4'));var rp=require(_0xafad('0x5'));var fs=require('fs');var path=require(_0xafad('0x6'));var rimraf=require(_0xafad('0x7'));var config=require('../../config/environment');var attributes=require(_0xafad('0x8'));module[_0xafad('0x9')]=function(_0x51f0ce,_0x52d3f2){return _0x51f0ce[_0xafad('0xa')]('OpenchannelQueueReport',attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xafad('0xb'),'fields':[_0xafad('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9e1=['./openchannelQueueReport.attributes','define','OpenchannelQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1aaa22,_0x19d933){var _0xfdd5b4=function(_0x67bd67){while(--_0x67bd67){_0x1aaa22['push'](_0x1aaa22['shift']());}};_0xfdd5b4(++_0x19d933);}(_0xf9e1,0x14e));var _0x1f9e=function(_0x434c45,_0x301993){_0x434c45=_0x434c45-0x0;var _0x39b7b0=_0xf9e1[_0x434c45];return _0x39b7b0;};'use strict';var _=require(_0x1f9e('0x0'));var util=require(_0x1f9e('0x1'));var logger=require('../../config/logger')(_0x1f9e('0x2'));var moment=require(_0x1f9e('0x3'));var BPromise=require(_0x1f9e('0x4'));var rp=require(_0x1f9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1f9e('0x6'));module['exports']=function(_0x5c4d6b,_0x46e743){return _0x5c4d6b[_0x1f9e('0x7')](_0x1f9e('0x8'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1f9e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9776bfb..c12050a 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 _0x6132=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','limit','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6132,0xf3));var _0x2613=function(_0x5c4b79,_0x483a9f){_0x5c4b79=_0x5c4b79-0x0;var _0x2699c9=_0x6132[_0x5c4b79];return _0x2699c9;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var moment=require('moment');var BPromise=require(_0x2613('0x1'));var rs=require(_0x2613('0x2'));var fs=require('fs');var Redis=require(_0x2613('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2613('0x4'))('rpc');var config=require(_0x2613('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2613('0x6')][_0x2613('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1083a6,_0x546fd4,_0x43c9d4){return new BPromise(function(_0x43c876,_0x51f79d){return client['request'](_0x1083a6,_0x43c9d4)[_0x2613('0x8')](function(_0x47dfc5){logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));logger[_0x2613('0xc')](_0x2613('0xd'),_0x546fd4,_0x2613('0xb'),JSON['stringify'](_0x47dfc5));if(_0x47dfc5[_0x2613('0xe')]){if(_0x47dfc5[_0x2613('0xe')][_0x2613('0xf')]===0x1f4){logger[_0x2613('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x51f79d(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x43c876(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}else{logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));_0x43c876(_0x47dfc5[_0x2613('0x11')][_0x2613('0x10')]);}})[_0x2613('0x12')](function(_0xb99fd7){logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0xb99fd7);_0x51f79d(_0xb99fd7);});});}exports[_0x2613('0x13')]=function(_0x32e426){var _0x35279f=this;return new Promise(function(_0x5072e5,_0x8adf43){return db[_0x2613('0x14')][_0x2613('0x15')](_0x32e426[_0x2613('0x16')],{'raw':_0x32e426[_0x2613('0x17')]?_0x32e426[_0x2613('0x17')][_0x2613('0x18')]===undefined?!![]:![]:!![]})[_0x2613('0x8')](function(_0x41f86d){logger[_0x2613('0x9')](_0x2613('0x13'),_0x32e426);logger['debug'](_0x2613('0x13'),_0x32e426,JSON[_0x2613('0x19')](_0x41f86d));_0x5072e5(_0x41f86d);})[_0x2613('0x12')](function(_0x55d5c2){logger[_0x2613('0xe')]('CreateOpenchannelQueueReport',_0x55d5c2[_0x2613('0x10')],_0x32e426);_0x8adf43(_0x35279f[_0x2613('0xe')](0x1f4,_0x55d5c2[_0x2613('0x10')]));});});};exports[_0x2613('0x1a')]=function(_0x1e7e26){var _0x2cf4b7=this;return new Promise(function(_0x128aa0,_0x279fcc){return db[_0x2613('0x14')][_0x2613('0x1b')](_0x1e7e26[_0x2613('0x16')],{'raw':_0x1e7e26['options']?_0x1e7e26[_0x2613('0x17')][_0x2613('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7e26['options']?_0x1e7e26[_0x2613('0x17')]['where']||null:null,'attributes':_0x1e7e26[_0x2613('0x17')]?_0x1e7e26[_0x2613('0x17')]['attributes']||null:null,'limit':_0x1e7e26[_0x2613('0x17')]?_0x1e7e26[_0x2613('0x17')][_0x2613('0x1c')]||null:null})['then'](function(_0x55b95d){logger[_0x2613('0x9')]('UpdateOpenchannelQueueReport',_0x1e7e26);logger[_0x2613('0xc')](_0x2613('0x1a'),_0x1e7e26,JSON[_0x2613('0x19')](_0x55b95d));_0x128aa0(_0x55b95d);})[_0x2613('0x12')](function(_0x4a6008){logger[_0x2613('0xe')](_0x2613('0x1a'),_0x4a6008[_0x2613('0x10')],_0x1e7e26);_0x279fcc(_0x2cf4b7['error'](0x1f4,_0x4a6008[_0x2613('0x10')]));});});}; \ No newline at end of file +var _0xb470=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x2f5fae,_0x555535){var _0x3eb6b8=function(_0xcdf2d6){while(--_0xcdf2d6){_0x2f5fae['push'](_0x2f5fae['shift']());}};_0x3eb6b8(++_0x555535);}(_0xb470,0x75));var _0x0b47=function(_0xd8d1a0,_0x48a454){_0xd8d1a0=_0xd8d1a0-0x0;var _0x13e794=_0xb470[_0xd8d1a0];return _0x13e794;};'use strict';var _=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var moment=require(_0x0b47('0x2'));var BPromise=require(_0x0b47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b47('0x4'));var db=require(_0x0b47('0x5'))['db'];var utils=require(_0x0b47('0x6'));var logger=require('../../config/logger')(_0x0b47('0x7'));var config=require(_0x0b47('0x8'));var jayson=require(_0x0b47('0x9'));var client=jayson[_0x0b47('0xa')][_0x0b47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23d960,_0x201ab2,_0x37eb18){return new BPromise(function(_0x4bfebf,_0x56543c){return client['request'](_0x23d960,_0x37eb18)['then'](function(_0x38523d){logger[_0x0b47('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x201ab2,_0x0b47('0xd'));logger[_0x0b47('0xe')](_0x0b47('0xf'),_0x201ab2,_0x0b47('0xd'),JSON[_0x0b47('0x10')](_0x38523d));if(_0x38523d[_0x0b47('0x11')]){if(_0x38523d[_0x0b47('0x11')][_0x0b47('0x12')]===0x1f4){logger[_0x0b47('0x11')](_0x0b47('0x13'),_0x201ab2,_0x38523d['error']['message']);return _0x56543c(_0x38523d[_0x0b47('0x11')]['message']);}logger[_0x0b47('0x11')](_0x0b47('0x13'),_0x201ab2,_0x38523d['error'][_0x0b47('0x14')]);return _0x4bfebf(_0x38523d[_0x0b47('0x11')][_0x0b47('0x14')]);}else{logger[_0x0b47('0xc')](_0x0b47('0x13'),_0x201ab2,_0x0b47('0xd'));_0x4bfebf(_0x38523d[_0x0b47('0x15')][_0x0b47('0x14')]);}})[_0x0b47('0x16')](function(_0x1da847){logger['error'](_0x0b47('0x13'),_0x201ab2,_0x1da847);_0x56543c(_0x1da847);});});}exports['CreateOpenchannelQueueReport']=function(_0x11f305){var _0x1620fc=this;return new Promise(function(_0x2b1024,_0x478caa){return db[_0x0b47('0x17')]['create'](_0x11f305['body'],{'raw':_0x11f305[_0x0b47('0x18')]?_0x11f305[_0x0b47('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0b47('0x19')](function(_0x501357){logger[_0x0b47('0xc')](_0x0b47('0x1a'),_0x11f305);logger[_0x0b47('0xe')](_0x0b47('0x1a'),_0x11f305,JSON[_0x0b47('0x10')](_0x501357));_0x2b1024(_0x501357);})[_0x0b47('0x16')](function(_0x3bd7f1){logger[_0x0b47('0x11')](_0x0b47('0x1a'),_0x3bd7f1[_0x0b47('0x14')],_0x11f305);_0x478caa(_0x1620fc[_0x0b47('0x11')](0x1f4,_0x3bd7f1['message']));});});};exports[_0x0b47('0x1b')]=function(_0x11935a){var _0x4e481c=this;return new Promise(function(_0x32559d,_0x2a2287){return db[_0x0b47('0x17')][_0x0b47('0x1c')](_0x11935a['body'],{'raw':_0x11935a['options']?_0x11935a[_0x0b47('0x18')][_0x0b47('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11935a['options']?_0x11935a[_0x0b47('0x18')][_0x0b47('0x1e')]||null:null,'attributes':_0x11935a[_0x0b47('0x18')]?_0x11935a[_0x0b47('0x18')][_0x0b47('0x1f')]||null:null,'limit':_0x11935a[_0x0b47('0x18')]?_0x11935a[_0x0b47('0x18')][_0x0b47('0x20')]||null:null})[_0x0b47('0x19')](function(_0x15d877){logger[_0x0b47('0xc')]('UpdateOpenchannelQueueReport',_0x11935a);logger['debug'](_0x0b47('0x1b'),_0x11935a,JSON['stringify'](_0x15d877));_0x32559d(_0x15d877);})[_0x0b47('0x16')](function(_0x9a2cc1){logger[_0x0b47('0x11')](_0x0b47('0x1b'),_0x9a2cc1[_0x0b47('0x14')],_0x11935a);_0x2a2287(_0x4e481c['error'](0x1f4,_0x9a2cc1[_0x0b47('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 8a18810..1fc4573 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(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 10a2e63..cf31501 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 _0x423b=['STRING','agent','queue','DATE','NOW','sequelize'];(function(_0x446832,_0x12964a){var _0x2002bd=function(_0xa1de44){while(--_0xa1de44){_0x446832['push'](_0x446832['shift']());}};_0x2002bd(++_0x12964a);}(_0x423b,0x107));var _0xb423=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x423b[_0x8c43de];return _0xa6591b;};'use strict';var moment=require('moment');var Sequelize=require(_0xb423('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb423('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xb423('0x2'),_0xb423('0x3')),'allowNull':![],'defaultValue':_0xb423('0x3')},'transferredAt':{'type':Sequelize[_0xb423('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xb423('0x5')]}}; \ No newline at end of file +var _0xf4de=['exports','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x475359,_0x38636d){var _0x4ab13a=function(_0x152b9c){while(--_0x152b9c){_0x475359['push'](_0x475359['shift']());}};_0x4ab13a(++_0x38636d);}(_0xf4de,0x19f));var _0xef4d=function(_0x4b0d54,_0x32fe9f){_0x4b0d54=_0x4b0d54-0x0;var _0x48cb9b=_0xf4de[_0x4b0d54];return _0x48cb9b;};'use strict';var moment=require(_0xef4d('0x0'));var Sequelize=require('sequelize');module[_0xef4d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xef4d('0x2')](_0xef4d('0x3'),_0xef4d('0x4'),'queue'),'allowNull':![],'defaultValue':_0xef4d('0x5')},'transferredAt':{'type':Sequelize[_0xef4d('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xef4d('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index cedfaa3..c6ecfc7 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 _0x3e00=['../../config/environment','../../mysqldb','status','end','json','offset','set','reject','save','update','then','stack','name','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','pick','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x3e00,0xe7));var _0x03e0=function(_0x52755b,_0x1c23a7){_0x52755b=_0x52755b-0x0;var _0x5cd316=_0x3e00[_0x52755b];return _0x5cd316;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x03e0('0x0'));var rimraf=require(_0x03e0('0x1'));var zipdir=require(_0x03e0('0x2'));var jsonpatch=require(_0x03e0('0x3'));var rp=require('request-promise');var moment=require(_0x03e0('0x4'));var BPromise=require(_0x03e0('0x5'));var Mustache=require(_0x03e0('0x6'));var util=require(_0x03e0('0x7'));var path=require(_0x03e0('0x8'));var sox=require('sox');var csv=require(_0x03e0('0x9'));var ejs=require(_0x03e0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x03e0('0xb'));var crypto=require(_0x03e0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x03e0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03e0('0xe'));var authService=require(_0x03e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03e0('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x03e0('0x11'));var db=require(_0x03e0('0x12'))['db'];function respondWithStatusCode(_0x1001c5,_0x5eaa40){_0x5eaa40=_0x5eaa40||0xcc;return function(_0x16fc09){if(_0x16fc09){return _0x1001c5['sendStatus'](_0x5eaa40);}return _0x1001c5[_0x03e0('0x13')](_0x5eaa40)[_0x03e0('0x14')]();};}function respondWithResult(_0x5eeccc,_0x103ad8){_0x103ad8=_0x103ad8||0xc8;return function(_0x21f501){if(_0x21f501){return _0x5eeccc['status'](_0x103ad8)[_0x03e0('0x15')](_0x21f501);}};}function respondWithFilteredResult(_0x28c139,_0x38ef17){return function(_0x2109c5){if(_0x2109c5){var _0x590989=_0x2109c5['count'],_0x533e87=_0x38ef17[_0x03e0('0x16')],_0x10ceb3=_0x38ef17['offset']+_0x38ef17['limit'],_0x2989f3;if(_0x10ceb3>=_0x590989){_0x10ceb3=_0x590989;_0x2989f3=0xc8;}else{_0x2989f3=0xce;}_0x28c139[_0x03e0('0x13')](_0x2989f3);return _0x28c139[_0x03e0('0x17')]('Content-Range',_0x533e87+'-'+_0x10ceb3+'/'+_0x590989)[_0x03e0('0x15')](_0x2109c5);}return null;};}function patchUpdates(_0xe67cc1){return function(_0x22325e){try{jsonpatch['apply'](_0x22325e,_0xe67cc1,!![]);}catch(_0x5f1635){return BPromise[_0x03e0('0x18')](_0x5f1635);}return _0x22325e[_0x03e0('0x19')]();};}function saveUpdates(_0x243b90,_0x50d988){return function(_0x579d66){if(_0x579d66){return _0x579d66[_0x03e0('0x1a')](_0x243b90)[_0x03e0('0x1b')](function(_0x3b67ef){return _0x3b67ef;});}return null;};}function removeEntity(_0x10a59c,_0x4ebb33){return function(_0x622687){if(_0x622687){return _0x622687['destroy']()[_0x03e0('0x1b')](function(){_0x10a59c[_0x03e0('0x13')](0xcc)[_0x03e0('0x14')]();});}};}function handleEntityNotFound(_0x1d0fd9,_0x4a5c96){return function(_0x5f0f94){if(!_0x5f0f94){_0x1d0fd9['sendStatus'](0x194);}return _0x5f0f94;};}function handleError(_0x422731,_0x2f735b){_0x2f735b=_0x2f735b||0x1f4;return function(_0x139181){logger['error'](_0x139181[_0x03e0('0x1c')]);if(_0x139181[_0x03e0('0x1d')]){delete _0x139181[_0x03e0('0x1d')];}_0x422731['status'](_0x2f735b)['send'](_0x139181);};}exports['index']=function(_0x26f6cd,_0x5710c4){var _0x2c49bc={},_0x281157={},_0x46f083={'count':0x0,'rows':[]};var _0x1a0f12=_[_0x03e0('0x1e')](db[_0x03e0('0x1f')][_0x03e0('0x20')],function(_0x27ae18){return{'name':_0x27ae18['fieldName'],'type':_0x27ae18['type'][_0x03e0('0x21')]};});_0x281157[_0x03e0('0x22')]=_[_0x03e0('0x1e')](_0x1a0f12,_0x03e0('0x1d'));_0x281157[_0x03e0('0x23')]=_[_0x03e0('0x24')](_0x26f6cd[_0x03e0('0x23')]);_0x281157[_0x03e0('0x25')]=_[_0x03e0('0x26')](_0x281157[_0x03e0('0x22')],_0x281157['query']);_0x2c49bc['attributes']=_['intersection'](_0x281157[_0x03e0('0x22')],qs[_0x03e0('0x27')](_0x26f6cd[_0x03e0('0x23')][_0x03e0('0x27')]));_0x2c49bc[_0x03e0('0x28')]=_0x2c49bc[_0x03e0('0x28')][_0x03e0('0x29')]?_0x2c49bc['attributes']:_0x281157[_0x03e0('0x22')];if(!_0x26f6cd['query'][_0x03e0('0x2a')](_0x03e0('0x2b'))){_0x2c49bc[_0x03e0('0x2c')]=qs[_0x03e0('0x2c')](_0x26f6cd[_0x03e0('0x23')][_0x03e0('0x2c')]);_0x2c49bc[_0x03e0('0x16')]=qs[_0x03e0('0x16')](_0x26f6cd[_0x03e0('0x23')][_0x03e0('0x16')]);}_0x2c49bc['order']=qs['sort'](_0x26f6cd['query']['sort']);_0x2c49bc['where']=qs[_0x03e0('0x25')](_[_0x03e0('0x2d')](_0x26f6cd[_0x03e0('0x23')],_0x281157['filters']),_0x1a0f12);if(_0x26f6cd[_0x03e0('0x23')]['filter']){_0x2c49bc[_0x03e0('0x2e')]=_[_0x03e0('0x2f')](_0x2c49bc['where'],{'$or':_[_0x03e0('0x1e')](_0x1a0f12,function(_0x2c834b){if(_0x2c834b['type']!==_0x03e0('0x30')){var _0x1628a9={};_0x1628a9[_0x2c834b[_0x03e0('0x1d')]]={'$like':'%'+_0x26f6cd[_0x03e0('0x23')]['filter']+'%'};return _0x1628a9;}})});}_0x2c49bc=_[_0x03e0('0x2f')]({},_0x2c49bc,_0x26f6cd[_0x03e0('0x31')]);var _0x409fd1={'where':_0x2c49bc[_0x03e0('0x2e')]};return db[_0x03e0('0x1f')][_0x03e0('0x32')](_0x409fd1)[_0x03e0('0x1b')](function(_0xcd309){_0x46f083['count']=_0xcd309;if(_0x26f6cd[_0x03e0('0x23')][_0x03e0('0x33')]){_0x2c49bc[_0x03e0('0x34')]=[{'all':!![]}];}return db[_0x03e0('0x1f')]['findAll'](_0x2c49bc);})[_0x03e0('0x1b')](function(_0x5b1f5f){_0x46f083[_0x03e0('0x35')]=_0x5b1f5f;return _0x46f083;})[_0x03e0('0x1b')](respondWithFilteredResult(_0x5710c4,_0x2c49bc))[_0x03e0('0x36')](handleError(_0x5710c4,null));};exports[_0x03e0('0x37')]=function(_0x43b8f6,_0x54a3b9){var _0x34d3a9={'raw':!![],'where':{'id':_0x43b8f6[_0x03e0('0x38')]['id']}},_0x4225e6={};_0x4225e6[_0x03e0('0x22')]=_[_0x03e0('0x24')](db[_0x03e0('0x1f')][_0x03e0('0x20')]);_0x4225e6['query']=_[_0x03e0('0x24')](_0x43b8f6[_0x03e0('0x23')]);_0x4225e6['filters']=_[_0x03e0('0x26')](_0x4225e6['model'],_0x4225e6['query']);_0x34d3a9[_0x03e0('0x28')]=_[_0x03e0('0x26')](_0x4225e6['model'],qs[_0x03e0('0x27')](_0x43b8f6['query'][_0x03e0('0x27')]));_0x34d3a9[_0x03e0('0x28')]=_0x34d3a9[_0x03e0('0x28')][_0x03e0('0x29')]?_0x34d3a9[_0x03e0('0x28')]:_0x4225e6['model'];if(_0x43b8f6['query'][_0x03e0('0x33')]){_0x34d3a9[_0x03e0('0x34')]=[{'all':!![]}];}_0x34d3a9=_[_0x03e0('0x2f')]({},_0x34d3a9,_0x43b8f6['options']);return db[_0x03e0('0x1f')][_0x03e0('0x39')](_0x34d3a9)[_0x03e0('0x1b')](handleEntityNotFound(_0x54a3b9,null))[_0x03e0('0x1b')](respondWithResult(_0x54a3b9,null))['catch'](handleError(_0x54a3b9,null));};exports[_0x03e0('0x3a')]=function(_0x54e7f7,_0x19f103){return db[_0x03e0('0x1f')][_0x03e0('0x3a')](_0x54e7f7['body'],{})[_0x03e0('0x1b')](respondWithResult(_0x19f103,0xc9))['catch'](handleError(_0x19f103,null));};exports['update']=function(_0x1f7c7a,_0x17648b){if(_0x1f7c7a[_0x03e0('0x3b')]['id']){delete _0x1f7c7a[_0x03e0('0x3b')]['id'];}return db[_0x03e0('0x1f')]['find']({'where':{'id':_0x1f7c7a['params']['id']}})['then'](handleEntityNotFound(_0x17648b,null))[_0x03e0('0x1b')](saveUpdates(_0x1f7c7a[_0x03e0('0x3b')],null))[_0x03e0('0x1b')](respondWithResult(_0x17648b,null))[_0x03e0('0x36')](handleError(_0x17648b,null));};exports[_0x03e0('0x3c')]=function(_0x87bf7b,_0x4419ec){return db[_0x03e0('0x1f')]['find']({'where':{'id':_0x87bf7b['params']['id']}})[_0x03e0('0x1b')](handleEntityNotFound(_0x4419ec,null))[_0x03e0('0x1b')](removeEntity(_0x4419ec,null))['catch'](handleError(_0x4419ec,null));};exports[_0x03e0('0x3d')]=function(_0x58c96c,_0x23ab9d){return db[_0x03e0('0x1f')]['describe']()['then'](respondWithResult(_0x23ab9d,null))[_0x03e0('0x36')](handleError(_0x23ab9d,null));}; \ No newline at end of file +var _0xd826=['lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','update','params','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x53c8ff,_0x145bd9){var _0xe71aba=function(_0x464031){while(--_0x464031){_0x53c8ff['push'](_0x53c8ff['shift']());}};_0xe71aba(++_0x145bd9);}(_0xd826,0xdb));var _0x6d82=function(_0x2fdeda,_0x17d17e){_0x2fdeda=_0x2fdeda-0x0;var _0x50b0d0=_0xd826[_0x2fdeda];return _0x50b0d0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6d82('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d82('0x1'));var rp=require(_0x6d82('0x2'));var moment=require(_0x6d82('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6d82('0x4'));var util=require(_0x6d82('0x5'));var path=require(_0x6d82('0x6'));var sox=require(_0x6d82('0x7'));var csv=require('to-csv');var ejs=require(_0x6d82('0x8'));var fs=require('fs');var _=require(_0x6d82('0x9'));var squel=require('squel');var crypto=require(_0x6d82('0xa'));var jsforce=require(_0x6d82('0xb'));var deskjs=require(_0x6d82('0xc'));var toCsv=require(_0x6d82('0xd'));var querystring=require(_0x6d82('0xe'));var Papa=require(_0x6d82('0xf'));var Redis=require(_0x6d82('0x10'));var authService=require(_0x6d82('0x11'));var qs=require(_0x6d82('0x12'));var as=require(_0x6d82('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6d82('0x14'));var utils=require('../../config/utils');var config=require(_0x6d82('0x15'));var db=require(_0x6d82('0x16'))['db'];function respondWithStatusCode(_0x3afe83,_0xebf961){_0xebf961=_0xebf961||0xcc;return function(_0x135ca0){if(_0x135ca0){return _0x3afe83['sendStatus'](_0xebf961);}return _0x3afe83[_0x6d82('0x17')](_0xebf961)[_0x6d82('0x18')]();};}function respondWithResult(_0x125ca2,_0x4ed6ad){_0x4ed6ad=_0x4ed6ad||0xc8;return function(_0x5c7cd6){if(_0x5c7cd6){return _0x125ca2['status'](_0x4ed6ad)[_0x6d82('0x19')](_0x5c7cd6);}};}function respondWithFilteredResult(_0x11cb5c,_0x23ddeb){return function(_0x402051){if(_0x402051){var _0x3896d8=_0x402051['count'],_0x94364d=_0x23ddeb[_0x6d82('0x1a')],_0x1075ac=_0x23ddeb[_0x6d82('0x1a')]+_0x23ddeb[_0x6d82('0x1b')],_0x50f351;if(_0x1075ac>=_0x3896d8){_0x1075ac=_0x3896d8;_0x50f351=0xc8;}else{_0x50f351=0xce;}_0x11cb5c[_0x6d82('0x17')](_0x50f351);return _0x11cb5c[_0x6d82('0x1c')]('Content-Range',_0x94364d+'-'+_0x1075ac+'/'+_0x3896d8)[_0x6d82('0x19')](_0x402051);}return null;};}function patchUpdates(_0x193235){return function(_0x265db5){try{jsonpatch[_0x6d82('0x1d')](_0x265db5,_0x193235,!![]);}catch(_0x4b6e6a){return BPromise[_0x6d82('0x1e')](_0x4b6e6a);}return _0x265db5[_0x6d82('0x1f')]();};}function saveUpdates(_0x46bc0f,_0x479e63){return function(_0x534f46){if(_0x534f46){return _0x534f46['update'](_0x46bc0f)[_0x6d82('0x20')](function(_0xc4e4a9){return _0xc4e4a9;});}return null;};}function removeEntity(_0x9727e6,_0x2842ea){return function(_0x15243a){if(_0x15243a){return _0x15243a[_0x6d82('0x21')]()[_0x6d82('0x20')](function(){_0x9727e6[_0x6d82('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c4642,_0x568871){return function(_0x1797f7){if(!_0x1797f7){_0x4c4642[_0x6d82('0x22')](0x194);}return _0x1797f7;};}function handleError(_0xb38cbe,_0x51e453){_0x51e453=_0x51e453||0x1f4;return function(_0x4d34de){logger[_0x6d82('0x23')](_0x4d34de[_0x6d82('0x24')]);if(_0x4d34de[_0x6d82('0x25')]){delete _0x4d34de['name'];}_0xb38cbe[_0x6d82('0x17')](_0x51e453)[_0x6d82('0x26')](_0x4d34de);};}exports[_0x6d82('0x27')]=function(_0x2e4c5d,_0x1e86b2){var _0x218696={},_0x4920a1={},_0x4a6abb={'count':0x0,'rows':[]};var _0x10c537=_[_0x6d82('0x28')](db[_0x6d82('0x29')][_0x6d82('0x2a')],function(_0x41dde9){return{'name':_0x41dde9[_0x6d82('0x2b')],'type':_0x41dde9[_0x6d82('0x2c')][_0x6d82('0x2d')]};});_0x4920a1[_0x6d82('0x2e')]=_[_0x6d82('0x28')](_0x10c537,'name');_0x4920a1['query']=_[_0x6d82('0x2f')](_0x2e4c5d[_0x6d82('0x30')]);_0x4920a1[_0x6d82('0x31')]=_[_0x6d82('0x32')](_0x4920a1[_0x6d82('0x2e')],_0x4920a1[_0x6d82('0x30')]);_0x218696['attributes']=_[_0x6d82('0x32')](_0x4920a1['model'],qs[_0x6d82('0x33')](_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x33')]));_0x218696['attributes']=_0x218696[_0x6d82('0x34')]['length']?_0x218696[_0x6d82('0x34')]:_0x4920a1[_0x6d82('0x2e')];if(!_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x35')](_0x6d82('0x36'))){_0x218696['limit']=qs['limit'](_0x2e4c5d[_0x6d82('0x30')]['limit']);_0x218696['offset']=qs[_0x6d82('0x1a')](_0x2e4c5d['query']['offset']);}_0x218696['order']=qs['sort'](_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x37')]);_0x218696[_0x6d82('0x38')]=qs['filters'](_[_0x6d82('0x39')](_0x2e4c5d[_0x6d82('0x30')],_0x4920a1[_0x6d82('0x31')]),_0x10c537);if(_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x3a')]){_0x218696[_0x6d82('0x38')]=_[_0x6d82('0x3b')](_0x218696[_0x6d82('0x38')],{'$or':_[_0x6d82('0x28')](_0x10c537,function(_0x474ac1){if(_0x474ac1[_0x6d82('0x2c')]!==_0x6d82('0x3c')){var _0x19c8fb={};_0x19c8fb[_0x474ac1[_0x6d82('0x25')]]={'$like':'%'+_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x3a')]+'%'};return _0x19c8fb;}})});}_0x218696=_[_0x6d82('0x3b')]({},_0x218696,_0x2e4c5d['options']);var _0x3b3132={'where':_0x218696['where']};return db[_0x6d82('0x29')][_0x6d82('0x3d')](_0x3b3132)[_0x6d82('0x20')](function(_0x58ba86){_0x4a6abb[_0x6d82('0x3d')]=_0x58ba86;if(_0x2e4c5d[_0x6d82('0x30')][_0x6d82('0x3e')]){_0x218696[_0x6d82('0x3f')]=[{'all':!![]}];}return db[_0x6d82('0x29')][_0x6d82('0x40')](_0x218696);})[_0x6d82('0x20')](function(_0x3d4e3){_0x4a6abb[_0x6d82('0x41')]=_0x3d4e3;return _0x4a6abb;})[_0x6d82('0x20')](respondWithFilteredResult(_0x1e86b2,_0x218696))[_0x6d82('0x42')](handleError(_0x1e86b2,null));};exports[_0x6d82('0x43')]=function(_0x57c329,_0x33a9b0){var _0x1f9811={'raw':!![],'where':{'id':_0x57c329['params']['id']}},_0x15704c={};_0x15704c[_0x6d82('0x2e')]=_[_0x6d82('0x2f')](db[_0x6d82('0x29')][_0x6d82('0x2a')]);_0x15704c[_0x6d82('0x30')]=_[_0x6d82('0x2f')](_0x57c329[_0x6d82('0x30')]);_0x15704c[_0x6d82('0x31')]=_[_0x6d82('0x32')](_0x15704c[_0x6d82('0x2e')],_0x15704c[_0x6d82('0x30')]);_0x1f9811[_0x6d82('0x34')]=_['intersection'](_0x15704c[_0x6d82('0x2e')],qs[_0x6d82('0x33')](_0x57c329[_0x6d82('0x30')][_0x6d82('0x33')]));_0x1f9811['attributes']=_0x1f9811['attributes'][_0x6d82('0x44')]?_0x1f9811['attributes']:_0x15704c[_0x6d82('0x2e')];if(_0x57c329['query'][_0x6d82('0x3e')]){_0x1f9811[_0x6d82('0x3f')]=[{'all':!![]}];}_0x1f9811=_['merge']({},_0x1f9811,_0x57c329[_0x6d82('0x45')]);return db[_0x6d82('0x29')][_0x6d82('0x46')](_0x1f9811)[_0x6d82('0x20')](handleEntityNotFound(_0x33a9b0,null))[_0x6d82('0x20')](respondWithResult(_0x33a9b0,null))[_0x6d82('0x42')](handleError(_0x33a9b0,null));};exports[_0x6d82('0x47')]=function(_0x2a2063,_0x3915bb){return db[_0x6d82('0x29')][_0x6d82('0x47')](_0x2a2063[_0x6d82('0x48')],{})[_0x6d82('0x20')](respondWithResult(_0x3915bb,0xc9))['catch'](handleError(_0x3915bb,null));};exports[_0x6d82('0x49')]=function(_0x4c0302,_0x5f2ede){if(_0x4c0302[_0x6d82('0x48')]['id']){delete _0x4c0302['body']['id'];}return db[_0x6d82('0x29')][_0x6d82('0x46')]({'where':{'id':_0x4c0302[_0x6d82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f2ede,null))[_0x6d82('0x20')](saveUpdates(_0x4c0302[_0x6d82('0x48')],null))['then'](respondWithResult(_0x5f2ede,null))[_0x6d82('0x42')](handleError(_0x5f2ede,null));};exports['destroy']=function(_0x1b75db,_0x476c07){return db[_0x6d82('0x29')][_0x6d82('0x46')]({'where':{'id':_0x1b75db[_0x6d82('0x4a')]['id']}})[_0x6d82('0x20')](handleEntityNotFound(_0x476c07,null))['then'](removeEntity(_0x476c07,null))[_0x6d82('0x42')](handleError(_0x476c07,null));};exports['describe']=function(_0x1cd7d8,_0xcfeb6b){return db[_0x6d82('0x29')][_0x6d82('0x4b')]()[_0x6d82('0x20')](respondWithResult(_0xcfeb6b,null))[_0x6d82('0x42')](handleError(_0xcfeb6b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 84880ce..d24835b 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 _0x29b1=['define','report_openchannel_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x13872d,_0x1e4cc4){var _0x1e71b8=function(_0x3cd363){while(--_0x3cd363){_0x13872d['push'](_0x13872d['shift']());}};_0x1e71b8(++_0x1e4cc4);}(_0x29b1,0x13b));var _0x129b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x29b1[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x129b('0x0'))(_0x129b('0x1'));var moment=require(_0x129b('0x2'));var BPromise=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var fs=require('fs');var path=require(_0x129b('0x5'));var rimraf=require(_0x129b('0x6'));var config=require(_0x129b('0x7'));var attributes=require(_0x129b('0x8'));module[_0x129b('0x9')]=function(_0x11c23d,_0x5ca1ff){return _0x11c23d[_0x129b('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x129b('0xb'),'paranoid':![],'indexes':[{'name':_0x129b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x16ad3e,_0x1ab954){var _0x245c2e=function(_0xd7d9f2){while(--_0xd7d9f2){_0x16ad3e['push'](_0x16ad3e['shift']());}};_0x245c2e(++_0x1ab954);}(_0xb458,0x94));var _0x8b45=function(_0x1d53cd,_0x24bf78){_0x1d53cd=_0x1d53cd-0x0;var _0x3a3bb4=_0xb458[_0x1d53cd];return _0x3a3bb4;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b45('0x4'));var rimraf=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var attributes=require(_0x8b45('0x7'));module['exports']=function(_0xfe8757,_0xd23b88){return _0xfe8757[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 73291d0..04cf639 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 _0x2b99=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x467520,_0x504453){var _0x527842=function(_0x257996){while(--_0x257996){_0x467520['push'](_0x467520['shift']());}};_0x527842(++_0x504453);}(_0x2b99,0x1b3));var _0x92b9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x2b99[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x92b9('0x0'));var util=require(_0x92b9('0x1'));var moment=require(_0x92b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x92b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b9('0x4'))['db'];var utils=require(_0x92b9('0x5'));var logger=require('../../config/logger')(_0x92b9('0x6'));var config=require(_0x92b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x92b9('0x8')][_0x92b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61f37e,_0x1b1000,_0x4267b2){return new BPromise(function(_0x927fc0,_0x53e1a5){return client[_0x92b9('0xa')](_0x61f37e,_0x4267b2)[_0x92b9('0xb')](function(_0x31f8bb){logger[_0x92b9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1b1000,_0x92b9('0xd'));logger[_0x92b9('0xe')](_0x92b9('0xf'),_0x1b1000,_0x92b9('0xd'),JSON[_0x92b9('0x10')](_0x31f8bb));if(_0x31f8bb[_0x92b9('0x11')]){if(_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x12')]===0x1f4){logger[_0x92b9('0x11')](_0x92b9('0x13'),_0x1b1000,_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);return _0x53e1a5(_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);}logger[_0x92b9('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1b1000,_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);return _0x927fc0(_0x31f8bb['error']['message']);}else{logger[_0x92b9('0xc')](_0x92b9('0x13'),_0x1b1000,_0x92b9('0xd'));_0x927fc0(_0x31f8bb[_0x92b9('0x15')][_0x92b9('0x14')]);}})[_0x92b9('0x16')](function(_0x491168){logger['error'](_0x92b9('0x13'),_0x1b1000,_0x491168);_0x53e1a5(_0x491168);});});} \ No newline at end of file +var _0xc524=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','util','bluebird','ioredis'];(function(_0x3542c5,_0x3425bf){var _0x29f4f4=function(_0x4aa352){while(--_0x4aa352){_0x3542c5['push'](_0x3542c5['shift']());}};_0x29f4f4(++_0x3425bf);}(_0xc524,0x140));var _0x4c52=function(_0x1494d5,_0x22a91c){_0x1494d5=_0x1494d5-0x0;var _0x5c2e77=_0xc524[_0x1494d5];return _0x5c2e77;};'use strict';var _=require('lodash');var util=require(_0x4c52('0x0'));var moment=require('moment');var BPromise=require(_0x4c52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c52('0x2'));var db=require(_0x4c52('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c52('0x4'))(_0x4c52('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c52('0x6'));var client=jayson['client'][_0x4c52('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea7ca,_0x16fad1,_0xa9d343){return new BPromise(function(_0x38d640,_0x3f2a67){return client['request'](_0x1ea7ca,_0xa9d343)[_0x4c52('0x8')](function(_0x1d1948){logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x16fad1,'request\x20sent');logger[_0x4c52('0xb')](_0x4c52('0xc'),_0x16fad1,_0x4c52('0xd'),JSON['stringify'](_0x1d1948));if(_0x1d1948['error']){if(_0x1d1948['error'][_0x4c52('0xe')]===0x1f4){logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x1d1948['error'][_0x4c52('0x10')]);return _0x3f2a67(_0x1d1948[_0x4c52('0xf')][_0x4c52('0x10')]);}logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x1d1948[_0x4c52('0xf')][_0x4c52('0x10')]);return _0x38d640(_0x1d1948['error'][_0x4c52('0x10')]);}else{logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x16fad1,_0x4c52('0xd'));_0x38d640(_0x1d1948[_0x4c52('0x11')]['message']);}})[_0x4c52('0x12')](function(_0x2d9806){logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x2d9806);_0x3f2a67(_0x2d9806);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0c9871b..78d3fd8 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 _0x4268=['./pause.controller','get','isAuthenticated','/:id','show','create','put','update','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7a3bfe,_0x41fc9e){var _0x3829e4=function(_0x39685c){while(--_0x39685c){_0x7a3bfe['push'](_0x7a3bfe['shift']());}};_0x3829e4(++_0x41fc9e);}(_0x4268,0xf7));var _0x8426=function(_0x45e02b,_0x1d3448){_0x45e02b=_0x45e02b-0x0;var _0x3746ea=_0x4268[_0x45e02b];return _0x3746ea;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8426('0x0'));var express=require('express');var router=express[_0x8426('0x1')]();var auth=require(_0x8426('0x2'));var interaction=require(_0x8426('0x3'));var config=require(_0x8426('0x4'));var controller=require(_0x8426('0x5'));router[_0x8426('0x6')]('/',auth[_0x8426('0x7')](),controller['index']);router[_0x8426('0x6')](_0x8426('0x8'),auth['isAuthenticated'](),controller[_0x8426('0x9')]);router['post']('/',auth[_0x8426('0x7')](),controller[_0x8426('0xa')]);router[_0x8426('0xb')](_0x8426('0x8'),auth[_0x8426('0x7')](),controller[_0x8426('0xc')]);router['delete'](_0x8426('0x8'),auth[_0x8426('0x7')](),controller['destroy']);module[_0x8426('0xd')]=router; \ No newline at end of file +var _0xe0b0=['isAuthenticated','index','get','/:id','post','put','update','destroy','exports','util','path','Router','../../config/environment'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0xe0b0,0x14e));var _0x0e0b=function(_0x24d920,_0x397122){_0x24d920=_0x24d920-0x0;var _0x1ef779=_0xe0b0[_0x24d920];return _0x1ef779;};'use strict';var multer=require('multer');var util=require(_0x0e0b('0x0'));var path=require(_0x0e0b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e0b('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e0b('0x3'));var controller=require('./pause.controller');router['get']('/',auth[_0x0e0b('0x4')](),controller[_0x0e0b('0x5')]);router[_0x0e0b('0x6')](_0x0e0b('0x7'),auth[_0x0e0b('0x4')](),controller['show']);router[_0x0e0b('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e0b('0x9')](_0x0e0b('0x7'),auth['isAuthenticated'](),controller[_0x0e0b('0xa')]);router['delete'](_0x0e0b('0x7'),auth[_0x0e0b('0x4')](),controller[_0x0e0b('0xb')]);module[_0x0e0b('0xc')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 5ed407b..1914445 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 _0xff96=['name','sequelize','exports','STRING'];(function(_0x4ae5b9,_0x4a42d2){var _0x3f94f4=function(_0x324f87){while(--_0x324f87){_0x4ae5b9['push'](_0x4ae5b9['shift']());}};_0x3f94f4(++_0x4a42d2);}(_0xff96,0x179));var _0x6ff9=function(_0x2e30d8,_0x344b2c){_0x2e30d8=_0x2e30d8-0x0;var _0x347234=_0xff96[_0x2e30d8];return _0x347234;};'use strict';var Sequelize=require(_0x6ff9('0x0'));module[_0x6ff9('0x1')]={'name':{'type':Sequelize[_0x6ff9('0x2')],'unique':_0x6ff9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6ff9('0x2')]}}; \ No newline at end of file +var _0x8775=['sequelize','exports','STRING','name'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x8775,0x194));var _0x5877=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x8775[_0x2bd1ec];return _0x2f7577;};'use strict';var Sequelize=require(_0x5877('0x0'));module[_0x5877('0x1')]={'name':{'type':Sequelize[_0x5877('0x2')],'unique':_0x5877('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5877('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a986032..807920a 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 _0x4139=['save','update','then','get','Pauses','UserProfileResource','destroy','error','name','send','index','map','Pause','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','json','apply','reject'];(function(_0xefca7,_0x526dd5){var _0x58568b=function(_0x27a0a8){while(--_0x27a0a8){_0xefca7['push'](_0xefca7['shift']());}};_0x58568b(++_0x526dd5);}(_0x4139,0x84));var _0x9413=function(_0x59fa4d,_0x4c9ed4){_0x59fa4d=_0x59fa4d-0x0;var _0x190985=_0x4139[_0x59fa4d];return _0x190985;};'use strict';var pdf=require(_0x9413('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9413('0x1'));var zipdir=require(_0x9413('0x2'));var jsonpatch=require(_0x9413('0x3'));var rp=require('request-promise');var moment=require(_0x9413('0x4'));var BPromise=require(_0x9413('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9413('0x6'));var sox=require(_0x9413('0x7'));var csv=require(_0x9413('0x8'));var ejs=require(_0x9413('0x9'));var fs=require('fs');var _=require(_0x9413('0xa'));var squel=require('squel');var crypto=require(_0x9413('0xb'));var jsforce=require(_0x9413('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9413('0xd'));var Papa=require(_0x9413('0xe'));var Redis=require(_0x9413('0xf'));var authService=require(_0x9413('0x10'));var qs=require(_0x9413('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9413('0x12'))(_0x9413('0x13'));var utils=require(_0x9413('0x14'));var config=require(_0x9413('0x15'));var db=require(_0x9413('0x16'))['db'];function respondWithStatusCode(_0x2c5557,_0x54605e){_0x54605e=_0x54605e||0xcc;return function(_0xaf85f7){if(_0xaf85f7){return _0x2c5557[_0x9413('0x17')](_0x54605e);}return _0x2c5557['status'](_0x54605e)[_0x9413('0x18')]();};}function respondWithResult(_0x4537b6,_0x4edb4f){_0x4edb4f=_0x4edb4f||0xc8;return function(_0x4fc8b7){if(_0x4fc8b7){return _0x4537b6['status'](_0x4edb4f)['json'](_0x4fc8b7);}};}function respondWithFilteredResult(_0x1065fe,_0x2c7c8b){return function(_0x23f5d9){if(_0x23f5d9){var _0x298826=_0x23f5d9[_0x9413('0x19')],_0x3c7911=_0x2c7c8b[_0x9413('0x1a')],_0x95d32f=_0x2c7c8b['offset']+_0x2c7c8b[_0x9413('0x1b')],_0x53c8ec;if(_0x95d32f>=_0x298826){_0x95d32f=_0x298826;_0x53c8ec=0xc8;}else{_0x53c8ec=0xce;}_0x1065fe[_0x9413('0x1c')](_0x53c8ec);return _0x1065fe['set']('Content-Range',_0x3c7911+'-'+_0x95d32f+'/'+_0x298826)[_0x9413('0x1d')](_0x23f5d9);}return null;};}function patchUpdates(_0x156d7f){return function(_0x23559d){try{jsonpatch[_0x9413('0x1e')](_0x23559d,_0x156d7f,!![]);}catch(_0x278a23){return BPromise[_0x9413('0x1f')](_0x278a23);}return _0x23559d[_0x9413('0x20')]();};}function saveUpdates(_0x3e6ceb,_0x32b7fe){return function(_0xfe7ed){if(_0xfe7ed){return _0xfe7ed[_0x9413('0x21')](_0x3e6ceb)[_0x9413('0x22')](function(_0x3b043a){return _0x3b043a;});}return null;};}function removeEntity(_0x4456eb,_0x8a91c6){return function(_0x395453){if(_0x395453){return _0x395453['destroy']()['then'](function(){var _0x4ee026=_0x395453[_0x9413('0x23')]({'plain':!![]});var _0x393007=_0x9413('0x24');return db[_0x9413('0x25')][_0x9413('0x26')]({'where':{'type':_0x393007,'resourceId':_0x4ee026['id']}})[_0x9413('0x22')](function(){return _0x395453;});})['then'](function(){_0x4456eb[_0x9413('0x1c')](0xcc)[_0x9413('0x18')]();});}};}function handleEntityNotFound(_0x317d41,_0x2a23){return function(_0x4336c3){if(!_0x4336c3){_0x317d41['sendStatus'](0x194);}return _0x4336c3;};}function handleError(_0x415253,_0x5f53b9){_0x5f53b9=_0x5f53b9||0x1f4;return function(_0x655bec){logger[_0x9413('0x27')](_0x655bec['stack']);if(_0x655bec[_0x9413('0x28')]){delete _0x655bec[_0x9413('0x28')];}_0x415253[_0x9413('0x1c')](_0x5f53b9)[_0x9413('0x29')](_0x655bec);};}exports[_0x9413('0x2a')]=function(_0x33e254,_0x5c9715){var _0x56a027={},_0x26666e={},_0x2eb58d={'count':0x0,'rows':[]};var _0x3f2c54=_[_0x9413('0x2b')](db[_0x9413('0x2c')]['rawAttributes'],function(_0xf78cb6){return{'name':_0xf78cb6[_0x9413('0x2d')],'type':_0xf78cb6[_0x9413('0x2e')][_0x9413('0x2f')]};});_0x26666e[_0x9413('0x30')]=_[_0x9413('0x2b')](_0x3f2c54,_0x9413('0x28'));_0x26666e['query']=_[_0x9413('0x31')](_0x33e254[_0x9413('0x32')]);_0x26666e[_0x9413('0x33')]=_[_0x9413('0x34')](_0x26666e['model'],_0x26666e[_0x9413('0x32')]);_0x56a027[_0x9413('0x35')]=_[_0x9413('0x34')](_0x26666e['model'],qs[_0x9413('0x36')](_0x33e254[_0x9413('0x32')]['fields']));_0x56a027[_0x9413('0x35')]=_0x56a027['attributes'][_0x9413('0x37')]?_0x56a027[_0x9413('0x35')]:_0x26666e[_0x9413('0x30')];if(!_0x33e254[_0x9413('0x32')][_0x9413('0x38')](_0x9413('0x39'))){_0x56a027[_0x9413('0x1b')]=qs[_0x9413('0x1b')](_0x33e254[_0x9413('0x32')][_0x9413('0x1b')]);_0x56a027[_0x9413('0x1a')]=qs[_0x9413('0x1a')](_0x33e254[_0x9413('0x32')][_0x9413('0x1a')]);}_0x56a027[_0x9413('0x3a')]=qs[_0x9413('0x3b')](_0x33e254['query'][_0x9413('0x3b')]);_0x56a027['where']=qs[_0x9413('0x33')](_[_0x9413('0x3c')](_0x33e254['query'],_0x26666e[_0x9413('0x33')]),_0x3f2c54);if(_0x33e254[_0x9413('0x32')][_0x9413('0x3d')]){_0x56a027[_0x9413('0x3e')]=_[_0x9413('0x3f')](_0x56a027[_0x9413('0x3e')],{'$or':_[_0x9413('0x2b')](_0x3f2c54,function(_0x40ac57){if(_0x40ac57['type']!=='VIRTUAL'){var _0xaf7a7c={};_0xaf7a7c[_0x40ac57['name']]={'$like':'%'+_0x33e254[_0x9413('0x32')]['filter']+'%'};return _0xaf7a7c;}})});}_0x56a027=_[_0x9413('0x3f')]({},_0x56a027,_0x33e254[_0x9413('0x40')]);var _0x18e89a={'where':_0x56a027[_0x9413('0x3e')]};return db[_0x9413('0x2c')][_0x9413('0x19')](_0x18e89a)[_0x9413('0x22')](function(_0x4575ba){_0x2eb58d[_0x9413('0x19')]=_0x4575ba;if(_0x33e254['query'][_0x9413('0x41')]){_0x56a027[_0x9413('0x42')]=[{'all':!![]}];}return db['Pause'][_0x9413('0x43')](_0x56a027);})[_0x9413('0x22')](function(_0x3c40f0){_0x2eb58d[_0x9413('0x44')]=_0x3c40f0;return _0x2eb58d;})[_0x9413('0x22')](respondWithFilteredResult(_0x5c9715,_0x56a027))[_0x9413('0x45')](handleError(_0x5c9715,null));};exports[_0x9413('0x46')]=function(_0x52f355,_0x120ee0){var _0x415d36={'raw':!![],'where':{'id':_0x52f355['params']['id']}},_0x497db5={};_0x497db5[_0x9413('0x30')]=_[_0x9413('0x31')](db[_0x9413('0x2c')][_0x9413('0x47')]);_0x497db5['query']=_[_0x9413('0x31')](_0x52f355[_0x9413('0x32')]);_0x497db5[_0x9413('0x33')]=_[_0x9413('0x34')](_0x497db5[_0x9413('0x30')],_0x497db5[_0x9413('0x32')]);_0x415d36['attributes']=_[_0x9413('0x34')](_0x497db5['model'],qs[_0x9413('0x36')](_0x52f355[_0x9413('0x32')][_0x9413('0x36')]));_0x415d36[_0x9413('0x35')]=_0x415d36[_0x9413('0x35')][_0x9413('0x37')]?_0x415d36[_0x9413('0x35')]:_0x497db5[_0x9413('0x30')];if(_0x52f355['query']['includeAll']){_0x415d36['include']=[{'all':!![]}];}_0x415d36=_[_0x9413('0x3f')]({},_0x415d36,_0x52f355[_0x9413('0x40')]);return db[_0x9413('0x2c')][_0x9413('0x48')](_0x415d36)[_0x9413('0x22')](handleEntityNotFound(_0x120ee0,null))[_0x9413('0x22')](respondWithResult(_0x120ee0,null))[_0x9413('0x45')](handleError(_0x120ee0,null));};exports[_0x9413('0x49')]=function(_0x218c1c,_0x4a5ed6){return db[_0x9413('0x2c')][_0x9413('0x49')](_0x218c1c[_0x9413('0x4a')],{})['then'](function(_0x545ee0){var _0x575025=_0x218c1c[_0x9413('0x4b')][_0x9413('0x23')]({'plain':!![]});if(!_0x575025)throw new Error(_0x9413('0x4c'));if(_0x575025[_0x9413('0x4d')]===_0x9413('0x4b')){var _0xaf68ec=_0x545ee0[_0x9413('0x23')]({'plain':!![]});var _0x4305c9=_0x9413('0x24');return db[_0x9413('0x4e')]['find']({'where':{'name':_0x4305c9,'userProfileId':_0x575025['userProfileId']},'raw':!![]})[_0x9413('0x22')](function(_0x572677){if(_0x572677&&_0x572677[_0x9413('0x4f')]===0x0){return db[_0x9413('0x25')][_0x9413('0x49')]({'name':_0xaf68ec['name'],'resourceId':_0xaf68ec['id'],'type':_0x572677[_0x9413('0x28')],'sectionId':_0x572677['id']},{})['then'](function(){return _0x545ee0;});}else{return _0x545ee0;}})[_0x9413('0x45')](function(_0x198d5b){logger[_0x9413('0x27')](_0x9413('0x50'),_0x198d5b);throw _0x198d5b;});}return _0x545ee0;})['then'](respondWithResult(_0x4a5ed6,0xc9))[_0x9413('0x45')](handleError(_0x4a5ed6,null));};exports[_0x9413('0x21')]=function(_0x5b86f0,_0x3fa03a){if(_0x5b86f0[_0x9413('0x4a')]['id']){delete _0x5b86f0[_0x9413('0x4a')]['id'];}return db[_0x9413('0x2c')]['find']({'where':{'id':_0x5b86f0['params']['id']}})[_0x9413('0x22')](handleEntityNotFound(_0x3fa03a,null))['then'](saveUpdates(_0x5b86f0['body'],null))['then'](respondWithResult(_0x3fa03a,null))[_0x9413('0x45')](handleError(_0x3fa03a,null));};exports[_0x9413('0x26')]=function(_0xd1ca2f,_0x57aa50){return db[_0x9413('0x2c')][_0x9413('0x48')]({'where':{'id':_0xd1ca2f[_0x9413('0x51')]['id']}})[_0x9413('0x22')](handleEntityNotFound(_0x57aa50,null))[_0x9413('0x22')](removeEntity(_0x57aa50,null))['catch'](handleError(_0x57aa50,null));}; \ No newline at end of file +var _0xc18a=['limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','end','error','stack','name','index','map','Pause','fieldName','type','model','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','catch','show','params','keys','include','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','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','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset'];(function(_0x5267c9,_0x3a66ba){var _0x4e98bb=function(_0x5439da){while(--_0x5439da){_0x5267c9['push'](_0x5267c9['shift']());}};_0x4e98bb(++_0x3a66ba);}(_0xc18a,0x172));var _0xac18=function(_0x3394c6,_0x1d907d){_0x3394c6=_0x3394c6-0x0;var _0x25e4ec=_0xc18a[_0x3394c6];return _0x25e4ec;};'use strict';var pdf=require(_0xac18('0x0'));var emlformat=require(_0xac18('0x1'));var rimraf=require(_0xac18('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac18('0x3'));var rp=require(_0xac18('0x4'));var moment=require(_0xac18('0x5'));var BPromise=require(_0xac18('0x6'));var Mustache=require(_0xac18('0x7'));var util=require('util');var path=require(_0xac18('0x8'));var sox=require(_0xac18('0x9'));var csv=require(_0xac18('0xa'));var ejs=require(_0xac18('0xb'));var fs=require('fs');var _=require(_0xac18('0xc'));var squel=require(_0xac18('0xd'));var crypto=require(_0xac18('0xe'));var jsforce=require(_0xac18('0xf'));var deskjs=require(_0xac18('0x10'));var toCsv=require(_0xac18('0xa'));var querystring=require(_0xac18('0x11'));var Papa=require(_0xac18('0x12'));var Redis=require(_0xac18('0x13'));var authService=require(_0xac18('0x14'));var qs=require(_0xac18('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xac18('0x16'))(_0xac18('0x17'));var utils=require(_0xac18('0x18'));var config=require(_0xac18('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35179b,_0x7d24c9){_0x7d24c9=_0x7d24c9||0xcc;return function(_0x433a4f){if(_0x433a4f){return _0x35179b[_0xac18('0x1a')](_0x7d24c9);}return _0x35179b['status'](_0x7d24c9)['end']();};}function respondWithResult(_0x1ff24b,_0x4e8315){_0x4e8315=_0x4e8315||0xc8;return function(_0x5f4167){if(_0x5f4167){return _0x1ff24b[_0xac18('0x1b')](_0x4e8315)['json'](_0x5f4167);}};}function respondWithFilteredResult(_0x1af164,_0x3af8f9){return function(_0x357f00){if(_0x357f00){var _0x1e4cb5=_0x357f00[_0xac18('0x1c')],_0x14e97e=_0x3af8f9[_0xac18('0x1d')],_0x5cc79e=_0x3af8f9[_0xac18('0x1d')]+_0x3af8f9[_0xac18('0x1e')],_0x58ffd5;if(_0x5cc79e>=_0x1e4cb5){_0x5cc79e=_0x1e4cb5;_0x58ffd5=0xc8;}else{_0x58ffd5=0xce;}_0x1af164[_0xac18('0x1b')](_0x58ffd5);return _0x1af164[_0xac18('0x1f')](_0xac18('0x20'),_0x14e97e+'-'+_0x5cc79e+'/'+_0x1e4cb5)['json'](_0x357f00);}return null;};}function patchUpdates(_0x26850e){return function(_0x16079f){try{jsonpatch[_0xac18('0x21')](_0x16079f,_0x26850e,!![]);}catch(_0x3e4044){return BPromise[_0xac18('0x22')](_0x3e4044);}return _0x16079f[_0xac18('0x23')]();};}function saveUpdates(_0x35b6eb,_0x13e558){return function(_0xe8a738){if(_0xe8a738){return _0xe8a738['update'](_0x35b6eb)['then'](function(_0x301b7e){return _0x301b7e;});}return null;};}function removeEntity(_0x46f55b,_0x2de718){return function(_0x1720e0){if(_0x1720e0){return _0x1720e0[_0xac18('0x24')]()[_0xac18('0x25')](function(){var _0xb476bc=_0x1720e0[_0xac18('0x26')]({'plain':!![]});var _0x293017='Pauses';return db[_0xac18('0x27')][_0xac18('0x24')]({'where':{'type':_0x293017,'resourceId':_0xb476bc['id']}})[_0xac18('0x25')](function(){return _0x1720e0;});})[_0xac18('0x25')](function(){_0x46f55b[_0xac18('0x1b')](0xcc)[_0xac18('0x28')]();});}};}function handleEntityNotFound(_0x833e47,_0xab1bf8){return function(_0x2f2cff){if(!_0x2f2cff){_0x833e47['sendStatus'](0x194);}return _0x2f2cff;};}function handleError(_0x5a043d,_0x1c4cc9){_0x1c4cc9=_0x1c4cc9||0x1f4;return function(_0x28ae76){logger[_0xac18('0x29')](_0x28ae76[_0xac18('0x2a')]);if(_0x28ae76[_0xac18('0x2b')]){delete _0x28ae76[_0xac18('0x2b')];}_0x5a043d[_0xac18('0x1b')](_0x1c4cc9)['send'](_0x28ae76);};}exports[_0xac18('0x2c')]=function(_0x463605,_0x451f49){var _0x2eecae={},_0x3ae758={},_0x391ba0={'count':0x0,'rows':[]};var _0x20ca85=_[_0xac18('0x2d')](db[_0xac18('0x2e')]['rawAttributes'],function(_0x3199b7){return{'name':_0x3199b7[_0xac18('0x2f')],'type':_0x3199b7[_0xac18('0x30')]['key']};});_0x3ae758[_0xac18('0x31')]=_[_0xac18('0x2d')](_0x20ca85,_0xac18('0x2b'));_0x3ae758['query']=_['keys'](_0x463605['query']);_0x3ae758[_0xac18('0x32')]=_['intersection'](_0x3ae758[_0xac18('0x31')],_0x3ae758['query']);_0x2eecae[_0xac18('0x33')]=_[_0xac18('0x34')](_0x3ae758[_0xac18('0x31')],qs[_0xac18('0x35')](_0x463605[_0xac18('0x36')][_0xac18('0x35')]));_0x2eecae[_0xac18('0x33')]=_0x2eecae[_0xac18('0x33')][_0xac18('0x37')]?_0x2eecae[_0xac18('0x33')]:_0x3ae758[_0xac18('0x31')];if(!_0x463605[_0xac18('0x36')][_0xac18('0x38')](_0xac18('0x39'))){_0x2eecae[_0xac18('0x1e')]=qs[_0xac18('0x1e')](_0x463605[_0xac18('0x36')][_0xac18('0x1e')]);_0x2eecae[_0xac18('0x1d')]=qs['offset'](_0x463605[_0xac18('0x36')][_0xac18('0x1d')]);}_0x2eecae['order']=qs['sort'](_0x463605[_0xac18('0x36')][_0xac18('0x3a')]);_0x2eecae[_0xac18('0x3b')]=qs[_0xac18('0x32')](_[_0xac18('0x3c')](_0x463605[_0xac18('0x36')],_0x3ae758['filters']),_0x20ca85);if(_0x463605[_0xac18('0x36')]['filter']){_0x2eecae[_0xac18('0x3b')]=_[_0xac18('0x3d')](_0x2eecae[_0xac18('0x3b')],{'$or':_['map'](_0x20ca85,function(_0x5f5cc5){if(_0x5f5cc5['type']!=='VIRTUAL'){var _0x1453a3={};_0x1453a3[_0x5f5cc5[_0xac18('0x2b')]]={'$like':'%'+_0x463605[_0xac18('0x36')][_0xac18('0x3e')]+'%'};return _0x1453a3;}})});}_0x2eecae=_['merge']({},_0x2eecae,_0x463605[_0xac18('0x3f')]);var _0x145464={'where':_0x2eecae[_0xac18('0x3b')]};return db[_0xac18('0x2e')]['count'](_0x145464)[_0xac18('0x25')](function(_0x5d3a02){_0x391ba0['count']=_0x5d3a02;if(_0x463605[_0xac18('0x36')][_0xac18('0x40')]){_0x2eecae['include']=[{'all':!![]}];}return db['Pause'][_0xac18('0x41')](_0x2eecae);})[_0xac18('0x25')](function(_0x52fde7){_0x391ba0['rows']=_0x52fde7;return _0x391ba0;})[_0xac18('0x25')](respondWithFilteredResult(_0x451f49,_0x2eecae))[_0xac18('0x42')](handleError(_0x451f49,null));};exports[_0xac18('0x43')]=function(_0x422d95,_0x1273eb){var _0x222dad={'raw':!![],'where':{'id':_0x422d95[_0xac18('0x44')]['id']}},_0x40a596={};_0x40a596['model']=_['keys'](db[_0xac18('0x2e')]['rawAttributes']);_0x40a596[_0xac18('0x36')]=_[_0xac18('0x45')](_0x422d95[_0xac18('0x36')]);_0x40a596[_0xac18('0x32')]=_[_0xac18('0x34')](_0x40a596[_0xac18('0x31')],_0x40a596['query']);_0x222dad[_0xac18('0x33')]=_[_0xac18('0x34')](_0x40a596[_0xac18('0x31')],qs['fields'](_0x422d95[_0xac18('0x36')]['fields']));_0x222dad[_0xac18('0x33')]=_0x222dad[_0xac18('0x33')]['length']?_0x222dad[_0xac18('0x33')]:_0x40a596[_0xac18('0x31')];if(_0x422d95[_0xac18('0x36')]['includeAll']){_0x222dad[_0xac18('0x46')]=[{'all':!![]}];}_0x222dad=_[_0xac18('0x3d')]({},_0x222dad,_0x422d95[_0xac18('0x3f')]);return db[_0xac18('0x2e')][_0xac18('0x47')](_0x222dad)[_0xac18('0x25')](handleEntityNotFound(_0x1273eb,null))[_0xac18('0x25')](respondWithResult(_0x1273eb,null))[_0xac18('0x42')](handleError(_0x1273eb,null));};exports[_0xac18('0x48')]=function(_0x4bdc0d,_0x52c5b7){return db[_0xac18('0x2e')][_0xac18('0x48')](_0x4bdc0d['body'],{})[_0xac18('0x25')](function(_0x570397){var _0x26ee43=_0x4bdc0d[_0xac18('0x49')][_0xac18('0x26')]({'plain':!![]});if(!_0x26ee43)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ee43[_0xac18('0x4a')]==='user'){var _0x1e6c57=_0x570397[_0xac18('0x26')]({'plain':!![]});var _0x2c4cc8='Pauses';return db[_0xac18('0x4b')][_0xac18('0x47')]({'where':{'name':_0x2c4cc8,'userProfileId':_0x26ee43[_0xac18('0x4c')]},'raw':!![]})[_0xac18('0x25')](function(_0x5cbdfb){if(_0x5cbdfb&&_0x5cbdfb['autoAssociation']===0x0){return db[_0xac18('0x27')][_0xac18('0x48')]({'name':_0x1e6c57[_0xac18('0x2b')],'resourceId':_0x1e6c57['id'],'type':_0x5cbdfb[_0xac18('0x2b')],'sectionId':_0x5cbdfb['id']},{})[_0xac18('0x25')](function(){return _0x570397;});}else{return _0x570397;}})[_0xac18('0x42')](function(_0x2600d5){logger[_0xac18('0x29')](_0xac18('0x4d'),_0x2600d5);throw _0x2600d5;});}return _0x570397;})['then'](respondWithResult(_0x52c5b7,0xc9))[_0xac18('0x42')](handleError(_0x52c5b7,null));};exports[_0xac18('0x4e')]=function(_0x17ecbb,_0x1ba19e){if(_0x17ecbb[_0xac18('0x4f')]['id']){delete _0x17ecbb[_0xac18('0x4f')]['id'];}return db['Pause']['find']({'where':{'id':_0x17ecbb[_0xac18('0x44')]['id']}})[_0xac18('0x25')](handleEntityNotFound(_0x1ba19e,null))[_0xac18('0x25')](saveUpdates(_0x17ecbb[_0xac18('0x4f')],null))[_0xac18('0x25')](respondWithResult(_0x1ba19e,null))['catch'](handleError(_0x1ba19e,null));};exports['destroy']=function(_0x14dcd8,_0x2577b8){return db[_0xac18('0x2e')][_0xac18('0x47')]({'where':{'id':_0x14dcd8[_0xac18('0x44')]['id']}})['then'](handleEntityNotFound(_0x2577b8,null))['then'](removeEntity(_0x2577b8,null))[_0xac18('0x42')](handleError(_0x2577b8,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 32827c0..ef6586e 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 _0x93ba=['tools_pauses','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','Pause'];(function(_0x7c13ed,_0x4d9dd5){var _0x4cad66=function(_0x3db414){while(--_0x3db414){_0x7c13ed['push'](_0x7c13ed['shift']());}};_0x4cad66(++_0x4d9dd5);}(_0x93ba,0xbf));var _0xa93b=function(_0x2b380d,_0x33fb20){_0x2b380d=_0x2b380d-0x0;var _0x51298f=_0x93ba[_0x2b380d];return _0x51298f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa93b('0x0'))(_0xa93b('0x1'));var moment=require('moment');var BPromise=require(_0xa93b('0x2'));var rp=require(_0xa93b('0x3'));var fs=require('fs');var path=require(_0xa93b('0x4'));var rimraf=require(_0xa93b('0x5'));var config=require(_0xa93b('0x6'));var attributes=require(_0xa93b('0x7'));module['exports']=function(_0x26b80e,_0x204dc7){return _0x26b80e['define'](_0xa93b('0x8'),attributes,{'tableName':_0xa93b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91d3=['../../config/environment','./pause.attributes','define','Pause','tools_pauses','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1a897b,_0x33c762){var _0x54da75=function(_0x45054e){while(--_0x45054e){_0x1a897b['push'](_0x1a897b['shift']());}};_0x54da75(++_0x33c762);}(_0x91d3,0xc0));var _0x391d=function(_0x43fb6e,_0x6cdaa1){_0x43fb6e=_0x43fb6e-0x0;var _0x56a9ca=_0x91d3[_0x43fb6e];return _0x56a9ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x391d('0x0'))(_0x391d('0x1'));var moment=require(_0x391d('0x2'));var BPromise=require(_0x391d('0x3'));var rp=require(_0x391d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x391d('0x5'));var config=require(_0x391d('0x6'));var attributes=require(_0x391d('0x7'));module['exports']=function(_0x5404d3,_0x4c18e1){return _0x5404d3[_0x391d('0x8')](_0x391d('0x9'),attributes,{'tableName':_0x391d('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 033b168..6b17c6d 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 _0xb492=['ShowPause','Pause','options','raw','where','include','model','attributes','map','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0xb492,0x172));var _0x2b49=function(_0x1bfec2,_0x11ebf3){_0x1bfec2=_0x1bfec2-0x0;var _0x4a5f78=_0xb492[_0x1bfec2];return _0x4a5f78;};'use strict';var _=require('lodash');var util=require(_0x2b49('0x0'));var moment=require(_0x2b49('0x1'));var BPromise=require(_0x2b49('0x2'));var rs=require(_0x2b49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b49('0x4'));var logger=require(_0x2b49('0x5'))(_0x2b49('0x6'));var config=require(_0x2b49('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x363d21,_0x4b4d49,_0x2b745f){return new BPromise(function(_0x1b06c2,_0x349f69){return client[_0x2b49('0x9')](_0x363d21,_0x2b745f)[_0x2b49('0xa')](function(_0x597a3d){logger[_0x2b49('0xb')](_0x2b49('0xc'),_0x4b4d49,'request\x20sent');logger[_0x2b49('0xd')](_0x2b49('0xe'),_0x4b4d49,_0x2b49('0xf'),JSON['stringify'](_0x597a3d));if(_0x597a3d[_0x2b49('0x10')]){if(_0x597a3d[_0x2b49('0x10')][_0x2b49('0x11')]===0x1f4){logger[_0x2b49('0x10')](_0x2b49('0xc'),_0x4b4d49,_0x597a3d[_0x2b49('0x10')]['message']);return _0x349f69(_0x597a3d['error'][_0x2b49('0x12')]);}logger[_0x2b49('0x10')]('Pause,\x20%s,\x20%s',_0x4b4d49,_0x597a3d['error'][_0x2b49('0x12')]);return _0x1b06c2(_0x597a3d[_0x2b49('0x10')][_0x2b49('0x12')]);}else{logger['info'](_0x2b49('0xc'),_0x4b4d49,_0x2b49('0xf'));_0x1b06c2(_0x597a3d['result']['message']);}})[_0x2b49('0x13')](function(_0xa72527){logger[_0x2b49('0x10')](_0x2b49('0xc'),_0x4b4d49,_0xa72527);_0x349f69(_0xa72527);});});}exports[_0x2b49('0x14')]=function(_0x248de1){var _0xd51946=this;return new Promise(function(_0x25f0d8,_0x2034e5){return db[_0x2b49('0x15')]['find']({'raw':_0x248de1[_0x2b49('0x16')]?_0x248de1['options'][_0x2b49('0x17')]===undefined?!![]:![]:!![],'where':_0x248de1[_0x2b49('0x16')]?_0x248de1[_0x2b49('0x16')][_0x2b49('0x18')]||null:null,'attributes':_0x248de1[_0x2b49('0x16')]?_0x248de1[_0x2b49('0x16')]['attributes']||null:null,'include':_0x248de1[_0x2b49('0x16')]?_0x248de1[_0x2b49('0x16')][_0x2b49('0x19')]?_['map'](_0x248de1[_0x2b49('0x16')]['include'],function(_0x579d9e){return{'model':db[_0x579d9e[_0x2b49('0x1a')]],'as':_0x579d9e['as'],'attributes':_0x579d9e[_0x2b49('0x1b')],'include':_0x579d9e[_0x2b49('0x19')]?_[_0x2b49('0x1c')](_0x579d9e[_0x2b49('0x19')],function(_0x522591){return{'model':db[_0x522591[_0x2b49('0x1a')]],'as':_0x522591['as'],'attributes':_0x522591['attributes'],'include':_0x522591[_0x2b49('0x19')]?_[_0x2b49('0x1c')](_0x522591[_0x2b49('0x19')],function(_0x464754){return{'model':db[_0x464754['model']],'as':_0x464754['as'],'attributes':_0x464754[_0x2b49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2b49('0xa')](function(_0x1dee89){logger[_0x2b49('0xb')](_0x2b49('0x14'),_0x248de1);logger[_0x2b49('0xd')]('ShowPause',_0x248de1,JSON[_0x2b49('0x1d')](_0x1dee89));_0x25f0d8(_0x1dee89);})[_0x2b49('0x13')](function(_0x237233){logger[_0x2b49('0x10')](_0x2b49('0x14'),_0x237233[_0x2b49('0x12')],_0x248de1);_0x2034e5(_0xd51946[_0x2b49('0x10')](0x1f4,_0x237233[_0x2b49('0x12')]));});});}; \ No newline at end of file +var _0x893d=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Pause,\x20%s,\x20%s','info','catch','ShowPause','find','options','where','attributes','include','map','model','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x893d,0x180));var _0xd893=function(_0x1de047,_0x25cf3c){_0x1de047=_0x1de047-0x0;var _0x6c2b31=_0x893d[_0x1de047];return _0x6c2b31;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd893('0x0'));var rs=require(_0xd893('0x1'));var fs=require('fs');var Redis=require(_0xd893('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd893('0x3'));var logger=require(_0xd893('0x4'))(_0xd893('0x5'));var config=require(_0xd893('0x6'));var jayson=require(_0xd893('0x7'));var client=jayson[_0xd893('0x8')][_0xd893('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ed410,_0x17b233,_0x4d5527){return new BPromise(function(_0x226e79,_0x39249a){return client[_0xd893('0xa')](_0x3ed410,_0x4d5527)[_0xd893('0xb')](function(_0x3373c7){logger['info']('Pause,\x20%s,\x20%s',_0x17b233,_0xd893('0xc'));logger[_0xd893('0xd')](_0xd893('0xe'),_0x17b233,_0xd893('0xc'),JSON[_0xd893('0xf')](_0x3373c7));if(_0x3373c7[_0xd893('0x10')]){if(_0x3373c7['error'][_0xd893('0x11')]===0x1f4){logger['error']('Pause,\x20%s,\x20%s',_0x17b233,_0x3373c7[_0xd893('0x10')][_0xd893('0x12')]);return _0x39249a(_0x3373c7['error'][_0xd893('0x12')]);}logger['error'](_0xd893('0x13'),_0x17b233,_0x3373c7[_0xd893('0x10')]['message']);return _0x226e79(_0x3373c7[_0xd893('0x10')][_0xd893('0x12')]);}else{logger[_0xd893('0x14')](_0xd893('0x13'),_0x17b233,_0xd893('0xc'));_0x226e79(_0x3373c7['result'][_0xd893('0x12')]);}})[_0xd893('0x15')](function(_0x430a25){logger[_0xd893('0x10')]('Pause,\x20%s,\x20%s',_0x17b233,_0x430a25);_0x39249a(_0x430a25);});});}exports[_0xd893('0x16')]=function(_0x5bdaae){var _0x55f74=this;return new Promise(function(_0x5513fa,_0x80fdb3){return db['Pause'][_0xd893('0x17')]({'raw':_0x5bdaae[_0xd893('0x18')]?_0x5bdaae['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bdaae['options']?_0x5bdaae[_0xd893('0x18')][_0xd893('0x19')]||null:null,'attributes':_0x5bdaae[_0xd893('0x18')]?_0x5bdaae['options'][_0xd893('0x1a')]||null:null,'include':_0x5bdaae[_0xd893('0x18')]?_0x5bdaae['options'][_0xd893('0x1b')]?_[_0xd893('0x1c')](_0x5bdaae[_0xd893('0x18')][_0xd893('0x1b')],function(_0x87c0ed){return{'model':db[_0x87c0ed[_0xd893('0x1d')]],'as':_0x87c0ed['as'],'attributes':_0x87c0ed['attributes'],'include':_0x87c0ed[_0xd893('0x1b')]?_['map'](_0x87c0ed['include'],function(_0x452523){return{'model':db[_0x452523[_0xd893('0x1d')]],'as':_0x452523['as'],'attributes':_0x452523['attributes'],'include':_0x452523[_0xd893('0x1b')]?_['map'](_0x452523[_0xd893('0x1b')],function(_0x178b88){return{'model':db[_0x178b88['model']],'as':_0x178b88['as'],'attributes':_0x178b88[_0xd893('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd893('0xb')](function(_0x227e56){logger['info'](_0xd893('0x16'),_0x5bdaae);logger[_0xd893('0xd')]('ShowPause',_0x5bdaae,JSON[_0xd893('0xf')](_0x227e56));_0x5513fa(_0x227e56);})[_0xd893('0x15')](function(_0x389d65){logger['error'](_0xd893('0x16'),_0x389d65['message'],_0x5bdaae);_0x80fdb3(_0x55f74[_0xd893('0x10')](0x1f4,_0x389d65[_0xd893('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index f14fc01..b5737af 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 _0xd7ca=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','webhookPost','put','update'];(function(_0x5d0737,_0x5e0b7e){var _0xc15e1=function(_0xb50647){while(--_0xb50647){_0x5d0737['push'](_0x5d0737['shift']());}};_0xc15e1(++_0x5e0b7e);}(_0xd7ca,0x1d6));var _0xad7c=function(_0xe5397e,_0x88febf){_0xe5397e=_0xe5397e-0x0;var _0x959991=_0xd7ca[_0xe5397e];return _0x959991;};'use strict';var multer=require(_0xad7c('0x0'));var util=require(_0xad7c('0x1'));var path=require(_0xad7c('0x2'));var timeout=require(_0xad7c('0x3'));var express=require('express');var router=express[_0xad7c('0x4')]();var auth=require(_0xad7c('0x5'));var interaction=require(_0xad7c('0x6'));var config=require(_0xad7c('0x7'));var controller=require(_0xad7c('0x8'));router[_0xad7c('0x9')]('/',auth[_0xad7c('0xa')](),controller[_0xad7c('0xb')]);router[_0xad7c('0x9')](_0xad7c('0xc'),controller[_0xad7c('0xd')]);router[_0xad7c('0x9')](_0xad7c('0xe'),auth[_0xad7c('0xa')](),controller[_0xad7c('0xf')]);router['get'](_0xad7c('0x10'),auth['isAuthenticated'](),controller[_0xad7c('0x11')]);var upload=multer({'storage':multer[_0xad7c('0x12')]({'destination':function(_0x5a83e9,_0x25be56,_0x3be648){_0x3be648(null,path[_0xad7c('0x13')](config[_0xad7c('0x14')],_0xad7c('0x15')));},'filename':function(_0x4ba403,_0x11e17f,_0x5f338b){_0x11e17f[_0xad7c('0x16')]=_0x11e17f[_0xad7c('0x16')][_0xad7c('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5f338b(null,util[_0xad7c('0x18')](_0xad7c('0x19'),path['basename'](_0x11e17f[_0xad7c('0x16')],path[_0xad7c('0x1a')](_0x11e17f[_0xad7c('0x16')])),Date[_0xad7c('0x1b')](),path[_0xad7c('0x1a')](_0x11e17f[_0xad7c('0x16')])));}})});router[_0xad7c('0x1c')]('/',upload['single'](_0xad7c('0x1d')),controller[_0xad7c('0x1e')]);router[_0xad7c('0x1c')](_0xad7c('0xc'),controller[_0xad7c('0x1f')]);router[_0xad7c('0x20')](_0xad7c('0xe'),auth['isAuthenticated'](),controller[_0xad7c('0x21')]);router[_0xad7c('0x22')](_0xad7c('0xe'),auth[_0xad7c('0xa')](),controller[_0xad7c('0x22')]);module[_0xad7c('0x23')]=router; \ No newline at end of file +var _0x83f4=['extname','post','single','file','webhookPost','put','update','delete','util','path','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','show','download','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename'];(function(_0x939a09,_0x5e9b9e){var _0x85abd6=function(_0x30cfad){while(--_0x30cfad){_0x939a09['push'](_0x939a09['shift']());}};_0x85abd6(++_0x5e9b9e);}(_0x83f4,0x174));var _0x483f=function(_0x29472a,_0x1f8bf3){_0x29472a=_0x29472a-0x0;var _0x156d4f=_0x83f4[_0x29472a];return _0x156d4f;};'use strict';var multer=require('multer');var util=require(_0x483f('0x0'));var path=require(_0x483f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x483f('0x2'));var config=require(_0x483f('0x3'));var controller=require(_0x483f('0x4'));router['get']('/',auth[_0x483f('0x5')](),controller[_0x483f('0x6')]);router[_0x483f('0x7')](_0x483f('0x8'),controller[_0x483f('0x9')]);router[_0x483f('0x7')](_0x483f('0xa'),auth[_0x483f('0x5')](),controller[_0x483f('0xb')]);router['get']('/:id/download',auth[_0x483f('0x5')](),controller[_0x483f('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ac071,_0x100863,_0x14f4c0){_0x14f4c0(null,path[_0x483f('0xd')](config[_0x483f('0xe')],_0x483f('0xf')));},'filename':function(_0x3c65ef,_0x2b2f63,_0x41d465){_0x2b2f63[_0x483f('0x10')]=_0x2b2f63[_0x483f('0x10')][_0x483f('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41d465(null,util['format'](_0x483f('0x12'),path[_0x483f('0x13')](_0x2b2f63[_0x483f('0x10')],path[_0x483f('0x14')](_0x2b2f63[_0x483f('0x10')])),Date['now'](),path[_0x483f('0x14')](_0x2b2f63[_0x483f('0x10')])));}})});router[_0x483f('0x15')]('/',upload[_0x483f('0x16')](_0x483f('0x17')),controller['upload']);router[_0x483f('0x15')](_0x483f('0x8'),controller[_0x483f('0x18')]);router[_0x483f('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x483f('0x1a')]);router['delete'](_0x483f('0xa'),auth[_0x483f('0x5')](),controller[_0x483f('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d43c022..d059732 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 _0xa468=['script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','html'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xa468,0xef));var _0x8a46=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa468[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a46('0x0')]},'type':{'type':Sequelize[_0x8a46('0x1')](_0x8a46('0x2'),_0x8a46('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x8a46('0x4')]},'path':{'type':Sequelize[_0x8a46('0x0')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x8a46('0x5')],'defaultValue':0x0,'comment':_0x8a46('0x6')},'sidebar':{'type':Sequelize[_0x8a46('0x1')]('adminOnly',_0x8a46('0x7'),'always',_0x8a46('0x8')),'defaultValue':_0x8a46('0x9'),'comment':_0x8a46('0xa')},'icon':{'type':Sequelize[_0x8a46('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8a46('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x8a46('0x0')]}}; \ No newline at end of file +var _0x2d24=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','STRING','sequelize','exports','ENUM','script'];(function(_0x22e8ac,_0x785844){var _0x352a52=function(_0x4723b1){while(--_0x4723b1){_0x22e8ac['push'](_0x22e8ac['shift']());}};_0x352a52(++_0x785844);}(_0x2d24,0x151));var _0x42d2=function(_0x18de57,_0x4f45c7){_0x18de57=_0x18de57-0x0;var _0x32e9e0=_0x2d24[_0x18de57];return _0x32e9e0;};'use strict';var Sequelize=require(_0x42d2('0x0'));module[_0x42d2('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x42d2('0x2')]('html',_0x42d2('0x3'))},'description':{'type':Sequelize[_0x42d2('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x42d2('0x5')},'active':{'type':Sequelize[_0x42d2('0x6')],'defaultValue':0x0,'comment':_0x42d2('0x7')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x42d2('0x8'),'always','never'),'defaultValue':_0x42d2('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x42d2('0xa')]},'adminUrl':{'type':Sequelize[_0x42d2('0xa')]},'agentUrl':{'type':Sequelize[_0x42d2('0xa')]},'scriptName':{'type':Sequelize[_0x42d2('0xa')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5c44cbe..11d1328 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 _0x488d=['status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','download','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','**/*','join','root','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','unlinkSync','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','icon','html','admin','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','test','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','port','method','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x488d,0x1df));var _0xd488=function(_0x557f4a,_0x4bfe60){_0x557f4a=_0x557f4a-0x0;var _0x19c609=_0x488d[_0x557f4a];return _0x19c609;};'use strict';var pdf=require(_0xd488('0x0'));var emlformat=require(_0xd488('0x1'));var rimraf=require(_0xd488('0x2'));var zipdir=require(_0xd488('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd488('0x4'));var moment=require(_0xd488('0x5'));var BPromise=require(_0xd488('0x6'));var Mustache=require(_0xd488('0x7'));var util=require(_0xd488('0x8'));var path=require(_0xd488('0x9'));var sox=require(_0xd488('0xa'));var csv=require(_0xd488('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd488('0xc'));var squel=require(_0xd488('0xd'));var crypto=require(_0xd488('0xe'));var jsforce=require(_0xd488('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd488('0x10'));var Papa=require(_0xd488('0x11'));var extract=require(_0xd488('0x12'));var rimraf=require(_0xd488('0x2'));var archiver=require(_0xd488('0x13'));var Redis=require(_0xd488('0x14'));var authService=require(_0xd488('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xd488('0x16'));var hardwareService=require(_0xd488('0x17'));var logger=require(_0xd488('0x18'))(_0xd488('0x19'));var utils=require(_0xd488('0x1a'));var config=require(_0xd488('0x1b'));var db=require(_0xd488('0x1c'))['db'];config[_0xd488('0x1d')]=_['defaults'](config[_0xd488('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xd488('0x1e'))(new Redis(config[_0xd488('0x1d')]));require(_0xd488('0x1f'))[_0xd488('0x20')](socket);function respondWithStatusCode(_0x5af518,_0x40321c){_0x40321c=_0x40321c||0xcc;return function(_0x20d7dc){if(_0x20d7dc){return _0x5af518[_0xd488('0x21')](_0x40321c);}return _0x5af518[_0xd488('0x22')](_0x40321c)[_0xd488('0x23')]();};}function respondWithResult(_0x288216,_0x200694){_0x200694=_0x200694||0xc8;return function(_0x442215){if(_0x442215){return _0x288216[_0xd488('0x22')](_0x200694)[_0xd488('0x24')](_0x442215);}};}function respondWithFilteredResult(_0x49d642,_0x302b9f){return function(_0x59e1e2){if(_0x59e1e2){var _0x588474=_0x59e1e2[_0xd488('0x25')],_0x333d9d=_0x302b9f[_0xd488('0x26')],_0x1a5ef6=_0x302b9f[_0xd488('0x26')]+_0x302b9f[_0xd488('0x27')],_0x128570;if(_0x1a5ef6>=_0x588474){_0x1a5ef6=_0x588474;_0x128570=0xc8;}else{_0x128570=0xce;}_0x49d642[_0xd488('0x22')](_0x128570);return _0x49d642[_0xd488('0x28')](_0xd488('0x29'),_0x333d9d+'-'+_0x1a5ef6+'/'+_0x588474)['json'](_0x59e1e2);}return null;};}function patchUpdates(_0x510688){return function(_0x2a085c){try{jsonpatch[_0xd488('0x2a')](_0x2a085c,_0x510688,!![]);}catch(_0x466570){return BPromise['reject'](_0x466570);}return _0x2a085c[_0xd488('0x2b')]();};}function saveUpdates(_0x51b059,_0x552a79){return function(_0x55bad4){if(_0x55bad4){return _0x55bad4[_0xd488('0x2c')](_0x51b059)[_0xd488('0x2d')](function(_0x438b4a){return _0x438b4a;});}return null;};}function removeEntity(_0x5a2350,_0x5c5bab){return function(_0x1124ea){if(_0x1124ea){return _0x1124ea[_0xd488('0x2e')]()[_0xd488('0x2d')](function(){var _0x2502c1=_0x1124ea[_0xd488('0x2f')]({'plain':!![]});var _0x35b901=_0xd488('0x30');return db[_0xd488('0x31')][_0xd488('0x2e')]({'where':{'type':_0x35b901,'resourceId':_0x2502c1['id']}})[_0xd488('0x2d')](function(){return _0x1124ea;});})[_0xd488('0x2d')](function(){_0x5a2350[_0xd488('0x22')](0xcc)[_0xd488('0x23')]();});}};}function handleEntityNotFound(_0x45a980,_0x1fc037){return function(_0x570f55){if(!_0x570f55){_0x45a980[_0xd488('0x21')](0x194);}return _0x570f55;};}function handleError(_0x888de6,_0x4b1f80){_0x4b1f80=_0x4b1f80||0x1f4;return function(_0x241568){logger[_0xd488('0x32')](_0x241568[_0xd488('0x33')]);if(_0x241568[_0xd488('0x34')]){delete _0x241568[_0xd488('0x34')];}_0x888de6['status'](_0x4b1f80)[_0xd488('0x35')](_0x241568);};}exports[_0xd488('0x36')]=function(_0x3edeca,_0x7b1acc){var _0x45bbe0={},_0x126fac={},_0x1aa0d8={'count':0x0,'rows':[]};var _0x159eed=_[_0xd488('0x37')](db[_0xd488('0x38')]['rawAttributes'],function(_0x49bb9b){return{'name':_0x49bb9b['fieldName'],'type':_0x49bb9b[_0xd488('0x39')][_0xd488('0x3a')]};});_0x126fac[_0xd488('0x3b')]=_[_0xd488('0x37')](_0x159eed,_0xd488('0x34'));_0x126fac[_0xd488('0x3c')]=_['keys'](_0x3edeca[_0xd488('0x3c')]);_0x126fac['filters']=_[_0xd488('0x3d')](_0x126fac[_0xd488('0x3b')],_0x126fac['query']);_0x45bbe0[_0xd488('0x3e')]=_[_0xd488('0x3d')](_0x126fac[_0xd488('0x3b')],qs[_0xd488('0x3f')](_0x3edeca['query'][_0xd488('0x3f')]));_0x45bbe0['attributes']=_0x45bbe0[_0xd488('0x3e')][_0xd488('0x40')]?_0x45bbe0['attributes']:_0x126fac['model'];if(!_0x3edeca[_0xd488('0x3c')][_0xd488('0x41')]('nolimit')){_0x45bbe0[_0xd488('0x27')]=qs['limit'](_0x3edeca[_0xd488('0x3c')][_0xd488('0x27')]);_0x45bbe0[_0xd488('0x26')]=qs['offset'](_0x3edeca[_0xd488('0x3c')][_0xd488('0x26')]);}_0x45bbe0[_0xd488('0x42')]=qs[_0xd488('0x43')](_0x3edeca[_0xd488('0x3c')][_0xd488('0x43')]);_0x45bbe0[_0xd488('0x44')]=qs['filters'](_[_0xd488('0x45')](_0x3edeca[_0xd488('0x3c')],_0x126fac[_0xd488('0x46')]),_0x159eed);if(_0x3edeca[_0xd488('0x3c')][_0xd488('0x47')]){_0x45bbe0[_0xd488('0x44')]=_[_0xd488('0x48')](_0x45bbe0[_0xd488('0x44')],{'$or':_[_0xd488('0x37')](_0x159eed,function(_0x5ee85e){if(_0x5ee85e['type']!==_0xd488('0x49')){var _0x4e8f7b={};_0x4e8f7b[_0x5ee85e['name']]={'$like':'%'+_0x3edeca[_0xd488('0x3c')][_0xd488('0x47')]+'%'};return _0x4e8f7b;}})});}_0x45bbe0=_[_0xd488('0x48')]({},_0x45bbe0,_0x3edeca[_0xd488('0x4a')]);var _0x19f24a={'where':_0x45bbe0['where']};return db[_0xd488('0x38')][_0xd488('0x25')](_0x19f24a)[_0xd488('0x2d')](function(_0x51eff7){_0x1aa0d8[_0xd488('0x25')]=_0x51eff7;if(_0x3edeca[_0xd488('0x3c')][_0xd488('0x4b')]){_0x45bbe0[_0xd488('0x4c')]=[{'all':!![]}];}return db[_0xd488('0x38')]['findAll'](_0x45bbe0);})[_0xd488('0x2d')](function(_0x756ff){_0x1aa0d8[_0xd488('0x4d')]=_0x756ff;return _0x1aa0d8;})['then'](respondWithFilteredResult(_0x7b1acc,_0x45bbe0))['catch'](handleError(_0x7b1acc,null));};exports[_0xd488('0x4e')]=function(_0x3d1367,_0x23f9c9){var _0x49fdf9={'raw':!![],'where':{'id':_0x3d1367[_0xd488('0x4f')]['id']}},_0x5b94db={};_0x5b94db[_0xd488('0x3b')]=_[_0xd488('0x50')](db[_0xd488('0x38')]['rawAttributes']);_0x5b94db[_0xd488('0x3c')]=_[_0xd488('0x50')](_0x3d1367[_0xd488('0x3c')]);_0x5b94db['filters']=_['intersection'](_0x5b94db[_0xd488('0x3b')],_0x5b94db[_0xd488('0x3c')]);_0x49fdf9[_0xd488('0x3e')]=_['intersection'](_0x5b94db[_0xd488('0x3b')],qs[_0xd488('0x3f')](_0x3d1367[_0xd488('0x3c')][_0xd488('0x3f')]));_0x49fdf9['attributes']=_0x49fdf9['attributes'][_0xd488('0x40')]?_0x49fdf9['attributes']:_0x5b94db[_0xd488('0x3b')];if(_0x3d1367[_0xd488('0x3c')][_0xd488('0x4b')]){_0x49fdf9[_0xd488('0x4c')]=[{'all':!![]}];}_0x49fdf9=_[_0xd488('0x48')]({},_0x49fdf9,_0x3d1367[_0xd488('0x4a')]);return db[_0xd488('0x38')][_0xd488('0x51')](_0x49fdf9)['then'](handleEntityNotFound(_0x23f9c9,null))['then'](respondWithResult(_0x23f9c9,null))[_0xd488('0x52')](handleError(_0x23f9c9,null));};exports[_0xd488('0x53')]=function(_0x39a2d0,_0x502e7b,_0x664d3){return db[_0xd488('0x38')][_0xd488('0x51')]({'where':{'id':_0x39a2d0['params']['id']},'attributes':[_0xd488('0x34'),_0xd488('0x9')],'raw':!![]})[_0xd488('0x2d')](handleEntityNotFound(_0x502e7b,null))[_0xd488('0x2d')](function(_0x3e08da){if(_0x3e08da){var _0x289c9f=path['join'](config['root'],'server/files/plugins',util[_0xd488('0x54')](_0xd488('0x55'),path[_0xd488('0x56')](_0x3e08da['path'])));var _0x26f1ea=fs[_0xd488('0x57')](_0x289c9f);var _0x1fd24f=archiver(_0xd488('0x58'),{'zlib':{'level':0x9}});_0x1fd24f['on'](_0xd488('0x59'),function(_0x3625ae){if(_0x3625ae[_0xd488('0x5a')]===_0xd488('0x5b')){logger[_0xd488('0x32')](_0x3625ae);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1fd24f['on'](_0xd488('0x32'),function(_0x3d26f1){throw new db[(_0xd488('0x5c'))][(_0xd488('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1fd24f[_0xd488('0x5e')](_0x26f1ea);_0x1fd24f['glob'](_0xd488('0x5f'),{'cwd':path[_0xd488('0x60')](config[_0xd488('0x61')],_0xd488('0x62'),path[_0xd488('0x63')](_0x3e08da['path'])),'ignore':[path[_0xd488('0x60')](path[_0xd488('0x56')](_0x3e08da['path']),_0xd488('0x64')),path[_0xd488('0x60')](path[_0xd488('0x56')](_0x3e08da[_0xd488('0x9')]),_0xd488('0x65'))],'nodir':!![]})[_0xd488('0x66')]();_0x26f1ea['on']('close',function(){if(!fs[_0xd488('0x67')](_0x289c9f)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x502e7b[_0xd488('0x53')](_0x289c9f,util[_0xd488('0x54')](_0xd488('0x55'),path[_0xd488('0x56')](_0x3e08da[_0xd488('0x9')])),function(_0x235527){if(_0x235527){throw new db[(_0xd488('0x5c'))][(_0xd488('0x5d'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xd488('0x68')](_0x289c9f);logger[_0xd488('0x69')](_0xd488('0x6a'));logger[_0xd488('0x69')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x502e7b,null));};exports[_0xd488('0x6b')]=function(_0x5e4a04,_0x5e518f,_0x3ee4fa){var _0x164f54=path[_0xd488('0x56')](_0x5e4a04[_0xd488('0x6c')][_0xd488('0x6d')],path['extname'](_0x5e4a04[_0xd488('0x6c')]['filename']));var _0x1aaee7=path[_0xd488('0x60')](config[_0xd488('0x61')],_0xd488('0x62'),_0x5e4a04[_0xd488('0x6c')][_0xd488('0x6d')]);var _0x5282da=path[_0xd488('0x60')](config[_0xd488('0x61')],_0xd488('0x62'),_0x164f54);logger[_0xd488('0x69')](_0xd488('0x6e'),_0x1aaee7);logger[_0xd488('0x69')](_0xd488('0x6f'),_0x5282da);try{fs[_0xd488('0x70')](_0x1aaee7,parseInt(_0xd488('0x71'),0x8));extract(_0x1aaee7,{'dir':_0x5282da},function(_0x1d932a){if(_0x1d932a){logger['error'](_0x1d932a);handleError(_0x1d932a,!![]);};var _0x1d2490=fs['readdirSync'](_0x5282da);if(_0x1d2490[_0xd488('0x40')]>0x1){removeReferences(_0x1aaee7,_0x5282da);logger['error'](_0xd488('0x72'));return _0x3ee4fa(new Error('Invalid\x20plugin\x20structure'));}var _0x317c04=fs[_0xd488('0x73')](path[_0xd488('0x60')](_0x5282da,_0x1d2490[0x0]));if(_0x317c04[_0xd488('0x74')]()){removeReferences(_0x1aaee7,_0x5282da);logger[_0xd488('0x32')](_0xd488('0x72'));return _0x3ee4fa(new Error(_0xd488('0x72')));}if(_0x317c04[_0xd488('0x75')]()){var _0x4956a2=fs[_0xd488('0x76')](path[_0xd488('0x60')](_0x5282da,_0x1d2490[0x0]));if(_0x4956a2['length']===0x0){removeReferences(_0x1aaee7,_0x5282da);logger[_0xd488('0x32')](_0xd488('0x72'));return _0x3ee4fa(new Error(_0xd488('0x72')));}var _0x208583=_0x4956a2[_0xd488('0x77')](function(_0x555804){return _0x555804===_0xd488('0x78');});if(!_0x208583){return _0x3ee4fa(new Error('Plugin\x20manifest\x20missing'));}var _0x3d7955=fs['readFileSync'](path['join'](_0x5282da,_0x1d2490[0x0],_0xd488('0x78')));var _0x21c388=JSON[_0xd488('0x79')](_0x3d7955);if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x34')]){return _0x3ee4fa(new Error(_0xd488('0x7b')));}if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x39')]){return _0x3ee4fa(new Error(_0xd488('0x7c')));}if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7d')]){return _0x3ee4fa(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')]){return _0x3ee4fa(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x21c388['type']==='html'){if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x7f')]){return _0x3ee4fa(new Error(_0xd488('0x80')));}if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x7f')]['admin']&&_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x7f')]['agent']){return _0x3ee4fa(new Error(_0xd488('0x81')));}}else if(_0x21c388[_0xd488('0x39')]==='script'){if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x82')]){return _0x3ee4fa(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xd488('0x7a')==typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x83')]){return _0x3ee4fa(new Error(_0xd488('0x84')));}}else{return _0x3ee4fa(new Error(_0xd488('0x85')));}var _0xd86993=_0x21c388[_0xd488('0x34')];var _0x1b8948=_0x21c388[_0xd488('0x86')];var _0x12d4b7=_0x21c388[_0xd488('0x39')];var _0x477db6=_0x21c388['sidebar']?_0x21c388['sidebar']:'always';var _0x2221d8=_0x21c388[_0xd488('0x87')]?_0x21c388[_0xd488('0x87')]:'icon-apps';var _0x308e17='';var _0x47ce9c='';var _0x1a4d69='';var _0x32c604='';var _0x422fcb=_0x21c388['version'];if(_0x12d4b7===_0xd488('0x88')){if(_0xd488('0x7a')!=typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x7f')][_0xd488('0x89')]){var _0x29aa75=_0x21c388[_0xd488('0x7e')][_0xd488('0x7f')][_0xd488('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x29aa75)){_0x308e17=path[_0xd488('0x60')]('plugins',_0x164f54,_0x1d2490[0x0],_0x29aa75);}else{_0x308e17=_0x29aa75;}}else{logger[_0xd488('0x69')](_0xd488('0x8a'));}if(_0xd488('0x7a')!=typeof _0x21c388['parameters']['views'][_0xd488('0x8b')]){var _0x218237=_0x21c388[_0xd488('0x7e')][_0xd488('0x7f')][_0xd488('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x218237)){_0x47ce9c=path['join'](_0xd488('0x8c'),_0x164f54,_0x1d2490[0x0],_0x218237);}else{_0x47ce9c=_0x218237;}}else{logger[_0xd488('0x69')](_0xd488('0x8d'));}}else if(_0x12d4b7===_0xd488('0x8e')){_0x1a4d69=_0x21c388[_0xd488('0x7e')][_0xd488('0x82')];_0x32c604=_0x21c388[_0xd488('0x7e')][_0xd488('0x83')];if(_0xd488('0x7a')!=typeof _0x21c388[_0xd488('0x7e')][_0xd488('0x7f')]){if(_0xd488('0x7a')!=typeof _0x21c388[_0xd488('0x7e')]['views'][_0xd488('0x89')]){var _0x29aa75=_0x21c388['parameters'][_0xd488('0x7f')][_0xd488('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xd488('0x8f')](_0x29aa75)){_0x308e17=path['join']('plugins',_0x164f54,_0x1d2490[0x0],_0x29aa75);}else{_0x308e17=_0x29aa75;}}if(_0xd488('0x7a')!=typeof _0x21c388['parameters']['views'][_0xd488('0x8b')]){var _0x218237=_0x21c388[_0xd488('0x7e')][_0xd488('0x7f')][_0xd488('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xd488('0x8f')](_0x218237)){_0x47ce9c=path[_0xd488('0x60')]('plugins',_0x164f54,_0x1d2490[0x0],_0x218237);}else{_0x47ce9c=_0x218237;}}}}var _0x5676ec={'name':_0xd86993,'description':_0x1b8948,'path':path['join'](_0x164f54,_0x1d2490[0x0]),'type':_0x12d4b7,'sidebar':_0x477db6,'icon':_0x2221d8,'adminUrl':_0x308e17,'agentUrl':_0x47ce9c,'scriptName':_0x1a4d69,'scriptPath':_0x32c604,'version':_0x422fcb};removeReferences(_0x1aaee7,null);return db[_0xd488('0x38')][_0xd488('0x90')](_0x5676ec)[_0xd488('0x2d')](function(_0x1d89cf){var _0x17ed7d={'role':_0x5e4a04[_0xd488('0x91')]['role'],'userProfileId':_0x5e4a04['body'][_0xd488('0x92')]};if(!_0x17ed7d)throw new Error(_0xd488('0x93'));if(_0x17ed7d[_0xd488('0x94')]===_0xd488('0x95')){var _0x3909cb=_0x1d89cf[_0xd488('0x2f')]({'plain':!![]});return db[_0xd488('0x96')]['find']({'where':{'name':_0xd488('0x30'),'userProfileId':_0x17ed7d[_0xd488('0x92')]},'raw':!![]})['then'](function(_0x2f6f17){if(_0x2f6f17&&_0x2f6f17[_0xd488('0x97')]===0x0){return db[_0xd488('0x31')][_0xd488('0x90')]({'name':_0x3909cb[_0xd488('0x34')],'resourceId':_0x3909cb['id'],'type':_0x2f6f17[_0xd488('0x34')],'sectionId':_0x2f6f17['id']},{})[_0xd488('0x2d')](function(){return _0x1d89cf;});}else{return _0x1d89cf;}})[_0xd488('0x52')](function(_0x3359b9){logger[_0xd488('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3359b9);throw _0x3359b9;});}return _0x1d89cf;})[_0xd488('0x2d')](respondWithResult(_0x5e518f,null))[_0xd488('0x52')](handleError(_0x5e518f,null));}});}catch(_0x493c4d){_0x5e518f[_0xd488('0x22')](0x1f4)[_0xd488('0x35')](_0x493c4d);}};function removeReferences(_0x21c39c,_0x42b08b){try{if(_0x21c39c){fs['unlinkSync'](_0x21c39c);logger[_0xd488('0x69')](_0xd488('0x98'));}if(_0x42b08b){rimraf(_0x42b08b,function(){});logger['info'](_0xd488('0x99'));}}catch(_0x43300d){logger[_0xd488('0x32')](_0x43300d);}}exports[_0xd488('0x2c')]=function(_0x1d417e,_0x299f8a,_0x63c3e){return db[_0xd488('0x38')]['find']({'where':{'id':_0x1d417e['params']['id']}})['then'](handleEntityNotFound(_0x299f8a,null))[_0xd488('0x2d')](saveUpdates(_0x1d417e[_0xd488('0x91')],null))['then'](respondWithResult(_0x299f8a,null))['catch'](handleError(_0x299f8a,null));};exports[_0xd488('0x9a')]=function(_0xb2b68e,_0x466168,_0x4d1a17){return db[_0xd488('0x38')][_0xd488('0x51')]({'where':{'id':_0xb2b68e[_0xd488('0x4f')]['id']}})[_0xd488('0x2d')](function(_0x29974d){if(_0x29974d){return _0x29974d[_0xd488('0x2e')]();}})[_0xd488('0x2d')](function(_0x2b649a){rimraf(path[_0xd488('0x60')](config[_0xd488('0x61')],_0xd488('0x62'),path[_0xd488('0x63')](_0x2b649a[_0xd488('0x9')])),function(){});return _0x2b649a;})['then'](handleEntityNotFound(_0x466168,null))[_0xd488('0x2d')](respondWithStatusCode(_0x466168,null))['catch'](handleError(_0x466168,null));};exports[_0xd488('0x9b')]=function(_0x250f95,_0x365b47,_0x168166){return BPromise[_0xd488('0x9c')]()[_0xd488('0x2d')](function(){if(!_0x250f95[_0xd488('0x3c')][_0xd488('0x9')]){throw new Error(_0xd488('0x9d'));}if(!_0x250f95[_0xd488('0x3c')]['port']){throw new Error(_0xd488('0x9e'));}var _0xba8c81=_0x250f95[_0xd488('0x3c')][_0xd488('0x9f')]?_0x250f95['query'][_0xd488('0x9f')]+':'+_0x250f95[_0xd488('0x3c')]['port']:_0xd488('0xa0')+_0x250f95['query']['port'];var _0x4a4684=_0x250f95[_0xd488('0x3c')][_0xd488('0x24')]?_0x250f95['query'][_0xd488('0x24')]:!![];var _0x2776ac=_0x250f95['query'][_0xd488('0xa1')]?_0x250f95[_0xd488('0x3c')][_0xd488('0xa1')]:null;var _0x3bb707={'method':_0x250f95['method'],'uri':util[_0xd488('0x54')](_0xd488('0xa2'),_0xba8c81,_0x250f95[_0xd488('0x3c')][_0xd488('0x9')]),'json':_0x4a4684,'resolveWithFullResponse':!![],'encoding':_0x2776ac,'qs':_0x250f95[_0xd488('0x3c')]};if(_0x250f95[_0xd488('0xa3')]){_0x3bb707[_0xd488('0xa3')]=_0x250f95[_0xd488('0xa3')];if(_0x3bb707[_0xd488('0xa3')][_0xd488('0xa4')]){delete _0x3bb707[_0xd488('0xa3')][_0xd488('0xa4')];}}if(_0x3bb707[_0xd488('0xa3')]['content-type']){delete _0x3bb707[_0xd488('0xa3')][_0xd488('0xa5')];}return rp(_0x3bb707);})[_0xd488('0x2d')](function(_0x4018f1){if(_0x4018f1){_0x365b47[_0xd488('0x28')](_0x4018f1[_0xd488('0xa3')]);logger[_0xd488('0x69')](_0x4018f1['body']);if(_[_0xd488('0xa6')](_0x250f95[_0xd488('0x3c')]['path'],_0xd488('0x53'))&&_0x4018f1[_0xd488('0xa7')]==0x1f4){return _0x365b47[_0xd488('0x21')](_0x4018f1[_0xd488('0xa7')]);}else{return _0x365b47[_0xd488('0x22')](_0x4018f1['statusCode'])['send'](_0x4018f1[_0xd488('0x91')]);}}else{return _0x365b47[_0xd488('0x21')](0xc8);}})[_0xd488('0x52')](handleError(_0x365b47,null));};exports[_0xd488('0xa8')]=function(_0x3bc584,_0x2405cc,_0x3d5f9f){return BPromise[_0xd488('0x9c')]()[_0xd488('0x2d')](function(){if(!_0x3bc584[_0xd488('0x3c')][_0xd488('0x9')]){throw new Error(_0xd488('0x9d'));}if(!_0x3bc584[_0xd488('0x3c')][_0xd488('0xa9')]){throw new Error(_0xd488('0x9e'));}var _0x48fd51=_0x3bc584['query'][_0xd488('0x9f')]?_0x3bc584[_0xd488('0x3c')]['hostname']+':'+_0x3bc584[_0xd488('0x3c')]['port']:_0xd488('0xa0')+_0x3bc584[_0xd488('0x3c')]['port'];var _0x56c66b=_0x3bc584['query']['json']?_0x3bc584[_0xd488('0x3c')]['json']:!![];var _0x126946=_0x3bc584[_0xd488('0x3c')][_0xd488('0xa1')]?_0x3bc584[_0xd488('0x3c')]['encoding']:null;var _0x1ffbcf={'method':_0x3bc584[_0xd488('0xaa')],'uri':util['format'](_0xd488('0xa2'),_0x48fd51,_0x3bc584[_0xd488('0x3c')][_0xd488('0x9')]),'json':_0x56c66b,'resolveWithFullResponse':!![],'encoding':_0x126946,'body':_0x3bc584[_0xd488('0x91')]};if(_0x3bc584[_0xd488('0xa3')]){_0x1ffbcf['headers']=_0x3bc584[_0xd488('0xa3')];if(_0x1ffbcf[_0xd488('0xa3')][_0xd488('0xa4')]){delete _0x1ffbcf['headers']['content-length'];}}if(_0x1ffbcf[_0xd488('0xa3')][_0xd488('0xa5')]){delete _0x1ffbcf[_0xd488('0xa3')][_0xd488('0xa5')];}return rp(_0x1ffbcf);})[_0xd488('0x2d')](function(_0x3d28ba){if(_0x3d28ba){_0x2405cc['set'](_0x3d28ba[_0xd488('0xa3')]);logger[_0xd488('0x69')](_0x3d28ba['body']);return _0x2405cc[_0xd488('0x22')](_0x3d28ba[_0xd488('0xa7')])[_0xd488('0x35')](_0x3d28ba[_0xd488('0x91')]);}else{return _0x2405cc['sendStatus'](0xc8);}})[_0xd488('0x52')](handleError(_0x2405cc,null));}; \ No newline at end of file +var _0x6f84=['Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','register','status','end','count','offset','limit','set','json','apply','reject','destroy','get','Plugins','UserProfileResource','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','catch','show','params','keys','fields','find','download','join','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','root','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins'];(function(_0x2c3d28,_0x10ae74){var _0x5ac957=function(_0x29fd1b){while(--_0x29fd1b){_0x2c3d28['push'](_0x2c3d28['shift']());}};_0x5ac957(++_0x10ae74);}(_0x6f84,0xc7));var _0x46f8=function(_0x4e11a9,_0x108cda){_0x4e11a9=_0x4e11a9-0x0;var _0x1a8970=_0x6f84[_0x4e11a9];return _0x1a8970;};'use strict';var pdf=require(_0x46f8('0x0'));var emlformat=require(_0x46f8('0x1'));var rimraf=require(_0x46f8('0x2'));var zipdir=require(_0x46f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x46f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46f8('0x5'));var util=require('util');var path=require(_0x46f8('0x6'));var sox=require(_0x46f8('0x7'));var csv=require(_0x46f8('0x8'));var ejs=require(_0x46f8('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x46f8('0xa'));var crypto=require(_0x46f8('0xb'));var jsforce=require(_0x46f8('0xc'));var deskjs=require(_0x46f8('0xd'));var toCsv=require(_0x46f8('0x8'));var querystring=require('querystring');var Papa=require(_0x46f8('0xe'));var extract=require(_0x46f8('0xf'));var rimraf=require(_0x46f8('0x2'));var archiver=require(_0x46f8('0x10'));var Redis=require(_0x46f8('0x11'));var authService=require(_0x46f8('0x12'));var qs=require(_0x46f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x46f8('0x14'))(_0x46f8('0x15'));var utils=require(_0x46f8('0x16'));var config=require(_0x46f8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x46f8('0x18')](config['redis'],{'host':_0x46f8('0x19'),'port':0x18eb});var socket=require(_0x46f8('0x1a'))(new Redis(config['redis']));require('./plugin.socket')[_0x46f8('0x1b')](socket);function respondWithStatusCode(_0x2fea8e,_0x4c4a51){_0x4c4a51=_0x4c4a51||0xcc;return function(_0x1a41ac){if(_0x1a41ac){return _0x2fea8e['sendStatus'](_0x4c4a51);}return _0x2fea8e[_0x46f8('0x1c')](_0x4c4a51)[_0x46f8('0x1d')]();};}function respondWithResult(_0x1e6223,_0x48600){_0x48600=_0x48600||0xc8;return function(_0x3cf14f){if(_0x3cf14f){return _0x1e6223[_0x46f8('0x1c')](_0x48600)['json'](_0x3cf14f);}};}function respondWithFilteredResult(_0x3273f8,_0x1b4ac4){return function(_0x30878f){if(_0x30878f){var _0x1580d7=_0x30878f[_0x46f8('0x1e')],_0x10e5d2=_0x1b4ac4[_0x46f8('0x1f')],_0x58509c=_0x1b4ac4['offset']+_0x1b4ac4[_0x46f8('0x20')],_0x45560d;if(_0x58509c>=_0x1580d7){_0x58509c=_0x1580d7;_0x45560d=0xc8;}else{_0x45560d=0xce;}_0x3273f8[_0x46f8('0x1c')](_0x45560d);return _0x3273f8[_0x46f8('0x21')]('Content-Range',_0x10e5d2+'-'+_0x58509c+'/'+_0x1580d7)[_0x46f8('0x22')](_0x30878f);}return null;};}function patchUpdates(_0xfd33b2){return function(_0x5e5ffe){try{jsonpatch[_0x46f8('0x23')](_0x5e5ffe,_0xfd33b2,!![]);}catch(_0x5a1539){return BPromise[_0x46f8('0x24')](_0x5a1539);}return _0x5e5ffe['save']();};}function saveUpdates(_0x3a4500,_0x42b8c6){return function(_0x254fec){if(_0x254fec){return _0x254fec['update'](_0x3a4500)['then'](function(_0x39f342){return _0x39f342;});}return null;};}function removeEntity(_0x3e8c61,_0x5a80dc){return function(_0x11b305){if(_0x11b305){return _0x11b305[_0x46f8('0x25')]()['then'](function(){var _0x9d96d3=_0x11b305[_0x46f8('0x26')]({'plain':!![]});var _0x5217c=_0x46f8('0x27');return db[_0x46f8('0x28')][_0x46f8('0x25')]({'where':{'type':_0x5217c,'resourceId':_0x9d96d3['id']}})['then'](function(){return _0x11b305;});})[_0x46f8('0x29')](function(){_0x3e8c61[_0x46f8('0x1c')](0xcc)[_0x46f8('0x1d')]();});}};}function handleEntityNotFound(_0xcc9917,_0x413819){return function(_0x58b4df){if(!_0x58b4df){_0xcc9917[_0x46f8('0x2a')](0x194);}return _0x58b4df;};}function handleError(_0x1daaa1,_0xf882c1){_0xf882c1=_0xf882c1||0x1f4;return function(_0x8b6628){logger['error'](_0x8b6628[_0x46f8('0x2b')]);if(_0x8b6628['name']){delete _0x8b6628[_0x46f8('0x2c')];}_0x1daaa1['status'](_0xf882c1)[_0x46f8('0x2d')](_0x8b6628);};}exports[_0x46f8('0x2e')]=function(_0x2d24ca,_0x3bb767){var _0x314a67={},_0x36db6f={},_0x179eff={'count':0x0,'rows':[]};var _0x144f95=_[_0x46f8('0x2f')](db['Plugin'][_0x46f8('0x30')],function(_0xdfcd4f){return{'name':_0xdfcd4f[_0x46f8('0x31')],'type':_0xdfcd4f[_0x46f8('0x32')][_0x46f8('0x33')]};});_0x36db6f[_0x46f8('0x34')]=_[_0x46f8('0x2f')](_0x144f95,_0x46f8('0x2c'));_0x36db6f[_0x46f8('0x35')]=_['keys'](_0x2d24ca[_0x46f8('0x35')]);_0x36db6f[_0x46f8('0x36')]=_[_0x46f8('0x37')](_0x36db6f['model'],_0x36db6f[_0x46f8('0x35')]);_0x314a67[_0x46f8('0x38')]=_['intersection'](_0x36db6f[_0x46f8('0x34')],qs['fields'](_0x2d24ca[_0x46f8('0x35')]['fields']));_0x314a67['attributes']=_0x314a67[_0x46f8('0x38')][_0x46f8('0x39')]?_0x314a67[_0x46f8('0x38')]:_0x36db6f['model'];if(!_0x2d24ca[_0x46f8('0x35')][_0x46f8('0x3a')](_0x46f8('0x3b'))){_0x314a67['limit']=qs[_0x46f8('0x20')](_0x2d24ca[_0x46f8('0x35')][_0x46f8('0x20')]);_0x314a67[_0x46f8('0x1f')]=qs['offset'](_0x2d24ca[_0x46f8('0x35')][_0x46f8('0x1f')]);}_0x314a67['order']=qs[_0x46f8('0x3c')](_0x2d24ca[_0x46f8('0x35')]['sort']);_0x314a67[_0x46f8('0x3d')]=qs[_0x46f8('0x36')](_[_0x46f8('0x3e')](_0x2d24ca[_0x46f8('0x35')],_0x36db6f['filters']),_0x144f95);if(_0x2d24ca[_0x46f8('0x35')][_0x46f8('0x3f')]){_0x314a67[_0x46f8('0x3d')]=_[_0x46f8('0x40')](_0x314a67[_0x46f8('0x3d')],{'$or':_[_0x46f8('0x2f')](_0x144f95,function(_0x4b5895){if(_0x4b5895['type']!==_0x46f8('0x41')){var _0x4e3f3c={};_0x4e3f3c[_0x4b5895[_0x46f8('0x2c')]]={'$like':'%'+_0x2d24ca[_0x46f8('0x35')]['filter']+'%'};return _0x4e3f3c;}})});}_0x314a67=_[_0x46f8('0x40')]({},_0x314a67,_0x2d24ca[_0x46f8('0x42')]);var _0x5a9e15={'where':_0x314a67[_0x46f8('0x3d')]};return db[_0x46f8('0x43')][_0x46f8('0x1e')](_0x5a9e15)['then'](function(_0x33d567){_0x179eff[_0x46f8('0x1e')]=_0x33d567;if(_0x2d24ca[_0x46f8('0x35')][_0x46f8('0x44')]){_0x314a67[_0x46f8('0x45')]=[{'all':!![]}];}return db['Plugin'][_0x46f8('0x46')](_0x314a67);})[_0x46f8('0x29')](function(_0x28851e){_0x179eff['rows']=_0x28851e;return _0x179eff;})[_0x46f8('0x29')](respondWithFilteredResult(_0x3bb767,_0x314a67))[_0x46f8('0x47')](handleError(_0x3bb767,null));};exports[_0x46f8('0x48')]=function(_0x3783a8,_0x18d863){var _0x187fd2={'raw':!![],'where':{'id':_0x3783a8[_0x46f8('0x49')]['id']}},_0x219029={};_0x219029[_0x46f8('0x34')]=_[_0x46f8('0x4a')](db[_0x46f8('0x43')][_0x46f8('0x30')]);_0x219029[_0x46f8('0x35')]=_[_0x46f8('0x4a')](_0x3783a8[_0x46f8('0x35')]);_0x219029[_0x46f8('0x36')]=_[_0x46f8('0x37')](_0x219029[_0x46f8('0x34')],_0x219029[_0x46f8('0x35')]);_0x187fd2[_0x46f8('0x38')]=_[_0x46f8('0x37')](_0x219029[_0x46f8('0x34')],qs[_0x46f8('0x4b')](_0x3783a8[_0x46f8('0x35')][_0x46f8('0x4b')]));_0x187fd2['attributes']=_0x187fd2[_0x46f8('0x38')][_0x46f8('0x39')]?_0x187fd2[_0x46f8('0x38')]:_0x219029[_0x46f8('0x34')];if(_0x3783a8[_0x46f8('0x35')]['includeAll']){_0x187fd2['include']=[{'all':!![]}];}_0x187fd2=_['merge']({},_0x187fd2,_0x3783a8['options']);return db[_0x46f8('0x43')][_0x46f8('0x4c')](_0x187fd2)[_0x46f8('0x29')](handleEntityNotFound(_0x18d863,null))[_0x46f8('0x29')](respondWithResult(_0x18d863,null))['catch'](handleError(_0x18d863,null));};exports[_0x46f8('0x4d')]=function(_0x10971f,_0x2324c3,_0x34dc6e){return db[_0x46f8('0x43')][_0x46f8('0x4c')]({'where':{'id':_0x10971f['params']['id']},'attributes':[_0x46f8('0x2c'),_0x46f8('0x6')],'raw':!![]})[_0x46f8('0x29')](handleEntityNotFound(_0x2324c3,null))[_0x46f8('0x29')](function(_0x5ce3ec){if(_0x5ce3ec){var _0x171648=path[_0x46f8('0x4e')](config['root'],_0x46f8('0x4f'),util[_0x46f8('0x50')](_0x46f8('0x51'),path['basename'](_0x5ce3ec[_0x46f8('0x6')])));var _0x3f06bd=fs[_0x46f8('0x52')](_0x171648);var _0x3b541a=archiver(_0x46f8('0x53'),{'zlib':{'level':0x9}});_0x3b541a['on'](_0x46f8('0x54'),function(_0x48eafb){if(_0x48eafb[_0x46f8('0x55')]===_0x46f8('0x56')){logger[_0x46f8('0x57')](_0x48eafb);}else{throw new db[(_0x46f8('0x58'))][(_0x46f8('0x59'))](_0x46f8('0x5a'));}});_0x3b541a['on'](_0x46f8('0x57'),function(_0x286fa7){throw new db[(_0x46f8('0x58'))][(_0x46f8('0x59'))](_0x46f8('0x5a'));});_0x3b541a['pipe'](_0x3f06bd);_0x3b541a[_0x46f8('0x5b')](_0x46f8('0x5c'),{'cwd':path[_0x46f8('0x4e')](config['root'],_0x46f8('0x4f'),path[_0x46f8('0x5d')](_0x5ce3ec['path'])),'ignore':[path[_0x46f8('0x4e')](path['basename'](_0x5ce3ec['path']),_0x46f8('0x5e')),path['join'](path[_0x46f8('0x5f')](_0x5ce3ec['path']),_0x46f8('0x60'))],'nodir':!![]})[_0x46f8('0x61')]();_0x3f06bd['on'](_0x46f8('0x62'),function(){if(!fs[_0x46f8('0x63')](_0x171648)){throw new db[(_0x46f8('0x58'))][(_0x46f8('0x59'))](_0x46f8('0x64'));}return _0x2324c3[_0x46f8('0x4d')](_0x171648,util[_0x46f8('0x50')](_0x46f8('0x51'),path[_0x46f8('0x5f')](_0x5ce3ec['path'])),function(_0x3a93a5){if(_0x3a93a5){throw new db[(_0x46f8('0x58'))][(_0x46f8('0x59'))](_0x46f8('0x65'));}fs[_0x46f8('0x66')](_0x171648);logger[_0x46f8('0x67')]('Download\x20completed');logger[_0x46f8('0x67')](_0x46f8('0x68'));});});}return null;})[_0x46f8('0x47')](handleError(_0x2324c3,null));};exports[_0x46f8('0x69')]=function(_0x28532f,_0x447bfa,_0x3d7437){var _0x246f10=path[_0x46f8('0x5f')](_0x28532f[_0x46f8('0x6a')][_0x46f8('0x6b')],path['extname'](_0x28532f[_0x46f8('0x6a')][_0x46f8('0x6b')]));var _0x3fe224=path['join'](config[_0x46f8('0x6c')],_0x46f8('0x4f'),_0x28532f[_0x46f8('0x6a')][_0x46f8('0x6b')]);var _0x4d3f11=path[_0x46f8('0x4e')](config[_0x46f8('0x6c')],_0x46f8('0x4f'),_0x246f10);logger[_0x46f8('0x67')](_0x46f8('0x6d'),_0x3fe224);logger[_0x46f8('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x4d3f11);try{fs[_0x46f8('0x6e')](_0x3fe224,parseInt(_0x46f8('0x6f'),0x8));extract(_0x3fe224,{'dir':_0x4d3f11},function(_0x1fa125){if(_0x1fa125){logger[_0x46f8('0x57')](_0x1fa125);handleError(_0x1fa125,!![]);};var _0x13bea7=fs[_0x46f8('0x70')](_0x4d3f11);if(_0x13bea7[_0x46f8('0x39')]>0x1){removeReferences(_0x3fe224,_0x4d3f11);logger[_0x46f8('0x57')]('Invalid\x20plugin\x20structure');return _0x3d7437(new Error(_0x46f8('0x71')));}var _0x130696=fs[_0x46f8('0x72')](path[_0x46f8('0x4e')](_0x4d3f11,_0x13bea7[0x0]));if(_0x130696[_0x46f8('0x73')]()){removeReferences(_0x3fe224,_0x4d3f11);logger['error'](_0x46f8('0x71'));return _0x3d7437(new Error(_0x46f8('0x71')));}if(_0x130696[_0x46f8('0x74')]()){var _0x4ae8cf=fs[_0x46f8('0x70')](path[_0x46f8('0x4e')](_0x4d3f11,_0x13bea7[0x0]));if(_0x4ae8cf[_0x46f8('0x39')]===0x0){removeReferences(_0x3fe224,_0x4d3f11);logger['error']('Invalid\x20plugin\x20structure');return _0x3d7437(new Error(_0x46f8('0x71')));}var _0x2c75d4=_0x4ae8cf[_0x46f8('0x75')](function(_0x134f95){return _0x134f95===_0x46f8('0x76');});if(!_0x2c75d4){return _0x3d7437(new Error(_0x46f8('0x77')));}var _0x4fe8e0=fs[_0x46f8('0x78')](path[_0x46f8('0x4e')](_0x4d3f11,_0x13bea7[0x0],_0x46f8('0x76')));var _0x5791fb=JSON['parse'](_0x4fe8e0);if('undefined'==typeof _0x5791fb[_0x46f8('0x2c')]){return _0x3d7437(new Error(_0x46f8('0x79')));}if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x32')]){return _0x3d7437(new Error(_0x46f8('0x7b')));}if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7c')]){return _0x3d7437(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7d')]){return _0x3d7437(new Error(_0x46f8('0x7e')));}if(_0x5791fb['type']===_0x46f8('0x7f')){if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')]){return _0x3d7437(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')][_0x46f8('0x81')]&&_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')][_0x46f8('0x82')]){return _0x3d7437(new Error(_0x46f8('0x83')));}}else if(_0x5791fb['type']===_0x46f8('0x84')){if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x85')]){return _0x3d7437(new Error(_0x46f8('0x86')));}if(_0x46f8('0x7a')==typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x87')]){return _0x3d7437(new Error(_0x46f8('0x88')));}}else{return _0x3d7437(new Error(_0x46f8('0x89')));}var _0x1a7de2=_0x5791fb[_0x46f8('0x2c')];var _0x5271ad=_0x5791fb[_0x46f8('0x8a')];var _0x201ab4=_0x5791fb[_0x46f8('0x32')];var _0x2ac2cd=_0x5791fb[_0x46f8('0x8b')]?_0x5791fb[_0x46f8('0x8b')]:_0x46f8('0x8c');var _0x527468=_0x5791fb[_0x46f8('0x8d')]?_0x5791fb['icon']:_0x46f8('0x8e');var _0x2424e8='';var _0x5ef39b='';var _0x2a4931='';var _0x36e810='';var _0x2a87bf=_0x5791fb['version'];if(_0x201ab4==='html'){if(_0x46f8('0x7a')!=typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')]['admin']){var _0x536847=_0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x46f8('0x8f')](_0x536847)){_0x2424e8=path['join'](_0x46f8('0x90'),_0x246f10,_0x13bea7[0x0],_0x536847);}else{_0x2424e8=_0x536847;}}else{logger['info'](_0x46f8('0x91'));}if('undefined'!=typeof _0x5791fb['parameters'][_0x46f8('0x80')][_0x46f8('0x82')]){var _0x43cfc8=_0x5791fb['parameters']['views'][_0x46f8('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x46f8('0x8f')](_0x43cfc8)){_0x5ef39b=path[_0x46f8('0x4e')](_0x46f8('0x90'),_0x246f10,_0x13bea7[0x0],_0x43cfc8);}else{_0x5ef39b=_0x43cfc8;}}else{logger['info'](_0x46f8('0x92'));}}else if(_0x201ab4===_0x46f8('0x84')){_0x2a4931=_0x5791fb['parameters'][_0x46f8('0x85')];_0x36e810=_0x5791fb[_0x46f8('0x7d')][_0x46f8('0x87')];if(_0x46f8('0x7a')!=typeof _0x5791fb['parameters'][_0x46f8('0x80')]){if(_0x46f8('0x7a')!=typeof _0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')][_0x46f8('0x81')]){var _0x536847=_0x5791fb[_0x46f8('0x7d')]['views'][_0x46f8('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x536847)){_0x2424e8=path[_0x46f8('0x4e')](_0x46f8('0x90'),_0x246f10,_0x13bea7[0x0],_0x536847);}else{_0x2424e8=_0x536847;}}if(_0x46f8('0x7a')!=typeof _0x5791fb['parameters'][_0x46f8('0x80')][_0x46f8('0x82')]){var _0x43cfc8=_0x5791fb[_0x46f8('0x7d')][_0x46f8('0x80')][_0x46f8('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x46f8('0x8f')](_0x43cfc8)){_0x5ef39b=path[_0x46f8('0x4e')](_0x46f8('0x90'),_0x246f10,_0x13bea7[0x0],_0x43cfc8);}else{_0x5ef39b=_0x43cfc8;}}}}var _0x5008e8={'name':_0x1a7de2,'description':_0x5271ad,'path':path[_0x46f8('0x4e')](_0x246f10,_0x13bea7[0x0]),'type':_0x201ab4,'sidebar':_0x2ac2cd,'icon':_0x527468,'adminUrl':_0x2424e8,'agentUrl':_0x5ef39b,'scriptName':_0x2a4931,'scriptPath':_0x36e810,'version':_0x2a87bf};removeReferences(_0x3fe224,null);return db[_0x46f8('0x43')][_0x46f8('0x93')](_0x5008e8)[_0x46f8('0x29')](function(_0x19db29){var _0x3c47d3={'role':_0x28532f[_0x46f8('0x94')][_0x46f8('0x95')],'userProfileId':_0x28532f[_0x46f8('0x94')][_0x46f8('0x96')]};if(!_0x3c47d3)throw new Error(_0x46f8('0x97'));if(_0x3c47d3[_0x46f8('0x95')]===_0x46f8('0x98')){var _0x59a013=_0x19db29[_0x46f8('0x26')]({'plain':!![]});return db[_0x46f8('0x99')][_0x46f8('0x4c')]({'where':{'name':'Plugins','userProfileId':_0x3c47d3[_0x46f8('0x96')]},'raw':!![]})[_0x46f8('0x29')](function(_0x32f562){if(_0x32f562&&_0x32f562[_0x46f8('0x9a')]===0x0){return db[_0x46f8('0x28')][_0x46f8('0x93')]({'name':_0x59a013[_0x46f8('0x2c')],'resourceId':_0x59a013['id'],'type':_0x32f562['name'],'sectionId':_0x32f562['id']},{})['then'](function(){return _0x19db29;});}else{return _0x19db29;}})[_0x46f8('0x47')](function(_0x5507de){logger[_0x46f8('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5507de);throw _0x5507de;});}return _0x19db29;})[_0x46f8('0x29')](respondWithResult(_0x447bfa,null))[_0x46f8('0x47')](handleError(_0x447bfa,null));}});}catch(_0x293815){_0x447bfa[_0x46f8('0x1c')](0x1f4)['send'](_0x293815);}};function removeReferences(_0x313021,_0x1d7110){try{if(_0x313021){fs[_0x46f8('0x66')](_0x313021);logger[_0x46f8('0x67')](_0x46f8('0x9b'));}if(_0x1d7110){rimraf(_0x1d7110,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0xd274da){logger[_0x46f8('0x57')](_0xd274da);}}exports[_0x46f8('0x9c')]=function(_0x5baa25,_0x876d13,_0x34a785){return db[_0x46f8('0x43')][_0x46f8('0x4c')]({'where':{'id':_0x5baa25['params']['id']}})[_0x46f8('0x29')](handleEntityNotFound(_0x876d13,null))['then'](saveUpdates(_0x5baa25['body'],null))[_0x46f8('0x29')](respondWithResult(_0x876d13,null))[_0x46f8('0x47')](handleError(_0x876d13,null));};exports[_0x46f8('0x9d')]=function(_0x4b7142,_0x32ba24,_0x53fe31){return db[_0x46f8('0x43')][_0x46f8('0x4c')]({'where':{'id':_0x4b7142['params']['id']}})[_0x46f8('0x29')](function(_0x2b8e20){if(_0x2b8e20){return _0x2b8e20['destroy']();}})[_0x46f8('0x29')](function(_0x175051){rimraf(path['join'](config[_0x46f8('0x6c')],'server/files/plugins',path[_0x46f8('0x5d')](_0x175051[_0x46f8('0x6')])),function(){});return _0x175051;})[_0x46f8('0x29')](handleEntityNotFound(_0x32ba24,null))['then'](respondWithStatusCode(_0x32ba24,null))[_0x46f8('0x47')](handleError(_0x32ba24,null));};exports[_0x46f8('0x9e')]=function(_0x3ce39f,_0x4c146f,_0x3dd117){return BPromise['resolve']()['then'](function(){if(!_0x3ce39f[_0x46f8('0x35')][_0x46f8('0x6')]){throw new Error(_0x46f8('0x9f'));}if(!_0x3ce39f[_0x46f8('0x35')][_0x46f8('0xa0')]){throw new Error(_0x46f8('0xa1'));}var _0x283f31=_0x3ce39f[_0x46f8('0x35')][_0x46f8('0xa2')]?_0x3ce39f['query']['hostname']+':'+_0x3ce39f[_0x46f8('0x35')][_0x46f8('0xa0')]:_0x46f8('0xa3')+_0x3ce39f[_0x46f8('0x35')][_0x46f8('0xa0')];var _0x5ecb46=_0x3ce39f[_0x46f8('0x35')]['json']?_0x3ce39f[_0x46f8('0x35')][_0x46f8('0x22')]:!![];var _0x3fd702=_0x3ce39f[_0x46f8('0x35')]['encoding']?_0x3ce39f[_0x46f8('0x35')]['encoding']:null;var _0x1ac25e={'method':_0x3ce39f[_0x46f8('0xa4')],'uri':util['format']('%s%s',_0x283f31,_0x3ce39f[_0x46f8('0x35')][_0x46f8('0x6')]),'json':_0x5ecb46,'resolveWithFullResponse':!![],'encoding':_0x3fd702,'qs':_0x3ce39f[_0x46f8('0x35')]};if(_0x3ce39f[_0x46f8('0xa5')]){_0x1ac25e[_0x46f8('0xa5')]=_0x3ce39f[_0x46f8('0xa5')];if(_0x1ac25e[_0x46f8('0xa5')][_0x46f8('0xa6')]){delete _0x1ac25e['headers'][_0x46f8('0xa6')];}}if(_0x1ac25e[_0x46f8('0xa5')][_0x46f8('0xa7')]){delete _0x1ac25e[_0x46f8('0xa5')]['content-type'];}return rp(_0x1ac25e);})[_0x46f8('0x29')](function(_0x49b9c1){if(_0x49b9c1){_0x4c146f['set'](_0x49b9c1[_0x46f8('0xa5')]);logger[_0x46f8('0x67')](_0x49b9c1[_0x46f8('0x94')]);if(_[_0x46f8('0xa8')](_0x3ce39f[_0x46f8('0x35')][_0x46f8('0x6')],_0x46f8('0x4d'))&&_0x49b9c1[_0x46f8('0xa9')]==0x1f4){return _0x4c146f[_0x46f8('0x2a')](_0x49b9c1['statusCode']);}else{return _0x4c146f['status'](_0x49b9c1['statusCode'])[_0x46f8('0x2d')](_0x49b9c1[_0x46f8('0x94')]);}}else{return _0x4c146f[_0x46f8('0x2a')](0xc8);}})[_0x46f8('0x47')](handleError(_0x4c146f,null));};exports[_0x46f8('0xaa')]=function(_0x44b0fa,_0x4d2d70,_0x16ff56){return BPromise[_0x46f8('0xab')]()['then'](function(){if(!_0x44b0fa[_0x46f8('0x35')]['path']){throw new Error(_0x46f8('0x9f'));}if(!_0x44b0fa[_0x46f8('0x35')][_0x46f8('0xa0')]){throw new Error(_0x46f8('0xa1'));}var _0x180f12=_0x44b0fa[_0x46f8('0x35')][_0x46f8('0xa2')]?_0x44b0fa[_0x46f8('0x35')][_0x46f8('0xa2')]+':'+_0x44b0fa[_0x46f8('0x35')][_0x46f8('0xa0')]:_0x46f8('0xa3')+_0x44b0fa[_0x46f8('0x35')]['port'];var _0x3f3d64=_0x44b0fa['query']['json']?_0x44b0fa[_0x46f8('0x35')][_0x46f8('0x22')]:!![];var _0x47b05c=_0x44b0fa[_0x46f8('0x35')]['encoding']?_0x44b0fa[_0x46f8('0x35')]['encoding']:null;var _0x185524={'method':_0x44b0fa[_0x46f8('0xa4')],'uri':util[_0x46f8('0x50')]('%s%s',_0x180f12,_0x44b0fa[_0x46f8('0x35')]['path']),'json':_0x3f3d64,'resolveWithFullResponse':!![],'encoding':_0x47b05c,'body':_0x44b0fa[_0x46f8('0x94')]};if(_0x44b0fa['headers']){_0x185524[_0x46f8('0xa5')]=_0x44b0fa[_0x46f8('0xa5')];if(_0x185524[_0x46f8('0xa5')][_0x46f8('0xa6')]){delete _0x185524[_0x46f8('0xa5')][_0x46f8('0xa6')];}}if(_0x185524[_0x46f8('0xa5')][_0x46f8('0xa7')]){delete _0x185524['headers'][_0x46f8('0xa7')];}return rp(_0x185524);})[_0x46f8('0x29')](function(_0x47ee6f){if(_0x47ee6f){_0x4d2d70['set'](_0x47ee6f[_0x46f8('0xa5')]);logger[_0x46f8('0x67')](_0x47ee6f[_0x46f8('0x94')]);return _0x4d2d70[_0x46f8('0x1c')](_0x47ee6f['statusCode'])['send'](_0x47ee6f[_0x46f8('0x94')]);}else{return _0x4d2d70['sendStatus'](0xc8);}})[_0x46f8('0x47')](handleError(_0x4d2d70,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index d1a5143..9262def 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 _0xdb28=['Plugin','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x424eb0,_0xd5e5cb){var _0x345128=function(_0x12c56f){while(--_0x12c56f){_0x424eb0['push'](_0x424eb0['shift']());}};_0x345128(++_0xd5e5cb);}(_0xdb28,0x106));var _0x8db2=function(_0x1510a4,_0x2a56b7){_0x1510a4=_0x1510a4-0x0;var _0x2ff957=_0xdb28[_0x1510a4];return _0x2ff957;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Plugin=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){PluginEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);PluginEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=PluginEvents; \ No newline at end of file +var _0xd117=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xfa73ac,_0x2a7395){var _0x4e8e14=function(_0x9b5698){while(--_0x9b5698){_0xfa73ac['push'](_0xfa73ac['shift']());}};_0x4e8e14(++_0x2a7395);}(_0xd117,0x182));var _0x7d11=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xd117[_0x39106e];return _0x892aec;};'use strict';var EventEmitter=require(_0x7d11('0x0'));var Plugin=require(_0x7d11('0x1'))['db'][_0x7d11('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7d11('0x3')](0x0);var events={'afterCreate':_0x7d11('0x4'),'afterUpdate':_0x7d11('0x5'),'afterDestroy':_0x7d11('0x6')};function emitEvent(_0x254bb4){return function(_0x3c07be,_0x31fcb0,_0x589c51){PluginEvents[_0x7d11('0x7')](_0x254bb4+':'+_0x3c07be['id'],_0x3c07be);PluginEvents[_0x7d11('0x7')](_0x254bb4,_0x3c07be);_0x589c51(null);};}for(var e in events){if(events[_0x7d11('0x8')](e)){var event=events[e];Plugin[_0x7d11('0x9')](e,emitEvent(event));}}module[_0x7d11('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 150ff34..7df0d1a 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 _0x09e1=['Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x2f3666,_0x46e986){var _0x227f67=function(_0x465d2f){while(--_0x465d2f){_0x2f3666['push'](_0x2f3666['shift']());}};_0x227f67(++_0x46e986);}(_0x09e1,0x143));var _0x109e=function(_0x50077f,_0x481c48){_0x50077f=_0x50077f-0x0;var _0x5bd3dc=_0x09e1[_0x50077f];return _0x5bd3dc;};'use strict';var _=require(_0x109e('0x0'));var util=require(_0x109e('0x1'));var logger=require(_0x109e('0x2'))(_0x109e('0x3'));var moment=require(_0x109e('0x4'));var BPromise=require(_0x109e('0x5'));var rp=require(_0x109e('0x6'));var fs=require('fs');var path=require(_0x109e('0x7'));var rimraf=require(_0x109e('0x8'));var config=require(_0x109e('0x9'));var attributes=require(_0x109e('0xa'));module[_0x109e('0xb')]=function(_0x2a8ce9,_0x297aa5){return _0x2a8ce9[_0x109e('0xc')](_0x109e('0xd'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c0f=['request-promise','path','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x9c0f,0x1c1));var _0xf9c0=function(_0x3d131a,_0x2ee691){_0x3d131a=_0x3d131a-0x0;var _0x44c22d=_0x9c0f[_0x3d131a];return _0x44c22d;};'use strict';var _=require(_0xf9c0('0x0'));var util=require(_0xf9c0('0x1'));var logger=require(_0xf9c0('0x2'))(_0xf9c0('0x3'));var moment=require(_0xf9c0('0x4'));var BPromise=require(_0xf9c0('0x5'));var rp=require(_0xf9c0('0x6'));var fs=require('fs');var path=require(_0xf9c0('0x7'));var rimraf=require('rimraf');var config=require(_0xf9c0('0x8'));var attributes=require('./plugin.attributes');module[_0xf9c0('0x9')]=function(_0x4df646,_0x1903f3){return _0x4df646[_0xf9c0('0xa')](_0xf9c0('0xb'),attributes,{'tableName':_0xf9c0('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 d5ded08..1454391 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 _0x07f8=['message','info','result','catch','CreatePlugin','Plugin','create','options','debug','stringify','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error'];(function(_0x2eb13a,_0x38849d){var _0x3a58d8=function(_0x207bb8){while(--_0x207bb8){_0x2eb13a['push'](_0x2eb13a['shift']());}};_0x3a58d8(++_0x38849d);}(_0x07f8,0x10f));var _0x807f=function(_0x20eaca,_0x5c6fd6){_0x20eaca=_0x20eaca-0x0;var _0xe4e235=_0x07f8[_0x20eaca];return _0xe4e235;};'use strict';var _=require(_0x807f('0x0'));var util=require(_0x807f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x807f('0x2'));var db=require(_0x807f('0x3'))['db'];var utils=require(_0x807f('0x4'));var logger=require(_0x807f('0x5'))(_0x807f('0x6'));var config=require(_0x807f('0x7'));var jayson=require(_0x807f('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x807f('0x9')]=_[_0x807f('0xa')](config[_0x807f('0x9')],{'host':_0x807f('0xb'),'port':0x18eb});var socket=require(_0x807f('0xc'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x577294,_0x20bf17,_0xf8ef87){return new BPromise(function(_0x5eb05d,_0x3c8a34){return client[_0x807f('0xd')](_0x577294,_0xf8ef87)[_0x807f('0xe')](function(_0x498b39){logger['info'](_0x807f('0xf'),_0x20bf17,_0x807f('0x10'));logger['debug'](_0x807f('0x11'),_0x20bf17,_0x807f('0x10'),JSON['stringify'](_0x498b39));if(_0x498b39[_0x807f('0x12')]){if(_0x498b39[_0x807f('0x12')]['code']===0x1f4){logger[_0x807f('0x12')](_0x807f('0xf'),_0x20bf17,_0x498b39['error'][_0x807f('0x13')]);return _0x3c8a34(_0x498b39[_0x807f('0x12')][_0x807f('0x13')]);}logger[_0x807f('0x12')](_0x807f('0xf'),_0x20bf17,_0x498b39[_0x807f('0x12')][_0x807f('0x13')]);return _0x5eb05d(_0x498b39[_0x807f('0x12')][_0x807f('0x13')]);}else{logger[_0x807f('0x14')](_0x807f('0xf'),_0x20bf17,_0x807f('0x10'));_0x5eb05d(_0x498b39[_0x807f('0x15')][_0x807f('0x13')]);}})[_0x807f('0x16')](function(_0x5123c2){logger[_0x807f('0x12')]('Plugin,\x20%s,\x20%s',_0x20bf17,_0x5123c2);_0x3c8a34(_0x5123c2);});});}exports[_0x807f('0x17')]=function(_0x5b7f87){var _0x878732=this;return new Promise(function(_0x353c5c,_0x1dfd72){return db[_0x807f('0x18')][_0x807f('0x19')](_0x5b7f87['body'],{'raw':_0x5b7f87[_0x807f('0x1a')]?_0x5b7f87[_0x807f('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xeda5d9){logger[_0x807f('0x14')](_0x807f('0x17'),_0x5b7f87);logger[_0x807f('0x1b')]('CreatePlugin',_0x5b7f87,JSON[_0x807f('0x1c')](_0xeda5d9));_0x353c5c(_0xeda5d9);})['catch'](function(_0x41420d){logger[_0x807f('0x12')]('CreatePlugin',_0x41420d['message'],_0x5b7f87);_0x1dfd72(_0x878732[_0x807f('0x12')](0x1f4,_0x41420d[_0x807f('0x13')]));});});}; \ No newline at end of file +var _0x5c45=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreatePlugin','Plugin','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5f2c2e,_0x82b99b){var _0x2e2958=function(_0x30b3da){while(--_0x30b3da){_0x5f2c2e['push'](_0x5f2c2e['shift']());}};_0x2e2958(++_0x82b99b);}(_0x5c45,0x13d));var _0x55c4=function(_0x20ee67,_0x1b0c93){_0x20ee67=_0x20ee67-0x0;var _0x4a4ab3=_0x5c45[_0x20ee67];return _0x4a4ab3;};'use strict';var _=require(_0x55c4('0x0'));var util=require(_0x55c4('0x1'));var moment=require(_0x55c4('0x2'));var BPromise=require(_0x55c4('0x3'));var rs=require(_0x55c4('0x4'));var fs=require('fs');var Redis=require(_0x55c4('0x5'));var db=require(_0x55c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x55c4('0x7'))(_0x55c4('0x8'));var config=require(_0x55c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x55c4('0xa')][_0x55c4('0xb')]({'port':0x232a});config[_0x55c4('0xc')]=_['defaults'](config['redis'],{'host':_0x55c4('0xd'),'port':0x18eb});var socket=require(_0x55c4('0xe'))(new Redis(config[_0x55c4('0xc')]));require(_0x55c4('0xf'))[_0x55c4('0x10')](socket);function respondWithRpcPromise(_0x71b8,_0xb71e0d,_0x588d6a){return new BPromise(function(_0x2a5b00,_0x237dba){return client[_0x55c4('0x11')](_0x71b8,_0x588d6a)[_0x55c4('0x12')](function(_0x32057c){logger[_0x55c4('0x13')](_0x55c4('0x14'),_0xb71e0d,_0x55c4('0x15'));logger[_0x55c4('0x16')](_0x55c4('0x17'),_0xb71e0d,_0x55c4('0x15'),JSON[_0x55c4('0x18')](_0x32057c));if(_0x32057c[_0x55c4('0x19')]){if(_0x32057c[_0x55c4('0x19')]['code']===0x1f4){logger['error'](_0x55c4('0x14'),_0xb71e0d,_0x32057c[_0x55c4('0x19')][_0x55c4('0x1a')]);return _0x237dba(_0x32057c['error'][_0x55c4('0x1a')]);}logger['error'](_0x55c4('0x14'),_0xb71e0d,_0x32057c['error'][_0x55c4('0x1a')]);return _0x2a5b00(_0x32057c[_0x55c4('0x19')]['message']);}else{logger[_0x55c4('0x13')](_0x55c4('0x14'),_0xb71e0d,_0x55c4('0x15'));_0x2a5b00(_0x32057c[_0x55c4('0x1b')]['message']);}})['catch'](function(_0x504d86){logger[_0x55c4('0x19')]('Plugin,\x20%s,\x20%s',_0xb71e0d,_0x504d86);_0x237dba(_0x504d86);});});}exports[_0x55c4('0x1c')]=function(_0x383ec3){var _0x430857=this;return new Promise(function(_0x2b6236,_0x221acc){return db[_0x55c4('0x1d')]['create'](_0x383ec3[_0x55c4('0x1e')],{'raw':_0x383ec3[_0x55c4('0x1f')]?_0x383ec3[_0x55c4('0x1f')][_0x55c4('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x75073b){logger[_0x55c4('0x13')](_0x55c4('0x1c'),_0x383ec3);logger[_0x55c4('0x16')](_0x55c4('0x1c'),_0x383ec3,JSON['stringify'](_0x75073b));_0x2b6236(_0x75073b);})[_0x55c4('0x21')](function(_0x55169f){logger['error'](_0x55c4('0x1c'),_0x55169f['message'],_0x383ec3);_0x221acc(_0x430857[_0x55c4('0x19')](0x1f4,_0x55169f[_0x55c4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3e99269..e0f8847 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 _0xa412=['save','remove','update','register','plugin:','./plugin.events'];(function(_0x2e1116,_0x5574a0){var _0x334636=function(_0x30154c){while(--_0x30154c){_0x2e1116['push'](_0x2e1116['shift']());}};_0x334636(++_0x5574a0);}(_0xa412,0xa7));var _0x2a41=function(_0x32e5a4,_0x4e6841){_0x32e5a4=_0x32e5a4-0x0;var _0x2e2054=_0xa412[_0x32e5a4];return _0x2e2054;};'use strict';var PluginEvents=require(_0x2a41('0x0'));var events=[_0x2a41('0x1'),_0x2a41('0x2'),_0x2a41('0x3')];function createListener(_0x3ffbcc,_0x1c8048){return function(_0x473575){_0x1c8048['emit'](_0x3ffbcc,_0x473575);};}function removeListener(_0x33e87b,_0x517ee2){return function(){PluginEvents['removeListener'](_0x33e87b,_0x517ee2);};}exports[_0x2a41('0x4')]=function(_0x54a9ea){for(var _0x56d9e2=0x0,_0x39ed65=events['length'];_0x56d9e2<_0x39ed65;_0x56d9e2++){var _0x4880e9=events[_0x56d9e2];var _0x1fdaf4=createListener(_0x2a41('0x5')+_0x4880e9,_0x54a9ea);PluginEvents['on'](_0x4880e9,_0x1fdaf4);}}; \ No newline at end of file +var _0x3c2c=['register','length','./plugin.events','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3c2c,0x160));var _0xc3c2=function(_0x5616b0,_0x14ac3b){_0x5616b0=_0x5616b0-0x0;var _0x502d8b=_0x3c2c[_0x5616b0];return _0x502d8b;};'use strict';var PluginEvents=require(_0xc3c2('0x0'));var events=[_0xc3c2('0x1'),_0xc3c2('0x2'),_0xc3c2('0x3')];function createListener(_0x59a8c0,_0x481bf9){return function(_0x321ef5){_0x481bf9[_0xc3c2('0x4')](_0x59a8c0,_0x321ef5);};}function removeListener(_0x2f4e7e,_0x3bb44f){return function(){PluginEvents['removeListener'](_0x2f4e7e,_0x3bb44f);};}exports[_0xc3c2('0x5')]=function(_0x158a5f){for(var _0x234da9=0x0,_0x21fa50=events[_0xc3c2('0x6')];_0x234da9<_0x21fa50;_0x234da9++){var _0x48cab1=events[_0x234da9];var _0x5daa76=createListener('plugin:'+_0x48cab1,_0x158a5f);PluginEvents['on'](_0x48cab1,_0x5daa76);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0d13206..6414a84 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 _0xdc58=['put','/:id','delete','destroy','exports','express','Router','get','isAuthenticated','index','show','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc58,0x71));var _0x8dc5=function(_0x42d10b,_0x562a22){_0x42d10b=_0x42d10b-0x0;var _0x256d90=_0xdc58[_0x42d10b];return _0x256d90;};'use strict';var express=require(_0x8dc5('0x0'));var router=express[_0x8dc5('0x1')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router[_0x8dc5('0x2')]('/',auth[_0x8dc5('0x3')](),controller[_0x8dc5('0x4')]);router['get']('/:id',auth[_0x8dc5('0x3')](),controller[_0x8dc5('0x5')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8dc5('0x6')]);router[_0x8dc5('0x7')](_0x8dc5('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x8dc5('0x9')]('/:id',auth[_0x8dc5('0x3')](),controller[_0x8dc5('0xa')]);module[_0x8dc5('0xb')]=router; \ No newline at end of file +var _0x7b27=['./pm2.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','express','Router','../../components/auth/service'];(function(_0x2f9806,_0x174012){var _0x2e8c64=function(_0x103fd1){while(--_0x103fd1){_0x2f9806['push'](_0x2f9806['shift']());}};_0x2e8c64(++_0x174012);}(_0x7b27,0x107));var _0x77b2=function(_0x4678fb,_0x118a45){_0x4678fb=_0x4678fb-0x0;var _0x5db241=_0x7b27[_0x4678fb];return _0x5db241;};'use strict';var express=require(_0x77b2('0x0'));var router=express[_0x77b2('0x1')]();var auth=require(_0x77b2('0x2'));var controller=require(_0x77b2('0x3'));router[_0x77b2('0x4')]('/',auth[_0x77b2('0x5')](),controller[_0x77b2('0x6')]);router[_0x77b2('0x4')](_0x77b2('0x7'),auth[_0x77b2('0x5')](),controller[_0x77b2('0x8')]);router[_0x77b2('0x9')]('/',auth[_0x77b2('0x5')](),controller['create']);router[_0x77b2('0xa')](_0x77b2('0x7'),auth[_0x77b2('0x5')](),controller[_0x77b2('0xb')]);router[_0x77b2('0xc')]('/:id',auth[_0x77b2('0x5')](),controller['destroy']);module[_0x77b2('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 3049171..12c0527 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 _0x0267=['express','motion2','catch','describe','body','script','../../files/plugins','chdir','dirname','dump','update','restart','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0x0267,0x1d9));var _0x7026=function(_0x4dfa39,_0x5c0e07){_0x4dfa39=_0x4dfa39-0x0;var _0x2c5c38=_0x0267[_0x4dfa39];return _0x2c5c38;};'use strict';var _=require('lodash');var pm2=require(_0x7026('0x0'));var logger=require(_0x7026('0x1'))(_0x7026('0x2'));var path=require(_0x7026('0x3'));var exec=require(_0x7026('0x4'))[_0x7026('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0xacc7d8,_0x49a35f){return function(_0x317064){if(!_0x317064){_0xacc7d8[_0x7026('0x6')](0x194);;}return _0x317064;};}function respondWithResult(_0x590d1c,_0x1d2bad){_0x1d2bad=_0x1d2bad||0xc8;return function(_0x322cdb){if(_0x322cdb){return _0x590d1c[_0x7026('0x7')](_0x1d2bad)['json'](_0x322cdb);}return null;};}function handleError(_0x381f60,_0x24e3e5){_0x24e3e5=_0x24e3e5||0x1f4;return function(_0x36d77c){logger[_0x7026('0x8')](_0x36d77c[_0x7026('0x9')]);if(_0x36d77c[_0x7026('0xa')]){delete _0x36d77c[_0x7026('0xa')];}_0x381f60[_0x7026('0x7')](_0x24e3e5)[_0x7026('0xb')](_0x36d77c);};}function execChildProcess(){return new BPromise(function(_0x2f8134,_0x20ed8c){exec(_0x7026('0xc'),function(_0x1a95c2,_0xd594e8,_0x223b87){logger[_0x7026('0xd')](_0xd594e8);logger['info'](_0x223b87);if(_0x1a95c2){logger[_0x7026('0x8')](_0x1a95c2);return _0x20ed8c(_0x1a95c2);}return _0x2f8134(_0xd594e8);});});}exports[_0x7026('0xe')]=function(_0x33053d,_0xbd782){return pm2[_0x7026('0xf')]()[_0x7026('0x10')](function(_0x27bd2c){if(_0x27bd2c){var _0x41c54b=_['reject'](_0x27bd2c,function(_0x2e099a){return _0x2e099a[_0x7026('0xa')]===_0x7026('0x11')||_0x2e099a[_0x7026('0xa')]===_0x7026('0x12');});return{'rows':_0x41c54b,'count':_0x41c54b['length']};}return null;})[_0x7026('0x10')](respondWithResult(_0xbd782,null))[_0x7026('0x13')](handleError(_0xbd782,null));};exports['show']=function(_0x32385c,_0x26209e){return pm2[_0x7026('0x14')](_0x32385c['params']['id'])[_0x7026('0x10')](respondWithResult(_0x26209e,null))[_0x7026('0x10')](handleEntityNotFound(_0x26209e,null))[_0x7026('0x13')](handleError(_0x26209e,null));};exports['create']=function(_0x1ceea2,_0x265cfa){if(_0x1ceea2[_0x7026('0x15')][_0x7026('0xa')]&&_0x1ceea2[_0x7026('0x15')][_0x7026('0x16')]){var _0x17a299=path['join'](__dirname,_0x7026('0x17'),_0x1ceea2[_0x7026('0x15')][_0x7026('0x16')]);var _0x24a021=process['cwd']();process[_0x7026('0x18')](path[_0x7026('0x19')](_0x17a299));return execChildProcess()[_0x7026('0x10')](function(_0x4f6320){process[_0x7026('0x18')](_0x24a021);return pm2['start']({'name':_0x1ceea2[_0x7026('0x15')]['name'],'script':_0x17a299});})[_0x7026('0x10')](function(_0x128af6){pm2[_0x7026('0x1a')]();return _0x128af6[0x0];})['then'](respondWithResult(_0x265cfa,0xc9))[_0x7026('0x13')](handleError(_0x265cfa,null));}else{return _0x265cfa[_0x7026('0x7')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x7026('0x1b')]=function(_0x27b9b7,_0x513cf6){if(_0x27b9b7[_0x7026('0x15')]['id']){delete _0x27b9b7[_0x7026('0x15')]['id'];}var _0x4a89c5={'online':_0x7026('0x1c'),'stopped':'stop'};if(_0x4a89c5[_0x7026('0x1d')](_0x27b9b7[_0x7026('0x15')][_0x7026('0x7')])){return pm2[_0x4a89c5[_0x27b9b7[_0x7026('0x15')][_0x7026('0x7')]]](_0x27b9b7[_0x7026('0x1e')]['id'])['then'](respondWithResult(_0x513cf6,0xc8))[_0x7026('0x13')](handleError(_0x513cf6,null));}else{return _0x513cf6[_0x7026('0x7')](0x1f4)[_0x7026('0xb')]({'message':_0x7026('0x1f')});}};exports[_0x7026('0x20')]=function(_0x3da779,_0x370894){if(_0x3da779[_0x7026('0x15')]['id']){delete _0x3da779[_0x7026('0x15')]['id'];}if(_0x3da779[_0x7026('0x1e')]['id']){return pm2[_0x7026('0x21')](_0x3da779[_0x7026('0x1e')]['id'])[_0x7026('0x10')](function(_0x5df6b2){pm2[_0x7026('0x1a')]();return _0x5df6b2[0x0];})[_0x7026('0x10')](respondWithResult(_0x370894,null))[_0x7026('0x13')](handleError(_0x370894,null));}else{return _0x370894[_0x7026('0x7')](0x1f4)['send']({'message':_0x7026('0x22')});}}; \ No newline at end of file +var _0xc070=['path','exec','bluebird','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','create','body','script','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','params','Unknown\x20status','delete','dump','lodash','../../config/pm2','../../config/logger','api'];(function(_0x54a079,_0x52c602){var _0x2d6a3f=function(_0x39e070){while(--_0x39e070){_0x54a079['push'](_0x54a079['shift']());}};_0x2d6a3f(++_0x52c602);}(_0xc070,0xbf));var _0x0c07=function(_0x3f3296,_0x15fe95){_0x3f3296=_0x3f3296-0x0;var _0x4f146a=_0xc070[_0x3f3296];return _0x4f146a;};'use strict';var _=require(_0x0c07('0x0'));var pm2=require(_0x0c07('0x1'));var logger=require(_0x0c07('0x2'))(_0x0c07('0x3'));var path=require(_0x0c07('0x4'));var exec=require('child_process')[_0x0c07('0x5')];var BPromise=require(_0x0c07('0x6'));function handleEntityNotFound(_0x34476b,_0x4e0199){return function(_0x1d0fb0){if(!_0x1d0fb0){_0x34476b[_0x0c07('0x7')](0x194);;}return _0x1d0fb0;};}function respondWithResult(_0x2ac7c6,_0x240b84){_0x240b84=_0x240b84||0xc8;return function(_0x9d1e9e){if(_0x9d1e9e){return _0x2ac7c6['status'](_0x240b84)[_0x0c07('0x8')](_0x9d1e9e);}return null;};}function handleError(_0x13859d,_0x98ef82){_0x98ef82=_0x98ef82||0x1f4;return function(_0x138648){logger[_0x0c07('0x9')](_0x138648[_0x0c07('0xa')]);if(_0x138648['name']){delete _0x138648[_0x0c07('0xb')];}_0x13859d[_0x0c07('0xc')](_0x98ef82)[_0x0c07('0xd')](_0x138648);};}function execChildProcess(){return new BPromise(function(_0x4dd377,_0x25cd39){exec(_0x0c07('0xe'),function(_0x1f2d2b,_0x2e8a97,_0x4354b0){logger[_0x0c07('0xf')](_0x2e8a97);logger[_0x0c07('0xf')](_0x4354b0);if(_0x1f2d2b){logger[_0x0c07('0x9')](_0x1f2d2b);return _0x25cd39(_0x1f2d2b);}return _0x4dd377(_0x2e8a97);});});}exports[_0x0c07('0x10')]=function(_0x4de81b,_0x17dab3){return pm2[_0x0c07('0x11')]()[_0x0c07('0x12')](function(_0x18e93b){if(_0x18e93b){var _0x576a85=_[_0x0c07('0x13')](_0x18e93b,function(_0x1ebff7){return _0x1ebff7[_0x0c07('0xb')]===_0x0c07('0x14')||_0x1ebff7[_0x0c07('0xb')]===_0x0c07('0x15');});return{'rows':_0x576a85,'count':_0x576a85[_0x0c07('0x16')]};}return null;})[_0x0c07('0x12')](respondWithResult(_0x17dab3,null))[_0x0c07('0x17')](handleError(_0x17dab3,null));};exports[_0x0c07('0x18')]=function(_0x42b41c,_0x50f087){return pm2['describe'](_0x42b41c['params']['id'])[_0x0c07('0x12')](respondWithResult(_0x50f087,null))[_0x0c07('0x12')](handleEntityNotFound(_0x50f087,null))['catch'](handleError(_0x50f087,null));};exports[_0x0c07('0x19')]=function(_0x561693,_0x2240c8){if(_0x561693[_0x0c07('0x1a')][_0x0c07('0xb')]&&_0x561693[_0x0c07('0x1a')][_0x0c07('0x1b')]){var _0x3391a6=path['join'](__dirname,_0x0c07('0x1c'),_0x561693['body']['script']);var _0x78616d=process[_0x0c07('0x1d')]();process['chdir'](path['dirname'](_0x3391a6));return execChildProcess()[_0x0c07('0x12')](function(_0x1eae9d){process[_0x0c07('0x1e')](_0x78616d);return pm2[_0x0c07('0x1f')]({'name':_0x561693[_0x0c07('0x1a')][_0x0c07('0xb')],'script':_0x3391a6});})['then'](function(_0x3bd322){pm2['dump']();return _0x3bd322[0x0];})[_0x0c07('0x12')](respondWithResult(_0x2240c8,0xc9))[_0x0c07('0x17')](handleError(_0x2240c8,null));}else{return _0x2240c8[_0x0c07('0xc')](0x1f4)[_0x0c07('0xd')]({'message':_0x0c07('0x20')});}};exports[_0x0c07('0x21')]=function(_0x175622,_0x4aa160){if(_0x175622['body']['id']){delete _0x175622[_0x0c07('0x1a')]['id'];}var _0x4d29b2={'online':_0x0c07('0x22'),'stopped':'stop'};if(_0x4d29b2['hasOwnProperty'](_0x175622[_0x0c07('0x1a')]['status'])){return pm2[_0x4d29b2[_0x175622[_0x0c07('0x1a')][_0x0c07('0xc')]]](_0x175622[_0x0c07('0x23')]['id'])[_0x0c07('0x12')](respondWithResult(_0x4aa160,0xc8))[_0x0c07('0x17')](handleError(_0x4aa160,null));}else{return _0x4aa160['status'](0x1f4)[_0x0c07('0xd')]({'message':_0x0c07('0x24')});}};exports['destroy']=function(_0x330c88,_0x4df0d8){if(_0x330c88[_0x0c07('0x1a')]['id']){delete _0x330c88[_0x0c07('0x1a')]['id'];}if(_0x330c88[_0x0c07('0x23')]['id']){return pm2[_0x0c07('0x25')](_0x330c88[_0x0c07('0x23')]['id'])['then'](function(_0x20d5ae){pm2[_0x0c07('0x26')]();return _0x20d5ae[0x0];})[_0x0c07('0x12')](respondWithResult(_0x4df0d8,null))[_0x0c07('0x17')](handleError(_0x4df0d8,null));}else{return _0x4df0d8[_0x0c07('0xc')](0x1f4)[_0x0c07('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ffed358..0a0c2ff 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 _0x43ea=['../../components/interaction/service','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x16b6fb,_0x7c304f){var _0x13527d=function(_0x1998a8){while(--_0x1998a8){_0x16b6fb['push'](_0x16b6fb['shift']());}};_0x13527d(++_0x7c304f);}(_0x43ea,0x1c2));var _0xa43e=function(_0x4656bb,_0x2c4488){_0x4656bb=_0x4656bb-0x0;var _0xc61fa9=_0x43ea[_0x4656bb];return _0xc61fa9;};'use strict';var multer=require(_0xa43e('0x0'));var util=require('util');var path=require(_0xa43e('0x1'));var timeout=require(_0xa43e('0x2'));var express=require(_0xa43e('0x3'));var router=express['Router']();var auth=require(_0xa43e('0x4'));var interaction=require(_0xa43e('0x5'));var config=require('../../config/environment');module[_0xa43e('0x6')]=router; \ No newline at end of file +var _0xa83f=['multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x376e1d,_0x4ec1fc){var _0x20512f=function(_0x1425b6){while(--_0x1425b6){_0x376e1d['push'](_0x376e1d['shift']());}};_0x20512f(++_0x4ec1fc);}(_0xa83f,0x118));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfa83('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa83('0x1'));var express=require(_0xfa83('0x2'));var router=express[_0xfa83('0x3')]();var auth=require(_0xfa83('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfa83('0x5'));module[_0xfa83('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 50c0cdf..f3fc4b2 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 _0x82d0=['sequelize','INTEGER','STRING','DATE'];(function(_0x1fdfdc,_0xba7922){var _0x4f0656=function(_0xeb4703){while(--_0xeb4703){_0x1fdfdc['push'](_0x1fdfdc['shift']());}};_0x4f0656(++_0xba7922);}(_0x82d0,0xb4));var _0x082d=function(_0x3a6b78,_0x2d62be){_0x3a6b78=_0x3a6b78-0x0;var _0x4943d4=_0x82d0[_0x3a6b78];return _0x4943d4;};'use strict';var Sequelize=require(_0x082d('0x0'));module['exports']={'state':{'type':Sequelize[_0x082d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x082d('0x2')]},'scheduledat':{'type':Sequelize[_0x082d('0x3')]},'uniqueid':{'type':Sequelize[_0x082d('0x2')]},'starttime':{'type':Sequelize[_0x082d('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x082d('0x2')]},'campaigntype':{'type':Sequelize[_0x082d('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe359=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x788984,_0x5f5d3a){var _0x11531f=function(_0xad28dd){while(--_0xad28dd){_0x788984['push'](_0x788984['shift']());}};_0x11531f(++_0x5f5d3a);}(_0xe359,0x1c8));var _0x9e35=function(_0x516bbe,_0x339531){_0x516bbe=_0x516bbe-0x0;var _0xe86fd5=_0xe359[_0x516bbe];return _0xe86fd5;};'use strict';var Sequelize=require(_0x9e35('0x0'));module[_0x9e35('0x1')]={'state':{'type':Sequelize[_0x9e35('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9e35('0x3')]},'scheduledat':{'type':Sequelize[_0x9e35('0x4')]},'uniqueid':{'type':Sequelize[_0x9e35('0x3')]},'starttime':{'type':Sequelize[_0x9e35('0x4')]},'responsetime':{'type':Sequelize[_0x9e35('0x4')]},'ringtime':{'type':Sequelize[_0x9e35('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9e35('0x3')]},'campaigntype':{'type':Sequelize[_0x9e35('0x3')]},'membername':{'type':Sequelize[_0x9e35('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0d94eee..9281c44 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 _0xd79b=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc8a692,_0x579320){var _0x5055d8=function(_0x528459){while(--_0x528459){_0xc8a692['push'](_0xc8a692['shift']());}};_0x5055d8(++_0x579320);}(_0xd79b,0xf5));var _0xbd79=function(_0x10e385,_0x3ae335){_0x10e385=_0x10e385-0x0;var _0x32f4c2=_0xd79b[_0x10e385];return _0x32f4c2;};'use strict';var _=require(_0xbd79('0x0'));var util=require(_0xbd79('0x1'));var logger=require(_0xbd79('0x2'))(_0xbd79('0x3'));var moment=require(_0xbd79('0x4'));var BPromise=require(_0xbd79('0x5'));var rp=require(_0xbd79('0x6'));var fs=require('fs');var path=require(_0xbd79('0x7'));var rimraf=require(_0xbd79('0x8'));var config=require(_0xbd79('0x9'));var attributes=require(_0xbd79('0xa'));module['exports']=function(_0x39d41f,_0x2ada9d){return _0x39d41f[_0xbd79('0xb')](_0xbd79('0xc'),attributes,{'tableName':_0xbd79('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0457=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview'];(function(_0x4b3d77,_0x138118){var _0x163796=function(_0xf430a6){while(--_0xf430a6){_0x4b3d77['push'](_0x4b3d77['shift']());}};_0x163796(++_0x138118);}(_0x0457,0x84));var _0x7045=function(_0x56b8dd,_0x14e979){_0x56b8dd=_0x56b8dd-0x0;var _0x391bac=_0x0457[_0x56b8dd];return _0x391bac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7045('0x0'))(_0x7045('0x1'));var moment=require(_0x7045('0x2'));var BPromise=require(_0x7045('0x3'));var rp=require(_0x7045('0x4'));var fs=require('fs');var path=require(_0x7045('0x5'));var rimraf=require(_0x7045('0x6'));var config=require(_0x7045('0x7'));var attributes=require(_0x7045('0x8'));module[_0x7045('0x9')]=function(_0x11184d,_0x5e8889){return _0x11184d['define'](_0x7045('0xa'),attributes,{'tableName':_0x7045('0xb'),'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 39045ec..af5c1d2 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 _0x0870=['create','body','options','raw','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','CreateReportAgentPreview'];(function(_0x3c2090,_0x4548fd){var _0x30ed8b=function(_0xddab49){while(--_0xddab49){_0x3c2090['push'](_0x3c2090['shift']());}};_0x30ed8b(++_0x4548fd);}(_0x0870,0x9c));var _0x0087=function(_0x51043d,_0x285da7){_0x51043d=_0x51043d-0x0;var _0x224034=_0x0870[_0x51043d];return _0x224034;};'use strict';var _=require('lodash');var util=require(_0x0087('0x0'));var moment=require(_0x0087('0x1'));var BPromise=require(_0x0087('0x2'));var rs=require(_0x0087('0x3'));var fs=require('fs');var Redis=require(_0x0087('0x4'));var db=require(_0x0087('0x5'))['db'];var utils=require(_0x0087('0x6'));var logger=require(_0x0087('0x7'))(_0x0087('0x8'));var config=require(_0x0087('0x9'));var jayson=require(_0x0087('0xa'));var client=jayson[_0x0087('0xb')][_0x0087('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ac6c6,_0xc944dc,_0x5a09b5){return new BPromise(function(_0x1aa697,_0x2c5a1f){return client[_0x0087('0xd')](_0x3ac6c6,_0x5a09b5)[_0x0087('0xe')](function(_0x3059cd){logger[_0x0087('0xf')](_0x0087('0x10'),_0xc944dc,_0x0087('0x11'));logger[_0x0087('0x12')](_0x0087('0x13'),_0xc944dc,_0x0087('0x11'),JSON['stringify'](_0x3059cd));if(_0x3059cd[_0x0087('0x14')]){if(_0x3059cd[_0x0087('0x14')]['code']===0x1f4){logger[_0x0087('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0xc944dc,_0x3059cd[_0x0087('0x14')]['message']);return _0x2c5a1f(_0x3059cd[_0x0087('0x14')][_0x0087('0x15')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0xc944dc,_0x3059cd[_0x0087('0x14')][_0x0087('0x15')]);return _0x1aa697(_0x3059cd[_0x0087('0x14')][_0x0087('0x15')]);}else{logger[_0x0087('0xf')](_0x0087('0x10'),_0xc944dc,_0x0087('0x11'));_0x1aa697(_0x3059cd[_0x0087('0x16')][_0x0087('0x15')]);}})['catch'](function(_0x2d7224){logger['error'](_0x0087('0x10'),_0xc944dc,_0x2d7224);_0x2c5a1f(_0x2d7224);});});}exports[_0x0087('0x17')]=function(_0x39c2b8){var _0xfc61a4=this;return new Promise(function(_0x416b22,_0x159a99){return db['ReportAgentPreview'][_0x0087('0x18')](_0x39c2b8[_0x0087('0x19')],{'raw':_0x39c2b8[_0x0087('0x1a')]?_0x39c2b8[_0x0087('0x1a')][_0x0087('0x1b')]===undefined?!![]:![]:!![]})[_0x0087('0xe')](function(_0x2afd98){logger[_0x0087('0xf')](_0x0087('0x17'),_0x39c2b8);logger[_0x0087('0x12')](_0x0087('0x17'),_0x39c2b8,JSON[_0x0087('0x1c')](_0x2afd98));_0x416b22(_0x2afd98);})[_0x0087('0x1d')](function(_0x5d0979){logger[_0x0087('0x14')](_0x0087('0x17'),_0x5d0979['message'],_0x39c2b8);_0x159a99(_0xfc61a4[_0x0087('0x14')](0x1f4,_0x5d0979[_0x0087('0x15')]));});});}; \ No newline at end of file +var _0x8e11=['create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8e11,0x1c5));var _0x18e1=function(_0x3a3e4f,_0x5b0b27){_0x3a3e4f=_0x3a3e4f-0x0;var _0x5841a6=_0x8e11[_0x3a3e4f];return _0x5841a6;};'use strict';var _=require(_0x18e1('0x0'));var util=require('util');var moment=require(_0x18e1('0x1'));var BPromise=require(_0x18e1('0x2'));var rs=require(_0x18e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18e1('0x4'))['db'];var utils=require(_0x18e1('0x5'));var logger=require(_0x18e1('0x6'))(_0x18e1('0x7'));var config=require(_0x18e1('0x8'));var jayson=require(_0x18e1('0x9'));var client=jayson[_0x18e1('0xa')][_0x18e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37f51c,_0x4dab53,_0x1843e3){return new BPromise(function(_0x13f8ca,_0x5642fc){return client[_0x18e1('0xc')](_0x37f51c,_0x1843e3)[_0x18e1('0xd')](function(_0x11addf){logger[_0x18e1('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x4dab53,_0x18e1('0xf'));logger[_0x18e1('0x10')](_0x18e1('0x11'),_0x4dab53,_0x18e1('0xf'),JSON[_0x18e1('0x12')](_0x11addf));if(_0x11addf[_0x18e1('0x13')]){if(_0x11addf[_0x18e1('0x13')][_0x18e1('0x14')]===0x1f4){logger['error'](_0x18e1('0x15'),_0x4dab53,_0x11addf[_0x18e1('0x13')][_0x18e1('0x16')]);return _0x5642fc(_0x11addf['error'][_0x18e1('0x16')]);}logger[_0x18e1('0x13')](_0x18e1('0x15'),_0x4dab53,_0x11addf[_0x18e1('0x13')][_0x18e1('0x16')]);return _0x13f8ca(_0x11addf['error']['message']);}else{logger[_0x18e1('0xe')](_0x18e1('0x15'),_0x4dab53,_0x18e1('0xf'));_0x13f8ca(_0x11addf[_0x18e1('0x17')][_0x18e1('0x16')]);}})[_0x18e1('0x18')](function(_0x28b109){logger[_0x18e1('0x13')](_0x18e1('0x15'),_0x4dab53,_0x28b109);_0x5642fc(_0x28b109);});});}exports[_0x18e1('0x19')]=function(_0xf31e57){var _0x3a3107=this;return new Promise(function(_0x25a898,_0x4f37f6){return db[_0x18e1('0x1a')][_0x18e1('0x1b')](_0xf31e57[_0x18e1('0x1c')],{'raw':_0xf31e57['options']?_0xf31e57[_0x18e1('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x18e1('0xd')](function(_0xe5b048){logger['info'](_0x18e1('0x19'),_0xf31e57);logger[_0x18e1('0x10')](_0x18e1('0x19'),_0xf31e57,JSON[_0x18e1('0x12')](_0xe5b048));_0x25a898(_0xe5b048);})[_0x18e1('0x18')](function(_0x318efe){logger[_0x18e1('0x13')](_0x18e1('0x19'),_0x318efe[_0x18e1('0x16')],_0xf31e57);_0x4f37f6(_0x3a3107['error'](0x1f4,_0x318efe[_0x18e1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ad53b1f..ef2b1a7 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 _0x65e1=['mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','post','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions'];(function(_0x4ca141,_0x28c31a){var _0xd7b085=function(_0x11f5c2){while(--_0x11f5c2){_0x4ca141['push'](_0x4ca141['shift']());}};_0xd7b085(++_0x28c31a);}(_0x65e1,0xc0));var _0x165e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x65e1[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x165e('0x0'));var util=require(_0x165e('0x1'));var path=require(_0x165e('0x2'));var express=require(_0x165e('0x3'));var router=express[_0x165e('0x4')]();var auth=require(_0x165e('0x5'));var controller=require(_0x165e('0x6'));router[_0x165e('0x7')](_0x165e('0x8'),auth[_0x165e('0x9')](),controller['voiceChannels']);router[_0x165e('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x165e('0x9')](),controller[_0x165e('0xa')]);router[_0x165e('0x7')](_0x165e('0xb'),auth[_0x165e('0x9')](),controller[_0x165e('0xc')]);router[_0x165e('0x7')](_0x165e('0xd'),auth[_0x165e('0x9')](),controller[_0x165e('0xe')]);router[_0x165e('0x7')]('/chat/queues',auth['isAuthenticated'](),controller[_0x165e('0xf')]);router[_0x165e('0x7')]('/mail/queues',auth[_0x165e('0x9')](),controller[_0x165e('0x10')]);router[_0x165e('0x7')](_0x165e('0x11'),auth[_0x165e('0x9')](),controller[_0x165e('0x12')]);router[_0x165e('0x7')](_0x165e('0x13'),auth['isAuthenticated'](),controller[_0x165e('0x14')]);router[_0x165e('0x7')](_0x165e('0x15'),auth[_0x165e('0x9')](),controller[_0x165e('0x16')]);router[_0x165e('0x7')](_0x165e('0x17'),auth[_0x165e('0x9')](),controller[_0x165e('0x18')]);router['get'](_0x165e('0x19'),auth[_0x165e('0x9')](),controller[_0x165e('0x1a')]);router[_0x165e('0x7')](_0x165e('0x1b'),auth['isAuthenticated'](),controller[_0x165e('0x1c')]);router[_0x165e('0x7')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x165e('0x1d')]);router[_0x165e('0x7')]('/voice/queues/channels/:uniqueid',auth[_0x165e('0x9')](),controller[_0x165e('0x1e')]);router[_0x165e('0x7')](_0x165e('0x1f'),auth[_0x165e('0x9')](),controller[_0x165e('0x20')]);router['get'](_0x165e('0x21'),auth[_0x165e('0x9')](),controller[_0x165e('0x22')]);router[_0x165e('0x7')](_0x165e('0x23'),auth['isAuthenticated'](),controller[_0x165e('0x24')]);router[_0x165e('0x7')](_0x165e('0x25'),auth[_0x165e('0x9')](),controller[_0x165e('0x26')]);router[_0x165e('0x7')](_0x165e('0x27'),auth[_0x165e('0x9')](),controller[_0x165e('0x28')]);router[_0x165e('0x7')](_0x165e('0x29'),auth['isAuthenticated'](),controller[_0x165e('0x2a')]);router[_0x165e('0x2b')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x165e('0x2c')]);router['get'](_0x165e('0x2d'),auth['isAuthenticated'](),controller['telephones']);router['get'](_0x165e('0x2e'),auth[_0x165e('0x9')](),controller[_0x165e('0x2f')]);router[_0x165e('0x7')](_0x165e('0x30'),auth[_0x165e('0x9')](),controller[_0x165e('0x31')]);router[_0x165e('0x7')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x165e('0x32')]);router[_0x165e('0x7')](_0x165e('0x33'),auth[_0x165e('0x9')](),controller[_0x165e('0x34')]);router[_0x165e('0x7')](_0x165e('0x35'),auth[_0x165e('0x9')](),controller[_0x165e('0x36')]);router[_0x165e('0x7')](_0x165e('0x37'),auth['isAuthenticated'](),controller[_0x165e('0x38')]);router[_0x165e('0x7')](_0x165e('0x39'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x165e('0x7')](_0x165e('0x3a'),auth[_0x165e('0x9')](),controller[_0x165e('0x3b')]);router[_0x165e('0x7')](_0x165e('0x3c'),auth[_0x165e('0x9')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x165e('0x3d'),auth[_0x165e('0x9')](),controller[_0x165e('0x3e')](_0x165e('0x3f')));router['get']('/mail/queues/:id',auth[_0x165e('0x9')](),controller['showMailQueues']);router['post'](_0x165e('0x40'),auth[_0x165e('0x9')](),controller[_0x165e('0x3e')](_0x165e('0x41')));router['get'](_0x165e('0x42'),auth[_0x165e('0x9')](),controller[_0x165e('0x43')]);router[_0x165e('0x44')]('/fax/queues/:id/notify',auth[_0x165e('0x9')](),controller[_0x165e('0x3e')](_0x165e('0x45')));router[_0x165e('0x7')]('/fax/queues/:id',auth[_0x165e('0x9')](),controller[_0x165e('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0x165e('0x9')](),controller[_0x165e('0x3e')](_0x165e('0x47')));router[_0x165e('0x7')](_0x165e('0x48'),auth['isAuthenticated'](),controller[_0x165e('0x49')]);router['post'](_0x165e('0x4a'),auth[_0x165e('0x9')](),controller['queueNotify'](_0x165e('0x4b')));router[_0x165e('0x44')](_0x165e('0x4c'),auth[_0x165e('0x9')](),controller[_0x165e('0x3e')](_0x165e('0x4d')));router['get'](_0x165e('0x4e'),auth[_0x165e('0x9')](),controller[_0x165e('0x4f')]);router[_0x165e('0x7')]('/whatsapp/queues/:id',auth[_0x165e('0x9')](),controller['showWhatsappQueues']);router['post'](_0x165e('0x50'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x165e('0x51')]=router; \ No newline at end of file +var _0xa880=['queueNotify','/mail/queues/:id','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify'];(function(_0x4e707d,_0x4d6037){var _0x2aa5b5=function(_0xb47f87){while(--_0xb47f87){_0x4e707d['push'](_0x4e707d['shift']());}};_0x2aa5b5(++_0x4d6037);}(_0xa880,0x9f));var _0x0a88=function(_0x420516,_0x5ce5ca){_0x420516=_0x420516-0x0;var _0x16484e=_0xa880[_0x420516];return _0x16484e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require('express');var router=express[_0x0a88('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x0a88('0x1'));router[_0x0a88('0x2')](_0x0a88('0x3'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x5')]);router[_0x0a88('0x2')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x0a88('0x4')](),controller[_0x0a88('0x6')]);router[_0x0a88('0x2')](_0x0a88('0x7'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x8')]);router['get']('/voice/queues',auth[_0x0a88('0x4')](),controller[_0x0a88('0x9')]);router[_0x0a88('0x2')]('/chat/queues',auth[_0x0a88('0x4')](),controller[_0x0a88('0xa')]);router[_0x0a88('0x2')](_0x0a88('0xb'),auth[_0x0a88('0x4')](),controller[_0x0a88('0xc')]);router[_0x0a88('0x2')](_0x0a88('0xd'),auth[_0x0a88('0x4')](),controller['mailAccounts']);router[_0x0a88('0x2')](_0x0a88('0xe'),auth[_0x0a88('0x4')](),controller[_0x0a88('0xf')]);router[_0x0a88('0x2')](_0x0a88('0x10'),auth['isAuthenticated'](),controller[_0x0a88('0x11')]);router['get'](_0x0a88('0x12'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x13')]);router[_0x0a88('0x2')](_0x0a88('0x14'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x15')]);router['get'](_0x0a88('0x16'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x17')]);router[_0x0a88('0x2')](_0x0a88('0x18'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x19')]);router['get'](_0x0a88('0x1a'),auth[_0x0a88('0x4')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x0a88('0x4')](),controller[_0x0a88('0x1b')]);router[_0x0a88('0x2')](_0x0a88('0x1c'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x1d')]);router[_0x0a88('0x2')](_0x0a88('0x1e'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x1f')]);router[_0x0a88('0x2')](_0x0a88('0x20'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x21')]);router[_0x0a88('0x2')]('/outbound/channels',auth[_0x0a88('0x4')](),controller[_0x0a88('0x22')]);router['get'](_0x0a88('0x23'),auth['isAuthenticated'](),controller['agents']);router[_0x0a88('0x24')](_0x0a88('0x25'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x26')]);router[_0x0a88('0x2')](_0x0a88('0x27'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x28')]);router[_0x0a88('0x2')](_0x0a88('0x29'),auth[_0x0a88('0x4')](),controller['trunks']);router[_0x0a88('0x2')](_0x0a88('0x2a'),auth['isAuthenticated'](),controller[_0x0a88('0x2b')]);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x0a88('0x2c')]);router[_0x0a88('0x2')](_0x0a88('0x2d'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router['get'](_0x0a88('0x2e'),auth[_0x0a88('0x4')](),controller['mailQueuesWaitingInteractions']);router[_0x0a88('0x2')]('/openchannel/queues/waitinginteractions',auth[_0x0a88('0x4')](),controller[_0x0a88('0x2f')]);router['get'](_0x0a88('0x30'),auth[_0x0a88('0x4')](),controller['smsQueuesWaitingInteractions']);router['get'](_0x0a88('0x31'),auth['isAuthenticated'](),controller[_0x0a88('0x32')]);router[_0x0a88('0x2')](_0x0a88('0x33'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x34')]);router['post'](_0x0a88('0x35'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x36')]('mail'));router['get'](_0x0a88('0x37'),auth[_0x0a88('0x4')](),controller['showMailQueues']);router[_0x0a88('0x38')](_0x0a88('0x39'),auth['isAuthenticated'](),controller[_0x0a88('0x36')](_0x0a88('0x3a')));router[_0x0a88('0x2')]('/chat/queues/:id',auth[_0x0a88('0x4')](),controller[_0x0a88('0x3b')]);router['post'](_0x0a88('0x3c'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x36')]('fax'));router[_0x0a88('0x2')](_0x0a88('0x3d'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x3e')]);router[_0x0a88('0x38')]('/openchannel/queues/:id/notify',auth[_0x0a88('0x4')](),controller['queueNotify']('openchannel'));router[_0x0a88('0x2')](_0x0a88('0x3f'),auth[_0x0a88('0x4')](),controller['showOpenchannelQueues']);router[_0x0a88('0x38')](_0x0a88('0x40'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x36')](_0x0a88('0x41')));router[_0x0a88('0x38')]('/whatsapp/queues/:id/notify',auth[_0x0a88('0x4')](),controller[_0x0a88('0x36')]('whatsapp'));router[_0x0a88('0x2')](_0x0a88('0x42'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x43')]);router[_0x0a88('0x2')](_0x0a88('0x44'),auth[_0x0a88('0x4')](),controller[_0x0a88('0x45')]);router[_0x0a88('0x38')](_0x0a88('0x46'),auth[_0x0a88('0x4')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index b024170..fdae3d0 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 _0xd53f=['MemberReport','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Account','findOne','messageId','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','create','Start','Interaction','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','jayson/promise','client','http','error','code','message','result','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','then','catch','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xd53f,0x131));var _0xfd53=function(_0x5c2dc8,_0x3bb768){_0x5c2dc8=_0x5c2dc8-0x0;var _0x1ca64c=_0xd53f[_0x5c2dc8];return _0x1ca64c;};'use strict';var BPromise=require(_0xfd53('0x0'));var moment=require(_0xfd53('0x1'));var _=require(_0xfd53('0x2'));var util=require('util');var db=require(_0xfd53('0x3'))['db'];var logger=require(_0xfd53('0x4'))('api');var jayson=require(_0xfd53('0x5'));var amiClient=jayson[_0xfd53('0x6')][_0xfd53('0x7')]({'port':0x232a});var mailClient=jayson[_0xfd53('0x6')][_0xfd53('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xfd53('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x59a6fa,_0x3fdfdd,_0x5c94ab){return new BPromise(function(_0x2763d4,_0x4a6935){var _0x11e8d5=_0x5c94ab?_0x5c94ab:amiClient;return _0x11e8d5['request'](_0x59a6fa,_0x3fdfdd)['then'](function(_0x320f0c){if(_0x320f0c['error']){if(_0x320f0c[_0xfd53('0x8')][_0xfd53('0x9')]===0x1f4){return _0x4a6935(_0x320f0c[_0xfd53('0x8')][_0xfd53('0xa')]);}return _0x2763d4(_0x320f0c['error'][_0xfd53('0xa')]);}else{_0x2763d4(_0x320f0c[_0xfd53('0xb')]);}})['catch'](function(_0x48ca31){_0x4a6935(_0x48ca31);});});}function respondWithResult(_0x5b0555,_0x213d51){_0x213d51=_0x213d51||0xc8;return function(_0x1043f9){if(_0x1043f9){return _0x5b0555[_0xfd53('0xc')](_0x213d51)[_0xfd53('0xd')](_0x1043f9);}return _0x5b0555[_0xfd53('0xe')](0x194);};}function handleError(_0x107d9c,_0x1d9d1e){_0x1d9d1e=_0x1d9d1e||0x1f4;return function(_0x49404){logger[_0xfd53('0x8')](_0x49404[_0xfd53('0xf')]);if(_0x49404[_0xfd53('0x10')]){delete _0x49404[_0xfd53('0x10')];}_0x107d9c['status'](_0x1d9d1e)[_0xfd53('0x11')](_0x49404);};}function findById(_0x2d9e67){return function(_0x2f11a0){if(!_['isNil'](_0x2d9e67)&&!_[_0xfd53('0x12')](_0x2f11a0)&&!_['isNil'](_0x2f11a0['rows'])){return _[_0xfd53('0x13')](_0x2f11a0[_0xfd53('0x14')],function(_0x4d3e65){return _0x4d3e65['id']==_0x2d9e67;});}return null;};}exports[_0xfd53('0x15')]=function(_0x5c0a45,_0x1bb14e){return respondWithRpcPromise(_0xfd53('0x16'),_0x5c0a45['query'])[_0xfd53('0x17')](respondWithResult(_0x1bb14e,null))[_0xfd53('0x18')](handleError(_0x1bb14e,null));};exports['voiceChannelMixMonitor']=function(_0x219f3b,_0x589309){return respondWithRpcPromise(_0xfd53('0x19'),_[_0xfd53('0x1a')](_0x219f3b[_0xfd53('0x1b')],_0x219f3b[_0xfd53('0x1c')]))[_0xfd53('0x17')](respondWithResult(_0x589309,null))[_0xfd53('0x18')](handleError(_0x589309,null));};exports[_0xfd53('0x1d')]=function(_0x3982dd,_0x4ff496){return respondWithRpcPromise(_0xfd53('0x1e'),_[_0xfd53('0x1a')](_0x3982dd[_0xfd53('0x1b')],_0x3982dd[_0xfd53('0x1c')]))[_0xfd53('0x17')](respondWithResult(_0x4ff496,null))[_0xfd53('0x18')](handleError(_0x4ff496,null));};exports[_0xfd53('0x1f')]=function(_0xdac9d7,_0x427019){return respondWithRpcPromise(_0xfd53('0x20'),_0xdac9d7['query'])[_0xfd53('0x17')](respondWithResult(_0x427019,null))[_0xfd53('0x18')](handleError(_0x427019,null));};exports[_0xfd53('0x21')]=function(_0x91c7cf,_0x523a8a){return respondWithRpcPromise(_0xfd53('0x20'),_0x91c7cf[_0xfd53('0x1b')])[_0xfd53('0x17')](findById(_0x91c7cf[_0xfd53('0x1c')]['id']))[_0xfd53('0x17')](respondWithResult(_0x523a8a,null))[_0xfd53('0x18')](handleError(_0x523a8a,null));};exports[_0xfd53('0x22')]=function(_0x9b3ec8,_0x224bc3){return respondWithRpcPromise(_0xfd53('0x23'),_[_0xfd53('0x1a')](_0x9b3ec8[_0xfd53('0x1b')],_0x9b3ec8[_0xfd53('0x1c')]))[_0xfd53('0x17')](respondWithResult(_0x224bc3,null))[_0xfd53('0x18')](handleError(_0x224bc3,null));};exports[_0xfd53('0x24')]=function(_0x3f1a84,_0x1e1280){return respondWithRpcPromise(_0xfd53('0x25'),_0x3f1a84[_0xfd53('0x1b')])[_0xfd53('0x17')](respondWithResult(_0x1e1280,null))[_0xfd53('0x18')](handleError(_0x1e1280,null));};exports[_0xfd53('0x26')]=function(_0x92f90d,_0x4b9845){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xfd53('0x1a')](_0x92f90d[_0xfd53('0x1b')],_0x92f90d[_0xfd53('0x1c')]))[_0xfd53('0x17')](respondWithResult(_0x4b9845,null))[_0xfd53('0x18')](handleError(_0x4b9845,null));};exports[_0xfd53('0x27')]=function(_0x29021b,_0x51ec3a){return respondWithRpcPromise(_0xfd53('0x28'),_[_0xfd53('0x1a')](_0x29021b[_0xfd53('0x1b')],_0x29021b['params']))[_0xfd53('0x17')](respondWithResult(_0x51ec3a,null))['catch'](handleError(_0x51ec3a,null));};exports[_0xfd53('0x29')]=function(_0x4a31a5,_0x2a0cc7){return respondWithRpcPromise(_0xfd53('0x2a'),_['merge'](_0x4a31a5[_0xfd53('0x1b')],_0x4a31a5['params']))[_0xfd53('0x17')](respondWithResult(_0x2a0cc7,null))[_0xfd53('0x18')](handleError(_0x2a0cc7,null));};exports['outbound']=function(_0x1f6b33,_0x41bca7){return respondWithRpcPromise(_0xfd53('0x2b'),_0x1f6b33[_0xfd53('0x1b')])['then'](respondWithResult(_0x41bca7,null))[_0xfd53('0x18')](handleError(_0x41bca7,null));};exports[_0xfd53('0x2c')]=function(_0x3d2c00,_0x3cec96){return respondWithRpcPromise(_0xfd53('0x2d'),_0x3d2c00[_0xfd53('0x1b')])[_0xfd53('0x17')](respondWithResult(_0x3cec96,null))['catch'](handleError(_0x3cec96,null));};exports[_0xfd53('0x2e')]=function(_0x10d36c,_0x5778f7){var _0x2a7966;return respondWithRpcPromise(_0xfd53('0x2f'),_0x10d36c[_0xfd53('0x1b')])[_0xfd53('0x17')](function(_0x2fe679){_0x2a7966=_0x2fe679;return respondWithRpcPromise(_0xfd53('0x2f'),_0x10d36c[_0xfd53('0x1b')],routingClient);})[_0xfd53('0x17')](function(_0x1ff55a){return _[_0xfd53('0x1a')]({},_0x1ff55a,_0x2a7966);})[_0xfd53('0x17')](respondWithResult(_0x5778f7,null))[_0xfd53('0x18')](handleError(_0x5778f7,null));};exports[_0xfd53('0x30')]=function(_0x54ecb4,_0x193b8c){if(_0x54ecb4[_0xfd53('0x31')]&&_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')]&&_0x54ecb4[_0xfd53('0x33')]&&_0x54ecb4[_0xfd53('0x33')][_0xfd53('0x10')]){for(var _0x22812b in _0x54ecb4['body'][_0xfd53('0x32')]){if(_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')][_0xfd53('0x34')](_0x22812b)){db['MemberReport']['findAll']({'where':{'channel':_0x22812b,'membername':_0x54ecb4['user']['name'],'type':_0xfd53('0x35'),'exitAt':null,'uniqueid':_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')][_0x22812b]&&_0x54ecb4[_0xfd53('0x31')]['interaction'][_0x22812b][_0xfd53('0x36')]?{'$notIn':_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')][_0x22812b]}:{'$ne':null}}})[_0xfd53('0x17')](function(_0x4aee4b){var _0x16d852=moment()[_0xfd53('0x37')](_0xfd53('0x38'));for(var _0x1314bc=0x0,_0x3584ea=_0x4aee4b[_0xfd53('0x36')];_0x1314bc<_0x3584ea;_0x1314bc+=0x1){_0x4aee4b[_0x1314bc][_0xfd53('0x39')]({'exitAt':_0x16d852});}});for(var _0x3e8096=0x0;_0x3e8096<_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')][_0x22812b]['length'];_0x3e8096+=0x1){db[_0xfd53('0x3a')][_0xfd53('0x3b')]({'where':{'channel':_0x22812b,'membername':_0x54ecb4[_0xfd53('0x33')][_0xfd53('0x10')],'type':'INTERACTION','uniqueid':_0x54ecb4[_0xfd53('0x31')][_0xfd53('0x32')][_0x22812b][_0x3e8096],'exitAt':null},'defaults':{'channel':_0x22812b,'membername':_0x54ecb4[_0xfd53('0x33')]['name'],'interface':_[_0xfd53('0x12')](_0x54ecb4['user'][_0xfd53('0x3c')])?util[_0xfd53('0x37')]('SIP/%s',_0x54ecb4[_0xfd53('0x33')][_0xfd53('0x10')]):_0x54ecb4[_0xfd53('0x33')]['interface'],'type':_0xfd53('0x35'),'enterAt':moment()[_0xfd53('0x37')](_0xfd53('0x38')),'role':_0xfd53('0x3d'),'internal':_0x54ecb4['user'][_0xfd53('0x3e')],'uniqueid':_0x54ecb4['body'][_0xfd53('0x32')][_0x22812b][_0x3e8096]}});}}}}return respondWithRpcPromise(_0xfd53('0x3f'),{'id':_0x54ecb4['params']['id'],'capacity':_0x54ecb4['body'][_0xfd53('0x40')]},routingClient)['then'](respondWithResult(_0x193b8c,null))[_0xfd53('0x18')](handleError(_0x193b8c,null));};exports[_0xfd53('0x41')]=function(_0x218b34,_0x27d1c7){return respondWithRpcPromise('Telephones',_0x218b34['query'])['then'](respondWithResult(_0x27d1c7,null))[_0xfd53('0x18')](handleError(_0x27d1c7,null));};exports[_0xfd53('0x42')]=function(_0x5de01a,_0x202a05){return respondWithRpcPromise(_0xfd53('0x43'),_0x5de01a['query'])[_0xfd53('0x17')](respondWithResult(_0x202a05,null))[_0xfd53('0x18')](handleError(_0x202a05,null));};exports[_0xfd53('0x44')]=function(_0x49cf95,_0x361004){return respondWithRpcPromise('Campaigns',_0x49cf95[_0xfd53('0x1b')])[_0xfd53('0x17')](respondWithResult(_0x361004,null))[_0xfd53('0x18')](handleError(_0x361004,null));};exports[_0xfd53('0x45')]=function(_0x4dfb6e,_0x47674b){return respondWithRpcPromise(_0xfd53('0x46'),_0x4dfb6e['query'],routingClient)[_0xfd53('0x17')](respondWithResult(_0x47674b,null))[_0xfd53('0x18')](handleError(_0x47674b,null));};exports[_0xfd53('0x47')]=function(_0x5018c6,_0x58bbe1){return respondWithRpcPromise('ChatQueues',_0x5018c6[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](findById(_0x5018c6[_0xfd53('0x1c')]['id']))[_0xfd53('0x17')](respondWithResult(_0x58bbe1,null))[_0xfd53('0x18')](handleError(_0x58bbe1,null));};exports[_0xfd53('0x48')]=function(_0xd8207a,_0x45d813){return respondWithRpcPromise(_0xfd53('0x49'),_0xd8207a[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x45d813,null))['catch'](handleError(_0x45d813,null));};exports[_0xfd53('0x4a')]=function(_0x421e24,_0x12a226){return respondWithRpcPromise(_0xfd53('0x49'),_0x421e24[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](findById(_0x421e24[_0xfd53('0x1c')]['id']))['then'](respondWithResult(_0x12a226,null))[_0xfd53('0x18')](handleError(_0x12a226,null));};exports[_0xfd53('0x4b')]=function(_0xeaba48,_0x5a755e){return respondWithRpcPromise(_0xfd53('0x4c'),_0xeaba48[_0xfd53('0x1b')],mailClient)[_0xfd53('0x17')](respondWithResult(_0x5a755e,null))[_0xfd53('0x18')](handleError(_0x5a755e,null));};exports[_0xfd53('0x4d')]=function(_0x2089be,_0x339f6a){return respondWithRpcPromise('OpenchannelQueues',_0x2089be[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x339f6a,null))['catch'](handleError(_0x339f6a,null));};exports['showOpenchannelQueues']=function(_0x404b00,_0xf059cc){return respondWithRpcPromise(_0xfd53('0x4e'),_0x404b00[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](findById(_0x404b00[_0xfd53('0x1c')]['id']))[_0xfd53('0x17')](respondWithResult(_0xf059cc,null))[_0xfd53('0x18')](handleError(_0xf059cc,null));};exports[_0xfd53('0x4f')]=function(_0x1b646d,_0x694227){return respondWithRpcPromise(_0xfd53('0x50'),_0x1b646d[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x694227,null))[_0xfd53('0x18')](handleError(_0x694227,null));};exports['showSmsQueues']=function(_0xdcf26a,_0x587002){return respondWithRpcPromise('SmsQueues',_0xdcf26a['query'],routingClient)[_0xfd53('0x17')](findById(_0xdcf26a['params']['id']))[_0xfd53('0x17')](respondWithResult(_0x587002,null))[_0xfd53('0x18')](handleError(_0x587002,null));};exports[_0xfd53('0x51')]=function(_0x4f6a98,_0x1a5be9){return respondWithRpcPromise(_0xfd53('0x52'),_0x4f6a98[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x1a5be9,null))[_0xfd53('0x18')](handleError(_0x1a5be9,null));};exports['showWhatsappQueues']=function(_0x5d43a5,_0x3a281c){return respondWithRpcPromise(_0xfd53('0x52'),_0x5d43a5[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](findById(_0x5d43a5[_0xfd53('0x1c')]['id']))[_0xfd53('0x17')](respondWithResult(_0x3a281c,null))[_0xfd53('0x18')](handleError(_0x3a281c,null));};exports[_0xfd53('0x53')]=function(_0x5d0832,_0x29eb53){return respondWithRpcPromise(_0xfd53('0x54'),_0x5d0832['query'],routingClient)[_0xfd53('0x17')](respondWithResult(_0x29eb53,null))['catch'](handleError(_0x29eb53,null));};exports[_0xfd53('0x55')]=function(_0x530dc3,_0x4b3dab){return respondWithRpcPromise(_0xfd53('0x54'),_0x530dc3[_0xfd53('0x1b')],routingClient)['then'](findById(_0x530dc3[_0xfd53('0x1c')]['id']))[_0xfd53('0x17')](respondWithResult(_0x4b3dab,null))[_0xfd53('0x18')](handleError(_0x4b3dab,null));};exports[_0xfd53('0x56')]=function(_0x1a96d1,_0x5e8963){return respondWithRpcPromise(_0xfd53('0x57'),_0x1a96d1['query'])[_0xfd53('0x17')](respondWithResult(_0x5e8963,null))[_0xfd53('0x18')](handleError(_0x5e8963,null));};exports[_0xfd53('0x58')]=function(_0x5ed683,_0x490644){return respondWithRpcPromise(_0xfd53('0x59'),_0x5ed683[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x490644,null))[_0xfd53('0x18')](handleError(_0x490644,null));};exports[_0xfd53('0x5a')]=function(_0x3e6648,_0x5d2928){return respondWithRpcPromise(_0xfd53('0x5b'),_0x3e6648[_0xfd53('0x1b')],routingClient)['then'](respondWithResult(_0x5d2928,null))['catch'](handleError(_0x5d2928,null));};exports[_0xfd53('0x5c')]=function(_0x44b39a,_0x215c8a){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x44b39a[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x215c8a,null))[_0xfd53('0x18')](handleError(_0x215c8a,null));};exports[_0xfd53('0x5d')]=function(_0x19bf2c,_0x5c3ea6){return respondWithRpcPromise(_0xfd53('0x5e'),_0x19bf2c['query'],routingClient)['then'](respondWithResult(_0x5c3ea6,null))[_0xfd53('0x18')](handleError(_0x5c3ea6,null));};exports[_0xfd53('0x5f')]=function(_0x5decf6,_0x1aec57){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x5decf6[_0xfd53('0x1b')],routingClient)[_0xfd53('0x17')](respondWithResult(_0x1aec57,null))[_0xfd53('0x18')](handleError(_0x1aec57,null));};exports['faxQueuesWaitingInteractions']=function(_0xb3417a,_0x4fb384){return respondWithRpcPromise(_0xfd53('0x60'),_0xb3417a[_0xfd53('0x1b')],routingClient)['then'](respondWithResult(_0x4fb384,null))[_0xfd53('0x18')](handleError(_0x4fb384,null));};exports['queueNotify']=function(_0x2c1222){return function(_0x489445,_0x49be9b){var _0xe435f5,_0x4d71c4;var _0xdae206=_['capitalize'](_0x2c1222);var _0x2aac2d=_0x2c1222===_0xfd53('0x61')?_0xfd53('0x62'):_0xfd53('0x63');return db[_0xdae206+'Queue'][_0xfd53('0x64')]({'raw':!![],'where':{'id':_0x489445['params']['id']}})[_0xfd53('0x17')](function(_0x422955){if(_[_0xfd53('0x12')](_0x422955)){throw new Error(_0xdae206+'\x20Queue\x20not\x20found');}_0xe435f5=_0x422955;return db[_0xdae206+'Message']['findOne']({'where':{'id':_0x489445[_0xfd53('0x31')][_0xfd53('0x65')]},'include':[{'model':db[_0xdae206+'Interaction'],'as':'Interaction'},{'model':db[_0xdae206+_0x2aac2d],'as':'Account'}]});})[_0xfd53('0x17')](function(_0x17581e){if(_[_0xfd53('0x12')](_0x17581e)){throw new Error(_0xdae206+_0xfd53('0x66'));}_0x4d71c4=_0x17581e;return _0x17581e[_0xfd53('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfd53('0x17')](function(){var _0x133764={'uniqueid':_0x2c1222+'.'+_0x4d71c4['id']+'.'+_0x4d71c4['Interaction']['id'],'FromUserId':_0x489445[_0xfd53('0x33')]['id'],'type':_0xfd53('0x68')};_0x133764[_0xdae206+_0xfd53('0x69')]=_0x4d71c4['id'];_0x133764[_0xdae206+_0xfd53('0x6a')]=_0x4d71c4['Interaction']['id'];_0x133764[_0xfd53('0x6b')+_0xdae206+_0x2aac2d+'Id']=_0x4d71c4[_0xfd53('0x63')]['id'];_0x133764['To'+_0xdae206+_0xfd53('0x6c')]=_0xe435f5['id'];return db[_0xdae206+'TransferReport'][_0xfd53('0x6d')](_0x133764);})[_0xfd53('0x17')](function(){return respondWithRpcPromise(_0xfd53('0x6e'),{'channel':_0x2c1222,'interaction':_0x4d71c4[_0xfd53('0x6f')],'message':_0x4d71c4,'account':_0x4d71c4['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xfd53('0x68'),'appdata':_0xe435f5['name']+','+(_0x4d71c4[_0xfd53('0x63')][_0xfd53('0x70')]||0x12c),'interval':_0xfd53('0x71')}]},routingClient);})[_0xfd53('0x17')](respondWithResult(_0x49be9b,null))[_0xfd53('0x18')](handleError(_0x49be9b,null));};};exports[_0xfd53('0x72')]=function(_0x16fbc1,_0x3aebb0){var _0x3fe0a6,_0x333c52;if(_[_0xfd53('0x12')](_0x16fbc1[_0xfd53('0x31')][_0xfd53('0x73')])){throw new Error(_0xfd53('0x74'));}var _0x219b1f=_0x16fbc1[_0xfd53('0x31')][_0xfd53('0x73')];var _0x3e1a70=_[_0xfd53('0x75')](_0x219b1f);var _0x66fc00=_0x219b1f===_0xfd53('0x61')?_0xfd53('0x62'):'Account';return db[_0xfd53('0x76')][_0xfd53('0x64')]({'raw':!![],'where':{'id':_0x16fbc1[_0xfd53('0x1c')]['id'],'role':_0xfd53('0x3d')}})[_0xfd53('0x17')](function(_0x4fd5b0){if(_[_0xfd53('0x12')](_0x4fd5b0)){throw new Error(_0xfd53('0x77'));}_0x3fe0a6=_0x4fd5b0;return db[_0x3e1a70+'Message'][_0xfd53('0x64')]({'where':{'id':_0x16fbc1['body'][_0xfd53('0x65')]},'include':[{'model':db[_0x3e1a70+_0xfd53('0x6f')],'as':_0xfd53('0x6f')},{'model':db[_0x3e1a70+_0x66fc00],'as':_0xfd53('0x63')}]});})[_0xfd53('0x17')](function(_0x48d716){if(_[_0xfd53('0x12')](_0x48d716)){throw new Error(_0x3e1a70+_0xfd53('0x66'));}_0x333c52=_0x48d716;return _0x48d716[_0xfd53('0x67')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x477bb4={'uniqueid':_0x219b1f+'.'+_0x333c52['id']+'.'+_0x333c52[_0xfd53('0x6f')]['id'],'FromUserId':_0x16fbc1[_0xfd53('0x33')]['id'],'type':_0xfd53('0x68'),'ToUserId':_0x3fe0a6['id']};_0x477bb4[_0x3e1a70+_0xfd53('0x69')]=_0x333c52['id'];_0x477bb4[_0x3e1a70+_0xfd53('0x6a')]=_0x333c52[_0xfd53('0x6f')]['id'];_0x477bb4[_0xfd53('0x6b')+_0x3e1a70+_0x66fc00+'Id']=_0x333c52[_0xfd53('0x63')]['id'];return db[_0x3e1a70+'TransferReport'][_0xfd53('0x6d')](_0x477bb4);})[_0xfd53('0x17')](function(){return respondWithRpcPromise(_0xfd53('0x6e'),{'channel':_0x219b1f,'interaction':_0x333c52[_0xfd53('0x6f')],'message':_0x333c52,'account':_0x333c52['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xfd53('0x3d'),'appdata':_0x3fe0a6['name']+','+(_0x333c52[_0xfd53('0x63')][_0xfd53('0x78')]||0x12c),'interval':_0xfd53('0x71')}]},routingClient);})['then'](respondWithResult(_0x3aebb0,null))['catch'](handleError(_0x3aebb0,null));}; \ No newline at end of file +var _0x5420=['status','json','stack','name','isNil','find','rows','VoiceChannels','query','then','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','internal','AgentCapacity','capacity','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','From','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','agent','Agent\x20not\x20found','update','MessageId','InteractionId','Start','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch'];(function(_0x12ac84,_0x448110){var _0x4facd0=function(_0x174100){while(--_0x174100){_0x12ac84['push'](_0x12ac84['shift']());}};_0x4facd0(++_0x448110);}(_0x5420,0x1ba));var _0x0542=function(_0x120ee5,_0x296702){_0x120ee5=_0x120ee5-0x0;var _0x76e2cc=_0x5420[_0x120ee5];return _0x76e2cc;};'use strict';var BPromise=require(_0x0542('0x0'));var moment=require('moment');var _=require(_0x0542('0x1'));var util=require(_0x0542('0x2'));var db=require(_0x0542('0x3'))['db'];var logger=require(_0x0542('0x4'))(_0x0542('0x5'));var jayson=require(_0x0542('0x6'));var amiClient=jayson[_0x0542('0x7')][_0x0542('0x8')]({'port':0x232a});var mailClient=jayson[_0x0542('0x7')][_0x0542('0x8')]({'port':0x232b});var routingClient=jayson[_0x0542('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0xd6fab,_0x5970f0,_0x56d028){return new BPromise(function(_0x36bc07,_0x189762){var _0x33e252=_0x56d028?_0x56d028:amiClient;return _0x33e252[_0x0542('0x9')](_0xd6fab,_0x5970f0)['then'](function(_0x5b87f8){if(_0x5b87f8[_0x0542('0xa')]){if(_0x5b87f8[_0x0542('0xa')]['code']===0x1f4){return _0x189762(_0x5b87f8[_0x0542('0xa')]['message']);}return _0x36bc07(_0x5b87f8['error'][_0x0542('0xb')]);}else{_0x36bc07(_0x5b87f8[_0x0542('0xc')]);}})[_0x0542('0xd')](function(_0x5eb300){_0x189762(_0x5eb300);});});}function respondWithResult(_0x1a7276,_0x116d24){_0x116d24=_0x116d24||0xc8;return function(_0x3943ad){if(_0x3943ad){return _0x1a7276[_0x0542('0xe')](_0x116d24)[_0x0542('0xf')](_0x3943ad);}return _0x1a7276['sendStatus'](0x194);};}function handleError(_0x1653ef,_0x284689){_0x284689=_0x284689||0x1f4;return function(_0xb93fc5){logger[_0x0542('0xa')](_0xb93fc5[_0x0542('0x10')]);if(_0xb93fc5[_0x0542('0x11')]){delete _0xb93fc5[_0x0542('0x11')];}_0x1653ef[_0x0542('0xe')](_0x284689)['send'](_0xb93fc5);};}function findById(_0x1d4d64){return function(_0x3cc0b5){if(!_[_0x0542('0x12')](_0x1d4d64)&&!_['isNil'](_0x3cc0b5)&&!_['isNil'](_0x3cc0b5['rows'])){return _[_0x0542('0x13')](_0x3cc0b5[_0x0542('0x14')],function(_0x5566b2){return _0x5566b2['id']==_0x1d4d64;});}return null;};}exports['voiceChannels']=function(_0x46ff5b,_0x4a36ce){return respondWithRpcPromise(_0x0542('0x15'),_0x46ff5b[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x4a36ce,null))[_0x0542('0xd')](handleError(_0x4a36ce,null));};exports['voiceChannelMixMonitor']=function(_0x14d210,_0x4e1737){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x0542('0x18')](_0x14d210['query'],_0x14d210[_0x0542('0x19')]))['then'](respondWithResult(_0x4e1737,null))['catch'](handleError(_0x4e1737,null));};exports[_0x0542('0x1a')]=function(_0x297a87,_0xa2e549){return respondWithRpcPromise(_0x0542('0x1b'),_[_0x0542('0x18')](_0x297a87[_0x0542('0x16')],_0x297a87[_0x0542('0x19')]))['then'](respondWithResult(_0xa2e549,null))[_0x0542('0xd')](handleError(_0xa2e549,null));};exports['voiceQueues']=function(_0x204afc,_0xe07d10){return respondWithRpcPromise(_0x0542('0x1c'),_0x204afc[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0xe07d10,null))[_0x0542('0xd')](handleError(_0xe07d10,null));};exports[_0x0542('0x1d')]=function(_0x2a6925,_0x559af1){return respondWithRpcPromise('VoiceQueues',_0x2a6925[_0x0542('0x16')])[_0x0542('0x17')](findById(_0x2a6925['params']['id']))['then'](respondWithResult(_0x559af1,null))[_0x0542('0xd')](handleError(_0x559af1,null));};exports['voiceQueuesPreview']=function(_0x5a2e29,_0x39ad8a){return respondWithRpcPromise(_0x0542('0x1e'),_[_0x0542('0x18')](_0x5a2e29['query'],_0x5a2e29[_0x0542('0x19')]))[_0x0542('0x17')](respondWithResult(_0x39ad8a,null))[_0x0542('0xd')](handleError(_0x39ad8a,null));};exports['voiceQueuesChannels']=function(_0x351ae8,_0x583dd6){return respondWithRpcPromise(_0x0542('0x1f'),_0x351ae8[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x583dd6,null))[_0x0542('0xd')](handleError(_0x583dd6,null));};exports[_0x0542('0x20')]=function(_0x5790a3,_0x4889b7){return respondWithRpcPromise(_0x0542('0x21'),_[_0x0542('0x18')](_0x5790a3[_0x0542('0x16')],_0x5790a3[_0x0542('0x19')]))[_0x0542('0x17')](respondWithResult(_0x4889b7,null))[_0x0542('0xd')](handleError(_0x4889b7,null));};exports[_0x0542('0x22')]=function(_0x35a4ab,_0x17359d){return respondWithRpcPromise(_0x0542('0x23'),_[_0x0542('0x18')](_0x35a4ab['query'],_0x35a4ab['params']))['then'](respondWithResult(_0x17359d,null))[_0x0542('0xd')](handleError(_0x17359d,null));};exports['voiceQueuesChannelRedirect']=function(_0x461512,_0x7a5eb1){return respondWithRpcPromise(_0x0542('0x24'),_['merge'](_0x461512[_0x0542('0x16')],_0x461512[_0x0542('0x19')]))['then'](respondWithResult(_0x7a5eb1,null))[_0x0542('0xd')](handleError(_0x7a5eb1,null));};exports['outbound']=function(_0x597774,_0x598bed){return respondWithRpcPromise(_0x0542('0x25'),_0x597774[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x598bed,null))[_0x0542('0xd')](handleError(_0x598bed,null));};exports[_0x0542('0x26')]=function(_0x48bc87,_0x55aa8c){return respondWithRpcPromise(_0x0542('0x27'),_0x48bc87[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x55aa8c,null))['catch'](handleError(_0x55aa8c,null));};exports[_0x0542('0x28')]=function(_0x36819f,_0x243afc){var _0x1406b5;return respondWithRpcPromise(_0x0542('0x29'),_0x36819f[_0x0542('0x16')])['then'](function(_0x9e7bf2){_0x1406b5=_0x9e7bf2;return respondWithRpcPromise(_0x0542('0x29'),_0x36819f[_0x0542('0x16')],routingClient);})[_0x0542('0x17')](function(_0x48df5c){return _['merge']({},_0x48df5c,_0x1406b5);})[_0x0542('0x17')](respondWithResult(_0x243afc,null))[_0x0542('0xd')](handleError(_0x243afc,null));};exports[_0x0542('0x2a')]=function(_0x1eaf3d,_0x162cc7){if(_0x1eaf3d[_0x0542('0x2b')]&&_0x1eaf3d['body'][_0x0542('0x2c')]&&_0x1eaf3d[_0x0542('0x2d')]&&_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x11')]){for(var _0x5e053e in _0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')]){if(_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')]['hasOwnProperty'](_0x5e053e)){db[_0x0542('0x2e')][_0x0542('0x2f')]({'where':{'channel':_0x5e053e,'membername':_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')][_0x5e053e]&&_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')][_0x5e053e][_0x0542('0x30')]?{'$notIn':_0x1eaf3d['body'][_0x0542('0x2c')][_0x5e053e]}:{'$ne':null}}})[_0x0542('0x17')](function(_0x3cbdb7){var _0x18736b=moment()[_0x0542('0x31')](_0x0542('0x32'));for(var _0x3c60ff=0x0,_0x10a324=_0x3cbdb7[_0x0542('0x30')];_0x3c60ff<_0x10a324;_0x3c60ff+=0x1){_0x3cbdb7[_0x3c60ff][_0x0542('0x33')]({'exitAt':_0x18736b});}});for(var _0x5d6513=0x0;_0x5d6513<_0x1eaf3d['body'][_0x0542('0x2c')][_0x5e053e][_0x0542('0x30')];_0x5d6513+=0x1){db[_0x0542('0x2e')][_0x0542('0x34')]({'where':{'channel':_0x5e053e,'membername':_0x1eaf3d['user'][_0x0542('0x11')],'type':_0x0542('0x35'),'uniqueid':_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')][_0x5e053e][_0x5d6513],'exitAt':null},'defaults':{'channel':_0x5e053e,'membername':_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x11')],'interface':_['isNil'](_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x36')])?util[_0x0542('0x31')](_0x0542('0x37'),_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x11')]):_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x36')],'type':_0x0542('0x35'),'enterAt':moment()[_0x0542('0x31')](_0x0542('0x32')),'role':'agent','internal':_0x1eaf3d[_0x0542('0x2d')][_0x0542('0x38')],'uniqueid':_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x2c')][_0x5e053e][_0x5d6513]}});}}}}return respondWithRpcPromise(_0x0542('0x39'),{'id':_0x1eaf3d[_0x0542('0x19')]['id'],'capacity':_0x1eaf3d[_0x0542('0x2b')][_0x0542('0x3a')]},routingClient)['then'](respondWithResult(_0x162cc7,null))['catch'](handleError(_0x162cc7,null));};exports['telephones']=function(_0x292d82,_0x5746c9){return respondWithRpcPromise('Telephones',_0x292d82[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x5746c9,null))[_0x0542('0xd')](handleError(_0x5746c9,null));};exports['trunks']=function(_0xb21b27,_0x54eb91){return respondWithRpcPromise(_0x0542('0x3b'),_0xb21b27['query'])[_0x0542('0x17')](respondWithResult(_0x54eb91,null))[_0x0542('0xd')](handleError(_0x54eb91,null));};exports[_0x0542('0x3c')]=function(_0x55e568,_0x56068f){return respondWithRpcPromise(_0x0542('0x3d'),_0x55e568[_0x0542('0x16')])['then'](respondWithResult(_0x56068f,null))[_0x0542('0xd')](handleError(_0x56068f,null));};exports[_0x0542('0x3e')]=function(_0x596bd0,_0x49dbbf){return respondWithRpcPromise('ChatQueues',_0x596bd0['query'],routingClient)[_0x0542('0x17')](respondWithResult(_0x49dbbf,null))[_0x0542('0xd')](handleError(_0x49dbbf,null));};exports[_0x0542('0x3f')]=function(_0x4ceac8,_0x1898f5){return respondWithRpcPromise(_0x0542('0x40'),_0x4ceac8[_0x0542('0x16')],routingClient)[_0x0542('0x17')](findById(_0x4ceac8['params']['id']))[_0x0542('0x17')](respondWithResult(_0x1898f5,null))[_0x0542('0xd')](handleError(_0x1898f5,null));};exports[_0x0542('0x41')]=function(_0x3b2675,_0x284288){return respondWithRpcPromise(_0x0542('0x42'),_0x3b2675['query'],routingClient)[_0x0542('0x17')](respondWithResult(_0x284288,null))[_0x0542('0xd')](handleError(_0x284288,null));};exports[_0x0542('0x43')]=function(_0x20fedb,_0xe3eacb){return respondWithRpcPromise(_0x0542('0x42'),_0x20fedb[_0x0542('0x16')],routingClient)[_0x0542('0x17')](findById(_0x20fedb['params']['id']))[_0x0542('0x17')](respondWithResult(_0xe3eacb,null))[_0x0542('0xd')](handleError(_0xe3eacb,null));};exports[_0x0542('0x44')]=function(_0x7da7eb,_0x294ea0){return respondWithRpcPromise(_0x0542('0x45'),_0x7da7eb[_0x0542('0x16')],mailClient)['then'](respondWithResult(_0x294ea0,null))[_0x0542('0xd')](handleError(_0x294ea0,null));};exports['openchannelQueues']=function(_0x14927a,_0x10ea73){return respondWithRpcPromise('OpenchannelQueues',_0x14927a[_0x0542('0x16')],routingClient)[_0x0542('0x17')](respondWithResult(_0x10ea73,null))['catch'](handleError(_0x10ea73,null));};exports[_0x0542('0x46')]=function(_0x599c4b,_0x2e3156){return respondWithRpcPromise('OpenchannelQueues',_0x599c4b['query'],routingClient)['then'](findById(_0x599c4b['params']['id']))[_0x0542('0x17')](respondWithResult(_0x2e3156,null))[_0x0542('0xd')](handleError(_0x2e3156,null));};exports[_0x0542('0x47')]=function(_0x51f00c,_0xfbd705){return respondWithRpcPromise('SmsQueues',_0x51f00c['query'],routingClient)[_0x0542('0x17')](respondWithResult(_0xfbd705,null))[_0x0542('0xd')](handleError(_0xfbd705,null));};exports[_0x0542('0x48')]=function(_0x45295b,_0x2a97ab){return respondWithRpcPromise('SmsQueues',_0x45295b[_0x0542('0x16')],routingClient)[_0x0542('0x17')](findById(_0x45295b[_0x0542('0x19')]['id']))['then'](respondWithResult(_0x2a97ab,null))[_0x0542('0xd')](handleError(_0x2a97ab,null));};exports[_0x0542('0x49')]=function(_0x428dfd,_0x38f5a7){return respondWithRpcPromise(_0x0542('0x4a'),_0x428dfd[_0x0542('0x16')],routingClient)[_0x0542('0x17')](respondWithResult(_0x38f5a7,null))[_0x0542('0xd')](handleError(_0x38f5a7,null));};exports[_0x0542('0x4b')]=function(_0x4c2a6f,_0x5d1feb){return respondWithRpcPromise(_0x0542('0x4a'),_0x4c2a6f[_0x0542('0x16')],routingClient)['then'](findById(_0x4c2a6f[_0x0542('0x19')]['id']))[_0x0542('0x17')](respondWithResult(_0x5d1feb,null))[_0x0542('0xd')](handleError(_0x5d1feb,null));};exports[_0x0542('0x4c')]=function(_0x58fc99,_0x3a24bb){return respondWithRpcPromise(_0x0542('0x4d'),_0x58fc99[_0x0542('0x16')],routingClient)['then'](respondWithResult(_0x3a24bb,null))[_0x0542('0xd')](handleError(_0x3a24bb,null));};exports[_0x0542('0x4e')]=function(_0x250b97,_0x3572ae){return respondWithRpcPromise(_0x0542('0x4d'),_0x250b97['query'],routingClient)[_0x0542('0x17')](findById(_0x250b97[_0x0542('0x19')]['id']))[_0x0542('0x17')](respondWithResult(_0x3572ae,null))[_0x0542('0xd')](handleError(_0x3572ae,null));};exports['faxAccounts']=function(_0x449f1d,_0x355e43){return respondWithRpcPromise(_0x0542('0x4f'),_0x449f1d[_0x0542('0x16')])[_0x0542('0x17')](respondWithResult(_0x355e43,null))[_0x0542('0xd')](handleError(_0x355e43,null));};exports[_0x0542('0x50')]=function(_0x3e9735,_0x1e4d98){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3e9735[_0x0542('0x16')],routingClient)['then'](respondWithResult(_0x1e4d98,null))[_0x0542('0xd')](handleError(_0x1e4d98,null));};exports[_0x0542('0x51')]=function(_0x7ad43,_0x14ab3b){return respondWithRpcPromise(_0x0542('0x52'),_0x7ad43[_0x0542('0x16')],routingClient)[_0x0542('0x17')](respondWithResult(_0x14ab3b,null))[_0x0542('0xd')](handleError(_0x14ab3b,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x17a186,_0x30e8c2){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x17a186[_0x0542('0x16')],routingClient)[_0x0542('0x17')](respondWithResult(_0x30e8c2,null))[_0x0542('0xd')](handleError(_0x30e8c2,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a91d7,_0x3ea8a1){return respondWithRpcPromise(_0x0542('0x53'),_0x3a91d7['query'],routingClient)[_0x0542('0x17')](respondWithResult(_0x3ea8a1,null))['catch'](handleError(_0x3ea8a1,null));};exports[_0x0542('0x54')]=function(_0x3ce3c5,_0x136dec){return respondWithRpcPromise(_0x0542('0x55'),_0x3ce3c5['query'],routingClient)[_0x0542('0x17')](respondWithResult(_0x136dec,null))[_0x0542('0xd')](handleError(_0x136dec,null));};exports[_0x0542('0x56')]=function(_0x3aa2f4,_0x1698df){return respondWithRpcPromise(_0x0542('0x57'),_0x3aa2f4[_0x0542('0x16')],routingClient)[_0x0542('0x17')](respondWithResult(_0x1698df,null))[_0x0542('0xd')](handleError(_0x1698df,null));};exports['queueNotify']=function(_0x3e1f87){return function(_0x24431c,_0x1932b8){var _0x531d66,_0xadf019;var _0x144c38=_[_0x0542('0x58')](_0x3e1f87);var _0x2c5bee=_0x3e1f87===_0x0542('0x59')?_0x0542('0x5a'):'Account';return db[_0x144c38+'Queue'][_0x0542('0x5b')]({'raw':!![],'where':{'id':_0x24431c[_0x0542('0x19')]['id']}})[_0x0542('0x17')](function(_0x3a2851){if(_[_0x0542('0x12')](_0x3a2851)){throw new Error(_0x144c38+_0x0542('0x5c'));}_0x531d66=_0x3a2851;return db[_0x144c38+_0x0542('0x5d')]['findOne']({'where':{'id':_0x24431c[_0x0542('0x2b')][_0x0542('0x5e')]},'include':[{'model':db[_0x144c38+_0x0542('0x5f')],'as':_0x0542('0x5f')},{'model':db[_0x144c38+_0x2c5bee],'as':_0x0542('0x60')}]});})[_0x0542('0x17')](function(_0x3afe27){if(_[_0x0542('0x12')](_0x3afe27)){throw new Error(_0x144c38+_0x0542('0x61'));}_0xadf019=_0x3afe27;return _0x3afe27['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0542('0x17')](function(){var _0x4b5c29={'uniqueid':_0x3e1f87+'.'+_0xadf019['id']+'.'+_0xadf019[_0x0542('0x5f')]['id'],'FromUserId':_0x24431c['user']['id'],'type':_0x0542('0x62')};_0x4b5c29[_0x144c38+'MessageId']=_0xadf019['id'];_0x4b5c29[_0x144c38+'InteractionId']=_0xadf019[_0x0542('0x5f')]['id'];_0x4b5c29[_0x0542('0x63')+_0x144c38+_0x2c5bee+'Id']=_0xadf019[_0x0542('0x60')]['id'];_0x4b5c29['To'+_0x144c38+'QueueId']=_0x531d66['id'];return db[_0x144c38+_0x0542('0x64')][_0x0542('0x65')](_0x4b5c29);})[_0x0542('0x17')](function(){return respondWithRpcPromise('Start',{'channel':_0x3e1f87,'interaction':_0xadf019[_0x0542('0x5f')],'message':_0xadf019,'account':_0xadf019[_0x0542('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0542('0x62'),'appdata':_0x531d66[_0x0542('0x11')]+','+(_0xadf019[_0x0542('0x60')][_0x0542('0x66')]||0x12c),'interval':_0x0542('0x67')}]},routingClient);})[_0x0542('0x17')](respondWithResult(_0x1932b8,null))['catch'](handleError(_0x1932b8,null));};};exports[_0x0542('0x68')]=function(_0x278af1,_0x4a9222){var _0x1c3466,_0x585e75;if(_[_0x0542('0x12')](_0x278af1[_0x0542('0x2b')][_0x0542('0x69')])){throw new Error(_0x0542('0x6a'));}var _0x580e80=_0x278af1[_0x0542('0x2b')][_0x0542('0x69')];var _0x53b7b7=_[_0x0542('0x58')](_0x580e80);var _0x6923da=_0x580e80===_0x0542('0x59')?_0x0542('0x5a'):_0x0542('0x60');return db[_0x0542('0x6b')][_0x0542('0x5b')]({'raw':!![],'where':{'id':_0x278af1['params']['id'],'role':_0x0542('0x6c')}})[_0x0542('0x17')](function(_0x146ad4){if(_[_0x0542('0x12')](_0x146ad4)){throw new Error(_0x0542('0x6d'));}_0x1c3466=_0x146ad4;return db[_0x53b7b7+'Message'][_0x0542('0x5b')]({'where':{'id':_0x278af1[_0x0542('0x2b')][_0x0542('0x5e')]},'include':[{'model':db[_0x53b7b7+_0x0542('0x5f')],'as':_0x0542('0x5f')},{'model':db[_0x53b7b7+_0x6923da],'as':_0x0542('0x60')}]});})[_0x0542('0x17')](function(_0x102c5c){if(_['isNil'](_0x102c5c)){throw new Error(_0x53b7b7+_0x0542('0x61'));}_0x585e75=_0x102c5c;return _0x102c5c[_0x0542('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0542('0x17')](function(){var _0x225621={'uniqueid':_0x580e80+'.'+_0x585e75['id']+'.'+_0x585e75[_0x0542('0x5f')]['id'],'FromUserId':_0x278af1[_0x0542('0x2d')]['id'],'type':_0x0542('0x62'),'ToUserId':_0x1c3466['id']};_0x225621[_0x53b7b7+_0x0542('0x6f')]=_0x585e75['id'];_0x225621[_0x53b7b7+_0x0542('0x70')]=_0x585e75[_0x0542('0x5f')]['id'];_0x225621[_0x0542('0x63')+_0x53b7b7+_0x6923da+'Id']=_0x585e75['Account']['id'];return db[_0x53b7b7+_0x0542('0x64')][_0x0542('0x65')](_0x225621);})[_0x0542('0x17')](function(){return respondWithRpcPromise(_0x0542('0x71'),{'channel':_0x580e80,'interaction':_0x585e75[_0x0542('0x5f')],'message':_0x585e75,'account':_0x585e75[_0x0542('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1c3466[_0x0542('0x11')]+','+(_0x585e75[_0x0542('0x60')]['agentTransferTimeout']||0x12c),'interval':_0x0542('0x67')}]},routingClient);})[_0x0542('0x17')](respondWithResult(_0x4a9222,null))[_0x0542('0xd')](handleError(_0x4a9222,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f1684e3..b016017 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 _0x697a=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','/:id/run','run','post','create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x697a,0x91));var _0xa697=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x697a[_0x2ae2ad];return _0x26dbd7;};'use strict';var multer=require(_0xa697('0x0'));var util=require(_0xa697('0x1'));var path=require(_0xa697('0x2'));var timeout=require(_0xa697('0x3'));var express=require('express');var router=express[_0xa697('0x4')]();var auth=require(_0xa697('0x5'));var interaction=require(_0xa697('0x6'));var config=require('../../config/environment');var controller=require(_0xa697('0x7'));router[_0xa697('0x8')]('/',auth[_0xa697('0x9')](),controller['index']);router[_0xa697('0x8')](_0xa697('0xa'),auth[_0xa697('0x9')](),controller['show']);router[_0xa697('0x8')](_0xa697('0xb'),auth['isAuthenticated'](),controller[_0xa697('0xc')]);router[_0xa697('0xd')]('/',auth['isAuthenticated'](),controller[_0xa697('0xe')]);router[_0xa697('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa697('0x10')]);router[_0xa697('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa697('0x12')]);module[_0xa697('0x13')]=router; \ No newline at end of file +var _0x652b=['../../config/environment','./schedule.controller','isAuthenticated','index','/:id','get','post','create','put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x4467d0,_0x514b12){var _0xc5b8ce=function(_0x1cdacb){while(--_0x1cdacb){_0x4467d0['push'](_0x4467d0['shift']());}};_0xc5b8ce(++_0x514b12);}(_0x652b,0xbb));var _0xb652=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x652b[_0x155c64];return _0x1f154a;};'use strict';var multer=require(_0xb652('0x0'));var util=require(_0xb652('0x1'));var path=require('path');var timeout=require(_0xb652('0x2'));var express=require(_0xb652('0x3'));var router=express['Router']();var auth=require(_0xb652('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb652('0x5'));var controller=require(_0xb652('0x6'));router['get']('/',auth[_0xb652('0x7')](),controller[_0xb652('0x8')]);router['get'](_0xb652('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xb652('0xa')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xb652('0xb')]('/',auth[_0xb652('0x7')](),controller[_0xb652('0xc')]);router[_0xb652('0xd')](_0xb652('0x9'),auth[_0xb652('0x7')](),controller['update']);router[_0xb652('0xe')](_0xb652('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xb652('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0f2347f..70ddcb7 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 _0x2e88=['pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','ENUM','years','months','weeks','days','hours','minutes','csv'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x2e88,0x95));var _0x82e8=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x2e88[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x82e8('0x0'));module[_0x82e8('0x1')]={'name':{'type':Sequelize[_0x82e8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x82e8('0x2')]},'active':{'type':Sequelize[_0x82e8('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x82e8('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x82e8('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x82e8('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x82e8('0x5')](_0x82e8('0x6'),'quarters',_0x82e8('0x7'),_0x82e8('0x8'),_0x82e8('0x9'),_0x82e8('0xa'),_0x82e8('0xb')),'allowNull':![],'defaultValue':_0x82e8('0x9')},'output':{'type':Sequelize[_0x82e8('0x5')](_0x82e8('0xc'),_0x82e8('0xd'),_0x82e8('0xe')),'allowNull':![],'defaultValue':_0x82e8('0xc')},'type':{'type':Sequelize['ENUM'](_0x82e8('0xf'),_0x82e8('0x10')),'allowNull':![],'defaultValue':_0x82e8('0xf')},'sendMail':{'type':Sequelize[_0x82e8('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x82e8('0x2')]},'cc':{'type':Sequelize[_0x82e8('0x11')]},'bcc':{'type':Sequelize[_0x82e8('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6bac=['sequelize','STRING','BOOLEAN','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','csv','default','custom','TEXT'];(function(_0x4bb48b,_0x25894f){var _0x3d4f32=function(_0x1e9d4a){while(--_0x1e9d4a){_0x4bb48b['push'](_0x4bb48b['shift']());}};_0x3d4f32(++_0x25894f);}(_0x6bac,0xa5));var _0xc6ba=function(_0xa585ec,_0x1b698b){_0xa585ec=_0xa585ec-0x0;var _0xac8c07=_0x6bac[_0xa585ec];return _0xac8c07;};'use strict';var Sequelize=require(_0xc6ba('0x0'));module['exports']={'name':{'type':Sequelize[_0xc6ba('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc6ba('0x1')]},'active':{'type':Sequelize[_0xc6ba('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc6ba('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc6ba('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc6ba('0x4')]('years',_0xc6ba('0x5'),_0xc6ba('0x6'),_0xc6ba('0x7'),_0xc6ba('0x8'),_0xc6ba('0x9'),_0xc6ba('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xc6ba('0xb'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM']('custom',_0xc6ba('0xc')),'allowNull':![],'defaultValue':_0xc6ba('0xd')},'sendMail':{'type':Sequelize[_0xc6ba('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xc6ba('0x1')]},'cc':{'type':Sequelize[_0xc6ba('0xe')]},'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 e716b5b..978526b 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 _0xdc0a=['update','run','../../config/schedule','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','catch','params','find','body','user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xeb7df2,_0x499ab3){var _0x564935=function(_0x4c71ee){while(--_0x4c71ee){_0xeb7df2['push'](_0xeb7df2['shift']());}};_0x564935(++_0x499ab3);}(_0xdc0a,0x18e));var _0xadc0=function(_0x1b2779,_0x181d22){_0x1b2779=_0x1b2779-0x0;var _0x162929=_0xdc0a[_0x1b2779];return _0x162929;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xadc0('0x0'));var rp=require(_0xadc0('0x1'));var moment=require(_0xadc0('0x2'));var BPromise=require(_0xadc0('0x3'));var Mustache=require(_0xadc0('0x4'));var util=require(_0xadc0('0x5'));var path=require(_0xadc0('0x6'));var sox=require('sox');var csv=require(_0xadc0('0x7'));var ejs=require(_0xadc0('0x8'));var fs=require('fs');var _=require(_0xadc0('0x9'));var squel=require('squel');var crypto=require(_0xadc0('0xa'));var jsforce=require(_0xadc0('0xb'));var deskjs=require(_0xadc0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xadc0('0xd'));var Papa=require(_0xadc0('0xe'));var Redis=require(_0xadc0('0xf'));var authService=require(_0xadc0('0x10'));var qs=require(_0xadc0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadc0('0x12'));var logger=require(_0xadc0('0x13'))('api');var utils=require(_0xadc0('0x14'));var config=require(_0xadc0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ed3a4,_0x840a98){_0x840a98=_0x840a98||0xcc;return function(_0x5b7965){if(_0x5b7965){return _0x3ed3a4[_0xadc0('0x16')](_0x840a98);}return _0x3ed3a4['status'](_0x840a98)[_0xadc0('0x17')]();};}function respondWithResult(_0x340392,_0x14a781){_0x14a781=_0x14a781||0xc8;return function(_0x4caf17){if(_0x4caf17){return _0x340392[_0xadc0('0x18')](_0x14a781)[_0xadc0('0x19')](_0x4caf17);}};}function respondWithFilteredResult(_0x5bcbc9,_0x54008d){return function(_0xbafdcc){if(_0xbafdcc){var _0x46d84b=_0xbafdcc['count'],_0x48ef6d=_0x54008d[_0xadc0('0x1a')],_0x4ea25a=_0x54008d[_0xadc0('0x1a')]+_0x54008d[_0xadc0('0x1b')],_0x7fe842;if(_0x4ea25a>=_0x46d84b){_0x4ea25a=_0x46d84b;_0x7fe842=0xc8;}else{_0x7fe842=0xce;}_0x5bcbc9[_0xadc0('0x18')](_0x7fe842);return _0x5bcbc9[_0xadc0('0x1c')](_0xadc0('0x1d'),_0x48ef6d+'-'+_0x4ea25a+'/'+_0x46d84b)[_0xadc0('0x19')](_0xbafdcc);}return null;};}function patchUpdates(_0x4c6fc7){return function(_0x1706ec){try{jsonpatch[_0xadc0('0x1e')](_0x1706ec,_0x4c6fc7,!![]);}catch(_0x24c78a){return BPromise[_0xadc0('0x1f')](_0x24c78a);}return _0x1706ec['save']();};}function saveUpdates(_0x1bab55,_0x3c767f){return function(_0x552ee3){if(_0x552ee3){return _0x552ee3['update'](_0x1bab55)['then'](function(_0x50dcde){return _0x50dcde;});}return null;};}function removeEntity(_0x19d093,_0x5029fa){return function(_0x58217c){if(_0x58217c){return _0x58217c['destroy']()[_0xadc0('0x20')](function(){var _0x4f7b6f=_0x58217c[_0xadc0('0x21')]({'plain':!![]});var _0x5017a0=_0xadc0('0x22');return db[_0xadc0('0x23')][_0xadc0('0x24')]({'where':{'type':_0x5017a0,'resourceId':_0x4f7b6f['id']}})[_0xadc0('0x20')](function(){return _0x58217c;});})[_0xadc0('0x20')](function(){_0x19d093['status'](0xcc)[_0xadc0('0x17')]();});}};}function handleEntityNotFound(_0xc6a247,_0x219d94){return function(_0x400ec2){if(!_0x400ec2){_0xc6a247['sendStatus'](0x194);}return _0x400ec2;};}function handleError(_0xe72dee,_0x32c640){_0x32c640=_0x32c640||0x1f4;return function(_0x3a1ced){logger[_0xadc0('0x25')](_0x3a1ced[_0xadc0('0x26')]);if(_0x3a1ced[_0xadc0('0x27')]){delete _0x3a1ced[_0xadc0('0x27')];}_0xe72dee[_0xadc0('0x18')](_0x32c640)[_0xadc0('0x28')](_0x3a1ced);};}exports[_0xadc0('0x29')]=function(_0x265558,_0x1b3dd2){var _0x9fce16={},_0x497abc={},_0x3511fa={'count':0x0,'rows':[]};var _0x3ea81c=_[_0xadc0('0x2a')](db[_0xadc0('0x2b')][_0xadc0('0x2c')],function(_0x3c0c93){return{'name':_0x3c0c93['fieldName'],'type':_0x3c0c93['type'][_0xadc0('0x2d')]};});_0x497abc['model']=_['map'](_0x3ea81c,'name');_0x497abc[_0xadc0('0x2e')]=_[_0xadc0('0x2f')](_0x265558[_0xadc0('0x2e')]);_0x497abc[_0xadc0('0x30')]=_[_0xadc0('0x31')](_0x497abc[_0xadc0('0x32')],_0x497abc['query']);_0x9fce16[_0xadc0('0x33')]=_['intersection'](_0x497abc[_0xadc0('0x32')],qs[_0xadc0('0x34')](_0x265558['query']['fields']));_0x9fce16['attributes']=_0x9fce16[_0xadc0('0x33')][_0xadc0('0x35')]?_0x9fce16[_0xadc0('0x33')]:_0x497abc['model'];if(!_0x265558[_0xadc0('0x2e')]['hasOwnProperty'](_0xadc0('0x36'))){_0x9fce16[_0xadc0('0x1b')]=qs['limit'](_0x265558[_0xadc0('0x2e')][_0xadc0('0x1b')]);_0x9fce16[_0xadc0('0x1a')]=qs['offset'](_0x265558[_0xadc0('0x2e')][_0xadc0('0x1a')]);}_0x9fce16[_0xadc0('0x37')]=qs[_0xadc0('0x38')](_0x265558[_0xadc0('0x2e')][_0xadc0('0x38')]);_0x9fce16[_0xadc0('0x39')]=qs[_0xadc0('0x30')](_[_0xadc0('0x3a')](_0x265558[_0xadc0('0x2e')],_0x497abc['filters']),_0x3ea81c);if(_0x265558[_0xadc0('0x2e')][_0xadc0('0x3b')]){_0x9fce16[_0xadc0('0x39')]=_['merge'](_0x9fce16[_0xadc0('0x39')],{'$or':_[_0xadc0('0x2a')](_0x3ea81c,function(_0x5239b8){if(_0x5239b8[_0xadc0('0x3c')]!=='VIRTUAL'){var _0x1475e9={};_0x1475e9[_0x5239b8[_0xadc0('0x27')]]={'$like':'%'+_0x265558[_0xadc0('0x2e')][_0xadc0('0x3b')]+'%'};return _0x1475e9;}})});}_0x9fce16=_[_0xadc0('0x3d')]({},_0x9fce16,_0x265558[_0xadc0('0x3e')]);var _0x3404c6={'where':_0x9fce16[_0xadc0('0x39')]};return db['Schedule']['count'](_0x3404c6)[_0xadc0('0x20')](function(_0x1e52db){_0x3511fa['count']=_0x1e52db;if(_0x265558[_0xadc0('0x2e')][_0xadc0('0x3f')]){_0x9fce16[_0xadc0('0x40')]=[{'all':!![]}];}return db['Schedule'][_0xadc0('0x41')](_0x9fce16);})[_0xadc0('0x20')](function(_0x26cd6c){_0x3511fa['rows']=_0x26cd6c;return _0x3511fa;})[_0xadc0('0x20')](respondWithFilteredResult(_0x1b3dd2,_0x9fce16))[_0xadc0('0x42')](handleError(_0x1b3dd2,null));};exports['show']=function(_0x37ac9c,_0x210c60){var _0x2af164={'raw':![],'where':{'id':_0x37ac9c[_0xadc0('0x43')]['id']}},_0x536ee8={};_0x536ee8[_0xadc0('0x32')]=_['keys'](db[_0xadc0('0x2b')]['rawAttributes']);_0x536ee8[_0xadc0('0x2e')]=_[_0xadc0('0x2f')](_0x37ac9c[_0xadc0('0x2e')]);_0x536ee8[_0xadc0('0x30')]=_[_0xadc0('0x31')](_0x536ee8[_0xadc0('0x32')],_0x536ee8[_0xadc0('0x2e')]);_0x2af164['attributes']=_[_0xadc0('0x31')](_0x536ee8[_0xadc0('0x32')],qs['fields'](_0x37ac9c[_0xadc0('0x2e')]['fields']));_0x2af164[_0xadc0('0x33')]=_0x2af164[_0xadc0('0x33')][_0xadc0('0x35')]?_0x2af164[_0xadc0('0x33')]:_0x536ee8[_0xadc0('0x32')];if(_0x37ac9c[_0xadc0('0x2e')][_0xadc0('0x3f')]){_0x2af164['include']=[{'all':!![]}];}_0x2af164=_[_0xadc0('0x3d')]({},_0x2af164,_0x37ac9c[_0xadc0('0x3e')]);return db[_0xadc0('0x2b')][_0xadc0('0x44')](_0x2af164)[_0xadc0('0x20')](handleEntityNotFound(_0x210c60,null))['then'](respondWithResult(_0x210c60,null))['catch'](handleError(_0x210c60,null));};exports['create']=function(_0x4deef9,_0x363ffd){return db['Schedule']['create'](_0x4deef9[_0xadc0('0x45')],{})[_0xadc0('0x20')](function(_0x310223){var _0x3322e8=_0x4deef9[_0xadc0('0x46')][_0xadc0('0x21')]({'plain':!![]});if(!_0x3322e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3322e8[_0xadc0('0x47')]===_0xadc0('0x46')){var _0x5957ad=_0x310223[_0xadc0('0x21')]({'plain':!![]});var _0x318703=_0xadc0('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x318703,'userProfileId':_0x3322e8[_0xadc0('0x48')]},'raw':!![]})[_0xadc0('0x20')](function(_0x1c8b62){if(_0x1c8b62&&_0x1c8b62[_0xadc0('0x49')]===0x0){return db[_0xadc0('0x23')][_0xadc0('0x4a')]({'name':_0x5957ad['name'],'resourceId':_0x5957ad['id'],'type':_0x1c8b62[_0xadc0('0x27')],'sectionId':_0x1c8b62['id']},{})[_0xadc0('0x20')](function(){return _0x310223;});}else{return _0x310223;}})[_0xadc0('0x42')](function(_0x12b69d){logger[_0xadc0('0x25')](_0xadc0('0x4b'),_0x12b69d);throw _0x12b69d;});}return _0x310223;})[_0xadc0('0x20')](respondWithResult(_0x363ffd,0xc9))['catch'](handleError(_0x363ffd,null));};exports[_0xadc0('0x4c')]=function(_0x1a63a9,_0x49e5a8){if(_0x1a63a9[_0xadc0('0x45')]['id']){delete _0x1a63a9[_0xadc0('0x45')]['id'];}return db['Schedule'][_0xadc0('0x44')]({'where':{'id':_0x1a63a9['params']['id']}})[_0xadc0('0x20')](handleEntityNotFound(_0x49e5a8,null))[_0xadc0('0x20')](saveUpdates(_0x1a63a9['body'],null))[_0xadc0('0x20')](respondWithResult(_0x49e5a8,null))['catch'](handleError(_0x49e5a8,null));};exports[_0xadc0('0x24')]=function(_0x49c912,_0x53798c){return db['Schedule'][_0xadc0('0x44')]({'where':{'id':_0x49c912[_0xadc0('0x43')]['id']}})['then'](handleEntityNotFound(_0x53798c,null))[_0xadc0('0x20')](removeEntity(_0x53798c,null))[_0xadc0('0x42')](handleError(_0x53798c,null));};exports[_0xadc0('0x4d')]=function(_0x99fbfa,_0x46b181,_0xaf56d){var _0x40276c=require(_0xadc0('0x4e'));return db[_0xadc0('0x2b')][_0xadc0('0x44')]({'where':{'id':_0x99fbfa[_0xadc0('0x43')]['id']},'raw':!![]})[_0xadc0('0x20')](handleEntityNotFound(_0x46b181,null))[_0xadc0('0x20')](function(){_0x40276c[_0xadc0('0x4d')](_0x99fbfa['params']['id']);})['then'](respondWithStatusCode(_0x46b181,null))[_0xadc0('0x42')](handleError(_0x46b181,null));}; \ No newline at end of file +var _0xd466=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','index','Schedule','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','run'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd466,0xf3));var _0x6d46=function(_0x574b7f,_0x5a758e){_0x574b7f=_0x574b7f-0x0;var _0x3da1af=_0xd466[_0x574b7f];return _0x3da1af;};'use strict';var pdf=require(_0x6d46('0x0'));var emlformat=require(_0x6d46('0x1'));var rimraf=require(_0x6d46('0x2'));var zipdir=require(_0x6d46('0x3'));var jsonpatch=require(_0x6d46('0x4'));var rp=require(_0x6d46('0x5'));var moment=require(_0x6d46('0x6'));var BPromise=require(_0x6d46('0x7'));var Mustache=require(_0x6d46('0x8'));var util=require(_0x6d46('0x9'));var path=require('path');var sox=require(_0x6d46('0xa'));var csv=require(_0x6d46('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6d46('0xc'));var squel=require(_0x6d46('0xd'));var crypto=require(_0x6d46('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6d46('0xf'));var toCsv=require(_0x6d46('0xb'));var querystring=require(_0x6d46('0x10'));var Papa=require(_0x6d46('0x11'));var Redis=require('ioredis');var authService=require(_0x6d46('0x12'));var qs=require(_0x6d46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d46('0x14'));var logger=require(_0x6d46('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6d46('0x16'))['db'];function respondWithStatusCode(_0x90e6a9,_0xd12a33){_0xd12a33=_0xd12a33||0xcc;return function(_0x9f2932){if(_0x9f2932){return _0x90e6a9['sendStatus'](_0xd12a33);}return _0x90e6a9[_0x6d46('0x17')](_0xd12a33)[_0x6d46('0x18')]();};}function respondWithResult(_0x232c83,_0x25c291){_0x25c291=_0x25c291||0xc8;return function(_0x3aae21){if(_0x3aae21){return _0x232c83[_0x6d46('0x17')](_0x25c291)[_0x6d46('0x19')](_0x3aae21);}};}function respondWithFilteredResult(_0x2fc684,_0x19354c){return function(_0x7f6bee){if(_0x7f6bee){var _0x370a61=_0x7f6bee[_0x6d46('0x1a')],_0x36ee82=_0x19354c[_0x6d46('0x1b')],_0x3ef281=_0x19354c[_0x6d46('0x1b')]+_0x19354c[_0x6d46('0x1c')],_0x4fe3ae;if(_0x3ef281>=_0x370a61){_0x3ef281=_0x370a61;_0x4fe3ae=0xc8;}else{_0x4fe3ae=0xce;}_0x2fc684[_0x6d46('0x17')](_0x4fe3ae);return _0x2fc684[_0x6d46('0x1d')](_0x6d46('0x1e'),_0x36ee82+'-'+_0x3ef281+'/'+_0x370a61)[_0x6d46('0x19')](_0x7f6bee);}return null;};}function patchUpdates(_0x77126f){return function(_0x29f3bc){try{jsonpatch['apply'](_0x29f3bc,_0x77126f,!![]);}catch(_0x466848){return BPromise[_0x6d46('0x1f')](_0x466848);}return _0x29f3bc[_0x6d46('0x20')]();};}function saveUpdates(_0x4d3267,_0x338a62){return function(_0x2eae68){if(_0x2eae68){return _0x2eae68[_0x6d46('0x21')](_0x4d3267)[_0x6d46('0x22')](function(_0x47a6be){return _0x47a6be;});}return null;};}function removeEntity(_0x3a3e53,_0x1c2949){return function(_0x1aacb4){if(_0x1aacb4){return _0x1aacb4[_0x6d46('0x23')]()[_0x6d46('0x22')](function(){var _0x363943=_0x1aacb4[_0x6d46('0x24')]({'plain':!![]});var _0x16142c=_0x6d46('0x25');return db[_0x6d46('0x26')][_0x6d46('0x23')]({'where':{'type':_0x16142c,'resourceId':_0x363943['id']}})['then'](function(){return _0x1aacb4;});})[_0x6d46('0x22')](function(){_0x3a3e53[_0x6d46('0x17')](0xcc)[_0x6d46('0x18')]();});}};}function handleEntityNotFound(_0x119aae,_0x245ff7){return function(_0x4bfc77){if(!_0x4bfc77){_0x119aae[_0x6d46('0x27')](0x194);}return _0x4bfc77;};}function handleError(_0x233e7c,_0x104071){_0x104071=_0x104071||0x1f4;return function(_0x25113c){logger['error'](_0x25113c[_0x6d46('0x28')]);if(_0x25113c[_0x6d46('0x29')]){delete _0x25113c[_0x6d46('0x29')];}_0x233e7c[_0x6d46('0x17')](_0x104071)['send'](_0x25113c);};}exports[_0x6d46('0x2a')]=function(_0xbef7ef,_0x307b9e){var _0x195a32={},_0x3ebbba={},_0x4b9139={'count':0x0,'rows':[]};var _0x646b1=_['map'](db[_0x6d46('0x2b')][_0x6d46('0x2c')],function(_0x4711a8){return{'name':_0x4711a8[_0x6d46('0x2d')],'type':_0x4711a8[_0x6d46('0x2e')][_0x6d46('0x2f')]};});_0x3ebbba['model']=_[_0x6d46('0x30')](_0x646b1,_0x6d46('0x29'));_0x3ebbba[_0x6d46('0x31')]=_['keys'](_0xbef7ef['query']);_0x3ebbba[_0x6d46('0x32')]=_['intersection'](_0x3ebbba['model'],_0x3ebbba[_0x6d46('0x31')]);_0x195a32['attributes']=_[_0x6d46('0x33')](_0x3ebbba[_0x6d46('0x34')],qs['fields'](_0xbef7ef['query']['fields']));_0x195a32['attributes']=_0x195a32[_0x6d46('0x35')][_0x6d46('0x36')]?_0x195a32[_0x6d46('0x35')]:_0x3ebbba[_0x6d46('0x34')];if(!_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x37')]('nolimit')){_0x195a32[_0x6d46('0x1c')]=qs[_0x6d46('0x1c')](_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x1c')]);_0x195a32[_0x6d46('0x1b')]=qs[_0x6d46('0x1b')](_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x1b')]);}_0x195a32['order']=qs['sort'](_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x38')]);_0x195a32[_0x6d46('0x39')]=qs['filters'](_[_0x6d46('0x3a')](_0xbef7ef[_0x6d46('0x31')],_0x3ebbba[_0x6d46('0x32')]),_0x646b1);if(_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x3b')]){_0x195a32[_0x6d46('0x39')]=_[_0x6d46('0x3c')](_0x195a32['where'],{'$or':_[_0x6d46('0x30')](_0x646b1,function(_0x4057b4){if(_0x4057b4[_0x6d46('0x2e')]!==_0x6d46('0x3d')){var _0x47eb65={};_0x47eb65[_0x4057b4[_0x6d46('0x29')]]={'$like':'%'+_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x3b')]+'%'};return _0x47eb65;}})});}_0x195a32=_[_0x6d46('0x3c')]({},_0x195a32,_0xbef7ef[_0x6d46('0x3e')]);var _0x57226d={'where':_0x195a32['where']};return db[_0x6d46('0x2b')][_0x6d46('0x1a')](_0x57226d)['then'](function(_0x23ae0d){_0x4b9139[_0x6d46('0x1a')]=_0x23ae0d;if(_0xbef7ef[_0x6d46('0x31')][_0x6d46('0x3f')]){_0x195a32[_0x6d46('0x40')]=[{'all':!![]}];}return db[_0x6d46('0x2b')][_0x6d46('0x41')](_0x195a32);})[_0x6d46('0x22')](function(_0x4ea414){_0x4b9139['rows']=_0x4ea414;return _0x4b9139;})[_0x6d46('0x22')](respondWithFilteredResult(_0x307b9e,_0x195a32))[_0x6d46('0x42')](handleError(_0x307b9e,null));};exports[_0x6d46('0x43')]=function(_0x339e02,_0x3de886){var _0x1a8568={'raw':![],'where':{'id':_0x339e02[_0x6d46('0x44')]['id']}},_0x562224={};_0x562224[_0x6d46('0x34')]=_[_0x6d46('0x45')](db[_0x6d46('0x2b')]['rawAttributes']);_0x562224[_0x6d46('0x31')]=_[_0x6d46('0x45')](_0x339e02[_0x6d46('0x31')]);_0x562224['filters']=_[_0x6d46('0x33')](_0x562224[_0x6d46('0x34')],_0x562224['query']);_0x1a8568['attributes']=_[_0x6d46('0x33')](_0x562224['model'],qs[_0x6d46('0x46')](_0x339e02['query'][_0x6d46('0x46')]));_0x1a8568[_0x6d46('0x35')]=_0x1a8568['attributes'][_0x6d46('0x36')]?_0x1a8568['attributes']:_0x562224['model'];if(_0x339e02['query']['includeAll']){_0x1a8568['include']=[{'all':!![]}];}_0x1a8568=_[_0x6d46('0x3c')]({},_0x1a8568,_0x339e02[_0x6d46('0x3e')]);return db[_0x6d46('0x2b')]['find'](_0x1a8568)[_0x6d46('0x22')](handleEntityNotFound(_0x3de886,null))[_0x6d46('0x22')](respondWithResult(_0x3de886,null))[_0x6d46('0x42')](handleError(_0x3de886,null));};exports[_0x6d46('0x47')]=function(_0x1a851f,_0x47b417){return db[_0x6d46('0x2b')]['create'](_0x1a851f[_0x6d46('0x48')],{})[_0x6d46('0x22')](function(_0xfc06d4){var _0x3a2a44=_0x1a851f['user']['get']({'plain':!![]});if(!_0x3a2a44)throw new Error(_0x6d46('0x49'));if(_0x3a2a44['role']===_0x6d46('0x4a')){var _0x545f70=_0xfc06d4[_0x6d46('0x24')]({'plain':!![]});var _0x3117d5=_0x6d46('0x25');return db[_0x6d46('0x4b')]['find']({'where':{'name':_0x3117d5,'userProfileId':_0x3a2a44[_0x6d46('0x4c')]},'raw':!![]})[_0x6d46('0x22')](function(_0x1d3a56){if(_0x1d3a56&&_0x1d3a56['autoAssociation']===0x0){return db[_0x6d46('0x26')][_0x6d46('0x47')]({'name':_0x545f70[_0x6d46('0x29')],'resourceId':_0x545f70['id'],'type':_0x1d3a56[_0x6d46('0x29')],'sectionId':_0x1d3a56['id']},{})[_0x6d46('0x22')](function(){return _0xfc06d4;});}else{return _0xfc06d4;}})['catch'](function(_0x2b9dcf){logger[_0x6d46('0x4d')](_0x6d46('0x4e'),_0x2b9dcf);throw _0x2b9dcf;});}return _0xfc06d4;})[_0x6d46('0x22')](respondWithResult(_0x47b417,0xc9))[_0x6d46('0x42')](handleError(_0x47b417,null));};exports[_0x6d46('0x21')]=function(_0x1d9c0c,_0x53b3db){if(_0x1d9c0c['body']['id']){delete _0x1d9c0c[_0x6d46('0x48')]['id'];}return db['Schedule'][_0x6d46('0x4f')]({'where':{'id':_0x1d9c0c['params']['id']}})['then'](handleEntityNotFound(_0x53b3db,null))[_0x6d46('0x22')](saveUpdates(_0x1d9c0c['body'],null))[_0x6d46('0x22')](respondWithResult(_0x53b3db,null))['catch'](handleError(_0x53b3db,null));};exports[_0x6d46('0x23')]=function(_0x1c1988,_0x24c3bf){return db[_0x6d46('0x2b')][_0x6d46('0x4f')]({'where':{'id':_0x1c1988[_0x6d46('0x44')]['id']}})[_0x6d46('0x22')](handleEntityNotFound(_0x24c3bf,null))[_0x6d46('0x22')](removeEntity(_0x24c3bf,null))['catch'](handleError(_0x24c3bf,null));};exports['run']=function(_0x51f137,_0xadbefa,_0x18cd7a){var _0xf80ee7=require('../../config/schedule');return db[_0x6d46('0x2b')][_0x6d46('0x4f')]({'where':{'id':_0x51f137[_0x6d46('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xadbefa,null))[_0x6d46('0x22')](function(){_0xf80ee7[_0x6d46('0x50')](_0x51f137['params']['id']);})['then'](respondWithStatusCode(_0xadbefa,null))[_0x6d46('0x42')](handleError(_0xadbefa,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index b1b65f2..6d3dc74 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 _0x9979=['request-promise','path','rimraf','./schedule.attributes','exports','tools_schedules','util','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9979,0x1df));var _0x9997=function(_0x4182e8,_0x238b08){_0x4182e8=_0x4182e8-0x0;var _0x13437d=_0x9979[_0x4182e8];return _0x13437d;};'use strict';var _=require('lodash');var util=require(_0x9997('0x0'));var logger=require(_0x9997('0x1'))(_0x9997('0x2'));var moment=require(_0x9997('0x3'));var BPromise=require(_0x9997('0x4'));var rp=require(_0x9997('0x5'));var fs=require('fs');var path=require(_0x9997('0x6'));var rimraf=require(_0x9997('0x7'));var config=require('../../config/environment');var attributes=require(_0x9997('0x8'));module[_0x9997('0x9')]=function(_0x334fe3,_0x172014){return _0x334fe3['define']('Schedule',attributes,{'tableName':_0x9997('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x820c=['Schedule','tools_schedules','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x820c,0xb2));var _0xc820=function(_0x271f44,_0x454bc7){_0x271f44=_0x271f44-0x0;var _0x2baf1=_0x820c[_0x271f44];return _0x2baf1;};'use strict';var _=require(_0xc820('0x0'));var util=require('util');var logger=require(_0xc820('0x1'))(_0xc820('0x2'));var moment=require(_0xc820('0x3'));var BPromise=require(_0xc820('0x4'));var rp=require(_0xc820('0x5'));var fs=require('fs');var path=require(_0xc820('0x6'));var rimraf=require(_0xc820('0x7'));var config=require(_0xc820('0x8'));var attributes=require('./schedule.attributes');module['exports']=function(_0xca5d96,_0x3863ba){return _0xca5d96['define'](_0xc820('0x9'),attributes,{'tableName':_0xc820('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 5a6b06b..13bf0b1 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 _0x8ea5=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','debug','stringify','error','code','Schedule,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x1977bd,_0x49edc9){var _0x5672a5=function(_0x2c84a8){while(--_0x2c84a8){_0x1977bd['push'](_0x1977bd['shift']());}};_0x5672a5(++_0x49edc9);}(_0x8ea5,0x1b7));var _0x58ea=function(_0x5f0298,_0x3990a2){_0x5f0298=_0x5f0298-0x0;var _0x1d6a85=_0x8ea5[_0x5f0298];return _0x1d6a85;};'use strict';var _=require(_0x58ea('0x0'));var util=require(_0x58ea('0x1'));var moment=require('moment');var BPromise=require(_0x58ea('0x2'));var rs=require(_0x58ea('0x3'));var fs=require('fs');var Redis=require(_0x58ea('0x4'));var db=require(_0x58ea('0x5'))['db'];var utils=require(_0x58ea('0x6'));var logger=require(_0x58ea('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x58ea('0x8')][_0x58ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x533707,_0x561c51,_0x2e9694){return new BPromise(function(_0x5fafb,_0x1a74cf){return client[_0x58ea('0xa')](_0x533707,_0x2e9694)[_0x58ea('0xb')](function(_0x711f6a){logger[_0x58ea('0xc')]('Schedule,\x20%s,\x20%s',_0x561c51,'request\x20sent');logger[_0x58ea('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x561c51,'request\x20sent',JSON[_0x58ea('0xe')](_0x711f6a));if(_0x711f6a['error']){if(_0x711f6a[_0x58ea('0xf')][_0x58ea('0x10')]===0x1f4){logger['error'](_0x58ea('0x11'),_0x561c51,_0x711f6a[_0x58ea('0xf')]['message']);return _0x1a74cf(_0x711f6a[_0x58ea('0xf')][_0x58ea('0x12')]);}logger[_0x58ea('0xf')](_0x58ea('0x11'),_0x561c51,_0x711f6a['error'][_0x58ea('0x12')]);return _0x5fafb(_0x711f6a['error'][_0x58ea('0x12')]);}else{logger[_0x58ea('0xc')]('Schedule,\x20%s,\x20%s',_0x561c51,_0x58ea('0x13'));_0x5fafb(_0x711f6a[_0x58ea('0x14')][_0x58ea('0x12')]);}})[_0x58ea('0x15')](function(_0x148f79){logger[_0x58ea('0xf')](_0x58ea('0x11'),_0x561c51,_0x148f79);_0x1a74cf(_0x148f79);});});} \ No newline at end of file +var _0x45a7=['request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Schedule,\x20%s,\x20%s','result','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d72ce,_0x4ddcec){var _0x40e4d5=function(_0x41eb72){while(--_0x41eb72){_0x2d72ce['push'](_0x2d72ce['shift']());}};_0x40e4d5(++_0x4ddcec);}(_0x45a7,0x19b));var _0x745a=function(_0x432286,_0xc7f906){_0x432286=_0x432286-0x0;var _0x475b6e=_0x45a7[_0x432286];return _0x475b6e;};'use strict';var _=require(_0x745a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x745a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x745a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x745a('0x3'))(_0x745a('0x4'));var config=require(_0x745a('0x5'));var jayson=require(_0x745a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x434958,_0x698b84,_0x1fa63e){return new BPromise(function(_0x2fea8d,_0x39d572){return client[_0x745a('0x7')](_0x434958,_0x1fa63e)[_0x745a('0x8')](function(_0x4dcb26){logger[_0x745a('0x9')]('Schedule,\x20%s,\x20%s',_0x698b84,_0x745a('0xa'));logger[_0x745a('0xb')](_0x745a('0xc'),_0x698b84,_0x745a('0xa'),JSON[_0x745a('0xd')](_0x4dcb26));if(_0x4dcb26[_0x745a('0xe')]){if(_0x4dcb26[_0x745a('0xe')][_0x745a('0xf')]===0x1f4){logger[_0x745a('0xe')]('Schedule,\x20%s,\x20%s',_0x698b84,_0x4dcb26['error'][_0x745a('0x10')]);return _0x39d572(_0x4dcb26[_0x745a('0xe')]['message']);}logger[_0x745a('0xe')](_0x745a('0x11'),_0x698b84,_0x4dcb26[_0x745a('0xe')][_0x745a('0x10')]);return _0x2fea8d(_0x4dcb26[_0x745a('0xe')][_0x745a('0x10')]);}else{logger[_0x745a('0x9')]('Schedule,\x20%s,\x20%s',_0x698b84,_0x745a('0xa'));_0x2fea8d(_0x4dcb26[_0x745a('0x12')][_0x745a('0x10')]);}})['catch'](function(_0x57a838){logger[_0x745a('0xe')](_0x745a('0x11'),_0x698b84,_0x57a838);_0x39d572(_0x57a838);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f93ceab..9b5e8cc 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 _0xcd6f=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','show','/:id/download','create','put','/:id','delete','destroy','exports','util','Router','../../components/auth/service'];(function(_0x477bf9,_0x7cf50b){var _0x264d79=function(_0x23e5d3){while(--_0x23e5d3){_0x477bf9['push'](_0x477bf9['shift']());}};_0x264d79(++_0x7cf50b);}(_0xcd6f,0xc9));var _0xfcd6=function(_0x59f33e,_0x50645e){_0x59f33e=_0x59f33e-0x0;var _0x412e53=_0xcd6f[_0x59f33e];return _0x412e53;};'use strict';var multer=require('multer');var util=require(_0xfcd6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcd6('0x1')]();var auth=require(_0xfcd6('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfcd6('0x3'));var controller=require(_0xfcd6('0x4'));router[_0xfcd6('0x5')]('/',auth[_0xfcd6('0x6')](),controller[_0xfcd6('0x7')]);router[_0xfcd6('0x5')](_0xfcd6('0x8'),auth[_0xfcd6('0x6')](),controller['describe']);router[_0xfcd6('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xfcd6('0x9')]);router[_0xfcd6('0x5')](_0xfcd6('0xa'),auth[_0xfcd6('0x6')](),controller['download']);router['post']('/',auth[_0xfcd6('0x6')](),controller[_0xfcd6('0xb')]);router[_0xfcd6('0xc')](_0xfcd6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfcd6('0xe')](_0xfcd6('0xd'),auth[_0xfcd6('0x6')](),controller[_0xfcd6('0xf')]);module[_0xfcd6('0x10')]=router; \ No newline at end of file +var _0x9832=['index','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x13dd37,_0x1a62d7){var _0x4018ef=function(_0x24f017){while(--_0x24f017){_0x13dd37['push'](_0x13dd37['shift']());}};_0x4018ef(++_0x1a62d7);}(_0x9832,0x66));var _0x2983=function(_0x6fc5f7,_0x5dde8b){_0x6fc5f7=_0x6fc5f7-0x0;var _0x4fe306=_0x9832[_0x6fc5f7];return _0x4fe306;};'use strict';var multer=require(_0x2983('0x0'));var util=require('util');var path=require(_0x2983('0x1'));var timeout=require(_0x2983('0x2'));var express=require(_0x2983('0x3'));var router=express[_0x2983('0x4')]();var auth=require(_0x2983('0x5'));var interaction=require(_0x2983('0x6'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x2983('0x7')]('/',auth['isAuthenticated'](),controller[_0x2983('0x8')]);router[_0x2983('0x7')](_0x2983('0x9'),auth[_0x2983('0xa')](),controller[_0x2983('0xb')]);router[_0x2983('0x7')](_0x2983('0xc'),auth[_0x2983('0xa')](),controller[_0x2983('0xd')]);router[_0x2983('0x7')](_0x2983('0xe'),auth[_0x2983('0xa')](),controller['download']);router[_0x2983('0xf')]('/',auth[_0x2983('0xa')](),controller[_0x2983('0x10')]);router[_0x2983('0x11')](_0x2983('0xc'),auth['isAuthenticated'](),controller[_0x2983('0x12')]);router[_0x2983('0x13')](_0x2983('0xc'),auth[_0x2983('0xa')](),controller[_0x2983('0x14')]);module[_0x2983('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 02e1ce7..3b21ad9 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 _0x98a8=['updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt'];(function(_0x4130fa,_0x43f6b4){var _0x37d856=function(_0x8305bd){while(--_0x8305bd){_0x4130fa['push'](_0x4130fa['shift']());}};_0x37d856(++_0x43f6b4);}(_0x98a8,0x12c));var _0x898a=function(_0x170eb3,_0x2d2f52){_0x170eb3=_0x170eb3-0x0;var _0x5378cb=_0x98a8[_0x170eb3];return _0x5378cb;};'use strict';var Sequelize=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var config=require(_0x898a('0x3'));module[_0x898a('0x4')]={'format':{'type':Sequelize[_0x898a('0x5')],'get':function(){return this[_0x898a('0x6')]('value')?path[_0x898a('0x7')](this[_0x898a('0x6')](_0x898a('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0x898a('0x9')]},'channel':{'type':Sequelize[_0x898a('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3aadc2){var _0x564583=_0x3aadc2[_0x898a('0xa')](/\\/g,'/');this['setDataValue'](_0x898a('0x8'),_0x564583);}},'rating':{'type':Sequelize[_0x898a('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x898a('0xb')],'set':function(_0x96b636){this[_0x898a('0xc')](_0x898a('0xd'),moment()[_0x898a('0xe')](_0x96b636,'ms'));this[_0x898a('0xc')](_0x898a('0xf'),moment());this['setDataValue'](_0x898a('0x10'),_0x96b636);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x898a('0x6')]('startedAt'))[_0x898a('0x11')](_0x898a('0x12'))[_0x898a('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('closedAt'))[_0x898a('0x11')](_0x898a('0x12'))[_0x898a('0x13')]();}},'createdAt':{'type':Sequelize[_0x898a('0x14')],'get':function(){return moment(this[_0x898a('0x6')](_0x898a('0x15')))['format'](_0x898a('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x898a('0x14')],'get':function(){return moment(this['getDataValue'](_0x898a('0x16')))['format'](_0x898a('0x12'))['toString']();}}}; \ No newline at end of file +var _0x5075=['VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x5075,0x73));var _0x5507=function(_0x522e32,_0x440e6d){_0x522e32=_0x522e32-0x0;var _0x216842=_0x5075[_0x522e32];return _0x216842;};'use strict';var Sequelize=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var config=require(_0x5507('0x3'));module[_0x5507('0x4')]={'format':{'type':Sequelize[_0x5507('0x5')],'get':function(){return this[_0x5507('0x6')]('value')?path[_0x5507('0x7')](this[_0x5507('0x6')](_0x5507('0x8'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x5507('0x9')],'set':function(_0x773559){var _0x4c2d6d=_0x773559[_0x5507('0xa')](/\\/g,'/');this[_0x5507('0xb')](_0x5507('0x8'),_0x4c2d6d);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xe8c49){this[_0x5507('0xb')](_0x5507('0xc'),moment()[_0x5507('0xd')](_0xe8c49,'ms'));this['setDataValue'](_0x5507('0xe'),moment());this[_0x5507('0xb')]('duration',_0xe8c49);}},'startedAt':{'type':Sequelize[_0x5507('0xf')],'get':function(){return moment(this[_0x5507('0x6')]('startedAt'))[_0x5507('0x10')](_0x5507('0x11'))[_0x5507('0x12')]();}},'closedAt':{'type':Sequelize[_0x5507('0xf')],'get':function(){return moment(this[_0x5507('0x6')](_0x5507('0xe')))['format'](_0x5507('0x11'))[_0x5507('0x12')]();}},'createdAt':{'type':Sequelize[_0x5507('0xf')],'get':function(){return moment(this[_0x5507('0x6')]('createdAt'))[_0x5507('0x10')](_0x5507('0x11'))[_0x5507('0x12')]();}},'updatedAt':{'type':Sequelize[_0x5507('0xf')],'get':function(){return moment(this[_0x5507('0x6')](_0x5507('0x13')))[_0x5507('0x10')](_0x5507('0x11'))[_0x5507('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 5a1f158..eb3ebe7 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 _0x0d23=['rows','catch','params','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','find','join','server/files/screen_recordings','format','%s.cypher','existsSync','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','download','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0d23,0xe8));var _0x30d2=function(_0x59d795,_0xd98596){_0x59d795=_0x59d795-0x0;var _0xbb606e=_0x0d23[_0x59d795];return _0xbb606e;};'use strict';var pdf=require(_0x30d2('0x0'));var emlformat=require(_0x30d2('0x1'));var rimraf=require(_0x30d2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x30d2('0x3'));var moment=require(_0x30d2('0x4'));var BPromise=require(_0x30d2('0x5'));var Mustache=require(_0x30d2('0x6'));var util=require('util');var path=require(_0x30d2('0x7'));var sox=require(_0x30d2('0x8'));var csv=require(_0x30d2('0x9'));var ejs=require(_0x30d2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x30d2('0xb'));var crypto=require(_0x30d2('0xc'));var jsforce=require(_0x30d2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x30d2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x30d2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30d2('0xf'));var hardwareService=require(_0x30d2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x30d2('0x11'));var config=require('../../config/environment');var db=require(_0x30d2('0x12'))['db'];function respondWithStatusCode(_0x186d37,_0x274198){_0x274198=_0x274198||0xcc;return function(_0x1c3368){if(_0x1c3368){return _0x186d37['sendStatus'](_0x274198);}return _0x186d37[_0x30d2('0x13')](_0x274198)[_0x30d2('0x14')]();};}function respondWithResult(_0x41b3b4,_0x3f3f15){_0x3f3f15=_0x3f3f15||0xc8;return function(_0x1433ba){if(_0x1433ba){return _0x41b3b4[_0x30d2('0x13')](_0x3f3f15)[_0x30d2('0x15')](_0x1433ba);}};}function respondWithFilteredResult(_0x182b79,_0x3499d4){return function(_0x3bc72b){if(_0x3bc72b){var _0x2448a8=_0x3bc72b[_0x30d2('0x16')],_0x485b59=_0x3499d4[_0x30d2('0x17')],_0x40e131=_0x3499d4[_0x30d2('0x17')]+_0x3499d4[_0x30d2('0x18')],_0x1706d9;if(_0x40e131>=_0x2448a8){_0x40e131=_0x2448a8;_0x1706d9=0xc8;}else{_0x1706d9=0xce;}_0x182b79[_0x30d2('0x13')](_0x1706d9);return _0x182b79['set'](_0x30d2('0x19'),_0x485b59+'-'+_0x40e131+'/'+_0x2448a8)['json'](_0x3bc72b);}return null;};}function patchUpdates(_0x4c2832){return function(_0x5e88a3){try{jsonpatch['apply'](_0x5e88a3,_0x4c2832,!![]);}catch(_0x30ca7f){return BPromise['reject'](_0x30ca7f);}return _0x5e88a3[_0x30d2('0x1a')]();};}function saveUpdates(_0x1bf124,_0x58baa8){return function(_0x306a0f){if(_0x306a0f){return _0x306a0f[_0x30d2('0x1b')](_0x1bf124)[_0x30d2('0x1c')](function(_0x20b8c6){return _0x20b8c6;});}return null;};}function removeEntity(_0x634553,_0x2c35c0){return function(_0x2f90a2){if(_0x2f90a2){return _0x2f90a2[_0x30d2('0x1d')]()[_0x30d2('0x1c')](function(){_0x634553['status'](0xcc)[_0x30d2('0x14')]();});}};}function handleEntityNotFound(_0x2a715d,_0xa1b7c4){return function(_0x16f979){if(!_0x16f979){_0x2a715d[_0x30d2('0x1e')](0x194);}return _0x16f979;};}function handleError(_0x36702a,_0x579ad0){_0x579ad0=_0x579ad0||0x1f4;return function(_0x474700){logger[_0x30d2('0x1f')](_0x474700[_0x30d2('0x20')]);if(_0x474700['name']){delete _0x474700[_0x30d2('0x21')];}_0x36702a['status'](_0x579ad0)['send'](_0x474700);};}exports[_0x30d2('0x22')]=function(_0x1a7da3,_0x282aa2){var _0x13f535={},_0x236426={},_0x41480c={'count':0x0,'rows':[]};var _0x3d6d82=_[_0x30d2('0x23')](db[_0x30d2('0x24')][_0x30d2('0x25')],function(_0x2aecfb){return{'name':_0x2aecfb[_0x30d2('0x26')],'type':_0x2aecfb[_0x30d2('0x27')][_0x30d2('0x28')]};});_0x236426[_0x30d2('0x29')]=_['differenceBy'](_['map'](_0x3d6d82,_0x30d2('0x21')),['format']);_0x236426[_0x30d2('0x2a')]=_[_0x30d2('0x2b')](_0x1a7da3['query']);_0x236426[_0x30d2('0x2c')]=_['intersection'](_0x236426[_0x30d2('0x29')],_0x236426[_0x30d2('0x2a')]);_0x13f535[_0x30d2('0x2d')]=_[_0x30d2('0x2e')](_0x236426['model'],qs[_0x30d2('0x2f')](_0x1a7da3[_0x30d2('0x2a')][_0x30d2('0x2f')]));_0x13f535[_0x30d2('0x2d')]=_0x13f535[_0x30d2('0x2d')]['length']?_0x13f535[_0x30d2('0x2d')]:_0x236426[_0x30d2('0x29')];if(!_0x1a7da3['query']['hasOwnProperty']('nolimit')){_0x13f535['limit']=qs[_0x30d2('0x18')](_0x1a7da3[_0x30d2('0x2a')][_0x30d2('0x18')]);_0x13f535[_0x30d2('0x17')]=qs[_0x30d2('0x17')](_0x1a7da3[_0x30d2('0x2a')][_0x30d2('0x17')]);}_0x13f535[_0x30d2('0x30')]=qs[_0x30d2('0x31')](_0x1a7da3[_0x30d2('0x2a')][_0x30d2('0x31')]);_0x13f535['where']=qs[_0x30d2('0x2c')](_[_0x30d2('0x32')](_0x1a7da3['query'],_0x236426[_0x30d2('0x2c')]),_0x3d6d82);if(_0x1a7da3[_0x30d2('0x2a')][_0x30d2('0x33')]){_0x13f535[_0x30d2('0x34')]=_[_0x30d2('0x35')](_0x13f535[_0x30d2('0x34')],{'$or':_[_0x30d2('0x23')](_0x3d6d82,function(_0x41228b){if(_0x41228b[_0x30d2('0x27')]!==_0x30d2('0x36')){var _0x3e5e30={};_0x3e5e30[_0x41228b['name']]={'$like':'%'+_0x1a7da3['query']['filter']+'%'};return _0x3e5e30;}})});}_0x13f535=_[_0x30d2('0x35')]({},_0x13f535,_0x1a7da3[_0x30d2('0x37')]);var _0x552489={'where':_0x13f535['where']};return db['ScreenRecording'][_0x30d2('0x16')](_0x552489)[_0x30d2('0x1c')](function(_0x540649){_0x41480c['count']=_0x540649;if(_0x1a7da3['query'][_0x30d2('0x38')]){_0x13f535[_0x30d2('0x39')]=[{'all':!![]}];}return db[_0x30d2('0x24')][_0x30d2('0x3a')](_0x13f535);})[_0x30d2('0x1c')](function(_0x1fd051){_0x41480c[_0x30d2('0x3b')]=_0x1fd051;return _0x41480c;})['then'](respondWithFilteredResult(_0x282aa2,_0x13f535))[_0x30d2('0x3c')](handleError(_0x282aa2,null));};exports['show']=function(_0x20245c,_0x20a877){var _0x151c9e={'raw':![],'where':{'id':_0x20245c[_0x30d2('0x3d')]['id']}},_0xea656a={};_0xea656a[_0x30d2('0x29')]=_[_0x30d2('0x2b')](db[_0x30d2('0x24')][_0x30d2('0x25')]);_0xea656a[_0x30d2('0x2a')]=_[_0x30d2('0x2b')](_0x20245c[_0x30d2('0x2a')]);_0xea656a[_0x30d2('0x2c')]=_[_0x30d2('0x2e')](_0xea656a[_0x30d2('0x29')],_0xea656a[_0x30d2('0x2a')]);_0x151c9e['attributes']=_[_0x30d2('0x2e')](_0xea656a['model'],qs[_0x30d2('0x2f')](_0x20245c['query']['fields']));_0x151c9e[_0x30d2('0x2d')]=_0x151c9e[_0x30d2('0x2d')]['length']?_0x151c9e['attributes']:_0xea656a[_0x30d2('0x29')];if(_0x20245c['query']['includeAll']){_0x151c9e[_0x30d2('0x39')]=[{'all':!![]}];}_0x151c9e=_[_0x30d2('0x35')]({},_0x151c9e,_0x20245c[_0x30d2('0x37')]);return db['ScreenRecording']['find'](_0x151c9e)[_0x30d2('0x1c')](handleEntityNotFound(_0x20a877,null))['then'](respondWithResult(_0x20a877,null))[_0x30d2('0x3c')](handleError(_0x20a877,null));};exports[_0x30d2('0x3e')]=function(_0x2607ca,_0x2a6220){return db[_0x30d2('0x24')][_0x30d2('0x3e')](_0x2607ca[_0x30d2('0x3f')],{})['then'](respondWithResult(_0x2a6220,0xc9))[_0x30d2('0x3c')](handleError(_0x2a6220,null));};exports['update']=function(_0x106e11,_0x31078e){if(_0x106e11[_0x30d2('0x3f')]['id']){delete _0x106e11['body']['id'];}delete _0x106e11[_0x30d2('0x3f')][_0x30d2('0x40')];delete _0x106e11[_0x30d2('0x3f')][_0x30d2('0x41')];delete _0x106e11[_0x30d2('0x3f')][_0x30d2('0x42')];delete _0x106e11['body'][_0x30d2('0x43')];return db[_0x30d2('0x24')]['find']({'where':{'id':_0x106e11['params']['id']}})[_0x30d2('0x1c')](handleEntityNotFound(_0x31078e,null))[_0x30d2('0x1c')](saveUpdates(_0x106e11[_0x30d2('0x3f')],null))['then'](respondWithResult(_0x31078e,null))['catch'](handleError(_0x31078e,null));};exports['describe']=function(_0x2008fa,_0xb3d0b6){return db[_0x30d2('0x24')][_0x30d2('0x44')]()[_0x30d2('0x1c')](respondWithResult(_0xb3d0b6,null))[_0x30d2('0x3c')](handleError(_0xb3d0b6,null));};exports['download']=function(_0x25bf55,_0x17200d,_0x1f61c1){var _0x421ff6=require(_0x30d2('0x45'));var _0x32419e=![];var _0x47dd13={};if(_0x25bf55[_0x30d2('0x2a')][_0x30d2('0x27')]&&_0x25bf55[_0x30d2('0x2a')][_0x30d2('0x27')]===_0x30d2('0x46')){_0x47dd13['uniqueid']=_0x25bf55[_0x30d2('0x3d')]['id'];}else{_0x47dd13['id']=_0x25bf55['params']['id'];}return db[_0x30d2('0x24')][_0x30d2('0x47')]({'where':_0x47dd13,'attributes':['id',_0x30d2('0x43')],'raw':!![]})[_0x30d2('0x1c')](handleEntityNotFound(_0x17200d,null))[_0x30d2('0x1c')](function(_0x59c662){if(_0x59c662){var _0x38caa8=path[_0x30d2('0x48')](config['root'],_0x30d2('0x49'),_0x59c662[_0x30d2('0x43')]);var _0x46e8e8=util[_0x30d2('0x4a')](_0x30d2('0x4b'),_0x38caa8);if(fs[_0x30d2('0x4c')](_0x46e8e8)){_0x32419e=!![];return _0x421ff6['decryptFile'](_0x46e8e8,_0x38caa8,config[_0x30d2('0x4d')][_0x30d2('0x4e')])['then'](function(){return _0x59c662;});}return _0x59c662;}})['then'](function(_0x1c2676){if(_0x1c2676){var _0x39287d=path[_0x30d2('0x48')](config[_0x30d2('0x4f')],_0x30d2('0x49'),_0x1c2676['value']);if(!fs['existsSync'](_0x39287d)){throw new db[(_0x30d2('0x50'))][(_0x30d2('0x51'))](_0x30d2('0x52'));}if(_0x1c2676[_0x30d2('0x53')]){return _0x17200d['download'](_0x39287d,_0x1c2676[_0x30d2('0x53')]+path[_0x30d2('0x54')](_0x39287d),function(){if(_0x32419e){fs['unlink'](_0x39287d);}});}else{return _0x17200d[_0x30d2('0x55')](_0x39287d,function(_0x116722){if(_0x32419e){fs[_0x30d2('0x56')](_0x39287d);}});}}})['catch'](function(_0x289ef5){if(_0x289ef5[_0x30d2('0x57')]===_0x30d2('0x52')){_0x17200d[_0x30d2('0x13')](0x194)['send'](_0x30d2('0x58'));}else{return handleError(_0x17200d,null);}});};exports[_0x30d2('0x1d')]=function(_0x13a7da,_0x1daf67){return db[_0x30d2('0x24')][_0x30d2('0x47')]({'where':{'id':_0x13a7da['params']['id']}})[_0x30d2('0x1c')](function(_0xeb9b44){if(!_0xeb9b44)throw new ReferenceError(_0x30d2('0x59'));return _0xeb9b44;})[_0x30d2('0x1c')](function(_0x9b6b4a){var _0x575c5e=path['join'](config['root'],'server/files/screen_recordings',_0x9b6b4a[_0x30d2('0x43')]);logger[_0x30d2('0x5a')](_0x30d2('0x5b'),_0x575c5e);if(!_[_0x30d2('0x5c')](_0x9b6b4a[_0x30d2('0x43')])&&fs[_0x30d2('0x4c')](_0x575c5e)){logger[_0x30d2('0x5a')](_0x30d2('0x5d')+_0x575c5e+_0x30d2('0x5e'));fs[_0x30d2('0x5f')](_0x575c5e);}_0x575c5e=_0x575c5e+_0x30d2('0x60');if(!_['isNil'](_0x9b6b4a[_0x30d2('0x43')])&&fs[_0x30d2('0x4c')](_0x575c5e)){logger['info']('File:\x20\x22'+_0x575c5e+_0x30d2('0x5e'));fs[_0x30d2('0x5f')](_0x575c5e);}return _0x9b6b4a;})[_0x30d2('0x1c')](function(_0x15f22d){if(!_0x15f22d)throw new InternalError();return _0x15f22d[_0x30d2('0x1d')]();})[_0x30d2('0x1c')](function(){_0x1daf67[_0x30d2('0x13')](0xcc)[_0x30d2('0x14')]();})[_0x30d2('0x3c')](handleError(_0x1daf67,null));}; \ No newline at end of file +var _0x6108=['bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','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','apply','save','update','then','stack','name','index','map','ScreenRecording','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','createdAt','closedAt','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','send','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6108,0xbc));var _0x8610=function(_0x10aa24,_0x1546df){_0x10aa24=_0x10aa24-0x0;var _0xecaf3d=_0x6108[_0x10aa24];return _0xecaf3d;};'use strict';var pdf=require(_0x8610('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8610('0x1'));var zipdir=require(_0x8610('0x2'));var jsonpatch=require(_0x8610('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8610('0x4'));var Mustache=require(_0x8610('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8610('0x6'));var csv=require(_0x8610('0x7'));var ejs=require(_0x8610('0x8'));var fs=require('fs');var _=require(_0x8610('0x9'));var squel=require('squel');var crypto=require(_0x8610('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8610('0xb'));var toCsv=require(_0x8610('0x7'));var querystring=require(_0x8610('0xc'));var Papa=require('papaparse');var Redis=require(_0x8610('0xd'));var authService=require(_0x8610('0xe'));var qs=require(_0x8610('0xf'));var as=require(_0x8610('0x10'));var hardwareService=require(_0x8610('0x11'));var logger=require(_0x8610('0x12'))('api');var utils=require(_0x8610('0x13'));var config=require(_0x8610('0x14'));var db=require(_0x8610('0x15'))['db'];function respondWithStatusCode(_0x4ee6f4,_0xc18be9){_0xc18be9=_0xc18be9||0xcc;return function(_0x4bb57e){if(_0x4bb57e){return _0x4ee6f4[_0x8610('0x16')](_0xc18be9);}return _0x4ee6f4[_0x8610('0x17')](_0xc18be9)[_0x8610('0x18')]();};}function respondWithResult(_0x277942,_0x3f5223){_0x3f5223=_0x3f5223||0xc8;return function(_0x4eacbf){if(_0x4eacbf){return _0x277942['status'](_0x3f5223)[_0x8610('0x19')](_0x4eacbf);}};}function respondWithFilteredResult(_0x593949,_0x214015){return function(_0x5526b5){if(_0x5526b5){var _0x5e1994=_0x5526b5[_0x8610('0x1a')],_0x57e567=_0x214015[_0x8610('0x1b')],_0x3d94c2=_0x214015['offset']+_0x214015['limit'],_0x21c500;if(_0x3d94c2>=_0x5e1994){_0x3d94c2=_0x5e1994;_0x21c500=0xc8;}else{_0x21c500=0xce;}_0x593949[_0x8610('0x17')](_0x21c500);return _0x593949['set']('Content-Range',_0x57e567+'-'+_0x3d94c2+'/'+_0x5e1994)[_0x8610('0x19')](_0x5526b5);}return null;};}function patchUpdates(_0x4c7d56){return function(_0x56bf4f){try{jsonpatch[_0x8610('0x1c')](_0x56bf4f,_0x4c7d56,!![]);}catch(_0x153daa){return BPromise['reject'](_0x153daa);}return _0x56bf4f[_0x8610('0x1d')]();};}function saveUpdates(_0x327b56,_0x17fe4a){return function(_0x39ae24){if(_0x39ae24){return _0x39ae24[_0x8610('0x1e')](_0x327b56)[_0x8610('0x1f')](function(_0x2e3e69){return _0x2e3e69;});}return null;};}function removeEntity(_0x1ab679,_0x4184f0){return function(_0x19e38a){if(_0x19e38a){return _0x19e38a['destroy']()[_0x8610('0x1f')](function(){_0x1ab679['status'](0xcc)[_0x8610('0x18')]();});}};}function handleEntityNotFound(_0x2b8e7f,_0x8866a){return function(_0x5103ad){if(!_0x5103ad){_0x2b8e7f[_0x8610('0x16')](0x194);}return _0x5103ad;};}function handleError(_0x53b646,_0x585269){_0x585269=_0x585269||0x1f4;return function(_0x4b3e6a){logger['error'](_0x4b3e6a[_0x8610('0x20')]);if(_0x4b3e6a[_0x8610('0x21')]){delete _0x4b3e6a['name'];}_0x53b646[_0x8610('0x17')](_0x585269)['send'](_0x4b3e6a);};}exports[_0x8610('0x22')]=function(_0x2503bc,_0x49bef2){var _0x3a4a74={},_0x345369={},_0x3e6d97={'count':0x0,'rows':[]};var _0x260fdc=_[_0x8610('0x23')](db[_0x8610('0x24')]['rawAttributes'],function(_0x42a104){return{'name':_0x42a104[_0x8610('0x25')],'type':_0x42a104[_0x8610('0x26')]['key']};});_0x345369[_0x8610('0x27')]=_['differenceBy'](_[_0x8610('0x23')](_0x260fdc,'name'),['format']);_0x345369[_0x8610('0x28')]=_[_0x8610('0x29')](_0x2503bc[_0x8610('0x28')]);_0x345369['filters']=_['intersection'](_0x345369[_0x8610('0x27')],_0x345369[_0x8610('0x28')]);_0x3a4a74[_0x8610('0x2a')]=_[_0x8610('0x2b')](_0x345369[_0x8610('0x27')],qs[_0x8610('0x2c')](_0x2503bc['query'][_0x8610('0x2c')]));_0x3a4a74[_0x8610('0x2a')]=_0x3a4a74[_0x8610('0x2a')][_0x8610('0x2d')]?_0x3a4a74[_0x8610('0x2a')]:_0x345369[_0x8610('0x27')];if(!_0x2503bc[_0x8610('0x28')][_0x8610('0x2e')]('nolimit')){_0x3a4a74['limit']=qs[_0x8610('0x2f')](_0x2503bc[_0x8610('0x28')][_0x8610('0x2f')]);_0x3a4a74[_0x8610('0x1b')]=qs[_0x8610('0x1b')](_0x2503bc[_0x8610('0x28')][_0x8610('0x1b')]);}_0x3a4a74[_0x8610('0x30')]=qs[_0x8610('0x31')](_0x2503bc[_0x8610('0x28')][_0x8610('0x31')]);_0x3a4a74['where']=qs[_0x8610('0x32')](_[_0x8610('0x33')](_0x2503bc[_0x8610('0x28')],_0x345369['filters']),_0x260fdc);if(_0x2503bc['query'][_0x8610('0x34')]){_0x3a4a74[_0x8610('0x35')]=_[_0x8610('0x36')](_0x3a4a74[_0x8610('0x35')],{'$or':_[_0x8610('0x23')](_0x260fdc,function(_0x593b43){if(_0x593b43['type']!==_0x8610('0x37')){var _0x3c84f5={};_0x3c84f5[_0x593b43[_0x8610('0x21')]]={'$like':'%'+_0x2503bc['query']['filter']+'%'};return _0x3c84f5;}})});}_0x3a4a74=_[_0x8610('0x36')]({},_0x3a4a74,_0x2503bc[_0x8610('0x38')]);var _0x3e6a50={'where':_0x3a4a74[_0x8610('0x35')]};return db[_0x8610('0x24')][_0x8610('0x1a')](_0x3e6a50)[_0x8610('0x1f')](function(_0x229c50){_0x3e6d97[_0x8610('0x1a')]=_0x229c50;if(_0x2503bc[_0x8610('0x28')][_0x8610('0x39')]){_0x3a4a74['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8610('0x3a')](_0x3a4a74);})[_0x8610('0x1f')](function(_0x415d55){_0x3e6d97['rows']=_0x415d55;return _0x3e6d97;})['then'](respondWithFilteredResult(_0x49bef2,_0x3a4a74))[_0x8610('0x3b')](handleError(_0x49bef2,null));};exports[_0x8610('0x3c')]=function(_0x52f640,_0xb037ab){var _0x30fc7e={'raw':![],'where':{'id':_0x52f640[_0x8610('0x3d')]['id']}},_0x5ba462={};_0x5ba462['model']=_['keys'](db[_0x8610('0x24')][_0x8610('0x3e')]);_0x5ba462[_0x8610('0x28')]=_[_0x8610('0x29')](_0x52f640[_0x8610('0x28')]);_0x5ba462[_0x8610('0x32')]=_[_0x8610('0x2b')](_0x5ba462[_0x8610('0x27')],_0x5ba462['query']);_0x30fc7e[_0x8610('0x2a')]=_[_0x8610('0x2b')](_0x5ba462[_0x8610('0x27')],qs[_0x8610('0x2c')](_0x52f640['query'][_0x8610('0x2c')]));_0x30fc7e['attributes']=_0x30fc7e[_0x8610('0x2a')][_0x8610('0x2d')]?_0x30fc7e[_0x8610('0x2a')]:_0x5ba462[_0x8610('0x27')];if(_0x52f640[_0x8610('0x28')][_0x8610('0x39')]){_0x30fc7e[_0x8610('0x3f')]=[{'all':!![]}];}_0x30fc7e=_[_0x8610('0x36')]({},_0x30fc7e,_0x52f640[_0x8610('0x38')]);return db[_0x8610('0x24')][_0x8610('0x40')](_0x30fc7e)['then'](handleEntityNotFound(_0xb037ab,null))[_0x8610('0x1f')](respondWithResult(_0xb037ab,null))[_0x8610('0x3b')](handleError(_0xb037ab,null));};exports[_0x8610('0x41')]=function(_0x5c13b9,_0x3380ef){return db['ScreenRecording'][_0x8610('0x41')](_0x5c13b9[_0x8610('0x42')],{})[_0x8610('0x1f')](respondWithResult(_0x3380ef,0xc9))[_0x8610('0x3b')](handleError(_0x3380ef,null));};exports[_0x8610('0x1e')]=function(_0x106ef4,_0x57ea5b){if(_0x106ef4['body']['id']){delete _0x106ef4[_0x8610('0x42')]['id'];}delete _0x106ef4['body']['duration'];delete _0x106ef4['body'][_0x8610('0x43')];delete _0x106ef4[_0x8610('0x42')][_0x8610('0x44')];delete _0x106ef4[_0x8610('0x42')]['value'];return db[_0x8610('0x24')]['find']({'where':{'id':_0x106ef4['params']['id']}})[_0x8610('0x1f')](handleEntityNotFound(_0x57ea5b,null))[_0x8610('0x1f')](saveUpdates(_0x106ef4[_0x8610('0x42')],null))[_0x8610('0x1f')](respondWithResult(_0x57ea5b,null))['catch'](handleError(_0x57ea5b,null));};exports['describe']=function(_0x4edb18,_0x43435b){return db[_0x8610('0x24')][_0x8610('0x45')]()[_0x8610('0x1f')](respondWithResult(_0x43435b,null))[_0x8610('0x3b')](handleError(_0x43435b,null));};exports['download']=function(_0x2264ab,_0x2118db,_0x5074d3){var _0x22ddd3=require(_0x8610('0x46'));var _0x4f3820=![];var _0x258025={};if(_0x2264ab[_0x8610('0x28')][_0x8610('0x26')]&&_0x2264ab[_0x8610('0x28')]['type']===_0x8610('0x47')){_0x258025['uniqueid']=_0x2264ab[_0x8610('0x3d')]['id'];}else{_0x258025['id']=_0x2264ab['params']['id'];}return db['ScreenRecording']['find']({'where':_0x258025,'attributes':['id',_0x8610('0x48')],'raw':!![]})[_0x8610('0x1f')](handleEntityNotFound(_0x2118db,null))[_0x8610('0x1f')](function(_0x3317f3){if(_0x3317f3){var _0x4f7ad0=path[_0x8610('0x49')](config[_0x8610('0x4a')],_0x8610('0x4b'),_0x3317f3[_0x8610('0x48')]);var _0x32ebb9=util[_0x8610('0x4c')](_0x8610('0x4d'),_0x4f7ad0);if(fs['existsSync'](_0x32ebb9)){_0x4f3820=!![];return _0x22ddd3['decryptFile'](_0x32ebb9,_0x4f7ad0,config['secrets']['recording'])['then'](function(){return _0x3317f3;});}return _0x3317f3;}})[_0x8610('0x1f')](function(_0x3942ea){if(_0x3942ea){var _0x16f565=path[_0x8610('0x49')](config[_0x8610('0x4a')],_0x8610('0x4b'),_0x3942ea[_0x8610('0x48')]);if(!fs[_0x8610('0x4e')](_0x16f565)){throw new db[(_0x8610('0x4f'))]['ValidationError'](_0x8610('0x50'));}if(_0x3942ea[_0x8610('0x51')]){return _0x2118db['download'](_0x16f565,_0x3942ea[_0x8610('0x51')]+path[_0x8610('0x52')](_0x16f565),function(){if(_0x4f3820){fs[_0x8610('0x53')](_0x16f565);}});}else{return _0x2118db[_0x8610('0x54')](_0x16f565,function(_0x2e1630){if(_0x4f3820){fs[_0x8610('0x53')](_0x16f565);}});}}})[_0x8610('0x3b')](function(_0x52dbd7){if(_0x52dbd7[_0x8610('0x55')]===_0x8610('0x50')){_0x2118db['status'](0x194)[_0x8610('0x56')](_0x8610('0x57'));}else{return handleError(_0x2118db,null);}});};exports[_0x8610('0x58')]=function(_0x3f1e74,_0x580d53){return db[_0x8610('0x24')][_0x8610('0x40')]({'where':{'id':_0x3f1e74[_0x8610('0x3d')]['id']}})['then'](function(_0x5d1221){if(!_0x5d1221)throw new ReferenceError(_0x8610('0x59'));return _0x5d1221;})[_0x8610('0x1f')](function(_0x4b02e7){var _0x12834f=path['join'](config['root'],_0x8610('0x4b'),_0x4b02e7[_0x8610('0x48')]);logger[_0x8610('0x5a')](_0x8610('0x5b'),_0x12834f);if(!_[_0x8610('0x5c')](_0x4b02e7[_0x8610('0x48')])&&fs[_0x8610('0x4e')](_0x12834f)){logger[_0x8610('0x5a')](_0x8610('0x5d')+_0x12834f+_0x8610('0x5e'));fs[_0x8610('0x5f')](_0x12834f);}_0x12834f=_0x12834f+'.cypher';if(!_[_0x8610('0x5c')](_0x4b02e7['value'])&&fs[_0x8610('0x4e')](_0x12834f)){logger['info'](_0x8610('0x5d')+_0x12834f+_0x8610('0x5e'));fs[_0x8610('0x5f')](_0x12834f);}return _0x4b02e7;})[_0x8610('0x1f')](function(_0x3aa3e8){if(!_0x3aa3e8)throw new InternalError();return _0x3aa3e8['destroy']();})[_0x8610('0x1f')](function(){_0x580d53[_0x8610('0x17')](0xcc)[_0x8610('0x18')]();})['catch'](handleError(_0x580d53,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 7e5bfe5..62c36b3 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 _0x191b=['util','../../config/logger','api','moment','bluebird','exports','define','ScreenRecording'];(function(_0x23d96d,_0x2c5c84){var _0x52bdbd=function(_0x157f50){while(--_0x157f50){_0x23d96d['push'](_0x23d96d['shift']());}};_0x52bdbd(++_0x2c5c84);}(_0x191b,0x100));var _0xb191=function(_0x41af9a,_0x4e8fc6){_0x41af9a=_0x41af9a-0x0;var _0x104b40=_0x191b[_0x41af9a];return _0x104b40;};'use strict';var _=require('lodash');var util=require(_0xb191('0x0'));var logger=require(_0xb191('0x1'))(_0xb191('0x2'));var moment=require(_0xb191('0x3'));var BPromise=require(_0xb191('0x4'));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('./screenRecording.attributes');module[_0xb191('0x5')]=function(_0x3bca62,_0x283687){return _0x3bca62[_0xb191('0x6')](_0xb191('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x98de=['request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment'];(function(_0xd46033,_0xa8f11f){var _0x2c64d9=function(_0x54475c){while(--_0x54475c){_0xd46033['push'](_0xd46033['shift']());}};_0x2c64d9(++_0xa8f11f);}(_0x98de,0x114));var _0xe98d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x98de[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe98d('0x0'));var util=require(_0xe98d('0x1'));var logger=require(_0xe98d('0x2'))('api');var moment=require(_0xe98d('0x3'));var BPromise=require('bluebird');var rp=require(_0xe98d('0x4'));var fs=require('fs');var path=require(_0xe98d('0x5'));var rimraf=require(_0xe98d('0x6'));var config=require(_0xe98d('0x7'));var attributes=require(_0xe98d('0x8'));module[_0xe98d('0x9')]=function(_0x172896,_0x480432){return _0x172896[_0xe98d('0xa')](_0xe98d('0xb'),attributes,{'tableName':_0xe98d('0xc'),'paranoid':![],'indexes':[{'name':_0xe98d('0xd'),'fields':[_0xe98d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e6d7428..92c1116 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(_0x7fd03,_0x4a534f){var _0x289816=function(_0x54a7aa){while(--_0x54a7aa){_0x7fd03['push'](_0x7fd03['shift']());}};_0x289816(++_0x4a534f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x59ba1c,_0xd79bcd){var _0x1051bc=function(_0x4d8282){while(--_0x4d8282){_0x59ba1c['push'](_0x59ba1c['shift']());}};_0x1051bc(++_0xd79bcd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 fc3e48b..784d90c 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 _0x5436=['file','addLogoLogin','join','preferred','addPreferred','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','format','logo','extname','originalname','post','single','addLogo','server/files/images/logos/','%s%s','logologin'];(function(_0x2c63cb,_0x2f6c97){var _0x11db24=function(_0xa8bdee){while(--_0xa8bdee){_0x2c63cb['push'](_0x2c63cb['shift']());}};_0x11db24(++_0x2f6c97);}(_0x5436,0x1cc));var _0x6543=function(_0x5cc4bc,_0x38e8d5){_0x5cc4bc=_0x5cc4bc-0x0;var _0x1632eb=_0x5436[_0x5cc4bc];return _0x1632eb;};'use strict';var multer=require(_0x6543('0x0'));var util=require(_0x6543('0x1'));var path=require(_0x6543('0x2'));var timeout=require(_0x6543('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6543('0x4'));var interaction=require(_0x6543('0x5'));var config=require(_0x6543('0x6'));var controller=require('./setting.controller');router[_0x6543('0x7')]('/',auth[_0x6543('0x8')](),controller[_0x6543('0x9')]);router[_0x6543('0x7')](_0x6543('0xa'),controller['show']);router[_0x6543('0x7')](_0x6543('0xb'),controller['getLogo']);router['get'](_0x6543('0xc'),controller[_0x6543('0xd')]);router[_0x6543('0x7')](_0x6543('0xe'),controller[_0x6543('0xf')]);router[_0x6543('0x7')](_0x6543('0x10'),controller[_0x6543('0x11')]);router[_0x6543('0x7')](_0x6543('0x12'),controller[_0x6543('0x13')]);var upload=multer({'storage':multer[_0x6543('0x14')]({'destination':function(_0x124998,_0x3dd9d3,_0x529cc3){_0x529cc3(null,path['join'](config[_0x6543('0x15')],'server/files/images/logos/'));},'filename':function(_0x3d7c29,_0x3979cf,_0x30fa3f){_0x30fa3f(null,util[_0x6543('0x16')]('%s%s',_0x6543('0x17'),path[_0x6543('0x18')](_0x3979cf[_0x6543('0x19')])));}})});router[_0x6543('0x1a')]('/:id/logo',upload[_0x6543('0x1b')]('file'),controller[_0x6543('0x1c')]);var upload=multer({'storage':multer[_0x6543('0x14')]({'destination':function(_0xf25df8,_0x3bc578,_0x4c9994){_0x4c9994(null,path['join'](config[_0x6543('0x15')],_0x6543('0x1d')));},'filename':function(_0x7efc1e,_0x49a98f,_0x1f7793){_0x1f7793(null,util[_0x6543('0x16')](_0x6543('0x1e'),_0x6543('0x1f'),path[_0x6543('0x18')](_0x49a98f[_0x6543('0x19')])));}})});router[_0x6543('0x1a')]('/:id/logo_login',upload[_0x6543('0x1b')](_0x6543('0x20')),controller[_0x6543('0x21')]);var upload=multer({'storage':multer[_0x6543('0x14')]({'destination':function(_0x4293c8,_0x476418,_0x525707){_0x525707(null,path[_0x6543('0x22')](config[_0x6543('0x15')],_0x6543('0x1d')));},'filename':function(_0xd0242f,_0x8357,_0x398e4c){_0x398e4c(null,util[_0x6543('0x16')]('%s%s',_0x6543('0x23'),path[_0x6543('0x18')](_0x8357[_0x6543('0x19')])));}})});router[_0x6543('0x1a')](_0x6543('0x10'),upload[_0x6543('0x1b')](_0x6543('0x20')),controller[_0x6543('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2630f6,_0x147223,_0x48f777){_0x48f777(null,path[_0x6543('0x22')](config[_0x6543('0x15')],_0x6543('0x1d')));},'filename':function(_0xa920c4,_0x377461,_0x4aa0cf){_0x4aa0cf(null,util[_0x6543('0x16')](_0x6543('0x1e'),_0x6543('0x25'),path[_0x6543('0x18')](_0x377461[_0x6543('0x19')])));}})});router[_0x6543('0x1a')](_0x6543('0x12'),upload['single']('file'),controller[_0x6543('0x26')]);router[_0x6543('0x27')](_0x6543('0xa'),auth[_0x6543('0x8')](),controller['update']);module[_0x6543('0x28')]=router; \ No newline at end of file +var _0x9bd9=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','file','addLogo','diskStorage','root','format','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','show','/:id/logo'];(function(_0x52e2d,_0x401cb0){var _0x385d51=function(_0x22045a){while(--_0x22045a){_0x52e2d['push'](_0x52e2d['shift']());}};_0x385d51(++_0x401cb0);}(_0x9bd9,0x164));var _0x99bd=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0x9bd9[_0xfcdda0];return _0x17ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x99bd('0x0'));var express=require(_0x99bd('0x1'));var router=express[_0x99bd('0x2')]();var auth=require(_0x99bd('0x3'));var interaction=require(_0x99bd('0x4'));var config=require(_0x99bd('0x5'));var controller=require(_0x99bd('0x6'));router['get']('/',auth[_0x99bd('0x7')](),controller[_0x99bd('0x8')]);router[_0x99bd('0x9')](_0x99bd('0xa'),controller[_0x99bd('0xb')]);router['get'](_0x99bd('0xc'),controller['getLogo']);router[_0x99bd('0x9')](_0x99bd('0xd'),controller[_0x99bd('0xe')]);router['get'](_0x99bd('0xf'),controller[_0x99bd('0x10')]);router[_0x99bd('0x9')](_0x99bd('0x11'),controller[_0x99bd('0x12')]);router[_0x99bd('0x9')](_0x99bd('0x13'),controller[_0x99bd('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b83af,_0x1a95f7,_0x2ca592){_0x2ca592(null,path[_0x99bd('0x15')](config['root'],_0x99bd('0x16')));},'filename':function(_0x5685a0,_0x8e2f97,_0x90b614){_0x90b614(null,util['format'](_0x99bd('0x17'),_0x99bd('0x18'),path[_0x99bd('0x19')](_0x8e2f97[_0x99bd('0x1a')])));}})});router[_0x99bd('0x1b')]('/:id/logo',upload[_0x99bd('0x1c')](_0x99bd('0x1d')),controller[_0x99bd('0x1e')]);var upload=multer({'storage':multer[_0x99bd('0x1f')]({'destination':function(_0x9fa2e9,_0x2e9aee,_0x507f6a){_0x507f6a(null,path['join'](config[_0x99bd('0x20')],_0x99bd('0x16')));},'filename':function(_0x1a2236,_0x5f016a,_0x5c706b){_0x5c706b(null,util[_0x99bd('0x21')](_0x99bd('0x17'),_0x99bd('0x22'),path[_0x99bd('0x19')](_0x5f016a[_0x99bd('0x1a')])));}})});router[_0x99bd('0x1b')](_0x99bd('0xd'),upload['single']('file'),controller[_0x99bd('0x23')]);var upload=multer({'storage':multer[_0x99bd('0x1f')]({'destination':function(_0x1b08d2,_0x4978c8,_0x2ce9fb){_0x2ce9fb(null,path['join'](config['root'],_0x99bd('0x16')));},'filename':function(_0x11d070,_0x5d508d,_0x59efcb){_0x59efcb(null,util[_0x99bd('0x21')](_0x99bd('0x17'),_0x99bd('0x24'),path[_0x99bd('0x19')](_0x5d508d[_0x99bd('0x1a')])));}})});router['post'](_0x99bd('0x11'),upload[_0x99bd('0x1c')](_0x99bd('0x1d')),controller[_0x99bd('0x25')]);var upload=multer({'storage':multer[_0x99bd('0x1f')]({'destination':function(_0x40bea7,_0x4d2ac6,_0x1c41f2){_0x1c41f2(null,path[_0x99bd('0x15')](config[_0x99bd('0x20')],_0x99bd('0x16')));},'filename':function(_0x32addd,_0xdcea0f,_0x30faef){_0x30faef(null,util[_0x99bd('0x21')](_0x99bd('0x17'),_0x99bd('0x26'),path[_0x99bd('0x19')](_0xdcea0f['originalname'])));}})});router[_0x99bd('0x1b')](_0x99bd('0x13'),upload[_0x99bd('0x1c')](_0x99bd('0x1d')),controller[_0x99bd('0x27')]);router['put']('/:id',auth[_0x99bd('0x7')](),controller['update']);module[_0x99bd('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index f5e3bbe..f285da7 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 _0x3410=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_mailbox'];(function(_0x2eda7d,_0x162382){var _0x2fd21d=function(_0x3bf4d0){while(--_0x3bf4d0){_0x2eda7d['push'](_0x2eda7d['shift']());}};_0x2fd21d(++_0x162382);}(_0x3410,0x18c));var _0x0341=function(_0x3baa54,_0x4ebfea){_0x3baa54=_0x3baa54-0x0;var _0x126327=_0x3410[_0x3baa54];return _0x126327;};'use strict';var Sequelize=require(_0x0341('0x0'));module[_0x0341('0x1')]={'min_internal':{'type':Sequelize[_0x0341('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0341('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0341('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0341('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x0341('0x4')]},'defaultLogo':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0341('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0341('0x4')]},'turnaddr':{'type':Sequelize[_0x0341('0x4')]},'turnusername':{'type':Sequelize[_0x0341('0x4')]},'turnpassword':{'type':Sequelize[_0x0341('0x4')]},'pageTitle':{'type':Sequelize[_0x0341('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0341('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0341('0x4')],'defaultValue':_0x0341('0x6')},'enableEmailPreview':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0341('0x4')],'defaultValue':_0x0341('0x7')},'chatTimeout':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0341('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0341('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0341('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0341('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0341('0x4')]},'sentiment':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0341('0x2')]},'sentimentRegion':{'type':Sequelize[_0x0341('0x4')]},'language':{'type':Sequelize[_0x0341('0x4')]},'bucket':{'type':Sequelize[_0x0341('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0341('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x95a8=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x95a8,0x174));var _0x895a=function(_0x4bf17a,_0x24d74c){_0x4bf17a=_0x4bf17a-0x0;var _0xe22657=_0x95a8[_0x4bf17a];return _0xe22657;};'use strict';var Sequelize=require(_0x895a('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x895a('0x1')](0xb),'unique':_0x895a('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x895a('0x1')](0xb),'unique':_0x895a('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x895a('0x4')},'logo':{'type':Sequelize[_0x895a('0x5')]},'defaultLogo':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x895a('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x895a('0x5')]},'turnaddr':{'type':Sequelize[_0x895a('0x5')]},'turnusername':{'type':Sequelize[_0x895a('0x5')]},'turnpassword':{'type':Sequelize[_0x895a('0x5')]},'pageTitle':{'type':Sequelize[_0x895a('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x895a('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x895a('0x5')],'defaultValue':_0x895a('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x895a('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x895a('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x895a('0x8')},'chatTimeout':{'type':Sequelize[_0x895a('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x895a('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x895a('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x895a('0x5')]},'defaultFavicon':{'type':Sequelize[_0x895a('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x895a('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x895a('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x895a('0x5')]},'sentiment':{'type':Sequelize[_0x895a('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x895a('0x1')]},'sentimentRegion':{'type':Sequelize[_0x895a('0x5')]},'language':{'type':Sequelize[_0x895a('0x5')]},'bucket':{'type':Sequelize[_0x895a('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x895a('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 6ee18e0..725a48d 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 _0xc358=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','getLogoLogin','favicon','default_loginLogo.svg','\x20not\x20found','download','gdpr','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','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','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','map','Setting','rawAttributes','fieldName','type','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit'];(function(_0x55714b,_0x1dfa2b){var _0x190a6e=function(_0x388175){while(--_0x388175){_0x55714b['push'](_0x55714b['shift']());}};_0x190a6e(++_0x1dfa2b);}(_0xc358,0x19e));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8c35('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c35('0x1'));var zipdir=require(_0x8c35('0x2'));var jsonpatch=require(_0x8c35('0x3'));var rp=require(_0x8c35('0x4'));var moment=require('moment');var BPromise=require(_0x8c35('0x5'));var Mustache=require('mustache');var util=require(_0x8c35('0x6'));var path=require(_0x8c35('0x7'));var sox=require(_0x8c35('0x8'));var csv=require(_0x8c35('0x9'));var ejs=require(_0x8c35('0xa'));var fs=require('fs');var _=require(_0x8c35('0xb'));var squel=require(_0x8c35('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c35('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8c35('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c35('0xf'));var qs=require(_0x8c35('0x10'));var as=require(_0x8c35('0x11'));var hardwareService=require(_0x8c35('0x12'));var logger=require(_0x8c35('0x13'))(_0x8c35('0x14'));var utils=require(_0x8c35('0x15'));var config=require(_0x8c35('0x16'));var db=require(_0x8c35('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x8c35('0x18')][_0x8c35('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4d69c3,_0x2324fc,_0x1fd878){if(_0x1fd878){var _0x5db032=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db032[_0x8c35('0x1a')](_0x2324fc)){return _0x4d69c3;}else{throw new db['Sequelize'][(_0x8c35('0x1b'))](_0x8c35('0x1c'));}}else{return _0x4d69c3;}}function respondWithRpcPromise(_0x48d73b,_0x4c6a16,_0x268ce1,_0x11d3a4){return new BPromise(function(_0x4df5de,_0x346e54){var _0x15906f=_0x11d3a4||client;return _0x15906f[_0x8c35('0x1d')](_0x48d73b,_0x268ce1)['then'](function(_0x4bfe08){logger[_0x8c35('0x1e')](_0x8c35('0x1f'),_0x4c6a16,_0x8c35('0x20'));logger[_0x8c35('0x21')](_0x8c35('0x22'),_0x4c6a16,_0x8c35('0x20'),JSON['stringify'](_0x4bfe08));if(_0x4bfe08[_0x8c35('0x23')]){if(_0x4bfe08[_0x8c35('0x23')][_0x8c35('0x24')]===0x1f4){logger[_0x8c35('0x23')](_0x8c35('0x1f'),_0x4c6a16,_0x4bfe08['error'][_0x8c35('0x25')]);return _0x346e54(_0x4bfe08[_0x8c35('0x23')][_0x8c35('0x25')]);}logger[_0x8c35('0x23')](_0x8c35('0x1f'),_0x4c6a16,_0x4bfe08[_0x8c35('0x23')]['message']);return _0x4df5de(_0x4bfe08['error']['message']);}else{logger[_0x8c35('0x1e')](_0x8c35('0x1f'),_0x4c6a16,_0x8c35('0x20'));_0x4df5de(_0x4bfe08[_0x8c35('0x26')][_0x8c35('0x25')]);}})[_0x8c35('0x27')](function(_0x4b5303){logger[_0x8c35('0x23')](_0x8c35('0x1f'),_0x4c6a16,_0x4b5303);_0x346e54(_0x4b5303);});});}function respondWithStatusCode(_0x3ea4da,_0x25426b){_0x25426b=_0x25426b||0xcc;return function(_0x5d9172){if(_0x5d9172){return _0x3ea4da['sendStatus'](_0x25426b);}return _0x3ea4da['status'](_0x25426b)[_0x8c35('0x28')]();};}function respondWithResult(_0x43f675,_0x291673){_0x291673=_0x291673||0xc8;return function(_0x28d968){if(_0x28d968){return _0x43f675[_0x8c35('0x29')](_0x291673)[_0x8c35('0x2a')](_0x28d968);}};}function respondWithFilteredResult(_0x5ad3f8,_0x31fe2b){return function(_0x595f82){if(_0x595f82){var _0x436efa=_0x595f82[_0x8c35('0x2b')],_0x594b54=_0x31fe2b[_0x8c35('0x2c')],_0x45cc96=_0x31fe2b[_0x8c35('0x2c')]+_0x31fe2b[_0x8c35('0x2d')],_0x3ec88e;if(_0x45cc96>=_0x436efa){_0x45cc96=_0x436efa;_0x3ec88e=0xc8;}else{_0x3ec88e=0xce;}_0x5ad3f8[_0x8c35('0x29')](_0x3ec88e);return _0x5ad3f8['set'](_0x8c35('0x2e'),_0x594b54+'-'+_0x45cc96+'/'+_0x436efa)[_0x8c35('0x2a')](_0x595f82);}return null;};}function patchUpdates(_0x1253aa){return function(_0x28400e){try{jsonpatch[_0x8c35('0x2f')](_0x28400e,_0x1253aa,!![]);}catch(_0x2899f5){return BPromise[_0x8c35('0x30')](_0x2899f5);}return _0x28400e[_0x8c35('0x31')]();};}function saveUpdates(_0x30161c,_0x4f404b){return function(_0x4015be){if(_0x4015be){return _0x4015be[_0x8c35('0x32')](_0x30161c)[_0x8c35('0x33')](function(_0x3aa863){return _0x3aa863;});}return null;};}function removeEntity(_0x54e018,_0x67219f){return function(_0x1a29c1){if(_0x1a29c1){return _0x1a29c1[_0x8c35('0x34')]()[_0x8c35('0x33')](function(){_0x54e018[_0x8c35('0x29')](0xcc)[_0x8c35('0x28')]();});}};}function handleEntityNotFound(_0x1fec32,_0x556cf8){return function(_0x1beb78){if(!_0x1beb78){_0x1fec32[_0x8c35('0x35')](0x194);}return _0x1beb78;};}function handleError(_0x28f797,_0x4b2358){_0x4b2358=_0x4b2358||0x1f4;return function(_0x5a8d47){logger[_0x8c35('0x23')](_0x5a8d47['stack']);if(_0x5a8d47['name']){delete _0x5a8d47[_0x8c35('0x36')];}_0x28f797['status'](_0x4b2358)['send'](_0x5a8d47);};}exports[_0x8c35('0x37')]=function(_0x5d44fe,_0x562165){var _0x2705c4={},_0x45f5e9={},_0x5b7c35={'count':0x0,'rows':[]};var _0x8abca4=_[_0x8c35('0x38')](db[_0x8c35('0x39')][_0x8c35('0x3a')],function(_0x386fe0){return{'name':_0x386fe0[_0x8c35('0x3b')],'type':_0x386fe0[_0x8c35('0x3c')]['key']};});_0x45f5e9['model']=_['map'](_0x8abca4,_0x8c35('0x36'));_0x45f5e9['query']=_[_0x8c35('0x3d')](_0x5d44fe[_0x8c35('0x3e')]);_0x45f5e9[_0x8c35('0x3f')]=_['intersection'](_0x45f5e9['model'],_0x45f5e9[_0x8c35('0x3e')]);_0x2705c4[_0x8c35('0x40')]=_[_0x8c35('0x41')](_0x45f5e9[_0x8c35('0x42')],qs['fields'](_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x43')]));_0x2705c4[_0x8c35('0x40')]=_0x2705c4[_0x8c35('0x40')]['length']?_0x2705c4[_0x8c35('0x40')]:_0x45f5e9[_0x8c35('0x42')];if(!_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x44')](_0x8c35('0x45'))){_0x2705c4[_0x8c35('0x2d')]=qs[_0x8c35('0x2d')](_0x5d44fe['query'][_0x8c35('0x2d')]);_0x2705c4[_0x8c35('0x2c')]=qs['offset'](_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x2c')]);}_0x2705c4[_0x8c35('0x46')]=qs[_0x8c35('0x47')](_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x47')]);_0x2705c4[_0x8c35('0x48')]=qs[_0x8c35('0x3f')](_[_0x8c35('0x49')](_0x5d44fe['query'],_0x45f5e9[_0x8c35('0x3f')]),_0x8abca4);if(_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x4a')]){_0x2705c4['where']=_[_0x8c35('0x4b')](_0x2705c4[_0x8c35('0x48')],{'$or':_[_0x8c35('0x38')](_0x8abca4,function(_0x1ce7ba){if(_0x1ce7ba[_0x8c35('0x3c')]!==_0x8c35('0x4c')){var _0x668837={};_0x668837[_0x1ce7ba[_0x8c35('0x36')]]={'$like':'%'+_0x5d44fe[_0x8c35('0x3e')][_0x8c35('0x4a')]+'%'};return _0x668837;}})});}_0x2705c4=_[_0x8c35('0x4b')]({},_0x2705c4,_0x5d44fe[_0x8c35('0x4d')]);var _0x3fc76b={'where':_0x2705c4[_0x8c35('0x48')]};return db[_0x8c35('0x39')][_0x8c35('0x2b')](_0x3fc76b)[_0x8c35('0x33')](function(_0x26f2ef){_0x5b7c35[_0x8c35('0x2b')]=_0x26f2ef;if(_0x5d44fe['query'][_0x8c35('0x4e')]){_0x2705c4[_0x8c35('0x4f')]=[{'all':!![]}];}return db[_0x8c35('0x39')][_0x8c35('0x50')](_0x2705c4);})['then'](function(_0x4cf2da){_0x5b7c35[_0x8c35('0x51')]=_0x4cf2da;return _0x5b7c35;})[_0x8c35('0x33')](respondWithFilteredResult(_0x562165,_0x2705c4))[_0x8c35('0x27')](handleError(_0x562165,null));};exports[_0x8c35('0x52')]=function(_0x197d68,_0x2a9c1c){var _0x3e76c7={'raw':![],'where':{'id':_0x197d68[_0x8c35('0x53')]['id']}},_0x35bb38={};_0x35bb38['model']=_['keys'](db[_0x8c35('0x39')][_0x8c35('0x3a')]);_0x35bb38['query']=_['keys'](_0x197d68[_0x8c35('0x3e')]);_0x35bb38[_0x8c35('0x3f')]=_['intersection'](_0x35bb38[_0x8c35('0x42')],_0x35bb38['query']);_0x3e76c7[_0x8c35('0x40')]=_[_0x8c35('0x41')](_0x35bb38[_0x8c35('0x42')],qs[_0x8c35('0x43')](_0x197d68[_0x8c35('0x3e')]['fields']));_0x3e76c7['attributes']=_0x3e76c7[_0x8c35('0x40')][_0x8c35('0x54')]?_0x3e76c7['attributes']:_0x35bb38[_0x8c35('0x42')];if(_0x197d68[_0x8c35('0x3e')][_0x8c35('0x4e')]){_0x3e76c7['include']=[{'all':!![]}];}_0x3e76c7=_[_0x8c35('0x4b')]({},_0x3e76c7,_0x197d68['options']);return db[_0x8c35('0x39')]['find'](_0x3e76c7)['then'](handleEntityNotFound(_0x2a9c1c,null))[_0x8c35('0x33')](respondWithResult(_0x2a9c1c,null))['catch'](handleError(_0x2a9c1c,null));};exports[_0x8c35('0x32')]=function(_0x319799,_0x2a701b){if(_0x319799[_0x8c35('0x55')]['id']){delete _0x319799['body']['id'];}return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x319799[_0x8c35('0x53')]['id']}})[_0x8c35('0x33')](handleEntityNotFound(_0x2a701b,null))['then'](saveUpdates(_0x319799[_0x8c35('0x55')],null))[_0x8c35('0x33')](respondWithResult(_0x2a701b,null))[_0x8c35('0x27')](handleError(_0x2a701b,null));};exports[_0x8c35('0x57')]=function(_0x281e21,_0x2409ce,_0x469c85){if(_0x281e21[_0x8c35('0x58')]&&_0x281e21[_0x8c35('0x58')][_0x8c35('0x59')]){_0x281e21[_0x8c35('0x55')][_0x8c35('0x5a')]=_0x281e21[_0x8c35('0x58')]['filename'];}return db[_0x8c35('0x39')]['find']({'where':{'id':_0x281e21[_0x8c35('0x53')]['id']}})[_0x8c35('0x33')](handleEntityNotFound(_0x2409ce,null))[_0x8c35('0x33')](saveUpdates(_0x281e21[_0x8c35('0x55')],null))[_0x8c35('0x33')](respondWithResult(_0x2409ce,null))['catch'](handleError(_0x2409ce,null));};exports[_0x8c35('0x5b')]=function(_0x3ea8ec,_0x1ca3ee,_0x3cefb1){if(_0x3ea8ec[_0x8c35('0x58')]&&_0x3ea8ec[_0x8c35('0x58')]['filename']){_0x3ea8ec[_0x8c35('0x55')][_0x8c35('0x5c')]=_0x3ea8ec['file'][_0x8c35('0x59')];}return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x3ea8ec['params']['id']}})[_0x8c35('0x33')](handleEntityNotFound(_0x1ca3ee,null))[_0x8c35('0x33')](saveUpdates(_0x3ea8ec[_0x8c35('0x55')],null))['then'](respondWithResult(_0x1ca3ee,null))[_0x8c35('0x27')](handleError(_0x1ca3ee,null));};var utilLicense=require(_0x8c35('0x5d'));exports[_0x8c35('0x5e')]=function(_0x148f0e,_0x5c160f,_0x5d9268){var _0xa89e48=_0x8c35('0x5f');var _0x44e1e7={'custom':![]};return utilLicense[_0x8c35('0x60')]()['then'](function(_0x268563){if(_0x268563){_0x44e1e7=_0x268563;}return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x148f0e[_0x8c35('0x53')]['id']},'attributes':[_0x8c35('0x5a'),'loginLogo',_0x8c35('0x61'),'favicon','defaultLogo',_0x8c35('0x62'),_0x8c35('0x63'),_0x8c35('0x64')],'raw':!![]});})[_0x8c35('0x33')](handleEntityNotFound(_0x5c160f,null))['then'](function(_0x251a09){if(_0x251a09){var _0xddd59d=_0x251a09[_0x8c35('0x5a')]&&fs[_0x8c35('0x65')](path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0xa89e48,_['toLower'](_0x251a09[_0x8c35('0x5a')])))?path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0xa89e48,_[_0x8c35('0x68')](_0x251a09[_0x8c35('0x5a')])):path['join'](config[_0x8c35('0x67')],_0xa89e48,_[_0x8c35('0x68')](_0x8c35('0x69')));var _0x1ea2ad=_0x8c35('0x6a')+_[_0x8c35('0x6b')](_0x8c35('0x5a'));if(_0x251a09[_0x1ea2ad]||!_0x44e1e7[_0x8c35('0x6c')]){_0xddd59d=path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0xa89e48,_[_0x8c35('0x68')]('default_logo.svg'));}if(!fs[_0x8c35('0x65')](_0xddd59d)){throw new db[(_0x8c35('0x6d'))][(_0x8c35('0x1b'))](_[_0x8c35('0x6b')](_0x8c35('0x5a'))+'\x20not\x20found');}return _0x5c160f['download'](_0xddd59d);}})['catch'](handleError(_0x5c160f,null));};var utilLicense=require('../../config/license/util');exports[_0x8c35('0x6e')]=function(_0x56325a,_0x1d8e77,_0x2e33e7){var _0x48d1c7=_0x8c35('0x5f');var _0x2565af={'custom':![]};return utilLicense[_0x8c35('0x60')]()['then'](function(_0xf8312f){if(_0xf8312f){_0x2565af=_0xf8312f;}return db['Setting']['find']({'where':{'id':_0x56325a[_0x8c35('0x53')]['id']},'attributes':[_0x8c35('0x5a'),_0x8c35('0x5c'),'preferred',_0x8c35('0x6f'),'defaultLogo','defaultLoginLogo',_0x8c35('0x63'),_0x8c35('0x64')],'raw':!![]});})[_0x8c35('0x33')](handleEntityNotFound(_0x1d8e77,null))[_0x8c35('0x33')](function(_0x117592){if(_0x117592){var _0x16d186=_0x117592[_0x8c35('0x5c')]&&fs[_0x8c35('0x65')](path[_0x8c35('0x66')](config['root'],_0x48d1c7,_[_0x8c35('0x68')](_0x117592['loginLogo'])))?path['join'](config[_0x8c35('0x67')],_0x48d1c7,_[_0x8c35('0x68')](_0x117592[_0x8c35('0x5c')])):path[_0x8c35('0x66')](config['root'],_0x48d1c7,_[_0x8c35('0x68')](_0x8c35('0x70')));var _0x15f666=_0x8c35('0x6a')+_['upperFirst'](_0x8c35('0x5c'));if(_0x117592[_0x15f666]||!_0x2565af[_0x8c35('0x6c')]){_0x16d186=path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x48d1c7,_[_0x8c35('0x68')](_0x8c35('0x70')));}if(!fs[_0x8c35('0x65')](_0x16d186)){throw new db['Sequelize'][(_0x8c35('0x1b'))](_[_0x8c35('0x6b')](_0x8c35('0x5c'))+_0x8c35('0x71'));}return _0x1d8e77[_0x8c35('0x72')](_0x16d186);}})[_0x8c35('0x27')](handleError(_0x1d8e77,null));};exports[_0x8c35('0x73')]=function(_0x1392d3,_0x751e3a){return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x1392d3[_0x8c35('0x53')]['id']},'attributes':['securePassword']})[_0x8c35('0x33')](respondWithResult(_0x751e3a,null))[_0x8c35('0x27')](handleError(_0x751e3a,null));};exports['addPreferred']=function(_0x231aff,_0x5462cc,_0x324b42){if(_0x231aff['file']&&_0x231aff[_0x8c35('0x58')]['filename']){_0x231aff['body'][_0x8c35('0x61')]=_0x231aff[_0x8c35('0x58')]['filename'];}return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x231aff[_0x8c35('0x53')]['id']}})[_0x8c35('0x33')](handleEntityNotFound(_0x5462cc,null))['then'](saveUpdates(_0x231aff[_0x8c35('0x55')],null))[_0x8c35('0x33')](respondWithResult(_0x5462cc,null))[_0x8c35('0x27')](handleError(_0x5462cc,null));};var utilLicense=require(_0x8c35('0x5d'));exports['getPreferred']=function(_0x2e9179,_0x486acd,_0x49e7ee){var _0x5802c2=_0x8c35('0x5f');var _0x38a70b={'custom':![]};return utilLicense[_0x8c35('0x60')]()[_0x8c35('0x33')](function(_0x3c7cd2){if(_0x3c7cd2){_0x38a70b=_0x3c7cd2;}return db[_0x8c35('0x39')][_0x8c35('0x56')]({'where':{'id':_0x2e9179[_0x8c35('0x53')]['id']},'attributes':['logo',_0x8c35('0x5c'),_0x8c35('0x61'),'favicon',_0x8c35('0x74'),_0x8c35('0x62'),_0x8c35('0x63'),_0x8c35('0x64')],'raw':!![]});})[_0x8c35('0x33')](handleEntityNotFound(_0x486acd,null))['then'](function(_0x76267b){if(_0x76267b){var _0x3025a5=_0x76267b[_0x8c35('0x61')]&&fs[_0x8c35('0x65')](path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x5802c2,_[_0x8c35('0x68')](_0x76267b[_0x8c35('0x61')])))?path['join'](config[_0x8c35('0x67')],_0x5802c2,_[_0x8c35('0x68')](_0x76267b[_0x8c35('0x61')])):path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x5802c2,_['toLower'](_0x8c35('0x75')));var _0x2135d7=_0x8c35('0x6a')+_[_0x8c35('0x6b')]('preferred');if(_0x76267b[_0x2135d7]||!_0x38a70b[_0x8c35('0x6c')]||!_0x38a70b[_0x8c35('0x61')]){_0x3025a5=path[_0x8c35('0x66')](config['root'],_0x5802c2,_[_0x8c35('0x68')](_0x8c35('0x75')));}if(!fs[_0x8c35('0x65')](_0x3025a5)){throw new db[(_0x8c35('0x6d'))][(_0x8c35('0x1b'))](_[_0x8c35('0x6b')](_0x8c35('0x61'))+'\x20not\x20found');}return _0x486acd['download'](_0x3025a5);}})['catch'](handleError(_0x486acd,null));};exports[_0x8c35('0x76')]=function(_0x1bb149,_0x3a99bd,_0x51861f){if(_0x1bb149[_0x8c35('0x58')]&&_0x1bb149[_0x8c35('0x58')][_0x8c35('0x59')]){_0x1bb149[_0x8c35('0x55')][_0x8c35('0x6f')]=_0x1bb149[_0x8c35('0x58')][_0x8c35('0x59')];}return db['Setting'][_0x8c35('0x56')]({'where':{'id':_0x1bb149['params']['id']}})['then'](handleEntityNotFound(_0x3a99bd,null))['then'](saveUpdates(_0x1bb149[_0x8c35('0x55')],null))['then'](respondWithResult(_0x3a99bd,null))[_0x8c35('0x27')](handleError(_0x3a99bd,null));};var utilLicense=require('../../config/license/util');exports[_0x8c35('0x77')]=function(_0x32dfe6,_0x22a30d,_0xf48451){var _0x49c991=_0x8c35('0x5f');var _0xf7772a={'custom':![]};return utilLicense['getLicense']()[_0x8c35('0x33')](function(_0x399a1c){if(_0x399a1c){_0xf7772a=_0x399a1c;}return db[_0x8c35('0x39')]['find']({'where':{'id':_0x32dfe6['params']['id']},'attributes':[_0x8c35('0x5a'),_0x8c35('0x5c'),_0x8c35('0x61'),_0x8c35('0x6f'),_0x8c35('0x74'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x8c35('0x33')](handleEntityNotFound(_0x22a30d,null))['then'](function(_0x43edbe){if(_0x43edbe){var _0x3e83ce=_0x43edbe[_0x8c35('0x6f')]&&fs[_0x8c35('0x65')](path['join'](config[_0x8c35('0x67')],_0x49c991,_[_0x8c35('0x68')](_0x43edbe['favicon'])))?path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x49c991,_[_0x8c35('0x68')](_0x43edbe[_0x8c35('0x6f')])):path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x49c991,_[_0x8c35('0x68')]('default_favicon.ico'));var _0x1f0dca=_0x8c35('0x6a')+_['upperFirst'](_0x8c35('0x6f'));if(_0x43edbe[_0x1f0dca]||!_0xf7772a[_0x8c35('0x6c')]){_0x3e83ce=path[_0x8c35('0x66')](config[_0x8c35('0x67')],_0x49c991,_['toLower'](_0x8c35('0x78')));}if(!fs[_0x8c35('0x65')](_0x3e83ce)){throw new db[(_0x8c35('0x6d'))][(_0x8c35('0x1b'))](_[_0x8c35('0x6b')]('favicon')+_0x8c35('0x71'));}return _0x22a30d[_0x8c35('0x72')](_0x3e83ce);}})['catch'](handleError(_0x22a30d,null));}; \ No newline at end of file +var _0x04c2=['params','find','body','file','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','\x20not\x20found','download','getLogoLogin','preferred','defaultFavicon','default_loginLogo.svg','custom','gdpr','securePassword','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','json','offset','limit','set','reject','save','update','destroy','sendStatus','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','show'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0x04c2,0x9e));var _0x204c=function(_0x243a32,_0x31f4c8){_0x243a32=_0x243a32-0x0;var _0xad7b97=_0x04c2[_0x243a32];return _0xad7b97;};'use strict';var pdf=require(_0x204c('0x0'));var emlformat=require(_0x204c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x204c('0x2'));var jsonpatch=require(_0x204c('0x3'));var rp=require(_0x204c('0x4'));var moment=require(_0x204c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x204c('0x6'));var util=require(_0x204c('0x7'));var path=require(_0x204c('0x8'));var sox=require(_0x204c('0x9'));var csv=require(_0x204c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x204c('0xb'));var squel=require('squel');var crypto=require(_0x204c('0xc'));var jsforce=require(_0x204c('0xd'));var deskjs=require(_0x204c('0xe'));var toCsv=require(_0x204c('0xa'));var querystring=require(_0x204c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x204c('0x10'));var qs=require(_0x204c('0x11'));var as=require(_0x204c('0x12'));var hardwareService=require(_0x204c('0x13'));var logger=require(_0x204c('0x14'))(_0x204c('0x15'));var utils=require(_0x204c('0x16'));var config=require('../../config/environment');var db=require(_0x204c('0x17'))['db'];var jayson=require(_0x204c('0x18'));var client=jayson[_0x204c('0x19')][_0x204c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x53f027,_0x1ff577,_0x5d750b){if(_0x5d750b){var _0xabca8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xabca8[_0x204c('0x1b')](_0x1ff577)){return _0x53f027;}else{throw new db[(_0x204c('0x1c'))][(_0x204c('0x1d'))](_0x204c('0x1e'));}}else{return _0x53f027;}}function respondWithRpcPromise(_0x34a56d,_0x5529e8,_0x378dfd,_0x59dc87){return new BPromise(function(_0x104af5,_0xd98b1e){var _0x2bcb0a=_0x59dc87||client;return _0x2bcb0a[_0x204c('0x1f')](_0x34a56d,_0x378dfd)[_0x204c('0x20')](function(_0x5b52a1){logger[_0x204c('0x21')]('Setting,\x20%s,\x20%s',_0x5529e8,'request\x20sent');logger[_0x204c('0x22')](_0x204c('0x23'),_0x5529e8,'request\x20sent',JSON[_0x204c('0x24')](_0x5b52a1));if(_0x5b52a1['error']){if(_0x5b52a1[_0x204c('0x25')][_0x204c('0x26')]===0x1f4){logger[_0x204c('0x25')](_0x204c('0x27'),_0x5529e8,_0x5b52a1['error'][_0x204c('0x28')]);return _0xd98b1e(_0x5b52a1[_0x204c('0x25')][_0x204c('0x28')]);}logger[_0x204c('0x25')](_0x204c('0x27'),_0x5529e8,_0x5b52a1[_0x204c('0x25')]['message']);return _0x104af5(_0x5b52a1[_0x204c('0x25')][_0x204c('0x28')]);}else{logger[_0x204c('0x21')](_0x204c('0x27'),_0x5529e8,_0x204c('0x29'));_0x104af5(_0x5b52a1[_0x204c('0x2a')][_0x204c('0x28')]);}})[_0x204c('0x2b')](function(_0xbf1686){logger[_0x204c('0x25')](_0x204c('0x27'),_0x5529e8,_0xbf1686);_0xd98b1e(_0xbf1686);});});}function respondWithStatusCode(_0x2f197f,_0x59f8f1){_0x59f8f1=_0x59f8f1||0xcc;return function(_0x5510c6){if(_0x5510c6){return _0x2f197f['sendStatus'](_0x59f8f1);}return _0x2f197f[_0x204c('0x2c')](_0x59f8f1)[_0x204c('0x2d')]();};}function respondWithResult(_0x4c6178,_0x174709){_0x174709=_0x174709||0xc8;return function(_0x58d4ab){if(_0x58d4ab){return _0x4c6178[_0x204c('0x2c')](_0x174709)[_0x204c('0x2e')](_0x58d4ab);}};}function respondWithFilteredResult(_0x5679c3,_0x55d1bd){return function(_0x12620e){if(_0x12620e){var _0x1fc3c8=_0x12620e['count'],_0x552a98=_0x55d1bd['offset'],_0x260a7d=_0x55d1bd[_0x204c('0x2f')]+_0x55d1bd[_0x204c('0x30')],_0x441194;if(_0x260a7d>=_0x1fc3c8){_0x260a7d=_0x1fc3c8;_0x441194=0xc8;}else{_0x441194=0xce;}_0x5679c3['status'](_0x441194);return _0x5679c3[_0x204c('0x31')]('Content-Range',_0x552a98+'-'+_0x260a7d+'/'+_0x1fc3c8)['json'](_0x12620e);}return null;};}function patchUpdates(_0x567dda){return function(_0x437151){try{jsonpatch['apply'](_0x437151,_0x567dda,!![]);}catch(_0x273890){return BPromise[_0x204c('0x32')](_0x273890);}return _0x437151[_0x204c('0x33')]();};}function saveUpdates(_0x32a692,_0x2bf526){return function(_0x17f69d){if(_0x17f69d){return _0x17f69d[_0x204c('0x34')](_0x32a692)['then'](function(_0x756bd6){return _0x756bd6;});}return null;};}function removeEntity(_0x3e39e7,_0x4ef10b){return function(_0x5d94de){if(_0x5d94de){return _0x5d94de[_0x204c('0x35')]()[_0x204c('0x20')](function(){_0x3e39e7[_0x204c('0x2c')](0xcc)[_0x204c('0x2d')]();});}};}function handleEntityNotFound(_0x583c9a,_0x202c76){return function(_0x564de2){if(!_0x564de2){_0x583c9a[_0x204c('0x36')](0x194);}return _0x564de2;};}function handleError(_0x1a975e,_0x587ebb){_0x587ebb=_0x587ebb||0x1f4;return function(_0xda3f54){logger['error'](_0xda3f54['stack']);if(_0xda3f54[_0x204c('0x37')]){delete _0xda3f54[_0x204c('0x37')];}_0x1a975e['status'](_0x587ebb)[_0x204c('0x38')](_0xda3f54);};}exports[_0x204c('0x39')]=function(_0x38ce1e,_0x326efa){var _0x5abd31={},_0x3ccb19={},_0x2cfb61={'count':0x0,'rows':[]};var _0x3f0550=_[_0x204c('0x3a')](db[_0x204c('0x3b')][_0x204c('0x3c')],function(_0x478b89){return{'name':_0x478b89[_0x204c('0x3d')],'type':_0x478b89[_0x204c('0x3e')][_0x204c('0x3f')]};});_0x3ccb19[_0x204c('0x40')]=_[_0x204c('0x3a')](_0x3f0550,_0x204c('0x37'));_0x3ccb19[_0x204c('0x41')]=_[_0x204c('0x42')](_0x38ce1e['query']);_0x3ccb19[_0x204c('0x43')]=_[_0x204c('0x44')](_0x3ccb19[_0x204c('0x40')],_0x3ccb19[_0x204c('0x41')]);_0x5abd31[_0x204c('0x45')]=_['intersection'](_0x3ccb19['model'],qs[_0x204c('0x46')](_0x38ce1e[_0x204c('0x41')][_0x204c('0x46')]));_0x5abd31[_0x204c('0x45')]=_0x5abd31['attributes'][_0x204c('0x47')]?_0x5abd31[_0x204c('0x45')]:_0x3ccb19[_0x204c('0x40')];if(!_0x38ce1e['query'][_0x204c('0x48')](_0x204c('0x49'))){_0x5abd31[_0x204c('0x30')]=qs['limit'](_0x38ce1e[_0x204c('0x41')]['limit']);_0x5abd31[_0x204c('0x2f')]=qs[_0x204c('0x2f')](_0x38ce1e['query'][_0x204c('0x2f')]);}_0x5abd31[_0x204c('0x4a')]=qs['sort'](_0x38ce1e['query'][_0x204c('0x4b')]);_0x5abd31['where']=qs[_0x204c('0x43')](_[_0x204c('0x4c')](_0x38ce1e[_0x204c('0x41')],_0x3ccb19[_0x204c('0x43')]),_0x3f0550);if(_0x38ce1e[_0x204c('0x41')][_0x204c('0x4d')]){_0x5abd31['where']=_[_0x204c('0x4e')](_0x5abd31[_0x204c('0x4f')],{'$or':_[_0x204c('0x3a')](_0x3f0550,function(_0x3f8d17){if(_0x3f8d17['type']!==_0x204c('0x50')){var _0x3dc46a={};_0x3dc46a[_0x3f8d17[_0x204c('0x37')]]={'$like':'%'+_0x38ce1e[_0x204c('0x41')]['filter']+'%'};return _0x3dc46a;}})});}_0x5abd31=_[_0x204c('0x4e')]({},_0x5abd31,_0x38ce1e[_0x204c('0x51')]);var _0x4117a3={'where':_0x5abd31[_0x204c('0x4f')]};return db[_0x204c('0x3b')][_0x204c('0x52')](_0x4117a3)[_0x204c('0x20')](function(_0x506e8e){_0x2cfb61[_0x204c('0x52')]=_0x506e8e;if(_0x38ce1e[_0x204c('0x41')][_0x204c('0x53')]){_0x5abd31[_0x204c('0x54')]=[{'all':!![]}];}return db['Setting'][_0x204c('0x55')](_0x5abd31);})[_0x204c('0x20')](function(_0x20f9b6){_0x2cfb61[_0x204c('0x56')]=_0x20f9b6;return _0x2cfb61;})['then'](respondWithFilteredResult(_0x326efa,_0x5abd31))[_0x204c('0x2b')](handleError(_0x326efa,null));};exports[_0x204c('0x57')]=function(_0x3c2e0f,_0x1dcc5b){var _0x2ca976={'raw':![],'where':{'id':_0x3c2e0f[_0x204c('0x58')]['id']}},_0x24b9a4={};_0x24b9a4[_0x204c('0x40')]=_[_0x204c('0x42')](db[_0x204c('0x3b')][_0x204c('0x3c')]);_0x24b9a4[_0x204c('0x41')]=_['keys'](_0x3c2e0f[_0x204c('0x41')]);_0x24b9a4['filters']=_['intersection'](_0x24b9a4[_0x204c('0x40')],_0x24b9a4[_0x204c('0x41')]);_0x2ca976[_0x204c('0x45')]=_[_0x204c('0x44')](_0x24b9a4[_0x204c('0x40')],qs['fields'](_0x3c2e0f[_0x204c('0x41')][_0x204c('0x46')]));_0x2ca976['attributes']=_0x2ca976[_0x204c('0x45')]['length']?_0x2ca976[_0x204c('0x45')]:_0x24b9a4[_0x204c('0x40')];if(_0x3c2e0f[_0x204c('0x41')][_0x204c('0x53')]){_0x2ca976[_0x204c('0x54')]=[{'all':!![]}];}_0x2ca976=_[_0x204c('0x4e')]({},_0x2ca976,_0x3c2e0f['options']);return db['Setting'][_0x204c('0x59')](_0x2ca976)[_0x204c('0x20')](handleEntityNotFound(_0x1dcc5b,null))['then'](respondWithResult(_0x1dcc5b,null))[_0x204c('0x2b')](handleError(_0x1dcc5b,null));};exports[_0x204c('0x34')]=function(_0x1e8436,_0x6e3a6d){if(_0x1e8436['body']['id']){delete _0x1e8436['body']['id'];}return db['Setting'][_0x204c('0x59')]({'where':{'id':_0x1e8436['params']['id']}})[_0x204c('0x20')](handleEntityNotFound(_0x6e3a6d,null))[_0x204c('0x20')](saveUpdates(_0x1e8436[_0x204c('0x5a')],null))[_0x204c('0x20')](respondWithResult(_0x6e3a6d,null))[_0x204c('0x2b')](handleError(_0x6e3a6d,null));};exports['addLogo']=function(_0x492b2e,_0x3cb702,_0x5f4edd){if(_0x492b2e['file']&&_0x492b2e[_0x204c('0x5b')][_0x204c('0x5c')]){_0x492b2e[_0x204c('0x5a')]['logo']=_0x492b2e['file'][_0x204c('0x5c')];}return db[_0x204c('0x3b')][_0x204c('0x59')]({'where':{'id':_0x492b2e['params']['id']}})[_0x204c('0x20')](handleEntityNotFound(_0x3cb702,null))['then'](saveUpdates(_0x492b2e[_0x204c('0x5a')],null))['then'](respondWithResult(_0x3cb702,null))[_0x204c('0x2b')](handleError(_0x3cb702,null));};exports[_0x204c('0x5d')]=function(_0x41781a,_0x5badcf,_0x1f5b81){if(_0x41781a[_0x204c('0x5b')]&&_0x41781a[_0x204c('0x5b')]['filename']){_0x41781a['body'][_0x204c('0x5e')]=_0x41781a[_0x204c('0x5b')][_0x204c('0x5c')];}return db[_0x204c('0x3b')][_0x204c('0x59')]({'where':{'id':_0x41781a[_0x204c('0x58')]['id']}})['then'](handleEntityNotFound(_0x5badcf,null))['then'](saveUpdates(_0x41781a['body'],null))['then'](respondWithResult(_0x5badcf,null))[_0x204c('0x2b')](handleError(_0x5badcf,null));};var utilLicense=require(_0x204c('0x5f'));exports['getLogo']=function(_0x553bdf,_0x1aa765,_0x16c5d5){var _0x508c4c=_0x204c('0x60');var _0x1723eb={'custom':![]};return utilLicense[_0x204c('0x61')]()[_0x204c('0x20')](function(_0x1e155e){if(_0x1e155e){_0x1723eb=_0x1e155e;}return db[_0x204c('0x3b')][_0x204c('0x59')]({'where':{'id':_0x553bdf['params']['id']},'attributes':[_0x204c('0x62'),'loginLogo','preferred',_0x204c('0x63'),_0x204c('0x64'),_0x204c('0x65'),_0x204c('0x66'),'defaultFavicon'],'raw':!![]});})[_0x204c('0x20')](handleEntityNotFound(_0x1aa765,null))['then'](function(_0x16d16d){if(_0x16d16d){var _0x4fcd89=_0x16d16d[_0x204c('0x62')]&&fs[_0x204c('0x67')](path[_0x204c('0x68')](config[_0x204c('0x69')],_0x508c4c,_[_0x204c('0x6a')](_0x16d16d[_0x204c('0x62')])))?path['join'](config[_0x204c('0x69')],_0x508c4c,_['toLower'](_0x16d16d[_0x204c('0x62')])):path[_0x204c('0x68')](config[_0x204c('0x69')],_0x508c4c,_[_0x204c('0x6a')](_0x204c('0x6b')));var _0x5b9c22=_0x204c('0x6c')+_[_0x204c('0x6d')](_0x204c('0x62'));if(_0x16d16d[_0x5b9c22]||!_0x1723eb['custom']){_0x4fcd89=path[_0x204c('0x68')](config['root'],_0x508c4c,_[_0x204c('0x6a')]('default_logo.svg'));}if(!fs[_0x204c('0x67')](_0x4fcd89)){throw new db[(_0x204c('0x1c'))]['ValidationError'](_['upperFirst'](_0x204c('0x62'))+_0x204c('0x6e'));}return _0x1aa765[_0x204c('0x6f')](_0x4fcd89);}})['catch'](handleError(_0x1aa765,null));};var utilLicense=require(_0x204c('0x5f'));exports[_0x204c('0x70')]=function(_0x5b0f14,_0x5d7c52,_0x57d759){var _0x52319d=_0x204c('0x60');var _0x5b898e={'custom':![]};return utilLicense[_0x204c('0x61')]()[_0x204c('0x20')](function(_0x1122c3){if(_0x1122c3){_0x5b898e=_0x1122c3;}return db['Setting'][_0x204c('0x59')]({'where':{'id':_0x5b0f14[_0x204c('0x58')]['id']},'attributes':[_0x204c('0x62'),_0x204c('0x5e'),_0x204c('0x71'),_0x204c('0x63'),_0x204c('0x64'),_0x204c('0x65'),_0x204c('0x66'),_0x204c('0x72')],'raw':!![]});})['then'](handleEntityNotFound(_0x5d7c52,null))['then'](function(_0x59c920){if(_0x59c920){var _0x33974b=_0x59c920[_0x204c('0x5e')]&&fs[_0x204c('0x67')](path['join'](config[_0x204c('0x69')],_0x52319d,_[_0x204c('0x6a')](_0x59c920[_0x204c('0x5e')])))?path[_0x204c('0x68')](config['root'],_0x52319d,_['toLower'](_0x59c920[_0x204c('0x5e')])):path[_0x204c('0x68')](config[_0x204c('0x69')],_0x52319d,_[_0x204c('0x6a')](_0x204c('0x73')));var _0x233788=_0x204c('0x6c')+_[_0x204c('0x6d')]('loginLogo');if(_0x59c920[_0x233788]||!_0x5b898e[_0x204c('0x74')]){_0x33974b=path[_0x204c('0x68')](config[_0x204c('0x69')],_0x52319d,_[_0x204c('0x6a')]('default_loginLogo.svg'));}if(!fs[_0x204c('0x67')](_0x33974b)){throw new db[(_0x204c('0x1c'))][(_0x204c('0x1d'))](_[_0x204c('0x6d')]('loginLogo')+_0x204c('0x6e'));}return _0x5d7c52[_0x204c('0x6f')](_0x33974b);}})['catch'](handleError(_0x5d7c52,null));};exports[_0x204c('0x75')]=function(_0x484255,_0x36c32a){return db['Setting'][_0x204c('0x59')]({'where':{'id':_0x484255[_0x204c('0x58')]['id']},'attributes':[_0x204c('0x76')]})[_0x204c('0x20')](respondWithResult(_0x36c32a,null))[_0x204c('0x2b')](handleError(_0x36c32a,null));};exports[_0x204c('0x77')]=function(_0x2844d5,_0x1bed1b,_0x275f2f){if(_0x2844d5[_0x204c('0x5b')]&&_0x2844d5['file'][_0x204c('0x5c')]){_0x2844d5['body'][_0x204c('0x71')]=_0x2844d5[_0x204c('0x5b')][_0x204c('0x5c')];}return db[_0x204c('0x3b')][_0x204c('0x59')]({'where':{'id':_0x2844d5[_0x204c('0x58')]['id']}})[_0x204c('0x20')](handleEntityNotFound(_0x1bed1b,null))[_0x204c('0x20')](saveUpdates(_0x2844d5[_0x204c('0x5a')],null))[_0x204c('0x20')](respondWithResult(_0x1bed1b,null))[_0x204c('0x2b')](handleError(_0x1bed1b,null));};var utilLicense=require(_0x204c('0x5f'));exports['getPreferred']=function(_0x48d31b,_0xefa1fb,_0x32ef20){var _0x117908=_0x204c('0x60');var _0x17f3e5={'custom':![]};return utilLicense[_0x204c('0x61')]()['then'](function(_0x5a90cd){if(_0x5a90cd){_0x17f3e5=_0x5a90cd;}return db[_0x204c('0x3b')]['find']({'where':{'id':_0x48d31b[_0x204c('0x58')]['id']},'attributes':['logo',_0x204c('0x5e'),_0x204c('0x71'),_0x204c('0x63'),_0x204c('0x64'),'defaultLoginLogo',_0x204c('0x66'),'defaultFavicon'],'raw':!![]});})[_0x204c('0x20')](handleEntityNotFound(_0xefa1fb,null))[_0x204c('0x20')](function(_0x5f1c4d){if(_0x5f1c4d){var _0x3f5d22=_0x5f1c4d[_0x204c('0x71')]&&fs[_0x204c('0x67')](path[_0x204c('0x68')](config['root'],_0x117908,_[_0x204c('0x6a')](_0x5f1c4d[_0x204c('0x71')])))?path[_0x204c('0x68')](config[_0x204c('0x69')],_0x117908,_[_0x204c('0x6a')](_0x5f1c4d[_0x204c('0x71')])):path[_0x204c('0x68')](config[_0x204c('0x69')],_0x117908,_[_0x204c('0x6a')]('default_preferred.png'));var _0x193e71=_0x204c('0x6c')+_[_0x204c('0x6d')]('preferred');if(_0x5f1c4d[_0x193e71]||!_0x17f3e5['custom']||!_0x17f3e5[_0x204c('0x71')]){_0x3f5d22=path[_0x204c('0x68')](config[_0x204c('0x69')],_0x117908,_[_0x204c('0x6a')](_0x204c('0x78')));}if(!fs[_0x204c('0x67')](_0x3f5d22)){throw new db[(_0x204c('0x1c'))][(_0x204c('0x1d'))](_['upperFirst']('preferred')+_0x204c('0x6e'));}return _0xefa1fb['download'](_0x3f5d22);}})[_0x204c('0x2b')](handleError(_0xefa1fb,null));};exports['addFavicon']=function(_0x687d80,_0x5b02ed,_0x16f17e){if(_0x687d80[_0x204c('0x5b')]&&_0x687d80[_0x204c('0x5b')]['filename']){_0x687d80['body']['favicon']=_0x687d80[_0x204c('0x5b')][_0x204c('0x5c')];}return db[_0x204c('0x3b')]['find']({'where':{'id':_0x687d80['params']['id']}})[_0x204c('0x20')](handleEntityNotFound(_0x5b02ed,null))['then'](saveUpdates(_0x687d80[_0x204c('0x5a')],null))[_0x204c('0x20')](respondWithResult(_0x5b02ed,null))['catch'](handleError(_0x5b02ed,null));};var utilLicense=require(_0x204c('0x5f'));exports[_0x204c('0x79')]=function(_0x36cf1b,_0x11ce3d,_0x33cbfb){var _0x3cb902='server/files/images/logos';var _0x560d2a={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x24f7b5){if(_0x24f7b5){_0x560d2a=_0x24f7b5;}return db['Setting'][_0x204c('0x59')]({'where':{'id':_0x36cf1b[_0x204c('0x58')]['id']},'attributes':['logo',_0x204c('0x5e'),_0x204c('0x71'),_0x204c('0x63'),'defaultLogo',_0x204c('0x65'),_0x204c('0x66'),_0x204c('0x72')],'raw':!![]});})['then'](handleEntityNotFound(_0x11ce3d,null))['then'](function(_0x4772a3){if(_0x4772a3){var _0x2d44bd=_0x4772a3[_0x204c('0x63')]&&fs[_0x204c('0x67')](path[_0x204c('0x68')](config[_0x204c('0x69')],_0x3cb902,_[_0x204c('0x6a')](_0x4772a3[_0x204c('0x63')])))?path['join'](config[_0x204c('0x69')],_0x3cb902,_[_0x204c('0x6a')](_0x4772a3[_0x204c('0x63')])):path[_0x204c('0x68')](config['root'],_0x3cb902,_['toLower'](_0x204c('0x7a')));var _0x53e4a6=_0x204c('0x6c')+_[_0x204c('0x6d')]('favicon');if(_0x4772a3[_0x53e4a6]||!_0x560d2a[_0x204c('0x74')]){_0x2d44bd=path['join'](config[_0x204c('0x69')],_0x3cb902,_[_0x204c('0x6a')](_0x204c('0x7a')));}if(!fs[_0x204c('0x67')](_0x2d44bd)){throw new db['Sequelize'][(_0x204c('0x1d'))](_[_0x204c('0x6d')](_0x204c('0x63'))+_0x204c('0x6e'));}return _0x11ce3d[_0x204c('0x6f')](_0x2d44bd);}})[_0x204c('0x2b')](handleError(_0x11ce3d,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 01a516b..ec93ac3 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 _0x5733=['define','settings','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./setting.attributes','exports'];(function(_0x388167,_0x1431ba){var _0x1ea71e=function(_0x216522){while(--_0x216522){_0x388167['push'](_0x388167['shift']());}};_0x1ea71e(++_0x1431ba);}(_0x5733,0xf4));var _0x3573=function(_0x581461,_0x502e14){_0x581461=_0x581461-0x0;var _0x2fc18b=_0x5733[_0x581461];return _0x2fc18b;};'use strict';var _=require(_0x3573('0x0'));var util=require(_0x3573('0x1'));var logger=require(_0x3573('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3573('0x3'));var rp=require(_0x3573('0x4'));var fs=require('fs');var path=require(_0x3573('0x5'));var rimraf=require('rimraf');var config=require(_0x3573('0x6'));var attributes=require(_0x3573('0x7'));module[_0x3573('0x8')]=function(_0x48227e,_0x205225){return _0x48227e[_0x3573('0x9')]('Setting',attributes,{'tableName':_0x3573('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd8a=['util','api','moment','bluebird','rimraf','../../config/environment','./setting.attributes','Setting','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfd8a,0x74));var _0xafd8=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xfd8a[_0x2bfe52];return _0x1cf649;};'use strict';var _=require(_0xafd8('0x0'));var util=require(_0xafd8('0x1'));var logger=require('../../config/logger')(_0xafd8('0x2'));var moment=require(_0xafd8('0x3'));var BPromise=require(_0xafd8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xafd8('0x5'));var config=require(_0xafd8('0x6'));var attributes=require(_0xafd8('0x7'));module['exports']=function(_0x2ae027,_0xeaba4d){return _0x2ae027['define'](_0xafd8('0x8'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7f5e8c2..8a3c049 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 _0x2b35=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0xfc5fd4,_0x43c5dc){var _0x34fa22=function(_0x1f5770){while(--_0x1f5770){_0xfc5fd4['push'](_0xfc5fd4['shift']());}};_0x34fa22(++_0x43c5dc);}(_0x2b35,0x1a1));var _0x52b3=function(_0x29287c,_0x1bbf21){_0x29287c=_0x29287c-0x0;var _0x27eaca=_0x2b35[_0x29287c];return _0x27eaca;};'use strict';var _=require(_0x52b3('0x0'));var util=require(_0x52b3('0x1'));var moment=require('moment');var BPromise=require(_0x52b3('0x2'));var rs=require(_0x52b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52b3('0x4'))['db'];var utils=require(_0x52b3('0x5'));var logger=require(_0x52b3('0x6'))(_0x52b3('0x7'));var config=require('../../config/environment');var jayson=require(_0x52b3('0x8'));var client=jayson[_0x52b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x884b4c,_0x17c60f,_0x2a6520){return new BPromise(function(_0x345024,_0x19a6dd){return client[_0x52b3('0xa')](_0x884b4c,_0x2a6520)[_0x52b3('0xb')](function(_0x4492c2){logger['info'](_0x52b3('0xc'),_0x17c60f,_0x52b3('0xd'));logger['debug'](_0x52b3('0xe'),_0x17c60f,_0x52b3('0xd'),JSON[_0x52b3('0xf')](_0x4492c2));if(_0x4492c2[_0x52b3('0x10')]){if(_0x4492c2['error'][_0x52b3('0x11')]===0x1f4){logger[_0x52b3('0x10')](_0x52b3('0xc'),_0x17c60f,_0x4492c2[_0x52b3('0x10')]['message']);return _0x19a6dd(_0x4492c2[_0x52b3('0x10')][_0x52b3('0x12')]);}logger[_0x52b3('0x10')](_0x52b3('0xc'),_0x17c60f,_0x4492c2['error'][_0x52b3('0x12')]);return _0x345024(_0x4492c2['error'][_0x52b3('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x17c60f,_0x52b3('0xd'));_0x345024(_0x4492c2['result'][_0x52b3('0x12')]);}})[_0x52b3('0x13')](function(_0x3a1143){logger[_0x52b3('0x10')](_0x52b3('0xc'),_0x17c60f,_0x3a1143);_0x19a6dd(_0x3a1143);});});} \ No newline at end of file +var _0xeeed=['code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x4f152f,_0xf0569f){var _0x16b76b=function(_0x2eec29){while(--_0x2eec29){_0x4f152f['push'](_0x4f152f['shift']());}};_0x16b76b(++_0xf0569f);}(_0xeeed,0x93));var _0xdeee=function(_0x31906e,_0x415d76){_0x31906e=_0x31906e-0x0;var _0x20be34=_0xeeed[_0x31906e];return _0x20be34;};'use strict';var _=require(_0xdeee('0x0'));var util=require('util');var moment=require(_0xdeee('0x1'));var BPromise=require('bluebird');var rs=require(_0xdeee('0x2'));var fs=require('fs');var Redis=require(_0xdeee('0x3'));var db=require(_0xdeee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdeee('0x5'))(_0xdeee('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdeee('0x7')][_0xdeee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9b6719,_0xc8d54a,_0x2c6ec9){return new BPromise(function(_0x162215,_0x2370a7){return client['request'](_0x9b6719,_0x2c6ec9)[_0xdeee('0x9')](function(_0x3c0710){logger[_0xdeee('0xa')](_0xdeee('0xb'),_0xc8d54a,'request\x20sent');logger[_0xdeee('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0xc8d54a,_0xdeee('0xd'),JSON['stringify'](_0x3c0710));if(_0x3c0710[_0xdeee('0xe')]){if(_0x3c0710['error'][_0xdeee('0xf')]===0x1f4){logger[_0xdeee('0xe')](_0xdeee('0xb'),_0xc8d54a,_0x3c0710[_0xdeee('0xe')][_0xdeee('0x10')]);return _0x2370a7(_0x3c0710['error'][_0xdeee('0x10')]);}logger[_0xdeee('0xe')]('Setting,\x20%s,\x20%s',_0xc8d54a,_0x3c0710[_0xdeee('0xe')][_0xdeee('0x10')]);return _0x162215(_0x3c0710[_0xdeee('0xe')]['message']);}else{logger[_0xdeee('0xa')](_0xdeee('0xb'),_0xc8d54a,'request\x20sent');_0x162215(_0x3c0710['result'][_0xdeee('0x10')]);}})[_0xdeee('0x11')](function(_0x30b350){logger[_0xdeee('0xe')](_0xdeee('0xb'),_0xc8d54a,_0x30b350);_0x2370a7(_0x30b350);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 052803d..215e8a0 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 _0x7b3a=['path','express','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7b3a,0x93));var _0xa7b3=function(_0x4cf664,_0x5ca30a){_0x4cf664=_0x4cf664-0x0;var _0x1cc8f6=_0x7b3a[_0x4cf664];return _0x1cc8f6;};'use strict';var multer=require(_0xa7b3('0x0'));var util=require('util');var path=require(_0xa7b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7b3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa7b3('0x3'));var controller=require(_0xa7b3('0x4'));router[_0xa7b3('0x5')]('/',auth[_0xa7b3('0x6')](),controller['index']);router[_0xa7b3('0x5')](_0xa7b3('0x7'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x8')]);router['get'](_0xa7b3('0x9'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0xa')]);router[_0xa7b3('0x5')]('/:id/dispositions',auth[_0xa7b3('0x6')](),controller['getDispositions']);router['get'](_0xa7b3('0xb'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0xc')]);router[_0xa7b3('0x5')]('/:id/applications',auth[_0xa7b3('0x6')](),controller[_0xa7b3('0xd')]);router[_0xa7b3('0x5')](_0xa7b3('0xe'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0xf')]);router['get'](_0xa7b3('0x10'),controller[_0xa7b3('0x11')]);router[_0xa7b3('0x5')](_0xa7b3('0x12'),auth[_0xa7b3('0x6')](),controller['getAgents']);router['post']('/',auth[_0xa7b3('0x6')](),controller['create']);router[_0xa7b3('0x13')](_0xa7b3('0x14'),auth['isAuthenticated'](),controller[_0xa7b3('0x15')]);router[_0xa7b3('0x13')](_0xa7b3('0xb'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x16')]);router[_0xa7b3('0x13')](_0xa7b3('0x17'),controller[_0xa7b3('0x18')]);router['post'](_0xa7b3('0x19'),auth[_0xa7b3('0x6')](),controller['addApplications']);router[_0xa7b3('0x13')]('/:id/send',auth['isAuthenticated'](),controller[_0xa7b3('0x1a')]);router['post']('/:id/status',controller[_0xa7b3('0x1b')]);router[_0xa7b3('0x13')](_0xa7b3('0x12'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x1c')]);router[_0xa7b3('0x1d')](_0xa7b3('0x9'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x1e')]);router[_0xa7b3('0x1f')](_0xa7b3('0x9'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x20')]);router['delete'](_0xa7b3('0x14'),auth['isAuthenticated'](),controller[_0xa7b3('0x21')]);router[_0xa7b3('0x1f')](_0xa7b3('0xb'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x22')]);router[_0xa7b3('0x1f')](_0xa7b3('0x12'),auth[_0xa7b3('0x6')](),controller[_0xa7b3('0x23')]);module[_0xa7b3('0x24')]=router; \ No newline at end of file +var _0x6b09=['get','isAuthenticated','describe','show','/:id/dispositions','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','status','addAgents','put','/:id','update','delete','removeAnswers','removeAgents','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','index'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x6b09,0xe1));var _0x96b0=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x6b09[_0x3792e6];return _0x441e44;};'use strict';var multer=require(_0x96b0('0x0'));var util=require('util');var path=require(_0x96b0('0x1'));var timeout=require(_0x96b0('0x2'));var express=require('express');var router=express[_0x96b0('0x3')]();var auth=require(_0x96b0('0x4'));var interaction=require(_0x96b0('0x5'));var config=require(_0x96b0('0x6'));var controller=require(_0x96b0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x96b0('0x8')]);router[_0x96b0('0x9')]('/describe',auth[_0x96b0('0xa')](),controller[_0x96b0('0xb')]);router['get']('/:id',auth[_0x96b0('0xa')](),controller[_0x96b0('0xc')]);router['get'](_0x96b0('0xd'),auth[_0x96b0('0xa')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x96b0('0xa')](),controller[_0x96b0('0xe')]);router[_0x96b0('0x9')](_0x96b0('0xf'),auth[_0x96b0('0xa')](),controller['getApplications']);router[_0x96b0('0x9')](_0x96b0('0x10'),auth[_0x96b0('0xa')](),controller['getInteractions']);router['get'](_0x96b0('0x11'),controller[_0x96b0('0x12')]);router['get'](_0x96b0('0x13'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x14')]);router[_0x96b0('0x15')]('/',auth['isAuthenticated'](),controller[_0x96b0('0x16')]);router[_0x96b0('0x15')](_0x96b0('0xd'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x17')]);router[_0x96b0('0x15')](_0x96b0('0x18'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x19')]);router[_0x96b0('0x15')](_0x96b0('0x1a'),controller[_0x96b0('0x1b')]);router[_0x96b0('0x15')]('/:id/applications',auth[_0x96b0('0xa')](),controller[_0x96b0('0x1c')]);router[_0x96b0('0x15')](_0x96b0('0x1d'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x1e')]);router['post'](_0x96b0('0x11'),controller[_0x96b0('0x1f')]);router[_0x96b0('0x15')](_0x96b0('0x13'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x20')]);router[_0x96b0('0x21')](_0x96b0('0x22'),auth[_0x96b0('0xa')](),controller[_0x96b0('0x23')]);router[_0x96b0('0x24')](_0x96b0('0x22'),auth[_0x96b0('0xa')](),controller['destroy']);router[_0x96b0('0x24')](_0x96b0('0xd'),auth[_0x96b0('0xa')](),controller['removeDispositions']);router['delete'](_0x96b0('0x18'),auth['isAuthenticated'](),controller[_0x96b0('0x25')]);router[_0x96b0('0x24')](_0x96b0('0x13'),auth['isAuthenticated'](),controller[_0x96b0('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 85de4e9..624e073 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 _0x6d2a=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','name','generate','ENUM','skebby','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x401fd6,_0xb28d69){var _0x451f8f=function(_0x315816){while(--_0x315816){_0x401fd6['push'](_0x401fd6['shift']());}};_0x451f8f(++_0xb28d69);}(_0x6d2a,0x191));var _0xa6d2=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0x6d2a[_0xe65ac8];return _0x202ba1;};'use strict';var Sequelize=require(_0xa6d2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xa6d2('0x1')],'unique':_0xa6d2('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xa6d2('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xa6d2('0x1')],'defaultValue':function(){return rs[_0xa6d2('0x3')]();}},'phone':{'type':Sequelize[_0xa6d2('0x1')]},'type':{'type':Sequelize[_0xa6d2('0x4')]('twilio',_0xa6d2('0x5'),'connectel',_0xa6d2('0x6'),_0xa6d2('0x7'),_0xa6d2('0x8'),_0xa6d2('0x9'),'infobip',_0xa6d2('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa6d2('0x1')]},'authToken':{'type':Sequelize[_0xa6d2('0x1')]},'smsMethod':{'type':Sequelize[_0xa6d2('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa6d2('0x1')]},'password':{'type':Sequelize[_0xa6d2('0x1')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xa6d2('0x1')]},'deliveryReport':{'type':Sequelize[_0xa6d2('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xa6d2('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa6d2('0xc');}},'notificationSound':{'type':Sequelize[_0xa6d2('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa6d2('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6d2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa6d2('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6d2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6d2('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa6d2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa6d2('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6d2('0xd')],'comment':_0xa6d2('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa6d2('0xf'),'set':function(_0x3c7e87){if(!_0x3c7e87)this[_0xa6d2('0x10')](_0xa6d2('0x11'),null);this[_0xa6d2('0x10')]('mandatoryDisposition',_0x3c7e87);}}}; \ No newline at end of file +var _0x1e6a=['ENUM','twilio','skebby','connectel','plivo','clickatell','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate'];(function(_0x1586c8,_0x31d4d8){var _0x13f487=function(_0x25ab3a){while(--_0x25ab3a){_0x1586c8['push'](_0x1586c8['shift']());}};_0x13f487(++_0x31d4d8);}(_0x1e6a,0x163));var _0xa1e6=function(_0x271b8a,_0x3ae3eb){_0x271b8a=_0x271b8a-0x0;var _0x1697db=_0x1e6a[_0x271b8a];return _0x1697db;};'use strict';var Sequelize=require(_0xa1e6('0x0'));var rs=require(_0xa1e6('0x1'));module[_0xa1e6('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa1e6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa1e6('0x3')],'defaultValue':function(){return rs[_0xa1e6('0x4')]();}},'phone':{'type':Sequelize[_0xa1e6('0x3')]},'type':{'type':Sequelize[_0xa1e6('0x5')](_0xa1e6('0x6'),_0xa1e6('0x7'),_0xa1e6('0x8'),'clicksend',_0xa1e6('0x9'),_0xa1e6('0xa'),'csc','infobip',_0xa1e6('0xb'))},'accountSid':{'type':Sequelize[_0xa1e6('0x3')]},'authId':{'type':Sequelize[_0xa1e6('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xa1e6('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa1e6('0x3')]},'password':{'type':Sequelize[_0xa1e6('0x3')]},'apiKey':{'type':Sequelize[_0xa1e6('0x3')]},'senderString':{'type':Sequelize[_0xa1e6('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa1e6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa1e6('0xc')],'defaultValue':function(){return _0xa1e6('0xd');}},'notificationSound':{'type':Sequelize[_0xa1e6('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa1e6('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa1e6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa1e6('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa1e6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa1e6('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa1e6('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa1e6('0xf')],'comment':_0xa1e6('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xa1e6('0xe')],'defaultValue':![],'comment':_0xa1e6('0x11'),'set':function(_0x564a05){if(!_0x564a05)this[_0xa1e6('0x12')](_0xa1e6('0x13'),null);this[_0xa1e6('0x12')]('mandatoryDisposition',_0x564a05);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 227d0f9..36997da 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 _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','addApplications','sequelize','bulkCreate'];(function(_0x2bd1af,_0x22e1aa){var _0x1de6d1=function(_0x2e67dd){while(--_0x2e67dd){_0x2bd1af['push'](_0x2bd1af['shift']());}};_0x1de6d1(++_0x22e1aa);}(_0x7a54,0x106));var _0x47a5=function(_0x1d991b,_0x9caa62){_0x1d991b=_0x1d991b-0x0;var _0x11de6c=_0x7a54[_0x1d991b];return _0x11de6c;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));}; \ No newline at end of file +var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','addApplications','sequelize','bulkCreate'];(function(_0x364d99,_0x25a352){var _0x21d5ec=function(_0x37ac8b){while(--_0x37ac8b){_0x364d99['push'](_0x364d99['shift']());}};_0x21d5ec(++_0x25a352);}(_0x7a54,0x106));var _0x47a5=function(_0x34d2c0,_0x3680fe){_0x34d2c0=_0x34d2c0-0x0;var _0x153244=_0x7a54[_0x34d2c0];return _0x153244;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2b9617a..f233d1c 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 _0x3417=['events','../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','exports'];(function(_0xd465de,_0x1d7a90){var _0x31388a=function(_0x793747){while(--_0x793747){_0xd465de['push'](_0xd465de['shift']());}};_0x31388a(++_0x1d7a90);}(_0x3417,0xf8));var _0x7341=function(_0x21c5f4,_0x1be642){_0x21c5f4=_0x21c5f4-0x0;var _0x54587f=_0x3417[_0x21c5f4];return _0x54587f;};'use strict';var EventEmitter=require(_0x7341('0x0'));var SmsAccount=require(_0x7341('0x1'))['db'][_0x7341('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7341('0x3'),'afterDestroy':_0x7341('0x4')};function emitEvent(_0x380dd6){return function(_0x4921da,_0x5689ae,_0x32b22c){SmsAccountEvents['emit'](_0x380dd6+':'+_0x4921da['id'],_0x4921da);SmsAccountEvents[_0x7341('0x5')](_0x380dd6,_0x4921da);_0x32b22c(null);};}for(var e in events){if(events[_0x7341('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7341('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x949c=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x949c,0x19b));var _0xc949=function(_0x37b003,_0x330b7a){_0x37b003=_0x37b003-0x0;var _0x1cb93a=_0x949c[_0x37b003];return _0x1cb93a;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xc949('0x0'))['db'][_0xc949('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc949('0x2')](0x0);var events={'afterCreate':_0xc949('0x3'),'afterUpdate':_0xc949('0x4'),'afterDestroy':_0xc949('0x5')};function emitEvent(_0x204446){return function(_0x356d28,_0x4a7afa,_0x4aa5f7){SmsAccountEvents[_0xc949('0x6')](_0x204446+':'+_0x356d28['id'],_0x356d28);SmsAccountEvents[_0xc949('0x6')](_0x204446,_0x356d28);_0x4aa5f7(null);};}for(var e in events){if(events[_0xc949('0x7')](e)){var event=events[e];SmsAccount[_0xc949('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index bf15453..68d2b6f 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 _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5ce8b9,_0x46d4f9){var _0x28c64f=function(_0x45f0ab){while(--_0x45f0ab){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0x28c64f(++_0x46d4f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x111cb5,_0x1ccd05){var _0x34f5fe=function(_0x82bc79){while(--_0x82bc79){_0x111cb5['push'](_0x111cb5['shift']());}};_0x34f5fe(++_0x1ccd05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'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 deaca7d..a44f8ce 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 _0x8109=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xe05ca,_0x5ce053){var _0x217914=function(_0x89f3da){while(--_0x89f3da){_0xe05ca['push'](_0xe05ca['shift']());}};_0x217914(++_0x5ce053);}(_0x8109,0xfc));var _0x9810=function(_0x265ed2,_0x3a2f36){_0x265ed2=_0x265ed2-0x0;var _0x3ab17c=_0x8109[_0x265ed2];return _0x3ab17c;};'use strict';var _=require(_0x9810('0x0'));var util=require(_0x9810('0x1'));var moment=require(_0x9810('0x2'));var BPromise=require(_0x9810('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9810('0x4'));var db=require(_0x9810('0x5'))['db'];var utils=require(_0x9810('0x6'));var logger=require(_0x9810('0x7'))(_0x9810('0x8'));var config=require('../../config/environment');var jayson=require(_0x9810('0x9'));var client=jayson[_0x9810('0xa')][_0x9810('0xb')]({'port':0x232a});config[_0x9810('0xc')]=_[_0x9810('0xd')](config[_0x9810('0xc')],{'host':_0x9810('0xe'),'port':0x18eb});var socket=require(_0x9810('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x9810('0x10')](socket);function respondWithRpcPromise(_0x45c467,_0x50840b,_0x4188a5){return new BPromise(function(_0x4790f8,_0x412c83){return client['request'](_0x45c467,_0x4188a5)[_0x9810('0x11')](function(_0x8d1a22){logger[_0x9810('0x12')](_0x9810('0x13'),_0x50840b,_0x9810('0x14'));logger[_0x9810('0x15')](_0x9810('0x16'),_0x50840b,_0x9810('0x14'),JSON[_0x9810('0x17')](_0x8d1a22));if(_0x8d1a22[_0x9810('0x18')]){if(_0x8d1a22[_0x9810('0x18')][_0x9810('0x19')]===0x1f4){logger[_0x9810('0x18')](_0x9810('0x13'),_0x50840b,_0x8d1a22[_0x9810('0x18')]['message']);return _0x412c83(_0x8d1a22[_0x9810('0x18')][_0x9810('0x1a')]);}logger['error'](_0x9810('0x13'),_0x50840b,_0x8d1a22[_0x9810('0x18')][_0x9810('0x1a')]);return _0x4790f8(_0x8d1a22[_0x9810('0x18')][_0x9810('0x1a')]);}else{logger['info'](_0x9810('0x13'),_0x50840b,_0x9810('0x14'));_0x4790f8(_0x8d1a22['result'][_0x9810('0x1a')]);}})[_0x9810('0x1b')](function(_0x305fe9){logger[_0x9810('0x18')]('SmsAccount,\x20%s,\x20%s',_0x50840b,_0x305fe9);_0x412c83(_0x305fe9);});});}exports[_0x9810('0x1c')]=function(_0x1ec6ce){var _0x2e21a8=this;return new Promise(function(_0x15f255,_0x3b42a2){return db['SmsAccount'][_0x9810('0x1d')]({'raw':_0x1ec6ce[_0x9810('0x1e')]?_0x1ec6ce['options'][_0x9810('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ec6ce[_0x9810('0x1e')]?_0x1ec6ce[_0x9810('0x1e')][_0x9810('0x20')]||null:null,'attributes':_0x1ec6ce[_0x9810('0x1e')]?_0x1ec6ce[_0x9810('0x1e')][_0x9810('0x21')]||null:null,'include':_0x1ec6ce[_0x9810('0x1e')]?_0x1ec6ce[_0x9810('0x1e')][_0x9810('0x22')]?_['map'](_0x1ec6ce[_0x9810('0x1e')][_0x9810('0x22')],function(_0x4c3ef9){return{'model':db[_0x4c3ef9[_0x9810('0x23')]],'as':_0x4c3ef9['as'],'attributes':_0x4c3ef9[_0x9810('0x21')],'include':_0x4c3ef9['include']?_[_0x9810('0x24')](_0x4c3ef9[_0x9810('0x22')],function(_0x29d09a){return{'model':db[_0x29d09a[_0x9810('0x23')]],'as':_0x29d09a['as'],'attributes':_0x29d09a['attributes'],'include':_0x29d09a['include']?_[_0x9810('0x24')](_0x29d09a[_0x9810('0x22')],function(_0x363ddc){return{'model':db[_0x363ddc[_0x9810('0x23')]],'as':_0x363ddc['as'],'attributes':_0x363ddc[_0x9810('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9810('0x11')](function(_0x508b39){logger[_0x9810('0x12')](_0x9810('0x1c'),_0x1ec6ce);logger['debug'](_0x9810('0x1c'),_0x1ec6ce,JSON[_0x9810('0x17')](_0x508b39));_0x15f255(_0x508b39);})[_0x9810('0x1b')](function(_0x477be4){logger[_0x9810('0x18')](_0x9810('0x1c'),_0x477be4[_0x9810('0x1a')],_0x1ec6ce);_0x3b42a2(_0x2e21a8[_0x9810('0x18')](0x1f4,_0x477be4['message']));});});}; \ No newline at end of file +var _0xdd7f=['message','result','find','options','raw','where','attributes','map','include','model','then','ShowSmsAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsAccount,\x20%s,\x20%s'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xdd7f,0x1a3));var _0xfdd7=function(_0x2872e0,_0x33e460){_0x2872e0=_0x2872e0-0x0;var _0x16fd85=_0xdd7f[_0x2872e0];return _0x16fd85;};'use strict';var _=require('lodash');var util=require(_0xfdd7('0x0'));var moment=require('moment');var BPromise=require(_0xfdd7('0x1'));var rs=require(_0xfdd7('0x2'));var fs=require('fs');var Redis=require(_0xfdd7('0x3'));var db=require(_0xfdd7('0x4'))['db'];var utils=require(_0xfdd7('0x5'));var logger=require(_0xfdd7('0x6'))('rpc');var config=require(_0xfdd7('0x7'));var jayson=require(_0xfdd7('0x8'));var client=jayson[_0xfdd7('0x9')][_0xfdd7('0xa')]({'port':0x232a});config[_0xfdd7('0xb')]=_[_0xfdd7('0xc')](config[_0xfdd7('0xb')],{'host':_0xfdd7('0xd'),'port':0x18eb});var socket=require(_0xfdd7('0xe'))(new Redis(config['redis']));require(_0xfdd7('0xf'))[_0xfdd7('0x10')](socket);function respondWithRpcPromise(_0x1d1a49,_0x5f4b2a,_0x257eae){return new BPromise(function(_0x4f4d7b,_0x46a959){return client[_0xfdd7('0x11')](_0x1d1a49,_0x257eae)['then'](function(_0x4339d1){logger[_0xfdd7('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5f4b2a,'request\x20sent');logger[_0xfdd7('0x13')](_0xfdd7('0x14'),_0x5f4b2a,_0xfdd7('0x15'),JSON[_0xfdd7('0x16')](_0x4339d1));if(_0x4339d1[_0xfdd7('0x17')]){if(_0x4339d1[_0xfdd7('0x17')]['code']===0x1f4){logger['error'](_0xfdd7('0x18'),_0x5f4b2a,_0x4339d1[_0xfdd7('0x17')][_0xfdd7('0x19')]);return _0x46a959(_0x4339d1[_0xfdd7('0x17')][_0xfdd7('0x19')]);}logger[_0xfdd7('0x17')]('SmsAccount,\x20%s,\x20%s',_0x5f4b2a,_0x4339d1[_0xfdd7('0x17')][_0xfdd7('0x19')]);return _0x4f4d7b(_0x4339d1[_0xfdd7('0x17')][_0xfdd7('0x19')]);}else{logger[_0xfdd7('0x12')](_0xfdd7('0x18'),_0x5f4b2a,'request\x20sent');_0x4f4d7b(_0x4339d1[_0xfdd7('0x1a')][_0xfdd7('0x19')]);}})['catch'](function(_0x3c09be){logger[_0xfdd7('0x17')]('SmsAccount,\x20%s,\x20%s',_0x5f4b2a,_0x3c09be);_0x46a959(_0x3c09be);});});}exports['ShowSmsAccount']=function(_0x5e9658){var _0x2b7fbf=this;return new Promise(function(_0x1319cb,_0x464054){return db['SmsAccount'][_0xfdd7('0x1b')]({'raw':_0x5e9658[_0xfdd7('0x1c')]?_0x5e9658[_0xfdd7('0x1c')][_0xfdd7('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e9658[_0xfdd7('0x1c')]?_0x5e9658[_0xfdd7('0x1c')][_0xfdd7('0x1e')]||null:null,'attributes':_0x5e9658[_0xfdd7('0x1c')]?_0x5e9658[_0xfdd7('0x1c')][_0xfdd7('0x1f')]||null:null,'include':_0x5e9658[_0xfdd7('0x1c')]?_0x5e9658['options']['include']?_[_0xfdd7('0x20')](_0x5e9658[_0xfdd7('0x1c')][_0xfdd7('0x21')],function(_0x3e9fbc){return{'model':db[_0x3e9fbc[_0xfdd7('0x22')]],'as':_0x3e9fbc['as'],'attributes':_0x3e9fbc[_0xfdd7('0x1f')],'include':_0x3e9fbc[_0xfdd7('0x21')]?_['map'](_0x3e9fbc[_0xfdd7('0x21')],function(_0x346023){return{'model':db[_0x346023[_0xfdd7('0x22')]],'as':_0x346023['as'],'attributes':_0x346023['attributes'],'include':_0x346023[_0xfdd7('0x21')]?_[_0xfdd7('0x20')](_0x346023[_0xfdd7('0x21')],function(_0x51b765){return{'model':db[_0x51b765[_0xfdd7('0x22')]],'as':_0x51b765['as'],'attributes':_0x51b765[_0xfdd7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfdd7('0x23')](function(_0x43d814){logger['info'](_0xfdd7('0x24'),_0x5e9658);logger[_0xfdd7('0x13')]('ShowSmsAccount',_0x5e9658,JSON[_0xfdd7('0x16')](_0x43d814));_0x1319cb(_0x43d814);})['catch'](function(_0x29ffb3){logger[_0xfdd7('0x17')](_0xfdd7('0x24'),_0x29ffb3[_0xfdd7('0x19')],_0x5e9658);_0x464054(_0x2b7fbf['error'](0x1f4,_0x29ffb3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 4a76adb..93d73d5 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 _0xe451=['register','length','smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener'];(function(_0xa3918c,_0x59c668){var _0x322ee2=function(_0x2e7014){while(--_0x2e7014){_0xa3918c['push'](_0xa3918c['shift']());}};_0x322ee2(++_0x59c668);}(_0xe451,0x12c));var _0x1e45=function(_0x2f8809,_0x167daf){_0x2f8809=_0x2f8809-0x0;var _0x561ef3=_0xe451[_0x2f8809];return _0x561ef3;};'use strict';var SmsAccountEvents=require(_0x1e45('0x0'));var events=[_0x1e45('0x1'),_0x1e45('0x2'),_0x1e45('0x3')];function createListener(_0x46a335,_0x1d9fc7){return function(_0x5661a7){_0x1d9fc7[_0x1e45('0x4')](_0x46a335,_0x5661a7);};}function removeListener(_0x54da5a,_0x3ad59c){return function(){SmsAccountEvents[_0x1e45('0x5')](_0x54da5a,_0x3ad59c);};}exports[_0x1e45('0x6')]=function(_0x170aba){for(var _0x3c3b4d=0x0,_0x55d10a=events[_0x1e45('0x7')];_0x3c3b4d<_0x55d10a;_0x3c3b4d++){var _0x2fde13=events[_0x3c3b4d];var _0x57e1ac=createListener(_0x1e45('0x8')+_0x2fde13,_0x170aba);SmsAccountEvents['on'](_0x2fde13,_0x57e1ac);}}; \ No newline at end of file +var _0x9e0d=['emit','length','./smsAccount.events','save','remove','update'];(function(_0x4ef235,_0x485f12){var _0x39996f=function(_0x3d0e02){while(--_0x3d0e02){_0x4ef235['push'](_0x4ef235['shift']());}};_0x39996f(++_0x485f12);}(_0x9e0d,0xf8));var _0xd9e0=function(_0x2b78e5,_0x3126f8){_0x2b78e5=_0x2b78e5-0x0;var _0xa8d52d=_0x9e0d[_0x2b78e5];return _0xa8d52d;};'use strict';var SmsAccountEvents=require(_0xd9e0('0x0'));var events=[_0xd9e0('0x1'),_0xd9e0('0x2'),_0xd9e0('0x3')];function createListener(_0x3a6544,_0x20914e){return function(_0x1e11be){_0x20914e[_0xd9e0('0x4')](_0x3a6544,_0x1e11be);};}function removeListener(_0x3e20bb,_0x275a3b){return function(){SmsAccountEvents['removeListener'](_0x3e20bb,_0x275a3b);};}exports['register']=function(_0x25381e){for(var _0x4560a0=0x0,_0x659b86=events[_0xd9e0('0x5')];_0x4560a0<_0x659b86;_0x4560a0++){var _0x3ef9cd=events[_0x4560a0];var _0x1d39ab=createListener('smsAccount:'+_0x3ef9cd,_0x25381e);SmsAccountEvents['on'](_0x3ef9cd,_0x1d39ab);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 53d92a9..f3424ad 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 _0x9f6b=['../../components/auth/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','/:id','show','post','create','multer','util','path','connect-timeout','express','Router'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9f6b,0x162));var _0xb9f6=function(_0x680443,_0x1ab79f){_0x680443=_0x680443-0x0;var _0x28121f=_0x9f6b[_0x680443];return _0x28121f;};'use strict';var multer=require(_0xb9f6('0x0'));var util=require(_0xb9f6('0x1'));var path=require(_0xb9f6('0x2'));var timeout=require(_0xb9f6('0x3'));var express=require(_0xb9f6('0x4'));var router=express[_0xb9f6('0x5')]();var auth=require(_0xb9f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb9f6('0x7'));var controller=require(_0xb9f6('0x8'));router['get']('/',auth[_0xb9f6('0x9')](),controller[_0xb9f6('0xa')]);router['get'](_0xb9f6('0xb'),auth[_0xb9f6('0x9')](),controller[_0xb9f6('0xc')]);router[_0xb9f6('0xd')]('/',auth['isAuthenticated'](),controller[_0xb9f6('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xb9f6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xda45=['get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller'];(function(_0x4b18e3,_0x48cac8){var _0x2ec7fd=function(_0x48d1f8){while(--_0x48d1f8){_0x4b18e3['push'](_0x4b18e3['shift']());}};_0x2ec7fd(++_0x48cac8);}(_0xda45,0xe6));var _0x5da4=function(_0x20f731,_0x19f74a){_0x20f731=_0x20f731-0x0;var _0x5afe0c=_0xda45[_0x20f731];return _0x5afe0c;};'use strict';var multer=require(_0x5da4('0x0'));var util=require('util');var path=require(_0x5da4('0x1'));var timeout=require(_0x5da4('0x2'));var express=require('express');var router=express[_0x5da4('0x3')]();var auth=require(_0x5da4('0x4'));var interaction=require(_0x5da4('0x5'));var config=require(_0x5da4('0x6'));var controller=require(_0x5da4('0x7'));router[_0x5da4('0x8')]('/',auth[_0x5da4('0x9')](),controller[_0x5da4('0xa')]);router[_0x5da4('0x8')](_0x5da4('0xb'),auth[_0x5da4('0x9')](),controller[_0x5da4('0xc')]);router['post']('/',auth[_0x5da4('0x9')](),controller['create']);router[_0x5da4('0xd')]('/:id',auth[_0x5da4('0x9')](),controller['update']);router[_0x5da4('0xe')](_0x5da4('0xb'),auth[_0x5da4('0x9')](),controller[_0x5da4('0xf')]);module[_0x5da4('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1b8e970..1cdae0d 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 _0x023b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x023b,0x80));var _0xb023=function(_0x56c4bc,_0x3e87fa){_0x56c4bc=_0x56c4bc-0x0;var _0x34dfea=_0x023b[_0x56c4bc];return _0x34dfea;};'use strict';var Sequelize=require(_0xb023('0x0'));module[_0xb023('0x1')]={'priority':{'type':Sequelize[_0xb023('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb023('0x3')],'allowNull':![],'defaultValue':_0xb023('0x4')},'appdata':{'type':Sequelize[_0xb023('0x5')]()},'description':{'type':Sequelize[_0xb023('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb023('0x6')}}; \ No newline at end of file +var _0x717b=['noop','TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x717b,0x136));var _0xb717=function(_0x472070,_0xbc8757){_0x472070=_0x472070-0x0;var _0x379085=_0x717b[_0x472070];return _0x379085;};'use strict';var Sequelize=require(_0xb717('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb717('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb717('0x2')},'appdata':{'type':Sequelize[_0xb717('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb717('0x4')],'defaultValue':_0xb717('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index d89cd3b..99ef64d 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 _0x5204=['moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','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','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','SmsApplication','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','catch','show','params','rawAttributes','keys','includeAll','include','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x14f8a4,_0x47af7f){var _0x562f74=function(_0x11b1b6){while(--_0x11b1b6){_0x14f8a4['push'](_0x14f8a4['shift']());}};_0x562f74(++_0x47af7f);}(_0x5204,0xdf));var _0x4520=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x5204[_0x36f243];return _0x426436;};'use strict';var pdf=require(_0x4520('0x0'));var emlformat=require(_0x4520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require('mustache');var util=require(_0x4520('0x7'));var path=require('path');var sox=require(_0x4520('0x8'));var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x9'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var db=require(_0x4520('0x19'))['db'];function respondWithStatusCode(_0x394072,_0x3c7a5d){_0x3c7a5d=_0x3c7a5d||0xcc;return function(_0x508ea6){if(_0x508ea6){return _0x394072[_0x4520('0x1a')](_0x3c7a5d);}return _0x394072[_0x4520('0x1b')](_0x3c7a5d)[_0x4520('0x1c')]();};}function respondWithResult(_0x4677d7,_0x426836){_0x426836=_0x426836||0xc8;return function(_0x34d383){if(_0x34d383){return _0x4677d7[_0x4520('0x1b')](_0x426836)['json'](_0x34d383);}};}function respondWithFilteredResult(_0x3e53e5,_0x20de6b){return function(_0x1ab841){if(_0x1ab841){var _0x15a31f=_0x1ab841[_0x4520('0x1d')],_0x32d8aa=_0x20de6b[_0x4520('0x1e')],_0x51d85f=_0x20de6b[_0x4520('0x1e')]+_0x20de6b[_0x4520('0x1f')],_0x2c1805;if(_0x51d85f>=_0x15a31f){_0x51d85f=_0x15a31f;_0x2c1805=0xc8;}else{_0x2c1805=0xce;}_0x3e53e5[_0x4520('0x1b')](_0x2c1805);return _0x3e53e5[_0x4520('0x20')](_0x4520('0x21'),_0x32d8aa+'-'+_0x51d85f+'/'+_0x15a31f)[_0x4520('0x22')](_0x1ab841);}return null;};}function patchUpdates(_0x11eaea){return function(_0x398dd2){try{jsonpatch[_0x4520('0x23')](_0x398dd2,_0x11eaea,!![]);}catch(_0x4ac41d){return BPromise[_0x4520('0x24')](_0x4ac41d);}return _0x398dd2['save']();};}function saveUpdates(_0x5ceff6,_0x4c46c5){return function(_0x2b9456){if(_0x2b9456){return _0x2b9456['update'](_0x5ceff6)[_0x4520('0x25')](function(_0x270dc2){return _0x270dc2;});}return null;};}function removeEntity(_0x428d36,_0x534b15){return function(_0x3199a9){if(_0x3199a9){return _0x3199a9[_0x4520('0x26')]()[_0x4520('0x25')](function(){_0x428d36['status'](0xcc)[_0x4520('0x1c')]();});}};}function handleEntityNotFound(_0x847d15,_0x24eacd){return function(_0x3a4680){if(!_0x3a4680){_0x847d15[_0x4520('0x1a')](0x194);}return _0x3a4680;};}function handleError(_0x552da1,_0x3774bd){_0x3774bd=_0x3774bd||0x1f4;return function(_0x15987c){logger[_0x4520('0x27')](_0x15987c[_0x4520('0x28')]);if(_0x15987c['name']){delete _0x15987c[_0x4520('0x29')];}_0x552da1[_0x4520('0x1b')](_0x3774bd)[_0x4520('0x2a')](_0x15987c);};}exports[_0x4520('0x2b')]=function(_0xad9f8,_0x2c95ea){var _0x2d6902={},_0x195c58={},_0x180c44={'count':0x0,'rows':[]};var _0x926ca0=_['map'](db[_0x4520('0x2c')]['rawAttributes'],function(_0x7ce8d2){return{'name':_0x7ce8d2[_0x4520('0x2d')],'type':_0x7ce8d2[_0x4520('0x2e')][_0x4520('0x2f')]};});_0x195c58[_0x4520('0x30')]=_[_0x4520('0x31')](_0x926ca0,'name');_0x195c58[_0x4520('0x32')]=_['keys'](_0xad9f8[_0x4520('0x32')]);_0x195c58['filters']=_[_0x4520('0x33')](_0x195c58['model'],_0x195c58[_0x4520('0x32')]);_0x2d6902['attributes']=_['intersection'](_0x195c58[_0x4520('0x30')],qs[_0x4520('0x34')](_0xad9f8[_0x4520('0x32')]['fields']));_0x2d6902[_0x4520('0x35')]=_0x2d6902[_0x4520('0x35')][_0x4520('0x36')]?_0x2d6902[_0x4520('0x35')]:_0x195c58['model'];if(!_0xad9f8['query'][_0x4520('0x37')](_0x4520('0x38'))){_0x2d6902['limit']=qs[_0x4520('0x1f')](_0xad9f8[_0x4520('0x32')][_0x4520('0x1f')]);_0x2d6902[_0x4520('0x1e')]=qs[_0x4520('0x1e')](_0xad9f8[_0x4520('0x32')]['offset']);}_0x2d6902[_0x4520('0x39')]=qs[_0x4520('0x3a')](_0xad9f8['query'][_0x4520('0x3a')]);_0x2d6902['where']=qs[_0x4520('0x3b')](_[_0x4520('0x3c')](_0xad9f8['query'],_0x195c58['filters']),_0x926ca0);if(_0xad9f8['query'][_0x4520('0x3d')]){_0x2d6902[_0x4520('0x3e')]=_[_0x4520('0x3f')](_0x2d6902[_0x4520('0x3e')],{'$or':_[_0x4520('0x31')](_0x926ca0,function(_0x1ca2b4){if(_0x1ca2b4[_0x4520('0x2e')]!=='VIRTUAL'){var _0x47085e={};_0x47085e[_0x1ca2b4[_0x4520('0x29')]]={'$like':'%'+_0xad9f8[_0x4520('0x32')]['filter']+'%'};return _0x47085e;}})});}_0x2d6902=_[_0x4520('0x3f')]({},_0x2d6902,_0xad9f8[_0x4520('0x40')]);var _0x5c6f84={'where':_0x2d6902['where']};return db[_0x4520('0x2c')][_0x4520('0x1d')](_0x5c6f84)[_0x4520('0x25')](function(_0x11164a){_0x180c44[_0x4520('0x1d')]=_0x11164a;if(_0xad9f8['query']['includeAll']){_0x2d6902['include']=[{'all':!![]}];}return db[_0x4520('0x2c')]['findAll'](_0x2d6902);})[_0x4520('0x25')](function(_0x54da7a){_0x180c44['rows']=_0x54da7a;return _0x180c44;})[_0x4520('0x25')](respondWithFilteredResult(_0x2c95ea,_0x2d6902))[_0x4520('0x41')](handleError(_0x2c95ea,null));};exports[_0x4520('0x42')]=function(_0x214026,_0x21e21c){var _0x59d646={'raw':!![],'where':{'id':_0x214026[_0x4520('0x43')]['id']}},_0x1675e6={};_0x1675e6['model']=_['keys'](db[_0x4520('0x2c')][_0x4520('0x44')]);_0x1675e6['query']=_[_0x4520('0x45')](_0x214026[_0x4520('0x32')]);_0x1675e6[_0x4520('0x3b')]=_[_0x4520('0x33')](_0x1675e6['model'],_0x1675e6[_0x4520('0x32')]);_0x59d646[_0x4520('0x35')]=_[_0x4520('0x33')](_0x1675e6[_0x4520('0x30')],qs[_0x4520('0x34')](_0x214026[_0x4520('0x32')][_0x4520('0x34')]));_0x59d646[_0x4520('0x35')]=_0x59d646[_0x4520('0x35')][_0x4520('0x36')]?_0x59d646[_0x4520('0x35')]:_0x1675e6[_0x4520('0x30')];if(_0x214026[_0x4520('0x32')][_0x4520('0x46')]){_0x59d646[_0x4520('0x47')]=[{'all':!![]}];}_0x59d646=_[_0x4520('0x3f')]({},_0x59d646,_0x214026[_0x4520('0x40')]);return db['SmsApplication'][_0x4520('0x48')](_0x59d646)[_0x4520('0x25')](handleEntityNotFound(_0x21e21c,null))['then'](respondWithResult(_0x21e21c,null))['catch'](handleError(_0x21e21c,null));};exports['create']=function(_0x4dce4f,_0x22e62d){return db['SmsApplication'][_0x4520('0x49')](_0x4dce4f[_0x4520('0x4a')],{})[_0x4520('0x25')](respondWithResult(_0x22e62d,0xc9))[_0x4520('0x41')](handleError(_0x22e62d,null));};exports[_0x4520('0x4b')]=function(_0x5e3eef,_0x2b89be){if(_0x5e3eef[_0x4520('0x4a')]['id']){delete _0x5e3eef[_0x4520('0x4a')]['id'];}return db[_0x4520('0x2c')][_0x4520('0x48')]({'where':{'id':_0x5e3eef[_0x4520('0x43')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x2b89be,null))[_0x4520('0x25')](saveUpdates(_0x5e3eef[_0x4520('0x4a')],null))[_0x4520('0x25')](respondWithResult(_0x2b89be,null))[_0x4520('0x41')](handleError(_0x2b89be,null));};exports[_0x4520('0x26')]=function(_0x4cf80e,_0x53987b){return db[_0x4520('0x2c')][_0x4520('0x48')]({'where':{'id':_0x4cf80e[_0x4520('0x43')]['id']}})['then'](handleEntityNotFound(_0x53987b,null))[_0x4520('0x25')](removeEntity(_0x53987b,null))[_0x4520('0x41')](handleError(_0x53987b,null));}; \ No newline at end of file +var _0x3423=['status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','stack','index','SmsApplication','rawAttributes','fieldName','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','params','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','api','../../config/utils','../../mysqldb'];(function(_0x4b4027,_0x5af0bd){var _0x559ed9=function(_0x139187){while(--_0x139187){_0x4b4027['push'](_0x4b4027['shift']());}};_0x559ed9(++_0x5af0bd);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3342('0x0'));var zipdir=require(_0x3342('0x1'));var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require(_0x3342('0x5'));var Mustache=require(_0x3342('0x6'));var util=require(_0x3342('0x7'));var path=require(_0x3342('0x8'));var sox=require(_0x3342('0x9'));var csv=require(_0x3342('0xa'));var ejs=require(_0x3342('0xb'));var fs=require('fs');var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0xa'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var db=require(_0x3342('0x15'))['db'];function respondWithStatusCode(_0x5a3cb1,_0x716d80){_0x716d80=_0x716d80||0xcc;return function(_0x36e1f4){if(_0x36e1f4){return _0x5a3cb1['sendStatus'](_0x716d80);}return _0x5a3cb1[_0x3342('0x16')](_0x716d80)[_0x3342('0x17')]();};}function respondWithResult(_0x38e3f7,_0xe4689e){_0xe4689e=_0xe4689e||0xc8;return function(_0x61fcc0){if(_0x61fcc0){return _0x38e3f7[_0x3342('0x16')](_0xe4689e)[_0x3342('0x18')](_0x61fcc0);}};}function respondWithFilteredResult(_0x59be1d,_0x3e44f3){return function(_0x19bd71){if(_0x19bd71){var _0x49afe3=_0x19bd71['count'],_0x40d609=_0x3e44f3[_0x3342('0x19')],_0x2c9df0=_0x3e44f3[_0x3342('0x19')]+_0x3e44f3[_0x3342('0x1a')],_0x51ef91;if(_0x2c9df0>=_0x49afe3){_0x2c9df0=_0x49afe3;_0x51ef91=0xc8;}else{_0x51ef91=0xce;}_0x59be1d[_0x3342('0x16')](_0x51ef91);return _0x59be1d[_0x3342('0x1b')](_0x3342('0x1c'),_0x40d609+'-'+_0x2c9df0+'/'+_0x49afe3)[_0x3342('0x18')](_0x19bd71);}return null;};}function patchUpdates(_0x3ebf6b){return function(_0x2c90c8){try{jsonpatch['apply'](_0x2c90c8,_0x3ebf6b,!![]);}catch(_0x283fc1){return BPromise[_0x3342('0x1d')](_0x283fc1);}return _0x2c90c8[_0x3342('0x1e')]();};}function saveUpdates(_0x5e05f5,_0x3cb86f){return function(_0x463324){if(_0x463324){return _0x463324['update'](_0x5e05f5)[_0x3342('0x1f')](function(_0x28528b){return _0x28528b;});}return null;};}function removeEntity(_0x4b765d,_0x4e1b19){return function(_0x5a0658){if(_0x5a0658){return _0x5a0658[_0x3342('0x20')]()[_0x3342('0x1f')](function(){_0x4b765d[_0x3342('0x16')](0xcc)[_0x3342('0x17')]();});}};}function handleEntityNotFound(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(!_0x26eb87){_0xd2b87d[_0x3342('0x21')](0x194);}return _0x26eb87;};}function handleError(_0x5d4f14,_0x30ffc9){_0x30ffc9=_0x30ffc9||0x1f4;return function(_0x517db5){logger['error'](_0x517db5[_0x3342('0x22')]);if(_0x517db5['name']){delete _0x517db5['name'];}_0x5d4f14[_0x3342('0x16')](_0x30ffc9)['send'](_0x517db5);};}exports[_0x3342('0x23')]=function(_0x543ec3,_0x524286){var _0x55cddd={},_0x1497d9={},_0x286c42={'count':0x0,'rows':[]};var _0x1dd607=_['map'](db[_0x3342('0x24')][_0x3342('0x25')],function(_0x1cc542){return{'name':_0x1cc542[_0x3342('0x26')],'type':_0x1cc542['type'][_0x3342('0x27')]};});_0x1497d9[_0x3342('0x28')]=_[_0x3342('0x29')](_0x1dd607,_0x3342('0x2a'));_0x1497d9[_0x3342('0x2b')]=_[_0x3342('0x2c')](_0x543ec3[_0x3342('0x2b')]);_0x1497d9['filters']=_[_0x3342('0x2d')](_0x1497d9['model'],_0x1497d9[_0x3342('0x2b')]);_0x55cddd[_0x3342('0x2e')]=_['intersection'](_0x1497d9[_0x3342('0x28')],qs[_0x3342('0x2f')](_0x543ec3[_0x3342('0x2b')][_0x3342('0x2f')]));_0x55cddd['attributes']=_0x55cddd[_0x3342('0x2e')][_0x3342('0x30')]?_0x55cddd[_0x3342('0x2e')]:_0x1497d9[_0x3342('0x28')];if(!_0x543ec3[_0x3342('0x2b')][_0x3342('0x31')](_0x3342('0x32'))){_0x55cddd[_0x3342('0x1a')]=qs[_0x3342('0x1a')](_0x543ec3[_0x3342('0x2b')][_0x3342('0x1a')]);_0x55cddd[_0x3342('0x19')]=qs['offset'](_0x543ec3['query'][_0x3342('0x19')]);}_0x55cddd['order']=qs[_0x3342('0x33')](_0x543ec3[_0x3342('0x2b')][_0x3342('0x33')]);_0x55cddd[_0x3342('0x34')]=qs[_0x3342('0x35')](_[_0x3342('0x36')](_0x543ec3[_0x3342('0x2b')],_0x1497d9['filters']),_0x1dd607);if(_0x543ec3[_0x3342('0x2b')][_0x3342('0x37')]){_0x55cddd[_0x3342('0x34')]=_[_0x3342('0x38')](_0x55cddd[_0x3342('0x34')],{'$or':_['map'](_0x1dd607,function(_0x410d0d){if(_0x410d0d['type']!==_0x3342('0x39')){var _0x2b9923={};_0x2b9923[_0x410d0d[_0x3342('0x2a')]]={'$like':'%'+_0x543ec3[_0x3342('0x2b')]['filter']+'%'};return _0x2b9923;}})});}_0x55cddd=_[_0x3342('0x38')]({},_0x55cddd,_0x543ec3['options']);var _0x9fcf8d={'where':_0x55cddd[_0x3342('0x34')]};return db[_0x3342('0x24')][_0x3342('0x3a')](_0x9fcf8d)[_0x3342('0x1f')](function(_0xf83613){_0x286c42[_0x3342('0x3a')]=_0xf83613;if(_0x543ec3['query'][_0x3342('0x3b')]){_0x55cddd[_0x3342('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0x3342('0x3d')](_0x55cddd);})[_0x3342('0x1f')](function(_0x494d28){_0x286c42[_0x3342('0x3e')]=_0x494d28;return _0x286c42;})[_0x3342('0x1f')](respondWithFilteredResult(_0x524286,_0x55cddd))['catch'](handleError(_0x524286,null));};exports['show']=function(_0x5acb74,_0x46eb0a){var _0x41e727={'raw':!![],'where':{'id':_0x5acb74[_0x3342('0x3f')]['id']}},_0x594285={};_0x594285[_0x3342('0x28')]=_[_0x3342('0x2c')](db[_0x3342('0x24')][_0x3342('0x25')]);_0x594285[_0x3342('0x2b')]=_[_0x3342('0x2c')](_0x5acb74[_0x3342('0x2b')]);_0x594285['filters']=_['intersection'](_0x594285[_0x3342('0x28')],_0x594285[_0x3342('0x2b')]);_0x41e727[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x594285[_0x3342('0x28')],qs[_0x3342('0x2f')](_0x5acb74['query'][_0x3342('0x2f')]));_0x41e727[_0x3342('0x2e')]=_0x41e727[_0x3342('0x2e')][_0x3342('0x30')]?_0x41e727[_0x3342('0x2e')]:_0x594285[_0x3342('0x28')];if(_0x5acb74['query'][_0x3342('0x3b')]){_0x41e727['include']=[{'all':!![]}];}_0x41e727=_[_0x3342('0x38')]({},_0x41e727,_0x5acb74[_0x3342('0x40')]);return db[_0x3342('0x24')][_0x3342('0x41')](_0x41e727)['then'](handleEntityNotFound(_0x46eb0a,null))[_0x3342('0x1f')](respondWithResult(_0x46eb0a,null))[_0x3342('0x42')](handleError(_0x46eb0a,null));};exports['create']=function(_0x1f54a8,_0x302159){return db[_0x3342('0x24')][_0x3342('0x43')](_0x1f54a8['body'],{})[_0x3342('0x1f')](respondWithResult(_0x302159,0xc9))[_0x3342('0x42')](handleError(_0x302159,null));};exports['update']=function(_0x1fc491,_0x483ba7){if(_0x1fc491['body']['id']){delete _0x1fc491[_0x3342('0x44')]['id'];}return db[_0x3342('0x24')][_0x3342('0x41')]({'where':{'id':_0x1fc491[_0x3342('0x3f')]['id']}})[_0x3342('0x1f')](handleEntityNotFound(_0x483ba7,null))[_0x3342('0x1f')](saveUpdates(_0x1fc491[_0x3342('0x44')],null))['then'](respondWithResult(_0x483ba7,null))['catch'](handleError(_0x483ba7,null));};exports[_0x3342('0x20')]=function(_0x5a9e40,_0x26251c){return db['SmsApplication']['find']({'where':{'id':_0x5a9e40['params']['id']}})[_0x3342('0x1f')](handleEntityNotFound(_0x26251c,null))[_0x3342('0x1f')](removeEntity(_0x26251c,null))[_0x3342('0x42')](handleError(_0x26251c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9d83e1f..787a5b9 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 _0x8ce0=['path','rimraf','./smsApplication.attributes','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28467f,_0x2ec69e){var _0x9db74f=function(_0x464ee3){while(--_0x464ee3){_0x28467f['push'](_0x28467f['shift']());}};_0x9db74f(++_0x2ec69e);}(_0x8ce0,0x172));var _0x08ce=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8ce0[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x08ce('0x0'));var util=require(_0x08ce('0x1'));var logger=require(_0x08ce('0x2'))(_0x08ce('0x3'));var moment=require(_0x08ce('0x4'));var BPromise=require(_0x08ce('0x5'));var rp=require(_0x08ce('0x6'));var fs=require('fs');var path=require(_0x08ce('0x7'));var rimraf=require(_0x08ce('0x8'));var config=require('../../config/environment');var attributes=require(_0x08ce('0x9'));module['exports']=function(_0x14398e,_0x59528d){return _0x14398e[_0x08ce('0xa')](_0x08ce('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x08ce('0xc')});}; \ No newline at end of file +var _0x0e6a=['path','rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4970bc,_0x58008f){var _0x399c8c=function(_0x5df158){while(--_0x5df158){_0x4970bc['push'](_0x4970bc['shift']());}};_0x399c8c(++_0x58008f);}(_0x0e6a,0x1b4));var _0xa0e6=function(_0x4b5039,_0x23b033){_0x4b5039=_0x4b5039-0x0;var _0x597f29=_0x0e6a[_0x4b5039];return _0x597f29;};'use strict';var _=require('lodash');var util=require(_0xa0e6('0x0'));var logger=require(_0xa0e6('0x1'))(_0xa0e6('0x2'));var moment=require(_0xa0e6('0x3'));var BPromise=require(_0xa0e6('0x4'));var rp=require(_0xa0e6('0x5'));var fs=require('fs');var path=require(_0xa0e6('0x6'));var rimraf=require(_0xa0e6('0x7'));var config=require(_0xa0e6('0x8'));var attributes=require(_0xa0e6('0x9'));module['exports']=function(_0x3dc18b,_0x31c846){return _0x3dc18b['define'](_0xa0e6('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa0e6('0xb'),'collate':_0xa0e6('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1d67662..80eaec3 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 _0x5a93=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x449a12,_0x196a03){var _0x9e89ab=function(_0xfe2ef6){while(--_0xfe2ef6){_0x449a12['push'](_0x449a12['shift']());}};_0x9e89ab(++_0x196a03);}(_0x5a93,0xf6));var _0x35a9=function(_0x4191bb,_0x4910a6){_0x4191bb=_0x4191bb-0x0;var _0x1f9b76=_0x5a93[_0x4191bb];return _0x1f9b76;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var moment=require('moment');var BPromise=require(_0x35a9('0x1'));var rs=require(_0x35a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35a9('0x3'));var logger=require(_0x35a9('0x4'))(_0x35a9('0x5'));var config=require('../../config/environment');var jayson=require(_0x35a9('0x6'));var client=jayson[_0x35a9('0x7')][_0x35a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354490,_0x271228,_0x45e6f7){return new BPromise(function(_0x71d143,_0x22d770){return client[_0x35a9('0x9')](_0x354490,_0x45e6f7)[_0x35a9('0xa')](function(_0x5b4f25){logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));logger[_0x35a9('0xe')](_0x35a9('0xf'),_0x271228,_0x35a9('0xd'),JSON['stringify'](_0x5b4f25));if(_0x5b4f25[_0x35a9('0x10')]){if(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x11')]===0x1f4){logger[_0x35a9('0x10')]('SmsApplication,\x20%s,\x20%s',_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x22d770(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);}logger['error'](_0x35a9('0xc'),_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x71d143(_0x5b4f25[_0x35a9('0x10')]['message']);}else{logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));_0x71d143(_0x5b4f25['result'][_0x35a9('0x12')]);}})[_0x35a9('0x13')](function(_0x14eeb5){logger[_0x35a9('0x10')](_0x35a9('0xc'),_0x271228,_0x14eeb5);_0x22d770(_0x14eeb5);});});} \ No newline at end of file +var _0x5b5a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','result','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3adc72,_0x4fb254){var _0x182b64=function(_0x5c6e6b){while(--_0x5c6e6b){_0x3adc72['push'](_0x3adc72['shift']());}};_0x182b64(++_0x4fb254);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x4c2bc5,_0x4984e2){_0x4c2bc5=_0x4c2bc5-0x0;var _0x487209=_0x5b5a[_0x4c2bc5];return _0x487209;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var moment=require(_0xa5b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5b5('0x2'));var fs=require('fs');var Redis=require(_0xa5b5('0x3'));var db=require(_0xa5b5('0x4'))['db'];var utils=require(_0xa5b5('0x5'));var logger=require(_0xa5b5('0x6'))(_0xa5b5('0x7'));var config=require(_0xa5b5('0x8'));var jayson=require(_0xa5b5('0x9'));var client=jayson['client'][_0xa5b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c137,_0x513641,_0x32a09a){return new BPromise(function(_0x1936d6,_0x1157ee){return client[_0xa5b5('0xb')](_0x29c137,_0x32a09a)[_0xa5b5('0xc')](function(_0x307afa){logger[_0xa5b5('0xd')](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));logger[_0xa5b5('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x513641,'request\x20sent',JSON['stringify'](_0x307afa));if(_0x307afa['error']){if(_0x307afa[_0xa5b5('0x11')]['code']===0x1f4){logger[_0xa5b5('0x11')]('SmsApplication,\x20%s,\x20%s',_0x513641,_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);return _0x1157ee(_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);}logger[_0xa5b5('0x11')](_0xa5b5('0xe'),_0x513641,_0x307afa[_0xa5b5('0x11')]['message']);return _0x1936d6(_0x307afa['error'][_0xa5b5('0x12')]);}else{logger['info'](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));_0x1936d6(_0x307afa[_0xa5b5('0x13')]['message']);}})['catch'](function(_0x4d3274){logger['error'](_0xa5b5('0xe'),_0x513641,_0x4d3274);_0x1157ee(_0x4d3274);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 714f9a6..261ad97 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 _0xdf94=['post','create','/:id/tags','sms','smsinteraction:addtags','addTags','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x7c51b5,_0x50f45d){var _0x129dfe=function(_0x29b8e2){while(--_0x29b8e2){_0x7c51b5['push'](_0x7c51b5['shift']());}};_0x129dfe(++_0x50f45d);}(_0xdf94,0xad));var _0x4df9=function(_0x30f700,_0x203748){_0x30f700=_0x30f700-0x0;var _0x55e4eb=_0xdf94[_0x30f700];return _0x55e4eb;};'use strict';var multer=require('multer');var util=require(_0x4df9('0x0'));var path=require(_0x4df9('0x1'));var timeout=require(_0x4df9('0x2'));var express=require(_0x4df9('0x3'));var router=express[_0x4df9('0x4')]();var auth=require(_0x4df9('0x5'));var interaction=require(_0x4df9('0x6'));var config=require(_0x4df9('0x7'));var controller=require(_0x4df9('0x8'));router[_0x4df9('0x9')]('/',auth[_0x4df9('0xa')](),controller[_0x4df9('0xb')]);router[_0x4df9('0x9')](_0x4df9('0xc'),auth[_0x4df9('0xa')](),controller[_0x4df9('0xd')]);router[_0x4df9('0x9')](_0x4df9('0xe'),auth['isAuthenticated'](),controller[_0x4df9('0xf')]);router[_0x4df9('0x9')](_0x4df9('0x10'),auth[_0x4df9('0xa')](),controller[_0x4df9('0x11')]);router[_0x4df9('0x9')](_0x4df9('0x12'),auth['isAuthenticated'](),controller['download']);router[_0x4df9('0x13')]('/',auth['isAuthenticated'](),controller[_0x4df9('0x14')]);router[_0x4df9('0x13')](_0x4df9('0x10'),auth[_0x4df9('0xa')](),controller['addMessage']);router[_0x4df9('0x13')](_0x4df9('0x15'),auth[_0x4df9('0xa')](),interaction['tracked'](_0x4df9('0x16'),_0x4df9('0x17')),controller[_0x4df9('0x18')]);router['put'](_0x4df9('0xe'),auth['isAuthenticated'](),interaction[_0x4df9('0x19')](_0x4df9('0x16'),_0x4df9('0x1a')),controller[_0x4df9('0x1b')]);router['delete'](_0x4df9('0xe'),auth[_0x4df9('0xa')](),interaction[_0x4df9('0x19')]('sms',_0x4df9('0x1c')),controller['destroy']);router[_0x4df9('0x1d')](_0x4df9('0x15'),auth[_0x4df9('0xa')](),controller[_0x4df9('0x1e')]);module[_0x4df9('0x1f')]=router; \ No newline at end of file +var _0x9d01=['describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get'];(function(_0x346a90,_0x538586){var _0xd1059c=function(_0x5e6897){while(--_0x5e6897){_0x346a90['push'](_0x346a90['shift']());}};_0xd1059c(++_0x538586);}(_0x9d01,0x1ec));var _0x19d0=function(_0x35f5b5,_0x389e18){_0x35f5b5=_0x35f5b5-0x0;var _0x16c86b=_0x9d01[_0x35f5b5];return _0x16c86b;};'use strict';var multer=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var path=require(_0x19d0('0x2'));var timeout=require(_0x19d0('0x3'));var express=require(_0x19d0('0x4'));var router=express[_0x19d0('0x5')]();var auth=require(_0x19d0('0x6'));var interaction=require(_0x19d0('0x7'));var config=require('../../config/environment');var controller=require(_0x19d0('0x8'));router['get']('/',auth[_0x19d0('0x9')](),controller[_0x19d0('0xa')]);router[_0x19d0('0xb')]('/describe',auth[_0x19d0('0x9')](),controller[_0x19d0('0xc')]);router[_0x19d0('0xb')](_0x19d0('0xd'),auth[_0x19d0('0x9')](),controller[_0x19d0('0xe')]);router[_0x19d0('0xb')](_0x19d0('0xf'),auth[_0x19d0('0x9')](),controller[_0x19d0('0x10')]);router['get']('/:id/download',auth[_0x19d0('0x9')](),controller[_0x19d0('0x11')]);router[_0x19d0('0x12')]('/',auth[_0x19d0('0x9')](),controller['create']);router['post'](_0x19d0('0xf'),auth['isAuthenticated'](),controller[_0x19d0('0x13')]);router[_0x19d0('0x12')](_0x19d0('0x14'),auth['isAuthenticated'](),interaction[_0x19d0('0x15')](_0x19d0('0x16'),_0x19d0('0x17')),controller['addTags']);router[_0x19d0('0x18')](_0x19d0('0xd'),auth[_0x19d0('0x9')](),interaction[_0x19d0('0x15')](_0x19d0('0x16'),'smsinteraction:update'),controller['update']);router[_0x19d0('0x19')](_0x19d0('0xd'),auth[_0x19d0('0x9')](),interaction[_0x19d0('0x15')](_0x19d0('0x16'),_0x19d0('0x1a')),controller['destroy']);router[_0x19d0('0x19')](_0x19d0('0x14'),auth['isAuthenticated'](),controller[_0x19d0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b0307a3..abead7b 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 _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x9ec221,_0x2594a6){var _0xdbe55e=function(_0x4b4c43){while(--_0x4b4c43){_0x9ec221['push'](_0x9ec221['shift']());}};_0xdbe55e(++_0x2594a6);}(_0x757a,0xde));var _0xa757=function(_0x5ed35a,_0x5c2d67){_0x5ed35a=_0x5ed35a-0x0;var _0xe83723=_0x757a[_0x5ed35a];return _0xe83723;};'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 +var _0x0713=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3071('0x0')]={'closed':{'type':Sequelize[_0x3071('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3071('0x2')]},'disposition':{'type':Sequelize[_0x3071('0x3')]},'note':{'type':Sequelize[_0x3071('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3071('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3071('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('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 87e4d79..ef8e407 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 _0xb58b=['Account','Owner','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','YYYY-MM-DD','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','System','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','catch','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','field','from','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','compact','isEmpty','SmsAccountId','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','SmsInteraction','includeAll','include','merge','options','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','filter','$gte','format','findAll','addTags','setTags','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','User','firstName','lastName','direction','secret','SmsAccount'];(function(_0x530525,_0x7e14ec){var _0x41a015=function(_0x4fab3e){while(--_0x4fab3e){_0x530525['push'](_0x530525['shift']());}};_0x41a015(++_0x7e14ec);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4964b5,_0x48bdf0){_0x4964b5=_0x4964b5-0x0;var _0x3663d3=_0xb58b[_0x4964b5];return _0x3663d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb58('0x0'));var rimraf=require(_0xbb58('0x1'));var zipdir=require(_0xbb58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb58('0x3'));var moment=require(_0xbb58('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb58('0x5'));var util=require('util');var path=require(_0xbb58('0x6'));var sox=require(_0xbb58('0x7'));var csv=require(_0xbb58('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x8'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var db=require(_0xbb58('0x17'))['db'];config['redis']=_[_0xbb58('0x18')](config[_0xbb58('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb58('0x1a'))(new Redis(config[_0xbb58('0x19')]));require(_0xbb58('0x1b'))[_0xbb58('0x1c')](socket);function respondWithStatusCode(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xcc;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1d')](_0x58245f);}return _0x19ceda['status'](_0x58245f)['end']();};}function respondWithResult(_0x33c20f,_0x445b1f){_0x445b1f=_0x445b1f||0xc8;return function(_0x38d69a){if(_0x38d69a){return _0x33c20f['status'](_0x445b1f)['json'](_0x38d69a);}};}function respondWithFilteredResult(_0x5ac9df,_0x55156e){return function(_0x28637b){if(_0x28637b){var _0x3134ea=_0x28637b[_0xbb58('0x1e')],_0x48f3e0=_0x55156e[_0xbb58('0x1f')],_0xbee66=_0x55156e[_0xbb58('0x1f')]+_0x55156e[_0xbb58('0x20')],_0x497653;if(_0xbee66>=_0x3134ea){_0xbee66=_0x3134ea;_0x497653=0xc8;}else{_0x497653=0xce;}_0x5ac9df[_0xbb58('0x21')](_0x497653);return _0x5ac9df[_0xbb58('0x22')](_0xbb58('0x23'),_0x48f3e0+'-'+_0xbee66+'/'+_0x3134ea)['json'](_0x28637b);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x24')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x25')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x26')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x27')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x28')]()[_0xbb58('0x27')](function(){_0x21964d[_0xbb58('0x21')](0xcc)[_0xbb58('0x29')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x1d')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x2a')](_0x8e9ed9[_0xbb58('0x2b')]);if(_0x8e9ed9[_0xbb58('0x2c')]){delete _0x8e9ed9[_0xbb58('0x2c')];}_0x1be0ae[_0xbb58('0x21')](_0x129094)[_0xbb58('0x2d')](_0x8e9ed9);};}function getInteractionUsers(_0x28b3a3,_0x2a0481){return new BPromise(function(_0x4157c4,_0x3559b6){try{if(_0x2a0481[_0x28b3a3['id']]){_0x28b3a3['Users']=_[_0xbb58('0x2e')](_0x2a0481[_0x28b3a3['id']],function(_0xe46bc1){return{'id':_0xe46bc1['id'],'fullname':_0xe46bc1[_0xbb58('0x2f')]};});}}catch(_0x3c9cee){_0x3559b6(_0x3c9cee);}_0x4157c4(_0x28b3a3);});}function getInteractionTags(_0x3304b9,_0x9d379f){return new BPromise(function(_0x1ba526,_0x643e0e){try{if(_0x3304b9[_0xbb58('0x30')]){_0x3304b9['Tags']=[];_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')](',')[_0xbb58('0x32')](function(_0x3a1e46){_0x3304b9[_0xbb58('0x33')][_0xbb58('0x34')](_0x9d379f[_0x3a1e46]);});}delete _0x3304b9[_0xbb58('0x30')];}catch(_0x2599af){_0x643e0e(_0x2599af);}_0x1ba526(_0x3304b9);});}function updateSmsInteraction(_0x23816c,_0x1cae1c,_0x389187){return new BPromise(function(_0x34583e,_0x2f5967){return getInteractionUsers(_0x23816c,_0x389187)['then'](function(_0x51b69f){return getInteractionTags(_0x51b69f,_0x1cae1c);})['then'](function(_0x1def9f){_0x34583e(_0x1def9f);})[_0xbb58('0x35')](function(_0x1c207b){_0x2f5967(_0x1c207b);});});}exports[_0xbb58('0x36')]=function(_0xb28e63,_0x3333e5){var _0x3093bf={},_0x29137f={},_0x5db313={'count':0x0,'rows':[]};var _0x2fbf90=_[_0xbb58('0x2e')](db['SmsInteraction'][_0xbb58('0x37')],function(_0x4da3ed){return{'name':_0x4da3ed[_0xbb58('0x38')],'type':_0x4da3ed['type'][_0xbb58('0x39')]};});_0x29137f[_0xbb58('0x3a')]=_['map'](_0x2fbf90,_0xbb58('0x2c'));_0x29137f[_0xbb58('0x3b')]=_[_0xbb58('0x3c')](_0xb28e63[_0xbb58('0x3b')]);_0x29137f[_0xbb58('0x3d')]=_[_0xbb58('0x3e')](_0x29137f[_0xbb58('0x3a')],_0x29137f[_0xbb58('0x3b')]);_0x3093bf['attributes']=_[_0xbb58('0x3e')](_0x29137f[_0xbb58('0x3a')],qs[_0xbb58('0x3f')](_0xb28e63['query']['fields']));_0x3093bf[_0xbb58('0x40')]=_0x3093bf['attributes'][_0xbb58('0x41')]?_0x3093bf[_0xbb58('0x40')]:_0x29137f[_0xbb58('0x3a')];if(!_0xb28e63['query']['hasOwnProperty'](_0xbb58('0x42'))){_0x3093bf[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x20')]);_0x3093bf[_0xbb58('0x1f')]=qs['offset'](_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x1f')]);}_0x3093bf[_0xbb58('0x43')]=qs[_0xbb58('0x44')](_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x44')]);_0x3093bf['where']=qs[_0xbb58('0x3d')](_['pick'](_0xb28e63[_0xbb58('0x3b')],_0x29137f[_0xbb58('0x3d')]),_0x2fbf90);var _0x29fb1c=[];var _0x45817f=squel['select']()[_0xbb58('0x45')]('id')[_0xbb58('0x45')](_0xbb58('0x2c'))[_0xbb58('0x45')]('color')[_0xbb58('0x46')]('tools_tags');var _0x2ffd8b=squel[_0xbb58('0x47')]()[_0xbb58('0x45')](_0xbb58('0x48'))[_0xbb58('0x45')](_0xbb58('0x49'))[_0xbb58('0x45')](_0xbb58('0x4a'))[_0xbb58('0x46')](_0xbb58('0x4b'),'ui')[_0xbb58('0x4c')](_0xbb58('0x4d'),'u',_0xbb58('0x4e'));var _0x55a1cc=squel[_0xbb58('0x47')]()['from']('sms_interactions','i')[_0xbb58('0x4c')](_0xbb58('0x4f'),'c',_0xbb58('0x50'))[_0xbb58('0x4c')](_0xbb58('0x4d'),'o',_0xbb58('0x51'))[_0xbb58('0x4c')](_0xbb58('0x52'),'a',_0xbb58('0x53'))[_0xbb58('0x4c')](_0xbb58('0x54'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xbb58('0x4c')](_0xbb58('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xbb58('0x4c')](_0xbb58('0x56'),'t',_0xbb58('0x57'));var _0xdb0ff7=squel['expr']();var _0x17418c=[];var _0x54d658=squel[_0xbb58('0x58')]();var _0x336598;if(_0xb28e63[_0xbb58('0x3b')]['search']){_0x336598=as[_0xbb58('0x59')](_0xb28e63[_0xbb58('0x3b')]['search']);var _0x419cef=_0x336598['sqlOperator'];for(var _0x28301d=0x0;_0x28301d<_0x336598[_0xbb58('0x5a')][_0xbb58('0x41')];_0x28301d++){var _0x1ec976=_0x336598[_0xbb58('0x5a')][_0x28301d];var _0x13d964='i';var _0x130557=_['find'](_0x2fbf90,[_0xbb58('0x2c'),_0x1ec976[_0xbb58('0x45')]]);if(!_0x130557){switch(_0x1ec976['field']){case _0xbb58('0x5b'):if(_0x1ec976[_0xbb58('0x5c')]==0x1){_0x55a1cc['having']('`'+_0x1ec976[_0xbb58('0x45')]+_0xbb58('0x5d'));}else{_0x55a1cc[_0xbb58('0x5e')]('`'+_0x1ec976['field']+_0xbb58('0x5f'));}break;case _0xbb58('0x60'):if(_0x1ec976[_0xbb58('0x61')]==='$substring'){if(_0x1ec976[_0xbb58('0x5c')]['split']('\x20')[_0xbb58('0x41')]>0x1){_0xdb0ff7[_0x419cef](_0xbb58('0x62'),qs[_0xbb58('0x63')](_0x1ec976['value']),null);}else{var _0x5aaace='%'+_0x1ec976[_0xbb58('0x5c')]+'%';_0xdb0ff7[_0x419cef](_0xbb58('0x64'),_0x5aaace,_0x5aaace,_0x5aaace);}}else{_0x130557=_[_0xbb58('0x65')](_0x2fbf90,[_0xbb58('0x2c'),_0xbb58('0x66')]);_0x1ec976['field']=_0xbb58('0x66');_0x143a40=as[_0xbb58('0x67')](_0x13d964,_0x130557[_0xbb58('0x68')],_0x1ec976);_0xdb0ff7[_0x419cef](_0x143a40['text'],_0x143a40[_0xbb58('0x5c')][_0xbb58('0x69')],_0x143a40[_0xbb58('0x5c')][_0xbb58('0x29')]);}break;case _0xbb58('0x6a'):var _0x5e7ae0=_0x1ec976[_0xbb58('0x5c')][_0xbb58('0x31')](',')[_0xbb58('0x2e')](function(_0x20dcaa){return Number(_0x20dcaa);});_0x5e7ae0[_0xbb58('0x32')](function(_0x38b1ba){_0x54d658['or'](_0xbb58('0x6b'),'%,'+_0x38b1ba+',%');});_0x17418c=_[_0xbb58('0x6c')](_0x17418c,_0x5e7ae0);break;case'User':if(_0x1ec976[_0xbb58('0x61')]==='$substring'){_0xdb0ff7[_0x419cef](_0xbb58('0x6d'),'%'+_0x1ec976[_0xbb58('0x5c')]+'%',null);}else{_0x130557=_[_0xbb58('0x65')](_0x2fbf90,[_0xbb58('0x2c'),_0xbb58('0x6e')]);_0x1ec976[_0xbb58('0x45')]=_0xbb58('0x6e');_0x143a40=as[_0xbb58('0x67')](_0x13d964,_0x130557[_0xbb58('0x68')],_0x1ec976);_0xdb0ff7[_0x419cef](_0x143a40[_0xbb58('0x6f')],_0x143a40[_0xbb58('0x5c')]['start'],_0x143a40[_0xbb58('0x5c')][_0xbb58('0x29')]);}break;case _0xbb58('0x70'):_0x143a40=as['buildExpression']('me',null,_0x1ec976);_0xdb0ff7[_0x419cef](_0x143a40[_0xbb58('0x6f')],_0x143a40['value'][_0xbb58('0x69')],_0x143a40[_0xbb58('0x5c')]['end']);break;}}else{var _0x143a40=as[_0xbb58('0x67')](_0x13d964,_0x130557[_0xbb58('0x68')],_0x1ec976);_0xdb0ff7[_0x419cef](_0x143a40[_0xbb58('0x6f')],_0x143a40[_0xbb58('0x5c')]['start'],_0x143a40['value'][_0xbb58('0x29')]);}}}else{var _0x2f0db7=_(_0xb28e63[_0xbb58('0x3b')])['keys']()[_0xbb58('0x2e')](function(_0x419215){return _['some'](_0x2fbf90,[_0xbb58('0x2c'),_0x419215])?_0x419215:undefined;})[_0xbb58('0x71')]()['value']();if(!_[_0xbb58('0x72')](_0x2f0db7)){_0x2f0db7[_0xbb58('0x32')](function(_0x3c6f5d){if(_0x3c6f5d===_0xbb58('0x73')){_0x55a1cc[_0xbb58('0x74')]('i.SmsAccountId\x20IN\x20?',[][_0xbb58('0x75')](_0xb28e63[_0xbb58('0x3b')][_0x3c6f5d]));}else if(_0x3c6f5d===_0xbb58('0x76')){var _0x1da9c7=JSON[_0xbb58('0x77')](_0xb28e63['query'][_0x3c6f5d])['$gte'];var _0x29f64a=JSON['parse'](_0xb28e63[_0xbb58('0x3b')][_0x3c6f5d])[_0xbb58('0x78')];_0x55a1cc[_0xbb58('0x74')](_0xbb58('0x79'),_0x1da9c7,_0x29f64a);}else{if(_0xb28e63[_0xbb58('0x3b')][_0x3c6f5d]===_0xbb58('0x7a')){_0x55a1cc[_0xbb58('0x74')]('i.'+_0x3c6f5d+_0xbb58('0x7b'));}else{_0x55a1cc[_0xbb58('0x74')]('i.'+_0x3c6f5d+_0xbb58('0x7c'),_0xb28e63['query'][_0x3c6f5d]);}}});}if(_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x7d')]){if(_0xb28e63[_0xbb58('0x3b')]['read']==0x1){_0x55a1cc[_0xbb58('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x55a1cc['having'](_0xbb58('0x7e'));}}if(_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x7f')]){_0x17418c=_[_0xbb58('0x80')](_0xb28e63['query']['tag'])?_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x7f')]:new Array(_0xb28e63['query'][_0xbb58('0x7f')]);_0x17418c[_0xbb58('0x32')](function(_0x3cd96a){_0x54d658['or'](_0xbb58('0x6b'),'%,'+_0x3cd96a+',%');});}if(_0xb28e63[_0xbb58('0x3b')]['filter']){var _0x30b8d2=_0xb28e63['query']['filter'][_0xbb58('0x81')]('\x5c','\x5c\x5c')[_0xbb58('0x81')]('\x27\x27',_0xbb58('0x82'));if(qs['isNumeric'](_0x30b8d2)){_0xdb0ff7['or'](_0xbb58('0x83'),_0x30b8d2+'%')['or'](_0xbb58('0x84'),_0x30b8d2+'%');}else{_0xdb0ff7['or'](_0xbb58('0x85'),qs[_0xbb58('0x63')](_0x30b8d2))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x30b8d2+'%');}}}_0x55a1cc[_0xbb58('0x74')](_0xdb0ff7);_0x55a1cc['group']('i.id');var _0x3addb7={'type':db[_0xbb58('0x86')][_0xbb58('0x87')]['SELECT'],'raw':!![]};var _0x4992f7=_0x55a1cc[_0xbb58('0x88')]();_0x4992f7[_0xbb58('0x45')](_0xbb58('0x89'));_0x4992f7[_0xbb58('0x45')](_0xbb58('0x8a'),_0xbb58('0x5b'));if(_0x3093bf[_0xbb58('0x43')]){_0x3093bf[_0xbb58('0x43')][_0xbb58('0x32')](function(_0x163ca4){_0x55a1cc[_0xbb58('0x43')]('i.'+_0x163ca4[0x0],_0x163ca4[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x17418c)){_0x55a1cc[_0xbb58('0x5e')](_0x54d658);_0x4992f7[_0xbb58('0x74')](_0xbb58('0x8b'),_0x17418c);}BPromise['resolve']()[_0xbb58('0x27')](function(){if(!_0x336598){if(_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x73')]||_0xb28e63['query'][_0xbb58('0x8c')])return;_0x4992f7['where'](_0xbb58('0x8d'));_0x55a1cc['where'](_0xbb58('0x8d'));return;}return _0xb28e63[_0xbb58('0x8e')][_0xbb58('0x8f')]({'attributes':['id'],'raw':!![]})[_0xbb58('0x27')](function(_0x26c15a){if(_[_0xbb58('0x72')](_0x26c15a)){_0x4992f7['where']('i.SmsAccountId\x20IS\x20NULL');_0x55a1cc[_0xbb58('0x74')](_0xbb58('0x90'));}else{_0x4992f7['where'](_0xbb58('0x91'),_[_0xbb58('0x2e')](_0x26c15a,'id'));_0x55a1cc[_0xbb58('0x74')]('i.SmsAccountId\x20IN\x20?',_[_0xbb58('0x2e')](_0x26c15a,'id'));}});})['then'](function(){db[_0xbb58('0x92')][_0xbb58('0x3b')](_0x4992f7[_0xbb58('0x93')](),_0x3addb7)[_0xbb58('0x27')](function(_0x389cd3){_0x5db313[_0xbb58('0x1e')]=_0x389cd3[_0xbb58('0x41')];if(_0x5db313['count']===0x0)return[];return db[_0xbb58('0x92')][_0xbb58('0x3b')](_0x45817f[_0xbb58('0x93')](),_0x3addb7)['then'](function(_0x25fb59){_0x29fb1c=_[_0xbb58('0x94')](_0x25fb59,'id');_0x3addb7=_['merge'](_0x3addb7,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb28e63[_0xbb58('0x3b')][_0xbb58('0x3f')]){_0x3093bf[_0xbb58('0x40')]['forEach'](function(_0x4deb01){_0x55a1cc[_0xbb58('0x45')]('i.'+_0x4deb01);});}else{_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x8a'),_0xbb58('0x5b'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x95'),_0xbb58('0x96'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x97'),_0xbb58('0x98'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x99'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x9a'),_0xbb58('0x9b'));_0x55a1cc['field'](_0xbb58('0x9c'),'Contact.lastName');_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x9d'),_0xbb58('0x9e'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0x9f'),_0xbb58('0xa0'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0xa1'),_0xbb58('0xa2'));_0x55a1cc[_0xbb58('0x45')]('c.fax',_0xbb58('0xa3'));_0x55a1cc[_0xbb58('0x45')](_0xbb58('0xa4'),_0xbb58('0xa5'));_0x55a1cc[_0xbb58('0x45')]('o.internal',_0xbb58('0xa6'));_0x55a1cc['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbb58('0x30'));}if(_0x3093bf['limit'])_0x55a1cc[_0xbb58('0x20')](_0x3093bf['limit']);if(_0x3093bf[_0xbb58('0x1f')])_0x55a1cc['offset'](_0x3093bf[_0xbb58('0x1f')]);return db[_0xbb58('0x92')][_0xbb58('0x3b')](_0x55a1cc[_0xbb58('0x93')](),_0x3addb7);})[_0xbb58('0x27')](function(_0x30cb55){_0x2ffd8b[_0xbb58('0x74')](_0xbb58('0xa7'),_['map'](_0x30cb55,'id'));return db['sequelize'][_0xbb58('0x3b')](_0x2ffd8b[_0xbb58('0x93')](),_0x3addb7)['then'](function(_0x57f022){var _0x56722e=_[_0xbb58('0xa8')](_0x57f022,_0xbb58('0xa9'));var _0x564b8a=[];_0x30cb55[_0xbb58('0x32')](function(_0x4281c0){_0x564b8a[_0xbb58('0x34')](updateSmsInteraction(_0x4281c0,_0x29fb1c,_0x56722e));});return BPromise[_0xbb58('0xaa')](_0x564b8a);});});})[_0xbb58('0x27')](function(_0x343535){_0x5db313[_0xbb58('0xab')]=_0x343535;return _0x5db313;})[_0xbb58('0x27')](respondWithFilteredResult(_0x3333e5,_0x3093bf));})['catch'](handleError(_0x3333e5,null));};exports[_0xbb58('0xac')]=function(_0x1c8f1a,_0x4d9bb7){var _0x5b101d={'raw':![],'where':{'id':_0x1c8f1a[_0xbb58('0xad')]['id']}},_0x2bef7b={};_0x2bef7b[_0xbb58('0x3a')]=_[_0xbb58('0x3c')](db[_0xbb58('0xae')]['rawAttributes']);_0x2bef7b[_0xbb58('0x3b')]=_[_0xbb58('0x3c')](_0x1c8f1a['query']);_0x2bef7b[_0xbb58('0x3d')]=_[_0xbb58('0x3e')](_0x2bef7b[_0xbb58('0x3a')],_0x2bef7b['query']);_0x5b101d[_0xbb58('0x40')]=_[_0xbb58('0x3e')](_0x2bef7b['model'],qs[_0xbb58('0x3f')](_0x1c8f1a[_0xbb58('0x3b')]['fields']));_0x5b101d['attributes']=_0x5b101d[_0xbb58('0x40')][_0xbb58('0x41')]?_0x5b101d['attributes']:_0x2bef7b[_0xbb58('0x3a')];if(_0x1c8f1a[_0xbb58('0x3b')][_0xbb58('0xaf')]){_0x5b101d[_0xbb58('0xb0')]=[{'all':!![]}];}_0x5b101d=_[_0xbb58('0xb1')]({},_0x5b101d,_0x1c8f1a[_0xbb58('0xb2')]);return db['SmsInteraction'][_0xbb58('0x65')](_0x5b101d)['then'](handleEntityNotFound(_0x4d9bb7,null))[_0xbb58('0x27')](respondWithResult(_0x4d9bb7,null))[_0xbb58('0x35')](handleError(_0x4d9bb7,null));};exports[_0xbb58('0xb3')]=function(_0x40a994,_0x68bf76){return db[_0xbb58('0xae')]['create'](_0x40a994[_0xbb58('0x70')],{})['then'](respondWithResult(_0x68bf76,0xc9))[_0xbb58('0x35')](handleError(_0x68bf76,null));};exports[_0xbb58('0xb4')]=function(_0x4cd52b,_0x52bc27){if(_0x4cd52b[_0xbb58('0x70')]['id']){delete _0x4cd52b[_0xbb58('0x70')]['id'];}return db['SmsInteraction'][_0xbb58('0x65')]({'where':{'id':_0x4cd52b['params']['id']}})[_0xbb58('0x27')](handleEntityNotFound(_0x52bc27,null))[_0xbb58('0x27')](saveUpdates(_0x4cd52b[_0xbb58('0x70')],null))[_0xbb58('0x27')](respondWithResult(_0x52bc27,null))[_0xbb58('0x35')](handleError(_0x52bc27,null));};exports[_0xbb58('0x28')]=function(_0x8875f1,_0x2a7465){return db[_0xbb58('0xae')][_0xbb58('0x65')]({'where':{'id':_0x8875f1[_0xbb58('0xad')]['id']}})['then'](handleEntityNotFound(_0x2a7465,null))[_0xbb58('0x27')](removeEntity(_0x2a7465,null))['catch'](handleError(_0x2a7465,null));};exports[_0xbb58('0xb5')]=function(_0x586752,_0x1281d8){return db[_0xbb58('0xae')]['describe']()[_0xbb58('0x27')](respondWithResult(_0x1281d8,null))['catch'](handleError(_0x1281d8,null));};exports[_0xbb58('0xb6')]=function(_0x1378ca,_0x37e3ea,_0x4e387e){return db[_0xbb58('0xb7')][_0xbb58('0x65')]({'where':{'id':_0x1378ca[_0xbb58('0xad')]['id']}})[_0xbb58('0x27')](handleEntityNotFound(_0x37e3ea,null))[_0xbb58('0x27')](function(_0x360749){if(_0x360749){return _0x360749['addMessage'](_0x1378ca[_0xbb58('0x70')][_0xbb58('0xb8')],_[_0xbb58('0xb9')](_0x1378ca['body'],[_0xbb58('0xb8'),'id'])||{});}})[_0xbb58('0x27')](respondWithResult(_0x37e3ea,null))[_0xbb58('0x35')](handleError(_0x37e3ea,null));};exports[_0xbb58('0xba')]=function(_0xa16ba1,_0x26d28e,_0x45e60f){var _0x3641cf={'raw':![],'where':{}};var _0x31a6ee={};var _0x505902={'count':0x0,'rows':[]};return db[_0xbb58('0xae')]['findOne']({'where':{'id':_0xa16ba1[_0xbb58('0xad')]['id']}})['then'](handleEntityNotFound(_0x26d28e,null))[_0xbb58('0x27')](function(_0x1ecf17){if(_0x1ecf17){_0x31a6ee[_0xbb58('0x3a')]=_[_0xbb58('0x3c')](db[_0xbb58('0xb7')][_0xbb58('0x37')]);_0x31a6ee[_0xbb58('0x3b')]=_[_0xbb58('0x3c')](_0xa16ba1[_0xbb58('0x3b')]);_0x31a6ee[_0xbb58('0x3d')]=_[_0xbb58('0x3e')](_0x31a6ee[_0xbb58('0x3a')],_0x31a6ee[_0xbb58('0x3b')]);_0x3641cf[_0xbb58('0x40')]=_[_0xbb58('0x3e')](_0x31a6ee[_0xbb58('0x3a')],qs[_0xbb58('0x3f')](_0xa16ba1[_0xbb58('0x3b')][_0xbb58('0x3f')]));_0x3641cf[_0xbb58('0x40')]=_0x3641cf[_0xbb58('0x40')][_0xbb58('0x41')]?_0x3641cf[_0xbb58('0x40')]:_0x31a6ee[_0xbb58('0x3a')];if(!_0xa16ba1[_0xbb58('0x3b')]['hasOwnProperty'](_0xbb58('0x42'))){_0x3641cf[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0xa16ba1[_0xbb58('0x3b')]['limit']);_0x3641cf[_0xbb58('0x1f')]=qs[_0xbb58('0x1f')](_0xa16ba1[_0xbb58('0x3b')][_0xbb58('0x1f')]);}_0x3641cf[_0xbb58('0x43')]=qs['sort'](_0xa16ba1[_0xbb58('0x3b')][_0xbb58('0x44')]);_0x3641cf[_0xbb58('0x74')]=qs[_0xbb58('0x3d')](_['pick'](_0xa16ba1[_0xbb58('0x3b')],_0x31a6ee[_0xbb58('0x3d')]));_0x3641cf[_0xbb58('0x74')]['SmsInteractionId']=_0x1ecf17['id'];if(_0xa16ba1['query'][_0xbb58('0xbb')]){_0x3641cf['where']=_[_0xbb58('0xb1')](_0x3641cf[_0xbb58('0x74')],{'$or':_[_0xbb58('0x2e')](_0x3641cf['attributes'],function(_0x12e94f){var _0x27ac56={};_0x27ac56[_0x12e94f]={'$like':'%'+_0xa16ba1['query'][_0xbb58('0xbb')]+'%'};return _0x27ac56;})});}if(_0xa16ba1[_0xbb58('0x3b')]['$gte']){var _0x20e214=_0xa16ba1[_0xbb58('0x3b')][_0xbb58('0xbc')]['split'](',');var _0x2cfa2a={};_0x2cfa2a[_0x20e214[0x0]]={'$gte':moment(_0x20e214[0x1])[_0xbb58('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3641cf[_0xbb58('0x74')]=_[_0xbb58('0xb1')](_0x3641cf[_0xbb58('0x74')],_0x2cfa2a);}_0x3641cf=_[_0xbb58('0xb1')]({},_0x3641cf,_0xa16ba1[_0xbb58('0xb2')]);return db[_0xbb58('0xb7')][_0xbb58('0x1e')]({'where':_0x3641cf[_0xbb58('0x74')]})['then'](function(_0x2a0803){_0x505902['count']=_0x2a0803;if(_0xa16ba1[_0xbb58('0x3b')]['includeAll']){_0x3641cf[_0xbb58('0xb0')]=[{'all':!![]}];}return db[_0xbb58('0xb7')][_0xbb58('0xbe')](_0x3641cf);})[_0xbb58('0x27')](function(_0x3665a8){_0x505902['rows']=_0x3665a8;return _0x505902;});}})[_0xbb58('0x27')](respondWithFilteredResult(_0x26d28e,_0x3641cf))[_0xbb58('0x35')](handleError(_0x26d28e,null));};exports[_0xbb58('0xbf')]=function(_0x200d16,_0x1f5844,_0xab7d39){return db['SmsInteraction']['find']({'where':{'id':_0x200d16['params']['id']}})[_0xbb58('0x27')](handleEntityNotFound(_0x1f5844,null))['then'](function(_0x15d86c){if(_0x15d86c){return _0x15d86c[_0xbb58('0xc0')](_0x200d16[_0xbb58('0x70')][_0xbb58('0xb8')],_[_0xbb58('0xb9')](_0x200d16[_0xbb58('0x70')],[_0xbb58('0xb8'),'id'])||{})['spread'](function(){return db[_0xbb58('0x6a')][_0xbb58('0xbe')]({'attributes':['id',_0xbb58('0x2c'),_0xbb58('0xc1')],'where':{'id':_0x200d16[_0xbb58('0x70')]['ids']}});})[_0xbb58('0x27')](function(_0x5a2861){socket[_0xbb58('0xc2')](_0xbb58('0xc3'),{'id':Number(_0x200d16[_0xbb58('0xad')]['id']),'tags':_0x5a2861||[]});return{'id':Number(_0x200d16[_0xbb58('0xad')]['id']),'tags':_0x5a2861||[]};});}})[_0xbb58('0x27')](respondWithResult(_0x1f5844,null))['catch'](handleError(_0x1f5844,null));};exports[_0xbb58('0xc4')]=function(_0x2ea15c,_0x3d05df,_0x196dbf){return db[_0xbb58('0xae')]['find']({'where':{'id':_0x2ea15c[_0xbb58('0xad')]['id']}})[_0xbb58('0x27')](handleEntityNotFound(_0x3d05df,null))[_0xbb58('0x27')](function(_0x23aaec){if(_0x23aaec){return _0x23aaec['removeTags'](_0x2ea15c[_0xbb58('0x3b')][_0xbb58('0xb8')]);}})['then'](respondWithStatusCode(_0x3d05df,null))[_0xbb58('0x35')](handleError(_0x3d05df,null));};exports[_0xbb58('0xc5')]=function(_0x319d14,_0x3810f1){var _0x426144=moment()[_0xbb58('0xc6')]()[_0xbb58('0x93')]();var _0x90682c=path['join'](config['root'],'server','files','tmp');var _0x362bd8=path[_0xbb58('0xc7')](config[_0xbb58('0xc8')],_0xbb58('0xc9'),_0xbb58('0xca'),_0xbb58('0xcb'));var _0x520662=path[_0xbb58('0xc7')](_0x90682c,_0x426144);var _0x2968e3=util[_0xbb58('0xbd')](_0xbb58('0xcc'),_0x319d14['params']['id'],_0x426144);var _0x47c2ca=path[_0xbb58('0xc7')](_0x90682c,_0x2968e3);var _0x1830b0=[];_0x1830b0[_0xbb58('0x34')]({'model':db[_0xbb58('0xcd')],'as':'User','attributes':['id',_0xbb58('0x2f')],'raw':!![]});_0x1830b0[_0xbb58('0x34')]({'model':db['CmContact'],'as':_0xbb58('0x60'),'attributes':['id',_0xbb58('0xce'),_0xbb58('0xcf')],'raw':!![]});var _0x45809d=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body',_0xbb58('0x76'),_0xbb58('0xd0'),_0xbb58('0xd1'),'read'],'include':_0x1830b0}];_0x45809d['push']({'model':db[_0xbb58('0xd2')],'as':_0xbb58('0xd3'),'attributes':['id','name']});_0x45809d['push']({'model':db[_0xbb58('0xcd')],'as':_0xbb58('0xd4'),'attributes':['id',_0xbb58('0x2f')]});return db[_0xbb58('0xae')][_0xbb58('0x65')]({'where':{'id':_0x319d14[_0xbb58('0xad')]['id']},'include':_0x45809d})[_0xbb58('0x27')](handleEntityNotFound(_0x3810f1,null))[_0xbb58('0x27')](function(_0x51c7e6){if(_0x51c7e6){var _0x3aec87=_0x51c7e6['get']({'plain':!![]});fs[_0xbb58('0xd5')](_0x520662);var _0x4237aa={'format':'A4','border':_0xbb58('0xd6'),'header':{'height':'40px','contents':{'first':_0xbb58('0xd7')}},'footer':{'height':_0xbb58('0xd8'),'contents':{'default':util[_0xbb58('0xbd')](_0xbb58('0xd9'),util['format']('%s\x20#%d','Sms',_0x3aec87['id']),moment()['format'](_0xbb58('0xda'))['toString']())}}};var _0x2d83d1={'channel':_0xbb58('0xdb'),'account':_0x3aec87[_0xbb58('0xd3')][_0xbb58('0x2c')],'agent':_0x3aec87['Owner']?_0x3aec87[_0xbb58('0xd4')][_0xbb58('0x2f')]:_0xbb58('0xdc'),'createdAt':moment(_0x3aec87[_0xbb58('0x76')])[_0xbb58('0xbd')](_0xbb58('0xdd'))[_0xbb58('0x93')](),'closedAt':_0x3aec87[_0xbb58('0xde')]?moment(_0x3aec87[_0xbb58('0xdf')])[_0xbb58('0xbd')](_0xbb58('0xdd'))['toString']():'','disposition':_0x3aec87[_0xbb58('0xe0')],'messages':_(_0x3aec87['Messages'])[_0xbb58('0xbb')]({'secret':![]})[_0xbb58('0x2e')](function(_0x400d28){return{'date':moment(_0x400d28['createdAt'])['format'](_0xbb58('0xdd'))[_0xbb58('0x93')](),'sender':_0x400d28[_0xbb58('0xd0')]==='out'?_0x400d28[_0xbb58('0xcd')]?_0x400d28[_0xbb58('0xcd')][_0xbb58('0x2f')]:_0xbb58('0xe1'):_0x400d28[_0xbb58('0x60')][_0xbb58('0xce')]+(_0x400d28[_0xbb58('0x60')][_0xbb58('0xcf')]?'\x20'+_0x400d28[_0xbb58('0x60')][_0xbb58('0xcf')]:''),'body':_0x400d28[_0xbb58('0x70')],'direction':_0x400d28[_0xbb58('0xd0')]===_0xbb58('0xe2')?'A':'C','secret':_0x400d28[_0xbb58('0xd1')],'read':_0x400d28[_0xbb58('0x7d')]};})[_0xbb58('0x5c')]()};return ejs[_0xbb58('0xe3')](path[_0xbb58('0xc7')](config['root'],_0xbb58('0xc9'),_0xbb58('0xe4'),_0xbb58('0xe5')),{'interaction':_0x2d83d1})[_0xbb58('0x27')](function(_0x1e568f){return new BPromise(function(_0xa2a796,_0x3444ee){pdf[_0xbb58('0xb3')](_0x1e568f,_0x4237aa)[_0xbb58('0xe6')](path[_0xbb58('0xc7')](_0x520662,_0xbb58('0xe7')+_0x3aec87['id']+'-'+_0x426144+_0xbb58('0xe8')),function(_0x5ab9d8,_0x4a3a0c){if(_0x5ab9d8)return _0x3444ee(_0x5ab9d8);_0xa2a796(_0x4a3a0c);});});})[_0xbb58('0x27')](function(){return new BPromise(function(_0x4cc939,_0x272bfe){zipdir(_0x520662,{'saveTo':_0x47c2ca},function(_0x2bff0d,_0x2d5bf4){if(_0x2bff0d)return _0x272bfe(_0x2bff0d);return _0x4cc939(_0x2d5bf4);});})[_0xbb58('0x27')](function(){return new BPromise(function(_0x5cc418,_0x8be3c7){rimraf(_0x520662,function(_0x13e815){if(_0x13e815)_0x8be3c7(_0x13e815);return _0x5cc418();});});})['then'](function(){return _0x3810f1[_0xbb58('0xc5')](_0x47c2ca,_0x2968e3,function(_0x123236){if(_0x123236){console[_0xbb58('0xe9')](_0xbb58('0xea'),_0x123236);}else{fs[_0xbb58('0xeb')](_0x47c2ca);}});});});}else{return _0x3810f1[_0xbb58('0x1d')](0xc8);}})[_0xbb58('0x35')](handleError(_0x3810f1,null));}; \ No newline at end of file +var _0x55e0=['crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','field','color','select','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','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?','find','UserId','buildExpression','body','keys','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','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','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','rows','show','params','rawAttributes','include','merge','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','pick','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','SmsAccount','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','Account','closed','closedAt','disposition','out','System','secret','renderFile','views','transcript-','err','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash'];(function(_0x3ba937,_0x373271){var _0x590be0=function(_0x1ff501){while(--_0x1ff501){_0x3ba937['push'](_0x3ba937['shift']());}};_0x590be0(++_0x373271);}(_0x55e0,0xdc));var _0x055e=function(_0x3ee554,_0x6ff1c1){_0x3ee554=_0x3ee554-0x0;var _0x35066a=_0x55e0[_0x3ee554];return _0x35066a;};'use strict';var pdf=require(_0x055e('0x0'));var emlformat=require(_0x055e('0x1'));var rimraf=require(_0x055e('0x2'));var zipdir=require(_0x055e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x055e('0x4'));var BPromise=require(_0x055e('0x5'));var Mustache=require(_0x055e('0x6'));var util=require(_0x055e('0x7'));var path=require(_0x055e('0x8'));var sox=require(_0x055e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x055e('0xa'));var squel=require('squel');var crypto=require(_0x055e('0xb'));var jsforce=require(_0x055e('0xc'));var deskjs=require(_0x055e('0xd'));var toCsv=require(_0x055e('0xe'));var querystring=require(_0x055e('0xf'));var Papa=require('papaparse');var Redis=require(_0x055e('0x10'));var authService=require(_0x055e('0x11'));var qs=require(_0x055e('0x12'));var as=require(_0x055e('0x13'));var hardwareService=require(_0x055e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x055e('0x15'));var config=require('../../config/environment');var db=require(_0x055e('0x16'))['db'];config[_0x055e('0x17')]=_[_0x055e('0x18')](config[_0x055e('0x17')],{'host':_0x055e('0x19'),'port':0x18eb});var socket=require(_0x055e('0x1a'))(new Redis(config[_0x055e('0x17')]));require('./smsInteraction.socket')[_0x055e('0x1b')](socket);function respondWithStatusCode(_0xb80d83,_0x3cfd14){_0x3cfd14=_0x3cfd14||0xcc;return function(_0xe41bae){if(_0xe41bae){return _0xb80d83[_0x055e('0x1c')](_0x3cfd14);}return _0xb80d83['status'](_0x3cfd14)[_0x055e('0x1d')]();};}function respondWithResult(_0x2fe55f,_0x111cdb){_0x111cdb=_0x111cdb||0xc8;return function(_0x599533){if(_0x599533){return _0x2fe55f[_0x055e('0x1e')](_0x111cdb)[_0x055e('0x1f')](_0x599533);}};}function respondWithFilteredResult(_0xb4e6ca,_0x2bad86){return function(_0x2cc84e){if(_0x2cc84e){var _0x4c85dd=_0x2cc84e[_0x055e('0x20')],_0x36ef10=_0x2bad86['offset'],_0x2cf3de=_0x2bad86[_0x055e('0x21')]+_0x2bad86[_0x055e('0x22')],_0x2f4a06;if(_0x2cf3de>=_0x4c85dd){_0x2cf3de=_0x4c85dd;_0x2f4a06=0xc8;}else{_0x2f4a06=0xce;}_0xb4e6ca['status'](_0x2f4a06);return _0xb4e6ca[_0x055e('0x23')](_0x055e('0x24'),_0x36ef10+'-'+_0x2cf3de+'/'+_0x4c85dd)[_0x055e('0x1f')](_0x2cc84e);}return null;};}function patchUpdates(_0x124d86){return function(_0x4280cf){try{jsonpatch[_0x055e('0x25')](_0x4280cf,_0x124d86,!![]);}catch(_0x53b766){return BPromise[_0x055e('0x26')](_0x53b766);}return _0x4280cf[_0x055e('0x27')]();};}function saveUpdates(_0x211594,_0x5930ff){return function(_0x3f444a){if(_0x3f444a){return _0x3f444a[_0x055e('0x28')](_0x211594)[_0x055e('0x29')](function(_0x37243b){return _0x37243b;});}return null;};}function removeEntity(_0x51df23,_0x71a6e1){return function(_0x56c372){if(_0x56c372){return _0x56c372[_0x055e('0x2a')]()[_0x055e('0x29')](function(){_0x51df23[_0x055e('0x1e')](0xcc)[_0x055e('0x1d')]();});}};}function handleEntityNotFound(_0x40c62a,_0x4c653c){return function(_0x58caf9){if(!_0x58caf9){_0x40c62a[_0x055e('0x1c')](0x194);}return _0x58caf9;};}function handleError(_0x1f90a9,_0x2a82f8){_0x2a82f8=_0x2a82f8||0x1f4;return function(_0x4b5891){logger[_0x055e('0x2b')](_0x4b5891[_0x055e('0x2c')]);if(_0x4b5891[_0x055e('0x2d')]){delete _0x4b5891[_0x055e('0x2d')];}_0x1f90a9['status'](_0x2a82f8)[_0x055e('0x2e')](_0x4b5891);};}function getInteractionUsers(_0x5958ef,_0x1528c3){return new BPromise(function(_0x35def0,_0x23a506){try{if(_0x1528c3[_0x5958ef['id']]){_0x5958ef[_0x055e('0x2f')]=_[_0x055e('0x30')](_0x1528c3[_0x5958ef['id']],function(_0x5c0e76){return{'id':_0x5c0e76['id'],'fullname':_0x5c0e76[_0x055e('0x31')]};});}}catch(_0x453e5e){_0x23a506(_0x453e5e);}_0x35def0(_0x5958ef);});}function getInteractionTags(_0x293062,_0x1499e1){return new BPromise(function(_0x36abb2,_0x225c88){try{if(_0x293062[_0x055e('0x32')]){_0x293062[_0x055e('0x33')]=[];_0x293062['TagIds'][_0x055e('0x34')](',')[_0x055e('0x35')](function(_0x5cfeea){_0x293062[_0x055e('0x33')][_0x055e('0x36')](_0x1499e1[_0x5cfeea]);});}delete _0x293062[_0x055e('0x32')];}catch(_0x20717b){_0x225c88(_0x20717b);}_0x36abb2(_0x293062);});}function updateSmsInteraction(_0x23c611,_0x43d8b7,_0x5e1a92){return new BPromise(function(_0x5ddf59,_0x25d19d){return getInteractionUsers(_0x23c611,_0x5e1a92)['then'](function(_0x49b64c){return getInteractionTags(_0x49b64c,_0x43d8b7);})['then'](function(_0x31ee60){_0x5ddf59(_0x31ee60);})[_0x055e('0x37')](function(_0x35c6cf){_0x25d19d(_0x35c6cf);});});}exports[_0x055e('0x38')]=function(_0x282914,_0x16a4fa){var _0x13efb7={},_0x106543={},_0x42a33e={'count':0x0,'rows':[]};var _0x2f60fa=_[_0x055e('0x30')](db[_0x055e('0x39')]['rawAttributes'],function(_0x571b75){return{'name':_0x571b75[_0x055e('0x3a')],'type':_0x571b75[_0x055e('0x3b')][_0x055e('0x3c')]};});_0x106543[_0x055e('0x3d')]=_[_0x055e('0x30')](_0x2f60fa,_0x055e('0x2d'));_0x106543[_0x055e('0x3e')]=_['keys'](_0x282914[_0x055e('0x3e')]);_0x106543[_0x055e('0x3f')]=_[_0x055e('0x40')](_0x106543[_0x055e('0x3d')],_0x106543[_0x055e('0x3e')]);_0x13efb7['attributes']=_[_0x055e('0x40')](_0x106543[_0x055e('0x3d')],qs['fields'](_0x282914[_0x055e('0x3e')][_0x055e('0x41')]));_0x13efb7['attributes']=_0x13efb7[_0x055e('0x42')][_0x055e('0x43')]?_0x13efb7['attributes']:_0x106543[_0x055e('0x3d')];if(!_0x282914[_0x055e('0x3e')]['hasOwnProperty'](_0x055e('0x44'))){_0x13efb7[_0x055e('0x22')]=qs[_0x055e('0x22')](_0x282914['query'][_0x055e('0x22')]);_0x13efb7[_0x055e('0x21')]=qs['offset'](_0x282914[_0x055e('0x3e')][_0x055e('0x21')]);}_0x13efb7[_0x055e('0x45')]=qs['sort'](_0x282914[_0x055e('0x3e')][_0x055e('0x46')]);_0x13efb7[_0x055e('0x47')]=qs['filters'](_['pick'](_0x282914[_0x055e('0x3e')],_0x106543[_0x055e('0x3f')]),_0x2f60fa);var _0x4ff19e=[];var _0x3a5bc5=squel['select']()[_0x055e('0x48')]('id')['field'](_0x055e('0x2d'))[_0x055e('0x48')](_0x055e('0x49'))['from']('tools_tags');var _0x20b951=squel[_0x055e('0x4a')]()[_0x055e('0x48')](_0x055e('0x4b'))['field']('u.fullname')[_0x055e('0x48')](_0x055e('0x4c'))['from'](_0x055e('0x4d'),'ui')[_0x055e('0x4e')](_0x055e('0x4f'),'u',_0x055e('0x50'));var _0x19e29c=squel[_0x055e('0x4a')]()['from'](_0x055e('0x51'),'i')[_0x055e('0x4e')]('cm_contacts','c',_0x055e('0x52'))[_0x055e('0x4e')](_0x055e('0x4f'),'o',_0x055e('0x53'))[_0x055e('0x4e')](_0x055e('0x54'),'a',_0x055e('0x55'))['left_join'](_0x055e('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x055e('0x4e')](_0x055e('0x57'),'it',_0x055e('0x58'))['left_join']('tools_tags','t',_0x055e('0x59'));var _0x20114c=squel[_0x055e('0x5a')]();var _0x250cab=[];var _0xb4be7a=squel[_0x055e('0x5a')]();var _0x128e11;if(_0x282914[_0x055e('0x3e')][_0x055e('0x5b')]){_0x128e11=as['parseSearch'](_0x282914[_0x055e('0x3e')][_0x055e('0x5b')]);var _0x2f8ad0=_0x128e11[_0x055e('0x5c')];for(var _0x335415=0x0;_0x335415<_0x128e11['conditions'][_0x055e('0x43')];_0x335415++){var _0x1d4061=_0x128e11[_0x055e('0x5d')][_0x335415];var _0x4b7ba0='i';var _0x43a849=_['find'](_0x2f60fa,[_0x055e('0x2d'),_0x1d4061[_0x055e('0x48')]]);if(!_0x43a849){switch(_0x1d4061['field']){case _0x055e('0x5e'):if(_0x1d4061[_0x055e('0x5f')]==0x1){_0x19e29c[_0x055e('0x60')]('`'+_0x1d4061['field']+'`\x20=\x200');}else{_0x19e29c[_0x055e('0x60')]('`'+_0x1d4061[_0x055e('0x48')]+_0x055e('0x61'));}break;case _0x055e('0x62'):if(_0x1d4061[_0x055e('0x63')]===_0x055e('0x64')){if(_0x1d4061[_0x055e('0x5f')][_0x055e('0x34')]('\x20')[_0x055e('0x43')]>0x1){_0x20114c[_0x2f8ad0](_0x055e('0x65'),qs['getFullTextValue'](_0x1d4061[_0x055e('0x5f')]),null);}else{var _0x7f03ed='%'+_0x1d4061[_0x055e('0x5f')]+'%';_0x20114c[_0x2f8ad0](_0x055e('0x66'),_0x7f03ed,_0x7f03ed,_0x7f03ed);}}else{_0x43a849=_['find'](_0x2f60fa,[_0x055e('0x2d'),_0x055e('0x67')]);_0x1d4061[_0x055e('0x48')]=_0x055e('0x67');_0x329d46=as['buildExpression'](_0x4b7ba0,_0x43a849['type'],_0x1d4061);_0x20114c[_0x2f8ad0](_0x329d46[_0x055e('0x68')],_0x329d46[_0x055e('0x5f')][_0x055e('0x69')],_0x329d46[_0x055e('0x5f')][_0x055e('0x1d')]);}break;case _0x055e('0x6a'):var _0x3876d0=_0x1d4061[_0x055e('0x5f')]['split'](',')['map'](function(_0x1df839){return Number(_0x1df839);});_0x3876d0[_0x055e('0x35')](function(_0x5240d5){_0xb4be7a['or'](_0x055e('0x6b'),'%,'+_0x5240d5+',%');});_0x250cab=_[_0x055e('0x6c')](_0x250cab,_0x3876d0);break;case _0x055e('0x6d'):if(_0x1d4061[_0x055e('0x63')]==='$substring'){_0x20114c[_0x2f8ad0](_0x055e('0x6e'),'%'+_0x1d4061[_0x055e('0x5f')]+'%',null);}else{_0x43a849=_[_0x055e('0x6f')](_0x2f60fa,[_0x055e('0x2d'),_0x055e('0x70')]);_0x1d4061[_0x055e('0x48')]=_0x055e('0x70');_0x329d46=as[_0x055e('0x71')](_0x4b7ba0,_0x43a849['type'],_0x1d4061);_0x20114c[_0x2f8ad0](_0x329d46[_0x055e('0x68')],_0x329d46[_0x055e('0x5f')]['start'],_0x329d46[_0x055e('0x5f')][_0x055e('0x1d')]);}break;case _0x055e('0x72'):_0x329d46=as[_0x055e('0x71')]('me',null,_0x1d4061);_0x20114c[_0x2f8ad0](_0x329d46['text'],_0x329d46[_0x055e('0x5f')][_0x055e('0x69')],_0x329d46[_0x055e('0x5f')]['end']);break;}}else{var _0x329d46=as[_0x055e('0x71')](_0x4b7ba0,_0x43a849[_0x055e('0x3b')],_0x1d4061);_0x20114c[_0x2f8ad0](_0x329d46[_0x055e('0x68')],_0x329d46[_0x055e('0x5f')]['start'],_0x329d46[_0x055e('0x5f')][_0x055e('0x1d')]);}}}else{var _0x1166b5=_(_0x282914[_0x055e('0x3e')])[_0x055e('0x73')]()['map'](function(_0x43f475){return _[_0x055e('0x74')](_0x2f60fa,[_0x055e('0x2d'),_0x43f475])?_0x43f475:undefined;})['compact']()[_0x055e('0x5f')]();if(!_[_0x055e('0x75')](_0x1166b5)){_0x1166b5[_0x055e('0x35')](function(_0x2262e1){if(_0x2262e1===_0x055e('0x76')){_0x19e29c['where'](_0x055e('0x77'),[]['concat'](_0x282914[_0x055e('0x3e')][_0x2262e1]));}else if(_0x2262e1===_0x055e('0x78')){var _0x533c0a=JSON[_0x055e('0x79')](_0x282914[_0x055e('0x3e')][_0x2262e1])[_0x055e('0x7a')];var _0x2bdf06=JSON['parse'](_0x282914['query'][_0x2262e1])[_0x055e('0x7b')];_0x19e29c['where'](_0x055e('0x7c'),_0x533c0a,_0x2bdf06);}else{if(_0x282914[_0x055e('0x3e')][_0x2262e1]===_0x055e('0x7d')){_0x19e29c[_0x055e('0x47')]('i.'+_0x2262e1+_0x055e('0x7e'));}else{_0x19e29c[_0x055e('0x47')]('i.'+_0x2262e1+_0x055e('0x7f'),_0x282914[_0x055e('0x3e')][_0x2262e1]);}}});}if(_0x282914[_0x055e('0x3e')][_0x055e('0x80')]){if(_0x282914['query']['read']==0x1){_0x19e29c[_0x055e('0x60')](_0x055e('0x81'));}else{_0x19e29c['having'](_0x055e('0x82'));}}if(_0x282914['query'][_0x055e('0x83')]){_0x250cab=_[_0x055e('0x84')](_0x282914[_0x055e('0x3e')][_0x055e('0x83')])?_0x282914[_0x055e('0x3e')][_0x055e('0x83')]:new Array(_0x282914[_0x055e('0x3e')][_0x055e('0x83')]);_0x250cab['forEach'](function(_0x144fa1){_0xb4be7a['or'](_0x055e('0x6b'),'%,'+_0x144fa1+',%');});}if(_0x282914[_0x055e('0x3e')][_0x055e('0x85')]){var _0x148db3=_0x282914[_0x055e('0x3e')][_0x055e('0x85')][_0x055e('0x86')]('\x5c','\x5c\x5c')[_0x055e('0x86')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x055e('0x87')](_0x148db3)){_0x20114c['or'](_0x055e('0x88'),_0x148db3+'%')['or']('i.phone\x20LIKE\x20?',_0x148db3+'%');}else{_0x20114c['or'](_0x055e('0x89'),qs[_0x055e('0x8a')](_0x148db3))['or'](_0x055e('0x8b'),_0x148db3+'%');}}}_0x19e29c[_0x055e('0x47')](_0x20114c);_0x19e29c['group'](_0x055e('0x8c'));var _0x4dfba2={'type':db[_0x055e('0x8d')][_0x055e('0x8e')][_0x055e('0x8f')],'raw':!![]};var _0x525d4f=_0x19e29c[_0x055e('0x90')]();_0x525d4f[_0x055e('0x48')](_0x055e('0x8c'));_0x525d4f[_0x055e('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x055e('0x5e'));if(_0x13efb7[_0x055e('0x45')]){_0x13efb7[_0x055e('0x45')][_0x055e('0x35')](function(_0x29bb04){_0x19e29c['order']('i.'+_0x29bb04[0x0],_0x29bb04[0x1]===_0x055e('0x91')?![]:!![]);});}if(!_[_0x055e('0x75')](_0x250cab)){_0x19e29c[_0x055e('0x60')](_0xb4be7a);_0x525d4f[_0x055e('0x47')]('t.id\x20IN\x20?',_0x250cab);}BPromise[_0x055e('0x92')]()[_0x055e('0x29')](function(){if(!_0x128e11){if(_0x282914[_0x055e('0x3e')][_0x055e('0x76')]||_0x282914['query'][_0x055e('0x93')])return;_0x525d4f[_0x055e('0x47')](_0x055e('0x94'));_0x19e29c[_0x055e('0x47')](_0x055e('0x94'));return;}return _0x282914['user'][_0x055e('0x95')]({'attributes':['id'],'raw':!![]})[_0x055e('0x29')](function(_0x2e5122){if(_['isEmpty'](_0x2e5122)){_0x525d4f['where'](_0x055e('0x96'));_0x19e29c['where'](_0x055e('0x96'));}else{_0x525d4f[_0x055e('0x47')]('i.SmsAccountId\x20IN\x20?',_[_0x055e('0x30')](_0x2e5122,'id'));_0x19e29c[_0x055e('0x47')](_0x055e('0x77'),_[_0x055e('0x30')](_0x2e5122,'id'));}});})[_0x055e('0x29')](function(){db[_0x055e('0x97')][_0x055e('0x3e')](_0x525d4f[_0x055e('0x98')](),_0x4dfba2)[_0x055e('0x29')](function(_0x431b5e){_0x42a33e[_0x055e('0x20')]=_0x431b5e[_0x055e('0x43')];if(_0x42a33e[_0x055e('0x20')]===0x0)return[];return db[_0x055e('0x97')][_0x055e('0x3e')](_0x3a5bc5[_0x055e('0x98')](),_0x4dfba2)['then'](function(_0x27e80f){_0x4ff19e=_['keyBy'](_0x27e80f,'id');_0x4dfba2=_['merge'](_0x4dfba2,{'model':db[_0x055e('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x282914[_0x055e('0x3e')][_0x055e('0x41')]){_0x13efb7['attributes'][_0x055e('0x35')](function(_0x265b94){_0x19e29c['field']('i.'+_0x265b94);});}else{_0x19e29c[_0x055e('0x48')](_0x055e('0x99'),'unreadMessages');_0x19e29c[_0x055e('0x48')]('a.key',_0x055e('0x9a'));_0x19e29c[_0x055e('0x48')](_0x055e('0x9b'),_0x055e('0x9c'));_0x19e29c['field']('i.*');_0x19e29c['field'](_0x055e('0x9d'),'Contact.firstName');_0x19e29c['field'](_0x055e('0x9e'),'Contact.lastName');_0x19e29c[_0x055e('0x48')](_0x055e('0x9f'),_0x055e('0xa0'));_0x19e29c[_0x055e('0x48')]('c.phone','Contact.phone');_0x19e29c[_0x055e('0x48')](_0x055e('0xa1'),_0x055e('0xa2'));_0x19e29c[_0x055e('0x48')](_0x055e('0xa3'),_0x055e('0xa4'));_0x19e29c[_0x055e('0x48')]('o.fullname',_0x055e('0xa5'));_0x19e29c['field']('o.internal',_0x055e('0xa6'));_0x19e29c[_0x055e('0x48')](_0x055e('0xa7'),'TagIds');}if(_0x13efb7[_0x055e('0x22')])_0x19e29c[_0x055e('0x22')](_0x13efb7[_0x055e('0x22')]);if(_0x13efb7['offset'])_0x19e29c[_0x055e('0x21')](_0x13efb7[_0x055e('0x21')]);return db[_0x055e('0x97')][_0x055e('0x3e')](_0x19e29c[_0x055e('0x98')](),_0x4dfba2);})[_0x055e('0x29')](function(_0x2ec6d1){_0x20b951[_0x055e('0x47')](_0x055e('0xa8'),_[_0x055e('0x30')](_0x2ec6d1,'id'));return db[_0x055e('0x97')][_0x055e('0x3e')](_0x20b951[_0x055e('0x98')](),_0x4dfba2)[_0x055e('0x29')](function(_0xd6807d){var _0x3df4d8=_['groupBy'](_0xd6807d,_0x055e('0xa9'));var _0x208e75=[];_0x2ec6d1[_0x055e('0x35')](function(_0x4ac58f){_0x208e75['push'](updateSmsInteraction(_0x4ac58f,_0x4ff19e,_0x3df4d8));});return BPromise['all'](_0x208e75);});});})[_0x055e('0x29')](function(_0x10cee9){_0x42a33e[_0x055e('0xaa')]=_0x10cee9;return _0x42a33e;})[_0x055e('0x29')](respondWithFilteredResult(_0x16a4fa,_0x13efb7));})[_0x055e('0x37')](handleError(_0x16a4fa,null));};exports[_0x055e('0xab')]=function(_0x2c6c7d,_0x2f9a0f){var _0x546ca6={'raw':![],'where':{'id':_0x2c6c7d[_0x055e('0xac')]['id']}},_0x3aef2f={};_0x3aef2f[_0x055e('0x3d')]=_[_0x055e('0x73')](db[_0x055e('0x39')][_0x055e('0xad')]);_0x3aef2f[_0x055e('0x3e')]=_[_0x055e('0x73')](_0x2c6c7d[_0x055e('0x3e')]);_0x3aef2f[_0x055e('0x3f')]=_[_0x055e('0x40')](_0x3aef2f[_0x055e('0x3d')],_0x3aef2f['query']);_0x546ca6['attributes']=_[_0x055e('0x40')](_0x3aef2f[_0x055e('0x3d')],qs[_0x055e('0x41')](_0x2c6c7d['query'][_0x055e('0x41')]));_0x546ca6[_0x055e('0x42')]=_0x546ca6[_0x055e('0x42')]['length']?_0x546ca6[_0x055e('0x42')]:_0x3aef2f['model'];if(_0x2c6c7d[_0x055e('0x3e')]['includeAll']){_0x546ca6[_0x055e('0xae')]=[{'all':!![]}];}_0x546ca6=_[_0x055e('0xaf')]({},_0x546ca6,_0x2c6c7d['options']);return db['SmsInteraction'][_0x055e('0x6f')](_0x546ca6)['then'](handleEntityNotFound(_0x2f9a0f,null))['then'](respondWithResult(_0x2f9a0f,null))[_0x055e('0x37')](handleError(_0x2f9a0f,null));};exports[_0x055e('0xb0')]=function(_0x2e3249,_0x46bbaa){return db[_0x055e('0x39')]['create'](_0x2e3249[_0x055e('0x72')],{})[_0x055e('0x29')](respondWithResult(_0x46bbaa,0xc9))['catch'](handleError(_0x46bbaa,null));};exports[_0x055e('0x28')]=function(_0x1d39a6,_0x14ea19){if(_0x1d39a6[_0x055e('0x72')]['id']){delete _0x1d39a6[_0x055e('0x72')]['id'];}return db[_0x055e('0x39')][_0x055e('0x6f')]({'where':{'id':_0x1d39a6[_0x055e('0xac')]['id']}})['then'](handleEntityNotFound(_0x14ea19,null))[_0x055e('0x29')](saveUpdates(_0x1d39a6[_0x055e('0x72')],null))[_0x055e('0x29')](respondWithResult(_0x14ea19,null))[_0x055e('0x37')](handleError(_0x14ea19,null));};exports[_0x055e('0x2a')]=function(_0x3bcc80,_0xf22117){return db[_0x055e('0x39')][_0x055e('0x6f')]({'where':{'id':_0x3bcc80[_0x055e('0xac')]['id']}})[_0x055e('0x29')](handleEntityNotFound(_0xf22117,null))['then'](removeEntity(_0xf22117,null))[_0x055e('0x37')](handleError(_0xf22117,null));};exports[_0x055e('0xb1')]=function(_0x35a0bc,_0x555839){return db['SmsInteraction'][_0x055e('0xb1')]()[_0x055e('0x29')](respondWithResult(_0x555839,null))[_0x055e('0x37')](handleError(_0x555839,null));};exports[_0x055e('0xb2')]=function(_0xe63e29,_0x3cd8e5,_0x505cc4){return db[_0x055e('0xb3')][_0x055e('0x6f')]({'where':{'id':_0xe63e29[_0x055e('0xac')]['id']}})[_0x055e('0x29')](handleEntityNotFound(_0x3cd8e5,null))[_0x055e('0x29')](function(_0x20218f){if(_0x20218f){return _0x20218f[_0x055e('0xb2')](_0xe63e29[_0x055e('0x72')][_0x055e('0xb4')],_['omit'](_0xe63e29['body'],['ids','id'])||{});}})[_0x055e('0x29')](respondWithResult(_0x3cd8e5,null))[_0x055e('0x37')](handleError(_0x3cd8e5,null));};exports[_0x055e('0xb5')]=function(_0x540e41,_0x2baf49,_0x423aad){var _0x1fafc5={'raw':![],'where':{}};var _0x361c4e={};var _0x1ac2cc={'count':0x0,'rows':[]};return db[_0x055e('0x39')][_0x055e('0xb6')]({'where':{'id':_0x540e41[_0x055e('0xac')]['id']}})['then'](handleEntityNotFound(_0x2baf49,null))[_0x055e('0x29')](function(_0xd5c785){if(_0xd5c785){_0x361c4e['model']=_['keys'](db[_0x055e('0xb3')][_0x055e('0xad')]);_0x361c4e[_0x055e('0x3e')]=_[_0x055e('0x73')](_0x540e41['query']);_0x361c4e['filters']=_[_0x055e('0x40')](_0x361c4e[_0x055e('0x3d')],_0x361c4e[_0x055e('0x3e')]);_0x1fafc5[_0x055e('0x42')]=_[_0x055e('0x40')](_0x361c4e['model'],qs[_0x055e('0x41')](_0x540e41[_0x055e('0x3e')]['fields']));_0x1fafc5[_0x055e('0x42')]=_0x1fafc5['attributes']['length']?_0x1fafc5['attributes']:_0x361c4e[_0x055e('0x3d')];if(!_0x540e41[_0x055e('0x3e')]['hasOwnProperty'](_0x055e('0x44'))){_0x1fafc5[_0x055e('0x22')]=qs['limit'](_0x540e41[_0x055e('0x3e')]['limit']);_0x1fafc5[_0x055e('0x21')]=qs['offset'](_0x540e41[_0x055e('0x3e')][_0x055e('0x21')]);}_0x1fafc5[_0x055e('0x45')]=qs[_0x055e('0x46')](_0x540e41['query'][_0x055e('0x46')]);_0x1fafc5[_0x055e('0x47')]=qs['filters'](_[_0x055e('0xb7')](_0x540e41[_0x055e('0x3e')],_0x361c4e[_0x055e('0x3f')]));_0x1fafc5[_0x055e('0x47')][_0x055e('0xa9')]=_0xd5c785['id'];if(_0x540e41[_0x055e('0x3e')][_0x055e('0x85')]){_0x1fafc5[_0x055e('0x47')]=_[_0x055e('0xaf')](_0x1fafc5[_0x055e('0x47')],{'$or':_[_0x055e('0x30')](_0x1fafc5[_0x055e('0x42')],function(_0x4f9edd){var _0x156bc8={};_0x156bc8[_0x4f9edd]={'$like':'%'+_0x540e41[_0x055e('0x3e')][_0x055e('0x85')]+'%'};return _0x156bc8;})});}if(_0x540e41['query'][_0x055e('0x7a')]){var _0x484ee0=_0x540e41[_0x055e('0x3e')][_0x055e('0x7a')]['split'](',');var _0xfb3b6d={};_0xfb3b6d[_0x484ee0[0x0]]={'$gte':moment(_0x484ee0[0x1])['format'](_0x055e('0xb8'))};_0x1fafc5['where']=_[_0x055e('0xaf')](_0x1fafc5[_0x055e('0x47')],_0xfb3b6d);}_0x1fafc5=_['merge']({},_0x1fafc5,_0x540e41[_0x055e('0xb9')]);return db[_0x055e('0xb3')][_0x055e('0x20')]({'where':_0x1fafc5['where']})[_0x055e('0x29')](function(_0x1c97bc){_0x1ac2cc[_0x055e('0x20')]=_0x1c97bc;if(_0x540e41[_0x055e('0x3e')][_0x055e('0xba')]){_0x1fafc5[_0x055e('0xae')]=[{'all':!![]}];}return db['SmsMessage'][_0x055e('0xbb')](_0x1fafc5);})['then'](function(_0xb9f32){_0x1ac2cc[_0x055e('0xaa')]=_0xb9f32;return _0x1ac2cc;});}})['then'](respondWithFilteredResult(_0x2baf49,_0x1fafc5))['catch'](handleError(_0x2baf49,null));};exports[_0x055e('0xbc')]=function(_0x5cb9f6,_0x47c423,_0x24b914){return db['SmsInteraction'][_0x055e('0x6f')]({'where':{'id':_0x5cb9f6['params']['id']}})[_0x055e('0x29')](handleEntityNotFound(_0x47c423,null))[_0x055e('0x29')](function(_0x39f91b){if(_0x39f91b){return _0x39f91b[_0x055e('0xbd')](_0x5cb9f6[_0x055e('0x72')]['ids'],_['omit'](_0x5cb9f6[_0x055e('0x72')],[_0x055e('0xb4'),'id'])||{})[_0x055e('0xbe')](function(){return db[_0x055e('0x6a')]['findAll']({'attributes':['id',_0x055e('0x2d'),_0x055e('0x49')],'where':{'id':_0x5cb9f6['body'][_0x055e('0xb4')]}});})[_0x055e('0x29')](function(_0x14f015){socket[_0x055e('0xbf')](_0x055e('0xc0'),{'id':Number(_0x5cb9f6[_0x055e('0xac')]['id']),'tags':_0x14f015||[]});return{'id':Number(_0x5cb9f6['params']['id']),'tags':_0x14f015||[]};});}})[_0x055e('0x29')](respondWithResult(_0x47c423,null))[_0x055e('0x37')](handleError(_0x47c423,null));};exports[_0x055e('0xc1')]=function(_0x557c92,_0x38a846,_0x7d100){return db[_0x055e('0x39')]['find']({'where':{'id':_0x557c92['params']['id']}})[_0x055e('0x29')](handleEntityNotFound(_0x38a846,null))[_0x055e('0x29')](function(_0x5276cd){if(_0x5276cd){return _0x5276cd['removeTags'](_0x557c92[_0x055e('0x3e')]['ids']);}})[_0x055e('0x29')](respondWithStatusCode(_0x38a846,null))[_0x055e('0x37')](handleError(_0x38a846,null));};exports[_0x055e('0xc2')]=function(_0x4c7afc,_0x1423f4){var _0x31db97=moment()[_0x055e('0xc3')]()['toString']();var _0x306b88=path['join'](config[_0x055e('0xc4')],_0x055e('0xc5'),_0x055e('0xc6'),_0x055e('0xc7'));var _0x27fb93=path[_0x055e('0xc8')](config[_0x055e('0xc4')],_0x055e('0xc5'),_0x055e('0xc6'),_0x055e('0xc9'));var _0xb88a07=path['join'](_0x306b88,_0x31db97);var _0x4ce80e=util[_0x055e('0xca')](_0x055e('0xcb'),_0x4c7afc[_0x055e('0xac')]['id'],_0x31db97);var _0x45c0c6=path[_0x055e('0xc8')](_0x306b88,_0x4ce80e);var _0x4405ad=[];_0x4405ad['push']({'model':db[_0x055e('0x6d')],'as':_0x055e('0x6d'),'attributes':['id',_0x055e('0x31')],'raw':!![]});_0x4405ad[_0x055e('0x36')]({'model':db[_0x055e('0xcc')],'as':_0x055e('0x62'),'attributes':['id',_0x055e('0xcd'),_0x055e('0xce')],'raw':!![]});var _0x4900bc=[{'model':db[_0x055e('0xb3')],'as':_0x055e('0xcf'),'attributes':['id','body',_0x055e('0x78'),_0x055e('0xd0'),'secret',_0x055e('0x80')],'include':_0x4405ad}];_0x4900bc[_0x055e('0x36')]({'model':db[_0x055e('0xd1')],'as':'Account','attributes':['id',_0x055e('0x2d')]});_0x4900bc['push']({'model':db['User'],'as':_0x055e('0xd2'),'attributes':['id',_0x055e('0x31')]});return db[_0x055e('0x39')][_0x055e('0x6f')]({'where':{'id':_0x4c7afc[_0x055e('0xac')]['id']},'include':_0x4900bc})[_0x055e('0x29')](handleEntityNotFound(_0x1423f4,null))[_0x055e('0x29')](function(_0x144713){if(_0x144713){var _0x26c946=_0x144713[_0x055e('0xd3')]({'plain':!![]});fs[_0x055e('0xd4')](_0xb88a07);var _0x2a568c={'format':'A4','border':'10px','header':{'height':_0x055e('0xd5'),'contents':{'first':_0x055e('0xd6')}},'footer':{'height':_0x055e('0xd7'),'contents':{'default':util[_0x055e('0xca')](_0x055e('0xd8'),util[_0x055e('0xca')](_0x055e('0xd9'),'Sms',_0x26c946['id']),moment()[_0x055e('0xca')](_0x055e('0xda'))[_0x055e('0x98')]())}}};var _0x251e7a={'channel':_0x055e('0xdb'),'account':_0x26c946[_0x055e('0xdc')][_0x055e('0x2d')],'agent':_0x26c946[_0x055e('0xd2')]?_0x26c946[_0x055e('0xd2')][_0x055e('0x31')]:'N.A.','createdAt':moment(_0x26c946['createdAt'])[_0x055e('0xca')](_0x055e('0xb8'))[_0x055e('0x98')](),'closedAt':_0x26c946[_0x055e('0xdd')]?moment(_0x26c946[_0x055e('0xde')])['format'](_0x055e('0xb8'))[_0x055e('0x98')]():'','disposition':_0x26c946[_0x055e('0xdf')],'messages':_(_0x26c946[_0x055e('0xcf')])[_0x055e('0x85')]({'secret':![]})['map'](function(_0x279b39){return{'date':moment(_0x279b39[_0x055e('0x78')])[_0x055e('0xca')](_0x055e('0xb8'))[_0x055e('0x98')](),'sender':_0x279b39[_0x055e('0xd0')]===_0x055e('0xe0')?_0x279b39[_0x055e('0x6d')]?_0x279b39[_0x055e('0x6d')][_0x055e('0x31')]:_0x055e('0xe1'):_0x279b39['Contact'][_0x055e('0xcd')]+(_0x279b39['Contact'][_0x055e('0xce')]?'\x20'+_0x279b39[_0x055e('0x62')]['lastName']:''),'body':_0x279b39['body'],'direction':_0x279b39['direction']===_0x055e('0xe0')?'A':'C','secret':_0x279b39[_0x055e('0xe2')],'read':_0x279b39['read']};})[_0x055e('0x5f')]()};return ejs[_0x055e('0xe3')](path[_0x055e('0xc8')](config[_0x055e('0xc4')],_0x055e('0xc5'),_0x055e('0xe4'),'downloadInteraction.html'),{'interaction':_0x251e7a})[_0x055e('0x29')](function(_0x1523d9){return new BPromise(function(_0x562362,_0x22c7ef){pdf[_0x055e('0xb0')](_0x1523d9,_0x2a568c)['toFile'](path[_0x055e('0xc8')](_0xb88a07,_0x055e('0xe5')+_0x26c946['id']+'-'+_0x31db97+'.pdf'),function(_0x3c7f35,_0x51d323){if(_0x3c7f35)return _0x22c7ef(_0x3c7f35);_0x562362(_0x51d323);});});})[_0x055e('0x29')](function(){return new BPromise(function(_0x481ea0,_0xb60055){zipdir(_0xb88a07,{'saveTo':_0x45c0c6},function(_0x5819b5,_0x148621){if(_0x5819b5)return _0xb60055(_0x5819b5);return _0x481ea0(_0x148621);});})[_0x055e('0x29')](function(){return new BPromise(function(_0x26399c,_0x25011f){rimraf(_0xb88a07,function(_0xe83c1f){if(_0xe83c1f)_0x25011f(_0xe83c1f);return _0x26399c();});});})[_0x055e('0x29')](function(){return _0x1423f4[_0x055e('0xc2')](_0x45c0c6,_0x4ce80e,function(_0x197faf){if(_0x197faf){console['log'](_0x055e('0xe6'),_0x197faf);}else{fs['unlinkSync'](_0x45c0c6);}});});});}else{return _0x1423f4['sendStatus'](0xc8);}})[_0x055e('0x37')](handleError(_0x1423f4,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9e477fd..d81fc1f 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 _0x6921=['exports','../../mysqldb','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1ff7c5,_0x5c6e19){var _0x16fcdf=function(_0x34c8d7){while(--_0x34c8d7){_0x1ff7c5['push'](_0x1ff7c5['shift']());}};_0x16fcdf(++_0x5c6e19);}(_0x6921,0x1d1));var _0x1692=function(_0x180da6,_0x4cdee1){_0x180da6=_0x180da6-0x0;var _0xaba72c=_0x6921[_0x180da6];return _0xaba72c;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x1692('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x1692('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1692('0x1')](0x0);var events={'afterCreate':_0x1692('0x2'),'afterUpdate':'update','afterDestroy':_0x1692('0x3')};function emitEvent(_0x577497){return function(_0x4581c4,_0x39cc05,_0x15f20e){_0x4581c4[_0x1692('0x4')]({'attributes':['id'],'raw':!![]})[_0x1692('0x5')](function(_0x36d159){_0x4581c4[_0x1692('0x6')](_0x1692('0x7'),_0x36d159[_0x1692('0x8')](function(_0x38159b){return{'id':_0x38159b['id']};}));return SmsMessage[_0x1692('0x9')]({'where':{'SmsInteractionId':_0x4581c4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3dd25c){_0x4581c4['setDataValue'](_0x1692('0xa'),_0x3dd25c[_0x1692('0xb')]);SmsInteractionEvents[_0x1692('0xc')](_0x577497+':'+_0x4581c4['id'],_0x4581c4);SmsInteractionEvents[_0x1692('0xc')](_0x577497,_0x4581c4);_0x15f20e(null);})[_0x1692('0xd')](_0x15f20e(null));};}for(var e in events){if(events[_0x1692('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x1692('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xcb99=['length','emit','catch','hasOwnProperty','events','SmsInteraction','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x51db22,_0x198ad2){var _0x80faef=function(_0x8b4331){while(--_0x8b4331){_0x51db22['push'](_0x51db22['shift']());}};_0x80faef(++_0x198ad2);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4911ed,_0x476941){_0x4911ed=_0x4911ed-0x0;var _0x230288=_0xcb99[_0x4911ed];return _0x230288;};'use strict';var EventEmitter=require(_0x9cb9('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x9cb9('0x1')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9cb9('0x2')](0x0);var events={'afterCreate':_0x9cb9('0x3'),'afterUpdate':_0x9cb9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x167735){return function(_0x41788c,_0x544d32,_0x214b72){_0x41788c['getUsers']({'attributes':['id'],'raw':!![]})[_0x9cb9('0x5')](function(_0xa84493){_0x41788c[_0x9cb9('0x6')](_0x9cb9('0x7'),_0xa84493[_0x9cb9('0x8')](function(_0x124bd0){return{'id':_0x124bd0['id']};}));return SmsMessage[_0x9cb9('0x9')]({'where':{'SmsInteractionId':_0x41788c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9cb9('0x5')](function(_0x48d99a){_0x41788c['setDataValue'](_0x9cb9('0xa'),_0x48d99a[_0x9cb9('0xb')]);SmsInteractionEvents[_0x9cb9('0xc')](_0x167735+':'+_0x41788c['id'],_0x41788c);SmsInteractionEvents['emit'](_0x167735,_0x41788c);_0x214b72(null);})[_0x9cb9('0xd')](_0x214b72(null));};}for(var e in events){if(events[_0x9cb9('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fa6214d..a8939d3 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 _0x10df=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closedAt','format'];(function(_0x210acd,_0x5617de){var _0x9ae98a=function(_0x751aad){while(--_0x751aad){_0x210acd['push'](_0x210acd['shift']());}};_0x9ae98a(++_0x5617de);}(_0x10df,0xb1));var _0xf10d=function(_0x1cd585,_0x54276b){_0x1cd585=_0x1cd585-0x0;var _0x3ca87f=_0x10df[_0x1cd585];return _0x3ca87f;};'use strict';var _=require(_0xf10d('0x0'));var util=require(_0xf10d('0x1'));var logger=require(_0xf10d('0x2'))('api');var moment=require(_0xf10d('0x3'));var BPromise=require(_0xf10d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf10d('0x5'));var rimraf=require(_0xf10d('0x6'));var config=require(_0xf10d('0x7'));var attributes=require(_0xf10d('0x8'));module['exports']=function(_0x3d162d,_0x28bda9){return _0x3d162d[_0xf10d('0x9')](_0xf10d('0xa'),attributes,{'tableName':_0xf10d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe5226,_0x5803cf,_0x4c9c67){if(_0xe5226[_0xf10d('0xc')]('closed')){_0xe5226[_0xf10d('0xd')]=moment()[_0xf10d('0xe')](_0xf10d('0xf'));}_0x4c9c67(null,_0xe5226);}}});}; \ No newline at end of file +var _0xeda6=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define','sms_interactions','changed','closed'];(function(_0x4ac00b,_0x486aa9){var _0x3ed73f=function(_0x29fd28){while(--_0x29fd28){_0x4ac00b['push'](_0x4ac00b['shift']());}};_0x3ed73f(++_0x486aa9);}(_0xeda6,0xa7));var _0x6eda=function(_0x38e6c1,_0x65eb49){_0x38e6c1=_0x38e6c1-0x0;var _0x28d507=_0xeda6[_0x38e6c1];return _0x28d507;};'use strict';var _=require(_0x6eda('0x0'));var util=require(_0x6eda('0x1'));var logger=require('../../config/logger')(_0x6eda('0x2'));var moment=require(_0x6eda('0x3'));var BPromise=require(_0x6eda('0x4'));var rp=require(_0x6eda('0x5'));var fs=require('fs');var path=require(_0x6eda('0x6'));var rimraf=require('rimraf');var config=require(_0x6eda('0x7'));var attributes=require(_0x6eda('0x8'));module['exports']=function(_0x3ab5ef,_0x1002fe){return _0x3ab5ef[_0x6eda('0x9')]('SmsInteraction',attributes,{'tableName':_0x6eda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd9da8,_0x282fa2,_0xc46ba1){if(_0xd9da8[_0x6eda('0xb')](_0x6eda('0xc'))){_0xd9da8[_0x6eda('0xd')]=moment()['format'](_0x6eda('0xe'));}_0xc46ba1(null,_0xd9da8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c17567e..bc8d8b6 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 _0x97cc=['http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','body','options','raw','where','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xe5041d,_0x2559a9){var _0x16cce7=function(_0x538a8d){while(--_0x538a8d){_0xe5041d['push'](_0xe5041d['shift']());}};_0x16cce7(++_0x2559a9);}(_0x97cc,0x1e4));var _0xc97c=function(_0x21b7ec,_0x446c89){_0x21b7ec=_0x21b7ec-0x0;var _0x5a2909=_0x97cc[_0x21b7ec];return _0x5a2909;};'use strict';var _=require('lodash');var util=require(_0xc97c('0x0'));var moment=require('moment');var BPromise=require(_0xc97c('0x1'));var rs=require(_0xc97c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc97c('0x3'))['db'];var utils=require(_0xc97c('0x4'));var logger=require(_0xc97c('0x5'))('rpc');var config=require(_0xc97c('0x6'));var jayson=require(_0xc97c('0x7'));var client=jayson['client'][_0xc97c('0x8')]({'port':0x232a});config[_0xc97c('0x9')]=_['defaults'](config[_0xc97c('0x9')],{'host':_0xc97c('0xa'),'port':0x18eb});var socket=require(_0xc97c('0xb'))(new Redis(config['redis']));require(_0xc97c('0xc'))[_0xc97c('0xd')](socket);function respondWithRpcPromise(_0x294059,_0x55d478,_0x5765e2){return new BPromise(function(_0x27d770,_0x1b03a1){return client[_0xc97c('0xe')](_0x294059,_0x5765e2)[_0xc97c('0xf')](function(_0x26e58e){logger[_0xc97c('0x10')](_0xc97c('0x11'),_0x55d478,_0xc97c('0x12'));logger[_0xc97c('0x13')](_0xc97c('0x14'),_0x55d478,_0xc97c('0x12'),JSON[_0xc97c('0x15')](_0x26e58e));if(_0x26e58e[_0xc97c('0x16')]){if(_0x26e58e[_0xc97c('0x16')][_0xc97c('0x17')]===0x1f4){logger[_0xc97c('0x16')](_0xc97c('0x11'),_0x55d478,_0x26e58e['error']['message']);return _0x1b03a1(_0x26e58e[_0xc97c('0x16')][_0xc97c('0x18')]);}logger[_0xc97c('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x55d478,_0x26e58e[_0xc97c('0x16')]['message']);return _0x27d770(_0x26e58e[_0xc97c('0x16')]['message']);}else{logger[_0xc97c('0x10')](_0xc97c('0x11'),_0x55d478,_0xc97c('0x12'));_0x27d770(_0x26e58e[_0xc97c('0x19')][_0xc97c('0x18')]);}})[_0xc97c('0x1a')](function(_0x4797f8){logger[_0xc97c('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x55d478,_0x4797f8);_0x1b03a1(_0x4797f8);});});}exports['UpdateSmsInteraction']=function(_0x204212){var _0x968c2b=this;return new Promise(function(_0x5587f0,_0x49b88b){return db[_0xc97c('0x1b')][_0xc97c('0x1c')](_0x204212[_0xc97c('0x1d')],{'raw':_0x204212[_0xc97c('0x1e')]?_0x204212[_0xc97c('0x1e')][_0xc97c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x204212[_0xc97c('0x1e')]?_0x204212[_0xc97c('0x1e')][_0xc97c('0x20')]||null:null,'attributes':_0x204212[_0xc97c('0x1e')]?_0x204212['options']['attributes']||null:null,'limit':_0x204212[_0xc97c('0x1e')]?_0x204212[_0xc97c('0x1e')][_0xc97c('0x21')]||null:null})[_0xc97c('0xf')](function(_0x440fbd){logger[_0xc97c('0x10')](_0xc97c('0x22'),_0x204212);logger['debug'](_0xc97c('0x22'),_0x204212,JSON['stringify'](_0x440fbd));_0x5587f0(_0x440fbd);})[_0xc97c('0x1a')](function(_0x50e107){logger[_0xc97c('0x16')](_0xc97c('0x22'),_0x50e107[_0xc97c('0x18')],_0x204212);_0x49b88b(_0x968c2b['error'](0x1f4,_0x50e107[_0xc97c('0x18')]));});});};exports[_0xc97c('0x23')]=function(_0x20216d){return new Promise(function(_0x1fa28c,_0x4bd23d){return db[_0xc97c('0x1b')][_0xc97c('0x24')]({'where':_0x20216d[_0xc97c('0x1e')]?_0x20216d[_0xc97c('0x1e')][_0xc97c('0x20')]||null:null})['then'](function(_0x45eeca){if(_0x45eeca){return _0x45eeca[_0xc97c('0x25')](_0x20216d[_0xc97c('0x1d')]['ids'],_['omit'](_0x20216d['body'],[_0xc97c('0x26'),'id'])||{});}})[_0xc97c('0x27')](function(_0x4eb0e0){logger[_0xc97c('0x10')](_0xc97c('0x28'),_0x20216d);logger[_0xc97c('0x13')]('AddTags',_0x20216d,JSON[_0xc97c('0x15')](_0x4eb0e0));_0x1fa28c(_0x4eb0e0);})[_0xc97c('0x1a')](function(_0x2b35b0){logger[_0xc97c('0x16')](_0xc97c('0x28'),_0x2b35b0[_0xc97c('0x18')],_0x20216d);_0x4bd23d(_this[_0xc97c('0x16')](0x1f4,_0x2b35b0[_0xc97c('0x18')]));});});}; \ No newline at end of file +var _0xbb64=['socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','attributes','stringify','find','where','addTags','body','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2bb465,_0x5e00ee){var _0x1a4ce5=function(_0x18ef51){while(--_0x18ef51){_0x2bb465['push'](_0x2bb465['shift']());}};_0x1a4ce5(++_0x5e00ee);}(_0xbb64,0x118));var _0x4bb6=function(_0x27440c,_0x56558b){_0x27440c=_0x27440c-0x0;var _0xda47ee=_0xbb64[_0x27440c];return _0xda47ee;};'use strict';var _=require(_0x4bb6('0x0'));var util=require(_0x4bb6('0x1'));var moment=require('moment');var BPromise=require(_0x4bb6('0x2'));var rs=require(_0x4bb6('0x3'));var fs=require('fs');var Redis=require(_0x4bb6('0x4'));var db=require(_0x4bb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4bb6('0x6'))(_0x4bb6('0x7'));var config=require(_0x4bb6('0x8'));var jayson=require(_0x4bb6('0x9'));var client=jayson[_0x4bb6('0xa')][_0x4bb6('0xb')]({'port':0x232a});config[_0x4bb6('0xc')]=_[_0x4bb6('0xd')](config[_0x4bb6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4bb6('0xe'))(new Redis(config[_0x4bb6('0xc')]));require(_0x4bb6('0xf'))[_0x4bb6('0x10')](socket);function respondWithRpcPromise(_0x149cf6,_0x12aad4,_0x18aa3e){return new BPromise(function(_0x41d983,_0x254352){return client[_0x4bb6('0x11')](_0x149cf6,_0x18aa3e)[_0x4bb6('0x12')](function(_0x55e1a9){logger[_0x4bb6('0x13')](_0x4bb6('0x14'),_0x12aad4,'request\x20sent');logger[_0x4bb6('0x15')](_0x4bb6('0x16'),_0x12aad4,_0x4bb6('0x17'),JSON['stringify'](_0x55e1a9));if(_0x55e1a9['error']){if(_0x55e1a9[_0x4bb6('0x18')][_0x4bb6('0x19')]===0x1f4){logger[_0x4bb6('0x18')](_0x4bb6('0x14'),_0x12aad4,_0x55e1a9[_0x4bb6('0x18')][_0x4bb6('0x1a')]);return _0x254352(_0x55e1a9[_0x4bb6('0x18')][_0x4bb6('0x1a')]);}logger[_0x4bb6('0x18')](_0x4bb6('0x14'),_0x12aad4,_0x55e1a9[_0x4bb6('0x18')][_0x4bb6('0x1a')]);return _0x41d983(_0x55e1a9[_0x4bb6('0x18')][_0x4bb6('0x1a')]);}else{logger['info'](_0x4bb6('0x14'),_0x12aad4,_0x4bb6('0x17'));_0x41d983(_0x55e1a9['result']['message']);}})[_0x4bb6('0x1b')](function(_0x2f4b1c){logger['error'](_0x4bb6('0x14'),_0x12aad4,_0x2f4b1c);_0x254352(_0x2f4b1c);});});}exports[_0x4bb6('0x1c')]=function(_0x4dab4b){var _0x474576=this;return new Promise(function(_0x353274,_0x471680){return db[_0x4bb6('0x1d')][_0x4bb6('0x1e')](_0x4dab4b['body'],{'raw':_0x4dab4b[_0x4bb6('0x1f')]?_0x4dab4b['options'][_0x4bb6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dab4b['options']?_0x4dab4b[_0x4bb6('0x1f')]['where']||null:null,'attributes':_0x4dab4b[_0x4bb6('0x1f')]?_0x4dab4b[_0x4bb6('0x1f')][_0x4bb6('0x21')]||null:null,'limit':_0x4dab4b[_0x4bb6('0x1f')]?_0x4dab4b[_0x4bb6('0x1f')]['limit']||null:null})[_0x4bb6('0x12')](function(_0x233880){logger[_0x4bb6('0x13')]('UpdateSmsInteraction',_0x4dab4b);logger[_0x4bb6('0x15')](_0x4bb6('0x1c'),_0x4dab4b,JSON[_0x4bb6('0x22')](_0x233880));_0x353274(_0x233880);})[_0x4bb6('0x1b')](function(_0x19c4f7){logger[_0x4bb6('0x18')]('UpdateSmsInteraction',_0x19c4f7[_0x4bb6('0x1a')],_0x4dab4b);_0x471680(_0x474576[_0x4bb6('0x18')](0x1f4,_0x19c4f7[_0x4bb6('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x1b85ec){return new Promise(function(_0x4aad5a,_0x3f3be9){return db[_0x4bb6('0x1d')][_0x4bb6('0x23')]({'where':_0x1b85ec['options']?_0x1b85ec['options'][_0x4bb6('0x24')]||null:null})['then'](function(_0x504da4){if(_0x504da4){return _0x504da4[_0x4bb6('0x25')](_0x1b85ec[_0x4bb6('0x26')]['ids'],_[_0x4bb6('0x27')](_0x1b85ec['body'],['ids','id'])||{});}})[_0x4bb6('0x28')](function(_0x31cba0){logger['info'](_0x4bb6('0x29'),_0x1b85ec);logger[_0x4bb6('0x15')](_0x4bb6('0x29'),_0x1b85ec,JSON[_0x4bb6('0x22')](_0x31cba0));_0x4aad5a(_0x31cba0);})[_0x4bb6('0x1b')](function(_0x58cdb){logger['error']('AddTags',_0x58cdb[_0x4bb6('0x1a')],_0x1b85ec);_0x3f3be9(_this[_0x4bb6('0x18')](0x1f4,_0x58cdb[_0x4bb6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 558bdea..e091b66 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 _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x2f53bd,_0x3fcfcb){var _0x295808=function(_0x26dbc2){while(--_0x26dbc2){_0x2f53bd['push'](_0x2f53bd['shift']());}};_0x295808(++_0x3fcfcb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x489fb7,_0xe0d692){var _0x4815e0=function(_0x39eb63){while(--_0x39eb63){_0x489fb7['push'](_0x489fb7['shift']());}};_0x4815e0(++_0xe0d692);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2024053..8825a87 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 _0x9c0e=['/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index'];(function(_0x565989,_0x3f31f0){var _0xa5b3e7=function(_0x3dd797){while(--_0x3dd797){_0x565989['push'](_0x565989['shift']());}};_0xa5b3e7(++_0x3f31f0);}(_0x9c0e,0x16d));var _0xe9c0=function(_0x3a03e2,_0x9d46f7){_0x3a03e2=_0x3a03e2-0x0;var _0x557b6c=_0x9c0e[_0x3a03e2];return _0x557b6c;};'use strict';var multer=require(_0xe9c0('0x0'));var util=require(_0xe9c0('0x1'));var path=require(_0xe9c0('0x2'));var timeout=require(_0xe9c0('0x3'));var express=require('express');var router=express[_0xe9c0('0x4')]();var auth=require(_0xe9c0('0x5'));var interaction=require(_0xe9c0('0x6'));var config=require(_0xe9c0('0x7'));var controller=require(_0xe9c0('0x8'));router[_0xe9c0('0x9')]('/',auth[_0xe9c0('0xa')](),controller[_0xe9c0('0xb')]);router[_0xe9c0('0x9')](_0xe9c0('0xc'),auth['isAuthenticated'](),controller[_0xe9c0('0xd')]);router['get']('/:id',auth[_0xe9c0('0xa')](),controller[_0xe9c0('0xe')]);router[_0xe9c0('0xf')]('/',auth[_0xe9c0('0xa')](),interaction[_0xe9c0('0x10')](_0xe9c0('0x11'),_0xe9c0('0x12')),controller[_0xe9c0('0x13')]);router['post'](_0xe9c0('0x14'),controller[_0xe9c0('0x15')]);router[_0xe9c0('0x16')](_0xe9c0('0x17'),auth[_0xe9c0('0xa')](),controller['update']);router['put'](_0xe9c0('0x18'),auth[_0xe9c0('0xa')](),controller[_0xe9c0('0x19')]);router[_0xe9c0('0x16')](_0xe9c0('0x1a'),auth[_0xe9c0('0xa')](),controller['reject']);router[_0xe9c0('0x1b')](_0xe9c0('0x17'),auth['isAuthenticated'](),controller[_0xe9c0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x3f70=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','post','tracked','smsmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1b8f2b,_0x987af7){var _0xc0b07f=function(_0x17a8e4){while(--_0x17a8e4){_0x1b8f2b['push'](_0x1b8f2b['shift']());}};_0xc0b07f(++_0x987af7);}(_0x3f70,0x164));var _0x03f7=function(_0x396a1c,_0x303068){_0x396a1c=_0x396a1c-0x0;var _0x4baaee=_0x3f70[_0x396a1c];return _0x4baaee;};'use strict';var multer=require(_0x03f7('0x0'));var util=require(_0x03f7('0x1'));var path=require('path');var timeout=require(_0x03f7('0x2'));var express=require('express');var router=express[_0x03f7('0x3')]();var auth=require(_0x03f7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x03f7('0x5')]('/',auth[_0x03f7('0x6')](),controller[_0x03f7('0x7')]);router[_0x03f7('0x5')](_0x03f7('0x8'),auth['isAuthenticated'](),controller[_0x03f7('0x9')]);router['get']('/:id',auth[_0x03f7('0x6')](),controller['show']);router[_0x03f7('0xa')]('/',auth[_0x03f7('0x6')](),interaction[_0x03f7('0xb')]('sms',_0x03f7('0xc')),controller[_0x03f7('0xd')]);router['post'](_0x03f7('0xe'),controller[_0x03f7('0xf')]);router['put'](_0x03f7('0x10'),auth[_0x03f7('0x6')](),controller[_0x03f7('0x11')]);router[_0x03f7('0x12')](_0x03f7('0x13'),auth[_0x03f7('0x6')](),controller['accept']);router[_0x03f7('0x12')](_0x03f7('0x14'),auth[_0x03f7('0x6')](),controller['reject']);router[_0x03f7('0x15')](_0x03f7('0x10'),auth[_0x03f7('0x6')](),controller[_0x03f7('0x16')]);module[_0x03f7('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 64ba2f8..bd59b8b 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 _0x8150=['ENUM','out','STRING','medium','BOOLEAN'];(function(_0x37d9e3,_0x21943b){var _0x312890=function(_0x3ab969){while(--_0x3ab969){_0x37d9e3['push'](_0x37d9e3['shift']());}};_0x312890(++_0x21943b);}(_0x8150,0x1a7));var _0x0815=function(_0x3aecba,_0x23332f){_0x3aecba=_0x3aecba-0x0;var _0x4a07ac=_0x8150[_0x3aecba];return _0x4a07ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x0815('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x0815('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0815('0x2')]('in',_0x0815('0x3')),'defaultValue':_0x0815('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0815('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0815('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x7899=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7899,0x168));var _0x9789=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x7899[_0x15ca1a];return _0x507626;};'use strict';var Sequelize=require(_0x9789('0x0'));module[_0x9789('0x1')]={'body':{'type':Sequelize[_0x9789('0x2')](_0x9789('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9789('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9789('0x5')]('in',_0x9789('0x6')),'defaultValue':_0x9789('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9789('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x9789('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 4d541b8..36ff3af 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 _0xee11=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteractionId','isNil','read1stAt','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','manual','interface','channel','event','EventManager','acceptmessage','reject','sms','agent','SmsInteraction','interaction','RejectMessage','rejectMessage','SIP/%s','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','DELIVERED','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.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','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','count','offset','limit','Content-Range','save','update','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','describe','sms-interactions','accept'];(function(_0x2a9363,_0x1d9f52){var _0x3480dd=function(_0x26efc8){while(--_0x26efc8){_0x2a9363['push'](_0x2a9363['shift']());}};_0x3480dd(++_0x1d9f52);}(_0xee11,0x146));var _0x1ee1=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xee11[_0x5c6299];return _0x23b564;};'use strict';var pdf=require(_0x1ee1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1ee1('0x1'));var jsonpatch=require(_0x1ee1('0x2'));var rp=require(_0x1ee1('0x3'));var moment=require(_0x1ee1('0x4'));var BPromise=require(_0x1ee1('0x5'));var Mustache=require(_0x1ee1('0x6'));var util=require(_0x1ee1('0x7'));var path=require(_0x1ee1('0x8'));var sox=require('sox');var csv=require(_0x1ee1('0x9'));var ejs=require(_0x1ee1('0xa'));var fs=require('fs');var _=require(_0x1ee1('0xb'));var squel=require(_0x1ee1('0xc'));var crypto=require(_0x1ee1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ee1('0x9'));var querystring=require(_0x1ee1('0xe'));var Papa=require(_0x1ee1('0xf'));var Redis=require(_0x1ee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1ee1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ee1('0x12'));var logger=require(_0x1ee1('0x13'))(_0x1ee1('0x14'));var utils=require(_0x1ee1('0x15'));var config=require('../../config/environment');var db=require(_0x1ee1('0x16'))['db'];config[_0x1ee1('0x17')]=_['defaults'](config[_0x1ee1('0x17')],{'host':_0x1ee1('0x18'),'port':0x18eb});var socket=require(_0x1ee1('0x19'))(new Redis(config[_0x1ee1('0x17')]));require(_0x1ee1('0x1a'))[_0x1ee1('0x1b')](socket);var jayson=require(_0x1ee1('0x1c'));var client=jayson[_0x1ee1('0x1d')][_0x1ee1('0x1e')]({'port':0x232c});var client9002=jayson[_0x1ee1('0x1d')][_0x1ee1('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x443dff,_0x3c64f1,_0x3a19db){if(_0x3a19db){var _0x4828ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4828ba['test'](_0x3c64f1)){return _0x443dff;}else{throw new db[(_0x1ee1('0x1f'))][(_0x1ee1('0x20'))](_0x1ee1('0x21'));}}else{return _0x443dff;}}function respondWithRpcPromise(_0x2752ba,_0x1e18b9,_0xff3d76,_0x55abff){return new BPromise(function(_0x39229e,_0x3c97aa){var _0x5c380f=_0x55abff||client;return _0x5c380f[_0x1ee1('0x22')](_0x2752ba,_0xff3d76)[_0x1ee1('0x23')](function(_0x4819de){logger['info'](_0x1ee1('0x24'),_0x1e18b9,_0x1ee1('0x25'));logger[_0x1ee1('0x26')](_0x1ee1('0x27'),_0x1e18b9,'request\x20sent',JSON[_0x1ee1('0x28')](_0x4819de));if(_0x4819de[_0x1ee1('0x29')]){if(_0x4819de[_0x1ee1('0x29')]['code']===0x1f4){logger[_0x1ee1('0x29')](_0x1ee1('0x24'),_0x1e18b9,_0x4819de[_0x1ee1('0x29')][_0x1ee1('0x2a')]);return _0x3c97aa(_0x4819de[_0x1ee1('0x29')][_0x1ee1('0x2a')]);}logger['error'](_0x1ee1('0x24'),_0x1e18b9,_0x4819de['error']['message']);return _0x39229e(_0x4819de[_0x1ee1('0x29')][_0x1ee1('0x2a')]);}else{logger['info'](_0x1ee1('0x24'),_0x1e18b9,_0x1ee1('0x25'));_0x39229e(_0x4819de[_0x1ee1('0x2b')][_0x1ee1('0x2a')]);}})[_0x1ee1('0x2c')](function(_0x12c583){logger['error'](_0x1ee1('0x24'),_0x1e18b9,_0x12c583);_0x3c97aa(_0x12c583);});});}function respondWithStatusCode(_0x8a95d8,_0x1784b4){_0x1784b4=_0x1784b4||0xcc;return function(_0x11ce8d){if(_0x11ce8d){return _0x8a95d8[_0x1ee1('0x2d')](_0x1784b4);}return _0x8a95d8[_0x1ee1('0x2e')](_0x1784b4)['end']();};}function respondWithResult(_0x19e4cc,_0x576bf4){_0x576bf4=_0x576bf4||0xc8;return function(_0x1fab9d){if(_0x1fab9d){return _0x19e4cc[_0x1ee1('0x2e')](_0x576bf4)['json'](_0x1fab9d);}};}function respondWithFilteredResult(_0x53d2b3,_0x444ed9){return function(_0xfd544d){if(_0xfd544d){var _0xf63d67=_0xfd544d[_0x1ee1('0x2f')],_0x209592=_0x444ed9[_0x1ee1('0x30')],_0x49241e=_0x444ed9[_0x1ee1('0x30')]+_0x444ed9[_0x1ee1('0x31')],_0x4b9ea4;if(_0x49241e>=_0xf63d67){_0x49241e=_0xf63d67;_0x4b9ea4=0xc8;}else{_0x4b9ea4=0xce;}_0x53d2b3['status'](_0x4b9ea4);return _0x53d2b3['set'](_0x1ee1('0x32'),_0x209592+'-'+_0x49241e+'/'+_0xf63d67)['json'](_0xfd544d);}return null;};}function patchUpdates(_0x25fb77){return function(_0x2a6883){try{jsonpatch['apply'](_0x2a6883,_0x25fb77,!![]);}catch(_0x2fe0a8){return BPromise['reject'](_0x2fe0a8);}return _0x2a6883[_0x1ee1('0x33')]();};}function saveUpdates(_0x4866a9,_0x285110){return function(_0x48a147){if(_0x48a147){return _0x48a147[_0x1ee1('0x34')](_0x4866a9)[_0x1ee1('0x23')](function(_0x513124){return _0x513124;});}return null;};}function removeEntity(_0x4cc56e,_0x3a2746){return function(_0x2d8ac3){if(_0x2d8ac3){return _0x2d8ac3['destroy']()[_0x1ee1('0x23')](function(){_0x4cc56e[_0x1ee1('0x2e')](0xcc)[_0x1ee1('0x35')]();});}};}function handleEntityNotFound(_0x3d9e0a,_0x40964d){return function(_0x71f867){if(!_0x71f867){_0x3d9e0a[_0x1ee1('0x2d')](0x194);}return _0x71f867;};}function handleError(_0x29011b,_0x24ca9e){_0x24ca9e=_0x24ca9e||0x1f4;return function(_0xb651ba){logger[_0x1ee1('0x29')](_0xb651ba[_0x1ee1('0x36')]);if(_0xb651ba[_0x1ee1('0x37')]){delete _0xb651ba[_0x1ee1('0x37')];}_0x29011b[_0x1ee1('0x2e')](_0x24ca9e)[_0x1ee1('0x38')](_0xb651ba);};}exports[_0x1ee1('0x39')]=function(_0x307b0e,_0x435013){var _0xb20ad8={},_0x175da4={},_0x2733a={'count':0x0,'rows':[]};var _0x493e0c=_[_0x1ee1('0x3a')](db[_0x1ee1('0x3b')][_0x1ee1('0x3c')],function(_0x14d787){return{'name':_0x14d787[_0x1ee1('0x3d')],'type':_0x14d787[_0x1ee1('0x3e')][_0x1ee1('0x3f')]};});_0x175da4[_0x1ee1('0x40')]=_[_0x1ee1('0x3a')](_0x493e0c,_0x1ee1('0x37'));_0x175da4[_0x1ee1('0x41')]=_[_0x1ee1('0x42')](_0x307b0e['query']);_0x175da4[_0x1ee1('0x43')]=_[_0x1ee1('0x44')](_0x175da4[_0x1ee1('0x40')],_0x175da4[_0x1ee1('0x41')]);_0xb20ad8[_0x1ee1('0x45')]=_[_0x1ee1('0x44')](_0x175da4[_0x1ee1('0x40')],qs['fields'](_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x46')]));_0xb20ad8['attributes']=_0xb20ad8[_0x1ee1('0x45')]['length']?_0xb20ad8['attributes']:_0x175da4[_0x1ee1('0x40')];if(!_0x307b0e[_0x1ee1('0x41')]['hasOwnProperty'](_0x1ee1('0x47'))){_0xb20ad8[_0x1ee1('0x31')]=qs[_0x1ee1('0x31')](_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x31')]);_0xb20ad8['offset']=qs['offset'](_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x30')]);}_0xb20ad8[_0x1ee1('0x48')]=qs[_0x1ee1('0x49')](_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x49')]);_0xb20ad8[_0x1ee1('0x4a')]=qs['filters'](_[_0x1ee1('0x4b')](_0x307b0e['query'],_0x175da4[_0x1ee1('0x43')]),_0x493e0c);if(_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x4c')]){_0xb20ad8[_0x1ee1('0x4a')]=_[_0x1ee1('0x4d')](_0xb20ad8[_0x1ee1('0x4a')],{'$or':_[_0x1ee1('0x3a')](_0x493e0c,function(_0xe22f5a){if(_0xe22f5a[_0x1ee1('0x3e')]!==_0x1ee1('0x4e')){var _0x576bc3={};_0x576bc3[_0xe22f5a[_0x1ee1('0x37')]]={'$like':'%'+_0x307b0e[_0x1ee1('0x41')][_0x1ee1('0x4c')]+'%'};return _0x576bc3;}})});}_0xb20ad8=_['merge']({},_0xb20ad8,_0x307b0e[_0x1ee1('0x4f')]);var _0x81fe7e={'where':_0xb20ad8[_0x1ee1('0x4a')]};return db['SmsMessage'][_0x1ee1('0x2f')](_0x81fe7e)[_0x1ee1('0x23')](function(_0x423b28){_0x2733a[_0x1ee1('0x2f')]=_0x423b28;if(_0x307b0e['query'][_0x1ee1('0x50')]){_0xb20ad8[_0x1ee1('0x51')]=[{'all':!![]}];}return db[_0x1ee1('0x3b')][_0x1ee1('0x52')](_0xb20ad8);})['then'](function(_0x5baf2f){_0x2733a[_0x1ee1('0x53')]=_0x5baf2f;return _0x2733a;})[_0x1ee1('0x23')](respondWithFilteredResult(_0x435013,_0xb20ad8))[_0x1ee1('0x2c')](handleError(_0x435013,null));};exports[_0x1ee1('0x54')]=function(_0x5b9a65,_0x920f1c){var _0x26d977={'raw':!![],'where':{'id':_0x5b9a65[_0x1ee1('0x55')]['id']}},_0x515ef0={};_0x515ef0[_0x1ee1('0x40')]=_[_0x1ee1('0x42')](db[_0x1ee1('0x3b')][_0x1ee1('0x3c')]);_0x515ef0[_0x1ee1('0x41')]=_['keys'](_0x5b9a65[_0x1ee1('0x41')]);_0x515ef0[_0x1ee1('0x43')]=_[_0x1ee1('0x44')](_0x515ef0[_0x1ee1('0x40')],_0x515ef0[_0x1ee1('0x41')]);_0x26d977[_0x1ee1('0x45')]=_['intersection'](_0x515ef0['model'],qs[_0x1ee1('0x46')](_0x5b9a65[_0x1ee1('0x41')]['fields']));_0x26d977['attributes']=_0x26d977[_0x1ee1('0x45')][_0x1ee1('0x56')]?_0x26d977[_0x1ee1('0x45')]:_0x515ef0['model'];if(_0x5b9a65[_0x1ee1('0x41')][_0x1ee1('0x50')]){_0x26d977[_0x1ee1('0x51')]=[{'all':!![]}];}_0x26d977=_[_0x1ee1('0x4d')]({},_0x26d977,_0x5b9a65[_0x1ee1('0x4f')]);return db[_0x1ee1('0x3b')][_0x1ee1('0x57')](_0x26d977)[_0x1ee1('0x23')](handleEntityNotFound(_0x920f1c,null))['then'](respondWithResult(_0x920f1c,null))['catch'](handleError(_0x920f1c,null));};exports[_0x1ee1('0x58')]=function(_0x51b0a5,_0x4ac90f){return db[_0x1ee1('0x3b')]['create'](_0x51b0a5['body'],{})[_0x1ee1('0x23')](respondWithResult(_0x4ac90f,0xc9))[_0x1ee1('0x2c')](handleError(_0x4ac90f,null));};exports['update']=function(_0x476c6f,_0x5bcfae){if(_0x476c6f[_0x1ee1('0x59')]['id']){delete _0x476c6f[_0x1ee1('0x59')]['id'];}return db['SmsMessage'][_0x1ee1('0x57')]({'where':{'id':_0x476c6f[_0x1ee1('0x55')]['id']}})[_0x1ee1('0x23')](handleEntityNotFound(_0x5bcfae,null))[_0x1ee1('0x23')](saveUpdates(_0x476c6f[_0x1ee1('0x59')],null))[_0x1ee1('0x23')](respondWithResult(_0x5bcfae,null))[_0x1ee1('0x2c')](handleError(_0x5bcfae,null));};exports[_0x1ee1('0x5a')]=function(_0x1e14a0,_0x50ca94){return db[_0x1ee1('0x3b')][_0x1ee1('0x57')]({'where':{'id':_0x1e14a0['params']['id']}})[_0x1ee1('0x23')](handleEntityNotFound(_0x50ca94,null))[_0x1ee1('0x23')](removeEntity(_0x50ca94,null))['catch'](handleError(_0x50ca94,null));};exports['describe']=function(_0x1c05b4,_0x2bde09){return db['SmsMessage'][_0x1ee1('0x5b')]()['then'](respondWithResult(_0x2bde09,null))[_0x1ee1('0x2c')](handleError(_0x2bde09,null));};var interaction_log=require(_0x1ee1('0x13'))(_0x1ee1('0x5c'));exports[_0x1ee1('0x5d')]=function(_0x6fde4,_0x2eb7c3,_0x5e6149){var _0x3dd8e4={'channel':'sms'};if(_0x6fde4[_0x1ee1('0x59')]['id']){delete _0x6fde4[_0x1ee1('0x59')]['id'];}_0x6fde4[_0x1ee1('0x59')][_0x1ee1('0x5e')]=!![];_0x6fde4[_0x1ee1('0x59')][_0x1ee1('0x5f')]=moment()[_0x1ee1('0x60')](_0x1ee1('0x61'));_0x6fde4[_0x1ee1('0x59')]['UserId']=_0x6fde4[_0x1ee1('0x59')][_0x1ee1('0x62')]||_0x6fde4[_0x1ee1('0x63')]['id'];return db['SmsMessage'][_0x1ee1('0x57')]({'where':{'id':_0x6fde4[_0x1ee1('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x1ee1('0x64')],'as':_0x1ee1('0x65')}]})[_0x1ee1('0x23')](handleEntityNotFound(_0x2eb7c3,null))[_0x1ee1('0x23')](saveUpdates(_0x6fde4[_0x1ee1('0x59')],null))[_0x1ee1('0x23')](function(_0x2792ff){if(_0x2792ff){_0x3dd8e4[_0x1ee1('0x2a')]=_0x2792ff[_0x1ee1('0x66')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2792ff[_0x1ee1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x2eb7c3,null))['then'](function(_0x21080b){if(_0x21080b){return _0x21080b[_0x1ee1('0x34')]({'UserId':_0x6fde4['body']['UserId'],'read1stAt':_[_0x1ee1('0x68')](_0x21080b[_0x1ee1('0x69')])?moment()[_0x1ee1('0x60')](_0x1ee1('0x61')):undefined});}return null;})[_0x1ee1('0x23')](function(_0x394add){if(_0x394add){_0x3dd8e4['interaction']=_0x394add[_0x1ee1('0x66')]({'plain':!![]});interaction_log[_0x1ee1('0x6a')](_0x1ee1('0x6b'),_0x6fde4[_0x1ee1('0x63')]['id'],_0x6fde4[_0x1ee1('0x63')]['name'],_0x6fde4[_0x1ee1('0x63')][_0x1ee1('0x6c')],_0x3dd8e4['interaction']['id'],_0x6fde4[_0x1ee1('0x59')]?JSON['stringify'](_0x6fde4[_0x1ee1('0x59')]):_0x1ee1('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3dd8e4);}return null;})[_0x1ee1('0x23')](function(_0x961d50){if(_0x961d50){if(_0x6fde4[_0x1ee1('0x59')][_0x1ee1('0x6e')]){_0x3dd8e4[_0x1ee1('0x2a')][_0x1ee1('0x6f')]=util[_0x1ee1('0x60')]('SIP/%s',_0x6fde4['user'][_0x1ee1('0x37')]);_0x3dd8e4[_0x1ee1('0x2a')]['channel']=_0x3dd8e4[_0x1ee1('0x70')];_0x3dd8e4['message'][_0x1ee1('0x71')]=_0x1ee1('0x5d');return respondWithRpcPromise(_0x1ee1('0x72'),_0x1ee1('0x72'),{'event':_0x1ee1('0x73'),'message':_0x3dd8e4['message']},client9002)[_0x1ee1('0x23')](function(){return _0x3dd8e4;});}return _0x3dd8e4;}return null;})[_0x1ee1('0x23')](respondWithResult(_0x2eb7c3,null))[_0x1ee1('0x2c')](handleError(_0x2eb7c3,null));};var interaction_log=require(_0x1ee1('0x13'))(_0x1ee1('0x5c'));exports[_0x1ee1('0x74')]=function(_0x5dde57,_0x619c37,_0x48a77a){var _0x12394e={'agent':{},'channel':_0x1ee1('0x75')};if(_0x5dde57['body']['id']){delete _0x5dde57['body']['id'];}_0x5dde57[_0x1ee1('0x59')][_0x1ee1('0x62')]=_0x5dde57[_0x1ee1('0x59')][_0x1ee1('0x62')]||_0x5dde57[_0x1ee1('0x63')]['id'];_0x12394e[_0x1ee1('0x76')]['id']=_0x5dde57[_0x1ee1('0x59')][_0x1ee1('0x62')];return db[_0x1ee1('0x3b')][_0x1ee1('0x57')]({'where':{'id':_0x5dde57[_0x1ee1('0x55')]['id'],'UserId':null}})[_0x1ee1('0x23')](handleEntityNotFound(_0x619c37,null))[_0x1ee1('0x23')](function(_0x17a8f9){if(_0x17a8f9){_0x12394e[_0x1ee1('0x2a')]=_0x17a8f9[_0x1ee1('0x66')]({'plain':!![]});return db[_0x1ee1('0x77')][_0x1ee1('0x57')]({'where':{'id':_0x17a8f9[_0x1ee1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x619c37,null))[_0x1ee1('0x23')](function(_0x31bd3c){if(_0x31bd3c){_0x12394e[_0x1ee1('0x78')]=_0x31bd3c[_0x1ee1('0x66')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5dde57[_0x1ee1('0x63')]['id'],_0x5dde57['user'][_0x1ee1('0x37')],_0x5dde57[_0x1ee1('0x63')][_0x1ee1('0x6c')],_0x12394e[_0x1ee1('0x78')]['id'],_0x5dde57[_0x1ee1('0x59')]?JSON[_0x1ee1('0x28')](_0x5dde57[_0x1ee1('0x59')]):'null');return respondWithRpcPromise(_0x1ee1('0x79'),_0x1ee1('0x7a'),_0x12394e);}return null;})[_0x1ee1('0x23')](function(_0x15a415){if(_0x15a415){_0x15a415['message']['interface']=util[_0x1ee1('0x60')](_0x1ee1('0x7b'),_0x5dde57[_0x1ee1('0x63')]['name']);_0x15a415['message'][_0x1ee1('0x70')]=_0x12394e[_0x1ee1('0x70')];_0x15a415[_0x1ee1('0x2a')]['event']=_0x1ee1('0x74');respondWithRpcPromise('EventManager',_0x1ee1('0x72'),{'event':'rejectmessage','message':_0x15a415[_0x1ee1('0x2a')]},client9002);return _0x12394e;}return null;})[_0x1ee1('0x23')](respondWithResult(_0x619c37,null))[_0x1ee1('0x2c')](handleError(_0x619c37,null));};exports[_0x1ee1('0x2e')]=function(_0x151096,_0x3a249b,_0x16f618){if(_0x151096[_0x1ee1('0x59')]['id']){delete _0x151096['body']['id'];}var _0x3a5eb3;return db[_0x1ee1('0x3b')][_0x1ee1('0x57')]({'where':{'id':_0x151096[_0x1ee1('0x55')]['id']}})[_0x1ee1('0x23')](handleEntityNotFound(_0x3a249b,null))[_0x1ee1('0x23')](function(_0x1b21a2){if(_0x1b21a2){_0x3a5eb3=_0x1b21a2;return db[_0x1ee1('0x7c')][_0x1ee1('0x57')]({'where':{'id':_0x1b21a2[_0x1ee1('0x7d')]}});}})[_0x1ee1('0x23')](handleEntityNotFound(_0x3a249b,null))[_0x1ee1('0x23')](function(_0x4f18da){if(_0x4f18da){logger[_0x1ee1('0x26')](_0x1ee1('0x27'),_0x1ee1('0x2e'),'received\x20delivery\x20report\x20from',_0x4f18da[_0x1ee1('0x3e')],util[_0x1ee1('0x7e')](_0x151096[_0x1ee1('0x59')],{'showHidden':![],'depth':null}));switch(_0x4f18da[_0x1ee1('0x3e')]){case _0x1ee1('0x7f'):if(_0x151096[_0x1ee1('0x59')][_0x1ee1('0x80')]&&_0x151096[_0x1ee1('0x59')][_0x1ee1('0x80')]===_0x3a5eb3[_0x1ee1('0x81')]){return _0x3a5eb3[_0x1ee1('0x34')]({'read':!![]});}else{logger[_0x1ee1('0x29')](_0x1ee1('0x82'),_0x1ee1('0x2e'),_0x1ee1('0x7f'),util[_0x1ee1('0x7e')](_0x151096[_0x1ee1('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1ee1('0x83'):if(_0x151096[_0x1ee1('0x59')][_0x1ee1('0x84')]&&_0x151096['body'][_0x1ee1('0x84')]===_0x3a5eb3[_0x1ee1('0x81')]&&_[_0x1ee1('0x85')]([_0x1ee1('0x86'),_0x1ee1('0x87')],_0x151096[_0x1ee1('0x59')][_0x1ee1('0x88')])>=0x0){return _0x3a5eb3['update']({'read':!![]});}else{logger[_0x1ee1('0x29')](_0x1ee1('0x82'),'status',_0x1ee1('0x89'),util[_0x1ee1('0x7e')](_0x151096[_0x1ee1('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3526ff=_0x151096['body'][_0x1ee1('0x8a')][0x0];if(_0x3526ff['status']['groupName']===_0x1ee1('0x8b')){return _0x3a5eb3[_0x1ee1('0x34')]({'read':!![]});}else{logger[_0x1ee1('0x29')](_0x1ee1('0x82'),_0x1ee1('0x2e'),'infobip',util[_0x1ee1('0x7e')](_0x151096[_0x1ee1('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3a5eb3;}})['then'](respondWithResult(_0x3a249b,null))[_0x1ee1('0x2c')](handleError(_0x3a249b,null));}; \ No newline at end of file +var _0x63c6=['options','count','include','findAll','catch','show','params','rawAttributes','find','create','body','sms-interactions','accept','sms','read','readAt','format','UserId','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','event','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','plivio','results','groupName','infobip','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','status','end','json','offset','limit','apply','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x63c6,0xbb));var _0x663c=function(_0x3c1be6,_0x1649fd){_0x3c1be6=_0x3c1be6-0x0;var _0x42db4f=_0x63c6[_0x3c1be6];return _0x42db4f;};'use strict';var pdf=require(_0x663c('0x0'));var emlformat=require(_0x663c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x663c('0x2'));var rp=require(_0x663c('0x3'));var moment=require(_0x663c('0x4'));var BPromise=require(_0x663c('0x5'));var Mustache=require(_0x663c('0x6'));var util=require(_0x663c('0x7'));var path=require(_0x663c('0x8'));var sox=require(_0x663c('0x9'));var csv=require(_0x663c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x663c('0xb'));var squel=require(_0x663c('0xc'));var crypto=require(_0x663c('0xd'));var jsforce=require(_0x663c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x663c('0xa'));var querystring=require('querystring');var Papa=require(_0x663c('0xf'));var Redis=require('ioredis');var authService=require(_0x663c('0x10'));var qs=require(_0x663c('0x11'));var as=require(_0x663c('0x12'));var hardwareService=require(_0x663c('0x13'));var logger=require(_0x663c('0x14'))(_0x663c('0x15'));var utils=require(_0x663c('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x663c('0x17')]=_[_0x663c('0x18')](config['redis'],{'host':_0x663c('0x19'),'port':0x18eb});var socket=require(_0x663c('0x1a'))(new Redis(config[_0x663c('0x17')]));require(_0x663c('0x1b'))['register'](socket);var jayson=require(_0x663c('0x1c'));var client=jayson[_0x663c('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x663c('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x44ffaa,_0xb1e1bf,_0x2a7b0d){if(_0x2a7b0d){var _0x14cb89=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14cb89[_0x663c('0x1e')](_0xb1e1bf)){return _0x44ffaa;}else{throw new db[(_0x663c('0x1f'))][(_0x663c('0x20'))](_0x663c('0x21'));}}else{return _0x44ffaa;}}function respondWithRpcPromise(_0x31895b,_0x3c87fe,_0x517f70,_0x2fd707){return new BPromise(function(_0x33f149,_0x6e56fd){var _0x49665e=_0x2fd707||client;return _0x49665e[_0x663c('0x22')](_0x31895b,_0x517f70)[_0x663c('0x23')](function(_0x2c0cb4){logger[_0x663c('0x24')](_0x663c('0x25'),_0x3c87fe,'request\x20sent');logger[_0x663c('0x26')](_0x663c('0x27'),_0x3c87fe,_0x663c('0x28'),JSON[_0x663c('0x29')](_0x2c0cb4));if(_0x2c0cb4['error']){if(_0x2c0cb4['error'][_0x663c('0x2a')]===0x1f4){logger[_0x663c('0x2b')](_0x663c('0x25'),_0x3c87fe,_0x2c0cb4[_0x663c('0x2b')][_0x663c('0x2c')]);return _0x6e56fd(_0x2c0cb4['error']['message']);}logger['error'](_0x663c('0x25'),_0x3c87fe,_0x2c0cb4[_0x663c('0x2b')][_0x663c('0x2c')]);return _0x33f149(_0x2c0cb4[_0x663c('0x2b')]['message']);}else{logger[_0x663c('0x24')](_0x663c('0x25'),_0x3c87fe,_0x663c('0x28'));_0x33f149(_0x2c0cb4[_0x663c('0x2d')][_0x663c('0x2c')]);}})['catch'](function(_0x34fc73){logger['error'](_0x663c('0x25'),_0x3c87fe,_0x34fc73);_0x6e56fd(_0x34fc73);});});}function respondWithStatusCode(_0x5ead23,_0x4ec72b){_0x4ec72b=_0x4ec72b||0xcc;return function(_0x34cd8c){if(_0x34cd8c){return _0x5ead23['sendStatus'](_0x4ec72b);}return _0x5ead23[_0x663c('0x2e')](_0x4ec72b)[_0x663c('0x2f')]();};}function respondWithResult(_0x30ff6f,_0x46d722){_0x46d722=_0x46d722||0xc8;return function(_0x1ab262){if(_0x1ab262){return _0x30ff6f[_0x663c('0x2e')](_0x46d722)[_0x663c('0x30')](_0x1ab262);}};}function respondWithFilteredResult(_0x567184,_0x61ebd3){return function(_0x29f074){if(_0x29f074){var _0x43ad67=_0x29f074['count'],_0x248345=_0x61ebd3[_0x663c('0x31')],_0x3b3d39=_0x61ebd3['offset']+_0x61ebd3[_0x663c('0x32')],_0x242ba7;if(_0x3b3d39>=_0x43ad67){_0x3b3d39=_0x43ad67;_0x242ba7=0xc8;}else{_0x242ba7=0xce;}_0x567184['status'](_0x242ba7);return _0x567184['set']('Content-Range',_0x248345+'-'+_0x3b3d39+'/'+_0x43ad67)[_0x663c('0x30')](_0x29f074);}return null;};}function patchUpdates(_0x10f4c4){return function(_0x5b4740){try{jsonpatch[_0x663c('0x33')](_0x5b4740,_0x10f4c4,!![]);}catch(_0x6c7d72){return BPromise['reject'](_0x6c7d72);}return _0x5b4740[_0x663c('0x34')]();};}function saveUpdates(_0x38278d,_0x31b3d5){return function(_0xdc1ba6){if(_0xdc1ba6){return _0xdc1ba6[_0x663c('0x35')](_0x38278d)['then'](function(_0x2326b8){return _0x2326b8;});}return null;};}function removeEntity(_0x2f2d8e,_0x36809f){return function(_0x4d29ef){if(_0x4d29ef){return _0x4d29ef[_0x663c('0x36')]()[_0x663c('0x23')](function(){_0x2f2d8e[_0x663c('0x2e')](0xcc)[_0x663c('0x2f')]();});}};}function handleEntityNotFound(_0x58b228,_0x3178cc){return function(_0xba7d56){if(!_0xba7d56){_0x58b228[_0x663c('0x37')](0x194);}return _0xba7d56;};}function handleError(_0xd16d2,_0x5752e1){_0x5752e1=_0x5752e1||0x1f4;return function(_0x4af133){logger[_0x663c('0x2b')](_0x4af133[_0x663c('0x38')]);if(_0x4af133['name']){delete _0x4af133[_0x663c('0x39')];}_0xd16d2[_0x663c('0x2e')](_0x5752e1)[_0x663c('0x3a')](_0x4af133);};}exports[_0x663c('0x3b')]=function(_0x50b42a,_0x2ab331){var _0x38123e={},_0x50a2e7={},_0x4e8d68={'count':0x0,'rows':[]};var _0x45acd5=_[_0x663c('0x3c')](db[_0x663c('0x3d')]['rawAttributes'],function(_0x51b931){return{'name':_0x51b931['fieldName'],'type':_0x51b931[_0x663c('0x3e')]['key']};});_0x50a2e7[_0x663c('0x3f')]=_[_0x663c('0x3c')](_0x45acd5,_0x663c('0x39'));_0x50a2e7['query']=_[_0x663c('0x40')](_0x50b42a[_0x663c('0x41')]);_0x50a2e7[_0x663c('0x42')]=_[_0x663c('0x43')](_0x50a2e7['model'],_0x50a2e7[_0x663c('0x41')]);_0x38123e[_0x663c('0x44')]=_[_0x663c('0x43')](_0x50a2e7[_0x663c('0x3f')],qs['fields'](_0x50b42a[_0x663c('0x41')][_0x663c('0x45')]));_0x38123e[_0x663c('0x44')]=_0x38123e['attributes'][_0x663c('0x46')]?_0x38123e[_0x663c('0x44')]:_0x50a2e7[_0x663c('0x3f')];if(!_0x50b42a['query'][_0x663c('0x47')]('nolimit')){_0x38123e[_0x663c('0x32')]=qs['limit'](_0x50b42a[_0x663c('0x41')][_0x663c('0x32')]);_0x38123e[_0x663c('0x31')]=qs['offset'](_0x50b42a[_0x663c('0x41')][_0x663c('0x31')]);}_0x38123e[_0x663c('0x48')]=qs['sort'](_0x50b42a[_0x663c('0x41')]['sort']);_0x38123e[_0x663c('0x49')]=qs[_0x663c('0x42')](_[_0x663c('0x4a')](_0x50b42a['query'],_0x50a2e7[_0x663c('0x42')]),_0x45acd5);if(_0x50b42a[_0x663c('0x41')][_0x663c('0x4b')]){_0x38123e[_0x663c('0x49')]=_[_0x663c('0x4c')](_0x38123e[_0x663c('0x49')],{'$or':_[_0x663c('0x3c')](_0x45acd5,function(_0x36b14a){if(_0x36b14a[_0x663c('0x3e')]!=='VIRTUAL'){var _0x10632d={};_0x10632d[_0x36b14a[_0x663c('0x39')]]={'$like':'%'+_0x50b42a[_0x663c('0x41')][_0x663c('0x4b')]+'%'};return _0x10632d;}})});}_0x38123e=_[_0x663c('0x4c')]({},_0x38123e,_0x50b42a[_0x663c('0x4d')]);var _0x3930cd={'where':_0x38123e['where']};return db[_0x663c('0x3d')][_0x663c('0x4e')](_0x3930cd)[_0x663c('0x23')](function(_0x4229e4){_0x4e8d68[_0x663c('0x4e')]=_0x4229e4;if(_0x50b42a[_0x663c('0x41')]['includeAll']){_0x38123e[_0x663c('0x4f')]=[{'all':!![]}];}return db[_0x663c('0x3d')][_0x663c('0x50')](_0x38123e);})['then'](function(_0x14b180){_0x4e8d68['rows']=_0x14b180;return _0x4e8d68;})[_0x663c('0x23')](respondWithFilteredResult(_0x2ab331,_0x38123e))[_0x663c('0x51')](handleError(_0x2ab331,null));};exports[_0x663c('0x52')]=function(_0x3db2fc,_0x4cb522){var _0x488e1d={'raw':!![],'where':{'id':_0x3db2fc[_0x663c('0x53')]['id']}},_0x167e07={};_0x167e07[_0x663c('0x3f')]=_[_0x663c('0x40')](db[_0x663c('0x3d')][_0x663c('0x54')]);_0x167e07[_0x663c('0x41')]=_[_0x663c('0x40')](_0x3db2fc[_0x663c('0x41')]);_0x167e07[_0x663c('0x42')]=_[_0x663c('0x43')](_0x167e07[_0x663c('0x3f')],_0x167e07['query']);_0x488e1d['attributes']=_[_0x663c('0x43')](_0x167e07[_0x663c('0x3f')],qs['fields'](_0x3db2fc[_0x663c('0x41')][_0x663c('0x45')]));_0x488e1d[_0x663c('0x44')]=_0x488e1d['attributes']['length']?_0x488e1d['attributes']:_0x167e07[_0x663c('0x3f')];if(_0x3db2fc[_0x663c('0x41')]['includeAll']){_0x488e1d[_0x663c('0x4f')]=[{'all':!![]}];}_0x488e1d=_[_0x663c('0x4c')]({},_0x488e1d,_0x3db2fc['options']);return db[_0x663c('0x3d')][_0x663c('0x55')](_0x488e1d)['then'](handleEntityNotFound(_0x4cb522,null))['then'](respondWithResult(_0x4cb522,null))[_0x663c('0x51')](handleError(_0x4cb522,null));};exports['create']=function(_0x3c7cab,_0x367528){return db['SmsMessage'][_0x663c('0x56')](_0x3c7cab[_0x663c('0x57')],{})[_0x663c('0x23')](respondWithResult(_0x367528,0xc9))[_0x663c('0x51')](handleError(_0x367528,null));};exports[_0x663c('0x35')]=function(_0x3112e1,_0x14fad7){if(_0x3112e1[_0x663c('0x57')]['id']){delete _0x3112e1[_0x663c('0x57')]['id'];}return db[_0x663c('0x3d')][_0x663c('0x55')]({'where':{'id':_0x3112e1[_0x663c('0x53')]['id']}})[_0x663c('0x23')](handleEntityNotFound(_0x14fad7,null))[_0x663c('0x23')](saveUpdates(_0x3112e1['body'],null))['then'](respondWithResult(_0x14fad7,null))[_0x663c('0x51')](handleError(_0x14fad7,null));};exports[_0x663c('0x36')]=function(_0x550ed1,_0xd2f377){return db[_0x663c('0x3d')][_0x663c('0x55')]({'where':{'id':_0x550ed1[_0x663c('0x53')]['id']}})['then'](handleEntityNotFound(_0xd2f377,null))[_0x663c('0x23')](removeEntity(_0xd2f377,null))['catch'](handleError(_0xd2f377,null));};exports['describe']=function(_0x213261,_0x37014b){return db[_0x663c('0x3d')]['describe']()[_0x663c('0x23')](respondWithResult(_0x37014b,null))[_0x663c('0x51')](handleError(_0x37014b,null));};var interaction_log=require(_0x663c('0x14'))(_0x663c('0x58'));exports[_0x663c('0x59')]=function(_0x127d91,_0x306243,_0xe8f953){var _0x392887={'channel':_0x663c('0x5a')};if(_0x127d91[_0x663c('0x57')]['id']){delete _0x127d91['body']['id'];}_0x127d91[_0x663c('0x57')][_0x663c('0x5b')]=!![];_0x127d91[_0x663c('0x57')][_0x663c('0x5c')]=moment()[_0x663c('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x127d91[_0x663c('0x57')]['UserId']=_0x127d91['body'][_0x663c('0x5e')]||_0x127d91['user']['id'];return db['SmsMessage'][_0x663c('0x55')]({'where':{'id':_0x127d91[_0x663c('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x663c('0x5f')}]})[_0x663c('0x23')](handleEntityNotFound(_0x306243,null))['then'](saveUpdates(_0x127d91['body'],null))[_0x663c('0x23')](function(_0x424bab){if(_0x424bab){_0x392887[_0x663c('0x2c')]=_0x424bab[_0x663c('0x60')]({'plain':!![]});return db[_0x663c('0x61')][_0x663c('0x55')]({'where':{'id':_0x424bab[_0x663c('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x306243,null))[_0x663c('0x23')](function(_0x581e1d){if(_0x581e1d){return _0x581e1d[_0x663c('0x35')]({'UserId':_0x127d91[_0x663c('0x57')][_0x663c('0x5e')],'read1stAt':_['isNil'](_0x581e1d[_0x663c('0x63')])?moment()[_0x663c('0x5d')](_0x663c('0x64')):undefined});}return null;})[_0x663c('0x23')](function(_0x63035a){if(_0x63035a){_0x392887[_0x663c('0x65')]=_0x63035a[_0x663c('0x60')]({'plain':!![]});interaction_log[_0x663c('0x24')](_0x663c('0x66'),_0x127d91[_0x663c('0x67')]['id'],_0x127d91[_0x663c('0x67')][_0x663c('0x39')],_0x127d91[_0x663c('0x67')][_0x663c('0x68')],_0x392887[_0x663c('0x65')]['id'],_0x127d91['body']?JSON[_0x663c('0x29')](_0x127d91[_0x663c('0x57')]):_0x663c('0x69'));return respondWithRpcPromise('AcceptMessage',_0x663c('0x6a'),_0x392887);}return null;})['then'](function(_0x45b626){if(_0x45b626){if(_0x127d91['body'][_0x663c('0x6b')]){_0x392887['message'][_0x663c('0x6c')]=util[_0x663c('0x5d')](_0x663c('0x6d'),_0x127d91[_0x663c('0x67')][_0x663c('0x39')]);_0x392887[_0x663c('0x2c')][_0x663c('0x6e')]=_0x392887[_0x663c('0x6e')];_0x392887[_0x663c('0x2c')]['event']=_0x663c('0x59');return respondWithRpcPromise('EventManager',_0x663c('0x6f'),{'event':_0x663c('0x70'),'message':_0x392887[_0x663c('0x2c')]},client9002)['then'](function(){return _0x392887;});}return _0x392887;}return null;})[_0x663c('0x23')](respondWithResult(_0x306243,null))[_0x663c('0x51')](handleError(_0x306243,null));};var interaction_log=require('../../config/logger')(_0x663c('0x58'));exports[_0x663c('0x71')]=function(_0x54aad8,_0x21b70f,_0x45a4ba){var _0x40cd62={'agent':{},'channel':_0x663c('0x5a')};if(_0x54aad8[_0x663c('0x57')]['id']){delete _0x54aad8[_0x663c('0x57')]['id'];}_0x54aad8[_0x663c('0x57')][_0x663c('0x5e')]=_0x54aad8[_0x663c('0x57')]['UserId']||_0x54aad8[_0x663c('0x67')]['id'];_0x40cd62[_0x663c('0x72')]['id']=_0x54aad8['body'][_0x663c('0x5e')];return db[_0x663c('0x3d')][_0x663c('0x55')]({'where':{'id':_0x54aad8[_0x663c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21b70f,null))[_0x663c('0x23')](function(_0x2ae4d0){if(_0x2ae4d0){_0x40cd62[_0x663c('0x2c')]=_0x2ae4d0[_0x663c('0x60')]({'plain':!![]});return db['SmsInteraction'][_0x663c('0x55')]({'where':{'id':_0x2ae4d0[_0x663c('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x21b70f,null))['then'](function(_0x169dfd){if(_0x169dfd){_0x40cd62['interaction']=_0x169dfd[_0x663c('0x60')]({'plain':!![]});interaction_log[_0x663c('0x24')](_0x663c('0x73'),_0x54aad8['user']['id'],_0x54aad8[_0x663c('0x67')][_0x663c('0x39')],_0x54aad8['user'][_0x663c('0x68')],_0x40cd62['interaction']['id'],_0x54aad8[_0x663c('0x57')]?JSON[_0x663c('0x29')](_0x54aad8[_0x663c('0x57')]):'null');return respondWithRpcPromise('RejectMessage',_0x663c('0x74'),_0x40cd62);}return null;})['then'](function(_0x1e8ecc){if(_0x1e8ecc){_0x1e8ecc[_0x663c('0x2c')][_0x663c('0x6c')]=util['format']('SIP/%s',_0x54aad8['user'][_0x663c('0x39')]);_0x1e8ecc['message'][_0x663c('0x6e')]=_0x40cd62[_0x663c('0x6e')];_0x1e8ecc[_0x663c('0x2c')][_0x663c('0x75')]=_0x663c('0x71');respondWithRpcPromise(_0x663c('0x6f'),'EventManager',{'event':'rejectmessage','message':_0x1e8ecc[_0x663c('0x2c')]},client9002);return _0x40cd62;}return null;})[_0x663c('0x23')](respondWithResult(_0x21b70f,null))[_0x663c('0x51')](handleError(_0x21b70f,null));};exports[_0x663c('0x2e')]=function(_0x4992c9,_0x3f09c5,_0x5e9423){if(_0x4992c9[_0x663c('0x57')]['id']){delete _0x4992c9['body']['id'];}var _0x4a8987;return db['SmsMessage'][_0x663c('0x55')]({'where':{'id':_0x4992c9[_0x663c('0x53')]['id']}})[_0x663c('0x23')](handleEntityNotFound(_0x3f09c5,null))['then'](function(_0x199531){if(_0x199531){_0x4a8987=_0x199531;return db[_0x663c('0x76')][_0x663c('0x55')]({'where':{'id':_0x199531['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3f09c5,null))[_0x663c('0x23')](function(_0x4466d6){if(_0x4466d6){logger[_0x663c('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x663c('0x2e'),_0x663c('0x77'),_0x4466d6[_0x663c('0x3e')],util[_0x663c('0x78')](_0x4992c9[_0x663c('0x57')],{'showHidden':![],'depth':null}));switch(_0x4466d6[_0x663c('0x3e')]){case _0x663c('0x79'):if(_0x4992c9[_0x663c('0x57')][_0x663c('0x7a')]&&_0x4992c9[_0x663c('0x57')][_0x663c('0x7a')]===_0x4a8987[_0x663c('0x7b')]){return _0x4a8987[_0x663c('0x35')]({'read':!![]});}else{logger['error'](_0x663c('0x7c'),_0x663c('0x2e'),'twilio',util['inspect'](_0x4992c9[_0x663c('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4992c9['body']['MessageUUID']&&_0x4992c9['body'][_0x663c('0x7d')]===_0x4a8987[_0x663c('0x7b')]&&_[_0x663c('0x7e')]([_0x663c('0x7f'),'delivered'],_0x4992c9[_0x663c('0x57')]['Status'])>=0x0){return _0x4a8987['update']({'read':!![]});}else{logger[_0x663c('0x2b')](_0x663c('0x7c'),_0x663c('0x2e'),_0x663c('0x80'),util['inspect'](_0x4992c9[_0x663c('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x118150=_0x4992c9[_0x663c('0x57')][_0x663c('0x81')][0x0];if(_0x118150['status'][_0x663c('0x82')]==='DELIVERED'){return _0x4a8987[_0x663c('0x35')]({'read':!![]});}else{logger[_0x663c('0x2b')](_0x663c('0x7c'),'status',_0x663c('0x83'),util[_0x663c('0x78')](_0x4992c9[_0x663c('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4a8987;}})[_0x663c('0x23')](respondWithResult(_0x3f09c5,null))['catch'](handleError(_0x3f09c5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c08fd16..f507234 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 _0x6cd7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','remove'];(function(_0x204fe9,_0x51ebe1){var _0xdefb11=function(_0x436d5d){while(--_0x436d5d){_0x204fe9['push'](_0x204fe9['shift']());}};_0xdefb11(++_0x51ebe1);}(_0x6cd7,0x134));var _0x76cd=function(_0x4abb10,_0x26897f){_0x4abb10=_0x4abb10-0x0;var _0x2494fe=_0x6cd7[_0x4abb10];return _0x2494fe;};'use strict';var EventEmitter=require(_0x76cd('0x0'));var SmsMessage=require(_0x76cd('0x1'))['db'][_0x76cd('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x76cd('0x3')};function emitEvent(_0x4eddf5){return function(_0x786b9b,_0x2425bf,_0x8dd721){SmsMessageEvents['emit'](_0x4eddf5+':'+_0x786b9b['id'],_0x786b9b);SmsMessageEvents[_0x76cd('0x4')](_0x4eddf5,_0x786b9b);_0x8dd721(null);};}for(var e in events){if(events[_0x76cd('0x5')](e)){var event=events[e];SmsMessage[_0x76cd('0x6')](e,emitEvent(event));}}module[_0x76cd('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x25d8=['save','remove','emit','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x25d8,0x125));var _0x825d=function(_0x569f87,_0x23836a){_0x569f87=_0x569f87-0x0;var _0x2c87cb=_0x25d8[_0x569f87];return _0x2c87cb;};'use strict';var EventEmitter=require(_0x825d('0x0'));var SmsMessage=require(_0x825d('0x1'))['db'][_0x825d('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x825d('0x3'),'afterUpdate':'update','afterDestroy':_0x825d('0x4')};function emitEvent(_0x7b1089){return function(_0x9c07fe,_0x4c572e,_0x5d6600){SmsMessageEvents[_0x825d('0x5')](_0x7b1089+':'+_0x9c07fe['id'],_0x9c07fe);SmsMessageEvents[_0x825d('0x5')](_0x7b1089,_0x9c07fe);_0x5d6600(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x825d('0x6')](e,emitEvent(event));}}module[_0x825d('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 af18182..9fc69fb 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 _0xf6b4=['read','connectel','authToken','senderString','POST','https://smsapi.connectel.se/api/send/','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','keys','sort','length','createHash','md5','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','FULLTEXT','models','direction','toLowerCase','out','isNil','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','phone','remote','/api/sms/messages/','/status?token=','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','sender','&password=','GET','user_key','internal_order_id','deliveryReport'];(function(_0x33cdac,_0x45266b){var _0x6862e9=function(_0x2549f4){while(--_0x2549f4){_0x33cdac['push'](_0x33cdac['shift']());}};_0x6862e9(++_0x45266b);}(_0xf6b4,0xaa));var _0x4f6b=function(_0x99c2dd,_0x1d32eb){_0x99c2dd=_0x99c2dd-0x0;var _0x173349=_0xf6b4[_0x99c2dd];return _0x173349;};'use strict';var _=require(_0x4f6b('0x0'));var util=require(_0x4f6b('0x1'));var logger=require('../../config/logger')(_0x4f6b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f6b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f6b('0x4'));var config=require(_0x4f6b('0x5'));var attributes=require(_0x4f6b('0x6'));module[_0x4f6b('0x7')]=function(_0x2596ab,_0x2864a6){return _0x2596ab['define'](_0x4f6b('0x8'),attributes,{'tableName':_0x4f6b('0x9'),'paranoid':![],'indexes':[{'name':_0x4f6b('0xa'),'fields':['messageId']},{'name':'fti_sms_messages','fields':['body'],'type':_0x4f6b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59f7c7,_0x54aa2f,_0x224e61){var _0xa827ee=_0x2596ab[_0x4f6b('0xc')];var _0x4b6295=_0x59f7c7['get']({'plain':!![]});if(_0x4b6295[_0x4f6b('0xd')][_0x4f6b('0xe')]()==='in'||_0x4b6295['direction'][_0x4f6b('0xe')]()===_0x4f6b('0xf')&&!_0x4b6295['secret']&&!_[_0x4f6b('0x10')](_0x4b6295['UserId'])){_0xa827ee[_0x4f6b('0x11')][_0x4f6b('0x12')]({'where':{'id':_0x4b6295[_0x4f6b('0x13')]}})[_0x4f6b('0x14')](function(_0x14a517){if(_0x14a517){_0x14a517['update']({'lastMsgAt':_0x4b6295[_0x4f6b('0x15')],'lastMsgDirection':_0x4b6295[_0x4f6b('0xd')]['toLowerCase']()});}})[_0x4f6b('0x16')](function(_0x2df8e0){console['error'](_0x2df8e0);});}if(_0x4b6295['direction']===_0x4f6b('0xf')&&!_0x4b6295[_0x4f6b('0x17')]){var _0x15a869;_0xa827ee[_0x4f6b('0x18')]['find']({'where':{'id':_0x4b6295[_0x4f6b('0x19')]},'raw':!![]})[_0x4f6b('0x14')](function(_0x415a9a){_0x15a869=_0x415a9a;if(_0x15a869&&_0x15a869[_0x4f6b('0x1a')]){switch(_0x15a869[_0x4f6b('0x1a')]){case _0x4f6b('0x1b'):var _0x3baf36=require(_0x4f6b('0x1b'));if(_0x15a869[_0x4f6b('0x1c')]&&_0x15a869['authToken']&&_0x15a869[_0x4f6b('0x1d')]){var _0x2b4d56=new _0x3baf36(_0x15a869[_0x4f6b('0x1c')],_0x15a869['authToken']);_0x2b4d56['messages']['create']({'body':_0x4b6295['body'],'to':_0x4b6295[_0x4f6b('0x1d')],'from':_0x15a869[_0x4f6b('0x1d')],'statusCallback':_0x15a869[_0x4f6b('0x1e')]+_0x4f6b('0x1f')+_0x4b6295['id']+_0x4f6b('0x20')+_0x15a869[_0x4f6b('0x21')]})['then'](function(_0x68521){if(_0x68521[_0x4f6b('0x22')]){return _0x59f7c7[_0x4f6b('0x23')]({'messageId':_0x68521[_0x4f6b('0x22')]});}})[_0x4f6b('0x16')](function(_0x34e373){logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x1b'),util[_0x4f6b('0x27')](_0x34e373,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4f6b('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4f6b('0x28'):var _0x5b2d06=_0x4f6b('0x29');if(_0x15a869[_0x4f6b('0x2a')]&&_0x15a869[_0x4f6b('0x2b')]){var _0x2c6037={'recipient':[_0x4b6295[_0x4f6b('0x1d')]],'message':_0x4b6295[_0x4f6b('0x2c')],'message_type':_0x15a869[_0x4f6b('0x2d')]};if(_0x15a869['smsMethod']&&_0x15a869[_0x4f6b('0x2d')]!=='SI'){_0x2c6037[_0x4f6b('0x2e')]=_0x15a869['phone'];}var _0x79fa6f={'url':_0x5b2d06+'login?username='+_0x15a869[_0x4f6b('0x2a')]+_0x4f6b('0x2f')+_0x15a869['password'],'method':_0x4f6b('0x30')};rp(_0x79fa6f)[_0x4f6b('0x14')](function(_0x5ccbc8){var _0x68f6c2=_0x5ccbc8['split'](';');var _0x535013={'user_key':_0x68f6c2[0x0],'session_key':_0x68f6c2[0x1]};_0x79fa6f={'url':_0x5b2d06+'sms','method':'POST','headers':{'user_key':_0x535013[_0x4f6b('0x31')],'Session_key':_0x535013['session_key']},'json':!![],'body':_0x2c6037};return rp(_0x79fa6f);})['then'](function(_0x287445){if(_0x287445['total_sent']>=0x1){var _0x23c602={'messageId':_0x287445[_0x4f6b('0x32')]};if(_0x15a869[_0x4f6b('0x2d')]!=='GP'||!_0x15a869[_0x4f6b('0x33')]){_0x23c602[_0x4f6b('0x34')]=!![];}return _0x59f7c7[_0x4f6b('0x23')](_0x23c602);}else{return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x28'),util[_0x4f6b('0x27')](_0x287445,{'showHidden':![],'depth':null}));}})['catch'](function(_0x99b4a0){return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x28'),util[_0x4f6b('0x27')](_0x99b4a0,{'showHidden':![],'depth':null}));});}else{logger[_0x4f6b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f6b('0x26'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x4f6b('0x35'):if(_0x15a869[_0x4f6b('0x36')]){var _0x516eeb={'recipient':_0x4b6295['phone'],'message':_0x4b6295[_0x4f6b('0x2c')],'sender':_0x15a869[_0x4f6b('0x37')]||_0x15a869[_0x4f6b('0x1d')],'authorization':_0x15a869['authToken']};var _0x54aa2f={'method':_0x4f6b('0x38'),'uri':_0x4f6b('0x39'),'body':_0x516eeb,'json':!![]};rp(_0x54aa2f)['then'](function(_0x42a408){var _0x17942f={'messageId':_0x42a408['requestid']};if(!_0x15a869[_0x4f6b('0x33')]){_0x17942f['read']=!![];}return _0x59f7c7['update'](_0x17942f);})['catch'](function(_0x3fa045){logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x35'),util[_0x4f6b('0x27')](_0x3fa045,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x35'),'Missing\x20parameters:\x20authToken');}break;case _0x4f6b('0x3a'):if(_0x15a869['username']&&_0x15a869[_0x4f6b('0x2b')]){var _0x516eeb={'messages':[{'source':_0x4f6b('0x3b'),'to':_0x4b6295[_0x4f6b('0x1d')],'body':_0x4b6295[_0x4f6b('0x2c')],'from':_0x15a869[_0x4f6b('0x37')]||_0x15a869[_0x4f6b('0x1d')]}]};var _0x48b945=util[_0x4f6b('0x3c')](_0x4f6b('0x3d'),_0x15a869[_0x4f6b('0x2a')],_0x15a869['password']);var _0x54aa2f={'method':_0x4f6b('0x38'),'uri':_0x4f6b('0x3e'),'body':_0x516eeb,'headers':{'Authorization':util[_0x4f6b('0x3c')](_0x4f6b('0x3f'),new Buffer(_0x48b945)[_0x4f6b('0x40')](_0x4f6b('0x41')))},'json':!![]};rp(_0x54aa2f)[_0x4f6b('0x14')](function(_0x39aab7){if(_0x39aab7[_0x4f6b('0x42')]>=0xc8&&_0x39aab7['http_code']<=0xce){if(_0x39aab7['data']&&_0x39aab7[_0x4f6b('0x43')]['queued_count']>0x0){var _0x3436d1=_['head'](_0x39aab7[_0x4f6b('0x43')]['messages']);var _0x5b8fa5={'messageId':_0x3436d1[_0x4f6b('0x44')]};if(!_0x15a869['deliveryReport']){_0x5b8fa5['read']=!![];}return _0x59f7c7[_0x4f6b('0x23')](_0x5b8fa5);}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x45'),util[_0x4f6b('0x27')](_0x39aab7,{'showHidden':![],'depth':null}));}}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x45'),util['inspect'](_0x39aab7,{'showHidden':![],'depth':null}));}})[_0x4f6b('0x16')](function(_0x5e9fbd){logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),'clickSend',util['inspect'](_0x5e9fbd,{'showHidden':![],'depth':null}));});}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x45'),_0x4f6b('0x46'));}break;case'plivo':if(_0x15a869[_0x4f6b('0x47')]&&_0x15a869[_0x4f6b('0x36')]){var _0x516eeb={'dst':_0x4b6295['phone'],'text':_0x4b6295['body'],'src':_0x15a869[_0x4f6b('0x37')]||_0x15a869[_0x4f6b('0x1d')],'url':_0x15a869['remote']+_0x4f6b('0x1f')+_0x4b6295['id']+_0x4f6b('0x20')+_0x15a869[_0x4f6b('0x21')]};var _0x48b945=util[_0x4f6b('0x3c')]('%s:%s',_0x15a869[_0x4f6b('0x47')],_0x15a869[_0x4f6b('0x36')]);var _0x54aa2f={'method':_0x4f6b('0x38'),'uri':util['format'](_0x4f6b('0x48'),_0x15a869[_0x4f6b('0x47')]),'body':_0x516eeb,'headers':{'Authorization':util[_0x4f6b('0x3c')](_0x4f6b('0x3f'),new Buffer(_0x48b945)[_0x4f6b('0x40')](_0x4f6b('0x41')))},'json':!![]};rp(_0x54aa2f)[_0x4f6b('0x14')](function(_0x5beb9d){var _0x1a30f3={'messageId':_0x5beb9d[_0x4f6b('0x49')][0x0]};return _0x59f7c7[_0x4f6b('0x23')](_0x1a30f3);})[_0x4f6b('0x16')](function(_0xf38b9a){logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x4a'),util['inspect'](_0xf38b9a,{'showHidden':![],'depth':null}));});}else{logger[_0x4f6b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f6b('0x26'),_0x4f6b('0x4a'),_0x4f6b('0x4b'));}break;case _0x4f6b('0x4c'):if(_0x15a869[_0x4f6b('0x2a')]&&_0x15a869[_0x4f6b('0x2b')]){if(_0x15a869[_0x4f6b('0x4d')]){var _0xd0b857={'method':_0x4f6b('0x38'),'uri':_0x15a869[_0x4f6b('0x4d')]+_0x4f6b('0x4e'),'body':{'username':_0x15a869[_0x4f6b('0x2a')],'password':_0x15a869[_0x4f6b('0x2b')]},'json':!![]};return rp(_0xd0b857)[_0x4f6b('0x14')](function(_0x5c9b3f){var _0x164842={'method':_0x4f6b('0x38'),'uri':_0x15a869['baseUrl']+_0x4f6b('0x4f'),'body':{'messages':[{'from':_0x15a869[_0x4f6b('0x1d')],'destinations':[{'to':_0x4b6295[_0x4f6b('0x1d')]}],'text':_0x4b6295[_0x4f6b('0x2c')],'notifyUrl':_0x15a869['remote']+'/api/sms/messages/'+_0x4b6295['id']+_0x4f6b('0x20')+_0x15a869['token'],'notifyContentType':_0x4f6b('0x50'),'callbackData':_0x15a869[_0x4f6b('0x1d')]+';'+_0x4b6295[_0x4f6b('0x2c')]}]},'headers':{'Authorization':_0x4f6b('0x51')+_0x5c9b3f[_0x4f6b('0x21')]},'json':!![]};return rp(_0x164842)[_0x4f6b('0x14')](function(_0x24b406){if(_0x24b406[_0x4f6b('0x52')]){var _0x40a1a8={'messageId':_0x24b406[_0x4f6b('0x52')][0x0][_0x4f6b('0xa')]};if(!_0x15a869[_0x4f6b('0x33')]){_0x40a1a8[_0x4f6b('0x34')]=!![];}return _0x59f7c7[_0x4f6b('0x23')](_0x40a1a8);}else{return logger['error'](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x4c'),util[_0x4f6b('0x27')](_0x24b406,{'showHidden':![],'depth':null}));}});})[_0x4f6b('0x16')](function(_0x2237b1){return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x4c'),util[_0x4f6b('0x27')](_0x2237b1,{'showHidden':![],'depth':null}));});}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x4c'),_0x4f6b('0x53'));}}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),'afterCreate',_0x4f6b('0x4c'),_0x4f6b('0x46'));}break;case _0x4f6b('0x54'):var _0x23caf2=require(_0x4f6b('0x55'));if(_0x15a869[_0x4f6b('0x56')]){var _0x220c76={};_0x220c76[_0x4f6b('0x57')]=_0x15a869['username'];_0x220c76[_0x4f6b('0x1d')]=_0x4b6295[_0x4f6b('0x1d')];_0x220c76[_0x4f6b('0x2e')]=_0x15a869[_0x4f6b('0x1d')];_0x220c76['text']=_0x4b6295[_0x4f6b('0x2c')];_0x220c76['timestamp']=+new Date();var _0x43e5b4='';var _0x33441d='';var _0x578cb8=Object[_0x4f6b('0x58')](_0x220c76);_0x578cb8[_0x4f6b('0x59')]();for(var _0x1d38a4=0x0;_0x1d38a4<_0x578cb8[_0x4f6b('0x5a')];_0x1d38a4++){if(_0x43e5b4!=''){_0x43e5b4+='&';}_0x43e5b4+=_0x578cb8[_0x1d38a4]+'='+encodeURIComponent(_0x220c76[_0x578cb8[_0x1d38a4]]);_0x33441d+=_0x220c76[_0x578cb8[_0x1d38a4]];}_0x33441d+=_0x15a869[_0x4f6b('0x56')];_0x33441d=_0x23caf2[_0x4f6b('0x5b')](_0x4f6b('0x5c'))[_0x4f6b('0x23')](_0x33441d)['digest']('hex');if(_0x43e5b4!==''){_0x43e5b4+='&';}_0x43e5b4+='signature='+_0x33441d;var _0x79fa6f={'method':'GET','uri':_0x15a869[_0x4f6b('0x4d')]+'/external/get/send.php?'+_0x43e5b4,'json':!![]};return rp(_0x79fa6f)[_0x4f6b('0x14')](function(_0x464986){var _0x4cb691=Object['keys'](_0x464986);if(_0x464986[_0x4cb691[0x0]]['error']&&parseInt(_0x464986[_0x4cb691[0x0]][_0x4f6b('0x24')])===0x0){var _0x35add2={'messageId':_0x464986[_0x4cb691[0x0]][_0x4f6b('0x5d')]};if(!_0x15a869[_0x4f6b('0x33')]){_0x35add2[_0x4f6b('0x34')]=!![];}return _0x59f7c7[_0x4f6b('0x23')](_0x35add2);}else{return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),'csc',util['inspect'](_0x464986[_0x4f6b('0x24')],{'showHidden':![],'depth':null}));}})[_0x4f6b('0x16')](function(_0x221a8c){return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),'csc',util[_0x4f6b('0x27')](_0x221a8c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4f6b('0x25'),'afterCreate',_0x4f6b('0x54'),'Missing\x20parameters:\x20apiKey');}break;case _0x4f6b('0x5e'):if(_0x15a869[_0x4f6b('0x56')]){var _0x1781ab={'method':'POST','uri':_0x4f6b('0x5f'),'headers':{'Authorization':_0x15a869[_0x4f6b('0x56')]},'body':{'content':_0x4b6295[_0x4f6b('0x2c')],'to':[_0x4b6295[_0x4f6b('0x1d')]],'from':_0x15a869['phone'],'binary':![],'clientMessageId':_0x4f6b('0x60'),'charset':_0x4f6b('0x61')},'json':!![]};rp(_0x1781ab)['then'](function(_0x53826b){if(!_0x53826b[_0x4f6b('0x24')]){var _0x16578f={'messageId':_0x53826b[_0x4f6b('0x52')][0x0][_0x4f6b('0x62')]};if(!_0x15a869[_0x4f6b('0x33')]){_0x16578f[_0x4f6b('0x34')]=!![];}return _0x59f7c7['update'](_0x16578f);}else{return logger[_0x4f6b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f6b('0x26'),_0x4f6b('0x5e'),util[_0x4f6b('0x27')](_0x53826b[_0x4f6b('0x24')],{'showHidden':![],'depth':null}));}})[_0x4f6b('0x16')](function(_0x434c0c){return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),'afterCreate',_0x4f6b('0x5e'),util[_0x4f6b('0x27')](_0x434c0c,{'showHidden':![],'depth':null}));});}else{logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x5e'),_0x4f6b('0x63'));}break;case _0x4f6b('0x64'):if(_0x15a869[_0x4f6b('0x56')]){var _0x13ad40={};var _0x79fa6f={'method':'POST','uri':_0x4f6b('0x65'),'headers':{'Authorization':_0x4f6b('0x66')+_0x15a869[_0x4f6b('0x56')],'Content-Type':_0x4f6b('0x50')},'body':{'from':_0x15a869['phone'],'to':_0x4b6295[_0x4f6b('0x1d')],'text':_0x4b6295[_0x4f6b('0x2c')]},'json':!![]};return rp(_0x79fa6f)['then'](function(_0x5c2c18){if(_0x5c2c18[_0x4f6b('0x67')]==0xca){_0x13ad40[_0x4f6b('0x68')]=_0x5c2c18;var _0x316ed6={'method':'POST','uri':_0x4f6b('0x69'),'headers':{'Authorization':'Bearer\x20'+_0x15a869['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x13ad40[_0x4f6b('0x68')][_0x4f6b('0x6a')]},'json':!![]};return rp(_0x316ed6)[_0x4f6b('0x14')](function(_0x4cee2b){_0x13ad40[_0x4f6b('0x6b')]=_0x4cee2b;var _0x321c1a={'messageId':_0x13ad40['message'][_0x4f6b('0x6a')],'read':!![]};return _0x59f7c7[_0x4f6b('0x23')](_0x321c1a);});}else{return logger[_0x4f6b('0x24')](_0x4f6b('0x25'),_0x4f6b('0x26'),_0x4f6b('0x64'),util[_0x4f6b('0x27')](_0x5c2c18,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5500fa){return logger[_0x4f6b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f6b('0x26'),_0x4f6b('0x64'),util['inspect'](_0x5500fa,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x4f6b('0x25'),_0x4f6b('0x26'),'intelepeer',_0x4f6b('0x6c'));}break;}}})['finally'](function(){_0x224e61();});}else{_0x224e61();}}},'charset':_0x4f6b('0x6d'),'collate':_0x4f6b('0x6e')});}; \ No newline at end of file +var _0x5290=['toLowerCase','out','secret','UserId','SmsInteraction','findOne','createdAt','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','messages','create','remote','/api/sms/messages/','/status?token=','update','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','http_code','data','head','message_id','clickSend','plivo','authToken','token','authId','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','length','createHash','md5','digest','signature=','GET','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','body','FULLTEXT','models','get','direction'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5290,0x65));var _0x0529=function(_0x7b1927,_0x7d3e65){_0x7b1927=_0x7b1927-0x0;var _0x2deaaa=_0x5290[_0x7b1927];return _0x2deaaa;};'use strict';var _=require(_0x0529('0x0'));var util=require(_0x0529('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0529('0x2'));var rp=require(_0x0529('0x3'));var fs=require('fs');var path=require(_0x0529('0x4'));var rimraf=require(_0x0529('0x5'));var config=require(_0x0529('0x6'));var attributes=require(_0x0529('0x7'));module[_0x0529('0x8')]=function(_0x4d68ea,_0x3cbbf4){return _0x4d68ea[_0x0529('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x0529('0xa'),'fields':[_0x0529('0xa')]},{'name':'fti_sms_messages','fields':[_0x0529('0xb')],'type':_0x0529('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x255229,_0x2f2931,_0x2f09fa){var _0x54e22a=_0x4d68ea[_0x0529('0xd')];var _0x382873=_0x255229[_0x0529('0xe')]({'plain':!![]});if(_0x382873[_0x0529('0xf')]['toLowerCase']()==='in'||_0x382873['direction'][_0x0529('0x10')]()===_0x0529('0x11')&&!_0x382873[_0x0529('0x12')]&&!_['isNil'](_0x382873[_0x0529('0x13')])){_0x54e22a[_0x0529('0x14')][_0x0529('0x15')]({'where':{'id':_0x382873['SmsInteractionId']}})['then'](function(_0x4f3a7e){if(_0x4f3a7e){_0x4f3a7e['update']({'lastMsgAt':_0x382873[_0x0529('0x16')],'lastMsgDirection':_0x382873[_0x0529('0xf')][_0x0529('0x10')]()});}})['catch'](function(_0x3b9f7b){console[_0x0529('0x17')](_0x3b9f7b);});}if(_0x382873[_0x0529('0xf')]===_0x0529('0x11')&&!_0x382873['secret']){var _0xca87bb;_0x54e22a[_0x0529('0x18')][_0x0529('0x19')]({'where':{'id':_0x382873[_0x0529('0x1a')]},'raw':!![]})[_0x0529('0x1b')](function(_0x1b9fbc){_0xca87bb=_0x1b9fbc;if(_0xca87bb&&_0xca87bb['type']){switch(_0xca87bb[_0x0529('0x1c')]){case _0x0529('0x1d'):var _0x3e2069=require(_0x0529('0x1d'));if(_0xca87bb[_0x0529('0x1e')]&&_0xca87bb['authToken']&&_0xca87bb[_0x0529('0x1f')]){var _0x4caed1=new _0x3e2069(_0xca87bb[_0x0529('0x1e')],_0xca87bb['authToken']);_0x4caed1[_0x0529('0x20')][_0x0529('0x21')]({'body':_0x382873[_0x0529('0xb')],'to':_0x382873[_0x0529('0x1f')],'from':_0xca87bb[_0x0529('0x1f')],'statusCallback':_0xca87bb[_0x0529('0x22')]+_0x0529('0x23')+_0x382873['id']+_0x0529('0x24')+_0xca87bb['token']})[_0x0529('0x1b')](function(_0xc4bd5){if(_0xc4bd5['sid']){return _0x255229[_0x0529('0x25')]({'messageId':_0xc4bd5[_0x0529('0x26')]});}})[_0x0529('0x27')](function(_0x2e33a6){logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x1d'),util[_0x0529('0x2a')](_0x2e33a6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0529('0x28'),'afterCreate',_0x0529('0x1d'),_0x0529('0x2b'));}break;case'skebby':var _0x39f248=_0x0529('0x2c');if(_0xca87bb[_0x0529('0x2d')]&&_0xca87bb[_0x0529('0x2e')]){var _0x3ee9db={'recipient':[_0x382873['phone']],'message':_0x382873[_0x0529('0xb')],'message_type':_0xca87bb[_0x0529('0x2f')]};if(_0xca87bb['smsMethod']&&_0xca87bb[_0x0529('0x2f')]!=='SI'){_0x3ee9db[_0x0529('0x30')]=_0xca87bb[_0x0529('0x1f')];}var _0x42b609={'url':_0x39f248+_0x0529('0x31')+_0xca87bb[_0x0529('0x2d')]+'&password='+_0xca87bb['password'],'method':'GET'};rp(_0x42b609)[_0x0529('0x1b')](function(_0x11e598){var _0x268a0b=_0x11e598[_0x0529('0x32')](';');var _0x1ec745={'user_key':_0x268a0b[0x0],'session_key':_0x268a0b[0x1]};_0x42b609={'url':_0x39f248+_0x0529('0x33'),'method':_0x0529('0x34'),'headers':{'user_key':_0x1ec745[_0x0529('0x35')],'Session_key':_0x1ec745[_0x0529('0x36')]},'json':!![],'body':_0x3ee9db};return rp(_0x42b609);})[_0x0529('0x1b')](function(_0x1da36c){if(_0x1da36c[_0x0529('0x37')]>=0x1){var _0xbc3c4f={'messageId':_0x1da36c[_0x0529('0x38')]};if(_0xca87bb['smsMethod']!=='GP'||!_0xca87bb[_0x0529('0x39')]){_0xbc3c4f[_0x0529('0x3a')]=!![];}return _0x255229['update'](_0xbc3c4f);}else{return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x3b'),util[_0x0529('0x2a')](_0x1da36c,{'showHidden':![],'depth':null}));}})[_0x0529('0x27')](function(_0x5122d7){return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),'skebby',util[_0x0529('0x2a')](_0x5122d7,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0529('0x29'),_0x0529('0x3b'),_0x0529('0x3c'));}break;case'connectel':if(_0xca87bb['authToken']){var _0x10020f={'recipient':_0x382873[_0x0529('0x1f')],'message':_0x382873['body'],'sender':_0xca87bb[_0x0529('0x3d')]||_0xca87bb[_0x0529('0x1f')],'authorization':_0xca87bb['authToken']};var _0x2f2931={'method':_0x0529('0x34'),'uri':_0x0529('0x3e'),'body':_0x10020f,'json':!![]};rp(_0x2f2931)[_0x0529('0x1b')](function(_0x6fc863){var _0x20c813={'messageId':_0x6fc863[_0x0529('0x3f')]};if(!_0xca87bb[_0x0529('0x39')]){_0x20c813[_0x0529('0x3a')]=!![];}return _0x255229[_0x0529('0x25')](_0x20c813);})[_0x0529('0x27')](function(_0x32a5c0){logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',util[_0x0529('0x2a')](_0x32a5c0,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x0529('0x40'):if(_0xca87bb[_0x0529('0x2d')]&&_0xca87bb[_0x0529('0x2e')]){var _0x10020f={'messages':[{'source':_0x0529('0x41'),'to':_0x382873[_0x0529('0x1f')],'body':_0x382873[_0x0529('0xb')],'from':_0xca87bb[_0x0529('0x3d')]||_0xca87bb['phone']}]};var _0x19dada=util[_0x0529('0x42')](_0x0529('0x43'),_0xca87bb[_0x0529('0x2d')],_0xca87bb[_0x0529('0x2e')]);var _0x2f2931={'method':_0x0529('0x34'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x10020f,'headers':{'Authorization':util[_0x0529('0x42')](_0x0529('0x44'),new Buffer(_0x19dada)['toString']('base64'))},'json':!![]};rp(_0x2f2931)[_0x0529('0x1b')](function(_0x614057){if(_0x614057['http_code']>=0xc8&&_0x614057[_0x0529('0x45')]<=0xce){if(_0x614057['data']&&_0x614057[_0x0529('0x46')]['queued_count']>0x0){var _0x2ceb95=_[_0x0529('0x47')](_0x614057[_0x0529('0x46')][_0x0529('0x20')]);var _0x1bc535={'messageId':_0x2ceb95[_0x0529('0x48')]};if(!_0xca87bb[_0x0529('0x39')]){_0x1bc535[_0x0529('0x3a')]=!![];}return _0x255229[_0x0529('0x25')](_0x1bc535);}else{logger['error'](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x49'),util[_0x0529('0x2a')](_0x614057,{'showHidden':![],'depth':null}));}}else{logger[_0x0529('0x17')](_0x0529('0x28'),'afterCreate','clickSend',util[_0x0529('0x2a')](_0x614057,{'showHidden':![],'depth':null}));}})[_0x0529('0x27')](function(_0x139593){logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0529('0x29'),_0x0529('0x49'),util[_0x0529('0x2a')](_0x139593,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0529('0x49'),_0x0529('0x3c'));}break;case _0x0529('0x4a'):if(_0xca87bb['authId']&&_0xca87bb[_0x0529('0x4b')]){var _0x10020f={'dst':_0x382873[_0x0529('0x1f')],'text':_0x382873['body'],'src':_0xca87bb[_0x0529('0x3d')]||_0xca87bb[_0x0529('0x1f')],'url':_0xca87bb['remote']+'/api/sms/messages/'+_0x382873['id']+_0x0529('0x24')+_0xca87bb[_0x0529('0x4c')]};var _0x19dada=util[_0x0529('0x42')](_0x0529('0x43'),_0xca87bb[_0x0529('0x4d')],_0xca87bb['authToken']);var _0x2f2931={'method':_0x0529('0x34'),'uri':util[_0x0529('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0xca87bb[_0x0529('0x4d')]),'body':_0x10020f,'headers':{'Authorization':util[_0x0529('0x42')](_0x0529('0x44'),new Buffer(_0x19dada)[_0x0529('0x4e')](_0x0529('0x4f')))},'json':!![]};rp(_0x2f2931)['then'](function(_0x189f5d){var _0x345974={'messageId':_0x189f5d[_0x0529('0x50')][0x0]};return _0x255229[_0x0529('0x25')](_0x345974);})[_0x0529('0x27')](function(_0x5f28e9){logger['error'](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x4a'),util[_0x0529('0x2a')](_0x5f28e9,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x4a'),_0x0529('0x51'));}break;case _0x0529('0x52'):if(_0xca87bb[_0x0529('0x2d')]&&_0xca87bb['password']){if(_0xca87bb['baseUrl']){var _0x2a9a9f={'method':'POST','uri':_0xca87bb[_0x0529('0x53')]+'/auth/1/session','body':{'username':_0xca87bb[_0x0529('0x2d')],'password':_0xca87bb[_0x0529('0x2e')]},'json':!![]};return rp(_0x2a9a9f)['then'](function(_0x23ae46){var _0x5c799c={'method':'POST','uri':_0xca87bb[_0x0529('0x53')]+_0x0529('0x54'),'body':{'messages':[{'from':_0xca87bb[_0x0529('0x1f')],'destinations':[{'to':_0x382873[_0x0529('0x1f')]}],'text':_0x382873[_0x0529('0xb')],'notifyUrl':_0xca87bb[_0x0529('0x22')]+'/api/sms/messages/'+_0x382873['id']+_0x0529('0x24')+_0xca87bb[_0x0529('0x4c')],'notifyContentType':'application/json','callbackData':_0xca87bb[_0x0529('0x1f')]+';'+_0x382873[_0x0529('0xb')]}]},'headers':{'Authorization':_0x0529('0x55')+_0x23ae46[_0x0529('0x4c')]},'json':!![]};return rp(_0x5c799c)[_0x0529('0x1b')](function(_0x21409d){if(_0x21409d[_0x0529('0x20')]){var _0x5517d0={'messageId':_0x21409d[_0x0529('0x20')][0x0][_0x0529('0xa')]};if(!_0xca87bb[_0x0529('0x39')]){_0x5517d0[_0x0529('0x3a')]=!![];}return _0x255229[_0x0529('0x25')](_0x5517d0);}else{return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x52'),util[_0x0529('0x2a')](_0x21409d,{'showHidden':![],'depth':null}));}});})[_0x0529('0x27')](function(_0x224d96){return logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0529('0x29'),'infobip',util['inspect'](_0x224d96,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x52'),_0x0529('0x56'));}}else{logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x52'),_0x0529('0x3c'));}break;case'csc':var _0x2064ab=require(_0x0529('0x57'));if(_0xca87bb[_0x0529('0x58')]){var _0x287c5e={};_0x287c5e[_0x0529('0x59')]=_0xca87bb[_0x0529('0x2d')];_0x287c5e['phone']=_0x382873[_0x0529('0x1f')];_0x287c5e['sender']=_0xca87bb[_0x0529('0x1f')];_0x287c5e[_0x0529('0x5a')]=_0x382873['body'];_0x287c5e['timestamp']=+new Date();var _0x5e1f3a='';var _0x4ababb='';var _0x3dc9b8=Object['keys'](_0x287c5e);_0x3dc9b8['sort']();for(var _0x447f15=0x0;_0x447f15<_0x3dc9b8[_0x0529('0x5b')];_0x447f15++){if(_0x5e1f3a!=''){_0x5e1f3a+='&';}_0x5e1f3a+=_0x3dc9b8[_0x447f15]+'='+encodeURIComponent(_0x287c5e[_0x3dc9b8[_0x447f15]]);_0x4ababb+=_0x287c5e[_0x3dc9b8[_0x447f15]];}_0x4ababb+=_0xca87bb[_0x0529('0x58')];_0x4ababb=_0x2064ab[_0x0529('0x5c')](_0x0529('0x5d'))['update'](_0x4ababb)[_0x0529('0x5e')]('hex');if(_0x5e1f3a!==''){_0x5e1f3a+='&';}_0x5e1f3a+=_0x0529('0x5f')+_0x4ababb;var _0x42b609={'method':_0x0529('0x60'),'uri':_0xca87bb[_0x0529('0x53')]+_0x0529('0x61')+_0x5e1f3a,'json':!![]};return rp(_0x42b609)[_0x0529('0x1b')](function(_0x2696fc){var _0x3bc7a9=Object[_0x0529('0x62')](_0x2696fc);if(_0x2696fc[_0x3bc7a9[0x0]]['error']&&parseInt(_0x2696fc[_0x3bc7a9[0x0]][_0x0529('0x17')])===0x0){var _0x3286a6={'messageId':_0x2696fc[_0x3bc7a9[0x0]][_0x0529('0x63')]};if(!_0xca87bb[_0x0529('0x39')]){_0x3286a6['read']=!![];}return _0x255229[_0x0529('0x25')](_0x3286a6);}else{return logger['error'](_0x0529('0x28'),_0x0529('0x29'),'csc',util[_0x0529('0x2a')](_0x2696fc['error'],{'showHidden':![],'depth':null}));}})[_0x0529('0x27')](function(_0x140ee7){return logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0529('0x29'),'csc',util[_0x0529('0x2a')](_0x140ee7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0529('0x28'),_0x0529('0x29'),'csc',_0x0529('0x64'));}break;case'clickatell':if(_0xca87bb[_0x0529('0x58')]){var _0x198873={'method':_0x0529('0x34'),'uri':_0x0529('0x65'),'headers':{'Authorization':_0xca87bb[_0x0529('0x58')]},'body':{'content':_0x382873[_0x0529('0xb')],'to':[_0x382873[_0x0529('0x1f')]],'from':_0xca87bb['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x0529('0x66')},'json':!![]};rp(_0x198873)[_0x0529('0x1b')](function(_0x568932){if(!_0x568932[_0x0529('0x17')]){var _0x301b55={'messageId':_0x568932[_0x0529('0x20')][0x0][_0x0529('0x67')]};if(!_0xca87bb[_0x0529('0x39')]){_0x301b55[_0x0529('0x3a')]=!![];}return _0x255229[_0x0529('0x25')](_0x301b55);}else{return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x68'),util[_0x0529('0x2a')](_0x568932['error'],{'showHidden':![],'depth':null}));}})[_0x0529('0x27')](function(_0x46c18f){return logger[_0x0529('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0529('0x68'),util['inspect'](_0x46c18f,{'showHidden':![],'depth':null}));});}else{logger[_0x0529('0x17')](_0x0529('0x28'),'afterCreate',_0x0529('0x68'),'Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0xca87bb[_0x0529('0x58')]){var _0x5845ca={};var _0x42b609={'method':_0x0529('0x34'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x0529('0x69')+_0xca87bb[_0x0529('0x58')],'Content-Type':_0x0529('0x6a')},'body':{'from':_0xca87bb[_0x0529('0x1f')],'to':_0x382873[_0x0529('0x1f')],'text':_0x382873[_0x0529('0xb')]},'json':!![]};return rp(_0x42b609)[_0x0529('0x1b')](function(_0x112424){if(_0x112424[_0x0529('0x6b')]==0xca){_0x5845ca[_0x0529('0x6c')]=_0x112424;var _0x3884b6={'method':'POST','uri':_0x0529('0x6d'),'headers':{'Authorization':_0x0529('0x69')+_0xca87bb[_0x0529('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x5845ca[_0x0529('0x6c')][_0x0529('0x6e')]},'json':!![]};return rp(_0x3884b6)[_0x0529('0x1b')](function(_0x4e7cdd){_0x5845ca[_0x0529('0x6f')]=_0x4e7cdd;var _0x3a9e4e={'messageId':_0x5845ca[_0x0529('0x6c')][_0x0529('0x6e')],'read':!![]};return _0x255229['update'](_0x3a9e4e);});}else{return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x70'),util[_0x0529('0x2a')](_0x112424,{'showHidden':![],'depth':null}));}})['catch'](function(_0x581bc0){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0529('0x70'),util[_0x0529('0x2a')](_0x581bc0,{'showHidden':![],'depth':null}));});}else{return logger[_0x0529('0x17')](_0x0529('0x28'),_0x0529('0x29'),_0x0529('0x70'),_0x0529('0x71'));}break;}}})[_0x0529('0x72')](function(){_0x2f09fa();});}else{_0x2f09fa();}}},'charset':_0x0529('0x73'),'collate':_0x0529('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 0d27f45..2a215d0 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 _0x0b0e=['message','result','SmsMessage','create','body','options','CreateSmsMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s'];(function(_0x4de9bd,_0x45d424){var _0xb71232=function(_0x51b9c3){while(--_0x51b9c3){_0x4de9bd['push'](_0x4de9bd['shift']());}};_0xb71232(++_0x45d424);}(_0x0b0e,0x187));var _0xe0b0=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0x0b0e[_0x392dc2];return _0x14150f;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateSmsMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateSmsMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x5f2f=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x31f06e,_0x52385d){var _0x2f6fd7=function(_0x2ede9f){while(--_0x2ede9f){_0x31f06e['push'](_0x31f06e['shift']());}};_0x2f6fd7(++_0x52385d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39bc68,_0x269d2d){_0x39bc68=_0x39bc68-0x0;var _0x395d16=_0x5f2f[_0x39bc68];return _0x395d16;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./smsMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateSmsMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index ea9515d..47ea7a4 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 _0x1459=['save','remove','update','register','smsMessage:','./smsMessage.events'];(function(_0x17b28b,_0x50a595){var _0x5aed68=function(_0x5005f3){while(--_0x5005f3){_0x17b28b['push'](_0x17b28b['shift']());}};_0x5aed68(++_0x50a595);}(_0x1459,0x185));var _0x9145=function(_0x4c2c07,_0x59f7df){_0x4c2c07=_0x4c2c07-0x0;var _0x2ea378=_0x1459[_0x4c2c07];return _0x2ea378;};'use strict';var SmsMessageEvents=require(_0x9145('0x0'));var events=[_0x9145('0x1'),_0x9145('0x2'),_0x9145('0x3')];function createListener(_0x3437cb,_0x2b1fba){return function(_0x282bd0){_0x2b1fba['emit'](_0x3437cb,_0x282bd0);};}function removeListener(_0x31b914,_0x26e690){return function(){SmsMessageEvents['removeListener'](_0x31b914,_0x26e690);};}exports[_0x9145('0x4')]=function(_0x583f99){for(var _0x123ce2=0x0,_0x35f311=events['length'];_0x123ce2<_0x35f311;_0x123ce2++){var _0x414550=events[_0x123ce2];var _0xb9d383=createListener(_0x9145('0x5')+_0x414550,_0x583f99);SmsMessageEvents['on'](_0x414550,_0xb9d383);}}; \ No newline at end of file +var _0xe59a=['remove','update','emit','removeListener','register','smsMessage:','save'];(function(_0x175ed1,_0x3d9a30){var _0x1b4c37=function(_0x59522f){while(--_0x59522f){_0x175ed1['push'](_0x175ed1['shift']());}};_0x1b4c37(++_0x3d9a30);}(_0xe59a,0xca));var _0xae59=function(_0x571dfd,_0x5c5d0d){_0x571dfd=_0x571dfd-0x0;var _0x1731d9=_0xe59a[_0x571dfd];return _0x1731d9;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xae59('0x0'),_0xae59('0x1'),_0xae59('0x2')];function createListener(_0x2575bc,_0x2bb3e7){return function(_0x3d04b0){_0x2bb3e7[_0xae59('0x3')](_0x2575bc,_0x3d04b0);};}function removeListener(_0x379b58,_0x2b93a5){return function(){SmsMessageEvents[_0xae59('0x4')](_0x379b58,_0x2b93a5);};}exports[_0xae59('0x5')]=function(_0x46b8f6){for(var _0x1fcf1d=0x0,_0x59a09b=events['length'];_0x1fcf1d<_0x59a09b;_0x1fcf1d++){var _0x495e8e=events[_0x1fcf1d];var _0x32329b=createListener(_0xae59('0x6')+_0x495e8e,_0x46b8f6);SmsMessageEvents['on'](_0x495e8e,_0x32329b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index cab1c91..d0e2abe 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 _0xd8a5=['destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete'];(function(_0xf2267d,_0x10c87c){var _0x207e0d=function(_0x12b23d){while(--_0x12b23d){_0xf2267d['push'](_0xf2267d['shift']());}};_0x207e0d(++_0x10c87c);}(_0xd8a5,0x160));var _0x5d8a=function(_0x226a57,_0x3c5397){_0x226a57=_0x226a57-0x0;var _0xfcdbcc=_0xd8a5[_0x226a57];return _0xfcdbcc;};'use strict';var multer=require(_0x5d8a('0x0'));var util=require('util');var path=require(_0x5d8a('0x1'));var timeout=require(_0x5d8a('0x2'));var express=require('express');var router=express[_0x5d8a('0x3')]();var auth=require(_0x5d8a('0x4'));var interaction=require(_0x5d8a('0x5'));var config=require(_0x5d8a('0x6'));var controller=require(_0x5d8a('0x7'));router[_0x5d8a('0x8')]('/',auth[_0x5d8a('0x9')](),controller[_0x5d8a('0xa')]);router[_0x5d8a('0x8')](_0x5d8a('0xb'),auth[_0x5d8a('0x9')](),controller[_0x5d8a('0xc')]);router[_0x5d8a('0x8')]('/:id',auth[_0x5d8a('0x9')](),controller[_0x5d8a('0xd')]);router[_0x5d8a('0x8')](_0x5d8a('0xe'),auth[_0x5d8a('0x9')](),controller['getMembers']);router[_0x5d8a('0x8')](_0x5d8a('0xf'),auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x10')]);router['get'](_0x5d8a('0x11'),auth[_0x5d8a('0x9')](),controller['getAgents']);router[_0x5d8a('0x12')]('/',auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x13')]);router[_0x5d8a('0x12')](_0x5d8a('0xf'),auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x14')]);router[_0x5d8a('0x12')](_0x5d8a('0x11'),auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x15')]);router[_0x5d8a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5d8a('0x17')]);router[_0x5d8a('0x18')]('/:id',auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x19')]);router[_0x5d8a('0x18')](_0x5d8a('0xf'),auth['isAuthenticated'](),controller[_0x5d8a('0x1a')]);router['delete'](_0x5d8a('0x11'),auth[_0x5d8a('0x9')](),controller[_0x5d8a('0x1b')]);module[_0x5d8a('0x1c')]=router; \ No newline at end of file +var _0x82f8=['./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','/:id','destroy','removeTeams','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x82f8,0x157));var _0x882f=function(_0x38d0af,_0x5d2f92){_0x38d0af=_0x38d0af-0x0;var _0x29fa3f=_0x82f8[_0x38d0af];return _0x29fa3f;};'use strict';var multer=require('multer');var util=require(_0x882f('0x0'));var path=require(_0x882f('0x1'));var timeout=require('connect-timeout');var express=require(_0x882f('0x2'));var router=express[_0x882f('0x3')]();var auth=require(_0x882f('0x4'));var interaction=require(_0x882f('0x5'));var config=require(_0x882f('0x6'));var controller=require(_0x882f('0x7'));router[_0x882f('0x8')]('/',auth[_0x882f('0x9')](),controller['index']);router['get'](_0x882f('0xa'),auth[_0x882f('0x9')](),controller[_0x882f('0xb')]);router[_0x882f('0x8')]('/:id',auth[_0x882f('0x9')](),controller['show']);router[_0x882f('0x8')]('/:id/members',auth[_0x882f('0x9')](),controller['getMembers']);router['get'](_0x882f('0xc'),auth[_0x882f('0x9')](),controller[_0x882f('0xd')]);router[_0x882f('0x8')](_0x882f('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0x882f('0xf')]('/',auth[_0x882f('0x9')](),controller[_0x882f('0x10')]);router[_0x882f('0xf')](_0x882f('0xc'),auth[_0x882f('0x9')](),controller[_0x882f('0x11')]);router['post'](_0x882f('0xe'),auth[_0x882f('0x9')](),controller[_0x882f('0x12')]);router[_0x882f('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x882f('0x14')](_0x882f('0x15'),auth[_0x882f('0x9')](),controller[_0x882f('0x16')]);router[_0x882f('0x14')](_0x882f('0xc'),auth[_0x882f('0x9')](),controller[_0x882f('0x17')]);router['delete'](_0x882f('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x882f('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6fa563a..2bd2b01 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 _0x8be8=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x8be8,0x10b));var _0x88be=function(_0x200258,_0x5bdf12){_0x200258=_0x200258-0x0;var _0x1edc1d=_0x8be8[_0x200258];return _0x1edc1d;};'use strict';var Sequelize=require(_0x88be('0x0'));module[_0x88be('0x1')]={'name':{'type':Sequelize[_0x88be('0x2')],'unique':_0x88be('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x88be('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x88be('0x5'),_0x88be('0x6'),_0x88be('0x7'))}}; \ No newline at end of file +var _0x4a29=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4a29,0x6b));var _0x94a2=function(_0x3f0512,_0xe123e){_0x3f0512=_0x3f0512-0x0;var _0x4c9de2=_0x4a29[_0x3f0512];return _0x4c9de2;};'use strict';var Sequelize=require(_0x94a2('0x0'));module[_0x94a2('0x1')]={'name':{'type':Sequelize[_0x94a2('0x2')],'unique':_0x94a2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x94a2('0x2')]},'timeout':{'type':Sequelize[_0x94a2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x94a2('0x5'),_0x94a2('0x6'),_0x94a2('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index bc375c6..74d15e5 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 _0x593c=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','ids','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','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/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create'];(function(_0x37e39f,_0x426ea2){var _0x5754a6=function(_0x108d89){while(--_0x108d89){_0x37e39f['push'](_0x37e39f['shift']());}};_0x5754a6(++_0x426ea2);}(_0x593c,0x15f));var _0xc593=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x593c[_0x5e709a];return _0x57401a;};'use strict';var pdf=require(_0xc593('0x0'));var emlformat=require(_0xc593('0x1'));var rimraf=require(_0xc593('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc593('0x3'));var BPromise=require(_0xc593('0x4'));var Mustache=require('mustache');var util=require(_0xc593('0x5'));var path=require('path');var sox=require(_0xc593('0x6'));var csv=require(_0xc593('0x7'));var ejs=require(_0xc593('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc593('0x9'));var crypto=require(_0xc593('0xa'));var jsforce=require(_0xc593('0xb'));var deskjs=require(_0xc593('0xc'));var toCsv=require(_0xc593('0x7'));var querystring=require(_0xc593('0xd'));var Papa=require(_0xc593('0xe'));var Redis=require(_0xc593('0xf'));var authService=require(_0xc593('0x10'));var qs=require(_0xc593('0x11'));var as=require(_0xc593('0x12'));var hardwareService=require(_0xc593('0x13'));var logger=require(_0xc593('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc593('0x15'));var db=require(_0xc593('0x16'))['db'];config['redis']=_[_0xc593('0x17')](config[_0xc593('0x18')],{'host':_0xc593('0x19'),'port':0x18eb});var socket=require(_0xc593('0x1a'))(new Redis(config[_0xc593('0x18')]));require(_0xc593('0x1b'))[_0xc593('0x1c')](socket);function respondWithStatusCode(_0x1775a9,_0x131983){_0x131983=_0x131983||0xcc;return function(_0x4d0d79){if(_0x4d0d79){return _0x1775a9[_0xc593('0x1d')](_0x131983);}return _0x1775a9['status'](_0x131983)[_0xc593('0x1e')]();};}function respondWithResult(_0x48a549,_0xf28dfb){_0xf28dfb=_0xf28dfb||0xc8;return function(_0x5ada53){if(_0x5ada53){return _0x48a549[_0xc593('0x1f')](_0xf28dfb)[_0xc593('0x20')](_0x5ada53);}};}function respondWithFilteredResult(_0x406d73,_0x4aa2cc){return function(_0x1592ff){if(_0x1592ff){var _0x5d37e3=_0x1592ff[_0xc593('0x21')],_0x4314a1=_0x4aa2cc[_0xc593('0x22')],_0x26bf88=_0x4aa2cc[_0xc593('0x22')]+_0x4aa2cc[_0xc593('0x23')],_0x4741e8;if(_0x26bf88>=_0x5d37e3){_0x26bf88=_0x5d37e3;_0x4741e8=0xc8;}else{_0x4741e8=0xce;}_0x406d73[_0xc593('0x1f')](_0x4741e8);return _0x406d73[_0xc593('0x24')](_0xc593('0x25'),_0x4314a1+'-'+_0x26bf88+'/'+_0x5d37e3)[_0xc593('0x20')](_0x1592ff);}return null;};}function patchUpdates(_0x5d3e3b){return function(_0x41454e){try{jsonpatch[_0xc593('0x26')](_0x41454e,_0x5d3e3b,!![]);}catch(_0x29217e){return BPromise[_0xc593('0x27')](_0x29217e);}return _0x41454e[_0xc593('0x28')]();};}function saveUpdates(_0x427dea,_0x4f86aa){return function(_0x1c6224){if(_0x1c6224){return _0x1c6224[_0xc593('0x29')](_0x427dea)[_0xc593('0x2a')](function(_0x2c6ddb){return _0x2c6ddb;});}return null;};}function removeEntity(_0x1020e6,_0x57063a){return function(_0x53650a){if(_0x53650a){return _0x53650a['destroy']()[_0xc593('0x2a')](function(){var _0x388d0b=_0x53650a[_0xc593('0x2b')]({'plain':!![]});var _0x4c7573='SmsQueues';return db[_0xc593('0x2c')][_0xc593('0x2d')]({'where':{'type':_0x4c7573,'resourceId':_0x388d0b['id']}})['then'](function(){return _0x53650a;});})[_0xc593('0x2a')](function(){_0x1020e6[_0xc593('0x1f')](0xcc)[_0xc593('0x1e')]();});}};}function handleEntityNotFound(_0x1608b9,_0x382a23){return function(_0x42af51){if(!_0x42af51){_0x1608b9[_0xc593('0x1d')](0x194);}return _0x42af51;};}function handleError(_0x432e1b,_0x640d00){_0x640d00=_0x640d00||0x1f4;return function(_0x438482){logger[_0xc593('0x2e')](_0x438482[_0xc593('0x2f')]);if(_0x438482[_0xc593('0x30')]){delete _0x438482[_0xc593('0x30')];}_0x432e1b[_0xc593('0x1f')](_0x640d00)[_0xc593('0x31')](_0x438482);};}exports[_0xc593('0x32')]=function(_0x54a663,_0x935582){var _0x56ba23={},_0x1a6fef={},_0x4153bf={'count':0x0,'rows':[]};var _0x50a550=_['map'](db[_0xc593('0x33')][_0xc593('0x34')],function(_0x1eeb04){return{'name':_0x1eeb04[_0xc593('0x35')],'type':_0x1eeb04['type']['key']};});_0x1a6fef[_0xc593('0x36')]=_[_0xc593('0x37')](_0x50a550,_0xc593('0x30'));_0x1a6fef[_0xc593('0x38')]=_[_0xc593('0x39')](_0x54a663[_0xc593('0x38')]);_0x1a6fef[_0xc593('0x3a')]=_['intersection'](_0x1a6fef['model'],_0x1a6fef[_0xc593('0x38')]);_0x56ba23[_0xc593('0x3b')]=_[_0xc593('0x3c')](_0x1a6fef[_0xc593('0x36')],qs[_0xc593('0x3d')](_0x54a663[_0xc593('0x38')]['fields']));_0x56ba23[_0xc593('0x3b')]=_0x56ba23[_0xc593('0x3b')][_0xc593('0x3e')]?_0x56ba23[_0xc593('0x3b')]:_0x1a6fef[_0xc593('0x36')];if(!_0x54a663[_0xc593('0x38')][_0xc593('0x3f')](_0xc593('0x40'))){_0x56ba23[_0xc593('0x23')]=qs['limit'](_0x54a663['query'][_0xc593('0x23')]);_0x56ba23[_0xc593('0x22')]=qs[_0xc593('0x22')](_0x54a663['query'][_0xc593('0x22')]);}_0x56ba23[_0xc593('0x41')]=qs[_0xc593('0x42')](_0x54a663[_0xc593('0x38')]['sort']);_0x56ba23[_0xc593('0x43')]=qs[_0xc593('0x3a')](_[_0xc593('0x44')](_0x54a663[_0xc593('0x38')],_0x1a6fef[_0xc593('0x3a')]),_0x50a550);if(_0x54a663[_0xc593('0x38')][_0xc593('0x45')]){_0x56ba23[_0xc593('0x43')]=_[_0xc593('0x46')](_0x56ba23[_0xc593('0x43')],{'$or':_['map'](_0x50a550,function(_0x1d8656){if(_0x1d8656['type']!==_0xc593('0x47')){var _0x3394de={};_0x3394de[_0x1d8656[_0xc593('0x30')]]={'$like':'%'+_0x54a663[_0xc593('0x38')][_0xc593('0x45')]+'%'};return _0x3394de;}})});}_0x56ba23=_[_0xc593('0x46')]({},_0x56ba23,_0x54a663[_0xc593('0x48')]);var _0x1102e4={'where':_0x56ba23[_0xc593('0x43')]};return db['SmsQueue'][_0xc593('0x21')](_0x1102e4)[_0xc593('0x2a')](function(_0x241822){_0x4153bf[_0xc593('0x21')]=_0x241822;if(_0x54a663['query']['includeAll']){_0x56ba23[_0xc593('0x49')]=[{'all':!![]}];}return db[_0xc593('0x33')][_0xc593('0x4a')](_0x56ba23);})[_0xc593('0x2a')](function(_0x40afe7){_0x4153bf['rows']=_0x40afe7;return _0x4153bf;})['then'](respondWithFilteredResult(_0x935582,_0x56ba23))[_0xc593('0x4b')](handleError(_0x935582,null));};exports[_0xc593('0x4c')]=function(_0x17ae62,_0x1d3ffb){var _0x8a43a1={'raw':!![],'where':{'id':_0x17ae62[_0xc593('0x4d')]['id']}},_0x5732b1={};_0x5732b1[_0xc593('0x36')]=_[_0xc593('0x39')](db['SmsQueue'][_0xc593('0x34')]);_0x5732b1[_0xc593('0x38')]=_['keys'](_0x17ae62[_0xc593('0x38')]);_0x5732b1[_0xc593('0x3a')]=_[_0xc593('0x3c')](_0x5732b1[_0xc593('0x36')],_0x5732b1[_0xc593('0x38')]);_0x8a43a1[_0xc593('0x3b')]=_[_0xc593('0x3c')](_0x5732b1[_0xc593('0x36')],qs['fields'](_0x17ae62[_0xc593('0x38')][_0xc593('0x3d')]));_0x8a43a1[_0xc593('0x3b')]=_0x8a43a1[_0xc593('0x3b')][_0xc593('0x3e')]?_0x8a43a1['attributes']:_0x5732b1[_0xc593('0x36')];if(_0x17ae62[_0xc593('0x38')][_0xc593('0x4e')]){_0x8a43a1['include']=[{'all':!![]}];}_0x8a43a1=_[_0xc593('0x46')]({},_0x8a43a1,_0x17ae62[_0xc593('0x48')]);return db[_0xc593('0x33')][_0xc593('0x4f')](_0x8a43a1)[_0xc593('0x2a')](handleEntityNotFound(_0x1d3ffb,null))[_0xc593('0x2a')](respondWithResult(_0x1d3ffb,null))['catch'](handleError(_0x1d3ffb,null));};exports[_0xc593('0x50')]=function(_0x22b4e0,_0x4fcb2a){return db['SmsQueue']['create'](_0x22b4e0[_0xc593('0x51')],{})[_0xc593('0x2a')](function(_0x5b81ab){var _0x4d665a=_0x22b4e0['user']['get']({'plain':!![]});if(!_0x4d665a)throw new Error(_0xc593('0x52'));if(_0x4d665a[_0xc593('0x53')]===_0xc593('0x54')){var _0x3d7344=_0x5b81ab['get']({'plain':!![]});var _0x1af776=_0xc593('0x55');return db[_0xc593('0x56')][_0xc593('0x4f')]({'where':{'name':_0x1af776,'userProfileId':_0x4d665a['userProfileId']},'raw':!![]})[_0xc593('0x2a')](function(_0x45c83e){if(_0x45c83e&&_0x45c83e[_0xc593('0x57')]===0x0){return db[_0xc593('0x2c')]['create']({'name':_0x3d7344[_0xc593('0x30')],'resourceId':_0x3d7344['id'],'type':_0x45c83e[_0xc593('0x30')],'sectionId':_0x45c83e['id']},{})['then'](function(){return _0x5b81ab;});}else{return _0x5b81ab;}})[_0xc593('0x4b')](function(_0x4334d2){logger[_0xc593('0x2e')](_0xc593('0x58'),_0x4334d2);throw _0x4334d2;});}return _0x5b81ab;})[_0xc593('0x2a')](respondWithResult(_0x4fcb2a,0xc9))[_0xc593('0x4b')](handleError(_0x4fcb2a,null));};exports['update']=function(_0x28adcf,_0x54497e){if(_0x28adcf['body']['id']){delete _0x28adcf['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x28adcf[_0xc593('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54497e,null))['then'](saveUpdates(_0x28adcf['body'],null))['then'](respondWithResult(_0x54497e,null))[_0xc593('0x4b')](handleError(_0x54497e,null));};exports['destroy']=function(_0x1798df,_0x231c1d){return db[_0xc593('0x33')][_0xc593('0x4f')]({'where':{'id':_0x1798df['params']['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x231c1d,null))[_0xc593('0x2a')](removeEntity(_0x231c1d,null))[_0xc593('0x4b')](handleError(_0x231c1d,null));};exports[_0xc593('0x59')]=function(_0x351b59,_0xfbd45e){return db[_0xc593('0x33')][_0xc593('0x59')]()[_0xc593('0x2a')](respondWithResult(_0xfbd45e,null))[_0xc593('0x4b')](handleError(_0xfbd45e,null));};exports[_0xc593('0x5a')]=function(_0x53826d,_0x2e0aa0,_0x259097){var _0x2e00a2={'raw':!![],'where':{}},_0x2ab306={},_0x5f2abc;return db['SmsQueue'][_0xc593('0x5b')]({'where':{'id':_0x53826d[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x2e0aa0,null))['then'](function(_0x13f157){if(_0x13f157){_0x5f2abc=_0x13f157[_0xc593('0x2b')]({'plain':!![]});_0x2ab306[_0xc593('0x36')]=_['keys'](db[_0xc593('0x5c')][_0xc593('0x34')]);_0x2ab306[_0xc593('0x38')]=_[_0xc593('0x39')](_0x53826d['query']);_0x2ab306[_0xc593('0x3a')]=_[_0xc593('0x3c')](_0x2ab306[_0xc593('0x36')],_0x2ab306[_0xc593('0x38')]);_0x2e00a2[_0xc593('0x3b')]=_[_0xc593('0x3c')](_0x2ab306[_0xc593('0x36')],qs[_0xc593('0x3d')](_0x53826d[_0xc593('0x38')][_0xc593('0x3d')]));_0x2e00a2[_0xc593('0x3b')]=_0x2e00a2[_0xc593('0x3b')]['length']?_0x2e00a2[_0xc593('0x3b')]:_0x2ab306[_0xc593('0x36')];if(!_0x53826d[_0xc593('0x38')][_0xc593('0x3f')](_0xc593('0x40'))){_0x2e00a2[_0xc593('0x23')]=qs['limit'](_0x53826d[_0xc593('0x38')][_0xc593('0x23')]);_0x2e00a2[_0xc593('0x22')]=qs[_0xc593('0x22')](_0x53826d['query']['offset']);}_0x2e00a2[_0xc593('0x41')]=qs[_0xc593('0x42')](_0x53826d[_0xc593('0x38')][_0xc593('0x42')]);_0x2e00a2['where']=qs[_0xc593('0x3a')](_['pick'](_0x53826d['query'],_0x2ab306['filters']));_0x2e00a2['where'][_0xc593('0x5d')]=_0x13f157['id'];if(_0x53826d[_0xc593('0x38')]['filter']){_0x2e00a2['where']=_[_0xc593('0x46')](_0x2e00a2[_0xc593('0x43')],{'$or':_[_0xc593('0x37')](_0x2e00a2[_0xc593('0x3b')],function(_0x348117){var _0x33a5ee={};_0x33a5ee[_0x348117]={'$like':'%'+_0x53826d['query'][_0xc593('0x45')]+'%'};return _0x33a5ee;})});}_0x2e00a2=_['merge']({},_0x2e00a2,_0x53826d['options']);return db[_0xc593('0x5c')][_0xc593('0x4a')](_0x2e00a2);}})[_0xc593('0x2a')](function(_0x34d878){if(_0x34d878){return db['User'][_0xc593('0x5e')]({'where':{'id':_[_0xc593('0x37')](_0x34d878,_0xc593('0x5f')),'role':'agent'},'attributes':['id',_0xc593('0x30'),_0xc593('0x60'),_0xc593('0x61'),_0xc593('0x62')]});}})[_0xc593('0x2a')](function(_0x3e5a59){if(_0x3e5a59){return{'count':_0x3e5a59[_0xc593('0x21')],'rows':_[_0xc593('0x37')](_0x3e5a59[_0xc593('0x63')],function(_0xc9dc2e){return{'membername':_0xc9dc2e[_0xc593('0x30')],'UserId':_0xc9dc2e['id'],'queue_name':_0x5f2abc[_0xc593('0x30')],'SmsQueueId':_0x5f2abc['id'],'interface':util[_0xc593('0x64')](_0xc593('0x65'),_0xc593('0x66'),_0xc9dc2e[_0xc593('0x30')]),'penalty':0x0,'paused':_0xc9dc2e[_0xc593('0x60')],'createdAt':_0xc9dc2e[_0xc593('0x62')],'updatedAt':_0xc9dc2e[_0xc593('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc593('0x2a')](respondWithFilteredResult(_0x2e0aa0,_0x2e00a2))[_0xc593('0x4b')](handleError(_0x2e0aa0,null));};exports['getTeams']=function(_0x5951a1,_0x1bf482,_0x1441f5){var _0x1ec6bf={};var _0x20cb83={};var _0x147af1;var _0x605c60;return db[_0xc593('0x33')][_0xc593('0x5b')]({'where':{'id':_0x5951a1[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x1bf482,null))['then'](function(_0x544d43){if(_0x544d43){_0x147af1=_0x544d43;_0x20cb83[_0xc593('0x36')]=_['keys'](db[_0xc593('0x67')]['rawAttributes']);_0x20cb83[_0xc593('0x38')]=_['keys'](_0x5951a1[_0xc593('0x38')]);_0x20cb83[_0xc593('0x3a')]=_[_0xc593('0x3c')](_0x20cb83['model'],_0x20cb83[_0xc593('0x38')]);_0x1ec6bf[_0xc593('0x3b')]=_[_0xc593('0x3c')](_0x20cb83[_0xc593('0x36')],qs[_0xc593('0x3d')](_0x5951a1[_0xc593('0x38')][_0xc593('0x3d')]));_0x1ec6bf[_0xc593('0x3b')]=_0x1ec6bf[_0xc593('0x3b')][_0xc593('0x3e')]?_0x1ec6bf[_0xc593('0x3b')]:_0x20cb83['model'];_0x1ec6bf[_0xc593('0x41')]=qs[_0xc593('0x42')](_0x5951a1[_0xc593('0x38')][_0xc593('0x42')]);_0x1ec6bf[_0xc593('0x43')]=qs[_0xc593('0x3a')](_[_0xc593('0x44')](_0x5951a1[_0xc593('0x38')],_0x20cb83[_0xc593('0x3a')]));if(_0x5951a1['query']['filter']){_0x1ec6bf[_0xc593('0x43')]=_[_0xc593('0x46')](_0x1ec6bf[_0xc593('0x43')],{'$or':_[_0xc593('0x37')](_0x1ec6bf[_0xc593('0x3b')],function(_0x3047ec){var _0x1f4286={};_0x1f4286[_0x3047ec]={'$like':'%'+_0x5951a1[_0xc593('0x38')][_0xc593('0x45')]+'%'};return _0x1f4286;})});}_0x1ec6bf=_[_0xc593('0x46')]({},_0x1ec6bf,_0x5951a1[_0xc593('0x48')]);return _0x147af1['getTeams'](_0x1ec6bf);}})[_0xc593('0x2a')](function(_0x409de4){if(_0x409de4){_0x605c60=_0x409de4[_0xc593('0x3e')];if(!_0x5951a1[_0xc593('0x38')][_0xc593('0x3f')](_0xc593('0x40'))){_0x1ec6bf[_0xc593('0x23')]=qs['limit'](_0x5951a1[_0xc593('0x38')][_0xc593('0x23')]);_0x1ec6bf[_0xc593('0x22')]=qs['offset'](_0x5951a1[_0xc593('0x38')][_0xc593('0x22')]);}return _0x147af1[_0xc593('0x68')](_0x1ec6bf);}})[_0xc593('0x2a')](function(_0x57dda6){if(_0x57dda6){return _0x57dda6?{'count':_0x605c60,'rows':_0x57dda6}:null;}})['then'](respondWithResult(_0x1bf482,null))[_0xc593('0x4b')](handleError(_0x1bf482,null));};exports[_0xc593('0x69')]=function(_0x5da371,_0x1d7c96,_0x23a5c5){var _0x55c8e4=_0x5da371[_0xc593('0x51')]['ids'];return db[_0xc593('0x67')][_0xc593('0x4a')]({'where':{'id':_0x55c8e4},'attributes':['id'],'include':[{'model':db[_0xc593('0x6a')],'as':_0xc593('0x6b'),'attributes':['id',_0xc593('0x30'),_0xc593('0x6c'),_0xc593('0x6d'),'interface'],'raw':!![]}]})[_0xc593('0x2a')](function(_0x3125a4){if(_0x3125a4){var _0xefb06f=_[_0xc593('0x6e')](_0x3125a4,function(_0x1ccdd6){var _0x44d662=_0x1ccdd6[_0xc593('0x2b')]({'plain':!![]});return _0x44d662[_0xc593('0x6b')];});return db['SmsQueue'][_0xc593('0x4f')]({'where':{'id':_0x5da371[_0xc593('0x4d')]['id']}})['then'](function(_0x14e568){return db['sequelize'][_0xc593('0x6f')](function(_0x2228da){return _0x14e568['addTeams'](_0x55c8e4,{'transaction':_0x2228da})[_0xc593('0x2a')](function(){return BPromise[_0xc593('0x70')](_0xefb06f,function(_0x109df7){return db[_0xc593('0x5c')][_0xc593('0x71')]({'where':{'UserId':_0x109df7['id'],'SmsQueueId':_0x5da371['params']['id']},'transaction':_0x2228da});});})[_0xc593('0x2a')](function(){_0xefb06f[_0xc593('0x72')](function(_0x5816d3){socket[_0xc593('0x73')](_0xc593('0x74'),{'UserId':_0x5816d3['id'],'SmsQueueId':_0x14e568['id']});});});});});}})[_0xc593('0x2a')](respondWithStatusCode(_0x1d7c96,null))[_0xc593('0x4b')](handleError(_0x1d7c96,null));};exports['removeTeams']=function(_0x8a0812,_0x3a5d6e,_0x53290f){return db['Team'][_0xc593('0x4a')]({'where':{'id':_0x8a0812['query'][_0xc593('0x75')]},'attributes':['id'],'include':[{'model':db[_0xc593('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc593('0x2a')](handleEntityNotFound(_0x3a5d6e,null))[_0xc593('0x2a')](function(_0x33373b){var _0x361ff8=_[_0xc593('0x37')](_0x33373b,'id');var _0x3ad479=[];var _0x39facc=[];var _0x205520=squel[_0xc593('0x76')]();_0x205520['field'](_0xc593('0x77'))[_0xc593('0x78')](_0xc593('0x79'),'tq')[_0xc593('0x7a')](_0xc593('0x7b'),'ut',_0xc593('0x7c'))['where']('SmsQueueId\x20=\x20?',_0x8a0812[_0xc593('0x4d')]['id']);for(var _0x23938e=0x0;_0x23938e<_0x33373b[_0xc593('0x3e')];_0x23938e+=0x1){let _0x314716=_0x33373b[_0x23938e];for(var _0x7e054f=0x0;_0x7e054f<_0x314716[_0xc593('0x6b')][_0xc593('0x3e')];_0x7e054f+=0x1){let _0x3357c2=_0x314716[_0xc593('0x6b')][_0x7e054f];var _0x3d6bdf=_0x205520['clone']();_0x3d6bdf[_0xc593('0x43')](_0xc593('0x7d'),_0x3357c2['id']);_0x39facc['push'](db[_0xc593('0x7e')]['query'](_0x3d6bdf['toString'](),{'type':db[_0xc593('0x7e')][_0xc593('0x7f')][_0xc593('0x80')]})['then'](function(_0x2d1355){if(_0x2d1355['length']===0x1){return _0x3357c2['id'];}else{var _0x3cb8b4=_[_0xc593('0x81')](_[_0xc593('0x37')](_0x2d1355,_0xc593('0x82')),function(_0xf53c29){return _[_0xc593('0x83')](_0x361ff8,_0xf53c29);});if(_0x3cb8b4){return _0x3357c2['id'];}}}));}}return BPromise[_0xc593('0x84')](_0x39facc)[_0xc593('0x2a')](function(_0x4ebe2e){_0x3ad479=_(_0x3ad479)[_0xc593('0x85')](_0x4ebe2e)['compact']()[_0xc593('0x86')]();return db['SmsQueue'][_0xc593('0x4f')]({'where':{'id':_0x8a0812[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](function(_0x575a6f){return db['sequelize'][_0xc593('0x6f')](function(_0x5ab3d6){return _0x575a6f[_0xc593('0x87')](_0x8a0812[_0xc593('0x38')]['ids'],{'transaction':_0x5ab3d6})[_0xc593('0x2a')](function(){if(!_[_0xc593('0x88')](_0x3ad479)){return _0x575a6f[_0xc593('0x89')](_0x3ad479,{'transaction':_0x5ab3d6});}})[_0xc593('0x2a')](function(){_0x3ad479[_0xc593('0x72')](function(_0xaa028a){socket['emit']('userSmsQueue:remove',{'UserId':_0xaa028a,'SmsQueueId':_0x575a6f['id']});});});});});});})['then'](respondWithStatusCode(_0x3a5d6e,null))['catch'](handleError(_0x3a5d6e,null));};exports[_0xc593('0x8a')]=function(_0x22f74b,_0x3e8285,_0x1f4645){return db[_0xc593('0x33')]['find']({'where':{'id':_0x22f74b[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x3e8285,null))['then'](function(_0x3d3c56){if(_0x3d3c56){return _0x3d3c56[_0xc593('0x8a')](_0x22f74b[_0xc593('0x51')][_0xc593('0x75')],_[_0xc593('0x8b')](_0x22f74b['body'],[_0xc593('0x75'),'id'])||{})[_0xc593('0x8c')](function(_0x4159e2){for(var _0xcea3e5=0x0;_0xcea3e5<_0x22f74b[_0xc593('0x51')][_0xc593('0x75')][_0xc593('0x3e')];_0xcea3e5+=0x1){socket['emit'](_0xc593('0x74'),{'UserId':_0x22f74b['body'][_0xc593('0x75')][_0xcea3e5],'SmsQueueId':_0x22f74b[_0xc593('0x4d')]['id']});}return _0x4159e2;});}})[_0xc593('0x2a')](respondWithResult(_0x3e8285,null))[_0xc593('0x4b')](handleError(_0x3e8285,null));};exports[_0xc593('0x89')]=function(_0x2a61d6,_0x422728,_0x425ae3){return db[_0xc593('0x33')]['find']({'where':{'id':_0x2a61d6[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x422728,null))['then'](function(_0x526181){if(_0x526181){return _0x526181[_0xc593('0x89')](_0x2a61d6['query']['ids'])[_0xc593('0x2a')](function(){if(_[_0xc593('0x8d')](_0x2a61d6[_0xc593('0x38')][_0xc593('0x75')])){for(var _0x2d3e5d=0x0;_0x2d3e5d<_0x2a61d6[_0xc593('0x38')][_0xc593('0x75')]['length'];_0x2d3e5d+=0x1){socket[_0xc593('0x73')](_0xc593('0x8e'),{'UserId':Number(_0x2a61d6[_0xc593('0x38')][_0xc593('0x75')][_0x2d3e5d]),'SmsQueueId':Number(_0x2a61d6[_0xc593('0x4d')]['id'])});}}else{socket[_0xc593('0x73')](_0xc593('0x8e'),{'UserId':Number(_0x2a61d6['query'][_0xc593('0x75')]),'SmsQueueId':Number(_0x2a61d6['params']['id'])});}});}})[_0xc593('0x2a')](respondWithStatusCode(_0x422728,null))[_0xc593('0x4b')](handleError(_0x422728,null));};exports[_0xc593('0x8f')]=function(_0x55b80c,_0x3e5bf7,_0x23717e){var _0x533ec9={};var _0x53b4d0={};var _0x50a5c2;var _0x4131cb;return db[_0xc593('0x33')]['findOne']({'where':{'id':_0x55b80c[_0xc593('0x4d')]['id']}})[_0xc593('0x2a')](handleEntityNotFound(_0x3e5bf7,null))[_0xc593('0x2a')](function(_0x150b50){if(_0x150b50){_0x50a5c2=_0x150b50;_0x53b4d0[_0xc593('0x36')]=_[_0xc593('0x39')](db[_0xc593('0x6a')][_0xc593('0x34')]);_0x53b4d0['query']=_['keys'](_0x55b80c[_0xc593('0x38')]);_0x53b4d0['filters']=_[_0xc593('0x3c')](_0x53b4d0['model'],_0x53b4d0[_0xc593('0x38')]);_0x533ec9[_0xc593('0x3b')]=_[_0xc593('0x3c')](_0x53b4d0[_0xc593('0x36')],qs[_0xc593('0x3d')](_0x55b80c['query']['fields']));_0x533ec9[_0xc593('0x3b')]=_0x533ec9[_0xc593('0x3b')][_0xc593('0x3e')]?_0x533ec9[_0xc593('0x3b')]:_0x53b4d0[_0xc593('0x36')];_0x533ec9[_0xc593('0x41')]=qs['sort'](_0x55b80c[_0xc593('0x38')]['sort']);_0x533ec9['where']=qs[_0xc593('0x3a')](_[_0xc593('0x44')](_0x55b80c[_0xc593('0x38')],_0x53b4d0['filters']));if(_0x55b80c[_0xc593('0x38')][_0xc593('0x45')]){_0x533ec9[_0xc593('0x43')]=_[_0xc593('0x46')](_0x533ec9[_0xc593('0x43')],{'$or':_[_0xc593('0x37')](_0x533ec9[_0xc593('0x3b')],function(_0x186484){var _0x4e8613={};_0x4e8613[_0x186484]={'$like':'%'+_0x55b80c[_0xc593('0x38')][_0xc593('0x45')]+'%'};return _0x4e8613;})});}_0x533ec9=_[_0xc593('0x46')]({},_0x533ec9,_0x55b80c[_0xc593('0x48')]);return _0x50a5c2[_0xc593('0x8f')](_0x533ec9);}})[_0xc593('0x2a')](function(_0x5addc6){if(_0x5addc6){_0x4131cb=_0x5addc6['length'];if(!_0x55b80c[_0xc593('0x38')][_0xc593('0x3f')](_0xc593('0x40'))){_0x533ec9['limit']=qs[_0xc593('0x23')](_0x55b80c['query'][_0xc593('0x23')]);_0x533ec9[_0xc593('0x22')]=qs[_0xc593('0x22')](_0x55b80c['query'][_0xc593('0x22')]);}return _0x50a5c2[_0xc593('0x8f')](_0x533ec9);}})[_0xc593('0x2a')](function(_0x1d831b){if(_0x1d831b){return _0x1d831b?{'count':_0x4131cb,'rows':_0x1d831b}:null;}})[_0xc593('0x2a')](respondWithResult(_0x3e5bf7,null))[_0xc593('0x4b')](handleError(_0x3e5bf7,null));}; \ No newline at end of file +var _0x9b9b=['query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','user','role','find','userProfileId','update','describe','getMembers','UserSmsQueue','sort','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','getTeams','addTeams','ids','online','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','Team','Agents','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','offset','limit','set','json','reject','save','then','get','SmsQueues','destroy','end','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b9b,0xe3));var _0xb9b9=function(_0x2b38a6,_0x4fbc47){_0x2b38a6=_0x2b38a6-0x0;var _0x118544=_0x9b9b[_0x2b38a6];return _0x118544;};'use strict';var pdf=require(_0xb9b9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb9b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var moment=require('moment');var BPromise=require(_0xb9b9('0x4'));var Mustache=require(_0xb9b9('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb9b9('0x6'));var csv=require('to-csv');var ejs=require(_0xb9b9('0x7'));var fs=require('fs');var _=require(_0xb9b9('0x8'));var squel=require(_0xb9b9('0x9'));var crypto=require(_0xb9b9('0xa'));var jsforce=require(_0xb9b9('0xb'));var deskjs=require(_0xb9b9('0xc'));var toCsv=require(_0xb9b9('0xd'));var querystring=require(_0xb9b9('0xe'));var Papa=require(_0xb9b9('0xf'));var Redis=require('ioredis');var authService=require(_0xb9b9('0x10'));var qs=require(_0xb9b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9b9('0x12'));var logger=require(_0xb9b9('0x13'))(_0xb9b9('0x14'));var utils=require(_0xb9b9('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb9b9('0x16')]=_[_0xb9b9('0x17')](config[_0xb9b9('0x16')],{'host':_0xb9b9('0x18'),'port':0x18eb});var socket=require(_0xb9b9('0x19'))(new Redis(config[_0xb9b9('0x16')]));require(_0xb9b9('0x1a'))['register'](socket);function respondWithStatusCode(_0x38d3ef,_0x18f759){_0x18f759=_0x18f759||0xcc;return function(_0x52e791){if(_0x52e791){return _0x38d3ef[_0xb9b9('0x1b')](_0x18f759);}return _0x38d3ef['status'](_0x18f759)['end']();};}function respondWithResult(_0x186255,_0x155835){_0x155835=_0x155835||0xc8;return function(_0xa01b64){if(_0xa01b64){return _0x186255[_0xb9b9('0x1c')](_0x155835)['json'](_0xa01b64);}};}function respondWithFilteredResult(_0x1bb3eb,_0xd1257e){return function(_0x33d10c){if(_0x33d10c){var _0xc47538=_0x33d10c['count'],_0x76bcd=_0xd1257e[_0xb9b9('0x1d')],_0x32622e=_0xd1257e[_0xb9b9('0x1d')]+_0xd1257e[_0xb9b9('0x1e')],_0x157f06;if(_0x32622e>=_0xc47538){_0x32622e=_0xc47538;_0x157f06=0xc8;}else{_0x157f06=0xce;}_0x1bb3eb[_0xb9b9('0x1c')](_0x157f06);return _0x1bb3eb[_0xb9b9('0x1f')]('Content-Range',_0x76bcd+'-'+_0x32622e+'/'+_0xc47538)[_0xb9b9('0x20')](_0x33d10c);}return null;};}function patchUpdates(_0x32f7c9){return function(_0x465b5c){try{jsonpatch['apply'](_0x465b5c,_0x32f7c9,!![]);}catch(_0x5880b8){return BPromise[_0xb9b9('0x21')](_0x5880b8);}return _0x465b5c[_0xb9b9('0x22')]();};}function saveUpdates(_0x238c5a,_0x49bd56){return function(_0x53755a){if(_0x53755a){return _0x53755a['update'](_0x238c5a)[_0xb9b9('0x23')](function(_0x498955){return _0x498955;});}return null;};}function removeEntity(_0x483b3b,_0x282576){return function(_0x10fc83){if(_0x10fc83){return _0x10fc83['destroy']()[_0xb9b9('0x23')](function(){var _0x56dd76=_0x10fc83[_0xb9b9('0x24')]({'plain':!![]});var _0x25e710=_0xb9b9('0x25');return db['UserProfileResource'][_0xb9b9('0x26')]({'where':{'type':_0x25e710,'resourceId':_0x56dd76['id']}})[_0xb9b9('0x23')](function(){return _0x10fc83;});})[_0xb9b9('0x23')](function(){_0x483b3b[_0xb9b9('0x1c')](0xcc)[_0xb9b9('0x27')]();});}};}function handleEntityNotFound(_0x38323d,_0x34f8a0){return function(_0x195654){if(!_0x195654){_0x38323d['sendStatus'](0x194);}return _0x195654;};}function handleError(_0x52a700,_0x28c09f){_0x28c09f=_0x28c09f||0x1f4;return function(_0x2e2c39){logger[_0xb9b9('0x28')](_0x2e2c39[_0xb9b9('0x29')]);if(_0x2e2c39[_0xb9b9('0x2a')]){delete _0x2e2c39[_0xb9b9('0x2a')];}_0x52a700[_0xb9b9('0x1c')](_0x28c09f)[_0xb9b9('0x2b')](_0x2e2c39);};}exports[_0xb9b9('0x2c')]=function(_0x4eece8,_0x2a4f2){var _0x105993={},_0x5b9dc9={},_0x1e516d={'count':0x0,'rows':[]};var _0x24772b=_['map'](db[_0xb9b9('0x2d')][_0xb9b9('0x2e')],function(_0x128579){return{'name':_0x128579[_0xb9b9('0x2f')],'type':_0x128579[_0xb9b9('0x30')][_0xb9b9('0x31')]};});_0x5b9dc9[_0xb9b9('0x32')]=_['map'](_0x24772b,_0xb9b9('0x2a'));_0x5b9dc9[_0xb9b9('0x33')]=_[_0xb9b9('0x34')](_0x4eece8['query']);_0x5b9dc9['filters']=_['intersection'](_0x5b9dc9[_0xb9b9('0x32')],_0x5b9dc9['query']);_0x105993[_0xb9b9('0x35')]=_[_0xb9b9('0x36')](_0x5b9dc9[_0xb9b9('0x32')],qs[_0xb9b9('0x37')](_0x4eece8[_0xb9b9('0x33')]['fields']));_0x105993[_0xb9b9('0x35')]=_0x105993[_0xb9b9('0x35')][_0xb9b9('0x38')]?_0x105993['attributes']:_0x5b9dc9[_0xb9b9('0x32')];if(!_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x39')](_0xb9b9('0x3a'))){_0x105993[_0xb9b9('0x1e')]=qs[_0xb9b9('0x1e')](_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x1e')]);_0x105993[_0xb9b9('0x1d')]=qs[_0xb9b9('0x1d')](_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x1d')]);}_0x105993[_0xb9b9('0x3b')]=qs['sort'](_0x4eece8[_0xb9b9('0x33')]['sort']);_0x105993['where']=qs[_0xb9b9('0x3c')](_[_0xb9b9('0x3d')](_0x4eece8['query'],_0x5b9dc9[_0xb9b9('0x3c')]),_0x24772b);if(_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x3e')]){_0x105993[_0xb9b9('0x3f')]=_[_0xb9b9('0x40')](_0x105993[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x41')](_0x24772b,function(_0x10d144){if(_0x10d144[_0xb9b9('0x30')]!==_0xb9b9('0x42')){var _0x594f16={};_0x594f16[_0x10d144[_0xb9b9('0x2a')]]={'$like':'%'+_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x3e')]+'%'};return _0x594f16;}})});}_0x105993=_['merge']({},_0x105993,_0x4eece8[_0xb9b9('0x43')]);var _0x4a0e29={'where':_0x105993['where']};return db[_0xb9b9('0x2d')][_0xb9b9('0x44')](_0x4a0e29)[_0xb9b9('0x23')](function(_0x486084){_0x1e516d[_0xb9b9('0x44')]=_0x486084;if(_0x4eece8[_0xb9b9('0x33')][_0xb9b9('0x45')]){_0x105993[_0xb9b9('0x46')]=[{'all':!![]}];}return db[_0xb9b9('0x2d')][_0xb9b9('0x47')](_0x105993);})[_0xb9b9('0x23')](function(_0x3bd9c3){_0x1e516d[_0xb9b9('0x48')]=_0x3bd9c3;return _0x1e516d;})[_0xb9b9('0x23')](respondWithFilteredResult(_0x2a4f2,_0x105993))['catch'](handleError(_0x2a4f2,null));};exports[_0xb9b9('0x49')]=function(_0x1f6dfa,_0x215fb3){var _0x6b1ecb={'raw':!![],'where':{'id':_0x1f6dfa[_0xb9b9('0x4a')]['id']}},_0x16bbd6={};_0x16bbd6['model']=_[_0xb9b9('0x34')](db[_0xb9b9('0x2d')][_0xb9b9('0x2e')]);_0x16bbd6['query']=_[_0xb9b9('0x34')](_0x1f6dfa[_0xb9b9('0x33')]);_0x16bbd6[_0xb9b9('0x3c')]=_[_0xb9b9('0x36')](_0x16bbd6[_0xb9b9('0x32')],_0x16bbd6['query']);_0x6b1ecb['attributes']=_[_0xb9b9('0x36')](_0x16bbd6[_0xb9b9('0x32')],qs[_0xb9b9('0x37')](_0x1f6dfa[_0xb9b9('0x33')][_0xb9b9('0x37')]));_0x6b1ecb[_0xb9b9('0x35')]=_0x6b1ecb[_0xb9b9('0x35')]['length']?_0x6b1ecb[_0xb9b9('0x35')]:_0x16bbd6[_0xb9b9('0x32')];if(_0x1f6dfa[_0xb9b9('0x33')][_0xb9b9('0x45')]){_0x6b1ecb[_0xb9b9('0x46')]=[{'all':!![]}];}_0x6b1ecb=_[_0xb9b9('0x40')]({},_0x6b1ecb,_0x1f6dfa[_0xb9b9('0x43')]);return db[_0xb9b9('0x2d')]['find'](_0x6b1ecb)[_0xb9b9('0x23')](handleEntityNotFound(_0x215fb3,null))[_0xb9b9('0x23')](respondWithResult(_0x215fb3,null))[_0xb9b9('0x4b')](handleError(_0x215fb3,null));};exports[_0xb9b9('0x4c')]=function(_0x130435,_0x489c19){return db[_0xb9b9('0x2d')]['create'](_0x130435[_0xb9b9('0x4d')],{})[_0xb9b9('0x23')](function(_0x51870e){var _0x3e52de=_0x130435[_0xb9b9('0x4e')][_0xb9b9('0x24')]({'plain':!![]});if(!_0x3e52de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e52de[_0xb9b9('0x4f')]===_0xb9b9('0x4e')){var _0x17f3cc=_0x51870e[_0xb9b9('0x24')]({'plain':!![]});var _0x76f63e=_0xb9b9('0x25');return db['UserProfileSection'][_0xb9b9('0x50')]({'where':{'name':_0x76f63e,'userProfileId':_0x3e52de[_0xb9b9('0x51')]},'raw':!![]})[_0xb9b9('0x23')](function(_0x5e9d34){if(_0x5e9d34&&_0x5e9d34['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x17f3cc['name'],'resourceId':_0x17f3cc['id'],'type':_0x5e9d34[_0xb9b9('0x2a')],'sectionId':_0x5e9d34['id']},{})[_0xb9b9('0x23')](function(){return _0x51870e;});}else{return _0x51870e;}})[_0xb9b9('0x4b')](function(_0x2e3a4a){logger[_0xb9b9('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e3a4a);throw _0x2e3a4a;});}return _0x51870e;})[_0xb9b9('0x23')](respondWithResult(_0x489c19,0xc9))[_0xb9b9('0x4b')](handleError(_0x489c19,null));};exports[_0xb9b9('0x52')]=function(_0x1c7935,_0x1470fc){if(_0x1c7935[_0xb9b9('0x4d')]['id']){delete _0x1c7935[_0xb9b9('0x4d')]['id'];}return db[_0xb9b9('0x2d')]['find']({'where':{'id':_0x1c7935['params']['id']}})[_0xb9b9('0x23')](handleEntityNotFound(_0x1470fc,null))[_0xb9b9('0x23')](saveUpdates(_0x1c7935['body'],null))[_0xb9b9('0x23')](respondWithResult(_0x1470fc,null))['catch'](handleError(_0x1470fc,null));};exports[_0xb9b9('0x26')]=function(_0x103527,_0x57425e){return db['SmsQueue'][_0xb9b9('0x50')]({'where':{'id':_0x103527[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](handleEntityNotFound(_0x57425e,null))[_0xb9b9('0x23')](removeEntity(_0x57425e,null))[_0xb9b9('0x4b')](handleError(_0x57425e,null));};exports['describe']=function(_0x7f4937,_0xe311eb){return db[_0xb9b9('0x2d')][_0xb9b9('0x53')]()[_0xb9b9('0x23')](respondWithResult(_0xe311eb,null))[_0xb9b9('0x4b')](handleError(_0xe311eb,null));};exports[_0xb9b9('0x54')]=function(_0x57722a,_0x14378b,_0x12f546){var _0x16a2fb={'raw':!![],'where':{}},_0x47ccd6={},_0x542d29;return db[_0xb9b9('0x2d')]['findOne']({'where':{'id':_0x57722a['params']['id']}})['then'](handleEntityNotFound(_0x14378b,null))[_0xb9b9('0x23')](function(_0x51e221){if(_0x51e221){_0x542d29=_0x51e221['get']({'plain':!![]});_0x47ccd6[_0xb9b9('0x32')]=_[_0xb9b9('0x34')](db[_0xb9b9('0x55')][_0xb9b9('0x2e')]);_0x47ccd6[_0xb9b9('0x33')]=_[_0xb9b9('0x34')](_0x57722a[_0xb9b9('0x33')]);_0x47ccd6['filters']=_[_0xb9b9('0x36')](_0x47ccd6[_0xb9b9('0x32')],_0x47ccd6['query']);_0x16a2fb[_0xb9b9('0x35')]=_[_0xb9b9('0x36')](_0x47ccd6[_0xb9b9('0x32')],qs['fields'](_0x57722a[_0xb9b9('0x33')]['fields']));_0x16a2fb['attributes']=_0x16a2fb[_0xb9b9('0x35')][_0xb9b9('0x38')]?_0x16a2fb[_0xb9b9('0x35')]:_0x47ccd6[_0xb9b9('0x32')];if(!_0x57722a[_0xb9b9('0x33')][_0xb9b9('0x39')]('nolimit')){_0x16a2fb[_0xb9b9('0x1e')]=qs[_0xb9b9('0x1e')](_0x57722a[_0xb9b9('0x33')]['limit']);_0x16a2fb[_0xb9b9('0x1d')]=qs[_0xb9b9('0x1d')](_0x57722a['query']['offset']);}_0x16a2fb['order']=qs[_0xb9b9('0x56')](_0x57722a[_0xb9b9('0x33')][_0xb9b9('0x56')]);_0x16a2fb[_0xb9b9('0x3f')]=qs[_0xb9b9('0x3c')](_[_0xb9b9('0x3d')](_0x57722a[_0xb9b9('0x33')],_0x47ccd6[_0xb9b9('0x3c')]));_0x16a2fb[_0xb9b9('0x3f')][_0xb9b9('0x57')]=_0x51e221['id'];if(_0x57722a[_0xb9b9('0x33')][_0xb9b9('0x3e')]){_0x16a2fb[_0xb9b9('0x3f')]=_[_0xb9b9('0x40')](_0x16a2fb[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x41')](_0x16a2fb[_0xb9b9('0x35')],function(_0xba386f){var _0x4ea862={};_0x4ea862[_0xba386f]={'$like':'%'+_0x57722a['query']['filter']+'%'};return _0x4ea862;})});}_0x16a2fb=_[_0xb9b9('0x40')]({},_0x16a2fb,_0x57722a[_0xb9b9('0x43')]);return db[_0xb9b9('0x55')][_0xb9b9('0x47')](_0x16a2fb);}})[_0xb9b9('0x23')](function(_0xb57698){if(_0xb57698){return db[_0xb9b9('0x58')][_0xb9b9('0x59')]({'where':{'id':_[_0xb9b9('0x41')](_0xb57698,_0xb9b9('0x5a')),'role':'agent'},'attributes':['id','name',_0xb9b9('0x5b'),_0xb9b9('0x5c'),_0xb9b9('0x5d')]});}})[_0xb9b9('0x23')](function(_0x30b34d){if(_0x30b34d){return{'count':_0x30b34d[_0xb9b9('0x44')],'rows':_[_0xb9b9('0x41')](_0x30b34d[_0xb9b9('0x48')],function(_0x3378b1){return{'membername':_0x3378b1[_0xb9b9('0x2a')],'UserId':_0x3378b1['id'],'queue_name':_0x542d29['name'],'SmsQueueId':_0x542d29['id'],'interface':util[_0xb9b9('0x5e')](_0xb9b9('0x5f'),_0xb9b9('0x60'),_0x3378b1[_0xb9b9('0x2a')]),'penalty':0x0,'paused':_0x3378b1[_0xb9b9('0x5b')],'createdAt':_0x3378b1[_0xb9b9('0x5d')],'updatedAt':_0x3378b1[_0xb9b9('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x14378b,_0x16a2fb))[_0xb9b9('0x4b')](handleError(_0x14378b,null));};exports['getTeams']=function(_0x44333e,_0x27c674,_0x377d36){var _0x158a7d={};var _0xc862be={};var _0x2d1ed2;var _0x25930f;return db[_0xb9b9('0x2d')][_0xb9b9('0x61')]({'where':{'id':_0x44333e[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](handleEntityNotFound(_0x27c674,null))[_0xb9b9('0x23')](function(_0x5b3515){if(_0x5b3515){_0x2d1ed2=_0x5b3515;_0xc862be[_0xb9b9('0x32')]=_[_0xb9b9('0x34')](db['Team']['rawAttributes']);_0xc862be[_0xb9b9('0x33')]=_[_0xb9b9('0x34')](_0x44333e['query']);_0xc862be['filters']=_[_0xb9b9('0x36')](_0xc862be['model'],_0xc862be[_0xb9b9('0x33')]);_0x158a7d[_0xb9b9('0x35')]=_[_0xb9b9('0x36')](_0xc862be['model'],qs[_0xb9b9('0x37')](_0x44333e[_0xb9b9('0x33')][_0xb9b9('0x37')]));_0x158a7d['attributes']=_0x158a7d[_0xb9b9('0x35')][_0xb9b9('0x38')]?_0x158a7d[_0xb9b9('0x35')]:_0xc862be[_0xb9b9('0x32')];_0x158a7d['order']=qs['sort'](_0x44333e['query'][_0xb9b9('0x56')]);_0x158a7d['where']=qs[_0xb9b9('0x3c')](_[_0xb9b9('0x3d')](_0x44333e[_0xb9b9('0x33')],_0xc862be['filters']));if(_0x44333e[_0xb9b9('0x33')]['filter']){_0x158a7d[_0xb9b9('0x3f')]=_[_0xb9b9('0x40')](_0x158a7d[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x41')](_0x158a7d['attributes'],function(_0x15b9e6){var _0x518e6d={};_0x518e6d[_0x15b9e6]={'$like':'%'+_0x44333e[_0xb9b9('0x33')][_0xb9b9('0x3e')]+'%'};return _0x518e6d;})});}_0x158a7d=_[_0xb9b9('0x40')]({},_0x158a7d,_0x44333e[_0xb9b9('0x43')]);return _0x2d1ed2[_0xb9b9('0x62')](_0x158a7d);}})['then'](function(_0x502c3d){if(_0x502c3d){_0x25930f=_0x502c3d[_0xb9b9('0x38')];if(!_0x44333e[_0xb9b9('0x33')][_0xb9b9('0x39')](_0xb9b9('0x3a'))){_0x158a7d['limit']=qs[_0xb9b9('0x1e')](_0x44333e['query']['limit']);_0x158a7d[_0xb9b9('0x1d')]=qs[_0xb9b9('0x1d')](_0x44333e[_0xb9b9('0x33')][_0xb9b9('0x1d')]);}return _0x2d1ed2['getTeams'](_0x158a7d);}})[_0xb9b9('0x23')](function(_0x346abe){if(_0x346abe){return _0x346abe?{'count':_0x25930f,'rows':_0x346abe}:null;}})[_0xb9b9('0x23')](respondWithResult(_0x27c674,null))[_0xb9b9('0x4b')](handleError(_0x27c674,null));};exports[_0xb9b9('0x63')]=function(_0x12c2d6,_0x1278f7,_0x5317e7){var _0x11d486=_0x12c2d6[_0xb9b9('0x4d')][_0xb9b9('0x64')];return db['Team'][_0xb9b9('0x47')]({'where':{'id':_0x11d486},'attributes':['id'],'include':[{'model':db[_0xb9b9('0x58')],'as':'Agents','attributes':['id',_0xb9b9('0x2a'),_0xb9b9('0x65'),'voicePause',_0xb9b9('0x66')],'raw':!![]}]})['then'](function(_0x51db50){if(_0x51db50){var _0x4a0121=_[_0xb9b9('0x67')](_0x51db50,function(_0x97942){var _0x385def=_0x97942[_0xb9b9('0x24')]({'plain':!![]});return _0x385def['Agents'];});return db['SmsQueue'][_0xb9b9('0x50')]({'where':{'id':_0x12c2d6[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](function(_0x3fef45){return db[_0xb9b9('0x68')]['transaction'](function(_0x4bde4d){return _0x3fef45[_0xb9b9('0x63')](_0x11d486,{'transaction':_0x4bde4d})[_0xb9b9('0x23')](function(){return BPromise[_0xb9b9('0x69')](_0x4a0121,function(_0x289b9a){return db[_0xb9b9('0x55')][_0xb9b9('0x6a')]({'where':{'UserId':_0x289b9a['id'],'SmsQueueId':_0x12c2d6[_0xb9b9('0x4a')]['id']},'transaction':_0x4bde4d});});})[_0xb9b9('0x23')](function(){_0x4a0121[_0xb9b9('0x6b')](function(_0x432859){socket[_0xb9b9('0x6c')]('userSmsQueue:save',{'UserId':_0x432859['id'],'SmsQueueId':_0x3fef45['id']});});});});});}})[_0xb9b9('0x23')](respondWithStatusCode(_0x1278f7,null))[_0xb9b9('0x4b')](handleError(_0x1278f7,null));};exports[_0xb9b9('0x6d')]=function(_0x2912b1,_0x4b6bff,_0x46fd1b){return db[_0xb9b9('0x6e')]['findAll']({'where':{'id':_0x2912b1[_0xb9b9('0x33')][_0xb9b9('0x64')]},'attributes':['id'],'include':[{'model':db[_0xb9b9('0x58')],'as':_0xb9b9('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xb9b9('0x23')](handleEntityNotFound(_0x4b6bff,null))[_0xb9b9('0x23')](function(_0x234ad3){var _0x157703=_[_0xb9b9('0x41')](_0x234ad3,'id');var _0x2b8eb1=[];var _0x5a60ee=[];var _0x818786=squel[_0xb9b9('0x70')]();_0x818786[_0xb9b9('0x71')](_0xb9b9('0x72'))[_0xb9b9('0x73')](_0xb9b9('0x74'),'tq')['join'](_0xb9b9('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb9b9('0x76'),_0x2912b1[_0xb9b9('0x4a')]['id']);for(var _0x4b9427=0x0;_0x4b9427<_0x234ad3['length'];_0x4b9427+=0x1){let _0x3fa8d3=_0x234ad3[_0x4b9427];for(var _0x127015=0x0;_0x127015<_0x3fa8d3[_0xb9b9('0x6f')][_0xb9b9('0x38')];_0x127015+=0x1){let _0x438c6b=_0x3fa8d3[_0xb9b9('0x6f')][_0x127015];var _0x4bdec5=_0x818786[_0xb9b9('0x77')]();_0x4bdec5['where'](_0xb9b9('0x78'),_0x438c6b['id']);_0x5a60ee[_0xb9b9('0x79')](db['sequelize'][_0xb9b9('0x33')](_0x4bdec5['toString'](),{'type':db[_0xb9b9('0x68')]['QueryTypes'][_0xb9b9('0x7a')]})[_0xb9b9('0x23')](function(_0x4b4941){if(_0x4b4941[_0xb9b9('0x38')]===0x1){return _0x438c6b['id'];}else{var _0x542de2=_[_0xb9b9('0x7b')](_[_0xb9b9('0x41')](_0x4b4941,_0xb9b9('0x7c')),function(_0x5d34bb){return _[_0xb9b9('0x7d')](_0x157703,_0x5d34bb);});if(_0x542de2){return _0x438c6b['id'];}}}));}}return BPromise[_0xb9b9('0x7e')](_0x5a60ee)[_0xb9b9('0x23')](function(_0x1861c4){_0x2b8eb1=_(_0x2b8eb1)[_0xb9b9('0x7f')](_0x1861c4)[_0xb9b9('0x80')]()[_0xb9b9('0x81')]();return db[_0xb9b9('0x2d')][_0xb9b9('0x50')]({'where':{'id':_0x2912b1[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](function(_0x148158){return db[_0xb9b9('0x68')][_0xb9b9('0x82')](function(_0x3c346c){return _0x148158[_0xb9b9('0x6d')](_0x2912b1['query'][_0xb9b9('0x64')],{'transaction':_0x3c346c})['then'](function(){if(!_[_0xb9b9('0x83')](_0x2b8eb1)){return _0x148158[_0xb9b9('0x84')](_0x2b8eb1,{'transaction':_0x3c346c});}})[_0xb9b9('0x23')](function(){_0x2b8eb1[_0xb9b9('0x6b')](function(_0x1d4fae){socket[_0xb9b9('0x6c')](_0xb9b9('0x85'),{'UserId':_0x1d4fae,'SmsQueueId':_0x148158['id']});});});});});});})[_0xb9b9('0x23')](respondWithStatusCode(_0x4b6bff,null))[_0xb9b9('0x4b')](handleError(_0x4b6bff,null));};exports['addAgents']=function(_0xcc1f88,_0x2da1ff,_0x2da082){return db['SmsQueue'][_0xb9b9('0x50')]({'where':{'id':_0xcc1f88[_0xb9b9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2da1ff,null))['then'](function(_0x555680){if(_0x555680){return _0x555680[_0xb9b9('0x86')](_0xcc1f88['body'][_0xb9b9('0x64')],_['omit'](_0xcc1f88[_0xb9b9('0x4d')],[_0xb9b9('0x64'),'id'])||{})[_0xb9b9('0x87')](function(_0x3b0885){for(var _0x2fa59d=0x0;_0x2fa59d<_0xcc1f88['body'][_0xb9b9('0x64')][_0xb9b9('0x38')];_0x2fa59d+=0x1){socket['emit'](_0xb9b9('0x88'),{'UserId':_0xcc1f88[_0xb9b9('0x4d')][_0xb9b9('0x64')][_0x2fa59d],'SmsQueueId':_0xcc1f88[_0xb9b9('0x4a')]['id']});}return _0x3b0885;});}})[_0xb9b9('0x23')](respondWithResult(_0x2da1ff,null))[_0xb9b9('0x4b')](handleError(_0x2da1ff,null));};exports[_0xb9b9('0x84')]=function(_0x384aa4,_0x45b360,_0x1f8a9d){return db[_0xb9b9('0x2d')][_0xb9b9('0x50')]({'where':{'id':_0x384aa4[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](handleEntityNotFound(_0x45b360,null))[_0xb9b9('0x23')](function(_0x3d969a){if(_0x3d969a){return _0x3d969a[_0xb9b9('0x84')](_0x384aa4[_0xb9b9('0x33')][_0xb9b9('0x64')])[_0xb9b9('0x23')](function(){if(_[_0xb9b9('0x89')](_0x384aa4[_0xb9b9('0x33')][_0xb9b9('0x64')])){for(var _0x3186d0=0x0;_0x3186d0<_0x384aa4[_0xb9b9('0x33')]['ids']['length'];_0x3186d0+=0x1){socket[_0xb9b9('0x6c')](_0xb9b9('0x85'),{'UserId':Number(_0x384aa4[_0xb9b9('0x33')]['ids'][_0x3186d0]),'SmsQueueId':Number(_0x384aa4['params']['id'])});}}else{socket['emit'](_0xb9b9('0x85'),{'UserId':Number(_0x384aa4[_0xb9b9('0x33')][_0xb9b9('0x64')]),'SmsQueueId':Number(_0x384aa4['params']['id'])});}});}})[_0xb9b9('0x23')](respondWithStatusCode(_0x45b360,null))[_0xb9b9('0x4b')](handleError(_0x45b360,null));};exports[_0xb9b9('0x8a')]=function(_0x1bbf66,_0x564134,_0x1ad746){var _0x21254d={};var _0x5bd635={};var _0x4d16c3;var _0x3c0372;return db[_0xb9b9('0x2d')][_0xb9b9('0x61')]({'where':{'id':_0x1bbf66[_0xb9b9('0x4a')]['id']}})[_0xb9b9('0x23')](handleEntityNotFound(_0x564134,null))['then'](function(_0x5ae5f2){if(_0x5ae5f2){_0x4d16c3=_0x5ae5f2;_0x5bd635[_0xb9b9('0x32')]=_['keys'](db['User'][_0xb9b9('0x2e')]);_0x5bd635[_0xb9b9('0x33')]=_[_0xb9b9('0x34')](_0x1bbf66['query']);_0x5bd635[_0xb9b9('0x3c')]=_[_0xb9b9('0x36')](_0x5bd635['model'],_0x5bd635[_0xb9b9('0x33')]);_0x21254d[_0xb9b9('0x35')]=_['intersection'](_0x5bd635[_0xb9b9('0x32')],qs[_0xb9b9('0x37')](_0x1bbf66[_0xb9b9('0x33')][_0xb9b9('0x37')]));_0x21254d[_0xb9b9('0x35')]=_0x21254d[_0xb9b9('0x35')][_0xb9b9('0x38')]?_0x21254d[_0xb9b9('0x35')]:_0x5bd635[_0xb9b9('0x32')];_0x21254d['order']=qs['sort'](_0x1bbf66[_0xb9b9('0x33')]['sort']);_0x21254d[_0xb9b9('0x3f')]=qs[_0xb9b9('0x3c')](_[_0xb9b9('0x3d')](_0x1bbf66[_0xb9b9('0x33')],_0x5bd635[_0xb9b9('0x3c')]));if(_0x1bbf66[_0xb9b9('0x33')]['filter']){_0x21254d[_0xb9b9('0x3f')]=_[_0xb9b9('0x40')](_0x21254d['where'],{'$or':_[_0xb9b9('0x41')](_0x21254d['attributes'],function(_0x3e2857){var _0x5eac12={};_0x5eac12[_0x3e2857]={'$like':'%'+_0x1bbf66['query']['filter']+'%'};return _0x5eac12;})});}_0x21254d=_['merge']({},_0x21254d,_0x1bbf66[_0xb9b9('0x43')]);return _0x4d16c3[_0xb9b9('0x8a')](_0x21254d);}})[_0xb9b9('0x23')](function(_0x21e8f3){if(_0x21e8f3){_0x3c0372=_0x21e8f3[_0xb9b9('0x38')];if(!_0x1bbf66['query'][_0xb9b9('0x39')](_0xb9b9('0x3a'))){_0x21254d[_0xb9b9('0x1e')]=qs[_0xb9b9('0x1e')](_0x1bbf66[_0xb9b9('0x33')][_0xb9b9('0x1e')]);_0x21254d['offset']=qs['offset'](_0x1bbf66[_0xb9b9('0x33')][_0xb9b9('0x1d')]);}return _0x4d16c3['getAgents'](_0x21254d);}})[_0xb9b9('0x23')](function(_0x2cb71a){if(_0x2cb71a){return _0x2cb71a?{'count':_0x3c0372,'rows':_0x2cb71a}:null;}})[_0xb9b9('0x23')](respondWithResult(_0x564134,null))[_0xb9b9('0x4b')](handleError(_0x564134,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ac8acde..19653a6 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 _0xe607=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2fae72,_0x19ddcd){var _0x5322ee=function(_0x1f1b46){while(--_0x1f1b46){_0x2fae72['push'](_0x2fae72['shift']());}};_0x5322ee(++_0x19ddcd);}(_0xe607,0x7f));var _0x7e60=function(_0x23c168,_0x57cc87){_0x23c168=_0x23c168-0x0;var _0x5dca4a=_0xe607[_0x23c168];return _0x5dca4a;};'use strict';var EventEmitter=require(_0x7e60('0x0'));var SmsQueue=require(_0x7e60('0x1'))['db'][_0x7e60('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7e60('0x3')](0x0);var events={'afterCreate':_0x7e60('0x4'),'afterUpdate':'update','afterDestroy':_0x7e60('0x5')};function emitEvent(_0x218dda){return function(_0x53675d,_0x20c1df,_0x324af1){SmsQueueEvents['emit'](_0x218dda+':'+_0x53675d['id'],_0x53675d);SmsQueueEvents[_0x7e60('0x6')](_0x218dda,_0x53675d);_0x324af1(null);};}for(var e in events){if(events[_0x7e60('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x7e60('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x81ff=['events','SmsQueue','setMaxListeners','save','remove','hasOwnProperty','exports'];(function(_0x2a56db,_0x2d1d7f){var _0x3cf7f3=function(_0x57ffc7){while(--_0x57ffc7){_0x2a56db['push'](_0x2a56db['shift']());}};_0x3cf7f3(++_0x2d1d7f);}(_0x81ff,0x149));var _0xf81f=function(_0x537831,_0x118c2f){_0x537831=_0x537831-0x0;var _0x29719b=_0x81ff[_0x537831];return _0x29719b;};'use strict';var EventEmitter=require(_0xf81f('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xf81f('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf81f('0x2')](0x0);var events={'afterCreate':_0xf81f('0x3'),'afterUpdate':'update','afterDestroy':_0xf81f('0x4')};function emitEvent(_0x254884){return function(_0x3324e2,_0x4376a3,_0x588ed5){SmsQueueEvents['emit'](_0x254884+':'+_0x3324e2['id'],_0x3324e2);SmsQueueEvents['emit'](_0x254884,_0x3324e2);_0x588ed5(null);};}for(var e in events){if(events[_0xf81f('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xf81f('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 93164f5..011689b 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 _0xa44a=['rimraf','exports','define','sms_queues','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4bb885,_0x1ea860){var _0x5398f3=function(_0x6d3e25){while(--_0x6d3e25){_0x4bb885['push'](_0x4bb885['shift']());}};_0x5398f3(++_0x1ea860);}(_0xa44a,0x9a));var _0xaa44=function(_0x209285,_0x54b0b4){_0x209285=_0x209285-0x0;var _0x165b8d=_0xa44a[_0x209285];return _0x165b8d;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa44('0x1'));var moment=require(_0xaa44('0x2'));var BPromise=require(_0xaa44('0x3'));var rp=require(_0xaa44('0x4'));var fs=require('fs');var path=require(_0xaa44('0x5'));var rimraf=require(_0xaa44('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xaa44('0x7')]=function(_0x39a3f6,_0x4979e3){return _0x39a3f6[_0xaa44('0x8')]('SmsQueue',attributes,{'tableName':_0xaa44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49c4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x49c4,0x9b));var _0x449c=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x49c4[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var logger=require(_0x449c('0x1'))(_0x449c('0x2'));var moment=require(_0x449c('0x3'));var BPromise=require(_0x449c('0x4'));var rp=require(_0x449c('0x5'));var fs=require('fs');var path=require(_0x449c('0x6'));var rimraf=require(_0x449c('0x7'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x449c('0x8')]=function(_0x442e56,_0x12586c){return _0x442e56[_0x449c('0x9')](_0x449c('0xa'),attributes,{'tableName':_0x449c('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 6e25260..4c3cc4c 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 _0x29c7=['client','http','redis','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x58561b,_0x3b3892){var _0xcb80bb=function(_0x36ad8e){while(--_0x36ad8e){_0x58561b['push'](_0x58561b['shift']());}};_0xcb80bb(++_0x3b3892);}(_0x29c7,0x6f));var _0x729c=function(_0x3661d5,_0x295514){_0x3661d5=_0x3661d5-0x0;var _0x5ce30c=_0x29c7[_0x3661d5];return _0x5ce30c;};'use strict';var _=require(_0x729c('0x0'));var util=require(_0x729c('0x1'));var moment=require(_0x729c('0x2'));var BPromise=require('bluebird');var rs=require(_0x729c('0x3'));var fs=require('fs');var Redis=require(_0x729c('0x4'));var db=require(_0x729c('0x5'))['db'];var utils=require(_0x729c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x729c('0x7'));var jayson=require(_0x729c('0x8'));var client=jayson[_0x729c('0x9')][_0x729c('0xa')]({'port':0x232a});config[_0x729c('0xb')]=_['defaults'](config['redis'],{'host':_0x729c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x729c('0xb')]));require('./smsQueue.socket')[_0x729c('0xd')](socket);function respondWithRpcPromise(_0x1ff297,_0x37010c,_0x454e42){return new BPromise(function(_0xc61c77,_0x5765cd){return client[_0x729c('0xe')](_0x1ff297,_0x454e42)[_0x729c('0xf')](function(_0x3a08a4){logger[_0x729c('0x10')](_0x729c('0x11'),_0x37010c,_0x729c('0x12'));logger[_0x729c('0x13')](_0x729c('0x14'),_0x37010c,'request\x20sent',JSON['stringify'](_0x3a08a4));if(_0x3a08a4[_0x729c('0x15')]){if(_0x3a08a4['error'][_0x729c('0x16')]===0x1f4){logger[_0x729c('0x15')]('SmsQueue,\x20%s,\x20%s',_0x37010c,_0x3a08a4[_0x729c('0x15')][_0x729c('0x17')]);return _0x5765cd(_0x3a08a4[_0x729c('0x15')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x37010c,_0x3a08a4[_0x729c('0x15')][_0x729c('0x17')]);return _0xc61c77(_0x3a08a4[_0x729c('0x15')][_0x729c('0x17')]);}else{logger[_0x729c('0x10')]('SmsQueue,\x20%s,\x20%s',_0x37010c,_0x729c('0x12'));_0xc61c77(_0x3a08a4[_0x729c('0x18')][_0x729c('0x17')]);}})[_0x729c('0x19')](function(_0x3e7f32){logger['error'](_0x729c('0x11'),_0x37010c,_0x3e7f32);_0x5765cd(_0x3e7f32);});});}exports[_0x729c('0x1a')]=function(_0x135bc4){var _0x4d053e=this;return new Promise(function(_0x577c81,_0xd76cba){return db[_0x729c('0x1b')][_0x729c('0x1c')]({'raw':_0x135bc4[_0x729c('0x1d')]?_0x135bc4[_0x729c('0x1d')][_0x729c('0x1e')]===undefined?!![]:![]:!![],'where':_0x135bc4[_0x729c('0x1d')]?_0x135bc4[_0x729c('0x1d')][_0x729c('0x1f')]||null:null,'attributes':_0x135bc4[_0x729c('0x1d')]?_0x135bc4['options'][_0x729c('0x20')]||null:null,'limit':_0x135bc4[_0x729c('0x1d')]?_0x135bc4['options'][_0x729c('0x21')]||null:null,'include':_0x135bc4[_0x729c('0x1d')]?_0x135bc4[_0x729c('0x1d')][_0x729c('0x22')]?_[_0x729c('0x23')](_0x135bc4[_0x729c('0x1d')][_0x729c('0x22')],function(_0x18467e){return{'model':db[_0x18467e['model']],'as':_0x18467e['as'],'attributes':_0x18467e[_0x729c('0x20')],'include':_0x18467e[_0x729c('0x22')]?_[_0x729c('0x23')](_0x18467e['include'],function(_0x365f7c){return{'model':db[_0x365f7c['model']],'as':_0x365f7c['as'],'attributes':_0x365f7c[_0x729c('0x20')],'include':_0x365f7c['include']?_[_0x729c('0x23')](_0x365f7c[_0x729c('0x22')],function(_0x50f4e7){return{'model':db[_0x50f4e7[_0x729c('0x24')]],'as':_0x50f4e7['as'],'attributes':_0x50f4e7[_0x729c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d5881){logger[_0x729c('0x10')](_0x729c('0x1a'),_0x135bc4);logger['debug'](_0x729c('0x1a'),_0x135bc4,JSON[_0x729c('0x25')](_0x5d5881));_0x577c81(_0x5d5881);})['catch'](function(_0x35bd0){logger[_0x729c('0x15')](_0x729c('0x1a'),_0x35bd0[_0x729c('0x17')],_0x135bc4);_0xd76cba(_0x4d053e['error'](0x1f4,_0x35bd0[_0x729c('0x17')]));});});};exports['ShowSmsQueue']=function(_0x2e1628){var _0x57706b=this;return new Promise(function(_0x17a059,_0xbee19a){return db[_0x729c('0x1b')][_0x729c('0x26')]({'raw':_0x2e1628[_0x729c('0x1d')]?_0x2e1628[_0x729c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2e1628[_0x729c('0x1d')]?_0x2e1628[_0x729c('0x1d')][_0x729c('0x1f')]||null:null,'attributes':_0x2e1628[_0x729c('0x1d')]?_0x2e1628[_0x729c('0x1d')][_0x729c('0x20')]||null:null,'include':_0x2e1628['options']?_0x2e1628[_0x729c('0x1d')][_0x729c('0x22')]?_[_0x729c('0x23')](_0x2e1628[_0x729c('0x1d')][_0x729c('0x22')],function(_0x69be95){return{'model':db[_0x69be95['model']],'as':_0x69be95['as'],'attributes':_0x69be95['attributes'],'include':_0x69be95[_0x729c('0x22')]?_[_0x729c('0x23')](_0x69be95[_0x729c('0x22')],function(_0x232264){return{'model':db[_0x232264[_0x729c('0x24')]],'as':_0x232264['as'],'attributes':_0x232264['attributes'],'include':_0x232264[_0x729c('0x22')]?_[_0x729c('0x23')](_0x232264[_0x729c('0x22')],function(_0x2b765a){return{'model':db[_0x2b765a[_0x729c('0x24')]],'as':_0x2b765a['as'],'attributes':_0x2b765a['attributes']};}):[]};}):[]};}):[]:[]})[_0x729c('0xf')](function(_0x139666){logger[_0x729c('0x10')]('ShowSmsQueue',_0x2e1628);logger[_0x729c('0x13')](_0x729c('0x27'),_0x2e1628,JSON['stringify'](_0x139666));_0x17a059(_0x139666);})[_0x729c('0x19')](function(_0x5371d9){logger[_0x729c('0x15')](_0x729c('0x27'),_0x5371d9[_0x729c('0x17')],_0x2e1628);_0xbee19a(_0x57706b[_0x729c('0x15')](0x1f4,_0x5371d9[_0x729c('0x17')]));});});}; \ No newline at end of file +var _0xc6e9=['../../config/utils','../../config/logger','rpc','redis','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','SmsQueue','findAll','options','raw','where','attributes','limit','map','model','include','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x4bfa31,_0x2ff098){var _0x479a0d=function(_0x226cc8){while(--_0x226cc8){_0x4bfa31['push'](_0x4bfa31['shift']());}};_0x479a0d(++_0x2ff098);}(_0xc6e9,0x11b));var _0x9c6e=function(_0x1a7783,_0x5a81af){_0x1a7783=_0x1a7783-0x0;var _0x1f41a6=_0xc6e9[_0x1a7783];return _0x1f41a6;};'use strict';var _=require(_0x9c6e('0x0'));var util=require(_0x9c6e('0x1'));var moment=require(_0x9c6e('0x2'));var BPromise=require(_0x9c6e('0x3'));var rs=require(_0x9c6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9c6e('0x5'));var logger=require(_0x9c6e('0x6'))(_0x9c6e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9c6e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c6e('0x9'))(new Redis(config[_0x9c6e('0x8')]));require(_0x9c6e('0xa'))[_0x9c6e('0xb')](socket);function respondWithRpcPromise(_0xd4e5e3,_0x3fad79,_0x487fa2){return new BPromise(function(_0x4fba64,_0x3f3de7){return client['request'](_0xd4e5e3,_0x487fa2)[_0x9c6e('0xc')](function(_0x531e6b){logger['info'](_0x9c6e('0xd'),_0x3fad79,_0x9c6e('0xe'));logger[_0x9c6e('0xf')](_0x9c6e('0x10'),_0x3fad79,_0x9c6e('0xe'),JSON[_0x9c6e('0x11')](_0x531e6b));if(_0x531e6b['error']){if(_0x531e6b[_0x9c6e('0x12')][_0x9c6e('0x13')]===0x1f4){logger[_0x9c6e('0x12')](_0x9c6e('0xd'),_0x3fad79,_0x531e6b[_0x9c6e('0x12')]['message']);return _0x3f3de7(_0x531e6b[_0x9c6e('0x12')][_0x9c6e('0x14')]);}logger[_0x9c6e('0x12')](_0x9c6e('0xd'),_0x3fad79,_0x531e6b[_0x9c6e('0x12')][_0x9c6e('0x14')]);return _0x4fba64(_0x531e6b[_0x9c6e('0x12')][_0x9c6e('0x14')]);}else{logger[_0x9c6e('0x15')](_0x9c6e('0xd'),_0x3fad79,_0x9c6e('0xe'));_0x4fba64(_0x531e6b['result'][_0x9c6e('0x14')]);}})[_0x9c6e('0x16')](function(_0x10470d){logger['error'](_0x9c6e('0xd'),_0x3fad79,_0x10470d);_0x3f3de7(_0x10470d);});});}exports['GetSmsQueue']=function(_0x4f89d0){var _0x23222f=this;return new Promise(function(_0x6ca215,_0x1f9263){return db[_0x9c6e('0x17')][_0x9c6e('0x18')]({'raw':_0x4f89d0[_0x9c6e('0x19')]?_0x4f89d0[_0x9c6e('0x19')][_0x9c6e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f89d0[_0x9c6e('0x19')]?_0x4f89d0['options'][_0x9c6e('0x1b')]||null:null,'attributes':_0x4f89d0[_0x9c6e('0x19')]?_0x4f89d0[_0x9c6e('0x19')][_0x9c6e('0x1c')]||null:null,'limit':_0x4f89d0[_0x9c6e('0x19')]?_0x4f89d0[_0x9c6e('0x19')][_0x9c6e('0x1d')]||null:null,'include':_0x4f89d0[_0x9c6e('0x19')]?_0x4f89d0[_0x9c6e('0x19')]['include']?_[_0x9c6e('0x1e')](_0x4f89d0['options']['include'],function(_0x1e3404){return{'model':db[_0x1e3404[_0x9c6e('0x1f')]],'as':_0x1e3404['as'],'attributes':_0x1e3404[_0x9c6e('0x1c')],'include':_0x1e3404[_0x9c6e('0x20')]?_[_0x9c6e('0x1e')](_0x1e3404[_0x9c6e('0x20')],function(_0x58c818){return{'model':db[_0x58c818[_0x9c6e('0x1f')]],'as':_0x58c818['as'],'attributes':_0x58c818[_0x9c6e('0x1c')],'include':_0x58c818[_0x9c6e('0x20')]?_[_0x9c6e('0x1e')](_0x58c818[_0x9c6e('0x20')],function(_0x3001d4){return{'model':db[_0x3001d4[_0x9c6e('0x1f')]],'as':_0x3001d4['as'],'attributes':_0x3001d4[_0x9c6e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d7344){logger['info'](_0x9c6e('0x21'),_0x4f89d0);logger['debug']('GetSmsQueue',_0x4f89d0,JSON['stringify'](_0x3d7344));_0x6ca215(_0x3d7344);})[_0x9c6e('0x16')](function(_0x4848b2){logger[_0x9c6e('0x12')]('GetSmsQueue',_0x4848b2['message'],_0x4f89d0);_0x1f9263(_0x23222f[_0x9c6e('0x12')](0x1f4,_0x4848b2[_0x9c6e('0x14')]));});});};exports[_0x9c6e('0x22')]=function(_0x546e7a){var _0x2ed938=this;return new Promise(function(_0x3c5842,_0x39b4b5){return db[_0x9c6e('0x17')][_0x9c6e('0x23')]({'raw':_0x546e7a[_0x9c6e('0x19')]?_0x546e7a[_0x9c6e('0x19')][_0x9c6e('0x1a')]===undefined?!![]:![]:!![],'where':_0x546e7a[_0x9c6e('0x19')]?_0x546e7a[_0x9c6e('0x19')][_0x9c6e('0x1b')]||null:null,'attributes':_0x546e7a['options']?_0x546e7a[_0x9c6e('0x19')]['attributes']||null:null,'include':_0x546e7a[_0x9c6e('0x19')]?_0x546e7a[_0x9c6e('0x19')][_0x9c6e('0x20')]?_[_0x9c6e('0x1e')](_0x546e7a['options'][_0x9c6e('0x20')],function(_0x5d7c97){return{'model':db[_0x5d7c97[_0x9c6e('0x1f')]],'as':_0x5d7c97['as'],'attributes':_0x5d7c97[_0x9c6e('0x1c')],'include':_0x5d7c97[_0x9c6e('0x20')]?_[_0x9c6e('0x1e')](_0x5d7c97[_0x9c6e('0x20')],function(_0x127b1c){return{'model':db[_0x127b1c[_0x9c6e('0x1f')]],'as':_0x127b1c['as'],'attributes':_0x127b1c[_0x9c6e('0x1c')],'include':_0x127b1c['include']?_[_0x9c6e('0x1e')](_0x127b1c[_0x9c6e('0x20')],function(_0x322882){return{'model':db[_0x322882[_0x9c6e('0x1f')]],'as':_0x322882['as'],'attributes':_0x322882[_0x9c6e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9c6e('0xc')](function(_0x5de565){logger['info'](_0x9c6e('0x22'),_0x546e7a);logger['debug']('ShowSmsQueue',_0x546e7a,JSON[_0x9c6e('0x11')](_0x5de565));_0x3c5842(_0x5de565);})[_0x9c6e('0x16')](function(_0x2f7072){logger[_0x9c6e('0x12')](_0x9c6e('0x22'),_0x2f7072[_0x9c6e('0x14')],_0x546e7a);_0x39b4b5(_0x2ed938[_0x9c6e('0x12')](0x1f4,_0x2f7072[_0x9c6e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index ec196be..f1749e6 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 _0x2d6e=['update','emit','removeListener','length','smsQueue:'];(function(_0x3ad373,_0x1a13e8){var _0x48b843=function(_0xbf1676){while(--_0xbf1676){_0x3ad373['push'](_0x3ad373['shift']());}};_0x48b843(++_0x1a13e8);}(_0x2d6e,0x11d));var _0xe2d6=function(_0x56d4f6,_0x4e9689){_0x56d4f6=_0x56d4f6-0x0;var _0x2ceca0=_0x2d6e[_0x56d4f6];return _0x2ceca0;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save','remove',_0xe2d6('0x0')];function createListener(_0x1879f5,_0x354730){return function(_0x2f2385){_0x354730[_0xe2d6('0x1')](_0x1879f5,_0x2f2385);};}function removeListener(_0x4cfa3d,_0x3241c4){return function(){SmsQueueEvents[_0xe2d6('0x2')](_0x4cfa3d,_0x3241c4);};}exports['register']=function(_0x328b1a){for(var _0x3a2433=0x0,_0x6cac0f=events[_0xe2d6('0x3')];_0x3a2433<_0x6cac0f;_0x3a2433++){var _0x226ebd=events[_0x3a2433];var _0x41567a=createListener(_0xe2d6('0x4')+_0x226ebd,_0x328b1a);SmsQueueEvents['on'](_0x226ebd,_0x41567a);}}; \ No newline at end of file +var _0xf590=['emit','register','length','remove'];(function(_0x3a9cdc,_0x20f028){var _0x1ad79d=function(_0x5d76db){while(--_0x5d76db){_0x3a9cdc['push'](_0x3a9cdc['shift']());}};_0x1ad79d(++_0x20f028);}(_0xf590,0x14b));var _0x0f59=function(_0x1aa835,_0x23e8ac){_0x1aa835=_0x1aa835-0x0;var _0x5ad5c7=_0xf590[_0x1aa835];return _0x5ad5c7;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x0f59('0x0'),'update'];function createListener(_0x1b0a02,_0x34a361){return function(_0x2639f7){_0x34a361[_0x0f59('0x1')](_0x1b0a02,_0x2639f7);};}function removeListener(_0x3e8b88,_0x4f3f9f){return function(){SmsQueueEvents['removeListener'](_0x3e8b88,_0x4f3f9f);};}exports[_0x0f59('0x2')]=function(_0xd29089){for(var _0xf73f1f=0x0,_0x312aaa=events[_0x0f59('0x3')];_0xf73f1f<_0x312aaa;_0xf73f1f++){var _0x149401=events[_0xf73f1f];var _0x2cbb86=createListener('smsQueue:'+_0x149401,_0xd29089);SmsQueueEvents['on'](_0x149401,_0x2cbb86);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 130b544..8df1c23 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 _0x77f2=['show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','express','../../config/environment','./smsQueueReport.controller','isAuthenticated','describe','get'];(function(_0x58f48a,_0x375bfd){var _0x426d8c=function(_0x5c0b29){while(--_0x5c0b29){_0x58f48a['push'](_0x58f48a['shift']());}};_0x426d8c(++_0x375bfd);}(_0x77f2,0x188));var _0x277f=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0x77f2[_0x554047];return _0x5d11e4;};'use strict';var multer=require('multer');var util=require(_0x277f('0x0'));var path=require('path');var timeout=require(_0x277f('0x1'));var express=require(_0x277f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x277f('0x3'));var controller=require(_0x277f('0x4'));router['get']('/',auth[_0x277f('0x5')](),controller['index']);router['get']('/describe',auth[_0x277f('0x5')](),controller[_0x277f('0x6')]);router[_0x277f('0x7')]('/:id',auth[_0x277f('0x5')](),controller[_0x277f('0x8')]);router[_0x277f('0x9')]('/',auth[_0x277f('0x5')](),controller[_0x277f('0xa')]);router['put'](_0x277f('0xb'),auth[_0x277f('0x5')](),controller[_0x277f('0xc')]);router[_0x277f('0xd')](_0x277f('0xb'),auth[_0x277f('0x5')](),controller[_0x277f('0xe')]);module[_0x277f('0xf')]=router; \ No newline at end of file +var _0xcf08=['isAuthenticated','index','/describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x3ca027,_0x1efc3a){var _0x586745=function(_0xb676e1){while(--_0xb676e1){_0x3ca027['push'](_0x3ca027['shift']());}};_0x586745(++_0x1efc3a);}(_0xcf08,0xe6));var _0x8cf0=function(_0x4c4d26,_0x56bcf0){_0x4c4d26=_0x4c4d26-0x0;var _0x32ce49=_0xcf08[_0x4c4d26];return _0x32ce49;};'use strict';var multer=require(_0x8cf0('0x0'));var util=require(_0x8cf0('0x1'));var path=require(_0x8cf0('0x2'));var timeout=require(_0x8cf0('0x3'));var express=require(_0x8cf0('0x4'));var router=express[_0x8cf0('0x5')]();var auth=require(_0x8cf0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8cf0('0x7'));var controller=require(_0x8cf0('0x8'));router[_0x8cf0('0x9')]('/',auth[_0x8cf0('0xa')](),controller[_0x8cf0('0xb')]);router[_0x8cf0('0x9')](_0x8cf0('0xc'),auth[_0x8cf0('0xa')](),controller['describe']);router['get'](_0x8cf0('0xd'),auth[_0x8cf0('0xa')](),controller[_0x8cf0('0xe')]);router[_0x8cf0('0xf')]('/',auth[_0x8cf0('0xa')](),controller['create']);router['put'](_0x8cf0('0xd'),auth[_0x8cf0('0xa')](),controller[_0x8cf0('0x10')]);router[_0x8cf0('0x11')](_0x8cf0('0xd'),auth[_0x8cf0('0xa')](),controller[_0x8cf0('0x12')]);module[_0x8cf0('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 43e2b4c..f61c60c 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 _0xd85c=['sequelize','exports','STRING','DATE','moment'];(function(_0x267618,_0x341e39){var _0x94a18=function(_0x92a653){while(--_0x92a653){_0x267618['push'](_0x267618['shift']());}};_0x94a18(++_0x341e39);}(_0xd85c,0x15d));var _0xcd85=function(_0x20b8b6,_0x29a14c){_0x20b8b6=_0x20b8b6-0x0;var _0x22c341=_0xd85c[_0x20b8b6];return _0x22c341;};'use strict';var moment=require(_0xcd85('0x0'));var Sequelize=require(_0xcd85('0x1'));module[_0xcd85('0x2')]={'uniqueid':{'type':Sequelize[_0xcd85('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcd85('0x3')]},'joinAt':{'type':Sequelize[_0xcd85('0x4')]},'leaveAt':{'type':Sequelize[_0xcd85('0x4')]},'acceptAt':{'type':Sequelize[_0xcd85('0x4')]},'exitAt':{'type':Sequelize[_0xcd85('0x4')]},'reason':{'type':Sequelize[_0xcd85('0x3')]}}; \ No newline at end of file +var _0x3e7f=['STRING','DATE','moment','exports'];(function(_0x15ad67,_0x3da0bb){var _0x1db054=function(_0x24b472){while(--_0x24b472){_0x15ad67['push'](_0x15ad67['shift']());}};_0x1db054(++_0x3da0bb);}(_0x3e7f,0x11e));var _0xf3e7=function(_0x3278fb,_0x46292a){_0x3278fb=_0x3278fb-0x0;var _0x50aced=_0x3e7f[_0x3278fb];return _0x50aced;};'use strict';var moment=require(_0xf3e7('0x0'));var Sequelize=require('sequelize');module[_0xf3e7('0x1')]={'uniqueid':{'type':Sequelize[_0xf3e7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf3e7('0x2')]},'joinAt':{'type':Sequelize[_0xf3e7('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf3e7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf3e7('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6756500..bebc5fd 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 _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x2d175f,_0x4c0219){var _0x234cde=function(_0x13c841){while(--_0x13c841){_0x2d175f['push'](_0x2d175f['shift']());}};_0x234cde(++_0x4c0219);}(_0x814b,0x1a2));var _0xb814=function(_0x5c96eb,_0x5404da){_0x5c96eb=_0x5c96eb-0x0;var _0x4ddbad=_0x814b[_0x5c96eb];return _0x4ddbad;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));}; \ No newline at end of file +var _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']),_0x23b061);if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SmsQueueReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SmsQueueReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b3f8236..54d2755 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 _0x8594=['../../config/environment','./smsQueueReport.attributes','exports','define','util','api','moment','bluebird','request-promise','path'];(function(_0x5258dc,_0x45b282){var _0x3aa4c7=function(_0x226da7){while(--_0x226da7){_0x5258dc['push'](_0x5258dc['shift']());}};_0x3aa4c7(++_0x45b282);}(_0x8594,0x1c6));var _0x4859=function(_0x1895bd,_0x147024){_0x1895bd=_0x1895bd-0x0;var _0x4913f7=_0x8594[_0x1895bd];return _0x4913f7;};'use strict';var _=require('lodash');var util=require(_0x4859('0x0'));var logger=require('../../config/logger')(_0x4859('0x1'));var moment=require(_0x4859('0x2'));var BPromise=require(_0x4859('0x3'));var rp=require(_0x4859('0x4'));var fs=require('fs');var path=require(_0x4859('0x5'));var rimraf=require('rimraf');var config=require(_0x4859('0x6'));var attributes=require(_0x4859('0x7'));module[_0x4859('0x8')]=function(_0x33a141,_0x4b0958){return _0x33a141[_0x4859('0x9')]('SmsQueueReport',attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa47e=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','SmsQueueReport','report_sms_queue'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xa47e,0x90));var _0xea47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa47e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea47('0x0'));var util=require(_0xea47('0x1'));var logger=require(_0xea47('0x2'))(_0xea47('0x3'));var moment=require(_0xea47('0x4'));var BPromise=require(_0xea47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea47('0x6'));var rimraf=require(_0xea47('0x7'));var config=require(_0xea47('0x8'));var attributes=require(_0xea47('0x9'));module['exports']=function(_0x37fad1,_0x49dec3){return _0x37fad1['define'](_0xea47('0xa'),attributes,{'tableName':_0xea47('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xea47('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 5425adb..07a0188 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 _0x3d57=['options','raw','CreateSmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport','body'];(function(_0x3633f6,_0x1f24df){var _0xf501e8=function(_0x77155e){while(--_0x77155e){_0x3633f6['push'](_0x3633f6['shift']());}};_0xf501e8(++_0x1f24df);}(_0x3d57,0xf8));var _0x73d5=function(_0x3124d4,_0x1267e3){_0x3124d4=_0x3124d4-0x0;var _0x1d9cda=_0x3d57[_0x3124d4];return _0x1d9cda;};'use strict';var _=require(_0x73d5('0x0'));var util=require(_0x73d5('0x1'));var moment=require(_0x73d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x73d5('0x3'));var fs=require('fs');var Redis=require(_0x73d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x73d5('0x5'))(_0x73d5('0x6'));var config=require(_0x73d5('0x7'));var jayson=require(_0x73d5('0x8'));var client=jayson[_0x73d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47a46f,_0x562580,_0x27157f){return new BPromise(function(_0xd3caae,_0xcdaa26){return client[_0x73d5('0xa')](_0x47a46f,_0x27157f)[_0x73d5('0xb')](function(_0xe591d6){logger[_0x73d5('0xc')](_0x73d5('0xd'),_0x562580,_0x73d5('0xe'));logger['debug'](_0x73d5('0xf'),_0x562580,'request\x20sent',JSON[_0x73d5('0x10')](_0xe591d6));if(_0xe591d6['error']){if(_0xe591d6[_0x73d5('0x11')][_0x73d5('0x12')]===0x1f4){logger['error'](_0x73d5('0xd'),_0x562580,_0xe591d6[_0x73d5('0x11')][_0x73d5('0x13')]);return _0xcdaa26(_0xe591d6['error'][_0x73d5('0x13')]);}logger[_0x73d5('0x11')](_0x73d5('0xd'),_0x562580,_0xe591d6[_0x73d5('0x11')][_0x73d5('0x13')]);return _0xd3caae(_0xe591d6['error'][_0x73d5('0x13')]);}else{logger[_0x73d5('0xc')](_0x73d5('0xd'),_0x562580,_0x73d5('0xe'));_0xd3caae(_0xe591d6['result'][_0x73d5('0x13')]);}})['catch'](function(_0x189053){logger[_0x73d5('0x11')](_0x73d5('0xd'),_0x562580,_0x189053);_0xcdaa26(_0x189053);});});}exports['CreateSmsQueueReport']=function(_0x5d331c){var _0x2833e7=this;return new Promise(function(_0xca7fc1,_0x584d4b){return db[_0x73d5('0x14')]['create'](_0x5d331c[_0x73d5('0x15')],{'raw':_0x5d331c[_0x73d5('0x16')]?_0x5d331c[_0x73d5('0x16')][_0x73d5('0x17')]===undefined?!![]:![]:!![]})[_0x73d5('0xb')](function(_0x5116ee){logger['info'](_0x73d5('0x18'),_0x5d331c);logger['debug']('CreateSmsQueueReport',_0x5d331c,JSON[_0x73d5('0x10')](_0x5116ee));_0xca7fc1(_0x5116ee);})['catch'](function(_0x2c18d9){logger[_0x73d5('0x11')](_0x73d5('0x18'),_0x2c18d9[_0x73d5('0x13')],_0x5d331c);_0x584d4b(_0x2833e7[_0x73d5('0x11')](0x1f4,_0x2c18d9[_0x73d5('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x5d061b){var _0x214e1a=this;return new Promise(function(_0x3becc4,_0x48fd2d){return db[_0x73d5('0x14')][_0x73d5('0x19')](_0x5d061b['body'],{'raw':_0x5d061b['options']?_0x5d061b[_0x73d5('0x16')][_0x73d5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d061b[_0x73d5('0x16')]?_0x5d061b[_0x73d5('0x16')][_0x73d5('0x1a')]||null:null,'attributes':_0x5d061b[_0x73d5('0x16')]?_0x5d061b[_0x73d5('0x16')][_0x73d5('0x1b')]||null:null,'limit':_0x5d061b[_0x73d5('0x16')]?_0x5d061b['options'][_0x73d5('0x1c')]||null:null})[_0x73d5('0xb')](function(_0x6e136d){logger[_0x73d5('0xc')](_0x73d5('0x1d'),_0x5d061b);logger['debug'](_0x73d5('0x1d'),_0x5d061b,JSON[_0x73d5('0x10')](_0x6e136d));_0x3becc4(_0x6e136d);})['catch'](function(_0x4176ba){logger['error'](_0x73d5('0x1d'),_0x4176ba[_0x73d5('0x13')],_0x5d061b);_0x48fd2d(_0x214e1a[_0x73d5('0x11')](0x1f4,_0x4176ba['message']));});});}; \ No newline at end of file +var _0x4acb=['SmsQueueReport','raw','UpdateSmsQueueReport','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateSmsQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4acb,0x99));var _0xb4ac=function(_0x4c8c19,_0x15d473){_0x4c8c19=_0x4c8c19-0x0;var _0x32c443=_0x4acb[_0x4c8c19];return _0x32c443;};'use strict';var _=require(_0xb4ac('0x0'));var util=require(_0xb4ac('0x1'));var moment=require(_0xb4ac('0x2'));var BPromise=require(_0xb4ac('0x3'));var rs=require(_0xb4ac('0x4'));var fs=require('fs');var Redis=require(_0xb4ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4ac('0x6'));var logger=require(_0xb4ac('0x7'))(_0xb4ac('0x8'));var config=require(_0xb4ac('0x9'));var jayson=require(_0xb4ac('0xa'));var client=jayson[_0xb4ac('0xb')][_0xb4ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52e4f7,_0x1530a8,_0x18fd27){return new BPromise(function(_0x435b1b,_0x4f3784){return client[_0xb4ac('0xd')](_0x52e4f7,_0x18fd27)[_0xb4ac('0xe')](function(_0x549155){logger[_0xb4ac('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x1530a8,'request\x20sent');logger[_0xb4ac('0x10')](_0xb4ac('0x11'),_0x1530a8,'request\x20sent',JSON[_0xb4ac('0x12')](_0x549155));if(_0x549155[_0xb4ac('0x13')]){if(_0x549155['error'][_0xb4ac('0x14')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x1530a8,_0x549155[_0xb4ac('0x13')][_0xb4ac('0x15')]);return _0x4f3784(_0x549155[_0xb4ac('0x13')]['message']);}logger[_0xb4ac('0x13')](_0xb4ac('0x16'),_0x1530a8,_0x549155[_0xb4ac('0x13')][_0xb4ac('0x15')]);return _0x435b1b(_0x549155['error'][_0xb4ac('0x15')]);}else{logger[_0xb4ac('0xf')](_0xb4ac('0x16'),_0x1530a8,_0xb4ac('0x17'));_0x435b1b(_0x549155[_0xb4ac('0x18')]['message']);}})[_0xb4ac('0x19')](function(_0x38ced3){logger[_0xb4ac('0x13')](_0xb4ac('0x16'),_0x1530a8,_0x38ced3);_0x4f3784(_0x38ced3);});});}exports[_0xb4ac('0x1a')]=function(_0x33e179){var _0x17684c=this;return new Promise(function(_0x294ff6,_0x5427a1){return db[_0xb4ac('0x1b')]['create'](_0x33e179['body'],{'raw':_0x33e179['options']?_0x33e179['options'][_0xb4ac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4e6e3a){logger[_0xb4ac('0xf')](_0xb4ac('0x1a'),_0x33e179);logger[_0xb4ac('0x10')](_0xb4ac('0x1a'),_0x33e179,JSON[_0xb4ac('0x12')](_0x4e6e3a));_0x294ff6(_0x4e6e3a);})[_0xb4ac('0x19')](function(_0xefaa){logger[_0xb4ac('0x13')](_0xb4ac('0x1a'),_0xefaa[_0xb4ac('0x15')],_0x33e179);_0x5427a1(_0x17684c[_0xb4ac('0x13')](0x1f4,_0xefaa['message']));});});};exports[_0xb4ac('0x1d')]=function(_0x54a21f){var _0x570925=this;return new Promise(function(_0xf032e0,_0x161ab7){return db[_0xb4ac('0x1b')][_0xb4ac('0x1e')](_0x54a21f[_0xb4ac('0x1f')],{'raw':_0x54a21f[_0xb4ac('0x20')]?_0x54a21f['options'][_0xb4ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a21f[_0xb4ac('0x20')]?_0x54a21f[_0xb4ac('0x20')][_0xb4ac('0x21')]||null:null,'attributes':_0x54a21f[_0xb4ac('0x20')]?_0x54a21f[_0xb4ac('0x20')][_0xb4ac('0x22')]||null:null,'limit':_0x54a21f[_0xb4ac('0x20')]?_0x54a21f[_0xb4ac('0x20')][_0xb4ac('0x23')]||null:null})[_0xb4ac('0xe')](function(_0x18da04){logger[_0xb4ac('0xf')](_0xb4ac('0x1d'),_0x54a21f);logger[_0xb4ac('0x10')]('UpdateSmsQueueReport',_0x54a21f,JSON[_0xb4ac('0x12')](_0x18da04));_0xf032e0(_0x18da04);})[_0xb4ac('0x19')](function(_0x523580){logger[_0xb4ac('0x13')]('UpdateSmsQueueReport',_0x523580[_0xb4ac('0x15')],_0x54a21f);_0x161ab7(_0x570925['error'](0x1f4,_0x523580[_0xb4ac('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 8fd9360..41f2ab7 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 _0x2547=['../../config/environment','get','isAuthenticated','index','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x40fe51,_0x4ef362){var _0x307c59=function(_0xcafcef){while(--_0xcafcef){_0x40fe51['push'](_0x40fe51['shift']());}};_0x307c59(++_0x4ef362);}(_0x2547,0x1cd));var _0x7254=function(_0xf599a9,_0x2ca1f4){_0xf599a9=_0xf599a9-0x0;var _0x575263=_0x2547[_0xf599a9];return _0x575263;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var auth=require(_0x7254('0x5'));var interaction=require(_0x7254('0x6'));var config=require(_0x7254('0x7'));var controller=require('./smsTransferReport.controller');router[_0x7254('0x8')]('/',auth[_0x7254('0x9')](),controller[_0x7254('0xa')]);router[_0x7254('0x8')]('/describe',auth[_0x7254('0x9')](),controller[_0x7254('0xb')]);router[_0x7254('0x8')]('/:id',auth[_0x7254('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7254('0xc')]);router[_0x7254('0xd')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0xf')]);router[_0x7254('0x10')]('/:id',auth[_0x7254('0x9')](),controller['destroy']);module[_0x7254('0x11')]=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','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3600af,_0x1cf875){var _0x11845d=function(_0x57d7a){while(--_0x57d7a){_0x3600af['push'](_0x3600af['shift']());}};_0x11845d(++_0x1cf875);}(_0x2032,0xd9));var _0x2203=function(_0x224e2a,_0x1c4d32){_0x224e2a=_0x224e2a-0x0;var _0x29bd78=_0x2032[_0x224e2a];return _0x29bd78;};'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/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 12d09cd..984048f 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 _0xf5c5=['agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xf5c5,0x13a));var _0x5f5c=function(_0x4b8556,_0x3fc58d){_0x4b8556=_0x4b8556-0x0;var _0x32b2c1=_0xf5c5[_0x4b8556];return _0x32b2c1;};'use strict';var moment=require(_0x5f5c('0x0'));var Sequelize=require(_0x5f5c('0x1'));module[_0x5f5c('0x2')]={'uniqueid':{'type':Sequelize[_0x5f5c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5f5c('0x4')](_0x5f5c('0x5'),_0x5f5c('0x6'),_0x5f5c('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5f5c('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x5f5c('0x9')]}}; \ No newline at end of file +var _0x2dd5=['queue','moment','sequelize','STRING','ENUM','account'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0x2dd5,0x1db));var _0x52dd=function(_0x2b2c7d,_0x52cee6){_0x2b2c7d=_0x2b2c7d-0x0;var _0x3bd7a7=_0x2dd5[_0x2b2c7d];return _0x3bd7a7;};'use strict';var moment=require(_0x52dd('0x0'));var Sequelize=require(_0x52dd('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x52dd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x52dd('0x3')](_0x52dd('0x4'),'agent',_0x52dd('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 17d7130..0c63e62 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 _0xd8b0=['intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','SmsTransferReport','count','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','html-pdf','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','index','map','rawAttributes','fieldName','key','query','keys'];(function(_0x3e8d3c,_0x2e4078){var _0x5e64c6=function(_0x3e1493){while(--_0x3e1493){_0x3e8d3c['push'](_0x3e8d3c['shift']());}};_0x5e64c6(++_0x2e4078);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var 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={},_0x28f639={},_0x3ef745={'count':0x0,'rows':[]};var _0x4c05ee=_[_0x0d8b('0x28')](db['SmsTransferReport'][_0x0d8b('0x29')],function(_0x4b59e5){return{'name':_0x4b59e5[_0x0d8b('0x2a')],'type':_0x4b59e5['type'][_0x0d8b('0x2b')]};});_0x28f639['model']=_[_0x0d8b('0x28')](_0x4c05ee,'name');_0x28f639[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0xa2af02[_0x0d8b('0x2c')]);_0x28f639['filters']=_['intersection'](_0x28f639['model'],_0x28f639[_0x0d8b('0x2c')]);_0x59a905['attributes']=_[_0x0d8b('0x2e')](_0x28f639['model'],qs['fields'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x2f')]));_0x59a905[_0x0d8b('0x30')]=_0x59a905[_0x0d8b('0x30')][_0x0d8b('0x31')]?_0x59a905[_0x0d8b('0x30')]:_0x28f639[_0x0d8b('0x32')];if(!_0xa2af02[_0x0d8b('0x2c')]['hasOwnProperty'](_0x0d8b('0x33'))){_0x59a905[_0x0d8b('0x1b')]=qs['limit'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x59a905[_0x0d8b('0x1a')]=qs['offset'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x59a905[_0x0d8b('0x34')]=qs[_0x0d8b('0x35')](_0xa2af02[_0x0d8b('0x2c')]['sort']);_0x59a905[_0x0d8b('0x36')]=qs[_0x0d8b('0x37')](_['pick'](_0xa2af02[_0x0d8b('0x2c')],_0x28f639[_0x0d8b('0x37')]),_0x4c05ee);if(_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x59a905[_0x0d8b('0x36')]=_['merge'](_0x59a905['where'],{'$or':_[_0x0d8b('0x28')](_0x4c05ee,function(_0x5c2c04){if(_0x5c2c04['type']!==_0x0d8b('0x39')){var _0x2e279c={};_0x2e279c[_0x5c2c04[_0x0d8b('0x25')]]={'$like':'%'+_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x2e279c;}})});}_0x59a905=_[_0x0d8b('0x3a')]({},_0x59a905,_0xa2af02['options']);var _0x6e5bab={'where':_0x59a905[_0x0d8b('0x36')]};return db[_0x0d8b('0x3b')][_0x0d8b('0x3c')](_0x6e5bab)[_0x0d8b('0x22')](function(_0x1a39ad){_0x3ef745[_0x0d8b('0x3c')]=_0x1a39ad;if(_0xa2af02['query'][_0x0d8b('0x3d')]){_0x59a905[_0x0d8b('0x3e')]=[{'all':!![]}];}return db[_0x0d8b('0x3b')][_0x0d8b('0x3f')](_0x59a905);})['then'](function(_0xe0bf42){_0x3ef745['rows']=_0xe0bf42;return _0x3ef745;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4fe6f9,_0x59a905))[_0x0d8b('0x40')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x41')]=function(_0x26ac10,_0x35fa7e){var _0x3e632e={'raw':!![],'where':{'id':_0x26ac10[_0x0d8b('0x42')]['id']}},_0x1ff17d={};_0x1ff17d[_0x0d8b('0x32')]=_[_0x0d8b('0x2d')](db['SmsTransferReport']['rawAttributes']);_0x1ff17d['query']=_['keys'](_0x26ac10['query']);_0x1ff17d[_0x0d8b('0x37')]=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],_0x1ff17d['query']);_0x3e632e['attributes']=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],qs[_0x0d8b('0x2f')](_0x26ac10['query'][_0x0d8b('0x2f')]));_0x3e632e[_0x0d8b('0x30')]=_0x3e632e['attributes']['length']?_0x3e632e[_0x0d8b('0x30')]:_0x1ff17d['model'];if(_0x26ac10[_0x0d8b('0x2c')]['includeAll']){_0x3e632e['include']=[{'all':!![]}];}_0x3e632e=_[_0x0d8b('0x3a')]({},_0x3e632e,_0x26ac10[_0x0d8b('0x43')]);return db['SmsTransferReport']['find'](_0x3e632e)['then'](handleEntityNotFound(_0x35fa7e,null))['then'](respondWithResult(_0x35fa7e,null))[_0x0d8b('0x40')](handleError(_0x35fa7e,null));};exports[_0x0d8b('0x44')]=function(_0xd9d4c3,_0x490eda){return db[_0x0d8b('0x3b')][_0x0d8b('0x44')](_0xd9d4c3[_0x0d8b('0x45')],{})[_0x0d8b('0x22')](respondWithResult(_0x490eda,0xc9))[_0x0d8b('0x40')](handleError(_0x490eda,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x45')]['id']){delete _0x11d22b[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x3b')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x45')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x40')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x47')]=function(_0x574b90,_0x371fa0){return db['SmsTransferReport']['find']({'where':{'id':_0x574b90[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x371fa0,null))[_0x0d8b('0x22')](removeEntity(_0x371fa0,null))[_0x0d8b('0x40')](handleError(_0x371fa0,null));};exports['describe']=function(_0x131579,_0x1106d6){return db[_0x0d8b('0x3b')][_0x0d8b('0x48')]()[_0x0d8b('0x22')](respondWithResult(_0x1106d6,null))['catch'](handleError(_0x1106d6,null));}; \ No newline at end of file +var _0x0713=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2702c5,_0x121a91){var _0x400d27=function(_0xbb9c22){while(--_0xbb9c22){_0x2702c5['push'](_0x2702c5['shift']());}};_0x400d27(++_0x121a91);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]),_0x3fa3b8);if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['SmsTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['SmsTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));};exports[_0x3071('0x4c')]=function(_0x2307dd,_0x22aade){return db[_0x3071('0x2e')][_0x3071('0x4c')]()[_0x3071('0x26')](respondWithResult(_0x22aade,null))[_0x3071('0x43')](handleError(_0x22aade,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 03767ac..529bc43 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 _0x44fe=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x31c2d8,_0x269933){var _0x35349d=function(_0x32253d){while(--_0x32253d){_0x31c2d8['push'](_0x31c2d8['shift']());}};_0x35349d(++_0x269933);}(_0x44fe,0xbc));var _0xe44f=function(_0x524605,_0x3484c1){_0x524605=_0x524605-0x0;var _0x2d3911=_0x44fe[_0x524605];return _0x2d3911;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe44f('0x0'))(_0xe44f('0x1'));var moment=require(_0xe44f('0x2'));var BPromise=require(_0xe44f('0x3'));var rp=require(_0xe44f('0x4'));var fs=require('fs');var path=require(_0xe44f('0x5'));var rimraf=require(_0xe44f('0x6'));var config=require(_0xe44f('0x7'));var attributes=require(_0xe44f('0x8'));module[_0xe44f('0x9')]=function(_0x5ad0f4,_0x4dbfd7){return _0x5ad0f4['define'](_0xe44f('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xe44f('0xb'),'fields':[_0xe44f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53e1=['rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','request-promise','path'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x53e1,0x16f));var _0x153e=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x53e1[_0x9df3d8];return _0x366da1;};'use strict';var _=require(_0x153e('0x0'));var util=require('util');var logger=require(_0x153e('0x1'))(_0x153e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x153e('0x3'));var fs=require('fs');var path=require(_0x153e('0x4'));var rimraf=require(_0x153e('0x5'));var config=require(_0x153e('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x153e('0x7')]=function(_0x1b9f85,_0x1c4ddc){return _0x1b9f85[_0x153e('0x8')](_0x153e('0x9'),attributes,{'tableName':_0x153e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x153e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7a2acf2..5c7f1ab 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 _0xb126=['randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb126,0x1de));var _0x6b12=function(_0x501ee2,_0x5e0980){_0x501ee2=_0x501ee2-0x0;var _0x3c8573=_0xb126[_0x501ee2];return _0x3c8573;};'use strict';var _=require('lodash');var util=require(_0x6b12('0x0'));var moment=require('moment');var BPromise=require(_0x6b12('0x1'));var rs=require(_0x6b12('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b12('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6b12('0x4'));var jayson=require(_0x6b12('0x5'));var client=jayson[_0x6b12('0x6')][_0x6b12('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2533f2,_0x27084e,_0x47b09a){return new BPromise(function(_0x3f7a5a,_0x2c6a6){return client['request'](_0x2533f2,_0x47b09a)[_0x6b12('0x8')](function(_0x3bf2f6){logger[_0x6b12('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x27084e,_0x6b12('0xa'));logger[_0x6b12('0xb')](_0x6b12('0xc'),_0x27084e,_0x6b12('0xa'),JSON[_0x6b12('0xd')](_0x3bf2f6));if(_0x3bf2f6['error']){if(_0x3bf2f6[_0x6b12('0xe')][_0x6b12('0xf')]===0x1f4){logger[_0x6b12('0xe')](_0x6b12('0x10'),_0x27084e,_0x3bf2f6[_0x6b12('0xe')][_0x6b12('0x11')]);return _0x2c6a6(_0x3bf2f6[_0x6b12('0xe')][_0x6b12('0x11')]);}logger['error'](_0x6b12('0x10'),_0x27084e,_0x3bf2f6[_0x6b12('0xe')][_0x6b12('0x11')]);return _0x3f7a5a(_0x3bf2f6[_0x6b12('0xe')]['message']);}else{logger[_0x6b12('0x9')](_0x6b12('0x10'),_0x27084e,_0x6b12('0xa'));_0x3f7a5a(_0x3bf2f6[_0x6b12('0x12')][_0x6b12('0x11')]);}})[_0x6b12('0x13')](function(_0x280e7a){logger['error'](_0x6b12('0x10'),_0x27084e,_0x280e7a);_0x2c6a6(_0x280e7a);});});} \ No newline at end of file +var _0xd6b4=['SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1564a7,_0x3159ff){var _0x247eee=function(_0x51899c){while(--_0x51899c){_0x1564a7['push'](_0x1564a7['shift']());}};_0x247eee(++_0x3159ff);}(_0xd6b4,0x72));var _0x4d6b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd6b4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4d6b('0x0'));var util=require(_0x4d6b('0x1'));var moment=require(_0x4d6b('0x2'));var BPromise=require(_0x4d6b('0x3'));var rs=require(_0x4d6b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d6b('0x6'));var config=require(_0x4d6b('0x7'));var jayson=require(_0x4d6b('0x8'));var client=jayson[_0x4d6b('0x9')][_0x4d6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d61bb,_0x261a9a,_0x307347){return new BPromise(function(_0x2607b7,_0x84c358){return client[_0x4d6b('0xb')](_0x1d61bb,_0x307347)['then'](function(_0x2d0ae4){logger[_0x4d6b('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x261a9a,_0x4d6b('0xd'));logger[_0x4d6b('0xe')](_0x4d6b('0xf'),_0x261a9a,_0x4d6b('0xd'),JSON['stringify'](_0x2d0ae4));if(_0x2d0ae4[_0x4d6b('0x10')]){if(_0x2d0ae4[_0x4d6b('0x10')][_0x4d6b('0x11')]===0x1f4){logger[_0x4d6b('0x10')](_0x4d6b('0x12'),_0x261a9a,_0x2d0ae4['error'][_0x4d6b('0x13')]);return _0x84c358(_0x2d0ae4['error'][_0x4d6b('0x13')]);}logger[_0x4d6b('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x261a9a,_0x2d0ae4['error'][_0x4d6b('0x13')]);return _0x2607b7(_0x2d0ae4[_0x4d6b('0x10')]['message']);}else{logger[_0x4d6b('0xc')](_0x4d6b('0x12'),_0x261a9a,_0x4d6b('0xd'));_0x2607b7(_0x2d0ae4[_0x4d6b('0x14')][_0x4d6b('0x13')]);}})[_0x4d6b('0x15')](function(_0x257ead){logger[_0x4d6b('0x10')](_0x4d6b('0x12'),_0x261a9a,_0x257ead);_0x84c358(_0x257ead);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f9b0379..2ddbd9b 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 _0x6d7d=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','/:id','update','delete','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','show','/:id/download','isAuthenticated','download','diskStorage','server/files/sounds/original/'];(function(_0x5274eb,_0x510d9a){var _0x2ca2c0=function(_0x38d6a7){while(--_0x38d6a7){_0x5274eb['push'](_0x5274eb['shift']());}};_0x2ca2c0(++_0x510d9a);}(_0x6d7d,0x1b3));var _0xd6d7=function(_0x33e32f,_0x217ce4){_0x33e32f=_0x33e32f-0x0;var _0xb7b433=_0x6d7d[_0x33e32f];return _0xb7b433;};'use strict';var multer=require(_0xd6d7('0x0'));var util=require(_0xd6d7('0x1'));var path=require(_0xd6d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xd6d7('0x3'));var interaction=require(_0xd6d7('0x4'));var config=require(_0xd6d7('0x5'));var controller=require(_0xd6d7('0x6'));router[_0xd6d7('0x7')]('/',auth['isAuthenticated'](),controller[_0xd6d7('0x8')]);router[_0xd6d7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd6d7('0x9')]);router[_0xd6d7('0x7')](_0xd6d7('0xa'),auth[_0xd6d7('0xb')](),controller[_0xd6d7('0xc')]);var upload=multer({'storage':multer[_0xd6d7('0xd')]({'destination':function(_0x1bbfde,_0xf2ba08,_0x175012){_0x175012(null,path['join'](config['root'],_0xd6d7('0xe')));},'filename':function(_0x57df74,_0x42638e,_0x1d707d){_0x42638e[_0xd6d7('0xf')]=_0x42638e[_0xd6d7('0xf')][_0xd6d7('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d707d(null,util[_0xd6d7('0x11')](_0xd6d7('0x12'),path[_0xd6d7('0x13')](_0x42638e[_0xd6d7('0xf')],path[_0xd6d7('0x14')](_0x42638e['originalname'])),Date[_0xd6d7('0x15')](),path[_0xd6d7('0x14')](_0x42638e[_0xd6d7('0xf')])));}})});router[_0xd6d7('0x16')]('/',upload[_0xd6d7('0x17')](_0xd6d7('0x18')),controller[_0xd6d7('0x19')]);router['put'](_0xd6d7('0x1a'),auth['isAuthenticated'](),controller[_0xd6d7('0x1b')]);router[_0xd6d7('0x1c')]('/:id',auth[_0xd6d7('0xb')](),controller[_0xd6d7('0x1c')]);module[_0xd6d7('0x1d')]=router; \ No newline at end of file +var _0x095a=['./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x92724b,_0x18e7d6){var _0x12e4f5=function(_0x406734){while(--_0x406734){_0x92724b['push'](_0x92724b['shift']());}};_0x12e4f5(++_0x18e7d6);}(_0x095a,0x119));var _0xa095=function(_0x10f7a8,_0x21c281){_0x10f7a8=_0x10f7a8-0x0;var _0x2102a0=_0x095a[_0x10f7a8];return _0x2102a0;};'use strict';var multer=require(_0xa095('0x0'));var util=require(_0xa095('0x1'));var path=require(_0xa095('0x2'));var timeout=require(_0xa095('0x3'));var express=require(_0xa095('0x4'));var router=express[_0xa095('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa095('0x6'));var controller=require(_0xa095('0x7'));router[_0xa095('0x8')]('/',auth[_0xa095('0x9')](),controller['index']);router[_0xa095('0x8')](_0xa095('0xa'),auth[_0xa095('0x9')](),controller[_0xa095('0xb')]);router[_0xa095('0x8')](_0xa095('0xc'),auth[_0xa095('0x9')](),controller[_0xa095('0xd')]);var upload=multer({'storage':multer[_0xa095('0xe')]({'destination':function(_0x458059,_0x46bd92,_0x2a2173){_0x2a2173(null,path[_0xa095('0xf')](config[_0xa095('0x10')],'server/files/sounds/original/'));},'filename':function(_0x2d56ef,_0x4cf77b,_0x508d46){_0x4cf77b[_0xa095('0x11')]=_0x4cf77b['originalname'][_0xa095('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x508d46(null,util[_0xa095('0x13')](_0xa095('0x14'),path[_0xa095('0x15')](_0x4cf77b['originalname'],path[_0xa095('0x16')](_0x4cf77b['originalname'])),Date[_0xa095('0x17')](),path[_0xa095('0x16')](_0x4cf77b['originalname'])));}})});router[_0xa095('0x18')]('/',upload[_0xa095('0x19')](_0xa095('0x1a')),controller[_0xa095('0x1b')]);router[_0xa095('0x1c')](_0xa095('0xa'),auth['isAuthenticated'](),controller[_0xa095('0x1d')]);router[_0xa095('0x1e')]('/:id',auth[_0xa095('0x9')](),controller[_0xa095('0x1e')]);module[_0xa095('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index aeb1c42..40d5564 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 _0x0b4c=['FLOAT','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x31a7f1,_0x130e51){var _0x5d4407=function(_0x7df34f){while(--_0x7df34f){_0x31a7f1['push'](_0x31a7f1['shift']());}};_0x5d4407(++_0x130e51);}(_0x0b4c,0xf3));var _0xc0b4=function(_0x3a9b5e,_0x24076b){_0x3a9b5e=_0x3a9b5e-0x0;var _0x9f68b=_0x0b4c[_0x3a9b5e];return _0x9f68b;};'use strict';var Sequelize=require(_0xc0b4('0x0'));module[_0xc0b4('0x1')]={'name':{'type':Sequelize[_0xc0b4('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc0b4('0x2')]},'display_name':{'type':Sequelize[_0xc0b4('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xc0b4('0x2')]},'original_format':{'type':Sequelize[_0xc0b4('0x2')]},'original_duration':{'type':Sequelize[_0xc0b4('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xc0b4('0x4')]},'original_bitRate':{'type':Sequelize[_0xc0b4('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xc0b4('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc0b4('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc0b4('0x4')]},'converted_bitRate':{'type':Sequelize[_0xc0b4('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc0b4('0x4')]}}; \ No newline at end of file +var _0xbc3c=['sequelize','exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x296d85,_0x2a3cec){var _0x56e54e=function(_0x3dd54a){while(--_0x3dd54a){_0x296d85['push'](_0x296d85['shift']());}};_0x56e54e(++_0x2a3cec);}(_0xbc3c,0xd2));var _0xcbc3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xbc3c[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xcbc3('0x0'));module[_0xcbc3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcbc3('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcbc3('0x3')]},'display_name':{'type':Sequelize[_0xcbc3('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xcbc3('0x3')]},'original_duration':{'type':Sequelize[_0xcbc3('0x4')]},'original_sampleCount':{'type':Sequelize[_0xcbc3('0x5')]},'original_channelCount':{'type':Sequelize[_0xcbc3('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xcbc3('0x6')]},'converted_format':{'type':Sequelize[_0xcbc3('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xcbc3('0x5')]},'converted_channelCount':{'type':Sequelize[_0xcbc3('0x6')]},'converted_bitRate':{'type':Sequelize[_0xcbc3('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xcbc3('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0978b84..6c6ec2c 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 _0xe1fe=['update','get','Sounds','UserProfileResource','destroy','then','error','stack','name','send','map','Sound','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','join','root','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','download','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','original_format','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','sendStatus','status','end','count','offset','json','apply','reject'];(function(_0x4d19bb,_0x2f9f5a){var _0x4f7095=function(_0x3fe4c3){while(--_0x3fe4c3){_0x4d19bb['push'](_0x4d19bb['shift']());}};_0x4f7095(++_0x2f9f5a);}(_0xe1fe,0x1c3));var _0xee1f=function(_0x57f463,_0x48358){_0x57f463=_0x57f463-0x0;var _0x1e9868=_0xe1fe[_0x57f463];return _0x1e9868;};'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'];function respondWithStatusCode(_0x3f7f6e,_0xd8408d){_0xd8408d=_0xd8408d||0xcc;return function(_0x31512b){if(_0x31512b){return _0x3f7f6e[_0xee1f('0x19')](_0xd8408d);}return _0x3f7f6e[_0xee1f('0x1a')](_0xd8408d)[_0xee1f('0x1b')]();};}function respondWithResult(_0x1a8b4f,_0x39ac58){_0x39ac58=_0x39ac58||0xc8;return function(_0x3302c3){if(_0x3302c3){return _0x1a8b4f['status'](_0x39ac58)['json'](_0x3302c3);}};}function respondWithFilteredResult(_0x1028e8,_0x12900a){return function(_0x15d69f){if(_0x15d69f){var _0x15ebbc=_0x15d69f[_0xee1f('0x1c')],_0x158a8e=_0x12900a[_0xee1f('0x1d')],_0x264150=_0x12900a[_0xee1f('0x1d')]+_0x12900a['limit'],_0x1e2c32;if(_0x264150>=_0x15ebbc){_0x264150=_0x15ebbc;_0x1e2c32=0xc8;}else{_0x1e2c32=0xce;}_0x1028e8[_0xee1f('0x1a')](_0x1e2c32);return _0x1028e8['set']('Content-Range',_0x158a8e+'-'+_0x264150+'/'+_0x15ebbc)[_0xee1f('0x1e')](_0x15d69f);}return null;};}function patchUpdates(_0x247ad6){return function(_0x351ccb){try{jsonpatch[_0xee1f('0x1f')](_0x351ccb,_0x247ad6,!![]);}catch(_0x25cc33){return BPromise[_0xee1f('0x20')](_0x25cc33);}return _0x351ccb['save']();};}function saveUpdates(_0x251bcf,_0x3ebe79){return function(_0x29dad7){if(_0x29dad7){return _0x29dad7[_0xee1f('0x21')](_0x251bcf)['then'](function(_0x5a4a34){return _0x5a4a34;});}return null;};}function removeEntity(_0x325cfb,_0x2eefbc){return function(_0x361953){if(_0x361953){return _0x361953['destroy']()['then'](function(){var _0x18e6b4=_0x361953[_0xee1f('0x22')]({'plain':!![]});var _0x395044=_0xee1f('0x23');return db[_0xee1f('0x24')][_0xee1f('0x25')]({'where':{'type':_0x395044,'resourceId':_0x18e6b4['id']}})['then'](function(){return _0x361953;});})[_0xee1f('0x26')](function(){_0x325cfb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x131848,_0x2b4f19){return function(_0x50432d){if(!_0x50432d){_0x131848[_0xee1f('0x19')](0x194);}return _0x50432d;};}function handleError(_0x302386,_0x34d2f2){_0x34d2f2=_0x34d2f2||0x1f4;return function(_0x5e0ba8){logger[_0xee1f('0x27')](_0x5e0ba8[_0xee1f('0x28')]);if(_0x5e0ba8['name']){delete _0x5e0ba8[_0xee1f('0x29')];}_0x302386[_0xee1f('0x1a')](_0x34d2f2)[_0xee1f('0x2a')](_0x5e0ba8);};}exports['index']=function(_0x3ffb94,_0x5afa2f){var _0x125c30={},_0x4e3c47={},_0x473894={'count':0x0,'rows':[]};var _0x317806=_[_0xee1f('0x2b')](db[_0xee1f('0x2c')][_0xee1f('0x2d')],function(_0x19344b){return{'name':_0x19344b[_0xee1f('0x2e')],'type':_0x19344b['type'][_0xee1f('0x2f')]};});_0x4e3c47['model']=_[_0xee1f('0x2b')](_0x317806,_0xee1f('0x29'));_0x4e3c47[_0xee1f('0x30')]=_[_0xee1f('0x31')](_0x3ffb94['query']);_0x4e3c47['filters']=_['intersection'](_0x4e3c47[_0xee1f('0x32')],_0x4e3c47[_0xee1f('0x30')]);_0x125c30[_0xee1f('0x33')]=_['intersection'](_0x4e3c47[_0xee1f('0x32')],qs['fields'](_0x3ffb94['query'][_0xee1f('0x34')]));_0x125c30[_0xee1f('0x33')]=_0x125c30['attributes'][_0xee1f('0x35')]?_0x125c30[_0xee1f('0x33')]:_0x4e3c47[_0xee1f('0x32')];if(!_0x3ffb94[_0xee1f('0x30')][_0xee1f('0x36')]('nolimit')){_0x125c30[_0xee1f('0x37')]=qs[_0xee1f('0x37')](_0x3ffb94[_0xee1f('0x30')][_0xee1f('0x37')]);_0x125c30[_0xee1f('0x1d')]=qs['offset'](_0x3ffb94[_0xee1f('0x30')][_0xee1f('0x1d')]);}_0x125c30['order']=qs['sort'](_0x3ffb94[_0xee1f('0x30')][_0xee1f('0x38')]);_0x125c30[_0xee1f('0x39')]=qs[_0xee1f('0x3a')](_[_0xee1f('0x3b')](_0x3ffb94['query'],_0x4e3c47[_0xee1f('0x3a')]),_0x317806);if(_0x3ffb94[_0xee1f('0x30')]['filter']){_0x125c30[_0xee1f('0x39')]=_[_0xee1f('0x3c')](_0x125c30[_0xee1f('0x39')],{'$or':_[_0xee1f('0x2b')](_0x317806,function(_0x2cf0fc){if(_0x2cf0fc[_0xee1f('0x3d')]!==_0xee1f('0x3e')){var _0xee4eea={};_0xee4eea[_0x2cf0fc[_0xee1f('0x29')]]={'$like':'%'+_0x3ffb94['query']['filter']+'%'};return _0xee4eea;}})});}_0x125c30=_[_0xee1f('0x3c')]({},_0x125c30,_0x3ffb94['options']);var _0x15ec3f={'where':_0x125c30['where']};return db[_0xee1f('0x2c')][_0xee1f('0x1c')](_0x15ec3f)[_0xee1f('0x26')](function(_0x11ecef){_0x473894[_0xee1f('0x1c')]=_0x11ecef;if(_0x3ffb94['query'][_0xee1f('0x3f')]){_0x125c30['include']=[{'all':!![]}];}return db['Sound'][_0xee1f('0x40')](_0x125c30);})[_0xee1f('0x26')](function(_0x249ca9){_0x473894[_0xee1f('0x41')]=_0x249ca9;return _0x473894;})[_0xee1f('0x26')](respondWithFilteredResult(_0x5afa2f,_0x125c30))[_0xee1f('0x42')](handleError(_0x5afa2f,null));};exports[_0xee1f('0x43')]=function(_0x2fa0d3,_0x14a262){var _0x8a3c3c={'raw':!![],'where':{'id':_0x2fa0d3[_0xee1f('0x44')]['id']}},_0xec5457={};_0xec5457[_0xee1f('0x32')]=_[_0xee1f('0x31')](db[_0xee1f('0x2c')][_0xee1f('0x2d')]);_0xec5457[_0xee1f('0x30')]=_[_0xee1f('0x31')](_0x2fa0d3[_0xee1f('0x30')]);_0xec5457[_0xee1f('0x3a')]=_['intersection'](_0xec5457[_0xee1f('0x32')],_0xec5457[_0xee1f('0x30')]);_0x8a3c3c['attributes']=_['intersection'](_0xec5457[_0xee1f('0x32')],qs[_0xee1f('0x34')](_0x2fa0d3[_0xee1f('0x30')][_0xee1f('0x34')]));_0x8a3c3c['attributes']=_0x8a3c3c[_0xee1f('0x33')][_0xee1f('0x35')]?_0x8a3c3c[_0xee1f('0x33')]:_0xec5457['model'];if(_0x2fa0d3[_0xee1f('0x30')]['includeAll']){_0x8a3c3c['include']=[{'all':!![]}];}_0x8a3c3c=_[_0xee1f('0x3c')]({},_0x8a3c3c,_0x2fa0d3[_0xee1f('0x45')]);return db[_0xee1f('0x2c')]['find'](_0x8a3c3c)[_0xee1f('0x26')](handleEntityNotFound(_0x14a262,null))[_0xee1f('0x26')](respondWithResult(_0x14a262,null))[_0xee1f('0x42')](handleError(_0x14a262,null));};exports['download']=function(_0x3c340a,_0x265e2b,_0x4e8fc8){return db[_0xee1f('0x2c')][_0xee1f('0x46')]({'where':{'id':_0x3c340a['params']['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x265e2b,null))[_0xee1f('0x26')](function(_0x393a5c){if(_0x393a5c){if(!fs['existsSync'](path[_0xee1f('0x47')](config[_0xee1f('0x48')],_0xee1f('0x49'),_0x393a5c[_0xee1f('0x4a')]+'.'+_0x393a5c[_0xee1f('0x4b')]))){throw new db[(_0xee1f('0x4c'))][(_0xee1f('0x4d'))]('Sound\x20not\x20found');}return _0x265e2b[_0xee1f('0x4e')](path[_0xee1f('0x47')](config[_0xee1f('0x48')],_0xee1f('0x49'),util['format']('%s.%s',_0x393a5c['save_name'],_0x393a5c['converted_format'])),util['format'](_0xee1f('0x4f'),_0x393a5c[_0xee1f('0x29')],_0x393a5c['converted_format']));}return null;})[_0xee1f('0x42')](handleError(_0x265e2b,null));};exports[_0xee1f('0x50')]=function(_0x3d2ca4,_0x206371,_0x14dfa7){var _0x4da060={'name':path[_0xee1f('0x51')](_0x3d2ca4[_0xee1f('0x52')][_0xee1f('0x53')],path[_0xee1f('0x54')](_0x3d2ca4[_0xee1f('0x52')]['originalname'])),'save_name':path[_0xee1f('0x51')](_0x3d2ca4[_0xee1f('0x52')][_0xee1f('0x55')],path['extname'](_0x3d2ca4['file'][_0xee1f('0x55')])),'original_format':path[_0xee1f('0x54')](_0x3d2ca4[_0xee1f('0x52')][_0xee1f('0x53')])[_0xee1f('0x56')](0x1),'converted_format':_0xee1f('0x57')};var _0x1a6361=path[_0xee1f('0x47')](config['root'],_0xee1f('0x58'),_0x3d2ca4[_0xee1f('0x52')][_0xee1f('0x55')]);var _0x44031d=path[_0xee1f('0x47')](config[_0xee1f('0x48')],_0xee1f('0x49'),util[_0xee1f('0x59')](_0xee1f('0x4f'),path[_0xee1f('0x51')](_0x3d2ca4['file'][_0xee1f('0x55')],path[_0xee1f('0x54')](_0x3d2ca4[_0xee1f('0x52')][_0xee1f('0x55')])),_0x4da060[_0xee1f('0x4b')]));logger[_0xee1f('0x5a')](_0xee1f('0x5b'),_0x1a6361);logger[_0xee1f('0x5a')](_0xee1f('0x5c'),_0x44031d);try{fs[_0xee1f('0x5d')](_0x1a6361,parseInt(_0xee1f('0x5e'),0x8));var _0x6d8380=sox[_0xee1f('0x5f')](_0x1a6361,_0x44031d,{'sampleRate':0x1f40,'format':_0xee1f('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6d8380['on']('error',function(_0x376c4f){fs[_0xee1f('0x60')](_0x1a6361);_0x206371[_0xee1f('0x1a')](0x1f4)[_0xee1f('0x2a')](_0x376c4f);});_0x6d8380['on'](_0xee1f('0x61'),function(_0x2de2af){_0x4da060[_0xee1f('0x62')]=isNaN(_0x2de2af['duration'])?null:_0x2de2af[_0xee1f('0x63')]*0x3e8;_0x4da060['original_sampleCount']=isNaN(_0x2de2af[_0xee1f('0x64')])?null:_0x2de2af[_0xee1f('0x64')];_0x4da060[_0xee1f('0x65')]=isNaN(_0x2de2af[_0xee1f('0x66')])?null:_0x2de2af[_0xee1f('0x66')];_0x4da060[_0xee1f('0x67')]=isNaN(_0x2de2af['bitRate'])?null:_0x2de2af[_0xee1f('0x68')];_0x4da060[_0xee1f('0x69')]=isNaN(_0x2de2af[_0xee1f('0x6a')])?null:_0x2de2af[_0xee1f('0x6a')];});_0x6d8380['on']('dest',function(_0x336b7d){_0x4da060[_0xee1f('0x6b')]=isNaN(_0x336b7d[_0xee1f('0x63')])?null:_0x336b7d[_0xee1f('0x63')]*0x3e8;_0x4da060['converted_sampleCount']=isNaN(_0x336b7d[_0xee1f('0x64')])?null:_0x336b7d['sampleCount'];_0x4da060[_0xee1f('0x6c')]=isNaN(_0x336b7d[_0xee1f('0x66')])?null:_0x336b7d[_0xee1f('0x66')];_0x4da060[_0xee1f('0x6d')]=isNaN(_0x336b7d[_0xee1f('0x68')])?null:_0x336b7d[_0xee1f('0x68')];_0x4da060[_0xee1f('0x6e')]=isNaN(_0x336b7d[_0xee1f('0x6a')])?null:_0x336b7d[_0xee1f('0x6a')];});_0x6d8380['on'](_0xee1f('0x1b'),function(){fs[_0xee1f('0x5d')](_0x44031d,parseInt(_0xee1f('0x5e'),0x8));return db[_0xee1f('0x2c')]['create'](_0x4da060)[_0xee1f('0x26')](function(_0x4a85c5){var _0x5df0c7={'role':_0x3d2ca4[_0xee1f('0x6f')]['role'],'userProfileId':_0x3d2ca4[_0xee1f('0x6f')]['userProfileId']};if(!_0x5df0c7)throw new Error(_0xee1f('0x70'));if(_0x5df0c7[_0xee1f('0x71')]===_0xee1f('0x72')){var _0x51c4e4=_0x4a85c5[_0xee1f('0x22')]({'plain':!![]});return db[_0xee1f('0x73')][_0xee1f('0x46')]({'where':{'name':_0xee1f('0x23'),'userProfileId':_0x5df0c7[_0xee1f('0x74')]},'raw':!![]})[_0xee1f('0x26')](function(_0x4d028d){if(_0x4d028d&&_0x4d028d[_0xee1f('0x75')]===0x0){return db['UserProfileResource'][_0xee1f('0x50')]({'name':_0x51c4e4['name'],'resourceId':_0x51c4e4['id'],'type':_0x4d028d[_0xee1f('0x29')],'sectionId':_0x4d028d['id']},{})[_0xee1f('0x26')](function(){return _0x4a85c5;});}else{return _0x4a85c5;}})['catch'](function(_0x4e6ebe){logger[_0xee1f('0x27')](_0xee1f('0x76'),_0x4e6ebe);throw _0x4e6ebe;});}return _0x4a85c5;})[_0xee1f('0x26')](respondWithResult(_0x206371,null))[_0xee1f('0x42')](handleError(_0x206371,null));});_0x6d8380['start']();}catch(_0x342c92){_0x206371[_0xee1f('0x1a')](0x1f4)[_0xee1f('0x2a')](_0x342c92);}};exports[_0xee1f('0x21')]=function(_0x15df34,_0x17adfc,_0x1cb149){return db[_0xee1f('0x2c')][_0xee1f('0x46')]({'where':{'id':_0x15df34[_0xee1f('0x44')]['id']}})[_0xee1f('0x26')](handleEntityNotFound(_0x17adfc,null))['then'](saveUpdates(_[_0xee1f('0x3b')](_0x15df34[_0xee1f('0x6f')],['name','description']),null))[_0xee1f('0x26')](respondWithResult(_0x17adfc,null))['catch'](handleError(_0x17adfc,null));};exports[_0xee1f('0x77')]=function(_0x22c727,_0x551417,_0x1c157a){return db['Sound'][_0xee1f('0x46')]({'where':{'id':_0x22c727['params']['id']}})[_0xee1f('0x26')](function(_0x4078ea){if(_0x4078ea){return _0x4078ea[_0xee1f('0x25')]();}})[_0xee1f('0x26')](function(_0x5ea304){var _0x8ac020=path['join'](config['root'],_0xee1f('0x58'),util['format'](_0xee1f('0x4f'),_0x5ea304[_0xee1f('0x4a')],_0x5ea304[_0xee1f('0x78')]));var _0x3310a7=path[_0xee1f('0x47')](config['root'],_0xee1f('0x49'),util[_0xee1f('0x59')](_0xee1f('0x4f'),_0x5ea304[_0xee1f('0x4a')],_0x5ea304[_0xee1f('0x4b')]));fs['unlinkSync'](_0x8ac020);fs[_0xee1f('0x60')](_0x3310a7);return _0x5ea304;})[_0xee1f('0x26')](function(_0x3784ba){if(_0x3784ba){return _0x551417[_0xee1f('0x1a')](0xcc)[_0xee1f('0x1b')]();}})[_0xee1f('0x26')](handleEntityNotFound(_0x551417,null))[_0xee1f('0x42')](handleError(_0x551417,null));}; \ No newline at end of file +var _0x38d9=['path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','Sound','includeAll','include','rows','catch','show','rawAttributes','download','find','params','save_name','converted_format','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','unlinkSync','src','original_duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x40c51a,_0x2fdc07){var _0x4f9782=function(_0x3963f1){while(--_0x3963f1){_0x40c51a['push'](_0x40c51a['shift']());}};_0x4f9782(++_0x2fdc07);}(_0x38d9,0x167));var _0x938d=function(_0x2af541,_0x334192){_0x2af541=_0x2af541-0x0;var _0x27c609=_0x38d9[_0x2af541];return _0x27c609;};'use strict';var pdf=require(_0x938d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x938d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x938d('0x2'));var moment=require(_0x938d('0x3'));var BPromise=require(_0x938d('0x4'));var Mustache=require(_0x938d('0x5'));var util=require(_0x938d('0x6'));var path=require(_0x938d('0x7'));var sox=require('sox');var csv=require(_0x938d('0x8'));var ejs=require(_0x938d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x938d('0xa'));var crypto=require(_0x938d('0xb'));var jsforce=require(_0x938d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x938d('0xd'));var Papa=require('papaparse');var Redis=require(_0x938d('0xe'));var authService=require(_0x938d('0xf'));var qs=require(_0x938d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x938d('0x11'));var logger=require(_0x938d('0x12'))(_0x938d('0x13'));var utils=require(_0x938d('0x14'));var config=require(_0x938d('0x15'));var db=require(_0x938d('0x16'))['db'];function respondWithStatusCode(_0x3d797d,_0x37422a){_0x37422a=_0x37422a||0xcc;return function(_0x29e7ac){if(_0x29e7ac){return _0x3d797d[_0x938d('0x17')](_0x37422a);}return _0x3d797d[_0x938d('0x18')](_0x37422a)['end']();};}function respondWithResult(_0x2ea19b,_0x292fb3){_0x292fb3=_0x292fb3||0xc8;return function(_0x3b6a9b){if(_0x3b6a9b){return _0x2ea19b[_0x938d('0x18')](_0x292fb3)[_0x938d('0x19')](_0x3b6a9b);}};}function respondWithFilteredResult(_0xbb35fd,_0x5d0b0a){return function(_0x3e978f){if(_0x3e978f){var _0x1ba058=_0x3e978f[_0x938d('0x1a')],_0x46eb9f=_0x5d0b0a[_0x938d('0x1b')],_0x484ebc=_0x5d0b0a['offset']+_0x5d0b0a[_0x938d('0x1c')],_0x2f677e;if(_0x484ebc>=_0x1ba058){_0x484ebc=_0x1ba058;_0x2f677e=0xc8;}else{_0x2f677e=0xce;}_0xbb35fd[_0x938d('0x18')](_0x2f677e);return _0xbb35fd['set'](_0x938d('0x1d'),_0x46eb9f+'-'+_0x484ebc+'/'+_0x1ba058)[_0x938d('0x19')](_0x3e978f);}return null;};}function patchUpdates(_0x1d90dc){return function(_0x153b89){try{jsonpatch['apply'](_0x153b89,_0x1d90dc,!![]);}catch(_0x2220e8){return BPromise['reject'](_0x2220e8);}return _0x153b89[_0x938d('0x1e')]();};}function saveUpdates(_0x29241f,_0x2108d4){return function(_0x470fda){if(_0x470fda){return _0x470fda[_0x938d('0x1f')](_0x29241f)[_0x938d('0x20')](function(_0x538fa2){return _0x538fa2;});}return null;};}function removeEntity(_0x3126bd,_0x212675){return function(_0x169558){if(_0x169558){return _0x169558[_0x938d('0x21')]()['then'](function(){var _0xbfc208=_0x169558[_0x938d('0x22')]({'plain':!![]});var _0x319579='Sounds';return db[_0x938d('0x23')][_0x938d('0x21')]({'where':{'type':_0x319579,'resourceId':_0xbfc208['id']}})[_0x938d('0x20')](function(){return _0x169558;});})[_0x938d('0x20')](function(){_0x3126bd[_0x938d('0x18')](0xcc)[_0x938d('0x24')]();});}};}function handleEntityNotFound(_0x1ddf5a,_0x41fd5b){return function(_0x417da3){if(!_0x417da3){_0x1ddf5a[_0x938d('0x17')](0x194);}return _0x417da3;};}function handleError(_0x278182,_0x163637){_0x163637=_0x163637||0x1f4;return function(_0x3301d3){logger[_0x938d('0x25')](_0x3301d3[_0x938d('0x26')]);if(_0x3301d3[_0x938d('0x27')]){delete _0x3301d3[_0x938d('0x27')];}_0x278182[_0x938d('0x18')](_0x163637)[_0x938d('0x28')](_0x3301d3);};}exports['index']=function(_0x30768f,_0x35d47b){var _0x3f3786={},_0x535358={},_0x21fa95={'count':0x0,'rows':[]};var _0x2c3977=_['map'](db['Sound']['rawAttributes'],function(_0x159cce){return{'name':_0x159cce[_0x938d('0x29')],'type':_0x159cce[_0x938d('0x2a')][_0x938d('0x2b')]};});_0x535358[_0x938d('0x2c')]=_[_0x938d('0x2d')](_0x2c3977,'name');_0x535358[_0x938d('0x2e')]=_[_0x938d('0x2f')](_0x30768f['query']);_0x535358['filters']=_[_0x938d('0x30')](_0x535358[_0x938d('0x2c')],_0x535358[_0x938d('0x2e')]);_0x3f3786[_0x938d('0x31')]=_[_0x938d('0x30')](_0x535358[_0x938d('0x2c')],qs[_0x938d('0x32')](_0x30768f[_0x938d('0x2e')][_0x938d('0x32')]));_0x3f3786['attributes']=_0x3f3786[_0x938d('0x31')][_0x938d('0x33')]?_0x3f3786['attributes']:_0x535358[_0x938d('0x2c')];if(!_0x30768f[_0x938d('0x2e')][_0x938d('0x34')](_0x938d('0x35'))){_0x3f3786[_0x938d('0x1c')]=qs[_0x938d('0x1c')](_0x30768f[_0x938d('0x2e')][_0x938d('0x1c')]);_0x3f3786[_0x938d('0x1b')]=qs[_0x938d('0x1b')](_0x30768f['query'][_0x938d('0x1b')]);}_0x3f3786[_0x938d('0x36')]=qs[_0x938d('0x37')](_0x30768f['query'][_0x938d('0x37')]);_0x3f3786[_0x938d('0x38')]=qs['filters'](_[_0x938d('0x39')](_0x30768f[_0x938d('0x2e')],_0x535358[_0x938d('0x3a')]),_0x2c3977);if(_0x30768f[_0x938d('0x2e')]['filter']){_0x3f3786['where']=_[_0x938d('0x3b')](_0x3f3786[_0x938d('0x38')],{'$or':_[_0x938d('0x2d')](_0x2c3977,function(_0x34510e){if(_0x34510e['type']!==_0x938d('0x3c')){var _0x3430d4={};_0x3430d4[_0x34510e[_0x938d('0x27')]]={'$like':'%'+_0x30768f[_0x938d('0x2e')][_0x938d('0x3d')]+'%'};return _0x3430d4;}})});}_0x3f3786=_['merge']({},_0x3f3786,_0x30768f[_0x938d('0x3e')]);var _0x62cfff={'where':_0x3f3786['where']};return db[_0x938d('0x3f')][_0x938d('0x1a')](_0x62cfff)['then'](function(_0x28431e){_0x21fa95[_0x938d('0x1a')]=_0x28431e;if(_0x30768f[_0x938d('0x2e')][_0x938d('0x40')]){_0x3f3786[_0x938d('0x41')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x3f3786);})['then'](function(_0x9dd8d9){_0x21fa95[_0x938d('0x42')]=_0x9dd8d9;return _0x21fa95;})[_0x938d('0x20')](respondWithFilteredResult(_0x35d47b,_0x3f3786))[_0x938d('0x43')](handleError(_0x35d47b,null));};exports[_0x938d('0x44')]=function(_0x2f4c01,_0x3442a1){var _0x28e5ee={'raw':!![],'where':{'id':_0x2f4c01['params']['id']}},_0x3457c6={};_0x3457c6[_0x938d('0x2c')]=_[_0x938d('0x2f')](db['Sound'][_0x938d('0x45')]);_0x3457c6[_0x938d('0x2e')]=_[_0x938d('0x2f')](_0x2f4c01[_0x938d('0x2e')]);_0x3457c6[_0x938d('0x3a')]=_['intersection'](_0x3457c6['model'],_0x3457c6[_0x938d('0x2e')]);_0x28e5ee[_0x938d('0x31')]=_[_0x938d('0x30')](_0x3457c6[_0x938d('0x2c')],qs['fields'](_0x2f4c01[_0x938d('0x2e')][_0x938d('0x32')]));_0x28e5ee['attributes']=_0x28e5ee[_0x938d('0x31')]['length']?_0x28e5ee['attributes']:_0x3457c6['model'];if(_0x2f4c01[_0x938d('0x2e')]['includeAll']){_0x28e5ee[_0x938d('0x41')]=[{'all':!![]}];}_0x28e5ee=_['merge']({},_0x28e5ee,_0x2f4c01['options']);return db[_0x938d('0x3f')]['find'](_0x28e5ee)[_0x938d('0x20')](handleEntityNotFound(_0x3442a1,null))[_0x938d('0x20')](respondWithResult(_0x3442a1,null))[_0x938d('0x43')](handleError(_0x3442a1,null));};exports[_0x938d('0x46')]=function(_0x2ed980,_0x14917c,_0x83c728){return db['Sound'][_0x938d('0x47')]({'where':{'id':_0x2ed980[_0x938d('0x48')]['id']},'attributes':[_0x938d('0x27'),_0x938d('0x49'),_0x938d('0x4a')],'raw':!![]})[_0x938d('0x20')](handleEntityNotFound(_0x14917c,null))[_0x938d('0x20')](function(_0x519a66){if(_0x519a66){if(!fs['existsSync'](path[_0x938d('0x4b')](config[_0x938d('0x4c')],'server/files/sounds/converted',_0x519a66[_0x938d('0x49')]+'.'+_0x519a66[_0x938d('0x4a')]))){throw new db[(_0x938d('0x4d'))][(_0x938d('0x4e'))](_0x938d('0x4f'));}return _0x14917c[_0x938d('0x46')](path[_0x938d('0x4b')](config[_0x938d('0x4c')],_0x938d('0x50'),util[_0x938d('0x51')](_0x938d('0x52'),_0x519a66['save_name'],_0x519a66[_0x938d('0x4a')])),util['format'](_0x938d('0x52'),_0x519a66[_0x938d('0x27')],_0x519a66[_0x938d('0x4a')]));}return null;})[_0x938d('0x43')](handleError(_0x14917c,null));};exports[_0x938d('0x53')]=function(_0x4fef56,_0x5d8337,_0x42e518){var _0x57619b={'name':path[_0x938d('0x54')](_0x4fef56[_0x938d('0x55')][_0x938d('0x56')],path[_0x938d('0x57')](_0x4fef56['file'][_0x938d('0x56')])),'save_name':path[_0x938d('0x54')](_0x4fef56['file'][_0x938d('0x58')],path[_0x938d('0x57')](_0x4fef56[_0x938d('0x55')][_0x938d('0x58')])),'original_format':path[_0x938d('0x57')](_0x4fef56['file'][_0x938d('0x56')])[_0x938d('0x59')](0x1),'converted_format':'wav'};var _0x2fe185=path[_0x938d('0x4b')](config[_0x938d('0x4c')],'server/files/sounds/original',_0x4fef56[_0x938d('0x55')][_0x938d('0x58')]);var _0x30f916=path[_0x938d('0x4b')](config[_0x938d('0x4c')],'server/files/sounds/converted',util[_0x938d('0x51')](_0x938d('0x52'),path['basename'](_0x4fef56[_0x938d('0x55')]['filename'],path['extname'](_0x4fef56['file'][_0x938d('0x58')])),_0x57619b[_0x938d('0x4a')]));logger[_0x938d('0x5a')](_0x938d('0x5b'),_0x2fe185);logger[_0x938d('0x5a')](_0x938d('0x5c'),_0x30f916);try{fs[_0x938d('0x5d')](_0x2fe185,parseInt('0777',0x8));var _0x2cc29f=sox[_0x938d('0x5e')](_0x2fe185,_0x30f916,{'sampleRate':0x1f40,'format':_0x938d('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2cc29f['on'](_0x938d('0x25'),function(_0x56506c){fs[_0x938d('0x60')](_0x2fe185);_0x5d8337[_0x938d('0x18')](0x1f4)[_0x938d('0x28')](_0x56506c);});_0x2cc29f['on'](_0x938d('0x61'),function(_0x561641){_0x57619b[_0x938d('0x62')]=isNaN(_0x561641['duration'])?null:_0x561641['duration']*0x3e8;_0x57619b['original_sampleCount']=isNaN(_0x561641[_0x938d('0x63')])?null:_0x561641['sampleCount'];_0x57619b[_0x938d('0x64')]=isNaN(_0x561641[_0x938d('0x65')])?null:_0x561641[_0x938d('0x65')];_0x57619b[_0x938d('0x66')]=isNaN(_0x561641[_0x938d('0x67')])?null:_0x561641[_0x938d('0x67')];_0x57619b[_0x938d('0x68')]=isNaN(_0x561641['sampleRate'])?null:_0x561641[_0x938d('0x69')];});_0x2cc29f['on'](_0x938d('0x6a'),function(_0x771e82){_0x57619b[_0x938d('0x6b')]=isNaN(_0x771e82[_0x938d('0x6c')])?null:_0x771e82['duration']*0x3e8;_0x57619b['converted_sampleCount']=isNaN(_0x771e82['sampleCount'])?null:_0x771e82['sampleCount'];_0x57619b[_0x938d('0x6d')]=isNaN(_0x771e82['channelCount'])?null:_0x771e82[_0x938d('0x65')];_0x57619b['converted_bitRate']=isNaN(_0x771e82['bitRate'])?null:_0x771e82[_0x938d('0x67')];_0x57619b[_0x938d('0x6e')]=isNaN(_0x771e82[_0x938d('0x69')])?null:_0x771e82[_0x938d('0x69')];});_0x2cc29f['on'](_0x938d('0x24'),function(){fs[_0x938d('0x5d')](_0x30f916,parseInt('0777',0x8));return db[_0x938d('0x3f')][_0x938d('0x53')](_0x57619b)[_0x938d('0x20')](function(_0x1b08a5){var _0x31d06c={'role':_0x4fef56[_0x938d('0x6f')][_0x938d('0x70')],'userProfileId':_0x4fef56[_0x938d('0x6f')][_0x938d('0x71')]};if(!_0x31d06c)throw new Error(_0x938d('0x72'));if(_0x31d06c[_0x938d('0x70')]===_0x938d('0x73')){var _0x227582=_0x1b08a5[_0x938d('0x22')]({'plain':!![]});return db['UserProfileSection'][_0x938d('0x47')]({'where':{'name':_0x938d('0x74'),'userProfileId':_0x31d06c[_0x938d('0x71')]},'raw':!![]})['then'](function(_0x5b274f){if(_0x5b274f&&_0x5b274f[_0x938d('0x75')]===0x0){return db[_0x938d('0x23')]['create']({'name':_0x227582[_0x938d('0x27')],'resourceId':_0x227582['id'],'type':_0x5b274f[_0x938d('0x27')],'sectionId':_0x5b274f['id']},{})[_0x938d('0x20')](function(){return _0x1b08a5;});}else{return _0x1b08a5;}})[_0x938d('0x43')](function(_0xb67d2d){logger['error'](_0x938d('0x76'),_0xb67d2d);throw _0xb67d2d;});}return _0x1b08a5;})[_0x938d('0x20')](respondWithResult(_0x5d8337,null))[_0x938d('0x43')](handleError(_0x5d8337,null));});_0x2cc29f[_0x938d('0x77')]();}catch(_0x211e67){_0x5d8337[_0x938d('0x18')](0x1f4)[_0x938d('0x28')](_0x211e67);}};exports['update']=function(_0x1f765a,_0x533ef6,_0x2ba50c){return db['Sound'][_0x938d('0x47')]({'where':{'id':_0x1f765a[_0x938d('0x48')]['id']}})[_0x938d('0x20')](handleEntityNotFound(_0x533ef6,null))[_0x938d('0x20')](saveUpdates(_[_0x938d('0x39')](_0x1f765a[_0x938d('0x6f')],['name',_0x938d('0x78')]),null))[_0x938d('0x20')](respondWithResult(_0x533ef6,null))['catch'](handleError(_0x533ef6,null));};exports['delete']=function(_0x342b56,_0x20de8e,_0x520598){return db[_0x938d('0x3f')][_0x938d('0x47')]({'where':{'id':_0x342b56['params']['id']}})[_0x938d('0x20')](function(_0x560c25){if(_0x560c25){return _0x560c25[_0x938d('0x21')]();}})[_0x938d('0x20')](function(_0x3d6e95){var _0x105970=path[_0x938d('0x4b')](config[_0x938d('0x4c')],'server/files/sounds/original',util[_0x938d('0x51')](_0x938d('0x52'),_0x3d6e95['save_name'],_0x3d6e95[_0x938d('0x79')]));var _0x585af2=path[_0x938d('0x4b')](config['root'],_0x938d('0x50'),util['format'](_0x938d('0x52'),_0x3d6e95[_0x938d('0x49')],_0x3d6e95['converted_format']));fs[_0x938d('0x60')](_0x105970);fs['unlinkSync'](_0x585af2);return _0x3d6e95;})['then'](function(_0x333aa8){if(_0x333aa8){return _0x20de8e[_0x938d('0x18')](0xcc)[_0x938d('0x24')]();}})[_0x938d('0x20')](handleEntityNotFound(_0x20de8e,null))[_0x938d('0x43')](handleError(_0x20de8e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f6ad024..c6209e9 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 _0x9cfd=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash'];(function(_0x259ceb,_0x353842){var _0x1d0d8e=function(_0x3404d6){while(--_0x3404d6){_0x259ceb['push'](_0x259ceb['shift']());}};_0x1d0d8e(++_0x353842);}(_0x9cfd,0x128));var _0xd9cf=function(_0x42a971,_0x337e98){_0x42a971=_0x42a971-0x0;var _0x47c6a9=_0x9cfd[_0x42a971];return _0x47c6a9;};'use strict';var _=require(_0xd9cf('0x0'));var util=require(_0xd9cf('0x1'));var logger=require(_0xd9cf('0x2'))('api');var moment=require(_0xd9cf('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9cf('0x4'));var fs=require('fs');var path=require(_0xd9cf('0x5'));var rimraf=require(_0xd9cf('0x6'));var config=require(_0xd9cf('0x7'));var attributes=require(_0xd9cf('0x8'));module['exports']=function(_0x13eb8a,_0x345a25){return _0x13eb8a['define'](_0xd9cf('0x9'),attributes,{'tableName':_0xd9cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x939b=['./sound.attributes','exports','define','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3c118e,_0x4da89e){var _0x3ed1b6=function(_0x42d38a){while(--_0x42d38a){_0x3c118e['push'](_0x3c118e['shift']());}};_0x3ed1b6(++_0x4da89e);}(_0x939b,0x64));var _0xb939=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x939b[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xb939('0x0'));var util=require(_0xb939('0x1'));var logger=require(_0xb939('0x2'))(_0xb939('0x3'));var moment=require(_0xb939('0x4'));var BPromise=require('bluebird');var rp=require(_0xb939('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb939('0x6'));var config=require(_0xb939('0x7'));var attributes=require(_0xb939('0x8'));module[_0xb939('0x9')]=function(_0x22eec4,_0x1bc786){return _0x22eec4[_0xb939('0xa')]('Sound',attributes,{'tableName':_0xb939('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 7362084..16f0bbb 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 _0x8c93=['result','catch','ShowSound','Sound','find','options','raw','attributes','map','include','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','code','error','Sound,\x20%s,\x20%s','message'];(function(_0x3f3c5e,_0x5b6773){var _0xe970e6=function(_0x2fa5d9){while(--_0x2fa5d9){_0x3f3c5e['push'](_0x3f3c5e['shift']());}};_0xe970e6(++_0x5b6773);}(_0x8c93,0xfa));var _0x38c9=function(_0xda929e,_0x2454bc){_0xda929e=_0xda929e-0x0;var _0x4575ab=_0x8c93[_0xda929e];return _0x4575ab;};'use strict';var _=require(_0x38c9('0x0'));var util=require(_0x38c9('0x1'));var moment=require(_0x38c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x38c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38c9('0x4'))['db'];var utils=require(_0x38c9('0x5'));var logger=require(_0x38c9('0x6'))(_0x38c9('0x7'));var config=require(_0x38c9('0x8'));var jayson=require(_0x38c9('0x9'));var client=jayson[_0x38c9('0xa')][_0x38c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35753a,_0x3fbd1a,_0x1ac82f){return new BPromise(function(_0x4fa947,_0x3cc7c0){return client[_0x38c9('0xc')](_0x35753a,_0x1ac82f)[_0x38c9('0xd')](function(_0x348784){logger[_0x38c9('0xe')]('Sound,\x20%s,\x20%s',_0x3fbd1a,_0x38c9('0xf'));logger['debug'](_0x38c9('0x10'),_0x3fbd1a,_0x38c9('0xf'),JSON[_0x38c9('0x11')](_0x348784));if(_0x348784['error']){if(_0x348784['error'][_0x38c9('0x12')]===0x1f4){logger[_0x38c9('0x13')](_0x38c9('0x14'),_0x3fbd1a,_0x348784['error'][_0x38c9('0x15')]);return _0x3cc7c0(_0x348784[_0x38c9('0x13')][_0x38c9('0x15')]);}logger['error']('Sound,\x20%s,\x20%s',_0x3fbd1a,_0x348784['error'][_0x38c9('0x15')]);return _0x4fa947(_0x348784[_0x38c9('0x13')]['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x3fbd1a,_0x38c9('0xf'));_0x4fa947(_0x348784[_0x38c9('0x16')]['message']);}})[_0x38c9('0x17')](function(_0x18c3e3){logger['error']('Sound,\x20%s,\x20%s',_0x3fbd1a,_0x18c3e3);_0x3cc7c0(_0x18c3e3);});});}exports[_0x38c9('0x18')]=function(_0x49d318){var _0x33b1fb=this;return new Promise(function(_0x35de44,_0x98cf42){return db[_0x38c9('0x19')][_0x38c9('0x1a')]({'raw':_0x49d318[_0x38c9('0x1b')]?_0x49d318['options'][_0x38c9('0x1c')]===undefined?!![]:![]:!![],'where':_0x49d318[_0x38c9('0x1b')]?_0x49d318[_0x38c9('0x1b')]['where']||null:null,'attributes':_0x49d318[_0x38c9('0x1b')]?_0x49d318[_0x38c9('0x1b')][_0x38c9('0x1d')]||null:null,'include':_0x49d318[_0x38c9('0x1b')]?_0x49d318[_0x38c9('0x1b')]['include']?_[_0x38c9('0x1e')](_0x49d318['options'][_0x38c9('0x1f')],function(_0x5b82bc){return{'model':db[_0x5b82bc[_0x38c9('0x20')]],'as':_0x5b82bc['as'],'attributes':_0x5b82bc['attributes'],'include':_0x5b82bc[_0x38c9('0x1f')]?_[_0x38c9('0x1e')](_0x5b82bc[_0x38c9('0x1f')],function(_0x3a1237){return{'model':db[_0x3a1237[_0x38c9('0x20')]],'as':_0x3a1237['as'],'attributes':_0x3a1237[_0x38c9('0x1d')],'include':_0x3a1237[_0x38c9('0x1f')]?_[_0x38c9('0x1e')](_0x3a1237[_0x38c9('0x1f')],function(_0x1e1606){return{'model':db[_0x1e1606[_0x38c9('0x20')]],'as':_0x1e1606['as'],'attributes':_0x1e1606[_0x38c9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x38c9('0xd')](function(_0x1054eb){logger[_0x38c9('0xe')](_0x38c9('0x18'),_0x49d318);logger[_0x38c9('0x21')](_0x38c9('0x18'),_0x49d318,JSON['stringify'](_0x1054eb));_0x35de44(_0x1054eb);})[_0x38c9('0x17')](function(_0x5dfe05){logger['error'](_0x38c9('0x18'),_0x5dfe05[_0x38c9('0x15')],_0x49d318);_0x98cf42(_0x33b1fb[_0x38c9('0x13')](0x1f4,_0x5dfe05[_0x38c9('0x15')]));});});}; \ No newline at end of file +var _0xd3a3=['model','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSound','Sound','find','options','raw','where','include','map'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xd3a3,0x87));var _0x3d3a=function(_0x24f6c4,_0x54f981){_0x24f6c4=_0x24f6c4-0x0;var _0x61891f=_0xd3a3[_0x24f6c4];return _0x61891f;};'use strict';var _=require(_0x3d3a('0x0'));var util=require(_0x3d3a('0x1'));var moment=require(_0x3d3a('0x2'));var BPromise=require(_0x3d3a('0x3'));var rs=require(_0x3d3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d3a('0x5'))['db'];var utils=require(_0x3d3a('0x6'));var logger=require(_0x3d3a('0x7'))(_0x3d3a('0x8'));var config=require(_0x3d3a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3d3a('0xa')][_0x3d3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cdded,_0x300cea,_0x56e596){return new BPromise(function(_0xa0fa2b,_0x52f3bd){return client['request'](_0x1cdded,_0x56e596)[_0x3d3a('0xc')](function(_0x453a95){logger[_0x3d3a('0xd')](_0x3d3a('0xe'),_0x300cea,_0x3d3a('0xf'));logger[_0x3d3a('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x300cea,_0x3d3a('0xf'),JSON[_0x3d3a('0x11')](_0x453a95));if(_0x453a95[_0x3d3a('0x12')]){if(_0x453a95[_0x3d3a('0x12')][_0x3d3a('0x13')]===0x1f4){logger[_0x3d3a('0x12')](_0x3d3a('0xe'),_0x300cea,_0x453a95[_0x3d3a('0x12')][_0x3d3a('0x14')]);return _0x52f3bd(_0x453a95[_0x3d3a('0x12')][_0x3d3a('0x14')]);}logger[_0x3d3a('0x12')](_0x3d3a('0xe'),_0x300cea,_0x453a95[_0x3d3a('0x12')]['message']);return _0xa0fa2b(_0x453a95[_0x3d3a('0x12')][_0x3d3a('0x14')]);}else{logger['info'](_0x3d3a('0xe'),_0x300cea,_0x3d3a('0xf'));_0xa0fa2b(_0x453a95[_0x3d3a('0x15')][_0x3d3a('0x14')]);}})['catch'](function(_0x364411){logger[_0x3d3a('0x12')](_0x3d3a('0xe'),_0x300cea,_0x364411);_0x52f3bd(_0x364411);});});}exports[_0x3d3a('0x16')]=function(_0x4bf65c){var _0x33c83b=this;return new Promise(function(_0x5d2d22,_0x30917c){return db[_0x3d3a('0x17')][_0x3d3a('0x18')]({'raw':_0x4bf65c[_0x3d3a('0x19')]?_0x4bf65c['options'][_0x3d3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4bf65c[_0x3d3a('0x19')]?_0x4bf65c[_0x3d3a('0x19')][_0x3d3a('0x1b')]||null:null,'attributes':_0x4bf65c[_0x3d3a('0x19')]?_0x4bf65c['options']['attributes']||null:null,'include':_0x4bf65c[_0x3d3a('0x19')]?_0x4bf65c[_0x3d3a('0x19')][_0x3d3a('0x1c')]?_[_0x3d3a('0x1d')](_0x4bf65c[_0x3d3a('0x19')]['include'],function(_0x68c72f){return{'model':db[_0x68c72f[_0x3d3a('0x1e')]],'as':_0x68c72f['as'],'attributes':_0x68c72f[_0x3d3a('0x1f')],'include':_0x68c72f[_0x3d3a('0x1c')]?_[_0x3d3a('0x1d')](_0x68c72f[_0x3d3a('0x1c')],function(_0x39e688){return{'model':db[_0x39e688[_0x3d3a('0x1e')]],'as':_0x39e688['as'],'attributes':_0x39e688[_0x3d3a('0x1f')],'include':_0x39e688['include']?_[_0x3d3a('0x1d')](_0x39e688['include'],function(_0x2408e1){return{'model':db[_0x2408e1[_0x3d3a('0x1e')]],'as':_0x2408e1['as'],'attributes':_0x2408e1[_0x3d3a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3d3a('0xc')](function(_0x26c322){logger[_0x3d3a('0xd')](_0x3d3a('0x16'),_0x4bf65c);logger[_0x3d3a('0x10')](_0x3d3a('0x16'),_0x4bf65c,JSON[_0x3d3a('0x11')](_0x26c322));_0x5d2d22(_0x26c322);})[_0x3d3a('0x20')](function(_0x13483f){logger[_0x3d3a('0x12')](_0x3d3a('0x16'),_0x13483f['message'],_0x4bf65c);_0x30917c(_0x33c83b['error'](0x1f4,_0x13483f[_0x3d3a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index c539c84..b7df289 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 _0xf20d=['create','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf20d,0x1ac));var _0xdf20=function(_0x201429,_0x54de48){_0x201429=_0x201429-0x0;var _0x2558f3=_0xf20d[_0x201429];return _0x2558f3;};'use strict';var multer=require(_0xdf20('0x0'));var util=require(_0xdf20('0x1'));var path=require(_0xdf20('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf20('0x3'));var router=express[_0xdf20('0x4')]();var auth=require(_0xdf20('0x5'));var interaction=require(_0xdf20('0x6'));var config=require('../../config/environment');var controller=require(_0xdf20('0x7'));router[_0xdf20('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf20('0x9')]);router[_0xdf20('0x8')](_0xdf20('0xa'),auth[_0xdf20('0xb')](),controller[_0xdf20('0xc')]);router[_0xdf20('0xd')]('/',auth[_0xdf20('0xb')](),controller[_0xdf20('0xe')]);router['put'](_0xdf20('0xa'),auth[_0xdf20('0xb')](),controller[_0xdf20('0xf')]);router[_0xdf20('0x10')](_0xdf20('0xa'),auth[_0xdf20('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5e35=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x5e35,0xd9));var _0x55e3=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x5e35[_0x342baa];return _0x1208f3;};'use strict';var multer=require('multer');var util=require(_0x55e3('0x0'));var path=require(_0x55e3('0x1'));var timeout=require(_0x55e3('0x2'));var express=require(_0x55e3('0x3'));var router=express[_0x55e3('0x4')]();var auth=require(_0x55e3('0x5'));var interaction=require(_0x55e3('0x6'));var config=require(_0x55e3('0x7'));var controller=require(_0x55e3('0x8'));router[_0x55e3('0x9')]('/',auth[_0x55e3('0xa')](),controller[_0x55e3('0xb')]);router[_0x55e3('0x9')](_0x55e3('0xc'),auth['isAuthenticated'](),controller[_0x55e3('0xd')]);router[_0x55e3('0xe')]('/',auth['isAuthenticated'](),controller[_0x55e3('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x55e3('0x10')]);router[_0x55e3('0x11')](_0x55e3('0xc'),auth['isAuthenticated'](),controller[_0x55e3('0x12')]);module[_0x55e3('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 34e44ae..a7f8a91 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 _0x42ec=['STRING','medium','out','sequelize','exports'];(function(_0x190417,_0x54dc0d){var _0x110e9c=function(_0x517b86){while(--_0x517b86){_0x190417['push'](_0x190417['shift']());}};_0x110e9c(++_0x54dc0d);}(_0x42ec,0x8a));var _0xc42e=function(_0x3473a6,_0x3bbf1d){_0x3473a6=_0x3473a6-0x0;var _0x587786=_0x42ec[_0x3473a6];return _0x587786;};'use strict';var Sequelize=require(_0xc42e('0x0'));module[_0xc42e('0x1')]={'uniqueid':{'type':Sequelize[_0xc42e('0x2')]},'body':{'type':Sequelize['TEXT'](_0xc42e('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc42e('0x4')),'defaultValue':_0xc42e('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0x3d41=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x7265d8,_0x266c82){var _0x31098a=function(_0x4f1eef){while(--_0x4f1eef){_0x7265d8['push'](_0x7265d8['shift']());}};_0x31098a(++_0x266c82);}(_0x3d41,0x6e));var _0x13d4=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0x3d41[_0x10a212];return _0x23c82b;};'use strict';var Sequelize=require(_0x13d4('0x0'));module[_0x13d4('0x1')]={'uniqueid':{'type':Sequelize[_0x13d4('0x2')]},'body':{'type':Sequelize[_0x13d4('0x3')](_0x13d4('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x13d4('0x5')]('in',_0x13d4('0x6')),'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 3e61153..1530c8a 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 _0x125e=['merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','error','stack','name','send','SquareMessage','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter'];(function(_0x26aae0,_0x27785b){var _0xf7c4f9=function(_0x1a35c9){while(--_0x1a35c9){_0x26aae0['push'](_0x26aae0['shift']());}};_0xf7c4f9(++_0x27785b);}(_0x125e,0xd3));var _0xe125=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x125e[_0x533e4e];return _0x1f14bb;};'use strict';var pdf=require(_0xe125('0x0'));var emlformat=require(_0xe125('0x1'));var rimraf=require(_0xe125('0x2'));var zipdir=require(_0xe125('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe125('0x4'));var moment=require('moment');var BPromise=require(_0xe125('0x5'));var Mustache=require(_0xe125('0x6'));var util=require(_0xe125('0x7'));var path=require('path');var sox=require(_0xe125('0x8'));var csv=require(_0xe125('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe125('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe125('0xb'));var deskjs=require(_0xe125('0xc'));var toCsv=require(_0xe125('0x9'));var querystring=require(_0xe125('0xd'));var Papa=require('papaparse');var Redis=require(_0xe125('0xe'));var authService=require(_0xe125('0xf'));var qs=require(_0xe125('0x10'));var as=require(_0xe125('0x11'));var hardwareService=require(_0xe125('0x12'));var logger=require('../../config/logger')(_0xe125('0x13'));var utils=require(_0xe125('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b8f6,_0x591490){_0x591490=_0x591490||0xcc;return function(_0x8759ac){if(_0x8759ac){return _0x53b8f6[_0xe125('0x15')](_0x591490);}return _0x53b8f6['status'](_0x591490)[_0xe125('0x16')]();};}function respondWithResult(_0x387773,_0xba3e95){_0xba3e95=_0xba3e95||0xc8;return function(_0x553cd3){if(_0x553cd3){return _0x387773[_0xe125('0x17')](_0xba3e95)[_0xe125('0x18')](_0x553cd3);}};}function respondWithFilteredResult(_0x31dfa2,_0x536e27){return function(_0x9f627b){if(_0x9f627b){var _0x296b2b=_0x9f627b[_0xe125('0x19')],_0x8c1f5=_0x536e27[_0xe125('0x1a')],_0x2c3065=_0x536e27[_0xe125('0x1a')]+_0x536e27[_0xe125('0x1b')],_0x3ce41e;if(_0x2c3065>=_0x296b2b){_0x2c3065=_0x296b2b;_0x3ce41e=0xc8;}else{_0x3ce41e=0xce;}_0x31dfa2['status'](_0x3ce41e);return _0x31dfa2[_0xe125('0x1c')](_0xe125('0x1d'),_0x8c1f5+'-'+_0x2c3065+'/'+_0x296b2b)[_0xe125('0x18')](_0x9f627b);}return null;};}function patchUpdates(_0x1d0500){return function(_0x2455f9){try{jsonpatch['apply'](_0x2455f9,_0x1d0500,!![]);}catch(_0x218b66){return BPromise[_0xe125('0x1e')](_0x218b66);}return _0x2455f9[_0xe125('0x1f')]();};}function saveUpdates(_0x13c9fa,_0x55a268){return function(_0x57043d){if(_0x57043d){return _0x57043d['update'](_0x13c9fa)['then'](function(_0x490cee){return _0x490cee;});}return null;};}function removeEntity(_0x4605de,_0x1a00e5){return function(_0x2ff0aa){if(_0x2ff0aa){return _0x2ff0aa[_0xe125('0x20')]()[_0xe125('0x21')](function(){_0x4605de[_0xe125('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb4dd5,_0x4bbc1f){return function(_0x4a16b0){if(!_0x4a16b0){_0xfb4dd5['sendStatus'](0x194);}return _0x4a16b0;};}function handleError(_0x2b1ef7,_0x516630){_0x516630=_0x516630||0x1f4;return function(_0x390eeb){logger[_0xe125('0x22')](_0x390eeb[_0xe125('0x23')]);if(_0x390eeb[_0xe125('0x24')]){delete _0x390eeb[_0xe125('0x24')];}_0x2b1ef7['status'](_0x516630)[_0xe125('0x25')](_0x390eeb);};}exports['index']=function(_0x2dd8c1,_0x566088){var _0x56d81c={},_0x210f75={},_0x45100c={'count':0x0,'rows':[]};var _0x4a8168=_['map'](db[_0xe125('0x26')]['rawAttributes'],function(_0xa4cc23){return{'name':_0xa4cc23['fieldName'],'type':_0xa4cc23['type'][_0xe125('0x27')]};});_0x210f75[_0xe125('0x28')]=_[_0xe125('0x29')](_0x4a8168,_0xe125('0x24'));_0x210f75[_0xe125('0x2a')]=_['keys'](_0x2dd8c1[_0xe125('0x2a')]);_0x210f75[_0xe125('0x2b')]=_[_0xe125('0x2c')](_0x210f75['model'],_0x210f75[_0xe125('0x2a')]);_0x56d81c[_0xe125('0x2d')]=_[_0xe125('0x2c')](_0x210f75[_0xe125('0x28')],qs[_0xe125('0x2e')](_0x2dd8c1[_0xe125('0x2a')][_0xe125('0x2e')]));_0x56d81c[_0xe125('0x2d')]=_0x56d81c[_0xe125('0x2d')][_0xe125('0x2f')]?_0x56d81c['attributes']:_0x210f75[_0xe125('0x28')];if(!_0x2dd8c1['query'][_0xe125('0x30')]('nolimit')){_0x56d81c['limit']=qs['limit'](_0x2dd8c1[_0xe125('0x2a')][_0xe125('0x1b')]);_0x56d81c[_0xe125('0x1a')]=qs[_0xe125('0x1a')](_0x2dd8c1['query']['offset']);}_0x56d81c['order']=qs[_0xe125('0x31')](_0x2dd8c1[_0xe125('0x2a')][_0xe125('0x31')]);_0x56d81c[_0xe125('0x32')]=qs['filters'](_[_0xe125('0x33')](_0x2dd8c1[_0xe125('0x2a')],_0x210f75[_0xe125('0x2b')]),_0x4a8168);if(_0x2dd8c1[_0xe125('0x2a')]['filter']){_0x56d81c[_0xe125('0x32')]=_['merge'](_0x56d81c[_0xe125('0x32')],{'$or':_[_0xe125('0x29')](_0x4a8168,function(_0x272f08){if(_0x272f08['type']!=='VIRTUAL'){var _0x14ba9f={};_0x14ba9f[_0x272f08[_0xe125('0x24')]]={'$like':'%'+_0x2dd8c1[_0xe125('0x2a')][_0xe125('0x34')]+'%'};return _0x14ba9f;}})});}_0x56d81c=_[_0xe125('0x35')]({},_0x56d81c,_0x2dd8c1['options']);var _0x5ee8e0={'where':_0x56d81c[_0xe125('0x32')]};return db[_0xe125('0x26')][_0xe125('0x19')](_0x5ee8e0)[_0xe125('0x21')](function(_0x2e275d){_0x45100c[_0xe125('0x19')]=_0x2e275d;if(_0x2dd8c1['query'][_0xe125('0x36')]){_0x56d81c[_0xe125('0x37')]=[{'all':!![]}];}return db[_0xe125('0x26')][_0xe125('0x38')](_0x56d81c);})[_0xe125('0x21')](function(_0x37103c){_0x45100c['rows']=_0x37103c;return _0x45100c;})[_0xe125('0x21')](respondWithFilteredResult(_0x566088,_0x56d81c))[_0xe125('0x39')](handleError(_0x566088,null));};exports[_0xe125('0x3a')]=function(_0x333538,_0x4418dc){var _0x1dcd90={'raw':!![],'where':{'id':_0x333538['params']['id']}},_0x527bd8={};_0x527bd8[_0xe125('0x28')]=_['keys'](db[_0xe125('0x26')]['rawAttributes']);_0x527bd8[_0xe125('0x2a')]=_[_0xe125('0x3b')](_0x333538[_0xe125('0x2a')]);_0x527bd8[_0xe125('0x2b')]=_[_0xe125('0x2c')](_0x527bd8[_0xe125('0x28')],_0x527bd8[_0xe125('0x2a')]);_0x1dcd90[_0xe125('0x2d')]=_[_0xe125('0x2c')](_0x527bd8[_0xe125('0x28')],qs[_0xe125('0x2e')](_0x333538[_0xe125('0x2a')]['fields']));_0x1dcd90[_0xe125('0x2d')]=_0x1dcd90['attributes'][_0xe125('0x2f')]?_0x1dcd90[_0xe125('0x2d')]:_0x527bd8[_0xe125('0x28')];if(_0x333538[_0xe125('0x2a')][_0xe125('0x36')]){_0x1dcd90[_0xe125('0x37')]=[{'all':!![]}];}_0x1dcd90=_[_0xe125('0x35')]({},_0x1dcd90,_0x333538[_0xe125('0x3c')]);return db[_0xe125('0x26')][_0xe125('0x3d')](_0x1dcd90)[_0xe125('0x21')](handleEntityNotFound(_0x4418dc,null))[_0xe125('0x21')](respondWithResult(_0x4418dc,null))[_0xe125('0x39')](handleError(_0x4418dc,null));};exports[_0xe125('0x3e')]=function(_0x7e66de,_0x531678){return db[_0xe125('0x26')]['create'](_0x7e66de[_0xe125('0x3f')],{})[_0xe125('0x21')](respondWithResult(_0x531678,0xc9))['catch'](handleError(_0x531678,null));};exports[_0xe125('0x40')]=function(_0x5132cf,_0x577188){if(_0x5132cf[_0xe125('0x3f')]['id']){delete _0x5132cf[_0xe125('0x3f')]['id'];}return db[_0xe125('0x26')][_0xe125('0x3d')]({'where':{'id':_0x5132cf[_0xe125('0x41')]['id']}})[_0xe125('0x21')](handleEntityNotFound(_0x577188,null))[_0xe125('0x21')](saveUpdates(_0x5132cf['body'],null))[_0xe125('0x21')](respondWithResult(_0x577188,null))['catch'](handleError(_0x577188,null));};exports[_0xe125('0x20')]=function(_0x8507c5,_0x31c52d){return db['SquareMessage'][_0xe125('0x3d')]({'where':{'id':_0x8507c5[_0xe125('0x41')]['id']}})[_0xe125('0x21')](handleEntityNotFound(_0x31c52d,null))[_0xe125('0x21')](removeEntity(_0x31c52d,null))['catch'](handleError(_0x31c52d,null));}; \ No newline at end of file +var _0x4b00=['desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','apply','reject','update','then','destroy','error','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','options','includeAll','include','SquareMessage','findAll','rows','catch','show','params','keys','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x5cd251,_0x300c67){var _0x26c9cd=function(_0x2fc33c){while(--_0x2fc33c){_0x5cd251['push'](_0x5cd251['shift']());}};_0x26c9cd(++_0x300c67);}(_0x4b00,0x14f));var _0x04b0=function(_0x2ae2bc,_0x177514){_0x2ae2bc=_0x2ae2bc-0x0;var _0x53c290=_0x4b00[_0x2ae2bc];return _0x53c290;};'use strict';var pdf=require(_0x04b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x04b0('0x1'));var zipdir=require(_0x04b0('0x2'));var jsonpatch=require(_0x04b0('0x3'));var rp=require(_0x04b0('0x4'));var moment=require('moment');var BPromise=require(_0x04b0('0x5'));var Mustache=require(_0x04b0('0x6'));var util=require(_0x04b0('0x7'));var path=require(_0x04b0('0x8'));var sox=require(_0x04b0('0x9'));var csv=require('to-csv');var ejs=require(_0x04b0('0xa'));var fs=require('fs');var _=require(_0x04b0('0xb'));var squel=require(_0x04b0('0xc'));var crypto=require(_0x04b0('0xd'));var jsforce=require(_0x04b0('0xe'));var deskjs=require(_0x04b0('0xf'));var toCsv=require(_0x04b0('0x10'));var querystring=require(_0x04b0('0x11'));var Papa=require(_0x04b0('0x12'));var Redis=require(_0x04b0('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04b0('0x14'));var logger=require(_0x04b0('0x15'))('api');var utils=require(_0x04b0('0x16'));var config=require(_0x04b0('0x17'));var db=require(_0x04b0('0x18'))['db'];function respondWithStatusCode(_0x5cb1a5,_0x30ec61){_0x30ec61=_0x30ec61||0xcc;return function(_0x3b7456){if(_0x3b7456){return _0x5cb1a5[_0x04b0('0x19')](_0x30ec61);}return _0x5cb1a5['status'](_0x30ec61)[_0x04b0('0x1a')]();};}function respondWithResult(_0x13cce3,_0x54ab27){_0x54ab27=_0x54ab27||0xc8;return function(_0x26af21){if(_0x26af21){return _0x13cce3[_0x04b0('0x1b')](_0x54ab27)[_0x04b0('0x1c')](_0x26af21);}};}function respondWithFilteredResult(_0x27c2f2,_0x4366f8){return function(_0x4272ad){if(_0x4272ad){var _0x30cfa9=_0x4272ad[_0x04b0('0x1d')],_0x807617=_0x4366f8[_0x04b0('0x1e')],_0x4a55fe=_0x4366f8[_0x04b0('0x1e')]+_0x4366f8['limit'],_0x42bff9;if(_0x4a55fe>=_0x30cfa9){_0x4a55fe=_0x30cfa9;_0x42bff9=0xc8;}else{_0x42bff9=0xce;}_0x27c2f2[_0x04b0('0x1b')](_0x42bff9);return _0x27c2f2['set']('Content-Range',_0x807617+'-'+_0x4a55fe+'/'+_0x30cfa9)['json'](_0x4272ad);}return null;};}function patchUpdates(_0x49e05e){return function(_0x643a16){try{jsonpatch[_0x04b0('0x1f')](_0x643a16,_0x49e05e,!![]);}catch(_0x9ef747){return BPromise[_0x04b0('0x20')](_0x9ef747);}return _0x643a16['save']();};}function saveUpdates(_0x5c67bf,_0x4fc03f){return function(_0x34fc9){if(_0x34fc9){return _0x34fc9[_0x04b0('0x21')](_0x5c67bf)[_0x04b0('0x22')](function(_0x577393){return _0x577393;});}return null;};}function removeEntity(_0x5be4ff,_0x152959){return function(_0x4873ed){if(_0x4873ed){return _0x4873ed[_0x04b0('0x23')]()[_0x04b0('0x22')](function(){_0x5be4ff[_0x04b0('0x1b')](0xcc)[_0x04b0('0x1a')]();});}};}function handleEntityNotFound(_0x2127ac,_0x4931eb){return function(_0x1bc37c){if(!_0x1bc37c){_0x2127ac[_0x04b0('0x19')](0x194);}return _0x1bc37c;};}function handleError(_0x366f6e,_0x5ebd12){_0x5ebd12=_0x5ebd12||0x1f4;return function(_0xce6898){logger[_0x04b0('0x24')](_0xce6898[_0x04b0('0x25')]);if(_0xce6898[_0x04b0('0x26')]){delete _0xce6898[_0x04b0('0x26')];}_0x366f6e[_0x04b0('0x1b')](_0x5ebd12)[_0x04b0('0x27')](_0xce6898);};}exports['index']=function(_0x15e6ce,_0x565fc5){var _0x3063bc={},_0x2dc3fe={},_0x299704={'count':0x0,'rows':[]};var _0xfe1287=_['map'](db['SquareMessage']['rawAttributes'],function(_0x20a944){return{'name':_0x20a944[_0x04b0('0x28')],'type':_0x20a944[_0x04b0('0x29')][_0x04b0('0x2a')]};});_0x2dc3fe[_0x04b0('0x2b')]=_[_0x04b0('0x2c')](_0xfe1287,_0x04b0('0x26'));_0x2dc3fe[_0x04b0('0x2d')]=_['keys'](_0x15e6ce[_0x04b0('0x2d')]);_0x2dc3fe[_0x04b0('0x2e')]=_[_0x04b0('0x2f')](_0x2dc3fe[_0x04b0('0x2b')],_0x2dc3fe['query']);_0x3063bc['attributes']=_['intersection'](_0x2dc3fe[_0x04b0('0x2b')],qs[_0x04b0('0x30')](_0x15e6ce['query'][_0x04b0('0x30')]));_0x3063bc[_0x04b0('0x31')]=_0x3063bc[_0x04b0('0x31')][_0x04b0('0x32')]?_0x3063bc[_0x04b0('0x31')]:_0x2dc3fe[_0x04b0('0x2b')];if(!_0x15e6ce['query'][_0x04b0('0x33')](_0x04b0('0x34'))){_0x3063bc[_0x04b0('0x35')]=qs[_0x04b0('0x35')](_0x15e6ce['query']['limit']);_0x3063bc['offset']=qs['offset'](_0x15e6ce[_0x04b0('0x2d')][_0x04b0('0x1e')]);}_0x3063bc['order']=qs[_0x04b0('0x36')](_0x15e6ce['query']['sort']);_0x3063bc[_0x04b0('0x37')]=qs[_0x04b0('0x2e')](_['pick'](_0x15e6ce[_0x04b0('0x2d')],_0x2dc3fe[_0x04b0('0x2e')]),_0xfe1287);if(_0x15e6ce[_0x04b0('0x2d')]['filter']){_0x3063bc[_0x04b0('0x37')]=_[_0x04b0('0x38')](_0x3063bc[_0x04b0('0x37')],{'$or':_[_0x04b0('0x2c')](_0xfe1287,function(_0x1cba2b){if(_0x1cba2b[_0x04b0('0x29')]!=='VIRTUAL'){var _0x59a2c4={};_0x59a2c4[_0x1cba2b[_0x04b0('0x26')]]={'$like':'%'+_0x15e6ce[_0x04b0('0x2d')]['filter']+'%'};return _0x59a2c4;}})});}_0x3063bc=_[_0x04b0('0x38')]({},_0x3063bc,_0x15e6ce[_0x04b0('0x39')]);var _0x6f955={'where':_0x3063bc[_0x04b0('0x37')]};return db['SquareMessage'][_0x04b0('0x1d')](_0x6f955)[_0x04b0('0x22')](function(_0x5ab54c){_0x299704[_0x04b0('0x1d')]=_0x5ab54c;if(_0x15e6ce[_0x04b0('0x2d')][_0x04b0('0x3a')]){_0x3063bc[_0x04b0('0x3b')]=[{'all':!![]}];}return db[_0x04b0('0x3c')][_0x04b0('0x3d')](_0x3063bc);})[_0x04b0('0x22')](function(_0x4257f2){_0x299704[_0x04b0('0x3e')]=_0x4257f2;return _0x299704;})[_0x04b0('0x22')](respondWithFilteredResult(_0x565fc5,_0x3063bc))[_0x04b0('0x3f')](handleError(_0x565fc5,null));};exports[_0x04b0('0x40')]=function(_0x1427d1,_0x51dc11){var _0x4e6acd={'raw':!![],'where':{'id':_0x1427d1[_0x04b0('0x41')]['id']}},_0xa2d181={};_0xa2d181['model']=_['keys'](db['SquareMessage']['rawAttributes']);_0xa2d181[_0x04b0('0x2d')]=_[_0x04b0('0x42')](_0x1427d1[_0x04b0('0x2d')]);_0xa2d181[_0x04b0('0x2e')]=_[_0x04b0('0x2f')](_0xa2d181[_0x04b0('0x2b')],_0xa2d181[_0x04b0('0x2d')]);_0x4e6acd[_0x04b0('0x31')]=_[_0x04b0('0x2f')](_0xa2d181['model'],qs[_0x04b0('0x30')](_0x1427d1['query'][_0x04b0('0x30')]));_0x4e6acd['attributes']=_0x4e6acd[_0x04b0('0x31')][_0x04b0('0x32')]?_0x4e6acd['attributes']:_0xa2d181[_0x04b0('0x2b')];if(_0x1427d1[_0x04b0('0x2d')]['includeAll']){_0x4e6acd[_0x04b0('0x3b')]=[{'all':!![]}];}_0x4e6acd=_[_0x04b0('0x38')]({},_0x4e6acd,_0x1427d1[_0x04b0('0x39')]);return db[_0x04b0('0x3c')]['find'](_0x4e6acd)['then'](handleEntityNotFound(_0x51dc11,null))['then'](respondWithResult(_0x51dc11,null))['catch'](handleError(_0x51dc11,null));};exports[_0x04b0('0x43')]=function(_0x3fe9cf,_0x3cfb09){return db[_0x04b0('0x3c')][_0x04b0('0x43')](_0x3fe9cf[_0x04b0('0x44')],{})[_0x04b0('0x22')](respondWithResult(_0x3cfb09,0xc9))[_0x04b0('0x3f')](handleError(_0x3cfb09,null));};exports[_0x04b0('0x21')]=function(_0xbf2122,_0x5093c7){if(_0xbf2122[_0x04b0('0x44')]['id']){delete _0xbf2122[_0x04b0('0x44')]['id'];}return db[_0x04b0('0x3c')]['find']({'where':{'id':_0xbf2122[_0x04b0('0x41')]['id']}})[_0x04b0('0x22')](handleEntityNotFound(_0x5093c7,null))[_0x04b0('0x22')](saveUpdates(_0xbf2122['body'],null))[_0x04b0('0x22')](respondWithResult(_0x5093c7,null))[_0x04b0('0x3f')](handleError(_0x5093c7,null));};exports[_0x04b0('0x23')]=function(_0x5450aa,_0x42ad93){return db['SquareMessage'][_0x04b0('0x45')]({'where':{'id':_0x5450aa[_0x04b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x42ad93,null))[_0x04b0('0x22')](removeEntity(_0x42ad93,null))[_0x04b0('0x3f')](handleError(_0x42ad93,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c3772a8..6b8bd55 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 _0x31f0=['./squareMessage.attributes','define','square_messages','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x168e4c,_0x634aaf){var _0x4c9813=function(_0x101941){while(--_0x101941){_0x168e4c['push'](_0x168e4c['shift']());}};_0x4c9813(++_0x634aaf);}(_0x31f0,0xb7));var _0x031f=function(_0x55ac80,_0x2d36e9){_0x55ac80=_0x55ac80-0x0;var _0x36bef2=_0x31f0[_0x55ac80];return _0x36bef2;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('SquareMessage',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['lodash','moment','bluebird','path','rimraf','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x113bc1,_0x200ad4){var _0x39abbe=function(_0x5053d6){while(--_0x5053d6){_0x113bc1['push'](_0x113bc1['shift']());}};_0x39abbe(++_0x200ad4);}(_0x2675,0x75));var _0x5267=function(_0x1da8e9,_0x8fc6bb){_0x1da8e9=_0x1da8e9-0x0;var _0x46eab5=_0x2675[_0x1da8e9];return _0x46eab5;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),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 ba1b625..5058f22 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 _0x0ec6=['body','options','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x55a49f,_0x3c2cef){var _0x52eeda=function(_0x482dff){while(--_0x482dff){_0x55a49f['push'](_0x55a49f['shift']());}};_0x52eeda(++_0x3c2cef);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x554aa4,_0x3e2572){_0x554aa4=_0x554aa4-0x0;var _0x50e6ae=_0x0ec6[_0x554aa4];return _0x50e6ae;};'use strict';var _=require(_0x60ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60ec('0x1'));var rs=require(_0x60ec('0x2'));var fs=require('fs');var Redis=require(_0x60ec('0x3'));var db=require(_0x60ec('0x4'))['db'];var utils=require(_0x60ec('0x5'));var logger=require(_0x60ec('0x6'))(_0x60ec('0x7'));var config=require('../../config/environment');var jayson=require(_0x60ec('0x8'));var client=jayson[_0x60ec('0x9')][_0x60ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x74adc4,_0x5d4cba,_0xcb974c){return new BPromise(function(_0x488ab8,_0x2c4a14){return client[_0x60ec('0xb')](_0x74adc4,_0xcb974c)[_0x60ec('0xc')](function(_0x1363c2){logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,'request\x20sent');logger['debug'](_0x60ec('0xf'),_0x5d4cba,_0x60ec('0x10'),JSON[_0x60ec('0x11')](_0x1363c2));if(_0x1363c2[_0x60ec('0x12')]){if(_0x1363c2[_0x60ec('0x12')]['code']===0x1f4){logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x2c4a14(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x488ab8(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}else{logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,_0x60ec('0x10'));_0x488ab8(_0x1363c2[_0x60ec('0x14')]['message']);}})[_0x60ec('0x15')](function(_0x2778dd){logger[_0x60ec('0x12')](_0x60ec('0xe'),_0x5d4cba,_0x2778dd);_0x2c4a14(_0x2778dd);});});}exports[_0x60ec('0x16')]=function(_0x222c38){var _0x27d863=this;return new Promise(function(_0x13052c,_0xbca8e2){return db[_0x60ec('0x17')][_0x60ec('0x18')](_0x222c38[_0x60ec('0x19')],{'raw':_0x222c38['options']?_0x222c38[_0x60ec('0x1a')][_0x60ec('0x1b')]===undefined?!![]:![]:!![]})[_0x60ec('0xc')](function(_0x278ae3){logger['info'](_0x60ec('0x16'),_0x222c38);logger[_0x60ec('0x1c')](_0x60ec('0x16'),_0x222c38,JSON[_0x60ec('0x11')](_0x278ae3));_0x13052c(_0x278ae3);})[_0x60ec('0x15')](function(_0x354f08){logger['error']('CreateSquareMessage',_0x354f08['message'],_0x222c38);_0xbca8e2(_0x27d863[_0x60ec('0x12')](0x1f4,_0x354f08[_0x60ec('0x13')]));});});}; \ No newline at end of file +var _0x1115=['CreateSquareMessage','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','result','SquareMessage','create','body','options','raw'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1115,0x1b6));var _0x5111=function(_0x59cd10,_0x5c644b){_0x59cd10=_0x59cd10-0x0;var _0x5f10fe=_0x1115[_0x59cd10];return _0x5f10fe;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var moment=require(_0x5111('0x1'));var BPromise=require(_0x5111('0x2'));var rs=require(_0x5111('0x3'));var fs=require('fs');var Redis=require(_0x5111('0x4'));var db=require(_0x5111('0x5'))['db'];var utils=require(_0x5111('0x6'));var logger=require(_0x5111('0x7'))(_0x5111('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5111('0x9')][_0x5111('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50f0a3,_0x400661,_0x2d2777){return new BPromise(function(_0x54d5ae,_0x42a3c5){return client['request'](_0x50f0a3,_0x2d2777)[_0x5111('0xb')](function(_0x3bbc8c){logger['info']('SquareMessage,\x20%s,\x20%s',_0x400661,_0x5111('0xc'));logger['debug'](_0x5111('0xd'),_0x400661,'request\x20sent',JSON[_0x5111('0xe')](_0x3bbc8c));if(_0x3bbc8c[_0x5111('0xf')]){if(_0x3bbc8c[_0x5111('0xf')][_0x5111('0x10')]===0x1f4){logger[_0x5111('0xf')](_0x5111('0x11'),_0x400661,_0x3bbc8c[_0x5111('0xf')][_0x5111('0x12')]);return _0x42a3c5(_0x3bbc8c[_0x5111('0xf')][_0x5111('0x12')]);}logger[_0x5111('0xf')](_0x5111('0x11'),_0x400661,_0x3bbc8c[_0x5111('0xf')][_0x5111('0x12')]);return _0x54d5ae(_0x3bbc8c[_0x5111('0xf')][_0x5111('0x12')]);}else{logger[_0x5111('0x13')](_0x5111('0x11'),_0x400661,'request\x20sent');_0x54d5ae(_0x3bbc8c[_0x5111('0x14')]['message']);}})['catch'](function(_0x387e1e){logger[_0x5111('0xf')](_0x5111('0x11'),_0x400661,_0x387e1e);_0x42a3c5(_0x387e1e);});});}exports['CreateSquareMessage']=function(_0x367f8d){var _0xa3f4ba=this;return new Promise(function(_0x52c614,_0x204c4f){return db[_0x5111('0x15')][_0x5111('0x16')](_0x367f8d[_0x5111('0x17')],{'raw':_0x367f8d['options']?_0x367f8d[_0x5111('0x18')][_0x5111('0x19')]===undefined?!![]:![]:!![]})[_0x5111('0xb')](function(_0x1b3136){logger[_0x5111('0x13')](_0x5111('0x1a'),_0x367f8d);logger[_0x5111('0x1b')](_0x5111('0x1a'),_0x367f8d,JSON[_0x5111('0xe')](_0x1b3136));_0x52c614(_0x1b3136);})[_0x5111('0x1c')](function(_0x4b73ce){logger[_0x5111('0xf')](_0x5111('0x1a'),_0x4b73ce[_0x5111('0x12')],_0x367f8d);_0x204c4f(_0xa3f4ba['error'](0x1f4,_0x4b73ce[_0x5111('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 459cfe1..85f93df 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 _0x4958=['isAuthenticated','15s','test','post','create','put','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','/:id/test'];(function(_0x1222a7,_0x41cb32){var _0x47f53e=function(_0x1dfb2c){while(--_0x1dfb2c){_0x1222a7['push'](_0x1222a7['shift']());}};_0x47f53e(++_0x41cb32);}(_0x4958,0x192));var _0x8495=function(_0x12c8ff,_0x15857a){_0x12c8ff=_0x12c8ff-0x0;var _0x46281f=_0x4958[_0x12c8ff];return _0x46281f;};'use strict';var multer=require('multer');var util=require(_0x8495('0x0'));var path=require(_0x8495('0x1'));var timeout=require(_0x8495('0x2'));var express=require(_0x8495('0x3'));var router=express[_0x8495('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8495('0x5'));var config=require(_0x8495('0x6'));var controller=require(_0x8495('0x7'));router[_0x8495('0x8')]('/',auth['isAuthenticated'](),controller[_0x8495('0x9')]);router[_0x8495('0x8')](_0x8495('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8495('0x8')](_0x8495('0xb'),auth[_0x8495('0xc')](),timeout(_0x8495('0xd')),controller[_0x8495('0xe')]);router[_0x8495('0xf')]('/',auth[_0x8495('0xc')](),controller[_0x8495('0x10')]);router[_0x8495('0x11')]('/:id',auth[_0x8495('0xc')](),controller['update']);router['delete'](_0x8495('0xa'),auth[_0x8495('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd720=['Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x4e0edd,_0x536c32){var _0x4cabad=function(_0x47e5ae){while(--_0x47e5ae){_0x4e0edd['push'](_0x4e0edd['shift']());}};_0x4cabad(++_0x536c32);}(_0xd720,0x8f));var _0x0d72=function(_0x40eb86,_0x35fd71){_0x40eb86=_0x40eb86-0x0;var _0x187e1c=_0xd720[_0x40eb86];return _0x187e1c;};'use strict';var multer=require('multer');var util=require(_0x0d72('0x0'));var path=require(_0x0d72('0x1'));var timeout=require(_0x0d72('0x2'));var express=require(_0x0d72('0x3'));var router=express[_0x0d72('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0d72('0x5'));var config=require(_0x0d72('0x6'));var controller=require(_0x0d72('0x7'));router[_0x0d72('0x8')]('/',auth[_0x0d72('0x9')](),controller[_0x0d72('0xa')]);router['get'](_0x0d72('0xb'),auth[_0x0d72('0x9')](),controller[_0x0d72('0xc')]);router[_0x0d72('0x8')](_0x0d72('0xd'),auth[_0x0d72('0x9')](),timeout(_0x0d72('0xe')),controller[_0x0d72('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0d72('0x10')]);router[_0x0d72('0x11')](_0x0d72('0xb'),auth[_0x0d72('0x9')](),controller[_0x0d72('0x12')]);router['delete'](_0x0d72('0xb'),auth['isAuthenticated'](),controller[_0x0d72('0x13')]);module[_0x0d72('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index d230362..4c42f69 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 _0x9608=['exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9608,0x132));var _0x8960=function(_0x4bb58d,_0x411f50){_0x4bb58d=_0x4bb58d-0x0;var _0x444bfb=_0x9608[_0x4bb58d];return _0x444bfb;};'use strict';var Sequelize=require('sequelize');module[_0x8960('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8960('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8960('0x2')]}}; \ No newline at end of file +var _0x5fef=['name','sequelize','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5fef,0xa9));var _0xf5fe=function(_0x4cdac6,_0x71ab3d){_0x4cdac6=_0x4cdac6-0x0;var _0x37de73=_0x5fef[_0x4cdac6];return _0x37de73;};'use strict';var Sequelize=require(_0xf5fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xf5fe('0x1')],'unique':_0xf5fe('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf5fe('0x1')]},'description':{'type':Sequelize[_0xf5fe('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 89fccfe..31148da 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 _0xc494=['test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x478b43,_0x384010){var _0x5afda8=function(_0x2eeee1){while(--_0x2eeee1){_0x478b43['push'](_0x478b43['shift']());}};_0x5afda8(++_0x384010);}(_0xc494,0x1b8));var _0x4c49=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc494[_0x33032e];return _0x13316b;};'use strict';var pdf=require(_0x4c49('0x0'));var emlformat=require(_0x4c49('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4c49('0x4'));var util=require(_0x4c49('0x5'));var path=require(_0x4c49('0x6'));var sox=require(_0x4c49('0x7'));var csv=require('to-csv');var ejs=require(_0x4c49('0x8'));var fs=require('fs');var _=require(_0x4c49('0x9'));var squel=require(_0x4c49('0xa'));var crypto=require('crypto');var jsforce=require(_0x4c49('0xb'));var deskjs=require(_0x4c49('0xc'));var toCsv=require(_0x4c49('0xd'));var querystring=require('querystring');var Papa=require(_0x4c49('0xe'));var Redis=require(_0x4c49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4c49('0x10'));var as=require(_0x4c49('0x11'));var hardwareService=require(_0x4c49('0x12'));var logger=require(_0x4c49('0x13'))(_0x4c49('0x14'));var utils=require(_0x4c49('0x15'));var config=require('../../config/environment');var db=require(_0x4c49('0x16'))['db'];function respondWithStatusCode(_0x1da1d8,_0x2ac255){_0x2ac255=_0x2ac255||0xcc;return function(_0x30aba0){if(_0x30aba0){return _0x1da1d8[_0x4c49('0x17')](_0x2ac255);}return _0x1da1d8[_0x4c49('0x18')](_0x2ac255)[_0x4c49('0x19')]();};}function respondWithResult(_0xec50f7,_0x5f1a8f){_0x5f1a8f=_0x5f1a8f||0xc8;return function(_0x24e6ac){if(_0x24e6ac){return _0xec50f7[_0x4c49('0x18')](_0x5f1a8f)[_0x4c49('0x1a')](_0x24e6ac);}};}function respondWithFilteredResult(_0x2a3e12,_0x233cfa){return function(_0x278826){if(_0x278826){var _0x18f87c=_0x278826[_0x4c49('0x1b')],_0x450423=_0x233cfa[_0x4c49('0x1c')],_0x24d4a0=_0x233cfa[_0x4c49('0x1c')]+_0x233cfa[_0x4c49('0x1d')],_0x5949f6;if(_0x24d4a0>=_0x18f87c){_0x24d4a0=_0x18f87c;_0x5949f6=0xc8;}else{_0x5949f6=0xce;}_0x2a3e12[_0x4c49('0x18')](_0x5949f6);return _0x2a3e12[_0x4c49('0x1e')](_0x4c49('0x1f'),_0x450423+'-'+_0x24d4a0+'/'+_0x18f87c)[_0x4c49('0x1a')](_0x278826);}return null;};}function patchUpdates(_0x171488){return function(_0x4f4536){try{jsonpatch[_0x4c49('0x20')](_0x4f4536,_0x171488,!![]);}catch(_0x55b471){return BPromise[_0x4c49('0x21')](_0x55b471);}return _0x4f4536[_0x4c49('0x22')]();};}function saveUpdates(_0x23df02,_0x2cd50c){return function(_0x53814d){if(_0x53814d){return _0x53814d['update'](_0x23df02)[_0x4c49('0x23')](function(_0x25f6fc){return _0x25f6fc;});}return null;};}function removeEntity(_0x5083d0,_0x13e967){return function(_0x1684ce){if(_0x1684ce){return _0x1684ce[_0x4c49('0x24')]()[_0x4c49('0x23')](function(){var _0x3f5014=_0x1684ce[_0x4c49('0x25')]({'plain':!![]});var _0xd14722=_0x4c49('0x26');return db[_0x4c49('0x27')][_0x4c49('0x24')]({'where':{'type':_0xd14722,'resourceId':_0x3f5014['id']}})['then'](function(){return _0x1684ce;});})[_0x4c49('0x23')](function(){_0x5083d0[_0x4c49('0x18')](0xcc)[_0x4c49('0x19')]();});}};}function handleEntityNotFound(_0x3c8ba1,_0x248d92){return function(_0x108645){if(!_0x108645){_0x3c8ba1['sendStatus'](0x194);}return _0x108645;};}function handleError(_0x5a83fc,_0xbc61e0){_0xbc61e0=_0xbc61e0||0x1f4;return function(_0x554d23){logger['error'](_0x554d23['stack']);if(_0x554d23['name']){delete _0x554d23[_0x4c49('0x28')];}_0x5a83fc['status'](_0xbc61e0)[_0x4c49('0x29')](_0x554d23);};}exports[_0x4c49('0x2a')]=function(_0x4ee033,_0x14331b){var _0x53d1c9={},_0x1cdf7f={},_0x31679d={'count':0x0,'rows':[]};var _0x20c7f8=_[_0x4c49('0x2b')](db[_0x4c49('0x2c')][_0x4c49('0x2d')],function(_0x1b811f){return{'name':_0x1b811f[_0x4c49('0x2e')],'type':_0x1b811f['type'][_0x4c49('0x2f')]};});_0x1cdf7f['model']=_[_0x4c49('0x2b')](_0x20c7f8,_0x4c49('0x28'));_0x1cdf7f[_0x4c49('0x30')]=_[_0x4c49('0x31')](_0x4ee033[_0x4c49('0x30')]);_0x1cdf7f['filters']=_[_0x4c49('0x32')](_0x1cdf7f['model'],_0x1cdf7f[_0x4c49('0x30')]);_0x53d1c9[_0x4c49('0x33')]=_['intersection'](_0x1cdf7f[_0x4c49('0x34')],qs['fields'](_0x4ee033[_0x4c49('0x30')][_0x4c49('0x35')]));_0x53d1c9[_0x4c49('0x33')]=_0x53d1c9[_0x4c49('0x33')][_0x4c49('0x36')]?_0x53d1c9[_0x4c49('0x33')]:_0x1cdf7f[_0x4c49('0x34')];if(!_0x4ee033[_0x4c49('0x30')][_0x4c49('0x37')](_0x4c49('0x38'))){_0x53d1c9['limit']=qs[_0x4c49('0x1d')](_0x4ee033[_0x4c49('0x30')][_0x4c49('0x1d')]);_0x53d1c9[_0x4c49('0x1c')]=qs['offset'](_0x4ee033[_0x4c49('0x30')][_0x4c49('0x1c')]);}_0x53d1c9['order']=qs[_0x4c49('0x39')](_0x4ee033[_0x4c49('0x30')]['sort']);_0x53d1c9['where']=qs['filters'](_[_0x4c49('0x3a')](_0x4ee033['query'],_0x1cdf7f[_0x4c49('0x3b')]),_0x20c7f8);if(_0x4ee033[_0x4c49('0x30')][_0x4c49('0x3c')]){_0x53d1c9[_0x4c49('0x3d')]=_['merge'](_0x53d1c9[_0x4c49('0x3d')],{'$or':_[_0x4c49('0x2b')](_0x20c7f8,function(_0x3a334f){if(_0x3a334f[_0x4c49('0x3e')]!==_0x4c49('0x3f')){var _0x6ada21={};_0x6ada21[_0x3a334f[_0x4c49('0x28')]]={'$like':'%'+_0x4ee033[_0x4c49('0x30')][_0x4c49('0x3c')]+'%'};return _0x6ada21;}})});}_0x53d1c9=_[_0x4c49('0x40')]({},_0x53d1c9,_0x4ee033[_0x4c49('0x41')]);var _0x8844e4={'where':_0x53d1c9[_0x4c49('0x3d')]};return db[_0x4c49('0x2c')]['count'](_0x8844e4)['then'](function(_0x258f13){_0x31679d[_0x4c49('0x1b')]=_0x258f13;if(_0x4ee033[_0x4c49('0x30')][_0x4c49('0x42')]){_0x53d1c9['include']=[{'all':!![]}];}return db[_0x4c49('0x2c')]['findAll'](_0x53d1c9);})[_0x4c49('0x23')](function(_0x42279e){_0x31679d[_0x4c49('0x43')]=_0x42279e;return _0x31679d;})[_0x4c49('0x23')](respondWithFilteredResult(_0x14331b,_0x53d1c9))[_0x4c49('0x44')](handleError(_0x14331b,null));};exports[_0x4c49('0x45')]=function(_0x83907b,_0x3b720f){var _0x1476fe={'raw':!![],'where':{'id':_0x83907b[_0x4c49('0x46')]['id']}},_0x5519d8={};_0x5519d8[_0x4c49('0x34')]=_[_0x4c49('0x31')](db[_0x4c49('0x2c')][_0x4c49('0x2d')]);_0x5519d8[_0x4c49('0x30')]=_[_0x4c49('0x31')](_0x83907b['query']);_0x5519d8['filters']=_[_0x4c49('0x32')](_0x5519d8[_0x4c49('0x34')],_0x5519d8['query']);_0x1476fe[_0x4c49('0x33')]=_[_0x4c49('0x32')](_0x5519d8[_0x4c49('0x34')],qs[_0x4c49('0x35')](_0x83907b[_0x4c49('0x30')][_0x4c49('0x35')]));_0x1476fe[_0x4c49('0x33')]=_0x1476fe[_0x4c49('0x33')][_0x4c49('0x36')]?_0x1476fe[_0x4c49('0x33')]:_0x5519d8['model'];if(_0x83907b[_0x4c49('0x30')][_0x4c49('0x42')]){_0x1476fe[_0x4c49('0x47')]=[{'all':!![]}];}_0x1476fe=_['merge']({},_0x1476fe,_0x83907b[_0x4c49('0x41')]);return db[_0x4c49('0x2c')]['find'](_0x1476fe)[_0x4c49('0x23')](handleEntityNotFound(_0x3b720f,null))[_0x4c49('0x23')](respondWithResult(_0x3b720f,null))[_0x4c49('0x44')](handleError(_0x3b720f,null));};exports[_0x4c49('0x48')]=function(_0x49dbda,_0x23e552){return db[_0x4c49('0x2c')][_0x4c49('0x48')](_0x49dbda[_0x4c49('0x49')],{})[_0x4c49('0x23')](function(_0x2e3b19){var _0x1659ab=_0x49dbda['user'][_0x4c49('0x25')]({'plain':!![]});if(!_0x1659ab)throw new Error(_0x4c49('0x4a'));if(_0x1659ab[_0x4c49('0x4b')]===_0x4c49('0x4c')){var _0x4869f4=_0x2e3b19[_0x4c49('0x25')]({'plain':!![]});var _0x2deebc=_0x4c49('0x26');return db[_0x4c49('0x4d')][_0x4c49('0x4e')]({'where':{'name':_0x2deebc,'userProfileId':_0x1659ab['userProfileId']},'raw':!![]})[_0x4c49('0x23')](function(_0x281260){if(_0x281260&&_0x281260[_0x4c49('0x4f')]===0x0){return db[_0x4c49('0x27')]['create']({'name':_0x4869f4[_0x4c49('0x28')],'resourceId':_0x4869f4['id'],'type':_0x281260[_0x4c49('0x28')],'sectionId':_0x281260['id']},{})['then'](function(){return _0x2e3b19;});}else{return _0x2e3b19;}})['catch'](function(_0x39d4ee){logger['error'](_0x4c49('0x50'),_0x39d4ee);throw _0x39d4ee;});}return _0x2e3b19;})['then'](respondWithResult(_0x23e552,0xc9))[_0x4c49('0x44')](handleError(_0x23e552,null));};exports[_0x4c49('0x51')]=function(_0x2be41d,_0x18b1dc){if(_0x2be41d[_0x4c49('0x49')]['id']){delete _0x2be41d[_0x4c49('0x49')]['id'];}return db[_0x4c49('0x2c')]['find']({'where':{'id':_0x2be41d['params']['id']}})[_0x4c49('0x23')](handleEntityNotFound(_0x18b1dc,null))[_0x4c49('0x23')](saveUpdates(_0x2be41d['body'],null))[_0x4c49('0x23')](respondWithResult(_0x18b1dc,null))[_0x4c49('0x44')](handleError(_0x18b1dc,null));};exports[_0x4c49('0x24')]=function(_0x1f1a4f,_0x1edaa9){return db[_0x4c49('0x2c')][_0x4c49('0x4e')]({'where':{'id':_0x1f1a4f[_0x4c49('0x46')]['id']}})[_0x4c49('0x23')](handleEntityNotFound(_0x1edaa9,null))[_0x4c49('0x23')](removeEntity(_0x1edaa9,null))[_0x4c49('0x44')](handleError(_0x1edaa9,null));};exports[_0x4c49('0x52')]=function(_0x1853a6,_0x2d33dc,_0x229c9e){var _0x2a758f;return db[_0x4c49('0x2c')][_0x4c49('0x4e')]({'where':{'id':_0x1853a6[_0x4c49('0x46')]['id']},'attributes':['id',_0x4c49('0x53')]})[_0x4c49('0x23')](handleEntityNotFound(_0x2d33dc,null))[_0x4c49('0x23')](function(_0x12de92){if(_0x12de92){var _0x52b83a=require(_0x4c49('0x54'))();_0x52b83a[_0x4c49('0x55')](_0x12de92[_0x4c49('0x53')]);_0x52b83a[_0x4c49('0x56')]();return _0x12de92;}})[_0x4c49('0x23')](respondWithResult(_0x2d33dc,null))[_0x4c49('0x44')](handleError(_0x2d33dc,null));}; \ No newline at end of file +var _0xcbbb=['dsn','odbc','closeSync','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','then','destroy','ODBC','UserProfileResource','stack','name','index','map','SquareOdbc','fieldName','type','key','model','query','keys','intersection','attributes','length','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','update','test'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xcbbb,0x147));var _0xbcbb=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xcbbb[_0x5a2285];return _0x48f6ed;};'use strict';var pdf=require(_0xbcbb('0x0'));var emlformat=require(_0xbcbb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbcbb('0x2'));var jsonpatch=require(_0xbcbb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbcbb('0x4'));var Mustache=require(_0xbcbb('0x5'));var util=require(_0xbcbb('0x6'));var path=require(_0xbcbb('0x7'));var sox=require(_0xbcbb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbcbb('0x9'));var squel=require(_0xbcbb('0xa'));var crypto=require(_0xbcbb('0xb'));var jsforce=require(_0xbcbb('0xc'));var deskjs=require(_0xbcbb('0xd'));var toCsv=require(_0xbcbb('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbcbb('0xf'));var authService=require(_0xbcbb('0x10'));var qs=require(_0xbcbb('0x11'));var as=require(_0xbcbb('0x12'));var hardwareService=require(_0xbcbb('0x13'));var logger=require('../../config/logger')(_0xbcbb('0x14'));var utils=require(_0xbcbb('0x15'));var config=require('../../config/environment');var db=require(_0xbcbb('0x16'))['db'];function respondWithStatusCode(_0x2d1353,_0x46ff1c){_0x46ff1c=_0x46ff1c||0xcc;return function(_0x435941){if(_0x435941){return _0x2d1353[_0xbcbb('0x17')](_0x46ff1c);}return _0x2d1353[_0xbcbb('0x18')](_0x46ff1c)[_0xbcbb('0x19')]();};}function respondWithResult(_0x30d165,_0x3df624){_0x3df624=_0x3df624||0xc8;return function(_0x5d110e){if(_0x5d110e){return _0x30d165[_0xbcbb('0x18')](_0x3df624)[_0xbcbb('0x1a')](_0x5d110e);}};}function respondWithFilteredResult(_0x4efaed,_0x35b16b){return function(_0x1899cc){if(_0x1899cc){var _0x32a795=_0x1899cc[_0xbcbb('0x1b')],_0x4c0d82=_0x35b16b[_0xbcbb('0x1c')],_0x4aa633=_0x35b16b[_0xbcbb('0x1c')]+_0x35b16b['limit'],_0x1ea7bf;if(_0x4aa633>=_0x32a795){_0x4aa633=_0x32a795;_0x1ea7bf=0xc8;}else{_0x1ea7bf=0xce;}_0x4efaed[_0xbcbb('0x18')](_0x1ea7bf);return _0x4efaed['set'](_0xbcbb('0x1d'),_0x4c0d82+'-'+_0x4aa633+'/'+_0x32a795)[_0xbcbb('0x1a')](_0x1899cc);}return null;};}function patchUpdates(_0x450c80){return function(_0x185886){try{jsonpatch[_0xbcbb('0x1e')](_0x185886,_0x450c80,!![]);}catch(_0x3b0a75){return BPromise[_0xbcbb('0x1f')](_0x3b0a75);}return _0x185886['save']();};}function saveUpdates(_0x331986,_0x4a6c52){return function(_0x1edb05){if(_0x1edb05){return _0x1edb05['update'](_0x331986)[_0xbcbb('0x20')](function(_0x178643){return _0x178643;});}return null;};}function removeEntity(_0xb933f9,_0x1c286e){return function(_0xc8e44a){if(_0xc8e44a){return _0xc8e44a[_0xbcbb('0x21')]()[_0xbcbb('0x20')](function(){var _0x260d16=_0xc8e44a['get']({'plain':!![]});var _0x35ec0f=_0xbcbb('0x22');return db[_0xbcbb('0x23')][_0xbcbb('0x21')]({'where':{'type':_0x35ec0f,'resourceId':_0x260d16['id']}})[_0xbcbb('0x20')](function(){return _0xc8e44a;});})[_0xbcbb('0x20')](function(){_0xb933f9[_0xbcbb('0x18')](0xcc)[_0xbcbb('0x19')]();});}};}function handleEntityNotFound(_0x1828c7,_0x476a80){return function(_0x2a2603){if(!_0x2a2603){_0x1828c7['sendStatus'](0x194);}return _0x2a2603;};}function handleError(_0x28a8c6,_0x4d9326){_0x4d9326=_0x4d9326||0x1f4;return function(_0x198cc1){logger['error'](_0x198cc1[_0xbcbb('0x24')]);if(_0x198cc1[_0xbcbb('0x25')]){delete _0x198cc1[_0xbcbb('0x25')];}_0x28a8c6[_0xbcbb('0x18')](_0x4d9326)['send'](_0x198cc1);};}exports[_0xbcbb('0x26')]=function(_0x44dd0d,_0x4efc35){var _0x252bcc={},_0x57b6fa={},_0x5474d8={'count':0x0,'rows':[]};var _0x549f32=_[_0xbcbb('0x27')](db[_0xbcbb('0x28')]['rawAttributes'],function(_0x4f9b0d){return{'name':_0x4f9b0d[_0xbcbb('0x29')],'type':_0x4f9b0d[_0xbcbb('0x2a')][_0xbcbb('0x2b')]};});_0x57b6fa[_0xbcbb('0x2c')]=_['map'](_0x549f32,_0xbcbb('0x25'));_0x57b6fa[_0xbcbb('0x2d')]=_[_0xbcbb('0x2e')](_0x44dd0d[_0xbcbb('0x2d')]);_0x57b6fa['filters']=_[_0xbcbb('0x2f')](_0x57b6fa[_0xbcbb('0x2c')],_0x57b6fa[_0xbcbb('0x2d')]);_0x252bcc[_0xbcbb('0x30')]=_['intersection'](_0x57b6fa[_0xbcbb('0x2c')],qs['fields'](_0x44dd0d[_0xbcbb('0x2d')]['fields']));_0x252bcc['attributes']=_0x252bcc[_0xbcbb('0x30')][_0xbcbb('0x31')]?_0x252bcc[_0xbcbb('0x30')]:_0x57b6fa[_0xbcbb('0x2c')];if(!_0x44dd0d[_0xbcbb('0x2d')]['hasOwnProperty']('nolimit')){_0x252bcc[_0xbcbb('0x32')]=qs[_0xbcbb('0x32')](_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x32')]);_0x252bcc[_0xbcbb('0x1c')]=qs[_0xbcbb('0x1c')](_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x1c')]);}_0x252bcc[_0xbcbb('0x33')]=qs['sort'](_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x34')]);_0x252bcc[_0xbcbb('0x35')]=qs['filters'](_[_0xbcbb('0x36')](_0x44dd0d[_0xbcbb('0x2d')],_0x57b6fa[_0xbcbb('0x37')]),_0x549f32);if(_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x38')]){_0x252bcc['where']=_[_0xbcbb('0x39')](_0x252bcc['where'],{'$or':_[_0xbcbb('0x27')](_0x549f32,function(_0x2397e3){if(_0x2397e3[_0xbcbb('0x2a')]!==_0xbcbb('0x3a')){var _0x4df063={};_0x4df063[_0x2397e3[_0xbcbb('0x25')]]={'$like':'%'+_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x38')]+'%'};return _0x4df063;}})});}_0x252bcc=_[_0xbcbb('0x39')]({},_0x252bcc,_0x44dd0d[_0xbcbb('0x3b')]);var _0x5b125f={'where':_0x252bcc[_0xbcbb('0x35')]};return db[_0xbcbb('0x28')][_0xbcbb('0x1b')](_0x5b125f)['then'](function(_0x5b347a){_0x5474d8[_0xbcbb('0x1b')]=_0x5b347a;if(_0x44dd0d[_0xbcbb('0x2d')][_0xbcbb('0x3c')]){_0x252bcc[_0xbcbb('0x3d')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x252bcc);})[_0xbcbb('0x20')](function(_0xead37d){_0x5474d8['rows']=_0xead37d;return _0x5474d8;})[_0xbcbb('0x20')](respondWithFilteredResult(_0x4efc35,_0x252bcc))[_0xbcbb('0x3e')](handleError(_0x4efc35,null));};exports[_0xbcbb('0x3f')]=function(_0x412189,_0x1e4ec4){var _0x2615b1={'raw':!![],'where':{'id':_0x412189[_0xbcbb('0x40')]['id']}},_0x398ce9={};_0x398ce9['model']=_[_0xbcbb('0x2e')](db[_0xbcbb('0x28')][_0xbcbb('0x41')]);_0x398ce9[_0xbcbb('0x2d')]=_[_0xbcbb('0x2e')](_0x412189[_0xbcbb('0x2d')]);_0x398ce9['filters']=_[_0xbcbb('0x2f')](_0x398ce9[_0xbcbb('0x2c')],_0x398ce9['query']);_0x2615b1['attributes']=_['intersection'](_0x398ce9[_0xbcbb('0x2c')],qs[_0xbcbb('0x42')](_0x412189['query']['fields']));_0x2615b1[_0xbcbb('0x30')]=_0x2615b1[_0xbcbb('0x30')][_0xbcbb('0x31')]?_0x2615b1[_0xbcbb('0x30')]:_0x398ce9[_0xbcbb('0x2c')];if(_0x412189['query'][_0xbcbb('0x3c')]){_0x2615b1[_0xbcbb('0x3d')]=[{'all':!![]}];}_0x2615b1=_['merge']({},_0x2615b1,_0x412189[_0xbcbb('0x3b')]);return db[_0xbcbb('0x28')][_0xbcbb('0x43')](_0x2615b1)[_0xbcbb('0x20')](handleEntityNotFound(_0x1e4ec4,null))[_0xbcbb('0x20')](respondWithResult(_0x1e4ec4,null))[_0xbcbb('0x3e')](handleError(_0x1e4ec4,null));};exports[_0xbcbb('0x44')]=function(_0x275d6b,_0x531766){return db['SquareOdbc'][_0xbcbb('0x44')](_0x275d6b[_0xbcbb('0x45')],{})[_0xbcbb('0x20')](function(_0x3edb8a){var _0x12d35d=_0x275d6b[_0xbcbb('0x46')][_0xbcbb('0x47')]({'plain':!![]});if(!_0x12d35d)throw new Error(_0xbcbb('0x48'));if(_0x12d35d[_0xbcbb('0x49')]===_0xbcbb('0x46')){var _0x5300fa=_0x3edb8a[_0xbcbb('0x47')]({'plain':!![]});var _0x59eeeb='ODBC';return db[_0xbcbb('0x4a')][_0xbcbb('0x43')]({'where':{'name':_0x59eeeb,'userProfileId':_0x12d35d['userProfileId']},'raw':!![]})[_0xbcbb('0x20')](function(_0x32d5a3){if(_0x32d5a3&&_0x32d5a3['autoAssociation']===0x0){return db['UserProfileResource'][_0xbcbb('0x44')]({'name':_0x5300fa[_0xbcbb('0x25')],'resourceId':_0x5300fa['id'],'type':_0x32d5a3[_0xbcbb('0x25')],'sectionId':_0x32d5a3['id']},{})['then'](function(){return _0x3edb8a;});}else{return _0x3edb8a;}})[_0xbcbb('0x3e')](function(_0x1a53f0){logger[_0xbcbb('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a53f0);throw _0x1a53f0;});}return _0x3edb8a;})[_0xbcbb('0x20')](respondWithResult(_0x531766,0xc9))[_0xbcbb('0x3e')](handleError(_0x531766,null));};exports[_0xbcbb('0x4c')]=function(_0x148872,_0x3e804c){if(_0x148872['body']['id']){delete _0x148872[_0xbcbb('0x45')]['id'];}return db[_0xbcbb('0x28')][_0xbcbb('0x43')]({'where':{'id':_0x148872[_0xbcbb('0x40')]['id']}})[_0xbcbb('0x20')](handleEntityNotFound(_0x3e804c,null))[_0xbcbb('0x20')](saveUpdates(_0x148872[_0xbcbb('0x45')],null))[_0xbcbb('0x20')](respondWithResult(_0x3e804c,null))[_0xbcbb('0x3e')](handleError(_0x3e804c,null));};exports[_0xbcbb('0x21')]=function(_0x46f9c5,_0x11c8a9){return db[_0xbcbb('0x28')]['find']({'where':{'id':_0x46f9c5[_0xbcbb('0x40')]['id']}})[_0xbcbb('0x20')](handleEntityNotFound(_0x11c8a9,null))[_0xbcbb('0x20')](removeEntity(_0x11c8a9,null))[_0xbcbb('0x3e')](handleError(_0x11c8a9,null));};exports[_0xbcbb('0x4d')]=function(_0x299356,_0x3912c1,_0x24953b){var _0x28403e;return db[_0xbcbb('0x28')][_0xbcbb('0x43')]({'where':{'id':_0x299356[_0xbcbb('0x40')]['id']},'attributes':['id',_0xbcbb('0x4e')]})[_0xbcbb('0x20')](handleEntityNotFound(_0x3912c1,null))['then'](function(_0x1820af){if(_0x1820af){var _0x6188bd=require(_0xbcbb('0x4f'))();_0x6188bd['openSync'](_0x1820af['dsn']);_0x6188bd[_0xbcbb('0x50')]();return _0x1820af;}})[_0xbcbb('0x20')](respondWithResult(_0x3912c1,null))[_0xbcbb('0x3e')](handleError(_0x3912c1,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index ec7c716..77e6893 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 _0xe48f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc'];(function(_0x1cc12c,_0x23f1dc){var _0x558fe3=function(_0x2f1462){while(--_0x2f1462){_0x1cc12c['push'](_0x1cc12c['shift']());}};_0x558fe3(++_0x23f1dc);}(_0xe48f,0x9c));var _0xfe48=function(_0x2c84e5,_0x58a7c7){_0x2c84e5=_0x2c84e5-0x0;var _0x4990ec=_0xe48f[_0x2c84e5];return _0x4990ec;};'use strict';var _=require(_0xfe48('0x0'));var util=require(_0xfe48('0x1'));var logger=require(_0xfe48('0x2'))(_0xfe48('0x3'));var moment=require('moment');var BPromise=require(_0xfe48('0x4'));var rp=require(_0xfe48('0x5'));var fs=require('fs');var path=require(_0xfe48('0x6'));var rimraf=require(_0xfe48('0x7'));var config=require(_0xfe48('0x8'));var attributes=require(_0xfe48('0x9'));module['exports']=function(_0x4d410c,_0x57e7ae){return _0x4d410c[_0xfe48('0xa')]('SquareOdbc',attributes,{'tableName':_0xfe48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65a4=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65a4,0x166));var _0x465a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x65a4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x465a('0x0'));var util=require(_0x465a('0x1'));var logger=require(_0x465a('0x2'))(_0x465a('0x3'));var moment=require(_0x465a('0x4'));var BPromise=require(_0x465a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x465a('0x6'));var rimraf=require('rimraf');var config=require(_0x465a('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x465a('0x8')]=function(_0x2d8378,_0x16dc5d){return _0x2d8378[_0x465a('0x9')](_0x465a('0xa'),attributes,{'tableName':_0x465a('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 1a15df0..fa63064 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x6d91a,_0x3c06dc){var _0x405faf=function(_0x4b157a){while(--_0x4b157a){_0x6d91a['push'](_0x6d91a['shift']());}};_0x405faf(++_0x3c06dc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x373096,_0x4d37aa){_0x373096=_0x373096-0x0;var _0x14a6d0=_0x5fc3[_0x373096];return _0x14a6d0;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ 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(_0x4b1d4d,_0x386cab){var _0x3d2157=function(_0x171da){while(--_0x171da){_0x4b1d4d['push'](_0x4b1d4d['shift']());}};_0x3d2157(++_0x386cab);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 c834633..afba734 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 _0xeb74=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers','post','create','/:id/users','addUsers','update','delete','destroy','removeUsers','multer','util','path'];(function(_0x138a32,_0x4009ff){var _0x31dcd3=function(_0x2682a6){while(--_0x2682a6){_0x138a32['push'](_0x138a32['shift']());}};_0x31dcd3(++_0x4009ff);}(_0xeb74,0xe3));var _0x4eb7=function(_0x180935,_0x2fb36b){_0x180935=_0x180935-0x0;var _0x4f4fbb=_0xeb74[_0x180935];return _0x4f4fbb;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var auth=require(_0x4eb7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eb7('0x7'));var controller=require(_0x4eb7('0x8'));router[_0x4eb7('0x9')]('/',auth[_0x4eb7('0xa')](),controller[_0x4eb7('0xb')]);router['get'](_0x4eb7('0xc'),auth['isAuthenticated'](),controller[_0x4eb7('0xd')]);router[_0x4eb7('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x4eb7('0xe')]);router[_0x4eb7('0xf')]('/',auth['isAuthenticated'](),controller[_0x4eb7('0x10')]);router['post'](_0x4eb7('0x11'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x12')]);router['put'](_0x4eb7('0xc'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x13')]);router[_0x4eb7('0x14')](_0x4eb7('0xc'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x15')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x4eb7('0x16')]);module['exports']=router; \ No newline at end of file +var _0xeb74=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers','post','create','/:id/users','addUsers','update','delete','destroy','removeUsers','multer','util','path'];(function(_0x2dc53c,_0x4a29ce){var _0x32ea88=function(_0x159135){while(--_0x159135){_0x2dc53c['push'](_0x2dc53c['shift']());}};_0x32ea88(++_0x4a29ce);}(_0xeb74,0xe3));var _0x4eb7=function(_0x17cdc7,_0x233fec){_0x17cdc7=_0x17cdc7-0x0;var _0xbcbbeb=_0xeb74[_0x17cdc7];return _0xbcbbeb;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var auth=require(_0x4eb7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eb7('0x7'));var controller=require(_0x4eb7('0x8'));router[_0x4eb7('0x9')]('/',auth[_0x4eb7('0xa')](),controller[_0x4eb7('0xb')]);router['get'](_0x4eb7('0xc'),auth['isAuthenticated'](),controller[_0x4eb7('0xd')]);router[_0x4eb7('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x4eb7('0xe')]);router[_0x4eb7('0xf')]('/',auth['isAuthenticated'](),controller[_0x4eb7('0x10')]);router['post'](_0x4eb7('0x11'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x12')]);router['put'](_0x4eb7('0xc'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x13')]);router[_0x4eb7('0x14')](_0x4eb7('0xc'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x15')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x4eb7('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4c31172..8f41e5a 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 _0xb310=['BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0x3f9631,_0x51ffcb){var _0x242d84=function(_0xfcd4f7){while(--_0xfcd4f7){_0x3f9631['push'](_0x3f9631['shift']());}};_0x242d84(++_0x51ffcb);}(_0xb310,0x1b2));var _0x0b31=function(_0x421cdf,_0x141e7d){_0x421cdf=_0x421cdf-0x0;var _0x1c8f3=_0xb310[_0x421cdf];return _0x1c8f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x0b31('0x0')](_0x0b31('0x1')),'get':function(){if(this[_0x0b31('0x2')](_0x0b31('0x3'))){return this[_0x0b31('0x2')]('preproduction')[_0x0b31('0x4')](_0x0b31('0x5'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x0b31('0x2')](_0x0b31('0x6'))){return this[_0x0b31('0x2')](_0x0b31('0x6'))[_0x0b31('0x4')]('utf8');}}}}; \ No newline at end of file +var _0x095c=['sequelize','exports','STRING','name','TEXT','BLOB','long','preproduction','toString','getDataValue','production','utf8'];(function(_0x29f0f0,_0x1cc22c){var _0x20a1ce=function(_0x96c4a8){while(--_0x96c4a8){_0x29f0f0['push'](_0x29f0f0['shift']());}};_0x20a1ce(++_0x1cc22c);}(_0x095c,0x1d4));var _0xc095=function(_0x54d75c,_0xdc2bbd){_0x54d75c=_0x54d75c-0x0;var _0x21dbbd=_0x095c[_0x54d75c];return _0x21dbbd;};'use strict';var Sequelize=require(_0xc095('0x0'));module[_0xc095('0x1')]={'name':{'type':Sequelize[_0xc095('0x2')],'unique':_0xc095('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc095('0x2')]},'notes':{'type':Sequelize[_0xc095('0x4')]},'preproduction':{'type':Sequelize[_0xc095('0x5')](_0xc095('0x6')),'get':function(){if(this['getDataValue'](_0xc095('0x7'))){return this['getDataValue'](_0xc095('0x7'))[_0xc095('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xc095('0x5')]('long'),'get':function(){if(this[_0xc095('0x9')](_0xc095('0xa'))){return this[_0xc095('0x9')](_0xc095('0xa'))['toString'](_0xc095('0xb'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a00c773..2c46c7a 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 _0x01e5=['keys','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','options','SquareProject','includeAll','rows','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','order','hasOwnProperty','nolimit','html-pdf','fast-json-patch','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','SquareProjects','UserProfileResource','sendStatus','stack','name','rawAttributes','type','key','map','query'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x01e5,0x1e5));var _0x501e=function(_0x195e78,_0xf0c2ab){_0x195e78=_0x195e78-0x0;var _0x2048e8=_0x01e5[_0x195e78];return _0x2048e8;};'use strict';var pdf=require(_0x501e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x501e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x501e('0x2'));var util=require(_0x501e('0x3'));var path=require('path');var sox=require(_0x501e('0x4'));var csv=require('to-csv');var ejs=require(_0x501e('0x5'));var fs=require('fs');var _=require(_0x501e('0x6'));var squel=require(_0x501e('0x7'));var crypto=require(_0x501e('0x8'));var jsforce=require(_0x501e('0x9'));var deskjs=require(_0x501e('0xa'));var toCsv=require(_0x501e('0xb'));var querystring=require(_0x501e('0xc'));var Papa=require(_0x501e('0xd'));var Redis=require(_0x501e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x501e('0xf'));var as=require(_0x501e('0x10'));var hardwareService=require(_0x501e('0x11'));var logger=require('../../config/logger')(_0x501e('0x12'));var utils=require(_0x501e('0x13'));var config=require('../../config/environment');var db=require(_0x501e('0x14'))['db'];config[_0x501e('0x15')]=_['defaults'](config['redis'],{'host':_0x501e('0x16'),'port':0x18eb});var socket=require(_0x501e('0x17'))(new Redis(config['redis']));require('./squareProject.socket')[_0x501e('0x18')](socket);function respondWithStatusCode(_0xbe8d31,_0x19a334){_0x19a334=_0x19a334||0xcc;return function(_0x43590f){if(_0x43590f){return _0xbe8d31['sendStatus'](_0x19a334);}return _0xbe8d31[_0x501e('0x19')](_0x19a334)[_0x501e('0x1a')]();};}function respondWithResult(_0x40644f,_0x2ded16){_0x2ded16=_0x2ded16||0xc8;return function(_0x7c8fe4){if(_0x7c8fe4){return _0x40644f[_0x501e('0x19')](_0x2ded16)[_0x501e('0x1b')](_0x7c8fe4);}};}function respondWithFilteredResult(_0x6db7f5,_0x2bc81c){return function(_0x4bc774){if(_0x4bc774){var _0x44f7b6=_0x4bc774[_0x501e('0x1c')],_0x50d0ee=_0x2bc81c['offset'],_0x4a9206=_0x2bc81c[_0x501e('0x1d')]+_0x2bc81c[_0x501e('0x1e')],_0x26a015;if(_0x4a9206>=_0x44f7b6){_0x4a9206=_0x44f7b6;_0x26a015=0xc8;}else{_0x26a015=0xce;}_0x6db7f5['status'](_0x26a015);return _0x6db7f5[_0x501e('0x1f')](_0x501e('0x20'),_0x50d0ee+'-'+_0x4a9206+'/'+_0x44f7b6)[_0x501e('0x1b')](_0x4bc774);}return null;};}function patchUpdates(_0x54717e){return function(_0x4ff09c){try{jsonpatch[_0x501e('0x21')](_0x4ff09c,_0x54717e,!![]);}catch(_0x1e23f0){return BPromise[_0x501e('0x22')](_0x1e23f0);}return _0x4ff09c[_0x501e('0x23')]();};}function saveUpdates(_0x540c98,_0x1cf90b){return function(_0x506aaf){if(_0x506aaf){return _0x506aaf[_0x501e('0x24')](_0x540c98)['then'](function(_0x5334fa){return _0x5334fa;});}return null;};}function removeEntity(_0x57c341,_0x3cd8c7){return function(_0x46bc02){if(_0x46bc02){return _0x46bc02[_0x501e('0x25')]()[_0x501e('0x26')](function(){var _0x264558=_0x46bc02['get']({'plain':!![]});var _0x3e77de=_0x501e('0x27');return db[_0x501e('0x28')][_0x501e('0x25')]({'where':{'type':_0x3e77de,'resourceId':_0x264558['id']}})['then'](function(){return _0x46bc02;});})[_0x501e('0x26')](function(){_0x57c341[_0x501e('0x19')](0xcc)[_0x501e('0x1a')]();});}};}function handleEntityNotFound(_0x9dbf8b,_0x1b2219){return function(_0x2177a4){if(!_0x2177a4){_0x9dbf8b[_0x501e('0x29')](0x194);}return _0x2177a4;};}function handleError(_0x8541ea,_0x539eac){_0x539eac=_0x539eac||0x1f4;return function(_0x28253b){logger['error'](_0x28253b[_0x501e('0x2a')]);if(_0x28253b['name']){delete _0x28253b[_0x501e('0x2b')];}_0x8541ea[_0x501e('0x19')](_0x539eac)['send'](_0x28253b);};}exports['index']=function(_0x9b08b9,_0x2bd848){var _0xdc2f1b={},_0x5da796={},_0x399ff2={'count':0x0,'rows':[]};var _0x5982f3=_['map'](db['SquareProject'][_0x501e('0x2c')],function(_0x2abf15){return{'name':_0x2abf15['fieldName'],'type':_0x2abf15[_0x501e('0x2d')][_0x501e('0x2e')]};});_0x5da796['model']=_[_0x501e('0x2f')](_0x5982f3,_0x501e('0x2b'));_0x5da796[_0x501e('0x30')]=_[_0x501e('0x31')](_0x9b08b9[_0x501e('0x30')]);_0x5da796[_0x501e('0x32')]=_[_0x501e('0x33')](_0x5da796[_0x501e('0x34')],_0x5da796[_0x501e('0x30')]);_0xdc2f1b[_0x501e('0x35')]=_[_0x501e('0x33')](_0x5da796['model'],qs[_0x501e('0x36')](_0x9b08b9['query']['fields']));_0xdc2f1b[_0x501e('0x35')]=_0xdc2f1b['attributes'][_0x501e('0x37')]?_0xdc2f1b['attributes']:_0x5da796[_0x501e('0x34')];if(!_0x9b08b9[_0x501e('0x30')]['hasOwnProperty']('nolimit')){_0xdc2f1b[_0x501e('0x1e')]=qs['limit'](_0x9b08b9[_0x501e('0x30')][_0x501e('0x1e')]);_0xdc2f1b[_0x501e('0x1d')]=qs[_0x501e('0x1d')](_0x9b08b9[_0x501e('0x30')][_0x501e('0x1d')]);}_0xdc2f1b['order']=qs[_0x501e('0x38')](_0x9b08b9[_0x501e('0x30')]['sort']);_0xdc2f1b['where']=qs['filters'](_[_0x501e('0x39')](_0x9b08b9[_0x501e('0x30')],_0x5da796[_0x501e('0x32')]),_0x5982f3);if(_0x9b08b9['query'][_0x501e('0x3a')]){_0xdc2f1b[_0x501e('0x3b')]=_[_0x501e('0x3c')](_0xdc2f1b[_0x501e('0x3b')],{'$or':_[_0x501e('0x2f')](_0x5982f3,function(_0x2c72c8){if(_0x2c72c8['type']!=='VIRTUAL'){var _0x36b127={};_0x36b127[_0x2c72c8[_0x501e('0x2b')]]={'$like':'%'+_0x9b08b9[_0x501e('0x30')][_0x501e('0x3a')]+'%'};return _0x36b127;}})});}_0xdc2f1b=_[_0x501e('0x3c')]({},_0xdc2f1b,_0x9b08b9[_0x501e('0x3d')]);var _0x42a306={'where':_0xdc2f1b[_0x501e('0x3b')]};return db[_0x501e('0x3e')]['count'](_0x42a306)[_0x501e('0x26')](function(_0x31ea3d){_0x399ff2['count']=_0x31ea3d;if(_0x9b08b9['query'][_0x501e('0x3f')]){_0xdc2f1b['include']=[{'all':!![]}];}return db[_0x501e('0x3e')]['findAll'](_0xdc2f1b);})[_0x501e('0x26')](function(_0x10a71d){_0x399ff2[_0x501e('0x40')]=_0x10a71d;return _0x399ff2;})[_0x501e('0x26')](respondWithFilteredResult(_0x2bd848,_0xdc2f1b))[_0x501e('0x41')](handleError(_0x2bd848,null));};exports[_0x501e('0x42')]=function(_0x1c68d,_0x1f76cd){var _0x26c7be={'raw':![],'where':{'id':_0x1c68d[_0x501e('0x43')]['id']}},_0x51f025={};_0x51f025[_0x501e('0x34')]=_[_0x501e('0x31')](db[_0x501e('0x3e')][_0x501e('0x2c')]);_0x51f025[_0x501e('0x30')]=_[_0x501e('0x31')](_0x1c68d[_0x501e('0x30')]);_0x51f025[_0x501e('0x32')]=_[_0x501e('0x33')](_0x51f025['model'],_0x51f025[_0x501e('0x30')]);_0x26c7be['attributes']=_[_0x501e('0x33')](_0x51f025[_0x501e('0x34')],qs['fields'](_0x1c68d[_0x501e('0x30')]['fields']));_0x26c7be['attributes']=_0x26c7be[_0x501e('0x35')][_0x501e('0x37')]?_0x26c7be[_0x501e('0x35')]:_0x51f025[_0x501e('0x34')];if(_0x1c68d[_0x501e('0x30')][_0x501e('0x3f')]){_0x26c7be[_0x501e('0x44')]=[{'all':!![]}];}_0x26c7be=_[_0x501e('0x3c')]({},_0x26c7be,_0x1c68d[_0x501e('0x3d')]);return db['SquareProject'][_0x501e('0x45')](_0x26c7be)['then'](handleEntityNotFound(_0x1f76cd,null))[_0x501e('0x26')](respondWithResult(_0x1f76cd,null))[_0x501e('0x41')](handleError(_0x1f76cd,null));};exports['create']=function(_0xb33a5f,_0x4d2ca5){return db[_0x501e('0x3e')]['create'](_0xb33a5f[_0x501e('0x46')],{})[_0x501e('0x26')](function(_0x63ed2c){var _0x4253ad=_0xb33a5f[_0x501e('0x47')][_0x501e('0x48')]({'plain':!![]});if(!_0x4253ad)throw new Error(_0x501e('0x49'));if(_0x4253ad[_0x501e('0x4a')]==='user'){var _0xde2f17=_0x63ed2c[_0x501e('0x48')]({'plain':!![]});var _0x32ffe8=_0x501e('0x27');return db[_0x501e('0x4b')][_0x501e('0x45')]({'where':{'name':_0x32ffe8,'userProfileId':_0x4253ad[_0x501e('0x4c')]},'raw':!![]})[_0x501e('0x26')](function(_0x5906c3){if(_0x5906c3&&_0x5906c3[_0x501e('0x4d')]===0x0){return db[_0x501e('0x28')]['create']({'name':_0xde2f17['name'],'resourceId':_0xde2f17['id'],'type':_0x5906c3['name'],'sectionId':_0x5906c3['id']},{})[_0x501e('0x26')](function(){return _0x63ed2c;});}else{return _0x63ed2c;}})['catch'](function(_0x502c76){logger[_0x501e('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x502c76);throw _0x502c76;});}return _0x63ed2c;})[_0x501e('0x26')](respondWithResult(_0x4d2ca5,0xc9))[_0x501e('0x41')](handleError(_0x4d2ca5,null));};exports[_0x501e('0x24')]=function(_0x5698bc,_0x301cbd){if(_0x5698bc['body']['id']){delete _0x5698bc[_0x501e('0x46')]['id'];}return db[_0x501e('0x3e')][_0x501e('0x45')]({'where':{'id':_0x5698bc[_0x501e('0x43')]['id']}})[_0x501e('0x26')](handleEntityNotFound(_0x301cbd,null))[_0x501e('0x26')](saveUpdates(_0x5698bc[_0x501e('0x46')],null))[_0x501e('0x26')](respondWithResult(_0x301cbd,null))[_0x501e('0x41')](handleError(_0x301cbd,null));};exports[_0x501e('0x25')]=function(_0x286a15,_0x288ef2){return db[_0x501e('0x3e')][_0x501e('0x45')]({'where':{'id':_0x286a15[_0x501e('0x43')]['id']}})[_0x501e('0x26')](handleEntityNotFound(_0x288ef2,null))[_0x501e('0x26')](removeEntity(_0x288ef2,null))[_0x501e('0x41')](handleError(_0x288ef2,null));};exports['addUsers']=function(_0x479101,_0x31fac8,_0x223fca){return db['SquareProject'][_0x501e('0x45')]({'where':{'id':_0x479101[_0x501e('0x43')]['id']}})['then'](handleEntityNotFound(_0x31fac8,null))['then'](function(_0x274e28){if(_0x274e28){return _0x274e28['addUsers'](_0x479101[_0x501e('0x46')]['ids'],_[_0x501e('0x4f')](_0x479101[_0x501e('0x46')],[_0x501e('0x50'),'id'])||{});}})[_0x501e('0x26')](respondWithResult(_0x31fac8,null))['catch'](handleError(_0x31fac8,null));};exports[_0x501e('0x51')]=function(_0x36b717,_0x3720d1,_0x516013){return db[_0x501e('0x3e')]['find']({'where':{'id':_0x36b717[_0x501e('0x43')]['id']}})[_0x501e('0x26')](handleEntityNotFound(_0x3720d1,null))[_0x501e('0x26')](function(_0x3f107a){if(_0x3f107a){return _0x3f107a[_0x501e('0x51')](_0x36b717[_0x501e('0x30')][_0x501e('0x50')])[_0x501e('0x26')](function(){if(_['isArray'](_0x36b717[_0x501e('0x30')][_0x501e('0x50')])){for(var _0x70ac1d=0x0;_0x70ac1d<_0x36b717[_0x501e('0x30')][_0x501e('0x50')]['length'];_0x70ac1d+=0x1){socket[_0x501e('0x52')](_0x501e('0x53'),{'UserId':Number(_0x36b717[_0x501e('0x30')]['ids'][_0x70ac1d]),'SquareProjectId':Number(_0x36b717[_0x501e('0x43')]['id'])});}}else{socket[_0x501e('0x52')](_0x501e('0x53'),{'UserId':Number(_0x36b717[_0x501e('0x30')]['ids']),'SquareProjectId':Number(_0x36b717['params']['id'])});}});}})[_0x501e('0x26')](respondWithStatusCode(_0x3720d1,null))[_0x501e('0x41')](handleError(_0x3720d1,null));};exports[_0x501e('0x54')]=function(_0x3ad235,_0x3bb24c,_0x515156){var _0x499b09={};var _0x326778={};var _0x951d1;var _0x4ad394;return db[_0x501e('0x3e')][_0x501e('0x55')]({'where':{'id':_0x3ad235[_0x501e('0x43')]['id']}})[_0x501e('0x26')](handleEntityNotFound(_0x3bb24c,null))[_0x501e('0x26')](function(_0x550ad5){if(_0x550ad5){_0x951d1=_0x550ad5;_0x326778[_0x501e('0x34')]=_[_0x501e('0x31')](db['User'][_0x501e('0x2c')]);_0x326778[_0x501e('0x30')]=_[_0x501e('0x31')](_0x3ad235[_0x501e('0x30')]);_0x326778[_0x501e('0x32')]=_[_0x501e('0x33')](_0x326778[_0x501e('0x34')],_0x326778['query']);_0x499b09['attributes']=_['intersection'](_0x326778[_0x501e('0x34')],qs[_0x501e('0x36')](_0x3ad235[_0x501e('0x30')]['fields']));_0x499b09[_0x501e('0x35')]=_0x499b09[_0x501e('0x35')][_0x501e('0x37')]?_0x499b09[_0x501e('0x35')]:_0x326778[_0x501e('0x34')];_0x499b09[_0x501e('0x56')]=qs[_0x501e('0x38')](_0x3ad235[_0x501e('0x30')][_0x501e('0x38')]);_0x499b09['where']=qs['filters'](_[_0x501e('0x39')](_0x3ad235[_0x501e('0x30')],_0x326778[_0x501e('0x32')]));if(_0x3ad235[_0x501e('0x30')][_0x501e('0x3a')]){_0x499b09[_0x501e('0x3b')]=_['merge'](_0x499b09['where'],{'$or':_['map'](_0x499b09[_0x501e('0x35')],function(_0x356e99){var _0x9bd86={};_0x9bd86[_0x356e99]={'$like':'%'+_0x3ad235['query'][_0x501e('0x3a')]+'%'};return _0x9bd86;})});}_0x499b09=_[_0x501e('0x3c')]({},_0x499b09,_0x3ad235[_0x501e('0x3d')]);return _0x951d1[_0x501e('0x54')](_0x499b09);}})['then'](function(_0x523ad9){if(_0x523ad9){_0x4ad394=_0x523ad9[_0x501e('0x37')];if(!_0x3ad235[_0x501e('0x30')][_0x501e('0x57')](_0x501e('0x58'))){_0x499b09[_0x501e('0x1e')]=qs[_0x501e('0x1e')](_0x3ad235[_0x501e('0x30')][_0x501e('0x1e')]);_0x499b09[_0x501e('0x1d')]=qs['offset'](_0x3ad235[_0x501e('0x30')][_0x501e('0x1d')]);}return _0x951d1[_0x501e('0x54')](_0x499b09);}})[_0x501e('0x26')](function(_0x42415b){if(_0x42415b){return _0x42415b?{'count':_0x4ad394,'rows':_0x42415b}:null;}})[_0x501e('0x26')](respondWithResult(_0x3bb24c,null))[_0x501e('0x41')](handleError(_0x3bb24c,null));}; \ No newline at end of file +var _0x3dc0=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','type','key','model','query','intersection','attributes','fields','length','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','pick','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3825ec,_0x5437a1){var _0x5462db=function(_0x458f4c){while(--_0x458f4c){_0x3825ec['push'](_0x3825ec['shift']());}};_0x5462db(++_0x5437a1);}(_0x3dc0,0x10d));var _0x03dc=function(_0x3fda0e,_0x4ff970){_0x3fda0e=_0x3fda0e-0x0;var _0x6937aa=_0x3dc0[_0x3fda0e];return _0x6937aa;};'use strict';var pdf=require(_0x03dc('0x0'));var emlformat=require(_0x03dc('0x1'));var rimraf=require(_0x03dc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03dc('0x3'));var rp=require(_0x03dc('0x4'));var moment=require(_0x03dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03dc('0x6'));var util=require(_0x03dc('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x03dc('0x8'));var squel=require(_0x03dc('0x9'));var crypto=require(_0x03dc('0xa'));var jsforce=require(_0x03dc('0xb'));var deskjs=require(_0x03dc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x03dc('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03dc('0xe'));var qs=require(_0x03dc('0xf'));var as=require(_0x03dc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03dc('0x11'))(_0x03dc('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x03dc('0x13'))['db'];config[_0x03dc('0x14')]=_[_0x03dc('0x15')](config[_0x03dc('0x14')],{'host':_0x03dc('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x03dc('0x17'))[_0x03dc('0x18')](socket);function respondWithStatusCode(_0x41612f,_0x3c1da7){_0x3c1da7=_0x3c1da7||0xcc;return function(_0x1c95d0){if(_0x1c95d0){return _0x41612f[_0x03dc('0x19')](_0x3c1da7);}return _0x41612f[_0x03dc('0x1a')](_0x3c1da7)[_0x03dc('0x1b')]();};}function respondWithResult(_0x2bc524,_0x2ec7cb){_0x2ec7cb=_0x2ec7cb||0xc8;return function(_0x55ad2b){if(_0x55ad2b){return _0x2bc524[_0x03dc('0x1a')](_0x2ec7cb)[_0x03dc('0x1c')](_0x55ad2b);}};}function respondWithFilteredResult(_0x114895,_0x19863b){return function(_0x49b9d5){if(_0x49b9d5){var _0x3554f1=_0x49b9d5[_0x03dc('0x1d')],_0x2ab2bf=_0x19863b['offset'],_0x360928=_0x19863b[_0x03dc('0x1e')]+_0x19863b['limit'],_0x2a4f55;if(_0x360928>=_0x3554f1){_0x360928=_0x3554f1;_0x2a4f55=0xc8;}else{_0x2a4f55=0xce;}_0x114895['status'](_0x2a4f55);return _0x114895[_0x03dc('0x1f')]('Content-Range',_0x2ab2bf+'-'+_0x360928+'/'+_0x3554f1)[_0x03dc('0x1c')](_0x49b9d5);}return null;};}function patchUpdates(_0xd4a1e7){return function(_0x126422){try{jsonpatch[_0x03dc('0x20')](_0x126422,_0xd4a1e7,!![]);}catch(_0x59bd88){return BPromise[_0x03dc('0x21')](_0x59bd88);}return _0x126422[_0x03dc('0x22')]();};}function saveUpdates(_0x42335d,_0x35db81){return function(_0x5c8a49){if(_0x5c8a49){return _0x5c8a49[_0x03dc('0x23')](_0x42335d)[_0x03dc('0x24')](function(_0x3be605){return _0x3be605;});}return null;};}function removeEntity(_0x504c14,_0xfc85a2){return function(_0x475454){if(_0x475454){return _0x475454[_0x03dc('0x25')]()[_0x03dc('0x24')](function(){var _0x2333dc=_0x475454[_0x03dc('0x26')]({'plain':!![]});var _0x18acd6=_0x03dc('0x27');return db[_0x03dc('0x28')][_0x03dc('0x25')]({'where':{'type':_0x18acd6,'resourceId':_0x2333dc['id']}})['then'](function(){return _0x475454;});})[_0x03dc('0x24')](function(){_0x504c14[_0x03dc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4333eb,_0x52b7b8){return function(_0x306328){if(!_0x306328){_0x4333eb[_0x03dc('0x19')](0x194);}return _0x306328;};}function handleError(_0x1b8c39,_0x5c342d){_0x5c342d=_0x5c342d||0x1f4;return function(_0x126230){logger[_0x03dc('0x29')](_0x126230[_0x03dc('0x2a')]);if(_0x126230[_0x03dc('0x2b')]){delete _0x126230[_0x03dc('0x2b')];}_0x1b8c39['status'](_0x5c342d)[_0x03dc('0x2c')](_0x126230);};}exports[_0x03dc('0x2d')]=function(_0x79cdd9,_0x405b2a){var _0x3ff01c={},_0x335dbc={},_0x1b472d={'count':0x0,'rows':[]};var _0x2ac4c0=_[_0x03dc('0x2e')](db[_0x03dc('0x2f')][_0x03dc('0x30')],function(_0x3020ad){return{'name':_0x3020ad['fieldName'],'type':_0x3020ad[_0x03dc('0x31')][_0x03dc('0x32')]};});_0x335dbc[_0x03dc('0x33')]=_[_0x03dc('0x2e')](_0x2ac4c0,_0x03dc('0x2b'));_0x335dbc[_0x03dc('0x34')]=_['keys'](_0x79cdd9[_0x03dc('0x34')]);_0x335dbc['filters']=_[_0x03dc('0x35')](_0x335dbc['model'],_0x335dbc['query']);_0x3ff01c[_0x03dc('0x36')]=_[_0x03dc('0x35')](_0x335dbc[_0x03dc('0x33')],qs[_0x03dc('0x37')](_0x79cdd9[_0x03dc('0x34')][_0x03dc('0x37')]));_0x3ff01c['attributes']=_0x3ff01c[_0x03dc('0x36')][_0x03dc('0x38')]?_0x3ff01c['attributes']:_0x335dbc['model'];if(!_0x79cdd9['query']['hasOwnProperty']('nolimit')){_0x3ff01c[_0x03dc('0x39')]=qs[_0x03dc('0x39')](_0x79cdd9[_0x03dc('0x34')]['limit']);_0x3ff01c[_0x03dc('0x1e')]=qs[_0x03dc('0x1e')](_0x79cdd9[_0x03dc('0x34')][_0x03dc('0x1e')]);}_0x3ff01c[_0x03dc('0x3a')]=qs[_0x03dc('0x3b')](_0x79cdd9[_0x03dc('0x34')][_0x03dc('0x3b')]);_0x3ff01c[_0x03dc('0x3c')]=qs[_0x03dc('0x3d')](_['pick'](_0x79cdd9[_0x03dc('0x34')],_0x335dbc[_0x03dc('0x3d')]),_0x2ac4c0);if(_0x79cdd9['query'][_0x03dc('0x3e')]){_0x3ff01c[_0x03dc('0x3c')]=_[_0x03dc('0x3f')](_0x3ff01c['where'],{'$or':_['map'](_0x2ac4c0,function(_0x4104a0){if(_0x4104a0[_0x03dc('0x31')]!==_0x03dc('0x40')){var _0x81deb5={};_0x81deb5[_0x4104a0[_0x03dc('0x2b')]]={'$like':'%'+_0x79cdd9[_0x03dc('0x34')][_0x03dc('0x3e')]+'%'};return _0x81deb5;}})});}_0x3ff01c=_[_0x03dc('0x3f')]({},_0x3ff01c,_0x79cdd9[_0x03dc('0x41')]);var _0x585efe={'where':_0x3ff01c[_0x03dc('0x3c')]};return db[_0x03dc('0x2f')][_0x03dc('0x1d')](_0x585efe)[_0x03dc('0x24')](function(_0x3d093d){_0x1b472d[_0x03dc('0x1d')]=_0x3d093d;if(_0x79cdd9['query']['includeAll']){_0x3ff01c[_0x03dc('0x42')]=[{'all':!![]}];}return db[_0x03dc('0x2f')][_0x03dc('0x43')](_0x3ff01c);})['then'](function(_0x73833b){_0x1b472d[_0x03dc('0x44')]=_0x73833b;return _0x1b472d;})[_0x03dc('0x24')](respondWithFilteredResult(_0x405b2a,_0x3ff01c))[_0x03dc('0x45')](handleError(_0x405b2a,null));};exports[_0x03dc('0x46')]=function(_0xffcf5d,_0x4cd7e5){var _0xe2d29b={'raw':![],'where':{'id':_0xffcf5d[_0x03dc('0x47')]['id']}},_0x4cb965={};_0x4cb965[_0x03dc('0x33')]=_['keys'](db[_0x03dc('0x2f')][_0x03dc('0x30')]);_0x4cb965['query']=_[_0x03dc('0x48')](_0xffcf5d[_0x03dc('0x34')]);_0x4cb965[_0x03dc('0x3d')]=_[_0x03dc('0x35')](_0x4cb965[_0x03dc('0x33')],_0x4cb965[_0x03dc('0x34')]);_0xe2d29b[_0x03dc('0x36')]=_[_0x03dc('0x35')](_0x4cb965[_0x03dc('0x33')],qs['fields'](_0xffcf5d[_0x03dc('0x34')][_0x03dc('0x37')]));_0xe2d29b['attributes']=_0xe2d29b['attributes'][_0x03dc('0x38')]?_0xe2d29b['attributes']:_0x4cb965[_0x03dc('0x33')];if(_0xffcf5d[_0x03dc('0x34')][_0x03dc('0x49')]){_0xe2d29b[_0x03dc('0x42')]=[{'all':!![]}];}_0xe2d29b=_['merge']({},_0xe2d29b,_0xffcf5d[_0x03dc('0x41')]);return db[_0x03dc('0x2f')]['find'](_0xe2d29b)['then'](handleEntityNotFound(_0x4cd7e5,null))[_0x03dc('0x24')](respondWithResult(_0x4cd7e5,null))[_0x03dc('0x45')](handleError(_0x4cd7e5,null));};exports[_0x03dc('0x4a')]=function(_0x13579c,_0x5a5fde){return db['SquareProject'][_0x03dc('0x4a')](_0x13579c['body'],{})[_0x03dc('0x24')](function(_0x8f8038){var _0x30dc8c=_0x13579c[_0x03dc('0x4b')][_0x03dc('0x26')]({'plain':!![]});if(!_0x30dc8c)throw new Error(_0x03dc('0x4c'));if(_0x30dc8c[_0x03dc('0x4d')]==='user'){var _0xe35d48=_0x8f8038[_0x03dc('0x26')]({'plain':!![]});var _0x96480d=_0x03dc('0x27');return db[_0x03dc('0x4e')][_0x03dc('0x4f')]({'where':{'name':_0x96480d,'userProfileId':_0x30dc8c['userProfileId']},'raw':!![]})[_0x03dc('0x24')](function(_0x1a4511){if(_0x1a4511&&_0x1a4511[_0x03dc('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xe35d48['name'],'resourceId':_0xe35d48['id'],'type':_0x1a4511[_0x03dc('0x2b')],'sectionId':_0x1a4511['id']},{})[_0x03dc('0x24')](function(){return _0x8f8038;});}else{return _0x8f8038;}})[_0x03dc('0x45')](function(_0x56d60c){logger[_0x03dc('0x29')](_0x03dc('0x51'),_0x56d60c);throw _0x56d60c;});}return _0x8f8038;})[_0x03dc('0x24')](respondWithResult(_0x5a5fde,0xc9))[_0x03dc('0x45')](handleError(_0x5a5fde,null));};exports[_0x03dc('0x23')]=function(_0x3cc6e6,_0x34092d){if(_0x3cc6e6[_0x03dc('0x52')]['id']){delete _0x3cc6e6['body']['id'];}return db[_0x03dc('0x2f')][_0x03dc('0x4f')]({'where':{'id':_0x3cc6e6[_0x03dc('0x47')]['id']}})[_0x03dc('0x24')](handleEntityNotFound(_0x34092d,null))[_0x03dc('0x24')](saveUpdates(_0x3cc6e6[_0x03dc('0x52')],null))[_0x03dc('0x24')](respondWithResult(_0x34092d,null))[_0x03dc('0x45')](handleError(_0x34092d,null));};exports[_0x03dc('0x25')]=function(_0x3036b2,_0x2795ee){return db[_0x03dc('0x2f')][_0x03dc('0x4f')]({'where':{'id':_0x3036b2[_0x03dc('0x47')]['id']}})[_0x03dc('0x24')](handleEntityNotFound(_0x2795ee,null))[_0x03dc('0x24')](removeEntity(_0x2795ee,null))[_0x03dc('0x45')](handleError(_0x2795ee,null));};exports[_0x03dc('0x53')]=function(_0x57910d,_0x1a92f2,_0x318acd){return db['SquareProject'][_0x03dc('0x4f')]({'where':{'id':_0x57910d['params']['id']}})[_0x03dc('0x24')](handleEntityNotFound(_0x1a92f2,null))['then'](function(_0x5c1f92){if(_0x5c1f92){return _0x5c1f92[_0x03dc('0x53')](_0x57910d[_0x03dc('0x52')][_0x03dc('0x54')],_[_0x03dc('0x55')](_0x57910d[_0x03dc('0x52')],['ids','id'])||{});}})['then'](respondWithResult(_0x1a92f2,null))[_0x03dc('0x45')](handleError(_0x1a92f2,null));};exports[_0x03dc('0x56')]=function(_0x337589,_0x6d34c8,_0x31fef4){return db[_0x03dc('0x2f')][_0x03dc('0x4f')]({'where':{'id':_0x337589['params']['id']}})[_0x03dc('0x24')](handleEntityNotFound(_0x6d34c8,null))['then'](function(_0x2be7){if(_0x2be7){return _0x2be7[_0x03dc('0x56')](_0x337589[_0x03dc('0x34')][_0x03dc('0x54')])[_0x03dc('0x24')](function(){if(_[_0x03dc('0x57')](_0x337589[_0x03dc('0x34')]['ids'])){for(var _0x5c273e=0x0;_0x5c273e<_0x337589[_0x03dc('0x34')][_0x03dc('0x54')][_0x03dc('0x38')];_0x5c273e+=0x1){socket[_0x03dc('0x58')](_0x03dc('0x59'),{'UserId':Number(_0x337589['query'][_0x03dc('0x54')][_0x5c273e]),'SquareProjectId':Number(_0x337589['params']['id'])});}}else{socket[_0x03dc('0x58')](_0x03dc('0x59'),{'UserId':Number(_0x337589[_0x03dc('0x34')][_0x03dc('0x54')]),'SquareProjectId':Number(_0x337589[_0x03dc('0x47')]['id'])});}});}})[_0x03dc('0x24')](respondWithStatusCode(_0x6d34c8,null))[_0x03dc('0x45')](handleError(_0x6d34c8,null));};exports[_0x03dc('0x5a')]=function(_0x32898e,_0x4d3d1b,_0x53ddea){var _0x1aa835={};var _0x49149e={};var _0x9bff49;var _0x320926;return db[_0x03dc('0x2f')]['findOne']({'where':{'id':_0x32898e[_0x03dc('0x47')]['id']}})[_0x03dc('0x24')](handleEntityNotFound(_0x4d3d1b,null))[_0x03dc('0x24')](function(_0x48c159){if(_0x48c159){_0x9bff49=_0x48c159;_0x49149e[_0x03dc('0x33')]=_['keys'](db[_0x03dc('0x5b')]['rawAttributes']);_0x49149e[_0x03dc('0x34')]=_[_0x03dc('0x48')](_0x32898e['query']);_0x49149e[_0x03dc('0x3d')]=_[_0x03dc('0x35')](_0x49149e[_0x03dc('0x33')],_0x49149e['query']);_0x1aa835[_0x03dc('0x36')]=_[_0x03dc('0x35')](_0x49149e[_0x03dc('0x33')],qs['fields'](_0x32898e[_0x03dc('0x34')]['fields']));_0x1aa835[_0x03dc('0x36')]=_0x1aa835[_0x03dc('0x36')][_0x03dc('0x38')]?_0x1aa835[_0x03dc('0x36')]:_0x49149e[_0x03dc('0x33')];_0x1aa835[_0x03dc('0x3a')]=qs[_0x03dc('0x3b')](_0x32898e['query'][_0x03dc('0x3b')]);_0x1aa835[_0x03dc('0x3c')]=qs['filters'](_[_0x03dc('0x5c')](_0x32898e[_0x03dc('0x34')],_0x49149e[_0x03dc('0x3d')]));if(_0x32898e['query']['filter']){_0x1aa835[_0x03dc('0x3c')]=_[_0x03dc('0x3f')](_0x1aa835[_0x03dc('0x3c')],{'$or':_['map'](_0x1aa835[_0x03dc('0x36')],function(_0x5e8636){var _0x579b3d={};_0x579b3d[_0x5e8636]={'$like':'%'+_0x32898e[_0x03dc('0x34')][_0x03dc('0x3e')]+'%'};return _0x579b3d;})});}_0x1aa835=_['merge']({},_0x1aa835,_0x32898e['options']);return _0x9bff49[_0x03dc('0x5a')](_0x1aa835);}})[_0x03dc('0x24')](function(_0x20d51a){if(_0x20d51a){_0x320926=_0x20d51a[_0x03dc('0x38')];if(!_0x32898e[_0x03dc('0x34')]['hasOwnProperty'](_0x03dc('0x5d'))){_0x1aa835[_0x03dc('0x39')]=qs[_0x03dc('0x39')](_0x32898e['query']['limit']);_0x1aa835[_0x03dc('0x1e')]=qs['offset'](_0x32898e[_0x03dc('0x34')][_0x03dc('0x1e')]);}return _0x9bff49[_0x03dc('0x5a')](_0x1aa835);}})[_0x03dc('0x24')](function(_0x198f02){if(_0x198f02){return _0x198f02?{'count':_0x320926,'rows':_0x198f02}:null;}})[_0x03dc('0x24')](respondWithResult(_0x4d3d1b,null))[_0x03dc('0x45')](handleError(_0x4d3d1b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 76e7a2f..30f050d 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 _0x3b34=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x5b6062,_0x3aade7){var _0x1354ea=function(_0x32db85){while(--_0x32db85){_0x5b6062['push'](_0x5b6062['shift']());}};_0x1354ea(++_0x3aade7);}(_0x3b34,0x108));var _0x43b3=function(_0x5ae2bd,_0x37c17a){_0x5ae2bd=_0x5ae2bd-0x0;var _0xd3aabe=_0x3b34[_0x5ae2bd];return _0xd3aabe;};'use strict';var EventEmitter=require(_0x43b3('0x0'));var SquareProject=require(_0x43b3('0x1'))['db'][_0x43b3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x43b3('0x3')](0x0);var events={'afterCreate':_0x43b3('0x4'),'afterUpdate':_0x43b3('0x5'),'afterDestroy':_0x43b3('0x6')};function emitEvent(_0x5e41c9){return function(_0x3397ee,_0x395c6a,_0x26d89c){SquareProjectEvents[_0x43b3('0x7')](_0x5e41c9+':'+_0x3397ee['id'],_0x3397ee);SquareProjectEvents[_0x43b3('0x7')](_0x5e41c9,_0x3397ee);_0x26d89c(null);};}for(var e in events){if(events[_0x43b3('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x43b3('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x5e37=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject'];(function(_0x46d5ac,_0x4cc7df){var _0xb6f383=function(_0x3c7740){while(--_0x3c7740){_0x46d5ac['push'](_0x46d5ac['shift']());}};_0xb6f383(++_0x4cc7df);}(_0x5e37,0xcc));var _0x75e3=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x5e37[_0x4631eb];return _0x562eca;};'use strict';var EventEmitter=require(_0x75e3('0x0'));var SquareProject=require(_0x75e3('0x1'))['db'][_0x75e3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x75e3('0x3')](0x0);var events={'afterCreate':_0x75e3('0x4'),'afterUpdate':'update','afterDestroy':_0x75e3('0x5')};function emitEvent(_0x3618e1){return function(_0x1f320e,_0x11cc09,_0x5d1ea0){SquareProjectEvents[_0x75e3('0x6')](_0x3618e1+':'+_0x1f320e['id'],_0x1f320e);SquareProjectEvents['emit'](_0x3618e1,_0x1f320e);_0x5d1ea0(null);};}for(var e in events){if(events[_0x75e3('0x7')](e)){var event=events[e];SquareProject[_0x75e3('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e4b2f14..4463d9b 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 _0x1a85=['moment','path','rimraf','../../config/environment','exports','SquareProject','square_projects','../../config/logger','api'];(function(_0x9b0431,_0x32542c){var _0x4b3886=function(_0x51da12){while(--_0x51da12){_0x9b0431['push'](_0x9b0431['shift']());}};_0x4b3886(++_0x32542c);}(_0x1a85,0x178));var _0x51a8=function(_0x82305a,_0x46a9fb){_0x82305a=_0x82305a-0x0;var _0x5b57e6=_0x1a85[_0x82305a];return _0x5b57e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./squareProject.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x5d7916,_0x1ed837){var _0x3c27ec=function(_0x4ace7f){while(--_0x4ace7f){_0x5d7916['push'](_0x5d7916['shift']());}};_0x3c27ec(++_0x1ed837);}(_0x57ca,0x108));var _0xa57c=function(_0x266a3f,_0x5768e8){_0x266a3f=_0x266a3f-0x0;var _0x39d8d2=_0x57ca[_0x266a3f];return _0x39d8d2;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'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 e30fdee..0f8fd93 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 _0x6a70=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareProject,\x20%s,\x20%s','message','result','ShowSquareProject','SquareProject','options','raw','attributes','map','include','model','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x11dc4d,_0x45f353){var _0x125d12=function(_0x59c927){while(--_0x59c927){_0x11dc4d['push'](_0x11dc4d['shift']());}};_0x125d12(++_0x45f353);}(_0x6a70,0x120));var _0x06a7=function(_0x44f58c,_0x1c9df2){_0x44f58c=_0x44f58c-0x0;var _0x733b0a=_0x6a70[_0x44f58c];return _0x733b0a;};'use strict';var _=require(_0x06a7('0x0'));var util=require(_0x06a7('0x1'));var moment=require(_0x06a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x06a7('0x3'));var fs=require('fs');var Redis=require(_0x06a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06a7('0x5'))(_0x06a7('0x6'));var config=require(_0x06a7('0x7'));var jayson=require(_0x06a7('0x8'));var client=jayson[_0x06a7('0x9')][_0x06a7('0xa')]({'port':0x232a});config[_0x06a7('0xb')]=_[_0x06a7('0xc')](config[_0x06a7('0xb')],{'host':_0x06a7('0xd'),'port':0x18eb});var socket=require(_0x06a7('0xe'))(new Redis(config['redis']));require(_0x06a7('0xf'))[_0x06a7('0x10')](socket);function respondWithRpcPromise(_0x40e4e8,_0x36afab,_0x3457b3){return new BPromise(function(_0xfff1cf,_0x5c3b24){return client[_0x06a7('0x11')](_0x40e4e8,_0x3457b3)[_0x06a7('0x12')](function(_0x7ba452){logger[_0x06a7('0x13')]('SquareProject,\x20%s,\x20%s',_0x36afab,_0x06a7('0x14'));logger['debug'](_0x06a7('0x15'),_0x36afab,_0x06a7('0x14'),JSON[_0x06a7('0x16')](_0x7ba452));if(_0x7ba452['error']){if(_0x7ba452['error'][_0x06a7('0x17')]===0x1f4){logger[_0x06a7('0x18')](_0x06a7('0x19'),_0x36afab,_0x7ba452[_0x06a7('0x18')][_0x06a7('0x1a')]);return _0x5c3b24(_0x7ba452[_0x06a7('0x18')][_0x06a7('0x1a')]);}logger[_0x06a7('0x18')](_0x06a7('0x19'),_0x36afab,_0x7ba452[_0x06a7('0x18')][_0x06a7('0x1a')]);return _0xfff1cf(_0x7ba452['error'][_0x06a7('0x1a')]);}else{logger['info'](_0x06a7('0x19'),_0x36afab,_0x06a7('0x14'));_0xfff1cf(_0x7ba452[_0x06a7('0x1b')][_0x06a7('0x1a')]);}})['catch'](function(_0x216876){logger[_0x06a7('0x18')](_0x06a7('0x19'),_0x36afab,_0x216876);_0x5c3b24(_0x216876);});});}exports[_0x06a7('0x1c')]=function(_0x453f43){var _0x3269d8=this;return new Promise(function(_0x2717a2,_0x564648){return db[_0x06a7('0x1d')]['find']({'raw':_0x453f43[_0x06a7('0x1e')]?_0x453f43[_0x06a7('0x1e')][_0x06a7('0x1f')]===undefined?!![]:![]:!![],'where':_0x453f43[_0x06a7('0x1e')]?_0x453f43['options']['where']||null:null,'attributes':_0x453f43[_0x06a7('0x1e')]?_0x453f43[_0x06a7('0x1e')][_0x06a7('0x20')]||null:null,'include':_0x453f43[_0x06a7('0x1e')]?_0x453f43[_0x06a7('0x1e')]['include']?_[_0x06a7('0x21')](_0x453f43['options'][_0x06a7('0x22')],function(_0x5381a2){return{'model':db[_0x5381a2[_0x06a7('0x23')]],'as':_0x5381a2['as'],'attributes':_0x5381a2[_0x06a7('0x20')],'include':_0x5381a2['include']?_[_0x06a7('0x21')](_0x5381a2['include'],function(_0xc501d2){return{'model':db[_0xc501d2[_0x06a7('0x23')]],'as':_0xc501d2['as'],'attributes':_0xc501d2[_0x06a7('0x20')],'include':_0xc501d2['include']?_['map'](_0xc501d2['include'],function(_0x2d0d4a){return{'model':db[_0x2d0d4a[_0x06a7('0x23')]],'as':_0x2d0d4a['as'],'attributes':_0x2d0d4a[_0x06a7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06a7('0x12')](function(_0x52df39){logger[_0x06a7('0x13')]('ShowSquareProject',_0x453f43);logger['debug']('ShowSquareProject',_0x453f43,JSON[_0x06a7('0x16')](_0x52df39));_0x2717a2(_0x52df39);})[_0x06a7('0x24')](function(_0x2d2baf){logger[_0x06a7('0x18')]('ShowSquareProject',_0x2d2baf['message'],_0x453f43);_0x564648(_0x3269d8[_0x06a7('0x18')](0x1f4,_0x2d2baf[_0x06a7('0x1a')]));});});}; \ No newline at end of file +var _0xab02=['SquareProject','find','options','raw','where','attributes','map','include','model','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','request','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab02,0x1de));var _0x2ab0=function(_0x428af1,_0x2400e6){_0x428af1=_0x428af1-0x0;var _0x8a89bb=_0xab02[_0x428af1];return _0x8a89bb;};'use strict';var _=require('lodash');var util=require(_0x2ab0('0x0'));var moment=require(_0x2ab0('0x1'));var BPromise=require(_0x2ab0('0x2'));var rs=require(_0x2ab0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ab0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2ab0('0x5'));var jayson=require(_0x2ab0('0x6'));var client=jayson[_0x2ab0('0x7')][_0x2ab0('0x8')]({'port':0x232a});config[_0x2ab0('0x9')]=_[_0x2ab0('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2ab0('0xb'))(new Redis(config[_0x2ab0('0x9')]));require(_0x2ab0('0xc'))[_0x2ab0('0xd')](socket);function respondWithRpcPromise(_0x1557da,_0x24ad93,_0x871ff6){return new BPromise(function(_0x1da890,_0xab97c1){return client[_0x2ab0('0xe')](_0x1557da,_0x871ff6)['then'](function(_0x19889){logger[_0x2ab0('0xf')]('SquareProject,\x20%s,\x20%s',_0x24ad93,_0x2ab0('0x10'));logger['debug'](_0x2ab0('0x11'),_0x24ad93,_0x2ab0('0x10'),JSON[_0x2ab0('0x12')](_0x19889));if(_0x19889[_0x2ab0('0x13')]){if(_0x19889[_0x2ab0('0x13')][_0x2ab0('0x14')]===0x1f4){logger[_0x2ab0('0x13')](_0x2ab0('0x15'),_0x24ad93,_0x19889[_0x2ab0('0x13')][_0x2ab0('0x16')]);return _0xab97c1(_0x19889[_0x2ab0('0x13')][_0x2ab0('0x16')]);}logger[_0x2ab0('0x13')](_0x2ab0('0x15'),_0x24ad93,_0x19889['error'][_0x2ab0('0x16')]);return _0x1da890(_0x19889[_0x2ab0('0x13')]['message']);}else{logger[_0x2ab0('0xf')](_0x2ab0('0x15'),_0x24ad93,_0x2ab0('0x10'));_0x1da890(_0x19889[_0x2ab0('0x17')][_0x2ab0('0x16')]);}})[_0x2ab0('0x18')](function(_0x482ff2){logger[_0x2ab0('0x13')](_0x2ab0('0x15'),_0x24ad93,_0x482ff2);_0xab97c1(_0x482ff2);});});}exports[_0x2ab0('0x19')]=function(_0x549eb4){var _0x10405b=this;return new Promise(function(_0x122386,_0x1e2b5f){return db[_0x2ab0('0x1a')][_0x2ab0('0x1b')]({'raw':_0x549eb4['options']?_0x549eb4[_0x2ab0('0x1c')][_0x2ab0('0x1d')]===undefined?!![]:![]:!![],'where':_0x549eb4[_0x2ab0('0x1c')]?_0x549eb4[_0x2ab0('0x1c')][_0x2ab0('0x1e')]||null:null,'attributes':_0x549eb4[_0x2ab0('0x1c')]?_0x549eb4[_0x2ab0('0x1c')][_0x2ab0('0x1f')]||null:null,'include':_0x549eb4[_0x2ab0('0x1c')]?_0x549eb4[_0x2ab0('0x1c')]['include']?_[_0x2ab0('0x20')](_0x549eb4[_0x2ab0('0x1c')][_0x2ab0('0x21')],function(_0x40ebfa){return{'model':db[_0x40ebfa[_0x2ab0('0x22')]],'as':_0x40ebfa['as'],'attributes':_0x40ebfa[_0x2ab0('0x1f')],'include':_0x40ebfa[_0x2ab0('0x21')]?_[_0x2ab0('0x20')](_0x40ebfa[_0x2ab0('0x21')],function(_0xf83e93){return{'model':db[_0xf83e93[_0x2ab0('0x22')]],'as':_0xf83e93['as'],'attributes':_0xf83e93[_0x2ab0('0x1f')],'include':_0xf83e93['include']?_[_0x2ab0('0x20')](_0xf83e93['include'],function(_0x5e1996){return{'model':db[_0x5e1996['model']],'as':_0x5e1996['as'],'attributes':_0x5e1996['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ab0('0x23')](function(_0x16bd45){logger[_0x2ab0('0xf')](_0x2ab0('0x19'),_0x549eb4);logger['debug'](_0x2ab0('0x19'),_0x549eb4,JSON[_0x2ab0('0x12')](_0x16bd45));_0x122386(_0x16bd45);})['catch'](function(_0x10f695){logger[_0x2ab0('0x13')](_0x2ab0('0x19'),_0x10f695[_0x2ab0('0x16')],_0x549eb4);_0x1e2b5f(_0x10405b[_0x2ab0('0x13')](0x1f4,_0x10f695['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 3e3b358..ed85985 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 _0x4c60=['squareProject:','./squareProject.events','save','remove','update','removeListener','register','length'];(function(_0x37ad5b,_0x5d0322){var _0xb41db3=function(_0x5528af){while(--_0x5528af){_0x37ad5b['push'](_0x37ad5b['shift']());}};_0xb41db3(++_0x5d0322);}(_0x4c60,0xc1));var _0x04c6=function(_0x51b07a,_0x4d7206){_0x51b07a=_0x51b07a-0x0;var _0x1dd36e=_0x4c60[_0x51b07a];return _0x1dd36e;};'use strict';var SquareProjectEvents=require(_0x04c6('0x0'));var events=[_0x04c6('0x1'),_0x04c6('0x2'),_0x04c6('0x3')];function createListener(_0x5ba768,_0x2a1d36){return function(_0x5d9fa3){_0x2a1d36['emit'](_0x5ba768,_0x5d9fa3);};}function removeListener(_0x4ad4f1,_0x53ca7a){return function(){SquareProjectEvents[_0x04c6('0x4')](_0x4ad4f1,_0x53ca7a);};}exports[_0x04c6('0x5')]=function(_0x2054da){for(var _0x12bd5d=0x0,_0x2b9041=events[_0x04c6('0x6')];_0x12bd5d<_0x2b9041;_0x12bd5d++){var _0x8f9b13=events[_0x12bd5d];var _0x530a48=createListener(_0x04c6('0x7')+_0x8f9b13,_0x2054da);SquareProjectEvents['on'](_0x8f9b13,_0x530a48);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','squareProject:'];(function(_0x524865,_0x1d33d0){var _0x4e3817=function(_0x1f945b){while(--_0x1f945b){_0x524865['push'](_0x524865['shift']());}};_0x4e3817(++_0x1d33d0);}(_0x1261,0x144));var _0x1126=function(_0x3a85ab,_0x1f3525){_0x3a85ab=_0x3a85ab-0x0;var _0x32d91a=_0x1261[_0x3a85ab];return _0x32d91a;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){SquareProjectEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);SquareProjectEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8759ec1..47cbbd4 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 _0xca2c=['multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports'];(function(_0x25408e,_0x457e2d){var _0xd3099d=function(_0x44fe35){while(--_0x44fe35){_0x25408e['push'](_0x25408e['shift']());}};_0xd3099d(++_0x457e2d);}(_0xca2c,0xd1));var _0xcca2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xca2c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcca2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcca2('0x1'));var express=require(_0xcca2('0x2'));var router=express[_0xcca2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcca2('0x4'));var config=require(_0xcca2('0x5'));var controller=require(_0xcca2('0x6'));router['get']('/',auth[_0xcca2('0x7')](),controller['index']);router[_0xcca2('0x8')](_0xcca2('0x9'),auth[_0xcca2('0x7')](),controller['show']);router[_0xcca2('0x8')](_0xcca2('0xa'),auth['isAuthenticated'](),controller[_0xcca2('0xb')]);router[_0xcca2('0xc')]('/',auth['isAuthenticated'](),controller[_0xcca2('0xd')]);router[_0xcca2('0xe')](_0xcca2('0x9'),auth['isAuthenticated'](),controller[_0xcca2('0xf')]);router[_0xcca2('0x10')]('/:id/delete',auth[_0xcca2('0x7')](),controller[_0xcca2('0x11')]);module[_0xcca2('0x12')]=router; \ No newline at end of file +var _0x531f=['index','/:id/download','download','post','put','/:id','delete','/:id/delete','exports','path','connect-timeout','../../config/environment','get','isAuthenticated'];(function(_0x43186d,_0x4b40ec){var _0x5f562c=function(_0x18ed7e){while(--_0x18ed7e){_0x43186d['push'](_0x43186d['shift']());}};_0x5f562c(++_0x4b40ec);}(_0x531f,0x1c9));var _0xf531=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x531f[_0xf4f343];return _0x4cda68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf531('0x0'));var timeout=require(_0xf531('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf531('0x2'));var controller=require('./squareRecording.controller');router[_0xf531('0x3')]('/',auth[_0xf531('0x4')](),controller[_0xf531('0x5')]);router[_0xf531('0x3')]('/:id',auth[_0xf531('0x4')](),controller['show']);router[_0xf531('0x3')](_0xf531('0x6'),auth[_0xf531('0x4')](),controller[_0xf531('0x7')]);router[_0xf531('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf531('0x9')](_0xf531('0xa'),auth[_0xf531('0x4')](),controller['update']);router[_0xf531('0xb')](_0xf531('0xc'),auth[_0xf531('0x4')](),controller['destroy']);module[_0xf531('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b9928dd..ef6933c 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 _0xa3c4=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x33eaca,_0x488474){var _0x28a6ce=function(_0xfe2eab){while(--_0xfe2eab){_0x33eaca['push'](_0x33eaca['shift']());}};_0x28a6ce(++_0x488474);}(_0xa3c4,0xba));var _0x4a3c=function(_0x14d83a,_0x48aae2){_0x14d83a=_0x14d83a-0x0;var _0x383cd6=_0xa3c4[_0x14d83a];return _0x383cd6;};'use strict';var Sequelize=require(_0x4a3c('0x0'));module[_0x4a3c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4a3c('0x2')]},'calleridname':{'type':Sequelize[_0x4a3c('0x2')]},'context':{'type':Sequelize[_0x4a3c('0x2')]},'extension':{'type':Sequelize[_0x4a3c('0x2')]},'priority':{'type':Sequelize[_0x4a3c('0x2')]},'accountcode':{'type':Sequelize[_0x4a3c('0x2')]},'dnid':{'type':Sequelize[_0x4a3c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x4a3c('0x2')]},'format':{'type':Sequelize[_0x4a3c('0x3')],'get':function(){var _0x2c731a='';var _0x1e20ff=this[_0x4a3c('0x4')](_0x4a3c('0x5'));if(_0x1e20ff){_0x2c731a=_0x1e20ff['substring'](_0x1e20ff[_0x4a3c('0x6')]('.'));}return _0x2c731a;}}}; \ No newline at end of file +var _0x7f9e=['VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x2e0979,_0x1d6067){var _0x486780=function(_0x11c955){while(--_0x11c955){_0x2e0979['push'](_0x2e0979['shift']());}};_0x486780(++_0x1d6067);}(_0x7f9e,0x90));var _0xe7f9=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x7f9e[_0x468b0f];return _0x3e74d9;};'use strict';var Sequelize=require(_0xe7f9('0x0'));module[_0xe7f9('0x1')]={'uniqueid':{'type':Sequelize[_0xe7f9('0x2')]},'callerid':{'type':Sequelize[_0xe7f9('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7f9('0x2')]},'extension':{'type':Sequelize[_0xe7f9('0x2')]},'priority':{'type':Sequelize[_0xe7f9('0x2')]},'accountcode':{'type':Sequelize[_0xe7f9('0x2')]},'dnid':{'type':Sequelize[_0xe7f9('0x2')]},'projectName':{'type':Sequelize[_0xe7f9('0x2')]},'saveName':{'type':Sequelize[_0xe7f9('0x2')]},'filename':{'type':Sequelize[_0xe7f9('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe7f9('0x3')],'get':function(){var _0x4ce68d='';var _0x149229=this[_0xe7f9('0x4')]('savePath');if(_0x149229){_0x4ce68d=_0x149229[_0xe7f9('0x5')](_0x149229[_0xe7f9('0x6')]('.'));}return _0x4ce68d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7851c06..cd89a2b 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 _0x6e9d=['filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','extname','unlink','download','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','type','filter','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','../../components/encryptor','uniqueid','savePath'];(function(_0x1ea853,_0x318901){var _0x4588f0=function(_0x1daa14){while(--_0x1daa14){_0x1ea853['push'](_0x1ea853['shift']());}};_0x4588f0(++_0x318901);}(_0x6e9d,0x71));var _0xd6e9=function(_0x5446e8,_0x5e7a96){_0x5446e8=_0x5446e8-0x0;var _0x43712f=_0x6e9d[_0x5446e8];return _0x43712f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd6e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6e9('0x1'));var moment=require('moment');var BPromise=require(_0xd6e9('0x2'));var Mustache=require(_0xd6e9('0x3'));var util=require(_0xd6e9('0x4'));var path=require(_0xd6e9('0x5'));var sox=require(_0xd6e9('0x6'));var csv=require(_0xd6e9('0x7'));var ejs=require(_0xd6e9('0x8'));var fs=require('fs');var _=require(_0xd6e9('0x9'));var squel=require(_0xd6e9('0xa'));var crypto=require('crypto');var jsforce=require(_0xd6e9('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6e9('0xc'));var Papa=require(_0xd6e9('0xd'));var Redis=require(_0xd6e9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6e9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6e9('0x10'))(_0xd6e9('0x11'));var utils=require(_0xd6e9('0x12'));var config=require(_0xd6e9('0x13'));var db=require(_0xd6e9('0x14'))['db'];function respondWithStatusCode(_0x3d29d9,_0x43d73c){_0x43d73c=_0x43d73c||0xcc;return function(_0x30f3bb){if(_0x30f3bb){return _0x3d29d9[_0xd6e9('0x15')](_0x43d73c);}return _0x3d29d9[_0xd6e9('0x16')](_0x43d73c)[_0xd6e9('0x17')]();};}function respondWithResult(_0x3ac047,_0x1ecfd4){_0x1ecfd4=_0x1ecfd4||0xc8;return function(_0x5cadf4){if(_0x5cadf4){return _0x3ac047[_0xd6e9('0x16')](_0x1ecfd4)[_0xd6e9('0x18')](_0x5cadf4);}};}function respondWithFilteredResult(_0x5328aa,_0x10aa46){return function(_0x200cf7){if(_0x200cf7){var _0x34bda1=_0x200cf7[_0xd6e9('0x19')],_0xb0a2d4=_0x10aa46['offset'],_0x176342=_0x10aa46['offset']+_0x10aa46[_0xd6e9('0x1a')],_0x2e27ac;if(_0x176342>=_0x34bda1){_0x176342=_0x34bda1;_0x2e27ac=0xc8;}else{_0x2e27ac=0xce;}_0x5328aa[_0xd6e9('0x16')](_0x2e27ac);return _0x5328aa[_0xd6e9('0x1b')]('Content-Range',_0xb0a2d4+'-'+_0x176342+'/'+_0x34bda1)['json'](_0x200cf7);}return null;};}function patchUpdates(_0x5ea4d0){return function(_0x1910fb){try{jsonpatch[_0xd6e9('0x1c')](_0x1910fb,_0x5ea4d0,!![]);}catch(_0x123c09){return BPromise[_0xd6e9('0x1d')](_0x123c09);}return _0x1910fb[_0xd6e9('0x1e')]();};}function saveUpdates(_0xef5eaa,_0x1d1fd3){return function(_0x109735){if(_0x109735){return _0x109735[_0xd6e9('0x1f')](_0xef5eaa)[_0xd6e9('0x20')](function(_0xe17941){return _0xe17941;});}return null;};}function removeEntity(_0xd1a50e,_0x202c8b){return function(_0x1a4774){if(_0x1a4774){return _0x1a4774[_0xd6e9('0x21')]()[_0xd6e9('0x20')](function(){_0xd1a50e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d585c,_0x344443){return function(_0x39cd85){if(!_0x39cd85){_0x5d585c[_0xd6e9('0x15')](0x194);}return _0x39cd85;};}function handleError(_0x469334,_0x49bdf5){_0x49bdf5=_0x49bdf5||0x1f4;return function(_0x87041b){logger[_0xd6e9('0x22')](_0x87041b['stack']);if(_0x87041b[_0xd6e9('0x23')]){delete _0x87041b[_0xd6e9('0x23')];}_0x469334[_0xd6e9('0x16')](_0x49bdf5)[_0xd6e9('0x24')](_0x87041b);};}exports[_0xd6e9('0x25')]=function(_0x29a78a,_0x247a30){var _0x41f579={},_0x211c65={},_0x542a58={'count':0x0,'rows':[]};var _0x274be4=_[_0xd6e9('0x26')](db[_0xd6e9('0x27')][_0xd6e9('0x28')],function(_0x4ad5e1){return{'name':_0x4ad5e1[_0xd6e9('0x29')],'type':_0x4ad5e1['type'][_0xd6e9('0x2a')]};});_0x211c65[_0xd6e9('0x2b')]=_[_0xd6e9('0x26')](_0x274be4,'name');_0x211c65[_0xd6e9('0x2c')]=_[_0xd6e9('0x2d')](_0x29a78a['query']);_0x211c65[_0xd6e9('0x2e')]=_['intersection'](_0x211c65[_0xd6e9('0x2b')],_0x211c65[_0xd6e9('0x2c')]);_0x41f579[_0xd6e9('0x2f')]=_[_0xd6e9('0x30')](_0x211c65['model'],qs[_0xd6e9('0x31')](_0x29a78a[_0xd6e9('0x2c')][_0xd6e9('0x31')]));_0x41f579['attributes']=_0x41f579[_0xd6e9('0x2f')][_0xd6e9('0x32')]?_0x41f579[_0xd6e9('0x2f')]:_0x211c65[_0xd6e9('0x2b')];if(!_0x29a78a['query'][_0xd6e9('0x33')](_0xd6e9('0x34'))){_0x41f579[_0xd6e9('0x1a')]=qs[_0xd6e9('0x1a')](_0x29a78a[_0xd6e9('0x2c')][_0xd6e9('0x1a')]);_0x41f579[_0xd6e9('0x35')]=qs[_0xd6e9('0x35')](_0x29a78a[_0xd6e9('0x2c')][_0xd6e9('0x35')]);}_0x41f579['order']=qs[_0xd6e9('0x36')](_0x29a78a['query']['sort']);_0x41f579[_0xd6e9('0x37')]=qs[_0xd6e9('0x2e')](_[_0xd6e9('0x38')](_0x29a78a[_0xd6e9('0x2c')],_0x211c65['filters']),_0x274be4);if(_0x29a78a[_0xd6e9('0x2c')]['filter']){_0x41f579[_0xd6e9('0x37')]=_['merge'](_0x41f579[_0xd6e9('0x37')],{'$or':_[_0xd6e9('0x26')](_0x274be4,function(_0x3caba9){if(_0x3caba9[_0xd6e9('0x39')]!=='VIRTUAL'){var _0xb7f34a={};_0xb7f34a[_0x3caba9[_0xd6e9('0x23')]]={'$like':'%'+_0x29a78a[_0xd6e9('0x2c')][_0xd6e9('0x3a')]+'%'};return _0xb7f34a;}})});}_0x41f579=_['merge']({},_0x41f579,_0x29a78a[_0xd6e9('0x3b')]);var _0x464da7={'where':_0x41f579[_0xd6e9('0x37')]};return db[_0xd6e9('0x27')][_0xd6e9('0x19')](_0x464da7)[_0xd6e9('0x20')](function(_0x24b0d0){_0x542a58[_0xd6e9('0x19')]=_0x24b0d0;if(_0x29a78a['query'][_0xd6e9('0x3c')]){_0x41f579[_0xd6e9('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0xd6e9('0x3e')](_0x41f579);})[_0xd6e9('0x20')](function(_0x347454){_0x542a58['rows']=_0x347454;return _0x542a58;})[_0xd6e9('0x20')](respondWithFilteredResult(_0x247a30,_0x41f579))[_0xd6e9('0x3f')](handleError(_0x247a30,null));};exports[_0xd6e9('0x40')]=function(_0x342196,_0x4ba98a){var _0x36d74f={'raw':!![],'where':{'id':_0x342196[_0xd6e9('0x41')]['id']}},_0x2b40ee={};_0x2b40ee['model']=_[_0xd6e9('0x2d')](db[_0xd6e9('0x27')]['rawAttributes']);_0x2b40ee['query']=_['keys'](_0x342196[_0xd6e9('0x2c')]);_0x2b40ee[_0xd6e9('0x2e')]=_[_0xd6e9('0x30')](_0x2b40ee[_0xd6e9('0x2b')],_0x2b40ee[_0xd6e9('0x2c')]);_0x36d74f[_0xd6e9('0x2f')]=_[_0xd6e9('0x30')](_0x2b40ee[_0xd6e9('0x2b')],qs[_0xd6e9('0x31')](_0x342196[_0xd6e9('0x2c')][_0xd6e9('0x31')]));_0x36d74f[_0xd6e9('0x2f')]=_0x36d74f[_0xd6e9('0x2f')]['length']?_0x36d74f[_0xd6e9('0x2f')]:_0x2b40ee[_0xd6e9('0x2b')];if(_0x342196[_0xd6e9('0x2c')][_0xd6e9('0x3c')]){_0x36d74f[_0xd6e9('0x3d')]=[{'all':!![]}];}_0x36d74f=_[_0xd6e9('0x42')]({},_0x36d74f,_0x342196[_0xd6e9('0x3b')]);return db[_0xd6e9('0x27')][_0xd6e9('0x43')](_0x36d74f)['then'](handleEntityNotFound(_0x4ba98a,null))['then'](respondWithResult(_0x4ba98a,null))[_0xd6e9('0x3f')](handleError(_0x4ba98a,null));};exports['create']=function(_0x2834a6,_0x5f407b){return db['SquareRecording'][_0xd6e9('0x44')](_0x2834a6[_0xd6e9('0x45')],{})[_0xd6e9('0x20')](respondWithResult(_0x5f407b,0xc9))['catch'](handleError(_0x5f407b,null));};exports[_0xd6e9('0x1f')]=function(_0x4763cf,_0x1496b8){if(_0x4763cf['body']['id']){delete _0x4763cf[_0xd6e9('0x45')]['id'];}return db[_0xd6e9('0x27')][_0xd6e9('0x43')]({'where':{'id':_0x4763cf[_0xd6e9('0x41')]['id']}})[_0xd6e9('0x20')](handleEntityNotFound(_0x1496b8,null))[_0xd6e9('0x20')](saveUpdates(_0x4763cf['body'],null))['then'](respondWithResult(_0x1496b8,null))[_0xd6e9('0x3f')](handleError(_0x1496b8,null));};exports['download']=function(_0x36db8d,_0x16f56b,_0x48f602){var _0x3bc931=require(_0xd6e9('0x46'));var _0x451997=![];var _0x3b408c={};if(_0x36db8d['query'][_0xd6e9('0x39')]&&_0x36db8d[_0xd6e9('0x2c')][_0xd6e9('0x39')]===_0xd6e9('0x47')){_0x3b408c['uniqueid']=_0x36db8d[_0xd6e9('0x41')]['id'];}else{_0x3b408c['id']=_0x36db8d[_0xd6e9('0x41')]['id'];}return db['SquareRecording']['find']({'where':_0x3b408c,'attributes':['id',_0xd6e9('0x48'),_0xd6e9('0x49')],'raw':!![]})[_0xd6e9('0x20')](handleEntityNotFound(_0x16f56b,null))[_0xd6e9('0x20')](function(_0x5b2a4d){if(_0x5b2a4d){var _0x15fc11=_0x5b2a4d[_0xd6e9('0x48')];var _0x80923f=util[_0xd6e9('0x4a')](_0xd6e9('0x4b'),_0x15fc11);if(fs[_0xd6e9('0x4c')](_0x80923f)){_0x451997=!![];return _0x3bc931[_0xd6e9('0x4d')](_0x80923f,_0x15fc11,config[_0xd6e9('0x4e')][_0xd6e9('0x4f')])[_0xd6e9('0x20')](function(){return _0x5b2a4d;});}return _0x5b2a4d;}})['then'](function(_0x1710d5){if(_0x1710d5){var _0xaa3c00=_0x1710d5[_0xd6e9('0x48')];if(!fs['existsSync'](_0xaa3c00)){throw new db[(_0xd6e9('0x50'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x1710d5[_0xd6e9('0x49')]){return _0x16f56b['download'](_0xaa3c00,_0x1710d5[_0xd6e9('0x49')]+path[_0xd6e9('0x51')](_0xaa3c00),function(){if(_0x451997){fs[_0xd6e9('0x52')](_0xaa3c00);}});}else{return _0x16f56b[_0xd6e9('0x53')](_0xaa3c00,function(_0x1194b8){if(_0x451997){fs[_0xd6e9('0x52')](_0xaa3c00);}});}}})[_0xd6e9('0x3f')](function(_0x5476ab){if(_0x5476ab[_0xd6e9('0x54')]==='SquareRecording\x20not\x20found'){_0x16f56b['status'](0x194)[_0xd6e9('0x24')](_0xd6e9('0x55'));}else{return handleError(_0x16f56b,null);}});};exports[_0xd6e9('0x21')]=function(_0x2dcc4c,_0x5c1a78){return db[_0xd6e9('0x27')]['find']({'where':{'id':_0x2dcc4c[_0xd6e9('0x41')]['id']}})[_0xd6e9('0x20')](function(_0x540ff2){if(!_0x540ff2)throw new ReferenceError('Entity\x20not\x20found');return _0x540ff2;})[_0xd6e9('0x20')](function(_0x227277){var _0x2a9dd0=_0x227277[_0xd6e9('0x48')];logger['info'](_0xd6e9('0x56'),_0x2a9dd0);if(!_[_0xd6e9('0x57')](_0x227277[_0xd6e9('0x48')])&&fs[_0xd6e9('0x4c')](_0x2a9dd0)){logger[_0xd6e9('0x58')]('File:\x20\x22'+_0x2a9dd0+_0xd6e9('0x59'));fs[_0xd6e9('0x5a')](_0x2a9dd0);}_0x2a9dd0=_0x2a9dd0+_0xd6e9('0x5b');if(!_[_0xd6e9('0x57')](_0x227277[_0xd6e9('0x48')])&&fs[_0xd6e9('0x4c')](_0x2a9dd0)){logger[_0xd6e9('0x58')](_0xd6e9('0x5c')+_0x2a9dd0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd6e9('0x5a')](_0x2a9dd0);}return _0x227277;})[_0xd6e9('0x20')](function(_0x19c8ce){if(!_0x19c8ce)throw new InternalError();return _0x19c8ce[_0xd6e9('0x21')]();})['then'](function(){_0x5c1a78[_0xd6e9('0x16')](0xcc)[_0xd6e9('0x17')]();})[_0xd6e9('0x3f')](handleError(_0x5c1a78,null));}; \ No newline at end of file +var _0x308e=['info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','secrets','recording','existsSync','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0x308e,0x187));var _0xe308=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x308e[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require(_0xe308('0x0'));var emlformat=require(_0xe308('0x1'));var rimraf=require(_0xe308('0x2'));var zipdir=require(_0xe308('0x3'));var jsonpatch=require(_0xe308('0x4'));var rp=require('request-promise');var moment=require(_0xe308('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe308('0x6'));var util=require('util');var path=require(_0xe308('0x7'));var sox=require(_0xe308('0x8'));var csv=require(_0xe308('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe308('0xa'));var squel=require(_0xe308('0xb'));var crypto=require('crypto');var jsforce=require(_0xe308('0xc'));var deskjs=require(_0xe308('0xd'));var toCsv=require(_0xe308('0x9'));var querystring=require(_0xe308('0xe'));var Papa=require('papaparse');var Redis=require(_0xe308('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe308('0x10'));var as=require(_0xe308('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe308('0x12'))(_0xe308('0x13'));var utils=require('../../config/utils');var config=require(_0xe308('0x14'));var db=require(_0xe308('0x15'))['db'];function respondWithStatusCode(_0x4efd12,_0x5582f8){_0x5582f8=_0x5582f8||0xcc;return function(_0x5b4b15){if(_0x5b4b15){return _0x4efd12[_0xe308('0x16')](_0x5582f8);}return _0x4efd12[_0xe308('0x17')](_0x5582f8)[_0xe308('0x18')]();};}function respondWithResult(_0x57cf15,_0x3de5db){_0x3de5db=_0x3de5db||0xc8;return function(_0x57ac81){if(_0x57ac81){return _0x57cf15[_0xe308('0x17')](_0x3de5db)['json'](_0x57ac81);}};}function respondWithFilteredResult(_0x49379c,_0x2b50d1){return function(_0xa71cda){if(_0xa71cda){var _0x56c4c0=_0xa71cda[_0xe308('0x19')],_0x478607=_0x2b50d1[_0xe308('0x1a')],_0x489ba0=_0x2b50d1[_0xe308('0x1a')]+_0x2b50d1[_0xe308('0x1b')],_0x1c664c;if(_0x489ba0>=_0x56c4c0){_0x489ba0=_0x56c4c0;_0x1c664c=0xc8;}else{_0x1c664c=0xce;}_0x49379c[_0xe308('0x17')](_0x1c664c);return _0x49379c[_0xe308('0x1c')](_0xe308('0x1d'),_0x478607+'-'+_0x489ba0+'/'+_0x56c4c0)[_0xe308('0x1e')](_0xa71cda);}return null;};}function patchUpdates(_0x303d08){return function(_0x2b87bc){try{jsonpatch[_0xe308('0x1f')](_0x2b87bc,_0x303d08,!![]);}catch(_0x6e3402){return BPromise[_0xe308('0x20')](_0x6e3402);}return _0x2b87bc['save']();};}function saveUpdates(_0x27e019,_0x193d7f){return function(_0x1479d8){if(_0x1479d8){return _0x1479d8['update'](_0x27e019)['then'](function(_0x5b96d7){return _0x5b96d7;});}return null;};}function removeEntity(_0x375470,_0x1298e1){return function(_0x346d7b){if(_0x346d7b){return _0x346d7b[_0xe308('0x21')]()[_0xe308('0x22')](function(){_0x375470[_0xe308('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x562642,_0x40119d){return function(_0x316364){if(!_0x316364){_0x562642['sendStatus'](0x194);}return _0x316364;};}function handleError(_0xa44e74,_0x2c1527){_0x2c1527=_0x2c1527||0x1f4;return function(_0x70af23){logger[_0xe308('0x23')](_0x70af23[_0xe308('0x24')]);if(_0x70af23[_0xe308('0x25')]){delete _0x70af23['name'];}_0xa44e74[_0xe308('0x17')](_0x2c1527)[_0xe308('0x26')](_0x70af23);};}exports[_0xe308('0x27')]=function(_0x3aa414,_0x16ce8f){var _0xc6c193={},_0x3cbdfd={},_0x2b9dfe={'count':0x0,'rows':[]};var _0xd2a735=_[_0xe308('0x28')](db[_0xe308('0x29')][_0xe308('0x2a')],function(_0x4a75c8){return{'name':_0x4a75c8[_0xe308('0x2b')],'type':_0x4a75c8[_0xe308('0x2c')][_0xe308('0x2d')]};});_0x3cbdfd[_0xe308('0x2e')]=_[_0xe308('0x28')](_0xd2a735,'name');_0x3cbdfd[_0xe308('0x2f')]=_[_0xe308('0x30')](_0x3aa414[_0xe308('0x2f')]);_0x3cbdfd[_0xe308('0x31')]=_[_0xe308('0x32')](_0x3cbdfd['model'],_0x3cbdfd['query']);_0xc6c193['attributes']=_[_0xe308('0x32')](_0x3cbdfd[_0xe308('0x2e')],qs[_0xe308('0x33')](_0x3aa414['query'][_0xe308('0x33')]));_0xc6c193[_0xe308('0x34')]=_0xc6c193['attributes'][_0xe308('0x35')]?_0xc6c193[_0xe308('0x34')]:_0x3cbdfd[_0xe308('0x2e')];if(!_0x3aa414[_0xe308('0x2f')][_0xe308('0x36')](_0xe308('0x37'))){_0xc6c193[_0xe308('0x1b')]=qs[_0xe308('0x1b')](_0x3aa414['query']['limit']);_0xc6c193['offset']=qs['offset'](_0x3aa414[_0xe308('0x2f')]['offset']);}_0xc6c193['order']=qs[_0xe308('0x38')](_0x3aa414[_0xe308('0x2f')][_0xe308('0x38')]);_0xc6c193[_0xe308('0x39')]=qs[_0xe308('0x31')](_[_0xe308('0x3a')](_0x3aa414['query'],_0x3cbdfd[_0xe308('0x31')]),_0xd2a735);if(_0x3aa414[_0xe308('0x2f')][_0xe308('0x3b')]){_0xc6c193[_0xe308('0x39')]=_[_0xe308('0x3c')](_0xc6c193['where'],{'$or':_[_0xe308('0x28')](_0xd2a735,function(_0x2be1bc){if(_0x2be1bc[_0xe308('0x2c')]!==_0xe308('0x3d')){var _0x58ce5b={};_0x58ce5b[_0x2be1bc[_0xe308('0x25')]]={'$like':'%'+_0x3aa414[_0xe308('0x2f')][_0xe308('0x3b')]+'%'};return _0x58ce5b;}})});}_0xc6c193=_[_0xe308('0x3c')]({},_0xc6c193,_0x3aa414[_0xe308('0x3e')]);var _0x55d80b={'where':_0xc6c193[_0xe308('0x39')]};return db[_0xe308('0x29')][_0xe308('0x19')](_0x55d80b)[_0xe308('0x22')](function(_0x1f3835){_0x2b9dfe[_0xe308('0x19')]=_0x1f3835;if(_0x3aa414[_0xe308('0x2f')]['includeAll']){_0xc6c193['include']=[{'all':!![]}];}return db['SquareRecording'][_0xe308('0x3f')](_0xc6c193);})[_0xe308('0x22')](function(_0x57a118){_0x2b9dfe[_0xe308('0x40')]=_0x57a118;return _0x2b9dfe;})[_0xe308('0x22')](respondWithFilteredResult(_0x16ce8f,_0xc6c193))[_0xe308('0x41')](handleError(_0x16ce8f,null));};exports[_0xe308('0x42')]=function(_0x5f4d5d,_0x177b5e){var _0x10d40b={'raw':!![],'where':{'id':_0x5f4d5d[_0xe308('0x43')]['id']}},_0x171b5a={};_0x171b5a[_0xe308('0x2e')]=_[_0xe308('0x30')](db[_0xe308('0x29')][_0xe308('0x2a')]);_0x171b5a['query']=_[_0xe308('0x30')](_0x5f4d5d[_0xe308('0x2f')]);_0x171b5a['filters']=_[_0xe308('0x32')](_0x171b5a['model'],_0x171b5a[_0xe308('0x2f')]);_0x10d40b[_0xe308('0x34')]=_[_0xe308('0x32')](_0x171b5a[_0xe308('0x2e')],qs['fields'](_0x5f4d5d[_0xe308('0x2f')][_0xe308('0x33')]));_0x10d40b[_0xe308('0x34')]=_0x10d40b[_0xe308('0x34')][_0xe308('0x35')]?_0x10d40b[_0xe308('0x34')]:_0x171b5a['model'];if(_0x5f4d5d['query'][_0xe308('0x44')]){_0x10d40b['include']=[{'all':!![]}];}_0x10d40b=_[_0xe308('0x3c')]({},_0x10d40b,_0x5f4d5d[_0xe308('0x3e')]);return db[_0xe308('0x29')][_0xe308('0x45')](_0x10d40b)[_0xe308('0x22')](handleEntityNotFound(_0x177b5e,null))[_0xe308('0x22')](respondWithResult(_0x177b5e,null))[_0xe308('0x41')](handleError(_0x177b5e,null));};exports[_0xe308('0x46')]=function(_0x55e065,_0x42b807){return db[_0xe308('0x29')][_0xe308('0x46')](_0x55e065['body'],{})[_0xe308('0x22')](respondWithResult(_0x42b807,0xc9))['catch'](handleError(_0x42b807,null));};exports[_0xe308('0x47')]=function(_0x134a2b,_0x58dcbe){if(_0x134a2b[_0xe308('0x48')]['id']){delete _0x134a2b[_0xe308('0x48')]['id'];}return db[_0xe308('0x29')][_0xe308('0x45')]({'where':{'id':_0x134a2b['params']['id']}})[_0xe308('0x22')](handleEntityNotFound(_0x58dcbe,null))['then'](saveUpdates(_0x134a2b[_0xe308('0x48')],null))[_0xe308('0x22')](respondWithResult(_0x58dcbe,null))[_0xe308('0x41')](handleError(_0x58dcbe,null));};exports[_0xe308('0x49')]=function(_0x5e36c0,_0x32d05f,_0x204454){var _0x5365f7=require(_0xe308('0x4a'));var _0x3dd212=![];var _0x449968={};if(_0x5e36c0[_0xe308('0x2f')][_0xe308('0x2c')]&&_0x5e36c0[_0xe308('0x2f')][_0xe308('0x2c')]==='uniqueid'){_0x449968[_0xe308('0x4b')]=_0x5e36c0[_0xe308('0x43')]['id'];}else{_0x449968['id']=_0x5e36c0[_0xe308('0x43')]['id'];}return db['SquareRecording'][_0xe308('0x45')]({'where':_0x449968,'attributes':['id',_0xe308('0x4c'),_0xe308('0x4d')],'raw':!![]})[_0xe308('0x22')](handleEntityNotFound(_0x32d05f,null))[_0xe308('0x22')](function(_0xa32ec8){if(_0xa32ec8){var _0xe83cfe=_0xa32ec8[_0xe308('0x4c')];var _0x4fcd43=util['format'](_0xe308('0x4e'),_0xe83cfe);if(fs['existsSync'](_0x4fcd43)){_0x3dd212=!![];return _0x5365f7[_0xe308('0x4f')](_0x4fcd43,_0xe83cfe,config[_0xe308('0x50')][_0xe308('0x51')])[_0xe308('0x22')](function(){return _0xa32ec8;});}return _0xa32ec8;}})['then'](function(_0xeb1dc1){if(_0xeb1dc1){var _0x42e9b4=_0xeb1dc1[_0xe308('0x4c')];if(!fs[_0xe308('0x52')](_0x42e9b4)){throw new db['Sequelize']['ValidationError'](_0xe308('0x53'));}if(_0xeb1dc1[_0xe308('0x4d')]){return _0x32d05f['download'](_0x42e9b4,_0xeb1dc1[_0xe308('0x4d')]+path[_0xe308('0x54')](_0x42e9b4),function(){if(_0x3dd212){fs[_0xe308('0x55')](_0x42e9b4);}});}else{return _0x32d05f[_0xe308('0x49')](_0x42e9b4,function(_0x13a889){if(_0x3dd212){fs['unlink'](_0x42e9b4);}});}}})[_0xe308('0x41')](function(_0x24320b){if(_0x24320b[_0xe308('0x56')]===_0xe308('0x53')){_0x32d05f[_0xe308('0x17')](0x194)[_0xe308('0x26')](_0xe308('0x57'));}else{return handleError(_0x32d05f,null);}});};exports[_0xe308('0x21')]=function(_0x233a08,_0xaa0d31){return db[_0xe308('0x29')][_0xe308('0x45')]({'where':{'id':_0x233a08[_0xe308('0x43')]['id']}})['then'](function(_0x4e4200){if(!_0x4e4200)throw new ReferenceError(_0xe308('0x58'));return _0x4e4200;})[_0xe308('0x22')](function(_0x2893e6){var _0x5ec0b0=_0x2893e6[_0xe308('0x4c')];logger[_0xe308('0x59')](_0xe308('0x5a'),_0x5ec0b0);if(!_['isNil'](_0x2893e6[_0xe308('0x4c')])&&fs[_0xe308('0x52')](_0x5ec0b0)){logger[_0xe308('0x59')](_0xe308('0x5b')+_0x5ec0b0+_0xe308('0x5c'));fs['unlinkSync'](_0x5ec0b0);}_0x5ec0b0=_0x5ec0b0+_0xe308('0x5d');if(!_[_0xe308('0x5e')](_0x2893e6[_0xe308('0x4c')])&&fs[_0xe308('0x52')](_0x5ec0b0)){logger[_0xe308('0x59')](_0xe308('0x5b')+_0x5ec0b0+_0xe308('0x5c'));fs[_0xe308('0x5f')](_0x5ec0b0);}return _0x2893e6;})[_0xe308('0x22')](function(_0xd171bf){if(!_0xd171bf)throw new InternalError();return _0xd171bf['destroy']();})[_0xe308('0x22')](function(){_0xaa0d31[_0xe308('0x17')](0xcc)[_0xe308('0x18')]();})['catch'](handleError(_0xaa0d31,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1e2ba8d..8d24ed6 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 _0xc6da=['request-promise','path','rimraf','../../config/environment','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47823a,_0x4a49a7){var _0x215023=function(_0x285813){while(--_0x285813){_0x47823a['push'](_0x47823a['shift']());}};_0x215023(++_0x4a49a7);}(_0xc6da,0xe4));var _0xac6d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc6da[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xac6d('0x0'));var util=require(_0xac6d('0x1'));var logger=require(_0xac6d('0x2'))(_0xac6d('0x3'));var moment=require(_0xac6d('0x4'));var BPromise=require(_0xac6d('0x5'));var rp=require(_0xac6d('0x6'));var fs=require('fs');var path=require(_0xac6d('0x7'));var rimraf=require(_0xac6d('0x8'));var config=require(_0xac6d('0x9'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0xf9d23c,_0x1f1d1b){return _0xf9d23c[_0xac6d('0xa')](_0xac6d('0xb'),attributes,{'tableName':_0xac6d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79b0=['api','moment','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x543b08,_0x36bcfc){var _0x1e08e4=function(_0x3bf864){while(--_0x3bf864){_0x543b08['push'](_0x543b08['shift']());}};_0x1e08e4(++_0x36bcfc);}(_0x79b0,0x1ad));var _0x079b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x79b0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x079b('0x0'));var util=require(_0x079b('0x1'));var logger=require(_0x079b('0x2'))(_0x079b('0x3'));var moment=require(_0x079b('0x4'));var BPromise=require('bluebird');var rp=require(_0x079b('0x5'));var fs=require('fs');var path=require(_0x079b('0x6'));var rimraf=require('rimraf');var config=require(_0x079b('0x7'));var attributes=require('./squareRecording.attributes');module[_0x079b('0x8')]=function(_0x1feadc,_0x588203){return _0x1feadc[_0x079b('0x9')](_0x079b('0xa'),attributes,{'tableName':_0x079b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 29d0319..ec88eff 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 _0xbff1=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','jayson/promise','client','http'];(function(_0x4faf15,_0x367d4e){var _0x16c0b5=function(_0x2e55a5){while(--_0x2e55a5){_0x4faf15['push'](_0x4faf15['shift']());}};_0x16c0b5(++_0x367d4e);}(_0xbff1,0x1c4));var _0x1bff=function(_0x5cd66b,_0x456626){_0x5cd66b=_0x5cd66b-0x0;var _0x212c9e=_0xbff1[_0x5cd66b];return _0x212c9e;};'use strict';var _=require(_0x1bff('0x0'));var util=require('util');var moment=require(_0x1bff('0x1'));var BPromise=require(_0x1bff('0x2'));var rs=require(_0x1bff('0x3'));var fs=require('fs');var Redis=require(_0x1bff('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1bff('0x5'));var client=jayson[_0x1bff('0x6')][_0x1bff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33dac1,_0x129afd,_0x1c33f8){return new BPromise(function(_0x1cff03,_0x40d42b){return client['request'](_0x33dac1,_0x1c33f8)[_0x1bff('0x8')](function(_0x4c8331){logger[_0x1bff('0x9')](_0x1bff('0xa'),_0x129afd,_0x1bff('0xb'));logger[_0x1bff('0xc')](_0x1bff('0xd'),_0x129afd,_0x1bff('0xb'),JSON[_0x1bff('0xe')](_0x4c8331));if(_0x4c8331[_0x1bff('0xf')]){if(_0x4c8331['error'][_0x1bff('0x10')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x129afd,_0x4c8331[_0x1bff('0xf')][_0x1bff('0x11')]);return _0x40d42b(_0x4c8331['error'][_0x1bff('0x11')]);}logger[_0x1bff('0xf')](_0x1bff('0xa'),_0x129afd,_0x4c8331[_0x1bff('0xf')][_0x1bff('0x11')]);return _0x1cff03(_0x4c8331[_0x1bff('0xf')][_0x1bff('0x11')]);}else{logger[_0x1bff('0x9')](_0x1bff('0xa'),_0x129afd,_0x1bff('0xb'));_0x1cff03(_0x4c8331['result'][_0x1bff('0x11')]);}})['catch'](function(_0x5b2252){logger[_0x1bff('0xf')](_0x1bff('0xa'),_0x129afd,_0x5b2252);_0x40d42b(_0x5b2252);});});}exports[_0x1bff('0x12')]=function(_0x25d5c0){var _0x573cbf=this;return new Promise(function(_0x1da52d,_0x1b4307){return db['SquareRecording'][_0x1bff('0x13')](_0x25d5c0[_0x1bff('0x14')],{'raw':_0x25d5c0['options']?_0x25d5c0[_0x1bff('0x15')][_0x1bff('0x16')]===undefined?!![]:![]:!![]})[_0x1bff('0x8')](function(_0x588c4c){logger[_0x1bff('0x9')](_0x1bff('0x12'),_0x25d5c0);logger[_0x1bff('0xc')](_0x1bff('0x12'),_0x25d5c0,JSON[_0x1bff('0xe')](_0x588c4c));_0x1da52d(_0x588c4c);})['catch'](function(_0x1a8c65){logger[_0x1bff('0xf')](_0x1bff('0x12'),_0x1a8c65[_0x1bff('0x11')],_0x25d5c0);_0x1b4307(_0x573cbf[_0x1bff('0xf')](0x1f4,_0x1a8c65[_0x1bff('0x11')]));});});}; \ No newline at end of file +var _0x2804=['options','raw','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','info','result','catch','CreateSquareRecording','SquareRecording','body'];(function(_0x4d1de7,_0x5c5fed){var _0x28ae8a=function(_0x2fc7e6){while(--_0x2fc7e6){_0x4d1de7['push'](_0x4d1de7['shift']());}};_0x28ae8a(++_0x5c5fed);}(_0x2804,0x16c));var _0x4280=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4280('0x0'));var util=require(_0x4280('0x1'));var moment=require('moment');var BPromise=require(_0x4280('0x2'));var rs=require(_0x4280('0x3'));var fs=require('fs');var Redis=require(_0x4280('0x4'));var db=require(_0x4280('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4280('0x6'))(_0x4280('0x7'));var config=require(_0x4280('0x8'));var jayson=require(_0x4280('0x9'));var client=jayson[_0x4280('0xa')][_0x4280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x522e42,_0x3d7c51,_0x3cd6c1){return new BPromise(function(_0x2f796e,_0x253ee8){return client[_0x4280('0xc')](_0x522e42,_0x3cd6c1)[_0x4280('0xd')](function(_0x8d4323){logger['info']('SquareRecording,\x20%s,\x20%s',_0x3d7c51,_0x4280('0xe'));logger['debug'](_0x4280('0xf'),_0x3d7c51,_0x4280('0xe'),JSON['stringify'](_0x8d4323));if(_0x8d4323[_0x4280('0x10')]){if(_0x8d4323[_0x4280('0x10')][_0x4280('0x11')]===0x1f4){logger[_0x4280('0x10')](_0x4280('0x12'),_0x3d7c51,_0x8d4323[_0x4280('0x10')]['message']);return _0x253ee8(_0x8d4323['error'][_0x4280('0x13')]);}logger[_0x4280('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3d7c51,_0x8d4323['error'][_0x4280('0x13')]);return _0x2f796e(_0x8d4323[_0x4280('0x10')]['message']);}else{logger[_0x4280('0x14')](_0x4280('0x12'),_0x3d7c51,_0x4280('0xe'));_0x2f796e(_0x8d4323[_0x4280('0x15')][_0x4280('0x13')]);}})[_0x4280('0x16')](function(_0x510e5f){logger['error'](_0x4280('0x12'),_0x3d7c51,_0x510e5f);_0x253ee8(_0x510e5f);});});}exports[_0x4280('0x17')]=function(_0x442cb6){var _0x2ba7d0=this;return new Promise(function(_0x1699a2,_0x484a86){return db[_0x4280('0x18')]['create'](_0x442cb6[_0x4280('0x19')],{'raw':_0x442cb6['options']?_0x442cb6[_0x4280('0x1a')][_0x4280('0x1b')]===undefined?!![]:![]:!![]})[_0x4280('0xd')](function(_0x2d1938){logger['info'](_0x4280('0x17'),_0x442cb6);logger[_0x4280('0x1c')](_0x4280('0x17'),_0x442cb6,JSON[_0x4280('0x1d')](_0x2d1938));_0x1699a2(_0x2d1938);})[_0x4280('0x16')](function(_0x55ad83){logger[_0x4280('0x10')](_0x4280('0x17'),_0x55ad83[_0x4280('0x13')],_0x442cb6);_0x484a86(_0x2ba7d0[_0x4280('0x10')](0x1f4,_0x55ad83[_0x4280('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 90b8d8d..a001c16 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 _0x3b0c=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','index','/describe','/:id','show','post','create','isAuthenticated','update','delete','destroy','exports'];(function(_0x49c699,_0x314403){var _0x2853ea=function(_0x68ceb9){while(--_0x68ceb9){_0x49c699['push'](_0x49c699['shift']());}};_0x2853ea(++_0x314403);}(_0x3b0c,0x1c8));var _0xc3b0=function(_0x37b159,_0x377c84){_0x37b159=_0x37b159-0x0;var _0x2fa2c3=_0x3b0c[_0x37b159];return _0x2fa2c3;};'use strict';var multer=require('multer');var util=require(_0xc3b0('0x0'));var path=require('path');var timeout=require(_0xc3b0('0x1'));var express=require(_0xc3b0('0x2'));var router=express[_0xc3b0('0x3')]();var auth=require(_0xc3b0('0x4'));var interaction=require(_0xc3b0('0x5'));var config=require('../../config/environment');var controller=require(_0xc3b0('0x6'));router[_0xc3b0('0x7')]('/',auth['isAuthenticated'](),controller[_0xc3b0('0x8')]);router[_0xc3b0('0x7')](_0xc3b0('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xc3b0('0x7')](_0xc3b0('0xa'),auth['isAuthenticated'](),controller[_0xc3b0('0xb')]);router[_0xc3b0('0xc')]('/',auth['isAuthenticated'](),controller[_0xc3b0('0xd')]);router['put'](_0xc3b0('0xa'),auth[_0xc3b0('0xe')](),controller[_0xc3b0('0xf')]);router[_0xc3b0('0x10')](_0xc3b0('0xa'),auth[_0xc3b0('0xe')](),controller[_0xc3b0('0x11')]);module[_0xc3b0('0x12')]=router; \ No newline at end of file +var _0xf5f0=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x5e9bbd,_0x4b43cd){var _0xc7828d=function(_0x7a6a5c){while(--_0x7a6a5c){_0x5e9bbd['push'](_0x5e9bbd['shift']());}};_0xc7828d(++_0x4b43cd);}(_0xf5f0,0x171));var _0x0f5f=function(_0x592a18,_0x20d4dd){_0x592a18=_0x592a18-0x0;var _0x34ccb9=_0xf5f0[_0x592a18];return _0x34ccb9;};'use strict';var multer=require(_0x0f5f('0x0'));var util=require(_0x0f5f('0x1'));var path=require(_0x0f5f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f5f('0x3'));var router=express[_0x0f5f('0x4')]();var auth=require(_0x0f5f('0x5'));var interaction=require(_0x0f5f('0x6'));var config=require(_0x0f5f('0x7'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0f5f('0x8')](),controller[_0x0f5f('0x9')]);router['get'](_0x0f5f('0xa'),auth[_0x0f5f('0x8')](),controller[_0x0f5f('0xb')]);router[_0x0f5f('0xc')](_0x0f5f('0xd'),auth[_0x0f5f('0x8')](),controller[_0x0f5f('0xe')]);router[_0x0f5f('0xf')]('/',auth[_0x0f5f('0x8')](),controller[_0x0f5f('0x10')]);router[_0x0f5f('0x11')](_0x0f5f('0xd'),auth[_0x0f5f('0x8')](),controller[_0x0f5f('0x12')]);router[_0x0f5f('0x13')](_0x0f5f('0xd'),auth[_0x0f5f('0x8')](),controller[_0x0f5f('0x14')]);module[_0x0f5f('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 42d5788..d37b6a6 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 _0x8873=['STRING','DATE'];(function(_0x49ee70,_0x115b1e){var _0x3a7254=function(_0x1bc688){while(--_0x1bc688){_0x49ee70['push'](_0x49ee70['shift']());}};_0x3a7254(++_0x115b1e);}(_0x8873,0x1e6));var _0x3887=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0x8873[_0x406fbb];return _0x8e921d;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x3887('0x0')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3887('0x0')]},'language':{'type':Sequelize[_0x3887('0x0')]},'type':{'type':Sequelize[_0x3887('0x0')]},'uniqueid':{'type':Sequelize[_0x3887('0x0')]},'version':{'type':Sequelize[_0x3887('0x0')]},'callerid':{'type':Sequelize[_0x3887('0x0')]},'calleridname':{'type':Sequelize[_0x3887('0x0')]},'callingpres':{'type':Sequelize[_0x3887('0x0')]},'callingani2':{'type':Sequelize[_0x3887('0x0')]},'callington':{'type':Sequelize[_0x3887('0x0')]},'callingtns':{'type':Sequelize[_0x3887('0x0')]},'dnid':{'type':Sequelize[_0x3887('0x0')]},'rdnis':{'type':Sequelize[_0x3887('0x0')]},'context':{'type':Sequelize[_0x3887('0x0')]},'extension':{'type':Sequelize[_0x3887('0x0')]},'priority':{'type':Sequelize[_0x3887('0x0')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3887('0x0')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3887('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x006b=['exports','STRING','DATE','BOOLEAN'];(function(_0x261bcb,_0x52b65a){var _0x5de730=function(_0x5d1e11){while(--_0x5d1e11){_0x261bcb['push'](_0x261bcb['shift']());}};_0x5de730(++_0x52b65a);}(_0x006b,0xbc));var _0xb006=function(_0x4a0b63,_0x1b9603){_0x4a0b63=_0x4a0b63-0x0;var _0x3bdfdd=_0x006b[_0x4a0b63];return _0x3bdfdd;};'use strict';var Sequelize=require('sequelize');module[_0xb006('0x0')]={'network':{'type':Sequelize[_0xb006('0x1')]},'network_script':{'type':Sequelize[_0xb006('0x1')]},'request':{'type':Sequelize[_0xb006('0x1')]},'channel':{'type':Sequelize[_0xb006('0x1')]},'language':{'type':Sequelize[_0xb006('0x1')]},'type':{'type':Sequelize[_0xb006('0x1')]},'uniqueid':{'type':Sequelize[_0xb006('0x1')]},'version':{'type':Sequelize[_0xb006('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb006('0x1')]},'callingpres':{'type':Sequelize[_0xb006('0x1')]},'callingani2':{'type':Sequelize[_0xb006('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb006('0x1')]},'dnid':{'type':Sequelize[_0xb006('0x1')]},'rdnis':{'type':Sequelize[_0xb006('0x1')]},'context':{'type':Sequelize[_0xb006('0x1')]},'extension':{'type':Sequelize[_0xb006('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xb006('0x1')]},'accountcode':{'type':Sequelize[_0xb006('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xb006('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb006('0x2')]},'bot':{'type':Sequelize[_0xb006('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 4c4c3b9..bc6b034 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 _0xead5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','params','filters','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4ca536,_0x57c8de){var _0x3bd35f=function(_0x26d91d){while(--_0x26d91d){_0x4ca536['push'](_0x4ca536['shift']());}};_0x3bd35f(++_0x57c8de);}(_0xead5,0xce));var _0x5ead=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xead5[_0x8c1005];return _0x175354;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ead('0x0'));var rimraf=require(_0x5ead('0x1'));var zipdir=require(_0x5ead('0x2'));var jsonpatch=require(_0x5ead('0x3'));var rp=require(_0x5ead('0x4'));var moment=require(_0x5ead('0x5'));var BPromise=require(_0x5ead('0x6'));var Mustache=require(_0x5ead('0x7'));var util=require(_0x5ead('0x8'));var path=require(_0x5ead('0x9'));var sox=require('sox');var csv=require(_0x5ead('0xa'));var ejs=require(_0x5ead('0xb'));var fs=require('fs');var _=require(_0x5ead('0xc'));var squel=require(_0x5ead('0xd'));var crypto=require(_0x5ead('0xe'));var jsforce=require(_0x5ead('0xf'));var deskjs=require(_0x5ead('0x10'));var toCsv=require(_0x5ead('0xa'));var querystring=require(_0x5ead('0x11'));var Papa=require(_0x5ead('0x12'));var Redis=require(_0x5ead('0x13'));var authService=require(_0x5ead('0x14'));var qs=require(_0x5ead('0x15'));var as=require(_0x5ead('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5ead('0x17'));var utils=require(_0x5ead('0x18'));var config=require(_0x5ead('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ccbd6,_0x3ddad6){_0x3ddad6=_0x3ddad6||0xcc;return function(_0x1a54f4){if(_0x1a54f4){return _0x4ccbd6[_0x5ead('0x1a')](_0x3ddad6);}return _0x4ccbd6[_0x5ead('0x1b')](_0x3ddad6)['end']();};}function respondWithResult(_0xec4010,_0x27095e){_0x27095e=_0x27095e||0xc8;return function(_0x3922e6){if(_0x3922e6){return _0xec4010[_0x5ead('0x1b')](_0x27095e)[_0x5ead('0x1c')](_0x3922e6);}};}function respondWithFilteredResult(_0x44a99d,_0x3fb79f){return function(_0x1b6f41){if(_0x1b6f41){var _0x2bab1c=_0x1b6f41[_0x5ead('0x1d')],_0x2a6152=_0x3fb79f[_0x5ead('0x1e')],_0x5a759c=_0x3fb79f[_0x5ead('0x1e')]+_0x3fb79f[_0x5ead('0x1f')],_0x112f8f;if(_0x5a759c>=_0x2bab1c){_0x5a759c=_0x2bab1c;_0x112f8f=0xc8;}else{_0x112f8f=0xce;}_0x44a99d[_0x5ead('0x1b')](_0x112f8f);return _0x44a99d[_0x5ead('0x20')](_0x5ead('0x21'),_0x2a6152+'-'+_0x5a759c+'/'+_0x2bab1c)[_0x5ead('0x1c')](_0x1b6f41);}return null;};}function patchUpdates(_0x14d7a0){return function(_0x39ca3c){try{jsonpatch[_0x5ead('0x22')](_0x39ca3c,_0x14d7a0,!![]);}catch(_0x1ce51f){return BPromise[_0x5ead('0x23')](_0x1ce51f);}return _0x39ca3c[_0x5ead('0x24')]();};}function saveUpdates(_0x457c3a,_0x2674df){return function(_0x3cd5a0){if(_0x3cd5a0){return _0x3cd5a0[_0x5ead('0x25')](_0x457c3a)['then'](function(_0x27d23f){return _0x27d23f;});}return null;};}function removeEntity(_0x4e7da7,_0x1e5aca){return function(_0x1367f3){if(_0x1367f3){return _0x1367f3[_0x5ead('0x26')]()[_0x5ead('0x27')](function(){_0x4e7da7[_0x5ead('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6d8d,_0x3aa8cc){return function(_0x46223d){if(!_0x46223d){_0x4f6d8d['sendStatus'](0x194);}return _0x46223d;};}function handleError(_0x16532f,_0x33cffd){_0x33cffd=_0x33cffd||0x1f4;return function(_0x3b83b3){logger[_0x5ead('0x28')](_0x3b83b3[_0x5ead('0x29')]);if(_0x3b83b3[_0x5ead('0x2a')]){delete _0x3b83b3[_0x5ead('0x2a')];}_0x16532f[_0x5ead('0x1b')](_0x33cffd)[_0x5ead('0x2b')](_0x3b83b3);};}exports[_0x5ead('0x2c')]=function(_0x58ce9e,_0x26461c){var _0x676fbf={},_0x3ee343={},_0x59a4aa={'count':0x0,'rows':[]};var _0x187914=_[_0x5ead('0x2d')](db[_0x5ead('0x2e')][_0x5ead('0x2f')],function(_0x5bc8f7){return{'name':_0x5bc8f7['fieldName'],'type':_0x5bc8f7[_0x5ead('0x30')][_0x5ead('0x31')]};});_0x3ee343[_0x5ead('0x32')]=_[_0x5ead('0x2d')](_0x187914,_0x5ead('0x2a'));_0x3ee343['query']=_[_0x5ead('0x33')](_0x58ce9e[_0x5ead('0x34')]);_0x3ee343['filters']=_[_0x5ead('0x35')](_0x3ee343[_0x5ead('0x32')],_0x3ee343[_0x5ead('0x34')]);_0x676fbf[_0x5ead('0x36')]=_[_0x5ead('0x35')](_0x3ee343[_0x5ead('0x32')],qs[_0x5ead('0x37')](_0x58ce9e['query'][_0x5ead('0x37')]));_0x676fbf[_0x5ead('0x36')]=_0x676fbf[_0x5ead('0x36')][_0x5ead('0x38')]?_0x676fbf[_0x5ead('0x36')]:_0x3ee343[_0x5ead('0x32')];if(!_0x58ce9e['query'][_0x5ead('0x39')](_0x5ead('0x3a'))){_0x676fbf['limit']=qs[_0x5ead('0x1f')](_0x58ce9e[_0x5ead('0x34')]['limit']);_0x676fbf['offset']=qs[_0x5ead('0x1e')](_0x58ce9e['query'][_0x5ead('0x1e')]);}_0x676fbf[_0x5ead('0x3b')]=qs['sort'](_0x58ce9e[_0x5ead('0x34')]['sort']);_0x676fbf[_0x5ead('0x3c')]=qs['filters'](_[_0x5ead('0x3d')](_0x58ce9e[_0x5ead('0x34')],_0x3ee343['filters']),_0x187914);if(_0x58ce9e[_0x5ead('0x34')][_0x5ead('0x3e')]){_0x676fbf[_0x5ead('0x3c')]=_['merge'](_0x676fbf['where'],{'$or':_[_0x5ead('0x2d')](_0x187914,function(_0x3348ea){if(_0x3348ea[_0x5ead('0x30')]!==_0x5ead('0x3f')){var _0x56c599={};_0x56c599[_0x3348ea[_0x5ead('0x2a')]]={'$like':'%'+_0x58ce9e[_0x5ead('0x34')][_0x5ead('0x3e')]+'%'};return _0x56c599;}})});}_0x676fbf=_['merge']({},_0x676fbf,_0x58ce9e[_0x5ead('0x40')]);var _0x426b04={'where':_0x676fbf[_0x5ead('0x3c')]};return db[_0x5ead('0x2e')][_0x5ead('0x1d')](_0x426b04)[_0x5ead('0x27')](function(_0x7ef1e2){_0x59a4aa['count']=_0x7ef1e2;if(_0x58ce9e[_0x5ead('0x34')][_0x5ead('0x41')]){_0x676fbf['include']=[{'all':!![]}];}return db[_0x5ead('0x2e')][_0x5ead('0x42')](_0x676fbf);})[_0x5ead('0x27')](function(_0x1a2f6e){_0x59a4aa['rows']=_0x1a2f6e;return _0x59a4aa;})[_0x5ead('0x27')](respondWithFilteredResult(_0x26461c,_0x676fbf))[_0x5ead('0x43')](handleError(_0x26461c,null));};exports['show']=function(_0x1e0f18,_0x58949b){var _0x163182={'raw':!![],'where':{'id':_0x1e0f18[_0x5ead('0x44')]['id']}},_0x1b4101={};_0x1b4101[_0x5ead('0x32')]=_[_0x5ead('0x33')](db['SquareReport'][_0x5ead('0x2f')]);_0x1b4101[_0x5ead('0x34')]=_['keys'](_0x1e0f18[_0x5ead('0x34')]);_0x1b4101[_0x5ead('0x45')]=_[_0x5ead('0x35')](_0x1b4101[_0x5ead('0x32')],_0x1b4101['query']);_0x163182[_0x5ead('0x36')]=_[_0x5ead('0x35')](_0x1b4101[_0x5ead('0x32')],qs[_0x5ead('0x37')](_0x1e0f18[_0x5ead('0x34')][_0x5ead('0x37')]));_0x163182['attributes']=_0x163182[_0x5ead('0x36')]['length']?_0x163182[_0x5ead('0x36')]:_0x1b4101[_0x5ead('0x32')];if(_0x1e0f18[_0x5ead('0x34')][_0x5ead('0x41')]){_0x163182[_0x5ead('0x46')]=[{'all':!![]}];}_0x163182=_['merge']({},_0x163182,_0x1e0f18['options']);return db[_0x5ead('0x2e')][_0x5ead('0x47')](_0x163182)[_0x5ead('0x27')](handleEntityNotFound(_0x58949b,null))[_0x5ead('0x27')](respondWithResult(_0x58949b,null))[_0x5ead('0x43')](handleError(_0x58949b,null));};exports[_0x5ead('0x48')]=function(_0x305c5d,_0x3bf6b3){return db[_0x5ead('0x2e')][_0x5ead('0x48')](_0x305c5d['body'],{})[_0x5ead('0x27')](respondWithResult(_0x3bf6b3,0xc9))['catch'](handleError(_0x3bf6b3,null));};exports['update']=function(_0xe18c59,_0x24ed7b){if(_0xe18c59[_0x5ead('0x49')]['id']){delete _0xe18c59['body']['id'];}return db[_0x5ead('0x2e')][_0x5ead('0x47')]({'where':{'id':_0xe18c59[_0x5ead('0x44')]['id']}})[_0x5ead('0x27')](handleEntityNotFound(_0x24ed7b,null))[_0x5ead('0x27')](saveUpdates(_0xe18c59[_0x5ead('0x49')],null))['then'](respondWithResult(_0x24ed7b,null))[_0x5ead('0x43')](handleError(_0x24ed7b,null));};exports['destroy']=function(_0x4c1624,_0x1b7027){return db[_0x5ead('0x2e')][_0x5ead('0x47')]({'where':{'id':_0x4c1624[_0x5ead('0x44')]['id']}})[_0x5ead('0x27')](handleEntityNotFound(_0x1b7027,null))[_0x5ead('0x27')](removeEntity(_0x1b7027,null))[_0x5ead('0x43')](handleError(_0x1b7027,null));};exports[_0x5ead('0x4a')]=function(_0x25eefb,_0x5209c9){return db[_0x5ead('0x2e')][_0x5ead('0x4a')]()[_0x5ead('0x27')](respondWithResult(_0x5209c9,null))[_0x5ead('0x43')](handleError(_0x5209c9,null));}; \ No newline at end of file +var _0x459d=['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','status','end','json','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','findAll','catch','params','length','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x501f8b,_0x537f45){var _0x125925=function(_0x42ded7){while(--_0x42ded7){_0x501f8b['push'](_0x501f8b['shift']());}};_0x125925(++_0x537f45);}(_0x459d,0x8f));var _0xd459=function(_0x582e51,_0x48e819){_0x582e51=_0x582e51-0x0;var _0x363ec5=_0x459d[_0x582e51];return _0x363ec5;};'use strict';var pdf=require(_0xd459('0x0'));var emlformat=require(_0xd459('0x1'));var rimraf=require(_0xd459('0x2'));var zipdir=require(_0xd459('0x3'));var jsonpatch=require(_0xd459('0x4'));var rp=require(_0xd459('0x5'));var moment=require(_0xd459('0x6'));var BPromise=require(_0xd459('0x7'));var Mustache=require(_0xd459('0x8'));var util=require('util');var path=require(_0xd459('0x9'));var sox=require(_0xd459('0xa'));var csv=require(_0xd459('0xb'));var ejs=require(_0xd459('0xc'));var fs=require('fs');var _=require(_0xd459('0xd'));var squel=require(_0xd459('0xe'));var crypto=require(_0xd459('0xf'));var jsforce=require(_0xd459('0x10'));var deskjs=require(_0xd459('0x11'));var toCsv=require(_0xd459('0xb'));var querystring=require(_0xd459('0x12'));var Papa=require(_0xd459('0x13'));var Redis=require(_0xd459('0x14'));var authService=require(_0xd459('0x15'));var qs=require(_0xd459('0x16'));var as=require(_0xd459('0x17'));var hardwareService=require(_0xd459('0x18'));var logger=require('../../config/logger')(_0xd459('0x19'));var utils=require(_0xd459('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188034,_0x5304d2){_0x5304d2=_0x5304d2||0xcc;return function(_0x14431e){if(_0x14431e){return _0x188034['sendStatus'](_0x5304d2);}return _0x188034[_0xd459('0x1b')](_0x5304d2)[_0xd459('0x1c')]();};}function respondWithResult(_0x309ba0,_0x5436c3){_0x5436c3=_0x5436c3||0xc8;return function(_0x2805d9){if(_0x2805d9){return _0x309ba0[_0xd459('0x1b')](_0x5436c3)[_0xd459('0x1d')](_0x2805d9);}};}function respondWithFilteredResult(_0x5aebc5,_0x412dce){return function(_0xb3331a){if(_0xb3331a){var _0x126d59=_0xb3331a[_0xd459('0x1e')],_0x538552=_0x412dce[_0xd459('0x1f')],_0x1e5e2f=_0x412dce[_0xd459('0x1f')]+_0x412dce['limit'],_0x34f59d;if(_0x1e5e2f>=_0x126d59){_0x1e5e2f=_0x126d59;_0x34f59d=0xc8;}else{_0x34f59d=0xce;}_0x5aebc5[_0xd459('0x1b')](_0x34f59d);return _0x5aebc5['set'](_0xd459('0x20'),_0x538552+'-'+_0x1e5e2f+'/'+_0x126d59)['json'](_0xb3331a);}return null;};}function patchUpdates(_0x67e593){return function(_0x4a2d95){try{jsonpatch['apply'](_0x4a2d95,_0x67e593,!![]);}catch(_0x26b55d){return BPromise[_0xd459('0x21')](_0x26b55d);}return _0x4a2d95[_0xd459('0x22')]();};}function saveUpdates(_0x3383c9,_0x565a14){return function(_0x484af8){if(_0x484af8){return _0x484af8[_0xd459('0x23')](_0x3383c9)['then'](function(_0x2af92f){return _0x2af92f;});}return null;};}function removeEntity(_0x123f85,_0x12e4b6){return function(_0x5ee7af){if(_0x5ee7af){return _0x5ee7af['destroy']()[_0xd459('0x24')](function(){_0x123f85[_0xd459('0x1b')](0xcc)[_0xd459('0x1c')]();});}};}function handleEntityNotFound(_0x2fa9e1,_0x5beb20){return function(_0xec7ed2){if(!_0xec7ed2){_0x2fa9e1[_0xd459('0x25')](0x194);}return _0xec7ed2;};}function handleError(_0x2486a0,_0x1ffa98){_0x1ffa98=_0x1ffa98||0x1f4;return function(_0x46e69b){logger[_0xd459('0x26')](_0x46e69b[_0xd459('0x27')]);if(_0x46e69b[_0xd459('0x28')]){delete _0x46e69b[_0xd459('0x28')];}_0x2486a0[_0xd459('0x1b')](_0x1ffa98)['send'](_0x46e69b);};}exports[_0xd459('0x29')]=function(_0x264765,_0x451466){var _0x421992={},_0x3a6d44={},_0x1018c2={'count':0x0,'rows':[]};var _0xb2310a=_[_0xd459('0x2a')](db['SquareReport'][_0xd459('0x2b')],function(_0x5dc494){return{'name':_0x5dc494[_0xd459('0x2c')],'type':_0x5dc494['type'][_0xd459('0x2d')]};});_0x3a6d44[_0xd459('0x2e')]=_[_0xd459('0x2a')](_0xb2310a,_0xd459('0x28'));_0x3a6d44[_0xd459('0x2f')]=_[_0xd459('0x30')](_0x264765[_0xd459('0x2f')]);_0x3a6d44[_0xd459('0x31')]=_[_0xd459('0x32')](_0x3a6d44['model'],_0x3a6d44['query']);_0x421992[_0xd459('0x33')]=_[_0xd459('0x32')](_0x3a6d44['model'],qs[_0xd459('0x34')](_0x264765['query']['fields']));_0x421992[_0xd459('0x33')]=_0x421992[_0xd459('0x33')]['length']?_0x421992[_0xd459('0x33')]:_0x3a6d44[_0xd459('0x2e')];if(!_0x264765['query'][_0xd459('0x35')](_0xd459('0x36'))){_0x421992[_0xd459('0x37')]=qs[_0xd459('0x37')](_0x264765[_0xd459('0x2f')]['limit']);_0x421992[_0xd459('0x1f')]=qs[_0xd459('0x1f')](_0x264765[_0xd459('0x2f')][_0xd459('0x1f')]);}_0x421992[_0xd459('0x38')]=qs[_0xd459('0x39')](_0x264765[_0xd459('0x2f')]['sort']);_0x421992[_0xd459('0x3a')]=qs['filters'](_[_0xd459('0x3b')](_0x264765['query'],_0x3a6d44['filters']),_0xb2310a);if(_0x264765[_0xd459('0x2f')][_0xd459('0x3c')]){_0x421992[_0xd459('0x3a')]=_[_0xd459('0x3d')](_0x421992[_0xd459('0x3a')],{'$or':_[_0xd459('0x2a')](_0xb2310a,function(_0x1a31f5){if(_0x1a31f5['type']!==_0xd459('0x3e')){var _0x5584e7={};_0x5584e7[_0x1a31f5[_0xd459('0x28')]]={'$like':'%'+_0x264765[_0xd459('0x2f')][_0xd459('0x3c')]+'%'};return _0x5584e7;}})});}_0x421992=_['merge']({},_0x421992,_0x264765[_0xd459('0x3f')]);var _0x334b8e={'where':_0x421992[_0xd459('0x3a')]};return db[_0xd459('0x40')]['count'](_0x334b8e)[_0xd459('0x24')](function(_0x288d52){_0x1018c2['count']=_0x288d52;if(_0x264765[_0xd459('0x2f')][_0xd459('0x41')]){_0x421992['include']=[{'all':!![]}];}return db[_0xd459('0x40')][_0xd459('0x42')](_0x421992);})[_0xd459('0x24')](function(_0x36be19){_0x1018c2['rows']=_0x36be19;return _0x1018c2;})['then'](respondWithFilteredResult(_0x451466,_0x421992))[_0xd459('0x43')](handleError(_0x451466,null));};exports['show']=function(_0x2b9e3c,_0x23c1ba){var _0x3302d2={'raw':!![],'where':{'id':_0x2b9e3c[_0xd459('0x44')]['id']}},_0x15f1d3={};_0x15f1d3[_0xd459('0x2e')]=_[_0xd459('0x30')](db['SquareReport'][_0xd459('0x2b')]);_0x15f1d3[_0xd459('0x2f')]=_['keys'](_0x2b9e3c[_0xd459('0x2f')]);_0x15f1d3[_0xd459('0x31')]=_['intersection'](_0x15f1d3[_0xd459('0x2e')],_0x15f1d3[_0xd459('0x2f')]);_0x3302d2[_0xd459('0x33')]=_[_0xd459('0x32')](_0x15f1d3[_0xd459('0x2e')],qs[_0xd459('0x34')](_0x2b9e3c[_0xd459('0x2f')]['fields']));_0x3302d2[_0xd459('0x33')]=_0x3302d2[_0xd459('0x33')][_0xd459('0x45')]?_0x3302d2[_0xd459('0x33')]:_0x15f1d3[_0xd459('0x2e')];if(_0x2b9e3c[_0xd459('0x2f')][_0xd459('0x41')]){_0x3302d2[_0xd459('0x46')]=[{'all':!![]}];}_0x3302d2=_[_0xd459('0x3d')]({},_0x3302d2,_0x2b9e3c[_0xd459('0x3f')]);return db[_0xd459('0x40')][_0xd459('0x47')](_0x3302d2)['then'](handleEntityNotFound(_0x23c1ba,null))['then'](respondWithResult(_0x23c1ba,null))[_0xd459('0x43')](handleError(_0x23c1ba,null));};exports[_0xd459('0x48')]=function(_0xb06a97,_0x3e82d2){return db[_0xd459('0x40')][_0xd459('0x48')](_0xb06a97[_0xd459('0x49')],{})[_0xd459('0x24')](respondWithResult(_0x3e82d2,0xc9))['catch'](handleError(_0x3e82d2,null));};exports[_0xd459('0x23')]=function(_0x4cb352,_0x46501f){if(_0x4cb352[_0xd459('0x49')]['id']){delete _0x4cb352['body']['id'];}return db[_0xd459('0x40')][_0xd459('0x47')]({'where':{'id':_0x4cb352[_0xd459('0x44')]['id']}})['then'](handleEntityNotFound(_0x46501f,null))[_0xd459('0x24')](saveUpdates(_0x4cb352[_0xd459('0x49')],null))[_0xd459('0x24')](respondWithResult(_0x46501f,null))[_0xd459('0x43')](handleError(_0x46501f,null));};exports[_0xd459('0x4a')]=function(_0x3f9aef,_0x40e678){return db[_0xd459('0x40')]['find']({'where':{'id':_0x3f9aef[_0xd459('0x44')]['id']}})[_0xd459('0x24')](handleEntityNotFound(_0x40e678,null))[_0xd459('0x24')](removeEntity(_0x40e678,null))[_0xd459('0x43')](handleError(_0x40e678,null));};exports[_0xd459('0x4b')]=function(_0x42b503,_0x4c3146){return db['SquareReport']['describe']()['then'](respondWithResult(_0x4c3146,null))[_0xd459('0x43')](handleError(_0x4c3146,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e818bfb..69e4477 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 _0x598c=['exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5adf5a,_0x290d54){var _0x35cb7f=function(_0x443c7c){while(--_0x443c7c){_0x5adf5a['push'](_0x5adf5a['shift']());}};_0x35cb7f(++_0x290d54);}(_0x598c,0xb7));var _0xc598=function(_0x3a6e53,_0x46c98c){_0x3a6e53=_0x3a6e53-0x0;var _0x2c63cc=_0x598c[_0x3a6e53];return _0x2c63cc;};'use strict';var _=require(_0xc598('0x0'));var util=require(_0xc598('0x1'));var logger=require(_0xc598('0x2'))(_0xc598('0x3'));var moment=require('moment');var BPromise=require(_0xc598('0x4'));var rp=require(_0xc598('0x5'));var fs=require('fs');var path=require(_0xc598('0x6'));var rimraf=require(_0xc598('0x7'));var config=require(_0xc598('0x8'));var attributes=require('./squareReport.attributes');module[_0xc598('0x9')]=function(_0x1564a1,_0x531516){return _0x1564a1[_0xc598('0xa')](_0xc598('0xb'),attributes,{'tableName':_0xc598('0xc'),'paranoid':![],'indexes':[{'name':_0xc598('0xd'),'fields':['uniqueid',_0xc598('0xe')]},{'name':_0xc598('0xf'),'fields':[_0xc598('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf074=['uniqueid','project_name','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname'];(function(_0x261a0e,_0x371f85){var _0x3442a2=function(_0x30c904){while(--_0x30c904){_0x261a0e['push'](_0x261a0e['shift']());}};_0x3442a2(++_0x371f85);}(_0xf074,0x16b));var _0x4f07=function(_0x50e441,_0xc3e0be){_0x50e441=_0x50e441-0x0;var _0x14d824=_0xf074[_0x50e441];return _0x14d824;};'use strict';var _=require('lodash');var util=require(_0x4f07('0x0'));var logger=require(_0x4f07('0x1'))(_0x4f07('0x2'));var moment=require(_0x4f07('0x3'));var BPromise=require(_0x4f07('0x4'));var rp=require(_0x4f07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f07('0x6'));var config=require(_0x4f07('0x7'));var attributes=require(_0x4f07('0x8'));module['exports']=function(_0x59dade,_0x5a2ff2){return _0x59dade[_0x4f07('0x9')]('SquareReport',attributes,{'tableName':_0x4f07('0xa'),'paranoid':![],'indexes':[{'name':_0x4f07('0xb'),'fields':[_0x4f07('0xc'),_0x4f07('0xd')]},{'name':_0x4f07('0xe'),'fields':[_0x4f07('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 5a6d816..cc12006 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 _0x35b1=['options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareReport','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35b1,0x111));var _0x135b=function(_0x56500a,_0x5953c7){_0x56500a=_0x56500a-0x0;var _0x333977=_0x35b1[_0x56500a];return _0x333977;};'use strict';var _=require(_0x135b('0x0'));var util=require(_0x135b('0x1'));var moment=require('moment');var BPromise=require(_0x135b('0x2'));var rs=require(_0x135b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x135b('0x4'))['db'];var utils=require(_0x135b('0x5'));var logger=require(_0x135b('0x6'))(_0x135b('0x7'));var config=require(_0x135b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x135b('0x9')][_0x135b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x399e90,_0x1ad75d,_0x1b3c60){return new BPromise(function(_0xcb0912,_0x27e454){return client[_0x135b('0xb')](_0x399e90,_0x1b3c60)[_0x135b('0xc')](function(_0x2d1068){logger[_0x135b('0xd')](_0x135b('0xe'),_0x1ad75d,_0x135b('0xf'));logger['debug'](_0x135b('0x10'),_0x1ad75d,_0x135b('0xf'),JSON[_0x135b('0x11')](_0x2d1068));if(_0x2d1068[_0x135b('0x12')]){if(_0x2d1068[_0x135b('0x12')][_0x135b('0x13')]===0x1f4){logger['error'](_0x135b('0xe'),_0x1ad75d,_0x2d1068['error'][_0x135b('0x14')]);return _0x27e454(_0x2d1068[_0x135b('0x12')][_0x135b('0x14')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x1ad75d,_0x2d1068['error']['message']);return _0xcb0912(_0x2d1068[_0x135b('0x12')]['message']);}else{logger[_0x135b('0xd')](_0x135b('0xe'),_0x1ad75d,_0x135b('0xf'));_0xcb0912(_0x2d1068['result'][_0x135b('0x14')]);}})[_0x135b('0x15')](function(_0x19e24a){logger[_0x135b('0x12')](_0x135b('0xe'),_0x1ad75d,_0x19e24a);_0x27e454(_0x19e24a);});});}exports['CreateSquareReport']=function(_0x53f55e){var _0x321efa=this;return new Promise(function(_0x337f24,_0x250f6f){return db[_0x135b('0x16')]['create'](_0x53f55e[_0x135b('0x17')],{'raw':_0x53f55e[_0x135b('0x18')]?_0x53f55e['options'][_0x135b('0x19')]===undefined?!![]:![]:!![]})[_0x135b('0xc')](function(_0x54db12){logger[_0x135b('0xd')]('CreateSquareReport',_0x53f55e);logger['debug'](_0x135b('0x1a'),_0x53f55e,JSON[_0x135b('0x11')](_0x54db12));_0x337f24(_0x54db12);})[_0x135b('0x15')](function(_0x268219){logger[_0x135b('0x12')](_0x135b('0x1a'),_0x268219[_0x135b('0x14')],_0x53f55e);_0x250f6f(_0x321efa[_0x135b('0x12')](0x1f4,_0x268219[_0x135b('0x14')]));});});};exports[_0x135b('0x1b')]=function(_0x80f9a8){var _0x201918=this;return new Promise(function(_0x459e57,_0xe82c60){return db[_0x135b('0x16')][_0x135b('0x1c')](_0x80f9a8['body'],{'raw':_0x80f9a8[_0x135b('0x18')]?_0x80f9a8[_0x135b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80f9a8[_0x135b('0x18')]?_0x80f9a8[_0x135b('0x18')][_0x135b('0x1d')]||null:null,'attributes':_0x80f9a8[_0x135b('0x18')]?_0x80f9a8['options'][_0x135b('0x1e')]||null:null,'limit':_0x80f9a8[_0x135b('0x18')]?_0x80f9a8[_0x135b('0x18')][_0x135b('0x1f')]||null:null})[_0x135b('0xc')](function(_0x8c0eca){logger[_0x135b('0xd')](_0x135b('0x1b'),_0x80f9a8);logger[_0x135b('0x20')](_0x135b('0x1b'),_0x80f9a8,JSON[_0x135b('0x11')](_0x8c0eca));_0x459e57(_0x8c0eca);})[_0x135b('0x15')](function(_0x376433){logger['error'](_0x135b('0x1b'),_0x376433[_0x135b('0x14')],_0x80f9a8);_0xe82c60(_0x201918[_0x135b('0x12')](0x1f4,_0x376433[_0x135b('0x14')]));});});}; \ No newline at end of file +var _0x55d2=['error','code','message','SquareReport,\x20%s,\x20%s','request\x20sent','result','CreateSquareReport','SquareReport','create','body','options','then','UpdateSquareReport','update','raw','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x70404,_0x507113){var _0x2da0b9=function(_0x3fa2a9){while(--_0x3fa2a9){_0x70404['push'](_0x70404['shift']());}};_0x2da0b9(++_0x507113);}(_0x55d2,0x188));var _0x255d=function(_0x2739ac,_0x45a29d){_0x2739ac=_0x2739ac-0x0;var _0xa610df=_0x55d2[_0x2739ac];return _0xa610df;};'use strict';var _=require(_0x255d('0x0'));var util=require(_0x255d('0x1'));var moment=require('moment');var BPromise=require(_0x255d('0x2'));var rs=require(_0x255d('0x3'));var fs=require('fs');var Redis=require(_0x255d('0x4'));var db=require(_0x255d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')][_0x255d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d7e87,_0x1e3592,_0x59a355){return new BPromise(function(_0x4c9a2c,_0x40a34c){return client[_0x255d('0xb')](_0x3d7e87,_0x59a355)['then'](function(_0x4ec8fb){logger[_0x255d('0xc')]('SquareReport,\x20%s,\x20%s',_0x1e3592,'request\x20sent');logger[_0x255d('0xd')](_0x255d('0xe'),_0x1e3592,'request\x20sent',JSON[_0x255d('0xf')](_0x4ec8fb));if(_0x4ec8fb['error']){if(_0x4ec8fb[_0x255d('0x10')][_0x255d('0x11')]===0x1f4){logger[_0x255d('0x10')]('SquareReport,\x20%s,\x20%s',_0x1e3592,_0x4ec8fb[_0x255d('0x10')][_0x255d('0x12')]);return _0x40a34c(_0x4ec8fb[_0x255d('0x10')]['message']);}logger[_0x255d('0x10')](_0x255d('0x13'),_0x1e3592,_0x4ec8fb[_0x255d('0x10')][_0x255d('0x12')]);return _0x4c9a2c(_0x4ec8fb['error']['message']);}else{logger[_0x255d('0xc')](_0x255d('0x13'),_0x1e3592,_0x255d('0x14'));_0x4c9a2c(_0x4ec8fb[_0x255d('0x15')]['message']);}})['catch'](function(_0x3f9e43){logger['error']('SquareReport,\x20%s,\x20%s',_0x1e3592,_0x3f9e43);_0x40a34c(_0x3f9e43);});});}exports[_0x255d('0x16')]=function(_0xe3167c){var _0x27730b=this;return new Promise(function(_0x22bb90,_0x321172){return db[_0x255d('0x17')][_0x255d('0x18')](_0xe3167c[_0x255d('0x19')],{'raw':_0xe3167c[_0x255d('0x1a')]?_0xe3167c['options']['raw']===undefined?!![]:![]:!![]})[_0x255d('0x1b')](function(_0x395890){logger['info']('CreateSquareReport',_0xe3167c);logger['debug']('CreateSquareReport',_0xe3167c,JSON[_0x255d('0xf')](_0x395890));_0x22bb90(_0x395890);})['catch'](function(_0x3c9529){logger[_0x255d('0x10')](_0x255d('0x16'),_0x3c9529[_0x255d('0x12')],_0xe3167c);_0x321172(_0x27730b[_0x255d('0x10')](0x1f4,_0x3c9529[_0x255d('0x12')]));});});};exports[_0x255d('0x1c')]=function(_0x5cd561){var _0x1855a7=this;return new Promise(function(_0x3159d3,_0x413a08){return db['SquareReport'][_0x255d('0x1d')](_0x5cd561[_0x255d('0x19')],{'raw':_0x5cd561['options']?_0x5cd561[_0x255d('0x1a')][_0x255d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd561[_0x255d('0x1a')]?_0x5cd561[_0x255d('0x1a')][_0x255d('0x1f')]||null:null,'attributes':_0x5cd561[_0x255d('0x1a')]?_0x5cd561[_0x255d('0x1a')]['attributes']||null:null,'limit':_0x5cd561[_0x255d('0x1a')]?_0x5cd561[_0x255d('0x1a')][_0x255d('0x20')]||null:null})[_0x255d('0x1b')](function(_0x246a58){logger[_0x255d('0xc')](_0x255d('0x1c'),_0x5cd561);logger[_0x255d('0xd')]('UpdateSquareReport',_0x5cd561,JSON[_0x255d('0xf')](_0x246a58));_0x3159d3(_0x246a58);})[_0x255d('0x21')](function(_0x33459a){logger['error'](_0x255d('0x1c'),_0x33459a[_0x255d('0x12')],_0x5cd561);_0x413a08(_0x1855a7['error'](0x1f4,_0x33459a[_0x255d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1f206f2..e3994d7 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x814b,0x1a2));var _0xb814=function(_0x16e9b5,_0x192142){_0x16e9b5=_0x16e9b5-0x0;var _0x206df0=_0x814b[_0x16e9b5];return _0x206df0;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _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(_0x322da0,_0x525dc1){var _0x5dfc58=function(_0x28085c){while(--_0x28085c){_0x322da0['push'](_0x322da0['shift']());}};_0x5dfc58(++_0x525dc1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e1d7d,_0x5a7761){_0x4e1d7d=_0x4e1d7d-0x0;var _0x53f086=_0x5f2f[_0x4e1d7d];return _0x53f086;};'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 7a891b8..7660e38 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 _0x43f9=['STRING','TEXT','sequelize','exports'];(function(_0x2a11ec,_0x477d22){var _0x4bfd96=function(_0x4d09dc){while(--_0x4d09dc){_0x2a11ec['push'](_0x2a11ec['shift']());}};_0x4bfd96(++_0x477d22);}(_0x43f9,0x13e));var _0x943f=function(_0x2e5a94,_0x21870a){_0x2e5a94=_0x2e5a94-0x0;var _0x85f77f=_0x43f9[_0x2e5a94];return _0x85f77f;};'use strict';var Sequelize=require(_0x943f('0x0'));module[_0x943f('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x943f('0x2')]},'data':{'type':Sequelize[_0x943f('0x3')]},'project_name':{'type':Sequelize[_0x943f('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6fce=['exports','STRING','TEXT'];(function(_0x3e1944,_0x481749){var _0x24d309=function(_0x95597){while(--_0x95597){_0x3e1944['push'](_0x3e1944['shift']());}};_0x24d309(++_0x481749);}(_0x6fce,0x186));var _0xe6fc=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x6fce[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module[_0xe6fc('0x0')]={'uniqueid':{'type':Sequelize[_0xe6fc('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xe6fc('0x1')]},'data':{'type':Sequelize[_0xe6fc('0x2')]},'project_name':{'type':Sequelize[_0xe6fc('0x1')]},'callerid':{'type':Sequelize[_0xe6fc('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index f760863..9d0e97d 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 _0x6e2e=['body','update','destroy','describe','html-pdf','fast-json-patch','request-promise','moment','bluebird','sox','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','Content-Range','json','apply','reject','save','status','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','order','pick','filter','where','merge','then','includeAll','findAll','catch','show','params','fields','length','include','options','find','create'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x6e2e,0x13a));var _0xe6e2=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x6e2e[_0x18cd5b];return _0x5eaa52;};'use strict';var pdf=require(_0xe6e2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe6e2('0x1'));var rp=require(_0xe6e2('0x2'));var moment=require(_0xe6e2('0x3'));var BPromise=require(_0xe6e2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe6e2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe6e2('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6e2('0x7'));var toCsv=require(_0xe6e2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6e2('0x9'));var authService=require(_0xe6e2('0xa'));var qs=require(_0xe6e2('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe6e2('0xc'));var utils=require(_0xe6e2('0xd'));var config=require(_0xe6e2('0xe'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x435635,_0x1ef5e2){_0x1ef5e2=_0x1ef5e2||0xcc;return function(_0x44d038){if(_0x44d038){return _0x435635[_0xe6e2('0xf')](_0x1ef5e2);}return _0x435635['status'](_0x1ef5e2)[_0xe6e2('0x10')]();};}function respondWithResult(_0x4317e8,_0x1cdafe){_0x1cdafe=_0x1cdafe||0xc8;return function(_0x4e3b85){if(_0x4e3b85){return _0x4317e8['status'](_0x1cdafe)['json'](_0x4e3b85);}};}function respondWithFilteredResult(_0x34efa1,_0x71e2cb){return function(_0x3a898a){if(_0x3a898a){var _0x5af6b2=_0x3a898a[_0xe6e2('0x11')],_0x4e4b1f=_0x71e2cb[_0xe6e2('0x12')],_0x392ae2=_0x71e2cb['offset']+_0x71e2cb[_0xe6e2('0x13')],_0xe8a2f6;if(_0x392ae2>=_0x5af6b2){_0x392ae2=_0x5af6b2;_0xe8a2f6=0xc8;}else{_0xe8a2f6=0xce;}_0x34efa1['status'](_0xe8a2f6);return _0x34efa1['set'](_0xe6e2('0x14'),_0x4e4b1f+'-'+_0x392ae2+'/'+_0x5af6b2)[_0xe6e2('0x15')](_0x3a898a);}return null;};}function patchUpdates(_0x350025){return function(_0x37c29b){try{jsonpatch[_0xe6e2('0x16')](_0x37c29b,_0x350025,!![]);}catch(_0x137ad2){return BPromise[_0xe6e2('0x17')](_0x137ad2);}return _0x37c29b[_0xe6e2('0x18')]();};}function saveUpdates(_0x39badf,_0x311f74){return function(_0x26a2ca){if(_0x26a2ca){return _0x26a2ca['update'](_0x39badf)['then'](function(_0x2f3c21){return _0x2f3c21;});}return null;};}function removeEntity(_0x320a12,_0x4ce1bd){return function(_0x586b22){if(_0x586b22){return _0x586b22['destroy']()['then'](function(){_0x320a12[_0xe6e2('0x19')](0xcc)[_0xe6e2('0x10')]();});}};}function handleEntityNotFound(_0x49e835,_0x1231cf){return function(_0x1b197e){if(!_0x1b197e){_0x49e835[_0xe6e2('0xf')](0x194);}return _0x1b197e;};}function handleError(_0x17cd62,_0x2ec843){_0x2ec843=_0x2ec843||0x1f4;return function(_0x526b15){logger[_0xe6e2('0x1a')](_0x526b15['stack']);if(_0x526b15[_0xe6e2('0x1b')]){delete _0x526b15['name'];}_0x17cd62['status'](_0x2ec843)[_0xe6e2('0x1c')](_0x526b15);};}exports['index']=function(_0x1bd48b,_0x35b0b6){var _0x48c2a8={},_0x226644={},_0x2f58df={'count':0x0,'rows':[]};var _0x3b33c4=_[_0xe6e2('0x1d')](db[_0xe6e2('0x1e')][_0xe6e2('0x1f')],function(_0x46b691){return{'name':_0x46b691[_0xe6e2('0x20')],'type':_0x46b691[_0xe6e2('0x21')]['key']};});_0x226644[_0xe6e2('0x22')]=_[_0xe6e2('0x1d')](_0x3b33c4,_0xe6e2('0x1b'));_0x226644[_0xe6e2('0x23')]=_[_0xe6e2('0x24')](_0x1bd48b[_0xe6e2('0x23')]);_0x226644[_0xe6e2('0x25')]=_[_0xe6e2('0x26')](_0x226644['model'],_0x226644[_0xe6e2('0x23')]);_0x48c2a8[_0xe6e2('0x27')]=_[_0xe6e2('0x26')](_0x226644[_0xe6e2('0x22')],qs['fields'](_0x1bd48b[_0xe6e2('0x23')]['fields']));_0x48c2a8[_0xe6e2('0x27')]=_0x48c2a8['attributes']['length']?_0x48c2a8['attributes']:_0x226644[_0xe6e2('0x22')];if(!_0x1bd48b['query']['hasOwnProperty'](_0xe6e2('0x28'))){_0x48c2a8[_0xe6e2('0x13')]=qs[_0xe6e2('0x13')](_0x1bd48b[_0xe6e2('0x23')][_0xe6e2('0x13')]);_0x48c2a8[_0xe6e2('0x12')]=qs['offset'](_0x1bd48b[_0xe6e2('0x23')][_0xe6e2('0x12')]);}_0x48c2a8[_0xe6e2('0x29')]=qs['sort'](_0x1bd48b['query']['sort']);_0x48c2a8['where']=qs['filters'](_[_0xe6e2('0x2a')](_0x1bd48b[_0xe6e2('0x23')],_0x226644[_0xe6e2('0x25')]),_0x3b33c4);if(_0x1bd48b[_0xe6e2('0x23')][_0xe6e2('0x2b')]){_0x48c2a8[_0xe6e2('0x2c')]=_['merge'](_0x48c2a8[_0xe6e2('0x2c')],{'$or':_[_0xe6e2('0x1d')](_0x3b33c4,function(_0x283d39){if(_0x283d39['type']!=='VIRTUAL'){var _0x40e44f={};_0x40e44f[_0x283d39[_0xe6e2('0x1b')]]={'$like':'%'+_0x1bd48b[_0xe6e2('0x23')][_0xe6e2('0x2b')]+'%'};return _0x40e44f;}})});}_0x48c2a8=_[_0xe6e2('0x2d')]({},_0x48c2a8,_0x1bd48b['options']);var _0x170e7a={'where':_0x48c2a8[_0xe6e2('0x2c')]};return db[_0xe6e2('0x1e')][_0xe6e2('0x11')](_0x170e7a)[_0xe6e2('0x2e')](function(_0x26b17a){_0x2f58df['count']=_0x26b17a;if(_0x1bd48b[_0xe6e2('0x23')][_0xe6e2('0x2f')]){_0x48c2a8['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xe6e2('0x30')](_0x48c2a8);})[_0xe6e2('0x2e')](function(_0x252361){_0x2f58df['rows']=_0x252361;return _0x2f58df;})[_0xe6e2('0x2e')](respondWithFilteredResult(_0x35b0b6,_0x48c2a8))[_0xe6e2('0x31')](handleError(_0x35b0b6,null));};exports[_0xe6e2('0x32')]=function(_0x6618ee,_0x7ae2b1){var _0x133dce={'raw':!![],'where':{'id':_0x6618ee[_0xe6e2('0x33')]['id']}},_0x25e6e5={};_0x25e6e5[_0xe6e2('0x22')]=_[_0xe6e2('0x24')](db[_0xe6e2('0x1e')][_0xe6e2('0x1f')]);_0x25e6e5[_0xe6e2('0x23')]=_[_0xe6e2('0x24')](_0x6618ee[_0xe6e2('0x23')]);_0x25e6e5[_0xe6e2('0x25')]=_[_0xe6e2('0x26')](_0x25e6e5['model'],_0x25e6e5[_0xe6e2('0x23')]);_0x133dce['attributes']=_[_0xe6e2('0x26')](_0x25e6e5[_0xe6e2('0x22')],qs['fields'](_0x6618ee[_0xe6e2('0x23')][_0xe6e2('0x34')]));_0x133dce['attributes']=_0x133dce[_0xe6e2('0x27')][_0xe6e2('0x35')]?_0x133dce['attributes']:_0x25e6e5['model'];if(_0x6618ee[_0xe6e2('0x23')][_0xe6e2('0x2f')]){_0x133dce[_0xe6e2('0x36')]=[{'all':!![]}];}_0x133dce=_[_0xe6e2('0x2d')]({},_0x133dce,_0x6618ee[_0xe6e2('0x37')]);return db[_0xe6e2('0x1e')][_0xe6e2('0x38')](_0x133dce)[_0xe6e2('0x2e')](handleEntityNotFound(_0x7ae2b1,null))['then'](respondWithResult(_0x7ae2b1,null))[_0xe6e2('0x31')](handleError(_0x7ae2b1,null));};exports[_0xe6e2('0x39')]=function(_0x5bfa13,_0x148a54){return db['SquareDetailsReport']['create'](_0x5bfa13[_0xe6e2('0x3a')],{})['then'](respondWithResult(_0x148a54,0xc9))[_0xe6e2('0x31')](handleError(_0x148a54,null));};exports[_0xe6e2('0x3b')]=function(_0x4c3c7d,_0x678b8f){if(_0x4c3c7d[_0xe6e2('0x3a')]['id']){delete _0x4c3c7d[_0xe6e2('0x3a')]['id'];}return db[_0xe6e2('0x1e')][_0xe6e2('0x38')]({'where':{'id':_0x4c3c7d['params']['id']}})['then'](handleEntityNotFound(_0x678b8f,null))['then'](saveUpdates(_0x4c3c7d[_0xe6e2('0x3a')],null))[_0xe6e2('0x2e')](respondWithResult(_0x678b8f,null))[_0xe6e2('0x31')](handleError(_0x678b8f,null));};exports[_0xe6e2('0x3c')]=function(_0x2f2865,_0x530f6e){return db['SquareDetailsReport'][_0xe6e2('0x38')]({'where':{'id':_0x2f2865[_0xe6e2('0x33')]['id']}})['then'](handleEntityNotFound(_0x530f6e,null))[_0xe6e2('0x2e')](removeEntity(_0x530f6e,null))[_0xe6e2('0x31')](handleError(_0x530f6e,null));};exports[_0xe6e2('0x3d')]=function(_0x15a708,_0x33e1a0){return db['SquareDetailsReport'][_0xe6e2('0x3d')]()['then'](respondWithResult(_0x33e1a0,null))['catch'](handleError(_0x33e1a0,null));}; \ No newline at end of file +var _0x4201=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','count','includeAll','include','SquareDetailsReport','findAll','rows','keys','rawAttributes','options','find','create','body','catch','params','describe','html-pdf','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4201,0x86));var _0x1420=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0x4201[_0x1e235e];return _0x1e8e94;};'use strict';var pdf=require(_0x1420('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1420('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1420('0x2'));var BPromise=require(_0x1420('0x3'));var Mustache=require(_0x1420('0x4'));var util=require(_0x1420('0x5'));var path=require(_0x1420('0x6'));var sox=require(_0x1420('0x7'));var csv=require(_0x1420('0x8'));var ejs=require(_0x1420('0x9'));var fs=require('fs');var _=require(_0x1420('0xa'));var squel=require(_0x1420('0xb'));var crypto=require(_0x1420('0xc'));var jsforce=require(_0x1420('0xd'));var deskjs=require(_0x1420('0xe'));var toCsv=require(_0x1420('0x8'));var querystring=require(_0x1420('0xf'));var Papa=require(_0x1420('0x10'));var Redis=require(_0x1420('0x11'));var authService=require(_0x1420('0x12'));var qs=require(_0x1420('0x13'));var as=require(_0x1420('0x14'));var hardwareService=require(_0x1420('0x15'));var logger=require(_0x1420('0x16'))(_0x1420('0x17'));var utils=require(_0x1420('0x18'));var config=require(_0x1420('0x19'));var db=require(_0x1420('0x1a'))['db'];function respondWithStatusCode(_0x18a425,_0x54219f){_0x54219f=_0x54219f||0xcc;return function(_0x1b2759){if(_0x1b2759){return _0x18a425[_0x1420('0x1b')](_0x54219f);}return _0x18a425['status'](_0x54219f)[_0x1420('0x1c')]();};}function respondWithResult(_0x1469d9,_0x328db0){_0x328db0=_0x328db0||0xc8;return function(_0x41386e){if(_0x41386e){return _0x1469d9[_0x1420('0x1d')](_0x328db0)[_0x1420('0x1e')](_0x41386e);}};}function respondWithFilteredResult(_0x175e02,_0x5884ac){return function(_0x33e7be){if(_0x33e7be){var _0x3d044d=_0x33e7be['count'],_0x1b261b=_0x5884ac[_0x1420('0x1f')],_0x20b77a=_0x5884ac[_0x1420('0x1f')]+_0x5884ac['limit'],_0x5dca23;if(_0x20b77a>=_0x3d044d){_0x20b77a=_0x3d044d;_0x5dca23=0xc8;}else{_0x5dca23=0xce;}_0x175e02[_0x1420('0x1d')](_0x5dca23);return _0x175e02[_0x1420('0x20')](_0x1420('0x21'),_0x1b261b+'-'+_0x20b77a+'/'+_0x3d044d)[_0x1420('0x1e')](_0x33e7be);}return null;};}function patchUpdates(_0x2e1ee6){return function(_0x53d489){try{jsonpatch[_0x1420('0x22')](_0x53d489,_0x2e1ee6,!![]);}catch(_0x411970){return BPromise[_0x1420('0x23')](_0x411970);}return _0x53d489['save']();};}function saveUpdates(_0x5101f4,_0x211c2f){return function(_0x2b2900){if(_0x2b2900){return _0x2b2900[_0x1420('0x24')](_0x5101f4)['then'](function(_0x1ffc2a){return _0x1ffc2a;});}return null;};}function removeEntity(_0x57d847,_0x36149c){return function(_0x1afa05){if(_0x1afa05){return _0x1afa05[_0x1420('0x25')]()[_0x1420('0x26')](function(){_0x57d847[_0x1420('0x1d')](0xcc)[_0x1420('0x1c')]();});}};}function handleEntityNotFound(_0x3a9437,_0x50a3ee){return function(_0x4c2063){if(!_0x4c2063){_0x3a9437[_0x1420('0x1b')](0x194);}return _0x4c2063;};}function handleError(_0x55cc0a,_0x3b1013){_0x3b1013=_0x3b1013||0x1f4;return function(_0x536f1c){logger[_0x1420('0x27')](_0x536f1c['stack']);if(_0x536f1c[_0x1420('0x28')]){delete _0x536f1c[_0x1420('0x28')];}_0x55cc0a[_0x1420('0x1d')](_0x3b1013)[_0x1420('0x29')](_0x536f1c);};}exports['index']=function(_0x3d2f13,_0x51bd5b){var _0x29ce9a={},_0x31d4f2={},_0x998b55={'count':0x0,'rows':[]};var _0x51fa35=_[_0x1420('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x467e87){return{'name':_0x467e87[_0x1420('0x2b')],'type':_0x467e87['type']['key']};});_0x31d4f2[_0x1420('0x2c')]=_['map'](_0x51fa35,_0x1420('0x28'));_0x31d4f2[_0x1420('0x2d')]=_['keys'](_0x3d2f13['query']);_0x31d4f2['filters']=_[_0x1420('0x2e')](_0x31d4f2['model'],_0x31d4f2[_0x1420('0x2d')]);_0x29ce9a[_0x1420('0x2f')]=_[_0x1420('0x2e')](_0x31d4f2[_0x1420('0x2c')],qs[_0x1420('0x30')](_0x3d2f13[_0x1420('0x2d')]['fields']));_0x29ce9a[_0x1420('0x2f')]=_0x29ce9a[_0x1420('0x2f')][_0x1420('0x31')]?_0x29ce9a[_0x1420('0x2f')]:_0x31d4f2[_0x1420('0x2c')];if(!_0x3d2f13[_0x1420('0x2d')][_0x1420('0x32')](_0x1420('0x33'))){_0x29ce9a[_0x1420('0x34')]=qs[_0x1420('0x34')](_0x3d2f13['query'][_0x1420('0x34')]);_0x29ce9a['offset']=qs[_0x1420('0x1f')](_0x3d2f13[_0x1420('0x2d')]['offset']);}_0x29ce9a[_0x1420('0x35')]=qs[_0x1420('0x36')](_0x3d2f13[_0x1420('0x2d')][_0x1420('0x36')]);_0x29ce9a[_0x1420('0x37')]=qs[_0x1420('0x38')](_[_0x1420('0x39')](_0x3d2f13['query'],_0x31d4f2[_0x1420('0x38')]),_0x51fa35);if(_0x3d2f13[_0x1420('0x2d')][_0x1420('0x3a')]){_0x29ce9a['where']=_['merge'](_0x29ce9a[_0x1420('0x37')],{'$or':_['map'](_0x51fa35,function(_0x51ce32){if(_0x51ce32[_0x1420('0x3b')]!==_0x1420('0x3c')){var _0x22eb05={};_0x22eb05[_0x51ce32['name']]={'$like':'%'+_0x3d2f13[_0x1420('0x2d')][_0x1420('0x3a')]+'%'};return _0x22eb05;}})});}_0x29ce9a=_[_0x1420('0x3d')]({},_0x29ce9a,_0x3d2f13['options']);var _0x1f2300={'where':_0x29ce9a['where']};return db['SquareDetailsReport'][_0x1420('0x3e')](_0x1f2300)[_0x1420('0x26')](function(_0x5248ff){_0x998b55[_0x1420('0x3e')]=_0x5248ff;if(_0x3d2f13[_0x1420('0x2d')][_0x1420('0x3f')]){_0x29ce9a[_0x1420('0x40')]=[{'all':!![]}];}return db[_0x1420('0x41')][_0x1420('0x42')](_0x29ce9a);})['then'](function(_0x36799d){_0x998b55[_0x1420('0x43')]=_0x36799d;return _0x998b55;})['then'](respondWithFilteredResult(_0x51bd5b,_0x29ce9a))['catch'](handleError(_0x51bd5b,null));};exports['show']=function(_0x3ded9a,_0x14348c){var _0x187101={'raw':!![],'where':{'id':_0x3ded9a['params']['id']}},_0x1f98dd={};_0x1f98dd['model']=_[_0x1420('0x44')](db[_0x1420('0x41')][_0x1420('0x45')]);_0x1f98dd[_0x1420('0x2d')]=_[_0x1420('0x44')](_0x3ded9a['query']);_0x1f98dd[_0x1420('0x38')]=_[_0x1420('0x2e')](_0x1f98dd[_0x1420('0x2c')],_0x1f98dd[_0x1420('0x2d')]);_0x187101[_0x1420('0x2f')]=_[_0x1420('0x2e')](_0x1f98dd['model'],qs[_0x1420('0x30')](_0x3ded9a[_0x1420('0x2d')][_0x1420('0x30')]));_0x187101[_0x1420('0x2f')]=_0x187101[_0x1420('0x2f')]['length']?_0x187101['attributes']:_0x1f98dd[_0x1420('0x2c')];if(_0x3ded9a[_0x1420('0x2d')]['includeAll']){_0x187101[_0x1420('0x40')]=[{'all':!![]}];}_0x187101=_[_0x1420('0x3d')]({},_0x187101,_0x3ded9a[_0x1420('0x46')]);return db[_0x1420('0x41')][_0x1420('0x47')](_0x187101)[_0x1420('0x26')](handleEntityNotFound(_0x14348c,null))['then'](respondWithResult(_0x14348c,null))['catch'](handleError(_0x14348c,null));};exports[_0x1420('0x48')]=function(_0x5b8af2,_0x5084d8){return db[_0x1420('0x41')]['create'](_0x5b8af2[_0x1420('0x49')],{})[_0x1420('0x26')](respondWithResult(_0x5084d8,0xc9))[_0x1420('0x4a')](handleError(_0x5084d8,null));};exports[_0x1420('0x24')]=function(_0x2898e7,_0x3241c2){if(_0x2898e7[_0x1420('0x49')]['id']){delete _0x2898e7[_0x1420('0x49')]['id'];}return db[_0x1420('0x41')]['find']({'where':{'id':_0x2898e7[_0x1420('0x4b')]['id']}})[_0x1420('0x26')](handleEntityNotFound(_0x3241c2,null))[_0x1420('0x26')](saveUpdates(_0x2898e7[_0x1420('0x49')],null))[_0x1420('0x26')](respondWithResult(_0x3241c2,null))[_0x1420('0x4a')](handleError(_0x3241c2,null));};exports['destroy']=function(_0x5f1746,_0x13afe8){return db[_0x1420('0x41')][_0x1420('0x47')]({'where':{'id':_0x5f1746['params']['id']}})['then'](handleEntityNotFound(_0x13afe8,null))[_0x1420('0x26')](removeEntity(_0x13afe8,null))[_0x1420('0x4a')](handleError(_0x13afe8,null));};exports[_0x1420('0x4c')]=function(_0x4f7800,_0xf7e10e){return db[_0x1420('0x41')][_0x1420('0x4c')]()[_0x1420('0x26')](respondWithResult(_0xf7e10e,null))[_0x1420('0x4a')](handleError(_0xf7e10e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 603f961..66c4664 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 _0x91ee=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x207794,_0x1f5a2f){var _0x5b5621=function(_0x3cd977){while(--_0x3cd977){_0x207794['push'](_0x207794['shift']());}};_0x5b5621(++_0x1f5a2f);}(_0x91ee,0xd7));var _0xe91e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x91ee[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xe91e('0x0'));var util=require(_0xe91e('0x1'));var logger=require(_0xe91e('0x2'))(_0xe91e('0x3'));var moment=require(_0xe91e('0x4'));var BPromise=require(_0xe91e('0x5'));var rp=require(_0xe91e('0x6'));var fs=require('fs');var path=require(_0xe91e('0x7'));var rimraf=require(_0xe91e('0x8'));var config=require(_0xe91e('0x9'));var attributes=require(_0xe91e('0xa'));module[_0xe91e('0xb')]=function(_0x270a7f,_0x5a0f01){return _0x270a7f[_0xe91e('0xc')](_0xe91e('0xd'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d7e=['exports','define','report_square_details','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x5d141f,_0x167646){var _0x390840=function(_0x41a8d5){while(--_0x41a8d5){_0x5d141f['push'](_0x5d141f['shift']());}};_0x390840(++_0x167646);}(_0x3d7e,0xab));var _0xe3d7=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x3d7e[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0xe3d7('0x0'));var util=require(_0xe3d7('0x1'));var logger=require(_0xe3d7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe3d7('0x3'));var rp=require(_0xe3d7('0x4'));var fs=require('fs');var path=require(_0xe3d7('0x5'));var rimraf=require(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var attributes=require(_0xe3d7('0x8'));module[_0xe3d7('0x9')]=function(_0x28405d,_0x5d39f6){return _0x28405d[_0xe3d7('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xe3d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 5fb41ce..ffcfb04 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 _0x6d9d=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6d9d,0x130));var _0xd6d9=function(_0x285016,_0x4fb6db){_0x285016=_0x285016-0x0;var _0x4646b5=_0x6d9d[_0x285016];return _0x4646b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6d9('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6d9('0x1'));var db=require(_0xd6d9('0x2'))['db'];var utils=require(_0xd6d9('0x3'));var logger=require(_0xd6d9('0x4'))(_0xd6d9('0x5'));var config=require(_0xd6d9('0x6'));var jayson=require(_0xd6d9('0x7'));var client=jayson[_0xd6d9('0x8')][_0xd6d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4301be,_0x5e210d,_0x4a69d8){return new BPromise(function(_0x1f4f9a,_0x53f390){return client[_0xd6d9('0xa')](_0x4301be,_0x4a69d8)[_0xd6d9('0xb')](function(_0xe91cb8){logger[_0xd6d9('0xc')](_0xd6d9('0xd'),_0x5e210d,_0xd6d9('0xe'));logger[_0xd6d9('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5e210d,_0xd6d9('0xe'),JSON['stringify'](_0xe91cb8));if(_0xe91cb8['error']){if(_0xe91cb8[_0xd6d9('0x10')][_0xd6d9('0x11')]===0x1f4){logger['error'](_0xd6d9('0xd'),_0x5e210d,_0xe91cb8[_0xd6d9('0x10')][_0xd6d9('0x12')]);return _0x53f390(_0xe91cb8[_0xd6d9('0x10')][_0xd6d9('0x12')]);}logger['error'](_0xd6d9('0xd'),_0x5e210d,_0xe91cb8['error']['message']);return _0x1f4f9a(_0xe91cb8[_0xd6d9('0x10')][_0xd6d9('0x12')]);}else{logger[_0xd6d9('0xc')](_0xd6d9('0xd'),_0x5e210d,_0xd6d9('0xe'));_0x1f4f9a(_0xe91cb8[_0xd6d9('0x13')][_0xd6d9('0x12')]);}})[_0xd6d9('0x14')](function(_0xf199ab){logger['error'](_0xd6d9('0xd'),_0x5e210d,_0xf199ab);_0x53f390(_0xf199ab);});});}exports[_0xd6d9('0x15')]=function(_0x1017dc){var _0x11b4d9=this;return new Promise(function(_0x5b83ec,_0x2de61f){return db[_0xd6d9('0x16')][_0xd6d9('0x17')](_0x1017dc[_0xd6d9('0x18')],{'raw':_0x1017dc[_0xd6d9('0x19')]?_0x1017dc[_0xd6d9('0x19')][_0xd6d9('0x1a')]===undefined?!![]:![]:!![]})[_0xd6d9('0xb')](function(_0x7ebdd8){logger[_0xd6d9('0xc')](_0xd6d9('0x15'),_0x1017dc);logger['debug']('CreateSquareDetailsReport',_0x1017dc,JSON['stringify'](_0x7ebdd8));_0x5b83ec(_0x7ebdd8);})[_0xd6d9('0x14')](function(_0x29e851){logger[_0xd6d9('0x10')](_0xd6d9('0x15'),_0x29e851['message'],_0x1017dc);_0x2de61f(_0x11b4d9['error'](0x1f4,_0x29e851['message']));});});}; \ No newline at end of file +var _0xfb80=['util','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport'];(function(_0x4d2dea,_0x4e608e){var _0x1a5bb3=function(_0xbf8917){while(--_0xbf8917){_0x4d2dea['push'](_0x4d2dea['shift']());}};_0x1a5bb3(++_0x4e608e);}(_0xfb80,0x1a9));var _0x0fb8=function(_0x451ffc,_0x25afb7){_0x451ffc=_0x451ffc-0x0;var _0x1269bc=_0xfb80[_0x451ffc];return _0x1269bc;};'use strict';var _=require('lodash');var util=require(_0x0fb8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fb8('0x1'));var fs=require('fs');var Redis=require(_0x0fb8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0fb8('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fb8('0x4'));var client=jayson[_0x0fb8('0x5')][_0x0fb8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57c52e,_0x84e4fb,_0x195c54){return new BPromise(function(_0x4e65e1,_0x94a5d6){return client[_0x0fb8('0x7')](_0x57c52e,_0x195c54)[_0x0fb8('0x8')](function(_0x1c7b5e){logger[_0x0fb8('0x9')](_0x0fb8('0xa'),_0x84e4fb,_0x0fb8('0xb'));logger['debug'](_0x0fb8('0xc'),_0x84e4fb,_0x0fb8('0xb'),JSON[_0x0fb8('0xd')](_0x1c7b5e));if(_0x1c7b5e[_0x0fb8('0xe')]){if(_0x1c7b5e[_0x0fb8('0xe')][_0x0fb8('0xf')]===0x1f4){logger[_0x0fb8('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x84e4fb,_0x1c7b5e['error'][_0x0fb8('0x10')]);return _0x94a5d6(_0x1c7b5e[_0x0fb8('0xe')][_0x0fb8('0x10')]);}logger[_0x0fb8('0xe')](_0x0fb8('0xa'),_0x84e4fb,_0x1c7b5e[_0x0fb8('0xe')][_0x0fb8('0x10')]);return _0x4e65e1(_0x1c7b5e['error'][_0x0fb8('0x10')]);}else{logger[_0x0fb8('0x9')](_0x0fb8('0xa'),_0x84e4fb,_0x0fb8('0xb'));_0x4e65e1(_0x1c7b5e[_0x0fb8('0x11')]['message']);}})[_0x0fb8('0x12')](function(_0x134c9b){logger[_0x0fb8('0xe')](_0x0fb8('0xa'),_0x84e4fb,_0x134c9b);_0x94a5d6(_0x134c9b);});});}exports['CreateSquareDetailsReport']=function(_0x54a19a){var _0x34b6e6=this;return new Promise(function(_0x36131f,_0x376893){return db[_0x0fb8('0x13')][_0x0fb8('0x14')](_0x54a19a[_0x0fb8('0x15')],{'raw':_0x54a19a[_0x0fb8('0x16')]?_0x54a19a[_0x0fb8('0x16')][_0x0fb8('0x17')]===undefined?!![]:![]:!![]})[_0x0fb8('0x8')](function(_0x3f2c47){logger[_0x0fb8('0x9')](_0x0fb8('0x18'),_0x54a19a);logger['debug'](_0x0fb8('0x18'),_0x54a19a,JSON[_0x0fb8('0xd')](_0x3f2c47));_0x36131f(_0x3f2c47);})[_0x0fb8('0x12')](function(_0x1a04d3){logger['error'](_0x0fb8('0x18'),_0x1a04d3[_0x0fb8('0x10')],_0x54a19a);_0x376893(_0x34b6e6[_0x0fb8('0xe')](0x1f4,_0x1a04d3[_0x0fb8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3f86b55..54ef5dc 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 _0x5d2e=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express','Router','../../components/auth/service'];(function(_0x49fe6a,_0xa223e4){var _0x25249e=function(_0x4d75e8){while(--_0x4d75e8){_0x49fe6a['push'](_0x49fe6a['shift']());}};_0x25249e(++_0xa223e4);}(_0x5d2e,0x126));var _0xe5d2=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x5d2e[_0xb0f7c3];return _0x28ea68;};'use strict';var express=require(_0xe5d2('0x0'));var router=express[_0xe5d2('0x1')]();var auth=require(_0xe5d2('0x2'));var controller=require(_0xe5d2('0x3'));router[_0xe5d2('0x4')]('/',auth[_0xe5d2('0x5')](),controller[_0xe5d2('0x6')]);router[_0xe5d2('0x4')](_0xe5d2('0x7'),auth[_0xe5d2('0x5')](),controller['killProcess']);module[_0xe5d2('0x8')]=router; \ No newline at end of file +var _0x4f01=['get','isAuthenticated','index','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller'];(function(_0x541021,_0x6149e3){var _0x2ddc10=function(_0x19dd20){while(--_0x19dd20){_0x541021['push'](_0x541021['shift']());}};_0x2ddc10(++_0x6149e3);}(_0x4f01,0xe5));var _0x14f0=function(_0x215af5,_0x372c28){_0x215af5=_0x215af5-0x0;var _0x591625=_0x4f01[_0x215af5];return _0x591625;};'use strict';var express=require('express');var router=express[_0x14f0('0x0')]();var auth=require(_0x14f0('0x1'));var controller=require(_0x14f0('0x2'));router[_0x14f0('0x3')]('/',auth[_0x14f0('0x4')](),controller[_0x14f0('0x5')]);router[_0x14f0('0x3')](_0x14f0('0x6'),auth[_0x14f0('0x4')](),controller['killProcess']);module[_0x14f0('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6d3fe5b..513e949 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 _0x71fd=['status','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','indexOf','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x71fd,0x1c1));var _0xd71f=function(_0x529e40,_0x48d6e6){_0x529e40=_0x529e40-0x0;var _0x22aecb=_0x71fd[_0x529e40];return _0x22aecb;};'use strict';var info=require('systeminformation');var exec=require(_0xd71f('0x0'))['exec'];var logger=require(_0xd71f('0x1'))('api');var util=require('util');var BPromise=require(_0xd71f('0x2'));var _=require('lodash');function handleError(_0x22b02e,_0x3d03f6,_0x4132ce){_0x3d03f6=_0x3d03f6||0x1f4;return function(_0x2b8520){logger[_0xd71f('0x3')](_0xd71f('0x4'),_0x4132ce,_0x3d03f6,util[_0xd71f('0x5')](_0x2b8520,{'showHidden':![],'depth':null}));delete _0x2b8520[_0xd71f('0x6')];_0x22b02e[_0xd71f('0x7')](_0x3d03f6)['send'](_0x2b8520);};}exports['index']=function(_0x5f283e,_0x5e88a2){return info[_0xd71f('0x8')]()['then'](function(_0x347f92){return _0x5e88a2[_0xd71f('0x7')](0xc8)[_0xd71f('0x9')](_0x347f92);})[_0xd71f('0xa')](function(_0x5f2ccf){return _0x5e88a2[_0xd71f('0x7')](0x1f4)['json'](_0x5f2ccf);});};exports[_0xd71f('0xb')]=function(_0xcd5619,_0x2a8375){var _0x493da4=[_0xd71f('0xc')];return new BPromise(function(_0x5f17e2,_0x5e60bf){return exec(util[_0xd71f('0xd')](_0xd71f('0xe'),_0xcd5619[_0xd71f('0xf')]['pid']),function(_0x1a571a,_0x970cc6,_0x223177){if(_0x1a571a){return _0x5e60bf(_0x1a571a);}return _0x5f17e2(_0x970cc6);});})[_0xd71f('0x10')](function(_0x13cecd){var _0x3e6be2=![];var _0x301aaa=_0x13cecd[_0xd71f('0x11')](/\n/);for(var _0x4d99e3=0x0,_0x4a40ad=_0x493da4[_0xd71f('0x12')];_0x4d99e3<_0x4a40ad,_0x3e6be2===![];_0x4d99e3+=0x1){if(_0x13cecd[_0xd71f('0x13')](_0x493da4[_0x4d99e3])>=0x0){_0x3e6be2=!![];}}if(!_0x3e6be2){throw new Error(util[_0xd71f('0xd')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xcd5619[_0xd71f('0xf')]['pid']));}process[_0xd71f('0x14')](_0xcd5619[_0xd71f('0xf')][_0xd71f('0x15')],_0xd71f('0x16'));return _0x2a8375[_0xd71f('0x7')](0xc8)['json']({'message':util[_0xd71f('0xd')](_0xd71f('0x17'),_0xcd5619[_0xd71f('0xf')][_0xd71f('0x15')])});})['catch'](handleError(_0x2a8375,null,_0xd71f('0xb')));}; \ No newline at end of file +var _0x1401=['exec','api','util','bluebird','error','inspect','status','send','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process'];(function(_0x4851b1,_0x3f3607){var _0x1b643c=function(_0x41f67a){while(--_0x41f67a){_0x4851b1['push'](_0x4851b1['shift']());}};_0x1b643c(++_0x3f3607);}(_0x1401,0x144));var _0x1140=function(_0x24b281,_0x7be283){_0x24b281=_0x24b281-0x0;var _0x1da33e=_0x1401[_0x24b281];return _0x1da33e;};'use strict';var info=require('systeminformation');var exec=require(_0x1140('0x0'))[_0x1140('0x1')];var logger=require('../../config/logger')(_0x1140('0x2'));var util=require(_0x1140('0x3'));var BPromise=require(_0x1140('0x4'));var _=require('lodash');function handleError(_0x1b348c,_0x120ef2,_0x631155){_0x120ef2=_0x120ef2||0x1f4;return function(_0x59f9aa){logger[_0x1140('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x631155,_0x120ef2,util[_0x1140('0x6')](_0x59f9aa,{'showHidden':![],'depth':null}));delete _0x59f9aa['name'];_0x1b348c[_0x1140('0x7')](_0x120ef2)[_0x1140('0x8')](_0x59f9aa);};}exports['index']=function(_0x579393,_0xd2f75){return info['getAllData']()[_0x1140('0x9')](function(_0x4dc05e){return _0xd2f75['status'](0xc8)['json'](_0x4dc05e);})[_0x1140('0xa')](function(_0x53d516){return _0xd2f75['status'](0x1f4)[_0x1140('0xb')](_0x53d516);});};exports[_0x1140('0xc')]=function(_0x56cabf,_0x3b47bf){var _0x1775bf=[_0x1140('0xd')];return new BPromise(function(_0x126366,_0x6c00de){return exec(util['format'](_0x1140('0xe'),_0x56cabf[_0x1140('0xf')]['pid']),function(_0x31ded6,_0x246198,_0x4e3085){if(_0x31ded6){return _0x6c00de(_0x31ded6);}return _0x126366(_0x246198);});})['then'](function(_0x2702e4){var _0xcbbec3=![];var _0x39eae4=_0x2702e4[_0x1140('0x10')](/\n/);for(var _0x2e326f=0x0,_0x43cd7f=_0x1775bf[_0x1140('0x11')];_0x2e326f<_0x43cd7f,_0xcbbec3===![];_0x2e326f+=0x1){if(_0x2702e4[_0x1140('0x12')](_0x1775bf[_0x2e326f])>=0x0){_0xcbbec3=!![];}}if(!_0xcbbec3){throw new Error(util[_0x1140('0x13')](_0x1140('0x14'),_0x56cabf[_0x1140('0xf')][_0x1140('0x15')]));}process[_0x1140('0x16')](_0x56cabf[_0x1140('0xf')][_0x1140('0x15')],_0x1140('0x17'));return _0x3b47bf['status'](0xc8)[_0x1140('0xb')]({'message':util['format'](_0x1140('0x18'),_0x56cabf['params']['pid'])});})[_0x1140('0xa')](handleError(_0x3b47bf,null,_0x1140('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4d9ccba..a31f294 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 _0x5ff3=['/:id','show','create','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x324fe7,_0x3f73c9){var _0xc41ef7=function(_0x49455a){while(--_0x49455a){_0x324fe7['push'](_0x324fe7['shift']());}};_0xc41ef7(++_0x3f73c9);}(_0x5ff3,0x17d));var _0x35ff=function(_0x54f136,_0x2b9f58){_0x54f136=_0x54f136-0x0;var _0x20a325=_0x5ff3[_0x54f136];return _0x20a325;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./tag.controller');router[_0x35ff('0x6')]('/',auth[_0x35ff('0x7')](),controller[_0x35ff('0x8')]);router[_0x35ff('0x6')](_0x35ff('0x9'),auth['isAuthenticated'](),controller[_0x35ff('0xa')]);router['post']('/',auth[_0x35ff('0x7')](),controller[_0x35ff('0xb')]);router[_0x35ff('0xc')]('/:id',auth[_0x35ff('0x7')](),controller['update']);router[_0x35ff('0xd')](_0x35ff('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x35ff('0xe')]=router; \ No newline at end of file +var _0xe706=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0xe706,0xa3));var _0x6e70=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0xe706[_0x566667];return _0x277136;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0xe')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6e7a26e..3fe71f1 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 _0xe5b5=['exports','STRING','name','#0091EA','sequelize'];(function(_0x50c710,_0x504134){var _0x2d5f79=function(_0x73e66c){while(--_0x73e66c){_0x50c710['push'](_0x50c710['shift']());}};_0x2d5f79(++_0x504134);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xe5b5[_0x5beda8];return _0x2aa042;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'name':{'type':Sequelize[_0x5e5b('0x2')],'unique':_0x5e5b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':_0x5e5b('0x4')},'description':{'type':Sequelize[_0x5e5b('0x2')]}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0x54220b,_0x45aacf){var _0x54968f=function(_0x3c27de){while(--_0x3c27de){_0x54220b['push'](_0x54220b['shift']());}};_0x54968f(++_0x45aacf);}(_0x2032,0xd9));var _0x2203=function(_0xc42daf,_0x550248){_0xc42daf=_0xc42daf-0x0;var _0x2802ba=_0x2032[_0xc42daf];return _0x2802ba;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f537337..1ad6366 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 _0xc9f6=['ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','update','then','Tags','UserProfileResource','destroy','name','send','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','Tag','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0xc9f6,0x98));var _0x6c9f=function(_0x51789c,_0x3d5847){_0x51789c=_0x51789c-0x0;var _0x30128a=_0xc9f6[_0x51789c];return _0x30128a;};'use strict';var pdf=require(_0x6c9f('0x0'));var emlformat=require(_0x6c9f('0x1'));var rimraf=require(_0x6c9f('0x2'));var zipdir=require(_0x6c9f('0x3'));var jsonpatch=require(_0x6c9f('0x4'));var rp=require('request-promise');var moment=require(_0x6c9f('0x5'));var BPromise=require(_0x6c9f('0x6'));var Mustache=require(_0x6c9f('0x7'));var util=require(_0x6c9f('0x8'));var path=require('path');var sox=require(_0x6c9f('0x9'));var csv=require('to-csv');var ejs=require(_0x6c9f('0xa'));var fs=require('fs');var _=require(_0x6c9f('0xb'));var squel=require('squel');var crypto=require(_0x6c9f('0xc'));var jsforce=require(_0x6c9f('0xd'));var deskjs=require(_0x6c9f('0xe'));var toCsv=require(_0x6c9f('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6c9f('0x10'));var authService=require(_0x6c9f('0x11'));var qs=require(_0x6c9f('0x12'));var as=require(_0x6c9f('0x13'));var hardwareService=require(_0x6c9f('0x14'));var logger=require(_0x6c9f('0x15'))(_0x6c9f('0x16'));var utils=require('../../config/utils');var config=require(_0x6c9f('0x17'));var db=require(_0x6c9f('0x18'))['db'];function respondWithStatusCode(_0x465d38,_0x157bdd){_0x157bdd=_0x157bdd||0xcc;return function(_0x477291){if(_0x477291){return _0x465d38[_0x6c9f('0x19')](_0x157bdd);}return _0x465d38[_0x6c9f('0x1a')](_0x157bdd)[_0x6c9f('0x1b')]();};}function respondWithResult(_0x441db3,_0x507787){_0x507787=_0x507787||0xc8;return function(_0x4c1810){if(_0x4c1810){return _0x441db3[_0x6c9f('0x1a')](_0x507787)['json'](_0x4c1810);}};}function respondWithFilteredResult(_0x20ab4a,_0xfec06e){return function(_0xc080e4){if(_0xc080e4){var _0x3cc214=_0xc080e4[_0x6c9f('0x1c')],_0x549523=_0xfec06e['offset'],_0x44881d=_0xfec06e[_0x6c9f('0x1d')]+_0xfec06e['limit'],_0x7f3d9f;if(_0x44881d>=_0x3cc214){_0x44881d=_0x3cc214;_0x7f3d9f=0xc8;}else{_0x7f3d9f=0xce;}_0x20ab4a[_0x6c9f('0x1a')](_0x7f3d9f);return _0x20ab4a['set'](_0x6c9f('0x1e'),_0x549523+'-'+_0x44881d+'/'+_0x3cc214)[_0x6c9f('0x1f')](_0xc080e4);}return null;};}function patchUpdates(_0x3ea1f9){return function(_0x31a522){try{jsonpatch[_0x6c9f('0x20')](_0x31a522,_0x3ea1f9,!![]);}catch(_0x4a1d07){return BPromise[_0x6c9f('0x21')](_0x4a1d07);}return _0x31a522['save']();};}function saveUpdates(_0x16286f,_0x2170de){return function(_0x1e8526){if(_0x1e8526){return _0x1e8526[_0x6c9f('0x22')](_0x16286f)[_0x6c9f('0x23')](function(_0x304f10){return _0x304f10;});}return null;};}function removeEntity(_0x5cc88a,_0x1c2d75){return function(_0x263380){if(_0x263380){return _0x263380['destroy']()[_0x6c9f('0x23')](function(){var _0x407227=_0x263380['get']({'plain':!![]});var _0x17bb15=_0x6c9f('0x24');return db[_0x6c9f('0x25')][_0x6c9f('0x26')]({'where':{'type':_0x17bb15,'resourceId':_0x407227['id']}})[_0x6c9f('0x23')](function(){return _0x263380;});})['then'](function(){_0x5cc88a[_0x6c9f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e37a6,_0x51b8c3){return function(_0x1cf369){if(!_0x1cf369){_0x5e37a6[_0x6c9f('0x19')](0x194);}return _0x1cf369;};}function handleError(_0x1d790b,_0x55f068){_0x55f068=_0x55f068||0x1f4;return function(_0x56a223){logger['error'](_0x56a223['stack']);if(_0x56a223[_0x6c9f('0x27')]){delete _0x56a223[_0x6c9f('0x27')];}_0x1d790b[_0x6c9f('0x1a')](_0x55f068)[_0x6c9f('0x28')](_0x56a223);};}exports[_0x6c9f('0x29')]=function(_0x35af0f,_0x3e0bae){var _0x47efaf={},_0xc36bea={},_0x1161b5={'count':0x0,'rows':[]};var _0x1c873a=_[_0x6c9f('0x2a')](db['Tag']['rawAttributes'],function(_0x1b25a6){return{'name':_0x1b25a6[_0x6c9f('0x2b')],'type':_0x1b25a6[_0x6c9f('0x2c')][_0x6c9f('0x2d')]};});_0xc36bea['model']=_[_0x6c9f('0x2a')](_0x1c873a,_0x6c9f('0x27'));_0xc36bea[_0x6c9f('0x2e')]=_['keys'](_0x35af0f[_0x6c9f('0x2e')]);_0xc36bea[_0x6c9f('0x2f')]=_[_0x6c9f('0x30')](_0xc36bea[_0x6c9f('0x31')],_0xc36bea['query']);_0x47efaf['attributes']=_[_0x6c9f('0x30')](_0xc36bea[_0x6c9f('0x31')],qs[_0x6c9f('0x32')](_0x35af0f[_0x6c9f('0x2e')][_0x6c9f('0x32')]));_0x47efaf['attributes']=_0x47efaf[_0x6c9f('0x33')][_0x6c9f('0x34')]?_0x47efaf[_0x6c9f('0x33')]:_0xc36bea[_0x6c9f('0x31')];if(!_0x35af0f[_0x6c9f('0x2e')]['hasOwnProperty'](_0x6c9f('0x35'))){_0x47efaf[_0x6c9f('0x36')]=qs['limit'](_0x35af0f[_0x6c9f('0x2e')][_0x6c9f('0x36')]);_0x47efaf[_0x6c9f('0x1d')]=qs[_0x6c9f('0x1d')](_0x35af0f[_0x6c9f('0x2e')][_0x6c9f('0x1d')]);}_0x47efaf[_0x6c9f('0x37')]=qs[_0x6c9f('0x38')](_0x35af0f[_0x6c9f('0x2e')][_0x6c9f('0x38')]);_0x47efaf[_0x6c9f('0x39')]=qs[_0x6c9f('0x2f')](_[_0x6c9f('0x3a')](_0x35af0f[_0x6c9f('0x2e')],_0xc36bea[_0x6c9f('0x2f')]),_0x1c873a);if(_0x35af0f['query']['filter']){_0x47efaf[_0x6c9f('0x39')]=_[_0x6c9f('0x3b')](_0x47efaf['where'],{'$or':_[_0x6c9f('0x2a')](_0x1c873a,function(_0x2abfb3){if(_0x2abfb3[_0x6c9f('0x2c')]!==_0x6c9f('0x3c')){var _0x18e6a8={};_0x18e6a8[_0x2abfb3['name']]={'$like':'%'+_0x35af0f['query'][_0x6c9f('0x3d')]+'%'};return _0x18e6a8;}})});}_0x47efaf=_[_0x6c9f('0x3b')]({},_0x47efaf,_0x35af0f[_0x6c9f('0x3e')]);var _0x22b389={'where':_0x47efaf[_0x6c9f('0x39')]};return db[_0x6c9f('0x3f')]['count'](_0x22b389)[_0x6c9f('0x23')](function(_0x5c6913){_0x1161b5[_0x6c9f('0x1c')]=_0x5c6913;if(_0x35af0f[_0x6c9f('0x2e')][_0x6c9f('0x40')]){_0x47efaf[_0x6c9f('0x41')]=[{'all':!![]}];}return db['Tag'][_0x6c9f('0x42')](_0x47efaf);})[_0x6c9f('0x23')](function(_0x2f63cc){_0x1161b5['rows']=_0x2f63cc;return _0x1161b5;})[_0x6c9f('0x23')](respondWithFilteredResult(_0x3e0bae,_0x47efaf))[_0x6c9f('0x43')](handleError(_0x3e0bae,null));};exports[_0x6c9f('0x44')]=function(_0x413395,_0x113d6c){var _0x5bb93b={'raw':!![],'where':{'id':_0x413395[_0x6c9f('0x45')]['id']}},_0x38edcf={};_0x38edcf['model']=_[_0x6c9f('0x46')](db[_0x6c9f('0x3f')][_0x6c9f('0x47')]);_0x38edcf['query']=_[_0x6c9f('0x46')](_0x413395[_0x6c9f('0x2e')]);_0x38edcf[_0x6c9f('0x2f')]=_[_0x6c9f('0x30')](_0x38edcf['model'],_0x38edcf[_0x6c9f('0x2e')]);_0x5bb93b[_0x6c9f('0x33')]=_[_0x6c9f('0x30')](_0x38edcf[_0x6c9f('0x31')],qs[_0x6c9f('0x32')](_0x413395['query'][_0x6c9f('0x32')]));_0x5bb93b[_0x6c9f('0x33')]=_0x5bb93b[_0x6c9f('0x33')][_0x6c9f('0x34')]?_0x5bb93b[_0x6c9f('0x33')]:_0x38edcf[_0x6c9f('0x31')];if(_0x413395[_0x6c9f('0x2e')][_0x6c9f('0x40')]){_0x5bb93b['include']=[{'all':!![]}];}_0x5bb93b=_[_0x6c9f('0x3b')]({},_0x5bb93b,_0x413395[_0x6c9f('0x3e')]);return db['Tag'][_0x6c9f('0x48')](_0x5bb93b)[_0x6c9f('0x23')](handleEntityNotFound(_0x113d6c,null))[_0x6c9f('0x23')](respondWithResult(_0x113d6c,null))[_0x6c9f('0x43')](handleError(_0x113d6c,null));};exports[_0x6c9f('0x49')]=function(_0x2dca83,_0x370966){return db[_0x6c9f('0x3f')][_0x6c9f('0x49')](_0x2dca83[_0x6c9f('0x4a')],{})[_0x6c9f('0x23')](function(_0x4ebe9e){var _0x7866d0=_0x2dca83[_0x6c9f('0x4b')]['get']({'plain':!![]});if(!_0x7866d0)throw new Error(_0x6c9f('0x4c'));if(_0x7866d0[_0x6c9f('0x4d')]===_0x6c9f('0x4b')){var _0x4dfd41=_0x4ebe9e['get']({'plain':!![]});var _0x2d452a=_0x6c9f('0x24');return db['UserProfileSection'][_0x6c9f('0x48')]({'where':{'name':_0x2d452a,'userProfileId':_0x7866d0[_0x6c9f('0x4e')]},'raw':!![]})[_0x6c9f('0x23')](function(_0x128027){if(_0x128027&&_0x128027['autoAssociation']===0x0){return db['UserProfileResource'][_0x6c9f('0x49')]({'name':_0x4dfd41[_0x6c9f('0x27')],'resourceId':_0x4dfd41['id'],'type':_0x128027[_0x6c9f('0x27')],'sectionId':_0x128027['id']},{})['then'](function(){return _0x4ebe9e;});}else{return _0x4ebe9e;}})[_0x6c9f('0x43')](function(_0x3d9e8a){logger[_0x6c9f('0x4f')](_0x6c9f('0x50'),_0x3d9e8a);throw _0x3d9e8a;});}return _0x4ebe9e;})[_0x6c9f('0x23')](respondWithResult(_0x370966,0xc9))[_0x6c9f('0x43')](handleError(_0x370966,null));};exports['update']=function(_0x473619,_0x1313f1){if(_0x473619[_0x6c9f('0x4a')]['id']){delete _0x473619[_0x6c9f('0x4a')]['id'];}return db[_0x6c9f('0x3f')][_0x6c9f('0x48')]({'where':{'id':_0x473619[_0x6c9f('0x45')]['id']}})[_0x6c9f('0x23')](handleEntityNotFound(_0x1313f1,null))['then'](saveUpdates(_0x473619[_0x6c9f('0x4a')],null))[_0x6c9f('0x23')](respondWithResult(_0x1313f1,null))['catch'](handleError(_0x1313f1,null));};exports['destroy']=function(_0x10caf4,_0xb70bfe){return db[_0x6c9f('0x3f')][_0x6c9f('0x48')]({'where':{'id':_0x10caf4[_0x6c9f('0x45')]['id']}})[_0x6c9f('0x23')](handleEntityNotFound(_0xb70bfe,null))[_0x6c9f('0x23')](removeEntity(_0xb70bfe,null))[_0x6c9f('0x43')](handleError(_0xb70bfe,null));}; \ No newline at end of file +var _0x5460=['map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','fieldName','key','model'];(function(_0x430326,_0x4d74cf){var _0x218bd3=function(_0x79a0ac){while(--_0x79a0ac){_0x430326['push'](_0x430326['shift']());}};_0x218bd3(++_0x4d74cf);}(_0x5460,0xd2));var _0x0546=function(_0x5dd511,_0x375d07){_0x5dd511=_0x5dd511-0x0;var _0x128597=_0x5460[_0x5dd511];return _0x128597;};'use strict';var pdf=require(_0x0546('0x0'));var emlformat=require(_0x0546('0x1'));var rimraf=require(_0x0546('0x2'));var zipdir=require(_0x0546('0x3'));var jsonpatch=require(_0x0546('0x4'));var rp=require(_0x0546('0x5'));var moment=require(_0x0546('0x6'));var BPromise=require(_0x0546('0x7'));var Mustache=require(_0x0546('0x8'));var util=require(_0x0546('0x9'));var path=require('path');var sox=require(_0x0546('0xa'));var csv=require(_0x0546('0xb'));var ejs=require(_0x0546('0xc'));var fs=require('fs');var _=require(_0x0546('0xd'));var squel=require('squel');var crypto=require(_0x0546('0xe'));var jsforce=require(_0x0546('0xf'));var deskjs=require(_0x0546('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0546('0x11'));var Papa=require(_0x0546('0x12'));var Redis=require(_0x0546('0x13'));var authService=require(_0x0546('0x14'));var qs=require(_0x0546('0x15'));var as=require(_0x0546('0x16'));var hardwareService=require(_0x0546('0x17'));var logger=require(_0x0546('0x18'))(_0x0546('0x19'));var utils=require(_0x0546('0x1a'));var config=require(_0x0546('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x376e6b,_0xfc0a93){_0xfc0a93=_0xfc0a93||0xcc;return function(_0x662f1d){if(_0x662f1d){return _0x376e6b[_0x0546('0x1c')](_0xfc0a93);}return _0x376e6b[_0x0546('0x1d')](_0xfc0a93)[_0x0546('0x1e')]();};}function respondWithResult(_0x22c271,_0x20b60a){_0x20b60a=_0x20b60a||0xc8;return function(_0x4635f7){if(_0x4635f7){return _0x22c271[_0x0546('0x1d')](_0x20b60a)[_0x0546('0x1f')](_0x4635f7);}};}function respondWithFilteredResult(_0x427ba5,_0xbaaa1f){return function(_0x1b3d97){if(_0x1b3d97){var _0x3c78ce=_0x1b3d97[_0x0546('0x20')],_0x2c8931=_0xbaaa1f[_0x0546('0x21')],_0x122ab6=_0xbaaa1f['offset']+_0xbaaa1f['limit'],_0x242b17;if(_0x122ab6>=_0x3c78ce){_0x122ab6=_0x3c78ce;_0x242b17=0xc8;}else{_0x242b17=0xce;}_0x427ba5[_0x0546('0x1d')](_0x242b17);return _0x427ba5[_0x0546('0x22')](_0x0546('0x23'),_0x2c8931+'-'+_0x122ab6+'/'+_0x3c78ce)[_0x0546('0x1f')](_0x1b3d97);}return null;};}function patchUpdates(_0x4fb3f7){return function(_0x4b7625){try{jsonpatch[_0x0546('0x24')](_0x4b7625,_0x4fb3f7,!![]);}catch(_0xd762fc){return BPromise['reject'](_0xd762fc);}return _0x4b7625[_0x0546('0x25')]();};}function saveUpdates(_0x4ba9a5,_0x11c35){return function(_0x5a79b8){if(_0x5a79b8){return _0x5a79b8[_0x0546('0x26')](_0x4ba9a5)[_0x0546('0x27')](function(_0x108f03){return _0x108f03;});}return null;};}function removeEntity(_0x576e13,_0x45df02){return function(_0x1ef663){if(_0x1ef663){return _0x1ef663[_0x0546('0x28')]()['then'](function(){var _0x2d07c8=_0x1ef663[_0x0546('0x29')]({'plain':!![]});var _0x57ad23=_0x0546('0x2a');return db[_0x0546('0x2b')]['destroy']({'where':{'type':_0x57ad23,'resourceId':_0x2d07c8['id']}})[_0x0546('0x27')](function(){return _0x1ef663;});})[_0x0546('0x27')](function(){_0x576e13[_0x0546('0x1d')](0xcc)[_0x0546('0x1e')]();});}};}function handleEntityNotFound(_0x6b3def,_0x26a4d5){return function(_0x10f1f7){if(!_0x10f1f7){_0x6b3def[_0x0546('0x1c')](0x194);}return _0x10f1f7;};}function handleError(_0x103504,_0x2ae92b){_0x2ae92b=_0x2ae92b||0x1f4;return function(_0x21b3e1){logger[_0x0546('0x2c')](_0x21b3e1[_0x0546('0x2d')]);if(_0x21b3e1[_0x0546('0x2e')]){delete _0x21b3e1['name'];}_0x103504['status'](_0x2ae92b)[_0x0546('0x2f')](_0x21b3e1);};}exports[_0x0546('0x30')]=function(_0x5625d3,_0x43e0ff){var _0x4cc05b={},_0x1ed266={},_0x12deaa={'count':0x0,'rows':[]};var _0x1a6b62=_['map'](db[_0x0546('0x31')][_0x0546('0x32')],function(_0x1eeea9){return{'name':_0x1eeea9[_0x0546('0x33')],'type':_0x1eeea9['type'][_0x0546('0x34')]};});_0x1ed266[_0x0546('0x35')]=_[_0x0546('0x36')](_0x1a6b62,_0x0546('0x2e'));_0x1ed266[_0x0546('0x37')]=_[_0x0546('0x38')](_0x5625d3[_0x0546('0x37')]);_0x1ed266['filters']=_[_0x0546('0x39')](_0x1ed266['model'],_0x1ed266['query']);_0x4cc05b['attributes']=_['intersection'](_0x1ed266[_0x0546('0x35')],qs[_0x0546('0x3a')](_0x5625d3['query']['fields']));_0x4cc05b[_0x0546('0x3b')]=_0x4cc05b[_0x0546('0x3b')][_0x0546('0x3c')]?_0x4cc05b['attributes']:_0x1ed266['model'];if(!_0x5625d3[_0x0546('0x37')][_0x0546('0x3d')](_0x0546('0x3e'))){_0x4cc05b[_0x0546('0x3f')]=qs[_0x0546('0x3f')](_0x5625d3[_0x0546('0x37')][_0x0546('0x3f')]);_0x4cc05b['offset']=qs[_0x0546('0x21')](_0x5625d3['query'][_0x0546('0x21')]);}_0x4cc05b['order']=qs[_0x0546('0x40')](_0x5625d3[_0x0546('0x37')][_0x0546('0x40')]);_0x4cc05b[_0x0546('0x41')]=qs[_0x0546('0x42')](_['pick'](_0x5625d3['query'],_0x1ed266[_0x0546('0x42')]),_0x1a6b62);if(_0x5625d3[_0x0546('0x37')][_0x0546('0x43')]){_0x4cc05b[_0x0546('0x41')]=_['merge'](_0x4cc05b[_0x0546('0x41')],{'$or':_['map'](_0x1a6b62,function(_0x164603){if(_0x164603[_0x0546('0x44')]!==_0x0546('0x45')){var _0xcbe22d={};_0xcbe22d[_0x164603[_0x0546('0x2e')]]={'$like':'%'+_0x5625d3[_0x0546('0x37')]['filter']+'%'};return _0xcbe22d;}})});}_0x4cc05b=_[_0x0546('0x46')]({},_0x4cc05b,_0x5625d3[_0x0546('0x47')]);var _0x313fbd={'where':_0x4cc05b[_0x0546('0x41')]};return db[_0x0546('0x31')]['count'](_0x313fbd)[_0x0546('0x27')](function(_0x2c0fc9){_0x12deaa[_0x0546('0x20')]=_0x2c0fc9;if(_0x5625d3['query'][_0x0546('0x48')]){_0x4cc05b[_0x0546('0x49')]=[{'all':!![]}];}return db[_0x0546('0x31')][_0x0546('0x4a')](_0x4cc05b);})['then'](function(_0x59ab2a){_0x12deaa[_0x0546('0x4b')]=_0x59ab2a;return _0x12deaa;})[_0x0546('0x27')](respondWithFilteredResult(_0x43e0ff,_0x4cc05b))['catch'](handleError(_0x43e0ff,null));};exports[_0x0546('0x4c')]=function(_0x2de6bd,_0x565bec){var _0x1af656={'raw':!![],'where':{'id':_0x2de6bd['params']['id']}},_0x2ce445={};_0x2ce445[_0x0546('0x35')]=_['keys'](db[_0x0546('0x31')][_0x0546('0x32')]);_0x2ce445[_0x0546('0x37')]=_[_0x0546('0x38')](_0x2de6bd[_0x0546('0x37')]);_0x2ce445[_0x0546('0x42')]=_[_0x0546('0x39')](_0x2ce445[_0x0546('0x35')],_0x2ce445['query']);_0x1af656[_0x0546('0x3b')]=_[_0x0546('0x39')](_0x2ce445[_0x0546('0x35')],qs[_0x0546('0x3a')](_0x2de6bd['query'][_0x0546('0x3a')]));_0x1af656[_0x0546('0x3b')]=_0x1af656[_0x0546('0x3b')]['length']?_0x1af656[_0x0546('0x3b')]:_0x2ce445[_0x0546('0x35')];if(_0x2de6bd[_0x0546('0x37')][_0x0546('0x48')]){_0x1af656[_0x0546('0x49')]=[{'all':!![]}];}_0x1af656=_[_0x0546('0x46')]({},_0x1af656,_0x2de6bd['options']);return db[_0x0546('0x31')]['find'](_0x1af656)[_0x0546('0x27')](handleEntityNotFound(_0x565bec,null))[_0x0546('0x27')](respondWithResult(_0x565bec,null))[_0x0546('0x4d')](handleError(_0x565bec,null));};exports[_0x0546('0x4e')]=function(_0x3e14f2,_0x408903){return db[_0x0546('0x31')][_0x0546('0x4e')](_0x3e14f2[_0x0546('0x4f')],{})[_0x0546('0x27')](function(_0x1d8b8d){var _0x10daa4=_0x3e14f2[_0x0546('0x50')][_0x0546('0x29')]({'plain':!![]});if(!_0x10daa4)throw new Error(_0x0546('0x51'));if(_0x10daa4[_0x0546('0x52')]==='user'){var _0x43dd59=_0x1d8b8d['get']({'plain':!![]});var _0x4ec9ed=_0x0546('0x2a');return db[_0x0546('0x53')]['find']({'where':{'name':_0x4ec9ed,'userProfileId':_0x10daa4[_0x0546('0x54')]},'raw':!![]})[_0x0546('0x27')](function(_0x14ae37){if(_0x14ae37&&_0x14ae37[_0x0546('0x55')]===0x0){return db[_0x0546('0x2b')][_0x0546('0x4e')]({'name':_0x43dd59[_0x0546('0x2e')],'resourceId':_0x43dd59['id'],'type':_0x14ae37[_0x0546('0x2e')],'sectionId':_0x14ae37['id']},{})[_0x0546('0x27')](function(){return _0x1d8b8d;});}else{return _0x1d8b8d;}})['catch'](function(_0x3d5f49){logger[_0x0546('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5f49);throw _0x3d5f49;});}return _0x1d8b8d;})['then'](respondWithResult(_0x408903,0xc9))['catch'](handleError(_0x408903,null));};exports[_0x0546('0x26')]=function(_0x122185,_0x1d77ad){if(_0x122185['body']['id']){delete _0x122185[_0x0546('0x4f')]['id'];}return db[_0x0546('0x31')]['find']({'where':{'id':_0x122185[_0x0546('0x56')]['id']}})[_0x0546('0x27')](handleEntityNotFound(_0x1d77ad,null))[_0x0546('0x27')](saveUpdates(_0x122185[_0x0546('0x4f')],null))[_0x0546('0x27')](respondWithResult(_0x1d77ad,null))[_0x0546('0x4d')](handleError(_0x1d77ad,null));};exports['destroy']=function(_0x347e97,_0x4e76dd){return db['Tag'][_0x0546('0x57')]({'where':{'id':_0x347e97['params']['id']}})[_0x0546('0x27')](handleEntityNotFound(_0x4e76dd,null))['then'](removeEntity(_0x4e76dd,null))['catch'](handleError(_0x4e76dd,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7e59941..1a4a028 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 _0x36eb=['Tag','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./tag.attributes','exports'];(function(_0x462cb9,_0x581639){var _0x58dd35=function(_0x42bf39){while(--_0x42bf39){_0x462cb9['push'](_0x462cb9['shift']());}};_0x58dd35(++_0x581639);}(_0x36eb,0xb5));var _0xb36e=function(_0x10d8fb,_0x176b83){_0x10d8fb=_0x10d8fb-0x0;var _0x1e9413=_0x36eb[_0x10d8fb];return _0x1e9413;};'use strict';var _=require('lodash');var util=require(_0xb36e('0x0'));var logger=require(_0xb36e('0x1'))(_0xb36e('0x2'));var moment=require(_0xb36e('0x3'));var BPromise=require(_0xb36e('0x4'));var rp=require(_0xb36e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb36e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb36e('0x7'));module[_0xb36e('0x8')]=function(_0x201b33,_0x2cca2e){return _0x201b33['define'](_0xb36e('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d06=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x579e52,_0x164227){var _0x2ca01d=function(_0x5a7c48){while(--_0x5a7c48){_0x579e52['push'](_0x579e52['shift']());}};_0x2ca01d(++_0x164227);}(_0x1d06,0x1bc));var _0x61d0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1d06[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x61d0('0x0'));var util=require('util');var logger=require(_0x61d0('0x1'))(_0x61d0('0x2'));var moment=require(_0x61d0('0x3'));var BPromise=require('bluebird');var rp=require(_0x61d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61d0('0x5'));var config=require(_0x61d0('0x6'));var attributes=require(_0x61d0('0x7'));module[_0x61d0('0x8')]=function(_0x4698f0,_0x47367d){return _0x4698f0[_0x61d0('0x9')](_0x61d0('0xa'),attributes,{'tableName':_0x61d0('0xb'),'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 d49be5a..f7bf539 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 _0x7072=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x519a6f,_0x52cb04){var _0x221793=function(_0x2da616){while(--_0x2da616){_0x519a6f['push'](_0x519a6f['shift']());}};_0x221793(++_0x52cb04);}(_0x7072,0x138));var _0x2707=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7072[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});} \ No newline at end of file +var _0x3140=['jayson/promise','client','http','request','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d7883,_0x334166){var _0x386248=function(_0x3f2fa0){while(--_0x3f2fa0){_0x3d7883['push'](_0x3d7883['shift']());}};_0x386248(++_0x334166);}(_0x3140,0xaf));var _0x0314=function(_0x29af75,_0x152b87){_0x29af75=_0x29af75-0x0;var _0x32b56b=_0x3140[_0x29af75];return _0x32b56b;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Tag,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c8f6a89..902ab91 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 _0xc74a=['isAuthenticated','getQueues','/:id/users','post','create','addQueues','addAgents','put','update','delete','removeQueues','removeAgents','exports','util','path','connect-timeout','express','Router','./team.controller','get','index','/:id','show','/:id/queues'];(function(_0x820827,_0x21b7f7){var _0x344e5a=function(_0x166f68){while(--_0x166f68){_0x820827['push'](_0x820827['shift']());}};_0x344e5a(++_0x21b7f7);}(_0xc74a,0xfd));var _0xac74=function(_0x18eb2a,_0x25b8fb){_0x18eb2a=_0x18eb2a-0x0;var _0x4c2a71=_0xc74a[_0x18eb2a];return _0x4c2a71;};'use strict';var multer=require('multer');var util=require(_0xac74('0x0'));var path=require(_0xac74('0x1'));var timeout=require(_0xac74('0x2'));var express=require(_0xac74('0x3'));var router=express[_0xac74('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac74('0x5'));router[_0xac74('0x6')]('/',auth['isAuthenticated'](),controller[_0xac74('0x7')]);router[_0xac74('0x6')](_0xac74('0x8'),auth['isAuthenticated'](),controller[_0xac74('0x9')]);router[_0xac74('0x6')](_0xac74('0xa'),auth[_0xac74('0xb')](),controller[_0xac74('0xc')]);router['get'](_0xac74('0xd'),auth[_0xac74('0xb')](),controller['getAgents']);router[_0xac74('0xe')]('/',auth[_0xac74('0xb')](),controller[_0xac74('0xf')]);router[_0xac74('0xe')](_0xac74('0xa'),auth['isAuthenticated'](),controller[_0xac74('0x10')]);router[_0xac74('0xe')](_0xac74('0xd'),auth[_0xac74('0xb')](),controller[_0xac74('0x11')]);router[_0xac74('0x12')](_0xac74('0x8'),auth[_0xac74('0xb')](),controller[_0xac74('0x13')]);router['delete'](_0xac74('0x8'),auth[_0xac74('0xb')](),controller['destroy']);router[_0xac74('0x14')](_0xac74('0xa'),auth[_0xac74('0xb')](),controller[_0xac74('0x15')]);router[_0xac74('0x14')](_0xac74('0xd'),auth[_0xac74('0xb')](),controller[_0xac74('0x16')]);module[_0xac74('0x17')]=router; \ No newline at end of file +var _0xebb0=['put','update','delete','removeQueues','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','isAuthenticated','show','/:id/queues','/:id/users','getAgents','post','addQueues'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0xebb0,0xa6));var _0x0ebb=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xebb0[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0x0ebb('0x0'));var util=require('util');var path=require(_0x0ebb('0x1'));var timeout=require(_0x0ebb('0x2'));var express=require(_0x0ebb('0x3'));var router=express['Router']();var auth=require(_0x0ebb('0x4'));var interaction=require(_0x0ebb('0x5'));var config=require(_0x0ebb('0x6'));var controller=require(_0x0ebb('0x7'));router[_0x0ebb('0x8')]('/',auth['isAuthenticated'](),controller[_0x0ebb('0x9')]);router['get'](_0x0ebb('0xa'),auth[_0x0ebb('0xb')](),controller[_0x0ebb('0xc')]);router[_0x0ebb('0x8')](_0x0ebb('0xd'),auth[_0x0ebb('0xb')](),controller['getQueues']);router['get'](_0x0ebb('0xe'),auth[_0x0ebb('0xb')](),controller[_0x0ebb('0xf')]);router[_0x0ebb('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ebb('0x10')](_0x0ebb('0xd'),auth[_0x0ebb('0xb')](),controller[_0x0ebb('0x11')]);router['post'](_0x0ebb('0xe'),auth[_0x0ebb('0xb')](),controller['addAgents']);router[_0x0ebb('0x12')](_0x0ebb('0xa'),auth['isAuthenticated'](),controller[_0x0ebb('0x13')]);router[_0x0ebb('0x14')](_0x0ebb('0xa'),auth[_0x0ebb('0xb')](),controller['destroy']);router[_0x0ebb('0x14')](_0x0ebb('0xd'),auth[_0x0ebb('0xb')](),controller[_0x0ebb('0x15')]);router[_0x0ebb('0x14')]('/:id/users',auth[_0x0ebb('0xb')](),controller[_0x0ebb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 4ad7230..89ed58d 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 _0xd3d5=['sequelize','name','STRING'];(function(_0x246c60,_0x47c0de){var _0x2032da=function(_0x5fefa7){while(--_0x5fefa7){_0x246c60['push'](_0x246c60['shift']());}};_0x2032da(++_0x47c0de);}(_0xd3d5,0x123));var _0x5d3d=function(_0x4bb065,_0x5a3b0d){_0x4bb065=_0x4bb065-0x0;var _0x47bee6=_0xd3d5[_0x4bb065];return _0x47bee6;};'use strict';var Sequelize=require(_0x5d3d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5d3d('0x1')},'description':{'type':Sequelize[_0x5d3d('0x2')]}}; \ No newline at end of file +var _0x3158=['name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3158,0x1ba));var _0x8315=function(_0x2c4fba,_0x1c0bb7){_0x2c4fba=_0x2c4fba-0x0;var _0x207521=_0x3158[_0x2c4fba];return _0x207521;};'use strict';var Sequelize=require(_0x8315('0x0'));module[_0x8315('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8315('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index eaaea7a..90b21e0 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 _0x1b43=['params','add','removeQueues','ids','addAgents','Voice','Chat','Mail','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','omit','spread','removeAgents','voice','chat','mail','sms','fax','openchannel','emit','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','count','set','Content-Range','apply','save','then','destroy','get','Teams','UserProfileResource','end','stack','name','send','map','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','offset','sort','where','filter','VIRTUAL','options','Team','includeAll','include','findAll','catch','show','keys','rawAttributes','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','order','pick','Queues','addQueues'];(function(_0x275a9f,_0x52eb15){var _0x553971=function(_0x22d7b2){while(--_0x22d7b2){_0x275a9f['push'](_0x275a9f['shift']());}};_0x553971(++_0x52eb15);}(_0x1b43,0x19a));var _0x31b4=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x1b43[_0x2cf2e9];return _0xd3670d;};'use strict';var pdf=require(_0x31b4('0x0'));var emlformat=require(_0x31b4('0x1'));var rimraf=require(_0x31b4('0x2'));var zipdir=require(_0x31b4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31b4('0x4'));var moment=require(_0x31b4('0x5'));var BPromise=require(_0x31b4('0x6'));var Mustache=require('mustache');var util=require(_0x31b4('0x7'));var path=require(_0x31b4('0x8'));var sox=require(_0x31b4('0x9'));var csv=require(_0x31b4('0xa'));var ejs=require(_0x31b4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x31b4('0xc'));var jsforce=require(_0x31b4('0xd'));var deskjs=require(_0x31b4('0xe'));var toCsv=require(_0x31b4('0xa'));var querystring=require(_0x31b4('0xf'));var Papa=require(_0x31b4('0x10'));var Redis=require(_0x31b4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x31b4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31b4('0x13'));var logger=require('../../config/logger')(_0x31b4('0x14'));var utils=require(_0x31b4('0x15'));var config=require('../../config/environment');var db=require(_0x31b4('0x16'))['db'];config[_0x31b4('0x17')]=_[_0x31b4('0x18')](config[_0x31b4('0x17')],{'host':_0x31b4('0x19'),'port':0x18eb});var socket=require(_0x31b4('0x1a'))(new Redis(config[_0x31b4('0x17')]));require(_0x31b4('0x1b'))[_0x31b4('0x1c')](socket);function respondWithStatusCode(_0x488c28,_0x2cb4f3){_0x2cb4f3=_0x2cb4f3||0xcc;return function(_0x4d4e10){if(_0x4d4e10){return _0x488c28[_0x31b4('0x1d')](_0x2cb4f3);}return _0x488c28[_0x31b4('0x1e')](_0x2cb4f3)['end']();};}function respondWithResult(_0x1975e8,_0x12f42a){_0x12f42a=_0x12f42a||0xc8;return function(_0x133a8e){if(_0x133a8e){return _0x1975e8[_0x31b4('0x1e')](_0x12f42a)['json'](_0x133a8e);}};}function respondWithFilteredResult(_0x45787b,_0x29e181){return function(_0x2df1dd){if(_0x2df1dd){var _0x351925=_0x2df1dd[_0x31b4('0x1f')],_0x35c8cf=_0x29e181['offset'],_0x150019=_0x29e181['offset']+_0x29e181['limit'],_0x412a21;if(_0x150019>=_0x351925){_0x150019=_0x351925;_0x412a21=0xc8;}else{_0x412a21=0xce;}_0x45787b[_0x31b4('0x1e')](_0x412a21);return _0x45787b[_0x31b4('0x20')](_0x31b4('0x21'),_0x35c8cf+'-'+_0x150019+'/'+_0x351925)['json'](_0x2df1dd);}return null;};}function patchUpdates(_0x1608e1){return function(_0x2957bd){try{jsonpatch[_0x31b4('0x22')](_0x2957bd,_0x1608e1,!![]);}catch(_0x2464da){return BPromise['reject'](_0x2464da);}return _0x2957bd[_0x31b4('0x23')]();};}function saveUpdates(_0x378d6d,_0x1532af){return function(_0x4e676d){if(_0x4e676d){return _0x4e676d['update'](_0x378d6d)[_0x31b4('0x24')](function(_0x59f302){return _0x59f302;});}return null;};}function removeEntity(_0x23a67f,_0x5d9754){return function(_0x4de830){if(_0x4de830){return _0x4de830[_0x31b4('0x25')]()[_0x31b4('0x24')](function(){var _0x46c769=_0x4de830[_0x31b4('0x26')]({'plain':!![]});var _0x50517a=_0x31b4('0x27');return db[_0x31b4('0x28')][_0x31b4('0x25')]({'where':{'type':_0x50517a,'resourceId':_0x46c769['id']}})[_0x31b4('0x24')](function(){return _0x4de830;});})[_0x31b4('0x24')](function(){_0x23a67f[_0x31b4('0x1e')](0xcc)[_0x31b4('0x29')]();});}};}function handleEntityNotFound(_0x4d6f02,_0x54af40){return function(_0x934e2f){if(!_0x934e2f){_0x4d6f02[_0x31b4('0x1d')](0x194);}return _0x934e2f;};}function handleError(_0x3bf5d9,_0x55de5f){_0x55de5f=_0x55de5f||0x1f4;return function(_0x5d4835){logger['error'](_0x5d4835[_0x31b4('0x2a')]);if(_0x5d4835[_0x31b4('0x2b')]){delete _0x5d4835['name'];}_0x3bf5d9['status'](_0x55de5f)[_0x31b4('0x2c')](_0x5d4835);};}exports['index']=function(_0x37bb26,_0x48eec6){var _0x3db389={},_0x14714c={},_0x26335d={'count':0x0,'rows':[]};var _0x30a63d=_[_0x31b4('0x2d')](db['Team']['rawAttributes'],function(_0x7212d2){return{'name':_0x7212d2[_0x31b4('0x2e')],'type':_0x7212d2[_0x31b4('0x2f')]['key']};});_0x14714c[_0x31b4('0x30')]=_[_0x31b4('0x2d')](_0x30a63d,_0x31b4('0x2b'));_0x14714c[_0x31b4('0x31')]=_['keys'](_0x37bb26['query']);_0x14714c[_0x31b4('0x32')]=_['intersection'](_0x14714c[_0x31b4('0x30')],_0x14714c[_0x31b4('0x31')]);_0x3db389[_0x31b4('0x33')]=_[_0x31b4('0x34')](_0x14714c[_0x31b4('0x30')],qs[_0x31b4('0x35')](_0x37bb26['query'][_0x31b4('0x35')]));_0x3db389[_0x31b4('0x33')]=_0x3db389[_0x31b4('0x33')][_0x31b4('0x36')]?_0x3db389['attributes']:_0x14714c[_0x31b4('0x30')];if(!_0x37bb26['query'][_0x31b4('0x37')]('nolimit')){_0x3db389[_0x31b4('0x38')]=qs[_0x31b4('0x38')](_0x37bb26['query']['limit']);_0x3db389[_0x31b4('0x39')]=qs['offset'](_0x37bb26[_0x31b4('0x31')][_0x31b4('0x39')]);}_0x3db389['order']=qs[_0x31b4('0x3a')](_0x37bb26[_0x31b4('0x31')][_0x31b4('0x3a')]);_0x3db389[_0x31b4('0x3b')]=qs[_0x31b4('0x32')](_['pick'](_0x37bb26[_0x31b4('0x31')],_0x14714c[_0x31b4('0x32')]),_0x30a63d);if(_0x37bb26[_0x31b4('0x31')][_0x31b4('0x3c')]){_0x3db389[_0x31b4('0x3b')]=_['merge'](_0x3db389[_0x31b4('0x3b')],{'$or':_[_0x31b4('0x2d')](_0x30a63d,function(_0xbd9e97){if(_0xbd9e97[_0x31b4('0x2f')]!==_0x31b4('0x3d')){var _0x18f030={};_0x18f030[_0xbd9e97['name']]={'$like':'%'+_0x37bb26['query'][_0x31b4('0x3c')]+'%'};return _0x18f030;}})});}_0x3db389=_['merge']({},_0x3db389,_0x37bb26[_0x31b4('0x3e')]);var _0x21d904={'where':_0x3db389['where']};return db[_0x31b4('0x3f')][_0x31b4('0x1f')](_0x21d904)[_0x31b4('0x24')](function(_0xdd22e2){_0x26335d[_0x31b4('0x1f')]=_0xdd22e2;if(_0x37bb26[_0x31b4('0x31')][_0x31b4('0x40')]){_0x3db389[_0x31b4('0x41')]=[{'all':!![]}];}return db['Team'][_0x31b4('0x42')](_0x3db389);})[_0x31b4('0x24')](function(_0x201542){_0x26335d['rows']=_0x201542;return _0x26335d;})[_0x31b4('0x24')](respondWithFilteredResult(_0x48eec6,_0x3db389))[_0x31b4('0x43')](handleError(_0x48eec6,null));};exports[_0x31b4('0x44')]=function(_0x55574c,_0x1f0295){var _0x4c2ee8={'raw':![],'where':{'id':_0x55574c['params']['id']}},_0x5a9600={};_0x5a9600[_0x31b4('0x30')]=_[_0x31b4('0x45')](db[_0x31b4('0x3f')][_0x31b4('0x46')]);_0x5a9600['query']=_[_0x31b4('0x45')](_0x55574c[_0x31b4('0x31')]);_0x5a9600['filters']=_[_0x31b4('0x34')](_0x5a9600[_0x31b4('0x30')],_0x5a9600[_0x31b4('0x31')]);_0x4c2ee8[_0x31b4('0x33')]=_[_0x31b4('0x34')](_0x5a9600[_0x31b4('0x30')],qs[_0x31b4('0x35')](_0x55574c['query'][_0x31b4('0x35')]));_0x4c2ee8['attributes']=_0x4c2ee8[_0x31b4('0x33')][_0x31b4('0x36')]?_0x4c2ee8[_0x31b4('0x33')]:_0x5a9600['model'];if(_0x55574c['query'][_0x31b4('0x40')]){_0x4c2ee8[_0x31b4('0x41')]=[{'all':!![]}];}_0x4c2ee8=_[_0x31b4('0x47')]({},_0x4c2ee8,_0x55574c[_0x31b4('0x3e')]);return db[_0x31b4('0x3f')][_0x31b4('0x48')](_0x4c2ee8)['then'](handleEntityNotFound(_0x1f0295,null))[_0x31b4('0x24')](respondWithResult(_0x1f0295,null))[_0x31b4('0x43')](handleError(_0x1f0295,null));};exports[_0x31b4('0x49')]=function(_0x2c2cb8,_0x1d4dae){return db['Team'][_0x31b4('0x49')](_0x2c2cb8['body'],{})[_0x31b4('0x24')](function(_0xa88109){var _0x4bce54=_0x2c2cb8[_0x31b4('0x4a')]['get']({'plain':!![]});if(!_0x4bce54)throw new Error(_0x31b4('0x4b'));if(_0x4bce54[_0x31b4('0x4c')]==='user'){var _0x5afa08=_0xa88109['get']({'plain':!![]});var _0x43a1f1='Teams';return db[_0x31b4('0x4d')][_0x31b4('0x48')]({'where':{'name':_0x43a1f1,'userProfileId':_0x4bce54[_0x31b4('0x4e')]},'raw':!![]})[_0x31b4('0x24')](function(_0x41660d){if(_0x41660d&&_0x41660d[_0x31b4('0x4f')]===0x0){return db[_0x31b4('0x28')]['create']({'name':_0x5afa08[_0x31b4('0x2b')],'resourceId':_0x5afa08['id'],'type':_0x41660d[_0x31b4('0x2b')],'sectionId':_0x41660d['id']},{})['then'](function(){return _0xa88109;});}else{return _0xa88109;}})['catch'](function(_0xe83b90){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe83b90);throw _0xe83b90;});}return _0xa88109;})[_0x31b4('0x24')](respondWithResult(_0x1d4dae,0xc9))[_0x31b4('0x43')](handleError(_0x1d4dae,null));};exports[_0x31b4('0x50')]=function(_0x299463,_0x159613){if(_0x299463[_0x31b4('0x51')]['id']){delete _0x299463[_0x31b4('0x51')]['id'];}return db['Team']['find']({'where':{'id':_0x299463['params']['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x159613,null))[_0x31b4('0x24')](saveUpdates(_0x299463[_0x31b4('0x51')],null))[_0x31b4('0x24')](respondWithResult(_0x159613,null))[_0x31b4('0x43')](handleError(_0x159613,null));};exports[_0x31b4('0x25')]=function(_0x3810f9,_0x5e5059){return db[_0x31b4('0x3f')]['find']({'where':{'id':_0x3810f9['params']['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x5e5059,null))['then'](removeEntity(_0x5e5059,null))['catch'](handleError(_0x5e5059,null));};exports['getQueues']=function(_0x188a98,_0x3babe3,_0x2af164){return db[_0x31b4('0x3f')][_0x31b4('0x52')]({'where':{'id':_0x188a98['params']['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x3babe3,null))['then'](function(_0x4f3f41){if(!_0x188a98[_0x31b4('0x31')][_0x31b4('0x53')]||!utils[_0x31b4('0x54')](_0x188a98[_0x31b4('0x31')][_0x31b4('0x53')])){throw new db[(_0x31b4('0x55'))][(_0x31b4('0x56'))](_0x31b4('0x57'));}var _0x4b051a={};var _0xecdf38={};_0xecdf38[_0x31b4('0x30')]=_[_0x31b4('0x45')](db[_[_0x31b4('0x58')](_0x188a98[_0x31b4('0x31')][_0x31b4('0x53')][_0x31b4('0x59')]())+'Queue'][_0x31b4('0x46')]);_0xecdf38[_0x31b4('0x31')]=_[_0x31b4('0x45')](_0x188a98[_0x31b4('0x31')]);_0xecdf38[_0x31b4('0x32')]=_[_0x31b4('0x34')](_0xecdf38['model'],_0xecdf38[_0x31b4('0x31')]);_0x4b051a[_0x31b4('0x33')]=_[_0x31b4('0x34')](_0xecdf38[_0x31b4('0x30')],qs['fields'](_0x188a98[_0x31b4('0x31')][_0x31b4('0x35')]));_0x4b051a[_0x31b4('0x33')]=_0x4b051a['attributes'][_0x31b4('0x36')]?_0x4b051a[_0x31b4('0x33')]:_0xecdf38[_0x31b4('0x30')];_0x4b051a[_0x31b4('0x38')]=qs[_0x31b4('0x38')](_0x188a98[_0x31b4('0x31')][_0x31b4('0x38')]);_0x4b051a['offset']=qs[_0x31b4('0x39')](_0x188a98['query'][_0x31b4('0x39')]);_0x4b051a[_0x31b4('0x5a')]=qs[_0x31b4('0x3a')](_0x188a98[_0x31b4('0x31')][_0x31b4('0x3a')]);_0x4b051a[_0x31b4('0x3b')]=qs['filters'](_[_0x31b4('0x5b')](_0x188a98['query'],_0xecdf38['filters']));_0x4b051a=_[_0x31b4('0x47')]({},_0x4b051a,_0x188a98['options']);return _0x4f3f41[_0x31b4('0x26')+_[_0x31b4('0x58')](_0x188a98[_0x31b4('0x31')][_0x31b4('0x53')][_0x31b4('0x59')]())+_0x31b4('0x5c')](_0x4b051a);})[_0x31b4('0x24')](respondWithResult(_0x3babe3,null))[_0x31b4('0x43')](handleError(_0x3babe3,null));};exports[_0x31b4('0x5d')]=function(_0x5dd782,_0x5127aa,_0x295de0){return db[_0x31b4('0x3f')]['findOne']({'where':{'id':_0x5dd782[_0x31b4('0x5e')]['id']}})[_0x31b4('0x24')](function(_0x27930a){if(_0x27930a){if(!_0x5dd782[_0x31b4('0x51')][_0x31b4('0x53')]||!utils[_0x31b4('0x54')](_0x5dd782[_0x31b4('0x51')][_0x31b4('0x53')])){throw new db[(_0x31b4('0x55'))][(_0x31b4('0x56'))]('Unknown\x20channel');}return _0x27930a[_0x31b4('0x5f')+_[_0x31b4('0x58')](_0x5dd782[_0x31b4('0x51')][_0x31b4('0x53')]['toLowerCase']())+_0x31b4('0x5c')](_0x5dd782[_0x31b4('0x51')]['ids']);}return null;})[_0x31b4('0x24')](handleEntityNotFound(_0x5127aa,null))['then'](respondWithStatusCode(_0x5127aa,null))['catch'](handleError(_0x5127aa,null));};exports[_0x31b4('0x60')]=function(_0x48fa92,_0x2cfc12,_0x1080d3){return db[_0x31b4('0x3f')]['findOne']({'where':{'id':_0x48fa92[_0x31b4('0x5e')]['id']}})[_0x31b4('0x24')](function(_0x50e267){if(_0x50e267){if(!_0x48fa92[_0x31b4('0x31')]['channel']||!utils[_0x31b4('0x54')](_0x48fa92[_0x31b4('0x31')][_0x31b4('0x53')])){throw new db[(_0x31b4('0x55'))][(_0x31b4('0x56'))](_0x31b4('0x57'));}return _0x50e267['remove'+_[_0x31b4('0x58')](_0x48fa92['query']['channel']['toLowerCase']())+_0x31b4('0x5c')](_0x48fa92['query'][_0x31b4('0x61')]);}return null;})[_0x31b4('0x24')](handleEntityNotFound(_0x2cfc12,null))[_0x31b4('0x24')](respondWithStatusCode(_0x2cfc12,null))[_0x31b4('0x43')](handleError(_0x2cfc12,null));};exports[_0x31b4('0x62')]=function(_0x6336c,_0x504000,_0x2934dd){return db['Team'][_0x31b4('0x48')]({'where':{'id':_0x6336c[_0x31b4('0x5e')]['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x504000,null))['then'](function(_0x3b0cb9){if(_0x3b0cb9){var _0x487d97=[_0x31b4('0x63'),_0x31b4('0x64'),_0x31b4('0x65'),'Sms','Fax',_0x31b4('0x66'),'Whatsapp'];return BPromise[_0x31b4('0x67')](_0x487d97,function(_0x5daa03){return _0x3b0cb9[_0x31b4('0x26')+_0x5daa03+_0x31b4('0x5c')]({'attributes':['id','name']})[_0x31b4('0x24')](function(_0x5e586e){return BPromise[_0x31b4('0x67')](_0x5e586e,function(_0x1c1d3c){return _0x1c1d3c[_0x31b4('0x62')](_0x6336c[_0x31b4('0x51')][_0x31b4('0x61')])[_0x31b4('0x24')](function(){if(_0x5daa03==='Voice'){return db[_0x31b4('0x68')][_0x31b4('0x42')]({'where':{'id':_0x6336c[_0x31b4('0x51')][_0x31b4('0x61')]},'attributes':['id',_0x31b4('0x2b'),_0x31b4('0x69'),_0x31b4('0x6a'),_0x31b4('0x6b')],'raw':!![]})['then'](function(_0x315ded){return BPromise[_0x31b4('0x67')](_[_0x31b4('0x3c')](_0x315ded,{'online':0x1}),function(_0x39495b){return db[_0x31b4('0x6c')][_0x31b4('0x6d')]({'membername':_0x39495b[_0x31b4('0x2b')],'UserId':_0x39495b['id'],'queue_name':_0x1c1d3c[_0x31b4('0x2b')],'VoiceQueueId':_0x1c1d3c['id'],'interface':_[_0x31b4('0x6e')](_0x39495b[_0x31b4('0x6b')])?util[_0x31b4('0x6f')](_0x31b4('0x70'),_0x39495b['name']):_0x39495b['interface'],'paused':_0x39495b['voicePause']||![],'penalty':0x0});});});}});});})['then'](function(){return _0x3b0cb9;});})[_0x31b4('0x24')](function(){return _0x3b0cb9;});}})[_0x31b4('0x24')](function(_0x54f2c9){if(_0x54f2c9){return _0x54f2c9['addAgents'](_0x6336c[_0x31b4('0x51')][_0x31b4('0x61')],_[_0x31b4('0x71')](_0x6336c[_0x31b4('0x51')],['ids','id'])||{})[_0x31b4('0x72')](function(_0x2f56b1){for(var _0xe43f99=0x0;_0xe43f99<_0x6336c[_0x31b4('0x51')]['ids'][_0x31b4('0x36')];_0xe43f99+=0x1){socket['emit']('userTeam:save',{'UserId':_0x6336c[_0x31b4('0x51')][_0x31b4('0x61')][_0xe43f99],'TeamId':_0x6336c['params']['id']});}return _0x2f56b1;});}})[_0x31b4('0x24')](respondWithResult(_0x504000,null))['catch'](handleError(_0x504000,null));};exports[_0x31b4('0x73')]=function(_0x1387d4,_0x510879,_0x4f2cb0){return db['Team'][_0x31b4('0x48')]({'where':{'id':_0x1387d4['params']['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x510879,null))[_0x31b4('0x24')](function(_0x3cdd71){if(_0x3cdd71){return BPromise[_0x31b4('0x67')]([_0x31b4('0x74'),_0x31b4('0x75'),_0x31b4('0x76'),_0x31b4('0x77'),_0x31b4('0x78'),_0x31b4('0x79'),'whatsapp'],function(_0x5c35ca){return _0x3cdd71[_0x31b4('0x26')+_[_0x31b4('0x58')](_0x5c35ca)+_0x31b4('0x5c')]({'attributes':['id','name']})[_0x31b4('0x24')](function(_0x15826b){return BPromise[_0x31b4('0x67')](_0x15826b,function(_0x50bc7a){return _0x50bc7a[_0x31b4('0x73')](_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')])[_0x31b4('0x24')](function(){if(_0x5c35ca===_0x31b4('0x74')){return db[_0x31b4('0x6c')][_0x31b4('0x25')]({'where':{'VoiceQueueId':_0x50bc7a['id'],'UserId':_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')]}});}});});})[_0x31b4('0x24')](function(){return _0x3cdd71;});})['then'](function(){return _0x3cdd71;});}})[_0x31b4('0x24')](function(_0x22e2a1){if(_0x22e2a1){return _0x22e2a1[_0x31b4('0x73')](_0x1387d4['query'][_0x31b4('0x61')])['then'](function(){if(_['isArray'](_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')])){for(var _0x4763e3=0x0;_0x4763e3<_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')][_0x31b4('0x36')];_0x4763e3+=0x1){socket[_0x31b4('0x7a')](_0x31b4('0x7b'),{'UserId':Number(_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')][_0x4763e3]),'TeamId':Number(_0x1387d4[_0x31b4('0x5e')]['id'])});}}else{socket['emit'](_0x31b4('0x7b'),{'UserId':Number(_0x1387d4[_0x31b4('0x31')][_0x31b4('0x61')]),'TeamId':Number(_0x1387d4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x510879,null))[_0x31b4('0x43')](handleError(_0x510879,null));};exports[_0x31b4('0x7c')]=function(_0x461173,_0x42ed0b,_0x1dcfc1){var _0xd76a13={};var _0x4bb133={};var _0x3b3d1f;var _0x3a6230;return db[_0x31b4('0x3f')]['findOne']({'where':{'id':_0x461173[_0x31b4('0x5e')]['id']}})[_0x31b4('0x24')](handleEntityNotFound(_0x42ed0b,null))[_0x31b4('0x24')](function(_0x3a1c0e){if(_0x3a1c0e){_0x3b3d1f=_0x3a1c0e;_0x4bb133[_0x31b4('0x30')]=_[_0x31b4('0x45')](db[_0x31b4('0x68')]['rawAttributes']);_0x4bb133['query']=_[_0x31b4('0x45')](_0x461173[_0x31b4('0x31')]);_0x4bb133[_0x31b4('0x32')]=_[_0x31b4('0x34')](_0x4bb133[_0x31b4('0x30')],_0x4bb133[_0x31b4('0x31')]);_0xd76a13[_0x31b4('0x33')]=_['intersection'](_0x4bb133[_0x31b4('0x30')],qs['fields'](_0x461173[_0x31b4('0x31')]['fields']));_0xd76a13['attributes']=_0xd76a13[_0x31b4('0x33')][_0x31b4('0x36')]?_0xd76a13[_0x31b4('0x33')]:_0x4bb133['model'];_0xd76a13['order']=qs[_0x31b4('0x3a')](_0x461173[_0x31b4('0x31')][_0x31b4('0x3a')]);_0xd76a13['where']=qs[_0x31b4('0x32')](_[_0x31b4('0x5b')](_0x461173[_0x31b4('0x31')],_0x4bb133[_0x31b4('0x32')]));if(_0x461173[_0x31b4('0x31')]['filter']){_0xd76a13[_0x31b4('0x3b')]=_[_0x31b4('0x47')](_0xd76a13[_0x31b4('0x3b')],{'$or':_[_0x31b4('0x2d')](_0xd76a13[_0x31b4('0x33')],function(_0xeac2d9){var _0x21e046={};_0x21e046[_0xeac2d9]={'$like':'%'+_0x461173['query']['filter']+'%'};return _0x21e046;})});}_0xd76a13=_[_0x31b4('0x47')]({},_0xd76a13,_0x461173['options']);return _0x3b3d1f[_0x31b4('0x7c')](_0xd76a13);}})[_0x31b4('0x24')](function(_0x13efb5){if(_0x13efb5){_0x3a6230=_0x13efb5[_0x31b4('0x36')];if(!_0x461173[_0x31b4('0x31')][_0x31b4('0x37')](_0x31b4('0x7d'))){_0xd76a13[_0x31b4('0x38')]=qs[_0x31b4('0x38')](_0x461173['query'][_0x31b4('0x38')]);_0xd76a13[_0x31b4('0x39')]=qs[_0x31b4('0x39')](_0x461173['query'][_0x31b4('0x39')]);}return _0x3b3d1f['getAgents'](_0xd76a13);}})[_0x31b4('0x24')](function(_0x304254){if(_0x304254){return _0x304254?{'count':_0x3a6230,'rows':_0x304254}:null;}})[_0x31b4('0x24')](respondWithResult(_0x42ed0b,null))[_0x31b4('0x43')](handleError(_0x42ed0b,null));}; \ No newline at end of file +var _0xc476=['ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','count','offset','limit','Content-Range','json','apply','reject','update','destroy','then','Teams','UserProfileResource','sendStatus','error','name','send','index','map','Team','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','catch','user','get','role','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','sort','pick','Queues','add','ids','remove','Voice','Chat','Mail','Sms','Fax','Whatsapp','each','addAgents','User','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','spread','userTeam:save','removeAgents','voice','chat','mail','sms','fax','openchannel','isArray','userTeam:remove','emit','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xc476,0xfb));var _0x6c47=function(_0x433157,_0x5bc755){_0x433157=_0x433157-0x0;var _0x30dd99=_0xc476[_0x433157];return _0x30dd99;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6c47('0x0'));var rimraf=require(_0x6c47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c47('0x2'));var rp=require('request-promise');var moment=require(_0x6c47('0x3'));var BPromise=require(_0x6c47('0x4'));var Mustache=require(_0x6c47('0x5'));var util=require(_0x6c47('0x6'));var path=require(_0x6c47('0x7'));var sox=require('sox');var csv=require(_0x6c47('0x8'));var ejs=require(_0x6c47('0x9'));var fs=require('fs');var _=require(_0x6c47('0xa'));var squel=require(_0x6c47('0xb'));var crypto=require(_0x6c47('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c47('0x8'));var querystring=require('querystring');var Papa=require(_0x6c47('0xd'));var Redis=require(_0x6c47('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6c47('0xf'));var as=require(_0x6c47('0x10'));var hardwareService=require(_0x6c47('0x11'));var logger=require(_0x6c47('0x12'))(_0x6c47('0x13'));var utils=require('../../config/utils');var config=require(_0x6c47('0x14'));var db=require(_0x6c47('0x15'))['db'];config[_0x6c47('0x16')]=_[_0x6c47('0x17')](config[_0x6c47('0x16')],{'host':_0x6c47('0x18'),'port':0x18eb});var socket=require(_0x6c47('0x19'))(new Redis(config[_0x6c47('0x16')]));require(_0x6c47('0x1a'))[_0x6c47('0x1b')](socket);function respondWithStatusCode(_0x2cbc54,_0xcb76af){_0xcb76af=_0xcb76af||0xcc;return function(_0x2335d9){if(_0x2335d9){return _0x2cbc54['sendStatus'](_0xcb76af);}return _0x2cbc54[_0x6c47('0x1c')](_0xcb76af)[_0x6c47('0x1d')]();};}function respondWithResult(_0x234a80,_0x1c084e){_0x1c084e=_0x1c084e||0xc8;return function(_0x579403){if(_0x579403){return _0x234a80['status'](_0x1c084e)['json'](_0x579403);}};}function respondWithFilteredResult(_0x1c5139,_0x1e893e){return function(_0x3e86ba){if(_0x3e86ba){var _0x202d16=_0x3e86ba[_0x6c47('0x1e')],_0xd3b58c=_0x1e893e['offset'],_0x1266e8=_0x1e893e[_0x6c47('0x1f')]+_0x1e893e[_0x6c47('0x20')],_0x308c6a;if(_0x1266e8>=_0x202d16){_0x1266e8=_0x202d16;_0x308c6a=0xc8;}else{_0x308c6a=0xce;}_0x1c5139[_0x6c47('0x1c')](_0x308c6a);return _0x1c5139['set'](_0x6c47('0x21'),_0xd3b58c+'-'+_0x1266e8+'/'+_0x202d16)[_0x6c47('0x22')](_0x3e86ba);}return null;};}function patchUpdates(_0x2536bf){return function(_0x25094e){try{jsonpatch[_0x6c47('0x23')](_0x25094e,_0x2536bf,!![]);}catch(_0x4782d2){return BPromise[_0x6c47('0x24')](_0x4782d2);}return _0x25094e['save']();};}function saveUpdates(_0x1aefc1,_0x1d7357){return function(_0x504484){if(_0x504484){return _0x504484[_0x6c47('0x25')](_0x1aefc1)['then'](function(_0x577d53){return _0x577d53;});}return null;};}function removeEntity(_0x2c7d15,_0xc93140){return function(_0x34a75d){if(_0x34a75d){return _0x34a75d[_0x6c47('0x26')]()[_0x6c47('0x27')](function(){var _0xecdc2e=_0x34a75d['get']({'plain':!![]});var _0x26eb07=_0x6c47('0x28');return db[_0x6c47('0x29')][_0x6c47('0x26')]({'where':{'type':_0x26eb07,'resourceId':_0xecdc2e['id']}})['then'](function(){return _0x34a75d;});})[_0x6c47('0x27')](function(){_0x2c7d15[_0x6c47('0x1c')](0xcc)[_0x6c47('0x1d')]();});}};}function handleEntityNotFound(_0x4cf2ce,_0x5f4836){return function(_0xa2a0c1){if(!_0xa2a0c1){_0x4cf2ce[_0x6c47('0x2a')](0x194);}return _0xa2a0c1;};}function handleError(_0x4081ea,_0x32e67b){_0x32e67b=_0x32e67b||0x1f4;return function(_0x7b006){logger[_0x6c47('0x2b')](_0x7b006['stack']);if(_0x7b006[_0x6c47('0x2c')]){delete _0x7b006[_0x6c47('0x2c')];}_0x4081ea[_0x6c47('0x1c')](_0x32e67b)[_0x6c47('0x2d')](_0x7b006);};}exports[_0x6c47('0x2e')]=function(_0x5ac482,_0x39a220){var _0x5c0e96={},_0x40b58e={},_0xa4204c={'count':0x0,'rows':[]};var _0x11228f=_[_0x6c47('0x2f')](db[_0x6c47('0x30')]['rawAttributes'],function(_0x4a4a22){return{'name':_0x4a4a22[_0x6c47('0x31')],'type':_0x4a4a22[_0x6c47('0x32')][_0x6c47('0x33')]};});_0x40b58e['model']=_[_0x6c47('0x2f')](_0x11228f,_0x6c47('0x2c'));_0x40b58e[_0x6c47('0x34')]=_[_0x6c47('0x35')](_0x5ac482[_0x6c47('0x34')]);_0x40b58e[_0x6c47('0x36')]=_[_0x6c47('0x37')](_0x40b58e[_0x6c47('0x38')],_0x40b58e['query']);_0x5c0e96[_0x6c47('0x39')]=_[_0x6c47('0x37')](_0x40b58e[_0x6c47('0x38')],qs['fields'](_0x5ac482['query']['fields']));_0x5c0e96[_0x6c47('0x39')]=_0x5c0e96[_0x6c47('0x39')][_0x6c47('0x3a')]?_0x5c0e96[_0x6c47('0x39')]:_0x40b58e[_0x6c47('0x38')];if(!_0x5ac482[_0x6c47('0x34')][_0x6c47('0x3b')](_0x6c47('0x3c'))){_0x5c0e96[_0x6c47('0x20')]=qs[_0x6c47('0x20')](_0x5ac482[_0x6c47('0x34')]['limit']);_0x5c0e96[_0x6c47('0x1f')]=qs[_0x6c47('0x1f')](_0x5ac482[_0x6c47('0x34')][_0x6c47('0x1f')]);}_0x5c0e96[_0x6c47('0x3d')]=qs['sort'](_0x5ac482[_0x6c47('0x34')]['sort']);_0x5c0e96['where']=qs['filters'](_['pick'](_0x5ac482[_0x6c47('0x34')],_0x40b58e[_0x6c47('0x36')]),_0x11228f);if(_0x5ac482[_0x6c47('0x34')][_0x6c47('0x3e')]){_0x5c0e96[_0x6c47('0x3f')]=_['merge'](_0x5c0e96[_0x6c47('0x3f')],{'$or':_[_0x6c47('0x2f')](_0x11228f,function(_0xe56531){if(_0xe56531[_0x6c47('0x32')]!==_0x6c47('0x40')){var _0x5675b3={};_0x5675b3[_0xe56531['name']]={'$like':'%'+_0x5ac482[_0x6c47('0x34')][_0x6c47('0x3e')]+'%'};return _0x5675b3;}})});}_0x5c0e96=_[_0x6c47('0x41')]({},_0x5c0e96,_0x5ac482[_0x6c47('0x42')]);var _0x922e05={'where':_0x5c0e96[_0x6c47('0x3f')]};return db[_0x6c47('0x30')][_0x6c47('0x1e')](_0x922e05)[_0x6c47('0x27')](function(_0x5448d3){_0xa4204c['count']=_0x5448d3;if(_0x5ac482[_0x6c47('0x34')][_0x6c47('0x43')]){_0x5c0e96[_0x6c47('0x44')]=[{'all':!![]}];}return db[_0x6c47('0x30')][_0x6c47('0x45')](_0x5c0e96);})['then'](function(_0x2228af){_0xa4204c[_0x6c47('0x46')]=_0x2228af;return _0xa4204c;})[_0x6c47('0x27')](respondWithFilteredResult(_0x39a220,_0x5c0e96))['catch'](handleError(_0x39a220,null));};exports[_0x6c47('0x47')]=function(_0x24d229,_0x2e8d99){var _0x49df07={'raw':![],'where':{'id':_0x24d229[_0x6c47('0x48')]['id']}},_0x236fd8={};_0x236fd8[_0x6c47('0x38')]=_[_0x6c47('0x35')](db[_0x6c47('0x30')][_0x6c47('0x49')]);_0x236fd8['query']=_['keys'](_0x24d229[_0x6c47('0x34')]);_0x236fd8[_0x6c47('0x36')]=_[_0x6c47('0x37')](_0x236fd8[_0x6c47('0x38')],_0x236fd8[_0x6c47('0x34')]);_0x49df07['attributes']=_[_0x6c47('0x37')](_0x236fd8[_0x6c47('0x38')],qs[_0x6c47('0x4a')](_0x24d229[_0x6c47('0x34')][_0x6c47('0x4a')]));_0x49df07[_0x6c47('0x39')]=_0x49df07['attributes'][_0x6c47('0x3a')]?_0x49df07[_0x6c47('0x39')]:_0x236fd8[_0x6c47('0x38')];if(_0x24d229[_0x6c47('0x34')][_0x6c47('0x43')]){_0x49df07[_0x6c47('0x44')]=[{'all':!![]}];}_0x49df07=_[_0x6c47('0x41')]({},_0x49df07,_0x24d229[_0x6c47('0x42')]);return db[_0x6c47('0x30')]['find'](_0x49df07)[_0x6c47('0x27')](handleEntityNotFound(_0x2e8d99,null))[_0x6c47('0x27')](respondWithResult(_0x2e8d99,null))[_0x6c47('0x4b')](handleError(_0x2e8d99,null));};exports['create']=function(_0x333680,_0x29bdf3){return db[_0x6c47('0x30')]['create'](_0x333680['body'],{})[_0x6c47('0x27')](function(_0x5c32be){var _0x2b8903=_0x333680[_0x6c47('0x4c')][_0x6c47('0x4d')]({'plain':!![]});if(!_0x2b8903)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b8903[_0x6c47('0x4e')]===_0x6c47('0x4c')){var _0x12f2c5=_0x5c32be[_0x6c47('0x4d')]({'plain':!![]});var _0x3327c3=_0x6c47('0x28');return db['UserProfileSection'][_0x6c47('0x4f')]({'where':{'name':_0x3327c3,'userProfileId':_0x2b8903['userProfileId']},'raw':!![]})[_0x6c47('0x27')](function(_0x320783){if(_0x320783&&_0x320783[_0x6c47('0x50')]===0x0){return db[_0x6c47('0x29')][_0x6c47('0x51')]({'name':_0x12f2c5[_0x6c47('0x2c')],'resourceId':_0x12f2c5['id'],'type':_0x320783['name'],'sectionId':_0x320783['id']},{})[_0x6c47('0x27')](function(){return _0x5c32be;});}else{return _0x5c32be;}})['catch'](function(_0x10b7b1){logger['error'](_0x6c47('0x52'),_0x10b7b1);throw _0x10b7b1;});}return _0x5c32be;})[_0x6c47('0x27')](respondWithResult(_0x29bdf3,0xc9))[_0x6c47('0x4b')](handleError(_0x29bdf3,null));};exports[_0x6c47('0x25')]=function(_0x2dc802,_0x4a5eea){if(_0x2dc802[_0x6c47('0x53')]['id']){delete _0x2dc802[_0x6c47('0x53')]['id'];}return db[_0x6c47('0x30')][_0x6c47('0x4f')]({'where':{'id':_0x2dc802[_0x6c47('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a5eea,null))[_0x6c47('0x27')](saveUpdates(_0x2dc802[_0x6c47('0x53')],null))[_0x6c47('0x27')](respondWithResult(_0x4a5eea,null))[_0x6c47('0x4b')](handleError(_0x4a5eea,null));};exports[_0x6c47('0x26')]=function(_0x174207,_0x17f366){return db[_0x6c47('0x30')][_0x6c47('0x4f')]({'where':{'id':_0x174207[_0x6c47('0x48')]['id']}})[_0x6c47('0x27')](handleEntityNotFound(_0x17f366,null))[_0x6c47('0x27')](removeEntity(_0x17f366,null))['catch'](handleError(_0x17f366,null));};exports[_0x6c47('0x54')]=function(_0x23c2df,_0x1767a0,_0x5457f0){return db[_0x6c47('0x30')][_0x6c47('0x55')]({'where':{'id':_0x23c2df[_0x6c47('0x48')]['id']}})[_0x6c47('0x27')](handleEntityNotFound(_0x1767a0,null))[_0x6c47('0x27')](function(_0x1277f4){if(!_0x23c2df['query'][_0x6c47('0x56')]||!utils[_0x6c47('0x57')](_0x23c2df[_0x6c47('0x34')]['channel'])){throw new db[(_0x6c47('0x58'))][(_0x6c47('0x59'))](_0x6c47('0x5a'));}var _0x539232={};var _0x261258={};_0x261258[_0x6c47('0x38')]=_[_0x6c47('0x35')](db[_[_0x6c47('0x5b')](_0x23c2df[_0x6c47('0x34')]['channel'][_0x6c47('0x5c')]())+_0x6c47('0x5d')][_0x6c47('0x49')]);_0x261258[_0x6c47('0x34')]=_[_0x6c47('0x35')](_0x23c2df[_0x6c47('0x34')]);_0x261258['filters']=_[_0x6c47('0x37')](_0x261258['model'],_0x261258[_0x6c47('0x34')]);_0x539232[_0x6c47('0x39')]=_[_0x6c47('0x37')](_0x261258[_0x6c47('0x38')],qs['fields'](_0x23c2df['query'][_0x6c47('0x4a')]));_0x539232[_0x6c47('0x39')]=_0x539232[_0x6c47('0x39')][_0x6c47('0x3a')]?_0x539232[_0x6c47('0x39')]:_0x261258[_0x6c47('0x38')];_0x539232[_0x6c47('0x20')]=qs[_0x6c47('0x20')](_0x23c2df['query'][_0x6c47('0x20')]);_0x539232[_0x6c47('0x1f')]=qs[_0x6c47('0x1f')](_0x23c2df[_0x6c47('0x34')][_0x6c47('0x1f')]);_0x539232['order']=qs[_0x6c47('0x5e')](_0x23c2df[_0x6c47('0x34')][_0x6c47('0x5e')]);_0x539232['where']=qs[_0x6c47('0x36')](_[_0x6c47('0x5f')](_0x23c2df[_0x6c47('0x34')],_0x261258[_0x6c47('0x36')]));_0x539232=_[_0x6c47('0x41')]({},_0x539232,_0x23c2df['options']);return _0x1277f4['get'+_['capitalize'](_0x23c2df['query'][_0x6c47('0x56')][_0x6c47('0x5c')]())+_0x6c47('0x60')](_0x539232);})[_0x6c47('0x27')](respondWithResult(_0x1767a0,null))[_0x6c47('0x4b')](handleError(_0x1767a0,null));};exports['addQueues']=function(_0x161f55,_0x403957,_0x4e0aa3){return db[_0x6c47('0x30')][_0x6c47('0x55')]({'where':{'id':_0x161f55['params']['id']}})[_0x6c47('0x27')](function(_0x8209e8){if(_0x8209e8){if(!_0x161f55['body']['channel']||!utils['isValidChannel'](_0x161f55[_0x6c47('0x53')]['channel'])){throw new db[(_0x6c47('0x58'))]['ValidationError'](_0x6c47('0x5a'));}return _0x8209e8[_0x6c47('0x61')+_[_0x6c47('0x5b')](_0x161f55[_0x6c47('0x53')]['channel'][_0x6c47('0x5c')]())+_0x6c47('0x60')](_0x161f55[_0x6c47('0x53')][_0x6c47('0x62')]);}return null;})[_0x6c47('0x27')](handleEntityNotFound(_0x403957,null))['then'](respondWithStatusCode(_0x403957,null))[_0x6c47('0x4b')](handleError(_0x403957,null));};exports['removeQueues']=function(_0x37c75f,_0x3a9d7a,_0x5bd8c9){return db['Team'][_0x6c47('0x55')]({'where':{'id':_0x37c75f[_0x6c47('0x48')]['id']}})[_0x6c47('0x27')](function(_0x592ea6){if(_0x592ea6){if(!_0x37c75f[_0x6c47('0x34')][_0x6c47('0x56')]||!utils['isValidChannel'](_0x37c75f['query']['channel'])){throw new db[(_0x6c47('0x58'))][(_0x6c47('0x59'))](_0x6c47('0x5a'));}return _0x592ea6[_0x6c47('0x63')+_['capitalize'](_0x37c75f['query'][_0x6c47('0x56')][_0x6c47('0x5c')]())+_0x6c47('0x60')](_0x37c75f[_0x6c47('0x34')][_0x6c47('0x62')]);}return null;})[_0x6c47('0x27')](handleEntityNotFound(_0x3a9d7a,null))[_0x6c47('0x27')](respondWithStatusCode(_0x3a9d7a,null))[_0x6c47('0x4b')](handleError(_0x3a9d7a,null));};exports['addAgents']=function(_0x121546,_0x4472df,_0x4cf678){return db[_0x6c47('0x30')]['find']({'where':{'id':_0x121546[_0x6c47('0x48')]['id']}})[_0x6c47('0x27')](handleEntityNotFound(_0x4472df,null))[_0x6c47('0x27')](function(_0x3ac246){if(_0x3ac246){var _0x6f7abd=[_0x6c47('0x64'),_0x6c47('0x65'),_0x6c47('0x66'),_0x6c47('0x67'),_0x6c47('0x68'),'Openchannel',_0x6c47('0x69')];return BPromise[_0x6c47('0x6a')](_0x6f7abd,function(_0xef8035){return _0x3ac246[_0x6c47('0x4d')+_0xef8035+_0x6c47('0x60')]({'attributes':['id',_0x6c47('0x2c')]})[_0x6c47('0x27')](function(_0x36152d){return BPromise[_0x6c47('0x6a')](_0x36152d,function(_0x497a4f){return _0x497a4f[_0x6c47('0x6b')](_0x121546['body'][_0x6c47('0x62')])[_0x6c47('0x27')](function(){if(_0xef8035===_0x6c47('0x64')){return db[_0x6c47('0x6c')]['findAll']({'where':{'id':_0x121546[_0x6c47('0x53')][_0x6c47('0x62')]},'attributes':['id',_0x6c47('0x2c'),_0x6c47('0x6d'),'voicePause',_0x6c47('0x6e')],'raw':!![]})[_0x6c47('0x27')](function(_0x1dc8c4){return BPromise[_0x6c47('0x6a')](_[_0x6c47('0x3e')](_0x1dc8c4,{'online':0x1}),function(_0x27eefb){return db[_0x6c47('0x6f')][_0x6c47('0x70')]({'membername':_0x27eefb[_0x6c47('0x2c')],'UserId':_0x27eefb['id'],'queue_name':_0x497a4f[_0x6c47('0x2c')],'VoiceQueueId':_0x497a4f['id'],'interface':_[_0x6c47('0x71')](_0x27eefb['interface'])?util[_0x6c47('0x72')](_0x6c47('0x73'),_0x27eefb['name']):_0x27eefb[_0x6c47('0x6e')],'paused':_0x27eefb[_0x6c47('0x74')]||![],'penalty':0x0});});});}});});})[_0x6c47('0x27')](function(){return _0x3ac246;});})[_0x6c47('0x27')](function(){return _0x3ac246;});}})['then'](function(_0x322b9b){if(_0x322b9b){return _0x322b9b['addAgents'](_0x121546['body'][_0x6c47('0x62')],_['omit'](_0x121546['body'],[_0x6c47('0x62'),'id'])||{})[_0x6c47('0x75')](function(_0x35c604){for(var _0x3973f8=0x0;_0x3973f8<_0x121546['body'][_0x6c47('0x62')][_0x6c47('0x3a')];_0x3973f8+=0x1){socket['emit'](_0x6c47('0x76'),{'UserId':_0x121546[_0x6c47('0x53')]['ids'][_0x3973f8],'TeamId':_0x121546[_0x6c47('0x48')]['id']});}return _0x35c604;});}})[_0x6c47('0x27')](respondWithResult(_0x4472df,null))['catch'](handleError(_0x4472df,null));};exports[_0x6c47('0x77')]=function(_0x48c949,_0xdc229c,_0x379416){return db['Team'][_0x6c47('0x4f')]({'where':{'id':_0x48c949[_0x6c47('0x48')]['id']}})['then'](handleEntityNotFound(_0xdc229c,null))[_0x6c47('0x27')](function(_0x3a92b9){if(_0x3a92b9){return BPromise[_0x6c47('0x6a')]([_0x6c47('0x78'),_0x6c47('0x79'),_0x6c47('0x7a'),_0x6c47('0x7b'),_0x6c47('0x7c'),_0x6c47('0x7d'),'whatsapp'],function(_0x11fafc){return _0x3a92b9[_0x6c47('0x4d')+_[_0x6c47('0x5b')](_0x11fafc)+_0x6c47('0x60')]({'attributes':['id',_0x6c47('0x2c')]})[_0x6c47('0x27')](function(_0x16823f){return BPromise[_0x6c47('0x6a')](_0x16823f,function(_0x346669){return _0x346669[_0x6c47('0x77')](_0x48c949['query'][_0x6c47('0x62')])[_0x6c47('0x27')](function(){if(_0x11fafc===_0x6c47('0x78')){return db[_0x6c47('0x6f')][_0x6c47('0x26')]({'where':{'VoiceQueueId':_0x346669['id'],'UserId':_0x48c949['query']['ids']}});}});});})[_0x6c47('0x27')](function(){return _0x3a92b9;});})[_0x6c47('0x27')](function(){return _0x3a92b9;});}})['then'](function(_0x2c5bc5){if(_0x2c5bc5){return _0x2c5bc5['removeAgents'](_0x48c949['query']['ids'])[_0x6c47('0x27')](function(){if(_[_0x6c47('0x7e')](_0x48c949['query'][_0x6c47('0x62')])){for(var _0x15dfdc=0x0;_0x15dfdc<_0x48c949['query']['ids'][_0x6c47('0x3a')];_0x15dfdc+=0x1){socket['emit'](_0x6c47('0x7f'),{'UserId':Number(_0x48c949[_0x6c47('0x34')][_0x6c47('0x62')][_0x15dfdc]),'TeamId':Number(_0x48c949[_0x6c47('0x48')]['id'])});}}else{socket[_0x6c47('0x80')]('userTeam:remove',{'UserId':Number(_0x48c949[_0x6c47('0x34')][_0x6c47('0x62')]),'TeamId':Number(_0x48c949[_0x6c47('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0xdc229c,null))[_0x6c47('0x4b')](handleError(_0xdc229c,null));};exports[_0x6c47('0x81')]=function(_0x42dfa0,_0xec3fb8,_0x2e247f){var _0x1a8a61={};var _0x5e6a9d={};var _0x4abf16;var _0x1a263e;return db[_0x6c47('0x30')][_0x6c47('0x55')]({'where':{'id':_0x42dfa0[_0x6c47('0x48')]['id']}})[_0x6c47('0x27')](handleEntityNotFound(_0xec3fb8,null))[_0x6c47('0x27')](function(_0x18f88e){if(_0x18f88e){_0x4abf16=_0x18f88e;_0x5e6a9d[_0x6c47('0x38')]=_[_0x6c47('0x35')](db['User'][_0x6c47('0x49')]);_0x5e6a9d[_0x6c47('0x34')]=_['keys'](_0x42dfa0['query']);_0x5e6a9d['filters']=_['intersection'](_0x5e6a9d[_0x6c47('0x38')],_0x5e6a9d[_0x6c47('0x34')]);_0x1a8a61['attributes']=_[_0x6c47('0x37')](_0x5e6a9d[_0x6c47('0x38')],qs['fields'](_0x42dfa0[_0x6c47('0x34')]['fields']));_0x1a8a61[_0x6c47('0x39')]=_0x1a8a61['attributes'][_0x6c47('0x3a')]?_0x1a8a61['attributes']:_0x5e6a9d[_0x6c47('0x38')];_0x1a8a61['order']=qs['sort'](_0x42dfa0['query']['sort']);_0x1a8a61[_0x6c47('0x3f')]=qs[_0x6c47('0x36')](_[_0x6c47('0x5f')](_0x42dfa0[_0x6c47('0x34')],_0x5e6a9d[_0x6c47('0x36')]));if(_0x42dfa0[_0x6c47('0x34')][_0x6c47('0x3e')]){_0x1a8a61['where']=_['merge'](_0x1a8a61['where'],{'$or':_[_0x6c47('0x2f')](_0x1a8a61[_0x6c47('0x39')],function(_0x4e8622){var _0x174b2c={};_0x174b2c[_0x4e8622]={'$like':'%'+_0x42dfa0[_0x6c47('0x34')][_0x6c47('0x3e')]+'%'};return _0x174b2c;})});}_0x1a8a61=_[_0x6c47('0x41')]({},_0x1a8a61,_0x42dfa0[_0x6c47('0x42')]);return _0x4abf16[_0x6c47('0x81')](_0x1a8a61);}})[_0x6c47('0x27')](function(_0x133ef5){if(_0x133ef5){_0x1a263e=_0x133ef5[_0x6c47('0x3a')];if(!_0x42dfa0[_0x6c47('0x34')][_0x6c47('0x3b')]('nolimit')){_0x1a8a61[_0x6c47('0x20')]=qs[_0x6c47('0x20')](_0x42dfa0[_0x6c47('0x34')][_0x6c47('0x20')]);_0x1a8a61[_0x6c47('0x1f')]=qs[_0x6c47('0x1f')](_0x42dfa0['query']['offset']);}return _0x4abf16[_0x6c47('0x81')](_0x1a8a61);}})[_0x6c47('0x27')](function(_0x1ae4c1){if(_0x1ae4c1){return _0x1ae4c1?{'count':_0x1a263e,'rows':_0x1ae4c1}:null;}})[_0x6c47('0x27')](respondWithResult(_0xec3fb8,null))[_0x6c47('0x4b')](handleError(_0xec3fb8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e47e658..43d1b0b 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 _0xe9c0=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55072f,_0x1de6dc){var _0x39ed8c=function(_0x3b25b2){while(--_0x3b25b2){_0x55072f['push'](_0x55072f['shift']());}};_0x39ed8c(++_0x1de6dc);}(_0xe9c0,0xb7));var _0x0e9c=function(_0x5acb5c,_0xb2f845){_0x5acb5c=_0x5acb5c-0x0;var _0x359c2b=_0xe9c0[_0x5acb5c];return _0x359c2b;};'use strict';var EventEmitter=require(_0x0e9c('0x0'));var Team=require(_0x0e9c('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e9c('0x2'),'afterUpdate':'update','afterDestroy':_0x0e9c('0x3')};function emitEvent(_0x438da7){return function(_0xbaca88,_0x2bebd8,_0x3d26cf){TeamEvents[_0x0e9c('0x4')](_0x438da7+':'+_0xbaca88['id'],_0xbaca88);TeamEvents[_0x0e9c('0x4')](_0x438da7,_0xbaca88);_0x3d26cf(null);};}for(var e in events){if(events[_0x0e9c('0x5')](e)){var event=events[e];Team[_0x0e9c('0x6')](e,emitEvent(event));}}module[_0x0e9c('0x7')]=TeamEvents; \ No newline at end of file +var _0xfa5c=['events','Team','save','update','remove','emit','exports'];(function(_0x4a9a1b,_0x3d6647){var _0x57b089=function(_0x2049e6){while(--_0x2049e6){_0x4a9a1b['push'](_0x4a9a1b['shift']());}};_0x57b089(++_0x3d6647);}(_0xfa5c,0xd2));var _0xcfa5=function(_0x3390df,_0x1a7605){_0x3390df=_0x3390df-0x0;var _0x1e7b87=_0xfa5c[_0x3390df];return _0x1e7b87;};'use strict';var EventEmitter=require(_0xcfa5('0x0'));var Team=require('../../mysqldb')['db'][_0xcfa5('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcfa5('0x2'),'afterUpdate':_0xcfa5('0x3'),'afterDestroy':_0xcfa5('0x4')};function emitEvent(_0xad7bf1){return function(_0x4817a4,_0x68c9d8,_0x2d3a36){TeamEvents[_0xcfa5('0x5')](_0xad7bf1+':'+_0x4817a4['id'],_0x4817a4);TeamEvents[_0xcfa5('0x5')](_0xad7bf1,_0x4817a4);_0x2d3a36(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xcfa5('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 9a51d45..c8e4fd6 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 _0x5e59=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Team','teams','util','../../config/logger'];(function(_0x588cbd,_0x43b872){var _0x571e75=function(_0x12de7b){while(--_0x12de7b){_0x588cbd['push'](_0x588cbd['shift']());}};_0x571e75(++_0x43b872);}(_0x5e59,0x1d2));var _0x95e5=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x5e59[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x95e5('0x0'));var logger=require(_0x95e5('0x1'))(_0x95e5('0x2'));var moment=require('moment');var BPromise=require(_0x95e5('0x3'));var rp=require(_0x95e5('0x4'));var fs=require('fs');var path=require(_0x95e5('0x5'));var rimraf=require(_0x95e5('0x6'));var config=require(_0x95e5('0x7'));var attributes=require('./team.attributes');module[_0x95e5('0x8')]=function(_0x3c17e3,_0x19d8ca){return _0x3c17e3[_0x95e5('0x9')](_0x95e5('0xa'),attributes,{'tableName':_0x95e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x340b=['define','Team','teams','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3c45de,_0x1f0979){var _0x270350=function(_0x45f304){while(--_0x45f304){_0x3c45de['push'](_0x3c45de['shift']());}};_0x270350(++_0x1f0979);}(_0x340b,0xcf));var _0xb340=function(_0xefb6aa,_0x2af122){_0xefb6aa=_0xefb6aa-0x0;var _0x5e9867=_0x340b[_0xefb6aa];return _0x5e9867;};'use strict';var _=require(_0xb340('0x0'));var util=require('util');var logger=require(_0xb340('0x1'))('api');var moment=require(_0xb340('0x2'));var BPromise=require(_0xb340('0x3'));var rp=require(_0xb340('0x4'));var fs=require('fs');var path=require(_0xb340('0x5'));var rimraf=require(_0xb340('0x6'));var config=require(_0xb340('0x7'));var attributes=require('./team.attributes');module[_0xb340('0x8')]=function(_0x9e987d,_0x4f2332){return _0x9e987d[_0xb340('0x9')](_0xb340('0xa'),attributes,{'tableName':_0xb340('0xb'),'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 0ed552d..865ce74 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 _0xeef6=['http','redis','defaults','localhost','request','then','info','request\x20sent','debug','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x120259,_0x32e9df){var _0x7a50a8=function(_0xb9b049){while(--_0xb9b049){_0x120259['push'](_0x120259['shift']());}};_0x7a50a8(++_0x32e9df);}(_0xeef6,0xa0));var _0x6eef=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xeef6[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x6eef('0x0'));var util=require(_0x6eef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6eef('0x2'));var fs=require('fs');var Redis=require(_0x6eef('0x3'));var db=require(_0x6eef('0x4'))['db'];var utils=require(_0x6eef('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6eef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6eef('0x7')][_0x6eef('0x8')]({'port':0x232a});config[_0x6eef('0x9')]=_[_0x6eef('0xa')](config[_0x6eef('0x9')],{'host':_0x6eef('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6eef('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x269b5c,_0x44e5e2,_0x3e7a05){return new BPromise(function(_0x258be5,_0x259e01){return client[_0x6eef('0xc')](_0x269b5c,_0x3e7a05)[_0x6eef('0xd')](function(_0x573447){logger[_0x6eef('0xe')]('Team,\x20%s,\x20%s',_0x44e5e2,_0x6eef('0xf'));logger[_0x6eef('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x44e5e2,'request\x20sent',JSON[_0x6eef('0x11')](_0x573447));if(_0x573447[_0x6eef('0x12')]){if(_0x573447[_0x6eef('0x12')][_0x6eef('0x13')]===0x1f4){logger[_0x6eef('0x12')](_0x6eef('0x14'),_0x44e5e2,_0x573447[_0x6eef('0x12')][_0x6eef('0x15')]);return _0x259e01(_0x573447['error'][_0x6eef('0x15')]);}logger['error'](_0x6eef('0x14'),_0x44e5e2,_0x573447[_0x6eef('0x12')]['message']);return _0x258be5(_0x573447[_0x6eef('0x12')][_0x6eef('0x15')]);}else{logger['info'](_0x6eef('0x14'),_0x44e5e2,_0x6eef('0xf'));_0x258be5(_0x573447[_0x6eef('0x16')][_0x6eef('0x15')]);}})[_0x6eef('0x17')](function(_0xe20a20){logger['error'](_0x6eef('0x14'),_0x44e5e2,_0xe20a20);_0x259e01(_0xe20a20);});});} \ No newline at end of file +var _0x4542=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4542,0x14a));var _0x2454=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4542[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2454('0x0'));var util=require(_0x2454('0x1'));var moment=require(_0x2454('0x2'));var BPromise=require(_0x2454('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2454('0x4'))(_0x2454('0x5'));var config=require(_0x2454('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2454('0x7')][_0x2454('0x8')]({'port':0x232a});config[_0x2454('0x9')]=_[_0x2454('0xa')](config[_0x2454('0x9')],{'host':_0x2454('0xb'),'port':0x18eb});var socket=require(_0x2454('0xc'))(new Redis(config['redis']));require(_0x2454('0xd'))[_0x2454('0xe')](socket);function respondWithRpcPromise(_0x21ef2a,_0x36b7f4,_0x8eb78c){return new BPromise(function(_0x4310b9,_0x59c9e0){return client['request'](_0x21ef2a,_0x8eb78c)['then'](function(_0x23d603){logger[_0x2454('0xf')](_0x2454('0x10'),_0x36b7f4,_0x2454('0x11'));logger['debug'](_0x2454('0x12'),_0x36b7f4,'request\x20sent',JSON[_0x2454('0x13')](_0x23d603));if(_0x23d603[_0x2454('0x14')]){if(_0x23d603[_0x2454('0x14')]['code']===0x1f4){logger[_0x2454('0x14')](_0x2454('0x10'),_0x36b7f4,_0x23d603[_0x2454('0x14')]['message']);return _0x59c9e0(_0x23d603[_0x2454('0x14')][_0x2454('0x15')]);}logger[_0x2454('0x14')](_0x2454('0x10'),_0x36b7f4,_0x23d603['error']['message']);return _0x4310b9(_0x23d603[_0x2454('0x14')]['message']);}else{logger[_0x2454('0xf')](_0x2454('0x10'),_0x36b7f4,_0x2454('0x11'));_0x4310b9(_0x23d603[_0x2454('0x16')][_0x2454('0x15')]);}})[_0x2454('0x17')](function(_0x1471d5){logger[_0x2454('0x14')](_0x2454('0x10'),_0x36b7f4,_0x1471d5);_0x59c9e0(_0x1471d5);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f052f8d..89c8fc5 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 _0x77a9=['remove','emit','removeListener','register','./team.events'];(function(_0x52aec5,_0x12af9f){var _0x5d0a76=function(_0x1e93d8){while(--_0x1e93d8){_0x52aec5['push'](_0x52aec5['shift']());}};_0x5d0a76(++_0x12af9f);}(_0x77a9,0x19e));var _0x977a=function(_0x27d29e,_0x46ddcc){_0x27d29e=_0x27d29e-0x0;var _0x174321=_0x77a9[_0x27d29e];return _0x174321;};'use strict';var TeamEvents=require(_0x977a('0x0'));var events=['save',_0x977a('0x1'),'update'];function createListener(_0x15eb44,_0x23a4e3){return function(_0x3807f1){_0x23a4e3[_0x977a('0x2')](_0x15eb44,_0x3807f1);};}function removeListener(_0x520cd7,_0x318fc8){return function(){TeamEvents[_0x977a('0x3')](_0x520cd7,_0x318fc8);};}exports[_0x977a('0x4')]=function(_0x2b4ba5){for(var _0x261e46=0x0,_0x579e03=events['length'];_0x261e46<_0x579e03;_0x261e46++){var _0x2e177f=events[_0x261e46];var _0x12fd82=createListener('team:'+_0x2e177f,_0x2b4ba5);TeamEvents['on'](_0x2e177f,_0x12fd82);}}; \ No newline at end of file +var _0xaafc=['removeListener','length','save','remove','update','emit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xaafc,0x176));var _0xcaaf=function(_0x4ea37d,_0x254048){_0x4ea37d=_0x4ea37d-0x0;var _0x49e7b6=_0xaafc[_0x4ea37d];return _0x49e7b6;};'use strict';var TeamEvents=require('./team.events');var events=[_0xcaaf('0x0'),_0xcaaf('0x1'),_0xcaaf('0x2')];function createListener(_0xaa122e,_0x58deea){return function(_0x3a9705){_0x58deea[_0xcaaf('0x3')](_0xaa122e,_0x3a9705);};}function removeListener(_0x4e9be3,_0x4a3b11){return function(){TeamEvents[_0xcaaf('0x4')](_0x4e9be3,_0x4a3b11);};}exports['register']=function(_0x291f15){for(var _0x54757a=0x0,_0x31e6bb=events[_0xcaaf('0x5')];_0x54757a<_0x31e6bb;_0x54757a++){var _0x22d1b2=events[_0x54757a];var _0xdccf0d=createListener('team:'+_0x22d1b2,_0x291f15);TeamEvents['on'](_0x22d1b2,_0xdccf0d);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9d82ac3..8383570 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 _0x228e=['../../components/auth/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x409add,_0x2c353a){var _0x3893d2=function(_0x20216b){while(--_0x20216b){_0x409add['push'](_0x409add['shift']());}};_0x3893d2(++_0x2c353a);}(_0x228e,0x64));var _0xe228=function(_0x217846,_0x52f3f1){_0x217846=_0x217846-0x0;var _0x2a044f=_0x228e[_0x217846];return _0x2a044f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe228('0x0'));var express=require(_0xe228('0x1'));var router=express['Router']();var auth=require(_0xe228('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe228('0x3'));var controller=require(_0xe228('0x4'));router[_0xe228('0x5')]('/',auth['isAuthenticated'](),controller[_0xe228('0x6')]);router[_0xe228('0x5')](_0xe228('0x7'),auth[_0xe228('0x8')](),controller[_0xe228('0x9')]);router[_0xe228('0xa')]('/',auth[_0xe228('0x8')](),controller[_0xe228('0xb')]);router[_0xe228('0xc')](_0xe228('0x7'),auth[_0xe228('0x8')](),controller[_0xe228('0xd')]);router[_0xe228('0xe')](_0xe228('0x7'),auth[_0xe228('0x8')](),controller[_0xe228('0xf')]);module[_0xe228('0x10')]=router; \ No newline at end of file +var _0x994b=['post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','/:id','show'];(function(_0x53f107,_0x5c244f){var _0x55e922=function(_0xf3c644){while(--_0xf3c644){_0x53f107['push'](_0x53f107['shift']());}};_0x55e922(++_0x5c244f);}(_0x994b,0xf4));var _0xb994=function(_0x3884b7,_0x37682d){_0x3884b7=_0x3884b7-0x0;var _0x598253=_0x994b[_0x3884b7];return _0x598253;};'use strict';var multer=require(_0xb994('0x0'));var util=require(_0xb994('0x1'));var path=require(_0xb994('0x2'));var timeout=require('connect-timeout');var express=require(_0xb994('0x3'));var router=express[_0xb994('0x4')]();var auth=require(_0xb994('0x5'));var interaction=require(_0xb994('0x6'));var config=require('../../config/environment');var controller=require(_0xb994('0x7'));router['get']('/',auth[_0xb994('0x8')](),controller['index']);router['get'](_0xb994('0x9'),auth[_0xb994('0x8')](),controller[_0xb994('0xa')]);router[_0xb994('0xb')]('/',auth['isAuthenticated'](),controller[_0xb994('0xc')]);router[_0xb994('0xd')](_0xb994('0x9'),auth['isAuthenticated'](),controller[_0xb994('0xe')]);router[_0xb994('0xf')]('/:id',auth[_0xb994('0x8')](),controller[_0xb994('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ccaf417..45396ff 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 _0xd4a1=['exports','STRING','TEXT','sequelize'];(function(_0x4f5c39,_0x15f99a){var _0x11296f=function(_0x32103e){while(--_0x32103e){_0x4f5c39['push'](_0x4f5c39['shift']());}};_0x11296f(++_0x15f99a);}(_0xd4a1,0x157));var _0x1d4a=function(_0x44c573,_0xfde812){_0x44c573=_0x44c573-0x0;var _0x5dbbe8=_0xd4a1[_0x44c573];return _0x5dbbe8;};'use strict';var Sequelize=require(_0x1d4a('0x0'));module[_0x1d4a('0x1')]={'name':{'type':Sequelize[_0x1d4a('0x2')]},'description':{'type':Sequelize[_0x1d4a('0x2')]},'html':{'type':Sequelize[_0x1d4a('0x3')]}}; \ No newline at end of file +var _0x93e9=['sequelize','exports','STRING','TEXT'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x93e9,0xcc));var _0x993e=function(_0x37fbfa,_0xfc2d47){_0x37fbfa=_0x37fbfa-0x0;var _0x55296f=_0x93e9[_0x37fbfa];return _0x55296f;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'html':{'type':Sequelize[_0x993e('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8098e84..c81d378 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 _0x319f=['limit','set','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','error','name','send','map','Template','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x372c68,_0x46c3ff){var _0x29aea8=function(_0x5107df){while(--_0x5107df){_0x372c68['push'](_0x372c68['shift']());}};_0x29aea8(++_0x46c3ff);}(_0x319f,0xd7));var _0xf319=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x319f[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xf319('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf319('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf319('0x2'));var rp=require(_0xf319('0x3'));var moment=require('moment');var BPromise=require(_0xf319('0x4'));var Mustache=require('mustache');var util=require(_0xf319('0x5'));var path=require('path');var sox=require(_0xf319('0x6'));var csv=require(_0xf319('0x7'));var ejs=require(_0xf319('0x8'));var fs=require('fs');var _=require(_0xf319('0x9'));var squel=require(_0xf319('0xa'));var crypto=require(_0xf319('0xb'));var jsforce=require(_0xf319('0xc'));var deskjs=require(_0xf319('0xd'));var toCsv=require(_0xf319('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf319('0xe'));var authService=require(_0xf319('0xf'));var qs=require(_0xf319('0x10'));var as=require(_0xf319('0x11'));var hardwareService=require(_0xf319('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf319('0x13'));var config=require(_0xf319('0x14'));var db=require(_0xf319('0x15'))['db'];function respondWithStatusCode(_0x23fd2e,_0x3b45d1){_0x3b45d1=_0x3b45d1||0xcc;return function(_0xf33522){if(_0xf33522){return _0x23fd2e[_0xf319('0x16')](_0x3b45d1);}return _0x23fd2e[_0xf319('0x17')](_0x3b45d1)[_0xf319('0x18')]();};}function respondWithResult(_0x1e843a,_0x21e35b){_0x21e35b=_0x21e35b||0xc8;return function(_0x17e1bf){if(_0x17e1bf){return _0x1e843a[_0xf319('0x17')](_0x21e35b)[_0xf319('0x19')](_0x17e1bf);}};}function respondWithFilteredResult(_0x8ed2b2,_0x3fa178){return function(_0x1594c1){if(_0x1594c1){var _0x703086=_0x1594c1[_0xf319('0x1a')],_0x2b5568=_0x3fa178['offset'],_0x2fed89=_0x3fa178[_0xf319('0x1b')]+_0x3fa178[_0xf319('0x1c')],_0x1bc848;if(_0x2fed89>=_0x703086){_0x2fed89=_0x703086;_0x1bc848=0xc8;}else{_0x1bc848=0xce;}_0x8ed2b2['status'](_0x1bc848);return _0x8ed2b2[_0xf319('0x1d')](_0xf319('0x1e'),_0x2b5568+'-'+_0x2fed89+'/'+_0x703086)['json'](_0x1594c1);}return null;};}function patchUpdates(_0x3d8dd5){return function(_0x48d97b){try{jsonpatch[_0xf319('0x1f')](_0x48d97b,_0x3d8dd5,!![]);}catch(_0x244845){return BPromise[_0xf319('0x20')](_0x244845);}return _0x48d97b[_0xf319('0x21')]();};}function saveUpdates(_0x490943,_0x567d51){return function(_0x39fe0e){if(_0x39fe0e){return _0x39fe0e[_0xf319('0x22')](_0x490943)[_0xf319('0x23')](function(_0x14b3d8){return _0x14b3d8;});}return null;};}function removeEntity(_0x1d878a,_0x4ed5d2){return function(_0x42be76){if(_0x42be76){return _0x42be76[_0xf319('0x24')]()['then'](function(){var _0x46d237=_0x42be76['get']({'plain':!![]});var _0x484b61=_0xf319('0x25');return db[_0xf319('0x26')][_0xf319('0x24')]({'where':{'type':_0x484b61,'resourceId':_0x46d237['id']}})[_0xf319('0x23')](function(){return _0x42be76;});})[_0xf319('0x23')](function(){_0x1d878a[_0xf319('0x17')](0xcc)[_0xf319('0x18')]();});}};}function handleEntityNotFound(_0xdf31ae,_0x1e1dc6){return function(_0x1b048c){if(!_0x1b048c){_0xdf31ae[_0xf319('0x16')](0x194);}return _0x1b048c;};}function handleError(_0xed9a0f,_0x25a7e5){_0x25a7e5=_0x25a7e5||0x1f4;return function(_0x548f55){logger[_0xf319('0x27')](_0x548f55['stack']);if(_0x548f55[_0xf319('0x28')]){delete _0x548f55['name'];}_0xed9a0f[_0xf319('0x17')](_0x25a7e5)[_0xf319('0x29')](_0x548f55);};}exports['index']=function(_0x3b3a77,_0x17aa59){var _0x43012f={},_0x468f95={},_0x5ed088={'count':0x0,'rows':[]};var _0x4d63d8=_[_0xf319('0x2a')](db[_0xf319('0x2b')]['rawAttributes'],function(_0x4188f1){return{'name':_0x4188f1[_0xf319('0x2c')],'type':_0x4188f1['type'][_0xf319('0x2d')]};});_0x468f95[_0xf319('0x2e')]=_[_0xf319('0x2a')](_0x4d63d8,_0xf319('0x28'));_0x468f95['query']=_[_0xf319('0x2f')](_0x3b3a77[_0xf319('0x30')]);_0x468f95[_0xf319('0x31')]=_[_0xf319('0x32')](_0x468f95['model'],_0x468f95[_0xf319('0x30')]);_0x43012f[_0xf319('0x33')]=_[_0xf319('0x32')](_0x468f95['model'],qs[_0xf319('0x34')](_0x3b3a77[_0xf319('0x30')]['fields']));_0x43012f[_0xf319('0x33')]=_0x43012f[_0xf319('0x33')][_0xf319('0x35')]?_0x43012f[_0xf319('0x33')]:_0x468f95[_0xf319('0x2e')];if(!_0x3b3a77[_0xf319('0x30')][_0xf319('0x36')]('nolimit')){_0x43012f[_0xf319('0x1c')]=qs[_0xf319('0x1c')](_0x3b3a77[_0xf319('0x30')]['limit']);_0x43012f['offset']=qs[_0xf319('0x1b')](_0x3b3a77[_0xf319('0x30')]['offset']);}_0x43012f[_0xf319('0x37')]=qs[_0xf319('0x38')](_0x3b3a77[_0xf319('0x30')][_0xf319('0x38')]);_0x43012f[_0xf319('0x39')]=qs[_0xf319('0x31')](_[_0xf319('0x3a')](_0x3b3a77['query'],_0x468f95['filters']),_0x4d63d8);if(_0x3b3a77[_0xf319('0x30')][_0xf319('0x3b')]){_0x43012f[_0xf319('0x39')]=_[_0xf319('0x3c')](_0x43012f['where'],{'$or':_[_0xf319('0x2a')](_0x4d63d8,function(_0x3fbad1){if(_0x3fbad1[_0xf319('0x3d')]!==_0xf319('0x3e')){var _0x45e700={};_0x45e700[_0x3fbad1['name']]={'$like':'%'+_0x3b3a77['query'][_0xf319('0x3b')]+'%'};return _0x45e700;}})});}_0x43012f=_['merge']({},_0x43012f,_0x3b3a77['options']);var _0x589062={'where':_0x43012f[_0xf319('0x39')]};return db['Template']['count'](_0x589062)[_0xf319('0x23')](function(_0x28024c){_0x5ed088[_0xf319('0x1a')]=_0x28024c;if(_0x3b3a77[_0xf319('0x30')][_0xf319('0x3f')]){_0x43012f[_0xf319('0x40')]=[{'all':!![]}];}return db[_0xf319('0x2b')]['findAll'](_0x43012f);})[_0xf319('0x23')](function(_0x544fb9){_0x5ed088[_0xf319('0x41')]=_0x544fb9;return _0x5ed088;})[_0xf319('0x23')](respondWithFilteredResult(_0x17aa59,_0x43012f))[_0xf319('0x42')](handleError(_0x17aa59,null));};exports[_0xf319('0x43')]=function(_0x2d8106,_0x3d19bd){var _0x580ae6={'raw':!![],'where':{'id':_0x2d8106[_0xf319('0x44')]['id']}},_0x4afc30={};_0x4afc30['model']=_[_0xf319('0x2f')](db[_0xf319('0x2b')][_0xf319('0x45')]);_0x4afc30[_0xf319('0x30')]=_[_0xf319('0x2f')](_0x2d8106['query']);_0x4afc30[_0xf319('0x31')]=_[_0xf319('0x32')](_0x4afc30[_0xf319('0x2e')],_0x4afc30['query']);_0x580ae6[_0xf319('0x33')]=_[_0xf319('0x32')](_0x4afc30['model'],qs[_0xf319('0x34')](_0x2d8106[_0xf319('0x30')][_0xf319('0x34')]));_0x580ae6['attributes']=_0x580ae6[_0xf319('0x33')][_0xf319('0x35')]?_0x580ae6[_0xf319('0x33')]:_0x4afc30[_0xf319('0x2e')];if(_0x2d8106['query'][_0xf319('0x3f')]){_0x580ae6[_0xf319('0x40')]=[{'all':!![]}];}_0x580ae6=_['merge']({},_0x580ae6,_0x2d8106[_0xf319('0x46')]);return db[_0xf319('0x2b')]['find'](_0x580ae6)[_0xf319('0x23')](handleEntityNotFound(_0x3d19bd,null))[_0xf319('0x23')](respondWithResult(_0x3d19bd,null))['catch'](handleError(_0x3d19bd,null));};exports[_0xf319('0x47')]=function(_0x3998f1,_0x120e51){return db['Template'][_0xf319('0x47')](_0x3998f1['body'],{})[_0xf319('0x23')](function(_0x39e09e){var _0x5effc1=_0x3998f1['user']['get']({'plain':!![]});if(!_0x5effc1)throw new Error(_0xf319('0x48'));if(_0x5effc1[_0xf319('0x49')]===_0xf319('0x4a')){var _0x31eccf=_0x39e09e[_0xf319('0x4b')]({'plain':!![]});var _0x6835e8=_0xf319('0x25');return db[_0xf319('0x4c')][_0xf319('0x4d')]({'where':{'name':_0x6835e8,'userProfileId':_0x5effc1['userProfileId']},'raw':!![]})['then'](function(_0x4d0f1d){if(_0x4d0f1d&&_0x4d0f1d[_0xf319('0x4e')]===0x0){return db[_0xf319('0x26')][_0xf319('0x47')]({'name':_0x31eccf[_0xf319('0x28')],'resourceId':_0x31eccf['id'],'type':_0x4d0f1d[_0xf319('0x28')],'sectionId':_0x4d0f1d['id']},{})[_0xf319('0x23')](function(){return _0x39e09e;});}else{return _0x39e09e;}})[_0xf319('0x42')](function(_0x4f6244){logger[_0xf319('0x27')](_0xf319('0x4f'),_0x4f6244);throw _0x4f6244;});}return _0x39e09e;})[_0xf319('0x23')](respondWithResult(_0x120e51,0xc9))[_0xf319('0x42')](handleError(_0x120e51,null));};exports[_0xf319('0x22')]=function(_0x324aa5,_0x10f0a0){if(_0x324aa5['body']['id']){delete _0x324aa5[_0xf319('0x50')]['id'];}return db[_0xf319('0x2b')][_0xf319('0x4d')]({'where':{'id':_0x324aa5['params']['id']}})[_0xf319('0x23')](handleEntityNotFound(_0x10f0a0,null))[_0xf319('0x23')](saveUpdates(_0x324aa5[_0xf319('0x50')],null))[_0xf319('0x23')](respondWithResult(_0x10f0a0,null))[_0xf319('0x42')](handleError(_0x10f0a0,null));};exports[_0xf319('0x24')]=function(_0x181df0,_0x519de7){return db[_0xf319('0x2b')]['find']({'where':{'id':_0x181df0['params']['id']}})[_0xf319('0x23')](handleEntityNotFound(_0x519de7,null))[_0xf319('0x23')](removeEntity(_0x519de7,null))['catch'](handleError(_0x519de7,null));}; \ No newline at end of file +var _0x1f10=['stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','get','Templates','UserProfileResource','destroy','error'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x1f10,0x12a));var _0x01f1=function(_0x18dfbd,_0x575eb8){_0x18dfbd=_0x18dfbd-0x0;var _0x3e63bc=_0x1f10[_0x18dfbd];return _0x3e63bc;};'use strict';var pdf=require(_0x01f1('0x0'));var emlformat=require(_0x01f1('0x1'));var rimraf=require(_0x01f1('0x2'));var zipdir=require(_0x01f1('0x3'));var jsonpatch=require(_0x01f1('0x4'));var rp=require('request-promise');var moment=require(_0x01f1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x01f1('0x6'));var util=require(_0x01f1('0x7'));var path=require(_0x01f1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f1('0x9'));var fs=require('fs');var _=require(_0x01f1('0xa'));var squel=require(_0x01f1('0xb'));var crypto=require('crypto');var jsforce=require(_0x01f1('0xc'));var deskjs=require(_0x01f1('0xd'));var toCsv=require(_0x01f1('0xe'));var querystring=require(_0x01f1('0xf'));var Papa=require(_0x01f1('0x10'));var Redis=require(_0x01f1('0x11'));var authService=require(_0x01f1('0x12'));var qs=require(_0x01f1('0x13'));var as=require(_0x01f1('0x14'));var hardwareService=require(_0x01f1('0x15'));var logger=require('../../config/logger')(_0x01f1('0x16'));var utils=require(_0x01f1('0x17'));var config=require(_0x01f1('0x18'));var db=require(_0x01f1('0x19'))['db'];function respondWithStatusCode(_0xd8ba1a,_0x262a75){_0x262a75=_0x262a75||0xcc;return function(_0x2aee3a){if(_0x2aee3a){return _0xd8ba1a[_0x01f1('0x1a')](_0x262a75);}return _0xd8ba1a[_0x01f1('0x1b')](_0x262a75)[_0x01f1('0x1c')]();};}function respondWithResult(_0x148728,_0x4a59fb){_0x4a59fb=_0x4a59fb||0xc8;return function(_0x4a8908){if(_0x4a8908){return _0x148728[_0x01f1('0x1b')](_0x4a59fb)[_0x01f1('0x1d')](_0x4a8908);}};}function respondWithFilteredResult(_0x2980c7,_0x541c5a){return function(_0x4a020d){if(_0x4a020d){var _0x2c7941=_0x4a020d['count'],_0x1a40fd=_0x541c5a['offset'],_0xf82ac6=_0x541c5a[_0x01f1('0x1e')]+_0x541c5a[_0x01f1('0x1f')],_0x155435;if(_0xf82ac6>=_0x2c7941){_0xf82ac6=_0x2c7941;_0x155435=0xc8;}else{_0x155435=0xce;}_0x2980c7['status'](_0x155435);return _0x2980c7['set'](_0x01f1('0x20'),_0x1a40fd+'-'+_0xf82ac6+'/'+_0x2c7941)['json'](_0x4a020d);}return null;};}function patchUpdates(_0x2cf7b6){return function(_0x4ec3da){try{jsonpatch[_0x01f1('0x21')](_0x4ec3da,_0x2cf7b6,!![]);}catch(_0x32039a){return BPromise[_0x01f1('0x22')](_0x32039a);}return _0x4ec3da['save']();};}function saveUpdates(_0x5548b1,_0x483084){return function(_0x5e840b){if(_0x5e840b){return _0x5e840b[_0x01f1('0x23')](_0x5548b1)[_0x01f1('0x24')](function(_0x9e61ec){return _0x9e61ec;});}return null;};}function removeEntity(_0xc41636,_0x563c85){return function(_0x4942f7){if(_0x4942f7){return _0x4942f7['destroy']()[_0x01f1('0x24')](function(){var _0xa0c5e4=_0x4942f7[_0x01f1('0x25')]({'plain':!![]});var _0x4a4c9d=_0x01f1('0x26');return db[_0x01f1('0x27')][_0x01f1('0x28')]({'where':{'type':_0x4a4c9d,'resourceId':_0xa0c5e4['id']}})['then'](function(){return _0x4942f7;});})['then'](function(){_0xc41636[_0x01f1('0x1b')](0xcc)[_0x01f1('0x1c')]();});}};}function handleEntityNotFound(_0x11bb12,_0x5c39a8){return function(_0x2ef5b1){if(!_0x2ef5b1){_0x11bb12[_0x01f1('0x1a')](0x194);}return _0x2ef5b1;};}function handleError(_0xdebfb,_0x365e11){_0x365e11=_0x365e11||0x1f4;return function(_0x229714){logger[_0x01f1('0x29')](_0x229714[_0x01f1('0x2a')]);if(_0x229714[_0x01f1('0x2b')]){delete _0x229714[_0x01f1('0x2b')];}_0xdebfb[_0x01f1('0x1b')](_0x365e11)[_0x01f1('0x2c')](_0x229714);};}exports[_0x01f1('0x2d')]=function(_0x501817,_0x3312d9){var _0x40ed27={},_0x1315c0={},_0x1bec6c={'count':0x0,'rows':[]};var _0x18b3b0=_[_0x01f1('0x2e')](db[_0x01f1('0x2f')][_0x01f1('0x30')],function(_0x1a11b4){return{'name':_0x1a11b4[_0x01f1('0x31')],'type':_0x1a11b4[_0x01f1('0x32')][_0x01f1('0x33')]};});_0x1315c0[_0x01f1('0x34')]=_['map'](_0x18b3b0,_0x01f1('0x2b'));_0x1315c0[_0x01f1('0x35')]=_[_0x01f1('0x36')](_0x501817[_0x01f1('0x35')]);_0x1315c0[_0x01f1('0x37')]=_['intersection'](_0x1315c0[_0x01f1('0x34')],_0x1315c0[_0x01f1('0x35')]);_0x40ed27[_0x01f1('0x38')]=_[_0x01f1('0x39')](_0x1315c0[_0x01f1('0x34')],qs[_0x01f1('0x3a')](_0x501817[_0x01f1('0x35')][_0x01f1('0x3a')]));_0x40ed27[_0x01f1('0x38')]=_0x40ed27[_0x01f1('0x38')][_0x01f1('0x3b')]?_0x40ed27['attributes']:_0x1315c0['model'];if(!_0x501817[_0x01f1('0x35')]['hasOwnProperty'](_0x01f1('0x3c'))){_0x40ed27[_0x01f1('0x1f')]=qs[_0x01f1('0x1f')](_0x501817['query'][_0x01f1('0x1f')]);_0x40ed27['offset']=qs[_0x01f1('0x1e')](_0x501817[_0x01f1('0x35')][_0x01f1('0x1e')]);}_0x40ed27[_0x01f1('0x3d')]=qs['sort'](_0x501817[_0x01f1('0x35')][_0x01f1('0x3e')]);_0x40ed27['where']=qs[_0x01f1('0x37')](_[_0x01f1('0x3f')](_0x501817[_0x01f1('0x35')],_0x1315c0[_0x01f1('0x37')]),_0x18b3b0);if(_0x501817[_0x01f1('0x35')][_0x01f1('0x40')]){_0x40ed27[_0x01f1('0x41')]=_[_0x01f1('0x42')](_0x40ed27[_0x01f1('0x41')],{'$or':_[_0x01f1('0x2e')](_0x18b3b0,function(_0x598101){if(_0x598101[_0x01f1('0x32')]!==_0x01f1('0x43')){var _0x40dd44={};_0x40dd44[_0x598101['name']]={'$like':'%'+_0x501817[_0x01f1('0x35')][_0x01f1('0x40')]+'%'};return _0x40dd44;}})});}_0x40ed27=_[_0x01f1('0x42')]({},_0x40ed27,_0x501817[_0x01f1('0x44')]);var _0x294e49={'where':_0x40ed27[_0x01f1('0x41')]};return db[_0x01f1('0x2f')][_0x01f1('0x45')](_0x294e49)[_0x01f1('0x24')](function(_0x2329f8){_0x1bec6c[_0x01f1('0x45')]=_0x2329f8;if(_0x501817[_0x01f1('0x35')][_0x01f1('0x46')]){_0x40ed27[_0x01f1('0x47')]=[{'all':!![]}];}return db[_0x01f1('0x2f')][_0x01f1('0x48')](_0x40ed27);})[_0x01f1('0x24')](function(_0x23805b){_0x1bec6c[_0x01f1('0x49')]=_0x23805b;return _0x1bec6c;})[_0x01f1('0x24')](respondWithFilteredResult(_0x3312d9,_0x40ed27))[_0x01f1('0x4a')](handleError(_0x3312d9,null));};exports[_0x01f1('0x4b')]=function(_0x51b459,_0x104667){var _0x1622e1={'raw':!![],'where':{'id':_0x51b459[_0x01f1('0x4c')]['id']}},_0x421c7d={};_0x421c7d[_0x01f1('0x34')]=_[_0x01f1('0x36')](db[_0x01f1('0x2f')][_0x01f1('0x30')]);_0x421c7d[_0x01f1('0x35')]=_[_0x01f1('0x36')](_0x51b459[_0x01f1('0x35')]);_0x421c7d[_0x01f1('0x37')]=_[_0x01f1('0x39')](_0x421c7d[_0x01f1('0x34')],_0x421c7d[_0x01f1('0x35')]);_0x1622e1[_0x01f1('0x38')]=_[_0x01f1('0x39')](_0x421c7d[_0x01f1('0x34')],qs[_0x01f1('0x3a')](_0x51b459[_0x01f1('0x35')]['fields']));_0x1622e1[_0x01f1('0x38')]=_0x1622e1[_0x01f1('0x38')]['length']?_0x1622e1['attributes']:_0x421c7d['model'];if(_0x51b459['query'][_0x01f1('0x46')]){_0x1622e1[_0x01f1('0x47')]=[{'all':!![]}];}_0x1622e1=_[_0x01f1('0x42')]({},_0x1622e1,_0x51b459[_0x01f1('0x44')]);return db[_0x01f1('0x2f')]['find'](_0x1622e1)[_0x01f1('0x24')](handleEntityNotFound(_0x104667,null))['then'](respondWithResult(_0x104667,null))[_0x01f1('0x4a')](handleError(_0x104667,null));};exports[_0x01f1('0x4d')]=function(_0x5d13f6,_0x47f814){return db[_0x01f1('0x2f')][_0x01f1('0x4d')](_0x5d13f6['body'],{})[_0x01f1('0x24')](function(_0x5eaa2e){var _0x302703=_0x5d13f6[_0x01f1('0x4e')][_0x01f1('0x25')]({'plain':!![]});if(!_0x302703)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x302703[_0x01f1('0x4f')]===_0x01f1('0x4e')){var _0x5d9228=_0x5eaa2e[_0x01f1('0x25')]({'plain':!![]});var _0x24e875=_0x01f1('0x26');return db[_0x01f1('0x50')][_0x01f1('0x51')]({'where':{'name':_0x24e875,'userProfileId':_0x302703['userProfileId']},'raw':!![]})[_0x01f1('0x24')](function(_0x467eb5){if(_0x467eb5&&_0x467eb5[_0x01f1('0x52')]===0x0){return db[_0x01f1('0x27')][_0x01f1('0x4d')]({'name':_0x5d9228[_0x01f1('0x2b')],'resourceId':_0x5d9228['id'],'type':_0x467eb5['name'],'sectionId':_0x467eb5['id']},{})[_0x01f1('0x24')](function(){return _0x5eaa2e;});}else{return _0x5eaa2e;}})[_0x01f1('0x4a')](function(_0x445392){logger[_0x01f1('0x29')](_0x01f1('0x53'),_0x445392);throw _0x445392;});}return _0x5eaa2e;})[_0x01f1('0x24')](respondWithResult(_0x47f814,0xc9))['catch'](handleError(_0x47f814,null));};exports[_0x01f1('0x23')]=function(_0x4c4e45,_0x72c155){if(_0x4c4e45[_0x01f1('0x54')]['id']){delete _0x4c4e45[_0x01f1('0x54')]['id'];}return db[_0x01f1('0x2f')][_0x01f1('0x51')]({'where':{'id':_0x4c4e45[_0x01f1('0x4c')]['id']}})[_0x01f1('0x24')](handleEntityNotFound(_0x72c155,null))[_0x01f1('0x24')](saveUpdates(_0x4c4e45['body'],null))['then'](respondWithResult(_0x72c155,null))['catch'](handleError(_0x72c155,null));};exports['destroy']=function(_0x4aa848,_0x1f8c0a){return db[_0x01f1('0x2f')]['find']({'where':{'id':_0x4aa848[_0x01f1('0x4c')]['id']}})[_0x01f1('0x24')](handleEntityNotFound(_0x1f8c0a,null))['then'](removeEntity(_0x1f8c0a,null))[_0x01f1('0x4a')](handleError(_0x1f8c0a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 84f29a7..6ca60e4 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 _0x3024=['tools_templates','lodash','util','api','moment','path','../../config/environment','./template.attributes','Template'];(function(_0x4b94b4,_0x174bbf){var _0x1597ce=function(_0x26fef1){while(--_0x26fef1){_0x4b94b4['push'](_0x4b94b4['shift']());}};_0x1597ce(++_0x174bbf);}(_0x3024,0x64));var _0x4302=function(_0x5ecfa3,_0x5b55db){_0x5ecfa3=_0x5ecfa3-0x0;var _0x31ec93=_0x3024[_0x5ecfa3];return _0x31ec93;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var logger=require('../../config/logger')(_0x4302('0x2'));var moment=require(_0x4302('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4302('0x4'));var rimraf=require('rimraf');var config=require(_0x4302('0x5'));var attributes=require(_0x4302('0x6'));module['exports']=function(_0x13d051,_0x5f20){return _0x13d051['define'](_0x4302('0x7'),attributes,{'tableName':_0x4302('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['lodash','util','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x4d8d0f,_0x53a0e9){var _0x212d10=function(_0x72d9d8){while(--_0x72d9d8){_0x4d8d0f['push'](_0x4d8d0f['shift']());}};_0x212d10(++_0x53a0e9);}(_0x896e,0x6e));var _0xe896=function(_0x10d7b0,_0x27e100){_0x10d7b0=_0x10d7b0-0x0;var _0x2f7c78=_0x896e[_0x10d7b0];return _0x2f7c78;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe896('0x2'));var rp=require(_0xe896('0x3'));var fs=require('fs');var path=require(_0xe896('0x4'));var rimraf=require('rimraf');var config=require(_0xe896('0x5'));var attributes=require(_0xe896('0x6'));module[_0xe896('0x7')]=function(_0x237373,_0x33c68d){return _0x237373[_0xe896('0x8')](_0xe896('0x9'),attributes,{'tableName':'tools_templates','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 8230e06..50bef6c 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 _0xbd46=['catch','GetTemplate','Template','options','raw','where','limit','map','include','attributes','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5351e0,_0x2fca27){var _0x254a60=function(_0x31c7da){while(--_0x31c7da){_0x5351e0['push'](_0x5351e0['shift']());}};_0x254a60(++_0x2fca27);}(_0xbd46,0xb6));var _0x6bd4=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0xbd46[_0x1d426f];return _0x17f71a;};'use strict';var _=require(_0x6bd4('0x0'));var util=require(_0x6bd4('0x1'));var moment=require(_0x6bd4('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bd4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6bd4('0x4'))['db'];var utils=require(_0x6bd4('0x5'));var logger=require(_0x6bd4('0x6'))('rpc');var config=require(_0x6bd4('0x7'));var jayson=require(_0x6bd4('0x8'));var client=jayson[_0x6bd4('0x9')][_0x6bd4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ff665,_0x1a116b,_0x156fbc){return new BPromise(function(_0x5ad25c,_0x222ab8){return client[_0x6bd4('0xb')](_0x3ff665,_0x156fbc)[_0x6bd4('0xc')](function(_0x1001ec){logger['info'](_0x6bd4('0xd'),_0x1a116b,_0x6bd4('0xe'));logger['debug'](_0x6bd4('0xf'),_0x1a116b,_0x6bd4('0xe'),JSON[_0x6bd4('0x10')](_0x1001ec));if(_0x1001ec[_0x6bd4('0x11')]){if(_0x1001ec[_0x6bd4('0x11')][_0x6bd4('0x12')]===0x1f4){logger[_0x6bd4('0x11')]('Template,\x20%s,\x20%s',_0x1a116b,_0x1001ec[_0x6bd4('0x11')][_0x6bd4('0x13')]);return _0x222ab8(_0x1001ec[_0x6bd4('0x11')][_0x6bd4('0x13')]);}logger[_0x6bd4('0x11')](_0x6bd4('0xd'),_0x1a116b,_0x1001ec['error']['message']);return _0x5ad25c(_0x1001ec['error'][_0x6bd4('0x13')]);}else{logger[_0x6bd4('0x14')](_0x6bd4('0xd'),_0x1a116b,_0x6bd4('0xe'));_0x5ad25c(_0x1001ec[_0x6bd4('0x15')][_0x6bd4('0x13')]);}})[_0x6bd4('0x16')](function(_0x52f2e1){logger[_0x6bd4('0x11')]('Template,\x20%s,\x20%s',_0x1a116b,_0x52f2e1);_0x222ab8(_0x52f2e1);});});}exports[_0x6bd4('0x17')]=function(_0x35f988){var _0x3df7e7=this;return new Promise(function(_0x1f705d,_0x19cf1a){return db[_0x6bd4('0x18')]['findAll']({'raw':_0x35f988['options']?_0x35f988[_0x6bd4('0x19')][_0x6bd4('0x1a')]===undefined?!![]:![]:!![],'where':_0x35f988[_0x6bd4('0x19')]?_0x35f988[_0x6bd4('0x19')][_0x6bd4('0x1b')]||null:null,'attributes':_0x35f988['options']?_0x35f988[_0x6bd4('0x19')]['attributes']||null:null,'limit':_0x35f988[_0x6bd4('0x19')]?_0x35f988[_0x6bd4('0x19')][_0x6bd4('0x1c')]||null:null,'include':_0x35f988[_0x6bd4('0x19')]?_0x35f988[_0x6bd4('0x19')]['include']?_[_0x6bd4('0x1d')](_0x35f988['options'][_0x6bd4('0x1e')],function(_0x1bb111){return{'model':db[_0x1bb111['model']],'as':_0x1bb111['as'],'attributes':_0x1bb111[_0x6bd4('0x1f')],'include':_0x1bb111[_0x6bd4('0x1e')]?_[_0x6bd4('0x1d')](_0x1bb111['include'],function(_0x36efdd){return{'model':db[_0x36efdd[_0x6bd4('0x20')]],'as':_0x36efdd['as'],'attributes':_0x36efdd[_0x6bd4('0x1f')],'include':_0x36efdd['include']?_[_0x6bd4('0x1d')](_0x36efdd[_0x6bd4('0x1e')],function(_0x130b35){return{'model':db[_0x130b35[_0x6bd4('0x20')]],'as':_0x130b35['as'],'attributes':_0x130b35[_0x6bd4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6bd4('0xc')](function(_0x33bc81){logger[_0x6bd4('0x14')](_0x6bd4('0x17'),_0x35f988);logger[_0x6bd4('0x21')](_0x6bd4('0x17'),_0x35f988,JSON[_0x6bd4('0x10')](_0x33bc81));_0x1f705d(_0x33bc81);})['catch'](function(_0x38a623){logger[_0x6bd4('0x11')]('GetTemplate',_0x38a623[_0x6bd4('0x13')],_0x35f988);_0x19cf1a(_0x3df7e7[_0x6bd4('0x11')](0x1f4,_0x38a623['message']));});});}; \ No newline at end of file +var _0xcabd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','Template,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','map','include','model','GetTemplate','lodash','util','bluebird','randomstring'];(function(_0x21f19a,_0x12adef){var _0x14edb2=function(_0x2156f4){while(--_0x2156f4){_0x21f19a['push'](_0x21f19a['shift']());}};_0x14edb2(++_0x12adef);}(_0xcabd,0x1bc));var _0xdcab=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xcabd[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var moment=require('moment');var BPromise=require(_0xdcab('0x2'));var rs=require(_0xdcab('0x3'));var fs=require('fs');var Redis=require(_0xdcab('0x4'));var db=require(_0xdcab('0x5'))['db'];var utils=require(_0xdcab('0x6'));var logger=require(_0xdcab('0x7'))(_0xdcab('0x8'));var config=require(_0xdcab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdcab('0xa')][_0xdcab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6618,_0x45b692,_0x1fa258){return new BPromise(function(_0xd4c0b6,_0x113ecb){return client[_0xdcab('0xc')](_0x2b6618,_0x1fa258)[_0xdcab('0xd')](function(_0xfb72c3){logger[_0xdcab('0xe')]('Template,\x20%s,\x20%s',_0x45b692,'request\x20sent');logger[_0xdcab('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x45b692,_0xdcab('0x10'),JSON[_0xdcab('0x11')](_0xfb72c3));if(_0xfb72c3[_0xdcab('0x12')]){if(_0xfb72c3['error'][_0xdcab('0x13')]===0x1f4){logger[_0xdcab('0x12')]('Template,\x20%s,\x20%s',_0x45b692,_0xfb72c3['error'][_0xdcab('0x14')]);return _0x113ecb(_0xfb72c3['error']['message']);}logger[_0xdcab('0x12')](_0xdcab('0x15'),_0x45b692,_0xfb72c3['error'][_0xdcab('0x14')]);return _0xd4c0b6(_0xfb72c3['error'][_0xdcab('0x14')]);}else{logger[_0xdcab('0xe')](_0xdcab('0x15'),_0x45b692,_0xdcab('0x10'));_0xd4c0b6(_0xfb72c3[_0xdcab('0x16')][_0xdcab('0x14')]);}})[_0xdcab('0x17')](function(_0x3fe8d6){logger[_0xdcab('0x12')](_0xdcab('0x15'),_0x45b692,_0x3fe8d6);_0x113ecb(_0x3fe8d6);});});}exports['GetTemplate']=function(_0x4079d3){var _0x28b56e=this;return new Promise(function(_0x2dc40f,_0x3837e6){return db['Template'][_0xdcab('0x18')]({'raw':_0x4079d3[_0xdcab('0x19')]?_0x4079d3[_0xdcab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4079d3['options']?_0x4079d3['options'][_0xdcab('0x1a')]||null:null,'attributes':_0x4079d3['options']?_0x4079d3[_0xdcab('0x19')][_0xdcab('0x1b')]||null:null,'limit':_0x4079d3[_0xdcab('0x19')]?_0x4079d3[_0xdcab('0x19')]['limit']||null:null,'include':_0x4079d3['options']?_0x4079d3[_0xdcab('0x19')]['include']?_[_0xdcab('0x1c')](_0x4079d3[_0xdcab('0x19')][_0xdcab('0x1d')],function(_0x2aa732){return{'model':db[_0x2aa732['model']],'as':_0x2aa732['as'],'attributes':_0x2aa732['attributes'],'include':_0x2aa732[_0xdcab('0x1d')]?_[_0xdcab('0x1c')](_0x2aa732[_0xdcab('0x1d')],function(_0x3bed83){return{'model':db[_0x3bed83[_0xdcab('0x1e')]],'as':_0x3bed83['as'],'attributes':_0x3bed83['attributes'],'include':_0x3bed83[_0xdcab('0x1d')]?_[_0xdcab('0x1c')](_0x3bed83[_0xdcab('0x1d')],function(_0x18b027){return{'model':db[_0x18b027[_0xdcab('0x1e')]],'as':_0x18b027['as'],'attributes':_0x18b027[_0xdcab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdcab('0xd')](function(_0x40efe6){logger[_0xdcab('0xe')]('GetTemplate',_0x4079d3);logger['debug']('GetTemplate',_0x4079d3,JSON['stringify'](_0x40efe6));_0x2dc40f(_0x40efe6);})['catch'](function(_0x4350a5){logger['error'](_0xdcab('0x1f'),_0x4350a5['message'],_0x4079d3);_0x3837e6(_0x28b56e[_0xdcab('0x12')](0x1f4,_0x4350a5[_0xdcab('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index bbb2567..4e67aeb 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 _0xea0f=['getActions','post','create','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','update','delete','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/all_conditions'];(function(_0x1bac43,_0x36d42d){var _0x633e2f=function(_0x950676){while(--_0x950676){_0x1bac43['push'](_0x1bac43['shift']());}};_0x633e2f(++_0x36d42d);}(_0xea0f,0x96));var _0xfea0=function(_0x4565fb,_0x338c60){_0x4565fb=_0x4565fb-0x0;var _0xdcdd88=_0xea0f[_0x4565fb];return _0xdcdd88;};'use strict';var multer=require(_0xfea0('0x0'));var util=require(_0xfea0('0x1'));var path=require(_0xfea0('0x2'));var timeout=require('connect-timeout');var express=require(_0xfea0('0x3'));var router=express[_0xfea0('0x4')]();var auth=require(_0xfea0('0x5'));var interaction=require(_0xfea0('0x6'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xfea0('0x7')]('/',auth[_0xfea0('0x8')](),controller['index']);router[_0xfea0('0x7')]('/:id',auth[_0xfea0('0x8')](),controller[_0xfea0('0x9')]);router[_0xfea0('0x7')](_0xfea0('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0xfea0('0x8')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0xfea0('0x8')](),controller[_0xfea0('0xb')]);router[_0xfea0('0xc')]('/',auth['isAuthenticated'](),controller[_0xfea0('0xd')]);router[_0xfea0('0xc')](_0xfea0('0xa'),auth[_0xfea0('0x8')](),controller['addAllCondition']);router[_0xfea0('0xc')](_0xfea0('0xe'),auth[_0xfea0('0x8')](),controller[_0xfea0('0xf')]);router[_0xfea0('0xc')](_0xfea0('0x10'),auth[_0xfea0('0x8')](),controller[_0xfea0('0x11')]);router[_0xfea0('0x12')]('/:id',auth[_0xfea0('0x8')](),controller[_0xfea0('0x13')]);router[_0xfea0('0x14')](_0xfea0('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xfea0('0x16')]=router; \ No newline at end of file +var _0x893e=['addAction','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','/:id/all_conditions','addAnyCondition'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x893e,0x10a));var _0xe893=function(_0x4b150b,_0x248e21){_0x4b150b=_0x4b150b-0x0;var _0x67a9fd=_0x893e[_0x4b150b];return _0x67a9fd;};'use strict';var multer=require(_0xe893('0x0'));var util=require(_0xe893('0x1'));var path=require(_0xe893('0x2'));var timeout=require('connect-timeout');var express=require(_0xe893('0x3'));var router=express[_0xe893('0x4')]();var auth=require(_0xe893('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe893('0x6'));var controller=require(_0xe893('0x7'));router[_0xe893('0x8')]('/',auth[_0xe893('0x9')](),controller[_0xe893('0xa')]);router[_0xe893('0x8')]('/:id',auth[_0xe893('0x9')](),controller[_0xe893('0xb')]);router[_0xe893('0x8')]('/:id/all_conditions',auth[_0xe893('0x9')](),controller[_0xe893('0xc')]);router['get'](_0xe893('0xd'),auth[_0xe893('0x9')](),controller['getAnyConditions']);router[_0xe893('0x8')](_0xe893('0xe'),auth[_0xe893('0x9')](),controller[_0xe893('0xf')]);router['post']('/',auth[_0xe893('0x9')](),controller[_0xe893('0x10')]);router[_0xe893('0x11')](_0xe893('0x12'),auth[_0xe893('0x9')](),controller['addAllCondition']);router['post'](_0xe893('0xd'),auth[_0xe893('0x9')](),controller[_0xe893('0x13')]);router[_0xe893('0x11')](_0xe893('0xe'),auth[_0xe893('0x9')](),controller[_0xe893('0x14')]);router['put'](_0xe893('0x15'),auth[_0xe893('0x9')](),controller[_0xe893('0x16')]);router[_0xe893('0x17')](_0xe893('0x15'),auth[_0xe893('0x9')](),controller[_0xe893('0x18')]);module[_0xe893('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 9c2b384..da44349 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 _0x8dd7=['sequelize','STRING','BOOLEAN'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x8dd7,0x6f));var _0x78dd=function(_0x50a45f,_0x428399){_0x50a45f=_0x50a45f-0x0;var _0x5279ef=_0x8dd7[_0x50a45f];return _0x5279ef;};'use strict';var Sequelize=require(_0x78dd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x78dd('0x1')]},'description':{'type':Sequelize[_0x78dd('0x1')]},'status':{'type':Sequelize[_0x78dd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x65cc=['BOOLEAN','sequelize','exports','STRING'];(function(_0x285228,_0x537f9e){var _0x3240ad=function(_0xc587ef){while(--_0xc587ef){_0x285228['push'](_0x285228['shift']());}};_0x3240ad(++_0x537f9e);}(_0x65cc,0x1b1));var _0xc65c=function(_0x5b9986,_0x5d376a){_0x5b9986=_0x5b9986-0x0;var _0x2c3085=_0x65cc[_0x5b9986];return _0x2c3085;};'use strict';var Sequelize=require(_0xc65c('0x0'));module[_0xc65c('0x1')]={'name':{'type':Sequelize[_0xc65c('0x2')]},'channel':{'type':Sequelize[_0xc65c('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xc65c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index cb0bc19..7acb892 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 _0xb6cf=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','Trigger','includeAll','include','findAll','rows','show','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','bluebird','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/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','Triggers','UserProfileResource','sendStatus','error','stack'];(function(_0x5d5201,_0x38a5a1){var _0x229267=function(_0x6bb4f5){while(--_0x6bb4f5){_0x5d5201['push'](_0x5d5201['shift']());}};_0x229267(++_0x38a5a1);}(_0xb6cf,0xed));var _0xfb6c=function(_0x7b544a,_0x33c45a){_0x7b544a=_0x7b544a-0x0;var _0x33dcb4=_0xb6cf[_0x7b544a];return _0x33dcb4;};'use strict';var pdf=require(_0xfb6c('0x0'));var emlformat=require(_0xfb6c('0x1'));var rimraf=require(_0xfb6c('0x2'));var zipdir=require(_0xfb6c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfb6c('0x4'));var Mustache=require(_0xfb6c('0x5'));var util=require(_0xfb6c('0x6'));var path=require('path');var sox=require(_0xfb6c('0x7'));var csv=require(_0xfb6c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfb6c('0x9'));var squel=require(_0xfb6c('0xa'));var crypto=require(_0xfb6c('0xb'));var jsforce=require(_0xfb6c('0xc'));var deskjs=require(_0xfb6c('0xd'));var toCsv=require(_0xfb6c('0x8'));var querystring=require(_0xfb6c('0xe'));var Papa=require(_0xfb6c('0xf'));var Redis=require(_0xfb6c('0x10'));var authService=require(_0xfb6c('0x11'));var qs=require(_0xfb6c('0x12'));var as=require(_0xfb6c('0x13'));var hardwareService=require(_0xfb6c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfb6c('0x15'));var config=require(_0xfb6c('0x16'));var db=require(_0xfb6c('0x17'))['db'];function respondWithStatusCode(_0x1831fd,_0x21cbe8){_0x21cbe8=_0x21cbe8||0xcc;return function(_0x174630){if(_0x174630){return _0x1831fd['sendStatus'](_0x21cbe8);}return _0x1831fd[_0xfb6c('0x18')](_0x21cbe8)[_0xfb6c('0x19')]();};}function respondWithResult(_0x34e254,_0x23dbc9){_0x23dbc9=_0x23dbc9||0xc8;return function(_0x51090d){if(_0x51090d){return _0x34e254[_0xfb6c('0x18')](_0x23dbc9)[_0xfb6c('0x1a')](_0x51090d);}};}function respondWithFilteredResult(_0x33d06c,_0x1c840d){return function(_0x3f22fb){if(_0x3f22fb){var _0x3b78eb=_0x3f22fb[_0xfb6c('0x1b')],_0x4d296b=_0x1c840d[_0xfb6c('0x1c')],_0x2fd6e0=_0x1c840d[_0xfb6c('0x1c')]+_0x1c840d[_0xfb6c('0x1d')],_0x317fb7;if(_0x2fd6e0>=_0x3b78eb){_0x2fd6e0=_0x3b78eb;_0x317fb7=0xc8;}else{_0x317fb7=0xce;}_0x33d06c[_0xfb6c('0x18')](_0x317fb7);return _0x33d06c[_0xfb6c('0x1e')](_0xfb6c('0x1f'),_0x4d296b+'-'+_0x2fd6e0+'/'+_0x3b78eb)['json'](_0x3f22fb);}return null;};}function patchUpdates(_0x5db396){return function(_0x28fb21){try{jsonpatch[_0xfb6c('0x20')](_0x28fb21,_0x5db396,!![]);}catch(_0x427e3d){return BPromise['reject'](_0x427e3d);}return _0x28fb21[_0xfb6c('0x21')]();};}function saveUpdates(_0x9c1ca,_0x46d933){return function(_0x53872c){if(_0x53872c){return _0x53872c[_0xfb6c('0x22')](_0x9c1ca)[_0xfb6c('0x23')](function(_0x3faf0c){return _0x3faf0c;});}return null;};}function removeEntity(_0x245208,_0xd14f79){return function(_0x3c7ab8){if(_0x3c7ab8){return _0x3c7ab8['destroy']()['then'](function(){var _0x3cac9d=_0x3c7ab8[_0xfb6c('0x24')]({'plain':!![]});var _0x492d2b=_0xfb6c('0x25');return db[_0xfb6c('0x26')]['destroy']({'where':{'type':_0x492d2b,'resourceId':_0x3cac9d['id']}})['then'](function(){return _0x3c7ab8;});})[_0xfb6c('0x23')](function(){_0x245208[_0xfb6c('0x18')](0xcc)[_0xfb6c('0x19')]();});}};}function handleEntityNotFound(_0x2d3366,_0xacad6e){return function(_0x3e44b3){if(!_0x3e44b3){_0x2d3366[_0xfb6c('0x27')](0x194);}return _0x3e44b3;};}function handleError(_0x30c3e5,_0x2da568){_0x2da568=_0x2da568||0x1f4;return function(_0x177371){logger[_0xfb6c('0x28')](_0x177371[_0xfb6c('0x29')]);if(_0x177371[_0xfb6c('0x2a')]){delete _0x177371[_0xfb6c('0x2a')];}_0x30c3e5[_0xfb6c('0x18')](_0x2da568)[_0xfb6c('0x2b')](_0x177371);};}exports[_0xfb6c('0x2c')]=function(_0x4c51af,_0x5f4cd2){var _0x35d7b1={},_0x211506={},_0x4ee69f={'count':0x0,'rows':[]};var _0x31831e=_[_0xfb6c('0x2d')](db['Trigger']['rawAttributes'],function(_0x477cc5){return{'name':_0x477cc5[_0xfb6c('0x2e')],'type':_0x477cc5[_0xfb6c('0x2f')][_0xfb6c('0x30')]};});_0x211506[_0xfb6c('0x31')]=_['map'](_0x31831e,_0xfb6c('0x2a'));_0x211506[_0xfb6c('0x32')]=_[_0xfb6c('0x33')](_0x4c51af[_0xfb6c('0x32')]);_0x211506[_0xfb6c('0x34')]=_['intersection'](_0x211506[_0xfb6c('0x31')],_0x211506['query']);_0x35d7b1['attributes']=_[_0xfb6c('0x35')](_0x211506[_0xfb6c('0x31')],qs[_0xfb6c('0x36')](_0x4c51af['query'][_0xfb6c('0x36')]));_0x35d7b1[_0xfb6c('0x37')]=_0x35d7b1[_0xfb6c('0x37')]['length']?_0x35d7b1['attributes']:_0x211506[_0xfb6c('0x31')];if(!_0x4c51af[_0xfb6c('0x32')]['hasOwnProperty'](_0xfb6c('0x38'))){_0x35d7b1['limit']=qs[_0xfb6c('0x1d')](_0x4c51af[_0xfb6c('0x32')]['limit']);_0x35d7b1[_0xfb6c('0x1c')]=qs[_0xfb6c('0x1c')](_0x4c51af[_0xfb6c('0x32')][_0xfb6c('0x1c')]);}_0x35d7b1[_0xfb6c('0x39')]=qs[_0xfb6c('0x3a')](_0x4c51af[_0xfb6c('0x32')][_0xfb6c('0x3a')]);_0x35d7b1[_0xfb6c('0x3b')]=qs[_0xfb6c('0x34')](_[_0xfb6c('0x3c')](_0x4c51af[_0xfb6c('0x32')],_0x211506['filters']),_0x31831e);if(_0x4c51af[_0xfb6c('0x32')][_0xfb6c('0x3d')]){_0x35d7b1[_0xfb6c('0x3b')]=_[_0xfb6c('0x3e')](_0x35d7b1[_0xfb6c('0x3b')],{'$or':_['map'](_0x31831e,function(_0x46c6f6){if(_0x46c6f6[_0xfb6c('0x2f')]!=='VIRTUAL'){var _0x3c5a98={};_0x3c5a98[_0x46c6f6[_0xfb6c('0x2a')]]={'$like':'%'+_0x4c51af['query']['filter']+'%'};return _0x3c5a98;}})});}_0x35d7b1=_[_0xfb6c('0x3e')]({},_0x35d7b1,_0x4c51af[_0xfb6c('0x3f')]);var _0x1b7014={'where':_0x35d7b1[_0xfb6c('0x3b')]};return db[_0xfb6c('0x40')][_0xfb6c('0x1b')](_0x1b7014)['then'](function(_0x570483){_0x4ee69f[_0xfb6c('0x1b')]=_0x570483;if(_0x4c51af[_0xfb6c('0x32')][_0xfb6c('0x41')]){_0x35d7b1[_0xfb6c('0x42')]=[{'all':!![]}];}return db[_0xfb6c('0x40')][_0xfb6c('0x43')](_0x35d7b1);})[_0xfb6c('0x23')](function(_0x382959){_0x4ee69f[_0xfb6c('0x44')]=_0x382959;return _0x4ee69f;})[_0xfb6c('0x23')](respondWithFilteredResult(_0x5f4cd2,_0x35d7b1))['catch'](handleError(_0x5f4cd2,null));};exports[_0xfb6c('0x45')]=function(_0x490e78,_0xcb0dd){var _0x374d52={'raw':![],'where':{'id':_0x490e78['params']['id']}},_0x5a13c2={};_0x5a13c2[_0xfb6c('0x31')]=_[_0xfb6c('0x33')](db[_0xfb6c('0x40')][_0xfb6c('0x46')]);_0x5a13c2[_0xfb6c('0x32')]=_[_0xfb6c('0x33')](_0x490e78[_0xfb6c('0x32')]);_0x5a13c2[_0xfb6c('0x34')]=_[_0xfb6c('0x35')](_0x5a13c2[_0xfb6c('0x31')],_0x5a13c2['query']);_0x374d52['attributes']=_[_0xfb6c('0x35')](_0x5a13c2[_0xfb6c('0x31')],qs['fields'](_0x490e78['query']['fields']));_0x374d52[_0xfb6c('0x37')]=_0x374d52[_0xfb6c('0x37')][_0xfb6c('0x47')]?_0x374d52[_0xfb6c('0x37')]:_0x5a13c2['model'];if(_0x490e78['query']['includeAll']){_0x374d52['include']=[{'all':!![]}];}_0x374d52=_[_0xfb6c('0x3e')]({},_0x374d52,_0x490e78[_0xfb6c('0x3f')]);return db[_0xfb6c('0x40')][_0xfb6c('0x48')](_0x374d52)[_0xfb6c('0x23')](handleEntityNotFound(_0xcb0dd,null))[_0xfb6c('0x23')](respondWithResult(_0xcb0dd,null))[_0xfb6c('0x49')](handleError(_0xcb0dd,null));};exports[_0xfb6c('0x4a')]=function(_0x1aab8e,_0x56f89a){return db[_0xfb6c('0x40')][_0xfb6c('0x4a')](_0x1aab8e[_0xfb6c('0x4b')],{})[_0xfb6c('0x23')](function(_0x5914d9){var _0x160bb1=_0x1aab8e[_0xfb6c('0x4c')][_0xfb6c('0x24')]({'plain':!![]});if(!_0x160bb1)throw new Error(_0xfb6c('0x4d'));if(_0x160bb1[_0xfb6c('0x4e')]===_0xfb6c('0x4c')){var _0x2ea714=_0x5914d9[_0xfb6c('0x24')]({'plain':!![]});var _0x3d6a37=_0xfb6c('0x25');return db[_0xfb6c('0x4f')]['find']({'where':{'name':_0x3d6a37,'userProfileId':_0x160bb1['userProfileId']},'raw':!![]})[_0xfb6c('0x23')](function(_0x47ff07){if(_0x47ff07&&_0x47ff07['autoAssociation']===0x0){return db[_0xfb6c('0x26')][_0xfb6c('0x4a')]({'name':_0x2ea714[_0xfb6c('0x2a')],'resourceId':_0x2ea714['id'],'type':_0x47ff07[_0xfb6c('0x2a')],'sectionId':_0x47ff07['id']},{})[_0xfb6c('0x23')](function(){return _0x5914d9;});}else{return _0x5914d9;}})[_0xfb6c('0x49')](function(_0xcc057c){logger[_0xfb6c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcc057c);throw _0xcc057c;});}return _0x5914d9;})[_0xfb6c('0x23')](respondWithResult(_0x56f89a,0xc9))[_0xfb6c('0x49')](handleError(_0x56f89a,null));};exports[_0xfb6c('0x22')]=function(_0xfb38f4,_0x43f52d){if(_0xfb38f4[_0xfb6c('0x4b')]['id']){delete _0xfb38f4['body']['id'];}return db['Trigger']['find']({'where':{'id':_0xfb38f4[_0xfb6c('0x50')]['id']}})['then'](handleEntityNotFound(_0x43f52d,null))[_0xfb6c('0x23')](saveUpdates(_0xfb38f4['body'],null))[_0xfb6c('0x23')](respondWithResult(_0x43f52d,null))[_0xfb6c('0x49')](handleError(_0x43f52d,null));};exports['destroy']=function(_0x495a0f,_0x450023){return db['Trigger'][_0xfb6c('0x48')]({'where':{'id':_0x495a0f[_0xfb6c('0x50')]['id']}})[_0xfb6c('0x23')](handleEntityNotFound(_0x450023,null))[_0xfb6c('0x23')](removeEntity(_0x450023,null))['catch'](handleError(_0x450023,null));};exports['addAllCondition']=function(_0x15e11a,_0x31c3bb,_0x3a88c6){if(_0x15e11a[_0xfb6c('0x4b')]['id']){delete _0x15e11a['body']['id'];}return db[_0xfb6c('0x40')][_0xfb6c('0x48')]({'where':{'id':_0x15e11a[_0xfb6c('0x50')]['id']}})[_0xfb6c('0x23')](handleEntityNotFound(_0x31c3bb,null))['then'](function(_0x2900d8){if(_0x2900d8){_0x15e11a[_0xfb6c('0x4b')][_0xfb6c('0x51')]=_0x2900d8['id'];return db[_0xfb6c('0x52')][_0xfb6c('0x4a')](_0x15e11a[_0xfb6c('0x4b')]);}})['then'](respondWithResult(_0x31c3bb,null))[_0xfb6c('0x49')](handleError(_0x31c3bb,null));};exports[_0xfb6c('0x53')]=function(_0x170398,_0x222a7c,_0x101c91){if(_0x170398[_0xfb6c('0x4b')]['id']){delete _0x170398[_0xfb6c('0x4b')]['id'];}return db[_0xfb6c('0x40')][_0xfb6c('0x48')]({'where':{'id':_0x170398[_0xfb6c('0x50')]['id']}})[_0xfb6c('0x23')](handleEntityNotFound(_0x222a7c,null))[_0xfb6c('0x23')](function(_0x1a230a){if(_0x1a230a){_0x170398[_0xfb6c('0x4b')][_0xfb6c('0x54')]=_0x1a230a['id'];return db[_0xfb6c('0x52')]['create'](_0x170398[_0xfb6c('0x4b')]);}})['then'](respondWithResult(_0x222a7c,null))[_0xfb6c('0x49')](handleError(_0x222a7c,null));};exports[_0xfb6c('0x55')]=function(_0x49fe2c,_0x1d727a,_0x27d99d){var _0x4845d3={};var _0x5de246={};var _0x3f7587;var _0x25203f;return db[_0xfb6c('0x40')][_0xfb6c('0x56')]({'where':{'id':_0x49fe2c[_0xfb6c('0x50')]['id']}})['then'](handleEntityNotFound(_0x1d727a,null))[_0xfb6c('0x23')](function(_0x911166){if(_0x911166){_0x3f7587=_0x911166;_0x5de246[_0xfb6c('0x31')]=_['keys'](db[_0xfb6c('0x52')][_0xfb6c('0x46')]);_0x5de246[_0xfb6c('0x32')]=_[_0xfb6c('0x33')](_0x49fe2c[_0xfb6c('0x32')]);_0x5de246[_0xfb6c('0x34')]=_[_0xfb6c('0x35')](_0x5de246[_0xfb6c('0x31')],_0x5de246[_0xfb6c('0x32')]);_0x4845d3[_0xfb6c('0x37')]=_['intersection'](_0x5de246['model'],qs[_0xfb6c('0x36')](_0x49fe2c[_0xfb6c('0x32')][_0xfb6c('0x36')]));_0x4845d3['attributes']=_0x4845d3[_0xfb6c('0x37')][_0xfb6c('0x47')]?_0x4845d3[_0xfb6c('0x37')]:_0x5de246[_0xfb6c('0x31')];_0x4845d3['order']=qs[_0xfb6c('0x3a')](_0x49fe2c[_0xfb6c('0x32')]['sort']);_0x4845d3[_0xfb6c('0x3b')]=qs[_0xfb6c('0x34')](_[_0xfb6c('0x3c')](_0x49fe2c[_0xfb6c('0x32')],_0x5de246[_0xfb6c('0x34')]));if(_0x49fe2c['query'][_0xfb6c('0x3d')]){_0x4845d3[_0xfb6c('0x3b')]=_['merge'](_0x4845d3[_0xfb6c('0x3b')],{'$or':_[_0xfb6c('0x2d')](_0x4845d3[_0xfb6c('0x37')],function(_0xde1dbd){var _0x3d9d3f={};_0x3d9d3f[_0xde1dbd]={'$like':'%'+_0x49fe2c['query'][_0xfb6c('0x3d')]+'%'};return _0x3d9d3f;})});}_0x4845d3=_[_0xfb6c('0x3e')]({},_0x4845d3,_0x49fe2c[_0xfb6c('0x3f')]);return _0x3f7587['getAllConditions'](_0x4845d3);}})[_0xfb6c('0x23')](function(_0x1ee6ec){if(_0x1ee6ec){_0x25203f=_0x1ee6ec['length'];if(!_0x49fe2c[_0xfb6c('0x32')][_0xfb6c('0x57')]('nolimit')){_0x4845d3['limit']=qs['limit'](_0x49fe2c['query'][_0xfb6c('0x1d')]);_0x4845d3[_0xfb6c('0x1c')]=qs[_0xfb6c('0x1c')](_0x49fe2c[_0xfb6c('0x32')][_0xfb6c('0x1c')]);}return _0x3f7587[_0xfb6c('0x55')](_0x4845d3);}})[_0xfb6c('0x23')](function(_0x508aa0){if(_0x508aa0){return _0x508aa0?{'count':_0x25203f,'rows':_0x508aa0}:null;}})[_0xfb6c('0x23')](respondWithResult(_0x1d727a,null))[_0xfb6c('0x49')](handleError(_0x1d727a,null));};exports[_0xfb6c('0x58')]=function(_0x1be20a,_0x36c7c6,_0x472385){var _0x1106d5={};var _0x165f5e={};var _0x3f3252;var _0x4efc64;return db[_0xfb6c('0x40')][_0xfb6c('0x56')]({'where':{'id':_0x1be20a['params']['id']}})[_0xfb6c('0x23')](handleEntityNotFound(_0x36c7c6,null))[_0xfb6c('0x23')](function(_0x5f10f0){if(_0x5f10f0){_0x3f3252=_0x5f10f0;_0x165f5e[_0xfb6c('0x31')]=_[_0xfb6c('0x33')](db[_0xfb6c('0x52')][_0xfb6c('0x46')]);_0x165f5e[_0xfb6c('0x32')]=_['keys'](_0x1be20a['query']);_0x165f5e[_0xfb6c('0x34')]=_['intersection'](_0x165f5e['model'],_0x165f5e['query']);_0x1106d5[_0xfb6c('0x37')]=_[_0xfb6c('0x35')](_0x165f5e['model'],qs[_0xfb6c('0x36')](_0x1be20a[_0xfb6c('0x32')]['fields']));_0x1106d5[_0xfb6c('0x37')]=_0x1106d5[_0xfb6c('0x37')]['length']?_0x1106d5['attributes']:_0x165f5e['model'];_0x1106d5[_0xfb6c('0x39')]=qs[_0xfb6c('0x3a')](_0x1be20a['query'][_0xfb6c('0x3a')]);_0x1106d5[_0xfb6c('0x3b')]=qs[_0xfb6c('0x34')](_[_0xfb6c('0x3c')](_0x1be20a[_0xfb6c('0x32')],_0x165f5e[_0xfb6c('0x34')]));if(_0x1be20a[_0xfb6c('0x32')][_0xfb6c('0x3d')]){_0x1106d5[_0xfb6c('0x3b')]=_[_0xfb6c('0x3e')](_0x1106d5[_0xfb6c('0x3b')],{'$or':_[_0xfb6c('0x2d')](_0x1106d5[_0xfb6c('0x37')],function(_0x140f17){var _0x5301e3={};_0x5301e3[_0x140f17]={'$like':'%'+_0x1be20a[_0xfb6c('0x32')]['filter']+'%'};return _0x5301e3;})});}_0x1106d5=_[_0xfb6c('0x3e')]({},_0x1106d5,_0x1be20a[_0xfb6c('0x3f')]);return _0x3f3252[_0xfb6c('0x58')](_0x1106d5);}})['then'](function(_0x57557d){if(_0x57557d){_0x4efc64=_0x57557d[_0xfb6c('0x47')];if(!_0x1be20a[_0xfb6c('0x32')][_0xfb6c('0x57')]('nolimit')){_0x1106d5[_0xfb6c('0x1d')]=qs[_0xfb6c('0x1d')](_0x1be20a[_0xfb6c('0x32')][_0xfb6c('0x1d')]);_0x1106d5[_0xfb6c('0x1c')]=qs['offset'](_0x1be20a[_0xfb6c('0x32')][_0xfb6c('0x1c')]);}return _0x3f3252[_0xfb6c('0x58')](_0x1106d5);}})[_0xfb6c('0x23')](function(_0x3aa46a){if(_0x3aa46a){return _0x3aa46a?{'count':_0x4efc64,'rows':_0x3aa46a}:null;}})['then'](respondWithResult(_0x36c7c6,null))[_0xfb6c('0x49')](handleError(_0x36c7c6,null));};exports[_0xfb6c('0x59')]=function(_0xee368e,_0x1141df,_0x34d996){if(_0xee368e['body']['id']){delete _0xee368e[_0xfb6c('0x4b')]['id'];}return db[_0xfb6c('0x40')][_0xfb6c('0x48')]({'where':{'id':_0xee368e[_0xfb6c('0x50')]['id']}})['then'](handleEntityNotFound(_0x1141df,null))[_0xfb6c('0x23')](function(_0x3d6902){if(_0x3d6902){_0xee368e[_0xfb6c('0x4b')][_0xfb6c('0x5a')]=_0x3d6902['id'];return db[_0xfb6c('0x5b')]['create'](_0xee368e[_0xfb6c('0x4b')]);}})[_0xfb6c('0x23')](respondWithResult(_0x1141df,null))[_0xfb6c('0x49')](handleError(_0x1141df,null));};exports[_0xfb6c('0x5c')]=function(_0xf14d28,_0x3c746d,_0x430e89){var _0x310cb3={};var _0x436422={};var _0x51d7f0;var _0x539c4c;return db['Trigger'][_0xfb6c('0x56')]({'where':{'id':_0xf14d28['params']['id']}})[_0xfb6c('0x23')](handleEntityNotFound(_0x3c746d,null))['then'](function(_0x5579d1){if(_0x5579d1){_0x51d7f0=_0x5579d1;_0x436422[_0xfb6c('0x31')]=_[_0xfb6c('0x33')](db[_0xfb6c('0x5b')][_0xfb6c('0x46')]);_0x436422[_0xfb6c('0x32')]=_[_0xfb6c('0x33')](_0xf14d28[_0xfb6c('0x32')]);_0x436422[_0xfb6c('0x34')]=_[_0xfb6c('0x35')](_0x436422['model'],_0x436422[_0xfb6c('0x32')]);_0x310cb3[_0xfb6c('0x37')]=_[_0xfb6c('0x35')](_0x436422[_0xfb6c('0x31')],qs[_0xfb6c('0x36')](_0xf14d28[_0xfb6c('0x32')][_0xfb6c('0x36')]));_0x310cb3[_0xfb6c('0x37')]=_0x310cb3[_0xfb6c('0x37')]['length']?_0x310cb3[_0xfb6c('0x37')]:_0x436422[_0xfb6c('0x31')];_0x310cb3[_0xfb6c('0x39')]=qs['sort'](_0xf14d28['query'][_0xfb6c('0x3a')]);_0x310cb3[_0xfb6c('0x3b')]=qs[_0xfb6c('0x34')](_[_0xfb6c('0x3c')](_0xf14d28['query'],_0x436422['filters']));if(_0xf14d28[_0xfb6c('0x32')][_0xfb6c('0x3d')]){_0x310cb3[_0xfb6c('0x3b')]=_[_0xfb6c('0x3e')](_0x310cb3[_0xfb6c('0x3b')],{'$or':_[_0xfb6c('0x2d')](_0x310cb3[_0xfb6c('0x37')],function(_0x3e3ffa){var _0x358e0e={};_0x358e0e[_0x3e3ffa]={'$like':'%'+_0xf14d28[_0xfb6c('0x32')][_0xfb6c('0x3d')]+'%'};return _0x358e0e;})});}_0x310cb3=_['merge']({},_0x310cb3,_0xf14d28[_0xfb6c('0x3f')]);return _0x51d7f0[_0xfb6c('0x5c')](_0x310cb3);}})['then'](function(_0x17dccf){if(_0x17dccf){_0x539c4c=_0x17dccf[_0xfb6c('0x47')];if(!_0xf14d28[_0xfb6c('0x32')][_0xfb6c('0x57')](_0xfb6c('0x38'))){_0x310cb3[_0xfb6c('0x1d')]=qs[_0xfb6c('0x1d')](_0xf14d28['query']['limit']);_0x310cb3[_0xfb6c('0x1c')]=qs[_0xfb6c('0x1c')](_0xf14d28['query'][_0xfb6c('0x1c')]);}return _0x51d7f0[_0xfb6c('0x5c')](_0x310cb3);}})[_0xfb6c('0x23')](function(_0x46f753){if(_0x46f753){return _0x46f753?{'count':_0x539c4c,'rows':_0x46f753}:null;}})['then'](respondWithResult(_0x3c746d,null))[_0xfb6c('0x49')](handleError(_0x3c746d,null));}; \ No newline at end of file +var _0xb090=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','update','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','Triggers','error','stack','name','index','map','Trigger','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','findAll','catch','show','params','keys','rawAttributes','include','options','find','create','body','user'];(function(_0x467079,_0x3e668c){var _0x1a0f56=function(_0x5abc34){while(--_0x5abc34){_0x467079['push'](_0x467079['shift']());}};_0x1a0f56(++_0x3e668c);}(_0xb090,0xcb));var _0x0b09=function(_0x5864c0,_0x3b5531){_0x5864c0=_0x5864c0-0x0;var _0x10cc0a=_0xb090[_0x5864c0];return _0x10cc0a;};'use strict';var pdf=require(_0x0b09('0x0'));var emlformat=require(_0x0b09('0x1'));var rimraf=require(_0x0b09('0x2'));var zipdir=require(_0x0b09('0x3'));var jsonpatch=require(_0x0b09('0x4'));var rp=require(_0x0b09('0x5'));var moment=require('moment');var BPromise=require(_0x0b09('0x6'));var Mustache=require(_0x0b09('0x7'));var util=require(_0x0b09('0x8'));var path=require('path');var sox=require(_0x0b09('0x9'));var csv=require(_0x0b09('0xa'));var ejs=require(_0x0b09('0xb'));var fs=require('fs');var _=require(_0x0b09('0xc'));var squel=require(_0x0b09('0xd'));var crypto=require(_0x0b09('0xe'));var jsforce=require(_0x0b09('0xf'));var deskjs=require(_0x0b09('0x10'));var toCsv=require(_0x0b09('0xa'));var querystring=require(_0x0b09('0x11'));var Papa=require(_0x0b09('0x12'));var Redis=require(_0x0b09('0x13'));var authService=require(_0x0b09('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b09('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0b09('0x16'));var db=require(_0x0b09('0x17'))['db'];function respondWithStatusCode(_0x1427b9,_0x2a1c2e){_0x2a1c2e=_0x2a1c2e||0xcc;return function(_0x4e1590){if(_0x4e1590){return _0x1427b9['sendStatus'](_0x2a1c2e);}return _0x1427b9[_0x0b09('0x18')](_0x2a1c2e)[_0x0b09('0x19')]();};}function respondWithResult(_0x2cacb7,_0x4bfeab){_0x4bfeab=_0x4bfeab||0xc8;return function(_0x227db9){if(_0x227db9){return _0x2cacb7[_0x0b09('0x18')](_0x4bfeab)['json'](_0x227db9);}};}function respondWithFilteredResult(_0x3f2a0b,_0x31dc6d){return function(_0x325b41){if(_0x325b41){var _0x36759b=_0x325b41[_0x0b09('0x1a')],_0x87d84=_0x31dc6d['offset'],_0x584ff2=_0x31dc6d[_0x0b09('0x1b')]+_0x31dc6d[_0x0b09('0x1c')],_0xc0c0dd;if(_0x584ff2>=_0x36759b){_0x584ff2=_0x36759b;_0xc0c0dd=0xc8;}else{_0xc0c0dd=0xce;}_0x3f2a0b[_0x0b09('0x18')](_0xc0c0dd);return _0x3f2a0b[_0x0b09('0x1d')](_0x0b09('0x1e'),_0x87d84+'-'+_0x584ff2+'/'+_0x36759b)[_0x0b09('0x1f')](_0x325b41);}return null;};}function patchUpdates(_0x4fcb85){return function(_0x4954f8){try{jsonpatch['apply'](_0x4954f8,_0x4fcb85,!![]);}catch(_0x406cc2){return BPromise[_0x0b09('0x20')](_0x406cc2);}return _0x4954f8[_0x0b09('0x21')]();};}function saveUpdates(_0xb7a578,_0x2ae6a8){return function(_0x3e0749){if(_0x3e0749){return _0x3e0749['update'](_0xb7a578)[_0x0b09('0x22')](function(_0x48ecf2){return _0x48ecf2;});}return null;};}function removeEntity(_0x2924bf,_0x40806a){return function(_0x3fa279){if(_0x3fa279){return _0x3fa279[_0x0b09('0x23')]()[_0x0b09('0x22')](function(){var _0x499f18=_0x3fa279['get']({'plain':!![]});var _0x26e2f3=_0x0b09('0x24');return db['UserProfileResource'][_0x0b09('0x23')]({'where':{'type':_0x26e2f3,'resourceId':_0x499f18['id']}})['then'](function(){return _0x3fa279;});})[_0x0b09('0x22')](function(){_0x2924bf[_0x0b09('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b3ec,_0x29563d){return function(_0x8c8c3e){if(!_0x8c8c3e){_0x35b3ec['sendStatus'](0x194);}return _0x8c8c3e;};}function handleError(_0x503f35,_0x2b8851){_0x2b8851=_0x2b8851||0x1f4;return function(_0x2bff8b){logger[_0x0b09('0x25')](_0x2bff8b[_0x0b09('0x26')]);if(_0x2bff8b[_0x0b09('0x27')]){delete _0x2bff8b[_0x0b09('0x27')];}_0x503f35['status'](_0x2b8851)['send'](_0x2bff8b);};}exports[_0x0b09('0x28')]=function(_0x22fd0e,_0x30defb){var _0x4e6861={},_0x373754={},_0x2e0cb0={'count':0x0,'rows':[]};var _0x34805c=_[_0x0b09('0x29')](db[_0x0b09('0x2a')]['rawAttributes'],function(_0x3a7755){return{'name':_0x3a7755[_0x0b09('0x2b')],'type':_0x3a7755[_0x0b09('0x2c')][_0x0b09('0x2d')]};});_0x373754[_0x0b09('0x2e')]=_['map'](_0x34805c,_0x0b09('0x27'));_0x373754[_0x0b09('0x2f')]=_['keys'](_0x22fd0e['query']);_0x373754[_0x0b09('0x30')]=_[_0x0b09('0x31')](_0x373754[_0x0b09('0x2e')],_0x373754[_0x0b09('0x2f')]);_0x4e6861['attributes']=_[_0x0b09('0x31')](_0x373754[_0x0b09('0x2e')],qs[_0x0b09('0x32')](_0x22fd0e[_0x0b09('0x2f')][_0x0b09('0x32')]));_0x4e6861[_0x0b09('0x33')]=_0x4e6861['attributes'][_0x0b09('0x34')]?_0x4e6861['attributes']:_0x373754[_0x0b09('0x2e')];if(!_0x22fd0e[_0x0b09('0x2f')][_0x0b09('0x35')](_0x0b09('0x36'))){_0x4e6861[_0x0b09('0x1c')]=qs[_0x0b09('0x1c')](_0x22fd0e['query']['limit']);_0x4e6861[_0x0b09('0x1b')]=qs[_0x0b09('0x1b')](_0x22fd0e['query'][_0x0b09('0x1b')]);}_0x4e6861['order']=qs[_0x0b09('0x37')](_0x22fd0e[_0x0b09('0x2f')]['sort']);_0x4e6861['where']=qs[_0x0b09('0x30')](_[_0x0b09('0x38')](_0x22fd0e['query'],_0x373754[_0x0b09('0x30')]),_0x34805c);if(_0x22fd0e['query'][_0x0b09('0x39')]){_0x4e6861[_0x0b09('0x3a')]=_[_0x0b09('0x3b')](_0x4e6861[_0x0b09('0x3a')],{'$or':_[_0x0b09('0x29')](_0x34805c,function(_0x26c2b7){if(_0x26c2b7[_0x0b09('0x2c')]!=='VIRTUAL'){var _0x2ac810={};_0x2ac810[_0x26c2b7['name']]={'$like':'%'+_0x22fd0e[_0x0b09('0x2f')]['filter']+'%'};return _0x2ac810;}})});}_0x4e6861=_[_0x0b09('0x3b')]({},_0x4e6861,_0x22fd0e['options']);var _0x1e5734={'where':_0x4e6861['where']};return db['Trigger']['count'](_0x1e5734)[_0x0b09('0x22')](function(_0x14f6a9){_0x2e0cb0[_0x0b09('0x1a')]=_0x14f6a9;if(_0x22fd0e['query'][_0x0b09('0x3c')]){_0x4e6861['include']=[{'all':!![]}];}return db[_0x0b09('0x2a')][_0x0b09('0x3d')](_0x4e6861);})[_0x0b09('0x22')](function(_0x5f034e){_0x2e0cb0['rows']=_0x5f034e;return _0x2e0cb0;})[_0x0b09('0x22')](respondWithFilteredResult(_0x30defb,_0x4e6861))[_0x0b09('0x3e')](handleError(_0x30defb,null));};exports[_0x0b09('0x3f')]=function(_0x175857,_0x1fb1a3){var _0x16baca={'raw':![],'where':{'id':_0x175857[_0x0b09('0x40')]['id']}},_0x14a41e={};_0x14a41e[_0x0b09('0x2e')]=_[_0x0b09('0x41')](db[_0x0b09('0x2a')][_0x0b09('0x42')]);_0x14a41e[_0x0b09('0x2f')]=_['keys'](_0x175857[_0x0b09('0x2f')]);_0x14a41e[_0x0b09('0x30')]=_[_0x0b09('0x31')](_0x14a41e[_0x0b09('0x2e')],_0x14a41e[_0x0b09('0x2f')]);_0x16baca[_0x0b09('0x33')]=_[_0x0b09('0x31')](_0x14a41e['model'],qs[_0x0b09('0x32')](_0x175857[_0x0b09('0x2f')][_0x0b09('0x32')]));_0x16baca[_0x0b09('0x33')]=_0x16baca['attributes'][_0x0b09('0x34')]?_0x16baca[_0x0b09('0x33')]:_0x14a41e[_0x0b09('0x2e')];if(_0x175857[_0x0b09('0x2f')][_0x0b09('0x3c')]){_0x16baca[_0x0b09('0x43')]=[{'all':!![]}];}_0x16baca=_['merge']({},_0x16baca,_0x175857[_0x0b09('0x44')]);return db['Trigger'][_0x0b09('0x45')](_0x16baca)['then'](handleEntityNotFound(_0x1fb1a3,null))[_0x0b09('0x22')](respondWithResult(_0x1fb1a3,null))['catch'](handleError(_0x1fb1a3,null));};exports[_0x0b09('0x46')]=function(_0x350a44,_0x540a26){return db[_0x0b09('0x2a')][_0x0b09('0x46')](_0x350a44[_0x0b09('0x47')],{})[_0x0b09('0x22')](function(_0x4de9aa){var _0x2e2633=_0x350a44[_0x0b09('0x48')][_0x0b09('0x49')]({'plain':!![]});if(!_0x2e2633)throw new Error(_0x0b09('0x4a'));if(_0x2e2633[_0x0b09('0x4b')]===_0x0b09('0x48')){var _0x519cd7=_0x4de9aa['get']({'plain':!![]});var _0x1e0cb3=_0x0b09('0x24');return db[_0x0b09('0x4c')]['find']({'where':{'name':_0x1e0cb3,'userProfileId':_0x2e2633[_0x0b09('0x4d')]},'raw':!![]})[_0x0b09('0x22')](function(_0xacb35){if(_0xacb35&&_0xacb35['autoAssociation']===0x0){return db[_0x0b09('0x4e')][_0x0b09('0x46')]({'name':_0x519cd7[_0x0b09('0x27')],'resourceId':_0x519cd7['id'],'type':_0xacb35[_0x0b09('0x27')],'sectionId':_0xacb35['id']},{})[_0x0b09('0x22')](function(){return _0x4de9aa;});}else{return _0x4de9aa;}})[_0x0b09('0x3e')](function(_0x10db9f){logger[_0x0b09('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10db9f);throw _0x10db9f;});}return _0x4de9aa;})[_0x0b09('0x22')](respondWithResult(_0x540a26,0xc9))[_0x0b09('0x3e')](handleError(_0x540a26,null));};exports[_0x0b09('0x4f')]=function(_0x55fb64,_0x425da2){if(_0x55fb64[_0x0b09('0x47')]['id']){delete _0x55fb64[_0x0b09('0x47')]['id'];}return db[_0x0b09('0x2a')][_0x0b09('0x45')]({'where':{'id':_0x55fb64['params']['id']}})['then'](handleEntityNotFound(_0x425da2,null))[_0x0b09('0x22')](saveUpdates(_0x55fb64[_0x0b09('0x47')],null))[_0x0b09('0x22')](respondWithResult(_0x425da2,null))[_0x0b09('0x3e')](handleError(_0x425da2,null));};exports['destroy']=function(_0x261670,_0x55f37e){return db['Trigger'][_0x0b09('0x45')]({'where':{'id':_0x261670[_0x0b09('0x40')]['id']}})[_0x0b09('0x22')](handleEntityNotFound(_0x55f37e,null))['then'](removeEntity(_0x55f37e,null))['catch'](handleError(_0x55f37e,null));};exports['addAllCondition']=function(_0x795c38,_0x3366dc,_0xb5a62){if(_0x795c38['body']['id']){delete _0x795c38[_0x0b09('0x47')]['id'];}return db[_0x0b09('0x2a')]['find']({'where':{'id':_0x795c38[_0x0b09('0x40')]['id']}})[_0x0b09('0x22')](handleEntityNotFound(_0x3366dc,null))['then'](function(_0x385ec5){if(_0x385ec5){_0x795c38['body'][_0x0b09('0x50')]=_0x385ec5['id'];return db[_0x0b09('0x51')]['create'](_0x795c38[_0x0b09('0x47')]);}})['then'](respondWithResult(_0x3366dc,null))[_0x0b09('0x3e')](handleError(_0x3366dc,null));};exports[_0x0b09('0x52')]=function(_0x505442,_0x959bf5,_0x96be6b){if(_0x505442[_0x0b09('0x47')]['id']){delete _0x505442['body']['id'];}return db['Trigger'][_0x0b09('0x45')]({'where':{'id':_0x505442['params']['id']}})['then'](handleEntityNotFound(_0x959bf5,null))[_0x0b09('0x22')](function(_0x49749a){if(_0x49749a){_0x505442[_0x0b09('0x47')][_0x0b09('0x53')]=_0x49749a['id'];return db['Condition'][_0x0b09('0x46')](_0x505442[_0x0b09('0x47')]);}})['then'](respondWithResult(_0x959bf5,null))[_0x0b09('0x3e')](handleError(_0x959bf5,null));};exports[_0x0b09('0x54')]=function(_0xdb5633,_0x289f80,_0x37cbee){var _0x37b884={};var _0x3e5567={};var _0x709448;var _0x3bc819;return db[_0x0b09('0x2a')][_0x0b09('0x55')]({'where':{'id':_0xdb5633['params']['id']}})[_0x0b09('0x22')](handleEntityNotFound(_0x289f80,null))[_0x0b09('0x22')](function(_0x16ae41){if(_0x16ae41){_0x709448=_0x16ae41;_0x3e5567[_0x0b09('0x2e')]=_[_0x0b09('0x41')](db[_0x0b09('0x51')][_0x0b09('0x42')]);_0x3e5567['query']=_['keys'](_0xdb5633['query']);_0x3e5567[_0x0b09('0x30')]=_[_0x0b09('0x31')](_0x3e5567['model'],_0x3e5567[_0x0b09('0x2f')]);_0x37b884[_0x0b09('0x33')]=_[_0x0b09('0x31')](_0x3e5567[_0x0b09('0x2e')],qs[_0x0b09('0x32')](_0xdb5633['query']['fields']));_0x37b884[_0x0b09('0x33')]=_0x37b884[_0x0b09('0x33')]['length']?_0x37b884[_0x0b09('0x33')]:_0x3e5567[_0x0b09('0x2e')];_0x37b884[_0x0b09('0x56')]=qs['sort'](_0xdb5633[_0x0b09('0x2f')][_0x0b09('0x37')]);_0x37b884[_0x0b09('0x3a')]=qs['filters'](_[_0x0b09('0x38')](_0xdb5633[_0x0b09('0x2f')],_0x3e5567[_0x0b09('0x30')]));if(_0xdb5633[_0x0b09('0x2f')][_0x0b09('0x39')]){_0x37b884[_0x0b09('0x3a')]=_['merge'](_0x37b884[_0x0b09('0x3a')],{'$or':_[_0x0b09('0x29')](_0x37b884[_0x0b09('0x33')],function(_0x575daf){var _0x3e2144={};_0x3e2144[_0x575daf]={'$like':'%'+_0xdb5633['query'][_0x0b09('0x39')]+'%'};return _0x3e2144;})});}_0x37b884=_[_0x0b09('0x3b')]({},_0x37b884,_0xdb5633[_0x0b09('0x44')]);return _0x709448[_0x0b09('0x54')](_0x37b884);}})[_0x0b09('0x22')](function(_0xca14a4){if(_0xca14a4){_0x3bc819=_0xca14a4['length'];if(!_0xdb5633['query'][_0x0b09('0x35')]('nolimit')){_0x37b884[_0x0b09('0x1c')]=qs[_0x0b09('0x1c')](_0xdb5633[_0x0b09('0x2f')][_0x0b09('0x1c')]);_0x37b884[_0x0b09('0x1b')]=qs['offset'](_0xdb5633[_0x0b09('0x2f')][_0x0b09('0x1b')]);}return _0x709448['getAllConditions'](_0x37b884);}})[_0x0b09('0x22')](function(_0x5e2711){if(_0x5e2711){return _0x5e2711?{'count':_0x3bc819,'rows':_0x5e2711}:null;}})[_0x0b09('0x22')](respondWithResult(_0x289f80,null))[_0x0b09('0x3e')](handleError(_0x289f80,null));};exports[_0x0b09('0x57')]=function(_0x39bc00,_0x3fc0d2,_0x2c8255){var _0x24173f={};var _0x5b1423={};var _0x53759a;var _0x2283b2;return db['Trigger']['findOne']({'where':{'id':_0x39bc00['params']['id']}})[_0x0b09('0x22')](handleEntityNotFound(_0x3fc0d2,null))[_0x0b09('0x22')](function(_0x1c69c0){if(_0x1c69c0){_0x53759a=_0x1c69c0;_0x5b1423['model']=_[_0x0b09('0x41')](db[_0x0b09('0x51')]['rawAttributes']);_0x5b1423[_0x0b09('0x2f')]=_[_0x0b09('0x41')](_0x39bc00['query']);_0x5b1423[_0x0b09('0x30')]=_[_0x0b09('0x31')](_0x5b1423[_0x0b09('0x2e')],_0x5b1423[_0x0b09('0x2f')]);_0x24173f[_0x0b09('0x33')]=_[_0x0b09('0x31')](_0x5b1423[_0x0b09('0x2e')],qs[_0x0b09('0x32')](_0x39bc00[_0x0b09('0x2f')]['fields']));_0x24173f[_0x0b09('0x33')]=_0x24173f['attributes'][_0x0b09('0x34')]?_0x24173f[_0x0b09('0x33')]:_0x5b1423[_0x0b09('0x2e')];_0x24173f['order']=qs[_0x0b09('0x37')](_0x39bc00['query'][_0x0b09('0x37')]);_0x24173f[_0x0b09('0x3a')]=qs['filters'](_[_0x0b09('0x38')](_0x39bc00['query'],_0x5b1423['filters']));if(_0x39bc00[_0x0b09('0x2f')][_0x0b09('0x39')]){_0x24173f[_0x0b09('0x3a')]=_[_0x0b09('0x3b')](_0x24173f['where'],{'$or':_['map'](_0x24173f[_0x0b09('0x33')],function(_0xe56fe9){var _0xe340b7={};_0xe340b7[_0xe56fe9]={'$like':'%'+_0x39bc00[_0x0b09('0x2f')][_0x0b09('0x39')]+'%'};return _0xe340b7;})});}_0x24173f=_['merge']({},_0x24173f,_0x39bc00[_0x0b09('0x44')]);return _0x53759a[_0x0b09('0x57')](_0x24173f);}})[_0x0b09('0x22')](function(_0x20d8c6){if(_0x20d8c6){_0x2283b2=_0x20d8c6[_0x0b09('0x34')];if(!_0x39bc00[_0x0b09('0x2f')]['hasOwnProperty'](_0x0b09('0x36'))){_0x24173f[_0x0b09('0x1c')]=qs[_0x0b09('0x1c')](_0x39bc00['query'][_0x0b09('0x1c')]);_0x24173f[_0x0b09('0x1b')]=qs[_0x0b09('0x1b')](_0x39bc00[_0x0b09('0x2f')][_0x0b09('0x1b')]);}return _0x53759a['getAnyConditions'](_0x24173f);}})[_0x0b09('0x22')](function(_0xdd62b8){if(_0xdd62b8){return _0xdd62b8?{'count':_0x2283b2,'rows':_0xdd62b8}:null;}})[_0x0b09('0x22')](respondWithResult(_0x3fc0d2,null))[_0x0b09('0x3e')](handleError(_0x3fc0d2,null));};exports[_0x0b09('0x58')]=function(_0x55c39e,_0x28e29d,_0x1b4f89){if(_0x55c39e[_0x0b09('0x47')]['id']){delete _0x55c39e[_0x0b09('0x47')]['id'];}return db[_0x0b09('0x2a')][_0x0b09('0x45')]({'where':{'id':_0x55c39e[_0x0b09('0x40')]['id']}})[_0x0b09('0x22')](handleEntityNotFound(_0x28e29d,null))[_0x0b09('0x22')](function(_0xc43976){if(_0xc43976){_0x55c39e['body'][_0x0b09('0x59')]=_0xc43976['id'];return db[_0x0b09('0x5a')]['create'](_0x55c39e[_0x0b09('0x47')]);}})[_0x0b09('0x22')](respondWithResult(_0x28e29d,null))[_0x0b09('0x3e')](handleError(_0x28e29d,null));};exports[_0x0b09('0x5b')]=function(_0x28b1e3,_0x4d661a,_0x42e97a){var _0x5be372={};var _0x5ebb6b={};var _0x4d38ad;var _0x3c3d91;return db[_0x0b09('0x2a')]['findOne']({'where':{'id':_0x28b1e3[_0x0b09('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d661a,null))[_0x0b09('0x22')](function(_0x5d447d){if(_0x5d447d){_0x4d38ad=_0x5d447d;_0x5ebb6b[_0x0b09('0x2e')]=_[_0x0b09('0x41')](db[_0x0b09('0x5a')][_0x0b09('0x42')]);_0x5ebb6b[_0x0b09('0x2f')]=_[_0x0b09('0x41')](_0x28b1e3[_0x0b09('0x2f')]);_0x5ebb6b[_0x0b09('0x30')]=_[_0x0b09('0x31')](_0x5ebb6b[_0x0b09('0x2e')],_0x5ebb6b[_0x0b09('0x2f')]);_0x5be372[_0x0b09('0x33')]=_[_0x0b09('0x31')](_0x5ebb6b[_0x0b09('0x2e')],qs['fields'](_0x28b1e3[_0x0b09('0x2f')][_0x0b09('0x32')]));_0x5be372['attributes']=_0x5be372[_0x0b09('0x33')][_0x0b09('0x34')]?_0x5be372[_0x0b09('0x33')]:_0x5ebb6b[_0x0b09('0x2e')];_0x5be372[_0x0b09('0x56')]=qs[_0x0b09('0x37')](_0x28b1e3[_0x0b09('0x2f')][_0x0b09('0x37')]);_0x5be372[_0x0b09('0x3a')]=qs[_0x0b09('0x30')](_[_0x0b09('0x38')](_0x28b1e3[_0x0b09('0x2f')],_0x5ebb6b['filters']));if(_0x28b1e3[_0x0b09('0x2f')][_0x0b09('0x39')]){_0x5be372[_0x0b09('0x3a')]=_['merge'](_0x5be372[_0x0b09('0x3a')],{'$or':_[_0x0b09('0x29')](_0x5be372[_0x0b09('0x33')],function(_0x26c990){var _0x1b6b96={};_0x1b6b96[_0x26c990]={'$like':'%'+_0x28b1e3['query']['filter']+'%'};return _0x1b6b96;})});}_0x5be372=_[_0x0b09('0x3b')]({},_0x5be372,_0x28b1e3[_0x0b09('0x44')]);return _0x4d38ad[_0x0b09('0x5b')](_0x5be372);}})[_0x0b09('0x22')](function(_0x1b0f2b){if(_0x1b0f2b){_0x3c3d91=_0x1b0f2b[_0x0b09('0x34')];if(!_0x28b1e3[_0x0b09('0x2f')][_0x0b09('0x35')](_0x0b09('0x36'))){_0x5be372[_0x0b09('0x1c')]=qs[_0x0b09('0x1c')](_0x28b1e3['query'][_0x0b09('0x1c')]);_0x5be372[_0x0b09('0x1b')]=qs[_0x0b09('0x1b')](_0x28b1e3[_0x0b09('0x2f')][_0x0b09('0x1b')]);}return _0x4d38ad['getActions'](_0x5be372);}})['then'](function(_0x542302){if(_0x542302){return _0x542302?{'count':_0x3c3d91,'rows':_0x542302}:null;}})[_0x0b09('0x22')](respondWithResult(_0x4d661a,null))[_0x0b09('0x3e')](handleError(_0x4d661a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 74d2e42..146e7df 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util'];(function(_0x3ed430,_0x5fafab){var _0xae4a10=function(_0x53105d){while(--_0x53105d){_0x3ed430['push'](_0x3ed430['shift']());}};_0xae4a10(++_0x5fafab);}(_0x7a54,0x106));var _0x47a5=function(_0xb0b535,_0x25a2d0){_0xb0b535=_0xb0b535-0x0;var _0x168233=_0x7a54[_0xb0b535];return _0x168233;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./trigger.attributes'];(function(_0x437a20,_0x218d35){var _0x26706c=function(_0x4f73bd){while(--_0x4f73bd){_0x437a20['push'](_0x437a20['shift']());}};_0x26706c(++_0x218d35);}(_0x2ef3,0xba));var _0x32ef=function(_0xa5f7b2,_0x192c9c){_0xa5f7b2=_0xa5f7b2-0x0;var _0x413f8b=_0x2ef3[_0xa5f7b2];return _0x413f8b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 341ca6e..7c48f80 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 _0xf7b4=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrigger','find','ShowTrigger','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5e3dd7,_0x3e39be){var _0x570cf4=function(_0x2ed895){while(--_0x2ed895){_0x5e3dd7['push'](_0x5e3dd7['shift']());}};_0x570cf4(++_0x3e39be);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1088dd,_0x497614){_0x1088dd=_0x1088dd-0x0;var _0x3fc2b6=_0xf7b4[_0x1088dd];return _0x3fc2b6;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('Trigger,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('Trigger,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['GetTrigger']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')]({'raw':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'limit':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1b')]||null:null,'include':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x24e5cf[_0x4f7b('0x17')]['include'],function(_0x150f57){return{'model':db[_0x150f57[_0x4f7b('0x1e')]],'as':_0x150f57['as'],'attributes':_0x150f57['attributes'],'include':_0x150f57[_0x4f7b('0x1c')]?_['map'](_0x150f57[_0x4f7b('0x1c')],function(_0x2429be){return{'model':db[_0x2429be[_0x4f7b('0x1e')]],'as':_0x2429be['as'],'attributes':_0x2429be[_0x4f7b('0x1a')],'include':_0x2429be[_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x2429be[_0x4f7b('0x1c')],function(_0x3ad769){return{'model':db[_0x3ad769['model']],'as':_0x3ad769['as'],'attributes':_0x3ad769[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x311675){logger['info'](_0x4f7b('0x20'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x20'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x311675));_0x519d90(_0x311675);})[_0x4f7b('0x14')](function(_0x4ebffa){logger[_0x4f7b('0x10')](_0x4f7b('0x20'),_0x4ebffa[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da['error'](0x1f4,_0x4ebffa[_0x4f7b('0x12')]));});});};exports['ShowTrigger']=function(_0x4e4828){var _0x1a2346=this;return new Promise(function(_0x52a5b1,_0x1aad4b){return db[_0x4f7b('0x15')][_0x4f7b('0x21')]({'raw':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'include':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')],function(_0x35f1ed){return{'model':db[_0x35f1ed[_0x4f7b('0x1e')]],'as':_0x35f1ed['as'],'attributes':_0x35f1ed[_0x4f7b('0x1a')],'include':_0x35f1ed[_0x4f7b('0x1c')]?_['map'](_0x35f1ed[_0x4f7b('0x1c')],function(_0x5127a2){return{'model':db[_0x5127a2[_0x4f7b('0x1e')]],'as':_0x5127a2['as'],'attributes':_0x5127a2[_0x4f7b('0x1a')],'include':_0x5127a2['include']?_[_0x4f7b('0x1d')](_0x5127a2[_0x4f7b('0x1c')],function(_0x1347b6){return{'model':db[_0x1347b6['model']],'as':_0x1347b6['as'],'attributes':_0x1347b6[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x446f6e){logger[_0x4f7b('0xb')](_0x4f7b('0x22'),_0x4e4828);logger[_0x4f7b('0xd')](_0x4f7b('0x22'),_0x4e4828,JSON['stringify'](_0x446f6e));_0x52a5b1(_0x446f6e);})[_0x4f7b('0x14')](function(_0x486187){logger[_0x4f7b('0x10')](_0x4f7b('0x22'),_0x486187[_0x4f7b('0x12')],_0x4e4828);_0x1aad4b(_0x1a2346['error'](0x1f4,_0x486187[_0x4f7b('0x12')]));});});}; \ No newline at end of file +var _0xd914=['raw','where','attributes','limit','include','map','model','then','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrigger','Trigger','options'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xd914,0x17f));var _0x4d91=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xd914[_0x7feb90];return _0x3c5b33;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});}exports[_0x4d91('0x16')]=function(_0x44b9a7){var _0x4cfa40=this;return new Promise(function(_0x350e23,_0x3b579b){return db[_0x4d91('0x17')]['findAll']({'raw':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x19')]===undefined?!![]:![]:!![],'where':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1a')]||null:null,'attributes':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1b')]||null:null,'limit':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7['options'][_0x4d91('0x1c')]||null:null,'include':_0x44b9a7['options']?_0x44b9a7['options'][_0x4d91('0x1d')]?_[_0x4d91('0x1e')](_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1d')],function(_0x7d8cbf){return{'model':db[_0x7d8cbf[_0x4d91('0x1f')]],'as':_0x7d8cbf['as'],'attributes':_0x7d8cbf[_0x4d91('0x1b')],'include':_0x7d8cbf[_0x4d91('0x1d')]?_['map'](_0x7d8cbf['include'],function(_0x1ee6b3){return{'model':db[_0x1ee6b3[_0x4d91('0x1f')]],'as':_0x1ee6b3['as'],'attributes':_0x1ee6b3[_0x4d91('0x1b')],'include':_0x1ee6b3[_0x4d91('0x1d')]?_[_0x4d91('0x1e')](_0x1ee6b3[_0x4d91('0x1d')],function(_0x14bdb4){return{'model':db[_0x14bdb4['model']],'as':_0x14bdb4['as'],'attributes':_0x14bdb4[_0x4d91('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d91('0x20')](function(_0x12ac74){logger['info']('GetTrigger',_0x44b9a7);logger[_0x4d91('0xf')](_0x4d91('0x16'),_0x44b9a7,JSON['stringify'](_0x12ac74));_0x350e23(_0x12ac74);})['catch'](function(_0x42d5a0){logger[_0x4d91('0x11')](_0x4d91('0x16'),_0x42d5a0[_0x4d91('0x13')],_0x44b9a7);_0x3b579b(_0x4cfa40['error'](0x1f4,_0x42d5a0[_0x4d91('0x13')]));});});};exports[_0x4d91('0x21')]=function(_0x468e95){var _0xee7535=this;return new Promise(function(_0xa63422,_0x3466f3){return db[_0x4d91('0x17')]['find']({'raw':_0x468e95[_0x4d91('0x18')]?_0x468e95['options']['raw']===undefined?!![]:![]:!![],'where':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')]['where']||null:null,'attributes':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')][_0x4d91('0x1b')]||null:null,'include':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')]['include']?_[_0x4d91('0x1e')](_0x468e95[_0x4d91('0x18')][_0x4d91('0x1d')],function(_0x2b8131){return{'model':db[_0x2b8131[_0x4d91('0x1f')]],'as':_0x2b8131['as'],'attributes':_0x2b8131[_0x4d91('0x1b')],'include':_0x2b8131['include']?_[_0x4d91('0x1e')](_0x2b8131[_0x4d91('0x1d')],function(_0x5c2247){return{'model':db[_0x5c2247[_0x4d91('0x1f')]],'as':_0x5c2247['as'],'attributes':_0x5c2247[_0x4d91('0x1b')],'include':_0x5c2247[_0x4d91('0x1d')]?_['map'](_0x5c2247[_0x4d91('0x1d')],function(_0x2c8b54){return{'model':db[_0x2c8b54[_0x4d91('0x1f')]],'as':_0x2c8b54['as'],'attributes':_0x2c8b54[_0x4d91('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x64cee3){logger[_0x4d91('0xc')](_0x4d91('0x21'),_0x468e95);logger[_0x4d91('0xf')]('ShowTrigger',_0x468e95,JSON['stringify'](_0x64cee3));_0xa63422(_0x64cee3);})[_0x4d91('0x15')](function(_0x3dac76){logger['error'](_0x4d91('0x21'),_0x3dac76[_0x4d91('0x13')],_0x468e95);_0x3466f3(_0xee7535[_0x4d91('0x11')](0x1f4,_0x3dac76[_0x4d91('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a938457..306fb98 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 _0xed1f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','clone','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xed1f,0x6a));var _0xfed1=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xed1f[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var auth=require(_0xfed1('0x6'));var interaction=require(_0xfed1('0x7'));var config=require(_0xfed1('0x8'));var controller=require(_0xfed1('0x9'));router[_0xfed1('0xa')]('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0xc')]);router[_0xfed1('0xa')](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/:id/clone',auth[_0xfed1('0xb')](),controller[_0xfed1('0x10')]);router['post']('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0x11')]);router['put'](_0xfed1('0xd'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);router[_0xfed1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfed1('0x14')]);module[_0xfed1('0x15')]=router; \ No newline at end of file +var _0x33c5=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','util'];(function(_0x523ec1,_0x1cdeb0){var _0x15a70b=function(_0x32af8e){while(--_0x32af8e){_0x523ec1['push'](_0x523ec1['shift']());}};_0x15a70b(++_0x1cdeb0);}(_0x33c5,0xe6));var _0x533c=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x33c5[_0x21a2b3];return _0x4651a7;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var auth=require(_0x533c('0x4'));var interaction=require(_0x533c('0x5'));var config=require(_0x533c('0x6'));var controller=require('./trunk.controller');router[_0x533c('0x7')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x9')]);router[_0x533c('0x7')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')](_0x533c('0xd'),auth[_0x533c('0x8')](),controller[_0x533c('0xe')]);router[_0x533c('0xc')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0xa'),auth['isAuthenticated'](),controller[_0x533c('0x11')]);router[_0x533c('0x12')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0x13')]);module[_0x533c('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index d8f3cd8..ec470ae 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 _0xb678=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','certificate','passive','actpass','dynamic','nonat','update,nonat','sequelize','exports','STRING','ENUM','friend','user'];(function(_0x5bc69d,_0x25137d){var _0x154d9c=function(_0x10a8b0){while(--_0x10a8b0){_0x5bc69d['push'](_0x5bc69d['shift']());}};_0x154d9c(++_0x25137d);}(_0xb678,0x1ee));var _0x8b67=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb678[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x8b67('0x0'));module[_0x8b67('0x1')]={'name':{'type':Sequelize[_0x8b67('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x4'),_0x8b67('0x5'),'peer'),'allowNull':![],'defaultValue':_0x8b67('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8b67('0x3')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x8b67('0x6'),_0x8b67('0x7'),_0x8b67('0x8'),_0x8b67('0x9'),'PROHIB')},'deny':{'type':Sequelize[_0x8b67('0x2')]},'permit':{'type':Sequelize[_0x8b67('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x8b67('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':_0x8b67('0xa'),'set':function(_0x30926f){this[_0x8b67('0xb')](_0x8b67('0xc'),_0x30926f?_0x30926f[_0x8b67('0xd')](','):null);},'get':function(){return this[_0x8b67('0xe')](_0x8b67('0xc'))?this[_0x8b67('0xe')](_0x8b67('0xc'))['split'](','):null;},'comment':_0x8b67('0xf')},'dtmfmode':{'type':Sequelize['ENUM'](_0x8b67('0x10'),_0x8b67('0x11'),_0x8b67('0x12'),_0x8b67('0x13'),_0x8b67('0x14')),'defaultValue':_0x8b67('0x10')},'directmedia':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no','nonat',_0x8b67('0x16'),_0x8b67('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8b67('0x2')]},'directmediadeny':{'type':Sequelize[_0x8b67('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x8b67('0x18'),'set':function(_0x5ebb81){this[_0x8b67('0xb')]('nat',_0x5ebb81?_0x5ebb81['join'](','):null);},'get':function(){return this[_0x8b67('0xe')](_0x8b67('0x19'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x8b67('0x1a')},'callgroup':{'type':Sequelize[_0x8b67('0x2')]},'namedcallgroup':{'type':Sequelize[_0x8b67('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x8b67('0x2')]},'language':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8b67('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':_0x8b67('0x1b')},'allow':{'type':Sequelize[_0x8b67('0x2')],'allowNull':![],'defaultValue':_0x8b67('0x1c'),'set':function(_0x3f128a){this[_0x8b67('0xb')](_0x8b67('0x1d'),_0x3f128a?_0x3f128a[_0x8b67('0xd')](';'):_0x8b67('0x1c'));},'get':function(){return this[_0x8b67('0xe')](_0x8b67('0x1d'))?this[_0x8b67('0xe')](_0x8b67('0x1d'))[_0x8b67('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8b67('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':_0x8b67('0x1f'),'set':function(_0xc841ba){this['setDataValue']('insecure',_0xc841ba?_0xc841ba[_0x8b67('0xd')](','):null);},'get':function(){return this[_0x8b67('0xe')](_0x8b67('0x20'))?this[_0x8b67('0xe')]('insecure')[_0x8b67('0x1e')](','):null;},'comment':_0x8b67('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8b67('0x3')]('yes','no',_0x8b67('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no')},'accountcode':{'type':Sequelize[_0x8b67('0x23')](0xb)},'setvar':{'type':Sequelize[_0x8b67('0x2')]},'callerid':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':_0x8b67('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no'),'defaultValue':_0x8b67('0x15')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8b67('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x8b67('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no',_0x8b67('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8b67('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'mailbox':{'type':Sequelize[_0x8b67('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x8b67('0x26'),_0x8b67('0x27'),_0x8b67('0x28'))},'session_expires':{'type':Sequelize[_0x8b67('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x8b67('0x3')]('uac',_0x8b67('0x29')),'defaultValue':_0x8b67('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x8b67('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x8b67('0x2')]},'fromuser':{'type':Sequelize[_0x8b67('0x2')]},'port':{'type':Sequelize[_0x8b67('0x23')](0x5)},'qualify':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x8b67('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x8b67('0x2')]},'defaultuser':{'type':Sequelize[_0x8b67('0x2')]},'rtptimeout':{'type':Sequelize[_0x8b67('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8b67('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no',_0x8b67('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8b67('0x2')]},'callbackextension':{'type':Sequelize[_0x8b67('0x2')]},'timert1':{'type':Sequelize[_0x8b67('0x23')](0xb)},'timerb':{'type':Sequelize[_0x8b67('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8b67('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x8b67('0x2')]},'contactdeny':{'type':Sequelize[_0x8b67('0x2')]},'contactacl':{'type':Sequelize[_0x8b67('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x8b67('0x2')]},'maxforwards':{'type':Sequelize[_0x8b67('0x23')](0xb)},'encryption':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no')},'icesupport':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x8b67('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x8b67('0x3')]('yes','no',_0x8b67('0x2b'),_0x8b67('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x8b67('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x8b67('0x2')]},'dtlscipher':{'type':Sequelize[_0x8b67('0x2')]},'dtlscafile':{'type':Sequelize[_0x8b67('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8b67('0x3')]('active',_0x8b67('0x2d'),_0x8b67('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8b67('0x2')]},'recordofffeature':{'type':Sequelize[_0x8b67('0x2')]},'call_limit':{'type':Sequelize[_0x8b67('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x8b67('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no')},'vmexten':{'type':Sequelize[_0x8b67('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x8b67('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b67('0x2')]},'host':{'type':Sequelize[_0x8b67('0x2')],'defaultValue':_0x8b67('0x2f')},'canreinvite':{'type':Sequelize[_0x8b67('0x3')](_0x8b67('0x15'),'no',_0x8b67('0x30'),_0x8b67('0x16'),_0x8b67('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8b67('0x2')]},'otherFields':{'type':Sequelize[_0x8b67('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xd7bc=['PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','ENUM','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','BOOLEAN','sequelize','STRING','name','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0xd7bc,0x102));var _0xcd7b=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0xd7bc[_0x3ec122];return _0x4ecf41;};'use strict';var Sequelize=require(_0xcd7b('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd7b('0x1')],'allowNull':![],'unique':_0xcd7b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xcd7b('0x3'),_0xcd7b('0x4'),_0xcd7b('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xcd7b('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xcd7b('0x6'),_0xcd7b('0x7'),_0xcd7b('0x8'),_0xcd7b('0x9'),_0xcd7b('0xa'),_0xcd7b('0xb'),_0xcd7b('0xc'),_0xcd7b('0xd'))},'deny':{'type':Sequelize[_0xcd7b('0x1')]},'permit':{'type':Sequelize[_0xcd7b('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xcd7b('0x1')]},'remotesecret':{'type':Sequelize[_0xcd7b('0x1')]},'transport':{'type':Sequelize[_0xcd7b('0x1')],'defaultValue':_0xcd7b('0xe'),'set':function(_0x4c135d){this[_0xcd7b('0xf')](_0xcd7b('0x10'),_0x4c135d?_0x4c135d[_0xcd7b('0x11')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xcd7b('0x12')](_0xcd7b('0x10'))[_0xcd7b('0x13')](','):null;},'comment':_0xcd7b('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0xcd7b('0x15'),_0xcd7b('0x16'),_0xcd7b('0x17'),_0xcd7b('0x18'),_0xcd7b('0x19')),'defaultValue':_0xcd7b('0x15')},'directmedia':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no',_0xcd7b('0x1c'),_0xcd7b('0x1d'),_0xcd7b('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcd7b('0x1')]},'directmediadeny':{'type':Sequelize[_0xcd7b('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xcd7b('0x1f'),'set':function(_0x4b2a2b){this['setDataValue'](_0xcd7b('0x20'),_0x4b2a2b?_0x4b2a2b[_0xcd7b('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xcd7b('0x20'))?this[_0xcd7b('0x12')]('nat')[_0xcd7b('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xcd7b('0x1')]},'namedcallgroup':{'type':Sequelize[_0xcd7b('0x1')]},'pickupgroup':{'type':Sequelize[_0xcd7b('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xcd7b('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcd7b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xcd7b('0x1')],'defaultValue':_0xcd7b('0x21')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x23f906){this[_0xcd7b('0xf')]('allow',_0x23f906?_0x23f906[_0xcd7b('0x11')](';'):_0xcd7b('0x22'));},'get':function(){return this[_0xcd7b('0x12')](_0xcd7b('0x23'))?this['getDataValue']('allow')[_0xcd7b('0x13')](';'):null;},'comment':_0xcd7b('0x24')},'autoframing':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x3d18e0){this[_0xcd7b('0xf')](_0xcd7b('0x25'),_0x3d18e0?_0x3d18e0[_0xcd7b('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xcd7b('0x25'))?this[_0xcd7b('0x12')](_0xcd7b('0x25'))[_0xcd7b('0x13')](','):null;},'comment':_0xcd7b('0x26')},'trustrpid':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no',_0xcd7b('0x27'))},'promiscredir':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'setvar':{'type':Sequelize[_0xcd7b('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xcd7b('0x29')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no'),'defaultValue':_0xcd7b('0x1b')},'busylevel':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0xcd7b('0x1a')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xcd7b('0x1')]},'template':{'type':Sequelize[_0xcd7b('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no',_0xcd7b('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'mailbox':{'type':Sequelize[_0xcd7b('0x1')]},'session_timers':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x2b'),_0xcd7b('0x2c'),'originate')},'session_expires':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'session_minse':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x2d'),_0xcd7b('0x2e')),'defaultValue':_0xcd7b('0x2e')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xcd7b('0x1')]},'fromdomain':{'type':Sequelize[_0xcd7b('0x1')]},'fromuser':{'type':Sequelize[_0xcd7b('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no'),'defaultValue':_0xcd7b('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xcd7b('0x1')]},'defaultuser':{'type':Sequelize[_0xcd7b('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no',_0xcd7b('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcd7b('0x1')]},'callbackextension':{'type':Sequelize[_0xcd7b('0x1')]},'timert1':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'timerb':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0xcd7b('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xcd7b('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xcd7b('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'force_avp':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xcd7b('0x1a')]('yes','no',_0xcd7b('0x30'),_0xcd7b('0x31'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xcd7b('0x1')]},'dtlssetup':{'type':Sequelize[_0xcd7b('0x1a')]('active',_0xcd7b('0x32'),_0xcd7b('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcd7b('0x1')]},'usereqphone':{'type':Sequelize[_0xcd7b('0x1a')](_0xcd7b('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xcd7b('0x1a')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xcd7b('0x1a')]('yes','no')},'vmexten':{'type':Sequelize[_0xcd7b('0x1')]},'mohinterpret':{'type':Sequelize[_0xcd7b('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xcd7b('0x1')]},'description':{'type':Sequelize[_0xcd7b('0x1')]},'host':{'type':Sequelize[_0xcd7b('0x1')],'defaultValue':_0xcd7b('0x34')},'canreinvite':{'type':Sequelize['ENUM'](_0xcd7b('0x1b'),'no',_0xcd7b('0x1c'),_0xcd7b('0x1d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xcd7b('0x1')]},'otherFields':{'type':Sequelize[_0xcd7b('0x1')]},'active':{'type':Sequelize[_0xcd7b('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xcd7b('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 8d9431b..8b36ef4 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 _0x6947=['Reload','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','ValidationError','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','include','rows','params','options','find','clone','get','createdAt','updatedAt','body','omit','user','role','create','findAll','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x6947,0x72));var _0x7694=function(_0x1fa57e,_0x19c2f3){_0x1fa57e=_0x1fa57e-0x0;var _0x1111c6=_0x6947[_0x1fa57e];return _0x1111c6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7694('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7694('0x1'));var jsonpatch=require(_0x7694('0x2'));var rp=require(_0x7694('0x3'));var moment=require(_0x7694('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7694('0x5'));var path=require(_0x7694('0x6'));var sox=require(_0x7694('0x7'));var csv=require(_0x7694('0x8'));var ejs=require(_0x7694('0x9'));var fs=require('fs');var _=require(_0x7694('0xa'));var squel=require('squel');var crypto=require(_0x7694('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7694('0xc'));var toCsv=require(_0x7694('0x8'));var querystring=require('querystring');var Papa=require(_0x7694('0xd'));var Redis=require(_0x7694('0xe'));var authService=require(_0x7694('0xf'));var qs=require(_0x7694('0x10'));var as=require(_0x7694('0x11'));var hardwareService=require(_0x7694('0x12'));var logger=require(_0x7694('0x13'))('api');var utils=require(_0x7694('0x14'));var config=require(_0x7694('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7694('0x16'));var client=jayson[_0x7694('0x17')][_0x7694('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4c3341,_0x5f4904,_0x3d285d){if(_0x3d285d){var _0x46612b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46612b[_0x7694('0x19')](_0x5f4904)){return _0x4c3341;}else{throw new db['Sequelize'][(_0x7694('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 _0x4c3341;}}function respondWithRpcPromise(_0x3b46e6,_0x1e7706,_0x1bec84,_0x306c31){return new BPromise(function(_0x4298a2,_0x550c85){var _0x23432d=_0x306c31||client;return _0x23432d[_0x7694('0x1b')](_0x3b46e6,_0x1bec84)[_0x7694('0x1c')](function(_0xc7c0b4){logger['info'](_0x7694('0x1d'),_0x1e7706,_0x7694('0x1e'));logger[_0x7694('0x1f')](_0x7694('0x20'),_0x1e7706,_0x7694('0x1e'),JSON[_0x7694('0x21')](_0xc7c0b4));if(_0xc7c0b4['error']){if(_0xc7c0b4[_0x7694('0x22')]['code']===0x1f4){logger[_0x7694('0x22')](_0x7694('0x1d'),_0x1e7706,_0xc7c0b4[_0x7694('0x22')][_0x7694('0x23')]);return _0x550c85(_0xc7c0b4[_0x7694('0x22')]['message']);}logger[_0x7694('0x22')](_0x7694('0x1d'),_0x1e7706,_0xc7c0b4[_0x7694('0x22')][_0x7694('0x23')]);return _0x4298a2(_0xc7c0b4[_0x7694('0x22')]['message']);}else{logger[_0x7694('0x24')](_0x7694('0x1d'),_0x1e7706,_0x7694('0x1e'));_0x4298a2(_0xc7c0b4[_0x7694('0x25')]['message']);}})[_0x7694('0x26')](function(_0x51ce21){logger[_0x7694('0x22')]('Trunk,\x20%s,\x20%s',_0x1e7706,_0x51ce21);_0x550c85(_0x51ce21);});});}function respondWithStatusCode(_0x2d77b7,_0x4fd5ff){_0x4fd5ff=_0x4fd5ff||0xcc;return function(_0xd3be74){if(_0xd3be74){return _0x2d77b7[_0x7694('0x27')](_0x4fd5ff);}return _0x2d77b7[_0x7694('0x28')](_0x4fd5ff)[_0x7694('0x29')]();};}function respondWithResult(_0x27269b,_0x350102){_0x350102=_0x350102||0xc8;return function(_0x285114){if(_0x285114){return _0x27269b['status'](_0x350102)[_0x7694('0x2a')](_0x285114);}};}function respondWithFilteredResult(_0x3c09fa,_0x2d4a79){return function(_0x3522ce){if(_0x3522ce){var _0x5c3e18=_0x3522ce['count'],_0x292553=_0x2d4a79[_0x7694('0x2b')],_0x374130=_0x2d4a79[_0x7694('0x2b')]+_0x2d4a79[_0x7694('0x2c')],_0x2facc7;if(_0x374130>=_0x5c3e18){_0x374130=_0x5c3e18;_0x2facc7=0xc8;}else{_0x2facc7=0xce;}_0x3c09fa['status'](_0x2facc7);return _0x3c09fa[_0x7694('0x2d')](_0x7694('0x2e'),_0x292553+'-'+_0x374130+'/'+_0x5c3e18)[_0x7694('0x2a')](_0x3522ce);}return null;};}function patchUpdates(_0x3eb1f2){return function(_0x241d47){try{jsonpatch[_0x7694('0x2f')](_0x241d47,_0x3eb1f2,!![]);}catch(_0x9b5fe0){return BPromise[_0x7694('0x30')](_0x9b5fe0);}return _0x241d47[_0x7694('0x31')]();};}function saveUpdates(_0x54d39e,_0xa6cf7d){return function(_0x37475a){if(_0x37475a){return _0x37475a[_0x7694('0x32')](_0x54d39e)[_0x7694('0x1c')](function(_0x4a5680){return _0x4a5680;});}return null;};}function removeEntity(_0x96b982,_0xa37b54){return function(_0x1fd736){if(_0x1fd736){return _0x1fd736[_0x7694('0x33')]()[_0x7694('0x1c')](function(){var _0x3529c9=_0x1fd736['get']({'plain':!![]});var _0x26e9a4=_0x7694('0x34');return db[_0x7694('0x35')][_0x7694('0x33')]({'where':{'type':_0x26e9a4,'resourceId':_0x3529c9['id']}})[_0x7694('0x1c')](function(){return _0x1fd736;});})[_0x7694('0x1c')](function(){_0x96b982[_0x7694('0x28')](0xcc)[_0x7694('0x29')]();});}};}function handleEntityNotFound(_0x270494,_0x4ad731){return function(_0x312424){if(!_0x312424){_0x270494['sendStatus'](0x194);}return _0x312424;};}function handleError(_0x3d3712,_0x13f8ed){_0x13f8ed=_0x13f8ed||0x1f4;return function(_0xb828b9){logger[_0x7694('0x22')](_0xb828b9[_0x7694('0x36')]);if(_0xb828b9[_0x7694('0x37')]){delete _0xb828b9[_0x7694('0x37')];}_0x3d3712[_0x7694('0x28')](_0x13f8ed)['send'](_0xb828b9);};}exports['index']=function(_0x3b0e0d,_0x8192ac){var _0x264781={},_0x5553c9={},_0x13794b={'count':0x0,'rows':[]};var _0x1b69e5=_[_0x7694('0x38')](db[_0x7694('0x39')][_0x7694('0x3a')],function(_0x3979d1){return{'name':_0x3979d1[_0x7694('0x3b')],'type':_0x3979d1[_0x7694('0x3c')][_0x7694('0x3d')]};});_0x5553c9[_0x7694('0x3e')]=_[_0x7694('0x38')](_0x1b69e5,_0x7694('0x37'));_0x5553c9[_0x7694('0x3f')]=_[_0x7694('0x40')](_0x3b0e0d[_0x7694('0x3f')]);_0x5553c9[_0x7694('0x41')]=_[_0x7694('0x42')](_0x5553c9[_0x7694('0x3e')],_0x5553c9[_0x7694('0x3f')]);_0x264781[_0x7694('0x43')]=_[_0x7694('0x42')](_0x5553c9['model'],qs['fields'](_0x3b0e0d[_0x7694('0x3f')][_0x7694('0x44')]));_0x264781[_0x7694('0x43')]=_0x264781['attributes'][_0x7694('0x45')]?_0x264781[_0x7694('0x43')]:_0x5553c9[_0x7694('0x3e')];if(!_0x3b0e0d['query']['hasOwnProperty'](_0x7694('0x46'))){_0x264781[_0x7694('0x2c')]=qs[_0x7694('0x2c')](_0x3b0e0d['query'][_0x7694('0x2c')]);_0x264781['offset']=qs[_0x7694('0x2b')](_0x3b0e0d[_0x7694('0x3f')][_0x7694('0x2b')]);}_0x264781[_0x7694('0x47')]=qs[_0x7694('0x48')](_0x3b0e0d[_0x7694('0x3f')][_0x7694('0x48')]);_0x264781['where']=qs[_0x7694('0x41')](_[_0x7694('0x49')](_0x3b0e0d[_0x7694('0x3f')],_0x5553c9[_0x7694('0x41')]),_0x1b69e5);if(_0x3b0e0d[_0x7694('0x3f')]['filter']){_0x264781[_0x7694('0x4a')]=_[_0x7694('0x4b')](_0x264781[_0x7694('0x4a')],{'$or':_[_0x7694('0x38')](_0x1b69e5,function(_0x439965){if(_0x439965[_0x7694('0x3c')]!==_0x7694('0x4c')){var _0x3329b6={};_0x3329b6[_0x439965['name']]={'$like':'%'+_0x3b0e0d[_0x7694('0x3f')][_0x7694('0x4d')]+'%'};return _0x3329b6;}})});}_0x264781=_['merge']({},_0x264781,_0x3b0e0d['options']);var _0x3afd93={'where':_0x264781['where']};return db[_0x7694('0x39')][_0x7694('0x4e')](_0x3afd93)[_0x7694('0x1c')](function(_0x15c4dd){_0x13794b[_0x7694('0x4e')]=_0x15c4dd;if(_0x3b0e0d[_0x7694('0x3f')][_0x7694('0x4f')]){_0x264781[_0x7694('0x50')]=[{'all':!![]}];}return db[_0x7694('0x39')]['findAll'](_0x264781);})[_0x7694('0x1c')](function(_0x20117d){_0x13794b[_0x7694('0x51')]=_0x20117d;return _0x13794b;})['then'](respondWithFilteredResult(_0x8192ac,_0x264781))[_0x7694('0x26')](handleError(_0x8192ac,null));};exports['show']=function(_0x3a776b,_0x51757a){var _0x5a597b={'raw':![],'where':{'id':_0x3a776b[_0x7694('0x52')]['id']}},_0x266c60={};_0x266c60[_0x7694('0x3e')]=_[_0x7694('0x40')](db[_0x7694('0x39')]['rawAttributes']);_0x266c60[_0x7694('0x3f')]=_[_0x7694('0x40')](_0x3a776b[_0x7694('0x3f')]);_0x266c60['filters']=_[_0x7694('0x42')](_0x266c60[_0x7694('0x3e')],_0x266c60[_0x7694('0x3f')]);_0x5a597b['attributes']=_[_0x7694('0x42')](_0x266c60[_0x7694('0x3e')],qs[_0x7694('0x44')](_0x3a776b[_0x7694('0x3f')][_0x7694('0x44')]));_0x5a597b[_0x7694('0x43')]=_0x5a597b['attributes'][_0x7694('0x45')]?_0x5a597b['attributes']:_0x266c60['model'];if(_0x3a776b[_0x7694('0x3f')][_0x7694('0x4f')]){_0x5a597b[_0x7694('0x50')]=[{'all':!![]}];}_0x5a597b=_[_0x7694('0x4b')]({},_0x5a597b,_0x3a776b[_0x7694('0x53')]);return db[_0x7694('0x39')][_0x7694('0x54')](_0x5a597b)[_0x7694('0x1c')](handleEntityNotFound(_0x51757a,null))[_0x7694('0x1c')](respondWithResult(_0x51757a,null))[_0x7694('0x26')](handleError(_0x51757a,null));};exports[_0x7694('0x55')]=function(_0x5feb64,_0xef40fa){var _0x3d98f4={'where':{'id':_0x5feb64[_0x7694('0x52')]['id']}},_0x17a552={};_0x17a552[_0x7694('0x3e')]=_[_0x7694('0x40')](db['Trunk'][_0x7694('0x3a')]);_0x3d98f4[_0x7694('0x43')]=_['intersection'](_0x17a552[_0x7694('0x3e')],qs[_0x7694('0x44')](_0x5feb64['query'][_0x7694('0x44')]));_0x3d98f4[_0x7694('0x43')]=_0x3d98f4['attributes'][_0x7694('0x45')]?_0x3d98f4[_0x7694('0x43')]:_0x17a552['model'];if(_0x5feb64[_0x7694('0x3f')][_0x7694('0x4f')]){_0x3d98f4[_0x7694('0x50')]=[{'all':!![]}];}_0x3d98f4=_['merge']({},_0x3d98f4,_0x5feb64[_0x7694('0x53')]);return db['Trunk'][_0x7694('0x54')](_0x3d98f4)[_0x7694('0x1c')](handleEntityNotFound(_0xef40fa,null))[_0x7694('0x1c')](function(_0x3cf3cf){if(_0x3cf3cf){var _0x565b46=_0x3cf3cf[_0x7694('0x56')]({'plain':!![]});_0x565b46=qs['omit'](_0x565b46,['id',_0x7694('0x57'),_0x7694('0x58')]);_0x5feb64[_0x7694('0x59')]=_[_0x7694('0x5a')](_0x5feb64[_0x7694('0x59')],['id',_0x7694('0x57'),_0x7694('0x58')]);return db[_0x7694('0x39')]['create'](_[_0x7694('0x4b')](_0x565b46,_0x5feb64[_0x7694('0x59')]),{'include':_0x5feb64['query'][_0x7694('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x26e6a5){var _0x14c859=_0x5feb64[_0x7694('0x5b')][_0x7694('0x56')]({'plain':!![]});if(!_0x14c859)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14c859[_0x7694('0x5c')]===_0x7694('0x5b')){var _0x548718=_0x26e6a5[_0x7694('0x56')]({'plain':!![]});var _0x556863='Trunks';return db['UserProfileSection'][_0x7694('0x54')]({'where':{'name':_0x556863,'userProfileId':_0x14c859['userProfileId']},'raw':!![]})[_0x7694('0x1c')](function(_0x2f72f6){if(_0x2f72f6&&_0x2f72f6['autoAssociation']===0x0){return db[_0x7694('0x35')][_0x7694('0x5d')]({'name':_0x548718[_0x7694('0x37')],'resourceId':_0x548718['id'],'type':_0x2f72f6['name'],'sectionId':_0x2f72f6['id']},{})['then'](function(){return _0x26e6a5;});}else{return _0x26e6a5;}})['catch'](function(_0x2706fa){logger[_0x7694('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2706fa);throw _0x2706fa;});}return _0x26e6a5;});}})[_0x7694('0x1c')](respondWithResult(_0xef40fa,0xc9))[_0x7694('0x26')](handleError(_0xef40fa,null));};exports[_0x7694('0x5d')]=function(_0x541573,_0x415991,_0x409766){var _0x3c53aa;return db[_0x7694('0x39')][_0x7694('0x5d')](_0x541573['body'],{'raw':!![]})[_0x7694('0x1c')](function(_0x10adce){_0x3c53aa=_0x10adce;return db['Trunk'][_0x7694('0x5e')]({'raw':!![]});})['then'](function(_0x1dd773){var _0x2678a1=fs['readFileSync'](path[_0x7694('0x5f')](config[_0x7694('0x60')],_0x7694('0x61')),_0x7694('0x62'));var _0x158540=fs[_0x7694('0x63')](path[_0x7694('0x5f')](config['root'],_0x7694('0x64')),_0x7694('0x62'));var _0x648ae6=ejs['render'](_0x2678a1,{'trunks':_0x1dd773||[]});fs[_0x7694('0x65')](_0x7694('0x66'),_0x648ae6);if(_0x3c53aa[_0x7694('0x67')]){var _0x47a860=ejs[_0x7694('0x68')](_0x158540,{'trunks':_0x1dd773||[]});fs[_0x7694('0x65')](_0x7694('0x69'),_0x47a860);}})[_0x7694('0x1c')](function(){return respondWithRpcPromise('Reload',_0x7694('0x5d'),{'module':_0x7694('0x6a')});})[_0x7694('0x1c')](function(){var _0x517b68=_0x541573[_0x7694('0x5b')]['get']({'plain':!![]});if(!_0x517b68)throw new Error(_0x7694('0x6b'));if(_0x517b68[_0x7694('0x5c')]==='user'){var _0x2cfc72=_0x3c53aa[_0x7694('0x56')]({'plain':!![]});return db[_0x7694('0x6c')][_0x7694('0x54')]({'where':{'name':'Trunks','userProfileId':_0x517b68[_0x7694('0x6d')]},'raw':!![]})[_0x7694('0x1c')](function(_0xb78d8c){if(_0xb78d8c&&_0xb78d8c[_0x7694('0x6e')]===0x0){return db[_0x7694('0x35')][_0x7694('0x5d')]({'name':_0x2cfc72[_0x7694('0x37')],'resourceId':_0x2cfc72['id'],'type':_0xb78d8c[_0x7694('0x37')],'sectionId':_0xb78d8c['id']},{})[_0x7694('0x1c')](function(){return _0x3c53aa;});}else{return _0x3c53aa;}})[_0x7694('0x26')](function(_0x5d8675){logger[_0x7694('0x22')](_0x7694('0x6f'),_0x5d8675);throw _0x5d8675;});}return _0x3c53aa;})[_0x7694('0x1c')](respondWithResult(_0x415991,0xc9))[_0x7694('0x26')](handleError(_0x415991,null));};exports['update']=function(_0x1051c2,_0x1ebd6a,_0x1f01bd){var _0xec5fd7;return db[_0x7694('0x39')][_0x7694('0x54')]({'where':{'id':_0x1051c2[_0x7694('0x52')]['id']}})[_0x7694('0x1c')](handleEntityNotFound(_0x1ebd6a,null))['then'](saveUpdates(_0x1051c2['body'],null))[_0x7694('0x1c')](function(_0x122acf){if(_0x122acf){_0xec5fd7=_0x122acf;return db[_0x7694('0x39')][_0x7694('0x5e')]({'raw':!![]});}})[_0x7694('0x1c')](function(_0x8a3013){if(_0x8a3013){var _0x403f87=fs[_0x7694('0x63')](path[_0x7694('0x5f')](config[_0x7694('0x60')],'server/files/templates/trunk.ejs'),_0x7694('0x62'));var _0x5b2c89=fs[_0x7694('0x63')](path['join'](config[_0x7694('0x60')],'server/files/templates/registry.ejs'),_0x7694('0x62'));var _0x29c2e4=ejs[_0x7694('0x68')](_0x403f87,{'trunks':_0x8a3013||[]});fs[_0x7694('0x65')](_0x7694('0x66'),_0x29c2e4);var _0x396d09=ejs[_0x7694('0x68')](_0x5b2c89,{'trunks':_0x8a3013||[]});fs['writeFileSync'](_0x7694('0x69'),_0x396d09);return respondWithRpcPromise(_0x7694('0x70'),_0x7694('0x32'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x36d1bf){if(_0x36d1bf){return _0xec5fd7;}})[_0x7694('0x1c')](respondWithResult(_0x1ebd6a,null))['catch'](handleError(_0x1ebd6a,null));};exports[_0x7694('0x33')]=function(_0x58d4d9,_0x2edd31,_0xb3ea78){var _0x19583f;return db[_0x7694('0x39')][_0x7694('0x54')]({'where':{'id':_0x58d4d9[_0x7694('0x52')]['id']}})[_0x7694('0x1c')](handleEntityNotFound(_0x2edd31,null))[_0x7694('0x1c')](removeEntity(_0x2edd31,null))[_0x7694('0x1c')](function(){return db['Trunk'][_0x7694('0x5e')]({'raw':!![]});})['then'](function(_0x4975a5){var _0x2cd229=fs['readFileSync'](path[_0x7694('0x5f')](config[_0x7694('0x60')],_0x7694('0x61')),_0x7694('0x62'));var _0x39316a=fs['readFileSync'](path[_0x7694('0x5f')](config[_0x7694('0x60')],'server/files/templates/registry.ejs'),_0x7694('0x62'));var _0x12b306=ejs['render'](_0x2cd229,{'trunks':_0x4975a5});var _0x3cacbf=ejs[_0x7694('0x68')](_0x39316a,{'trunks':_0x4975a5});fs['writeFileSync'](_0x7694('0x66'),_0x12b306);fs[_0x7694('0x65')](_0x7694('0x69'),_0x3cacbf);return respondWithRpcPromise(_0x7694('0x70'),'destroy',{'module':_0x7694('0x6a')});})[_0x7694('0x26')](handleError(_0x2edd31,null));}; \ No newline at end of file +var _0xd4f4=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','utf8','readFileSync','server/files/templates/registry.ejs','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','userProfileId','update','server/files/templates/trunk.ejs','Reload','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','destroy','then','get','Trunks','sendStatus','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','intersection','includeAll','find','clone','omit','updatedAt','body','createdAt','create'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x10c0ad,_0x248702){_0x10c0ad=_0x10c0ad-0x0;var _0x35b79a=_0xd4f4[_0x10c0ad];return _0x35b79a;};'use strict';var pdf=require(_0x4d4f('0x0'));var emlformat=require(_0x4d4f('0x1'));var rimraf=require(_0x4d4f('0x2'));var zipdir=require(_0x4d4f('0x3'));var jsonpatch=require(_0x4d4f('0x4'));var rp=require(_0x4d4f('0x5'));var moment=require(_0x4d4f('0x6'));var BPromise=require(_0x4d4f('0x7'));var Mustache=require(_0x4d4f('0x8'));var util=require(_0x4d4f('0x9'));var path=require(_0x4d4f('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var db=require(_0x4d4f('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x15fe6a,_0xe9b7a6,_0x4b7472){if(_0x4b7472){var _0x1ea8b3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ea8b3[_0x4d4f('0x1d')](_0xe9b7a6)){return _0x15fe6a;}else{throw new db[(_0x4d4f('0x1e'))]['ValidationError'](_0x4d4f('0x1f'));}}else{return _0x15fe6a;}}function respondWithRpcPromise(_0x2e736b,_0x1a9173,_0x4a3364,_0x59bfb5){return new BPromise(function(_0x5e4ff5,_0x18a528){var _0x16f8e7=_0x59bfb5||client;return _0x16f8e7[_0x4d4f('0x20')](_0x2e736b,_0x4a3364)['then'](function(_0x30b6b1){logger[_0x4d4f('0x21')]('Trunk,\x20%s,\x20%s',_0x1a9173,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x1a9173,'request\x20sent',JSON[_0x4d4f('0x22')](_0x30b6b1));if(_0x30b6b1[_0x4d4f('0x23')]){if(_0x30b6b1[_0x4d4f('0x23')][_0x4d4f('0x24')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x1a9173,_0x30b6b1[_0x4d4f('0x23')]['message']);return _0x18a528(_0x30b6b1[_0x4d4f('0x23')][_0x4d4f('0x25')]);}logger[_0x4d4f('0x23')](_0x4d4f('0x26'),_0x1a9173,_0x30b6b1[_0x4d4f('0x23')]['message']);return _0x5e4ff5(_0x30b6b1['error'][_0x4d4f('0x25')]);}else{logger['info'](_0x4d4f('0x26'),_0x1a9173,_0x4d4f('0x27'));_0x5e4ff5(_0x30b6b1[_0x4d4f('0x28')][_0x4d4f('0x25')]);}})[_0x4d4f('0x29')](function(_0x497cec){logger[_0x4d4f('0x23')](_0x4d4f('0x26'),_0x1a9173,_0x497cec);_0x18a528(_0x497cec);});});}function respondWithStatusCode(_0x1cf365,_0x28443b){_0x28443b=_0x28443b||0xcc;return function(_0x5cf9e7){if(_0x5cf9e7){return _0x1cf365['sendStatus'](_0x28443b);}return _0x1cf365[_0x4d4f('0x2a')](_0x28443b)[_0x4d4f('0x2b')]();};}function respondWithResult(_0xa2492c,_0x1f79f9){_0x1f79f9=_0x1f79f9||0xc8;return function(_0x58acbe){if(_0x58acbe){return _0xa2492c[_0x4d4f('0x2a')](_0x1f79f9)[_0x4d4f('0x2c')](_0x58acbe);}};}function respondWithFilteredResult(_0x388593,_0x2e91b2){return function(_0x4effb1){if(_0x4effb1){var _0x338ba2=_0x4effb1['count'],_0x51cb3d=_0x2e91b2[_0x4d4f('0x2d')],_0x1688bb=_0x2e91b2[_0x4d4f('0x2d')]+_0x2e91b2[_0x4d4f('0x2e')],_0x333a40;if(_0x1688bb>=_0x338ba2){_0x1688bb=_0x338ba2;_0x333a40=0xc8;}else{_0x333a40=0xce;}_0x388593[_0x4d4f('0x2a')](_0x333a40);return _0x388593[_0x4d4f('0x2f')](_0x4d4f('0x30'),_0x51cb3d+'-'+_0x1688bb+'/'+_0x338ba2)['json'](_0x4effb1);}return null;};}function patchUpdates(_0x36eede){return function(_0x4578b6){try{jsonpatch[_0x4d4f('0x31')](_0x4578b6,_0x36eede,!![]);}catch(_0x43c37b){return BPromise[_0x4d4f('0x32')](_0x43c37b);}return _0x4578b6['save']();};}function saveUpdates(_0x2d6565,_0x486e33){return function(_0x35f9e2){if(_0x35f9e2){return _0x35f9e2['update'](_0x2d6565)['then'](function(_0x5c751e){return _0x5c751e;});}return null;};}function removeEntity(_0x9abc01,_0x57fc2b){return function(_0x16ccd2){if(_0x16ccd2){return _0x16ccd2[_0x4d4f('0x33')]()[_0x4d4f('0x34')](function(){var _0x4f79f9=_0x16ccd2[_0x4d4f('0x35')]({'plain':!![]});var _0x1ab7c4=_0x4d4f('0x36');return db['UserProfileResource'][_0x4d4f('0x33')]({'where':{'type':_0x1ab7c4,'resourceId':_0x4f79f9['id']}})['then'](function(){return _0x16ccd2;});})[_0x4d4f('0x34')](function(){_0x9abc01[_0x4d4f('0x2a')](0xcc)[_0x4d4f('0x2b')]();});}};}function handleEntityNotFound(_0x128e3d,_0x2448f3){return function(_0x13f341){if(!_0x13f341){_0x128e3d[_0x4d4f('0x37')](0x194);}return _0x13f341;};}function handleError(_0x461900,_0x5d8058){_0x5d8058=_0x5d8058||0x1f4;return function(_0x54a21e){logger[_0x4d4f('0x23')](_0x54a21e['stack']);if(_0x54a21e['name']){delete _0x54a21e[_0x4d4f('0x38')];}_0x461900[_0x4d4f('0x2a')](_0x5d8058)[_0x4d4f('0x39')](_0x54a21e);};}exports[_0x4d4f('0x3a')]=function(_0x129103,_0x56eed8){var _0x12c512={},_0x27466f={},_0x5cc3e7={'count':0x0,'rows':[]};var _0x32af9a=_[_0x4d4f('0x3b')](db[_0x4d4f('0x3c')][_0x4d4f('0x3d')],function(_0x18800e){return{'name':_0x18800e[_0x4d4f('0x3e')],'type':_0x18800e[_0x4d4f('0x3f')][_0x4d4f('0x40')]};});_0x27466f[_0x4d4f('0x41')]=_['map'](_0x32af9a,'name');_0x27466f[_0x4d4f('0x42')]=_[_0x4d4f('0x43')](_0x129103[_0x4d4f('0x42')]);_0x27466f[_0x4d4f('0x44')]=_['intersection'](_0x27466f['model'],_0x27466f[_0x4d4f('0x42')]);_0x12c512[_0x4d4f('0x45')]=_['intersection'](_0x27466f['model'],qs[_0x4d4f('0x46')](_0x129103[_0x4d4f('0x42')]['fields']));_0x12c512[_0x4d4f('0x45')]=_0x12c512[_0x4d4f('0x45')][_0x4d4f('0x47')]?_0x12c512[_0x4d4f('0x45')]:_0x27466f[_0x4d4f('0x41')];if(!_0x129103['query'][_0x4d4f('0x48')]('nolimit')){_0x12c512[_0x4d4f('0x2e')]=qs[_0x4d4f('0x2e')](_0x129103['query'][_0x4d4f('0x2e')]);_0x12c512[_0x4d4f('0x2d')]=qs[_0x4d4f('0x2d')](_0x129103['query'][_0x4d4f('0x2d')]);}_0x12c512['order']=qs[_0x4d4f('0x49')](_0x129103['query'][_0x4d4f('0x49')]);_0x12c512[_0x4d4f('0x4a')]=qs[_0x4d4f('0x44')](_[_0x4d4f('0x4b')](_0x129103[_0x4d4f('0x42')],_0x27466f['filters']),_0x32af9a);if(_0x129103['query'][_0x4d4f('0x4c')]){_0x12c512[_0x4d4f('0x4a')]=_[_0x4d4f('0x4d')](_0x12c512[_0x4d4f('0x4a')],{'$or':_['map'](_0x32af9a,function(_0x54d0d5){if(_0x54d0d5['type']!==_0x4d4f('0x4e')){var _0x1a093e={};_0x1a093e[_0x54d0d5[_0x4d4f('0x38')]]={'$like':'%'+_0x129103[_0x4d4f('0x42')][_0x4d4f('0x4c')]+'%'};return _0x1a093e;}})});}_0x12c512=_[_0x4d4f('0x4d')]({},_0x12c512,_0x129103[_0x4d4f('0x4f')]);var _0x437da9={'where':_0x12c512[_0x4d4f('0x4a')]};return db[_0x4d4f('0x3c')][_0x4d4f('0x50')](_0x437da9)[_0x4d4f('0x34')](function(_0x5c7a41){_0x5cc3e7[_0x4d4f('0x50')]=_0x5c7a41;if(_0x129103[_0x4d4f('0x42')]['includeAll']){_0x12c512[_0x4d4f('0x51')]=[{'all':!![]}];}return db['Trunk'][_0x4d4f('0x52')](_0x12c512);})[_0x4d4f('0x34')](function(_0x50a3b3){_0x5cc3e7[_0x4d4f('0x53')]=_0x50a3b3;return _0x5cc3e7;})[_0x4d4f('0x34')](respondWithFilteredResult(_0x56eed8,_0x12c512))[_0x4d4f('0x29')](handleError(_0x56eed8,null));};exports[_0x4d4f('0x54')]=function(_0x7f22f2,_0x3eae74){var _0x11a63e={'raw':![],'where':{'id':_0x7f22f2[_0x4d4f('0x55')]['id']}},_0x3cf05c={};_0x3cf05c[_0x4d4f('0x41')]=_[_0x4d4f('0x43')](db[_0x4d4f('0x3c')]['rawAttributes']);_0x3cf05c[_0x4d4f('0x42')]=_['keys'](_0x7f22f2['query']);_0x3cf05c['filters']=_[_0x4d4f('0x56')](_0x3cf05c[_0x4d4f('0x41')],_0x3cf05c['query']);_0x11a63e['attributes']=_[_0x4d4f('0x56')](_0x3cf05c[_0x4d4f('0x41')],qs['fields'](_0x7f22f2[_0x4d4f('0x42')]['fields']));_0x11a63e[_0x4d4f('0x45')]=_0x11a63e[_0x4d4f('0x45')][_0x4d4f('0x47')]?_0x11a63e[_0x4d4f('0x45')]:_0x3cf05c['model'];if(_0x7f22f2[_0x4d4f('0x42')][_0x4d4f('0x57')]){_0x11a63e[_0x4d4f('0x51')]=[{'all':!![]}];}_0x11a63e=_[_0x4d4f('0x4d')]({},_0x11a63e,_0x7f22f2[_0x4d4f('0x4f')]);return db['Trunk'][_0x4d4f('0x58')](_0x11a63e)['then'](handleEntityNotFound(_0x3eae74,null))[_0x4d4f('0x34')](respondWithResult(_0x3eae74,null))['catch'](handleError(_0x3eae74,null));};exports[_0x4d4f('0x59')]=function(_0xc23eb6,_0x57f4b3){var _0x1c072d={'where':{'id':_0xc23eb6['params']['id']}},_0x1d8ae6={};_0x1d8ae6[_0x4d4f('0x41')]=_['keys'](db[_0x4d4f('0x3c')]['rawAttributes']);_0x1c072d['attributes']=_[_0x4d4f('0x56')](_0x1d8ae6[_0x4d4f('0x41')],qs[_0x4d4f('0x46')](_0xc23eb6[_0x4d4f('0x42')][_0x4d4f('0x46')]));_0x1c072d['attributes']=_0x1c072d['attributes'][_0x4d4f('0x47')]?_0x1c072d['attributes']:_0x1d8ae6[_0x4d4f('0x41')];if(_0xc23eb6[_0x4d4f('0x42')][_0x4d4f('0x57')]){_0x1c072d[_0x4d4f('0x51')]=[{'all':!![]}];}_0x1c072d=_[_0x4d4f('0x4d')]({},_0x1c072d,_0xc23eb6[_0x4d4f('0x4f')]);return db['Trunk'][_0x4d4f('0x58')](_0x1c072d)[_0x4d4f('0x34')](handleEntityNotFound(_0x57f4b3,null))[_0x4d4f('0x34')](function(_0x4bb7ac){if(_0x4bb7ac){var _0x2011aa=_0x4bb7ac[_0x4d4f('0x35')]({'plain':!![]});_0x2011aa=qs[_0x4d4f('0x5a')](_0x2011aa,['id','createdAt',_0x4d4f('0x5b')]);_0xc23eb6['body']=_[_0x4d4f('0x5a')](_0xc23eb6[_0x4d4f('0x5c')],['id',_0x4d4f('0x5d'),_0x4d4f('0x5b')]);return db[_0x4d4f('0x3c')][_0x4d4f('0x5e')](_[_0x4d4f('0x4d')](_0x2011aa,_0xc23eb6[_0x4d4f('0x5c')]),{'include':_0xc23eb6[_0x4d4f('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x4d4f('0x34')](function(_0x255771){var _0x4907b6=_0xc23eb6[_0x4d4f('0x5f')][_0x4d4f('0x35')]({'plain':!![]});if(!_0x4907b6)throw new Error(_0x4d4f('0x60'));if(_0x4907b6[_0x4d4f('0x61')]==='user'){var _0x4013a9=_0x255771[_0x4d4f('0x35')]({'plain':!![]});var _0x5995f2='Trunks';return db[_0x4d4f('0x62')][_0x4d4f('0x58')]({'where':{'name':_0x5995f2,'userProfileId':_0x4907b6['userProfileId']},'raw':!![]})['then'](function(_0x4d34fc){if(_0x4d34fc&&_0x4d34fc[_0x4d4f('0x63')]===0x0){return db[_0x4d4f('0x64')]['create']({'name':_0x4013a9[_0x4d4f('0x38')],'resourceId':_0x4013a9['id'],'type':_0x4d34fc[_0x4d4f('0x38')],'sectionId':_0x4d34fc['id']},{})[_0x4d4f('0x34')](function(){return _0x255771;});}else{return _0x255771;}})[_0x4d4f('0x29')](function(_0x1d9552){logger[_0x4d4f('0x23')](_0x4d4f('0x65'),_0x1d9552);throw _0x1d9552;});}return _0x255771;});}})[_0x4d4f('0x34')](respondWithResult(_0x57f4b3,0xc9))['catch'](handleError(_0x57f4b3,null));};exports[_0x4d4f('0x5e')]=function(_0x4e4196,_0x403cb2,_0x289653){var _0x1567c3;return db['Trunk'][_0x4d4f('0x5e')](_0x4e4196[_0x4d4f('0x5c')],{'raw':!![]})[_0x4d4f('0x34')](function(_0x14675c){_0x1567c3=_0x14675c;return db['Trunk'][_0x4d4f('0x52')]({'raw':!![]});})['then'](function(_0x268b34){var _0x50d0da=fs['readFileSync'](path[_0x4d4f('0x66')](config[_0x4d4f('0x67')],'server/files/templates/trunk.ejs'),_0x4d4f('0x68'));var _0x53a18b=fs[_0x4d4f('0x69')](path[_0x4d4f('0x66')](config[_0x4d4f('0x67')],_0x4d4f('0x6a')),'utf8');var _0x4952f0=ejs[_0x4d4f('0x6b')](_0x50d0da,{'trunks':_0x268b34||[]});fs[_0x4d4f('0x6c')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4952f0);if(_0x1567c3[_0x4d4f('0x6d')]){var _0x140cfd=ejs[_0x4d4f('0x6b')](_0x53a18b,{'trunks':_0x268b34||[]});fs[_0x4d4f('0x6c')](_0x4d4f('0x6e'),_0x140cfd);}})[_0x4d4f('0x34')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x4d4f('0x6f')});})[_0x4d4f('0x34')](function(){var _0x5e199d=_0x4e4196[_0x4d4f('0x5f')][_0x4d4f('0x35')]({'plain':!![]});if(!_0x5e199d)throw new Error(_0x4d4f('0x60'));if(_0x5e199d[_0x4d4f('0x61')]===_0x4d4f('0x5f')){var _0x45000f=_0x1567c3[_0x4d4f('0x35')]({'plain':!![]});return db[_0x4d4f('0x62')][_0x4d4f('0x58')]({'where':{'name':_0x4d4f('0x36'),'userProfileId':_0x5e199d[_0x4d4f('0x70')]},'raw':!![]})[_0x4d4f('0x34')](function(_0x13f45c){if(_0x13f45c&&_0x13f45c[_0x4d4f('0x63')]===0x0){return db[_0x4d4f('0x64')]['create']({'name':_0x45000f[_0x4d4f('0x38')],'resourceId':_0x45000f['id'],'type':_0x13f45c[_0x4d4f('0x38')],'sectionId':_0x13f45c['id']},{})[_0x4d4f('0x34')](function(){return _0x1567c3;});}else{return _0x1567c3;}})[_0x4d4f('0x29')](function(_0x5daf28){logger['error'](_0x4d4f('0x65'),_0x5daf28);throw _0x5daf28;});}return _0x1567c3;})[_0x4d4f('0x34')](respondWithResult(_0x403cb2,0xc9))[_0x4d4f('0x29')](handleError(_0x403cb2,null));};exports[_0x4d4f('0x71')]=function(_0x64820e,_0x2876b5,_0x19a8fb){var _0x342d66;return db[_0x4d4f('0x3c')][_0x4d4f('0x58')]({'where':{'id':_0x64820e['params']['id']}})[_0x4d4f('0x34')](handleEntityNotFound(_0x2876b5,null))[_0x4d4f('0x34')](saveUpdates(_0x64820e[_0x4d4f('0x5c')],null))[_0x4d4f('0x34')](function(_0x584c53){if(_0x584c53){_0x342d66=_0x584c53;return db['Trunk']['findAll']({'raw':!![]});}})[_0x4d4f('0x34')](function(_0x50b625){if(_0x50b625){var _0x3e592b=fs[_0x4d4f('0x69')](path[_0x4d4f('0x66')](config[_0x4d4f('0x67')],_0x4d4f('0x72')),_0x4d4f('0x68'));var _0x1990d6=fs[_0x4d4f('0x69')](path['join'](config['root'],_0x4d4f('0x6a')),'utf8');var _0x3a81b7=ejs[_0x4d4f('0x6b')](_0x3e592b,{'trunks':_0x50b625||[]});fs[_0x4d4f('0x6c')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3a81b7);var _0x535407=ejs['render'](_0x1990d6,{'trunks':_0x50b625||[]});fs[_0x4d4f('0x6c')]('/etc/asterisk/sip_xcally_registers.conf',_0x535407);return respondWithRpcPromise(_0x4d4f('0x73'),'update',{'module':_0x4d4f('0x6f')});}return null;})[_0x4d4f('0x34')](function(_0x1e8b6f){if(_0x1e8b6f){return _0x342d66;}})[_0x4d4f('0x34')](respondWithResult(_0x2876b5,null))[_0x4d4f('0x29')](handleError(_0x2876b5,null));};exports[_0x4d4f('0x33')]=function(_0x548709,_0x18274e,_0x3beacf){var _0x4691b7;return db[_0x4d4f('0x3c')][_0x4d4f('0x58')]({'where':{'id':_0x548709['params']['id']}})[_0x4d4f('0x34')](handleEntityNotFound(_0x18274e,null))['then'](removeEntity(_0x18274e,null))[_0x4d4f('0x34')](function(){return db[_0x4d4f('0x3c')][_0x4d4f('0x52')]({'raw':!![]});})[_0x4d4f('0x34')](function(_0x46fd1a){var _0x20d8df=fs[_0x4d4f('0x69')](path['join'](config[_0x4d4f('0x67')],_0x4d4f('0x72')),_0x4d4f('0x68'));var _0x4fb657=fs[_0x4d4f('0x69')](path['join'](config[_0x4d4f('0x67')],'server/files/templates/registry.ejs'),_0x4d4f('0x68'));var _0x20e632=ejs[_0x4d4f('0x6b')](_0x20d8df,{'trunks':_0x46fd1a});var _0x5dd02f=ejs[_0x4d4f('0x6b')](_0x4fb657,{'trunks':_0x46fd1a});fs[_0x4d4f('0x6c')](_0x4d4f('0x74'),_0x20e632);fs[_0x4d4f('0x6c')]('/etc/asterisk/sip_xcally_registers.conf',_0x5dd02f);return respondWithRpcPromise(_0x4d4f('0x73'),_0x4d4f('0x33'),{'module':'chan_sip.so'});})[_0x4d4f('0x29')](handleError(_0x18274e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a21a55e..0c703fb 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 _0xa9ed=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x19a4fe,_0x35458c){var _0x1f7234=function(_0x3245fc){while(--_0x3245fc){_0x19a4fe['push'](_0x19a4fe['shift']());}};_0x1f7234(++_0x35458c);}(_0xa9ed,0x187));var _0xda9e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa9ed[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xda9e('0x0'));var util=require(_0xda9e('0x1'));var logger=require(_0xda9e('0x2'))(_0xda9e('0x3'));var moment=require(_0xda9e('0x4'));var BPromise=require('bluebird');var rp=require(_0xda9e('0x5'));var fs=require('fs');var path=require(_0xda9e('0x6'));var rimraf=require(_0xda9e('0x7'));var config=require(_0xda9e('0x8'));var attributes=require(_0xda9e('0x9'));module[_0xda9e('0xa')]=function(_0x424183,_0xcf4678){return _0x424183[_0xda9e('0xb')](_0xda9e('0xc'),attributes,{'tableName':_0xda9e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa823=['rimraf','../../config/environment','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0xcba291,_0x10e9d5){var _0x162274=function(_0x38100e){while(--_0x38100e){_0xcba291['push'](_0xcba291['shift']());}};_0x162274(++_0x10e9d5);}(_0xa823,0x1d3));var _0x3a82=function(_0x5a7710,_0x42c551){_0x5a7710=_0x5a7710-0x0;var _0x4b4839=_0xa823[_0x5a7710];return _0x4b4839;};'use strict';var _=require(_0x3a82('0x0'));var util=require(_0x3a82('0x1'));var logger=require(_0x3a82('0x2'))('api');var moment=require(_0x3a82('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a82('0x4'));var fs=require('fs');var path=require(_0x3a82('0x5'));var rimraf=require(_0x3a82('0x6'));var config=require(_0x3a82('0x7'));var attributes=require('./trunk.attributes');module['exports']=function(_0x4ba92e,_0x259d9c){return _0x4ba92e[_0x3a82('0x8')](_0x3a82('0x9'),attributes,{'tableName':_0x3a82('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 0c7004f..f285551 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 _0xda2d=['../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowTrunk','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x4c2bc5,_0x4984e2){var _0x487209=function(_0x3cabbf){while(--_0x3cabbf){_0x4c2bc5['push'](_0x4c2bc5['shift']());}};_0x487209(++_0x4984e2);}(_0xda2d,0x102));var _0xdda2=function(_0x399511,_0x25a2bf){_0x399511=_0x399511-0x0;var _0x1173b3=_0xda2d[_0x399511];return _0x1173b3;};'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']('Trunk,\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')]('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')]({'raw':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')][_0xdda2('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['where']||null:null,'attributes':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x19')]||null:null,'limit':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['limit']||null:null,'include':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x1a3b35['options'][_0xdda2('0x1a')],function(_0xfda248){return{'model':db[_0xfda248[_0xdda2('0x1c')]],'as':_0xfda248['as'],'attributes':_0xfda248[_0xdda2('0x19')],'include':_0xfda248[_0xdda2('0x1a')]?_['map'](_0xfda248[_0xdda2('0x1a')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x1c')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x19')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1a')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x1c')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x5d26ae){logger[_0xdda2('0x12')](_0xdda2('0x14'),_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON['stringify'](_0x5d26ae));_0x2b6ee8(_0x5d26ae);})[_0xdda2('0x1d')](function(_0x255bbc){logger['error'](_0xdda2('0x14'),_0x255bbc[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x255bbc[_0xdda2('0x11')]));});});};exports['ShowTrunk']=function(_0x129eba){var _0x5e107f=this;return new Promise(function(_0x4b19b7,_0x1ca9f3){return db['Trunk'][_0xdda2('0x1e')]({'raw':_0x129eba['options']?_0x129eba['options']['raw']===undefined?!![]:![]:!![],'where':_0x129eba[_0xdda2('0x17')]?_0x129eba['options'][_0xdda2('0x1f')]||null:null,'attributes':_0x129eba['options']?_0x129eba['options']['attributes']||null:null,'include':_0x129eba[_0xdda2('0x17')]?_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')],function(_0x2bcfba){return{'model':db[_0x2bcfba[_0xdda2('0x1c')]],'as':_0x2bcfba['as'],'attributes':_0x2bcfba[_0xdda2('0x19')],'include':_0x2bcfba[_0xdda2('0x1a')]?_['map'](_0x2bcfba[_0xdda2('0x1a')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x1c')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x19')],'include':_0x4212da[_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x4212da[_0xdda2('0x1a')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x40eb19){logger['info']('ShowTrunk',_0x129eba);logger[_0xdda2('0xd')](_0xdda2('0x20'),_0x129eba,JSON[_0xdda2('0xf')](_0x40eb19));_0x4b19b7(_0x40eb19);})[_0xdda2('0x1d')](function(_0x246001){logger['error'](_0xdda2('0x20'),_0x246001[_0xdda2('0x11')],_0x129eba);_0x1ca9f3(_0x5e107f['error'](0x1f4,_0x246001['message']));});});}; \ 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(_0xad6452,_0x34d448){var _0x497f9c=function(_0x158e70){while(--_0x158e70){_0xad6452['push'](_0xad6452['shift']());}};_0x497f9c(++_0x34d448);}(_0x757a,0xde));var _0xa757=function(_0xb86121,_0x587d9f){_0xb86121=_0xb86121-0x0;var _0x552702=_0x757a[_0xb86121];return _0x552702;};'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 ad17137..5bd0067 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 _0x8a8e=['/:id/lists','getLists','/:id/agents','getAgents','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/create_many','bulkCreate','/:id/contacts','addContacts','create','diskStorage','join','root','server/files/images/','format','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','/:id/mail_accounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/:id','show','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams'];(function(_0x24a85e,_0x371670){var _0x5321cd=function(_0x5a1663){while(--_0x5a1663){_0x24a85e['push'](_0x24a85e['shift']());}};_0x5321cd(++_0x371670);}(_0x8a8e,0x1a2));var _0xe8a8=function(_0x386574,_0x4f92e9){_0x386574=_0x386574-0x0;var _0x1f8da8=_0x8a8e[_0x386574];return _0x1f8da8;};'use strict';var multer=require(_0xe8a8('0x0'));var util=require(_0xe8a8('0x1'));var path=require(_0xe8a8('0x2'));var timeout=require(_0xe8a8('0x3'));var express=require(_0xe8a8('0x4'));var router=express[_0xe8a8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe8a8('0x6'));var config=require(_0xe8a8('0x7'));var controller=require(_0xe8a8('0x8'));router[_0xe8a8('0x9')]('/',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0xb')]);router['get'](_0xe8a8('0xc'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0xd')]);router[_0xe8a8('0x9')](_0xe8a8('0xe'),auth['isAuthenticated'](),controller[_0xe8a8('0xf')]);router[_0xe8a8('0x9')](_0xe8a8('0x10'),auth['isAuthenticated'](),controller[_0xe8a8('0x11')]);router[_0xe8a8('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xe8a8('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xe8a8('0x12')]);router['get'](_0xe8a8('0x13'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x14')]);router['get'](_0xe8a8('0x15'),auth['isAuthenticated'](),controller[_0xe8a8('0x16')]);router[_0xe8a8('0x9')]('/:id/groups',auth['isAuthenticated'](),controller[_0xe8a8('0x17')]);router[_0xe8a8('0x9')]('/:id/recordings',auth[_0xe8a8('0xa')](),controller['getRecordings']);router[_0xe8a8('0x9')]('/:id/screen_recordings',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x18')]);router['get'](_0xe8a8('0x19'),auth['isAuthenticated'](),controller[_0xe8a8('0x1a')]);router[_0xe8a8('0x9')](_0xe8a8('0x1b'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x1c')]);router[_0xe8a8('0x9')](_0xe8a8('0x1d'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x1e')]);router[_0xe8a8('0x9')](_0xe8a8('0x1f'),auth['isAuthenticated'](),controller[_0xe8a8('0x20')]);router[_0xe8a8('0x9')](_0xe8a8('0x21'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x22')]);router[_0xe8a8('0x9')](_0xe8a8('0x23'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get'](_0xe8a8('0x24'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x25')]);router[_0xe8a8('0x9')](_0xe8a8('0x26'),auth['isAuthenticated'](),controller[_0xe8a8('0x27')]);router[_0xe8a8('0x9')](_0xe8a8('0x28'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x29')]);router[_0xe8a8('0x9')]('/:id/prefixes',auth[_0xe8a8('0xa')](),controller['getVoicePrefixes']);router[_0xe8a8('0x9')]('/:id/fax_accounts',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x2a')]);router[_0xe8a8('0x9')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xe8a8('0x2b')]);router[_0xe8a8('0x9')](_0xe8a8('0x2c'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x2d')]);router[_0xe8a8('0x9')](_0xe8a8('0x2e'),auth['isAuthenticated'](),controller[_0xe8a8('0x2f')]);router[_0xe8a8('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xe8a8('0x30')]);router[_0xe8a8('0x9')](_0xe8a8('0x31'),auth[_0xe8a8('0xa')](),controller['getWhatsappAccounts']);router['get'](_0xe8a8('0x32'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x33')]);router[_0xe8a8('0x9')](_0xe8a8('0x34'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x35')]);router['get'](_0xe8a8('0x36'),auth[_0xe8a8('0xa')](),controller['getApiKey']);router[_0xe8a8('0x37')](_0xe8a8('0x38'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x39')]);router[_0xe8a8('0x37')](_0xe8a8('0x3a'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x3b')]);router[_0xe8a8('0x37')]('/',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x3c')]);router[_0xe8a8('0x37')]('/:id/queues',auth[_0xe8a8('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0xe8a8('0x3d')]({'destination':function(_0x2bc0b3,_0x193bb5,_0x4a961a){_0x4a961a(null,path[_0xe8a8('0x3e')](config[_0xe8a8('0x3f')],_0xe8a8('0x40')));},'filename':function(_0x215d33,_0x3bc129,_0x5a93a5){_0x5a93a5(null,util[_0xe8a8('0x41')]('%s-%s',Date[_0xe8a8('0x42')](),_0x3bc129[_0xe8a8('0x43')]));}})});router[_0xe8a8('0x37')](_0xe8a8('0x44'),upload['single'](_0xe8a8('0x45')),controller[_0xe8a8('0x46')]);router['post'](_0xe8a8('0x47'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x48')]);router[_0xe8a8('0x37')](_0xe8a8('0x49'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x4a')]);router['post']('/:id/pause',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x4b')]);router[_0xe8a8('0x37')]('/:id/unpause',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x4c')]);router[_0xe8a8('0x37')](_0xe8a8('0x24'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x4d')]);router[_0xe8a8('0x37')](_0xe8a8('0x4e'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x4f')]);router[_0xe8a8('0x37')](_0xe8a8('0x50'),auth[_0xe8a8('0xa')](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xe8a8('0x51')]);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xe8a8('0x52')]);router['post']('/:id/openchannel_interactions',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x53')]);router[_0xe8a8('0x37')]('/:id/whatsapp_interactions',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x54')]);router[_0xe8a8('0x37')](_0xe8a8('0x55'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x56')]);router[_0xe8a8('0x37')]('/:id/mail_accounts',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x57')]);router[_0xe8a8('0x37')](_0xe8a8('0x2c'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x58')]);router[_0xe8a8('0x37')](_0xe8a8('0x2e'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x59')]);router[_0xe8a8('0x37')](_0xe8a8('0x5a'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x5b')]);router[_0xe8a8('0x37')](_0xe8a8('0x31'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x5c')]);router['post']('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xe8a8('0x37')](_0xe8a8('0x36'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x5d')]);router[_0xe8a8('0x5e')]('/:id',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x5f')]);router['put'](_0xe8a8('0x60'),auth['isAuthenticated'](),controller['changePassword']);router[_0xe8a8('0x61')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router[_0xe8a8('0x61')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe8a8('0x62')]);router[_0xe8a8('0x61')](_0xe8a8('0x10'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x63')]);router['delete'](_0xe8a8('0x4e'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x64')]);router[_0xe8a8('0x61')](_0xe8a8('0x50'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x65')]);router[_0xe8a8('0x61')](_0xe8a8('0x66'),auth['isAuthenticated'](),controller[_0xe8a8('0x67')]);router[_0xe8a8('0x61')](_0xe8a8('0x68'),auth[_0xe8a8('0xa')](),controller['removeSmsInteractions']);router[_0xe8a8('0x61')]('/:id/openchannel_interactions',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x69')]);router[_0xe8a8('0x61')](_0xe8a8('0x6a'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x6b')]);router['delete'](_0xe8a8('0x55'),auth[_0xe8a8('0xa')](),controller['removeFaxAccounts']);router[_0xe8a8('0x61')](_0xe8a8('0x6c'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x6d')]);router[_0xe8a8('0x61')](_0xe8a8('0x2c'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x6e')]);router[_0xe8a8('0x61')](_0xe8a8('0x2e'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x6f')]);router['delete'](_0xe8a8('0x5a'),auth[_0xe8a8('0xa')](),controller['removeChatWebsites']);router[_0xe8a8('0x61')](_0xe8a8('0x31'),auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x70')]);router[_0xe8a8('0x61')]('/:id/square_projects',auth[_0xe8a8('0xa')](),controller[_0xe8a8('0x71')]);router['delete'](_0xe8a8('0x36'),auth[_0xe8a8('0xa')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0x9f29=['addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','multer','path','express','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts'];(function(_0x5169af,_0x158682){var _0x4eeaa1=function(_0x4dd87a){while(--_0x4dd87a){_0x5169af['push'](_0x5169af['shift']());}};_0x4eeaa1(++_0x158682);}(_0x9f29,0x1c6));var _0x99f2=function(_0x1ee338,_0x2b4056){_0x1ee338=_0x1ee338-0x0;var _0xa76c8e=_0x9f29[_0x1ee338];return _0xa76c8e;};'use strict';var multer=require(_0x99f2('0x0'));var util=require('util');var path=require(_0x99f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x99f2('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x99f2('0x3'));var config=require(_0x99f2('0x4'));var controller=require(_0x99f2('0x5'));router[_0x99f2('0x6')]('/',auth['isAuthenticated'](),controller[_0x99f2('0x7')]);router['get'](_0x99f2('0x8'),auth[_0x99f2('0x9')](),controller[_0x99f2('0xa')]);router[_0x99f2('0x6')](_0x99f2('0xb'),auth['isAuthenticated'](),controller['whoami']);router[_0x99f2('0x6')]('/:id',auth[_0x99f2('0x9')](),controller[_0x99f2('0xc')]);router[_0x99f2('0x6')](_0x99f2('0xd'),controller[_0x99f2('0xe')]);router[_0x99f2('0x6')](_0x99f2('0xf'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x10')]);router[_0x99f2('0x6')](_0x99f2('0x11'),auth['isAuthenticated'](),controller[_0x99f2('0x12')]);router[_0x99f2('0x6')](_0x99f2('0x13'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x99f2('0x6')](_0x99f2('0x14'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x15')]);router[_0x99f2('0x6')](_0x99f2('0x16'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x99f2('0x6')]('/:id/screen_recordings',auth[_0x99f2('0x9')](),controller['getScreenRecordings']);router['get'](_0x99f2('0x17'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x18')]);router[_0x99f2('0x6')](_0x99f2('0x19'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x1a')]);router[_0x99f2('0x6')](_0x99f2('0x1b'),auth[_0x99f2('0x9')](),controller['getMailInteractions']);router['get'](_0x99f2('0x1c'),auth['isAuthenticated'](),controller[_0x99f2('0x1d')]);router[_0x99f2('0x6')]('/:id/fax/interactions',auth[_0x99f2('0x9')](),controller['getFaxInteractions']);router[_0x99f2('0x6')](_0x99f2('0x1e'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x1f')]);router[_0x99f2('0x6')](_0x99f2('0x20'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x21')]);router[_0x99f2('0x6')](_0x99f2('0x22'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x23')]);router[_0x99f2('0x6')](_0x99f2('0x24'),auth['isAuthenticated'](),controller[_0x99f2('0x25')]);router['get'](_0x99f2('0x26'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x99f2('0x6')](_0x99f2('0x27'),auth[_0x99f2('0x9')](),controller['getFaxAccounts']);router[_0x99f2('0x6')](_0x99f2('0x28'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x29')]);router[_0x99f2('0x6')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x99f2('0x2a')]);router['get'](_0x99f2('0x2b'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x2c')]);router[_0x99f2('0x6')]('/:id/chat_websites',auth[_0x99f2('0x9')](),controller[_0x99f2('0x2d')]);router[_0x99f2('0x6')](_0x99f2('0x2e'),auth['isAuthenticated'](),controller[_0x99f2('0x2f')]);router[_0x99f2('0x6')](_0x99f2('0x30'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x31')]);router[_0x99f2('0x6')](_0x99f2('0x32'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x33')]);router[_0x99f2('0x6')](_0x99f2('0x34'),auth[_0x99f2('0x9')](),controller['getApiKey']);router[_0x99f2('0x35')]('/create_many',auth[_0x99f2('0x9')](),controller[_0x99f2('0x36')]);router[_0x99f2('0x35')]('/:id/contacts',auth[_0x99f2('0x9')](),controller['addContacts']);router[_0x99f2('0x35')]('/',auth[_0x99f2('0x9')](),controller['create']);router[_0x99f2('0x35')]('/:id/queues',auth[_0x99f2('0x9')](),controller[_0x99f2('0x37')]);var upload=multer({'storage':multer[_0x99f2('0x38')]({'destination':function(_0x3f9b8f,_0x36170f,_0x31a7b7){_0x31a7b7(null,path[_0x99f2('0x39')](config[_0x99f2('0x3a')],_0x99f2('0x3b')));},'filename':function(_0x5d8db7,_0x5ac3fe,_0x52a38b){_0x52a38b(null,util['format'](_0x99f2('0x3c'),Date[_0x99f2('0x3d')](),_0x5ac3fe[_0x99f2('0x3e')]));}})});router[_0x99f2('0x35')]('/:id/avatar',upload[_0x99f2('0x3f')](_0x99f2('0x40')),controller['addAvatar']);router['post']('/:id/login',auth[_0x99f2('0x9')](),controller[_0x99f2('0x41')]);router[_0x99f2('0x35')](_0x99f2('0x42'),auth[_0x99f2('0x9')](),controller['logout']);router[_0x99f2('0x35')](_0x99f2('0x43'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x44')]);router[_0x99f2('0x35')](_0x99f2('0x45'),auth[_0x99f2('0x9')](),controller['unpause']);router[_0x99f2('0x35')](_0x99f2('0x20'),auth['isAuthenticated'](),controller['addTeams']);router[_0x99f2('0x35')](_0x99f2('0x46'),auth['isAuthenticated'](),controller[_0x99f2('0x47')]);router[_0x99f2('0x35')](_0x99f2('0x48'),auth['isAuthenticated'](),controller[_0x99f2('0x49')]);router[_0x99f2('0x35')](_0x99f2('0x4a'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x99f2('0x35')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x99f2('0x4b')]);router[_0x99f2('0x35')](_0x99f2('0x4c'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x99f2('0x35')](_0x99f2('0x4d'),auth[_0x99f2('0x9')](),controller['addWhatsappInteractions']);router[_0x99f2('0x35')]('/:id/fax_accounts',auth[_0x99f2('0x9')](),controller[_0x99f2('0x4e')]);router[_0x99f2('0x35')](_0x99f2('0x28'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x4f')]);router[_0x99f2('0x35')](_0x99f2('0x50'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x51')]);router[_0x99f2('0x35')](_0x99f2('0x2b'),auth['isAuthenticated'](),controller[_0x99f2('0x52')]);router[_0x99f2('0x35')](_0x99f2('0x53'),auth['isAuthenticated'](),controller[_0x99f2('0x54')]);router['post'](_0x99f2('0x2e'),auth['isAuthenticated'](),controller[_0x99f2('0x55')]);router['post']('/:id/square_projects',auth[_0x99f2('0x9')](),controller[_0x99f2('0x56')]);router[_0x99f2('0x35')](_0x99f2('0x34'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x57')]);router[_0x99f2('0x58')](_0x99f2('0x59'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x5a')]);router[_0x99f2('0x58')](_0x99f2('0x5b'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x5c')]);router[_0x99f2('0x5d')](_0x99f2('0x11'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x5e')]);router[_0x99f2('0x5d')](_0x99f2('0x20'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x5f')]);router[_0x99f2('0x5d')](_0x99f2('0x59'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x60')]);router['delete'](_0x99f2('0x46'),auth['isAuthenticated'](),controller[_0x99f2('0x61')]);router[_0x99f2('0x5d')](_0x99f2('0x48'),auth[_0x99f2('0x9')](),controller['removeMailInteractions']);router[_0x99f2('0x5d')](_0x99f2('0x4a'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x62')]);router['delete'](_0x99f2('0x63'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x64')]);router[_0x99f2('0x5d')](_0x99f2('0x4c'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x65')]);router[_0x99f2('0x5d')](_0x99f2('0x4d'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x66')]);router[_0x99f2('0x5d')](_0x99f2('0x27'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x67')]);router[_0x99f2('0x5d')](_0x99f2('0x28'),auth[_0x99f2('0x9')](),controller[_0x99f2('0x68')]);router['delete'](_0x99f2('0x50'),auth['isAuthenticated'](),controller[_0x99f2('0x69')]);router[_0x99f2('0x5d')](_0x99f2('0x2b'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x99f2('0x5d')](_0x99f2('0x53'),auth[_0x99f2('0x9')](),controller['removeChatWebsites']);router[_0x99f2('0x5d')]('/:id/whatsapp_accounts',auth[_0x99f2('0x9')](),controller[_0x99f2('0x6a')]);router['delete']('/:id/square_projects',auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete'](_0x99f2('0x34'),auth[_0x99f2('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ea8713d..bb8cd17 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 _0x5232=['always','accept','refuse','uac','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','get','isArray','wss','encryption','avpf','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','callerid','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','INTEGER','format','getDataValue','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5232,0x1f0));var _0x2523=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0x5232[_0x211bc3];return _0x34c9a2;};'use strict';var Sequelize=require(_0x2523('0x0'));var moment=require(_0x2523('0x1'));var util=require(_0x2523('0x2'));var _=require('lodash');module[_0x2523('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2523('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4085f9){this[_0x2523('0x5')](_0x2523('0x4'),_0x4085f9);this[_0x2523('0x5')](_0x2523('0x6'),_0x4085f9);},'comment':_0x2523('0x7')},'fullname':{'type':Sequelize[_0x2523('0x8')],'allowNull':![],'set':function(_0x81711){this[_0x2523('0x5')]('fullname',_0x81711);this['setDataValue'](_0x2523('0x9'),util['format'](_0x2523('0xa'),_0x81711,this['getDataValue'](_0x2523('0xb'))));}},'alias':{'type':Sequelize[_0x2523('0x8')]},'email':{'type':Sequelize[_0x2523('0x8')],'allowNull':![],'unique':_0x2523('0xc'),'validate':{'isEmail':!![]},'set':function(_0x299aca){if(_0x299aca){this[_0x2523('0x5')](_0x2523('0xc'),_0x299aca['toLowerCase']());}}},'role':{'type':Sequelize[_0x2523('0xd')](_0x2523('0xe'),_0x2523('0xf'),_0x2523('0x10'),_0x2523('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x2523('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2523('0x8')],'defaultValue':_0x2523('0x12')},'internal':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':![],'unique':_0x2523('0xb'),'set':function(_0x7b05b8){this[_0x2523('0x5')]('internal',_0x7b05b8);this[_0x2523('0x5')]('accountcode',_0x7b05b8);this[_0x2523('0x5')](_0x2523('0x9'),util[_0x2523('0x14')](_0x2523('0xa'),this[_0x2523('0x15')](_0x2523('0x16')),_0x7b05b8));}},'salt':{'type':Sequelize[_0x2523('0x8')]},'phone':{'type':Sequelize[_0x2523('0x8')]},'mobile':{'type':Sequelize[_0x2523('0x8')]},'address':{'type':Sequelize[_0x2523('0x8')]},'zipcode':{'type':Sequelize[_0x2523('0x8')]},'userpic':{'type':Sequelize[_0x2523('0x8')]},'city':{'type':Sequelize[_0x2523('0x8')]},'country':{'type':Sequelize[_0x2523('0x8')]},'online':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2523('0x18')]},'voicePause':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2523('0x8')],'defaultValue':_0x2523('0x19')},'lastPauseAt':{'type':Sequelize[_0x2523('0x18')]},'chatCapacity':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2523('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2523('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2523('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![],'defaultValue':_0x2523('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x2523('0x1b'),_0x2523('0xf'),_0x2523('0x1c')),'allowNull':!![],'defaultValue':_0x2523('0x1b')},'context':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![],'defaultValue':_0x2523('0x1d')},'callingpres':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x1e'),_0x2523('0x1f'),_0x2523('0x20'),_0x2523('0x21'),_0x2523('0x22'),_0x2523('0x23'),_0x2523('0x24'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![],'defaultValue':_0x2523('0x25'),'set':function(_0x17fc23){this['setDataValue']('transport',_0x17fc23?_0x17fc23[_0x2523('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x2523('0x27'))?this['getDataValue'](_0x2523('0x27'))['split'](','):null;},'comment':_0x2523('0x28')},'dtmfmode':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x29'),'info','shortinfo',_0x2523('0x2a'),_0x2523('0x2b')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat','update',_0x2523('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x53c2d5){this['setDataValue'](_0x2523('0x2e'),_0x53c2d5?_0x53c2d5[_0x2523('0x26')](','):null);},'get':function(){return this[_0x2523('0x15')]('nat')?this[_0x2523('0x15')]('nat')['split'](','):null;},'comment':_0x2523('0x2f')},'callgroup':{'type':Sequelize[_0x2523('0x8')]},'namedcallgroup':{'type':Sequelize[_0x2523('0x8')]},'pickupgroup':{'type':Sequelize[_0x2523('0x8')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2523('0x8')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2523('0x30')},'allow':{'type':Sequelize[_0x2523('0x8')],'allowNull':![],'defaultValue':_0x2523('0x31'),'set':function(_0x3d69e1){this[_0x2523('0x5')](_0x2523('0x32'),_0x3d69e1?_0x3d69e1[_0x2523('0x26')](';'):_0x2523('0x31'));},'get':function(){return this[_0x2523('0x15')](_0x2523('0x32'))?this[_0x2523('0x15')]('allow')[_0x2523('0x33')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3b42f5){this[_0x2523('0x5')]('insecure',_0x3b42f5?_0x3b42f5[_0x2523('0x26')](','):null);},'get':function(){return this[_0x2523('0x15')](_0x2523('0x34'))?this[_0x2523('0x15')](_0x2523('0x34'))[_0x2523('0x33')](','):null;},'comment':_0x2523('0x35')},'trustrpid':{'type':Sequelize[_0x2523('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no',_0x2523('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2523('0x37')},'amaflags':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x2523('0x2d')},'busylevel':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2523('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x2523('0x2d'),'no',_0x2523('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x39'),_0x2523('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x3b'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2523('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2523('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no',_0x2523('0x3c'),_0x2523('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x3e'),_0x2523('0x3f'),_0x2523('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2523('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2523('0xd')](_0x2523('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2523('0xd')]('yes','no',_0x2523('0x41'),'update',_0x2523('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2523('0x8')]},'resetPasswordExpires':{'type':Sequelize[_0x2523('0x18')]},'showWebBar':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0,'set':function(_0x1f59fb){this['setDataValue']('showWebBar',_0x1f59fb);var _0x33154a=this[_0x2523('0x43')]({'plain':!![]});switch(_0x1f59fb){case 0x0:case 0x1:var _0x1f85ff=_0x33154a[_0x2523('0x27')]?_[_0x2523('0x44')](_0x33154a['transport'])?_0x33154a['transport']['join']():_0x33154a[_0x2523('0x27')]:_0x2523('0x25');if(_0x1f85ff===_0x2523('0x45')){_0x1f85ff='udp';}this[_0x2523('0x5')](_0x2523('0x27'),_0x1f85ff);this[_0x2523('0x5')](_0x2523('0x46'),'no');this[_0x2523('0x5')](_0x2523('0x47'),null);this[_0x2523('0x5')]('force_avp',null);this[_0x2523('0x5')]('icesupport',null);this[_0x2523('0x5')](_0x2523('0x48'),null);this['setDataValue'](_0x2523('0x49'),null);this[_0x2523('0x5')](_0x2523('0x4a'),null);this[_0x2523('0x5')](_0x2523('0x4b'),null);this[_0x2523('0x5')](_0x2523('0x4c'),null);this[_0x2523('0x5')](_0x2523('0x4d'),'no');break;case 0x2:this[_0x2523('0x5')](_0x2523('0x27'),_0x2523('0x45'));this['setDataValue'](_0x2523('0x46'),_0x2523('0x2d'));this[_0x2523('0x5')](_0x2523('0x47'),_0x2523('0x2d'));this[_0x2523('0x5')](_0x2523('0x4e'),_0x2523('0x2d'));this[_0x2523('0x5')]('icesupport',_0x2523('0x2d'));this[_0x2523('0x5')](_0x2523('0x48'),_0x2523('0x2d'));this[_0x2523('0x5')](_0x2523('0x49'),'no');this[_0x2523('0x5')](_0x2523('0x4a'),_0x2523('0x40'));this[_0x2523('0x5')]('dtlscertfile',_0x33154a[_0x2523('0x4b')]||_0x2523('0x4f'));this[_0x2523('0x5')]('dtlsprivatekey',_0x33154a[_0x2523('0x4c')]||_0x2523('0x50'));this['setDataValue'](_0x2523('0x4d'),_0x2523('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x2523('0x51')],'set':function(_0x1d6371){this[_0x2523('0x5')]('permissions',_0x1d6371?_0x1d6371['join'](','):[]);},'get':function(){return this[_0x2523('0x15')]('permissions')?_[_0x2523('0x52')](this[_0x2523('0x15')]('permissions')[_0x2523('0x33')](','),function(_0x3470f2){return parseInt(_0x3470f2,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2523('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2523('0x8')]},'phoneBarUnconditional':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2523('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2523('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2523('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2523('0x8')]},'passwordResetAt':{'type':Sequelize[_0x2523('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2523('0x53')],'get':function(){return this[_0x2523('0x15')](_0x2523('0x54'))?this['getDataValue'](_0x2523('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2523('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![],'set':function(_0x4ed2b9){if(typeof _0x4ed2b9===_0x2523('0x55')){var _0x5d1728=_0x4ed2b9==='1'?!![]:_0x4ed2b9==='0'?![]:_0x4ed2b9===_0x2523('0x56')?!![]:_0x4ed2b9===_0x2523('0x57')?![]:![];this[_0x2523('0x5')]('screenrecording',_0x5d1728);}else{this['setDataValue'](_0x2523('0x58'),_0x4ed2b9);}}},'blocked':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![],'set':function(_0xb8e012){this[_0x2523('0x5')](_0x2523('0x59'),_0xb8e012);if(_0xb8e012===!![]){this[_0x2523('0x5')](_0x2523('0x5a'),moment());this[_0x2523('0x5')](_0x2523('0x5b'),0x0);}else{this[_0x2523('0x5')](_0x2523('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x2523('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2523('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2523('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x1482=['info','inband','auto','yes','nonat','update','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uac','uas','certificate','active','passive','actpass','showWebBar','get','isArray','udp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','wss','avpf','force_avp','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','rfc2833'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x1482,0x8f));var _0x2148=function(_0x33744d,_0x54a4fd){_0x33744d=_0x33744d-0x0;var _0x428b6e=_0x1482[_0x33744d];return _0x428b6e;};'use strict';var Sequelize=require(_0x2148('0x0'));var moment=require(_0x2148('0x1'));var util=require(_0x2148('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x2148('0x3')],'allowNull':![],'unique':_0x2148('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47d160){this[_0x2148('0x5')]('name',_0x47d160);this[_0x2148('0x5')]('defaultuser',_0x47d160);},'comment':_0x2148('0x6')},'fullname':{'type':Sequelize[_0x2148('0x3')],'allowNull':![],'set':function(_0x4938cb){this[_0x2148('0x5')](_0x2148('0x7'),_0x4938cb);this[_0x2148('0x5')]('callerid',util[_0x2148('0x8')](_0x2148('0x9'),_0x4938cb,this[_0x2148('0xa')](_0x2148('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2148('0xc'),'validate':{'isEmail':!![]},'set':function(_0x3a7486){if(_0x3a7486){this['setDataValue'](_0x2148('0xc'),_0x3a7486[_0x2148('0xd')]());}}},'role':{'type':Sequelize[_0x2148('0xe')](_0x2148('0xf'),_0x2148('0x10'),'agent',_0x2148('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x2148('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2148('0x3')],'defaultValue':_0x2148('0x12')},'internal':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':![],'unique':_0x2148('0xb'),'set':function(_0x35d26f){this['setDataValue'](_0x2148('0xb'),_0x35d26f);this[_0x2148('0x5')](_0x2148('0x14'),_0x35d26f);this[_0x2148('0x5')](_0x2148('0x15'),util[_0x2148('0x8')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0x2148('0x7')),_0x35d26f));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2148('0x3')]},'mobile':{'type':Sequelize[_0x2148('0x3')]},'address':{'type':Sequelize[_0x2148('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x2148('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2148('0x3')],'defaultValue':_0x2148('0x17')},'lastPauseAt':{'type':Sequelize[_0x2148('0x18')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2148('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2148('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![],'defaultValue':_0x2148('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x2148('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x1a'),_0x2148('0x10'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![],'defaultValue':_0x2148('0x1b')},'callingpres':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x1c'),_0x2148('0x1d'),_0x2148('0x1e'),_0x2148('0x1f'),_0x2148('0x20'),_0x2148('0x21'),_0x2148('0x22'),_0x2148('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2febe8){this[_0x2148('0x5')](_0x2148('0x24'),_0x2febe8?_0x2febe8[_0x2148('0x25')](','):null);},'get':function(){return this[_0x2148('0xa')]('transport')?this['getDataValue'](_0x2148('0x24'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x26'),_0x2148('0x27'),'shortinfo',_0x2148('0x28'),_0x2148('0x29')),'allowNull':!![],'defaultValue':_0x2148('0x26')},'directmedia':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no',_0x2148('0x2b'),_0x2148('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x2bb954){this['setDataValue']('nat',_0x2bb954?_0x2bb954[_0x2148('0x25')](','):null);},'get':function(){return this[_0x2148('0xa')](_0x2148('0x2d'))?this[_0x2148('0xa')](_0x2148('0x2d'))[_0x2148('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2148('0x3')]},'pickupgroup':{'type':Sequelize[_0x2148('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x2148('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2148('0x3')]},'disallow':{'type':Sequelize[_0x2148('0x3')],'allowNull':![],'defaultValue':_0x2148('0x2f')},'allow':{'type':Sequelize[_0x2148('0x3')],'allowNull':![],'defaultValue':_0x2148('0x30'),'set':function(_0x47ce76){this['setDataValue'](_0x2148('0x31'),_0x47ce76?_0x47ce76[_0x2148('0x25')](';'):_0x2148('0x30'));},'get':function(){return this[_0x2148('0xa')](_0x2148('0x31'))?this['getDataValue'](_0x2148('0x31'))[_0x2148('0x2e')](';'):null;},'comment':_0x2148('0x32')},'autoframing':{'type':Sequelize[_0x2148('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![],'set':function(_0x328fe2){this[_0x2148('0x5')](_0x2148('0x33'),_0x328fe2?_0x328fe2[_0x2148('0x25')](','):null);},'get':function(){return this[_0x2148('0xa')](_0x2148('0x33'))?this[_0x2148('0xa')](_0x2148('0x33'))[_0x2148('0x2e')](','):null;},'comment':_0x2148('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no',_0x2148('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2148('0x2a')},'busylevel':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2148('0xe')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2148('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no',_0x2148('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x37'),'refuse',_0x2148('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x39'),_0x2148('0x3a')),'allowNull':!![],'defaultValue':_0x2148('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2148('0x2a')},'keepalive':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2148('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2148('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no','fingerprint',_0x2148('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x3c'),_0x2148('0x3d'),_0x2148('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2148('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x2148('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2148('0xe')]('yes','no',_0x2148('0x2b'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2148('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0,'set':function(_0x1a79f5){this['setDataValue'](_0x2148('0x3f'),_0x1a79f5);var _0x337ab9=this[_0x2148('0x40')]({'plain':!![]});switch(_0x1a79f5){case 0x0:case 0x1:var _0xe05a5=_0x337ab9[_0x2148('0x24')]?_[_0x2148('0x41')](_0x337ab9[_0x2148('0x24')])?_0x337ab9[_0x2148('0x24')][_0x2148('0x25')]():_0x337ab9[_0x2148('0x24')]:_0x2148('0x42');if(_0xe05a5==='wss'){_0xe05a5=_0x2148('0x42');}this[_0x2148('0x5')](_0x2148('0x24'),_0xe05a5);this[_0x2148('0x5')]('encryption','no');this[_0x2148('0x5')]('avpf',null);this['setDataValue']('force_avp',null);this['setDataValue'](_0x2148('0x43'),null);this[_0x2148('0x5')](_0x2148('0x44'),null);this[_0x2148('0x5')](_0x2148('0x45'),null);this[_0x2148('0x5')]('dtlssetup',null);this[_0x2148('0x5')](_0x2148('0x46'),null);this['setDataValue'](_0x2148('0x47'),null);this[_0x2148('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x2148('0x24'),_0x2148('0x48'));this[_0x2148('0x5')]('encryption',_0x2148('0x2a'));this[_0x2148('0x5')](_0x2148('0x49'),_0x2148('0x2a'));this[_0x2148('0x5')](_0x2148('0x4a'),_0x2148('0x2a'));this[_0x2148('0x5')](_0x2148('0x43'),_0x2148('0x2a'));this['setDataValue'](_0x2148('0x44'),_0x2148('0x2a'));this[_0x2148('0x5')](_0x2148('0x45'),'no');this[_0x2148('0x5')](_0x2148('0x4b'),_0x2148('0x3e'));this['setDataValue']('dtlscertfile',_0x337ab9[_0x2148('0x46')]||_0x2148('0x4c'));this[_0x2148('0x5')]('dtlsprivatekey',_0x337ab9['dtlsprivatekey']||_0x2148('0x4d'));this['setDataValue'](_0x2148('0x4e'),_0x2148('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x2148('0x4f')],'set':function(_0x26293f){this['setDataValue'](_0x2148('0x50'),_0x26293f?_0x26293f[_0x2148('0x25')](','):[]);},'get':function(){return this[_0x2148('0xa')](_0x2148('0x50'))?_[_0x2148('0x51')](this[_0x2148('0xa')]('permissions')['split'](','),function(_0x42efb5){return parseInt(_0x42efb5,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2148('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2148('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2148('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2148('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2148('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2148('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2148('0xe')](_0x2148('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2148('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2148('0x3')]},'passwordResetAt':{'type':Sequelize[_0x2148('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2148('0x52')],'get':function(){return this[_0x2148('0xa')](_0x2148('0x53'))?this[_0x2148('0xa')](_0x2148('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2148('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2148('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![],'set':function(_0x403bcc){if(typeof _0x403bcc===_0x2148('0x54')){var _0x256a00=_0x403bcc==='1'?!![]:_0x403bcc==='0'?![]:_0x403bcc===_0x2148('0x55')?!![]:_0x403bcc===_0x2148('0x56')?![]:![];this[_0x2148('0x5')](_0x2148('0x57'),_0x256a00);}else{this[_0x2148('0x5')](_0x2148('0x57'),_0x403bcc);}}},'blocked':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![],'set':function(_0x3856b7){this[_0x2148('0x5')](_0x2148('0x58'),_0x3856b7);if(_0x3856b7===!![]){this['setDataValue'](_0x2148('0x59'),moment());this['setDataValue'](_0x2148('0x5a'),0x0);}else{this[_0x2148('0x5')](_0x2148('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0x2148('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2148('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b08dffa..f0d0d52 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 _0xb2ad=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./user.socket','register','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~!@#$%^&-_=+[{]}.','info','User,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Users','user','Agents','Telephones','filter','ignore','map','value','role','name','UserProfileResource','stack','index','fieldName','type','password','salt','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','sequelize','options','User','includeAll','findAll','rows','show','params','differenceBy','rawAttributes','find','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','telephone','admin','../../config/license/util','getLicense','telephones','users','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','length','from','voicemail','VoiceMail','fullname','email','permissions','113','110','104','105','106','108','109','100','111','114','agent','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','interface','add','capitalize','Queues','penalty','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','push','SIP/%s','voicePause','each','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getContacts','CmContact','include','List','Tags','color','tag','getQueues','Queue','order','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','forEach','all','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','mail','whatsapp','openchannel','%s%s','Pause','getTeams','Team','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','removeTeams','getMailQueues','flatten','removeAgent','getLists','CmList','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','eml-format','zip-dir'];(function(_0xb93956,_0xbb403d){var _0x4b347d=function(_0x3577f5){while(--_0x3577f5){_0xb93956['push'](_0xb93956['shift']());}};_0x4b347d(++_0xbb403d);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x2b3ba3,_0x4f1ac8){_0x2b3ba3=_0x2b3ba3-0x0;var _0x3f6e7a=_0xb2ad[_0x2b3ba3];return _0x3f6e7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdb2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb2a('0x1'));var jsonpatch=require(_0xdb2a('0x2'));var rp=require(_0xdb2a('0x3'));var moment=require(_0xdb2a('0x4'));var BPromise=require(_0xdb2a('0x5'));var Mustache=require('mustache');var util=require(_0xdb2a('0x6'));var path=require(_0xdb2a('0x7'));var sox=require(_0xdb2a('0x8'));var csv=require(_0xdb2a('0x9'));var ejs=require(_0xdb2a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb2a('0xb'));var jsforce=require(_0xdb2a('0xc'));var deskjs=require(_0xdb2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdb2a('0xe'));var Papa=require(_0xdb2a('0xf'));var Redis=require('ioredis');var authService=require(_0xdb2a('0x10'));var qs=require(_0xdb2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2a('0x12'))(_0xdb2a('0x13'));var utils=require(_0xdb2a('0x14'));var config=require('../../config/environment');var db=require(_0xdb2a('0x15'))['db'];config[_0xdb2a('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdb2a('0x17'))(new Redis(config['redis']));require(_0xdb2a('0x18'))[_0xdb2a('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdb2a('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x542503,_0x5d8282,_0x5dbbb1){if(_0x5dbbb1){var _0x8a580e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x8a580e[_0xdb2a('0x1b')](_0x5d8282)){return _0x542503;}else{throw new db['Sequelize']['ValidationError'](_0xdb2a('0x1c'));}}else{return _0x542503;}}function respondWithRpcPromise(_0x1835be,_0x440dab,_0x1bdd2f,_0x52508d){return new BPromise(function(_0x2bc67d,_0x2de4cf){var _0x1f6111=_0x52508d||client;return _0x1f6111['request'](_0x1835be,_0x1bdd2f)['then'](function(_0x424583){logger[_0xdb2a('0x1d')](_0xdb2a('0x1e'),_0x440dab,_0xdb2a('0x1f'));logger[_0xdb2a('0x20')]('User,\x20%s,\x20%s,\x20%s',_0x440dab,_0xdb2a('0x1f'),JSON['stringify'](_0x424583));if(_0x424583[_0xdb2a('0x21')]){if(_0x424583['error']['code']===0x1f4){logger[_0xdb2a('0x21')](_0xdb2a('0x1e'),_0x440dab,_0x424583[_0xdb2a('0x21')]['message']);return _0x2de4cf(_0x424583[_0xdb2a('0x21')][_0xdb2a('0x22')]);}logger[_0xdb2a('0x21')](_0xdb2a('0x1e'),_0x440dab,_0x424583[_0xdb2a('0x21')][_0xdb2a('0x22')]);return _0x2bc67d(_0x424583['error'][_0xdb2a('0x22')]);}else{logger[_0xdb2a('0x1d')]('User,\x20%s,\x20%s',_0x440dab,_0xdb2a('0x1f'));_0x2bc67d(_0x424583[_0xdb2a('0x23')][_0xdb2a('0x22')]);}})[_0xdb2a('0x24')](function(_0x4dd822){logger[_0xdb2a('0x21')](_0xdb2a('0x1e'),_0x440dab,_0x4dd822);_0x2de4cf(_0x4dd822);});});}function respondWithStatusCode(_0x3439c1,_0x1cab2b){_0x1cab2b=_0x1cab2b||0xcc;return function(_0x4ed637){if(_0x4ed637){return _0x3439c1[_0xdb2a('0x25')](_0x1cab2b);}return _0x3439c1[_0xdb2a('0x26')](_0x1cab2b)[_0xdb2a('0x27')]();};}function respondWithResult(_0x2b1c6d,_0x235c06){_0x235c06=_0x235c06||0xc8;return function(_0x565889){if(_0x565889){return _0x2b1c6d[_0xdb2a('0x26')](_0x235c06)[_0xdb2a('0x28')](_0x565889);}};}function respondWithFilteredResult(_0x42cc46,_0x5dcc2d){return function(_0x65b6c3){if(_0x65b6c3){var _0xd3a8a3=_0x65b6c3[_0xdb2a('0x29')],_0x134053=_0x5dcc2d[_0xdb2a('0x2a')],_0x2b01e5=_0x5dcc2d[_0xdb2a('0x2a')]+_0x5dcc2d[_0xdb2a('0x2b')],_0x3c55cc;if(_0x2b01e5>=_0xd3a8a3){_0x2b01e5=_0xd3a8a3;_0x3c55cc=0xc8;}else{_0x3c55cc=0xce;}_0x42cc46[_0xdb2a('0x26')](_0x3c55cc);return _0x42cc46[_0xdb2a('0x2c')](_0xdb2a('0x2d'),_0x134053+'-'+_0x2b01e5+'/'+_0xd3a8a3)[_0xdb2a('0x28')](_0x65b6c3);}return null;};}function patchUpdates(_0x1f033b){return function(_0x1053d0){try{jsonpatch[_0xdb2a('0x2e')](_0x1053d0,_0x1f033b,!![]);}catch(_0x506e1c){return BPromise[_0xdb2a('0x2f')](_0x506e1c);}return _0x1053d0[_0xdb2a('0x30')]();};}function saveUpdates(_0x36f9f7,_0x4a29e8){return function(_0x49ec05){if(_0x49ec05){return _0x49ec05[_0xdb2a('0x31')](_0x36f9f7)[_0xdb2a('0x32')](function(_0xac01e9){return _0xac01e9;});}return null;};}function removeEntity(_0x3bc30f,_0x234dc5){return function(_0x3f9110){if(_0x3f9110){return _0x3f9110[_0xdb2a('0x33')]()[_0xdb2a('0x32')](function(){var _0x185297=_0x3f9110[_0xdb2a('0x34')]({'plain':!![]});var _0x15e9db=[{'name':_0xdb2a('0x35'),'value':_0xdb2a('0x36'),'ignore':!![]},{'name':_0xdb2a('0x37'),'value':'agent','ignore':![]},{'name':_0xdb2a('0x38'),'value':'telephone','ignore':![]}];var _0x52f058=_(_0x15e9db)[_0xdb2a('0x39')](_0xdb2a('0x3a'))[_0xdb2a('0x3b')](_0xdb2a('0x3c'))[_0xdb2a('0x3c')]();if(_['includes'](_0x52f058,_0x185297['role'])){return;}var _0x472170=_['find'](_0x15e9db,['value',_0x185297[_0xdb2a('0x3d')]])[_0xdb2a('0x3e')];return db[_0xdb2a('0x3f')]['destroy']({'where':{'type':_0x472170,'resourceId':_0x185297['id']}})[_0xdb2a('0x32')](function(){return _0x3f9110;});})[_0xdb2a('0x32')](function(){_0x3bc30f[_0xdb2a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad7eb,_0x3dc539){return function(_0x4604af){if(!_0x4604af){_0x1ad7eb[_0xdb2a('0x25')](0x194);}return _0x4604af;};}function handleError(_0x1efcf8,_0x43ca76){_0x43ca76=_0x43ca76||0x1f4;return function(_0x1c3768){logger['error'](_0x1c3768[_0xdb2a('0x40')]);if(_0x1c3768[_0xdb2a('0x3e')]){delete _0x1c3768[_0xdb2a('0x3e')];}_0x1efcf8[_0xdb2a('0x26')](_0x43ca76)['send'](_0x1c3768);};}exports[_0xdb2a('0x41')]=function(_0xb7777e,_0x56e67f){var _0x44d762={},_0x39c387={},_0x1cb36e={'count':0x0,'rows':[]};var _0x232885=_['map'](db['User']['rawAttributes'],function(_0x2e56b6){return{'name':_0x2e56b6[_0xdb2a('0x42')],'type':_0x2e56b6[_0xdb2a('0x43')]['key']};});_0x39c387['model']=_['differenceBy'](_[_0xdb2a('0x3b')](_0x232885,'name'),[_0xdb2a('0x44'),_0xdb2a('0x45')]);_0x39c387[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0xb7777e['query']);_0x39c387[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x39c387[_0xdb2a('0x4a')],_0x39c387['query']);_0x44d762[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x39c387[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0xb7777e['query'][_0xdb2a('0x4c')]));_0x44d762['attributes']=_0x44d762[_0xdb2a('0x4b')]['length']?_0x44d762['attributes']:_0x39c387[_0xdb2a('0x4a')];if(!_0xb7777e[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x44d762[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0xb7777e[_0xdb2a('0x46')]['limit']);_0x44d762[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0xb7777e[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}_0x44d762['order']=qs[_0xdb2a('0x4f')](_0xb7777e[_0xdb2a('0x46')]['sort']);_0x44d762[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0xb7777e[_0xdb2a('0x46')],_0x39c387['filters']),_0x232885);if(_0xb7777e['query'][_0xdb2a('0x39')]){_0x44d762['where']=_[_0xdb2a('0x52')](_0x44d762['where'],{'$or':_[_0xdb2a('0x3b')](_0x232885,function(_0x351393){if(_0x351393[_0xdb2a('0x43')]!=='VIRTUAL'){return db[_0xdb2a('0x53')][_0xdb2a('0x50')](db[_0xdb2a('0x53')]['fn']('lower',db[_0xdb2a('0x53')]['col'](_0x351393[_0xdb2a('0x3e')])),{'$like':db[_0xdb2a('0x53')]['fn']('lower','%'+_0xb7777e[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%')});}})});}_0x44d762=_[_0xdb2a('0x52')]({},_0x44d762,_0xb7777e[_0xdb2a('0x54')]);var _0x4ef3bb={'where':_0x44d762[_0xdb2a('0x50')]};return db[_0xdb2a('0x55')][_0xdb2a('0x29')](_0x4ef3bb)[_0xdb2a('0x32')](function(_0x43def4){_0x1cb36e[_0xdb2a('0x29')]=_0x43def4;if(_0xb7777e[_0xdb2a('0x46')][_0xdb2a('0x56')]){_0x44d762['include']=[{'all':!![]}];}return db['User'][_0xdb2a('0x57')](_0x44d762);})[_0xdb2a('0x32')](function(_0x182733){_0x1cb36e[_0xdb2a('0x58')]=_0x182733;return _0x1cb36e;})[_0xdb2a('0x32')](respondWithFilteredResult(_0x56e67f,_0x44d762))[_0xdb2a('0x24')](handleError(_0x56e67f,null));};exports[_0xdb2a('0x59')]=function(_0x46def4,_0x41ec8d){var _0x18ef8a={'raw':![],'where':{'id':_0x46def4[_0xdb2a('0x5a')]['id']}},_0x141c03={};_0x141c03[_0xdb2a('0x4a')]=_[_0xdb2a('0x5b')](_['keys'](db[_0xdb2a('0x55')][_0xdb2a('0x5c')]),[_0xdb2a('0x44'),_0xdb2a('0x45')]);_0x141c03['query']=_[_0xdb2a('0x47')](_0x46def4[_0xdb2a('0x46')]);_0x141c03[_0xdb2a('0x48')]=_['intersection'](_0x141c03[_0xdb2a('0x4a')],_0x141c03['query']);_0x18ef8a['attributes']=_['intersection'](_0x141c03[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x46def4[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x18ef8a[_0xdb2a('0x4b')]=_0x18ef8a[_0xdb2a('0x4b')]['length']?_0x18ef8a['attributes']:_0x141c03['model'];if(_0x46def4[_0xdb2a('0x46')][_0xdb2a('0x56')]){_0x18ef8a['include']=[{'all':!![]}];}_0x18ef8a=_[_0xdb2a('0x52')]({},_0x18ef8a,_0x46def4['options']);return db['User'][_0xdb2a('0x5d')](_0x18ef8a)[_0xdb2a('0x32')](handleEntityNotFound(_0x41ec8d,null))[_0xdb2a('0x32')](respondWithResult(_0x41ec8d,null))[_0xdb2a('0x24')](handleError(_0x41ec8d,null));};exports[_0xdb2a('0x5e')]=function(_0x51a6b6,_0x5a8773){return db[_0xdb2a('0x55')][_0xdb2a('0x5e')](_0x51a6b6[_0xdb2a('0x5f')],{'raw':![],'individualHooks':!![]})[_0xdb2a('0x32')](respondWithResult(_0x5a8773,0xc9))[_0xdb2a('0x24')](handleError(_0x5a8773,null));};exports[_0xdb2a('0x31')]=function(_0x2cfc49,_0x36d655){if(_0x2cfc49[_0xdb2a('0x5f')]['id']){delete _0x2cfc49[_0xdb2a('0x5f')]['id'];}delete _0x2cfc49[_0xdb2a('0x5f')]['role'];return db['User'][_0xdb2a('0x5d')]({'where':{'id':_0x2cfc49[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x36d655,null))[_0xdb2a('0x32')](saveUpdates(_0x2cfc49[_0xdb2a('0x5f')],null))['then'](respondWithResult(_0x36d655,null))[_0xdb2a('0x24')](handleError(_0x36d655,null));};exports[_0xdb2a('0x60')]=function(_0x1eeeb3,_0x38a241){return db[_0xdb2a('0x55')][_0xdb2a('0x60')]()[_0xdb2a('0x32')](respondWithResult(_0x38a241,null))[_0xdb2a('0x24')](handleError(_0x38a241,null));};exports[_0xdb2a('0x61')]=function(_0x3416d6,_0x2d7448,_0x43825a){return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x3416d6[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x2d7448,null))[_0xdb2a('0x32')](function(_0x3aff54){if(_0x3aff54){return _0x3aff54[_0xdb2a('0x61')](_0x3416d6[_0xdb2a('0x5f')][_0xdb2a('0x62')],_[_0xdb2a('0x63')](_0x3416d6[_0xdb2a('0x5f')],[_0xdb2a('0x62'),'id'])||{});}})[_0xdb2a('0x32')](respondWithResult(_0x2d7448,null))[_0xdb2a('0x24')](handleError(_0x2d7448,null));};var getLicense=function(_0x423136){return new BPromise(function(_0x7a9589,_0x503010){var _0x332c4d=0x0;_0x423136[_0xdb2a('0x5f')][_0xdb2a('0x3d')]==='agent'&&_0x7a9589(_0xdb2a('0x64'));return db[_0xdb2a('0x55')][_0xdb2a('0x29')]({'where':{'$or':[{'role':_0x423136[_0xdb2a('0x5f')]['role']==='telephone'?_0xdb2a('0x65'):[_0xdb2a('0x66'),_0xdb2a('0x36')]}]}})[_0xdb2a('0x32')](function(_0x77f45){_0x332c4d=_0x77f45;return require(_0xdb2a('0x67'))[_0xdb2a('0x68')]();})[_0xdb2a('0x32')](function(_0x59d183){var _0x4c3d51=_0x423136[_0xdb2a('0x5f')][_0xdb2a('0x3d')]===_0xdb2a('0x65')?_0xdb2a('0x69'):_0xdb2a('0x6a');if(!_['isNil'](_0x59d183[_0x4c3d51])&&_0x332c4d>=_0x59d183[_0x4c3d51]){return _0x503010({'message':'License\x20limit\x20reached'});}return _0x7a9589(util[_0xdb2a('0x6b')](_0xdb2a('0x6c'),_0x4c3d51,_0x332c4d));})[_0xdb2a('0x24')](function(_0x4605d3){return _0x503010(_0x4605d3);});});};exports[_0xdb2a('0x6d')]=function(_0xffe016,_0x238f54){return getLicense(_0xffe016)[_0xdb2a('0x32')](function(_0x34d509){if(!_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')]){var _0x463d42;return db[_0xdb2a('0x6f')][_0xdb2a('0x70')](0x1)[_0xdb2a('0x32')](function(_0x2deeff){return checkPasswordPattern(_0x2deeff,_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x44')],_0x2deeff[_0xdb2a('0x71')]);})['then'](function(_0x963a9e){_0x463d42=_0x963a9e[_0xdb2a('0x72')];return db['User'][_0xdb2a('0x73')](_0xdb2a('0x6e'));})[_0xdb2a('0x32')](function(_0x457e9d){if(_[_0xdb2a('0x74')](_0x457e9d)){if(_0x463d42){_0xffe016['body'][_0xdb2a('0x6e')]=_0x463d42;}else{_0xffe016['body'][_0xdb2a('0x6e')]=0x1;}}else{if(_['isNil'](_0x463d42)||_0x463d42==_0x457e9d){_0xffe016['body'][_0xdb2a('0x6e')]=_0x457e9d+0x1;}else if(_0x463d42>_0x457e9d){_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')]=_0x463d42;}else{return db['sequelize']['query'](_0xdb2a('0x75'),{'type':db[_0xdb2a('0x53')]['QueryTypes'][_0xdb2a('0x76')]})['then'](function(_0x32004a){if(_0x32004a&&_0x32004a[_0xdb2a('0x77')]){for(var _0x2a29c6=0x0,_0x31d292=_0x32004a[_0xdb2a('0x77')];_0x2a29c6<_0x31d292&&_[_0xdb2a('0x74')](_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')]);_0x2a29c6++){if(_0x463d42<=_0x32004a[_0x2a29c6]['from']){_0xffe016['body'][_0xdb2a('0x6e')]=_0x32004a[_0x2a29c6][_0xdb2a('0x78')];}else if(_0x463d42>_0x32004a[_0x2a29c6][_0xdb2a('0x78')]&&_0x463d42<=_0x32004a[_0x2a29c6]['to']){_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')]=_0x463d42;}}}if(_[_0xdb2a('0x74')](_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')])){_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')]=_0x457e9d+0x1;}});}}});}})['then'](function(){if(_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x79')]){_0xffe016[_0xdb2a('0x5f')]['mailbox']=_0xffe016['body'][_0xdb2a('0x6e')];_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x7a')]={'mailbox':_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x6e')],'password':_0xffe016['body'][_0xdb2a('0x44')],'fullname':_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x7b')],'email':_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x7c')]};}if(_0xffe016[_0xdb2a('0x5f')]&&_0xffe016['body'][_0xdb2a('0x3d')]==='agent'){if(!_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x7d')]){_0xffe016[_0xdb2a('0x5f')]['permissions']=['101','102','103',_0xdb2a('0x7e'),_0xdb2a('0x7f'),_0xdb2a('0x80'),_0xdb2a('0x81'),_0xdb2a('0x82'),'107',_0xdb2a('0x83'),_0xdb2a('0x84'),_0xdb2a('0x85'),_0xdb2a('0x86'),_0xdb2a('0x87')];}}return db[_0xdb2a('0x55')][_0xdb2a('0x6d')](_0xffe016[_0xdb2a('0x5f')],{'include':[{'model':db[_0xdb2a('0x7a')],'as':'VoiceMail'}]});})[_0xdb2a('0x32')](function(_0x181c68){if(_0xffe016[_0xdb2a('0x5f')][_0xdb2a('0x3d')]==='user')return _0x181c68;var _0x3f57a4=_0xffe016[_0xdb2a('0x36')][_0xdb2a('0x34')]({'plain':!![]});if(!_0x3f57a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f57a4['role']===_0xdb2a('0x36')){var _0xf27dc0=_0x181c68[_0xdb2a('0x34')]({'plain':!![]});var _0x536441=[{'name':'Agents','value':_0xdb2a('0x88')},{'name':'Telephones','value':_0xdb2a('0x65')}];var _0x407317=_[_0xdb2a('0x5d')](_0x536441,['value',_0xf27dc0[_0xdb2a('0x3d')]])[_0xdb2a('0x3e')];return db['UserProfileSection']['find']({'where':{'name':_0x407317,'userProfileId':_0x3f57a4[_0xdb2a('0x89')]},'raw':!![]})[_0xdb2a('0x32')](function(_0x18b838){if(_0x18b838&&_0x18b838[_0xdb2a('0x8a')]===0x0){return db[_0xdb2a('0x3f')][_0xdb2a('0x6d')]({'name':_0xf27dc0[_0xdb2a('0x3e')],'resourceId':_0xf27dc0['id'],'type':_0x18b838[_0xdb2a('0x3e')],'sectionId':_0x18b838['id']},{})[_0xdb2a('0x32')](function(){return _0x181c68;});}else{return _0x181c68;}})[_0xdb2a('0x24')](function(_0x1636ff){logger[_0xdb2a('0x21')](_0xdb2a('0x8b'),_0x1636ff);throw _0x1636ff;});}return _0x181c68;})[_0xdb2a('0x32')](respondWithResult(_0x238f54,0xc9))['catch'](handleError(_0x238f54,null));};exports[_0xdb2a('0x8c')]=function(_0x11210d,_0xf818bd,_0x245913){var _0x47527e=![];if(_0x11210d[_0xdb2a('0x5f')]['id']){delete _0x11210d[_0xdb2a('0x5f')]['id'];}return db[_0xdb2a('0x6f')][_0xdb2a('0x8d')]({'attributes':['id',_0xdb2a('0x71')]})[_0xdb2a('0x32')](function(_0x4aa613){_0x47527e=_0x4aa613['securePassword'];return db['User']['find']({'where':{'id':_0x11210d['params']['id']}});})[_0xdb2a('0x32')](function(_0x31c1eb){if(_0x31c1eb){if(_0x31c1eb['id']==_0x11210d[_0xdb2a('0x36')]['id']){if(!_0x11210d[_0xdb2a('0x5f')][_0xdb2a('0x8e')]||!_0x11210d['body']['newPassword']){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0x91'));}if(!_0x31c1eb[_0xdb2a('0x92')](_0x11210d['body'][_0xdb2a('0x8e')])){throw new db['Sequelize']['ValidationError'](_0xdb2a('0x93'));}if(_0x11210d[_0xdb2a('0x5f')][_0xdb2a('0x8e')]==_0x11210d[_0xdb2a('0x5f')][_0xdb2a('0x94')]){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0x95'));}return _0x31c1eb;}else if(_0x11210d[_0xdb2a('0x36')][_0xdb2a('0x3d')]==_0xdb2a('0x66')){if(!_0x11210d[_0xdb2a('0x5f')][_0xdb2a('0x94')]){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0x96'));}return _0x31c1eb;}else if(_0x11210d[_0xdb2a('0x36')][_0xdb2a('0x3d')]==_0xdb2a('0x36')){if(!_0x11210d[_0xdb2a('0x5f')]['newPassword']){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0x96'));}if(_0x31c1eb[_0xdb2a('0x3d')]!='agent'){throw new db['Sequelize']['ValidationError'](_0xdb2a('0x97'));}return _0x31c1eb;}else{throw new db[(_0xdb2a('0x8f'))]['ValidationError'](_0xdb2a('0x97'));}}return null;})[_0xdb2a('0x32')](handleEntityNotFound(_0xf818bd,null))['then'](function(_0x331b99){return checkPasswordPattern(_0x331b99,_0x11210d['body'][_0xdb2a('0x94')],_0x47527e);})[_0xdb2a('0x32')](saveUpdates({'password':_0x11210d['body'][_0xdb2a('0x94')],'passwordResetAt':_0x11210d['user']['id']==_0x11210d[_0xdb2a('0x5a')]['id']?moment():null},null))['then'](respondWithResult(_0xf818bd,null))['catch'](handleError(_0xf818bd,null));};exports[_0xdb2a('0x98')]=function(_0x5575d9,_0x2a0f63,_0x45e3d5){var _0x3e2ee0=_0x5575d9['body'][_0xdb2a('0x99')];return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x5575d9[_0xdb2a('0x5a')]['id']},'attributes':['id',_0xdb2a('0x3e'),_0xdb2a('0x3d'),_0xdb2a('0x9a'),_0xdb2a('0x9b'),'voicePause',_0xdb2a('0x9c')]})[_0xdb2a('0x32')](handleEntityNotFound(_0x2a0f63,null))['then'](function(_0x367118){if(_0x367118){if(!utils['isValidChannel'](_0x3e2ee0)){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))]('Unknown\x20channel');}return _0x367118[_0xdb2a('0x9d')+_[_0xdb2a('0x9e')](_0x3e2ee0['toLowerCase']())+_0xdb2a('0x9f')](_0x5575d9[_0xdb2a('0x5f')]['ids'],{'penalty':_0x5575d9[_0xdb2a('0x5f')][_0xdb2a('0xa0')]||0x0})['spread'](function(_0x30c03b){for(var _0x3e35f5=0x0;_0x3e35f5<_0x5575d9[_0xdb2a('0x5f')]['ids']['length'];_0x3e35f5+=0x1){var _0x5d6e7e={'UserId':_0x5575d9[_0xdb2a('0x5a')]['id']};_0x5d6e7e[_[_0xdb2a('0x9e')](_0x3e2ee0[_0xdb2a('0xa1')]())+_0xdb2a('0xa2')]=_0x5575d9['body'][_0xdb2a('0x62')][_0x3e35f5];socket[_0xdb2a('0xa3')](_0xdb2a('0x36')+_[_0xdb2a('0x9e')](_0x3e2ee0[_0xdb2a('0xa1')]())+_0xdb2a('0xa4'),_0x5d6e7e);}return _0x30c03b;})[_0xdb2a('0x32')](function(){if(_0x3e2ee0===_0xdb2a('0xa5')){return db[_0xdb2a('0xa6')][_0xdb2a('0x57')]({'where':{'id':_0x5575d9[_0xdb2a('0x5f')]['ids']||[]},'raw':!![],'attributes':['id',_0xdb2a('0x3e')]});}})[_0xdb2a('0x32')](function(_0x21b447){var _0x38ccca=_0x367118[_0xdb2a('0x34')]({'plain':!![]});var _0x5c5a50=[];if(_0x3e2ee0==='voice'&&_0x38ccca[_0xdb2a('0x3d')]===_0xdb2a('0x88')&&_0x38ccca[_0xdb2a('0x9a')]){for(var _0x399e26=0x0;_0x399e26<_0x21b447['length'];_0x399e26+=0x1){_0x5c5a50[_0xdb2a('0xa7')]({'membername':_0x38ccca[_0xdb2a('0x3e')],'UserId':_0x38ccca['id'],'queue_name':_0x21b447[_0x399e26][_0xdb2a('0x3e')],'VoiceQueueId':_0x21b447[_0x399e26]['id'],'interface':_[_0xdb2a('0x74')](_0x38ccca['interface'])?util['format'](_0xdb2a('0xa8'),_0x38ccca[_0xdb2a('0x3e')]):_0x38ccca[_0xdb2a('0x9c')],'paused':_0x38ccca[_0xdb2a('0xa9')]||![],'penalty':_0x5575d9[_0xdb2a('0x5f')][_0xdb2a('0xa0')]||0x0});}return BPromise[_0xdb2a('0xaa')](_0x5c5a50,function(_0x2d9934){return db['UserVoiceQueueRt'][_0xdb2a('0xab')](_0x2d9934);});}return _0x367118;});}})['then'](respondWithStatusCode(_0x2a0f63,null))[_0xdb2a('0x24')](handleError(_0x2a0f63,null));};exports[_0xdb2a('0xac')]=function(_0x4ed3df,_0x5a5028,_0xd83615){var _0x717ed1;return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x4ed3df[_0xdb2a('0x5a')]['id']},'attributes':['id',_0xdb2a('0x3e'),_0xdb2a('0x3d')]})[_0xdb2a('0x32')](handleEntityNotFound(_0x5a5028,null))[_0xdb2a('0x32')](function(_0x2b5f9e){if(_0x2b5f9e){_0x717ed1=_0x2b5f9e;if(!_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x99')]||!utils[_0xdb2a('0xad')](_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x99')])){throw new db[(_0xdb2a('0x8f'))]['ValidationError'](_0xdb2a('0xae'));}return _0x2b5f9e[_0xdb2a('0xaf')+_['capitalize'](_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x99')][_0xdb2a('0xa1')]())+_0xdb2a('0x9f')](_0x4ed3df[_0xdb2a('0x46')]['ids']);}})[_0xdb2a('0x32')](function(_0x498eba){for(var _0x29d84e=0x0;_0x29d84e<_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x62')][_0xdb2a('0x77')];_0x29d84e+=0x1){var _0x2fc8b9={'UserId':_0x4ed3df[_0xdb2a('0x5a')]['id']};_0x2fc8b9[_[_0xdb2a('0x9e')](_0x4ed3df[_0xdb2a('0x46')]['channel']['toLowerCase']())+'QueueId']=_0x4ed3df[_0xdb2a('0x46')]['ids'][_0x29d84e];socket['emit'](_0xdb2a('0x36')+_[_0xdb2a('0x9e')](_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x99')][_0xdb2a('0xa1')]())+_0xdb2a('0xb0'),_0x2fc8b9);}return _0x498eba;})['then'](function(){if(_0x4ed3df[_0xdb2a('0x46')][_0xdb2a('0x99')]===_0xdb2a('0xa5')){return db[_0xdb2a('0xb1')][_0xdb2a('0x33')]({'where':{'UserId':_0x4ed3df[_0xdb2a('0x5a')]['id'],'VoiceQueueId':_0x4ed3df['query'][_0xdb2a('0x62')]},'individualHooks':!![]})[_0xdb2a('0x32')](function(){return _0x717ed1;});}return _0x717ed1;})['then'](respondWithStatusCode(_0x5a5028,null))[_0xdb2a('0x24')](handleError(_0x5a5028,null));};exports[_0xdb2a('0xb2')]=function(_0x472e2,_0x4b5540,_0xa1023e){_0x472e2[_0xdb2a('0x5f')][_0xdb2a('0xb3')]=_0x472e2[_0xdb2a('0xb4')][_0xdb2a('0xb5')];return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x472e2[_0xdb2a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b5540,null))['then'](saveUpdates(_0x472e2[_0xdb2a('0x5f')],null))[_0xdb2a('0x32')](respondWithResult(_0x4b5540,null))['catch'](handleError(_0x4b5540,null));};exports[_0xdb2a('0xb6')]=function(_0x1086cf,_0x3020dd,_0x56b737){var _0x27aaf5=path[_0xdb2a('0xb7')](config['root'],_0xdb2a('0xb8'));return db['User'][_0xdb2a('0x5d')]({'where':{'id':_0x1086cf[_0xdb2a('0x5a')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x3020dd,null))[_0xdb2a('0x32')](function(_0x8e8b07){if(_0x8e8b07){if(_[_0xdb2a('0x74')](_0x8e8b07[_0xdb2a('0xb3')])){return _0x3020dd[_0xdb2a('0xb9')](_0x27aaf5);}else{if(!fs[_0xdb2a('0xba')](path[_0xdb2a('0xb7')](config[_0xdb2a('0xbb')],_0xdb2a('0xbc'),_0x8e8b07[_0xdb2a('0xb3')]))){return _0x3020dd[_0xdb2a('0xb9')](_0x27aaf5);}return _0x3020dd[_0xdb2a('0xb9')](path[_0xdb2a('0xb7')](config[_0xdb2a('0xbb')],'server/files/images/',_0x8e8b07['userpic']));}}})['catch'](handleError(_0x3020dd,null));};exports[_0xdb2a('0xbd')]=function(_0x158abb,_0x20dbe2,_0x5d6112){var _0x18ea83={};var _0x136980={};var _0x1a39a9;var _0x5c3caa;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x158abb[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x20dbe2,null))['then'](function(_0x15cef8){if(_0x15cef8){_0x1a39a9=_0x15cef8;_0x136980[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db[_0xdb2a('0xbe')][_0xdb2a('0x5c')]);_0x136980[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x158abb[_0xdb2a('0x46')]);_0x136980[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x136980[_0xdb2a('0x4a')],_0x136980[_0xdb2a('0x46')]);_0x18ea83[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x136980[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x158abb[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x18ea83[_0xdb2a('0x4b')]=_0x18ea83['attributes'][_0xdb2a('0x77')]?_0x18ea83['attributes']:_0x136980[_0xdb2a('0x4a')];_0x18ea83['order']=qs[_0xdb2a('0x4f')](_0x158abb[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x18ea83[_0xdb2a('0x50')]=qs['filters'](_[_0xdb2a('0x51')](_0x158abb['query'],_0x136980['filters']));if(_0x158abb['query'][_0xdb2a('0x39')]){_0x18ea83[_0xdb2a('0x50')]=_['merge'](_0x18ea83[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x18ea83[_0xdb2a('0x4b')],function(_0x14b9b6){var _0x32fe2b={};_0x32fe2b[_0x14b9b6]={'$like':'%'+_0x158abb[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x32fe2b;})});}_0x18ea83=_[_0xdb2a('0x52')]({},_0x18ea83,_0x158abb['options']);return _0x1a39a9[_0xdb2a('0xbd')](_0x18ea83);}})['then'](function(_0x1ffdbe){if(_0x1ffdbe){_0x5c3caa=_0x1ffdbe[_0xdb2a('0x77')];if(_0x158abb['query']['hasOwnProperty'](_0xdb2a('0x56'))){_0x18ea83[_0xdb2a('0xbf')]=[{'model':db['CmList'],'as':_0xdb2a('0xc0'),'required':![]},{'model':db['Tag'],'as':_0xdb2a('0xc1'),'attributes':['id',_0xdb2a('0x3e'),_0xdb2a('0xc2')],'where':_0x158abb[_0xdb2a('0x46')]['tag']?{'id':_0x158abb[_0xdb2a('0x46')]['tag']}:undefined,'required':_0x158abb['query'][_0xdb2a('0xc3')]?!![]:![]}];}if(!_0x158abb[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x18ea83[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x158abb['query'][_0xdb2a('0x2b')]);_0x18ea83['offset']=qs['offset'](_0x158abb[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x1a39a9[_0xdb2a('0xbd')](_0x18ea83);}})['then'](function(_0x1526d7){if(_0x1526d7){return _0x1526d7?{'count':_0x5c3caa,'rows':_0x1526d7}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x20dbe2,null))[_0xdb2a('0x24')](handleError(_0x20dbe2,null));};exports[_0xdb2a('0xc4')]=function(_0x5d8197,_0x5b680a,_0x3414ae){var _0x29fb2a;var _0x424c83;var _0x569698={};var _0x43d142;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x5d8197[_0xdb2a('0x5a')]['id']},'attributes':['id',_0xdb2a('0x3e'),'role']})['then'](handleEntityNotFound(_0x5b680a,null))[_0xdb2a('0x32')](function(_0x246dd9){if(!utils['isValidChannel'](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x99')])){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0xae'));}_0x29fb2a=_0x246dd9;var _0x39dc3b={};_0x39dc3b[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db[_[_0xdb2a('0x9e')](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x99')])+_0xdb2a('0xc5')][_0xdb2a('0x5c')]);_0x39dc3b[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x5d8197['query']);_0x39dc3b[_0xdb2a('0x48')]=_['intersection'](_0x39dc3b[_0xdb2a('0x4a')],_0x39dc3b[_0xdb2a('0x46')]);_0x569698['attributes']=_[_0xdb2a('0x49')](_0x39dc3b['model'],qs[_0xdb2a('0x4c')](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x569698[_0xdb2a('0x4b')]=_0x569698[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x569698[_0xdb2a('0x4b')]:_0x39dc3b[_0xdb2a('0x4a')];_0x569698['order']=qs['sort'](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x569698['where']=qs[_0xdb2a('0x48')](_['pick'](_0x5d8197[_0xdb2a('0x46')],_0x39dc3b[_0xdb2a('0x48')]));if(_0x5d8197['query'][_0xdb2a('0x39')]){_0x569698['where']=_[_0xdb2a('0x52')](_0x569698[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x569698[_0xdb2a('0x4b')],function(_0x53826c){var _0x3915d1={};_0x3915d1[_0x53826c]={'$like':'%'+_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x3915d1;})});}_0x569698=_['merge']({},_0x569698,_0x5d8197[_0xdb2a('0x54')]);switch(_0x29fb2a[_0xdb2a('0x3d')]){case _0xdb2a('0x66'):return db[_['capitalize'](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x99')])+'Queue'][_0xdb2a('0x57')](_0x569698);case _0xdb2a('0x36'):case'agent':return _0x29fb2a[_0xdb2a('0x34')+_[_0xdb2a('0x9e')](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x99')])+'Queues'](_0x569698);default:throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))]('Unknown\x20role');}})[_0xdb2a('0x32')](function(_0x594c12){_0x43d142=_0x594c12['length'];if(!_0x5d8197[_0xdb2a('0x46')]['hasOwnProperty']('nolimit')){_0x569698[_0xdb2a('0x2b')]=qs['limit'](_0x5d8197[_0xdb2a('0x46')]['limit']);_0x569698[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x5d8197['query'][_0xdb2a('0x2a')]);}switch(_0x29fb2a[_0xdb2a('0x3d')]){case _0xdb2a('0x66'):return db[_[_0xdb2a('0x9e')](_0x5d8197[_0xdb2a('0x46')]['channel'])+_0xdb2a('0xc5')][_0xdb2a('0x57')](_0x569698);case _0xdb2a('0x36'):case'agent':return _0x29fb2a[_0xdb2a('0x34')+_[_0xdb2a('0x9e')](_0x5d8197[_0xdb2a('0x46')][_0xdb2a('0x99')])+'Queues'](_0x569698);}})[_0xdb2a('0x32')](function(_0xe5d8d9){return{'count':_0x43d142,'rows':_0xe5d8d9};})['then'](respondWithResult(_0x5b680a,null))[_0xdb2a('0x24')](handleError(_0x5b680a,null));};exports['getVoiceQueuesRt']=function(_0x461f35,_0x3eaff3,_0x1dcdf4){var _0x2698df={};var _0x196d0a={};var _0x174c59;var _0x5bdde8;return db['User'][_0xdb2a('0x8d')]({'where':{'id':_0x461f35[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x3eaff3,null))[_0xdb2a('0x32')](function(_0x4addfb){if(_0x4addfb){_0x174c59=_0x4addfb;_0x196d0a[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db['UserVoiceQueueRt'][_0xdb2a('0x5c')]);_0x196d0a[_0xdb2a('0x46')]=_['keys'](_0x461f35['query']);_0x196d0a[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x196d0a[_0xdb2a('0x4a')],_0x196d0a[_0xdb2a('0x46')]);_0x2698df['attributes']=_['intersection'](_0x196d0a[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x461f35[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x2698df['attributes']=_0x2698df[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x2698df['attributes']:_0x196d0a['model'];_0x2698df[_0xdb2a('0xc6')]=qs['sort'](_0x461f35[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x2698df[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0x461f35['query'],_0x196d0a['filters']));if(_0x461f35[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x2698df[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x2698df[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x2698df['attributes'],function(_0x2dee05){var _0x15e492={};_0x15e492[_0x2dee05]={'$like':'%'+_0x461f35[_0xdb2a('0x46')]['filter']+'%'};return _0x15e492;})});}_0x2698df=_[_0xdb2a('0x52')]({},_0x2698df,_0x461f35['options']);return _0x174c59['getVoiceQueuesRt'](_0x2698df);}})[_0xdb2a('0x32')](function(_0x3a268c){if(_0x3a268c){_0x5bdde8=_0x3a268c['length'];if(!_0x461f35[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x2698df[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x461f35[_0xdb2a('0x46')]['limit']);_0x2698df['offset']=qs[_0xdb2a('0x2a')](_0x461f35[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x174c59['getVoiceQueuesRt'](_0x2698df);}})[_0xdb2a('0x32')](function(_0x313518){if(_0x313518){return _0x313518?{'count':_0x5bdde8,'rows':_0x313518}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x3eaff3,null))[_0xdb2a('0x24')](handleError(_0x3eaff3,null));};exports[_0xdb2a('0xc7')]=function(_0x253aed,_0xc9def6,_0x1a7dd6){var _0x5e06ff={};var _0x228e56={};var _0x51355f;var _0x5806d2;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x253aed[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0xc9def6,null))[_0xdb2a('0x32')](function(_0x42cb82){if(_0x42cb82){_0x51355f=_0x42cb82;_0x228e56['model']=_[_0xdb2a('0x47')](db[_0xdb2a('0xc8')][_0xdb2a('0x5c')]);_0x228e56[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x253aed[_0xdb2a('0x46')]);_0x228e56[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x228e56[_0xdb2a('0x4a')],_0x228e56['query']);_0x5e06ff[_0xdb2a('0x4b')]=_['intersection'](_0x228e56['model'],qs[_0xdb2a('0x4c')](_0x253aed[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x5e06ff[_0xdb2a('0x4b')]=_0x5e06ff[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x5e06ff[_0xdb2a('0x4b')]:_0x228e56[_0xdb2a('0x4a')];_0x5e06ff[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x253aed[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x5e06ff[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_['pick'](_0x253aed[_0xdb2a('0x46')],_0x228e56['filters']));if(_0x253aed[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x5e06ff[_0xdb2a('0x50')]=_['merge'](_0x5e06ff[_0xdb2a('0x50')],{'$or':_['map'](_0x5e06ff[_0xdb2a('0x4b')],function(_0x547711){var _0x53816a={};_0x53816a[_0x547711]={'$like':'%'+_0x253aed[_0xdb2a('0x46')]['filter']+'%'};return _0x53816a;})});}_0x5e06ff=_[_0xdb2a('0x52')]({},_0x5e06ff,_0x253aed[_0xdb2a('0x54')]);return _0x51355f[_0xdb2a('0xc7')](_0x5e06ff);}})[_0xdb2a('0x32')](function(_0x57e43c){if(_0x57e43c){_0x5806d2=_0x57e43c[_0xdb2a('0x77')];if(!_0x253aed[_0xdb2a('0x46')]['hasOwnProperty'](_0xdb2a('0x4e'))){_0x5e06ff[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x253aed[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x5e06ff[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x253aed[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x51355f[_0xdb2a('0xc7')](_0x5e06ff);}})['then'](function(_0x3548e7){if(_0x3548e7){return _0x3548e7?{'count':_0x5806d2,'rows':_0x3548e7}:null;}})[_0xdb2a('0x32')](respondWithResult(_0xc9def6,null))[_0xdb2a('0x24')](handleError(_0xc9def6,null));};exports[_0xdb2a('0xc9')]=function(_0x5c6dcd,_0x1d35e3,_0x4a01fc){var _0x313b80={'raw':!![],'where':{}};var _0xb9c621={};var _0x1fa347={'count':0x0,'rows':[]};return db['User'][_0xdb2a('0x8d')]({'where':{'id':_0x5c6dcd['params']['id']}})['then'](handleEntityNotFound(_0x1d35e3,null))[_0xdb2a('0x32')](function(_0x4b49f1){if(_0x4b49f1){_0xb9c621[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db[_0xdb2a('0xca')][_0xdb2a('0x5c')]);_0xb9c621['query']=_['keys'](_0x5c6dcd[_0xdb2a('0x46')]);_0xb9c621[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0xb9c621[_0xdb2a('0x4a')],_0xb9c621[_0xdb2a('0x46')]);_0x313b80[_0xdb2a('0x4b')]=_['intersection'](_0xb9c621[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x5c6dcd[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x313b80[_0xdb2a('0x4b')]=_0x313b80[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x313b80[_0xdb2a('0x4b')]:_0xb9c621[_0xdb2a('0x4a')];if(!_0x5c6dcd[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x313b80[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x5c6dcd['query'][_0xdb2a('0x2b')]);_0x313b80[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x5c6dcd[_0xdb2a('0x46')]['offset']);}_0x313b80[_0xdb2a('0xc6')]=qs['sort'](_0x5c6dcd['query'][_0xdb2a('0x4f')]);_0x313b80[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_['pick'](_0x5c6dcd[_0xdb2a('0x46')],_0xb9c621['filters']));_0x313b80[_0xdb2a('0x50')]['UserId']=_0x4b49f1['id'];if(_0x5c6dcd[_0xdb2a('0x46')]['filter']){_0x313b80[_0xdb2a('0x50')]=_['merge'](_0x313b80['where'],{'$or':_['map'](_0x313b80[_0xdb2a('0x4b')],function(_0x276a89){var _0x22e27b={};_0x22e27b[_0x276a89]={'$like':'%'+_0x5c6dcd['query'][_0xdb2a('0x39')]+'%'};return _0x22e27b;})});}_0x313b80=_[_0xdb2a('0x52')]({},_0x313b80,_0x5c6dcd[_0xdb2a('0x54')]);return db[_0xdb2a('0xca')][_0xdb2a('0x29')]({'where':_0x313b80[_0xdb2a('0x50')]})[_0xdb2a('0x32')](function(_0x5a6c83){_0x1fa347['count']=_0x5a6c83;if(_0x5c6dcd[_0xdb2a('0x46')]['includeAll']){_0x313b80[_0xdb2a('0xbf')]=[{'all':!![]}];}return db[_0xdb2a('0xca')][_0xdb2a('0x57')](_0x313b80);})[_0xdb2a('0x32')](function(_0x2a9b5b){_0x1fa347['rows']=_0x2a9b5b;return _0x1fa347;});}})['then'](respondWithFilteredResult(_0x1d35e3,_0x313b80))[_0xdb2a('0x24')](handleError(_0x1d35e3,null));};exports[_0xdb2a('0xcb')]=function(_0x5d8a91,_0xf1116a,_0x28a3c5){var _0x28f717={'raw':!![],'where':{}};var _0x7bd3e8={};var _0x2a1ae5={'count':0x0,'rows':[]};return db[_0xdb2a('0x55')]['findOne']({'where':{'id':_0x5d8a91[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0xf1116a,null))[_0xdb2a('0x32')](function(_0x1a7b95){if(_0x1a7b95){_0x7bd3e8[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db['ScreenRecording']['rawAttributes']);_0x7bd3e8[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x5d8a91['query']);_0x7bd3e8[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x7bd3e8[_0xdb2a('0x4a')],_0x7bd3e8[_0xdb2a('0x46')]);_0x28f717[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x7bd3e8[_0xdb2a('0x4a')],qs['fields'](_0x5d8a91[_0xdb2a('0x46')]['fields']));_0x28f717[_0xdb2a('0x4b')]=_0x28f717['attributes'][_0xdb2a('0x77')]?_0x28f717[_0xdb2a('0x4b')]:_0x7bd3e8['model'];if(!_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x28f717[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x28f717[_0xdb2a('0x2a')]=qs['offset'](_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}_0x28f717[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x28f717[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0x5d8a91[_0xdb2a('0x46')],_0x7bd3e8['filters']));_0x28f717[_0xdb2a('0x50')][_0xdb2a('0xcc')]=_0x1a7b95['id'];if(_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x28f717['where']=_['merge'](_0x28f717[_0xdb2a('0x50')],{'$or':_['map'](_0x28f717[_0xdb2a('0x4b')],function(_0x3a92ce){var _0x5365f3={};_0x5365f3[_0x3a92ce]={'$like':'%'+_0x5d8a91[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x5365f3;})});}_0x28f717=_['merge']({},_0x28f717,_0x5d8a91[_0xdb2a('0x54')]);return db['ScreenRecording'][_0xdb2a('0x29')]({'where':_0x28f717[_0xdb2a('0x50')]})[_0xdb2a('0x32')](function(_0x30d50b){_0x2a1ae5['count']=_0x30d50b;if(_0x5d8a91[_0xdb2a('0x46')]['includeAll']){_0x28f717[_0xdb2a('0xbf')]=[{'all':!![]}];}return db['ScreenRecording'][_0xdb2a('0x57')](_0x28f717);})[_0xdb2a('0x32')](function(_0x368b2f){_0x2a1ae5[_0xdb2a('0x58')]=_0x368b2f;return _0x2a1ae5;});}})[_0xdb2a('0x32')](respondWithFilteredResult(_0xf1116a,_0x28f717))[_0xdb2a('0x24')](handleError(_0xf1116a,null));};exports[_0xdb2a('0xcd')]=function(_0x497ee5,_0x5afa56,_0x1e44ad){var _0x3e146c={};var _0x4026bf={};var _0x65ba45;var _0xe76f68;return db[_0xdb2a('0x55')]['findOne']({'where':{'id':_0x497ee5[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x5afa56,null))[_0xdb2a('0x32')](function(_0x5a54bf){if(_0x5a54bf){_0x65ba45=_0x5a54bf;_0x4026bf[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db[_0xdb2a('0xce')][_0xdb2a('0x5c')]);_0x4026bf[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x497ee5[_0xdb2a('0x46')]);_0x4026bf[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x4026bf[_0xdb2a('0x4a')],_0x4026bf[_0xdb2a('0x46')]);_0x3e146c[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x4026bf[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x497ee5['query']['fields']));_0x3e146c[_0xdb2a('0x4b')]=_0x3e146c[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x3e146c[_0xdb2a('0x4b')]:_0x4026bf[_0xdb2a('0x4a')];_0x3e146c['order']=qs[_0xdb2a('0x4f')](_0x497ee5[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x3e146c['where']=qs[_0xdb2a('0x48')](_['pick'](_0x497ee5['query'],_0x4026bf[_0xdb2a('0x48')]));if(_0x497ee5[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x3e146c['where']=_[_0xdb2a('0x52')](_0x3e146c[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x3e146c[_0xdb2a('0x4b')],function(_0x40d6a0){var _0xcfb3b3={};_0xcfb3b3[_0x40d6a0]={'$like':'%'+_0x497ee5[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0xcfb3b3;})});}_0x3e146c=_[_0xdb2a('0x52')]({},_0x3e146c,_0x497ee5[_0xdb2a('0x54')]);return _0x65ba45[_0xdb2a('0xcd')](_0x3e146c);}})[_0xdb2a('0x32')](function(_0x18a9f2){if(_0x18a9f2){_0xe76f68=_0x18a9f2[_0xdb2a('0x77')];if(!_0x497ee5['query'][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x3e146c['limit']=qs[_0xdb2a('0x2b')](_0x497ee5[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x3e146c['offset']=qs[_0xdb2a('0x2a')](_0x497ee5[_0xdb2a('0x46')]['offset']);}return _0x65ba45['getChatInteractions'](_0x3e146c);}})[_0xdb2a('0x32')](function(_0x293e20){if(_0x293e20){return _0x293e20?{'count':_0xe76f68,'rows':_0x293e20}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x5afa56,null))['catch'](handleError(_0x5afa56,null));};exports[_0xdb2a('0xcf')]=function(_0x51b45a,_0x361fe5,_0x24e1ab){var _0x357322={};var _0x275d62={};var _0x4899c9;var _0x874733;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x51b45a[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x361fe5,null))['then'](function(_0x25937f){if(_0x25937f){_0x4899c9=_0x25937f;_0x275d62['model']=_[_0xdb2a('0x47')](db[_0xdb2a('0xd0')][_0xdb2a('0x5c')]);_0x275d62[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x51b45a['query']);_0x275d62['filters']=_['intersection'](_0x275d62[_0xdb2a('0x4a')],_0x275d62[_0xdb2a('0x46')]);_0x357322[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x275d62[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x51b45a[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x357322[_0xdb2a('0x4b')]=_0x357322['attributes'][_0xdb2a('0x77')]?_0x357322[_0xdb2a('0x4b')]:_0x275d62['model'];_0x357322[_0xdb2a('0xc6')]=qs['sort'](_0x51b45a[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x357322['where']=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0x51b45a[_0xdb2a('0x46')],_0x275d62['filters']));if(_0x51b45a[_0xdb2a('0x46')]['filter']){_0x357322[_0xdb2a('0x50')]=_['merge'](_0x357322[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x357322['attributes'],function(_0x54d5bd){var _0x2b3f87={};_0x2b3f87[_0x54d5bd]={'$like':'%'+_0x51b45a['query']['filter']+'%'};return _0x2b3f87;})});}_0x357322=_[_0xdb2a('0x52')]({},_0x357322,_0x51b45a['options']);return _0x4899c9[_0xdb2a('0xcf')](_0x357322);}})[_0xdb2a('0x32')](function(_0x137a85){if(_0x137a85){_0x874733=_0x137a85[_0xdb2a('0x77')];if(!_0x51b45a[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x357322[_0xdb2a('0x2b')]=qs['limit'](_0x51b45a[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x357322[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x51b45a[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x4899c9['getOpenchannelInteractions'](_0x357322);}})[_0xdb2a('0x32')](function(_0x14c45e){if(_0x14c45e){return _0x14c45e?{'count':_0x874733,'rows':_0x14c45e}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x361fe5,null))[_0xdb2a('0x24')](handleError(_0x361fe5,null));};exports[_0xdb2a('0xd1')]=function(_0x467c11,_0xd67f9e,_0x131838){var _0x295bfb={'raw':!![],'where':{}};var _0x2543d4={};var _0x21c298={'count':0x0,'rows':[]};return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x467c11[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0xd67f9e,null))['then'](function(_0x39fcdf){if(_0x39fcdf){_0x2543d4['model']=_[_0xdb2a('0x47')](db['MailInteraction'][_0xdb2a('0x5c')]);_0x2543d4[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x467c11['query']);_0x2543d4[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x2543d4['model'],_0x2543d4[_0xdb2a('0x46')]);_0x295bfb[_0xdb2a('0x4b')]=_['intersection'](_0x2543d4[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x295bfb[_0xdb2a('0x4b')]=_0x295bfb[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x295bfb[_0xdb2a('0x4b')]:_0x2543d4['model'];if(!_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x295bfb[_0xdb2a('0x2b')]=qs['limit'](_0x467c11['query']['limit']);_0x295bfb[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}_0x295bfb[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x295bfb[_0xdb2a('0x50')]=qs['filters'](_[_0xdb2a('0x51')](_0x467c11[_0xdb2a('0x46')],_0x2543d4[_0xdb2a('0x48')]));_0x295bfb[_0xdb2a('0x50')][_0xdb2a('0xcc')]=_0x39fcdf['id'];if(_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x295bfb[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x295bfb[_0xdb2a('0x50')],{'$or':_['map'](_0x295bfb[_0xdb2a('0x4b')],function(_0x357633){var _0x47f99f={};_0x47f99f[_0x357633]={'$like':'%'+_0x467c11[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x47f99f;})});}_0x295bfb=_[_0xdb2a('0x52')]({},_0x295bfb,_0x467c11[_0xdb2a('0x54')]);return db['MailInteraction'][_0xdb2a('0x29')]({'where':_0x295bfb[_0xdb2a('0x50')]})[_0xdb2a('0x32')](function(_0x22842c){_0x21c298['count']=_0x22842c;if(_0x467c11['query'][_0xdb2a('0x56')]){_0x295bfb[_0xdb2a('0xbf')]=[{'all':!![]}];}return db[_0xdb2a('0xd2')][_0xdb2a('0x57')](_0x295bfb);})[_0xdb2a('0x32')](function(_0xd177ae){_0x21c298[_0xdb2a('0x58')]=_0xd177ae;return _0x21c298;});}})[_0xdb2a('0x32')](respondWithFilteredResult(_0xd67f9e,_0x295bfb))[_0xdb2a('0x24')](handleError(_0xd67f9e,null));};exports['getSmsInteractions']=function(_0x393b3a,_0x4e3502,_0x6fbbfc){var _0x434dd0={};var _0x10b87f={};var _0x5237b1;var _0x44b912;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x393b3a['params']['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x4e3502,null))[_0xdb2a('0x32')](function(_0x2d8160){if(_0x2d8160){_0x5237b1=_0x2d8160;_0x10b87f[_0xdb2a('0x4a')]=_['keys'](db[_0xdb2a('0xd3')][_0xdb2a('0x5c')]);_0x10b87f[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x393b3a['query']);_0x10b87f[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x10b87f['model'],_0x10b87f['query']);_0x434dd0[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x10b87f[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x393b3a[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x434dd0[_0xdb2a('0x4b')]=_0x434dd0[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x434dd0[_0xdb2a('0x4b')]:_0x10b87f['model'];_0x434dd0[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x393b3a[_0xdb2a('0x46')]['sort']);_0x434dd0[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_['pick'](_0x393b3a[_0xdb2a('0x46')],_0x10b87f['filters']));if(_0x393b3a['query'][_0xdb2a('0x39')]){_0x434dd0[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x434dd0['where'],{'$or':_['map'](_0x434dd0[_0xdb2a('0x4b')],function(_0x3543f1){var _0x58572a={};_0x58572a[_0x3543f1]={'$like':'%'+_0x393b3a[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x58572a;})});}_0x434dd0=_[_0xdb2a('0x52')]({},_0x434dd0,_0x393b3a[_0xdb2a('0x54')]);return _0x5237b1[_0xdb2a('0xd4')](_0x434dd0);}})[_0xdb2a('0x32')](function(_0x162b9b){if(_0x162b9b){_0x44b912=_0x162b9b[_0xdb2a('0x77')];if(!_0x393b3a[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x434dd0[_0xdb2a('0x2b')]=qs['limit'](_0x393b3a[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x434dd0['offset']=qs['offset'](_0x393b3a[_0xdb2a('0x46')]['offset']);}return _0x5237b1['getSmsInteractions'](_0x434dd0);}})[_0xdb2a('0x32')](function(_0x46b848){if(_0x46b848){return _0x46b848?{'count':_0x44b912,'rows':_0x46b848}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x4e3502,null))['catch'](handleError(_0x4e3502,null));};exports[_0xdb2a('0xd5')]=function(_0x145092,_0x5586a5,_0x186b59){var _0x81e281={};var _0x33e2b4={};var _0x195d05;var _0x597f5b;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x145092[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x5586a5,null))[_0xdb2a('0x32')](function(_0x20bada){if(_0x20bada){_0x195d05=_0x20bada;_0x33e2b4['model']=_[_0xdb2a('0x47')](db[_0xdb2a('0xd6')][_0xdb2a('0x5c')]);_0x33e2b4[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x145092[_0xdb2a('0x46')]);_0x33e2b4[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x33e2b4['model'],_0x33e2b4[_0xdb2a('0x46')]);_0x81e281[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x33e2b4[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x145092[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x81e281['attributes']=_0x81e281[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x81e281[_0xdb2a('0x4b')]:_0x33e2b4[_0xdb2a('0x4a')];_0x81e281[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x145092['query'][_0xdb2a('0x4f')]);_0x81e281[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0x145092[_0xdb2a('0x46')],_0x33e2b4[_0xdb2a('0x48')]));if(_0x145092[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x81e281[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x81e281[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x81e281['attributes'],function(_0x5d31bf){var _0x232463={};_0x232463[_0x5d31bf]={'$like':'%'+_0x145092[_0xdb2a('0x46')]['filter']+'%'};return _0x232463;})});}_0x81e281=_[_0xdb2a('0x52')]({},_0x81e281,_0x145092[_0xdb2a('0x54')]);return _0x195d05[_0xdb2a('0xd5')](_0x81e281);}})[_0xdb2a('0x32')](function(_0x5cc0b4){if(_0x5cc0b4){_0x597f5b=_0x5cc0b4['length'];if(!_0x145092[_0xdb2a('0x46')]['hasOwnProperty']('nolimit')){_0x81e281['limit']=qs[_0xdb2a('0x2b')](_0x145092[_0xdb2a('0x46')][_0xdb2a('0x2b')]);_0x81e281['offset']=qs['offset'](_0x145092[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x195d05[_0xdb2a('0xd5')](_0x81e281);}})[_0xdb2a('0x32')](function(_0x4fcd8d){if(_0x4fcd8d){return _0x4fcd8d?{'count':_0x597f5b,'rows':_0x4fcd8d}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x5586a5,null))[_0xdb2a('0x24')](handleError(_0x5586a5,null));};exports['getWhatsappInteractions']=function(_0x489289,_0x590f7f,_0x244229){var _0x11add0={};var _0x1bbe17={};var _0xefa382;var _0x56f084;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x489289[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x590f7f,null))[_0xdb2a('0x32')](function(_0x432968){if(_0x432968){_0xefa382=_0x432968;_0x1bbe17['model']=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x1bbe17[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x489289[_0xdb2a('0x46')]);_0x1bbe17['filters']=_[_0xdb2a('0x49')](_0x1bbe17[_0xdb2a('0x4a')],_0x1bbe17[_0xdb2a('0x46')]);_0x11add0[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x1bbe17[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x489289[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x11add0[_0xdb2a('0x4b')]=_0x11add0[_0xdb2a('0x4b')]['length']?_0x11add0['attributes']:_0x1bbe17[_0xdb2a('0x4a')];_0x11add0['order']=qs['sort'](_0x489289[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x11add0[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_[_0xdb2a('0x51')](_0x489289[_0xdb2a('0x46')],_0x1bbe17[_0xdb2a('0x48')]));if(_0x489289[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x11add0[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x11add0[_0xdb2a('0x50')],{'$or':_[_0xdb2a('0x3b')](_0x11add0['attributes'],function(_0x2686d2){var _0x41478a={};_0x41478a[_0x2686d2]={'$like':'%'+_0x489289[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x41478a;})});}_0x11add0=_['merge']({},_0x11add0,_0x489289['options']);return _0xefa382[_0xdb2a('0xd7')](_0x11add0);}})[_0xdb2a('0x32')](function(_0x142149){if(_0x142149){_0x56f084=_0x142149[_0xdb2a('0x77')];if(!_0x489289[_0xdb2a('0x46')]['hasOwnProperty'](_0xdb2a('0x4e'))){_0x11add0[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x489289[_0xdb2a('0x46')]['limit']);_0x11add0[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x489289['query'][_0xdb2a('0x2a')]);}return _0xefa382['getWhatsappInteractions'](_0x11add0);}})['then'](function(_0x368c27){if(_0x368c27){return _0x368c27?{'count':_0x56f084,'rows':_0x368c27}:null;}})['then'](respondWithResult(_0x590f7f,null))[_0xdb2a('0x24')](handleError(_0x590f7f,null));};exports[_0xdb2a('0xd8')]=function(_0x5396eb,_0x517089,_0x38eed4){var _0x1d2171;var _0x1e7b94;var _0x46f859;var _0x5bcb5d=!_[_0xdb2a('0x74')](_0x5396eb[_0xdb2a('0x5a')]['id'])?_0x5396eb[_0xdb2a('0x5a')]['id']:!_[_0xdb2a('0x74')](_0x5396eb[_0xdb2a('0x36')]['id'])?_0x5396eb[_0xdb2a('0x36')]['id']:null;return db[_0xdb2a('0x55')]['find']({'where':{'id':_0x5bcb5d,'role':{'$or':[_0xdb2a('0x66'),_0xdb2a('0x36'),_0xdb2a('0x88')]}},'attributes':['id','name','phone',_0xdb2a('0xd9'),_0xdb2a('0x3d'),_0xdb2a('0x6e'),_0xdb2a('0x9b')]})[_0xdb2a('0x32')](function(_0x474e84){if(_0x474e84){if(_0x474e84[_0xdb2a('0x3d')]===_0xdb2a('0x88')){_0x1d2171=_0x474e84;if(_0x5396eb[_0xdb2a('0x5f')][_0xdb2a('0x9c')]){_0x46f859=util[_0xdb2a('0x6b')](_0xdb2a('0xda'),_0x1d2171[_0x5396eb[_0xdb2a('0x5f')][_0xdb2a('0x9c')]]);}else if(_0x5396eb[_0xdb2a('0x5f')][_0xdb2a('0xdb')]){_0x46f859=util['format'](_0xdb2a('0xa8'),_0x5396eb['body'][_0xdb2a('0xdb')]);}else{_0x46f859=util[_0xdb2a('0x6b')]('SIP/%s',_0x1d2171['name']);}socket['to'](util[_0xdb2a('0x6b')](_0xdb2a('0xdc'),_0x1d2171[_0xdb2a('0x3e')]))['emit'](_0xdb2a('0xdd'),{'ip':_0x5396eb[_0xdb2a('0xde')][_0xdb2a('0xdf')]||_0x5396eb[_0xdb2a('0xe0')][_0xdb2a('0xe1')]||_0x5396eb[_0xdb2a('0xe2')][_0xdb2a('0xe1')]||_0x5396eb[_0xdb2a('0xe0')][_0xdb2a('0xe2')][_0xdb2a('0xe1')]});return db[_0xdb2a('0xb1')][_0xdb2a('0x33')]({'where':{'membername':_0x1d2171[_0xdb2a('0x3e')]},'individualHooks':!![]});}}else{throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0xe3'));}})[_0xdb2a('0x32')](function(){if(_0x1d2171){return _0x1d2171['getVoiceQueues']({'raw':!![]});}})[_0xdb2a('0x32')](function(_0x3e68b6){if(_0x1d2171){var _0x4b9aa4=[];if(_0x3e68b6){_0x1e7b94=_0x3e68b6;if(_0x1e7b94[_0xdb2a('0x77')]){for(var _0x36262c=0x0;_0x36262c<_0x1e7b94['length'];_0x36262c++){_0x4b9aa4['push']({'membername':_0x1d2171['name'],'UserId':_0x1d2171['id'],'queue_name':_0x1e7b94[_0x36262c][_0xdb2a('0x3e')],'VoiceQueueId':_0x1e7b94[_0x36262c]['id'],'interface':_0x46f859,'paused':_0x1d2171['loginInPause']||![],'penalty':_0x1e7b94[_0x36262c][_0xdb2a('0xe4')]||0x0});}return BPromise[_0xdb2a('0xaa')](_0x4b9aa4,function(_0x122884){return db[_0xdb2a('0xb1')][_0xdb2a('0xab')](_0x122884);});}}}})[_0xdb2a('0x32')](function(){if(_0x1d2171){return db[_0xdb2a('0xe5')][_0xdb2a('0x57')]({'where':{'membername':_0x1d2171['name'],'exitAt':null}});}})[_0xdb2a('0x32')](function(_0x284754){if(_0x1d2171){var _0x20fd7e=[];_0x284754['forEach'](function(_0x33fdc4){_0x20fd7e[_0xdb2a('0xa7')](_0x33fdc4['update']({'exitAt':moment()[_0xdb2a('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x20fd7e);}})['then'](function(){if(_0x1d2171){var _0x2b4c08=[];var _0x438ced=[];var _0x57b6ce=utils[_0xdb2a('0xe6')]();var _0x50c366={'membername':_0x1d2171['name'],'interface':_0x46f859,'enterAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7')),'role':_0x1d2171[_0xdb2a('0x3d')],'internal':_0x1d2171['internal']};_0x57b6ce['forEach'](function(_0x1a02b4){_0x2b4c08[_0xdb2a('0xa7')](_[_0xdb2a('0x52')]({'channel':_0x1a02b4,'type':_0xdb2a('0xe8'),'data1':_0x5396eb[_0xdb2a('0x5f')][_0xdb2a('0xe9')],'data2':_0x46f859},_0x50c366));if(_0x1d2171[_0xdb2a('0x9b')]){_0x438ced[_0xdb2a('0xa7')](_[_0xdb2a('0x52')]({'channel':_0x1a02b4,'type':_0xdb2a('0xea'),'data1':_0xdb2a('0xeb')},_0x50c366));}});return db[_0xdb2a('0xe5')][_0xdb2a('0x5e')](_0x2b4c08[_0xdb2a('0xec')](_0x438ced),{'individualHooks':!![]});}})[_0xdb2a('0x32')](function(){if(_0x1d2171){return _0x1d2171['update']({'online':!![],'lastLoginAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7')),'voicePause':_0x1d2171['loginInPause']||![],'mailPause':_0x1d2171[_0xdb2a('0x9b')]||![],'chatPause':_0x1d2171['loginInPause']||![],'faxPause':_0x1d2171['loginInPause']||![],'smsPause':_0x1d2171[_0xdb2a('0x9b')]||![],'openchannelPause':_0x1d2171[_0xdb2a('0x9b')]||![],'whatsappPause':_0x1d2171[_0xdb2a('0x9b')]||![],'pauseType':_0x1d2171[_0xdb2a('0x9b')]?_0xdb2a('0xeb'):null,'interface':_0x46f859,'lastPauseAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7'))});}})[_0xdb2a('0x32')](function(_0x210f88){if(_0x5396eb[_0xdb2a('0xed')]){return _0x38eed4();}else{return BPromise[_0xdb2a('0xee')](_0x210f88)[_0xdb2a('0x32')](respondWithResult(_0x517089,null));}})[_0xdb2a('0x24')](handleError(_0x517089,null));};exports[_0xdb2a('0xef')]=function(_0x123b4e,_0x262e2f,_0xc64ee1){var _0x2bfdde;return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x123b4e[_0xdb2a('0x5a')]['id'],'role':_0xdb2a('0x88')},'attributes':['id',_0xdb2a('0x3e'),_0xdb2a('0x3d')]})['then'](handleEntityNotFound(_0x262e2f,null))[_0xdb2a('0x32')](function(_0x52cab8){if(_0x52cab8){_0x2bfdde=_0x52cab8;return db[_0xdb2a('0xb1')][_0xdb2a('0x33')]({'where':{'membername':_0x2bfdde[_0xdb2a('0x3e')]},'individualHooks':!![]});}})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0xe5')]['findAll']({'where':{'membername':_0x2bfdde[_0xdb2a('0x3e')],'exitAt':null}});})[_0xdb2a('0x32')](function(_0x24b236){var _0x1f0552=[];_0x24b236[_0xdb2a('0xf0')](function(_0x3695a7){_0x1f0552[_0xdb2a('0xa7')](_0x3695a7[_0xdb2a('0x31')]({'exitAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7'))}));});return BPromise[_0xdb2a('0xf1')](_0x1f0552);})[_0xdb2a('0x32')](function(){return _0x2bfdde[_0xdb2a('0x31')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x262e2f,null))[_0xdb2a('0x24')](handleError(_0x262e2f,null));};exports[_0xdb2a('0xf2')]=function(_0x1b84a4,_0x78a3b5,_0x33f379){var _0x39f8dc;return db[_0xdb2a('0xb1')]['update']({'paused':0x1},{'where':{'UserId':_0x1b84a4[_0xdb2a('0x5a')]['id']},'individualHooks':!![]})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x1b84a4[_0xdb2a('0x5a')]['id'],'role':_0xdb2a('0x88')},'attributes':['id',_0xdb2a('0x3e'),_0xdb2a('0x3d'),_0xdb2a('0x6e'),'interface']});})[_0xdb2a('0x32')](handleEntityNotFound(_0x78a3b5,null))['then'](function(_0x12d098){if(_0x12d098){_0x39f8dc=_0x12d098;return respondWithRpcPromise(_0xdb2a('0xf3'),_0xdb2a('0xf2'),{'id':_0x39f8dc['id'],'name':_0x39f8dc['name'],'pause':!![]});}})[_0xdb2a('0x32')](function(){if(_0x39f8dc){return db[_0xdb2a('0xe5')]['findAll']({'where':{'membername':_0x39f8dc[_0xdb2a('0x3e')],'type':_0xdb2a('0xea'),'exitAt':null}});}})[_0xdb2a('0x32')](function(_0x5a1a11){if(_0x5a1a11[_0xdb2a('0x77')]){var _0x3721cf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1f2d7f=0x0,_0x439a2a=_0x5a1a11[_0xdb2a('0x77')];_0x1f2d7f<_0x439a2a;_0x1f2d7f++){_0x5a1a11[_0x1f2d7f][_0xdb2a('0xf4')]({'exitAt':_0x3721cf});}}})[_0xdb2a('0x32')](function(){var _0x3683e7=[];var _0x577335=utils[_0xdb2a('0xe6')]();_0x577335['forEach'](function(_0x4793e){_0x3683e7['push']({'channel':_0x4793e,'membername':_0x39f8dc[_0xdb2a('0x3e')],'interface':_[_0xdb2a('0x74')](_0x39f8dc[_0xdb2a('0x9c')])?util[_0xdb2a('0x6b')]('SIP/%s',_0x39f8dc[_0xdb2a('0x3e')]):_0x39f8dc[_0xdb2a('0x9c')],'type':_0xdb2a('0xea'),'enterAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7')),'data1':_0x1b84a4[_0xdb2a('0x5f')][_0xdb2a('0x43')]||_0xdb2a('0xf5'),'role':_0x39f8dc['role'],'internal':_0x39f8dc[_0xdb2a('0x6e')]});});return db['MemberReport']['bulkCreate'](_0x3683e7,{'individualHooks':!![]});})[_0xdb2a('0x32')](function(){return _0x39f8dc[_0xdb2a('0x31')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1b84a4[_0xdb2a('0x5f')][_0xdb2a('0x43')]||_0xdb2a('0xf5'),'lastPauseAt':moment()[_0xdb2a('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdb2a('0x32')](respondWithResult(_0x78a3b5,null))[_0xdb2a('0x24')](handleError(_0x78a3b5,null));};exports[_0xdb2a('0xf6')]=function(_0x3cecd2,_0x38cea4,_0x39a869){var _0x1b86b8;return db[_0xdb2a('0x55')]['find']({'where':{'id':_0x3cecd2['params']['id']},'attributes':['id','name',_0xdb2a('0x3d'),_0xdb2a('0xa9'),_0xdb2a('0xf7'),_0xdb2a('0xf8'),_0xdb2a('0xf9'),_0xdb2a('0xfa'),_0xdb2a('0xfb'),_0xdb2a('0xfc'),'pauseType',_0xdb2a('0xfd')]})[_0xdb2a('0x32')](handleEntityNotFound(_0x38cea4,null))[_0xdb2a('0x32')](function(_0x3a391b){if(_0x3a391b){_0x1b86b8=_0x3a391b;if(_0x3cecd2[_0xdb2a('0x5f')]['channel']&&!utils['isValidChannel'](_0x3cecd2['body'][_0xdb2a('0x99')])){throw new db[(_0xdb2a('0x8f'))][(_0xdb2a('0x90'))](_0xdb2a('0xae'));}switch(_0x3cecd2[_0xdb2a('0x5f')][_0xdb2a('0x99')]){case _0xdb2a('0xa5'):return respondWithRpcPromise(_0xdb2a('0xf3'),'unpause',{'id':_0x1b86b8['id'],'name':_0x1b86b8[_0xdb2a('0x3e')],'pause':![]})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0xb1')][_0xdb2a('0x31')]({'paused':0x0},{'where':{'UserId':_0x1b86b8['id']},'individualHooks':!![]});})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0xe5')][_0xdb2a('0x5d')]({'where':{'channel':_0x3cecd2[_0xdb2a('0x5f')]['channel'],'membername':_0x1b86b8['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x390662){if(_0x390662){return _0x390662[_0xdb2a('0x31')]({'exitAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7')),'data2':_0xdb2a('0xfe')},{'individualHooks':!![]});}return null;})[_0xdb2a('0x32')](function(){return _0x1b86b8['update']({'voicePause':![]});});case _0xdb2a('0xff'):case'chat':case'fax':case'sms':case _0xdb2a('0x100'):case _0xdb2a('0x101'):return db['MemberReport'][_0xdb2a('0x5d')]({'where':{'channel':_0x3cecd2[_0xdb2a('0x5f')]['channel'],'membername':_0x1b86b8[_0xdb2a('0x3e')],'type':_0xdb2a('0xea'),'exitAt':null}})[_0xdb2a('0x32')](function(_0x393d67){if(_0x393d67){return _0x393d67[_0xdb2a('0x31')]({'exitAt':moment()[_0xdb2a('0x6b')](_0xdb2a('0xe7')),'data2':_0xdb2a('0xfe')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x33cad2={};_['set'](_0x33cad2,util[_0xdb2a('0x6b')](_0xdb2a('0x102'),_0x3cecd2[_0xdb2a('0x5f')]['channel'],_0xdb2a('0x103')),![]);return _0x1b86b8[_0xdb2a('0x31')](_0x33cad2);});default:return respondWithRpcPromise(_0xdb2a('0xf3'),_0xdb2a('0xf6'),{'id':_0x1b86b8['id'],'name':_0x1b86b8[_0xdb2a('0x3e')],'pause':![]})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0xb1')]['update']({'paused':0x0},{'where':{'UserId':_0x1b86b8['id']}});})[_0xdb2a('0x32')](function(){return db[_0xdb2a('0xe5')]['findAll']({'where':{'membername':_0x1b86b8['name'],'type':_0xdb2a('0xea'),'exitAt':null}});})['then'](function(_0x53cd8b){var _0xa375b7=[];_0x53cd8b['forEach'](function(_0x2b6b0b){_0xa375b7['push'](_0x2b6b0b[_0xdb2a('0x31')]({'exitAt':moment()['format'](_0xdb2a('0xe7')),'data2':_0xdb2a('0xfe')}));});return BPromise[_0xdb2a('0xf1')](_0xa375b7);})[_0xdb2a('0x32')](function(){return _0x1b86b8[_0xdb2a('0x31')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x38cea4,null))['catch'](handleError(_0x38cea4,null));};exports[_0xdb2a('0x104')]=function(_0x59e146,_0x16d904,_0x48f345){var _0x4a42ee={};var _0x43cb65={};var _0x4d02e7;var _0x48e0bc;return db['User']['findOne']({'where':{'id':_0x59e146['params']['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x16d904,null))[_0xdb2a('0x32')](function(_0x75e474){if(_0x75e474){_0x4d02e7=_0x75e474;_0x43cb65[_0xdb2a('0x4a')]=_[_0xdb2a('0x47')](db['Team'][_0xdb2a('0x5c')]);_0x43cb65[_0xdb2a('0x46')]=_['keys'](_0x59e146[_0xdb2a('0x46')]);_0x43cb65[_0xdb2a('0x48')]=_['intersection'](_0x43cb65[_0xdb2a('0x4a')],_0x43cb65[_0xdb2a('0x46')]);_0x4a42ee[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x43cb65[_0xdb2a('0x4a')],qs[_0xdb2a('0x4c')](_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x4a42ee[_0xdb2a('0x4b')]=_0x4a42ee[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x4a42ee['attributes']:_0x43cb65[_0xdb2a('0x4a')];_0x4a42ee[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x4a42ee[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_['pick'](_0x59e146[_0xdb2a('0x46')],_0x43cb65[_0xdb2a('0x48')]));if(_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x4a42ee[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x4a42ee[_0xdb2a('0x50')],{'$or':_['map'](_0x4a42ee[_0xdb2a('0x4b')],function(_0x23cd6b){var _0x101719={};_0x101719[_0x23cd6b]={'$like':'%'+_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0x101719;})});}_0x4a42ee=_[_0xdb2a('0x52')]({},_0x4a42ee,_0x59e146[_0xdb2a('0x54')]);return _0x4d02e7[_0xdb2a('0x104')](_0x4a42ee);}})[_0xdb2a('0x32')](function(_0x27180b){if(_0x27180b){_0x48e0bc=_0x27180b[_0xdb2a('0x77')];if(!_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x4a42ee[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x59e146['query'][_0xdb2a('0x2b')]);_0x4a42ee[_0xdb2a('0x2a')]=qs['offset'](_0x59e146[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x4d02e7[_0xdb2a('0x104')](_0x4a42ee);}})[_0xdb2a('0x32')](function(_0x5569ee){if(_0x5569ee){return _0x5569ee?{'count':_0x48e0bc,'rows':_0x5569ee}:null;}})[_0xdb2a('0x32')](respondWithResult(_0x16d904,null))[_0xdb2a('0x24')](handleError(_0x16d904,null));};exports['addTeams']=function(_0x38c741,_0x4ddd39){return db[_0xdb2a('0x55')][_0xdb2a('0x5d')]({'where':{'id':_0x38c741[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x4ddd39,null))['then'](function(_0x4cbcd6){if(_0x4cbcd6){var _0x276669=_0x4cbcd6[_0xdb2a('0x34')]({'plain':!![]});return _0x4cbcd6['addTeams'](_0x38c741[_0xdb2a('0x5f')][_0xdb2a('0x62')],_[_0xdb2a('0x63')](_0x38c741[_0xdb2a('0x5f')],['ids','id'])||{})[_0xdb2a('0x32')](function(){for(var _0x12c866=0x0;_0x12c866<_0x38c741[_0xdb2a('0x5f')][_0xdb2a('0x62')][_0xdb2a('0x77')];_0x12c866++){var _0x5c42ed=[];db[_0xdb2a('0x105')][_0xdb2a('0x8d')]({'where':{'id':_0x38c741[_0xdb2a('0x5f')]['ids'][_0x12c866]}})[_0xdb2a('0x32')](function(_0x4c25fe){_0x5c42ed[_0xdb2a('0xa7')](_0x4c25fe[_0xdb2a('0x106')]()[_0xdb2a('0x32')](function(_0x258d65){for(var _0x5f49d1=0x0;_0x5f49d1<_0x258d65[_0xdb2a('0x77')];_0x5f49d1++){_0x258d65[_0x5f49d1][_0xdb2a('0x107')]('channel',_0xdb2a('0x108'));}return _0x258d65;}));_0x5c42ed[_0xdb2a('0xa7')](_0x4c25fe[_0xdb2a('0x109')]()[_0xdb2a('0x32')](function(_0x375f00){for(var _0x3ba98a=0x0;_0x3ba98a<_0x375f00['length'];_0x3ba98a++){_0x375f00[_0x3ba98a][_0xdb2a('0x107')]('channel',_0xdb2a('0x10a'));}return _0x375f00;}));_0x5c42ed['push'](_0x4c25fe['getMailQueues']()['then'](function(_0x25cbc9){for(var _0x440aac=0x0;_0x440aac<_0x25cbc9[_0xdb2a('0x77')];_0x440aac++){_0x25cbc9[_0x440aac][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x10b'));}return _0x25cbc9;}));_0x5c42ed[_0xdb2a('0xa7')](_0x4c25fe[_0xdb2a('0x10c')]()[_0xdb2a('0x32')](function(_0x3d7bc4){for(var _0xc48310=0x0;_0xc48310<_0x3d7bc4[_0xdb2a('0x77')];_0xc48310++){_0x3d7bc4[_0xc48310][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x10d'));}return _0x3d7bc4;}));_0x5c42ed[_0xdb2a('0xa7')](_0x4c25fe[_0xdb2a('0x10e')]()[_0xdb2a('0x32')](function(_0x1f39dc){for(var _0x310c7e=0x0;_0x310c7e<_0x1f39dc[_0xdb2a('0x77')];_0x310c7e++){_0x1f39dc[_0x310c7e][_0xdb2a('0x107')]('channel',_0xdb2a('0x10f'));}return _0x1f39dc;}));_0x5c42ed['push'](_0x4c25fe[_0xdb2a('0x110')]()['then'](function(_0x25f7bd){for(var _0x4845b6=0x0;_0x4845b6<_0x25f7bd[_0xdb2a('0x77')];_0x4845b6++){_0x25f7bd[_0x4845b6]['setDataValue'](_0xdb2a('0x99'),_0xdb2a('0x111'));}return _0x25f7bd;}));_0x5c42ed[_0xdb2a('0xa7')](_0x4c25fe[_0xdb2a('0x112')]()[_0xdb2a('0x32')](function(_0x1b9674){for(var _0x559c0d=0x0;_0x559c0d<_0x1b9674['length'];_0x559c0d++){_0x1b9674[_0x559c0d]['setDataValue'](_0xdb2a('0x99'),_0xdb2a('0x113'));}return _0x1b9674;}));return BPromise[_0xdb2a('0xf1')](_0x5c42ed);})[_0xdb2a('0x32')](function(_0x20c602){var _0x317625=_['flatten'](_0x20c602);_0x5c42ed=[];return db[_0xdb2a('0x53')][_0xdb2a('0x114')](function(_0x3c278d){for(var _0x2b181a=0x0;_0x2b181a<_0x317625['length'];_0x2b181a++){_0x5c42ed[_0xdb2a('0xa7')](_0x317625[_0x2b181a][_0xdb2a('0x115')](_0x276669['id']),{'transaction':_0x3c278d});}return BPromise[_0xdb2a('0xf1')](_0x5c42ed)[_0xdb2a('0x32')](function(){if(_0x276669[_0xdb2a('0x9a')]){return BPromise[_0xdb2a('0xaa')](_['filter'](_0x317625,function(_0x238a59){return _0x238a59[_0xdb2a('0x116')](_0xdb2a('0x99'))===_0xdb2a('0x108');}),function(_0x1fbcc7){return db['UserVoiceQueueRt'][_0xdb2a('0xab')]({'membername':_0x276669[_0xdb2a('0x3e')],'UserId':_0x276669['id'],'queue_name':_0x1fbcc7['name'],'VoiceQueueId':_0x1fbcc7['id'],'interface':_[_0xdb2a('0x74')](_0x276669[_0xdb2a('0x9c')])?util['format'](_0xdb2a('0xa8'),_0x276669[_0xdb2a('0x3e')]):_0x276669['interface'],'paused':_0x276669[_0xdb2a('0xa9')]||![],'penalty':_0x276669[_0xdb2a('0xa0')]},{'transaction':_0x3c278d});});}else{return;}})[_0xdb2a('0x32')](function(){for(var _0x11170e=0x0;_0x11170e<_0x317625[_0xdb2a('0x77')];_0x11170e++){var _0x40caba=_0x317625[_0x11170e][_0xdb2a('0x116')](_0xdb2a('0x99'));var _0x2f8fc8=_0x40caba+_0xdb2a('0xa2');socket['emit'](_0xdb2a('0x36')+_0x40caba+'Queue:save',{'UserId':_0x276669['id'],['queueField']:_0x317625[_0x11170e]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x4ddd39,null))[_0xdb2a('0x24')](handleError(_0x4ddd39,null));};exports['removeTeams']=function(_0x146df3,_0x1426a5){return db[_0xdb2a('0x55')]['findOne']({'where':{'id':_0x146df3['params']['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x1426a5,null))[_0xdb2a('0x32')](function(_0x27d63b){if(_0x27d63b){var _0x318160=_0x27d63b['get']({'plain':!![]});var _0x16f2a2=_0x146df3['query']['ids'];return _0x27d63b[_0xdb2a('0x117')](_0x16f2a2)[_0xdb2a('0x32')](function(){for(var _0x3fe0e3=0x0;_0x3fe0e3<_0x16f2a2[_0xdb2a('0x77')];_0x3fe0e3++){var _0x1d1d2f=[];db['Team'][_0xdb2a('0x8d')]({'where':{'id':_0x16f2a2[_0x3fe0e3]}})[_0xdb2a('0x32')](function(_0x3ee821){_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x106')]()[_0xdb2a('0x32')](function(_0x45e4f0){for(var _0x4650be=0x0;_0x4650be<_0x45e4f0['length'];_0x4650be++){_0x45e4f0[_0x4650be][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x108'));}return _0x45e4f0;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x109')]()['then'](function(_0x39f321){for(var _0x47f082=0x0;_0x47f082<_0x39f321[_0xdb2a('0x77')];_0x47f082++){_0x39f321[_0x47f082][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x10a'));}return _0x39f321;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x118')]()['then'](function(_0x575b7f){for(var _0x4d6931=0x0;_0x4d6931<_0x575b7f[_0xdb2a('0x77')];_0x4d6931++){_0x575b7f[_0x4d6931][_0xdb2a('0x107')](_0xdb2a('0x99'),'Mail');}return _0x575b7f;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821['getSmsQueues']()[_0xdb2a('0x32')](function(_0x2bfc3f){for(var _0xf3d782=0x0;_0xf3d782<_0x2bfc3f[_0xdb2a('0x77')];_0xf3d782++){_0x2bfc3f[_0xf3d782][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x10d'));}return _0x2bfc3f;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x10e')]()['then'](function(_0x3748ac){for(var _0x234178=0x0;_0x234178<_0x3748ac['length'];_0x234178++){_0x3748ac[_0x234178][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x10f'));}return _0x3748ac;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x110')]()[_0xdb2a('0x32')](function(_0x662adf){for(var _0xc147b7=0x0;_0xc147b7<_0x662adf[_0xdb2a('0x77')];_0xc147b7++){_0x662adf[_0xc147b7]['setDataValue'](_0xdb2a('0x99'),_0xdb2a('0x111'));}return _0x662adf;}));_0x1d1d2f[_0xdb2a('0xa7')](_0x3ee821[_0xdb2a('0x112')]()[_0xdb2a('0x32')](function(_0x2a600a){for(var _0x2e25a6=0x0;_0x2e25a6<_0x2a600a[_0xdb2a('0x77')];_0x2e25a6++){_0x2a600a[_0x2e25a6][_0xdb2a('0x107')](_0xdb2a('0x99'),_0xdb2a('0x113'));}return _0x2a600a;}));return BPromise['all'](_0x1d1d2f);})[_0xdb2a('0x32')](function(_0x2932a5){var _0x14f0d9=_[_0xdb2a('0x119')](_0x2932a5);_0x1d1d2f=[];return db[_0xdb2a('0x53')]['transaction'](function(_0x1bcba7){for(var _0x166fc3=0x0;_0x166fc3<_0x14f0d9[_0xdb2a('0x77')];_0x166fc3++){_0x1d1d2f[_0xdb2a('0xa7')](_0x14f0d9[_0x166fc3][_0xdb2a('0x11a')](_0x318160['id']),{'transaction':_0x1bcba7});}return BPromise[_0xdb2a('0xf1')](_0x1d1d2f)['then'](function(){if(_0x318160[_0xdb2a('0x9a')]){return BPromise['each'](_[_0xdb2a('0x39')](_0x14f0d9,function(_0x1be467){return _0x1be467[_0xdb2a('0x116')](_0xdb2a('0x99'))==='Voice';}),function(_0x84b156){return db[_0xdb2a('0xb1')][_0xdb2a('0x33')]({'where':{'VoiceQueueId':_0x84b156['id'],'UserId':_0x318160['id']},'transaction':_0x1bcba7});});}else{return;}})['then'](function(){for(var _0x3a9de3=0x0;_0x3a9de3<_0x14f0d9[_0xdb2a('0x77')];_0x3a9de3++){var _0x2b2f79=_0x14f0d9[_0x3a9de3][_0xdb2a('0x116')](_0xdb2a('0x99'));var _0x1adb5d=_0x2b2f79+_0xdb2a('0xa2');socket[_0xdb2a('0xa3')](_0xdb2a('0x36')+_0x2b2f79+'Queue:remove',{'UserId':_0x318160['id'],['queueField']:_0x14f0d9[_0x3a9de3]['id']});}});});});}});}})[_0xdb2a('0x32')](respondWithStatusCode(_0x1426a5,null))[_0xdb2a('0x24')](handleError(_0x1426a5,null));};exports[_0xdb2a('0x11b')]=function(_0x50ece4,_0x35246b,_0x28e95d){var _0x171163={};var _0x568462={};var _0x486f40;var _0x5dab31;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x50ece4[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x35246b,null))[_0xdb2a('0x32')](function(_0x388288){if(_0x388288){_0x486f40=_0x388288;_0x568462['model']=_[_0xdb2a('0x47')](db[_0xdb2a('0x11c')][_0xdb2a('0x5c')]);_0x568462[_0xdb2a('0x46')]=_[_0xdb2a('0x47')](_0x50ece4[_0xdb2a('0x46')]);_0x568462[_0xdb2a('0x48')]=_[_0xdb2a('0x49')](_0x568462[_0xdb2a('0x4a')],_0x568462['query']);_0x171163['attributes']=_[_0xdb2a('0x49')](_0x568462['model'],qs[_0xdb2a('0x4c')](_0x50ece4[_0xdb2a('0x46')]['fields']));_0x171163['attributes']=_0x171163[_0xdb2a('0x4b')][_0xdb2a('0x77')]?_0x171163['attributes']:_0x568462[_0xdb2a('0x4a')];_0x171163[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x50ece4[_0xdb2a('0x46')]['sort']);_0x171163[_0xdb2a('0x50')]=qs[_0xdb2a('0x48')](_['pick'](_0x50ece4[_0xdb2a('0x46')],_0x568462[_0xdb2a('0x48')]));if(_0x50ece4[_0xdb2a('0x46')]['filter']){_0x171163['where']=_[_0xdb2a('0x52')](_0x171163['where'],{'$or':_['map'](_0x171163['attributes'],function(_0x56ea63){var _0xf72003={};_0xf72003[_0x56ea63]={'$like':'%'+_0x50ece4['query']['filter']+'%'};return _0xf72003;})});}_0x171163=_['merge']({},_0x171163,_0x50ece4['options']);return _0x486f40[_0xdb2a('0x11b')](_0x171163);}})[_0xdb2a('0x32')](function(_0x572e50){if(_0x572e50){_0x5dab31=_0x572e50[_0xdb2a('0x77')];if(!_0x50ece4[_0xdb2a('0x46')][_0xdb2a('0x4d')](_0xdb2a('0x4e'))){_0x171163[_0xdb2a('0x2b')]=qs[_0xdb2a('0x2b')](_0x50ece4[_0xdb2a('0x46')]['limit']);_0x171163[_0xdb2a('0x2a')]=qs[_0xdb2a('0x2a')](_0x50ece4[_0xdb2a('0x46')][_0xdb2a('0x2a')]);}return _0x486f40['getLists'](_0x171163);}})[_0xdb2a('0x32')](function(_0x4e7c05){if(_0x4e7c05){return _0x4e7c05?{'count':_0x5dab31,'rows':_0x4e7c05}:null;}})['then'](respondWithResult(_0x35246b,null))[_0xdb2a('0x24')](handleError(_0x35246b,null));};exports[_0xdb2a('0x11d')]=function(_0x38614e,_0x5bf0d5,_0x2a3cb5){var _0x53d380={};var _0x228d7b={};var _0x4f1bf7;var _0x5496ce;return db[_0xdb2a('0x55')][_0xdb2a('0x8d')]({'where':{'id':_0x38614e[_0xdb2a('0x5a')]['id']}})[_0xdb2a('0x32')](handleEntityNotFound(_0x5bf0d5,null))[_0xdb2a('0x32')](function(_0x1c9848){if(_0x1c9848){_0x4f1bf7=_0x1c9848;_0x228d7b['model']=_['keys'](db[_0xdb2a('0x55')][_0xdb2a('0x5c')]);_0x228d7b['query']=_['keys'](_0x38614e['query']);_0x228d7b['filters']=_[_0xdb2a('0x49')](_0x228d7b[_0xdb2a('0x4a')],_0x228d7b[_0xdb2a('0x46')]);_0x53d380[_0xdb2a('0x4b')]=_[_0xdb2a('0x49')](_0x228d7b['model'],qs[_0xdb2a('0x4c')](_0x38614e[_0xdb2a('0x46')][_0xdb2a('0x4c')]));_0x53d380['attributes']=_0x53d380[_0xdb2a('0x4b')]['length']?_0x53d380[_0xdb2a('0x4b')]:_0x228d7b[_0xdb2a('0x4a')];_0x53d380[_0xdb2a('0xc6')]=qs[_0xdb2a('0x4f')](_0x38614e[_0xdb2a('0x46')][_0xdb2a('0x4f')]);_0x53d380['where']=qs[_0xdb2a('0x48')](_['pick'](_0x38614e['query'],_0x228d7b[_0xdb2a('0x48')]));if(_0x38614e[_0xdb2a('0x46')][_0xdb2a('0x39')]){_0x53d380[_0xdb2a('0x50')]=_[_0xdb2a('0x52')](_0x53d380[_0xdb2a('0x50')],{'$or':_['map'](_0x53d380['attributes'],function(_0x23c40c){var _0xd6e362={};_0xd6e362[_0x23c40c]={'$like':'%'+_0x38614e[_0xdb2a('0x46')][_0xdb2a('0x39')]+'%'};return _0xd6e362;})});}_0x53d380['model']=db['User'];_0x53d380['as']='Agents';_0x53d380=_[_0xdb2a('0x52')]({},_0x53d380,_0x38614e[_0xdb2a('0x54')]);return _0x4f1bf7[_0xdb2a('0x106')]({'include':[_0x53d380]});}})[_0xdb2a('0x32')](function(_0x554bed){if(_0x554bed){var _0x1e3b58={},_0xfa603b=[],_0x2e9814=0x0;for(var _0x1893c0=0x0;_0x1893c0<_0x554bed['length'];_0x1893c0+=0x1){for(var _0x29bbf4=0x0,_0x4c5cf7;_0x29bbf4<_0x554bed[_0x1893c0]['Agents'][_0xdb2a('0x77')];_0x29bbf4+=0x1){_0x4c5cf7=_0x554bed[_0x1893c0][_0xdb2a('0x37')][_0x29bbf4][_0xdb2a('0x34')]({'plain':!![]});_0x1e3b58[_0x4c5cf7['id']]=_0x4c5cf7;}}_0x1e3b58=_[_0xdb2a('0x11e')](_0x1e3b58);for(var _0x26ff06=qs[_0xdb2a('0x2a')](_0x38614e[_0xdb2a('0x46')][_0xdb2a('0x2a')]);_0x26ff06<_0x1e3b58[_0xdb2a('0x77')]&&_0xfa603b['length']=_0x449126){_0xec1b47=_0x449126;_0x22773=0xc8;}else{_0x22773=0xce;}_0x1ed76f[_0xf1c2('0x33')](_0x22773);return _0x1ed76f[_0xf1c2('0x38')](_0xf1c2('0x39'),_0x2347e7+'-'+_0xec1b47+'/'+_0x449126)['json'](_0x19daf5);}return null;};}function patchUpdates(_0x34bddf){return function(_0x585833){try{jsonpatch[_0xf1c2('0x3a')](_0x585833,_0x34bddf,!![]);}catch(_0x33012){return BPromise[_0xf1c2('0x3b')](_0x33012);}return _0x585833[_0xf1c2('0x3c')]();};}function saveUpdates(_0x26332d,_0x163b23){return function(_0x4b2654){if(_0x4b2654){return _0x4b2654[_0xf1c2('0x3d')](_0x26332d)[_0xf1c2('0x27')](function(_0x506636){return _0x506636;});}return null;};}function removeEntity(_0x326e9e,_0x165de0){return function(_0x5a86b7){if(_0x5a86b7){return _0x5a86b7[_0xf1c2('0x3e')]()['then'](function(){var _0x45f190=_0x5a86b7['get']({'plain':!![]});var _0x2aa392=[{'name':_0xf1c2('0x3f'),'value':'user','ignore':!![]},{'name':_0xf1c2('0x40'),'value':_0xf1c2('0x41'),'ignore':![]},{'name':_0xf1c2('0x42'),'value':_0xf1c2('0x43'),'ignore':![]}];var _0x3d17bc=_(_0x2aa392)[_0xf1c2('0x44')]('ignore')['map']('value')['value']();if(_['includes'](_0x3d17bc,_0x45f190[_0xf1c2('0x45')])){return;}var _0x205207=_[_0xf1c2('0x46')](_0x2aa392,[_0xf1c2('0x47'),_0x45f190[_0xf1c2('0x45')]])[_0xf1c2('0x48')];return db['UserProfileResource']['destroy']({'where':{'type':_0x205207,'resourceId':_0x45f190['id']}})['then'](function(){return _0x5a86b7;});})[_0xf1c2('0x27')](function(){_0x326e9e[_0xf1c2('0x33')](0xcc)[_0xf1c2('0x34')]();});}};}function handleEntityNotFound(_0x131d40,_0x289b64){return function(_0xf64ef7){if(!_0xf64ef7){_0x131d40[_0xf1c2('0x32')](0x194);}return _0xf64ef7;};}function handleError(_0x5e4d9f,_0x24084a){_0x24084a=_0x24084a||0x1f4;return function(_0x33e402){logger[_0xf1c2('0x2d')](_0x33e402[_0xf1c2('0x49')]);if(_0x33e402['name']){delete _0x33e402[_0xf1c2('0x48')];}_0x5e4d9f[_0xf1c2('0x33')](_0x24084a)['send'](_0x33e402);};}exports[_0xf1c2('0x4a')]=function(_0x6f9041,_0x2c9cef){var _0x4c6d80={},_0x1cc7de={},_0x581a96={'count':0x0,'rows':[]};var _0x3eef15=_['map'](db[_0xf1c2('0x4b')][_0xf1c2('0x4c')],function(_0x57adf8){return{'name':_0x57adf8['fieldName'],'type':_0x57adf8[_0xf1c2('0x4d')][_0xf1c2('0x4e')]};});_0x1cc7de[_0xf1c2('0x4f')]=_[_0xf1c2('0x50')](_[_0xf1c2('0x51')](_0x3eef15,'name'),[_0xf1c2('0x52'),_0xf1c2('0x53')]);_0x1cc7de[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x6f9041['query']);_0x1cc7de['filters']=_[_0xf1c2('0x56')](_0x1cc7de[_0xf1c2('0x4f')],_0x1cc7de['query']);_0x4c6d80[_0xf1c2('0x57')]=_['intersection'](_0x1cc7de[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x6f9041[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x4c6d80[_0xf1c2('0x57')]=_0x4c6d80['attributes'][_0xf1c2('0x59')]?_0x4c6d80[_0xf1c2('0x57')]:_0x1cc7de['model'];if(!_0x6f9041[_0xf1c2('0x54')]['hasOwnProperty'](_0xf1c2('0x5a'))){_0x4c6d80[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x6f9041[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x4c6d80[_0xf1c2('0x36')]=qs['offset'](_0x6f9041['query'][_0xf1c2('0x36')]);}_0x4c6d80[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x6f9041[_0xf1c2('0x54')]['sort']);_0x4c6d80[_0xf1c2('0x5d')]=qs['filters'](_['pick'](_0x6f9041[_0xf1c2('0x54')],_0x1cc7de['filters']),_0x3eef15);if(_0x6f9041[_0xf1c2('0x54')]['filter']){_0x4c6d80[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x4c6d80[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x3eef15,function(_0x3ab220){if(_0x3ab220[_0xf1c2('0x4d')]!==_0xf1c2('0x5f')){return db[_0xf1c2('0x60')][_0xf1c2('0x5d')](db[_0xf1c2('0x60')]['fn'](_0xf1c2('0x61'),db[_0xf1c2('0x60')]['col'](_0x3ab220[_0xf1c2('0x48')])),{'$like':db['sequelize']['fn'](_0xf1c2('0x61'),'%'+_0x6f9041[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%')});}})});}_0x4c6d80=_[_0xf1c2('0x5e')]({},_0x4c6d80,_0x6f9041[_0xf1c2('0x62')]);var _0x25a2e5={'where':_0x4c6d80[_0xf1c2('0x5d')]};return db[_0xf1c2('0x4b')]['count'](_0x25a2e5)['then'](function(_0x14ca7a){_0x581a96[_0xf1c2('0x63')]=_0x14ca7a;if(_0x6f9041[_0xf1c2('0x54')][_0xf1c2('0x64')]){_0x4c6d80['include']=[{'all':!![]}];}return db['User'][_0xf1c2('0x65')](_0x4c6d80);})[_0xf1c2('0x27')](function(_0x54551d){_0x581a96[_0xf1c2('0x66')]=_0x54551d;return _0x581a96;})[_0xf1c2('0x27')](respondWithFilteredResult(_0x2c9cef,_0x4c6d80))['catch'](handleError(_0x2c9cef,null));};exports['show']=function(_0x5478e9,_0x16b427){var _0x2c9ec9={'raw':![],'where':{'id':_0x5478e9[_0xf1c2('0x67')]['id']}},_0x2d5fe9={};_0x2d5fe9[_0xf1c2('0x4f')]=_[_0xf1c2('0x50')](_[_0xf1c2('0x55')](db['User'][_0xf1c2('0x4c')]),['password',_0xf1c2('0x53')]);_0x2d5fe9['query']=_[_0xf1c2('0x55')](_0x5478e9[_0xf1c2('0x54')]);_0x2d5fe9[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x2d5fe9[_0xf1c2('0x4f')],_0x2d5fe9[_0xf1c2('0x54')]);_0x2c9ec9[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x2d5fe9[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x5478e9[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x2c9ec9['attributes']=_0x2c9ec9['attributes']['length']?_0x2c9ec9[_0xf1c2('0x57')]:_0x2d5fe9['model'];if(_0x5478e9['query'][_0xf1c2('0x64')]){_0x2c9ec9[_0xf1c2('0x69')]=[{'all':!![]}];}_0x2c9ec9=_['merge']({},_0x2c9ec9,_0x5478e9['options']);return db[_0xf1c2('0x4b')][_0xf1c2('0x46')](_0x2c9ec9)[_0xf1c2('0x27')](handleEntityNotFound(_0x16b427,null))[_0xf1c2('0x27')](respondWithResult(_0x16b427,null))[_0xf1c2('0x31')](handleError(_0x16b427,null));};exports[_0xf1c2('0x6a')]=function(_0x355775,_0x5931bd){return db[_0xf1c2('0x4b')][_0xf1c2('0x6a')](_0x355775[_0xf1c2('0x6b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5931bd,0xc9))[_0xf1c2('0x31')](handleError(_0x5931bd,null));};exports[_0xf1c2('0x3d')]=function(_0xe94887,_0x3efa5d){if(_0xe94887['body']['id']){delete _0xe94887[_0xf1c2('0x6b')]['id'];}delete _0xe94887[_0xf1c2('0x6b')][_0xf1c2('0x45')];return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0xe94887[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x3efa5d,null))[_0xf1c2('0x27')](saveUpdates(_0xe94887[_0xf1c2('0x6b')],null))[_0xf1c2('0x27')](respondWithResult(_0x3efa5d,null))[_0xf1c2('0x31')](handleError(_0x3efa5d,null));};exports[_0xf1c2('0x6c')]=function(_0x10c37b,_0x3e304e){return db[_0xf1c2('0x4b')][_0xf1c2('0x6c')]()[_0xf1c2('0x27')](respondWithResult(_0x3e304e,null))[_0xf1c2('0x31')](handleError(_0x3e304e,null));};exports[_0xf1c2('0x6d')]=function(_0x136532,_0x2f6736,_0x32af84){return db[_0xf1c2('0x4b')]['find']({'where':{'id':_0x136532[_0xf1c2('0x67')]['id']}})['then'](handleEntityNotFound(_0x2f6736,null))['then'](function(_0xd93484){if(_0xd93484){return _0xd93484[_0xf1c2('0x6d')](_0x136532[_0xf1c2('0x6b')][_0xf1c2('0x6e')],_[_0xf1c2('0x6f')](_0x136532[_0xf1c2('0x6b')],['ids','id'])||{});}})[_0xf1c2('0x27')](respondWithResult(_0x2f6736,null))[_0xf1c2('0x31')](handleError(_0x2f6736,null));};var getLicense=function(_0x3e8e62){return new BPromise(function(_0x4a5507,_0x569228){var _0x127b17=0x0;_0x3e8e62['body']['role']===_0xf1c2('0x41')&&_0x4a5507(_0xf1c2('0x70'));return db[_0xf1c2('0x4b')]['count']({'where':{'$or':[{'role':_0x3e8e62[_0xf1c2('0x6b')]['role']===_0xf1c2('0x43')?_0xf1c2('0x43'):['admin','user']}]}})['then'](function(_0x4bc10c){_0x127b17=_0x4bc10c;return require(_0xf1c2('0x71'))[_0xf1c2('0x72')]();})[_0xf1c2('0x27')](function(_0x296e25){var _0x58437f=_0x3e8e62['body'][_0xf1c2('0x45')]===_0xf1c2('0x43')?_0xf1c2('0x73'):_0xf1c2('0x74');if(!_['isNil'](_0x296e25[_0x58437f])&&_0x127b17>=_0x296e25[_0x58437f]){return _0x569228({'message':_0xf1c2('0x75')});}return _0x4a5507(util['format']('count\x20%s:\x20%s',_0x58437f,_0x127b17));})[_0xf1c2('0x31')](function(_0x10bbb4){return _0x569228(_0x10bbb4);});});};exports[_0xf1c2('0x76')]=function(_0x31443b,_0xb38878){return getLicense(_0x31443b)[_0xf1c2('0x27')](function(_0x534d86){if(!_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x77')]){var _0x1306e8;return db[_0xf1c2('0x78')]['findById'](0x1)[_0xf1c2('0x27')](function(_0x1e3d5d){return checkPasswordPattern(_0x1e3d5d,_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x52')],_0x1e3d5d['securePassword']);})[_0xf1c2('0x27')](function(_0x1a685c){_0x1306e8=_0x1a685c[_0xf1c2('0x79')];return db[_0xf1c2('0x4b')][_0xf1c2('0x7a')](_0xf1c2('0x77'));})[_0xf1c2('0x27')](function(_0x583262){if(_['isNil'](_0x583262)){if(_0x1306e8){_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x77')]=_0x1306e8;}else{_0x31443b['body'][_0xf1c2('0x77')]=0x1;}}else{if(_[_0xf1c2('0x7b')](_0x1306e8)||_0x1306e8==_0x583262){_0x31443b['body'][_0xf1c2('0x77')]=_0x583262+0x1;}else if(_0x1306e8>_0x583262){_0x31443b['body'][_0xf1c2('0x77')]=_0x1306e8;}else{return db[_0xf1c2('0x60')]['query'](_0xf1c2('0x7c'),{'type':db['sequelize'][_0xf1c2('0x7d')][_0xf1c2('0x7e')]})[_0xf1c2('0x27')](function(_0x449333){if(_0x449333&&_0x449333[_0xf1c2('0x59')]){for(var _0x17b679=0x0,_0x3d3ff2=_0x449333[_0xf1c2('0x59')];_0x17b679<_0x3d3ff2&&_[_0xf1c2('0x7b')](_0x31443b['body']['internal']);_0x17b679++){if(_0x1306e8<=_0x449333[_0x17b679][_0xf1c2('0x7f')]){_0x31443b[_0xf1c2('0x6b')]['internal']=_0x449333[_0x17b679][_0xf1c2('0x7f')];}else if(_0x1306e8>_0x449333[_0x17b679][_0xf1c2('0x7f')]&&_0x1306e8<=_0x449333[_0x17b679]['to']){_0x31443b['body']['internal']=_0x1306e8;}}}if(_[_0xf1c2('0x7b')](_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x77')])){_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x77')]=_0x583262+0x1;}});}}});}})['then'](function(){if(_0x31443b['body']['voicemail']){_0x31443b['body'][_0xf1c2('0x80')]=_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x77')];_0x31443b[_0xf1c2('0x6b')]['VoiceMail']={'mailbox':_0x31443b['body'][_0xf1c2('0x77')],'password':_0x31443b['body'][_0xf1c2('0x52')],'fullname':_0x31443b['body'][_0xf1c2('0x81')],'email':_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x82')]};}if(_0x31443b['body']&&_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x45')]===_0xf1c2('0x41')){if(!_0x31443b['body'][_0xf1c2('0x83')]){_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x83')]=[_0xf1c2('0x84'),'102',_0xf1c2('0x85'),_0xf1c2('0x86'),_0xf1c2('0x87'),_0xf1c2('0x88'),'105',_0xf1c2('0x89'),_0xf1c2('0x8a'),_0xf1c2('0x8b'),_0xf1c2('0x8c'),_0xf1c2('0x8d'),_0xf1c2('0x8e'),'114'];}}return db['User'][_0xf1c2('0x76')](_0x31443b['body'],{'include':[{'model':db[_0xf1c2('0x8f')],'as':_0xf1c2('0x8f')}]});})[_0xf1c2('0x27')](function(_0x205b70){if(_0x31443b[_0xf1c2('0x6b')][_0xf1c2('0x45')]===_0xf1c2('0x90'))return _0x205b70;var _0x26bff4=_0x31443b[_0xf1c2('0x90')]['get']({'plain':!![]});if(!_0x26bff4)throw new Error(_0xf1c2('0x91'));if(_0x26bff4['role']===_0xf1c2('0x90')){var _0x29e039=_0x205b70[_0xf1c2('0x92')]({'plain':!![]});var _0x16475d=[{'name':_0xf1c2('0x40'),'value':_0xf1c2('0x41')},{'name':_0xf1c2('0x42'),'value':'telephone'}];var _0x12a6d0=_[_0xf1c2('0x46')](_0x16475d,[_0xf1c2('0x47'),_0x29e039[_0xf1c2('0x45')]])[_0xf1c2('0x48')];return db[_0xf1c2('0x93')][_0xf1c2('0x46')]({'where':{'name':_0x12a6d0,'userProfileId':_0x26bff4[_0xf1c2('0x94')]},'raw':!![]})[_0xf1c2('0x27')](function(_0x198a02){if(_0x198a02&&_0x198a02['autoAssociation']===0x0){return db[_0xf1c2('0x95')]['create']({'name':_0x29e039[_0xf1c2('0x48')],'resourceId':_0x29e039['id'],'type':_0x198a02[_0xf1c2('0x48')],'sectionId':_0x198a02['id']},{})['then'](function(){return _0x205b70;});}else{return _0x205b70;}})['catch'](function(_0x121db5){logger[_0xf1c2('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x121db5);throw _0x121db5;});}return _0x205b70;})[_0xf1c2('0x27')](respondWithResult(_0xb38878,0xc9))[_0xf1c2('0x31')](handleError(_0xb38878,null));};exports[_0xf1c2('0x96')]=function(_0x265d43,_0x1dfa1a,_0x230ced){var _0x8c8648=![];if(_0x265d43[_0xf1c2('0x6b')]['id']){delete _0x265d43[_0xf1c2('0x6b')]['id'];}return db[_0xf1c2('0x78')][_0xf1c2('0x97')]({'attributes':['id',_0xf1c2('0x98')]})[_0xf1c2('0x27')](function(_0xa277e4){_0x8c8648=_0xa277e4[_0xf1c2('0x98')];return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x265d43['params']['id']}});})['then'](function(_0x9ef5bc){if(_0x9ef5bc){if(_0x9ef5bc['id']==_0x265d43[_0xf1c2('0x90')]['id']){if(!_0x265d43['body'][_0xf1c2('0x99')]||!_0x265d43['body'][_0xf1c2('0x9a')]){throw new db[(_0xf1c2('0x23'))][(_0xf1c2('0x24'))](_0xf1c2('0x9b'));}if(!_0x9ef5bc['authenticate'](_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x99')])){throw new db['Sequelize']['ValidationError'](_0xf1c2('0x9c'));}if(_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x99')]==_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x9a')]){throw new db[(_0xf1c2('0x23'))][(_0xf1c2('0x24'))](_0xf1c2('0x9d'));}return _0x9ef5bc;}else if(_0x265d43[_0xf1c2('0x90')][_0xf1c2('0x45')]==_0xf1c2('0x9e')){if(!_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x9a')]){throw new db[(_0xf1c2('0x23'))]['ValidationError'](_0xf1c2('0x9f'));}return _0x9ef5bc;}else if(_0x265d43[_0xf1c2('0x90')][_0xf1c2('0x45')]=='user'){if(!_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x9a')]){throw new db[(_0xf1c2('0x23'))]['ValidationError'](_0xf1c2('0x9f'));}if(_0x9ef5bc['role']!='agent'){throw new db['Sequelize']['ValidationError'](_0xf1c2('0xa0'));}return _0x9ef5bc;}else{throw new db[(_0xf1c2('0x23'))][(_0xf1c2('0x24'))](_0xf1c2('0xa0'));}}return null;})[_0xf1c2('0x27')](handleEntityNotFound(_0x1dfa1a,null))[_0xf1c2('0x27')](function(_0x7ded0c){return checkPasswordPattern(_0x7ded0c,_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x9a')],_0x8c8648);})[_0xf1c2('0x27')](saveUpdates({'password':_0x265d43[_0xf1c2('0x6b')][_0xf1c2('0x9a')],'passwordResetAt':_0x265d43[_0xf1c2('0x90')]['id']==_0x265d43[_0xf1c2('0x67')]['id']?moment():null},null))[_0xf1c2('0x27')](respondWithResult(_0x1dfa1a,null))['catch'](handleError(_0x1dfa1a,null));};exports[_0xf1c2('0xa1')]=function(_0x38e51c,_0x3cf152,_0x226c83){var _0x55329b=_0x38e51c[_0xf1c2('0x6b')][_0xf1c2('0xa2')];return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x38e51c[_0xf1c2('0x67')]['id']},'attributes':['id',_0xf1c2('0x48'),_0xf1c2('0x45'),'online',_0xf1c2('0xa3'),_0xf1c2('0xa4'),_0xf1c2('0xa5')]})[_0xf1c2('0x27')](handleEntityNotFound(_0x3cf152,null))['then'](function(_0x48f2e5){if(_0x48f2e5){if(!utils['isValidChannel'](_0x55329b)){throw new db[(_0xf1c2('0x23'))][(_0xf1c2('0x24'))]('Unknown\x20channel');}return _0x48f2e5['add'+_[_0xf1c2('0xa6')](_0x55329b['toLowerCase']())+_0xf1c2('0xa7')](_0x38e51c[_0xf1c2('0x6b')]['ids'],{'penalty':_0x38e51c[_0xf1c2('0x6b')][_0xf1c2('0xa8')]||0x0})[_0xf1c2('0xa9')](function(_0x2bbd6a){for(var _0x51282c=0x0;_0x51282c<_0x38e51c[_0xf1c2('0x6b')][_0xf1c2('0x6e')][_0xf1c2('0x59')];_0x51282c+=0x1){var _0x38131f={'UserId':_0x38e51c[_0xf1c2('0x67')]['id']};_0x38131f[_[_0xf1c2('0xa6')](_0x55329b[_0xf1c2('0xaa')]())+_0xf1c2('0xab')]=_0x38e51c[_0xf1c2('0x6b')][_0xf1c2('0x6e')][_0x51282c];socket[_0xf1c2('0xac')]('user'+_['capitalize'](_0x55329b[_0xf1c2('0xaa')]())+_0xf1c2('0xad'),_0x38131f);}return _0x2bbd6a;})[_0xf1c2('0x27')](function(){if(_0x55329b===_0xf1c2('0xae')){return db[_0xf1c2('0xaf')][_0xf1c2('0x65')]({'where':{'id':_0x38e51c[_0xf1c2('0x6b')]['ids']||[]},'raw':!![],'attributes':['id',_0xf1c2('0x48')]});}})[_0xf1c2('0x27')](function(_0xe83cd1){var _0x570ea2=_0x48f2e5['get']({'plain':!![]});var _0x442bfc=[];if(_0x55329b==='voice'&&_0x570ea2[_0xf1c2('0x45')]===_0xf1c2('0x41')&&_0x570ea2[_0xf1c2('0xb0')]){for(var _0x4c1df0=0x0;_0x4c1df0<_0xe83cd1[_0xf1c2('0x59')];_0x4c1df0+=0x1){_0x442bfc[_0xf1c2('0xb1')]({'membername':_0x570ea2[_0xf1c2('0x48')],'UserId':_0x570ea2['id'],'queue_name':_0xe83cd1[_0x4c1df0][_0xf1c2('0x48')],'VoiceQueueId':_0xe83cd1[_0x4c1df0]['id'],'interface':_[_0xf1c2('0x7b')](_0x570ea2['interface'])?util[_0xf1c2('0xb2')](_0xf1c2('0xb3'),_0x570ea2[_0xf1c2('0x48')]):_0x570ea2[_0xf1c2('0xa5')],'paused':_0x570ea2[_0xf1c2('0xa4')]||![],'penalty':_0x38e51c[_0xf1c2('0x6b')][_0xf1c2('0xa8')]||0x0});}return BPromise['each'](_0x442bfc,function(_0x201788){return db[_0xf1c2('0xb4')][_0xf1c2('0xb5')](_0x201788);});}return _0x48f2e5;});}})[_0xf1c2('0x27')](respondWithStatusCode(_0x3cf152,null))[_0xf1c2('0x31')](handleError(_0x3cf152,null));};exports[_0xf1c2('0xb6')]=function(_0xec9d1c,_0x245184,_0x42341e){var _0x77b6a5;return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0xec9d1c['params']['id']},'attributes':['id','name',_0xf1c2('0x45')]})[_0xf1c2('0x27')](handleEntityNotFound(_0x245184,null))[_0xf1c2('0x27')](function(_0x25e15f){if(_0x25e15f){_0x77b6a5=_0x25e15f;if(!_0xec9d1c[_0xf1c2('0x54')][_0xf1c2('0xa2')]||!utils['isValidChannel'](_0xec9d1c[_0xf1c2('0x54')]['channel'])){throw new db[(_0xf1c2('0x23'))][(_0xf1c2('0x24'))](_0xf1c2('0xb7'));}return _0x25e15f[_0xf1c2('0xb8')+_['capitalize'](_0xec9d1c['query']['channel']['toLowerCase']())+_0xf1c2('0xa7')](_0xec9d1c[_0xf1c2('0x54')]['ids']);}})[_0xf1c2('0x27')](function(_0x1c3975){for(var _0x2d3adb=0x0;_0x2d3adb<_0xec9d1c[_0xf1c2('0x54')]['ids'][_0xf1c2('0x59')];_0x2d3adb+=0x1){var _0x562061={'UserId':_0xec9d1c[_0xf1c2('0x67')]['id']};_0x562061[_[_0xf1c2('0xa6')](_0xec9d1c['query'][_0xf1c2('0xa2')][_0xf1c2('0xaa')]())+_0xf1c2('0xab')]=_0xec9d1c[_0xf1c2('0x54')][_0xf1c2('0x6e')][_0x2d3adb];socket[_0xf1c2('0xac')]('user'+_[_0xf1c2('0xa6')](_0xec9d1c[_0xf1c2('0x54')][_0xf1c2('0xa2')][_0xf1c2('0xaa')]())+_0xf1c2('0xb9'),_0x562061);}return _0x1c3975;})[_0xf1c2('0x27')](function(){if(_0xec9d1c[_0xf1c2('0x54')][_0xf1c2('0xa2')]===_0xf1c2('0xae')){return db[_0xf1c2('0xb4')][_0xf1c2('0x3e')]({'where':{'UserId':_0xec9d1c[_0xf1c2('0x67')]['id'],'VoiceQueueId':_0xec9d1c['query'][_0xf1c2('0x6e')]},'individualHooks':!![]})[_0xf1c2('0x27')](function(){return _0x77b6a5;});}return _0x77b6a5;})[_0xf1c2('0x27')](respondWithStatusCode(_0x245184,null))[_0xf1c2('0x31')](handleError(_0x245184,null));};exports[_0xf1c2('0xba')]=function(_0x37bb25,_0x40c179,_0x4b56fc){_0x37bb25[_0xf1c2('0x6b')][_0xf1c2('0xbb')]=_0x37bb25[_0xf1c2('0xbc')][_0xf1c2('0xbd')];return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x37bb25[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x40c179,null))['then'](saveUpdates(_0x37bb25[_0xf1c2('0x6b')],null))[_0xf1c2('0x27')](respondWithResult(_0x40c179,null))[_0xf1c2('0x31')](handleError(_0x40c179,null));};exports[_0xf1c2('0xbe')]=function(_0x26d2ee,_0x5f4ad1,_0x4b4b64){var _0x3519d2=path['join'](config[_0xf1c2('0xbf')],'server/files/images/logos/default_profile.png');return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x26d2ee['params']['id']},'attributes':['id',_0xf1c2('0xbb')],'raw':!![]})[_0xf1c2('0x27')](handleEntityNotFound(_0x5f4ad1,null))[_0xf1c2('0x27')](function(_0x5d5e9a){if(_0x5d5e9a){if(_[_0xf1c2('0x7b')](_0x5d5e9a['userpic'])){return _0x5f4ad1[_0xf1c2('0xc0')](_0x3519d2);}else{if(!fs[_0xf1c2('0xc1')](path[_0xf1c2('0xc2')](config[_0xf1c2('0xbf')],'server/files/images/',_0x5d5e9a[_0xf1c2('0xbb')]))){return _0x5f4ad1['download'](_0x3519d2);}return _0x5f4ad1[_0xf1c2('0xc0')](path[_0xf1c2('0xc2')](config[_0xf1c2('0xbf')],_0xf1c2('0xc3'),_0x5d5e9a['userpic']));}}})['catch'](handleError(_0x5f4ad1,null));};exports['getContacts']=function(_0x4c26c4,_0x167d36,_0xf5e0bb){var _0x3f6b76={};var _0x3064bb={};var _0x57028a;var _0x7ee8f6;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x4c26c4[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x167d36,null))[_0xf1c2('0x27')](function(_0x140ce3){if(_0x140ce3){_0x57028a=_0x140ce3;_0x3064bb[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xc4')][_0xf1c2('0x4c')]);_0x3064bb[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x4c26c4['query']);_0x3064bb[_0xf1c2('0x68')]=_['intersection'](_0x3064bb[_0xf1c2('0x4f')],_0x3064bb[_0xf1c2('0x54')]);_0x3f6b76[_0xf1c2('0x57')]=_['intersection'](_0x3064bb[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x3f6b76[_0xf1c2('0x57')]=_0x3f6b76[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x3f6b76[_0xf1c2('0x57')]:_0x3064bb['model'];_0x3f6b76[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x4c26c4[_0xf1c2('0x54')]['sort']);_0x3f6b76[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_['pick'](_0x4c26c4[_0xf1c2('0x54')],_0x3064bb['filters']));if(_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x3f6b76[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x3f6b76[_0xf1c2('0x5d')],{'$or':_['map'](_0x3f6b76[_0xf1c2('0x57')],function(_0x367ca0){var _0x166414={};_0x166414[_0x367ca0]={'$like':'%'+_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x166414;})});}_0x3f6b76=_[_0xf1c2('0x5e')]({},_0x3f6b76,_0x4c26c4['options']);return _0x57028a[_0xf1c2('0xc5')](_0x3f6b76);}})[_0xf1c2('0x27')](function(_0x55e5c1){if(_0x55e5c1){_0x7ee8f6=_0x55e5c1[_0xf1c2('0x59')];if(_0x4c26c4['query'][_0xf1c2('0xc6')](_0xf1c2('0x64'))){_0x3f6b76[_0xf1c2('0x69')]=[{'model':db['CmList'],'as':_0xf1c2('0xc7'),'required':![]},{'model':db[_0xf1c2('0xc8')],'as':_0xf1c2('0xc9'),'attributes':['id',_0xf1c2('0x48'),_0xf1c2('0xca')],'where':_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0xcb')]?{'id':_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0xcb')]}:undefined,'required':_0x4c26c4['query'][_0xf1c2('0xcb')]?!![]:![]}];}if(!_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0xc6')]('nolimit')){_0x3f6b76[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x4c26c4['query'][_0xf1c2('0x37')]);_0x3f6b76[_0xf1c2('0x36')]=qs[_0xf1c2('0x36')](_0x4c26c4[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x57028a[_0xf1c2('0xc5')](_0x3f6b76);}})[_0xf1c2('0x27')](function(_0x12b5bf){if(_0x12b5bf){return _0x12b5bf?{'count':_0x7ee8f6,'rows':_0x12b5bf}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x167d36,null))[_0xf1c2('0x31')](handleError(_0x167d36,null));};exports[_0xf1c2('0xcc')]=function(_0x13a45a,_0xc6d1d1,_0x43aae3){var _0x15a623;var _0x24c9da;var _0x336a6b={};var _0x2fd1f2;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x13a45a['params']['id']},'attributes':['id','name',_0xf1c2('0x45')]})[_0xf1c2('0x27')](handleEntityNotFound(_0xc6d1d1,null))[_0xf1c2('0x27')](function(_0x2fa613){if(!utils[_0xf1c2('0xcd')](_0x13a45a[_0xf1c2('0x54')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xf1c2('0xb7'));}_0x15a623=_0x2fa613;var _0xed70e0={};_0xed70e0[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_[_0xf1c2('0xa6')](_0x13a45a['query']['channel'])+'Queue'][_0xf1c2('0x4c')]);_0xed70e0[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x13a45a['query']);_0xed70e0[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0xed70e0[_0xf1c2('0x4f')],_0xed70e0[_0xf1c2('0x54')]);_0x336a6b[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0xed70e0[_0xf1c2('0x4f')],qs['fields'](_0x13a45a[_0xf1c2('0x54')]['fields']));_0x336a6b['attributes']=_0x336a6b[_0xf1c2('0x57')]['length']?_0x336a6b[_0xf1c2('0x57')]:_0xed70e0[_0xf1c2('0x4f')];_0x336a6b[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x13a45a['query'][_0xf1c2('0x5c')]);_0x336a6b[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x13a45a[_0xf1c2('0x54')],_0xed70e0[_0xf1c2('0x68')]));if(_0x13a45a[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x336a6b['where']=_[_0xf1c2('0x5e')](_0x336a6b[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x336a6b['attributes'],function(_0x40f9ab){var _0x2a6807={};_0x2a6807[_0x40f9ab]={'$like':'%'+_0x13a45a['query'][_0xf1c2('0x44')]+'%'};return _0x2a6807;})});}_0x336a6b=_[_0xf1c2('0x5e')]({},_0x336a6b,_0x13a45a['options']);switch(_0x15a623['role']){case _0xf1c2('0x9e'):return db[_[_0xf1c2('0xa6')](_0x13a45a[_0xf1c2('0x54')][_0xf1c2('0xa2')])+'Queue']['findAll'](_0x336a6b);case'user':case _0xf1c2('0x41'):return _0x15a623[_0xf1c2('0x92')+_[_0xf1c2('0xa6')](_0x13a45a[_0xf1c2('0x54')]['channel'])+_0xf1c2('0xa7')](_0x336a6b);default:throw new db['Sequelize'][(_0xf1c2('0x24'))]('Unknown\x20role');}})['then'](function(_0x1daf08){_0x2fd1f2=_0x1daf08[_0xf1c2('0x59')];if(!_0x13a45a['query']['hasOwnProperty']('nolimit')){_0x336a6b[_0xf1c2('0x37')]=qs['limit'](_0x13a45a[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x336a6b['offset']=qs['offset'](_0x13a45a[_0xf1c2('0x54')][_0xf1c2('0x36')]);}switch(_0x15a623[_0xf1c2('0x45')]){case _0xf1c2('0x9e'):return db[_[_0xf1c2('0xa6')](_0x13a45a[_0xf1c2('0x54')]['channel'])+_0xf1c2('0xcf')]['findAll'](_0x336a6b);case _0xf1c2('0x90'):case'agent':return _0x15a623[_0xf1c2('0x92')+_[_0xf1c2('0xa6')](_0x13a45a[_0xf1c2('0x54')][_0xf1c2('0xa2')])+_0xf1c2('0xa7')](_0x336a6b);}})[_0xf1c2('0x27')](function(_0xb9f588){return{'count':_0x2fd1f2,'rows':_0xb9f588};})[_0xf1c2('0x27')](respondWithResult(_0xc6d1d1,null))[_0xf1c2('0x31')](handleError(_0xc6d1d1,null));};exports['getVoiceQueuesRt']=function(_0x99de94,_0x2156c6,_0x51d2e1){var _0x41562f={};var _0x1c8ff2={};var _0x27377e;var _0x471186;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x99de94[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x2156c6,null))[_0xf1c2('0x27')](function(_0x75f530){if(_0x75f530){_0x27377e=_0x75f530;_0x1c8ff2[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xb4')]['rawAttributes']);_0x1c8ff2[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x99de94['query']);_0x1c8ff2[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x1c8ff2[_0xf1c2('0x4f')],_0x1c8ff2['query']);_0x41562f['attributes']=_['intersection'](_0x1c8ff2[_0xf1c2('0x4f')],qs['fields'](_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x41562f[_0xf1c2('0x57')]=_0x41562f['attributes'][_0xf1c2('0x59')]?_0x41562f[_0xf1c2('0x57')]:_0x1c8ff2[_0xf1c2('0x4f')];_0x41562f[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x41562f[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_['pick'](_0x99de94['query'],_0x1c8ff2[_0xf1c2('0x68')]));if(_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x41562f[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x41562f[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x41562f[_0xf1c2('0x57')],function(_0x4f5ebd){var _0x518a26={};_0x518a26[_0x4f5ebd]={'$like':'%'+_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x518a26;})});}_0x41562f=_['merge']({},_0x41562f,_0x99de94['options']);return _0x27377e['getVoiceQueuesRt'](_0x41562f);}})[_0xf1c2('0x27')](function(_0x1f94e2){if(_0x1f94e2){_0x471186=_0x1f94e2[_0xf1c2('0x59')];if(!_0x99de94['query'][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x41562f[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x41562f[_0xf1c2('0x36')]=qs[_0xf1c2('0x36')](_0x99de94[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x27377e[_0xf1c2('0xd0')](_0x41562f);}})[_0xf1c2('0x27')](function(_0x49bec1){if(_0x49bec1){return _0x49bec1?{'count':_0x471186,'rows':_0x49bec1}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x2156c6,null))[_0xf1c2('0x31')](handleError(_0x2156c6,null));};exports[_0xf1c2('0xd1')]=function(_0x18f8a4,_0x49671e,_0x53ab2f){var _0x1ce449={};var _0x10f0b4={};var _0x3685d;var _0x1849d8;return db[_0xf1c2('0x4b')]['findOne']({'where':{'id':_0x18f8a4[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x49671e,null))['then'](function(_0x2d1f18){if(_0x2d1f18){_0x3685d=_0x2d1f18;_0x10f0b4['model']=_[_0xf1c2('0x55')](db[_0xf1c2('0xd2')][_0xf1c2('0x4c')]);_0x10f0b4[_0xf1c2('0x54')]=_['keys'](_0x18f8a4[_0xf1c2('0x54')]);_0x10f0b4['filters']=_[_0xf1c2('0x56')](_0x10f0b4[_0xf1c2('0x4f')],_0x10f0b4[_0xf1c2('0x54')]);_0x1ce449[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x10f0b4[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x1ce449['attributes']=_0x1ce449[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x1ce449['attributes']:_0x10f0b4[_0xf1c2('0x4f')];_0x1ce449[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x1ce449[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_['pick'](_0x18f8a4['query'],_0x10f0b4[_0xf1c2('0x68')]));if(_0x18f8a4[_0xf1c2('0x54')]['filter']){_0x1ce449[_0xf1c2('0x5d')]=_['merge'](_0x1ce449['where'],{'$or':_[_0xf1c2('0x51')](_0x1ce449[_0xf1c2('0x57')],function(_0x3485c0){var _0x4a6bba={};_0x4a6bba[_0x3485c0]={'$like':'%'+_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x4a6bba;})});}_0x1ce449=_[_0xf1c2('0x5e')]({},_0x1ce449,_0x18f8a4[_0xf1c2('0x62')]);return _0x3685d[_0xf1c2('0xd1')](_0x1ce449);}})['then'](function(_0x4d1f0f){if(_0x4d1f0f){_0x1849d8=_0x4d1f0f['length'];if(!_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x1ce449[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x1ce449[_0xf1c2('0x36')]=qs['offset'](_0x18f8a4[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x3685d[_0xf1c2('0xd1')](_0x1ce449);}})[_0xf1c2('0x27')](function(_0x4575cf){if(_0x4575cf){return _0x4575cf?{'count':_0x1849d8,'rows':_0x4575cf}:null;}})['then'](respondWithResult(_0x49671e,null))['catch'](handleError(_0x49671e,null));};exports['getRecordings']=function(_0x4a13d5,_0x3d1c4e,_0x56ede0){var _0x13aa29={'raw':!![],'where':{}};var _0x328f5f={};var _0x3c4fe5={'count':0x0,'rows':[]};return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x4a13d5[_0xf1c2('0x67')]['id']}})['then'](handleEntityNotFound(_0x3d1c4e,null))[_0xf1c2('0x27')](function(_0x5d1582){if(_0x5d1582){_0x328f5f[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xd3')]['rawAttributes']);_0x328f5f[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x4a13d5[_0xf1c2('0x54')]);_0x328f5f['filters']=_[_0xf1c2('0x56')](_0x328f5f['model'],_0x328f5f['query']);_0x13aa29[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x328f5f[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x4a13d5[_0xf1c2('0x54')]['fields']));_0x13aa29['attributes']=_0x13aa29[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x13aa29[_0xf1c2('0x57')]:_0x328f5f[_0xf1c2('0x4f')];if(!_0x4a13d5[_0xf1c2('0x54')]['hasOwnProperty'](_0xf1c2('0x5a'))){_0x13aa29[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x4a13d5[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x13aa29['offset']=qs[_0xf1c2('0x36')](_0x4a13d5['query'][_0xf1c2('0x36')]);}_0x13aa29[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x4a13d5[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x13aa29[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x4a13d5[_0xf1c2('0x54')],_0x328f5f['filters']));_0x13aa29[_0xf1c2('0x5d')][_0xf1c2('0xd4')]=_0x5d1582['id'];if(_0x4a13d5[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x13aa29['where']=_[_0xf1c2('0x5e')](_0x13aa29['where'],{'$or':_[_0xf1c2('0x51')](_0x13aa29[_0xf1c2('0x57')],function(_0x2a588f){var _0x1594fc={};_0x1594fc[_0x2a588f]={'$like':'%'+_0x4a13d5['query'][_0xf1c2('0x44')]+'%'};return _0x1594fc;})});}_0x13aa29=_[_0xf1c2('0x5e')]({},_0x13aa29,_0x4a13d5['options']);return db[_0xf1c2('0xd3')][_0xf1c2('0x63')]({'where':_0x13aa29[_0xf1c2('0x5d')]})[_0xf1c2('0x27')](function(_0x46a683){_0x3c4fe5[_0xf1c2('0x63')]=_0x46a683;if(_0x4a13d5[_0xf1c2('0x54')][_0xf1c2('0x64')]){_0x13aa29[_0xf1c2('0x69')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x13aa29);})[_0xf1c2('0x27')](function(_0x43257c){_0x3c4fe5[_0xf1c2('0x66')]=_0x43257c;return _0x3c4fe5;});}})[_0xf1c2('0x27')](respondWithFilteredResult(_0x3d1c4e,_0x13aa29))[_0xf1c2('0x31')](handleError(_0x3d1c4e,null));};exports[_0xf1c2('0xd5')]=function(_0x119f82,_0x4374c3,_0x4c521e){var _0x129907={'raw':!![],'where':{}};var _0x28dfbc={};var _0x365fec={'count':0x0,'rows':[]};return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x119f82[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x4374c3,null))[_0xf1c2('0x27')](function(_0x1ec745){if(_0x1ec745){_0x28dfbc[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xd6')][_0xf1c2('0x4c')]);_0x28dfbc[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x119f82['query']);_0x28dfbc[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x28dfbc[_0xf1c2('0x4f')],_0x28dfbc[_0xf1c2('0x54')]);_0x129907[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x28dfbc[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x119f82['query'][_0xf1c2('0x58')]));_0x129907[_0xf1c2('0x57')]=_0x129907[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x129907['attributes']:_0x28dfbc['model'];if(!_0x119f82[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x129907[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x119f82['query'][_0xf1c2('0x37')]);_0x129907['offset']=qs['offset'](_0x119f82[_0xf1c2('0x54')][_0xf1c2('0x36')]);}_0x129907['order']=qs[_0xf1c2('0x5c')](_0x119f82[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x129907['where']=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x119f82['query'],_0x28dfbc[_0xf1c2('0x68')]));_0x129907[_0xf1c2('0x5d')][_0xf1c2('0xd4')]=_0x1ec745['id'];if(_0x119f82['query'][_0xf1c2('0x44')]){_0x129907['where']=_[_0xf1c2('0x5e')](_0x129907[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x129907[_0xf1c2('0x57')],function(_0x574051){var _0x493b80={};_0x493b80[_0x574051]={'$like':'%'+_0x119f82[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x493b80;})});}_0x129907=_['merge']({},_0x129907,_0x119f82[_0xf1c2('0x62')]);return db['ScreenRecording'][_0xf1c2('0x63')]({'where':_0x129907[_0xf1c2('0x5d')]})[_0xf1c2('0x27')](function(_0x18ab9e){_0x365fec[_0xf1c2('0x63')]=_0x18ab9e;if(_0x119f82[_0xf1c2('0x54')][_0xf1c2('0x64')]){_0x129907[_0xf1c2('0x69')]=[{'all':!![]}];}return db['ScreenRecording'][_0xf1c2('0x65')](_0x129907);})[_0xf1c2('0x27')](function(_0xd84cc5){_0x365fec[_0xf1c2('0x66')]=_0xd84cc5;return _0x365fec;});}})[_0xf1c2('0x27')](respondWithFilteredResult(_0x4374c3,_0x129907))[_0xf1c2('0x31')](handleError(_0x4374c3,null));};exports[_0xf1c2('0xd7')]=function(_0x545943,_0x29f0c2,_0x4c80b5){var _0x225af4={};var _0x5ecf5c={};var _0x56b4d7;var _0x5df493;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x545943[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x29f0c2,null))[_0xf1c2('0x27')](function(_0xdeeb4e){if(_0xdeeb4e){_0x56b4d7=_0xdeeb4e;_0x5ecf5c[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xd8')]['rawAttributes']);_0x5ecf5c[_0xf1c2('0x54')]=_['keys'](_0x545943[_0xf1c2('0x54')]);_0x5ecf5c['filters']=_[_0xf1c2('0x56')](_0x5ecf5c[_0xf1c2('0x4f')],_0x5ecf5c[_0xf1c2('0x54')]);_0x225af4['attributes']=_['intersection'](_0x5ecf5c[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x545943['query'][_0xf1c2('0x58')]));_0x225af4[_0xf1c2('0x57')]=_0x225af4[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x225af4[_0xf1c2('0x57')]:_0x5ecf5c[_0xf1c2('0x4f')];_0x225af4[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x545943[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x225af4[_0xf1c2('0x5d')]=qs['filters'](_[_0xf1c2('0xce')](_0x545943[_0xf1c2('0x54')],_0x5ecf5c['filters']));if(_0x545943[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x225af4[_0xf1c2('0x5d')]=_['merge'](_0x225af4[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x225af4[_0xf1c2('0x57')],function(_0x5d543f){var _0x5f3c30={};_0x5f3c30[_0x5d543f]={'$like':'%'+_0x545943['query']['filter']+'%'};return _0x5f3c30;})});}_0x225af4=_['merge']({},_0x225af4,_0x545943['options']);return _0x56b4d7[_0xf1c2('0xd7')](_0x225af4);}})['then'](function(_0x1a30c3){if(_0x1a30c3){_0x5df493=_0x1a30c3['length'];if(!_0x545943[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x225af4[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x545943[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x225af4['offset']=qs[_0xf1c2('0x36')](_0x545943[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x56b4d7['getChatInteractions'](_0x225af4);}})[_0xf1c2('0x27')](function(_0x107f26){if(_0x107f26){return _0x107f26?{'count':_0x5df493,'rows':_0x107f26}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x29f0c2,null))[_0xf1c2('0x31')](handleError(_0x29f0c2,null));};exports[_0xf1c2('0xd9')]=function(_0x5e2f9e,_0x45b984,_0x2c12c0){var _0x1c889e={};var _0x505272={};var _0x3ed02d;var _0x840411;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x5e2f9e[_0xf1c2('0x67')]['id']}})['then'](handleEntityNotFound(_0x45b984,null))[_0xf1c2('0x27')](function(_0x62de44){if(_0x62de44){_0x3ed02d=_0x62de44;_0x505272[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xda')][_0xf1c2('0x4c')]);_0x505272[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x5e2f9e['query']);_0x505272['filters']=_[_0xf1c2('0x56')](_0x505272['model'],_0x505272['query']);_0x1c889e['attributes']=_[_0xf1c2('0x56')](_0x505272[_0xf1c2('0x4f')],qs['fields'](_0x5e2f9e[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x1c889e[_0xf1c2('0x57')]=_0x1c889e[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x1c889e[_0xf1c2('0x57')]:_0x505272[_0xf1c2('0x4f')];_0x1c889e[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x5e2f9e['query'][_0xf1c2('0x5c')]);_0x1c889e[_0xf1c2('0x5d')]=qs['filters'](_[_0xf1c2('0xce')](_0x5e2f9e[_0xf1c2('0x54')],_0x505272[_0xf1c2('0x68')]));if(_0x5e2f9e[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x1c889e[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x1c889e[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x1c889e[_0xf1c2('0x57')],function(_0x3009b4){var _0x5c3832={};_0x5c3832[_0x3009b4]={'$like':'%'+_0x5e2f9e[_0xf1c2('0x54')]['filter']+'%'};return _0x5c3832;})});}_0x1c889e=_['merge']({},_0x1c889e,_0x5e2f9e[_0xf1c2('0x62')]);return _0x3ed02d[_0xf1c2('0xd9')](_0x1c889e);}})[_0xf1c2('0x27')](function(_0x1e90f0){if(_0x1e90f0){_0x840411=_0x1e90f0[_0xf1c2('0x59')];if(!_0x5e2f9e['query'][_0xf1c2('0xc6')]('nolimit')){_0x1c889e[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x5e2f9e[_0xf1c2('0x54')]['limit']);_0x1c889e['offset']=qs[_0xf1c2('0x36')](_0x5e2f9e[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x3ed02d[_0xf1c2('0xd9')](_0x1c889e);}})[_0xf1c2('0x27')](function(_0x1f03bd){if(_0x1f03bd){return _0x1f03bd?{'count':_0x840411,'rows':_0x1f03bd}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x45b984,null))[_0xf1c2('0x31')](handleError(_0x45b984,null));};exports[_0xf1c2('0xdb')]=function(_0x4981e8,_0xccf39b,_0x41a7a){var _0x4b1aaa={'raw':!![],'where':{}};var _0x132f53={};var _0x50c73e={'count':0x0,'rows':[]};return db['User'][_0xf1c2('0x97')]({'where':{'id':_0x4981e8[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0xccf39b,null))[_0xf1c2('0x27')](function(_0x2e4305){if(_0x2e4305){_0x132f53[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db['MailInteraction'][_0xf1c2('0x4c')]);_0x132f53[_0xf1c2('0x54')]=_['keys'](_0x4981e8[_0xf1c2('0x54')]);_0x132f53['filters']=_[_0xf1c2('0x56')](_0x132f53[_0xf1c2('0x4f')],_0x132f53['query']);_0x4b1aaa['attributes']=_['intersection'](_0x132f53[_0xf1c2('0x4f')],qs['fields'](_0x4981e8[_0xf1c2('0x54')]['fields']));_0x4b1aaa[_0xf1c2('0x57')]=_0x4b1aaa[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x4b1aaa[_0xf1c2('0x57')]:_0x132f53[_0xf1c2('0x4f')];if(!_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x4b1aaa[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x4981e8['query'][_0xf1c2('0x37')]);_0x4b1aaa[_0xf1c2('0x36')]=qs[_0xf1c2('0x36')](_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0x36')]);}_0x4b1aaa[_0xf1c2('0x5b')]=qs['sort'](_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x4b1aaa[_0xf1c2('0x5d')]=qs['filters'](_[_0xf1c2('0xce')](_0x4981e8['query'],_0x132f53[_0xf1c2('0x68')]));_0x4b1aaa[_0xf1c2('0x5d')][_0xf1c2('0xd4')]=_0x2e4305['id'];if(_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x4b1aaa[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x4b1aaa['where'],{'$or':_[_0xf1c2('0x51')](_0x4b1aaa[_0xf1c2('0x57')],function(_0x593916){var _0x506b8e={};_0x506b8e[_0x593916]={'$like':'%'+_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x506b8e;})});}_0x4b1aaa=_[_0xf1c2('0x5e')]({},_0x4b1aaa,_0x4981e8[_0xf1c2('0x62')]);return db[_0xf1c2('0xdc')][_0xf1c2('0x63')]({'where':_0x4b1aaa['where']})['then'](function(_0x84d76f){_0x50c73e[_0xf1c2('0x63')]=_0x84d76f;if(_0x4981e8[_0xf1c2('0x54')][_0xf1c2('0x64')]){_0x4b1aaa[_0xf1c2('0x69')]=[{'all':!![]}];}return db[_0xf1c2('0xdc')][_0xf1c2('0x65')](_0x4b1aaa);})[_0xf1c2('0x27')](function(_0x26ac98){_0x50c73e[_0xf1c2('0x66')]=_0x26ac98;return _0x50c73e;});}})[_0xf1c2('0x27')](respondWithFilteredResult(_0xccf39b,_0x4b1aaa))['catch'](handleError(_0xccf39b,null));};exports[_0xf1c2('0xdd')]=function(_0x3dfbbe,_0x51c711,_0x21c820){var _0x16bddd={};var _0x5851b3={};var _0x5a8095;var _0x24a962;return db['User']['findOne']({'where':{'id':_0x3dfbbe[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x51c711,null))[_0xf1c2('0x27')](function(_0x235574){if(_0x235574){_0x5a8095=_0x235574;_0x5851b3[_0xf1c2('0x4f')]=_['keys'](db[_0xf1c2('0xde')][_0xf1c2('0x4c')]);_0x5851b3['query']=_['keys'](_0x3dfbbe[_0xf1c2('0x54')]);_0x5851b3[_0xf1c2('0x68')]=_['intersection'](_0x5851b3[_0xf1c2('0x4f')],_0x5851b3[_0xf1c2('0x54')]);_0x16bddd[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x5851b3[_0xf1c2('0x4f')],qs['fields'](_0x3dfbbe[_0xf1c2('0x54')]['fields']));_0x16bddd['attributes']=_0x16bddd[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x16bddd['attributes']:_0x5851b3[_0xf1c2('0x4f')];_0x16bddd['order']=qs[_0xf1c2('0x5c')](_0x3dfbbe[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x16bddd['where']=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x3dfbbe[_0xf1c2('0x54')],_0x5851b3[_0xf1c2('0x68')]));if(_0x3dfbbe[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x16bddd['where']=_[_0xf1c2('0x5e')](_0x16bddd[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x16bddd[_0xf1c2('0x57')],function(_0x570e8a){var _0x44e7fb={};_0x44e7fb[_0x570e8a]={'$like':'%'+_0x3dfbbe['query'][_0xf1c2('0x44')]+'%'};return _0x44e7fb;})});}_0x16bddd=_[_0xf1c2('0x5e')]({},_0x16bddd,_0x3dfbbe[_0xf1c2('0x62')]);return _0x5a8095['getSmsInteractions'](_0x16bddd);}})[_0xf1c2('0x27')](function(_0x1d3558){if(_0x1d3558){_0x24a962=_0x1d3558[_0xf1c2('0x59')];if(!_0x3dfbbe['query'][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x16bddd[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x3dfbbe[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x16bddd['offset']=qs[_0xf1c2('0x36')](_0x3dfbbe[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x5a8095[_0xf1c2('0xdd')](_0x16bddd);}})['then'](function(_0x107365){if(_0x107365){return _0x107365?{'count':_0x24a962,'rows':_0x107365}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x51c711,null))['catch'](handleError(_0x51c711,null));};exports[_0xf1c2('0xdf')]=function(_0x49ce0a,_0x203c36,_0x56f9bd){var _0x7a1003={};var _0x79ed3a={};var _0x72fb42;var _0x1aa1a6;return db['User'][_0xf1c2('0x97')]({'where':{'id':_0x49ce0a['params']['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x203c36,null))['then'](function(_0x40d9c5){if(_0x40d9c5){_0x72fb42=_0x40d9c5;_0x79ed3a[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db['FaxInteraction'][_0xf1c2('0x4c')]);_0x79ed3a[_0xf1c2('0x54')]=_['keys'](_0x49ce0a[_0xf1c2('0x54')]);_0x79ed3a[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x79ed3a['model'],_0x79ed3a[_0xf1c2('0x54')]);_0x7a1003[_0xf1c2('0x57')]=_[_0xf1c2('0x56')](_0x79ed3a[_0xf1c2('0x4f')],qs['fields'](_0x49ce0a[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x7a1003[_0xf1c2('0x57')]=_0x7a1003[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x7a1003['attributes']:_0x79ed3a[_0xf1c2('0x4f')];_0x7a1003[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x49ce0a[_0xf1c2('0x54')]['sort']);_0x7a1003['where']=qs[_0xf1c2('0x68')](_['pick'](_0x49ce0a[_0xf1c2('0x54')],_0x79ed3a[_0xf1c2('0x68')]));if(_0x49ce0a[_0xf1c2('0x54')]['filter']){_0x7a1003['where']=_[_0xf1c2('0x5e')](_0x7a1003['where'],{'$or':_[_0xf1c2('0x51')](_0x7a1003[_0xf1c2('0x57')],function(_0x180c2c){var _0x8df080={};_0x8df080[_0x180c2c]={'$like':'%'+_0x49ce0a[_0xf1c2('0x54')]['filter']+'%'};return _0x8df080;})});}_0x7a1003=_[_0xf1c2('0x5e')]({},_0x7a1003,_0x49ce0a[_0xf1c2('0x62')]);return _0x72fb42[_0xf1c2('0xdf')](_0x7a1003);}})[_0xf1c2('0x27')](function(_0x182752){if(_0x182752){_0x1aa1a6=_0x182752[_0xf1c2('0x59')];if(!_0x49ce0a[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x7a1003[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x49ce0a[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x7a1003['offset']=qs['offset'](_0x49ce0a[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x72fb42[_0xf1c2('0xdf')](_0x7a1003);}})[_0xf1c2('0x27')](function(_0x31fa56){if(_0x31fa56){return _0x31fa56?{'count':_0x1aa1a6,'rows':_0x31fa56}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x203c36,null))[_0xf1c2('0x31')](handleError(_0x203c36,null));};exports[_0xf1c2('0xe0')]=function(_0x4a27e8,_0x51b98a,_0x3d1068){var _0x5b7a8e={};var _0x12223f={};var _0x4afcb4;var _0x3363b8;return db['User']['findOne']({'where':{'id':_0x4a27e8[_0xf1c2('0x67')]['id']}})['then'](handleEntityNotFound(_0x51b98a,null))[_0xf1c2('0x27')](function(_0x319d77){if(_0x319d77){_0x4afcb4=_0x319d77;_0x12223f[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0xe1')][_0xf1c2('0x4c')]);_0x12223f[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x4a27e8[_0xf1c2('0x54')]);_0x12223f['filters']=_['intersection'](_0x12223f['model'],_0x12223f[_0xf1c2('0x54')]);_0x5b7a8e['attributes']=_[_0xf1c2('0x56')](_0x12223f['model'],qs[_0xf1c2('0x58')](_0x4a27e8['query'][_0xf1c2('0x58')]));_0x5b7a8e['attributes']=_0x5b7a8e['attributes'][_0xf1c2('0x59')]?_0x5b7a8e[_0xf1c2('0x57')]:_0x12223f['model'];_0x5b7a8e[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x4a27e8[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x5b7a8e[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x4a27e8[_0xf1c2('0x54')],_0x12223f[_0xf1c2('0x68')]));if(_0x4a27e8[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x5b7a8e['where']=_[_0xf1c2('0x5e')](_0x5b7a8e['where'],{'$or':_['map'](_0x5b7a8e[_0xf1c2('0x57')],function(_0x369bba){var _0x5074c0={};_0x5074c0[_0x369bba]={'$like':'%'+_0x4a27e8['query'][_0xf1c2('0x44')]+'%'};return _0x5074c0;})});}_0x5b7a8e=_[_0xf1c2('0x5e')]({},_0x5b7a8e,_0x4a27e8[_0xf1c2('0x62')]);return _0x4afcb4[_0xf1c2('0xe0')](_0x5b7a8e);}})[_0xf1c2('0x27')](function(_0x1b6b1b){if(_0x1b6b1b){_0x3363b8=_0x1b6b1b[_0xf1c2('0x59')];if(!_0x4a27e8[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x5b7a8e['limit']=qs[_0xf1c2('0x37')](_0x4a27e8[_0xf1c2('0x54')]['limit']);_0x5b7a8e[_0xf1c2('0x36')]=qs['offset'](_0x4a27e8[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x4afcb4[_0xf1c2('0xe0')](_0x5b7a8e);}})['then'](function(_0x11b8b9){if(_0x11b8b9){return _0x11b8b9?{'count':_0x3363b8,'rows':_0x11b8b9}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x51b98a,null))[_0xf1c2('0x31')](handleError(_0x51b98a,null));};exports[_0xf1c2('0xe2')]=function(_0x5cb381,_0x3cc196,_0x13bf25){var _0xcac66b;var _0x845711;var _0x25c975;var _0x36750d=!_[_0xf1c2('0x7b')](_0x5cb381[_0xf1c2('0x67')]['id'])?_0x5cb381[_0xf1c2('0x67')]['id']:!_['isNil'](_0x5cb381[_0xf1c2('0x90')]['id'])?_0x5cb381[_0xf1c2('0x90')]['id']:null;return db['User'][_0xf1c2('0x46')]({'where':{'id':_0x36750d,'role':{'$or':[_0xf1c2('0x9e'),'user',_0xf1c2('0x41')]}},'attributes':['id',_0xf1c2('0x48'),_0xf1c2('0xe3'),_0xf1c2('0xe4'),_0xf1c2('0x45'),_0xf1c2('0x77'),_0xf1c2('0xa3')]})['then'](function(_0x3796ce){if(_0x3796ce){if(_0x3796ce[_0xf1c2('0x45')]==='agent'){_0xcac66b=_0x3796ce;if(_0x5cb381[_0xf1c2('0x6b')][_0xf1c2('0xa5')]){_0x25c975=util['format'](_0xf1c2('0xe5'),_0xcac66b[_0x5cb381[_0xf1c2('0x6b')]['interface']]);}else if(_0x5cb381[_0xf1c2('0x6b')][_0xf1c2('0xe6')]){_0x25c975=util[_0xf1c2('0xb2')](_0xf1c2('0xb3'),_0x5cb381[_0xf1c2('0x6b')][_0xf1c2('0xe6')]);}else{_0x25c975=util['format'](_0xf1c2('0xb3'),_0xcac66b[_0xf1c2('0x48')]);}socket['to'](util[_0xf1c2('0xb2')](_0xf1c2('0xe7'),_0xcac66b[_0xf1c2('0x48')]))[_0xf1c2('0xac')]('user:forcelogout',{'ip':_0x5cb381[_0xf1c2('0xe8')][_0xf1c2('0xe9')]||_0x5cb381[_0xf1c2('0xea')][_0xf1c2('0xeb')]||_0x5cb381[_0xf1c2('0xec')][_0xf1c2('0xeb')]||_0x5cb381['connection'][_0xf1c2('0xec')][_0xf1c2('0xeb')]});return db[_0xf1c2('0xb4')][_0xf1c2('0x3e')]({'where':{'membername':_0xcac66b[_0xf1c2('0x48')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xf1c2('0x24'))](_0xf1c2('0xed'));}})['then'](function(){if(_0xcac66b){return _0xcac66b[_0xf1c2('0xee')]({'raw':!![]});}})['then'](function(_0x409209){if(_0xcac66b){var _0x4abd0b=[];if(_0x409209){_0x845711=_0x409209;if(_0x845711[_0xf1c2('0x59')]){for(var _0x4b8fea=0x0;_0x4b8fea<_0x845711['length'];_0x4b8fea++){_0x4abd0b[_0xf1c2('0xb1')]({'membername':_0xcac66b['name'],'UserId':_0xcac66b['id'],'queue_name':_0x845711[_0x4b8fea]['name'],'VoiceQueueId':_0x845711[_0x4b8fea]['id'],'interface':_0x25c975,'paused':_0xcac66b[_0xf1c2('0xa3')]||![],'penalty':_0x845711[_0x4b8fea][_0xf1c2('0xef')]||0x0});}return BPromise[_0xf1c2('0xf0')](_0x4abd0b,function(_0x45864f){return db[_0xf1c2('0xb4')][_0xf1c2('0xb5')](_0x45864f);});}}}})[_0xf1c2('0x27')](function(){if(_0xcac66b){return db[_0xf1c2('0xf1')][_0xf1c2('0x65')]({'where':{'membername':_0xcac66b['name'],'exitAt':null}});}})[_0xf1c2('0x27')](function(_0x57ccfb){if(_0xcac66b){var _0x5c4cfc=[];_0x57ccfb[_0xf1c2('0xf2')](function(_0x3ae3b0){_0x5c4cfc[_0xf1c2('0xb1')](_0x3ae3b0[_0xf1c2('0x3d')]({'exitAt':moment()['format'](_0xf1c2('0xf3'))}));});return BPromise['all'](_0x5c4cfc);}})['then'](function(){if(_0xcac66b){var _0x47d69b=[];var _0x341d58=[];var _0x1b4c00=utils[_0xf1c2('0xf4')]();var _0x31456b={'membername':_0xcac66b[_0xf1c2('0x48')],'interface':_0x25c975,'enterAt':moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3')),'role':_0xcac66b[_0xf1c2('0x45')],'internal':_0xcac66b[_0xf1c2('0x77')]};_0x1b4c00['forEach'](function(_0x222aed){_0x47d69b[_0xf1c2('0xb1')](_[_0xf1c2('0x5e')]({'channel':_0x222aed,'type':_0xf1c2('0xf5'),'data1':_0x5cb381[_0xf1c2('0x6b')][_0xf1c2('0xf6')],'data2':_0x25c975},_0x31456b));if(_0xcac66b[_0xf1c2('0xa3')]){_0x341d58['push'](_[_0xf1c2('0x5e')]({'channel':_0x222aed,'type':_0xf1c2('0xf7'),'data1':_0xf1c2('0xf8')},_0x31456b));}});return db['MemberReport']['bulkCreate'](_0x47d69b[_0xf1c2('0xf9')](_0x341d58),{'individualHooks':!![]});}})[_0xf1c2('0x27')](function(){if(_0xcac66b){return _0xcac66b['update']({'online':!![],'lastLoginAt':moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3')),'voicePause':_0xcac66b[_0xf1c2('0xa3')]||![],'mailPause':_0xcac66b['loginInPause']||![],'chatPause':_0xcac66b[_0xf1c2('0xa3')]||![],'faxPause':_0xcac66b[_0xf1c2('0xa3')]||![],'smsPause':_0xcac66b[_0xf1c2('0xa3')]||![],'openchannelPause':_0xcac66b[_0xf1c2('0xa3')]||![],'whatsappPause':_0xcac66b['loginInPause']||![],'pauseType':_0xcac66b[_0xf1c2('0xa3')]?_0xf1c2('0xf8'):null,'interface':_0x25c975,'lastPauseAt':moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3'))});}})[_0xf1c2('0x27')](function(_0xbb002d){if(_0x5cb381['isMiddleware']){return _0x13bf25();}else{return BPromise['resolve'](_0xbb002d)['then'](respondWithResult(_0x3cc196,null));}})[_0xf1c2('0x31')](handleError(_0x3cc196,null));};exports[_0xf1c2('0xfa')]=function(_0x602da7,_0x17ce37,_0x40403c){var _0x1b08fb;return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x602da7[_0xf1c2('0x67')]['id'],'role':_0xf1c2('0x41')},'attributes':['id',_0xf1c2('0x48'),_0xf1c2('0x45')]})[_0xf1c2('0x27')](handleEntityNotFound(_0x17ce37,null))[_0xf1c2('0x27')](function(_0x5233f5){if(_0x5233f5){_0x1b08fb=_0x5233f5;return db['UserVoiceQueueRt'][_0xf1c2('0x3e')]({'where':{'membername':_0x1b08fb['name']},'individualHooks':!![]});}})[_0xf1c2('0x27')](function(){return db[_0xf1c2('0xf1')][_0xf1c2('0x65')]({'where':{'membername':_0x1b08fb['name'],'exitAt':null}});})[_0xf1c2('0x27')](function(_0x1bbab2){var _0x498dc5=[];_0x1bbab2[_0xf1c2('0xf2')](function(_0x5f1c3f){_0x498dc5[_0xf1c2('0xb1')](_0x5f1c3f[_0xf1c2('0x3d')]({'exitAt':moment()['format'](_0xf1c2('0xf3'))}));});return BPromise[_0xf1c2('0xfb')](_0x498dc5);})[_0xf1c2('0x27')](function(){return _0x1b08fb[_0xf1c2('0x3d')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf1c2('0x27')](respondWithResult(_0x17ce37,null))[_0xf1c2('0x31')](handleError(_0x17ce37,null));};exports[_0xf1c2('0xfc')]=function(_0x265566,_0x47e946,_0x4627eb){var _0xcacdb9;return db['UserVoiceQueueRt'][_0xf1c2('0x3d')]({'paused':0x1},{'where':{'UserId':_0x265566[_0xf1c2('0x67')]['id']},'individualHooks':!![]})[_0xf1c2('0x27')](function(){return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x265566['params']['id'],'role':_0xf1c2('0x41')},'attributes':['id',_0xf1c2('0x48'),'role','internal','interface']});})['then'](handleEntityNotFound(_0x47e946,null))[_0xf1c2('0x27')](function(_0x255853){if(_0x255853){_0xcacdb9=_0x255853;return respondWithRpcPromise(_0xf1c2('0xfd'),_0xf1c2('0xfc'),{'id':_0xcacdb9['id'],'name':_0xcacdb9[_0xf1c2('0x48')],'pause':!![]});}})[_0xf1c2('0x27')](function(){if(_0xcacdb9){return db[_0xf1c2('0xf1')][_0xf1c2('0x65')]({'where':{'membername':_0xcacdb9[_0xf1c2('0x48')],'type':_0xf1c2('0xf7'),'exitAt':null}});}})[_0xf1c2('0x27')](function(_0x1faadc){if(_0x1faadc[_0xf1c2('0x59')]){var _0x5194e0=moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3'));for(var _0x26b6e7=0x0,_0x1257ad=_0x1faadc[_0xf1c2('0x59')];_0x26b6e7<_0x1257ad;_0x26b6e7++){_0x1faadc[_0x26b6e7]['updateAttributes']({'exitAt':_0x5194e0});}}})['then'](function(){var _0x591d03=[];var _0xcc4c6a=utils[_0xf1c2('0xf4')]();_0xcc4c6a[_0xf1c2('0xf2')](function(_0x48a151){_0x591d03[_0xf1c2('0xb1')]({'channel':_0x48a151,'membername':_0xcacdb9[_0xf1c2('0x48')],'interface':_[_0xf1c2('0x7b')](_0xcacdb9[_0xf1c2('0xa5')])?util[_0xf1c2('0xb2')](_0xf1c2('0xb3'),_0xcacdb9[_0xf1c2('0x48')]):_0xcacdb9[_0xf1c2('0xa5')],'type':_0xf1c2('0xf7'),'enterAt':moment()['format'](_0xf1c2('0xf3')),'data1':_0x265566[_0xf1c2('0x6b')][_0xf1c2('0x4d')]||'DEFAULT\x20PAUSE','role':_0xcacdb9[_0xf1c2('0x45')],'internal':_0xcacdb9[_0xf1c2('0x77')]});});return db[_0xf1c2('0xf1')][_0xf1c2('0x6a')](_0x591d03,{'individualHooks':!![]});})[_0xf1c2('0x27')](function(){return _0xcacdb9[_0xf1c2('0x3d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x265566[_0xf1c2('0x6b')][_0xf1c2('0x4d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xf1c2('0xf3'))});})[_0xf1c2('0x27')](respondWithResult(_0x47e946,null))[_0xf1c2('0x31')](handleError(_0x47e946,null));};exports[_0xf1c2('0xfe')]=function(_0x18983c,_0x373f2e,_0x26e6e5){var _0x45c49f;return db[_0xf1c2('0x4b')]['find']({'where':{'id':_0x18983c[_0xf1c2('0x67')]['id']},'attributes':['id','name',_0xf1c2('0x45'),_0xf1c2('0xa4'),'mailPause','chatPause',_0xf1c2('0xff'),_0xf1c2('0x100'),_0xf1c2('0x101'),_0xf1c2('0x102'),'pauseType','lastPauseAt']})['then'](handleEntityNotFound(_0x373f2e,null))[_0xf1c2('0x27')](function(_0xba04a4){if(_0xba04a4){_0x45c49f=_0xba04a4;if(_0x18983c['body'][_0xf1c2('0xa2')]&&!utils[_0xf1c2('0xcd')](_0x18983c[_0xf1c2('0x6b')][_0xf1c2('0xa2')])){throw new db['Sequelize'][(_0xf1c2('0x24'))](_0xf1c2('0xb7'));}switch(_0x18983c[_0xf1c2('0x6b')][_0xf1c2('0xa2')]){case'voice':return respondWithRpcPromise(_0xf1c2('0xfd'),_0xf1c2('0xfe'),{'id':_0x45c49f['id'],'name':_0x45c49f['name'],'pause':![]})[_0xf1c2('0x27')](function(){return db['UserVoiceQueueRt'][_0xf1c2('0x3d')]({'paused':0x0},{'where':{'UserId':_0x45c49f['id']},'individualHooks':!![]});})[_0xf1c2('0x27')](function(){return db[_0xf1c2('0xf1')][_0xf1c2('0x46')]({'where':{'channel':_0x18983c[_0xf1c2('0x6b')]['channel'],'membername':_0x45c49f['name'],'type':_0xf1c2('0xf7'),'exitAt':null}});})[_0xf1c2('0x27')](function(_0x4f6d22){if(_0x4f6d22){return _0x4f6d22[_0xf1c2('0x3d')]({'exitAt':moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3')),'data2':_0xf1c2('0x103')},{'individualHooks':!![]});}return null;})[_0xf1c2('0x27')](function(){return _0x45c49f[_0xf1c2('0x3d')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0xf1c2('0x104'):case _0xf1c2('0x105'):case _0xf1c2('0x106'):return db[_0xf1c2('0xf1')][_0xf1c2('0x46')]({'where':{'channel':_0x18983c[_0xf1c2('0x6b')][_0xf1c2('0xa2')],'membername':_0x45c49f[_0xf1c2('0x48')],'type':_0xf1c2('0xf7'),'exitAt':null}})['then'](function(_0x26a870){if(_0x26a870){return _0x26a870[_0xf1c2('0x3d')]({'exitAt':moment()[_0xf1c2('0xb2')](_0xf1c2('0xf3')),'data2':_0xf1c2('0x103')},{'individualHooks':!![]});}return null;})[_0xf1c2('0x27')](function(){var _0x25ae84={};_['set'](_0x25ae84,util[_0xf1c2('0xb2')](_0xf1c2('0x107'),_0x18983c[_0xf1c2('0x6b')]['channel'],_0xf1c2('0x108')),![]);return _0x45c49f[_0xf1c2('0x3d')](_0x25ae84);});default:return respondWithRpcPromise('QueuePause',_0xf1c2('0xfe'),{'id':_0x45c49f['id'],'name':_0x45c49f[_0xf1c2('0x48')],'pause':![]})['then'](function(){return db[_0xf1c2('0xb4')][_0xf1c2('0x3d')]({'paused':0x0},{'where':{'UserId':_0x45c49f['id']}});})[_0xf1c2('0x27')](function(){return db[_0xf1c2('0xf1')][_0xf1c2('0x65')]({'where':{'membername':_0x45c49f[_0xf1c2('0x48')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x570783){var _0x166532=[];_0x570783['forEach'](function(_0x12361e){_0x166532[_0xf1c2('0xb1')](_0x12361e['update']({'exitAt':moment()['format'](_0xf1c2('0xf3')),'data2':'manual'}));});return BPromise[_0xf1c2('0xfb')](_0x166532);})[_0xf1c2('0x27')](function(){return _0x45c49f['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x373f2e,null))[_0xf1c2('0x31')](handleError(_0x373f2e,null));};exports[_0xf1c2('0x109')]=function(_0x84f937,_0x1406c5,_0x249dbf){var _0x4880d7={};var _0x4c91dd={};var _0x567a7a;var _0x1a4d41;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x84f937['params']['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x1406c5,null))[_0xf1c2('0x27')](function(_0x2d6e3c){if(_0x2d6e3c){_0x567a7a=_0x2d6e3c;_0x4c91dd[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db['Team'][_0xf1c2('0x4c')]);_0x4c91dd[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x84f937[_0xf1c2('0x54')]);_0x4c91dd[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x4c91dd[_0xf1c2('0x4f')],_0x4c91dd[_0xf1c2('0x54')]);_0x4880d7[_0xf1c2('0x57')]=_['intersection'](_0x4c91dd[_0xf1c2('0x4f')],qs[_0xf1c2('0x58')](_0x84f937[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x4880d7[_0xf1c2('0x57')]=_0x4880d7['attributes']['length']?_0x4880d7[_0xf1c2('0x57')]:_0x4c91dd[_0xf1c2('0x4f')];_0x4880d7[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x84f937[_0xf1c2('0x54')]['sort']);_0x4880d7[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_[_0xf1c2('0xce')](_0x84f937[_0xf1c2('0x54')],_0x4c91dd[_0xf1c2('0x68')]));if(_0x84f937[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x4880d7[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x4880d7[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x4880d7['attributes'],function(_0x5bcba9){var _0x4b0aca={};_0x4b0aca[_0x5bcba9]={'$like':'%'+_0x84f937[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x4b0aca;})});}_0x4880d7=_[_0xf1c2('0x5e')]({},_0x4880d7,_0x84f937[_0xf1c2('0x62')]);return _0x567a7a[_0xf1c2('0x109')](_0x4880d7);}})[_0xf1c2('0x27')](function(_0x29ddee){if(_0x29ddee){_0x1a4d41=_0x29ddee[_0xf1c2('0x59')];if(!_0x84f937[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x4880d7['limit']=qs[_0xf1c2('0x37')](_0x84f937['query'][_0xf1c2('0x37')]);_0x4880d7['offset']=qs[_0xf1c2('0x36')](_0x84f937[_0xf1c2('0x54')][_0xf1c2('0x36')]);}return _0x567a7a[_0xf1c2('0x109')](_0x4880d7);}})[_0xf1c2('0x27')](function(_0x405f29){if(_0x405f29){return _0x405f29?{'count':_0x1a4d41,'rows':_0x405f29}:null;}})['then'](respondWithResult(_0x1406c5,null))['catch'](handleError(_0x1406c5,null));};exports[_0xf1c2('0x10a')]=function(_0x187b2a,_0x2cb48f){return db[_0xf1c2('0x4b')][_0xf1c2('0x46')]({'where':{'id':_0x187b2a[_0xf1c2('0x67')]['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x2cb48f,null))['then'](function(_0x902144){if(_0x902144){var _0x56928d=_0x902144[_0xf1c2('0x92')]({'plain':!![]});return _0x902144[_0xf1c2('0x10a')](_0x187b2a['body'][_0xf1c2('0x6e')],_['omit'](_0x187b2a[_0xf1c2('0x6b')],[_0xf1c2('0x6e'),'id'])||{})[_0xf1c2('0x27')](function(){for(var _0x5292ab=0x0;_0x5292ab<_0x187b2a[_0xf1c2('0x6b')][_0xf1c2('0x6e')][_0xf1c2('0x59')];_0x5292ab++){var _0x54952b=[];db[_0xf1c2('0x10b')]['findOne']({'where':{'id':_0x187b2a[_0xf1c2('0x6b')]['ids'][_0x5292ab]}})[_0xf1c2('0x27')](function(_0x13edbd){_0x54952b['push'](_0x13edbd['getVoiceQueues']()[_0xf1c2('0x27')](function(_0xede140){for(var _0x312428=0x0;_0x312428<_0xede140[_0xf1c2('0x59')];_0x312428++){_0xede140[_0x312428]['setDataValue'](_0xf1c2('0xa2'),_0xf1c2('0x10c'));}return _0xede140;}));_0x54952b['push'](_0x13edbd[_0xf1c2('0x10d')]()[_0xf1c2('0x27')](function(_0x5d6f2b){for(var _0x581b12=0x0;_0x581b12<_0x5d6f2b[_0xf1c2('0x59')];_0x581b12++){_0x5d6f2b[_0x581b12]['setDataValue']('channel',_0xf1c2('0x10e'));}return _0x5d6f2b;}));_0x54952b['push'](_0x13edbd[_0xf1c2('0x10f')]()[_0xf1c2('0x27')](function(_0x2cc007){for(var _0x1236a8=0x0;_0x1236a8<_0x2cc007['length'];_0x1236a8++){_0x2cc007[_0x1236a8]['setDataValue'](_0xf1c2('0xa2'),_0xf1c2('0x110'));}return _0x2cc007;}));_0x54952b[_0xf1c2('0xb1')](_0x13edbd[_0xf1c2('0x111')]()[_0xf1c2('0x27')](function(_0x1ed4ca){for(var _0xa79889=0x0;_0xa79889<_0x1ed4ca[_0xf1c2('0x59')];_0xa79889++){_0x1ed4ca[_0xa79889][_0xf1c2('0x112')]('channel',_0xf1c2('0x113'));}return _0x1ed4ca;}));_0x54952b[_0xf1c2('0xb1')](_0x13edbd[_0xf1c2('0x114')]()['then'](function(_0xde9169){for(var _0x1c2815=0x0;_0x1c2815<_0xde9169[_0xf1c2('0x59')];_0x1c2815++){_0xde9169[_0x1c2815][_0xf1c2('0x112')](_0xf1c2('0xa2'),_0xf1c2('0x115'));}return _0xde9169;}));_0x54952b[_0xf1c2('0xb1')](_0x13edbd[_0xf1c2('0x116')]()['then'](function(_0x25f6de){for(var _0x4bda13=0x0;_0x4bda13<_0x25f6de[_0xf1c2('0x59')];_0x4bda13++){_0x25f6de[_0x4bda13][_0xf1c2('0x112')]('channel',_0xf1c2('0x117'));}return _0x25f6de;}));_0x54952b['push'](_0x13edbd[_0xf1c2('0x118')]()['then'](function(_0x8ee9a7){for(var _0x47a5b5=0x0;_0x47a5b5<_0x8ee9a7[_0xf1c2('0x59')];_0x47a5b5++){_0x8ee9a7[_0x47a5b5][_0xf1c2('0x112')](_0xf1c2('0xa2'),_0xf1c2('0x119'));}return _0x8ee9a7;}));return BPromise[_0xf1c2('0xfb')](_0x54952b);})['then'](function(_0x113e39){var _0x1c2542=_[_0xf1c2('0x11a')](_0x113e39);_0x54952b=[];return db['sequelize'][_0xf1c2('0x11b')](function(_0x4287a1){for(var _0x2ed185=0x0;_0x2ed185<_0x1c2542['length'];_0x2ed185++){_0x54952b[_0xf1c2('0xb1')](_0x1c2542[_0x2ed185][_0xf1c2('0x11c')](_0x56928d['id']),{'transaction':_0x4287a1});}return BPromise['all'](_0x54952b)[_0xf1c2('0x27')](function(){if(_0x56928d[_0xf1c2('0xb0')]){return BPromise[_0xf1c2('0xf0')](_[_0xf1c2('0x44')](_0x1c2542,function(_0x3290cd){return _0x3290cd[_0xf1c2('0x11d')](_0xf1c2('0xa2'))===_0xf1c2('0x10c');}),function(_0xfa09b6){return db[_0xf1c2('0xb4')][_0xf1c2('0xb5')]({'membername':_0x56928d['name'],'UserId':_0x56928d['id'],'queue_name':_0xfa09b6['name'],'VoiceQueueId':_0xfa09b6['id'],'interface':_[_0xf1c2('0x7b')](_0x56928d[_0xf1c2('0xa5')])?util[_0xf1c2('0xb2')](_0xf1c2('0xb3'),_0x56928d[_0xf1c2('0x48')]):_0x56928d[_0xf1c2('0xa5')],'paused':_0x56928d['voicePause']||![],'penalty':_0x56928d['penalty']},{'transaction':_0x4287a1});});}else{return;}})[_0xf1c2('0x27')](function(){for(var _0x9b0ed=0x0;_0x9b0ed<_0x1c2542['length'];_0x9b0ed++){var _0x2a11ae=_0x1c2542[_0x9b0ed][_0xf1c2('0x11d')](_0xf1c2('0xa2'));var _0x5bfb8a=_0x2a11ae+_0xf1c2('0xab');socket[_0xf1c2('0xac')]('user'+_0x2a11ae+_0xf1c2('0xad'),{'UserId':_0x56928d['id'],['queueField']:_0x1c2542[_0x9b0ed]['id']});}});});});}});}})[_0xf1c2('0x27')](respondWithStatusCode(_0x2cb48f,null))[_0xf1c2('0x31')](handleError(_0x2cb48f,null));};exports[_0xf1c2('0x11e')]=function(_0x4b1986,_0x185cfd){return db['User']['findOne']({'where':{'id':_0x4b1986[_0xf1c2('0x67')]['id']}})['then'](handleEntityNotFound(_0x185cfd,null))['then'](function(_0x56c5af){if(_0x56c5af){var _0x54bcb4=_0x56c5af[_0xf1c2('0x92')]({'plain':!![]});var _0x167e24=_0x4b1986[_0xf1c2('0x54')][_0xf1c2('0x6e')];return _0x56c5af[_0xf1c2('0x11e')](_0x167e24)['then'](function(){for(var _0x367cde=0x0;_0x367cde<_0x167e24[_0xf1c2('0x59')];_0x367cde++){var _0x44640e=[];db['Team'][_0xf1c2('0x97')]({'where':{'id':_0x167e24[_0x367cde]}})[_0xf1c2('0x27')](function(_0x18a09f){_0x44640e[_0xf1c2('0xb1')](_0x18a09f[_0xf1c2('0xee')]()[_0xf1c2('0x27')](function(_0x3bf0bb){for(var _0x10403e=0x0;_0x10403e<_0x3bf0bb[_0xf1c2('0x59')];_0x10403e++){_0x3bf0bb[_0x10403e][_0xf1c2('0x112')](_0xf1c2('0xa2'),_0xf1c2('0x10c'));}return _0x3bf0bb;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f['getChatQueues']()[_0xf1c2('0x27')](function(_0x3c5ae0){for(var _0x97ffa9=0x0;_0x97ffa9<_0x3c5ae0[_0xf1c2('0x59')];_0x97ffa9++){_0x3c5ae0[_0x97ffa9]['setDataValue'](_0xf1c2('0xa2'),_0xf1c2('0x10e'));}return _0x3c5ae0;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f[_0xf1c2('0x10f')]()[_0xf1c2('0x27')](function(_0x45a6e0){for(var _0x1773ef=0x0;_0x1773ef<_0x45a6e0[_0xf1c2('0x59')];_0x1773ef++){_0x45a6e0[_0x1773ef]['setDataValue'](_0xf1c2('0xa2'),_0xf1c2('0x110'));}return _0x45a6e0;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f[_0xf1c2('0x111')]()['then'](function(_0x250a38){for(var _0x49f6ff=0x0;_0x49f6ff<_0x250a38[_0xf1c2('0x59')];_0x49f6ff++){_0x250a38[_0x49f6ff][_0xf1c2('0x112')](_0xf1c2('0xa2'),'Sms');}return _0x250a38;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f['getWhatsappQueues']()[_0xf1c2('0x27')](function(_0x372396){for(var _0x5094cb=0x0;_0x5094cb<_0x372396[_0xf1c2('0x59')];_0x5094cb++){_0x372396[_0x5094cb][_0xf1c2('0x112')](_0xf1c2('0xa2'),_0xf1c2('0x115'));}return _0x372396;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f[_0xf1c2('0x116')]()[_0xf1c2('0x27')](function(_0x56ce08){for(var _0x12718e=0x0;_0x12718e<_0x56ce08[_0xf1c2('0x59')];_0x12718e++){_0x56ce08[_0x12718e][_0xf1c2('0x112')]('channel',_0xf1c2('0x117'));}return _0x56ce08;}));_0x44640e[_0xf1c2('0xb1')](_0x18a09f[_0xf1c2('0x118')]()['then'](function(_0x3008d8){for(var _0x35b3d5=0x0;_0x35b3d5<_0x3008d8['length'];_0x35b3d5++){_0x3008d8[_0x35b3d5]['setDataValue'](_0xf1c2('0xa2'),_0xf1c2('0x119'));}return _0x3008d8;}));return BPromise[_0xf1c2('0xfb')](_0x44640e);})[_0xf1c2('0x27')](function(_0x307150){var _0x1a060c=_[_0xf1c2('0x11a')](_0x307150);_0x44640e=[];return db[_0xf1c2('0x60')][_0xf1c2('0x11b')](function(_0x15c4d3){for(var _0x2c5a29=0x0;_0x2c5a29<_0x1a060c[_0xf1c2('0x59')];_0x2c5a29++){_0x44640e[_0xf1c2('0xb1')](_0x1a060c[_0x2c5a29][_0xf1c2('0x11f')](_0x54bcb4['id']),{'transaction':_0x15c4d3});}return BPromise[_0xf1c2('0xfb')](_0x44640e)[_0xf1c2('0x27')](function(){if(_0x54bcb4['online']){return BPromise[_0xf1c2('0xf0')](_[_0xf1c2('0x44')](_0x1a060c,function(_0x54ea05){return _0x54ea05[_0xf1c2('0x11d')](_0xf1c2('0xa2'))===_0xf1c2('0x10c');}),function(_0x4f2312){return db['UserVoiceQueueRt'][_0xf1c2('0x3e')]({'where':{'VoiceQueueId':_0x4f2312['id'],'UserId':_0x54bcb4['id']},'transaction':_0x15c4d3});});}else{return;}})[_0xf1c2('0x27')](function(){for(var _0x55e572=0x0;_0x55e572<_0x1a060c[_0xf1c2('0x59')];_0x55e572++){var _0x403f82=_0x1a060c[_0x55e572][_0xf1c2('0x11d')](_0xf1c2('0xa2'));var _0x1e1762=_0x403f82+'QueueId';socket[_0xf1c2('0xac')](_0xf1c2('0x90')+_0x403f82+_0xf1c2('0xb9'),{'UserId':_0x54bcb4['id'],['queueField']:_0x1a060c[_0x55e572]['id']});}});});});}});}})[_0xf1c2('0x27')](respondWithStatusCode(_0x185cfd,null))['catch'](handleError(_0x185cfd,null));};exports[_0xf1c2('0x120')]=function(_0x1d4476,_0x112715,_0x430967){var _0x1de36a={};var _0x4378d3={};var _0x1a3448;var _0x3a9100;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x1d4476['params']['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x112715,null))[_0xf1c2('0x27')](function(_0x118bb2){if(_0x118bb2){_0x1a3448=_0x118bb2;_0x4378d3[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db['CmList'][_0xf1c2('0x4c')]);_0x4378d3[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x1d4476['query']);_0x4378d3[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x4378d3['model'],_0x4378d3[_0xf1c2('0x54')]);_0x1de36a[_0xf1c2('0x57')]=_['intersection'](_0x4378d3['model'],qs[_0xf1c2('0x58')](_0x1d4476[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x1de36a['attributes']=_0x1de36a[_0xf1c2('0x57')]['length']?_0x1de36a[_0xf1c2('0x57')]:_0x4378d3['model'];_0x1de36a[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x1d4476[_0xf1c2('0x54')][_0xf1c2('0x5c')]);_0x1de36a['where']=qs['filters'](_[_0xf1c2('0xce')](_0x1d4476[_0xf1c2('0x54')],_0x4378d3[_0xf1c2('0x68')]));if(_0x1d4476['query'][_0xf1c2('0x44')]){_0x1de36a[_0xf1c2('0x5d')]=_[_0xf1c2('0x5e')](_0x1de36a[_0xf1c2('0x5d')],{'$or':_[_0xf1c2('0x51')](_0x1de36a[_0xf1c2('0x57')],function(_0x1b1276){var _0x1a389c={};_0x1a389c[_0x1b1276]={'$like':'%'+_0x1d4476[_0xf1c2('0x54')][_0xf1c2('0x44')]+'%'};return _0x1a389c;})});}_0x1de36a=_[_0xf1c2('0x5e')]({},_0x1de36a,_0x1d4476[_0xf1c2('0x62')]);return _0x1a3448[_0xf1c2('0x120')](_0x1de36a);}})[_0xf1c2('0x27')](function(_0x1ab921){if(_0x1ab921){_0x3a9100=_0x1ab921[_0xf1c2('0x59')];if(!_0x1d4476[_0xf1c2('0x54')][_0xf1c2('0xc6')](_0xf1c2('0x5a'))){_0x1de36a[_0xf1c2('0x37')]=qs[_0xf1c2('0x37')](_0x1d4476[_0xf1c2('0x54')][_0xf1c2('0x37')]);_0x1de36a[_0xf1c2('0x36')]=qs['offset'](_0x1d4476[_0xf1c2('0x54')]['offset']);}return _0x1a3448[_0xf1c2('0x120')](_0x1de36a);}})['then'](function(_0x91e4a7){if(_0x91e4a7){return _0x91e4a7?{'count':_0x3a9100,'rows':_0x91e4a7}:null;}})[_0xf1c2('0x27')](respondWithResult(_0x112715,null))[_0xf1c2('0x31')](handleError(_0x112715,null));};exports[_0xf1c2('0x121')]=function(_0x2d5aa7,_0x16ecda,_0x22960c){var _0x4f9976={};var _0x548f52={};var _0x48267f;var _0x2e48b1;return db[_0xf1c2('0x4b')][_0xf1c2('0x97')]({'where':{'id':_0x2d5aa7['params']['id']}})[_0xf1c2('0x27')](handleEntityNotFound(_0x16ecda,null))[_0xf1c2('0x27')](function(_0x25bc48){if(_0x25bc48){_0x48267f=_0x25bc48;_0x548f52[_0xf1c2('0x4f')]=_[_0xf1c2('0x55')](db[_0xf1c2('0x4b')][_0xf1c2('0x4c')]);_0x548f52[_0xf1c2('0x54')]=_[_0xf1c2('0x55')](_0x2d5aa7[_0xf1c2('0x54')]);_0x548f52[_0xf1c2('0x68')]=_[_0xf1c2('0x56')](_0x548f52['model'],_0x548f52[_0xf1c2('0x54')]);_0x4f9976[_0xf1c2('0x57')]=_['intersection'](_0x548f52['model'],qs[_0xf1c2('0x58')](_0x2d5aa7[_0xf1c2('0x54')][_0xf1c2('0x58')]));_0x4f9976[_0xf1c2('0x57')]=_0x4f9976[_0xf1c2('0x57')][_0xf1c2('0x59')]?_0x4f9976['attributes']:_0x548f52[_0xf1c2('0x4f')];_0x4f9976[_0xf1c2('0x5b')]=qs[_0xf1c2('0x5c')](_0x2d5aa7[_0xf1c2('0x54')]['sort']);_0x4f9976[_0xf1c2('0x5d')]=qs[_0xf1c2('0x68')](_['pick'](_0x2d5aa7[_0xf1c2('0x54')],_0x548f52[_0xf1c2('0x68')]));if(_0x2d5aa7[_0xf1c2('0x54')][_0xf1c2('0x44')]){_0x4f9976[_0xf1c2('0x5d')]=_['merge'](_0x4f9976[_0xf1c2('0x5d')],{'$or':_['map'](_0x4f9976[_0xf1c2('0x57')],function(_0x42771d){var _0x187f0b={};_0x187f0b[_0x42771d]={'$like':'%'+_0x2d5aa7[_0xf1c2('0x54')]['filter']+'%'};return _0x187f0b;})});}_0x4f9976['model']=db[_0xf1c2('0x4b')];_0x4f9976['as']=_0xf1c2('0x40');_0x4f9976=_[_0xf1c2('0x5e')]({},_0x4f9976,_0x2d5aa7['options']);return _0x48267f['getVoiceQueues']({'include':[_0x4f9976]});}})[_0xf1c2('0x27')](function(_0x53cc3b){if(_0x53cc3b){var _0x4e3687={},_0x4cd180=[],_0x3f53e5=0x0;for(var _0xfe5229=0x0;_0xfe5229<_0x53cc3b[_0xf1c2('0x59')];_0xfe5229+=0x1){for(var _0x392330=0x0,_0x58b56e;_0x392330<_0x53cc3b[_0xfe5229][_0xf1c2('0x40')][_0xf1c2('0x59')];_0x392330+=0x1){_0x58b56e=_0x53cc3b[_0xfe5229]['Agents'][_0x392330][_0xf1c2('0x92')]({'plain':!![]});_0x4e3687[_0x58b56e['id']]=_0x58b56e;}}_0x4e3687=_['values'](_0x4e3687);for(var _0x3b1e52=qs[_0xf1c2('0x36')](_0x2d5aa7[_0xf1c2('0x54')][_0xf1c2('0x36')]);_0x3b1e52<_0x4e3687[_0xf1c2('0x59')]&&_0x4cd180[_0xf1c2('0x59')]=_0x4d4a5b['agents']){throw new Error(_0xacc4('0x4e'));}})[_0xacc4('0x23')](function(){if(_0x2754b9){return db[_0xacc4('0x3d')]['destroy']({'where':{'membername':_0x2754b9['name']},'individualHooks':!![]});}})[_0xacc4('0x23')](function(){if(_0x2754b9){return _0x2754b9[_0xacc4('0x4f')]({'raw':!![]});}})[_0xacc4('0x23')](function(_0x5a4993){if(_0x2754b9){if(_0x5a4993){var _0x533726=[];_0x222b9e=_0x5a4993;if(_0x222b9e[_0xacc4('0x2e')]){for(var _0x1c172f=0x0;_0x1c172f<_0x222b9e[_0xacc4('0x2e')];_0x1c172f++){_0x533726[_0xacc4('0x30')](db[_0xacc4('0x3d')][_0xacc4('0x50')]({'membername':_0x2754b9[_0xacc4('0x31')],'UserId':_0x2754b9['id'],'queue_name':_0x222b9e[_0x1c172f][_0xacc4('0x31')],'VoiceQueueId':_0x222b9e[_0x1c172f]['id'],'interface':_0xbec5ac,'paused':_0x2754b9[_0xacc4('0x49')]||![],'penalty':_0x222b9e[_0x1c172f]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x533726);}}}})[_0xacc4('0x23')](function(){if(_0x2754b9){return db[_0xacc4('0x2a')]['findAll']({'where':{'membername':_0x2754b9['name'],'exitAt':null}});}})[_0xacc4('0x23')](function(_0x1f6c3f){if(_0x2754b9){if(_0x1f6c3f&&_0x1f6c3f[_0xacc4('0x2e')]){var _0xcef1e8=[];_0x1f6c3f['forEach'](function(_0xf45853){_0xcef1e8[_0xacc4('0x30')](_0xf45853[_0xacc4('0x29')]({'exitAt':moment()[_0xacc4('0x2c')](_0xacc4('0x2d'))}));});return BPromise[_0xacc4('0x45')](_0xcef1e8);}}})[_0xacc4('0x23')](function(_0x1a8087){if(_0x2754b9){var _0x4d63f3=[];var _0x202629=[];var _0x2ab12c=utils[_0xacc4('0x51')]();var _0xa46cf3={'membername':_0x2754b9[_0xacc4('0x31')],'interface':_0xbec5ac,'enterAt':moment()[_0xacc4('0x2c')](_0xacc4('0x2d')),'role':_0x2754b9[_0xacc4('0x34')],'internal':_0x2754b9[_0xacc4('0x27')]};_0x2ab12c['forEach'](function(_0x13f5af){_0x4d63f3['push'](_[_0xacc4('0x52')]({'channel':_0x13f5af,'type':_0xacc4('0x53'),'data1':'callysquare','data2':_0xbec5ac},_0xa46cf3));if(_0x2754b9[_0xacc4('0x49')]){_0x202629[_0xacc4('0x30')](_[_0xacc4('0x52')]({'channel':_0x13f5af,'type':_0xacc4('0x2b'),'data1':_0xacc4('0x54')},_0xa46cf3));}});return db[_0xacc4('0x2a')][_0xacc4('0x35')](_0x4d63f3[_0xacc4('0x55')](_0x202629),{'individualHooks':!![]});}})[_0xacc4('0x23')](function(){if(_0x2754b9){return _0x2754b9[_0xacc4('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0xacc4('0x2d')),'voicePause':_0x2754b9[_0xacc4('0x49')]||![],'mailPause':_0x2754b9[_0xacc4('0x49')]||![],'chatPause':_0x2754b9[_0xacc4('0x49')]||![],'faxPause':_0x2754b9[_0xacc4('0x49')]||![],'smsPause':_0x2754b9[_0xacc4('0x49')]||![],'openchannelPause':_0x2754b9['loginInPause']||![],'pauseType':_0x2754b9[_0xacc4('0x49')]?_0xacc4('0x54'):null,'lastPauseAt':moment()[_0xacc4('0x2c')](_0xacc4('0x2d')),'interface':_0xbec5ac});}})['then'](function(_0x4894a7){_0x40b1e0(_0x4894a7);})[_0xacc4('0x18')](function(_0x1bf576){_0x44cea7(_0x3f5b47['error'](0x1f4,_0x1bf576[_0xacc4('0x16')]));});});}; \ No newline at end of file +var _0x60f7=['error','message','User,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','stringify','ShowUser','User','find','PauseUser','name','role','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','isNil','interface','body','type','internal','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','set','all','LogoutUser','LoginUser','mobile','SIP/%s','count','agent','../../config/license/util','getLicense','agents','destroy','upsert','loginInPause','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./user.socket','register','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s'];(function(_0x3fbe61,_0x6b5852){var _0xad6457=function(_0x2dc6a7){while(--_0x2dc6a7){_0x3fbe61['push'](_0x3fbe61['shift']());}};_0xad6457(++_0x6b5852);}(_0x60f7,0x100));var _0x760f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x60f7[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x760f('0x0'));var util=require(_0x760f('0x1'));var moment=require(_0x760f('0x2'));var BPromise=require(_0x760f('0x3'));var rs=require(_0x760f('0x4'));var fs=require('fs');var Redis=require(_0x760f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x760f('0x6'))(_0x760f('0x7'));var config=require(_0x760f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x760f('0x9')][_0x760f('0xa')]({'port':0x232a});config[_0x760f('0xb')]=_['defaults'](config[_0x760f('0xb')],{'host':_0x760f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x760f('0xb')]));require(_0x760f('0xd'))[_0x760f('0xe')](socket);function respondWithRpcPromise(_0x5ecea0,_0x1e68db,_0x557b43){return new BPromise(function(_0x54edf7,_0x4f8dd3){return client['request'](_0x5ecea0,_0x557b43)[_0x760f('0xf')](function(_0x33659b){logger[_0x760f('0x10')]('User,\x20%s,\x20%s',_0x1e68db,_0x760f('0x11'));logger[_0x760f('0x12')](_0x760f('0x13'),_0x1e68db,_0x760f('0x11'),JSON['stringify'](_0x33659b));if(_0x33659b['error']){if(_0x33659b[_0x760f('0x14')]['code']===0x1f4){logger[_0x760f('0x14')]('User,\x20%s,\x20%s',_0x1e68db,_0x33659b[_0x760f('0x14')][_0x760f('0x15')]);return _0x4f8dd3(_0x33659b['error'][_0x760f('0x15')]);}logger[_0x760f('0x14')](_0x760f('0x16'),_0x1e68db,_0x33659b[_0x760f('0x14')]['message']);return _0x54edf7(_0x33659b[_0x760f('0x14')][_0x760f('0x15')]);}else{logger[_0x760f('0x10')](_0x760f('0x16'),_0x1e68db,_0x760f('0x11'));_0x54edf7(_0x33659b[_0x760f('0x17')][_0x760f('0x15')]);}})[_0x760f('0x18')](function(_0x3e1c4c){logger['error'](_0x760f('0x16'),_0x1e68db,_0x3e1c4c);_0x4f8dd3(_0x3e1c4c);});});}exports['GetUser']=function(_0x1c5d4d){var _0x5c53cc=this;return new Promise(function(_0x3bc874,_0x325f99){return db['User'][_0x760f('0x19')]({'raw':_0x1c5d4d[_0x760f('0x1a')]?_0x1c5d4d[_0x760f('0x1a')][_0x760f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c5d4d['options']?_0x1c5d4d['options'][_0x760f('0x1c')]||null:null,'attributes':_0x1c5d4d[_0x760f('0x1a')]?_0x1c5d4d[_0x760f('0x1a')][_0x760f('0x1d')]||null:null,'limit':_0x1c5d4d[_0x760f('0x1a')]?_0x1c5d4d[_0x760f('0x1a')][_0x760f('0x1e')]||null:null,'include':_0x1c5d4d[_0x760f('0x1a')]?_0x1c5d4d['options'][_0x760f('0x1f')]?_[_0x760f('0x20')](_0x1c5d4d[_0x760f('0x1a')]['include'],function(_0x360a87){return{'model':db[_0x360a87['model']],'as':_0x360a87['as'],'attributes':_0x360a87[_0x760f('0x1d')],'include':_0x360a87[_0x760f('0x1f')]?_[_0x760f('0x20')](_0x360a87[_0x760f('0x1f')],function(_0xe158d8){return{'model':db[_0xe158d8['model']],'as':_0xe158d8['as'],'attributes':_0xe158d8[_0x760f('0x1d')],'include':_0xe158d8['include']?_[_0x760f('0x20')](_0xe158d8[_0x760f('0x1f')],function(_0x56aacf){return{'model':db[_0x56aacf[_0x760f('0x21')]],'as':_0x56aacf['as'],'attributes':_0x56aacf[_0x760f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x760f('0xf')](function(_0x4d23fc){logger[_0x760f('0x10')](_0x760f('0x22'),_0x1c5d4d);logger['debug']('GetUser',_0x1c5d4d,JSON[_0x760f('0x23')](_0x4d23fc));_0x3bc874(_0x4d23fc);})['catch'](function(_0xd8f97d){logger[_0x760f('0x14')](_0x760f('0x22'),_0xd8f97d[_0x760f('0x15')],_0x1c5d4d);_0x325f99(_0x5c53cc[_0x760f('0x14')](0x1f4,_0xd8f97d[_0x760f('0x15')]));});});};exports[_0x760f('0x24')]=function(_0x57862c){var _0x5a9b84=this;return new Promise(function(_0x2ce4c1,_0x5bb292){return db[_0x760f('0x25')][_0x760f('0x26')]({'raw':_0x57862c[_0x760f('0x1a')]?_0x57862c['options'][_0x760f('0x1b')]===undefined?!![]:![]:!![],'where':_0x57862c['options']?_0x57862c['options']['where']||null:null,'attributes':_0x57862c['options']?_0x57862c[_0x760f('0x1a')][_0x760f('0x1d')]||null:null,'include':_0x57862c[_0x760f('0x1a')]?_0x57862c[_0x760f('0x1a')]['include']?_[_0x760f('0x20')](_0x57862c['options'][_0x760f('0x1f')],function(_0x5c9279){return{'model':db[_0x5c9279[_0x760f('0x21')]],'as':_0x5c9279['as'],'attributes':_0x5c9279[_0x760f('0x1d')],'include':_0x5c9279[_0x760f('0x1f')]?_[_0x760f('0x20')](_0x5c9279[_0x760f('0x1f')],function(_0x39a56c){return{'model':db[_0x39a56c[_0x760f('0x21')]],'as':_0x39a56c['as'],'attributes':_0x39a56c[_0x760f('0x1d')],'include':_0x39a56c[_0x760f('0x1f')]?_[_0x760f('0x20')](_0x39a56c[_0x760f('0x1f')],function(_0x2bea5c){return{'model':db[_0x2bea5c['model']],'as':_0x2bea5c['as'],'attributes':_0x2bea5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x760f('0xf')](function(_0x2bfe3e){logger[_0x760f('0x10')](_0x760f('0x24'),_0x57862c);logger['debug']('ShowUser',_0x57862c,JSON['stringify'](_0x2bfe3e));_0x2ce4c1(_0x2bfe3e);})[_0x760f('0x18')](function(_0x19ad0e){logger[_0x760f('0x14')](_0x760f('0x24'),_0x19ad0e[_0x760f('0x15')],_0x57862c);_0x5bb292(_0x5a9b84[_0x760f('0x14')](0x1f4,_0x19ad0e[_0x760f('0x15')]));});});};exports[_0x760f('0x27')]=function(_0x3bdf7f){var _0x548eed=this;return new Promise(function(_0x192dee,_0x1eae09){var _0x399b82;return db[_0x760f('0x25')][_0x760f('0x26')]({'where':_0x3bdf7f[_0x760f('0x1a')][_0x760f('0x1c')]||{},'attributes':['id',_0x760f('0x28'),_0x760f('0x29'),'internal','interface']})[_0x760f('0xf')](function(_0x4c2a77){if(_0x4c2a77){_0x399b82=_0x4c2a77;return db[_0x760f('0x2a')][_0x760f('0x2b')]({'paused':0x1},{'where':{'UserId':_0x399b82['id']},'individualHooks':!![]});}})[_0x760f('0xf')](function(){if(_0x399b82){return db[_0x760f('0x2c')]['findAll']({'where':{'membername':_0x399b82['name'],'type':_0x760f('0x2d'),'exitAt':null}});}})[_0x760f('0xf')](function(_0x3b786f){if(_0x399b82){if(_0x3b786f&&_0x3b786f['length']){var _0x5bbca1=moment()[_0x760f('0x2e')](_0x760f('0x2f'));for(var _0x4c1ddd=0x0,_0x134257=_0x3b786f[_0x760f('0x30')];_0x4c1ddd<_0x134257;_0x4c1ddd++){_0x3b786f[_0x4c1ddd][_0x760f('0x31')]({'exitAt':_0x5bbca1});}}}})[_0x760f('0xf')](function(){if(_0x399b82){var _0x1984ee=[];var _0x361483=utils['getChannels']();_0x361483[_0x760f('0x32')](function(_0x4da77a){_0x1984ee[_0x760f('0x33')]({'channel':_0x4da77a,'membername':_0x399b82[_0x760f('0x28')],'interface':_[_0x760f('0x34')](_0x399b82[_0x760f('0x35')])?util[_0x760f('0x2e')]('SIP/%s',_0x399b82[_0x760f('0x28')]):_0x399b82[_0x760f('0x35')],'type':'PAUSE','enterAt':moment()[_0x760f('0x2e')](_0x760f('0x2f')),'data1':_0x3bdf7f[_0x760f('0x36')][_0x760f('0x37')]||'DEFAULT\x20PAUSE','role':_0x399b82[_0x760f('0x29')],'internal':_0x399b82[_0x760f('0x38')],'uniqueid':_0x3bdf7f[_0x760f('0x36')][_0x760f('0x39')]||null});});return db['MemberReport'][_0x760f('0x3a')](_0x1984ee,{'individualHooks':!![]});}})[_0x760f('0xf')](function(){if(_0x399b82){return _0x399b82['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3bdf7f['body'][_0x760f('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x760f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x760f('0xf')](function(_0x5c2c7b){_0x192dee(_0x5c2c7b);})[_0x760f('0x18')](function(_0x150298){_0x1eae09(_0x548eed['error'](0x1f4,_0x150298['message']));});});};exports[_0x760f('0x3b')]=function(_0x3fe80b){var _0x48777f=this;return new Promise(function(_0x19a8f2,_0x19aef5){var _0x216e32;return db[_0x760f('0x25')][_0x760f('0x3c')]({'where':_0x3fe80b[_0x760f('0x1a')][_0x760f('0x1c')]||{},'attributes':['id',_0x760f('0x28')]})[_0x760f('0xf')](function(_0x492ab3){if(_0x492ab3){_0x216e32=_0x492ab3;if(_0x3fe80b[_0x760f('0x36')][_0x760f('0x3d')]&&!utils[_0x760f('0x3e')](_0x3fe80b[_0x760f('0x36')][_0x760f('0x3d')])){throw new Error(_0x760f('0x3f'));}switch(_0x3fe80b['body'][_0x760f('0x3d')]){case _0x760f('0x40'):return db[_0x760f('0x2a')][_0x760f('0x2b')]({'paused':0x0},{'where':{'UserId':_0x216e32['id']}})[_0x760f('0xf')](function(){return db[_0x760f('0x2c')][_0x760f('0x26')]({'where':{'channel':_0x3fe80b[_0x760f('0x36')][_0x760f('0x3d')],'membername':_0x216e32[_0x760f('0x28')],'type':_0x760f('0x2d'),'exitAt':null}});})[_0x760f('0xf')](function(_0x3d1e4f){if(_0x3d1e4f){return _0x3d1e4f[_0x760f('0x2b')]({'exitAt':moment()['format'](_0x760f('0x2f')),'data2':_0x760f('0x41')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x216e32[_0x760f('0x2b')]({'voicePause':![]});});case _0x760f('0x42'):case _0x760f('0x43'):case _0x760f('0x44'):case _0x760f('0x45'):case _0x760f('0x46'):return db[_0x760f('0x2c')]['find']({'where':{'channel':_0x3fe80b['body'][_0x760f('0x3d')],'membername':_0x216e32['name'],'type':_0x760f('0x2d'),'exitAt':null}})[_0x760f('0xf')](function(_0x2da937){return _0x2da937['update']({'exitAt':moment()['format'](_0x760f('0x2f')),'data2':_0x760f('0x41')},{'individualHooks':!![]});})[_0x760f('0xf')](function(){var _0x3a35aa={};_[_0x760f('0x47')](_0x3a35aa,util[_0x760f('0x2e')]('%s%s',_0x3fe80b[_0x760f('0x36')]['channel'],'Pause'),![]);return _0x216e32['update'](_0x3a35aa);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x216e32['id']}})['then'](function(){return db[_0x760f('0x2c')][_0x760f('0x19')]({'where':{'membername':_0x216e32[_0x760f('0x28')],'type':_0x760f('0x2d'),'exitAt':null}});})[_0x760f('0xf')](function(_0x28326a){var _0x3cb771=[];_0x28326a['forEach'](function(_0x7d0674){_0x3cb771['push'](_0x7d0674['update']({'exitAt':moment()['format'](_0x760f('0x2f')),'data2':_0x760f('0x41')}));});return BPromise[_0x760f('0x48')](_0x3cb771);})['then'](function(){return _0x216e32['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x760f('0xf')](function(_0x1b5354){_0x19a8f2(_0x1b5354);})[_0x760f('0x18')](function(_0x571535){_0x19aef5(_0x48777f['error'](0x1f4,_0x571535['message']));});});};exports[_0x760f('0x49')]=function(_0x373b93){var _0x4d0e94=this;return new Promise(function(_0x25416e,_0x19a489){var _0x50a7c4;return db[_0x760f('0x25')][_0x760f('0x3c')]({'where':_0x373b93[_0x760f('0x1a')][_0x760f('0x1c')]||{},'attributes':['id','name']})[_0x760f('0xf')](function(_0x3ed541){if(_0x3ed541){_0x50a7c4=_0x3ed541;return db[_0x760f('0x2a')]['destroy']({'where':{'membername':_0x50a7c4[_0x760f('0x28')]},'individualHooks':!![]});}})[_0x760f('0xf')](function(){if(_0x50a7c4){return db['MemberReport']['findAll']({'where':{'membername':_0x50a7c4[_0x760f('0x28')],'exitAt':null}});}})[_0x760f('0xf')](function(_0x1de052){if(_0x50a7c4){if(_0x1de052&&_0x1de052[_0x760f('0x30')]){var _0x4ed520=[];_0x1de052['forEach'](function(_0x228808){_0x4ed520[_0x760f('0x33')](_0x228808['update']({'exitAt':moment()[_0x760f('0x2e')](_0x760f('0x2f'))}));});return BPromise[_0x760f('0x48')](_0x4ed520);}}})[_0x760f('0xf')](function(){if(_0x50a7c4){return _0x50a7c4[_0x760f('0x2b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x760f('0xf')](function(_0x2cbbd4){_0x25416e(_0x2cbbd4);})['catch'](function(_0x523292){_0x19a489(_0x4d0e94[_0x760f('0x14')](0x1f4,_0x523292[_0x760f('0x15')]));});});};exports[_0x760f('0x4a')]=function(_0x415b6e){var _0x8de3d7=this;return new Promise(function(_0x3e316f,_0x2fbba9){var _0x5a5a1c;var _0x3aeacf;var _0x18f8c5;var _0x828e21;return db[_0x760f('0x25')][_0x760f('0x3c')]({'where':_0x415b6e['options'][_0x760f('0x1c')]||{},'attributes':['id',_0x760f('0x28'),_0x760f('0x29'),_0x760f('0x4b'),'phone',_0x760f('0x38'),'loginInPause',_0x760f('0x35')]})[_0x760f('0xf')](function(_0x278008){if(_0x278008){_0x5a5a1c=_0x278008;_0x828e21=_0x415b6e['body'][_0x760f('0x35')]?_0x415b6e[_0x760f('0x36')][_0x760f('0x35')]:util[_0x760f('0x2e')](_0x760f('0x4c'),_0x5a5a1c[_0x760f('0x28')]);return db[_0x760f('0x25')][_0x760f('0x4d')]({'where':{'role':_0x760f('0x4e'),'online':!![],'id':{'$ne':_0x5a5a1c['id']}}});}})[_0x760f('0xf')](function(_0x334751){if(_0x334751){_0x18f8c5=_0x334751;return require(_0x760f('0x4f'))[_0x760f('0x50')]();}})[_0x760f('0xf')](function(_0xad1edf){if(_0xad1edf&&_0xad1edf[_0x760f('0x51')]&&_0x18f8c5>=_0xad1edf[_0x760f('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x760f('0xf')](function(){if(_0x5a5a1c){return db[_0x760f('0x2a')][_0x760f('0x52')]({'where':{'membername':_0x5a5a1c[_0x760f('0x28')]},'individualHooks':!![]});}})[_0x760f('0xf')](function(){if(_0x5a5a1c){return _0x5a5a1c['getVoiceQueues']({'raw':!![]});}})[_0x760f('0xf')](function(_0x125abd){if(_0x5a5a1c){if(_0x125abd){var _0xa2bc56=[];_0x3aeacf=_0x125abd;if(_0x3aeacf[_0x760f('0x30')]){for(var _0xa8fb6d=0x0;_0xa8fb6d<_0x3aeacf[_0x760f('0x30')];_0xa8fb6d++){_0xa2bc56[_0x760f('0x33')](db[_0x760f('0x2a')][_0x760f('0x53')]({'membername':_0x5a5a1c[_0x760f('0x28')],'UserId':_0x5a5a1c['id'],'queue_name':_0x3aeacf[_0xa8fb6d][_0x760f('0x28')],'VoiceQueueId':_0x3aeacf[_0xa8fb6d]['id'],'interface':_0x828e21,'paused':_0x5a5a1c[_0x760f('0x54')]||![],'penalty':_0x3aeacf[_0xa8fb6d][_0x760f('0x55')]||0x0}));}return BPromise[_0x760f('0x48')](_0xa2bc56);}}}})['then'](function(){if(_0x5a5a1c){return db['MemberReport']['findAll']({'where':{'membername':_0x5a5a1c[_0x760f('0x28')],'exitAt':null}});}})[_0x760f('0xf')](function(_0x5d2fcd){if(_0x5a5a1c){if(_0x5d2fcd&&_0x5d2fcd[_0x760f('0x30')]){var _0x19309f=[];_0x5d2fcd['forEach'](function(_0x2391bc){_0x19309f[_0x760f('0x33')](_0x2391bc['update']({'exitAt':moment()[_0x760f('0x2e')](_0x760f('0x2f'))}));});return BPromise[_0x760f('0x48')](_0x19309f);}}})[_0x760f('0xf')](function(_0x5745b1){if(_0x5a5a1c){var _0x261617=[];var _0x493789=[];var _0x36ac5b=utils[_0x760f('0x56')]();var _0x2d8d5d={'membername':_0x5a5a1c['name'],'interface':_0x828e21,'enterAt':moment()[_0x760f('0x2e')](_0x760f('0x2f')),'role':_0x5a5a1c[_0x760f('0x29')],'internal':_0x5a5a1c[_0x760f('0x38')]};_0x36ac5b[_0x760f('0x32')](function(_0x1929c8){_0x261617['push'](_[_0x760f('0x57')]({'channel':_0x1929c8,'type':_0x760f('0x58'),'data1':_0x760f('0x59'),'data2':_0x828e21},_0x2d8d5d));if(_0x5a5a1c[_0x760f('0x54')]){_0x493789['push'](_[_0x760f('0x57')]({'channel':_0x1929c8,'type':_0x760f('0x2d'),'data1':_0x760f('0x5a')},_0x2d8d5d));}});return db['MemberReport']['bulkCreate'](_0x261617[_0x760f('0x5b')](_0x493789),{'individualHooks':!![]});}})[_0x760f('0xf')](function(){if(_0x5a5a1c){return _0x5a5a1c[_0x760f('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x760f('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5a5a1c[_0x760f('0x54')]||![],'mailPause':_0x5a5a1c['loginInPause']||![],'chatPause':_0x5a5a1c[_0x760f('0x54')]||![],'faxPause':_0x5a5a1c['loginInPause']||![],'smsPause':_0x5a5a1c['loginInPause']||![],'openchannelPause':_0x5a5a1c[_0x760f('0x54')]||![],'pauseType':_0x5a5a1c['loginInPause']?_0x760f('0x5a'):null,'lastPauseAt':moment()[_0x760f('0x2e')](_0x760f('0x2f')),'interface':_0x828e21});}})['then'](function(_0x47a7b5){_0x3e316f(_0x47a7b5);})[_0x760f('0x18')](function(_0x54dc0e){_0x2fbba9(_0x8de3d7[_0x760f('0x14')](0x1f4,_0x54dc0e[_0x760f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a4feb1b..93c1064 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 _0xba09=['removeListener','save','remove','update','emit'];(function(_0x283eef,_0x4972ab){var _0x2db2f7=function(_0x6e2654){while(--_0x6e2654){_0x283eef['push'](_0x283eef['shift']());}};_0x2db2f7(++_0x4972ab);}(_0xba09,0x137));var _0x9ba0=function(_0x4ffd20,_0x1e83b6){_0x4ffd20=_0x4ffd20-0x0;var _0x49b5e2=_0xba09[_0x4ffd20];return _0x49b5e2;};'use strict';var UserEvents=require('./user.events');var events=[_0x9ba0('0x0'),_0x9ba0('0x1'),_0x9ba0('0x2')];function createListener(_0x3ca857,_0x5db1be){return function(_0x59ee9f){_0x5db1be[_0x9ba0('0x3')](_0x3ca857,_0x59ee9f);};}function removeListener(_0xaaaf81,_0x19242b){return function(){UserEvents[_0x9ba0('0x4')](_0xaaaf81,_0x19242b);};}exports['register']=function(_0x1f3371){for(var _0x2ecf55=0x0,_0x28adf3=events['length'];_0x2ecf55<_0x28adf3;_0x2ecf55++){var _0x2fb5c3=events[_0x2ecf55];var _0x29a531=createListener('user:'+_0x2fb5c3,_0x1f3371);UserEvents['on'](_0x2fb5c3,_0x29a531);}}; \ No newline at end of file +var _0x4396=['emit','removeListener','register','length','user:','./user.events','save'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4396,0x194));var _0x6439=function(_0x59ef3d,_0x5c7aee){_0x59ef3d=_0x59ef3d-0x0;var _0x585558=_0x4396[_0x59ef3d];return _0x585558;};'use strict';var UserEvents=require(_0x6439('0x0'));var events=[_0x6439('0x1'),'remove','update'];function createListener(_0x8e852,_0x1d4505){return function(_0x5738ad){_0x1d4505[_0x6439('0x2')](_0x8e852,_0x5738ad);};}function removeListener(_0x2329a6,_0x4c7497){return function(){UserEvents[_0x6439('0x3')](_0x2329a6,_0x4c7497);};}exports[_0x6439('0x4')]=function(_0x1c8090){for(var _0x5d4f78=0x0,_0xa44a58=events[_0x6439('0x5')];_0x5d4f78<_0xa44a58;_0x5d4f78++){var _0xb564f3=events[_0x5d4f78];var _0x62ef3b=createListener(_0x6439('0x6')+_0xb564f3,_0x1c8090);UserEvents['on'](_0xb564f3,_0x62ef3b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index fd915f8..25acb7d 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 _0xd983=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x41bb88,_0x721dee){var _0x1c76d1=function(_0x2ae743){while(--_0x2ae743){_0x41bb88['push'](_0x41bb88['shift']());}};_0x1c76d1(++_0x721dee);}(_0xd983,0x7d));var _0x3d98=function(_0x3a3420,_0x21c7b4){_0x3a3420=_0x3a3420-0x0;var _0x555706=_0xd983[_0x3a3420];return _0x555706;};'use strict';var multer=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var path=require(_0x3d98('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d98('0x3'));var router=express[_0x3d98('0x4')]();var auth=require(_0x3d98('0x5'));var interaction=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));module[_0x3d98('0x8')]=router; \ No newline at end of file +var _0xf330=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4d892b,_0x734dc8){var _0x5c6f01=function(_0x1e6973){while(--_0x1e6973){_0x4d892b['push'](_0x4d892b['shift']());}};_0x5c6f01(++_0x734dc8);}(_0xf330,0xcb));var _0x0f33=function(_0x82c104,_0x9c644a){_0x82c104=_0x82c104-0x0;var _0x4ab8ef=_0xf330[_0x82c104];return _0x4ab8ef;};'use strict';var multer=require('multer');var util=require(_0x0f33('0x0'));var path=require(_0x0f33('0x1'));var timeout=require(_0x0f33('0x2'));var express=require(_0x0f33('0x3'));var router=express['Router']();var auth=require(_0x0f33('0x4'));var interaction=require(_0x0f33('0x5'));var config=require('../../config/environment');module[_0x0f33('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 218ab03..920beef 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 _0xb10b=['sequelize','INTEGER'];(function(_0x253a69,_0x2d1753){var _0x3f852c=function(_0x1056e6){while(--_0x1056e6){_0x253a69['push'](_0x253a69['shift']());}};_0x3f852c(++_0x2d1753);}(_0xb10b,0x12a));var _0xbb10=function(_0x58321f,_0x5730b9){_0x58321f=_0x58321f-0x0;var _0x3728ea=_0xb10b[_0x58321f];return _0x3728ea;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x36674f,_0x40012b){var _0x406ab2=function(_0x394e1e){while(--_0x394e1e){_0x36674f['push'](_0x36674f['shift']());}};_0x406ab2(++_0x40012b);}(_0xe706,0xa3));var _0x6e70=function(_0x28087c,_0x895c0f){_0x28087c=_0x28087c-0x0;var _0x329122=_0xe706[_0x28087c];return _0x329122;};'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 f1bbd0c..cef0431 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 _0xaad5=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','define'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xaad5,0x7a));var _0x5aad=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xaad5[_0x270adf];return _0x29eda9;};'use strict';var _=require('lodash');var util=require(_0x5aad('0x0'));var logger=require(_0x5aad('0x1'))(_0x5aad('0x2'));var moment=require(_0x5aad('0x3'));var BPromise=require(_0x5aad('0x4'));var rp=require(_0x5aad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aad('0x6'));var config=require(_0x5aad('0x7'));var attributes=require(_0x5aad('0x8'));module['exports']=function(_0x1ef48a,_0x30f769){return _0x1ef48a[_0x5aad('0x9')](_0x5aad('0xa'),attributes,{'tableName':_0x5aad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e27=['./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x2e27,0x19b));var _0x72e2=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x2e27[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x72e2('0x0'));var util=require(_0x72e2('0x1'));var logger=require(_0x72e2('0x2'))(_0x72e2('0x3'));var moment=require('moment');var BPromise=require(_0x72e2('0x4'));var rp=require(_0x72e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x72e2('0x7'));module['exports']=function(_0x335266,_0x2fae29){return _0x335266[_0x72e2('0x8')](_0x72e2('0x9'),attributes,{'tableName':_0x72e2('0xa'),'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 b794c08..b34552f 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 _0x0200=['request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug'];(function(_0x5a0747,_0x34789b){var _0x1a2b6d=function(_0x57dc6e){while(--_0x57dc6e){_0x5a0747['push'](_0x5a0747['shift']());}};_0x1a2b6d(++_0x34789b);}(_0x0200,0x66));var _0x0020=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x0200[_0x1b3a09];return _0x357bb8;};'use strict';var _=require(_0x0020('0x0'));var util=require(_0x0020('0x1'));var moment=require(_0x0020('0x2'));var BPromise=require(_0x0020('0x3'));var rs=require(_0x0020('0x4'));var fs=require('fs');var Redis=require(_0x0020('0x5'));var db=require(_0x0020('0x6'))['db'];var utils=require(_0x0020('0x7'));var logger=require(_0x0020('0x8'))(_0x0020('0x9'));var config=require(_0x0020('0xa'));var jayson=require(_0x0020('0xb'));var client=jayson[_0x0020('0xc')][_0x0020('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2dde88,_0x11a4ad,_0x3577f4){return new BPromise(function(_0x399fda,_0x5d9ba2){return client[_0x0020('0xe')](_0x2dde88,_0x3577f4)['then'](function(_0x3b057b){logger[_0x0020('0xf')](_0x0020('0x10'),_0x11a4ad,'request\x20sent');logger[_0x0020('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x11a4ad,_0x0020('0x12'),JSON[_0x0020('0x13')](_0x3b057b));if(_0x3b057b['error']){if(_0x3b057b[_0x0020('0x14')][_0x0020('0x15')]===0x1f4){logger[_0x0020('0x14')](_0x0020('0x10'),_0x11a4ad,_0x3b057b[_0x0020('0x14')]['message']);return _0x5d9ba2(_0x3b057b[_0x0020('0x14')][_0x0020('0x16')]);}logger[_0x0020('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x11a4ad,_0x3b057b[_0x0020('0x14')][_0x0020('0x16')]);return _0x399fda(_0x3b057b[_0x0020('0x14')]['message']);}else{logger[_0x0020('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x11a4ad,'request\x20sent');_0x399fda(_0x3b057b['result']['message']);}})[_0x0020('0x17')](function(_0x58e099){logger[_0x0020('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x11a4ad,_0x58e099);_0x5d9ba2(_0x58e099);});});} \ No newline at end of file +var _0xcd1b=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11cdb3,_0x228295){var _0x414dfc=function(_0x4d794d){while(--_0x4d794d){_0x11cdb3['push'](_0x11cdb3['shift']());}};_0x414dfc(++_0x228295);}(_0xcd1b,0xd5));var _0xbcd1=function(_0x24a90a,_0x40e57e){_0x24a90a=_0x24a90a-0x0;var _0x1fb916=_0xcd1b[_0x24a90a];return _0x1fb916;};'use strict';var _=require(_0xbcd1('0x0'));var util=require('util');var moment=require(_0xbcd1('0x1'));var BPromise=require(_0xbcd1('0x2'));var rs=require(_0xbcd1('0x3'));var fs=require('fs');var Redis=require(_0xbcd1('0x4'));var db=require(_0xbcd1('0x5'))['db'];var utils=require(_0xbcd1('0x6'));var logger=require('../../config/logger')(_0xbcd1('0x7'));var config=require(_0xbcd1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbcd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b0e50,_0x9ee97,_0x3ddcb7){return new BPromise(function(_0x286956,_0x4d499a){return client[_0xbcd1('0xa')](_0x1b0e50,_0x3ddcb7)['then'](function(_0x4e4e3a){logger[_0xbcd1('0xb')](_0xbcd1('0xc'),_0x9ee97,_0xbcd1('0xd'));logger[_0xbcd1('0xe')](_0xbcd1('0xf'),_0x9ee97,_0xbcd1('0xd'),JSON[_0xbcd1('0x10')](_0x4e4e3a));if(_0x4e4e3a[_0xbcd1('0x11')]){if(_0x4e4e3a[_0xbcd1('0x11')]['code']===0x1f4){logger[_0xbcd1('0x11')](_0xbcd1('0xc'),_0x9ee97,_0x4e4e3a[_0xbcd1('0x11')][_0xbcd1('0x12')]);return _0x4d499a(_0x4e4e3a['error'][_0xbcd1('0x12')]);}logger[_0xbcd1('0x11')](_0xbcd1('0xc'),_0x9ee97,_0x4e4e3a[_0xbcd1('0x11')][_0xbcd1('0x12')]);return _0x286956(_0x4e4e3a[_0xbcd1('0x11')][_0xbcd1('0x12')]);}else{logger[_0xbcd1('0xb')](_0xbcd1('0xc'),_0x9ee97,'request\x20sent');_0x286956(_0x4e4e3a[_0xbcd1('0x13')][_0xbcd1('0x12')]);}})[_0xbcd1('0x14')](function(_0x19815b){logger[_0xbcd1('0x11')](_0xbcd1('0xc'),_0x9ee97,_0x19815b);_0x4d499a(_0x19815b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 10e7e48..8441de3 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 _0xc3eb=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path'];(function(_0xb32392,_0x2117d2){var _0x58b793=function(_0x457fb1){while(--_0x457fb1){_0xb32392['push'](_0xb32392['shift']());}};_0x58b793(++_0x2117d2);}(_0xc3eb,0x173));var _0xbc3e=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0xc3eb[_0x53e3de];return _0x7b905b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc3e('0x0'));var timeout=require('connect-timeout');var express=require(_0xbc3e('0x1'));var router=express[_0xbc3e('0x2')]();var auth=require(_0xbc3e('0x3'));var interaction=require(_0xbc3e('0x4'));var config=require('../../config/environment');module[_0xbc3e('0x5')]=router; \ No newline at end of file +var _0xe254=['express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','path'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0xe254,0xad));var _0x4e25=function(_0x263ca9,_0x4c8ba0){_0x263ca9=_0x263ca9-0x0;var _0x318d2d=_0xe254[_0x263ca9];return _0x318d2d;};'use strict';var multer=require(_0x4e25('0x0'));var util=require('util');var path=require(_0x4e25('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e25('0x2'));var router=express[_0x4e25('0x3')]();var auth=require(_0x4e25('0x4'));var interaction=require(_0x4e25('0x5'));var config=require('../../config/environment');module[_0x4e25('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 78bb3a8..c902df1 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0abf=['sequelize','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c00=['INTEGER','STRING','sequelize','exports'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x5c00,0x17e));var _0x05c0=function(_0x1c5cd2,_0x277ceb){_0x1c5cd2=_0x1c5cd2-0x0;var _0x895e35=_0x5c00[_0x1c5cd2];return _0x895e35;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'penalty':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x05c0('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e850c27..e66dc51 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xb10b,0x12a));var _0xbb10=function(_0x165ca9,_0x36e359){_0x165ca9=_0x165ca9-0x0;var _0x25f49a=_0xb10b[_0x165ca9];return _0x25f49a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x512eb0,_0x27edfe){_0x512eb0=_0x512eb0-0x0;var _0x1378fe=_0xb10b[_0x512eb0];return _0x1378fe;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 323e552..c3b92bb 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 _0x6c2c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x6c2c,0x158));var _0xc6c2=function(_0x3097c7,_0x5adc02){_0x3097c7=_0x3097c7-0x0;var _0x3aff29=_0x6c2c[_0x3097c7];return _0x3aff29;};'use strict';var _=require('lodash');var util=require(_0xc6c2('0x0'));var moment=require(_0xc6c2('0x1'));var BPromise=require(_0xc6c2('0x2'));var rs=require(_0xc6c2('0x3'));var fs=require('fs');var Redis=require(_0xc6c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6c2('0x5'));var logger=require(_0xc6c2('0x6'))(_0xc6c2('0x7'));var config=require(_0xc6c2('0x8'));var jayson=require(_0xc6c2('0x9'));var client=jayson[_0xc6c2('0xa')][_0xc6c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398313,_0x2d63d5,_0x27eaa4){return new BPromise(function(_0x490e12,_0x2f1609){return client[_0xc6c2('0xc')](_0x398313,_0x27eaa4)[_0xc6c2('0xd')](function(_0x2a5616){logger[_0xc6c2('0xe')](_0xc6c2('0xf'),_0x2d63d5,_0xc6c2('0x10'));logger[_0xc6c2('0x11')](_0xc6c2('0x12'),_0x2d63d5,_0xc6c2('0x10'),JSON[_0xc6c2('0x13')](_0x2a5616));if(_0x2a5616['error']){if(_0x2a5616[_0xc6c2('0x14')][_0xc6c2('0x15')]===0x1f4){logger['error'](_0xc6c2('0xf'),_0x2d63d5,_0x2a5616['error']['message']);return _0x2f1609(_0x2a5616[_0xc6c2('0x14')]['message']);}logger[_0xc6c2('0x14')](_0xc6c2('0xf'),_0x2d63d5,_0x2a5616[_0xc6c2('0x14')]['message']);return _0x490e12(_0x2a5616[_0xc6c2('0x14')][_0xc6c2('0x16')]);}else{logger[_0xc6c2('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x2d63d5,'request\x20sent');_0x490e12(_0x2a5616[_0xc6c2('0x17')][_0xc6c2('0x16')]);}})[_0xc6c2('0x18')](function(_0x26a352){logger['error'](_0xc6c2('0xf'),_0x2d63d5,_0x26a352);_0x2f1609(_0x26a352);});});} \ No newline at end of file +var _0xc264=['jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc264,0x1a6));var _0x4c26=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0xc264[_0x1c206c];return _0x188aaa;};'use strict';var _=require(_0x4c26('0x0'));var util=require(_0x4c26('0x1'));var moment=require(_0x4c26('0x2'));var BPromise=require(_0x4c26('0x3'));var rs=require(_0x4c26('0x4'));var fs=require('fs');var Redis=require(_0x4c26('0x5'));var db=require(_0x4c26('0x6'))['db'];var utils=require(_0x4c26('0x7'));var logger=require(_0x4c26('0x8'))('rpc');var config=require(_0x4c26('0x9'));var jayson=require(_0x4c26('0xa'));var client=jayson[_0x4c26('0xb')][_0x4c26('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x208947,_0x54730d,_0x3c1a8f){return new BPromise(function(_0x4fabcd,_0x18e509){return client[_0x4c26('0xd')](_0x208947,_0x3c1a8f)[_0x4c26('0xe')](function(_0x46dcae){logger[_0x4c26('0xf')](_0x4c26('0x10'),_0x54730d,'request\x20sent');logger[_0x4c26('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x54730d,'request\x20sent',JSON[_0x4c26('0x12')](_0x46dcae));if(_0x46dcae[_0x4c26('0x13')]){if(_0x46dcae[_0x4c26('0x13')][_0x4c26('0x14')]===0x1f4){logger[_0x4c26('0x13')](_0x4c26('0x10'),_0x54730d,_0x46dcae['error'][_0x4c26('0x15')]);return _0x18e509(_0x46dcae[_0x4c26('0x13')][_0x4c26('0x15')]);}logger[_0x4c26('0x13')](_0x4c26('0x10'),_0x54730d,_0x46dcae[_0x4c26('0x13')][_0x4c26('0x15')]);return _0x4fabcd(_0x46dcae['error'][_0x4c26('0x15')]);}else{logger['info'](_0x4c26('0x10'),_0x54730d,'request\x20sent');_0x4fabcd(_0x46dcae[_0x4c26('0x16')][_0x4c26('0x15')]);}})[_0x4c26('0x17')](function(_0x434e2a){logger[_0x4c26('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x54730d,_0x434e2a);_0x18e509(_0x434e2a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index bd85c31..eb1fd6d 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 _0x4494=['../../components/auth/service','../../components/interaction/service','exports','path','Router'];(function(_0x475be2,_0xf0639){var _0x4ff8b1=function(_0x4bccc9){while(--_0x4bccc9){_0x475be2['push'](_0x475be2['shift']());}};_0x4ff8b1(++_0xf0639);}(_0x4494,0x8a));var _0x4449=function(_0x4d8695,_0x1c0dd0){_0x4d8695=_0x4d8695-0x0;var _0x14c650=_0x4494[_0x4d8695];return _0x14c650;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4449('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4449('0x1')]();var auth=require(_0x4449('0x2'));var interaction=require(_0x4449('0x3'));var config=require('../../config/environment');module[_0x4449('0x4')]=router; \ No newline at end of file +var _0xb6c6=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x3748b0,_0x437de7){var _0x554fcd=function(_0x41ea38){while(--_0x41ea38){_0x3748b0['push'](_0x3748b0['shift']());}};_0x554fcd(++_0x437de7);}(_0xb6c6,0xf7));var _0x6b6c=function(_0x578bf5,_0x24b8d5){_0x578bf5=_0x578bf5-0x0;var _0x60f678=_0xb6c6[_0x578bf5];return _0x60f678;};'use strict';var multer=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var path=require(_0x6b6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b6c('0x3'));var router=express[_0x6b6c('0x4')]();var auth=require(_0x6b6c('0x5'));var interaction=require(_0x6b6c('0x6'));var config=require(_0x6b6c('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cfd697c..6e207f4 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x3a1040,_0x5aef49){var _0xea943e=function(_0x3c98d){while(--_0x3c98d){_0x3a1040['push'](_0x3a1040['shift']());}};_0xea943e(++_0x5aef49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x5b0d3f,_0xab2919){var _0xe597d0=function(_0x182802){while(--_0x182802){_0x5b0d3f['push'](_0x5b0d3f['shift']());}};_0xe597d0(++_0xab2919);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 5036244..9424608 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 _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x21dfde,_0x5797b7){var _0x5b65e9=function(_0x132585){while(--_0x132585){_0x21dfde['push'](_0x21dfde['shift']());}};_0x5b65e9(++_0x5797b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x302fc4,_0x27b9ce){var _0x2e4c7d=function(_0x89ed4a){while(--_0x89ed4a){_0x302fc4['push'](_0x302fc4['shift']());}};_0x2e4c7d(++_0x27b9ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index bbb3e4a..923ebc7 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 _0x22ed=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1b5738,_0x5e6b11){_0x1b5738=_0x1b5738-0x0;var _0x4d8a1e=_0x22ed[_0x1b5738];return _0x4d8a1e;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3185f2,_0x5d99d5,_0x405361){return new BPromise(function(_0x3378a3,_0x5dd614){return client[_0xd22e('0xd')](_0x3185f2,_0x405361)['then'](function(_0x5444e8){logger[_0xd22e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x5d99d5,'request\x20sent');logger['debug'](_0xd22e('0xf'),_0x5d99d5,_0xd22e('0x10'),JSON[_0xd22e('0x11')](_0x5444e8));if(_0x5444e8[_0xd22e('0x12')]){if(_0x5444e8['error'][_0xd22e('0x13')]===0x1f4){logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')][_0xd22e('0x15')]);return _0x5dd614(_0x5444e8[_0xd22e('0x12')]['message']);}logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')]['message']);return _0x3378a3(_0x5444e8[_0xd22e('0x12')]['message']);}else{logger[_0xd22e('0xe')](_0xd22e('0x14'),_0x5d99d5,_0xd22e('0x10'));_0x3378a3(_0x5444e8[_0xd22e('0x16')][_0xd22e('0x15')]);}})[_0xd22e('0x17')](function(_0x3cbd14){logger[_0xd22e('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x5d99d5,_0x3cbd14);_0x5dd614(_0x3cbd14);});});} \ No newline at end of file +var _0xce27=['UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','UserMailQueue,\x20%s,\x20%s','debug'];(function(_0x5570cd,_0xace1a7){var _0x3f07b8=function(_0x3813f0){while(--_0x3813f0){_0x5570cd['push'](_0x5570cd['shift']());}};_0x3f07b8(++_0xace1a7);}(_0xce27,0xef));var _0x7ce2=function(_0x2937ec,_0x26f651){_0x2937ec=_0x2937ec-0x0;var _0x3ccece=_0xce27[_0x2937ec];return _0x3ccece;};'use strict';var _=require(_0x7ce2('0x0'));var util=require(_0x7ce2('0x1'));var moment=require(_0x7ce2('0x2'));var BPromise=require(_0x7ce2('0x3'));var rs=require(_0x7ce2('0x4'));var fs=require('fs');var Redis=require(_0x7ce2('0x5'));var db=require(_0x7ce2('0x6'))['db'];var utils=require(_0x7ce2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7ce2('0x8'));var jayson=require(_0x7ce2('0x9'));var client=jayson[_0x7ce2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eacb4,_0x1eb216,_0x258865){return new BPromise(function(_0x5ad6df,_0x23f9a2){return client[_0x7ce2('0xb')](_0x5eacb4,_0x258865)['then'](function(_0x27d952){logger['info'](_0x7ce2('0xc'),_0x1eb216,'request\x20sent');logger[_0x7ce2('0xd')](_0x7ce2('0xe'),_0x1eb216,_0x7ce2('0xf'),JSON[_0x7ce2('0x10')](_0x27d952));if(_0x27d952[_0x7ce2('0x11')]){if(_0x27d952[_0x7ce2('0x11')][_0x7ce2('0x12')]===0x1f4){logger[_0x7ce2('0x11')](_0x7ce2('0xc'),_0x1eb216,_0x27d952['error'][_0x7ce2('0x13')]);return _0x23f9a2(_0x27d952['error'][_0x7ce2('0x13')]);}logger[_0x7ce2('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x1eb216,_0x27d952[_0x7ce2('0x11')][_0x7ce2('0x13')]);return _0x5ad6df(_0x27d952[_0x7ce2('0x11')][_0x7ce2('0x13')]);}else{logger[_0x7ce2('0x14')](_0x7ce2('0xc'),_0x1eb216,_0x7ce2('0xf'));_0x5ad6df(_0x27d952[_0x7ce2('0x15')][_0x7ce2('0x13')]);}})[_0x7ce2('0x16')](function(_0x45c8d8){logger[_0x7ce2('0x11')](_0x7ce2('0xc'),_0x1eb216,_0x45c8d8);_0x23f9a2(_0x45c8d8);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 07c11f4..3b6bdb4 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 _0xc015=['../../components/interaction/service','../../config/environment','exports','util','path','express','../../components/auth/service'];(function(_0x42f226,_0x409907){var _0x52debe=function(_0xa3666b){while(--_0xa3666b){_0x42f226['push'](_0x42f226['shift']());}};_0x52debe(++_0x409907);}(_0xc015,0x106));var _0x5c01=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xc015[_0x80d733];return _0x435868;};'use strict';var multer=require('multer');var util=require(_0x5c01('0x0'));var path=require(_0x5c01('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c01('0x2'));var router=express['Router']();var auth=require(_0x5c01('0x3'));var interaction=require(_0x5c01('0x4'));var config=require(_0x5c01('0x5'));module[_0x5c01('0x6')]=router; \ No newline at end of file +var _0xaecd=['util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x167f24,_0x2f5452){var _0x321f97=function(_0x24313d){while(--_0x24313d){_0x167f24['push'](_0x167f24['shift']());}};_0x321f97(++_0x2f5452);}(_0xaecd,0xfa));var _0xdaec=function(_0x487bcc,_0x3ac993){_0x487bcc=_0x487bcc-0x0;var _0x370aa2=_0xaecd[_0x487bcc];return _0x370aa2;};'use strict';var multer=require('multer');var util=require(_0xdaec('0x0'));var path=require(_0xdaec('0x1'));var timeout=require(_0xdaec('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xdaec('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdaec('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 38c2793..869e6bc 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 _0xd8b0=['exports','sequelize'];(function(_0x2382e2,_0x1c07e6){var _0x5e9fab=function(_0xfc8c77){while(--_0xfc8c77){_0x2382e2['push'](_0x2382e2['shift']());}};_0x5e9fab(++_0x1c07e6);}(_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(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 89b6f21..a4fb9db 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 _0x0490=['api','moment','request-promise','../../config/environment','exports','define','../../config/logger'];(function(_0x553fcf,_0x2944af){var _0xfaadf0=function(_0x5343e3){while(--_0x5343e3){_0x553fcf['push'](_0x553fcf['shift']());}};_0xfaadf0(++_0x2944af);}(_0x0490,0x172));var _0x0049=function(_0x3669aa,_0x20b3fd){_0x3669aa=_0x3669aa-0x0;var _0x29103d=_0x0490[_0x3669aa];return _0x29103d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0049('0x0'))(_0x0049('0x1'));var moment=require(_0x0049('0x2'));var BPromise=require('bluebird');var rp=require(_0x0049('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0049('0x4'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x0049('0x5')]=function(_0x3d13b6,_0x3db887){return _0x3d13b6[_0x0049('0x6')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaff2=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xaff2,0x18c));var _0x2aff=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xaff2[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2aff('0x0'))(_0x2aff('0x1'));var moment=require(_0x2aff('0x2'));var BPromise=require(_0x2aff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aff('0x4'));var rimraf=require(_0x2aff('0x5'));var config=require(_0x2aff('0x6'));var attributes=require(_0x2aff('0x7'));module[_0x2aff('0x8')]=function(_0x3b0a1c,_0x2cc279){return _0x3b0a1c[_0x2aff('0x9')](_0x2aff('0xa'),attributes,{'tableName':_0x2aff('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 be76f10..6bb70bf 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 _0xc18a=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','http','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f0213,_0x3c3c9e){var _0x2048c4=function(_0x26d0c6){while(--_0x26d0c6){_0x1f0213['push'](_0x1f0213['shift']());}};_0x2048c4(++_0x3c3c9e);}(_0xc18a,0x1b7));var _0xac18=function(_0x4195e8,_0x202df1){_0x4195e8=_0x4195e8-0x0;var _0x29177a=_0xc18a[_0x4195e8];return _0x29177a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac18('0x0'));var BPromise=require(_0xac18('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac18('0x2'))['db'];var utils=require(_0xac18('0x3'));var logger=require(_0xac18('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac18('0x5')][_0xac18('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x196008,_0x16402e,_0x41ef48){return new BPromise(function(_0x14669d,_0x23a74f){return client['request'](_0x196008,_0x41ef48)[_0xac18('0x7')](function(_0x2dd46f){logger['info'](_0xac18('0x8'),_0x16402e,_0xac18('0x9'));logger[_0xac18('0xa')](_0xac18('0xb'),_0x16402e,_0xac18('0x9'),JSON[_0xac18('0xc')](_0x2dd46f));if(_0x2dd46f[_0xac18('0xd')]){if(_0x2dd46f[_0xac18('0xd')]['code']===0x1f4){logger['error'](_0xac18('0x8'),_0x16402e,_0x2dd46f[_0xac18('0xd')][_0xac18('0xe')]);return _0x23a74f(_0x2dd46f[_0xac18('0xd')][_0xac18('0xe')]);}logger[_0xac18('0xd')](_0xac18('0x8'),_0x16402e,_0x2dd46f[_0xac18('0xd')][_0xac18('0xe')]);return _0x14669d(_0x2dd46f[_0xac18('0xd')]['message']);}else{logger[_0xac18('0xf')](_0xac18('0x8'),_0x16402e,_0xac18('0x9'));_0x14669d(_0x2dd46f[_0xac18('0x10')][_0xac18('0xe')]);}})[_0xac18('0x11')](function(_0x153a8d){logger[_0xac18('0xd')](_0xac18('0x8'),_0x16402e,_0x153a8d);_0x23a74f(_0x153a8d);});});} \ No newline at end of file +var _0x4ff0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4ff0,0xbc));var _0x04ff=function(_0x2fe75b,_0x293f4d){_0x2fe75b=_0x2fe75b-0x0;var _0x935b21=_0x4ff0[_0x2fe75b];return _0x935b21;};'use strict';var _=require(_0x04ff('0x0'));var util=require('util');var moment=require(_0x04ff('0x1'));var BPromise=require(_0x04ff('0x2'));var rs=require(_0x04ff('0x3'));var fs=require('fs');var Redis=require(_0x04ff('0x4'));var db=require(_0x04ff('0x5'))['db'];var utils=require(_0x04ff('0x6'));var logger=require('../../config/logger')(_0x04ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x04ff('0x8'));var client=jayson[_0x04ff('0x9')][_0x04ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x425fdb,_0x6a7a28,_0x45e9c0){return new BPromise(function(_0x3b72f0,_0x4754ad){return client[_0x04ff('0xb')](_0x425fdb,_0x45e9c0)[_0x04ff('0xc')](function(_0x3fead4){logger[_0x04ff('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x6a7a28,_0x04ff('0xe'));logger[_0x04ff('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x6a7a28,_0x04ff('0xe'),JSON[_0x04ff('0x10')](_0x3fead4));if(_0x3fead4[_0x04ff('0x11')]){if(_0x3fead4['error'][_0x04ff('0x12')]===0x1f4){logger[_0x04ff('0x11')](_0x04ff('0x13'),_0x6a7a28,_0x3fead4['error'][_0x04ff('0x14')]);return _0x4754ad(_0x3fead4[_0x04ff('0x11')]['message']);}logger[_0x04ff('0x11')](_0x04ff('0x13'),_0x6a7a28,_0x3fead4[_0x04ff('0x11')][_0x04ff('0x14')]);return _0x3b72f0(_0x3fead4['error']['message']);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x6a7a28,_0x04ff('0xe'));_0x3b72f0(_0x3fead4['result'][_0x04ff('0x14')]);}})['catch'](function(_0x16226c){logger[_0x04ff('0x11')](_0x04ff('0x13'),_0x6a7a28,_0x16226c);_0x4754ad(_0x16226c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 83565ca..4273d7d 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 _0xe2b0=['express','Router','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','destroy','delete','multer','util','connect-timeout'];(function(_0x37fcf9,_0x352d89){var _0x1758f2=function(_0x2d8871){while(--_0x2d8871){_0x37fcf9['push'](_0x37fcf9['shift']());}};_0x1758f2(++_0x352d89);}(_0xe2b0,0x14d));var _0x0e2b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe2b0[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x0e2b('0x0'));var util=require(_0x0e2b('0x1'));var path=require('path');var timeout=require(_0x0e2b('0x2'));var express=require(_0x0e2b('0x3'));var router=express[_0x0e2b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e2b('0x5'));var config=require('../../config/environment');var controller=require(_0x0e2b('0x6'));router[_0x0e2b('0x7')]('/',auth[_0x0e2b('0x8')](),controller[_0x0e2b('0x9')]);router[_0x0e2b('0x7')]('/describe',auth[_0x0e2b('0x8')](),controller[_0x0e2b('0xa')]);router[_0x0e2b('0x7')](_0x0e2b('0xb'),auth[_0x0e2b('0x8')](),controller[_0x0e2b('0xc')]);router[_0x0e2b('0x7')](_0x0e2b('0xd'),auth['isAuthenticated'](),controller[_0x0e2b('0xe')]);router[_0x0e2b('0x7')](_0x0e2b('0xf'),auth['isAuthenticated'](),controller[_0x0e2b('0x10')]);router[_0x0e2b('0x11')]('/',auth['isAuthenticated'](),controller[_0x0e2b('0x12')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x0e2b('0x13')]);router[_0x0e2b('0x11')]('/:id/sections',auth[_0x0e2b('0x8')](),controller[_0x0e2b('0x14')]);router[_0x0e2b('0x11')](_0x0e2b('0xf'),auth[_0x0e2b('0x8')](),controller[_0x0e2b('0x15')]);router['put'](_0x0e2b('0xb'),auth[_0x0e2b('0x8')](),controller['update']);router['delete'](_0x0e2b('0xb'),auth['isAuthenticated'](),controller[_0x0e2b('0x16')]);router[_0x0e2b('0x17')](_0x0e2b('0xd'),auth[_0x0e2b('0x8')](),controller['removeSections']);router[_0x0e2b('0x17')](_0x0e2b('0xf'),auth[_0x0e2b('0x8')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0xb7db=['get','describe','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index'];(function(_0x256ce7,_0x3a602b){var _0x7bab9e=function(_0x2a9568){while(--_0x2a9568){_0x256ce7['push'](_0x256ce7['shift']());}};_0x7bab9e(++_0x3a602b);}(_0xb7db,0xac));var _0xbb7d=function(_0x495d33,_0x4acb6f){_0x495d33=_0x495d33-0x0;var _0x2436b1=_0xb7db[_0x495d33];return _0x2436b1;};'use strict';var multer=require('multer');var util=require(_0xbb7d('0x0'));var path=require(_0xbb7d('0x1'));var timeout=require(_0xbb7d('0x2'));var express=require(_0xbb7d('0x3'));var router=express[_0xbb7d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb7d('0x5'));var config=require(_0xbb7d('0x6'));var controller=require(_0xbb7d('0x7'));router['get']('/',auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x9')]);router[_0xbb7d('0xa')]('/describe',auth[_0xbb7d('0x8')](),controller[_0xbb7d('0xb')]);router[_0xbb7d('0xa')]('/:id',auth[_0xbb7d('0x8')](),controller[_0xbb7d('0xc')]);router['get'](_0xbb7d('0xd'),auth[_0xbb7d('0x8')](),controller[_0xbb7d('0xe')]);router[_0xbb7d('0xa')](_0xbb7d('0xf'),auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x10')]);router[_0xbb7d('0x11')]('/',auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x12')]);router[_0xbb7d('0x11')](_0xbb7d('0x13'),auth[_0xbb7d('0x8')](),controller['clone']);router[_0xbb7d('0x11')](_0xbb7d('0xd'),auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x14')]);router[_0xbb7d('0x11')](_0xbb7d('0xf'),auth['isAuthenticated'](),controller[_0xbb7d('0x15')]);router['put'](_0xbb7d('0x16'),auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x17')]);router[_0xbb7d('0x18')](_0xbb7d('0x16'),auth[_0xbb7d('0x8')](),controller[_0xbb7d('0x19')]);router[_0xbb7d('0x18')](_0xbb7d('0xd'),auth['isAuthenticated'](),controller['removeSections']);router[_0xbb7d('0x18')](_0xbb7d('0xf'),auth[_0xbb7d('0x8')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c243ca8..0056cf7 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 _0xaebe=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x2ca04a,_0x47eeb0){var _0x3bc72c=function(_0x432c59){while(--_0x432c59){_0x2ca04a['push'](_0x2ca04a['shift']());}};_0x3bc72c(++_0x47eeb0);}(_0xaebe,0xed));var _0xeaeb=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xaebe[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0xeaeb('0x0'));module[_0xeaeb('0x1')]={'name':{'type':Sequelize[_0xeaeb('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x27ddc8){this[_0xeaeb('0x3')](_0xeaeb('0x4'),_0x27ddc8?_0x27ddc8[_0xeaeb('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xeaeb('0x4'))?this[_0xeaeb('0x6')](_0xeaeb('0x4'))[_0xeaeb('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xeaeb('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x4704=['crudPermissions','getDataValue','sequelize','STRING','name','setDataValue'];(function(_0xd12b8d,_0x503b2){var _0x1132e3=function(_0x3176dc){while(--_0x3176dc){_0xd12b8d['push'](_0xd12b8d['shift']());}};_0x1132e3(++_0x503b2);}(_0x4704,0x19a));var _0x4470=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x4704[_0xc471d2];return _0x334c68;};'use strict';var Sequelize=require(_0x4470('0x0'));module['exports']={'name':{'type':Sequelize[_0x4470('0x1')],'allowNull':![],'unique':_0x4470('0x2')},'crudPermissions':{'type':Sequelize[_0x4470('0x1')],'set':function(_0x388b71){this[_0x4470('0x3')](_0x4470('0x4'),_0x388b71?_0x388b71['join'](''):[]);},'get':function(){return this[_0x4470('0x5')]('crudPermissions')?this[_0x4470('0x5')](_0x4470('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4470('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index cc6b412..9292b3d 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 _0xddf8=['userProfileId','Resources','UserProfileSection','describe','addSections','transaction','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','mergeResources','parentSections','all','ignore','union','childModel','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','Tags','color','Tag','tag','value','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','contacts','CmContact','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','QueueCampaigns','users','agents','telephones','User','Users','admin','user','zendeskaccounts','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','UserProfile','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','clone','get','omit','updatedAt','crudPermissions','sequelize','each','autoAssociation','UserProfileResource','createdAt','sectionId'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xddf8,0x94));var _0x8ddf=function(_0x15a4c8,_0x1ad9f2){_0x15a4c8=_0x15a4c8-0x0;var _0x166023=_0xddf8[_0x15a4c8];return _0x166023;};'use strict';var pdf=require(_0x8ddf('0x0'));var emlformat=require(_0x8ddf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8ddf('0x2'));var jsonpatch=require(_0x8ddf('0x3'));var rp=require(_0x8ddf('0x4'));var moment=require(_0x8ddf('0x5'));var BPromise=require(_0x8ddf('0x6'));var Mustache=require('mustache');var util=require(_0x8ddf('0x7'));var path=require(_0x8ddf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8ddf('0x9'));var fs=require('fs');var _=require(_0x8ddf('0xa'));var squel=require(_0x8ddf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ddf('0xc'));var querystring=require(_0x8ddf('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ddf('0xe'));var as=require(_0x8ddf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ddf('0x10'))('api');var utils=require(_0x8ddf('0x11'));var config=require(_0x8ddf('0x12'));var db=require('../../mysqldb')['db'];config[_0x8ddf('0x13')]=_['defaults'](config['redis'],{'host':_0x8ddf('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ddf('0x13')]));require(_0x8ddf('0x15'))[_0x8ddf('0x16')](socket);function respondWithStatusCode(_0x48c22c,_0x127833){_0x127833=_0x127833||0xcc;return function(_0x58b7f9){if(_0x58b7f9){return _0x48c22c[_0x8ddf('0x17')](_0x127833);}return _0x48c22c[_0x8ddf('0x18')](_0x127833)[_0x8ddf('0x19')]();};}function respondWithResult(_0xf61c56,_0x5261b8){_0x5261b8=_0x5261b8||0xc8;return function(_0x3b06e3){if(_0x3b06e3){return _0xf61c56['status'](_0x5261b8)[_0x8ddf('0x1a')](_0x3b06e3);}};}function respondWithFilteredResult(_0x3d2497,_0x103218){return function(_0x396da3){if(_0x396da3){var _0x1dca7a=_0x396da3[_0x8ddf('0x1b')],_0x160e75=_0x103218[_0x8ddf('0x1c')],_0x4fe8e4=_0x103218[_0x8ddf('0x1c')]+_0x103218['limit'],_0x18f78c;if(_0x4fe8e4>=_0x1dca7a){_0x4fe8e4=_0x1dca7a;_0x18f78c=0xc8;}else{_0x18f78c=0xce;}_0x3d2497[_0x8ddf('0x18')](_0x18f78c);return _0x3d2497['set'](_0x8ddf('0x1d'),_0x160e75+'-'+_0x4fe8e4+'/'+_0x1dca7a)[_0x8ddf('0x1a')](_0x396da3);}return null;};}function patchUpdates(_0x5e1cb5){return function(_0x2e9d8c){try{jsonpatch[_0x8ddf('0x1e')](_0x2e9d8c,_0x5e1cb5,!![]);}catch(_0x30e818){return BPromise[_0x8ddf('0x1f')](_0x30e818);}return _0x2e9d8c[_0x8ddf('0x20')]();};}function saveUpdates(_0x55357b,_0x4189c9){return function(_0xc605){if(_0xc605){return _0xc605[_0x8ddf('0x21')](_0x55357b)[_0x8ddf('0x22')](function(_0x2d0cbb){return _0x2d0cbb;});}return null;};}function removeEntity(_0x42f4bf,_0x47809d){return function(_0xb9705f){if(_0xb9705f){return _0xb9705f[_0x8ddf('0x23')]()[_0x8ddf('0x22')](function(){_0x42f4bf['status'](0xcc)[_0x8ddf('0x19')]();});}};}function handleEntityNotFound(_0x28b89e,_0x1794ee){return function(_0x375f37){if(!_0x375f37){_0x28b89e[_0x8ddf('0x17')](0x194);}return _0x375f37;};}function handleError(_0x3f94ae,_0x4bf443){_0x4bf443=_0x4bf443||0x1f4;return function(_0xc06ebb){logger['error'](_0xc06ebb[_0x8ddf('0x24')]);if(_0xc06ebb[_0x8ddf('0x25')]){delete _0xc06ebb['name'];}_0x3f94ae[_0x8ddf('0x18')](_0x4bf443)[_0x8ddf('0x26')](_0xc06ebb);};}exports[_0x8ddf('0x27')]=function(_0x3416c4,_0x5a1b16){var _0x312cc0={},_0x28eb71={},_0x3d75f4={'count':0x0,'rows':[]};var _0x2fd774=_[_0x8ddf('0x28')](db['UserProfile'][_0x8ddf('0x29')],function(_0x16e932){return{'name':_0x16e932['fieldName'],'type':_0x16e932[_0x8ddf('0x2a')][_0x8ddf('0x2b')]};});_0x28eb71[_0x8ddf('0x2c')]=_[_0x8ddf('0x28')](_0x2fd774,_0x8ddf('0x25'));_0x28eb71[_0x8ddf('0x2d')]=_['keys'](_0x3416c4['query']);_0x28eb71[_0x8ddf('0x2e')]=_[_0x8ddf('0x2f')](_0x28eb71[_0x8ddf('0x2c')],_0x28eb71['query']);_0x312cc0[_0x8ddf('0x30')]=_[_0x8ddf('0x2f')](_0x28eb71[_0x8ddf('0x2c')],qs['fields'](_0x3416c4['query'][_0x8ddf('0x31')]));_0x312cc0['attributes']=_0x312cc0[_0x8ddf('0x30')][_0x8ddf('0x32')]?_0x312cc0['attributes']:_0x28eb71[_0x8ddf('0x2c')];if(!_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x33')](_0x8ddf('0x34'))){_0x312cc0[_0x8ddf('0x35')]=qs[_0x8ddf('0x35')](_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x35')]);_0x312cc0[_0x8ddf('0x1c')]=qs[_0x8ddf('0x1c')](_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x1c')]);}_0x312cc0['order']=qs[_0x8ddf('0x36')](_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x36')]);_0x312cc0[_0x8ddf('0x37')]=qs[_0x8ddf('0x2e')](_[_0x8ddf('0x38')](_0x3416c4[_0x8ddf('0x2d')],_0x28eb71['filters']),_0x2fd774);if(_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x39')]){_0x312cc0[_0x8ddf('0x37')]=_['merge'](_0x312cc0['where'],{'$or':_[_0x8ddf('0x28')](_0x2fd774,function(_0x5e99d4){if(_0x5e99d4[_0x8ddf('0x2a')]!==_0x8ddf('0x3a')){var _0xe22c0e={};_0xe22c0e[_0x5e99d4[_0x8ddf('0x25')]]={'$like':'%'+_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x39')]+'%'};return _0xe22c0e;}})});}_0x312cc0=_[_0x8ddf('0x3b')]({},_0x312cc0,_0x3416c4['options']);var _0x29a71d={'where':_0x312cc0[_0x8ddf('0x37')]};return db[_0x8ddf('0x3c')][_0x8ddf('0x1b')](_0x29a71d)[_0x8ddf('0x22')](function(_0x218d76){_0x3d75f4[_0x8ddf('0x1b')]=_0x218d76;if(_0x3416c4[_0x8ddf('0x2d')][_0x8ddf('0x3d')]){_0x312cc0[_0x8ddf('0x3e')]=[{'all':!![]}];}return db[_0x8ddf('0x3c')][_0x8ddf('0x3f')](_0x312cc0);})[_0x8ddf('0x22')](function(_0x37ed98){_0x3d75f4[_0x8ddf('0x40')]=_0x37ed98;return _0x3d75f4;})[_0x8ddf('0x22')](respondWithFilteredResult(_0x5a1b16,_0x312cc0))[_0x8ddf('0x41')](handleError(_0x5a1b16,null));};exports['show']=function(_0x3c86d2,_0x35a8bf){var _0x1c5e22={'raw':![],'where':{'id':_0x3c86d2[_0x8ddf('0x42')]['id']}},_0x246a7f={};_0x246a7f[_0x8ddf('0x2c')]=_['keys'](db['UserProfile'][_0x8ddf('0x29')]);_0x246a7f['query']=_[_0x8ddf('0x43')](_0x3c86d2[_0x8ddf('0x2d')]);_0x246a7f[_0x8ddf('0x2e')]=_[_0x8ddf('0x2f')](_0x246a7f['model'],_0x246a7f['query']);_0x1c5e22['attributes']=_['intersection'](_0x246a7f[_0x8ddf('0x2c')],qs['fields'](_0x3c86d2[_0x8ddf('0x2d')]['fields']));_0x1c5e22[_0x8ddf('0x30')]=_0x1c5e22[_0x8ddf('0x30')][_0x8ddf('0x32')]?_0x1c5e22[_0x8ddf('0x30')]:_0x246a7f[_0x8ddf('0x2c')];if(_0x3c86d2[_0x8ddf('0x2d')][_0x8ddf('0x3d')]){_0x1c5e22[_0x8ddf('0x3e')]=[{'all':!![]}];}_0x1c5e22=_[_0x8ddf('0x3b')]({},_0x1c5e22,_0x3c86d2[_0x8ddf('0x44')]);return db[_0x8ddf('0x3c')][_0x8ddf('0x45')](_0x1c5e22)[_0x8ddf('0x22')](handleEntityNotFound(_0x35a8bf,null))[_0x8ddf('0x22')](respondWithResult(_0x35a8bf,null))['catch'](handleError(_0x35a8bf,null));};exports['create']=function(_0x1b11b0,_0x24da10){return db[_0x8ddf('0x3c')][_0x8ddf('0x46')](_0x1b11b0[_0x8ddf('0x47')],{})[_0x8ddf('0x22')](respondWithResult(_0x24da10,0xc9))[_0x8ddf('0x41')](handleError(_0x24da10,null));};exports[_0x8ddf('0x48')]=function(_0xc6d66,_0x19acad){var _0x387da7={'where':{'id':_0xc6d66[_0x8ddf('0x42')]['id']}},_0x57da3e={};_0x57da3e['model']=_[_0x8ddf('0x43')](db['UserProfile']['rawAttributes']);_0x387da7[_0x8ddf('0x30')]=_[_0x8ddf('0x2f')](_0x57da3e[_0x8ddf('0x2c')],qs['fields'](_0xc6d66['query'][_0x8ddf('0x31')]));_0x387da7[_0x8ddf('0x30')]=_0x387da7[_0x8ddf('0x30')][_0x8ddf('0x32')]?_0x387da7[_0x8ddf('0x30')]:_0x57da3e[_0x8ddf('0x2c')];if(_0xc6d66[_0x8ddf('0x2d')]['includeAll']){_0x387da7['include']=[{'all':!![]}];}_0x387da7=_[_0x8ddf('0x3b')]({},_0x387da7,_0xc6d66[_0x8ddf('0x44')]);return db[_0x8ddf('0x3c')][_0x8ddf('0x45')](_0x387da7)[_0x8ddf('0x22')](handleEntityNotFound(_0x19acad,null))['then'](function(_0x266856){if(_0x266856){var _0xc199cc=_0x266856[_0x8ddf('0x49')]({'plain':!![]});_0xc199cc=qs[_0x8ddf('0x4a')](_0xc199cc,['id','createdAt',_0x8ddf('0x4b'),_0x8ddf('0x4c')]);_0xc6d66[_0x8ddf('0x47')]=_[_0x8ddf('0x4a')](_0xc6d66[_0x8ddf('0x47')],['id','createdAt',_0x8ddf('0x4b')]);return db[_0x8ddf('0x4d')]['transaction'](function(_0x381568){return db[_0x8ddf('0x3c')]['create'](_[_0x8ddf('0x3b')](_0xc199cc,_0xc6d66[_0x8ddf('0x47')]),{'include':_0xc6d66['query'][_0x8ddf('0x3d')]?[{'all':!![]}]:undefined,'transaction':_0x381568})[_0x8ddf('0x22')](function(_0x234bae){var _0x5ad922=_0x234bae[_0x8ddf('0x49')]({'plain':!![]});return db['UserProfileSection'][_0x8ddf('0x3f')]({'where':{'userProfileId':_0xc6d66[_0x8ddf('0x42')]['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0x5c2203){if(_0x5c2203){return BPromise[_0x8ddf('0x4e')](_0x5c2203,function(_0x4206fa){return new BPromise(function(_0x57fd22,_0x200a17){if(_0x4206fa[_0x8ddf('0x4f')]===null||_0x4206fa[_0x8ddf('0x4f')]===0x1)_0x57fd22(null);return db[_0x8ddf('0x50')][_0x8ddf('0x3f')]({'where':{'sectionId':_0x4206fa['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0x2180d2){var _0xa5f297=_[_0x8ddf('0x28')](_0x2180d2,function(_0x4d027d){return qs['omit'](_0x4d027d,['id',_0x8ddf('0x51'),'updatedAt',_0x8ddf('0x52')]);});_0x57fd22(_0xa5f297);})[_0x8ddf('0x41')](function(_0xec456d){_0x200a17(_0xec456d);});})[_0x8ddf('0x22')](function(_0x265f57){var _0x197ec7=qs['omit'](_0x4206fa,['id',_0x8ddf('0x51'),'updatedAt']);_0x197ec7[_0x8ddf('0x53')]=_0x5ad922['id'];if(_0x265f57)_0x197ec7[_0x8ddf('0x54')]=_0x265f57;return _0x197ec7;})[_0x8ddf('0x22')](function(_0x2f53d8){return db[_0x8ddf('0x55')][_0x8ddf('0x46')](_0x2f53d8,{'include':[{'model':db[_0x8ddf('0x50')],'as':'Resources'}],'raw':!![],'transaction':_0x381568});});})['then'](function(){return _0x5ad922;});}});});});}})[_0x8ddf('0x22')](respondWithResult(_0x19acad,0xc9))['catch'](handleError(_0x19acad,null));};exports[_0x8ddf('0x21')]=function(_0x3afbe1,_0x4db371){if(_0x3afbe1[_0x8ddf('0x47')]['id']){delete _0x3afbe1['body']['id'];}return db[_0x8ddf('0x3c')][_0x8ddf('0x45')]({'where':{'id':_0x3afbe1['params']['id']}})[_0x8ddf('0x22')](handleEntityNotFound(_0x4db371,null))['then'](saveUpdates(_0x3afbe1[_0x8ddf('0x47')],null))['then'](respondWithResult(_0x4db371,null))['catch'](handleError(_0x4db371,null));};exports[_0x8ddf('0x23')]=function(_0x37d740,_0x3a3626){return db[_0x8ddf('0x3c')][_0x8ddf('0x45')]({'where':{'id':_0x37d740['params']['id']}})[_0x8ddf('0x22')](handleEntityNotFound(_0x3a3626,null))[_0x8ddf('0x22')](removeEntity(_0x3a3626,null))[_0x8ddf('0x41')](handleError(_0x3a3626,null));};exports[_0x8ddf('0x56')]=function(_0x459407,_0x28352a){return db[_0x8ddf('0x3c')]['describe']()[_0x8ddf('0x22')](respondWithResult(_0x28352a,null))[_0x8ddf('0x41')](handleError(_0x28352a,null));};exports[_0x8ddf('0x57')]=function(_0x42a226,_0x12a32f){var _0xce0740=_0x42a226[_0x8ddf('0x47')];return db[_0x8ddf('0x3c')]['find']({'where':{'id':_0x42a226['params']['id']}})['then'](handleEntityNotFound(_0x12a32f,null))['then'](function(_0x1d7fb5){if(_0x1d7fb5){return db['sequelize'][_0x8ddf('0x58')](function(_0x4c9905){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x42a226['params']['id'],'sectionId':_[_0x8ddf('0x28')](_0xce0740,function(_0x2eb128){return _0x2eb128[_0x8ddf('0x52')];})},'transaction':_0x4c9905})[_0x8ddf('0x22')](function(){var _0x55e5eb=_[_0x8ddf('0x28')](_0xce0740,function(_0x218e9f){_0x218e9f['userProfileId']=_0x42a226[_0x8ddf('0x42')]['id'];return _0x218e9f;});var _0xcdcda5=[];return BPromise[_0x8ddf('0x4e')](_0x55e5eb,function(_0x3a1c5f){return db['UserProfileSection'][_0x8ddf('0x46')](_0x3a1c5f,{'include':[{'model':db[_0x8ddf('0x50')],'as':_0x8ddf('0x54')}],'raw':!![],'transaction':_0x4c9905})['then'](function(_0x3b287d){_0xcdcda5[_0x8ddf('0x59')](_0x3b287d[_0x8ddf('0x49')]({'plain':!![]}));});})[_0x8ddf('0x22')](function(){return _0xcdcda5;});});});}})['then'](function(_0x318d8d){return _0x318d8d;})['then'](respondWithResult(_0x12a32f,null))['catch'](handleError(_0x12a32f,null));};exports[_0x8ddf('0x5a')]=function(_0x25aab4,_0x7161ef){var _0x50b1f9;return db[_0x8ddf('0x3c')][_0x8ddf('0x45')]({'where':{'id':_0x25aab4['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x7161ef,null))[_0x8ddf('0x22')](function(_0x311ee8){if(_0x311ee8){_0x50b1f9=_0x311ee8;return db[_0x8ddf('0x55')]['destroy']({'where':{'userProfileId':_0x25aab4[_0x8ddf('0x42')]['id'],'sectionId':_0x25aab4[_0x8ddf('0x2d')]['ids']}});}})[_0x8ddf('0x22')](function(){return _0x50b1f9;})[_0x8ddf('0x22')](respondWithStatusCode(_0x7161ef,null))[_0x8ddf('0x41')](handleError(_0x7161ef,null));};exports[_0x8ddf('0x5b')]=function(_0x1a18f0,_0x4995ea){var _0x2b12fb=[];var _0x29c42f=[];return db[_0x8ddf('0x55')][_0x8ddf('0x3f')]({'where':{'userProfileId':_0x1a18f0[_0x8ddf('0x42')]['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0x5c022f){_0x2b12fb=_['filter'](_0x5c022f,function(_0x1370cf){return _0x1370cf[_0x8ddf('0x5c')]===0x1||_[_0x8ddf('0x5d')]([0x3eb,0x709],_0x1370cf[_0x8ddf('0x52')]);});if(!_[_0x8ddf('0x5e')](_0x2b12fb)){return _[_0x8ddf('0x28')](_0x2b12fb,function(_0x44ecad){return _0x44ecad[_0x8ddf('0x52')];});}else{return;}})[_0x8ddf('0x22')](function(_0x8f0ab9){if(_0x8f0ab9)_0x29c42f=_0x8f0ab9;if(_[_0x8ddf('0x5d')](_0x29c42f,0x64)){var _0x31a891=_[_0x8ddf('0x45')](_0x2b12fb,{'sectionId':0x64});return hasDefaultDashboard(_0x31a891)['then'](function(_0x479c78){return _[_0x8ddf('0x28')](_0x2b12fb,function(_0x338b49){if(_0x338b49[_0x8ddf('0x52')]===0x64){_0x338b49[_0x8ddf('0x5f')]=_0x479c78;}return _0x338b49;});});}else{return;}})['then'](function(_0x2d1f44){if(_0x2d1f44)_0x2b12fb=_0x2d1f44;if(_[_0x8ddf('0x5d')](_0x29c42f,0x3eb)){var _0x4e72ee=_[_0x8ddf('0x45')](_0x2b12fb,{'sectionId':0x3eb});return getCustomDashboards(_0x4e72ee)['then'](function(_0x101d38){return _['map'](_0x2b12fb,function(_0x582c5b){if(_0x4e72ee[_0x8ddf('0x5c')]){if(_0x582c5b[_0x8ddf('0x52')]===0x3eb){_0x582c5b[_0x8ddf('0x5f')]=_0x101d38;}}else{if(_0x582c5b[_0x8ddf('0x52')]===0x64){_0x582c5b[_0x8ddf('0x5f')]=_0x101d38;}}return _0x582c5b;});});}else{return;}})[_0x8ddf('0x22')](function(_0x37c32a){if(_0x37c32a)_0x2b12fb=_0x37c32a;if(_[_0x8ddf('0x5d')](_0x29c42f,0x709)){var _0x31e1c6=_['find'](_0x2b12fb,{'sectionId':0x709});return getPlugins(_0x31e1c6)[_0x8ddf('0x22')](function(_0x2e211a){if(_0x31e1c6[_0x8ddf('0x5c')]){return _[_0x8ddf('0x28')](_0x2b12fb,function(_0x2b7649){if(_0x2b7649[_0x8ddf('0x52')]===0x709){_0x2b7649[_0x8ddf('0x5f')]=_0x2e211a;}return _0x2b7649;});}else{var _0xdc7b39={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e211a};var _0x5d8747=_['map'](_0x2b12fb);_0x5d8747['push'](_0xdc7b39);return _0x5d8747;}});}else{return;}})[_0x8ddf('0x22')](function(_0x4f04c9){if(_0x4f04c9)_0x2b12fb=_0x4f04c9;return _[_0x8ddf('0x39')](_0x2b12fb,['enabled',0x1]);})['then'](respondWithResult(_0x4995ea,null))['catch'](handleError(_0x4995ea,null));};function hasDefaultDashboard(_0x374dfc){var _0xcc452d=[0x65];return new BPromise(function(_0x5b8a0b,_0x3f47b3){try{if(_0x374dfc[_0x8ddf('0x4f')]){_0x5b8a0b(_0xcc452d);}else{return db[_0x8ddf('0x50')][_0x8ddf('0x60')]({'where':{'sectionId':_0x374dfc['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0x463c5c){_0x463c5c?_0x5b8a0b(_0xcc452d):_0x5b8a0b();});}}catch(_0x77680e){_0x3f47b3(_0x77680e);}});}function getCustomDashboards(_0x5c1c2a){var _0x4c3568=[];return new BPromise(function(_0x58d0dd,_0x2de8dc){try{if(_0x5c1c2a[_0x8ddf('0x4f')]){return db['Dashboard'][_0x8ddf('0x3f')]({'raw':!![]})[_0x8ddf('0x22')](function(_0x444f27){_0x444f27[_0x8ddf('0x61')](function(_0x220e49){_0x4c3568[_0x8ddf('0x59')](_0x220e49['id']+0x1869f);});_0x58d0dd(_0x4c3568);});}else{return db['UserProfileResource'][_0x8ddf('0x3f')]({'where':{'sectionId':_0x5c1c2a['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0xa444b7){_0xa444b7['forEach'](function(_0x9ed89a){_0x4c3568[_0x8ddf('0x59')](_0x9ed89a[_0x8ddf('0x62')]+0x1869f);});_0x58d0dd(_0x4c3568);});}}catch(_0x38eb13){_0x2de8dc(_0x38eb13);}});}function getPlugins(_0x2513d9){var _0x25e433=[];return new BPromise(function(_0x254804,_0x4f680d){try{if(_0x2513d9[_0x8ddf('0x4f')]){return db['Plugin']['findAll']({'raw':!![]})[_0x8ddf('0x22')](function(_0x21b2e2){_0x21b2e2[_0x8ddf('0x61')](function(_0x19290d){_0x25e433[_0x8ddf('0x59')](_0x19290d['id']+0x15b38);});_0x254804(_0x25e433);});}else{return db[_0x8ddf('0x50')][_0x8ddf('0x3f')]({'where':{'sectionId':_0x2513d9['id']},'raw':!![]})[_0x8ddf('0x22')](function(_0x4d9b0b){_0x4d9b0b['forEach'](function(_0x1dd55b){_0x25e433[_0x8ddf('0x59')](_0x1dd55b[_0x8ddf('0x62')]+0x15b38);});_0x254804(_0x25e433);});}}catch(_0x51576c){_0x4f680d(_0x51576c);}});}exports['addResources']=function(_0x27c6ca,_0x14a8f0){return db['UserProfile'][_0x8ddf('0x45')]({'where':{'id':_0x27c6ca['params']['id']}})[_0x8ddf('0x22')](handleEntityNotFound(_0x14a8f0,null))[_0x8ddf('0x22')](function(_0x1ba8c7){if(_0x1ba8c7){return db[_0x8ddf('0x4d')][_0x8ddf('0x58')](function(_0x278fc2){return db[_0x8ddf('0x55')][_0x8ddf('0x3f')]({'where':{'userProfileId':_0x27c6ca['params']['id']},'attributes':['id'],'raw':!![]})[_0x8ddf('0x22')](function(_0x25e27c){if(_0x25e27c){return db[_0x8ddf('0x55')][_0x8ddf('0x23')]({'where':{'userProfileId':_0x27c6ca[_0x8ddf('0x42')]['id'],'id':_['map'](_0x25e27c,function(_0x4b38ea){return _0x4b38ea['id'];})},'transaction':_0x278fc2});}})[_0x8ddf('0x22')](function(_0x6f4ee0){var _0x4bf3bb=_['map'](_0x27c6ca['body'],function(_0x37a017){_0x37a017['userProfileId']=_0x27c6ca['params']['id'];return _0x37a017;});return db['UserProfileSection']['bulkCreate'](_0x4bf3bb,{'raw':!![],'transaction':_0x278fc2});})[_0x8ddf('0x22')](function(_0x10026b){var _0x3392de=_[_0x8ddf('0x39')](_[_0x8ddf('0x28')](_0x10026b,function(_0x419092){return _0x419092[_0x8ddf('0x49')]({'plain':!![]});}),{'includeAll':![]});if(_0x3392de){return db[_0x8ddf('0x55')][_0x8ddf('0x3f')]({'where':{'userProfileId':_0x27c6ca[_0x8ddf('0x42')]['id'],'sectionId':_[_0x8ddf('0x28')](_0x3392de,function(_0x40ef4f){return _0x40ef4f[_0x8ddf('0x52')];})},'attributes':['id',_0x8ddf('0x52')],'raw':!![]})[_0x8ddf('0x22')](function(_0x1463f3){var _0x474e67=_[_0x8ddf('0x28')](_0x27c6ca['body'],function(_0x2d5127){_0x2d5127[_0x8ddf('0x53')]=_0x27c6ca['params']['id'];return _0x2d5127;});return db['UserProfileResource'][_0x8ddf('0x63')](_0x474e67,{'raw':!![],'transaction':_0x278fc2});});}})[_0x8ddf('0x41')](handleError(_0x14a8f0,null));});}})['then'](function(_0x3b28b9){var _0x2c0fad=_[_0x8ddf('0x28')](_0x3b28b9,function(_0x552079){return _0x552079[_0x8ddf('0x49')]({'plain':!![]});});})[_0x8ddf('0x22')](respondWithResult(_0x14a8f0,null))[_0x8ddf('0x41')](handleError(_0x14a8f0,null));};exports[_0x8ddf('0x64')]=function(_0x504394,_0x1c4057,_0x5d8c50){return db['UserProfile'][_0x8ddf('0x45')]({'where':{'id':_0x504394[_0x8ddf('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c4057,null))[_0x8ddf('0x22')](function(_0x49434d){if(_0x49434d){return _0x49434d[_0x8ddf('0x64')](_0x504394['query'][_0x8ddf('0x65')]);}})['then'](respondWithStatusCode(_0x1c4057,null))[_0x8ddf('0x41')](handleError(_0x1c4057,null));};exports[_0x8ddf('0x66')]=function(_0x28a3a2,_0x220109){var _0x554548={'raw':![],'where':{}};var _0x245613={};var _0x420887={'count':0x0,'rows':[]};var _0x17483e=_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x67')];if(typeof _0x17483e===_0x8ddf('0x68')){throw new db[(_0x8ddf('0x69'))][(_0x8ddf('0x6a'))]('Unknown\x20section');}var _0x599f7b=_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x6b')]||![];var _0x1919a7=getQueryModels(_0x17483e,_0x599f7b);if(typeof _0x1919a7['childModel']==='undefined'){throw new db['Sequelize'][(_0x8ddf('0x6a'))]('Invalid\x20section\x20\x27'+_0x17483e+'\x27');}var _0x526aaf=[];if(!_['isEmpty'](_0x1919a7[_0x8ddf('0x6c')])){_0x526aaf=_0x1919a7[_0x8ddf('0x6c')];}else{_0x526aaf=[{'name':_0x17483e}];}return db[_0x8ddf('0x3c')][_0x8ddf('0x60')]({'where':{'id':_0x28a3a2['params']['id']}})[_0x8ddf('0x22')](handleEntityNotFound(_0x220109,null))[_0x8ddf('0x22')](function(_0x13e40f){if(_0x13e40f){var _0xde5968=[];for(var _0x32085a=0x0;_0x32085a<_0x526aaf[_0x8ddf('0x32')];_0x32085a++){_0xde5968[_0x8ddf('0x59')](db['UserProfileSection'][_0x8ddf('0x60')]({'where':{'userProfileId':_0x13e40f['id'],'name':_0x526aaf[_0x32085a][_0x8ddf('0x25')]},'raw':!![]}));}return BPromise[_0x8ddf('0x6d')](_0xde5968);}})[_0x8ddf('0x22')](function(_0xb37fa8){var _0x2c1c69=_[_0x8ddf('0x39')](_0xb37fa8,function(_0x5ca632){return _0x5ca632?_0x5ca632:undefined;});var _0x544ef6=_[_0x8ddf('0x39')](_0x526aaf,[_0x8ddf('0x6e'),!![]]);var _0x1cf855=_[_0x8ddf('0x5e')](_0x2c1c69)&&_[_0x8ddf('0x5e')](_0x544ef6)?null:_[_0x8ddf('0x6f')](_0x544ef6,_0x2c1c69);if(_0x1cf855){var _0x4bdf34=[];for(var _0xf808d4=0x0;_0xf808d4<_0x1cf855[_0x8ddf('0x32')];_0xf808d4++){var _0x373e5e=_[_0x8ddf('0x45')](_0x526aaf,function(_0x556ba9){return _0x1cf855[_0xf808d4]?_0x556ba9[_0x8ddf('0x25')]===_0x1cf855[_0xf808d4][_0x8ddf('0x25')]:null;});if(_0x373e5e){if(_0x1cf855[_0xf808d4]['ignore']){_0x4bdf34[_0x8ddf('0x59')](getAllResources(_0x1919a7[_0x8ddf('0x70')],_0x1cf855[_0xf808d4]));}else{if(!_0x1cf855[_0xf808d4][_0x8ddf('0x4f')]){_0x4bdf34[_0x8ddf('0x59')](getAllowedResources(_0x373e5e,_0x1cf855[_0xf808d4],_0x1919a7[_0x8ddf('0x70')]));}else{if(_0x373e5e[_0x8ddf('0x2c')]){_0x4bdf34['push'](getAllFilteredResources(_0x373e5e,_0x1cf855[_0xf808d4]));}}}}}return BPromise['all'](_0x4bdf34);}else{return null;}})[_0x8ddf('0x22')](function(_0x30a654){var _0x13d506=_0x30a654;var _0x2809bf=null;if(_0x13d506){_0x2809bf=_0x13d506[_0x8ddf('0x32')]===0x1?_0x13d506[0x0]:null;}if(_0x2809bf||_0x13d506){var _0x5b21d9=db[_0x1919a7['childModel']][_0x8ddf('0x29')];_0x245613[_0x8ddf('0x2c')]=_[_0x8ddf('0x43')](_0x5b21d9);_0x245613['query']=_[_0x8ddf('0x43')](_0x28a3a2[_0x8ddf('0x2d')]);_0x245613[_0x8ddf('0x2e')]=_[_0x8ddf('0x2f')](_0x245613[_0x8ddf('0x2c')],_0x245613[_0x8ddf('0x2d')]);_0x554548[_0x8ddf('0x30')]=_[_0x8ddf('0x2f')](_0x245613[_0x8ddf('0x2c')],qs[_0x8ddf('0x31')](_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x31')]));_0x554548['attributes']=_0x554548[_0x8ddf('0x30')][_0x8ddf('0x32')]?_0x554548['attributes']:_0x245613['model'];if(!_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x33')](_0x8ddf('0x34'))){_0x554548[_0x8ddf('0x35')]=qs[_0x8ddf('0x35')](_0x28a3a2['query']['limit']);_0x554548[_0x8ddf('0x1c')]=qs['offset'](_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x1c')]);}_0x554548['order']=qs['sort'](_0x28a3a2[_0x8ddf('0x2d')]['sort']);_0x554548[_0x8ddf('0x37')]=qs[_0x8ddf('0x2e')](_[_0x8ddf('0x38')](_0x28a3a2['query'],_0x245613[_0x8ddf('0x2e')]));if(_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x39')]){_0x554548['where']=_['merge'](_0x554548[_0x8ddf('0x37')],{'$or':_[_0x8ddf('0x28')](_0x5b21d9,function(_0x37229b){if(_0x37229b['type'][_0x8ddf('0x2b')]!==_0x8ddf('0x3a')){var _0x5d96cf={};_0x5d96cf[_0x37229b['field']]={'$like':'%'+_0x28a3a2[_0x8ddf('0x2d')]['filter']+'%'};return _0x5d96cf;}})});}var _0x58cb0b=[];if(_0x2809bf){var _0x307c0d=_['find'](_0x526aaf,[_0x8ddf('0x25'),_0x2809bf[_0x8ddf('0x25')]]);if(_0x307c0d[_0x8ddf('0x71')]){var _0x1aa791={};if(_0x1919a7[_0x8ddf('0x70')]==='AnalyticExtractedReport'){_0x1aa791[_0x307c0d[_0x8ddf('0x72')]]=_[_0x8ddf('0x28')](_0x2809bf['associatedResources'],'id');}else{_0x1aa791[_0x307c0d[_0x8ddf('0x72')]]=_0x2809bf[_0x8ddf('0x73')];}_0x58cb0b[_0x8ddf('0x59')](_0x1aa791);}else{_0x554548[_0x8ddf('0x37')]['id']=_0x2809bf[_0x8ddf('0x73')];}}else{for(var _0x3d4f02=0x0;_0x3d4f02<_0x13d506[_0x8ddf('0x32')];_0x3d4f02++){var _0x307c0d=_['find'](_0x526aaf,[_0x8ddf('0x25'),_0x13d506[_0x3d4f02][_0x8ddf('0x25')]]);if(_0x307c0d[_0x8ddf('0x71')]){var _0x1aa791={};_0x1aa791[_0x307c0d[_0x8ddf('0x72')]]=_0x13d506[_0x3d4f02][_0x8ddf('0x73')];_0x58cb0b['push'](_0x1aa791);}else{if(!_0x554548[_0x8ddf('0x37')]['id'])_0x554548['where']['id']=[];_0x13d506[_0x3d4f02][_0x8ddf('0x73')][_0x8ddf('0x61')](function(_0x544aaf){_0x554548[_0x8ddf('0x37')]['id'][_0x8ddf('0x59')](_0x544aaf);});}}}if(!_[_0x8ddf('0x5e')](_0x58cb0b)){_0x554548[_0x8ddf('0x37')]=_['merge'](_0x554548[_0x8ddf('0x37')],{'$and':{'$or':_0x58cb0b}});}_0x554548=_[_0x8ddf('0x3b')]({},_0x554548,_0x28a3a2[_0x8ddf('0x44')]);if(_0x2809bf&&!_0x2809bf[_0x8ddf('0x4f')]&&_0x1919a7[_0x8ddf('0x70')]===_0x8ddf('0x74')){if(_0x28a3a2[_0x8ddf('0x2d')]['includeAll']){_0x554548['include']=[{'all':!![]}];}return db[_0x1919a7[_0x8ddf('0x70')]][_0x8ddf('0x3f')](_0x554548)[_0x8ddf('0x22')](function(_0x51981e){var _0x4d785b=[];_0x51981e[_0x8ddf('0x61')](function(_0x35b06d){var _0x404aa1;switch(_0x35b06d[_0x8ddf('0x75')]){case _0x8ddf('0x76'):_0x404aa1=_[_0x8ddf('0x45')](_0x2809bf['associatedResources'],function(_0x155c8a){return _0x155c8a['id']===_0x35b06d[_0x8ddf('0x77')]&&_0x155c8a[_0x8ddf('0x2a')]===_0x8ddf('0x78');});break;case _0x8ddf('0x79'):_0x404aa1=_[_0x8ddf('0x45')](_0x2809bf['associatedResources'],function(_0x45813e){return _0x45813e['id']===_0x35b06d['reportId']&&_0x45813e['type']===_0x8ddf('0x7a');});break;}if(_0x404aa1)_0x4d785b[_0x8ddf('0x59')](_0x35b06d);});_0x420887['count']=_0x4d785b[_0x8ddf('0x32')];_0x420887['rows']=_0x4d785b;return _0x420887;});}else{return db[_0x1919a7[_0x8ddf('0x70')]]['count']({'where':_0x554548['where']})['then'](function(_0x2b86d8){_0x420887[_0x8ddf('0x1b')]=_0x2b86d8;if(_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x3d')]){if(_0x1919a7['childModel']==='CmContact'){_0x554548[_0x8ddf('0x3e')]=[{'model':db['Tag'],'as':_0x8ddf('0x7b'),'attributes':['id','name',_0x8ddf('0x7c')],'required':_0x28a3a2[_0x8ddf('0x2d')]['tag']?!![]:![]},{'model':db[_0x8ddf('0x7d')],'as':'ThroughTags','attributes':['id',_0x8ddf('0x25'),_0x8ddf('0x7c')],'through':_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x7e')]?{'attributes':[],'where':{'TagId':_0x28a3a2[_0x8ddf('0x2d')]['tag']||undefined}}:{},'required':_0x28a3a2[_0x8ddf('0x2d')][_0x8ddf('0x7e')]?!![]:![]}];}else{_0x554548['include']=[{'all':!![]}];}}return db[_0x1919a7[_0x8ddf('0x70')]][_0x8ddf('0x3f')](_0x554548);})[_0x8ddf('0x22')](function(_0x38cbfa){_0x420887[_0x8ddf('0x40')]=_0x38cbfa;return _0x420887;});}}else{return _0x420887;}})[_0x8ddf('0x22')](respondWithFilteredResult(_0x220109,_0x554548))[_0x8ddf('0x41')](handleError(_0x220109,null));};function getAllResources(_0x593971,_0x47533f){return new BPromise(function(_0xd01a4,_0x54aa28){if(_0x47533f){var _0x1a18fd=_0x47533f[_0x8ddf('0x39')]?{[_0x47533f['filter']['field']]:_0x47533f[_0x8ddf('0x39')][_0x8ddf('0x7f')]}:undefined;return db[_0x593971]['findAll']({'where':_0x1a18fd,'raw':!![]})[_0x8ddf('0x22')](function(_0x17c252){_0x47533f[_0x8ddf('0x73')]=_['map'](_0x17c252,'id');_0xd01a4(_0x47533f);})[_0x8ddf('0x41')](function(_0x4a6618){_0x54aa28(_0x4a6618);});}else{_0xd01a4(null);}});}function getAllFilteredResources(_0xb58b48,_0x29c734){return new BPromise(function(_0x4c3b28,_0x551e66){var _0x14d4d9=_0xb58b48[_0x8ddf('0x39')]?{[_0xb58b48[_0x8ddf('0x39')]['field']]:_0xb58b48['filter'][_0x8ddf('0x7f')]}:undefined;return db[_0xb58b48['model']][_0x8ddf('0x3f')]({'where':_0x14d4d9,'raw':!![]})[_0x8ddf('0x22')](function(_0x503709){_0x29c734[_0x8ddf('0x73')]=_[_0x8ddf('0x28')](_0x503709,function(_0x10f79d){return _0x10f79d[_0x8ddf('0x25')];});_0x4c3b28(_0x29c734);})['catch'](function(_0x105fa8){_0x551e66(_0x105fa8);});});}function getAllowedResources(_0x4b82d0,_0x4ca9aa,_0x5595c5){return new BPromise(function(_0x50f8e1,_0x41726b){if(_0x4ca9aa){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x4ca9aa['id']},'raw':!![]})['then'](function(_0x4928d2){if(_0x4b82d0[_0x8ddf('0x71')]&&_0x4b82d0['field']!=='id'){_0x4ca9aa[_0x8ddf('0x73')]=_[_0x8ddf('0x28')](_0x4928d2,function(_0x4cd7cc){return _0x4cd7cc[_0x4b82d0[_0x8ddf('0x71')]];});}else{if(_0x5595c5==='AnalyticExtractedReport'){_0x4ca9aa[_0x8ddf('0x73')]=_[_0x8ddf('0x28')](_0x4928d2,function(_0x249a6d){return{'id':_0x249a6d[_0x8ddf('0x62')],'type':_0x249a6d[_0x8ddf('0x2a')]};});}else{_0x4ca9aa['associatedResources']=_[_0x8ddf('0x28')](_0x4928d2,function(_0x1c0423){return _0x1c0423['resourceId'];});}}_0x50f8e1(_0x4ca9aa);})[_0x8ddf('0x41')](function(_0x1c743a){_0x41726b(_0x1c743a);});}else{_0x50f8e1(null);}});}function getQueryModels(_0x3280e4,_0x28149f){var _0x946950=_0x3280e4['toLowerCase']();var _0x585c6f={'childModel':undefined,'parentSections':[]};switch(_0x946950){case _0x8ddf('0x80'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x81');break;case _0x8ddf('0x82'):_0x585c6f['childModel']=_0x8ddf('0x83');break;case _0x8ddf('0x84'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x85');_0x585c6f[_0x8ddf('0x6c')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x8ddf('0x86')}];break;case _0x8ddf('0x87'):_0x585c6f['childModel']='JscriptyProject';break;case _0x8ddf('0x88'):_0x585c6f['childModel']=_0x8ddf('0x89');_0x585c6f[_0x8ddf('0x6c')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x8ddf('0x8a'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x8b');break;case _0x8ddf('0x8c'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x8d');break;case _0x8ddf('0x8e'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x8f');break;case'chatqueues':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x90');break;case'chatwebsites':_0x585c6f[_0x8ddf('0x70')]='ChatWebsite';break;case'faxqueues':_0x585c6f['childModel']=_0x8ddf('0x91');break;case _0x8ddf('0x92'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x93');break;case'inboundroutes':case _0x8ddf('0x94'):case _0x8ddf('0x95'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x96');break;case _0x8ddf('0x97'):_0x585c6f[_0x8ddf('0x70')]='VoiceContext';break;case'voicemails':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x98');break;case _0x8ddf('0x99'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x9a');_0x585c6f[_0x8ddf('0x6c')]=[{'name':_0x8ddf('0x9b'),'field':_0x8ddf('0x25'),'foreignKey':_0x8ddf('0x9c'),'model':'User','filter':{'field':_0x8ddf('0x9d'),'value':[_0x8ddf('0x9e')]}},{'name':_0x8ddf('0x9f'),'field':_0x8ddf('0x25'),'foreignKey':_0x8ddf('0x9c'),'model':'User','filter':{'field':_0x8ddf('0x9d'),'value':[_0x8ddf('0xa0')]}},{'name':_0x8ddf('0xa1'),'field':'name','foreignKey':_0x8ddf('0xa2'),'model':_0x8ddf('0xa3'),'filter':{'field':'type','value':[_0x8ddf('0xa4')]}},{'name':'QueueCampaigns','field':_0x8ddf('0x25'),'foreignKey':_0x8ddf('0xa2'),'model':'VoiceQueue','filter':{'field':_0x8ddf('0x2a'),'value':[_0x8ddf('0xa5')]}}];break;case'musiconholds':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xa6');break;case _0x8ddf('0xa7'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xa8');break;case _0x8ddf('0xa9'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xaa');break;case'ivrcampaigns':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xab');break;case _0x8ddf('0xac'):_0x585c6f['childModel']=_0x8ddf('0xad');break;case _0x8ddf('0xae'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xaf');break;case _0x8ddf('0xb0'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xb1');break;case _0x8ddf('0xb2'):_0x585c6f[_0x8ddf('0x70')]='OpenchannelQueue';break;case _0x8ddf('0xb3'):_0x585c6f['childModel']=_0x8ddf('0xb4');break;case _0x8ddf('0xb5'):_0x585c6f['childModel']=_0x8ddf('0xb6');break;case'smsaccounts':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xb7');break;case _0x8ddf('0xb8'):_0x585c6f['childModel']=_0x8ddf('0xb9');break;case _0x8ddf('0xba'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xbb');break;case _0x8ddf('0xbc'):_0x585c6f[_0x8ddf('0x70')]='Team';break;case _0x8ddf('0xbd'):case'queuecampaigns':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xa3');if(_0x28149f){_0x585c6f[_0x8ddf('0x6c')]=[{'name':'VoiceQueues'},{'name':_0x8ddf('0xbe')}];}break;case _0x8ddf('0xbf'):case _0x8ddf('0xc0'):case _0x8ddf('0xc1'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xc2');if(_0x28149f){_0x585c6f[_0x8ddf('0x6c')]=[{'name':_0x8ddf('0xc3'),'filter':{'field':_0x8ddf('0x9d'),'value':[_0x8ddf('0xc4'),_0x8ddf('0xc5')]},'ignore':!![]},{'name':'Agents'},{'name':_0x8ddf('0x9f')}];}break;case _0x8ddf('0xc6'):_0x585c6f[_0x8ddf('0x70')]='ZendeskAccount';break;case _0x8ddf('0xc7'):_0x585c6f[_0x8ddf('0x70')]='SalesforceAccount';break;case'freshdeskaccounts':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xc8');break;case _0x8ddf('0xc9'):_0x585c6f['childModel']=_0x8ddf('0xca');break;case _0x8ddf('0xcb'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xcc');break;case _0x8ddf('0xcd'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xce');break;case _0x8ddf('0xcf'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xc2');break;case _0x8ddf('0xd0'):_0x585c6f[_0x8ddf('0x70')]='CannedAnswer';break;case _0x8ddf('0xd1'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xd2');break;case _0x8ddf('0xd3'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xd4');break;case _0x8ddf('0xd5'):_0x585c6f['childModel']='Interval';break;case _0x8ddf('0xd6'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xd7');break;case'scheduler':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xd8');break;case _0x8ddf('0xd9'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xda');break;case'tags':_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x7d');break;case'templates':_0x585c6f['childModel']='Template';break;case _0x8ddf('0xdb'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xdc');break;case _0x8ddf('0xdd'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xde');break;case _0x8ddf('0xdf'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xe0');break;case _0x8ddf('0xe1'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0xe2');break;case _0x8ddf('0xe3'):_0x585c6f[_0x8ddf('0x70')]=_0x8ddf('0x74');_0x585c6f[_0x8ddf('0x6c')]=[{'name':_0x8ddf('0xe4'),'field':'id','foreignKey':'reportId'}];break;case _0x8ddf('0xe5'):_0x585c6f['childModel']=_0x8ddf('0xe6');break;case _0x8ddf('0xba'):_0x585c6f['childModel']=_0x8ddf('0xbb');break;default:return _0x585c6f;}return _0x585c6f;} \ No newline at end of file +var _0x373f=['triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','metrics','AnalyticMetric','whatsappaccounts','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','catch','length','options','create','body','createdAt','updatedAt','omit','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','find','destroy','describe','addSections','params','each','push','get','removeSections','getSections','includes','subsections','enabled','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','Unknown\x20section','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','all','ignore','union','childModel','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','DefaultReports','reportId','CustomReports','CmContact','Tag','Tags','ThroughTags','color','tag','rows','value','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','users','Users','admin','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','templates','Template'];(function(_0x17a781,_0x1dcf27){var _0x279db2=function(_0x32a614){while(--_0x32a614){_0x17a781['push'](_0x17a781['shift']());}};_0x279db2(++_0x1dcf27);}(_0x373f,0xfd));var _0xf373=function(_0x5430d5,_0x484426){_0x5430d5=_0x5430d5-0x0;var _0x1e6f03=_0x373f[_0x5430d5];return _0x1e6f03;};'use strict';var pdf=require(_0xf373('0x0'));var emlformat=require(_0xf373('0x1'));var rimraf=require(_0xf373('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf373('0x3'));var rp=require(_0xf373('0x4'));var moment=require(_0xf373('0x5'));var BPromise=require(_0xf373('0x6'));var Mustache=require(_0xf373('0x7'));var util=require('util');var path=require(_0xf373('0x8'));var sox=require(_0xf373('0x9'));var csv=require(_0xf373('0xa'));var ejs=require(_0xf373('0xb'));var fs=require('fs');var _=require(_0xf373('0xc'));var squel=require('squel');var crypto=require(_0xf373('0xd'));var jsforce=require(_0xf373('0xe'));var deskjs=require(_0xf373('0xf'));var toCsv=require(_0xf373('0xa'));var querystring=require(_0xf373('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf373('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf373('0x12'));var hardwareService=require(_0xf373('0x13'));var logger=require(_0xf373('0x14'))(_0xf373('0x15'));var utils=require(_0xf373('0x16'));var config=require(_0xf373('0x17'));var db=require(_0xf373('0x18'))['db'];config[_0xf373('0x19')]=_[_0xf373('0x1a')](config[_0xf373('0x19')],{'host':_0xf373('0x1b'),'port':0x18eb});var socket=require(_0xf373('0x1c'))(new Redis(config['redis']));require(_0xf373('0x1d'))['register'](socket);function respondWithStatusCode(_0x20d4cf,_0x3243af){_0x3243af=_0x3243af||0xcc;return function(_0x413b2e){if(_0x413b2e){return _0x20d4cf['sendStatus'](_0x3243af);}return _0x20d4cf[_0xf373('0x1e')](_0x3243af)[_0xf373('0x1f')]();};}function respondWithResult(_0x2a2ab0,_0x14080f){_0x14080f=_0x14080f||0xc8;return function(_0x55d409){if(_0x55d409){return _0x2a2ab0[_0xf373('0x1e')](_0x14080f)[_0xf373('0x20')](_0x55d409);}};}function respondWithFilteredResult(_0x9edda0,_0x5dfc82){return function(_0x27bec3){if(_0x27bec3){var _0xd9e2a2=_0x27bec3['count'],_0x1c0780=_0x5dfc82[_0xf373('0x21')],_0x35763b=_0x5dfc82[_0xf373('0x21')]+_0x5dfc82[_0xf373('0x22')],_0x51cb14;if(_0x35763b>=_0xd9e2a2){_0x35763b=_0xd9e2a2;_0x51cb14=0xc8;}else{_0x51cb14=0xce;}_0x9edda0[_0xf373('0x1e')](_0x51cb14);return _0x9edda0[_0xf373('0x23')](_0xf373('0x24'),_0x1c0780+'-'+_0x35763b+'/'+_0xd9e2a2)['json'](_0x27bec3);}return null;};}function patchUpdates(_0x49fafb){return function(_0x31301b){try{jsonpatch[_0xf373('0x25')](_0x31301b,_0x49fafb,!![]);}catch(_0x3177a7){return BPromise[_0xf373('0x26')](_0x3177a7);}return _0x31301b['save']();};}function saveUpdates(_0x4a9078,_0x19f99d){return function(_0x4be25b){if(_0x4be25b){return _0x4be25b[_0xf373('0x27')](_0x4a9078)[_0xf373('0x28')](function(_0x4a937b){return _0x4a937b;});}return null;};}function removeEntity(_0x24b6d4,_0x2ad8c6){return function(_0x59cc9c){if(_0x59cc9c){return _0x59cc9c['destroy']()[_0xf373('0x28')](function(){_0x24b6d4[_0xf373('0x1e')](0xcc)[_0xf373('0x1f')]();});}};}function handleEntityNotFound(_0x335430,_0x3e5279){return function(_0x230973){if(!_0x230973){_0x335430[_0xf373('0x29')](0x194);}return _0x230973;};}function handleError(_0x184585,_0x3a3d9c){_0x3a3d9c=_0x3a3d9c||0x1f4;return function(_0x1492d3){logger[_0xf373('0x2a')](_0x1492d3[_0xf373('0x2b')]);if(_0x1492d3[_0xf373('0x2c')]){delete _0x1492d3[_0xf373('0x2c')];}_0x184585[_0xf373('0x1e')](_0x3a3d9c)['send'](_0x1492d3);};}exports[_0xf373('0x2d')]=function(_0x11fda9,_0x3d4cd1){var _0x1ce590={},_0x111476={},_0x591f04={'count':0x0,'rows':[]};var _0x44bc73=_[_0xf373('0x2e')](db[_0xf373('0x2f')][_0xf373('0x30')],function(_0x30bad9){return{'name':_0x30bad9[_0xf373('0x31')],'type':_0x30bad9['type'][_0xf373('0x32')]};});_0x111476[_0xf373('0x33')]=_[_0xf373('0x2e')](_0x44bc73,_0xf373('0x2c'));_0x111476[_0xf373('0x34')]=_[_0xf373('0x35')](_0x11fda9[_0xf373('0x34')]);_0x111476['filters']=_[_0xf373('0x36')](_0x111476[_0xf373('0x33')],_0x111476[_0xf373('0x34')]);_0x1ce590[_0xf373('0x37')]=_[_0xf373('0x36')](_0x111476[_0xf373('0x33')],qs[_0xf373('0x38')](_0x11fda9[_0xf373('0x34')][_0xf373('0x38')]));_0x1ce590['attributes']=_0x1ce590['attributes']['length']?_0x1ce590[_0xf373('0x37')]:_0x111476[_0xf373('0x33')];if(!_0x11fda9['query']['hasOwnProperty'](_0xf373('0x39'))){_0x1ce590['limit']=qs[_0xf373('0x22')](_0x11fda9['query'][_0xf373('0x22')]);_0x1ce590[_0xf373('0x21')]=qs[_0xf373('0x21')](_0x11fda9[_0xf373('0x34')][_0xf373('0x21')]);}_0x1ce590[_0xf373('0x3a')]=qs[_0xf373('0x3b')](_0x11fda9[_0xf373('0x34')]['sort']);_0x1ce590[_0xf373('0x3c')]=qs[_0xf373('0x3d')](_[_0xf373('0x3e')](_0x11fda9[_0xf373('0x34')],_0x111476[_0xf373('0x3d')]),_0x44bc73);if(_0x11fda9[_0xf373('0x34')][_0xf373('0x3f')]){_0x1ce590[_0xf373('0x3c')]=_[_0xf373('0x40')](_0x1ce590[_0xf373('0x3c')],{'$or':_[_0xf373('0x2e')](_0x44bc73,function(_0x3fa9d4){if(_0x3fa9d4[_0xf373('0x41')]!==_0xf373('0x42')){var _0x569a38={};_0x569a38[_0x3fa9d4[_0xf373('0x2c')]]={'$like':'%'+_0x11fda9['query'][_0xf373('0x3f')]+'%'};return _0x569a38;}})});}_0x1ce590=_[_0xf373('0x40')]({},_0x1ce590,_0x11fda9['options']);var _0x3ad8fe={'where':_0x1ce590[_0xf373('0x3c')]};return db['UserProfile'][_0xf373('0x43')](_0x3ad8fe)[_0xf373('0x28')](function(_0x211c19){_0x591f04['count']=_0x211c19;if(_0x11fda9[_0xf373('0x34')][_0xf373('0x44')]){_0x1ce590[_0xf373('0x45')]=[{'all':!![]}];}return db[_0xf373('0x2f')][_0xf373('0x46')](_0x1ce590);})[_0xf373('0x28')](function(_0x1f710a){_0x591f04['rows']=_0x1f710a;return _0x591f04;})['then'](respondWithFilteredResult(_0x3d4cd1,_0x1ce590))[_0xf373('0x47')](handleError(_0x3d4cd1,null));};exports['show']=function(_0x27f35b,_0x50bc6b){var _0x1b2d86={'raw':![],'where':{'id':_0x27f35b['params']['id']}},_0x1908b4={};_0x1908b4[_0xf373('0x33')]=_[_0xf373('0x35')](db[_0xf373('0x2f')][_0xf373('0x30')]);_0x1908b4[_0xf373('0x34')]=_['keys'](_0x27f35b['query']);_0x1908b4['filters']=_['intersection'](_0x1908b4[_0xf373('0x33')],_0x1908b4[_0xf373('0x34')]);_0x1b2d86[_0xf373('0x37')]=_[_0xf373('0x36')](_0x1908b4[_0xf373('0x33')],qs[_0xf373('0x38')](_0x27f35b['query'][_0xf373('0x38')]));_0x1b2d86['attributes']=_0x1b2d86[_0xf373('0x37')][_0xf373('0x48')]?_0x1b2d86['attributes']:_0x1908b4[_0xf373('0x33')];if(_0x27f35b[_0xf373('0x34')][_0xf373('0x44')]){_0x1b2d86[_0xf373('0x45')]=[{'all':!![]}];}_0x1b2d86=_[_0xf373('0x40')]({},_0x1b2d86,_0x27f35b[_0xf373('0x49')]);return db['UserProfile']['find'](_0x1b2d86)[_0xf373('0x28')](handleEntityNotFound(_0x50bc6b,null))[_0xf373('0x28')](respondWithResult(_0x50bc6b,null))['catch'](handleError(_0x50bc6b,null));};exports[_0xf373('0x4a')]=function(_0x3706bf,_0x3ca490){return db[_0xf373('0x2f')][_0xf373('0x4a')](_0x3706bf[_0xf373('0x4b')],{})[_0xf373('0x28')](respondWithResult(_0x3ca490,0xc9))[_0xf373('0x47')](handleError(_0x3ca490,null));};exports['clone']=function(_0x170fd4,_0x210b31){var _0x393817={'where':{'id':_0x170fd4['params']['id']}},_0x3b7a4c={};_0x3b7a4c[_0xf373('0x33')]=_[_0xf373('0x35')](db[_0xf373('0x2f')]['rawAttributes']);_0x393817['attributes']=_[_0xf373('0x36')](_0x3b7a4c[_0xf373('0x33')],qs['fields'](_0x170fd4['query'][_0xf373('0x38')]));_0x393817['attributes']=_0x393817[_0xf373('0x37')]['length']?_0x393817['attributes']:_0x3b7a4c['model'];if(_0x170fd4[_0xf373('0x34')][_0xf373('0x44')]){_0x393817[_0xf373('0x45')]=[{'all':!![]}];}_0x393817=_[_0xf373('0x40')]({},_0x393817,_0x170fd4[_0xf373('0x49')]);return db['UserProfile']['find'](_0x393817)[_0xf373('0x28')](handleEntityNotFound(_0x210b31,null))[_0xf373('0x28')](function(_0x219ce5){if(_0x219ce5){var _0xf2dac=_0x219ce5['get']({'plain':!![]});_0xf2dac=qs['omit'](_0xf2dac,['id',_0xf373('0x4c'),_0xf373('0x4d'),'crudPermissions']);_0x170fd4[_0xf373('0x4b')]=_[_0xf373('0x4e')](_0x170fd4[_0xf373('0x4b')],['id',_0xf373('0x4c'),'updatedAt']);return db[_0xf373('0x4f')][_0xf373('0x50')](function(_0x24ae20){return db[_0xf373('0x2f')][_0xf373('0x4a')](_[_0xf373('0x40')](_0xf2dac,_0x170fd4[_0xf373('0x4b')]),{'include':_0x170fd4[_0xf373('0x34')][_0xf373('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x24ae20})[_0xf373('0x28')](function(_0x218cb7){var _0x1d68b0=_0x218cb7['get']({'plain':!![]});return db[_0xf373('0x51')][_0xf373('0x46')]({'where':{'userProfileId':_0x170fd4['params']['id']},'raw':!![]})[_0xf373('0x28')](function(_0x3580af){if(_0x3580af){return BPromise['each'](_0x3580af,function(_0x126715){return new BPromise(function(_0xcccf63,_0x597ef3){if(_0x126715[_0xf373('0x52')]===null||_0x126715[_0xf373('0x52')]===0x1)_0xcccf63(null);return db[_0xf373('0x53')][_0xf373('0x46')]({'where':{'sectionId':_0x126715['id']},'raw':!![]})[_0xf373('0x28')](function(_0x2a7887){var _0x556ac7=_[_0xf373('0x2e')](_0x2a7887,function(_0xbee9ea){return qs[_0xf373('0x4e')](_0xbee9ea,['id',_0xf373('0x4c'),'updatedAt',_0xf373('0x54')]);});_0xcccf63(_0x556ac7);})['catch'](function(_0x45e7ab){_0x597ef3(_0x45e7ab);});})[_0xf373('0x28')](function(_0x26490f){var _0x29b8d5=qs[_0xf373('0x4e')](_0x126715,['id',_0xf373('0x4c'),_0xf373('0x4d')]);_0x29b8d5[_0xf373('0x55')]=_0x1d68b0['id'];if(_0x26490f)_0x29b8d5[_0xf373('0x56')]=_0x26490f;return _0x29b8d5;})[_0xf373('0x28')](function(_0x956167){return db[_0xf373('0x51')]['create'](_0x956167,{'include':[{'model':db[_0xf373('0x53')],'as':_0xf373('0x56')}],'raw':!![],'transaction':_0x24ae20});});})[_0xf373('0x28')](function(){return _0x1d68b0;});}});});});}})[_0xf373('0x28')](respondWithResult(_0x210b31,0xc9))['catch'](handleError(_0x210b31,null));};exports[_0xf373('0x27')]=function(_0x95265,_0x4b74ad){if(_0x95265[_0xf373('0x4b')]['id']){delete _0x95265[_0xf373('0x4b')]['id'];}return db[_0xf373('0x2f')][_0xf373('0x57')]({'where':{'id':_0x95265['params']['id']}})['then'](handleEntityNotFound(_0x4b74ad,null))[_0xf373('0x28')](saveUpdates(_0x95265[_0xf373('0x4b')],null))[_0xf373('0x28')](respondWithResult(_0x4b74ad,null))[_0xf373('0x47')](handleError(_0x4b74ad,null));};exports[_0xf373('0x58')]=function(_0x37e2c6,_0x1679b6){return db[_0xf373('0x2f')][_0xf373('0x57')]({'where':{'id':_0x37e2c6['params']['id']}})['then'](handleEntityNotFound(_0x1679b6,null))[_0xf373('0x28')](removeEntity(_0x1679b6,null))['catch'](handleError(_0x1679b6,null));};exports[_0xf373('0x59')]=function(_0x6e193d,_0x57d8c6){return db[_0xf373('0x2f')]['describe']()[_0xf373('0x28')](respondWithResult(_0x57d8c6,null))['catch'](handleError(_0x57d8c6,null));};exports[_0xf373('0x5a')]=function(_0x47be40,_0x33b9ad){var _0x453e20=_0x47be40[_0xf373('0x4b')];return db[_0xf373('0x2f')][_0xf373('0x57')]({'where':{'id':_0x47be40[_0xf373('0x5b')]['id']}})[_0xf373('0x28')](handleEntityNotFound(_0x33b9ad,null))[_0xf373('0x28')](function(_0x8584df){if(_0x8584df){return db[_0xf373('0x4f')][_0xf373('0x50')](function(_0x5efc63){return db[_0xf373('0x51')][_0xf373('0x58')]({'where':{'userProfileId':_0x47be40[_0xf373('0x5b')]['id'],'sectionId':_[_0xf373('0x2e')](_0x453e20,function(_0x43f778){return _0x43f778[_0xf373('0x54')];})},'transaction':_0x5efc63})[_0xf373('0x28')](function(){var _0xe9145f=_['map'](_0x453e20,function(_0x24ebeb){_0x24ebeb[_0xf373('0x55')]=_0x47be40['params']['id'];return _0x24ebeb;});var _0x409524=[];return BPromise[_0xf373('0x5c')](_0xe9145f,function(_0x8f7955){return db[_0xf373('0x51')][_0xf373('0x4a')](_0x8f7955,{'include':[{'model':db['UserProfileResource'],'as':_0xf373('0x56')}],'raw':!![],'transaction':_0x5efc63})[_0xf373('0x28')](function(_0x45567d){_0x409524[_0xf373('0x5d')](_0x45567d[_0xf373('0x5e')]({'plain':!![]}));});})[_0xf373('0x28')](function(){return _0x409524;});});});}})[_0xf373('0x28')](function(_0xcbfd41){return _0xcbfd41;})[_0xf373('0x28')](respondWithResult(_0x33b9ad,null))[_0xf373('0x47')](handleError(_0x33b9ad,null));};exports[_0xf373('0x5f')]=function(_0x38635a,_0x46e5e2){var _0x2b5c39;return db[_0xf373('0x2f')]['find']({'where':{'id':_0x38635a[_0xf373('0x5b')]['id']},'attributes':['id',_0xf373('0x2c')]})[_0xf373('0x28')](handleEntityNotFound(_0x46e5e2,null))[_0xf373('0x28')](function(_0xd1fd17){if(_0xd1fd17){_0x2b5c39=_0xd1fd17;return db['UserProfileSection'][_0xf373('0x58')]({'where':{'userProfileId':_0x38635a[_0xf373('0x5b')]['id'],'sectionId':_0x38635a[_0xf373('0x34')]['ids']}});}})['then'](function(){return _0x2b5c39;})['then'](respondWithStatusCode(_0x46e5e2,null))[_0xf373('0x47')](handleError(_0x46e5e2,null));};exports[_0xf373('0x60')]=function(_0x4dbdb0,_0x3f8530){var _0x17bb01=[];var _0x147632=[];return db['UserProfileSection'][_0xf373('0x46')]({'where':{'userProfileId':_0x4dbdb0[_0xf373('0x5b')]['id']},'raw':!![]})['then'](function(_0x19b398){_0x17bb01=_[_0xf373('0x3f')](_0x19b398,function(_0x151da6){return _0x151da6['enabled']===0x1||_[_0xf373('0x61')]([0x3eb,0x709],_0x151da6[_0xf373('0x54')]);});if(!_['isEmpty'](_0x17bb01)){return _[_0xf373('0x2e')](_0x17bb01,function(_0x3feef6){return _0x3feef6['sectionId'];});}else{return;}})[_0xf373('0x28')](function(_0x13e1c2){if(_0x13e1c2)_0x147632=_0x13e1c2;if(_[_0xf373('0x61')](_0x147632,0x64)){var _0x4f271a=_[_0xf373('0x57')](_0x17bb01,{'sectionId':0x64});return hasDefaultDashboard(_0x4f271a)[_0xf373('0x28')](function(_0x18646a){return _[_0xf373('0x2e')](_0x17bb01,function(_0x314492){if(_0x314492[_0xf373('0x54')]===0x64){_0x314492[_0xf373('0x62')]=_0x18646a;}return _0x314492;});});}else{return;}})[_0xf373('0x28')](function(_0x52d12e){if(_0x52d12e)_0x17bb01=_0x52d12e;if(_[_0xf373('0x61')](_0x147632,0x3eb)){var _0xf7a9d8=_[_0xf373('0x57')](_0x17bb01,{'sectionId':0x3eb});return getCustomDashboards(_0xf7a9d8)[_0xf373('0x28')](function(_0x433482){return _[_0xf373('0x2e')](_0x17bb01,function(_0x29169e){if(_0xf7a9d8[_0xf373('0x63')]){if(_0x29169e[_0xf373('0x54')]===0x3eb){_0x29169e['subsections']=_0x433482;}}else{if(_0x29169e['sectionId']===0x64){_0x29169e['subsections']=_0x433482;}}return _0x29169e;});});}else{return;}})[_0xf373('0x28')](function(_0x441667){if(_0x441667)_0x17bb01=_0x441667;if(_[_0xf373('0x61')](_0x147632,0x709)){var _0x5e2100=_[_0xf373('0x57')](_0x17bb01,{'sectionId':0x709});return getPlugins(_0x5e2100)[_0xf373('0x28')](function(_0x231849){if(_0x5e2100['enabled']){return _[_0xf373('0x2e')](_0x17bb01,function(_0x4e09e2){if(_0x4e09e2[_0xf373('0x54')]===0x709){_0x4e09e2['subsections']=_0x231849;}return _0x4e09e2;});}else{var _0x501844={'sectionId':0x76c,'enabled':0x1,'subsections':_0x231849};var _0x283caf=_[_0xf373('0x2e')](_0x17bb01);_0x283caf['push'](_0x501844);return _0x283caf;}});}else{return;}})[_0xf373('0x28')](function(_0x309d17){if(_0x309d17)_0x17bb01=_0x309d17;return _[_0xf373('0x3f')](_0x17bb01,['enabled',0x1]);})[_0xf373('0x28')](respondWithResult(_0x3f8530,null))[_0xf373('0x47')](handleError(_0x3f8530,null));};function hasDefaultDashboard(_0x2b6af7){var _0x32e205=[0x65];return new BPromise(function(_0x435899,_0x295a6c){try{if(_0x2b6af7[_0xf373('0x52')]){_0x435899(_0x32e205);}else{return db[_0xf373('0x53')][_0xf373('0x64')]({'where':{'sectionId':_0x2b6af7['id']},'raw':!![]})[_0xf373('0x28')](function(_0x681570){_0x681570?_0x435899(_0x32e205):_0x435899();});}}catch(_0x394545){_0x295a6c(_0x394545);}});}function getCustomDashboards(_0x2cfe8e){var _0x5b0ef=[];return new BPromise(function(_0x27b7a6,_0x2a5a95){try{if(_0x2cfe8e[_0xf373('0x52')]){return db[_0xf373('0x65')][_0xf373('0x46')]({'raw':!![]})['then'](function(_0x3325aa){_0x3325aa[_0xf373('0x66')](function(_0x3103f3){_0x5b0ef['push'](_0x3103f3['id']+0x1869f);});_0x27b7a6(_0x5b0ef);});}else{return db[_0xf373('0x53')][_0xf373('0x46')]({'where':{'sectionId':_0x2cfe8e['id']},'raw':!![]})['then'](function(_0x44eef4){_0x44eef4[_0xf373('0x66')](function(_0x501d2e){_0x5b0ef[_0xf373('0x5d')](_0x501d2e[_0xf373('0x67')]+0x1869f);});_0x27b7a6(_0x5b0ef);});}}catch(_0x441ef3){_0x2a5a95(_0x441ef3);}});}function getPlugins(_0x208760){var _0x1b3cb9=[];return new BPromise(function(_0x2d37f0,_0x1735b0){try{if(_0x208760[_0xf373('0x52')]){return db['Plugin'][_0xf373('0x46')]({'raw':!![]})['then'](function(_0x4e5ba6){_0x4e5ba6[_0xf373('0x66')](function(_0x1e41a2){_0x1b3cb9['push'](_0x1e41a2['id']+0x15b38);});_0x2d37f0(_0x1b3cb9);});}else{return db[_0xf373('0x53')][_0xf373('0x46')]({'where':{'sectionId':_0x208760['id']},'raw':!![]})['then'](function(_0x97ff01){_0x97ff01[_0xf373('0x66')](function(_0x263f47){_0x1b3cb9[_0xf373('0x5d')](_0x263f47[_0xf373('0x67')]+0x15b38);});_0x2d37f0(_0x1b3cb9);});}}catch(_0x11b394){_0x1735b0(_0x11b394);}});}exports[_0xf373('0x68')]=function(_0xebdbcb,_0x15134a){return db[_0xf373('0x2f')][_0xf373('0x57')]({'where':{'id':_0xebdbcb[_0xf373('0x5b')]['id']}})[_0xf373('0x28')](handleEntityNotFound(_0x15134a,null))['then'](function(_0x4af7b4){if(_0x4af7b4){return db[_0xf373('0x4f')][_0xf373('0x50')](function(_0x170490){return db[_0xf373('0x51')][_0xf373('0x46')]({'where':{'userProfileId':_0xebdbcb[_0xf373('0x5b')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x1576b0){if(_0x1576b0){return db['UserProfileSection'][_0xf373('0x58')]({'where':{'userProfileId':_0xebdbcb['params']['id'],'id':_[_0xf373('0x2e')](_0x1576b0,function(_0x94a6ed){return _0x94a6ed['id'];})},'transaction':_0x170490});}})[_0xf373('0x28')](function(_0x1f3dc4){var _0x493f17=_['map'](_0xebdbcb[_0xf373('0x4b')],function(_0x18d246){_0x18d246[_0xf373('0x55')]=_0xebdbcb[_0xf373('0x5b')]['id'];return _0x18d246;});return db[_0xf373('0x51')][_0xf373('0x69')](_0x493f17,{'raw':!![],'transaction':_0x170490});})[_0xf373('0x28')](function(_0x990223){var _0x475a7b=_[_0xf373('0x3f')](_[_0xf373('0x2e')](_0x990223,function(_0x5a5845){return _0x5a5845[_0xf373('0x5e')]({'plain':!![]});}),{'includeAll':![]});if(_0x475a7b){return db[_0xf373('0x51')][_0xf373('0x46')]({'where':{'userProfileId':_0xebdbcb['params']['id'],'sectionId':_[_0xf373('0x2e')](_0x475a7b,function(_0x3c239e){return _0x3c239e[_0xf373('0x54')];})},'attributes':['id',_0xf373('0x54')],'raw':!![]})[_0xf373('0x28')](function(_0x2b6b2d){var _0x5dba4a=_[_0xf373('0x2e')](_0xebdbcb[_0xf373('0x4b')],function(_0x1e747b){_0x1e747b[_0xf373('0x55')]=_0xebdbcb[_0xf373('0x5b')]['id'];return _0x1e747b;});return db['UserProfileResource'][_0xf373('0x69')](_0x5dba4a,{'raw':!![],'transaction':_0x170490});});}})[_0xf373('0x47')](handleError(_0x15134a,null));});}})[_0xf373('0x28')](function(_0x12a22a){var _0x2d1d91=_['map'](_0x12a22a,function(_0x1c03f6){return _0x1c03f6[_0xf373('0x5e')]({'plain':!![]});});})[_0xf373('0x28')](respondWithResult(_0x15134a,null))['catch'](handleError(_0x15134a,null));};exports[_0xf373('0x6a')]=function(_0x265762,_0x2cf316,_0x404232){return db[_0xf373('0x2f')][_0xf373('0x57')]({'where':{'id':_0x265762[_0xf373('0x5b')]['id']}})[_0xf373('0x28')](handleEntityNotFound(_0x2cf316,null))['then'](function(_0x2d88b5){if(_0x2d88b5){return _0x2d88b5[_0xf373('0x6a')](_0x265762[_0xf373('0x34')][_0xf373('0x6b')]);}})['then'](respondWithStatusCode(_0x2cf316,null))['catch'](handleError(_0x2cf316,null));};exports[_0xf373('0x6c')]=function(_0x4c642f,_0x5182ff){var _0x1298c2={'raw':![],'where':{}};var _0x17c864={};var _0x22b26a={'count':0x0,'rows':[]};var _0x4b514d=_0x4c642f[_0xf373('0x34')][_0xf373('0x6d')];if(typeof _0x4b514d===_0xf373('0x6e')){throw new db[(_0xf373('0x6f'))]['ValidationError'](_0xf373('0x70'));}var _0x4fc8df=_0x4c642f[_0xf373('0x34')]['mergeResources']||![];var _0x5e73e6=getQueryModels(_0x4b514d,_0x4fc8df);if(typeof _0x5e73e6['childModel']===_0xf373('0x6e')){throw new db[(_0xf373('0x6f'))][(_0xf373('0x71'))](_0xf373('0x72')+_0x4b514d+'\x27');}var _0x36b0d6=[];if(!_[_0xf373('0x73')](_0x5e73e6['parentSections'])){_0x36b0d6=_0x5e73e6[_0xf373('0x74')];}else{_0x36b0d6=[{'name':_0x4b514d}];}return db[_0xf373('0x2f')][_0xf373('0x64')]({'where':{'id':_0x4c642f['params']['id']}})['then'](handleEntityNotFound(_0x5182ff,null))[_0xf373('0x28')](function(_0x8cbbbc){if(_0x8cbbbc){var _0x910eb4=[];for(var _0x43ad89=0x0;_0x43ad89<_0x36b0d6['length'];_0x43ad89++){_0x910eb4[_0xf373('0x5d')](db[_0xf373('0x51')]['findOne']({'where':{'userProfileId':_0x8cbbbc['id'],'name':_0x36b0d6[_0x43ad89][_0xf373('0x2c')]},'raw':!![]}));}return BPromise[_0xf373('0x75')](_0x910eb4);}})[_0xf373('0x28')](function(_0x6f6275){var _0x114c8d=_[_0xf373('0x3f')](_0x6f6275,function(_0x1d36c8){return _0x1d36c8?_0x1d36c8:undefined;});var _0x223e63=_[_0xf373('0x3f')](_0x36b0d6,[_0xf373('0x76'),!![]]);var _0xa9a265=_[_0xf373('0x73')](_0x114c8d)&&_['isEmpty'](_0x223e63)?null:_[_0xf373('0x77')](_0x223e63,_0x114c8d);if(_0xa9a265){var _0x2d3203=[];for(var _0x27f825=0x0;_0x27f825<_0xa9a265['length'];_0x27f825++){var _0x56c318=_['find'](_0x36b0d6,function(_0xae4462){return _0xa9a265[_0x27f825]?_0xae4462[_0xf373('0x2c')]===_0xa9a265[_0x27f825][_0xf373('0x2c')]:null;});if(_0x56c318){if(_0xa9a265[_0x27f825][_0xf373('0x76')]){_0x2d3203['push'](getAllResources(_0x5e73e6[_0xf373('0x78')],_0xa9a265[_0x27f825]));}else{if(!_0xa9a265[_0x27f825][_0xf373('0x52')]){_0x2d3203['push'](getAllowedResources(_0x56c318,_0xa9a265[_0x27f825],_0x5e73e6[_0xf373('0x78')]));}else{if(_0x56c318[_0xf373('0x33')]){_0x2d3203[_0xf373('0x5d')](getAllFilteredResources(_0x56c318,_0xa9a265[_0x27f825]));}}}}}return BPromise[_0xf373('0x75')](_0x2d3203);}else{return null;}})[_0xf373('0x28')](function(_0x53fd7a){var _0x40679c=_0x53fd7a;var _0x3af0f6=null;if(_0x40679c){_0x3af0f6=_0x40679c[_0xf373('0x48')]===0x1?_0x40679c[0x0]:null;}if(_0x3af0f6||_0x40679c){var _0x261089=db[_0x5e73e6[_0xf373('0x78')]][_0xf373('0x30')];_0x17c864[_0xf373('0x33')]=_[_0xf373('0x35')](_0x261089);_0x17c864[_0xf373('0x34')]=_['keys'](_0x4c642f[_0xf373('0x34')]);_0x17c864[_0xf373('0x3d')]=_[_0xf373('0x36')](_0x17c864[_0xf373('0x33')],_0x17c864[_0xf373('0x34')]);_0x1298c2['attributes']=_[_0xf373('0x36')](_0x17c864[_0xf373('0x33')],qs[_0xf373('0x38')](_0x4c642f['query'][_0xf373('0x38')]));_0x1298c2['attributes']=_0x1298c2[_0xf373('0x37')][_0xf373('0x48')]?_0x1298c2[_0xf373('0x37')]:_0x17c864[_0xf373('0x33')];if(!_0x4c642f[_0xf373('0x34')]['hasOwnProperty']('nolimit')){_0x1298c2[_0xf373('0x22')]=qs['limit'](_0x4c642f[_0xf373('0x34')][_0xf373('0x22')]);_0x1298c2['offset']=qs[_0xf373('0x21')](_0x4c642f[_0xf373('0x34')][_0xf373('0x21')]);}_0x1298c2['order']=qs[_0xf373('0x3b')](_0x4c642f['query'][_0xf373('0x3b')]);_0x1298c2[_0xf373('0x3c')]=qs['filters'](_[_0xf373('0x3e')](_0x4c642f[_0xf373('0x34')],_0x17c864[_0xf373('0x3d')]));if(_0x4c642f[_0xf373('0x34')][_0xf373('0x3f')]){_0x1298c2[_0xf373('0x3c')]=_['merge'](_0x1298c2[_0xf373('0x3c')],{'$or':_[_0xf373('0x2e')](_0x261089,function(_0xde0c98){if(_0xde0c98[_0xf373('0x41')][_0xf373('0x32')]!=='VIRTUAL'){var _0x519b7c={};_0x519b7c[_0xde0c98[_0xf373('0x79')]]={'$like':'%'+_0x4c642f[_0xf373('0x34')][_0xf373('0x3f')]+'%'};return _0x519b7c;}})});}var _0x31e4a9=[];if(_0x3af0f6){var _0x3a1c6b=_[_0xf373('0x57')](_0x36b0d6,[_0xf373('0x2c'),_0x3af0f6[_0xf373('0x2c')]]);if(_0x3a1c6b['field']){var _0x1ece5b={};if(_0x5e73e6[_0xf373('0x78')]===_0xf373('0x7a')){_0x1ece5b[_0x3a1c6b[_0xf373('0x7b')]]=_['map'](_0x3af0f6[_0xf373('0x7c')],'id');}else{_0x1ece5b[_0x3a1c6b['foreignKey']]=_0x3af0f6[_0xf373('0x7c')];}_0x31e4a9['push'](_0x1ece5b);}else{_0x1298c2[_0xf373('0x3c')]['id']=_0x3af0f6[_0xf373('0x7c')];}}else{for(var _0x53f492=0x0;_0x53f492<_0x40679c[_0xf373('0x48')];_0x53f492++){var _0x3a1c6b=_['find'](_0x36b0d6,['name',_0x40679c[_0x53f492][_0xf373('0x2c')]]);if(_0x3a1c6b[_0xf373('0x79')]){var _0x1ece5b={};_0x1ece5b[_0x3a1c6b[_0xf373('0x7b')]]=_0x40679c[_0x53f492][_0xf373('0x7c')];_0x31e4a9['push'](_0x1ece5b);}else{if(!_0x1298c2[_0xf373('0x3c')]['id'])_0x1298c2['where']['id']=[];_0x40679c[_0x53f492][_0xf373('0x7c')][_0xf373('0x66')](function(_0x1b195d){_0x1298c2['where']['id'][_0xf373('0x5d')](_0x1b195d);});}}}if(!_['isEmpty'](_0x31e4a9)){_0x1298c2['where']=_[_0xf373('0x40')](_0x1298c2[_0xf373('0x3c')],{'$and':{'$or':_0x31e4a9}});}_0x1298c2=_[_0xf373('0x40')]({},_0x1298c2,_0x4c642f[_0xf373('0x49')]);if(_0x3af0f6&&!_0x3af0f6[_0xf373('0x52')]&&_0x5e73e6[_0xf373('0x78')]===_0xf373('0x7a')){if(_0x4c642f['query']['includeAll']){_0x1298c2[_0xf373('0x45')]=[{'all':!![]}];}return db[_0x5e73e6[_0xf373('0x78')]][_0xf373('0x46')](_0x1298c2)['then'](function(_0xbea445){var _0x42fdb2=[];_0xbea445['forEach'](function(_0xab7a7d){var _0x56ff26;switch(_0xab7a7d[_0xf373('0x7d')]){case _0xf373('0x7e'):_0x56ff26=_[_0xf373('0x57')](_0x3af0f6[_0xf373('0x7c')],function(_0x5b8f95){return _0x5b8f95['id']===_0xab7a7d['reportId']&&_0x5b8f95['type']===_0xf373('0x7f');});break;case'custom':_0x56ff26=_[_0xf373('0x57')](_0x3af0f6[_0xf373('0x7c')],function(_0x566c19){return _0x566c19['id']===_0xab7a7d[_0xf373('0x80')]&&_0x566c19[_0xf373('0x41')]===_0xf373('0x81');});break;}if(_0x56ff26)_0x42fdb2[_0xf373('0x5d')](_0xab7a7d);});_0x22b26a['count']=_0x42fdb2[_0xf373('0x48')];_0x22b26a['rows']=_0x42fdb2;return _0x22b26a;});}else{return db[_0x5e73e6[_0xf373('0x78')]][_0xf373('0x43')]({'where':_0x1298c2[_0xf373('0x3c')]})['then'](function(_0x30f99c){_0x22b26a[_0xf373('0x43')]=_0x30f99c;if(_0x4c642f[_0xf373('0x34')][_0xf373('0x44')]){if(_0x5e73e6[_0xf373('0x78')]===_0xf373('0x82')){_0x1298c2[_0xf373('0x45')]=[{'model':db[_0xf373('0x83')],'as':_0xf373('0x84'),'attributes':['id',_0xf373('0x2c'),'color'],'required':_0x4c642f[_0xf373('0x34')]['tag']?!![]:![]},{'model':db[_0xf373('0x83')],'as':_0xf373('0x85'),'attributes':['id','name',_0xf373('0x86')],'through':_0x4c642f[_0xf373('0x34')]['tag']?{'attributes':[],'where':{'TagId':_0x4c642f[_0xf373('0x34')][_0xf373('0x87')]||undefined}}:{},'required':_0x4c642f[_0xf373('0x34')][_0xf373('0x87')]?!![]:![]}];}else{_0x1298c2[_0xf373('0x45')]=[{'all':!![]}];}}return db[_0x5e73e6[_0xf373('0x78')]][_0xf373('0x46')](_0x1298c2);})[_0xf373('0x28')](function(_0x2ca92b){_0x22b26a[_0xf373('0x88')]=_0x2ca92b;return _0x22b26a;});}}else{return _0x22b26a;}})[_0xf373('0x28')](respondWithFilteredResult(_0x5182ff,_0x1298c2))['catch'](handleError(_0x5182ff,null));};function getAllResources(_0x18657b,_0x317f90){return new BPromise(function(_0x5c3921,_0x34d15d){if(_0x317f90){var _0x5bb532=_0x317f90['filter']?{[_0x317f90[_0xf373('0x3f')][_0xf373('0x79')]]:_0x317f90[_0xf373('0x3f')]['value']}:undefined;return db[_0x18657b][_0xf373('0x46')]({'where':_0x5bb532,'raw':!![]})[_0xf373('0x28')](function(_0x37b599){_0x317f90[_0xf373('0x7c')]=_[_0xf373('0x2e')](_0x37b599,'id');_0x5c3921(_0x317f90);})[_0xf373('0x47')](function(_0x39f7a4){_0x34d15d(_0x39f7a4);});}else{_0x5c3921(null);}});}function getAllFilteredResources(_0x26a953,_0x41b717){return new BPromise(function(_0x7c7568,_0x36097c){var _0x1e9271=_0x26a953[_0xf373('0x3f')]?{[_0x26a953[_0xf373('0x3f')][_0xf373('0x79')]]:_0x26a953[_0xf373('0x3f')][_0xf373('0x89')]}:undefined;return db[_0x26a953['model']][_0xf373('0x46')]({'where':_0x1e9271,'raw':!![]})[_0xf373('0x28')](function(_0x591a89){_0x41b717[_0xf373('0x7c')]=_[_0xf373('0x2e')](_0x591a89,function(_0x22a53c){return _0x22a53c[_0xf373('0x2c')];});_0x7c7568(_0x41b717);})[_0xf373('0x47')](function(_0x4d06b5){_0x36097c(_0x4d06b5);});});}function getAllowedResources(_0x3a6c05,_0x1f314e,_0x32b17b){return new BPromise(function(_0xa6259,_0xe103b1){if(_0x1f314e){return db['UserProfileResource'][_0xf373('0x46')]({'where':{'sectionId':_0x1f314e['id']},'raw':!![]})[_0xf373('0x28')](function(_0x164e52){if(_0x3a6c05[_0xf373('0x79')]&&_0x3a6c05['field']!=='id'){_0x1f314e[_0xf373('0x7c')]=_[_0xf373('0x2e')](_0x164e52,function(_0x248736){return _0x248736[_0x3a6c05[_0xf373('0x79')]];});}else{if(_0x32b17b==='AnalyticExtractedReport'){_0x1f314e[_0xf373('0x7c')]=_['map'](_0x164e52,function(_0x2230b3){return{'id':_0x2230b3[_0xf373('0x67')],'type':_0x2230b3[_0xf373('0x41')]};});}else{_0x1f314e[_0xf373('0x7c')]=_[_0xf373('0x2e')](_0x164e52,function(_0x51792c){return _0x51792c['resourceId'];});}}_0xa6259(_0x1f314e);})[_0xf373('0x47')](function(_0x105b3e){_0xe103b1(_0x105b3e);});}else{_0xa6259(null);}});}function getQueryModels(_0x344ea4,_0x4f164b){var _0x58b721=_0x344ea4[_0xf373('0x8a')]();var _0x13303d={'childModel':undefined,'parentSections':[]};switch(_0x58b721){case _0xf373('0x8b'):_0x13303d[_0xf373('0x78')]='SquareProject';break;case _0xf373('0x8c'):_0x13303d[_0xf373('0x78')]=_0xf373('0x8d');break;case _0xf373('0x8e'):_0x13303d[_0xf373('0x78')]=_0xf373('0x8f');_0x13303d[_0xf373('0x74')]=[{'name':_0xf373('0x90'),'field':_0xf373('0x2c'),'foreignKey':'projectName'}];break;case _0xf373('0x91'):_0x13303d['childModel']='JscriptyProject';break;case _0xf373('0x92'):_0x13303d[_0xf373('0x78')]=_0xf373('0x82');_0x13303d[_0xf373('0x74')]=[{'name':'Lists','field':'id','foreignKey':_0xf373('0x93')}];break;case _0xf373('0x94'):_0x13303d[_0xf373('0x78')]=_0xf373('0x95');break;case _0xf373('0x96'):_0x13303d[_0xf373('0x78')]=_0xf373('0x97');break;case _0xf373('0x98'):_0x13303d[_0xf373('0x78')]=_0xf373('0x99');break;case _0xf373('0x9a'):_0x13303d[_0xf373('0x78')]=_0xf373('0x9b');break;case _0xf373('0x9c'):_0x13303d[_0xf373('0x78')]=_0xf373('0x9d');break;case _0xf373('0x9e'):_0x13303d[_0xf373('0x78')]=_0xf373('0x9f');break;case'faxaccounts':_0x13303d['childModel']=_0xf373('0xa0');break;case _0xf373('0xa1'):case _0xf373('0xa2'):case'outboundroutes':_0x13303d[_0xf373('0x78')]=_0xf373('0xa3');break;case _0xf373('0xa4'):_0x13303d[_0xf373('0x78')]=_0xf373('0xa5');break;case _0xf373('0xa6'):_0x13303d[_0xf373('0x78')]=_0xf373('0xa7');break;case _0xf373('0xa8'):_0x13303d[_0xf373('0x78')]=_0xf373('0xa9');_0x13303d[_0xf373('0x74')]=[{'name':_0xf373('0xaa'),'field':_0xf373('0x2c'),'foreignKey':_0xf373('0xab'),'model':'User','filter':{'field':_0xf373('0xac'),'value':[_0xf373('0xad')]}},{'name':_0xf373('0xae'),'field':_0xf373('0x2c'),'foreignKey':_0xf373('0xab'),'model':_0xf373('0xaf'),'filter':{'field':_0xf373('0xac'),'value':['telephone']}},{'name':_0xf373('0xb0'),'field':_0xf373('0x2c'),'foreignKey':'queue','model':_0xf373('0xb1'),'filter':{'field':'type','value':['inbound']}},{'name':_0xf373('0xb2'),'field':'name','foreignKey':_0xf373('0xb3'),'model':_0xf373('0xb1'),'filter':{'field':_0xf373('0x41'),'value':[_0xf373('0xb4')]}}];break;case'musiconholds':_0x13303d[_0xf373('0x78')]=_0xf373('0xb5');break;case _0xf373('0xb6'):_0x13303d[_0xf373('0x78')]='VoiceChanSpy';break;case _0xf373('0xb7'):_0x13303d[_0xf373('0x78')]=_0xf373('0xb8');break;case _0xf373('0xb9'):_0x13303d[_0xf373('0x78')]=_0xf373('0xba');break;case _0xf373('0xbb'):_0x13303d['childModel']=_0xf373('0xbc');break;case'mailaccounts':_0x13303d['childModel']='MailAccount';break;case _0xf373('0xbd'):_0x13303d[_0xf373('0x78')]=_0xf373('0xbe');break;case _0xf373('0xbf'):_0x13303d['childModel']='OpenchannelQueue';break;case _0xf373('0xc0'):_0x13303d[_0xf373('0x78')]=_0xf373('0xc1');break;case _0xf373('0xc2'):_0x13303d[_0xf373('0x78')]=_0xf373('0xc3');break;case _0xf373('0xc4'):_0x13303d[_0xf373('0x78')]=_0xf373('0xc5');break;case _0xf373('0xc6'):_0x13303d[_0xf373('0x78')]=_0xf373('0xc7');break;case'whatsappaccounts':_0x13303d[_0xf373('0x78')]=_0xf373('0xc8');break;case'teams':_0x13303d[_0xf373('0x78')]=_0xf373('0xc9');break;case _0xf373('0xca'):case'queuecampaigns':_0x13303d[_0xf373('0x78')]=_0xf373('0xb1');if(_0x4f164b){_0x13303d[_0xf373('0x74')]=[{'name':_0xf373('0xb0')},{'name':'QueueCampaigns'}];}break;case _0xf373('0xcb'):case'agents':case'telephones':_0x13303d[_0xf373('0x78')]=_0xf373('0xaf');if(_0x4f164b){_0x13303d[_0xf373('0x74')]=[{'name':_0xf373('0xcc'),'filter':{'field':_0xf373('0xac'),'value':[_0xf373('0xcd'),_0xf373('0xce')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x13303d[_0xf373('0x78')]='ZendeskAccount';break;case _0xf373('0xcf'):_0x13303d[_0xf373('0x78')]=_0xf373('0xd0');break;case _0xf373('0xd1'):_0x13303d['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x13303d['childModel']=_0xf373('0xd2');break;case _0xf373('0xd3'):_0x13303d[_0xf373('0x78')]=_0xf373('0xd4');break;case _0xf373('0xd5'):_0x13303d[_0xf373('0x78')]=_0xf373('0xd6');break;case'vtigeraccounts':_0x13303d['childModel']='User';break;case'cannedanswers':_0x13303d[_0xf373('0x78')]=_0xf373('0xd7');break;case _0xf373('0xd8'):_0x13303d['childModel']=_0xf373('0xd9');break;case _0xf373('0xda'):_0x13303d[_0xf373('0x78')]=_0xf373('0x65');break;case _0xf373('0xdb'):_0x13303d[_0xf373('0x78')]=_0xf373('0xdc');break;case _0xf373('0xdd'):_0x13303d['childModel']='Pause';break;case _0xf373('0xde'):_0x13303d[_0xf373('0x78')]=_0xf373('0xdf');break;case _0xf373('0xe0'):_0x13303d[_0xf373('0x78')]=_0xf373('0xe1');break;case _0xf373('0xe2'):_0x13303d[_0xf373('0x78')]='Tag';break;case _0xf373('0xe3'):_0x13303d[_0xf373('0x78')]=_0xf373('0xe4');break;case _0xf373('0xe5'):_0x13303d['childModel']=_0xf373('0xe6');break;case _0xf373('0xe7'):_0x13303d['childModel']=_0xf373('0xe8');break;case _0xf373('0xe9'):_0x13303d[_0xf373('0x78')]=_0xf373('0xea');break;case _0xf373('0xeb'):_0x13303d[_0xf373('0x78')]=_0xf373('0xec');break;case'extractedreports':_0x13303d[_0xf373('0x78')]='AnalyticExtractedReport';_0x13303d[_0xf373('0x74')]=[{'name':_0xf373('0xed'),'field':'id','foreignKey':_0xf373('0x80')}];break;case _0xf373('0xee'):_0x13303d['childModel']=_0xf373('0xef');break;case _0xf373('0xf0'):_0x13303d[_0xf373('0x78')]='WhatsappAccount';break;default:return _0x13303d;}return _0x13303d;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 728666d..8f231b7 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 _0xec06=['UserProfile','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x435a6e,_0x2814d1){var _0x5bd249=function(_0x3a195a){while(--_0x3a195a){_0x435a6e['push'](_0x435a6e['shift']());}};_0x5bd249(++_0x2814d1);}(_0xec06,0x104));var _0x6ec0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xec06[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x6ec0('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x6ec0('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ec0('0x2'),'afterUpdate':_0x6ec0('0x3'),'afterDestroy':_0x6ec0('0x4')};function emitEvent(_0x5654f0){return function(_0x4a1230,_0x454556,_0x17cd2c){UserProfileEvents[_0x6ec0('0x5')](_0x5654f0+':'+_0x4a1230['id'],_0x4a1230);UserProfileEvents[_0x6ec0('0x5')](_0x5654f0,_0x4a1230);_0x17cd2c(null);};}for(var e in events){if(events[_0x6ec0('0x6')](e)){var event=events[e];UserProfile[_0x6ec0('0x7')](e,emitEvent(event));}}module[_0x6ec0('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x9383=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','hasOwnProperty'];(function(_0x1fc3b6,_0x4efd2){var _0xa0f9f6=function(_0x3c9960){while(--_0x3c9960){_0x1fc3b6['push'](_0x1fc3b6['shift']());}};_0xa0f9f6(++_0x4efd2);}(_0x9383,0xec));var _0x3938=function(_0x5a7cc6,_0x12f72e){_0x5a7cc6=_0x5a7cc6-0x0;var _0x5b805b=_0x9383[_0x5a7cc6];return _0x5b805b;};'use strict';var EventEmitter=require(_0x3938('0x0'));var UserProfile=require(_0x3938('0x1'))['db'][_0x3938('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3938('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3938('0x4'),'afterDestroy':_0x3938('0x5')};function emitEvent(_0x284873){return function(_0x56968a,_0x298501,_0x374e88){UserProfileEvents['emit'](_0x284873+':'+_0x56968a['id'],_0x56968a);UserProfileEvents['emit'](_0x284873,_0x56968a);_0x374e88(null);};}for(var e in events){if(events[_0x3938('0x6')](e)){var event=events[e];UserProfile[_0x3938('0x7')](e,emitEvent(event));}}module[_0x3938('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index a6eb5b8..8219993 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 _0x031b=['user_profiles','util','path','rimraf','./userProfile.attributes','exports','define'];(function(_0x12ed40,_0x152286){var _0x2bd024=function(_0x12680a){while(--_0x12680a){_0x12ed40['push'](_0x12ed40['shift']());}};_0x2bd024(++_0x152286);}(_0x031b,0x151));var _0xb031=function(_0x5c124e,_0x4540ef){_0x5c124e=_0x5c124e-0x0;var _0x38079d=_0x031b[_0x5c124e];return _0x38079d;};'use strict';var _=require('lodash');var util=require(_0xb031('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(_0xb031('0x1'));var rimraf=require(_0xb031('0x2'));var config=require('../../config/environment');var attributes=require(_0xb031('0x3'));module[_0xb031('0x4')]=function(_0xb2782e,_0x49fe4b){return _0xb2782e[_0xb031('0x5')]('UserProfile',attributes,{'tableName':_0xb031('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c74=['define','UserProfile','user_profiles','lodash','util','api','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0x9c74,0xe7));var _0x49c7=function(_0x11a846,_0x2c29cb){_0x11a846=_0x11a846-0x0;var _0x2b8c28=_0x9c74[_0x11a846];return _0x2b8c28;};'use strict';var _=require(_0x49c7('0x0'));var util=require(_0x49c7('0x1'));var logger=require('../../config/logger')(_0x49c7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49c7('0x3'));var fs=require('fs');var path=require(_0x49c7('0x4'));var rimraf=require(_0x49c7('0x5'));var config=require(_0x49c7('0x6'));var attributes=require(_0x49c7('0x7'));module[_0x49c7('0x8')]=function(_0x4429f8,_0xb349f5){return _0x4429f8[_0x49c7('0x9')](_0x49c7('0xa'),attributes,{'tableName':_0x49c7('0xb'),'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 6d76de2..34ec0de 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 _0x6aa7=['client','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x48bda2,_0x3acde3){var _0x5ae22e=function(_0x3d14aa){while(--_0x3d14aa){_0x48bda2['push'](_0x48bda2['shift']());}};_0x5ae22e(++_0x3acde3);}(_0x6aa7,0x178));var _0x76aa=function(_0x5e6547,_0xd517cb){_0x5e6547=_0x5e6547-0x0;var _0x2ddb39=_0x6aa7[_0x5e6547];return _0x2ddb39;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});} \ No newline at end of file +var _0xdc97=['redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserProfile,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x54b83b,_0x50919b){var _0x4e4405=function(_0x2f420f){while(--_0x2f420f){_0x54b83b['push'](_0x54b83b['shift']());}};_0x4e4405(++_0x50919b);}(_0xdc97,0x13b));var _0x7dc9=function(_0xb0aecb,_0x4ee98f){_0xb0aecb=_0xb0aecb-0x0;var _0xb8f0f2=_0xdc97[_0xb0aecb];return _0xb8f0f2;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});config[_0x7dc9('0xa')]=_['defaults'](config['redis'],{'host':_0x7dc9('0xb'),'port':0x18eb});var socket=require(_0x7dc9('0xc'))(new Redis(config[_0x7dc9('0xa')]));require(_0x7dc9('0xd'))[_0x7dc9('0xe')](socket);function respondWithRpcPromise(_0x5ca05b,_0xb2fa2a,_0x44fe24){return new BPromise(function(_0x37dfc,_0x1dc3f7){return client[_0x7dc9('0xf')](_0x5ca05b,_0x44fe24)[_0x7dc9('0x10')](function(_0x1e336a){logger['info']('UserProfile,\x20%s,\x20%s',_0xb2fa2a,'request\x20sent');logger['debug'](_0x7dc9('0x11'),_0xb2fa2a,_0x7dc9('0x12'),JSON['stringify'](_0x1e336a));if(_0x1e336a[_0x7dc9('0x13')]){if(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x14')]===0x1f4){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')]['message']);return _0x1dc3f7(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);return _0x37dfc(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}else{logger[_0x7dc9('0x17')]('UserProfile,\x20%s,\x20%s',_0xb2fa2a,_0x7dc9('0x12'));_0x37dfc(_0x1e336a['result'][_0x7dc9('0x16')]);}})[_0x7dc9('0x18')](function(_0x5d61d7){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x5d61d7);_0x1dc3f7(_0x5d61d7);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 72a3c87..0b00ada 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 _0xeaeb=['removeListener','register','length','userProfile:','./userProfile.events','save','update'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xeaeb,0xcf));var _0xbeae=function(_0xe8b420,_0x1a892d){_0xe8b420=_0xe8b420-0x0;var _0x50f7b7=_0xeaeb[_0xe8b420];return _0x50f7b7;};'use strict';var UserProfileEvents=require(_0xbeae('0x0'));var events=[_0xbeae('0x1'),'remove',_0xbeae('0x2')];function createListener(_0x1e10a5,_0x277d58){return function(_0x24060a){_0x277d58['emit'](_0x1e10a5,_0x24060a);};}function removeListener(_0x1ba962,_0x1535e0){return function(){UserProfileEvents[_0xbeae('0x3')](_0x1ba962,_0x1535e0);};}exports[_0xbeae('0x4')]=function(_0x237835){for(var _0x4f2a84=0x0,_0x3d5f46=events[_0xbeae('0x5')];_0x4f2a84<_0x3d5f46;_0x4f2a84++){var _0x1b3d9e=events[_0x4f2a84];var _0x34ca57=createListener(_0xbeae('0x6')+_0x1b3d9e,_0x237835);UserProfileEvents['on'](_0x1b3d9e,_0x34ca57);}}; \ No newline at end of file +var _0x9be1=['register','userProfile:','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x2a02f8,_0x69bc26){var _0x266beb=function(_0x4f3fb5){while(--_0x4f3fb5){_0x2a02f8['push'](_0x2a02f8['shift']());}};_0x266beb(++_0x69bc26);}(_0x9be1,0x1c2));var _0x19be=function(_0x38faa4,_0x4d90a2){_0x38faa4=_0x38faa4-0x0;var _0x652493=_0x9be1[_0x38faa4];return _0x652493;};'use strict';var UserProfileEvents=require(_0x19be('0x0'));var events=[_0x19be('0x1'),_0x19be('0x2'),_0x19be('0x3')];function createListener(_0x309b81,_0x14e644){return function(_0x44da91){_0x14e644[_0x19be('0x4')](_0x309b81,_0x44da91);};}function removeListener(_0x51067b,_0x7b876e){return function(){UserProfileEvents[_0x19be('0x5')](_0x51067b,_0x7b876e);};}exports[_0x19be('0x6')]=function(_0x417659){for(var _0x3640bd=0x0,_0x22cc48=events['length'];_0x3640bd<_0x22cc48;_0x3640bd++){var _0x54b45c=events[_0x3640bd];var _0x304168=createListener(_0x19be('0x7')+_0x54b45c,_0x417659);UserProfileEvents['on'](_0x54b45c,_0x304168);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f9b5bd8..ad13aa6 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 _0xc171=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post','put','update','delete','path','connect-timeout','express','Router'];(function(_0x55b9d1,_0x33354b){var _0x306008=function(_0x3ca843){while(--_0x3ca843){_0x55b9d1['push'](_0x55b9d1['shift']());}};_0x306008(++_0x33354b);}(_0xc171,0x6c));var _0x1c17=function(_0x133f69,_0x2d4632){_0x133f69=_0x133f69-0x0;var _0x3b67bb=_0xc171[_0x133f69];return _0x3b67bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c17('0x0'));var timeout=require(_0x1c17('0x1'));var express=require(_0x1c17('0x2'));var router=express[_0x1c17('0x3')]();var auth=require(_0x1c17('0x4'));var interaction=require(_0x1c17('0x5'));var config=require(_0x1c17('0x6'));var controller=require('./userProfileResource.controller');router[_0x1c17('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1c17('0x7')](_0x1c17('0x8'),auth[_0x1c17('0x9')](),controller[_0x1c17('0xa')]);router[_0x1c17('0x7')](_0x1c17('0xb'),auth[_0x1c17('0x9')](),controller['show']);router[_0x1c17('0xc')]('/',auth[_0x1c17('0x9')](),controller['create']);router[_0x1c17('0xd')](_0x1c17('0xb'),auth[_0x1c17('0x9')](),controller[_0x1c17('0xe')]);router[_0x1c17('0xf')]('/:id',auth[_0x1c17('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x578c=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0x578c,0x1e8));var _0xc578=function(_0x209a80,_0x3df498){_0x209a80=_0x209a80-0x0;var _0x453a9d=_0x578c[_0x209a80];return _0x453a9d;};'use strict';var multer=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var path=require(_0xc578('0x2'));var timeout=require(_0xc578('0x3'));var express=require(_0xc578('0x4'));var router=express[_0xc578('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc578('0x6'));var config=require(_0xc578('0x7'));var controller=require(_0xc578('0x8'));router[_0xc578('0x9')]('/',auth[_0xc578('0xa')](),controller[_0xc578('0xb')]);router['get'](_0xc578('0xc'),auth[_0xc578('0xa')](),controller[_0xc578('0xd')]);router[_0xc578('0x9')]('/:id',auth[_0xc578('0xa')](),controller[_0xc578('0xe')]);router[_0xc578('0xf')]('/',auth[_0xc578('0xa')](),controller[_0xc578('0x10')]);router[_0xc578('0x11')](_0xc578('0x12'),auth['isAuthenticated'](),controller[_0xc578('0x13')]);router[_0xc578('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc578('0x15')]);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 3cbcc4f..99c0ed3 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 _0x9772=['sequelize','exports','STRING'];(function(_0x442065,_0x561c4d){var _0x30a95a=function(_0x501d1c){while(--_0x501d1c){_0x442065['push'](_0x442065['shift']());}};_0x30a95a(++_0x561c4d);}(_0x9772,0x1da));var _0x2977=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x9772[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x2977('0x0'));module[_0x2977('0x1')]={'name':{'type':Sequelize[_0x2977('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2977('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x876d=['STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x876d,0x1e8));var _0xd876=function(_0x58b01d,_0x5a2303){_0x58b01d=_0x58b01d-0x0;var _0x572cc2=_0x876d[_0x58b01d];return _0x572cc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd876('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xd876('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index a0dd50a..3d3c562 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 _0xae24=['then','error','stack','name','send','map','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','options','UserProfileResource','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy'];(function(_0x5c7997,_0x5381dd){var _0x22ab38=function(_0x3d496f){while(--_0x3d496f){_0x5c7997['push'](_0x5c7997['shift']());}};_0x22ab38(++_0x5381dd);}(_0xae24,0x182));var _0x4ae2=function(_0x4fca4b,_0x4f78b1){_0x4fca4b=_0x4fca4b-0x0;var _0x2a6cef=_0xae24[_0x4fca4b];return _0x2a6cef;};'use strict';var pdf=require(_0x4ae2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4ae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ae2('0x2'));var rp=require(_0x4ae2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ae2('0x4'));var util=require('util');var path=require(_0x4ae2('0x5'));var sox=require(_0x4ae2('0x6'));var csv=require(_0x4ae2('0x7'));var ejs=require(_0x4ae2('0x8'));var fs=require('fs');var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var as=require(_0x4ae2('0xf'));var hardwareService=require(_0x4ae2('0x10'));var logger=require(_0x4ae2('0x11'))('api');var utils=require(_0x4ae2('0x12'));var config=require(_0x4ae2('0x13'));var db=require(_0x4ae2('0x14'))['db'];function respondWithStatusCode(_0x4d7dc3,_0x25d2b4){_0x25d2b4=_0x25d2b4||0xcc;return function(_0x22ac1e){if(_0x22ac1e){return _0x4d7dc3[_0x4ae2('0x15')](_0x25d2b4);}return _0x4d7dc3[_0x4ae2('0x16')](_0x25d2b4)[_0x4ae2('0x17')]();};}function respondWithResult(_0x40954f,_0x145287){_0x145287=_0x145287||0xc8;return function(_0x3cabc9){if(_0x3cabc9){return _0x40954f[_0x4ae2('0x16')](_0x145287)['json'](_0x3cabc9);}};}function respondWithFilteredResult(_0x4ec027,_0x4d5cab){return function(_0x2f3936){if(_0x2f3936){var _0xf834a1=_0x2f3936[_0x4ae2('0x18')],_0x5f447a=_0x4d5cab[_0x4ae2('0x19')],_0x463765=_0x4d5cab[_0x4ae2('0x19')]+_0x4d5cab[_0x4ae2('0x1a')],_0x9fb8db;if(_0x463765>=_0xf834a1){_0x463765=_0xf834a1;_0x9fb8db=0xc8;}else{_0x9fb8db=0xce;}_0x4ec027[_0x4ae2('0x16')](_0x9fb8db);return _0x4ec027[_0x4ae2('0x1b')](_0x4ae2('0x1c'),_0x5f447a+'-'+_0x463765+'/'+_0xf834a1)[_0x4ae2('0x1d')](_0x2f3936);}return null;};}function patchUpdates(_0x4d5071){return function(_0x4a97af){try{jsonpatch[_0x4ae2('0x1e')](_0x4a97af,_0x4d5071,!![]);}catch(_0x2d910c){return BPromise['reject'](_0x2d910c);}return _0x4a97af[_0x4ae2('0x1f')]();};}function saveUpdates(_0x343db1,_0xccb3b){return function(_0x2ad222){if(_0x2ad222){return _0x2ad222[_0x4ae2('0x20')](_0x343db1)['then'](function(_0x2bf5fe){return _0x2bf5fe;});}return null;};}function removeEntity(_0x53c686,_0x522165){return function(_0x2ceec4){if(_0x2ceec4){return _0x2ceec4[_0x4ae2('0x21')]()[_0x4ae2('0x22')](function(){_0x53c686[_0x4ae2('0x16')](0xcc)[_0x4ae2('0x17')]();});}};}function handleEntityNotFound(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(!_0x4a0ddb){_0x526768[_0x4ae2('0x15')](0x194);}return _0x4a0ddb;};}function handleError(_0x12b5d2,_0x130239){_0x130239=_0x130239||0x1f4;return function(_0x57933b){logger[_0x4ae2('0x23')](_0x57933b[_0x4ae2('0x24')]);if(_0x57933b[_0x4ae2('0x25')]){delete _0x57933b[_0x4ae2('0x25')];}_0x12b5d2[_0x4ae2('0x16')](_0x130239)[_0x4ae2('0x26')](_0x57933b);};}exports['index']=function(_0x5962b0,_0x9508d7){var _0x3030f8={},_0x3fa514={},_0x329588={'count':0x0,'rows':[]};var _0x3a9b96=_[_0x4ae2('0x27')](db['UserProfileResource']['rawAttributes'],function(_0x3e2666){return{'name':_0x3e2666['fieldName'],'type':_0x3e2666['type']['key']};});_0x3fa514[_0x4ae2('0x28')]=_[_0x4ae2('0x27')](_0x3a9b96,'name');_0x3fa514[_0x4ae2('0x29')]=_[_0x4ae2('0x2a')](_0x5962b0[_0x4ae2('0x29')]);_0x3fa514[_0x4ae2('0x2b')]=_[_0x4ae2('0x2c')](_0x3fa514[_0x4ae2('0x28')],_0x3fa514[_0x4ae2('0x29')]);_0x3030f8[_0x4ae2('0x2d')]=_[_0x4ae2('0x2c')](_0x3fa514[_0x4ae2('0x28')],qs[_0x4ae2('0x2e')](_0x5962b0[_0x4ae2('0x29')][_0x4ae2('0x2e')]));_0x3030f8[_0x4ae2('0x2d')]=_0x3030f8[_0x4ae2('0x2d')][_0x4ae2('0x2f')]?_0x3030f8[_0x4ae2('0x2d')]:_0x3fa514['model'];if(!_0x5962b0[_0x4ae2('0x29')]['hasOwnProperty'](_0x4ae2('0x30'))){_0x3030f8[_0x4ae2('0x1a')]=qs['limit'](_0x5962b0[_0x4ae2('0x29')][_0x4ae2('0x1a')]);_0x3030f8[_0x4ae2('0x19')]=qs[_0x4ae2('0x19')](_0x5962b0['query'][_0x4ae2('0x19')]);}_0x3030f8[_0x4ae2('0x31')]=qs[_0x4ae2('0x32')](_0x5962b0[_0x4ae2('0x29')][_0x4ae2('0x32')]);_0x3030f8[_0x4ae2('0x33')]=qs[_0x4ae2('0x2b')](_[_0x4ae2('0x34')](_0x5962b0[_0x4ae2('0x29')],_0x3fa514['filters']),_0x3a9b96);if(_0x5962b0[_0x4ae2('0x29')]['filter']){_0x3030f8[_0x4ae2('0x33')]=_[_0x4ae2('0x35')](_0x3030f8[_0x4ae2('0x33')],{'$or':_[_0x4ae2('0x27')](_0x3a9b96,function(_0x771c14){if(_0x771c14[_0x4ae2('0x36')]!=='VIRTUAL'){var _0x38f12f={};_0x38f12f[_0x771c14[_0x4ae2('0x25')]]={'$like':'%'+_0x5962b0[_0x4ae2('0x29')][_0x4ae2('0x37')]+'%'};return _0x38f12f;}})});}_0x3030f8=_['merge']({},_0x3030f8,_0x5962b0[_0x4ae2('0x38')]);var _0x34a784={'where':_0x3030f8[_0x4ae2('0x33')]};return db[_0x4ae2('0x39')][_0x4ae2('0x18')](_0x34a784)[_0x4ae2('0x22')](function(_0x1fdc61){_0x329588[_0x4ae2('0x18')]=_0x1fdc61;if(_0x5962b0[_0x4ae2('0x29')][_0x4ae2('0x3a')]){_0x3030f8[_0x4ae2('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x4ae2('0x3c')](_0x3030f8);})[_0x4ae2('0x22')](function(_0x23f120){_0x329588[_0x4ae2('0x3d')]=_0x23f120;return _0x329588;})['then'](respondWithFilteredResult(_0x9508d7,_0x3030f8))['catch'](handleError(_0x9508d7,null));};exports[_0x4ae2('0x3e')]=function(_0x45527a,_0x2cbdcc){var _0x3cdf23={'raw':![],'where':{'id':_0x45527a[_0x4ae2('0x3f')]['id']}},_0x567371={};_0x567371[_0x4ae2('0x28')]=_['keys'](db[_0x4ae2('0x39')][_0x4ae2('0x40')]);_0x567371[_0x4ae2('0x29')]=_['keys'](_0x45527a[_0x4ae2('0x29')]);_0x567371[_0x4ae2('0x2b')]=_[_0x4ae2('0x2c')](_0x567371[_0x4ae2('0x28')],_0x567371[_0x4ae2('0x29')]);_0x3cdf23[_0x4ae2('0x2d')]=_[_0x4ae2('0x2c')](_0x567371[_0x4ae2('0x28')],qs['fields'](_0x45527a[_0x4ae2('0x29')][_0x4ae2('0x2e')]));_0x3cdf23['attributes']=_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')]?_0x3cdf23['attributes']:_0x567371[_0x4ae2('0x28')];if(_0x45527a[_0x4ae2('0x29')]['includeAll']){_0x3cdf23[_0x4ae2('0x3b')]=[{'all':!![]}];}_0x3cdf23=_[_0x4ae2('0x35')]({},_0x3cdf23,_0x45527a[_0x4ae2('0x38')]);return db['UserProfileResource']['find'](_0x3cdf23)[_0x4ae2('0x22')](handleEntityNotFound(_0x2cbdcc,null))[_0x4ae2('0x22')](respondWithResult(_0x2cbdcc,null))[_0x4ae2('0x41')](handleError(_0x2cbdcc,null));};exports[_0x4ae2('0x42')]=function(_0x507f1d,_0x16a072){return db[_0x4ae2('0x39')][_0x4ae2('0x42')](_0x507f1d['body'],{})[_0x4ae2('0x22')](respondWithResult(_0x16a072,0xc9))[_0x4ae2('0x41')](handleError(_0x16a072,null));};exports[_0x4ae2('0x20')]=function(_0x4e9b6e,_0x16bf0b){if(_0x4e9b6e[_0x4ae2('0x43')]['id']){delete _0x4e9b6e[_0x4ae2('0x43')]['id'];}return db[_0x4ae2('0x39')][_0x4ae2('0x44')]({'where':{'id':_0x4e9b6e[_0x4ae2('0x3f')]['id']}})[_0x4ae2('0x22')](handleEntityNotFound(_0x16bf0b,null))[_0x4ae2('0x22')](saveUpdates(_0x4e9b6e[_0x4ae2('0x43')],null))[_0x4ae2('0x22')](respondWithResult(_0x16bf0b,null))['catch'](handleError(_0x16bf0b,null));};exports[_0x4ae2('0x21')]=function(_0x4a70c6,_0x10db30){return db[_0x4ae2('0x39')][_0x4ae2('0x44')]({'where':{'id':_0x4a70c6[_0x4ae2('0x3f')]['id']}})[_0x4ae2('0x22')](handleEntityNotFound(_0x10db30,null))[_0x4ae2('0x22')](removeEntity(_0x10db30,null))['catch'](handleError(_0x10db30,null));};exports[_0x4ae2('0x45')]=function(_0x2215eb,_0x57c9f4){return db[_0x4ae2('0x39')][_0x4ae2('0x45')]()['then'](respondWithResult(_0x57c9f4,null))[_0x4ae2('0x41')](handleError(_0x57c9f4,null));}; \ No newline at end of file +var _0xabce=['Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','keys','options','UserProfileResource','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set'];(function(_0x4bcc22,_0x5a9086){var _0x43fa37=function(_0x1f63d3){while(--_0x1f63d3){_0x4bcc22['push'](_0x4bcc22['shift']());}};_0x43fa37(++_0x5a9086);}(_0xabce,0x103));var _0xeabc=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xabce[_0x5e3b04];return _0x1fc44d;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];function respondWithStatusCode(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xcc;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x19')](_0x3fd0b5);}return _0x435ea7['status'](_0x3fd0b5)[_0xeabc('0x1a')]();};}function respondWithResult(_0x1319f3,_0x3251c6){_0x3251c6=_0x3251c6||0xc8;return function(_0x55f0de){if(_0x55f0de){return _0x1319f3['status'](_0x3251c6)[_0xeabc('0x1b')](_0x55f0de);}};}function respondWithFilteredResult(_0x3ae954,_0x326bac){return function(_0x53d5cb){if(_0x53d5cb){var _0xf913d7=_0x53d5cb[_0xeabc('0x1c')],_0x638976=_0x326bac['offset'],_0x49f2d8=_0x326bac[_0xeabc('0x1d')]+_0x326bac[_0xeabc('0x1e')],_0x53fe28;if(_0x49f2d8>=_0xf913d7){_0x49f2d8=_0xf913d7;_0x53fe28=0xc8;}else{_0x53fe28=0xce;}_0x3ae954[_0xeabc('0x1f')](_0x53fe28);return _0x3ae954[_0xeabc('0x20')](_0xeabc('0x21'),_0x638976+'-'+_0x49f2d8+'/'+_0xf913d7)[_0xeabc('0x1b')](_0x53d5cb);}return null;};}function patchUpdates(_0x384be5){return function(_0x5e30ee){try{jsonpatch['apply'](_0x5e30ee,_0x384be5,!![]);}catch(_0x1253e4){return BPromise['reject'](_0x1253e4);}return _0x5e30ee[_0xeabc('0x22')]();};}function saveUpdates(_0x16530c,_0x502947){return function(_0x28063a){if(_0x28063a){return _0x28063a[_0xeabc('0x23')](_0x16530c)[_0xeabc('0x24')](function(_0x184e60){return _0x184e60;});}return null;};}function removeEntity(_0x3c9611,_0x4e99a4){return function(_0xecdbf){if(_0xecdbf){return _0xecdbf[_0xeabc('0x25')]()[_0xeabc('0x24')](function(){_0x3c9611['status'](0xcc)[_0xeabc('0x1a')]();});}};}function handleEntityNotFound(_0x3854d2,_0x214953){return function(_0x319119){if(!_0x319119){_0x3854d2['sendStatus'](0x194);}return _0x319119;};}function handleError(_0x109e1d,_0x480440){_0x480440=_0x480440||0x1f4;return function(_0x27dbaf){logger['error'](_0x27dbaf[_0xeabc('0x26')]);if(_0x27dbaf[_0xeabc('0x27')]){delete _0x27dbaf[_0xeabc('0x27')];}_0x109e1d[_0xeabc('0x1f')](_0x480440)[_0xeabc('0x28')](_0x27dbaf);};}exports[_0xeabc('0x29')]=function(_0x131722,_0x4c2693){var _0x5b2934={},_0x459c8a={},_0x5bf8f2={'count':0x0,'rows':[]};var _0x3c1b5b=_[_0xeabc('0x2a')](db['UserProfileResource'][_0xeabc('0x2b')],function(_0x38572d){return{'name':_0x38572d[_0xeabc('0x2c')],'type':_0x38572d[_0xeabc('0x2d')][_0xeabc('0x2e')]};});_0x459c8a[_0xeabc('0x2f')]=_[_0xeabc('0x2a')](_0x3c1b5b,_0xeabc('0x27'));_0x459c8a[_0xeabc('0x30')]=_['keys'](_0x131722[_0xeabc('0x30')]);_0x459c8a['filters']=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],_0x459c8a[_0xeabc('0x30')]);_0x5b2934[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x131722['query'][_0xeabc('0x33')]));_0x5b2934[_0xeabc('0x32')]=_0x5b2934[_0xeabc('0x32')]['length']?_0x5b2934[_0xeabc('0x32')]:_0x459c8a[_0xeabc('0x2f')];if(!_0x131722[_0xeabc('0x30')]['hasOwnProperty'](_0xeabc('0x34'))){_0x5b2934[_0xeabc('0x1e')]=qs[_0xeabc('0x1e')](_0x131722['query'][_0xeabc('0x1e')]);_0x5b2934[_0xeabc('0x1d')]=qs['offset'](_0x131722['query'][_0xeabc('0x1d')]);}_0x5b2934[_0xeabc('0x35')]=qs['sort'](_0x131722[_0xeabc('0x30')][_0xeabc('0x36')]);_0x5b2934[_0xeabc('0x37')]=qs[_0xeabc('0x38')](_[_0xeabc('0x39')](_0x131722['query'],_0x459c8a[_0xeabc('0x38')]),_0x3c1b5b);if(_0x131722['query'][_0xeabc('0x3a')]){_0x5b2934[_0xeabc('0x37')]=_[_0xeabc('0x3b')](_0x5b2934['where'],{'$or':_['map'](_0x3c1b5b,function(_0x452580){if(_0x452580['type']!==_0xeabc('0x3c')){var _0x4ebd64={};_0x4ebd64[_0x452580['name']]={'$like':'%'+_0x131722['query']['filter']+'%'};return _0x4ebd64;}})});}_0x5b2934=_[_0xeabc('0x3b')]({},_0x5b2934,_0x131722['options']);var _0x257fe8={'where':_0x5b2934[_0xeabc('0x37')]};return db['UserProfileResource'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b2934);})['then'](function(_0x46056c){_0x5bf8f2[_0xeabc('0x3f')]=_0x46056c;return _0x5bf8f2;})[_0xeabc('0x24')](respondWithFilteredResult(_0x4c2693,_0x5b2934))['catch'](handleError(_0x4c2693,null));};exports['show']=function(_0x5cd62e,_0x1680e8){var _0x5e9cb3={'raw':![],'where':{'id':_0x5cd62e['params']['id']}},_0xc6af4d={};_0xc6af4d[_0xeabc('0x2f')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0xc6af4d[_0xeabc('0x30')]=_[_0xeabc('0x40')](_0x5cd62e[_0xeabc('0x30')]);_0xc6af4d[_0xeabc('0x38')]=_['intersection'](_0xc6af4d[_0xeabc('0x2f')],_0xc6af4d['query']);_0x5e9cb3[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0xc6af4d[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x5cd62e[_0xeabc('0x30')]['fields']));_0x5e9cb3['attributes']=_0x5e9cb3[_0xeabc('0x32')]['length']?_0x5e9cb3[_0xeabc('0x32')]:_0xc6af4d[_0xeabc('0x2f')];if(_0x5cd62e['query'][_0xeabc('0x3d')]){_0x5e9cb3[_0xeabc('0x3e')]=[{'all':!![]}];}_0x5e9cb3=_[_0xeabc('0x3b')]({},_0x5e9cb3,_0x5cd62e[_0xeabc('0x41')]);return db[_0xeabc('0x42')][_0xeabc('0x43')](_0x5e9cb3)[_0xeabc('0x24')](handleEntityNotFound(_0x1680e8,null))['then'](respondWithResult(_0x1680e8,null))[_0xeabc('0x44')](handleError(_0x1680e8,null));};exports[_0xeabc('0x45')]=function(_0x2e7a5e,_0x1b41c8){return db[_0xeabc('0x42')][_0xeabc('0x45')](_0x2e7a5e[_0xeabc('0x46')],{})[_0xeabc('0x24')](respondWithResult(_0x1b41c8,0xc9))[_0xeabc('0x44')](handleError(_0x1b41c8,null));};exports[_0xeabc('0x23')]=function(_0x5689fc,_0x38356c){if(_0x5689fc[_0xeabc('0x46')]['id']){delete _0x5689fc[_0xeabc('0x46')]['id'];}return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x5689fc[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x38356c,null))['then'](saveUpdates(_0x5689fc[_0xeabc('0x46')],null))[_0xeabc('0x24')](respondWithResult(_0x38356c,null))[_0xeabc('0x44')](handleError(_0x38356c,null));};exports[_0xeabc('0x25')]=function(_0x47440e,_0x58e2c1){return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x47440e[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x58e2c1,null))['then'](removeEntity(_0x58e2c1,null))[_0xeabc('0x44')](handleError(_0x58e2c1,null));};exports[_0xeabc('0x48')]=function(_0x568847,_0x43e596){return db['UserProfileResource'][_0xeabc('0x48')]()['then'](respondWithResult(_0x43e596,null))[_0xeabc('0x44')](handleError(_0x43e596,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6c86b81..86832da 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 _0xa74f=['../../config/logger','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0xa74f,0x9a));var _0xfa74=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xa74f[_0x4bcf38];return _0x4a89be;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[{'name':_0xfa74('0x9'),'fields':[_0xfa74('0xa'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xee5b,0x1f4));var _0xbee5=function(_0x484dda,_0x562550){_0x484dda=_0x484dda-0x0;var _0x13e119=_0xee5b[_0x484dda];return _0x13e119;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index c2c73ad..6245548 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 _0xe5ee=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe5ee,0x145));var _0xee5e=function(_0x4c32ae,_0x1a5de0){_0x4c32ae=_0x4c32ae-0x0;var _0x2da35c=_0xe5ee[_0x4c32ae];return _0x2da35c;};'use strict';var _=require(_0xee5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee5e('0x1'));var rs=require(_0xee5e('0x2'));var fs=require('fs');var Redis=require(_0xee5e('0x3'));var db=require(_0xee5e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee5e('0x5'));var config=require('../../config/environment');var jayson=require(_0xee5e('0x6'));var client=jayson['client'][_0xee5e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x409f6b,_0x37de7f,_0x56e8c6){return new BPromise(function(_0x2e36db,_0x33ee77){return client[_0xee5e('0x8')](_0x409f6b,_0x56e8c6)['then'](function(_0x30a504){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x37de7f,_0xee5e('0x9'));logger['debug'](_0xee5e('0xa'),_0x37de7f,_0xee5e('0x9'),JSON[_0xee5e('0xb')](_0x30a504));if(_0x30a504[_0xee5e('0xc')]){if(_0x30a504[_0xee5e('0xc')][_0xee5e('0xd')]===0x1f4){logger[_0xee5e('0xc')](_0xee5e('0xe'),_0x37de7f,_0x30a504[_0xee5e('0xc')]['message']);return _0x33ee77(_0x30a504[_0xee5e('0xc')]['message']);}logger['error'](_0xee5e('0xe'),_0x37de7f,_0x30a504[_0xee5e('0xc')][_0xee5e('0xf')]);return _0x2e36db(_0x30a504[_0xee5e('0xc')]['message']);}else{logger[_0xee5e('0x10')](_0xee5e('0xe'),_0x37de7f,_0xee5e('0x9'));_0x2e36db(_0x30a504[_0xee5e('0x11')]['message']);}})[_0xee5e('0x12')](function(_0x5b5551){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x37de7f,_0x5b5551);_0x33ee77(_0x5b5551);});});} \ No newline at end of file +var _0xdecc=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','UserProfileResource,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x251d43,_0xd5a05a){var _0x3d7759=function(_0x13bd1c){while(--_0x13bd1c){_0x251d43['push'](_0x251d43['shift']());}};_0x3d7759(++_0xd5a05a);}(_0xdecc,0x1b5));var _0xcdec=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0xdecc[_0xf363f0];return _0x55a386;};'use strict';var _=require(_0xcdec('0x0'));var util=require(_0xcdec('0x1'));var moment=require(_0xcdec('0x2'));var BPromise=require(_0xcdec('0x3'));var rs=require(_0xcdec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdec('0x5'))['db'];var utils=require(_0xcdec('0x6'));var logger=require('../../config/logger')(_0xcdec('0x7'));var config=require(_0xcdec('0x8'));var jayson=require(_0xcdec('0x9'));var client=jayson['client'][_0xcdec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459c22,_0xdd1796,_0x1fd413){return new BPromise(function(_0x3b0db3,_0x5a74e6){return client[_0xcdec('0xb')](_0x459c22,_0x1fd413)[_0xcdec('0xc')](function(_0x41df7b){logger[_0xcdec('0xd')]('UserProfileResource,\x20%s,\x20%s',_0xdd1796,_0xcdec('0xe'));logger[_0xcdec('0xf')](_0xcdec('0x10'),_0xdd1796,_0xcdec('0xe'),JSON[_0xcdec('0x11')](_0x41df7b));if(_0x41df7b[_0xcdec('0x12')]){if(_0x41df7b[_0xcdec('0x12')]['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xdd1796,_0x41df7b[_0xcdec('0x12')]['message']);return _0x5a74e6(_0x41df7b[_0xcdec('0x12')][_0xcdec('0x13')]);}logger[_0xcdec('0x12')](_0xcdec('0x14'),_0xdd1796,_0x41df7b[_0xcdec('0x12')][_0xcdec('0x13')]);return _0x3b0db3(_0x41df7b[_0xcdec('0x12')][_0xcdec('0x13')]);}else{logger['info'](_0xcdec('0x14'),_0xdd1796,'request\x20sent');_0x3b0db3(_0x41df7b['result'][_0xcdec('0x13')]);}})[_0xcdec('0x15')](function(_0x58556d){logger[_0xcdec('0x12')](_0xcdec('0x14'),_0xdd1796,_0x58556d);_0x5a74e6(_0x58556d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f7f5e33..b5a3bfd 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 _0x851d=['/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x197b9d,_0x45a398){var _0x93e74d=function(_0x4b1a76){while(--_0x4b1a76){_0x197b9d['push'](_0x197b9d['shift']());}};_0x93e74d(++_0x45a398);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd851('0x0'));var util=require('util');var path=require(_0xd851('0x1'));var timeout=require(_0xd851('0x2'));var express=require('express');var router=express[_0xd851('0x3')]();var auth=require(_0xd851('0x4'));var interaction=require(_0xd851('0x5'));var config=require(_0xd851('0x6'));var controller=require(_0xd851('0x7'));router[_0xd851('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd851('0x8')](_0xd851('0x9'),auth[_0xd851('0xa')](),controller[_0xd851('0xb')]);router[_0xd851('0x8')](_0xd851('0xc'),auth['isAuthenticated'](),controller[_0xd851('0xd')]);router['post']('/',auth[_0xd851('0xa')](),controller[_0xd851('0xe')]);router['put'](_0xd851('0xc'),auth[_0xd851('0xa')](),controller[_0xd851('0xf')]);router[_0xd851('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd851('0x11')]);module[_0xd851('0x12')]=router; \ No newline at end of file +var _0x20c0=['update','exports','util','path','express','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','index','describe','post','put','/:id'];(function(_0x133f5f,_0x1f73f8){var _0x4b421c=function(_0xdcb362){while(--_0xdcb362){_0x133f5f['push'](_0x133f5f['shift']());}};_0x4b421c(++_0x1f73f8);}(_0x20c0,0x13d));var _0x020c=function(_0x450b87,_0x1a66fe){_0x450b87=_0x450b87-0x0;var _0x5d147e=_0x20c0[_0x450b87];return _0x5d147e;};'use strict';var multer=require('multer');var util=require(_0x020c('0x0'));var path=require(_0x020c('0x1'));var timeout=require('connect-timeout');var express=require(_0x020c('0x2'));var router=express[_0x020c('0x3')]();var auth=require(_0x020c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x020c('0x5'));router[_0x020c('0x6')]('/',auth[_0x020c('0x7')](),controller[_0x020c('0x8')]);router['get']('/describe',auth[_0x020c('0x7')](),controller[_0x020c('0x9')]);router[_0x020c('0x6')]('/:id',auth[_0x020c('0x7')](),controller['show']);router[_0x020c('0xa')]('/',auth[_0x020c('0x7')](),controller['create']);router[_0x020c('0xb')](_0x020c('0xc'),auth[_0x020c('0x7')](),controller[_0x020c('0xd')]);router['delete'](_0x020c('0xc'),auth[_0x020c('0x7')](),controller['destroy']);module[_0x020c('0xe')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index b71f5d0..938193d 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 _0xa44a=['sequelize','STRING','INTEGER','BOOLEAN','join','getDataValue','split'];(function(_0x456ecc,_0x11df8d){var _0x4d666d=function(_0x335a03){while(--_0x335a03){_0x456ecc['push'](_0x456ecc['shift']());}};_0x4d666d(++_0x11df8d);}(_0xa44a,0x9a));var _0xaa44=function(_0x3ae69f,_0x5c6d6e){_0x3ae69f=_0x3ae69f-0x0;var _0x9175bc=_0xa44a[_0x3ae69f];return _0x9175bc;};'use strict';var Sequelize=require(_0xaa44('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaa44('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa44('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaa44('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa44('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa44('0x1')],'set':function(_0x3427a1){this['setDataValue']('crudPermissions',_0x3427a1?_0x3427a1[_0xaa44('0x4')](''):[]);},'get':function(){return this[_0xaa44('0x5')]('crudPermissions')?this[_0xaa44('0x5')]('crudPermissions')[_0xaa44('0x6')](''):[];}}}; \ No newline at end of file +var _0x5c42=['STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split','sequelize'];(function(_0x43a6f1,_0x571f82){var _0x56974a=function(_0x5979be){while(--_0x5979be){_0x43a6f1['push'](_0x43a6f1['shift']());}};_0x56974a(++_0x571f82);}(_0x5c42,0x182));var _0x25c4=function(_0x15f01d,_0x38678a){_0x15f01d=_0x15f01d-0x0;var _0x33e1cb=_0x5c42[_0x15f01d];return _0x33e1cb;};'use strict';var Sequelize=require(_0x25c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x25c4('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x25c4('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x25c4('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x25c4('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x25c4('0x1')],'set':function(_0x4341d3){this[_0x25c4('0x4')]('crudPermissions',_0x4341d3?_0x4341d3[_0x25c4('0x5')](''):[]);},'get':function(){return this[_0x25c4('0x6')](_0x25c4('0x7'))?this[_0x25c4('0x6')](_0x25c4('0x7'))[_0x25c4('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b6d38ef..a4686f4 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 _0xe55c=['type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileSection'];(function(_0x4c4438,_0x1c2e5e){var _0x342c54=function(_0x335891){while(--_0x335891){_0x4c4438['push'](_0x4c4438['shift']());}};_0x342c54(++_0x1c2e5e);}(_0xe55c,0x1c8));var _0xce55=function(_0x211845,_0x721d77){_0x211845=_0x211845-0x0;var _0x285ce7=_0xe55c[_0x211845];return _0x285ce7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xce55('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce55('0x1'));var jsonpatch=require(_0xce55('0x2'));var rp=require(_0xce55('0x3'));var moment=require(_0xce55('0x4'));var BPromise=require(_0xce55('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xce55('0x6'));var csv=require(_0xce55('0x7'));var ejs=require(_0xce55('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xce55('0x9'));var crypto=require(_0xce55('0xa'));var jsforce=require(_0xce55('0xb'));var deskjs=require(_0xce55('0xc'));var toCsv=require(_0xce55('0x7'));var querystring=require('querystring');var Papa=require(_0xce55('0xd'));var Redis=require('ioredis');var authService=require(_0xce55('0xe'));var qs=require(_0xce55('0xf'));var as=require(_0xce55('0x10'));var hardwareService=require(_0xce55('0x11'));var logger=require(_0xce55('0x12'))(_0xce55('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xce55('0x14'))['db'];function respondWithStatusCode(_0x4c1c77,_0x6eecf5){_0x6eecf5=_0x6eecf5||0xcc;return function(_0x4d710a){if(_0x4d710a){return _0x4c1c77[_0xce55('0x15')](_0x6eecf5);}return _0x4c1c77[_0xce55('0x16')](_0x6eecf5)[_0xce55('0x17')]();};}function respondWithResult(_0x57d505,_0x2e5f6b){_0x2e5f6b=_0x2e5f6b||0xc8;return function(_0x41a30b){if(_0x41a30b){return _0x57d505[_0xce55('0x16')](_0x2e5f6b)[_0xce55('0x18')](_0x41a30b);}};}function respondWithFilteredResult(_0x4acfc7,_0x57b996){return function(_0x548306){if(_0x548306){var _0x1511a0=_0x548306['count'],_0x132eec=_0x57b996[_0xce55('0x19')],_0x48cb78=_0x57b996['offset']+_0x57b996[_0xce55('0x1a')],_0x11dfb5;if(_0x48cb78>=_0x1511a0){_0x48cb78=_0x1511a0;_0x11dfb5=0xc8;}else{_0x11dfb5=0xce;}_0x4acfc7[_0xce55('0x16')](_0x11dfb5);return _0x4acfc7[_0xce55('0x1b')](_0xce55('0x1c'),_0x132eec+'-'+_0x48cb78+'/'+_0x1511a0)[_0xce55('0x18')](_0x548306);}return null;};}function patchUpdates(_0x26a676){return function(_0x1044a2){try{jsonpatch[_0xce55('0x1d')](_0x1044a2,_0x26a676,!![]);}catch(_0x543d95){return BPromise[_0xce55('0x1e')](_0x543d95);}return _0x1044a2[_0xce55('0x1f')]();};}function saveUpdates(_0x431293,_0x45d06c){return function(_0x12edbc){if(_0x12edbc){return _0x12edbc[_0xce55('0x20')](_0x431293)[_0xce55('0x21')](function(_0x24c357){return _0x24c357;});}return null;};}function removeEntity(_0xd064da,_0x4ad841){return function(_0x444216){if(_0x444216){return _0x444216[_0xce55('0x22')]()[_0xce55('0x21')](function(){_0xd064da['status'](0xcc)[_0xce55('0x17')]();});}};}function handleEntityNotFound(_0x2eb621,_0x464282){return function(_0x52cd1a){if(!_0x52cd1a){_0x2eb621['sendStatus'](0x194);}return _0x52cd1a;};}function handleError(_0x2d36bf,_0x58b98f){_0x58b98f=_0x58b98f||0x1f4;return function(_0xd00dc4){logger[_0xce55('0x23')](_0xd00dc4[_0xce55('0x24')]);if(_0xd00dc4[_0xce55('0x25')]){delete _0xd00dc4[_0xce55('0x25')];}_0x2d36bf['status'](_0x58b98f)[_0xce55('0x26')](_0xd00dc4);};}exports['index']=function(_0x3e7232,_0x1c6424){var _0x4d5651={},_0x4596f7={},_0x28637d={'count':0x0,'rows':[]};var _0x3205b1=_[_0xce55('0x27')](db[_0xce55('0x28')]['rawAttributes'],function(_0x594bb7){return{'name':_0x594bb7['fieldName'],'type':_0x594bb7[_0xce55('0x29')][_0xce55('0x2a')]};});_0x4596f7[_0xce55('0x2b')]=_[_0xce55('0x27')](_0x3205b1,'name');_0x4596f7['query']=_[_0xce55('0x2c')](_0x3e7232[_0xce55('0x2d')]);_0x4596f7['filters']=_[_0xce55('0x2e')](_0x4596f7[_0xce55('0x2b')],_0x4596f7[_0xce55('0x2d')]);_0x4d5651['attributes']=_['intersection'](_0x4596f7[_0xce55('0x2b')],qs['fields'](_0x3e7232[_0xce55('0x2d')][_0xce55('0x2f')]));_0x4d5651[_0xce55('0x30')]=_0x4d5651['attributes']['length']?_0x4d5651[_0xce55('0x30')]:_0x4596f7[_0xce55('0x2b')];if(!_0x3e7232['query'][_0xce55('0x31')](_0xce55('0x32'))){_0x4d5651[_0xce55('0x1a')]=qs[_0xce55('0x1a')](_0x3e7232[_0xce55('0x2d')]['limit']);_0x4d5651[_0xce55('0x19')]=qs[_0xce55('0x19')](_0x3e7232[_0xce55('0x2d')][_0xce55('0x19')]);}_0x4d5651[_0xce55('0x33')]=qs['sort'](_0x3e7232[_0xce55('0x2d')][_0xce55('0x34')]);_0x4d5651[_0xce55('0x35')]=qs[_0xce55('0x36')](_[_0xce55('0x37')](_0x3e7232[_0xce55('0x2d')],_0x4596f7[_0xce55('0x36')]),_0x3205b1);if(_0x3e7232[_0xce55('0x2d')]['filter']){_0x4d5651[_0xce55('0x35')]=_[_0xce55('0x38')](_0x4d5651[_0xce55('0x35')],{'$or':_[_0xce55('0x27')](_0x3205b1,function(_0x12f2aa){if(_0x12f2aa[_0xce55('0x29')]!==_0xce55('0x39')){var _0x25fed9={};_0x25fed9[_0x12f2aa['name']]={'$like':'%'+_0x3e7232[_0xce55('0x2d')][_0xce55('0x3a')]+'%'};return _0x25fed9;}})});}_0x4d5651=_[_0xce55('0x38')]({},_0x4d5651,_0x3e7232[_0xce55('0x3b')]);var _0x116cf9={'where':_0x4d5651[_0xce55('0x35')]};return db[_0xce55('0x28')][_0xce55('0x3c')](_0x116cf9)['then'](function(_0x1204c2){_0x28637d[_0xce55('0x3c')]=_0x1204c2;if(_0x3e7232[_0xce55('0x2d')][_0xce55('0x3d')]){_0x4d5651[_0xce55('0x3e')]=[{'all':!![]}];}return db[_0xce55('0x28')][_0xce55('0x3f')](_0x4d5651);})['then'](function(_0x5b0ec7){_0x28637d[_0xce55('0x40')]=_0x5b0ec7;return _0x28637d;})[_0xce55('0x21')](respondWithFilteredResult(_0x1c6424,_0x4d5651))[_0xce55('0x41')](handleError(_0x1c6424,null));};exports['show']=function(_0x3d90cf,_0x7eb2ee){var _0xc27cc5={'raw':![],'where':{'id':_0x3d90cf[_0xce55('0x42')]['id']}},_0xc4c758={};_0xc4c758[_0xce55('0x2b')]=_[_0xce55('0x2c')](db[_0xce55('0x28')]['rawAttributes']);_0xc4c758['query']=_[_0xce55('0x2c')](_0x3d90cf['query']);_0xc4c758[_0xce55('0x36')]=_[_0xce55('0x2e')](_0xc4c758[_0xce55('0x2b')],_0xc4c758[_0xce55('0x2d')]);_0xc27cc5[_0xce55('0x30')]=_[_0xce55('0x2e')](_0xc4c758['model'],qs[_0xce55('0x2f')](_0x3d90cf[_0xce55('0x2d')]['fields']));_0xc27cc5[_0xce55('0x30')]=_0xc27cc5['attributes']['length']?_0xc27cc5['attributes']:_0xc4c758[_0xce55('0x2b')];if(_0x3d90cf[_0xce55('0x2d')][_0xce55('0x3d')]){_0xc27cc5['include']=[{'all':!![]}];}_0xc27cc5=_['merge']({},_0xc27cc5,_0x3d90cf['options']);return db['UserProfileSection'][_0xce55('0x43')](_0xc27cc5)[_0xce55('0x21')](handleEntityNotFound(_0x7eb2ee,null))[_0xce55('0x21')](respondWithResult(_0x7eb2ee,null))[_0xce55('0x41')](handleError(_0x7eb2ee,null));};exports['create']=function(_0x243f38,_0x255cae){return db[_0xce55('0x28')][_0xce55('0x44')](_0x243f38['body'],{})['then'](respondWithResult(_0x255cae,0xc9))[_0xce55('0x41')](handleError(_0x255cae,null));};exports['update']=function(_0x4a8dd2,_0x5a900e){if(_0x4a8dd2['body']['id']){delete _0x4a8dd2[_0xce55('0x45')]['id'];}return db[_0xce55('0x28')][_0xce55('0x43')]({'where':{'id':_0x4a8dd2[_0xce55('0x42')]['id']}})[_0xce55('0x21')](handleEntityNotFound(_0x5a900e,null))['then'](saveUpdates(_0x4a8dd2['body'],null))[_0xce55('0x21')](respondWithResult(_0x5a900e,null))[_0xce55('0x41')](handleError(_0x5a900e,null));};exports[_0xce55('0x22')]=function(_0x193184,_0x3dc7d9){return db[_0xce55('0x28')][_0xce55('0x43')]({'where':{'id':_0x193184[_0xce55('0x42')]['id']}})[_0xce55('0x21')](handleEntityNotFound(_0x3dc7d9,null))[_0xce55('0x21')](removeEntity(_0x3dc7d9,null))[_0xce55('0x41')](handleError(_0x3dc7d9,null));};exports[_0xce55('0x46')]=function(_0x47715e,_0x19a940){return db[_0xce55('0x28')][_0xce55('0x46')]()[_0xce55('0x21')](respondWithResult(_0x19a940,null))[_0xce55('0x41')](handleError(_0x19a940,null));}; \ No newline at end of file +var _0xa4f9=['attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','options','UserProfileSection','count','includeAll','include','findAll','rows','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','key','name','query','keys','intersection','model'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa4f9,0x1cf));var _0x9a4f=function(_0x379426,_0x3a369e){_0x379426=_0x379426-0x0;var _0x5873c2=_0xa4f9[_0x379426];return _0x5873c2;};'use strict';var pdf=require(_0x9a4f('0x0'));var emlformat=require(_0x9a4f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9a4f('0x2'));var jsonpatch=require(_0x9a4f('0x3'));var rp=require(_0x9a4f('0x4'));var moment=require(_0x9a4f('0x5'));var BPromise=require(_0x9a4f('0x6'));var Mustache=require(_0x9a4f('0x7'));var util=require(_0x9a4f('0x8'));var path=require(_0x9a4f('0x9'));var sox=require(_0x9a4f('0xa'));var csv=require(_0x9a4f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9a4f('0xc'));var squel=require(_0x9a4f('0xd'));var crypto=require(_0x9a4f('0xe'));var jsforce=require(_0x9a4f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9a4f('0xb'));var querystring=require(_0x9a4f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a4f('0x11'));var authService=require(_0x9a4f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9a4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a4f('0x14'))(_0x9a4f('0x15'));var utils=require(_0x9a4f('0x16'));var config=require(_0x9a4f('0x17'));var db=require(_0x9a4f('0x18'))['db'];function respondWithStatusCode(_0x3c9131,_0x2b8baf){_0x2b8baf=_0x2b8baf||0xcc;return function(_0x6c6371){if(_0x6c6371){return _0x3c9131[_0x9a4f('0x19')](_0x2b8baf);}return _0x3c9131[_0x9a4f('0x1a')](_0x2b8baf)['end']();};}function respondWithResult(_0x253e88,_0x3f82b3){_0x3f82b3=_0x3f82b3||0xc8;return function(_0x45822b){if(_0x45822b){return _0x253e88['status'](_0x3f82b3)['json'](_0x45822b);}};}function respondWithFilteredResult(_0x33bf9c,_0x2f1ed9){return function(_0x1b9bf7){if(_0x1b9bf7){var _0x5b5f0e=_0x1b9bf7['count'],_0x327f39=_0x2f1ed9['offset'],_0x3ea00e=_0x2f1ed9[_0x9a4f('0x1b')]+_0x2f1ed9['limit'],_0x319b3b;if(_0x3ea00e>=_0x5b5f0e){_0x3ea00e=_0x5b5f0e;_0x319b3b=0xc8;}else{_0x319b3b=0xce;}_0x33bf9c[_0x9a4f('0x1a')](_0x319b3b);return _0x33bf9c[_0x9a4f('0x1c')]('Content-Range',_0x327f39+'-'+_0x3ea00e+'/'+_0x5b5f0e)[_0x9a4f('0x1d')](_0x1b9bf7);}return null;};}function patchUpdates(_0x2cdeb9){return function(_0x1bfa35){try{jsonpatch[_0x9a4f('0x1e')](_0x1bfa35,_0x2cdeb9,!![]);}catch(_0x2aec16){return BPromise[_0x9a4f('0x1f')](_0x2aec16);}return _0x1bfa35[_0x9a4f('0x20')]();};}function saveUpdates(_0x58a533,_0x46c756){return function(_0x1eb0df){if(_0x1eb0df){return _0x1eb0df[_0x9a4f('0x21')](_0x58a533)[_0x9a4f('0x22')](function(_0x2cee85){return _0x2cee85;});}return null;};}function removeEntity(_0x5a7a60,_0x2ba826){return function(_0x4ebed3){if(_0x4ebed3){return _0x4ebed3[_0x9a4f('0x23')]()[_0x9a4f('0x22')](function(){_0x5a7a60[_0x9a4f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c1df7,_0xd7af4f){return function(_0x141ec9){if(!_0x141ec9){_0x5c1df7[_0x9a4f('0x19')](0x194);}return _0x141ec9;};}function handleError(_0x1081e2,_0x1bf6ae){_0x1bf6ae=_0x1bf6ae||0x1f4;return function(_0x553df4){logger[_0x9a4f('0x24')](_0x553df4[_0x9a4f('0x25')]);if(_0x553df4['name']){delete _0x553df4['name'];}_0x1081e2[_0x9a4f('0x1a')](_0x1bf6ae)[_0x9a4f('0x26')](_0x553df4);};}exports[_0x9a4f('0x27')]=function(_0x294909,_0x49c805){var _0x59a442={},_0x1e74ca={},_0x2d5bc6={'count':0x0,'rows':[]};var _0x107944=_[_0x9a4f('0x28')](db['UserProfileSection'][_0x9a4f('0x29')],function(_0x16138d){return{'name':_0x16138d['fieldName'],'type':_0x16138d['type'][_0x9a4f('0x2a')]};});_0x1e74ca['model']=_['map'](_0x107944,_0x9a4f('0x2b'));_0x1e74ca[_0x9a4f('0x2c')]=_[_0x9a4f('0x2d')](_0x294909[_0x9a4f('0x2c')]);_0x1e74ca['filters']=_[_0x9a4f('0x2e')](_0x1e74ca[_0x9a4f('0x2f')],_0x1e74ca['query']);_0x59a442[_0x9a4f('0x30')]=_[_0x9a4f('0x2e')](_0x1e74ca[_0x9a4f('0x2f')],qs[_0x9a4f('0x31')](_0x294909[_0x9a4f('0x2c')]['fields']));_0x59a442['attributes']=_0x59a442[_0x9a4f('0x30')][_0x9a4f('0x32')]?_0x59a442[_0x9a4f('0x30')]:_0x1e74ca['model'];if(!_0x294909[_0x9a4f('0x2c')]['hasOwnProperty'](_0x9a4f('0x33'))){_0x59a442['limit']=qs['limit'](_0x294909[_0x9a4f('0x2c')][_0x9a4f('0x34')]);_0x59a442['offset']=qs[_0x9a4f('0x1b')](_0x294909['query'][_0x9a4f('0x1b')]);}_0x59a442[_0x9a4f('0x35')]=qs[_0x9a4f('0x36')](_0x294909[_0x9a4f('0x2c')][_0x9a4f('0x36')]);_0x59a442[_0x9a4f('0x37')]=qs[_0x9a4f('0x38')](_[_0x9a4f('0x39')](_0x294909['query'],_0x1e74ca[_0x9a4f('0x38')]),_0x107944);if(_0x294909[_0x9a4f('0x2c')][_0x9a4f('0x3a')]){_0x59a442[_0x9a4f('0x37')]=_[_0x9a4f('0x3b')](_0x59a442['where'],{'$or':_['map'](_0x107944,function(_0x1e238f){if(_0x1e238f[_0x9a4f('0x3c')]!=='VIRTUAL'){var _0x41c08d={};_0x41c08d[_0x1e238f[_0x9a4f('0x2b')]]={'$like':'%'+_0x294909[_0x9a4f('0x2c')][_0x9a4f('0x3a')]+'%'};return _0x41c08d;}})});}_0x59a442=_[_0x9a4f('0x3b')]({},_0x59a442,_0x294909[_0x9a4f('0x3d')]);var _0xe5c8e2={'where':_0x59a442['where']};return db[_0x9a4f('0x3e')]['count'](_0xe5c8e2)[_0x9a4f('0x22')](function(_0x8b363e){_0x2d5bc6[_0x9a4f('0x3f')]=_0x8b363e;if(_0x294909[_0x9a4f('0x2c')][_0x9a4f('0x40')]){_0x59a442[_0x9a4f('0x41')]=[{'all':!![]}];}return db[_0x9a4f('0x3e')][_0x9a4f('0x42')](_0x59a442);})[_0x9a4f('0x22')](function(_0x263715){_0x2d5bc6[_0x9a4f('0x43')]=_0x263715;return _0x2d5bc6;})[_0x9a4f('0x22')](respondWithFilteredResult(_0x49c805,_0x59a442))['catch'](handleError(_0x49c805,null));};exports['show']=function(_0x37e03e,_0x3182c6){var _0x37998f={'raw':![],'where':{'id':_0x37e03e['params']['id']}},_0x37b2f6={};_0x37b2f6[_0x9a4f('0x2f')]=_[_0x9a4f('0x2d')](db[_0x9a4f('0x3e')][_0x9a4f('0x29')]);_0x37b2f6[_0x9a4f('0x2c')]=_[_0x9a4f('0x2d')](_0x37e03e[_0x9a4f('0x2c')]);_0x37b2f6[_0x9a4f('0x38')]=_[_0x9a4f('0x2e')](_0x37b2f6[_0x9a4f('0x2f')],_0x37b2f6[_0x9a4f('0x2c')]);_0x37998f[_0x9a4f('0x30')]=_[_0x9a4f('0x2e')](_0x37b2f6[_0x9a4f('0x2f')],qs[_0x9a4f('0x31')](_0x37e03e[_0x9a4f('0x2c')][_0x9a4f('0x31')]));_0x37998f['attributes']=_0x37998f[_0x9a4f('0x30')]['length']?_0x37998f[_0x9a4f('0x30')]:_0x37b2f6['model'];if(_0x37e03e[_0x9a4f('0x2c')][_0x9a4f('0x40')]){_0x37998f[_0x9a4f('0x41')]=[{'all':!![]}];}_0x37998f=_[_0x9a4f('0x3b')]({},_0x37998f,_0x37e03e[_0x9a4f('0x3d')]);return db[_0x9a4f('0x3e')][_0x9a4f('0x44')](_0x37998f)['then'](handleEntityNotFound(_0x3182c6,null))[_0x9a4f('0x22')](respondWithResult(_0x3182c6,null))[_0x9a4f('0x45')](handleError(_0x3182c6,null));};exports[_0x9a4f('0x46')]=function(_0x565c19,_0x425b38){return db[_0x9a4f('0x3e')]['create'](_0x565c19[_0x9a4f('0x47')],{})[_0x9a4f('0x22')](respondWithResult(_0x425b38,0xc9))[_0x9a4f('0x45')](handleError(_0x425b38,null));};exports[_0x9a4f('0x21')]=function(_0x1ae9fc,_0x484a34){if(_0x1ae9fc[_0x9a4f('0x47')]['id']){delete _0x1ae9fc['body']['id'];}return db[_0x9a4f('0x3e')][_0x9a4f('0x44')]({'where':{'id':_0x1ae9fc['params']['id']}})[_0x9a4f('0x22')](handleEntityNotFound(_0x484a34,null))[_0x9a4f('0x22')](saveUpdates(_0x1ae9fc[_0x9a4f('0x47')],null))[_0x9a4f('0x22')](respondWithResult(_0x484a34,null))[_0x9a4f('0x45')](handleError(_0x484a34,null));};exports['destroy']=function(_0x39f750,_0x3d2391){return db['UserProfileSection'][_0x9a4f('0x44')]({'where':{'id':_0x39f750['params']['id']}})[_0x9a4f('0x22')](handleEntityNotFound(_0x3d2391,null))[_0x9a4f('0x22')](removeEntity(_0x3d2391,null))[_0x9a4f('0x45')](handleError(_0x3d2391,null));};exports[_0x9a4f('0x48')]=function(_0x4f4185,_0x2f6898){return db['UserProfileSection'][_0x9a4f('0x48')]()[_0x9a4f('0x22')](respondWithResult(_0x2f6898,null))[_0x9a4f('0x45')](handleError(_0x2f6898,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3591eec..6c1a1a2 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 _0xa739=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa739,0x11d));var _0x9a73=function(_0x4a3a30,_0x11fcf2){_0x4a3a30=_0x4a3a30-0x0;var _0x342dff=_0xa739[_0x4a3a30];return _0x342dff;};'use strict';var _=require(_0x9a73('0x0'));var util=require(_0x9a73('0x1'));var logger=require(_0x9a73('0x2'))(_0x9a73('0x3'));var moment=require('moment');var BPromise=require(_0x9a73('0x4'));var rp=require(_0x9a73('0x5'));var fs=require('fs');var path=require(_0x9a73('0x6'));var rimraf=require(_0x9a73('0x7'));var config=require(_0x9a73('0x8'));var attributes=require(_0x9a73('0x9'));module[_0x9a73('0xa')]=function(_0x4ec62e,_0x1c4d95){return _0x4ec62e[_0x9a73('0xb')](_0x9a73('0xc'),attributes,{'tableName':_0x9a73('0xd'),'paranoid':![],'indexes':[{'name':_0x9a73('0xe'),'fields':[_0x9a73('0xf'),_0x9a73('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1be3=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4145c9,_0x5ca502){var _0x4a4b95=function(_0x79a9ca){while(--_0x79a9ca){_0x4145c9['push'](_0x4145c9['shift']());}};_0x4a4b95(++_0x5ca502);}(_0x1be3,0x108));var _0x31be=function(_0xf70b15,_0x38960d){_0xf70b15=_0xf70b15-0x0;var _0x4b8ce7=_0x1be3[_0xf70b15];return _0x4b8ce7;};'use strict';var _=require(_0x31be('0x0'));var util=require(_0x31be('0x1'));var logger=require(_0x31be('0x2'))(_0x31be('0x3'));var moment=require(_0x31be('0x4'));var BPromise=require('bluebird');var rp=require(_0x31be('0x5'));var fs=require('fs');var path=require(_0x31be('0x6'));var rimraf=require(_0x31be('0x7'));var config=require(_0x31be('0x8'));var attributes=require(_0x31be('0x9'));module[_0x31be('0xa')]=function(_0x30c0a6,_0x280d51){return _0x30c0a6[_0x31be('0xb')](_0x31be('0xc'),attributes,{'tableName':_0x31be('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x31be('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 8ac8a98..6cb3e59 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 _0x3d94=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f3b02,_0x6b754f){var _0xbfec81=function(_0x3c2824){while(--_0x3c2824){_0x5f3b02['push'](_0x5f3b02['shift']());}};_0xbfec81(++_0x6b754f);}(_0x3d94,0x146));var _0x43d9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3d94[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x43d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x43d9('0x1'));var rs=require(_0x43d9('0x2'));var fs=require('fs');var Redis=require(_0x43d9('0x3'));var db=require(_0x43d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43d9('0x5'))(_0x43d9('0x6'));var config=require(_0x43d9('0x7'));var jayson=require(_0x43d9('0x8'));var client=jayson[_0x43d9('0x9')][_0x43d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2252df,_0x52721d,_0x42b068){return new BPromise(function(_0x356491,_0x185085){return client[_0x43d9('0xb')](_0x2252df,_0x42b068)[_0x43d9('0xc')](function(_0x2a4bfc){logger[_0x43d9('0xd')](_0x43d9('0xe'),_0x52721d,_0x43d9('0xf'));logger['debug'](_0x43d9('0x10'),_0x52721d,'request\x20sent',JSON[_0x43d9('0x11')](_0x2a4bfc));if(_0x2a4bfc[_0x43d9('0x12')]){if(_0x2a4bfc['error'][_0x43d9('0x13')]===0x1f4){logger['error'](_0x43d9('0xe'),_0x52721d,_0x2a4bfc['error'][_0x43d9('0x14')]);return _0x185085(_0x2a4bfc[_0x43d9('0x12')][_0x43d9('0x14')]);}logger[_0x43d9('0x12')](_0x43d9('0xe'),_0x52721d,_0x2a4bfc[_0x43d9('0x12')]['message']);return _0x356491(_0x2a4bfc['error'][_0x43d9('0x14')]);}else{logger[_0x43d9('0xd')](_0x43d9('0xe'),_0x52721d,_0x43d9('0xf'));_0x356491(_0x2a4bfc[_0x43d9('0x15')][_0x43d9('0x14')]);}})[_0x43d9('0x16')](function(_0x1b180f){logger[_0x43d9('0x12')](_0x43d9('0xe'),_0x52721d,_0x1b180f);_0x185085(_0x1b180f);});});} \ No newline at end of file +var _0xc21e=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x10a18d,_0x460b58){var _0x352317=function(_0x3e526d){while(--_0x3e526d){_0x10a18d['push'](_0x10a18d['shift']());}};_0x352317(++_0x460b58);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xec21('0x0'));var moment=require(_0xec21('0x1'));var BPromise=require(_0xec21('0x2'));var rs=require(_0xec21('0x3'));var fs=require('fs');var Redis=require(_0xec21('0x4'));var db=require(_0xec21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var jayson=require(_0xec21('0x9'));var client=jayson[_0xec21('0xa')][_0xec21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x406b66,_0x2f15e7,_0x51f6dc){return new BPromise(function(_0x2b1396,_0x3d74a2){return client[_0xec21('0xc')](_0x406b66,_0x51f6dc)[_0xec21('0xd')](function(_0x4d478){logger['info'](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));logger[_0xec21('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2f15e7,'request\x20sent',JSON[_0xec21('0x11')](_0x4d478));if(_0x4d478[_0xec21('0x12')]){if(_0x4d478['error'][_0xec21('0x13')]===0x1f4){logger[_0xec21('0x12')](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x3d74a2(_0x4d478['error'][_0xec21('0x14')]);}logger['error'](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x2b1396(_0x4d478['error'][_0xec21('0x14')]);}else{logger[_0xec21('0x15')](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));_0x2b1396(_0x4d478[_0xec21('0x16')][_0xec21('0x14')]);}})[_0xec21('0x17')](function(_0x350a53){logger['error'](_0xec21('0xe'),_0x2f15e7,_0x350a53);_0x3d74a2(_0x350a53);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1fe8c7c..060212b 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 _0x7bf2=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0xae8a5b,_0xdc0c91){var _0x13719c=function(_0x5015ef){while(--_0x5015ef){_0xae8a5b['push'](_0xae8a5b['shift']());}};_0x13719c(++_0xdc0c91);}(_0x7bf2,0x1b0));var _0x27bf=function(_0xef4cf,_0x525bf0){_0xef4cf=_0xef4cf-0x0;var _0x47481f=_0x7bf2[_0xef4cf];return _0x47481f;};'use strict';var multer=require(_0x27bf('0x0'));var util=require('util');var path=require(_0x27bf('0x1'));var timeout=require(_0x27bf('0x2'));var express=require(_0x27bf('0x3'));var router=express[_0x27bf('0x4')]();var auth=require(_0x27bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x27bf('0x6'));module[_0x27bf('0x7')]=router; \ No newline at end of file +var _0x986d=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12d917,_0x59ddd4){var _0x576d1a=function(_0x360f23){while(--_0x360f23){_0x12d917['push'](_0x12d917['shift']());}};_0x576d1a(++_0x59ddd4);}(_0x986d,0xa9));var _0xd986=function(_0x50ee6b,_0x5af008){_0x50ee6b=_0x50ee6b-0x0;var _0x36cbab=_0x986d[_0x50ee6b];return _0x36cbab;};'use strict';var multer=require(_0xd986('0x0'));var util=require('util');var path=require(_0xd986('0x1'));var timeout=require(_0xd986('0x2'));var express=require('express');var router=express[_0xd986('0x3')]();var auth=require(_0xd986('0x4'));var interaction=require(_0xd986('0x5'));var config=require(_0xd986('0x6'));module[_0xd986('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d70269c..81fa231 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(_0x23902e,_0x2bcb4e){var _0x28f007=function(_0x4005e9){while(--_0x4005e9){_0x23902e['push'](_0x23902e['shift']());}};_0x28f007(++_0x2bcb4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0xce492c,_0x2bdb82){var _0x2be746=function(_0x4e9984){while(--_0x4e9984){_0xce492c['push'](_0xce492c['shift']());}};_0x2be746(++_0x2bdb82);}(_0xb10b,0x12a));var _0xbb10=function(_0x58b6a8,_0x307021){_0x58b6a8=_0x58b6a8-0x0;var _0xc566dc=_0xb10b[_0x58b6a8];return _0xc566dc;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index fe38bb7..c8a1580 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 _0x3451=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x45da8d,_0x15cf7f){var _0x511da2=function(_0x3f5c65){while(--_0x3f5c65){_0x45da8d['push'](_0x45da8d['shift']());}};_0x511da2(++_0x15cf7f);}(_0x3451,0x19a));var _0x1345=function(_0x486236,_0x325e27){_0x486236=_0x486236-0x0;var _0x58d527=_0x3451[_0x486236];return _0x58d527;};'use strict';var _=require(_0x1345('0x0'));var util=require(_0x1345('0x1'));var logger=require('../../config/logger')(_0x1345('0x2'));var moment=require(_0x1345('0x3'));var BPromise=require(_0x1345('0x4'));var rp=require(_0x1345('0x5'));var fs=require('fs');var path=require(_0x1345('0x6'));var rimraf=require(_0x1345('0x7'));var config=require(_0x1345('0x8'));var attributes=require(_0x1345('0x9'));module[_0x1345('0xa')]=function(_0x30f76b,_0x1b67de){return _0x30f76b[_0x1345('0xb')]('UserSmsQueue',attributes,{'tableName':_0x1345('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','user_has_sms_queues','lodash'];(function(_0x65ca91,_0x9a26fd){var _0x361969=function(_0x5282b7){while(--_0x5282b7){_0x65ca91['push'](_0x65ca91['shift']());}};_0x361969(++_0x9a26fd);}(_0x3276,0xc7));var _0x6327=function(_0x2f194e,_0xaa5aa9){_0x2f194e=_0x2f194e-0x0;var _0xc6c609=_0x3276[_0x2f194e];return _0xc6c609;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('UserSmsQueue',attributes,{'tableName':_0x6327('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 6a1ea65..1299e57 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 _0xd044=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfc8e58,_0x43d753){var _0x1be7b6=function(_0x20106f){while(--_0x20106f){_0xfc8e58['push'](_0xfc8e58['shift']());}};_0x1be7b6(++_0x43d753);}(_0xd044,0x1e7));var _0x4d04=function(_0x237ead,_0x1869d8){_0x237ead=_0x237ead-0x0;var _0x3f78bf=_0xd044[_0x237ead];return _0x3f78bf;};'use strict';var _=require(_0x4d04('0x0'));var util=require(_0x4d04('0x1'));var moment=require(_0x4d04('0x2'));var BPromise=require(_0x4d04('0x3'));var rs=require(_0x4d04('0x4'));var fs=require('fs');var Redis=require(_0x4d04('0x5'));var db=require(_0x4d04('0x6'))['db'];var utils=require(_0x4d04('0x7'));var logger=require(_0x4d04('0x8'))(_0x4d04('0x9'));var config=require(_0x4d04('0xa'));var jayson=require(_0x4d04('0xb'));var client=jayson[_0x4d04('0xc')][_0x4d04('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d9921,_0x2f0408,_0x13acdb){return new BPromise(function(_0x274294,_0x27a1e7){return client[_0x4d04('0xe')](_0x1d9921,_0x13acdb)['then'](function(_0x3f4f3e){logger['info'](_0x4d04('0xf'),_0x2f0408,'request\x20sent');logger[_0x4d04('0x10')](_0x4d04('0x11'),_0x2f0408,'request\x20sent',JSON[_0x4d04('0x12')](_0x3f4f3e));if(_0x3f4f3e[_0x4d04('0x13')]){if(_0x3f4f3e[_0x4d04('0x13')]['code']===0x1f4){logger['error'](_0x4d04('0xf'),_0x2f0408,_0x3f4f3e[_0x4d04('0x13')][_0x4d04('0x14')]);return _0x27a1e7(_0x3f4f3e[_0x4d04('0x13')]['message']);}logger['error'](_0x4d04('0xf'),_0x2f0408,_0x3f4f3e[_0x4d04('0x13')][_0x4d04('0x14')]);return _0x274294(_0x3f4f3e['error'][_0x4d04('0x14')]);}else{logger['info'](_0x4d04('0xf'),_0x2f0408,'request\x20sent');_0x274294(_0x3f4f3e['result']['message']);}})[_0x4d04('0x15')](function(_0x5b3d2c){logger[_0x4d04('0x13')](_0x4d04('0xf'),_0x2f0408,_0x5b3d2c);_0x27a1e7(_0x5b3d2c);});});} \ No newline at end of file +var _0x2d50=['code','message','catch','moment','randomstring','ioredis','rpc','../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x2d50,0x7a));var _0x02d5=function(_0x53c4bd,_0x29c89f){_0x53c4bd=_0x53c4bd-0x0;var _0x356988=_0x2d50[_0x53c4bd];return _0x356988;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x02d5('0x0'));var BPromise=require('bluebird');var rs=require(_0x02d5('0x1'));var fs=require('fs');var Redis=require(_0x02d5('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x02d5('0x3'));var config=require(_0x02d5('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x02d5('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a93ed,_0x1850e3,_0xc82a0b){return new BPromise(function(_0x266bec,_0x54b694){return client[_0x02d5('0x6')](_0x2a93ed,_0xc82a0b)[_0x02d5('0x7')](function(_0x5d577b){logger[_0x02d5('0x8')](_0x02d5('0x9'),_0x1850e3,_0x02d5('0xa'));logger['debug'](_0x02d5('0xb'),_0x1850e3,_0x02d5('0xa'),JSON[_0x02d5('0xc')](_0x5d577b));if(_0x5d577b[_0x02d5('0xd')]){if(_0x5d577b[_0x02d5('0xd')][_0x02d5('0xe')]===0x1f4){logger[_0x02d5('0xd')](_0x02d5('0x9'),_0x1850e3,_0x5d577b[_0x02d5('0xd')][_0x02d5('0xf')]);return _0x54b694(_0x5d577b[_0x02d5('0xd')][_0x02d5('0xf')]);}logger[_0x02d5('0xd')](_0x02d5('0x9'),_0x1850e3,_0x5d577b['error']['message']);return _0x266bec(_0x5d577b[_0x02d5('0xd')][_0x02d5('0xf')]);}else{logger[_0x02d5('0x8')](_0x02d5('0x9'),_0x1850e3,_0x02d5('0xa'));_0x266bec(_0x5d577b['result']['message']);}})[_0x02d5('0x10')](function(_0x1a1675){logger[_0x02d5('0xd')](_0x02d5('0x9'),_0x1850e3,_0x1a1675);_0x54b694(_0x1a1675);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 4d1f7fa..047204e 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 _0x7307=['../../config/environment','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2fa27d,_0x1e48e7){var _0x380f28=function(_0x1244dc){while(--_0x1244dc){_0x2fa27d['push'](_0x2fa27d['shift']());}};_0x380f28(++_0x1e48e7);}(_0x7307,0x121));var _0x7730=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x7307[_0x59befa];return _0x1dd63d;};'use strict';var multer=require(_0x7730('0x0'));var util=require(_0x7730('0x1'));var path=require(_0x7730('0x2'));var timeout=require(_0x7730('0x3'));var express=require(_0x7730('0x4'));var router=express[_0x7730('0x5')]();var auth=require(_0x7730('0x6'));var interaction=require(_0x7730('0x7'));var config=require(_0x7730('0x8'));module['exports']=router; \ No newline at end of file +var _0x0ff1=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x4c409e,_0x259ad5){var _0xa2fb65=function(_0x9cdc9e){while(--_0x9cdc9e){_0x4c409e['push'](_0x4c409e['shift']());}};_0xa2fb65(++_0x259ad5);}(_0x0ff1,0x68));var _0x10ff=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x0ff1[_0x296754];return _0x1d9f1d;};'use strict';var multer=require(_0x10ff('0x0'));var util=require(_0x10ff('0x1'));var path=require('path');var timeout=require(_0x10ff('0x2'));var express=require(_0x10ff('0x3'));var router=express['Router']();var auth=require(_0x10ff('0x4'));var interaction=require(_0x10ff('0x5'));var config=require(_0x10ff('0x6'));module[_0x10ff('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 944f95c..042afea 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x41cd6f,_0x28e0e0){var _0x2080a8=function(_0x2483a7){while(--_0x2483a7){_0x41cd6f['push'](_0x41cd6f['shift']());}};_0x2080a8(++_0x28e0e0);}(_0xe706,0xa3));var _0x6e70=function(_0x3c6c7c,_0x569b3e){_0x3c6c7c=_0x3c6c7c-0x0;var _0x56c812=_0xe706[_0x3c6c7c];return _0x56c812;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xed4e3c,_0x39e976){var _0x4297cc=function(_0x5a0cb8){while(--_0x5a0cb8){_0xed4e3c['push'](_0xed4e3c['shift']());}};_0x4297cc(++_0x39e976);}(_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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index fa21998..ecd6882 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 _0xd19b=['UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2bdf13,_0x8bc589){var _0x412d41=function(_0x146658){while(--_0x146658){_0x2bdf13['push'](_0x2bdf13['shift']());}};_0x412d41(++_0x8bc589);}(_0xd19b,0x17e));var _0xbd19=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xd19b[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require('lodash');var util=require(_0xbd19('0x0'));var logger=require(_0xbd19('0x1'))(_0xbd19('0x2'));var moment=require('moment');var BPromise=require(_0xbd19('0x3'));var rp=require(_0xbd19('0x4'));var fs=require('fs');var path=require(_0xbd19('0x5'));var rimraf=require(_0xbd19('0x6'));var config=require(_0xbd19('0x7'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x33ecc6,_0xfef502){return _0x33ecc6['define'](_0xbd19('0x8'),attributes,{'tableName':_0xbd19('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c46=['moment','bluebird','request-promise','rimraf','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0x2c46,0x12f));var _0x62c4=function(_0x23e144,_0x3009ba){_0x23e144=_0x23e144-0x0;var _0x177781=_0x2c46[_0x23e144];return _0x177781;};'use strict';var _=require('lodash');var util=require(_0x62c4('0x0'));var logger=require(_0x62c4('0x1'))(_0x62c4('0x2'));var moment=require(_0x62c4('0x3'));var BPromise=require(_0x62c4('0x4'));var rp=require(_0x62c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62c4('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x3cca8b,_0x3750da){return _0x3cca8b['define'](_0x62c4('0x7'),attributes,{'tableName':_0x62c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index d9a26ca..b5623f3 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 _0x66b7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x19468a,_0x4216bb){var _0x55d9f0=function(_0x5a0493){while(--_0x5a0493){_0x19468a['push'](_0x19468a['shift']());}};_0x55d9f0(++_0x4216bb);}(_0x66b7,0xd7));var _0x766b=function(_0x392890,_0xb8d3dd){_0x392890=_0x392890-0x0;var _0x2b2e30=_0x66b7[_0x392890];return _0x2b2e30;};'use strict';var _=require(_0x766b('0x0'));var util=require(_0x766b('0x1'));var moment=require(_0x766b('0x2'));var BPromise=require(_0x766b('0x3'));var rs=require(_0x766b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x766b('0x5'))['db'];var utils=require(_0x766b('0x6'));var logger=require(_0x766b('0x7'))('rpc');var config=require(_0x766b('0x8'));var jayson=require(_0x766b('0x9'));var client=jayson[_0x766b('0xa')][_0x766b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5998fc,_0x17928d,_0x393b3d){return new BPromise(function(_0x3aba65,_0x439650){return client['request'](_0x5998fc,_0x393b3d)[_0x766b('0xc')](function(_0x4e91f0){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x17928d,_0x766b('0xd'));logger[_0x766b('0xe')](_0x766b('0xf'),_0x17928d,_0x766b('0xd'),JSON[_0x766b('0x10')](_0x4e91f0));if(_0x4e91f0['error']){if(_0x4e91f0[_0x766b('0x11')][_0x766b('0x12')]===0x1f4){logger[_0x766b('0x11')](_0x766b('0x13'),_0x17928d,_0x4e91f0[_0x766b('0x11')][_0x766b('0x14')]);return _0x439650(_0x4e91f0['error'][_0x766b('0x14')]);}logger[_0x766b('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x17928d,_0x4e91f0[_0x766b('0x11')][_0x766b('0x14')]);return _0x3aba65(_0x4e91f0[_0x766b('0x11')][_0x766b('0x14')]);}else{logger['info'](_0x766b('0x13'),_0x17928d,_0x766b('0xd'));_0x3aba65(_0x4e91f0[_0x766b('0x15')][_0x766b('0x14')]);}})['catch'](function(_0x2646a0){logger[_0x766b('0x11')](_0x766b('0x13'),_0x17928d,_0x2646a0);_0x439650(_0x2646a0);});});} \ No newline at end of file +var _0x42bc=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x3fd2df,_0x52c281){var _0x14c770=function(_0x568ae3){while(--_0x568ae3){_0x3fd2df['push'](_0x3fd2df['shift']());}};_0x14c770(++_0x52c281);}(_0x42bc,0xc5));var _0xc42b=function(_0x2b9e33,_0x266ac7){_0x2b9e33=_0x2b9e33-0x0;var _0x3062a6=_0x42bc[_0x2b9e33];return _0x3062a6;};'use strict';var _=require(_0xc42b('0x0'));var util=require(_0xc42b('0x1'));var moment=require(_0xc42b('0x2'));var BPromise=require(_0xc42b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc42b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc42b('0x5'));var logger=require(_0xc42b('0x6'))('rpc');var config=require(_0xc42b('0x7'));var jayson=require(_0xc42b('0x8'));var client=jayson[_0xc42b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a463,_0x11070f,_0x41ecec){return new BPromise(function(_0x1e8740,_0x5b9add){return client[_0xc42b('0xa')](_0x11a463,_0x41ecec)['then'](function(_0x45b052){logger[_0xc42b('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x11070f,'request\x20sent');logger[_0xc42b('0xc')](_0xc42b('0xd'),_0x11070f,_0xc42b('0xe'),JSON['stringify'](_0x45b052));if(_0x45b052[_0xc42b('0xf')]){if(_0x45b052[_0xc42b('0xf')]['code']===0x1f4){logger['error'](_0xc42b('0x10'),_0x11070f,_0x45b052[_0xc42b('0xf')]['message']);return _0x5b9add(_0x45b052['error'][_0xc42b('0x11')]);}logger[_0xc42b('0xf')](_0xc42b('0x10'),_0x11070f,_0x45b052[_0xc42b('0xf')][_0xc42b('0x11')]);return _0x1e8740(_0x45b052[_0xc42b('0xf')][_0xc42b('0x11')]);}else{logger['info'](_0xc42b('0x10'),_0x11070f,_0xc42b('0xe'));_0x1e8740(_0x45b052[_0xc42b('0x12')][_0xc42b('0x11')]);}})[_0xc42b('0x13')](function(_0x16a4a8){logger[_0xc42b('0xf')](_0xc42b('0x10'),_0x11070f,_0x16a4a8);_0x5b9add(_0x16a4a8);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index deb8ecc..4289cb7 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 _0xaa72=['../../config/environment','exports','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x369e31,_0x5f1558){var _0x33b750=function(_0x264483){while(--_0x264483){_0x369e31['push'](_0x369e31['shift']());}};_0x33b750(++_0x5f1558);}(_0xaa72,0x113));var _0x2aa7=function(_0xfd53c9,_0x278fd3){_0xfd53c9=_0xfd53c9-0x0;var _0x1f520b=_0xaa72[_0xfd53c9];return _0x1f520b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2aa7('0x0'));var timeout=require(_0x2aa7('0x1'));var express=require(_0x2aa7('0x2'));var router=express[_0x2aa7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2aa7('0x4'));var config=require(_0x2aa7('0x5'));module[_0x2aa7('0x6')]=router; \ No newline at end of file +var _0x685d=['Router','../../components/interaction/service','../../config/environment','exports','multer','path','express'];(function(_0x8bd9ad,_0x44a34d){var _0x492b04=function(_0x167e0b){while(--_0x167e0b){_0x8bd9ad['push'](_0x8bd9ad['shift']());}};_0x492b04(++_0x44a34d);}(_0x685d,0x17e));var _0xd685=function(_0x296ca9,_0x2f25a7){_0x296ca9=_0x296ca9-0x0;var _0x29804c=_0x685d[_0x296ca9];return _0x29804c;};'use strict';var multer=require(_0xd685('0x0'));var util=require('util');var path=require(_0xd685('0x1'));var timeout=require('connect-timeout');var express=require(_0xd685('0x2'));var router=express[_0xd685('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd685('0x4'));var config=require(_0xd685('0x5'));module[_0xd685('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index fd487d7..10ca3ff 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 _0x7c14=['queue_interface','sequelize','Required\x20by\x20Asterisk','STRING','INTEGER'];(function(_0x25e37a,_0x3c9560){var _0x2a0e29=function(_0x20d6a5){while(--_0x20d6a5){_0x25e37a['push'](_0x25e37a['shift']());}};_0x2a0e29(++_0x3c9560);}(_0x7c14,0xec));var _0x47c1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c14[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x47c1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x47c1('0x1')},'membername':{'type':Sequelize[_0x47c1('0x2')],'allowNull':![],'comment':_0x47c1('0x1')},'UserId':{'type':Sequelize[_0x47c1('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x47c1('0x2')],'allowNull':![],'unique':_0x47c1('0x4'),'comment':_0x47c1('0x1')},'VoiceQueueId':{'type':Sequelize[_0x47c1('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x47c1('0x1')},'penalty':{'type':Sequelize[_0x47c1('0x3')](0xb),'defaultValue':0x0,'comment':_0x47c1('0x1')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x47c1('0x1')}}; \ No newline at end of file +var _0x7a54=['STRING','INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x18c34d,_0x182e9b){var _0x5f4b4b=function(_0x170ae5){while(--_0x170ae5){_0x18c34d['push'](_0x18c34d['shift']());}};_0x5f4b4b(++_0x182e9b);}(_0x7a54,0x11d));var _0x47a5=function(_0x1e565c,_0x2569e9){_0x1e565c=_0x1e565c-0x0;var _0x1300f6=_0x7a54[_0x1e565c];return _0x1300f6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x47a5('0x2')},'membername':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![],'comment':_0x47a5('0x2')},'UserId':{'type':Sequelize[_0x47a5('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![],'unique':_0x47a5('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x47a5('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![],'unique':_0x47a5('0x5'),'comment':_0x47a5('0x2')},'penalty':{'type':Sequelize[_0x47a5('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x47a5('0x4')](0xb),'defaultValue':0x0,'comment':_0x47a5('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 149670e..d549f18 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 _0x0d17=['hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4841d4,_0x41ed37){var _0x22aaa1=function(_0x21f7ae){while(--_0x21f7ae){_0x4841d4['push'](_0x4841d4['shift']());}};_0x22aaa1(++_0x41ed37);}(_0x0d17,0x16a));var _0x70d1=function(_0x351bd4,_0x100125){_0x351bd4=_0x351bd4-0x0;var _0x391674=_0x0d17[_0x351bd4];return _0x391674;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x70d1('0x0'))['db'][_0x70d1('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x70d1('0x2')](0x0);var events={'afterCreate':_0x70d1('0x3'),'afterUpdate':'update','afterDestroy':_0x70d1('0x4')};function emitEvent(_0x567f3a){return function(_0x7703d7,_0x35f520,_0x1025d6){UserVoiceQueueRtEvents[_0x70d1('0x5')](_0x567f3a+':'+_0x7703d7['id'],_0x7703d7);UserVoiceQueueRtEvents['emit'](_0x567f3a,_0x7703d7);_0x1025d6(null);};}for(var e in events){if(events[_0x70d1('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x70d1('0x7')](e,emitEvent(event));}}module[_0x70d1('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x51a3=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x51a3,0x1ac));var _0x351a=function(_0x17a504,_0x42b47b){_0x17a504=_0x17a504-0x0;var _0xb6f356=_0x51a3[_0x17a504];return _0xb6f356;};'use strict';var EventEmitter=require(_0x351a('0x0'));var UserVoiceQueueRt=require(_0x351a('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x351a('0x2'),'afterUpdate':_0x351a('0x3'),'afterDestroy':_0x351a('0x4')};function emitEvent(_0x476a44){return function(_0xd22bd1,_0x209638,_0x21aa07){UserVoiceQueueRtEvents[_0x351a('0x5')](_0x476a44+':'+_0xd22bd1['id'],_0xd22bd1);UserVoiceQueueRtEvents[_0x351a('0x5')](_0x476a44,_0xd22bd1);_0x21aa07(null);};}for(var e in events){if(events[_0x351a('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x351a('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 c7da92c..81e9f44 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 _0x3dcc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x2bb1c0,_0x2c15f4){var _0x55a993=function(_0x49871b){while(--_0x49871b){_0x2bb1c0['push'](_0x2bb1c0['shift']());}};_0x55a993(++_0x2c15f4);}(_0x3dcc,0x14c));var _0xc3dc=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0x3dcc[_0x10df1e];return _0x3e24fb;};'use strict';var _=require(_0xc3dc('0x0'));var util=require(_0xc3dc('0x1'));var logger=require(_0xc3dc('0x2'))(_0xc3dc('0x3'));var moment=require(_0xc3dc('0x4'));var BPromise=require(_0xc3dc('0x5'));var rp=require(_0xc3dc('0x6'));var fs=require('fs');var path=require(_0xc3dc('0x7'));var rimraf=require(_0xc3dc('0x8'));var config=require(_0xc3dc('0x9'));var attributes=require(_0xc3dc('0xa'));module[_0xc3dc('0xb')]=function(_0x4c4c08,_0x10b7ed){return _0x4c4c08['define'](_0xc3dc('0xc'),attributes,{'tableName':_0xc3dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce64=['user_has_voice_queues_rt','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','UserVoiceQueueRt'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xce64,0x169));var _0x4ce6=function(_0x1b59fc,_0x340dcc){_0x1b59fc=_0x1b59fc-0x0;var _0x1815af=_0xce64[_0x1b59fc];return _0x1815af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ce6('0x0'))('api');var moment=require('moment');var BPromise=require(_0x4ce6('0x1'));var rp=require(_0x4ce6('0x2'));var fs=require('fs');var path=require(_0x4ce6('0x3'));var rimraf=require('rimraf');var config=require(_0x4ce6('0x4'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x4ce6('0x5')]=function(_0x3730ab,_0x3b10ce){return _0x3730ab['define'](_0x4ce6('0x6'),attributes,{'tableName':_0x4ce6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 7296bf1..dc896d2 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 _0xd7de=['./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x21f31f,_0x508d58){var _0xf3c92a=function(_0xec9c78){while(--_0xec9c78){_0x21f31f['push'](_0x21f31f['shift']());}};_0xf3c92a(++_0x508d58);}(_0xd7de,0x89));var _0xed7d=function(_0x473ea6,_0xc67499){_0x473ea6=_0x473ea6-0x0;var _0x50e462=_0xd7de[_0x473ea6];return _0x50e462;};'use strict';var _=require('lodash');var util=require(_0xed7d('0x0'));var moment=require(_0xed7d('0x1'));var BPromise=require(_0xed7d('0x2'));var rs=require(_0xed7d('0x3'));var fs=require('fs');var Redis=require(_0xed7d('0x4'));var db=require(_0xed7d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed7d('0x6'))(_0xed7d('0x7'));var config=require('../../config/environment');var jayson=require(_0xed7d('0x8'));var client=jayson[_0xed7d('0x9')][_0xed7d('0xa')]({'port':0x232a});config[_0xed7d('0xb')]=_[_0xed7d('0xc')](config[_0xed7d('0xb')],{'host':_0xed7d('0xd'),'port':0x18eb});var socket=require(_0xed7d('0xe'))(new Redis(config[_0xed7d('0xb')]));require(_0xed7d('0xf'))[_0xed7d('0x10')](socket);function respondWithRpcPromise(_0x84c180,_0x519f88,_0x500e77){return new BPromise(function(_0x5ce3e0,_0x5bd122){return client['request'](_0x84c180,_0x500e77)['then'](function(_0x14e909){logger[_0xed7d('0x11')](_0xed7d('0x12'),_0x519f88,_0xed7d('0x13'));logger[_0xed7d('0x14')](_0xed7d('0x15'),_0x519f88,_0xed7d('0x13'),JSON['stringify'](_0x14e909));if(_0x14e909['error']){if(_0x14e909[_0xed7d('0x16')][_0xed7d('0x17')]===0x1f4){logger['error'](_0xed7d('0x12'),_0x519f88,_0x14e909[_0xed7d('0x16')]['message']);return _0x5bd122(_0x14e909[_0xed7d('0x16')][_0xed7d('0x18')]);}logger[_0xed7d('0x16')](_0xed7d('0x12'),_0x519f88,_0x14e909[_0xed7d('0x16')][_0xed7d('0x18')]);return _0x5ce3e0(_0x14e909[_0xed7d('0x16')][_0xed7d('0x18')]);}else{logger[_0xed7d('0x11')](_0xed7d('0x12'),_0x519f88,_0xed7d('0x13'));_0x5ce3e0(_0x14e909[_0xed7d('0x19')][_0xed7d('0x18')]);}})[_0xed7d('0x1a')](function(_0x3808ed){logger[_0xed7d('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x519f88,_0x3808ed);_0x5bd122(_0x3808ed);});});}exports['GetVoiceQueueRtPauses']=function(_0x52457d){var _0x577b09=this;return new Promise(function(_0x2fc2ad,_0x2a296f){return db[_0xed7d('0x1b')]['findAll']({'raw':_0x52457d['options']?_0x52457d[_0xed7d('0x1c')][_0xed7d('0x1d')]===undefined?!![]:![]:!![],'where':_0x52457d['options']?_0x52457d[_0xed7d('0x1c')][_0xed7d('0x1e')]||null:null,'attributes':[[db[_0xed7d('0x1f')]['fn'](_0xed7d('0x20'),db[_0xed7d('0x1f')]['fn']('IF',db[_0xed7d('0x1f')][_0xed7d('0x21')](_0xed7d('0x22')))),_0xed7d('0x23')]]})['then'](function(_0x183869){logger['info'](_0xed7d('0x24'),_0x52457d);logger[_0xed7d('0x14')](_0xed7d('0x24'),_0x52457d,JSON[_0xed7d('0x25')](_0x183869));_0x2fc2ad(_0x183869);})[_0xed7d('0x1a')](function(_0x2ea196){logger[_0xed7d('0x16')](_0xed7d('0x24'),_0x2ea196[_0xed7d('0x18')],_0x52457d);_0x2a296f(_0x577b09[_0xed7d('0x16')](0x1f4,_0x2ea196[_0xed7d('0x18')]));});});}; \ No newline at end of file +var _0xef60=['stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','info','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef60,0xaa));var _0x0ef6=function(_0x4dd45b,_0x117280){_0x4dd45b=_0x4dd45b-0x0;var _0x22b033=_0xef60[_0x4dd45b];return _0x22b033;};'use strict';var _=require('lodash');var util=require(_0x0ef6('0x0'));var moment=require('moment');var BPromise=require(_0x0ef6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ef6('0x2'))['db'];var utils=require(_0x0ef6('0x3'));var logger=require(_0x0ef6('0x4'))('rpc');var config=require(_0x0ef6('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ef6('0x6')]({'port':0x232a});config[_0x0ef6('0x7')]=_['defaults'](config[_0x0ef6('0x7')],{'host':_0x0ef6('0x8'),'port':0x18eb});var socket=require(_0x0ef6('0x9'))(new Redis(config['redis']));require(_0x0ef6('0xa'))[_0x0ef6('0xb')](socket);function respondWithRpcPromise(_0x23b064,_0x4ece59,_0x1f79ee){return new BPromise(function(_0x249740,_0x3b974b){return client['request'](_0x23b064,_0x1f79ee)[_0x0ef6('0xc')](function(_0x8a4a88){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4ece59,_0x0ef6('0xd'));logger[_0x0ef6('0xe')](_0x0ef6('0xf'),_0x4ece59,_0x0ef6('0xd'),JSON[_0x0ef6('0x10')](_0x8a4a88));if(_0x8a4a88[_0x0ef6('0x11')]){if(_0x8a4a88[_0x0ef6('0x11')][_0x0ef6('0x12')]===0x1f4){logger[_0x0ef6('0x11')](_0x0ef6('0x13'),_0x4ece59,_0x8a4a88[_0x0ef6('0x11')]['message']);return _0x3b974b(_0x8a4a88[_0x0ef6('0x11')][_0x0ef6('0x14')]);}logger[_0x0ef6('0x11')](_0x0ef6('0x13'),_0x4ece59,_0x8a4a88['error']['message']);return _0x249740(_0x8a4a88[_0x0ef6('0x11')][_0x0ef6('0x14')]);}else{logger[_0x0ef6('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4ece59,_0x0ef6('0xd'));_0x249740(_0x8a4a88['result'][_0x0ef6('0x14')]);}})[_0x0ef6('0x16')](function(_0x4a66b0){logger[_0x0ef6('0x11')](_0x0ef6('0x13'),_0x4ece59,_0x4a66b0);_0x3b974b(_0x4a66b0);});});}exports[_0x0ef6('0x17')]=function(_0xbfe34b){var _0x3c4388=this;return new Promise(function(_0x4e7693,_0x5414d6){return db['UserVoiceQueueRt'][_0x0ef6('0x18')]({'raw':_0xbfe34b['options']?_0xbfe34b[_0x0ef6('0x19')][_0x0ef6('0x1a')]===undefined?!![]:![]:!![],'where':_0xbfe34b[_0x0ef6('0x19')]?_0xbfe34b[_0x0ef6('0x19')][_0x0ef6('0x1b')]||null:null,'attributes':[[db[_0x0ef6('0x1c')]['fn'](_0x0ef6('0x1d'),db[_0x0ef6('0x1c')]['fn']('IF',db[_0x0ef6('0x1c')]['literal'](_0x0ef6('0x1e')))),'outboundQueuePauses']]})['then'](function(_0x561af1){logger['info'](_0x0ef6('0x17'),_0xbfe34b);logger[_0x0ef6('0xe')](_0x0ef6('0x17'),_0xbfe34b,JSON[_0x0ef6('0x10')](_0x561af1));_0x4e7693(_0x561af1);})[_0x0ef6('0x16')](function(_0x1f0d4c){logger[_0x0ef6('0x11')]('GetVoiceQueueRtPauses',_0x1f0d4c[_0x0ef6('0x14')],_0xbfe34b);_0x5414d6(_0x3c4388['error'](0x1f4,_0x1f0d4c[_0x0ef6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1e54187..95db7a3 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 _0x7e4b=['./userVoiceQueueRt.events','save','remove','update','removeListener','register','userVoiceQueueRt:'];(function(_0x97501e,_0x48c8fd){var _0x5919c8=function(_0x4033bd){while(--_0x4033bd){_0x97501e['push'](_0x97501e['shift']());}};_0x5919c8(++_0x48c8fd);}(_0x7e4b,0x11f));var _0xb7e4=function(_0x46a10d,_0x26d9c2){_0x46a10d=_0x46a10d-0x0;var _0x49f73a=_0x7e4b[_0x46a10d];return _0x49f73a;};'use strict';var UserVoiceQueueRtEvents=require(_0xb7e4('0x0'));var events=[_0xb7e4('0x1'),_0xb7e4('0x2'),_0xb7e4('0x3')];function createListener(_0x1b4434,_0x408e68){return function(_0x49c67d){_0x408e68['emit'](_0x1b4434,_0x49c67d);};}function removeListener(_0x37799e,_0x3eae72){return function(){UserVoiceQueueRtEvents[_0xb7e4('0x4')](_0x37799e,_0x3eae72);};}exports[_0xb7e4('0x5')]=function(_0x1675a6){for(var _0x562216=0x0,_0xc08254=events['length'];_0x562216<_0xc08254;_0x562216++){var _0x1789f0=events[_0x562216];var _0x514fe4=createListener(_0xb7e4('0x6')+_0x1789f0,_0x1675a6);UserVoiceQueueRtEvents['on'](_0x1789f0,_0x514fe4);}}; \ No newline at end of file +var _0x3e41=['./userVoiceQueueRt.events','remove','update','emit','register','userVoiceQueueRt:'];(function(_0x5c5904,_0xa16eeb){var _0x1eb4b8=function(_0x103d25){while(--_0x103d25){_0x5c5904['push'](_0x5c5904['shift']());}};_0x1eb4b8(++_0xa16eeb);}(_0x3e41,0x138));var _0x13e4=function(_0x350976,_0x4bdcb1){_0x350976=_0x350976-0x0;var _0x57b884=_0x3e41[_0x350976];return _0x57b884;};'use strict';var UserVoiceQueueRtEvents=require(_0x13e4('0x0'));var events=['save',_0x13e4('0x1'),_0x13e4('0x2')];function createListener(_0x9a8db1,_0x33bb57){return function(_0x4a1efc){_0x33bb57[_0x13e4('0x3')](_0x9a8db1,_0x4a1efc);};}function removeListener(_0x430fd3,_0x4dce82){return function(){UserVoiceQueueRtEvents['removeListener'](_0x430fd3,_0x4dce82);};}exports[_0x13e4('0x4')]=function(_0x7b9206){for(var _0x56caf1=0x0,_0x55a0a8=events['length'];_0x56caf1<_0x55a0a8;_0x56caf1++){var _0x4ad7aa=events[_0x56caf1];var _0xf69aca=createListener(_0x13e4('0x5')+_0x4ad7aa,_0x7b9206);UserVoiceQueueRtEvents['on'](_0x4ad7aa,_0xf69aca);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6956088..d0e3bf4 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd26f=['../../config/environment','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x43f8ff,_0x43374a){var _0x3768cb=function(_0x22e6e6){while(--_0x22e6e6){_0x43f8ff['push'](_0x43f8ff['shift']());}};_0x3768cb(++_0x43374a);}(_0xd26f,0xa2));var _0xfd26=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xd26f[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0xfd26('0x0'));var path=require(_0xfd26('0x1'));var timeout=require(_0xfd26('0x2'));var express=require('express');var router=express[_0xfd26('0x3')]();var auth=require(_0xfd26('0x4'));var interaction=require(_0xfd26('0x5'));var config=require(_0xfd26('0x6'));module[_0xfd26('0x7')]=router; \ No newline at end of file +var _0x6dcb=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path'];(function(_0x4571fb,_0x44b35a){var _0x3fcfef=function(_0x373021){while(--_0x373021){_0x4571fb['push'](_0x4571fb['shift']());}};_0x3fcfef(++_0x44b35a);}(_0x6dcb,0x156));var _0xb6dc=function(_0x3b7d8e,_0x310dae){_0x3b7d8e=_0x3b7d8e-0x0;var _0x2d4427=_0x6dcb[_0x3b7d8e];return _0x2d4427;};'use strict';var multer=require(_0xb6dc('0x0'));var util=require('util');var path=require(_0xb6dc('0x1'));var timeout=require(_0xb6dc('0x2'));var express=require('express');var router=express[_0xb6dc('0x3')]();var auth=require(_0xb6dc('0x4'));var interaction=require(_0xb6dc('0x5'));var config=require(_0xb6dc('0x6'));module[_0xb6dc('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 83c83ec..1087c12 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x507e70,_0xffb184){var _0x2dee23=function(_0x3cd7c9){while(--_0x3cd7c9){_0x507e70['push'](_0x507e70['shift']());}};_0x2dee23(++_0xffb184);}(_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 _0xd8b0=['exports','sequelize'];(function(_0x452450,_0x40b419){var _0x448b19=function(_0x5467b0){while(--_0x5467b0){_0x452450['push'](_0x452450['shift']());}};_0x448b19(++_0x40b419);}(_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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index bd48dc8..d0e84b0 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe296=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0xdcba5e,_0x5c3c26){var _0x5c31ff=function(_0x30cf7d){while(--_0x30cf7d){_0xdcba5e['push'](_0xdcba5e['shift']());}};_0x5c31ff(++_0x5c3c26);}(_0xe296,0xb4));var _0x6e29=function(_0x152861,_0x2343d6){_0x152861=_0x152861-0x0;var _0x21367f=_0xe296[_0x152861];return _0x21367f;};'use strict';var _=require('lodash');var util=require(_0x6e29('0x0'));var logger=require(_0x6e29('0x1'))(_0x6e29('0x2'));var moment=require(_0x6e29('0x3'));var BPromise=require(_0x6e29('0x4'));var rp=require(_0x6e29('0x5'));var fs=require('fs');var path=require(_0x6e29('0x6'));var rimraf=require(_0x6e29('0x7'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x6e29('0x8')]=function(_0x5daa67,_0x22e9fb){return _0x5daa67[_0x6e29('0x9')](_0x6e29('0xa'),attributes,{'tableName':_0x6e29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16b2=['util','../../config/logger','api','bluebird','request-promise','path','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x542f79,_0x2df7d7){var _0x5b0e12=function(_0x95b1af){while(--_0x95b1af){_0x542f79['push'](_0x542f79['shift']());}};_0x5b0e12(++_0x2df7d7);}(_0x16b2,0x149));var _0x216b=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x16b2[_0x10791d];return _0x1b4f9c;};'use strict';var _=require(_0x216b('0x0'));var util=require(_0x216b('0x1'));var logger=require(_0x216b('0x2'))(_0x216b('0x3'));var moment=require('moment');var BPromise=require(_0x216b('0x4'));var rp=require(_0x216b('0x5'));var fs=require('fs');var path=require(_0x216b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x216b('0x7'));module[_0x216b('0x8')]=function(_0x32b50a,_0x88fa10){return _0x32b50a['define'](_0x216b('0x9'),attributes,{'tableName':_0x216b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index a33c48d..de1cba4 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x11b8df,_0x41e72c){var _0x49aa80=function(_0x489cc4){while(--_0x489cc4){_0x11b8df['push'](_0x11b8df['shift']());}};_0x49aa80(++_0x41e72c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x4bd951,_0x516604){var _0x8ebe7e=function(_0x3f1713){while(--_0x3f1713){_0x4bd951['push'](_0x4bd951['shift']());}};_0x8ebe7e(++_0x516604);}(_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);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index df8f9a6..b524fd1 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 _0x5103=['show','post','create','put','update','delete','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','index','/:id','isAuthenticated'];(function(_0x185d9a,_0x25555f){var _0x3098ec=function(_0x3275a8){while(--_0x3275a8){_0x185d9a['push'](_0x185d9a['shift']());}};_0x3098ec(++_0x25555f);}(_0x5103,0x197));var _0x3510=function(_0x80b16b,_0x315606){_0x80b16b=_0x80b16b-0x0;var _0x46963b=_0x5103[_0x80b16b];return _0x46963b;};'use strict';var multer=require(_0x3510('0x0'));var util=require('util');var path=require(_0x3510('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x3510('0x2'));var interaction=require(_0x3510('0x3'));var config=require(_0x3510('0x4'));var controller=require(_0x3510('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x3510('0x6')]);router['get'](_0x3510('0x7'),auth[_0x3510('0x8')](),controller[_0x3510('0x9')]);router[_0x3510('0xa')]('/',auth[_0x3510('0x8')](),controller[_0x3510('0xb')]);router[_0x3510('0xc')](_0x3510('0x7'),auth['isAuthenticated'](),controller[_0x3510('0xd')]);router[_0x3510('0xe')](_0x3510('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x3510('0xf')]=router; \ No newline at end of file +var _0x031b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x1cf29b,_0x391e21){var _0x43f745=function(_0x157813){while(--_0x157813){_0x1cf29b['push'](_0x1cf29b['shift']());}};_0x43f745(++_0x391e21);}(_0x031b,0x1e9));var _0xb031=function(_0x344f03,_0x58c5e0){_0x344f03=_0x344f03-0x0;var _0x1ff746=_0x031b[_0x344f03];return _0x1ff746;};'use strict';var multer=require('multer');var util=require(_0xb031('0x0'));var path=require(_0xb031('0x1'));var timeout=require(_0xb031('0x2'));var express=require(_0xb031('0x3'));var router=express[_0xb031('0x4')]();var auth=require(_0xb031('0x5'));var interaction=require(_0xb031('0x6'));var config=require(_0xb031('0x7'));var controller=require(_0xb031('0x8'));router['get']('/',auth[_0xb031('0x9')](),controller[_0xb031('0xa')]);router[_0xb031('0xb')](_0xb031('0xc'),auth[_0xb031('0x9')](),controller[_0xb031('0xd')]);router[_0xb031('0xe')]('/',auth[_0xb031('0x9')](),controller[_0xb031('0xf')]);router['put'](_0xb031('0xc'),auth[_0xb031('0x9')](),controller['update']);router[_0xb031('0x10')]('/:id',auth[_0xb031('0x9')](),controller[_0xb031('0x11')]);module[_0xb031('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 03f09d0..48575dd 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 _0x368b=['exports','STRING','name'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0x368b,0x19e));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xb368('0x0')]={'name':{'type':Sequelize[_0xb368('0x1')],'unique':_0xb368('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb368('0x1')]}}; \ No newline at end of file +var _0x02f9=['sequelize','exports','STRING','name'];(function(_0x16a8ef,_0x160f81){var _0xc9bc08=function(_0x55e258){while(--_0x55e258){_0x16a8ef['push'](_0x16a8ef['shift']());}};_0xc9bc08(++_0x160f81);}(_0x02f9,0xf0));var _0x902f=function(_0x35f616,_0xc97542){_0x35f616=_0x35f616-0x0;var _0x4057dc=_0x02f9[_0x35f616];return _0x4057dc;};'use strict';var Sequelize=require(_0x902f('0x0'));module[_0x902f('0x1')]={'name':{'type':Sequelize[_0x902f('0x2')],'unique':_0x902f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x902f('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 2b91b6b..494503c 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 _0x5a9a=['rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','includeAll','include'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x5a9a,0x1ac));var _0xa5a9=function(_0x51db17,_0x3b4b0a){_0x51db17=_0x51db17-0x0;var _0x43345a=_0x5a9a[_0x51db17];return _0x43345a;};'use strict';var pdf=require(_0xa5a9('0x0'));var emlformat=require(_0xa5a9('0x1'));var rimraf=require(_0xa5a9('0x2'));var zipdir=require(_0xa5a9('0x3'));var jsonpatch=require(_0xa5a9('0x4'));var rp=require('request-promise');var moment=require(_0xa5a9('0x5'));var BPromise=require(_0xa5a9('0x6'));var Mustache=require(_0xa5a9('0x7'));var util=require(_0xa5a9('0x8'));var path=require(_0xa5a9('0x9'));var sox=require(_0xa5a9('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa5a9('0xb'));var squel=require(_0xa5a9('0xc'));var crypto=require(_0xa5a9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa5a9('0xe'));var querystring=require(_0xa5a9('0xf'));var Papa=require(_0xa5a9('0x10'));var Redis=require(_0xa5a9('0x11'));var authService=require(_0xa5a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa5a9('0x13'));var hardwareService=require(_0xa5a9('0x14'));var logger=require('../../config/logger')(_0xa5a9('0x15'));var utils=require(_0xa5a9('0x16'));var config=require(_0xa5a9('0x17'));var db=require(_0xa5a9('0x18'))['db'];function respondWithStatusCode(_0x3fff8d,_0x18e0a6){_0x18e0a6=_0x18e0a6||0xcc;return function(_0x576cf2){if(_0x576cf2){return _0x3fff8d[_0xa5a9('0x19')](_0x18e0a6);}return _0x3fff8d['status'](_0x18e0a6)[_0xa5a9('0x1a')]();};}function respondWithResult(_0x2be150,_0x44ecfe){_0x44ecfe=_0x44ecfe||0xc8;return function(_0x4c8e82){if(_0x4c8e82){return _0x2be150['status'](_0x44ecfe)[_0xa5a9('0x1b')](_0x4c8e82);}};}function respondWithFilteredResult(_0x3534dd,_0xaa7861){return function(_0x404078){if(_0x404078){var _0x5dca2f=_0x404078[_0xa5a9('0x1c')],_0x56af6d=_0xaa7861[_0xa5a9('0x1d')],_0x15a6ad=_0xaa7861[_0xa5a9('0x1d')]+_0xaa7861[_0xa5a9('0x1e')],_0x5cf9f2;if(_0x15a6ad>=_0x5dca2f){_0x15a6ad=_0x5dca2f;_0x5cf9f2=0xc8;}else{_0x5cf9f2=0xce;}_0x3534dd[_0xa5a9('0x1f')](_0x5cf9f2);return _0x3534dd[_0xa5a9('0x20')](_0xa5a9('0x21'),_0x56af6d+'-'+_0x15a6ad+'/'+_0x5dca2f)[_0xa5a9('0x1b')](_0x404078);}return null;};}function patchUpdates(_0x17ac9b){return function(_0x8231b){try{jsonpatch[_0xa5a9('0x22')](_0x8231b,_0x17ac9b,!![]);}catch(_0x1e24a0){return BPromise[_0xa5a9('0x23')](_0x1e24a0);}return _0x8231b[_0xa5a9('0x24')]();};}function saveUpdates(_0x1acb50,_0x4ab4b2){return function(_0x5c9297){if(_0x5c9297){return _0x5c9297[_0xa5a9('0x25')](_0x1acb50)[_0xa5a9('0x26')](function(_0x573420){return _0x573420;});}return null;};}function removeEntity(_0x481f5e,_0x18b472){return function(_0x962e36){if(_0x962e36){return _0x962e36[_0xa5a9('0x27')]()[_0xa5a9('0x26')](function(){var _0x366db9=_0x962e36[_0xa5a9('0x28')]({'plain':!![]});var _0x431f93=_0xa5a9('0x29');return db[_0xa5a9('0x2a')][_0xa5a9('0x27')]({'where':{'type':_0x431f93,'resourceId':_0x366db9['id']}})[_0xa5a9('0x26')](function(){return _0x962e36;});})['then'](function(){_0x481f5e[_0xa5a9('0x1f')](0xcc)[_0xa5a9('0x1a')]();});}};}function handleEntityNotFound(_0x2b8e71,_0x448fe3){return function(_0x3c2b0e){if(!_0x3c2b0e){_0x2b8e71['sendStatus'](0x194);}return _0x3c2b0e;};}function handleError(_0x3dfc26,_0x174cb1){_0x174cb1=_0x174cb1||0x1f4;return function(_0x5afa14){logger['error'](_0x5afa14[_0xa5a9('0x2b')]);if(_0x5afa14['name']){delete _0x5afa14[_0xa5a9('0x2c')];}_0x3dfc26[_0xa5a9('0x1f')](_0x174cb1)[_0xa5a9('0x2d')](_0x5afa14);};}exports['index']=function(_0xa5a40a,_0x542b72){var _0x321376={},_0x382857={},_0x3a670f={'count':0x0,'rows':[]};var _0x47e3dc=_[_0xa5a9('0x2e')](db['Variable'][_0xa5a9('0x2f')],function(_0x432729){return{'name':_0x432729['fieldName'],'type':_0x432729[_0xa5a9('0x30')][_0xa5a9('0x31')]};});_0x382857[_0xa5a9('0x32')]=_[_0xa5a9('0x2e')](_0x47e3dc,'name');_0x382857['query']=_[_0xa5a9('0x33')](_0xa5a40a['query']);_0x382857[_0xa5a9('0x34')]=_[_0xa5a9('0x35')](_0x382857[_0xa5a9('0x32')],_0x382857[_0xa5a9('0x36')]);_0x321376[_0xa5a9('0x37')]=_['intersection'](_0x382857[_0xa5a9('0x32')],qs['fields'](_0xa5a40a[_0xa5a9('0x36')][_0xa5a9('0x38')]));_0x321376[_0xa5a9('0x37')]=_0x321376[_0xa5a9('0x37')][_0xa5a9('0x39')]?_0x321376['attributes']:_0x382857[_0xa5a9('0x32')];if(!_0xa5a40a[_0xa5a9('0x36')]['hasOwnProperty'](_0xa5a9('0x3a'))){_0x321376['limit']=qs[_0xa5a9('0x1e')](_0xa5a40a[_0xa5a9('0x36')][_0xa5a9('0x1e')]);_0x321376['offset']=qs['offset'](_0xa5a40a[_0xa5a9('0x36')]['offset']);}_0x321376[_0xa5a9('0x3b')]=qs[_0xa5a9('0x3c')](_0xa5a40a[_0xa5a9('0x36')][_0xa5a9('0x3c')]);_0x321376[_0xa5a9('0x3d')]=qs[_0xa5a9('0x34')](_[_0xa5a9('0x3e')](_0xa5a40a[_0xa5a9('0x36')],_0x382857[_0xa5a9('0x34')]),_0x47e3dc);if(_0xa5a40a[_0xa5a9('0x36')][_0xa5a9('0x3f')]){_0x321376[_0xa5a9('0x3d')]=_[_0xa5a9('0x40')](_0x321376[_0xa5a9('0x3d')],{'$or':_['map'](_0x47e3dc,function(_0x3dac46){if(_0x3dac46[_0xa5a9('0x30')]!==_0xa5a9('0x41')){var _0x51a9a2={};_0x51a9a2[_0x3dac46[_0xa5a9('0x2c')]]={'$like':'%'+_0xa5a40a[_0xa5a9('0x36')][_0xa5a9('0x3f')]+'%'};return _0x51a9a2;}})});}_0x321376=_[_0xa5a9('0x40')]({},_0x321376,_0xa5a40a[_0xa5a9('0x42')]);var _0x5523b9={'where':_0x321376['where']};return db[_0xa5a9('0x43')][_0xa5a9('0x1c')](_0x5523b9)[_0xa5a9('0x26')](function(_0x5e3265){_0x3a670f[_0xa5a9('0x1c')]=_0x5e3265;if(_0xa5a40a['query'][_0xa5a9('0x44')]){_0x321376[_0xa5a9('0x45')]=[{'all':!![]}];}return db[_0xa5a9('0x43')]['findAll'](_0x321376);})[_0xa5a9('0x26')](function(_0x104a24){_0x3a670f[_0xa5a9('0x46')]=_0x104a24;return _0x3a670f;})['then'](respondWithFilteredResult(_0x542b72,_0x321376))[_0xa5a9('0x47')](handleError(_0x542b72,null));};exports[_0xa5a9('0x48')]=function(_0x3c262f,_0x1dce69){var _0x1c5a55={'raw':!![],'where':{'id':_0x3c262f[_0xa5a9('0x49')]['id']}},_0x3c16f5={};_0x3c16f5[_0xa5a9('0x32')]=_[_0xa5a9('0x33')](db['Variable'][_0xa5a9('0x2f')]);_0x3c16f5[_0xa5a9('0x36')]=_[_0xa5a9('0x33')](_0x3c262f[_0xa5a9('0x36')]);_0x3c16f5['filters']=_[_0xa5a9('0x35')](_0x3c16f5[_0xa5a9('0x32')],_0x3c16f5[_0xa5a9('0x36')]);_0x1c5a55[_0xa5a9('0x37')]=_[_0xa5a9('0x35')](_0x3c16f5[_0xa5a9('0x32')],qs[_0xa5a9('0x38')](_0x3c262f[_0xa5a9('0x36')][_0xa5a9('0x38')]));_0x1c5a55[_0xa5a9('0x37')]=_0x1c5a55['attributes']['length']?_0x1c5a55[_0xa5a9('0x37')]:_0x3c16f5[_0xa5a9('0x32')];if(_0x3c262f['query']['includeAll']){_0x1c5a55['include']=[{'all':!![]}];}_0x1c5a55=_[_0xa5a9('0x40')]({},_0x1c5a55,_0x3c262f['options']);return db[_0xa5a9('0x43')]['find'](_0x1c5a55)[_0xa5a9('0x26')](handleEntityNotFound(_0x1dce69,null))[_0xa5a9('0x26')](respondWithResult(_0x1dce69,null))['catch'](handleError(_0x1dce69,null));};exports[_0xa5a9('0x4a')]=function(_0x5b1033,_0x4b351d){return db['Variable'][_0xa5a9('0x4a')](_0x5b1033[_0xa5a9('0x4b')],{})[_0xa5a9('0x26')](function(_0x54621e){var _0x8004f=_0x5b1033['user'][_0xa5a9('0x28')]({'plain':!![]});if(!_0x8004f)throw new Error(_0xa5a9('0x4c'));if(_0x8004f['role']===_0xa5a9('0x4d')){var _0x32c378=_0x54621e[_0xa5a9('0x28')]({'plain':!![]});var _0x4d8941=_0xa5a9('0x29');return db[_0xa5a9('0x4e')]['find']({'where':{'name':_0x4d8941,'userProfileId':_0x8004f[_0xa5a9('0x4f')]},'raw':!![]})[_0xa5a9('0x26')](function(_0x669d94){if(_0x669d94&&_0x669d94['autoAssociation']===0x0){return db[_0xa5a9('0x2a')]['create']({'name':_0x32c378['name'],'resourceId':_0x32c378['id'],'type':_0x669d94[_0xa5a9('0x2c')],'sectionId':_0x669d94['id']},{})[_0xa5a9('0x26')](function(){return _0x54621e;});}else{return _0x54621e;}})[_0xa5a9('0x47')](function(_0x2e0ba3){logger[_0xa5a9('0x50')](_0xa5a9('0x51'),_0x2e0ba3);throw _0x2e0ba3;});}return _0x54621e;})['then'](respondWithResult(_0x4b351d,0xc9))[_0xa5a9('0x47')](handleError(_0x4b351d,null));};exports[_0xa5a9('0x25')]=function(_0x5e4a3d,_0x6d0731){if(_0x5e4a3d[_0xa5a9('0x4b')]['id']){delete _0x5e4a3d[_0xa5a9('0x4b')]['id'];}return db['Variable'][_0xa5a9('0x52')]({'where':{'id':_0x5e4a3d[_0xa5a9('0x49')]['id']}})[_0xa5a9('0x26')](handleEntityNotFound(_0x6d0731,null))[_0xa5a9('0x26')](saveUpdates(_0x5e4a3d[_0xa5a9('0x4b')],null))['then'](respondWithResult(_0x6d0731,null))[_0xa5a9('0x47')](handleError(_0x6d0731,null));};exports[_0xa5a9('0x27')]=function(_0xceda3c,_0x21721d){return db[_0xa5a9('0x43')][_0xa5a9('0x52')]({'where':{'id':_0xceda3c[_0xa5a9('0x49')]['id']}})['then'](handleEntityNotFound(_0x21721d,null))[_0xa5a9('0x26')](removeEntity(_0x21721d,null))['catch'](handleError(_0x21721d,null));}; \ No newline at end of file +var _0xffb0=['filter','merge','VIRTUAL','options','count','includeAll','show','params','keys','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','Variable','rawAttributes','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick'];(function(_0x214c7c,_0x3f8be3){var _0x52192c=function(_0x521810){while(--_0x521810){_0x214c7c['push'](_0x214c7c['shift']());}};_0x52192c(++_0x3f8be3);}(_0xffb0,0x1d5));var _0x0ffb=function(_0x47f3f2,_0x45fb40){_0x47f3f2=_0x47f3f2-0x0;var _0xfb1613=_0xffb0[_0x47f3f2];return _0xfb1613;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0ffb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ffb('0x1'));var rp=require(_0x0ffb('0x2'));var moment=require('moment');var BPromise=require(_0x0ffb('0x3'));var Mustache=require(_0x0ffb('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0ffb('0x5'));var csv=require(_0x0ffb('0x6'));var ejs=require(_0x0ffb('0x7'));var fs=require('fs');var _=require(_0x0ffb('0x8'));var squel=require(_0x0ffb('0x9'));var crypto=require('crypto');var jsforce=require(_0x0ffb('0xa'));var deskjs=require(_0x0ffb('0xb'));var toCsv=require(_0x0ffb('0x6'));var querystring=require(_0x0ffb('0xc'));var Papa=require('papaparse');var Redis=require(_0x0ffb('0xd'));var authService=require(_0x0ffb('0xe'));var qs=require(_0x0ffb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0ffb('0x10'));var utils=require(_0x0ffb('0x11'));var config=require(_0x0ffb('0x12'));var db=require(_0x0ffb('0x13'))['db'];function respondWithStatusCode(_0xfed812,_0x28b254){_0x28b254=_0x28b254||0xcc;return function(_0x4449e7){if(_0x4449e7){return _0xfed812[_0x0ffb('0x14')](_0x28b254);}return _0xfed812[_0x0ffb('0x15')](_0x28b254)[_0x0ffb('0x16')]();};}function respondWithResult(_0x3b183f,_0x566357){_0x566357=_0x566357||0xc8;return function(_0x18bb87){if(_0x18bb87){return _0x3b183f[_0x0ffb('0x15')](_0x566357)[_0x0ffb('0x17')](_0x18bb87);}};}function respondWithFilteredResult(_0x5016d7,_0x4f4f17){return function(_0x55d5d2){if(_0x55d5d2){var _0x1eec24=_0x55d5d2['count'],_0x38cb12=_0x4f4f17[_0x0ffb('0x18')],_0x296221=_0x4f4f17['offset']+_0x4f4f17['limit'],_0x3d204e;if(_0x296221>=_0x1eec24){_0x296221=_0x1eec24;_0x3d204e=0xc8;}else{_0x3d204e=0xce;}_0x5016d7[_0x0ffb('0x15')](_0x3d204e);return _0x5016d7[_0x0ffb('0x19')](_0x0ffb('0x1a'),_0x38cb12+'-'+_0x296221+'/'+_0x1eec24)[_0x0ffb('0x17')](_0x55d5d2);}return null;};}function patchUpdates(_0x1ab7f1){return function(_0x529eb2){try{jsonpatch[_0x0ffb('0x1b')](_0x529eb2,_0x1ab7f1,!![]);}catch(_0x45124e){return BPromise['reject'](_0x45124e);}return _0x529eb2['save']();};}function saveUpdates(_0xf5e5c8,_0x4a0309){return function(_0x2ffd49){if(_0x2ffd49){return _0x2ffd49[_0x0ffb('0x1c')](_0xf5e5c8)[_0x0ffb('0x1d')](function(_0x275306){return _0x275306;});}return null;};}function removeEntity(_0x107f54,_0x205cf6){return function(_0x3de305){if(_0x3de305){return _0x3de305[_0x0ffb('0x1e')]()[_0x0ffb('0x1d')](function(){var _0xc3ee8=_0x3de305[_0x0ffb('0x1f')]({'plain':!![]});var _0x4aaa07=_0x0ffb('0x20');return db[_0x0ffb('0x21')][_0x0ffb('0x1e')]({'where':{'type':_0x4aaa07,'resourceId':_0xc3ee8['id']}})[_0x0ffb('0x1d')](function(){return _0x3de305;});})[_0x0ffb('0x1d')](function(){_0x107f54[_0x0ffb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x566d0a,_0x10a756){return function(_0x12ef5f){if(!_0x12ef5f){_0x566d0a['sendStatus'](0x194);}return _0x12ef5f;};}function handleError(_0x1709eb,_0x3ede70){_0x3ede70=_0x3ede70||0x1f4;return function(_0x2588e6){logger[_0x0ffb('0x22')](_0x2588e6['stack']);if(_0x2588e6[_0x0ffb('0x23')]){delete _0x2588e6[_0x0ffb('0x23')];}_0x1709eb[_0x0ffb('0x15')](_0x3ede70)[_0x0ffb('0x24')](_0x2588e6);};}exports[_0x0ffb('0x25')]=function(_0x3aa368,_0xa210){var _0x5a9543={},_0x8a52f7={},_0x35ab6e={'count':0x0,'rows':[]};var _0x10e6ee=_['map'](db[_0x0ffb('0x26')][_0x0ffb('0x27')],function(_0x2a1b70){return{'name':_0x2a1b70['fieldName'],'type':_0x2a1b70[_0x0ffb('0x28')][_0x0ffb('0x29')]};});_0x8a52f7['model']=_[_0x0ffb('0x2a')](_0x10e6ee,_0x0ffb('0x23'));_0x8a52f7[_0x0ffb('0x2b')]=_['keys'](_0x3aa368[_0x0ffb('0x2b')]);_0x8a52f7[_0x0ffb('0x2c')]=_['intersection'](_0x8a52f7[_0x0ffb('0x2d')],_0x8a52f7[_0x0ffb('0x2b')]);_0x5a9543[_0x0ffb('0x2e')]=_[_0x0ffb('0x2f')](_0x8a52f7[_0x0ffb('0x2d')],qs['fields'](_0x3aa368[_0x0ffb('0x2b')][_0x0ffb('0x30')]));_0x5a9543[_0x0ffb('0x2e')]=_0x5a9543[_0x0ffb('0x2e')][_0x0ffb('0x31')]?_0x5a9543[_0x0ffb('0x2e')]:_0x8a52f7['model'];if(!_0x3aa368[_0x0ffb('0x2b')][_0x0ffb('0x32')](_0x0ffb('0x33'))){_0x5a9543[_0x0ffb('0x34')]=qs[_0x0ffb('0x34')](_0x3aa368['query'][_0x0ffb('0x34')]);_0x5a9543[_0x0ffb('0x18')]=qs[_0x0ffb('0x18')](_0x3aa368['query'][_0x0ffb('0x18')]);}_0x5a9543['order']=qs['sort'](_0x3aa368[_0x0ffb('0x2b')][_0x0ffb('0x35')]);_0x5a9543[_0x0ffb('0x36')]=qs[_0x0ffb('0x2c')](_[_0x0ffb('0x37')](_0x3aa368['query'],_0x8a52f7[_0x0ffb('0x2c')]),_0x10e6ee);if(_0x3aa368['query'][_0x0ffb('0x38')]){_0x5a9543['where']=_[_0x0ffb('0x39')](_0x5a9543[_0x0ffb('0x36')],{'$or':_[_0x0ffb('0x2a')](_0x10e6ee,function(_0x2260e3){if(_0x2260e3[_0x0ffb('0x28')]!==_0x0ffb('0x3a')){var _0xf0711a={};_0xf0711a[_0x2260e3[_0x0ffb('0x23')]]={'$like':'%'+_0x3aa368[_0x0ffb('0x2b')]['filter']+'%'};return _0xf0711a;}})});}_0x5a9543=_[_0x0ffb('0x39')]({},_0x5a9543,_0x3aa368[_0x0ffb('0x3b')]);var _0x56dbe1={'where':_0x5a9543[_0x0ffb('0x36')]};return db[_0x0ffb('0x26')][_0x0ffb('0x3c')](_0x56dbe1)['then'](function(_0x540e0f){_0x35ab6e['count']=_0x540e0f;if(_0x3aa368[_0x0ffb('0x2b')][_0x0ffb('0x3d')]){_0x5a9543['include']=[{'all':!![]}];}return db[_0x0ffb('0x26')]['findAll'](_0x5a9543);})[_0x0ffb('0x1d')](function(_0x1edd2a){_0x35ab6e['rows']=_0x1edd2a;return _0x35ab6e;})[_0x0ffb('0x1d')](respondWithFilteredResult(_0xa210,_0x5a9543))['catch'](handleError(_0xa210,null));};exports[_0x0ffb('0x3e')]=function(_0x2c577f,_0x3f7e82){var _0x15a5d6={'raw':!![],'where':{'id':_0x2c577f[_0x0ffb('0x3f')]['id']}},_0x117644={};_0x117644[_0x0ffb('0x2d')]=_[_0x0ffb('0x40')](db['Variable']['rawAttributes']);_0x117644['query']=_['keys'](_0x2c577f['query']);_0x117644[_0x0ffb('0x2c')]=_[_0x0ffb('0x2f')](_0x117644[_0x0ffb('0x2d')],_0x117644['query']);_0x15a5d6[_0x0ffb('0x2e')]=_[_0x0ffb('0x2f')](_0x117644['model'],qs['fields'](_0x2c577f[_0x0ffb('0x2b')][_0x0ffb('0x30')]));_0x15a5d6[_0x0ffb('0x2e')]=_0x15a5d6['attributes'][_0x0ffb('0x31')]?_0x15a5d6[_0x0ffb('0x2e')]:_0x117644['model'];if(_0x2c577f[_0x0ffb('0x2b')]['includeAll']){_0x15a5d6[_0x0ffb('0x41')]=[{'all':!![]}];}_0x15a5d6=_[_0x0ffb('0x39')]({},_0x15a5d6,_0x2c577f[_0x0ffb('0x3b')]);return db['Variable']['find'](_0x15a5d6)['then'](handleEntityNotFound(_0x3f7e82,null))[_0x0ffb('0x1d')](respondWithResult(_0x3f7e82,null))[_0x0ffb('0x42')](handleError(_0x3f7e82,null));};exports[_0x0ffb('0x43')]=function(_0x3b6f5b,_0x19cea0){return db[_0x0ffb('0x26')]['create'](_0x3b6f5b['body'],{})[_0x0ffb('0x1d')](function(_0x4b0cc6){var _0x2e1905=_0x3b6f5b['user'][_0x0ffb('0x1f')]({'plain':!![]});if(!_0x2e1905)throw new Error(_0x0ffb('0x44'));if(_0x2e1905[_0x0ffb('0x45')]===_0x0ffb('0x46')){var _0x1f3453=_0x4b0cc6['get']({'plain':!![]});var _0xfb1768=_0x0ffb('0x20');return db['UserProfileSection']['find']({'where':{'name':_0xfb1768,'userProfileId':_0x2e1905['userProfileId']},'raw':!![]})['then'](function(_0x21404e){if(_0x21404e&&_0x21404e[_0x0ffb('0x47')]===0x0){return db[_0x0ffb('0x21')][_0x0ffb('0x43')]({'name':_0x1f3453[_0x0ffb('0x23')],'resourceId':_0x1f3453['id'],'type':_0x21404e[_0x0ffb('0x23')],'sectionId':_0x21404e['id']},{})['then'](function(){return _0x4b0cc6;});}else{return _0x4b0cc6;}})[_0x0ffb('0x42')](function(_0x2ab5b6){logger[_0x0ffb('0x22')](_0x0ffb('0x48'),_0x2ab5b6);throw _0x2ab5b6;});}return _0x4b0cc6;})[_0x0ffb('0x1d')](respondWithResult(_0x19cea0,0xc9))[_0x0ffb('0x42')](handleError(_0x19cea0,null));};exports[_0x0ffb('0x1c')]=function(_0x43a6a9,_0x361d48){if(_0x43a6a9[_0x0ffb('0x49')]['id']){delete _0x43a6a9[_0x0ffb('0x49')]['id'];}return db[_0x0ffb('0x26')][_0x0ffb('0x4a')]({'where':{'id':_0x43a6a9[_0x0ffb('0x3f')]['id']}})[_0x0ffb('0x1d')](handleEntityNotFound(_0x361d48,null))[_0x0ffb('0x1d')](saveUpdates(_0x43a6a9[_0x0ffb('0x49')],null))['then'](respondWithResult(_0x361d48,null))[_0x0ffb('0x42')](handleError(_0x361d48,null));};exports[_0x0ffb('0x1e')]=function(_0x12ff1d,_0x27b569){return db['Variable'][_0x0ffb('0x4a')]({'where':{'id':_0x12ff1d[_0x0ffb('0x3f')]['id']}})[_0x0ffb('0x1d')](handleEntityNotFound(_0x27b569,null))['then'](removeEntity(_0x27b569,null))[_0x0ffb('0x42')](handleError(_0x27b569,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8aeb379..a38ff96 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 _0x8165=['request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','api','moment'];(function(_0x3b38c3,_0x4e1d40){var _0x4adfca=function(_0x53d15f){while(--_0x53d15f){_0x3b38c3['push'](_0x3b38c3['shift']());}};_0x4adfca(++_0x4e1d40);}(_0x8165,0x154));var _0x5816=function(_0x57ac32,_0x11e19c){_0x57ac32=_0x57ac32-0x0;var _0x51ea48=_0x8165[_0x57ac32];return _0x51ea48;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5816('0x0'));var moment=require(_0x5816('0x1'));var BPromise=require('bluebird');var rp=require(_0x5816('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5816('0x3'));var config=require(_0x5816('0x4'));var attributes=require(_0x5816('0x5'));module[_0x5816('0x6')]=function(_0xf33a13,_0x58e2b9){return _0xf33a13[_0x5816('0x7')]('Variable',attributes,{'tableName':_0x5816('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf937=['../../config/environment','./variable.attributes','exports','tools_variables','lodash','util','moment','bluebird','path','rimraf'];(function(_0x5e1d9b,_0x53fdbd){var _0x5761b0=function(_0x21fde8){while(--_0x21fde8){_0x5e1d9b['push'](_0x5e1d9b['shift']());}};_0x5761b0(++_0x53fdbd);}(_0xf937,0x1e4));var _0x7f93=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xf937[_0x4207f4];return _0x29a621;};'use strict';var _=require(_0x7f93('0x0'));var util=require(_0x7f93('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7f93('0x2'));var BPromise=require(_0x7f93('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f93('0x4'));var rimraf=require(_0x7f93('0x5'));var config=require(_0x7f93('0x6'));var attributes=require(_0x7f93('0x7'));module[_0x7f93('0x8')]=function(_0x1eaca8,_0x329996){return _0x1eaca8['define']('Variable',attributes,{'tableName':_0x7f93('0x9'),'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 0385a13..45425c2 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 _0x4da5=['../../config/environment','jayson/promise','client','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x4da5,0x10e));var _0x54da=function(_0x5f07cb,_0x230497){_0x5f07cb=_0x5f07cb-0x0;var _0x22c5aa=_0x4da5[_0x5f07cb];return _0x22c5aa;};'use strict';var _=require(_0x54da('0x0'));var util=require(_0x54da('0x1'));var moment=require(_0x54da('0x2'));var BPromise=require(_0x54da('0x3'));var rs=require(_0x54da('0x4'));var fs=require('fs');var Redis=require(_0x54da('0x5'));var db=require(_0x54da('0x6'))['db'];var utils=require(_0x54da('0x7'));var logger=require('../../config/logger')(_0x54da('0x8'));var config=require(_0x54da('0x9'));var jayson=require(_0x54da('0xa'));var client=jayson[_0x54da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c0f9a,_0x497a7c,_0x1dd2b9){return new BPromise(function(_0x18ac75,_0x31973e){return client['request'](_0x5c0f9a,_0x1dd2b9)[_0x54da('0xc')](function(_0x4a2a93){logger[_0x54da('0xd')](_0x54da('0xe'),_0x497a7c,'request\x20sent');logger[_0x54da('0xf')](_0x54da('0x10'),_0x497a7c,'request\x20sent',JSON[_0x54da('0x11')](_0x4a2a93));if(_0x4a2a93['error']){if(_0x4a2a93[_0x54da('0x12')][_0x54da('0x13')]===0x1f4){logger[_0x54da('0x12')](_0x54da('0xe'),_0x497a7c,_0x4a2a93[_0x54da('0x12')][_0x54da('0x14')]);return _0x31973e(_0x4a2a93[_0x54da('0x12')]['message']);}logger[_0x54da('0x12')](_0x54da('0xe'),_0x497a7c,_0x4a2a93[_0x54da('0x12')]['message']);return _0x18ac75(_0x4a2a93[_0x54da('0x12')]['message']);}else{logger[_0x54da('0xd')](_0x54da('0xe'),_0x497a7c,'request\x20sent');_0x18ac75(_0x4a2a93[_0x54da('0x15')][_0x54da('0x14')]);}})[_0x54da('0x16')](function(_0x2557c3){logger[_0x54da('0x12')](_0x54da('0xe'),_0x497a7c,_0x2557c3);_0x31973e(_0x2557c3);});});}exports[_0x54da('0x17')]=function(_0x820538){var _0x59242b=this;return new Promise(function(_0x49fa51,_0x4e29c){return db['Variable'][_0x54da('0x18')]({'raw':_0x820538[_0x54da('0x19')]?_0x820538[_0x54da('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x820538[_0x54da('0x19')]?_0x820538[_0x54da('0x19')][_0x54da('0x1a')]||null:null,'attributes':_0x820538['options']?_0x820538['options'][_0x54da('0x1b')]||null:null,'include':_0x820538[_0x54da('0x19')]?_0x820538[_0x54da('0x19')][_0x54da('0x1c')]?_[_0x54da('0x1d')](_0x820538['options'][_0x54da('0x1c')],function(_0x7f9f79){return{'model':db[_0x7f9f79[_0x54da('0x1e')]],'as':_0x7f9f79['as'],'attributes':_0x7f9f79[_0x54da('0x1b')],'include':_0x7f9f79['include']?_[_0x54da('0x1d')](_0x7f9f79['include'],function(_0x3725d0){return{'model':db[_0x3725d0[_0x54da('0x1e')]],'as':_0x3725d0['as'],'attributes':_0x3725d0[_0x54da('0x1b')],'include':_0x3725d0['include']?_['map'](_0x3725d0['include'],function(_0x2374c9){return{'model':db[_0x2374c9[_0x54da('0x1e')]],'as':_0x2374c9['as'],'attributes':_0x2374c9[_0x54da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x54da('0xc')](function(_0x164938){logger['info'](_0x54da('0x17'),_0x820538);logger[_0x54da('0xf')](_0x54da('0x17'),_0x820538,JSON[_0x54da('0x11')](_0x164938));_0x49fa51(_0x164938);})[_0x54da('0x16')](function(_0x1cb225){logger[_0x54da('0x12')]('ShowVariable',_0x1cb225['message'],_0x820538);_0x4e29c(_0x59242b['error'](0x1f4,_0x1cb225[_0x54da('0x14')]));});});}; \ No newline at end of file +var _0xceb2=['Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','options','raw','where','include','attributes','model','ShowVariable','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Variable,\x20%s,\x20%s','debug'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0xceb2,0xc4));var _0x2ceb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xceb2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ceb('0x0'));var util=require('util');var moment=require(_0x2ceb('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ceb('0x2'));var fs=require('fs');var Redis=require(_0x2ceb('0x3'));var db=require(_0x2ceb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ceb('0x5'))(_0x2ceb('0x6'));var config=require(_0x2ceb('0x7'));var jayson=require(_0x2ceb('0x8'));var client=jayson[_0x2ceb('0x9')][_0x2ceb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7b90,_0xf567f0,_0xe83a23){return new BPromise(function(_0x2f960a,_0x54e6c0){return client['request'](_0x3f7b90,_0xe83a23)[_0x2ceb('0xb')](function(_0x4b2c98){logger['info'](_0x2ceb('0xc'),_0xf567f0,'request\x20sent');logger[_0x2ceb('0xd')](_0x2ceb('0xe'),_0xf567f0,_0x2ceb('0xf'),JSON['stringify'](_0x4b2c98));if(_0x4b2c98['error']){if(_0x4b2c98[_0x2ceb('0x10')][_0x2ceb('0x11')]===0x1f4){logger['error'](_0x2ceb('0xc'),_0xf567f0,_0x4b2c98[_0x2ceb('0x10')][_0x2ceb('0x12')]);return _0x54e6c0(_0x4b2c98[_0x2ceb('0x10')][_0x2ceb('0x12')]);}logger['error'](_0x2ceb('0xc'),_0xf567f0,_0x4b2c98['error'][_0x2ceb('0x12')]);return _0x2f960a(_0x4b2c98[_0x2ceb('0x10')][_0x2ceb('0x12')]);}else{logger[_0x2ceb('0x13')]('Variable,\x20%s,\x20%s',_0xf567f0,_0x2ceb('0xf'));_0x2f960a(_0x4b2c98[_0x2ceb('0x14')][_0x2ceb('0x12')]);}})[_0x2ceb('0x15')](function(_0x42b6ba){logger[_0x2ceb('0x10')](_0x2ceb('0xc'),_0xf567f0,_0x42b6ba);_0x54e6c0(_0x42b6ba);});});}exports['ShowVariable']=function(_0x2c541c){var _0x3200ac=this;return new Promise(function(_0x3e8d1e,_0x283c2a){return db['Variable']['find']({'raw':_0x2c541c[_0x2ceb('0x16')]?_0x2c541c[_0x2ceb('0x16')][_0x2ceb('0x17')]===undefined?!![]:![]:!![],'where':_0x2c541c['options']?_0x2c541c[_0x2ceb('0x16')][_0x2ceb('0x18')]||null:null,'attributes':_0x2c541c[_0x2ceb('0x16')]?_0x2c541c[_0x2ceb('0x16')]['attributes']||null:null,'include':_0x2c541c['options']?_0x2c541c['options']['include']?_['map'](_0x2c541c[_0x2ceb('0x16')][_0x2ceb('0x19')],function(_0x30b885){return{'model':db[_0x30b885['model']],'as':_0x30b885['as'],'attributes':_0x30b885['attributes'],'include':_0x30b885[_0x2ceb('0x19')]?_['map'](_0x30b885[_0x2ceb('0x19')],function(_0x4c066d){return{'model':db[_0x4c066d['model']],'as':_0x4c066d['as'],'attributes':_0x4c066d[_0x2ceb('0x1a')],'include':_0x4c066d['include']?_['map'](_0x4c066d[_0x2ceb('0x19')],function(_0x2efe56){return{'model':db[_0x2efe56[_0x2ceb('0x1b')]],'as':_0x2efe56['as'],'attributes':_0x2efe56[_0x2ceb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2ceb('0xb')](function(_0x290144){logger['info'](_0x2ceb('0x1c'),_0x2c541c);logger[_0x2ceb('0xd')](_0x2ceb('0x1c'),_0x2c541c,JSON[_0x2ceb('0x1d')](_0x290144));_0x3e8d1e(_0x290144);})[_0x2ceb('0x15')](function(_0x2362a1){logger[_0x2ceb('0x10')](_0x2ceb('0x1c'),_0x2362a1[_0x2ceb('0x12')],_0x2c541c);_0x283c2a(_0x3200ac[_0x2ceb('0x10')](0x1f4,_0x2362a1['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c828d86..342dda7 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 _0xb6fb=['migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','/pull','pull','/restart','/migrations'];(function(_0x471057,_0x238c77){var _0x84ba98=function(_0xaae7ad){while(--_0xaae7ad){_0x471057['push'](_0x471057['shift']());}};_0x84ba98(++_0x238c77);}(_0xb6fb,0x1c3));var _0xbb6f=function(_0x82993,_0x1499a1){_0x82993=_0x82993-0x0;var _0x5b0a22=_0xb6fb[_0x82993];return _0x5b0a22;};'use strict';var express=require(_0xbb6f('0x0'));var router=express[_0xbb6f('0x1')]();var auth=require(_0xbb6f('0x2'));var controller=require(_0xbb6f('0x3'));router[_0xbb6f('0x4')]('/',controller[_0xbb6f('0x5')]);router[_0xbb6f('0x4')](_0xbb6f('0x6'),auth[_0xbb6f('0x7')](),auth[_0xbb6f('0x8')](),controller['fetch']);router[_0xbb6f('0x4')](_0xbb6f('0x9'),auth[_0xbb6f('0x7')](),auth[_0xbb6f('0x8')](),controller['reset']);router[_0xbb6f('0x4')](_0xbb6f('0xa'),auth[_0xbb6f('0x7')](),auth['canUpdate'](),controller[_0xbb6f('0xb')]);router[_0xbb6f('0x4')](_0xbb6f('0xc'),auth['isAuthenticated'](),controller['restart']);router[_0xbb6f('0x4')](_0xbb6f('0xd'),controller[_0xbb6f('0xe')]);module['exports']=router; \ No newline at end of file +var _0x0e45=['../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router'];(function(_0x47994e,_0x270c34){var _0x1c55fb=function(_0x2e7b35){while(--_0x2e7b35){_0x47994e['push'](_0x47994e['shift']());}};_0x1c55fb(++_0x270c34);}(_0x0e45,0x18a));var _0x50e4=function(_0x3a1600,_0x460ef0){_0x3a1600=_0x3a1600-0x0;var _0xfc157f=_0x0e45[_0x3a1600];return _0xfc157f;};'use strict';var express=require(_0x50e4('0x0'));var router=express[_0x50e4('0x1')]();var auth=require(_0x50e4('0x2'));var controller=require(_0x50e4('0x3'));router[_0x50e4('0x4')]('/',controller[_0x50e4('0x5')]);router[_0x50e4('0x4')](_0x50e4('0x6'),auth[_0x50e4('0x7')](),auth[_0x50e4('0x8')](),controller[_0x50e4('0x9')]);router[_0x50e4('0x4')]('/reset',auth[_0x50e4('0x7')](),auth[_0x50e4('0x8')](),controller[_0x50e4('0xa')]);router['get'](_0x50e4('0xb'),auth[_0x50e4('0x7')](),auth['canUpdate'](),controller[_0x50e4('0xc')]);router[_0x50e4('0x4')](_0x50e4('0xd'),auth[_0x50e4('0x7')](),controller[_0x50e4('0xe')]);router[_0x50e4('0x4')](_0x50e4('0xf'),controller[_0x50e4('0x10')]);module[_0x50e4('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6234bea..ce93ec2 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 _0xe9ef=['../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','exports','version','query','latest','fetch','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','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.','root','migrations','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','exec'];(function(_0x20ed2e,_0x36655c){var _0x4d88c0=function(_0x1461c4){while(--_0x1461c4){_0x20ed2e['push'](_0x20ed2e['shift']());}};_0x4d88c0(++_0x36655c);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xe9ef[_0x3e91a9];return _0x25c9ad;};'use strict';var Umzug=require(_0xfe9e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xfe9e('0x1'));var pkginfo=require(_0xfe9e('0x2'))(module,'version');var compareVersions=require(_0xfe9e('0x3'));var exec=require('child_process')[_0xfe9e('0x4')];var db=require(_0xfe9e('0x5'))['db'];var config=require(_0xfe9e('0x6'));var pm2=require(_0xfe9e('0x7'));var logger=require('../../config/logger')(_0xfe9e('0x8'));var git=require(_0xfe9e('0x9'))(config['root']);exports['index']=function(_0x1ae09c,_0x51d134){var _0x4325a6={'current':module[_0xfe9e('0xa')][_0xfe9e('0xb')],'phonebar':0x2};if(_0x1ae09c['query']&&_0x1ae09c[_0xfe9e('0xc')][_0xfe9e('0xd')]){return git[_0xfe9e('0xe')]()['tags'](function(_0x1cc515,_0x48a289){_0x4325a6[_0xfe9e('0xd')]=(_0x1cc515?module[_0xfe9e('0xa')][_0xfe9e('0xb')]:_0x48a289[_0xfe9e('0xd')])||_0xfe9e('0xf');return _0x51d134[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')](_0x4325a6);});}else{return _0x51d134[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')](_0x4325a6);}};exports['fetch']=function(_0x2805cb,_0x173e46){return git['fetch']([_0xfe9e('0x12'),_0xfe9e('0x13')],function(_0x1af00c){if(_0x1af00c){logger[_0xfe9e('0x14')](_0x1af00c);return _0x173e46['status'](0x1f4)['json'](_0x1af00c);}logger[_0xfe9e('0x15')](_0xfe9e('0x16'));return _0x173e46[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xfe9e('0x17')]=function(_0x158cbf,_0xdf0a3b){return git[_0xfe9e('0x17')](['--hard',_0xfe9e('0x18')],function(_0x114434){if(_0x114434){logger[_0xfe9e('0x14')](_0x114434);return _0xdf0a3b[_0xfe9e('0x10')](0x1f4)[_0xfe9e('0x11')](_0x114434);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xdf0a3b[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')]({'output':_0xfe9e('0x19')});});};exports[_0xfe9e('0x1a')]=function(_0x1ad37a,_0x147ae5){exec(_0xfe9e('0x1b'),function(_0xb5d636,_0x3c0c92,_0xa7d9d8){logger[_0xfe9e('0x15')](_0x3c0c92);logger[_0xfe9e('0x15')](_0xa7d9d8);if(_0xb5d636){logger['error'](_0xb5d636);return _0x147ae5[_0xfe9e('0x10')](0x1f4)[_0xfe9e('0x11')](_0xb5d636);}return _0x147ae5['status'](0xc8)[_0xfe9e('0x11')]({'output':_0x3c0c92});});};exports['restart']=function(_0x73a9d1,_0x1df6cd){return pm2['restart'](_0xfe9e('0x1c'))[_0xfe9e('0x1d')](function(_0x28d2cb){logger[_0xfe9e('0x15')](_0xfe9e('0x1e'),_0x28d2cb);return _0x1df6cd[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')]({'output':_0xfe9e('0x1f')});})[_0xfe9e('0x20')](function(_0x3f7228){logger[_0xfe9e('0x14')](_0x3f7228);return _0x1df6cd[_0xfe9e('0x10')](0x1f4)[_0xfe9e('0x11')](_0x3f7228);});};exports['migrations']=function(_0x5687ed,_0x2ee15b){var _0x116b50=fs[_0xfe9e('0x21')](path[_0xfe9e('0x22')](config['root'],_0xfe9e('0x23'),'migrations'));var _0x55b08a=[];for(var _0x4fcc67=0x0;_0x4fcc67<_0x116b50[_0xfe9e('0x24')];_0x4fcc67++){var _0x291a49=_0x116b50[_0x4fcc67][_0xfe9e('0x25')]('.js','');if(compareVersions(module['exports'][_0xfe9e('0xb')],_0x291a49)===-0x1){_0x55b08a[_0xfe9e('0x26')](_0x291a49);}}if(_0x55b08a[_0xfe9e('0x24')]){var _0x3d8d36=_0x55b08a[_0xfe9e('0x27')](compareVersions);var _0x502368=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xfe9e('0x28')],'modelName':_0xfe9e('0x28'),'columnName':_0xfe9e('0xb')},'migrations':{'params':[db[_0xfe9e('0x29')][_0xfe9e('0x2a')](),db[_0xfe9e('0x29')][_0xfe9e('0x2b')],function(){throw new Error(_0xfe9e('0x2c'));}],'path':path['join'](config[_0xfe9e('0x2d')],_0xfe9e('0x23'),_0xfe9e('0x2e')),'pattern':/\.js$/}});_0x502368['up']({'migrations':_['map'](_0x3d8d36,function(_0x2f52c7){return _0x2f52c7+_0xfe9e('0x2f');})})['then'](function(){return _0x2ee15b['status'](0xc8)[_0xfe9e('0x11')]({'output':_0xfe9e('0x30')+module[_0xfe9e('0xa')][_0xfe9e('0xb')]+_0xfe9e('0x31')+_[_0xfe9e('0x32')](_0x3d8d36),'migrations':_[_0xfe9e('0x22')](_0x3d8d36)});})['catch'](function(_0x4c148e){if(_0x4c148e instanceof db[_0xfe9e('0x29')][_0xfe9e('0x33')]){return _0x2ee15b[_0xfe9e('0x10')](0xc8)[_0xfe9e('0x11')]({'output':_0xfe9e('0x34')});}else{return _0x2ee15b[_0xfe9e('0x10')](0x1f4)[_0xfe9e('0x11')](_0x4c148e);}});}else{return _0x2ee15b['status'](0xc8)[_0xfe9e('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xfb11=['.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','exec','../../config/environment','../../config/pm2','update','simple-git','index','exports','version','query','latest','fetch','2.0.0','status','json','origin','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root','server','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xfb11[_0x4fc9e6];return _0x551d28;};'use strict';var Umzug=require(_0x1fb1('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1fb1('0x1'));var pkginfo=require(_0x1fb1('0x2'))(module,'version');var compareVersions=require(_0x1fb1('0x3'));var exec=require('child_process')[_0x1fb1('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x1fb1('0x5'));var pm2=require(_0x1fb1('0x6'));var logger=require('../../config/logger')(_0x1fb1('0x7'));var git=require(_0x1fb1('0x8'))(config['root']);exports[_0x1fb1('0x9')]=function(_0x2596c2,_0x34e61a){var _0x236b20={'current':module[_0x1fb1('0xa')][_0x1fb1('0xb')],'phonebar':0x2};if(_0x2596c2[_0x1fb1('0xc')]&&_0x2596c2[_0x1fb1('0xc')][_0x1fb1('0xd')]){return git[_0x1fb1('0xe')]()['tags'](function(_0x232036,_0x53f30e){_0x236b20[_0x1fb1('0xd')]=(_0x232036?module['exports'][_0x1fb1('0xb')]:_0x53f30e[_0x1fb1('0xd')])||_0x1fb1('0xf');return _0x34e61a[_0x1fb1('0x10')](0xc8)[_0x1fb1('0x11')](_0x236b20);});}else{return _0x34e61a[_0x1fb1('0x10')](0xc8)['json'](_0x236b20);}};exports[_0x1fb1('0xe')]=function(_0xf371e8,_0x2c5be1){return git[_0x1fb1('0xe')]([_0x1fb1('0x12'),_0x1fb1('0x13')],function(_0x151152){if(_0x151152){logger[_0x1fb1('0x14')](_0x151152);return _0x2c5be1[_0x1fb1('0x10')](0x1f4)['json'](_0x151152);}logger['info'](_0x1fb1('0x15'));return _0x2c5be1[_0x1fb1('0x10')](0xc8)[_0x1fb1('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x1fb1('0x16')]=function(_0x23f1f5,_0x24d4df){return git[_0x1fb1('0x16')]([_0x1fb1('0x17'),_0x1fb1('0x18')],function(_0x10df7b){if(_0x10df7b){logger[_0x1fb1('0x14')](_0x10df7b);return _0x24d4df[_0x1fb1('0x10')](0x1f4)['json'](_0x10df7b);}logger[_0x1fb1('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x24d4df['status'](0xc8)[_0x1fb1('0x11')]({'output':_0x1fb1('0x1a')});});};exports[_0x1fb1('0x1b')]=function(_0x54ad97,_0x12df9f){exec('npm\x20install\x20--production',function(_0x5c76f5,_0x532c63,_0x31178c){logger[_0x1fb1('0x19')](_0x532c63);logger[_0x1fb1('0x19')](_0x31178c);if(_0x5c76f5){logger[_0x1fb1('0x14')](_0x5c76f5);return _0x12df9f[_0x1fb1('0x10')](0x1f4)['json'](_0x5c76f5);}return _0x12df9f[_0x1fb1('0x10')](0xc8)[_0x1fb1('0x11')]({'output':_0x532c63});});};exports[_0x1fb1('0x1c')]=function(_0x5fc9e6,_0x2bc885){return pm2[_0x1fb1('0x1c')](_0x1fb1('0x1d'))[_0x1fb1('0x1e')](function(_0x530a5e){logger[_0x1fb1('0x19')](_0x1fb1('0x1f'),_0x530a5e);return _0x2bc885[_0x1fb1('0x10')](0xc8)[_0x1fb1('0x11')]({'output':_0x1fb1('0x20')});})[_0x1fb1('0x21')](function(_0x1a74c4){logger[_0x1fb1('0x14')](_0x1a74c4);return _0x2bc885[_0x1fb1('0x10')](0x1f4)[_0x1fb1('0x11')](_0x1a74c4);});};exports[_0x1fb1('0x22')]=function(_0x497017,_0x39fc43){var _0xe8ec0a=fs[_0x1fb1('0x23')](path['join'](config[_0x1fb1('0x24')],_0x1fb1('0x25'),_0x1fb1('0x22')));var _0x1b71cb=[];for(var _0x5402e9=0x0;_0x5402e9<_0xe8ec0a[_0x1fb1('0x26')];_0x5402e9++){var _0x30c8eb=_0xe8ec0a[_0x5402e9]['replace'](_0x1fb1('0x27'),'');if(compareVersions(module['exports']['version'],_0x30c8eb)===-0x1){_0x1b71cb[_0x1fb1('0x28')](_0x30c8eb);}}if(_0x1b71cb[_0x1fb1('0x26')]){var _0x54e813=_0x1b71cb[_0x1fb1('0x29')](compareVersions);var _0x149753=new Umzug({'storage':_0x1fb1('0x2a'),'storageOptions':{'model':db[_0x1fb1('0x2b')],'modelName':_0x1fb1('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x1fb1('0x2a')][_0x1fb1('0x2c')](),db[_0x1fb1('0x2a')][_0x1fb1('0x2d')],function(){throw new Error(_0x1fb1('0x2e'));}],'path':path[_0x1fb1('0x2f')](config[_0x1fb1('0x24')],_0x1fb1('0x25'),_0x1fb1('0x22')),'pattern':/\.js$/}});_0x149753['up']({'migrations':_['map'](_0x54e813,function(_0x2d74b9){return _0x2d74b9+'.js';})})[_0x1fb1('0x1e')](function(){return _0x39fc43['status'](0xc8)[_0x1fb1('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x1fb1('0xb')]+_0x1fb1('0x30')+_[_0x1fb1('0x31')](_0x54e813),'migrations':_[_0x1fb1('0x2f')](_0x54e813)});})['catch'](function(_0x3b0642){if(_0x3b0642 instanceof db[_0x1fb1('0x2a')][_0x1fb1('0x32')]){return _0x39fc43['status'](0xc8)[_0x1fb1('0x11')]({'output':_0x1fb1('0x33')});}else{return _0x39fc43[_0x1fb1('0x10')](0x1f4)[_0x1fb1('0x11')](_0x3b0642);}});}else{return _0x39fc43[_0x1fb1('0x10')](0xc8)[_0x1fb1('0x11')]({'output':_0x1fb1('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 112e7e7..9e51cf9 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 _0x599b=['describe','show','post','put','update','/:id','destroy','exports','multer','util','express','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x599b,0x18f));var _0xb599=function(_0x596e9c,_0x571353){_0x596e9c=_0x596e9c-0x0;var _0x2f52d4=_0x599b[_0x596e9c];return _0x2f52d4;};'use strict';var multer=require(_0xb599('0x0'));var util=require(_0xb599('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb599('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb599('0x3'));var controller=require(_0xb599('0x4'));router[_0xb599('0x5')]('/',auth['isAuthenticated'](),controller[_0xb599('0x6')]);router['get'](_0xb599('0x7'),auth[_0xb599('0x8')](),controller[_0xb599('0x9')]);router[_0xb599('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xb599('0xa')]);router[_0xb599('0xb')]('/',auth[_0xb599('0x8')](),controller['create']);router[_0xb599('0xc')]('/:id',auth[_0xb599('0x8')](),controller[_0xb599('0xd')]);router['delete'](_0xb599('0xe'),auth[_0xb599('0x8')](),controller[_0xb599('0xf')]);module[_0xb599('0x10')]=router; \ No newline at end of file +var _0x6ab1=['put','/:id','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','show','post','create'];(function(_0x25b400,_0x135d12){var _0x4249ed=function(_0xce5811){while(--_0xce5811){_0x25b400['push'](_0x25b400['shift']());}};_0x4249ed(++_0x135d12);}(_0x6ab1,0x77));var _0x16ab=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x6ab1[_0x540133];return _0x26b6e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x16ab('0x0'));var timeout=require(_0x16ab('0x1'));var express=require(_0x16ab('0x2'));var router=express[_0x16ab('0x3')]();var auth=require(_0x16ab('0x4'));var interaction=require(_0x16ab('0x5'));var config=require(_0x16ab('0x6'));var controller=require(_0x16ab('0x7'));router[_0x16ab('0x8')]('/',auth[_0x16ab('0x9')](),controller['index']);router[_0x16ab('0x8')](_0x16ab('0xa'),auth[_0x16ab('0x9')](),controller['describe']);router[_0x16ab('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x16ab('0xb')]);router[_0x16ab('0xc')]('/',auth[_0x16ab('0x9')](),controller[_0x16ab('0xd')]);router[_0x16ab('0xe')](_0x16ab('0xf'),auth[_0x16ab('0x9')](),controller[_0x16ab('0x10')]);router[_0x16ab('0x11')]('/:id',auth[_0x16ab('0x9')](),controller['destroy']);module[_0x16ab('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 423474f..94c38d8 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 _0x7c09=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c09,0x102));var _0x97c0=function(_0x105758,_0x2518b9){_0x105758=_0x105758-0x0;var _0x4ffca2=_0x7c09[_0x105758];return _0x4ffca2;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'type':{'type':Sequelize[_0x97c0('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x97c0('0x1')]},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'queue':{'type':Sequelize[_0x97c0('0x1')]},'interface':{'type':Sequelize[_0x97c0('0x1')]},'membername':{'type':Sequelize[_0x97c0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x97c0('0x2')]},'agentconnectAt':{'type':Sequelize[_0x97c0('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x97c0('0x3')]},'agentcomplete':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x97c0('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97c0('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x97c0('0x1')]},'channel':{'type':Sequelize[_0x97c0('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x97c0('0x1')]},'connectedlinename':{'type':Sequelize[_0x97c0('0x1')]},'language':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'exten':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'destchannel':{'type':Sequelize[_0x97c0('0x1')]},'destchannelstate':{'type':Sequelize[_0x97c0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x97c0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x97c0('0x1')]},'destcalleridname':{'type':Sequelize[_0x97c0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x97c0('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x97c0('0x1')]},'destaccountcode':{'type':Sequelize[_0x97c0('0x1')]},'destcontext':{'type':Sequelize[_0x97c0('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x97c0('0x1')]},'destuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x97c0('0x1')]},'transfer':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97c0('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x97c0('0x1')]},'transferuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d17=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x51b368,_0xcfee9){var _0x4e4934=function(_0x46677d){while(--_0x46677d){_0x51b368['push'](_0x51b368['shift']());}};_0x4e4934(++_0xcfee9);}(_0x2d17,0x17e));var _0x72d1=function(_0x636970,_0x50c5ae){_0x636970=_0x636970-0x0;var _0x5ac5a5=_0x2d17[_0x636970];return _0x5ac5a5;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x72d1('0x2')]},'calleridnum':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x72d1('0x2')]},'interface':{'type':Sequelize[_0x72d1('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x72d1('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x72d1('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x72d1('0x3')]},'holdtime':{'type':Sequelize[_0x72d1('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x72d1('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x72d1('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x72d1('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x72d1('0x4')]},'reason':{'type':Sequelize[_0x72d1('0x2')]},'lastevent':{'type':Sequelize[_0x72d1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x72d1('0x4')]},'channelstatedesc':{'type':Sequelize[_0x72d1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x72d1('0x2')]},'connectedlinename':{'type':Sequelize[_0x72d1('0x2')]},'language':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize[_0x72d1('0x2')]},'exten':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'destchannel':{'type':Sequelize[_0x72d1('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x72d1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x72d1('0x2')]},'destcalleridname':{'type':Sequelize[_0x72d1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x72d1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x72d1('0x2')]},'destlanguage':{'type':Sequelize[_0x72d1('0x2')]},'destaccountcode':{'type':Sequelize[_0x72d1('0x2')]},'destcontext':{'type':Sequelize[_0x72d1('0x2')]},'destexten':{'type':Sequelize[_0x72d1('0x2')]},'destpriority':{'type':Sequelize[_0x72d1('0x2')]},'destuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x72d1('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x72d1('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x72d1('0x2')]},'transferuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 8cbd2d6..54fc96d 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 _0x3ff4=['send','VoiceAgentReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','params','rawAttributes','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','sendStatus','stack','name'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x3ff4,0xb5));var _0x43ff=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x3ff4[_0x1da527];return _0x40fc7c;};'use strict';var pdf=require(_0x43ff('0x0'));var emlformat=require(_0x43ff('0x1'));var rimraf=require(_0x43ff('0x2'));var zipdir=require(_0x43ff('0x3'));var jsonpatch=require(_0x43ff('0x4'));var rp=require(_0x43ff('0x5'));var moment=require(_0x43ff('0x6'));var BPromise=require(_0x43ff('0x7'));var Mustache=require(_0x43ff('0x8'));var util=require(_0x43ff('0x9'));var path=require(_0x43ff('0xa'));var sox=require('sox');var csv=require(_0x43ff('0xb'));var ejs=require(_0x43ff('0xc'));var fs=require('fs');var _=require(_0x43ff('0xd'));var squel=require(_0x43ff('0xe'));var crypto=require(_0x43ff('0xf'));var jsforce=require(_0x43ff('0x10'));var deskjs=require(_0x43ff('0x11'));var toCsv=require(_0x43ff('0xb'));var querystring=require(_0x43ff('0x12'));var Papa=require(_0x43ff('0x13'));var Redis=require('ioredis');var authService=require(_0x43ff('0x14'));var qs=require(_0x43ff('0x15'));var as=require(_0x43ff('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43ff('0x17'))('api');var utils=require(_0x43ff('0x18'));var config=require(_0x43ff('0x19'));var db=require(_0x43ff('0x1a'))['db'];function respondWithStatusCode(_0x265ed5,_0x1cfeaf){_0x1cfeaf=_0x1cfeaf||0xcc;return function(_0x4c9167){if(_0x4c9167){return _0x265ed5['sendStatus'](_0x1cfeaf);}return _0x265ed5[_0x43ff('0x1b')](_0x1cfeaf)[_0x43ff('0x1c')]();};}function respondWithResult(_0x24888d,_0x33fb0a){_0x33fb0a=_0x33fb0a||0xc8;return function(_0x55570a){if(_0x55570a){return _0x24888d[_0x43ff('0x1b')](_0x33fb0a)[_0x43ff('0x1d')](_0x55570a);}};}function respondWithFilteredResult(_0xd68b04,_0x122cb6){return function(_0x378c3d){if(_0x378c3d){var _0x362d39=_0x378c3d[_0x43ff('0x1e')],_0x203181=_0x122cb6['offset'],_0x11439d=_0x122cb6[_0x43ff('0x1f')]+_0x122cb6[_0x43ff('0x20')],_0x182d74;if(_0x11439d>=_0x362d39){_0x11439d=_0x362d39;_0x182d74=0xc8;}else{_0x182d74=0xce;}_0xd68b04['status'](_0x182d74);return _0xd68b04[_0x43ff('0x21')](_0x43ff('0x22'),_0x203181+'-'+_0x11439d+'/'+_0x362d39)[_0x43ff('0x1d')](_0x378c3d);}return null;};}function patchUpdates(_0x4d18b7){return function(_0x2b3e37){try{jsonpatch[_0x43ff('0x23')](_0x2b3e37,_0x4d18b7,!![]);}catch(_0xd3314f){return BPromise[_0x43ff('0x24')](_0xd3314f);}return _0x2b3e37['save']();};}function saveUpdates(_0x200022,_0x42df46){return function(_0x145b57){if(_0x145b57){return _0x145b57['update'](_0x200022)[_0x43ff('0x25')](function(_0x504be9){return _0x504be9;});}return null;};}function removeEntity(_0x4c42df,_0x3124fe){return function(_0x3b45b6){if(_0x3b45b6){return _0x3b45b6['destroy']()[_0x43ff('0x25')](function(){_0x4c42df[_0x43ff('0x1b')](0xcc)[_0x43ff('0x1c')]();});}};}function handleEntityNotFound(_0x256f19,_0x3e39f3){return function(_0x817a19){if(!_0x817a19){_0x256f19[_0x43ff('0x26')](0x194);}return _0x817a19;};}function handleError(_0x228452,_0x5f0565){_0x5f0565=_0x5f0565||0x1f4;return function(_0x3a5e6f){logger['error'](_0x3a5e6f[_0x43ff('0x27')]);if(_0x3a5e6f[_0x43ff('0x28')]){delete _0x3a5e6f[_0x43ff('0x28')];}_0x228452['status'](_0x5f0565)[_0x43ff('0x29')](_0x3a5e6f);};}exports['index']=function(_0x16ef20,_0x215ea0){var _0x4d2912={},_0x3debbc={},_0x9c79bc={'count':0x0,'rows':[]};var _0x448e8a=_['map'](db[_0x43ff('0x2a')]['rawAttributes'],function(_0x5cd271){return{'name':_0x5cd271[_0x43ff('0x2b')],'type':_0x5cd271['type'][_0x43ff('0x2c')]};});_0x3debbc[_0x43ff('0x2d')]=_[_0x43ff('0x2e')](_0x448e8a,_0x43ff('0x28'));_0x3debbc[_0x43ff('0x2f')]=_[_0x43ff('0x30')](_0x16ef20[_0x43ff('0x2f')]);_0x3debbc[_0x43ff('0x31')]=_[_0x43ff('0x32')](_0x3debbc[_0x43ff('0x2d')],_0x3debbc['query']);_0x4d2912[_0x43ff('0x33')]=_[_0x43ff('0x32')](_0x3debbc[_0x43ff('0x2d')],qs[_0x43ff('0x34')](_0x16ef20[_0x43ff('0x2f')][_0x43ff('0x34')]));_0x4d2912[_0x43ff('0x33')]=_0x4d2912[_0x43ff('0x33')][_0x43ff('0x35')]?_0x4d2912[_0x43ff('0x33')]:_0x3debbc[_0x43ff('0x2d')];if(!_0x16ef20[_0x43ff('0x2f')][_0x43ff('0x36')](_0x43ff('0x37'))){_0x4d2912[_0x43ff('0x20')]=qs[_0x43ff('0x20')](_0x16ef20[_0x43ff('0x2f')]['limit']);_0x4d2912[_0x43ff('0x1f')]=qs['offset'](_0x16ef20['query'][_0x43ff('0x1f')]);}_0x4d2912['order']=qs[_0x43ff('0x38')](_0x16ef20[_0x43ff('0x2f')][_0x43ff('0x38')]);_0x4d2912['where']=qs[_0x43ff('0x31')](_[_0x43ff('0x39')](_0x16ef20[_0x43ff('0x2f')],_0x3debbc[_0x43ff('0x31')]),_0x448e8a);if(_0x16ef20[_0x43ff('0x2f')]['filter']){_0x4d2912['where']=_[_0x43ff('0x3a')](_0x4d2912['where'],{'$or':_[_0x43ff('0x2e')](_0x448e8a,function(_0x158630){if(_0x158630[_0x43ff('0x3b')]!==_0x43ff('0x3c')){var _0x35cee1={};_0x35cee1[_0x158630[_0x43ff('0x28')]]={'$like':'%'+_0x16ef20[_0x43ff('0x2f')][_0x43ff('0x3d')]+'%'};return _0x35cee1;}})});}_0x4d2912=_['merge']({},_0x4d2912,_0x16ef20[_0x43ff('0x3e')]);var _0x23844f={'where':_0x4d2912['where']};return db['VoiceAgentReport']['count'](_0x23844f)[_0x43ff('0x25')](function(_0x3818b2){_0x9c79bc[_0x43ff('0x1e')]=_0x3818b2;if(_0x16ef20[_0x43ff('0x2f')][_0x43ff('0x3f')]){_0x4d2912['include']=[{'all':!![]}];}return db[_0x43ff('0x2a')][_0x43ff('0x40')](_0x4d2912);})['then'](function(_0x3bfb33){_0x9c79bc[_0x43ff('0x41')]=_0x3bfb33;return _0x9c79bc;})[_0x43ff('0x25')](respondWithFilteredResult(_0x215ea0,_0x4d2912))['catch'](handleError(_0x215ea0,null));};exports['show']=function(_0x261d4f,_0x176339){var _0x377e10={'raw':![],'where':{'id':_0x261d4f[_0x43ff('0x42')]['id']}},_0x1a01aa={};_0x1a01aa[_0x43ff('0x2d')]=_[_0x43ff('0x30')](db[_0x43ff('0x2a')][_0x43ff('0x43')]);_0x1a01aa[_0x43ff('0x2f')]=_[_0x43ff('0x30')](_0x261d4f[_0x43ff('0x2f')]);_0x1a01aa[_0x43ff('0x31')]=_['intersection'](_0x1a01aa[_0x43ff('0x2d')],_0x1a01aa[_0x43ff('0x2f')]);_0x377e10['attributes']=_['intersection'](_0x1a01aa[_0x43ff('0x2d')],qs[_0x43ff('0x34')](_0x261d4f[_0x43ff('0x2f')]['fields']));_0x377e10[_0x43ff('0x33')]=_0x377e10[_0x43ff('0x33')]['length']?_0x377e10[_0x43ff('0x33')]:_0x1a01aa[_0x43ff('0x2d')];if(_0x261d4f['query'][_0x43ff('0x3f')]){_0x377e10['include']=[{'all':!![]}];}_0x377e10=_['merge']({},_0x377e10,_0x261d4f[_0x43ff('0x3e')]);return db[_0x43ff('0x2a')][_0x43ff('0x44')](_0x377e10)[_0x43ff('0x25')](handleEntityNotFound(_0x176339,null))[_0x43ff('0x25')](respondWithResult(_0x176339,null))[_0x43ff('0x45')](handleError(_0x176339,null));};exports[_0x43ff('0x46')]=function(_0x23a974,_0x1b7c37){return db[_0x43ff('0x2a')][_0x43ff('0x46')](_0x23a974[_0x43ff('0x47')],{})['then'](respondWithResult(_0x1b7c37,0xc9))['catch'](handleError(_0x1b7c37,null));};exports['update']=function(_0x20c033,_0x3d5865){if(_0x20c033[_0x43ff('0x47')]['id']){delete _0x20c033[_0x43ff('0x47')]['id'];}return db[_0x43ff('0x2a')][_0x43ff('0x44')]({'where':{'id':_0x20c033['params']['id']}})[_0x43ff('0x25')](handleEntityNotFound(_0x3d5865,null))['then'](saveUpdates(_0x20c033[_0x43ff('0x47')],null))[_0x43ff('0x25')](respondWithResult(_0x3d5865,null))[_0x43ff('0x45')](handleError(_0x3d5865,null));};exports[_0x43ff('0x48')]=function(_0x4b9fe7,_0x15ccf6){return db[_0x43ff('0x2a')][_0x43ff('0x44')]({'where':{'id':_0x4b9fe7[_0x43ff('0x42')]['id']}})['then'](handleEntityNotFound(_0x15ccf6,null))[_0x43ff('0x25')](removeEntity(_0x15ccf6,null))['catch'](handleError(_0x15ccf6,null));};exports[_0x43ff('0x49')]=function(_0xb60a17,_0x49441b){return db['VoiceAgentReport'][_0x43ff('0x49')]()['then'](respondWithResult(_0x49441b,null))['catch'](handleError(_0x49441b,null));}; \ No newline at end of file +var _0xfb71=['name','index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xfb71,0x6c));var _0x1fb7=function(_0x5e8826,_0x40ca2d){_0x5e8826=_0x5e8826-0x0;var _0x2c3b15=_0xfb71[_0x5e8826];return _0x2c3b15;};'use strict';var pdf=require(_0x1fb7('0x0'));var emlformat=require(_0x1fb7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1fb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fb7('0x3'));var moment=require(_0x1fb7('0x4'));var BPromise=require(_0x1fb7('0x5'));var Mustache=require(_0x1fb7('0x6'));var util=require(_0x1fb7('0x7'));var path=require(_0x1fb7('0x8'));var sox=require(_0x1fb7('0x9'));var csv=require(_0x1fb7('0xa'));var ejs=require(_0x1fb7('0xb'));var fs=require('fs');var _=require(_0x1fb7('0xc'));var squel=require(_0x1fb7('0xd'));var crypto=require(_0x1fb7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fb7('0xf'));var toCsv=require(_0x1fb7('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fb7('0x10'));var authService=require(_0x1fb7('0x11'));var qs=require(_0x1fb7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb7('0x13'));var logger=require(_0x1fb7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1fb7('0x15'));var db=require(_0x1fb7('0x16'))['db'];function respondWithStatusCode(_0x31b73e,_0xe5b4f7){_0xe5b4f7=_0xe5b4f7||0xcc;return function(_0x227d95){if(_0x227d95){return _0x31b73e[_0x1fb7('0x17')](_0xe5b4f7);}return _0x31b73e[_0x1fb7('0x18')](_0xe5b4f7)[_0x1fb7('0x19')]();};}function respondWithResult(_0xaace39,_0xb0b0b3){_0xb0b0b3=_0xb0b0b3||0xc8;return function(_0x5da80f){if(_0x5da80f){return _0xaace39[_0x1fb7('0x18')](_0xb0b0b3)[_0x1fb7('0x1a')](_0x5da80f);}};}function respondWithFilteredResult(_0x221d24,_0x1de0a6){return function(_0x4cc9c2){if(_0x4cc9c2){var _0x30e2c2=_0x4cc9c2[_0x1fb7('0x1b')],_0x46ebf2=_0x1de0a6['offset'],_0x334e7d=_0x1de0a6[_0x1fb7('0x1c')]+_0x1de0a6[_0x1fb7('0x1d')],_0x4f4bc6;if(_0x334e7d>=_0x30e2c2){_0x334e7d=_0x30e2c2;_0x4f4bc6=0xc8;}else{_0x4f4bc6=0xce;}_0x221d24[_0x1fb7('0x18')](_0x4f4bc6);return _0x221d24[_0x1fb7('0x1e')]('Content-Range',_0x46ebf2+'-'+_0x334e7d+'/'+_0x30e2c2)[_0x1fb7('0x1a')](_0x4cc9c2);}return null;};}function patchUpdates(_0x541b6c){return function(_0x4cc946){try{jsonpatch[_0x1fb7('0x1f')](_0x4cc946,_0x541b6c,!![]);}catch(_0x58cb5a){return BPromise[_0x1fb7('0x20')](_0x58cb5a);}return _0x4cc946['save']();};}function saveUpdates(_0x9e1301,_0x2de84c){return function(_0x5db294){if(_0x5db294){return _0x5db294[_0x1fb7('0x21')](_0x9e1301)[_0x1fb7('0x22')](function(_0x4f1ff3){return _0x4f1ff3;});}return null;};}function removeEntity(_0x450206,_0x4a72e4){return function(_0x43be47){if(_0x43be47){return _0x43be47[_0x1fb7('0x23')]()['then'](function(){_0x450206[_0x1fb7('0x18')](0xcc)[_0x1fb7('0x19')]();});}};}function handleEntityNotFound(_0x2fcb67,_0x57de2d){return function(_0x35a3ca){if(!_0x35a3ca){_0x2fcb67[_0x1fb7('0x17')](0x194);}return _0x35a3ca;};}function handleError(_0x534df7,_0x1e0e26){_0x1e0e26=_0x1e0e26||0x1f4;return function(_0x14158){logger[_0x1fb7('0x24')](_0x14158[_0x1fb7('0x25')]);if(_0x14158[_0x1fb7('0x26')]){delete _0x14158[_0x1fb7('0x26')];}_0x534df7[_0x1fb7('0x18')](_0x1e0e26)['send'](_0x14158);};}exports[_0x1fb7('0x27')]=function(_0xd0d3d0,_0x19c01e){var _0x40e9bc={},_0x1244bd={},_0x5c47ee={'count':0x0,'rows':[]};var _0x28e5d7=_[_0x1fb7('0x28')](db[_0x1fb7('0x29')][_0x1fb7('0x2a')],function(_0x3631c7){return{'name':_0x3631c7[_0x1fb7('0x2b')],'type':_0x3631c7[_0x1fb7('0x2c')][_0x1fb7('0x2d')]};});_0x1244bd['model']=_[_0x1fb7('0x28')](_0x28e5d7,_0x1fb7('0x26'));_0x1244bd[_0x1fb7('0x2e')]=_['keys'](_0xd0d3d0[_0x1fb7('0x2e')]);_0x1244bd[_0x1fb7('0x2f')]=_['intersection'](_0x1244bd[_0x1fb7('0x30')],_0x1244bd[_0x1fb7('0x2e')]);_0x40e9bc[_0x1fb7('0x31')]=_[_0x1fb7('0x32')](_0x1244bd[_0x1fb7('0x30')],qs['fields'](_0xd0d3d0[_0x1fb7('0x2e')]['fields']));_0x40e9bc[_0x1fb7('0x31')]=_0x40e9bc[_0x1fb7('0x31')][_0x1fb7('0x33')]?_0x40e9bc[_0x1fb7('0x31')]:_0x1244bd[_0x1fb7('0x30')];if(!_0xd0d3d0['query'][_0x1fb7('0x34')](_0x1fb7('0x35'))){_0x40e9bc[_0x1fb7('0x1d')]=qs[_0x1fb7('0x1d')](_0xd0d3d0['query'][_0x1fb7('0x1d')]);_0x40e9bc['offset']=qs[_0x1fb7('0x1c')](_0xd0d3d0[_0x1fb7('0x2e')]['offset']);}_0x40e9bc[_0x1fb7('0x36')]=qs[_0x1fb7('0x37')](_0xd0d3d0[_0x1fb7('0x2e')][_0x1fb7('0x37')]);_0x40e9bc[_0x1fb7('0x38')]=qs[_0x1fb7('0x2f')](_[_0x1fb7('0x39')](_0xd0d3d0['query'],_0x1244bd['filters']),_0x28e5d7);if(_0xd0d3d0[_0x1fb7('0x2e')][_0x1fb7('0x3a')]){_0x40e9bc['where']=_['merge'](_0x40e9bc[_0x1fb7('0x38')],{'$or':_['map'](_0x28e5d7,function(_0x225d21){if(_0x225d21[_0x1fb7('0x2c')]!==_0x1fb7('0x3b')){var _0x202a20={};_0x202a20[_0x225d21[_0x1fb7('0x26')]]={'$like':'%'+_0xd0d3d0[_0x1fb7('0x2e')][_0x1fb7('0x3a')]+'%'};return _0x202a20;}})});}_0x40e9bc=_[_0x1fb7('0x3c')]({},_0x40e9bc,_0xd0d3d0[_0x1fb7('0x3d')]);var _0x3507d2={'where':_0x40e9bc[_0x1fb7('0x38')]};return db[_0x1fb7('0x29')][_0x1fb7('0x1b')](_0x3507d2)[_0x1fb7('0x22')](function(_0x22a343){_0x5c47ee[_0x1fb7('0x1b')]=_0x22a343;if(_0xd0d3d0[_0x1fb7('0x2e')][_0x1fb7('0x3e')]){_0x40e9bc[_0x1fb7('0x3f')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x1fb7('0x40')](_0x40e9bc);})['then'](function(_0x49159c){_0x5c47ee[_0x1fb7('0x41')]=_0x49159c;return _0x5c47ee;})[_0x1fb7('0x22')](respondWithFilteredResult(_0x19c01e,_0x40e9bc))[_0x1fb7('0x42')](handleError(_0x19c01e,null));};exports['show']=function(_0x13293d,_0x570ddb){var _0x5876e4={'raw':![],'where':{'id':_0x13293d[_0x1fb7('0x43')]['id']}},_0x2a1e52={};_0x2a1e52[_0x1fb7('0x30')]=_[_0x1fb7('0x44')](db[_0x1fb7('0x29')][_0x1fb7('0x2a')]);_0x2a1e52['query']=_['keys'](_0x13293d[_0x1fb7('0x2e')]);_0x2a1e52[_0x1fb7('0x2f')]=_[_0x1fb7('0x32')](_0x2a1e52[_0x1fb7('0x30')],_0x2a1e52[_0x1fb7('0x2e')]);_0x5876e4[_0x1fb7('0x31')]=_['intersection'](_0x2a1e52[_0x1fb7('0x30')],qs['fields'](_0x13293d[_0x1fb7('0x2e')]['fields']));_0x5876e4['attributes']=_0x5876e4[_0x1fb7('0x31')][_0x1fb7('0x33')]?_0x5876e4[_0x1fb7('0x31')]:_0x2a1e52[_0x1fb7('0x30')];if(_0x13293d[_0x1fb7('0x2e')][_0x1fb7('0x3e')]){_0x5876e4['include']=[{'all':!![]}];}_0x5876e4=_[_0x1fb7('0x3c')]({},_0x5876e4,_0x13293d[_0x1fb7('0x3d')]);return db[_0x1fb7('0x29')][_0x1fb7('0x45')](_0x5876e4)[_0x1fb7('0x22')](handleEntityNotFound(_0x570ddb,null))['then'](respondWithResult(_0x570ddb,null))[_0x1fb7('0x42')](handleError(_0x570ddb,null));};exports['create']=function(_0x5d33ad,_0x557ec7){return db[_0x1fb7('0x29')][_0x1fb7('0x46')](_0x5d33ad[_0x1fb7('0x47')],{})[_0x1fb7('0x22')](respondWithResult(_0x557ec7,0xc9))[_0x1fb7('0x42')](handleError(_0x557ec7,null));};exports[_0x1fb7('0x21')]=function(_0x98844e,_0x1d7c44){if(_0x98844e[_0x1fb7('0x47')]['id']){delete _0x98844e['body']['id'];}return db[_0x1fb7('0x29')][_0x1fb7('0x45')]({'where':{'id':_0x98844e[_0x1fb7('0x43')]['id']}})[_0x1fb7('0x22')](handleEntityNotFound(_0x1d7c44,null))['then'](saveUpdates(_0x98844e[_0x1fb7('0x47')],null))[_0x1fb7('0x22')](respondWithResult(_0x1d7c44,null))[_0x1fb7('0x42')](handleError(_0x1d7c44,null));};exports[_0x1fb7('0x23')]=function(_0x50b470,_0x53b82a){return db[_0x1fb7('0x29')][_0x1fb7('0x45')]({'where':{'id':_0x50b470[_0x1fb7('0x43')]['id']}})[_0x1fb7('0x22')](handleEntityNotFound(_0x53b82a,null))[_0x1fb7('0x22')](removeEntity(_0x53b82a,null))['catch'](handleError(_0x53b82a,null));};exports['describe']=function(_0x20ff87,_0x1962f7){return db['VoiceAgentReport'][_0x1fb7('0x48')]()[_0x1fb7('0x22')](respondWithResult(_0x1962f7,null))[_0x1fb7('0x42')](handleError(_0x1962f7,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index a7d9761..c8a23f1 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 _0x70e0=['rimraf','./voiceAgentReport.attributes','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x301f00,_0x1687c4){var _0x3c372a=function(_0x38ff50){while(--_0x38ff50){_0x301f00['push'](_0x301f00['shift']());}};_0x3c372a(++_0x1687c4);}(_0x70e0,0x17b));var _0x070e=function(_0x424a11,_0x2ab828){_0x424a11=_0x424a11-0x0;var _0x50df57=_0x70e0[_0x424a11];return _0x50df57;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceAgentReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'fields':[_0x070e('0x9'),_0x070e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','VoiceAgentReport','destuniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x0a9e('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 defed5f..76df7f8 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 _0x4269=['message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e448b,_0x193ca0){var _0x273cf5=function(_0x32245d){while(--_0x32245d){_0x4e448b['push'](_0x4e448b['shift']());}};_0x273cf5(++_0x193ca0);}(_0x4269,0xcc));var _0x9426=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x4269[_0x15fa77];return _0x1385ff;};'use strict';var _=require(_0x9426('0x0'));var util=require('util');var moment=require(_0x9426('0x1'));var BPromise=require(_0x9426('0x2'));var rs=require(_0x9426('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9426('0x4'))['db'];var utils=require(_0x9426('0x5'));var logger=require('../../config/logger')(_0x9426('0x6'));var config=require(_0x9426('0x7'));var jayson=require(_0x9426('0x8'));var client=jayson['client'][_0x9426('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17f4a9,_0x28643d,_0x22a82e){return new BPromise(function(_0x47ba03,_0x4d7dca){return client[_0x9426('0xa')](_0x17f4a9,_0x22a82e)[_0x9426('0xb')](function(_0x854a6d){logger[_0x9426('0xc')](_0x9426('0xd'),_0x28643d,_0x9426('0xe'));logger[_0x9426('0xf')](_0x9426('0x10'),_0x28643d,'request\x20sent',JSON[_0x9426('0x11')](_0x854a6d));if(_0x854a6d[_0x9426('0x12')]){if(_0x854a6d[_0x9426('0x12')][_0x9426('0x13')]===0x1f4){logger['error'](_0x9426('0xd'),_0x28643d,_0x854a6d['error'][_0x9426('0x14')]);return _0x4d7dca(_0x854a6d[_0x9426('0x12')][_0x9426('0x14')]);}logger[_0x9426('0x12')](_0x9426('0xd'),_0x28643d,_0x854a6d[_0x9426('0x12')]['message']);return _0x47ba03(_0x854a6d[_0x9426('0x12')]['message']);}else{logger[_0x9426('0xc')](_0x9426('0xd'),_0x28643d,_0x9426('0xe'));_0x47ba03(_0x854a6d[_0x9426('0x15')]['message']);}})[_0x9426('0x16')](function(_0x934394){logger[_0x9426('0x12')](_0x9426('0xd'),_0x28643d,_0x934394);_0x4d7dca(_0x934394);});});}exports[_0x9426('0x17')]=function(_0x40257b){var _0x2a68fd=this;return new Promise(function(_0x208263,_0x3b0ca6){return db[_0x9426('0x18')][_0x9426('0x19')](_0x40257b['body'],{'raw':_0x40257b[_0x9426('0x1a')]?_0x40257b[_0x9426('0x1a')][_0x9426('0x1b')]===undefined?!![]:![]:!![]})[_0x9426('0xb')](function(_0x3c9463){logger[_0x9426('0xc')]('CreateVoiceAgentReport',_0x40257b);logger[_0x9426('0xf')](_0x9426('0x17'),_0x40257b,JSON[_0x9426('0x11')](_0x3c9463));_0x208263(_0x3c9463);})[_0x9426('0x16')](function(_0x582389){logger[_0x9426('0x12')](_0x9426('0x17'),_0x582389[_0x9426('0x14')],_0x40257b);_0x3b0ca6(_0x2a68fd[_0x9426('0x12')](0x1f4,_0x582389[_0x9426('0x14')]));});});};exports[_0x9426('0x1c')]=function(_0x55fc0e){var _0x31575d=this;return new Promise(function(_0x4cde0e,_0x1621aa){return db[_0x9426('0x18')][_0x9426('0x1d')](_0x55fc0e['body'],{'raw':_0x55fc0e[_0x9426('0x1a')]?_0x55fc0e['options'][_0x9426('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55fc0e[_0x9426('0x1a')]?_0x55fc0e[_0x9426('0x1a')][_0x9426('0x1e')]||null:null,'attributes':_0x55fc0e['options']?_0x55fc0e[_0x9426('0x1a')][_0x9426('0x1f')]||null:null,'limit':_0x55fc0e[_0x9426('0x1a')]?_0x55fc0e[_0x9426('0x1a')]['limit']||null:null})[_0x9426('0xb')](function(_0x45a813){logger[_0x9426('0xc')]('UpdateVoiceAgentReport',_0x55fc0e);logger[_0x9426('0xf')](_0x9426('0x1c'),_0x55fc0e,JSON[_0x9426('0x11')](_0x45a813));_0x4cde0e(_0x45a813);})['catch'](function(_0x2b9eb4){logger[_0x9426('0x12')](_0x9426('0x1c'),_0x2b9eb4[_0x9426('0x14')],_0x55fc0e);_0x1621aa(_0x31575d[_0x9426('0x12')](0x1f4,_0x2b9eb4[_0x9426('0x14')]));});});}; \ No newline at end of file +var _0xf929=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf929,0x164));var _0x9f92=function(_0x23aa7f,_0x1fd440){_0x23aa7f=_0x23aa7f-0x0;var _0x1441fd=_0xf929[_0x23aa7f];return _0x1441fd;};'use strict';var _=require(_0x9f92('0x0'));var util=require('util');var moment=require(_0x9f92('0x1'));var BPromise=require(_0x9f92('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f92('0x3'));var db=require(_0x9f92('0x4'))['db'];var utils=require(_0x9f92('0x5'));var logger=require(_0x9f92('0x6'))(_0x9f92('0x7'));var config=require(_0x9f92('0x8'));var jayson=require(_0x9f92('0x9'));var client=jayson[_0x9f92('0xa')][_0x9f92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29a770,_0x77aa18,_0x5f343f){return new BPromise(function(_0x98a2f5,_0x2d4115){return client[_0x9f92('0xc')](_0x29a770,_0x5f343f)[_0x9f92('0xd')](function(_0x35adc2){logger[_0x9f92('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x77aa18,_0x9f92('0xf'));logger[_0x9f92('0x10')](_0x9f92('0x11'),_0x77aa18,_0x9f92('0xf'),JSON[_0x9f92('0x12')](_0x35adc2));if(_0x35adc2[_0x9f92('0x13')]){if(_0x35adc2[_0x9f92('0x13')][_0x9f92('0x14')]===0x1f4){logger[_0x9f92('0x13')](_0x9f92('0x15'),_0x77aa18,_0x35adc2[_0x9f92('0x13')]['message']);return _0x2d4115(_0x35adc2[_0x9f92('0x13')][_0x9f92('0x16')]);}logger[_0x9f92('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x77aa18,_0x35adc2[_0x9f92('0x13')]['message']);return _0x98a2f5(_0x35adc2[_0x9f92('0x13')][_0x9f92('0x16')]);}else{logger[_0x9f92('0xe')](_0x9f92('0x15'),_0x77aa18,_0x9f92('0xf'));_0x98a2f5(_0x35adc2['result']['message']);}})[_0x9f92('0x17')](function(_0x27dcf4){logger[_0x9f92('0x13')](_0x9f92('0x15'),_0x77aa18,_0x27dcf4);_0x2d4115(_0x27dcf4);});});}exports['CreateVoiceAgentReport']=function(_0x1045c1){var _0x1ead43=this;return new Promise(function(_0x31acf3,_0x1d058a){return db[_0x9f92('0x18')][_0x9f92('0x19')](_0x1045c1[_0x9f92('0x1a')],{'raw':_0x1045c1[_0x9f92('0x1b')]?_0x1045c1[_0x9f92('0x1b')][_0x9f92('0x1c')]===undefined?!![]:![]:!![]})[_0x9f92('0xd')](function(_0x340e0a){logger[_0x9f92('0xe')](_0x9f92('0x1d'),_0x1045c1);logger['debug'](_0x9f92('0x1d'),_0x1045c1,JSON[_0x9f92('0x12')](_0x340e0a));_0x31acf3(_0x340e0a);})[_0x9f92('0x17')](function(_0x5b6f2f){logger[_0x9f92('0x13')](_0x9f92('0x1d'),_0x5b6f2f[_0x9f92('0x16')],_0x1045c1);_0x1d058a(_0x1ead43[_0x9f92('0x13')](0x1f4,_0x5b6f2f[_0x9f92('0x16')]));});});};exports[_0x9f92('0x1e')]=function(_0xf2b1db){var _0x2c2812=this;return new Promise(function(_0x5ca0f2,_0x214dfd){return db['VoiceAgentReport']['update'](_0xf2b1db[_0x9f92('0x1a')],{'raw':_0xf2b1db[_0x9f92('0x1b')]?_0xf2b1db[_0x9f92('0x1b')][_0x9f92('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2b1db[_0x9f92('0x1b')]?_0xf2b1db[_0x9f92('0x1b')][_0x9f92('0x1f')]||null:null,'attributes':_0xf2b1db[_0x9f92('0x1b')]?_0xf2b1db[_0x9f92('0x1b')][_0x9f92('0x20')]||null:null,'limit':_0xf2b1db[_0x9f92('0x1b')]?_0xf2b1db[_0x9f92('0x1b')][_0x9f92('0x21')]||null:null})['then'](function(_0x2dc012){logger['info'](_0x9f92('0x1e'),_0xf2b1db);logger[_0x9f92('0x10')]('UpdateVoiceAgentReport',_0xf2b1db,JSON[_0x9f92('0x12')](_0x2dc012));_0x5ca0f2(_0x2dc012);})[_0x9f92('0x17')](function(_0x56b814){logger[_0x9f92('0x13')](_0x9f92('0x1e'),_0x56b814['message'],_0xf2b1db);_0x214dfd(_0x2c2812['error'](0x1f4,_0x56b814['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index afb730f..b3371f3 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 _0x6e7c=['show','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x2f479d,_0x1d6836){var _0x300d48=function(_0x338a74){while(--_0x338a74){_0x2f479d['push'](_0x2f479d['shift']());}};_0x300d48(++_0x1d6836);}(_0x6e7c,0x9e));var _0xc6e7=function(_0x97765a,_0x4f9522){_0x97765a=_0x97765a-0x0;var _0x20b325=_0x6e7c[_0x97765a];return _0x20b325;};'use strict';var multer=require(_0xc6e7('0x0'));var util=require(_0xc6e7('0x1'));var path=require(_0xc6e7('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6e7('0x3'));var router=express[_0xc6e7('0x4')]();var auth=require(_0xc6e7('0x5'));var interaction=require(_0xc6e7('0x6'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0xc6e7('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6e7('0x8')]);router[_0xc6e7('0x7')](_0xc6e7('0x9'),auth[_0xc6e7('0xa')](),controller[_0xc6e7('0xb')]);router[_0xc6e7('0x7')](_0xc6e7('0xc'),auth[_0xc6e7('0xa')](),controller[_0xc6e7('0xd')]);router['post']('/',auth[_0xc6e7('0xa')](),controller[_0xc6e7('0xe')]);router[_0xc6e7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc6e7('0x10')]);router['delete'](_0xc6e7('0xc'),auth[_0xc6e7('0xa')](),controller[_0xc6e7('0x11')]);module[_0xc6e7('0x12')]=router; \ No newline at end of file +var _0xba02=['destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id'];(function(_0x29f0d1,_0x329499){var _0x4560d3=function(_0x19fb1f){while(--_0x19fb1f){_0x29f0d1['push'](_0x29f0d1['shift']());}};_0x4560d3(++_0x329499);}(_0xba02,0x65));var _0x2ba0=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xba02[_0x1203f];return _0x365f0a;};'use strict';var multer=require('multer');var util=require(_0x2ba0('0x0'));var path=require(_0x2ba0('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ba0('0x2'));var router=express[_0x2ba0('0x3')]();var auth=require(_0x2ba0('0x4'));var interaction=require(_0x2ba0('0x5'));var config=require(_0x2ba0('0x6'));var controller=require(_0x2ba0('0x7'));router[_0x2ba0('0x8')]('/',auth[_0x2ba0('0x9')](),controller[_0x2ba0('0xa')]);router[_0x2ba0('0x8')](_0x2ba0('0xb'),auth['isAuthenticated'](),controller[_0x2ba0('0xc')]);router[_0x2ba0('0x8')]('/:id',auth[_0x2ba0('0x9')](),controller[_0x2ba0('0xd')]);router[_0x2ba0('0xe')]('/',auth[_0x2ba0('0x9')](),controller[_0x2ba0('0xf')]);router[_0x2ba0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2ba0('0x11')]);router['delete'](_0x2ba0('0x12'),auth[_0x2ba0('0x9')](),controller[_0x2ba0('0x13')]);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 ddbf7bd..0d85c29 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(_0x313665,_0x5f5d32){var _0x40bc9e=function(_0x53309b){while(--_0x53309b){_0x313665['push'](_0x313665['shift']());}};_0x40bc9e(++_0x5f5d32);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'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 _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x567f86,_0x5d2e15){var _0x35eae4=function(_0x4c4d16){while(--_0x4c4d16){_0x567f86['push'](_0x567f86['shift']());}};_0x35eae4(++_0x5d2e15);}(_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 diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index eec301a..1f6f6b4 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 _0x1b91=['lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','count','offset','set','Content-Range','apply','reject','save','then','status','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VoiceCallReport','includeAll','alias','User','findAll','rows','catch','show','params','include','find','create','destroy','describe','update','body','uniqueid','user','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x19f98d,_0x3e1c0a){var _0x4f9a0d=function(_0x16dd54){while(--_0x16dd54){_0x19f98d['push'](_0x19f98d['shift']());}};_0x4f9a0d(++_0x3e1c0a);}(_0x1b91,0x12d));var _0x11b9=function(_0x3b2115,_0x3fbce1){_0x3b2115=_0x3b2115-0x0;var _0x2ef1c6=_0x1b91[_0x3b2115];return _0x2ef1c6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x11b9('0x0'));var rimraf=require(_0x11b9('0x1'));var zipdir=require(_0x11b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11b9('0x3'));var moment=require('moment');var BPromise=require(_0x11b9('0x4'));var Mustache=require(_0x11b9('0x5'));var util=require(_0x11b9('0x6'));var path=require(_0x11b9('0x7'));var sox=require(_0x11b9('0x8'));var csv=require(_0x11b9('0x9'));var ejs=require(_0x11b9('0xa'));var fs=require('fs');var _=require(_0x11b9('0xb'));var squel=require(_0x11b9('0xc'));var crypto=require(_0x11b9('0xd'));var jsforce=require(_0x11b9('0xe'));var deskjs=require(_0x11b9('0xf'));var toCsv=require(_0x11b9('0x9'));var querystring=require('querystring');var Papa=require(_0x11b9('0x10'));var Redis=require('ioredis');var authService=require(_0x11b9('0x11'));var qs=require(_0x11b9('0x12'));var as=require(_0x11b9('0x13'));var hardwareService=require(_0x11b9('0x14'));var logger=require(_0x11b9('0x15'))('api');var utils=require(_0x11b9('0x16'));var config=require('../../config/environment');var db=require(_0x11b9('0x17'))['db'];function respondWithStatusCode(_0x3a4c6f,_0x2bd3ce){_0x2bd3ce=_0x2bd3ce||0xcc;return function(_0x2f9034){if(_0x2f9034){return _0x3a4c6f[_0x11b9('0x18')](_0x2bd3ce);}return _0x3a4c6f['status'](_0x2bd3ce)[_0x11b9('0x19')]();};}function respondWithResult(_0x166f57,_0x367faf){_0x367faf=_0x367faf||0xc8;return function(_0xb47a3a){if(_0xb47a3a){return _0x166f57['status'](_0x367faf)['json'](_0xb47a3a);}};}function respondWithFilteredResult(_0x365595,_0x5e0ce0){return function(_0x173334){if(_0x173334){var _0xca2792=_0x173334[_0x11b9('0x1a')],_0x33cb92=_0x5e0ce0[_0x11b9('0x1b')],_0x1f675a=_0x5e0ce0['offset']+_0x5e0ce0['limit'],_0x26e9f3;if(_0x1f675a>=_0xca2792){_0x1f675a=_0xca2792;_0x26e9f3=0xc8;}else{_0x26e9f3=0xce;}_0x365595['status'](_0x26e9f3);return _0x365595[_0x11b9('0x1c')](_0x11b9('0x1d'),_0x33cb92+'-'+_0x1f675a+'/'+_0xca2792)['json'](_0x173334);}return null;};}function patchUpdates(_0x4d8369){return function(_0x51a582){try{jsonpatch[_0x11b9('0x1e')](_0x51a582,_0x4d8369,!![]);}catch(_0x2ade0d){return BPromise[_0x11b9('0x1f')](_0x2ade0d);}return _0x51a582[_0x11b9('0x20')]();};}function saveUpdates(_0x4b49e9,_0xd85734){return function(_0x13b7a0){if(_0x13b7a0){return _0x13b7a0['update'](_0x4b49e9)[_0x11b9('0x21')](function(_0x2faac0){return _0x2faac0;});}return null;};}function removeEntity(_0x5b505f,_0x360f80){return function(_0x51b2d2){if(_0x51b2d2){return _0x51b2d2['destroy']()[_0x11b9('0x21')](function(){_0x5b505f[_0x11b9('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x549810,_0x1d4274){return function(_0x33c4a7){if(!_0x33c4a7){_0x549810[_0x11b9('0x18')](0x194);}return _0x33c4a7;};}function handleError(_0x49e9d8,_0x3ed6b2){_0x3ed6b2=_0x3ed6b2||0x1f4;return function(_0xc4797){logger[_0x11b9('0x23')](_0xc4797[_0x11b9('0x24')]);if(_0xc4797[_0x11b9('0x25')]){delete _0xc4797[_0x11b9('0x25')];}_0x49e9d8[_0x11b9('0x22')](_0x3ed6b2)[_0x11b9('0x26')](_0xc4797);};}exports[_0x11b9('0x27')]=function(_0x31d93d,_0x1ba302){var _0x22f61d={},_0x2bfa5e={},_0x175cf5={'count':0x0,'rows':[]};var _0x48f9e0=_[_0x11b9('0x28')](db['VoiceCallReport'][_0x11b9('0x29')],function(_0x17f87e){return{'name':_0x17f87e['fieldName'],'type':_0x17f87e[_0x11b9('0x2a')][_0x11b9('0x2b')]};});_0x2bfa5e[_0x11b9('0x2c')]=_[_0x11b9('0x28')](_0x48f9e0,_0x11b9('0x25'));_0x2bfa5e[_0x11b9('0x2d')]=_[_0x11b9('0x2e')](_0x31d93d[_0x11b9('0x2d')]);_0x2bfa5e[_0x11b9('0x2f')]=_['intersection'](_0x2bfa5e[_0x11b9('0x2c')],_0x2bfa5e[_0x11b9('0x2d')]);_0x22f61d[_0x11b9('0x30')]=_[_0x11b9('0x31')](_0x2bfa5e[_0x11b9('0x2c')],qs[_0x11b9('0x32')](_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x32')]));_0x22f61d['attributes']=_0x22f61d[_0x11b9('0x30')][_0x11b9('0x33')]?_0x22f61d['attributes']:_0x2bfa5e[_0x11b9('0x2c')];if(!_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x34')](_0x11b9('0x35'))){_0x22f61d[_0x11b9('0x36')]=qs['limit'](_0x31d93d[_0x11b9('0x2d')]['limit']);_0x22f61d[_0x11b9('0x1b')]=qs[_0x11b9('0x1b')](_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x1b')]);}_0x22f61d[_0x11b9('0x37')]=qs[_0x11b9('0x38')](_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x38')]);_0x22f61d[_0x11b9('0x39')]=qs[_0x11b9('0x2f')](_['pick'](_0x31d93d[_0x11b9('0x2d')],_0x2bfa5e[_0x11b9('0x2f')]),_0x48f9e0);if(_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x3a')]){_0x22f61d[_0x11b9('0x39')]=_['merge'](_0x22f61d['where'],{'$or':_[_0x11b9('0x28')](_0x48f9e0,function(_0x5eb215){if(_0x5eb215[_0x11b9('0x2a')]!=='VIRTUAL'){var _0x3e5a41={};_0x3e5a41[_0x5eb215[_0x11b9('0x25')]]={'$like':'%'+_0x31d93d['query'][_0x11b9('0x3a')]+'%'};return _0x3e5a41;}})});}_0x22f61d=_[_0x11b9('0x3b')]({},_0x22f61d,_0x31d93d['options']);var _0x1cb069={'where':_0x22f61d['where']};return db[_0x11b9('0x3c')][_0x11b9('0x1a')](_0x1cb069)['then'](function(_0x29f22e){_0x175cf5[_0x11b9('0x1a')]=_0x29f22e;if(_0x31d93d[_0x11b9('0x2d')][_0x11b9('0x3d')]){_0x22f61d['include']=[{'attributes':['id','name','fullname',_0x11b9('0x3e')],'model':db['User'],'as':_0x11b9('0x3f')}];}return db['VoiceCallReport'][_0x11b9('0x40')](_0x22f61d);})['then'](function(_0x25f0ca){_0x175cf5[_0x11b9('0x41')]=_0x25f0ca;return _0x175cf5;})[_0x11b9('0x21')](respondWithFilteredResult(_0x1ba302,_0x22f61d))[_0x11b9('0x42')](handleError(_0x1ba302,null));};exports[_0x11b9('0x43')]=function(_0x130467,_0x4219c6){var _0x335c9b={'raw':!![],'where':{'id':_0x130467[_0x11b9('0x44')]['id']}},_0x13e38c={};_0x13e38c[_0x11b9('0x2c')]=_['keys'](db[_0x11b9('0x3c')][_0x11b9('0x29')]);_0x13e38c[_0x11b9('0x2d')]=_['keys'](_0x130467[_0x11b9('0x2d')]);_0x13e38c['filters']=_['intersection'](_0x13e38c[_0x11b9('0x2c')],_0x13e38c['query']);_0x335c9b[_0x11b9('0x30')]=_[_0x11b9('0x31')](_0x13e38c[_0x11b9('0x2c')],qs[_0x11b9('0x32')](_0x130467[_0x11b9('0x2d')]['fields']));_0x335c9b[_0x11b9('0x30')]=_0x335c9b[_0x11b9('0x30')]['length']?_0x335c9b['attributes']:_0x13e38c[_0x11b9('0x2c')];if(_0x130467[_0x11b9('0x2d')][_0x11b9('0x3d')]){_0x335c9b[_0x11b9('0x45')]=[{'all':!![]}];}_0x335c9b=_[_0x11b9('0x3b')]({},_0x335c9b,_0x130467['options']);return db[_0x11b9('0x3c')][_0x11b9('0x46')](_0x335c9b)[_0x11b9('0x21')](handleEntityNotFound(_0x4219c6,null))[_0x11b9('0x21')](respondWithResult(_0x4219c6,null))[_0x11b9('0x42')](handleError(_0x4219c6,null));};exports['create']=function(_0x24d907,_0x1ceb7e){return db[_0x11b9('0x3c')][_0x11b9('0x47')](_0x24d907['body'],{})[_0x11b9('0x21')](respondWithResult(_0x1ceb7e,0xc9))[_0x11b9('0x42')](handleError(_0x1ceb7e,null));};exports[_0x11b9('0x48')]=function(_0x16dd3e,_0x2c8377){return db[_0x11b9('0x3c')][_0x11b9('0x46')]({'where':{'id':_0x16dd3e[_0x11b9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c8377,null))['then'](removeEntity(_0x2c8377,null))[_0x11b9('0x42')](handleError(_0x2c8377,null));};exports['describe']=function(_0x2c1818,_0x335a5b){return db['VoiceCallReport'][_0x11b9('0x49')]()[_0x11b9('0x21')](respondWithResult(_0x335a5b,null))[_0x11b9('0x42')](handleError(_0x335a5b,null));};exports[_0x11b9('0x4a')]=function(_0x488387,_0x29b1cc){if(_0x488387[_0x11b9('0x4b')][_0x11b9('0x4c')]){delete _0x488387[_0x11b9('0x4b')]['uniqueid'];}return db[_0x11b9('0x3c')]['find']({'where':{'uniqueid':_0x488387[_0x11b9('0x44')]['id'],'UserId':{'$or':[null,_0x488387[_0x11b9('0x4d')]['id']]}}})[_0x11b9('0x21')](handleEntityNotFound(_0x29b1cc,null))[_0x11b9('0x21')](saveUpdates(_0x488387[_0x11b9('0x4b')],null))['then'](respondWithResult(_0x29b1cc,null))[_0x11b9('0x42')](handleError(_0x29b1cc,null));}; \ No newline at end of file +var _0x63a8=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','update','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','include','fullname','User','findAll','catch','params','includeAll','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x15d9d6,_0x793d4f){var _0x1e2dc0=function(_0x184d6b){while(--_0x184d6b){_0x15d9d6['push'](_0x15d9d6['shift']());}};_0x1e2dc0(++_0x793d4f);}(_0x63a8,0x1ab));var _0x863a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x63a8[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0x863a('0x0'));var emlformat=require(_0x863a('0x1'));var rimraf=require(_0x863a('0x2'));var zipdir=require(_0x863a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x863a('0x4'));var moment=require(_0x863a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x863a('0x6'));var util=require(_0x863a('0x7'));var path=require(_0x863a('0x8'));var sox=require(_0x863a('0x9'));var csv=require(_0x863a('0xa'));var ejs=require(_0x863a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x863a('0xc'));var crypto=require(_0x863a('0xd'));var jsforce=require(_0x863a('0xe'));var deskjs=require(_0x863a('0xf'));var toCsv=require(_0x863a('0xa'));var querystring=require(_0x863a('0x10'));var Papa=require(_0x863a('0x11'));var Redis=require(_0x863a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x863a('0x13'));var as=require(_0x863a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x863a('0x15'))(_0x863a('0x16'));var utils=require(_0x863a('0x17'));var config=require(_0x863a('0x18'));var db=require(_0x863a('0x19'))['db'];function respondWithStatusCode(_0x2f1d82,_0x1bdebb){_0x1bdebb=_0x1bdebb||0xcc;return function(_0x19519b){if(_0x19519b){return _0x2f1d82[_0x863a('0x1a')](_0x1bdebb);}return _0x2f1d82[_0x863a('0x1b')](_0x1bdebb)[_0x863a('0x1c')]();};}function respondWithResult(_0x343a89,_0x176b5b){_0x176b5b=_0x176b5b||0xc8;return function(_0x4eadc6){if(_0x4eadc6){return _0x343a89[_0x863a('0x1b')](_0x176b5b)[_0x863a('0x1d')](_0x4eadc6);}};}function respondWithFilteredResult(_0x1be3cc,_0x4ddb3a){return function(_0x35054a){if(_0x35054a){var _0x2165f5=_0x35054a[_0x863a('0x1e')],_0x8e338a=_0x4ddb3a[_0x863a('0x1f')],_0x14e931=_0x4ddb3a[_0x863a('0x1f')]+_0x4ddb3a[_0x863a('0x20')],_0x181d22;if(_0x14e931>=_0x2165f5){_0x14e931=_0x2165f5;_0x181d22=0xc8;}else{_0x181d22=0xce;}_0x1be3cc[_0x863a('0x1b')](_0x181d22);return _0x1be3cc['set']('Content-Range',_0x8e338a+'-'+_0x14e931+'/'+_0x2165f5)['json'](_0x35054a);}return null;};}function patchUpdates(_0x5f0a55){return function(_0x28e537){try{jsonpatch[_0x863a('0x21')](_0x28e537,_0x5f0a55,!![]);}catch(_0x36cf28){return BPromise['reject'](_0x36cf28);}return _0x28e537['save']();};}function saveUpdates(_0x27b32f,_0x1fbad4){return function(_0x26e9fa){if(_0x26e9fa){return _0x26e9fa[_0x863a('0x22')](_0x27b32f)[_0x863a('0x23')](function(_0xe8dba2){return _0xe8dba2;});}return null;};}function removeEntity(_0x4ce600,_0x3f51f7){return function(_0x11e230){if(_0x11e230){return _0x11e230[_0x863a('0x24')]()[_0x863a('0x23')](function(){_0x4ce600[_0x863a('0x1b')](0xcc)[_0x863a('0x1c')]();});}};}function handleEntityNotFound(_0x338e64,_0x807736){return function(_0x4db6ff){if(!_0x4db6ff){_0x338e64['sendStatus'](0x194);}return _0x4db6ff;};}function handleError(_0x579484,_0x2fe47c){_0x2fe47c=_0x2fe47c||0x1f4;return function(_0x1cec49){logger[_0x863a('0x25')](_0x1cec49[_0x863a('0x26')]);if(_0x1cec49[_0x863a('0x27')]){delete _0x1cec49['name'];}_0x579484['status'](_0x2fe47c)['send'](_0x1cec49);};}exports[_0x863a('0x28')]=function(_0x150b0e,_0x5bf718){var _0x52ebb7={},_0x4f9077={},_0x5be215={'count':0x0,'rows':[]};var _0x3d1713=_[_0x863a('0x29')](db[_0x863a('0x2a')][_0x863a('0x2b')],function(_0x1f234f){return{'name':_0x1f234f[_0x863a('0x2c')],'type':_0x1f234f[_0x863a('0x2d')]['key']};});_0x4f9077[_0x863a('0x2e')]=_[_0x863a('0x29')](_0x3d1713,_0x863a('0x27'));_0x4f9077['query']=_[_0x863a('0x2f')](_0x150b0e[_0x863a('0x30')]);_0x4f9077[_0x863a('0x31')]=_[_0x863a('0x32')](_0x4f9077['model'],_0x4f9077[_0x863a('0x30')]);_0x52ebb7['attributes']=_[_0x863a('0x32')](_0x4f9077[_0x863a('0x2e')],qs[_0x863a('0x33')](_0x150b0e[_0x863a('0x30')][_0x863a('0x33')]));_0x52ebb7[_0x863a('0x34')]=_0x52ebb7[_0x863a('0x34')][_0x863a('0x35')]?_0x52ebb7['attributes']:_0x4f9077[_0x863a('0x2e')];if(!_0x150b0e[_0x863a('0x30')]['hasOwnProperty'](_0x863a('0x36'))){_0x52ebb7[_0x863a('0x20')]=qs[_0x863a('0x20')](_0x150b0e[_0x863a('0x30')][_0x863a('0x20')]);_0x52ebb7[_0x863a('0x1f')]=qs['offset'](_0x150b0e[_0x863a('0x30')][_0x863a('0x1f')]);}_0x52ebb7[_0x863a('0x37')]=qs[_0x863a('0x38')](_0x150b0e[_0x863a('0x30')]['sort']);_0x52ebb7['where']=qs['filters'](_[_0x863a('0x39')](_0x150b0e[_0x863a('0x30')],_0x4f9077[_0x863a('0x31')]),_0x3d1713);if(_0x150b0e[_0x863a('0x30')][_0x863a('0x3a')]){_0x52ebb7['where']=_[_0x863a('0x3b')](_0x52ebb7[_0x863a('0x3c')],{'$or':_['map'](_0x3d1713,function(_0x5e5b37){if(_0x5e5b37['type']!==_0x863a('0x3d')){var _0x48ca5c={};_0x48ca5c[_0x5e5b37[_0x863a('0x27')]]={'$like':'%'+_0x150b0e[_0x863a('0x30')][_0x863a('0x3a')]+'%'};return _0x48ca5c;}})});}_0x52ebb7=_[_0x863a('0x3b')]({},_0x52ebb7,_0x150b0e['options']);var _0x17b8f6={'where':_0x52ebb7['where']};return db[_0x863a('0x2a')][_0x863a('0x1e')](_0x17b8f6)[_0x863a('0x23')](function(_0x4566b1){_0x5be215['count']=_0x4566b1;if(_0x150b0e['query']['includeAll']){_0x52ebb7[_0x863a('0x3e')]=[{'attributes':['id','name',_0x863a('0x3f'),'alias'],'model':db[_0x863a('0x40')],'as':'User'}];}return db[_0x863a('0x2a')][_0x863a('0x41')](_0x52ebb7);})['then'](function(_0x44f0c8){_0x5be215['rows']=_0x44f0c8;return _0x5be215;})[_0x863a('0x23')](respondWithFilteredResult(_0x5bf718,_0x52ebb7))[_0x863a('0x42')](handleError(_0x5bf718,null));};exports['show']=function(_0x495676,_0x2ec43f){var _0x497245={'raw':!![],'where':{'id':_0x495676[_0x863a('0x43')]['id']}},_0x269b39={};_0x269b39['model']=_[_0x863a('0x2f')](db['VoiceCallReport'][_0x863a('0x2b')]);_0x269b39[_0x863a('0x30')]=_[_0x863a('0x2f')](_0x495676[_0x863a('0x30')]);_0x269b39[_0x863a('0x31')]=_[_0x863a('0x32')](_0x269b39[_0x863a('0x2e')],_0x269b39['query']);_0x497245['attributes']=_[_0x863a('0x32')](_0x269b39[_0x863a('0x2e')],qs['fields'](_0x495676[_0x863a('0x30')][_0x863a('0x33')]));_0x497245[_0x863a('0x34')]=_0x497245[_0x863a('0x34')][_0x863a('0x35')]?_0x497245[_0x863a('0x34')]:_0x269b39['model'];if(_0x495676[_0x863a('0x30')][_0x863a('0x44')]){_0x497245['include']=[{'all':!![]}];}_0x497245=_['merge']({},_0x497245,_0x495676['options']);return db[_0x863a('0x2a')][_0x863a('0x45')](_0x497245)[_0x863a('0x23')](handleEntityNotFound(_0x2ec43f,null))['then'](respondWithResult(_0x2ec43f,null))[_0x863a('0x42')](handleError(_0x2ec43f,null));};exports['create']=function(_0x106d27,_0x5ce6c6){return db['VoiceCallReport'][_0x863a('0x46')](_0x106d27[_0x863a('0x47')],{})[_0x863a('0x23')](respondWithResult(_0x5ce6c6,0xc9))[_0x863a('0x42')](handleError(_0x5ce6c6,null));};exports['destroy']=function(_0x4d9616,_0x114c68){return db[_0x863a('0x2a')][_0x863a('0x45')]({'where':{'id':_0x4d9616[_0x863a('0x43')]['id']}})['then'](handleEntityNotFound(_0x114c68,null))[_0x863a('0x23')](removeEntity(_0x114c68,null))['catch'](handleError(_0x114c68,null));};exports[_0x863a('0x48')]=function(_0x1ad86b,_0x3a13b0){return db[_0x863a('0x2a')][_0x863a('0x48')]()[_0x863a('0x23')](respondWithResult(_0x3a13b0,null))['catch'](handleError(_0x3a13b0,null));};exports[_0x863a('0x22')]=function(_0x3cf5f2,_0x279fdc){if(_0x3cf5f2[_0x863a('0x47')][_0x863a('0x49')]){delete _0x3cf5f2[_0x863a('0x47')][_0x863a('0x49')];}return db['VoiceCallReport'][_0x863a('0x45')]({'where':{'uniqueid':_0x3cf5f2[_0x863a('0x43')]['id'],'UserId':{'$or':[null,_0x3cf5f2[_0x863a('0x4a')]['id']]}}})[_0x863a('0x23')](handleEntityNotFound(_0x279fdc,null))[_0x863a('0x23')](saveUpdates(_0x3cf5f2[_0x863a('0x47')],null))[_0x863a('0x23')](respondWithResult(_0x279fdc,null))[_0x863a('0x42')](handleError(_0x279fdc,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c54c642..48f00c2 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 _0xb858=['bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','report_call','lodash','util','api'];(function(_0x403633,_0x328fdc){var _0x416df6=function(_0x56c491){while(--_0x56c491){_0x403633['push'](_0x403633['shift']());}};_0x416df6(++_0x328fdc);}(_0xb858,0x9f));var _0x8b85=function(_0x5f84b4,_0x190e19){_0x5f84b4=_0x5f84b4-0x0;var _0x2c1c3e=_0xb858[_0x5f84b4];return _0x2c1c3e;};'use strict';var _=require(_0x8b85('0x0'));var util=require(_0x8b85('0x1'));var logger=require('../../config/logger')(_0x8b85('0x2'));var moment=require('moment');var BPromise=require(_0x8b85('0x3'));var rp=require(_0x8b85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b85('0x5'));var config=require(_0x8b85('0x6'));var attributes=require(_0x8b85('0x7'));module['exports']=function(_0x21e72d,_0x25d09a){return _0x21e72d['define']('VoiceCallReport',attributes,{'tableName':_0x8b85('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x80f1=['../../config/logger','moment','request-promise','path','rimraf','./voiceCallReport.attributes','exports','VoiceCallReport','uniqueid','lodash','util'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x80f1,0x1c1));var _0x180f=function(_0x1df83c,_0x1f4e23){_0x1df83c=_0x1df83c-0x0;var _0x16933a=_0x80f1[_0x1df83c];return _0x16933a;};'use strict';var _=require(_0x180f('0x0'));var util=require(_0x180f('0x1'));var logger=require(_0x180f('0x2'))('api');var moment=require(_0x180f('0x3'));var BPromise=require('bluebird');var rp=require(_0x180f('0x4'));var fs=require('fs');var path=require(_0x180f('0x5'));var rimraf=require(_0x180f('0x6'));var config=require('../../config/environment');var attributes=require(_0x180f('0x7'));module[_0x180f('0x8')]=function(_0x23fe75,_0x3ebb34){return _0x23fe75['define'](_0x180f('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x180f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index bb99b6e..5338f86 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 _0x694a=['UpdateVoiceCallReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','limit','include','attributes','map','model','CreateVoiceCallReport','create'];(function(_0x39649f,_0x4e0e87){var _0x4edf8a=function(_0x502901){while(--_0x502901){_0x39649f['push'](_0x39649f['shift']());}};_0x4edf8a(++_0x4e0e87);}(_0x694a,0x76));var _0xa694=function(_0x1ef8c2,_0x53bd14){_0x1ef8c2=_0x1ef8c2-0x0;var _0x394a67=_0x694a[_0x1ef8c2];return _0x394a67;};'use strict';var _=require(_0xa694('0x0'));var util=require(_0xa694('0x1'));var moment=require(_0xa694('0x2'));var BPromise=require(_0xa694('0x3'));var rs=require(_0xa694('0x4'));var fs=require('fs');var Redis=require(_0xa694('0x5'));var db=require(_0xa694('0x6'))['db'];var utils=require(_0xa694('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa694('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa694('0x9')][_0xa694('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278377,_0x23a91f,_0x4f947c){return new BPromise(function(_0x2e19ee,_0x818d5d){return client[_0xa694('0xb')](_0x278377,_0x4f947c)[_0xa694('0xc')](function(_0x27fa0b){logger[_0xa694('0xd')](_0xa694('0xe'),_0x23a91f,_0xa694('0xf'));logger[_0xa694('0x10')](_0xa694('0x11'),_0x23a91f,_0xa694('0xf'),JSON[_0xa694('0x12')](_0x27fa0b));if(_0x27fa0b[_0xa694('0x13')]){if(_0x27fa0b[_0xa694('0x13')]['code']===0x1f4){logger[_0xa694('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x23a91f,_0x27fa0b['error'][_0xa694('0x14')]);return _0x818d5d(_0x27fa0b['error'][_0xa694('0x14')]);}logger['error'](_0xa694('0xe'),_0x23a91f,_0x27fa0b[_0xa694('0x13')][_0xa694('0x14')]);return _0x2e19ee(_0x27fa0b['error'][_0xa694('0x14')]);}else{logger[_0xa694('0xd')](_0xa694('0xe'),_0x23a91f,_0xa694('0xf'));_0x2e19ee(_0x27fa0b[_0xa694('0x15')][_0xa694('0x14')]);}})[_0xa694('0x16')](function(_0x1449cc){logger[_0xa694('0x13')](_0xa694('0xe'),_0x23a91f,_0x1449cc);_0x818d5d(_0x1449cc);});});}exports[_0xa694('0x17')]=function(_0x19da3a){var _0x90e379=this;return new Promise(function(_0x2d4256,_0x16c745){return db[_0xa694('0x18')]['findAll']({'raw':_0x19da3a[_0xa694('0x19')]?_0x19da3a[_0xa694('0x19')][_0xa694('0x1a')]===undefined?!![]:![]:!![],'where':_0x19da3a[_0xa694('0x19')]?_0x19da3a[_0xa694('0x19')]['where']||null:null,'attributes':_0x19da3a['options']?_0x19da3a['options']['attributes']||null:null,'limit':_0x19da3a[_0xa694('0x19')]?_0x19da3a[_0xa694('0x19')][_0xa694('0x1b')]||null:null,'include':_0x19da3a[_0xa694('0x19')]?_0x19da3a['options'][_0xa694('0x1c')]?_['map'](_0x19da3a['options'][_0xa694('0x1c')],function(_0x4090a6){return{'model':db[_0x4090a6['model']],'as':_0x4090a6['as'],'attributes':_0x4090a6[_0xa694('0x1d')],'include':_0x4090a6['include']?_[_0xa694('0x1e')](_0x4090a6[_0xa694('0x1c')],function(_0x163813){return{'model':db[_0x163813[_0xa694('0x1f')]],'as':_0x163813['as'],'attributes':_0x163813[_0xa694('0x1d')],'include':_0x163813['include']?_[_0xa694('0x1e')](_0x163813[_0xa694('0x1c')],function(_0x22190b){return{'model':db[_0x22190b[_0xa694('0x1f')]],'as':_0x22190b['as'],'attributes':_0x22190b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa694('0xc')](function(_0x3891de){logger[_0xa694('0xd')](_0xa694('0x17'),_0x19da3a);logger['debug'](_0xa694('0x17'),_0x19da3a,JSON[_0xa694('0x12')](_0x3891de));_0x2d4256(_0x3891de);})[_0xa694('0x16')](function(_0x43ed4f){logger[_0xa694('0x13')]('GetVoiceCallReport',_0x43ed4f[_0xa694('0x14')],_0x19da3a);_0x16c745(_0x90e379[_0xa694('0x13')](0x1f4,_0x43ed4f[_0xa694('0x14')]));});});};exports[_0xa694('0x20')]=function(_0x59cbc4){var _0x3f4135=this;return new Promise(function(_0x408cc5,_0x5b0d02){return db[_0xa694('0x18')][_0xa694('0x21')](_0x59cbc4['body'],{'raw':_0x59cbc4[_0xa694('0x19')]?_0x59cbc4[_0xa694('0x19')][_0xa694('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x71c8ab){logger[_0xa694('0xd')](_0xa694('0x20'),_0x59cbc4);logger[_0xa694('0x10')](_0xa694('0x20'),_0x59cbc4,JSON[_0xa694('0x12')](_0x71c8ab));_0x408cc5(_0x71c8ab);})[_0xa694('0x16')](function(_0x4759b5){logger[_0xa694('0x13')]('CreateVoiceCallReport',_0x4759b5[_0xa694('0x14')],_0x59cbc4);_0x5b0d02(_0x3f4135[_0xa694('0x13')](0x1f4,_0x4759b5[_0xa694('0x14')]));});});};exports[_0xa694('0x22')]=function(_0x58ee20){var _0x42bd6f=this;return new Promise(function(_0x534cc0,_0x14d243){return db[_0xa694('0x18')][_0xa694('0x23')](_0x58ee20[_0xa694('0x24')],{'raw':_0x58ee20['options']?_0x58ee20['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ee20[_0xa694('0x19')]?_0x58ee20[_0xa694('0x19')][_0xa694('0x25')]||null:null,'attributes':_0x58ee20[_0xa694('0x19')]?_0x58ee20[_0xa694('0x19')][_0xa694('0x1d')]||null:null,'limit':_0x58ee20['options']?_0x58ee20[_0xa694('0x19')][_0xa694('0x1b')]||null:null})[_0xa694('0xc')](function(_0xfd9eb7){logger[_0xa694('0xd')](_0xa694('0x22'),_0x58ee20);logger[_0xa694('0x10')](_0xa694('0x22'),_0x58ee20,JSON[_0xa694('0x12')](_0xfd9eb7));_0x534cc0(_0xfd9eb7);})[_0xa694('0x16')](function(_0x4d7c2d){logger[_0xa694('0x13')]('UpdateVoiceCallReport',_0x4d7c2d['message'],_0x58ee20);_0x14d243(_0x42bd6f[_0xa694('0x13')](0x1f4,_0x4d7c2d[_0xa694('0x14')]));});});}; \ No newline at end of file +var _0x6521=['request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3aac36,_0x287fe1){var _0x519fe0=function(_0x1da7de){while(--_0x1da7de){_0x3aac36['push'](_0x3aac36['shift']());}};_0x519fe0(++_0x287fe1);}(_0x6521,0x91));var _0x1652=function(_0xd41ece,_0x241cdb){_0xd41ece=_0xd41ece-0x0;var _0x5e2da2=_0x6521[_0xd41ece];return _0x5e2da2;};'use strict';var _=require(_0x1652('0x0'));var util=require(_0x1652('0x1'));var moment=require(_0x1652('0x2'));var BPromise=require(_0x1652('0x3'));var rs=require(_0x1652('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1652('0x5'))['db'];var utils=require(_0x1652('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1652('0x7'));var jayson=require(_0x1652('0x8'));var client=jayson[_0x1652('0x9')][_0x1652('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334a1f,_0x37c33a,_0x477cfc){return new BPromise(function(_0x49195d,_0x2bf3af){return client[_0x1652('0xb')](_0x334a1f,_0x477cfc)[_0x1652('0xc')](function(_0x2162e3){logger[_0x1652('0xd')](_0x1652('0xe'),_0x37c33a,_0x1652('0xf'));logger[_0x1652('0x10')](_0x1652('0x11'),_0x37c33a,_0x1652('0xf'),JSON['stringify'](_0x2162e3));if(_0x2162e3[_0x1652('0x12')]){if(_0x2162e3[_0x1652('0x12')][_0x1652('0x13')]===0x1f4){logger[_0x1652('0x12')](_0x1652('0xe'),_0x37c33a,_0x2162e3[_0x1652('0x12')][_0x1652('0x14')]);return _0x2bf3af(_0x2162e3[_0x1652('0x12')][_0x1652('0x14')]);}logger['error'](_0x1652('0xe'),_0x37c33a,_0x2162e3[_0x1652('0x12')][_0x1652('0x14')]);return _0x49195d(_0x2162e3[_0x1652('0x12')]['message']);}else{logger[_0x1652('0xd')](_0x1652('0xe'),_0x37c33a,_0x1652('0xf'));_0x49195d(_0x2162e3[_0x1652('0x15')][_0x1652('0x14')]);}})[_0x1652('0x16')](function(_0xe36443){logger[_0x1652('0x12')](_0x1652('0xe'),_0x37c33a,_0xe36443);_0x2bf3af(_0xe36443);});});}exports[_0x1652('0x17')]=function(_0x5a37c1){var _0x57ac4e=this;return new Promise(function(_0x1e29a9,_0x4ca00b){return db[_0x1652('0x18')][_0x1652('0x19')]({'raw':_0x5a37c1[_0x1652('0x1a')]?_0x5a37c1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a37c1[_0x1652('0x1a')]?_0x5a37c1[_0x1652('0x1a')][_0x1652('0x1b')]||null:null,'attributes':_0x5a37c1[_0x1652('0x1a')]?_0x5a37c1[_0x1652('0x1a')][_0x1652('0x1c')]||null:null,'limit':_0x5a37c1['options']?_0x5a37c1[_0x1652('0x1a')][_0x1652('0x1d')]||null:null,'include':_0x5a37c1['options']?_0x5a37c1[_0x1652('0x1a')][_0x1652('0x1e')]?_[_0x1652('0x1f')](_0x5a37c1['options']['include'],function(_0x367f7){return{'model':db[_0x367f7[_0x1652('0x20')]],'as':_0x367f7['as'],'attributes':_0x367f7['attributes'],'include':_0x367f7[_0x1652('0x1e')]?_[_0x1652('0x1f')](_0x367f7[_0x1652('0x1e')],function(_0x9cbb28){return{'model':db[_0x9cbb28[_0x1652('0x20')]],'as':_0x9cbb28['as'],'attributes':_0x9cbb28['attributes'],'include':_0x9cbb28['include']?_[_0x1652('0x1f')](_0x9cbb28[_0x1652('0x1e')],function(_0x322494){return{'model':db[_0x322494[_0x1652('0x20')]],'as':_0x322494['as'],'attributes':_0x322494[_0x1652('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1652('0xc')](function(_0x35fce2){logger[_0x1652('0xd')]('GetVoiceCallReport',_0x5a37c1);logger[_0x1652('0x10')](_0x1652('0x17'),_0x5a37c1,JSON[_0x1652('0x21')](_0x35fce2));_0x1e29a9(_0x35fce2);})[_0x1652('0x16')](function(_0x71eaeb){logger['error'](_0x1652('0x17'),_0x71eaeb['message'],_0x5a37c1);_0x4ca00b(_0x57ac4e[_0x1652('0x12')](0x1f4,_0x71eaeb[_0x1652('0x14')]));});});};exports[_0x1652('0x22')]=function(_0x56b9d2){var _0x4e1ded=this;return new Promise(function(_0x2e5041,_0x35ef2a){return db[_0x1652('0x18')][_0x1652('0x23')](_0x56b9d2['body'],{'raw':_0x56b9d2[_0x1652('0x1a')]?_0x56b9d2['options']['raw']===undefined?!![]:![]:!![]})[_0x1652('0xc')](function(_0x56cb5e){logger[_0x1652('0xd')](_0x1652('0x22'),_0x56b9d2);logger['debug']('CreateVoiceCallReport',_0x56b9d2,JSON[_0x1652('0x21')](_0x56cb5e));_0x2e5041(_0x56cb5e);})['catch'](function(_0x37c4af){logger[_0x1652('0x12')](_0x1652('0x22'),_0x37c4af['message'],_0x56b9d2);_0x35ef2a(_0x4e1ded[_0x1652('0x12')](0x1f4,_0x37c4af[_0x1652('0x14')]));});});};exports[_0x1652('0x24')]=function(_0x3cf61e){var _0x32e04d=this;return new Promise(function(_0x15a5e3,_0x293f36){return db[_0x1652('0x18')][_0x1652('0x25')](_0x3cf61e['body'],{'raw':_0x3cf61e[_0x1652('0x1a')]?_0x3cf61e[_0x1652('0x1a')][_0x1652('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cf61e[_0x1652('0x1a')]?_0x3cf61e[_0x1652('0x1a')][_0x1652('0x1b')]||null:null,'attributes':_0x3cf61e['options']?_0x3cf61e[_0x1652('0x1a')][_0x1652('0x1c')]||null:null,'limit':_0x3cf61e[_0x1652('0x1a')]?_0x3cf61e[_0x1652('0x1a')][_0x1652('0x1d')]||null:null})[_0x1652('0xc')](function(_0x223781){logger['info'](_0x1652('0x24'),_0x3cf61e);logger[_0x1652('0x10')](_0x1652('0x24'),_0x3cf61e,JSON[_0x1652('0x21')](_0x223781));_0x15a5e3(_0x223781);})[_0x1652('0x16')](function(_0x319273){logger[_0x1652('0x12')](_0x1652('0x24'),_0x319273[_0x1652('0x14')],_0x3cf61e);_0x293f36(_0x32e04d[_0x1652('0x12')](0x1f4,_0x319273['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index fd78aeb..30a7dfd 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 _0x2c8f=['destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x438fea,_0x3444e8){var _0x4069a5=function(_0x1595ee){while(--_0x1595ee){_0x438fea['push'](_0x438fea['shift']());}};_0x4069a5(++_0x3444e8);}(_0x2c8f,0x192));var _0xf2c8=function(_0x408287,_0x37512d){_0x408287=_0x408287-0x0;var _0x40715c=_0x2c8f[_0x408287];return _0x40715c;};'use strict';var multer=require('multer');var util=require(_0xf2c8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2c8('0x1')]();var auth=require(_0xf2c8('0x2'));var interaction=require(_0xf2c8('0x3'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xf2c8('0x4')]('/',auth[_0xf2c8('0x5')](),controller[_0xf2c8('0x6')]);router[_0xf2c8('0x4')](_0xf2c8('0x7'),auth['isAuthenticated'](),controller[_0xf2c8('0x8')]);router[_0xf2c8('0x9')]('/',auth[_0xf2c8('0x5')](),controller[_0xf2c8('0xa')]);router[_0xf2c8('0xb')](_0xf2c8('0x7'),auth['isAuthenticated'](),controller[_0xf2c8('0xc')]);router[_0xf2c8('0xd')](_0xf2c8('0x7'),auth[_0xf2c8('0x5')](),controller[_0xf2c8('0xe')]);module[_0xf2c8('0xf')]=router; \ No newline at end of file +var _0xd9dc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd9dc,0x18b));var _0xcd9d=function(_0x125cb4,_0xd3bfd8){_0x125cb4=_0x125cb4-0x0;var _0x22579d=_0xd9dc[_0x125cb4];return _0x22579d;};'use strict';var multer=require(_0xcd9d('0x0'));var util=require('util');var path=require(_0xcd9d('0x1'));var timeout=require(_0xcd9d('0x2'));var express=require(_0xcd9d('0x3'));var router=express[_0xcd9d('0x4')]();var auth=require(_0xcd9d('0x5'));var interaction=require(_0xcd9d('0x6'));var config=require(_0xcd9d('0x7'));var controller=require(_0xcd9d('0x8'));router[_0xcd9d('0x9')]('/',auth[_0xcd9d('0xa')](),controller[_0xcd9d('0xb')]);router[_0xcd9d('0x9')](_0xcd9d('0xc'),auth[_0xcd9d('0xa')](),controller['show']);router[_0xcd9d('0xd')]('/',auth[_0xcd9d('0xa')](),controller[_0xcd9d('0xe')]);router[_0xcd9d('0xf')](_0xcd9d('0xc'),auth[_0xcd9d('0xa')](),controller[_0xcd9d('0x10')]);router[_0xcd9d('0x11')](_0xcd9d('0xc'),auth[_0xcd9d('0xa')](),controller[_0xcd9d('0x12')]);module[_0xcd9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 0f3480b..65b3ea0 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 _0x9181=['name','setDataValue','options','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x103a35,_0x530953){var _0x6a3143=function(_0x241e84){while(--_0x241e84){_0x103a35['push'](_0x103a35['shift']());}};_0x6a3143(++_0x530953);}(_0x9181,0xa6));var _0x1918=function(_0x180928,_0x5277ff){_0x180928=_0x180928-0x0;var _0x519412=_0x9181[_0x180928];return _0x519412;};'use strict';var Sequelize=require(_0x1918('0x0'));module['exports']={'name':{'type':Sequelize[_0x1918('0x1')]},'prefix':{'type':Sequelize[_0x1918('0x1')],'unique':_0x1918('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1918('0x1')],'set':function(_0x555dca){this[_0x1918('0x3')](_0x1918('0x4'),_0x555dca?_0x555dca['join'](''):[]);},'get':function(){return this[_0x1918('0x5')](_0x1918('0x4'))?this['getDataValue'](_0x1918('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x1918('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x1918('0x1')]},'record':{'type':Sequelize[_0x1918('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1918('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x725c=['name','options','join','getDataValue','BOOLEAN','STRING'];(function(_0x2d6549,_0x916739){var _0x493273=function(_0x23ae46){while(--_0x23ae46){_0x2d6549['push'](_0x2d6549['shift']());}};_0x493273(++_0x916739);}(_0x725c,0x197));var _0xc725=function(_0x5c2d24,_0x1c1173){_0x5c2d24=_0x5c2d24-0x0;var _0x416f96=_0x725c[_0x5c2d24];return _0x416f96;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc725('0x0')],'unique':_0xc725('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xc725('0x0')],'set':function(_0x358a61){this['setDataValue'](_0xc725('0x2'),_0x358a61?_0x358a61[_0xc725('0x3')](''):[]);},'get':function(){return this[_0xc725('0x4')]('options')?this[_0xc725('0x4')](_0xc725('0x2'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc725('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0xc725('0x0')]},'record':{'type':Sequelize[_0xc725('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index c2105f7..390f3e6 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 _0x6bb2=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','VIRTUAL','filter','merge','options','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x5e7388,_0x2ac0a4){var _0x52adb3=function(_0x36429f){while(--_0x36429f){_0x5e7388['push'](_0x5e7388['shift']());}};_0x52adb3(++_0x2ac0a4);}(_0x6bb2,0x1c7));var _0x26bb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x6bb2[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0x26bb('0x0'));var emlformat=require(_0x26bb('0x1'));var rimraf=require(_0x26bb('0x2'));var zipdir=require(_0x26bb('0x3'));var jsonpatch=require(_0x26bb('0x4'));var rp=require(_0x26bb('0x5'));var moment=require(_0x26bb('0x6'));var BPromise=require(_0x26bb('0x7'));var Mustache=require(_0x26bb('0x8'));var util=require(_0x26bb('0x9'));var path=require(_0x26bb('0xa'));var sox=require(_0x26bb('0xb'));var csv=require(_0x26bb('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x26bb('0xd'));var squel=require(_0x26bb('0xe'));var crypto=require(_0x26bb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x26bb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x26bb('0x11'));var Papa=require(_0x26bb('0x12'));var Redis=require(_0x26bb('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x26bb('0x14'));var as=require(_0x26bb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26bb('0x16'))(_0x26bb('0x17'));var utils=require(_0x26bb('0x18'));var config=require(_0x26bb('0x19'));var db=require(_0x26bb('0x1a'))['db'];function respondWithStatusCode(_0x15f1ba,_0x171a9b){_0x171a9b=_0x171a9b||0xcc;return function(_0x3db8e1){if(_0x3db8e1){return _0x15f1ba[_0x26bb('0x1b')](_0x171a9b);}return _0x15f1ba[_0x26bb('0x1c')](_0x171a9b)[_0x26bb('0x1d')]();};}function respondWithResult(_0xa825,_0x29826e){_0x29826e=_0x29826e||0xc8;return function(_0x57b056){if(_0x57b056){return _0xa825['status'](_0x29826e)[_0x26bb('0x1e')](_0x57b056);}};}function respondWithFilteredResult(_0x28a1e8,_0x15e219){return function(_0x196d59){if(_0x196d59){var _0x483fbb=_0x196d59[_0x26bb('0x1f')],_0x2d677a=_0x15e219[_0x26bb('0x20')],_0x46a75a=_0x15e219[_0x26bb('0x20')]+_0x15e219[_0x26bb('0x21')],_0xcc2c8c;if(_0x46a75a>=_0x483fbb){_0x46a75a=_0x483fbb;_0xcc2c8c=0xc8;}else{_0xcc2c8c=0xce;}_0x28a1e8[_0x26bb('0x1c')](_0xcc2c8c);return _0x28a1e8[_0x26bb('0x22')]('Content-Range',_0x2d677a+'-'+_0x46a75a+'/'+_0x483fbb)[_0x26bb('0x1e')](_0x196d59);}return null;};}function patchUpdates(_0x36473d){return function(_0x164c97){try{jsonpatch[_0x26bb('0x23')](_0x164c97,_0x36473d,!![]);}catch(_0x5950fd){return BPromise[_0x26bb('0x24')](_0x5950fd);}return _0x164c97[_0x26bb('0x25')]();};}function saveUpdates(_0x217022,_0x35c3b5){return function(_0x406207){if(_0x406207){return _0x406207[_0x26bb('0x26')](_0x217022)[_0x26bb('0x27')](function(_0x7f562){return _0x7f562;});}return null;};}function removeEntity(_0x203978,_0x52fe63){return function(_0x23bb95){if(_0x23bb95){return _0x23bb95['destroy']()[_0x26bb('0x27')](function(){var _0x449b28=_0x23bb95[_0x26bb('0x28')]({'plain':!![]});var _0x3cc0dc=_0x26bb('0x29');return db[_0x26bb('0x2a')]['destroy']({'where':{'type':_0x3cc0dc,'resourceId':_0x449b28['id']}})[_0x26bb('0x27')](function(){return _0x23bb95;});})[_0x26bb('0x27')](function(){_0x203978[_0x26bb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28fc85,_0x1f871e){return function(_0x8c087){if(!_0x8c087){_0x28fc85[_0x26bb('0x1b')](0x194);}return _0x8c087;};}function handleError(_0x146e3f,_0x1107c2){_0x1107c2=_0x1107c2||0x1f4;return function(_0x184ec4){logger['error'](_0x184ec4[_0x26bb('0x2b')]);if(_0x184ec4[_0x26bb('0x2c')]){delete _0x184ec4[_0x26bb('0x2c')];}_0x146e3f[_0x26bb('0x1c')](_0x1107c2)[_0x26bb('0x2d')](_0x184ec4);};}exports[_0x26bb('0x2e')]=function(_0x46973e,_0x16e487){var _0x9260d4={},_0x233fbc={},_0x299cbe={'count':0x0,'rows':[]};var _0x360ed3=_[_0x26bb('0x2f')](db[_0x26bb('0x30')][_0x26bb('0x31')],function(_0x3bf093){return{'name':_0x3bf093[_0x26bb('0x32')],'type':_0x3bf093[_0x26bb('0x33')]['key']};});_0x233fbc[_0x26bb('0x34')]=_['map'](_0x360ed3,_0x26bb('0x2c'));_0x233fbc[_0x26bb('0x35')]=_[_0x26bb('0x36')](_0x46973e[_0x26bb('0x35')]);_0x233fbc[_0x26bb('0x37')]=_[_0x26bb('0x38')](_0x233fbc[_0x26bb('0x34')],_0x233fbc['query']);_0x9260d4[_0x26bb('0x39')]=_[_0x26bb('0x38')](_0x233fbc[_0x26bb('0x34')],qs[_0x26bb('0x3a')](_0x46973e[_0x26bb('0x35')][_0x26bb('0x3a')]));_0x9260d4['attributes']=_0x9260d4['attributes'][_0x26bb('0x3b')]?_0x9260d4[_0x26bb('0x39')]:_0x233fbc[_0x26bb('0x34')];if(!_0x46973e[_0x26bb('0x35')]['hasOwnProperty'](_0x26bb('0x3c'))){_0x9260d4['limit']=qs['limit'](_0x46973e[_0x26bb('0x35')][_0x26bb('0x21')]);_0x9260d4[_0x26bb('0x20')]=qs[_0x26bb('0x20')](_0x46973e[_0x26bb('0x35')][_0x26bb('0x20')]);}_0x9260d4['order']=qs[_0x26bb('0x3d')](_0x46973e[_0x26bb('0x35')][_0x26bb('0x3d')]);_0x9260d4[_0x26bb('0x3e')]=qs[_0x26bb('0x37')](_['pick'](_0x46973e['query'],_0x233fbc[_0x26bb('0x37')]),_0x360ed3);if(_0x46973e[_0x26bb('0x35')]['filter']){_0x9260d4[_0x26bb('0x3e')]=_['merge'](_0x9260d4[_0x26bb('0x3e')],{'$or':_[_0x26bb('0x2f')](_0x360ed3,function(_0x48ec6b){if(_0x48ec6b[_0x26bb('0x33')]!==_0x26bb('0x3f')){var _0x29a4b8={};_0x29a4b8[_0x48ec6b[_0x26bb('0x2c')]]={'$like':'%'+_0x46973e['query'][_0x26bb('0x40')]+'%'};return _0x29a4b8;}})});}_0x9260d4=_[_0x26bb('0x41')]({},_0x9260d4,_0x46973e[_0x26bb('0x42')]);var _0x49abd4={'where':_0x9260d4[_0x26bb('0x3e')]};return db['VoiceChanSpy'][_0x26bb('0x1f')](_0x49abd4)[_0x26bb('0x27')](function(_0x434fb9){_0x299cbe[_0x26bb('0x1f')]=_0x434fb9;if(_0x46973e['query']['includeAll']){_0x9260d4['include']=[{'all':!![]}];}return db[_0x26bb('0x30')][_0x26bb('0x43')](_0x9260d4);})[_0x26bb('0x27')](function(_0x48bb4a){_0x299cbe['rows']=_0x48bb4a;return _0x299cbe;})[_0x26bb('0x27')](respondWithFilteredResult(_0x16e487,_0x9260d4))['catch'](handleError(_0x16e487,null));};exports[_0x26bb('0x44')]=function(_0x436518,_0x1b571d){var _0x503035={'raw':![],'where':{'id':_0x436518[_0x26bb('0x45')]['id']}},_0x4e27a6={};_0x4e27a6[_0x26bb('0x34')]=_[_0x26bb('0x36')](db[_0x26bb('0x30')]['rawAttributes']);_0x4e27a6[_0x26bb('0x35')]=_[_0x26bb('0x36')](_0x436518[_0x26bb('0x35')]);_0x4e27a6[_0x26bb('0x37')]=_['intersection'](_0x4e27a6['model'],_0x4e27a6[_0x26bb('0x35')]);_0x503035[_0x26bb('0x39')]=_[_0x26bb('0x38')](_0x4e27a6['model'],qs[_0x26bb('0x3a')](_0x436518[_0x26bb('0x35')][_0x26bb('0x3a')]));_0x503035['attributes']=_0x503035['attributes'][_0x26bb('0x3b')]?_0x503035[_0x26bb('0x39')]:_0x4e27a6[_0x26bb('0x34')];if(_0x436518['query']['includeAll']){_0x503035[_0x26bb('0x46')]=[{'all':!![]}];}_0x503035=_[_0x26bb('0x41')]({},_0x503035,_0x436518[_0x26bb('0x42')]);return db[_0x26bb('0x30')][_0x26bb('0x47')](_0x503035)['then'](handleEntityNotFound(_0x1b571d,null))[_0x26bb('0x27')](respondWithResult(_0x1b571d,null))[_0x26bb('0x48')](handleError(_0x1b571d,null));};exports[_0x26bb('0x49')]=function(_0x1792b9,_0x5e3239){return db[_0x26bb('0x30')][_0x26bb('0x49')](_0x1792b9[_0x26bb('0x4a')],{})[_0x26bb('0x27')](function(_0x29250d){var _0x5e28ab=_0x1792b9[_0x26bb('0x4b')]['get']({'plain':!![]});if(!_0x5e28ab)throw new Error(_0x26bb('0x4c'));if(_0x5e28ab['role']===_0x26bb('0x4b')){var _0x52bf6b=_0x29250d[_0x26bb('0x28')]({'plain':!![]});var _0x536570=_0x26bb('0x29');return db['UserProfileSection'][_0x26bb('0x47')]({'where':{'name':_0x536570,'userProfileId':_0x5e28ab[_0x26bb('0x4d')]},'raw':!![]})['then'](function(_0x30ff15){if(_0x30ff15&&_0x30ff15['autoAssociation']===0x0){return db['UserProfileResource'][_0x26bb('0x49')]({'name':_0x52bf6b[_0x26bb('0x2c')],'resourceId':_0x52bf6b['id'],'type':_0x30ff15[_0x26bb('0x2c')],'sectionId':_0x30ff15['id']},{})[_0x26bb('0x27')](function(){return _0x29250d;});}else{return _0x29250d;}})['catch'](function(_0x43b3ec){logger[_0x26bb('0x4e')](_0x26bb('0x4f'),_0x43b3ec);throw _0x43b3ec;});}return _0x29250d;})[_0x26bb('0x27')](respondWithResult(_0x5e3239,0xc9))[_0x26bb('0x48')](handleError(_0x5e3239,null));};exports[_0x26bb('0x26')]=function(_0x59ef3a,_0x58eaa2){if(_0x59ef3a['body']['id']){delete _0x59ef3a['body']['id'];}return db[_0x26bb('0x30')][_0x26bb('0x47')]({'where':{'id':_0x59ef3a[_0x26bb('0x45')]['id']}})[_0x26bb('0x27')](handleEntityNotFound(_0x58eaa2,null))[_0x26bb('0x27')](saveUpdates(_0x59ef3a[_0x26bb('0x4a')],null))[_0x26bb('0x27')](respondWithResult(_0x58eaa2,null))['catch'](handleError(_0x58eaa2,null));};exports['destroy']=function(_0xfc7137,_0x1e9d0c){return db[_0x26bb('0x30')][_0x26bb('0x47')]({'where':{'id':_0xfc7137['params']['id']}})[_0x26bb('0x27')](handleEntityNotFound(_0x1e9d0c,null))[_0x26bb('0x27')](removeEntity(_0x1e9d0c,null))[_0x26bb('0x48')](handleError(_0x1e9d0c,null));}; \ No newline at end of file +var _0xb07d=['name','send','index','map','VoiceChanSpy','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','destroy','get','UserProfileResource','error','stack'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0xb07d,0x10d));var _0xdb07=function(_0x516adf,_0x8c64dd){_0x516adf=_0x516adf-0x0;var _0xd6f7ff=_0xb07d[_0x516adf];return _0xd6f7ff;};'use strict';var pdf=require(_0xdb07('0x0'));var emlformat=require(_0xdb07('0x1'));var rimraf=require(_0xdb07('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdb07('0x3'));var moment=require('moment');var BPromise=require(_0xdb07('0x4'));var Mustache=require('mustache');var util=require(_0xdb07('0x5'));var path=require(_0xdb07('0x6'));var sox=require('sox');var csv=require(_0xdb07('0x7'));var ejs=require(_0xdb07('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdb07('0x9'));var crypto=require('crypto');var jsforce=require(_0xdb07('0xa'));var deskjs=require(_0xdb07('0xb'));var toCsv=require(_0xdb07('0x7'));var querystring=require(_0xdb07('0xc'));var Papa=require(_0xdb07('0xd'));var Redis=require(_0xdb07('0xe'));var authService=require(_0xdb07('0xf'));var qs=require(_0xdb07('0x10'));var as=require(_0xdb07('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb07('0x12'))(_0xdb07('0x13'));var utils=require(_0xdb07('0x14'));var config=require(_0xdb07('0x15'));var db=require(_0xdb07('0x16'))['db'];function respondWithStatusCode(_0x3e1de5,_0x4d065d){_0x4d065d=_0x4d065d||0xcc;return function(_0x3684a7){if(_0x3684a7){return _0x3e1de5[_0xdb07('0x17')](_0x4d065d);}return _0x3e1de5[_0xdb07('0x18')](_0x4d065d)[_0xdb07('0x19')]();};}function respondWithResult(_0x58acc7,_0x4f6fd8){_0x4f6fd8=_0x4f6fd8||0xc8;return function(_0x544f82){if(_0x544f82){return _0x58acc7[_0xdb07('0x18')](_0x4f6fd8)[_0xdb07('0x1a')](_0x544f82);}};}function respondWithFilteredResult(_0x53373d,_0x202094){return function(_0x5b0b00){if(_0x5b0b00){var _0x5cfb15=_0x5b0b00[_0xdb07('0x1b')],_0x30dfab=_0x202094[_0xdb07('0x1c')],_0x495547=_0x202094[_0xdb07('0x1c')]+_0x202094[_0xdb07('0x1d')],_0x1dfb25;if(_0x495547>=_0x5cfb15){_0x495547=_0x5cfb15;_0x1dfb25=0xc8;}else{_0x1dfb25=0xce;}_0x53373d[_0xdb07('0x18')](_0x1dfb25);return _0x53373d['set']('Content-Range',_0x30dfab+'-'+_0x495547+'/'+_0x5cfb15)['json'](_0x5b0b00);}return null;};}function patchUpdates(_0x3c7ef6){return function(_0x2ecf1f){try{jsonpatch['apply'](_0x2ecf1f,_0x3c7ef6,!![]);}catch(_0xf3b10c){return BPromise[_0xdb07('0x1e')](_0xf3b10c);}return _0x2ecf1f[_0xdb07('0x1f')]();};}function saveUpdates(_0x5e7dce,_0x2c6283){return function(_0x223d24){if(_0x223d24){return _0x223d24[_0xdb07('0x20')](_0x5e7dce)[_0xdb07('0x21')](function(_0x279327){return _0x279327;});}return null;};}function removeEntity(_0x1691fe,_0x2e1358){return function(_0x2dfdc1){if(_0x2dfdc1){return _0x2dfdc1[_0xdb07('0x22')]()[_0xdb07('0x21')](function(){var _0x44656b=_0x2dfdc1[_0xdb07('0x23')]({'plain':!![]});var _0x3c4c56='ChanSpies';return db[_0xdb07('0x24')][_0xdb07('0x22')]({'where':{'type':_0x3c4c56,'resourceId':_0x44656b['id']}})[_0xdb07('0x21')](function(){return _0x2dfdc1;});})[_0xdb07('0x21')](function(){_0x1691fe[_0xdb07('0x18')](0xcc)[_0xdb07('0x19')]();});}};}function handleEntityNotFound(_0x5c9aa8,_0x445a04){return function(_0x2434e6){if(!_0x2434e6){_0x5c9aa8[_0xdb07('0x17')](0x194);}return _0x2434e6;};}function handleError(_0xdbccb0,_0x21fed9){_0x21fed9=_0x21fed9||0x1f4;return function(_0x509edf){logger[_0xdb07('0x25')](_0x509edf[_0xdb07('0x26')]);if(_0x509edf[_0xdb07('0x27')]){delete _0x509edf[_0xdb07('0x27')];}_0xdbccb0[_0xdb07('0x18')](_0x21fed9)[_0xdb07('0x28')](_0x509edf);};}exports[_0xdb07('0x29')]=function(_0x5c6409,_0x38d537){var _0x40d824={},_0x2b662a={},_0x5a7472={'count':0x0,'rows':[]};var _0x5d67c9=_[_0xdb07('0x2a')](db[_0xdb07('0x2b')]['rawAttributes'],function(_0x29c198){return{'name':_0x29c198[_0xdb07('0x2c')],'type':_0x29c198[_0xdb07('0x2d')][_0xdb07('0x2e')]};});_0x2b662a[_0xdb07('0x2f')]=_[_0xdb07('0x2a')](_0x5d67c9,_0xdb07('0x27'));_0x2b662a['query']=_[_0xdb07('0x30')](_0x5c6409['query']);_0x2b662a['filters']=_[_0xdb07('0x31')](_0x2b662a['model'],_0x2b662a[_0xdb07('0x32')]);_0x40d824[_0xdb07('0x33')]=_[_0xdb07('0x31')](_0x2b662a[_0xdb07('0x2f')],qs[_0xdb07('0x34')](_0x5c6409[_0xdb07('0x32')]['fields']));_0x40d824[_0xdb07('0x33')]=_0x40d824[_0xdb07('0x33')][_0xdb07('0x35')]?_0x40d824['attributes']:_0x2b662a['model'];if(!_0x5c6409['query']['hasOwnProperty'](_0xdb07('0x36'))){_0x40d824[_0xdb07('0x1d')]=qs[_0xdb07('0x1d')](_0x5c6409[_0xdb07('0x32')]['limit']);_0x40d824['offset']=qs[_0xdb07('0x1c')](_0x5c6409['query']['offset']);}_0x40d824['order']=qs['sort'](_0x5c6409[_0xdb07('0x32')][_0xdb07('0x37')]);_0x40d824[_0xdb07('0x38')]=qs[_0xdb07('0x39')](_['pick'](_0x5c6409['query'],_0x2b662a[_0xdb07('0x39')]),_0x5d67c9);if(_0x5c6409[_0xdb07('0x32')][_0xdb07('0x3a')]){_0x40d824[_0xdb07('0x38')]=_[_0xdb07('0x3b')](_0x40d824[_0xdb07('0x38')],{'$or':_['map'](_0x5d67c9,function(_0x3464f7){if(_0x3464f7['type']!=='VIRTUAL'){var _0x268d3c={};_0x268d3c[_0x3464f7[_0xdb07('0x27')]]={'$like':'%'+_0x5c6409[_0xdb07('0x32')][_0xdb07('0x3a')]+'%'};return _0x268d3c;}})});}_0x40d824=_[_0xdb07('0x3b')]({},_0x40d824,_0x5c6409[_0xdb07('0x3c')]);var _0x86e416={'where':_0x40d824[_0xdb07('0x38')]};return db[_0xdb07('0x2b')][_0xdb07('0x1b')](_0x86e416)[_0xdb07('0x21')](function(_0x3db2fc){_0x5a7472[_0xdb07('0x1b')]=_0x3db2fc;if(_0x5c6409[_0xdb07('0x32')][_0xdb07('0x3d')]){_0x40d824[_0xdb07('0x3e')]=[{'all':!![]}];}return db[_0xdb07('0x2b')][_0xdb07('0x3f')](_0x40d824);})[_0xdb07('0x21')](function(_0x58729b){_0x5a7472[_0xdb07('0x40')]=_0x58729b;return _0x5a7472;})['then'](respondWithFilteredResult(_0x38d537,_0x40d824))[_0xdb07('0x41')](handleError(_0x38d537,null));};exports[_0xdb07('0x42')]=function(_0x3ccb7d,_0x11e860){var _0x3f3ff5={'raw':![],'where':{'id':_0x3ccb7d[_0xdb07('0x43')]['id']}},_0x1c9208={};_0x1c9208[_0xdb07('0x2f')]=_[_0xdb07('0x30')](db['VoiceChanSpy'][_0xdb07('0x44')]);_0x1c9208['query']=_[_0xdb07('0x30')](_0x3ccb7d['query']);_0x1c9208[_0xdb07('0x39')]=_['intersection'](_0x1c9208[_0xdb07('0x2f')],_0x1c9208[_0xdb07('0x32')]);_0x3f3ff5['attributes']=_[_0xdb07('0x31')](_0x1c9208[_0xdb07('0x2f')],qs['fields'](_0x3ccb7d[_0xdb07('0x32')][_0xdb07('0x34')]));_0x3f3ff5[_0xdb07('0x33')]=_0x3f3ff5[_0xdb07('0x33')][_0xdb07('0x35')]?_0x3f3ff5[_0xdb07('0x33')]:_0x1c9208['model'];if(_0x3ccb7d['query'][_0xdb07('0x3d')]){_0x3f3ff5[_0xdb07('0x3e')]=[{'all':!![]}];}_0x3f3ff5=_['merge']({},_0x3f3ff5,_0x3ccb7d[_0xdb07('0x3c')]);return db['VoiceChanSpy'][_0xdb07('0x45')](_0x3f3ff5)[_0xdb07('0x21')](handleEntityNotFound(_0x11e860,null))[_0xdb07('0x21')](respondWithResult(_0x11e860,null))[_0xdb07('0x41')](handleError(_0x11e860,null));};exports[_0xdb07('0x46')]=function(_0x503f54,_0x2a202c){return db[_0xdb07('0x2b')][_0xdb07('0x46')](_0x503f54[_0xdb07('0x47')],{})[_0xdb07('0x21')](function(_0x32479e){var _0x2e7d1f=_0x503f54[_0xdb07('0x48')][_0xdb07('0x23')]({'plain':!![]});if(!_0x2e7d1f)throw new Error(_0xdb07('0x49'));if(_0x2e7d1f[_0xdb07('0x4a')]===_0xdb07('0x48')){var _0x385198=_0x32479e['get']({'plain':!![]});var _0x28c548='ChanSpies';return db[_0xdb07('0x4b')]['find']({'where':{'name':_0x28c548,'userProfileId':_0x2e7d1f[_0xdb07('0x4c')]},'raw':!![]})[_0xdb07('0x21')](function(_0x33b321){if(_0x33b321&&_0x33b321['autoAssociation']===0x0){return db[_0xdb07('0x24')][_0xdb07('0x46')]({'name':_0x385198[_0xdb07('0x27')],'resourceId':_0x385198['id'],'type':_0x33b321['name'],'sectionId':_0x33b321['id']},{})[_0xdb07('0x21')](function(){return _0x32479e;});}else{return _0x32479e;}})[_0xdb07('0x41')](function(_0x4e6799){logger[_0xdb07('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e6799);throw _0x4e6799;});}return _0x32479e;})['then'](respondWithResult(_0x2a202c,0xc9))['catch'](handleError(_0x2a202c,null));};exports[_0xdb07('0x20')]=function(_0x22b455,_0x197eb1){if(_0x22b455[_0xdb07('0x47')]['id']){delete _0x22b455['body']['id'];}return db[_0xdb07('0x2b')][_0xdb07('0x45')]({'where':{'id':_0x22b455[_0xdb07('0x43')]['id']}})[_0xdb07('0x21')](handleEntityNotFound(_0x197eb1,null))[_0xdb07('0x21')](saveUpdates(_0x22b455['body'],null))[_0xdb07('0x21')](respondWithResult(_0x197eb1,null))['catch'](handleError(_0x197eb1,null));};exports['destroy']=function(_0x1a6c16,_0xebb721){return db['VoiceChanSpy'][_0xdb07('0x45')]({'where':{'id':_0x1a6c16['params']['id']}})[_0xdb07('0x21')](handleEntityNotFound(_0xebb721,null))['then'](removeEntity(_0xebb721,null))[_0xdb07('0x41')](handleError(_0xebb721,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 480e8e4..ab37d08 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 _0x377e=['length','internal','concat','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','merge','format','CDR(type)=%s','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join'];(function(_0xa0d332,_0xcd956f){var _0x50fd0c=function(_0x35f2b0){while(--_0x35f2b0){_0xa0d332['push'](_0xa0d332['shift']());}};_0x50fd0c(++_0xcd956f);}(_0x377e,0x1e2));var _0xe377=function(_0x13a61c,_0x17c53a){_0x13a61c=_0x13a61c-0x0;var _0x2d0c84=_0x377e[_0x13a61c];return _0x2d0c84;};'use strict';var _=require(_0xe377('0x0'));var util=require(_0xe377('0x1'));var BPromise=require('bluebird');var attributes=require(_0xe377('0x2'));var getUserApplications=function(_0x538d8a,_0x2d6646,_0x1c0062){var _0x167b11=0x1;var _0x344eea=[];var _0x156973={'context':_0x2d6646['context']||_0xe377('0x3'),'exten':util['format'](_0xe377('0x4'),_0x538d8a[_0xe377('0x5')],_0x1c0062),'type':_0xe377('0x6'),'isApp':![],'ChanSpyId':_0x538d8a['id'],'UserId':_0x2d6646['id']};_0x344eea['push'](_[_0xe377('0x7')]({'app':'Set','appdata':util[_0xe377('0x8')](_0xe377('0x9'),_0xe377('0xa')),'priority':_0x167b11++},_0x156973));if(_0x538d8a[_0xe377('0xb')]){_0x344eea[_0xe377('0xc')](_[_0xe377('0x7')]({'app':'MixMonitor','appdata':util[_0xe377('0x8')](_0xe377('0xd'),_0x538d8a[_0xe377('0xe')]),'priority':_0x167b11++},_0x156973));}if(_0x538d8a[_0xe377('0xf')]){_0x344eea['push'](_[_0xe377('0x7')]({'app':'Authenticate','appdata':_0x538d8a[_0xe377('0x10')],'priority':_0x167b11++},_0x156973));}_0x344eea[_0xe377('0xc')](_[_0xe377('0x7')]({'app':_0xe377('0x11'),'appdata':util['format'](_0xe377('0x12'),_0x2d6646[_0xe377('0x13')],_0x538d8a[_0xe377('0x14')]?_0x538d8a[_0xe377('0x14')][_0xe377('0x15')](''):''),'priority':_0x167b11++},_0x156973));if(_0x538d8a[_0xe377('0xb')]){_0x344eea[_0xe377('0xc')](_['merge']({'app':'StopMixMonitor','priority':_0x167b11++},_0x156973));}return _0x344eea;};var getChanSpyApplications=function(_0x4b1578,_0x2e610f){var _0x472784=[];for(var _0x373853=0x0,_0x134f2e=0x1;_0x373853<_0x2e610f[_0xe377('0x16')];_0x373853++,_0x134f2e=0x1){_0x472784=_0x472784['concat'](getUserApplications(_0x4b1578,_0x2e610f[_0x373853],_0x2e610f[_0x373853]['internal']));if(_0x2e610f[_0x373853][_0xe377('0x17')]!=_0x2e610f[_0x373853]['name']){_0x472784=_0x472784[_0xe377('0x18')](getUserApplications(_0x4b1578,_0x2e610f[_0x373853],_0x2e610f[_0x373853]['name']));}}return _0x472784;};var getChanSpyPromise=function(_0x1ff8f5,_0x4558ed){return new BPromise(function(_0x67849,_0x26c811){return _0x1ff8f5[_0xe377('0x19')][_0xe377('0x1a')]({'attributes':['id',_0xe377('0x13'),'internal'],'where':{'role':_0xe377('0x1b'),'chanspy':!![]},'raw':!![]})[_0xe377('0x1c')](function(_0x128547){if(_0x128547){return _0x67849(getChanSpyApplications(_0x4558ed,_0x128547));}return _0x67849([]);})[_0xe377('0x1d')](function(_0x25295d){_0x26c811(_0x25295d);});});};module[_0xe377('0x1e')]=function(_0x3fab11,_0x5cb27f){var _0x45b4e5=_0x3fab11[_0xe377('0x1f')];return _0x3fab11['define'](_0xe377('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x515d82,_0x19e75f,_0x50d45c){return getChanSpyPromise(_0x45b4e5,_0x515d82)[_0xe377('0x1c')](function(_0x270e7d){if(_0x270e7d&&_0x270e7d[_0xe377('0x16')]){return _0x45b4e5[_0xe377('0x21')][_0xe377('0x22')](_0x270e7d);}})['then'](function(){_0x50d45c();})['catch'](function(_0x509a7d){_0x50d45c(_0x509a7d);});},'afterUpdate':function(_0x11c9c1,_0x371bd5,_0x59827a){return _0x45b4e5['VoiceExtension'][_0xe377('0x23')]({'where':{'ChanSpyId':_0x11c9c1['id']}})['then'](function(){return getChanSpyPromise(_0x45b4e5,_0x11c9c1);})[_0xe377('0x1c')](function(_0x216f47){if(_0x216f47&&_0x216f47['length']){return _0x45b4e5[_0xe377('0x21')][_0xe377('0x22')](_0x216f47);}})[_0xe377('0x1c')](function(){_0x59827a();})[_0xe377('0x1d')](function(_0x51abb9){_0x59827a(_0x51abb9);});},'afterDestroy':function(_0x55a3a9,_0xf0045f,_0x274d20){return _0x45b4e5[_0xe377('0x21')][_0xe377('0x23')]({'where':{'ChanSpyId':_0x55a3a9['id']}})[_0xe377('0x1c')](function(){_0x274d20();})['catch'](function(_0x2d6822){_0x274d20(_0x2d6822);});}}});}; \ No newline at end of file +var _0x7ece=['concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','CDR(type)=%s','chanspy','record','push','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length'];(function(_0x30750f,_0x4c5518){var _0x19c56c=function(_0x4075c5){while(--_0x4075c5){_0x30750f['push'](_0x30750f['shift']());}};_0x19c56c(++_0x4c5518);}(_0x7ece,0x1e3));var _0xe7ec=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x7ece[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xe7ec('0x0'));var util=require(_0xe7ec('0x1'));var BPromise=require(_0xe7ec('0x2'));var attributes=require(_0xe7ec('0x3'));var getUserApplications=function(_0x5b9111,_0x283582,_0x50b4dc){var _0x9194cc=0x1;var _0x2180ba=[];var _0x1434a2={'context':_0x283582[_0xe7ec('0x4')]||_0xe7ec('0x5'),'exten':util[_0xe7ec('0x6')]('%s%s',_0x5b9111[_0xe7ec('0x7')],_0x50b4dc),'type':_0xe7ec('0x8'),'isApp':![],'ChanSpyId':_0x5b9111['id'],'UserId':_0x283582['id']};_0x2180ba['push'](_[_0xe7ec('0x9')]({'app':'Set','appdata':util[_0xe7ec('0x6')](_0xe7ec('0xa'),_0xe7ec('0xb')),'priority':_0x9194cc++},_0x1434a2));if(_0x5b9111[_0xe7ec('0xc')]){_0x2180ba[_0xe7ec('0xd')](_[_0xe7ec('0x9')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x5b9111[_0xe7ec('0xe')]),'priority':_0x9194cc++},_0x1434a2));}if(_0x5b9111[_0xe7ec('0xf')]){_0x2180ba[_0xe7ec('0xd')](_[_0xe7ec('0x9')]({'app':_0xe7ec('0x10'),'appdata':_0x5b9111[_0xe7ec('0x11')],'priority':_0x9194cc++},_0x1434a2));}_0x2180ba[_0xe7ec('0xd')](_[_0xe7ec('0x9')]({'app':'ChanSpy','appdata':util[_0xe7ec('0x6')](_0xe7ec('0x12'),_0x283582[_0xe7ec('0x13')],_0x5b9111[_0xe7ec('0x14')]?_0x5b9111[_0xe7ec('0x14')][_0xe7ec('0x15')](''):''),'priority':_0x9194cc++},_0x1434a2));if(_0x5b9111[_0xe7ec('0xc')]){_0x2180ba['push'](_[_0xe7ec('0x9')]({'app':_0xe7ec('0x16'),'priority':_0x9194cc++},_0x1434a2));}return _0x2180ba;};var getChanSpyApplications=function(_0x12bd5e,_0x5178de){var _0x5bdd19=[];for(var _0x1f79b7=0x0,_0x25dad5=0x1;_0x1f79b7<_0x5178de[_0xe7ec('0x17')];_0x1f79b7++,_0x25dad5=0x1){_0x5bdd19=_0x5bdd19[_0xe7ec('0x18')](getUserApplications(_0x12bd5e,_0x5178de[_0x1f79b7],_0x5178de[_0x1f79b7][_0xe7ec('0x19')]));if(_0x5178de[_0x1f79b7][_0xe7ec('0x19')]!=_0x5178de[_0x1f79b7][_0xe7ec('0x13')]){_0x5bdd19=_0x5bdd19['concat'](getUserApplications(_0x12bd5e,_0x5178de[_0x1f79b7],_0x5178de[_0x1f79b7]['name']));}}return _0x5bdd19;};var getChanSpyPromise=function(_0x77c267,_0x490e83){return new BPromise(function(_0xb61f2d,_0x494b46){return _0x77c267[_0xe7ec('0x1a')][_0xe7ec('0x1b')]({'attributes':['id',_0xe7ec('0x13'),_0xe7ec('0x19')],'where':{'role':_0xe7ec('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x4c974e){if(_0x4c974e){return _0xb61f2d(getChanSpyApplications(_0x490e83,_0x4c974e));}return _0xb61f2d([]);})[_0xe7ec('0x1d')](function(_0x479171){_0x494b46(_0x479171);});});};module[_0xe7ec('0x1e')]=function(_0x349717,_0x1285ec){var _0x5349bd=_0x349717[_0xe7ec('0x1f')];return _0x349717[_0xe7ec('0x20')](_0xe7ec('0x21'),attributes,{'tableName':_0xe7ec('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xcd2f3e,_0x169f07,_0x4c63be){return getChanSpyPromise(_0x5349bd,_0xcd2f3e)[_0xe7ec('0x23')](function(_0x296763){if(_0x296763&&_0x296763[_0xe7ec('0x17')]){return _0x5349bd['VoiceExtension']['bulkCreate'](_0x296763);}})[_0xe7ec('0x23')](function(){_0x4c63be();})[_0xe7ec('0x1d')](function(_0x47f286){_0x4c63be(_0x47f286);});},'afterUpdate':function(_0x3abcdb,_0x566f2b,_0x43d705){return _0x5349bd[_0xe7ec('0x24')][_0xe7ec('0x25')]({'where':{'ChanSpyId':_0x3abcdb['id']}})[_0xe7ec('0x23')](function(){return getChanSpyPromise(_0x5349bd,_0x3abcdb);})[_0xe7ec('0x23')](function(_0x95c73e){if(_0x95c73e&&_0x95c73e['length']){return _0x5349bd[_0xe7ec('0x24')][_0xe7ec('0x26')](_0x95c73e);}})[_0xe7ec('0x23')](function(){_0x43d705();})[_0xe7ec('0x1d')](function(_0x17591){_0x43d705(_0x17591);});},'afterDestroy':function(_0x51b7cb,_0x337aab,_0x5e6e51){return _0x5349bd['VoiceExtension'][_0xe7ec('0x25')]({'where':{'ChanSpyId':_0x51b7cb['id']}})['then'](function(){_0x5e6e51();})[_0xe7ec('0x1d')](function(_0x20823e){_0x5e6e51(_0x20823e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1754665..addabe6 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 _0x66a2=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x13972c,_0x16ddf9){var _0x5d5d7e=function(_0x1f7073){while(--_0x1f7073){_0x13972c['push'](_0x13972c['shift']());}};_0x5d5d7e(++_0x16ddf9);}(_0x66a2,0x12e));var _0x266a=function(_0x831a64,_0x505c25){_0x831a64=_0x831a64-0x0;var _0x4eb0c7=_0x66a2[_0x831a64];return _0x4eb0c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x266a('0x0'));var BPromise=require(_0x266a('0x1'));var rs=require(_0x266a('0x2'));var fs=require('fs');var Redis=require(_0x266a('0x3'));var db=require(_0x266a('0x4'))['db'];var utils=require(_0x266a('0x5'));var logger=require(_0x266a('0x6'))('rpc');var config=require(_0x266a('0x7'));var jayson=require(_0x266a('0x8'));var client=jayson[_0x266a('0x9')][_0x266a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15fa5d,_0x38d9ea,_0x3e6b99){return new BPromise(function(_0xbe292,_0xd6aa5a){return client[_0x266a('0xb')](_0x15fa5d,_0x3e6b99)[_0x266a('0xc')](function(_0x2e1f95){logger['info'](_0x266a('0xd'),_0x38d9ea,_0x266a('0xe'));logger[_0x266a('0xf')](_0x266a('0x10'),_0x38d9ea,'request\x20sent',JSON[_0x266a('0x11')](_0x2e1f95));if(_0x2e1f95[_0x266a('0x12')]){if(_0x2e1f95[_0x266a('0x12')][_0x266a('0x13')]===0x1f4){logger[_0x266a('0x12')](_0x266a('0xd'),_0x38d9ea,_0x2e1f95[_0x266a('0x12')][_0x266a('0x14')]);return _0xd6aa5a(_0x2e1f95[_0x266a('0x12')]['message']);}logger[_0x266a('0x12')](_0x266a('0xd'),_0x38d9ea,_0x2e1f95['error'][_0x266a('0x14')]);return _0xbe292(_0x2e1f95[_0x266a('0x12')][_0x266a('0x14')]);}else{logger['info'](_0x266a('0xd'),_0x38d9ea,'request\x20sent');_0xbe292(_0x2e1f95[_0x266a('0x15')][_0x266a('0x14')]);}})[_0x266a('0x16')](function(_0x3d9295){logger[_0x266a('0x12')](_0x266a('0xd'),_0x38d9ea,_0x3d9295);_0xd6aa5a(_0x3d9295);});});} \ No newline at end of file +var _0x1277=['request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x1277,0x125));var _0x7127=function(_0x40827f,_0x415800){_0x40827f=_0x40827f-0x0;var _0x109173=_0x1277[_0x40827f];return _0x109173;};'use strict';var _=require(_0x7127('0x0'));var util=require('util');var moment=require(_0x7127('0x1'));var BPromise=require(_0x7127('0x2'));var rs=require(_0x7127('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7127('0x4'));var logger=require(_0x7127('0x5'))(_0x7127('0x6'));var config=require(_0x7127('0x7'));var jayson=require(_0x7127('0x8'));var client=jayson[_0x7127('0x9')][_0x7127('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bf7b5,_0x1b5dc9,_0x343f1a){return new BPromise(function(_0x24dcb4,_0x3250d7){return client[_0x7127('0xb')](_0x4bf7b5,_0x343f1a)[_0x7127('0xc')](function(_0x864f50){logger[_0x7127('0xd')](_0x7127('0xe'),_0x1b5dc9,_0x7127('0xf'));logger[_0x7127('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1b5dc9,_0x7127('0xf'),JSON[_0x7127('0x11')](_0x864f50));if(_0x864f50['error']){if(_0x864f50['error']['code']===0x1f4){logger[_0x7127('0x12')](_0x7127('0xe'),_0x1b5dc9,_0x864f50['error'][_0x7127('0x13')]);return _0x3250d7(_0x864f50[_0x7127('0x12')][_0x7127('0x13')]);}logger[_0x7127('0x12')](_0x7127('0xe'),_0x1b5dc9,_0x864f50[_0x7127('0x12')][_0x7127('0x13')]);return _0x24dcb4(_0x864f50[_0x7127('0x12')][_0x7127('0x13')]);}else{logger[_0x7127('0xd')](_0x7127('0xe'),_0x1b5dc9,_0x7127('0xf'));_0x24dcb4(_0x864f50[_0x7127('0x14')][_0x7127('0x13')]);}})[_0x7127('0x15')](function(_0x18f1aa){logger[_0x7127('0x12')](_0x7127('0xe'),_0x1b5dc9,_0x18f1aa);_0x3250d7(_0x18f1aa);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a7afa5c..2438eb8 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 _0xefbd=['../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3f76d0,_0x541ba3){var _0x2cfa91=function(_0x27c0cf){while(--_0x27c0cf){_0x3f76d0['push'](_0x3f76d0['shift']());}};_0x2cfa91(++_0x541ba3);}(_0xefbd,0x11b));var _0xdefb=function(_0x41ae4e,_0x55d1c9){_0x41ae4e=_0x41ae4e-0x0;var _0x2c26ef=_0xefbd[_0x41ae4e];return _0x2c26ef;};'use strict';var multer=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var path=require(_0xdefb('0x2'));var timeout=require(_0xdefb('0x3'));var express=require('express');var router=express[_0xdefb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdefb('0x5'));var config=require(_0xdefb('0x6'));var controller=require(_0xdefb('0x7'));router[_0xdefb('0x8')]('/',auth[_0xdefb('0x9')](),controller['index']);router['get'](_0xdefb('0xa'),auth['isAuthenticated'](),controller[_0xdefb('0xb')]);router[_0xdefb('0xc')]('/',auth[_0xdefb('0x9')](),controller[_0xdefb('0xd')]);router[_0xdefb('0xe')](_0xdefb('0xa'),auth[_0xdefb('0x9')](),controller[_0xdefb('0xf')]);router[_0xdefb('0x10')](_0xdefb('0xa'),auth[_0xdefb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xced1=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45c253,_0x354552){var _0x7fb9c5=function(_0x53631c){while(--_0x53631c){_0x45c253['push'](_0x45c253['shift']());}};_0x7fb9c5(++_0x354552);}(_0xced1,0xb0));var _0x1ced=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xced1[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x1ced('0x0'));var util=require(_0x1ced('0x1'));var path=require(_0x1ced('0x2'));var timeout=require(_0x1ced('0x3'));var express=require(_0x1ced('0x4'));var router=express[_0x1ced('0x5')]();var auth=require(_0x1ced('0x6'));var interaction=require(_0x1ced('0x7'));var config=require(_0x1ced('0x8'));var controller=require(_0x1ced('0x9'));router['get']('/',auth[_0x1ced('0xa')](),controller['index']);router[_0x1ced('0xb')](_0x1ced('0xc'),auth['isAuthenticated'](),controller[_0x1ced('0xd')]);router[_0x1ced('0xe')]('/',auth[_0x1ced('0xa')](),controller['create']);router['put'](_0x1ced('0xc'),auth[_0x1ced('0xa')](),controller[_0x1ced('0xf')]);router['delete'](_0x1ced('0xc'),auth[_0x1ced('0xa')](),controller[_0x1ced('0x10')]);module[_0x1ced('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8814474..1b41087 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 _0x3e74=['name','sequelize','STRING'];(function(_0x673e91,_0x5066f8){var _0x3ee5cb=function(_0x2b30d2){while(--_0x2b30d2){_0x673e91['push'](_0x673e91['shift']());}};_0x3ee5cb(++_0x5066f8);}(_0x3e74,0x175));var _0x43e7=function(_0x2620d4,_0x58876a){_0x2620d4=_0x2620d4-0x0;var _0x5e9789=_0x3e74[_0x2620d4];return _0x5e9789;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x16f565,_0xdcb691){var _0xcd6cc1=function(_0x45b294){while(--_0x45b294){_0x16f565['push'](_0x16f565['shift']());}};_0xcd6cc1(++_0xdcb691);}(_0xe14b,0x93));var _0xbe14=function(_0xa79b23,_0x30e2cc){_0xa79b23=_0xa79b23-0x0;var _0x277865=_0xe14b[_0xa79b23];return _0x277865;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'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 21bd55b..dd47403 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 _0x7217=['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','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\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','get','Contexts','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','show','params','length','options','find','create','body','join','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','role','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','root','server/files/templates/context.ejs','utf8','chan_sip.so','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'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'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(){var _0x498654=_0x5c5b33[_0x7721('0x39')]({'plain':!![]});var _0x5ce026=_0x7721('0x3a');return db[_0x7721('0x3b')][_0x7721('0x37')]({'where':{'type':_0x5ce026,'resourceId':_0x498654['id']}})[_0x7721('0x38')](function(){return _0x5c5b33;});})[_0x7721('0x38')](function(){_0x3e4e56[_0x7721('0x2d')](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x15545a,_0x25bdd9){return function(_0x3a2eb7){if(!_0x3a2eb7){_0x15545a[_0x7721('0x2c')](0x194);}return _0x3a2eb7;};}function handleError(_0x5c806d,_0xd1df68){_0xd1df68=_0xd1df68||0x1f4;return function(_0x5e6663){logger[_0x7721('0x26')](_0x5e6663[_0x7721('0x3c')]);if(_0x5e6663[_0x7721('0x3d')]){delete _0x5e6663[_0x7721('0x3d')];}_0x5c806d[_0x7721('0x2d')](_0xd1df68)[_0x7721('0x3e')](_0x5e6663);};}exports['index']=function(_0x557c34,_0x4cadef){var _0x539560={},_0x18001c={},_0x1b3f8d={'count':0x0,'rows':[]};var _0x1acc72=_[_0x7721('0x3f')](db['VoiceContext'][_0x7721('0x40')],function(_0x4cf659){return{'name':_0x4cf659[_0x7721('0x41')],'type':_0x4cf659[_0x7721('0x42')]['key']};});_0x18001c[_0x7721('0x43')]=_[_0x7721('0x3f')](_0x1acc72,'name');_0x18001c['query']=_[_0x7721('0x44')](_0x557c34[_0x7721('0x45')]);_0x18001c[_0x7721('0x46')]=_[_0x7721('0x47')](_0x18001c['model'],_0x18001c[_0x7721('0x45')]);_0x539560[_0x7721('0x48')]=_[_0x7721('0x47')](_0x18001c[_0x7721('0x43')],qs[_0x7721('0x49')](_0x557c34['query'][_0x7721('0x49')]));_0x539560['attributes']=_0x539560[_0x7721('0x48')]['length']?_0x539560[_0x7721('0x48')]:_0x18001c[_0x7721('0x43')];if(!_0x557c34[_0x7721('0x45')]['hasOwnProperty'](_0x7721('0x4a'))){_0x539560[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x557c34['query'][_0x7721('0x31')]);_0x539560[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x557c34[_0x7721('0x45')][_0x7721('0x30')]);}_0x539560[_0x7721('0x4b')]=qs[_0x7721('0x4c')](_0x557c34['query']['sort']);_0x539560[_0x7721('0x4d')]=qs[_0x7721('0x46')](_[_0x7721('0x4e')](_0x557c34[_0x7721('0x45')],_0x18001c[_0x7721('0x46')]),_0x1acc72);if(_0x557c34[_0x7721('0x45')][_0x7721('0x4f')]){_0x539560[_0x7721('0x4d')]=_[_0x7721('0x50')](_0x539560[_0x7721('0x4d')],{'$or':_['map'](_0x1acc72,function(_0x578867){if(_0x578867[_0x7721('0x42')]!==_0x7721('0x51')){var _0x151f69={};_0x151f69[_0x578867[_0x7721('0x3d')]]={'$like':'%'+_0x557c34['query'][_0x7721('0x4f')]+'%'};return _0x151f69;}})});}_0x539560=_[_0x7721('0x50')]({},_0x539560,_0x557c34['options']);var _0x330fac={'where':_0x539560['where']};return db[_0x7721('0x52')]['count'](_0x330fac)[_0x7721('0x38')](function(_0x196be4){_0x1b3f8d[_0x7721('0x2f')]=_0x196be4;if(_0x557c34['query'][_0x7721('0x53')]){_0x539560[_0x7721('0x54')]=[{'all':!![]}];}return db['VoiceContext'][_0x7721('0x55')](_0x539560);})[_0x7721('0x38')](function(_0xf88e8c){_0x1b3f8d['rows']=_0xf88e8c;return _0x1b3f8d;})[_0x7721('0x38')](respondWithFilteredResult(_0x4cadef,_0x539560))['catch'](handleError(_0x4cadef,null));};exports[_0x7721('0x56')]=function(_0x310549,_0x4738ef){var _0x443503={'raw':![],'where':{'id':_0x310549[_0x7721('0x57')]['id']}},_0x1c95d8={};_0x1c95d8[_0x7721('0x43')]=_[_0x7721('0x44')](db[_0x7721('0x52')][_0x7721('0x40')]);_0x1c95d8[_0x7721('0x45')]=_[_0x7721('0x44')](_0x310549[_0x7721('0x45')]);_0x1c95d8[_0x7721('0x46')]=_[_0x7721('0x47')](_0x1c95d8['model'],_0x1c95d8[_0x7721('0x45')]);_0x443503[_0x7721('0x48')]=_[_0x7721('0x47')](_0x1c95d8[_0x7721('0x43')],qs[_0x7721('0x49')](_0x310549[_0x7721('0x45')][_0x7721('0x49')]));_0x443503['attributes']=_0x443503[_0x7721('0x48')][_0x7721('0x58')]?_0x443503[_0x7721('0x48')]:_0x1c95d8[_0x7721('0x43')];if(_0x310549[_0x7721('0x45')][_0x7721('0x53')]){_0x443503[_0x7721('0x54')]=[{'all':!![]}];}_0x443503=_[_0x7721('0x50')]({},_0x443503,_0x310549[_0x7721('0x59')]);return db[_0x7721('0x52')][_0x7721('0x5a')](_0x443503)['then'](handleEntityNotFound(_0x4738ef,null))[_0x7721('0x38')](respondWithResult(_0x4738ef,null))[_0x7721('0x2b')](handleError(_0x4738ef,null));};exports[_0x7721('0x5b')]=function(_0x2ee3c0,_0x15ed3b,_0x3e7918){var _0x41644f;return db[_0x7721('0x52')][_0x7721('0x5b')](_0x2ee3c0[_0x7721('0x5c')],{'raw':!![]})[_0x7721('0x38')](function(_0x2e5c28){_0x41644f=_0x2e5c28;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});})[_0x7721('0x38')](function(_0x577f47){var _0x50e9e9=fs['readFileSync'](path[_0x7721('0x5d')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x5d7036=ejs[_0x7721('0x5e')](_0x50e9e9,{'contexts':_0x577f47||[]});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x5d7036);})['then'](function(){return respondWithRpcPromise(_0x7721('0x61'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x24d1dc=_0x2ee3c0['user']['get']({'plain':!![]});if(!_0x24d1dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24d1dc[_0x7721('0x62')]===_0x7721('0x63')){var _0x1ff090=_0x41644f['get']({'plain':!![]});return db[_0x7721('0x64')][_0x7721('0x5a')]({'where':{'name':_0x7721('0x3a'),'userProfileId':_0x24d1dc[_0x7721('0x65')]},'raw':!![]})[_0x7721('0x38')](function(_0x16e80b){if(_0x16e80b&&_0x16e80b[_0x7721('0x66')]===0x0){return db[_0x7721('0x3b')][_0x7721('0x5b')]({'name':_0x1ff090[_0x7721('0x3d')],'resourceId':_0x1ff090['id'],'type':_0x16e80b[_0x7721('0x3d')],'sectionId':_0x16e80b['id']},{})[_0x7721('0x38')](function(){return _0x41644f;});}else{return _0x41644f;}})[_0x7721('0x2b')](function(_0x211d27){logger[_0x7721('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211d27);throw _0x211d27;});}return _0x41644f;})[_0x7721('0x38')](respondWithResult(_0x15ed3b,0xc9))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports[_0x7721('0x36')]=function(_0xb6db23,_0x542e30,_0x103009){var _0x104f05;return db['VoiceContext'][_0x7721('0x5a')]({'where':{'id':_0xb6db23['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x542e30,null))[_0x7721('0x38')](saveUpdates(_0xb6db23[_0x7721('0x5c')],null))[_0x7721('0x38')](function(_0x3d2b7d){if(_0x3d2b7d){_0x104f05=_0x3d2b7d;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});}})[_0x7721('0x38')](function(_0x4727b0){var _0x57759a=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),_0x7721('0x6a'));var _0x3ed425=ejs[_0x7721('0x5e')](_0x57759a,{'contexts':_0x4727b0||[]});fs['writeFileSync'](_0x7721('0x60'),_0x3ed425);})[_0x7721('0x38')](function(){return respondWithRpcPromise('Reload',_0x7721('0x36'),{'module':'chan_sip.so'});})[_0x7721('0x38')](function(){return _0x104f05;})[_0x7721('0x38')](respondWithResult(_0x542e30,null))[_0x7721('0x2b')](handleError(_0x542e30,null));};exports[_0x7721('0x37')]=function(_0x1e2436,_0x2bab14,_0x258c57){var _0x5dca04;return db[_0x7721('0x52')][_0x7721('0x5a')]({'where':{'id':_0x1e2436[_0x7721('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bab14,null))['then'](removeEntity(_0x2bab14,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x7721('0x38')](function(_0x2645dd){var _0x580473=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),'utf8');var _0x275b25=ejs[_0x7721('0x5e')](_0x580473,{'contexts':_0x2645dd});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x275b25);return respondWithRpcPromise(_0x7721('0x61'),'destroy',{'module':_0x7721('0x6b')});})[_0x7721('0x2b')](handleError(_0x2bab14,null));}; \ No newline at end of file +var _0x34e8=['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','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','sendStatus','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceContext','includeAll','include','findAll','rows','show','length','create','body','join','root','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','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','client'];(function(_0x2192ee,_0x13521d){var _0x5b944a=function(_0x34962f){while(--_0x34962f){_0x2192ee['push'](_0x2192ee['shift']());}};_0x5b944a(++_0x13521d);}(_0x34e8,0x12c));var _0x834e=function(_0x52c701,_0x1b22f0){_0x52c701=_0x52c701-0x0;var _0x433f9e=_0x34e8[_0x52c701];return _0x433f9e;};'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'];var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x58a27e,_0x23848e,_0x2d95f2){if(_0x2d95f2){var _0x28e659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e659[_0x834e('0x1f')](_0x23848e)){return _0x58a27e;}else{throw new db['Sequelize'][(_0x834e('0x20'))](_0x834e('0x21'));}}else{return _0x58a27e;}}function respondWithRpcPromise(_0x57274a,_0x316205,_0x4a9cdc,_0x38a8cd){return new BPromise(function(_0x36d443,_0x478afe){var _0x43ac41=_0x38a8cd||client;return _0x43ac41[_0x834e('0x22')](_0x57274a,_0x4a9cdc)[_0x834e('0x23')](function(_0x50b3f6){logger[_0x834e('0x24')](_0x834e('0x25'),_0x316205,_0x834e('0x26'));logger[_0x834e('0x27')](_0x834e('0x28'),_0x316205,_0x834e('0x26'),JSON[_0x834e('0x29')](_0x50b3f6));if(_0x50b3f6['error']){if(_0x50b3f6[_0x834e('0x2a')][_0x834e('0x2b')]===0x1f4){logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6['error'][_0x834e('0x2c')]);return _0x478afe(_0x50b3f6[_0x834e('0x2a')]['message']);}logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6[_0x834e('0x2a')]['message']);return _0x36d443(_0x50b3f6['error'][_0x834e('0x2c')]);}else{logger[_0x834e('0x24')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x834e('0x26'));_0x36d443(_0x50b3f6[_0x834e('0x2d')]['message']);}})[_0x834e('0x2e')](function(_0x2e1983){logger[_0x834e('0x2a')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x2e1983);_0x478afe(_0x2e1983);});});}function respondWithStatusCode(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xcc;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['sendStatus'](_0x3e310f);}return _0x24fcf7[_0x834e('0x2f')](_0x3e310f)['end']();};}function respondWithResult(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0xc8;return function(_0x3db026){if(_0x3db026){return _0x2826ec[_0x834e('0x2f')](_0x3f1b0b)[_0x834e('0x30')](_0x3db026);}};}function respondWithFilteredResult(_0x130cc5,_0x491919){return function(_0x510780){if(_0x510780){var _0x4dc64a=_0x510780[_0x834e('0x31')],_0x58c1d7=_0x491919['offset'],_0x2c7a8d=_0x491919[_0x834e('0x32')]+_0x491919[_0x834e('0x33')],_0x567cea;if(_0x2c7a8d>=_0x4dc64a){_0x2c7a8d=_0x4dc64a;_0x567cea=0xc8;}else{_0x567cea=0xce;}_0x130cc5[_0x834e('0x2f')](_0x567cea);return _0x130cc5[_0x834e('0x34')](_0x834e('0x35'),_0x58c1d7+'-'+_0x2c7a8d+'/'+_0x4dc64a)[_0x834e('0x30')](_0x510780);}return null;};}function patchUpdates(_0x3d149d){return function(_0xfaf716){try{jsonpatch[_0x834e('0x36')](_0xfaf716,_0x3d149d,!![]);}catch(_0x493289){return BPromise[_0x834e('0x37')](_0x493289);}return _0xfaf716['save']();};}function saveUpdates(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x38')](_0x2c75c2)[_0x834e('0x23')](function(_0x4689c2){return _0x4689c2;});}return null;};}function removeEntity(_0x4696a1,_0x38cd29){return function(_0x358c31){if(_0x358c31){return _0x358c31[_0x834e('0x39')]()['then'](function(){var _0x2a3c7f=_0x358c31[_0x834e('0x3a')]({'plain':!![]});var _0x24a9df=_0x834e('0x3b');return db['UserProfileResource'][_0x834e('0x39')]({'where':{'type':_0x24a9df,'resourceId':_0x2a3c7f['id']}})[_0x834e('0x23')](function(){return _0x358c31;});})['then'](function(){_0x4696a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e58fa,_0x41bf4d){return function(_0x20c6ae){if(!_0x20c6ae){_0x3e58fa[_0x834e('0x3c')](0x194);}return _0x20c6ae;};}function handleError(_0x339e28,_0x1b76dd){_0x1b76dd=_0x1b76dd||0x1f4;return function(_0x4c2ef6){logger[_0x834e('0x2a')](_0x4c2ef6['stack']);if(_0x4c2ef6[_0x834e('0x3d')]){delete _0x4c2ef6[_0x834e('0x3d')];}_0x339e28['status'](_0x1b76dd)[_0x834e('0x3e')](_0x4c2ef6);};}exports[_0x834e('0x3f')]=function(_0x491c28,_0x481f70){var _0x388711={},_0xd0d43a={},_0x2e9383={'count':0x0,'rows':[]};var _0x130c23=_[_0x834e('0x40')](db['VoiceContext'][_0x834e('0x41')],function(_0x548d1d){return{'name':_0x548d1d['fieldName'],'type':_0x548d1d[_0x834e('0x42')]['key']};});_0xd0d43a[_0x834e('0x43')]=_[_0x834e('0x40')](_0x130c23,_0x834e('0x3d'));_0xd0d43a[_0x834e('0x44')]=_[_0x834e('0x45')](_0x491c28['query']);_0xd0d43a[_0x834e('0x46')]=_[_0x834e('0x47')](_0xd0d43a[_0x834e('0x43')],_0xd0d43a['query']);_0x388711[_0x834e('0x48')]=_[_0x834e('0x47')](_0xd0d43a['model'],qs[_0x834e('0x49')](_0x491c28['query'][_0x834e('0x49')]));_0x388711[_0x834e('0x48')]=_0x388711['attributes']['length']?_0x388711[_0x834e('0x48')]:_0xd0d43a[_0x834e('0x43')];if(!_0x491c28[_0x834e('0x44')][_0x834e('0x4a')](_0x834e('0x4b'))){_0x388711[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x491c28['query'][_0x834e('0x33')]);_0x388711['offset']=qs[_0x834e('0x32')](_0x491c28['query'][_0x834e('0x32')]);}_0x388711['order']=qs[_0x834e('0x4c')](_0x491c28[_0x834e('0x44')]['sort']);_0x388711[_0x834e('0x4d')]=qs[_0x834e('0x46')](_[_0x834e('0x4e')](_0x491c28[_0x834e('0x44')],_0xd0d43a[_0x834e('0x46')]),_0x130c23);if(_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]){_0x388711[_0x834e('0x4d')]=_[_0x834e('0x50')](_0x388711[_0x834e('0x4d')],{'$or':_['map'](_0x130c23,function(_0x3124be){if(_0x3124be[_0x834e('0x42')]!=='VIRTUAL'){var _0x112306={};_0x112306[_0x3124be[_0x834e('0x3d')]]={'$like':'%'+_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]+'%'};return _0x112306;}})});}_0x388711=_[_0x834e('0x50')]({},_0x388711,_0x491c28[_0x834e('0x51')]);var _0x4eab06={'where':_0x388711['where']};return db[_0x834e('0x52')][_0x834e('0x31')](_0x4eab06)[_0x834e('0x23')](function(_0x40ff5a){_0x2e9383[_0x834e('0x31')]=_0x40ff5a;if(_0x491c28[_0x834e('0x44')][_0x834e('0x53')]){_0x388711[_0x834e('0x54')]=[{'all':!![]}];}return db[_0x834e('0x52')][_0x834e('0x55')](_0x388711);})[_0x834e('0x23')](function(_0x385435){_0x2e9383[_0x834e('0x56')]=_0x385435;return _0x2e9383;})[_0x834e('0x23')](respondWithFilteredResult(_0x481f70,_0x388711))[_0x834e('0x2e')](handleError(_0x481f70,null));};exports[_0x834e('0x57')]=function(_0x3df078,_0x32b8f7){var _0x420841={'raw':![],'where':{'id':_0x3df078['params']['id']}},_0x1adf86={};_0x1adf86[_0x834e('0x43')]=_[_0x834e('0x45')](db['VoiceContext'][_0x834e('0x41')]);_0x1adf86[_0x834e('0x44')]=_['keys'](_0x3df078[_0x834e('0x44')]);_0x1adf86[_0x834e('0x46')]=_[_0x834e('0x47')](_0x1adf86[_0x834e('0x43')],_0x1adf86[_0x834e('0x44')]);_0x420841[_0x834e('0x48')]=_[_0x834e('0x47')](_0x1adf86['model'],qs[_0x834e('0x49')](_0x3df078[_0x834e('0x44')][_0x834e('0x49')]));_0x420841[_0x834e('0x48')]=_0x420841[_0x834e('0x48')][_0x834e('0x58')]?_0x420841[_0x834e('0x48')]:_0x1adf86[_0x834e('0x43')];if(_0x3df078['query'][_0x834e('0x53')]){_0x420841['include']=[{'all':!![]}];}_0x420841=_[_0x834e('0x50')]({},_0x420841,_0x3df078['options']);return db[_0x834e('0x52')]['find'](_0x420841)['then'](handleEntityNotFound(_0x32b8f7,null))[_0x834e('0x23')](respondWithResult(_0x32b8f7,null))[_0x834e('0x2e')](handleError(_0x32b8f7,null));};exports['create']=function(_0x5be43d,_0x2c8155,_0x2452b4){var _0x138ed2;return db[_0x834e('0x52')][_0x834e('0x59')](_0x5be43d[_0x834e('0x5a')],{'raw':!![]})[_0x834e('0x23')](function(_0x4273f1){_0x138ed2=_0x4273f1;return db['VoiceContext'][_0x834e('0x55')]({'raw':!![]});})[_0x834e('0x23')](function(_0x5d5ac2){var _0x281342=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),_0x834e('0x5d'));var _0x37ee0e=ejs[_0x834e('0x5e')](_0x281342,{'contexts':_0x5d5ac2||[]});fs[_0x834e('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x37ee0e);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x59'),{'module':'chan_sip.so'});})[_0x834e('0x23')](function(){var _0x1fcae9=_0x5be43d[_0x834e('0x61')][_0x834e('0x3a')]({'plain':!![]});if(!_0x1fcae9)throw new Error(_0x834e('0x62'));if(_0x1fcae9[_0x834e('0x63')]===_0x834e('0x61')){var _0x1def00=_0x138ed2[_0x834e('0x3a')]({'plain':!![]});return db[_0x834e('0x64')][_0x834e('0x65')]({'where':{'name':_0x834e('0x3b'),'userProfileId':_0x1fcae9[_0x834e('0x66')]},'raw':!![]})[_0x834e('0x23')](function(_0x460a7a){if(_0x460a7a&&_0x460a7a[_0x834e('0x67')]===0x0){return db[_0x834e('0x68')][_0x834e('0x59')]({'name':_0x1def00[_0x834e('0x3d')],'resourceId':_0x1def00['id'],'type':_0x460a7a[_0x834e('0x3d')],'sectionId':_0x460a7a['id']},{})[_0x834e('0x23')](function(){return _0x138ed2;});}else{return _0x138ed2;}})[_0x834e('0x2e')](function(_0x5c83eb){logger[_0x834e('0x2a')](_0x834e('0x69'),_0x5c83eb);throw _0x5c83eb;});}return _0x138ed2;})[_0x834e('0x23')](respondWithResult(_0x2c8155,0xc9))[_0x834e('0x2e')](handleError(_0x2c8155,null));};exports['update']=function(_0x30faa8,_0x5a9c70,_0x56a152){var _0x2fdb1b;return db[_0x834e('0x52')][_0x834e('0x65')]({'where':{'id':_0x30faa8[_0x834e('0x6a')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x5a9c70,null))[_0x834e('0x23')](saveUpdates(_0x30faa8[_0x834e('0x5a')],null))[_0x834e('0x23')](function(_0x525ed3){if(_0x525ed3){_0x2fdb1b=_0x525ed3;return db[_0x834e('0x52')]['findAll']({'raw':!![]});}})[_0x834e('0x23')](function(_0xd35dda){var _0x514fe5=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],_0x834e('0x6b')),_0x834e('0x5d'));var _0x2c41bd=ejs['render'](_0x514fe5,{'contexts':_0xd35dda||[]});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x2c41bd);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x38'),{'module':_0x834e('0x6d')});})[_0x834e('0x23')](function(){return _0x2fdb1b;})[_0x834e('0x23')](respondWithResult(_0x5a9c70,null))[_0x834e('0x2e')](handleError(_0x5a9c70,null));};exports[_0x834e('0x39')]=function(_0x5b2bf6,_0x1b158b,_0x2e4d80){var _0x42fc96;return db[_0x834e('0x52')]['find']({'where':{'id':_0x5b2bf6[_0x834e('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1b158b,null))['then'](removeEntity(_0x1b158b,null))['then'](function(){return db[_0x834e('0x52')][_0x834e('0x55')]({'raw':!![]});})['then'](function(_0x2645df){var _0x1b200d=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x346be5=ejs[_0x834e('0x5e')](_0x1b200d,{'contexts':_0x2645df});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x346be5);return respondWithRpcPromise(_0x834e('0x60'),'destroy',{'module':_0x834e('0x6d')});})['catch'](handleError(_0x1b158b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 13bf28b..db3bf59 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 _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x412a61,_0x766110){var _0x2e14db=function(_0x5e13d2){while(--_0x5e13d2){_0x412a61['push'](_0x412a61['shift']());}};_0x2e14db(++_0x766110);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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':'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 1fd04b0..7ee8f60 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 _0xd6d5=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','error','code','message','catch','lodash','bluebird'];(function(_0x3bc7c6,_0x37d687){var _0x47ee95=function(_0x58140a){while(--_0x58140a){_0x3bc7c6['push'](_0x3bc7c6['shift']());}};_0x47ee95(++_0x37d687);}(_0xd6d5,0x1de));var _0x5d6d=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xd6d5[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x5d6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5d6d('0x1'));var rs=require(_0x5d6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d6d('0x3'))['db'];var utils=require(_0x5d6d('0x4'));var logger=require(_0x5d6d('0x5'))(_0x5d6d('0x6'));var config=require(_0x5d6d('0x7'));var jayson=require(_0x5d6d('0x8'));var client=jayson[_0x5d6d('0x9')][_0x5d6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e4a9,_0x3a3fcb,_0x91cfe2){return new BPromise(function(_0xda13f6,_0x1991ff){return client[_0x5d6d('0xb')](_0x25e4a9,_0x91cfe2)[_0x5d6d('0xc')](function(_0x2114ed){logger[_0x5d6d('0xd')](_0x5d6d('0xe'),_0x3a3fcb,'request\x20sent');logger[_0x5d6d('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3a3fcb,'request\x20sent',JSON['stringify'](_0x2114ed));if(_0x2114ed[_0x5d6d('0x10')]){if(_0x2114ed[_0x5d6d('0x10')][_0x5d6d('0x11')]===0x1f4){logger[_0x5d6d('0x10')](_0x5d6d('0xe'),_0x3a3fcb,_0x2114ed[_0x5d6d('0x10')]['message']);return _0x1991ff(_0x2114ed['error'][_0x5d6d('0x12')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x3a3fcb,_0x2114ed[_0x5d6d('0x10')][_0x5d6d('0x12')]);return _0xda13f6(_0x2114ed[_0x5d6d('0x10')][_0x5d6d('0x12')]);}else{logger[_0x5d6d('0xd')](_0x5d6d('0xe'),_0x3a3fcb,'request\x20sent');_0xda13f6(_0x2114ed['result'][_0x5d6d('0x12')]);}})[_0x5d6d('0x13')](function(_0x1b3074){logger[_0x5d6d('0x10')]('VoiceContext,\x20%s,\x20%s',_0x3a3fcb,_0x1b3074);_0x1991ff(_0x1b3074);});});} \ No newline at end of file +var _0xdafb=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xdafb,0x10a));var _0xbdaf=function(_0x44dfc3,_0x16ef6c){_0x44dfc3=_0x44dfc3-0x0;var _0x165ba3=_0xdafb[_0x44dfc3];return _0x165ba3;};'use strict';var _=require('lodash');var util=require(_0xbdaf('0x0'));var moment=require(_0xbdaf('0x1'));var BPromise=require(_0xbdaf('0x2'));var rs=require(_0xbdaf('0x3'));var fs=require('fs');var Redis=require(_0xbdaf('0x4'));var db=require(_0xbdaf('0x5'))['db'];var utils=require(_0xbdaf('0x6'));var logger=require('../../config/logger')(_0xbdaf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdaf('0x8')][_0xbdaf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5254c0,_0x56237f,_0x2aa643){return new BPromise(function(_0x4dac6c,_0x1a01aa){return client[_0xbdaf('0xa')](_0x5254c0,_0x2aa643)[_0xbdaf('0xb')](function(_0x38053c){logger[_0xbdaf('0xc')](_0xbdaf('0xd'),_0x56237f,'request\x20sent');logger[_0xbdaf('0xe')](_0xbdaf('0xf'),_0x56237f,_0xbdaf('0x10'),JSON[_0xbdaf('0x11')](_0x38053c));if(_0x38053c[_0xbdaf('0x12')]){if(_0x38053c[_0xbdaf('0x12')][_0xbdaf('0x13')]===0x1f4){logger[_0xbdaf('0x12')](_0xbdaf('0xd'),_0x56237f,_0x38053c[_0xbdaf('0x12')]['message']);return _0x1a01aa(_0x38053c[_0xbdaf('0x12')][_0xbdaf('0x14')]);}logger['error'](_0xbdaf('0xd'),_0x56237f,_0x38053c['error'][_0xbdaf('0x14')]);return _0x4dac6c(_0x38053c[_0xbdaf('0x12')][_0xbdaf('0x14')]);}else{logger[_0xbdaf('0xc')](_0xbdaf('0xd'),_0x56237f,'request\x20sent');_0x4dac6c(_0x38053c[_0xbdaf('0x15')][_0xbdaf('0x14')]);}})['catch'](function(_0x47b8a8){logger[_0xbdaf('0x12')](_0xbdaf('0xd'),_0x56237f,_0x47b8a8);_0x1a01aa(_0x47b8a8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6ed8183..9d3db39 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 _0xa453=['../../config/environment','./voiceDialReport.controller','get','index','isAuthenticated','/:id','show','post','put','update','delete','multer','util','path','connect-timeout'];(function(_0x51f959,_0x110165){var _0x554986=function(_0x4c4c03){while(--_0x4c4c03){_0x51f959['push'](_0x51f959['shift']());}};_0x554986(++_0x110165);}(_0xa453,0x1dc));var _0x3a45=function(_0x321806,_0xd6d342){_0x321806=_0x321806-0x0;var _0x1b21b4=_0xa453[_0x321806];return _0x1b21b4;};'use strict';var multer=require(_0x3a45('0x0'));var util=require(_0x3a45('0x1'));var path=require(_0x3a45('0x2'));var timeout=require(_0x3a45('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a45('0x4'));var controller=require(_0x3a45('0x5'));router[_0x3a45('0x6')]('/',auth['isAuthenticated'](),controller[_0x3a45('0x7')]);router[_0x3a45('0x6')]('/describe',auth[_0x3a45('0x8')](),controller['describe']);router[_0x3a45('0x6')](_0x3a45('0x9'),auth[_0x3a45('0x8')](),controller[_0x3a45('0xa')]);router[_0x3a45('0xb')]('/',auth[_0x3a45('0x8')](),controller['create']);router[_0x3a45('0xc')](_0x3a45('0x9'),auth['isAuthenticated'](),controller[_0x3a45('0xd')]);router[_0x3a45('0xe')]('/:id',auth[_0x3a45('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdee7=['exports','express','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','/describe','show','post','create','put','/:id','destroy'];(function(_0x241ada,_0x38127a){var _0x3662b7=function(_0x35e5a0){while(--_0x35e5a0){_0x241ada['push'](_0x241ada['shift']());}};_0x3662b7(++_0x38127a);}(_0xdee7,0xe1));var _0x7dee=function(_0x53a50e,_0x48be94){_0x53a50e=_0x53a50e-0x0;var _0x5bac61=_0xdee7[_0x53a50e];return _0x5bac61;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7dee('0x0'));var router=express['Router']();var auth=require(_0x7dee('0x1'));var interaction=require(_0x7dee('0x2'));var config=require('../../config/environment');var controller=require(_0x7dee('0x3'));router[_0x7dee('0x4')]('/',auth[_0x7dee('0x5')](),controller['index']);router[_0x7dee('0x4')](_0x7dee('0x6'),auth[_0x7dee('0x5')](),controller['describe']);router[_0x7dee('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x7dee('0x7')]);router[_0x7dee('0x8')]('/',auth[_0x7dee('0x5')](),controller[_0x7dee('0x9')]);router[_0x7dee('0xa')](_0x7dee('0xb'),auth[_0x7dee('0x5')](),controller['update']);router['delete'](_0x7dee('0xb'),auth[_0x7dee('0x5')](),controller[_0x7dee('0xc')]);module[_0x7dee('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 2dea50c..2d5321b 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 _0xf99e=['INTEGER','DATE','called,connect,complete','exports','STRING'];(function(_0x172544,_0x5b1077){var _0x5313cb=function(_0x21d529){while(--_0x21d529){_0x172544['push'](_0x172544['shift']());}};_0x5313cb(++_0x5b1077);}(_0xf99e,0x189));var _0xef99=function(_0x2b9847,_0x5b5294){_0x2b9847=_0x2b9847-0x0;var _0x4e393f=_0xf99e[_0x2b9847];return _0x4e393f;};'use strict';var Sequelize=require('sequelize');module[_0xef99('0x0')]={'privilege':{'type':Sequelize[_0xef99('0x1')]},'channel':{'type':Sequelize[_0xef99('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xef99('0x1')]},'calleridnum':{'type':Sequelize[_0xef99('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xef99('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xef99('0x1')]},'accountcode':{'type':Sequelize[_0xef99('0x1')]},'context':{'type':Sequelize[_0xef99('0x1')]},'exten':{'type':Sequelize[_0xef99('0x1')]},'priority':{'type':Sequelize[_0xef99('0x2')]},'uniqueid':{'type':Sequelize[_0xef99('0x1')]},'linkedid':{'type':Sequelize[_0xef99('0x1')]},'destchannel':{'type':Sequelize[_0xef99('0x1')]},'destchannelstate':{'type':Sequelize[_0xef99('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xef99('0x1')]},'destcalleridnum':{'type':Sequelize[_0xef99('0x1')]},'destcalleridname':{'type':Sequelize[_0xef99('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xef99('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xef99('0x1')]},'destlanguage':{'type':Sequelize[_0xef99('0x1')]},'destaccountcode':{'type':Sequelize[_0xef99('0x1')]},'destcontext':{'type':Sequelize[_0xef99('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xef99('0x2')]},'destuniqueid':{'type':Sequelize[_0xef99('0x1')]},'destlinkedid':{'type':Sequelize[_0xef99('0x1')]},'dialstring':{'type':Sequelize[_0xef99('0x1')]},'dialstatus':{'type':Sequelize[_0xef99('0x1')]},'starttime':{'type':Sequelize[_0xef99('0x3')]},'answertime':{'type':Sequelize[_0xef99('0x3')]},'endtime':{'type':Sequelize[_0xef99('0x3')]},'lastevent':{'type':Sequelize[_0xef99('0x1')],'comment':_0xef99('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xef99('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xef99('0x2')]}}; \ No newline at end of file +var _0x5d17=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x2842cc,_0x180702){var _0x803635=function(_0x49180b){while(--_0x49180b){_0x2842cc['push'](_0x2842cc['shift']());}};_0x803635(++_0x180702);}(_0x5d17,0x148));var _0x75d1=function(_0x196dc5,_0x50be9d){_0x196dc5=_0x196dc5-0x0;var _0x56458e=_0x5d17[_0x196dc5];return _0x56458e;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x75d1('0x2')]},'channelstate':{'type':Sequelize[_0x75d1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x75d1('0x2')]},'calleridnum':{'type':Sequelize[_0x75d1('0x2')]},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x75d1('0x2')]},'connectedlinename':{'type':Sequelize[_0x75d1('0x2')]},'language':{'type':Sequelize[_0x75d1('0x2')]},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'exten':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize[_0x75d1('0x3')]},'uniqueid':{'type':Sequelize[_0x75d1('0x2')]},'linkedid':{'type':Sequelize[_0x75d1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x75d1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x75d1('0x2')]},'destcalleridname':{'type':Sequelize[_0x75d1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x75d1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x75d1('0x2')]},'destlanguage':{'type':Sequelize[_0x75d1('0x2')]},'destaccountcode':{'type':Sequelize[_0x75d1('0x2')]},'destcontext':{'type':Sequelize[_0x75d1('0x2')]},'destexten':{'type':Sequelize[_0x75d1('0x2')]},'destpriority':{'type':Sequelize[_0x75d1('0x3')]},'destuniqueid':{'type':Sequelize[_0x75d1('0x2')]},'destlinkedid':{'type':Sequelize[_0x75d1('0x2')]},'dialstring':{'type':Sequelize[_0x75d1('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x75d1('0x4')]},'lastevent':{'type':Sequelize[_0x75d1('0x2')],'comment':_0x75d1('0x5')},'routeId':{'type':Sequelize[_0x75d1('0x3')]},'duration':{'type':Sequelize[_0x75d1('0x3')]},'holdtime':{'type':Sequelize[_0x75d1('0x3')]},'billableseconds':{'type':Sequelize[_0x75d1('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index fcfdc9e..8753b54 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 _0x6be5=['name','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../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','apply','save','update','destroy','then','error'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x6be5,0x71));var _0x56be=function(_0x2772f1,_0x370888){_0x2772f1=_0x2772f1-0x0;var _0x5cee94=_0x6be5[_0x2772f1];return _0x5cee94;};'use strict';var pdf=require(_0x56be('0x0'));var emlformat=require(_0x56be('0x1'));var rimraf=require(_0x56be('0x2'));var zipdir=require(_0x56be('0x3'));var jsonpatch=require(_0x56be('0x4'));var rp=require(_0x56be('0x5'));var moment=require(_0x56be('0x6'));var BPromise=require(_0x56be('0x7'));var Mustache=require(_0x56be('0x8'));var util=require(_0x56be('0x9'));var path=require(_0x56be('0xa'));var sox=require(_0x56be('0xb'));var csv=require('to-csv');var ejs=require(_0x56be('0xc'));var fs=require('fs');var _=require(_0x56be('0xd'));var squel=require('squel');var crypto=require(_0x56be('0xe'));var jsforce=require(_0x56be('0xf'));var deskjs=require(_0x56be('0x10'));var toCsv=require(_0x56be('0x11'));var querystring=require(_0x56be('0x12'));var Papa=require(_0x56be('0x13'));var Redis=require('ioredis');var authService=require(_0x56be('0x14'));var qs=require(_0x56be('0x15'));var as=require(_0x56be('0x16'));var hardwareService=require(_0x56be('0x17'));var logger=require(_0x56be('0x18'))(_0x56be('0x19'));var utils=require(_0x56be('0x1a'));var config=require(_0x56be('0x1b'));var db=require(_0x56be('0x1c'))['db'];function respondWithStatusCode(_0x4ae430,_0x58a9d2){_0x58a9d2=_0x58a9d2||0xcc;return function(_0x2df7b4){if(_0x2df7b4){return _0x4ae430[_0x56be('0x1d')](_0x58a9d2);}return _0x4ae430[_0x56be('0x1e')](_0x58a9d2)[_0x56be('0x1f')]();};}function respondWithResult(_0x135b46,_0x9b2f52){_0x9b2f52=_0x9b2f52||0xc8;return function(_0x388256){if(_0x388256){return _0x135b46[_0x56be('0x1e')](_0x9b2f52)[_0x56be('0x20')](_0x388256);}};}function respondWithFilteredResult(_0x2dd99d,_0x576bd7){return function(_0x47bd5b){if(_0x47bd5b){var _0x3dc1b3=_0x47bd5b[_0x56be('0x21')],_0x2e6ab7=_0x576bd7[_0x56be('0x22')],_0x19b451=_0x576bd7['offset']+_0x576bd7[_0x56be('0x23')],_0xeb5c8d;if(_0x19b451>=_0x3dc1b3){_0x19b451=_0x3dc1b3;_0xeb5c8d=0xc8;}else{_0xeb5c8d=0xce;}_0x2dd99d[_0x56be('0x1e')](_0xeb5c8d);return _0x2dd99d[_0x56be('0x24')]('Content-Range',_0x2e6ab7+'-'+_0x19b451+'/'+_0x3dc1b3)[_0x56be('0x20')](_0x47bd5b);}return null;};}function patchUpdates(_0x47ba05){return function(_0x473d67){try{jsonpatch[_0x56be('0x25')](_0x473d67,_0x47ba05,!![]);}catch(_0x5178d8){return BPromise['reject'](_0x5178d8);}return _0x473d67[_0x56be('0x26')]();};}function saveUpdates(_0x44891c,_0xe8ac97){return function(_0x407a3a){if(_0x407a3a){return _0x407a3a[_0x56be('0x27')](_0x44891c)['then'](function(_0x144e65){return _0x144e65;});}return null;};}function removeEntity(_0x402b21,_0x55a087){return function(_0x13800d){if(_0x13800d){return _0x13800d[_0x56be('0x28')]()[_0x56be('0x29')](function(){_0x402b21['status'](0xcc)[_0x56be('0x1f')]();});}};}function handleEntityNotFound(_0x4e42db,_0x559b26){return function(_0x23293b){if(!_0x23293b){_0x4e42db[_0x56be('0x1d')](0x194);}return _0x23293b;};}function handleError(_0x4fd183,_0x68f5f7){_0x68f5f7=_0x68f5f7||0x1f4;return function(_0x38502d){logger[_0x56be('0x2a')](_0x38502d['stack']);if(_0x38502d[_0x56be('0x2b')]){delete _0x38502d[_0x56be('0x2b')];}_0x4fd183[_0x56be('0x1e')](_0x68f5f7)['send'](_0x38502d);};}exports[_0x56be('0x2c')]=function(_0x665ea5,_0x45d4f0){var _0x19d433={},_0x52344a={},_0x177d4c={'count':0x0,'rows':[]};var _0x4e7e07=_[_0x56be('0x2d')](db[_0x56be('0x2e')][_0x56be('0x2f')],function(_0x3101d9){return{'name':_0x3101d9[_0x56be('0x30')],'type':_0x3101d9[_0x56be('0x31')][_0x56be('0x32')]};});_0x52344a[_0x56be('0x33')]=_[_0x56be('0x2d')](_0x4e7e07,'name');_0x52344a[_0x56be('0x34')]=_[_0x56be('0x35')](_0x665ea5[_0x56be('0x34')]);_0x52344a[_0x56be('0x36')]=_[_0x56be('0x37')](_0x52344a[_0x56be('0x33')],_0x52344a[_0x56be('0x34')]);_0x19d433[_0x56be('0x38')]=_['intersection'](_0x52344a[_0x56be('0x33')],qs[_0x56be('0x39')](_0x665ea5[_0x56be('0x34')]['fields']));_0x19d433['attributes']=_0x19d433['attributes'][_0x56be('0x3a')]?_0x19d433[_0x56be('0x38')]:_0x52344a[_0x56be('0x33')];if(!_0x665ea5['query']['hasOwnProperty'](_0x56be('0x3b'))){_0x19d433[_0x56be('0x23')]=qs['limit'](_0x665ea5[_0x56be('0x34')][_0x56be('0x23')]);_0x19d433[_0x56be('0x22')]=qs['offset'](_0x665ea5[_0x56be('0x34')][_0x56be('0x22')]);}_0x19d433[_0x56be('0x3c')]=qs[_0x56be('0x3d')](_0x665ea5[_0x56be('0x34')]['sort']);_0x19d433['where']=qs[_0x56be('0x36')](_[_0x56be('0x3e')](_0x665ea5[_0x56be('0x34')],_0x52344a[_0x56be('0x36')]),_0x4e7e07);if(_0x665ea5[_0x56be('0x34')][_0x56be('0x3f')]){_0x19d433[_0x56be('0x40')]=_[_0x56be('0x41')](_0x19d433[_0x56be('0x40')],{'$or':_['map'](_0x4e7e07,function(_0x21286b){if(_0x21286b[_0x56be('0x31')]!==_0x56be('0x42')){var _0x106c9f={};_0x106c9f[_0x21286b['name']]={'$like':'%'+_0x665ea5['query'][_0x56be('0x3f')]+'%'};return _0x106c9f;}})});}_0x19d433=_[_0x56be('0x41')]({},_0x19d433,_0x665ea5[_0x56be('0x43')]);var _0x522274={'where':_0x19d433[_0x56be('0x40')]};return db[_0x56be('0x2e')][_0x56be('0x21')](_0x522274)[_0x56be('0x29')](function(_0x368fc1){_0x177d4c[_0x56be('0x21')]=_0x368fc1;if(_0x665ea5[_0x56be('0x34')][_0x56be('0x44')]){_0x19d433['include']=[{'all':!![]}];}return db[_0x56be('0x2e')][_0x56be('0x45')](_0x19d433);})[_0x56be('0x29')](function(_0x56d9c1){_0x177d4c[_0x56be('0x46')]=_0x56d9c1;return _0x177d4c;})[_0x56be('0x29')](respondWithFilteredResult(_0x45d4f0,_0x19d433))[_0x56be('0x47')](handleError(_0x45d4f0,null));};exports[_0x56be('0x48')]=function(_0x441fa8,_0xed2702){var _0x5a105d={'raw':!![],'where':{'id':_0x441fa8['params']['id']}},_0x42ea0b={};_0x42ea0b[_0x56be('0x33')]=_['keys'](db[_0x56be('0x2e')][_0x56be('0x2f')]);_0x42ea0b['query']=_[_0x56be('0x35')](_0x441fa8[_0x56be('0x34')]);_0x42ea0b[_0x56be('0x36')]=_[_0x56be('0x37')](_0x42ea0b[_0x56be('0x33')],_0x42ea0b[_0x56be('0x34')]);_0x5a105d['attributes']=_[_0x56be('0x37')](_0x42ea0b[_0x56be('0x33')],qs[_0x56be('0x39')](_0x441fa8['query']['fields']));_0x5a105d[_0x56be('0x38')]=_0x5a105d[_0x56be('0x38')]['length']?_0x5a105d[_0x56be('0x38')]:_0x42ea0b[_0x56be('0x33')];if(_0x441fa8[_0x56be('0x34')]['includeAll']){_0x5a105d['include']=[{'all':!![]}];}_0x5a105d=_['merge']({},_0x5a105d,_0x441fa8[_0x56be('0x43')]);return db[_0x56be('0x2e')][_0x56be('0x49')](_0x5a105d)['then'](handleEntityNotFound(_0xed2702,null))[_0x56be('0x29')](respondWithResult(_0xed2702,null))['catch'](handleError(_0xed2702,null));};exports[_0x56be('0x4a')]=function(_0x273f26,_0x3a75ce){return db[_0x56be('0x2e')][_0x56be('0x4a')](_0x273f26[_0x56be('0x4b')],{})['then'](respondWithResult(_0x3a75ce,0xc9))[_0x56be('0x47')](handleError(_0x3a75ce,null));};exports[_0x56be('0x27')]=function(_0x58746d,_0x551082){if(_0x58746d[_0x56be('0x4b')]['id']){delete _0x58746d[_0x56be('0x4b')]['id'];}return db['VoiceDialReport'][_0x56be('0x49')]({'where':{'id':_0x58746d[_0x56be('0x4c')]['id']}})[_0x56be('0x29')](handleEntityNotFound(_0x551082,null))[_0x56be('0x29')](saveUpdates(_0x58746d[_0x56be('0x4b')],null))['then'](respondWithResult(_0x551082,null))[_0x56be('0x47')](handleError(_0x551082,null));};exports[_0x56be('0x28')]=function(_0x24ac4a,_0x1ef15d){return db['VoiceDialReport']['find']({'where':{'id':_0x24ac4a[_0x56be('0x4c')]['id']}})[_0x56be('0x29')](handleEntityNotFound(_0x1ef15d,null))[_0x56be('0x29')](removeEntity(_0x1ef15d,null))[_0x56be('0x47')](handleError(_0x1ef15d,null));};exports[_0x56be('0x4d')]=function(_0x11b054,_0x46ff24){return db[_0x56be('0x2e')][_0x56be('0x4d')]()[_0x56be('0x29')](respondWithResult(_0x46ff24,null))['catch'](handleError(_0x46ff24,null));}; \ No newline at end of file +var _0xd1d7=['end','sendStatus','error','stack','name','index','map','VoiceDialReport','key','model','keys','filters','intersection','query','attributes','fields','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','reject','save','then','destroy'];(function(_0x474f36,_0x104751){var _0x451b9e=function(_0x2f8abc){while(--_0x2f8abc){_0x474f36['push'](_0x474f36['shift']());}};_0x451b9e(++_0x104751);}(_0xd1d7,0x144));var _0x7d1d=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0xd1d7[_0xca18be];return _0x2815ad;};'use strict';var pdf=require(_0x7d1d('0x0'));var emlformat=require(_0x7d1d('0x1'));var rimraf=require(_0x7d1d('0x2'));var zipdir=require(_0x7d1d('0x3'));var jsonpatch=require(_0x7d1d('0x4'));var rp=require(_0x7d1d('0x5'));var moment=require(_0x7d1d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7d1d('0x7'));var util=require(_0x7d1d('0x8'));var path=require(_0x7d1d('0x9'));var sox=require('sox');var csv=require(_0x7d1d('0xa'));var ejs=require(_0x7d1d('0xb'));var fs=require('fs');var _=require(_0x7d1d('0xc'));var squel=require(_0x7d1d('0xd'));var crypto=require(_0x7d1d('0xe'));var jsforce=require(_0x7d1d('0xf'));var deskjs=require(_0x7d1d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d1d('0x11'));var Redis=require(_0x7d1d('0x12'));var authService=require(_0x7d1d('0x13'));var qs=require(_0x7d1d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d1d('0x15'));var logger=require(_0x7d1d('0x16'))(_0x7d1d('0x17'));var utils=require(_0x7d1d('0x18'));var config=require(_0x7d1d('0x19'));var db=require(_0x7d1d('0x1a'))['db'];function respondWithStatusCode(_0x1e7c82,_0x3dc349){_0x3dc349=_0x3dc349||0xcc;return function(_0x170640){if(_0x170640){return _0x1e7c82['sendStatus'](_0x3dc349);}return _0x1e7c82['status'](_0x3dc349)['end']();};}function respondWithResult(_0x4d45a9,_0x2a0b3d){_0x2a0b3d=_0x2a0b3d||0xc8;return function(_0x34084b){if(_0x34084b){return _0x4d45a9[_0x7d1d('0x1b')](_0x2a0b3d)['json'](_0x34084b);}};}function respondWithFilteredResult(_0x48ee8b,_0x444b8a){return function(_0x859739){if(_0x859739){var _0x1b9108=_0x859739[_0x7d1d('0x1c')],_0x4776f3=_0x444b8a[_0x7d1d('0x1d')],_0xc6f9c6=_0x444b8a[_0x7d1d('0x1d')]+_0x444b8a[_0x7d1d('0x1e')],_0x24c033;if(_0xc6f9c6>=_0x1b9108){_0xc6f9c6=_0x1b9108;_0x24c033=0xc8;}else{_0x24c033=0xce;}_0x48ee8b[_0x7d1d('0x1b')](_0x24c033);return _0x48ee8b['set'](_0x7d1d('0x1f'),_0x4776f3+'-'+_0xc6f9c6+'/'+_0x1b9108)['json'](_0x859739);}return null;};}function patchUpdates(_0x4c098d){return function(_0x3c8b64){try{jsonpatch['apply'](_0x3c8b64,_0x4c098d,!![]);}catch(_0x4e07b7){return BPromise[_0x7d1d('0x20')](_0x4e07b7);}return _0x3c8b64[_0x7d1d('0x21')]();};}function saveUpdates(_0x3c210b,_0x23d1a6){return function(_0x555004){if(_0x555004){return _0x555004['update'](_0x3c210b)[_0x7d1d('0x22')](function(_0x5d1bb7){return _0x5d1bb7;});}return null;};}function removeEntity(_0x3034c9,_0x29c705){return function(_0x4efbac){if(_0x4efbac){return _0x4efbac[_0x7d1d('0x23')]()[_0x7d1d('0x22')](function(){_0x3034c9[_0x7d1d('0x1b')](0xcc)[_0x7d1d('0x24')]();});}};}function handleEntityNotFound(_0x30c170,_0x158f10){return function(_0x240a82){if(!_0x240a82){_0x30c170[_0x7d1d('0x25')](0x194);}return _0x240a82;};}function handleError(_0x204be7,_0x26a826){_0x26a826=_0x26a826||0x1f4;return function(_0x350331){logger[_0x7d1d('0x26')](_0x350331[_0x7d1d('0x27')]);if(_0x350331[_0x7d1d('0x28')]){delete _0x350331['name'];}_0x204be7[_0x7d1d('0x1b')](_0x26a826)['send'](_0x350331);};}exports[_0x7d1d('0x29')]=function(_0x356294,_0x1fe626){var _0x402ecd={},_0x2a1bef={},_0x163aea={'count':0x0,'rows':[]};var _0x1aa5b5=_[_0x7d1d('0x2a')](db[_0x7d1d('0x2b')]['rawAttributes'],function(_0xe21bcf){return{'name':_0xe21bcf['fieldName'],'type':_0xe21bcf['type'][_0x7d1d('0x2c')]};});_0x2a1bef[_0x7d1d('0x2d')]=_['map'](_0x1aa5b5,_0x7d1d('0x28'));_0x2a1bef['query']=_[_0x7d1d('0x2e')](_0x356294['query']);_0x2a1bef[_0x7d1d('0x2f')]=_[_0x7d1d('0x30')](_0x2a1bef[_0x7d1d('0x2d')],_0x2a1bef[_0x7d1d('0x31')]);_0x402ecd[_0x7d1d('0x32')]=_[_0x7d1d('0x30')](_0x2a1bef[_0x7d1d('0x2d')],qs[_0x7d1d('0x33')](_0x356294[_0x7d1d('0x31')][_0x7d1d('0x33')]));_0x402ecd[_0x7d1d('0x32')]=_0x402ecd[_0x7d1d('0x32')]['length']?_0x402ecd[_0x7d1d('0x32')]:_0x2a1bef['model'];if(!_0x356294['query']['hasOwnProperty'](_0x7d1d('0x34'))){_0x402ecd[_0x7d1d('0x1e')]=qs[_0x7d1d('0x1e')](_0x356294[_0x7d1d('0x31')][_0x7d1d('0x1e')]);_0x402ecd[_0x7d1d('0x1d')]=qs[_0x7d1d('0x1d')](_0x356294[_0x7d1d('0x31')]['offset']);}_0x402ecd['order']=qs[_0x7d1d('0x35')](_0x356294[_0x7d1d('0x31')][_0x7d1d('0x35')]);_0x402ecd[_0x7d1d('0x36')]=qs[_0x7d1d('0x2f')](_[_0x7d1d('0x37')](_0x356294['query'],_0x2a1bef[_0x7d1d('0x2f')]),_0x1aa5b5);if(_0x356294[_0x7d1d('0x31')][_0x7d1d('0x38')]){_0x402ecd[_0x7d1d('0x36')]=_[_0x7d1d('0x39')](_0x402ecd[_0x7d1d('0x36')],{'$or':_[_0x7d1d('0x2a')](_0x1aa5b5,function(_0x53cac1){if(_0x53cac1[_0x7d1d('0x3a')]!==_0x7d1d('0x3b')){var _0x23e037={};_0x23e037[_0x53cac1[_0x7d1d('0x28')]]={'$like':'%'+_0x356294['query'][_0x7d1d('0x38')]+'%'};return _0x23e037;}})});}_0x402ecd=_['merge']({},_0x402ecd,_0x356294[_0x7d1d('0x3c')]);var _0x390e90={'where':_0x402ecd[_0x7d1d('0x36')]};return db[_0x7d1d('0x2b')][_0x7d1d('0x1c')](_0x390e90)['then'](function(_0x2b2d33){_0x163aea[_0x7d1d('0x1c')]=_0x2b2d33;if(_0x356294['query'][_0x7d1d('0x3d')]){_0x402ecd[_0x7d1d('0x3e')]=[{'all':!![]}];}return db[_0x7d1d('0x2b')]['findAll'](_0x402ecd);})[_0x7d1d('0x22')](function(_0x71d52c){_0x163aea[_0x7d1d('0x3f')]=_0x71d52c;return _0x163aea;})['then'](respondWithFilteredResult(_0x1fe626,_0x402ecd))[_0x7d1d('0x40')](handleError(_0x1fe626,null));};exports['show']=function(_0xa8e9bf,_0x165edc){var _0x407543={'raw':!![],'where':{'id':_0xa8e9bf[_0x7d1d('0x41')]['id']}},_0x3f2970={};_0x3f2970[_0x7d1d('0x2d')]=_['keys'](db[_0x7d1d('0x2b')][_0x7d1d('0x42')]);_0x3f2970[_0x7d1d('0x31')]=_[_0x7d1d('0x2e')](_0xa8e9bf[_0x7d1d('0x31')]);_0x3f2970[_0x7d1d('0x2f')]=_['intersection'](_0x3f2970[_0x7d1d('0x2d')],_0x3f2970[_0x7d1d('0x31')]);_0x407543[_0x7d1d('0x32')]=_[_0x7d1d('0x30')](_0x3f2970[_0x7d1d('0x2d')],qs[_0x7d1d('0x33')](_0xa8e9bf['query'][_0x7d1d('0x33')]));_0x407543[_0x7d1d('0x32')]=_0x407543[_0x7d1d('0x32')]['length']?_0x407543[_0x7d1d('0x32')]:_0x3f2970[_0x7d1d('0x2d')];if(_0xa8e9bf[_0x7d1d('0x31')]['includeAll']){_0x407543[_0x7d1d('0x3e')]=[{'all':!![]}];}_0x407543=_['merge']({},_0x407543,_0xa8e9bf['options']);return db[_0x7d1d('0x2b')][_0x7d1d('0x43')](_0x407543)['then'](handleEntityNotFound(_0x165edc,null))[_0x7d1d('0x22')](respondWithResult(_0x165edc,null))[_0x7d1d('0x40')](handleError(_0x165edc,null));};exports['create']=function(_0x236e0b,_0x196595){return db[_0x7d1d('0x2b')][_0x7d1d('0x44')](_0x236e0b[_0x7d1d('0x45')],{})[_0x7d1d('0x22')](respondWithResult(_0x196595,0xc9))[_0x7d1d('0x40')](handleError(_0x196595,null));};exports[_0x7d1d('0x46')]=function(_0x5f3935,_0x341d5d){if(_0x5f3935[_0x7d1d('0x45')]['id']){delete _0x5f3935[_0x7d1d('0x45')]['id'];}return db[_0x7d1d('0x2b')][_0x7d1d('0x43')]({'where':{'id':_0x5f3935['params']['id']}})[_0x7d1d('0x22')](handleEntityNotFound(_0x341d5d,null))[_0x7d1d('0x22')](saveUpdates(_0x5f3935[_0x7d1d('0x45')],null))[_0x7d1d('0x22')](respondWithResult(_0x341d5d,null))['catch'](handleError(_0x341d5d,null));};exports[_0x7d1d('0x23')]=function(_0x189bd8,_0x5c54f8){return db[_0x7d1d('0x2b')][_0x7d1d('0x43')]({'where':{'id':_0x189bd8['params']['id']}})[_0x7d1d('0x22')](handleEntityNotFound(_0x5c54f8,null))[_0x7d1d('0x22')](removeEntity(_0x5c54f8,null))[_0x7d1d('0x40')](handleError(_0x5c54f8,null));};exports[_0x7d1d('0x47')]=function(_0x4fa45d,_0xf1e92b){return db[_0x7d1d('0x2b')][_0x7d1d('0x47')]()[_0x7d1d('0x22')](respondWithResult(_0xf1e92b,null))[_0x7d1d('0x40')](handleError(_0xf1e92b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 154f182..4d41852 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 _0xd991=['define','uniqueid','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3e539b,_0x43e11b){var _0x3434f9=function(_0x5d7c5f){while(--_0x5d7c5f){_0x3e539b['push'](_0x3e539b['shift']());}};_0x3434f9(++_0x43e11b);}(_0xd991,0x6a));var _0x1d99=function(_0x196615,_0x582da9){_0x196615=_0x196615-0x0;var _0x593cc6=_0xd991[_0x196615];return _0x593cc6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1d99('0x0'))(_0x1d99('0x1'));var moment=require('moment');var BPromise=require(_0x1d99('0x2'));var rp=require(_0x1d99('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d99('0x4'));var config=require(_0x1d99('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x31cd03,_0x3b8e08){return _0x31cd03[_0x1d99('0x6')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x1d99('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6136=['util','../../config/logger','api','moment','bluebird','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','lodash'];(function(_0x4cf475,_0x375c28){var _0x8876fe=function(_0x157658){while(--_0x157658){_0x4cf475['push'](_0x4cf475['shift']());}};_0x8876fe(++_0x375c28);}(_0x6136,0x112));var _0x6613=function(_0x180ab8,_0x54dee0){_0x180ab8=_0x180ab8-0x0;var _0x33c46b=_0x6136[_0x180ab8];return _0x33c46b;};'use strict';var _=require(_0x6613('0x0'));var util=require(_0x6613('0x1'));var logger=require(_0x6613('0x2'))(_0x6613('0x3'));var moment=require(_0x6613('0x4'));var BPromise=require(_0x6613('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6613('0x6'));var attributes=require(_0x6613('0x7'));module[_0x6613('0x8')]=function(_0x410b70,_0x17ce54){return _0x410b70['define'](_0x6613('0x9'),attributes,{'tableName':_0x6613('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 5646789..3afff20 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 _0xe3c5=['../../config/environment','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','options','then','CreateVoiceDialReport','UpdateVoiceDialReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5a4b4c,_0x2c504f){var _0x500540=function(_0x383e00){while(--_0x383e00){_0x5a4b4c['push'](_0x5a4b4c['shift']());}};_0x500540(++_0x2c504f);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x1dd2cc,_0x36ddfe){_0x1dd2cc=_0x1dd2cc-0x0;var _0x305d8e=_0xe3c5[_0x1dd2cc];return _0x305d8e;};'use strict';var _=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var moment=require(_0x5e3c('0x2'));var BPromise=require(_0x5e3c('0x3'));var rs=require(_0x5e3c('0x4'));var fs=require('fs');var Redis=require(_0x5e3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e3c('0x6'));var logger=require(_0x5e3c('0x7'))(_0x5e3c('0x8'));var config=require(_0x5e3c('0x9'));var jayson=require(_0x5e3c('0xa'));var client=jayson[_0x5e3c('0xb')][_0x5e3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d6b68,_0xc8c788,_0x17076a){return new BPromise(function(_0x3139da,_0x3068c6){return client['request'](_0x2d6b68,_0x17076a)['then'](function(_0x32942e){logger[_0x5e3c('0xd')](_0x5e3c('0xe'),_0xc8c788,_0x5e3c('0xf'));logger[_0x5e3c('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xc8c788,_0x5e3c('0xf'),JSON[_0x5e3c('0x11')](_0x32942e));if(_0x32942e['error']){if(_0x32942e[_0x5e3c('0x12')]['code']===0x1f4){logger['error'](_0x5e3c('0xe'),_0xc8c788,_0x32942e[_0x5e3c('0x12')][_0x5e3c('0x13')]);return _0x3068c6(_0x32942e[_0x5e3c('0x12')][_0x5e3c('0x13')]);}logger[_0x5e3c('0x12')](_0x5e3c('0xe'),_0xc8c788,_0x32942e[_0x5e3c('0x12')]['message']);return _0x3139da(_0x32942e['error'][_0x5e3c('0x13')]);}else{logger[_0x5e3c('0xd')](_0x5e3c('0xe'),_0xc8c788,'request\x20sent');_0x3139da(_0x32942e['result'][_0x5e3c('0x13')]);}})[_0x5e3c('0x14')](function(_0x321487){logger[_0x5e3c('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0xc8c788,_0x321487);_0x3068c6(_0x321487);});});}exports['CreateVoiceDialReport']=function(_0xc3635a){var _0x5e4a11=this;return new Promise(function(_0x4c8267,_0x17e973){return db['VoiceDialReport']['create'](_0xc3635a['body'],{'raw':_0xc3635a[_0x5e3c('0x15')]?_0xc3635a[_0x5e3c('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x5e3c('0x16')](function(_0x55a5e8){logger[_0x5e3c('0xd')](_0x5e3c('0x17'),_0xc3635a);logger[_0x5e3c('0x10')](_0x5e3c('0x17'),_0xc3635a,JSON[_0x5e3c('0x11')](_0x55a5e8));_0x4c8267(_0x55a5e8);})[_0x5e3c('0x14')](function(_0xf2a06c){logger['error']('CreateVoiceDialReport',_0xf2a06c['message'],_0xc3635a);_0x17e973(_0x5e4a11['error'](0x1f4,_0xf2a06c[_0x5e3c('0x13')]));});});};exports[_0x5e3c('0x18')]=function(_0x418994){var _0x1cf57f=this;return new Promise(function(_0x1a74ab,_0x41d7cd){return db['VoiceDialReport'][_0x5e3c('0x19')](_0x418994[_0x5e3c('0x1a')],{'raw':_0x418994[_0x5e3c('0x15')]?_0x418994[_0x5e3c('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x418994['options']?_0x418994[_0x5e3c('0x15')][_0x5e3c('0x1b')]||null:null,'attributes':_0x418994['options']?_0x418994[_0x5e3c('0x15')][_0x5e3c('0x1c')]||null:null,'limit':_0x418994[_0x5e3c('0x15')]?_0x418994[_0x5e3c('0x15')][_0x5e3c('0x1d')]||null:null})['then'](function(_0x2a61ab){logger['info']('UpdateVoiceDialReport',_0x418994);logger[_0x5e3c('0x10')](_0x5e3c('0x18'),_0x418994,JSON[_0x5e3c('0x11')](_0x2a61ab));_0x1a74ab(_0x2a61ab);})[_0x5e3c('0x14')](function(_0x488cc3){logger[_0x5e3c('0x12')](_0x5e3c('0x18'),_0x488cc3[_0x5e3c('0x13')],_0x418994);_0x41d7cd(_0x1cf57f[_0x5e3c('0x12')](0x1f4,_0x488cc3['message']));});});}; \ No newline at end of file +var _0x1978=['create','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','body','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x1978,0x174));var _0x8197=function(_0x384e4c,_0x241881){_0x384e4c=_0x384e4c-0x0;var _0x361098=_0x1978[_0x384e4c];return _0x361098;};'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':0x232a});function respondWithRpcPromise(_0x117bf1,_0x374969,_0x3e8799){return new BPromise(function(_0x1bc265,_0x108379){return client[_0x8197('0xc')](_0x117bf1,_0x3e8799)[_0x8197('0xd')](function(_0x3fd8ee){logger[_0x8197('0xe')](_0x8197('0xf'),_0x374969,_0x8197('0x10'));logger[_0x8197('0x11')](_0x8197('0x12'),_0x374969,'request\x20sent',JSON[_0x8197('0x13')](_0x3fd8ee));if(_0x3fd8ee[_0x8197('0x14')]){if(_0x3fd8ee[_0x8197('0x14')][_0x8197('0x15')]===0x1f4){logger[_0x8197('0x14')](_0x8197('0xf'),_0x374969,_0x3fd8ee['error']['message']);return _0x108379(_0x3fd8ee[_0x8197('0x14')][_0x8197('0x16')]);}logger[_0x8197('0x14')](_0x8197('0xf'),_0x374969,_0x3fd8ee[_0x8197('0x14')]['message']);return _0x1bc265(_0x3fd8ee[_0x8197('0x14')]['message']);}else{logger[_0x8197('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x374969,_0x8197('0x10'));_0x1bc265(_0x3fd8ee['result'][_0x8197('0x16')]);}})[_0x8197('0x17')](function(_0x56fd37){logger[_0x8197('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x374969,_0x56fd37);_0x108379(_0x56fd37);});});}exports['CreateVoiceDialReport']=function(_0x4695a5){var _0x48bce1=this;return new Promise(function(_0x170d65,_0x34292d){return db['VoiceDialReport'][_0x8197('0x18')](_0x4695a5['body'],{'raw':_0x4695a5[_0x8197('0x19')]?_0x4695a5[_0x8197('0x19')][_0x8197('0x1a')]===undefined?!![]:![]:!![]})[_0x8197('0xd')](function(_0x22e831){logger[_0x8197('0xe')]('CreateVoiceDialReport',_0x4695a5);logger[_0x8197('0x11')](_0x8197('0x1b'),_0x4695a5,JSON[_0x8197('0x13')](_0x22e831));_0x170d65(_0x22e831);})['catch'](function(_0x4c06d1){logger[_0x8197('0x14')](_0x8197('0x1b'),_0x4c06d1[_0x8197('0x16')],_0x4695a5);_0x34292d(_0x48bce1[_0x8197('0x14')](0x1f4,_0x4c06d1[_0x8197('0x16')]));});});};exports[_0x8197('0x1c')]=function(_0x570241){var _0x4199d8=this;return new Promise(function(_0xe50ccd,_0xd7285e){return db['VoiceDialReport'][_0x8197('0x1d')](_0x570241[_0x8197('0x1e')],{'raw':_0x570241[_0x8197('0x19')]?_0x570241[_0x8197('0x19')][_0x8197('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x570241[_0x8197('0x19')]?_0x570241[_0x8197('0x19')]['where']||null:null,'attributes':_0x570241[_0x8197('0x19')]?_0x570241[_0x8197('0x19')][_0x8197('0x1f')]||null:null,'limit':_0x570241[_0x8197('0x19')]?_0x570241[_0x8197('0x19')][_0x8197('0x20')]||null:null})['then'](function(_0x8cd98c){logger[_0x8197('0xe')]('UpdateVoiceDialReport',_0x570241);logger[_0x8197('0x11')](_0x8197('0x1c'),_0x570241,JSON['stringify'](_0x8cd98c));_0xe50ccd(_0x8cd98c);})[_0x8197('0x17')](function(_0x21c7a4){logger[_0x8197('0x14')](_0x8197('0x1c'),_0x21c7a4[_0x8197('0x16')],_0x570241);_0xd7285e(_0x4199d8[_0x8197('0x14')](0x1f4,_0x21c7a4[_0x8197('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0a6ec15..5a3a276 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 _0xe43b=['create','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id'];(function(_0x2b1bb9,_0x3f85cc){var _0x59f401=function(_0x14ac15){while(--_0x14ac15){_0x2b1bb9['push'](_0x2b1bb9['shift']());}};_0x59f401(++_0x3f85cc);}(_0xe43b,0x1ed));var _0xbe43=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xe43b[_0x25bca6];return _0x3f8d02;};'use strict';var multer=require(_0xbe43('0x0'));var util=require(_0xbe43('0x1'));var path=require(_0xbe43('0x2'));var timeout=require(_0xbe43('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbe43('0x4'));var config=require(_0xbe43('0x5'));var controller=require(_0xbe43('0x6'));router[_0xbe43('0x7')]('/',auth[_0xbe43('0x8')](),controller[_0xbe43('0x9')]);router[_0xbe43('0x7')](_0xbe43('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbe43('0x8')](),controller[_0xbe43('0xb')]);router['post'](_0xbe43('0xc'),auth[_0xbe43('0x8')](),controller[_0xbe43('0xd')]);router[_0xbe43('0xe')](_0xbe43('0xa'),auth['isAuthenticated'](),controller[_0xbe43('0xf')]);router[_0xbe43('0x10')](_0xbe43('0xa'),auth[_0xbe43('0x8')](),controller[_0xbe43('0x11')]);module['exports']=router; \ No newline at end of file +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(_0x560b59,_0x102048){var _0x31c2d1=function(_0xf16c23){while(--_0xf16c23){_0x560b59['push'](_0x560b59['shift']());}};_0x31c2d1(++_0x102048);}(_0x5e01,0x160));var _0x15e0=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x5e01[_0x28aea5];return _0x6a55f9;};'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 diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 1377dde..2fb5790 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(_0x18e47e,_0x2accac){var _0x4721c9=function(_0x3d65ea){while(--_0x3d65ea){_0x18e47e['push'](_0x18e47e['shift']());}};_0x4721c9(++_0x2accac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x4a1bae,_0x586a09){var _0x10fd38=function(_0x260dcc){while(--_0x260dcc){_0x4a1bae['push'](_0x4a1bae['shift']());}};_0x10fd38(++_0x586a09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 c83e236..c471285 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 _0xdb28=['nolimit','order','sort','where','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','destroy','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','cutdigits','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./voiceExtension.socket','register','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','value','includes','type','find','UserProfileResource','stack','name','send','index','VoiceExtension','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x136a44,_0x407967){var _0x503b59=function(_0x10ad81){while(--_0x10ad81){_0x136a44['push'](_0x136a44['shift']());}};_0x503b59(++_0x407967);}(_0xdb28,0x106));var _0x8db2=function(_0x15cd8e,_0xf2b46c){_0x15cd8e=_0x15cd8e-0x0;var _0x185ac8=_0xdb28[_0x15cd8e];return _0x185ac8;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];config[_0x8db2('0x18')]=_[_0x8db2('0x19')](config[_0x8db2('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0x18')]));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x1d6a15,_0x227355){_0x227355=_0x227355||0xcc;return function(_0xfa285b){if(_0xfa285b){return _0x1d6a15[_0x8db2('0x1c')](_0x227355);}return _0x1d6a15[_0x8db2('0x1d')](_0x227355)[_0x8db2('0x1e')]();};}function respondWithResult(_0x16c8c2,_0x5489a9){_0x5489a9=_0x5489a9||0xc8;return function(_0x13b0f5){if(_0x13b0f5){return _0x16c8c2[_0x8db2('0x1d')](_0x5489a9)['json'](_0x13b0f5);}};}function respondWithFilteredResult(_0x2b3f73,_0x44957d){return function(_0x21db8c){if(_0x21db8c){var _0x3fddc2=_0x21db8c['count'],_0x2efd06=_0x44957d[_0x8db2('0x1f')],_0x46ce14=_0x44957d[_0x8db2('0x1f')]+_0x44957d[_0x8db2('0x20')],_0x51d60d;if(_0x46ce14>=_0x3fddc2){_0x46ce14=_0x3fddc2;_0x51d60d=0xc8;}else{_0x51d60d=0xce;}_0x2b3f73[_0x8db2('0x1d')](_0x51d60d);return _0x2b3f73['set'](_0x8db2('0x21'),_0x2efd06+'-'+_0x46ce14+'/'+_0x3fddc2)[_0x8db2('0x22')](_0x21db8c);}return null;};}function patchUpdates(_0x260940){return function(_0x297ba3){try{jsonpatch[_0x8db2('0x23')](_0x297ba3,_0x260940,!![]);}catch(_0x597260){return BPromise[_0x8db2('0x24')](_0x597260);}return _0x297ba3[_0x8db2('0x25')]();};}function saveUpdates(_0x18f69c,_0x125be2){return function(_0x2260d8){if(_0x2260d8){return _0x2260d8[_0x8db2('0x26')](_0x18f69c)[_0x8db2('0x27')](function(_0x5c6614){return _0x5c6614;});}return null;};}function removeEntity(_0x256202,_0x4f6516){return function(_0x5725f0){if(_0x5725f0){return _0x5725f0['destroy']()['then'](function(){var _0xec8cd2=_0x5725f0[_0x8db2('0x28')]({'plain':!![]});var _0x3be281=[{'name':_0x8db2('0x29'),'value':_0x8db2('0x2a'),'ignore':![]},{'name':_0x8db2('0x2b'),'value':'outbound','ignore':![]},{'name':_0x8db2('0x2c'),'value':_0x8db2('0x2d'),'ignore':![]}];var _0x430dd5=_(_0x3be281)[_0x8db2('0x2e')]('ignore')[_0x8db2('0x2f')](_0x8db2('0x30'))[_0x8db2('0x30')]();if(_[_0x8db2('0x31')](_0x430dd5,_0xec8cd2[_0x8db2('0x32')])){return;}var _0x21bae5=_[_0x8db2('0x33')](_0x3be281,[_0x8db2('0x30'),_0xec8cd2[_0x8db2('0x32')]])['name'];return db[_0x8db2('0x34')]['destroy']({'where':{'type':_0x21bae5,'resourceId':_0xec8cd2['id']}})['then'](function(){return _0x5725f0;});})[_0x8db2('0x27')](function(){_0x256202[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x49b2b3,_0x42b272){return function(_0x56b71a){if(!_0x56b71a){_0x49b2b3[_0x8db2('0x1c')](0x194);}return _0x56b71a;};}function handleError(_0x2b653b,_0x14bd12){_0x14bd12=_0x14bd12||0x1f4;return function(_0x4d9e26){logger['error'](_0x4d9e26[_0x8db2('0x35')]);if(_0x4d9e26[_0x8db2('0x36')]){delete _0x4d9e26['name'];}_0x2b653b['status'](_0x14bd12)[_0x8db2('0x37')](_0x4d9e26);};}exports[_0x8db2('0x38')]=function(_0xc884a,_0x2a2d65){var _0x17ad44={},_0xd39848={},_0x101711={'count':0x0,'rows':[]};var _0xae31b7=_[_0x8db2('0x2f')](db[_0x8db2('0x39')]['rawAttributes'],function(_0x1ab5eb){return{'name':_0x1ab5eb[_0x8db2('0x3a')],'type':_0x1ab5eb['type'][_0x8db2('0x3b')]};});_0xd39848[_0x8db2('0x3c')]=_['map'](_0xae31b7,'name');_0xd39848[_0x8db2('0x3d')]=_['keys'](_0xc884a[_0x8db2('0x3d')]);_0xd39848[_0x8db2('0x3e')]=_[_0x8db2('0x3f')](_0xd39848[_0x8db2('0x3c')],_0xd39848['query']);_0x17ad44[_0x8db2('0x40')]=_['intersection'](_0xd39848[_0x8db2('0x3c')],qs[_0x8db2('0x41')](_0xc884a[_0x8db2('0x3d')][_0x8db2('0x41')]));_0x17ad44['attributes']=_0x17ad44['attributes'][_0x8db2('0x42')]?_0x17ad44[_0x8db2('0x40')]:_0xd39848['model'];if(!_0xc884a[_0x8db2('0x3d')][_0x8db2('0x43')](_0x8db2('0x44'))){_0x17ad44['limit']=qs[_0x8db2('0x20')](_0xc884a[_0x8db2('0x3d')][_0x8db2('0x20')]);_0x17ad44[_0x8db2('0x1f')]=qs[_0x8db2('0x1f')](_0xc884a[_0x8db2('0x3d')][_0x8db2('0x1f')]);}_0x17ad44[_0x8db2('0x45')]=qs[_0x8db2('0x46')](_0xc884a[_0x8db2('0x3d')][_0x8db2('0x46')]);_0x17ad44[_0x8db2('0x47')]=qs[_0x8db2('0x3e')](_['pick'](_0xc884a[_0x8db2('0x3d')],_0xd39848[_0x8db2('0x3e')]),_0xae31b7);if(_0xc884a['query']['filter']){_0x17ad44[_0x8db2('0x47')]=_['merge'](_0x17ad44[_0x8db2('0x47')],{'$or':_[_0x8db2('0x2f')](_0xae31b7,function(_0x313130){if(_0x313130[_0x8db2('0x32')]!==_0x8db2('0x48')){var _0x30d606={};_0x30d606[_0x313130[_0x8db2('0x36')]]={'$like':'%'+_0xc884a['query'][_0x8db2('0x2e')]+'%'};return _0x30d606;}})});}_0x17ad44=_[_0x8db2('0x49')]({},_0x17ad44,_0xc884a[_0x8db2('0x4a')]);var _0x4a0b56={'where':_0x17ad44['where']};return db[_0x8db2('0x39')][_0x8db2('0x4b')](_0x4a0b56)[_0x8db2('0x27')](function(_0x2c47cc){_0x101711['count']=_0x2c47cc;if(_0xc884a[_0x8db2('0x3d')]['includeAll']){_0x17ad44[_0x8db2('0x4c')]=[{'all':!![]}];}return db[_0x8db2('0x39')][_0x8db2('0x4d')](_0x17ad44);})['then'](function(_0x4b0e72){_0x101711[_0x8db2('0x4e')]=_0x4b0e72;return _0x101711;})['then'](respondWithFilteredResult(_0x2a2d65,_0x17ad44))[_0x8db2('0x4f')](handleError(_0x2a2d65,null));};exports[_0x8db2('0x50')]=function(_0x27b8eb,_0x3a0c1b){var _0x2244b9={'raw':![],'where':{'id':_0x27b8eb[_0x8db2('0x51')]['id']}},_0x40c6e6={};_0x40c6e6[_0x8db2('0x3c')]=_[_0x8db2('0x52')](db[_0x8db2('0x39')][_0x8db2('0x53')]);_0x40c6e6[_0x8db2('0x3d')]=_['keys'](_0x27b8eb[_0x8db2('0x3d')]);_0x40c6e6[_0x8db2('0x3e')]=_[_0x8db2('0x3f')](_0x40c6e6[_0x8db2('0x3c')],_0x40c6e6['query']);_0x2244b9['attributes']=_[_0x8db2('0x3f')](_0x40c6e6[_0x8db2('0x3c')],qs[_0x8db2('0x41')](_0x27b8eb['query']['fields']));_0x2244b9['attributes']=_0x2244b9[_0x8db2('0x40')][_0x8db2('0x42')]?_0x2244b9[_0x8db2('0x40')]:_0x40c6e6[_0x8db2('0x3c')];if(_0x27b8eb[_0x8db2('0x3d')][_0x8db2('0x54')]){_0x2244b9[_0x8db2('0x4c')]=[{'all':!![]}];}_0x2244b9=_['merge']({},_0x2244b9,_0x27b8eb['options']);return db[_0x8db2('0x39')][_0x8db2('0x33')](_0x2244b9)[_0x8db2('0x27')](handleEntityNotFound(_0x3a0c1b,null))[_0x8db2('0x27')](respondWithResult(_0x3a0c1b,null))[_0x8db2('0x4f')](handleError(_0x3a0c1b,null));};exports[_0x8db2('0x55')]=function(_0x1f0f7c,_0x3ca2a7){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'where':{'id':_0x1f0f7c[_0x8db2('0x51')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x3ca2a7,null))[_0x8db2('0x27')](removeEntity(_0x3ca2a7,null))[_0x8db2('0x4f')](handleError(_0x3ca2a7,null));};exports[_0x8db2('0x56')]=function(_0x55ad51,_0x2ded23){if(_0x55ad51[_0x8db2('0x57')]['type']===_0x8db2('0x58')&&!_[_0x8db2('0x59')](_0x55ad51[_0x8db2('0x57')]['exten'],'_')){_0x55ad51[_0x8db2('0x57')][_0x8db2('0x5a')]='_'[_0x8db2('0x5b')](_0x55ad51[_0x8db2('0x57')][_0x8db2('0x5a')]);}return db['VoiceExtension'][_0x8db2('0x56')](_0x55ad51[_0x8db2('0x57')],{'raw':![]})[_0x8db2('0x27')](function(_0x58bb60){var _0x1e7d1a=_0x55ad51[_0x8db2('0x5c')][_0x8db2('0x28')]({'plain':!![]});if(!_0x1e7d1a)throw new Error(_0x8db2('0x5d'));if(_0x1e7d1a[_0x8db2('0x5e')]===_0x8db2('0x5c')){var _0x12a81a=_0x58bb60['get']({'plain':!![]});var _0x39ff90=[{'name':_0x8db2('0x29'),'value':'inbound'},{'name':_0x8db2('0x2b'),'value':_0x8db2('0x58')},{'name':'InternalRoutes','value':_0x8db2('0x2d')}];var _0x927c01=_[_0x8db2('0x33')](_0x39ff90,[_0x8db2('0x30'),_0x12a81a[_0x8db2('0x32')]])[_0x8db2('0x36')];return db[_0x8db2('0x5f')][_0x8db2('0x33')]({'where':{'name':_0x927c01,'userProfileId':_0x1e7d1a[_0x8db2('0x60')]},'raw':!![]})[_0x8db2('0x27')](function(_0x12fd12){if(_0x12fd12&&_0x12fd12[_0x8db2('0x61')]===0x0){return db[_0x8db2('0x34')][_0x8db2('0x56')]({'name':_0x12a81a[_0x8db2('0x36')],'resourceId':_0x12a81a['id'],'type':_0x12fd12[_0x8db2('0x36')],'sectionId':_0x12fd12['id']},{})['then'](function(){return _0x58bb60;});}else{return _0x58bb60;}})[_0x8db2('0x4f')](function(_0x2a0309){logger[_0x8db2('0x62')](_0x8db2('0x63'),_0x2a0309);throw _0x2a0309;});}return _0x58bb60;})[_0x8db2('0x27')](respondWithResult(_0x2ded23,0xc9))['catch'](handleError(_0x2ded23,null));};exports[_0x8db2('0x26')]=function(_0x2c3087,_0x3ab670){if(_0x2c3087[_0x8db2('0x57')]['id']){delete _0x2c3087[_0x8db2('0x57')]['id'];}return db[_0x8db2('0x39')][_0x8db2('0x33')]({'where':{'id':_0x2c3087[_0x8db2('0x51')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x27')](function(_0x10f42a){if(_0x10f42a){return db[_0x8db2('0x39')][_0x8db2('0x26')](_[_0x8db2('0x64')](_0x2c3087[_0x8db2('0x57')],[_0x8db2('0x5a'),_0x8db2('0x65'),_0x8db2('0x66'),'recordingFormat',_0x8db2('0x67'),'mandatoryDisposition']),{'where':{'context':_0x10f42a[_0x8db2('0x65')],'exten':_0x10f42a['exten']},'individualHooks':!![]})[_0x8db2('0x27')](function(_0x39330c){return _0x39330c;});}return null;})[_0x8db2('0x27')](respondWithStatusCode(_0x3ab670,null))[_0x8db2('0x4f')](handleError(_0x3ab670,null));};exports[_0x8db2('0x68')]=function(_0x59a32e,_0x50c5fb,_0x3d1128){return db[_0x8db2('0x39')][_0x8db2('0x69')]({'where':{'id':_0x59a32e[_0x8db2('0x51')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x50c5fb,null))[_0x8db2('0x27')](function(_0x3e3de3){if(_0x3e3de3){return db[_0x8db2('0x6a')]['transaction'](function(_0x2bde16){return db[_0x8db2('0x39')][_0x8db2('0x55')]({'where':{'VoiceExtensionId':_0x59a32e[_0x8db2('0x51')]['id']},'transaction':_0x2bde16})[_0x8db2('0x27')](function(_0x382c75){var _0x451746=_[_0x8db2('0x2f')](_0x59a32e['body'],function(_0x54318c){_0x54318c[_0x8db2('0x6b')]=_0x59a32e[_0x8db2('0x51')]['id'];return _0x54318c;});return db[_0x8db2('0x39')][_0x8db2('0x6c')](_0x451746,{'transaction':_0x2bde16});});})[_0x8db2('0x27')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x59a32e[_0x8db2('0x51')]['id']},'order':_0x8db2('0x6d')});});}})['then'](respondWithResult(_0x50c5fb,null))[_0x8db2('0x4f')](handleError(_0x50c5fb,null));}; \ No newline at end of file +var _0x524e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','find','type','name','destroy','end','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','includeAll','include','show','params','catch','create','startsWith','body','exten','concat','user'];(function(_0x61074,_0x3ecd30){var _0x53434b=function(_0x55b924){while(--_0x55b924){_0x61074['push'](_0x61074['shift']());}};_0x53434b(++_0x3ecd30);}(_0x524e,0x15e));var _0xe524=function(_0x1be552,_0x482a7b){_0x1be552=_0x1be552-0x0;var _0x4044f6=_0x524e[_0x1be552];return _0x4044f6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var Redis=require(_0xe524('0x12'));var authService=require(_0xe524('0x13'));var qs=require(_0xe524('0x14'));var as=require(_0xe524('0x15'));var hardwareService=require(_0xe524('0x16'));var logger=require(_0xe524('0x17'))(_0xe524('0x18'));var utils=require(_0xe524('0x19'));var config=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];config[_0xe524('0x1c')]=_['defaults'](config['redis'],{'host':_0xe524('0x1d'),'port':0x18eb});var socket=require(_0xe524('0x1e'))(new Redis(config[_0xe524('0x1c')]));require(_0xe524('0x1f'))[_0xe524('0x20')](socket);function respondWithStatusCode(_0x57c1b6,_0x12ff75){_0x12ff75=_0x12ff75||0xcc;return function(_0x51e9fe){if(_0x51e9fe){return _0x57c1b6[_0xe524('0x21')](_0x12ff75);}return _0x57c1b6[_0xe524('0x22')](_0x12ff75)['end']();};}function respondWithResult(_0x569660,_0x488fce){_0x488fce=_0x488fce||0xc8;return function(_0x109795){if(_0x109795){return _0x569660['status'](_0x488fce)[_0xe524('0x23')](_0x109795);}};}function respondWithFilteredResult(_0x5f17fe,_0x5c8736){return function(_0x5a5c0d){if(_0x5a5c0d){var _0x3a4027=_0x5a5c0d[_0xe524('0x24')],_0x4f1dfb=_0x5c8736[_0xe524('0x25')],_0x11b2a1=_0x5c8736['offset']+_0x5c8736[_0xe524('0x26')],_0x238f8f;if(_0x11b2a1>=_0x3a4027){_0x11b2a1=_0x3a4027;_0x238f8f=0xc8;}else{_0x238f8f=0xce;}_0x5f17fe[_0xe524('0x22')](_0x238f8f);return _0x5f17fe['set'](_0xe524('0x27'),_0x4f1dfb+'-'+_0x11b2a1+'/'+_0x3a4027)[_0xe524('0x23')](_0x5a5c0d);}return null;};}function patchUpdates(_0x43a4f9){return function(_0x1dcc0f){try{jsonpatch[_0xe524('0x28')](_0x1dcc0f,_0x43a4f9,!![]);}catch(_0x1cab6c){return BPromise[_0xe524('0x29')](_0x1cab6c);}return _0x1dcc0f[_0xe524('0x2a')]();};}function saveUpdates(_0x7dfe97,_0x5c4d21){return function(_0x7d1f92){if(_0x7d1f92){return _0x7d1f92['update'](_0x7dfe97)['then'](function(_0x2d2f83){return _0x2d2f83;});}return null;};}function removeEntity(_0x23df5e,_0x1ad106){return function(_0x85fc51){if(_0x85fc51){return _0x85fc51['destroy']()[_0xe524('0x2b')](function(){var _0x4a03bc=_0x85fc51[_0xe524('0x2c')]({'plain':!![]});var _0xcf5db=[{'name':_0xe524('0x2d'),'value':_0xe524('0x2e'),'ignore':![]},{'name':_0xe524('0x2f'),'value':_0xe524('0x30'),'ignore':![]},{'name':_0xe524('0x31'),'value':'internal','ignore':![]}];var _0x58a896=_(_0xcf5db)[_0xe524('0x32')](_0xe524('0x33'))[_0xe524('0x34')](_0xe524('0x35'))[_0xe524('0x35')]();if(_['includes'](_0x58a896,_0x4a03bc['type'])){return;}var _0x4b1ff=_[_0xe524('0x36')](_0xcf5db,[_0xe524('0x35'),_0x4a03bc[_0xe524('0x37')]])[_0xe524('0x38')];return db['UserProfileResource'][_0xe524('0x39')]({'where':{'type':_0x4b1ff,'resourceId':_0x4a03bc['id']}})[_0xe524('0x2b')](function(){return _0x85fc51;});})['then'](function(){_0x23df5e['status'](0xcc)[_0xe524('0x3a')]();});}};}function handleEntityNotFound(_0x376324,_0x5b2fc3){return function(_0x31d4a7){if(!_0x31d4a7){_0x376324['sendStatus'](0x194);}return _0x31d4a7;};}function handleError(_0x3fec06,_0x54af2a){_0x54af2a=_0x54af2a||0x1f4;return function(_0x315e56){logger[_0xe524('0x3b')](_0x315e56[_0xe524('0x3c')]);if(_0x315e56['name']){delete _0x315e56[_0xe524('0x38')];}_0x3fec06['status'](_0x54af2a)[_0xe524('0x3d')](_0x315e56);};}exports[_0xe524('0x3e')]=function(_0x276343,_0x502256){var _0x16e124={},_0x119cc3={},_0x49c43e={'count':0x0,'rows':[]};var _0x27817e=_[_0xe524('0x34')](db[_0xe524('0x3f')][_0xe524('0x40')],function(_0x53560d){return{'name':_0x53560d[_0xe524('0x41')],'type':_0x53560d[_0xe524('0x37')][_0xe524('0x42')]};});_0x119cc3[_0xe524('0x43')]=_[_0xe524('0x34')](_0x27817e,_0xe524('0x38'));_0x119cc3[_0xe524('0x44')]=_[_0xe524('0x45')](_0x276343['query']);_0x119cc3[_0xe524('0x46')]=_['intersection'](_0x119cc3[_0xe524('0x43')],_0x119cc3[_0xe524('0x44')]);_0x16e124['attributes']=_[_0xe524('0x47')](_0x119cc3['model'],qs[_0xe524('0x48')](_0x276343[_0xe524('0x44')][_0xe524('0x48')]));_0x16e124[_0xe524('0x49')]=_0x16e124[_0xe524('0x49')][_0xe524('0x4a')]?_0x16e124[_0xe524('0x49')]:_0x119cc3[_0xe524('0x43')];if(!_0x276343['query'][_0xe524('0x4b')](_0xe524('0x4c'))){_0x16e124[_0xe524('0x26')]=qs[_0xe524('0x26')](_0x276343[_0xe524('0x44')][_0xe524('0x26')]);_0x16e124[_0xe524('0x25')]=qs[_0xe524('0x25')](_0x276343['query'][_0xe524('0x25')]);}_0x16e124[_0xe524('0x4d')]=qs[_0xe524('0x4e')](_0x276343['query'][_0xe524('0x4e')]);_0x16e124['where']=qs[_0xe524('0x46')](_[_0xe524('0x4f')](_0x276343[_0xe524('0x44')],_0x119cc3[_0xe524('0x46')]),_0x27817e);if(_0x276343[_0xe524('0x44')][_0xe524('0x32')]){_0x16e124[_0xe524('0x50')]=_['merge'](_0x16e124[_0xe524('0x50')],{'$or':_[_0xe524('0x34')](_0x27817e,function(_0x13c54c){if(_0x13c54c[_0xe524('0x37')]!==_0xe524('0x51')){var _0x1ae283={};_0x1ae283[_0x13c54c['name']]={'$like':'%'+_0x276343[_0xe524('0x44')][_0xe524('0x32')]+'%'};return _0x1ae283;}})});}_0x16e124=_[_0xe524('0x52')]({},_0x16e124,_0x276343['options']);var _0x21ea32={'where':_0x16e124['where']};return db['VoiceExtension'][_0xe524('0x24')](_0x21ea32)[_0xe524('0x2b')](function(_0x4da26f){_0x49c43e[_0xe524('0x24')]=_0x4da26f;if(_0x276343[_0xe524('0x44')][_0xe524('0x53')]){_0x16e124[_0xe524('0x54')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x16e124);})[_0xe524('0x2b')](function(_0x10aad6){_0x49c43e['rows']=_0x10aad6;return _0x49c43e;})[_0xe524('0x2b')](respondWithFilteredResult(_0x502256,_0x16e124))['catch'](handleError(_0x502256,null));};exports[_0xe524('0x55')]=function(_0x181680,_0x462b87){var _0x312c47={'raw':![],'where':{'id':_0x181680[_0xe524('0x56')]['id']}},_0xbde17b={};_0xbde17b[_0xe524('0x43')]=_[_0xe524('0x45')](db[_0xe524('0x3f')][_0xe524('0x40')]);_0xbde17b[_0xe524('0x44')]=_[_0xe524('0x45')](_0x181680[_0xe524('0x44')]);_0xbde17b[_0xe524('0x46')]=_[_0xe524('0x47')](_0xbde17b['model'],_0xbde17b[_0xe524('0x44')]);_0x312c47['attributes']=_['intersection'](_0xbde17b[_0xe524('0x43')],qs['fields'](_0x181680[_0xe524('0x44')][_0xe524('0x48')]));_0x312c47['attributes']=_0x312c47[_0xe524('0x49')]['length']?_0x312c47['attributes']:_0xbde17b[_0xe524('0x43')];if(_0x181680[_0xe524('0x44')][_0xe524('0x53')]){_0x312c47['include']=[{'all':!![]}];}_0x312c47=_['merge']({},_0x312c47,_0x181680['options']);return db['VoiceExtension']['find'](_0x312c47)['then'](handleEntityNotFound(_0x462b87,null))[_0xe524('0x2b')](respondWithResult(_0x462b87,null))[_0xe524('0x57')](handleError(_0x462b87,null));};exports['destroy']=function(_0x465fb5,_0x40b871){return db[_0xe524('0x3f')][_0xe524('0x36')]({'where':{'id':_0x465fb5[_0xe524('0x56')]['id']}})['then'](handleEntityNotFound(_0x40b871,null))[_0xe524('0x2b')](removeEntity(_0x40b871,null))[_0xe524('0x57')](handleError(_0x40b871,null));};exports[_0xe524('0x58')]=function(_0x494c39,_0x24f65b){if(_0x494c39['body'][_0xe524('0x37')]===_0xe524('0x30')&&!_[_0xe524('0x59')](_0x494c39[_0xe524('0x5a')][_0xe524('0x5b')],'_')){_0x494c39[_0xe524('0x5a')][_0xe524('0x5b')]='_'[_0xe524('0x5c')](_0x494c39[_0xe524('0x5a')][_0xe524('0x5b')]);}return db[_0xe524('0x3f')][_0xe524('0x58')](_0x494c39['body'],{'raw':![]})['then'](function(_0x4831fa){var _0xe49f84=_0x494c39[_0xe524('0x5d')][_0xe524('0x2c')]({'plain':!![]});if(!_0xe49f84)throw new Error(_0xe524('0x5e'));if(_0xe49f84[_0xe524('0x5f')]===_0xe524('0x5d')){var _0x33ae9d=_0x4831fa[_0xe524('0x2c')]({'plain':!![]});var _0x1e9006=[{'name':_0xe524('0x2d'),'value':_0xe524('0x2e')},{'name':'OutboundRoutes','value':_0xe524('0x30')},{'name':_0xe524('0x31'),'value':'internal'}];var _0x53da86=_['find'](_0x1e9006,['value',_0x33ae9d[_0xe524('0x37')]])[_0xe524('0x38')];return db[_0xe524('0x60')][_0xe524('0x36')]({'where':{'name':_0x53da86,'userProfileId':_0xe49f84['userProfileId']},'raw':!![]})[_0xe524('0x2b')](function(_0x244f08){if(_0x244f08&&_0x244f08[_0xe524('0x61')]===0x0){return db[_0xe524('0x62')]['create']({'name':_0x33ae9d['name'],'resourceId':_0x33ae9d['id'],'type':_0x244f08['name'],'sectionId':_0x244f08['id']},{})[_0xe524('0x2b')](function(){return _0x4831fa;});}else{return _0x4831fa;}})['catch'](function(_0x357418){logger[_0xe524('0x3b')](_0xe524('0x63'),_0x357418);throw _0x357418;});}return _0x4831fa;})[_0xe524('0x2b')](respondWithResult(_0x24f65b,0xc9))[_0xe524('0x57')](handleError(_0x24f65b,null));};exports['update']=function(_0x5d0507,_0x29a519){if(_0x5d0507[_0xe524('0x5a')]['id']){delete _0x5d0507[_0xe524('0x5a')]['id'];}return db[_0xe524('0x3f')][_0xe524('0x36')]({'where':{'id':_0x5d0507[_0xe524('0x56')]['id']}})['then'](handleEntityNotFound(_0x29a519,null))[_0xe524('0x2b')](function(_0x26160b){if(_0x26160b){return db[_0xe524('0x3f')]['update'](_[_0xe524('0x4f')](_0x5d0507[_0xe524('0x5a')],[_0xe524('0x5b'),'context','description',_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66')]),{'where':{'context':_0x26160b[_0xe524('0x67')],'exten':_0x26160b[_0xe524('0x5b')]},'individualHooks':!![]})['then'](function(_0xe102a0){return _0xe102a0;});}return null;})[_0xe524('0x2b')](respondWithStatusCode(_0x29a519,null))[_0xe524('0x57')](handleError(_0x29a519,null));};exports[_0xe524('0x68')]=function(_0x3ce098,_0x22d06a,_0x35e6b2){return db[_0xe524('0x3f')][_0xe524('0x69')]({'where':{'id':_0x3ce098[_0xe524('0x56')]['id']}})[_0xe524('0x2b')](handleEntityNotFound(_0x22d06a,null))['then'](function(_0x3cf9c2){if(_0x3cf9c2){return db[_0xe524('0x6a')][_0xe524('0x6b')](function(_0xfed246){return db[_0xe524('0x3f')]['destroy']({'where':{'VoiceExtensionId':_0x3ce098[_0xe524('0x56')]['id']},'transaction':_0xfed246})[_0xe524('0x2b')](function(_0x2ea4c9){var _0x32d11a=_[_0xe524('0x34')](_0x3ce098[_0xe524('0x5a')],function(_0x2a09f5){_0x2a09f5['VoiceExtensionId']=_0x3ce098[_0xe524('0x56')]['id'];return _0x2a09f5;});return db[_0xe524('0x3f')][_0xe524('0x6c')](_0x32d11a,{'transaction':_0xfed246});});})[_0xe524('0x2b')](function(){return db['VoiceExtension'][_0xe524('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3ce098['params']['id']},'order':_0xe524('0x6e')});});}})[_0xe524('0x2b')](respondWithResult(_0x22d06a,null))[_0xe524('0x57')](handleError(_0x22d06a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 406ee72..be9438e 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 _0xc62a=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','save','remove','emit'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xc62a,0x123));var _0xac62=function(_0x11d746,_0x45facb){_0x11d746=_0x11d746-0x0;var _0x47bebb=_0xc62a[_0x11d746];return _0x47bebb;};'use strict';var EventEmitter=require(_0xac62('0x0'));var VoiceExtension=require(_0xac62('0x1'))['db'][_0xac62('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac62('0x3'),'afterUpdate':'update','afterDestroy':_0xac62('0x4')};function emitEvent(_0x3c6a7b){return function(_0x54f4f5,_0x82ed71,_0x4972cb){VoiceExtensionEvents[_0xac62('0x5')](_0x3c6a7b+':'+_0x54f4f5['id'],_0x54f4f5);VoiceExtensionEvents[_0xac62('0x5')](_0x3c6a7b,_0x54f4f5);_0x4972cb(null);};}for(var e in events){if(events[_0xac62('0x6')](e)){var event=events[e];VoiceExtension[_0xac62('0x7')](e,emitEvent(event));}}module[_0xac62('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc22b=['remove','emit','hasOwnProperty','hook','VoiceExtension','setMaxListeners','update'];(function(_0x272587,_0x4e5fb1){var _0x3c2ff6=function(_0x36b68d){while(--_0x36b68d){_0x272587['push'](_0x272587['shift']());}};_0x3c2ff6(++_0x4e5fb1);}(_0xc22b,0x1c4));var _0xbc22=function(_0x34321f,_0x8cf48b){_0x34321f=_0x34321f-0x0;var _0x43b7e2=_0xc22b[_0x34321f];return _0x43b7e2;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xbc22('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbc22('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc22('0x2'),'afterDestroy':_0xbc22('0x3')};function emitEvent(_0x31bff3){return function(_0x47af60,_0x446573,_0xb3259a){VoiceExtensionEvents[_0xbc22('0x4')](_0x31bff3+':'+_0x47af60['id'],_0x47af60);VoiceExtensionEvents[_0xbc22('0x4')](_0x31bff3,_0x47af60);_0xb3259a(null);};}for(var e in events){if(events[_0xbc22('0x5')](e)){var event=events[e];VoiceExtension[_0xbc22('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 106b11f..c6031a5 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 _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceExtension','voice_extensions','util','api','moment'];(function(_0x4b4554,_0x146431){var _0x5c1d12=function(_0x172065){while(--_0x172065){_0x4b4554['push'](_0x4b4554['shift']());}};_0x5c1d12(++_0x146431);}(_0xadb5,0xad));var _0x5adb=function(_0x3bd776,_0x14dc09){_0x3bd776=_0x3bd776-0x0;var _0x42992e=_0xadb5[_0x3bd776];return _0x42992e;};'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('./voiceExtension.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceExtension','voice_extensions','util','api','moment'];(function(_0x80eb66,_0x5a1622){var _0x24b084=function(_0x204535){while(--_0x204535){_0x80eb66['push'](_0x80eb66['shift']());}};_0x24b084(++_0x5a1622);}(_0xadb5,0xad));var _0x5adb=function(_0xc560aa,_0x337e3f){_0xc560aa=_0xc560aa-0x0;var _0x157adc=_0xadb5[_0xc560aa];return _0x157adc;};'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('./voiceExtension.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ce73f41..48e1cb5 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 _0x23ab=['then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','include','model','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x23ab,0x88));var _0xb23a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x23ab[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xb23a('0x0'));var util=require('util');var moment=require(_0xb23a('0x1'));var BPromise=require(_0xb23a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb23a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb23a('0x4'));var logger=require(_0xb23a('0x5'))(_0xb23a('0x6'));var config=require(_0xb23a('0x7'));var jayson=require(_0xb23a('0x8'));var client=jayson[_0xb23a('0x9')]['http']({'port':0x232a});config[_0xb23a('0xa')]=_[_0xb23a('0xb')](config[_0xb23a('0xa')],{'host':_0xb23a('0xc'),'port':0x18eb});var socket=require(_0xb23a('0xd'))(new Redis(config[_0xb23a('0xa')]));require(_0xb23a('0xe'))[_0xb23a('0xf')](socket);function respondWithRpcPromise(_0x1bb402,_0x3bf60d,_0x491dc5){return new BPromise(function(_0x335ffe,_0xb77fcf){return client['request'](_0x1bb402,_0x491dc5)[_0xb23a('0x10')](function(_0x133b53){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x3bf60d,_0xb23a('0x11'));logger[_0xb23a('0x12')](_0xb23a('0x13'),_0x3bf60d,_0xb23a('0x11'),JSON[_0xb23a('0x14')](_0x133b53));if(_0x133b53[_0xb23a('0x15')]){if(_0x133b53[_0xb23a('0x15')][_0xb23a('0x16')]===0x1f4){logger[_0xb23a('0x15')](_0xb23a('0x17'),_0x3bf60d,_0x133b53[_0xb23a('0x15')][_0xb23a('0x18')]);return _0xb77fcf(_0x133b53[_0xb23a('0x15')]['message']);}logger[_0xb23a('0x15')](_0xb23a('0x17'),_0x3bf60d,_0x133b53[_0xb23a('0x15')][_0xb23a('0x18')]);return _0x335ffe(_0x133b53[_0xb23a('0x15')][_0xb23a('0x18')]);}else{logger[_0xb23a('0x19')](_0xb23a('0x17'),_0x3bf60d,_0xb23a('0x11'));_0x335ffe(_0x133b53[_0xb23a('0x1a')][_0xb23a('0x18')]);}})[_0xb23a('0x1b')](function(_0x4861a7){logger['error'](_0xb23a('0x17'),_0x3bf60d,_0x4861a7);_0xb77fcf(_0x4861a7);});});}exports[_0xb23a('0x1c')]=function(_0x2621fc){var _0x362b3f=this;return new Promise(function(_0x28e0df,_0x206533){return db[_0xb23a('0x1d')][_0xb23a('0x1e')]({'raw':_0x2621fc[_0xb23a('0x1f')]?_0x2621fc[_0xb23a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2621fc[_0xb23a('0x1f')]?_0x2621fc[_0xb23a('0x1f')][_0xb23a('0x20')]||null:null,'attributes':_0x2621fc[_0xb23a('0x1f')]?_0x2621fc['options'][_0xb23a('0x21')]||null:null,'limit':_0x2621fc[_0xb23a('0x1f')]?_0x2621fc[_0xb23a('0x1f')][_0xb23a('0x22')]||null:null,'include':_0x2621fc['options']?_0x2621fc['options']['include']?_[_0xb23a('0x23')](_0x2621fc[_0xb23a('0x1f')][_0xb23a('0x24')],function(_0x141ac8){return{'model':db[_0x141ac8[_0xb23a('0x25')]],'as':_0x141ac8['as'],'attributes':_0x141ac8['attributes'],'include':_0x141ac8[_0xb23a('0x24')]?_[_0xb23a('0x23')](_0x141ac8[_0xb23a('0x24')],function(_0x35957c){return{'model':db[_0x35957c['model']],'as':_0x35957c['as'],'attributes':_0x35957c[_0xb23a('0x21')],'include':_0x35957c[_0xb23a('0x24')]?_[_0xb23a('0x23')](_0x35957c[_0xb23a('0x24')],function(_0x52e683){return{'model':db[_0x52e683[_0xb23a('0x25')]],'as':_0x52e683['as'],'attributes':_0x52e683['attributes']};}):[]};}):[]};}):[]:[]})[_0xb23a('0x10')](function(_0x5a3c1e){logger[_0xb23a('0x19')](_0xb23a('0x1c'),_0x2621fc);logger[_0xb23a('0x12')](_0xb23a('0x1c'),_0x2621fc,JSON['stringify'](_0x5a3c1e));_0x28e0df(_0x5a3c1e);})[_0xb23a('0x1b')](function(_0x5e83be){logger[_0xb23a('0x15')]('GetVoiceExtension',_0x5e83be[_0xb23a('0x18')],_0x2621fc);_0x206533(_0x362b3f[_0xb23a('0x15')](0x1f4,_0x5e83be['message']));});});}; \ No newline at end of file +var _0xae8a=['result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x381f58,_0x18e5f7){var _0x4c32ca=function(_0x117cf7){while(--_0x117cf7){_0x381f58['push'](_0x381f58['shift']());}};_0x4c32ca(++_0x18e5f7);}(_0xae8a,0x1c7));var _0xaae8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xae8a[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xaae8('0x0'));var util=require(_0xaae8('0x1'));var moment=require(_0xaae8('0x2'));var BPromise=require(_0xaae8('0x3'));var rs=require(_0xaae8('0x4'));var fs=require('fs');var Redis=require(_0xaae8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaae8('0x6'));var logger=require('../../config/logger')(_0xaae8('0x7'));var config=require(_0xaae8('0x8'));var jayson=require(_0xaae8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xaae8('0xa')]=_['defaults'](config['redis'],{'host':_0xaae8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaae8('0xc'))['register'](socket);function respondWithRpcPromise(_0x4a996c,_0x4cdda8,_0x3b67b2){return new BPromise(function(_0x33dec3,_0x2fe7e8){return client['request'](_0x4a996c,_0x3b67b2)[_0xaae8('0xd')](function(_0x1d4d23){logger[_0xaae8('0xe')](_0xaae8('0xf'),_0x4cdda8,_0xaae8('0x10'));logger[_0xaae8('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4cdda8,'request\x20sent',JSON['stringify'](_0x1d4d23));if(_0x1d4d23[_0xaae8('0x12')]){if(_0x1d4d23[_0xaae8('0x12')][_0xaae8('0x13')]===0x1f4){logger[_0xaae8('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4cdda8,_0x1d4d23['error'][_0xaae8('0x14')]);return _0x2fe7e8(_0x1d4d23[_0xaae8('0x12')]['message']);}logger[_0xaae8('0x12')](_0xaae8('0xf'),_0x4cdda8,_0x1d4d23[_0xaae8('0x12')][_0xaae8('0x14')]);return _0x33dec3(_0x1d4d23[_0xaae8('0x12')]['message']);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x4cdda8,_0xaae8('0x10'));_0x33dec3(_0x1d4d23[_0xaae8('0x15')][_0xaae8('0x14')]);}})[_0xaae8('0x16')](function(_0x508186){logger['error'](_0xaae8('0xf'),_0x4cdda8,_0x508186);_0x2fe7e8(_0x508186);});});}exports['GetVoiceExtension']=function(_0x55c2e9){var _0x228457=this;return new Promise(function(_0x3b5984,_0x5a4992){return db[_0xaae8('0x17')][_0xaae8('0x18')]({'raw':_0x55c2e9[_0xaae8('0x19')]?_0x55c2e9[_0xaae8('0x19')][_0xaae8('0x1a')]===undefined?!![]:![]:!![],'where':_0x55c2e9[_0xaae8('0x19')]?_0x55c2e9[_0xaae8('0x19')][_0xaae8('0x1b')]||null:null,'attributes':_0x55c2e9[_0xaae8('0x19')]?_0x55c2e9[_0xaae8('0x19')][_0xaae8('0x1c')]||null:null,'limit':_0x55c2e9['options']?_0x55c2e9[_0xaae8('0x19')][_0xaae8('0x1d')]||null:null,'include':_0x55c2e9[_0xaae8('0x19')]?_0x55c2e9[_0xaae8('0x19')][_0xaae8('0x1e')]?_[_0xaae8('0x1f')](_0x55c2e9['options']['include'],function(_0x4d34a3){return{'model':db[_0x4d34a3[_0xaae8('0x20')]],'as':_0x4d34a3['as'],'attributes':_0x4d34a3[_0xaae8('0x1c')],'include':_0x4d34a3[_0xaae8('0x1e')]?_[_0xaae8('0x1f')](_0x4d34a3[_0xaae8('0x1e')],function(_0x1bdfb9){return{'model':db[_0x1bdfb9[_0xaae8('0x20')]],'as':_0x1bdfb9['as'],'attributes':_0x1bdfb9[_0xaae8('0x1c')],'include':_0x1bdfb9[_0xaae8('0x1e')]?_[_0xaae8('0x1f')](_0x1bdfb9[_0xaae8('0x1e')],function(_0x21db26){return{'model':db[_0x21db26['model']],'as':_0x21db26['as'],'attributes':_0x21db26['attributes']};}):[]};}):[]};}):[]:[]})[_0xaae8('0xd')](function(_0x1881fa){logger[_0xaae8('0xe')]('GetVoiceExtension',_0x55c2e9);logger[_0xaae8('0x11')](_0xaae8('0x21'),_0x55c2e9,JSON['stringify'](_0x1881fa));_0x3b5984(_0x1881fa);})[_0xaae8('0x16')](function(_0x4d1296){logger['error'](_0xaae8('0x21'),_0x4d1296['message'],_0x55c2e9);_0x5a4992(_0x228457[_0xaae8('0x12')](0x1f4,_0x4d1296[_0xaae8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 0a613bf..0e3f92c 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 _0x1266=['voiceExtension:','./voiceExtension.events','remove','update','length'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0x1266,0x13c));var _0x6126=function(_0x12697c,_0x2ff8d6){_0x12697c=_0x12697c-0x0;var _0x1b3e7e=_0x1266[_0x12697c];return _0x1b3e7e;};'use strict';var VoiceExtensionEvents=require(_0x6126('0x0'));var events=['save',_0x6126('0x1'),_0x6126('0x2')];function createListener(_0x176eea,_0x493c50){return function(_0xecbf55){_0x493c50['emit'](_0x176eea,_0xecbf55);};}function removeListener(_0x41f779,_0x16ecc7){return function(){VoiceExtensionEvents['removeListener'](_0x41f779,_0x16ecc7);};}exports['register']=function(_0x483e10){for(var _0x137027=0x0,_0x19008c=events[_0x6126('0x3')];_0x137027<_0x19008c;_0x137027++){var _0x374a3f=events[_0x137027];var _0x4d5da4=createListener(_0x6126('0x4')+_0x374a3f,_0x483e10);VoiceExtensionEvents['on'](_0x374a3f,_0x4d5da4);}}; \ No newline at end of file +var _0x5dfe=['remove','update','emit','removeListener','register','voiceExtension:','./voiceExtension.events','save'];(function(_0x3ef490,_0xff3e7a){var _0x400885=function(_0x1ef8e2){while(--_0x1ef8e2){_0x3ef490['push'](_0x3ef490['shift']());}};_0x400885(++_0xff3e7a);}(_0x5dfe,0x15e));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceExtensionEvents=require(_0xe5df('0x0'));var events=[_0xe5df('0x1'),_0xe5df('0x2'),_0xe5df('0x3')];function createListener(_0x27a00d,_0x5c5c34){return function(_0x4811ec){_0x5c5c34[_0xe5df('0x4')](_0x27a00d,_0x4811ec);};}function removeListener(_0x429c2c,_0xfd3f79){return function(){VoiceExtensionEvents[_0xe5df('0x5')](_0x429c2c,_0xfd3f79);};}exports[_0xe5df('0x6')]=function(_0x67b4fe){for(var _0x5c3375=0x0,_0x45947b=events['length'];_0x5c3375<_0x45947b;_0x5c3375++){var _0x48198e=events[_0x5c3375];var _0x8d7ebd=createListener(_0xe5df('0x7')+_0x48198e,_0x67b4fe);VoiceExtensionEvents['on'](_0x48198e,_0x8d7ebd);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 19bba92..206fb89 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 _0x2885=['./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x279cc6,_0xe42918){var _0x12453a=function(_0x47b0b2){while(--_0x47b0b2){_0x279cc6['push'](_0x279cc6['shift']());}};_0x12453a(++_0xe42918);}(_0x2885,0x162));var _0x5288=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x2885[_0xd09668];return _0x68726;};'use strict';var multer=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var path=require('path');var timeout=require(_0x5288('0x2'));var express=require('express');var router=express[_0x5288('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5288('0x4'));var config=require(_0x5288('0x5'));var controller=require(_0x5288('0x6'));router[_0x5288('0x7')]('/',auth[_0x5288('0x8')](),controller[_0x5288('0x9')]);router[_0x5288('0x7')](_0x5288('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5288('0x7')](_0x5288('0xb'),auth[_0x5288('0x8')](),controller['getMessages']);router[_0x5288('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5288('0xd')](_0x5288('0xa'),auth[_0x5288('0x8')](),controller[_0x5288('0xe')]);router[_0x5288('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5288('0x10')]);module[_0x5288('0x11')]=router; \ No newline at end of file +var _0xce0a=['get','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index'];(function(_0x3e73ef,_0x1d6589){var _0x14be4a=function(_0x3844be){while(--_0x3844be){_0x3e73ef['push'](_0x3e73ef['shift']());}};_0x14be4a(++_0x1d6589);}(_0xce0a,0x1e4));var _0xace0=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0xce0a[_0x591cfd];return _0x4d0100;};'use strict';var multer=require('multer');var util=require(_0xace0('0x0'));var path=require(_0xace0('0x1'));var timeout=require(_0xace0('0x2'));var express=require(_0xace0('0x3'));var router=express[_0xace0('0x4')]();var auth=require(_0xace0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xace0('0x6'));var controller=require(_0xace0('0x7'));router['get']('/',auth[_0xace0('0x8')](),controller[_0xace0('0x9')]);router[_0xace0('0xa')]('/:id',auth[_0xace0('0x8')](),controller['show']);router[_0xace0('0xa')]('/:id/messages',auth[_0xace0('0x8')](),controller['getMessages']);router[_0xace0('0xb')]('/',auth[_0xace0('0x8')](),controller[_0xace0('0xc')]);router[_0xace0('0xd')](_0xace0('0xe'),auth[_0xace0('0x8')](),controller[_0xace0('0xf')]);router[_0xace0('0x10')]('/:id',auth[_0xace0('0x8')](),controller[_0xace0('0x11')]);module[_0xace0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index c80b936..eeb5dc2 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 _0x9ffd=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x59f4bf,_0xf43438){_0x59f4bf=_0x59f4bf-0x0;var _0x2ca445=_0x9ffd[_0x59f4bf];return _0x2ca445;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'customer_id':{'type':Sequelize[_0xd9ff('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xd9ff('0x3'),'unique':_0xd9ff('0x4')},'mailbox':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':'','allowNull':![],'unique':_0xd9ff('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xd9ff('0x2')]},'email':{'type':Sequelize[_0xd9ff('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5b8b99){this[_0xd9ff('0x5')](_0xd9ff('0x6'),typeof _0x5b8b99===_0xd9ff('0x7')&&_0x5b8b99[_0xd9ff('0x8')]()?_0x5b8b99[_0xd9ff('0x8')]():null);}},'pager':{'type':Sequelize[_0xd9ff('0x2')]},'tz':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':_0xd9ff('0x9')},'attach':{'type':Sequelize[_0xd9ff('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd9ff('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xd9ff('0x2')]},'callback':{'type':Sequelize[_0xd9ff('0x2')]},'review':{'type':Sequelize[_0xd9ff('0xa')](_0xd9ff('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd9ff('0xa')](_0xd9ff('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd9ff('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xd9ff('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd9ff('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xd9ff('0xa')](_0xd9ff('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd9ff('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd9ff('0xa')](_0xd9ff('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xd9ff('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xd9ff('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xd9ff('0xd')},'emailsubject':{'type':Sequelize[_0xd9ff('0x2')]},'emailbody':{'type':Sequelize[_0xd9ff('0x2')]},'maxsecs':{'type':Sequelize[_0xd9ff('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd9ff('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd9ff('0xf')],'get':function(){return this[_0xd9ff('0x10')](_0xd9ff('0x11'))+_0xd9ff('0x12')+this[_0xd9ff('0x10')](_0xd9ff('0x13'));}}}; \ No newline at end of file +var _0x36ee=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x564cf7,_0x26a298){var _0x1d0962=function(_0x5be2e8){while(--_0x5be2e8){_0x564cf7['push'](_0x564cf7['shift']());}};_0x1d0962(++_0x26a298);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xe36e('0x0')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe36e('0x1'),'unique':_0xe36e('0x2')},'mailbox':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':'','allowNull':![],'unique':_0xe36e('0x2')},'password':{'type':Sequelize[_0xe36e('0x0')]},'fullname':{'type':Sequelize[_0xe36e('0x0')]},'email':{'type':Sequelize[_0xe36e('0x0')],'validate':{'isEmail':!![]},'set':function(_0x3f29e1){this[_0xe36e('0x3')](_0xe36e('0x4'),typeof _0x3f29e1===_0xe36e('0x5')&&_0x3f29e1[_0xe36e('0x6')]()?_0x3f29e1['trim']():null);}},'pager':{'type':Sequelize[_0xe36e('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xe36e('0x7')},'attach':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xe36e('0x8')]('yes','no'),'defaultValue':_0xe36e('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe36e('0x0')]},'callback':{'type':Sequelize[_0xe36e('0x0')]},'review':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe36e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe36e('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe36e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe36e('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xe36e('0x9'),'no'),'defaultValue':_0xe36e('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe36e('0x8')](_0xe36e('0x9'),'no'),'defaultValue':_0xe36e('0x9'),'allowNull':![]},'stamp':{'type':_0xe36e('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe36e('0x0')]},'maxsecs':{'type':Sequelize[_0xe36e('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe36e('0xd')],'get':function(){return this['getDataValue'](_0xe36e('0xe'))+_0xe36e('0xf')+this['getDataValue'](_0xe36e('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7ce8eab..aeda3a0 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 _0xa459=['sort','filters','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','fields','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','mailbox','findAndCountAll','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','Voicemails','error','stack','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','name','keys','intersection','model','query','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa459,0x114));var _0x9a45=function(_0x366272,_0x1f11a6){_0x366272=_0x366272-0x0;var _0x3ee038=_0xa459[_0x366272];return _0x3ee038;};'use strict';var pdf=require(_0x9a45('0x0'));var emlformat=require(_0x9a45('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9a45('0x2'));var rp=require(_0x9a45('0x3'));var moment=require(_0x9a45('0x4'));var BPromise=require(_0x9a45('0x5'));var Mustache=require(_0x9a45('0x6'));var util=require(_0x9a45('0x7'));var path=require('path');var sox=require(_0x9a45('0x8'));var csv=require(_0x9a45('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9a45('0xa'));var crypto=require(_0x9a45('0xb'));var jsforce=require(_0x9a45('0xc'));var deskjs=require(_0x9a45('0xd'));var toCsv=require(_0x9a45('0x9'));var querystring=require(_0x9a45('0xe'));var Papa=require(_0x9a45('0xf'));var Redis=require(_0x9a45('0x10'));var authService=require(_0x9a45('0x11'));var qs=require(_0x9a45('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a45('0x13'));var logger=require(_0x9a45('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9a45('0x15'));var db=require(_0x9a45('0x16'))['db'];function respondWithStatusCode(_0x321636,_0x36d251){_0x36d251=_0x36d251||0xcc;return function(_0x5b8bb4){if(_0x5b8bb4){return _0x321636['sendStatus'](_0x36d251);}return _0x321636[_0x9a45('0x17')](_0x36d251)[_0x9a45('0x18')]();};}function respondWithResult(_0x110893,_0x2f580a){_0x2f580a=_0x2f580a||0xc8;return function(_0x32eb4e){if(_0x32eb4e){return _0x110893[_0x9a45('0x17')](_0x2f580a)[_0x9a45('0x19')](_0x32eb4e);}};}function respondWithFilteredResult(_0x35dc41,_0x2ea6b6){return function(_0x1cdfa8){if(_0x1cdfa8){var _0x1c7f2a=_0x1cdfa8[_0x9a45('0x1a')],_0x1d01b9=_0x2ea6b6[_0x9a45('0x1b')],_0x42daf1=_0x2ea6b6['offset']+_0x2ea6b6['limit'],_0xd05657;if(_0x42daf1>=_0x1c7f2a){_0x42daf1=_0x1c7f2a;_0xd05657=0xc8;}else{_0xd05657=0xce;}_0x35dc41[_0x9a45('0x17')](_0xd05657);return _0x35dc41[_0x9a45('0x1c')](_0x9a45('0x1d'),_0x1d01b9+'-'+_0x42daf1+'/'+_0x1c7f2a)[_0x9a45('0x19')](_0x1cdfa8);}return null;};}function patchUpdates(_0x14c07c){return function(_0x2518ac){try{jsonpatch['apply'](_0x2518ac,_0x14c07c,!![]);}catch(_0x2d3fc2){return BPromise['reject'](_0x2d3fc2);}return _0x2518ac[_0x9a45('0x1e')]();};}function saveUpdates(_0x1495d0,_0x2692f4){return function(_0x1d0982){if(_0x1d0982){return _0x1d0982[_0x9a45('0x1f')](_0x1495d0)[_0x9a45('0x20')](function(_0x337a46){return _0x337a46;});}return null;};}function removeEntity(_0x5820f4,_0x506512){return function(_0x3c4e1e){if(_0x3c4e1e){return _0x3c4e1e[_0x9a45('0x21')]()[_0x9a45('0x20')](function(){var _0x2ad8c6=_0x3c4e1e['get']({'plain':!![]});var _0x5ae056=_0x9a45('0x22');return db['UserProfileResource'][_0x9a45('0x21')]({'where':{'type':_0x5ae056,'resourceId':_0x2ad8c6['id']}})[_0x9a45('0x20')](function(){return _0x3c4e1e;});})['then'](function(){_0x5820f4[_0x9a45('0x17')](0xcc)[_0x9a45('0x18')]();});}};}function handleEntityNotFound(_0x3695c8,_0x3a567d){return function(_0x48e50d){if(!_0x48e50d){_0x3695c8['sendStatus'](0x194);}return _0x48e50d;};}function handleError(_0x28ea5f,_0x546618){_0x546618=_0x546618||0x1f4;return function(_0xf09580){logger[_0x9a45('0x23')](_0xf09580[_0x9a45('0x24')]);if(_0xf09580['name']){delete _0xf09580['name'];}_0x28ea5f[_0x9a45('0x17')](_0x546618)[_0x9a45('0x25')](_0xf09580);};}exports[_0x9a45('0x26')]=function(_0x4766ff,_0x766e9){var _0x5b56b8={},_0x303e3f={},_0xadb6={'count':0x0,'rows':[]};var _0x5dbef2=_[_0x9a45('0x27')](db[_0x9a45('0x28')][_0x9a45('0x29')],function(_0x40c27e){return{'name':_0x40c27e[_0x9a45('0x2a')],'type':_0x40c27e[_0x9a45('0x2b')][_0x9a45('0x2c')]};});_0x303e3f['model']=_[_0x9a45('0x27')](_0x5dbef2,_0x9a45('0x2d'));_0x303e3f['query']=_[_0x9a45('0x2e')](_0x4766ff['query']);_0x303e3f['filters']=_[_0x9a45('0x2f')](_0x303e3f[_0x9a45('0x30')],_0x303e3f[_0x9a45('0x31')]);_0x5b56b8[_0x9a45('0x32')]=_[_0x9a45('0x2f')](_0x303e3f[_0x9a45('0x30')],qs['fields'](_0x4766ff[_0x9a45('0x31')]['fields']));_0x5b56b8[_0x9a45('0x32')]=_0x5b56b8[_0x9a45('0x32')][_0x9a45('0x33')]?_0x5b56b8[_0x9a45('0x32')]:_0x303e3f[_0x9a45('0x30')];if(!_0x4766ff[_0x9a45('0x31')][_0x9a45('0x34')](_0x9a45('0x35'))){_0x5b56b8[_0x9a45('0x36')]=qs[_0x9a45('0x36')](_0x4766ff[_0x9a45('0x31')]['limit']);_0x5b56b8[_0x9a45('0x1b')]=qs[_0x9a45('0x1b')](_0x4766ff[_0x9a45('0x31')][_0x9a45('0x1b')]);}_0x5b56b8[_0x9a45('0x37')]=qs[_0x9a45('0x38')](_0x4766ff[_0x9a45('0x31')][_0x9a45('0x38')]);_0x5b56b8['where']=qs[_0x9a45('0x39')](_['pick'](_0x4766ff['query'],_0x303e3f['filters']),_0x5dbef2);if(_0x4766ff['query'][_0x9a45('0x3a')]){_0x5b56b8[_0x9a45('0x3b')]=_[_0x9a45('0x3c')](_0x5b56b8[_0x9a45('0x3b')],{'$or':_[_0x9a45('0x27')](_0x5dbef2,function(_0x162ec7){if(_0x162ec7['type']!==_0x9a45('0x3d')){var _0x2dd433={};_0x2dd433[_0x162ec7[_0x9a45('0x2d')]]={'$like':'%'+_0x4766ff['query']['filter']+'%'};return _0x2dd433;}})});}_0x5b56b8=_[_0x9a45('0x3c')]({},_0x5b56b8,_0x4766ff[_0x9a45('0x3e')]);var _0x1f9f09={'where':_0x5b56b8['where']};return db[_0x9a45('0x28')][_0x9a45('0x1a')](_0x1f9f09)[_0x9a45('0x20')](function(_0x2b384e){_0xadb6[_0x9a45('0x1a')]=_0x2b384e;if(_0x4766ff[_0x9a45('0x31')][_0x9a45('0x3f')]){_0x5b56b8['include']=[{'all':!![]}];}return db[_0x9a45('0x28')]['findAll'](_0x5b56b8);})[_0x9a45('0x20')](function(_0x5af57d){_0xadb6[_0x9a45('0x40')]=_0x5af57d;return _0xadb6;})[_0x9a45('0x20')](respondWithFilteredResult(_0x766e9,_0x5b56b8))[_0x9a45('0x41')](handleError(_0x766e9,null));};exports['show']=function(_0x448ede,_0x532b4c){var _0x1a7338={'raw':!![],'where':{'id':_0x448ede[_0x9a45('0x42')]['id']}},_0x5fa12={};_0x5fa12[_0x9a45('0x30')]=_[_0x9a45('0x2e')](db[_0x9a45('0x28')][_0x9a45('0x29')]);_0x5fa12[_0x9a45('0x31')]=_[_0x9a45('0x2e')](_0x448ede['query']);_0x5fa12[_0x9a45('0x39')]=_[_0x9a45('0x2f')](_0x5fa12[_0x9a45('0x30')],_0x5fa12['query']);_0x1a7338[_0x9a45('0x32')]=_[_0x9a45('0x2f')](_0x5fa12[_0x9a45('0x30')],qs[_0x9a45('0x43')](_0x448ede[_0x9a45('0x31')]['fields']));_0x1a7338['attributes']=_0x1a7338['attributes']['length']?_0x1a7338[_0x9a45('0x32')]:_0x5fa12[_0x9a45('0x30')];if(_0x448ede[_0x9a45('0x31')]['includeAll']){_0x1a7338[_0x9a45('0x44')]=[{'all':!![]}];}_0x1a7338=_[_0x9a45('0x3c')]({},_0x1a7338,_0x448ede[_0x9a45('0x3e')]);return db[_0x9a45('0x28')][_0x9a45('0x45')](_0x1a7338)['then'](handleEntityNotFound(_0x532b4c,null))[_0x9a45('0x20')](respondWithResult(_0x532b4c,null))[_0x9a45('0x41')](handleError(_0x532b4c,null));};exports[_0x9a45('0x46')]=function(_0x34bb0c,_0xaa581){return db[_0x9a45('0x28')]['create'](_0x34bb0c[_0x9a45('0x47')],{})['then'](function(_0x1f6232){var _0xf1d6d2=_0x34bb0c['user'][_0x9a45('0x48')]({'plain':!![]});if(!_0xf1d6d2)throw new Error(_0x9a45('0x49'));if(_0xf1d6d2['role']===_0x9a45('0x4a')){var _0x51f612=_0x1f6232['get']({'plain':!![]});var _0x401d6e='Voicemails';return db[_0x9a45('0x4b')][_0x9a45('0x45')]({'where':{'name':_0x401d6e,'userProfileId':_0xf1d6d2['userProfileId']},'raw':!![]})[_0x9a45('0x20')](function(_0xdb3911){if(_0xdb3911&&_0xdb3911[_0x9a45('0x4c')]===0x0){return db[_0x9a45('0x4d')][_0x9a45('0x46')]({'name':_0x51f612[_0x9a45('0x2d')],'resourceId':_0x51f612['id'],'type':_0xdb3911['name'],'sectionId':_0xdb3911['id']},{})['then'](function(){return _0x1f6232;});}else{return _0x1f6232;}})[_0x9a45('0x41')](function(_0x1ee7da){logger[_0x9a45('0x23')](_0x9a45('0x4e'),_0x1ee7da);throw _0x1ee7da;});}return _0x1f6232;})[_0x9a45('0x20')](respondWithResult(_0xaa581,0xc9))['catch'](handleError(_0xaa581,null));};exports['update']=function(_0x36a9f7,_0x5ceb76){if(_0x36a9f7['body']['id']){delete _0x36a9f7[_0x9a45('0x47')]['id'];}return db[_0x9a45('0x28')][_0x9a45('0x45')]({'where':{'id':_0x36a9f7[_0x9a45('0x42')]['id']}})[_0x9a45('0x20')](handleEntityNotFound(_0x5ceb76,null))[_0x9a45('0x20')](saveUpdates(_0x36a9f7[_0x9a45('0x47')],null))[_0x9a45('0x20')](respondWithResult(_0x5ceb76,null))[_0x9a45('0x41')](handleError(_0x5ceb76,null));};exports[_0x9a45('0x21')]=function(_0x402e4b,_0x1c51df){return db[_0x9a45('0x28')]['find']({'where':{'id':_0x402e4b[_0x9a45('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c51df,null))[_0x9a45('0x20')](removeEntity(_0x1c51df,null))['catch'](handleError(_0x1c51df,null));};exports[_0x9a45('0x4f')]=function(_0x51da36,_0x1f2a29,_0x2379fc){return db[_0x9a45('0x28')][_0x9a45('0x50')]({'where':{'id':_0x51da36['params']['id']}})['then'](handleEntityNotFound(_0x1f2a29,null))[_0x9a45('0x20')](function(_0x153b83){var _0x4046c6;var _0x2bffe9={},_0x41fa69={};_0x41fa69[_0x9a45('0x30')]=_[_0x9a45('0x2e')](db['VoiceMailMessage']['rawAttributes']);_0x41fa69[_0x9a45('0x31')]=_[_0x9a45('0x2e')](_0x51da36[_0x9a45('0x31')]);_0x41fa69[_0x9a45('0x39')]=_[_0x9a45('0x2f')](_0x41fa69[_0x9a45('0x30')],_0x41fa69[_0x9a45('0x31')]);_0x2bffe9['attributes']=_[_0x9a45('0x2f')](_0x41fa69[_0x9a45('0x30')],qs[_0x9a45('0x43')](_0x51da36[_0x9a45('0x31')]['fields']));_0x2bffe9[_0x9a45('0x32')]=_0x2bffe9[_0x9a45('0x32')][_0x9a45('0x33')]?_0x2bffe9['attributes']:_0x41fa69['model'];if(!_0x51da36['query'][_0x9a45('0x34')](_0x9a45('0x35'))){_0x2bffe9[_0x9a45('0x36')]=qs[_0x9a45('0x36')](_0x51da36[_0x9a45('0x31')][_0x9a45('0x36')]);_0x2bffe9[_0x9a45('0x1b')]=qs[_0x9a45('0x1b')](_0x51da36['query'][_0x9a45('0x1b')]);}_0x2bffe9[_0x9a45('0x37')]=qs[_0x9a45('0x38')](_0x51da36['query'][_0x9a45('0x38')]);_0x2bffe9['where']=qs[_0x9a45('0x39')](_['pick'](_0x51da36[_0x9a45('0x31')],_0x41fa69['filters']));if(_0x51da36['query'][_0x9a45('0x3a')]){_0x2bffe9[_0x9a45('0x3b')]=_[_0x9a45('0x3c')](_0x2bffe9[_0x9a45('0x3b')],{'$or':_[_0x9a45('0x27')](_0x2bffe9[_0x9a45('0x32')],function(_0x6d9fb1){var _0x3180cc={};_0x3180cc[_0x6d9fb1]={'$like':'%'+_0x51da36['query']['filter']+'%'};return _0x3180cc;})});}_0x2bffe9[_0x9a45('0x3b')]=_[_0x9a45('0x3c')](_0x2bffe9[_0x9a45('0x3b')],{'mailboxuser':_0x153b83[_0x9a45('0x51')]});_0x2bffe9=_[_0x9a45('0x3c')]({},_0x2bffe9,_0x51da36[_0x9a45('0x3e')]);return db['VoiceMailMessage'][_0x9a45('0x52')](_0x2bffe9)[_0x9a45('0x20')](respondWithFilteredResult(_0x1f2a29,_0x2bffe9));})[_0x9a45('0x41')](handleError(_0x1f2a29,null));}; \ No newline at end of file +var _0x423a=['includeAll','include','catch','params','rawAttributes','keys','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','hasOwnProperty','nolimit','mailbox','findAndCountAll','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','update','then','get','Voicemails','destroy','end','error','stack','name','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail'];(function(_0x5731d0,_0xf174fa){var _0xb9de31=function(_0x5a4273){while(--_0x5a4273){_0x5731d0['push'](_0x5731d0['shift']());}};_0xb9de31(++_0xf174fa);}(_0x423a,0xb4));var _0xa423=function(_0x27f7c8,_0x2310a4){_0x27f7c8=_0x27f7c8-0x0;var _0x3bdb6c=_0x423a[_0x27f7c8];return _0x3bdb6c;};'use strict';var pdf=require(_0xa423('0x0'));var emlformat=require(_0xa423('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa423('0x2'));var rp=require(_0xa423('0x3'));var moment=require(_0xa423('0x4'));var BPromise=require(_0xa423('0x5'));var Mustache=require(_0xa423('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa423('0x7'));var csv=require(_0xa423('0x8'));var ejs=require(_0xa423('0x9'));var fs=require('fs');var _=require(_0xa423('0xa'));var squel=require(_0xa423('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa423('0xc'));var Papa=require(_0xa423('0xd'));var Redis=require(_0xa423('0xe'));var authService=require(_0xa423('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa423('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa423('0x11'))(_0xa423('0x12'));var utils=require(_0xa423('0x13'));var config=require(_0xa423('0x14'));var db=require(_0xa423('0x15'))['db'];function respondWithStatusCode(_0x39ce0c,_0x567599){_0x567599=_0x567599||0xcc;return function(_0x3011d3){if(_0x3011d3){return _0x39ce0c[_0xa423('0x16')](_0x567599);}return _0x39ce0c[_0xa423('0x17')](_0x567599)['end']();};}function respondWithResult(_0x144f2f,_0x160758){_0x160758=_0x160758||0xc8;return function(_0x372f3b){if(_0x372f3b){return _0x144f2f[_0xa423('0x17')](_0x160758)['json'](_0x372f3b);}};}function respondWithFilteredResult(_0x2149b1,_0x4c5beb){return function(_0x1d317d){if(_0x1d317d){var _0x2a887b=_0x1d317d[_0xa423('0x18')],_0xcb08e4=_0x4c5beb[_0xa423('0x19')],_0x3c84f3=_0x4c5beb[_0xa423('0x19')]+_0x4c5beb[_0xa423('0x1a')],_0x5d5021;if(_0x3c84f3>=_0x2a887b){_0x3c84f3=_0x2a887b;_0x5d5021=0xc8;}else{_0x5d5021=0xce;}_0x2149b1[_0xa423('0x17')](_0x5d5021);return _0x2149b1[_0xa423('0x1b')](_0xa423('0x1c'),_0xcb08e4+'-'+_0x3c84f3+'/'+_0x2a887b)[_0xa423('0x1d')](_0x1d317d);}return null;};}function patchUpdates(_0x886dc1){return function(_0x3f9f70){try{jsonpatch['apply'](_0x3f9f70,_0x886dc1,!![]);}catch(_0x48ab61){return BPromise[_0xa423('0x1e')](_0x48ab61);}return _0x3f9f70['save']();};}function saveUpdates(_0x2882c0,_0x36d2b5){return function(_0x3a90ec){if(_0x3a90ec){return _0x3a90ec[_0xa423('0x1f')](_0x2882c0)[_0xa423('0x20')](function(_0x133487){return _0x133487;});}return null;};}function removeEntity(_0xff9317,_0x1d81a4){return function(_0x34746e){if(_0x34746e){return _0x34746e['destroy']()['then'](function(){var _0x27f5a8=_0x34746e[_0xa423('0x21')]({'plain':!![]});var _0x524289=_0xa423('0x22');return db['UserProfileResource'][_0xa423('0x23')]({'where':{'type':_0x524289,'resourceId':_0x27f5a8['id']}})[_0xa423('0x20')](function(){return _0x34746e;});})['then'](function(){_0xff9317[_0xa423('0x17')](0xcc)[_0xa423('0x24')]();});}};}function handleEntityNotFound(_0x2e5104,_0x517a7a){return function(_0x133e94){if(!_0x133e94){_0x2e5104[_0xa423('0x16')](0x194);}return _0x133e94;};}function handleError(_0x31d867,_0x2a99d3){_0x2a99d3=_0x2a99d3||0x1f4;return function(_0x3d35c4){logger[_0xa423('0x25')](_0x3d35c4[_0xa423('0x26')]);if(_0x3d35c4[_0xa423('0x27')]){delete _0x3d35c4[_0xa423('0x27')];}_0x31d867[_0xa423('0x17')](_0x2a99d3)['send'](_0x3d35c4);};}exports['index']=function(_0xa4de69,_0x18003d){var _0x33e78a={},_0x29f226={},_0x58323c={'count':0x0,'rows':[]};var _0x337613=_[_0xa423('0x28')](db['VoiceMail']['rawAttributes'],function(_0x262217){return{'name':_0x262217[_0xa423('0x29')],'type':_0x262217[_0xa423('0x2a')][_0xa423('0x2b')]};});_0x29f226[_0xa423('0x2c')]=_['map'](_0x337613,_0xa423('0x27'));_0x29f226['query']=_['keys'](_0xa4de69[_0xa423('0x2d')]);_0x29f226[_0xa423('0x2e')]=_[_0xa423('0x2f')](_0x29f226[_0xa423('0x2c')],_0x29f226[_0xa423('0x2d')]);_0x33e78a[_0xa423('0x30')]=_[_0xa423('0x2f')](_0x29f226[_0xa423('0x2c')],qs['fields'](_0xa4de69[_0xa423('0x2d')][_0xa423('0x31')]));_0x33e78a[_0xa423('0x30')]=_0x33e78a[_0xa423('0x30')][_0xa423('0x32')]?_0x33e78a[_0xa423('0x30')]:_0x29f226[_0xa423('0x2c')];if(!_0xa4de69[_0xa423('0x2d')]['hasOwnProperty']('nolimit')){_0x33e78a[_0xa423('0x1a')]=qs[_0xa423('0x1a')](_0xa4de69[_0xa423('0x2d')]['limit']);_0x33e78a[_0xa423('0x19')]=qs[_0xa423('0x19')](_0xa4de69['query'][_0xa423('0x19')]);}_0x33e78a[_0xa423('0x33')]=qs[_0xa423('0x34')](_0xa4de69[_0xa423('0x2d')][_0xa423('0x34')]);_0x33e78a[_0xa423('0x35')]=qs[_0xa423('0x2e')](_[_0xa423('0x36')](_0xa4de69[_0xa423('0x2d')],_0x29f226[_0xa423('0x2e')]),_0x337613);if(_0xa4de69[_0xa423('0x2d')][_0xa423('0x37')]){_0x33e78a['where']=_[_0xa423('0x38')](_0x33e78a[_0xa423('0x35')],{'$or':_['map'](_0x337613,function(_0xefc586){if(_0xefc586[_0xa423('0x2a')]!==_0xa423('0x39')){var _0x51c799={};_0x51c799[_0xefc586[_0xa423('0x27')]]={'$like':'%'+_0xa4de69[_0xa423('0x2d')][_0xa423('0x37')]+'%'};return _0x51c799;}})});}_0x33e78a=_['merge']({},_0x33e78a,_0xa4de69[_0xa423('0x3a')]);var _0xba57c8={'where':_0x33e78a['where']};return db[_0xa423('0x3b')]['count'](_0xba57c8)['then'](function(_0x5917d3){_0x58323c[_0xa423('0x18')]=_0x5917d3;if(_0xa4de69[_0xa423('0x2d')][_0xa423('0x3c')]){_0x33e78a[_0xa423('0x3d')]=[{'all':!![]}];}return db[_0xa423('0x3b')]['findAll'](_0x33e78a);})[_0xa423('0x20')](function(_0x4d4969){_0x58323c['rows']=_0x4d4969;return _0x58323c;})[_0xa423('0x20')](respondWithFilteredResult(_0x18003d,_0x33e78a))[_0xa423('0x3e')](handleError(_0x18003d,null));};exports['show']=function(_0x249090,_0x1c9f96){var _0x5add3f={'raw':!![],'where':{'id':_0x249090[_0xa423('0x3f')]['id']}},_0x39afcb={};_0x39afcb[_0xa423('0x2c')]=_['keys'](db['VoiceMail'][_0xa423('0x40')]);_0x39afcb['query']=_[_0xa423('0x41')](_0x249090[_0xa423('0x2d')]);_0x39afcb[_0xa423('0x2e')]=_['intersection'](_0x39afcb[_0xa423('0x2c')],_0x39afcb['query']);_0x5add3f[_0xa423('0x30')]=_[_0xa423('0x2f')](_0x39afcb[_0xa423('0x2c')],qs[_0xa423('0x31')](_0x249090[_0xa423('0x2d')][_0xa423('0x31')]));_0x5add3f[_0xa423('0x30')]=_0x5add3f[_0xa423('0x30')]['length']?_0x5add3f['attributes']:_0x39afcb[_0xa423('0x2c')];if(_0x249090[_0xa423('0x2d')][_0xa423('0x3c')]){_0x5add3f[_0xa423('0x3d')]=[{'all':!![]}];}_0x5add3f=_[_0xa423('0x38')]({},_0x5add3f,_0x249090[_0xa423('0x3a')]);return db[_0xa423('0x3b')][_0xa423('0x42')](_0x5add3f)[_0xa423('0x20')](handleEntityNotFound(_0x1c9f96,null))[_0xa423('0x20')](respondWithResult(_0x1c9f96,null))[_0xa423('0x3e')](handleError(_0x1c9f96,null));};exports['create']=function(_0x2cf13c,_0x3dd7a7){return db[_0xa423('0x3b')]['create'](_0x2cf13c[_0xa423('0x43')],{})[_0xa423('0x20')](function(_0x2af369){var _0x1667c1=_0x2cf13c['user'][_0xa423('0x21')]({'plain':!![]});if(!_0x1667c1)throw new Error(_0xa423('0x44'));if(_0x1667c1[_0xa423('0x45')]===_0xa423('0x46')){var _0x9d44ba=_0x2af369[_0xa423('0x21')]({'plain':!![]});var _0x4d28a7=_0xa423('0x22');return db[_0xa423('0x47')][_0xa423('0x42')]({'where':{'name':_0x4d28a7,'userProfileId':_0x1667c1['userProfileId']},'raw':!![]})[_0xa423('0x20')](function(_0x5a726c){if(_0x5a726c&&_0x5a726c['autoAssociation']===0x0){return db[_0xa423('0x48')][_0xa423('0x49')]({'name':_0x9d44ba[_0xa423('0x27')],'resourceId':_0x9d44ba['id'],'type':_0x5a726c['name'],'sectionId':_0x5a726c['id']},{})[_0xa423('0x20')](function(){return _0x2af369;});}else{return _0x2af369;}})['catch'](function(_0x22bb27){logger[_0xa423('0x25')](_0xa423('0x4a'),_0x22bb27);throw _0x22bb27;});}return _0x2af369;})[_0xa423('0x20')](respondWithResult(_0x3dd7a7,0xc9))[_0xa423('0x3e')](handleError(_0x3dd7a7,null));};exports[_0xa423('0x1f')]=function(_0x39e80b,_0x3c94b3){if(_0x39e80b[_0xa423('0x43')]['id']){delete _0x39e80b[_0xa423('0x43')]['id'];}return db['VoiceMail'][_0xa423('0x42')]({'where':{'id':_0x39e80b[_0xa423('0x3f')]['id']}})[_0xa423('0x20')](handleEntityNotFound(_0x3c94b3,null))[_0xa423('0x20')](saveUpdates(_0x39e80b[_0xa423('0x43')],null))[_0xa423('0x20')](respondWithResult(_0x3c94b3,null))[_0xa423('0x3e')](handleError(_0x3c94b3,null));};exports[_0xa423('0x23')]=function(_0x4294f1,_0x5d845f){return db[_0xa423('0x3b')][_0xa423('0x42')]({'where':{'id':_0x4294f1['params']['id']}})['then'](handleEntityNotFound(_0x5d845f,null))[_0xa423('0x20')](removeEntity(_0x5d845f,null))[_0xa423('0x3e')](handleError(_0x5d845f,null));};exports['getMessages']=function(_0x34aaf7,_0x5ad58d,_0x4f49d6){return db['VoiceMail'][_0xa423('0x4b')]({'where':{'id':_0x34aaf7['params']['id']}})['then'](handleEntityNotFound(_0x5ad58d,null))[_0xa423('0x20')](function(_0x36e516){var _0x41b698;var _0x113f0b={},_0x4ee744={};_0x4ee744[_0xa423('0x2c')]=_[_0xa423('0x41')](db['VoiceMailMessage']['rawAttributes']);_0x4ee744[_0xa423('0x2d')]=_[_0xa423('0x41')](_0x34aaf7[_0xa423('0x2d')]);_0x4ee744[_0xa423('0x2e')]=_[_0xa423('0x2f')](_0x4ee744[_0xa423('0x2c')],_0x4ee744['query']);_0x113f0b[_0xa423('0x30')]=_[_0xa423('0x2f')](_0x4ee744['model'],qs[_0xa423('0x31')](_0x34aaf7[_0xa423('0x2d')][_0xa423('0x31')]));_0x113f0b[_0xa423('0x30')]=_0x113f0b[_0xa423('0x30')][_0xa423('0x32')]?_0x113f0b['attributes']:_0x4ee744[_0xa423('0x2c')];if(!_0x34aaf7[_0xa423('0x2d')][_0xa423('0x4c')](_0xa423('0x4d'))){_0x113f0b['limit']=qs[_0xa423('0x1a')](_0x34aaf7[_0xa423('0x2d')][_0xa423('0x1a')]);_0x113f0b[_0xa423('0x19')]=qs[_0xa423('0x19')](_0x34aaf7[_0xa423('0x2d')][_0xa423('0x19')]);}_0x113f0b['order']=qs[_0xa423('0x34')](_0x34aaf7[_0xa423('0x2d')][_0xa423('0x34')]);_0x113f0b[_0xa423('0x35')]=qs[_0xa423('0x2e')](_['pick'](_0x34aaf7[_0xa423('0x2d')],_0x4ee744['filters']));if(_0x34aaf7['query'][_0xa423('0x37')]){_0x113f0b[_0xa423('0x35')]=_['merge'](_0x113f0b[_0xa423('0x35')],{'$or':_[_0xa423('0x28')](_0x113f0b[_0xa423('0x30')],function(_0x46088b){var _0x1540d5={};_0x1540d5[_0x46088b]={'$like':'%'+_0x34aaf7['query']['filter']+'%'};return _0x1540d5;})});}_0x113f0b[_0xa423('0x35')]=_[_0xa423('0x38')](_0x113f0b[_0xa423('0x35')],{'mailboxuser':_0x36e516[_0xa423('0x4e')]});_0x113f0b=_[_0xa423('0x38')]({},_0x113f0b,_0x34aaf7['options']);return db['VoiceMailMessage'][_0xa423('0x4f')](_0x113f0b)['then'](respondWithFilteredResult(_0x5ad58d,_0x113f0b));})[_0xa423('0x3e')](handleError(_0x5ad58d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ec13d94..b68262c 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 _0xdecb=['mailbox','context','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x3a5993,_0x5b405c){var _0x3ca50c=function(_0x5ad9f8){while(--_0x5ad9f8){_0x3a5993['push'](_0x3a5993['shift']());}};_0x3ca50c(++_0x5b405c);}(_0xdecb,0xe2));var _0xbdec=function(_0x142329,_0x2a3d2c){_0x142329=_0x142329-0x0;var _0x5aa41e=_0xdecb[_0x142329];return _0x5aa41e;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var logger=require(_0xbdec('0x1'))(_0xbdec('0x2'));var moment=require('moment');var BPromise=require(_0xbdec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdec('0x4'));var rimraf=require(_0xbdec('0x5'));var config=require(_0xbdec('0x6'));var attributes=require(_0xbdec('0x7'));module[_0xbdec('0x8')]=function(_0x26fef3,_0x13d9f8){return _0x26fef3['define'](_0xbdec('0x9'),attributes,{'tableName':_0xbdec('0xa'),'paranoid':![],'indexes':[{'name':_0xbdec('0xb'),'fields':[_0xbdec('0xc'),_0xbdec('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cd9=['mailbox','context','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceMail','mailbox_context'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x1cd9,0x1b4));var _0x91cd=function(_0x498e3e,_0x5cf823){_0x498e3e=_0x498e3e-0x0;var _0x247afb=_0x1cd9[_0x498e3e];return _0x247afb;};'use strict';var _=require(_0x91cd('0x0'));var util=require(_0x91cd('0x1'));var logger=require(_0x91cd('0x2'))('api');var moment=require(_0x91cd('0x3'));var BPromise=require(_0x91cd('0x4'));var rp=require(_0x91cd('0x5'));var fs=require('fs');var path=require(_0x91cd('0x6'));var rimraf=require(_0x91cd('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x91cd('0x8')]=function(_0x5cc40e,_0x289ae9){return _0x5cc40e[_0x91cd('0x9')](_0x91cd('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x91cd('0xb'),'fields':[_0x91cd('0xc'),_0x91cd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b3accc6..8195310 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 _0x6031=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x6031,0x197));var _0x1603=function(_0x16b8b4,_0x4a7aad){_0x16b8b4=_0x16b8b4-0x0;var _0x33f004=_0x6031[_0x16b8b4];return _0x33f004;};'use strict';var _=require(_0x1603('0x0'));var util=require(_0x1603('0x1'));var moment=require(_0x1603('0x2'));var BPromise=require(_0x1603('0x3'));var rs=require(_0x1603('0x4'));var fs=require('fs');var Redis=require(_0x1603('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1603('0x6'));var logger=require(_0x1603('0x7'))(_0x1603('0x8'));var config=require(_0x1603('0x9'));var jayson=require(_0x1603('0xa'));var client=jayson[_0x1603('0xb')][_0x1603('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x63c143,_0x3a024d,_0x196d45){return new BPromise(function(_0x1c79ce,_0x12ef08){return client['request'](_0x63c143,_0x196d45)[_0x1603('0xd')](function(_0x3c8a19){logger[_0x1603('0xe')]('VoiceMail,\x20%s,\x20%s',_0x3a024d,_0x1603('0xf'));logger[_0x1603('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3a024d,_0x1603('0xf'),JSON[_0x1603('0x11')](_0x3c8a19));if(_0x3c8a19['error']){if(_0x3c8a19[_0x1603('0x12')]['code']===0x1f4){logger['error'](_0x1603('0x13'),_0x3a024d,_0x3c8a19[_0x1603('0x12')][_0x1603('0x14')]);return _0x12ef08(_0x3c8a19[_0x1603('0x12')][_0x1603('0x14')]);}logger[_0x1603('0x12')](_0x1603('0x13'),_0x3a024d,_0x3c8a19[_0x1603('0x12')][_0x1603('0x14')]);return _0x1c79ce(_0x3c8a19[_0x1603('0x12')]['message']);}else{logger[_0x1603('0xe')]('VoiceMail,\x20%s,\x20%s',_0x3a024d,_0x1603('0xf'));_0x1c79ce(_0x3c8a19[_0x1603('0x15')][_0x1603('0x14')]);}})[_0x1603('0x16')](function(_0x35bcb5){logger[_0x1603('0x12')](_0x1603('0x13'),_0x3a024d,_0x35bcb5);_0x12ef08(_0x35bcb5);});});} \ No newline at end of file +var _0x9fad=['../../config/environment','jayson/promise','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1b7721,_0x4abafe){var _0x123bc1=function(_0x190c97){while(--_0x190c97){_0x1b7721['push'](_0x1b7721['shift']());}};_0x123bc1(++_0x4abafe);}(_0x9fad,0x143));var _0xd9fa=function(_0x5f271d,_0x5ab21f){_0x5f271d=_0x5f271d-0x0;var _0x18f5f9=_0x9fad[_0x5f271d];return _0x18f5f9;};'use strict';var _=require(_0xd9fa('0x0'));var util=require(_0xd9fa('0x1'));var moment=require(_0xd9fa('0x2'));var BPromise=require(_0xd9fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9fa('0x5'));var logger=require(_0xd9fa('0x6'))('rpc');var config=require(_0xd9fa('0x7'));var jayson=require(_0xd9fa('0x8'));var client=jayson['client'][_0xd9fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c7f9b,_0x2e3ea1,_0x200cda){return new BPromise(function(_0x5c5a3b,_0x1b98f6){return client['request'](_0x2c7f9b,_0x200cda)[_0xd9fa('0xa')](function(_0x715fc1){logger['info'](_0xd9fa('0xb'),_0x2e3ea1,_0xd9fa('0xc'));logger[_0xd9fa('0xd')](_0xd9fa('0xe'),_0x2e3ea1,'request\x20sent',JSON[_0xd9fa('0xf')](_0x715fc1));if(_0x715fc1[_0xd9fa('0x10')]){if(_0x715fc1[_0xd9fa('0x10')][_0xd9fa('0x11')]===0x1f4){logger['error'](_0xd9fa('0xb'),_0x2e3ea1,_0x715fc1['error'][_0xd9fa('0x12')]);return _0x1b98f6(_0x715fc1[_0xd9fa('0x10')]['message']);}logger[_0xd9fa('0x10')](_0xd9fa('0xb'),_0x2e3ea1,_0x715fc1[_0xd9fa('0x10')][_0xd9fa('0x12')]);return _0x5c5a3b(_0x715fc1[_0xd9fa('0x10')][_0xd9fa('0x12')]);}else{logger[_0xd9fa('0x13')](_0xd9fa('0xb'),_0x2e3ea1,_0xd9fa('0xc'));_0x5c5a3b(_0x715fc1[_0xd9fa('0x14')][_0xd9fa('0x12')]);}})[_0xd9fa('0x15')](function(_0x3a0d33){logger[_0xd9fa('0x10')]('VoiceMail,\x20%s,\x20%s',_0x2e3ea1,_0x3a0d33);_0x1b98f6(_0x3a0d33);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index b8e8d9e..e1351e5 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 _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x595f49,_0x21bb13){var _0x3da2bb=function(_0x34009b){while(--_0x34009b){_0x595f49['push'](_0x595f49['shift']());}};_0x3da2bb(++_0x21bb13);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1af093,_0x427db0){_0x1af093=_0x1af093-0x0;var _0x39b91d=_0x3f8a[_0x1af093];return _0x39b91d;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file +var _0x9c5a=['get','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x1681ca,_0xfd3029){var _0x433f6c=function(_0x3fcc5d){while(--_0x3fcc5d){_0x1681ca['push'](_0x1681ca['shift']());}};_0x433f6c(++_0xfd3029);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x52293c,_0x7d71cd){_0x52293c=_0x52293c-0x0;var _0x4396e0=_0x9c5a[_0x52293c];return _0x4396e0;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0x9')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0x10')]);router[_0xa9c5('0x11')](_0xa9c5('0xa'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x12')]);module[_0xa9c5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index fce8144..61e81d9 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 _0x8bd6=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','sequelize','exports'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x8bd6,0x146));var _0x68bd=function(_0x56f346,_0x241b2b){_0x56f346=_0x56f346-0x0;var _0x4caa2f=_0x8bd6[_0x56f346];return _0x4caa2f;};'use strict';var Sequelize=require(_0x68bd('0x0'));module[_0x68bd('0x1')]={'name':{'type':Sequelize[_0x68bd('0x2')],'get':function(_0x113a03){return this[_0x68bd('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x68bd('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x68bd('0x6')](_0x68bd('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x9c63=['exports','getDataValue','INTEGER','STRING','BLOB','long','sequelize'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9c63,0x16b));var _0x39c6=function(_0x3f8c5d,_0x3e0286){_0x3f8c5d=_0x3f8c5d-0x0;var _0x4f45b4=_0x9c63[_0x3f8c5d];return _0x4f45b4;};'use strict';var Sequelize=require(_0x39c6('0x0'));module[_0x39c6('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2c039a){return this[_0x39c6('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x39c6('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x39c6('0x5')](_0x39c6('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x39c6('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index bc94a6a..c95a630 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 _0x2504=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VoiceMailMessage','count','includeAll','include','findAll','catch','show','find','create','body','params','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','eml-format'];(function(_0x2bbb55,_0xf4e783){var _0x4fc50b=function(_0x21ae27){while(--_0x21ae27){_0x2bbb55['push'](_0x2bbb55['shift']());}};_0x4fc50b(++_0xf4e783);}(_0x2504,0xee));var _0x4250=function(_0x301a5b,_0x58d858){_0x301a5b=_0x301a5b-0x0;var _0x31f03e=_0x2504[_0x301a5b];return _0x31f03e;};'use strict';var pdf=require(_0x4250('0x0'));var emlformat=require(_0x4250('0x1'));var rimraf=require(_0x4250('0x2'));var zipdir=require(_0x4250('0x3'));var jsonpatch=require(_0x4250('0x4'));var rp=require(_0x4250('0x5'));var moment=require(_0x4250('0x6'));var BPromise=require(_0x4250('0x7'));var Mustache=require(_0x4250('0x8'));var util=require(_0x4250('0x9'));var path=require(_0x4250('0xa'));var sox=require(_0x4250('0xb'));var csv=require('to-csv');var ejs=require(_0x4250('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0x10'));var querystring=require(_0x4250('0x11'));var Papa=require('papaparse');var Redis=require(_0x4250('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x13'));var as=require(_0x4250('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x208e8c,_0x3c1e7e){_0x3c1e7e=_0x3c1e7e||0xcc;return function(_0x2a496b){if(_0x2a496b){return _0x208e8c['sendStatus'](_0x3c1e7e);}return _0x208e8c[_0x4250('0x18')](_0x3c1e7e)[_0x4250('0x19')]();};}function respondWithResult(_0x25b79b,_0x2c8a75){_0x2c8a75=_0x2c8a75||0xc8;return function(_0xfa4d8a){if(_0xfa4d8a){return _0x25b79b[_0x4250('0x18')](_0x2c8a75)['json'](_0xfa4d8a);}};}function respondWithFilteredResult(_0x9aa450,_0x46ba15){return function(_0x1b0c66){if(_0x1b0c66){var _0x3cff02=_0x1b0c66['count'],_0x2979cd=_0x46ba15[_0x4250('0x1a')],_0x9907b4=_0x46ba15[_0x4250('0x1a')]+_0x46ba15[_0x4250('0x1b')],_0x3d9a6d;if(_0x9907b4>=_0x3cff02){_0x9907b4=_0x3cff02;_0x3d9a6d=0xc8;}else{_0x3d9a6d=0xce;}_0x9aa450[_0x4250('0x18')](_0x3d9a6d);return _0x9aa450[_0x4250('0x1c')](_0x4250('0x1d'),_0x2979cd+'-'+_0x9907b4+'/'+_0x3cff02)[_0x4250('0x1e')](_0x1b0c66);}return null;};}function patchUpdates(_0x508bc3){return function(_0x31d0fc){try{jsonpatch['apply'](_0x31d0fc,_0x508bc3,!![]);}catch(_0x5aa26e){return BPromise[_0x4250('0x1f')](_0x5aa26e);}return _0x31d0fc[_0x4250('0x20')]();};}function saveUpdates(_0x5b7e7f,_0x42c331){return function(_0x242cf1){if(_0x242cf1){return _0x242cf1[_0x4250('0x21')](_0x5b7e7f)[_0x4250('0x22')](function(_0x2985f8){return _0x2985f8;});}return null;};}function removeEntity(_0x309745,_0x3818c0){return function(_0x728862){if(_0x728862){return _0x728862[_0x4250('0x23')]()['then'](function(){_0x309745[_0x4250('0x18')](0xcc)[_0x4250('0x19')]();});}};}function handleEntityNotFound(_0x1feb98,_0x523053){return function(_0x5d1a74){if(!_0x5d1a74){_0x1feb98[_0x4250('0x24')](0x194);}return _0x5d1a74;};}function handleError(_0x91c0d6,_0x1c1294){_0x1c1294=_0x1c1294||0x1f4;return function(_0x3f8750){logger[_0x4250('0x25')](_0x3f8750['stack']);if(_0x3f8750[_0x4250('0x26')]){delete _0x3f8750[_0x4250('0x26')];}_0x91c0d6[_0x4250('0x18')](_0x1c1294)['send'](_0x3f8750);};}exports['index']=function(_0x2dcd72,_0x5d0fa2){var _0x3e8b4d={},_0x1c4fa5={},_0x105206={'count':0x0,'rows':[]};var _0x2cdfdf=_[_0x4250('0x27')](db['VoiceMailMessage'][_0x4250('0x28')],function(_0x11ca22){return{'name':_0x11ca22['fieldName'],'type':_0x11ca22[_0x4250('0x29')]['key']};});_0x1c4fa5[_0x4250('0x2a')]=_['differenceBy'](_['map'](_0x2cdfdf,_0x4250('0x26')),['name']);_0x1c4fa5[_0x4250('0x2b')]=_[_0x4250('0x2c')](_0x2dcd72['query']);_0x1c4fa5[_0x4250('0x2d')]=_[_0x4250('0x2e')](_0x1c4fa5['model'],_0x1c4fa5[_0x4250('0x2b')]);_0x3e8b4d[_0x4250('0x2f')]=_['intersection'](_0x1c4fa5[_0x4250('0x2a')],qs[_0x4250('0x30')](_0x2dcd72[_0x4250('0x2b')][_0x4250('0x30')]));_0x3e8b4d[_0x4250('0x2f')]=_0x3e8b4d[_0x4250('0x2f')][_0x4250('0x31')]?_0x3e8b4d[_0x4250('0x2f')]:_0x1c4fa5[_0x4250('0x2a')];if(!_0x2dcd72[_0x4250('0x2b')][_0x4250('0x32')](_0x4250('0x33'))){_0x3e8b4d[_0x4250('0x1b')]=qs['limit'](_0x2dcd72[_0x4250('0x2b')]['limit']);_0x3e8b4d[_0x4250('0x1a')]=qs[_0x4250('0x1a')](_0x2dcd72['query'][_0x4250('0x1a')]);}_0x3e8b4d[_0x4250('0x34')]=qs[_0x4250('0x35')](_0x2dcd72[_0x4250('0x2b')]['sort']);_0x3e8b4d['where']=qs['filters'](_[_0x4250('0x36')](_0x2dcd72[_0x4250('0x2b')],_0x1c4fa5['filters']),_0x2cdfdf);if(_0x2dcd72[_0x4250('0x2b')][_0x4250('0x37')]){_0x3e8b4d[_0x4250('0x38')]=_[_0x4250('0x39')](_0x3e8b4d[_0x4250('0x38')],{'$or':_['map'](_0x2cdfdf,function(_0x16f3f3){if(_0x16f3f3['type']!=='VIRTUAL'){var _0xb15c48={};_0xb15c48[_0x16f3f3['name']]={'$like':'%'+_0x2dcd72[_0x4250('0x2b')][_0x4250('0x37')]+'%'};return _0xb15c48;}})});}_0x3e8b4d=_[_0x4250('0x39')]({},_0x3e8b4d,_0x2dcd72['options']);var _0x344aa9={'where':_0x3e8b4d[_0x4250('0x38')]};return db[_0x4250('0x3a')][_0x4250('0x3b')](_0x344aa9)[_0x4250('0x22')](function(_0x4c98f0){_0x105206[_0x4250('0x3b')]=_0x4c98f0;if(_0x2dcd72[_0x4250('0x2b')][_0x4250('0x3c')]){_0x3e8b4d[_0x4250('0x3d')]=[{'all':!![]}];}return db[_0x4250('0x3a')][_0x4250('0x3e')](_0x3e8b4d);})['then'](function(_0x3a340a){_0x105206['rows']=_0x3a340a;return _0x105206;})[_0x4250('0x22')](respondWithFilteredResult(_0x5d0fa2,_0x3e8b4d))[_0x4250('0x3f')](handleError(_0x5d0fa2,null));};exports[_0x4250('0x40')]=function(_0x2a10b9,_0xbe81c0){var _0x363a13={'raw':!![],'where':{'id':_0x2a10b9['params']['id']}},_0x4f1b8c={};_0x4f1b8c['model']=_[_0x4250('0x2c')](db[_0x4250('0x3a')][_0x4250('0x28')]);_0x4f1b8c['query']=_[_0x4250('0x2c')](_0x2a10b9[_0x4250('0x2b')]);_0x4f1b8c[_0x4250('0x2d')]=_['intersection'](_0x4f1b8c[_0x4250('0x2a')],_0x4f1b8c[_0x4250('0x2b')]);_0x363a13[_0x4250('0x2f')]=_[_0x4250('0x2e')](_0x4f1b8c['model'],qs['fields'](_0x2a10b9[_0x4250('0x2b')][_0x4250('0x30')]));_0x363a13[_0x4250('0x2f')]=_0x363a13[_0x4250('0x2f')][_0x4250('0x31')]?_0x363a13['attributes']:_0x4f1b8c[_0x4250('0x2a')];if(_0x2a10b9['query'][_0x4250('0x3c')]){_0x363a13[_0x4250('0x3d')]=[{'all':!![]}];}_0x363a13=_[_0x4250('0x39')]({},_0x363a13,_0x2a10b9['options']);return db[_0x4250('0x3a')][_0x4250('0x41')](_0x363a13)[_0x4250('0x22')](handleEntityNotFound(_0xbe81c0,null))['then'](respondWithResult(_0xbe81c0,null))['catch'](handleError(_0xbe81c0,null));};exports['create']=function(_0x222070,_0x2edff0){return db[_0x4250('0x3a')][_0x4250('0x42')](_0x222070[_0x4250('0x43')],{})[_0x4250('0x22')](respondWithResult(_0x2edff0,0xc9))['catch'](handleError(_0x2edff0,null));};exports[_0x4250('0x21')]=function(_0x3bfe2e,_0x462b99){if(_0x3bfe2e['body']['id']){delete _0x3bfe2e[_0x4250('0x43')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x3bfe2e[_0x4250('0x44')]['id']}})[_0x4250('0x22')](handleEntityNotFound(_0x462b99,null))[_0x4250('0x22')](saveUpdates(_0x3bfe2e[_0x4250('0x43')],null))[_0x4250('0x22')](respondWithResult(_0x462b99,null))[_0x4250('0x3f')](handleError(_0x462b99,null));};exports['destroy']=function(_0x1d6fe7,_0x566664){return db[_0x4250('0x3a')][_0x4250('0x41')]({'where':{'id':_0x1d6fe7[_0x4250('0x44')]['id']}})['then'](handleEntityNotFound(_0x566664,null))[_0x4250('0x22')](removeEntity(_0x566664,null))[_0x4250('0x3f')](handleError(_0x566664,null));};exports['download']=function(_0x481e95,_0x495a0c,_0xffe341){return db['VoiceMailMessage']['find']({'where':{'id':_0x481e95[_0x4250('0x44')]['id']},'attributes':['id',_0x4250('0x45'),_0x4250('0x46')]})[_0x4250('0x22')](handleEntityNotFound(_0x495a0c,null))[_0x4250('0x22')](function(_0x49324b){if(_0x49324b){if(!_0x49324b[_0x4250('0x45')]){throw new db[(_0x4250('0x47'))][(_0x4250('0x48'))](_0x4250('0x49'));}var _0x5cd88c={'Content-Type':_0x4250('0x4a'),'Content-Disposition':_0x4250('0x4b')};if(_0x49324b['msg_id']){_0x5cd88c[_0x4250('0x4c')]=_0x4250('0x4d')+_0x49324b['msg_id']+_0x4250('0x4e');}_0x495a0c[_0x4250('0x1c')](_0x5cd88c);return _0x495a0c[_0x4250('0x4f')](new Buffer(_0x49324b[_0x4250('0x45')]));}})[_0x4250('0x3f')](handleError(_0x495a0c,null));}; \ No newline at end of file +var _0xad95=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','VoiceMailMessage','findAll','rows','show','params','rawAttributes','includeAll','catch','create','update','body','find','destroy','download','recording','msg_id','Sequelize','ValidationError','attachment','Content-Disposition','.wav\x22','html-pdf','eml-format','rimraf','request-promise','moment','util','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','set','Content-Range','apply','save','then','end','error','stack','name','send','map','fieldName','type','key','model','differenceBy','query','keys','intersection','fields','attributes','length'];(function(_0x585be3,_0x495b13){var _0x132590=function(_0x45e57c){while(--_0x45e57c){_0x585be3['push'](_0x585be3['shift']());}};_0x132590(++_0x495b13);}(_0xad95,0x70));var _0x5ad9=function(_0x2b3981,_0x1ca1aa){_0x2b3981=_0x2b3981-0x0;var _0x4cbfc8=_0xad95[_0x2b3981];return _0x4cbfc8;};'use strict';var pdf=require(_0x5ad9('0x0'));var emlformat=require(_0x5ad9('0x1'));var rimraf=require(_0x5ad9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ad9('0x3'));var moment=require(_0x5ad9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ad9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var db=require(_0x5ad9('0x12'))['db'];function respondWithStatusCode(_0x329ed9,_0x3b2718){_0x3b2718=_0x3b2718||0xcc;return function(_0x262ce4){if(_0x262ce4){return _0x329ed9[_0x5ad9('0x13')](_0x3b2718);}return _0x329ed9['status'](_0x3b2718)['end']();};}function respondWithResult(_0x48253b,_0x431358){_0x431358=_0x431358||0xc8;return function(_0x4519ad){if(_0x4519ad){return _0x48253b['status'](_0x431358)[_0x5ad9('0x14')](_0x4519ad);}};}function respondWithFilteredResult(_0xcf9adc,_0x3f16ef){return function(_0x543743){if(_0x543743){var _0x3da125=_0x543743[_0x5ad9('0x15')],_0x32b0bd=_0x3f16ef[_0x5ad9('0x16')],_0x112d44=_0x3f16ef['offset']+_0x3f16ef[_0x5ad9('0x17')],_0x321c78;if(_0x112d44>=_0x3da125){_0x112d44=_0x3da125;_0x321c78=0xc8;}else{_0x321c78=0xce;}_0xcf9adc['status'](_0x321c78);return _0xcf9adc[_0x5ad9('0x18')](_0x5ad9('0x19'),_0x32b0bd+'-'+_0x112d44+'/'+_0x3da125)[_0x5ad9('0x14')](_0x543743);}return null;};}function patchUpdates(_0xb83249){return function(_0x1c5ab7){try{jsonpatch[_0x5ad9('0x1a')](_0x1c5ab7,_0xb83249,!![]);}catch(_0x110c04){return BPromise['reject'](_0x110c04);}return _0x1c5ab7[_0x5ad9('0x1b')]();};}function saveUpdates(_0x5885b5,_0x49363b){return function(_0x3356e5){if(_0x3356e5){return _0x3356e5['update'](_0x5885b5)[_0x5ad9('0x1c')](function(_0x36a2e9){return _0x36a2e9;});}return null;};}function removeEntity(_0x13e38c,_0xebbe63){return function(_0x1274f7){if(_0x1274f7){return _0x1274f7['destroy']()[_0x5ad9('0x1c')](function(){_0x13e38c['status'](0xcc)[_0x5ad9('0x1d')]();});}};}function handleEntityNotFound(_0x5b816d,_0x570d3c){return function(_0x524249){if(!_0x524249){_0x5b816d[_0x5ad9('0x13')](0x194);}return _0x524249;};}function handleError(_0x3701d8,_0x39a124){_0x39a124=_0x39a124||0x1f4;return function(_0x30b102){logger[_0x5ad9('0x1e')](_0x30b102[_0x5ad9('0x1f')]);if(_0x30b102[_0x5ad9('0x20')]){delete _0x30b102['name'];}_0x3701d8['status'](_0x39a124)[_0x5ad9('0x21')](_0x30b102);};}exports['index']=function(_0x3a2357,_0x584de3){var _0x346f35={},_0x55a0e4={},_0x58a156={'count':0x0,'rows':[]};var _0x243f82=_[_0x5ad9('0x22')](db['VoiceMailMessage']['rawAttributes'],function(_0x3942fa){return{'name':_0x3942fa[_0x5ad9('0x23')],'type':_0x3942fa[_0x5ad9('0x24')][_0x5ad9('0x25')]};});_0x55a0e4[_0x5ad9('0x26')]=_[_0x5ad9('0x27')](_['map'](_0x243f82,_0x5ad9('0x20')),[_0x5ad9('0x20')]);_0x55a0e4[_0x5ad9('0x28')]=_[_0x5ad9('0x29')](_0x3a2357['query']);_0x55a0e4['filters']=_[_0x5ad9('0x2a')](_0x55a0e4[_0x5ad9('0x26')],_0x55a0e4['query']);_0x346f35['attributes']=_['intersection'](_0x55a0e4[_0x5ad9('0x26')],qs[_0x5ad9('0x2b')](_0x3a2357['query'][_0x5ad9('0x2b')]));_0x346f35[_0x5ad9('0x2c')]=_0x346f35[_0x5ad9('0x2c')][_0x5ad9('0x2d')]?_0x346f35['attributes']:_0x55a0e4['model'];if(!_0x3a2357[_0x5ad9('0x28')][_0x5ad9('0x2e')](_0x5ad9('0x2f'))){_0x346f35[_0x5ad9('0x17')]=qs[_0x5ad9('0x17')](_0x3a2357['query'][_0x5ad9('0x17')]);_0x346f35[_0x5ad9('0x16')]=qs[_0x5ad9('0x16')](_0x3a2357[_0x5ad9('0x28')][_0x5ad9('0x16')]);}_0x346f35[_0x5ad9('0x30')]=qs['sort'](_0x3a2357[_0x5ad9('0x28')][_0x5ad9('0x31')]);_0x346f35['where']=qs[_0x5ad9('0x32')](_[_0x5ad9('0x33')](_0x3a2357['query'],_0x55a0e4[_0x5ad9('0x32')]),_0x243f82);if(_0x3a2357[_0x5ad9('0x28')][_0x5ad9('0x34')]){_0x346f35['where']=_[_0x5ad9('0x35')](_0x346f35[_0x5ad9('0x36')],{'$or':_[_0x5ad9('0x22')](_0x243f82,function(_0x234f92){if(_0x234f92['type']!==_0x5ad9('0x37')){var _0xf3301a={};_0xf3301a[_0x234f92[_0x5ad9('0x20')]]={'$like':'%'+_0x3a2357[_0x5ad9('0x28')][_0x5ad9('0x34')]+'%'};return _0xf3301a;}})});}_0x346f35=_[_0x5ad9('0x35')]({},_0x346f35,_0x3a2357[_0x5ad9('0x38')]);var _0x9219c6={'where':_0x346f35[_0x5ad9('0x36')]};return db['VoiceMailMessage'][_0x5ad9('0x15')](_0x9219c6)[_0x5ad9('0x1c')](function(_0x41d733){_0x58a156[_0x5ad9('0x15')]=_0x41d733;if(_0x3a2357[_0x5ad9('0x28')]['includeAll']){_0x346f35[_0x5ad9('0x39')]=[{'all':!![]}];}return db[_0x5ad9('0x3a')][_0x5ad9('0x3b')](_0x346f35);})['then'](function(_0x3d027a){_0x58a156[_0x5ad9('0x3c')]=_0x3d027a;return _0x58a156;})[_0x5ad9('0x1c')](respondWithFilteredResult(_0x584de3,_0x346f35))['catch'](handleError(_0x584de3,null));};exports[_0x5ad9('0x3d')]=function(_0x5cfe5b,_0x4fb3b9){var _0x77689e={'raw':!![],'where':{'id':_0x5cfe5b[_0x5ad9('0x3e')]['id']}},_0x34d201={};_0x34d201[_0x5ad9('0x26')]=_['keys'](db['VoiceMailMessage'][_0x5ad9('0x3f')]);_0x34d201['query']=_[_0x5ad9('0x29')](_0x5cfe5b['query']);_0x34d201[_0x5ad9('0x32')]=_['intersection'](_0x34d201[_0x5ad9('0x26')],_0x34d201[_0x5ad9('0x28')]);_0x77689e[_0x5ad9('0x2c')]=_[_0x5ad9('0x2a')](_0x34d201[_0x5ad9('0x26')],qs[_0x5ad9('0x2b')](_0x5cfe5b[_0x5ad9('0x28')][_0x5ad9('0x2b')]));_0x77689e[_0x5ad9('0x2c')]=_0x77689e['attributes'][_0x5ad9('0x2d')]?_0x77689e[_0x5ad9('0x2c')]:_0x34d201[_0x5ad9('0x26')];if(_0x5cfe5b[_0x5ad9('0x28')][_0x5ad9('0x40')]){_0x77689e['include']=[{'all':!![]}];}_0x77689e=_[_0x5ad9('0x35')]({},_0x77689e,_0x5cfe5b['options']);return db['VoiceMailMessage']['find'](_0x77689e)[_0x5ad9('0x1c')](handleEntityNotFound(_0x4fb3b9,null))[_0x5ad9('0x1c')](respondWithResult(_0x4fb3b9,null))[_0x5ad9('0x41')](handleError(_0x4fb3b9,null));};exports['create']=function(_0x39db4b,_0x21074f){return db[_0x5ad9('0x3a')][_0x5ad9('0x42')](_0x39db4b['body'],{})[_0x5ad9('0x1c')](respondWithResult(_0x21074f,0xc9))[_0x5ad9('0x41')](handleError(_0x21074f,null));};exports[_0x5ad9('0x43')]=function(_0x1920c7,_0x4fdbb6){if(_0x1920c7[_0x5ad9('0x44')]['id']){delete _0x1920c7[_0x5ad9('0x44')]['id'];}return db[_0x5ad9('0x3a')][_0x5ad9('0x45')]({'where':{'id':_0x1920c7[_0x5ad9('0x3e')]['id']}})[_0x5ad9('0x1c')](handleEntityNotFound(_0x4fdbb6,null))[_0x5ad9('0x1c')](saveUpdates(_0x1920c7['body'],null))[_0x5ad9('0x1c')](respondWithResult(_0x4fdbb6,null))['catch'](handleError(_0x4fdbb6,null));};exports[_0x5ad9('0x46')]=function(_0xb2cbc4,_0x9671da){return db[_0x5ad9('0x3a')][_0x5ad9('0x45')]({'where':{'id':_0xb2cbc4[_0x5ad9('0x3e')]['id']}})[_0x5ad9('0x1c')](handleEntityNotFound(_0x9671da,null))[_0x5ad9('0x1c')](removeEntity(_0x9671da,null))[_0x5ad9('0x41')](handleError(_0x9671da,null));};exports[_0x5ad9('0x47')]=function(_0x46e971,_0x2457aa,_0x2e99cb){return db[_0x5ad9('0x3a')][_0x5ad9('0x45')]({'where':{'id':_0x46e971['params']['id']},'attributes':['id',_0x5ad9('0x48'),_0x5ad9('0x49')]})[_0x5ad9('0x1c')](handleEntityNotFound(_0x2457aa,null))[_0x5ad9('0x1c')](function(_0x1c4f6e){if(_0x1c4f6e){if(!_0x1c4f6e[_0x5ad9('0x48')]){throw new db[(_0x5ad9('0x4a'))][(_0x5ad9('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0x2fc61a={'Content-Type':'audio/wav','Content-Disposition':_0x5ad9('0x4c')};if(_0x1c4f6e[_0x5ad9('0x49')]){_0x2fc61a[_0x5ad9('0x4d')]='attachment;\x20filename=\x22'+_0x1c4f6e[_0x5ad9('0x49')]+_0x5ad9('0x4e');}_0x2457aa[_0x5ad9('0x18')](_0x2fc61a);return _0x2457aa['send'](new Buffer(_0x1c4f6e[_0x5ad9('0x48')]));}})['catch'](handleError(_0x2457aa,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c641b4f..1a44774 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 _0xc893=['dir','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x14ec75,_0x56a3d4){var _0x40b9e9=function(_0x4d2f39){while(--_0x4d2f39){_0x14ec75['push'](_0x14ec75['shift']());}};_0x40b9e9(++_0x56a3d4);}(_0xc893,0x194));var _0x3c89=function(_0x4bcc12,_0x5da7ea){_0x4bcc12=_0x4bcc12-0x0;var _0x511c1e=_0xc893[_0x4bcc12];return _0x511c1e;};'use strict';var _=require('lodash');var util=require(_0x3c89('0x0'));var logger=require(_0x3c89('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3c89('0x2'));var rp=require(_0x3c89('0x3'));var fs=require('fs');var path=require(_0x3c89('0x4'));var rimraf=require(_0x3c89('0x5'));var config=require(_0x3c89('0x6'));var attributes=require(_0x3c89('0x7'));module[_0x3c89('0x8')]=function(_0x5f2803,_0x2e156d){return _0x5f2803[_0x3c89('0x9')](_0x3c89('0xa'),attributes,{'tableName':_0x3c89('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x3c89('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6582=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x4df7b3,_0xc1cadb){var _0x3dd819=function(_0xcbf7df){while(--_0xcbf7df){_0x4df7b3['push'](_0x4df7b3['shift']());}};_0x3dd819(++_0xc1cadb);}(_0x6582,0x108));var _0x2658=function(_0x3e72da,_0x7909e3){_0x3e72da=_0x3e72da-0x0;var _0x20a27d=_0x6582[_0x3e72da];return _0x20a27d;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var logger=require(_0x2658('0x2'))(_0x2658('0x3'));var moment=require(_0x2658('0x4'));var BPromise=require('bluebird');var rp=require(_0x2658('0x5'));var fs=require('fs');var path=require(_0x2658('0x6'));var rimraf=require(_0x2658('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x2ef520,_0x1702bd){return _0x2ef520[_0x2658('0x8')](_0x2658('0x9'),attributes,{'tableName':_0x2658('0xa'),'paranoid':![],'indexes':[{'name':_0x2658('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d4dd739..00ea529 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 _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x355e39,_0xc76ae3){var _0x263123=function(_0x4d5aee){while(--_0x4d5aee){_0x355e39['push'](_0x355e39['shift']());}};_0x263123(++_0xc76ae3);}(_0x2032,0xd9));var _0x2203=function(_0x208d50,_0x15cfe0){_0x208d50=_0x208d50-0x0;var _0x229053=_0x2032[_0x208d50];return _0x229053;};'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});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});} \ 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(_0x3a96e2,_0x5ecb0f){var _0x2c1e1f=function(_0x1fc4b3){while(--_0x1fc4b3){_0x3a96e2['push'](_0x3a96e2['shift']());}};_0x2c1e1f(++_0x5ecb0f);}(_0xda2d,0x102));var _0xdda2=function(_0x407bbe,_0x1ca38b){_0x407bbe=_0x407bbe-0x0;var _0x52fb99=_0xda2d[_0x407bbe];return _0x52fb99;};'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 f9fef3e..414a97a 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 _0xe581=['index','/:id','show','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xe581,0xd5));var _0x1e58=function(_0x1c41e6,_0x52fca1){_0x1c41e6=_0x1c41e6-0x0;var _0x10995d=_0xe581[_0x1c41e6];return _0x10995d;};'use strict';var multer=require(_0x1e58('0x0'));var util=require(_0x1e58('0x1'));var path=require(_0x1e58('0x2'));var timeout=require(_0x1e58('0x3'));var express=require(_0x1e58('0x4'));var router=express[_0x1e58('0x5')]();var auth=require(_0x1e58('0x6'));var interaction=require(_0x1e58('0x7'));var config=require(_0x1e58('0x8'));var controller=require(_0x1e58('0x9'));router[_0x1e58('0xa')]('/',auth[_0x1e58('0xb')](),controller[_0x1e58('0xc')]);router[_0x1e58('0xa')](_0x1e58('0xd'),auth[_0x1e58('0xb')](),controller[_0x1e58('0xe')]);router[_0x1e58('0xa')](_0x1e58('0xf'),auth[_0x1e58('0xb')](),controller[_0x1e58('0x10')]);router[_0x1e58('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e58('0x11')](_0x1e58('0xf'),auth[_0x1e58('0xb')](),controller['addSound']);router[_0x1e58('0x12')](_0x1e58('0xd'),auth['isAuthenticated'](),controller[_0x1e58('0x13')]);router[_0x1e58('0x14')](_0x1e58('0xd'),auth[_0x1e58('0xb')](),controller[_0x1e58('0x15')]);router[_0x1e58('0x14')](_0x1e58('0x16'),auth[_0x1e58('0xb')](),controller[_0x1e58('0x17')]);module[_0x1e58('0x18')]=router; \ No newline at end of file +var _0x4ad7=['isAuthenticated','index','/:id/sounds','getSounds','post','addSound','put','/:id','delete','destroy','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x8c31d4,_0x2e106e){var _0x32661f=function(_0xb8b031){while(--_0xb8b031){_0x8c31d4['push'](_0x8c31d4['shift']());}};_0x32661f(++_0x2e106e);}(_0x4ad7,0x110));var _0x74ad=function(_0x3d54ff,_0xee87b){_0x3d54ff=_0x3d54ff-0x0;var _0x256ea9=_0x4ad7[_0x3d54ff];return _0x256ea9;};'use strict';var multer=require(_0x74ad('0x0'));var util=require(_0x74ad('0x1'));var path=require('path');var timeout=require(_0x74ad('0x2'));var express=require(_0x74ad('0x3'));var router=express[_0x74ad('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x74ad('0x5'));var config=require(_0x74ad('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x74ad('0x7')]('/',auth[_0x74ad('0x8')](),controller[_0x74ad('0x9')]);router[_0x74ad('0x7')]('/:id',auth[_0x74ad('0x8')](),controller['show']);router[_0x74ad('0x7')](_0x74ad('0xa'),auth['isAuthenticated'](),controller[_0x74ad('0xb')]);router[_0x74ad('0xc')]('/',auth[_0x74ad('0x8')](),controller['create']);router[_0x74ad('0xc')]('/:id/sounds',auth[_0x74ad('0x8')](),controller[_0x74ad('0xd')]);router[_0x74ad('0xe')](_0x74ad('0xf'),auth[_0x74ad('0x8')](),controller['update']);router[_0x74ad('0x10')](_0x74ad('0xf'),auth[_0x74ad('0x8')](),controller[_0x74ad('0x11')]);router['delete'](_0x74ad('0x12'),auth[_0x74ad('0x8')](),controller['removeSound']);module[_0x74ad('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 870639f..c5ce5ba 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 _0x0881=['custom','files','mp3nb','STRING','alpha','TIMESTAMP','sequelize','exports','name'];(function(_0x58e7ed,_0xcc369f){var _0x282127=function(_0x199ce7){while(--_0x199ce7){_0x58e7ed['push'](_0x58e7ed['shift']());}};_0x282127(++_0xcc369f);}(_0x0881,0x9f));var _0x1088=function(_0x4186c3,_0x1c0521){_0x4186c3=_0x4186c3-0x0;var _0x23ff6c=_0x0881[_0x4186c3];return _0x23ff6c;};'use strict';var Sequelize=require(_0x1088('0x0'));module[_0x1088('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1088('0x2')},'mode':{'type':Sequelize['ENUM'](_0x1088('0x3'),_0x1088('0x4'),_0x1088('0x5'),'quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x1088('0x6')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1088('0x6')],'allowNull':!![],'defaultValue':_0x1088('0x7')},'format':{'type':Sequelize[_0x1088('0x6')],'allowNull':!![]},'stamp':{'type':_0x1088('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2205=['files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','exports','STRING','name','ENUM','custom'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2205,0x1b7));var _0x5220=function(_0xa39a8,_0x54030d){_0xa39a8=_0xa39a8-0x0;var _0x1534a9=_0x2205[_0xa39a8];return _0x1534a9;};'use strict';var Sequelize=require('sequelize');module[_0x5220('0x0')]={'name':{'type':Sequelize[_0x5220('0x1')],'allowNull':![],'unique':_0x5220('0x2')},'mode':{'type':Sequelize[_0x5220('0x3')](_0x5220('0x4'),_0x5220('0x5'),_0x5220('0x6'),_0x5220('0x7'),_0x5220('0x8'),_0x5220('0x9')),'allowNull':!![],'defaultValue':_0x5220('0x5')},'directory':{'type':Sequelize[_0x5220('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x5220('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5220('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5220('0x1')],'allowNull':!![],'defaultValue':_0x5220('0xa')},'format':{'type':Sequelize[_0x5220('0x1')],'allowNull':!![]},'stamp':{'type':_0x5220('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 d5fc214..477953c 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 _0xd8b0=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','ValidationError','removeSound','id2','message','getSounds','options','html-pdf','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','get','MusicOnHolds','UserProfileResource','destroy','name','send'];(function(_0x23b5af,_0x1ef483){var _0x17726b=function(_0x5bdc8a){while(--_0x5bdc8a){_0x23b5af['push'](_0x23b5af['shift']());}};_0x17726b(++_0x1ef483);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var 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(){var _0x2b924f=_0x56c729[_0x0d8b('0x23')]({'plain':!![]});var _0x38efc8=_0x0d8b('0x24');return db[_0x0d8b('0x25')][_0x0d8b('0x26')]({'where':{'type':_0x38efc8,'resourceId':_0x2b924f['id']}})[_0x0d8b('0x22')](function(){return _0x56c729;});})[_0x0d8b('0x22')](function(){_0x33fb87['status'](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['VoiceMusicOnHold'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x1b2b59['query'][_0x0d8b('0x1a')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x3e')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3f')]){_0x97050a[_0x0d8b('0x40')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x41')](_0x97050a);})[_0x0d8b('0x22')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x42')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x43')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x44')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x45')](db['VoiceMusicOnHold']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3f')]){_0x4d0811[_0x0d8b('0x40')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x4d0811)[_0x0d8b('0x22')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x22')](respondWithResult(_0x576050,null))[_0x0d8b('0x43')](handleError(_0x576050,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x47')]['id']){delete _0x11d22b[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x47')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x43')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x48')]=function(_0x574b90,_0x371fa0,_0x4d8850){return db['sequelize'][_0x0d8b('0x49')](function(_0x113fb7){if(_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4a')]==='files'){_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4b')]=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x4e'),_0x574b90['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x574b90[_0x0d8b('0x47')],{'transaction':_0x113fb7})[_0x0d8b('0x22')](function(_0x5e3bb4){if(_0x574b90['body'][_0x0d8b('0x4a')]===_0x0d8b('0x4f')){fs['mkdirSync'](_0x5e3bb4['directory'],parseInt(_0x0d8b('0x50'),0x8));}var _0xeeefd4=_0x574b90[_0x0d8b('0x51')][_0x0d8b('0x23')]({'plain':!![]});if(!_0xeeefd4)throw new Error(_0x0d8b('0x52'));if(_0xeeefd4['role']===_0x0d8b('0x51')){var _0x2afe34=_0x5e3bb4['get']({'plain':!![]});return db['UserProfileSection'][_0x0d8b('0x46')]({'where':{'name':_0x0d8b('0x24'),'userProfileId':_0xeeefd4['userProfileId']},'raw':!![]})['then'](function(_0xb8be3b){if(_0xb8be3b&&_0xb8be3b[_0x0d8b('0x53')]===0x0){return db[_0x0d8b('0x25')][_0x0d8b('0x48')]({'name':_0x2afe34['name'],'resourceId':_0x2afe34['id'],'type':_0xb8be3b[_0x0d8b('0x27')],'sectionId':_0xb8be3b['id']},{})['then'](function(){return _0x5e3bb4;});}else{return _0x5e3bb4;}})['catch'](function(_0x38c24e){logger[_0x0d8b('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c24e);});}return _0x5e3bb4;});})['then'](respondWithResult(_0x371fa0,0xc9))[_0x0d8b('0x43')](handleError(_0x371fa0,null));};exports[_0x0d8b('0x26')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0xccc2a9['params']['id']}})[_0x0d8b('0x22')](function(_0x37dc9f){if(_0x37dc9f){return db[_0x0d8b('0x55')][_0x0d8b('0x49')](function(_0x3fb9ea){return _0x37dc9f[_0x0d8b('0x26')]({'transaction':_0x3fb9ea,'raw':!![]})[_0x0d8b('0x22')](function(_0x1c78b6){if(_0x1c78b6[_0x0d8b('0x4b')]){fs['readdirSync'](_0x1c78b6[_0x0d8b('0x4b')])[_0x0d8b('0x56')](function(_0x180b7b){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x1c78b6['directory'],_0x180b7b));});fs[_0x0d8b('0x58')](_0x1c78b6[_0x0d8b('0x4b')]);}return _0x1c78b6;});})[_0x0d8b('0x43')](function(_0x17a87f){throw new db[(_0x0d8b('0x59'))]['ValidationError'](_0x17a87f['message']);});}})[_0x0d8b('0x22')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x22')](removeEntity(_0x2c1eb0,null))[_0x0d8b('0x43')](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x5a')]=function(_0x5a70bd,_0x199122,_0x12aef7){return db[_0x0d8b('0x55')]['transaction'](function(_0x2f19f4){var _0x532a85;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x5a70bd[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](function(_0x2b6eb6){if(_0x2b6eb6){_0x532a85=_0x2b6eb6;return _0x2b6eb6[_0x0d8b('0x5a')](_0x5a70bd['body']['id'],{'transaction':_0x2f19f4});}})[_0x0d8b('0x22')](function(_0x4c074d){if(_0x4c074d){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x5a70bd[_0x0d8b('0x47')]['id']},'attributes':['id',_0x0d8b('0x27'),'save_name',_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2332fc){if(_0x2332fc){var _0x2ccdae=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x5f'),util[_0x0d8b('0x60')](_0x0d8b('0x61'),path['basename'](_0x2332fc['save_name'],path[_0x0d8b('0x62')](_0x2332fc[_0x0d8b('0x63')])),_0x2332fc['converted_format']));var _0xb1aa96=path['join'](config['root'],_0x0d8b('0x4e'),_0x532a85[_0x0d8b('0x27')],util['format']('%s.%s',_0x2332fc[_0x0d8b('0x27')],_0x2332fc[_0x0d8b('0x5d')]));fs[_0x0d8b('0x64')](_0x2ccdae,_0xb1aa96);return _0x2332fc;}})[_0x0d8b('0x43')](function(_0x2ab72b){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x2ab72b['message']);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x199122,null))['then'](respondWithResult(_0x199122,0xc9))[_0x0d8b('0x43')](handleError(_0x199122,null));};exports[_0x0d8b('0x66')]=function(_0x2bb690,_0x14a34b,_0x49f610){return db[_0x0d8b('0x55')]['transaction'](function(_0x3a356b){var _0x2c6c5f;return db[_0x0d8b('0x3d')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](function(_0x91aa89){if(_0x91aa89){_0x2c6c5f=_0x91aa89;return _0x91aa89[_0x0d8b('0x66')](_0x2bb690[_0x0d8b('0x44')]['id2']);}})[_0x0d8b('0x22')](function(_0x54c28b){if(_0x54c28b){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690['params'][_0x0d8b('0x67')]},'attributes':['id','name',_0x0d8b('0x63'),_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2242cd){if(_0x2242cd){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x2c6c5f[_0x0d8b('0x4b')],util['format'](_0x0d8b('0x61'),_0x2242cd[_0x0d8b('0x27')],_0x2242cd['converted_format'])));return _0x2242cd;}})[_0x0d8b('0x43')](function(_0x105df9){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x105df9[_0x0d8b('0x68')]);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](respondWithStatusCode(_0x14a34b,0xcc))[_0x0d8b('0x43')](handleError(_0x14a34b,null));};exports[_0x0d8b('0x69')]=function(_0x5007c0,_0xe35028,_0x16df83){var _0x50c0ff={};var _0x1ece98={};var _0x93fc55;var _0x3acffa;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5007c0[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0xe35028,null))[_0x0d8b('0x22')](function(_0x5b76af){if(_0x5b76af){_0x93fc55=_0x5b76af;_0x1ece98['model']=_[_0x0d8b('0x45')](db[_0x0d8b('0x5b')][_0x0d8b('0x2a')]);_0x1ece98[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x5007c0[_0x0d8b('0x2c')]);_0x1ece98[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],_0x1ece98[_0x0d8b('0x2c')]);_0x50c0ff[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],qs['fields'](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x31')]));_0x50c0ff['attributes']=_0x50c0ff['attributes'][_0x0d8b('0x32')]?_0x50c0ff[_0x0d8b('0x30')]:_0x1ece98[_0x0d8b('0x2f')];_0x50c0ff[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x5007c0[_0x0d8b('0x2c')]['sort']);_0x50c0ff['where']=qs['filters'](_[_0x0d8b('0x37')](_0x5007c0[_0x0d8b('0x2c')],_0x1ece98[_0x0d8b('0x2d')]));if(_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x50c0ff[_0x0d8b('0x39')]=_['merge'](_0x50c0ff[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x50c0ff['attributes'],function(_0x30a69d){var _0x57e3c2={};_0x57e3c2[_0x30a69d]={'$like':'%'+_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x57e3c2;})});}_0x50c0ff=_[_0x0d8b('0x3a')]({},_0x50c0ff,_0x5007c0[_0x0d8b('0x6a')]);return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x424f9d){if(_0x424f9d){_0x3acffa=_0x424f9d[_0x0d8b('0x32')];if(!_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x50c0ff[_0x0d8b('0x1b')]=qs['limit'](_0x5007c0['query'][_0x0d8b('0x1b')]);_0x50c0ff[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x54674f){if(_0x54674f){return _0x54674f?{'count':_0x3acffa,'rows':_0x54674f}:null;}})[_0x0d8b('0x22')](respondWithResult(_0xe35028,null))['catch'](handleError(_0xe35028,null));}; \ No newline at end of file +var _0x5f2f=['getSounds','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','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','get','MusicOnHolds','UserProfileResource','then','end','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','catch','transaction','mode','directory','server/files/moh','create','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','message','addSound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','ValidationError','removeSound','id2','Sound'];(function(_0x144050,_0x58d1ce){var _0x409f13=function(_0x2cbc80){while(--_0x2cbc80){_0x144050['push'](_0x144050['shift']());}};_0x409f13(++_0x58d1ce);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30fe3a,_0x26a088){_0x30fe3a=_0x30fe3a-0x0;var _0x5a08d2=_0x5f2f[_0x30fe3a];return _0x5a08d2;};'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(){var _0x21cd91=_0x39c024[_0xf5f2('0x24')]({'plain':!![]});var _0x4e8bda=_0xf5f2('0x25');return db[_0xf5f2('0x26')]['destroy']({'where':{'type':_0x4e8bda,'resourceId':_0x21cd91['id']}})['then'](function(){return _0x39c024;});})[_0xf5f2('0x27')](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x28')]();});}};}function handleEntityNotFound(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(!_0x788a8d){_0x1a5bb3[_0xf5f2('0x17')](0x194);}return _0x788a8d;};}function handleError(_0x281ec8,_0x294414){_0x294414=_0x294414||0x1f4;return function(_0x4ab014){logger[_0xf5f2('0x29')](_0x4ab014[_0xf5f2('0x2a')]);if(_0x4ab014[_0xf5f2('0x2b')]){delete _0x4ab014[_0xf5f2('0x2b')];}_0x281ec8[_0xf5f2('0x18')](_0x294414)[_0xf5f2('0x2c')](_0x4ab014);};}exports['index']=function(_0x53cb96,_0x22c826){var _0x14c829={},_0x11c771={},_0x5027ab={'count':0x0,'rows':[]};var _0x5a2c7e=_[_0xf5f2('0x2d')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')],function(_0x153924){return{'name':_0x153924[_0xf5f2('0x30')],'type':_0x153924['type']['key']};});_0x11c771[_0xf5f2('0x31')]=_['map'](_0x5a2c7e,_0xf5f2('0x2b'));_0x11c771['query']=_[_0xf5f2('0x32')](_0x53cb96[_0xf5f2('0x33')]);_0x11c771[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x11c771[_0xf5f2('0x31')],_0x11c771[_0xf5f2('0x33')]);_0x14c829[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x11c771['model'],qs[_0xf5f2('0x37')](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x37')]));_0x14c829[_0xf5f2('0x36')]=_0x14c829[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x14c829[_0xf5f2('0x36')]:_0x11c771['model'];if(!_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x39')]('nolimit')){_0x14c829[_0xf5f2('0x1c')]=qs['limit'](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x14c829[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x53cb96['query']['offset']);}_0x14c829[_0xf5f2('0x3a')]=qs[_0xf5f2('0x3b')](_0x53cb96[_0xf5f2('0x33')]['sort']);_0x14c829[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x3d')](_0x53cb96['query'],_0x11c771[_0xf5f2('0x34')]),_0x5a2c7e);if(_0x53cb96[_0xf5f2('0x33')]['filter']){_0x14c829[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x14c829[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x2d')](_0x5a2c7e,function(_0x542cd6){if(_0x542cd6['type']!==_0xf5f2('0x3f')){var _0x140a11={};_0x140a11[_0x542cd6[_0xf5f2('0x2b')]]={'$like':'%'+_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x140a11;}})});}_0x14c829=_[_0xf5f2('0x3e')]({},_0x14c829,_0x53cb96[_0xf5f2('0x41')]);var _0x4c0ac7={'where':_0x14c829[_0xf5f2('0x3c')]};return db[_0xf5f2('0x2e')]['count'](_0x4c0ac7)[_0xf5f2('0x27')](function(_0x3f3895){_0x5027ab[_0xf5f2('0x1a')]=_0x3f3895;if(_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x42')]){_0x14c829[_0xf5f2('0x43')]=[{'all':!![]}];}return db[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0x14c829);})['then'](function(_0x31c3c){_0x5027ab[_0xf5f2('0x45')]=_0x31c3c;return _0x5027ab;})[_0xf5f2('0x27')](respondWithFilteredResult(_0x22c826,_0x14c829))['catch'](handleError(_0x22c826,null));};exports['show']=function(_0x59eb00,_0x76d21b){var _0x2ad13c={'raw':![],'where':{'id':_0x59eb00[_0xf5f2('0x46')]['id']}},_0x4c8d8e={};_0x4c8d8e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')]);_0x4c8d8e[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x59eb00[_0xf5f2('0x33')]);_0x4c8d8e[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x4c8d8e[_0xf5f2('0x31')],_0x4c8d8e[_0xf5f2('0x33')]);_0x2ad13c[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x4c8d8e['model'],qs[_0xf5f2('0x37')](_0x59eb00['query'][_0xf5f2('0x37')]));_0x2ad13c[_0xf5f2('0x36')]=_0x2ad13c[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x2ad13c[_0xf5f2('0x36')]:_0x4c8d8e[_0xf5f2('0x31')];if(_0x59eb00['query'][_0xf5f2('0x42')]){_0x2ad13c[_0xf5f2('0x43')]=[{'all':!![]}];}_0x2ad13c=_[_0xf5f2('0x3e')]({},_0x2ad13c,_0x59eb00[_0xf5f2('0x41')]);return db[_0xf5f2('0x2e')][_0xf5f2('0x47')](_0x2ad13c)[_0xf5f2('0x27')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x27')](respondWithResult(_0x76d21b,null))['catch'](handleError(_0x76d21b,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x48')]['id'];}return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x27')](saveUpdates(_0x33ec29[_0xf5f2('0x48')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x49')](handleError(_0x45db9a,null));};exports['create']=function(_0x740321,_0x497eb8,_0x2cbd9d){return db['sequelize'][_0xf5f2('0x4a')](function(_0xb8ea3a){if(_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4b')]==='files'){_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4c')]=path['join'](config['root'],_0xf5f2('0x4d'),_0x740321[_0xf5f2('0x48')]['name']);}return db[_0xf5f2('0x2e')][_0xf5f2('0x4e')](_0x740321[_0xf5f2('0x48')],{'transaction':_0xb8ea3a})[_0xf5f2('0x27')](function(_0x5d0db0){if(_0x740321['body'][_0xf5f2('0x4b')]===_0xf5f2('0x4f')){fs['mkdirSync'](_0x5d0db0[_0xf5f2('0x4c')],parseInt(_0xf5f2('0x50'),0x8));}var _0x255125=_0x740321[_0xf5f2('0x51')][_0xf5f2('0x24')]({'plain':!![]});if(!_0x255125)throw new Error(_0xf5f2('0x52'));if(_0x255125[_0xf5f2('0x53')]==='user'){var _0x59e8ef=_0x5d0db0[_0xf5f2('0x24')]({'plain':!![]});return db[_0xf5f2('0x54')][_0xf5f2('0x47')]({'where':{'name':_0xf5f2('0x25'),'userProfileId':_0x255125[_0xf5f2('0x55')]},'raw':!![]})['then'](function(_0xdb1106){if(_0xdb1106&&_0xdb1106[_0xf5f2('0x56')]===0x0){return db[_0xf5f2('0x26')]['create']({'name':_0x59e8ef[_0xf5f2('0x2b')],'resourceId':_0x59e8ef['id'],'type':_0xdb1106['name'],'sectionId':_0xdb1106['id']},{})[_0xf5f2('0x27')](function(){return _0x5d0db0;});}else{return _0x5d0db0;}})[_0xf5f2('0x49')](function(_0x28cce5){logger[_0xf5f2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28cce5);});}return _0x5d0db0;});})['then'](respondWithResult(_0x497eb8,0xc9))[_0xf5f2('0x49')](handleError(_0x497eb8,null));};exports['destroy']=function(_0xa39c65,_0x1f1916,_0x572ec1){var _0x3f0579;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0xa39c65['params']['id']}})[_0xf5f2('0x27')](function(_0xcf7a50){if(_0xcf7a50){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x51fa7e){return _0xcf7a50[_0xf5f2('0x23')]({'transaction':_0x51fa7e,'raw':!![]})['then'](function(_0x2cbe1e){if(_0x2cbe1e[_0xf5f2('0x4c')]){fs[_0xf5f2('0x58')](_0x2cbe1e[_0xf5f2('0x4c')])[_0xf5f2('0x59')](function(_0x5583c2){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x2cbe1e[_0xf5f2('0x4c')],_0x5583c2));});fs[_0xf5f2('0x5c')](_0x2cbe1e[_0xf5f2('0x4c')]);}return _0x2cbe1e;});})['catch'](function(_0x31e16b){throw new db['Sequelize']['ValidationError'](_0x31e16b[_0xf5f2('0x5d')]);});}})['then'](handleEntityNotFound(_0x1f1916,null))[_0xf5f2('0x27')](removeEntity(_0x1f1916,null))[_0xf5f2('0x49')](handleError(_0x1f1916,null));};exports[_0xf5f2('0x5e')]=function(_0x123b93,_0x5767fc,_0x15d0c2){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x18c41f){var _0x15b680;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x123b93['params']['id']}})[_0xf5f2('0x27')](function(_0x2d171d){if(_0x2d171d){_0x15b680=_0x2d171d;return _0x2d171d[_0xf5f2('0x5e')](_0x123b93[_0xf5f2('0x48')]['id'],{'transaction':_0x18c41f});}})['then'](function(_0x1de396){if(_0x1de396){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x123b93[_0xf5f2('0x48')]['id']},'attributes':['id','name',_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})[_0xf5f2('0x27')](function(_0x146462){if(_0x146462){var _0x4bd113=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],_0xf5f2('0x64'),util[_0xf5f2('0x65')](_0xf5f2('0x66'),path[_0xf5f2('0x67')](_0x146462['save_name'],path[_0xf5f2('0x68')](_0x146462[_0xf5f2('0x60')])),_0x146462['converted_format']));var _0x3f677e=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],'server/files/moh',_0x15b680['name'],util['format'](_0xf5f2('0x66'),_0x146462[_0xf5f2('0x2b')],_0x146462[_0xf5f2('0x61')]));fs[_0xf5f2('0x69')](_0x4bd113,_0x3f677e);return _0x146462;}})[_0xf5f2('0x49')](function(_0x4d878e){throw new db[(_0xf5f2('0x6a'))][(_0xf5f2('0x6b'))](_0x4d878e[_0xf5f2('0x5d')]);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x5767fc,null))[_0xf5f2('0x27')](respondWithResult(_0x5767fc,0xc9))[_0xf5f2('0x49')](handleError(_0x5767fc,null));};exports[_0xf5f2('0x6c')]=function(_0x3cce11,_0x155f45,_0x1f35ef){return db[_0xf5f2('0x57')]['transaction'](function(_0x5e4e07){var _0x5a143f;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))[_0xf5f2('0x27')](function(_0x5c6959){if(_0x5c6959){_0x5a143f=_0x5c6959;return _0x5c6959[_0xf5f2('0x6c')](_0x3cce11[_0xf5f2('0x46')][_0xf5f2('0x6d')]);}})[_0xf5f2('0x27')](function(_0x44d119){if(_0x44d119){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id2']},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})['then'](function(_0x40b36e){if(_0x40b36e){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x5a143f[_0xf5f2('0x4c')],util[_0xf5f2('0x65')]('%s.%s',_0x40b36e['name'],_0x40b36e[_0xf5f2('0x61')])));return _0x40b36e;}})[_0xf5f2('0x49')](function(_0x17eb69){throw new db[(_0xf5f2('0x6a'))]['ValidationError'](_0x17eb69['message']);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))['then'](respondWithStatusCode(_0x155f45,0xcc))['catch'](handleError(_0x155f45,null));};exports['getSounds']=function(_0x57cb18,_0xad4554,_0x543434){var _0x18eb83={};var _0x168092={};var _0x3de508;var _0x9f941e;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x57cb18[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xad4554,null))[_0xf5f2('0x27')](function(_0x2afeac){if(_0x2afeac){_0x3de508=_0x2afeac;_0x168092[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x6e')][_0xf5f2('0x2f')]);_0x168092[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x57cb18['query']);_0x168092[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],_0x168092[_0xf5f2('0x33')]);_0x18eb83[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],qs[_0xf5f2('0x37')](_0x57cb18['query'][_0xf5f2('0x37')]));_0x18eb83['attributes']=_0x18eb83['attributes']['length']?_0x18eb83['attributes']:_0x168092['model'];_0x18eb83['order']=qs[_0xf5f2('0x3b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x3b')]);_0x18eb83[_0xf5f2('0x3c')]=qs[_0xf5f2('0x34')](_[_0xf5f2('0x3d')](_0x57cb18['query'],_0x168092['filters']));if(_0x57cb18[_0xf5f2('0x33')]['filter']){_0x18eb83[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x18eb83['where'],{'$or':_['map'](_0x18eb83[_0xf5f2('0x36')],function(_0x274aa3){var _0x5a23c7={};_0x5a23c7[_0x274aa3]={'$like':'%'+_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x5a23c7;})});}_0x18eb83=_['merge']({},_0x18eb83,_0x57cb18[_0xf5f2('0x41')]);return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0x4c1678){if(_0x4c1678){_0x9f941e=_0x4c1678[_0xf5f2('0x38')];if(!_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x39')](_0xf5f2('0x70'))){_0x18eb83[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x18eb83[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1b')]);}return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0xe900ea){if(_0xe900ea){return _0xe900ea?{'count':_0x9f941e,'rows':_0xe900ea}:null;}})[_0xf5f2('0x27')](respondWithResult(_0xad4554,null))[_0xf5f2('0x49')](handleError(_0xad4554,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 7e55b84..6672df7 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 _0x8dc7=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8dc7,0xf7));var _0x78dc=function(_0x4c6619,_0x24303a){_0x4c6619=_0x4c6619-0x0;var _0x3a28b2=_0x8dc7[_0x4c6619];return _0x3a28b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78dc('0x0'))(_0x78dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78dc('0x2'));var fs=require('fs');var path=require(_0x78dc('0x3'));var rimraf=require(_0x78dc('0x4'));var config=require(_0x78dc('0x5'));var attributes=require(_0x78dc('0x6'));module[_0x78dc('0x7')]=function(_0x325c87,_0x4e7131){return _0x325c87[_0x78dc('0x8')](_0x78dc('0x9'),attributes,{'tableName':_0x78dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb87a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x2cc923,_0xb5ece){var _0x1e2359=function(_0x301d59){while(--_0x301d59){_0x2cc923['push'](_0x2cc923['shift']());}};_0x1e2359(++_0xb5ece);}(_0xb87a,0x7c));var _0xab87=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xb87a[_0x934425];return _0x31d596;};'use strict';var _=require(_0xab87('0x0'));var util=require(_0xab87('0x1'));var logger=require('../../config/logger')(_0xab87('0x2'));var moment=require(_0xab87('0x3'));var BPromise=require(_0xab87('0x4'));var rp=require(_0xab87('0x5'));var fs=require('fs');var path=require(_0xab87('0x6'));var rimraf=require(_0xab87('0x7'));var config=require(_0xab87('0x8'));var attributes=require(_0xab87('0x9'));module[_0xab87('0xa')]=function(_0x3ae818,_0x1e4b00){return _0x3ae818[_0xab87('0xb')](_0xab87('0xc'),attributes,{'tableName':_0xab87('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 e5917ce..1cba98e 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 _0x748e=['VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x748e,0x77));var _0xe748=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x748e[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var util=require(_0xe748('0x0'));var moment=require('moment');var BPromise=require(_0xe748('0x1'));var rs=require(_0xe748('0x2'));var fs=require('fs');var Redis=require(_0xe748('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe748('0x4'));var logger=require('../../config/logger')(_0xe748('0x5'));var config=require(_0xe748('0x6'));var jayson=require(_0xe748('0x7'));var client=jayson['client'][_0xe748('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x267bcf,_0x4f09e7,_0x1ffd56){return new BPromise(function(_0x3f70a6,_0xdf2657){return client['request'](_0x267bcf,_0x1ffd56)[_0xe748('0x9')](function(_0x5d4c46){logger[_0xe748('0xa')](_0xe748('0xb'),_0x4f09e7,_0xe748('0xc'));logger[_0xe748('0xd')](_0xe748('0xe'),_0x4f09e7,_0xe748('0xc'),JSON[_0xe748('0xf')](_0x5d4c46));if(_0x5d4c46[_0xe748('0x10')]){if(_0x5d4c46[_0xe748('0x10')]['code']===0x1f4){logger[_0xe748('0x10')](_0xe748('0xb'),_0x4f09e7,_0x5d4c46['error']['message']);return _0xdf2657(_0x5d4c46[_0xe748('0x10')]['message']);}logger[_0xe748('0x10')](_0xe748('0xb'),_0x4f09e7,_0x5d4c46[_0xe748('0x10')]['message']);return _0x3f70a6(_0x5d4c46[_0xe748('0x10')][_0xe748('0x11')]);}else{logger[_0xe748('0xa')](_0xe748('0xb'),_0x4f09e7,_0xe748('0xc'));_0x3f70a6(_0x5d4c46['result'][_0xe748('0x11')]);}})[_0xe748('0x12')](function(_0x35656f){logger[_0xe748('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4f09e7,_0x35656f);_0xdf2657(_0x35656f);});});} \ No newline at end of file +var _0x8bfb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1bb9b6,_0x5eb8a3){var _0x3ade32=function(_0xe0134a){while(--_0xe0134a){_0x1bb9b6['push'](_0x1bb9b6['shift']());}};_0x3ade32(++_0x5eb8a3);}(_0x8bfb,0xa3));var _0xb8bf=function(_0x48f5ca,_0x5e4750){_0x48f5ca=_0x48f5ca-0x0;var _0x50b00e=_0x8bfb[_0x48f5ca];return _0x50b00e;};'use strict';var _=require(_0xb8bf('0x0'));var util=require(_0xb8bf('0x1'));var moment=require(_0xb8bf('0x2'));var BPromise=require(_0xb8bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8bf('0x4'));var db=require(_0xb8bf('0x5'))['db'];var utils=require(_0xb8bf('0x6'));var logger=require(_0xb8bf('0x7'))(_0xb8bf('0x8'));var config=require(_0xb8bf('0x9'));var jayson=require(_0xb8bf('0xa'));var client=jayson['client'][_0xb8bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c382,_0x2373e2,_0x44bbd5){return new BPromise(function(_0x790edd,_0x4c4fa9){return client[_0xb8bf('0xc')](_0x55c382,_0x44bbd5)[_0xb8bf('0xd')](function(_0x258391){logger[_0xb8bf('0xe')](_0xb8bf('0xf'),_0x2373e2,_0xb8bf('0x10'));logger[_0xb8bf('0x11')](_0xb8bf('0x12'),_0x2373e2,_0xb8bf('0x10'),JSON[_0xb8bf('0x13')](_0x258391));if(_0x258391[_0xb8bf('0x14')]){if(_0x258391[_0xb8bf('0x14')]['code']===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2373e2,_0x258391[_0xb8bf('0x14')][_0xb8bf('0x15')]);return _0x4c4fa9(_0x258391[_0xb8bf('0x14')][_0xb8bf('0x15')]);}logger[_0xb8bf('0x14')](_0xb8bf('0xf'),_0x2373e2,_0x258391[_0xb8bf('0x14')][_0xb8bf('0x15')]);return _0x790edd(_0x258391['error'][_0xb8bf('0x15')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2373e2,_0xb8bf('0x10'));_0x790edd(_0x258391[_0xb8bf('0x16')][_0xb8bf('0x15')]);}})[_0xb8bf('0x17')](function(_0x4599f7){logger[_0xb8bf('0x14')](_0xb8bf('0xf'),_0x2373e2,_0x4599f7);_0x4c4fa9(_0x4599f7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 50b5942..1dddcaf 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 _0x44c0=['/:id','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe'];(function(_0x750842,_0x479757){var _0x5b162b=function(_0x5bbaaf){while(--_0x5bbaaf){_0x750842['push'](_0x750842['shift']());}};_0x5b162b(++_0x479757);}(_0x44c0,0x1a4));var _0x044c=function(_0x28c9b9,_0x5d6f79){_0x28c9b9=_0x28c9b9-0x0;var _0xb69ae0=_0x44c0[_0x28c9b9];return _0xb69ae0;};'use strict';var multer=require(_0x044c('0x0'));var util=require(_0x044c('0x1'));var path=require(_0x044c('0x2'));var timeout=require('connect-timeout');var express=require(_0x044c('0x3'));var router=express[_0x044c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x044c('0x5'));var config=require(_0x044c('0x6'));var controller=require(_0x044c('0x7'));router[_0x044c('0x8')]('/',auth[_0x044c('0x9')](),controller[_0x044c('0xa')]);router['get'](_0x044c('0xb'),auth[_0x044c('0x9')](),controller['describe']);router[_0x044c('0x8')](_0x044c('0xc'),auth[_0x044c('0x9')](),controller['show']);router[_0x044c('0x8')](_0x044c('0xd'),auth['isAuthenticated'](),controller[_0x044c('0xe')]);router[_0x044c('0xf')]('/',auth[_0x044c('0x9')](),controller[_0x044c('0x10')]);router[_0x044c('0xf')]('/:id/users',auth[_0x044c('0x9')](),controller[_0x044c('0x11')]);router[_0x044c('0x12')](_0x044c('0xc'),auth[_0x044c('0x9')](),controller[_0x044c('0x13')]);router['delete']('/:id',auth[_0x044c('0x9')](),controller[_0x044c('0x14')]);router[_0x044c('0x15')](_0x044c('0xd'),auth[_0x044c('0x9')](),controller[_0x044c('0x16')]);module[_0x044c('0x17')]=router; \ No newline at end of file +var _0x71a7=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router'];(function(_0x39602d,_0x1edf77){var _0x5b8548=function(_0x409251){while(--_0x409251){_0x39602d['push'](_0x39602d['shift']());}};_0x5b8548(++_0x1edf77);}(_0x71a7,0x126));var _0x771a=function(_0x992f81,_0x2ac0bc){_0x992f81=_0x992f81-0x0;var _0x54937e=_0x71a7[_0x992f81];return _0x54937e;};'use strict';var multer=require(_0x771a('0x0'));var util=require(_0x771a('0x1'));var path=require(_0x771a('0x2'));var timeout=require('connect-timeout');var express=require(_0x771a('0x3'));var router=express[_0x771a('0x4')]();var auth=require(_0x771a('0x5'));var interaction=require(_0x771a('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x771a('0x7')]('/',auth[_0x771a('0x8')](),controller[_0x771a('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x771a('0xa')]);router[_0x771a('0x7')](_0x771a('0xb'),auth[_0x771a('0x8')](),controller['show']);router[_0x771a('0x7')](_0x771a('0xc'),auth[_0x771a('0x8')](),controller[_0x771a('0xd')]);router[_0x771a('0xe')]('/',auth[_0x771a('0x8')](),controller[_0x771a('0xf')]);router[_0x771a('0xe')](_0x771a('0xc'),auth[_0x771a('0x8')](),controller[_0x771a('0x10')]);router[_0x771a('0x11')]('/:id',auth[_0x771a('0x8')](),controller[_0x771a('0x12')]);router[_0x771a('0x13')]('/:id',auth[_0x771a('0x8')](),controller[_0x771a('0x14')]);router[_0x771a('0x13')](_0x771a('0xc'),auth['isAuthenticated'](),controller[_0x771a('0x15')]);module[_0x771a('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 69e5c83..c19ba48 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 _0x0502=['getDataValue','name','INTEGER','sequelize','exports','STRING','VIRTUAL','system-'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x0502,0x1eb));var _0x2050=function(_0xc82d98,_0x7487b5){_0xc82d98=_0xc82d98-0x0;var _0x1cfdc4=_0x0502[_0xc82d98];return _0x1cfdc4;};'use strict';var Sequelize=require(_0x2050('0x0'));module[_0x2050('0x1')]={'name':{'type':Sequelize[_0x2050('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2050('0x3')],'get':function(_0x21869a){return _0x2050('0x4')+this[_0x2050('0x5')](_0x2050('0x6'))+'-';}},'description':{'type':Sequelize[_0x2050('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2050('0x7')]}}; \ No newline at end of file +var _0xfdb8=['system-','getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL'];(function(_0x4aab5f,_0x47181b){var _0x27909b=function(_0x1c3175){while(--_0x1c3175){_0x4aab5f['push'](_0x4aab5f['shift']());}};_0x27909b(++_0x47181b);}(_0xfdb8,0x184));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8fdb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fdb('0x1')],'allowNull':![],'unique':_0x8fdb('0x2')},'prefix':{'type':Sequelize[_0x8fdb('0x3')],'get':function(_0x2f4dea){return _0x8fdb('0x4')+this[_0x8fdb('0x5')](_0x8fdb('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x8fdb('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 1c868d9..f4a0ae5 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 _0xf0d1=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','get','destroy','error','stack','send','index','VoicePrefix','rawAttributes','fieldName','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','role','UserProfileSection','VoicePrefixes','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','description','priority','appdata','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','nolimit','eml-format'];(function(_0xefd0a,_0x23217f){var _0x177326=function(_0xd5cb86){while(--_0xd5cb86){_0xefd0a['push'](_0xefd0a['shift']());}};_0x177326(++_0x23217f);}(_0xf0d1,0x170));var _0x1f0d=function(_0x24b897,_0x38df26){_0x24b897=_0x24b897-0x0;var _0x522698=_0xf0d1[_0x24b897];return _0x522698;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1f0d('0x0'));var rimraf=require(_0x1f0d('0x1'));var zipdir=require(_0x1f0d('0x2'));var jsonpatch=require(_0x1f0d('0x3'));var rp=require(_0x1f0d('0x4'));var moment=require('moment');var BPromise=require(_0x1f0d('0x5'));var Mustache=require(_0x1f0d('0x6'));var util=require(_0x1f0d('0x7'));var path=require(_0x1f0d('0x8'));var sox=require('sox');var csv=require(_0x1f0d('0x9'));var ejs=require(_0x1f0d('0xa'));var fs=require('fs');var _=require(_0x1f0d('0xb'));var squel=require(_0x1f0d('0xc'));var crypto=require(_0x1f0d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1f0d('0xe'));var toCsv=require(_0x1f0d('0x9'));var querystring=require(_0x1f0d('0xf'));var Papa=require(_0x1f0d('0x10'));var Redis=require('ioredis');var authService=require(_0x1f0d('0x11'));var qs=require(_0x1f0d('0x12'));var as=require(_0x1f0d('0x13'));var hardwareService=require(_0x1f0d('0x14'));var logger=require(_0x1f0d('0x15'))(_0x1f0d('0x16'));var utils=require('../../config/utils');var config=require(_0x1f0d('0x17'));var db=require('../../mysqldb')['db'];config[_0x1f0d('0x18')]=_[_0x1f0d('0x19')](config['redis'],{'host':_0x1f0d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f0d('0x18')]));require(_0x1f0d('0x1b'))[_0x1f0d('0x1c')](socket);function respondWithStatusCode(_0x3c52aa,_0x3542c6){_0x3542c6=_0x3542c6||0xcc;return function(_0x3350c4){if(_0x3350c4){return _0x3c52aa[_0x1f0d('0x1d')](_0x3542c6);}return _0x3c52aa[_0x1f0d('0x1e')](_0x3542c6)[_0x1f0d('0x1f')]();};}function respondWithResult(_0x36e69b,_0x48582f){_0x48582f=_0x48582f||0xc8;return function(_0x4f4a4b){if(_0x4f4a4b){return _0x36e69b[_0x1f0d('0x1e')](_0x48582f)[_0x1f0d('0x20')](_0x4f4a4b);}};}function respondWithFilteredResult(_0x360656,_0x2d61e2){return function(_0x3083b3){if(_0x3083b3){var _0x41e869=_0x3083b3[_0x1f0d('0x21')],_0x2adad0=_0x2d61e2[_0x1f0d('0x22')],_0x27f58c=_0x2d61e2['offset']+_0x2d61e2[_0x1f0d('0x23')],_0x4678e5;if(_0x27f58c>=_0x41e869){_0x27f58c=_0x41e869;_0x4678e5=0xc8;}else{_0x4678e5=0xce;}_0x360656[_0x1f0d('0x1e')](_0x4678e5);return _0x360656[_0x1f0d('0x24')]('Content-Range',_0x2adad0+'-'+_0x27f58c+'/'+_0x41e869)[_0x1f0d('0x20')](_0x3083b3);}return null;};}function patchUpdates(_0x17547e){return function(_0x19e6aa){try{jsonpatch['apply'](_0x19e6aa,_0x17547e,!![]);}catch(_0x3d99db){return BPromise[_0x1f0d('0x25')](_0x3d99db);}return _0x19e6aa[_0x1f0d('0x26')]();};}function saveUpdates(_0x483a7a,_0x46e831){return function(_0x267861){if(_0x267861){return _0x267861[_0x1f0d('0x27')](_0x483a7a)[_0x1f0d('0x28')](function(_0x48bee6){return _0x48bee6;});}return null;};}function removeEntity(_0x530c16,_0x2d578a){return function(_0x320f6e){if(_0x320f6e){return _0x320f6e['destroy']()['then'](function(){var _0x5b835b=_0x320f6e[_0x1f0d('0x29')]({'plain':!![]});var _0x31a191='VoicePrefixes';return db['UserProfileResource'][_0x1f0d('0x2a')]({'where':{'type':_0x31a191,'resourceId':_0x5b835b['id']}})[_0x1f0d('0x28')](function(){return _0x320f6e;});})[_0x1f0d('0x28')](function(){_0x530c16[_0x1f0d('0x1e')](0xcc)[_0x1f0d('0x1f')]();});}};}function handleEntityNotFound(_0x25fe07,_0x2fcc41){return function(_0x5d3d51){if(!_0x5d3d51){_0x25fe07[_0x1f0d('0x1d')](0x194);}return _0x5d3d51;};}function handleError(_0x47ef12,_0xe06a19){_0xe06a19=_0xe06a19||0x1f4;return function(_0x390ec0){logger[_0x1f0d('0x2b')](_0x390ec0[_0x1f0d('0x2c')]);if(_0x390ec0['name']){delete _0x390ec0['name'];}_0x47ef12[_0x1f0d('0x1e')](_0xe06a19)[_0x1f0d('0x2d')](_0x390ec0);};}exports[_0x1f0d('0x2e')]=function(_0x3d1738,_0x25f4c3){var _0x2c4cf8={},_0x1359a0={},_0x179f05={'count':0x0,'rows':[]};var _0x5f3dd6=_['map'](db[_0x1f0d('0x2f')][_0x1f0d('0x30')],function(_0x3b5fc2){return{'name':_0x3b5fc2[_0x1f0d('0x31')],'type':_0x3b5fc2['type']['key']};});_0x1359a0[_0x1f0d('0x32')]=_[_0x1f0d('0x33')](_0x5f3dd6,_0x1f0d('0x34'));_0x1359a0['query']=_[_0x1f0d('0x35')](_0x3d1738[_0x1f0d('0x36')]);_0x1359a0[_0x1f0d('0x37')]=_[_0x1f0d('0x38')](_0x1359a0['model'],_0x1359a0[_0x1f0d('0x36')]);_0x2c4cf8[_0x1f0d('0x39')]=_[_0x1f0d('0x38')](_0x1359a0[_0x1f0d('0x32')],qs['fields'](_0x3d1738['query'][_0x1f0d('0x3a')]));_0x2c4cf8[_0x1f0d('0x39')]=_0x2c4cf8[_0x1f0d('0x39')][_0x1f0d('0x3b')]?_0x2c4cf8[_0x1f0d('0x39')]:_0x1359a0[_0x1f0d('0x32')];if(!_0x3d1738[_0x1f0d('0x36')][_0x1f0d('0x3c')]('nolimit')){_0x2c4cf8[_0x1f0d('0x23')]=qs[_0x1f0d('0x23')](_0x3d1738[_0x1f0d('0x36')][_0x1f0d('0x23')]);_0x2c4cf8[_0x1f0d('0x22')]=qs['offset'](_0x3d1738['query'][_0x1f0d('0x22')]);}_0x2c4cf8['order']=qs[_0x1f0d('0x3d')](_0x3d1738[_0x1f0d('0x36')]['sort']);_0x2c4cf8[_0x1f0d('0x3e')]=qs[_0x1f0d('0x37')](_[_0x1f0d('0x3f')](_0x3d1738[_0x1f0d('0x36')],_0x1359a0[_0x1f0d('0x37')]),_0x5f3dd6);if(_0x3d1738['query'][_0x1f0d('0x40')]){_0x2c4cf8[_0x1f0d('0x3e')]=_['merge'](_0x2c4cf8[_0x1f0d('0x3e')],{'$or':_[_0x1f0d('0x33')](_0x5f3dd6,function(_0x2049f7){if(_0x2049f7[_0x1f0d('0x41')]!=='VIRTUAL'){var _0x40d2e4={};_0x40d2e4[_0x2049f7['name']]={'$like':'%'+_0x3d1738[_0x1f0d('0x36')]['filter']+'%'};return _0x40d2e4;}})});}_0x2c4cf8=_[_0x1f0d('0x42')]({},_0x2c4cf8,_0x3d1738[_0x1f0d('0x43')]);var _0x184bd1={'where':_0x2c4cf8['where']};return db[_0x1f0d('0x2f')][_0x1f0d('0x21')](_0x184bd1)['then'](function(_0x19e2c5){_0x179f05[_0x1f0d('0x21')]=_0x19e2c5;if(_0x3d1738[_0x1f0d('0x36')][_0x1f0d('0x44')]){_0x2c4cf8[_0x1f0d('0x45')]=[{'all':!![]}];}return db[_0x1f0d('0x2f')][_0x1f0d('0x46')](_0x2c4cf8);})[_0x1f0d('0x28')](function(_0x53a48d){_0x179f05[_0x1f0d('0x47')]=_0x53a48d;return _0x179f05;})[_0x1f0d('0x28')](respondWithFilteredResult(_0x25f4c3,_0x2c4cf8))[_0x1f0d('0x48')](handleError(_0x25f4c3,null));};exports[_0x1f0d('0x49')]=function(_0x4ed658,_0x24ac24){var _0x4b1962={'raw':![],'where':{'id':_0x4ed658[_0x1f0d('0x4a')]['id']}},_0x5e5828={};_0x5e5828['model']=_[_0x1f0d('0x35')](db[_0x1f0d('0x2f')][_0x1f0d('0x30')]);_0x5e5828[_0x1f0d('0x36')]=_[_0x1f0d('0x35')](_0x4ed658[_0x1f0d('0x36')]);_0x5e5828[_0x1f0d('0x37')]=_[_0x1f0d('0x38')](_0x5e5828[_0x1f0d('0x32')],_0x5e5828['query']);_0x4b1962[_0x1f0d('0x39')]=_[_0x1f0d('0x38')](_0x5e5828[_0x1f0d('0x32')],qs[_0x1f0d('0x3a')](_0x4ed658[_0x1f0d('0x36')][_0x1f0d('0x3a')]));_0x4b1962[_0x1f0d('0x39')]=_0x4b1962[_0x1f0d('0x39')]['length']?_0x4b1962[_0x1f0d('0x39')]:_0x5e5828[_0x1f0d('0x32')];if(_0x4ed658['query'][_0x1f0d('0x44')]){_0x4b1962[_0x1f0d('0x45')]=[{'all':!![]}];}_0x4b1962=_['merge']({},_0x4b1962,_0x4ed658[_0x1f0d('0x43')]);return db[_0x1f0d('0x2f')][_0x1f0d('0x4b')](_0x4b1962)[_0x1f0d('0x28')](handleEntityNotFound(_0x24ac24,null))[_0x1f0d('0x28')](respondWithResult(_0x24ac24,null))[_0x1f0d('0x48')](handleError(_0x24ac24,null));};exports[_0x1f0d('0x2a')]=function(_0x5bfb24,_0x2ae6a9){return db[_0x1f0d('0x2f')][_0x1f0d('0x4b')]({'where':{'id':_0x5bfb24['params']['id']}})[_0x1f0d('0x28')](handleEntityNotFound(_0x2ae6a9,null))[_0x1f0d('0x28')](removeEntity(_0x2ae6a9,null))['catch'](handleError(_0x2ae6a9,null));};exports[_0x1f0d('0x4c')]=function(_0x391e9b,_0x1feb85){return db[_0x1f0d('0x2f')]['describe']()[_0x1f0d('0x28')](respondWithResult(_0x1feb85,null))[_0x1f0d('0x48')](handleError(_0x1feb85,null));};exports[_0x1f0d('0x4d')]=function(_0xdaebbd,_0x135de4){var _0x255bd4;return db['sequelize'][_0x1f0d('0x4e')](function(_0x556a82){return db[_0x1f0d('0x2f')][_0x1f0d('0x4d')](_0xdaebbd[_0x1f0d('0x4f')],{'transaction':_0x556a82})['then'](function(_0x1a890a){_0x255bd4=_0x1a890a[_0x1f0d('0x29')]({'plain':!![]});return db[_0x1f0d('0x50')][_0x1f0d('0x4b')]({'where':{'id':_0x255bd4[_0x1f0d('0x51')]},'raw':!![]})[_0x1f0d('0x28')](function(_0x132385){return createVoicePrefixExtensions(_0x255bd4,_0x132385,_0x556a82);});});})['then'](function(){var _0x54f476=_0xdaebbd['user'][_0x1f0d('0x29')]({'plain':!![]});if(!_0x54f476)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54f476[_0x1f0d('0x52')]==='user'){var _0x3f7048=_0x255bd4;return db[_0x1f0d('0x53')]['find']({'where':{'name':_0x1f0d('0x54'),'userProfileId':_0x54f476[_0x1f0d('0x55')]},'raw':!![]})['then'](function(_0x57d0b7){if(_0x57d0b7&&_0x57d0b7['autoAssociation']===0x0){return db[_0x1f0d('0x56')][_0x1f0d('0x4d')]({'name':_0x3f7048['name'],'resourceId':_0x3f7048['id'],'type':_0x57d0b7[_0x1f0d('0x34')],'sectionId':_0x57d0b7['id']},{})[_0x1f0d('0x28')](function(){return _0x255bd4;});}else{return _0x255bd4;}})[_0x1f0d('0x48')](function(_0xa76314){logger[_0x1f0d('0x2b')](_0x1f0d('0x57'),_0xa76314);throw _0xa76314;});}return _0x255bd4;})[_0x1f0d('0x28')](respondWithResult(_0x135de4,null))[_0x1f0d('0x48')](handleError(_0x135de4,null));};function Extension(_0x2711b4,_0x30705c,_0x109ec6,_0x4bce5d){this['context']=_0x1f0d('0x58');this[_0x1f0d('0x59')]=_0x2711b4;this[_0x1f0d('0x5a')]=_0x109ec6;this[_0x1f0d('0x41')]='system';this[_0x1f0d('0x5b')]='Voice\x20Prefix\x20Extension';this[_0x1f0d('0x5c')]=_0x30705c;this[_0x1f0d('0x5d')]=_0x4bce5d;}function createVoicePrefixExtensions(_0x5ca828,_0x10cb1f,_0x447279){return new BPromise(function(_0x59d8f3,_0x53712a){var _0x20f113=new Extension(formatPrefixName(_0x5ca828['prefix']),0x1,_0x1f0d('0x5e'),'Voice\x20Prefix');_0x20f113[_0x1f0d('0x5f')]=_0x5ca828['id'];return db[_0x1f0d('0x50')]['create'](_0x20f113,{'transaction':_0x447279})[_0x1f0d('0x28')](function(_0x589d96){var _0x5e1de9=_0x589d96[_0x1f0d('0x29')]({'plain':!![]});var _0x15b1f4=_[_0x1f0d('0x33')](addVoicePrefixExtensions(_0x5ca828,_0x10cb1f),function(_0x207ea0){_0x207ea0['VoiceExtensionId']=_0x5e1de9['id'];_0x207ea0[_0x1f0d('0x5f')]=_0x5ca828['id'];return _0x207ea0;});return db[_0x1f0d('0x50')][_0x1f0d('0x60')](_0x15b1f4,{'transaction':_0x447279})[_0x1f0d('0x28')](function(_0x341220){if(!_0x341220){return _0x53712a(_0x1f0d('0x61'));}else{return _0x59d8f3(_0x341220);}})[_0x1f0d('0x48')](function(_0x2a6bbf){return _0x53712a(_0x2a6bbf);});});;});};function addVoicePrefixExtensions(_0x3f72ac,_0x4f33df){var _0x1a9bbc=[];var _0xca2d0c=formatPrefixName(_0x3f72ac[_0x1f0d('0x62')]);_0x1a9bbc[_0x1f0d('0x63')](new Extension(_0xca2d0c,0x2,_0x1f0d('0x64'),_0x1f0d('0x65')+_0x3f72ac['name']));if(_0x3f72ac[_0x1f0d('0x66')]){_0x1a9bbc[_0x1f0d('0x63')](new Extension(_0xca2d0c,0x3,'Set',_0x1f0d('0x67')+_0x3f72ac[_0x1f0d('0x66')]));}else{_0x1a9bbc[_0x1f0d('0x63')](new Extension(_0xca2d0c,0x3,'NoOp',_0x1f0d('0x68')));}_0x1a9bbc[_0x1f0d('0x63')](new Extension(_0xca2d0c,0x4,_0x1f0d('0x69'),_0x4f33df[_0x1f0d('0x6a')]+','+_0x1f0d('0x6b')+(0x8+_0x3f72ac[_0x1f0d('0x34')][_0x1f0d('0x3b')])+'}'+','+0x1));return _0x1a9bbc;}function formatPrefixName(_0x569c90){var _0x2bbd97='_';for(var _0x368b88=0x0;_0x368b88<_0x569c90[_0x1f0d('0x3b')];_0x368b88++){if(_0x569c90[_0x1f0d('0x6c')](_0x368b88)=='-'){_0x2bbd97+=_0x569c90[_0x1f0d('0x6c')](_0x368b88);}else{_0x2bbd97+='['+_0x569c90[_0x1f0d('0x6c')](_0x368b88)+']';}}_0x2bbd97+='.';return _0x2bbd97;}exports[_0x1f0d('0x27')]=function(_0x346474,_0x226669,_0x4dcc89){var _0x445068=_0x346474['body'];_0x445068[_0x1f0d('0x62')]=_0x1f0d('0x6d')+_0x445068[_0x1f0d('0x34')]+'-';return db['sequelize'][_0x1f0d('0x4e')](function(_0x59ee23){return db['VoicePrefix'][_0x1f0d('0x27')](_0x445068,{'where':{'id':_0x445068['id']},'transaction':_0x59ee23})['then'](function(){return db[_0x1f0d('0x50')][_0x1f0d('0x2a')]({'where':{'VoicePrefixId':_0x445068['id']},'transaction':_0x59ee23})[_0x1f0d('0x28')](function(){return db[_0x1f0d('0x50')][_0x1f0d('0x4b')]({'where':{'id':_0x445068[_0x1f0d('0x51')]},'raw':!![]})[_0x1f0d('0x28')](function(_0x49bad7){return createVoicePrefixExtensions(_0x445068,_0x49bad7,_0x59ee23);});});});})['then'](function(){return db[_0x1f0d('0x2f')][_0x1f0d('0x6e')](_0x445068['id']);})[_0x1f0d('0x28')](respondWithResult(_0x226669,null))[_0x1f0d('0x48')](handleError(_0x226669,null));};exports[_0x1f0d('0x6f')]=function(_0x4fb944,_0x2e3a31,_0x2c2071){return db[_0x1f0d('0x2f')][_0x1f0d('0x4b')]({'where':{'id':_0x4fb944['params']['id']}})[_0x1f0d('0x28')](handleEntityNotFound(_0x2e3a31,null))['then'](function(_0x11c8a9){if(_0x11c8a9){return _0x11c8a9[_0x1f0d('0x6f')](_0x4fb944[_0x1f0d('0x4f')][_0x1f0d('0x70')],_[_0x1f0d('0x71')](_0x4fb944[_0x1f0d('0x4f')],['ids','id'])||{})['spread'](function(_0x20af56){for(var _0x5ee57e=0x0;_0x5ee57e<_0x4fb944['body'][_0x1f0d('0x70')][_0x1f0d('0x3b')];_0x5ee57e+=0x1){socket[_0x1f0d('0x72')](_0x1f0d('0x73'),{'UserId':_0x4fb944[_0x1f0d('0x4f')][_0x1f0d('0x70')][_0x5ee57e],'VoicePrefixId':_0x4fb944['params']['id']});}return _0x20af56;});}})[_0x1f0d('0x28')](respondWithResult(_0x2e3a31,null))[_0x1f0d('0x48')](handleError(_0x2e3a31,null));};exports[_0x1f0d('0x74')]=function(_0x4999cd,_0x5666b6,_0x43be2a){return db[_0x1f0d('0x2f')][_0x1f0d('0x4b')]({'where':{'id':_0x4999cd['params']['id']}})[_0x1f0d('0x28')](handleEntityNotFound(_0x5666b6,null))[_0x1f0d('0x28')](function(_0x320395){if(_0x320395){return _0x320395[_0x1f0d('0x74')](_0x4999cd[_0x1f0d('0x36')][_0x1f0d('0x70')])[_0x1f0d('0x28')](function(){if(_[_0x1f0d('0x75')](_0x4999cd['query'][_0x1f0d('0x70')])){for(var _0x48c3d6=0x0;_0x48c3d6<_0x4999cd['query'][_0x1f0d('0x70')][_0x1f0d('0x3b')];_0x48c3d6+=0x1){socket[_0x1f0d('0x72')](_0x1f0d('0x76'),{'UserId':Number(_0x4999cd[_0x1f0d('0x36')][_0x1f0d('0x70')][_0x48c3d6]),'VoicePrefixId':Number(_0x4999cd[_0x1f0d('0x4a')]['id'])});}}else{socket[_0x1f0d('0x72')](_0x1f0d('0x76'),{'UserId':Number(_0x4999cd[_0x1f0d('0x36')]['ids']),'VoicePrefixId':Number(_0x4999cd[_0x1f0d('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5666b6,null))['catch'](handleError(_0x5666b6,null));};exports[_0x1f0d('0x77')]=function(_0x289e65,_0x5db5ff,_0x1d520d){var _0x126e59={};var _0x2b371c={};var _0x99821d;var _0x53ca84;return db['VoicePrefix'][_0x1f0d('0x78')]({'where':{'id':_0x289e65[_0x1f0d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5db5ff,null))[_0x1f0d('0x28')](function(_0x4057f9){if(_0x4057f9){_0x99821d=_0x4057f9;_0x2b371c['model']=_[_0x1f0d('0x35')](db[_0x1f0d('0x79')][_0x1f0d('0x30')]);_0x2b371c[_0x1f0d('0x36')]=_['keys'](_0x289e65[_0x1f0d('0x36')]);_0x2b371c[_0x1f0d('0x37')]=_[_0x1f0d('0x38')](_0x2b371c[_0x1f0d('0x32')],_0x2b371c['query']);_0x126e59['attributes']=_[_0x1f0d('0x38')](_0x2b371c[_0x1f0d('0x32')],qs['fields'](_0x289e65[_0x1f0d('0x36')]['fields']));_0x126e59[_0x1f0d('0x39')]=_0x126e59[_0x1f0d('0x39')]['length']?_0x126e59[_0x1f0d('0x39')]:_0x2b371c[_0x1f0d('0x32')];_0x126e59['order']=qs['sort'](_0x289e65['query'][_0x1f0d('0x3d')]);_0x126e59['where']=qs['filters'](_[_0x1f0d('0x3f')](_0x289e65[_0x1f0d('0x36')],_0x2b371c[_0x1f0d('0x37')]));if(_0x289e65[_0x1f0d('0x36')]['filter']){_0x126e59['where']=_[_0x1f0d('0x42')](_0x126e59['where'],{'$or':_[_0x1f0d('0x33')](_0x126e59[_0x1f0d('0x39')],function(_0x5d0fcc){var _0x94072e={};_0x94072e[_0x5d0fcc]={'$like':'%'+_0x289e65[_0x1f0d('0x36')][_0x1f0d('0x40')]+'%'};return _0x94072e;})});}_0x126e59=_[_0x1f0d('0x42')]({},_0x126e59,_0x289e65[_0x1f0d('0x43')]);return _0x99821d[_0x1f0d('0x77')](_0x126e59);}})[_0x1f0d('0x28')](function(_0x41ca91){if(_0x41ca91){_0x53ca84=_0x41ca91[_0x1f0d('0x3b')];if(!_0x289e65[_0x1f0d('0x36')]['hasOwnProperty'](_0x1f0d('0x7a'))){_0x126e59[_0x1f0d('0x23')]=qs[_0x1f0d('0x23')](_0x289e65[_0x1f0d('0x36')]['limit']);_0x126e59['offset']=qs[_0x1f0d('0x22')](_0x289e65[_0x1f0d('0x36')][_0x1f0d('0x22')]);}return _0x99821d[_0x1f0d('0x77')](_0x126e59);}})[_0x1f0d('0x28')](function(_0x32e0e2){if(_0x32e0e2){return _0x32e0e2?{'count':_0x53ca84,'rows':_0x32e0e2}:null;}})['then'](respondWithResult(_0x5db5ff,null))[_0x1f0d('0x48')](handleError(_0x5db5ff,null));}; \ No newline at end of file +var _0xdf43=['Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','sequelize','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','filter','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','name','index','map','VoicePrefix','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','merge','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','app','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate'];(function(_0x2a3405,_0x282cdf){var _0x467a0e=function(_0x2c0df5){while(--_0x2c0df5){_0x2a3405['push'](_0x2a3405['shift']());}};_0x467a0e(++_0x282cdf);}(_0xdf43,0x91));var _0x3df4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdf43[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x3df4('0x0'));var emlformat=require(_0x3df4('0x1'));var rimraf=require(_0x3df4('0x2'));var zipdir=require(_0x3df4('0x3'));var jsonpatch=require(_0x3df4('0x4'));var rp=require(_0x3df4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3df4('0x6'));var path=require(_0x3df4('0x7'));var sox=require(_0x3df4('0x8'));var csv=require(_0x3df4('0x9'));var ejs=require(_0x3df4('0xa'));var fs=require('fs');var _=require(_0x3df4('0xb'));var squel=require(_0x3df4('0xc'));var crypto=require(_0x3df4('0xd'));var jsforce=require(_0x3df4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3df4('0x9'));var querystring=require(_0x3df4('0xf'));var Papa=require(_0x3df4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3df4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3df4('0x12'));var logger=require('../../config/logger')(_0x3df4('0x13'));var utils=require(_0x3df4('0x14'));var config=require(_0x3df4('0x15'));var db=require('../../mysqldb')['db'];config[_0x3df4('0x16')]=_[_0x3df4('0x17')](config['redis'],{'host':_0x3df4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3df4('0x16')]));require(_0x3df4('0x19'))[_0x3df4('0x1a')](socket);function respondWithStatusCode(_0x53b956,_0x43a9c4){_0x43a9c4=_0x43a9c4||0xcc;return function(_0x42bcc8){if(_0x42bcc8){return _0x53b956[_0x3df4('0x1b')](_0x43a9c4);}return _0x53b956['status'](_0x43a9c4)['end']();};}function respondWithResult(_0x122f2b,_0x52d122){_0x52d122=_0x52d122||0xc8;return function(_0x6ec1d5){if(_0x6ec1d5){return _0x122f2b[_0x3df4('0x1c')](_0x52d122)[_0x3df4('0x1d')](_0x6ec1d5);}};}function respondWithFilteredResult(_0x4d2034,_0x4a19b4){return function(_0x41477b){if(_0x41477b){var _0x1e2afc=_0x41477b[_0x3df4('0x1e')],_0x35faf8=_0x4a19b4['offset'],_0x463821=_0x4a19b4[_0x3df4('0x1f')]+_0x4a19b4['limit'],_0x33db66;if(_0x463821>=_0x1e2afc){_0x463821=_0x1e2afc;_0x33db66=0xc8;}else{_0x33db66=0xce;}_0x4d2034[_0x3df4('0x1c')](_0x33db66);return _0x4d2034[_0x3df4('0x20')]('Content-Range',_0x35faf8+'-'+_0x463821+'/'+_0x1e2afc)[_0x3df4('0x1d')](_0x41477b);}return null;};}function patchUpdates(_0x462189){return function(_0x532669){try{jsonpatch[_0x3df4('0x21')](_0x532669,_0x462189,!![]);}catch(_0x4e2ed9){return BPromise[_0x3df4('0x22')](_0x4e2ed9);}return _0x532669[_0x3df4('0x23')]();};}function saveUpdates(_0xff126e,_0x2b37d4){return function(_0x1b4019){if(_0x1b4019){return _0x1b4019[_0x3df4('0x24')](_0xff126e)[_0x3df4('0x25')](function(_0x3fe0a5){return _0x3fe0a5;});}return null;};}function removeEntity(_0x2490fe,_0x1951d4){return function(_0x1a747e){if(_0x1a747e){return _0x1a747e[_0x3df4('0x26')]()[_0x3df4('0x25')](function(){var _0x45613a=_0x1a747e[_0x3df4('0x27')]({'plain':!![]});var _0x498a27=_0x3df4('0x28');return db[_0x3df4('0x29')][_0x3df4('0x26')]({'where':{'type':_0x498a27,'resourceId':_0x45613a['id']}})[_0x3df4('0x25')](function(){return _0x1a747e;});})[_0x3df4('0x25')](function(){_0x2490fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6fd75,_0x467230){return function(_0x58fdfa){if(!_0x58fdfa){_0xd6fd75[_0x3df4('0x1b')](0x194);}return _0x58fdfa;};}function handleError(_0x478752,_0x376754){_0x376754=_0x376754||0x1f4;return function(_0x23637a){logger[_0x3df4('0x2a')](_0x23637a['stack']);if(_0x23637a[_0x3df4('0x2b')]){delete _0x23637a['name'];}_0x478752[_0x3df4('0x1c')](_0x376754)['send'](_0x23637a);};}exports[_0x3df4('0x2c')]=function(_0x2e9f8b,_0x448138){var _0xb6229={},_0x195089={},_0x5e6779={'count':0x0,'rows':[]};var _0x2b6978=_[_0x3df4('0x2d')](db[_0x3df4('0x2e')]['rawAttributes'],function(_0x1e17ef){return{'name':_0x1e17ef[_0x3df4('0x2f')],'type':_0x1e17ef[_0x3df4('0x30')][_0x3df4('0x31')]};});_0x195089[_0x3df4('0x32')]=_[_0x3df4('0x2d')](_0x2b6978,_0x3df4('0x2b'));_0x195089[_0x3df4('0x33')]=_['keys'](_0x2e9f8b[_0x3df4('0x33')]);_0x195089[_0x3df4('0x34')]=_[_0x3df4('0x35')](_0x195089['model'],_0x195089[_0x3df4('0x33')]);_0xb6229['attributes']=_[_0x3df4('0x35')](_0x195089[_0x3df4('0x32')],qs[_0x3df4('0x36')](_0x2e9f8b[_0x3df4('0x33')][_0x3df4('0x36')]));_0xb6229[_0x3df4('0x37')]=_0xb6229[_0x3df4('0x37')][_0x3df4('0x38')]?_0xb6229[_0x3df4('0x37')]:_0x195089['model'];if(!_0x2e9f8b[_0x3df4('0x33')][_0x3df4('0x39')]('nolimit')){_0xb6229['limit']=qs[_0x3df4('0x3a')](_0x2e9f8b[_0x3df4('0x33')][_0x3df4('0x3a')]);_0xb6229[_0x3df4('0x1f')]=qs[_0x3df4('0x1f')](_0x2e9f8b[_0x3df4('0x33')]['offset']);}_0xb6229['order']=qs[_0x3df4('0x3b')](_0x2e9f8b[_0x3df4('0x33')][_0x3df4('0x3b')]);_0xb6229[_0x3df4('0x3c')]=qs[_0x3df4('0x34')](_[_0x3df4('0x3d')](_0x2e9f8b['query'],_0x195089[_0x3df4('0x34')]),_0x2b6978);if(_0x2e9f8b[_0x3df4('0x33')]['filter']){_0xb6229[_0x3df4('0x3c')]=_[_0x3df4('0x3e')](_0xb6229[_0x3df4('0x3c')],{'$or':_[_0x3df4('0x2d')](_0x2b6978,function(_0x385de3){if(_0x385de3[_0x3df4('0x30')]!=='VIRTUAL'){var _0x3cef1a={};_0x3cef1a[_0x385de3[_0x3df4('0x2b')]]={'$like':'%'+_0x2e9f8b[_0x3df4('0x33')]['filter']+'%'};return _0x3cef1a;}})});}_0xb6229=_[_0x3df4('0x3e')]({},_0xb6229,_0x2e9f8b[_0x3df4('0x3f')]);var _0x20c2e6={'where':_0xb6229[_0x3df4('0x3c')]};return db[_0x3df4('0x2e')]['count'](_0x20c2e6)['then'](function(_0x32c287){_0x5e6779[_0x3df4('0x1e')]=_0x32c287;if(_0x2e9f8b['query'][_0x3df4('0x40')]){_0xb6229[_0x3df4('0x41')]=[{'all':!![]}];}return db[_0x3df4('0x2e')][_0x3df4('0x42')](_0xb6229);})[_0x3df4('0x25')](function(_0x2038b7){_0x5e6779['rows']=_0x2038b7;return _0x5e6779;})[_0x3df4('0x25')](respondWithFilteredResult(_0x448138,_0xb6229))['catch'](handleError(_0x448138,null));};exports[_0x3df4('0x43')]=function(_0x400679,_0x5bf1d0){var _0x329f5e={'raw':![],'where':{'id':_0x400679[_0x3df4('0x44')]['id']}},_0x28cc5a={};_0x28cc5a[_0x3df4('0x32')]=_[_0x3df4('0x45')](db[_0x3df4('0x2e')][_0x3df4('0x46')]);_0x28cc5a[_0x3df4('0x33')]=_[_0x3df4('0x45')](_0x400679[_0x3df4('0x33')]);_0x28cc5a['filters']=_[_0x3df4('0x35')](_0x28cc5a[_0x3df4('0x32')],_0x28cc5a[_0x3df4('0x33')]);_0x329f5e['attributes']=_[_0x3df4('0x35')](_0x28cc5a[_0x3df4('0x32')],qs[_0x3df4('0x36')](_0x400679[_0x3df4('0x33')][_0x3df4('0x36')]));_0x329f5e['attributes']=_0x329f5e[_0x3df4('0x37')]['length']?_0x329f5e[_0x3df4('0x37')]:_0x28cc5a['model'];if(_0x400679['query'][_0x3df4('0x40')]){_0x329f5e[_0x3df4('0x41')]=[{'all':!![]}];}_0x329f5e=_['merge']({},_0x329f5e,_0x400679['options']);return db[_0x3df4('0x2e')][_0x3df4('0x47')](_0x329f5e)['then'](handleEntityNotFound(_0x5bf1d0,null))[_0x3df4('0x25')](respondWithResult(_0x5bf1d0,null))['catch'](handleError(_0x5bf1d0,null));};exports[_0x3df4('0x26')]=function(_0x3e17de,_0x5c65c2){return db[_0x3df4('0x2e')][_0x3df4('0x47')]({'where':{'id':_0x3e17de[_0x3df4('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c65c2,null))['then'](removeEntity(_0x5c65c2,null))[_0x3df4('0x48')](handleError(_0x5c65c2,null));};exports['describe']=function(_0x4ac6fc,_0x1b11c4){return db[_0x3df4('0x2e')]['describe']()[_0x3df4('0x25')](respondWithResult(_0x1b11c4,null))['catch'](handleError(_0x1b11c4,null));};exports[_0x3df4('0x49')]=function(_0x43337a,_0x300f38){var _0x56da45;return db['sequelize'][_0x3df4('0x4a')](function(_0x1af275){return db[_0x3df4('0x2e')][_0x3df4('0x49')](_0x43337a[_0x3df4('0x4b')],{'transaction':_0x1af275})[_0x3df4('0x25')](function(_0x11d7b9){_0x56da45=_0x11d7b9[_0x3df4('0x27')]({'plain':!![]});return db[_0x3df4('0x4c')][_0x3df4('0x47')]({'where':{'id':_0x56da45[_0x3df4('0x4d')]},'raw':!![]})[_0x3df4('0x25')](function(_0xc2e553){return createVoicePrefixExtensions(_0x56da45,_0xc2e553,_0x1af275);});});})[_0x3df4('0x25')](function(){var _0x23e33a=_0x43337a['user'][_0x3df4('0x27')]({'plain':!![]});if(!_0x23e33a)throw new Error(_0x3df4('0x4e'));if(_0x23e33a[_0x3df4('0x4f')]==='user'){var _0x480bd9=_0x56da45;return db[_0x3df4('0x50')][_0x3df4('0x47')]({'where':{'name':'VoicePrefixes','userProfileId':_0x23e33a[_0x3df4('0x51')]},'raw':!![]})[_0x3df4('0x25')](function(_0x31d8c2){if(_0x31d8c2&&_0x31d8c2[_0x3df4('0x52')]===0x0){return db['UserProfileResource'][_0x3df4('0x49')]({'name':_0x480bd9[_0x3df4('0x2b')],'resourceId':_0x480bd9['id'],'type':_0x31d8c2['name'],'sectionId':_0x31d8c2['id']},{})[_0x3df4('0x25')](function(){return _0x56da45;});}else{return _0x56da45;}})[_0x3df4('0x48')](function(_0x5225c6){logger[_0x3df4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5225c6);throw _0x5225c6;});}return _0x56da45;})[_0x3df4('0x25')](respondWithResult(_0x300f38,null))[_0x3df4('0x48')](handleError(_0x300f38,null));};function Extension(_0x43e2cf,_0x9428a2,_0x48b36d,_0x1b7b8c){this[_0x3df4('0x53')]=_0x3df4('0x54');this['exten']=_0x43e2cf;this[_0x3df4('0x55')]=_0x48b36d;this[_0x3df4('0x30')]='system';this[_0x3df4('0x56')]='Voice\x20Prefix\x20Extension';this[_0x3df4('0x57')]=_0x9428a2;this[_0x3df4('0x58')]=_0x1b7b8c;}function createVoicePrefixExtensions(_0x447013,_0x4d38a3,_0x28031b){return new BPromise(function(_0x30e755,_0x2a6e00){var _0x155ae9=new Extension(formatPrefixName(_0x447013['prefix']),0x1,_0x3df4('0x59'),_0x3df4('0x5a'));_0x155ae9[_0x3df4('0x5b')]=_0x447013['id'];return db['VoiceExtension']['create'](_0x155ae9,{'transaction':_0x28031b})[_0x3df4('0x25')](function(_0xe8ff6f){var _0x42e99f=_0xe8ff6f['get']({'plain':!![]});var _0x12e447=_['map'](addVoicePrefixExtensions(_0x447013,_0x4d38a3),function(_0x3e6ad9){_0x3e6ad9[_0x3df4('0x4d')]=_0x42e99f['id'];_0x3e6ad9['VoicePrefixId']=_0x447013['id'];return _0x3e6ad9;});return db[_0x3df4('0x4c')][_0x3df4('0x5c')](_0x12e447,{'transaction':_0x28031b})[_0x3df4('0x25')](function(_0x5b3bb3){if(!_0x5b3bb3){return _0x2a6e00(_0x3df4('0x5d'));}else{return _0x30e755(_0x5b3bb3);}})[_0x3df4('0x48')](function(_0x4a7bdc){return _0x2a6e00(_0x4a7bdc);});});;});};function addVoicePrefixExtensions(_0x2e7bbb,_0x21605c){var _0x47a7c7=[];var _0x1ac5c0=formatPrefixName(_0x2e7bbb[_0x3df4('0x5e')]);_0x47a7c7[_0x3df4('0x5f')](new Extension(_0x1ac5c0,0x2,_0x3df4('0x60'),_0x3df4('0x61')+_0x2e7bbb[_0x3df4('0x2b')]));if(_0x2e7bbb[_0x3df4('0x62')]){_0x47a7c7['push'](new Extension(_0x1ac5c0,0x3,_0x3df4('0x60'),_0x3df4('0x63')+_0x2e7bbb[_0x3df4('0x62')]));}else{_0x47a7c7[_0x3df4('0x5f')](new Extension(_0x1ac5c0,0x3,_0x3df4('0x59'),_0x3df4('0x64')));}_0x47a7c7['push'](new Extension(_0x1ac5c0,0x4,'goto',_0x21605c['context']+','+_0x3df4('0x65')+(0x8+_0x2e7bbb['name'][_0x3df4('0x38')])+'}'+','+0x1));return _0x47a7c7;}function formatPrefixName(_0x423b34){var _0x204c13='_';for(var _0x4b8f6c=0x0;_0x4b8f6c<_0x423b34['length'];_0x4b8f6c++){if(_0x423b34[_0x3df4('0x66')](_0x4b8f6c)=='-'){_0x204c13+=_0x423b34[_0x3df4('0x66')](_0x4b8f6c);}else{_0x204c13+='['+_0x423b34[_0x3df4('0x66')](_0x4b8f6c)+']';}}_0x204c13+='.';return _0x204c13;}exports[_0x3df4('0x24')]=function(_0x9024bd,_0x27a215,_0x23a076){var _0x52c26c=_0x9024bd['body'];_0x52c26c[_0x3df4('0x5e')]=_0x3df4('0x67')+_0x52c26c[_0x3df4('0x2b')]+'-';return db[_0x3df4('0x68')][_0x3df4('0x4a')](function(_0x4cc3b5){return db[_0x3df4('0x2e')][_0x3df4('0x24')](_0x52c26c,{'where':{'id':_0x52c26c['id']},'transaction':_0x4cc3b5})['then'](function(){return db[_0x3df4('0x4c')]['destroy']({'where':{'VoicePrefixId':_0x52c26c['id']},'transaction':_0x4cc3b5})[_0x3df4('0x25')](function(){return db[_0x3df4('0x4c')][_0x3df4('0x47')]({'where':{'id':_0x52c26c[_0x3df4('0x4d')]},'raw':!![]})[_0x3df4('0x25')](function(_0x45d5d4){return createVoicePrefixExtensions(_0x52c26c,_0x45d5d4,_0x4cc3b5);});});});})[_0x3df4('0x25')](function(){return db[_0x3df4('0x2e')]['findById'](_0x52c26c['id']);})[_0x3df4('0x25')](respondWithResult(_0x27a215,null))[_0x3df4('0x48')](handleError(_0x27a215,null));};exports[_0x3df4('0x69')]=function(_0x2a9751,_0x332c68,_0x37f23e){return db[_0x3df4('0x2e')][_0x3df4('0x47')]({'where':{'id':_0x2a9751[_0x3df4('0x44')]['id']}})[_0x3df4('0x25')](handleEntityNotFound(_0x332c68,null))[_0x3df4('0x25')](function(_0x1eca0e){if(_0x1eca0e){return _0x1eca0e[_0x3df4('0x69')](_0x2a9751['body'][_0x3df4('0x6a')],_[_0x3df4('0x6b')](_0x2a9751[_0x3df4('0x4b')],[_0x3df4('0x6a'),'id'])||{})['spread'](function(_0x4ce994){for(var _0x82f736=0x0;_0x82f736<_0x2a9751[_0x3df4('0x4b')][_0x3df4('0x6a')][_0x3df4('0x38')];_0x82f736+=0x1){socket[_0x3df4('0x6c')](_0x3df4('0x6d'),{'UserId':_0x2a9751['body'][_0x3df4('0x6a')][_0x82f736],'VoicePrefixId':_0x2a9751[_0x3df4('0x44')]['id']});}return _0x4ce994;});}})[_0x3df4('0x25')](respondWithResult(_0x332c68,null))[_0x3df4('0x48')](handleError(_0x332c68,null));};exports[_0x3df4('0x6e')]=function(_0x2c8cd2,_0x4ca72f,_0x69c39d){return db[_0x3df4('0x2e')][_0x3df4('0x47')]({'where':{'id':_0x2c8cd2[_0x3df4('0x44')]['id']}})[_0x3df4('0x25')](handleEntityNotFound(_0x4ca72f,null))[_0x3df4('0x25')](function(_0x8c900d){if(_0x8c900d){return _0x8c900d[_0x3df4('0x6e')](_0x2c8cd2[_0x3df4('0x33')][_0x3df4('0x6a')])['then'](function(){if(_[_0x3df4('0x6f')](_0x2c8cd2[_0x3df4('0x33')][_0x3df4('0x6a')])){for(var _0x4c6fe2=0x0;_0x4c6fe2<_0x2c8cd2[_0x3df4('0x33')][_0x3df4('0x6a')]['length'];_0x4c6fe2+=0x1){socket[_0x3df4('0x6c')](_0x3df4('0x70'),{'UserId':Number(_0x2c8cd2['query']['ids'][_0x4c6fe2]),'VoicePrefixId':Number(_0x2c8cd2[_0x3df4('0x44')]['id'])});}}else{socket[_0x3df4('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x2c8cd2['query'][_0x3df4('0x6a')]),'VoicePrefixId':Number(_0x2c8cd2[_0x3df4('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ca72f,null))[_0x3df4('0x48')](handleError(_0x4ca72f,null));};exports[_0x3df4('0x71')]=function(_0x53e371,_0x3bba83,_0x454117){var _0x588cdb={};var _0x4d8f2d={};var _0x591cec;var _0x3b26f8;return db[_0x3df4('0x2e')][_0x3df4('0x72')]({'where':{'id':_0x53e371['params']['id']}})[_0x3df4('0x25')](handleEntityNotFound(_0x3bba83,null))['then'](function(_0x3b5d5b){if(_0x3b5d5b){_0x591cec=_0x3b5d5b;_0x4d8f2d[_0x3df4('0x32')]=_[_0x3df4('0x45')](db[_0x3df4('0x73')][_0x3df4('0x46')]);_0x4d8f2d['query']=_[_0x3df4('0x45')](_0x53e371[_0x3df4('0x33')]);_0x4d8f2d[_0x3df4('0x34')]=_['intersection'](_0x4d8f2d[_0x3df4('0x32')],_0x4d8f2d[_0x3df4('0x33')]);_0x588cdb[_0x3df4('0x37')]=_[_0x3df4('0x35')](_0x4d8f2d[_0x3df4('0x32')],qs['fields'](_0x53e371['query'][_0x3df4('0x36')]));_0x588cdb[_0x3df4('0x37')]=_0x588cdb[_0x3df4('0x37')][_0x3df4('0x38')]?_0x588cdb[_0x3df4('0x37')]:_0x4d8f2d['model'];_0x588cdb[_0x3df4('0x74')]=qs[_0x3df4('0x3b')](_0x53e371[_0x3df4('0x33')][_0x3df4('0x3b')]);_0x588cdb['where']=qs[_0x3df4('0x34')](_[_0x3df4('0x3d')](_0x53e371[_0x3df4('0x33')],_0x4d8f2d[_0x3df4('0x34')]));if(_0x53e371[_0x3df4('0x33')][_0x3df4('0x75')]){_0x588cdb['where']=_[_0x3df4('0x3e')](_0x588cdb[_0x3df4('0x3c')],{'$or':_[_0x3df4('0x2d')](_0x588cdb['attributes'],function(_0x1fee7c){var _0x2c5827={};_0x2c5827[_0x1fee7c]={'$like':'%'+_0x53e371[_0x3df4('0x33')]['filter']+'%'};return _0x2c5827;})});}_0x588cdb=_[_0x3df4('0x3e')]({},_0x588cdb,_0x53e371[_0x3df4('0x3f')]);return _0x591cec[_0x3df4('0x71')](_0x588cdb);}})[_0x3df4('0x25')](function(_0x20c968){if(_0x20c968){_0x3b26f8=_0x20c968[_0x3df4('0x38')];if(!_0x53e371[_0x3df4('0x33')]['hasOwnProperty'](_0x3df4('0x76'))){_0x588cdb[_0x3df4('0x3a')]=qs['limit'](_0x53e371[_0x3df4('0x33')][_0x3df4('0x3a')]);_0x588cdb[_0x3df4('0x1f')]=qs['offset'](_0x53e371['query'][_0x3df4('0x1f')]);}return _0x591cec['getAgents'](_0x588cdb);}})[_0x3df4('0x25')](function(_0xafa1e1){if(_0xafa1e1){return _0xafa1e1?{'count':_0x3b26f8,'rows':_0xafa1e1}:null;}})[_0x3df4('0x25')](respondWithResult(_0x3bba83,null))[_0x3df4('0x48')](handleError(_0x3bba83,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index afe4a95..048ff9c 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x3e12a7,_0x34c2a6){_0x3e12a7=_0x3e12a7-0x0;var _0x135bb5=_0x3e74[_0x3e12a7];return _0x135bb5;};'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 diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b4228eb..7a13234 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 _0x6ccf=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0x6ccf,0x1d3));var _0xf6cc=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x6ccf[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0xf6cc('0x0'));var util=require(_0xf6cc('0x1'));var logger=require(_0xf6cc('0x2'))(_0xf6cc('0x3'));var moment=require(_0xf6cc('0x4'));var BPromise=require(_0xf6cc('0x5'));var rp=require(_0xf6cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6cc('0x7'));var config=require(_0xf6cc('0x8'));var attributes=require(_0xf6cc('0x9'));module[_0xf6cc('0xa')]=function(_0x66e31c,_0x200b44){return _0x66e31c[_0xf6cc('0xb')](_0xf6cc('0xc'),attributes,{'tableName':_0xf6cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4200=['bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x2f5de9,_0x2485be){var _0x890a7f=function(_0x1687da){while(--_0x1687da){_0x2f5de9['push'](_0x2f5de9['shift']());}};_0x890a7f(++_0x2485be);}(_0x4200,0xe1));var _0x0420=function(_0x8ba184,_0x45ed1b){_0x8ba184=_0x8ba184-0x0;var _0x4f0f8c=_0x4200[_0x8ba184];return _0x4f0f8c;};'use strict';var _=require('lodash');var util=require(_0x0420('0x0'));var logger=require(_0x0420('0x1'))(_0x0420('0x2'));var moment=require('moment');var BPromise=require(_0x0420('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0420('0x4'));var rimraf=require(_0x0420('0x5'));var config=require(_0x0420('0x6'));var attributes=require(_0x0420('0x7'));module[_0x0420('0x8')]=function(_0x1be5cb,_0x4ca8d4){return _0x1be5cb[_0x0420('0x9')](_0x0420('0xa'),attributes,{'tableName':_0x0420('0xb'),'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 6290514..cda2c21 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 _0xf4d2=['rpc','../../config/environment','client','http','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10b1d1,_0x39ce24){var _0x520b5d=function(_0x6e8552){while(--_0x6e8552){_0x10b1d1['push'](_0x10b1d1['shift']());}};_0x520b5d(++_0x39ce24);}(_0xf4d2,0x130));var _0x2f4d=function(_0x356afd,_0x1552ed){_0x356afd=_0x356afd-0x0;var _0x111e01=_0xf4d2[_0x356afd];return _0x111e01;};'use strict';var _=require(_0x2f4d('0x0'));var util=require(_0x2f4d('0x1'));var moment=require(_0x2f4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f4d('0x3'));var fs=require('fs');var Redis=require(_0x2f4d('0x4'));var db=require(_0x2f4d('0x5'))['db'];var utils=require(_0x2f4d('0x6'));var logger=require(_0x2f4d('0x7'))(_0x2f4d('0x8'));var config=require(_0x2f4d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f4d('0xa')][_0x2f4d('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2f4d('0xc'),'port':0x18eb});var socket=require(_0x2f4d('0xd'))(new Redis(config['redis']));require(_0x2f4d('0xe'))[_0x2f4d('0xf')](socket);function respondWithRpcPromise(_0x1cec5b,_0x224e8e,_0x535085){return new BPromise(function(_0x4c2105,_0x6cc709){return client['request'](_0x1cec5b,_0x535085)[_0x2f4d('0x10')](function(_0x2fdea2){logger['info'](_0x2f4d('0x11'),_0x224e8e,_0x2f4d('0x12'));logger['debug'](_0x2f4d('0x13'),_0x224e8e,_0x2f4d('0x12'),JSON['stringify'](_0x2fdea2));if(_0x2fdea2['error']){if(_0x2fdea2['error']['code']===0x1f4){logger[_0x2f4d('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x224e8e,_0x2fdea2[_0x2f4d('0x14')][_0x2f4d('0x15')]);return _0x6cc709(_0x2fdea2[_0x2f4d('0x14')]['message']);}logger[_0x2f4d('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x224e8e,_0x2fdea2[_0x2f4d('0x14')][_0x2f4d('0x15')]);return _0x4c2105(_0x2fdea2[_0x2f4d('0x14')][_0x2f4d('0x15')]);}else{logger[_0x2f4d('0x16')](_0x2f4d('0x11'),_0x224e8e,'request\x20sent');_0x4c2105(_0x2fdea2[_0x2f4d('0x17')][_0x2f4d('0x15')]);}})['catch'](function(_0x37407e){logger['error'](_0x2f4d('0x11'),_0x224e8e,_0x37407e);_0x6cc709(_0x37407e);});});} \ No newline at end of file +var _0xd15b=['redis','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x2a2dcb,_0x569773){var _0x2cadd5=function(_0x30a451){while(--_0x30a451){_0x2a2dcb['push'](_0x2a2dcb['shift']());}};_0x2cadd5(++_0x569773);}(_0xd15b,0x187));var _0xbd15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd15b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbd15('0x0'));var util=require(_0xbd15('0x1'));var moment=require(_0xbd15('0x2'));var BPromise=require(_0xbd15('0x3'));var rs=require(_0xbd15('0x4'));var fs=require('fs');var Redis=require(_0xbd15('0x5'));var db=require(_0xbd15('0x6'))['db'];var utils=require(_0xbd15('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd15('0x8')]['http']({'port':0x232a});config[_0xbd15('0x9')]=_['defaults'](config[_0xbd15('0x9')],{'host':_0xbd15('0xa'),'port':0x18eb});var socket=require(_0xbd15('0xb'))(new Redis(config[_0xbd15('0x9')]));require(_0xbd15('0xc'))[_0xbd15('0xd')](socket);function respondWithRpcPromise(_0x1ce8b1,_0x5f0303,_0x52dd2c){return new BPromise(function(_0x1e103e,_0x2c6420){return client['request'](_0x1ce8b1,_0x52dd2c)[_0xbd15('0xe')](function(_0xebe547){logger['info'](_0xbd15('0xf'),_0x5f0303,_0xbd15('0x10'));logger[_0xbd15('0x11')](_0xbd15('0x12'),_0x5f0303,_0xbd15('0x10'),JSON[_0xbd15('0x13')](_0xebe547));if(_0xebe547[_0xbd15('0x14')]){if(_0xebe547['error']['code']===0x1f4){logger['error'](_0xbd15('0xf'),_0x5f0303,_0xebe547['error'][_0xbd15('0x15')]);return _0x2c6420(_0xebe547[_0xbd15('0x14')][_0xbd15('0x15')]);}logger['error'](_0xbd15('0xf'),_0x5f0303,_0xebe547[_0xbd15('0x14')][_0xbd15('0x15')]);return _0x1e103e(_0xebe547[_0xbd15('0x14')][_0xbd15('0x15')]);}else{logger[_0xbd15('0x16')](_0xbd15('0xf'),_0x5f0303,_0xbd15('0x10'));_0x1e103e(_0xebe547[_0xbd15('0x17')]['message']);}})[_0xbd15('0x18')](function(_0x10f675){logger[_0xbd15('0x14')](_0xbd15('0xf'),_0x5f0303,_0x10f675);_0x2c6420(_0x10f675);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a8778ff..f971d2b 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 _0xbaad=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','register'];(function(_0x5028c8,_0x5a7ffe){var _0x4d08bc=function(_0x125652){while(--_0x125652){_0x5028c8['push'](_0x5028c8['shift']());}};_0x4d08bc(++_0x5a7ffe);}(_0xbaad,0x11a));var _0xdbaa=function(_0x471706,_0x4066c1){_0x471706=_0x471706-0x0;var _0xb46646=_0xbaad[_0x471706];return _0xb46646;};'use strict';var VoicePrefixEvents=require(_0xdbaa('0x0'));var events=[_0xdbaa('0x1'),_0xdbaa('0x2'),_0xdbaa('0x3')];function createListener(_0x3d64e0,_0x121753){return function(_0x54050f){_0x121753[_0xdbaa('0x4')](_0x3d64e0,_0x54050f);};}function removeListener(_0x2b7994,_0x45268b){return function(){VoicePrefixEvents['removeListener'](_0x2b7994,_0x45268b);};}exports[_0xdbaa('0x5')]=function(_0x5f27cb){for(var _0x30ace8=0x0,_0x2c1f26=events[_0xdbaa('0x6')];_0x30ace8<_0x2c1f26;_0x30ace8++){var _0x536cad=events[_0x30ace8];var _0x35a96b=createListener(_0xdbaa('0x7')+_0x536cad,_0x5f27cb);VoicePrefixEvents['on'](_0x536cad,_0x35a96b);}}; \ No newline at end of file +var _0xc84c=['register','length','voicePrefix:','./voicePrefix.events','save','emit','removeListener'];(function(_0x3b399f,_0x8c9abd){var _0x11c97c=function(_0x38b510){while(--_0x38b510){_0x3b399f['push'](_0x3b399f['shift']());}};_0x11c97c(++_0x8c9abd);}(_0xc84c,0x13e));var _0xcc84=function(_0x3ecc30,_0x75412b){_0x3ecc30=_0x3ecc30-0x0;var _0x2682bc=_0xc84c[_0x3ecc30];return _0x2682bc;};'use strict';var VoicePrefixEvents=require(_0xcc84('0x0'));var events=[_0xcc84('0x1'),'remove','update'];function createListener(_0x4d570c,_0x1089bf){return function(_0x576b80){_0x1089bf[_0xcc84('0x2')](_0x4d570c,_0x576b80);};}function removeListener(_0x205f0c,_0x254518){return function(){VoicePrefixEvents[_0xcc84('0x3')](_0x205f0c,_0x254518);};}exports[_0xcc84('0x4')]=function(_0x5b97b8){for(var _0x34cf4c=0x0,_0x4ee335=events[_0xcc84('0x5')];_0x34cf4c<_0x4ee335;_0x34cf4c++){var _0x1f3c7b=events[_0x34cf4c];var _0x9e143f=createListener(_0xcc84('0x6')+_0x1f3c7b,_0x5b97b8);VoicePrefixEvents['on'](_0x1f3c7b,_0x9e143f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 329c3bf..46933b1 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 _0x0f47=['getLists','create','post','/:id/clone','clone','/:id/teams','/:id/lists','addLists','/:id/blacklists','put','delete','destroy','removeTeams','removeLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','/:id/members','getMembers'];(function(_0x1894c8,_0x4ffbcc){var _0x13c192=function(_0x2e3ab9){while(--_0x2e3ab9){_0x1894c8['push'](_0x1894c8['shift']());}};_0x13c192(++_0x4ffbcc);}(_0x0f47,0x137));var _0x70f4=function(_0x9016ef,_0xa973e1){_0x9016ef=_0x9016ef-0x0;var _0x3e0652=_0x0f47[_0x9016ef];return _0x3e0652;};'use strict';var multer=require(_0x70f4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70f4('0x1'));var express=require(_0x70f4('0x2'));var router=express[_0x70f4('0x3')]();var auth=require(_0x70f4('0x4'));var interaction=require(_0x70f4('0x5'));var config=require(_0x70f4('0x6'));var controller=require(_0x70f4('0x7'));router[_0x70f4('0x8')]('/',auth[_0x70f4('0x9')](),controller[_0x70f4('0xa')]);router[_0x70f4('0x8')](_0x70f4('0xb'),auth[_0x70f4('0x9')](),controller[_0x70f4('0xc')]);router[_0x70f4('0x8')]('/:id/hoppers',auth[_0x70f4('0x9')](),controller[_0x70f4('0xd')]);router[_0x70f4('0x8')](_0x70f4('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x70f4('0x8')](_0x70f4('0xf'),auth['isAuthenticated'](),controller[_0x70f4('0x10')]);router[_0x70f4('0x8')]('/:id/hopper_black',auth[_0x70f4('0x9')](),controller[_0x70f4('0x11')]);router[_0x70f4('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x70f4('0x12')]);router[_0x70f4('0x8')](_0x70f4('0x13'),auth[_0x70f4('0x9')](),controller['getAgents']);router[_0x70f4('0x8')](_0x70f4('0x14'),auth['isAuthenticated'](),controller[_0x70f4('0x15')]);router[_0x70f4('0x8')]('/:id/lists',auth[_0x70f4('0x9')](),controller[_0x70f4('0x16')]);router[_0x70f4('0x8')]('/:id/blacklists',auth[_0x70f4('0x9')](),controller['getBlackLists']);router['post']('/',auth[_0x70f4('0x9')](),controller[_0x70f4('0x17')]);router[_0x70f4('0x18')](_0x70f4('0x19'),auth[_0x70f4('0x9')](),controller[_0x70f4('0x1a')]);router['post'](_0x70f4('0x1b'),auth[_0x70f4('0x9')](),controller['addTeams']);router[_0x70f4('0x18')](_0x70f4('0x13'),auth[_0x70f4('0x9')](),controller['addAgents']);router['post'](_0x70f4('0x1c'),auth[_0x70f4('0x9')](),controller[_0x70f4('0x1d')]);router['post'](_0x70f4('0x1e'),auth[_0x70f4('0x9')](),controller['addBlackLists']);router[_0x70f4('0x1f')](_0x70f4('0xb'),auth[_0x70f4('0x9')](),controller['update']);router[_0x70f4('0x20')](_0x70f4('0xb'),auth['isAuthenticated'](),controller[_0x70f4('0x21')]);router[_0x70f4('0x20')](_0x70f4('0x1b'),auth[_0x70f4('0x9')](),controller[_0x70f4('0x22')]);router['delete'](_0x70f4('0x13'),auth[_0x70f4('0x9')](),controller['removeAgents']);router['delete'](_0x70f4('0x1c'),auth[_0x70f4('0x9')](),controller[_0x70f4('0x23')]);router[_0x70f4('0x20')](_0x70f4('0x1e'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x70f4('0x24')]=router; \ No newline at end of file +var _0x76b7=['destroy','removeAgents','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','put','/:id','update','delete'];(function(_0x54f493,_0x385811){var _0x5f2b47=function(_0x2d2323){while(--_0x2d2323){_0x54f493['push'](_0x54f493['shift']());}};_0x5f2b47(++_0x385811);}(_0x76b7,0x1e5));var _0x776b=function(_0x6d1ca7,_0x3aa503){_0x6d1ca7=_0x6d1ca7-0x0;var _0x24fa1e=_0x76b7[_0x6d1ca7];return _0x24fa1e;};'use strict';var multer=require('multer');var util=require(_0x776b('0x0'));var path=require(_0x776b('0x1'));var timeout=require(_0x776b('0x2'));var express=require(_0x776b('0x3'));var router=express[_0x776b('0x4')]();var auth=require(_0x776b('0x5'));var interaction=require(_0x776b('0x6'));var config=require(_0x776b('0x7'));var controller=require('./voiceQueue.controller');router[_0x776b('0x8')]('/',auth[_0x776b('0x9')](),controller[_0x776b('0xa')]);router[_0x776b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x776b('0xb')]);router[_0x776b('0x8')](_0x776b('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x776b('0x8')](_0x776b('0xd'),auth[_0x776b('0x9')](),controller[_0x776b('0xe')]);router['get']('/:id/hopper_finals',auth[_0x776b('0x9')](),controller['getHopperFinals']);router[_0x776b('0x8')](_0x776b('0xf'),auth[_0x776b('0x9')](),controller[_0x776b('0x10')]);router[_0x776b('0x8')](_0x776b('0x11'),auth[_0x776b('0x9')](),controller[_0x776b('0x12')]);router['get'](_0x776b('0x13'),auth[_0x776b('0x9')](),controller['getAgents']);router['get'](_0x776b('0x14'),auth[_0x776b('0x9')](),controller['getMembers']);router['get'](_0x776b('0x15'),auth['isAuthenticated'](),controller[_0x776b('0x16')]);router[_0x776b('0x8')](_0x776b('0x17'),auth[_0x776b('0x9')](),controller[_0x776b('0x18')]);router[_0x776b('0x19')]('/',auth[_0x776b('0x9')](),controller[_0x776b('0x1a')]);router['post'](_0x776b('0x1b'),auth[_0x776b('0x9')](),controller[_0x776b('0x1c')]);router[_0x776b('0x19')](_0x776b('0x11'),auth[_0x776b('0x9')](),controller[_0x776b('0x1d')]);router[_0x776b('0x19')](_0x776b('0x13'),auth['isAuthenticated'](),controller[_0x776b('0x1e')]);router[_0x776b('0x19')](_0x776b('0x15'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x776b('0x17'),auth[_0x776b('0x9')](),controller['addBlackLists']);router[_0x776b('0x1f')](_0x776b('0x20'),auth['isAuthenticated'](),controller[_0x776b('0x21')]);router[_0x776b('0x22')](_0x776b('0x20'),auth[_0x776b('0x9')](),controller[_0x776b('0x23')]);router[_0x776b('0x22')](_0x776b('0x11'),auth[_0x776b('0x9')](),controller['removeTeams']);router[_0x776b('0x22')](_0x776b('0x13'),auth['isAuthenticated'](),controller[_0x776b('0x24')]);router[_0x776b('0x22')]('/:id/lists',auth[_0x776b('0x9')](),controller[_0x776b('0x25')]);router[_0x776b('0x22')](_0x776b('0x17'),auth[_0x776b('0x9')](),controller[_0x776b('0x26')]);module[_0x776b('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index bd3a0c4..27dc532 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(_0x27ffa0,_0x3e6c4a){var _0x37c18b=function(_0x3accb1){while(--_0x3accb1){_0x27ffa0['push'](_0x27ffa0['shift']());}};_0x37c18b(++_0x3e6c4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x4c8700,_0x25e672){var _0x16dcaa=function(_0x18c324){while(--_0x18c324){_0x4c8700['push'](_0x4c8700['shift']());}};_0x16dcaa(++_0x25e672);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 8099e84..3eda98c 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 _0x8bcb=['insert','phone','ContactId','select','field','NOW()','CmListId','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','into','fromQuery','scheduledAt','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','body','user','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','findOne','CmHopper','pick','VoiceQueueId','CmHopperHistory','getHopperFinals','hasOwnProperty','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','flatMap','forEach','penalty','sequelize','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','interface','voicePause','emit','userVoiceQueue:save','ids','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','union','transaction','removeTeams','addAgents','spread','isEmpty','SIP/%s','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always'];(function(_0x58214b,_0x5c8973){var _0x1d4b6b=function(_0x3cd030){while(--_0x3cd030){_0x58214b['push'](_0x58214b['shift']());}};_0x1d4b6b(++_0x5c8973);}(_0x8bcb,0xcf));var _0xb8bc=function(_0x1cb17b,_0x2b7991){_0x1cb17b=_0x1cb17b-0x0;var _0x41d1a7=_0x8bcb[_0x1cb17b];return _0x41d1a7;};'use strict';var pdf=require(_0xb8bc('0x0'));var emlformat=require(_0xb8bc('0x1'));var rimraf=require(_0xb8bc('0x2'));var zipdir=require(_0xb8bc('0x3'));var jsonpatch=require(_0xb8bc('0x4'));var rp=require(_0xb8bc('0x5'));var moment=require(_0xb8bc('0x6'));var BPromise=require(_0xb8bc('0x7'));var Mustache=require(_0xb8bc('0x8'));var util=require('util');var path=require(_0xb8bc('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8bc('0xa'));var fs=require('fs');var _=require(_0xb8bc('0xb'));var squel=require(_0xb8bc('0xc'));var crypto=require(_0xb8bc('0xd'));var jsforce=require(_0xb8bc('0xe'));var deskjs=require(_0xb8bc('0xf'));var toCsv=require(_0xb8bc('0x10'));var querystring=require(_0xb8bc('0x11'));var Papa=require(_0xb8bc('0x12'));var Redis=require('ioredis');var authService=require(_0xb8bc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb8bc('0x14'));var hardwareService=require(_0xb8bc('0x15'));var logger=require('../../config/logger')(_0xb8bc('0x16'));var utils=require(_0xb8bc('0x17'));var config=require(_0xb8bc('0x18'));var db=require(_0xb8bc('0x19'))['db'];config[_0xb8bc('0x1a')]=_[_0xb8bc('0x1b')](config['redis'],{'host':_0xb8bc('0x1c'),'port':0x18eb});var socket=require(_0xb8bc('0x1d'))(new Redis(config[_0xb8bc('0x1a')]));require(_0xb8bc('0x1e'))['register'](socket);function respondWithStatusCode(_0x2c7d95,_0x459f3f){_0x459f3f=_0x459f3f||0xcc;return function(_0x924525){if(_0x924525){return _0x2c7d95[_0xb8bc('0x1f')](_0x459f3f);}return _0x2c7d95[_0xb8bc('0x20')](_0x459f3f)['end']();};}function respondWithResult(_0x5cafec,_0x123a16){_0x123a16=_0x123a16||0xc8;return function(_0xb951a6){if(_0xb951a6){return _0x5cafec['status'](_0x123a16)[_0xb8bc('0x21')](_0xb951a6);}};}function respondWithFilteredResult(_0x3d5143,_0x2d4fe4){return function(_0x157eaa){if(_0x157eaa){var _0x84e371=_0x157eaa[_0xb8bc('0x22')],_0x548e06=_0x2d4fe4[_0xb8bc('0x23')],_0x378dec=_0x2d4fe4[_0xb8bc('0x23')]+_0x2d4fe4[_0xb8bc('0x24')],_0x1aa092;if(_0x378dec>=_0x84e371){_0x378dec=_0x84e371;_0x1aa092=0xc8;}else{_0x1aa092=0xce;}_0x3d5143[_0xb8bc('0x20')](_0x1aa092);return _0x3d5143[_0xb8bc('0x25')](_0xb8bc('0x26'),_0x548e06+'-'+_0x378dec+'/'+_0x84e371)[_0xb8bc('0x21')](_0x157eaa);}return null;};}function patchUpdates(_0x39b81b){return function(_0x29bb23){try{jsonpatch['apply'](_0x29bb23,_0x39b81b,!![]);}catch(_0x30d110){return BPromise[_0xb8bc('0x27')](_0x30d110);}return _0x29bb23[_0xb8bc('0x28')]();};}function saveUpdates(_0x10be90,_0x2fc0fb){return function(_0x1dd89e){if(_0x1dd89e){return _0x1dd89e[_0xb8bc('0x29')](_0x10be90)['then'](function(_0x587f94){return _0x587f94;});}return null;};}function removeEntity(_0x3229a6,_0x9ef3b3){return function(_0x620dc8){if(_0x620dc8){return _0x620dc8[_0xb8bc('0x2a')]()[_0xb8bc('0x2b')](function(){var _0xa298e7=_0x620dc8[_0xb8bc('0x2c')]({'plain':!![]});var _0x36d9e4=[{'name':_0xb8bc('0x2d'),'value':_0xb8bc('0x2e'),'ignore':![]},{'name':_0xb8bc('0x2f'),'value':_0xb8bc('0x30'),'ignore':![]}];var _0x3324a0=_(_0x36d9e4)[_0xb8bc('0x31')](_0xb8bc('0x32'))[_0xb8bc('0x33')](_0xb8bc('0x34'))['value']();if(_[_0xb8bc('0x35')](_0x3324a0,_0xa298e7[_0xb8bc('0x36')])){return;}var _0x1a2ab7=_['find'](_0x36d9e4,[_0xb8bc('0x34'),_0xa298e7[_0xb8bc('0x36')]])[_0xb8bc('0x37')];return db[_0xb8bc('0x38')]['destroy']({'where':{'type':_0x1a2ab7,'resourceId':_0xa298e7['id']}})['then'](function(){return _0x620dc8;});})[_0xb8bc('0x2b')](function(){_0x3229a6[_0xb8bc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103e19,_0x2957fc){return function(_0x5488ec){if(!_0x5488ec){_0x103e19[_0xb8bc('0x1f')](0x194);}return _0x5488ec;};}function handleError(_0x5a9b36,_0xac04b8){_0xac04b8=_0xac04b8||0x1f4;return function(_0x1d4758){logger[_0xb8bc('0x39')](_0x1d4758[_0xb8bc('0x3a')]);if(_0x1d4758[_0xb8bc('0x37')]){delete _0x1d4758[_0xb8bc('0x37')];}_0x5a9b36['status'](_0xac04b8)[_0xb8bc('0x3b')](_0x1d4758);};}exports[_0xb8bc('0x3c')]=function(_0x1ea75e,_0x2b9454){var _0x15fa1a={},_0x34f3a3={},_0xdf259a={'count':0x0,'rows':[]};var _0x201c68=_[_0xb8bc('0x33')](db[_0xb8bc('0x3d')][_0xb8bc('0x3e')],function(_0x5ca776){return{'name':_0x5ca776['fieldName'],'type':_0x5ca776['type'][_0xb8bc('0x3f')]};});_0x34f3a3[_0xb8bc('0x40')]=_[_0xb8bc('0x33')](_0x201c68,'name');_0x34f3a3[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x1ea75e['query']);_0x34f3a3[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x34f3a3['model'],_0x34f3a3[_0xb8bc('0x41')]);_0x15fa1a[_0xb8bc('0x45')]=_['intersection'](_0x34f3a3[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x1ea75e[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x15fa1a[_0xb8bc('0x45')]=_0x15fa1a[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x15fa1a[_0xb8bc('0x45')]:_0x34f3a3[_0xb8bc('0x40')];if(!_0x1ea75e[_0xb8bc('0x41')]['hasOwnProperty'](_0xb8bc('0x48'))){_0x15fa1a[_0xb8bc('0x24')]=qs[_0xb8bc('0x24')](_0x1ea75e[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x15fa1a[_0xb8bc('0x23')]=qs['offset'](_0x1ea75e[_0xb8bc('0x41')][_0xb8bc('0x23')]);}_0x15fa1a[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x1ea75e['query']['sort']);_0x15fa1a[_0xb8bc('0x4b')]=qs['filters'](_['pick'](_0x1ea75e[_0xb8bc('0x41')],_0x34f3a3['filters']),_0x201c68);if(_0x1ea75e['query'][_0xb8bc('0x31')]){_0x15fa1a[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x15fa1a[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x201c68,function(_0x4d5c10){if(_0x4d5c10[_0xb8bc('0x36')]!==_0xb8bc('0x4d')){var _0x1efe11={};_0x1efe11[_0x4d5c10[_0xb8bc('0x37')]]={'$like':'%'+_0x1ea75e[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x1efe11;}})});}_0x15fa1a=_[_0xb8bc('0x4c')]({},_0x15fa1a,_0x1ea75e['options']);var _0x36d708={'where':_0x15fa1a[_0xb8bc('0x4b')]};return db[_0xb8bc('0x3d')][_0xb8bc('0x22')](_0x36d708)[_0xb8bc('0x2b')](function(_0x5504b0){_0xdf259a['count']=_0x5504b0;if(_0x1ea75e[_0xb8bc('0x41')][_0xb8bc('0x4e')]){_0x15fa1a[_0xb8bc('0x4f')]=[{'all':!![]}];}return db[_0xb8bc('0x3d')][_0xb8bc('0x50')](_0x15fa1a);})['then'](function(_0x5388a5){_0xdf259a[_0xb8bc('0x51')]=_0x5388a5;return _0xdf259a;})['then'](respondWithFilteredResult(_0x2b9454,_0x15fa1a))[_0xb8bc('0x52')](handleError(_0x2b9454,null));};exports[_0xb8bc('0x53')]=function(_0x15e34c,_0x1822b0){var _0x59045a={'raw':![],'where':{'id':_0x15e34c[_0xb8bc('0x54')]['id']}},_0x2a385d={};_0x2a385d['model']=_[_0xb8bc('0x42')](db[_0xb8bc('0x3d')]['rawAttributes']);_0x2a385d[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x15e34c[_0xb8bc('0x41')]);_0x2a385d[_0xb8bc('0x43')]=_['intersection'](_0x2a385d[_0xb8bc('0x40')],_0x2a385d[_0xb8bc('0x41')]);_0x59045a['attributes']=_[_0xb8bc('0x44')](_0x2a385d[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x15e34c[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x59045a[_0xb8bc('0x45')]=_0x59045a[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x59045a['attributes']:_0x2a385d[_0xb8bc('0x40')];if(_0x15e34c[_0xb8bc('0x41')]['includeAll']){_0x59045a['include']=[{'all':!![]}];}_0x59045a=_[_0xb8bc('0x4c')]({},_0x59045a,_0x15e34c['options']);return db['VoiceQueue']['find'](_0x59045a)['then'](handleEntityNotFound(_0x1822b0,null))['then'](respondWithResult(_0x1822b0,null))[_0xb8bc('0x52')](handleError(_0x1822b0,null));};exports['create']=function(_0x10f4e2,_0x559e44){return db['VoiceQueue']['create'](_0x10f4e2[_0xb8bc('0x55')],{})[_0xb8bc('0x2b')](function(_0xb7a50d){var _0x1658cb=_0x10f4e2[_0xb8bc('0x56')][_0xb8bc('0x2c')]({'plain':!![]});if(!_0x1658cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1658cb['role']===_0xb8bc('0x56')){var _0x2cd209=_0xb7a50d[_0xb8bc('0x2c')]({'plain':!![]});var _0x4ac9f8=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':_0xb8bc('0x30')}];var _0x5689d9=_['find'](_0x4ac9f8,['value',_0x2cd209['type']])[_0xb8bc('0x37')];return db['UserProfileSection'][_0xb8bc('0x57')]({'where':{'name':_0x5689d9,'userProfileId':_0x1658cb[_0xb8bc('0x58')]},'raw':!![]})[_0xb8bc('0x2b')](function(_0x17575f){if(_0x17575f&&_0x17575f['autoAssociation']===0x0){return db[_0xb8bc('0x38')][_0xb8bc('0x59')]({'name':_0x2cd209[_0xb8bc('0x37')],'resourceId':_0x2cd209['id'],'type':_0x17575f[_0xb8bc('0x37')],'sectionId':_0x17575f['id']},{})['then'](function(){return _0xb7a50d;});}else{return _0xb7a50d;}})['catch'](function(_0x5d2162){logger[_0xb8bc('0x39')](_0xb8bc('0x5a'),_0x5d2162);throw _0x5d2162;});}return _0xb7a50d;})[_0xb8bc('0x2b')](respondWithResult(_0x559e44,0xc9))[_0xb8bc('0x52')](handleError(_0x559e44,null));};exports[_0xb8bc('0x5b')]=function(_0x546829,_0x1e23d8){var _0x39a937={'where':{'id':_0x546829[_0xb8bc('0x54')]['id']}},_0x253169={};_0x253169[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x3d')][_0xb8bc('0x3e')]);_0x39a937['attributes']=_[_0xb8bc('0x44')](_0x253169['model'],qs[_0xb8bc('0x46')](_0x546829[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x39a937[_0xb8bc('0x45')]=_0x39a937[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x39a937[_0xb8bc('0x45')]:_0x253169[_0xb8bc('0x40')];if(_0x546829['query'][_0xb8bc('0x4e')]){_0x39a937['include']=[{'all':!![]}];}_0x39a937=_[_0xb8bc('0x4c')]({},_0x39a937,_0x546829[_0xb8bc('0x5c')]);return db['VoiceQueue'][_0xb8bc('0x57')](_0x39a937)[_0xb8bc('0x2b')](handleEntityNotFound(_0x1e23d8,null))[_0xb8bc('0x2b')](function(_0x56732e){if(_0x56732e){var _0x5560dc=_0x56732e[_0xb8bc('0x2c')]({'plain':!![]});_0x5560dc=qs[_0xb8bc('0x5d')](_0x5560dc,['id',_0xb8bc('0x5e'),_0xb8bc('0x5f')]);_0x546829['body']=_[_0xb8bc('0x5d')](_0x546829[_0xb8bc('0x55')],['id','createdAt',_0xb8bc('0x5f')]);return db['VoiceQueue'][_0xb8bc('0x59')](_[_0xb8bc('0x4c')](_0x5560dc,_0x546829[_0xb8bc('0x55')]),{'include':_0x546829[_0xb8bc('0x41')][_0xb8bc('0x4e')]?[{'all':!![]}]:undefined})[_0xb8bc('0x2b')](function(_0x5c9c7e){var _0x4a2eb5=_0x546829[_0xb8bc('0x56')][_0xb8bc('0x2c')]({'plain':!![]});if(!_0x4a2eb5)throw new Error(_0xb8bc('0x60'));if(_0x4a2eb5[_0xb8bc('0x61')]===_0xb8bc('0x56')){var _0x931c24=_0x5c9c7e[_0xb8bc('0x2c')]({'plain':!![]});var _0x5e256c=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xb8bc('0x2f'),'value':_0xb8bc('0x30')}];var _0xf3552c=_['find'](_0x5e256c,[_0xb8bc('0x34'),_0x931c24['type']])['name'];return db[_0xb8bc('0x62')][_0xb8bc('0x57')]({'where':{'name':_0xf3552c,'userProfileId':_0x4a2eb5[_0xb8bc('0x58')]},'raw':!![]})[_0xb8bc('0x2b')](function(_0x359c79){if(_0x359c79&&_0x359c79[_0xb8bc('0x63')]===0x0){return db[_0xb8bc('0x38')][_0xb8bc('0x59')]({'name':_0x931c24[_0xb8bc('0x37')],'resourceId':_0x931c24['id'],'type':_0x359c79[_0xb8bc('0x37')],'sectionId':_0x359c79['id']},{})[_0xb8bc('0x2b')](function(){return _0x5c9c7e;});}else{return _0x5c9c7e;}})[_0xb8bc('0x52')](function(_0x533797){logger[_0xb8bc('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x533797);throw _0x533797;});}return _0x5c9c7e;});}})[_0xb8bc('0x2b')](respondWithResult(_0x1e23d8,0xc9))[_0xb8bc('0x52')](handleError(_0x1e23d8,null));};exports['update']=function(_0x76bb62,_0x57d069){if(_0x76bb62[_0xb8bc('0x55')]['id']){delete _0x76bb62[_0xb8bc('0x55')]['id'];}return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0x76bb62[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x57d069,null))[_0xb8bc('0x2b')](saveUpdates(_0x76bb62[_0xb8bc('0x55')],null))['then'](respondWithResult(_0x57d069,null))[_0xb8bc('0x52')](handleError(_0x57d069,null));};exports[_0xb8bc('0x2a')]=function(_0x4239a5,_0x970eee){return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0x4239a5[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x970eee,null))[_0xb8bc('0x2b')](removeEntity(_0x970eee,null))['catch'](handleError(_0x970eee,null));};exports['getHoppers']=function(_0x149516,_0x97c0de,_0x2e374b){var _0x14b8d4={'raw':![],'where':{}};var _0x177245={};var _0x640b7d={'count':0x0,'rows':[]};return db[_0xb8bc('0x3d')][_0xb8bc('0x64')]({'where':{'id':_0x149516[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x97c0de,null))[_0xb8bc('0x2b')](function(_0x5578ad){if(_0x5578ad){_0x177245[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x65')]['rawAttributes']);_0x177245[_0xb8bc('0x41')]=_['keys'](_0x149516['query']);_0x177245[_0xb8bc('0x43')]=_['intersection'](_0x177245[_0xb8bc('0x40')],_0x177245[_0xb8bc('0x41')]);_0x14b8d4[_0xb8bc('0x45')]=_['intersection'](_0x177245[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x149516[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x14b8d4[_0xb8bc('0x45')]=_0x14b8d4['attributes']['length']?_0x14b8d4[_0xb8bc('0x45')]:_0x177245[_0xb8bc('0x40')];if(!_0x149516[_0xb8bc('0x41')]['hasOwnProperty'](_0xb8bc('0x48'))){_0x14b8d4[_0xb8bc('0x24')]=qs[_0xb8bc('0x24')](_0x149516[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x14b8d4[_0xb8bc('0x23')]=qs['offset'](_0x149516['query'][_0xb8bc('0x23')]);}_0x14b8d4[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x149516[_0xb8bc('0x41')]['sort']);_0x14b8d4['where']=qs['filters'](_[_0xb8bc('0x66')](_0x149516[_0xb8bc('0x41')],_0x177245['filters']));_0x14b8d4[_0xb8bc('0x4b')][_0xb8bc('0x67')]=_0x5578ad['id'];if(_0x149516['query'][_0xb8bc('0x31')]){_0x14b8d4[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x14b8d4[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x14b8d4['attributes'],function(_0x20f173){var _0x102617={};_0x102617[_0x20f173]={'$like':'%'+_0x149516[_0xb8bc('0x41')]['filter']+'%'};return _0x102617;})});}_0x14b8d4=_[_0xb8bc('0x4c')]({},_0x14b8d4,_0x149516['options']);return db[_0xb8bc('0x65')][_0xb8bc('0x22')]({'where':_0x14b8d4['where']})[_0xb8bc('0x2b')](function(_0x502221){_0x640b7d[_0xb8bc('0x22')]=_0x502221;if(_0x149516[_0xb8bc('0x41')][_0xb8bc('0x4e')]){_0x14b8d4[_0xb8bc('0x4f')]=[{'all':!![]}];}return db[_0xb8bc('0x65')][_0xb8bc('0x50')](_0x14b8d4);})[_0xb8bc('0x2b')](function(_0x217327){_0x640b7d[_0xb8bc('0x51')]=_0x217327;return _0x640b7d;});}})[_0xb8bc('0x2b')](respondWithFilteredResult(_0x97c0de,_0x14b8d4))[_0xb8bc('0x52')](handleError(_0x97c0de,null));};exports['getHopperHistories']=function(_0x3a2e5b,_0x24e503,_0x44095d){var _0x1557f7={'raw':!![],'where':{}};var _0x30d138={};var _0x2930d6={'count':0x0,'rows':[]};return db[_0xb8bc('0x3d')][_0xb8bc('0x64')]({'where':{'id':_0x3a2e5b[_0xb8bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x24e503,null))[_0xb8bc('0x2b')](function(_0x2b0278){if(_0x2b0278){_0x30d138['model']=_['keys'](db[_0xb8bc('0x68')]['rawAttributes']);_0x30d138[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x3a2e5b[_0xb8bc('0x41')]);_0x30d138[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x30d138[_0xb8bc('0x40')],_0x30d138[_0xb8bc('0x41')]);_0x1557f7[_0xb8bc('0x45')]=_[_0xb8bc('0x44')](_0x30d138[_0xb8bc('0x40')],qs['fields'](_0x3a2e5b[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x1557f7[_0xb8bc('0x45')]=_0x1557f7[_0xb8bc('0x45')]['length']?_0x1557f7['attributes']:_0x30d138[_0xb8bc('0x40')];if(!_0x3a2e5b['query']['hasOwnProperty'](_0xb8bc('0x48'))){_0x1557f7[_0xb8bc('0x24')]=qs['limit'](_0x3a2e5b[_0xb8bc('0x41')]['limit']);_0x1557f7[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x3a2e5b[_0xb8bc('0x41')][_0xb8bc('0x23')]);}_0x1557f7[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x3a2e5b[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x1557f7[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_['pick'](_0x3a2e5b[_0xb8bc('0x41')],_0x30d138[_0xb8bc('0x43')]));_0x1557f7['where'][_0xb8bc('0x67')]=_0x2b0278['id'];if(_0x3a2e5b[_0xb8bc('0x41')]['filter']){_0x1557f7[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x1557f7[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x1557f7[_0xb8bc('0x45')],function(_0x4a404b){var _0x5250fd={};_0x5250fd[_0x4a404b]={'$like':'%'+_0x3a2e5b[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x5250fd;})});}_0x1557f7=_['merge']({},_0x1557f7,_0x3a2e5b['options']);return db[_0xb8bc('0x68')]['count']({'where':_0x1557f7[_0xb8bc('0x4b')]})[_0xb8bc('0x2b')](function(_0x5766df){_0x2930d6['count']=_0x5766df;if(_0x3a2e5b[_0xb8bc('0x41')][_0xb8bc('0x4e')]){_0x1557f7[_0xb8bc('0x4f')]=[{'all':!![]}];}return db[_0xb8bc('0x68')][_0xb8bc('0x50')](_0x1557f7);})[_0xb8bc('0x2b')](function(_0x2b5128){_0x2930d6['rows']=_0x2b5128;return _0x2930d6;});}})[_0xb8bc('0x2b')](respondWithFilteredResult(_0x24e503,_0x1557f7))[_0xb8bc('0x52')](handleError(_0x24e503,null));};exports[_0xb8bc('0x69')]=function(_0x45d584,_0x1232b8,_0x252da7){var _0x119571={'raw':!![],'where':{}};var _0x7cbe99={};var _0x1fd9eb={'count':0x0,'rows':[]};return db[_0xb8bc('0x3d')]['findOne']({'where':{'id':_0x45d584['params']['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x1232b8,null))[_0xb8bc('0x2b')](function(_0xabd171){if(_0xabd171){_0x7cbe99[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db['CmHopperFinal'][_0xb8bc('0x3e')]);_0x7cbe99['query']=_['keys'](_0x45d584[_0xb8bc('0x41')]);_0x7cbe99[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x7cbe99[_0xb8bc('0x40')],_0x7cbe99[_0xb8bc('0x41')]);_0x119571[_0xb8bc('0x45')]=_['intersection'](_0x7cbe99[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x45d584[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x119571[_0xb8bc('0x45')]=_0x119571[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x119571[_0xb8bc('0x45')]:_0x7cbe99[_0xb8bc('0x40')];if(!_0x45d584[_0xb8bc('0x41')][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x119571[_0xb8bc('0x24')]=qs['limit'](_0x45d584['query']['limit']);_0x119571[_0xb8bc('0x23')]=qs['offset'](_0x45d584[_0xb8bc('0x41')][_0xb8bc('0x23')]);}_0x119571[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x45d584[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x119571[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_[_0xb8bc('0x66')](_0x45d584[_0xb8bc('0x41')],_0x7cbe99[_0xb8bc('0x43')]));_0x119571['where'][_0xb8bc('0x67')]=_0xabd171['id'];if(_0x45d584['query'][_0xb8bc('0x31')]){_0x119571[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x119571['where'],{'$or':_[_0xb8bc('0x33')](_0x119571[_0xb8bc('0x45')],function(_0x39528b){var _0x299ec6={};_0x299ec6[_0x39528b]={'$like':'%'+_0x45d584[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x299ec6;})});}_0x119571=_[_0xb8bc('0x4c')]({},_0x119571,_0x45d584[_0xb8bc('0x5c')]);return db[_0xb8bc('0x6b')][_0xb8bc('0x22')]({'where':_0x119571[_0xb8bc('0x4b')]})[_0xb8bc('0x2b')](function(_0x5b9a7e){_0x1fd9eb[_0xb8bc('0x22')]=_0x5b9a7e;if(_0x45d584['query'][_0xb8bc('0x4e')]){_0x119571['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xb8bc('0x50')](_0x119571);})[_0xb8bc('0x2b')](function(_0x4fe6b4){_0x1fd9eb[_0xb8bc('0x51')]=_0x4fe6b4;return _0x1fd9eb;});}})['then'](respondWithFilteredResult(_0x1232b8,_0x119571))[_0xb8bc('0x52')](handleError(_0x1232b8,null));};exports['getHopperBlacks']=function(_0x48a64c,_0x3fa00,_0x21b277){var _0x256287={'raw':!![],'where':{}};var _0x41d607={};var _0x2212ec={'count':0x0,'rows':[]};return db[_0xb8bc('0x3d')]['findOne']({'where':{'id':_0x48a64c['params']['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x3fa00,null))[_0xb8bc('0x2b')](function(_0x6ac246){if(_0x6ac246){_0x41d607[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x6c')][_0xb8bc('0x3e')]);_0x41d607[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x48a64c['query']);_0x41d607[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x41d607[_0xb8bc('0x40')],_0x41d607['query']);_0x256287['attributes']=_['intersection'](_0x41d607[_0xb8bc('0x40')],qs['fields'](_0x48a64c[_0xb8bc('0x41')]['fields']));_0x256287[_0xb8bc('0x45')]=_0x256287[_0xb8bc('0x45')]['length']?_0x256287[_0xb8bc('0x45')]:_0x41d607[_0xb8bc('0x40')];if(!_0x48a64c[_0xb8bc('0x41')][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x256287[_0xb8bc('0x24')]=qs['limit'](_0x48a64c[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x256287[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x48a64c['query'][_0xb8bc('0x23')]);}_0x256287[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x48a64c[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x256287[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_['pick'](_0x48a64c['query'],_0x41d607['filters']));_0x256287[_0xb8bc('0x4b')]['VoiceQueueId']=_0x6ac246['id'];if(_0x48a64c[_0xb8bc('0x41')][_0xb8bc('0x31')]){_0x256287['where']=_[_0xb8bc('0x4c')](_0x256287[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x256287['attributes'],function(_0x5e19f7){var _0x2a170a={};_0x2a170a[_0x5e19f7]={'$like':'%'+_0x48a64c['query'][_0xb8bc('0x31')]+'%'};return _0x2a170a;})});}_0x256287=_[_0xb8bc('0x4c')]({},_0x256287,_0x48a64c['options']);return db['CmHopperBlack'][_0xb8bc('0x22')]({'where':_0x256287['where']})[_0xb8bc('0x2b')](function(_0x330236){_0x2212ec['count']=_0x330236;if(_0x48a64c[_0xb8bc('0x41')][_0xb8bc('0x4e')]){_0x256287[_0xb8bc('0x4f')]=[{'all':!![]}];}return db[_0xb8bc('0x6c')][_0xb8bc('0x50')](_0x256287);})['then'](function(_0x123bb8){_0x2212ec[_0xb8bc('0x51')]=_0x123bb8;return _0x2212ec;});}})[_0xb8bc('0x2b')](respondWithFilteredResult(_0x3fa00,_0x256287))[_0xb8bc('0x52')](handleError(_0x3fa00,null));};exports[_0xb8bc('0x6d')]=function(_0x2e281f,_0x4cca54,_0x313240){var _0x3e5ee4={};var _0x40d66f={};var _0x1d7fe9;var _0xb4f7e7;return db[_0xb8bc('0x3d')]['findOne']({'where':{'id':_0x2e281f[_0xb8bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x4cca54,null))[_0xb8bc('0x2b')](function(_0x36ea4b){if(_0x36ea4b){_0x1d7fe9=_0x36ea4b;_0x40d66f[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x6e')]['rawAttributes']);_0x40d66f['query']=_[_0xb8bc('0x42')](_0x2e281f[_0xb8bc('0x41')]);_0x40d66f[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x40d66f[_0xb8bc('0x40')],_0x40d66f[_0xb8bc('0x41')]);_0x3e5ee4[_0xb8bc('0x45')]=_[_0xb8bc('0x44')](_0x40d66f[_0xb8bc('0x40')],qs['fields'](_0x2e281f[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x3e5ee4[_0xb8bc('0x45')]=_0x3e5ee4[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x3e5ee4['attributes']:_0x40d66f[_0xb8bc('0x40')];_0x3e5ee4['order']=qs[_0xb8bc('0x4a')](_0x2e281f[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x3e5ee4[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_['pick'](_0x2e281f[_0xb8bc('0x41')],_0x40d66f[_0xb8bc('0x43')]));if(_0x2e281f[_0xb8bc('0x41')]['filter']){_0x3e5ee4['where']=_[_0xb8bc('0x4c')](_0x3e5ee4[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x3e5ee4[_0xb8bc('0x45')],function(_0x20cbc0){var _0x7d7a11={};_0x7d7a11[_0x20cbc0]={'$like':'%'+_0x2e281f[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x7d7a11;})});}_0x3e5ee4=_[_0xb8bc('0x4c')]({},_0x3e5ee4,_0x2e281f[_0xb8bc('0x5c')]);return _0x1d7fe9[_0xb8bc('0x6d')](_0x3e5ee4);}})[_0xb8bc('0x2b')](function(_0x207bda){if(_0x207bda){_0xb4f7e7=_0x207bda[_0xb8bc('0x47')];if(!_0x2e281f[_0xb8bc('0x41')][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x3e5ee4[_0xb8bc('0x24')]=qs[_0xb8bc('0x24')](_0x2e281f[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x3e5ee4[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x2e281f['query'][_0xb8bc('0x23')]);}return _0x1d7fe9['getTeams'](_0x3e5ee4);}})[_0xb8bc('0x2b')](function(_0x29f821){if(_0x29f821){return _0x29f821?{'count':_0xb4f7e7,'rows':_0x29f821}:null;}})[_0xb8bc('0x2b')](respondWithResult(_0x4cca54,null))[_0xb8bc('0x52')](handleError(_0x4cca54,null));};exports[_0xb8bc('0x6f')]=function(_0x3e3ff4,_0x133d16,_0x48f730){var _0x389548=_0x3e3ff4['body'][_0xb8bc('0x70')];var _0x386089=_[_0xb8bc('0x33')](_0x389548,'id');return db[_0xb8bc('0x6e')][_0xb8bc('0x50')]({'where':{'id':_0x386089},'attributes':['id'],'include':[{'model':db[_0xb8bc('0x71')],'as':_0xb8bc('0x72'),'attributes':['id','name',_0xb8bc('0x73'),'voicePause','interface'],'raw':!![]}]})[_0xb8bc('0x2b')](function(_0x354032){if(_0x354032){var _0xaa8a39=_[_0xb8bc('0x74')](_0x354032,function(_0x5aa732){var _0x287243=_0x5aa732[_0xb8bc('0x2c')]({'plain':!![]});_0x287243[_0xb8bc('0x72')][_0xb8bc('0x75')](function(_0x201124){_0x201124['penalty']=_[_0xb8bc('0x57')](_0x389548,{'id':_0x287243['id']})[_0xb8bc('0x76')];});return _0x287243[_0xb8bc('0x72')];});return db['VoiceQueue']['find']({'where':{'id':_0x3e3ff4[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](function(_0x4b63a){return db[_0xb8bc('0x77')]['transaction'](function(_0x3274ca){return _0x4b63a[_0xb8bc('0x6f')](_0x386089,{'transaction':_0x3274ca})[_0xb8bc('0x2b')](function(){return BPromise[_0xb8bc('0x78')](_0xaa8a39,function(_0x5f365a){return db['UserVoiceQueue'][_0xb8bc('0x79')]({'where':{'UserId':_0x5f365a['id'],'VoiceQueueId':_0x3e3ff4['params']['id']},'defaults':{'penalty':_0x5f365a[_0xb8bc('0x76')]},'transaction':_0x3274ca});});})['then'](function(){return BPromise['each'](_['filter'](_0xaa8a39,{'online':!![]}),function(_0x1d597d){return db[_0xb8bc('0x7a')][_0xb8bc('0x7b')]({'membername':_0x1d597d[_0xb8bc('0x37')],'UserId':_0x1d597d['id'],'queue_name':_0x4b63a[_0xb8bc('0x37')],'VoiceQueueId':_0x4b63a['id'],'interface':_[_0xb8bc('0x7c')](_0x1d597d['interface'])?util[_0xb8bc('0x7d')]('SIP/%s',_0x1d597d[_0xb8bc('0x37')]):_0x1d597d[_0xb8bc('0x7e')],'paused':_0x1d597d[_0xb8bc('0x7f')]||![],'penalty':_0x1d597d[_0xb8bc('0x76')]},{'transaction':_0x3274ca});});})[_0xb8bc('0x2b')](function(){_0xaa8a39[_0xb8bc('0x75')](function(_0x31a60a){socket[_0xb8bc('0x80')](_0xb8bc('0x81'),{'UserId':_0x31a60a['id'],'VoiceQueueId':_0x4b63a['id']});});});});});}})[_0xb8bc('0x2b')](respondWithStatusCode(_0x133d16,null))['catch'](handleError(_0x133d16,null));};exports['removeTeams']=function(_0x390c65,_0x16a43d,_0x3e26fd){return db[_0xb8bc('0x6e')][_0xb8bc('0x50')]({'where':{'id':_0x390c65['query'][_0xb8bc('0x82')]},'attributes':['id'],'include':[{'model':db[_0xb8bc('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb8bc('0x2b')](handleEntityNotFound(_0x16a43d,null))[_0xb8bc('0x2b')](function(_0x33ef37){var _0x48710d=_[_0xb8bc('0x33')](_0x33ef37,'id');var _0x110dfa=[];var _0x4b77ad=[];var _0x568be5=squel['select']();_0x568be5['field']('tq.TeamId')['from']('team_has_voice_queues','tq')[_0xb8bc('0x83')]('user_has_teams','ut',_0xb8bc('0x84'))[_0xb8bc('0x4b')](_0xb8bc('0x85'),_0x390c65['params']['id']);for(var _0x3a52d3=0x0;_0x3a52d3<_0x33ef37['length'];_0x3a52d3+=0x1){let _0x834777=_0x33ef37[_0x3a52d3];for(var _0x4c7fc0=0x0;_0x4c7fc0<_0x834777[_0xb8bc('0x72')][_0xb8bc('0x47')];_0x4c7fc0+=0x1){let _0x358480=_0x834777[_0xb8bc('0x72')][_0x4c7fc0];var _0x34597e=_0x568be5['clone']();_0x34597e[_0xb8bc('0x4b')](_0xb8bc('0x86'),_0x358480['id']);_0x4b77ad[_0xb8bc('0x87')](db[_0xb8bc('0x77')][_0xb8bc('0x41')](_0x34597e[_0xb8bc('0x88')](),{'type':db[_0xb8bc('0x77')][_0xb8bc('0x89')][_0xb8bc('0x8a')]})[_0xb8bc('0x2b')](function(_0x4fa686){if(_0x4fa686[_0xb8bc('0x47')]===0x1){return _0x358480['id'];}else{var _0x4ee025=_['every'](_[_0xb8bc('0x33')](_0x4fa686,'TeamId'),function(_0x5488fe){return _[_0xb8bc('0x35')](_0x48710d,_0x5488fe);});if(_0x4ee025){return _0x358480['id'];}}}));}}return BPromise['all'](_0x4b77ad)['then'](function(_0x1f7753){_0x110dfa=_(_0x110dfa)[_0xb8bc('0x8b')](_0x1f7753)['compact']()['value']();return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0x390c65[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](function(_0x482f3e){return db[_0xb8bc('0x77')][_0xb8bc('0x8c')](function(_0x5b4344){return _0x482f3e[_0xb8bc('0x8d')](_0x390c65[_0xb8bc('0x41')][_0xb8bc('0x82')],{'transaction':_0x5b4344})[_0xb8bc('0x2b')](function(){if(!_['isEmpty'](_0x110dfa)){return _0x482f3e['removeAgents'](_0x110dfa,{'transaction':_0x5b4344})[_0xb8bc('0x2b')](function(){return db[_0xb8bc('0x7a')][_0xb8bc('0x2a')]({'where':{'VoiceQueueId':_0x390c65[_0xb8bc('0x54')]['id'],'UserId':_0x110dfa},'transaction':_0x5b4344});});}})['then'](function(){_0x110dfa['forEach'](function(_0x18add0){socket[_0xb8bc('0x80')]('userVoiceQueue:remove',{'UserId':_0x18add0,'VoiceQueueId':_0x482f3e['id']});});});});});});})[_0xb8bc('0x2b')](respondWithStatusCode(_0x16a43d,null))[_0xb8bc('0x52')](handleError(_0x16a43d,null));};exports[_0xb8bc('0x8e')]=function(_0x4d9bcf,_0x31e11f,_0x5e5761){var _0x518b7a,_0x118890;return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0x4d9bcf[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x31e11f,null))[_0xb8bc('0x2b')](function(_0x47f943){if(_0x47f943){_0x118890=_0x47f943;return _0x47f943[_0xb8bc('0x8e')](_0x4d9bcf[_0xb8bc('0x55')]['ids'],_[_0xb8bc('0x5d')](_0x4d9bcf[_0xb8bc('0x55')],[_0xb8bc('0x82'),'id'])||{})[_0xb8bc('0x8f')](function(_0x1a709d){for(var _0x39ee18=0x0;_0x39ee18<_0x4d9bcf[_0xb8bc('0x55')][_0xb8bc('0x82')][_0xb8bc('0x47')];_0x39ee18+=0x1){socket[_0xb8bc('0x80')](_0xb8bc('0x81'),{'UserId':_0x4d9bcf[_0xb8bc('0x55')][_0xb8bc('0x82')][_0x39ee18],'VoiceQueueId':_0x4d9bcf[_0xb8bc('0x54')]['id']});}return _0x1a709d;});}})[_0xb8bc('0x2b')](function(_0x380f47){_0x518b7a=_0x380f47||[];if(_0x118890){return db[_0xb8bc('0x71')]['findAll']({'where':{'id':_0x4d9bcf[_0xb8bc('0x55')]['ids']},'attributes':['id',_0xb8bc('0x37'),_0xb8bc('0x73'),_0xb8bc('0x7f'),_0xb8bc('0x7e')],'raw':!![]});}})[_0xb8bc('0x2b')](function(_0x40eaa8){if(!_[_0xb8bc('0x90')](_0x40eaa8)){var _0x510445=[];for(var _0x1b55b3=0x0;_0x1b55b3<_0x40eaa8[_0xb8bc('0x47')];_0x1b55b3++){if(_0x40eaa8[_0x1b55b3][_0xb8bc('0x73')]){_0x510445['push'](db[_0xb8bc('0x7a')][_0xb8bc('0x7b')]({'membername':_0x40eaa8[_0x1b55b3][_0xb8bc('0x37')],'UserId':_0x40eaa8[_0x1b55b3]['id'],'queue_name':_0x118890['name'],'VoiceQueueId':_0x118890['id'],'interface':_[_0xb8bc('0x7c')](_0x40eaa8[_0x1b55b3][_0xb8bc('0x7e')])?util['format'](_0xb8bc('0x91'),_0x40eaa8[_0x1b55b3]['name']):_0x40eaa8[_0x1b55b3][_0xb8bc('0x7e')],'paused':_0x40eaa8[_0x1b55b3][_0xb8bc('0x7f')]||![],'penalty':_0x4d9bcf[_0xb8bc('0x55')]['penalty']||0x0}));}}return BPromise['all'](_0x510445);}})[_0xb8bc('0x2b')](function(){return _0x518b7a;})['then'](respondWithResult(_0x31e11f,null))['catch'](handleError(_0x31e11f,null));};exports['removeAgents']=function(_0x20e285,_0x4176a8,_0x386c60){return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0x20e285[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x4176a8,null))['then'](function(_0x9f7ed7){if(_0x9f7ed7){return _0x9f7ed7[_0xb8bc('0x92')](_0x20e285[_0xb8bc('0x41')]['ids'])[_0xb8bc('0x2b')](function(){if(_[_0xb8bc('0x93')](_0x20e285[_0xb8bc('0x41')][_0xb8bc('0x82')])){for(var _0x8953e9=0x0;_0x8953e9<_0x20e285[_0xb8bc('0x41')]['ids']['length'];_0x8953e9+=0x1){socket[_0xb8bc('0x80')](_0xb8bc('0x94'),{'UserId':Number(_0x20e285[_0xb8bc('0x41')]['ids'][_0x8953e9]),'VoiceQueueId':Number(_0x20e285['params']['id'])});}}else{socket[_0xb8bc('0x80')](_0xb8bc('0x94'),{'UserId':Number(_0x20e285[_0xb8bc('0x41')]['ids']),'VoiceQueueId':Number(_0x20e285['params']['id'])});}});}})[_0xb8bc('0x2b')](function(_0x3d1179){return db['UserVoiceQueueRt'][_0xb8bc('0x2a')]({'where':{'VoiceQueueId':_0x20e285[_0xb8bc('0x54')]['id'],'UserId':_0x20e285[_0xb8bc('0x41')][_0xb8bc('0x82')]}})[_0xb8bc('0x2b')](function(){return _0x3d1179;});})[_0xb8bc('0x2b')](respondWithStatusCode(_0x4176a8,null))[_0xb8bc('0x52')](handleError(_0x4176a8,null));};exports[_0xb8bc('0x95')]=function(_0x5add6b,_0x322a5e,_0xe1f62b){var _0x413555={};var _0x4f6194={};var _0xe56c18;var _0x4f30b2;return db[_0xb8bc('0x3d')][_0xb8bc('0x64')]({'where':{'id':_0x5add6b[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x322a5e,null))[_0xb8bc('0x2b')](function(_0x12741a){if(_0x12741a){_0xe56c18=_0x12741a;_0x4f6194[_0xb8bc('0x40')]=_['keys'](db['User'][_0xb8bc('0x3e')]);_0x4f6194[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x5add6b['query']);_0x4f6194[_0xb8bc('0x43')]=_['intersection'](_0x4f6194['model'],_0x4f6194[_0xb8bc('0x41')]);_0x413555[_0xb8bc('0x45')]=_[_0xb8bc('0x44')](_0x4f6194['model'],qs[_0xb8bc('0x46')](_0x5add6b[_0xb8bc('0x41')]['fields']));_0x413555['attributes']=_0x413555['attributes'][_0xb8bc('0x47')]?_0x413555[_0xb8bc('0x45')]:_0x4f6194[_0xb8bc('0x40')];_0x413555[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x5add6b[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x413555[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_[_0xb8bc('0x66')](_0x5add6b[_0xb8bc('0x41')],_0x4f6194[_0xb8bc('0x43')]));if(_0x5add6b[_0xb8bc('0x41')]['filter']){_0x413555[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x413555['where'],{'$or':_[_0xb8bc('0x33')](_0x413555[_0xb8bc('0x45')],function(_0x35837c){var _0x477960={};_0x477960[_0x35837c]={'$like':'%'+_0x5add6b[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x477960;})});}_0x413555=_[_0xb8bc('0x4c')]({},_0x413555,_0x5add6b[_0xb8bc('0x5c')]);return _0xe56c18[_0xb8bc('0x95')](_0x413555);}})[_0xb8bc('0x2b')](function(_0x344ad4){if(_0x344ad4){_0x4f30b2=_0x344ad4[_0xb8bc('0x47')];if(!_0x5add6b[_0xb8bc('0x41')][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x413555[_0xb8bc('0x24')]=qs['limit'](_0x5add6b[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x413555[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x5add6b[_0xb8bc('0x41')]['offset']);}return _0xe56c18['getAgents'](_0x413555);}})['then'](function(_0x152e8c){if(_0x152e8c){return _0x152e8c?{'count':_0x4f30b2,'rows':_0x152e8c}:null;}})[_0xb8bc('0x2b')](respondWithResult(_0x322a5e,null))[_0xb8bc('0x52')](handleError(_0x322a5e,null));};exports[_0xb8bc('0x96')]=function(_0x146e4e,_0x4c4f06,_0x5884ec){var _0x53e9d6={};var _0x3e0fd3={};var _0x2bdf3d;var _0xb89324;return db[_0xb8bc('0x3d')]['findOne']({'where':{'id':_0x146e4e[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x4c4f06,null))[_0xb8bc('0x2b')](function(_0x461ab0){if(_0x461ab0){_0x2bdf3d=_0x461ab0;_0x3e0fd3[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x7a')][_0xb8bc('0x3e')]);_0x3e0fd3[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x146e4e[_0xb8bc('0x41')]);_0x3e0fd3[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0x3e0fd3[_0xb8bc('0x40')],_0x3e0fd3[_0xb8bc('0x41')]);_0x53e9d6['attributes']=_[_0xb8bc('0x44')](_0x3e0fd3[_0xb8bc('0x40')],qs['fields'](_0x146e4e[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x53e9d6[_0xb8bc('0x45')]=_0x53e9d6[_0xb8bc('0x45')]['length']?_0x53e9d6[_0xb8bc('0x45')]:_0x3e0fd3[_0xb8bc('0x40')];_0x53e9d6[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x146e4e[_0xb8bc('0x41')]['sort']);_0x53e9d6['where']=qs[_0xb8bc('0x43')](_[_0xb8bc('0x66')](_0x146e4e[_0xb8bc('0x41')],_0x3e0fd3[_0xb8bc('0x43')]));if(_0x146e4e[_0xb8bc('0x41')]['filter']){_0x53e9d6[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x53e9d6[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x53e9d6[_0xb8bc('0x45')],function(_0x16c57f){var _0xd7d7d6={};_0xd7d7d6[_0x16c57f]={'$like':'%'+_0x146e4e['query']['filter']+'%'};return _0xd7d7d6;})});}_0x53e9d6=_['merge']({},_0x53e9d6,_0x146e4e[_0xb8bc('0x5c')]);return _0x2bdf3d[_0xb8bc('0x96')](_0x53e9d6);}})[_0xb8bc('0x2b')](function(_0x589320){if(_0x589320){_0xb89324=_0x589320[_0xb8bc('0x47')];if(!_0x146e4e[_0xb8bc('0x41')]['hasOwnProperty'](_0xb8bc('0x48'))){_0x53e9d6[_0xb8bc('0x24')]=qs['limit'](_0x146e4e[_0xb8bc('0x41')]['limit']);_0x53e9d6[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x146e4e[_0xb8bc('0x41')][_0xb8bc('0x23')]);}return _0x2bdf3d[_0xb8bc('0x96')](_0x53e9d6);}})[_0xb8bc('0x2b')](function(_0x2085ed){return _0x2085ed?{'count':_0xb89324,'rows':_0x2085ed}:null;})[_0xb8bc('0x2b')](respondWithResult(_0x4c4f06,null))[_0xb8bc('0x52')](handleError(_0x4c4f06,null));};exports[_0xb8bc('0x97')]=function(_0x3ea6e6,_0x34cd81,_0x58f1b5){var _0x584938={};var _0x3d7877={};var _0x2eb55c;var _0x53be52;return db['VoiceQueue']['findOne']({'where':{'id':_0x3ea6e6[_0xb8bc('0x54')]['id']}})['then'](handleEntityNotFound(_0x34cd81,null))[_0xb8bc('0x2b')](function(_0x1546c4){if(_0x1546c4){_0x2eb55c=_0x1546c4;_0x3d7877[_0xb8bc('0x40')]=_[_0xb8bc('0x42')](db[_0xb8bc('0x98')][_0xb8bc('0x3e')]);_0x3d7877[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x3ea6e6[_0xb8bc('0x41')]);_0x3d7877['filters']=_[_0xb8bc('0x44')](_0x3d7877['model'],_0x3d7877[_0xb8bc('0x41')]);_0x584938[_0xb8bc('0x45')]=_[_0xb8bc('0x44')](_0x3d7877[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x3ea6e6['query'][_0xb8bc('0x46')]));_0x584938[_0xb8bc('0x45')]=_0x584938[_0xb8bc('0x45')]['length']?_0x584938['attributes']:_0x3d7877[_0xb8bc('0x40')];_0x584938[_0xb8bc('0x49')]=qs[_0xb8bc('0x4a')](_0x3ea6e6[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x584938[_0xb8bc('0x4b')]=qs[_0xb8bc('0x43')](_[_0xb8bc('0x66')](_0x3ea6e6[_0xb8bc('0x41')],_0x3d7877[_0xb8bc('0x43')]));if(_0x3ea6e6[_0xb8bc('0x41')][_0xb8bc('0x31')]){_0x584938[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x584938[_0xb8bc('0x4b')],{'$or':_[_0xb8bc('0x33')](_0x584938[_0xb8bc('0x45')],function(_0x1bd7c7){var _0x3068d3={};_0x3068d3[_0x1bd7c7]={'$like':'%'+_0x3ea6e6[_0xb8bc('0x41')]['filter']+'%'};return _0x3068d3;})});}_0x584938=_[_0xb8bc('0x4c')]({},_0x584938,_0x3ea6e6[_0xb8bc('0x5c')]);return _0x2eb55c[_0xb8bc('0x97')](_0x584938);}})[_0xb8bc('0x2b')](function(_0x5a41f3){if(_0x5a41f3){_0x53be52=_0x5a41f3['length'];if(!_0x3ea6e6['query'][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x584938['limit']=qs[_0xb8bc('0x24')](_0x3ea6e6[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x584938[_0xb8bc('0x23')]=qs['offset'](_0x3ea6e6['query'][_0xb8bc('0x23')]);}return _0x2eb55c['getLists'](_0x584938);}})[_0xb8bc('0x2b')](function(_0x11f1ab){if(_0x11f1ab){return _0x11f1ab?{'count':_0x53be52,'rows':_0x11f1ab}:null;}})[_0xb8bc('0x2b')](respondWithResult(_0x34cd81,null))[_0xb8bc('0x52')](handleError(_0x34cd81,null));};exports['addLists']=function(_0x1c912f,_0x40a248,_0x15d501){var _0x1053b6,_0x36abf6;return db[_0xb8bc('0x3d')]['find']({'where':{'id':_0x1c912f['params']['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x40a248,null))[_0xb8bc('0x2b')](function(_0x367740){if(_0x367740){_0x36abf6=_0x367740;return _0x367740['addLists'](_0x1c912f[_0xb8bc('0x55')]['ids'],_[_0xb8bc('0x5d')](_0x1c912f[_0xb8bc('0x55')],['ids','id'])||{});}return null;})[_0xb8bc('0x8f')](function(_0x33b0d6){var _0x4cfcbb;_0x1053b6=_0x33b0d6||[];var _0xf23a47=[];if(_0x33b0d6){for(var _0x3c9f0d=0x0;_0x3c9f0d<_0x33b0d6['length'];_0x3c9f0d+=0x1){var _0x15288b=_0x33b0d6[_0x3c9f0d][_0xb8bc('0x2c')]({'plain':!![]});_0x36abf6[_0xb8bc('0x99')]=_0x1c912f[_0xb8bc('0x55')][_0xb8bc('0x99')]?_0x1c912f[_0xb8bc('0x55')][_0xb8bc('0x99')]:_0x36abf6[_0xb8bc('0x99')];switch(_0x36abf6[_0xb8bc('0x99')]){case _0xb8bc('0x9a'):_0x4cfcbb=squel[_0xb8bc('0x9b')]()['into']('cm_hopper')['fromQuery']([_0xb8bc('0x9c'),'scheduledAt',_0xb8bc('0x9d'),'ListId',_0xb8bc('0x67'),_0xb8bc('0x5e'),_0xb8bc('0x5f')],squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')](_0xb8bc('0x9c'),_0xb8bc('0x9c'))['field'](_0xb8bc('0xa0'),'scheduledAt')[_0xb8bc('0x9f')]('id','ContactId')[_0xb8bc('0x9f')](_0x15288b[_0xb8bc('0xa1')][_0xb8bc('0x88')](),_0xb8bc('0xa2'))[_0xb8bc('0x9f')](_0x1c912f[_0xb8bc('0x54')]['id'][_0xb8bc('0x88')](),_0xb8bc('0x67'))[_0xb8bc('0x9f')](_0xb8bc('0xa0'),_0xb8bc('0x5e'))['field'](_0xb8bc('0xa0'),'updatedAt')[_0xb8bc('0xa3')](_0xb8bc('0xa4'))[_0xb8bc('0x4b')]('deletedAt\x20IS\x20NULL')[_0xb8bc('0x4b')](_0xb8bc('0xa5'),_0x15288b['CmListId'][_0xb8bc('0x88')]())[_0xb8bc('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xb8bc('0x4b')](_0xb8bc('0xa6'),squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')](_0xb8bc('0xa7'))[_0xb8bc('0xa3')](_0xb8bc('0xa8'))[_0xb8bc('0x4b')](_0xb8bc('0x85'),_0x1c912f[_0xb8bc('0x54')]['id'][_0xb8bc('0x88')]()))[_0xb8bc('0x4b')](_0xb8bc('0xa6'),squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')](_0xb8bc('0xa9'))[_0xb8bc('0xa3')](_0xb8bc('0xaa'))[_0xb8bc('0x4b')]('VoiceQueueId\x20=\x20?',_0x1c912f['params']['id']['toString']())))[_0xb8bc('0x88')]();break;case'onlyIfOpen':_0x4cfcbb=squel[_0xb8bc('0x9b')]()[_0xb8bc('0xab')](_0xb8bc('0xaa'))[_0xb8bc('0xac')](['phone',_0xb8bc('0xad'),_0xb8bc('0x9d'),'ListId',_0xb8bc('0x67'),_0xb8bc('0x5e'),_0xb8bc('0x5f')],squel['select']()[_0xb8bc('0x9f')]('phone',_0xb8bc('0x9c'))[_0xb8bc('0x9f')](_0xb8bc('0xa0'),'scheduledAt')[_0xb8bc('0x9f')]('id',_0xb8bc('0x9d'))[_0xb8bc('0x9f')](_0x15288b[_0xb8bc('0xa1')][_0xb8bc('0x88')](),_0xb8bc('0xa2'))[_0xb8bc('0x9f')](_0x1c912f[_0xb8bc('0x54')]['id']['toString'](),_0xb8bc('0x67'))[_0xb8bc('0x9f')]('NOW()',_0xb8bc('0x5e'))[_0xb8bc('0x9f')](_0xb8bc('0xa0'),_0xb8bc('0x5f'))['from']('cm_contacts')[_0xb8bc('0x4b')]('deletedAt\x20IS\x20NULL')[_0xb8bc('0x4b')](_0xb8bc('0xa5'),_0x15288b[_0xb8bc('0xa1')][_0xb8bc('0x88')]())[_0xb8bc('0x4b')](_0xb8bc('0xae'))[_0xb8bc('0x4b')](_0xb8bc('0xa6'),squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')](_0xb8bc('0xa9'))[_0xb8bc('0xa3')](_0xb8bc('0xaa'))['where']('VoiceQueueId\x20=\x20?',_0x1c912f[_0xb8bc('0x54')]['id'][_0xb8bc('0x88')]())))[_0xb8bc('0x88')]();break;default:_0x4cfcbb=squel['insert']()[_0xb8bc('0xab')]('cm_hopper')[_0xb8bc('0xac')]([_0xb8bc('0x9c'),_0xb8bc('0xad'),_0xb8bc('0x9d'),_0xb8bc('0xa2'),_0xb8bc('0x67'),'createdAt',_0xb8bc('0x5f')],squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')]('phone','phone')[_0xb8bc('0x9f')](_0xb8bc('0xa0'),'scheduledAt')[_0xb8bc('0x9f')]('id',_0xb8bc('0x9d'))['field'](_0x15288b[_0xb8bc('0xa1')]['toString'](),_0xb8bc('0xa2'))[_0xb8bc('0x9f')](_0x1c912f[_0xb8bc('0x54')]['id'][_0xb8bc('0x88')](),_0xb8bc('0x67'))[_0xb8bc('0x9f')]('NOW()','createdAt')[_0xb8bc('0x9f')](_0xb8bc('0xa0'),_0xb8bc('0x5f'))[_0xb8bc('0xa3')](_0xb8bc('0xa4'))[_0xb8bc('0x4b')](_0xb8bc('0xaf'))['where'](_0xb8bc('0xa5'),_0x15288b['CmListId']['toString']())['where'](_0xb8bc('0xae')))[_0xb8bc('0x88')]();}_0xf23a47['push'](db[_0xb8bc('0x77')][_0xb8bc('0x41')](_0x4cfcbb));}return BPromise[_0xb8bc('0xb0')](_0xf23a47);}})['then'](function(){return _0x1053b6;})['then'](respondWithResult(_0x40a248,null))['catch'](handleError(_0x40a248,null));};exports['removeLists']=function(_0x1c68b9,_0x379d96,_0x5b38ed){return db['VoiceQueue'][_0xb8bc('0x57')]({'where':{'id':_0x1c68b9[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x379d96,null))[_0xb8bc('0x2b')](function(_0x110bc6){if(_0x110bc6){return _0x110bc6[_0xb8bc('0xb1')](_0x1c68b9['query'][_0xb8bc('0x82')]);}})[_0xb8bc('0x2b')](function(_0x5f3edd){if(_0x5f3edd){return db['CmHopper'][_0xb8bc('0x2a')]({'where':{'ListId':_0x1c68b9[_0xb8bc('0x41')]['ids'],'VoiceQueueId':_0x1c68b9[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](function(){return _0x5f3edd;});}})[_0xb8bc('0x2b')](respondWithStatusCode(_0x379d96,null))[_0xb8bc('0x52')](handleError(_0x379d96,null));};exports[_0xb8bc('0xb2')]=function(_0x185dcd,_0x2a387d,_0x16d1b6){var _0x58c10e={};var _0xdc4bc5={};var _0x1c1bd1;var _0x3043d2;return db[_0xb8bc('0x3d')][_0xb8bc('0x64')]({'where':{'id':_0x185dcd[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x2a387d,null))[_0xb8bc('0x2b')](function(_0x2b36b1){if(_0x2b36b1){_0x1c1bd1=_0x2b36b1;_0xdc4bc5[_0xb8bc('0x40')]=_['keys'](db['CmList'][_0xb8bc('0x3e')]);_0xdc4bc5[_0xb8bc('0x41')]=_[_0xb8bc('0x42')](_0x185dcd['query']);_0xdc4bc5[_0xb8bc('0x43')]=_[_0xb8bc('0x44')](_0xdc4bc5[_0xb8bc('0x40')],_0xdc4bc5[_0xb8bc('0x41')]);_0x58c10e[_0xb8bc('0x45')]=_[_0xb8bc('0x44')](_0xdc4bc5[_0xb8bc('0x40')],qs[_0xb8bc('0x46')](_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x46')]));_0x58c10e['attributes']=_0x58c10e[_0xb8bc('0x45')][_0xb8bc('0x47')]?_0x58c10e[_0xb8bc('0x45')]:_0xdc4bc5[_0xb8bc('0x40')];_0x58c10e[_0xb8bc('0x49')]=qs['sort'](_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x4a')]);_0x58c10e['where']=qs[_0xb8bc('0x43')](_[_0xb8bc('0x66')](_0x185dcd[_0xb8bc('0x41')],_0xdc4bc5[_0xb8bc('0x43')]));if(_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x31')]){_0x58c10e[_0xb8bc('0x4b')]=_[_0xb8bc('0x4c')](_0x58c10e['where'],{'$or':_[_0xb8bc('0x33')](_0x58c10e['attributes'],function(_0x51dbf8){var _0x1f2537={};_0x1f2537[_0x51dbf8]={'$like':'%'+_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x31')]+'%'};return _0x1f2537;})});}_0x58c10e=_[_0xb8bc('0x4c')]({},_0x58c10e,_0x185dcd[_0xb8bc('0x5c')]);return _0x1c1bd1[_0xb8bc('0xb2')](_0x58c10e);}})[_0xb8bc('0x2b')](function(_0x36c8f3){if(_0x36c8f3){_0x3043d2=_0x36c8f3[_0xb8bc('0x47')];if(!_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x6a')](_0xb8bc('0x48'))){_0x58c10e[_0xb8bc('0x24')]=qs[_0xb8bc('0x24')](_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x24')]);_0x58c10e[_0xb8bc('0x23')]=qs[_0xb8bc('0x23')](_0x185dcd[_0xb8bc('0x41')][_0xb8bc('0x23')]);}return _0x1c1bd1[_0xb8bc('0xb2')](_0x58c10e);}})[_0xb8bc('0x2b')](function(_0x481a40){if(_0x481a40){return _0x481a40?{'count':_0x3043d2,'rows':_0x481a40}:null;}})[_0xb8bc('0x2b')](respondWithResult(_0x2a387d,null))[_0xb8bc('0x52')](handleError(_0x2a387d,null));};exports[_0xb8bc('0xb3')]=function(_0x2bdf6b,_0x4235ae,_0x789d01){var _0x761259,_0x160345;return db[_0xb8bc('0x3d')]['find']({'where':{'id':_0x2bdf6b['params']['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x4235ae,null))[_0xb8bc('0x2b')](function(_0x2bf480){if(_0x2bf480){_0x160345=_0x2bf480;return _0x2bf480[_0xb8bc('0xb3')](_0x2bdf6b[_0xb8bc('0x55')][_0xb8bc('0x82')],_[_0xb8bc('0x5d')](_0x2bdf6b[_0xb8bc('0x55')],['ids','id'])||{});}return null;})[_0xb8bc('0x8f')](function(_0x423136){var _0x4c389f;_0x761259=_0x423136||[];var _0x58a34f=[];if(_0x423136){for(var _0x449773=0x0;_0x449773<_0x423136['length'];_0x449773+=0x1){var _0x2b6ea8=_0x423136[_0x449773][_0xb8bc('0x2c')]({'plain':!![]});_0x4c389f=squel['insert']()[_0xb8bc('0xab')](_0xb8bc('0xb4'))[_0xb8bc('0xac')]([_0xb8bc('0x9c'),_0xb8bc('0x9d'),_0xb8bc('0xa2'),_0xb8bc('0x67'),'createdAt','updatedAt'],squel[_0xb8bc('0x9e')]()[_0xb8bc('0x9f')]('phone','phone')[_0xb8bc('0x9f')]('id',_0xb8bc('0x9d'))[_0xb8bc('0x9f')](_0x2b6ea8[_0xb8bc('0xa1')]['toString'](),_0xb8bc('0xa2'))[_0xb8bc('0x9f')](_0x2bdf6b[_0xb8bc('0x54')]['id']['toString'](),_0xb8bc('0x67'))['field'](_0xb8bc('0xa0'),'createdAt')[_0xb8bc('0x9f')](_0xb8bc('0xa0'),_0xb8bc('0x5f'))['from'](_0xb8bc('0xa4'))[_0xb8bc('0x4b')](_0xb8bc('0xaf'))['where']('ListId\x20=\x20?',_0x2b6ea8[_0xb8bc('0xa1')][_0xb8bc('0x88')]())[_0xb8bc('0x4b')](_0xb8bc('0xae')))['toString']();_0x58a34f['push'](db[_0xb8bc('0x77')][_0xb8bc('0x41')](_0x4c389f));}return BPromise[_0xb8bc('0xb0')](_0x58a34f);}})[_0xb8bc('0x2b')](function(){return _0x761259;})[_0xb8bc('0x2b')](respondWithResult(_0x4235ae,null))[_0xb8bc('0x52')](handleError(_0x4235ae,null));};exports['removeBlackLists']=function(_0xbdd021,_0x3a5cf0,_0x19a363){return db[_0xb8bc('0x3d')][_0xb8bc('0x57')]({'where':{'id':_0xbdd021[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](handleEntityNotFound(_0x3a5cf0,null))['then'](function(_0x4a5932){if(_0x4a5932){return _0x4a5932['removeBlackLists'](_0xbdd021['query'][_0xb8bc('0x82')]);}})['then'](function(_0x552e49){if(_0x552e49){return db['CmHopperBlack'][_0xb8bc('0x2a')]({'where':{'ListId':_0xbdd021[_0xb8bc('0x41')][_0xb8bc('0x82')],'VoiceQueueId':_0xbdd021[_0xb8bc('0x54')]['id']}})[_0xb8bc('0x2b')](function(){return _0x552e49;});}})[_0xb8bc('0x2b')](respondWithStatusCode(_0x3a5cf0,null))['catch'](handleError(_0x3a5cf0,null));}; \ No newline at end of file +var _0x15d5=['fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','QueueCampaigns','params','findOne','CmHopper','VoiceQueueId','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','online','voicePause','interface','forEach','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','penalty','emit','userVoiceQueue:save','removeTeams','Agents','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','all','union','compact','ids','isEmpty','userVoiceQueue:remove','addAgents','spread','removeAgents','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','ListId','select','phone','scheduledAt','ContactId','CmListId','toString','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','./voiceQueue.socket','register','status','end','json','count','offset','limit','set','apply','update','then','destroy','get','outbound','filter','ignore','value','includes','type','name','UserProfileResource','sendStatus','error','stack','send','index','map','VoiceQueue','rawAttributes'];(function(_0x3f4932,_0x34425e){var _0xafc18b=function(_0x45f50a){while(--_0x45f50a){_0x3f4932['push'](_0x3f4932['shift']());}};_0xafc18b(++_0x34425e);}(_0x15d5,0x7e));var _0x515d=function(_0x22d2b9,_0x3a9312){_0x22d2b9=_0x22d2b9-0x0;var _0x8c44ef=_0x15d5[_0x22d2b9];return _0x8c44ef;};'use strict';var pdf=require(_0x515d('0x0'));var emlformat=require(_0x515d('0x1'));var rimraf=require(_0x515d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x515d('0x3'));var rp=require(_0x515d('0x4'));var moment=require(_0x515d('0x5'));var BPromise=require(_0x515d('0x6'));var Mustache=require(_0x515d('0x7'));var util=require('util');var path=require(_0x515d('0x8'));var sox=require('sox');var csv=require(_0x515d('0x9'));var ejs=require(_0x515d('0xa'));var fs=require('fs');var _=require(_0x515d('0xb'));var squel=require(_0x515d('0xc'));var crypto=require(_0x515d('0xd'));var jsforce=require(_0x515d('0xe'));var deskjs=require(_0x515d('0xf'));var toCsv=require(_0x515d('0x9'));var querystring=require(_0x515d('0x10'));var Papa=require(_0x515d('0x11'));var Redis=require('ioredis');var authService=require(_0x515d('0x12'));var qs=require(_0x515d('0x13'));var as=require(_0x515d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x515d('0x15'));var utils=require(_0x515d('0x16'));var config=require(_0x515d('0x17'));var db=require('../../mysqldb')['db'];config[_0x515d('0x18')]=_[_0x515d('0x19')](config[_0x515d('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x515d('0x18')]));require(_0x515d('0x1a'))[_0x515d('0x1b')](socket);function respondWithStatusCode(_0x23e507,_0x232758){_0x232758=_0x232758||0xcc;return function(_0x1a1df7){if(_0x1a1df7){return _0x23e507['sendStatus'](_0x232758);}return _0x23e507[_0x515d('0x1c')](_0x232758)[_0x515d('0x1d')]();};}function respondWithResult(_0x462c4c,_0x224c25){_0x224c25=_0x224c25||0xc8;return function(_0x52be4f){if(_0x52be4f){return _0x462c4c['status'](_0x224c25)[_0x515d('0x1e')](_0x52be4f);}};}function respondWithFilteredResult(_0x4c21a0,_0x4d3b11){return function(_0x176082){if(_0x176082){var _0x435be0=_0x176082[_0x515d('0x1f')],_0x26a955=_0x4d3b11[_0x515d('0x20')],_0x5d27df=_0x4d3b11[_0x515d('0x20')]+_0x4d3b11[_0x515d('0x21')],_0x52db60;if(_0x5d27df>=_0x435be0){_0x5d27df=_0x435be0;_0x52db60=0xc8;}else{_0x52db60=0xce;}_0x4c21a0['status'](_0x52db60);return _0x4c21a0[_0x515d('0x22')]('Content-Range',_0x26a955+'-'+_0x5d27df+'/'+_0x435be0)[_0x515d('0x1e')](_0x176082);}return null;};}function patchUpdates(_0x6e834a){return function(_0xcb6759){try{jsonpatch[_0x515d('0x23')](_0xcb6759,_0x6e834a,!![]);}catch(_0x1bb372){return BPromise['reject'](_0x1bb372);}return _0xcb6759['save']();};}function saveUpdates(_0x15f54e,_0x3a8106){return function(_0x3fa849){if(_0x3fa849){return _0x3fa849[_0x515d('0x24')](_0x15f54e)[_0x515d('0x25')](function(_0x3be20a){return _0x3be20a;});}return null;};}function removeEntity(_0x3ea406,_0x25a983){return function(_0x519445){if(_0x519445){return _0x519445[_0x515d('0x26')]()[_0x515d('0x25')](function(){var _0x377e32=_0x519445[_0x515d('0x27')]({'plain':!![]});var _0x1be2ab=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x515d('0x28'),'ignore':![]}];var _0x6298ab=_(_0x1be2ab)[_0x515d('0x29')](_0x515d('0x2a'))['map'](_0x515d('0x2b'))[_0x515d('0x2b')]();if(_[_0x515d('0x2c')](_0x6298ab,_0x377e32[_0x515d('0x2d')])){return;}var _0x19d7d0=_['find'](_0x1be2ab,[_0x515d('0x2b'),_0x377e32['type']])[_0x515d('0x2e')];return db[_0x515d('0x2f')][_0x515d('0x26')]({'where':{'type':_0x19d7d0,'resourceId':_0x377e32['id']}})['then'](function(){return _0x519445;});})[_0x515d('0x25')](function(){_0x3ea406[_0x515d('0x1c')](0xcc)[_0x515d('0x1d')]();});}};}function handleEntityNotFound(_0x4647dd,_0x240256){return function(_0x5251d5){if(!_0x5251d5){_0x4647dd[_0x515d('0x30')](0x194);}return _0x5251d5;};}function handleError(_0x51fddb,_0x5c80ae){_0x5c80ae=_0x5c80ae||0x1f4;return function(_0x22d222){logger[_0x515d('0x31')](_0x22d222[_0x515d('0x32')]);if(_0x22d222[_0x515d('0x2e')]){delete _0x22d222[_0x515d('0x2e')];}_0x51fddb[_0x515d('0x1c')](_0x5c80ae)[_0x515d('0x33')](_0x22d222);};}exports[_0x515d('0x34')]=function(_0x2b35aa,_0xebbd86){var _0x59203b={},_0x1af3e9={},_0x28818b={'count':0x0,'rows':[]};var _0x180530=_[_0x515d('0x35')](db[_0x515d('0x36')][_0x515d('0x37')],function(_0x571732){return{'name':_0x571732[_0x515d('0x38')],'type':_0x571732[_0x515d('0x2d')][_0x515d('0x39')]};});_0x1af3e9[_0x515d('0x3a')]=_[_0x515d('0x35')](_0x180530,_0x515d('0x2e'));_0x1af3e9['query']=_['keys'](_0x2b35aa['query']);_0x1af3e9[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x1af3e9[_0x515d('0x3a')],_0x1af3e9[_0x515d('0x3d')]);_0x59203b[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x1af3e9[_0x515d('0x3a')],qs['fields'](_0x2b35aa['query'][_0x515d('0x3f')]));_0x59203b['attributes']=_0x59203b[_0x515d('0x3e')][_0x515d('0x40')]?_0x59203b[_0x515d('0x3e')]:_0x1af3e9['model'];if(!_0x2b35aa['query'][_0x515d('0x41')](_0x515d('0x42'))){_0x59203b['limit']=qs[_0x515d('0x21')](_0x2b35aa[_0x515d('0x3d')][_0x515d('0x21')]);_0x59203b[_0x515d('0x20')]=qs[_0x515d('0x20')](_0x2b35aa['query'][_0x515d('0x20')]);}_0x59203b[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x2b35aa[_0x515d('0x3d')][_0x515d('0x44')]);_0x59203b[_0x515d('0x45')]=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x2b35aa[_0x515d('0x3d')],_0x1af3e9[_0x515d('0x3b')]),_0x180530);if(_0x2b35aa[_0x515d('0x3d')]['filter']){_0x59203b[_0x515d('0x45')]=_[_0x515d('0x47')](_0x59203b[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x180530,function(_0x102ffd){if(_0x102ffd[_0x515d('0x2d')]!==_0x515d('0x48')){var _0x485efc={};_0x485efc[_0x102ffd[_0x515d('0x2e')]]={'$like':'%'+_0x2b35aa[_0x515d('0x3d')][_0x515d('0x29')]+'%'};return _0x485efc;}})});}_0x59203b=_[_0x515d('0x47')]({},_0x59203b,_0x2b35aa[_0x515d('0x49')]);var _0xa1e520={'where':_0x59203b[_0x515d('0x45')]};return db[_0x515d('0x36')][_0x515d('0x1f')](_0xa1e520)['then'](function(_0x23d698){_0x28818b[_0x515d('0x1f')]=_0x23d698;if(_0x2b35aa[_0x515d('0x3d')][_0x515d('0x4a')]){_0x59203b[_0x515d('0x4b')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x59203b);})[_0x515d('0x25')](function(_0x59f84c){_0x28818b['rows']=_0x59f84c;return _0x28818b;})[_0x515d('0x25')](respondWithFilteredResult(_0xebbd86,_0x59203b))[_0x515d('0x4c')](handleError(_0xebbd86,null));};exports[_0x515d('0x4d')]=function(_0x2515af,_0x3851c8){var _0x251d58={'raw':![],'where':{'id':_0x2515af['params']['id']}},_0x526dff={};_0x526dff['model']=_[_0x515d('0x4e')](db[_0x515d('0x36')][_0x515d('0x37')]);_0x526dff[_0x515d('0x3d')]=_['keys'](_0x2515af[_0x515d('0x3d')]);_0x526dff[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x526dff['model'],_0x526dff['query']);_0x251d58['attributes']=_[_0x515d('0x3c')](_0x526dff[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x2515af[_0x515d('0x3d')][_0x515d('0x3f')]));_0x251d58[_0x515d('0x3e')]=_0x251d58['attributes'][_0x515d('0x40')]?_0x251d58[_0x515d('0x3e')]:_0x526dff['model'];if(_0x2515af['query'][_0x515d('0x4a')]){_0x251d58[_0x515d('0x4b')]=[{'all':!![]}];}_0x251d58=_[_0x515d('0x47')]({},_0x251d58,_0x2515af[_0x515d('0x49')]);return db[_0x515d('0x36')][_0x515d('0x4f')](_0x251d58)['then'](handleEntityNotFound(_0x3851c8,null))['then'](respondWithResult(_0x3851c8,null))[_0x515d('0x4c')](handleError(_0x3851c8,null));};exports[_0x515d('0x50')]=function(_0xea84fb,_0x13b38a){return db[_0x515d('0x36')][_0x515d('0x50')](_0xea84fb['body'],{})[_0x515d('0x25')](function(_0x573080){var _0x32a402=_0xea84fb[_0x515d('0x51')][_0x515d('0x27')]({'plain':!![]});if(!_0x32a402)throw new Error(_0x515d('0x52'));if(_0x32a402[_0x515d('0x53')]===_0x515d('0x51')){var _0x2e33ef=_0x573080[_0x515d('0x27')]({'plain':!![]});var _0x14e4b3=[{'name':_0x515d('0x54'),'value':_0x515d('0x55')},{'name':'QueueCampaigns','value':_0x515d('0x28')}];var _0x28ad68=_[_0x515d('0x4f')](_0x14e4b3,[_0x515d('0x2b'),_0x2e33ef['type']])[_0x515d('0x2e')];return db[_0x515d('0x56')][_0x515d('0x4f')]({'where':{'name':_0x28ad68,'userProfileId':_0x32a402[_0x515d('0x57')]},'raw':!![]})[_0x515d('0x25')](function(_0x3dd52d){if(_0x3dd52d&&_0x3dd52d[_0x515d('0x58')]===0x0){return db[_0x515d('0x2f')][_0x515d('0x50')]({'name':_0x2e33ef[_0x515d('0x2e')],'resourceId':_0x2e33ef['id'],'type':_0x3dd52d[_0x515d('0x2e')],'sectionId':_0x3dd52d['id']},{})[_0x515d('0x25')](function(){return _0x573080;});}else{return _0x573080;}})['catch'](function(_0x342fda){logger['error'](_0x515d('0x59'),_0x342fda);throw _0x342fda;});}return _0x573080;})[_0x515d('0x25')](respondWithResult(_0x13b38a,0xc9))[_0x515d('0x4c')](handleError(_0x13b38a,null));};exports[_0x515d('0x5a')]=function(_0x1fce8a,_0x13458c){var _0x2f302d={'where':{'id':_0x1fce8a['params']['id']}},_0x12116a={};_0x12116a[_0x515d('0x3a')]=_['keys'](db[_0x515d('0x36')]['rawAttributes']);_0x2f302d[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x12116a[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x1fce8a[_0x515d('0x3d')][_0x515d('0x3f')]));_0x2f302d[_0x515d('0x3e')]=_0x2f302d['attributes'][_0x515d('0x40')]?_0x2f302d[_0x515d('0x3e')]:_0x12116a['model'];if(_0x1fce8a[_0x515d('0x3d')][_0x515d('0x4a')]){_0x2f302d['include']=[{'all':!![]}];}_0x2f302d=_[_0x515d('0x47')]({},_0x2f302d,_0x1fce8a[_0x515d('0x49')]);return db[_0x515d('0x36')][_0x515d('0x4f')](_0x2f302d)[_0x515d('0x25')](handleEntityNotFound(_0x13458c,null))['then'](function(_0xe97b55){if(_0xe97b55){var _0x3ec8d3=_0xe97b55[_0x515d('0x27')]({'plain':!![]});_0x3ec8d3=qs['omit'](_0x3ec8d3,['id','createdAt','updatedAt']);_0x1fce8a['body']=_[_0x515d('0x5b')](_0x1fce8a[_0x515d('0x5c')],['id',_0x515d('0x5d'),_0x515d('0x5e')]);return db[_0x515d('0x36')][_0x515d('0x50')](_[_0x515d('0x47')](_0x3ec8d3,_0x1fce8a[_0x515d('0x5c')]),{'include':_0x1fce8a[_0x515d('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0x515d('0x25')](function(_0x119f47){var _0x2de81a=_0x1fce8a[_0x515d('0x51')][_0x515d('0x27')]({'plain':!![]});if(!_0x2de81a)throw new Error(_0x515d('0x52'));if(_0x2de81a[_0x515d('0x53')]===_0x515d('0x51')){var _0x4b2e97=_0x119f47[_0x515d('0x27')]({'plain':!![]});var _0x217906=[{'name':'VoiceQueues','value':_0x515d('0x55')},{'name':_0x515d('0x5f'),'value':_0x515d('0x28')}];var _0x484b19=_[_0x515d('0x4f')](_0x217906,[_0x515d('0x2b'),_0x4b2e97[_0x515d('0x2d')]])['name'];return db['UserProfileSection'][_0x515d('0x4f')]({'where':{'name':_0x484b19,'userProfileId':_0x2de81a[_0x515d('0x57')]},'raw':!![]})[_0x515d('0x25')](function(_0x2ecee4){if(_0x2ecee4&&_0x2ecee4[_0x515d('0x58')]===0x0){return db[_0x515d('0x2f')][_0x515d('0x50')]({'name':_0x4b2e97['name'],'resourceId':_0x4b2e97['id'],'type':_0x2ecee4['name'],'sectionId':_0x2ecee4['id']},{})['then'](function(){return _0x119f47;});}else{return _0x119f47;}})[_0x515d('0x4c')](function(_0x44c111){logger[_0x515d('0x31')](_0x515d('0x59'),_0x44c111);throw _0x44c111;});}return _0x119f47;});}})[_0x515d('0x25')](respondWithResult(_0x13458c,0xc9))['catch'](handleError(_0x13458c,null));};exports[_0x515d('0x24')]=function(_0x43333c,_0x3e2117){if(_0x43333c[_0x515d('0x5c')]['id']){delete _0x43333c[_0x515d('0x5c')]['id'];}return db['VoiceQueue'][_0x515d('0x4f')]({'where':{'id':_0x43333c[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x3e2117,null))[_0x515d('0x25')](saveUpdates(_0x43333c[_0x515d('0x5c')],null))[_0x515d('0x25')](respondWithResult(_0x3e2117,null))[_0x515d('0x4c')](handleError(_0x3e2117,null));};exports[_0x515d('0x26')]=function(_0x5935fa,_0x1ba612){return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0x5935fa[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x1ba612,null))[_0x515d('0x25')](removeEntity(_0x1ba612,null))[_0x515d('0x4c')](handleError(_0x1ba612,null));};exports['getHoppers']=function(_0x37a205,_0x586836,_0x252c32){var _0x43a4aa={'raw':![],'where':{}};var _0x9c22a9={};var _0x245245={'count':0x0,'rows':[]};return db[_0x515d('0x36')][_0x515d('0x61')]({'where':{'id':_0x37a205[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x586836,null))[_0x515d('0x25')](function(_0x27bd4b){if(_0x27bd4b){_0x9c22a9[_0x515d('0x3a')]=_['keys'](db[_0x515d('0x62')][_0x515d('0x37')]);_0x9c22a9[_0x515d('0x3d')]=_[_0x515d('0x4e')](_0x37a205[_0x515d('0x3d')]);_0x9c22a9['filters']=_[_0x515d('0x3c')](_0x9c22a9[_0x515d('0x3a')],_0x9c22a9[_0x515d('0x3d')]);_0x43a4aa[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x9c22a9[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x37a205[_0x515d('0x3d')][_0x515d('0x3f')]));_0x43a4aa[_0x515d('0x3e')]=_0x43a4aa['attributes'][_0x515d('0x40')]?_0x43a4aa[_0x515d('0x3e')]:_0x9c22a9['model'];if(!_0x37a205[_0x515d('0x3d')][_0x515d('0x41')](_0x515d('0x42'))){_0x43a4aa[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x37a205[_0x515d('0x3d')][_0x515d('0x21')]);_0x43a4aa[_0x515d('0x20')]=qs['offset'](_0x37a205['query']['offset']);}_0x43a4aa[_0x515d('0x43')]=qs['sort'](_0x37a205[_0x515d('0x3d')][_0x515d('0x44')]);_0x43a4aa[_0x515d('0x45')]=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x37a205['query'],_0x9c22a9[_0x515d('0x3b')]));_0x43a4aa[_0x515d('0x45')][_0x515d('0x63')]=_0x27bd4b['id'];if(_0x37a205['query']['filter']){_0x43a4aa[_0x515d('0x45')]=_[_0x515d('0x47')](_0x43a4aa['where'],{'$or':_['map'](_0x43a4aa[_0x515d('0x3e')],function(_0x17e945){var _0x474ffa={};_0x474ffa[_0x17e945]={'$like':'%'+_0x37a205[_0x515d('0x3d')]['filter']+'%'};return _0x474ffa;})});}_0x43a4aa=_[_0x515d('0x47')]({},_0x43a4aa,_0x37a205['options']);return db['CmHopper'][_0x515d('0x1f')]({'where':_0x43a4aa[_0x515d('0x45')]})[_0x515d('0x25')](function(_0x209550){_0x245245[_0x515d('0x1f')]=_0x209550;if(_0x37a205[_0x515d('0x3d')][_0x515d('0x4a')]){_0x43a4aa[_0x515d('0x4b')]=[{'all':!![]}];}return db[_0x515d('0x62')][_0x515d('0x64')](_0x43a4aa);})[_0x515d('0x25')](function(_0x328e3b){_0x245245[_0x515d('0x65')]=_0x328e3b;return _0x245245;});}})[_0x515d('0x25')](respondWithFilteredResult(_0x586836,_0x43a4aa))[_0x515d('0x4c')](handleError(_0x586836,null));};exports['getHopperHistories']=function(_0x3d35cb,_0x36602f,_0xfa1047){var _0x3f5ad2={'raw':!![],'where':{}};var _0x416f1e={};var _0x2326ba={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x515d('0x61')]({'where':{'id':_0x3d35cb[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x36602f,null))[_0x515d('0x25')](function(_0x4868ca){if(_0x4868ca){_0x416f1e[_0x515d('0x3a')]=_[_0x515d('0x4e')](db['CmHopperHistory'][_0x515d('0x37')]);_0x416f1e['query']=_['keys'](_0x3d35cb['query']);_0x416f1e[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x416f1e[_0x515d('0x3a')],_0x416f1e[_0x515d('0x3d')]);_0x3f5ad2['attributes']=_[_0x515d('0x3c')](_0x416f1e['model'],qs[_0x515d('0x3f')](_0x3d35cb[_0x515d('0x3d')][_0x515d('0x3f')]));_0x3f5ad2[_0x515d('0x3e')]=_0x3f5ad2[_0x515d('0x3e')]['length']?_0x3f5ad2[_0x515d('0x3e')]:_0x416f1e[_0x515d('0x3a')];if(!_0x3d35cb[_0x515d('0x3d')][_0x515d('0x41')](_0x515d('0x42'))){_0x3f5ad2['limit']=qs[_0x515d('0x21')](_0x3d35cb[_0x515d('0x3d')]['limit']);_0x3f5ad2['offset']=qs['offset'](_0x3d35cb[_0x515d('0x3d')][_0x515d('0x20')]);}_0x3f5ad2[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x3d35cb['query'][_0x515d('0x44')]);_0x3f5ad2['where']=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x3d35cb[_0x515d('0x3d')],_0x416f1e['filters']));_0x3f5ad2['where'][_0x515d('0x63')]=_0x4868ca['id'];if(_0x3d35cb['query'][_0x515d('0x29')]){_0x3f5ad2['where']=_[_0x515d('0x47')](_0x3f5ad2[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x3f5ad2[_0x515d('0x3e')],function(_0x58b4a1){var _0x315f5d={};_0x315f5d[_0x58b4a1]={'$like':'%'+_0x3d35cb['query']['filter']+'%'};return _0x315f5d;})});}_0x3f5ad2=_[_0x515d('0x47')]({},_0x3f5ad2,_0x3d35cb[_0x515d('0x49')]);return db[_0x515d('0x66')][_0x515d('0x1f')]({'where':_0x3f5ad2[_0x515d('0x45')]})['then'](function(_0x2536a1){_0x2326ba[_0x515d('0x1f')]=_0x2536a1;if(_0x3d35cb['query']['includeAll']){_0x3f5ad2['include']=[{'all':!![]}];}return db[_0x515d('0x66')][_0x515d('0x64')](_0x3f5ad2);})[_0x515d('0x25')](function(_0x4373c3){_0x2326ba[_0x515d('0x65')]=_0x4373c3;return _0x2326ba;});}})[_0x515d('0x25')](respondWithFilteredResult(_0x36602f,_0x3f5ad2))[_0x515d('0x4c')](handleError(_0x36602f,null));};exports[_0x515d('0x67')]=function(_0x39dd16,_0x565f8d,_0xc5824d){var _0xd09208={'raw':!![],'where':{}};var _0x227d0b={};var _0x217790={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x39dd16[_0x515d('0x60')]['id']}})['then'](handleEntityNotFound(_0x565f8d,null))['then'](function(_0x180598){if(_0x180598){_0x227d0b[_0x515d('0x3a')]=_[_0x515d('0x4e')](db[_0x515d('0x68')][_0x515d('0x37')]);_0x227d0b[_0x515d('0x3d')]=_[_0x515d('0x4e')](_0x39dd16[_0x515d('0x3d')]);_0x227d0b[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x227d0b[_0x515d('0x3a')],_0x227d0b[_0x515d('0x3d')]);_0xd09208[_0x515d('0x3e')]=_['intersection'](_0x227d0b[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x39dd16['query'][_0x515d('0x3f')]));_0xd09208[_0x515d('0x3e')]=_0xd09208[_0x515d('0x3e')][_0x515d('0x40')]?_0xd09208['attributes']:_0x227d0b[_0x515d('0x3a')];if(!_0x39dd16['query']['hasOwnProperty'](_0x515d('0x42'))){_0xd09208[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x39dd16[_0x515d('0x3d')][_0x515d('0x21')]);_0xd09208[_0x515d('0x20')]=qs['offset'](_0x39dd16[_0x515d('0x3d')][_0x515d('0x20')]);}_0xd09208[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x39dd16[_0x515d('0x3d')][_0x515d('0x44')]);_0xd09208[_0x515d('0x45')]=qs['filters'](_[_0x515d('0x46')](_0x39dd16[_0x515d('0x3d')],_0x227d0b['filters']));_0xd09208[_0x515d('0x45')][_0x515d('0x63')]=_0x180598['id'];if(_0x39dd16[_0x515d('0x3d')][_0x515d('0x29')]){_0xd09208[_0x515d('0x45')]=_['merge'](_0xd09208['where'],{'$or':_[_0x515d('0x35')](_0xd09208[_0x515d('0x3e')],function(_0x407683){var _0x13aea4={};_0x13aea4[_0x407683]={'$like':'%'+_0x39dd16[_0x515d('0x3d')]['filter']+'%'};return _0x13aea4;})});}_0xd09208=_[_0x515d('0x47')]({},_0xd09208,_0x39dd16[_0x515d('0x49')]);return db[_0x515d('0x68')][_0x515d('0x1f')]({'where':_0xd09208[_0x515d('0x45')]})[_0x515d('0x25')](function(_0x20eda8){_0x217790[_0x515d('0x1f')]=_0x20eda8;if(_0x39dd16[_0x515d('0x3d')][_0x515d('0x4a')]){_0xd09208[_0x515d('0x4b')]=[{'all':!![]}];}return db[_0x515d('0x68')][_0x515d('0x64')](_0xd09208);})[_0x515d('0x25')](function(_0x212c4e){_0x217790[_0x515d('0x65')]=_0x212c4e;return _0x217790;});}})['then'](respondWithFilteredResult(_0x565f8d,_0xd09208))[_0x515d('0x4c')](handleError(_0x565f8d,null));};exports['getHopperBlacks']=function(_0x1b8d9c,_0x3d144d,_0x21ea39){var _0x1e0c7b={'raw':!![],'where':{}};var _0x46b148={};var _0xd2338b={'count':0x0,'rows':[]};return db[_0x515d('0x36')][_0x515d('0x61')]({'where':{'id':_0x1b8d9c[_0x515d('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d144d,null))[_0x515d('0x25')](function(_0x3fbce6){if(_0x3fbce6){_0x46b148['model']=_['keys'](db['CmHopperBlack'][_0x515d('0x37')]);_0x46b148[_0x515d('0x3d')]=_['keys'](_0x1b8d9c[_0x515d('0x3d')]);_0x46b148[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x46b148[_0x515d('0x3a')],_0x46b148[_0x515d('0x3d')]);_0x1e0c7b[_0x515d('0x3e')]=_['intersection'](_0x46b148[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x3f')]));_0x1e0c7b[_0x515d('0x3e')]=_0x1e0c7b[_0x515d('0x3e')]['length']?_0x1e0c7b[_0x515d('0x3e')]:_0x46b148[_0x515d('0x3a')];if(!_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x41')](_0x515d('0x42'))){_0x1e0c7b[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x21')]);_0x1e0c7b[_0x515d('0x20')]=qs['offset'](_0x1b8d9c['query'][_0x515d('0x20')]);}_0x1e0c7b[_0x515d('0x43')]=qs['sort'](_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x44')]);_0x1e0c7b[_0x515d('0x45')]=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x1b8d9c[_0x515d('0x3d')],_0x46b148['filters']));_0x1e0c7b[_0x515d('0x45')][_0x515d('0x63')]=_0x3fbce6['id'];if(_0x1b8d9c[_0x515d('0x3d')]['filter']){_0x1e0c7b[_0x515d('0x45')]=_['merge'](_0x1e0c7b['where'],{'$or':_[_0x515d('0x35')](_0x1e0c7b['attributes'],function(_0xe75da4){var _0x42bfe7={};_0x42bfe7[_0xe75da4]={'$like':'%'+_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x29')]+'%'};return _0x42bfe7;})});}_0x1e0c7b=_[_0x515d('0x47')]({},_0x1e0c7b,_0x1b8d9c['options']);return db[_0x515d('0x69')][_0x515d('0x1f')]({'where':_0x1e0c7b[_0x515d('0x45')]})['then'](function(_0x578a06){_0xd2338b[_0x515d('0x1f')]=_0x578a06;if(_0x1b8d9c[_0x515d('0x3d')][_0x515d('0x4a')]){_0x1e0c7b[_0x515d('0x4b')]=[{'all':!![]}];}return db[_0x515d('0x69')]['findAll'](_0x1e0c7b);})[_0x515d('0x25')](function(_0x1a14ad){_0xd2338b[_0x515d('0x65')]=_0x1a14ad;return _0xd2338b;});}})[_0x515d('0x25')](respondWithFilteredResult(_0x3d144d,_0x1e0c7b))['catch'](handleError(_0x3d144d,null));};exports[_0x515d('0x6a')]=function(_0x5f1c99,_0x22da55,_0x55facf){var _0x28d0f7={};var _0x78438e={};var _0x20d459;var _0x44abb9;return db['VoiceQueue'][_0x515d('0x61')]({'where':{'id':_0x5f1c99[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x22da55,null))['then'](function(_0x5a53dc){if(_0x5a53dc){_0x20d459=_0x5a53dc;_0x78438e[_0x515d('0x3a')]=_[_0x515d('0x4e')](db['Team'][_0x515d('0x37')]);_0x78438e['query']=_[_0x515d('0x4e')](_0x5f1c99['query']);_0x78438e[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x78438e['model'],_0x78438e[_0x515d('0x3d')]);_0x28d0f7[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x78438e[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x5f1c99[_0x515d('0x3d')][_0x515d('0x3f')]));_0x28d0f7[_0x515d('0x3e')]=_0x28d0f7[_0x515d('0x3e')][_0x515d('0x40')]?_0x28d0f7[_0x515d('0x3e')]:_0x78438e['model'];_0x28d0f7['order']=qs[_0x515d('0x44')](_0x5f1c99[_0x515d('0x3d')]['sort']);_0x28d0f7['where']=qs[_0x515d('0x3b')](_['pick'](_0x5f1c99[_0x515d('0x3d')],_0x78438e[_0x515d('0x3b')]));if(_0x5f1c99[_0x515d('0x3d')][_0x515d('0x29')]){_0x28d0f7[_0x515d('0x45')]=_[_0x515d('0x47')](_0x28d0f7[_0x515d('0x45')],{'$or':_['map'](_0x28d0f7[_0x515d('0x3e')],function(_0x22684d){var _0x2d946e={};_0x2d946e[_0x22684d]={'$like':'%'+_0x5f1c99[_0x515d('0x3d')]['filter']+'%'};return _0x2d946e;})});}_0x28d0f7=_['merge']({},_0x28d0f7,_0x5f1c99[_0x515d('0x49')]);return _0x20d459['getTeams'](_0x28d0f7);}})[_0x515d('0x25')](function(_0x14dd2f){if(_0x14dd2f){_0x44abb9=_0x14dd2f['length'];if(!_0x5f1c99[_0x515d('0x3d')][_0x515d('0x41')](_0x515d('0x42'))){_0x28d0f7[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x5f1c99['query'][_0x515d('0x21')]);_0x28d0f7[_0x515d('0x20')]=qs['offset'](_0x5f1c99[_0x515d('0x3d')][_0x515d('0x20')]);}return _0x20d459[_0x515d('0x6a')](_0x28d0f7);}})[_0x515d('0x25')](function(_0x35d751){if(_0x35d751){return _0x35d751?{'count':_0x44abb9,'rows':_0x35d751}:null;}})[_0x515d('0x25')](respondWithResult(_0x22da55,null))[_0x515d('0x4c')](handleError(_0x22da55,null));};exports[_0x515d('0x6b')]=function(_0x2dce9e,_0x2c20cc,_0x20071a){var _0x2acc10=_0x2dce9e[_0x515d('0x5c')][_0x515d('0x6c')];var _0x2bda2b=_['map'](_0x2acc10,'id');return db[_0x515d('0x6d')][_0x515d('0x64')]({'where':{'id':_0x2bda2b},'attributes':['id'],'include':[{'model':db[_0x515d('0x6e')],'as':'Agents','attributes':['id',_0x515d('0x2e'),_0x515d('0x6f'),_0x515d('0x70'),_0x515d('0x71')],'raw':!![]}]})[_0x515d('0x25')](function(_0x1b81d2){if(_0x1b81d2){var _0x2f57f7=_['flatMap'](_0x1b81d2,function(_0x4bb0ce){var _0x2c0a57=_0x4bb0ce[_0x515d('0x27')]({'plain':!![]});_0x2c0a57['Agents'][_0x515d('0x72')](function(_0x278f77){_0x278f77['penalty']=_['find'](_0x2acc10,{'id':_0x2c0a57['id']})['penalty'];});return _0x2c0a57['Agents'];});return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0x2dce9e[_0x515d('0x60')]['id']}})[_0x515d('0x25')](function(_0x52c7fd){return db['sequelize'][_0x515d('0x73')](function(_0x573582){return _0x52c7fd['addTeams'](_0x2bda2b,{'transaction':_0x573582})[_0x515d('0x25')](function(){return BPromise[_0x515d('0x74')](_0x2f57f7,function(_0x65efa0){return db[_0x515d('0x75')][_0x515d('0x76')]({'where':{'UserId':_0x65efa0['id'],'VoiceQueueId':_0x2dce9e['params']['id']},'defaults':{'penalty':_0x65efa0['penalty']},'transaction':_0x573582});});})[_0x515d('0x25')](function(){return BPromise[_0x515d('0x74')](_['filter'](_0x2f57f7,{'online':!![]}),function(_0x148f09){return db[_0x515d('0x77')][_0x515d('0x78')]({'membername':_0x148f09['name'],'UserId':_0x148f09['id'],'queue_name':_0x52c7fd[_0x515d('0x2e')],'VoiceQueueId':_0x52c7fd['id'],'interface':_[_0x515d('0x79')](_0x148f09[_0x515d('0x71')])?util[_0x515d('0x7a')](_0x515d('0x7b'),_0x148f09[_0x515d('0x2e')]):_0x148f09[_0x515d('0x71')],'paused':_0x148f09[_0x515d('0x70')]||![],'penalty':_0x148f09[_0x515d('0x7c')]},{'transaction':_0x573582});});})[_0x515d('0x25')](function(){_0x2f57f7[_0x515d('0x72')](function(_0x13dfd7){socket[_0x515d('0x7d')](_0x515d('0x7e'),{'UserId':_0x13dfd7['id'],'VoiceQueueId':_0x52c7fd['id']});});});});});}})['then'](respondWithStatusCode(_0x2c20cc,null))[_0x515d('0x4c')](handleError(_0x2c20cc,null));};exports[_0x515d('0x7f')]=function(_0x50840d,_0x45891a,_0x422ba7){return db[_0x515d('0x6d')][_0x515d('0x64')]({'where':{'id':_0x50840d[_0x515d('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x515d('0x6e')],'as':_0x515d('0x80'),'attributes':['id'],'raw':!![]}]})[_0x515d('0x25')](handleEntityNotFound(_0x45891a,null))['then'](function(_0x5ecc73){var _0x2dcf29=_[_0x515d('0x35')](_0x5ecc73,'id');var _0x521dd3=[];var _0xa966de=[];var _0x330154=squel['select']();_0x330154[_0x515d('0x81')](_0x515d('0x82'))[_0x515d('0x83')](_0x515d('0x84'),'tq')['join'](_0x515d('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x515d('0x45')](_0x515d('0x86'),_0x50840d[_0x515d('0x60')]['id']);for(var _0x2dfb51=0x0;_0x2dfb51<_0x5ecc73[_0x515d('0x40')];_0x2dfb51+=0x1){let _0xfcf022=_0x5ecc73[_0x2dfb51];for(var _0x2ff762=0x0;_0x2ff762<_0xfcf022[_0x515d('0x80')][_0x515d('0x40')];_0x2ff762+=0x1){let _0x1b2889=_0xfcf022[_0x515d('0x80')][_0x2ff762];var _0x29f78a=_0x330154[_0x515d('0x5a')]();_0x29f78a[_0x515d('0x45')](_0x515d('0x87'),_0x1b2889['id']);_0xa966de[_0x515d('0x88')](db[_0x515d('0x89')]['query'](_0x29f78a['toString'](),{'type':db['sequelize']['QueryTypes'][_0x515d('0x8a')]})['then'](function(_0x2327fc){if(_0x2327fc[_0x515d('0x40')]===0x1){return _0x1b2889['id'];}else{var _0x3250d3=_[_0x515d('0x8b')](_['map'](_0x2327fc,_0x515d('0x8c')),function(_0x552540){return _[_0x515d('0x2c')](_0x2dcf29,_0x552540);});if(_0x3250d3){return _0x1b2889['id'];}}}));}}return BPromise[_0x515d('0x8d')](_0xa966de)[_0x515d('0x25')](function(_0x511f33){_0x521dd3=_(_0x521dd3)[_0x515d('0x8e')](_0x511f33)[_0x515d('0x8f')]()[_0x515d('0x2b')]();return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0x50840d[_0x515d('0x60')]['id']}})[_0x515d('0x25')](function(_0x1d71eb){return db[_0x515d('0x89')][_0x515d('0x73')](function(_0x23187e){return _0x1d71eb[_0x515d('0x7f')](_0x50840d[_0x515d('0x3d')][_0x515d('0x90')],{'transaction':_0x23187e})[_0x515d('0x25')](function(){if(!_[_0x515d('0x91')](_0x521dd3)){return _0x1d71eb['removeAgents'](_0x521dd3,{'transaction':_0x23187e})[_0x515d('0x25')](function(){return db['UserVoiceQueueRt'][_0x515d('0x26')]({'where':{'VoiceQueueId':_0x50840d[_0x515d('0x60')]['id'],'UserId':_0x521dd3},'transaction':_0x23187e});});}})[_0x515d('0x25')](function(){_0x521dd3[_0x515d('0x72')](function(_0x1ace3a){socket[_0x515d('0x7d')](_0x515d('0x92'),{'UserId':_0x1ace3a,'VoiceQueueId':_0x1d71eb['id']});});});});});});})[_0x515d('0x25')](respondWithStatusCode(_0x45891a,null))['catch'](handleError(_0x45891a,null));};exports[_0x515d('0x93')]=function(_0x2af6b6,_0x4d26f0,_0x27922b){var _0x2c76bf,_0x20b793;return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0x2af6b6[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x4d26f0,null))['then'](function(_0x1ffcad){if(_0x1ffcad){_0x20b793=_0x1ffcad;return _0x1ffcad[_0x515d('0x93')](_0x2af6b6[_0x515d('0x5c')][_0x515d('0x90')],_['omit'](_0x2af6b6[_0x515d('0x5c')],['ids','id'])||{})[_0x515d('0x94')](function(_0x5ad257){for(var _0x250a95=0x0;_0x250a95<_0x2af6b6[_0x515d('0x5c')][_0x515d('0x90')][_0x515d('0x40')];_0x250a95+=0x1){socket[_0x515d('0x7d')](_0x515d('0x7e'),{'UserId':_0x2af6b6[_0x515d('0x5c')][_0x515d('0x90')][_0x250a95],'VoiceQueueId':_0x2af6b6[_0x515d('0x60')]['id']});}return _0x5ad257;});}})[_0x515d('0x25')](function(_0x2885ef){_0x2c76bf=_0x2885ef||[];if(_0x20b793){return db['User'][_0x515d('0x64')]({'where':{'id':_0x2af6b6[_0x515d('0x5c')][_0x515d('0x90')]},'attributes':['id',_0x515d('0x2e'),_0x515d('0x6f'),_0x515d('0x70'),_0x515d('0x71')],'raw':!![]});}})['then'](function(_0x42c380){if(!_[_0x515d('0x91')](_0x42c380)){var _0x56911b=[];for(var _0x4e4fa1=0x0;_0x4e4fa1<_0x42c380[_0x515d('0x40')];_0x4e4fa1++){if(_0x42c380[_0x4e4fa1][_0x515d('0x6f')]){_0x56911b[_0x515d('0x88')](db[_0x515d('0x77')][_0x515d('0x78')]({'membername':_0x42c380[_0x4e4fa1][_0x515d('0x2e')],'UserId':_0x42c380[_0x4e4fa1]['id'],'queue_name':_0x20b793[_0x515d('0x2e')],'VoiceQueueId':_0x20b793['id'],'interface':_['isNil'](_0x42c380[_0x4e4fa1][_0x515d('0x71')])?util['format'](_0x515d('0x7b'),_0x42c380[_0x4e4fa1][_0x515d('0x2e')]):_0x42c380[_0x4e4fa1][_0x515d('0x71')],'paused':_0x42c380[_0x4e4fa1][_0x515d('0x70')]||![],'penalty':_0x2af6b6[_0x515d('0x5c')][_0x515d('0x7c')]||0x0}));}}return BPromise[_0x515d('0x8d')](_0x56911b);}})[_0x515d('0x25')](function(){return _0x2c76bf;})[_0x515d('0x25')](respondWithResult(_0x4d26f0,null))[_0x515d('0x4c')](handleError(_0x4d26f0,null));};exports['removeAgents']=function(_0x594299,_0x4c22fb,_0xa65253){return db['VoiceQueue']['find']({'where':{'id':_0x594299['params']['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x4c22fb,null))['then'](function(_0x1fb6b6){if(_0x1fb6b6){return _0x1fb6b6[_0x515d('0x95')](_0x594299[_0x515d('0x3d')][_0x515d('0x90')])['then'](function(){if(_['isArray'](_0x594299[_0x515d('0x3d')][_0x515d('0x90')])){for(var _0x591ac9=0x0;_0x591ac9<_0x594299[_0x515d('0x3d')]['ids']['length'];_0x591ac9+=0x1){socket[_0x515d('0x7d')](_0x515d('0x92'),{'UserId':Number(_0x594299['query'][_0x515d('0x90')][_0x591ac9]),'VoiceQueueId':Number(_0x594299[_0x515d('0x60')]['id'])});}}else{socket[_0x515d('0x7d')](_0x515d('0x92'),{'UserId':Number(_0x594299[_0x515d('0x3d')][_0x515d('0x90')]),'VoiceQueueId':Number(_0x594299[_0x515d('0x60')]['id'])});}});}})[_0x515d('0x25')](function(_0x35eeaa){return db[_0x515d('0x77')][_0x515d('0x26')]({'where':{'VoiceQueueId':_0x594299[_0x515d('0x60')]['id'],'UserId':_0x594299[_0x515d('0x3d')][_0x515d('0x90')]}})[_0x515d('0x25')](function(){return _0x35eeaa;});})[_0x515d('0x25')](respondWithStatusCode(_0x4c22fb,null))[_0x515d('0x4c')](handleError(_0x4c22fb,null));};exports[_0x515d('0x96')]=function(_0x3e8502,_0x3d1fcf,_0x2ee2f8){var _0x1b0ed0={};var _0x24cad0={};var _0x315e91;var _0x4fc38b;return db[_0x515d('0x36')]['findOne']({'where':{'id':_0x3e8502['params']['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x3d1fcf,null))[_0x515d('0x25')](function(_0x4e20b1){if(_0x4e20b1){_0x315e91=_0x4e20b1;_0x24cad0[_0x515d('0x3a')]=_['keys'](db['User'][_0x515d('0x37')]);_0x24cad0['query']=_['keys'](_0x3e8502[_0x515d('0x3d')]);_0x24cad0['filters']=_[_0x515d('0x3c')](_0x24cad0[_0x515d('0x3a')],_0x24cad0[_0x515d('0x3d')]);_0x1b0ed0[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x24cad0[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x3e8502[_0x515d('0x3d')][_0x515d('0x3f')]));_0x1b0ed0[_0x515d('0x3e')]=_0x1b0ed0[_0x515d('0x3e')]['length']?_0x1b0ed0['attributes']:_0x24cad0[_0x515d('0x3a')];_0x1b0ed0[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x3e8502['query'][_0x515d('0x44')]);_0x1b0ed0['where']=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x3e8502['query'],_0x24cad0[_0x515d('0x3b')]));if(_0x3e8502['query'][_0x515d('0x29')]){_0x1b0ed0[_0x515d('0x45')]=_[_0x515d('0x47')](_0x1b0ed0[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x1b0ed0[_0x515d('0x3e')],function(_0x1a9eba){var _0x4ade5b={};_0x4ade5b[_0x1a9eba]={'$like':'%'+_0x3e8502[_0x515d('0x3d')][_0x515d('0x29')]+'%'};return _0x4ade5b;})});}_0x1b0ed0=_[_0x515d('0x47')]({},_0x1b0ed0,_0x3e8502[_0x515d('0x49')]);return _0x315e91[_0x515d('0x96')](_0x1b0ed0);}})[_0x515d('0x25')](function(_0x1ffb56){if(_0x1ffb56){_0x4fc38b=_0x1ffb56[_0x515d('0x40')];if(!_0x3e8502[_0x515d('0x3d')][_0x515d('0x41')](_0x515d('0x42'))){_0x1b0ed0[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x3e8502[_0x515d('0x3d')][_0x515d('0x21')]);_0x1b0ed0['offset']=qs['offset'](_0x3e8502[_0x515d('0x3d')][_0x515d('0x20')]);}return _0x315e91[_0x515d('0x96')](_0x1b0ed0);}})['then'](function(_0x40efa6){if(_0x40efa6){return _0x40efa6?{'count':_0x4fc38b,'rows':_0x40efa6}:null;}})['then'](respondWithResult(_0x3d1fcf,null))[_0x515d('0x4c')](handleError(_0x3d1fcf,null));};exports[_0x515d('0x97')]=function(_0x27f44a,_0x3d6fec,_0x2c8a1e){var _0x52f8c7={};var _0x25ddd0={};var _0x3b0349;var _0xd26ec7;return db[_0x515d('0x36')][_0x515d('0x61')]({'where':{'id':_0x27f44a['params']['id']}})['then'](handleEntityNotFound(_0x3d6fec,null))['then'](function(_0x2b7c97){if(_0x2b7c97){_0x3b0349=_0x2b7c97;_0x25ddd0[_0x515d('0x3a')]=_[_0x515d('0x4e')](db['UserVoiceQueueRt'][_0x515d('0x37')]);_0x25ddd0['query']=_[_0x515d('0x4e')](_0x27f44a[_0x515d('0x3d')]);_0x25ddd0[_0x515d('0x3b')]=_[_0x515d('0x3c')](_0x25ddd0[_0x515d('0x3a')],_0x25ddd0[_0x515d('0x3d')]);_0x52f8c7[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x25ddd0[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x27f44a[_0x515d('0x3d')]['fields']));_0x52f8c7[_0x515d('0x3e')]=_0x52f8c7[_0x515d('0x3e')][_0x515d('0x40')]?_0x52f8c7[_0x515d('0x3e')]:_0x25ddd0[_0x515d('0x3a')];_0x52f8c7[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x27f44a[_0x515d('0x3d')][_0x515d('0x44')]);_0x52f8c7[_0x515d('0x45')]=qs[_0x515d('0x3b')](_['pick'](_0x27f44a[_0x515d('0x3d')],_0x25ddd0[_0x515d('0x3b')]));if(_0x27f44a[_0x515d('0x3d')]['filter']){_0x52f8c7[_0x515d('0x45')]=_[_0x515d('0x47')](_0x52f8c7[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x52f8c7[_0x515d('0x3e')],function(_0x1a314c){var _0x5a2876={};_0x5a2876[_0x1a314c]={'$like':'%'+_0x27f44a['query'][_0x515d('0x29')]+'%'};return _0x5a2876;})});}_0x52f8c7=_[_0x515d('0x47')]({},_0x52f8c7,_0x27f44a['options']);return _0x3b0349[_0x515d('0x97')](_0x52f8c7);}})[_0x515d('0x25')](function(_0x105172){if(_0x105172){_0xd26ec7=_0x105172[_0x515d('0x40')];if(!_0x27f44a['query']['hasOwnProperty'](_0x515d('0x42'))){_0x52f8c7[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x27f44a[_0x515d('0x3d')][_0x515d('0x21')]);_0x52f8c7[_0x515d('0x20')]=qs[_0x515d('0x20')](_0x27f44a[_0x515d('0x3d')][_0x515d('0x20')]);}return _0x3b0349[_0x515d('0x97')](_0x52f8c7);}})[_0x515d('0x25')](function(_0x154d24){return _0x154d24?{'count':_0xd26ec7,'rows':_0x154d24}:null;})[_0x515d('0x25')](respondWithResult(_0x3d6fec,null))[_0x515d('0x4c')](handleError(_0x3d6fec,null));};exports[_0x515d('0x98')]=function(_0x4d2b17,_0x5b51fa,_0x1a0e1d){var _0x2c3178={};var _0x5211db={};var _0x1b4eea;var _0x531210;return db['VoiceQueue'][_0x515d('0x61')]({'where':{'id':_0x4d2b17[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x5b51fa,null))[_0x515d('0x25')](function(_0x4eb6f4){if(_0x4eb6f4){_0x1b4eea=_0x4eb6f4;_0x5211db['model']=_[_0x515d('0x4e')](db[_0x515d('0x99')]['rawAttributes']);_0x5211db[_0x515d('0x3d')]=_[_0x515d('0x4e')](_0x4d2b17[_0x515d('0x3d')]);_0x5211db['filters']=_[_0x515d('0x3c')](_0x5211db[_0x515d('0x3a')],_0x5211db[_0x515d('0x3d')]);_0x2c3178[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x5211db[_0x515d('0x3a')],qs[_0x515d('0x3f')](_0x4d2b17[_0x515d('0x3d')][_0x515d('0x3f')]));_0x2c3178['attributes']=_0x2c3178[_0x515d('0x3e')][_0x515d('0x40')]?_0x2c3178[_0x515d('0x3e')]:_0x5211db[_0x515d('0x3a')];_0x2c3178[_0x515d('0x43')]=qs[_0x515d('0x44')](_0x4d2b17[_0x515d('0x3d')][_0x515d('0x44')]);_0x2c3178['where']=qs['filters'](_[_0x515d('0x46')](_0x4d2b17[_0x515d('0x3d')],_0x5211db[_0x515d('0x3b')]));if(_0x4d2b17[_0x515d('0x3d')]['filter']){_0x2c3178[_0x515d('0x45')]=_[_0x515d('0x47')](_0x2c3178[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x2c3178[_0x515d('0x3e')],function(_0xaac775){var _0x2af54e={};_0x2af54e[_0xaac775]={'$like':'%'+_0x4d2b17['query'][_0x515d('0x29')]+'%'};return _0x2af54e;})});}_0x2c3178=_[_0x515d('0x47')]({},_0x2c3178,_0x4d2b17[_0x515d('0x49')]);return _0x1b4eea[_0x515d('0x98')](_0x2c3178);}})['then'](function(_0x3f6607){if(_0x3f6607){_0x531210=_0x3f6607[_0x515d('0x40')];if(!_0x4d2b17['query'][_0x515d('0x41')](_0x515d('0x42'))){_0x2c3178[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x4d2b17[_0x515d('0x3d')][_0x515d('0x21')]);_0x2c3178['offset']=qs[_0x515d('0x20')](_0x4d2b17[_0x515d('0x3d')][_0x515d('0x20')]);}return _0x1b4eea[_0x515d('0x98')](_0x2c3178);}})['then'](function(_0x519e9a){if(_0x519e9a){return _0x519e9a?{'count':_0x531210,'rows':_0x519e9a}:null;}})['then'](respondWithResult(_0x5b51fa,null))['catch'](handleError(_0x5b51fa,null));};exports[_0x515d('0x9a')]=function(_0x4ae324,_0x254d8e,_0x521e66){var _0xedb62b,_0x3cd940;return db['VoiceQueue'][_0x515d('0x4f')]({'where':{'id':_0x4ae324[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0x254d8e,null))[_0x515d('0x25')](function(_0xa31b08){if(_0xa31b08){_0x3cd940=_0xa31b08;return _0xa31b08[_0x515d('0x9a')](_0x4ae324[_0x515d('0x5c')][_0x515d('0x90')],_[_0x515d('0x5b')](_0x4ae324[_0x515d('0x5c')],['ids','id'])||{});}return null;})[_0x515d('0x94')](function(_0x42eaab){var _0x13122f;_0xedb62b=_0x42eaab||[];var _0x55c247=[];if(_0x42eaab){for(var _0x3b36f4=0x0;_0x3b36f4<_0x42eaab[_0x515d('0x40')];_0x3b36f4+=0x1){var _0x38ce05=_0x42eaab[_0x3b36f4][_0x515d('0x27')]({'plain':!![]});_0x3cd940[_0x515d('0x9b')]=_0x4ae324[_0x515d('0x5c')][_0x515d('0x9b')]?_0x4ae324[_0x515d('0x5c')]['dialCheckDuplicateType']:_0x3cd940[_0x515d('0x9b')];switch(_0x3cd940['dialCheckDuplicateType']){case _0x515d('0x9c'):_0x13122f=squel[_0x515d('0x9d')]()['into'](_0x515d('0x9e'))[_0x515d('0x9f')](['phone','scheduledAt','ContactId',_0x515d('0xa0'),_0x515d('0x63'),_0x515d('0x5d'),_0x515d('0x5e')],squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xa2'),_0x515d('0xa2'))[_0x515d('0x81')]('NOW()',_0x515d('0xa3'))['field']('id',_0x515d('0xa4'))[_0x515d('0x81')](_0x38ce05[_0x515d('0xa5')][_0x515d('0xa6')](),_0x515d('0xa0'))['field'](_0x4ae324['params']['id']['toString'](),_0x515d('0x63'))[_0x515d('0x81')](_0x515d('0xa7'),_0x515d('0x5d'))[_0x515d('0x81')](_0x515d('0xa7'),'updatedAt')[_0x515d('0x83')](_0x515d('0xa8'))['where']('deletedAt\x20IS\x20NULL')[_0x515d('0x45')](_0x515d('0xa9'),_0x38ce05[_0x515d('0xa5')][_0x515d('0xa6')]())[_0x515d('0x45')](_0x515d('0xaa'))['where'](_0x515d('0xab'),squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xac'))['from']('cm_hopper_final')['where'](_0x515d('0x86'),_0x4ae324['params']['id']['toString']()))['where'](_0x515d('0xab'),squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xad'))[_0x515d('0x83')](_0x515d('0x9e'))['where'](_0x515d('0x86'),_0x4ae324[_0x515d('0x60')]['id'][_0x515d('0xa6')]())))['toString']();break;case _0x515d('0xae'):_0x13122f=squel['insert']()[_0x515d('0xaf')]('cm_hopper')['fromQuery']([_0x515d('0xa2'),_0x515d('0xa3'),_0x515d('0xa4'),_0x515d('0xa0'),_0x515d('0x63'),_0x515d('0x5d'),_0x515d('0x5e')],squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xa2'),_0x515d('0xa2'))[_0x515d('0x81')](_0x515d('0xa7'),_0x515d('0xa3'))[_0x515d('0x81')]('id',_0x515d('0xa4'))['field'](_0x38ce05[_0x515d('0xa5')][_0x515d('0xa6')](),'ListId')[_0x515d('0x81')](_0x4ae324['params']['id'][_0x515d('0xa6')](),_0x515d('0x63'))[_0x515d('0x81')](_0x515d('0xa7'),_0x515d('0x5d'))[_0x515d('0x81')](_0x515d('0xa7'),'updatedAt')[_0x515d('0x83')](_0x515d('0xa8'))[_0x515d('0x45')]('deletedAt\x20IS\x20NULL')[_0x515d('0x45')]('ListId\x20=\x20?',_0x38ce05[_0x515d('0xa5')]['toString']())[_0x515d('0x45')](_0x515d('0xaa'))['where'](_0x515d('0xab'),squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xad'))[_0x515d('0x83')](_0x515d('0x9e'))[_0x515d('0x45')]('VoiceQueueId\x20=\x20?',_0x4ae324[_0x515d('0x60')]['id'][_0x515d('0xa6')]())))[_0x515d('0xa6')]();break;default:_0x13122f=squel['insert']()[_0x515d('0xaf')](_0x515d('0x9e'))[_0x515d('0x9f')]([_0x515d('0xa2'),_0x515d('0xa3'),_0x515d('0xa4'),'ListId',_0x515d('0x63'),_0x515d('0x5d'),'updatedAt'],squel[_0x515d('0xa1')]()[_0x515d('0x81')](_0x515d('0xa2'),'phone')['field']('NOW()','scheduledAt')[_0x515d('0x81')]('id',_0x515d('0xa4'))['field'](_0x38ce05[_0x515d('0xa5')][_0x515d('0xa6')](),_0x515d('0xa0'))['field'](_0x4ae324[_0x515d('0x60')]['id'][_0x515d('0xa6')](),_0x515d('0x63'))['field'](_0x515d('0xa7'),'createdAt')[_0x515d('0x81')](_0x515d('0xa7'),'updatedAt')[_0x515d('0x83')]('cm_contacts')[_0x515d('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x515d('0xa9'),_0x38ce05[_0x515d('0xa5')][_0x515d('0xa6')]())[_0x515d('0x45')](_0x515d('0xaa')))[_0x515d('0xa6')]();}_0x55c247['push'](db[_0x515d('0x89')][_0x515d('0x3d')](_0x13122f));}return BPromise[_0x515d('0x8d')](_0x55c247);}})[_0x515d('0x25')](function(){return _0xedb62b;})[_0x515d('0x25')](respondWithResult(_0x254d8e,null))[_0x515d('0x4c')](handleError(_0x254d8e,null));};exports[_0x515d('0xb0')]=function(_0xf5c29e,_0x1577cd,_0x466f2f){return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0xf5c29e[_0x515d('0x60')]['id']}})['then'](handleEntityNotFound(_0x1577cd,null))[_0x515d('0x25')](function(_0x16e3c7){if(_0x16e3c7){return _0x16e3c7[_0x515d('0xb0')](_0xf5c29e[_0x515d('0x3d')][_0x515d('0x90')]);}})['then'](function(_0x2a2f4e){if(_0x2a2f4e){return db[_0x515d('0x62')]['destroy']({'where':{'ListId':_0xf5c29e[_0x515d('0x3d')][_0x515d('0x90')],'VoiceQueueId':_0xf5c29e['params']['id']}})[_0x515d('0x25')](function(){return _0x2a2f4e;});}})[_0x515d('0x25')](respondWithStatusCode(_0x1577cd,null))['catch'](handleError(_0x1577cd,null));};exports['getBlackLists']=function(_0x31f352,_0x3d0c45,_0xbb2399){var _0x12b158={};var _0x47cd87={};var _0x27a017;var _0x213873;return db['VoiceQueue'][_0x515d('0x61')]({'where':{'id':_0x31f352[_0x515d('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d0c45,null))[_0x515d('0x25')](function(_0x2f38a6){if(_0x2f38a6){_0x27a017=_0x2f38a6;_0x47cd87[_0x515d('0x3a')]=_[_0x515d('0x4e')](db['CmList'][_0x515d('0x37')]);_0x47cd87['query']=_['keys'](_0x31f352[_0x515d('0x3d')]);_0x47cd87['filters']=_[_0x515d('0x3c')](_0x47cd87[_0x515d('0x3a')],_0x47cd87[_0x515d('0x3d')]);_0x12b158[_0x515d('0x3e')]=_[_0x515d('0x3c')](_0x47cd87['model'],qs['fields'](_0x31f352[_0x515d('0x3d')][_0x515d('0x3f')]));_0x12b158[_0x515d('0x3e')]=_0x12b158[_0x515d('0x3e')]['length']?_0x12b158[_0x515d('0x3e')]:_0x47cd87[_0x515d('0x3a')];_0x12b158[_0x515d('0x43')]=qs['sort'](_0x31f352[_0x515d('0x3d')][_0x515d('0x44')]);_0x12b158[_0x515d('0x45')]=qs[_0x515d('0x3b')](_[_0x515d('0x46')](_0x31f352[_0x515d('0x3d')],_0x47cd87['filters']));if(_0x31f352[_0x515d('0x3d')][_0x515d('0x29')]){_0x12b158[_0x515d('0x45')]=_[_0x515d('0x47')](_0x12b158[_0x515d('0x45')],{'$or':_[_0x515d('0x35')](_0x12b158[_0x515d('0x3e')],function(_0x5a7be9){var _0x2ed1e0={};_0x2ed1e0[_0x5a7be9]={'$like':'%'+_0x31f352[_0x515d('0x3d')][_0x515d('0x29')]+'%'};return _0x2ed1e0;})});}_0x12b158=_[_0x515d('0x47')]({},_0x12b158,_0x31f352[_0x515d('0x49')]);return _0x27a017['getBlackLists'](_0x12b158);}})[_0x515d('0x25')](function(_0x2606c2){if(_0x2606c2){_0x213873=_0x2606c2[_0x515d('0x40')];if(!_0x31f352[_0x515d('0x3d')][_0x515d('0x41')]('nolimit')){_0x12b158[_0x515d('0x21')]=qs[_0x515d('0x21')](_0x31f352[_0x515d('0x3d')][_0x515d('0x21')]);_0x12b158[_0x515d('0x20')]=qs[_0x515d('0x20')](_0x31f352['query'][_0x515d('0x20')]);}return _0x27a017[_0x515d('0xb1')](_0x12b158);}})[_0x515d('0x25')](function(_0x56f45f){if(_0x56f45f){return _0x56f45f?{'count':_0x213873,'rows':_0x56f45f}:null;}})[_0x515d('0x25')](respondWithResult(_0x3d0c45,null))[_0x515d('0x4c')](handleError(_0x3d0c45,null));};exports[_0x515d('0xb2')]=function(_0x3a91a9,_0x5d84b8,_0x200ae9){var _0xe2dff4,_0xb2228b;return db[_0x515d('0x36')][_0x515d('0x4f')]({'where':{'id':_0x3a91a9['params']['id']}})['then'](handleEntityNotFound(_0x5d84b8,null))[_0x515d('0x25')](function(_0x51dbc8){if(_0x51dbc8){_0xb2228b=_0x51dbc8;return _0x51dbc8[_0x515d('0xb2')](_0x3a91a9[_0x515d('0x5c')][_0x515d('0x90')],_[_0x515d('0x5b')](_0x3a91a9[_0x515d('0x5c')],['ids','id'])||{});}return null;})[_0x515d('0x94')](function(_0x36dac8){var _0x522453;_0xe2dff4=_0x36dac8||[];var _0x3c4be9=[];if(_0x36dac8){for(var _0x1f428b=0x0;_0x1f428b<_0x36dac8[_0x515d('0x40')];_0x1f428b+=0x1){var _0x8bb66d=_0x36dac8[_0x1f428b]['get']({'plain':!![]});_0x522453=squel[_0x515d('0x9d')]()[_0x515d('0xaf')](_0x515d('0xb3'))[_0x515d('0x9f')]([_0x515d('0xa2'),_0x515d('0xa4'),_0x515d('0xa0'),_0x515d('0x63'),_0x515d('0x5d'),_0x515d('0x5e')],squel['select']()[_0x515d('0x81')](_0x515d('0xa2'),_0x515d('0xa2'))[_0x515d('0x81')]('id',_0x515d('0xa4'))[_0x515d('0x81')](_0x8bb66d[_0x515d('0xa5')]['toString'](),_0x515d('0xa0'))[_0x515d('0x81')](_0x3a91a9[_0x515d('0x60')]['id'][_0x515d('0xa6')](),_0x515d('0x63'))['field'](_0x515d('0xa7'),_0x515d('0x5d'))[_0x515d('0x81')]('NOW()',_0x515d('0x5e'))[_0x515d('0x83')](_0x515d('0xa8'))[_0x515d('0x45')](_0x515d('0xb4'))['where'](_0x515d('0xa9'),_0x8bb66d[_0x515d('0xa5')][_0x515d('0xa6')]())[_0x515d('0x45')](_0x515d('0xaa')))['toString']();_0x3c4be9[_0x515d('0x88')](db[_0x515d('0x89')][_0x515d('0x3d')](_0x522453));}return BPromise[_0x515d('0x8d')](_0x3c4be9);}})[_0x515d('0x25')](function(){return _0xe2dff4;})[_0x515d('0x25')](respondWithResult(_0x5d84b8,null))[_0x515d('0x4c')](handleError(_0x5d84b8,null));};exports[_0x515d('0xb5')]=function(_0x2c8c80,_0xd34b6,_0x305dfc){return db['VoiceQueue']['find']({'where':{'id':_0x2c8c80[_0x515d('0x60')]['id']}})[_0x515d('0x25')](handleEntityNotFound(_0xd34b6,null))['then'](function(_0x399518){if(_0x399518){return _0x399518[_0x515d('0xb5')](_0x2c8c80[_0x515d('0x3d')]['ids']);}})[_0x515d('0x25')](function(_0x238738){if(_0x238738){return db['CmHopperBlack'][_0x515d('0x26')]({'where':{'ListId':_0x2c8c80[_0x515d('0x3d')][_0x515d('0x90')],'VoiceQueueId':_0x2c8c80[_0x515d('0x60')]['id']}})[_0x515d('0x25')](function(){return _0x238738;});}})[_0x515d('0x25')](respondWithStatusCode(_0xd34b6,null))['catch'](handleError(_0xd34b6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 2a46243..7cf3a8b 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 _0xf0b4=['../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3fef4c,_0x4c6076){var _0xc4f172=function(_0x3ffc5b){while(--_0x3ffc5b){_0x3fef4c['push'](_0x3fef4c['shift']());}};_0xc4f172(++_0x4c6076);}(_0xf0b4,0x194));var _0x4f0b=function(_0x57cefa,_0xea48f2){_0x57cefa=_0x57cefa-0x0;var _0x254cd7=_0xf0b4[_0x57cefa];return _0x254cd7;};'use strict';var EventEmitter=require(_0x4f0b('0x0'));var VoiceQueue=require(_0x4f0b('0x1'))['db'][_0x4f0b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f0b('0x3'),'afterUpdate':_0x4f0b('0x4'),'afterDestroy':_0x4f0b('0x5')};function emitEvent(_0x1535c9){return function(_0x4c59aa,_0x104282,_0x466c04){VoiceQueueEvents[_0x4f0b('0x6')](_0x1535c9+':'+_0x4c59aa['id'],_0x4c59aa);VoiceQueueEvents[_0x4f0b('0x6')](_0x1535c9,_0x4c59aa);_0x466c04(null);};}for(var e in events){if(events[_0x4f0b('0x7')](e)){var event=events[e];VoiceQueue[_0x4f0b('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x1b5e=['VoiceQueue','save','update','emit','hook','exports','events'];(function(_0x4bf3a7,_0x5d756b){var _0x58c9cc=function(_0x13c6c9){while(--_0x13c6c9){_0x4bf3a7['push'](_0x4bf3a7['shift']());}};_0x58c9cc(++_0x5d756b);}(_0x1b5e,0x1b1));var _0xe1b5=function(_0x4265bb,_0x18e130){_0x4265bb=_0x4265bb-0x0;var _0x316c1d=_0x1b5e[_0x4265bb];return _0x316c1d;};'use strict';var EventEmitter=require(_0xe1b5('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xe1b5('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1b5('0x2'),'afterUpdate':_0xe1b5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x26c0c6){return function(_0x52dcd5,_0x4efdb8,_0x2a772a){VoiceQueueEvents['emit'](_0x26c0c6+':'+_0x52dcd5['id'],_0x52dcd5);VoiceQueueEvents[_0xe1b5('0x4')](_0x26c0c6,_0x52dcd5);_0x2a772a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xe1b5('0x5')](e,emitEvent(event));}}module[_0xe1b5('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d463eb7..aa2eea3 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 _0x3948=['./voiceQueue.attributes','exports','VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xc86f3f,_0x1ca047){var _0x3075eb=function(_0x2df091){while(--_0x2df091){_0xc86f3f['push'](_0xc86f3f['shift']());}};_0x3075eb(++_0x1ca047);}(_0x3948,0x122));var _0x8394=function(_0x53e8c3,_0x3dab85){_0x53e8c3=_0x53e8c3-0x0;var _0x4cde42=_0x3948[_0x53e8c3];return _0x4cde42;};'use strict';var _=require(_0x8394('0x0'));var util=require(_0x8394('0x1'));var logger=require(_0x8394('0x2'))(_0x8394('0x3'));var moment=require(_0x8394('0x4'));var BPromise=require(_0x8394('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8394('0x6'));var rimraf=require(_0x8394('0x7'));var config=require(_0x8394('0x8'));var attributes=require(_0x8394('0x9'));module[_0x8394('0xa')]=function(_0x1d4d73,_0x7d46bc){return _0x1d4d73['define'](_0x8394('0xb'),attributes,{'tableName':_0x8394('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89d6=['request-promise','path','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment'];(function(_0x10f967,_0x28917b){var _0x4022e1=function(_0x134224){while(--_0x134224){_0x10f967['push'](_0x10f967['shift']());}};_0x4022e1(++_0x28917b);}(_0x89d6,0xa4));var _0x689d=function(_0x28cd9c,_0x57c79e){_0x28cd9c=_0x28cd9c-0x0;var _0x39b7c4=_0x89d6[_0x28cd9c];return _0x39b7c4;};'use strict';var _=require(_0x689d('0x0'));var util=require('util');var logger=require(_0x689d('0x1'))(_0x689d('0x2'));var moment=require(_0x689d('0x3'));var BPromise=require('bluebird');var rp=require(_0x689d('0x4'));var fs=require('fs');var path=require(_0x689d('0x5'));var rimraf=require('rimraf');var config=require(_0x689d('0x6'));var attributes=require(_0x689d('0x7'));module[_0x689d('0x8')]=function(_0x255d66,_0x2a36df){return _0x255d66[_0x689d('0x9')](_0x689d('0xa'),attributes,{'tableName':_0x689d('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 be5334b..739995a 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 _0xfd75=['options','raw','where','attributes','include','map','model','ShowVoiceQueue','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetVoiceQueue','VoiceQueue'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xfd75,0xa1));var _0x5fd7=function(_0x1dfa55,_0x1d2007){_0x1dfa55=_0x1dfa55-0x0;var _0x893d0e=_0xfd75[_0x1dfa55];return _0x893d0e;};'use strict';var _=require(_0x5fd7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5fd7('0x1'));var fs=require('fs');var Redis=require(_0x5fd7('0x2'));var db=require(_0x5fd7('0x3'))['db'];var utils=require(_0x5fd7('0x4'));var logger=require(_0x5fd7('0x5'))(_0x5fd7('0x6'));var config=require(_0x5fd7('0x7'));var jayson=require(_0x5fd7('0x8'));var client=jayson[_0x5fd7('0x9')][_0x5fd7('0xa')]({'port':0x232a});config[_0x5fd7('0xb')]=_[_0x5fd7('0xc')](config[_0x5fd7('0xb')],{'host':_0x5fd7('0xd'),'port':0x18eb});var socket=require(_0x5fd7('0xe'))(new Redis(config['redis']));require(_0x5fd7('0xf'))[_0x5fd7('0x10')](socket);function respondWithRpcPromise(_0x587d04,_0x3b976e,_0x5d83dd){return new BPromise(function(_0x504299,_0x47698e){return client[_0x5fd7('0x11')](_0x587d04,_0x5d83dd)[_0x5fd7('0x12')](function(_0x5efde8){logger['info'](_0x5fd7('0x13'),_0x3b976e,_0x5fd7('0x14'));logger[_0x5fd7('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3b976e,_0x5fd7('0x14'),JSON['stringify'](_0x5efde8));if(_0x5efde8[_0x5fd7('0x16')]){if(_0x5efde8[_0x5fd7('0x16')]['code']===0x1f4){logger[_0x5fd7('0x16')](_0x5fd7('0x13'),_0x3b976e,_0x5efde8[_0x5fd7('0x16')][_0x5fd7('0x17')]);return _0x47698e(_0x5efde8['error'][_0x5fd7('0x17')]);}logger[_0x5fd7('0x16')](_0x5fd7('0x13'),_0x3b976e,_0x5efde8[_0x5fd7('0x16')][_0x5fd7('0x17')]);return _0x504299(_0x5efde8['error'][_0x5fd7('0x17')]);}else{logger[_0x5fd7('0x18')](_0x5fd7('0x13'),_0x3b976e,_0x5fd7('0x14'));_0x504299(_0x5efde8[_0x5fd7('0x19')][_0x5fd7('0x17')]);}})[_0x5fd7('0x1a')](function(_0x3e217a){logger[_0x5fd7('0x16')](_0x5fd7('0x13'),_0x3b976e,_0x3e217a);_0x47698e(_0x3e217a);});});}exports[_0x5fd7('0x1b')]=function(_0x55b0b6){var _0x4da7e4=this;return new Promise(function(_0x581002,_0x47ed0b){return db[_0x5fd7('0x1c')]['findAll']({'raw':_0x55b0b6[_0x5fd7('0x1d')]?_0x55b0b6[_0x5fd7('0x1d')][_0x5fd7('0x1e')]===undefined?!![]:![]:!![],'where':_0x55b0b6[_0x5fd7('0x1d')]?_0x55b0b6['options'][_0x5fd7('0x1f')]||null:null,'attributes':_0x55b0b6[_0x5fd7('0x1d')]?_0x55b0b6[_0x5fd7('0x1d')][_0x5fd7('0x20')]||null:null,'limit':_0x55b0b6[_0x5fd7('0x1d')]?_0x55b0b6[_0x5fd7('0x1d')]['limit']||null:null,'include':_0x55b0b6['options']?_0x55b0b6['options'][_0x5fd7('0x21')]?_['map'](_0x55b0b6[_0x5fd7('0x1d')][_0x5fd7('0x21')],function(_0x49e7d1){return{'model':db[_0x49e7d1['model']],'as':_0x49e7d1['as'],'attributes':_0x49e7d1[_0x5fd7('0x20')],'include':_0x49e7d1[_0x5fd7('0x21')]?_[_0x5fd7('0x22')](_0x49e7d1[_0x5fd7('0x21')],function(_0x5441bf){return{'model':db[_0x5441bf[_0x5fd7('0x23')]],'as':_0x5441bf['as'],'attributes':_0x5441bf[_0x5fd7('0x20')],'include':_0x5441bf['include']?_[_0x5fd7('0x22')](_0x5441bf[_0x5fd7('0x21')],function(_0x371adf){return{'model':db[_0x371adf[_0x5fd7('0x23')]],'as':_0x371adf['as'],'attributes':_0x371adf[_0x5fd7('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bb1c5){logger[_0x5fd7('0x18')](_0x5fd7('0x1b'),_0x55b0b6);logger[_0x5fd7('0x15')](_0x5fd7('0x1b'),_0x55b0b6,JSON['stringify'](_0x5bb1c5));_0x581002(_0x5bb1c5);})[_0x5fd7('0x1a')](function(_0x3faad7){logger[_0x5fd7('0x16')]('GetVoiceQueue',_0x3faad7['message'],_0x55b0b6);_0x47ed0b(_0x4da7e4[_0x5fd7('0x16')](0x1f4,_0x3faad7[_0x5fd7('0x17')]));});});};exports[_0x5fd7('0x24')]=function(_0x2f829c){var _0x2c723d=this;return new Promise(function(_0x58ffa3,_0x11a51a){return db[_0x5fd7('0x1c')]['find']({'raw':_0x2f829c[_0x5fd7('0x1d')]?_0x2f829c[_0x5fd7('0x1d')][_0x5fd7('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f829c['options']?_0x2f829c[_0x5fd7('0x1d')][_0x5fd7('0x1f')]||null:null,'attributes':_0x2f829c[_0x5fd7('0x1d')]?_0x2f829c[_0x5fd7('0x1d')][_0x5fd7('0x20')]||null:null,'include':_0x2f829c['options']?_0x2f829c['options'][_0x5fd7('0x21')]?_[_0x5fd7('0x22')](_0x2f829c[_0x5fd7('0x1d')]['include'],function(_0x4e93aa){return{'model':db[_0x4e93aa[_0x5fd7('0x23')]],'as':_0x4e93aa['as'],'attributes':_0x4e93aa['attributes'],'include':_0x4e93aa[_0x5fd7('0x21')]?_[_0x5fd7('0x22')](_0x4e93aa['include'],function(_0x351d43){return{'model':db[_0x351d43[_0x5fd7('0x23')]],'as':_0x351d43['as'],'attributes':_0x351d43[_0x5fd7('0x20')],'include':_0x351d43['include']?_[_0x5fd7('0x22')](_0x351d43[_0x5fd7('0x21')],function(_0x492b41){return{'model':db[_0x492b41[_0x5fd7('0x23')]],'as':_0x492b41['as'],'attributes':_0x492b41[_0x5fd7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5fd7('0x12')](function(_0x72538f){logger['info'](_0x5fd7('0x24'),_0x2f829c);logger[_0x5fd7('0x15')]('ShowVoiceQueue',_0x2f829c,JSON[_0x5fd7('0x25')](_0x72538f));_0x58ffa3(_0x72538f);})[_0x5fd7('0x1a')](function(_0x36f86a){logger[_0x5fd7('0x16')](_0x5fd7('0x24'),_0x36f86a[_0x5fd7('0x17')],_0x2f829c);_0x11a51a(_0x2c723d['error'](0x1f4,_0x36f86a[_0x5fd7('0x17')]));});});}; \ No newline at end of file +var _0x20d6=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','VoiceQueue','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','catch','ShowVoiceQueue','find','lodash','util'];(function(_0x1e0aaf,_0xdb3209){var _0x23c16e=function(_0x1948e1){while(--_0x1948e1){_0x1e0aaf['push'](_0x1e0aaf['shift']());}};_0x23c16e(++_0xdb3209);}(_0x20d6,0x76));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require(_0x620d('0x4'));var fs=require('fs');var Redis=require(_0x620d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))('rpc');var config=require(_0x620d('0x8'));var jayson=require(_0x620d('0x9'));var client=jayson['client'][_0x620d('0xa')]({'port':0x232a});config[_0x620d('0xb')]=_[_0x620d('0xc')](config[_0x620d('0xb')],{'host':_0x620d('0xd'),'port':0x18eb});var socket=require(_0x620d('0xe'))(new Redis(config['redis']));require(_0x620d('0xf'))['register'](socket);function respondWithRpcPromise(_0x3a9d12,_0x5a1f5c,_0x5930f3){return new BPromise(function(_0x2634d5,_0x5ea0cf){return client['request'](_0x3a9d12,_0x5930f3)[_0x620d('0x10')](function(_0x343359){logger[_0x620d('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x5a1f5c,_0x620d('0x12'));logger[_0x620d('0x13')](_0x620d('0x14'),_0x5a1f5c,_0x620d('0x12'),JSON[_0x620d('0x15')](_0x343359));if(_0x343359[_0x620d('0x16')]){if(_0x343359[_0x620d('0x16')][_0x620d('0x17')]===0x1f4){logger[_0x620d('0x16')](_0x620d('0x18'),_0x5a1f5c,_0x343359[_0x620d('0x16')][_0x620d('0x19')]);return _0x5ea0cf(_0x343359['error'][_0x620d('0x19')]);}logger[_0x620d('0x16')](_0x620d('0x18'),_0x5a1f5c,_0x343359[_0x620d('0x16')][_0x620d('0x19')]);return _0x2634d5(_0x343359['error'][_0x620d('0x19')]);}else{logger['info'](_0x620d('0x18'),_0x5a1f5c,_0x620d('0x12'));_0x2634d5(_0x343359[_0x620d('0x1a')][_0x620d('0x19')]);}})['catch'](function(_0x1e6bbd){logger[_0x620d('0x16')](_0x620d('0x18'),_0x5a1f5c,_0x1e6bbd);_0x5ea0cf(_0x1e6bbd);});});}exports['GetVoiceQueue']=function(_0x5876fe){var _0x22ae04=this;return new Promise(function(_0x5b2adc,_0x45d4e7){return db[_0x620d('0x1b')]['findAll']({'raw':_0x5876fe[_0x620d('0x1c')]?_0x5876fe[_0x620d('0x1c')][_0x620d('0x1d')]===undefined?!![]:![]:!![],'where':_0x5876fe[_0x620d('0x1c')]?_0x5876fe[_0x620d('0x1c')][_0x620d('0x1e')]||null:null,'attributes':_0x5876fe[_0x620d('0x1c')]?_0x5876fe[_0x620d('0x1c')][_0x620d('0x1f')]||null:null,'limit':_0x5876fe[_0x620d('0x1c')]?_0x5876fe['options'][_0x620d('0x20')]||null:null,'include':_0x5876fe[_0x620d('0x1c')]?_0x5876fe[_0x620d('0x1c')][_0x620d('0x21')]?_[_0x620d('0x22')](_0x5876fe[_0x620d('0x1c')][_0x620d('0x21')],function(_0xa75ea1){return{'model':db[_0xa75ea1[_0x620d('0x23')]],'as':_0xa75ea1['as'],'attributes':_0xa75ea1['attributes'],'include':_0xa75ea1[_0x620d('0x21')]?_['map'](_0xa75ea1[_0x620d('0x21')],function(_0x133238){return{'model':db[_0x133238[_0x620d('0x23')]],'as':_0x133238['as'],'attributes':_0x133238[_0x620d('0x1f')],'include':_0x133238['include']?_[_0x620d('0x22')](_0x133238['include'],function(_0x433c48){return{'model':db[_0x433c48[_0x620d('0x23')]],'as':_0x433c48['as'],'attributes':_0x433c48[_0x620d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d2e98){logger[_0x620d('0x11')](_0x620d('0x24'),_0x5876fe);logger['debug'](_0x620d('0x24'),_0x5876fe,JSON[_0x620d('0x15')](_0x1d2e98));_0x5b2adc(_0x1d2e98);})[_0x620d('0x25')](function(_0x3d92b9){logger[_0x620d('0x16')]('GetVoiceQueue',_0x3d92b9['message'],_0x5876fe);_0x45d4e7(_0x22ae04[_0x620d('0x16')](0x1f4,_0x3d92b9[_0x620d('0x19')]));});});};exports[_0x620d('0x26')]=function(_0x303395){var _0x444ece=this;return new Promise(function(_0x1c5fe9,_0x4f83d0){return db['VoiceQueue'][_0x620d('0x27')]({'raw':_0x303395[_0x620d('0x1c')]?_0x303395['options'][_0x620d('0x1d')]===undefined?!![]:![]:!![],'where':_0x303395[_0x620d('0x1c')]?_0x303395[_0x620d('0x1c')]['where']||null:null,'attributes':_0x303395[_0x620d('0x1c')]?_0x303395[_0x620d('0x1c')]['attributes']||null:null,'include':_0x303395[_0x620d('0x1c')]?_0x303395[_0x620d('0x1c')][_0x620d('0x21')]?_['map'](_0x303395[_0x620d('0x1c')][_0x620d('0x21')],function(_0x68ca6e){return{'model':db[_0x68ca6e[_0x620d('0x23')]],'as':_0x68ca6e['as'],'attributes':_0x68ca6e['attributes'],'include':_0x68ca6e[_0x620d('0x21')]?_['map'](_0x68ca6e['include'],function(_0x2d527b){return{'model':db[_0x2d527b[_0x620d('0x23')]],'as':_0x2d527b['as'],'attributes':_0x2d527b[_0x620d('0x1f')],'include':_0x2d527b[_0x620d('0x21')]?_[_0x620d('0x22')](_0x2d527b[_0x620d('0x21')],function(_0x4b908e){return{'model':db[_0x4b908e[_0x620d('0x23')]],'as':_0x4b908e['as'],'attributes':_0x4b908e[_0x620d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x620d('0x10')](function(_0x4c9c62){logger['info'](_0x620d('0x26'),_0x303395);logger['debug']('ShowVoiceQueue',_0x303395,JSON['stringify'](_0x4c9c62));_0x1c5fe9(_0x4c9c62);})[_0x620d('0x25')](function(_0x453013){logger[_0x620d('0x16')](_0x620d('0x26'),_0x453013[_0x620d('0x19')],_0x303395);_0x4f83d0(_0x444ece[_0x620d('0x16')](0x1f4,_0x453013[_0x620d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0ee8545..60cb324 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 _0x3440=['./voiceQueue.events','save','update','emit','removeListener','register','length'];(function(_0x10bb2a,_0x56b6b3){var _0x1b3d33=function(_0x1fdb5f){while(--_0x1fdb5f){_0x10bb2a['push'](_0x10bb2a['shift']());}};_0x1b3d33(++_0x56b6b3);}(_0x3440,0x9a));var _0x0344=function(_0x221e70,_0x3b8f57){_0x221e70=_0x221e70-0x0;var _0x42ebb8=_0x3440[_0x221e70];return _0x42ebb8;};'use strict';var VoiceQueueEvents=require(_0x0344('0x0'));var events=[_0x0344('0x1'),'remove',_0x0344('0x2')];function createListener(_0x50db8f,_0x4cc8c9){return function(_0x2cd023){_0x4cc8c9[_0x0344('0x3')](_0x50db8f,_0x2cd023);};}function removeListener(_0x1499e3,_0x1787a1){return function(){VoiceQueueEvents[_0x0344('0x4')](_0x1499e3,_0x1787a1);};}exports[_0x0344('0x5')]=function(_0x6cb14c){for(var _0x2f8343=0x0,_0x513bf8=events[_0x0344('0x6')];_0x2f8343<_0x513bf8;_0x2f8343++){var _0x19f9fd=events[_0x2f8343];var _0x171d9d=createListener('voiceQueue:'+_0x19f9fd,_0x6cb14c);VoiceQueueEvents['on'](_0x19f9fd,_0x171d9d);}}; \ No newline at end of file +var _0x2e26=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x4f2cb,_0xd72207){var _0x1e895b=function(_0x28f350){while(--_0x28f350){_0x4f2cb['push'](_0x4f2cb['shift']());}};_0x1e895b(++_0xd72207);}(_0x2e26,0xc1));var _0x62e2=function(_0xa5bd5b,_0x5294d9){_0xa5bd5b=_0xa5bd5b-0x0;var _0x340535=_0x2e26[_0xa5bd5b];return _0x340535;};'use strict';var VoiceQueueEvents=require(_0x62e2('0x0'));var events=['save',_0x62e2('0x1'),_0x62e2('0x2')];function createListener(_0x360796,_0x508c97){return function(_0x951572){_0x508c97[_0x62e2('0x3')](_0x360796,_0x951572);};}function removeListener(_0x122d09,_0x5b1534){return function(){VoiceQueueEvents[_0x62e2('0x4')](_0x122d09,_0x5b1534);};}exports[_0x62e2('0x5')]=function(_0x506b03){for(var _0x291001=0x0,_0x52c7b9=events['length'];_0x291001<_0x52c7b9;_0x291001++){var _0x1efc88=events[_0x291001];var _0x3c53cb=createListener(_0x62e2('0x6')+_0x1efc88,_0x506b03);VoiceQueueEvents['on'](_0x1efc88,_0x3c53cb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 5d23f4c..be5a94e 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 _0xef17=['index','/describe','/index','getVoiceQueuesReport','/:id','isAuthenticated','show','post','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2c48e1,_0xa89096){var _0x440f67=function(_0x5045b1){while(--_0x5045b1){_0x2c48e1['push'](_0x2c48e1['shift']());}};_0x440f67(++_0xa89096);}(_0xef17,0x136));var _0x7ef1=function(_0x5810e4,_0x47e784){_0x5810e4=_0x5810e4-0x0;var _0x57a636=_0xef17[_0x5810e4];return _0x57a636;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var auth=require(_0x7ef1('0x6'));var interaction=require(_0x7ef1('0x7'));var config=require(_0x7ef1('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x7ef1('0x9')]('/',auth['isAuthenticated'](),controller[_0x7ef1('0xa')]);router['get'](_0x7ef1('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7ef1('0x9')](_0x7ef1('0xc'),auth['isAuthenticated'](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0x9')](_0x7ef1('0xe'),auth[_0x7ef1('0xf')](),controller[_0x7ef1('0x10')]);router[_0x7ef1('0x11')]('/',auth[_0x7ef1('0xf')](),controller['create']);router['put'](_0x7ef1('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7ef1('0xe'),auth['isAuthenticated'](),controller[_0x7ef1('0x12')]);module[_0x7ef1('0x13')]=router; \ No newline at end of file +var _0x444e=['index','getVoiceQueuesReport','show','post','create','delete','/:id','destroy','multer','path','express','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated'];(function(_0x3c0051,_0x4b3d5d){var _0x654720=function(_0x368414){while(--_0x368414){_0x3c0051['push'](_0x3c0051['shift']());}};_0x654720(++_0x4b3d5d);}(_0x444e,0xe8));var _0xe444=function(_0x212deb,_0x360d11){_0x212deb=_0x212deb-0x0;var _0x2ce4c4=_0x444e[_0x212deb];return _0x2ce4c4;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var auth=require(_0xe444('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe444('0x4'));var controller=require(_0xe444('0x5'));router[_0xe444('0x6')]('/',auth[_0xe444('0x7')](),controller[_0xe444('0x8')]);router[_0xe444('0x6')]('/describe',auth[_0xe444('0x7')](),controller['describe']);router[_0xe444('0x6')]('/index',auth[_0xe444('0x7')](),controller[_0xe444('0x9')]);router[_0xe444('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xe444('0xa')]);router[_0xe444('0xb')]('/',auth['isAuthenticated'](),controller[_0xe444('0xc')]);router['put']('/:id',auth[_0xe444('0x7')](),controller['update']);router[_0xe444('0xd')](_0xe444('0xe'),auth['isAuthenticated'](),controller[_0xe444('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index be87147..a663fbb 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 _0x96f5=['format','YYYY-MM-DD\x20HH:mm:ss','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x10092e,_0x36be0b){var _0x3133e2=function(_0x8c182e){while(--_0x8c182e){_0x10092e['push'](_0x10092e['shift']());}};_0x3133e2(++_0x36be0b);}(_0x96f5,0x133));var _0x596f=function(_0x5e39dd,_0x1c914d){_0x5e39dd=_0x5e39dd-0x0;var _0x3ae379=_0x96f5[_0x5e39dd];return _0x3ae379;};'use strict';var Sequelize=require(_0x596f('0x0'));var moment=require(_0x596f('0x1'));module[_0x596f('0x2')]={'type':{'type':Sequelize[_0x596f('0x3')]},'uniqueid':{'type':Sequelize[_0x596f('0x3')]},'calleridnum':{'type':Sequelize[_0x596f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x596f('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x596f('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x11a7bb){var _0x28d853=moment(_0x11a7bb);var _0x50f446=moment(this['getDataValue']('queuecallerjoinAt'))[_0x596f('0x5')](_0x596f('0x6'));var _0x392f78=_0x28d853['diff'](_0x50f446,'seconds');this['setDataValue'](_0x596f('0x7'),_0x11a7bb);this['setDataValue'](_0x596f('0x8'),_0x392f78||null);}},'position':{'type':Sequelize[_0x596f('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x596f('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x596f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x596f('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x596f('0x4')]},'queuecallerexit':{'type':Sequelize[_0x596f('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x596f('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x596f('0x3')]},'connectedlinenum':{'type':Sequelize[_0x596f('0x3')]},'connectedlinename':{'type':Sequelize[_0x596f('0x3')]},'accountcode':{'type':Sequelize[_0x596f('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x596f('0x3')]},'priority':{'type':Sequelize[_0x596f('0x3')]},'holdtime':{'type':Sequelize[_0x596f('0x9')]},'mohtime':{'type':Sequelize[_0x596f('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x596f('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x596f('0x3')]},'transfer':{'type':Sequelize[_0x596f('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x596f('0x3')],'comment':_0x596f('0xb')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x596f('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x596f('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x78d2=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE'];(function(_0x37fb83,_0x11fa4c){var _0x429520=function(_0x341e19){while(--_0x341e19){_0x37fb83['push'](_0x37fb83['shift']());}};_0x429520(++_0x11fa4c);}(_0x78d2,0xdf));var _0x278d=function(_0x1915e2,_0x51f382){_0x1915e2=_0x1915e2-0x0;var _0x550ab2=_0x78d2[_0x1915e2];return _0x550ab2;};'use strict';var Sequelize=require(_0x278d('0x0'));var moment=require(_0x278d('0x1'));module[_0x278d('0x2')]={'type':{'type':Sequelize[_0x278d('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x278d('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1c5f52){var _0x4c9354=moment(_0x1c5f52);var _0x458841=moment(this[_0x278d('0x4')]('queuecallerjoinAt'))[_0x278d('0x5')](_0x278d('0x6'));var _0x2729c8=_0x4c9354[_0x278d('0x7')](_0x458841,_0x278d('0x8'));this[_0x278d('0x9')](_0x278d('0xa'),_0x1c5f52);this[_0x278d('0x9')](_0x278d('0xb'),_0x2729c8||null);}},'position':{'type':Sequelize[_0x278d('0xc')]},'count':{'type':Sequelize[_0x278d('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x278d('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x278d('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x278d('0xe')]},'queuecallerexit':{'type':Sequelize[_0x278d('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x278d('0x3')],'comment':_0x278d('0xf')},'originalposition':{'type':Sequelize[_0x278d('0xc')]},'channel':{'type':Sequelize[_0x278d('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x278d('0x3')]},'accountcode':{'type':Sequelize[_0x278d('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x278d('0x3')]},'priority':{'type':Sequelize[_0x278d('0x3')]},'holdtime':{'type':Sequelize[_0x278d('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x278d('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x278d('0x3')]},'transfer':{'type':Sequelize[_0x278d('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x278d('0x3')],'comment':_0x278d('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x278d('0x3')]},'disposition':{'type':Sequelize[_0x278d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x278d('0xc')],'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 7762adc..55c66a3 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 _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0xfe553a,_0x2e3727){_0xfe553a=_0xfe553a-0x0;var _0xea3440=_0x7a54[_0xfe553a];return _0xea3440;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file +var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x1225e8,_0x1c8fde){_0x1225e8=_0x1225e8-0x0;var _0x59d75d=_0x7a54[_0x1225e8];return _0x59d75d;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 78f591c..5565804 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 _0x5142=['VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x108c04,_0x52fac3){var _0x4bdd87=function(_0x382186){while(--_0x382186){_0x108c04['push'](_0x108c04['shift']());}};_0x4bdd87(++_0x52fac3);}(_0x5142,0xbb));var _0x2514=function(_0xff3d27,_0x2323a0){_0xff3d27=_0xff3d27-0x0;var _0x3f8710=_0x5142[_0xff3d27];return _0x3f8710;};'use strict';var EventEmitter=require(_0x2514('0x0'));var VoiceQueueReport=require(_0x2514('0x1'))['db'][_0x2514('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2514('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2514('0x4')};function emitEvent(_0x1a3874){return function(_0x3a6065,_0x4eaa1e,_0x525710){VoiceQueueReportEvents['emit'](_0x1a3874+':'+_0x3a6065['id'],_0x3a6065);VoiceQueueReportEvents[_0x2514('0x5')](_0x1a3874,_0x3a6065);_0x525710(null);};}for(var e in events){if(events[_0x2514('0x6')](e)){var event=events[e];VoiceQueueReport[_0x2514('0x7')](e,emitEvent(event));}}module[_0x2514('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xef17=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xef17,0x1be));var _0x7ef1=function(_0x49140d,_0x1bb53a){_0x49140d=_0x49140d-0x0;var _0x5961e2=_0xef17[_0x49140d];return _0x5961e2;};'use strict';var EventEmitter=require(_0x7ef1('0x0'));var VoiceQueueReport=require(_0x7ef1('0x1'))['db'][_0x7ef1('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ef1('0x3'),'afterUpdate':_0x7ef1('0x4'),'afterDestroy':_0x7ef1('0x5')};function emitEvent(_0x268ed2){return function(_0x127bdc,_0x44634a,_0x5b2518){VoiceQueueReportEvents[_0x7ef1('0x6')](_0x268ed2+':'+_0x127bdc['id'],_0x127bdc);VoiceQueueReportEvents['emit'](_0x268ed2,_0x127bdc);_0x5b2518(null);};}for(var e in events){if(events[_0x7ef1('0x7')](e)){var event=events[e];VoiceQueueReport[_0x7ef1('0x8')](e,emitEvent(event));}}module[_0x7ef1('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 5d8ae45..e670258 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 _0xa69e=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','lodash'];(function(_0x523ccb,_0x2a9266){var _0x120c09=function(_0x4d9f20){while(--_0x4d9f20){_0x523ccb['push'](_0x523ccb['shift']());}};_0x120c09(++_0x2a9266);}(_0xa69e,0x176));var _0xea69=function(_0x1d23c6,_0x22d45b){_0x1d23c6=_0x1d23c6-0x0;var _0x2e25ac=_0xa69e[_0x1d23c6];return _0x2e25ac;};'use strict';var _=require(_0xea69('0x0'));var util=require(_0xea69('0x1'));var logger=require('../../config/logger')(_0xea69('0x2'));var moment=require(_0xea69('0x3'));var BPromise=require(_0xea69('0x4'));var rp=require(_0xea69('0x5'));var fs=require('fs');var path=require(_0xea69('0x6'));var rimraf=require(_0xea69('0x7'));var config=require(_0xea69('0x8'));var attributes=require(_0xea69('0x9'));module[_0xea69('0xa')]=function(_0x14d22f,_0x158ca7){return _0x14d22f[_0xea69('0xb')]('VoiceQueueReport',attributes,{'tableName':_0xea69('0xc'),'paranoid':![],'indexes':[{'fields':[_0xea69('0xd')]},{'fields':[_0xea69('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a1c=['path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x175892,_0x4a3e56){var _0x307ab9=function(_0x1d162c){while(--_0x1d162c){_0x175892['push'](_0x175892['shift']());}};_0x307ab9(++_0x4a3e56);}(_0x4a1c,0x140));var _0xc4a1=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0x4a1c[_0x364b32];return _0x3f3ea0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc4a1('0x0'))(_0xc4a1('0x1'));var moment=require(_0xc4a1('0x2'));var BPromise=require(_0xc4a1('0x3'));var rp=require(_0xc4a1('0x4'));var fs=require('fs');var path=require(_0xc4a1('0x5'));var rimraf=require(_0xc4a1('0x6'));var config=require('../../config/environment');var attributes=require(_0xc4a1('0x7'));module[_0xc4a1('0x8')]=function(_0x3d7243,_0xac2ea){return _0x3d7243[_0xc4a1('0x9')](_0xc4a1('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xc4a1('0xb')]},{'fields':[_0xc4a1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5d83356..d8cabe4 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 _0xc22c=['model','then','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map'];(function(_0x54bb33,_0x15fb65){var _0x5ac2a9=function(_0x3e2b4f){while(--_0x3e2b4f){_0x54bb33['push'](_0x54bb33['shift']());}};_0x5ac2a9(++_0x15fb65);}(_0xc22c,0x7f));var _0xcc22=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0xc22c[_0x589f71];return _0x5763bd;};'use strict';var _=require(_0xcc22('0x0'));var util=require(_0xcc22('0x1'));var moment=require('moment');var BPromise=require(_0xcc22('0x2'));var rs=require(_0xcc22('0x3'));var fs=require('fs');var Redis=require(_0xcc22('0x4'));var db=require(_0xcc22('0x5'))['db'];var utils=require(_0xcc22('0x6'));var logger=require(_0xcc22('0x7'))('rpc');var config=require(_0xcc22('0x8'));var jayson=require(_0xcc22('0x9'));var client=jayson[_0xcc22('0xa')]['http']({'port':0x232a});config[_0xcc22('0xb')]=_[_0xcc22('0xc')](config[_0xcc22('0xb')],{'host':_0xcc22('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc22('0xb')]));require('./voiceQueueReport.socket')[_0xcc22('0xe')](socket);function respondWithRpcPromise(_0x1b1831,_0x7f71a7,_0x290c9d){return new BPromise(function(_0x518223,_0x50689c){return client['request'](_0x1b1831,_0x290c9d)['then'](function(_0x1ae685){logger[_0xcc22('0xf')](_0xcc22('0x10'),_0x7f71a7,'request\x20sent');logger[_0xcc22('0x11')](_0xcc22('0x12'),_0x7f71a7,'request\x20sent',JSON['stringify'](_0x1ae685));if(_0x1ae685[_0xcc22('0x13')]){if(_0x1ae685[_0xcc22('0x13')]['code']===0x1f4){logger[_0xcc22('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x7f71a7,_0x1ae685[_0xcc22('0x13')]['message']);return _0x50689c(_0x1ae685['error'][_0xcc22('0x14')]);}logger[_0xcc22('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x7f71a7,_0x1ae685['error'][_0xcc22('0x14')]);return _0x518223(_0x1ae685[_0xcc22('0x13')][_0xcc22('0x14')]);}else{logger[_0xcc22('0xf')](_0xcc22('0x10'),_0x7f71a7,_0xcc22('0x15'));_0x518223(_0x1ae685[_0xcc22('0x16')][_0xcc22('0x14')]);}})[_0xcc22('0x17')](function(_0x4c1a01){logger[_0xcc22('0x13')](_0xcc22('0x10'),_0x7f71a7,_0x4c1a01);_0x50689c(_0x4c1a01);});});}exports[_0xcc22('0x18')]=function(_0x1fed32){var _0x2074bb=this;return new Promise(function(_0x53fbe9,_0x5e0861){return db[_0xcc22('0x19')]['findAll']({'raw':_0x1fed32['options']?_0x1fed32[_0xcc22('0x1a')][_0xcc22('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fed32[_0xcc22('0x1a')]?_0x1fed32[_0xcc22('0x1a')][_0xcc22('0x1c')]||null:null,'attributes':_0x1fed32['options']?_0x1fed32[_0xcc22('0x1a')][_0xcc22('0x1d')]||null:null,'limit':_0x1fed32[_0xcc22('0x1a')]?_0x1fed32[_0xcc22('0x1a')][_0xcc22('0x1e')]||null:null,'include':_0x1fed32[_0xcc22('0x1a')]?_0x1fed32['options'][_0xcc22('0x1f')]?_[_0xcc22('0x20')](_0x1fed32[_0xcc22('0x1a')]['include'],function(_0x5cf877){return{'model':db[_0x5cf877[_0xcc22('0x21')]],'as':_0x5cf877['as'],'attributes':_0x5cf877['attributes'],'include':_0x5cf877[_0xcc22('0x1f')]?_['map'](_0x5cf877[_0xcc22('0x1f')],function(_0x5edc72){return{'model':db[_0x5edc72[_0xcc22('0x21')]],'as':_0x5edc72['as'],'attributes':_0x5edc72[_0xcc22('0x1d')],'include':_0x5edc72[_0xcc22('0x1f')]?_[_0xcc22('0x20')](_0x5edc72[_0xcc22('0x1f')],function(_0xb4309e){return{'model':db[_0xb4309e[_0xcc22('0x21')]],'as':_0xb4309e['as'],'attributes':_0xb4309e['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc22('0x22')](function(_0x230c2c){logger[_0xcc22('0xf')]('GetVoiceQueueReport',_0x1fed32);logger['debug'](_0xcc22('0x18'),_0x1fed32,JSON['stringify'](_0x230c2c));_0x53fbe9(_0x230c2c);})['catch'](function(_0x57f8b0){logger[_0xcc22('0x13')](_0xcc22('0x18'),_0x57f8b0[_0xcc22('0x14')],_0x1fed32);_0x5e0861(_0x2074bb['error'](0x1f4,_0x57f8b0[_0xcc22('0x14')]));});});};exports[_0xcc22('0x23')]=function(_0x2dcb88){var _0x4036c5=this;return new Promise(function(_0x3bde1d,_0x4c6a2d){return db[_0xcc22('0x19')]['create'](_0x2dcb88['body'],{'raw':_0x2dcb88[_0xcc22('0x1a')]?_0x2dcb88['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3f45b3){logger[_0xcc22('0xf')](_0xcc22('0x23'),_0x2dcb88);logger['debug'](_0xcc22('0x23'),_0x2dcb88,JSON['stringify'](_0x3f45b3));_0x3bde1d(_0x3f45b3);})[_0xcc22('0x17')](function(_0x53ccd9){logger['error']('CreateVoiceQueueReport',_0x53ccd9['message'],_0x2dcb88);_0x4c6a2d(_0x4036c5['error'](0x1f4,_0x53ccd9['message']));});});};exports[_0xcc22('0x24')]=function(_0x8a346f){var _0x40dc09=this;return new Promise(function(_0x443fcf,_0x251af4){return db[_0xcc22('0x19')][_0xcc22('0x25')](_0x8a346f[_0xcc22('0x26')],{'raw':_0x8a346f[_0xcc22('0x1a')]?_0x8a346f['options'][_0xcc22('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a346f[_0xcc22('0x1a')]?_0x8a346f['options']['where']||null:null,'attributes':_0x8a346f[_0xcc22('0x1a')]?_0x8a346f[_0xcc22('0x1a')][_0xcc22('0x1d')]||null:null,'limit':_0x8a346f[_0xcc22('0x1a')]?_0x8a346f[_0xcc22('0x1a')][_0xcc22('0x1e')]||null:null})['then'](function(_0x38744e){logger[_0xcc22('0xf')](_0xcc22('0x24'),_0x8a346f);logger[_0xcc22('0x11')](_0xcc22('0x24'),_0x8a346f,JSON[_0xcc22('0x27')](_0x38744e));_0x443fcf(_0x38744e);})[_0xcc22('0x17')](function(_0x5f3a5c){logger[_0xcc22('0x13')](_0xcc22('0x24'),_0x5f3a5c[_0xcc22('0x14')],_0x8a346f);_0x251af4(_0x40dc09[_0xcc22('0x13')](0x1f4,_0x5f3a5c[_0xcc22('0x14')]));});});}; \ No newline at end of file +var _0x8343=['where','attributes','limit','include','map','model','stringify','CreateVoiceQueueReport','body','then','UpdateVoiceQueueReport','update','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options'];(function(_0xb23c05,_0xbb6c8a){var _0xde8542=function(_0x4c096d){while(--_0x4c096d){_0xb23c05['push'](_0xb23c05['shift']());}};_0xde8542(++_0xbb6c8a);}(_0x8343,0x175));var _0x3834=function(_0x2af95d,_0xd602d6){_0x2af95d=_0x2af95d-0x0;var _0x17c87b=_0x8343[_0x2af95d];return _0x17c87b;};'use strict';var _=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var moment=require(_0x3834('0x2'));var BPromise=require('bluebird');var rs=require(_0x3834('0x3'));var fs=require('fs');var Redis=require(_0x3834('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3834('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3834('0x6'));var client=jayson[_0x3834('0x7')][_0x3834('0x8')]({'port':0x232a});config[_0x3834('0x9')]=_['defaults'](config[_0x3834('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3834('0xa'))(new Redis(config[_0x3834('0x9')]));require(_0x3834('0xb'))[_0x3834('0xc')](socket);function respondWithRpcPromise(_0x28ea6c,_0x1e0031,_0x3fa76c){return new BPromise(function(_0xf1b549,_0x448182){return client[_0x3834('0xd')](_0x28ea6c,_0x3fa76c)['then'](function(_0x1ae1cb){logger[_0x3834('0xe')](_0x3834('0xf'),_0x1e0031,_0x3834('0x10'));logger[_0x3834('0x11')](_0x3834('0x12'),_0x1e0031,_0x3834('0x10'),JSON['stringify'](_0x1ae1cb));if(_0x1ae1cb[_0x3834('0x13')]){if(_0x1ae1cb[_0x3834('0x13')][_0x3834('0x14')]===0x1f4){logger[_0x3834('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e0031,_0x1ae1cb['error'][_0x3834('0x15')]);return _0x448182(_0x1ae1cb[_0x3834('0x13')][_0x3834('0x15')]);}logger[_0x3834('0x13')](_0x3834('0xf'),_0x1e0031,_0x1ae1cb[_0x3834('0x13')][_0x3834('0x15')]);return _0xf1b549(_0x1ae1cb[_0x3834('0x13')]['message']);}else{logger[_0x3834('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e0031,_0x3834('0x10'));_0xf1b549(_0x1ae1cb['result'][_0x3834('0x15')]);}})[_0x3834('0x16')](function(_0x36c51f){logger[_0x3834('0x13')](_0x3834('0xf'),_0x1e0031,_0x36c51f);_0x448182(_0x36c51f);});});}exports[_0x3834('0x17')]=function(_0x32d848){var _0x315b8f=this;return new Promise(function(_0x492bec,_0x53aaa3){return db[_0x3834('0x18')][_0x3834('0x19')]({'raw':_0x32d848[_0x3834('0x1a')]?_0x32d848['options']['raw']===undefined?!![]:![]:!![],'where':_0x32d848['options']?_0x32d848['options'][_0x3834('0x1b')]||null:null,'attributes':_0x32d848['options']?_0x32d848[_0x3834('0x1a')][_0x3834('0x1c')]||null:null,'limit':_0x32d848[_0x3834('0x1a')]?_0x32d848['options'][_0x3834('0x1d')]||null:null,'include':_0x32d848[_0x3834('0x1a')]?_0x32d848['options'][_0x3834('0x1e')]?_[_0x3834('0x1f')](_0x32d848['options'][_0x3834('0x1e')],function(_0x171862){return{'model':db[_0x171862[_0x3834('0x20')]],'as':_0x171862['as'],'attributes':_0x171862[_0x3834('0x1c')],'include':_0x171862['include']?_[_0x3834('0x1f')](_0x171862[_0x3834('0x1e')],function(_0x1d1022){return{'model':db[_0x1d1022[_0x3834('0x20')]],'as':_0x1d1022['as'],'attributes':_0x1d1022[_0x3834('0x1c')],'include':_0x1d1022[_0x3834('0x1e')]?_['map'](_0x1d1022[_0x3834('0x1e')],function(_0x77a2bd){return{'model':db[_0x77a2bd['model']],'as':_0x77a2bd['as'],'attributes':_0x77a2bd[_0x3834('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b8652){logger[_0x3834('0xe')](_0x3834('0x17'),_0x32d848);logger['debug']('GetVoiceQueueReport',_0x32d848,JSON[_0x3834('0x21')](_0x2b8652));_0x492bec(_0x2b8652);})['catch'](function(_0x432b4c){logger[_0x3834('0x13')](_0x3834('0x17'),_0x432b4c['message'],_0x32d848);_0x53aaa3(_0x315b8f[_0x3834('0x13')](0x1f4,_0x432b4c[_0x3834('0x15')]));});});};exports[_0x3834('0x22')]=function(_0x38dcc4){var _0x555d43=this;return new Promise(function(_0x120594,_0x1f0168){return db['VoiceQueueReport']['create'](_0x38dcc4[_0x3834('0x23')],{'raw':_0x38dcc4['options']?_0x38dcc4['options']['raw']===undefined?!![]:![]:!![]})[_0x3834('0x24')](function(_0x28352f){logger[_0x3834('0xe')](_0x3834('0x22'),_0x38dcc4);logger[_0x3834('0x11')](_0x3834('0x22'),_0x38dcc4,JSON[_0x3834('0x21')](_0x28352f));_0x120594(_0x28352f);})[_0x3834('0x16')](function(_0x3d01ae){logger[_0x3834('0x13')](_0x3834('0x22'),_0x3d01ae[_0x3834('0x15')],_0x38dcc4);_0x1f0168(_0x555d43[_0x3834('0x13')](0x1f4,_0x3d01ae[_0x3834('0x15')]));});});};exports[_0x3834('0x25')]=function(_0x1cfce1){var _0x49a17a=this;return new Promise(function(_0x3570a5,_0x3a7770){return db['VoiceQueueReport'][_0x3834('0x26')](_0x1cfce1[_0x3834('0x23')],{'raw':_0x1cfce1[_0x3834('0x1a')]?_0x1cfce1['options'][_0x3834('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cfce1[_0x3834('0x1a')]?_0x1cfce1['options'][_0x3834('0x1b')]||null:null,'attributes':_0x1cfce1['options']?_0x1cfce1[_0x3834('0x1a')]['attributes']||null:null,'limit':_0x1cfce1[_0x3834('0x1a')]?_0x1cfce1[_0x3834('0x1a')][_0x3834('0x1d')]||null:null})[_0x3834('0x24')](function(_0x1f4357){logger[_0x3834('0xe')](_0x3834('0x25'),_0x1cfce1);logger[_0x3834('0x11')](_0x3834('0x25'),_0x1cfce1,JSON[_0x3834('0x21')](_0x1f4357));_0x3570a5(_0x1f4357);})[_0x3834('0x16')](function(_0x354078){logger[_0x3834('0x13')](_0x3834('0x25'),_0x354078[_0x3834('0x15')],_0x1cfce1);_0x3a7770(_0x49a17a['error'](0x1f4,_0x354078[_0x3834('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index fa0184c..5177e3a 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 _0xc4f6=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','register'];(function(_0x47f8ba,_0x53ed87){var _0x4eb6cf=function(_0x4a88da){while(--_0x4a88da){_0x47f8ba['push'](_0x47f8ba['shift']());}};_0x4eb6cf(++_0x53ed87);}(_0xc4f6,0x64));var _0x6c4f=function(_0x1ff923,_0x3fba56){_0x1ff923=_0x1ff923-0x0;var _0x211ab9=_0xc4f6[_0x1ff923];return _0x211ab9;};'use strict';var VoiceQueueReportEvents=require(_0x6c4f('0x0'));var events=[_0x6c4f('0x1'),'remove',_0x6c4f('0x2')];function createListener(_0x46612a,_0x2bc29a){return function(_0x4192e4){_0x2bc29a[_0x6c4f('0x3')](_0x46612a,_0x4192e4);};}function removeListener(_0x1f342e,_0x4df593){return function(){VoiceQueueReportEvents['removeListener'](_0x1f342e,_0x4df593);};}exports[_0x6c4f('0x4')]=function(_0x36b51b){for(var _0x34fbd8=0x0,_0x36882d=events[_0x6c4f('0x5')];_0x34fbd8<_0x36882d;_0x34fbd8++){var _0x163215=events[_0x34fbd8];var _0x14f99c=createListener(_0x6c4f('0x6')+_0x163215,_0x36b51b);VoiceQueueReportEvents['on'](_0x163215,_0x14f99c);}}; \ No newline at end of file +var _0xeefe=['./voiceQueueReport.events','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0x35db8f,_0x1657d2){var _0x49173b=function(_0x1aeb1a){while(--_0x1aeb1a){_0x35db8f['push'](_0x35db8f['shift']());}};_0x49173b(++_0x1657d2);}(_0xeefe,0xd9));var _0xeeef=function(_0x39b913,_0x46e913){_0x39b913=_0x39b913-0x0;var _0x131c47=_0xeefe[_0x39b913];return _0x131c47;};'use strict';var VoiceQueueReportEvents=require(_0xeeef('0x0'));var events=['save','remove',_0xeeef('0x1')];function createListener(_0x1f5d17,_0x34abf8){return function(_0x45a98b){_0x34abf8[_0xeeef('0x2')](_0x1f5d17,_0x45a98b);};}function removeListener(_0x510186,_0x49e158){return function(){VoiceQueueReportEvents[_0xeeef('0x3')](_0x510186,_0x49e158);};}exports[_0xeeef('0x4')]=function(_0x5d32ae){for(var _0x2d0881=0x0,_0x85ba4c=events[_0xeeef('0x5')];_0x2d0881<_0x85ba4c;_0x2d0881++){var _0x39b6df=events[_0x2d0881];var _0x1cae49=createListener(_0xeeef('0x6')+_0x39b6df,_0x5d32ae);VoiceQueueReportEvents['on'](_0x39b6df,_0x1cae49);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9cd5d8d..fc6a392 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 _0x3912=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xb02e98,_0x1291e3){var _0x1de2cf=function(_0xe3d2e0){while(--_0xe3d2e0){_0xb02e98['push'](_0xb02e98['shift']());}};_0x1de2cf(++_0x1291e3);}(_0x3912,0xdc));var _0x2391=function(_0x2dad13,_0xc198f2){_0x2dad13=_0x2dad13-0x0;var _0x3b3417=_0x3912[_0x2dad13];return _0x3b3417;};'use strict';var multer=require(_0x2391('0x0'));var util=require('util');var path=require(_0x2391('0x1'));var timeout=require(_0x2391('0x2'));var express=require(_0x2391('0x3'));var router=express[_0x2391('0x4')]();var auth=require(_0x2391('0x5'));var interaction=require(_0x2391('0x6'));var config=require(_0x2391('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x2391('0x8')]('/',auth[_0x2391('0x9')](),controller[_0x2391('0xa')]);router[_0x2391('0x8')](_0x2391('0xb'),auth['isAuthenticated'](),controller[_0x2391('0xc')]);router[_0x2391('0xd')]('/',auth[_0x2391('0x9')](),controller[_0x2391('0xe')]);router[_0x2391('0xf')](_0x2391('0xb'),auth[_0x2391('0x9')](),controller[_0x2391('0x10')]);router[_0x2391('0x11')](_0x2391('0xb'),auth[_0x2391('0x9')](),controller[_0x2391('0x12')]);module[_0x2391('0x13')]=router; \ No newline at end of file +var _0x5643=['delete','/:id','destroy','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','put','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5643,0x162));var _0x3564=function(_0x23a14e,_0x125a00){_0x23a14e=_0x23a14e-0x0;var _0x31f181=_0x5643[_0x23a14e];return _0x31f181;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3564('0x0')]();var auth=require(_0x3564('0x1'));var interaction=require(_0x3564('0x2'));var config=require(_0x3564('0x3'));var controller=require('./voiceQueuesLog.controller');router[_0x3564('0x4')]('/',auth[_0x3564('0x5')](),controller['index']);router[_0x3564('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x3564('0x6')]);router[_0x3564('0x7')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3564('0x8')]('/:id',auth[_0x3564('0x5')](),controller[_0x3564('0x9')]);router[_0x3564('0xa')](_0x3564('0xb'),auth[_0x3564('0x5')](),controller[_0x3564('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index cb92f3a..3cbf21f 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 _0xc2b0=['sequelize','moment','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x164974,_0x32e0f8){var _0xd609c8=function(_0x4422a7){while(--_0x4422a7){_0x164974['push'](_0x164974['shift']());}};_0xd609c8(++_0x32e0f8);}(_0xc2b0,0x66));var _0x0c2b=function(_0xce1a87,_0x372c44){_0xce1a87=_0xce1a87-0x0;var _0x26669d=_0xc2b0[_0xce1a87];return _0x26669d;};'use strict';var Sequelize=require(_0x0c2b('0x0'));var moment=require(_0x0c2b('0x1'));module[_0x0c2b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0c2b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x0c2b('0x4')](_0x0c2b('0x5'))}}; \ No newline at end of file +var _0xda44=['sequelize','moment','STRING','DATE','format'];(function(_0x54fdd8,_0x2e81ae){var _0x4f6f8a=function(_0x2a970c){while(--_0x2a970c){_0x54fdd8['push'](_0x54fdd8['shift']());}};_0x4f6f8a(++_0x2e81ae);}(_0xda44,0x1d1));var _0x4da4=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xda44[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x4da4('0x0'));var moment=require(_0x4da4('0x1'));module['exports']={'time':{'type':Sequelize[_0x4da4('0x2')]},'callid':{'type':Sequelize[_0x4da4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4da4('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4da4('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4da4('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4da4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4da4('0x3')],'allowNull':![],'defaultValue':moment()[_0x4da4('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f5c3b73..ccdf960 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 _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x50c02d,_0x582cf8){var _0x3089ea=function(_0x495af9){while(--_0x495af9){_0x50c02d['push'](_0x50c02d['shift']());}};_0x3089ea(++_0x582cf8);}(_0xb10b,0x12a));var _0xbb10=function(_0x406b98,_0x3dea6d){_0x406b98=_0x406b98-0x0;var _0x10545f=_0xb10b[_0x406b98];return _0x10545f;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file +var _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x45405b,_0x207f59){var _0x41ff74=function(_0x25a7cc){while(--_0x25a7cc){_0x45405b['push'](_0x45405b['shift']());}};_0x41ff74(++_0x207f59);}(_0xb10b,0x12a));var _0xbb10=function(_0x69ede,_0x3f8e97){_0x69ede=_0x69ede-0x0;var _0x13e7e1=_0xb10b[_0x69ede];return _0x13e7e1;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 26ec651..422fea4 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 _0x4fb4=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20d0b6,_0xc58c6){var _0x89a852=function(_0x155e62){while(--_0x155e62){_0x20d0b6['push'](_0x20d0b6['shift']());}};_0x89a852(++_0xc58c6);}(_0x4fb4,0x190));var _0x44fb=function(_0x31a9aa,_0x508000){_0x31a9aa=_0x31a9aa-0x0;var _0x976b22=_0x4fb4[_0x31a9aa];return _0x976b22;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var logger=require(_0x44fb('0x1'))(_0x44fb('0x2'));var moment=require(_0x44fb('0x3'));var BPromise=require(_0x44fb('0x4'));var rp=require(_0x44fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var attributes=require(_0x44fb('0x8'));module[_0x44fb('0x9')]=function(_0x375d33,_0x173e70){return _0x375d33[_0x44fb('0xa')](_0x44fb('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x44fb('0xc'),'fields':[_0x44fb('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xe2fe=['event_dtm','dtm','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x302325,_0x51c70c){var _0x3d0e32=function(_0x5deadb){while(--_0x5deadb){_0x302325['push'](_0x302325['shift']());}};_0x3d0e32(++_0x51c70c);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xee2f('0xa'),'fields':['event',_0xee2f('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f1d2a22..630cdc9 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 _0x34b7=['stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x5aeb9b,_0x25fa2a){var _0x166300=function(_0x4ef23c){while(--_0x4ef23c){_0x5aeb9b['push'](_0x5aeb9b['shift']());}};_0x166300(++_0x25fa2a);}(_0x34b7,0x196));var _0x734b=function(_0xbb146,_0x1b3260){_0xbb146=_0xbb146-0x0;var _0x5094d0=_0x34b7[_0xbb146];return _0x5094d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});} \ No newline at end of file +var _0x3f8c=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info'];(function(_0x28d685,_0x20a8b0){var _0x5abd39=function(_0x2cd5f3){while(--_0x2cd5f3){_0x28d685['push'](_0x28d685['shift']());}};_0x5abd39(++_0x20a8b0);}(_0x3f8c,0x104));var _0xc3f8=function(_0x523f81,_0x1769e0){_0x523f81=_0x523f81-0x0;var _0x23a2b2=_0x3f8c[_0x523f81];return _0x23a2b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c544db5..8818bf5 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 _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x131776,_0x8b1dc7){var _0x15a4e2=function(_0x428008){while(--_0x428008){_0x131776['push'](_0x131776['shift']());}};_0x15a4e2(++_0x8b1dc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x4ba5e3,_0x3fb9b8){var _0xbb1325=function(_0x2d77cf){while(--_0x2d77cf){_0x4ba5e3['push'](_0x4ba5e3['shift']());}};_0xbb1325(++_0x3fb9b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('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 0fa19b7..584b9db 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 _0xa05a=['channel','membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0xa05a,0x91));var _0xaa05=function(_0x43191d,_0x39b148){_0x43191d=_0x43191d-0x0;var _0x5bde49=_0xa05a[_0x43191d];return _0x5bde49;};'use strict';var Sequelize=require(_0xaa05('0x0'));var moment=require(_0xaa05('0x1'));var path=require('path');module[_0xaa05('0x2')]={'format':{'type':Sequelize[_0xaa05('0x3')],'get':function(){return this[_0xaa05('0x4')](_0xaa05('0x5'))?path[_0xaa05('0x6')](this[_0xaa05('0x4')](_0xaa05('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xaa05('0x7')]},'channel':{'type':Sequelize[_0xaa05('0x7')],'set':function(_0x51cdad){if(_0x51cdad){this[_0xaa05('0x8')](_0xaa05('0x9'),_0x51cdad);this[_0xaa05('0x8')](_0xaa05('0xa'),_0x51cdad[_0xaa05('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa05('0x7')]},'calleridname':{'type':Sequelize[_0xaa05('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaa05('0x7')]},'context':{'type':Sequelize[_0xaa05('0x7')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xaa05('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xaa05('0x7')]},'userDisposition':{'type':Sequelize[_0xaa05('0x7')]},'location':{'type':Sequelize[_0xaa05('0xd')]},'transcribeName':{'type':Sequelize[_0xaa05('0x7')]},'transcribeStatus':{'type':Sequelize[_0xaa05('0x7')],'defaultValue':_0xaa05('0xe')},'fileUri':{'type':Sequelize[_0xaa05('0xd')]},'fileText':{'type':Sequelize[_0xaa05('0xd')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0xaa05('0x7')]},'sPositive':{'type':Sequelize[_0xaa05('0xf')]},'sNegative':{'type':Sequelize[_0xaa05('0xf')]},'sNeutral':{'type':Sequelize[_0xaa05('0xf')]},'sMixed':{'type':Sequelize[_0xaa05('0xf')]},'tempSentiment':{'type':Sequelize[_0xaa05('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xaa05('0x11')],'get':function(){return moment(this[_0xaa05('0x4')]('createdAt'))[_0xaa05('0x12')](_0xaa05('0x13'))[_0xaa05('0x14')]();}},'updatedAt':{'type':Sequelize[_0xaa05('0x11')],'get':function(){return moment(this[_0xaa05('0x4')](_0xaa05('0x15')))['format'](_0xaa05('0x13'))[_0xaa05('0x14')]();}}}; \ No newline at end of file +var _0xf886=['STRING','setDataValue','channel','membername','split','TEXT','NEW','FLOAT','BOOLEAN','createdAt','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','format','sequelize','moment','path','exports','VIRTUAL','getDataValue','extname','value'];(function(_0x1fe016,_0x2f5394){var _0x5e3d1d=function(_0x38d799){while(--_0x38d799){_0x1fe016['push'](_0x1fe016['shift']());}};_0x5e3d1d(++_0x2f5394);}(_0xf886,0x82));var _0x6f88=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0xf886[_0x3181cc];return _0x547a4a;};'use strict';var Sequelize=require(_0x6f88('0x0'));var moment=require(_0x6f88('0x1'));var path=require(_0x6f88('0x2'));module[_0x6f88('0x3')]={'format':{'type':Sequelize[_0x6f88('0x4')],'get':function(){return this[_0x6f88('0x5')]('value')?path[_0x6f88('0x6')](this[_0x6f88('0x5')](_0x6f88('0x7'))):undefined;}},'uniqueid':{'type':Sequelize[_0x6f88('0x8')]},'channel':{'type':Sequelize[_0x6f88('0x8')],'set':function(_0x9ea9b5){if(_0x9ea9b5){this[_0x6f88('0x9')](_0x6f88('0xa'),_0x9ea9b5);this['setDataValue'](_0x6f88('0xb'),_0x9ea9b5[_0x6f88('0xc')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x6f88('0x8')]},'calleridnum':{'type':Sequelize[_0x6f88('0x8')]},'calleridname':{'type':Sequelize[_0x6f88('0x8')]},'connectedlinenum':{'type':Sequelize[_0x6f88('0x8')]},'connectedlinename':{'type':Sequelize[_0x6f88('0x8')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6f88('0x8')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x6f88('0x8')]},'type':{'type':Sequelize[_0x6f88('0x8')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x6f88('0x8')]},'userDisposition':{'type':Sequelize[_0x6f88('0x8')]},'location':{'type':Sequelize[_0x6f88('0xd')]},'transcribeName':{'type':Sequelize[_0x6f88('0x8')]},'transcribeStatus':{'type':Sequelize[_0x6f88('0x8')],'defaultValue':_0x6f88('0xe')},'fileUri':{'type':Sequelize[_0x6f88('0xd')]},'fileText':{'type':Sequelize['TEXT']},'failureReason':{'type':Sequelize[_0x6f88('0xd')]},'sentiment':{'type':Sequelize[_0x6f88('0x8')]},'sPositive':{'type':Sequelize[_0x6f88('0xf')]},'sNegative':{'type':Sequelize[_0x6f88('0xf')]},'sNeutral':{'type':Sequelize[_0x6f88('0xf')]},'sMixed':{'type':Sequelize[_0x6f88('0xf')]},'tempSentiment':{'type':Sequelize[_0x6f88('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6f88('0x5')](_0x6f88('0x11')))['format'](_0x6f88('0x12'))[_0x6f88('0x13')]();}},'updatedAt':{'type':Sequelize[_0x6f88('0x14')],'get':function(){return moment(this['getDataValue'](_0x6f88('0x15')))[_0x6f88('0x16')](_0x6f88('0x12'))[_0x6f88('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c760c48..1b92ebe 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 _0x81f0=['Setting','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','count','offset','limit','status','set','json','apply','save','destroy','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','params','catch','create','body','update','find','describe','download','../../components/encryptor','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','secrets','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found'];(function(_0x18aae7,_0xec78c6){var _0x214ce4=function(_0x20b492){while(--_0x20b492){_0x18aae7['push'](_0x18aae7['shift']());}};_0x214ce4(++_0xec78c6);}(_0x81f0,0xaf));var _0x081f=function(_0xcba9ca,_0x32f7e6){_0xcba9ca=_0xcba9ca-0x0;var _0x5743ff=_0x81f0[_0xcba9ca];return _0x5743ff;};'use strict';var pdf=require(_0x081f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x081f('0x1'));var jsonpatch=require(_0x081f('0x2'));var rp=require('request-promise');var moment=require(_0x081f('0x3'));var BPromise=require(_0x081f('0x4'));var Mustache=require(_0x081f('0x5'));var util=require('util');var path=require(_0x081f('0x6'));var sox=require(_0x081f('0x7'));var csv=require(_0x081f('0x8'));var ejs=require(_0x081f('0x9'));var fs=require('fs');var _=require(_0x081f('0xa'));var squel=require(_0x081f('0xb'));var crypto=require(_0x081f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x081f('0xd'));var toCsv=require(_0x081f('0x8'));var querystring=require(_0x081f('0xe'));var Papa=require(_0x081f('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x081f('0x10'));var Redis=require(_0x081f('0x11'));var authService=require(_0x081f('0x12'));var qs=require(_0x081f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x081f('0x14'));var logger=require(_0x081f('0x15'))(_0x081f('0x16'));var utils=require(_0x081f('0x17'));var config=require(_0x081f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x257496,_0x1cb226){_0x1cb226=_0x1cb226||0xcc;return function(_0xf7bcea){if(_0xf7bcea){return _0x257496[_0x081f('0x19')](_0x1cb226);}return _0x257496['status'](_0x1cb226)['end']();};}function respondWithResult(_0x1ae477,_0x310551){_0x310551=_0x310551||0xc8;return function(_0x11fca6){if(_0x11fca6){return _0x1ae477['status'](_0x310551)['json'](_0x11fca6);}};}function respondWithFilteredResult(_0xd306fc,_0x35f8f0){return function(_0xba877b){if(_0xba877b){var _0x514bba=_0xba877b[_0x081f('0x1a')],_0x566f90=_0x35f8f0['offset'],_0x48637b=_0x35f8f0[_0x081f('0x1b')]+_0x35f8f0[_0x081f('0x1c')],_0x36aaa6;if(_0x48637b>=_0x514bba){_0x48637b=_0x514bba;_0x36aaa6=0xc8;}else{_0x36aaa6=0xce;}_0xd306fc[_0x081f('0x1d')](_0x36aaa6);return _0xd306fc[_0x081f('0x1e')]('Content-Range',_0x566f90+'-'+_0x48637b+'/'+_0x514bba)[_0x081f('0x1f')](_0xba877b);}return null;};}function patchUpdates(_0x18cf6a){return function(_0x5bcdb0){try{jsonpatch[_0x081f('0x20')](_0x5bcdb0,_0x18cf6a,!![]);}catch(_0x437775){return BPromise['reject'](_0x437775);}return _0x5bcdb0[_0x081f('0x21')]();};}function saveUpdates(_0x8b4b09,_0x1b77db){return function(_0x4eef8d){if(_0x4eef8d){return _0x4eef8d['update'](_0x8b4b09)['then'](function(_0x2af0e7){return _0x2af0e7;});}return null;};}function removeEntity(_0x24abc4,_0x3d6c8f){return function(_0x47ba6c){if(_0x47ba6c){return _0x47ba6c[_0x081f('0x22')]()[_0x081f('0x23')](function(){_0x24abc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2826e2,_0x57ab56){return function(_0x5891a1){if(!_0x5891a1){_0x2826e2[_0x081f('0x19')](0x194);}return _0x5891a1;};}function handleError(_0x17c7bb,_0x1267e1){_0x1267e1=_0x1267e1||0x1f4;return function(_0x1f590c){logger[_0x081f('0x24')](_0x1f590c[_0x081f('0x25')]);if(_0x1f590c[_0x081f('0x26')]){delete _0x1f590c['name'];}_0x17c7bb[_0x081f('0x1d')](_0x1267e1)[_0x081f('0x27')](_0x1f590c);};}exports[_0x081f('0x28')]=function(_0x2cf93c,_0x577179){var _0x4252c3={},_0x4d2c89={},_0x4850ef={'count':0x0,'rows':[]};var _0x5a8888=_[_0x081f('0x29')](db[_0x081f('0x2a')][_0x081f('0x2b')],function(_0x7789a0){return{'name':_0x7789a0[_0x081f('0x2c')],'type':_0x7789a0[_0x081f('0x2d')][_0x081f('0x2e')]};});_0x4d2c89[_0x081f('0x2f')]=_['differenceBy'](_[_0x081f('0x29')](_0x5a8888,_0x081f('0x26')),[_0x081f('0x30')]);_0x4d2c89['query']=_[_0x081f('0x31')](_0x2cf93c[_0x081f('0x32')]);_0x4d2c89[_0x081f('0x33')]=_[_0x081f('0x34')](_0x4d2c89[_0x081f('0x2f')],_0x4d2c89[_0x081f('0x32')]);_0x4252c3[_0x081f('0x35')]=_[_0x081f('0x34')](_0x4d2c89[_0x081f('0x2f')],qs['fields'](_0x2cf93c[_0x081f('0x32')][_0x081f('0x36')]));_0x4252c3[_0x081f('0x35')]=_0x4252c3['attributes']['length']?_0x4252c3['attributes']:_0x4d2c89[_0x081f('0x2f')];if(!_0x2cf93c[_0x081f('0x32')][_0x081f('0x37')](_0x081f('0x38'))){_0x4252c3[_0x081f('0x1c')]=qs[_0x081f('0x1c')](_0x2cf93c[_0x081f('0x32')][_0x081f('0x1c')]);_0x4252c3[_0x081f('0x1b')]=qs[_0x081f('0x1b')](_0x2cf93c['query'][_0x081f('0x1b')]);}_0x4252c3[_0x081f('0x39')]=qs[_0x081f('0x3a')](_0x2cf93c[_0x081f('0x32')][_0x081f('0x3a')]);_0x4252c3['where']=qs['filters'](_[_0x081f('0x3b')](_0x2cf93c[_0x081f('0x32')],_0x4d2c89[_0x081f('0x33')]),_0x5a8888);if(_0x2cf93c[_0x081f('0x32')][_0x081f('0x3c')]){_0x4252c3[_0x081f('0x3d')]=_[_0x081f('0x3e')](_0x4252c3['where'],{'$or':_[_0x081f('0x29')](_0x5a8888,function(_0x4c53fc){if(_0x4c53fc[_0x081f('0x2d')]!==_0x081f('0x3f')){var _0x5e62d2={};_0x5e62d2[_0x4c53fc[_0x081f('0x26')]]={'$like':'%'+_0x2cf93c['query'][_0x081f('0x3c')]+'%'};return _0x5e62d2;}})});}_0x4252c3=_[_0x081f('0x3e')]({},_0x4252c3,_0x2cf93c[_0x081f('0x40')]);var _0x521db6={'where':_0x4252c3[_0x081f('0x3d')]};return db['VoiceRecording']['count'](_0x521db6)[_0x081f('0x23')](function(_0x47d638){_0x4850ef[_0x081f('0x1a')]=_0x47d638;if(_0x2cf93c[_0x081f('0x32')]['includeAll']){_0x4252c3[_0x081f('0x41')]=[{'all':!![]}];}return db[_0x081f('0x2a')]['findAll'](_0x4252c3);})[_0x081f('0x23')](function(_0xc6f0a4){_0x4850ef[_0x081f('0x42')]=_0xc6f0a4;return _0x4850ef;})[_0x081f('0x23')](respondWithFilteredResult(_0x577179,_0x4252c3))['catch'](handleError(_0x577179,null));};exports['show']=function(_0x230e1a,_0x35ed84){var _0x4dc39b={'raw':![],'where':{'id':_0x230e1a[_0x081f('0x43')]['id']}},_0x29357b={};_0x29357b[_0x081f('0x2f')]=_['keys'](db[_0x081f('0x2a')][_0x081f('0x2b')]);_0x29357b[_0x081f('0x32')]=_[_0x081f('0x31')](_0x230e1a[_0x081f('0x32')]);_0x29357b[_0x081f('0x33')]=_['intersection'](_0x29357b[_0x081f('0x2f')],_0x29357b['query']);_0x4dc39b[_0x081f('0x35')]=_['intersection'](_0x29357b[_0x081f('0x2f')],qs['fields'](_0x230e1a[_0x081f('0x32')]['fields']));_0x4dc39b[_0x081f('0x35')]=_0x4dc39b[_0x081f('0x35')]['length']?_0x4dc39b[_0x081f('0x35')]:_0x29357b[_0x081f('0x2f')];if(_0x230e1a['query']['includeAll']){_0x4dc39b[_0x081f('0x41')]=[{'all':!![]}];}_0x4dc39b=_['merge']({},_0x4dc39b,_0x230e1a['options']);return db[_0x081f('0x2a')]['find'](_0x4dc39b)['then'](handleEntityNotFound(_0x35ed84,null))[_0x081f('0x23')](respondWithResult(_0x35ed84,null))[_0x081f('0x44')](handleError(_0x35ed84,null));};exports[_0x081f('0x45')]=function(_0x41718a,_0x3c55dc){return db[_0x081f('0x2a')][_0x081f('0x45')](_0x41718a[_0x081f('0x46')],{})[_0x081f('0x23')](respondWithResult(_0x3c55dc,0xc9))[_0x081f('0x44')](handleError(_0x3c55dc,null));};exports[_0x081f('0x47')]=function(_0x8ff96,_0x5e4b19){if(_0x8ff96[_0x081f('0x46')]['id']){delete _0x8ff96['body']['id'];}return db[_0x081f('0x2a')][_0x081f('0x48')]({'where':{'id':_0x8ff96[_0x081f('0x43')]['id']}})[_0x081f('0x23')](handleEntityNotFound(_0x5e4b19,null))[_0x081f('0x23')](saveUpdates(_0x8ff96[_0x081f('0x46')],null))[_0x081f('0x23')](respondWithResult(_0x5e4b19,null))[_0x081f('0x44')](handleError(_0x5e4b19,null));};exports[_0x081f('0x49')]=function(_0x1d6184,_0x122313){return db[_0x081f('0x2a')]['describe']()[_0x081f('0x23')](respondWithResult(_0x122313,null))[_0x081f('0x44')](handleError(_0x122313,null));};exports[_0x081f('0x4a')]=function(_0x30075e,_0x5f0902,_0x586612){var _0x5f0679=require(_0x081f('0x4b'));var _0x555636=![];var _0x837065={};if(_0x30075e['query'][_0x081f('0x2d')]&&_0x30075e['query']['type']==='uniqueid'){_0x837065['uniqueid']=_0x30075e[_0x081f('0x43')]['id'];}else{_0x837065['id']=_0x30075e[_0x081f('0x43')]['id'];}return db['VoiceRecording']['find']({'where':_0x837065,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5f0902,null))[_0x081f('0x23')](function(_0x5c850a){if(_0x5c850a){var _0xaae21b=_0x5c850a[_0x081f('0x4c')];var _0x58d9e7=util[_0x081f('0x30')](_0x081f('0x4d'),_0xaae21b);if(fs[_0x081f('0x4e')](_0x58d9e7)){_0x555636=!![];return _0x5f0679[_0x081f('0x4f')](_0x58d9e7,_0xaae21b,config['secrets'][_0x081f('0x50')])[_0x081f('0x23')](function(){return _0x5c850a;});}return _0x5c850a;}})[_0x081f('0x23')](function(_0x579ce6){if(_0x579ce6){var _0x341297=_0x579ce6[_0x081f('0x4c')];if(!fs[_0x081f('0x4e')](_0x341297)){throw new db[(_0x081f('0x51'))][(_0x081f('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x579ce6[_0x081f('0x53')]){return _0x5f0902[_0x081f('0x4a')](_0x341297,_0x579ce6[_0x081f('0x53')]+path[_0x081f('0x54')](_0x341297),function(){if(_0x555636){fs[_0x081f('0x55')](_0x341297);}});}else{return _0x5f0902[_0x081f('0x4a')](_0x341297,function(_0x255eec){if(_0x555636){fs[_0x081f('0x55')](_0x341297);}});}}})[_0x081f('0x44')](function(_0x176357){if(_0x176357[_0x081f('0x56')]==='VoiceRecording\x20not\x20found'){_0x5f0902['status'](0x194)[_0x081f('0x27')](_0x081f('0x57'));}else{return handleError(_0x5f0902,null);}});};exports['downloads']=function(_0x5aeb92,_0xa984c5,_0x1cd1a5){var _0x5dd0e0=require(_0x081f('0x4b'));var _0x240711=![];var _0x306f3a={'$and':[db[_0x081f('0x58')][_0x081f('0x3d')](db['sequelize']['fn'](_0x081f('0x59'),db[_0x081f('0x58')][_0x081f('0x5a')]('uniqueid')),_0x5aeb92[_0x081f('0x32')][_0x081f('0x5b')])]};if(_0x5aeb92[_0x081f('0x32')][_0x081f('0x2d')]&&_0x5aeb92[_0x081f('0x32')][_0x081f('0x2d')]==='uniqueid'){_0x306f3a[_0x081f('0x5c')][_0x081f('0x5d')]({'uniqueid':_0x5aeb92[_0x081f('0x43')]['id']});}else{_0x306f3a[_0x081f('0x5c')][_0x081f('0x5d')]({'id':_0x5aeb92[_0x081f('0x43')]['id']});}return db[_0x081f('0x2a')][_0x081f('0x48')]({'where':_0x306f3a,'attributes':['id',_0x081f('0x4c')],'raw':!![]})[_0x081f('0x23')](handleEntityNotFound(_0xa984c5,null))[_0x081f('0x23')](function(_0x1e77eb){if(_0x1e77eb){var _0x1d5f2e=util[_0x081f('0x30')]('%s.cypher',_0x1e77eb[_0x081f('0x4c')]);if(fs[_0x081f('0x4e')](_0x1d5f2e)){_0x240711=!![];return _0x5dd0e0['decryptFile'](_0x1d5f2e,_0x1e77eb[_0x081f('0x4c')],config[_0x081f('0x5e')][_0x081f('0x50')])[_0x081f('0x23')](function(){return _0x1e77eb;});}return _0x1e77eb;}})[_0x081f('0x23')](function(_0x367267){if(_0x367267){if(!fs[_0x081f('0x4e')](_0x367267['value'])){throw new db[(_0x081f('0x51'))][(_0x081f('0x52'))](_0x081f('0x5f'));}if(_0x367267['filename']){return _0xa984c5[_0x081f('0x4a')](_0x367267[_0x081f('0x4c')],_0x367267[_0x081f('0x53')]+path['extname'](_0x367267[_0x081f('0x4c')]),function(){if(_0x240711){fs['unlink'](_0x367267[_0x081f('0x4c')]);}});}else{return _0xa984c5['download'](_0x367267['value'],function(_0x1a8991){if(_0x240711){fs['unlink'](_0x367267[_0x081f('0x4c')]);}});}}})[_0x081f('0x44')](handleError(_0xa984c5,null));};exports[_0x081f('0x22')]=function(_0x4d007e,_0x39ca11){return db['VoiceRecording'][_0x081f('0x48')]({'where':{'id':_0x4d007e['params']['id']}})[_0x081f('0x23')](function(_0x4fa877){if(!_0x4fa877)throw new ReferenceError(_0x081f('0x60'));return _0x4fa877;})[_0x081f('0x23')](function(_0x3b994d){var _0x289d1e=_0x3b994d[_0x081f('0x4c')];logger[_0x081f('0x61')]('cancellazione\x20fisica\x20documento\x20%s',_0x289d1e);if(!_[_0x081f('0x62')](_0x3b994d[_0x081f('0x4c')])&&fs[_0x081f('0x4e')](_0x289d1e)){logger['info']('File:\x20\x22'+_0x289d1e+_0x081f('0x63'));fs[_0x081f('0x64')](_0x289d1e);}_0x289d1e=_0x289d1e+_0x081f('0x65');if(!_[_0x081f('0x62')](_0x3b994d[_0x081f('0x4c')])&&fs[_0x081f('0x4e')](_0x289d1e)){logger['info'](_0x081f('0x66')+_0x289d1e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x081f('0x64')](_0x289d1e);}return _0x3b994d;})[_0x081f('0x23')](function(_0x2c03fc){if(!_0x2c03fc)throw new InternalError();return _0x2c03fc['destroy']();})[_0x081f('0x23')](function(){_0x39ca11['status'](0xcc)['end']();})[_0x081f('0x44')](handleError(_0x39ca11,null));};function getBucketslist(_0x576c13,_0x2e2c58,_0x3029a6){return new Promise(function(_0x6b2233,_0x44a380){var _0x15c414=new AWS['S3']({'accessKeyId':_0x2e2c58,'secretAccessKey':_0x576c13,'region':_0x3029a6});_0x15c414['listBuckets']({},function(_0x3e90b4,_0x3a85e1){if(_0x3e90b4){return _0x44a380(_0x3e90b4);}else{return _0x6b2233(_0x3a85e1);}});});}function createBucket(_0x333994,_0x342fdd,_0x220535,_0x3bacfb){return new Promise(function(_0xc1469a,_0x2c9f4f){var _0x562cd7=new AWS['S3']({'accessKeyId':_0x342fdd,'secretAccessKey':_0x333994,'region':_0x220535});_0x562cd7[_0x081f('0x67')]({'Bucket':_0x3bacfb},function(_0x140917,_0x38bc5d){if(_0x140917){return _0x2c9f4f(_0x140917);}else{return _0xc1469a(_0x38bc5d);}});});}function uploadFile(_0x3a6969,_0x43bbaf,_0x2dde0c,_0x370678,_0x2fb8a1,_0x2cdc68){return new Promise(function(_0x4cb645,_0x3493a5){var _0x411ed3=new AWS['S3']({'accessKeyId':_0x43bbaf,'secretAccessKey':_0x3a6969,'region':_0x2dde0c});_0x411ed3[_0x081f('0x68')]({'Bucket':_0x370678,'Key':_0x2fb8a1,'Body':_0x2cdc68},function(_0x99e8e9,_0x3e492d){if(_0x99e8e9){return _0x3493a5(_0x99e8e9);}else{return _0x4cb645(_0x3e492d);}});});}function startTranscribe(_0x5dda17,_0x5ef94c,_0xaec1f4,_0x492059,_0x3867c0,_0x2ccc7a){return new Promise(function(_0xbe1279,_0x368804){var _0x487f52=new AWS[(_0x081f('0x69'))]({'accessKeyId':_0x5ef94c,'secretAccessKey':_0x5dda17,'region':_0xaec1f4});_0x487f52[_0x081f('0x6a')]({'TranscriptionJobName':_0x492059,'LanguageCode':_0x3867c0,'Media':{'MediaFileUri':_0x2ccc7a}},function(_0x4a5e8b,_0x216bd4){if(_0x4a5e8b){return _0x368804(_0x4a5e8b);}else{return _0xbe1279(_0x216bd4);}});});}function transcribe(_0x1009dd,_0x444634,_0x44daa5,_0x5873c1,_0x3c2862,_0x46c564,_0x3f953b){return new Promise(function(_0x325f8c,_0x48d77a){var _0x482724={};logger[_0x081f('0x61')](util['format'](_0x081f('0x6b'),_0x1009dd,_0x3c2862));return uploadFile(_0x444634,_0x44daa5,_0x5873c1,_0x3c2862,path[_0x081f('0x6c')](_0x46c564),fs[_0x081f('0x6d')](_0x46c564))[_0x081f('0x23')](function(_0x33cf7c){logger[_0x081f('0x61')](util[_0x081f('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x1009dd,_0x3c2862,_0x33cf7c[_0x081f('0x6e')]));_0x482724[_0x081f('0x6f')]=_0x33cf7c[_0x081f('0x70')];_0x482724[_0x081f('0x71')]=_0x33cf7c[_0x081f('0x6e')];logger['info'](util[_0x081f('0x30')](_0x081f('0x72'),_0x1009dd));return startTranscribe(_0x444634,_0x44daa5,_0x5873c1,uuidv4(),_0x3f953b,_0x33cf7c[_0x081f('0x6e')]);})['then'](function(_0x524fcd){logger['info'](util[_0x081f('0x30')](_0x081f('0x73'),_0x1009dd,_0x524fcd[_0x081f('0x74')][_0x081f('0x75')]));_0x482724['transcribeName']=_0x524fcd[_0x081f('0x74')]['TranscriptionJobName'];_0x482724[_0x081f('0x76')]=_0x524fcd[_0x081f('0x74')][_0x081f('0x77')];return _0x325f8c(_0x482724);})['catch'](function(_0x471429){return _0x48d77a(_0x471429);});});}exports['runTranscribe']=function(_0x5bac51,_0x2b20cc,_0x139cf6){var _0x195308;var _0x3518e6;var _0x2e2eaf;var _0x51f8c5=require(_0x081f('0x4b'));return db[_0x081f('0x2a')]['findOne']({'where':{'id':_0x5bac51['params']['id']}})[_0x081f('0x23')](function(_0x412087){if(_0x412087){var _0x3855b1=util['format']('%s.cypher',_0x412087[_0x081f('0x4c')]);if(fs['existsSync'](_0x3855b1)){cypher=!![];return _0x51f8c5[_0x081f('0x4f')](_0x3855b1,_0x412087[_0x081f('0x4c')],config['secrets'][_0x081f('0x50')])[_0x081f('0x23')](function(){return _0x412087;});}return _0x412087;}})[_0x081f('0x23')](function(_0x16958c){if(!_0x16958c){throw new db[(_0x081f('0x51'))]['ValidationError'](_0x081f('0x78'));}_0x3518e6=_0x16958c;return db[_0x081f('0x79')][_0x081f('0x7a')]({'where':{'id':0x1}});})[_0x081f('0x23')](handleEntityNotFound(_0x2b20cc,null))[_0x081f('0x23')](function(_0x2546d6){if(_0x2546d6){_0x195308=_0x2546d6;if(!_0x195308[_0x081f('0x7b')]||!_0x195308['transcribeAccountId']||!_0x195308[_0x081f('0x7c')]||!_0x195308[_0x081f('0x7d')]||!_0x195308['bucket']){throw new db[(_0x081f('0x51'))][(_0x081f('0x52'))](_0x081f('0x7e'));}if(_0x5bac51[_0x081f('0x46')][_0x081f('0x7f')]&&(!_0x195308[_0x081f('0x80')]||!_0x195308[_0x081f('0x81')]||!_0x195308[_0x081f('0x82')]||!_0x195308[_0x081f('0x7d')]||!_0x195308['bucket'])){throw new db[(_0x081f('0x51'))][(_0x081f('0x52'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x081f('0x83')][_0x081f('0x7a')]({'where':{'id':_0x195308[_0x081f('0x84')]}});}})[_0x081f('0x23')](function(_0x4743d3){if(!_0x4743d3){throw new db['Sequelize'][(_0x081f('0x52'))](_0x081f('0x85'));}if(!_0x4743d3[_0x081f('0x86')]||!_0x4743d3[_0x081f('0x87')]){throw new db[(_0x081f('0x51'))][(_0x081f('0x52'))]('Cloud\x20Provider\x20not\x20configured');}_0x2e2eaf=_0x4743d3;return getBucketslist(_0x2e2eaf[_0x081f('0x86')],_0x2e2eaf[_0x081f('0x87')],_0x195308[_0x081f('0x7c')]);})['then'](function(_0x2c1734){if(_0x2c1734&&_0x2c1734[_0x081f('0x88')]){var _0x38d117=_[_0x081f('0x48')](_0x2c1734['Buckets'],function(_0x360ecb){return _0x360ecb['Name']===_0x195308[_0x081f('0x6f')];});if(!_0x38d117){logger[_0x081f('0x61')](util[_0x081f('0x30')](_0x081f('0x89'),_0x5bac51[_0x081f('0x43')]['id'],_0x195308[_0x081f('0x6f')]));return createBucket(_0x2e2eaf[_0x081f('0x86')],_0x2e2eaf[_0x081f('0x87')],_0x195308['transcribeRegion'],_0x195308['bucket']);}logger[_0x081f('0x61')](util[_0x081f('0x30')](_0x081f('0x8a'),_0x5bac51[_0x081f('0x43')]['id'],_0x195308[_0x081f('0x6f')]));return;}})[_0x081f('0x23')](function(_0x48e2e2){if(_0x3518e6[_0x081f('0x76')]===_0x081f('0x8b')){return transcribe(_0x5bac51[_0x081f('0x43')]['id'],_0x2e2eaf[_0x081f('0x86')],_0x2e2eaf[_0x081f('0x87')],_0x195308['transcribeRegion'],_0x195308[_0x081f('0x6f')],_0x3518e6[_0x081f('0x4c')],_0x195308[_0x081f('0x7d')]);}else{logger[_0x081f('0x61')](util[_0x081f('0x30')](_0x081f('0x8c'),_0x5bac51[_0x081f('0x43')]['id']));return{'transcribeStatus':_0x081f('0x8d')};}})[_0x081f('0x23')](function(_0x1914ab){if(_0x1914ab){_0x1914ab[_0x081f('0x8e')]=_0x5bac51[_0x081f('0x46')][_0x081f('0x7f')];return _0x3518e6['updateAttributes'](_0x1914ab);}})[_0x081f('0x23')](respondWithResult(_0x2b20cc,null))[_0x081f('0x44')](handleError(_0x2b20cc,null));};function writeFile(_0xc83cdb,_0x2489f4){return new Promise(function(_0x23cf0,_0x144f06){fs['writeFile'](_0x2489f4,_0xc83cdb,function(_0xd4664b,_0x130c72){if(_0xd4664b){return _0x144f06(_0xd4664b);}else{return _0x23cf0(_0x130c72);}});});}exports[_0x081f('0x8f')]=function(_0x50e7d6,_0x1b0d9a,_0x4b2d3c){return db[_0x081f('0x2a')]['findOne']({'where':{'id':_0x50e7d6[_0x081f('0x43')]['id']}})[_0x081f('0x23')](handleEntityNotFound(_0x1b0d9a))['then'](function(_0x562de7){if(_0x562de7&&_0x562de7[_0x081f('0x90')]){var _0x1d735c=_0x562de7[_0x081f('0x90')];var _0x37d0e3=config[_0x081f('0x91')]+_0x081f('0x92')+_0x562de7['id']+_0x081f('0x93');if(fs[_0x081f('0x4e')](_0x37d0e3)){return _0x37d0e3;}return writeFile(_0x1d735c,_0x37d0e3)[_0x081f('0x23')](function(){return _0x37d0e3;});}else{throw new db['Sequelize'][(_0x081f('0x52'))]('Transcript\x20not\x20available');}})['then'](function(_0x19befe){return _0x1b0d9a[_0x081f('0x4a')](_0x19befe);})[_0x081f('0x44')](handleError(_0x1b0d9a));}; \ No newline at end of file +var _0xa9b7=['../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','index','map','VoiceRecording','rawAttributes','type','model','format','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','catch','params','fields','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','sequelize','col','token','$and','push','ValidationError','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','bucket','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','uuid/v4','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0xa9b7,0x1af));var _0x7a9b=function(_0x484642,_0x3b8c1e){_0x484642=_0x484642-0x0;var _0x287bc6=_0xa9b7[_0x484642];return _0x287bc6;};'use strict';var pdf=require(_0x7a9b('0x0'));var emlformat=require(_0x7a9b('0x1'));var rimraf=require(_0x7a9b('0x2'));var zipdir=require(_0x7a9b('0x3'));var jsonpatch=require(_0x7a9b('0x4'));var rp=require(_0x7a9b('0x5'));var moment=require(_0x7a9b('0x6'));var BPromise=require(_0x7a9b('0x7'));var Mustache=require(_0x7a9b('0x8'));var util=require(_0x7a9b('0x9'));var path=require(_0x7a9b('0xa'));var sox=require(_0x7a9b('0xb'));var csv=require(_0x7a9b('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a9b('0xd'));var squel=require(_0x7a9b('0xe'));var crypto=require(_0x7a9b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7a9b('0x10'));var toCsv=require(_0x7a9b('0xc'));var querystring=require('querystring');var Papa=require(_0x7a9b('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0x7a9b('0x12'));var Redis=require(_0x7a9b('0x13'));var authService=require(_0x7a9b('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a9b('0x15'));var logger=require(_0x7a9b('0x16'))(_0x7a9b('0x17'));var utils=require(_0x7a9b('0x18'));var config=require(_0x7a9b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x268fa0,_0x5d7002){_0x5d7002=_0x5d7002||0xcc;return function(_0x5d4ef1){if(_0x5d4ef1){return _0x268fa0[_0x7a9b('0x1a')](_0x5d7002);}return _0x268fa0[_0x7a9b('0x1b')](_0x5d7002)[_0x7a9b('0x1c')]();};}function respondWithResult(_0x28b13f,_0x3652c6){_0x3652c6=_0x3652c6||0xc8;return function(_0x1c9072){if(_0x1c9072){return _0x28b13f['status'](_0x3652c6)['json'](_0x1c9072);}};}function respondWithFilteredResult(_0x87d2d4,_0x35b2c8){return function(_0x54e7c9){if(_0x54e7c9){var _0x4d1488=_0x54e7c9[_0x7a9b('0x1d')],_0x493cdf=_0x35b2c8[_0x7a9b('0x1e')],_0x3e45b8=_0x35b2c8['offset']+_0x35b2c8[_0x7a9b('0x1f')],_0x3cb53a;if(_0x3e45b8>=_0x4d1488){_0x3e45b8=_0x4d1488;_0x3cb53a=0xc8;}else{_0x3cb53a=0xce;}_0x87d2d4['status'](_0x3cb53a);return _0x87d2d4[_0x7a9b('0x20')](_0x7a9b('0x21'),_0x493cdf+'-'+_0x3e45b8+'/'+_0x4d1488)[_0x7a9b('0x22')](_0x54e7c9);}return null;};}function patchUpdates(_0x30f39b){return function(_0xb82555){try{jsonpatch['apply'](_0xb82555,_0x30f39b,!![]);}catch(_0x74b28){return BPromise[_0x7a9b('0x23')](_0x74b28);}return _0xb82555[_0x7a9b('0x24')]();};}function saveUpdates(_0x506d4e,_0x7514ef){return function(_0xb2adec){if(_0xb2adec){return _0xb2adec[_0x7a9b('0x25')](_0x506d4e)[_0x7a9b('0x26')](function(_0xe12e38){return _0xe12e38;});}return null;};}function removeEntity(_0xd9fd9b,_0x1340d3){return function(_0x23a26f){if(_0x23a26f){return _0x23a26f['destroy']()['then'](function(){_0xd9fd9b[_0x7a9b('0x1b')](0xcc)[_0x7a9b('0x1c')]();});}};}function handleEntityNotFound(_0x455c96,_0x33b542){return function(_0xf49cc4){if(!_0xf49cc4){_0x455c96[_0x7a9b('0x1a')](0x194);}return _0xf49cc4;};}function handleError(_0x48296a,_0x1f9d53){_0x1f9d53=_0x1f9d53||0x1f4;return function(_0x8f443e){logger[_0x7a9b('0x27')](_0x8f443e[_0x7a9b('0x28')]);if(_0x8f443e[_0x7a9b('0x29')]){delete _0x8f443e[_0x7a9b('0x29')];}_0x48296a[_0x7a9b('0x1b')](_0x1f9d53)['send'](_0x8f443e);};}exports[_0x7a9b('0x2a')]=function(_0x2c6efb,_0x170158){var _0x28d50a={},_0x2362c6={},_0xfc1e73={'count':0x0,'rows':[]};var _0x51c681=_[_0x7a9b('0x2b')](db[_0x7a9b('0x2c')][_0x7a9b('0x2d')],function(_0xe16f7f){return{'name':_0xe16f7f['fieldName'],'type':_0xe16f7f[_0x7a9b('0x2e')]['key']};});_0x2362c6[_0x7a9b('0x2f')]=_['differenceBy'](_[_0x7a9b('0x2b')](_0x51c681,'name'),[_0x7a9b('0x30')]);_0x2362c6[_0x7a9b('0x31')]=_[_0x7a9b('0x32')](_0x2c6efb[_0x7a9b('0x31')]);_0x2362c6[_0x7a9b('0x33')]=_[_0x7a9b('0x34')](_0x2362c6['model'],_0x2362c6[_0x7a9b('0x31')]);_0x28d50a[_0x7a9b('0x35')]=_[_0x7a9b('0x34')](_0x2362c6[_0x7a9b('0x2f')],qs['fields'](_0x2c6efb[_0x7a9b('0x31')]['fields']));_0x28d50a['attributes']=_0x28d50a['attributes'][_0x7a9b('0x36')]?_0x28d50a['attributes']:_0x2362c6['model'];if(!_0x2c6efb['query'][_0x7a9b('0x37')](_0x7a9b('0x38'))){_0x28d50a['limit']=qs['limit'](_0x2c6efb['query']['limit']);_0x28d50a['offset']=qs['offset'](_0x2c6efb[_0x7a9b('0x31')][_0x7a9b('0x1e')]);}_0x28d50a[_0x7a9b('0x39')]=qs[_0x7a9b('0x3a')](_0x2c6efb[_0x7a9b('0x31')][_0x7a9b('0x3a')]);_0x28d50a['where']=qs['filters'](_[_0x7a9b('0x3b')](_0x2c6efb[_0x7a9b('0x31')],_0x2362c6[_0x7a9b('0x33')]),_0x51c681);if(_0x2c6efb[_0x7a9b('0x31')][_0x7a9b('0x3c')]){_0x28d50a[_0x7a9b('0x3d')]=_[_0x7a9b('0x3e')](_0x28d50a[_0x7a9b('0x3d')],{'$or':_[_0x7a9b('0x2b')](_0x51c681,function(_0x4c2242){if(_0x4c2242[_0x7a9b('0x2e')]!=='VIRTUAL'){var _0x1f66f5={};_0x1f66f5[_0x4c2242[_0x7a9b('0x29')]]={'$like':'%'+_0x2c6efb[_0x7a9b('0x31')]['filter']+'%'};return _0x1f66f5;}})});}_0x28d50a=_['merge']({},_0x28d50a,_0x2c6efb['options']);var _0x2e8ab1={'where':_0x28d50a[_0x7a9b('0x3d')]};return db[_0x7a9b('0x2c')][_0x7a9b('0x1d')](_0x2e8ab1)[_0x7a9b('0x26')](function(_0xad5a87){_0xfc1e73['count']=_0xad5a87;if(_0x2c6efb[_0x7a9b('0x31')]['includeAll']){_0x28d50a[_0x7a9b('0x3f')]=[{'all':!![]}];}return db[_0x7a9b('0x2c')][_0x7a9b('0x40')](_0x28d50a);})['then'](function(_0x51b12d){_0xfc1e73[_0x7a9b('0x41')]=_0x51b12d;return _0xfc1e73;})[_0x7a9b('0x26')](respondWithFilteredResult(_0x170158,_0x28d50a))[_0x7a9b('0x42')](handleError(_0x170158,null));};exports['show']=function(_0x4e8fe5,_0x46aa3b){var _0x38ea9d={'raw':![],'where':{'id':_0x4e8fe5[_0x7a9b('0x43')]['id']}},_0x1a97a3={};_0x1a97a3[_0x7a9b('0x2f')]=_['keys'](db[_0x7a9b('0x2c')][_0x7a9b('0x2d')]);_0x1a97a3['query']=_[_0x7a9b('0x32')](_0x4e8fe5['query']);_0x1a97a3['filters']=_['intersection'](_0x1a97a3[_0x7a9b('0x2f')],_0x1a97a3[_0x7a9b('0x31')]);_0x38ea9d['attributes']=_[_0x7a9b('0x34')](_0x1a97a3[_0x7a9b('0x2f')],qs[_0x7a9b('0x44')](_0x4e8fe5[_0x7a9b('0x31')][_0x7a9b('0x44')]));_0x38ea9d[_0x7a9b('0x35')]=_0x38ea9d['attributes'][_0x7a9b('0x36')]?_0x38ea9d[_0x7a9b('0x35')]:_0x1a97a3[_0x7a9b('0x2f')];if(_0x4e8fe5['query'][_0x7a9b('0x45')]){_0x38ea9d[_0x7a9b('0x3f')]=[{'all':!![]}];}_0x38ea9d=_[_0x7a9b('0x3e')]({},_0x38ea9d,_0x4e8fe5['options']);return db[_0x7a9b('0x2c')][_0x7a9b('0x46')](_0x38ea9d)['then'](handleEntityNotFound(_0x46aa3b,null))[_0x7a9b('0x26')](respondWithResult(_0x46aa3b,null))[_0x7a9b('0x42')](handleError(_0x46aa3b,null));};exports['create']=function(_0x366268,_0x46964e){return db[_0x7a9b('0x2c')][_0x7a9b('0x47')](_0x366268[_0x7a9b('0x48')],{})['then'](respondWithResult(_0x46964e,0xc9))[_0x7a9b('0x42')](handleError(_0x46964e,null));};exports[_0x7a9b('0x25')]=function(_0x212212,_0x58ba31){if(_0x212212[_0x7a9b('0x48')]['id']){delete _0x212212[_0x7a9b('0x48')]['id'];}return db[_0x7a9b('0x2c')][_0x7a9b('0x46')]({'where':{'id':_0x212212[_0x7a9b('0x43')]['id']}})[_0x7a9b('0x26')](handleEntityNotFound(_0x58ba31,null))['then'](saveUpdates(_0x212212['body'],null))[_0x7a9b('0x26')](respondWithResult(_0x58ba31,null))[_0x7a9b('0x42')](handleError(_0x58ba31,null));};exports[_0x7a9b('0x49')]=function(_0x75cfb1,_0x4f8dac){return db['VoiceRecording'][_0x7a9b('0x49')]()[_0x7a9b('0x26')](respondWithResult(_0x4f8dac,null))[_0x7a9b('0x42')](handleError(_0x4f8dac,null));};exports[_0x7a9b('0x4a')]=function(_0x5f205f,_0x302827,_0x4fb27e){var _0x20e405=require(_0x7a9b('0x4b'));var _0x5b5a46=![];var _0x58a1d0={};if(_0x5f205f[_0x7a9b('0x31')][_0x7a9b('0x2e')]&&_0x5f205f[_0x7a9b('0x31')]['type']===_0x7a9b('0x4c')){_0x58a1d0[_0x7a9b('0x4c')]=_0x5f205f[_0x7a9b('0x43')]['id'];}else{_0x58a1d0['id']=_0x5f205f[_0x7a9b('0x43')]['id'];}return db['VoiceRecording'][_0x7a9b('0x46')]({'where':_0x58a1d0,'attributes':['id',_0x7a9b('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x302827,null))[_0x7a9b('0x26')](function(_0x4e3053){if(_0x4e3053){var _0x3f8b82=_0x4e3053[_0x7a9b('0x4d')];var _0x54d94d=util[_0x7a9b('0x30')](_0x7a9b('0x4e'),_0x3f8b82);if(fs[_0x7a9b('0x4f')](_0x54d94d)){_0x5b5a46=!![];return _0x20e405[_0x7a9b('0x50')](_0x54d94d,_0x3f8b82,config[_0x7a9b('0x51')][_0x7a9b('0x52')])[_0x7a9b('0x26')](function(){return _0x4e3053;});}return _0x4e3053;}})[_0x7a9b('0x26')](function(_0x643332){if(_0x643332){var _0x5887fb=_0x643332[_0x7a9b('0x4d')];if(!fs['existsSync'](_0x5887fb)){throw new db[(_0x7a9b('0x53'))]['ValidationError'](_0x7a9b('0x54'));}if(_0x643332[_0x7a9b('0x55')]){return _0x302827[_0x7a9b('0x4a')](_0x5887fb,_0x643332[_0x7a9b('0x55')]+path[_0x7a9b('0x56')](_0x5887fb),function(){if(_0x5b5a46){fs['unlink'](_0x5887fb);}});}else{return _0x302827[_0x7a9b('0x4a')](_0x5887fb,function(_0x9cdd8f){if(_0x5b5a46){fs[_0x7a9b('0x57')](_0x5887fb);}});}}})[_0x7a9b('0x42')](function(_0x50efff){if(_0x50efff[_0x7a9b('0x58')]===_0x7a9b('0x54')){_0x302827[_0x7a9b('0x1b')](0x194)[_0x7a9b('0x59')]('Not\x20found');}else{return handleError(_0x302827,null);}});};exports['downloads']=function(_0x3804c4,_0x337269,_0x4f10d4){var _0x1e05f4=require(_0x7a9b('0x4b'));var _0x569dbe=![];var _0x4532a5={'$and':[db[_0x7a9b('0x5a')][_0x7a9b('0x3d')](db[_0x7a9b('0x5a')]['fn']('MD5',db[_0x7a9b('0x5a')][_0x7a9b('0x5b')]('uniqueid')),_0x3804c4[_0x7a9b('0x31')][_0x7a9b('0x5c')])]};if(_0x3804c4[_0x7a9b('0x31')]['type']&&_0x3804c4['query'][_0x7a9b('0x2e')]===_0x7a9b('0x4c')){_0x4532a5[_0x7a9b('0x5d')][_0x7a9b('0x5e')]({'uniqueid':_0x3804c4[_0x7a9b('0x43')]['id']});}else{_0x4532a5['$and']['push']({'id':_0x3804c4['params']['id']});}return db[_0x7a9b('0x2c')][_0x7a9b('0x46')]({'where':_0x4532a5,'attributes':['id',_0x7a9b('0x4d')],'raw':!![]})[_0x7a9b('0x26')](handleEntityNotFound(_0x337269,null))[_0x7a9b('0x26')](function(_0x597327){if(_0x597327){var _0x5d0667=util[_0x7a9b('0x30')]('%s.cypher',_0x597327[_0x7a9b('0x4d')]);if(fs[_0x7a9b('0x4f')](_0x5d0667)){_0x569dbe=!![];return _0x1e05f4['decryptFile'](_0x5d0667,_0x597327[_0x7a9b('0x4d')],config[_0x7a9b('0x51')][_0x7a9b('0x52')])[_0x7a9b('0x26')](function(){return _0x597327;});}return _0x597327;}})[_0x7a9b('0x26')](function(_0x5ee6ac){if(_0x5ee6ac){if(!fs[_0x7a9b('0x4f')](_0x5ee6ac[_0x7a9b('0x4d')])){throw new db[(_0x7a9b('0x53'))][(_0x7a9b('0x5f'))](_0x7a9b('0x54'));}if(_0x5ee6ac[_0x7a9b('0x55')]){return _0x337269[_0x7a9b('0x4a')](_0x5ee6ac[_0x7a9b('0x4d')],_0x5ee6ac[_0x7a9b('0x55')]+path[_0x7a9b('0x56')](_0x5ee6ac['value']),function(){if(_0x569dbe){fs[_0x7a9b('0x57')](_0x5ee6ac['value']);}});}else{return _0x337269[_0x7a9b('0x4a')](_0x5ee6ac[_0x7a9b('0x4d')],function(_0x588b8e){if(_0x569dbe){fs['unlink'](_0x5ee6ac[_0x7a9b('0x4d')]);}});}}})[_0x7a9b('0x42')](handleError(_0x337269,null));};exports[_0x7a9b('0x60')]=function(_0x2a2491,_0x4a53c0){return db['VoiceRecording'][_0x7a9b('0x46')]({'where':{'id':_0x2a2491[_0x7a9b('0x43')]['id']}})[_0x7a9b('0x26')](function(_0x3e97b7){if(!_0x3e97b7)throw new ReferenceError(_0x7a9b('0x61'));return _0x3e97b7;})[_0x7a9b('0x26')](function(_0x4ef29c){var _0x503994=_0x4ef29c[_0x7a9b('0x4d')];logger['info'](_0x7a9b('0x62'),_0x503994);if(!_['isNil'](_0x4ef29c[_0x7a9b('0x4d')])&&fs[_0x7a9b('0x4f')](_0x503994)){logger[_0x7a9b('0x63')](_0x7a9b('0x64')+_0x503994+_0x7a9b('0x65'));fs[_0x7a9b('0x66')](_0x503994);}_0x503994=_0x503994+'.cypher';if(!_[_0x7a9b('0x67')](_0x4ef29c[_0x7a9b('0x4d')])&&fs['existsSync'](_0x503994)){logger['info'](_0x7a9b('0x64')+_0x503994+_0x7a9b('0x65'));fs[_0x7a9b('0x66')](_0x503994);}return _0x4ef29c;})[_0x7a9b('0x26')](function(_0x586a1f){if(!_0x586a1f)throw new InternalError();return _0x586a1f[_0x7a9b('0x60')]();})[_0x7a9b('0x26')](function(){_0x4a53c0[_0x7a9b('0x1b')](0xcc)[_0x7a9b('0x1c')]();})[_0x7a9b('0x42')](handleError(_0x4a53c0,null));};function getBucketslist(_0x1a583f,_0x4744b8,_0x177976){return new Promise(function(_0x1328ee,_0x29b318){var _0x29bc0d=new AWS['S3']({'accessKeyId':_0x4744b8,'secretAccessKey':_0x1a583f,'region':_0x177976});_0x29bc0d[_0x7a9b('0x68')]({},function(_0x238a97,_0xbe4c2a){if(_0x238a97){return _0x29b318(_0x238a97);}else{return _0x1328ee(_0xbe4c2a);}});});}function createBucket(_0x3d7ed3,_0x514882,_0x4e0fae,_0x5c8723){return new Promise(function(_0xd86075,_0x1123f2){var _0x179c25=new AWS['S3']({'accessKeyId':_0x514882,'secretAccessKey':_0x3d7ed3,'region':_0x4e0fae});_0x179c25[_0x7a9b('0x69')]({'Bucket':_0x5c8723},function(_0x5a9041,_0x425121){if(_0x5a9041){return _0x1123f2(_0x5a9041);}else{return _0xd86075(_0x425121);}});});}function uploadFile(_0x5acdc1,_0x340683,_0x3f7030,_0x47f953,_0x4314fd,_0x47bec8){return new Promise(function(_0x14eeb4,_0x34e2f2){var _0x59b22f=new AWS['S3']({'accessKeyId':_0x340683,'secretAccessKey':_0x5acdc1,'region':_0x3f7030});_0x59b22f[_0x7a9b('0x6a')]({'Bucket':_0x47f953,'Key':_0x4314fd,'Body':_0x47bec8},function(_0x3c3ef9,_0x2e83ee){if(_0x3c3ef9){return _0x34e2f2(_0x3c3ef9);}else{return _0x14eeb4(_0x2e83ee);}});});}function startTranscribe(_0x18f960,_0x5df199,_0x2e4b8a,_0x1508b5,_0x2e3be2,_0xc2aa10){return new Promise(function(_0x54c4ff,_0xad498){var _0x3ad413=new AWS[(_0x7a9b('0x6b'))]({'accessKeyId':_0x5df199,'secretAccessKey':_0x18f960,'region':_0x2e4b8a});_0x3ad413[_0x7a9b('0x6c')]({'TranscriptionJobName':_0x1508b5,'LanguageCode':_0x2e3be2,'Media':{'MediaFileUri':_0xc2aa10}},function(_0x650157,_0x294dd5){if(_0x650157){return _0xad498(_0x650157);}else{return _0x54c4ff(_0x294dd5);}});});}function transcribe(_0x30af5a,_0x2d1cb5,_0x516bb0,_0x2a23b0,_0x300493,_0x543f38,_0x1c4bda){return new Promise(function(_0x4bd22,_0x3710f5){var _0x48cee5={};logger[_0x7a9b('0x63')](util[_0x7a9b('0x30')](_0x7a9b('0x6d'),_0x30af5a,_0x300493));return uploadFile(_0x2d1cb5,_0x516bb0,_0x2a23b0,_0x300493,path[_0x7a9b('0x6e')](_0x543f38),fs[_0x7a9b('0x6f')](_0x543f38))['then'](function(_0x5ca025){logger[_0x7a9b('0x63')](util['format'](_0x7a9b('0x70'),_0x30af5a,_0x300493,_0x5ca025[_0x7a9b('0x71')]));_0x48cee5['bucket']=_0x5ca025[_0x7a9b('0x72')];_0x48cee5[_0x7a9b('0x73')]=_0x5ca025['Location'];logger[_0x7a9b('0x63')](util[_0x7a9b('0x30')](_0x7a9b('0x74'),_0x30af5a));return startTranscribe(_0x2d1cb5,_0x516bb0,_0x2a23b0,uuidv4(),_0x1c4bda,_0x5ca025[_0x7a9b('0x71')]);})[_0x7a9b('0x26')](function(_0x1c25cb){logger['info'](util['format'](_0x7a9b('0x75'),_0x30af5a,_0x1c25cb[_0x7a9b('0x76')][_0x7a9b('0x77')]));_0x48cee5[_0x7a9b('0x78')]=_0x1c25cb['TranscriptionJob'][_0x7a9b('0x77')];_0x48cee5['transcribeStatus']=_0x1c25cb[_0x7a9b('0x76')][_0x7a9b('0x79')];return _0x4bd22(_0x48cee5);})['catch'](function(_0x11f08d){return _0x3710f5(_0x11f08d);});});}exports[_0x7a9b('0x7a')]=function(_0x284b83,_0x4ddacc,_0x16167e){var _0x1fa17c;var _0x328724;var _0x2a8a72;var _0xe05ac0=require(_0x7a9b('0x4b'));return db[_0x7a9b('0x2c')][_0x7a9b('0x7b')]({'where':{'id':_0x284b83['params']['id']}})[_0x7a9b('0x26')](function(_0x8c4d50){if(_0x8c4d50){var _0x2234de=util[_0x7a9b('0x30')]('%s.cypher',_0x8c4d50[_0x7a9b('0x4d')]);if(fs[_0x7a9b('0x4f')](_0x2234de)){cypher=!![];return _0xe05ac0['decryptFile'](_0x2234de,_0x8c4d50['value'],config[_0x7a9b('0x51')][_0x7a9b('0x52')])['then'](function(){return _0x8c4d50;});}return _0x8c4d50;}})['then'](function(_0x19ff0e){if(!_0x19ff0e){throw new db[(_0x7a9b('0x53'))][(_0x7a9b('0x5f'))](_0x7a9b('0x7c'));}_0x328724=_0x19ff0e;return db[_0x7a9b('0x7d')][_0x7a9b('0x7b')]({'where':{'id':0x1}});})[_0x7a9b('0x26')](handleEntityNotFound(_0x4ddacc,null))[_0x7a9b('0x26')](function(_0x2dd82d){if(_0x2dd82d){_0x1fa17c=_0x2dd82d;if(!_0x1fa17c[_0x7a9b('0x7e')]||!_0x1fa17c[_0x7a9b('0x7f')]||!_0x1fa17c['transcribeRegion']||!_0x1fa17c['language']||!_0x1fa17c[_0x7a9b('0x80')]){throw new db['Sequelize'][(_0x7a9b('0x5f'))]('Transcribe\x20not\x20configured');}if(_0x284b83['body']['runSentiment']&&(!_0x1fa17c['sentiment']||!_0x1fa17c['sentimentAccountId']||!_0x1fa17c[_0x7a9b('0x81')]||!_0x1fa17c['language']||!_0x1fa17c[_0x7a9b('0x80')])){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x7a9b('0x82')][_0x7a9b('0x7b')]({'where':{'id':_0x1fa17c['transcribeAccountId']}});}})[_0x7a9b('0x26')](function(_0x5557aa){if(!_0x5557aa){throw new db[(_0x7a9b('0x53'))][(_0x7a9b('0x5f'))](_0x7a9b('0x83'));}if(!_0x5557aa[_0x7a9b('0x84')]||!_0x5557aa['data2']){throw new db[(_0x7a9b('0x53'))][(_0x7a9b('0x5f'))](_0x7a9b('0x85'));}_0x2a8a72=_0x5557aa;return getBucketslist(_0x2a8a72[_0x7a9b('0x84')],_0x2a8a72[_0x7a9b('0x86')],_0x1fa17c['transcribeRegion']);})[_0x7a9b('0x26')](function(_0xc8697f){if(_0xc8697f&&_0xc8697f['Buckets']){var _0x3a2ae9=_[_0x7a9b('0x46')](_0xc8697f[_0x7a9b('0x87')],function(_0x97b258){return _0x97b258['Name']===_0x1fa17c[_0x7a9b('0x80')];});if(!_0x3a2ae9){logger[_0x7a9b('0x63')](util[_0x7a9b('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x284b83[_0x7a9b('0x43')]['id'],_0x1fa17c[_0x7a9b('0x80')]));return createBucket(_0x2a8a72[_0x7a9b('0x84')],_0x2a8a72[_0x7a9b('0x86')],_0x1fa17c[_0x7a9b('0x88')],_0x1fa17c['bucket']);}logger[_0x7a9b('0x63')](util[_0x7a9b('0x30')](_0x7a9b('0x89'),_0x284b83[_0x7a9b('0x43')]['id'],_0x1fa17c[_0x7a9b('0x80')]));return;}})[_0x7a9b('0x26')](function(_0xb42410){if(_0x328724['transcribeStatus']===_0x7a9b('0x8a')){return transcribe(_0x284b83[_0x7a9b('0x43')]['id'],_0x2a8a72[_0x7a9b('0x84')],_0x2a8a72[_0x7a9b('0x86')],_0x1fa17c[_0x7a9b('0x88')],_0x1fa17c['bucket'],_0x328724[_0x7a9b('0x4d')],_0x1fa17c[_0x7a9b('0x8b')]);}else{logger[_0x7a9b('0x63')](util['format'](_0x7a9b('0x8c'),_0x284b83[_0x7a9b('0x43')]['id']));return{'transcribeStatus':_0x7a9b('0x8d')};}})[_0x7a9b('0x26')](function(_0x59fdbe){if(_0x59fdbe){_0x59fdbe[_0x7a9b('0x8e')]=_0x284b83[_0x7a9b('0x48')][_0x7a9b('0x8f')];return _0x328724[_0x7a9b('0x90')](_0x59fdbe);}})[_0x7a9b('0x26')](respondWithResult(_0x4ddacc,null))[_0x7a9b('0x42')](handleError(_0x4ddacc,null));};function writeFile(_0x16bd17,_0x1ee140){return new Promise(function(_0x5deacb,_0xa6896){fs[_0x7a9b('0x91')](_0x1ee140,_0x16bd17,function(_0x15af0d,_0x546bb7){if(_0x15af0d){return _0xa6896(_0x15af0d);}else{return _0x5deacb(_0x546bb7);}});});}exports[_0x7a9b('0x92')]=function(_0x1032e7,_0x15311e,_0x1dc1c0){return db['VoiceRecording']['findOne']({'where':{'id':_0x1032e7[_0x7a9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x15311e))['then'](function(_0x5dc1b9){if(_0x5dc1b9&&_0x5dc1b9['fileText']){var _0x3173ee=_0x5dc1b9[_0x7a9b('0x93')];var _0x430d81=config[_0x7a9b('0x94')]+_0x7a9b('0x95')+_0x5dc1b9['id']+_0x7a9b('0x96');if(fs['existsSync'](_0x430d81)){return _0x430d81;}return writeFile(_0x3173ee,_0x430d81)['then'](function(){return _0x430d81;});}else{throw new db[(_0x7a9b('0x53'))][(_0x7a9b('0x5f'))](_0x7a9b('0x97'));}})[_0x7a9b('0x26')](function(_0x4d3c63){return _0x15311e[_0x7a9b('0x4a')](_0x4d3c63);})[_0x7a9b('0x42')](handleError(_0x15311e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 9d9d327..eb46972 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid'];(function(_0x5b68b3,_0x2ed81a){var _0x49d158=function(_0xb2531d){while(--_0xb2531d){_0x5b68b3['push'](_0x5b68b3['shift']());}};_0x49d158(++_0x2ed81a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0xfcf0[_0x2dc7c9];return _0x3e6536;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68fd=['path','rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4b04c5,_0x55156d){var _0x43a208=function(_0x5c97a4){while(--_0x5c97a4){_0x4b04c5['push'](_0x4b04c5['shift']());}};_0x43a208(++_0x55156d);}(_0x68fd,0x1e9));var _0xd68f=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x68fd[_0x54da5b];return _0x285d3b;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var logger=require(_0xd68f('0x1'))(_0xd68f('0x2'));var moment=require('moment');var BPromise=require(_0xd68f('0x3'));var rp=require(_0xd68f('0x4'));var fs=require('fs');var path=require(_0xd68f('0x5'));var rimraf=require(_0xd68f('0x6'));var config=require(_0xd68f('0x7'));var attributes=require(_0xd68f('0x8'));module[_0xd68f('0x9')]=function(_0x52b007,_0xc59f3e){return _0x52b007['define'](_0xd68f('0xa'),attributes,{'tableName':_0xd68f('0xb'),'paranoid':![],'indexes':[{'name':_0xd68f('0xc'),'fields':[_0xd68f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d0b44cb..79c0f0c 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(_0x22dbd1,_0x47e0bb){var _0x50a4fd=function(_0x5cadf4){while(--_0x5cadf4){_0x22dbd1['push'](_0x22dbd1['shift']());}};_0x50a4fd(++_0x47e0bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['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 2f23c8e..70c533b 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 _0x01d9=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5e2c70,_0x108e64){var _0x1e6cbc=function(_0x46e5fd){while(--_0x46e5fd){_0x5e2c70['push'](_0x5e2c70['shift']());}};_0x1e6cbc(++_0x108e64);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x326f,0xd1));var _0xf326=function(_0x1757fc,_0xc79556){_0x1757fc=_0x1757fc-0x0;var _0x2cda58=_0x326f[_0x1757fc];return _0x2cda58;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 75bf267..97d6316 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 _0xc2fb=['attended','STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x382797,_0x5f3579){var _0x433e49=function(_0x4dea7d){while(--_0x4dea7d){_0x382797['push'](_0x382797['shift']());}};_0x433e49(++_0x5f3579);}(_0xc2fb,0xab));var _0xbc2f=function(_0x45c05c,_0x4ec2ab){_0x45c05c=_0x45c05c-0x0;var _0x46e5d5=_0xc2fb[_0x45c05c];return _0x46e5d5;};'use strict';var Sequelize=require(_0xbc2f('0x0'));var moment=require(_0xbc2f('0x1'));module['exports']={'type':{'type':Sequelize[_0xbc2f('0x2')](_0xbc2f('0x3'),_0xbc2f('0x4'))},'result':{'type':Sequelize[_0xbc2f('0x5')]},'transfererchannel':{'type':Sequelize[_0xbc2f('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xbc2f('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xbc2f('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xbc2f('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xbc2f('0x5')]},'transfererexten':{'type':Sequelize[_0xbc2f('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xbc2f('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xbc2f('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xbc2f('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xbc2f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xbc2f('0x5')]},'transfereecontext':{'type':Sequelize[_0xbc2f('0x5')]},'transfereeexten':{'type':Sequelize[_0xbc2f('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xbc2f('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xbc2f('0x5')]}}; \ No newline at end of file +var _0xce71=['sequelize','moment','exports','ENUM','attended','STRING','Yes'];(function(_0x325939,_0x30fc6f){var _0x4ea27c=function(_0x24b7f7){while(--_0x24b7f7){_0x325939['push'](_0x325939['shift']());}};_0x4ea27c(++_0x30fc6f);}(_0xce71,0x93));var _0x1ce7=function(_0x612703,_0x24de39){_0x612703=_0x612703-0x0;var _0x5d258a=_0xce71[_0x612703];return _0x5d258a;};'use strict';var Sequelize=require(_0x1ce7('0x0'));var moment=require(_0x1ce7('0x1'));module[_0x1ce7('0x2')]={'type':{'type':Sequelize[_0x1ce7('0x3')]('blind',_0x1ce7('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x1ce7('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1ce7('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1ce7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1ce7('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x1ce7('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1ce7('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1ce7('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1ce7('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1ce7('0x5')]},'transfereecontext':{'type':Sequelize[_0x1ce7('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x1ce7('0x5')]},'isexternal':{'type':Sequelize[_0x1ce7('0x3')](_0x1ce7('0x6'),'No')},'context':{'type':Sequelize[_0x1ce7('0x5')]},'extension':{'type':Sequelize[_0x1ce7('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 29e4772..bbe59dd 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 _0x0b02=['find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','limit','status','Content-Range','apply','save','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','options','includeAll','include','VoiceTransferReport','rows','show','params'];(function(_0x4dc408,_0x491304){var _0x531dda=function(_0x44ae0d){while(--_0x44ae0d){_0x4dc408['push'](_0x4dc408['shift']());}};_0x531dda(++_0x491304);}(_0x0b02,0x1c4));var _0x20b0=function(_0x5c330e,_0x2f79b0){_0x5c330e=_0x5c330e-0x0;var _0x115de5=_0x0b02[_0x5c330e];return _0x115de5;};'use strict';var pdf=require(_0x20b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x20b0('0x1'));var zipdir=require(_0x20b0('0x2'));var jsonpatch=require(_0x20b0('0x3'));var rp=require('request-promise');var moment=require(_0x20b0('0x4'));var BPromise=require(_0x20b0('0x5'));var Mustache=require(_0x20b0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x20b0('0x7'));var csv=require(_0x20b0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x20b0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20b0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x20b0('0xb'));var Papa=require('papaparse');var Redis=require(_0x20b0('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x20b0('0xd'));var as=require(_0x20b0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20b0('0xf'))('api');var utils=require(_0x20b0('0x10'));var config=require(_0x20b0('0x11'));var db=require(_0x20b0('0x12'))['db'];function respondWithStatusCode(_0x34c80b,_0x695585){_0x695585=_0x695585||0xcc;return function(_0x150bb4){if(_0x150bb4){return _0x34c80b['sendStatus'](_0x695585);}return _0x34c80b['status'](_0x695585)[_0x20b0('0x13')]();};}function respondWithResult(_0x3446e8,_0x2f2d5c){_0x2f2d5c=_0x2f2d5c||0xc8;return function(_0x37314){if(_0x37314){return _0x3446e8['status'](_0x2f2d5c)[_0x20b0('0x14')](_0x37314);}};}function respondWithFilteredResult(_0x2459e9,_0x2f223a){return function(_0x253f3c){if(_0x253f3c){var _0x3471e7=_0x253f3c[_0x20b0('0x15')],_0x19294b=_0x2f223a['offset'],_0x23feb5=_0x2f223a['offset']+_0x2f223a[_0x20b0('0x16')],_0x1a07e3;if(_0x23feb5>=_0x3471e7){_0x23feb5=_0x3471e7;_0x1a07e3=0xc8;}else{_0x1a07e3=0xce;}_0x2459e9[_0x20b0('0x17')](_0x1a07e3);return _0x2459e9['set'](_0x20b0('0x18'),_0x19294b+'-'+_0x23feb5+'/'+_0x3471e7)[_0x20b0('0x14')](_0x253f3c);}return null;};}function patchUpdates(_0x14698e){return function(_0xbb344c){try{jsonpatch[_0x20b0('0x19')](_0xbb344c,_0x14698e,!![]);}catch(_0x1ac9dd){return BPromise['reject'](_0x1ac9dd);}return _0xbb344c[_0x20b0('0x1a')]();};}function saveUpdates(_0x2bd61c,_0x5a5436){return function(_0x18741e){if(_0x18741e){return _0x18741e['update'](_0x2bd61c)[_0x20b0('0x1b')](function(_0x3474e9){return _0x3474e9;});}return null;};}function removeEntity(_0x57c199,_0x31a01d){return function(_0xcdf50e){if(_0xcdf50e){return _0xcdf50e['destroy']()[_0x20b0('0x1b')](function(){_0x57c199['status'](0xcc)[_0x20b0('0x13')]();});}};}function handleEntityNotFound(_0x1ea54c,_0x3ee4af){return function(_0x50470d){if(!_0x50470d){_0x1ea54c[_0x20b0('0x1c')](0x194);}return _0x50470d;};}function handleError(_0x2a1b79,_0x18816e){_0x18816e=_0x18816e||0x1f4;return function(_0x30e5bb){logger[_0x20b0('0x1d')](_0x30e5bb['stack']);if(_0x30e5bb[_0x20b0('0x1e')]){delete _0x30e5bb['name'];}_0x2a1b79[_0x20b0('0x17')](_0x18816e)[_0x20b0('0x1f')](_0x30e5bb);};}exports[_0x20b0('0x20')]=function(_0x390d9a,_0x22a99d){var _0x2d3cd1={},_0x47f255={},_0x1b5df1={'count':0x0,'rows':[]};var _0x3faa61=_[_0x20b0('0x21')](db['VoiceTransferReport'][_0x20b0('0x22')],function(_0x5d07be){return{'name':_0x5d07be[_0x20b0('0x23')],'type':_0x5d07be['type']['key']};});_0x47f255[_0x20b0('0x24')]=_[_0x20b0('0x21')](_0x3faa61,_0x20b0('0x1e'));_0x47f255[_0x20b0('0x25')]=_[_0x20b0('0x26')](_0x390d9a[_0x20b0('0x25')]);_0x47f255[_0x20b0('0x27')]=_[_0x20b0('0x28')](_0x47f255[_0x20b0('0x24')],_0x47f255[_0x20b0('0x25')]);_0x2d3cd1[_0x20b0('0x29')]=_[_0x20b0('0x28')](_0x47f255[_0x20b0('0x24')],qs['fields'](_0x390d9a[_0x20b0('0x25')][_0x20b0('0x2a')]));_0x2d3cd1[_0x20b0('0x29')]=_0x2d3cd1[_0x20b0('0x29')][_0x20b0('0x2b')]?_0x2d3cd1[_0x20b0('0x29')]:_0x47f255['model'];if(!_0x390d9a[_0x20b0('0x25')][_0x20b0('0x2c')](_0x20b0('0x2d'))){_0x2d3cd1[_0x20b0('0x16')]=qs[_0x20b0('0x16')](_0x390d9a[_0x20b0('0x25')][_0x20b0('0x16')]);_0x2d3cd1[_0x20b0('0x2e')]=qs['offset'](_0x390d9a[_0x20b0('0x25')][_0x20b0('0x2e')]);}_0x2d3cd1[_0x20b0('0x2f')]=qs[_0x20b0('0x30')](_0x390d9a['query'][_0x20b0('0x30')]);_0x2d3cd1[_0x20b0('0x31')]=qs[_0x20b0('0x27')](_[_0x20b0('0x32')](_0x390d9a[_0x20b0('0x25')],_0x47f255[_0x20b0('0x27')]),_0x3faa61);if(_0x390d9a['query']['filter']){_0x2d3cd1['where']=_[_0x20b0('0x33')](_0x2d3cd1[_0x20b0('0x31')],{'$or':_[_0x20b0('0x21')](_0x3faa61,function(_0x173f90){if(_0x173f90['type']!=='VIRTUAL'){var _0xcf28ac={};_0xcf28ac[_0x173f90[_0x20b0('0x1e')]]={'$like':'%'+_0x390d9a[_0x20b0('0x25')][_0x20b0('0x34')]+'%'};return _0xcf28ac;}})});}_0x2d3cd1=_[_0x20b0('0x33')]({},_0x2d3cd1,_0x390d9a[_0x20b0('0x35')]);var _0x3d458a={'where':_0x2d3cd1[_0x20b0('0x31')]};return db['VoiceTransferReport'][_0x20b0('0x15')](_0x3d458a)[_0x20b0('0x1b')](function(_0x1c08f5){_0x1b5df1[_0x20b0('0x15')]=_0x1c08f5;if(_0x390d9a[_0x20b0('0x25')][_0x20b0('0x36')]){_0x2d3cd1[_0x20b0('0x37')]=[{'all':!![]}];}return db[_0x20b0('0x38')]['findAll'](_0x2d3cd1);})['then'](function(_0x125223){_0x1b5df1[_0x20b0('0x39')]=_0x125223;return _0x1b5df1;})[_0x20b0('0x1b')](respondWithFilteredResult(_0x22a99d,_0x2d3cd1))['catch'](handleError(_0x22a99d,null));};exports[_0x20b0('0x3a')]=function(_0x3a4439,_0x59dc95){var _0x522dc4={'raw':!![],'where':{'id':_0x3a4439[_0x20b0('0x3b')]['id']}},_0x2f0daa={};_0x2f0daa[_0x20b0('0x24')]=_[_0x20b0('0x26')](db[_0x20b0('0x38')]['rawAttributes']);_0x2f0daa[_0x20b0('0x25')]=_[_0x20b0('0x26')](_0x3a4439[_0x20b0('0x25')]);_0x2f0daa[_0x20b0('0x27')]=_[_0x20b0('0x28')](_0x2f0daa[_0x20b0('0x24')],_0x2f0daa[_0x20b0('0x25')]);_0x522dc4[_0x20b0('0x29')]=_[_0x20b0('0x28')](_0x2f0daa[_0x20b0('0x24')],qs[_0x20b0('0x2a')](_0x3a4439[_0x20b0('0x25')][_0x20b0('0x2a')]));_0x522dc4[_0x20b0('0x29')]=_0x522dc4[_0x20b0('0x29')][_0x20b0('0x2b')]?_0x522dc4[_0x20b0('0x29')]:_0x2f0daa[_0x20b0('0x24')];if(_0x3a4439['query'][_0x20b0('0x36')]){_0x522dc4['include']=[{'all':!![]}];}_0x522dc4=_[_0x20b0('0x33')]({},_0x522dc4,_0x3a4439['options']);return db['VoiceTransferReport'][_0x20b0('0x3c')](_0x522dc4)[_0x20b0('0x1b')](handleEntityNotFound(_0x59dc95,null))[_0x20b0('0x1b')](respondWithResult(_0x59dc95,null))[_0x20b0('0x3d')](handleError(_0x59dc95,null));};exports[_0x20b0('0x3e')]=function(_0x1ed364,_0x25c641){return db[_0x20b0('0x38')]['create'](_0x1ed364[_0x20b0('0x3f')],{})[_0x20b0('0x1b')](respondWithResult(_0x25c641,0xc9))[_0x20b0('0x3d')](handleError(_0x25c641,null));};exports['update']=function(_0x487c24,_0x246df1){if(_0x487c24['body']['id']){delete _0x487c24[_0x20b0('0x3f')]['id'];}return db[_0x20b0('0x38')]['find']({'where':{'id':_0x487c24['params']['id']}})[_0x20b0('0x1b')](handleEntityNotFound(_0x246df1,null))[_0x20b0('0x1b')](saveUpdates(_0x487c24[_0x20b0('0x3f')],null))[_0x20b0('0x1b')](respondWithResult(_0x246df1,null))[_0x20b0('0x3d')](handleError(_0x246df1,null));};exports['destroy']=function(_0x1e0aec,_0x46e375){return db[_0x20b0('0x38')][_0x20b0('0x3c')]({'where':{'id':_0x1e0aec[_0x20b0('0x3b')]['id']}})[_0x20b0('0x1b')](handleEntityNotFound(_0x46e375,null))['then'](removeEntity(_0x46e375,null))[_0x20b0('0x3d')](handleError(_0x46e375,null));}; \ No newline at end of file +var _0x9895=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName'];(function(_0x271b9f,_0x43e9c7){var _0x4f7f00=function(_0x55d14f){while(--_0x55d14f){_0x271b9f['push'](_0x271b9f['shift']());}};_0x4f7f00(++_0x43e9c7);}(_0x9895,0x14b));var _0x5989=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9895[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x5989('0x0'));var emlformat=require(_0x5989('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5989('0x2'));var jsonpatch=require(_0x5989('0x3'));var rp=require('request-promise');var moment=require(_0x5989('0x4'));var BPromise=require(_0x5989('0x5'));var Mustache=require(_0x5989('0x6'));var util=require(_0x5989('0x7'));var path=require(_0x5989('0x8'));var sox=require(_0x5989('0x9'));var csv=require(_0x5989('0xa'));var ejs=require(_0x5989('0xb'));var fs=require('fs');var _=require(_0x5989('0xc'));var squel=require(_0x5989('0xd'));var crypto=require(_0x5989('0xe'));var jsforce=require(_0x5989('0xf'));var deskjs=require(_0x5989('0x10'));var toCsv=require(_0x5989('0xa'));var querystring=require(_0x5989('0x11'));var Papa=require('papaparse');var Redis=require(_0x5989('0x12'));var authService=require(_0x5989('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5989('0x14'));var logger=require(_0x5989('0x15'))(_0x5989('0x16'));var utils=require('../../config/utils');var config=require(_0x5989('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31df42,_0x1bbd0e){_0x1bbd0e=_0x1bbd0e||0xcc;return function(_0x26bcb9){if(_0x26bcb9){return _0x31df42[_0x5989('0x18')](_0x1bbd0e);}return _0x31df42[_0x5989('0x19')](_0x1bbd0e)[_0x5989('0x1a')]();};}function respondWithResult(_0x2dcd37,_0x7eedec){_0x7eedec=_0x7eedec||0xc8;return function(_0x2834db){if(_0x2834db){return _0x2dcd37['status'](_0x7eedec)[_0x5989('0x1b')](_0x2834db);}};}function respondWithFilteredResult(_0x3afb6b,_0x296a39){return function(_0x3fc9df){if(_0x3fc9df){var _0x1ba956=_0x3fc9df['count'],_0xb518fc=_0x296a39[_0x5989('0x1c')],_0x35ef1d=_0x296a39[_0x5989('0x1c')]+_0x296a39[_0x5989('0x1d')],_0x3171e4;if(_0x35ef1d>=_0x1ba956){_0x35ef1d=_0x1ba956;_0x3171e4=0xc8;}else{_0x3171e4=0xce;}_0x3afb6b['status'](_0x3171e4);return _0x3afb6b[_0x5989('0x1e')](_0x5989('0x1f'),_0xb518fc+'-'+_0x35ef1d+'/'+_0x1ba956)[_0x5989('0x1b')](_0x3fc9df);}return null;};}function patchUpdates(_0x4c4826){return function(_0x2cc738){try{jsonpatch[_0x5989('0x20')](_0x2cc738,_0x4c4826,!![]);}catch(_0x57b56b){return BPromise[_0x5989('0x21')](_0x57b56b);}return _0x2cc738['save']();};}function saveUpdates(_0x217237,_0x581675){return function(_0x3e1c41){if(_0x3e1c41){return _0x3e1c41[_0x5989('0x22')](_0x217237)[_0x5989('0x23')](function(_0x5222fa){return _0x5222fa;});}return null;};}function removeEntity(_0x1e1be6,_0x559f2f){return function(_0x2ba94d){if(_0x2ba94d){return _0x2ba94d['destroy']()[_0x5989('0x23')](function(){_0x1e1be6[_0x5989('0x19')](0xcc)[_0x5989('0x1a')]();});}};}function handleEntityNotFound(_0x1f0690,_0x14c924){return function(_0x20d302){if(!_0x20d302){_0x1f0690[_0x5989('0x18')](0x194);}return _0x20d302;};}function handleError(_0x4c253d,_0x1b8a69){_0x1b8a69=_0x1b8a69||0x1f4;return function(_0x47fd65){logger[_0x5989('0x24')](_0x47fd65[_0x5989('0x25')]);if(_0x47fd65[_0x5989('0x26')]){delete _0x47fd65[_0x5989('0x26')];}_0x4c253d['status'](_0x1b8a69)[_0x5989('0x27')](_0x47fd65);};}exports[_0x5989('0x28')]=function(_0x4e06f1,_0x14b763){var _0x1f375e={},_0x353fa4={},_0x2723bd={'count':0x0,'rows':[]};var _0x24ee89=_['map'](db[_0x5989('0x29')][_0x5989('0x2a')],function(_0x28cecd){return{'name':_0x28cecd[_0x5989('0x2b')],'type':_0x28cecd[_0x5989('0x2c')][_0x5989('0x2d')]};});_0x353fa4[_0x5989('0x2e')]=_[_0x5989('0x2f')](_0x24ee89,'name');_0x353fa4['query']=_[_0x5989('0x30')](_0x4e06f1[_0x5989('0x31')]);_0x353fa4[_0x5989('0x32')]=_[_0x5989('0x33')](_0x353fa4[_0x5989('0x2e')],_0x353fa4[_0x5989('0x31')]);_0x1f375e[_0x5989('0x34')]=_[_0x5989('0x33')](_0x353fa4[_0x5989('0x2e')],qs[_0x5989('0x35')](_0x4e06f1[_0x5989('0x31')][_0x5989('0x35')]));_0x1f375e[_0x5989('0x34')]=_0x1f375e['attributes'][_0x5989('0x36')]?_0x1f375e[_0x5989('0x34')]:_0x353fa4['model'];if(!_0x4e06f1['query'][_0x5989('0x37')](_0x5989('0x38'))){_0x1f375e['limit']=qs[_0x5989('0x1d')](_0x4e06f1[_0x5989('0x31')]['limit']);_0x1f375e[_0x5989('0x1c')]=qs[_0x5989('0x1c')](_0x4e06f1[_0x5989('0x31')]['offset']);}_0x1f375e[_0x5989('0x39')]=qs[_0x5989('0x3a')](_0x4e06f1['query']['sort']);_0x1f375e[_0x5989('0x3b')]=qs[_0x5989('0x32')](_['pick'](_0x4e06f1[_0x5989('0x31')],_0x353fa4['filters']),_0x24ee89);if(_0x4e06f1[_0x5989('0x31')]['filter']){_0x1f375e[_0x5989('0x3b')]=_['merge'](_0x1f375e[_0x5989('0x3b')],{'$or':_[_0x5989('0x2f')](_0x24ee89,function(_0x3accc5){if(_0x3accc5[_0x5989('0x2c')]!==_0x5989('0x3c')){var _0x1fed07={};_0x1fed07[_0x3accc5[_0x5989('0x26')]]={'$like':'%'+_0x4e06f1[_0x5989('0x31')][_0x5989('0x3d')]+'%'};return _0x1fed07;}})});}_0x1f375e=_[_0x5989('0x3e')]({},_0x1f375e,_0x4e06f1[_0x5989('0x3f')]);var _0x5d95cb={'where':_0x1f375e['where']};return db[_0x5989('0x29')][_0x5989('0x40')](_0x5d95cb)[_0x5989('0x23')](function(_0x351294){_0x2723bd['count']=_0x351294;if(_0x4e06f1[_0x5989('0x31')][_0x5989('0x41')]){_0x1f375e['include']=[{'all':!![]}];}return db[_0x5989('0x29')][_0x5989('0x42')](_0x1f375e);})[_0x5989('0x23')](function(_0x408489){_0x2723bd[_0x5989('0x43')]=_0x408489;return _0x2723bd;})[_0x5989('0x23')](respondWithFilteredResult(_0x14b763,_0x1f375e))[_0x5989('0x44')](handleError(_0x14b763,null));};exports[_0x5989('0x45')]=function(_0x10fdc5,_0x396683){var _0x24a26d={'raw':!![],'where':{'id':_0x10fdc5[_0x5989('0x46')]['id']}},_0x4d5428={};_0x4d5428['model']=_[_0x5989('0x30')](db['VoiceTransferReport'][_0x5989('0x2a')]);_0x4d5428[_0x5989('0x31')]=_[_0x5989('0x30')](_0x10fdc5['query']);_0x4d5428['filters']=_['intersection'](_0x4d5428[_0x5989('0x2e')],_0x4d5428[_0x5989('0x31')]);_0x24a26d[_0x5989('0x34')]=_[_0x5989('0x33')](_0x4d5428[_0x5989('0x2e')],qs[_0x5989('0x35')](_0x10fdc5[_0x5989('0x31')]['fields']));_0x24a26d[_0x5989('0x34')]=_0x24a26d[_0x5989('0x34')][_0x5989('0x36')]?_0x24a26d['attributes']:_0x4d5428[_0x5989('0x2e')];if(_0x10fdc5['query'][_0x5989('0x41')]){_0x24a26d[_0x5989('0x47')]=[{'all':!![]}];}_0x24a26d=_[_0x5989('0x3e')]({},_0x24a26d,_0x10fdc5['options']);return db[_0x5989('0x29')][_0x5989('0x48')](_0x24a26d)[_0x5989('0x23')](handleEntityNotFound(_0x396683,null))[_0x5989('0x23')](respondWithResult(_0x396683,null))[_0x5989('0x44')](handleError(_0x396683,null));};exports[_0x5989('0x49')]=function(_0x2ec54a,_0x412c57){return db[_0x5989('0x29')]['create'](_0x2ec54a[_0x5989('0x4a')],{})['then'](respondWithResult(_0x412c57,0xc9))[_0x5989('0x44')](handleError(_0x412c57,null));};exports[_0x5989('0x22')]=function(_0x3c7edf,_0x26b25c){if(_0x3c7edf[_0x5989('0x4a')]['id']){delete _0x3c7edf[_0x5989('0x4a')]['id'];}return db[_0x5989('0x29')]['find']({'where':{'id':_0x3c7edf['params']['id']}})['then'](handleEntityNotFound(_0x26b25c,null))[_0x5989('0x23')](saveUpdates(_0x3c7edf[_0x5989('0x4a')],null))[_0x5989('0x23')](respondWithResult(_0x26b25c,null))[_0x5989('0x44')](handleError(_0x26b25c,null));};exports['destroy']=function(_0x55ef2e,_0x57edbb){return db[_0x5989('0x29')][_0x5989('0x48')]({'where':{'id':_0x55ef2e[_0x5989('0x46')]['id']}})[_0x5989('0x23')](handleEntityNotFound(_0x57edbb,null))[_0x5989('0x23')](removeEntity(_0x57edbb,null))[_0x5989('0x44')](handleError(_0x57edbb,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ee2b3cb..fa1aceb 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 _0xfa25=['path','rimraf','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x248c9d,_0x327180){var _0x5a2265=function(_0x215ade){while(--_0x215ade){_0x248c9d['push'](_0x248c9d['shift']());}};_0x5a2265(++_0x327180);}(_0xfa25,0x14f));var _0x5fa2=function(_0x248494,_0x100821){_0x248494=_0x248494-0x0;var _0x55856f=_0xfa25[_0x248494];return _0x55856f;};'use strict';var _=require(_0x5fa2('0x0'));var util=require(_0x5fa2('0x1'));var logger=require(_0x5fa2('0x2'))(_0x5fa2('0x3'));var moment=require(_0x5fa2('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fa2('0x5'));var fs=require('fs');var path=require(_0x5fa2('0x6'));var rimraf=require(_0x5fa2('0x7'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x3e6403,_0x3cda81){return _0x3e6403[_0x5fa2('0x8')](_0x5fa2('0x9'),attributes,{'tableName':_0x5fa2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5357=['../../config/logger','api','request-promise','path','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','util'];(function(_0x4031b4,_0x198544){var _0x2d4eb9=function(_0x15360c){while(--_0x15360c){_0x4031b4['push'](_0x4031b4['shift']());}};_0x2d4eb9(++_0x198544);}(_0x5357,0x7d));var _0x7535=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x5357[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require(_0x7535('0x0'));var logger=require(_0x7535('0x1'))(_0x7535('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7535('0x3'));var fs=require('fs');var path=require(_0x7535('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7535('0x5'));module[_0x7535('0x6')]=function(_0x2edfdc,_0xee9fa3){return _0x2edfdc[_0x7535('0x7')](_0x7535('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 178bda5..bbd7dae 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 _0x7421=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','CreateVoiceTransferReport','create','body','options','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7421,0x1aa));var _0x1742=function(_0x5d3d59,_0x20e288){_0x5d3d59=_0x5d3d59-0x0;var _0x278def=_0x7421[_0x5d3d59];return _0x278def;};'use strict';var _=require('lodash');var util=require(_0x1742('0x0'));var moment=require(_0x1742('0x1'));var BPromise=require(_0x1742('0x2'));var rs=require(_0x1742('0x3'));var fs=require('fs');var Redis=require(_0x1742('0x4'));var db=require(_0x1742('0x5'))['db'];var utils=require(_0x1742('0x6'));var logger=require(_0x1742('0x7'))('rpc');var config=require(_0x1742('0x8'));var jayson=require(_0x1742('0x9'));var client=jayson[_0x1742('0xa')][_0x1742('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cbdf8,_0x9b31b4,_0x312e3f){return new BPromise(function(_0x103835,_0x180461){return client[_0x1742('0xc')](_0x4cbdf8,_0x312e3f)[_0x1742('0xd')](function(_0x57ebd3){logger[_0x1742('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x9b31b4,_0x1742('0xf'));logger[_0x1742('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x9b31b4,_0x1742('0xf'),JSON[_0x1742('0x11')](_0x57ebd3));if(_0x57ebd3[_0x1742('0x12')]){if(_0x57ebd3['error'][_0x1742('0x13')]===0x1f4){logger[_0x1742('0x12')](_0x1742('0x14'),_0x9b31b4,_0x57ebd3[_0x1742('0x12')][_0x1742('0x15')]);return _0x180461(_0x57ebd3['error'][_0x1742('0x15')]);}logger['error'](_0x1742('0x14'),_0x9b31b4,_0x57ebd3[_0x1742('0x12')][_0x1742('0x15')]);return _0x103835(_0x57ebd3['error']['message']);}else{logger[_0x1742('0xe')](_0x1742('0x14'),_0x9b31b4,'request\x20sent');_0x103835(_0x57ebd3['result']['message']);}})['catch'](function(_0x167e54){logger[_0x1742('0x12')](_0x1742('0x14'),_0x9b31b4,_0x167e54);_0x180461(_0x167e54);});});}exports[_0x1742('0x16')]=function(_0x224859){var _0x155396=this;return new Promise(function(_0x48f68d,_0x2ef763){return db['VoiceTransferReport'][_0x1742('0x17')](_0x224859[_0x1742('0x18')],{'raw':_0x224859['options']?_0x224859[_0x1742('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2f2ee6){logger[_0x1742('0xe')](_0x1742('0x16'),_0x224859);logger[_0x1742('0x10')]('CreateVoiceTransferReport',_0x224859,JSON[_0x1742('0x11')](_0x2f2ee6));_0x48f68d(_0x2f2ee6);})[_0x1742('0x1a')](function(_0x16f9d5){logger[_0x1742('0x12')](_0x1742('0x16'),_0x16f9d5[_0x1742('0x15')],_0x224859);_0x2ef763(_0x155396[_0x1742('0x12')](0x1f4,_0x16f9d5[_0x1742('0x15')]));});});}; \ No newline at end of file +var _0x51cb=['error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','info','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x34ed48,_0x2cc995){var _0x37da5c=function(_0x5b6e16){while(--_0x5b6e16){_0x34ed48['push'](_0x34ed48['shift']());}};_0x37da5c(++_0x2cc995);}(_0x51cb,0xb1));var _0xb51c=function(_0x34f33d,_0x48e914){_0x34f33d=_0x34f33d-0x0;var _0x456ffe=_0x51cb[_0x34f33d];return _0x456ffe;};'use strict';var _=require(_0xb51c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb51c('0x1'));var fs=require('fs');var Redis=require(_0xb51c('0x2'));var db=require(_0xb51c('0x3'))['db'];var utils=require(_0xb51c('0x4'));var logger=require(_0xb51c('0x5'))(_0xb51c('0x6'));var config=require(_0xb51c('0x7'));var jayson=require(_0xb51c('0x8'));var client=jayson[_0xb51c('0x9')][_0xb51c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265c8e,_0x25d417,_0x2e7871){return new BPromise(function(_0x2a0a86,_0x12d79a){return client[_0xb51c('0xb')](_0x265c8e,_0x2e7871)[_0xb51c('0xc')](function(_0x11f46d){logger['info'](_0xb51c('0xd'),_0x25d417,_0xb51c('0xe'));logger[_0xb51c('0xf')](_0xb51c('0x10'),_0x25d417,_0xb51c('0xe'),JSON[_0xb51c('0x11')](_0x11f46d));if(_0x11f46d['error']){if(_0x11f46d['error'][_0xb51c('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x25d417,_0x11f46d[_0xb51c('0x13')][_0xb51c('0x14')]);return _0x12d79a(_0x11f46d[_0xb51c('0x13')]['message']);}logger[_0xb51c('0x13')](_0xb51c('0xd'),_0x25d417,_0x11f46d[_0xb51c('0x13')][_0xb51c('0x14')]);return _0x2a0a86(_0x11f46d[_0xb51c('0x13')][_0xb51c('0x14')]);}else{logger['info'](_0xb51c('0xd'),_0x25d417,_0xb51c('0xe'));_0x2a0a86(_0x11f46d['result'][_0xb51c('0x14')]);}})[_0xb51c('0x15')](function(_0x18b87a){logger[_0xb51c('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x25d417,_0x18b87a);_0x12d79a(_0x18b87a);});});}exports[_0xb51c('0x16')]=function(_0xccd31b){var _0x55614f=this;return new Promise(function(_0x3af866,_0x1f95b6){return db[_0xb51c('0x17')][_0xb51c('0x18')](_0xccd31b[_0xb51c('0x19')],{'raw':_0xccd31b[_0xb51c('0x1a')]?_0xccd31b[_0xb51c('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xc3cb0d){logger[_0xb51c('0x1b')](_0xb51c('0x16'),_0xccd31b);logger[_0xb51c('0xf')](_0xb51c('0x16'),_0xccd31b,JSON[_0xb51c('0x11')](_0xc3cb0d));_0x3af866(_0xc3cb0d);})[_0xb51c('0x15')](function(_0x2ab35b){logger[_0xb51c('0x13')](_0xb51c('0x16'),_0x2ab35b[_0xb51c('0x14')],_0xccd31b);_0x1f95b6(_0x55614f[_0xb51c('0x13')](0x1f4,_0x2ab35b['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 968b6d9..652c179 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40ca=['/answer','answer','/hold','hold','/unhold','unhold','calls','/transfer','exports','express','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','canUpdate'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x40ca,0x1a1));var _0xa40c=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x40ca[_0x5783f4];return _0x28e380;};'use strict';var express=require(_0xa40c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xa40c('0x1'));router[_0xa40c('0x2')](_0xa40c('0x3'),auth[_0xa40c('0x4')](),auth['canUpdate'](),controller[_0xa40c('0x5')]);router['post'](_0xa40c('0x6'),auth['isAuthenticated'](),auth[_0xa40c('0x7')](),controller['hangup']);router[_0xa40c('0x2')](_0xa40c('0x8'),auth[_0xa40c('0x4')](),auth[_0xa40c('0x7')](),controller[_0xa40c('0x9')]);router['post'](_0xa40c('0xa'),auth[_0xa40c('0x4')](),auth[_0xa40c('0x7')](),controller[_0xa40c('0xb')]);router[_0xa40c('0x2')](_0xa40c('0xc'),auth[_0xa40c('0x4')](),auth[_0xa40c('0x7')](),controller[_0xa40c('0xd')]);router[_0xa40c('0x2')]('/calls',auth[_0xa40c('0x4')](),auth['canUpdate'](),controller[_0xa40c('0xe')]);router[_0xa40c('0x2')](_0xa40c('0xf'),auth[_0xa40c('0x4')](),auth[_0xa40c('0x7')](),controller['transfer']);module[_0xa40c('0x10')]=router; \ No newline at end of file +var _0x1d5b=['isAuthenticated','canUpdate','originate','hangup','/answer','answer','/unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post'];(function(_0x91e917,_0x280010){var _0x4a0d09=function(_0xb83d86){while(--_0xb83d86){_0x91e917['push'](_0x91e917['shift']());}};_0x4a0d09(++_0x280010);}(_0x1d5b,0x13c));var _0xb1d5=function(_0xea2742,_0x32af37){_0xea2742=_0xea2742-0x0;var _0x54833c=_0x1d5b[_0xea2742];return _0x54833c;};'use strict';var express=require(_0xb1d5('0x0'));var router=express[_0xb1d5('0x1')]();var auth=require(_0xb1d5('0x2'));var controller=require('./webbar.controller');router[_0xb1d5('0x3')]('/originate',auth[_0xb1d5('0x4')](),auth[_0xb1d5('0x5')](),controller[_0xb1d5('0x6')]);router[_0xb1d5('0x3')]('/hangup',auth['isAuthenticated'](),auth[_0xb1d5('0x5')](),controller[_0xb1d5('0x7')]);router[_0xb1d5('0x3')](_0xb1d5('0x8'),auth[_0xb1d5('0x4')](),auth[_0xb1d5('0x5')](),controller[_0xb1d5('0x9')]);router[_0xb1d5('0x3')]('/hold',auth[_0xb1d5('0x4')](),auth[_0xb1d5('0x5')](),controller['hold']);router['post'](_0xb1d5('0xa'),auth[_0xb1d5('0x4')](),auth[_0xb1d5('0x5')](),controller['unhold']);router[_0xb1d5('0x3')](_0xb1d5('0xb'),auth[_0xb1d5('0x4')](),auth['canUpdate'](),controller[_0xb1d5('0xc')]);router[_0xb1d5('0x3')](_0xb1d5('0xd'),auth[_0xb1d5('0x4')](),auth['canUpdate'](),controller[_0xb1d5('0xe')]);module[_0xb1d5('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ccf61db..1a54f46 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25b0=['answer','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','calls','calls\x20fired:','rows','UserId','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','webbar:originate','entityFound:','format','user:%s','webbar:hangup'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x25b0,0x140));var _0x025b=function(_0x36fe46,_0x40010c){_0x36fe46=_0x36fe46-0x0;var _0x4d2e9c=_0x25b0[_0x36fe46];return _0x4d2e9c;};'use strict';var path=require(_0x025b('0x0'));var fs=require('fs');var _=require(_0x025b('0x1'));var db=require(_0x025b('0x2'))['db'];var config=require(_0x025b('0x3'));var util=require(_0x025b('0x4'));var BPromise=require(_0x025b('0x5'));var jayson=require(_0x025b('0x6'));var amiClient=jayson[_0x025b('0x7')][_0x025b('0x8')]({'port':0x232a});var logger=require(_0x025b('0x9'))('webbarapi');var Redis=require(_0x025b('0xa'));config[_0x025b('0xb')]=_[_0x025b('0xc')](config['redis'],{'host':_0x025b('0xd'),'port':0x18eb});var io=require(_0x025b('0xe'))(new Redis(config[_0x025b('0xb')]));var Schema=require(_0x025b('0xf'));var originateValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],_0x025b('0x11')]},'callNumber':{'type':_0x025b('0x12'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x025b('0x12')},'callbackUrl':{'type':_0x025b('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],_0x025b('0x11')]},'sessionId':{'type':_0x025b('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],_0x025b('0x11')]},'sessionId':{'type':_0x025b('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x025b('0x12'),'required':[!![],_0x025b('0x13')]},'transferNumber':{'type':_0x025b('0x12'),'required':[!![],_0x025b('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x025b('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],_0x025b('0x11')]},'sessionId':{'type':_0x025b('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],_0x025b('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x025b('0x10'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x242be4,_0x360856,_0x34b8b1){logger[_0x025b('0x15')](_0x242be4,_0x360856,JSON[_0x025b('0x16')](_0x34b8b1));io['to'](_0x242be4)[_0x025b('0x17')](_0x360856,_0x34b8b1);}function handleError(_0xf43f34){return function(_0x525651){console[_0x025b('0x18')](_0x025b('0x19'),_0x525651,_0x525651 instanceof RangeError);logger[_0x025b('0x1a')](_0x525651[_0x025b('0x1b')]);if(_0x525651 instanceof RangeError){if(_0x525651[_0x025b('0x1c')]){delete _0x525651[_0x025b('0x1c')];}_0xf43f34[_0x025b('0x1d')](0x194)[_0x025b('0x1e')](_0x525651);}else{if(_0x525651[_0x025b('0x1c')]){delete _0x525651[_0x025b('0x1c')];}_0xf43f34['status'](0x1f4)[_0x025b('0x1e')](_0x525651);}};}function checkError(){return function(_0x3e84d4){if(!_0x3e84d4){throw new RangeError(_0x025b('0x1f'));}return _0x3e84d4;};}function respondWithRpcPromise(_0x6ed27e,_0x5d3e63){return new BPromise(function(_0x4c712a,_0x1a519d){var _0x415655=amiClient;return _0x415655[_0x025b('0x20')](_0x6ed27e,_0x5d3e63)[_0x025b('0x21')](function(_0x4edb56){if(_0x4edb56[_0x025b('0x1a')]){if(_0x4edb56[_0x025b('0x1a')][_0x025b('0x22')]===0x1f4){return _0x1a519d(_0x4edb56[_0x025b('0x1a')][_0x025b('0x23')]);}return _0x4c712a(_0x4edb56[_0x025b('0x1a')][_0x025b('0x23')]);}else{_0x4c712a(_0x4edb56[_0x025b('0x24')]);}})[_0x025b('0x25')](function(_0x352f69){_0x1a519d(_0x352f69);});});}function getAgent(_0xca561c){return db[_0x025b('0x26')][_0x025b('0x27')]({'where':{'id':_0xca561c,'role':_0x025b('0x28')}})['then'](checkError());}function getAgentCheckSession(_0x227e6b,_0x3a4e03){return new BPromise(function(_0x11521d,_0x2f8a74){var _0x5c9614=respondWithRpcPromise(_0x025b('0x29'));var _0x503aaf=getAgent(_0x227e6b);Promise[_0x025b('0x2a')]([_0x5c9614,_0x503aaf])[_0x025b('0x21')](function(_0x296de2){var _0x229e6d=_0x296de2[0x0];var _0x2d074f=_0x296de2[0x1];var _0x2f02bc=_[_0x025b('0x2b')](_0x229e6d['rows'],function(_0x41d26e){return _0x41d26e['UserId']==_0x2d074f['id']&&_0x41d26e[_0x025b('0x2c')]==_0x3a4e03;});if(_0x2f02bc[_0x025b('0x2d')]==0x1){_0x11521d(_0x2d074f);}else{_0x2f8a74(new RangeError(_0x025b('0x2e')+_0x3a4e03+_0x025b('0x2f')));}});});}exports['originate']=function(_0x2459d3,_0x2d8ffe){logger[_0x025b('0x15')](_0x025b('0x30'),_0x2459d3[_0x025b('0x31')]);var _0x2743e5=originateValidation[_0x025b('0xf')](_0x2459d3[_0x025b('0x31')]);if(_0x2743e5['length']>0x0){return _0x2d8ffe[_0x025b('0x1d')](0x190)[_0x025b('0x32')](_0x2743e5);}var _0x507b89=_0x2459d3[_0x025b('0x31')][_0x025b('0x33')];var _0x15b54d=_0x2459d3[_0x025b('0x31')][_0x025b('0x34')];var _0x4f1715=_0x2459d3['body'][_0x025b('0x35')];var _0xadab9=_0x2459d3[_0x025b('0x31')][_0x025b('0x36')];return getAgent(_0x507b89)[_0x025b('0x21')](function(_0x39e25a){logger[_0x025b('0x15')]('entityFound:',_0x39e25a['name']);emit(util['format']('user:%s',_0x39e25a['name']),_0x025b('0x37'),{'callNumber':_0x15b54d,'callerId':_0x4f1715,'callbackUrl':_0xadab9});return _0x2d8ffe[_0x025b('0x1d')](0xc8)[_0x025b('0x32')]({'error':![],'message':'originate\x20executed!'});})[_0x025b('0x25')](handleError(_0x2d8ffe));};exports['hangup']=function(_0x51de97,_0x3c0ba9){logger[_0x025b('0x15')]('hangup\x20fired:',_0x51de97[_0x025b('0x31')]);var _0xb8e90=hangupValidation[_0x025b('0xf')](_0x51de97['body']);if(_0xb8e90[_0x025b('0x2d')]>0x0){return _0x3c0ba9['status'](0x190)[_0x025b('0x32')](_0xb8e90);}var _0x442bac=_0x51de97[_0x025b('0x31')][_0x025b('0x33')];var _0x5f52db=_0x51de97[_0x025b('0x31')]['sessionId'];return getAgent(_0x442bac)[_0x025b('0x21')](function(_0x5dbf2e){logger[_0x025b('0x15')](_0x025b('0x38'),_0x5dbf2e[_0x025b('0x1c')]);emit(util[_0x025b('0x39')](_0x025b('0x3a'),_0x5dbf2e['name']),_0x025b('0x3b'),{'sessionId':_0x5f52db});return _0x3c0ba9[_0x025b('0x1d')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x025b('0x25')](handleError(_0x3c0ba9));};exports[_0x025b('0x3c')]=function(_0x314d64,_0x39336e){logger[_0x025b('0x15')]('answer\x20fired:',_0x314d64[_0x025b('0x31')]);var _0x4b59df=answerValidation[_0x025b('0xf')](_0x314d64[_0x025b('0x31')]);if(_0x4b59df[_0x025b('0x2d')]>0x0){return _0x39336e[_0x025b('0x1d')](0x190)[_0x025b('0x32')](_0x4b59df);}var _0x57bd80=_0x314d64[_0x025b('0x31')][_0x025b('0x33')];var _0xf2b103=_0x314d64[_0x025b('0x31')][_0x025b('0x2c')];return getAgent(_0x57bd80)[_0x025b('0x21')](function(_0x250c02){logger[_0x025b('0x15')](_0x025b('0x38'),_0x250c02[_0x025b('0x1c')]);emit(util[_0x025b('0x39')](_0x025b('0x3a'),_0x250c02[_0x025b('0x1c')]),_0x025b('0x3d'),{'sessionId':_0xf2b103});return _0x39336e[_0x025b('0x1d')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x39336e));};exports['hold']=function(_0x23cd60,_0x12bf43){logger[_0x025b('0x15')](_0x025b('0x3e'),_0x23cd60[_0x025b('0x31')]);var _0x16c244=holdValidation['validate'](_0x23cd60[_0x025b('0x31')]);if(_0x16c244[_0x025b('0x2d')]>0x0){return _0x12bf43['status'](0x190)[_0x025b('0x32')](_0x16c244);}var _0x39ce38=_0x23cd60['body'][_0x025b('0x33')];var _0x10a081=_0x23cd60[_0x025b('0x31')][_0x025b('0x2c')];return getAgent(_0x39ce38)[_0x025b('0x21')](function(_0x5489c0){logger[_0x025b('0x15')](_0x025b('0x38'),_0x5489c0[_0x025b('0x1c')]);emit(util[_0x025b('0x39')]('user:%s',_0x5489c0[_0x025b('0x1c')]),_0x025b('0x3f'),{'sessionId':_0x10a081});return _0x12bf43[_0x025b('0x1d')](0xc8)[_0x025b('0x32')]({'error':![],'message':_0x025b('0x40')});})[_0x025b('0x25')](handleError(_0x12bf43));};exports['unhold']=function(_0x317001,_0xc216ff){logger[_0x025b('0x15')]('unhold\x20fired:',_0x317001[_0x025b('0x31')]);var _0x11feb3=unholdValidation[_0x025b('0xf')](_0x317001['body']);if(_0x11feb3['length']>0x0){return _0xc216ff[_0x025b('0x1d')](0x190)['json'](_0x11feb3);}var _0x29c44b=_0x317001[_0x025b('0x31')][_0x025b('0x33')];var _0x5d6cbc=_0x317001[_0x025b('0x31')][_0x025b('0x2c')];return getAgent(_0x29c44b)[_0x025b('0x21')](function(_0x193932){logger['info']('entityFound:',_0x193932[_0x025b('0x1c')]);emit(util[_0x025b('0x39')](_0x025b('0x3a'),_0x193932[_0x025b('0x1c')]),_0x025b('0x41'),{'sessionId':_0x5d6cbc});return _0xc216ff[_0x025b('0x1d')](0xc8)[_0x025b('0x32')]({'error':![],'message':'unhold\x20executed!'});})[_0x025b('0x25')](handleError(_0xc216ff));};exports[_0x025b('0x42')]=function(_0x4d39fb,_0xa54811){logger[_0x025b('0x15')](_0x025b('0x43'),_0xa54811[_0x025b('0x31')]);var _0x4298a7=callsValidation[_0x025b('0xf')](_0x4d39fb[_0x025b('0x31')]);if(_0x4298a7['length']>0x0){return _0xa54811[_0x025b('0x1d')](0x190)['json'](_0x4298a7);}var _0x42a1ad=_0x4d39fb[_0x025b('0x31')][_0x025b('0x33')];var _0x3c8733=respondWithRpcPromise('VoiceChannels');var _0x5a3b73=getAgent(_0x42a1ad);return Promise[_0x025b('0x2a')]([_0x3c8733,_0x5a3b73])[_0x025b('0x21')](function(_0x840d96){var _0x595e2e=_0x840d96[0x0];var _0x2655a8=_0x840d96[0x1];var _0x3c2208=_[_0x025b('0x2b')](_0x595e2e[_0x025b('0x44')],function(_0x110716){return _0x110716[_0x025b('0x45')]==_0x2655a8['id'];});return _0xa54811[_0x025b('0x1d')](0xc8)['json']({'count':_0x3c2208['length'],'rows':_0x3c2208});})['catch'](handleError(_0xa54811));};exports[_0x025b('0x46')]=function(_0x391246,_0x556fb9){logger['info'](_0x025b('0x47'),_0x391246['body']);var _0x4bad94=conferenceValidation[_0x025b('0xf')](_0x391246[_0x025b('0x31')]);if(_0x4bad94[_0x025b('0x2d')]>0x0){return _0x556fb9['status'](0x190)['json'](_0x4bad94);}var _0x10af4a=_0x391246[_0x025b('0x31')][_0x025b('0x33')];return getAgent(_0x10af4a)[_0x025b('0x21')](function(_0x1386e6){logger[_0x025b('0x15')](_0x025b('0x38'),_0x1386e6[_0x025b('0x1c')]);emit(util[_0x025b('0x39')](_0x025b('0x3a'),_0x1386e6[_0x025b('0x1c')]),_0x025b('0x48'));return _0x556fb9['status'](0xc8)[_0x025b('0x32')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x556fb9));};exports['transfer']=function(_0x2eb97e,_0x331297){logger[_0x025b('0x15')](_0x025b('0x49'),_0x2eb97e[_0x025b('0x31')]);var _0x2a8ef0=transferValidation[_0x025b('0xf')](_0x2eb97e['body']);if(_0x2a8ef0[_0x025b('0x2d')]>0x0){return _0x331297[_0x025b('0x1d')](0x190)[_0x025b('0x32')](_0x2a8ef0);}var _0x5f1be7=_0x2eb97e[_0x025b('0x31')][_0x025b('0x33')];var _0x365ba3=_0x2eb97e[_0x025b('0x31')]['sessionId'];var _0x5e4400=_0x2eb97e[_0x025b('0x31')][_0x025b('0x4a')];return getAgent(_0x5f1be7)[_0x025b('0x21')](function(_0x5b6ce6){logger[_0x025b('0x15')](_0x025b('0x38'),_0x5b6ce6[_0x025b('0x1c')]);emit(util['format'](_0x025b('0x3a'),_0x5b6ce6['name']),'webbar:transfer',{'sessionId':_0x365ba3,'transferNumber':_0x5e4400});return _0x331297[_0x025b('0x1d')](0xc8)[_0x025b('0x32')]({'error':![],'message':_0x025b('0x4b')});})[_0x025b('0x25')](handleError(_0x331297));}; \ No newline at end of file +var _0xb43b=['localhost','socket.io-emitter','redis','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','emit','handleError:','stack','name','send','status','request','error','code','result','catch','User','findOne','agent','VoiceChannels','all','then','filter','rows','sessionId','originate','info','originate\x20fired:','body','length','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','defaults'];(function(_0x187785,_0xbd2c11){var _0x390aeb=function(_0x438ceb){while(--_0x438ceb){_0x187785['push'](_0x187785['shift']());}};_0x390aeb(++_0xbd2c11);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4f7ba6,_0x19a2c9){_0x4f7ba6=_0x4f7ba6-0x0;var _0xfb1f81=_0xb43b[_0x4f7ba6];return _0xfb1f81;};'use strict';var path=require(_0xbb43('0x0'));var fs=require('fs');var _=require(_0xbb43('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xbb43('0x2'));var util=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xbb43('0x5')][_0xbb43('0x6')]({'port':0x232a});var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var Redis=require('ioredis');config['redis']=_[_0xbb43('0x9')](config['redis'],{'host':_0xbb43('0xa'),'port':0x18eb});var io=require(_0xbb43('0xb'))(new Redis(config[_0xbb43('0xc')]));var Schema=require(_0xbb43('0xd'));var originateValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xbb43('0xf'),'required':[!![],_0xbb43('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xbb43('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':_0xbb43('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbb43('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]}});function emit(_0x57bd1d,_0x526330,_0x202980){logger['info'](_0x57bd1d,_0x526330,JSON['stringify'](_0x202980));io['to'](_0x57bd1d)[_0xbb43('0x12')](_0x526330,_0x202980);}function handleError(_0x8242ab){return function(_0x2e3b43){console['log'](_0xbb43('0x13'),_0x2e3b43,_0x2e3b43 instanceof RangeError);logger['error'](_0x2e3b43[_0xbb43('0x14')]);if(_0x2e3b43 instanceof RangeError){if(_0x2e3b43[_0xbb43('0x15')]){delete _0x2e3b43['name'];}_0x8242ab['status'](0x194)[_0xbb43('0x16')](_0x2e3b43);}else{if(_0x2e3b43[_0xbb43('0x15')]){delete _0x2e3b43[_0xbb43('0x15')];}_0x8242ab[_0xbb43('0x17')](0x1f4)['send'](_0x2e3b43);}};}function checkError(){return function(_0x40a650){if(!_0x40a650){throw new RangeError('NotFound');}return _0x40a650;};}function respondWithRpcPromise(_0x3a257d,_0x4bfaca){return new BPromise(function(_0x2f5e31,_0x565256){var _0x3f323e=amiClient;return _0x3f323e[_0xbb43('0x18')](_0x3a257d,_0x4bfaca)['then'](function(_0x1d0768){if(_0x1d0768['error']){if(_0x1d0768[_0xbb43('0x19')][_0xbb43('0x1a')]===0x1f4){return _0x565256(_0x1d0768[_0xbb43('0x19')]['message']);}return _0x2f5e31(_0x1d0768['error']['message']);}else{_0x2f5e31(_0x1d0768[_0xbb43('0x1b')]);}})[_0xbb43('0x1c')](function(_0x5d8310){_0x565256(_0x5d8310);});});}function getAgent(_0x3b3083){return db[_0xbb43('0x1d')][_0xbb43('0x1e')]({'where':{'id':_0x3b3083,'role':_0xbb43('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x4b5342,_0x27fd7a){return new BPromise(function(_0x42800f,_0xa88db0){var _0x8b3205=respondWithRpcPromise(_0xbb43('0x20'));var _0x40b04b=getAgent(_0x4b5342);Promise[_0xbb43('0x21')]([_0x8b3205,_0x40b04b])[_0xbb43('0x22')](function(_0x539730){var _0x2ad6da=_0x539730[0x0];var _0x56fe33=_0x539730[0x1];var _0x31fbc8=_[_0xbb43('0x23')](_0x2ad6da[_0xbb43('0x24')],function(_0x1880cd){return _0x1880cd['UserId']==_0x56fe33['id']&&_0x1880cd[_0xbb43('0x25')]==_0x27fd7a;});if(_0x31fbc8['length']==0x1){_0x42800f(_0x56fe33);}else{_0xa88db0(new RangeError('sessionId\x20'+_0x27fd7a+'\x20not\x20found!'));}});});}exports[_0xbb43('0x26')]=function(_0x573a05,_0xa7e144){logger[_0xbb43('0x27')](_0xbb43('0x28'),_0x573a05['body']);var _0x205011=originateValidation[_0xbb43('0xd')](_0x573a05[_0xbb43('0x29')]);if(_0x205011[_0xbb43('0x2a')]>0x0){return _0xa7e144[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x205011);}var _0x3de482=_0x573a05[_0xbb43('0x29')]['userId'];var _0x2109aa=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2c')];var _0x244d66=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2d')];var _0x1eae09=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2e')];return getAgent(_0x3de482)[_0xbb43('0x22')](function(_0x21346a){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x21346a[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x21346a['name']),_0xbb43('0x32'),{'callNumber':_0x2109aa,'callerId':_0x244d66,'callbackUrl':_0x1eae09});return _0xa7e144[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x33')});})[_0xbb43('0x1c')](handleError(_0xa7e144));};exports[_0xbb43('0x34')]=function(_0x5374a2,_0x5f4601){logger['info'](_0xbb43('0x35'),_0x5374a2[_0xbb43('0x29')]);var _0x4a95c3=hangupValidation['validate'](_0x5374a2[_0xbb43('0x29')]);if(_0x4a95c3[_0xbb43('0x2a')]>0x0){return _0x5f4601[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x4a95c3);}var _0x3f9e7f=_0x5374a2['body'][_0xbb43('0x36')];var _0x526cb8=_0x5374a2[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x3f9e7f)[_0xbb43('0x22')](function(_0x531d96){logger[_0xbb43('0x27')]('entityFound:',_0x531d96[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x531d96[_0xbb43('0x15')]),'webbar:hangup',{'sessionId':_0x526cb8});return _0x5f4601[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x37')});})[_0xbb43('0x1c')](handleError(_0x5f4601));};exports['answer']=function(_0x3e0871,_0x136bd4){logger['info'](_0xbb43('0x38'),_0x3e0871['body']);var _0x42b965=answerValidation[_0xbb43('0xd')](_0x3e0871[_0xbb43('0x29')]);if(_0x42b965[_0xbb43('0x2a')]>0x0){return _0x136bd4[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x42b965);}var _0x4bf8ed=_0x3e0871[_0xbb43('0x29')]['userId'];var _0x307f1e=_0x3e0871[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x4bf8ed)[_0xbb43('0x22')](function(_0x4970fb){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x4970fb[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x4970fb[_0xbb43('0x15')]),_0xbb43('0x39'),{'sessionId':_0x307f1e});return _0x136bd4[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x3a')});})[_0xbb43('0x1c')](handleError(_0x136bd4));};exports['hold']=function(_0x1a66f0,_0x5d4c19){logger['info']('hold\x20fired:',_0x1a66f0['body']);var _0x1c3482=holdValidation['validate'](_0x1a66f0[_0xbb43('0x29')]);if(_0x1c3482['length']>0x0){return _0x5d4c19[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x1c3482);}var _0x1f3fb4=_0x1a66f0['body'][_0xbb43('0x36')];var _0x4d9f18=_0x1a66f0[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x1f3fb4)[_0xbb43('0x22')](function(_0x29840e){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x29840e[_0xbb43('0x15')]);emit(util['format'](_0xbb43('0x31'),_0x29840e[_0xbb43('0x15')]),_0xbb43('0x3b'),{'sessionId':_0x4d9f18});return _0x5d4c19[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x3c')});})[_0xbb43('0x1c')](handleError(_0x5d4c19));};exports[_0xbb43('0x3d')]=function(_0xb1883e,_0x4b7712){logger[_0xbb43('0x27')](_0xbb43('0x3e'),_0xb1883e[_0xbb43('0x29')]);var _0x4e1959=unholdValidation[_0xbb43('0xd')](_0xb1883e[_0xbb43('0x29')]);if(_0x4e1959[_0xbb43('0x2a')]>0x0){return _0x4b7712[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x4e1959);}var _0x59c805=_0xb1883e['body'][_0xbb43('0x36')];var _0x5c75ba=_0xb1883e[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x59c805)['then'](function(_0x29aea0){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x29aea0[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x29aea0[_0xbb43('0x15')]),'webbar:unhold',{'sessionId':_0x5c75ba});return _0x4b7712['status'](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x3f')});})[_0xbb43('0x1c')](handleError(_0x4b7712));};exports[_0xbb43('0x40')]=function(_0x129ee6,_0x5db053){logger['info'](_0xbb43('0x41'),_0x5db053[_0xbb43('0x29')]);var _0x3a84ad=callsValidation[_0xbb43('0xd')](_0x129ee6[_0xbb43('0x29')]);if(_0x3a84ad[_0xbb43('0x2a')]>0x0){return _0x5db053[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x3a84ad);}var _0x1a3f98=_0x129ee6['body'][_0xbb43('0x36')];var _0xb996d7=respondWithRpcPromise(_0xbb43('0x20'));var _0x3675d9=getAgent(_0x1a3f98);return Promise[_0xbb43('0x21')]([_0xb996d7,_0x3675d9])[_0xbb43('0x22')](function(_0x3f7262){var _0x3589fd=_0x3f7262[0x0];var _0x3e01e4=_0x3f7262[0x1];var _0x49a54e=_['filter'](_0x3589fd[_0xbb43('0x24')],function(_0x2b72ae){return _0x2b72ae[_0xbb43('0x42')]==_0x3e01e4['id'];});return _0x5db053[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'count':_0x49a54e[_0xbb43('0x2a')],'rows':_0x49a54e});})[_0xbb43('0x1c')](handleError(_0x5db053));};exports['conference']=function(_0x3bda63,_0x599eec){logger['info'](_0xbb43('0x43'),_0x3bda63[_0xbb43('0x29')]);var _0x3cccea=conferenceValidation[_0xbb43('0xd')](_0x3bda63[_0xbb43('0x29')]);if(_0x3cccea[_0xbb43('0x2a')]>0x0){return _0x599eec[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x3cccea);}var _0x51b076=_0x3bda63['body'][_0xbb43('0x36')];return getAgent(_0x51b076)[_0xbb43('0x22')](function(_0x137e75){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x137e75[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x137e75[_0xbb43('0x15')]),'webbar:conference');return _0x599eec[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x44')});})[_0xbb43('0x1c')](handleError(_0x599eec));};exports[_0xbb43('0x45')]=function(_0x33a4db,_0x5745eb){logger[_0xbb43('0x27')](_0xbb43('0x46'),_0x33a4db[_0xbb43('0x29')]);var _0x6d3bb1=transferValidation[_0xbb43('0xd')](_0x33a4db['body']);if(_0x6d3bb1[_0xbb43('0x2a')]>0x0){return _0x5745eb[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x6d3bb1);}var _0x231b11=_0x33a4db[_0xbb43('0x29')][_0xbb43('0x36')];var _0x2bd30e=_0x33a4db[_0xbb43('0x29')][_0xbb43('0x25')];var _0x3ab906=_0x33a4db['body'][_0xbb43('0x47')];return getAgent(_0x231b11)['then'](function(_0x2b9e5d){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x2b9e5d[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x2b9e5d['name']),_0xbb43('0x48'),{'sessionId':_0x2bd30e,'transferNumber':_0x3ab906});return _0x5745eb[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x49')});})[_0xbb43('0x1c')](handleError(_0x5745eb));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 8bed916..e39e8d2 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f4f=['/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','index','get','isAuthenticated','describe','/:id','show'];(function(_0x1fa544,_0x5b24e2){var _0x1fdbaf=function(_0x414287){while(--_0x414287){_0x1fa544['push'](_0x1fa544['shift']());}};_0x1fdbaf(++_0x5b24e2);}(_0x9f4f,0x1af));var _0xf9f4=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x9f4f[_0x31eb67];return _0x2a8cb8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf9f4('0x0'));var express=require(_0xf9f4('0x1'));var router=express[_0xf9f4('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf9f4('0x3'));var controller=require(_0xf9f4('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xf9f4('0x5')]);router[_0xf9f4('0x6')]('/describe',auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x8')]);router['get'](_0xf9f4('0x9'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0xa')]);router[_0xf9f4('0x6')](_0xf9f4('0xb'),auth[_0xf9f4('0x7')](),controller['getDispositions']);router[_0xf9f4('0x6')](_0xf9f4('0xc'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0xd')]);router['get'](_0xf9f4('0xe'),auth['isAuthenticated'](),controller[_0xf9f4('0xf')]);router[_0xf9f4('0x6')](_0xf9f4('0x10'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x11')]);router['post']('/',auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x12')]);router['post'](_0xf9f4('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xf9f4('0x13')]('/:id/canned_answers',auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x14')]);router[_0xf9f4('0x13')](_0xf9f4('0xe'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x15')]);router[_0xf9f4('0x13')](_0xf9f4('0x10'),auth['isAuthenticated'](),controller[_0xf9f4('0x16')]);router['post'](_0xf9f4('0x17'),controller[_0xf9f4('0x18')]);router[_0xf9f4('0x13')](_0xf9f4('0x19'),auth['isAuthenticated'](),controller[_0xf9f4('0x1a')]);router[_0xf9f4('0x1b')](_0xf9f4('0x9'),auth['isAuthenticated'](),controller[_0xf9f4('0x1c')]);router[_0xf9f4('0x1d')](_0xf9f4('0x9'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x1e')]);router[_0xf9f4('0x1d')](_0xf9f4('0xb'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x1f')]);router[_0xf9f4('0x1d')](_0xf9f4('0xc'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x20')]);router[_0xf9f4('0x1d')](_0xf9f4('0xe'),auth[_0xf9f4('0x7')](),controller[_0xf9f4('0x21')]);module['exports']=router; \ No newline at end of file +var _0xe155=['connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','/:id/send','put','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe155,0x1ad));var _0x5e15=function(_0xf04024,_0x2e034d){_0xf04024=_0xf04024-0x0;var _0x4b4cd2=_0xe155[_0xf04024];return _0x4b4cd2;};'use strict';var multer=require(_0x5e15('0x0'));var util=require(_0x5e15('0x1'));var path=require(_0x5e15('0x2'));var timeout=require(_0x5e15('0x3'));var express=require(_0x5e15('0x4'));var router=express['Router']();var auth=require(_0x5e15('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5e15('0x6'));var controller=require(_0x5e15('0x7'));router[_0x5e15('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e15('0x8')](_0x5e15('0x9'),auth[_0x5e15('0xa')](),controller[_0x5e15('0xb')]);router['get'](_0x5e15('0xc'),auth[_0x5e15('0xa')](),controller[_0x5e15('0xd')]);router[_0x5e15('0x8')](_0x5e15('0xe'),auth[_0x5e15('0xa')](),controller[_0x5e15('0xf')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x5e15('0x10')]);router[_0x5e15('0x8')]('/:id/users',auth[_0x5e15('0xa')](),controller[_0x5e15('0x11')]);router[_0x5e15('0x8')](_0x5e15('0x12'),auth['isAuthenticated'](),controller[_0x5e15('0x13')]);router[_0x5e15('0x14')]('/',auth['isAuthenticated'](),controller[_0x5e15('0x15')]);router['post'](_0x5e15('0xe'),auth[_0x5e15('0xa')](),controller[_0x5e15('0x16')]);router[_0x5e15('0x14')]('/:id/canned_answers',auth[_0x5e15('0xa')](),controller[_0x5e15('0x17')]);router[_0x5e15('0x14')](_0x5e15('0x18'),auth[_0x5e15('0xa')](),controller[_0x5e15('0x19')]);router[_0x5e15('0x14')](_0x5e15('0x12'),auth['isAuthenticated'](),controller[_0x5e15('0x1a')]);router[_0x5e15('0x14')](_0x5e15('0x1b'),controller['notify']);router[_0x5e15('0x14')](_0x5e15('0x1c'),auth[_0x5e15('0xa')](),controller['send']);router[_0x5e15('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x5e15('0x1e')]);router[_0x5e15('0x1f')](_0x5e15('0xc'),auth[_0x5e15('0xa')](),controller['destroy']);router[_0x5e15('0x1f')](_0x5e15('0xe'),auth[_0x5e15('0xa')](),controller[_0x5e15('0x20')]);router[_0x5e15('0x1f')](_0x5e15('0x21'),auth[_0x5e15('0xa')](),controller[_0x5e15('0x22')]);router[_0x5e15('0x1f')](_0x5e15('0x18'),auth[_0x5e15('0xa')](),controller['removeAgents']);module[_0x5e15('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1d1a17f..a69c762 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfd9=['STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfd9,0x6f));var _0x9bfd=function(_0x5410d0,_0x1a5e94){_0x5410d0=_0x5410d0-0x0;var _0x474456=_0xbfd9[_0x5410d0];return _0x474456;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9bfd('0x0'));module['exports']={'name':{'type':Sequelize[_0x9bfd('0x1')],'unique':_0x9bfd('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9bfd('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x9bfd('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x9bfd('0x1')],'defaultValue':function(){return rs[_0x9bfd('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x9bfd('0x4'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x9bfd('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9bfd('0x5')],'defaultValue':function(){return _0x9bfd('0x6');}},'notificationSound':{'type':Sequelize[_0x9bfd('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9bfd('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9bfd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9bfd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9bfd('0x8')],'comment':_0x9bfd('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9bfd('0x7')],'defaultValue':![],'comment':_0x9bfd('0xa'),'set':function(_0x5192f8){if(!_0x5192f8){this[_0x9bfd('0xb')](_0x9bfd('0xc'),null);}this[_0x9bfd('0xb')](_0x9bfd('0xd'),_0x5192f8);}},'description':{'type':Sequelize[_0x9bfd('0x1')]}}; \ No newline at end of file +var _0x9701=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','ENUM','twilio','TEXT'];(function(_0xf1c0fb,_0x5eadfc){var _0x25a71f=function(_0x17acb4){while(--_0x17acb4){_0xf1c0fb['push'](_0xf1c0fb['shift']());}};_0x25a71f(++_0x5eadfc);}(_0x9701,0xfc));var _0x1970=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9701[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1970('0x0'));var rs=require('randomstring');module[_0x1970('0x1')]={'name':{'type':Sequelize[_0x1970('0x2')],'unique':_0x1970('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x1970('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x1970('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x1970('0x2')],'defaultValue':function(){return rs[_0x1970('0x4')]();}},'phone':{'type':Sequelize[_0x1970('0x2')]},'type':{'type':Sequelize[_0x1970('0x5')](_0x1970('0x6'))},'accountSid':{'type':Sequelize[_0x1970('0x2')]},'authToken':{'type':Sequelize[_0x1970('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1970('0x7')],'defaultValue':function(){return _0x1970('0x8');}},'notificationSound':{'type':Sequelize[_0x1970('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1970('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1970('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1970('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1970('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1970('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1970('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1970('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1970('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1e6e4f){if(!_0x1e6e4f){this[_0x1970('0xb')](_0x1970('0xc'),null);}this[_0x1970('0xb')]('mandatoryDisposition',_0x1e6e4f);}},'description':{'type':Sequelize[_0x1970('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 9d40f93..757f426 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x373d=['Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','options','includeAll','WhatsappAccount','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','order','map','include','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','Applications','applications','asc','account','CmContact','createdAt','difference','CompanyId','ListId','mobile','from','From','replace','MessageSid','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','updatedAt','DESC','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','close','unmanaged','created','WhatsappMessage','messageId','ContactId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','send','\x0a','to\x20is\x20mandatory','List','out','dataValues','Messages','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./whatsappAccount.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~!@#$%^&-_=+[{]}.','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\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','get','WhatsappAccounts','UserProfileResource','stack','index'];(function(_0x48efbf,_0xd1ec2d){var _0x36a0da=function(_0x16f94e){while(--_0x16f94e){_0x48efbf['push'](_0x48efbf['shift']());}};_0x36a0da(++_0xd1ec2d);}(_0x373d,0x1e2));var _0xd373=function(_0x4d1f59,_0x4483ec){_0x4d1f59=_0x4d1f59-0x0;var _0x468441=_0x373d[_0x4d1f59];return _0x468441;};'use strict';var pdf=require(_0xd373('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd373('0x1'));var zipdir=require(_0xd373('0x2'));var jsonpatch=require(_0xd373('0x3'));var rp=require(_0xd373('0x4'));var moment=require('moment');var BPromise=require(_0xd373('0x5'));var Mustache=require(_0xd373('0x6'));var util=require(_0xd373('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd373('0x8'));var ejs=require(_0xd373('0x9'));var fs=require('fs');var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var db=require(_0xd373('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd373('0x15'),'port':0x18eb});var socket=require(_0xd373('0x16'))(new Redis(config['redis']));require(_0xd373('0x17'))[_0xd373('0x18')](socket);var jayson=require(_0xd373('0x19'));var client=jayson[_0xd373('0x1a')][_0xd373('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x1a9df9,_0x20aca5,_0x2eacb1){if(_0x2eacb1){var _0x5a286a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a286a[_0xd373('0x1c')](_0x20aca5)){return _0x1a9df9;}else{throw new db[(_0xd373('0x1d'))][(_0xd373('0x1e'))](_0xd373('0x1f'));}}else{return _0x1a9df9;}}function respondWithRpcPromise(_0x4e5768,_0x1e26cf,_0x5eab00,_0x460259){return new BPromise(function(_0x36d47a,_0x55c5c7){var _0x1bbdbd=_0x460259||client;return _0x1bbdbd['request'](_0x4e5768,_0x5eab00)['then'](function(_0x23fada){logger[_0xd373('0x20')](_0xd373('0x21'),_0x1e26cf,_0xd373('0x22'));logger[_0xd373('0x23')](_0xd373('0x24'),_0x1e26cf,'request\x20sent',JSON[_0xd373('0x25')](_0x23fada));if(_0x23fada[_0xd373('0x26')]){if(_0x23fada[_0xd373('0x26')][_0xd373('0x27')]===0x1f4){logger[_0xd373('0x26')](_0xd373('0x21'),_0x1e26cf,_0x23fada['error'][_0xd373('0x28')]);return _0x55c5c7(_0x23fada[_0xd373('0x26')][_0xd373('0x28')]);}logger[_0xd373('0x26')](_0xd373('0x21'),_0x1e26cf,_0x23fada[_0xd373('0x26')][_0xd373('0x28')]);return _0x36d47a(_0x23fada[_0xd373('0x26')][_0xd373('0x28')]);}else{logger[_0xd373('0x20')](_0xd373('0x21'),_0x1e26cf,_0xd373('0x22'));_0x36d47a(_0x23fada[_0xd373('0x29')][_0xd373('0x28')]);}})[_0xd373('0x2a')](function(_0x38ba50){logger[_0xd373('0x26')](_0xd373('0x21'),_0x1e26cf,_0x38ba50);_0x55c5c7(_0x38ba50);});});}function respondWithStatusCode(_0x3e657b,_0x470612){_0x470612=_0x470612||0xcc;return function(_0x45ee58){if(_0x45ee58){return _0x3e657b[_0xd373('0x2b')](_0x470612);}return _0x3e657b[_0xd373('0x2c')](_0x470612)[_0xd373('0x2d')]();};}function respondWithResult(_0xf85ca8,_0x2869e5){_0x2869e5=_0x2869e5||0xc8;return function(_0x158825){if(_0x158825){return _0xf85ca8[_0xd373('0x2c')](_0x2869e5)[_0xd373('0x2e')](_0x158825);}};}function respondWithFilteredResult(_0x7dad3e,_0x5287e7){return function(_0x7ca56e){if(_0x7ca56e){var _0x490842=_0x7ca56e[_0xd373('0x2f')],_0x498aaa=_0x5287e7[_0xd373('0x30')],_0xedc8f3=_0x5287e7[_0xd373('0x30')]+_0x5287e7['limit'],_0x15da6c;if(_0xedc8f3>=_0x490842){_0xedc8f3=_0x490842;_0x15da6c=0xc8;}else{_0x15da6c=0xce;}_0x7dad3e[_0xd373('0x2c')](_0x15da6c);return _0x7dad3e[_0xd373('0x31')]('Content-Range',_0x498aaa+'-'+_0xedc8f3+'/'+_0x490842)[_0xd373('0x2e')](_0x7ca56e);}return null;};}function patchUpdates(_0x8e4884){return function(_0x146e24){try{jsonpatch[_0xd373('0x32')](_0x146e24,_0x8e4884,!![]);}catch(_0x26538a){return BPromise[_0xd373('0x33')](_0x26538a);}return _0x146e24[_0xd373('0x34')]();};}function saveUpdates(_0x470d6e,_0x42faaa){return function(_0x52ff26){if(_0x52ff26){return _0x52ff26[_0xd373('0x35')](_0x470d6e)[_0xd373('0x36')](function(_0x420c73){return _0x420c73;});}return null;};}function removeEntity(_0x2cb761,_0x2da192){return function(_0x28da03){if(_0x28da03){return _0x28da03[_0xd373('0x37')]()[_0xd373('0x36')](function(){var _0xaa62aa=_0x28da03[_0xd373('0x38')]({'plain':!![]});var _0x38e0ea=_0xd373('0x39');return db[_0xd373('0x3a')][_0xd373('0x37')]({'where':{'type':_0x38e0ea,'resourceId':_0xaa62aa['id']}})[_0xd373('0x36')](function(){return _0x28da03;});})['then'](function(){_0x2cb761[_0xd373('0x2c')](0xcc)[_0xd373('0x2d')]();});}};}function handleEntityNotFound(_0x186e39,_0x3b4382){return function(_0x4b1080){if(!_0x4b1080){_0x186e39[_0xd373('0x2b')](0x194);}return _0x4b1080;};}function handleError(_0x470d91,_0x109fb2){_0x109fb2=_0x109fb2||0x1f4;return function(_0x3af9f7){logger[_0xd373('0x26')](_0x3af9f7[_0xd373('0x3b')]);if(_0x3af9f7['name']){delete _0x3af9f7['name'];}_0x470d91[_0xd373('0x2c')](_0x109fb2)['send'](_0x3af9f7);};}exports[_0xd373('0x3c')]=function(_0xe19d5b,_0x1d9b7a){var _0x51ba69={'include':[{'model':db[_0xd373('0x3d')],'as':_0xd373('0x3e')}]},_0x287136={},_0x14db16={'count':0x0,'rows':[]};var _0x504450=_['map'](db['WhatsappAccount'][_0xd373('0x3f')],function(_0x5b6385){return{'name':_0x5b6385[_0xd373('0x40')],'type':_0x5b6385[_0xd373('0x41')]['key']};});_0x287136['model']=_['map'](_0x504450,_0xd373('0x42'));_0x287136[_0xd373('0x43')]=_[_0xd373('0x44')](_0xe19d5b['query']);_0x287136['filters']=_[_0xd373('0x45')](_0x287136[_0xd373('0x46')],_0x287136['query']);_0x51ba69[_0xd373('0x47')]=_[_0xd373('0x45')](_0x287136[_0xd373('0x46')],qs[_0xd373('0x48')](_0xe19d5b[_0xd373('0x43')]['fields']));_0x51ba69['attributes']=_0x51ba69[_0xd373('0x47')][_0xd373('0x49')]?_0x51ba69[_0xd373('0x47')]:_0x287136[_0xd373('0x46')];if(!_0xe19d5b['query'][_0xd373('0x4a')]('nolimit')){_0x51ba69[_0xd373('0x4b')]=qs[_0xd373('0x4b')](_0xe19d5b[_0xd373('0x43')][_0xd373('0x4b')]);_0x51ba69[_0xd373('0x30')]=qs['offset'](_0xe19d5b[_0xd373('0x43')][_0xd373('0x30')]);}_0x51ba69['order']=qs[_0xd373('0x4c')](_0xe19d5b[_0xd373('0x43')][_0xd373('0x4c')]);_0x51ba69[_0xd373('0x4d')]=qs[_0xd373('0x4e')](_[_0xd373('0x4f')](_0xe19d5b[_0xd373('0x43')],_0x287136[_0xd373('0x4e')]),_0x504450);if(_0xe19d5b[_0xd373('0x43')][_0xd373('0x50')]){_0x51ba69['where']=_['merge'](_0x51ba69[_0xd373('0x4d')],{'$or':_['map'](_0x504450,function(_0x313963){if(_0x313963['type']!=='VIRTUAL'){var _0x5cbc16={};_0x5cbc16[_0x313963[_0xd373('0x42')]]={'$like':'%'+_0xe19d5b[_0xd373('0x43')][_0xd373('0x50')]+'%'};return _0x5cbc16;}})});}_0x51ba69=_[_0xd373('0x51')]({},_0x51ba69,_0xe19d5b[_0xd373('0x52')]);var _0x2fd07a={'where':_0x51ba69[_0xd373('0x4d')]};return db['WhatsappAccount'][_0xd373('0x2f')](_0x2fd07a)['then'](function(_0x4076e0){_0x14db16[_0xd373('0x2f')]=_0x4076e0;if(_0xe19d5b['query'][_0xd373('0x53')]){_0x51ba69['include']=[{'all':!![]}];}return db[_0xd373('0x54')][_0xd373('0x55')](_0x51ba69);})[_0xd373('0x36')](function(_0x1e97aa){_0x14db16[_0xd373('0x56')]=_0x1e97aa;return _0x14db16;})['then'](respondWithFilteredResult(_0x1d9b7a,_0x51ba69))['catch'](handleError(_0x1d9b7a,null));};exports['show']=function(_0x3a2192,_0x384e23){var _0x5b0801={'raw':![],'where':{'id':_0x3a2192[_0xd373('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd373('0x3e')}]},_0x359bca={};_0x359bca[_0xd373('0x46')]=_[_0xd373('0x44')](db[_0xd373('0x54')][_0xd373('0x3f')]);_0x359bca[_0xd373('0x43')]=_[_0xd373('0x44')](_0x3a2192[_0xd373('0x43')]);_0x359bca[_0xd373('0x4e')]=_[_0xd373('0x45')](_0x359bca[_0xd373('0x46')],_0x359bca['query']);_0x5b0801['attributes']=_['intersection'](_0x359bca['model'],qs['fields'](_0x3a2192['query'][_0xd373('0x48')]));_0x5b0801[_0xd373('0x47')]=_0x5b0801['attributes']['length']?_0x5b0801['attributes']:_0x359bca[_0xd373('0x46')];if(_0x3a2192[_0xd373('0x43')]['includeAll']){_0x5b0801['include']=[{'all':!![]}];}_0x5b0801=_[_0xd373('0x51')]({},_0x5b0801,_0x3a2192[_0xd373('0x52')]);return db[_0xd373('0x54')][_0xd373('0x58')](_0x5b0801)[_0xd373('0x36')](handleEntityNotFound(_0x384e23,null))['then'](respondWithResult(_0x384e23,null))[_0xd373('0x2a')](handleError(_0x384e23,null));};exports[_0xd373('0x59')]=function(_0x386e4c,_0x213da6){return db[_0xd373('0x54')][_0xd373('0x59')](_0x386e4c[_0xd373('0x5a')],{})[_0xd373('0x36')](function(_0x10fffb){var _0x558aaf=_0x386e4c[_0xd373('0x5b')][_0xd373('0x38')]({'plain':!![]});if(!_0x558aaf)throw new Error(_0xd373('0x5c'));if(_0x558aaf[_0xd373('0x5d')]===_0xd373('0x5b')){var _0x4cb143=_0x10fffb[_0xd373('0x38')]({'plain':!![]});var _0x1f775c=_0xd373('0x39');return db['UserProfileSection'][_0xd373('0x58')]({'where':{'name':_0x1f775c,'userProfileId':_0x558aaf['userProfileId']},'raw':!![]})[_0xd373('0x36')](function(_0x4bf666){if(_0x4bf666&&_0x4bf666[_0xd373('0x5e')]===0x0){return db[_0xd373('0x3a')][_0xd373('0x59')]({'name':_0x4cb143[_0xd373('0x42')],'resourceId':_0x4cb143['id'],'type':_0x4bf666[_0xd373('0x42')],'sectionId':_0x4bf666['id']},{})[_0xd373('0x36')](function(){return _0x10fffb;});}else{return _0x10fffb;}})[_0xd373('0x2a')](function(_0xaaf7fa){logger[_0xd373('0x26')](_0xd373('0x5f'),_0xaaf7fa);throw _0xaaf7fa;});}return _0x10fffb;})[_0xd373('0x36')](respondWithResult(_0x213da6,0xc9))[_0xd373('0x2a')](handleError(_0x213da6,null));};exports[_0xd373('0x35')]=function(_0x1f496e,_0x2e3266){if(_0x1f496e[_0xd373('0x5a')]['id']){delete _0x1f496e[_0xd373('0x5a')]['id'];}return db[_0xd373('0x54')][_0xd373('0x58')]({'where':{'id':_0x1f496e[_0xd373('0x57')]['id']},'include':[{'model':db[_0xd373('0x3d')],'as':_0xd373('0x3e')}]})[_0xd373('0x36')](handleEntityNotFound(_0x2e3266,null))[_0xd373('0x36')](saveUpdates(_0x1f496e[_0xd373('0x5a')],null))[_0xd373('0x36')](respondWithResult(_0x2e3266,null))['catch'](handleError(_0x2e3266,null));};exports[_0xd373('0x37')]=function(_0x1f92bb,_0x5fdc16){return db['WhatsappAccount'][_0xd373('0x58')]({'where':{'id':_0x1f92bb[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x5fdc16,null))[_0xd373('0x36')](removeEntity(_0x5fdc16,null))[_0xd373('0x2a')](handleError(_0x5fdc16,null));};exports[_0xd373('0x60')]=function(_0x284730,_0x51f71f){return db[_0xd373('0x54')][_0xd373('0x60')]()[_0xd373('0x36')](respondWithResult(_0x51f71f,null))[_0xd373('0x2a')](handleError(_0x51f71f,null));};exports[_0xd373('0x61')]=function(_0x208233,_0x3fd90e,_0x2cf09){if(_0x208233['body']['id']){delete _0x208233[_0xd373('0x5a')]['id'];}return db['WhatsappAccount'][_0xd373('0x58')]({'where':{'id':_0x208233[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x3fd90e,null))[_0xd373('0x36')](function(_0x36e7cc){if(_0x36e7cc){_0x208233[_0xd373('0x5a')][_0xd373('0x62')]=_0x36e7cc['id'];return db[_0xd373('0x63')]['create'](_0x208233[_0xd373('0x5a')]);}})['then'](respondWithResult(_0x3fd90e,null))[_0xd373('0x2a')](handleError(_0x3fd90e,null));};exports[_0xd373('0x64')]=function(_0x310a65,_0x3ce679,_0x30fcd6){var _0x267e66={'raw':![],'where':{}};var _0x1f9a5a={};var _0x4cd326={'count':0x0,'rows':[]};return db[_0xd373('0x54')][_0xd373('0x65')]({'where':{'id':_0x310a65[_0xd373('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ce679,null))[_0xd373('0x36')](function(_0x1d5b48){if(_0x1d5b48){_0x1f9a5a[_0xd373('0x46')]=_[_0xd373('0x44')](db[_0xd373('0x63')][_0xd373('0x3f')]);_0x1f9a5a[_0xd373('0x43')]=_[_0xd373('0x44')](_0x310a65[_0xd373('0x43')]);_0x1f9a5a[_0xd373('0x4e')]=_[_0xd373('0x45')](_0x1f9a5a[_0xd373('0x46')],_0x1f9a5a['query']);_0x267e66[_0xd373('0x47')]=_[_0xd373('0x45')](_0x1f9a5a[_0xd373('0x46')],qs['fields'](_0x310a65[_0xd373('0x43')][_0xd373('0x48')]));_0x267e66[_0xd373('0x47')]=_0x267e66['attributes'][_0xd373('0x49')]?_0x267e66['attributes']:_0x1f9a5a[_0xd373('0x46')];if(!_0x310a65[_0xd373('0x43')][_0xd373('0x4a')](_0xd373('0x66'))){_0x267e66['limit']=qs[_0xd373('0x4b')](_0x310a65['query'][_0xd373('0x4b')]);_0x267e66[_0xd373('0x30')]=qs[_0xd373('0x30')](_0x310a65[_0xd373('0x43')][_0xd373('0x30')]);}_0x267e66[_0xd373('0x67')]=qs['sort'](_0x310a65[_0xd373('0x43')]['sort']);_0x267e66[_0xd373('0x4d')]=qs['filters'](_['pick'](_0x310a65[_0xd373('0x43')],_0x1f9a5a[_0xd373('0x4e')]));_0x267e66[_0xd373('0x4d')][_0xd373('0x62')]=_0x1d5b48['id'];if(_0x310a65['query']['filter']){_0x267e66[_0xd373('0x4d')]=_[_0xd373('0x51')](_0x267e66[_0xd373('0x4d')],{'$or':_[_0xd373('0x68')](_0x267e66[_0xd373('0x47')],function(_0x1a30eb){var _0x16e708={};_0x16e708[_0x1a30eb]={'$like':'%'+_0x310a65[_0xd373('0x43')][_0xd373('0x50')]+'%'};return _0x16e708;})});}_0x267e66=_[_0xd373('0x51')]({},_0x267e66,_0x310a65['options']);return db[_0xd373('0x63')][_0xd373('0x2f')]({'where':_0x267e66[_0xd373('0x4d')]})[_0xd373('0x36')](function(_0x9bdd39){_0x4cd326[_0xd373('0x2f')]=_0x9bdd39;if(_0x310a65[_0xd373('0x43')]['includeAll']){_0x267e66[_0xd373('0x69')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x267e66);})[_0xd373('0x36')](function(_0x43f4a7){_0x4cd326[_0xd373('0x56')]=_0x43f4a7;return _0x4cd326;});}})[_0xd373('0x36')](respondWithFilteredResult(_0x3ce679,_0x267e66))[_0xd373('0x2a')](handleError(_0x3ce679,null));};exports[_0xd373('0x6a')]=function(_0x578a5e,_0x30732e,_0x19eb94){return db[_0xd373('0x54')]['find']({'where':{'id':_0x578a5e[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x30732e,null))[_0xd373('0x36')](function(_0x47ae4c){if(_0x47ae4c){return _0x47ae4c[_0xd373('0x6a')](_0x578a5e[_0xd373('0x43')][_0xd373('0x6b')]);}})['then'](respondWithStatusCode(_0x30732e,null))[_0xd373('0x2a')](handleError(_0x30732e,null));};exports[_0xd373('0x6c')]=function(_0x2059c4,_0x33ca89,_0x715eca){if(_0x2059c4[_0xd373('0x5a')]['id']){delete _0x2059c4[_0xd373('0x5a')]['id'];}return db[_0xd373('0x54')][_0xd373('0x58')]({'where':{'id':_0x2059c4[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x33ca89,null))[_0xd373('0x36')](function(_0x406f52){if(_0x406f52){_0x2059c4['body'][_0xd373('0x62')]=_0x406f52['id'];return db[_0xd373('0x6d')][_0xd373('0x59')](_0x2059c4['body']);}})[_0xd373('0x36')](respondWithResult(_0x33ca89,null))[_0xd373('0x2a')](handleError(_0x33ca89,null));};exports['getAnswers']=function(_0x476501,_0x578096,_0xf93f6b){var _0x473cf1={'raw':![],'where':{}};var _0x2a00e8={};var _0x3bc47a={'count':0x0,'rows':[]};return db[_0xd373('0x54')][_0xd373('0x65')]({'where':{'id':_0x476501['params']['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x578096,null))['then'](function(_0x18e009){if(_0x18e009){_0x2a00e8[_0xd373('0x46')]=_[_0xd373('0x44')](db[_0xd373('0x6d')][_0xd373('0x3f')]);_0x2a00e8['query']=_[_0xd373('0x44')](_0x476501[_0xd373('0x43')]);_0x2a00e8[_0xd373('0x4e')]=_[_0xd373('0x45')](_0x2a00e8[_0xd373('0x46')],_0x2a00e8[_0xd373('0x43')]);_0x473cf1['attributes']=_[_0xd373('0x45')](_0x2a00e8[_0xd373('0x46')],qs[_0xd373('0x48')](_0x476501['query'][_0xd373('0x48')]));_0x473cf1[_0xd373('0x47')]=_0x473cf1['attributes'][_0xd373('0x49')]?_0x473cf1['attributes']:_0x2a00e8[_0xd373('0x46')];if(!_0x476501['query']['hasOwnProperty'](_0xd373('0x66'))){_0x473cf1[_0xd373('0x4b')]=qs[_0xd373('0x4b')](_0x476501[_0xd373('0x43')][_0xd373('0x4b')]);_0x473cf1['offset']=qs[_0xd373('0x30')](_0x476501['query'][_0xd373('0x30')]);}_0x473cf1[_0xd373('0x67')]=qs[_0xd373('0x4c')](_0x476501['query'][_0xd373('0x4c')]);_0x473cf1['where']=qs[_0xd373('0x4e')](_[_0xd373('0x4f')](_0x476501[_0xd373('0x43')],_0x2a00e8[_0xd373('0x4e')]));_0x473cf1[_0xd373('0x4d')]['WhatsappAccountId']=_0x18e009['id'];if(_0x476501[_0xd373('0x43')][_0xd373('0x50')]){_0x473cf1[_0xd373('0x4d')]=_[_0xd373('0x51')](_0x473cf1[_0xd373('0x4d')],{'$or':_[_0xd373('0x68')](_0x473cf1[_0xd373('0x47')],function(_0x4859be){var _0x35e083={};_0x35e083[_0x4859be]={'$like':'%'+_0x476501[_0xd373('0x43')][_0xd373('0x50')]+'%'};return _0x35e083;})});}_0x473cf1=_[_0xd373('0x51')]({},_0x473cf1,_0x476501[_0xd373('0x52')]);return db[_0xd373('0x6d')][_0xd373('0x2f')]({'where':_0x473cf1[_0xd373('0x4d')]})[_0xd373('0x36')](function(_0xbe4347){_0x3bc47a[_0xd373('0x2f')]=_0xbe4347;if(_0x476501[_0xd373('0x43')][_0xd373('0x53')]){_0x473cf1[_0xd373('0x69')]=[{'all':!![]}];}return db[_0xd373('0x6d')][_0xd373('0x55')](_0x473cf1);})[_0xd373('0x36')](function(_0x53644a){_0x3bc47a[_0xd373('0x56')]=_0x53644a;return _0x3bc47a;});}})[_0xd373('0x36')](respondWithFilteredResult(_0x578096,_0x473cf1))['catch'](handleError(_0x578096,null));};exports['removeAnswers']=function(_0x280166,_0x3e7e7c,_0x4bcc80){return db[_0xd373('0x54')][_0xd373('0x58')]({'where':{'id':_0x280166[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x3e7e7c,null))[_0xd373('0x36')](function(_0x4870ca){if(_0x4870ca){return _0x4870ca[_0xd373('0x6e')](_0x280166[_0xd373('0x43')][_0xd373('0x6b')]);}})[_0xd373('0x36')](respondWithStatusCode(_0x3e7e7c,null))[_0xd373('0x2a')](handleError(_0x3e7e7c,null));};exports['addAgents']=function(_0x4e8b06,_0x147e3f,_0x19aed9){return db['WhatsappAccount'][_0xd373('0x58')]({'where':{'id':_0x4e8b06[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x147e3f,null))[_0xd373('0x36')](function(_0x1a3969){if(_0x1a3969){return _0x1a3969[_0xd373('0x6f')](_0x4e8b06['body'][_0xd373('0x6b')],_[_0xd373('0x70')](_0x4e8b06[_0xd373('0x5a')],['ids','id'])||{})[_0xd373('0x71')](function(_0x10b35e){for(var _0x698bd=0x0;_0x698bd<_0x4e8b06['body'][_0xd373('0x6b')][_0xd373('0x49')];_0x698bd+=0x1){socket['emit'](_0xd373('0x72'),{'UserId':_0x4e8b06[_0xd373('0x5a')]['ids'][_0x698bd],'WhatsappAccountId':_0x4e8b06[_0xd373('0x57')]['id']});}return _0x10b35e;});}})['then'](respondWithResult(_0x147e3f,null))[_0xd373('0x2a')](handleError(_0x147e3f,null));};exports[_0xd373('0x73')]=function(_0x3b6ba5,_0x54fef0,_0x585e5b){return db['WhatsappAccount'][_0xd373('0x58')]({'where':{'id':_0x3b6ba5['params']['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x54fef0,null))[_0xd373('0x36')](function(_0x57c629){if(_0x57c629){return _0x57c629[_0xd373('0x73')](_0x3b6ba5['query'][_0xd373('0x6b')])[_0xd373('0x36')](function(){if(_[_0xd373('0x74')](_0x3b6ba5[_0xd373('0x43')][_0xd373('0x6b')])){for(var _0x415d80=0x0;_0x415d80<_0x3b6ba5['query'][_0xd373('0x6b')]['length'];_0x415d80+=0x1){socket[_0xd373('0x75')](_0xd373('0x76'),{'UserId':Number(_0x3b6ba5[_0xd373('0x43')][_0xd373('0x6b')][_0x415d80]),'WhatsappAccountId':Number(_0x3b6ba5[_0xd373('0x57')]['id'])});}}else{socket[_0xd373('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x3b6ba5[_0xd373('0x43')][_0xd373('0x6b')]),'WhatsappAccountId':Number(_0x3b6ba5[_0xd373('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x54fef0,null))[_0xd373('0x2a')](handleError(_0x54fef0,null));};exports[_0xd373('0x77')]=function(_0x3edaa5,_0x2f1dc0,_0x132a55){var _0x783928={};var _0x5ae777={};var _0x1d4551;var _0x59c27d;return db[_0xd373('0x54')][_0xd373('0x65')]({'where':{'id':_0x3edaa5[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x2f1dc0,null))['then'](function(_0x5ccc0e){if(_0x5ccc0e){_0x1d4551=_0x5ccc0e;_0x5ae777[_0xd373('0x46')]=_[_0xd373('0x44')](db[_0xd373('0x78')][_0xd373('0x3f')]);_0x5ae777[_0xd373('0x43')]=_[_0xd373('0x44')](_0x3edaa5['query']);_0x5ae777[_0xd373('0x4e')]=_[_0xd373('0x45')](_0x5ae777['model'],_0x5ae777[_0xd373('0x43')]);_0x783928[_0xd373('0x47')]=_[_0xd373('0x45')](_0x5ae777['model'],qs[_0xd373('0x48')](_0x3edaa5[_0xd373('0x43')]['fields']));_0x783928['attributes']=_0x783928[_0xd373('0x47')][_0xd373('0x49')]?_0x783928[_0xd373('0x47')]:_0x5ae777[_0xd373('0x46')];_0x783928[_0xd373('0x67')]=qs[_0xd373('0x4c')](_0x3edaa5[_0xd373('0x43')]['sort']);_0x783928[_0xd373('0x4d')]=qs[_0xd373('0x4e')](_[_0xd373('0x4f')](_0x3edaa5[_0xd373('0x43')],_0x5ae777[_0xd373('0x4e')]));if(_0x3edaa5['query'][_0xd373('0x50')]){_0x783928[_0xd373('0x4d')]=_['merge'](_0x783928[_0xd373('0x4d')],{'$or':_['map'](_0x783928[_0xd373('0x47')],function(_0xead65e){var _0x1816a7={};_0x1816a7[_0xead65e]={'$like':'%'+_0x3edaa5[_0xd373('0x43')][_0xd373('0x50')]+'%'};return _0x1816a7;})});}_0x783928=_[_0xd373('0x51')]({},_0x783928,_0x3edaa5[_0xd373('0x52')]);return _0x1d4551[_0xd373('0x77')](_0x783928);}})['then'](function(_0x3f98d4){if(_0x3f98d4){_0x59c27d=_0x3f98d4[_0xd373('0x49')];if(!_0x3edaa5[_0xd373('0x43')][_0xd373('0x4a')](_0xd373('0x66'))){_0x783928[_0xd373('0x4b')]=qs['limit'](_0x3edaa5[_0xd373('0x43')][_0xd373('0x4b')]);_0x783928[_0xd373('0x30')]=qs[_0xd373('0x30')](_0x3edaa5[_0xd373('0x43')][_0xd373('0x30')]);}return _0x1d4551[_0xd373('0x77')](_0x783928);}})[_0xd373('0x36')](function(_0x442c3b){if(_0x442c3b){return _0x442c3b?{'count':_0x59c27d,'rows':_0x442c3b}:null;}})['then'](respondWithResult(_0x2f1dc0,null))[_0xd373('0x2a')](handleError(_0x2f1dc0,null));};exports[_0xd373('0x79')]=function(_0x2df849,_0x536c81,_0x14181d){return db['WhatsappAccount']['findOne']({'where':{'id':_0x2df849[_0xd373('0x57')]['id']}})['then'](handleEntityNotFound(_0x536c81,null))[_0xd373('0x36')](function(_0x528ea0){if(_0x528ea0){return db['sequelize']['transaction'](function(_0x570e1e){return db['WhatsappApplication'][_0xd373('0x37')]({'where':{'WhatsappAccountId':_0x2df849[_0xd373('0x57')]['id']},'transaction':_0x570e1e})[_0xd373('0x36')](function(_0x267dbd){var _0x4c7f62=_[_0xd373('0x68')](_0x2df849[_0xd373('0x5a')],function(_0x39cfbf){_0x39cfbf[_0xd373('0x62')]=_0x2df849[_0xd373('0x57')]['id'];return _0x39cfbf;});return db[_0xd373('0x7a')][_0xd373('0x7b')](_0x4c7f62,{'transaction':_0x570e1e});});})[_0xd373('0x36')](function(){return db[_0xd373('0x7a')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2df849[_0xd373('0x57')]['id']},'order':_0xd373('0x7c')});});}})[_0xd373('0x36')](respondWithResult(_0x536c81,null))['catch'](handleError(_0x536c81,null));};exports[_0xd373('0x7d')]=function(_0x116a86,_0x4fbfbd,_0x4f50fd){var _0x389f22={};var _0x59e7d9={};var _0x435f3e;var _0x4152c6;return db[_0xd373('0x54')][_0xd373('0x65')]({'where':{'id':_0x116a86[_0xd373('0x57')]['id']}})[_0xd373('0x36')](handleEntityNotFound(_0x4fbfbd,null))['then'](function(_0x4b3764){if(_0x4b3764){_0x435f3e=_0x4b3764;_0x59e7d9[_0xd373('0x46')]=_[_0xd373('0x44')](db[_0xd373('0x7a')][_0xd373('0x3f')]);_0x59e7d9['query']=_['keys'](_0x116a86[_0xd373('0x43')]);_0x59e7d9[_0xd373('0x4e')]=_[_0xd373('0x45')](_0x59e7d9[_0xd373('0x46')],_0x59e7d9[_0xd373('0x43')]);_0x389f22['attributes']=_['intersection'](_0x59e7d9[_0xd373('0x46')],qs['fields'](_0x116a86[_0xd373('0x43')][_0xd373('0x48')]));_0x389f22[_0xd373('0x47')]=_0x389f22['attributes'][_0xd373('0x49')]?_0x389f22[_0xd373('0x47')]:_0x59e7d9['model'];_0x389f22[_0xd373('0x67')]=qs[_0xd373('0x4c')](_0x116a86[_0xd373('0x43')]['sort']);_0x389f22[_0xd373('0x4d')]=qs[_0xd373('0x4e')](_[_0xd373('0x4f')](_0x116a86['query'],_0x59e7d9['filters']));if(_0x116a86[_0xd373('0x43')][_0xd373('0x50')]){_0x389f22[_0xd373('0x4d')]=_[_0xd373('0x51')](_0x389f22[_0xd373('0x4d')],{'$or':_[_0xd373('0x68')](_0x389f22[_0xd373('0x47')],function(_0xbceb23){var _0x558917={};_0x558917[_0xbceb23]={'$like':'%'+_0x116a86[_0xd373('0x43')][_0xd373('0x50')]+'%'};return _0x558917;})});}_0x389f22=_[_0xd373('0x51')]({},_0x389f22,_0x116a86[_0xd373('0x52')]);return _0x435f3e['getApplications'](_0x389f22);}})[_0xd373('0x36')](function(_0x53d182){if(_0x53d182){_0x4152c6=_0x53d182[_0xd373('0x49')];if(!_0x116a86[_0xd373('0x43')]['hasOwnProperty'](_0xd373('0x66'))){_0x389f22[_0xd373('0x4b')]=qs[_0xd373('0x4b')](_0x116a86[_0xd373('0x43')][_0xd373('0x4b')]);_0x389f22[_0xd373('0x30')]=qs[_0xd373('0x30')](_0x116a86[_0xd373('0x43')]['offset']);}return _0x435f3e['getApplications'](_0x389f22);}})[_0xd373('0x36')](function(_0x35c0f8){if(_0x35c0f8){return _0x35c0f8?{'count':_0x4152c6,'rows':_0x35c0f8}:null;}})[_0xd373('0x36')](respondWithResult(_0x4fbfbd,null))['catch'](handleError(_0x4fbfbd,null));};exports[_0xd373('0x7e')]=function(_0x2e8acd,_0x5961e6,_0x765bf4){var _0x39d4de={'channel':_0xd373('0x7f')};var _0x442774=[];var _0x170502=[];var _0x1e18a3={};return db[_0xd373('0x54')][_0xd373('0x58')]({'where':{'id':_0x2e8acd[_0xd373('0x57')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xd373('0x80')}]})[_0xd373('0x36')](handleEntityNotFound(_0x5961e6,null))[_0xd373('0x36')](function(_0x8cb4da){_0x39d4de['account']=_0x8cb4da;_0x39d4de[_0xd373('0x81')]=_['orderBy'](_0x8cb4da[_0xd373('0x80')],[_0xd373('0x7c')],[_0xd373('0x82')]);if(_0x39d4de[_0xd373('0x83')][_0xd373('0x80')]){delete _0x39d4de['account']['Applications'];}return db[_0xd373('0x84')][_0xd373('0x60')]();})[_0xd373('0x36')](function(_0x54b879){if(!_0x54b879){throw new db[(_0xd373('0x1d'))][(_0xd373('0x1e'))]('no\x20available\x20attributes');}_0x442774=_['difference'](_['keys'](_0x54b879),[_0xd373('0x85'),'updatedAt']);_0x170502=_[_0xd373('0x86')](_[_0xd373('0x44')](_0x54b879),[_0xd373('0x85'),'updatedAt',_0xd373('0x87'),_0xd373('0x88')]);_0x39d4de[_0xd373('0x5a')]={'mapKey':_0xd373('0x89')};if(_0x39d4de[_0xd373('0x83')][_0xd373('0x41')]&&_0x39d4de['account'][_0xd373('0x41')]==='twilio'){_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')]=_0x2e8acd[_0xd373('0x5a')][_0xd373('0x8b')][_0xd373('0x8c')]('whatsapp:','');_0x39d4de[_0xd373('0x5a')][_0xd373('0x5a')]=_0x2e8acd[_0xd373('0x5a')]['Body'];_0x39d4de[_0xd373('0x5a')]['messageId']=_0x2e8acd['body'][_0xd373('0x8d')];}if(_0x39d4de[_0xd373('0x5a')]['id']){delete _0x39d4de[_0xd373('0x5a')]['id'];}if(_[_0xd373('0x8e')](_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')])){throw new db[(_0xd373('0x1d'))][(_0xd373('0x1e'))](_0xd373('0x8f'));}if(_[_0xd373('0x8e')](_0x39d4de[_0xd373('0x5a')]['body'])||_0x39d4de[_0xd373('0x5a')][_0xd373('0x5a')]===''){throw new db[(_0xd373('0x1d'))]['ValidationError'](_0xd373('0x90'));}if(_[_0xd373('0x8e')](_0x39d4de[_0xd373('0x5a')][_0xd373('0x91')])){throw new db[(_0xd373('0x1d'))][(_0xd373('0x1e'))](_0xd373('0x92')+_0x170502);}if(!_[_0xd373('0x93')](_0x170502,_0x39d4de[_0xd373('0x5a')]['mapKey'])){throw new db[(_0xd373('0x1d'))]['ValidationError'](_0xd373('0x94')+_0x170502);}_0x1e18a3[_0x39d4de['body'][_0xd373('0x91')]]=_0x39d4de[_0xd373('0x5a')]['from'];return db['CmList'][_0xd373('0x58')]({'where':{'id':_0x39d4de['account']['ListId']},'include':[{'model':db[_0xd373('0x84')],'as':'Contacts','where':_0x1e18a3,'limit':0x1,'order':[[_0xd373('0x95'),_0xd373('0x96')]]}]});})[_0xd373('0x36')](handleEntityNotFound(_0x5961e6,null))[_0xd373('0x36')](function(_0x1fe2e1){if(_0x1fe2e1){_0x39d4de['list']=_[_0xd373('0x70')](_0x1fe2e1,[_0xd373('0x97')]);if(_0x1fe2e1[_0xd373('0x97')][_0xd373('0x49')]){return _0x1fe2e1['Contacts'][0x0];}var _0xd93aba=_[_0xd373('0x98')](_0x39d4de[_0xd373('0x5a')],{'firstName':_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')],'ListId':_0x1fe2e1['id']});_0xd93aba[_0x39d4de[_0xd373('0x5a')][_0xd373('0x91')]]=_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')];return db[_0xd373('0x84')][_0xd373('0x59')](_0xd93aba,{'fields':_0x442774,'raw':!![]});}})[_0xd373('0x36')](handleEntityNotFound(_0x5961e6,null))[_0xd373('0x36')](function(_0x38dc69){if(_0x38dc69){_0x39d4de[_0xd373('0x99')]=_0x38dc69;var _0x48bd60={'ContactId':_0x38dc69['id'],'phone':_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')],'WhatsappAccountId':_0x2e8acd[_0xd373('0x57')]['id']};var _0x151771={'ContactId':_0x38dc69['id'],'WhatsappAccountId':_0x2e8acd[_0xd373('0x57')]['id'],'closed':![]};return db[_0xd373('0x9a')][_0xd373('0x58')]({'where':_0x151771})[_0xd373('0x36')](function(_0x3a0df2){if(_0x3a0df2){return[_0x3a0df2,![]];}return db[_0xd373('0x9a')][_0xd373('0x59')](_0x48bd60)[_0xd373('0x36')](function(_0x4dc083){return[_0x4dc083,!![]];});});}})[_0xd373('0x71')](function(_0xb70252,_0x49333f){_0x39d4de[_0xd373('0x9b')]=_0xb70252[_0xd373('0x38')]({'plain':!![]});_0x39d4de[_0xd373('0x9b')]['created']=![];if(_0x49333f){if(_0x39d4de[_0xd373('0x83')][_0xd373('0x9c')]){_0x39d4de[_0xd373('0x81')]['push']({'id':0x0,'priority':_0x39d4de[_0xd373('0x81')][_0xd373('0x49')]+0x1,'app':_0xd373('0x9d'),'appdata':_0xd373('0x9e'),'interval':'*,*,*,*'});}_0x39d4de[_0xd373('0x9b')][_0xd373('0x9f')]=!![];}return db[_0xd373('0xa0')][_0xd373('0x59')]({'phone':_0x39d4de[_0xd373('0x5a')][_0xd373('0x8a')],'messageId':_0x39d4de['body'][_0xd373('0xa1')],'body':_0x39d4de[_0xd373('0x5a')][_0xd373('0x5a')],'WhatsappAccountId':_0x2e8acd[_0xd373('0x57')]['id'],'WhatsappInteractionId':_0xb70252['id'],'direction':'in','ContactId':_0xb70252[_0xd373('0xa2')],'AttachmentId':_0x39d4de['body']['AttachmentId']});})[_0xd373('0x36')](function(_0x3bab9c){_0x39d4de['message']=_0x3bab9c;if(_0x39d4de[_0xd373('0x9b')][_0xd373('0xa3')]){return db[_0xd373('0x78')][_0xd373('0x58')]({'attributes':['id',_0xd373('0x42')],'where':{'id':_0x39d4de[_0xd373('0x9b')][_0xd373('0xa3')]}})[_0xd373('0x36')](function(_0x1bbf63){if(_0x1bbf63){_0x39d4de['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd373('0xa4'),'appdata':_0x1bbf63[_0xd373('0x42')]+','+(_0x39d4de['account'][_0xd373('0xa5')]||0xa),'interval':_0xd373('0xa6')});}return respondWithRpcPromise(_0xd373('0xa7'),_0xd373('0xa8'),_0x39d4de);});}return respondWithRpcPromise(_0xd373('0xa7'),_0xd373('0xa8'),_0x39d4de);})['then'](function(_0x29029b){if(_0x29029b){var _0x42ee7c=0xc8;var _0x221a31=_0xd373('0xa9');logger[_0xd373('0x20')](_0xd373('0x24'),_0x221a31,_0x42ee7c,_0xd373('0xaa'));logger[_0xd373('0x23')](_0xd373('0xab'),_0x221a31,_0x42ee7c,_0xd373('0xaa'),JSON['stringify'](_0x29029b));if(_0x39d4de[_0xd373('0x83')][_0xd373('0x41')]===_0xd373('0xac')){return _0x5961e6[_0xd373('0x2c')](_0x42ee7c)[_0xd373('0x31')]('Content-Type',_0xd373('0xad'))[_0xd373('0xae')](_0xd373('0xaf'));}else{return _0x5961e6[_0xd373('0x2c')](_0x42ee7c)[_0xd373('0x2e')](_0x29029b);}}})[_0xd373('0x2a')](handleError(_0x5961e6,null));};exports[_0xd373('0xae')]=function(_0x23743f,_0x5d6c98,_0x13fe0c){var _0xe5660f,_0x8b94d9,_0x16126a;if(_['isNil'](_0x23743f[_0xd373('0x5a')][_0xd373('0x5a')])||_0x23743f['body'][_0xd373('0x5a')]===''){throw new db[(_0xd373('0x1d'))][(_0xd373('0x1e'))](_0xd373('0x90'));}if(_[_0xd373('0x8e')](_0x23743f[_0xd373('0x5a')]['to'])){throw new db['Sequelize'][(_0xd373('0x1e'))](_0xd373('0xb0'));}_0xe5660f=_0x23743f[_0xd373('0x5a')]['to'];return db[_0xd373('0x54')]['find']({'where':{'id':_0x23743f['params']['id']},'include':[{'model':db['CmList'],'as':_0xd373('0xb1'),'include':[{'model':db[_0xd373('0x84')],'as':_0xd373('0x97'),'where':{'mobile':_0xe5660f},'limit':0x1,'order':[['updatedAt',_0xd373('0x96')]]}]}]})[_0xd373('0x36')](handleEntityNotFound(_0x5d6c98,null))['then'](function(_0x471916){if(_0x471916&&_0x471916[_0xd373('0xb1')]){_0x8b94d9=_0x471916['get']({'plain':!![]});if(_0x8b94d9[_0xd373('0xb1')]&&_0x8b94d9[_0xd373('0xb1')][_0xd373('0x97')][_0xd373('0x49')]){return _0x8b94d9[_0xd373('0xb1')][_0xd373('0x97')][0x0];}return db[_0xd373('0x84')]['create'](_['defaults'](_0x23743f[_0xd373('0x5a')],{'firstName':_0xe5660f,'mobile':_0xe5660f,'phone':_0xe5660f,'ListId':_0x8b94d9['ListId']}));}})[_0xd373('0x36')](handleEntityNotFound(_0x5d6c98,null))['then'](function(_0x1a9169){if(_0x1a9169){_0x16126a=_0x1a9169;return db['WhatsappInteraction'][_0xd373('0x58')]({'where':{'ContactId':_0x16126a['id'],'closed':![],'WhatsappAccountId':_0x8b94d9['id']}})['then'](function(_0x8d4995){if(_0x8d4995){return[_0x8d4995,![]];}return db[_0xd373('0x9a')]['create']({'UserId':_0x23743f[_0xd373('0x5b')]['id'],'ContactId':_0x16126a['id'],'WhatsappAccountId':_0x8b94d9['id'],'phone':_0xe5660f,'firstMsgDirection':_0xd373('0xb2'),'Messages':[_['merge'](_0x23743f[_0xd373('0x5a')],{'read':![],'body':_0x23743f[_0xd373('0x5a')][_0xd373('0x5a')],'phone':_0xe5660f,'WhatsappAccountId':_0x8b94d9['id'],'UserId':_0x23743f[_0xd373('0x5b')]['id'],'ContactId':_0x16126a['id']})]},{'include':[{'model':db[_0xd373('0xa0')],'as':'Messages'}]})[_0xd373('0x36')](function(_0x5b8844){return[_0x5b8844,!![]];});});}})['spread'](function(_0x1851c7,_0x5b1887){if(_0x5b1887){return _0x1851c7;}return db['WhatsappMessage'][_0xd373('0x59')](_[_0xd373('0x51')](_0x23743f[_0xd373('0x5a')],{'read':![],'body':_0x23743f[_0xd373('0x5a')][_0xd373('0x5a')],'phone':_0xe5660f,'WhatsappAccountId':_0x8b94d9['id'],'WhatsappInteractionId':_0x1851c7['id'],'UserId':_0x23743f[_0xd373('0x5b')]['id'],'ContactId':_0x16126a['id']}))[_0xd373('0x36')](function(_0x1bd6f6){_0x1851c7[_0xd373('0xb3')]['Messages']=[];_0x1851c7['dataValues'][_0xd373('0xb4')]['push'](_0x1bd6f6[_0xd373('0xb3')]);return _0x1851c7;});})[_0xd373('0x36')](respondWithResult(_0x5d6c98,null))['catch'](handleError(_0x5d6c98,null));}; \ No newline at end of file +var _0xd404=['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','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getDispositions','findOne','rawAttributes','sort','WhatsappAccountId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','addAgents','omit','spread','removeAgents','emit','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','account','applications','priority','asc','Applications','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','twilio','From','replace','whatsapp:','Body','messageId','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','Contacts','DESC','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise'];(function(_0x2af333,_0x54f43f){var _0x1f22a5=function(_0x15ff1b){while(--_0x15ff1b){_0x2af333['push'](_0x2af333['shift']());}};_0x1f22a5(++_0x54f43f);}(_0xd404,0x15b));var _0x4d40=function(_0x32974a,_0xd71e64){_0x32974a=_0x32974a-0x0;var _0x29fb8b=_0xd404[_0x32974a];return _0x29fb8b;};'use strict';var pdf=require(_0x4d40('0x0'));var emlformat=require(_0x4d40('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d40('0x2'));var jsonpatch=require(_0x4d40('0x3'));var rp=require('request-promise');var moment=require(_0x4d40('0x4'));var BPromise=require(_0x4d40('0x5'));var Mustache=require(_0x4d40('0x6'));var util=require(_0x4d40('0x7'));var path=require(_0x4d40('0x8'));var sox=require(_0x4d40('0x9'));var csv=require(_0x4d40('0xa'));var ejs=require(_0x4d40('0xb'));var fs=require('fs');var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var db=require(_0x4d40('0x18'))['db'];config[_0x4d40('0x19')]=_[_0x4d40('0x1a')](config[_0x4d40('0x19')],{'host':_0x4d40('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d40('0x19')]));require(_0x4d40('0x1c'))[_0x4d40('0x1d')](socket);var jayson=require(_0x4d40('0x1e'));var client=jayson[_0x4d40('0x1f')]['http']({'port':0x232c});function checkPasswordPattern(_0x23de7b,_0x4077ce,_0x20bc1b){if(_0x20bc1b){var _0xcee25a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcee25a[_0x4d40('0x20')](_0x4077ce)){return _0x23de7b;}else{throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))](_0x4d40('0x23'));}}else{return _0x23de7b;}}function respondWithRpcPromise(_0x1439a7,_0x4b5d23,_0x535989,_0x1ae5c7){return new BPromise(function(_0x1c0cd8,_0x4e505f){var _0x23b8fd=_0x1ae5c7||client;return _0x23b8fd[_0x4d40('0x24')](_0x1439a7,_0x535989)['then'](function(_0x36d031){logger['info'](_0x4d40('0x25'),_0x4b5d23,_0x4d40('0x26'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4b5d23,_0x4d40('0x26'),JSON[_0x4d40('0x27')](_0x36d031));if(_0x36d031['error']){if(_0x36d031[_0x4d40('0x28')][_0x4d40('0x29')]===0x1f4){logger[_0x4d40('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x4b5d23,_0x36d031[_0x4d40('0x28')][_0x4d40('0x2a')]);return _0x4e505f(_0x36d031[_0x4d40('0x28')]['message']);}logger['error'](_0x4d40('0x25'),_0x4b5d23,_0x36d031[_0x4d40('0x28')][_0x4d40('0x2a')]);return _0x1c0cd8(_0x36d031[_0x4d40('0x28')][_0x4d40('0x2a')]);}else{logger['info'](_0x4d40('0x25'),_0x4b5d23,_0x4d40('0x26'));_0x1c0cd8(_0x36d031['result']['message']);}})[_0x4d40('0x2b')](function(_0x2a0c82){logger[_0x4d40('0x28')](_0x4d40('0x25'),_0x4b5d23,_0x2a0c82);_0x4e505f(_0x2a0c82);});});}function respondWithStatusCode(_0x4a8ad6,_0x325f6f){_0x325f6f=_0x325f6f||0xcc;return function(_0x105635){if(_0x105635){return _0x4a8ad6[_0x4d40('0x2c')](_0x325f6f);}return _0x4a8ad6[_0x4d40('0x2d')](_0x325f6f)[_0x4d40('0x2e')]();};}function respondWithResult(_0x1c0fcf,_0x4ca431){_0x4ca431=_0x4ca431||0xc8;return function(_0x4e4e61){if(_0x4e4e61){return _0x1c0fcf['status'](_0x4ca431)[_0x4d40('0x2f')](_0x4e4e61);}};}function respondWithFilteredResult(_0x350488,_0x1ac240){return function(_0x18f18f){if(_0x18f18f){var _0x598ca9=_0x18f18f['count'],_0x18e601=_0x1ac240[_0x4d40('0x30')],_0x1c8a1b=_0x1ac240[_0x4d40('0x30')]+_0x1ac240[_0x4d40('0x31')],_0x429da9;if(_0x1c8a1b>=_0x598ca9){_0x1c8a1b=_0x598ca9;_0x429da9=0xc8;}else{_0x429da9=0xce;}_0x350488[_0x4d40('0x2d')](_0x429da9);return _0x350488[_0x4d40('0x32')]('Content-Range',_0x18e601+'-'+_0x1c8a1b+'/'+_0x598ca9)[_0x4d40('0x2f')](_0x18f18f);}return null;};}function patchUpdates(_0x4ae4ce){return function(_0x263d0a){try{jsonpatch[_0x4d40('0x33')](_0x263d0a,_0x4ae4ce,!![]);}catch(_0x3cd439){return BPromise[_0x4d40('0x34')](_0x3cd439);}return _0x263d0a['save']();};}function saveUpdates(_0x5bbe0b,_0x5e483c){return function(_0x3642ee){if(_0x3642ee){return _0x3642ee[_0x4d40('0x35')](_0x5bbe0b)[_0x4d40('0x36')](function(_0x5e195a){return _0x5e195a;});}return null;};}function removeEntity(_0xf5f494,_0x5f1d1c){return function(_0x2fde16){if(_0x2fde16){return _0x2fde16[_0x4d40('0x37')]()[_0x4d40('0x36')](function(){var _0x1b8b68=_0x2fde16[_0x4d40('0x38')]({'plain':!![]});var _0x2c6a94=_0x4d40('0x39');return db[_0x4d40('0x3a')][_0x4d40('0x37')]({'where':{'type':_0x2c6a94,'resourceId':_0x1b8b68['id']}})[_0x4d40('0x36')](function(){return _0x2fde16;});})['then'](function(){_0xf5f494[_0x4d40('0x2d')](0xcc)[_0x4d40('0x2e')]();});}};}function handleEntityNotFound(_0x537a6a,_0x5bad1c){return function(_0x5087e1){if(!_0x5087e1){_0x537a6a[_0x4d40('0x2c')](0x194);}return _0x5087e1;};}function handleError(_0xcb42f6,_0x5784aa){_0x5784aa=_0x5784aa||0x1f4;return function(_0x256cc8){logger[_0x4d40('0x28')](_0x256cc8[_0x4d40('0x3b')]);if(_0x256cc8[_0x4d40('0x3c')]){delete _0x256cc8[_0x4d40('0x3c')];}_0xcb42f6['status'](_0x5784aa)[_0x4d40('0x3d')](_0x256cc8);};}exports[_0x4d40('0x3e')]=function(_0x4a84fa,_0x4eb405){var _0x3a4924={'include':[{'model':db[_0x4d40('0x3f')],'as':_0x4d40('0x40')}]},_0x11ed1a={},_0x56f52e={'count':0x0,'rows':[]};var _0x4ab819=_[_0x4d40('0x41')](db[_0x4d40('0x42')]['rawAttributes'],function(_0x3ed6c2){return{'name':_0x3ed6c2[_0x4d40('0x43')],'type':_0x3ed6c2['type'][_0x4d40('0x44')]};});_0x11ed1a['model']=_[_0x4d40('0x41')](_0x4ab819,_0x4d40('0x3c'));_0x11ed1a[_0x4d40('0x45')]=_[_0x4d40('0x46')](_0x4a84fa[_0x4d40('0x45')]);_0x11ed1a[_0x4d40('0x47')]=_[_0x4d40('0x48')](_0x11ed1a[_0x4d40('0x49')],_0x11ed1a[_0x4d40('0x45')]);_0x3a4924['attributes']=_[_0x4d40('0x48')](_0x11ed1a[_0x4d40('0x49')],qs[_0x4d40('0x4a')](_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x3a4924['attributes']=_0x3a4924[_0x4d40('0x4b')]['length']?_0x3a4924[_0x4d40('0x4b')]:_0x11ed1a[_0x4d40('0x49')];if(!_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x4c')]('nolimit')){_0x3a4924[_0x4d40('0x31')]=qs[_0x4d40('0x31')](_0x4a84fa['query'][_0x4d40('0x31')]);_0x3a4924['offset']=qs[_0x4d40('0x30')](_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x30')]);}_0x3a4924[_0x4d40('0x4d')]=qs['sort'](_0x4a84fa[_0x4d40('0x45')]['sort']);_0x3a4924[_0x4d40('0x4e')]=qs[_0x4d40('0x47')](_[_0x4d40('0x4f')](_0x4a84fa[_0x4d40('0x45')],_0x11ed1a['filters']),_0x4ab819);if(_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x50')]){_0x3a4924[_0x4d40('0x4e')]=_[_0x4d40('0x51')](_0x3a4924['where'],{'$or':_[_0x4d40('0x41')](_0x4ab819,function(_0x3b057d){if(_0x3b057d['type']!==_0x4d40('0x52')){var _0x493d8e={};_0x493d8e[_0x3b057d[_0x4d40('0x3c')]]={'$like':'%'+_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x50')]+'%'};return _0x493d8e;}})});}_0x3a4924=_[_0x4d40('0x51')]({},_0x3a4924,_0x4a84fa[_0x4d40('0x53')]);var _0x351900={'where':_0x3a4924[_0x4d40('0x4e')]};return db[_0x4d40('0x42')][_0x4d40('0x54')](_0x351900)['then'](function(_0x532fde){_0x56f52e[_0x4d40('0x54')]=_0x532fde;if(_0x4a84fa[_0x4d40('0x45')][_0x4d40('0x55')]){_0x3a4924[_0x4d40('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x4d40('0x57')](_0x3a4924);})[_0x4d40('0x36')](function(_0x4f7b36){_0x56f52e[_0x4d40('0x58')]=_0x4f7b36;return _0x56f52e;})['then'](respondWithFilteredResult(_0x4eb405,_0x3a4924))[_0x4d40('0x2b')](handleError(_0x4eb405,null));};exports[_0x4d40('0x59')]=function(_0x3e294e,_0x53d73a){var _0x2937bb={'raw':![],'where':{'id':_0x3e294e[_0x4d40('0x5a')]['id']},'include':[{'model':db[_0x4d40('0x3f')],'as':_0x4d40('0x40')}]},_0x17e039={};_0x17e039['model']=_[_0x4d40('0x46')](db[_0x4d40('0x42')]['rawAttributes']);_0x17e039[_0x4d40('0x45')]=_['keys'](_0x3e294e[_0x4d40('0x45')]);_0x17e039['filters']=_[_0x4d40('0x48')](_0x17e039[_0x4d40('0x49')],_0x17e039['query']);_0x2937bb[_0x4d40('0x4b')]=_[_0x4d40('0x48')](_0x17e039[_0x4d40('0x49')],qs[_0x4d40('0x4a')](_0x3e294e[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x2937bb[_0x4d40('0x4b')]=_0x2937bb[_0x4d40('0x4b')][_0x4d40('0x5b')]?_0x2937bb[_0x4d40('0x4b')]:_0x17e039[_0x4d40('0x49')];if(_0x3e294e[_0x4d40('0x45')][_0x4d40('0x55')]){_0x2937bb[_0x4d40('0x56')]=[{'all':!![]}];}_0x2937bb=_[_0x4d40('0x51')]({},_0x2937bb,_0x3e294e[_0x4d40('0x53')]);return db[_0x4d40('0x42')][_0x4d40('0x5c')](_0x2937bb)[_0x4d40('0x36')](handleEntityNotFound(_0x53d73a,null))['then'](respondWithResult(_0x53d73a,null))[_0x4d40('0x2b')](handleError(_0x53d73a,null));};exports[_0x4d40('0x5d')]=function(_0x4de203,_0x5cebfc){return db[_0x4d40('0x42')][_0x4d40('0x5d')](_0x4de203['body'],{})['then'](function(_0x33b61b){var _0x4c9df4=_0x4de203[_0x4d40('0x5e')]['get']({'plain':!![]});if(!_0x4c9df4)throw new Error(_0x4d40('0x5f'));if(_0x4c9df4[_0x4d40('0x60')]===_0x4d40('0x5e')){var _0x3e3160=_0x33b61b[_0x4d40('0x38')]({'plain':!![]});var _0x4a6e3e='WhatsappAccounts';return db['UserProfileSection'][_0x4d40('0x5c')]({'where':{'name':_0x4a6e3e,'userProfileId':_0x4c9df4[_0x4d40('0x61')]},'raw':!![]})[_0x4d40('0x36')](function(_0x21a798){if(_0x21a798&&_0x21a798[_0x4d40('0x62')]===0x0){return db['UserProfileResource'][_0x4d40('0x5d')]({'name':_0x3e3160['name'],'resourceId':_0x3e3160['id'],'type':_0x21a798[_0x4d40('0x3c')],'sectionId':_0x21a798['id']},{})[_0x4d40('0x36')](function(){return _0x33b61b;});}else{return _0x33b61b;}})[_0x4d40('0x2b')](function(_0x22305e){logger[_0x4d40('0x28')](_0x4d40('0x63'),_0x22305e);throw _0x22305e;});}return _0x33b61b;})['then'](respondWithResult(_0x5cebfc,0xc9))['catch'](handleError(_0x5cebfc,null));};exports[_0x4d40('0x35')]=function(_0x221552,_0x9f16bb){if(_0x221552[_0x4d40('0x64')]['id']){delete _0x221552[_0x4d40('0x64')]['id'];}return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x221552[_0x4d40('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x4d40('0x40')}]})['then'](handleEntityNotFound(_0x9f16bb,null))['then'](saveUpdates(_0x221552['body'],null))[_0x4d40('0x36')](respondWithResult(_0x9f16bb,null))[_0x4d40('0x2b')](handleError(_0x9f16bb,null));};exports[_0x4d40('0x37')]=function(_0x36f590,_0x4d0af5){return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x36f590[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x4d0af5,null))[_0x4d40('0x36')](removeEntity(_0x4d0af5,null))['catch'](handleError(_0x4d0af5,null));};exports['describe']=function(_0x23bc80,_0x4b24a7){return db[_0x4d40('0x42')][_0x4d40('0x65')]()[_0x4d40('0x36')](respondWithResult(_0x4b24a7,null))['catch'](handleError(_0x4b24a7,null));};exports['addDisposition']=function(_0x3ede3b,_0x506ac3,_0x19b92c){if(_0x3ede3b[_0x4d40('0x64')]['id']){delete _0x3ede3b['body']['id'];}return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x3ede3b[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x506ac3,null))[_0x4d40('0x36')](function(_0x2061a3){if(_0x2061a3){_0x3ede3b['body']['WhatsappAccountId']=_0x2061a3['id'];return db['Disposition'][_0x4d40('0x5d')](_0x3ede3b[_0x4d40('0x64')]);}})[_0x4d40('0x36')](respondWithResult(_0x506ac3,null))['catch'](handleError(_0x506ac3,null));};exports[_0x4d40('0x66')]=function(_0x22b423,_0x4bb2df,_0x595fa5){var _0x1e8a5f={'raw':![],'where':{}};var _0x1b5aa9={};var _0x4db818={'count':0x0,'rows':[]};return db[_0x4d40('0x42')][_0x4d40('0x67')]({'where':{'id':_0x22b423[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x4bb2df,null))[_0x4d40('0x36')](function(_0x717bc1){if(_0x717bc1){_0x1b5aa9['model']=_[_0x4d40('0x46')](db['Disposition'][_0x4d40('0x68')]);_0x1b5aa9[_0x4d40('0x45')]=_['keys'](_0x22b423[_0x4d40('0x45')]);_0x1b5aa9[_0x4d40('0x47')]=_['intersection'](_0x1b5aa9[_0x4d40('0x49')],_0x1b5aa9[_0x4d40('0x45')]);_0x1e8a5f['attributes']=_[_0x4d40('0x48')](_0x1b5aa9[_0x4d40('0x49')],qs[_0x4d40('0x4a')](_0x22b423[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x1e8a5f['attributes']=_0x1e8a5f[_0x4d40('0x4b')][_0x4d40('0x5b')]?_0x1e8a5f[_0x4d40('0x4b')]:_0x1b5aa9[_0x4d40('0x49')];if(!_0x22b423[_0x4d40('0x45')][_0x4d40('0x4c')]('nolimit')){_0x1e8a5f[_0x4d40('0x31')]=qs['limit'](_0x22b423[_0x4d40('0x45')][_0x4d40('0x31')]);_0x1e8a5f[_0x4d40('0x30')]=qs[_0x4d40('0x30')](_0x22b423[_0x4d40('0x45')]['offset']);}_0x1e8a5f[_0x4d40('0x4d')]=qs[_0x4d40('0x69')](_0x22b423[_0x4d40('0x45')][_0x4d40('0x69')]);_0x1e8a5f['where']=qs[_0x4d40('0x47')](_[_0x4d40('0x4f')](_0x22b423[_0x4d40('0x45')],_0x1b5aa9[_0x4d40('0x47')]));_0x1e8a5f['where'][_0x4d40('0x6a')]=_0x717bc1['id'];if(_0x22b423['query'][_0x4d40('0x50')]){_0x1e8a5f[_0x4d40('0x4e')]=_[_0x4d40('0x51')](_0x1e8a5f[_0x4d40('0x4e')],{'$or':_['map'](_0x1e8a5f['attributes'],function(_0x3c14b6){var _0x4660b8={};_0x4660b8[_0x3c14b6]={'$like':'%'+_0x22b423['query'][_0x4d40('0x50')]+'%'};return _0x4660b8;})});}_0x1e8a5f=_[_0x4d40('0x51')]({},_0x1e8a5f,_0x22b423[_0x4d40('0x53')]);return db[_0x4d40('0x6b')][_0x4d40('0x54')]({'where':_0x1e8a5f['where']})[_0x4d40('0x36')](function(_0x2036a8){_0x4db818[_0x4d40('0x54')]=_0x2036a8;if(_0x22b423[_0x4d40('0x45')][_0x4d40('0x55')]){_0x1e8a5f[_0x4d40('0x56')]=[{'all':!![]}];}return db[_0x4d40('0x6b')][_0x4d40('0x57')](_0x1e8a5f);})[_0x4d40('0x36')](function(_0x27085b){_0x4db818[_0x4d40('0x58')]=_0x27085b;return _0x4db818;});}})['then'](respondWithFilteredResult(_0x4bb2df,_0x1e8a5f))[_0x4d40('0x2b')](handleError(_0x4bb2df,null));};exports[_0x4d40('0x6c')]=function(_0x599727,_0xbb9020,_0xbec312){return db['WhatsappAccount']['find']({'where':{'id':_0x599727[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0xbb9020,null))['then'](function(_0x233f77){if(_0x233f77){return _0x233f77[_0x4d40('0x6c')](_0x599727['query'][_0x4d40('0x6d')]);}})[_0x4d40('0x36')](respondWithStatusCode(_0xbb9020,null))['catch'](handleError(_0xbb9020,null));};exports['addAnswer']=function(_0x50d012,_0x5e5004,_0xc7ec7d){if(_0x50d012['body']['id']){delete _0x50d012['body']['id'];}return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x50d012[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x5e5004,null))[_0x4d40('0x36')](function(_0xf8b560){if(_0xf8b560){_0x50d012[_0x4d40('0x64')]['WhatsappAccountId']=_0xf8b560['id'];return db[_0x4d40('0x6e')][_0x4d40('0x5d')](_0x50d012[_0x4d40('0x64')]);}})[_0x4d40('0x36')](respondWithResult(_0x5e5004,null))[_0x4d40('0x2b')](handleError(_0x5e5004,null));};exports[_0x4d40('0x6f')]=function(_0x43760a,_0x6f0128,_0x560121){var _0x570fe5={'raw':![],'where':{}};var _0x3bdda3={};var _0x9ea21d={'count':0x0,'rows':[]};return db[_0x4d40('0x42')][_0x4d40('0x67')]({'where':{'id':_0x43760a[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x6f0128,null))['then'](function(_0x185574){if(_0x185574){_0x3bdda3[_0x4d40('0x49')]=_['keys'](db[_0x4d40('0x6e')]['rawAttributes']);_0x3bdda3['query']=_['keys'](_0x43760a[_0x4d40('0x45')]);_0x3bdda3[_0x4d40('0x47')]=_[_0x4d40('0x48')](_0x3bdda3[_0x4d40('0x49')],_0x3bdda3['query']);_0x570fe5[_0x4d40('0x4b')]=_['intersection'](_0x3bdda3[_0x4d40('0x49')],qs[_0x4d40('0x4a')](_0x43760a[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x570fe5[_0x4d40('0x4b')]=_0x570fe5[_0x4d40('0x4b')]['length']?_0x570fe5[_0x4d40('0x4b')]:_0x3bdda3[_0x4d40('0x49')];if(!_0x43760a['query']['hasOwnProperty'](_0x4d40('0x70'))){_0x570fe5[_0x4d40('0x31')]=qs[_0x4d40('0x31')](_0x43760a[_0x4d40('0x45')][_0x4d40('0x31')]);_0x570fe5['offset']=qs[_0x4d40('0x30')](_0x43760a[_0x4d40('0x45')][_0x4d40('0x30')]);}_0x570fe5['order']=qs[_0x4d40('0x69')](_0x43760a['query'][_0x4d40('0x69')]);_0x570fe5[_0x4d40('0x4e')]=qs[_0x4d40('0x47')](_['pick'](_0x43760a[_0x4d40('0x45')],_0x3bdda3[_0x4d40('0x47')]));_0x570fe5['where'][_0x4d40('0x6a')]=_0x185574['id'];if(_0x43760a[_0x4d40('0x45')][_0x4d40('0x50')]){_0x570fe5[_0x4d40('0x4e')]=_['merge'](_0x570fe5[_0x4d40('0x4e')],{'$or':_['map'](_0x570fe5[_0x4d40('0x4b')],function(_0x16373c){var _0x4c74ff={};_0x4c74ff[_0x16373c]={'$like':'%'+_0x43760a[_0x4d40('0x45')]['filter']+'%'};return _0x4c74ff;})});}_0x570fe5=_['merge']({},_0x570fe5,_0x43760a[_0x4d40('0x53')]);return db['CannedAnswer'][_0x4d40('0x54')]({'where':_0x570fe5[_0x4d40('0x4e')]})[_0x4d40('0x36')](function(_0x283796){_0x9ea21d[_0x4d40('0x54')]=_0x283796;if(_0x43760a[_0x4d40('0x45')][_0x4d40('0x55')]){_0x570fe5['include']=[{'all':!![]}];}return db[_0x4d40('0x6e')]['findAll'](_0x570fe5);})[_0x4d40('0x36')](function(_0x58e05b){_0x9ea21d['rows']=_0x58e05b;return _0x9ea21d;});}})['then'](respondWithFilteredResult(_0x6f0128,_0x570fe5))['catch'](handleError(_0x6f0128,null));};exports[_0x4d40('0x71')]=function(_0x14ef80,_0x3593fe,_0x1be4ea){return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x14ef80[_0x4d40('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3593fe,null))[_0x4d40('0x36')](function(_0x7f96d0){if(_0x7f96d0){return _0x7f96d0['removeAnswers'](_0x14ef80[_0x4d40('0x45')][_0x4d40('0x6d')]);}})[_0x4d40('0x36')](respondWithStatusCode(_0x3593fe,null))['catch'](handleError(_0x3593fe,null));};exports[_0x4d40('0x72')]=function(_0x38cd6f,_0x14c6a8,_0x30e51c){return db['WhatsappAccount'][_0x4d40('0x5c')]({'where':{'id':_0x38cd6f[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x14c6a8,null))[_0x4d40('0x36')](function(_0x345dde){if(_0x345dde){return _0x345dde[_0x4d40('0x72')](_0x38cd6f[_0x4d40('0x64')][_0x4d40('0x6d')],_[_0x4d40('0x73')](_0x38cd6f['body'],[_0x4d40('0x6d'),'id'])||{})[_0x4d40('0x74')](function(_0x111363){for(var _0x334eb9=0x0;_0x334eb9<_0x38cd6f[_0x4d40('0x64')][_0x4d40('0x6d')][_0x4d40('0x5b')];_0x334eb9+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x38cd6f[_0x4d40('0x64')][_0x4d40('0x6d')][_0x334eb9],'WhatsappAccountId':_0x38cd6f[_0x4d40('0x5a')]['id']});}return _0x111363;});}})[_0x4d40('0x36')](respondWithResult(_0x14c6a8,null))[_0x4d40('0x2b')](handleError(_0x14c6a8,null));};exports[_0x4d40('0x75')]=function(_0x455170,_0x3b6eea,_0x2ad153){return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x455170[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x3b6eea,null))[_0x4d40('0x36')](function(_0xcd3354){if(_0xcd3354){return _0xcd3354[_0x4d40('0x75')](_0x455170[_0x4d40('0x45')][_0x4d40('0x6d')])[_0x4d40('0x36')](function(){if(_['isArray'](_0x455170['query'][_0x4d40('0x6d')])){for(var _0x3afa95=0x0;_0x3afa95<_0x455170[_0x4d40('0x45')]['ids'][_0x4d40('0x5b')];_0x3afa95+=0x1){socket[_0x4d40('0x76')](_0x4d40('0x77'),{'UserId':Number(_0x455170[_0x4d40('0x45')][_0x4d40('0x6d')][_0x3afa95]),'WhatsappAccountId':Number(_0x455170[_0x4d40('0x5a')]['id'])});}}else{socket[_0x4d40('0x76')](_0x4d40('0x77'),{'UserId':Number(_0x455170[_0x4d40('0x45')][_0x4d40('0x6d')]),'WhatsappAccountId':Number(_0x455170['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3b6eea,null))[_0x4d40('0x2b')](handleError(_0x3b6eea,null));};exports['getAgents']=function(_0x599c98,_0x4c58ad,_0x33ef8a){var _0x37ca45={};var _0x219acc={};var _0x2f1747;var _0x267d64;return db['WhatsappAccount'][_0x4d40('0x67')]({'where':{'id':_0x599c98['params']['id']}})['then'](handleEntityNotFound(_0x4c58ad,null))[_0x4d40('0x36')](function(_0x1d5533){if(_0x1d5533){_0x2f1747=_0x1d5533;_0x219acc['model']=_[_0x4d40('0x46')](db[_0x4d40('0x78')][_0x4d40('0x68')]);_0x219acc['query']=_[_0x4d40('0x46')](_0x599c98['query']);_0x219acc[_0x4d40('0x47')]=_[_0x4d40('0x48')](_0x219acc[_0x4d40('0x49')],_0x219acc[_0x4d40('0x45')]);_0x37ca45['attributes']=_[_0x4d40('0x48')](_0x219acc[_0x4d40('0x49')],qs[_0x4d40('0x4a')](_0x599c98[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x37ca45[_0x4d40('0x4b')]=_0x37ca45[_0x4d40('0x4b')][_0x4d40('0x5b')]?_0x37ca45['attributes']:_0x219acc[_0x4d40('0x49')];_0x37ca45['order']=qs[_0x4d40('0x69')](_0x599c98[_0x4d40('0x45')][_0x4d40('0x69')]);_0x37ca45[_0x4d40('0x4e')]=qs[_0x4d40('0x47')](_[_0x4d40('0x4f')](_0x599c98[_0x4d40('0x45')],_0x219acc[_0x4d40('0x47')]));if(_0x599c98['query'][_0x4d40('0x50')]){_0x37ca45[_0x4d40('0x4e')]=_[_0x4d40('0x51')](_0x37ca45[_0x4d40('0x4e')],{'$or':_[_0x4d40('0x41')](_0x37ca45['attributes'],function(_0x3a0458){var _0x3c35d8={};_0x3c35d8[_0x3a0458]={'$like':'%'+_0x599c98[_0x4d40('0x45')][_0x4d40('0x50')]+'%'};return _0x3c35d8;})});}_0x37ca45=_[_0x4d40('0x51')]({},_0x37ca45,_0x599c98[_0x4d40('0x53')]);return _0x2f1747[_0x4d40('0x79')](_0x37ca45);}})[_0x4d40('0x36')](function(_0xd70130){if(_0xd70130){_0x267d64=_0xd70130[_0x4d40('0x5b')];if(!_0x599c98['query']['hasOwnProperty'](_0x4d40('0x70'))){_0x37ca45[_0x4d40('0x31')]=qs[_0x4d40('0x31')](_0x599c98[_0x4d40('0x45')][_0x4d40('0x31')]);_0x37ca45['offset']=qs['offset'](_0x599c98['query'][_0x4d40('0x30')]);}return _0x2f1747[_0x4d40('0x79')](_0x37ca45);}})[_0x4d40('0x36')](function(_0x5464f8){if(_0x5464f8){return _0x5464f8?{'count':_0x267d64,'rows':_0x5464f8}:null;}})[_0x4d40('0x36')](respondWithResult(_0x4c58ad,null))[_0x4d40('0x2b')](handleError(_0x4c58ad,null));};exports[_0x4d40('0x7a')]=function(_0x594211,_0x1b106d,_0x571704){return db[_0x4d40('0x42')][_0x4d40('0x67')]({'where':{'id':_0x594211[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x1b106d,null))['then'](function(_0x411a4c){if(_0x411a4c){return db['sequelize'][_0x4d40('0x7b')](function(_0x3dd6a1){return db[_0x4d40('0x7c')][_0x4d40('0x37')]({'where':{'WhatsappAccountId':_0x594211['params']['id']},'transaction':_0x3dd6a1})[_0x4d40('0x36')](function(_0x3a59d3){var _0x5141c6=_[_0x4d40('0x41')](_0x594211[_0x4d40('0x64')],function(_0x1340bd){_0x1340bd[_0x4d40('0x6a')]=_0x594211['params']['id'];return _0x1340bd;});return db[_0x4d40('0x7c')][_0x4d40('0x7d')](_0x5141c6,{'transaction':_0x3dd6a1});});})[_0x4d40('0x36')](function(){return db[_0x4d40('0x7c')][_0x4d40('0x7e')]({'where':{'WhatsappAccountId':_0x594211[_0x4d40('0x5a')]['id']},'order':'priority'});});}})[_0x4d40('0x36')](respondWithResult(_0x1b106d,null))[_0x4d40('0x2b')](handleError(_0x1b106d,null));};exports[_0x4d40('0x7f')]=function(_0x4f92f4,_0x37ca4d,_0x3079b9){var _0x5b44b0={};var _0xd6c220={};var _0x39ea8e;var _0x346d9c;return db[_0x4d40('0x42')][_0x4d40('0x67')]({'where':{'id':_0x4f92f4[_0x4d40('0x5a')]['id']}})[_0x4d40('0x36')](handleEntityNotFound(_0x37ca4d,null))[_0x4d40('0x36')](function(_0x4001af){if(_0x4001af){_0x39ea8e=_0x4001af;_0xd6c220[_0x4d40('0x49')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0xd6c220[_0x4d40('0x45')]=_[_0x4d40('0x46')](_0x4f92f4[_0x4d40('0x45')]);_0xd6c220['filters']=_['intersection'](_0xd6c220[_0x4d40('0x49')],_0xd6c220[_0x4d40('0x45')]);_0x5b44b0['attributes']=_[_0x4d40('0x48')](_0xd6c220['model'],qs[_0x4d40('0x4a')](_0x4f92f4[_0x4d40('0x45')][_0x4d40('0x4a')]));_0x5b44b0['attributes']=_0x5b44b0[_0x4d40('0x4b')][_0x4d40('0x5b')]?_0x5b44b0[_0x4d40('0x4b')]:_0xd6c220['model'];_0x5b44b0[_0x4d40('0x4d')]=qs[_0x4d40('0x69')](_0x4f92f4[_0x4d40('0x45')]['sort']);_0x5b44b0[_0x4d40('0x4e')]=qs['filters'](_[_0x4d40('0x4f')](_0x4f92f4[_0x4d40('0x45')],_0xd6c220['filters']));if(_0x4f92f4['query'][_0x4d40('0x50')]){_0x5b44b0[_0x4d40('0x4e')]=_['merge'](_0x5b44b0['where'],{'$or':_['map'](_0x5b44b0[_0x4d40('0x4b')],function(_0x36605e){var _0x4839a1={};_0x4839a1[_0x36605e]={'$like':'%'+_0x4f92f4[_0x4d40('0x45')]['filter']+'%'};return _0x4839a1;})});}_0x5b44b0=_['merge']({},_0x5b44b0,_0x4f92f4[_0x4d40('0x53')]);return _0x39ea8e[_0x4d40('0x7f')](_0x5b44b0);}})[_0x4d40('0x36')](function(_0x1cd057){if(_0x1cd057){_0x346d9c=_0x1cd057[_0x4d40('0x5b')];if(!_0x4f92f4[_0x4d40('0x45')][_0x4d40('0x4c')](_0x4d40('0x70'))){_0x5b44b0[_0x4d40('0x31')]=qs[_0x4d40('0x31')](_0x4f92f4[_0x4d40('0x45')][_0x4d40('0x31')]);_0x5b44b0['offset']=qs['offset'](_0x4f92f4[_0x4d40('0x45')]['offset']);}return _0x39ea8e[_0x4d40('0x7f')](_0x5b44b0);}})[_0x4d40('0x36')](function(_0x3df448){if(_0x3df448){return _0x3df448?{'count':_0x346d9c,'rows':_0x3df448}:null;}})[_0x4d40('0x36')](respondWithResult(_0x37ca4d,null))[_0x4d40('0x2b')](handleError(_0x37ca4d,null));};exports[_0x4d40('0x80')]=function(_0x2e2b5a,_0xdeb15b,_0x3efc1a){var _0x456cc6={'channel':'whatsapp'};var _0x3b97e5=[];var _0xbc145=[];var _0x3b3e7a={};return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x2e2b5a[_0x4d40('0x5a')]['id']},'include':[{'model':db[_0x4d40('0x7c')],'as':'Applications'}]})[_0x4d40('0x36')](handleEntityNotFound(_0xdeb15b,null))[_0x4d40('0x36')](function(_0x2b7726){_0x456cc6[_0x4d40('0x81')]=_0x2b7726;_0x456cc6[_0x4d40('0x82')]=_['orderBy'](_0x2b7726['Applications'],[_0x4d40('0x83')],[_0x4d40('0x84')]);if(_0x456cc6[_0x4d40('0x81')][_0x4d40('0x85')]){delete _0x456cc6[_0x4d40('0x81')][_0x4d40('0x85')];}return db[_0x4d40('0x86')][_0x4d40('0x65')]();})[_0x4d40('0x36')](function(_0x177109){if(!_0x177109){throw new db[(_0x4d40('0x21'))]['ValidationError'](_0x4d40('0x87'));}_0x3b97e5=_[_0x4d40('0x88')](_[_0x4d40('0x46')](_0x177109),[_0x4d40('0x89'),_0x4d40('0x8a')]);_0xbc145=_['difference'](_[_0x4d40('0x46')](_0x177109),[_0x4d40('0x89'),'updatedAt','CompanyId',_0x4d40('0x8b')]);_0x456cc6[_0x4d40('0x64')]={'mapKey':_0x4d40('0x8c')};if(_0x456cc6[_0x4d40('0x81')]['type']&&_0x456cc6[_0x4d40('0x81')][_0x4d40('0x8d')]===_0x4d40('0x8e')){_0x456cc6[_0x4d40('0x64')]['from']=_0x2e2b5a[_0x4d40('0x64')][_0x4d40('0x8f')][_0x4d40('0x90')](_0x4d40('0x91'),'');_0x456cc6['body'][_0x4d40('0x64')]=_0x2e2b5a[_0x4d40('0x64')][_0x4d40('0x92')];_0x456cc6['body'][_0x4d40('0x93')]=_0x2e2b5a[_0x4d40('0x64')]['MessageSid'];}if(_0x456cc6[_0x4d40('0x64')]['id']){delete _0x456cc6['body']['id'];}if(_[_0x4d40('0x94')](_0x456cc6[_0x4d40('0x64')]['from'])){throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))](_0x4d40('0x95'));}if(_[_0x4d40('0x94')](_0x456cc6[_0x4d40('0x64')]['body'])||_0x456cc6[_0x4d40('0x64')][_0x4d40('0x64')]===''){throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))](_0x4d40('0x96'));}if(_[_0x4d40('0x94')](_0x456cc6[_0x4d40('0x64')][_0x4d40('0x97')])){throw new db[(_0x4d40('0x21'))]['ValidationError'](_0x4d40('0x98')+_0xbc145);}if(!_[_0x4d40('0x99')](_0xbc145,_0x456cc6[_0x4d40('0x64')][_0x4d40('0x97')])){throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))](_0x4d40('0x9a')+_0xbc145);}_0x3b3e7a[_0x456cc6[_0x4d40('0x64')]['mapKey']]=_0x456cc6[_0x4d40('0x64')][_0x4d40('0x9b')];return db[_0x4d40('0x9c')][_0x4d40('0x5c')]({'where':{'id':_0x456cc6['account'][_0x4d40('0x8b')]},'include':[{'model':db[_0x4d40('0x86')],'as':_0x4d40('0x9d'),'where':_0x3b3e7a,'limit':0x1,'order':[['updatedAt',_0x4d40('0x9e')]]}]});})[_0x4d40('0x36')](handleEntityNotFound(_0xdeb15b,null))[_0x4d40('0x36')](function(_0x193bce){if(_0x193bce){_0x456cc6['list']=_['omit'](_0x193bce,[_0x4d40('0x9d')]);if(_0x193bce['Contacts']['length']){return _0x193bce[_0x4d40('0x9d')][0x0];}var _0x44926f=_[_0x4d40('0x1a')](_0x456cc6[_0x4d40('0x64')],{'firstName':_0x456cc6[_0x4d40('0x64')][_0x4d40('0x9b')],'ListId':_0x193bce['id']});_0x44926f[_0x456cc6[_0x4d40('0x64')][_0x4d40('0x97')]]=_0x456cc6[_0x4d40('0x64')][_0x4d40('0x9b')];return db[_0x4d40('0x86')][_0x4d40('0x5d')](_0x44926f,{'fields':_0x3b97e5,'raw':!![]});}})['then'](handleEntityNotFound(_0xdeb15b,null))[_0x4d40('0x36')](function(_0x383021){if(_0x383021){_0x456cc6[_0x4d40('0x9f')]=_0x383021;var _0x5c06d1={'ContactId':_0x383021['id'],'phone':_0x456cc6[_0x4d40('0x64')]['from'],'WhatsappAccountId':_0x2e2b5a['params']['id']};var _0x4c0533={'ContactId':_0x383021['id'],'WhatsappAccountId':_0x2e2b5a[_0x4d40('0x5a')]['id'],'closed':![]};return db[_0x4d40('0xa0')][_0x4d40('0x5c')]({'where':_0x4c0533})[_0x4d40('0x36')](function(_0x5a5585){if(_0x5a5585){return[_0x5a5585,![]];}return db['WhatsappInteraction'][_0x4d40('0x5d')](_0x5c06d1)[_0x4d40('0x36')](function(_0x1b6207){return[_0x1b6207,!![]];});});}})[_0x4d40('0x74')](function(_0x13a6dc,_0x4f2ecb){_0x456cc6[_0x4d40('0xa1')]=_0x13a6dc['get']({'plain':!![]});_0x456cc6[_0x4d40('0xa1')][_0x4d40('0xa2')]=![];if(_0x4f2ecb){if(_0x456cc6[_0x4d40('0x81')][_0x4d40('0xa3')]){_0x456cc6[_0x4d40('0x82')]['push']({'id':0x0,'priority':_0x456cc6['applications'][_0x4d40('0x5b')]+0x1,'app':_0x4d40('0xa4'),'appdata':_0x4d40('0xa5'),'interval':'*,*,*,*'});}_0x456cc6[_0x4d40('0xa1')]['created']=!![];}return db[_0x4d40('0xa6')][_0x4d40('0x5d')]({'phone':_0x456cc6['body'][_0x4d40('0x9b')],'messageId':_0x456cc6[_0x4d40('0x64')]['messageId'],'body':_0x456cc6['body'][_0x4d40('0x64')],'WhatsappAccountId':_0x2e2b5a[_0x4d40('0x5a')]['id'],'WhatsappInteractionId':_0x13a6dc['id'],'direction':'in','ContactId':_0x13a6dc[_0x4d40('0xa7')],'AttachmentId':_0x456cc6[_0x4d40('0x64')][_0x4d40('0xa8')]});})['then'](function(_0x465da3){_0x456cc6[_0x4d40('0x2a')]=_0x465da3;if(_0x456cc6[_0x4d40('0xa1')][_0x4d40('0xa9')]){return db[_0x4d40('0x78')]['find']({'attributes':['id',_0x4d40('0x3c')],'where':{'id':_0x456cc6[_0x4d40('0xa1')][_0x4d40('0xa9')]}})[_0x4d40('0x36')](function(_0x199885){if(_0x199885){_0x456cc6[_0x4d40('0x82')][_0x4d40('0xaa')]({'id':0x0,'priority':0x0,'app':_0x4d40('0xab'),'appdata':_0x199885[_0x4d40('0x3c')]+','+(_0x456cc6[_0x4d40('0x81')][_0x4d40('0xac')]||0xa),'interval':_0x4d40('0xad')});}return respondWithRpcPromise('Start',_0x4d40('0xae'),_0x456cc6);});}return respondWithRpcPromise(_0x4d40('0xaf'),_0x4d40('0xae'),_0x456cc6);})[_0x4d40('0x36')](function(_0x22cf44){if(_0x22cf44){var _0x1332e3=0xc8;var _0xc86cc2=_0x4d40('0xb0');logger[_0x4d40('0xb1')](_0x4d40('0xb2'),_0xc86cc2,_0x1332e3,_0x4d40('0xb3'));logger[_0x4d40('0xb4')](_0x4d40('0xb5'),_0xc86cc2,_0x1332e3,_0x4d40('0xb3'),JSON[_0x4d40('0x27')](_0x22cf44));if(_0x456cc6[_0x4d40('0x81')][_0x4d40('0x8d')]===_0x4d40('0x8e')){return _0xdeb15b[_0x4d40('0x2d')](_0x1332e3)['set'](_0x4d40('0xb6'),'text/xml')[_0x4d40('0x3d')](_0x4d40('0xb7'));}else{return _0xdeb15b['status'](_0x1332e3)[_0x4d40('0x2f')](_0x22cf44);}}})[_0x4d40('0x2b')](handleError(_0xdeb15b,null));};exports[_0x4d40('0x3d')]=function(_0x50dcda,_0x55774f,_0x47faa9){var _0x2b6cfd,_0x494d0c,_0x296dac;if(_['isNil'](_0x50dcda[_0x4d40('0x64')]['body'])||_0x50dcda['body'][_0x4d40('0x64')]===''){throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4d40('0x94')](_0x50dcda['body']['to'])){throw new db[(_0x4d40('0x21'))][(_0x4d40('0x22'))](_0x4d40('0xb8'));}_0x2b6cfd=_0x50dcda[_0x4d40('0x64')]['to'];return db[_0x4d40('0x42')][_0x4d40('0x5c')]({'where':{'id':_0x50dcda[_0x4d40('0x5a')]['id']},'include':[{'model':db[_0x4d40('0x9c')],'as':_0x4d40('0xb9'),'include':[{'model':db['CmContact'],'as':_0x4d40('0x9d'),'where':{'mobile':_0x2b6cfd},'limit':0x1,'order':[[_0x4d40('0x8a'),_0x4d40('0x9e')]]}]}]})[_0x4d40('0x36')](handleEntityNotFound(_0x55774f,null))[_0x4d40('0x36')](function(_0x5ddcdb){if(_0x5ddcdb&&_0x5ddcdb[_0x4d40('0xb9')]){_0x494d0c=_0x5ddcdb[_0x4d40('0x38')]({'plain':!![]});if(_0x494d0c[_0x4d40('0xb9')]&&_0x494d0c[_0x4d40('0xb9')][_0x4d40('0x9d')][_0x4d40('0x5b')]){return _0x494d0c[_0x4d40('0xb9')][_0x4d40('0x9d')][0x0];}return db['CmContact'][_0x4d40('0x5d')](_[_0x4d40('0x1a')](_0x50dcda[_0x4d40('0x64')],{'firstName':_0x2b6cfd,'mobile':_0x2b6cfd,'phone':_0x2b6cfd,'ListId':_0x494d0c['ListId']}));}})[_0x4d40('0x36')](handleEntityNotFound(_0x55774f,null))[_0x4d40('0x36')](function(_0x523d37){if(_0x523d37){_0x296dac=_0x523d37;return db[_0x4d40('0xa0')]['find']({'where':{'ContactId':_0x296dac['id'],'closed':![],'WhatsappAccountId':_0x494d0c['id']}})[_0x4d40('0x36')](function(_0x558de3){if(_0x558de3){return[_0x558de3,![]];}return db[_0x4d40('0xa0')]['create']({'UserId':_0x50dcda[_0x4d40('0x5e')]['id'],'ContactId':_0x296dac['id'],'WhatsappAccountId':_0x494d0c['id'],'phone':_0x2b6cfd,'firstMsgDirection':_0x4d40('0xba'),'Messages':[_[_0x4d40('0x51')](_0x50dcda[_0x4d40('0x64')],{'read':![],'body':_0x50dcda[_0x4d40('0x64')][_0x4d40('0x64')],'phone':_0x2b6cfd,'WhatsappAccountId':_0x494d0c['id'],'UserId':_0x50dcda[_0x4d40('0x5e')]['id'],'ContactId':_0x296dac['id']})]},{'include':[{'model':db[_0x4d40('0xa6')],'as':_0x4d40('0xbb')}]})[_0x4d40('0x36')](function(_0x53a8ec){return[_0x53a8ec,!![]];});});}})[_0x4d40('0x74')](function(_0x41d30c,_0x2bbfe1){if(_0x2bbfe1){return _0x41d30c;}return db['WhatsappMessage'][_0x4d40('0x5d')](_['merge'](_0x50dcda['body'],{'read':![],'body':_0x50dcda[_0x4d40('0x64')]['body'],'phone':_0x2b6cfd,'WhatsappAccountId':_0x494d0c['id'],'WhatsappInteractionId':_0x41d30c['id'],'UserId':_0x50dcda[_0x4d40('0x5e')]['id'],'ContactId':_0x296dac['id']}))[_0x4d40('0x36')](function(_0x4d1e19){_0x41d30c[_0x4d40('0xbc')]['Messages']=[];_0x41d30c['dataValues']['Messages']['push'](_0x4d1e19[_0x4d40('0xbc')]);return _0x41d30c;});})[_0x4d40('0x36')](respondWithResult(_0x55774f,null))[_0x4d40('0x2b')](handleError(_0x55774f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 4eed78f..b68fe7d 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','update'];(function(_0x9f005d,_0x33165a){var _0x74b899=function(_0x3caf5d){while(--_0x3caf5d){_0x9f005d['push'](_0x9f005d['shift']());}};_0x74b899(++_0x33165a);}(_0x41d0,0x1c6));var _0x041d=function(_0x5cc35f,_0x5acd94){_0x5cc35f=_0x5cc35f-0x0;var _0x3f33eb=_0x41d0[_0x5cc35f];return _0x3f33eb;};'use strict';var EventEmitter=require(_0x041d('0x0'));var WhatsappAccount=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){WhatsappAccountEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);WhatsappAccountEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x041d('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x82c4=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x25656f,_0x4cf8be){var _0x6e703f=function(_0x334697){while(--_0x334697){_0x25656f['push'](_0x25656f['shift']());}};_0x6e703f(++_0x4cf8be);}(_0x82c4,0x1ca));var _0x482c=function(_0x25390b,_0x1771ca){_0x25390b=_0x25390b-0x0;var _0x490180=_0x82c4[_0x25390b];return _0x490180;};'use strict';var EventEmitter=require(_0x482c('0x0'));var WhatsappAccount=require(_0x482c('0x1'))['db'][_0x482c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x482c('0x3')](0x0);var events={'afterCreate':_0x482c('0x4'),'afterUpdate':_0x482c('0x5'),'afterDestroy':_0x482c('0x6')};function emitEvent(_0x56de13){return function(_0x16b0f8,_0x5f4dee,_0x4556c8){WhatsappAccountEvents['emit'](_0x56de13+':'+_0x16b0f8['id'],_0x16b0f8);WhatsappAccountEvents[_0x482c('0x7')](_0x56de13,_0x16b0f8);_0x4556c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x482c('0x8')](e,emitEvent(event));}}module[_0x482c('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a27132a..f7779b8 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cc8=['WhatsappAccount','lodash','util','../../config/logger','bluebird','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x5d76c0,_0x362f06){var _0x15cb7e=function(_0x91bf70){while(--_0x91bf70){_0x5d76c0['push'](_0x5d76c0['shift']());}};_0x15cb7e(++_0x362f06);}(_0x6cc8,0x169));var _0x86cc=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x6cc8[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x86cc('0x0'));var util=require(_0x86cc('0x1'));var logger=require(_0x86cc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x86cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x86cc('0x4'));var attributes=require(_0x86cc('0x5'));module[_0x86cc('0x6')]=function(_0x4886b3,_0x258cbd){return _0x4886b3[_0x86cc('0x7')](_0x86cc('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c1e=['util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','whatsapp_accounts','lodash'];(function(_0x1114b1,_0x4c4343){var _0x362af8=function(_0x5d3733){while(--_0x5d3733){_0x1114b1['push'](_0x1114b1['shift']());}};_0x362af8(++_0x4c4343);}(_0x1c1e,0x95));var _0xe1c1=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x1c1e[_0x587fb5];return _0x551105;};'use strict';var _=require(_0xe1c1('0x0'));var util=require(_0xe1c1('0x1'));var logger=require('../../config/logger')(_0xe1c1('0x2'));var moment=require(_0xe1c1('0x3'));var BPromise=require(_0xe1c1('0x4'));var rp=require(_0xe1c1('0x5'));var fs=require('fs');var path=require(_0xe1c1('0x6'));var rimraf=require('rimraf');var config=require(_0xe1c1('0x7'));var attributes=require(_0xe1c1('0x8'));module['exports']=function(_0x3a244a,_0x5855cc){return _0x3a244a['define']('WhatsappAccount',attributes,{'tableName':_0xe1c1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index dcd3e7c..226c00d 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16e8=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1ad759,_0x534529){var _0x553a8e=function(_0x16f8ec){while(--_0x16f8ec){_0x1ad759['push'](_0x1ad759['shift']());}};_0x553a8e(++_0x534529);}(_0x16e8,0x106));var _0x816e=function(_0x30b49c,_0x4dcce5){_0x30b49c=_0x30b49c-0x0;var _0x2b2f63=_0x16e8[_0x30b49c];return _0x2b2f63;};'use strict';var _=require('lodash');var util=require(_0x816e('0x0'));var moment=require(_0x816e('0x1'));var BPromise=require(_0x816e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x816e('0x3'));var db=require(_0x816e('0x4'))['db'];var utils=require(_0x816e('0x5'));var logger=require('../../config/logger')(_0x816e('0x6'));var config=require('../../config/environment');var jayson=require(_0x816e('0x7'));var client=jayson['client'][_0x816e('0x8')]({'port':0x232a});config['redis']=_[_0x816e('0x9')](config[_0x816e('0xa')],{'host':_0x816e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x816e('0xa')]));require('./whatsappAccount.socket')[_0x816e('0xc')](socket);function respondWithRpcPromise(_0x49a325,_0x58b814,_0x2210fe){return new BPromise(function(_0x337372,_0x3e355d){return client[_0x816e('0xd')](_0x49a325,_0x2210fe)[_0x816e('0xe')](function(_0x38e4cd){logger[_0x816e('0xf')](_0x816e('0x10'),_0x58b814,_0x816e('0x11'));logger[_0x816e('0x12')](_0x816e('0x13'),_0x58b814,_0x816e('0x11'),JSON[_0x816e('0x14')](_0x38e4cd));if(_0x38e4cd[_0x816e('0x15')]){if(_0x38e4cd[_0x816e('0x15')][_0x816e('0x16')]===0x1f4){logger[_0x816e('0x15')](_0x816e('0x10'),_0x58b814,_0x38e4cd[_0x816e('0x15')][_0x816e('0x17')]);return _0x3e355d(_0x38e4cd['error'][_0x816e('0x17')]);}logger['error'](_0x816e('0x10'),_0x58b814,_0x38e4cd[_0x816e('0x15')][_0x816e('0x17')]);return _0x337372(_0x38e4cd[_0x816e('0x15')][_0x816e('0x17')]);}else{logger[_0x816e('0xf')](_0x816e('0x10'),_0x58b814,'request\x20sent');_0x337372(_0x38e4cd[_0x816e('0x18')][_0x816e('0x17')]);}})[_0x816e('0x19')](function(_0x3d471b){logger[_0x816e('0x15')](_0x816e('0x10'),_0x58b814,_0x3d471b);_0x3e355d(_0x3d471b);});});}exports[_0x816e('0x1a')]=function(_0x5020b2){var _0x156b25=this;return new Promise(function(_0x353d0b,_0x435f49){return db[_0x816e('0x1b')]['find']({'raw':_0x5020b2[_0x816e('0x1c')]?_0x5020b2[_0x816e('0x1c')][_0x816e('0x1d')]===undefined?!![]:![]:!![],'where':_0x5020b2['options']?_0x5020b2[_0x816e('0x1c')][_0x816e('0x1e')]||null:null,'attributes':_0x5020b2[_0x816e('0x1c')]?_0x5020b2[_0x816e('0x1c')][_0x816e('0x1f')]||null:null,'include':_0x5020b2[_0x816e('0x1c')]?_0x5020b2[_0x816e('0x1c')][_0x816e('0x20')]?_[_0x816e('0x21')](_0x5020b2[_0x816e('0x1c')][_0x816e('0x20')],function(_0x3f9c82){return{'model':db[_0x3f9c82[_0x816e('0x22')]],'as':_0x3f9c82['as'],'attributes':_0x3f9c82[_0x816e('0x1f')],'include':_0x3f9c82[_0x816e('0x20')]?_[_0x816e('0x21')](_0x3f9c82[_0x816e('0x20')],function(_0xd57ebf){return{'model':db[_0xd57ebf[_0x816e('0x22')]],'as':_0xd57ebf['as'],'attributes':_0xd57ebf[_0x816e('0x1f')],'include':_0xd57ebf[_0x816e('0x20')]?_[_0x816e('0x21')](_0xd57ebf[_0x816e('0x20')],function(_0x2ad4b4){return{'model':db[_0x2ad4b4['model']],'as':_0x2ad4b4['as'],'attributes':_0x2ad4b4[_0x816e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x816e('0xe')](function(_0x23c280){logger[_0x816e('0xf')](_0x816e('0x1a'),_0x5020b2);logger[_0x816e('0x12')](_0x816e('0x1a'),_0x5020b2,JSON[_0x816e('0x14')](_0x23c280));_0x353d0b(_0x23c280);})['catch'](function(_0x1fc66e){logger['error'](_0x816e('0x1a'),_0x1fc66e[_0x816e('0x17')],_0x5020b2);_0x435f49(_0x156b25[_0x816e('0x15')](0x1f4,_0x1fc66e[_0x816e('0x17')]));});});}; \ No newline at end of file +var _0xc3fa=['redis','localhost','socket.io-emitter','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','include','map','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3fa,0x9f));var _0xac3f=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xc3fa[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0xac3f('0x0'));var util=require(_0xac3f('0x1'));var moment=require(_0xac3f('0x2'));var BPromise=require(_0xac3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac3f('0x4'));var db=require(_0xac3f('0x5'))['db'];var utils=require(_0xac3f('0x6'));var logger=require(_0xac3f('0x7'))('rpc');var config=require(_0xac3f('0x8'));var jayson=require(_0xac3f('0x9'));var client=jayson['client'][_0xac3f('0xa')]({'port':0x232a});config[_0xac3f('0xb')]=_['defaults'](config[_0xac3f('0xb')],{'host':_0xac3f('0xc'),'port':0x18eb});var socket=require(_0xac3f('0xd'))(new Redis(config[_0xac3f('0xb')]));require('./whatsappAccount.socket')[_0xac3f('0xe')](socket);function respondWithRpcPromise(_0x14f555,_0x58f4f8,_0xbb93ab){return new BPromise(function(_0x4039ab,_0x1901f9){return client['request'](_0x14f555,_0xbb93ab)[_0xac3f('0xf')](function(_0x31cdbb){logger[_0xac3f('0x10')](_0xac3f('0x11'),_0x58f4f8,'request\x20sent');logger[_0xac3f('0x12')](_0xac3f('0x13'),_0x58f4f8,_0xac3f('0x14'),JSON[_0xac3f('0x15')](_0x31cdbb));if(_0x31cdbb['error']){if(_0x31cdbb['error'][_0xac3f('0x16')]===0x1f4){logger[_0xac3f('0x17')](_0xac3f('0x11'),_0x58f4f8,_0x31cdbb[_0xac3f('0x17')][_0xac3f('0x18')]);return _0x1901f9(_0x31cdbb[_0xac3f('0x17')][_0xac3f('0x18')]);}logger[_0xac3f('0x17')](_0xac3f('0x11'),_0x58f4f8,_0x31cdbb[_0xac3f('0x17')][_0xac3f('0x18')]);return _0x4039ab(_0x31cdbb[_0xac3f('0x17')][_0xac3f('0x18')]);}else{logger['info'](_0xac3f('0x11'),_0x58f4f8,_0xac3f('0x14'));_0x4039ab(_0x31cdbb['result'][_0xac3f('0x18')]);}})[_0xac3f('0x19')](function(_0xdce7c1){logger[_0xac3f('0x17')](_0xac3f('0x11'),_0x58f4f8,_0xdce7c1);_0x1901f9(_0xdce7c1);});});}exports[_0xac3f('0x1a')]=function(_0x5925e7){var _0x372cec=this;return new Promise(function(_0x326b37,_0x2b3307){return db[_0xac3f('0x1b')][_0xac3f('0x1c')]({'raw':_0x5925e7[_0xac3f('0x1d')]?_0x5925e7[_0xac3f('0x1d')][_0xac3f('0x1e')]===undefined?!![]:![]:!![],'where':_0x5925e7['options']?_0x5925e7[_0xac3f('0x1d')]['where']||null:null,'attributes':_0x5925e7[_0xac3f('0x1d')]?_0x5925e7['options']['attributes']||null:null,'include':_0x5925e7[_0xac3f('0x1d')]?_0x5925e7[_0xac3f('0x1d')][_0xac3f('0x1f')]?_[_0xac3f('0x20')](_0x5925e7[_0xac3f('0x1d')][_0xac3f('0x1f')],function(_0x23aa7b){return{'model':db[_0x23aa7b['model']],'as':_0x23aa7b['as'],'attributes':_0x23aa7b['attributes'],'include':_0x23aa7b[_0xac3f('0x1f')]?_[_0xac3f('0x20')](_0x23aa7b[_0xac3f('0x1f')],function(_0x38b42e){return{'model':db[_0x38b42e['model']],'as':_0x38b42e['as'],'attributes':_0x38b42e[_0xac3f('0x21')],'include':_0x38b42e[_0xac3f('0x1f')]?_[_0xac3f('0x20')](_0x38b42e['include'],function(_0x221549){return{'model':db[_0x221549['model']],'as':_0x221549['as'],'attributes':_0x221549['attributes']};}):[]};}):[]};}):[]:[]})[_0xac3f('0xf')](function(_0x20cf1d){logger[_0xac3f('0x10')](_0xac3f('0x1a'),_0x5925e7);logger[_0xac3f('0x12')](_0xac3f('0x1a'),_0x5925e7,JSON[_0xac3f('0x15')](_0x20cf1d));_0x326b37(_0x20cf1d);})[_0xac3f('0x19')](function(_0x5a18e0){logger[_0xac3f('0x17')](_0xac3f('0x1a'),_0x5a18e0['message'],_0x5925e7);_0x2b3307(_0x372cec['error'](0x1f4,_0x5a18e0[_0xac3f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 28118ae..3a4fe32 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e9b=['emit','register','length','whatsappAccount:','remove','update'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x2e9b,0xd0));var _0xb2e9=function(_0x50a627,_0xb78c80){_0x50a627=_0x50a627-0x0;var _0x1677cf=_0x2e9b[_0x50a627];return _0x1677cf;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xb2e9('0x0'),_0xb2e9('0x1')];function createListener(_0x340341,_0x458202){return function(_0x549970){_0x458202[_0xb2e9('0x2')](_0x340341,_0x549970);};}function removeListener(_0x46b974,_0x7bcfe2){return function(){WhatsappAccountEvents['removeListener'](_0x46b974,_0x7bcfe2);};}exports[_0xb2e9('0x3')]=function(_0x5b85cc){for(var _0x191f76=0x0,_0x29e339=events[_0xb2e9('0x4')];_0x191f76<_0x29e339;_0x191f76++){var _0xeb22e8=events[_0x191f76];var _0x5eb854=createListener(_0xb2e9('0x5')+_0xeb22e8,_0x5b85cc);WhatsappAccountEvents['on'](_0xeb22e8,_0x5eb854);}}; \ No newline at end of file +var _0x50ce=['update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove'];(function(_0x471393,_0x1776e6){var _0x143908=function(_0x22fccb){while(--_0x22fccb){_0x471393['push'](_0x471393['shift']());}};_0x143908(++_0x1776e6);}(_0x50ce,0x136));var _0xe50c=function(_0x12ba3d,_0x5eae0d){_0x12ba3d=_0x12ba3d-0x0;var _0x178544=_0x50ce[_0x12ba3d];return _0x178544;};'use strict';var WhatsappAccountEvents=require(_0xe50c('0x0'));var events=['save',_0xe50c('0x1'),_0xe50c('0x2')];function createListener(_0x3740e7,_0x2f7d6c){return function(_0x43d693){_0x2f7d6c[_0xe50c('0x3')](_0x3740e7,_0x43d693);};}function removeListener(_0x3c8de1,_0x5c2ae0){return function(){WhatsappAccountEvents[_0xe50c('0x4')](_0x3c8de1,_0x5c2ae0);};}exports[_0xe50c('0x5')]=function(_0x205397){for(var _0x51567e=0x0,_0x2803e9=events[_0xe50c('0x6')];_0x51567e<_0x2803e9;_0x51567e++){var _0x5bfadb=events[_0x51567e];var _0x327154=createListener(_0xe50c('0x7')+_0x5bfadb,_0x205397);WhatsappAccountEvents['on'](_0x5bfadb,_0x327154);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e3a7f23..eb741dd 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x711b=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x8f4439,_0x52fc0f){var _0x21aabc=function(_0x34c8a5){while(--_0x34c8a5){_0x8f4439['push'](_0x8f4439['shift']());}};_0x21aabc(++_0x52fc0f);}(_0x711b,0x16a));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb711('0x0'));var util=require(_0xb711('0x1'));var path=require(_0xb711('0x2'));var timeout=require(_0xb711('0x3'));var express=require(_0xb711('0x4'));var router=express[_0xb711('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb711('0x6'));var config=require(_0xb711('0x7'));var controller=require(_0xb711('0x8'));router[_0xb711('0x9')]('/',auth['isAuthenticated'](),controller[_0xb711('0xa')]);router['get'](_0xb711('0xb'),auth[_0xb711('0xc')](),controller[_0xb711('0xd')]);router[_0xb711('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb711('0xf')](_0xb711('0xb'),auth[_0xb711('0xc')](),controller[_0xb711('0x10')]);router[_0xb711('0x11')](_0xb711('0xb'),auth[_0xb711('0xc')](),controller['destroy']);module[_0xb711('0x12')]=router; \ No newline at end of file +var _0x13f6=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete'];(function(_0x226c11,_0x14c0a4){var _0x4dc73e=function(_0x17e242){while(--_0x17e242){_0x226c11['push'](_0x226c11['shift']());}};_0x4dc73e(++_0x14c0a4);}(_0x13f6,0x1cb));var _0x613f=function(_0x1b5fbe,_0x5b57e1){_0x1b5fbe=_0x1b5fbe-0x0;var _0x1d0f55=_0x13f6[_0x1b5fbe];return _0x1d0f55;};'use strict';var multer=require(_0x613f('0x0'));var util=require('util');var path=require(_0x613f('0x1'));var timeout=require(_0x613f('0x2'));var express=require(_0x613f('0x3'));var router=express[_0x613f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router[_0x613f('0x8')]('/',auth['isAuthenticated'](),controller[_0x613f('0x9')]);router['get'](_0x613f('0xa'),auth[_0x613f('0xb')](),controller[_0x613f('0xc')]);router[_0x613f('0xd')]('/',auth['isAuthenticated'](),controller[_0x613f('0xe')]);router['put']('/:id',auth[_0x613f('0xb')](),controller[_0x613f('0xf')]);router[_0x613f('0x10')]('/:id',auth[_0x613f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 51da5ff..90e397e 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a98=['noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x2edd3f,_0x514bee){var _0x1026b3=function(_0x11a8ec){while(--_0x11a8ec){_0x2edd3f['push'](_0x2edd3f['shift']());}};_0x1026b3(++_0x514bee);}(_0x7a98,0x190));var _0x87a9=function(_0x197415,_0x166cd0){_0x197415=_0x197415-0x0;var _0x55d65c=_0x7a98[_0x197415];return _0x55d65c;};'use strict';var Sequelize=require(_0x87a9('0x0'));module[_0x87a9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x87a9('0x2')},'appdata':{'type':Sequelize[_0x87a9('0x3')]()},'description':{'type':Sequelize[_0x87a9('0x4')]},'interval':{'type':Sequelize[_0x87a9('0x4')],'defaultValue':_0x87a9('0x5')}}; \ No newline at end of file +var _0x27bb=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x27bb,0x103));var _0xb27b=function(_0x32e53c,_0x2d5617){_0x32e53c=_0x32e53c-0x0;var _0xd5c18b=_0x27bb[_0x32e53c];return _0xd5c18b;};'use strict';var Sequelize=require('sequelize');module[_0xb27b('0x0')]={'priority':{'type':Sequelize[_0xb27b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb27b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb27b('0x3')]()},'description':{'type':Sequelize[_0xb27b('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb27b('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e08ce15..2e8c0b3 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1efa=['sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','error','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x20ea89,_0x1bfce6){var _0x1f06a8=function(_0xc541ce){while(--_0xc541ce){_0x20ea89['push'](_0x20ea89['shift']());}};_0x1f06a8(++_0x1bfce6);}(_0x1efa,0x10c));var _0xa1ef=function(_0x3fa96e,_0x577a78){_0x3fa96e=_0x3fa96e-0x0;var _0x3067ae=_0x1efa[_0x3fa96e];return _0x3067ae;};'use strict';var pdf=require(_0xa1ef('0x0'));var emlformat=require(_0xa1ef('0x1'));var rimraf=require(_0xa1ef('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1ef('0x3'));var rp=require(_0xa1ef('0x4'));var moment=require('moment');var BPromise=require(_0xa1ef('0x5'));var Mustache=require('mustache');var util=require(_0xa1ef('0x6'));var path=require(_0xa1ef('0x7'));var sox=require(_0xa1ef('0x8'));var csv=require(_0xa1ef('0x9'));var ejs=require(_0xa1ef('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa1ef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa1ef('0xc'));var toCsv=require(_0xa1ef('0x9'));var querystring=require(_0xa1ef('0xd'));var Papa=require(_0xa1ef('0xe'));var Redis=require('ioredis');var authService=require(_0xa1ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa1ef('0x10'));var hardwareService=require(_0xa1ef('0x11'));var logger=require(_0xa1ef('0x12'))(_0xa1ef('0x13'));var utils=require(_0xa1ef('0x14'));var config=require(_0xa1ef('0x15'));var db=require(_0xa1ef('0x16'))['db'];function respondWithStatusCode(_0x42afaf,_0x35780b){_0x35780b=_0x35780b||0xcc;return function(_0x35ffc8){if(_0x35ffc8){return _0x42afaf[_0xa1ef('0x17')](_0x35780b);}return _0x42afaf[_0xa1ef('0x18')](_0x35780b)[_0xa1ef('0x19')]();};}function respondWithResult(_0x4e115c,_0xe91a49){_0xe91a49=_0xe91a49||0xc8;return function(_0x29e7c4){if(_0x29e7c4){return _0x4e115c[_0xa1ef('0x18')](_0xe91a49)[_0xa1ef('0x1a')](_0x29e7c4);}};}function respondWithFilteredResult(_0x5dfefd,_0x3d3689){return function(_0x1a8d8e){if(_0x1a8d8e){var _0x6dc80d=_0x1a8d8e[_0xa1ef('0x1b')],_0x246ff5=_0x3d3689['offset'],_0x1f149a=_0x3d3689[_0xa1ef('0x1c')]+_0x3d3689[_0xa1ef('0x1d')],_0x2bec70;if(_0x1f149a>=_0x6dc80d){_0x1f149a=_0x6dc80d;_0x2bec70=0xc8;}else{_0x2bec70=0xce;}_0x5dfefd[_0xa1ef('0x18')](_0x2bec70);return _0x5dfefd[_0xa1ef('0x1e')](_0xa1ef('0x1f'),_0x246ff5+'-'+_0x1f149a+'/'+_0x6dc80d)[_0xa1ef('0x1a')](_0x1a8d8e);}return null;};}function patchUpdates(_0xc2546a){return function(_0x4b5545){try{jsonpatch['apply'](_0x4b5545,_0xc2546a,!![]);}catch(_0x560a6c){return BPromise['reject'](_0x560a6c);}return _0x4b5545['save']();};}function saveUpdates(_0x73c015,_0x8e9a91){return function(_0xc8d2df){if(_0xc8d2df){return _0xc8d2df[_0xa1ef('0x20')](_0x73c015)[_0xa1ef('0x21')](function(_0xf66bb3){return _0xf66bb3;});}return null;};}function removeEntity(_0x123798,_0x57404f){return function(_0x4698b3){if(_0x4698b3){return _0x4698b3['destroy']()['then'](function(){_0x123798[_0xa1ef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21466c,_0x12a4e2){return function(_0x886e2f){if(!_0x886e2f){_0x21466c[_0xa1ef('0x17')](0x194);}return _0x886e2f;};}function handleError(_0x4b2452,_0x3c1cdd){_0x3c1cdd=_0x3c1cdd||0x1f4;return function(_0x243b30){logger[_0xa1ef('0x22')](_0x243b30['stack']);if(_0x243b30[_0xa1ef('0x23')]){delete _0x243b30[_0xa1ef('0x23')];}_0x4b2452[_0xa1ef('0x18')](_0x3c1cdd)['send'](_0x243b30);};}exports['index']=function(_0x19526f,_0x5ca5c7){var _0x4bd053={},_0xd16215={},_0x4c8a79={'count':0x0,'rows':[]};var _0x5e3ed1=_[_0xa1ef('0x24')](db[_0xa1ef('0x25')][_0xa1ef('0x26')],function(_0x1e30c7){return{'name':_0x1e30c7[_0xa1ef('0x27')],'type':_0x1e30c7[_0xa1ef('0x28')][_0xa1ef('0x29')]};});_0xd16215[_0xa1ef('0x2a')]=_['map'](_0x5e3ed1,'name');_0xd16215[_0xa1ef('0x2b')]=_[_0xa1ef('0x2c')](_0x19526f[_0xa1ef('0x2b')]);_0xd16215[_0xa1ef('0x2d')]=_[_0xa1ef('0x2e')](_0xd16215[_0xa1ef('0x2a')],_0xd16215[_0xa1ef('0x2b')]);_0x4bd053[_0xa1ef('0x2f')]=_[_0xa1ef('0x2e')](_0xd16215[_0xa1ef('0x2a')],qs[_0xa1ef('0x30')](_0x19526f['query'][_0xa1ef('0x30')]));_0x4bd053[_0xa1ef('0x2f')]=_0x4bd053[_0xa1ef('0x2f')]['length']?_0x4bd053[_0xa1ef('0x2f')]:_0xd16215['model'];if(!_0x19526f[_0xa1ef('0x2b')][_0xa1ef('0x31')]('nolimit')){_0x4bd053[_0xa1ef('0x1d')]=qs[_0xa1ef('0x1d')](_0x19526f[_0xa1ef('0x2b')]['limit']);_0x4bd053['offset']=qs[_0xa1ef('0x1c')](_0x19526f[_0xa1ef('0x2b')][_0xa1ef('0x1c')]);}_0x4bd053[_0xa1ef('0x32')]=qs['sort'](_0x19526f[_0xa1ef('0x2b')][_0xa1ef('0x33')]);_0x4bd053['where']=qs[_0xa1ef('0x2d')](_[_0xa1ef('0x34')](_0x19526f[_0xa1ef('0x2b')],_0xd16215[_0xa1ef('0x2d')]),_0x5e3ed1);if(_0x19526f[_0xa1ef('0x2b')][_0xa1ef('0x35')]){_0x4bd053[_0xa1ef('0x36')]=_[_0xa1ef('0x37')](_0x4bd053[_0xa1ef('0x36')],{'$or':_[_0xa1ef('0x24')](_0x5e3ed1,function(_0x125b98){if(_0x125b98[_0xa1ef('0x28')]!=='VIRTUAL'){var _0x215f20={};_0x215f20[_0x125b98['name']]={'$like':'%'+_0x19526f['query'][_0xa1ef('0x35')]+'%'};return _0x215f20;}})});}_0x4bd053=_[_0xa1ef('0x37')]({},_0x4bd053,_0x19526f[_0xa1ef('0x38')]);var _0x3dbee2={'where':_0x4bd053[_0xa1ef('0x36')]};return db[_0xa1ef('0x25')][_0xa1ef('0x1b')](_0x3dbee2)[_0xa1ef('0x21')](function(_0x2f08e7){_0x4c8a79[_0xa1ef('0x1b')]=_0x2f08e7;if(_0x19526f[_0xa1ef('0x2b')]['includeAll']){_0x4bd053[_0xa1ef('0x39')]=[{'all':!![]}];}return db[_0xa1ef('0x25')][_0xa1ef('0x3a')](_0x4bd053);})[_0xa1ef('0x21')](function(_0x5c6551){_0x4c8a79[_0xa1ef('0x3b')]=_0x5c6551;return _0x4c8a79;})[_0xa1ef('0x21')](respondWithFilteredResult(_0x5ca5c7,_0x4bd053))[_0xa1ef('0x3c')](handleError(_0x5ca5c7,null));};exports[_0xa1ef('0x3d')]=function(_0x1175e6,_0x3ff011){var _0x37b6c2={'raw':!![],'where':{'id':_0x1175e6[_0xa1ef('0x3e')]['id']}},_0x3bbbbf={};_0x3bbbbf[_0xa1ef('0x2a')]=_[_0xa1ef('0x2c')](db[_0xa1ef('0x25')]['rawAttributes']);_0x3bbbbf[_0xa1ef('0x2b')]=_['keys'](_0x1175e6['query']);_0x3bbbbf[_0xa1ef('0x2d')]=_['intersection'](_0x3bbbbf[_0xa1ef('0x2a')],_0x3bbbbf[_0xa1ef('0x2b')]);_0x37b6c2[_0xa1ef('0x2f')]=_[_0xa1ef('0x2e')](_0x3bbbbf[_0xa1ef('0x2a')],qs['fields'](_0x1175e6[_0xa1ef('0x2b')]['fields']));_0x37b6c2['attributes']=_0x37b6c2['attributes'][_0xa1ef('0x3f')]?_0x37b6c2[_0xa1ef('0x2f')]:_0x3bbbbf[_0xa1ef('0x2a')];if(_0x1175e6['query'][_0xa1ef('0x40')]){_0x37b6c2[_0xa1ef('0x39')]=[{'all':!![]}];}_0x37b6c2=_['merge']({},_0x37b6c2,_0x1175e6[_0xa1ef('0x38')]);return db['WhatsappApplication']['find'](_0x37b6c2)[_0xa1ef('0x21')](handleEntityNotFound(_0x3ff011,null))[_0xa1ef('0x21')](respondWithResult(_0x3ff011,null))[_0xa1ef('0x3c')](handleError(_0x3ff011,null));};exports['create']=function(_0x3df2fd,_0x4a0af0){return db['WhatsappApplication'][_0xa1ef('0x41')](_0x3df2fd[_0xa1ef('0x42')],{})[_0xa1ef('0x21')](respondWithResult(_0x4a0af0,0xc9))[_0xa1ef('0x3c')](handleError(_0x4a0af0,null));};exports[_0xa1ef('0x20')]=function(_0x3c9064,_0x6b80b6){if(_0x3c9064[_0xa1ef('0x42')]['id']){delete _0x3c9064['body']['id'];}return db[_0xa1ef('0x25')][_0xa1ef('0x43')]({'where':{'id':_0x3c9064[_0xa1ef('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6b80b6,null))['then'](saveUpdates(_0x3c9064[_0xa1ef('0x42')],null))['then'](respondWithResult(_0x6b80b6,null))[_0xa1ef('0x3c')](handleError(_0x6b80b6,null));};exports[_0xa1ef('0x44')]=function(_0x2c26e3,_0x1a32d2){return db[_0xa1ef('0x25')]['find']({'where':{'id':_0x2c26e3[_0xa1ef('0x3e')]['id']}})[_0xa1ef('0x21')](handleEntityNotFound(_0x1a32d2,null))[_0xa1ef('0x21')](removeEntity(_0x1a32d2,null))[_0xa1ef('0x3c')](handleError(_0x1a32d2,null));}; \ No newline at end of file +var _0x25f9=['pick','filter','VIRTUAL','options','then','includeAll','findAll','rows','show','length','include','find','catch','create','body','update','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','destroy','end','error','stack','name','send','map','WhatsappApplication','rawAttributes','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x541c48,_0x314e5a){var _0x18826e=function(_0x1efbd6){while(--_0x1efbd6){_0x541c48['push'](_0x541c48['shift']());}};_0x18826e(++_0x314e5a);}(_0x25f9,0x1f4));var _0x925f=function(_0x2704e4,_0x17696f){_0x2704e4=_0x2704e4-0x0;var _0x247152=_0x25f9[_0x2704e4];return _0x247152;};'use strict';var pdf=require(_0x925f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x925f('0x1'));var zipdir=require(_0x925f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x925f('0x3'));var moment=require(_0x925f('0x4'));var BPromise=require(_0x925f('0x5'));var Mustache=require(_0x925f('0x6'));var util=require('util');var path=require(_0x925f('0x7'));var sox=require(_0x925f('0x8'));var csv=require(_0x925f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x925f('0xa'));var squel=require(_0x925f('0xb'));var crypto=require(_0x925f('0xc'));var jsforce=require(_0x925f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x925f('0x9'));var querystring=require('querystring');var Papa=require(_0x925f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x925f('0xf'));var as=require(_0x925f('0x10'));var hardwareService=require(_0x925f('0x11'));var logger=require(_0x925f('0x12'))(_0x925f('0x13'));var utils=require(_0x925f('0x14'));var config=require(_0x925f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6f2eab,_0x434c14){_0x434c14=_0x434c14||0xcc;return function(_0x4828ed){if(_0x4828ed){return _0x6f2eab[_0x925f('0x16')](_0x434c14);}return _0x6f2eab[_0x925f('0x17')](_0x434c14)['end']();};}function respondWithResult(_0x35684f,_0x5f32f4){_0x5f32f4=_0x5f32f4||0xc8;return function(_0x5404ed){if(_0x5404ed){return _0x35684f[_0x925f('0x17')](_0x5f32f4)[_0x925f('0x18')](_0x5404ed);}};}function respondWithFilteredResult(_0x2fb278,_0x1d3cf8){return function(_0x4a9109){if(_0x4a9109){var _0x171b09=_0x4a9109[_0x925f('0x19')],_0x1c8c36=_0x1d3cf8[_0x925f('0x1a')],_0x1abc1f=_0x1d3cf8[_0x925f('0x1a')]+_0x1d3cf8[_0x925f('0x1b')],_0xb89f8c;if(_0x1abc1f>=_0x171b09){_0x1abc1f=_0x171b09;_0xb89f8c=0xc8;}else{_0xb89f8c=0xce;}_0x2fb278[_0x925f('0x17')](_0xb89f8c);return _0x2fb278['set'](_0x925f('0x1c'),_0x1c8c36+'-'+_0x1abc1f+'/'+_0x171b09)[_0x925f('0x18')](_0x4a9109);}return null;};}function patchUpdates(_0x82e848){return function(_0xa34945){try{jsonpatch[_0x925f('0x1d')](_0xa34945,_0x82e848,!![]);}catch(_0x248d76){return BPromise['reject'](_0x248d76);}return _0xa34945[_0x925f('0x1e')]();};}function saveUpdates(_0x2fc15d,_0x965454){return function(_0x66149e){if(_0x66149e){return _0x66149e['update'](_0x2fc15d)['then'](function(_0x33ff48){return _0x33ff48;});}return null;};}function removeEntity(_0x297a1a,_0x31a740){return function(_0x5d3da4){if(_0x5d3da4){return _0x5d3da4[_0x925f('0x1f')]()['then'](function(){_0x297a1a['status'](0xcc)[_0x925f('0x20')]();});}};}function handleEntityNotFound(_0x497d26,_0x37d0e3){return function(_0x234371){if(!_0x234371){_0x497d26['sendStatus'](0x194);}return _0x234371;};}function handleError(_0x28fc8f,_0x77a5c6){_0x77a5c6=_0x77a5c6||0x1f4;return function(_0x34125e){logger[_0x925f('0x21')](_0x34125e[_0x925f('0x22')]);if(_0x34125e[_0x925f('0x23')]){delete _0x34125e['name'];}_0x28fc8f[_0x925f('0x17')](_0x77a5c6)[_0x925f('0x24')](_0x34125e);};}exports['index']=function(_0x3f64be,_0x224ad5){var _0x515259={},_0x3b8ecb={},_0x264227={'count':0x0,'rows':[]};var _0x5bd68e=_[_0x925f('0x25')](db[_0x925f('0x26')][_0x925f('0x27')],function(_0x69eb40){return{'name':_0x69eb40['fieldName'],'type':_0x69eb40[_0x925f('0x28')]['key']};});_0x3b8ecb[_0x925f('0x29')]=_[_0x925f('0x25')](_0x5bd68e,_0x925f('0x23'));_0x3b8ecb['query']=_[_0x925f('0x2a')](_0x3f64be[_0x925f('0x2b')]);_0x3b8ecb['filters']=_[_0x925f('0x2c')](_0x3b8ecb['model'],_0x3b8ecb[_0x925f('0x2b')]);_0x515259[_0x925f('0x2d')]=_[_0x925f('0x2c')](_0x3b8ecb[_0x925f('0x29')],qs[_0x925f('0x2e')](_0x3f64be[_0x925f('0x2b')][_0x925f('0x2e')]));_0x515259[_0x925f('0x2d')]=_0x515259[_0x925f('0x2d')]['length']?_0x515259[_0x925f('0x2d')]:_0x3b8ecb[_0x925f('0x29')];if(!_0x3f64be[_0x925f('0x2b')][_0x925f('0x2f')](_0x925f('0x30'))){_0x515259[_0x925f('0x1b')]=qs[_0x925f('0x1b')](_0x3f64be[_0x925f('0x2b')][_0x925f('0x1b')]);_0x515259['offset']=qs[_0x925f('0x1a')](_0x3f64be[_0x925f('0x2b')][_0x925f('0x1a')]);}_0x515259['order']=qs[_0x925f('0x31')](_0x3f64be[_0x925f('0x2b')][_0x925f('0x31')]);_0x515259[_0x925f('0x32')]=qs[_0x925f('0x33')](_[_0x925f('0x34')](_0x3f64be[_0x925f('0x2b')],_0x3b8ecb['filters']),_0x5bd68e);if(_0x3f64be[_0x925f('0x2b')][_0x925f('0x35')]){_0x515259[_0x925f('0x32')]=_['merge'](_0x515259['where'],{'$or':_[_0x925f('0x25')](_0x5bd68e,function(_0x58e963){if(_0x58e963[_0x925f('0x28')]!==_0x925f('0x36')){var _0x17610a={};_0x17610a[_0x58e963['name']]={'$like':'%'+_0x3f64be[_0x925f('0x2b')][_0x925f('0x35')]+'%'};return _0x17610a;}})});}_0x515259=_['merge']({},_0x515259,_0x3f64be[_0x925f('0x37')]);var _0x26622c={'where':_0x515259[_0x925f('0x32')]};return db[_0x925f('0x26')]['count'](_0x26622c)[_0x925f('0x38')](function(_0x3b53f0){_0x264227[_0x925f('0x19')]=_0x3b53f0;if(_0x3f64be[_0x925f('0x2b')][_0x925f('0x39')]){_0x515259['include']=[{'all':!![]}];}return db[_0x925f('0x26')][_0x925f('0x3a')](_0x515259);})[_0x925f('0x38')](function(_0x92449){_0x264227[_0x925f('0x3b')]=_0x92449;return _0x264227;})[_0x925f('0x38')](respondWithFilteredResult(_0x224ad5,_0x515259))['catch'](handleError(_0x224ad5,null));};exports[_0x925f('0x3c')]=function(_0x1f6e30,_0x7b821c){var _0x525ebf={'raw':!![],'where':{'id':_0x1f6e30['params']['id']}},_0x38b58a={};_0x38b58a[_0x925f('0x29')]=_[_0x925f('0x2a')](db[_0x925f('0x26')][_0x925f('0x27')]);_0x38b58a[_0x925f('0x2b')]=_[_0x925f('0x2a')](_0x1f6e30['query']);_0x38b58a[_0x925f('0x33')]=_[_0x925f('0x2c')](_0x38b58a['model'],_0x38b58a[_0x925f('0x2b')]);_0x525ebf[_0x925f('0x2d')]=_['intersection'](_0x38b58a[_0x925f('0x29')],qs['fields'](_0x1f6e30['query'][_0x925f('0x2e')]));_0x525ebf['attributes']=_0x525ebf[_0x925f('0x2d')][_0x925f('0x3d')]?_0x525ebf[_0x925f('0x2d')]:_0x38b58a['model'];if(_0x1f6e30['query']['includeAll']){_0x525ebf[_0x925f('0x3e')]=[{'all':!![]}];}_0x525ebf=_['merge']({},_0x525ebf,_0x1f6e30[_0x925f('0x37')]);return db[_0x925f('0x26')][_0x925f('0x3f')](_0x525ebf)[_0x925f('0x38')](handleEntityNotFound(_0x7b821c,null))[_0x925f('0x38')](respondWithResult(_0x7b821c,null))[_0x925f('0x40')](handleError(_0x7b821c,null));};exports[_0x925f('0x41')]=function(_0x129549,_0x461c4c){return db[_0x925f('0x26')]['create'](_0x129549[_0x925f('0x42')],{})[_0x925f('0x38')](respondWithResult(_0x461c4c,0xc9))['catch'](handleError(_0x461c4c,null));};exports[_0x925f('0x43')]=function(_0x4332a2,_0x5412d6){if(_0x4332a2['body']['id']){delete _0x4332a2[_0x925f('0x42')]['id'];}return db['WhatsappApplication'][_0x925f('0x3f')]({'where':{'id':_0x4332a2[_0x925f('0x44')]['id']}})[_0x925f('0x38')](handleEntityNotFound(_0x5412d6,null))[_0x925f('0x38')](saveUpdates(_0x4332a2[_0x925f('0x42')],null))[_0x925f('0x38')](respondWithResult(_0x5412d6,null))[_0x925f('0x40')](handleError(_0x5412d6,null));};exports[_0x925f('0x1f')]=function(_0x1fc3f8,_0x435e82){return db[_0x925f('0x26')]['find']({'where':{'id':_0x1fc3f8['params']['id']}})['then'](handleEntityNotFound(_0x435e82,null))[_0x925f('0x38')](removeEntity(_0x435e82,null))[_0x925f('0x40')](handleError(_0x435e82,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c735d62..2a934fd 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9be=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x1f713b,_0x1e789f){var _0x534b7f=function(_0x8b7189){while(--_0x8b7189){_0x1f713b['push'](_0x1f713b['shift']());}};_0x534b7f(++_0x1e789f);}(_0xb9be,0xc5));var _0xeb9b=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xb9be[_0x22e9fe];return _0x47cd19;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var logger=require(_0xeb9b('0x2'))(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var rp=require(_0xeb9b('0x6'));var fs=require('fs');var path=require(_0xeb9b('0x7'));var rimraf=require(_0xeb9b('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0xeb9b('0x9')]=function(_0x181810,_0x2529cb){return _0x181810['define'](_0xeb9b('0xa'),attributes,{'tableName':_0xeb9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb9b('0xc'),'collate':_0xeb9b('0xd')});}; \ No newline at end of file +var _0xe98f=['whatsapp_applications','utf8mb4','lodash','../../config/logger','moment','bluebird','rimraf','./whatsappApplication.attributes','exports','WhatsappApplication'];(function(_0x15bf9d,_0x480ab7){var _0x535c4a=function(_0x1676e5){while(--_0x1676e5){_0x15bf9d['push'](_0x15bf9d['shift']());}};_0x535c4a(++_0x480ab7);}(_0xe98f,0xde));var _0xfe98=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe98f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var logger=require(_0xfe98('0x1'))('api');var moment=require(_0xfe98('0x2'));var BPromise=require(_0xfe98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe98('0x4'));var config=require('../../config/environment');var attributes=require(_0xfe98('0x5'));module[_0xfe98('0x6')]=function(_0x4a2baa,_0x3aab59){return _0x4a2baa['define'](_0xfe98('0x7'),attributes,{'tableName':_0xfe98('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe98('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index fec4255..a866896 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec46=['jayson/promise','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1c13f1,_0x108f31){var _0x5db4a6=function(_0x27fcaf){while(--_0x27fcaf){_0x1c13f1['push'](_0x1c13f1['shift']());}};_0x5db4a6(++_0x108f31);}(_0xec46,0x19c));var _0x6ec4=function(_0x389b98,_0x58b439){_0x389b98=_0x389b98-0x0;var _0x65b7c6=_0xec46[_0x389b98];return _0x65b7c6;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d260,_0x1f6d1a,_0x391ed9){return new BPromise(function(_0x42b81b,_0xe47f57){return client[_0x6ec4('0xa')](_0x55d260,_0x391ed9)[_0x6ec4('0xb')](function(_0x384cf){logger[_0x6ec4('0xc')](_0x6ec4('0xd'),_0x1f6d1a,_0x6ec4('0xe'));logger[_0x6ec4('0xf')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1f6d1a,'request\x20sent',JSON[_0x6ec4('0x10')](_0x384cf));if(_0x384cf[_0x6ec4('0x11')]){if(_0x384cf[_0x6ec4('0x11')]['code']===0x1f4){logger[_0x6ec4('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x1f6d1a,_0x384cf[_0x6ec4('0x11')]['message']);return _0xe47f57(_0x384cf[_0x6ec4('0x11')][_0x6ec4('0x12')]);}logger[_0x6ec4('0x11')](_0x6ec4('0xd'),_0x1f6d1a,_0x384cf[_0x6ec4('0x11')]['message']);return _0x42b81b(_0x384cf[_0x6ec4('0x11')][_0x6ec4('0x12')]);}else{logger[_0x6ec4('0xc')](_0x6ec4('0xd'),_0x1f6d1a,_0x6ec4('0xe'));_0x42b81b(_0x384cf[_0x6ec4('0x13')][_0x6ec4('0x12')]);}})[_0x6ec4('0x14')](function(_0x19ffc8){logger[_0x6ec4('0x11')](_0x6ec4('0xd'),_0x1f6d1a,_0x19ffc8);_0xe47f57(_0x19ffc8);});});} \ No newline at end of file +var _0x3148=['then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3d3f8e,_0x35a8ac){var _0x5932dc=function(_0x485545){while(--_0x485545){_0x3d3f8e['push'](_0x3d3f8e['shift']());}};_0x5932dc(++_0x35a8ac);}(_0x3148,0x1d3));var _0x8314=function(_0x3be20a,_0x223336){_0x3be20a=_0x3be20a-0x0;var _0x7382f6=_0x3148[_0x3be20a];return _0x7382f6;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require('moment');var BPromise=require(_0x8314('0x2'));var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require(_0x8314('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require(_0x8314('0x9'));var client=jayson[_0x8314('0xa')][_0x8314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd913,_0x4dd36d,_0x837c1f){return new BPromise(function(_0x4df2b0,_0x35b464){return client[_0x8314('0xc')](_0x1bd913,_0x837c1f)[_0x8314('0xd')](function(_0x357031){logger[_0x8314('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x4dd36d,'request\x20sent');logger[_0x8314('0xf')](_0x8314('0x10'),_0x4dd36d,_0x8314('0x11'),JSON[_0x8314('0x12')](_0x357031));if(_0x357031['error']){if(_0x357031[_0x8314('0x13')][_0x8314('0x14')]===0x1f4){logger['error'](_0x8314('0x15'),_0x4dd36d,_0x357031['error']['message']);return _0x35b464(_0x357031[_0x8314('0x13')][_0x8314('0x16')]);}logger[_0x8314('0x13')](_0x8314('0x15'),_0x4dd36d,_0x357031['error'][_0x8314('0x16')]);return _0x4df2b0(_0x357031[_0x8314('0x13')][_0x8314('0x16')]);}else{logger[_0x8314('0xe')](_0x8314('0x15'),_0x4dd36d,_0x8314('0x11'));_0x4df2b0(_0x357031['result']['message']);}})[_0x8314('0x17')](function(_0xf0ad31){logger[_0x8314('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4dd36d,_0xf0ad31);_0x35b464(_0xf0ad31);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 214d8fa..2a9946e 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10d3=['whatsappinteraction:addtags','tracked','whatsapp','update','delete','whatsappinteraction:destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x10d3,0x7e));var _0x310d=function(_0x384b96,_0x5163f1){_0x384b96=_0x384b96-0x0;var _0x1c1468=_0x10d3[_0x384b96];return _0x1c1468;};'use strict';var multer=require('multer');var util=require(_0x310d('0x0'));var path=require(_0x310d('0x1'));var timeout=require(_0x310d('0x2'));var express=require('express');var router=express[_0x310d('0x3')]();var auth=require(_0x310d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x310d('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x310d('0x6')]('/',auth[_0x310d('0x7')](),controller[_0x310d('0x8')]);router[_0x310d('0x6')](_0x310d('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x310d('0x6')](_0x310d('0xa'),auth[_0x310d('0x7')](),controller[_0x310d('0xb')]);router[_0x310d('0x6')](_0x310d('0xc'),auth['isAuthenticated'](),controller[_0x310d('0xd')]);router['get'](_0x310d('0xe'),auth[_0x310d('0x7')](),controller['download']);router[_0x310d('0xf')]('/',auth[_0x310d('0x7')](),controller[_0x310d('0x10')]);router[_0x310d('0xf')](_0x310d('0xc'),auth[_0x310d('0x7')](),controller['addMessage']);router[_0x310d('0xf')](_0x310d('0x11'),auth[_0x310d('0x7')](),interaction['tracked']('whatsapp',_0x310d('0x12')),controller['addTags']);router['put'](_0x310d('0xa'),auth['isAuthenticated'](),interaction[_0x310d('0x13')](_0x310d('0x14'),'whatsappinteraction:update'),controller[_0x310d('0x15')]);router[_0x310d('0x16')](_0x310d('0xa'),auth['isAuthenticated'](),interaction[_0x310d('0x13')](_0x310d('0x14'),_0x310d('0x17')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xe049=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','/:id','tracked','update','delete','whatsappinteraction:destroy','exports','path','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe049,0xa6));var _0x9e04=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe049[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e04('0x0'));var timeout=require('connect-timeout');var express=require(_0x9e04('0x1'));var router=express[_0x9e04('0x2')]();var auth=require(_0x9e04('0x3'));var interaction=require(_0x9e04('0x4'));var config=require(_0x9e04('0x5'));var controller=require(_0x9e04('0x6'));router['get']('/',auth[_0x9e04('0x7')](),controller['index']);router[_0x9e04('0x8')](_0x9e04('0x9'),auth[_0x9e04('0x7')](),controller[_0x9e04('0xa')]);router[_0x9e04('0x8')]('/:id',auth[_0x9e04('0x7')](),controller[_0x9e04('0xb')]);router[_0x9e04('0x8')](_0x9e04('0xc'),auth[_0x9e04('0x7')](),controller[_0x9e04('0xd')]);router['get'](_0x9e04('0xe'),auth[_0x9e04('0x7')](),controller['download']);router[_0x9e04('0xf')]('/',auth[_0x9e04('0x7')](),controller[_0x9e04('0x10')]);router['post']('/:id/messages',auth[_0x9e04('0x7')](),controller[_0x9e04('0x11')]);router[_0x9e04('0xf')](_0x9e04('0x12'),auth[_0x9e04('0x7')](),interaction['tracked'](_0x9e04('0x13'),_0x9e04('0x14')),controller[_0x9e04('0x15')]);router['put'](_0x9e04('0x16'),auth[_0x9e04('0x7')](),interaction[_0x9e04('0x17')](_0x9e04('0x13'),'whatsappinteraction:update'),controller[_0x9e04('0x18')]);router[_0x9e04('0x19')](_0x9e04('0x16'),auth[_0x9e04('0x7')](),interaction[_0x9e04('0x17')](_0x9e04('0x13'),_0x9e04('0x1a')),controller['destroy']);router[_0x9e04('0x19')](_0x9e04('0x12'),auth[_0x9e04('0x7')](),controller['removeTags']);module[_0x9e04('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9d0f42b..fcbe6a9 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x191a=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x36ad8d,_0x104e69){var _0x5da06e=function(_0x1ff03c){while(--_0x1ff03c){_0x36ad8d['push'](_0x36ad8d['shift']());}};_0x5da06e(++_0x104e69);}(_0x191a,0x1b6));var _0xa191=function(_0x43b6da,_0x5f52fc){_0x43b6da=_0x43b6da-0x0;var _0x3ad946=_0x191a[_0x43b6da];return _0x3ad946;};'use strict';var Sequelize=require(_0xa191('0x0'));var moment=require('moment');module[_0xa191('0x1')]={'closed':{'type':Sequelize[_0xa191('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa191('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa191('0x4')]},'phone':{'type':Sequelize[_0xa191('0x4')]},'read1stAt':{'type':Sequelize[_0xa191('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa191('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa191('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x62cb=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x3defae,_0x44c104){var _0x4345ab=function(_0x36ce40){while(--_0x36ce40){_0x3defae['push'](_0x3defae['shift']());}};_0x4345ab(++_0x44c104);}(_0x62cb,0x185));var _0xb62c=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x62cb[_0xfbdff6];return _0x4cb9be;};'use strict';var Sequelize=require(_0xb62c('0x0'));var moment=require('moment');module[_0xb62c('0x1')]={'closed':{'type':Sequelize[_0xb62c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb62c('0x3')]},'disposition':{'type':Sequelize[_0xb62c('0x4')]},'note':{'type':Sequelize[_0xb62c('0x4')]},'phone':{'type':Sequelize[_0xb62c('0x4')]},'read1stAt':{'type':Sequelize[_0xb62c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb62c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb62c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb62c('0x6')]('in',_0xb62c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 84f2ae2..5987099 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','length','getFullTextValue','ContactId','buildExpression','type','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','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','group','QueryTypes','SELECT','clone','order','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','include','merge','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','%s\x20#%d','Whatsapp','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','downloadInteraction.html','transcript-','download','log','err','unlinkSync','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','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus'];(function(_0x2c85a2,_0x3dafc5){var _0x4b9da0=function(_0x2822bf){while(--_0x2822bf){_0x2c85a2['push'](_0x2c85a2['shift']());}};_0x4b9da0(++_0x3dafc5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'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'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}function getInteractionUsers(_0x42a33c,_0x2772fe){return new BPromise(function(_0x116700,_0x4a5a9e){try{if(_0x2772fe[_0x42a33c['id']]){_0x42a33c['Users']=_[_0xac4a('0x2d')](_0x2772fe[_0x42a33c['id']],function(_0x7a948b){return{'id':_0x7a948b['id'],'fullname':_0x7a948b[_0xac4a('0x2e')]};});}}catch(_0x546b65){_0x4a5a9e(_0x546b65);}_0x116700(_0x42a33c);});}function getInteractionTags(_0x4bda1f,_0x355755){return new BPromise(function(_0x2896bc,_0x228629){try{if(_0x4bda1f[_0xac4a('0x2f')]){_0x4bda1f[_0xac4a('0x30')]=[];_0x4bda1f['TagIds'][_0xac4a('0x31')](',')['forEach'](function(_0x30364b){_0x4bda1f['Tags'][_0xac4a('0x32')](_0x355755[_0x30364b]);});}delete _0x4bda1f[_0xac4a('0x2f')];}catch(_0x31501b){_0x228629(_0x31501b);}_0x2896bc(_0x4bda1f);});}function updateWhatsappInteraction(_0x228aa7,_0x34577f,_0x61e552){return new BPromise(function(_0xbd4591,_0x1f13f3){return getInteractionUsers(_0x228aa7,_0x61e552)[_0xac4a('0x27')](function(_0xfd7c16){return getInteractionTags(_0xfd7c16,_0x34577f);})[_0xac4a('0x27')](function(_0x1634df){_0xbd4591(_0x1634df);})[_0xac4a('0x33')](function(_0x1a9d4e){_0x1f13f3(_0x1a9d4e);});});}exports['index']=function(_0x30442d,_0x1c41fb){var _0x5a4e2b={},_0x2a5419={},_0x1af1c1={'count':0x0,'rows':[]};var _0x565164=_['map'](db[_0xac4a('0x34')][_0xac4a('0x35')],function(_0x1b42b6){return{'name':_0x1b42b6[_0xac4a('0x36')],'type':_0x1b42b6['type'][_0xac4a('0x37')]};});_0x2a5419[_0xac4a('0x38')]=_['map'](_0x565164,_0xac4a('0x2b'));_0x2a5419[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x30442d['query']);_0x2a5419[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2a5419[_0xac4a('0x38')],_0x2a5419['query']);_0x5a4e2b[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x2a5419['model'],qs['fields'](_0x30442d[_0xac4a('0x39')]['fields']));_0x5a4e2b['attributes']=_0x5a4e2b['attributes']['length']?_0x5a4e2b[_0xac4a('0x3d')]:_0x2a5419[_0xac4a('0x38')];if(!_0x30442d[_0xac4a('0x39')][_0xac4a('0x3e')](_0xac4a('0x3f'))){_0x5a4e2b[_0xac4a('0x40')]=qs[_0xac4a('0x40')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x40')]);_0x5a4e2b[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x30442d[_0xac4a('0x39')]['offset']);}_0x5a4e2b['order']=qs['sort'](_0x30442d[_0xac4a('0x39')][_0xac4a('0x41')]);_0x5a4e2b[_0xac4a('0x42')]=qs[_0xac4a('0x3b')](_[_0xac4a('0x43')](_0x30442d[_0xac4a('0x39')],_0x2a5419[_0xac4a('0x3b')]),_0x565164);var _0x3441f2=[];var _0x3e9973=squel[_0xac4a('0x44')]()['field']('id')[_0xac4a('0x45')](_0xac4a('0x2b'))[_0xac4a('0x45')](_0xac4a('0x46'))[_0xac4a('0x47')]('tools_tags');var _0x8700b4=squel[_0xac4a('0x44')]()['field'](_0xac4a('0x48'))['field'](_0xac4a('0x49'))[_0xac4a('0x45')](_0xac4a('0x4a'))[_0xac4a('0x47')](_0xac4a('0x4b'),'ui')[_0xac4a('0x4c')](_0xac4a('0x4d'),'u',_0xac4a('0x4e'));var _0x98e0c4=squel[_0xac4a('0x44')]()[_0xac4a('0x47')](_0xac4a('0x4f'),'i')['left_join'](_0xac4a('0x50'),'c',_0xac4a('0x51'))[_0xac4a('0x4c')]('users','o',_0xac4a('0x52'))[_0xac4a('0x4c')]('whatsapp_accounts','a',_0xac4a('0x53'))['left_join'](_0xac4a('0x54'),'me',_0xac4a('0x55'))[_0xac4a('0x4c')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xac4a('0x4c')]('tools_tags','t',_0xac4a('0x56'));var _0x566258=squel[_0xac4a('0x57')]();var _0x530bbb=[];var _0x3be103=squel[_0xac4a('0x57')]();var _0x424f9b;if(_0x30442d[_0xac4a('0x39')]['search']){_0x424f9b=as[_0xac4a('0x58')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x59')]);var _0x1ee454=_0x424f9b[_0xac4a('0x5a')];for(var _0x138876=0x0;_0x138876<_0x424f9b[_0xac4a('0x5b')]['length'];_0x138876++){var _0x35dee5=_0x424f9b[_0xac4a('0x5b')][_0x138876];var _0x4828e3='i';var _0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0x35dee5[_0xac4a('0x45')]]);if(!_0x16afbe){switch(_0x35dee5['field']){case _0xac4a('0x5d'):if(_0x35dee5[_0xac4a('0x5e')]==0x1){_0x98e0c4[_0xac4a('0x5f')]('`'+_0x35dee5[_0xac4a('0x45')]+_0xac4a('0x60'));}else{_0x98e0c4['having']('`'+_0x35dee5[_0xac4a('0x45')]+'`\x20>\x200');}break;case _0xac4a('0x61'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){if(_0x35dee5['value'][_0xac4a('0x31')]('\x20')[_0xac4a('0x63')]>0x1){_0x566258[_0x1ee454]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x35dee5[_0xac4a('0x5e')]),null);}else{var _0x26b582='%'+_0x35dee5[_0xac4a('0x5e')]+'%';_0x566258[_0x1ee454]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x26b582,_0x26b582,_0x26b582);}}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0xac4a('0x65')]);_0x35dee5[_0xac4a('0x45')]=_0xac4a('0x65');_0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c['text'],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x69'):var _0x2ac1e9=_0x35dee5[_0xac4a('0x5e')][_0xac4a('0x31')](',')[_0xac4a('0x2d')](function(_0x786d9){return Number(_0x786d9);});_0x2ac1e9[_0xac4a('0x6a')](function(_0x38dd4f){_0x3be103['or'](_0xac4a('0x6b'),'%,'+_0x38dd4f+',%');});_0x530bbb=_[_0xac4a('0x6c')](_0x530bbb,_0x2ac1e9);break;case _0xac4a('0x6d'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){_0x566258[_0x1ee454](_0xac4a('0x6e'),'%'+_0x35dee5['value']+'%',null);}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,['name',_0xac4a('0x6f')]);_0x35dee5['field']=_0xac4a('0x6f');_0x19ce2c=as['buildExpression'](_0x4828e3,_0x16afbe['type'],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x71'):_0x19ce2c=as['buildExpression']('me',null,_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c['value'][_0xac4a('0x68')],_0x19ce2c['value'][_0xac4a('0x1e')]);break;}}else{var _0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}}}else{var _0x430dd0=_(_0x30442d[_0xac4a('0x39')])[_0xac4a('0x3a')]()[_0xac4a('0x2d')](function(_0x2cc410){return _[_0xac4a('0x72')](_0x565164,[_0xac4a('0x2b'),_0x2cc410])?_0x2cc410:undefined;})[_0xac4a('0x73')]()['value']();if(!_[_0xac4a('0x74')](_0x430dd0)){_0x430dd0[_0xac4a('0x6a')](function(_0x4fb812){if(_0x4fb812===_0xac4a('0x75')){_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),[][_0xac4a('0x77')](_0x30442d[_0xac4a('0x39')][_0x4fb812]));}else if(_0x4fb812==='createdAt'){var _0x47c6d8=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x79')];var _0x148288=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x7a')];_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x7b'),_0x47c6d8,_0x148288);}else{if(_0x30442d[_0xac4a('0x39')][_0x4fb812]===_0xac4a('0x7c')){_0x98e0c4['where']('i.'+_0x4fb812+'\x20IS\x20NULL');}else{_0x98e0c4[_0xac4a('0x42')]('i.'+_0x4fb812+_0xac4a('0x7d'),_0x30442d[_0xac4a('0x39')][_0x4fb812]);}}});}if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]==0x1){_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x7f'));}else{_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x80'));}}if(_0x30442d[_0xac4a('0x39')]['tag']){_0x530bbb=_[_0xac4a('0x81')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x82')])?_0x30442d[_0xac4a('0x39')]['tag']:new Array(_0x30442d[_0xac4a('0x39')]['tag']);_0x530bbb[_0xac4a('0x6a')](function(_0x3af39a){_0x3be103['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3af39a+',%');});}if(_0x30442d['query'][_0xac4a('0x83')]){var _0x3b8974=_0x30442d[_0xac4a('0x39')]['filter'][_0xac4a('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xac4a('0x85'));if(qs['isNumeric'](_0x3b8974)){_0x566258['or']('i.id\x20LIKE\x20?',_0x3b8974+'%')['or'](_0xac4a('0x86'),_0x3b8974+'%');}else{_0x566258['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x3b8974))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3b8974+'%');}}}_0x98e0c4[_0xac4a('0x42')](_0x566258);_0x98e0c4[_0xac4a('0x87')]('i.id');var _0x3980ae={'type':db['Sequelize'][_0xac4a('0x88')][_0xac4a('0x89')],'raw':!![]};var _0x522949=_0x98e0c4[_0xac4a('0x8a')]();_0x522949['field']('i.id');_0x522949[_0xac4a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xac4a('0x5d'));if(_0x5a4e2b['order']){_0x5a4e2b['order'][_0xac4a('0x6a')](function(_0x4065c0){_0x98e0c4[_0xac4a('0x8b')]('i.'+_0x4065c0[0x0],_0x4065c0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x530bbb)){_0x98e0c4[_0xac4a('0x5f')](_0x3be103);_0x522949[_0xac4a('0x42')]('t.id\x20IN\x20?',_0x530bbb);}BPromise['resolve']()[_0xac4a('0x27')](function(){if(!_0x424f9b){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x75')]||_0x30442d[_0xac4a('0x39')][_0xac4a('0x8c')])return;_0x522949[_0xac4a('0x42')](_0xac4a('0x8d'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8d'));return;}return _0x30442d['user'][_0xac4a('0x8e')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x27')](function(_0x3ba61e){if(_['isEmpty'](_0x3ba61e)){_0x522949[_0xac4a('0x42')](_0xac4a('0x8f'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8f'));}else{_0x522949[_0xac4a('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0xac4a('0x2d')](_0x3ba61e,'id'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),_[_0xac4a('0x2d')](_0x3ba61e,'id'));}});})[_0xac4a('0x27')](function(){db[_0xac4a('0x90')][_0xac4a('0x39')](_0x522949['toString'](),_0x3980ae)[_0xac4a('0x27')](function(_0x2be178){_0x1af1c1[_0xac4a('0x20')]=_0x2be178[_0xac4a('0x63')];if(_0x1af1c1[_0xac4a('0x20')]===0x0)return[];return db[_0xac4a('0x90')]['query'](_0x3e9973[_0xac4a('0x91')](),_0x3980ae)[_0xac4a('0x27')](function(_0x1b9a33){_0x3441f2=_[_0xac4a('0x92')](_0x1b9a33,'id');_0x3980ae=_['merge'](_0x3980ae,{'model':db[_0xac4a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30442d['query'][_0xac4a('0x93')]){_0x5a4e2b[_0xac4a('0x3d')]['forEach'](function(_0x5b95ab){_0x98e0c4[_0xac4a('0x45')]('i.'+_0x5b95ab);});}else{_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x94'),'unreadMessages');_0x98e0c4[_0xac4a('0x45')]('a.key',_0xac4a('0x95'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x96'),_0xac4a('0x97'));_0x98e0c4[_0xac4a('0x45')]('i.*');_0x98e0c4['field'](_0xac4a('0x98'),_0xac4a('0x99'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9a'),_0xac4a('0x9b'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9c'),_0xac4a('0x9d'));_0x98e0c4['field']('c.phone',_0xac4a('0x9e'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9f'),_0xac4a('0xa0'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa1'),_0xac4a('0xa2'));_0x98e0c4[_0xac4a('0x45')]('o.fullname','Owner.fullname');_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa3'),_0xac4a('0xa4'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa5'),_0xac4a('0x2f'));}if(_0x5a4e2b[_0xac4a('0x40')])_0x98e0c4['limit'](_0x5a4e2b[_0xac4a('0x40')]);if(_0x5a4e2b[_0xac4a('0x21')])_0x98e0c4[_0xac4a('0x21')](_0x5a4e2b['offset']);return db[_0xac4a('0x90')][_0xac4a('0x39')](_0x98e0c4[_0xac4a('0x91')](),_0x3980ae);})[_0xac4a('0x27')](function(_0x1a7448){_0x8700b4[_0xac4a('0x42')](_0xac4a('0xa6'),_[_0xac4a('0x2d')](_0x1a7448,'id'));return db[_0xac4a('0x90')]['query'](_0x8700b4[_0xac4a('0x91')](),_0x3980ae)['then'](function(_0x203321){var _0x1199f6=_[_0xac4a('0xa7')](_0x203321,_0xac4a('0xa8'));var _0x840fec=[];_0x1a7448[_0xac4a('0x6a')](function(_0x19766a){_0x840fec['push'](updateWhatsappInteraction(_0x19766a,_0x3441f2,_0x1199f6));});return BPromise[_0xac4a('0xa9')](_0x840fec);});});})[_0xac4a('0x27')](function(_0x279f9b){_0x1af1c1[_0xac4a('0xaa')]=_0x279f9b;return _0x1af1c1;})[_0xac4a('0x27')](respondWithFilteredResult(_0x1c41fb,_0x5a4e2b));})['catch'](handleError(_0x1c41fb,null));};exports[_0xac4a('0xab')]=function(_0x360d4f,_0x4f2b19){var _0x55af32={'raw':![],'where':{'id':_0x360d4f[_0xac4a('0xac')]['id']}},_0x386d6d={};_0x386d6d['model']=_[_0xac4a('0x3a')](db[_0xac4a('0x34')][_0xac4a('0x35')]);_0x386d6d[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x360d4f[_0xac4a('0x39')]);_0x386d6d['filters']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],_0x386d6d[_0xac4a('0x39')]);_0x55af32['attributes']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],qs[_0xac4a('0x93')](_0x360d4f[_0xac4a('0x39')][_0xac4a('0x93')]));_0x55af32[_0xac4a('0x3d')]=_0x55af32['attributes'][_0xac4a('0x63')]?_0x55af32[_0xac4a('0x3d')]:_0x386d6d['model'];if(_0x360d4f[_0xac4a('0x39')]['includeAll']){_0x55af32[_0xac4a('0xad')]=[{'all':!![]}];}_0x55af32=_[_0xac4a('0xae')]({},_0x55af32,_0x360d4f['options']);return db[_0xac4a('0x34')]['find'](_0x55af32)[_0xac4a('0x27')](handleEntityNotFound(_0x4f2b19,null))['then'](respondWithResult(_0x4f2b19,null))[_0xac4a('0x33')](handleError(_0x4f2b19,null));};exports[_0xac4a('0xaf')]=function(_0x24f464,_0xfe8977){return db[_0xac4a('0x34')][_0xac4a('0xaf')](_0x24f464[_0xac4a('0x71')],{})[_0xac4a('0x27')](respondWithResult(_0xfe8977,0xc9))[_0xac4a('0x33')](handleError(_0xfe8977,null));};exports[_0xac4a('0x26')]=function(_0x3a0163,_0x455eb7){if(_0x3a0163[_0xac4a('0x71')]['id']){delete _0x3a0163[_0xac4a('0x71')]['id'];}return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x3a0163[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x455eb7,null))[_0xac4a('0x27')](saveUpdates(_0x3a0163[_0xac4a('0x71')],null))[_0xac4a('0x27')](respondWithResult(_0x455eb7,null))[_0xac4a('0x33')](handleError(_0x455eb7,null));};exports[_0xac4a('0x28')]=function(_0x5d5bb3,_0x101137){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x5d5bb3[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x101137,null))[_0xac4a('0x27')](removeEntity(_0x101137,null))['catch'](handleError(_0x101137,null));};exports[_0xac4a('0xb0')]=function(_0x55866d,_0x277fd1){return db[_0xac4a('0x34')][_0xac4a('0xb0')]()['then'](respondWithResult(_0x277fd1,null))[_0xac4a('0x33')](handleError(_0x277fd1,null));};exports[_0xac4a('0xb1')]=function(_0x127ede,_0x52f3f2,_0x2da95f){return db[_0xac4a('0xb2')][_0xac4a('0x5c')]({'where':{'id':_0x127ede[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x52f3f2,null))[_0xac4a('0x27')](function(_0x3b4183){if(_0x3b4183){return _0x3b4183[_0xac4a('0xb1')](_0x127ede['body'][_0xac4a('0xb3')],_['omit'](_0x127ede['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x52f3f2,null))['catch'](handleError(_0x52f3f2,null));};exports[_0xac4a('0xb4')]=function(_0x58fcb0,_0xc014a6,_0x377444){var _0x2132b2={'raw':![],'where':{}};var _0x525d50={};var _0x9ea4d1={'count':0x0,'rows':[]};return db[_0xac4a('0x34')][_0xac4a('0xb5')]({'where':{'id':_0x58fcb0[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0xc014a6,null))[_0xac4a('0x27')](function(_0x7a1b25){if(_0x7a1b25){_0x525d50[_0xac4a('0x38')]=_['keys'](db[_0xac4a('0xb2')][_0xac4a('0x35')]);_0x525d50[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x58fcb0[_0xac4a('0x39')]);_0x525d50[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x525d50['model'],_0x525d50['query']);_0x2132b2[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x525d50['model'],qs[_0xac4a('0x93')](_0x58fcb0[_0xac4a('0x39')]['fields']));_0x2132b2['attributes']=_0x2132b2[_0xac4a('0x3d')][_0xac4a('0x63')]?_0x2132b2[_0xac4a('0x3d')]:_0x525d50[_0xac4a('0x38')];if(!_0x58fcb0[_0xac4a('0x39')]['hasOwnProperty'](_0xac4a('0x3f'))){_0x2132b2['limit']=qs['limit'](_0x58fcb0['query'][_0xac4a('0x40')]);_0x2132b2[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x21')]);}_0x2132b2[_0xac4a('0x8b')]=qs[_0xac4a('0x41')](_0x58fcb0[_0xac4a('0x39')]['sort']);_0x2132b2['where']=qs['filters'](_[_0xac4a('0x43')](_0x58fcb0[_0xac4a('0x39')],_0x525d50[_0xac4a('0x3b')]));_0x2132b2[_0xac4a('0x42')][_0xac4a('0xa8')]=_0x7a1b25['id'];if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]){_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],{'$or':_[_0xac4a('0x2d')](_0x2132b2[_0xac4a('0x3d')],function(_0xe0fd57){var _0x32b013={};_0x32b013[_0xe0fd57]={'$like':'%'+_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]+'%'};return _0x32b013;})});}if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')]){var _0x41cdb5=_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')][_0xac4a('0x31')](',');var _0x3e2575={};_0x3e2575[_0x41cdb5[0x0]]={'$gte':moment(_0x41cdb5[0x1])['format'](_0xac4a('0xb6'))};_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],_0x3e2575);}_0x2132b2=_[_0xac4a('0xae')]({},_0x2132b2,_0x58fcb0[_0xac4a('0xb7')]);return db[_0xac4a('0xb2')][_0xac4a('0x20')]({'where':_0x2132b2['where']})['then'](function(_0x113f80){_0x9ea4d1[_0xac4a('0x20')]=_0x113f80;if(_0x58fcb0[_0xac4a('0x39')]['includeAll']){_0x2132b2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xac4a('0xb8')](_0x2132b2);})['then'](function(_0x59e82c){_0x9ea4d1[_0xac4a('0xaa')]=_0x59e82c;return _0x9ea4d1;});}})['then'](respondWithFilteredResult(_0xc014a6,_0x2132b2))[_0xac4a('0x33')](handleError(_0xc014a6,null));};exports['addTags']=function(_0x3f95a4,_0x2b4f28,_0x413f5f){return db[_0xac4a('0x34')][_0xac4a('0x5c')]({'where':{'id':_0x3f95a4[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2b4f28,null))[_0xac4a('0x27')](function(_0x34b6d7){if(_0x34b6d7){return _0x34b6d7[_0xac4a('0xb9')](_0x3f95a4['body'][_0xac4a('0xb3')],_[_0xac4a('0xba')](_0x3f95a4[_0xac4a('0x71')],[_0xac4a('0xb3'),'id'])||{})['spread'](function(){return db[_0xac4a('0x69')][_0xac4a('0xb8')]({'attributes':['id',_0xac4a('0x2b'),_0xac4a('0x46')],'where':{'id':_0x3f95a4[_0xac4a('0x71')][_0xac4a('0xb3')]}});})['then'](function(_0x57d3cd){socket[_0xac4a('0xbb')](_0xac4a('0xbc'),{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]});return{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]};});}})[_0xac4a('0x27')](respondWithResult(_0x2b4f28,null))[_0xac4a('0x33')](handleError(_0x2b4f28,null));};exports['removeTags']=function(_0x21a6f6,_0x580c9b,_0xe4165d){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x21a6f6[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x580c9b,null))[_0xac4a('0x27')](function(_0x5650ce){if(_0x5650ce){return _0x5650ce[_0xac4a('0xbd')](_0x21a6f6[_0xac4a('0x39')][_0xac4a('0xb3')]);}})[_0xac4a('0x27')](respondWithStatusCode(_0x580c9b,null))[_0xac4a('0x33')](handleError(_0x580c9b,null));};exports['download']=function(_0x3dd60a,_0xbe1958){var _0x462964=moment()[_0xac4a('0xbe')]()[_0xac4a('0x91')]();var _0x5e5eb1=path[_0xac4a('0xbf')](config[_0xac4a('0xc0')],_0xac4a('0xc1'),_0xac4a('0xc2'),_0xac4a('0xc3'));var _0x55ccc3=path['join'](config['root'],'server',_0xac4a('0xc2'),_0xac4a('0xc4'));var _0x17f815=path[_0xac4a('0xbf')](_0x5e5eb1,_0x462964);var _0xa8b5bb=util['format'](_0xac4a('0xc5'),_0x3dd60a[_0xac4a('0xac')]['id'],_0x462964);var _0x5aad90=path[_0xac4a('0xbf')](_0x5e5eb1,_0xa8b5bb);var _0x14b425=[];_0x14b425[_0xac4a('0x32')]({'model':db['User'],'as':_0xac4a('0x6d'),'attributes':['id',_0xac4a('0x2e')],'raw':!![]});_0x14b425[_0xac4a('0x32')]({'model':db[_0xac4a('0xc6')],'as':_0xac4a('0x61'),'attributes':['id',_0xac4a('0xc7'),_0xac4a('0xc8')],'raw':!![]});if(_0x3dd60a[_0xac4a('0x39')][_0xac4a('0xc4')]){_0x14b425['push']({'model':db[_0xac4a('0xc9')],'as':_0xac4a('0xc9'),'raw':!![]});}var _0x579181=[{'model':db[_0xac4a('0xb2')],'as':'Messages','attributes':['id',_0xac4a('0x71'),_0xac4a('0xca'),'direction',_0xac4a('0xcb'),_0xac4a('0x7e')],'include':_0x14b425}];_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0xcc')],'as':_0xac4a('0xcd'),'attributes':['id',_0xac4a('0x2b')]});_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0x6d')],'as':'Owner','attributes':['id','fullname']});return db[_0xac4a('0x34')]['find']({'where':{'id':_0x3dd60a['params']['id']},'include':_0x579181})[_0xac4a('0x27')](handleEntityNotFound(_0xbe1958,null))[_0xac4a('0x27')](function(_0x3254c3){if(_0x3254c3){var _0x516225=_0x3254c3[_0xac4a('0xce')]({'plain':!![]});fs[_0xac4a('0xcf')](_0x17f815);var _0x5a2abf={'format':'A4','border':'10px','header':{'height':_0xac4a('0xd0'),'contents':{'first':_0xac4a('0xd1')}},'footer':{'height':_0xac4a('0xd2'),'contents':{'default':util[_0xac4a('0xd3')]('\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[_0xac4a('0xd3')](_0xac4a('0xd4'),_0xac4a('0xd5'),_0x516225['id']),moment()['format'](_0xac4a('0xd6'))[_0xac4a('0x91')]())}}};var _0x15b97a={'channel':_0xac4a('0xd5'),'account':_0x516225[_0xac4a('0xcd')]['name'],'agent':_0x516225['Owner']?_0x516225[_0xac4a('0xd7')][_0xac4a('0x2e')]:_0xac4a('0xd8'),'createdAt':moment(_0x516225[_0xac4a('0xca')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')](),'closedAt':_0x516225[_0xac4a('0xd9')]?moment(_0x516225[_0xac4a('0xda')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')]():'','disposition':_0x516225[_0xac4a('0xdb')],'messages':_(_0x516225['Messages'])[_0xac4a('0x83')]({'secret':![]})['map'](function(_0x4ec2c3){if(_0x4ec2c3[_0xac4a('0xc9')]){var _0x27833a=path[_0xac4a('0xbf')](_0x55ccc3,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]);if(fs[_0xac4a('0xdd')](_0x27833a)){fs[_0xac4a('0xde')](_0x27833a)[_0xac4a('0xdf')](fs[_0xac4a('0xe0')](path['join'](_0x17f815,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')])));}}return{'date':moment(_0x4ec2c3[_0xac4a('0xca')])[_0xac4a('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4ec2c3[_0xac4a('0xe1')]===_0xac4a('0xe2')?_0x4ec2c3[_0xac4a('0x6d')]?_0x4ec2c3[_0xac4a('0x6d')][_0xac4a('0x2e')]:_0xac4a('0xe3'):_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc7')]+(_0x4ec2c3[_0xac4a('0x61')]['lastName']?'\x20'+_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc8')]:''),'body':_0x4ec2c3[_0xac4a('0xc9')]?_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]:_0x4ec2c3[_0xac4a('0x71')],'direction':_0x4ec2c3['direction']==='out'?'A':'C','secret':_0x4ec2c3['secret'],'read':_0x4ec2c3[_0xac4a('0x7e')],'attachment':_0x4ec2c3[_0xac4a('0xc9')]};})['value']()};return ejs['renderFile'](path[_0xac4a('0xbf')](config['root'],_0xac4a('0xc1'),'views',_0xac4a('0xe4')),{'interaction':_0x15b97a})[_0xac4a('0x27')](function(_0x1888c3){return new BPromise(function(_0x4a04c3,_0x14435d){pdf[_0xac4a('0xaf')](_0x1888c3,_0x5a2abf)['toFile'](path[_0xac4a('0xbf')](_0x17f815,_0xac4a('0xe5')+_0x516225['id']+'-'+_0x462964+'.pdf'),function(_0x48a75c,_0x4514a5){if(_0x48a75c)return _0x14435d(_0x48a75c);_0x4a04c3(_0x4514a5);});});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x43df37,_0x45e45b){zipdir(_0x17f815,{'saveTo':_0x5aad90},function(_0x367254,_0x22cc71){if(_0x367254)return _0x45e45b(_0x367254);return _0x43df37(_0x22cc71);});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x1ea4ef,_0x156b67){rimraf(_0x17f815,function(_0x330070){if(_0x330070)_0x156b67(_0x330070);return _0x1ea4ef();});});})[_0xac4a('0x27')](function(){return _0xbe1958[_0xac4a('0xe6')](_0x5aad90,_0xa8b5bb,function(_0x2d755c){if(_0x2d755c){console[_0xac4a('0xe7')](_0xac4a('0xe8'),_0x2d755c);}else{fs[_0xac4a('0xe9')](_0x5aad90);}});});});}else{return _0xbe1958[_0xac4a('0x1c')](0xc8);}})['catch'](handleError(_0xbe1958,null));}; \ No newline at end of file +var _0xc4aa=['status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','length','getFullTextValue','ContactId','buildExpression','type','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','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','group','QueryTypes','SELECT','clone','order','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','include','merge','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','%s\x20#%d','Whatsapp','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','downloadInteraction.html','transcript-','download','log','err','unlinkSync','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','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus'];(function(_0xd9da23,_0x518693){var _0x3fbdb5=function(_0x3006f8){while(--_0x3006f8){_0xd9da23['push'](_0xd9da23['shift']());}};_0x3fbdb5(++_0x518693);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'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'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}function getInteractionUsers(_0x42a33c,_0x2772fe){return new BPromise(function(_0x116700,_0x4a5a9e){try{if(_0x2772fe[_0x42a33c['id']]){_0x42a33c['Users']=_[_0xac4a('0x2d')](_0x2772fe[_0x42a33c['id']],function(_0x7a948b){return{'id':_0x7a948b['id'],'fullname':_0x7a948b[_0xac4a('0x2e')]};});}}catch(_0x546b65){_0x4a5a9e(_0x546b65);}_0x116700(_0x42a33c);});}function getInteractionTags(_0x4bda1f,_0x355755){return new BPromise(function(_0x2896bc,_0x228629){try{if(_0x4bda1f[_0xac4a('0x2f')]){_0x4bda1f[_0xac4a('0x30')]=[];_0x4bda1f['TagIds'][_0xac4a('0x31')](',')['forEach'](function(_0x30364b){_0x4bda1f['Tags'][_0xac4a('0x32')](_0x355755[_0x30364b]);});}delete _0x4bda1f[_0xac4a('0x2f')];}catch(_0x31501b){_0x228629(_0x31501b);}_0x2896bc(_0x4bda1f);});}function updateWhatsappInteraction(_0x228aa7,_0x34577f,_0x61e552){return new BPromise(function(_0xbd4591,_0x1f13f3){return getInteractionUsers(_0x228aa7,_0x61e552)[_0xac4a('0x27')](function(_0xfd7c16){return getInteractionTags(_0xfd7c16,_0x34577f);})[_0xac4a('0x27')](function(_0x1634df){_0xbd4591(_0x1634df);})[_0xac4a('0x33')](function(_0x1a9d4e){_0x1f13f3(_0x1a9d4e);});});}exports['index']=function(_0x30442d,_0x1c41fb){var _0x5a4e2b={},_0x2a5419={},_0x1af1c1={'count':0x0,'rows':[]};var _0x565164=_['map'](db[_0xac4a('0x34')][_0xac4a('0x35')],function(_0x1b42b6){return{'name':_0x1b42b6[_0xac4a('0x36')],'type':_0x1b42b6['type'][_0xac4a('0x37')]};});_0x2a5419[_0xac4a('0x38')]=_['map'](_0x565164,_0xac4a('0x2b'));_0x2a5419[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x30442d['query']);_0x2a5419[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2a5419[_0xac4a('0x38')],_0x2a5419['query']);_0x5a4e2b[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x2a5419['model'],qs['fields'](_0x30442d[_0xac4a('0x39')]['fields']));_0x5a4e2b['attributes']=_0x5a4e2b['attributes']['length']?_0x5a4e2b[_0xac4a('0x3d')]:_0x2a5419[_0xac4a('0x38')];if(!_0x30442d[_0xac4a('0x39')][_0xac4a('0x3e')](_0xac4a('0x3f'))){_0x5a4e2b[_0xac4a('0x40')]=qs[_0xac4a('0x40')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x40')]);_0x5a4e2b[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x30442d[_0xac4a('0x39')]['offset']);}_0x5a4e2b['order']=qs['sort'](_0x30442d[_0xac4a('0x39')][_0xac4a('0x41')]);_0x5a4e2b[_0xac4a('0x42')]=qs[_0xac4a('0x3b')](_[_0xac4a('0x43')](_0x30442d[_0xac4a('0x39')],_0x2a5419[_0xac4a('0x3b')]),_0x565164);var _0x3441f2=[];var _0x3e9973=squel[_0xac4a('0x44')]()['field']('id')[_0xac4a('0x45')](_0xac4a('0x2b'))[_0xac4a('0x45')](_0xac4a('0x46'))[_0xac4a('0x47')]('tools_tags');var _0x8700b4=squel[_0xac4a('0x44')]()['field'](_0xac4a('0x48'))['field'](_0xac4a('0x49'))[_0xac4a('0x45')](_0xac4a('0x4a'))[_0xac4a('0x47')](_0xac4a('0x4b'),'ui')[_0xac4a('0x4c')](_0xac4a('0x4d'),'u',_0xac4a('0x4e'));var _0x98e0c4=squel[_0xac4a('0x44')]()[_0xac4a('0x47')](_0xac4a('0x4f'),'i')['left_join'](_0xac4a('0x50'),'c',_0xac4a('0x51'))[_0xac4a('0x4c')]('users','o',_0xac4a('0x52'))[_0xac4a('0x4c')]('whatsapp_accounts','a',_0xac4a('0x53'))['left_join'](_0xac4a('0x54'),'me',_0xac4a('0x55'))[_0xac4a('0x4c')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xac4a('0x4c')]('tools_tags','t',_0xac4a('0x56'));var _0x566258=squel[_0xac4a('0x57')]();var _0x530bbb=[];var _0x3be103=squel[_0xac4a('0x57')]();var _0x424f9b;if(_0x30442d[_0xac4a('0x39')]['search']){_0x424f9b=as[_0xac4a('0x58')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x59')]);var _0x1ee454=_0x424f9b[_0xac4a('0x5a')];for(var _0x138876=0x0;_0x138876<_0x424f9b[_0xac4a('0x5b')]['length'];_0x138876++){var _0x35dee5=_0x424f9b[_0xac4a('0x5b')][_0x138876];var _0x4828e3='i';var _0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0x35dee5[_0xac4a('0x45')]]);if(!_0x16afbe){switch(_0x35dee5['field']){case _0xac4a('0x5d'):if(_0x35dee5[_0xac4a('0x5e')]==0x1){_0x98e0c4[_0xac4a('0x5f')]('`'+_0x35dee5[_0xac4a('0x45')]+_0xac4a('0x60'));}else{_0x98e0c4['having']('`'+_0x35dee5[_0xac4a('0x45')]+'`\x20>\x200');}break;case _0xac4a('0x61'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){if(_0x35dee5['value'][_0xac4a('0x31')]('\x20')[_0xac4a('0x63')]>0x1){_0x566258[_0x1ee454]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x35dee5[_0xac4a('0x5e')]),null);}else{var _0x26b582='%'+_0x35dee5[_0xac4a('0x5e')]+'%';_0x566258[_0x1ee454]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x26b582,_0x26b582,_0x26b582);}}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0xac4a('0x65')]);_0x35dee5[_0xac4a('0x45')]=_0xac4a('0x65');_0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c['text'],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x69'):var _0x2ac1e9=_0x35dee5[_0xac4a('0x5e')][_0xac4a('0x31')](',')[_0xac4a('0x2d')](function(_0x786d9){return Number(_0x786d9);});_0x2ac1e9[_0xac4a('0x6a')](function(_0x38dd4f){_0x3be103['or'](_0xac4a('0x6b'),'%,'+_0x38dd4f+',%');});_0x530bbb=_[_0xac4a('0x6c')](_0x530bbb,_0x2ac1e9);break;case _0xac4a('0x6d'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){_0x566258[_0x1ee454](_0xac4a('0x6e'),'%'+_0x35dee5['value']+'%',null);}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,['name',_0xac4a('0x6f')]);_0x35dee5['field']=_0xac4a('0x6f');_0x19ce2c=as['buildExpression'](_0x4828e3,_0x16afbe['type'],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x71'):_0x19ce2c=as['buildExpression']('me',null,_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c['value'][_0xac4a('0x68')],_0x19ce2c['value'][_0xac4a('0x1e')]);break;}}else{var _0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}}}else{var _0x430dd0=_(_0x30442d[_0xac4a('0x39')])[_0xac4a('0x3a')]()[_0xac4a('0x2d')](function(_0x2cc410){return _[_0xac4a('0x72')](_0x565164,[_0xac4a('0x2b'),_0x2cc410])?_0x2cc410:undefined;})[_0xac4a('0x73')]()['value']();if(!_[_0xac4a('0x74')](_0x430dd0)){_0x430dd0[_0xac4a('0x6a')](function(_0x4fb812){if(_0x4fb812===_0xac4a('0x75')){_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),[][_0xac4a('0x77')](_0x30442d[_0xac4a('0x39')][_0x4fb812]));}else if(_0x4fb812==='createdAt'){var _0x47c6d8=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x79')];var _0x148288=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x7a')];_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x7b'),_0x47c6d8,_0x148288);}else{if(_0x30442d[_0xac4a('0x39')][_0x4fb812]===_0xac4a('0x7c')){_0x98e0c4['where']('i.'+_0x4fb812+'\x20IS\x20NULL');}else{_0x98e0c4[_0xac4a('0x42')]('i.'+_0x4fb812+_0xac4a('0x7d'),_0x30442d[_0xac4a('0x39')][_0x4fb812]);}}});}if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]==0x1){_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x7f'));}else{_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x80'));}}if(_0x30442d[_0xac4a('0x39')]['tag']){_0x530bbb=_[_0xac4a('0x81')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x82')])?_0x30442d[_0xac4a('0x39')]['tag']:new Array(_0x30442d[_0xac4a('0x39')]['tag']);_0x530bbb[_0xac4a('0x6a')](function(_0x3af39a){_0x3be103['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3af39a+',%');});}if(_0x30442d['query'][_0xac4a('0x83')]){var _0x3b8974=_0x30442d[_0xac4a('0x39')]['filter'][_0xac4a('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xac4a('0x85'));if(qs['isNumeric'](_0x3b8974)){_0x566258['or']('i.id\x20LIKE\x20?',_0x3b8974+'%')['or'](_0xac4a('0x86'),_0x3b8974+'%');}else{_0x566258['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x3b8974))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3b8974+'%');}}}_0x98e0c4[_0xac4a('0x42')](_0x566258);_0x98e0c4[_0xac4a('0x87')]('i.id');var _0x3980ae={'type':db['Sequelize'][_0xac4a('0x88')][_0xac4a('0x89')],'raw':!![]};var _0x522949=_0x98e0c4[_0xac4a('0x8a')]();_0x522949['field']('i.id');_0x522949[_0xac4a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xac4a('0x5d'));if(_0x5a4e2b['order']){_0x5a4e2b['order'][_0xac4a('0x6a')](function(_0x4065c0){_0x98e0c4[_0xac4a('0x8b')]('i.'+_0x4065c0[0x0],_0x4065c0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x530bbb)){_0x98e0c4[_0xac4a('0x5f')](_0x3be103);_0x522949[_0xac4a('0x42')]('t.id\x20IN\x20?',_0x530bbb);}BPromise['resolve']()[_0xac4a('0x27')](function(){if(!_0x424f9b){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x75')]||_0x30442d[_0xac4a('0x39')][_0xac4a('0x8c')])return;_0x522949[_0xac4a('0x42')](_0xac4a('0x8d'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8d'));return;}return _0x30442d['user'][_0xac4a('0x8e')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x27')](function(_0x3ba61e){if(_['isEmpty'](_0x3ba61e)){_0x522949[_0xac4a('0x42')](_0xac4a('0x8f'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8f'));}else{_0x522949[_0xac4a('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0xac4a('0x2d')](_0x3ba61e,'id'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),_[_0xac4a('0x2d')](_0x3ba61e,'id'));}});})[_0xac4a('0x27')](function(){db[_0xac4a('0x90')][_0xac4a('0x39')](_0x522949['toString'](),_0x3980ae)[_0xac4a('0x27')](function(_0x2be178){_0x1af1c1[_0xac4a('0x20')]=_0x2be178[_0xac4a('0x63')];if(_0x1af1c1[_0xac4a('0x20')]===0x0)return[];return db[_0xac4a('0x90')]['query'](_0x3e9973[_0xac4a('0x91')](),_0x3980ae)[_0xac4a('0x27')](function(_0x1b9a33){_0x3441f2=_[_0xac4a('0x92')](_0x1b9a33,'id');_0x3980ae=_['merge'](_0x3980ae,{'model':db[_0xac4a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30442d['query'][_0xac4a('0x93')]){_0x5a4e2b[_0xac4a('0x3d')]['forEach'](function(_0x5b95ab){_0x98e0c4[_0xac4a('0x45')]('i.'+_0x5b95ab);});}else{_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x94'),'unreadMessages');_0x98e0c4[_0xac4a('0x45')]('a.key',_0xac4a('0x95'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x96'),_0xac4a('0x97'));_0x98e0c4[_0xac4a('0x45')]('i.*');_0x98e0c4['field'](_0xac4a('0x98'),_0xac4a('0x99'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9a'),_0xac4a('0x9b'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9c'),_0xac4a('0x9d'));_0x98e0c4['field']('c.phone',_0xac4a('0x9e'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9f'),_0xac4a('0xa0'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa1'),_0xac4a('0xa2'));_0x98e0c4[_0xac4a('0x45')]('o.fullname','Owner.fullname');_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa3'),_0xac4a('0xa4'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa5'),_0xac4a('0x2f'));}if(_0x5a4e2b[_0xac4a('0x40')])_0x98e0c4['limit'](_0x5a4e2b[_0xac4a('0x40')]);if(_0x5a4e2b[_0xac4a('0x21')])_0x98e0c4[_0xac4a('0x21')](_0x5a4e2b['offset']);return db[_0xac4a('0x90')][_0xac4a('0x39')](_0x98e0c4[_0xac4a('0x91')](),_0x3980ae);})[_0xac4a('0x27')](function(_0x1a7448){_0x8700b4[_0xac4a('0x42')](_0xac4a('0xa6'),_[_0xac4a('0x2d')](_0x1a7448,'id'));return db[_0xac4a('0x90')]['query'](_0x8700b4[_0xac4a('0x91')](),_0x3980ae)['then'](function(_0x203321){var _0x1199f6=_[_0xac4a('0xa7')](_0x203321,_0xac4a('0xa8'));var _0x840fec=[];_0x1a7448[_0xac4a('0x6a')](function(_0x19766a){_0x840fec['push'](updateWhatsappInteraction(_0x19766a,_0x3441f2,_0x1199f6));});return BPromise[_0xac4a('0xa9')](_0x840fec);});});})[_0xac4a('0x27')](function(_0x279f9b){_0x1af1c1[_0xac4a('0xaa')]=_0x279f9b;return _0x1af1c1;})[_0xac4a('0x27')](respondWithFilteredResult(_0x1c41fb,_0x5a4e2b));})['catch'](handleError(_0x1c41fb,null));};exports[_0xac4a('0xab')]=function(_0x360d4f,_0x4f2b19){var _0x55af32={'raw':![],'where':{'id':_0x360d4f[_0xac4a('0xac')]['id']}},_0x386d6d={};_0x386d6d['model']=_[_0xac4a('0x3a')](db[_0xac4a('0x34')][_0xac4a('0x35')]);_0x386d6d[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x360d4f[_0xac4a('0x39')]);_0x386d6d['filters']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],_0x386d6d[_0xac4a('0x39')]);_0x55af32['attributes']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],qs[_0xac4a('0x93')](_0x360d4f[_0xac4a('0x39')][_0xac4a('0x93')]));_0x55af32[_0xac4a('0x3d')]=_0x55af32['attributes'][_0xac4a('0x63')]?_0x55af32[_0xac4a('0x3d')]:_0x386d6d['model'];if(_0x360d4f[_0xac4a('0x39')]['includeAll']){_0x55af32[_0xac4a('0xad')]=[{'all':!![]}];}_0x55af32=_[_0xac4a('0xae')]({},_0x55af32,_0x360d4f['options']);return db[_0xac4a('0x34')]['find'](_0x55af32)[_0xac4a('0x27')](handleEntityNotFound(_0x4f2b19,null))['then'](respondWithResult(_0x4f2b19,null))[_0xac4a('0x33')](handleError(_0x4f2b19,null));};exports[_0xac4a('0xaf')]=function(_0x24f464,_0xfe8977){return db[_0xac4a('0x34')][_0xac4a('0xaf')](_0x24f464[_0xac4a('0x71')],{})[_0xac4a('0x27')](respondWithResult(_0xfe8977,0xc9))[_0xac4a('0x33')](handleError(_0xfe8977,null));};exports[_0xac4a('0x26')]=function(_0x3a0163,_0x455eb7){if(_0x3a0163[_0xac4a('0x71')]['id']){delete _0x3a0163[_0xac4a('0x71')]['id'];}return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x3a0163[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x455eb7,null))[_0xac4a('0x27')](saveUpdates(_0x3a0163[_0xac4a('0x71')],null))[_0xac4a('0x27')](respondWithResult(_0x455eb7,null))[_0xac4a('0x33')](handleError(_0x455eb7,null));};exports[_0xac4a('0x28')]=function(_0x5d5bb3,_0x101137){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x5d5bb3[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x101137,null))[_0xac4a('0x27')](removeEntity(_0x101137,null))['catch'](handleError(_0x101137,null));};exports[_0xac4a('0xb0')]=function(_0x55866d,_0x277fd1){return db[_0xac4a('0x34')][_0xac4a('0xb0')]()['then'](respondWithResult(_0x277fd1,null))[_0xac4a('0x33')](handleError(_0x277fd1,null));};exports[_0xac4a('0xb1')]=function(_0x127ede,_0x52f3f2,_0x2da95f){return db[_0xac4a('0xb2')][_0xac4a('0x5c')]({'where':{'id':_0x127ede[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x52f3f2,null))[_0xac4a('0x27')](function(_0x3b4183){if(_0x3b4183){return _0x3b4183[_0xac4a('0xb1')](_0x127ede['body'][_0xac4a('0xb3')],_['omit'](_0x127ede['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x52f3f2,null))['catch'](handleError(_0x52f3f2,null));};exports[_0xac4a('0xb4')]=function(_0x58fcb0,_0xc014a6,_0x377444){var _0x2132b2={'raw':![],'where':{}};var _0x525d50={};var _0x9ea4d1={'count':0x0,'rows':[]};return db[_0xac4a('0x34')][_0xac4a('0xb5')]({'where':{'id':_0x58fcb0[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0xc014a6,null))[_0xac4a('0x27')](function(_0x7a1b25){if(_0x7a1b25){_0x525d50[_0xac4a('0x38')]=_['keys'](db[_0xac4a('0xb2')][_0xac4a('0x35')]);_0x525d50[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x58fcb0[_0xac4a('0x39')]);_0x525d50[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x525d50['model'],_0x525d50['query']);_0x2132b2[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x525d50['model'],qs[_0xac4a('0x93')](_0x58fcb0[_0xac4a('0x39')]['fields']));_0x2132b2['attributes']=_0x2132b2[_0xac4a('0x3d')][_0xac4a('0x63')]?_0x2132b2[_0xac4a('0x3d')]:_0x525d50[_0xac4a('0x38')];if(!_0x58fcb0[_0xac4a('0x39')]['hasOwnProperty'](_0xac4a('0x3f'))){_0x2132b2['limit']=qs['limit'](_0x58fcb0['query'][_0xac4a('0x40')]);_0x2132b2[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x21')]);}_0x2132b2[_0xac4a('0x8b')]=qs[_0xac4a('0x41')](_0x58fcb0[_0xac4a('0x39')]['sort']);_0x2132b2['where']=qs['filters'](_[_0xac4a('0x43')](_0x58fcb0[_0xac4a('0x39')],_0x525d50[_0xac4a('0x3b')]));_0x2132b2[_0xac4a('0x42')][_0xac4a('0xa8')]=_0x7a1b25['id'];if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]){_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],{'$or':_[_0xac4a('0x2d')](_0x2132b2[_0xac4a('0x3d')],function(_0xe0fd57){var _0x32b013={};_0x32b013[_0xe0fd57]={'$like':'%'+_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]+'%'};return _0x32b013;})});}if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')]){var _0x41cdb5=_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')][_0xac4a('0x31')](',');var _0x3e2575={};_0x3e2575[_0x41cdb5[0x0]]={'$gte':moment(_0x41cdb5[0x1])['format'](_0xac4a('0xb6'))};_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],_0x3e2575);}_0x2132b2=_[_0xac4a('0xae')]({},_0x2132b2,_0x58fcb0[_0xac4a('0xb7')]);return db[_0xac4a('0xb2')][_0xac4a('0x20')]({'where':_0x2132b2['where']})['then'](function(_0x113f80){_0x9ea4d1[_0xac4a('0x20')]=_0x113f80;if(_0x58fcb0[_0xac4a('0x39')]['includeAll']){_0x2132b2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xac4a('0xb8')](_0x2132b2);})['then'](function(_0x59e82c){_0x9ea4d1[_0xac4a('0xaa')]=_0x59e82c;return _0x9ea4d1;});}})['then'](respondWithFilteredResult(_0xc014a6,_0x2132b2))[_0xac4a('0x33')](handleError(_0xc014a6,null));};exports['addTags']=function(_0x3f95a4,_0x2b4f28,_0x413f5f){return db[_0xac4a('0x34')][_0xac4a('0x5c')]({'where':{'id':_0x3f95a4[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2b4f28,null))[_0xac4a('0x27')](function(_0x34b6d7){if(_0x34b6d7){return _0x34b6d7[_0xac4a('0xb9')](_0x3f95a4['body'][_0xac4a('0xb3')],_[_0xac4a('0xba')](_0x3f95a4[_0xac4a('0x71')],[_0xac4a('0xb3'),'id'])||{})['spread'](function(){return db[_0xac4a('0x69')][_0xac4a('0xb8')]({'attributes':['id',_0xac4a('0x2b'),_0xac4a('0x46')],'where':{'id':_0x3f95a4[_0xac4a('0x71')][_0xac4a('0xb3')]}});})['then'](function(_0x57d3cd){socket[_0xac4a('0xbb')](_0xac4a('0xbc'),{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]});return{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]};});}})[_0xac4a('0x27')](respondWithResult(_0x2b4f28,null))[_0xac4a('0x33')](handleError(_0x2b4f28,null));};exports['removeTags']=function(_0x21a6f6,_0x580c9b,_0xe4165d){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x21a6f6[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x580c9b,null))[_0xac4a('0x27')](function(_0x5650ce){if(_0x5650ce){return _0x5650ce[_0xac4a('0xbd')](_0x21a6f6[_0xac4a('0x39')][_0xac4a('0xb3')]);}})[_0xac4a('0x27')](respondWithStatusCode(_0x580c9b,null))[_0xac4a('0x33')](handleError(_0x580c9b,null));};exports['download']=function(_0x3dd60a,_0xbe1958){var _0x462964=moment()[_0xac4a('0xbe')]()[_0xac4a('0x91')]();var _0x5e5eb1=path[_0xac4a('0xbf')](config[_0xac4a('0xc0')],_0xac4a('0xc1'),_0xac4a('0xc2'),_0xac4a('0xc3'));var _0x55ccc3=path['join'](config['root'],'server',_0xac4a('0xc2'),_0xac4a('0xc4'));var _0x17f815=path[_0xac4a('0xbf')](_0x5e5eb1,_0x462964);var _0xa8b5bb=util['format'](_0xac4a('0xc5'),_0x3dd60a[_0xac4a('0xac')]['id'],_0x462964);var _0x5aad90=path[_0xac4a('0xbf')](_0x5e5eb1,_0xa8b5bb);var _0x14b425=[];_0x14b425[_0xac4a('0x32')]({'model':db['User'],'as':_0xac4a('0x6d'),'attributes':['id',_0xac4a('0x2e')],'raw':!![]});_0x14b425[_0xac4a('0x32')]({'model':db[_0xac4a('0xc6')],'as':_0xac4a('0x61'),'attributes':['id',_0xac4a('0xc7'),_0xac4a('0xc8')],'raw':!![]});if(_0x3dd60a[_0xac4a('0x39')][_0xac4a('0xc4')]){_0x14b425['push']({'model':db[_0xac4a('0xc9')],'as':_0xac4a('0xc9'),'raw':!![]});}var _0x579181=[{'model':db[_0xac4a('0xb2')],'as':'Messages','attributes':['id',_0xac4a('0x71'),_0xac4a('0xca'),'direction',_0xac4a('0xcb'),_0xac4a('0x7e')],'include':_0x14b425}];_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0xcc')],'as':_0xac4a('0xcd'),'attributes':['id',_0xac4a('0x2b')]});_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0x6d')],'as':'Owner','attributes':['id','fullname']});return db[_0xac4a('0x34')]['find']({'where':{'id':_0x3dd60a['params']['id']},'include':_0x579181})[_0xac4a('0x27')](handleEntityNotFound(_0xbe1958,null))[_0xac4a('0x27')](function(_0x3254c3){if(_0x3254c3){var _0x516225=_0x3254c3[_0xac4a('0xce')]({'plain':!![]});fs[_0xac4a('0xcf')](_0x17f815);var _0x5a2abf={'format':'A4','border':'10px','header':{'height':_0xac4a('0xd0'),'contents':{'first':_0xac4a('0xd1')}},'footer':{'height':_0xac4a('0xd2'),'contents':{'default':util[_0xac4a('0xd3')]('\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[_0xac4a('0xd3')](_0xac4a('0xd4'),_0xac4a('0xd5'),_0x516225['id']),moment()['format'](_0xac4a('0xd6'))[_0xac4a('0x91')]())}}};var _0x15b97a={'channel':_0xac4a('0xd5'),'account':_0x516225[_0xac4a('0xcd')]['name'],'agent':_0x516225['Owner']?_0x516225[_0xac4a('0xd7')][_0xac4a('0x2e')]:_0xac4a('0xd8'),'createdAt':moment(_0x516225[_0xac4a('0xca')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')](),'closedAt':_0x516225[_0xac4a('0xd9')]?moment(_0x516225[_0xac4a('0xda')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')]():'','disposition':_0x516225[_0xac4a('0xdb')],'messages':_(_0x516225['Messages'])[_0xac4a('0x83')]({'secret':![]})['map'](function(_0x4ec2c3){if(_0x4ec2c3[_0xac4a('0xc9')]){var _0x27833a=path[_0xac4a('0xbf')](_0x55ccc3,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]);if(fs[_0xac4a('0xdd')](_0x27833a)){fs[_0xac4a('0xde')](_0x27833a)[_0xac4a('0xdf')](fs[_0xac4a('0xe0')](path['join'](_0x17f815,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')])));}}return{'date':moment(_0x4ec2c3[_0xac4a('0xca')])[_0xac4a('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4ec2c3[_0xac4a('0xe1')]===_0xac4a('0xe2')?_0x4ec2c3[_0xac4a('0x6d')]?_0x4ec2c3[_0xac4a('0x6d')][_0xac4a('0x2e')]:_0xac4a('0xe3'):_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc7')]+(_0x4ec2c3[_0xac4a('0x61')]['lastName']?'\x20'+_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc8')]:''),'body':_0x4ec2c3[_0xac4a('0xc9')]?_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]:_0x4ec2c3[_0xac4a('0x71')],'direction':_0x4ec2c3['direction']==='out'?'A':'C','secret':_0x4ec2c3['secret'],'read':_0x4ec2c3[_0xac4a('0x7e')],'attachment':_0x4ec2c3[_0xac4a('0xc9')]};})['value']()};return ejs['renderFile'](path[_0xac4a('0xbf')](config['root'],_0xac4a('0xc1'),'views',_0xac4a('0xe4')),{'interaction':_0x15b97a})[_0xac4a('0x27')](function(_0x1888c3){return new BPromise(function(_0x4a04c3,_0x14435d){pdf[_0xac4a('0xaf')](_0x1888c3,_0x5a2abf)['toFile'](path[_0xac4a('0xbf')](_0x17f815,_0xac4a('0xe5')+_0x516225['id']+'-'+_0x462964+'.pdf'),function(_0x48a75c,_0x4514a5){if(_0x48a75c)return _0x14435d(_0x48a75c);_0x4a04c3(_0x4514a5);});});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x43df37,_0x45e45b){zipdir(_0x17f815,{'saveTo':_0x5aad90},function(_0x367254,_0x22cc71){if(_0x367254)return _0x45e45b(_0x367254);return _0x43df37(_0x22cc71);});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x1ea4ef,_0x156b67){rimraf(_0x17f815,function(_0x330070){if(_0x330070)_0x156b67(_0x330070);return _0x1ea4ef();});});})[_0xac4a('0x27')](function(){return _0xbe1958[_0xac4a('0xe6')](_0x5aad90,_0xa8b5bb,function(_0x2d755c){if(_0x2d755c){console[_0xac4a('0xe7')](_0xac4a('0xe8'),_0x2d755c);}else{fs[_0xac4a('0xe9')](_0x5aad90);}});});});}else{return _0xbe1958[_0xac4a('0x1c')](0xc8);}})['catch'](handleError(_0xbe1958,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 1d35d6e..6f85ad8 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73be=['WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','getUsers','then','Users','map','findAll','setDataValue','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1bd9fa,_0x182b0c){var _0x21032e=function(_0x7db43e){while(--_0x7db43e){_0x1bd9fa['push'](_0x1bd9fa['shift']());}};_0x21032e(++_0x182b0c);}(_0x73be,0x163));var _0xe73b=function(_0x1422c2,_0x55aa95){_0x1422c2=_0x1422c2-0x0;var _0x5e0276=_0x73be[_0x1422c2];return _0x5e0276;};'use strict';var EventEmitter=require(_0xe73b('0x0'));var WhatsappInteraction=require(_0xe73b('0x1'))['db'][_0xe73b('0x2')];var WhatsappMessage=require(_0xe73b('0x1'))['db'][_0xe73b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe73b('0x4')](0x0);var events={'afterCreate':_0xe73b('0x5'),'afterUpdate':'update','afterDestroy':_0xe73b('0x6')};function emitEvent(_0x1145e0){return function(_0x52ba44,_0x498a3c,_0x2d1a2c){_0x52ba44[_0xe73b('0x7')]({'attributes':['id'],'raw':!![]})[_0xe73b('0x8')](function(_0x4773a4){_0x52ba44['setDataValue'](_0xe73b('0x9'),_0x4773a4[_0xe73b('0xa')](function(_0xe024d1){return{'id':_0xe024d1['id']};}));return WhatsappMessage[_0xe73b('0xb')]({'where':{'WhatsappInteractionId':_0x52ba44['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e5208){_0x52ba44[_0xe73b('0xc')]('unreadMessages',_0x2e5208['length']);WhatsappInteractionEvents[_0xe73b('0xd')](_0x1145e0+':'+_0x52ba44['id'],_0x52ba44);WhatsappInteractionEvents[_0xe73b('0xd')](_0x1145e0,_0x52ba44);_0x2d1a2c(null);})[_0xe73b('0xe')](_0x2d1a2c(null));};}for(var e in events){if(events[_0xe73b('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xe73b('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x77eb=['Users','map','unreadMessages','emit','catch','hasOwnProperty','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x595112,_0xdeaf88){var _0x33f8a2=function(_0x28e70d){while(--_0x28e70d){_0x595112['push'](_0x595112['shift']());}};_0x33f8a2(++_0xdeaf88);}(_0x77eb,0x128));var _0xb77e=function(_0x11b58d,_0x555c55){_0x11b58d=_0x11b58d-0x0;var _0xc2811b=_0x77eb[_0x11b58d];return _0xc2811b;};'use strict';var EventEmitter=require(_0xb77e('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xb77e('0x1')];var WhatsappMessage=require(_0xb77e('0x2'))['db'][_0xb77e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb77e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb77e('0x5'),'afterDestroy':_0xb77e('0x6')};function emitEvent(_0x50b069){return function(_0x24391e,_0x5d74e0,_0x34cab2){_0x24391e[_0xb77e('0x7')]({'attributes':['id'],'raw':!![]})[_0xb77e('0x8')](function(_0x2e0eae){_0x24391e[_0xb77e('0x9')](_0xb77e('0xa'),_0x2e0eae[_0xb77e('0xb')](function(_0x1d1488){return{'id':_0x1d1488['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x24391e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb77e('0x8')](function(_0xb041b6){_0x24391e[_0xb77e('0x9')](_0xb77e('0xc'),_0xb041b6['length']);WhatsappInteractionEvents[_0xb77e('0xd')](_0x50b069+':'+_0x24391e['id'],_0x24391e);WhatsappInteractionEvents[_0xb77e('0xd')](_0x50b069,_0x24391e);_0x34cab2(null);})[_0xb77e('0xe')](_0x34cab2(null));};}for(var e in events){if(events[_0xb77e('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xb77e('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 56c6398..ce80df0 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x4365ca,_0x4c3ef2){var _0x506f4d=function(_0x195ff6){while(--_0x195ff6){_0x4365ca['push'](_0x4365ca['shift']());}};_0x506f4d(++_0x4c3ef2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});}; \ No newline at end of file +var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x39f027,_0x3cd724){var _0x315828=function(_0x16b0fb){while(--_0x16b0fb){_0x39f027['push'](_0x39f027['shift']());}};_0x315828(++_0x3cd724);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index e7a205f..da3285c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc485=['body','omit','ids','spread','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappInteraction.socket','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateWhatsappInteraction','update','options','where','attributes','limit','then','catch','WhatsappInteraction','find','addTags'];(function(_0xe781c3,_0x2086ad){var _0x51391b=function(_0x594034){while(--_0x594034){_0xe781c3['push'](_0xe781c3['shift']());}};_0x51391b(++_0x2086ad);}(_0xc485,0x1c0));var _0x5c48=function(_0x23b946,_0x2653e1){_0x23b946=_0x23b946-0x0;var _0xcfad4f=_0xc485[_0x23b946];return _0xcfad4f;};'use strict';var _=require(_0x5c48('0x0'));var util=require(_0x5c48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c48('0x2'));var fs=require('fs');var Redis=require(_0x5c48('0x3'));var db=require(_0x5c48('0x4'))['db'];var utils=require(_0x5c48('0x5'));var logger=require(_0x5c48('0x6'))('rpc');var config=require(_0x5c48('0x7'));var jayson=require(_0x5c48('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5c48('0x9')]=_[_0x5c48('0xa')](config[_0x5c48('0x9')],{'host':_0x5c48('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c48('0x9')]));require(_0x5c48('0xc'))['register'](socket);function respondWithRpcPromise(_0x5699ff,_0x4d3845,_0x7e6680){return new BPromise(function(_0x1e4e55,_0x57c90e){return client['request'](_0x5699ff,_0x7e6680)['then'](function(_0x19fd67){logger[_0x5c48('0xd')](_0x5c48('0xe'),_0x4d3845,_0x5c48('0xf'));logger[_0x5c48('0x10')](_0x5c48('0x11'),_0x4d3845,_0x5c48('0xf'),JSON[_0x5c48('0x12')](_0x19fd67));if(_0x19fd67[_0x5c48('0x13')]){if(_0x19fd67[_0x5c48('0x13')]['code']===0x1f4){logger['error'](_0x5c48('0xe'),_0x4d3845,_0x19fd67[_0x5c48('0x13')][_0x5c48('0x14')]);return _0x57c90e(_0x19fd67['error'][_0x5c48('0x14')]);}logger[_0x5c48('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d3845,_0x19fd67[_0x5c48('0x13')][_0x5c48('0x14')]);return _0x1e4e55(_0x19fd67[_0x5c48('0x13')][_0x5c48('0x14')]);}else{logger[_0x5c48('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d3845,'request\x20sent');_0x1e4e55(_0x19fd67[_0x5c48('0x15')][_0x5c48('0x14')]);}})['catch'](function(_0x29590a){logger[_0x5c48('0x13')](_0x5c48('0xe'),_0x4d3845,_0x29590a);_0x57c90e(_0x29590a);});});}exports[_0x5c48('0x16')]=function(_0x27e01c){var _0x46252c=this;return new Promise(function(_0x5cdd0,_0x3a3d2a){return db['WhatsappInteraction'][_0x5c48('0x17')](_0x27e01c['body'],{'raw':_0x27e01c['options']?_0x27e01c[_0x5c48('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27e01c['options']?_0x27e01c['options'][_0x5c48('0x19')]||null:null,'attributes':_0x27e01c[_0x5c48('0x18')]?_0x27e01c['options'][_0x5c48('0x1a')]||null:null,'limit':_0x27e01c[_0x5c48('0x18')]?_0x27e01c[_0x5c48('0x18')][_0x5c48('0x1b')]||null:null})[_0x5c48('0x1c')](function(_0x46113e){logger[_0x5c48('0xd')](_0x5c48('0x16'),_0x27e01c);logger[_0x5c48('0x10')](_0x5c48('0x16'),_0x27e01c,JSON[_0x5c48('0x12')](_0x46113e));_0x5cdd0(_0x46113e);})[_0x5c48('0x1d')](function(_0x4f1911){logger[_0x5c48('0x13')](_0x5c48('0x16'),_0x4f1911[_0x5c48('0x14')],_0x27e01c);_0x3a3d2a(_0x46252c[_0x5c48('0x13')](0x1f4,_0x4f1911[_0x5c48('0x14')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x292f96){return new Promise(function(_0x268ab2,_0xec5ee2){return db[_0x5c48('0x1e')][_0x5c48('0x1f')]({'where':_0x292f96[_0x5c48('0x18')]?_0x292f96[_0x5c48('0x18')][_0x5c48('0x19')]||null:null})[_0x5c48('0x1c')](function(_0x224780){if(_0x224780){return _0x224780[_0x5c48('0x20')](_0x292f96[_0x5c48('0x21')]['ids'],_[_0x5c48('0x22')](_0x292f96[_0x5c48('0x21')],[_0x5c48('0x23'),'id'])||{});}})[_0x5c48('0x24')](function(_0x217819){logger[_0x5c48('0xd')]('AddTags',_0x292f96);logger[_0x5c48('0x10')]('AddTags',_0x292f96,JSON[_0x5c48('0x12')](_0x217819));_0x268ab2(_0x217819);})[_0x5c48('0x1d')](function(_0x28accc){logger[_0x5c48('0x13')]('AddTags',_0x28accc[_0x5c48('0x14')],_0x292f96);_0xec5ee2(_this[_0x5c48('0x13')](0x1f4,_0x28accc[_0x5c48('0x14')]));});});}; \ No newline at end of file +var _0x1b25=['./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','find','addTags','body','omit','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x1b25,0x152));var _0x51b2=function(_0x3d1c32,_0x2ddd4d){_0x3d1c32=_0x3d1c32-0x0;var _0x57291b=_0x1b25[_0x3d1c32];return _0x57291b;};'use strict';var _=require(_0x51b2('0x0'));var util=require(_0x51b2('0x1'));var moment=require(_0x51b2('0x2'));var BPromise=require(_0x51b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51b2('0x5'));var logger=require('../../config/logger')(_0x51b2('0x6'));var config=require(_0x51b2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x51b2('0x8')][_0x51b2('0x9')]({'port':0x232a});config[_0x51b2('0xa')]=_[_0x51b2('0xb')](config[_0x51b2('0xa')],{'host':_0x51b2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51b2('0xa')]));require(_0x51b2('0xd'))[_0x51b2('0xe')](socket);function respondWithRpcPromise(_0x4c3714,_0x345456,_0x52c25c){return new BPromise(function(_0x4fbada,_0x4e0775){return client['request'](_0x4c3714,_0x52c25c)[_0x51b2('0xf')](function(_0x37ea04){logger[_0x51b2('0x10')](_0x51b2('0x11'),_0x345456,_0x51b2('0x12'));logger[_0x51b2('0x13')](_0x51b2('0x14'),_0x345456,_0x51b2('0x12'),JSON[_0x51b2('0x15')](_0x37ea04));if(_0x37ea04[_0x51b2('0x16')]){if(_0x37ea04['error']['code']===0x1f4){logger[_0x51b2('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x345456,_0x37ea04['error'][_0x51b2('0x17')]);return _0x4e0775(_0x37ea04['error']['message']);}logger[_0x51b2('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x345456,_0x37ea04['error'][_0x51b2('0x17')]);return _0x4fbada(_0x37ea04['error'][_0x51b2('0x17')]);}else{logger[_0x51b2('0x10')](_0x51b2('0x11'),_0x345456,_0x51b2('0x12'));_0x4fbada(_0x37ea04['result'][_0x51b2('0x17')]);}})[_0x51b2('0x18')](function(_0x22f020){logger[_0x51b2('0x16')](_0x51b2('0x11'),_0x345456,_0x22f020);_0x4e0775(_0x22f020);});});}exports[_0x51b2('0x19')]=function(_0xa533e0){var _0x498466=this;return new Promise(function(_0x324776,_0x1bbe57){return db[_0x51b2('0x1a')][_0x51b2('0x1b')](_0xa533e0['body'],{'raw':_0xa533e0[_0x51b2('0x1c')]?_0xa533e0[_0x51b2('0x1c')][_0x51b2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa533e0[_0x51b2('0x1c')]?_0xa533e0[_0x51b2('0x1c')][_0x51b2('0x1e')]||null:null,'attributes':_0xa533e0[_0x51b2('0x1c')]?_0xa533e0[_0x51b2('0x1c')][_0x51b2('0x1f')]||null:null,'limit':_0xa533e0[_0x51b2('0x1c')]?_0xa533e0[_0x51b2('0x1c')][_0x51b2('0x20')]||null:null})['then'](function(_0x1c3851){logger[_0x51b2('0x10')](_0x51b2('0x19'),_0xa533e0);logger[_0x51b2('0x13')](_0x51b2('0x19'),_0xa533e0,JSON['stringify'](_0x1c3851));_0x324776(_0x1c3851);})[_0x51b2('0x18')](function(_0x1028ef){logger['error'](_0x51b2('0x19'),_0x1028ef['message'],_0xa533e0);_0x1bbe57(_0x498466[_0x51b2('0x16')](0x1f4,_0x1028ef[_0x51b2('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4ab088){return new Promise(function(_0x2a2352,_0x13a680){return db[_0x51b2('0x1a')][_0x51b2('0x21')]({'where':_0x4ab088[_0x51b2('0x1c')]?_0x4ab088['options'][_0x51b2('0x1e')]||null:null})['then'](function(_0x1caf6d){if(_0x1caf6d){return _0x1caf6d[_0x51b2('0x22')](_0x4ab088[_0x51b2('0x23')]['ids'],_[_0x51b2('0x24')](_0x4ab088['body'],[_0x51b2('0x25'),'id'])||{});}})['spread'](function(_0x498881){logger[_0x51b2('0x10')]('AddTags',_0x4ab088);logger['debug'](_0x51b2('0x26'),_0x4ab088,JSON['stringify'](_0x498881));_0x2a2352(_0x498881);})['catch'](function(_0x1559ff){logger[_0x51b2('0x16')](_0x51b2('0x26'),_0x1559ff[_0x51b2('0x17')],_0x4ab088);_0x13a680(_this[_0x51b2('0x16')](0x1f4,_0x1559ff['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index cae1529..8af42b8 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x838b=['register','./whatsappInteraction.events','save','remove','emit'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x838b,0x196));var _0xb838=function(_0x8f6080,_0x5ad41a){_0x8f6080=_0x8f6080-0x0;var _0x3e6746=_0x838b[_0x8f6080];return _0x3e6746;};'use strict';var WhatsappInteractionEvents=require(_0xb838('0x0'));var events=[_0xb838('0x1'),_0xb838('0x2'),'update'];function createListener(_0x3d0aee,_0x499a41){return function(_0x3a25b4){_0x499a41[_0xb838('0x3')](_0x3d0aee,_0x3a25b4);};}function removeListener(_0x4ece8f,_0x5d650e){return function(){WhatsappInteractionEvents['removeListener'](_0x4ece8f,_0x5d650e);};}exports[_0xb838('0x4')]=function(_0x2239d4){for(var _0x2d6242=0x0,_0x4df560=events['length'];_0x2d6242<_0x4df560;_0x2d6242++){var _0x3b2624=events[_0x2d6242];var _0x347fa3=createListener('whatsappInteraction:'+_0x3b2624,_0x2239d4);WhatsappInteractionEvents['on'](_0x3b2624,_0x347fa3);}}; \ No newline at end of file +var _0x99cc=['length','save','remove','update','emit','removeListener','register'];(function(_0x1879c6,_0x593e24){var _0x2f6f5f=function(_0x32d01a){while(--_0x32d01a){_0x1879c6['push'](_0x1879c6['shift']());}};_0x2f6f5f(++_0x593e24);}(_0x99cc,0x1cf));var _0xc99c=function(_0x46d425,_0x4de85f){_0x46d425=_0x46d425-0x0;var _0xd6cd1a=_0x99cc[_0x46d425];return _0xd6cd1a;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xc99c('0x0'),_0xc99c('0x1'),_0xc99c('0x2')];function createListener(_0xe1a8a2,_0x59fed5){return function(_0x128ce){_0x59fed5[_0xc99c('0x3')](_0xe1a8a2,_0x128ce);};}function removeListener(_0x3a2c8a,_0x34d60a){return function(){WhatsappInteractionEvents[_0xc99c('0x4')](_0x3a2c8a,_0x34d60a);};}exports[_0xc99c('0x5')]=function(_0x156028){for(var _0x2c4691=0x0,_0x31a196=events[_0xc99c('0x6')];_0x2c4691<_0x31a196;_0x2c4691++){var _0x1c9d03=events[_0x2c4691];var _0x2707bb=createListener('whatsappInteraction:'+_0x1c9d03,_0x156028);WhatsappInteractionEvents['on'](_0x1c9d03,_0x2707bb);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2bc677b..de23667 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe631=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','isAuthenticated','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe631,0x197));var _0x1e63=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xe631[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x1e63('0x0'));var util=require(_0x1e63('0x1'));var path=require(_0x1e63('0x2'));var timeout=require(_0x1e63('0x3'));var express=require(_0x1e63('0x4'));var router=express['Router']();var auth=require(_0x1e63('0x5'));var interaction=require(_0x1e63('0x6'));var config=require(_0x1e63('0x7'));var controller=require(_0x1e63('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e63('0x9')]);router[_0x1e63('0xa')]('/describe',auth[_0x1e63('0xb')](),controller['describe']);router[_0x1e63('0xa')](_0x1e63('0xc'),auth[_0x1e63('0xb')](),controller[_0x1e63('0xd')]);router[_0x1e63('0xe')]('/',auth[_0x1e63('0xb')](),interaction[_0x1e63('0xf')](_0x1e63('0x10'),_0x1e63('0x11')),controller[_0x1e63('0x12')]);router[_0x1e63('0xe')](_0x1e63('0x13'),controller[_0x1e63('0x14')]);router[_0x1e63('0x15')]('/:id',auth[_0x1e63('0xb')](),controller['update']);router[_0x1e63('0x15')](_0x1e63('0x16'),auth[_0x1e63('0xb')](),controller[_0x1e63('0x17')]);router['put'](_0x1e63('0x18'),auth[_0x1e63('0xb')](),controller[_0x1e63('0x19')]);router[_0x1e63('0x1a')](_0x1e63('0xc'),auth[_0x1e63('0xb')](),controller[_0x1e63('0x1b')]);module[_0x1e63('0x1c')]=router; \ No newline at end of file +var _0xda51=['isAuthenticated','index','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','accept','/:id/reject','reject','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get'];(function(_0x4de226,_0xf589ec){var _0x2fb276=function(_0x3f99ed){while(--_0x3f99ed){_0x4de226['push'](_0x4de226['shift']());}};_0x2fb276(++_0xf589ec);}(_0xda51,0x1a6));var _0x1da5=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xda51[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0x1da5('0x0'));var util=require(_0x1da5('0x1'));var path=require(_0x1da5('0x2'));var timeout=require(_0x1da5('0x3'));var express=require(_0x1da5('0x4'));var router=express[_0x1da5('0x5')]();var auth=require(_0x1da5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1da5('0x7'));var controller=require(_0x1da5('0x8'));router[_0x1da5('0x9')]('/',auth[_0x1da5('0xa')](),controller[_0x1da5('0xb')]);router['get']('/describe',auth[_0x1da5('0xa')](),controller['describe']);router['get'](_0x1da5('0xc'),auth[_0x1da5('0xa')](),controller[_0x1da5('0xd')]);router[_0x1da5('0xe')]('/',auth[_0x1da5('0xa')](),interaction[_0x1da5('0xf')](_0x1da5('0x10'),_0x1da5('0x11')),controller['create']);router['post'](_0x1da5('0x12'),controller[_0x1da5('0x13')]);router['put'](_0x1da5('0xc'),auth[_0x1da5('0xa')](),controller['update']);router[_0x1da5('0x14')]('/:id/accept',auth[_0x1da5('0xa')](),controller[_0x1da5('0x15')]);router[_0x1da5('0x14')](_0x1da5('0x16'),auth[_0x1da5('0xa')](),controller[_0x1da5('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index ddd6e99..2063049 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27df=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x169dad,_0x3f495e){var _0x573abf=function(_0x830ba0){while(--_0x830ba0){_0x169dad['push'](_0x169dad['shift']());}};_0x573abf(++_0x3f495e);}(_0x27df,0x16a));var _0xf27d=function(_0x3ad8d3,_0xa9525e){_0x3ad8d3=_0x3ad8d3-0x0;var _0x4ebec5=_0x27df[_0x3ad8d3];return _0x4ebec5;};'use strict';var Sequelize=require(_0xf27d('0x0'));module[_0xf27d('0x1')]={'body':{'type':Sequelize[_0xf27d('0x2')](_0xf27d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf27d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf27d('0x5')),'defaultValue':_0xf27d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf27d('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf27d('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc507=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x31e965,_0xbd1e54){var _0x120351=function(_0x45229d){while(--_0x45229d){_0x31e965['push'](_0x31e965['shift']());}};_0x120351(++_0xbd1e54);}(_0xc507,0x8d));var _0x7c50=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xc507[_0x5e3701];return _0x345dcf;};'use strict';var Sequelize=require(_0x7c50('0x0'));module[_0x7c50('0x1')]={'body':{'type':Sequelize[_0x7c50('0x2')](_0x7c50('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7c50('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7c50('0x5')]('in',_0x7c50('0x6')),'defaultValue':_0x7c50('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7c50('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7c50('0x8')]},'secret':{'type':Sequelize[_0x7c50('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ac38ef0..85138ed 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefc6=['index','map','WhatsappMessage','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','WhatsappInteraction','WhatsappInteractionId','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','role','RejectMessage','rejectMessage','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','ValidationError','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send'];(function(_0x47c7eb,_0x3e3655){var _0x148991=function(_0x52dc2d){while(--_0x52dc2d){_0x47c7eb['push'](_0x47c7eb['shift']());}};_0x148991(++_0x3e3655);}(_0xefc6,0xc8));var _0x6efc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xefc6[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6efc('0x0'));var jsonpatch=require(_0x6efc('0x1'));var rp=require(_0x6efc('0x2'));var moment=require(_0x6efc('0x3'));var BPromise=require(_0x6efc('0x4'));var Mustache=require(_0x6efc('0x5'));var util=require(_0x6efc('0x6'));var path=require('path');var sox=require(_0x6efc('0x7'));var csv=require(_0x6efc('0x8'));var ejs=require(_0x6efc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6efc('0xa'));var crypto=require(_0x6efc('0xb'));var jsforce=require(_0x6efc('0xc'));var deskjs=require(_0x6efc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6efc('0xe'));var Papa=require(_0x6efc('0xf'));var Redis=require(_0x6efc('0x10'));var authService=require(_0x6efc('0x11'));var qs=require(_0x6efc('0x12'));var as=require(_0x6efc('0x13'));var hardwareService=require(_0x6efc('0x14'));var logger=require('../../config/logger')(_0x6efc('0x15'));var utils=require(_0x6efc('0x16'));var config=require(_0x6efc('0x17'));var db=require('../../mysqldb')['db'];config[_0x6efc('0x18')]=_[_0x6efc('0x19')](config[_0x6efc('0x18')],{'host':_0x6efc('0x1a'),'port':0x18eb});var socket=require(_0x6efc('0x1b'))(new Redis(config[_0x6efc('0x18')]));require(_0x6efc('0x1c'))[_0x6efc('0x1d')](socket);var jayson=require(_0x6efc('0x1e'));var client=jayson[_0x6efc('0x1f')][_0x6efc('0x20')]({'port':0x232c});var client9002=jayson[_0x6efc('0x1f')][_0x6efc('0x20')]({'port':0x232a});function checkPasswordPattern(_0x328c1d,_0x382291,_0x17e962){if(_0x17e962){var _0x1b238c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b238c['test'](_0x382291)){return _0x328c1d;}else{throw new db['Sequelize'][(_0x6efc('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 _0x328c1d;}}function respondWithRpcPromise(_0x8ff10c,_0x273b00,_0x44eed4,_0xc84a9){return new BPromise(function(_0x2e673d,_0x45602d){var _0x6f1e5c=_0xc84a9||client;return _0x6f1e5c['request'](_0x8ff10c,_0x44eed4)[_0x6efc('0x22')](function(_0x54c20e){logger[_0x6efc('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x273b00,_0x6efc('0x24'));logger[_0x6efc('0x25')](_0x6efc('0x26'),_0x273b00,_0x6efc('0x24'),JSON[_0x6efc('0x27')](_0x54c20e));if(_0x54c20e[_0x6efc('0x28')]){if(_0x54c20e['error'][_0x6efc('0x29')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x273b00,_0x54c20e[_0x6efc('0x28')]['message']);return _0x45602d(_0x54c20e[_0x6efc('0x28')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x273b00,_0x54c20e[_0x6efc('0x28')]['message']);return _0x2e673d(_0x54c20e[_0x6efc('0x28')][_0x6efc('0x2a')]);}else{logger['info'](_0x6efc('0x2b'),_0x273b00,_0x6efc('0x24'));_0x2e673d(_0x54c20e[_0x6efc('0x2c')][_0x6efc('0x2a')]);}})[_0x6efc('0x2d')](function(_0x147c00){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x273b00,_0x147c00);_0x45602d(_0x147c00);});});}function respondWithStatusCode(_0x19c974,_0x1fc7b8){_0x1fc7b8=_0x1fc7b8||0xcc;return function(_0x126459){if(_0x126459){return _0x19c974[_0x6efc('0x2e')](_0x1fc7b8);}return _0x19c974[_0x6efc('0x2f')](_0x1fc7b8)[_0x6efc('0x30')]();};}function respondWithResult(_0x47f60f,_0x3bb658){_0x3bb658=_0x3bb658||0xc8;return function(_0x5d0d3b){if(_0x5d0d3b){return _0x47f60f['status'](_0x3bb658)[_0x6efc('0x31')](_0x5d0d3b);}};}function respondWithFilteredResult(_0x9af85b,_0x235c0f){return function(_0x10745d){if(_0x10745d){var _0x14fd71=_0x10745d[_0x6efc('0x32')],_0xfdc4be=_0x235c0f['offset'],_0x413fdf=_0x235c0f[_0x6efc('0x33')]+_0x235c0f[_0x6efc('0x34')],_0x3df212;if(_0x413fdf>=_0x14fd71){_0x413fdf=_0x14fd71;_0x3df212=0xc8;}else{_0x3df212=0xce;}_0x9af85b[_0x6efc('0x2f')](_0x3df212);return _0x9af85b[_0x6efc('0x35')](_0x6efc('0x36'),_0xfdc4be+'-'+_0x413fdf+'/'+_0x14fd71)[_0x6efc('0x31')](_0x10745d);}return null;};}function patchUpdates(_0x9afdb8){return function(_0x4d60cd){try{jsonpatch[_0x6efc('0x37')](_0x4d60cd,_0x9afdb8,!![]);}catch(_0x5afde1){return BPromise[_0x6efc('0x38')](_0x5afde1);}return _0x4d60cd[_0x6efc('0x39')]();};}function saveUpdates(_0x1e16e6,_0x370a6d){return function(_0x41c093){if(_0x41c093){return _0x41c093[_0x6efc('0x3a')](_0x1e16e6)[_0x6efc('0x22')](function(_0x101291){return _0x101291;});}return null;};}function removeEntity(_0x376a95,_0x3292d0){return function(_0x5cc3d3){if(_0x5cc3d3){return _0x5cc3d3['destroy']()[_0x6efc('0x22')](function(){_0x376a95[_0x6efc('0x2f')](0xcc)[_0x6efc('0x30')]();});}};}function handleEntityNotFound(_0x249f59,_0x4aa1fc){return function(_0x356f00){if(!_0x356f00){_0x249f59['sendStatus'](0x194);}return _0x356f00;};}function handleError(_0x1dc733,_0x418671){_0x418671=_0x418671||0x1f4;return function(_0x533873){logger[_0x6efc('0x28')](_0x533873[_0x6efc('0x3b')]);if(_0x533873[_0x6efc('0x3c')]){delete _0x533873[_0x6efc('0x3c')];}_0x1dc733[_0x6efc('0x2f')](_0x418671)[_0x6efc('0x3d')](_0x533873);};}exports[_0x6efc('0x3e')]=function(_0x57e9cb,_0x2f86a0){var _0x2b98ae={},_0x57821c={},_0x2f455c={'count':0x0,'rows':[]};var _0x2da020=_[_0x6efc('0x3f')](db[_0x6efc('0x40')]['rawAttributes'],function(_0x15464e){return{'name':_0x15464e[_0x6efc('0x41')],'type':_0x15464e['type'][_0x6efc('0x42')]};});_0x57821c['model']=_['map'](_0x2da020,'name');_0x57821c['query']=_[_0x6efc('0x43')](_0x57e9cb[_0x6efc('0x44')]);_0x57821c[_0x6efc('0x45')]=_[_0x6efc('0x46')](_0x57821c[_0x6efc('0x47')],_0x57821c[_0x6efc('0x44')]);_0x2b98ae['attributes']=_[_0x6efc('0x46')](_0x57821c['model'],qs[_0x6efc('0x48')](_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x48')]));_0x2b98ae[_0x6efc('0x49')]=_0x2b98ae['attributes'][_0x6efc('0x4a')]?_0x2b98ae[_0x6efc('0x49')]:_0x57821c['model'];if(!_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x4b')]('nolimit')){_0x2b98ae[_0x6efc('0x34')]=qs['limit'](_0x57e9cb['query'][_0x6efc('0x34')]);_0x2b98ae[_0x6efc('0x33')]=qs['offset'](_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x33')]);}_0x2b98ae[_0x6efc('0x4c')]=qs[_0x6efc('0x4d')](_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x4d')]);_0x2b98ae[_0x6efc('0x4e')]=qs[_0x6efc('0x45')](_[_0x6efc('0x4f')](_0x57e9cb[_0x6efc('0x44')],_0x57821c['filters']),_0x2da020);if(_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x50')]){_0x2b98ae[_0x6efc('0x4e')]=_['merge'](_0x2b98ae[_0x6efc('0x4e')],{'$or':_[_0x6efc('0x3f')](_0x2da020,function(_0x156e8d){if(_0x156e8d[_0x6efc('0x51')]!==_0x6efc('0x52')){var _0x3294b0={};_0x3294b0[_0x156e8d['name']]={'$like':'%'+_0x57e9cb['query'][_0x6efc('0x50')]+'%'};return _0x3294b0;}})});}_0x2b98ae=_[_0x6efc('0x53')]({},_0x2b98ae,_0x57e9cb[_0x6efc('0x54')]);var _0x58cce6={'where':_0x2b98ae[_0x6efc('0x4e')]};return db[_0x6efc('0x40')]['count'](_0x58cce6)[_0x6efc('0x22')](function(_0xfb240f){_0x2f455c['count']=_0xfb240f;if(_0x57e9cb[_0x6efc('0x44')][_0x6efc('0x55')]){_0x2b98ae[_0x6efc('0x56')]=[{'all':!![]}];}return db[_0x6efc('0x40')][_0x6efc('0x57')](_0x2b98ae);})[_0x6efc('0x22')](function(_0x2f6f22){_0x2f455c['rows']=_0x2f6f22;return _0x2f455c;})[_0x6efc('0x22')](respondWithFilteredResult(_0x2f86a0,_0x2b98ae))[_0x6efc('0x2d')](handleError(_0x2f86a0,null));};exports[_0x6efc('0x58')]=function(_0x1382c3,_0x1bf6c7){var _0x42fa0a={'raw':!![],'where':{'id':_0x1382c3[_0x6efc('0x59')]['id']}},_0x4ee80d={};_0x4ee80d['model']=_[_0x6efc('0x43')](db['WhatsappMessage'][_0x6efc('0x5a')]);_0x4ee80d[_0x6efc('0x44')]=_[_0x6efc('0x43')](_0x1382c3[_0x6efc('0x44')]);_0x4ee80d[_0x6efc('0x45')]=_[_0x6efc('0x46')](_0x4ee80d[_0x6efc('0x47')],_0x4ee80d['query']);_0x42fa0a[_0x6efc('0x49')]=_[_0x6efc('0x46')](_0x4ee80d[_0x6efc('0x47')],qs[_0x6efc('0x48')](_0x1382c3[_0x6efc('0x44')]['fields']));_0x42fa0a[_0x6efc('0x49')]=_0x42fa0a['attributes'][_0x6efc('0x4a')]?_0x42fa0a[_0x6efc('0x49')]:_0x4ee80d[_0x6efc('0x47')];if(_0x1382c3[_0x6efc('0x44')][_0x6efc('0x55')]){_0x42fa0a[_0x6efc('0x56')]=[{'all':!![]}];}_0x42fa0a=_[_0x6efc('0x53')]({},_0x42fa0a,_0x1382c3[_0x6efc('0x54')]);return db['WhatsappMessage'][_0x6efc('0x5b')](_0x42fa0a)[_0x6efc('0x22')](handleEntityNotFound(_0x1bf6c7,null))[_0x6efc('0x22')](respondWithResult(_0x1bf6c7,null))['catch'](handleError(_0x1bf6c7,null));};exports[_0x6efc('0x5c')]=function(_0x6fa86f,_0x3609b8){return db[_0x6efc('0x40')][_0x6efc('0x5c')](_0x6fa86f[_0x6efc('0x5d')],{})[_0x6efc('0x22')](respondWithResult(_0x3609b8,0xc9))[_0x6efc('0x2d')](handleError(_0x3609b8,null));};exports[_0x6efc('0x3a')]=function(_0x428372,_0x292bdb){if(_0x428372[_0x6efc('0x5d')]['id']){delete _0x428372['body']['id'];}return db[_0x6efc('0x40')][_0x6efc('0x5b')]({'where':{'id':_0x428372[_0x6efc('0x59')]['id']}})[_0x6efc('0x22')](handleEntityNotFound(_0x292bdb,null))[_0x6efc('0x22')](saveUpdates(_0x428372['body'],null))[_0x6efc('0x22')](respondWithResult(_0x292bdb,null))[_0x6efc('0x2d')](handleError(_0x292bdb,null));};exports['destroy']=function(_0x39c7c3,_0x2f4e46){return db[_0x6efc('0x40')][_0x6efc('0x5b')]({'where':{'id':_0x39c7c3['params']['id']}})['then'](handleEntityNotFound(_0x2f4e46,null))[_0x6efc('0x22')](removeEntity(_0x2f4e46,null))[_0x6efc('0x2d')](handleError(_0x2f4e46,null));};exports[_0x6efc('0x5e')]=function(_0x251e8c,_0x1f8224){return db[_0x6efc('0x40')][_0x6efc('0x5e')]()['then'](respondWithResult(_0x1f8224,null))['catch'](handleError(_0x1f8224,null));};var interaction_log=require(_0x6efc('0x5f'))(_0x6efc('0x60'));exports[_0x6efc('0x61')]=function(_0x352526,_0x1a71e8,_0x36adf4){var _0x321a91={'channel':_0x6efc('0x62')};if(_0x352526['body']['id']){delete _0x352526[_0x6efc('0x5d')]['id'];}_0x352526['body']['read']=!![];_0x352526[_0x6efc('0x5d')]['readAt']=moment()[_0x6efc('0x63')](_0x6efc('0x64'));_0x352526[_0x6efc('0x5d')]['UserId']=_0x352526[_0x6efc('0x5d')][_0x6efc('0x65')]||_0x352526[_0x6efc('0x66')]['id'];return db[_0x6efc('0x40')][_0x6efc('0x5b')]({'where':{'id':_0x352526[_0x6efc('0x59')]['id'],'UserId':null},'include':[{'model':db[_0x6efc('0x67')],'as':_0x6efc('0x68')}]})[_0x6efc('0x22')](handleEntityNotFound(_0x1a71e8,null))[_0x6efc('0x22')](saveUpdates(_0x352526[_0x6efc('0x5d')],null))[_0x6efc('0x22')](function(_0x1a5ed2){if(_0x1a5ed2){_0x321a91[_0x6efc('0x2a')]=_0x1a5ed2[_0x6efc('0x69')]({'plain':!![]});return db[_0x6efc('0x6a')][_0x6efc('0x5b')]({'where':{'id':_0x1a5ed2[_0x6efc('0x6b')]}});}return null;})[_0x6efc('0x22')](handleEntityNotFound(_0x1a71e8,null))[_0x6efc('0x22')](function(_0x501189){if(_0x501189){return _0x501189['update']({'UserId':_0x352526[_0x6efc('0x5d')][_0x6efc('0x65')],'read1stAt':_['isNil'](_0x501189['read1stAt'])?moment()[_0x6efc('0x63')](_0x6efc('0x64')):undefined});}return null;})[_0x6efc('0x22')](function(_0x2ef55f){if(_0x2ef55f){_0x321a91[_0x6efc('0x6c')]=_0x2ef55f[_0x6efc('0x69')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x352526[_0x6efc('0x66')]['id'],_0x352526['user'][_0x6efc('0x3c')],_0x352526[_0x6efc('0x66')]['role'],_0x321a91[_0x6efc('0x6c')]['id'],_0x352526['body']?JSON[_0x6efc('0x27')](_0x352526[_0x6efc('0x5d')]):_0x6efc('0x6d'));return respondWithRpcPromise(_0x6efc('0x6e'),'acceptMessage',_0x321a91);}return null;})[_0x6efc('0x22')](function(_0x4f1aa8){if(_0x4f1aa8){if(_0x352526[_0x6efc('0x5d')][_0x6efc('0x6f')]){_0x321a91[_0x6efc('0x2a')][_0x6efc('0x70')]=util['format'](_0x6efc('0x71'),_0x352526[_0x6efc('0x66')]['name']);_0x321a91[_0x6efc('0x2a')][_0x6efc('0x72')]=_0x321a91[_0x6efc('0x72')];_0x321a91[_0x6efc('0x2a')][_0x6efc('0x73')]=_0x6efc('0x61');return respondWithRpcPromise(_0x6efc('0x74'),_0x6efc('0x74'),{'event':'acceptmessage','message':_0x321a91[_0x6efc('0x2a')]},client9002)['then'](function(){return _0x321a91;});}return _0x321a91;}return null;})[_0x6efc('0x22')](respondWithResult(_0x1a71e8,null))[_0x6efc('0x2d')](handleError(_0x1a71e8,null));};var interaction_log=require(_0x6efc('0x5f'))(_0x6efc('0x60'));exports[_0x6efc('0x38')]=function(_0x23350e,_0x1bef2f,_0x215da4){var _0x36e61f={'agent':{},'channel':_0x6efc('0x62')};if(_0x23350e['body']['id']){delete _0x23350e[_0x6efc('0x5d')]['id'];}_0x23350e[_0x6efc('0x5d')][_0x6efc('0x65')]=_0x23350e[_0x6efc('0x5d')][_0x6efc('0x65')]||_0x23350e[_0x6efc('0x66')]['id'];_0x36e61f[_0x6efc('0x75')]['id']=_0x23350e[_0x6efc('0x5d')][_0x6efc('0x65')];return db['WhatsappMessage'][_0x6efc('0x5b')]({'where':{'id':_0x23350e['params']['id'],'UserId':null}})[_0x6efc('0x22')](handleEntityNotFound(_0x1bef2f,null))[_0x6efc('0x22')](function(_0x1d33a0){if(_0x1d33a0){_0x36e61f[_0x6efc('0x2a')]=_0x1d33a0['get']({'plain':!![]});return db[_0x6efc('0x6a')]['find']({'where':{'id':_0x1d33a0[_0x6efc('0x6b')]}});}return null;})[_0x6efc('0x22')](handleEntityNotFound(_0x1bef2f,null))[_0x6efc('0x22')](function(_0xcbec57){if(_0xcbec57){_0x36e61f[_0x6efc('0x6c')]=_0xcbec57[_0x6efc('0x69')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23350e['user']['id'],_0x23350e[_0x6efc('0x66')][_0x6efc('0x3c')],_0x23350e[_0x6efc('0x66')][_0x6efc('0x76')],_0x36e61f[_0x6efc('0x6c')]['id'],_0x23350e[_0x6efc('0x5d')]?JSON[_0x6efc('0x27')](_0x23350e[_0x6efc('0x5d')]):_0x6efc('0x6d'));return respondWithRpcPromise(_0x6efc('0x77'),_0x6efc('0x78'),_0x36e61f);}return null;})[_0x6efc('0x22')](function(_0x1a08d1){if(_0x1a08d1){_0x1a08d1[_0x6efc('0x2a')][_0x6efc('0x70')]=util[_0x6efc('0x63')](_0x6efc('0x71'),_0x23350e[_0x6efc('0x66')][_0x6efc('0x3c')]);_0x1a08d1[_0x6efc('0x2a')][_0x6efc('0x72')]=_0x36e61f[_0x6efc('0x72')];_0x1a08d1[_0x6efc('0x2a')][_0x6efc('0x73')]='reject';respondWithRpcPromise(_0x6efc('0x74'),'EventManager',{'event':_0x6efc('0x79'),'message':_0x1a08d1[_0x6efc('0x2a')]},client9002);return _0x36e61f;}return null;})[_0x6efc('0x22')](respondWithResult(_0x1bef2f,null))[_0x6efc('0x2d')](handleError(_0x1bef2f,null));};exports['status']=function(_0x50096d,_0x1750af,_0x96c4c3){if(_0x50096d[_0x6efc('0x5d')]['id']){delete _0x50096d['body']['id'];}var _0x136095;return db[_0x6efc('0x40')][_0x6efc('0x5b')]({'where':{'id':_0x50096d[_0x6efc('0x59')]['id']}})[_0x6efc('0x22')](handleEntityNotFound(_0x1750af,null))[_0x6efc('0x22')](function(_0x4a368d){if(_0x4a368d){_0x136095=_0x4a368d;return db['WhatsappAccount'][_0x6efc('0x5b')]({'where':{'id':_0x4a368d[_0x6efc('0x7a')]}});}})[_0x6efc('0x22')](handleEntityNotFound(_0x1750af,null))['then'](function(_0x28e552){if(_0x28e552){logger[_0x6efc('0x25')](_0x6efc('0x7b'),_0x6efc('0x2f'),_0x6efc('0x7c'),_0x28e552[_0x6efc('0x51')],util[_0x6efc('0x7d')](_0x50096d[_0x6efc('0x5d')],{'showHidden':![],'depth':null}));switch(_0x28e552[_0x6efc('0x51')]){case _0x6efc('0x7e'):if(_0x50096d[_0x6efc('0x5d')]['MessageSid']&&_0x50096d[_0x6efc('0x5d')][_0x6efc('0x7f')]===_0x136095[_0x6efc('0x80')]&&_0x50096d[_0x6efc('0x5d')]['MessageStatus']&&_0x50096d[_0x6efc('0x5d')]['MessageStatus']===_0x6efc('0x81')){return _0x136095[_0x6efc('0x3a')]({'read':!![]});}else{logger[_0x6efc('0x28')](_0x6efc('0x82'),_0x6efc('0x2f'),_0x6efc('0x7e'),util['inspect'](_0x50096d[_0x6efc('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x136095;}})[_0x6efc('0x22')](respondWithResult(_0x1750af,null))[_0x6efc('0x2d')](handleError(_0x1750af,null));}; \ No newline at end of file +var _0x3b82=['bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','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','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','name','send','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','user','CmContact','Contact','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','inspect','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3b82,0x102));var _0x23b8=function(_0x37e0c5,_0x46c212){_0x37e0c5=_0x37e0c5-0x0;var _0x22f40e=_0x3b82[_0x37e0c5];return _0x22f40e;};'use strict';var pdf=require(_0x23b8('0x0'));var emlformat=require(_0x23b8('0x1'));var rimraf=require(_0x23b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23b8('0x3'));var rp=require(_0x23b8('0x4'));var moment=require(_0x23b8('0x5'));var BPromise=require(_0x23b8('0x6'));var Mustache=require('mustache');var util=require(_0x23b8('0x7'));var path=require(_0x23b8('0x8'));var sox=require(_0x23b8('0x9'));var csv=require(_0x23b8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x23b8('0xb'));var squel=require(_0x23b8('0xc'));var crypto=require(_0x23b8('0xd'));var jsforce=require(_0x23b8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x23b8('0xf'));var Papa=require('papaparse');var Redis=require(_0x23b8('0x10'));var authService=require(_0x23b8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x23b8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x23b8('0x13'))(_0x23b8('0x14'));var utils=require('../../config/utils');var config=require(_0x23b8('0x15'));var db=require(_0x23b8('0x16'))['db'];config[_0x23b8('0x17')]=_[_0x23b8('0x18')](config[_0x23b8('0x17')],{'host':_0x23b8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23b8('0x17')]));require('./whatsappMessage.socket')[_0x23b8('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x23b8('0x1b')][_0x23b8('0x1c')]({'port':0x232c});var client9002=jayson[_0x23b8('0x1b')][_0x23b8('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x44c231,_0x2a7f2f,_0x5b31d7){if(_0x5b31d7){var _0x2b12a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b12a5[_0x23b8('0x1d')](_0x2a7f2f)){return _0x44c231;}else{throw new db[(_0x23b8('0x1e'))]['ValidationError'](_0x23b8('0x1f'));}}else{return _0x44c231;}}function respondWithRpcPromise(_0x2c68ba,_0x42b25e,_0x2c4646,_0x9ebb1a){return new BPromise(function(_0xae62c2,_0x2ae466){var _0x5d9cf0=_0x9ebb1a||client;return _0x5d9cf0[_0x23b8('0x20')](_0x2c68ba,_0x2c4646)[_0x23b8('0x21')](function(_0x5c020d){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x42b25e,_0x23b8('0x22'));logger['debug'](_0x23b8('0x23'),_0x42b25e,_0x23b8('0x22'),JSON['stringify'](_0x5c020d));if(_0x5c020d[_0x23b8('0x24')]){if(_0x5c020d[_0x23b8('0x24')][_0x23b8('0x25')]===0x1f4){logger[_0x23b8('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x42b25e,_0x5c020d['error'][_0x23b8('0x26')]);return _0x2ae466(_0x5c020d[_0x23b8('0x24')][_0x23b8('0x26')]);}logger['error'](_0x23b8('0x27'),_0x42b25e,_0x5c020d['error'][_0x23b8('0x26')]);return _0xae62c2(_0x5c020d['error'][_0x23b8('0x26')]);}else{logger[_0x23b8('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x42b25e,_0x23b8('0x22'));_0xae62c2(_0x5c020d[_0x23b8('0x29')][_0x23b8('0x26')]);}})[_0x23b8('0x2a')](function(_0x529c2a){logger['error'](_0x23b8('0x27'),_0x42b25e,_0x529c2a);_0x2ae466(_0x529c2a);});});}function respondWithStatusCode(_0xf1f43a,_0x324d78){_0x324d78=_0x324d78||0xcc;return function(_0x2fa9c4){if(_0x2fa9c4){return _0xf1f43a[_0x23b8('0x2b')](_0x324d78);}return _0xf1f43a[_0x23b8('0x2c')](_0x324d78)[_0x23b8('0x2d')]();};}function respondWithResult(_0x55d0f8,_0xa16db4){_0xa16db4=_0xa16db4||0xc8;return function(_0x4c4785){if(_0x4c4785){return _0x55d0f8[_0x23b8('0x2c')](_0xa16db4)[_0x23b8('0x2e')](_0x4c4785);}};}function respondWithFilteredResult(_0x12e468,_0x2ba126){return function(_0x369e5b){if(_0x369e5b){var _0x1a1786=_0x369e5b[_0x23b8('0x2f')],_0x225954=_0x2ba126[_0x23b8('0x30')],_0x19fb3f=_0x2ba126[_0x23b8('0x30')]+_0x2ba126[_0x23b8('0x31')],_0x918982;if(_0x19fb3f>=_0x1a1786){_0x19fb3f=_0x1a1786;_0x918982=0xc8;}else{_0x918982=0xce;}_0x12e468[_0x23b8('0x2c')](_0x918982);return _0x12e468['set'](_0x23b8('0x32'),_0x225954+'-'+_0x19fb3f+'/'+_0x1a1786)[_0x23b8('0x2e')](_0x369e5b);}return null;};}function patchUpdates(_0x418bc1){return function(_0x57c634){try{jsonpatch[_0x23b8('0x33')](_0x57c634,_0x418bc1,!![]);}catch(_0x2cfeaa){return BPromise[_0x23b8('0x34')](_0x2cfeaa);}return _0x57c634[_0x23b8('0x35')]();};}function saveUpdates(_0x2b3f09,_0x173428){return function(_0x1c2a9b){if(_0x1c2a9b){return _0x1c2a9b[_0x23b8('0x36')](_0x2b3f09)[_0x23b8('0x21')](function(_0x462b06){return _0x462b06;});}return null;};}function removeEntity(_0x45332a,_0xd6ee31){return function(_0x49287f){if(_0x49287f){return _0x49287f['destroy']()[_0x23b8('0x21')](function(){_0x45332a[_0x23b8('0x2c')](0xcc)[_0x23b8('0x2d')]();});}};}function handleEntityNotFound(_0x14a519,_0x34e39e){return function(_0x35c7c4){if(!_0x35c7c4){_0x14a519['sendStatus'](0x194);}return _0x35c7c4;};}function handleError(_0x57e140,_0x30cf70){_0x30cf70=_0x30cf70||0x1f4;return function(_0x46f68a){logger[_0x23b8('0x24')](_0x46f68a['stack']);if(_0x46f68a[_0x23b8('0x37')]){delete _0x46f68a['name'];}_0x57e140[_0x23b8('0x2c')](_0x30cf70)[_0x23b8('0x38')](_0x46f68a);};}exports['index']=function(_0x16d56b,_0x30552d){var _0x40f1ed={},_0x2efbef={},_0x2bb35c={'count':0x0,'rows':[]};var _0x11cca4=_[_0x23b8('0x39')](db[_0x23b8('0x3a')]['rawAttributes'],function(_0x3b12a8){return{'name':_0x3b12a8[_0x23b8('0x3b')],'type':_0x3b12a8[_0x23b8('0x3c')][_0x23b8('0x3d')]};});_0x2efbef[_0x23b8('0x3e')]=_[_0x23b8('0x39')](_0x11cca4,_0x23b8('0x37'));_0x2efbef[_0x23b8('0x3f')]=_[_0x23b8('0x40')](_0x16d56b[_0x23b8('0x3f')]);_0x2efbef[_0x23b8('0x41')]=_['intersection'](_0x2efbef[_0x23b8('0x3e')],_0x2efbef[_0x23b8('0x3f')]);_0x40f1ed['attributes']=_[_0x23b8('0x42')](_0x2efbef[_0x23b8('0x3e')],qs[_0x23b8('0x43')](_0x16d56b[_0x23b8('0x3f')]['fields']));_0x40f1ed[_0x23b8('0x44')]=_0x40f1ed['attributes']['length']?_0x40f1ed['attributes']:_0x2efbef[_0x23b8('0x3e')];if(!_0x16d56b[_0x23b8('0x3f')][_0x23b8('0x45')](_0x23b8('0x46'))){_0x40f1ed['limit']=qs[_0x23b8('0x31')](_0x16d56b['query'][_0x23b8('0x31')]);_0x40f1ed[_0x23b8('0x30')]=qs[_0x23b8('0x30')](_0x16d56b[_0x23b8('0x3f')][_0x23b8('0x30')]);}_0x40f1ed[_0x23b8('0x47')]=qs[_0x23b8('0x48')](_0x16d56b[_0x23b8('0x3f')]['sort']);_0x40f1ed[_0x23b8('0x49')]=qs[_0x23b8('0x41')](_['pick'](_0x16d56b[_0x23b8('0x3f')],_0x2efbef[_0x23b8('0x41')]),_0x11cca4);if(_0x16d56b[_0x23b8('0x3f')][_0x23b8('0x4a')]){_0x40f1ed[_0x23b8('0x49')]=_[_0x23b8('0x4b')](_0x40f1ed['where'],{'$or':_[_0x23b8('0x39')](_0x11cca4,function(_0x30d9f7){if(_0x30d9f7[_0x23b8('0x3c')]!==_0x23b8('0x4c')){var _0x53e30c={};_0x53e30c[_0x30d9f7['name']]={'$like':'%'+_0x16d56b[_0x23b8('0x3f')][_0x23b8('0x4a')]+'%'};return _0x53e30c;}})});}_0x40f1ed=_[_0x23b8('0x4b')]({},_0x40f1ed,_0x16d56b[_0x23b8('0x4d')]);var _0x3b277e={'where':_0x40f1ed['where']};return db[_0x23b8('0x3a')][_0x23b8('0x2f')](_0x3b277e)[_0x23b8('0x21')](function(_0x4b3469){_0x2bb35c[_0x23b8('0x2f')]=_0x4b3469;if(_0x16d56b[_0x23b8('0x3f')]['includeAll']){_0x40f1ed[_0x23b8('0x4e')]=[{'all':!![]}];}return db[_0x23b8('0x3a')]['findAll'](_0x40f1ed);})['then'](function(_0x261ca6){_0x2bb35c[_0x23b8('0x4f')]=_0x261ca6;return _0x2bb35c;})['then'](respondWithFilteredResult(_0x30552d,_0x40f1ed))[_0x23b8('0x2a')](handleError(_0x30552d,null));};exports[_0x23b8('0x50')]=function(_0x21ea41,_0x128d45){var _0x5bb00a={'raw':!![],'where':{'id':_0x21ea41[_0x23b8('0x51')]['id']}},_0x377a55={};_0x377a55[_0x23b8('0x3e')]=_['keys'](db[_0x23b8('0x3a')][_0x23b8('0x52')]);_0x377a55['query']=_['keys'](_0x21ea41[_0x23b8('0x3f')]);_0x377a55[_0x23b8('0x41')]=_[_0x23b8('0x42')](_0x377a55[_0x23b8('0x3e')],_0x377a55[_0x23b8('0x3f')]);_0x5bb00a['attributes']=_[_0x23b8('0x42')](_0x377a55[_0x23b8('0x3e')],qs[_0x23b8('0x43')](_0x21ea41['query'][_0x23b8('0x43')]));_0x5bb00a['attributes']=_0x5bb00a[_0x23b8('0x44')]['length']?_0x5bb00a[_0x23b8('0x44')]:_0x377a55[_0x23b8('0x3e')];if(_0x21ea41[_0x23b8('0x3f')][_0x23b8('0x53')]){_0x5bb00a[_0x23b8('0x4e')]=[{'all':!![]}];}_0x5bb00a=_[_0x23b8('0x4b')]({},_0x5bb00a,_0x21ea41[_0x23b8('0x4d')]);return db['WhatsappMessage'][_0x23b8('0x54')](_0x5bb00a)[_0x23b8('0x21')](handleEntityNotFound(_0x128d45,null))[_0x23b8('0x21')](respondWithResult(_0x128d45,null))[_0x23b8('0x2a')](handleError(_0x128d45,null));};exports[_0x23b8('0x55')]=function(_0x10e46f,_0x35919a){return db['WhatsappMessage'][_0x23b8('0x55')](_0x10e46f[_0x23b8('0x56')],{})[_0x23b8('0x21')](respondWithResult(_0x35919a,0xc9))[_0x23b8('0x2a')](handleError(_0x35919a,null));};exports[_0x23b8('0x36')]=function(_0x5acaba,_0x4130dd){if(_0x5acaba[_0x23b8('0x56')]['id']){delete _0x5acaba['body']['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x5acaba[_0x23b8('0x51')]['id']}})[_0x23b8('0x21')](handleEntityNotFound(_0x4130dd,null))[_0x23b8('0x21')](saveUpdates(_0x5acaba[_0x23b8('0x56')],null))['then'](respondWithResult(_0x4130dd,null))[_0x23b8('0x2a')](handleError(_0x4130dd,null));};exports[_0x23b8('0x57')]=function(_0x2e3e2f,_0x2c4bd8){return db['WhatsappMessage'][_0x23b8('0x54')]({'where':{'id':_0x2e3e2f[_0x23b8('0x51')]['id']}})[_0x23b8('0x21')](handleEntityNotFound(_0x2c4bd8,null))[_0x23b8('0x21')](removeEntity(_0x2c4bd8,null))[_0x23b8('0x2a')](handleError(_0x2c4bd8,null));};exports['describe']=function(_0x38f431,_0x375aad){return db['WhatsappMessage'][_0x23b8('0x58')]()['then'](respondWithResult(_0x375aad,null))[_0x23b8('0x2a')](handleError(_0x375aad,null));};var interaction_log=require('../../config/logger')(_0x23b8('0x59'));exports[_0x23b8('0x5a')]=function(_0x531d06,_0x2a7a82,_0x4dd989){var _0x9253c4={'channel':_0x23b8('0x5b')};if(_0x531d06[_0x23b8('0x56')]['id']){delete _0x531d06[_0x23b8('0x56')]['id'];}_0x531d06[_0x23b8('0x56')]['read']=!![];_0x531d06[_0x23b8('0x56')][_0x23b8('0x5c')]=moment()[_0x23b8('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x531d06[_0x23b8('0x56')][_0x23b8('0x5e')]=_0x531d06['body'][_0x23b8('0x5e')]||_0x531d06[_0x23b8('0x5f')]['id'];return db[_0x23b8('0x3a')][_0x23b8('0x54')]({'where':{'id':_0x531d06[_0x23b8('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x23b8('0x60')],'as':_0x23b8('0x61')}]})['then'](handleEntityNotFound(_0x2a7a82,null))[_0x23b8('0x21')](saveUpdates(_0x531d06[_0x23b8('0x56')],null))[_0x23b8('0x21')](function(_0x55031e){if(_0x55031e){_0x9253c4[_0x23b8('0x26')]=_0x55031e[_0x23b8('0x62')]({'plain':!![]});return db[_0x23b8('0x63')][_0x23b8('0x54')]({'where':{'id':_0x55031e[_0x23b8('0x64')]}});}return null;})[_0x23b8('0x21')](handleEntityNotFound(_0x2a7a82,null))['then'](function(_0x79f131){if(_0x79f131){return _0x79f131[_0x23b8('0x36')]({'UserId':_0x531d06[_0x23b8('0x56')][_0x23b8('0x5e')],'read1stAt':_[_0x23b8('0x65')](_0x79f131[_0x23b8('0x66')])?moment()['format'](_0x23b8('0x67')):undefined});}return null;})['then'](function(_0x2713e2){if(_0x2713e2){_0x9253c4['interaction']=_0x2713e2[_0x23b8('0x62')]({'plain':!![]});interaction_log[_0x23b8('0x28')](_0x23b8('0x68'),_0x531d06[_0x23b8('0x5f')]['id'],_0x531d06[_0x23b8('0x5f')]['name'],_0x531d06['user'][_0x23b8('0x69')],_0x9253c4[_0x23b8('0x6a')]['id'],_0x531d06[_0x23b8('0x56')]?JSON[_0x23b8('0x6b')](_0x531d06['body']):_0x23b8('0x6c'));return respondWithRpcPromise(_0x23b8('0x6d'),'acceptMessage',_0x9253c4);}return null;})[_0x23b8('0x21')](function(_0x5a3527){if(_0x5a3527){if(_0x531d06[_0x23b8('0x56')]['manual']){_0x9253c4[_0x23b8('0x26')]['interface']=util[_0x23b8('0x5d')](_0x23b8('0x6e'),_0x531d06[_0x23b8('0x5f')]['name']);_0x9253c4[_0x23b8('0x26')]['channel']=_0x9253c4[_0x23b8('0x6f')];_0x9253c4[_0x23b8('0x26')][_0x23b8('0x70')]=_0x23b8('0x5a');return respondWithRpcPromise(_0x23b8('0x71'),_0x23b8('0x71'),{'event':_0x23b8('0x72'),'message':_0x9253c4[_0x23b8('0x26')]},client9002)[_0x23b8('0x21')](function(){return _0x9253c4;});}return _0x9253c4;}return null;})['then'](respondWithResult(_0x2a7a82,null))[_0x23b8('0x2a')](handleError(_0x2a7a82,null));};var interaction_log=require(_0x23b8('0x13'))(_0x23b8('0x59'));exports['reject']=function(_0x3481f2,_0x405567,_0x56c98c){var _0x3d8e74={'agent':{},'channel':_0x23b8('0x5b')};if(_0x3481f2['body']['id']){delete _0x3481f2[_0x23b8('0x56')]['id'];}_0x3481f2['body']['UserId']=_0x3481f2[_0x23b8('0x56')][_0x23b8('0x5e')]||_0x3481f2[_0x23b8('0x5f')]['id'];_0x3d8e74[_0x23b8('0x73')]['id']=_0x3481f2[_0x23b8('0x56')][_0x23b8('0x5e')];return db[_0x23b8('0x3a')][_0x23b8('0x54')]({'where':{'id':_0x3481f2[_0x23b8('0x51')]['id'],'UserId':null}})[_0x23b8('0x21')](handleEntityNotFound(_0x405567,null))[_0x23b8('0x21')](function(_0x3c581d){if(_0x3c581d){_0x3d8e74['message']=_0x3c581d[_0x23b8('0x62')]({'plain':!![]});return db[_0x23b8('0x63')][_0x23b8('0x54')]({'where':{'id':_0x3c581d[_0x23b8('0x64')]}});}return null;})[_0x23b8('0x21')](handleEntityNotFound(_0x405567,null))[_0x23b8('0x21')](function(_0x1aff27){if(_0x1aff27){_0x3d8e74[_0x23b8('0x6a')]=_0x1aff27[_0x23b8('0x62')]({'plain':!![]});interaction_log['info'](_0x23b8('0x74'),_0x3481f2[_0x23b8('0x5f')]['id'],_0x3481f2[_0x23b8('0x5f')][_0x23b8('0x37')],_0x3481f2[_0x23b8('0x5f')][_0x23b8('0x69')],_0x3d8e74['interaction']['id'],_0x3481f2['body']?JSON[_0x23b8('0x6b')](_0x3481f2[_0x23b8('0x56')]):_0x23b8('0x6c'));return respondWithRpcPromise(_0x23b8('0x75'),_0x23b8('0x76'),_0x3d8e74);}return null;})['then'](function(_0x26afff){if(_0x26afff){_0x26afff[_0x23b8('0x26')][_0x23b8('0x77')]=util[_0x23b8('0x5d')](_0x23b8('0x6e'),_0x3481f2[_0x23b8('0x5f')][_0x23b8('0x37')]);_0x26afff[_0x23b8('0x26')][_0x23b8('0x6f')]=_0x3d8e74[_0x23b8('0x6f')];_0x26afff['message']['event']=_0x23b8('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x23b8('0x78'),'message':_0x26afff[_0x23b8('0x26')]},client9002);return _0x3d8e74;}return null;})[_0x23b8('0x21')](respondWithResult(_0x405567,null))[_0x23b8('0x2a')](handleError(_0x405567,null));};exports[_0x23b8('0x2c')]=function(_0x1c0de4,_0x484a9e,_0x4b1dd2){if(_0x1c0de4[_0x23b8('0x56')]['id']){delete _0x1c0de4[_0x23b8('0x56')]['id'];}var _0x8c3fed;return db[_0x23b8('0x3a')][_0x23b8('0x54')]({'where':{'id':_0x1c0de4[_0x23b8('0x51')]['id']}})[_0x23b8('0x21')](handleEntityNotFound(_0x484a9e,null))[_0x23b8('0x21')](function(_0x14e54d){if(_0x14e54d){_0x8c3fed=_0x14e54d;return db[_0x23b8('0x79')][_0x23b8('0x54')]({'where':{'id':_0x14e54d[_0x23b8('0x7a')]}});}})[_0x23b8('0x21')](handleEntityNotFound(_0x484a9e,null))[_0x23b8('0x21')](function(_0xa01460){if(_0xa01460){logger[_0x23b8('0x7b')](_0x23b8('0x7c'),'status',_0x23b8('0x7d'),_0xa01460[_0x23b8('0x3c')],util['inspect'](_0x1c0de4['body'],{'showHidden':![],'depth':null}));switch(_0xa01460[_0x23b8('0x3c')]){case _0x23b8('0x7e'):if(_0x1c0de4[_0x23b8('0x56')][_0x23b8('0x7f')]&&_0x1c0de4[_0x23b8('0x56')][_0x23b8('0x7f')]===_0x8c3fed[_0x23b8('0x80')]&&_0x1c0de4[_0x23b8('0x56')][_0x23b8('0x81')]&&_0x1c0de4[_0x23b8('0x56')][_0x23b8('0x81')]===_0x23b8('0x82')){return _0x8c3fed['update']({'read':!![]});}else{logger[_0x23b8('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x23b8('0x7e'),util[_0x23b8('0x83')](_0x1c0de4[_0x23b8('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x8c3fed;}})[_0x23b8('0x21')](respondWithResult(_0x484a9e,null))[_0x23b8('0x2a')](handleError(_0x484a9e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5601b3f..2f3ff07 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['WhatsappMessage','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x69ad69,_0x5060b7){var _0xde56ca=function(_0x28fefe){while(--_0x28fefe){_0x69ad69['push'](_0x69ad69['shift']());}};_0xde56ca(++_0x5060b7);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf779,_0x13e983){_0x4cf779=_0x4cf779-0x0;var _0x2adc5e=_0x7a54[_0x4cf779];return _0x2adc5e;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var WhatsappMessage=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){WhatsappMessageEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);WhatsappMessageEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x114202,_0x3cbc47){var _0x7625b0=function(_0x29c543){while(--_0x29c543){_0x114202['push'](_0x114202['shift']());}};_0x7625b0(++_0x3cbc47);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xb10b[_0x1ee62e];return _0x27c6c8;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7d02b54..ac28d72 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c13=['UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','create','whatsapp:','/api/whatsapp/messages/','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','toLowerCase','direction','out','secret','isNil'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5c13,0x1db));var _0x35c1=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x5c13[_0x247fa1];return _0x244f35;};'use strict';var _=require('lodash');var util=require(_0x35c1('0x0'));var logger=require('../../config/logger')(_0x35c1('0x1'));var moment=require(_0x35c1('0x2'));var BPromise=require(_0x35c1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35c1('0x4'));var rimraf=require(_0x35c1('0x5'));var config=require('../../config/environment');var attributes=require(_0x35c1('0x6'));module[_0x35c1('0x7')]=function(_0x1c6231,_0x463154){return _0x1c6231[_0x35c1('0x8')](_0x35c1('0x9'),attributes,{'tableName':_0x35c1('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x35c1('0xb')]},{'name':_0x35c1('0xc'),'fields':[_0x35c1('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b02ee,_0x5260db,_0x79da9a){var _0x15563c=_0x1c6231[_0x35c1('0xe')];var _0x50144a=_0x5b02ee['get']({'plain':!![]});if(_0x50144a['direction'][_0x35c1('0xf')]()==='in'||_0x50144a[_0x35c1('0x10')][_0x35c1('0xf')]()===_0x35c1('0x11')&&!_0x50144a[_0x35c1('0x12')]&&!_[_0x35c1('0x13')](_0x50144a[_0x35c1('0x14')])){_0x15563c[_0x35c1('0x15')][_0x35c1('0x16')]({'where':{'id':_0x50144a[_0x35c1('0x17')]}})[_0x35c1('0x18')](function(_0x52b098){if(_0x52b098){_0x52b098[_0x35c1('0x19')]({'lastMsgAt':_0x50144a['createdAt'],'lastMsgDirection':_0x50144a[_0x35c1('0x10')]['toLowerCase']()});}})[_0x35c1('0x1a')](function(_0x59218f){console[_0x35c1('0x1b')](_0x59218f);});}if(_0x50144a[_0x35c1('0x10')]==='out'&&!_0x50144a[_0x35c1('0x12')]){var _0x334a54;_0x15563c[_0x35c1('0x1c')][_0x35c1('0x1d')]({'where':{'id':_0x50144a[_0x35c1('0x1e')]},'raw':!![]})[_0x35c1('0x18')](function(_0x1a9a00){_0x334a54=_0x1a9a00;if(_0x334a54&&_0x334a54[_0x35c1('0x1f')]){switch(_0x334a54[_0x35c1('0x1f')]){case'twilio':var _0x202a0b=require(_0x35c1('0x20'));if(_0x334a54['accountSid']&&_0x334a54[_0x35c1('0x21')]&&_0x334a54[_0x35c1('0x22')]){var _0x11ca56=new _0x202a0b(_0x334a54[_0x35c1('0x23')],_0x334a54[_0x35c1('0x21')]);_0x11ca56['messages'][_0x35c1('0x24')]({'body':_0x50144a[_0x35c1('0xd')],'to':'whatsapp:'+_0x50144a['phone'],'from':_0x35c1('0x25')+_0x334a54['phone'],'statusCallback':_0x334a54['remote']+_0x35c1('0x26')+_0x50144a['id']+'/status?token='+_0x334a54['token']})[_0x35c1('0x18')](function(_0x3e8326){if(_0x3e8326[_0x35c1('0x27')]){return _0x5b02ee[_0x35c1('0x19')]({'messageId':_0x3e8326[_0x35c1('0x27')]});}})['catch'](function(_0x3774ec){logger[_0x35c1('0x1b')](_0x35c1('0x28'),_0x35c1('0x29'),'twilio',util[_0x35c1('0x2a')](_0x3774ec,{'showHidden':![],'depth':null}));});}else{logger[_0x35c1('0x1b')](_0x35c1('0x28'),_0x35c1('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x79da9a();});}else{_0x79da9a();}}},'charset':_0x35c1('0x2b'),'collate':_0x35c1('0x2c')});}; \ No newline at end of file +var _0xadf8=['WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','body','whatsapp:','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xadf8,0x145));var _0x8adf=function(_0x221637,_0x42a5e0){_0x221637=_0x221637-0x0;var _0x11bf9e=_0xadf8[_0x221637];return _0x11bf9e;};'use strict';var _=require(_0x8adf('0x0'));var util=require(_0x8adf('0x1'));var logger=require('../../config/logger')(_0x8adf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8adf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8adf('0x4'));var config=require(_0x8adf('0x5'));var attributes=require(_0x8adf('0x6'));module['exports']=function(_0x11c457,_0x33d60e){return _0x11c457[_0x8adf('0x7')](_0x8adf('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8adf('0x9')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x345e5c,_0x177f8d,_0x424e8c){var _0x3151ce=_0x11c457[_0x8adf('0xa')];var _0x285828=_0x345e5c[_0x8adf('0xb')]({'plain':!![]});if(_0x285828[_0x8adf('0xc')][_0x8adf('0xd')]()==='in'||_0x285828[_0x8adf('0xc')][_0x8adf('0xd')]()===_0x8adf('0xe')&&!_0x285828[_0x8adf('0xf')]&&!_['isNil'](_0x285828[_0x8adf('0x10')])){_0x3151ce[_0x8adf('0x11')][_0x8adf('0x12')]({'where':{'id':_0x285828[_0x8adf('0x13')]}})['then'](function(_0x316148){if(_0x316148){_0x316148[_0x8adf('0x14')]({'lastMsgAt':_0x285828[_0x8adf('0x15')],'lastMsgDirection':_0x285828['direction'][_0x8adf('0xd')]()});}})[_0x8adf('0x16')](function(_0x550818){console[_0x8adf('0x17')](_0x550818);});}if(_0x285828[_0x8adf('0xc')]===_0x8adf('0xe')&&!_0x285828[_0x8adf('0xf')]){var _0x313e41;_0x3151ce['WhatsappAccount'][_0x8adf('0x18')]({'where':{'id':_0x285828[_0x8adf('0x19')]},'raw':!![]})[_0x8adf('0x1a')](function(_0x13a1bc){_0x313e41=_0x13a1bc;if(_0x313e41&&_0x313e41['type']){switch(_0x313e41[_0x8adf('0x1b')]){case _0x8adf('0x1c'):var _0x2e0af4=require('twilio');if(_0x313e41[_0x8adf('0x1d')]&&_0x313e41[_0x8adf('0x1e')]&&_0x313e41[_0x8adf('0x1f')]){var _0x41a95c=new _0x2e0af4(_0x313e41[_0x8adf('0x1d')],_0x313e41[_0x8adf('0x1e')]);_0x41a95c['messages']['create']({'body':_0x285828[_0x8adf('0x20')],'to':'whatsapp:'+_0x285828[_0x8adf('0x1f')],'from':_0x8adf('0x21')+_0x313e41[_0x8adf('0x1f')],'statusCallback':_0x313e41['remote']+_0x8adf('0x22')+_0x285828['id']+'/status?token='+_0x313e41[_0x8adf('0x23')]})[_0x8adf('0x1a')](function(_0x518ce3){if(_0x518ce3[_0x8adf('0x24')]){return _0x345e5c[_0x8adf('0x14')]({'messageId':_0x518ce3[_0x8adf('0x24')]});}})[_0x8adf('0x16')](function(_0x538f03){logger['error'](_0x8adf('0x25'),_0x8adf('0x26'),_0x8adf('0x1c'),util['inspect'](_0x538f03,{'showHidden':![],'depth':null}));});}else{logger[_0x8adf('0x17')](_0x8adf('0x25'),'afterCreate','twilio',_0x8adf('0x27'));}break;}}})[_0x8adf('0x28')](function(){_0x424e8c();});}else{_0x424e8c();}}},'charset':_0x8adf('0x29'),'collate':_0x8adf('0x2a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 7a095ee..d99cfa6 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a87=['./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','CreateWhatsappMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4a87,0x75));var _0x74a8=function(_0x5c200d,_0x2a3288){_0x5c200d=_0x5c200d-0x0;var _0x318549=_0x4a87[_0x5c200d];return _0x318549;};'use strict';var _=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var moment=require(_0x74a8('0x2'));var BPromise=require(_0x74a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74a8('0x4'));var db=require(_0x74a8('0x5'))['db'];var utils=require(_0x74a8('0x6'));var logger=require('../../config/logger')(_0x74a8('0x7'));var config=require(_0x74a8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x74a8('0x9')][_0x74a8('0xa')]({'port':0x232a});config[_0x74a8('0xb')]=_[_0x74a8('0xc')](config[_0x74a8('0xb')],{'host':_0x74a8('0xd'),'port':0x18eb});var socket=require(_0x74a8('0xe'))(new Redis(config[_0x74a8('0xb')]));require(_0x74a8('0xf'))[_0x74a8('0x10')](socket);function respondWithRpcPromise(_0x37b43,_0x24dc76,_0x3ae591){return new BPromise(function(_0x4f52a1,_0x43c96c){return client[_0x74a8('0x11')](_0x37b43,_0x3ae591)[_0x74a8('0x12')](function(_0x10840c){logger['info'](_0x74a8('0x13'),_0x24dc76,_0x74a8('0x14'));logger[_0x74a8('0x15')](_0x74a8('0x16'),_0x24dc76,_0x74a8('0x14'),JSON[_0x74a8('0x17')](_0x10840c));if(_0x10840c[_0x74a8('0x18')]){if(_0x10840c[_0x74a8('0x18')][_0x74a8('0x19')]===0x1f4){logger[_0x74a8('0x18')](_0x74a8('0x13'),_0x24dc76,_0x10840c[_0x74a8('0x18')][_0x74a8('0x1a')]);return _0x43c96c(_0x10840c[_0x74a8('0x18')]['message']);}logger[_0x74a8('0x18')](_0x74a8('0x13'),_0x24dc76,_0x10840c[_0x74a8('0x18')][_0x74a8('0x1a')]);return _0x4f52a1(_0x10840c[_0x74a8('0x18')][_0x74a8('0x1a')]);}else{logger[_0x74a8('0x1b')]('WhatsappMessage,\x20%s,\x20%s',_0x24dc76,_0x74a8('0x14'));_0x4f52a1(_0x10840c[_0x74a8('0x1c')][_0x74a8('0x1a')]);}})[_0x74a8('0x1d')](function(_0x27b141){logger[_0x74a8('0x18')](_0x74a8('0x13'),_0x24dc76,_0x27b141);_0x43c96c(_0x27b141);});});}exports['CreateWhatsappMessage']=function(_0x5a81ac){var _0xe71abb=this;return new Promise(function(_0x13e844,_0x25db86){return db['WhatsappMessage'][_0x74a8('0x1e')](_0x5a81ac['body'],{'raw':_0x5a81ac[_0x74a8('0x1f')]?_0x5a81ac['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x324236){logger[_0x74a8('0x1b')](_0x74a8('0x20'),_0x5a81ac);logger[_0x74a8('0x15')](_0x74a8('0x20'),_0x5a81ac,JSON[_0x74a8('0x17')](_0x324236));_0x13e844(_0x324236);})['catch'](function(_0x4606d1){logger['error'](_0x74a8('0x20'),_0x4606d1[_0x74a8('0x1a')],_0x5a81ac);_0x25db86(_0xe71abb['error'](0x1f4,_0x4606d1['message']));});});}; \ No newline at end of file +var _0xf3a6=['localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','request\x20sent','debug','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','CreateWhatsappMessage','create','body','options','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults'];(function(_0x3d8c4d,_0x5030ef){var _0x2aff72=function(_0x59a706){while(--_0x59a706){_0x3d8c4d['push'](_0x3d8c4d['shift']());}};_0x2aff72(++_0x5030ef);}(_0xf3a6,0x135));var _0x6f3a=function(_0x7fd9e9,_0x1765d0){_0x7fd9e9=_0x7fd9e9-0x0;var _0x285d92=_0xf3a6[_0x7fd9e9];return _0x285d92;};'use strict';var _=require('lodash');var util=require(_0x6f3a('0x0'));var moment=require(_0x6f3a('0x1'));var BPromise=require(_0x6f3a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f3a('0x3'));var db=require(_0x6f3a('0x4'))['db'];var utils=require(_0x6f3a('0x5'));var logger=require('../../config/logger')(_0x6f3a('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f3a('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6f3a('0x8')]=_[_0x6f3a('0x9')](config[_0x6f3a('0x8')],{'host':_0x6f3a('0xa'),'port':0x18eb});var socket=require(_0x6f3a('0xb'))(new Redis(config['redis']));require(_0x6f3a('0xc'))[_0x6f3a('0xd')](socket);function respondWithRpcPromise(_0x575d40,_0x4f0ef6,_0x26c1f4){return new BPromise(function(_0x48ebc3,_0x46cca0){return client[_0x6f3a('0xe')](_0x575d40,_0x26c1f4)['then'](function(_0x267f99){logger[_0x6f3a('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x4f0ef6,_0x6f3a('0x10'));logger[_0x6f3a('0x11')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4f0ef6,_0x6f3a('0x10'),JSON[_0x6f3a('0x12')](_0x267f99));if(_0x267f99['error']){if(_0x267f99[_0x6f3a('0x13')][_0x6f3a('0x14')]===0x1f4){logger[_0x6f3a('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x4f0ef6,_0x267f99[_0x6f3a('0x13')][_0x6f3a('0x15')]);return _0x46cca0(_0x267f99['error'][_0x6f3a('0x15')]);}logger['error'](_0x6f3a('0x16'),_0x4f0ef6,_0x267f99['error'][_0x6f3a('0x15')]);return _0x48ebc3(_0x267f99['error'][_0x6f3a('0x15')]);}else{logger[_0x6f3a('0xf')](_0x6f3a('0x16'),_0x4f0ef6,_0x6f3a('0x10'));_0x48ebc3(_0x267f99[_0x6f3a('0x17')][_0x6f3a('0x15')]);}})['catch'](function(_0x5116ef){logger[_0x6f3a('0x13')](_0x6f3a('0x16'),_0x4f0ef6,_0x5116ef);_0x46cca0(_0x5116ef);});});}exports[_0x6f3a('0x18')]=function(_0x5b149e){var _0x1562a8=this;return new Promise(function(_0x17690b,_0x2fe717){return db['WhatsappMessage'][_0x6f3a('0x19')](_0x5b149e[_0x6f3a('0x1a')],{'raw':_0x5b149e[_0x6f3a('0x1b')]?_0x5b149e[_0x6f3a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x6f3a('0x1c')](function(_0x68f30){logger[_0x6f3a('0xf')](_0x6f3a('0x18'),_0x5b149e);logger[_0x6f3a('0x11')](_0x6f3a('0x18'),_0x5b149e,JSON['stringify'](_0x68f30));_0x17690b(_0x68f30);})['catch'](function(_0x1de324){logger['error'](_0x6f3a('0x18'),_0x1de324[_0x6f3a('0x15')],_0x5b149e);_0x2fe717(_0x1562a8[_0x6f3a('0x13')](0x1f4,_0x1de324[_0x6f3a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 38f79bb..01f5c21 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8b0=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x549ba1,_0xadc20){var _0x550011=function(_0x27a255){while(--_0x27a255){_0x549ba1['push'](_0x549ba1['shift']());}};_0x550011(++_0xadc20);}(_0xc8b0,0x1cc));var _0x0c8b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc8b0[_0x397e5f];return _0x5302b8;};'use strict';var WhatsappMessageEvents=require(_0x0c8b('0x0'));var events=[_0x0c8b('0x1'),_0x0c8b('0x2'),_0x0c8b('0x3')];function createListener(_0x126c9b,_0x36b99b){return function(_0x2f1c1f){_0x36b99b[_0x0c8b('0x4')](_0x126c9b,_0x2f1c1f);};}function removeListener(_0xd3ef38,_0x3d1cc9){return function(){WhatsappMessageEvents[_0x0c8b('0x5')](_0xd3ef38,_0x3d1cc9);};}exports[_0x0c8b('0x6')]=function(_0x1c6dfe){for(var _0x2ac705=0x0,_0x17b93d=events['length'];_0x2ac705<_0x17b93d;_0x2ac705++){var _0xcbeca9=events[_0x2ac705];var _0x5cf70f=createListener(_0x0c8b('0x7')+_0xcbeca9,_0x1c6dfe);WhatsappMessageEvents['on'](_0xcbeca9,_0x5cf70f);}}; \ No newline at end of file +var _0x2383=['register','length','whatsappMessage:','./whatsappMessage.events','save','update','emit'];(function(_0x30befa,_0x417343){var _0x1db9d8=function(_0x50d0b8){while(--_0x50d0b8){_0x30befa['push'](_0x30befa['shift']());}};_0x1db9d8(++_0x417343);}(_0x2383,0xb2));var _0x3238=function(_0x518cac,_0x233c7e){_0x518cac=_0x518cac-0x0;var _0x17c7c2=_0x2383[_0x518cac];return _0x17c7c2;};'use strict';var WhatsappMessageEvents=require(_0x3238('0x0'));var events=[_0x3238('0x1'),'remove',_0x3238('0x2')];function createListener(_0x22d5b3,_0x314bac){return function(_0x199921){_0x314bac[_0x3238('0x3')](_0x22d5b3,_0x199921);};}function removeListener(_0x4bca38,_0x493657){return function(){WhatsappMessageEvents['removeListener'](_0x4bca38,_0x493657);};}exports[_0x3238('0x4')]=function(_0x4093e4){for(var _0x507e61=0x0,_0x18f178=events[_0x3238('0x5')];_0x507e61<_0x18f178;_0x507e61++){var _0x9e3868=events[_0x507e61];var _0x30987b=createListener(_0x3238('0x6')+_0x9e3868,_0x4093e4);WhatsappMessageEvents['on'](_0x9e3868,_0x30987b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 98194b2..ca64a4f 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a09=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members'];(function(_0x36eafc,_0x23fc6e){var _0x412f49=function(_0x2cdf16){while(--_0x2cdf16){_0x36eafc['push'](_0x36eafc['shift']());}};_0x412f49(++_0x23fc6e);}(_0x4a09,0x112));var _0x94a0=function(_0x2fd1ae,_0x5af591){_0x2fd1ae=_0x2fd1ae-0x0;var _0x462bee=_0x4a09[_0x2fd1ae];return _0x462bee;};'use strict';var multer=require(_0x94a0('0x0'));var util=require(_0x94a0('0x1'));var path=require(_0x94a0('0x2'));var timeout=require(_0x94a0('0x3'));var express=require('express');var router=express[_0x94a0('0x4')]();var auth=require(_0x94a0('0x5'));var interaction=require(_0x94a0('0x6'));var config=require(_0x94a0('0x7'));var controller=require(_0x94a0('0x8'));router[_0x94a0('0x9')]('/',auth[_0x94a0('0xa')](),controller[_0x94a0('0xb')]);router[_0x94a0('0x9')](_0x94a0('0xc'),auth['isAuthenticated'](),controller[_0x94a0('0xd')]);router[_0x94a0('0x9')]('/:id',auth[_0x94a0('0xa')](),controller[_0x94a0('0xe')]);router[_0x94a0('0x9')](_0x94a0('0xf'),auth['isAuthenticated'](),controller[_0x94a0('0x10')]);router[_0x94a0('0x9')](_0x94a0('0x11'),auth['isAuthenticated'](),controller[_0x94a0('0x12')]);router[_0x94a0('0x9')](_0x94a0('0x13'),auth[_0x94a0('0xa')](),controller[_0x94a0('0x14')]);router['post']('/',auth[_0x94a0('0xa')](),controller[_0x94a0('0x15')]);router['post'](_0x94a0('0x11'),auth[_0x94a0('0xa')](),controller[_0x94a0('0x16')]);router['post'](_0x94a0('0x13'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x94a0('0x17'),auth[_0x94a0('0xa')](),controller[_0x94a0('0x18')]);router[_0x94a0('0x19')]('/:id',auth[_0x94a0('0xa')](),controller[_0x94a0('0x1a')]);router[_0x94a0('0x19')](_0x94a0('0x11'),auth[_0x94a0('0xa')](),controller[_0x94a0('0x1b')]);router[_0x94a0('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x94a0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xfe43=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20f72c,_0x159470){var _0x1f0462=function(_0x1e2933){while(--_0x1e2933){_0x20f72c['push'](_0x20f72c['shift']());}};_0x1f0462(++_0x159470);}(_0xfe43,0x173));var _0x3fe4=function(_0x2371d0,_0x286b09){_0x2371d0=_0x2371d0-0x0;var _0x5f3a71=_0xfe43[_0x2371d0];return _0x5f3a71;};'use strict';var multer=require(_0x3fe4('0x0'));var util=require(_0x3fe4('0x1'));var path=require('path');var timeout=require(_0x3fe4('0x2'));var express=require(_0x3fe4('0x3'));var router=express[_0x3fe4('0x4')]();var auth=require(_0x3fe4('0x5'));var interaction=require(_0x3fe4('0x6'));var config=require(_0x3fe4('0x7'));var controller=require('./whatsappQueue.controller');router[_0x3fe4('0x8')]('/',auth[_0x3fe4('0x9')](),controller[_0x3fe4('0xa')]);router['get']('/describe',auth[_0x3fe4('0x9')](),controller[_0x3fe4('0xb')]);router[_0x3fe4('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth[_0x3fe4('0x9')](),controller[_0x3fe4('0xc')]);router['get'](_0x3fe4('0xd'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0xe')]);router[_0x3fe4('0x8')](_0x3fe4('0xf'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x10')]);router[_0x3fe4('0x11')]('/',auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x12')]);router[_0x3fe4('0x11')](_0x3fe4('0xd'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x13')]);router[_0x3fe4('0x11')](_0x3fe4('0xf'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x14')]);router[_0x3fe4('0x15')](_0x3fe4('0x16'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x17')]);router[_0x3fe4('0x18')](_0x3fe4('0x16'),auth[_0x3fe4('0x9')](),controller[_0x3fe4('0x19')]);router[_0x3fe4('0x18')](_0x3fe4('0xd'),auth['isAuthenticated'](),controller[_0x3fe4('0x1a')]);router[_0x3fe4('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x3fe4('0x1b')]);module[_0x3fe4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 989f454..a4a4bb5 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad05=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4da008,_0x1e853a){var _0x15ceb1=function(_0x4a58fb){while(--_0x4a58fb){_0x4da008['push'](_0x4da008['shift']());}};_0x15ceb1(++_0x1e853a);}(_0xad05,0x1cc));var _0x5ad0=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xad05[_0x57add2];return _0x4e3670;};'use strict';var Sequelize=require(_0x5ad0('0x0'));module[_0x5ad0('0x1')]={'name':{'type':Sequelize[_0x5ad0('0x2')],'unique':_0x5ad0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5ad0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5ad0('0x5')](_0x5ad0('0x6'),_0x5ad0('0x7'),_0x5ad0('0x8'))},'description':{'type':Sequelize[_0x5ad0('0x2')]}}; \ No newline at end of file +var _0x77fe=['exports','STRING','name','beepall','roundrobin','sequelize'];(function(_0x2bd754,_0x477b49){var _0x24f693=function(_0xea78d2){while(--_0xea78d2){_0x2bd754['push'](_0x2bd754['shift']());}};_0x24f693(++_0x477b49);}(_0x77fe,0x9b));var _0xe77f=function(_0x4021e7,_0x11ce1a){_0x4021e7=_0x4021e7-0x0;var _0xf5e37=_0x77fe[_0x4021e7];return _0xf5e37;};'use strict';var Sequelize=require(_0xe77f('0x0'));module[_0xe77f('0x1')]={'name':{'type':Sequelize[_0xe77f('0x2')],'unique':_0xe77f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xe77f('0x4'),_0xe77f('0x5'))},'description':{'type':Sequelize[_0xe77f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 3c5a82e..693775e 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fd7=['count','offset','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','send','index','map','WhatsappQueue','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','rows','show','params','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','pick','findAll','User','UserId','agent','whatsappPause','createdAt','%s/%s','updatedAt','addTeams','Team','online','interface','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x8fd7,0xec));var _0x78fd=function(_0xfcca6,_0x5cf278){_0xfcca6=_0xfcca6-0x0;var _0x217b37=_0x8fd7[_0xfcca6];return _0x217b37;};'use strict';var pdf=require(_0x78fd('0x0'));var emlformat=require(_0x78fd('0x1'));var rimraf=require(_0x78fd('0x2'));var zipdir=require(_0x78fd('0x3'));var jsonpatch=require(_0x78fd('0x4'));var rp=require(_0x78fd('0x5'));var moment=require(_0x78fd('0x6'));var BPromise=require(_0x78fd('0x7'));var Mustache=require('mustache');var util=require(_0x78fd('0x8'));var path=require(_0x78fd('0x9'));var sox=require(_0x78fd('0xa'));var csv=require(_0x78fd('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x78fd('0xc'));var squel=require(_0x78fd('0xd'));var crypto=require('crypto');var jsforce=require(_0x78fd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x78fd('0xb'));var querystring=require(_0x78fd('0xf'));var Papa=require(_0x78fd('0x10'));var Redis=require(_0x78fd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x78fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78fd('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x78fd('0x14'))['db'];config[_0x78fd('0x15')]=_[_0x78fd('0x16')](config[_0x78fd('0x15')],{'host':_0x78fd('0x17'),'port':0x18eb});var socket=require(_0x78fd('0x18'))(new Redis(config[_0x78fd('0x15')]));require(_0x78fd('0x19'))[_0x78fd('0x1a')](socket);function respondWithStatusCode(_0x20d833,_0x590217){_0x590217=_0x590217||0xcc;return function(_0x55b222){if(_0x55b222){return _0x20d833[_0x78fd('0x1b')](_0x590217);}return _0x20d833['status'](_0x590217)[_0x78fd('0x1c')]();};}function respondWithResult(_0x17629c,_0x3be05e){_0x3be05e=_0x3be05e||0xc8;return function(_0x7bc406){if(_0x7bc406){return _0x17629c[_0x78fd('0x1d')](_0x3be05e)['json'](_0x7bc406);}};}function respondWithFilteredResult(_0xf0ca40,_0x4bbc7d){return function(_0x402789){if(_0x402789){var _0x30bcc4=_0x402789[_0x78fd('0x1e')],_0x8c2318=_0x4bbc7d[_0x78fd('0x1f')],_0x598e7d=_0x4bbc7d[_0x78fd('0x1f')]+_0x4bbc7d[_0x78fd('0x20')],_0xeff6f7;if(_0x598e7d>=_0x30bcc4){_0x598e7d=_0x30bcc4;_0xeff6f7=0xc8;}else{_0xeff6f7=0xce;}_0xf0ca40['status'](_0xeff6f7);return _0xf0ca40[_0x78fd('0x21')](_0x78fd('0x22'),_0x8c2318+'-'+_0x598e7d+'/'+_0x30bcc4)['json'](_0x402789);}return null;};}function patchUpdates(_0x50c726){return function(_0x16f6fa){try{jsonpatch[_0x78fd('0x23')](_0x16f6fa,_0x50c726,!![]);}catch(_0x2e46a9){return BPromise['reject'](_0x2e46a9);}return _0x16f6fa[_0x78fd('0x24')]();};}function saveUpdates(_0x44b834,_0x5cb24c){return function(_0x274c89){if(_0x274c89){return _0x274c89[_0x78fd('0x25')](_0x44b834)['then'](function(_0x29e1df){return _0x29e1df;});}return null;};}function removeEntity(_0x1a3492,_0x38e6e7){return function(_0x513256){if(_0x513256){return _0x513256['destroy']()[_0x78fd('0x26')](function(){var _0x88aced=_0x513256[_0x78fd('0x27')]({'plain':!![]});var _0x45c217='WhatsappQueues';return db[_0x78fd('0x28')]['destroy']({'where':{'type':_0x45c217,'resourceId':_0x88aced['id']}})[_0x78fd('0x26')](function(){return _0x513256;});})[_0x78fd('0x26')](function(){_0x1a3492[_0x78fd('0x1d')](0xcc)[_0x78fd('0x1c')]();});}};}function handleEntityNotFound(_0xeba1ac,_0x363fc0){return function(_0x19f80b){if(!_0x19f80b){_0xeba1ac['sendStatus'](0x194);}return _0x19f80b;};}function handleError(_0x286193,_0x38afc1){_0x38afc1=_0x38afc1||0x1f4;return function(_0x3d0139){logger[_0x78fd('0x29')](_0x3d0139['stack']);if(_0x3d0139['name']){delete _0x3d0139['name'];}_0x286193['status'](_0x38afc1)[_0x78fd('0x2a')](_0x3d0139);};}exports[_0x78fd('0x2b')]=function(_0x53e812,_0x36fa40){var _0x4482ab={},_0x5708c1={},_0x214b88={'count':0x0,'rows':[]};var _0x38d7ab=_[_0x78fd('0x2c')](db[_0x78fd('0x2d')]['rawAttributes'],function(_0x1d7f72){return{'name':_0x1d7f72['fieldName'],'type':_0x1d7f72[_0x78fd('0x2e')]['key']};});_0x5708c1[_0x78fd('0x2f')]=_['map'](_0x38d7ab,_0x78fd('0x30'));_0x5708c1[_0x78fd('0x31')]=_[_0x78fd('0x32')](_0x53e812['query']);_0x5708c1['filters']=_['intersection'](_0x5708c1['model'],_0x5708c1[_0x78fd('0x31')]);_0x4482ab[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x5708c1[_0x78fd('0x2f')],qs[_0x78fd('0x35')](_0x53e812[_0x78fd('0x31')][_0x78fd('0x35')]));_0x4482ab[_0x78fd('0x33')]=_0x4482ab['attributes'][_0x78fd('0x36')]?_0x4482ab['attributes']:_0x5708c1['model'];if(!_0x53e812['query'][_0x78fd('0x37')](_0x78fd('0x38'))){_0x4482ab[_0x78fd('0x20')]=qs[_0x78fd('0x20')](_0x53e812[_0x78fd('0x31')][_0x78fd('0x20')]);_0x4482ab[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x53e812['query']['offset']);}_0x4482ab[_0x78fd('0x39')]=qs[_0x78fd('0x3a')](_0x53e812[_0x78fd('0x31')][_0x78fd('0x3a')]);_0x4482ab[_0x78fd('0x3b')]=qs[_0x78fd('0x3c')](_['pick'](_0x53e812[_0x78fd('0x31')],_0x5708c1['filters']),_0x38d7ab);if(_0x53e812[_0x78fd('0x31')][_0x78fd('0x3d')]){_0x4482ab['where']=_['merge'](_0x4482ab[_0x78fd('0x3b')],{'$or':_[_0x78fd('0x2c')](_0x38d7ab,function(_0x3f47e4){if(_0x3f47e4['type']!==_0x78fd('0x3e')){var _0x476c16={};_0x476c16[_0x3f47e4[_0x78fd('0x30')]]={'$like':'%'+_0x53e812[_0x78fd('0x31')][_0x78fd('0x3d')]+'%'};return _0x476c16;}})});}_0x4482ab=_['merge']({},_0x4482ab,_0x53e812[_0x78fd('0x3f')]);var _0x23ebe7={'where':_0x4482ab[_0x78fd('0x3b')]};return db[_0x78fd('0x2d')]['count'](_0x23ebe7)[_0x78fd('0x26')](function(_0x4460d4){_0x214b88[_0x78fd('0x1e')]=_0x4460d4;if(_0x53e812[_0x78fd('0x31')][_0x78fd('0x40')]){_0x4482ab[_0x78fd('0x41')]=[{'all':!![]}];}return db[_0x78fd('0x2d')]['findAll'](_0x4482ab);})[_0x78fd('0x26')](function(_0x43a21d){_0x214b88[_0x78fd('0x42')]=_0x43a21d;return _0x214b88;})['then'](respondWithFilteredResult(_0x36fa40,_0x4482ab))['catch'](handleError(_0x36fa40,null));};exports[_0x78fd('0x43')]=function(_0x56e24d,_0x2d6a78){var _0x1ad9fd={'raw':!![],'where':{'id':_0x56e24d[_0x78fd('0x44')]['id']}},_0x3ee6ad={};_0x3ee6ad['model']=_[_0x78fd('0x32')](db[_0x78fd('0x2d')]['rawAttributes']);_0x3ee6ad[_0x78fd('0x31')]=_[_0x78fd('0x32')](_0x56e24d[_0x78fd('0x31')]);_0x3ee6ad['filters']=_['intersection'](_0x3ee6ad[_0x78fd('0x2f')],_0x3ee6ad[_0x78fd('0x31')]);_0x1ad9fd[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x3ee6ad[_0x78fd('0x2f')],qs['fields'](_0x56e24d[_0x78fd('0x31')][_0x78fd('0x35')]));_0x1ad9fd[_0x78fd('0x33')]=_0x1ad9fd[_0x78fd('0x33')]['length']?_0x1ad9fd['attributes']:_0x3ee6ad[_0x78fd('0x2f')];if(_0x56e24d[_0x78fd('0x31')]['includeAll']){_0x1ad9fd[_0x78fd('0x41')]=[{'all':!![]}];}_0x1ad9fd=_[_0x78fd('0x45')]({},_0x1ad9fd,_0x56e24d[_0x78fd('0x3f')]);return db[_0x78fd('0x2d')]['find'](_0x1ad9fd)[_0x78fd('0x26')](handleEntityNotFound(_0x2d6a78,null))[_0x78fd('0x26')](respondWithResult(_0x2d6a78,null))[_0x78fd('0x46')](handleError(_0x2d6a78,null));};exports['create']=function(_0x51754b,_0x33eca1){return db[_0x78fd('0x2d')][_0x78fd('0x47')](_0x51754b[_0x78fd('0x48')],{})[_0x78fd('0x26')](function(_0x429641){var _0x289afd=_0x51754b[_0x78fd('0x49')][_0x78fd('0x27')]({'plain':!![]});if(!_0x289afd)throw new Error(_0x78fd('0x4a'));if(_0x289afd[_0x78fd('0x4b')]===_0x78fd('0x49')){var _0x24850e=_0x429641[_0x78fd('0x27')]({'plain':!![]});var _0x24a15e='WhatsappQueues';return db[_0x78fd('0x4c')][_0x78fd('0x4d')]({'where':{'name':_0x24a15e,'userProfileId':_0x289afd['userProfileId']},'raw':!![]})[_0x78fd('0x26')](function(_0x11a8c0){if(_0x11a8c0&&_0x11a8c0[_0x78fd('0x4e')]===0x0){return db['UserProfileResource'][_0x78fd('0x47')]({'name':_0x24850e[_0x78fd('0x30')],'resourceId':_0x24850e['id'],'type':_0x11a8c0[_0x78fd('0x30')],'sectionId':_0x11a8c0['id']},{})[_0x78fd('0x26')](function(){return _0x429641;});}else{return _0x429641;}})[_0x78fd('0x46')](function(_0x2ed41a){logger[_0x78fd('0x29')](_0x78fd('0x4f'),_0x2ed41a);throw _0x2ed41a;});}return _0x429641;})['then'](respondWithResult(_0x33eca1,0xc9))[_0x78fd('0x46')](handleError(_0x33eca1,null));};exports['update']=function(_0x18207d,_0x425708){if(_0x18207d['body']['id']){delete _0x18207d[_0x78fd('0x48')]['id'];}return db[_0x78fd('0x2d')][_0x78fd('0x4d')]({'where':{'id':_0x18207d[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0x425708,null))[_0x78fd('0x26')](saveUpdates(_0x18207d['body'],null))['then'](respondWithResult(_0x425708,null))[_0x78fd('0x46')](handleError(_0x425708,null));};exports[_0x78fd('0x50')]=function(_0x1530d0,_0xf50c8c){return db['WhatsappQueue'][_0x78fd('0x4d')]({'where':{'id':_0x1530d0[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0xf50c8c,null))[_0x78fd('0x26')](removeEntity(_0xf50c8c,null))[_0x78fd('0x46')](handleError(_0xf50c8c,null));};exports[_0x78fd('0x51')]=function(_0x1f50e0,_0x22b0dc){return db[_0x78fd('0x2d')][_0x78fd('0x51')]()['then'](respondWithResult(_0x22b0dc,null))[_0x78fd('0x46')](handleError(_0x22b0dc,null));};exports[_0x78fd('0x52')]=function(_0x561b05,_0x3387f5,_0x375e72){var _0x440c6c={'raw':!![],'where':{}},_0x11fd3b={},_0x1485da;return db[_0x78fd('0x2d')][_0x78fd('0x53')]({'where':{'id':_0x561b05[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0x3387f5,null))[_0x78fd('0x26')](function(_0x26922f){if(_0x26922f){_0x1485da=_0x26922f[_0x78fd('0x27')]({'plain':!![]});_0x11fd3b['model']=_[_0x78fd('0x32')](db[_0x78fd('0x54')][_0x78fd('0x55')]);_0x11fd3b[_0x78fd('0x31')]=_['keys'](_0x561b05[_0x78fd('0x31')]);_0x11fd3b['filters']=_[_0x78fd('0x34')](_0x11fd3b['model'],_0x11fd3b['query']);_0x440c6c[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x11fd3b['model'],qs[_0x78fd('0x35')](_0x561b05[_0x78fd('0x31')][_0x78fd('0x35')]));_0x440c6c[_0x78fd('0x33')]=_0x440c6c[_0x78fd('0x33')][_0x78fd('0x36')]?_0x440c6c[_0x78fd('0x33')]:_0x11fd3b[_0x78fd('0x2f')];if(!_0x561b05[_0x78fd('0x31')]['hasOwnProperty'](_0x78fd('0x38'))){_0x440c6c[_0x78fd('0x20')]=qs[_0x78fd('0x20')](_0x561b05['query']['limit']);_0x440c6c[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x561b05['query'][_0x78fd('0x1f')]);}_0x440c6c[_0x78fd('0x39')]=qs[_0x78fd('0x3a')](_0x561b05[_0x78fd('0x31')][_0x78fd('0x3a')]);_0x440c6c[_0x78fd('0x3b')]=qs[_0x78fd('0x3c')](_[_0x78fd('0x56')](_0x561b05['query'],_0x11fd3b[_0x78fd('0x3c')]));_0x440c6c[_0x78fd('0x3b')]['WhatsappQueueId']=_0x26922f['id'];if(_0x561b05['query']['filter']){_0x440c6c[_0x78fd('0x3b')]=_[_0x78fd('0x45')](_0x440c6c[_0x78fd('0x3b')],{'$or':_[_0x78fd('0x2c')](_0x440c6c['attributes'],function(_0x5e950c){var _0x1f989e={};_0x1f989e[_0x5e950c]={'$like':'%'+_0x561b05[_0x78fd('0x31')]['filter']+'%'};return _0x1f989e;})});}_0x440c6c=_[_0x78fd('0x45')]({},_0x440c6c,_0x561b05[_0x78fd('0x3f')]);return db[_0x78fd('0x54')][_0x78fd('0x57')](_0x440c6c);}})[_0x78fd('0x26')](function(_0x5120de){if(_0x5120de){return db[_0x78fd('0x58')]['findAndCountAll']({'where':{'id':_[_0x78fd('0x2c')](_0x5120de,_0x78fd('0x59')),'role':_0x78fd('0x5a')},'attributes':['id',_0x78fd('0x30'),_0x78fd('0x5b'),'updatedAt',_0x78fd('0x5c')]});}})['then'](function(_0x7f9727){if(_0x7f9727){return{'count':_0x7f9727[_0x78fd('0x1e')],'rows':_[_0x78fd('0x2c')](_0x7f9727['rows'],function(_0x526af4){return{'membername':_0x526af4[_0x78fd('0x30')],'UserId':_0x526af4['id'],'queue_name':_0x1485da[_0x78fd('0x30')],'WhatsappQueueId':_0x1485da['id'],'interface':util['format'](_0x78fd('0x5d'),'SIP',_0x526af4['name']),'penalty':0x0,'paused':_0x526af4[_0x78fd('0x5b')],'createdAt':_0x526af4[_0x78fd('0x5c')],'updatedAt':_0x526af4[_0x78fd('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x78fd('0x26')](respondWithFilteredResult(_0x3387f5,_0x440c6c))[_0x78fd('0x46')](handleError(_0x3387f5,null));};exports['getTeams']=function(_0x17d83e,_0x53c6b4,_0x4e9bc6){var _0x429efa={};var _0x2c0616={};var _0x4f7b1e;var _0x222020;return db['WhatsappQueue']['findOne']({'where':{'id':_0x17d83e[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0x53c6b4,null))[_0x78fd('0x26')](function(_0xc0e594){if(_0xc0e594){_0x4f7b1e=_0xc0e594;_0x2c0616[_0x78fd('0x2f')]=_[_0x78fd('0x32')](db['Team'][_0x78fd('0x55')]);_0x2c0616[_0x78fd('0x31')]=_['keys'](_0x17d83e[_0x78fd('0x31')]);_0x2c0616[_0x78fd('0x3c')]=_[_0x78fd('0x34')](_0x2c0616['model'],_0x2c0616[_0x78fd('0x31')]);_0x429efa[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x2c0616['model'],qs[_0x78fd('0x35')](_0x17d83e[_0x78fd('0x31')]['fields']));_0x429efa[_0x78fd('0x33')]=_0x429efa[_0x78fd('0x33')][_0x78fd('0x36')]?_0x429efa[_0x78fd('0x33')]:_0x2c0616[_0x78fd('0x2f')];_0x429efa[_0x78fd('0x39')]=qs['sort'](_0x17d83e[_0x78fd('0x31')][_0x78fd('0x3a')]);_0x429efa[_0x78fd('0x3b')]=qs['filters'](_[_0x78fd('0x56')](_0x17d83e[_0x78fd('0x31')],_0x2c0616[_0x78fd('0x3c')]));if(_0x17d83e[_0x78fd('0x31')]['filter']){_0x429efa[_0x78fd('0x3b')]=_[_0x78fd('0x45')](_0x429efa[_0x78fd('0x3b')],{'$or':_['map'](_0x429efa[_0x78fd('0x33')],function(_0x1b2c24){var _0x1e3558={};_0x1e3558[_0x1b2c24]={'$like':'%'+_0x17d83e[_0x78fd('0x31')][_0x78fd('0x3d')]+'%'};return _0x1e3558;})});}_0x429efa=_[_0x78fd('0x45')]({},_0x429efa,_0x17d83e[_0x78fd('0x3f')]);return _0x4f7b1e['getTeams'](_0x429efa);}})[_0x78fd('0x26')](function(_0x45da1b){if(_0x45da1b){_0x222020=_0x45da1b[_0x78fd('0x36')];if(!_0x17d83e[_0x78fd('0x31')][_0x78fd('0x37')]('nolimit')){_0x429efa['limit']=qs[_0x78fd('0x20')](_0x17d83e[_0x78fd('0x31')][_0x78fd('0x20')]);_0x429efa[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x17d83e[_0x78fd('0x31')][_0x78fd('0x1f')]);}return _0x4f7b1e['getTeams'](_0x429efa);}})[_0x78fd('0x26')](function(_0x2a4f0a){if(_0x2a4f0a){return _0x2a4f0a?{'count':_0x222020,'rows':_0x2a4f0a}:null;}})['then'](respondWithResult(_0x53c6b4,null))[_0x78fd('0x46')](handleError(_0x53c6b4,null));};exports[_0x78fd('0x5f')]=function(_0x1799a8,_0xb1ae44,_0x5c6d60){var _0x451a4b=_0x1799a8[_0x78fd('0x48')]['ids'];return db[_0x78fd('0x60')][_0x78fd('0x57')]({'where':{'id':_0x451a4b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x78fd('0x30'),_0x78fd('0x61'),'voicePause',_0x78fd('0x62')],'raw':!![]}]})['then'](function(_0xbfa5ea){if(_0xbfa5ea){var _0x5b9227=_[_0x78fd('0x63')](_0xbfa5ea,function(_0xf50ef9){var _0x376145=_0xf50ef9[_0x78fd('0x27')]({'plain':!![]});return _0x376145['Agents'];});return db[_0x78fd('0x2d')][_0x78fd('0x4d')]({'where':{'id':_0x1799a8[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](function(_0x382b77){return db[_0x78fd('0x64')]['transaction'](function(_0x2bec07){return _0x382b77[_0x78fd('0x5f')](_0x451a4b,{'transaction':_0x2bec07})[_0x78fd('0x26')](function(){return BPromise[_0x78fd('0x65')](_0x5b9227,function(_0xddb1f4){return db['UserWhatsappQueue'][_0x78fd('0x66')]({'where':{'UserId':_0xddb1f4['id'],'WhatsappQueueId':_0x1799a8[_0x78fd('0x44')]['id']},'transaction':_0x2bec07});});})[_0x78fd('0x26')](function(){_0x5b9227['forEach'](function(_0x3072fa){socket[_0x78fd('0x67')](_0x78fd('0x68'),{'UserId':_0x3072fa['id'],'WhatsappQueueId':_0x382b77['id']});});});});});}})[_0x78fd('0x26')](respondWithStatusCode(_0xb1ae44,null))[_0x78fd('0x46')](handleError(_0xb1ae44,null));};exports[_0x78fd('0x69')]=function(_0x5afaf7,_0xe5e560,_0x7d1d74){return db[_0x78fd('0x60')][_0x78fd('0x57')]({'where':{'id':_0x5afaf7[_0x78fd('0x31')][_0x78fd('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x78fd('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe5e560,null))[_0x78fd('0x26')](function(_0x41fd47){var _0x25edf8=_[_0x78fd('0x2c')](_0x41fd47,'id');var _0x1bb4a6=[];var _0x41d47e=[];var _0x4e09bb=squel['select']();_0x4e09bb['field'](_0x78fd('0x6b'))[_0x78fd('0x6c')]('team_has_whatsapp_queues','tq')['join'](_0x78fd('0x6d'),'ut',_0x78fd('0x6e'))['where'](_0x78fd('0x6f'),_0x5afaf7[_0x78fd('0x44')]['id']);for(var _0x4f0808=0x0;_0x4f0808<_0x41fd47[_0x78fd('0x36')];_0x4f0808+=0x1){let _0xf04a06=_0x41fd47[_0x4f0808];for(var _0x36180a=0x0;_0x36180a<_0xf04a06[_0x78fd('0x70')][_0x78fd('0x36')];_0x36180a+=0x1){let _0x34a2a7=_0xf04a06[_0x78fd('0x70')][_0x36180a];var _0x49be91=_0x4e09bb[_0x78fd('0x71')]();_0x49be91[_0x78fd('0x3b')](_0x78fd('0x72'),_0x34a2a7['id']);_0x41d47e['push'](db['sequelize'][_0x78fd('0x31')](_0x49be91['toString'](),{'type':db[_0x78fd('0x64')][_0x78fd('0x73')][_0x78fd('0x74')]})[_0x78fd('0x26')](function(_0x2c0185){if(_0x2c0185['length']===0x1){return _0x34a2a7['id'];}else{var _0xa968a2=_[_0x78fd('0x75')](_[_0x78fd('0x2c')](_0x2c0185,_0x78fd('0x76')),function(_0x3b43dd){return _[_0x78fd('0x77')](_0x25edf8,_0x3b43dd);});if(_0xa968a2){return _0x34a2a7['id'];}}}));}}return BPromise[_0x78fd('0x78')](_0x41d47e)['then'](function(_0x262fcb){_0x1bb4a6=_(_0x1bb4a6)[_0x78fd('0x79')](_0x262fcb)['compact']()[_0x78fd('0x7a')]();return db[_0x78fd('0x2d')]['find']({'where':{'id':_0x5afaf7[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](function(_0x5e8039){return db[_0x78fd('0x64')][_0x78fd('0x7b')](function(_0x3c9038){return _0x5e8039[_0x78fd('0x69')](_0x5afaf7[_0x78fd('0x31')]['ids'],{'transaction':_0x3c9038})[_0x78fd('0x26')](function(){if(!_[_0x78fd('0x7c')](_0x1bb4a6)){return _0x5e8039[_0x78fd('0x7d')](_0x1bb4a6,{'transaction':_0x3c9038});}})[_0x78fd('0x26')](function(){_0x1bb4a6[_0x78fd('0x7e')](function(_0x39bd55){socket[_0x78fd('0x67')](_0x78fd('0x7f'),{'UserId':_0x39bd55,'WhatsappQueueId':_0x5e8039['id']});});});});});});})[_0x78fd('0x26')](respondWithStatusCode(_0xe5e560,null))[_0x78fd('0x46')](handleError(_0xe5e560,null));};exports[_0x78fd('0x80')]=function(_0x17ca8f,_0xf220db,_0x365e2d){return db[_0x78fd('0x2d')]['find']({'where':{'id':_0x17ca8f[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0xf220db,null))['then'](function(_0x68954c){if(_0x68954c){return _0x68954c[_0x78fd('0x80')](_0x17ca8f[_0x78fd('0x48')][_0x78fd('0x6a')],_[_0x78fd('0x81')](_0x17ca8f['body'],['ids','id'])||{})[_0x78fd('0x82')](function(_0xbcf838){for(var _0x1776b3=0x0;_0x1776b3<_0x17ca8f[_0x78fd('0x48')]['ids'][_0x78fd('0x36')];_0x1776b3+=0x1){socket[_0x78fd('0x67')](_0x78fd('0x68'),{'UserId':_0x17ca8f['body'][_0x78fd('0x6a')][_0x1776b3],'WhatsappQueueId':_0x17ca8f[_0x78fd('0x44')]['id']});}return _0xbcf838;});}})[_0x78fd('0x26')](respondWithResult(_0xf220db,null))[_0x78fd('0x46')](handleError(_0xf220db,null));};exports[_0x78fd('0x7d')]=function(_0x14c9b3,_0x1ea562,_0x2e6450){return db['WhatsappQueue'][_0x78fd('0x4d')]({'where':{'id':_0x14c9b3[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0x1ea562,null))[_0x78fd('0x26')](function(_0x4eb930){if(_0x4eb930){return _0x4eb930[_0x78fd('0x7d')](_0x14c9b3[_0x78fd('0x31')][_0x78fd('0x6a')])['then'](function(){if(_[_0x78fd('0x83')](_0x14c9b3[_0x78fd('0x31')][_0x78fd('0x6a')])){for(var _0x5455ae=0x0;_0x5455ae<_0x14c9b3[_0x78fd('0x31')][_0x78fd('0x6a')][_0x78fd('0x36')];_0x5455ae+=0x1){socket[_0x78fd('0x67')](_0x78fd('0x7f'),{'UserId':Number(_0x14c9b3[_0x78fd('0x31')]['ids'][_0x5455ae]),'WhatsappQueueId':Number(_0x14c9b3[_0x78fd('0x44')]['id'])});}}else{socket['emit'](_0x78fd('0x7f'),{'UserId':Number(_0x14c9b3['query'][_0x78fd('0x6a')]),'WhatsappQueueId':Number(_0x14c9b3[_0x78fd('0x44')]['id'])});}});}})[_0x78fd('0x26')](respondWithStatusCode(_0x1ea562,null))[_0x78fd('0x46')](handleError(_0x1ea562,null));};exports[_0x78fd('0x84')]=function(_0x1eb408,_0x1dcfe9,_0x3b8a95){var _0xc004b9={};var _0xb67ab9={};var _0x5837cc;var _0x58ed74;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1eb408[_0x78fd('0x44')]['id']}})[_0x78fd('0x26')](handleEntityNotFound(_0x1dcfe9,null))[_0x78fd('0x26')](function(_0x386442){if(_0x386442){_0x5837cc=_0x386442;_0xb67ab9[_0x78fd('0x2f')]=_[_0x78fd('0x32')](db[_0x78fd('0x58')][_0x78fd('0x55')]);_0xb67ab9['query']=_['keys'](_0x1eb408[_0x78fd('0x31')]);_0xb67ab9[_0x78fd('0x3c')]=_[_0x78fd('0x34')](_0xb67ab9['model'],_0xb67ab9[_0x78fd('0x31')]);_0xc004b9[_0x78fd('0x33')]=_['intersection'](_0xb67ab9[_0x78fd('0x2f')],qs[_0x78fd('0x35')](_0x1eb408[_0x78fd('0x31')][_0x78fd('0x35')]));_0xc004b9[_0x78fd('0x33')]=_0xc004b9[_0x78fd('0x33')][_0x78fd('0x36')]?_0xc004b9[_0x78fd('0x33')]:_0xb67ab9['model'];_0xc004b9[_0x78fd('0x39')]=qs[_0x78fd('0x3a')](_0x1eb408[_0x78fd('0x31')]['sort']);_0xc004b9[_0x78fd('0x3b')]=qs[_0x78fd('0x3c')](_['pick'](_0x1eb408[_0x78fd('0x31')],_0xb67ab9[_0x78fd('0x3c')]));if(_0x1eb408[_0x78fd('0x31')]['filter']){_0xc004b9['where']=_['merge'](_0xc004b9[_0x78fd('0x3b')],{'$or':_[_0x78fd('0x2c')](_0xc004b9['attributes'],function(_0x30efc5){var _0x23a0fa={};_0x23a0fa[_0x30efc5]={'$like':'%'+_0x1eb408[_0x78fd('0x31')]['filter']+'%'};return _0x23a0fa;})});}_0xc004b9=_[_0x78fd('0x45')]({},_0xc004b9,_0x1eb408[_0x78fd('0x3f')]);return _0x5837cc['getAgents'](_0xc004b9);}})[_0x78fd('0x26')](function(_0x225ac9){if(_0x225ac9){_0x58ed74=_0x225ac9[_0x78fd('0x36')];if(!_0x1eb408[_0x78fd('0x31')][_0x78fd('0x37')]('nolimit')){_0xc004b9[_0x78fd('0x20')]=qs[_0x78fd('0x20')](_0x1eb408[_0x78fd('0x31')]['limit']);_0xc004b9[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x1eb408['query'][_0x78fd('0x1f')]);}return _0x5837cc[_0x78fd('0x84')](_0xc004b9);}})[_0x78fd('0x26')](function(_0xa8cbd5){if(_0xa8cbd5){return _0xa8cbd5?{'count':_0x58ed74,'rows':_0xa8cbd5}:null;}})['then'](respondWithResult(_0x1dcfe9,null))[_0x78fd('0x46')](handleError(_0x1dcfe9,null));}; \ No newline at end of file +var _0x4be7=['rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','status','end','json','count','offset','Content-Range','reject','save','then','destroy','get','UserProfileResource','stack','name','index','map','WhatsappQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','show','params','length','includeAll','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','WhatsappQueueId','UserWhatsappQueue','findAll','User','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','html-pdf','eml-format'];(function(_0x2426a9,_0xd7870e){var _0x504ae7=function(_0x22c3f){while(--_0x22c3f){_0x2426a9['push'](_0x2426a9['shift']());}};_0x504ae7(++_0xd7870e);}(_0x4be7,0x114));var _0x74be=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0x4be7[_0x5712cc];return _0x15561a;};'use strict';var pdf=require(_0x74be('0x0'));var emlformat=require(_0x74be('0x1'));var rimraf=require(_0x74be('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74be('0x3'));var rp=require(_0x74be('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74be('0x5'));var util=require(_0x74be('0x6'));var path=require(_0x74be('0x7'));var sox=require(_0x74be('0x8'));var csv=require(_0x74be('0x9'));var ejs=require(_0x74be('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x74be('0xb'));var crypto=require(_0x74be('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x74be('0x9'));var querystring=require(_0x74be('0xd'));var Papa=require(_0x74be('0xe'));var Redis=require(_0x74be('0xf'));var authService=require(_0x74be('0x10'));var qs=require(_0x74be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74be('0x12'))(_0x74be('0x13'));var utils=require('../../config/utils');var config=require(_0x74be('0x14'));var db=require(_0x74be('0x15'))['db'];config[_0x74be('0x16')]=_[_0x74be('0x17')](config['redis'],{'host':_0x74be('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74be('0x16')]));require(_0x74be('0x19'))[_0x74be('0x1a')](socket);function respondWithStatusCode(_0x265473,_0xaa7701){_0xaa7701=_0xaa7701||0xcc;return function(_0x5086bd){if(_0x5086bd){return _0x265473['sendStatus'](_0xaa7701);}return _0x265473[_0x74be('0x1b')](_0xaa7701)[_0x74be('0x1c')]();};}function respondWithResult(_0xbacdd4,_0x3163ee){_0x3163ee=_0x3163ee||0xc8;return function(_0x29093b){if(_0x29093b){return _0xbacdd4[_0x74be('0x1b')](_0x3163ee)[_0x74be('0x1d')](_0x29093b);}};}function respondWithFilteredResult(_0x6ed05d,_0x196149){return function(_0x14f24b){if(_0x14f24b){var _0x44572a=_0x14f24b[_0x74be('0x1e')],_0x5c8f4d=_0x196149[_0x74be('0x1f')],_0x23e7f3=_0x196149[_0x74be('0x1f')]+_0x196149['limit'],_0x58b440;if(_0x23e7f3>=_0x44572a){_0x23e7f3=_0x44572a;_0x58b440=0xc8;}else{_0x58b440=0xce;}_0x6ed05d[_0x74be('0x1b')](_0x58b440);return _0x6ed05d['set'](_0x74be('0x20'),_0x5c8f4d+'-'+_0x23e7f3+'/'+_0x44572a)['json'](_0x14f24b);}return null;};}function patchUpdates(_0x17eabb){return function(_0x2a7ab9){try{jsonpatch['apply'](_0x2a7ab9,_0x17eabb,!![]);}catch(_0x3c6e7e){return BPromise[_0x74be('0x21')](_0x3c6e7e);}return _0x2a7ab9[_0x74be('0x22')]();};}function saveUpdates(_0xef1a79,_0x1b8532){return function(_0x5dc19e){if(_0x5dc19e){return _0x5dc19e['update'](_0xef1a79)[_0x74be('0x23')](function(_0x305793){return _0x305793;});}return null;};}function removeEntity(_0x580bcc,_0x363df7){return function(_0xe3e361){if(_0xe3e361){return _0xe3e361[_0x74be('0x24')]()['then'](function(){var _0x377d3a=_0xe3e361[_0x74be('0x25')]({'plain':!![]});var _0x7efb58='WhatsappQueues';return db[_0x74be('0x26')][_0x74be('0x24')]({'where':{'type':_0x7efb58,'resourceId':_0x377d3a['id']}})[_0x74be('0x23')](function(){return _0xe3e361;});})['then'](function(){_0x580bcc[_0x74be('0x1b')](0xcc)[_0x74be('0x1c')]();});}};}function handleEntityNotFound(_0x2236f9,_0x49dca1){return function(_0x5c6c68){if(!_0x5c6c68){_0x2236f9['sendStatus'](0x194);}return _0x5c6c68;};}function handleError(_0xaaba60,_0x23d7bd){_0x23d7bd=_0x23d7bd||0x1f4;return function(_0x1539f5){logger['error'](_0x1539f5[_0x74be('0x27')]);if(_0x1539f5[_0x74be('0x28')]){delete _0x1539f5[_0x74be('0x28')];}_0xaaba60[_0x74be('0x1b')](_0x23d7bd)['send'](_0x1539f5);};}exports[_0x74be('0x29')]=function(_0x5f2498,_0x24765f){var _0x2374b8={},_0x412287={},_0x2fc5c3={'count':0x0,'rows':[]};var _0x49fcf3=_[_0x74be('0x2a')](db[_0x74be('0x2b')][_0x74be('0x2c')],function(_0x3b70ff){return{'name':_0x3b70ff['fieldName'],'type':_0x3b70ff['type'][_0x74be('0x2d')]};});_0x412287[_0x74be('0x2e')]=_[_0x74be('0x2a')](_0x49fcf3,'name');_0x412287[_0x74be('0x2f')]=_[_0x74be('0x30')](_0x5f2498[_0x74be('0x2f')]);_0x412287[_0x74be('0x31')]=_[_0x74be('0x32')](_0x412287[_0x74be('0x2e')],_0x412287[_0x74be('0x2f')]);_0x2374b8[_0x74be('0x33')]=_['intersection'](_0x412287[_0x74be('0x2e')],qs[_0x74be('0x34')](_0x5f2498[_0x74be('0x2f')][_0x74be('0x34')]));_0x2374b8[_0x74be('0x33')]=_0x2374b8[_0x74be('0x33')]['length']?_0x2374b8[_0x74be('0x33')]:_0x412287[_0x74be('0x2e')];if(!_0x5f2498[_0x74be('0x2f')][_0x74be('0x35')]('nolimit')){_0x2374b8[_0x74be('0x36')]=qs[_0x74be('0x36')](_0x5f2498[_0x74be('0x2f')][_0x74be('0x36')]);_0x2374b8[_0x74be('0x1f')]=qs[_0x74be('0x1f')](_0x5f2498[_0x74be('0x2f')][_0x74be('0x1f')]);}_0x2374b8[_0x74be('0x37')]=qs[_0x74be('0x38')](_0x5f2498[_0x74be('0x2f')]['sort']);_0x2374b8[_0x74be('0x39')]=qs[_0x74be('0x31')](_[_0x74be('0x3a')](_0x5f2498[_0x74be('0x2f')],_0x412287[_0x74be('0x31')]),_0x49fcf3);if(_0x5f2498['query'][_0x74be('0x3b')]){_0x2374b8[_0x74be('0x39')]=_[_0x74be('0x3c')](_0x2374b8[_0x74be('0x39')],{'$or':_[_0x74be('0x2a')](_0x49fcf3,function(_0x277bc1){if(_0x277bc1['type']!==_0x74be('0x3d')){var _0x500883={};_0x500883[_0x277bc1[_0x74be('0x28')]]={'$like':'%'+_0x5f2498[_0x74be('0x2f')][_0x74be('0x3b')]+'%'};return _0x500883;}})});}_0x2374b8=_[_0x74be('0x3c')]({},_0x2374b8,_0x5f2498['options']);var _0x32fadc={'where':_0x2374b8[_0x74be('0x39')]};return db['WhatsappQueue'][_0x74be('0x1e')](_0x32fadc)[_0x74be('0x23')](function(_0x3f8f60){_0x2fc5c3['count']=_0x3f8f60;if(_0x5f2498['query']['includeAll']){_0x2374b8['include']=[{'all':!![]}];}return db[_0x74be('0x2b')]['findAll'](_0x2374b8);})[_0x74be('0x23')](function(_0x196f5b){_0x2fc5c3['rows']=_0x196f5b;return _0x2fc5c3;})[_0x74be('0x23')](respondWithFilteredResult(_0x24765f,_0x2374b8))['catch'](handleError(_0x24765f,null));};exports[_0x74be('0x3e')]=function(_0x217b56,_0x4b9234){var _0x2cbbe3={'raw':!![],'where':{'id':_0x217b56[_0x74be('0x3f')]['id']}},_0x5a953b={};_0x5a953b[_0x74be('0x2e')]=_[_0x74be('0x30')](db[_0x74be('0x2b')][_0x74be('0x2c')]);_0x5a953b[_0x74be('0x2f')]=_[_0x74be('0x30')](_0x217b56[_0x74be('0x2f')]);_0x5a953b['filters']=_[_0x74be('0x32')](_0x5a953b['model'],_0x5a953b['query']);_0x2cbbe3[_0x74be('0x33')]=_[_0x74be('0x32')](_0x5a953b['model'],qs[_0x74be('0x34')](_0x217b56['query']['fields']));_0x2cbbe3[_0x74be('0x33')]=_0x2cbbe3['attributes'][_0x74be('0x40')]?_0x2cbbe3[_0x74be('0x33')]:_0x5a953b[_0x74be('0x2e')];if(_0x217b56[_0x74be('0x2f')][_0x74be('0x41')]){_0x2cbbe3[_0x74be('0x42')]=[{'all':!![]}];}_0x2cbbe3=_['merge']({},_0x2cbbe3,_0x217b56[_0x74be('0x43')]);return db[_0x74be('0x2b')][_0x74be('0x44')](_0x2cbbe3)['then'](handleEntityNotFound(_0x4b9234,null))[_0x74be('0x23')](respondWithResult(_0x4b9234,null))[_0x74be('0x45')](handleError(_0x4b9234,null));};exports[_0x74be('0x46')]=function(_0x222604,_0x3dac03){return db[_0x74be('0x2b')]['create'](_0x222604[_0x74be('0x47')],{})[_0x74be('0x23')](function(_0x5798a7){var _0x4c72d3=_0x222604[_0x74be('0x48')]['get']({'plain':!![]});if(!_0x4c72d3)throw new Error(_0x74be('0x49'));if(_0x4c72d3['role']==='user'){var _0x2f382a=_0x5798a7['get']({'plain':!![]});var _0x588040=_0x74be('0x4a');return db[_0x74be('0x4b')][_0x74be('0x44')]({'where':{'name':_0x588040,'userProfileId':_0x4c72d3[_0x74be('0x4c')]},'raw':!![]})[_0x74be('0x23')](function(_0x2403b8){if(_0x2403b8&&_0x2403b8[_0x74be('0x4d')]===0x0){return db[_0x74be('0x26')][_0x74be('0x46')]({'name':_0x2f382a[_0x74be('0x28')],'resourceId':_0x2f382a['id'],'type':_0x2403b8['name'],'sectionId':_0x2403b8['id']},{})[_0x74be('0x23')](function(){return _0x5798a7;});}else{return _0x5798a7;}})['catch'](function(_0x1c554b){logger[_0x74be('0x4e')](_0x74be('0x4f'),_0x1c554b);throw _0x1c554b;});}return _0x5798a7;})['then'](respondWithResult(_0x3dac03,0xc9))[_0x74be('0x45')](handleError(_0x3dac03,null));};exports['update']=function(_0x225aaa,_0x174551){if(_0x225aaa['body']['id']){delete _0x225aaa[_0x74be('0x47')]['id'];}return db[_0x74be('0x2b')]['find']({'where':{'id':_0x225aaa['params']['id']}})['then'](handleEntityNotFound(_0x174551,null))['then'](saveUpdates(_0x225aaa[_0x74be('0x47')],null))[_0x74be('0x23')](respondWithResult(_0x174551,null))[_0x74be('0x45')](handleError(_0x174551,null));};exports[_0x74be('0x24')]=function(_0x42e8b4,_0x47c0cd){return db[_0x74be('0x2b')][_0x74be('0x44')]({'where':{'id':_0x42e8b4['params']['id']}})[_0x74be('0x23')](handleEntityNotFound(_0x47c0cd,null))['then'](removeEntity(_0x47c0cd,null))[_0x74be('0x45')](handleError(_0x47c0cd,null));};exports['describe']=function(_0x3f8bc2,_0x5cf90e){return db['WhatsappQueue'][_0x74be('0x50')]()['then'](respondWithResult(_0x5cf90e,null))[_0x74be('0x45')](handleError(_0x5cf90e,null));};exports[_0x74be('0x51')]=function(_0x26e5a7,_0x3f718e,_0x2fb902){var _0x852fc6={'raw':!![],'where':{}},_0x1febe6={},_0x2ad461;return db['WhatsappQueue'][_0x74be('0x52')]({'where':{'id':_0x26e5a7['params']['id']}})['then'](handleEntityNotFound(_0x3f718e,null))[_0x74be('0x23')](function(_0x417a5a){if(_0x417a5a){_0x2ad461=_0x417a5a['get']({'plain':!![]});_0x1febe6[_0x74be('0x2e')]=_[_0x74be('0x30')](db['UserWhatsappQueue']['rawAttributes']);_0x1febe6[_0x74be('0x2f')]=_[_0x74be('0x30')](_0x26e5a7[_0x74be('0x2f')]);_0x1febe6[_0x74be('0x31')]=_[_0x74be('0x32')](_0x1febe6[_0x74be('0x2e')],_0x1febe6[_0x74be('0x2f')]);_0x852fc6[_0x74be('0x33')]=_[_0x74be('0x32')](_0x1febe6[_0x74be('0x2e')],qs[_0x74be('0x34')](_0x26e5a7[_0x74be('0x2f')][_0x74be('0x34')]));_0x852fc6[_0x74be('0x33')]=_0x852fc6['attributes']['length']?_0x852fc6[_0x74be('0x33')]:_0x1febe6[_0x74be('0x2e')];if(!_0x26e5a7[_0x74be('0x2f')][_0x74be('0x35')](_0x74be('0x53'))){_0x852fc6[_0x74be('0x36')]=qs[_0x74be('0x36')](_0x26e5a7['query'][_0x74be('0x36')]);_0x852fc6[_0x74be('0x1f')]=qs[_0x74be('0x1f')](_0x26e5a7[_0x74be('0x2f')][_0x74be('0x1f')]);}_0x852fc6[_0x74be('0x37')]=qs['sort'](_0x26e5a7[_0x74be('0x2f')][_0x74be('0x38')]);_0x852fc6[_0x74be('0x39')]=qs['filters'](_['pick'](_0x26e5a7[_0x74be('0x2f')],_0x1febe6[_0x74be('0x31')]));_0x852fc6[_0x74be('0x39')][_0x74be('0x54')]=_0x417a5a['id'];if(_0x26e5a7[_0x74be('0x2f')][_0x74be('0x3b')]){_0x852fc6[_0x74be('0x39')]=_[_0x74be('0x3c')](_0x852fc6[_0x74be('0x39')],{'$or':_[_0x74be('0x2a')](_0x852fc6[_0x74be('0x33')],function(_0x5bb326){var _0x4f870f={};_0x4f870f[_0x5bb326]={'$like':'%'+_0x26e5a7[_0x74be('0x2f')][_0x74be('0x3b')]+'%'};return _0x4f870f;})});}_0x852fc6=_[_0x74be('0x3c')]({},_0x852fc6,_0x26e5a7[_0x74be('0x43')]);return db[_0x74be('0x55')][_0x74be('0x56')](_0x852fc6);}})['then'](function(_0x11f788){if(_0x11f788){return db[_0x74be('0x57')]['findAndCountAll']({'where':{'id':_[_0x74be('0x2a')](_0x11f788,_0x74be('0x58')),'role':_0x74be('0x59')},'attributes':['id',_0x74be('0x28'),_0x74be('0x5a'),_0x74be('0x5b'),_0x74be('0x5c')]});}})[_0x74be('0x23')](function(_0x49f0f0){if(_0x49f0f0){return{'count':_0x49f0f0[_0x74be('0x1e')],'rows':_[_0x74be('0x2a')](_0x49f0f0[_0x74be('0x5d')],function(_0x1158e7){return{'membername':_0x1158e7[_0x74be('0x28')],'UserId':_0x1158e7['id'],'queue_name':_0x2ad461['name'],'WhatsappQueueId':_0x2ad461['id'],'interface':util[_0x74be('0x5e')](_0x74be('0x5f'),_0x74be('0x60'),_0x1158e7[_0x74be('0x28')]),'penalty':0x0,'paused':_0x1158e7[_0x74be('0x5a')],'createdAt':_0x1158e7['createdAt'],'updatedAt':_0x1158e7[_0x74be('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3f718e,_0x852fc6))['catch'](handleError(_0x3f718e,null));};exports[_0x74be('0x61')]=function(_0x3e5757,_0x16e556,_0x473acf){var _0x3b8eac={};var _0x365971={};var _0x444d0d;var _0x41ab4b;return db['WhatsappQueue'][_0x74be('0x52')]({'where':{'id':_0x3e5757[_0x74be('0x3f')]['id']}})[_0x74be('0x23')](handleEntityNotFound(_0x16e556,null))[_0x74be('0x23')](function(_0x3413dd){if(_0x3413dd){_0x444d0d=_0x3413dd;_0x365971[_0x74be('0x2e')]=_['keys'](db[_0x74be('0x62')][_0x74be('0x2c')]);_0x365971[_0x74be('0x2f')]=_['keys'](_0x3e5757['query']);_0x365971[_0x74be('0x31')]=_[_0x74be('0x32')](_0x365971[_0x74be('0x2e')],_0x365971[_0x74be('0x2f')]);_0x3b8eac[_0x74be('0x33')]=_[_0x74be('0x32')](_0x365971[_0x74be('0x2e')],qs[_0x74be('0x34')](_0x3e5757['query'][_0x74be('0x34')]));_0x3b8eac[_0x74be('0x33')]=_0x3b8eac[_0x74be('0x33')][_0x74be('0x40')]?_0x3b8eac[_0x74be('0x33')]:_0x365971['model'];_0x3b8eac[_0x74be('0x37')]=qs[_0x74be('0x38')](_0x3e5757[_0x74be('0x2f')][_0x74be('0x38')]);_0x3b8eac[_0x74be('0x39')]=qs['filters'](_[_0x74be('0x3a')](_0x3e5757[_0x74be('0x2f')],_0x365971['filters']));if(_0x3e5757[_0x74be('0x2f')][_0x74be('0x3b')]){_0x3b8eac[_0x74be('0x39')]=_[_0x74be('0x3c')](_0x3b8eac[_0x74be('0x39')],{'$or':_[_0x74be('0x2a')](_0x3b8eac['attributes'],function(_0x49f881){var _0x549e15={};_0x549e15[_0x49f881]={'$like':'%'+_0x3e5757[_0x74be('0x2f')]['filter']+'%'};return _0x549e15;})});}_0x3b8eac=_['merge']({},_0x3b8eac,_0x3e5757['options']);return _0x444d0d[_0x74be('0x61')](_0x3b8eac);}})[_0x74be('0x23')](function(_0xd6ee12){if(_0xd6ee12){_0x41ab4b=_0xd6ee12['length'];if(!_0x3e5757[_0x74be('0x2f')]['hasOwnProperty']('nolimit')){_0x3b8eac[_0x74be('0x36')]=qs[_0x74be('0x36')](_0x3e5757['query'][_0x74be('0x36')]);_0x3b8eac['offset']=qs[_0x74be('0x1f')](_0x3e5757[_0x74be('0x2f')][_0x74be('0x1f')]);}return _0x444d0d[_0x74be('0x61')](_0x3b8eac);}})[_0x74be('0x23')](function(_0x42fd97){if(_0x42fd97){return _0x42fd97?{'count':_0x41ab4b,'rows':_0x42fd97}:null;}})['then'](respondWithResult(_0x16e556,null))['catch'](handleError(_0x16e556,null));};exports[_0x74be('0x63')]=function(_0x544c2e,_0x209a61,_0x4a3a15){var _0x3e7576=_0x544c2e[_0x74be('0x47')][_0x74be('0x64')];return db['Team'][_0x74be('0x56')]({'where':{'id':_0x3e7576},'attributes':['id'],'include':[{'model':db[_0x74be('0x57')],'as':'Agents','attributes':['id',_0x74be('0x28'),_0x74be('0x65'),'voicePause',_0x74be('0x66')],'raw':!![]}]})[_0x74be('0x23')](function(_0x2571cb){if(_0x2571cb){var _0x18fdeb=_[_0x74be('0x67')](_0x2571cb,function(_0x5fb486){var _0x30d474=_0x5fb486[_0x74be('0x25')]({'plain':!![]});return _0x30d474[_0x74be('0x68')];});return db[_0x74be('0x2b')][_0x74be('0x44')]({'where':{'id':_0x544c2e[_0x74be('0x3f')]['id']}})['then'](function(_0xa7a7be){return db[_0x74be('0x69')][_0x74be('0x6a')](function(_0x913f41){return _0xa7a7be[_0x74be('0x63')](_0x3e7576,{'transaction':_0x913f41})[_0x74be('0x23')](function(){return BPromise[_0x74be('0x6b')](_0x18fdeb,function(_0x23255c){return db[_0x74be('0x55')][_0x74be('0x6c')]({'where':{'UserId':_0x23255c['id'],'WhatsappQueueId':_0x544c2e[_0x74be('0x3f')]['id']},'transaction':_0x913f41});});})[_0x74be('0x23')](function(){_0x18fdeb[_0x74be('0x6d')](function(_0x58383b){socket[_0x74be('0x6e')](_0x74be('0x6f'),{'UserId':_0x58383b['id'],'WhatsappQueueId':_0xa7a7be['id']});});});});});}})[_0x74be('0x23')](respondWithStatusCode(_0x209a61,null))[_0x74be('0x45')](handleError(_0x209a61,null));};exports[_0x74be('0x70')]=function(_0xd0a777,_0x3a28cf,_0x335922){return db['Team'][_0x74be('0x56')]({'where':{'id':_0xd0a777[_0x74be('0x2f')][_0x74be('0x64')]},'attributes':['id'],'include':[{'model':db[_0x74be('0x57')],'as':_0x74be('0x68'),'attributes':['id'],'raw':!![]}]})[_0x74be('0x23')](handleEntityNotFound(_0x3a28cf,null))['then'](function(_0x568656){var _0x304a9c=_[_0x74be('0x2a')](_0x568656,'id');var _0x3ac3a5=[];var _0x2231aa=[];var _0x53104e=squel[_0x74be('0x71')]();_0x53104e['field'](_0x74be('0x72'))[_0x74be('0x73')](_0x74be('0x74'),'tq')[_0x74be('0x75')](_0x74be('0x76'),'ut',_0x74be('0x77'))[_0x74be('0x39')]('WhatsappQueueId\x20=\x20?',_0xd0a777[_0x74be('0x3f')]['id']);for(var _0x5a7391=0x0;_0x5a7391<_0x568656['length'];_0x5a7391+=0x1){let _0x1515c5=_0x568656[_0x5a7391];for(var _0x1dbd84=0x0;_0x1dbd84<_0x1515c5['Agents'][_0x74be('0x40')];_0x1dbd84+=0x1){let _0x55208c=_0x1515c5['Agents'][_0x1dbd84];var _0x33d6d9=_0x53104e[_0x74be('0x78')]();_0x33d6d9[_0x74be('0x39')](_0x74be('0x79'),_0x55208c['id']);_0x2231aa[_0x74be('0x7a')](db[_0x74be('0x69')][_0x74be('0x2f')](_0x33d6d9['toString'](),{'type':db[_0x74be('0x69')][_0x74be('0x7b')][_0x74be('0x7c')]})[_0x74be('0x23')](function(_0x245aaf){if(_0x245aaf[_0x74be('0x40')]===0x1){return _0x55208c['id'];}else{var _0x36bc3f=_[_0x74be('0x7d')](_[_0x74be('0x2a')](_0x245aaf,_0x74be('0x7e')),function(_0x5dfbf9){return _[_0x74be('0x7f')](_0x304a9c,_0x5dfbf9);});if(_0x36bc3f){return _0x55208c['id'];}}}));}}return BPromise[_0x74be('0x80')](_0x2231aa)['then'](function(_0x3448de){_0x3ac3a5=_(_0x3ac3a5)['union'](_0x3448de)[_0x74be('0x81')]()[_0x74be('0x82')]();return db['WhatsappQueue'][_0x74be('0x44')]({'where':{'id':_0xd0a777[_0x74be('0x3f')]['id']}})[_0x74be('0x23')](function(_0x20008a){return db[_0x74be('0x69')]['transaction'](function(_0x299929){return _0x20008a[_0x74be('0x70')](_0xd0a777[_0x74be('0x2f')][_0x74be('0x64')],{'transaction':_0x299929})[_0x74be('0x23')](function(){if(!_[_0x74be('0x83')](_0x3ac3a5)){return _0x20008a[_0x74be('0x84')](_0x3ac3a5,{'transaction':_0x299929});}})[_0x74be('0x23')](function(){_0x3ac3a5[_0x74be('0x6d')](function(_0x10dc1e){socket[_0x74be('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x10dc1e,'WhatsappQueueId':_0x20008a['id']});});});});});});})[_0x74be('0x23')](respondWithStatusCode(_0x3a28cf,null))[_0x74be('0x45')](handleError(_0x3a28cf,null));};exports[_0x74be('0x85')]=function(_0xdfbc6a,_0x149fc4,_0x26cbe5){return db[_0x74be('0x2b')][_0x74be('0x44')]({'where':{'id':_0xdfbc6a[_0x74be('0x3f')]['id']}})[_0x74be('0x23')](handleEntityNotFound(_0x149fc4,null))[_0x74be('0x23')](function(_0x2180ca){if(_0x2180ca){return _0x2180ca[_0x74be('0x85')](_0xdfbc6a['body'][_0x74be('0x64')],_[_0x74be('0x86')](_0xdfbc6a[_0x74be('0x47')],[_0x74be('0x64'),'id'])||{})[_0x74be('0x87')](function(_0x17eaeb){for(var _0x3926c4=0x0;_0x3926c4<_0xdfbc6a[_0x74be('0x47')][_0x74be('0x64')]['length'];_0x3926c4+=0x1){socket[_0x74be('0x6e')](_0x74be('0x6f'),{'UserId':_0xdfbc6a[_0x74be('0x47')][_0x74be('0x64')][_0x3926c4],'WhatsappQueueId':_0xdfbc6a[_0x74be('0x3f')]['id']});}return _0x17eaeb;});}})[_0x74be('0x23')](respondWithResult(_0x149fc4,null))[_0x74be('0x45')](handleError(_0x149fc4,null));};exports[_0x74be('0x84')]=function(_0x3c8368,_0x1f8c6a,_0x12a231){return db['WhatsappQueue']['find']({'where':{'id':_0x3c8368[_0x74be('0x3f')]['id']}})[_0x74be('0x23')](handleEntityNotFound(_0x1f8c6a,null))[_0x74be('0x23')](function(_0x306691){if(_0x306691){return _0x306691[_0x74be('0x84')](_0x3c8368['query'][_0x74be('0x64')])[_0x74be('0x23')](function(){if(_[_0x74be('0x88')](_0x3c8368[_0x74be('0x2f')][_0x74be('0x64')])){for(var _0x4e3f18=0x0;_0x4e3f18<_0x3c8368[_0x74be('0x2f')]['ids']['length'];_0x4e3f18+=0x1){socket[_0x74be('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3c8368[_0x74be('0x2f')]['ids'][_0x4e3f18]),'WhatsappQueueId':Number(_0x3c8368['params']['id'])});}}else{socket[_0x74be('0x6e')](_0x74be('0x89'),{'UserId':Number(_0x3c8368[_0x74be('0x2f')][_0x74be('0x64')]),'WhatsappQueueId':Number(_0x3c8368['params']['id'])});}});}})[_0x74be('0x23')](respondWithStatusCode(_0x1f8c6a,null))[_0x74be('0x45')](handleError(_0x1f8c6a,null));};exports[_0x74be('0x8a')]=function(_0x1cf532,_0x5136ed,_0x50d447){var _0x232612={};var _0x10fe5a={};var _0x21596d;var _0x2c78b2;return db[_0x74be('0x2b')][_0x74be('0x52')]({'where':{'id':_0x1cf532['params']['id']}})[_0x74be('0x23')](handleEntityNotFound(_0x5136ed,null))[_0x74be('0x23')](function(_0x28b743){if(_0x28b743){_0x21596d=_0x28b743;_0x10fe5a[_0x74be('0x2e')]=_[_0x74be('0x30')](db[_0x74be('0x57')]['rawAttributes']);_0x10fe5a[_0x74be('0x2f')]=_[_0x74be('0x30')](_0x1cf532['query']);_0x10fe5a[_0x74be('0x31')]=_[_0x74be('0x32')](_0x10fe5a['model'],_0x10fe5a[_0x74be('0x2f')]);_0x232612[_0x74be('0x33')]=_[_0x74be('0x32')](_0x10fe5a[_0x74be('0x2e')],qs['fields'](_0x1cf532[_0x74be('0x2f')][_0x74be('0x34')]));_0x232612[_0x74be('0x33')]=_0x232612[_0x74be('0x33')][_0x74be('0x40')]?_0x232612[_0x74be('0x33')]:_0x10fe5a[_0x74be('0x2e')];_0x232612['order']=qs[_0x74be('0x38')](_0x1cf532[_0x74be('0x2f')][_0x74be('0x38')]);_0x232612[_0x74be('0x39')]=qs[_0x74be('0x31')](_['pick'](_0x1cf532[_0x74be('0x2f')],_0x10fe5a[_0x74be('0x31')]));if(_0x1cf532[_0x74be('0x2f')][_0x74be('0x3b')]){_0x232612['where']=_[_0x74be('0x3c')](_0x232612[_0x74be('0x39')],{'$or':_['map'](_0x232612[_0x74be('0x33')],function(_0x4a149d){var _0x5c5005={};_0x5c5005[_0x4a149d]={'$like':'%'+_0x1cf532[_0x74be('0x2f')]['filter']+'%'};return _0x5c5005;})});}_0x232612=_[_0x74be('0x3c')]({},_0x232612,_0x1cf532[_0x74be('0x43')]);return _0x21596d[_0x74be('0x8a')](_0x232612);}})['then'](function(_0x5ee893){if(_0x5ee893){_0x2c78b2=_0x5ee893['length'];if(!_0x1cf532[_0x74be('0x2f')][_0x74be('0x35')]('nolimit')){_0x232612[_0x74be('0x36')]=qs[_0x74be('0x36')](_0x1cf532['query']['limit']);_0x232612['offset']=qs[_0x74be('0x1f')](_0x1cf532[_0x74be('0x2f')]['offset']);}return _0x21596d[_0x74be('0x8a')](_0x232612);}})[_0x74be('0x23')](function(_0x174dd0){if(_0x174dd0){return _0x174dd0?{'count':_0x2c78b2,'rows':_0x174dd0}:null;}})['then'](respondWithResult(_0x5136ed,null))['catch'](handleError(_0x5136ed,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a180764..e073793 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf151=['save','update','remove','emit','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf151,0x1b5));var _0x1f15=function(_0x21e696,_0x2340f8){_0x21e696=_0x21e696-0x0;var _0x609e55=_0xf151[_0x21e696];return _0x609e55;};'use strict';var EventEmitter=require(_0x1f15('0x0'));var WhatsappQueue=require(_0x1f15('0x1'))['db'][_0x1f15('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1f15('0x3')](0x0);var events={'afterCreate':_0x1f15('0x4'),'afterUpdate':_0x1f15('0x5'),'afterDestroy':_0x1f15('0x6')};function emitEvent(_0x1911ce){return function(_0x1f3a50,_0x180732,_0x196cbc){WhatsappQueueEvents[_0x1f15('0x7')](_0x1911ce+':'+_0x1f3a50['id'],_0x1f3a50);WhatsappQueueEvents[_0x1f15('0x7')](_0x1911ce,_0x1f3a50);_0x196cbc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x1f15('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x8348=['emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove'];(function(_0x28bfb9,_0x5b2938){var _0x3f8956=function(_0x798179){while(--_0x798179){_0x28bfb9['push'](_0x28bfb9['shift']());}};_0x3f8956(++_0x5b2938);}(_0x8348,0x159));var _0x8834=function(_0x3cd9b7,_0x38145b){_0x3cd9b7=_0x3cd9b7-0x0;var _0x590a52=_0x8348[_0x3cd9b7];return _0x590a52;};'use strict';var EventEmitter=require(_0x8834('0x0'));var WhatsappQueue=require(_0x8834('0x1'))['db'][_0x8834('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8834('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8834('0x4'),'afterDestroy':_0x8834('0x5')};function emitEvent(_0x1155fa){return function(_0x2a9ea2,_0x3d4f08,_0x55125a){WhatsappQueueEvents['emit'](_0x1155fa+':'+_0x2a9ea2['id'],_0x2a9ea2);WhatsappQueueEvents[_0x8834('0x6')](_0x1155fa,_0x2a9ea2);_0x55125a(null);};}for(var e in events){if(events[_0x8834('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x8834('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b6b4cb3..70b831d 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1deb=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','whatsapp_queues'];(function(_0x96b6a,_0x12471d){var _0x3e16f3=function(_0xa1fc4b){while(--_0xa1fc4b){_0x96b6a['push'](_0x96b6a['shift']());}};_0x3e16f3(++_0x12471d);}(_0x1deb,0x160));var _0xb1de=function(_0x2f9115,_0x2c9097){_0x2f9115=_0x2f9115-0x0;var _0x18eb73=_0x1deb[_0x2f9115];return _0x18eb73;};'use strict';var _=require('lodash');var util=require(_0xb1de('0x0'));var logger=require(_0xb1de('0x1'))(_0xb1de('0x2'));var moment=require(_0xb1de('0x3'));var BPromise=require(_0xb1de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1de('0x5'));var rimraf=require(_0xb1de('0x6'));var config=require(_0xb1de('0x7'));var attributes=require(_0xb1de('0x8'));module['exports']=function(_0x87748d,_0x484ce5){return _0x87748d[_0xb1de('0x9')]('WhatsappQueue',attributes,{'tableName':_0xb1de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b98=['../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','api','moment','bluebird','path','rimraf'];(function(_0x2ac336,_0x497d9b){var _0x12ed2c=function(_0x32d148){while(--_0x32d148){_0x2ac336['push'](_0x2ac336['shift']());}};_0x12ed2c(++_0x497d9b);}(_0x2b98,0x11a));var _0x82b9=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x2b98[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x82b9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x82b9('0x1'));var moment=require(_0x82b9('0x2'));var BPromise=require(_0x82b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82b9('0x4'));var rimraf=require(_0x82b9('0x5'));var config=require(_0x82b9('0x6'));var attributes=require(_0x82b9('0x7'));module[_0x82b9('0x8')]=function(_0x5ae9c3,_0x1289cf){return _0x5ae9c3[_0x82b9('0x9')](_0x82b9('0xa'),attributes,{'tableName':_0x82b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 2e40647..e260241 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a39=['error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','map','model','include','stringify','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x3a39,0x179));var _0x93a3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3a39[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x93a3('0x0'));var moment=require(_0x93a3('0x1'));var BPromise=require(_0x93a3('0x2'));var rs=require(_0x93a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93a3('0x4'))['db'];var utils=require(_0x93a3('0x5'));var logger=require(_0x93a3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93a3('0x7'));var client=jayson[_0x93a3('0x8')][_0x93a3('0x9')]({'port':0x232a});config[_0x93a3('0xa')]=_[_0x93a3('0xb')](config[_0x93a3('0xa')],{'host':_0x93a3('0xc'),'port':0x18eb});var socket=require(_0x93a3('0xd'))(new Redis(config[_0x93a3('0xa')]));require(_0x93a3('0xe'))[_0x93a3('0xf')](socket);function respondWithRpcPromise(_0x4e3428,_0x230fe2,_0x2bb7e7){return new BPromise(function(_0x2c9fd3,_0x173d6a){return client[_0x93a3('0x10')](_0x4e3428,_0x2bb7e7)[_0x93a3('0x11')](function(_0x2c9c72){logger[_0x93a3('0x12')](_0x93a3('0x13'),_0x230fe2,_0x93a3('0x14'));logger[_0x93a3('0x15')](_0x93a3('0x16'),_0x230fe2,'request\x20sent',JSON['stringify'](_0x2c9c72));if(_0x2c9c72['error']){if(_0x2c9c72[_0x93a3('0x17')][_0x93a3('0x18')]===0x1f4){logger[_0x93a3('0x17')](_0x93a3('0x13'),_0x230fe2,_0x2c9c72[_0x93a3('0x17')][_0x93a3('0x19')]);return _0x173d6a(_0x2c9c72['error'][_0x93a3('0x19')]);}logger['error'](_0x93a3('0x13'),_0x230fe2,_0x2c9c72[_0x93a3('0x17')][_0x93a3('0x19')]);return _0x2c9fd3(_0x2c9c72[_0x93a3('0x17')][_0x93a3('0x19')]);}else{logger[_0x93a3('0x12')](_0x93a3('0x13'),_0x230fe2,_0x93a3('0x14'));_0x2c9fd3(_0x2c9c72['result'][_0x93a3('0x19')]);}})[_0x93a3('0x1a')](function(_0x323234){logger[_0x93a3('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x230fe2,_0x323234);_0x173d6a(_0x323234);});});}exports[_0x93a3('0x1b')]=function(_0x22378a){var _0x41c93c=this;return new Promise(function(_0x587ca3,_0x29947d){return db[_0x93a3('0x1c')]['findAll']({'raw':_0x22378a[_0x93a3('0x1d')]?_0x22378a[_0x93a3('0x1d')][_0x93a3('0x1e')]===undefined?!![]:![]:!![],'where':_0x22378a['options']?_0x22378a[_0x93a3('0x1d')][_0x93a3('0x1f')]||null:null,'attributes':_0x22378a[_0x93a3('0x1d')]?_0x22378a[_0x93a3('0x1d')][_0x93a3('0x20')]||null:null,'limit':_0x22378a[_0x93a3('0x1d')]?_0x22378a[_0x93a3('0x1d')][_0x93a3('0x21')]||null:null,'include':_0x22378a[_0x93a3('0x1d')]?_0x22378a['options']['include']?_[_0x93a3('0x22')](_0x22378a[_0x93a3('0x1d')]['include'],function(_0x20016d){return{'model':db[_0x20016d[_0x93a3('0x23')]],'as':_0x20016d['as'],'attributes':_0x20016d[_0x93a3('0x20')],'include':_0x20016d[_0x93a3('0x24')]?_[_0x93a3('0x22')](_0x20016d[_0x93a3('0x24')],function(_0x34e05c){return{'model':db[_0x34e05c[_0x93a3('0x23')]],'as':_0x34e05c['as'],'attributes':_0x34e05c['attributes'],'include':_0x34e05c['include']?_[_0x93a3('0x22')](_0x34e05c['include'],function(_0x426a55){return{'model':db[_0x426a55[_0x93a3('0x23')]],'as':_0x426a55['as'],'attributes':_0x426a55[_0x93a3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b2be9){logger['info'](_0x93a3('0x1b'),_0x22378a);logger[_0x93a3('0x15')](_0x93a3('0x1b'),_0x22378a,JSON[_0x93a3('0x25')](_0x5b2be9));_0x587ca3(_0x5b2be9);})[_0x93a3('0x1a')](function(_0x3e1640){logger['error'](_0x93a3('0x1b'),_0x3e1640['message'],_0x22378a);_0x29947d(_0x41c93c[_0x93a3('0x17')](0x1f4,_0x3e1640['message']));});});};exports[_0x93a3('0x26')]=function(_0x4fa659){var _0x2567fd=this;return new Promise(function(_0x331e94,_0x1c714d){return db[_0x93a3('0x1c')][_0x93a3('0x27')]({'raw':_0x4fa659['options']?_0x4fa659['options'][_0x93a3('0x1e')]===undefined?!![]:![]:!![],'where':_0x4fa659[_0x93a3('0x1d')]?_0x4fa659[_0x93a3('0x1d')]['where']||null:null,'attributes':_0x4fa659[_0x93a3('0x1d')]?_0x4fa659[_0x93a3('0x1d')][_0x93a3('0x20')]||null:null,'include':_0x4fa659['options']?_0x4fa659['options'][_0x93a3('0x24')]?_['map'](_0x4fa659[_0x93a3('0x1d')]['include'],function(_0x58b135){return{'model':db[_0x58b135['model']],'as':_0x58b135['as'],'attributes':_0x58b135[_0x93a3('0x20')],'include':_0x58b135['include']?_['map'](_0x58b135[_0x93a3('0x24')],function(_0x472bd5){return{'model':db[_0x472bd5[_0x93a3('0x23')]],'as':_0x472bd5['as'],'attributes':_0x472bd5[_0x93a3('0x20')],'include':_0x472bd5['include']?_['map'](_0x472bd5[_0x93a3('0x24')],function(_0x4b041f){return{'model':db[_0x4b041f['model']],'as':_0x4b041f['as'],'attributes':_0x4b041f[_0x93a3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aba92){logger[_0x93a3('0x12')](_0x93a3('0x26'),_0x4fa659);logger[_0x93a3('0x15')]('ShowWhatsappQueue',_0x4fa659,JSON[_0x93a3('0x25')](_0x5aba92));_0x331e94(_0x5aba92);})[_0x93a3('0x1a')](function(_0x407564){logger[_0x93a3('0x17')]('ShowWhatsappQueue',_0x407564[_0x93a3('0x19')],_0x4fa659);_0x1c714d(_0x2567fd['error'](0x1f4,_0x407564[_0x93a3('0x19')]));});});}; \ No newline at end of file +var _0x1db2=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue'];(function(_0x3866a0,_0x501e9a){var _0x4de61c=function(_0x581267){while(--_0x581267){_0x3866a0['push'](_0x3866a0['shift']());}};_0x4de61c(++_0x501e9a);}(_0x1db2,0x1a5));var _0x21db=function(_0x5bd30f,_0x2247cc){_0x5bd30f=_0x5bd30f-0x0;var _0x20332f=_0x1db2[_0x5bd30f];return _0x20332f;};'use strict';var _=require(_0x21db('0x0'));var util=require(_0x21db('0x1'));var moment=require(_0x21db('0x2'));var BPromise=require(_0x21db('0x3'));var rs=require(_0x21db('0x4'));var fs=require('fs');var Redis=require(_0x21db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21db('0x6'));var logger=require('../../config/logger')(_0x21db('0x7'));var config=require(_0x21db('0x8'));var jayson=require(_0x21db('0x9'));var client=jayson[_0x21db('0xa')][_0x21db('0xb')]({'port':0x232a});config[_0x21db('0xc')]=_[_0x21db('0xd')](config[_0x21db('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x21db('0xe'))(new Redis(config['redis']));require(_0x21db('0xf'))[_0x21db('0x10')](socket);function respondWithRpcPromise(_0x147754,_0x14f82c,_0x5ccdb8){return new BPromise(function(_0x1863ea,_0x5664b0){return client[_0x21db('0x11')](_0x147754,_0x5ccdb8)[_0x21db('0x12')](function(_0x5b800e){logger[_0x21db('0x13')](_0x21db('0x14'),_0x14f82c,_0x21db('0x15'));logger[_0x21db('0x16')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x14f82c,'request\x20sent',JSON[_0x21db('0x17')](_0x5b800e));if(_0x5b800e[_0x21db('0x18')]){if(_0x5b800e[_0x21db('0x18')][_0x21db('0x19')]===0x1f4){logger[_0x21db('0x18')](_0x21db('0x14'),_0x14f82c,_0x5b800e[_0x21db('0x18')][_0x21db('0x1a')]);return _0x5664b0(_0x5b800e['error']['message']);}logger[_0x21db('0x18')](_0x21db('0x14'),_0x14f82c,_0x5b800e[_0x21db('0x18')][_0x21db('0x1a')]);return _0x1863ea(_0x5b800e[_0x21db('0x18')][_0x21db('0x1a')]);}else{logger['info'](_0x21db('0x14'),_0x14f82c,'request\x20sent');_0x1863ea(_0x5b800e[_0x21db('0x1b')][_0x21db('0x1a')]);}})[_0x21db('0x1c')](function(_0x4bc2cb){logger[_0x21db('0x18')](_0x21db('0x14'),_0x14f82c,_0x4bc2cb);_0x5664b0(_0x4bc2cb);});});}exports['GetWhatsappQueue']=function(_0x2daecc){var _0x56de00=this;return new Promise(function(_0x971246,_0x223c69){return db['WhatsappQueue'][_0x21db('0x1d')]({'raw':_0x2daecc[_0x21db('0x1e')]?_0x2daecc[_0x21db('0x1e')][_0x21db('0x1f')]===undefined?!![]:![]:!![],'where':_0x2daecc[_0x21db('0x1e')]?_0x2daecc['options'][_0x21db('0x20')]||null:null,'attributes':_0x2daecc[_0x21db('0x1e')]?_0x2daecc[_0x21db('0x1e')][_0x21db('0x21')]||null:null,'limit':_0x2daecc[_0x21db('0x1e')]?_0x2daecc[_0x21db('0x1e')][_0x21db('0x22')]||null:null,'include':_0x2daecc[_0x21db('0x1e')]?_0x2daecc[_0x21db('0x1e')]['include']?_[_0x21db('0x23')](_0x2daecc['options'][_0x21db('0x24')],function(_0x48badc){return{'model':db[_0x48badc[_0x21db('0x25')]],'as':_0x48badc['as'],'attributes':_0x48badc[_0x21db('0x21')],'include':_0x48badc[_0x21db('0x24')]?_[_0x21db('0x23')](_0x48badc[_0x21db('0x24')],function(_0x7f7d39){return{'model':db[_0x7f7d39[_0x21db('0x25')]],'as':_0x7f7d39['as'],'attributes':_0x7f7d39[_0x21db('0x21')],'include':_0x7f7d39[_0x21db('0x24')]?_[_0x21db('0x23')](_0x7f7d39[_0x21db('0x24')],function(_0x507f47){return{'model':db[_0x507f47['model']],'as':_0x507f47['as'],'attributes':_0x507f47[_0x21db('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x151a60){logger['info'](_0x21db('0x26'),_0x2daecc);logger[_0x21db('0x16')](_0x21db('0x26'),_0x2daecc,JSON[_0x21db('0x17')](_0x151a60));_0x971246(_0x151a60);})[_0x21db('0x1c')](function(_0x2ff9ce){logger[_0x21db('0x18')](_0x21db('0x26'),_0x2ff9ce[_0x21db('0x1a')],_0x2daecc);_0x223c69(_0x56de00[_0x21db('0x18')](0x1f4,_0x2ff9ce['message']));});});};exports[_0x21db('0x27')]=function(_0x40b788){var _0x4f6cd3=this;return new Promise(function(_0x1edfdd,_0x4569d5){return db[_0x21db('0x28')][_0x21db('0x29')]({'raw':_0x40b788[_0x21db('0x1e')]?_0x40b788['options']['raw']===undefined?!![]:![]:!![],'where':_0x40b788[_0x21db('0x1e')]?_0x40b788[_0x21db('0x1e')][_0x21db('0x20')]||null:null,'attributes':_0x40b788['options']?_0x40b788['options'][_0x21db('0x21')]||null:null,'include':_0x40b788[_0x21db('0x1e')]?_0x40b788[_0x21db('0x1e')]['include']?_[_0x21db('0x23')](_0x40b788[_0x21db('0x1e')][_0x21db('0x24')],function(_0x200911){return{'model':db[_0x200911['model']],'as':_0x200911['as'],'attributes':_0x200911[_0x21db('0x21')],'include':_0x200911[_0x21db('0x24')]?_[_0x21db('0x23')](_0x200911['include'],function(_0x364193){return{'model':db[_0x364193[_0x21db('0x25')]],'as':_0x364193['as'],'attributes':_0x364193['attributes'],'include':_0x364193[_0x21db('0x24')]?_[_0x21db('0x23')](_0x364193['include'],function(_0x900d63){return{'model':db[_0x900d63[_0x21db('0x25')]],'as':_0x900d63['as'],'attributes':_0x900d63[_0x21db('0x21')]};}):[]};}):[]};}):[]:[]})[_0x21db('0x12')](function(_0x2ce06c){logger['info'](_0x21db('0x27'),_0x40b788);logger[_0x21db('0x16')](_0x21db('0x27'),_0x40b788,JSON['stringify'](_0x2ce06c));_0x1edfdd(_0x2ce06c);})['catch'](function(_0x3d2963){logger[_0x21db('0x18')](_0x21db('0x27'),_0x3d2963[_0x21db('0x1a')],_0x40b788);_0x4569d5(_0x4f6cd3[_0x21db('0x18')](0x1f4,_0x3d2963[_0x21db('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 5bc7566..bfd1773 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb776=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x5a56c6,_0x2bb453){var _0x3a9491=function(_0x37e861){while(--_0x37e861){_0x5a56c6['push'](_0x5a56c6['shift']());}};_0x3a9491(++_0x2bb453);}(_0xb776,0x1cc));var _0x6b77=function(_0x5b6a4e,_0x31b107){_0x5b6a4e=_0x5b6a4e-0x0;var _0x31a041=_0xb776[_0x5b6a4e];return _0x31a041;};'use strict';var WhatsappQueueEvents=require(_0x6b77('0x0'));var events=[_0x6b77('0x1'),_0x6b77('0x2'),'update'];function createListener(_0x261829,_0x389ccf){return function(_0x25ad61){_0x389ccf[_0x6b77('0x3')](_0x261829,_0x25ad61);};}function removeListener(_0x3663c7,_0xb8ebde){return function(){WhatsappQueueEvents[_0x6b77('0x4')](_0x3663c7,_0xb8ebde);};}exports[_0x6b77('0x5')]=function(_0x586afd){for(var _0x573554=0x0,_0x18baf5=events[_0x6b77('0x6')];_0x573554<_0x18baf5;_0x573554++){var _0x462c6b=events[_0x573554];var _0x646210=createListener(_0x6b77('0x7')+_0x462c6b,_0x586afd);WhatsappQueueEvents['on'](_0x462c6b,_0x646210);}}; \ No newline at end of file +var _0x92bb=['save','remove','emit','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x250166,_0x548ffd){var _0x18968c=function(_0x3a78ae){while(--_0x3a78ae){_0x250166['push'](_0x250166['shift']());}};_0x18968c(++_0x548ffd);}(_0x92bb,0x1cd));var _0xb92b=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x92bb[_0x46a3ff];return _0x404bc2;};'use strict';var WhatsappQueueEvents=require(_0xb92b('0x0'));var events=[_0xb92b('0x1'),_0xb92b('0x2'),'update'];function createListener(_0x5a69cb,_0x58b9a8){return function(_0x4e990c){_0x58b9a8[_0xb92b('0x3')](_0x5a69cb,_0x4e990c);};}function removeListener(_0x33e0d1,_0x4caee0){return function(){WhatsappQueueEvents['removeListener'](_0x33e0d1,_0x4caee0);};}exports[_0xb92b('0x4')]=function(_0x385a40){for(var _0x18731a=0x0,_0x51dcea=events[_0xb92b('0x5')];_0x18731a<_0x51dcea;_0x18731a++){var _0x594fbe=events[_0x18731a];var _0x51bcc1=createListener(_0xb92b('0x6')+_0x594fbe,_0x385a40);WhatsappQueueEvents['on'](_0x594fbe,_0x51bcc1);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index abf4bca..4c2e6d4 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ebd=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x43e53c,_0x113013){var _0x281074=function(_0x510fe8){while(--_0x510fe8){_0x43e53c['push'](_0x43e53c['shift']());}};_0x281074(++_0x113013);}(_0x8ebd,0x16d));var _0xd8eb=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x8ebd[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xd8eb('0x0'));var util=require(_0xd8eb('0x1'));var path=require(_0xd8eb('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8eb('0x3'));var router=express['Router']();var auth=require(_0xd8eb('0x4'));var interaction=require(_0xd8eb('0x5'));var config=require(_0xd8eb('0x6'));var controller=require(_0xd8eb('0x7'));router[_0xd8eb('0x8')]('/',auth[_0xd8eb('0x9')](),controller[_0xd8eb('0xa')]);router[_0xd8eb('0x8')](_0xd8eb('0xb'),auth[_0xd8eb('0x9')](),controller[_0xd8eb('0xc')]);router[_0xd8eb('0x8')](_0xd8eb('0xd'),auth[_0xd8eb('0x9')](),controller[_0xd8eb('0xe')]);router[_0xd8eb('0xf')]('/',auth[_0xd8eb('0x9')](),controller[_0xd8eb('0x10')]);router[_0xd8eb('0x11')](_0xd8eb('0xd'),auth[_0xd8eb('0x9')](),controller[_0xd8eb('0x12')]);router[_0xd8eb('0x13')](_0xd8eb('0xd'),auth['isAuthenticated'](),controller[_0xd8eb('0x14')]);module[_0xd8eb('0x15')]=router; \ No newline at end of file +var _0x8d41=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','show','post'];(function(_0x2bf677,_0x2fc095){var _0x28a0c3=function(_0x3d8633){while(--_0x3d8633){_0x2bf677['push'](_0x2bf677['shift']());}};_0x28a0c3(++_0x2fc095);}(_0x8d41,0x1aa));var _0x18d4=function(_0x4f03ce,_0x5cb284){_0x4f03ce=_0x4f03ce-0x0;var _0x52acd1=_0x8d41[_0x4f03ce];return _0x52acd1;};'use strict';var multer=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var path=require(_0x18d4('0x2'));var timeout=require(_0x18d4('0x3'));var express=require(_0x18d4('0x4'));var router=express['Router']();var auth=require(_0x18d4('0x5'));var interaction=require(_0x18d4('0x6'));var config=require(_0x18d4('0x7'));var controller=require(_0x18d4('0x8'));router[_0x18d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x18d4('0xa')]);router[_0x18d4('0x9')](_0x18d4('0xb'),auth[_0x18d4('0xc')](),controller['describe']);router[_0x18d4('0x9')]('/:id',auth[_0x18d4('0xc')](),controller[_0x18d4('0xd')]);router[_0x18d4('0xe')]('/',auth[_0x18d4('0xc')](),controller[_0x18d4('0xf')]);router[_0x18d4('0x10')](_0x18d4('0x11'),auth['isAuthenticated'](),controller[_0x18d4('0x12')]);router[_0x18d4('0x13')](_0x18d4('0x11'),auth[_0x18d4('0xc')](),controller['destroy']);module[_0x18d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a3f89d0..11f5340 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['STRING','DATE','sequelize','exports'];(function(_0x2b2ef8,_0x216e72){var _0x369d9a=function(_0x5cb9fc){while(--_0x5cb9fc){_0x2b2ef8['push'](_0x2b2ef8['shift']());}};_0x369d9a(++_0x216e72);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1218c5,_0x3cf770){_0x1218c5=_0x1218c5-0x0;var _0x221890=_0x8ef6[_0x1218c5];return _0x221890;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x68ef('0x2')]},'joinAt':{'type':Sequelize[_0x68ef('0x3')]},'leaveAt':{'type':Sequelize[_0x68ef('0x3')]},'acceptAt':{'type':Sequelize[_0x68ef('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x182058,_0x4346e6){var _0xe53171=function(_0x1cb2e9){while(--_0x1cb2e9){_0x182058['push'](_0x182058['shift']());}};_0xe53171(++_0x4346e6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e92981a..a1b61fa 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe635=['then','destroy','end','error','name','send','map','WhatsappQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','filter','merge','options','includeAll','rows','catch','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update'];(function(_0xdff253,_0x437916){var _0x399988=function(_0xe0d3b2){while(--_0xe0d3b2){_0xdff253['push'](_0xdff253['shift']());}};_0x399988(++_0x437916);}(_0xe635,0x1be));var _0x5e63=function(_0x30ecf2,_0x2d3bf8){_0x30ecf2=_0x30ecf2-0x0;var _0x2aef2f=_0xe635[_0x30ecf2];return _0x2aef2f;};'use strict';var pdf=require(_0x5e63('0x0'));var emlformat=require(_0x5e63('0x1'));var rimraf=require(_0x5e63('0x2'));var zipdir=require(_0x5e63('0x3'));var jsonpatch=require(_0x5e63('0x4'));var rp=require(_0x5e63('0x5'));var moment=require(_0x5e63('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5e63('0x7'));var path=require(_0x5e63('0x8'));var sox=require(_0x5e63('0x9'));var csv=require(_0x5e63('0xa'));var ejs=require(_0x5e63('0xb'));var fs=require('fs');var _=require(_0x5e63('0xc'));var squel=require(_0x5e63('0xd'));var crypto=require(_0x5e63('0xe'));var jsforce=require(_0x5e63('0xf'));var deskjs=require(_0x5e63('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5e63('0x11'));var Papa=require(_0x5e63('0x12'));var Redis=require(_0x5e63('0x13'));var authService=require(_0x5e63('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e63('0x15'));var hardwareService=require(_0x5e63('0x16'));var logger=require('../../config/logger')(_0x5e63('0x17'));var utils=require(_0x5e63('0x18'));var config=require('../../config/environment');var db=require(_0x5e63('0x19'))['db'];function respondWithStatusCode(_0x52b256,_0x1dcbf4){_0x1dcbf4=_0x1dcbf4||0xcc;return function(_0x23c833){if(_0x23c833){return _0x52b256[_0x5e63('0x1a')](_0x1dcbf4);}return _0x52b256[_0x5e63('0x1b')](_0x1dcbf4)['end']();};}function respondWithResult(_0x57a086,_0x560fee){_0x560fee=_0x560fee||0xc8;return function(_0x187e2e){if(_0x187e2e){return _0x57a086[_0x5e63('0x1b')](_0x560fee)['json'](_0x187e2e);}};}function respondWithFilteredResult(_0x1c6728,_0x1f7149){return function(_0x3c5d47){if(_0x3c5d47){var _0x491e27=_0x3c5d47[_0x5e63('0x1c')],_0x42a714=_0x1f7149[_0x5e63('0x1d')],_0xe0b567=_0x1f7149['offset']+_0x1f7149[_0x5e63('0x1e')],_0x4715f9;if(_0xe0b567>=_0x491e27){_0xe0b567=_0x491e27;_0x4715f9=0xc8;}else{_0x4715f9=0xce;}_0x1c6728[_0x5e63('0x1b')](_0x4715f9);return _0x1c6728[_0x5e63('0x1f')](_0x5e63('0x20'),_0x42a714+'-'+_0xe0b567+'/'+_0x491e27)[_0x5e63('0x21')](_0x3c5d47);}return null;};}function patchUpdates(_0x4a6013){return function(_0x3d5b23){try{jsonpatch['apply'](_0x3d5b23,_0x4a6013,!![]);}catch(_0x5d5cb4){return BPromise[_0x5e63('0x22')](_0x5d5cb4);}return _0x3d5b23[_0x5e63('0x23')]();};}function saveUpdates(_0x318047,_0x2ba2f0){return function(_0x239d37){if(_0x239d37){return _0x239d37[_0x5e63('0x24')](_0x318047)[_0x5e63('0x25')](function(_0x29ed92){return _0x29ed92;});}return null;};}function removeEntity(_0x2a3f12,_0x3fdabb){return function(_0x4c52f9){if(_0x4c52f9){return _0x4c52f9[_0x5e63('0x26')]()['then'](function(){_0x2a3f12['status'](0xcc)[_0x5e63('0x27')]();});}};}function handleEntityNotFound(_0x3ff002,_0x2d9387){return function(_0x9dc630){if(!_0x9dc630){_0x3ff002[_0x5e63('0x1a')](0x194);}return _0x9dc630;};}function handleError(_0x270236,_0x283bba){_0x283bba=_0x283bba||0x1f4;return function(_0x4eab9d){logger[_0x5e63('0x28')](_0x4eab9d['stack']);if(_0x4eab9d[_0x5e63('0x29')]){delete _0x4eab9d[_0x5e63('0x29')];}_0x270236['status'](_0x283bba)[_0x5e63('0x2a')](_0x4eab9d);};}exports['index']=function(_0x57235e,_0x1e2a52){var _0x548718={},_0x4e0a86={},_0x1f2eff={'count':0x0,'rows':[]};var _0x14434d=_[_0x5e63('0x2b')](db[_0x5e63('0x2c')][_0x5e63('0x2d')],function(_0x25c635){return{'name':_0x25c635['fieldName'],'type':_0x25c635[_0x5e63('0x2e')]['key']};});_0x4e0a86[_0x5e63('0x2f')]=_[_0x5e63('0x2b')](_0x14434d,_0x5e63('0x29'));_0x4e0a86[_0x5e63('0x30')]=_[_0x5e63('0x31')](_0x57235e[_0x5e63('0x30')]);_0x4e0a86['filters']=_[_0x5e63('0x32')](_0x4e0a86[_0x5e63('0x2f')],_0x4e0a86[_0x5e63('0x30')]);_0x548718['attributes']=_[_0x5e63('0x32')](_0x4e0a86[_0x5e63('0x2f')],qs[_0x5e63('0x33')](_0x57235e[_0x5e63('0x30')]['fields']));_0x548718['attributes']=_0x548718['attributes']['length']?_0x548718[_0x5e63('0x34')]:_0x4e0a86[_0x5e63('0x2f')];if(!_0x57235e[_0x5e63('0x30')]['hasOwnProperty'](_0x5e63('0x35'))){_0x548718[_0x5e63('0x1e')]=qs['limit'](_0x57235e[_0x5e63('0x30')][_0x5e63('0x1e')]);_0x548718[_0x5e63('0x1d')]=qs[_0x5e63('0x1d')](_0x57235e['query'][_0x5e63('0x1d')]);}_0x548718['order']=qs['sort'](_0x57235e[_0x5e63('0x30')][_0x5e63('0x36')]);_0x548718[_0x5e63('0x37')]=qs[_0x5e63('0x38')](_['pick'](_0x57235e[_0x5e63('0x30')],_0x4e0a86[_0x5e63('0x38')]),_0x14434d);if(_0x57235e[_0x5e63('0x30')][_0x5e63('0x39')]){_0x548718[_0x5e63('0x37')]=_[_0x5e63('0x3a')](_0x548718[_0x5e63('0x37')],{'$or':_[_0x5e63('0x2b')](_0x14434d,function(_0x48da95){if(_0x48da95[_0x5e63('0x2e')]!=='VIRTUAL'){var _0x115d26={};_0x115d26[_0x48da95['name']]={'$like':'%'+_0x57235e[_0x5e63('0x30')][_0x5e63('0x39')]+'%'};return _0x115d26;}})});}_0x548718=_['merge']({},_0x548718,_0x57235e[_0x5e63('0x3b')]);var _0x351ef0={'where':_0x548718[_0x5e63('0x37')]};return db[_0x5e63('0x2c')]['count'](_0x351ef0)['then'](function(_0x2d5c35){_0x1f2eff[_0x5e63('0x1c')]=_0x2d5c35;if(_0x57235e[_0x5e63('0x30')][_0x5e63('0x3c')]){_0x548718['include']=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x548718);})[_0x5e63('0x25')](function(_0x45373f){_0x1f2eff[_0x5e63('0x3d')]=_0x45373f;return _0x1f2eff;})[_0x5e63('0x25')](respondWithFilteredResult(_0x1e2a52,_0x548718))[_0x5e63('0x3e')](handleError(_0x1e2a52,null));};exports['show']=function(_0x7215a9,_0x364329){var _0x51b36c={'raw':!![],'where':{'id':_0x7215a9['params']['id']}},_0x1fb614={};_0x1fb614[_0x5e63('0x2f')]=_['keys'](db[_0x5e63('0x2c')][_0x5e63('0x2d')]);_0x1fb614[_0x5e63('0x30')]=_['keys'](_0x7215a9[_0x5e63('0x30')]);_0x1fb614[_0x5e63('0x38')]=_[_0x5e63('0x32')](_0x1fb614[_0x5e63('0x2f')],_0x1fb614[_0x5e63('0x30')]);_0x51b36c[_0x5e63('0x34')]=_['intersection'](_0x1fb614[_0x5e63('0x2f')],qs[_0x5e63('0x33')](_0x7215a9[_0x5e63('0x30')][_0x5e63('0x33')]));_0x51b36c[_0x5e63('0x34')]=_0x51b36c['attributes'][_0x5e63('0x3f')]?_0x51b36c[_0x5e63('0x34')]:_0x1fb614['model'];if(_0x7215a9['query'][_0x5e63('0x3c')]){_0x51b36c['include']=[{'all':!![]}];}_0x51b36c=_[_0x5e63('0x3a')]({},_0x51b36c,_0x7215a9['options']);return db['WhatsappQueueReport'][_0x5e63('0x40')](_0x51b36c)[_0x5e63('0x25')](handleEntityNotFound(_0x364329,null))[_0x5e63('0x25')](respondWithResult(_0x364329,null))[_0x5e63('0x3e')](handleError(_0x364329,null));};exports[_0x5e63('0x41')]=function(_0x9dc236,_0x402729){return db[_0x5e63('0x2c')][_0x5e63('0x41')](_0x9dc236[_0x5e63('0x42')],{})[_0x5e63('0x25')](respondWithResult(_0x402729,0xc9))[_0x5e63('0x3e')](handleError(_0x402729,null));};exports[_0x5e63('0x24')]=function(_0x571e6d,_0x3e4969){if(_0x571e6d[_0x5e63('0x42')]['id']){delete _0x571e6d[_0x5e63('0x42')]['id'];}return db[_0x5e63('0x2c')][_0x5e63('0x40')]({'where':{'id':_0x571e6d[_0x5e63('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4969,null))[_0x5e63('0x25')](saveUpdates(_0x571e6d['body'],null))[_0x5e63('0x25')](respondWithResult(_0x3e4969,null))['catch'](handleError(_0x3e4969,null));};exports[_0x5e63('0x26')]=function(_0x2b51c7,_0x53df5e){return db['WhatsappQueueReport']['find']({'where':{'id':_0x2b51c7[_0x5e63('0x43')]['id']}})['then'](handleEntityNotFound(_0x53df5e,null))[_0x5e63('0x25')](removeEntity(_0x53df5e,null))['catch'](handleError(_0x53df5e,null));};exports[_0x5e63('0x44')]=function(_0x3268f7,_0x453009){return db['WhatsappQueueReport']['describe']()[_0x5e63('0x25')](respondWithResult(_0x453009,null))['catch'](handleError(_0x453009,null));}; \ No newline at end of file +var _0x014c=['key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x014c,0x17b));var _0xc014=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0x014c[_0x4c3070];return _0x536a44;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc014('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc014('0x1'));var jsonpatch=require(_0xc014('0x2'));var rp=require(_0xc014('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc014('0x4'));var util=require(_0xc014('0x5'));var path=require(_0xc014('0x6'));var sox=require(_0xc014('0x7'));var csv=require(_0xc014('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x8'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ae990,_0xcde2d3){_0xcde2d3=_0xcde2d3||0xcc;return function(_0x2f8ac9){if(_0x2f8ac9){return _0x2ae990[_0xc014('0x14')](_0xcde2d3);}return _0x2ae990['status'](_0xcde2d3)[_0xc014('0x15')]();};}function respondWithResult(_0x300aaf,_0xe86dd){_0xe86dd=_0xe86dd||0xc8;return function(_0x5ced7d){if(_0x5ced7d){return _0x300aaf[_0xc014('0x16')](_0xe86dd)['json'](_0x5ced7d);}};}function respondWithFilteredResult(_0x458195,_0x1c4d3b){return function(_0x25fdf6){if(_0x25fdf6){var _0x26f264=_0x25fdf6[_0xc014('0x17')],_0x9f6a26=_0x1c4d3b[_0xc014('0x18')],_0x9791b9=_0x1c4d3b[_0xc014('0x18')]+_0x1c4d3b[_0xc014('0x19')],_0x4aa669;if(_0x9791b9>=_0x26f264){_0x9791b9=_0x26f264;_0x4aa669=0xc8;}else{_0x4aa669=0xce;}_0x458195['status'](_0x4aa669);return _0x458195['set'](_0xc014('0x1a'),_0x9f6a26+'-'+_0x9791b9+'/'+_0x26f264)['json'](_0x25fdf6);}return null;};}function patchUpdates(_0x5226ee){return function(_0x2261b0){try{jsonpatch[_0xc014('0x1b')](_0x2261b0,_0x5226ee,!![]);}catch(_0x4a3823){return BPromise[_0xc014('0x1c')](_0x4a3823);}return _0x2261b0[_0xc014('0x1d')]();};}function saveUpdates(_0x391a07,_0x2dac66){return function(_0x1078c4){if(_0x1078c4){return _0x1078c4['update'](_0x391a07)[_0xc014('0x1e')](function(_0x294c11){return _0x294c11;});}return null;};}function removeEntity(_0x31a349,_0x3c58cc){return function(_0x450b22){if(_0x450b22){return _0x450b22[_0xc014('0x1f')]()[_0xc014('0x1e')](function(){_0x31a349['status'](0xcc)[_0xc014('0x15')]();});}};}function handleEntityNotFound(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(!_0x174b46){_0x1b905d[_0xc014('0x14')](0x194);}return _0x174b46;};}function handleError(_0x144e11,_0x204ea0){_0x204ea0=_0x204ea0||0x1f4;return function(_0x3219e7){logger[_0xc014('0x20')](_0x3219e7[_0xc014('0x21')]);if(_0x3219e7['name']){delete _0x3219e7[_0xc014('0x22')];}_0x144e11[_0xc014('0x16')](_0x204ea0)[_0xc014('0x23')](_0x3219e7);};}exports[_0xc014('0x24')]=function(_0x30fd7d,_0x5676a3){var _0x6d0d83={},_0x382a6d={},_0x433aa4={'count':0x0,'rows':[]};var _0x12bc24=_['map'](db[_0xc014('0x25')][_0xc014('0x26')],function(_0x151705){return{'name':_0x151705[_0xc014('0x27')],'type':_0x151705[_0xc014('0x28')][_0xc014('0x29')]};});_0x382a6d[_0xc014('0x2a')]=_[_0xc014('0x2b')](_0x12bc24,_0xc014('0x22'));_0x382a6d[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x30fd7d['query']);_0x382a6d[_0xc014('0x2e')]=_['intersection'](_0x382a6d['model'],_0x382a6d['query']);_0x6d0d83[_0xc014('0x2f')]=_[_0xc014('0x30')](_0x382a6d['model'],qs[_0xc014('0x31')](_0x30fd7d[_0xc014('0x2c')][_0xc014('0x31')]));_0x6d0d83[_0xc014('0x2f')]=_0x6d0d83[_0xc014('0x2f')][_0xc014('0x32')]?_0x6d0d83[_0xc014('0x2f')]:_0x382a6d[_0xc014('0x2a')];if(!_0x30fd7d[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x6d0d83[_0xc014('0x19')]=qs['limit'](_0x30fd7d[_0xc014('0x2c')]['limit']);_0x6d0d83[_0xc014('0x18')]=qs[_0xc014('0x18')](_0x30fd7d[_0xc014('0x2c')][_0xc014('0x18')]);}_0x6d0d83[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x30fd7d[_0xc014('0x2c')]['sort']);_0x6d0d83[_0xc014('0x37')]=qs['filters'](_[_0xc014('0x38')](_0x30fd7d[_0xc014('0x2c')],_0x382a6d[_0xc014('0x2e')]),_0x12bc24);if(_0x30fd7d[_0xc014('0x2c')][_0xc014('0x39')]){_0x6d0d83[_0xc014('0x37')]=_[_0xc014('0x3a')](_0x6d0d83['where'],{'$or':_[_0xc014('0x2b')](_0x12bc24,function(_0xef647b){if(_0xef647b[_0xc014('0x28')]!=='VIRTUAL'){var _0x11ac76={};_0x11ac76[_0xef647b[_0xc014('0x22')]]={'$like':'%'+_0x30fd7d[_0xc014('0x2c')]['filter']+'%'};return _0x11ac76;}})});}_0x6d0d83=_[_0xc014('0x3a')]({},_0x6d0d83,_0x30fd7d['options']);var _0x2b17fe={'where':_0x6d0d83[_0xc014('0x37')]};return db[_0xc014('0x25')][_0xc014('0x17')](_0x2b17fe)[_0xc014('0x1e')](function(_0xc62c13){_0x433aa4[_0xc014('0x17')]=_0xc62c13;if(_0x30fd7d[_0xc014('0x2c')][_0xc014('0x3b')]){_0x6d0d83[_0xc014('0x3c')]=[{'all':!![]}];}return db[_0xc014('0x25')][_0xc014('0x3d')](_0x6d0d83);})['then'](function(_0x28fdce){_0x433aa4[_0xc014('0x3e')]=_0x28fdce;return _0x433aa4;})[_0xc014('0x1e')](respondWithFilteredResult(_0x5676a3,_0x6d0d83))[_0xc014('0x3f')](handleError(_0x5676a3,null));};exports['show']=function(_0x8fcec9,_0x553fb1){var _0x3a7f90={'raw':!![],'where':{'id':_0x8fcec9[_0xc014('0x40')]['id']}},_0x147d69={};_0x147d69[_0xc014('0x2a')]=_[_0xc014('0x2d')](db[_0xc014('0x25')][_0xc014('0x26')]);_0x147d69[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x8fcec9[_0xc014('0x2c')]);_0x147d69[_0xc014('0x2e')]=_['intersection'](_0x147d69[_0xc014('0x2a')],_0x147d69['query']);_0x3a7f90['attributes']=_[_0xc014('0x30')](_0x147d69[_0xc014('0x2a')],qs[_0xc014('0x31')](_0x8fcec9[_0xc014('0x2c')][_0xc014('0x31')]));_0x3a7f90['attributes']=_0x3a7f90[_0xc014('0x2f')][_0xc014('0x32')]?_0x3a7f90['attributes']:_0x147d69[_0xc014('0x2a')];if(_0x8fcec9[_0xc014('0x2c')][_0xc014('0x3b')]){_0x3a7f90[_0xc014('0x3c')]=[{'all':!![]}];}_0x3a7f90=_[_0xc014('0x3a')]({},_0x3a7f90,_0x8fcec9[_0xc014('0x41')]);return db[_0xc014('0x25')][_0xc014('0x42')](_0x3a7f90)[_0xc014('0x1e')](handleEntityNotFound(_0x553fb1,null))['then'](respondWithResult(_0x553fb1,null))[_0xc014('0x3f')](handleError(_0x553fb1,null));};exports[_0xc014('0x43')]=function(_0x3dd71b,_0x2b0b1d){return db[_0xc014('0x25')][_0xc014('0x43')](_0x3dd71b[_0xc014('0x44')],{})[_0xc014('0x1e')](respondWithResult(_0x2b0b1d,0xc9))[_0xc014('0x3f')](handleError(_0x2b0b1d,null));};exports['update']=function(_0x2ce299,_0x49fe09){if(_0x2ce299['body']['id']){delete _0x2ce299[_0xc014('0x44')]['id'];}return db['WhatsappQueueReport'][_0xc014('0x42')]({'where':{'id':_0x2ce299[_0xc014('0x40')]['id']}})['then'](handleEntityNotFound(_0x49fe09,null))[_0xc014('0x1e')](saveUpdates(_0x2ce299[_0xc014('0x44')],null))[_0xc014('0x1e')](respondWithResult(_0x49fe09,null))[_0xc014('0x3f')](handleError(_0x49fe09,null));};exports[_0xc014('0x1f')]=function(_0x2d5bfc,_0x59e63a){return db[_0xc014('0x25')][_0xc014('0x42')]({'where':{'id':_0x2d5bfc[_0xc014('0x40')]['id']}})[_0xc014('0x1e')](handleEntityNotFound(_0x59e63a,null))[_0xc014('0x1e')](removeEntity(_0x59e63a,null))[_0xc014('0x3f')](handleError(_0x59e63a,null));};exports[_0xc014('0x45')]=function(_0x14af79,_0x3ee079){return db[_0xc014('0x25')]['describe']()[_0xc014('0x1e')](respondWithResult(_0x3ee079,null))[_0xc014('0x3f')](handleError(_0x3ee079,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 2fec862..ff80428 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac60=['define','WhatsappQueueReport','uniqueid','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x4e7306,_0x51515f){var _0x403bbe=function(_0x311e60){while(--_0x311e60){_0x4e7306['push'](_0x4e7306['shift']());}};_0x403bbe(++_0x51515f);}(_0xac60,0x137));var _0x0ac6=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xac60[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ac6('0x0'))(_0x0ac6('0x1'));var moment=require(_0x0ac6('0x2'));var BPromise=require(_0x0ac6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ac6('0x4'));var config=require(_0x0ac6('0x5'));var attributes=require(_0x0ac6('0x6'));module[_0x0ac6('0x7')]=function(_0x49360e,_0x15d308){return _0x49360e[_0x0ac6('0x8')](_0x0ac6('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0ac6('0xa'),'fields':[_0x0ac6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde76=['util','../../config/logger','api','moment','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0xde76,0xe9));var _0x6de7=function(_0x5b7a24,_0x2092bd){_0x5b7a24=_0x5b7a24-0x0;var _0x4a797a=_0xde76[_0x5b7a24];return _0x4a797a;};'use strict';var _=require(_0x6de7('0x0'));var util=require(_0x6de7('0x1'));var logger=require(_0x6de7('0x2'))(_0x6de7('0x3'));var moment=require(_0x6de7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6de7('0x5'));var config=require(_0x6de7('0x6'));var attributes=require(_0x6de7('0x7'));module[_0x6de7('0x8')]=function(_0xead8fd,_0x2158fd){return _0xead8fd[_0x6de7('0x9')](_0x6de7('0xa'),attributes,{'tableName':_0x6de7('0xb'),'paranoid':![],'indexes':[{'name':_0x6de7('0xc'),'fields':[_0x6de7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index a4ee107..d54633b 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1845=['update','body','attributes','limit','UpdateWhatsappQueueReport','stringify','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw'];(function(_0x197dab,_0x42d8da){var _0xa24a56=function(_0x210d3a){while(--_0x210d3a){_0x197dab['push'](_0x197dab['shift']());}};_0xa24a56(++_0x42d8da);}(_0x1845,0x128));var _0x5184=function(_0x18fbc7,_0x8d43a){_0x18fbc7=_0x18fbc7-0x0;var _0xca4d34=_0x1845[_0x18fbc7];return _0xca4d34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5184('0x0'));var BPromise=require(_0x5184('0x1'));var rs=require(_0x5184('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5184('0x3'))['db'];var utils=require(_0x5184('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5184('0x5'));var client=jayson[_0x5184('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeab124,_0x1f0949,_0x16330d){return new BPromise(function(_0x1a9f8d,_0x5b02bc){return client[_0x5184('0x7')](_0xeab124,_0x16330d)[_0x5184('0x8')](function(_0x52fe64){logger[_0x5184('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f0949,'request\x20sent');logger[_0x5184('0xa')](_0x5184('0xb'),_0x1f0949,_0x5184('0xc'),JSON['stringify'](_0x52fe64));if(_0x52fe64[_0x5184('0xd')]){if(_0x52fe64['error'][_0x5184('0xe')]===0x1f4){logger[_0x5184('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f0949,_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);return _0x5b02bc(_0x52fe64['error'][_0x5184('0xf')]);}logger['error'](_0x5184('0x10'),_0x1f0949,_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);return _0x1a9f8d(_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);}else{logger[_0x5184('0x9')](_0x5184('0x10'),_0x1f0949,'request\x20sent');_0x1a9f8d(_0x52fe64['result'][_0x5184('0xf')]);}})[_0x5184('0x11')](function(_0x2cb42b){logger[_0x5184('0xd')](_0x5184('0x10'),_0x1f0949,_0x2cb42b);_0x5b02bc(_0x2cb42b);});});}exports[_0x5184('0x12')]=function(_0xcfe0c1){var _0x1c279a=this;return new Promise(function(_0x1c1b97,_0x3b5a3d){return db[_0x5184('0x13')][_0x5184('0x14')](_0xcfe0c1['body'],{'raw':_0xcfe0c1[_0x5184('0x15')]?_0xcfe0c1['options'][_0x5184('0x16')]===undefined?!![]:![]:!![]})[_0x5184('0x8')](function(_0x52c94a){logger[_0x5184('0x9')](_0x5184('0x12'),_0xcfe0c1);logger['debug'](_0x5184('0x12'),_0xcfe0c1,JSON['stringify'](_0x52c94a));_0x1c1b97(_0x52c94a);})[_0x5184('0x11')](function(_0x4f3bd2){logger[_0x5184('0xd')](_0x5184('0x12'),_0x4f3bd2['message'],_0xcfe0c1);_0x3b5a3d(_0x1c279a['error'](0x1f4,_0x4f3bd2[_0x5184('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1fb6e7){var _0x33afee=this;return new Promise(function(_0x4f46c6,_0x2f1823){return db[_0x5184('0x13')][_0x5184('0x17')](_0x1fb6e7[_0x5184('0x18')],{'raw':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7['options'][_0x5184('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7[_0x5184('0x15')]['where']||null:null,'attributes':_0x1fb6e7['options']?_0x1fb6e7[_0x5184('0x15')][_0x5184('0x19')]||null:null,'limit':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7[_0x5184('0x15')][_0x5184('0x1a')]||null:null})[_0x5184('0x8')](function(_0x56c097){logger['info'](_0x5184('0x1b'),_0x1fb6e7);logger[_0x5184('0xa')](_0x5184('0x1b'),_0x1fb6e7,JSON[_0x5184('0x1c')](_0x56c097));_0x4f46c6(_0x56c097);})[_0x5184('0x11')](function(_0x14bd4a){logger[_0x5184('0xd')](_0x5184('0x1b'),_0x14bd4a[_0x5184('0xf')],_0x1fb6e7);_0x2f1823(_0x33afee[_0x5184('0xd')](0x1f4,_0x14bd4a['message']));});});}; \ No newline at end of file +var _0xb151=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x24ecc9,_0x4b14b6){var _0x341dc9=function(_0x42a854){while(--_0x42a854){_0x24ecc9['push'](_0x24ecc9['shift']());}};_0x341dc9(++_0x4b14b6);}(_0xb151,0x1a1));var _0x1b15=function(_0x4e8891,_0x4667f9){_0x4e8891=_0x4e8891-0x0;var _0x448828=_0xb151[_0x4e8891];return _0x448828;};'use strict';var _=require(_0x1b15('0x0'));var util=require(_0x1b15('0x1'));var moment=require(_0x1b15('0x2'));var BPromise=require(_0x1b15('0x3'));var rs=require(_0x1b15('0x4'));var fs=require('fs');var Redis=require(_0x1b15('0x5'));var db=require(_0x1b15('0x6'))['db'];var utils=require(_0x1b15('0x7'));var logger=require(_0x1b15('0x8'))(_0x1b15('0x9'));var config=require(_0x1b15('0xa'));var jayson=require(_0x1b15('0xb'));var client=jayson['client'][_0x1b15('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x287e21,_0x547188,_0x1ab797){return new BPromise(function(_0x17452d,_0x32dc6f){return client['request'](_0x287e21,_0x1ab797)[_0x1b15('0xd')](function(_0x48b2b9){logger[_0x1b15('0xe')](_0x1b15('0xf'),_0x547188,'request\x20sent');logger[_0x1b15('0x10')](_0x1b15('0x11'),_0x547188,_0x1b15('0x12'),JSON[_0x1b15('0x13')](_0x48b2b9));if(_0x48b2b9[_0x1b15('0x14')]){if(_0x48b2b9[_0x1b15('0x14')]['code']===0x1f4){logger[_0x1b15('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x547188,_0x48b2b9[_0x1b15('0x14')][_0x1b15('0x15')]);return _0x32dc6f(_0x48b2b9[_0x1b15('0x14')][_0x1b15('0x15')]);}logger[_0x1b15('0x14')](_0x1b15('0xf'),_0x547188,_0x48b2b9['error'][_0x1b15('0x15')]);return _0x17452d(_0x48b2b9['error'][_0x1b15('0x15')]);}else{logger['info'](_0x1b15('0xf'),_0x547188,_0x1b15('0x12'));_0x17452d(_0x48b2b9[_0x1b15('0x16')][_0x1b15('0x15')]);}})[_0x1b15('0x17')](function(_0x3ae034){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x547188,_0x3ae034);_0x32dc6f(_0x3ae034);});});}exports[_0x1b15('0x18')]=function(_0x2ac63b){var _0x119832=this;return new Promise(function(_0x5cdacc,_0xda87a1){return db['WhatsappQueueReport'][_0x1b15('0x19')](_0x2ac63b[_0x1b15('0x1a')],{'raw':_0x2ac63b[_0x1b15('0x1b')]?_0x2ac63b[_0x1b15('0x1b')][_0x1b15('0x1c')]===undefined?!![]:![]:!![]})[_0x1b15('0xd')](function(_0x4cdfaa){logger['info']('CreateWhatsappQueueReport',_0x2ac63b);logger[_0x1b15('0x10')](_0x1b15('0x18'),_0x2ac63b,JSON[_0x1b15('0x13')](_0x4cdfaa));_0x5cdacc(_0x4cdfaa);})[_0x1b15('0x17')](function(_0x2c92c4){logger[_0x1b15('0x14')]('CreateWhatsappQueueReport',_0x2c92c4[_0x1b15('0x15')],_0x2ac63b);_0xda87a1(_0x119832[_0x1b15('0x14')](0x1f4,_0x2c92c4[_0x1b15('0x15')]));});});};exports[_0x1b15('0x1d')]=function(_0x2510f8){var _0x202fcd=this;return new Promise(function(_0x377ed3,_0x2b8b31){return db[_0x1b15('0x1e')][_0x1b15('0x1f')](_0x2510f8[_0x1b15('0x1a')],{'raw':_0x2510f8['options']?_0x2510f8[_0x1b15('0x1b')][_0x1b15('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8['options'][_0x1b15('0x20')]||null:null,'attributes':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8['options'][_0x1b15('0x21')]||null:null,'limit':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8[_0x1b15('0x1b')][_0x1b15('0x22')]||null:null})[_0x1b15('0xd')](function(_0x5a3543){logger[_0x1b15('0xe')](_0x1b15('0x1d'),_0x2510f8);logger[_0x1b15('0x10')](_0x1b15('0x1d'),_0x2510f8,JSON[_0x1b15('0x13')](_0x5a3543));_0x377ed3(_0x5a3543);})[_0x1b15('0x17')](function(_0x3e0c2d){logger['error'](_0x1b15('0x1d'),_0x3e0c2d[_0x1b15('0x15')],_0x2510f8);_0x2b8b31(_0x202fcd['error'](0x1f4,_0x3e0c2d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9dd5056..5f69b72 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0e5=['post','create','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./whatsappTransferReport.controller','isAuthenticated','index','describe','get','/:id','show'];(function(_0x5e127b,_0x4dc0d1){var _0x4f46d2=function(_0x137ba7){while(--_0x137ba7){_0x5e127b['push'](_0x5e127b['shift']());}};_0x4f46d2(++_0x4dc0d1);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x2c56bb,_0x59bfc2){_0x2c56bb=_0x2c56bb-0x0;var _0x1479a9=_0xb0e5[_0x2c56bb];return _0x1479a9;};'use strict';var multer=require(_0x5b0e('0x0'));var util=require(_0x5b0e('0x1'));var path=require(_0x5b0e('0x2'));var timeout=require(_0x5b0e('0x3'));var express=require(_0x5b0e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5b0e('0x5'));var config=require('../../config/environment');var controller=require(_0x5b0e('0x6'));router['get']('/',auth[_0x5b0e('0x7')](),controller[_0x5b0e('0x8')]);router['get']('/describe',auth[_0x5b0e('0x7')](),controller[_0x5b0e('0x9')]);router[_0x5b0e('0xa')](_0x5b0e('0xb'),auth[_0x5b0e('0x7')](),controller[_0x5b0e('0xc')]);router[_0x5b0e('0xd')]('/',auth[_0x5b0e('0x7')](),controller[_0x5b0e('0xe')]);router['put'](_0x5b0e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5b0e('0xf')](_0x5b0e('0xb'),auth[_0x5b0e('0x7')](),controller['destroy']);module[_0x5b0e('0x10')]=router; \ No newline at end of file +var _0x0530=['update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0530,0x72));var _0x0053=function(_0x27b5fd,_0x5a4d26){_0x27b5fd=_0x27b5fd-0x0;var _0x571e53=_0x0530[_0x27b5fd];return _0x571e53;};'use strict';var multer=require(_0x0053('0x0'));var util=require(_0x0053('0x1'));var path=require('path');var timeout=require(_0x0053('0x2'));var express=require('express');var router=express[_0x0053('0x3')]();var auth=require(_0x0053('0x4'));var interaction=require(_0x0053('0x5'));var config=require('../../config/environment');var controller=require(_0x0053('0x6'));router[_0x0053('0x7')]('/',auth[_0x0053('0x8')](),controller[_0x0053('0x9')]);router[_0x0053('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x0053('0xa')]);router['get'](_0x0053('0xb'),auth[_0x0053('0x8')](),controller[_0x0053('0xc')]);router['post']('/',auth[_0x0053('0x8')](),controller[_0x0053('0xd')]);router['put'](_0x0053('0xb'),auth[_0x0053('0x8')](),controller[_0x0053('0xe')]);router['delete'](_0x0053('0xb'),auth['isAuthenticated'](),controller[_0x0053('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3f0461d..d3563cc 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['DATE','sequelize','STRING','account','agent','queue'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x0b0e[_0x4d7379];return _0x46d7cf;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe0b0('0x5')]}}; \ No newline at end of file +var _0x2032=['agent','queue','exports','STRING','ENUM'];(function(_0x1826a6,_0x40f9fc){var _0x8fbc3=function(_0x3230bf){while(--_0x3230bf){_0x1826a6['push'](_0x1826a6['shift']());}};_0x8fbc3(++_0x40f9fc);}(_0x2032,0xd9));var _0x2203=function(_0x310864,_0x34b2b7){_0x310864=_0x310864-0x0;var _0x364359=_0x2032[_0x310864];return _0x364359;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'uniqueid':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2203('0x2')]('account',_0x2203('0x3'),_0x2203('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 9067959..1b27105 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7114=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','include','rows','catch','params','includeAll','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type'];(function(_0x5a8484,_0x467a59){var _0x49af1e=function(_0x32ca85){while(--_0x32ca85){_0x5a8484['push'](_0x5a8484['shift']());}};_0x49af1e(++_0x467a59);}(_0x7114,0xab));var _0x4711=function(_0x482b63,_0x1d2869){_0x482b63=_0x482b63-0x0;var _0x20a0ff=_0x7114[_0x482b63];return _0x20a0ff;};'use strict';var pdf=require(_0x4711('0x0'));var emlformat=require(_0x4711('0x1'));var rimraf=require(_0x4711('0x2'));var zipdir=require(_0x4711('0x3'));var jsonpatch=require(_0x4711('0x4'));var rp=require('request-promise');var moment=require(_0x4711('0x5'));var BPromise=require(_0x4711('0x6'));var Mustache=require(_0x4711('0x7'));var util=require(_0x4711('0x8'));var path=require(_0x4711('0x9'));var sox=require(_0x4711('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4711('0xb'));var crypto=require(_0x4711('0xc'));var jsforce=require(_0x4711('0xd'));var deskjs=require(_0x4711('0xe'));var toCsv=require(_0x4711('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4711('0x10'));var qs=require(_0x4711('0x11'));var as=require(_0x4711('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4711('0x13'))(_0x4711('0x14'));var utils=require(_0x4711('0x15'));var config=require(_0x4711('0x16'));var db=require(_0x4711('0x17'))['db'];function respondWithStatusCode(_0x364d91,_0x319733){_0x319733=_0x319733||0xcc;return function(_0x34161d){if(_0x34161d){return _0x364d91[_0x4711('0x18')](_0x319733);}return _0x364d91[_0x4711('0x19')](_0x319733)['end']();};}function respondWithResult(_0x3f326d,_0x21bc30){_0x21bc30=_0x21bc30||0xc8;return function(_0x866acd){if(_0x866acd){return _0x3f326d[_0x4711('0x19')](_0x21bc30)[_0x4711('0x1a')](_0x866acd);}};}function respondWithFilteredResult(_0x4b9d8c,_0x5b279f){return function(_0x18c487){if(_0x18c487){var _0x380858=_0x18c487[_0x4711('0x1b')],_0x4793b7=_0x5b279f[_0x4711('0x1c')],_0x9e931b=_0x5b279f[_0x4711('0x1c')]+_0x5b279f[_0x4711('0x1d')],_0x127ec7;if(_0x9e931b>=_0x380858){_0x9e931b=_0x380858;_0x127ec7=0xc8;}else{_0x127ec7=0xce;}_0x4b9d8c['status'](_0x127ec7);return _0x4b9d8c[_0x4711('0x1e')](_0x4711('0x1f'),_0x4793b7+'-'+_0x9e931b+'/'+_0x380858)[_0x4711('0x1a')](_0x18c487);}return null;};}function patchUpdates(_0x14f0eb){return function(_0x182b5c){try{jsonpatch[_0x4711('0x20')](_0x182b5c,_0x14f0eb,!![]);}catch(_0x1ab792){return BPromise[_0x4711('0x21')](_0x1ab792);}return _0x182b5c[_0x4711('0x22')]();};}function saveUpdates(_0x383356,_0x31f6c1){return function(_0x449102){if(_0x449102){return _0x449102[_0x4711('0x23')](_0x383356)[_0x4711('0x24')](function(_0xd1f8b4){return _0xd1f8b4;});}return null;};}function removeEntity(_0x189d50,_0x30667c){return function(_0x57d0f4){if(_0x57d0f4){return _0x57d0f4['destroy']()[_0x4711('0x24')](function(){_0x189d50[_0x4711('0x19')](0xcc)[_0x4711('0x25')]();});}};}function handleEntityNotFound(_0x2eac6c,_0x1d39b4){return function(_0x3f4239){if(!_0x3f4239){_0x2eac6c['sendStatus'](0x194);}return _0x3f4239;};}function handleError(_0x523cd4,_0xa3d871){_0xa3d871=_0xa3d871||0x1f4;return function(_0x193fa0){logger[_0x4711('0x26')](_0x193fa0[_0x4711('0x27')]);if(_0x193fa0[_0x4711('0x28')]){delete _0x193fa0[_0x4711('0x28')];}_0x523cd4['status'](_0xa3d871)[_0x4711('0x29')](_0x193fa0);};}exports[_0x4711('0x2a')]=function(_0x30a097,_0x54f02a){var _0x327096={},_0x95de13={},_0x17e5a6={'count':0x0,'rows':[]};var _0x31d7c6=_[_0x4711('0x2b')](db[_0x4711('0x2c')][_0x4711('0x2d')],function(_0x929b){return{'name':_0x929b[_0x4711('0x2e')],'type':_0x929b[_0x4711('0x2f')]['key']};});_0x95de13[_0x4711('0x30')]=_[_0x4711('0x2b')](_0x31d7c6,_0x4711('0x28'));_0x95de13[_0x4711('0x31')]=_[_0x4711('0x32')](_0x30a097[_0x4711('0x31')]);_0x95de13['filters']=_[_0x4711('0x33')](_0x95de13[_0x4711('0x30')],_0x95de13[_0x4711('0x31')]);_0x327096[_0x4711('0x34')]=_[_0x4711('0x33')](_0x95de13[_0x4711('0x30')],qs[_0x4711('0x35')](_0x30a097['query'][_0x4711('0x35')]));_0x327096[_0x4711('0x34')]=_0x327096[_0x4711('0x34')][_0x4711('0x36')]?_0x327096[_0x4711('0x34')]:_0x95de13[_0x4711('0x30')];if(!_0x30a097[_0x4711('0x31')][_0x4711('0x37')]('nolimit')){_0x327096[_0x4711('0x1d')]=qs[_0x4711('0x1d')](_0x30a097[_0x4711('0x31')][_0x4711('0x1d')]);_0x327096[_0x4711('0x1c')]=qs[_0x4711('0x1c')](_0x30a097[_0x4711('0x31')][_0x4711('0x1c')]);}_0x327096[_0x4711('0x38')]=qs['sort'](_0x30a097['query'][_0x4711('0x39')]);_0x327096[_0x4711('0x3a')]=qs['filters'](_['pick'](_0x30a097[_0x4711('0x31')],_0x95de13[_0x4711('0x3b')]),_0x31d7c6);if(_0x30a097['query'][_0x4711('0x3c')]){_0x327096['where']=_[_0x4711('0x3d')](_0x327096[_0x4711('0x3a')],{'$or':_['map'](_0x31d7c6,function(_0x46eb3b){if(_0x46eb3b[_0x4711('0x2f')]!=='VIRTUAL'){var _0x403352={};_0x403352[_0x46eb3b[_0x4711('0x28')]]={'$like':'%'+_0x30a097[_0x4711('0x31')]['filter']+'%'};return _0x403352;}})});}_0x327096=_['merge']({},_0x327096,_0x30a097[_0x4711('0x3e')]);var _0x15c118={'where':_0x327096[_0x4711('0x3a')]};return db['WhatsappTransferReport'][_0x4711('0x1b')](_0x15c118)[_0x4711('0x24')](function(_0x268545){_0x17e5a6[_0x4711('0x1b')]=_0x268545;if(_0x30a097[_0x4711('0x31')]['includeAll']){_0x327096[_0x4711('0x3f')]=[{'all':!![]}];}return db[_0x4711('0x2c')]['findAll'](_0x327096);})['then'](function(_0x1e5096){_0x17e5a6[_0x4711('0x40')]=_0x1e5096;return _0x17e5a6;})[_0x4711('0x24')](respondWithFilteredResult(_0x54f02a,_0x327096))[_0x4711('0x41')](handleError(_0x54f02a,null));};exports['show']=function(_0x10dbdf,_0x241eb8){var _0x1cafa9={'raw':!![],'where':{'id':_0x10dbdf[_0x4711('0x42')]['id']}},_0x1ac38a={};_0x1ac38a[_0x4711('0x30')]=_[_0x4711('0x32')](db['WhatsappTransferReport']['rawAttributes']);_0x1ac38a[_0x4711('0x31')]=_[_0x4711('0x32')](_0x10dbdf[_0x4711('0x31')]);_0x1ac38a[_0x4711('0x3b')]=_['intersection'](_0x1ac38a['model'],_0x1ac38a[_0x4711('0x31')]);_0x1cafa9[_0x4711('0x34')]=_['intersection'](_0x1ac38a[_0x4711('0x30')],qs[_0x4711('0x35')](_0x10dbdf[_0x4711('0x31')]['fields']));_0x1cafa9[_0x4711('0x34')]=_0x1cafa9[_0x4711('0x34')][_0x4711('0x36')]?_0x1cafa9[_0x4711('0x34')]:_0x1ac38a['model'];if(_0x10dbdf[_0x4711('0x31')][_0x4711('0x43')]){_0x1cafa9['include']=[{'all':!![]}];}_0x1cafa9=_[_0x4711('0x3d')]({},_0x1cafa9,_0x10dbdf[_0x4711('0x3e')]);return db[_0x4711('0x2c')][_0x4711('0x44')](_0x1cafa9)['then'](handleEntityNotFound(_0x241eb8,null))['then'](respondWithResult(_0x241eb8,null))[_0x4711('0x41')](handleError(_0x241eb8,null));};exports[_0x4711('0x45')]=function(_0x4627dc,_0x154c39){return db[_0x4711('0x2c')]['create'](_0x4627dc[_0x4711('0x46')],{})['then'](respondWithResult(_0x154c39,0xc9))[_0x4711('0x41')](handleError(_0x154c39,null));};exports['update']=function(_0x19a255,_0x45bf29){if(_0x19a255[_0x4711('0x46')]['id']){delete _0x19a255[_0x4711('0x46')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x19a255[_0x4711('0x42')]['id']}})[_0x4711('0x24')](handleEntityNotFound(_0x45bf29,null))[_0x4711('0x24')](saveUpdates(_0x19a255[_0x4711('0x46')],null))[_0x4711('0x24')](respondWithResult(_0x45bf29,null))[_0x4711('0x41')](handleError(_0x45bf29,null));};exports[_0x4711('0x47')]=function(_0x203a7a,_0x28dca6){return db[_0x4711('0x2c')][_0x4711('0x44')]({'where':{'id':_0x203a7a[_0x4711('0x42')]['id']}})[_0x4711('0x24')](handleEntityNotFound(_0x28dca6,null))[_0x4711('0x24')](removeEntity(_0x28dca6,null))[_0x4711('0x41')](handleError(_0x28dca6,null));};exports[_0x4711('0x48')]=function(_0x2b9e44,_0x3d2a68){return db['WhatsappTransferReport'][_0x4711('0x48')]()[_0x4711('0x24')](respondWithResult(_0x3d2a68,null))[_0x4711('0x41')](handleError(_0x3d2a68,null));}; \ No newline at end of file +var _0xb714=['name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','catch','show','includeAll','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','count','offset','limit','set','json','apply','reject','update','then'];(function(_0x2af8be,_0x2e8dff){var _0x4d2951=function(_0x3efb80){while(--_0x3efb80){_0x2af8be['push'](_0x2af8be['shift']());}};_0x4d2951(++_0x2e8dff);}(_0xb714,0xbe));var _0x4b71=function(_0x9f930a,_0x44051e){_0x9f930a=_0x9f930a-0x0;var _0x3fa0ce=_0xb714[_0x9f930a];return _0x3fa0ce;};'use strict';var pdf=require(_0x4b71('0x0'));var emlformat=require(_0x4b71('0x1'));var rimraf=require(_0x4b71('0x2'));var zipdir=require(_0x4b71('0x3'));var jsonpatch=require(_0x4b71('0x4'));var rp=require(_0x4b71('0x5'));var moment=require('moment');var BPromise=require(_0x4b71('0x6'));var Mustache=require(_0x4b71('0x7'));var util=require(_0x4b71('0x8'));var path=require(_0x4b71('0x9'));var sox=require(_0x4b71('0xa'));var csv=require(_0x4b71('0xb'));var ejs=require(_0x4b71('0xc'));var fs=require('fs');var _=require(_0x4b71('0xd'));var squel=require(_0x4b71('0xe'));var crypto=require(_0x4b71('0xf'));var jsforce=require(_0x4b71('0x10'));var deskjs=require(_0x4b71('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4b71('0x12'));var Papa=require(_0x4b71('0x13'));var Redis=require(_0x4b71('0x14'));var authService=require(_0x4b71('0x15'));var qs=require(_0x4b71('0x16'));var as=require(_0x4b71('0x17'));var hardwareService=require(_0x4b71('0x18'));var logger=require('../../config/logger')(_0x4b71('0x19'));var utils=require(_0x4b71('0x1a'));var config=require(_0x4b71('0x1b'));var db=require(_0x4b71('0x1c'))['db'];function respondWithStatusCode(_0x3c4c6b,_0x2d5723){_0x2d5723=_0x2d5723||0xcc;return function(_0x39859f){if(_0x39859f){return _0x3c4c6b[_0x4b71('0x1d')](_0x2d5723);}return _0x3c4c6b[_0x4b71('0x1e')](_0x2d5723)[_0x4b71('0x1f')]();};}function respondWithResult(_0xad791c,_0x4f69dc){_0x4f69dc=_0x4f69dc||0xc8;return function(_0xdcf5ba){if(_0xdcf5ba){return _0xad791c[_0x4b71('0x1e')](_0x4f69dc)['json'](_0xdcf5ba);}};}function respondWithFilteredResult(_0x43c0e4,_0x47dd07){return function(_0x174bde){if(_0x174bde){var _0x566159=_0x174bde[_0x4b71('0x20')],_0x39c5a2=_0x47dd07[_0x4b71('0x21')],_0x499a66=_0x47dd07[_0x4b71('0x21')]+_0x47dd07[_0x4b71('0x22')],_0x2cd6d3;if(_0x499a66>=_0x566159){_0x499a66=_0x566159;_0x2cd6d3=0xc8;}else{_0x2cd6d3=0xce;}_0x43c0e4[_0x4b71('0x1e')](_0x2cd6d3);return _0x43c0e4[_0x4b71('0x23')]('Content-Range',_0x39c5a2+'-'+_0x499a66+'/'+_0x566159)[_0x4b71('0x24')](_0x174bde);}return null;};}function patchUpdates(_0x5341e5){return function(_0x4db64c){try{jsonpatch[_0x4b71('0x25')](_0x4db64c,_0x5341e5,!![]);}catch(_0x479f57){return BPromise[_0x4b71('0x26')](_0x479f57);}return _0x4db64c['save']();};}function saveUpdates(_0x1174a9,_0x3f983e){return function(_0x5a4b50){if(_0x5a4b50){return _0x5a4b50[_0x4b71('0x27')](_0x1174a9)[_0x4b71('0x28')](function(_0x3df505){return _0x3df505;});}return null;};}function removeEntity(_0x1046bf,_0x264b94){return function(_0x29b717){if(_0x29b717){return _0x29b717['destroy']()['then'](function(){_0x1046bf[_0x4b71('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de9c3,_0x2f21be){return function(_0x1128d1){if(!_0x1128d1){_0x1de9c3[_0x4b71('0x1d')](0x194);}return _0x1128d1;};}function handleError(_0x2e13b0,_0x1f3a63){_0x1f3a63=_0x1f3a63||0x1f4;return function(_0x20f664){logger['error'](_0x20f664['stack']);if(_0x20f664['name']){delete _0x20f664[_0x4b71('0x29')];}_0x2e13b0[_0x4b71('0x1e')](_0x1f3a63)[_0x4b71('0x2a')](_0x20f664);};}exports[_0x4b71('0x2b')]=function(_0x559bda,_0x271bdb){var _0x3a5fda={},_0x3c9e4e={},_0x473472={'count':0x0,'rows':[]};var _0x163c18=_['map'](db[_0x4b71('0x2c')][_0x4b71('0x2d')],function(_0x53684d){return{'name':_0x53684d[_0x4b71('0x2e')],'type':_0x53684d[_0x4b71('0x2f')][_0x4b71('0x30')]};});_0x3c9e4e[_0x4b71('0x31')]=_[_0x4b71('0x32')](_0x163c18,_0x4b71('0x29'));_0x3c9e4e[_0x4b71('0x33')]=_[_0x4b71('0x34')](_0x559bda[_0x4b71('0x33')]);_0x3c9e4e['filters']=_[_0x4b71('0x35')](_0x3c9e4e[_0x4b71('0x31')],_0x3c9e4e['query']);_0x3a5fda[_0x4b71('0x36')]=_[_0x4b71('0x35')](_0x3c9e4e[_0x4b71('0x31')],qs[_0x4b71('0x37')](_0x559bda[_0x4b71('0x33')]['fields']));_0x3a5fda[_0x4b71('0x36')]=_0x3a5fda[_0x4b71('0x36')][_0x4b71('0x38')]?_0x3a5fda[_0x4b71('0x36')]:_0x3c9e4e['model'];if(!_0x559bda[_0x4b71('0x33')]['hasOwnProperty'](_0x4b71('0x39'))){_0x3a5fda[_0x4b71('0x22')]=qs[_0x4b71('0x22')](_0x559bda[_0x4b71('0x33')][_0x4b71('0x22')]);_0x3a5fda[_0x4b71('0x21')]=qs[_0x4b71('0x21')](_0x559bda[_0x4b71('0x33')][_0x4b71('0x21')]);}_0x3a5fda[_0x4b71('0x3a')]=qs[_0x4b71('0x3b')](_0x559bda[_0x4b71('0x33')][_0x4b71('0x3b')]);_0x3a5fda[_0x4b71('0x3c')]=qs[_0x4b71('0x3d')](_[_0x4b71('0x3e')](_0x559bda[_0x4b71('0x33')],_0x3c9e4e[_0x4b71('0x3d')]),_0x163c18);if(_0x559bda['query']['filter']){_0x3a5fda[_0x4b71('0x3c')]=_[_0x4b71('0x3f')](_0x3a5fda['where'],{'$or':_[_0x4b71('0x32')](_0x163c18,function(_0xc91e67){if(_0xc91e67[_0x4b71('0x2f')]!=='VIRTUAL'){var _0x2ebf8e={};_0x2ebf8e[_0xc91e67[_0x4b71('0x29')]]={'$like':'%'+_0x559bda[_0x4b71('0x33')][_0x4b71('0x40')]+'%'};return _0x2ebf8e;}})});}_0x3a5fda=_['merge']({},_0x3a5fda,_0x559bda[_0x4b71('0x41')]);var _0x4e1b98={'where':_0x3a5fda[_0x4b71('0x3c')]};return db[_0x4b71('0x2c')]['count'](_0x4e1b98)[_0x4b71('0x28')](function(_0x262c17){_0x473472[_0x4b71('0x20')]=_0x262c17;if(_0x559bda[_0x4b71('0x33')]['includeAll']){_0x3a5fda[_0x4b71('0x42')]=[{'all':!![]}];}return db[_0x4b71('0x2c')]['findAll'](_0x3a5fda);})[_0x4b71('0x28')](function(_0x15e82c){_0x473472[_0x4b71('0x43')]=_0x15e82c;return _0x473472;})[_0x4b71('0x28')](respondWithFilteredResult(_0x271bdb,_0x3a5fda))[_0x4b71('0x44')](handleError(_0x271bdb,null));};exports[_0x4b71('0x45')]=function(_0x12b9b4,_0x3936ea){var _0x559025={'raw':!![],'where':{'id':_0x12b9b4['params']['id']}},_0xcc7ff6={};_0xcc7ff6['model']=_[_0x4b71('0x34')](db['WhatsappTransferReport']['rawAttributes']);_0xcc7ff6['query']=_[_0x4b71('0x34')](_0x12b9b4['query']);_0xcc7ff6[_0x4b71('0x3d')]=_['intersection'](_0xcc7ff6[_0x4b71('0x31')],_0xcc7ff6['query']);_0x559025[_0x4b71('0x36')]=_[_0x4b71('0x35')](_0xcc7ff6[_0x4b71('0x31')],qs[_0x4b71('0x37')](_0x12b9b4[_0x4b71('0x33')][_0x4b71('0x37')]));_0x559025['attributes']=_0x559025[_0x4b71('0x36')][_0x4b71('0x38')]?_0x559025['attributes']:_0xcc7ff6[_0x4b71('0x31')];if(_0x12b9b4[_0x4b71('0x33')][_0x4b71('0x46')]){_0x559025[_0x4b71('0x42')]=[{'all':!![]}];}_0x559025=_[_0x4b71('0x3f')]({},_0x559025,_0x12b9b4['options']);return db[_0x4b71('0x2c')][_0x4b71('0x47')](_0x559025)['then'](handleEntityNotFound(_0x3936ea,null))[_0x4b71('0x28')](respondWithResult(_0x3936ea,null))[_0x4b71('0x44')](handleError(_0x3936ea,null));};exports[_0x4b71('0x48')]=function(_0x55fac4,_0x28f759){return db[_0x4b71('0x2c')][_0x4b71('0x48')](_0x55fac4[_0x4b71('0x49')],{})[_0x4b71('0x28')](respondWithResult(_0x28f759,0xc9))[_0x4b71('0x44')](handleError(_0x28f759,null));};exports[_0x4b71('0x27')]=function(_0x5e9c8f,_0x129713){if(_0x5e9c8f['body']['id']){delete _0x5e9c8f[_0x4b71('0x49')]['id'];}return db[_0x4b71('0x2c')][_0x4b71('0x47')]({'where':{'id':_0x5e9c8f[_0x4b71('0x4a')]['id']}})['then'](handleEntityNotFound(_0x129713,null))[_0x4b71('0x28')](saveUpdates(_0x5e9c8f[_0x4b71('0x49')],null))[_0x4b71('0x28')](respondWithResult(_0x129713,null))[_0x4b71('0x44')](handleError(_0x129713,null));};exports[_0x4b71('0x4b')]=function(_0x4dbe83,_0x77a1eb){return db[_0x4b71('0x2c')][_0x4b71('0x47')]({'where':{'id':_0x4dbe83[_0x4b71('0x4a')]['id']}})[_0x4b71('0x28')](handleEntityNotFound(_0x77a1eb,null))[_0x4b71('0x28')](removeEntity(_0x77a1eb,null))[_0x4b71('0x44')](handleError(_0x77a1eb,null));};exports[_0x4b71('0x4c')]=function(_0x4cafd6,_0x33be74){return db[_0x4b71('0x2c')]['describe']()[_0x4b71('0x28')](respondWithResult(_0x33be74,null))[_0x4b71('0x44')](handleError(_0x33be74,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b8b8468..289c4e6 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2bc=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x5b6b43,_0x5fd9d7){var _0x3ac8c4=function(_0x259629){while(--_0x259629){_0x5b6b43['push'](_0x5b6b43['shift']());}};_0x3ac8c4(++_0x5fd9d7);}(_0xe2bc,0x1ec));var _0xce2b=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xe2bc[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xce2b('0x0'));var util=require(_0xce2b('0x1'));var logger=require(_0xce2b('0x2'))('api');var moment=require(_0xce2b('0x3'));var BPromise=require(_0xce2b('0x4'));var rp=require(_0xce2b('0x5'));var fs=require('fs');var path=require(_0xce2b('0x6'));var rimraf=require(_0xce2b('0x7'));var config=require(_0xce2b('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x10f5eb,_0x1bb814){return _0x10f5eb[_0xce2b('0x9')](_0xce2b('0xa'),attributes,{'tableName':_0xce2b('0xb'),'paranoid':![],'indexes':[{'name':_0xce2b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a89=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappTransferReport'];(function(_0x239cd8,_0x2f70b8){var _0x174e98=function(_0x157826){while(--_0x157826){_0x239cd8['push'](_0x239cd8['shift']());}};_0x174e98(++_0x2f70b8);}(_0x5a89,0xfe));var _0x95a8=function(_0x5d8dd1,_0x2b2069){_0x5d8dd1=_0x5d8dd1-0x0;var _0x189342=_0x5a89[_0x5d8dd1];return _0x189342;};'use strict';var _=require(_0x95a8('0x0'));var util=require(_0x95a8('0x1'));var logger=require(_0x95a8('0x2'))(_0x95a8('0x3'));var moment=require(_0x95a8('0x4'));var BPromise=require(_0x95a8('0x5'));var rp=require(_0x95a8('0x6'));var fs=require('fs');var path=require(_0x95a8('0x7'));var rimraf=require(_0x95a8('0x8'));var config=require(_0x95a8('0x9'));var attributes=require('./whatsappTransferReport.attributes');module[_0x95a8('0xa')]=function(_0x3c1f21,_0x30d047){return _0x3c1f21['define'](_0x95a8('0xb'),attributes,{'tableName':_0x95a8('0xc'),'paranoid':![],'indexes':[{'name':_0x95a8('0xd'),'fields':[_0x95a8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 6cf8d1f..7f29741 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x49c24b,_0x227abe){var _0x385b6d=function(_0x4b3a95){while(--_0x4b3a95){_0x49c24b['push'](_0x49c24b['shift']());}};_0x385b6d(++_0x227abe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x426b34,_0x18adcb){var _0x5cfbf9=function(_0x43cc83){while(--_0x43cc83){_0x426b34['push'](_0x426b34['shift']());}};_0x5cfbf9(++_0x18adcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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/app.js b/server/app.js index d2c2bed..2f9d410 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe22c=['listen','info','start','Online\x20apps:','map','name','join','filter','status','online','None','seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','then'];(function(_0x1eb66e,_0x18d805){var _0x2b198d=function(_0x5a1bb9){while(--_0x5a1bb9){_0x1eb66e['push'](_0x1eb66e['shift']());}};_0x2b198d(++_0x18d805);}(_0xe22c,0x102));var _0xce22=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe22c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xce22('0x0'));var mysqldb=require(_0xce22('0x1'));var rpc=require('./rpc');var config=require(_0xce22('0x2'));var logger=require(_0xce22('0x3'))(_0xce22('0x4'));var pm2=require(_0xce22('0x5'));var pm2Config=require(_0xce22('0x6'));var schedule=require(_0xce22('0x7'));var chat=require(_0xce22('0x8'));var transcribe=require(_0xce22('0x9'));function main(){return mysqldb['db'][_0xce22('0xa')]['sync']()[_0xce22('0xb')](function(){return rpc[_0xce22('0xc')]();})[_0xce22('0xb')](function(_0x4e8120){logger[_0xce22('0xd')](_0x4e8120);return chat[_0xce22('0xe')]();})[_0xce22('0xb')](function(){return schedule[_0xce22('0xe')]();})[_0xce22('0xb')](function(){return transcribe[_0xce22('0xe')]();})[_0xce22('0xb')](function(_0x321c37){logger[_0xce22('0xd')](_0x321c37);return pm2[_0xce22('0xe')](pm2Config);})[_0xce22('0xb')](function(_0x2e6380){logger['info'](_0xce22('0xf'),_[_0xce22('0x10')](_['filter'](_0x2e6380,{'status':'online'}),_0xce22('0x11'))[_0xce22('0x12')]());logger[_0xce22('0xd')]('Offline\x20apps:',_[_0xce22('0x10')](_[_0xce22('0x13')](_0x2e6380,function(_0x25f8bd){return _0x25f8bd[_0xce22('0x14')]!==_0xce22('0x15');}),_0xce22('0x11'))[_0xce22('0x12')]()||_0xce22('0x16'));config[_0xce22('0x17')]&&require('./config/seedDB')['default']();require('./config/license')[_0xce22('0x18')]();})[_0xce22('0x19')](function(_0x1b572a){logger['error'](_0xce22('0x1a'),_0x1b572a);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x9770=['None','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','online','join','Offline\x20apps:','filter','status'];(function(_0x3130fb,_0x1fbf23){var _0x2ba85b=function(_0x48aa2d){while(--_0x48aa2d){_0x3130fb['push'](_0x3130fb['shift']());}};_0x2ba85b(++_0x1fbf23);}(_0x9770,0xd5));var _0x0977=function(_0x9f76ed,_0x6fced9){_0x9f76ed=_0x9f76ed-0x0;var _0x593e29=_0x9770[_0x9f76ed];return _0x593e29;};'use strict';var _=require(_0x0977('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x0977('0x1'));var logger=require(_0x0977('0x2'))(_0x0977('0x3'));var pm2=require(_0x0977('0x4'));var pm2Config=require(_0x0977('0x5'));var schedule=require('./config/schedule');var chat=require(_0x0977('0x6'));var transcribe=require(_0x0977('0x7'));function main(){return mysqldb['db'][_0x0977('0x8')][_0x0977('0x9')]()[_0x0977('0xa')](function(){return rpc[_0x0977('0xb')]();})[_0x0977('0xa')](function(_0x143ab6){logger[_0x0977('0xc')](_0x143ab6);return chat[_0x0977('0xd')]();})[_0x0977('0xa')](function(){return schedule[_0x0977('0xd')]();})[_0x0977('0xa')](function(){return transcribe['start']();})[_0x0977('0xa')](function(_0x5c2a5c){logger[_0x0977('0xc')](_0x5c2a5c);return pm2[_0x0977('0xd')](pm2Config);})[_0x0977('0xa')](function(_0x38c08c){logger[_0x0977('0xc')](_0x0977('0xe'),_[_0x0977('0xf')](_['filter'](_0x38c08c,{'status':_0x0977('0x10')}),'name')[_0x0977('0x11')]());logger[_0x0977('0xc')](_0x0977('0x12'),_[_0x0977('0xf')](_[_0x0977('0x13')](_0x38c08c,function(_0x34a938){return _0x34a938[_0x0977('0x14')]!==_0x0977('0x10');}),'name')[_0x0977('0x11')]()||_0x0977('0x15'));config['seedDB']&&require('./config/seedDB')['default']();require('./config/license')[_0x0977('0x16')]();})[_0x0977('0x17')](function(_0x4fd27f){logger['error'](_0x0977('0x18'),_0x4fd27f);process[_0x0977('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index bda8094..eb5fb37 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 _0xa930=['signToken','setTokenCookie','motion.token','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','bluebird','secrets','session','role','fullname','name','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','status','disposition','json','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','User','find','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware'];(function(_0x6ae11,_0x545fae){var _0x480623=function(_0xfd865f){while(--_0xfd865f){_0x6ae11['push'](_0x6ae11['shift']());}};_0x480623(++_0x545fae);}(_0xa930,0x73));var _0x0a93=function(_0x4e4e28,_0x346cd1){_0x4e4e28=_0x4e4e28-0x0;var _0x3bfeff=_0xa930[_0x4e4e28];return _0x3bfeff;};'use strict';var db=require(_0x0a93('0x0'))['db'];var config=require(_0x0a93('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0x0a93('0x2'));var jwt=require(_0x0a93('0x3'));var expressJwt=require(_0x0a93('0x4'));var compose=require(_0x0a93('0x5'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0x0a93('0x6'));var validateJwt=expressJwt({'secret':config[_0x0a93('0x7')][_0x0a93('0x8')]});var userAttributes=['id',_0x0a93('0x9'),_0x0a93('0xa'),_0x0a93('0xb'),_0x0a93('0xc'),_0x0a93('0xd'),_0x0a93('0xe'),'permissions','md5secret',_0x0a93('0xf'),_0x0a93('0x10'),_0x0a93('0x11'),_0x0a93('0x12'),_0x0a93('0x13'),_0x0a93('0x14'),_0x0a93('0x15'),_0x0a93('0x16'),_0x0a93('0x17'),'lastPauseAt',_0x0a93('0x18'),_0x0a93('0x19'),_0x0a93('0x1a'),_0x0a93('0x1b'),_0x0a93('0x1c'),_0x0a93('0x1d'),_0x0a93('0x1e'),'phoneBarEnableRecording',_0x0a93('0x1f'),_0x0a93('0x20'),'phoneBarExpires',_0x0a93('0x21'),_0x0a93('0x22'),_0x0a93('0x23'),_0x0a93('0x24'),_0x0a93('0x25'),_0x0a93('0x26')];exports['isChatInteractionAuthorized']=function(){return this[_0x0a93('0x27')](!![])[_0x0a93('0x28')](function(_0x3c40c8,_0x27d5fe,_0x4d54b5){if(_0x3c40c8[_0x0a93('0x29')]){_0x4d54b5();}else{return db[_0x0a93('0x2a')][_0x0a93('0x2b')]({'where':{'id':_0x3c40c8[_0x0a93('0x2c')]['id']},'attributes':['id',_0x0a93('0x2d'),'disposition'],'raw':!![]})[_0x0a93('0x2e')](function(_0x4d2804){if(_0x4d2804&&_0x4d2804[_0x0a93('0x2d')]){return _0x27d5fe[_0x0a93('0x2f')](_0x4d2804[_0x0a93('0x30')]==='unmanaged'?0x195:0x193)[_0x0a93('0x31')]({'message':_0x4d2804[_0x0a93('0x30')]==='unmanaged'?_0x0a93('0x32'):_0x0a93('0x33')});}else{_0x4d54b5();}})[_0x0a93('0x34')](function(_0x42a848){_0x4d54b5(_0x42a848);});}});};exports['isAuthenticated']=function isAuthenticated(_0x52b863){return compose()['use'](function(_0x1ce96d,_0x5793e4,_0x1aa301){if(_0x1ce96d[_0x0a93('0x35')][_0x0a93('0x36')]){if(_['startsWith'](_0x1ce96d['headers'][_0x0a93('0x36')],_0x0a93('0x37'))){var _0x209161=basicAuth(_0x1ce96d);db[_0x0a93('0x38')][_0x0a93('0x39')]({'where':{'name':_0x209161[_0x0a93('0xb')]}})[_0x0a93('0x2e')](function(_0x3d9af6){if(!_0x3d9af6||!_0x3d9af6[_0x0a93('0x3a')](_0x209161[_0x0a93('0x3b')])){return _0x5793e4[_0x0a93('0x2f')](0x191)['json']({'message':_0x0a93('0x3c')});}_0x1ce96d[_0x0a93('0x29')]={'id':_0x3d9af6['id']};_0x1aa301();})[_0x0a93('0x34')](function(_0x36b9af){_0x1aa301(_0x36b9af);});}else if(_[_0x0a93('0x3d')](_0x1ce96d[_0x0a93('0x35')][_0x0a93('0x36')],_0x0a93('0x3e'))){validateJwt(_0x1ce96d,_0x5793e4,_0x1aa301);}else{if(_0x52b863){_0x1aa301();}else{return _0x5793e4[_0x0a93('0x2f')](0x193)[_0x0a93('0x31')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1ce96d[_0x0a93('0x3f')][_0x0a93('0x40')]){try{var _0x57fe60={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x0a93('0x41')]()};verifyJwt(_0x1ce96d[_0x0a93('0x3f')][_0x0a93('0x40')],_0x57fe60)[_0x0a93('0x2e')](function(_0x2eaa53){return db[_0x0a93('0x38')][_0x0a93('0x39')]({'where':{'id':_0x2eaa53['sub']}})[_0x0a93('0x2e')](function(_0x11f04d){if(!_0x11f04d||!_['isEqual'](_0x11f04d[_0x0a93('0x42')],_0x2eaa53[_0x0a93('0x43')])){return _0x5793e4['status'](0x191)[_0x0a93('0x31')]({'message':_0x0a93('0x44')});}_0x1ce96d[_0x0a93('0x29')]={'id':_0x11f04d['id']};_0x1aa301();});})[_0x0a93('0x34')](function(){return _0x5793e4['status'](0x191)[_0x0a93('0x31')]({'message':_0x0a93('0x45')});});}catch(_0x230968){_0x1aa301(_0x230968);}}else if(_0x52b863){_0x1aa301();}else{return _0x5793e4['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x0a93('0x28')](function(_0x31cc2c,_0x20b391,_0x108e78){if(_0x31cc2c[_0x0a93('0x29')]){db[_0x0a93('0x38')][_0x0a93('0x39')]({'where':{'id':_0x31cc2c[_0x0a93('0x29')]['id']},'attributes':userAttributes})[_0x0a93('0x2e')](function(_0x512b5f){if(!_0x512b5f){return _0x20b391[_0x0a93('0x2f')](0x194)[_0x0a93('0x31')]({'message':'User\x20not\x20found.'});}_0x31cc2c[_0x0a93('0x29')]=_0x512b5f;_0x108e78();})[_0x0a93('0x34')](function(_0x4e445c){_0x108e78(_0x4e445c);});}else if(_0x52b863){_0x108e78();}else{return _0x20b391[_0x0a93('0x2f')](0x194)[_0x0a93('0x31')]({'message':_0x0a93('0x46')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x0a93('0x28')](function(_0x4d598e,_0x238738,_0x4911f0){return require('../../config/license/util')[_0x0a93('0x47')]()[_0x0a93('0x2e')](function(_0x48c080){if(_0x48c080[_0x0a93('0x48')]){_0x4911f0();}else{return _0x238738['status'](0x193)['json']({'message':_0x0a93('0x49')});}})[_0x0a93('0x34')](function(_0x1ef1e9){_0x4911f0(_0x1ef1e9);});});};exports[_0x0a93('0x4a')]=function(_0xbfa6fc,_0x432a49,_0x7424fe){_0xbfa6fc['isMiddleware']=!![];return _0x7424fe();};exports[_0x0a93('0x4b')]=function signToken(_0x6c8c9f){return signJwt(_0x6c8c9f);};exports[_0x0a93('0x4c')]=function(_0x3d3a62,_0xb01a9b){if(!_0x3d3a62[_0x0a93('0x29')]){return _0xb01a9b[_0x0a93('0x2f')](0x194)[_0x0a93('0x31')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3fd4a3={'payload':{'id':_0x3d3a62['user']['id'],'role':_0x3d3a62[_0x0a93('0x29')][_0x0a93('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd4a3)[_0x0a93('0x2e')](function(_0x56d840){_0xb01a9b['cookie'](_0x0a93('0x4d'),_0x56d840);_0xb01a9b['redirect'](_0x0a93('0x4e'));})[_0x0a93('0x34')](function(_0x34bc82){return _0xb01a9b['status'](0x1f4)[_0x0a93('0x4f')](_0x34bc82);});};exports['retrieveApiKey']=function(_0x4a6ded){if(_[_0x0a93('0x50')](_0x4a6ded['apiKeyNonce'])||_[_0x0a93('0x50')](_0x4a6ded[_0x0a93('0x51')])){return null;}else{return createJwt(_0x4a6ded);}};exports[_0x0a93('0x52')]=function(_0x34df0b){_0x34df0b[_0x0a93('0x42')]=generateNonce();_0x34df0b[_0x0a93('0x51')]=generateIssuedAt();return createJwt(_0x34df0b);};exports[_0x0a93('0x53')]=function(_0x592cd6,_0x3c031f){var _0x20d222=_0x592cd6[_0x0a93('0x3f')][_0x0a93('0x40')];if(_0x20d222){var _0x24c9e7={'nonce':_0x3c031f[_0x0a93('0x42')],'iat':_0x3c031f['apiKeyIat'],'audience':hardwareConf[_0x0a93('0x41')](),'issuer':hardwareConf[_0x0a93('0x41')]()};return verifyJwt(_0x20d222,_0x24c9e7)[_0x0a93('0x2e')](function(){return generateApiKey(_0x3c031f);});}else{throw{'message':_0x0a93('0x54')};}};function signJwt(_0x3f573d){var _0x5a0018=BPromise[_0x0a93('0x55')](jwt[_0x0a93('0x56')],{'context':jwt});var _0x4d7db5=_0x3f573d[_0x0a93('0x57')]||config[_0x0a93('0x7')][_0x0a93('0x8')];return new BPromise(function(_0x325486,_0x34f55b){_0x5a0018(_0x3f573d['payload'],_0x4d7db5,_0x3f573d[_0x0a93('0x58')])[_0x0a93('0x2e')](function(_0x1ff430){_0x325486(_0x1ff430);})[_0x0a93('0x34')](function(_0x1c405f){_0x34f55b(_0x1c405f);});});}function verifyJwt(_0x488fca,_0x5f38dd,_0x3192c4){var _0x5e9af2=BPromise['promisify'](jwt[_0x0a93('0x59')],{'context':jwt});var _0x22a5bb=_0x3192c4||config[_0x0a93('0x7')][_0x0a93('0x8')];return new BPromise(function(_0x2fb871,_0x4f4af9){_0x5e9af2(_0x488fca,_0x22a5bb,_0x5f38dd)[_0x0a93('0x2e')](function(_0x3b0ccc){_0x2fb871(_0x3b0ccc);})[_0x0a93('0x34')](function(_0x34ebbc){_0x4f4af9(_0x34ebbc);});});}function generateNonce(){return crypto[_0x0a93('0x5a')](0x10)[_0x0a93('0x5b')](_0x0a93('0x5c'));}function generateIssuedAt(){return Math[_0x0a93('0x5d')](Date[_0x0a93('0x5e')]()/0x3e8)[_0x0a93('0x5b')]();}function createJwt(_0x2b6f68){var _0x110fd6={'payload':{'iat':_0x2b6f68[_0x0a93('0x51')],'nonce':_0x2b6f68[_0x0a93('0x42')]},'options':{'algorithm':'HS512','subject':_0x2b6f68['id']['toString'](),'issuer':hardwareConf[_0x0a93('0x41')](),'audience':hardwareConf[_0x0a93('0x41')]()}};return signJwt(_0x110fd6)[_0x0a93('0x2e')](function(_0x542062){return{'iat':_0x2b6f68[_0x0a93('0x51')],'nonce':_0x2b6f68[_0x0a93('0x42')],'token':_0x542062};});} \ No newline at end of file +var _0x07bc=['phoneBarEnableRecording','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','Unknown\x20authorization\x20format','query','apikey','getUuid','find','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','payload','options','randomBytes','toString','hex','now','HS512','../../config/environment','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','session','role','name','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x07bc,0x15c));var _0xc07b=function(_0x5d55ab,_0x13689d){_0x5d55ab=_0x5d55ab-0x0;var _0x47d219=_0x07bc[_0x5d55ab];return _0x47d219;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xc07b('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xc07b('0x1'));var jwt=require(_0xc07b('0x2'));var expressJwt=require(_0xc07b('0x3'));var compose=require('composable-middleware');var basicAuth=require(_0xc07b('0x4'));var crypto=require(_0xc07b('0x5'));var BPromise=require(_0xc07b('0x6'));var validateJwt=expressJwt({'secret':config[_0xc07b('0x7')][_0xc07b('0x8')]});var userAttributes=['id',_0xc07b('0x9'),'fullname',_0xc07b('0xa'),_0xc07b('0xb'),_0xc07b('0xc'),'userpic','permissions',_0xc07b('0xd'),_0xc07b('0xe'),_0xc07b('0xf'),_0xc07b('0x10'),_0xc07b('0x11'),_0xc07b('0x12'),_0xc07b('0x13'),_0xc07b('0x14'),_0xc07b('0x15'),_0xc07b('0x16'),_0xc07b('0x17'),'crudPermissions',_0xc07b('0x18'),'passwordResetAt',_0xc07b('0x19'),_0xc07b('0x1a'),_0xc07b('0x1b'),'phoneBarDnd',_0xc07b('0x1c'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0xc07b('0x1d'),'phoneBarPrefixRequired',_0xc07b('0x1e'),_0xc07b('0x1f'),'hotdesk',_0xc07b('0x20'),_0xc07b('0x21')];exports[_0xc07b('0x22')]=function(){return this[_0xc07b('0x23')](!![])[_0xc07b('0x24')](function(_0x63af0d,_0x575afc,_0x4de77d){if(_0x63af0d[_0xc07b('0x25')]){_0x4de77d();}else{return db[_0xc07b('0x26')][_0xc07b('0x27')]({'where':{'id':_0x63af0d[_0xc07b('0x28')]['id']},'attributes':['id',_0xc07b('0x29'),'disposition'],'raw':!![]})[_0xc07b('0x2a')](function(_0x2168ce){if(_0x2168ce&&_0x2168ce[_0xc07b('0x29')]){return _0x575afc[_0xc07b('0x2b')](_0x2168ce['disposition']===_0xc07b('0x2c')?0x195:0x193)[_0xc07b('0x2d')]({'message':_0x2168ce[_0xc07b('0x2e')]===_0xc07b('0x2c')?_0xc07b('0x2f'):_0xc07b('0x30')});}else{_0x4de77d();}})[_0xc07b('0x31')](function(_0x1cb2c6){_0x4de77d(_0x1cb2c6);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2487df){return compose()[_0xc07b('0x24')](function(_0x1e3016,_0x562023,_0x544be9){if(_0x1e3016[_0xc07b('0x32')][_0xc07b('0x33')]){if(_[_0xc07b('0x34')](_0x1e3016[_0xc07b('0x32')]['authorization'],_0xc07b('0x35'))){var _0x59b11a=basicAuth(_0x1e3016);db[_0xc07b('0x36')]['find']({'where':{'name':_0x59b11a[_0xc07b('0xa')]}})[_0xc07b('0x2a')](function(_0x58638b){if(!_0x58638b||!_0x58638b[_0xc07b('0x37')](_0x59b11a['pass'])){return _0x562023[_0xc07b('0x2b')](0x191)[_0xc07b('0x2d')]({'message':'Wrong\x20credentials.'});}_0x1e3016['user']={'id':_0x58638b['id']};_0x544be9();})[_0xc07b('0x31')](function(_0x577a38){_0x544be9(_0x577a38);});}else if(_[_0xc07b('0x34')](_0x1e3016[_0xc07b('0x32')]['authorization'],'Bearer')){validateJwt(_0x1e3016,_0x562023,_0x544be9);}else{if(_0x2487df){_0x544be9();}else{return _0x562023[_0xc07b('0x2b')](0x193)[_0xc07b('0x2d')]({'message':_0xc07b('0x38')});}}}else if(_0x1e3016[_0xc07b('0x39')][_0xc07b('0x3a')]){try{var _0x1d9a57={'audience':hardwareConf[_0xc07b('0x3b')](),'issuer':hardwareConf[_0xc07b('0x3b')]()};verifyJwt(_0x1e3016[_0xc07b('0x39')][_0xc07b('0x3a')],_0x1d9a57)[_0xc07b('0x2a')](function(_0x22646b){return db[_0xc07b('0x36')][_0xc07b('0x3c')]({'where':{'id':_0x22646b['sub']}})[_0xc07b('0x2a')](function(_0x3e158a){if(!_0x3e158a||!_['isEqual'](_0x3e158a[_0xc07b('0x3d')],_0x22646b[_0xc07b('0x3e')])){return _0x562023[_0xc07b('0x2b')](0x191)[_0xc07b('0x2d')]({'message':_0xc07b('0x3f')});}_0x1e3016['user']={'id':_0x3e158a['id']};_0x544be9();});})['catch'](function(){return _0x562023[_0xc07b('0x2b')](0x191)[_0xc07b('0x2d')]({'message':_0xc07b('0x40')});});}catch(_0x3fe1ca){_0x544be9(_0x3fe1ca);}}else if(_0x2487df){_0x544be9();}else{return _0x562023[_0xc07b('0x2b')](0x193)[_0xc07b('0x2d')]({'message':_0xc07b('0x38')});}})[_0xc07b('0x24')](function(_0x2d2f36,_0x105b59,_0x35dd61){if(_0x2d2f36[_0xc07b('0x25')]){db[_0xc07b('0x36')]['find']({'where':{'id':_0x2d2f36[_0xc07b('0x25')]['id']},'attributes':userAttributes})['then'](function(_0x2e43ca){if(!_0x2e43ca){return _0x105b59['status'](0x194)[_0xc07b('0x2d')]({'message':_0xc07b('0x41')});}_0x2d2f36[_0xc07b('0x25')]=_0x2e43ca;_0x35dd61();})[_0xc07b('0x31')](function(_0x4a4c71){_0x35dd61(_0x4a4c71);});}else if(_0x2487df){_0x35dd61();}else{return _0x105b59[_0xc07b('0x2b')](0x194)[_0xc07b('0x2d')]({'message':_0xc07b('0x42')});}});};exports[_0xc07b('0x43')]=function canUpdate(){return compose()['use'](function(_0x27ee36,_0x51c524,_0x3c1969){return require(_0xc07b('0x44'))[_0xc07b('0x45')]()[_0xc07b('0x2a')](function(_0x36034b){if(_0x36034b[_0xc07b('0x46')]){_0x3c1969();}else{return _0x51c524[_0xc07b('0x2b')](0x193)[_0xc07b('0x2d')]({'message':_0xc07b('0x47')});}})['catch'](function(_0x1085b3){_0x3c1969(_0x1085b3);});});};exports[_0xc07b('0x48')]=function(_0x199887,_0x4be6ae,_0xaa0149){_0x199887['isMiddleware']=!![];return _0xaa0149();};exports[_0xc07b('0x49')]=function signToken(_0x185c94){return signJwt(_0x185c94);};exports[_0xc07b('0x4a')]=function(_0x2c9165,_0x57537e){if(!_0x2c9165[_0xc07b('0x25')]){return _0x57537e[_0xc07b('0x2b')](0x194)[_0xc07b('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3b19af={'payload':{'id':_0x2c9165[_0xc07b('0x25')]['id'],'role':_0x2c9165['user'][_0xc07b('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3b19af)[_0xc07b('0x2a')](function(_0x7f1d91){_0x57537e[_0xc07b('0x4b')]('motion.token',_0x7f1d91);_0x57537e[_0xc07b('0x4c')](_0xc07b('0x4d'));})['catch'](function(_0x17fcd6){return _0x57537e[_0xc07b('0x2b')](0x1f4)[_0xc07b('0x4e')](_0x17fcd6);});};exports[_0xc07b('0x4f')]=function(_0x5b9ae5){if(_[_0xc07b('0x50')](_0x5b9ae5['apiKeyNonce'])||_[_0xc07b('0x50')](_0x5b9ae5['apiKeyIat'])){return null;}else{return createJwt(_0x5b9ae5);}};exports[_0xc07b('0x51')]=function(_0x5eca9d){_0x5eca9d[_0xc07b('0x3d')]=generateNonce();_0x5eca9d[_0xc07b('0x52')]=generateIssuedAt();return createJwt(_0x5eca9d);};exports[_0xc07b('0x53')]=function(_0x23e582,_0x13dd51){var _0x1db00c=_0x23e582[_0xc07b('0x39')][_0xc07b('0x3a')];if(_0x1db00c){var _0x3f67e9={'nonce':_0x13dd51[_0xc07b('0x3d')],'iat':_0x13dd51[_0xc07b('0x52')],'audience':hardwareConf[_0xc07b('0x3b')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x1db00c,_0x3f67e9)['then'](function(){return generateApiKey(_0x13dd51);});}else{throw{'message':_0xc07b('0x54')};}};function signJwt(_0x57a680){var _0x1af57e=BPromise[_0xc07b('0x55')](jwt['sign'],{'context':jwt});var _0x4af947=_0x57a680[_0xc07b('0x56')]||config[_0xc07b('0x7')][_0xc07b('0x8')];return new BPromise(function(_0x2f1d2f,_0x4da627){_0x1af57e(_0x57a680[_0xc07b('0x57')],_0x4af947,_0x57a680[_0xc07b('0x58')])[_0xc07b('0x2a')](function(_0x6953b9){_0x2f1d2f(_0x6953b9);})['catch'](function(_0xdecb1a){_0x4da627(_0xdecb1a);});});}function verifyJwt(_0x22ddf1,_0x347276,_0xa21e2){var _0x33a663=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x29570d=_0xa21e2||config[_0xc07b('0x7')][_0xc07b('0x8')];return new BPromise(function(_0x51e65c,_0x2920d1){_0x33a663(_0x22ddf1,_0x29570d,_0x347276)[_0xc07b('0x2a')](function(_0x4c980c){_0x51e65c(_0x4c980c);})['catch'](function(_0x11099f){_0x2920d1(_0x11099f);});});}function generateNonce(){return crypto[_0xc07b('0x59')](0x10)[_0xc07b('0x5a')](_0xc07b('0x5b'));}function generateIssuedAt(){return Math['floor'](Date[_0xc07b('0x5c')]()/0x3e8)[_0xc07b('0x5a')]();}function createJwt(_0x223363){var _0x13d702={'payload':{'iat':_0x223363[_0xc07b('0x52')],'nonce':_0x223363[_0xc07b('0x3d')]},'options':{'algorithm':_0xc07b('0x5d'),'subject':_0x223363['id'][_0xc07b('0x5a')](),'issuer':hardwareConf[_0xc07b('0x3b')](),'audience':hardwareConf[_0xc07b('0x3b')]()}};return signJwt(_0x13d702)[_0xc07b('0x2a')](function(_0x310c18){return{'iat':_0x223363[_0xc07b('0x52')],'nonce':_0x223363['apiKeyNonce'],'token':_0x310c18};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 73bd874..e9a45c3 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 _0xcb91=['unlink','createReadStream','createWriteStream','createDecipher','update','aes192','hasOwnProperty','createCipher','algorithm','data','binary','write','end','final','close'];(function(_0xea4838,_0x3d802e){var _0xda5fe5=function(_0x13f122){while(--_0x13f122){_0xea4838['push'](_0xea4838['shift']());}};_0xda5fe5(++_0x3d802e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1de4b8,_0x529b41){_0x1de4b8=_0x1de4b8-0x0;var _0x557699=_0xcb91[_0x1de4b8];return _0x557699;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x1cb9('0x0')};function combineOptions(_0xe4a5bf){var _0x17d4ec={};for(var _0x22c4b8 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x22c4b8)){_0x17d4ec[_0x22c4b8]=defaultOptions[_0x22c4b8];}}if(_0xe4a5bf){for(var _0x8c392f in _0xe4a5bf){if(_0xe4a5bf[_0x1cb9('0x1')](_0x8c392f)){_0x17d4ec[_0x8c392f]=_0xe4a5bf[_0x8c392f];}}}return _0x17d4ec;}exports['encryptFile']=function(_0x13d5fd,_0x1b26cd,_0x53ffbd,_0x226b69){return new BPromise(function(_0x3f7deb,_0x4ffe20){_0x226b69=combineOptions(_0x226b69);var _0x38737d=new Buffer(_0x53ffbd);var _0x12567c=fs['createReadStream'](_0x13d5fd);var _0x3ae0f1=fs['createWriteStream'](_0x1b26cd);var _0x567139=crypto[_0x1cb9('0x2')](_0x226b69[_0x1cb9('0x3')],_0x38737d);_0x12567c['on'](_0x1cb9('0x4'),function(_0x1f0eca){var _0x2fc627=new Buffer(_0x567139['update'](_0x1f0eca),_0x1cb9('0x5'));_0x3ae0f1[_0x1cb9('0x6')](_0x2fc627);});_0x12567c['on'](_0x1cb9('0x7'),function(){try{var _0x3fdd83=new Buffer(_0x567139[_0x1cb9('0x8')]('binary'),'binary');_0x3ae0f1['write'](_0x3fdd83);_0x3ae0f1[_0x1cb9('0x7')]();_0x3ae0f1['on'](_0x1cb9('0x9'),function(){return _0x3f7deb(_0x1b26cd);});}catch(_0x384496){fs[_0x1cb9('0xa')](_0x1b26cd);return _0x4ffe20(_0x384496);}});});};exports['decryptFile']=function(_0x397727,_0x6ef389,_0x1b3cd7,_0x8dfa55){return new BPromise(function(_0x3e2d11,_0x5806d8){_0x8dfa55=combineOptions(_0x8dfa55);var _0x5572cb=new Buffer(_0x1b3cd7);var _0xd446a3=fs[_0x1cb9('0xb')](_0x397727);var _0x3904b7=fs[_0x1cb9('0xc')](_0x6ef389);var _0x3e21e0=crypto[_0x1cb9('0xd')](_0x8dfa55[_0x1cb9('0x3')],_0x5572cb);_0xd446a3['on']('data',function(_0x479d43){var _0x1b2fa6=new Buffer(_0x3e21e0[_0x1cb9('0xe')](_0x479d43),_0x1cb9('0x5'));_0x3904b7[_0x1cb9('0x6')](_0x1b2fa6);});_0xd446a3['on'](_0x1cb9('0x7'),function(){try{var _0x4014de=new Buffer(_0x3e21e0[_0x1cb9('0x8')]('binary'),'binary');_0x3904b7[_0x1cb9('0x6')](_0x4014de);_0x3904b7['end']();_0x3904b7['on'](_0x1cb9('0x9'),function(){return _0x3e2d11(_0x6ef389);});}catch(_0x2265ea){fs['unlink'](_0x6ef389);return _0x5806d8(_0x2265ea);}});});}; \ No newline at end of file +var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0xb0c2ac,_0x23c68a){var _0x5e726d=function(_0x1a7b5d){while(--_0x1a7b5d){_0xb0c2ac['push'](_0xb0c2ac['shift']());}};_0x5e726d(++_0x23c68a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 2a281e1..2063e45 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 _0xb903=['each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','inspect','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','query','sequelize','QueryTypes','num','Empty','push','format','SELECT','dirname','basename','length','existsSync','join'];(function(_0x477a47,_0x3fbbc1){var _0x41657a=function(_0x4abe4c){while(--_0x4abe4c){_0x477a47['push'](_0x477a47['shift']());}};_0x41657a(++_0x3fbbc1);}(_0xb903,0x185));var _0x3b90=function(_0x2f847f,_0x171405){_0x2f847f=_0x2f847f-0x0;var _0x456b8e=_0xb903[_0x2f847f];return _0x456b8e;};'use strict';var util=require(_0x3b90('0x0'));var path=require(_0x3b90('0x1'));var _=require(_0x3b90('0x2'));var csv=require(_0x3b90('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x3b90('0x4'));var rimraf=require(_0x3b90('0x5'));var db=require(_0x3b90('0x6'))['db'];var dbH=require(_0x3b90('0x6'))[_0x3b90('0x7')];var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3b90('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x55792c,_0x153283){var _0x2e4c06={'status':_0x55792c};var _0x42efe8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x153283){_0x2e4c06[_0x3b90('0xb')]=_0x153283;}return db['AnalyticExtractedReport']['update'](_0x2e4c06,_0x42efe8);}function main(){var _0x52401e=0x1388;var _0x51f916;logger['info'](util['format'](_0x3b90('0xc'),EXTRACTED_REPORT_ID,_0x3b90('0xd')));return db['Setting'][_0x3b90('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3b90('0xf'),'splitSizeCsv']})[_0x3b90('0x10')](function(_0x174c0d){if(_0x174c0d){_0x51f916=_0x174c0d;_0x52401e=_0x51f916[_0x3b90('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x3b90('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')]['SELECT']});})['then'](function(_0x3725b9){if(!_0x3725b9[0x0][_0x3b90('0x15')]){return analyticExtractedReport(_0x3b90('0x16'));}var _0x1af265=[];var _0x1efe01=0x0;var _0x529421=!![];if(_0x3725b9&&_0x3725b9['length']){var _0xd83280=_0x3725b9[0x0][_0x3b90('0x15')]%(_0x1efe01+_0x52401e);if(_0x51f916['split']){for(;_0x529421;_0x1efe01+=_0x52401e,_0xd83280=_0x3725b9[0x0][_0x3b90('0x15')]%(_0x1efe01+_0x52401e)){if(_0xd83280==0x0||_0xd83280==_0x3725b9[0x0][_0x3b90('0x15')]){_0x529421=![];}_0x1af265[_0x3b90('0x17')](dbH[_0x3b90('0x13')]['query'](util[_0x3b90('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x52401e,_0x1efe01),{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')]['SELECT']}));}}else{_0x1af265[_0x3b90('0x17')](dbH[_0x3b90('0x13')][_0x3b90('0x12')](QUERY,{'type':dbH[_0x3b90('0x13')][_0x3b90('0x14')][_0x3b90('0x19')]}));}}var _0x3bc7d5=path[_0x3b90('0x1a')](PATH);var _0xa98414=path[_0x3b90('0x1b')](PATH,'.csv');var _0x20b06a=_0x51f916[_0x3b90('0xf')]&&_0x1af265[_0x3b90('0x1c')]>0x1;var _0x7faee=[];if(!fs[_0x3b90('0x1d')](path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414))&&_0x20b06a){fs['mkdirSync'](path['join'](_0x3bc7d5,_0xa98414));}return BPromise[_0x3b90('0x1f')](_0x1af265,function(_0x29d472){_0x7faee[_0x3b90('0x17')](_0x29d472);})[_0x3b90('0x10')](function(){for(var _0x583523=0x0;_0x583523<_0x7faee[_0x3b90('0x1c')];_0x583523+=0x1){var _0x2936d7;var _0x1787d1=_0x7faee[_0x583523];if(_0x20b06a){_0x2936d7=path['join'](_0x3bc7d5,_0xa98414,util[_0x3b90('0x18')](_0x3b90('0x20'),_0xa98414,_0x583523,_0x3b90('0x21')));}else{_0x2936d7=path[_0x3b90('0x1e')](_0x3bc7d5,util[_0x3b90('0x18')](_0x3b90('0x22'),_0xa98414,'csv'));}fs[_0x3b90('0x23')](_0x2936d7,csv(_0x1787d1));}})['then'](function(){if(_0x20b06a){zipdir(path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414),{'saveTo':path[_0x3b90('0x1e')](_0x3bc7d5,util[_0x3b90('0x18')](_0x3b90('0x22'),_0xa98414,_0x3b90('0x24')))},function(_0x6704f,_0x290283){});rimraf(path[_0x3b90('0x1e')](_0x3bc7d5,_0xa98414),function(){});}})['then'](function(){logger['info'](util[_0x3b90('0x18')](_0x3b90('0x25'),EXTRACTED_REPORT_ID,_0x3b90('0xd')));return analyticExtractedReport(_0x3b90('0x26'),_0x20b06a?util['format']('%s.%s',_0xa98414,_0x20b06a?_0x3b90('0x24'):_0x3b90('0x21')):null);});})[_0x3b90('0x27')](function(_0x4f3ab5){logger[_0x3b90('0x28')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3b90('0xd')),util[_0x3b90('0x29')](_0x4f3ab5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x5636=['mkdirSync','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','.csv','join'];(function(_0x1bcc92,_0x4929b8){var _0x88406a=function(_0x4670f8){while(--_0x4670f8){_0x1bcc92['push'](_0x1bcc92['shift']());}};_0x88406a(++_0x4929b8);}(_0x5636,0x102));var _0x6563=function(_0x26dcb6,_0x3b1d76){_0x26dcb6=_0x26dcb6-0x0;var _0x2bb139=_0x5636[_0x26dcb6];return _0x2bb139;};'use strict';var util=require(_0x6563('0x0'));var path=require(_0x6563('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x6563('0x2'));var rimraf=require(_0x6563('0x3'));var db=require(_0x6563('0x4'))['db'];var dbH=require('../../mysqldb')[_0x6563('0x5')];var logger=require(_0x6563('0x6'))(_0x6563('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6563('0x8')][0x2]);var QUERY=process[_0x6563('0x8')][0x3];var PATH=process[_0x6563('0x8')][0x4];function analyticExtractedReport(_0x9884a9,_0x2d57d5){var _0x2d0d5b={'status':_0x9884a9};var _0x98fcd4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d57d5){_0x2d0d5b[_0x6563('0x9')]=_0x2d57d5;}return db[_0x6563('0xa')][_0x6563('0xb')](_0x2d0d5b,_0x98fcd4);}function main(){var _0x516d1a=0x1388;var _0x51fdc2;logger[_0x6563('0xc')](util[_0x6563('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x6563('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6563('0xf'),_0x6563('0x10')]})[_0x6563('0x11')](function(_0x33816e){if(_0x33816e){_0x51fdc2=_0x33816e;_0x516d1a=_0x51fdc2[_0x6563('0x10')]||0x1388;}})[_0x6563('0x11')](function(){return dbH[_0x6563('0x12')][_0x6563('0x13')](util['format'](_0x6563('0x14'),QUERY),{'type':dbH['sequelize'][_0x6563('0x15')][_0x6563('0x16')]});})[_0x6563('0x11')](function(_0x10d08c){if(!_0x10d08c[0x0]['num']){return analyticExtractedReport(_0x6563('0x17'));}var _0x11baa2=[];var _0x477d9b=0x0;var _0xd398ce=!![];if(_0x10d08c&&_0x10d08c['length']){var _0x3563fd=_0x10d08c[0x0]['num']%(_0x477d9b+_0x516d1a);if(_0x51fdc2['split']){for(;_0xd398ce;_0x477d9b+=_0x516d1a,_0x3563fd=_0x10d08c[0x0]['num']%(_0x477d9b+_0x516d1a)){if(_0x3563fd==0x0||_0x3563fd==_0x10d08c[0x0][_0x6563('0x18')]){_0xd398ce=![];}_0x11baa2['push'](dbH['sequelize'][_0x6563('0x13')](util[_0x6563('0xd')](_0x6563('0x19'),QUERY,_0x516d1a,_0x477d9b),{'type':dbH[_0x6563('0x12')][_0x6563('0x15')][_0x6563('0x16')]}));}}else{_0x11baa2[_0x6563('0x1a')](dbH[_0x6563('0x12')][_0x6563('0x13')](QUERY,{'type':dbH['sequelize'][_0x6563('0x15')][_0x6563('0x16')]}));}}var _0x20b478=path['dirname'](PATH);var _0x293db2=path['basename'](PATH,_0x6563('0x1b'));var _0x105379=_0x51fdc2['split']&&_0x11baa2['length']>0x1;var _0x3ab7f6=[];if(!fs['existsSync'](path[_0x6563('0x1c')](_0x20b478,_0x293db2))&&_0x105379){fs[_0x6563('0x1d')](path[_0x6563('0x1c')](_0x20b478,_0x293db2));}return BPromise['each'](_0x11baa2,function(_0xd860d5){_0x3ab7f6['push'](_0xd860d5);})[_0x6563('0x11')](function(){for(var _0x1590e6=0x0;_0x1590e6<_0x3ab7f6['length'];_0x1590e6+=0x1){var _0x365b16;var _0x28252d=_0x3ab7f6[_0x1590e6];if(_0x105379){_0x365b16=path['join'](_0x20b478,_0x293db2,util[_0x6563('0xd')]('%s%d.%s',_0x293db2,_0x1590e6,_0x6563('0x1e')));}else{_0x365b16=path['join'](_0x20b478,util['format'](_0x6563('0x1f'),_0x293db2,_0x6563('0x1e')));}fs[_0x6563('0x20')](_0x365b16,csv(_0x28252d));}})[_0x6563('0x11')](function(){if(_0x105379){zipdir(path[_0x6563('0x1c')](_0x20b478,_0x293db2),{'saveTo':path['join'](_0x20b478,util[_0x6563('0xd')]('%s.%s',_0x293db2,'zip'))},function(_0x3582c9,_0x35af37){});rimraf(path[_0x6563('0x1c')](_0x20b478,_0x293db2),function(){});}})[_0x6563('0x11')](function(){logger[_0x6563('0xc')](util[_0x6563('0xd')](_0x6563('0x21'),EXTRACTED_REPORT_ID,_0x6563('0x22')));return analyticExtractedReport(_0x6563('0x23'),_0x105379?util[_0x6563('0xd')]('%s.%s',_0x293db2,_0x105379?_0x6563('0x24'):_0x6563('0x1e')):null);});})[_0x6563('0x25')](function(_0x1558fb){logger[_0x6563('0xc')](util[_0x6563('0xd')](_0x6563('0x26'),EXTRACTED_REPORT_ID,'CSV'),util[_0x6563('0x27')](_0x1558fb,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6563('0x28'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 423a608..5c664ef 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x22da52,_0x2f124e){var _0x55fc4f=function(_0x4fb5cb){while(--_0x4fb5cb){_0x22da52['push'](_0x22da52['shift']());}};_0x55fc4f(++_0x2f124e);}(_0xb10b,0x12a));var _0xbb10=function(_0x18b0a1,_0x535aac){_0x18b0a1=_0x18b0a1-0x0;var _0x55005a=_0xb10b[_0x18b0a1];return _0x55005a;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x58a4b9,_0x1d4e4a){var _0x58aac5=function(_0xd4527d){while(--_0xd4527d){_0x58a4b9['push'](_0x58a4b9['shift']());}};_0x58aac5(++_0x1d4e4a);}(_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 11b47b9..14870a5 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 _0xcd26=['rimraf','../../mysqldb','dbH','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','path','json2xls','bluebird','zip-dir'];(function(_0x1fbef0,_0x5ca5e8){var _0x30a572=function(_0x170bc6){while(--_0x170bc6){_0x1fbef0['push'](_0x1fbef0['shift']());}};_0x30a572(++_0x5ca5e8);}(_0xcd26,0x77));var _0x6cd2=function(_0x227c55,_0x49db56){_0x227c55=_0x227c55-0x0;var _0x49e02b=_0xcd26[_0x227c55];return _0x49e02b;};'use strict';var util=require('util');var path=require(_0x6cd2('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x6cd2('0x1'));var BPromise=require(_0x6cd2('0x2'));var zipdir=require(_0x6cd2('0x3'));var rimraf=require(_0x6cd2('0x4'));var db=require(_0x6cd2('0x5'))['db'];var dbH=require(_0x6cd2('0x5'))[_0x6cd2('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6cd2('0x7')][0x2]);var QUERY=process[_0x6cd2('0x7')][0x3];var PATH=process[_0x6cd2('0x7')][0x4];function analyticExtractedReport(_0x2edd3a,_0x253b73){var _0x53d18d={'status':_0x2edd3a};var _0x8a4d42={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x253b73){_0x53d18d['savename']=_0x253b73;}return db[_0x6cd2('0x8')][_0x6cd2('0x9')](_0x53d18d,_0x8a4d42);}function main(){var _0x7b8046=0x1388;var _0x4884a3;logger[_0x6cd2('0xa')](util['format'](_0x6cd2('0xb'),EXTRACTED_REPORT_ID,_0x6cd2('0xc')));return db['Setting'][_0x6cd2('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6cd2('0xe'),_0x6cd2('0xf')]})[_0x6cd2('0x10')](function(_0x2200eb){if(_0x2200eb){_0x4884a3=_0x2200eb;_0x7b8046=_0x4884a3[_0x6cd2('0xf')]||0x1388;}})['then'](function(){return dbH[_0x6cd2('0x11')]['query'](util[_0x6cd2('0x12')](_0x6cd2('0x13'),QUERY),{'type':dbH['sequelize'][_0x6cd2('0x14')][_0x6cd2('0x15')]});})[_0x6cd2('0x10')](function(_0x34b88b){if(!_0x34b88b[0x0][_0x6cd2('0x16')]){return analyticExtractedReport(_0x6cd2('0x17'));}var _0x4afede=[];var _0x2b5b69=0x0;var _0x6da57e=!![];if(_0x4884a3[_0x6cd2('0xe')]){if(_0x34b88b&&_0x34b88b['length']){var _0x3edea0=_0x34b88b[0x0][_0x6cd2('0x16')]%(_0x2b5b69+_0x7b8046);for(;_0x6da57e;_0x2b5b69+=_0x7b8046,_0x3edea0=_0x34b88b[0x0][_0x6cd2('0x16')]%(_0x2b5b69+_0x7b8046)){if(_0x3edea0==0x0||_0x3edea0==_0x34b88b[0x0][_0x6cd2('0x16')]){_0x6da57e=![];}_0x4afede[_0x6cd2('0x18')](dbH[_0x6cd2('0x11')][_0x6cd2('0x19')](util[_0x6cd2('0x12')](_0x6cd2('0x1a'),QUERY,_0x7b8046,_0x2b5b69),{'type':dbH['sequelize'][_0x6cd2('0x14')][_0x6cd2('0x15')]}));}}}else{_0x4afede['push'](dbH[_0x6cd2('0x11')]['query'](QUERY,{'type':dbH['sequelize'][_0x6cd2('0x14')][_0x6cd2('0x15')]}));}var _0x3d3f46=path[_0x6cd2('0x1b')](PATH);var _0x4ac31d=path[_0x6cd2('0x1c')](PATH,'.xlsx');var _0x2fb0cd=_0x4884a3[_0x6cd2('0xe')]&&_0x4afede[_0x6cd2('0x1d')]>0x1;var _0xd21d30=[];if(!fs[_0x6cd2('0x1e')](path['join'](_0x3d3f46,_0x4ac31d))&&_0x2fb0cd){fs['mkdirSync'](path[_0x6cd2('0x1f')](_0x3d3f46,_0x4ac31d));}return BPromise[_0x6cd2('0x20')](_0x4afede,function(_0x2ee01f){_0xd21d30['push'](_0x2ee01f);})['then'](function(){for(var _0x178e60=0x0;_0x178e60<_0xd21d30[_0x6cd2('0x1d')];_0x178e60+=0x1){var _0x16dcad;var _0x648823=_0xd21d30[_0x178e60];if(_0x2fb0cd){_0x16dcad=path[_0x6cd2('0x1f')](_0x3d3f46,_0x4ac31d,util[_0x6cd2('0x12')](_0x6cd2('0x21'),_0x4ac31d,_0x178e60,_0x6cd2('0x22')));}else{_0x16dcad=path[_0x6cd2('0x1f')](_0x3d3f46,util[_0x6cd2('0x12')](_0x6cd2('0x23'),_0x4ac31d,_0x6cd2('0x22')));}fs[_0x6cd2('0x24')](_0x16dcad,json2xls(_0x648823),'binary');}})[_0x6cd2('0x10')](function(){if(_0x2fb0cd){zipdir(path[_0x6cd2('0x1f')](_0x3d3f46,_0x4ac31d),{'saveTo':path[_0x6cd2('0x1f')](_0x3d3f46,util[_0x6cd2('0x12')](_0x6cd2('0x23'),_0x4ac31d,'zip'))},function(_0x2670f7,_0x9fa1e3){});rimraf(path[_0x6cd2('0x1f')](_0x3d3f46,_0x4ac31d),function(){});}})[_0x6cd2('0x10')](function(){logger[_0x6cd2('0xa')](util[_0x6cd2('0x12')](_0x6cd2('0x25'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x6cd2('0x26'),_0x2fb0cd?util[_0x6cd2('0x12')]('%s.%s',_0x4ac31d,_0x2fb0cd?'zip':_0x6cd2('0x22')):null);});})['catch'](function(_0x14f123){logger['info'](util[_0x6cd2('0x12')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x6cd2('0x27')](_0x14f123,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6cd2('0x28'));});}main(); \ No newline at end of file +var _0x830b=['xlsx','%s.%s','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx','existsSync','join','mkdirSync','each'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x830b,0xab));var _0xb830=function(_0xf17c26,_0x31b7df){_0xf17c26=_0xf17c26-0x0;var _0x23a5ae=_0x830b[_0xf17c26];return _0x23a5ae;};'use strict';var util=require('util');var path=require('path');var _=require(_0xb830('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xb830('0x1'));var zipdir=require(_0xb830('0x2'));var rimraf=require(_0xb830('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb830('0x4'))[_0xb830('0x5')];var logger=require(_0xb830('0x6'))(_0xb830('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb830('0x8')][0x2]);var QUERY=process[_0xb830('0x8')][0x3];var PATH=process[_0xb830('0x8')][0x4];function analyticExtractedReport(_0x350230,_0x2c634b){var _0x3b95ed={'status':_0x350230};var _0x2a5298={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c634b){_0x3b95ed[_0xb830('0x9')]=_0x2c634b;}return db['AnalyticExtractedReport'][_0xb830('0xa')](_0x3b95ed,_0x2a5298);}function main(){var _0x4571ef=0x1388;var _0x4b26ed;logger[_0xb830('0xb')](util[_0xb830('0xc')](_0xb830('0xd'),EXTRACTED_REPORT_ID,_0xb830('0xe')));return db['Setting'][_0xb830('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb830('0x10'),_0xb830('0x11')]})['then'](function(_0x527a7a){if(_0x527a7a){_0x4b26ed=_0x527a7a;_0x4571ef=_0x4b26ed['splitSizeXlsx']||0x1388;}})[_0xb830('0x12')](function(){return dbH[_0xb830('0x13')][_0xb830('0x14')](util[_0xb830('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb830('0x13')][_0xb830('0x15')][_0xb830('0x16')]});})[_0xb830('0x12')](function(_0x1c6c0a){if(!_0x1c6c0a[0x0][_0xb830('0x17')]){return analyticExtractedReport(_0xb830('0x18'));}var _0x27eede=[];var _0x2eab32=0x0;var _0x127304=!![];if(_0x4b26ed[_0xb830('0x10')]){if(_0x1c6c0a&&_0x1c6c0a[_0xb830('0x19')]){var _0x135d6e=_0x1c6c0a[0x0][_0xb830('0x17')]%(_0x2eab32+_0x4571ef);for(;_0x127304;_0x2eab32+=_0x4571ef,_0x135d6e=_0x1c6c0a[0x0][_0xb830('0x17')]%(_0x2eab32+_0x4571ef)){if(_0x135d6e==0x0||_0x135d6e==_0x1c6c0a[0x0]['num']){_0x127304=![];}_0x27eede['push'](dbH[_0xb830('0x13')]['query'](util[_0xb830('0xc')](_0xb830('0x1a'),QUERY,_0x4571ef,_0x2eab32),{'type':dbH[_0xb830('0x13')][_0xb830('0x15')][_0xb830('0x16')]}));}}}else{_0x27eede[_0xb830('0x1b')](dbH['sequelize'][_0xb830('0x14')](QUERY,{'type':dbH[_0xb830('0x13')][_0xb830('0x15')][_0xb830('0x16')]}));}var _0x48c726=path['dirname'](PATH);var _0x2611ee=path[_0xb830('0x1c')](PATH,_0xb830('0x1d'));var _0x58adb2=_0x4b26ed[_0xb830('0x10')]&&_0x27eede['length']>0x1;var _0x4a880b=[];if(!fs[_0xb830('0x1e')](path[_0xb830('0x1f')](_0x48c726,_0x2611ee))&&_0x58adb2){fs[_0xb830('0x20')](path[_0xb830('0x1f')](_0x48c726,_0x2611ee));}return BPromise[_0xb830('0x21')](_0x27eede,function(_0x490842){_0x4a880b['push'](_0x490842);})['then'](function(){for(var _0x44cac2=0x0;_0x44cac2<_0x4a880b[_0xb830('0x19')];_0x44cac2+=0x1){var _0x59ddcf;var _0x345a67=_0x4a880b[_0x44cac2];if(_0x58adb2){_0x59ddcf=path[_0xb830('0x1f')](_0x48c726,_0x2611ee,util['format']('%s%d.%s',_0x2611ee,_0x44cac2,_0xb830('0x22')));}else{_0x59ddcf=path['join'](_0x48c726,util[_0xb830('0xc')](_0xb830('0x23'),_0x2611ee,_0xb830('0x22')));}fs['writeFileSync'](_0x59ddcf,json2xls(_0x345a67),_0xb830('0x24'));}})[_0xb830('0x12')](function(){if(_0x58adb2){zipdir(path[_0xb830('0x1f')](_0x48c726,_0x2611ee),{'saveTo':path[_0xb830('0x1f')](_0x48c726,util['format']('%s.%s',_0x2611ee,'zip'))},function(_0x183ce1,_0x3a4761){});rimraf(path[_0xb830('0x1f')](_0x48c726,_0x2611ee),function(){});}})[_0xb830('0x12')](function(){logger[_0xb830('0xb')](util[_0xb830('0xc')](_0xb830('0x25'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xb830('0x26'),_0x58adb2?util[_0xb830('0xc')](_0xb830('0x23'),_0x2611ee,_0x58adb2?'zip':_0xb830('0x22')):null);});})[_0xb830('0x27')](function(_0x3371c4){logger[_0xb830('0xb')](util[_0xb830('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb830('0xe')),util['inspect'](_0x3371c4,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb830('0x28'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 943de1e..9885291 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 _0xb584=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','Interval','findAll','then','intervals','models','VoiceExtension','map','exten','filter','groupBy','playback','hasOwnProperty','priority','extensions','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','push','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0x56cd70,_0x3cc19d){var _0x34007e=function(_0x51a586){while(--_0x51a586){_0x56cd70['push'](_0x56cd70['shift']());}};_0x34007e(++_0x3cc19d);}(_0xb584,0x1c1));var _0x4b58=function(_0xdcdae9,_0x5ecdf7){_0xdcdae9=_0xdcdae9-0x0;var _0x363215=_0xb584[_0xdcdae9];return _0x363215;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x39a445,_0x479d36){var _0x1bf6e1=this;return _0x39a445['models'][_0x4b58('0x0')][_0x4b58('0x1')]({'raw':!![]})[_0x4b58('0x2')](function(_0x3f6983){_0x1bf6e1[_0x4b58('0x3')]=_0x3f6983;return _0x39a445[_0x4b58('0x4')][_0x4b58('0x5')][_0x4b58('0x1')]({'where':{'IntervalId':_0x479d36['IntervalId']},'raw':!![]});})['then'](function(_0x3a969b){return _0x39a445[_0x4b58('0x4')][_0x4b58('0x5')][_0x4b58('0x1')]({'where':{'exten':{'$in':_['uniq'](_[_0x4b58('0x6')](_0x3a969b,_0x4b58('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x4b58('0x2')](function(_0x2a3fdd){var _0x1c9887=_[_0x4b58('0x8')](_0x2a3fdd,{'priority':'1'});var _0x218c44=_['filter'](_0x2a3fdd,{'isApp':0x1});var _0x13708e=_[_0x4b58('0x9')](_0x218c44,_0x4b58('0x7'));var _0xc60643=['queue',_0x4b58('0xa')];var _0x4d0b79=[];var _0x4a6a6a=[];for(var _0x480268 in _0x13708e){if(_0x13708e[_0x4b58('0xb')](_0x480268)){_0x1bf6e1[_0x4b58('0xc')]=0x2;_0x1bf6e1[_0x4b58('0xd')]=[];_0x1bf6e1['extension']=_[_0x4b58('0xe')](_0x1c9887,{'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')]});_0x1bf6e1[_0x4b58('0xd')]['push']({'type':_0x13708e[_0x480268][0x0]['type'],'app':_0x4b58('0xf'),'appdata':util[_0x4b58('0x10')](_0x4b58('0x11'),_0x13708e[_0x480268][0x0][_0x4b58('0x12')]),'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0]['exten'],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});if(_0x13708e[_0x480268][0x0][_0x4b58('0x12')]===_0x4b58('0x15')){if(_0x1bf6e1[_0x4b58('0x16')]){_0x1bf6e1[_0x4b58('0xd')]['push']({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x17')+(_0x1bf6e1[_0x4b58('0x16')][_0x4b58('0x18')]?_0x4b58('0x19')+_0x1bf6e1[_0x4b58('0x16')]['cutdigits']+'}':_0x4b58('0x1a')),'context':_0x13708e[_0x480268][0x0]['context'],'exten':_0x13708e[_0x480268][0x0]['exten'],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});}_0x1bf6e1['extensions']['push']({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x1b')+_0x13708e[_0x480268][0x0][_0x4b58('0x14')],'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1['priority']++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});var _0x42eff5=_0x1bf6e1[_0x4b58('0xc')]++;_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0]['type'],'app':_0x4b58('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x42eff5+0x2)+'):Goto('+(_0x42eff5+0x1)+')','context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x42eff5,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});if(_0x1bf6e1['extension']){_0x1bf6e1[_0x4b58('0xd')]['push']({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':'Set','appdata':_0x1bf6e1[_0x4b58('0x16')][_0x4b58('0x18')]?_0x4b58('0x1e')+_0x1bf6e1[_0x4b58('0x16')]['cutdigits']+'}':_0x4b58('0x1f'),'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0]['exten'],'priority':_0x1bf6e1['priority']++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});}_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0]['type'],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x20')+_0x13708e[_0x480268][0x0][_0x4b58('0x14')],'context':_0x13708e[_0x480268][0x0]['context'],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});if(_0x1bf6e1[_0x4b58('0x16')]&&_0x1bf6e1[_0x4b58('0x16')][_0x4b58('0xb')](_0x4b58('0x21'))&&_0x1bf6e1['extension'][_0x4b58('0x21')]!==_0x4b58('0x22')){_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x23'),'context':_0x13708e[_0x480268][0x0]['context'],'exten':_0x13708e[_0x480268][0x0]['exten'],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});_0x1bf6e1[_0x4b58('0xd')]['push']({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x24')+_0x1bf6e1[_0x4b58('0x16')][_0x4b58('0x21')]||_0x4b58('0x25'),'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});}}_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x26'),'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':'Set','appdata':_0x4b58('0x27'),'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1['priority']++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});_0x1bf6e1['extensions'][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x28'),'context':_0x13708e[_0x480268][0x0]['context'],'exten':_0x13708e[_0x480268][0x0][_0x4b58('0x7')],'priority':_0x1bf6e1[_0x4b58('0xc')]++,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});for(var _0x96d531=0x0,_0x11ffd6=0x0;_0x96d531<_0x13708e[_0x480268][_0x4b58('0x29')];_0x96d531+=0x1,_0x11ffd6=0x0){var _0x4de802=_0x13708e[_0x480268][_0x96d531];if(_0x4de802['type']){_0x4de802[_0x4b58('0x12')]=_0x4de802[_0x4b58('0x12')][_0x4b58('0x2a')]();}var _0x1bb25b=[];var _0x27ab66=[];delete _0x4de802['id'];delete _0x4de802['createdAt'];delete _0x4de802['updatedAt'];var _0x5925b2=_0x4de802[_0x4b58('0x2b')]!=='*,*,*,*'?[_0x4de802[_0x4b58('0x2b')]]:_0x4de802[_0x4b58('0x2c')]?_['map'](_[_0x4b58('0x8')](_0x1bf6e1['intervals'],{'IntervalId':_0x4de802[_0x4b58('0x2c')]}),_0x4b58('0x2b')):[];if(_0x4de802[_0x4b58('0xb')](_0x4b58('0x2d'))){if(_0x4de802[_0x4b58('0x2d')]&&_0x4de802['tag']!=='--'){_0x1bb25b['push']({'type':_0x4de802[_0x4b58('0x12')],'app':'Set','appdata':_0x4b58('0x2e')+_0x4de802[_0x4b58('0x2d')],'context':_0x4de802[_0x4b58('0x13')],'exten':_0x4de802['exten'],'priority':_0x5925b2['length']+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});}}if(_0x4de802['type']===_0x4b58('0x15')&&_0x4de802['hasOwnProperty'](_0x4b58('0x2f'))){if(_0x4de802[_0x4b58('0x2f')]){_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802['type'],'app':'ExecIf','appdata':_0x4b58('0x30')+_0x4de802[_0x4b58('0x2f')]+')','context':_0x4de802['context'],'exten':_0x4de802['exten'],'priority':_0x5925b2[_0x4b58('0x29')]+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});}else{_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802[_0x4b58('0x12')],'app':_0x4b58('0x1d'),'appdata':_0x4b58('0x31'),'context':_0x4de802['context'],'exten':_0x4de802[_0x4b58('0x7')],'priority':_0x5925b2[_0x4b58('0x29')]+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});}}if(_0x4de802['hasOwnProperty'](_0x4b58('0x32'))){if(_0xc60643[_0x4b58('0x33')](_0x4de802[_0x4b58('0x34')][_0x4b58('0x2a')]())>=0x0&&_0x4de802[_0x4b58('0x35')]!==_0x4b58('0x36')){if(_0x4de802[_0x4b58('0x32')]){_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802[_0x4b58('0x12')],'app':_0x4b58('0x1d'),'appdata':_0x4b58('0x37'),'context':_0x4de802[_0x4b58('0x13')],'exten':_0x4de802[_0x4b58('0x7')],'priority':_0x5925b2[_0x4b58('0x29')]+_0x1bf6e1['priority']+_0x11ffd6++,'VoiceExtensionId':_0x4de802['VoiceExtensionId']});_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802[_0x4b58('0x12')],'app':_0x4b58('0xf'),'appdata':_0x4b58('0x38'),'context':_0x4de802[_0x4b58('0x13')],'exten':_0x4de802[_0x4b58('0x7')],'priority':_0x5925b2['length']+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});}else{_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802[_0x4b58('0x12')],'app':_0x4b58('0x1d'),'appdata':_0x4b58('0x39'),'context':_0x4de802[_0x4b58('0x13')],'exten':_0x4de802[_0x4b58('0x7')],'priority':_0x5925b2[_0x4b58('0x29')]+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});_0x1bb25b[_0x4b58('0x1c')]({'type':_0x4de802[_0x4b58('0x12')],'app':'Set','appdata':_0x4b58('0x3a'),'context':_0x4de802[_0x4b58('0x13')],'exten':_0x4de802[_0x4b58('0x7')],'priority':_0x5925b2[_0x4b58('0x29')]+_0x1bf6e1[_0x4b58('0xc')]+_0x11ffd6++,'VoiceExtensionId':_0x4de802[_0x4b58('0x14')]});}}}for(var _0x47f7c6=0x0;_0x47f7c6<_0x5925b2['length'];_0x47f7c6+=0x1){var _0x2f2f6b=_0x1bf6e1[_0x4b58('0xc')]+_0x5925b2[_0x4b58('0x29')];var _0x477c13=_0x47f7c6===_0x5925b2['length']-0x1?_0x1bf6e1[_0x4b58('0xc')]+_0x1bb25b[_0x4b58('0x29')]+_0x27ab66[_0x4b58('0x29')]+0x2:_0x1bf6e1['priority']+_0x47f7c6+0x1;_0x1bb25b[_0x4b58('0x3b')](_0x47f7c6,0x0,{'type':_0x4de802['type'],'app':_0x4b58('0x3c'),'appdata':_0x5925b2[_0x47f7c6]+'?'+_0x4de802[_0x4b58('0x13')]+',${EXTEN},'+_0x2f2f6b+':'+_0x4de802[_0x4b58('0x13')]+',${EXTEN},'+_0x477c13,'exten':_0x4de802[_0x4b58('0x7')],'context':_0x4de802[_0x4b58('0x13')],'priority':_0x1bf6e1[_0x4b58('0xc')]+_0x47f7c6,'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});}_0x4de802[_0x4b58('0xc')]=_0x1bb25b[_0x4b58('0x29')]?_[_0x4b58('0x3d')](_0x1bb25b)['priority']+0x1:_0x1bf6e1[_0x4b58('0xc')];_0x1bf6e1[_0x4b58('0xc')]=(_0x27ab66['length']?_[_0x4b58('0x3d')](_0x27ab66)[_0x4b58('0xc')]:_0x4de802['priority'])+0x1;_0x1bf6e1[_0x4b58('0xd')]=_[_0x4b58('0x3e')](_0x1bf6e1[_0x4b58('0xd')],_0x1bb25b,[_0x4de802],_0x27ab66);}_0x1bf6e1[_0x4b58('0xd')][_0x4b58('0x1c')]({'type':_0x13708e[_0x480268][0x0][_0x4b58('0x12')],'app':_0x4b58('0x3f'),'exten':_0x13708e[_0x480268][0x0]['exten'],'context':_0x13708e[_0x480268][0x0][_0x4b58('0x13')],'priority':_0x1bf6e1[_0x4b58('0xc')],'VoiceExtensionId':_0x13708e[_0x480268][0x0][_0x4b58('0x14')]});_0x4d0b79['push'](_0x13708e[_0x480268][0x0][_0x4b58('0x14')]);_0x4a6a6a=_[_0x4b58('0x3e')](_0x4a6a6a,_0x1bf6e1[_0x4b58('0xd')]);}}return _0x39a445[_0x4b58('0x40')](function(_0x6ad66e){return _0x39a445[_0x4b58('0x4')][_0x4b58('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4d0b79}},'transaction':_0x6ad66e})['then'](function(_0x1e80f9){return _0x39a445['models'][_0x4b58('0x5')][_0x4b58('0x41')](_[_0x4b58('0x42')](_0x4a6a6a,_0x4b58('0xc')),{'transaction':_0x6ad66e});});});})[_0x4b58('0x43')](function(_0x59c65d){console[_0x4b58('0x44')](_0x59c65d);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x0f1e=['transaction','VoiceExtension','destroy','bulkCreate','sortBy','catch','error','rewrite','models','Interval','then','intervals','IntervalId','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','extension','find','extensions','type','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','push','CDR(destination)=','cutdigits','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','answer','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0x0f1e,0x18e));var _0xe0f1=function(_0x2d78d7,_0x294303){_0x2d78d7=_0x2d78d7-0x0;var _0x180374=_0x0f1e[_0x2d78d7];return _0x180374;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0xc073a6,_0x5a87fc){var _0x3c76ac=this;return _0xc073a6[_0xe0f1('0x0')][_0xe0f1('0x1')]['findAll']({'raw':!![]})[_0xe0f1('0x2')](function(_0x112769){_0x3c76ac[_0xe0f1('0x3')]=_0x112769;return _0xc073a6[_0xe0f1('0x0')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x5a87fc[_0xe0f1('0x4')]},'raw':!![]});})['then'](function(_0x3d3ace){return _0xc073a6[_0xe0f1('0x0')]['VoiceExtension'][_0xe0f1('0x5')]({'where':{'exten':{'$in':_[_0xe0f1('0x6')](_[_0xe0f1('0x7')](_0x3d3ace,_0xe0f1('0x8')))}},'order':[{'raw':_0xe0f1('0x9')}],'raw':!![]});})[_0xe0f1('0x2')](function(_0x23433a){var _0x2515ab=_[_0xe0f1('0xa')](_0x23433a,{'priority':'1'});var _0x5a87fa=_['filter'](_0x23433a,{'isApp':0x1});var _0x50836d=_['groupBy'](_0x5a87fa,_0xe0f1('0x8'));var _0x1ca352=[_0xe0f1('0xb'),'playback'];var _0x2a62d0=[];var _0xf1fe38=[];for(var _0x51e540 in _0x50836d){if(_0x50836d[_0xe0f1('0xc')](_0x51e540)){_0x3c76ac[_0xe0f1('0xd')]=0x2;_0x3c76ac['extensions']=[];_0x3c76ac[_0xe0f1('0xe')]=_[_0xe0f1('0xf')](_0x2515ab,{'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')]});_0x3c76ac[_0xe0f1('0x10')]['push']({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':util['format'](_0xe0f1('0x13'),_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')]),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac['priority']++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});if(_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')]===_0xe0f1('0x16')){if(_0x3c76ac['extension']){_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x18')+(_0x3c76ac[_0xe0f1('0xe')][_0xe0f1('0x19')]?'${EXTEN:'+_0x3c76ac[_0xe0f1('0xe')][_0xe0f1('0x19')]+'}':'${EXTEN}'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});}_0x3c76ac[_0xe0f1('0x10')][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x1a')+_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')],'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});var _0x5334d0=_0x3c76ac[_0xe0f1('0xd')]++;_0x3c76ac[_0xe0f1('0x10')]['push']({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x1b'),'appdata':_0xe0f1('0x1c')+(_0x5334d0+0x2)+_0xe0f1('0x1d')+(_0x5334d0+0x1)+')','context':_0x50836d[_0x51e540][0x0]['context'],'exten':_0x50836d[_0x51e540][0x0]['exten'],'priority':_0x5334d0,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});if(_0x3c76ac[_0xe0f1('0xe')]){_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0x3c76ac['extension'][_0xe0f1('0x19')]?_0xe0f1('0x1e')+_0x3c76ac[_0xe0f1('0xe')][_0xe0f1('0x19')]+'}':_0xe0f1('0x1f'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0]['exten'],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});}_0x3c76ac[_0xe0f1('0x10')][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':'Set','appdata':_0xe0f1('0x20')+_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')],'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0]['VoiceExtensionId']});if(_0x3c76ac['extension']&&_0x3c76ac[_0xe0f1('0xe')][_0xe0f1('0xc')](_0xe0f1('0x21'))&&_0x3c76ac['extension'][_0xe0f1('0x21')]!=='none'){_0x3c76ac[_0xe0f1('0x10')][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac['priority']++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x22')+_0x3c76ac[_0xe0f1('0xe')][_0xe0f1('0x21')]||_0xe0f1('0x23'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0]['exten'],'priority':_0x3c76ac['priority']++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});}}_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x24'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x25'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac[_0xe0f1('0xd')]++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});_0x3c76ac[_0xe0f1('0x10')][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0]['type'],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x26'),'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'priority':_0x3c76ac['priority']++,'VoiceExtensionId':_0x50836d[_0x51e540][0x0]['VoiceExtensionId']});for(var _0xf8c7cf=0x0,_0x45702a=0x0;_0xf8c7cf<_0x50836d[_0x51e540][_0xe0f1('0x27')];_0xf8c7cf+=0x1,_0x45702a=0x0){var _0x333194=_0x50836d[_0x51e540][_0xf8c7cf];if(_0x333194[_0xe0f1('0x11')]){_0x333194['type']=_0x333194[_0xe0f1('0x11')]['toLowerCase']();}var _0x4625f7=[];var _0x25a036=[];delete _0x333194['id'];delete _0x333194[_0xe0f1('0x28')];delete _0x333194[_0xe0f1('0x29')];var _0x5500c8=_0x333194['interval']!==_0xe0f1('0x2a')?[_0x333194[_0xe0f1('0x2b')]]:_0x333194[_0xe0f1('0x4')]?_['map'](_[_0xe0f1('0xa')](_0x3c76ac[_0xe0f1('0x3')],{'IntervalId':_0x333194[_0xe0f1('0x4')]}),_0xe0f1('0x2b')):[];if(_0x333194['hasOwnProperty']('tag')){if(_0x333194[_0xe0f1('0x2c')]&&_0x333194['tag']!=='--'){_0x4625f7[_0xe0f1('0x17')]({'type':_0x333194['type'],'app':'Set','appdata':'CDR(tag)='+_0x333194['tag'],'context':_0x333194['context'],'exten':_0x333194['exten'],'priority':_0x5500c8['length']+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194[_0xe0f1('0x15')]});}}if(_0x333194[_0xe0f1('0x11')]===_0xe0f1('0x16')&&_0x333194[_0xe0f1('0xc')](_0xe0f1('0x2d'))){if(_0x333194[_0xe0f1('0x2d')]){_0x4625f7['push']({'type':_0x333194[_0xe0f1('0x11')],'app':_0xe0f1('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x333194[_0xe0f1('0x2d')]+')','context':_0x333194[_0xe0f1('0x14')],'exten':_0x333194[_0xe0f1('0x8')],'priority':_0x5500c8[_0xe0f1('0x27')]+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194[_0xe0f1('0x15')]});}else{_0x4625f7['push']({'type':_0x333194[_0xe0f1('0x11')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x333194['context'],'exten':_0x333194[_0xe0f1('0x8')],'priority':_0x5500c8[_0xe0f1('0x27')]+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194[_0xe0f1('0x15')]});}}if(_0x333194[_0xe0f1('0xc')](_0xe0f1('0x2e'))){if(_0x1ca352['indexOf'](_0x333194['app']['toLowerCase']())>=0x0&&_0x333194[_0xe0f1('0x2f')]!=='custom'){if(_0x333194['answer']){_0x4625f7[_0xe0f1('0x17')]({'type':_0x333194[_0xe0f1('0x11')],'app':_0xe0f1('0x1b'),'appdata':_0xe0f1('0x30'),'context':_0x333194['context'],'exten':_0x333194[_0xe0f1('0x8')],'priority':_0x5500c8[_0xe0f1('0x27')]+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194['VoiceExtensionId']});_0x4625f7[_0xe0f1('0x17')]({'type':_0x333194['type'],'app':_0xe0f1('0x12'),'appdata':_0xe0f1('0x31'),'context':_0x333194['context'],'exten':_0x333194['exten'],'priority':_0x5500c8['length']+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194['VoiceExtensionId']});}else{_0x4625f7['push']({'type':_0x333194[_0xe0f1('0x11')],'app':'ExecIf','appdata':_0xe0f1('0x32'),'context':_0x333194['context'],'exten':_0x333194[_0xe0f1('0x8')],'priority':_0x5500c8[_0xe0f1('0x27')]+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194[_0xe0f1('0x15')]});_0x4625f7[_0xe0f1('0x17')]({'type':_0x333194['type'],'app':'Set','appdata':_0xe0f1('0x33'),'context':_0x333194[_0xe0f1('0x14')],'exten':_0x333194[_0xe0f1('0x8')],'priority':_0x5500c8[_0xe0f1('0x27')]+_0x3c76ac[_0xe0f1('0xd')]+_0x45702a++,'VoiceExtensionId':_0x333194[_0xe0f1('0x15')]});}}}for(var _0x2b02b5=0x0;_0x2b02b5<_0x5500c8['length'];_0x2b02b5+=0x1){var _0x1143c7=_0x3c76ac[_0xe0f1('0xd')]+_0x5500c8[_0xe0f1('0x27')];var _0x4b9536=_0x2b02b5===_0x5500c8[_0xe0f1('0x27')]-0x1?_0x3c76ac[_0xe0f1('0xd')]+_0x4625f7[_0xe0f1('0x27')]+_0x25a036['length']+0x2:_0x3c76ac[_0xe0f1('0xd')]+_0x2b02b5+0x1;_0x4625f7['splice'](_0x2b02b5,0x0,{'type':_0x333194[_0xe0f1('0x11')],'app':_0xe0f1('0x34'),'appdata':_0x5500c8[_0x2b02b5]+'?'+_0x333194[_0xe0f1('0x14')]+',${EXTEN},'+_0x1143c7+':'+_0x333194[_0xe0f1('0x14')]+_0xe0f1('0x35')+_0x4b9536,'exten':_0x333194['exten'],'context':_0x333194[_0xe0f1('0x14')],'priority':_0x3c76ac[_0xe0f1('0xd')]+_0x2b02b5,'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});}_0x333194[_0xe0f1('0xd')]=_0x4625f7[_0xe0f1('0x27')]?_[_0xe0f1('0x36')](_0x4625f7)[_0xe0f1('0xd')]+0x1:_0x3c76ac['priority'];_0x3c76ac[_0xe0f1('0xd')]=(_0x25a036[_0xe0f1('0x27')]?_[_0xe0f1('0x36')](_0x25a036)[_0xe0f1('0xd')]:_0x333194[_0xe0f1('0xd')])+0x1;_0x3c76ac[_0xe0f1('0x10')]=_['concat'](_0x3c76ac[_0xe0f1('0x10')],_0x4625f7,[_0x333194],_0x25a036);}_0x3c76ac['extensions'][_0xe0f1('0x17')]({'type':_0x50836d[_0x51e540][0x0][_0xe0f1('0x11')],'app':_0xe0f1('0x37'),'exten':_0x50836d[_0x51e540][0x0][_0xe0f1('0x8')],'context':_0x50836d[_0x51e540][0x0][_0xe0f1('0x14')],'priority':_0x3c76ac['priority'],'VoiceExtensionId':_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]});_0x2a62d0[_0xe0f1('0x17')](_0x50836d[_0x51e540][0x0][_0xe0f1('0x15')]);_0xf1fe38=_[_0xe0f1('0x38')](_0xf1fe38,_0x3c76ac['extensions']);}}return _0xc073a6[_0xe0f1('0x39')](function(_0x2dc40f){return _0xc073a6[_0xe0f1('0x0')][_0xe0f1('0x3a')][_0xe0f1('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x2a62d0}},'transaction':_0x2dc40f})[_0xe0f1('0x2')](function(_0x3abfe2){return _0xc073a6['models'][_0xe0f1('0x3a')][_0xe0f1('0x3c')](_[_0xe0f1('0x3d')](_0xf1fe38,'priority'),{'transaction':_0x2dc40f});});});})[_0xe0f1('0x3e')](function(_0x13e903){console[_0xe0f1('0x3f')](_0x13e903);});}exports[_0xe0f1('0x40')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index cb4af85..435c929 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 _0xbaf0=['YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','cm_contacts','str','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','pause','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate'];(function(_0x262d7b,_0x3ec3e8){var _0x582939=function(_0x565e2a){while(--_0x565e2a){_0x262d7b['push'](_0x262d7b['shift']());}};_0x582939(++_0x3ec3e8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require('bluebird');var util=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var fs=require('fs');var squel=require(_0x0baf('0x2'));var Papa=require(_0x0baf('0x3'));var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));config[_0x0baf('0x8')]=_[_0x0baf('0x9')](config[_0x0baf('0x8')],{'host':_0x0baf('0xa'),'port':0x18eb});var socket=require(_0x0baf('0xb'))(new Redis(config[_0x0baf('0x8')]));require(_0x0baf('0xc'))['register'](socket);try{if(!process[_0x0baf('0xd')][0x2]||process['argv'][0x2]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x2]===_0x0baf('0xf')){throw new Error(_0x0baf('0x10'));}var FILEPATH=process[_0x0baf('0xd')][0x2];if(!process[_0x0baf('0xd')][0x3]||process[_0x0baf('0xd')][0x3]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x3]===_0x0baf('0xf')||!process[_0x0baf('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x0baf('0xd')][0x4]===_0x0baf('0xf')){throw new Error(_0x0baf('0x11'));}var FIELDS=_[_0x0baf('0x12')](process['argv'][0x3][_0x0baf('0x13')](','),process['argv'][0x4][_0x0baf('0x13')](','));if(!process[_0x0baf('0xd')][0x5]||process[_0x0baf('0xd')][0x5]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x5]===_0x0baf('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0baf('0xd')][0x6]&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x7]:null;if(!process[_0x0baf('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x0baf('0xd')][0x8]===_0x0baf('0xf')){throw new Error(_0x0baf('0x14'));}var SOCKET_TIMESTAMP=process[_0x0baf('0xd')][0x8];}catch(_0x1fa92b){logger[_0x0baf('0x15')](_0x1fa92b);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(_0x210cd8,_0x636a13,_0x2c42e2,_0x15a2c3){var _0x54f2fa={'message':_0x636a13};_0x54f2fa[_0x210cd8]=!![];if(_0x2c42e2){_0x54f2fa[_0x0baf('0x16')]=_0x2c42e2;}if(_0x15a2c3){_0x54f2fa['index']=_0x15a2c3;}return _0x54f2fa;}function isEmail(_0xf6c158){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'](_0xf6c158);}function checkRow(_0x4de74c,_0x2ef0aa,_0x48a0e9){return new BPromise(function(_0x4be1b9,_0x47c4b){if(_[_0x0baf('0x17')](_0x4de74c)){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x18'),null,_0x48a0e9));}if(_0x4de74c[_0x0baf('0x19')]&&_0x4de74c['errors'][_0x0baf('0x1a')]){var _0x4681c5=_[_0x0baf('0x1b')](_0x4de74c[_0x0baf('0x19')],_0x0baf('0x1c'))[_0x0baf('0x1d')](';');return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x4681c5,null,_0x48a0e9));}var _0x549fd0={};for(var _0x1590b4 in FIELDS){if(FIELDS[_0x0baf('0x1e')](_0x1590b4)&&FIELDS[_0x1590b4]){_0x549fd0[_0x1590b4]=_0x4de74c[_0x0baf('0x1f')][0x0][FIELDS[_0x1590b4]]||_0x4de74c[_0x0baf('0x1f')][0x0]['\ufeff'+FIELDS[_0x1590b4]];}}if(!_0x549fd0['firstName']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x20'),null,_0x48a0e9));}if(!_0x549fd0['phone']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x21'),null,_0x48a0e9));}if(_0x549fd0[_0x0baf('0x22')]){var _0xb4dbb1=moment(_0x549fd0[_0x0baf('0x22')],_0x0baf('0x23'));if(!_0xb4dbb1[_0x0baf('0x24')]()){return _0x47c4b(handleCheckRowError('error',_0x0baf('0x25'),null,_0x48a0e9));}}if(_0x549fd0[_0x0baf('0x26')]){if(!isEmail(_0x549fd0[_0x0baf('0x26')])){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x27'),null,_0x48a0e9));}}_0x549fd0[_0x0baf('0x28')]=LISTID;_0x549fd0[_0x0baf('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0baf('0x1a')]&&_0x2ef0aa){var _0x59431b={};for(var _0x3ded64=0x0,_0x2adfd7=DUPLICATES[_0x0baf('0x1a')];_0x3ded64<_0x2adfd7;_0x3ded64+=0x1){_0x59431b[DUPLICATES[_0x3ded64]]=_0x549fd0[DUPLICATES[_0x3ded64]];}var _0x45294a=_[_0x0baf('0x2a')](_0x2ef0aa,_0x59431b);if(_0x45294a){return _0x47c4b(handleCheckRowError('duplicate',_0x0baf('0x2b'),_0x45294a,_0x48a0e9));}}return db['CmContact'][_0x0baf('0x2c')](_0x549fd0,{'raw':!![],'hooks':![],'fields':_[_0x0baf('0x2d')](_0x549fd0)})[_0x0baf('0x2e')](function(_0x3d65f2){if(DUPLICATES&&DUPLICATES['length']&&_0x2ef0aa){_0x2ef0aa[_0x0baf('0x2f')](_[_0x0baf('0x30')](_0x549fd0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d65f2['id'];return _0x4be1b9();})['catch'](function(_0x23d890){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x31')+(_0x23d890[_0x0baf('0x1c')]||JSON[_0x0baf('0x32')](_0x23d890)),null,_0x48a0e9));});});}function checkHopper(){function _0x1b0991(){return function(_0xe03d82){logger[_0x0baf('0x15')]('cmContact',_0x0baf('0x33'),util[_0x0baf('0x34')](_0xe03d82,{'showHidden':![],'depth':null}));};}var _0x5b991f=function(_0x32c022,_0x57783c){var _0x5c545f=squel[_0x0baf('0x35')]()[_0x0baf('0x36')]('cm_hopper')['fromQuery']([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x28'),_0x57783c,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))[_0x0baf('0x3d')]('id','ContactId')[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x32c022['id'][_0x0baf('0x3f')](),_0x57783c)[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3a'))[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')]('cm_contacts')[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID['toString']())[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'))[_0x0baf('0x40')](_0x0baf('0x46'))[_0x0baf('0x41')](_0x57783c+'\x20=\x20?',_0x32c022['id'][_0x0baf('0x3f')]())))[_0x0baf('0x3f')]();return _0x5c545f;};var _0x1daf1d=function(_0x339aff,_0x22207a){var _0x55f4f8=squel[_0x0baf('0x35')]()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),'scheduledAt',_0x0baf('0x39'),_0x0baf('0x28'),_0x22207a,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),'phone')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))['field']('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x339aff['id'][_0x0baf('0x3f')](),_0x22207a)[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3a'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')]('calleridnum')[_0x0baf('0x40')](_0x0baf('0x4a'))[_0x0baf('0x41')](_0x22207a+_0x0baf('0x4b'),_0x339aff['id'][_0x0baf('0x3f')]()))[_0x0baf('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0baf('0x3c')]()['field'](_0x0baf('0x37'))['from'](_0x0baf('0x46'))['where'](_0x22207a+_0x0baf('0x4b'),_0x339aff['id']['toString']())))[_0x0baf('0x3f')]();return _0x55f4f8;};function _0xcf7b8d(_0x411c1f,_0x4520d1){var _0x42a68b=squel['insert']()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),'ListId',_0x4520d1,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')]('NOW()','scheduledAt')[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x411c1f['id'][_0x0baf('0x3f')](),_0x4520d1)[_0x0baf('0x3d')](_0x0baf('0x3e'),'createdAt')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))['where'](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))[_0x0baf('0x3f')]();return _0x42a68b;}function _0x498405(_0x178495,_0x5dc434){var _0x3c00e7=squel['insert']()['into'](_0x0baf('0x4d'))['fromQuery']([_0x0baf('0x37'),_0x0baf('0x39'),'ListId',_0x5dc434,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()['field']('phone',_0x0baf('0x37'))[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x178495['id']['toString'](),_0x5dc434)['field']('NOW()',_0x0baf('0x3a'))['field']('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')]('ListId\x20=\x20?',LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))['toString']();return _0x3c00e7;}return db[_0x0baf('0x4e')][_0x0baf('0x4f')]({'where':{'type':_0x0baf('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x2c20fe){var _0x125906=[];if(_0x2c20fe){var _0x27a959;for(var _0x4cc046=0x0,_0x5874cc;_0x4cc046<_0x2c20fe['length'];_0x4cc046+=0x1){_0x5874cc=_0x2c20fe[_0x4cc046]['get']({'plain':!![]});switch(_0x5874cc[_0x0baf('0x53')]){case _0x0baf('0x54'):_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x1daf1d(_0x5874cc,_0x0baf('0x57')))['then'](function(){})['catch'](_0x1b0991()));break;case _0x0baf('0x58'):_0x125906['push'](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x5874cc,'VoiceQueueId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;default:_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x5874cc,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}}return _0x125906;})[_0x0baf('0x5a')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x333b07){var _0x20a514=[];if(_0x333b07){var _0x5093f5;for(var _0x1be7f2=0x0,_0x410f6c;_0x1be7f2<_0x333b07['length'];_0x1be7f2+=0x1){_0x410f6c=_0x333b07[_0x1be7f2]['get']({'plain':!![]});_0x20a514[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x498405(_0x410f6c,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x20a514;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id',_0x0baf('0x53')],'include':[{'model':db['CmList'],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x538f24){var _0x97d385=[];if(_0x538f24){for(var _0x4043d5=0x0,_0x421ca0;_0x4043d5<_0x538f24[_0x0baf('0x1a')];_0x4043d5+=0x1){_0x421ca0=_0x538f24[_0x4043d5][_0x0baf('0x5c')]({'plain':!![]});switch(_0x421ca0['dialCheckDuplicateType']){case'always':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x1daf1d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;case'onlyIfOpen':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x421ca0,'CampaignId'))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));break;default:_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));}}}return _0x97d385;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x1cbbcc){var _0x250df2=[];if(_0x1cbbcc){for(var _0xa4fd1b=0x0,_0x1cda78;_0xa4fd1b<_0x1cbbcc[_0x0baf('0x1a')];_0xa4fd1b+=0x1){_0x1cda78=_0x1cbbcc[_0xa4fd1b][_0x0baf('0x5c')]({'plain':!![]});_0x250df2[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x498405(_0x1cda78,'CampaignId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x250df2;})[_0x0baf('0x5a')]();})['catch'](function(_0x507783){logger[_0x0baf('0x15')](_0x0baf('0x5e'),_0x0baf('0x5f'),_0x507783[_0x0baf('0x1c')]);});}var processPromises=function(_0x2dcdfe){return BPromise[_0x0baf('0x5a')](promises)[_0x0baf('0x2e')](function(_0xa2d315){})[_0x0baf('0x59')](function(_0x4e8e85){logger[_0x0baf('0x15')](_0x0baf('0x60'),JSON[_0x0baf('0x32')](_0x4e8e85));})[_0x0baf('0x61')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2dcdfe){return _0x2dcdfe['resume']();}});};var endCsv=function(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x0baf('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0baf('0x64')](FILEPATH);}catch(_0x52e0c4){logger[_0x0baf('0x15')](_0x0baf('0x65'),JSON[_0x0baf('0x32')](_0x52e0c4));}finally{process[_0x0baf('0x66')](0x0);}});};process['on'](_0x0baf('0x67'),function(){logger[_0x0baf('0x68')](_0x0baf('0x69'));endCsv();});function main(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0baf('0x13')](',');return db[_0x0baf('0x6a')][_0x0baf('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1ed607){var _0xd0f63b=fs[_0x0baf('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0baf('0x6c')](_0xd0f63b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c37b4,_0x195303){total+=0x1;var _0x49d411=total;promises[_0x0baf('0x2f')](checkRow(_0x3c37b4,_0x1ed607,_0x49d411)[_0x0baf('0x2e')](function(){success+=0x1;})[_0x0baf('0x59')](function(_0x457ae8){if(_0x457ae8[_0x0baf('0x15')]){errors+=0x1;delete _0x457ae8['error'];}else if(_0x457ae8[_0x0baf('0x6d')]){duplicates+=0x1;delete _0x457ae8[_0x0baf('0x6d')];}rows[_0x0baf('0x2f')](_0x457ae8);}));if(total%0xc8===0x0){_0x195303[_0x0baf('0x6e')]();return processPromises(_0x195303);}},'complete':function(){return processPromises()[_0x0baf('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xb5f4e5,_0x5a2454){logger[_0x0baf('0x68')]('CSV\x20parse\x20error',JSON[_0x0baf('0x32')](_0xb5f4e5));endCsv();}});})[_0x0baf('0x59')](function(_0x1ce7bb){logger[_0x0baf('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0baf('0x32')](_0x1ce7bb));});}main(); \ No newline at end of file +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(_0x380a6b,_0x724b52){var _0x1ae7c3=function(_0x27b937){while(--_0x27b937){_0x380a6b['push'](_0x380a6b['shift']());}};_0x1ae7c3(++_0x724b52);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xcb91[_0x26b5ff];return _0x58603e;};'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 diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3876f26..e8a4010 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 _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x167ee5,_0x3f216a){var _0x3b3b04=function(_0x246431){while(--_0x246431){_0x167ee5['push'](_0x167ee5['shift']());}};_0x3b3b04(++_0x3f216a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){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))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x2289eb,_0x4f1848){var _0x4e3998=function(_0x519651){while(--_0x519651){_0x2289eb['push'](_0x2289eb['shift']());}};_0x4e3998(++_0x4f1848);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){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))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index ba09d33..91a1cce 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6556=['firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','orderBy','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','squel','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','cm_contacts_temp_','test','select','field','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','CmHopper','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','scheduledat','ContactId','ListId','updatedAt','priority','recallme','fields','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','fromQuery','createdAt','cm_contacts.ListId\x20=\x20','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','message','exit','errors','code','sequelize','query','stringify','start','binding','socket_timestamp','root','.csv','ContactItemType','findAll','name','writeFileSync','parse','createReadStream','data','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD'];(function(_0x4a4106,_0x4bf078){var _0x40ca88=function(_0x1af475){while(--_0x1af475){_0x4a4106['push'](_0x4a4106['shift']());}};_0x40ca88(++_0x4bf078);}(_0x6556,0xc1));var _0x6655=function(_0x2f6097,_0x24d316){_0x2f6097=_0x2f6097-0x0;var _0x1a0ff0=_0x6556[_0x2f6097];return _0x1a0ff0;};'use strict';var fs=require('fs');var path=require(_0x6655('0x0'));var _=require('lodash');var Papa=require(_0x6655('0x1'));var util=require('util');var BPromise=require(_0x6655('0x2'));var moment=require('moment');var squel=require(_0x6655('0x3'));var Redis=require('ioredis');var db=require(_0x6655('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x6655('0x5'))(_0x6655('0x6'));config[_0x6655('0x7')]=_[_0x6655('0x8')](config[_0x6655('0x7')],{'host':_0x6655('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6655('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x6655('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x6655('0xb')+moment()[_0x6655('0xa')]('YYYYMMDDHHmmss');var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x1bd59b){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))*$/[_0x6655('0xc')](_0x1bd59b);}function selectNotIn(_0x22724a,_0x195bf7,_0xfbe93f,_0x4d4360,_0x3790c2){return squel[_0x6655('0xd')]()[_0x6655('0xe')]('phone')['from'](_0x4d4360)[_0x6655('0xf')](_0x195bf7,null,_0x195bf7+_0x6655('0x10')+_0x4d4360+'.'+_0xfbe93f)['where'](_0x4d4360+'.'+_0xfbe93f+_0x6655('0x11')+_0x22724a+'.'+_0xfbe93f)[_0x6655('0x12')](_0x195bf7+_0x6655('0x13')+_0x3790c2[_0x6655('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x155ebb,_0x45b604){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x6655('0x14')+tempTableName)[_0x6655('0x15')](function(_0x1c416c){if(_0x1c416c!==null){var _0x1d7721=[];for(var _0x52e32f=0x0;_0x52e32f<_0x1c416c[_0x6655('0x16')];_0x52e32f++){var _0x330730=_0x1c416c[_0x52e32f];if(!_[_0x6655('0x17')](_0x330730[_0x6655('0x18')])){if(!_[_0x6655('0x17')](_0x330730[_0x6655('0x19')]))_0x1d7721[_0x6655('0x1a')](insertAdditionalPhones(_0x330730));promisesContact[_0x6655('0x1a')]({'contact':_0x330730});}}}Promise[_0x6655('0x1b')](_0x1d7721)[_0x6655('0x1c')](function(){_0x155ebb({'val':0x1});});})[_0x6655('0x1d')](function(_0x975cbd){logger[_0x6655('0x1e')](_0x975cbd['message']);});});}function insertAdditionalPhones(_0x5a6e87){return new Promise(function(_0x2b7823,_0x45a885){var _0x47fdcc=_0x5a6e87[_0x6655('0x19')];if(_['isNil'](_0x47fdcc))_0x45a885({'val':0x0});else{var _0x8fb12a=_0x47fdcc[_0x6655('0x1f')](';');var _0x439eee=[];orderBy=0x0;for(var _0x18233f=0x0;_0x18233f<_0x8fb12a['length'];_0x18233f++){_0x439eee[_0x6655('0x1a')](splitAdditionalPhone(_0x5a6e87['id'],_0x8fb12a[_0x18233f]));}Promise[_0x6655('0x1b')](_0x439eee)[_0x6655('0x1c')](function(){_0x2b7823({'val':_0x8fb12a[_0x6655('0x16')]});});}});}function splitAdditionalPhone(_0x128e0f,_0x353692){return new Promise(function(_0x11a33f,_0x19421d){var _0x313eaf=_0x353692[_0x6655('0x1f')](':');var _0x4fef79=_0x313eaf[0x0];var _0x4a6b07=_0x313eaf[0x1];if(_0x4a6b07!==''){var _0x3d79fc=_0x4a6b07['split']('|');var _0x320dcd=[];for(var _0xf1f07a=0x0;_0xf1f07a<_0x3d79fc[_0x6655('0x16')];_0xf1f07a++){if(_0x3d79fc[_0xf1f07a]!==''){var _0x1f0f4e=_[_0x6655('0x20')](promisesAdditionalPhones,{'contactId':_0x128e0f,'phone':_0x3d79fc[_0xf1f07a]});if(_0x1f0f4e['length']==0x0){orderBy++;promisesAdditionalPhones[_0x6655('0x1a')]({'contactId':_0x128e0f,'contactTypeId':_0x4fef79,'phone':_0x3d79fc[_0xf1f07a],'orderBy':orderBy});}}}_0x11a33f({'ok':0x1});}else _0x11a33f({'res':0x0});});}function createAdditionalPhone(_0x525b15,_0x5cbeb1,_0x29234d,_0x3f2af5){return new Promise(function(_0x5dcfbd,_0x4bf22e){return db[_0x6655('0x21')][_0x6655('0x22')]({'where':{'CmContactId':_0x525b15,'item':_0x29234d}})[_0x6655('0x1c')](function(_0x4f47fd){if(_0x4f47fd){return db[_0x6655('0x21')][_0x6655('0x23')]({'ItemTypeId':_0x5cbeb1,'OrderBy':_0x3f2af5},{'where':{'CmContactId':_0x525b15,'item':_0x29234d}})[_0x6655('0x1c')](function(_0x196b88){_0x5dcfbd({'res':_0x6655('0x24')});});}else{return db[_0x6655('0x21')][_0x6655('0x25')]({'CmContactId':_0x525b15,'item':_0x29234d,'ItemTypeId':_0x5cbeb1,'OrderBy':_0x3f2af5,'ItemClass':_0x6655('0x26')})[_0x6655('0x1c')](function(_0x29a0dc){_0x5dcfbd({'res':'inserted'});});}});});}function updateContact(_0x873efe){return new Promise(function(_0x238741,_0x20d18f){var _0x2ca1fe=_0x873efe['id'];delete _0x873efe['id'];return db['CmContact']['update'](_0x873efe,{'where':{'id':_0x2ca1fe}})['then'](function(_0x280704){updatedRows+=0x1;return db[_0x6655('0x27')]['update']({'phone':_0x873efe['phone']},{'where':{'ContactId':_0x2ca1fe}})[_0x6655('0x1c')](function(_0x321d24){_0x238741({'ret':'OK'});});});});}function insertCmHopper(_0x462832,_0x167c42,_0x2a0068,_0xa49958,_0x1a8368){var _0xc7293d=['cm_contacts.phone',_0x6655('0x28'),_0x6655('0x29'),_0x6655('0x2a'),_0x167c42+'.'+_0xa49958,_0x6655('0x2b'),_0x6655('0x2c'),_0x6655('0x2d'),_0x6655('0x2e'),'\x22'+_0x1a8368+'\x22'];return squel[_0x6655('0x2f')]()[_0x6655('0x30')](_0x6655('0x31'))['fromQuery']([_0x6655('0x18'),_0x6655('0x32'),_0x6655('0x33'),_0x6655('0x34'),_0xa49958,'createdAt',_0x6655('0x35'),_0x6655('0x36'),'UserId',_0x6655('0x37')],squel[_0x6655('0xd')]()[_0x6655('0x38')](_0xc7293d)[_0x6655('0x39')](_0x167c42)[_0x6655('0xf')](_0x6655('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0x167c42+_0x6655('0x3b'))[_0x6655('0xf')](_0x2a0068,null,_0x2a0068+_0x6655('0x10')+_0x167c42+'.'+_0xa49958)['where'](_0x167c42+_0x6655('0x3c'),_0x462832)[_0x6655('0x12')](_0x6655('0x3d'),NOW)['where'](_0x6655('0x3e'),selectNotIn(_0x167c42,_0x2a0068,_0xa49958,_0x6655('0x31'),[_0x6655('0x3f'),_0x6655('0x40')]))[_0x6655('0x12')](_0x6655('0x3e'),selectNotIn(_0x167c42,_0x2a0068,_0xa49958,_0x6655('0x31'),[_0x6655('0x3f')])))[_0x6655('0x41')]();}function insertCmHopperBlack(_0x311768,_0x477bfb,_0x507b64,_0x44398d){var _0x371d49=[_0x6655('0x42'),_0x6655('0x29'),_0x6655('0x2a'),_0x477bfb+'.'+_0x44398d,_0x6655('0x2b'),_0x6655('0x2c')];return squel[_0x6655('0x2f')]()[_0x6655('0x30')]('cm_hopper_black')[_0x6655('0x43')]([_0x6655('0x18'),_0x6655('0x33'),_0x6655('0x34'),_0x44398d,_0x6655('0x44'),_0x6655('0x35')],squel[_0x6655('0xd')]()[_0x6655('0x38')](_0x371d49)[_0x6655('0x39')](_0x477bfb)['join'](_0x6655('0x3a'),null,_0x6655('0x45')+_0x477bfb+_0x6655('0x3b'))[_0x6655('0xf')](_0x507b64,null,_0x507b64+'.id\x20=\x20'+_0x477bfb+'.'+_0x44398d)[_0x6655('0x12')](_0x477bfb+_0x6655('0x3c'),_0x311768)[_0x6655('0x12')](_0x6655('0x3d'),NOW)['where'](_0x6655('0x3e'),squel['select']()[_0x6655('0xe')](_0x6655('0x18'))[_0x6655('0x39')](_0x6655('0x46'))['where'](_0x6655('0x47'),_0x311768)[_0x6655('0x12')](_0x44398d+_0x6655('0x48'),_0x477bfb+'.'+_0x44398d)))['toString']();}function insertCmHopperAdditionalPhones(_0x4afad7){var _0x23a756=[_0x6655('0x49'),_0x6655('0x4a'),_0x6655('0x4b'),'cm_contact_has_items.createdAt',_0x6655('0x4c')];return squel[_0x6655('0x2f')]()[_0x6655('0x30')](_0x6655('0x4d'))[_0x6655('0x43')]([_0x6655('0x4e'),_0x6655('0x18'),_0x6655('0x4f'),_0x6655('0x44'),_0x6655('0x35')],squel[_0x6655('0xd')]()['fields'](_0x23a756)[_0x6655('0x39')](_0x6655('0x31'))['join'](_0x6655('0x3a'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x6655('0xf')]('cm_contact_has_items',null,_0x6655('0x50'))[_0x6655('0x12')](_0x6655('0x51'),_0x4afad7)[_0x6655('0x12')](_0x6655('0x3d'),NOW))[_0x6655('0x41')]();}function insertCmContact(_0x2d907b,_0x5d3c51,_0x18f6ed,_0x1ab739){var _0x4e271a=_['concat'](_[_0x6655('0x52')](_0x1ab739),[_0x6655('0x34'),'CompanyId',_0x6655('0x44'),_0x6655('0x35')]);return squel['insert']()['into']('cm_contacts')[_0x6655('0x43')](_0x4e271a,squel[_0x6655('0xd')]()[_0x6655('0x38')](_0x4e271a)[_0x6655('0x39')](_0x5d3c51)[_0x6655('0x12')]('('+_0x18f6ed[_0x6655('0xf')](',')+_0x6655('0x53'),squel[_0x6655('0xd')]()[_0x6655('0x38')](_0x18f6ed)['from'](_0x6655('0x3a'))[_0x6655('0x12')](_0x6655('0x47'),_0x2d907b))[_0x6655('0x12')]('id\x20IN\x20?',squel[_0x6655('0xd')]()[_0x6655('0xe')](_0x6655('0x54'),_0x6655('0x55'))[_0x6655('0x39')](_0x5d3c51)[_0x6655('0x56')](_0x18f6ed['join'](','))))['toString']();}function handleStop(){logger[_0x6655('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4413f5){logger[_0x6655('0x1e')](_0x4413f5[_0x6655('0x58')]);process[_0x6655('0x59')](0x1);}function handleError(_0x158b4f,_0x3da9a1){stats[_0x6655('0x5a')][_0x6655('0x1a')]({'name':_0x3da9a1[_0x6655('0x5b')],'message':_0x3da9a1['message'],'row':_0x158b4f});}function handleQuery(_0x2dffc2){logger[_0x6655('0x57')](_0x2dffc2);return db[_0x6655('0x5c')][_0x6655('0x5d')](_0x2dffc2)[_0x6655('0x15')](function(_0x154ac9){results[_0x6655('0x1a')](_0x154ac9);})[_0x6655('0x1d')](function(_0x41aca7){logger[_0x6655('0x1e')](_0x41aca7['message']);});}function main(_0x518c76,_0x3f12bb,_0x3ae8e3,_0x3e6b4b){logger[_0x6655('0x57')]('main',_0x518c76,JSON[_0x6655('0x5e')](_0x3f12bb));process['send'](_0x6655('0x5f'));var _0x19726a=_0x3f12bb[_0x6655('0x60')];var _0x76b565=_['clone'](_0x19726a);var _0xff9512=_0x3f12bb[_0x6655('0x61')];var _0x4dc455=path[_0x6655('0xf')](config[_0x6655('0x62')],'server/files/tmp',_0xff9512+_0x6655('0x63'));logger[_0x6655('0x57')]('body',_0x3f12bb);db[_0x6655('0x64')][_0x6655('0x65')]({'raw':!![],'attributes':['id',_0x6655('0x66')]})[_0x6655('0x1c')](function(_0x172dbe){for(var _0x453d99=0x0;_0x453d99<_0x172dbe[_0x6655('0x16')];_0x453d99++){if(_0x172dbe[_0x453d99]['name']in _0x19726a){contactItemTypes[_0x6655('0x1a')](_0x172dbe[_0x453d99]);delete _0x76b565[_0x172dbe[_0x453d99][_0x6655('0x66')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x76b565['AdditionalPhones']='';var _0x133c4c=_[_0x6655('0x52')](_0x76b565)[_0x6655('0xf')]();logger[_0x6655('0x57')]('header',_0x133c4c);fs[_0x6655('0x67')](_0x4dc455,_0x133c4c+'\x0a');Papa[_0x6655('0x68')](fs[_0x6655('0x69')](_0x518c76),{'header':!![],'skipEmptyLines':!![],'step':function(_0x30b403,_0x324c30){try{for(var _0x571ef2=0x0,_0x20782b=[];_0x571ef2<_0x30b403[_0x6655('0x6a')][_0x6655('0x16')];_0x571ef2++){stats['rows']+=0x1;if(_0x30b403[_0x6655('0x5a')][_0x571ef2]){handleError(_0x30b403['data'][_0x571ef2],_0x30b403[_0x6655('0x5a')][_0x571ef2]);}else{var _0x59cf03=[];var _0x5677de=[];for(var _0x20a744 in _0x19726a){let _0x819adf=contactItemTypes['find'](_0x4c5629=>_0x4c5629[_0x6655('0x66')]===_0x20a744);if(_[_0x6655('0x17')](_0x819adf)){if(_0x19726a[_0x6655('0x6b')](_0x20a744)){if(_0x30b403[_0x6655('0x6a')][_0x571ef2][_0x19726a[_0x20a744]]){var _0x2413a8=_['trim'](_0x30b403['data'][_0x571ef2][_0x19726a[_0x20a744]][_0x6655('0x6c')](/"/g,'\x27'));switch(_0x20a744){case _0x6655('0x32'):var _0x2faa59=moment(_0x2413a8,_0x6655('0x6d'),!![]);if(_0x2faa59[_0x6655('0x6e')]()){_0x20782b[_0x6655('0x1a')]('\x22'+_0x2413a8+'\x22');}else{_0x59cf03['push'](_0x6655('0x6f'));}break;case'priority':var _0x26d6ad=parseInt(_0x2413a8);_0x2413a8=_[_0x6655('0x70')](_0x26d6ad)||_0x26d6ad<0x0||_0x26d6ad>0x4?_0x3e6b4b?0x3:0x2:_0x26d6ad;_0x20782b[_0x6655('0x1a')]('\x22'+_0x2413a8+'\x22');break;case _0x6655('0x71'):var _0x431958=parseInt(_0x2413a8);if(_[_0x6655('0x72')](_0x431958)&&_[_0x6655('0x73')](_0x3ae8e3,_0x431958)){_0x20782b[_0x6655('0x1a')]('\x22'+_0x431958+'\x22');}else{_0x59cf03[_0x6655('0x1a')](_0x6655('0x74'));}break;case _0x6655('0x75'):if(isEmail(_0x2413a8)){_0x20782b[_0x6655('0x1a')]('\x22'+_0x2413a8+'\x22');}else{_0x59cf03[_0x6655('0x1a')](_0x6655('0x76'));}break;case _0x6655('0x77'):var _0x407f89=moment(_0x2413a8,_0x6655('0x78'),!![]);if(_0x407f89[_0x6655('0x6e')]()){_0x20782b[_0x6655('0x1a')]('\x22'+_0x2413a8+'\x22');}else{_0x59cf03[_0x6655('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x20782b[_0x6655('0x1a')]('\x22'+_0x2413a8+'\x22');}}else{switch(_0x20a744){case _0x6655('0x79'):case _0x6655('0x18'):_0x59cf03[_0x6655('0x1a')](_0x20a744+_0x6655('0x7a'));break;default:_0x20782b[_0x6655('0x1a')]('\x22\x22');}}}}else{var _0x1d5df9='';for(var _0x232ec4=0x0;_0x232ec4<_0x19726a[_0x20a744]['length'];_0x232ec4++){var _0x2413a8=_['trim'](_0x30b403[_0x6655('0x6a')][_0x571ef2][_0x19726a[_0x20a744][_0x232ec4]]['replace'](/"/g,'\x27'));if(_0x1d5df9=='')_0x1d5df9=_0x2413a8;else _0x1d5df9+='|'+_0x2413a8;}_0x5677de['push'](_0x819adf['id']+':'+_0x1d5df9);}}if(hasAdditionalPhones){_0x20782b[_0x6655('0x1a')]('\x22'+_0x5677de['join'](';')+'\x22');}if(_0x59cf03[_0x6655('0x16')]){handleError(_0x30b403[_0x6655('0x6a')][_0x571ef2],{'code':_0x6655('0x7b'),'message':_0x59cf03[_0x6655('0xf')]()});}else{fs[_0x6655('0x7c')](_0x4dc455,_0x20782b[_0x6655('0xf')]()+'\x0a');}_0x20782b=[];}if(!(stats[_0x6655('0x7d')]%0xc8)){socket[_0x6655('0x7e')](_0x6655('0x7f')+_0xff9512,stats);stats[_0x6655('0x5a')]=[];}}if(stopped){logger[_0x6655('0x57')](_0x6655('0x80'));_0x324c30[_0x6655('0x81')]();}}catch(_0x4aa254){handleError(_0x30b403[_0x6655('0x6a')][_0x571ef2],{'code':_0x6655('0x82'),'message':_0x4aa254[_0x6655('0x58')]});logger[_0x6655('0x1e')](_0x6655('0x83'),_0x4aa254[_0x6655('0x58')]);}},'complete':function(){try{var _0x245c3f=[];var _0x46bcfc=tempTableName;_0x245c3f[_0x6655('0x1a')](_0x6655('0x84')+_0x46bcfc+_0x6655('0x85'));logger[_0x6655('0x57')](_0x6655('0x86'),contactItemTypes[_0x6655('0x16')]);var _0x4cac50=util['format'](_0x6655('0x87'),_0x4dc455,_0x46bcfc,_0x133c4c,_0x3f12bb['ListId'],_0x3f12bb[_0x6655('0x88')]||null,NOW,NOW);if(_['isNil'](_0x19726a['scheduledat'])){_0x4cac50+=_0x6655('0x89');}_0x245c3f[_0x6655('0x1a')](_0x4cac50);BPromise[_0x6655('0x8a')](_0x245c3f,handleQuery)[_0x6655('0x1c')](function(_0xab6738){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x245c3f=[];for(var _0x177900=0x0;_0x177900\x20\x20','file\x20doesn\x27t\x20exists'];(function(_0x4adf2d,_0x371ea9){var _0x1e3260=function(_0x187ff2){while(--_0x187ff2){_0x4adf2d['push'](_0x4adf2d['shift']());}};_0x1e3260(++_0x371ea9);}(_0x96ff,0x1d2));var _0xf96f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x96ff[_0x40a045];return _0x1a687c;};'use strict';var fs=require('fs');var path=require(_0xf96f('0x0'));var _=require('lodash');var Papa=require(_0xf96f('0x1'));var util=require(_0xf96f('0x2'));var BPromise=require(_0xf96f('0x3'));var moment=require(_0xf96f('0x4'));var squel=require(_0xf96f('0x5'));var Redis=require(_0xf96f('0x6'));var db=require(_0xf96f('0x7'))['db'];var config=require(_0xf96f('0x8'));var logger=require(_0xf96f('0x9'))('import');config[_0xf96f('0xa')]=_['defaults'](config[_0xf96f('0xa')],{'host':_0xf96f('0xb'),'port':0x18eb});var socket=require(_0xf96f('0xc'))(new Redis(config[_0xf96f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xf96f('0xd'));var tempTableName=_0xf96f('0xe')+moment()[_0xf96f('0xf')](_0xf96f('0x10'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x3d2036){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))*$/[_0xf96f('0x11')](_0x3d2036);}function selectNotIn(_0x4f7348,_0x5788f8,_0x482650,_0x269a49,_0x557f7b){return squel[_0xf96f('0x12')]()['field'](_0xf96f('0x13'))[_0xf96f('0x14')](_0x269a49)[_0xf96f('0x15')](_0x5788f8,null,_0x5788f8+_0xf96f('0x16')+_0x269a49+'.'+_0x482650)[_0xf96f('0x17')](_0x269a49+'.'+_0x482650+_0xf96f('0x18')+_0x4f7348+'.'+_0x482650)['where'](_0x5788f8+_0xf96f('0x19')+_0x557f7b[_0xf96f('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5ec5a8,_0xaa7b6c){promisesAdditionalPhones=[];promisesContact=[];return db[_0xf96f('0x1a')][_0xf96f('0x1b')](_0xf96f('0x1c')+tempTableName)[_0xf96f('0x1d')](function(_0x5a09da){if(_0x5a09da!==null){var _0x499704=[];for(var _0x31dd82=0x0;_0x31dd82<_0x5a09da['length'];_0x31dd82++){var _0x18749b=_0x5a09da[_0x31dd82];if(!_[_0xf96f('0x1e')](_0x18749b[_0xf96f('0x13')])){if(!_[_0xf96f('0x1e')](_0x18749b['AdditionalPhones']))_0x499704[_0xf96f('0x1f')](insertAdditionalPhones(_0x18749b));promisesContact[_0xf96f('0x1f')]({'contact':_0x18749b});}}}Promise[_0xf96f('0x20')](_0x499704)[_0xf96f('0x21')](function(){_0x5ec5a8({'val':0x1});});})[_0xf96f('0x22')](function(_0x1e30ce){logger['error'](_0x1e30ce[_0xf96f('0x23')]);});});}function insertAdditionalPhones(_0x8a8942){return new Promise(function(_0x21f69,_0x822682){var _0x37b47a=_0x8a8942[_0xf96f('0x24')];if(_[_0xf96f('0x1e')](_0x37b47a))_0x822682({'val':0x0});else{var _0x406b42=_0x37b47a[_0xf96f('0x25')](';');var _0x3bb4f6=[];orderBy=0x0;for(var _0x4f1f7b=0x0;_0x4f1f7b<_0x406b42[_0xf96f('0x26')];_0x4f1f7b++){_0x3bb4f6['push'](splitAdditionalPhone(_0x8a8942['id'],_0x406b42[_0x4f1f7b]));}Promise[_0xf96f('0x20')](_0x3bb4f6)['then'](function(){_0x21f69({'val':_0x406b42[_0xf96f('0x26')]});});}});}function splitAdditionalPhone(_0x36b5bd,_0x287454){return new Promise(function(_0x31fcd4,_0x218091){var _0x1f6604=_0x287454['split'](':');var _0x5a1f3=_0x1f6604[0x0];var _0x20e072=_0x1f6604[0x1];if(_0x20e072!==''){var _0x4a35f5=_0x20e072[_0xf96f('0x25')]('|');var _0x2a73bf=[];for(var _0x5f3fad=0x0;_0x5f3fad<_0x4a35f5[_0xf96f('0x26')];_0x5f3fad++){if(_0x4a35f5[_0x5f3fad]!==''){var _0x3aa21e=_[_0xf96f('0x27')](promisesAdditionalPhones,{'contactId':_0x36b5bd,'phone':_0x4a35f5[_0x5f3fad]});if(_0x3aa21e[_0xf96f('0x26')]==0x0){orderBy++;promisesAdditionalPhones[_0xf96f('0x1f')]({'contactId':_0x36b5bd,'contactTypeId':_0x5a1f3,'phone':_0x4a35f5[_0x5f3fad],'orderBy':orderBy});}}}_0x31fcd4({'ok':0x1});}else _0x31fcd4({'res':0x0});});}function createAdditionalPhone(_0x4524e7,_0x59e40f,_0x35e103,_0x4ba0dd){return new Promise(function(_0x296919,_0x2f18e9){return db[_0xf96f('0x28')]['findOne']({'where':{'CmContactId':_0x4524e7,'item':_0x35e103}})[_0xf96f('0x21')](function(_0x33e727){if(_0x33e727){return db[_0xf96f('0x28')][_0xf96f('0x29')]({'ItemTypeId':_0x59e40f,'OrderBy':_0x4ba0dd},{'where':{'CmContactId':_0x4524e7,'item':_0x35e103}})['then'](function(_0x334e35){_0x296919({'res':'updated'});});}else{return db[_0xf96f('0x28')]['create']({'CmContactId':_0x4524e7,'item':_0x35e103,'ItemTypeId':_0x59e40f,'OrderBy':_0x4ba0dd,'ItemClass':_0xf96f('0x2a')})[_0xf96f('0x21')](function(_0x4c9c3b){_0x296919({'res':'inserted'});});}});});}function updateContact(_0x406b7f){return new Promise(function(_0x204986,_0x29396b){var _0x11a705=_0x406b7f['id'];delete _0x406b7f['id'];return db[_0xf96f('0x2b')][_0xf96f('0x29')](_0x406b7f,{'where':{'id':_0x11a705}})[_0xf96f('0x21')](function(_0x8957af){updatedRows+=0x1;return db[_0xf96f('0x2c')][_0xf96f('0x29')]({'phone':_0x406b7f[_0xf96f('0x13')]},{'where':{'ContactId':_0x11a705}})['then'](function(_0x2412b4){_0x204986({'ret':'OK'});});});});}function insertCmHopper(_0x543a01,_0x214566,_0x1e8029,_0x2bbded,_0x369cd0){var _0x5b5662=[_0xf96f('0x2d'),'cm_contacts.scheduledat','cm_contacts.id',_0xf96f('0x2e'),_0x214566+'.'+_0x2bbded,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x369cd0+'\x22'];return squel[_0xf96f('0x2f')]()['into']('cm_hopper')[_0xf96f('0x30')]([_0xf96f('0x13'),_0xf96f('0x31'),_0xf96f('0x32'),_0xf96f('0x33'),_0x2bbded,_0xf96f('0x34'),_0xf96f('0x35'),'priority',_0xf96f('0x36'),_0xf96f('0x37')],squel[_0xf96f('0x12')]()[_0xf96f('0x38')](_0x5b5662)['from'](_0x214566)[_0xf96f('0x15')](_0xf96f('0x39'),null,_0xf96f('0x3a')+_0x214566+_0xf96f('0x3b'))['join'](_0x1e8029,null,_0x1e8029+_0xf96f('0x16')+_0x214566+'.'+_0x2bbded)[_0xf96f('0x17')](_0x214566+_0xf96f('0x3c'),_0x543a01)[_0xf96f('0x17')](_0xf96f('0x3d'),NOW)[_0xf96f('0x17')](_0xf96f('0x3e'),selectNotIn(_0x214566,_0x1e8029,_0x2bbded,_0xf96f('0x3f'),[_0xf96f('0x40'),_0xf96f('0x41')]))[_0xf96f('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x214566,_0x1e8029,_0x2bbded,_0xf96f('0x3f'),[_0xf96f('0x40')])))[_0xf96f('0x42')]();}function insertCmHopperBlack(_0x3dc793,_0x22fd03,_0x3e8b15,_0x17b1b8){var _0x4bbae4=[_0xf96f('0x2d'),_0xf96f('0x43'),_0xf96f('0x2e'),_0x22fd03+'.'+_0x17b1b8,'cm_contacts.createdAt',_0xf96f('0x44')];return squel[_0xf96f('0x2f')]()[_0xf96f('0x45')](_0xf96f('0x46'))['fromQuery'](['phone',_0xf96f('0x32'),'ListId',_0x17b1b8,_0xf96f('0x34'),_0xf96f('0x35')],squel['select']()[_0xf96f('0x38')](_0x4bbae4)[_0xf96f('0x14')](_0x22fd03)[_0xf96f('0x15')](_0xf96f('0x39'),null,_0xf96f('0x3a')+_0x22fd03+'.CmListId')[_0xf96f('0x15')](_0x3e8b15,null,_0x3e8b15+_0xf96f('0x16')+_0x22fd03+'.'+_0x17b1b8)[_0xf96f('0x17')](_0x22fd03+_0xf96f('0x3c'),_0x3dc793)[_0xf96f('0x17')](_0xf96f('0x3d'),NOW)[_0xf96f('0x17')](_0xf96f('0x3e'),squel[_0xf96f('0x12')]()[_0xf96f('0x47')]('phone')[_0xf96f('0x14')](_0xf96f('0x46'))['where'](_0xf96f('0x48'),_0x3dc793)['where'](_0x17b1b8+_0xf96f('0x49'),_0x22fd03+'.'+_0x17b1b8)))['toString']();}function insertCmHopperAdditionalPhones(_0x2c6301){var _0x494afc=[_0xf96f('0x4a'),'cm_contact_has_items.item',_0xf96f('0x4b'),_0xf96f('0x4c'),_0xf96f('0x4d')];return squel[_0xf96f('0x2f')]()[_0xf96f('0x45')](_0xf96f('0x4e'))['fromQuery']([_0xf96f('0x4f'),_0xf96f('0x13'),_0xf96f('0x50'),_0xf96f('0x34'),_0xf96f('0x35')],squel[_0xf96f('0x12')]()[_0xf96f('0x38')](_0x494afc)[_0xf96f('0x14')](_0xf96f('0x3f'))[_0xf96f('0x15')](_0xf96f('0x39'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xf96f('0x15')](_0xf96f('0x51'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xf96f('0x17')](_0xf96f('0x52'),_0x2c6301)[_0xf96f('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xf96f('0x42')]();}function insertCmContact(_0x2c80d7,_0x2e35ad,_0x18d0fd,_0x46149a){var _0x1a73a1=_['concat'](_[_0xf96f('0x53')](_0x46149a),['ListId',_0xf96f('0x54'),_0xf96f('0x34'),_0xf96f('0x35')]);return squel[_0xf96f('0x2f')]()[_0xf96f('0x45')]('cm_contacts')[_0xf96f('0x30')](_0x1a73a1,squel[_0xf96f('0x12')]()[_0xf96f('0x38')](_0x1a73a1)['from'](_0x2e35ad)['where']('('+_0x18d0fd[_0xf96f('0x15')](',')+_0xf96f('0x55'),squel[_0xf96f('0x12')]()[_0xf96f('0x38')](_0x18d0fd)[_0xf96f('0x14')](_0xf96f('0x39'))[_0xf96f('0x17')](_0xf96f('0x48'),_0x2c80d7))['where']('id\x20IN\x20?',squel[_0xf96f('0x12')]()[_0xf96f('0x47')](_0xf96f('0x56'),_0xf96f('0x57'))[_0xf96f('0x14')](_0x2e35ad)[_0xf96f('0x58')](_0x18d0fd[_0xf96f('0x15')](','))))['toString']();}function handleStop(){logger[_0xf96f('0x59')](_0xf96f('0x5a'));stopped=!![];}function handleUncaughtException(_0x59152f){logger['error'](_0x59152f['message']);process['exit'](0x1);}function handleError(_0x4465d4,_0x4080d7){stats[_0xf96f('0x5b')][_0xf96f('0x1f')]({'name':_0x4080d7['code'],'message':_0x4080d7[_0xf96f('0x23')],'row':_0x4465d4});}function handleQuery(_0x39afcf){logger[_0xf96f('0x59')](_0x39afcf);return db['sequelize']['query'](_0x39afcf)[_0xf96f('0x1d')](function(_0x360c62){results['push'](_0x360c62);})[_0xf96f('0x22')](function(_0x57caf6){logger[_0xf96f('0x5c')](_0x57caf6[_0xf96f('0x23')]);});}function main(_0x5932fa,_0x46e8d0,_0x1face3,_0x33059d){logger[_0xf96f('0x59')](_0xf96f('0x5d'),_0x5932fa,JSON[_0xf96f('0x5e')](_0x46e8d0));process['send'](_0xf96f('0x5f'));var _0xb3d53a=_0x46e8d0[_0xf96f('0x60')];var _0x21557d=_[_0xf96f('0x61')](_0xb3d53a);var _0x290653=_0x46e8d0[_0xf96f('0x62')];var _0x2f22d4=path[_0xf96f('0x15')](config[_0xf96f('0x63')],_0xf96f('0x64'),_0x290653+_0xf96f('0x65'));logger[_0xf96f('0x59')](_0xf96f('0x66'),_0x46e8d0);db[_0xf96f('0x67')][_0xf96f('0x68')]({'raw':!![],'attributes':['id','name']})[_0xf96f('0x21')](function(_0x5461d0){for(var _0x5ab1c9=0x0;_0x5ab1c9<_0x5461d0['length'];_0x5ab1c9++){if(_0x5461d0[_0x5ab1c9][_0xf96f('0x69')]in _0xb3d53a){contactItemTypes[_0xf96f('0x1f')](_0x5461d0[_0x5ab1c9]);delete _0x21557d[_0x5461d0[_0x5ab1c9][_0xf96f('0x69')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x21557d[_0xf96f('0x24')]='';var _0x408b7d=_[_0xf96f('0x53')](_0x21557d)[_0xf96f('0x15')]();logger[_0xf96f('0x59')](_0xf96f('0x6a'),_0x408b7d);fs[_0xf96f('0x6b')](_0x2f22d4,_0x408b7d+'\x0a');Papa[_0xf96f('0x6c')](fs[_0xf96f('0x6d')](_0x5932fa),{'header':!![],'skipEmptyLines':!![],'step':function(_0x17c3de,_0x4b9719){try{for(var _0x19d094=0x0,_0x2bcc77=[];_0x19d094<_0x17c3de[_0xf96f('0x6e')]['length'];_0x19d094++){stats[_0xf96f('0x6f')]+=0x1;if(_0x17c3de[_0xf96f('0x5b')][_0x19d094]){handleError(_0x17c3de['data'][_0x19d094],_0x17c3de[_0xf96f('0x5b')][_0x19d094]);}else{var _0x28e700=[];var _0x12da3f=[];for(var _0xcf4507 in _0xb3d53a){let _0x2ecd44=contactItemTypes[_0xf96f('0x70')](_0x5904b7=>_0x5904b7[_0xf96f('0x69')]===_0xcf4507);if(_[_0xf96f('0x1e')](_0x2ecd44)){if(_0xb3d53a[_0xf96f('0x71')](_0xcf4507)){if(_0x17c3de[_0xf96f('0x6e')][_0x19d094][_0xb3d53a[_0xcf4507]]){var _0x13a6e6=_[_0xf96f('0x72')](_0x17c3de[_0xf96f('0x6e')][_0x19d094][_0xb3d53a[_0xcf4507]][_0xf96f('0x73')](/"/g,'\x27'));switch(_0xcf4507){case'scheduledat':var _0x1fd338=moment(_0x13a6e6,_0xf96f('0xd'),!![]);if(_0x1fd338[_0xf96f('0x74')]()){_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x13a6e6+'\x22');}else{_0x28e700[_0xf96f('0x1f')](_0xf96f('0x75'));}break;case'priority':var _0x4bb75b=parseInt(_0x13a6e6);_0x13a6e6=_[_0xf96f('0x76')](_0x4bb75b)||_0x4bb75b<0x0||_0x4bb75b>0x4?_0x33059d?0x3:0x2:_0x4bb75b;_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x13a6e6+'\x22');break;case'UserId':var _0x2385f8=parseInt(_0x13a6e6);if(_[_0xf96f('0x77')](_0x2385f8)&&_[_0xf96f('0x78')](_0x1face3,_0x2385f8)){_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x2385f8+'\x22');}else{_0x28e700[_0xf96f('0x1f')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x13a6e6)){_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x13a6e6+'\x22');}else{_0x28e700['push'](_0xf96f('0x79'));}break;case _0xf96f('0x7a'):var _0x114e53=moment(_0x13a6e6,'YYYY-MM-DD',!![]);if(_0x114e53[_0xf96f('0x74')]()){_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x13a6e6+'\x22');}else{_0x28e700['push'](_0xf96f('0x7b'));}break;default:_0x2bcc77[_0xf96f('0x1f')]('\x22'+_0x13a6e6+'\x22');}}else{switch(_0xcf4507){case'firstName':case _0xf96f('0x13'):_0x28e700[_0xf96f('0x1f')](_0xcf4507+_0xf96f('0x7c'));break;default:_0x2bcc77[_0xf96f('0x1f')]('\x22\x22');}}}}else{var _0xac2d94='';for(var _0x5f35b6=0x0;_0x5f35b6<_0xb3d53a[_0xcf4507][_0xf96f('0x26')];_0x5f35b6++){var _0x13a6e6=_['trim'](_0x17c3de[_0xf96f('0x6e')][_0x19d094][_0xb3d53a[_0xcf4507][_0x5f35b6]][_0xf96f('0x73')](/"/g,'\x27'));if(_0xac2d94=='')_0xac2d94=_0x13a6e6;else _0xac2d94+='|'+_0x13a6e6;}_0x12da3f['push'](_0x2ecd44['id']+':'+_0xac2d94);}}if(hasAdditionalPhones){_0x2bcc77['push']('\x22'+_0x12da3f[_0xf96f('0x15')](';')+'\x22');}if(_0x28e700[_0xf96f('0x26')]){handleError(_0x17c3de['data'][_0x19d094],{'code':'SystemRow','message':_0x28e700[_0xf96f('0x15')]()});}else{fs[_0xf96f('0x7d')](_0x2f22d4,_0x2bcc77[_0xf96f('0x15')]()+'\x0a');}_0x2bcc77=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xf96f('0x7e')+_0x290653,stats);stats[_0xf96f('0x5b')]=[];}}if(stopped){logger[_0xf96f('0x59')](_0xf96f('0x7f'));_0x4b9719[_0xf96f('0x80')]();}}catch(_0x5352e5){handleError(_0x17c3de[_0xf96f('0x6e')][_0x19d094],{'code':_0xf96f('0x81'),'message':_0x5352e5['message']});logger[_0xf96f('0x5c')](_0xf96f('0x82'),_0x5352e5[_0xf96f('0x23')]);}},'complete':function(){try{var _0x390aab=[];var _0x577354=tempTableName;_0x390aab[_0xf96f('0x1f')](_0xf96f('0x83')+_0x577354+_0xf96f('0x84'));logger['info'](_0xf96f('0x85'),contactItemTypes[_0xf96f('0x26')]);var _0x425dc9=util[_0xf96f('0xf')](_0xf96f('0x86'),_0x2f22d4,_0x577354,_0x408b7d,_0x46e8d0['ListId'],_0x46e8d0[_0xf96f('0x54')]||null,NOW,NOW);if(_['isNil'](_0xb3d53a['scheduledat'])){_0x425dc9+=_0xf96f('0x87');}_0x390aab[_0xf96f('0x1f')](_0x425dc9);BPromise[_0xf96f('0x88')](_0x390aab,handleQuery)['then'](function(_0x1a34c5){BPromise[_0xf96f('0x20')]([handleAdditionalPhones()])['then'](function(){_0x390aab=[];for(var _0x561923=0x0;_0x561923=_0x3a1dae){return _0x511ad0['status'](0x193)[_0x14ca('0x13')]({'message':util[_0x14ca('0x6')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x483374)});}_0x3bea46();})[_0x14ca('0x14')](function(_0x430020){_0x3bea46(_0x430020);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x14ca('0x15')],{'where':{'$or':[{'role':_0x14ca('0x16')},{'role':_0x14ca('0x17')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x5a35=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0x5a75f6,_0x1296cd){var _0x46daeb=function(_0x36ce2c){while(--_0x36ce2c){_0x5a75f6['push'](_0x5a75f6['shift']());}};_0x46daeb(++_0x1296cd);}(_0x5a35,0xa4));var _0x55a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5a35[_0x2641f9];return _0x585741;};'use strict';var crypto=require(_0x55a3('0x0'));var util=require(_0x55a3('0x1'));var compose=require(_0x55a3('0x2'));var db=require(_0x55a3('0x3'))['db'];var config=require(_0x55a3('0x4'));function getValueFromLicense(_0x44f28c,_0x1df0a6){if(_0x44f28c&&_0x1df0a6){if(_0x1df0a6[_0x55a3('0x5')]&&_0x1df0a6[_0x55a3('0x6')]){var _0x1ccb0a=_0x1df0a6[_0x55a3('0x5')];var _0x2cffba=_0x1df0a6['license'];var _0x5d7766=_0x1ccb0a[_0x55a3('0x7')]('-')[0x4];var _0x3293c1=_0x1ccb0a['split']('-')[0x0];var _0xaad2b8=crypto[_0x55a3('0x8')](_0x55a3('0x9'),util[_0x55a3('0xa')](_0x55a3('0xb'),_0x5d7766,_0x1ccb0a,_0x3293c1));var _0x3f5295=_0xaad2b8['update'](_0x2cffba,_0x55a3('0xc'),'utf8');_0x3f5295+=_0xaad2b8[_0x55a3('0xd')]('utf8');var _0xa0d019=JSON[_0x55a3('0xe')](_0x3f5295);return _0xa0d019['hasOwnProperty'](_0x44f28c)?_0xa0d019[_0x44f28c]:null;}}return null;}function isLimit(_0x42fc00,_0x265de5,_0x43144f,_0x1be69d){var _0x219b44=_0x265de5;return compose()[_0x55a3('0xf')](function(_0x1f5c3e,_0x52c9ac,_0x2b029a){return db[_0x55a3('0x10')][_0x55a3('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x55a3('0x12')](function(_0x3333b8){var _0x187fa7=getValueFromLicense(_0x42fc00,_0x3333b8);return _0x187fa7?_0x187fa7:_0x219b44;})[_0x55a3('0x12')](function(_0x550e8c){_0x219b44=_0x550e8c;return _0x43144f[_0x55a3('0x13')](_0x1be69d);})[_0x55a3('0x12')](function(_0xe7d0fc){if(_0xe7d0fc>=_0x219b44){return _0x52c9ac[_0x55a3('0x14')](0x193)[_0x55a3('0x15')]({'message':util[_0x55a3('0xa')](_0x55a3('0x16'),_0x42fc00)});}_0x2b029a();})[_0x55a3('0x17')](function(_0x4368d0){_0x2b029a(_0x4368d0);});});}function isUserLimit(){return isLimit(_0x55a3('0x18'),0x1,db[_0x55a3('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0x55a3('0x1a')}]}});}exports[_0x55a3('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9d79f41..20811c4 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 _0x1dab=['DATE','utcOffset','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','length','split','slice','shift','forEach','filter','map','push','buildExpression','operator','$between','value','$gt','$lte','days','format','castTo','text','CAST(','includes','\x20OR\x20','field','$in','IN\x20?','$notIn','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','>\x20?','$gte','start','$startsWith','pop'];(function(_0xa74d52,_0x430427){var _0x1e1247=function(_0x5128be){while(--_0x5128be){_0xa74d52['push'](_0xa74d52['shift']());}};_0x1e1247(++_0x430427);}(_0x1dab,0x13d));var _0xb1da=function(_0x5db018,_0x504f94){_0x5db018=_0x5db018-0x0;var _0xe48a05=_0x1dab[_0x5db018];return _0xe48a05;};'use strict';var _=require(_0xb1da('0x0'));var moment=require(_0xb1da('0x1'));exports[_0xb1da('0x2')]=function(_0x127a9a){var _0x32919f={'conditions':[]};_0x32919f[_0xb1da('0x3')]=_[_0xb1da('0x4')](_0x127a9a,'[$or]')?'or':_0xb1da('0x5');var _0x5afbac=_0x127a9a[_0xb1da('0x6')](_0xb1da('0x7'),'')[_0xb1da('0x6')](_0xb1da('0x8'),'')['split']('||');for(var _0x5078ce=0x0;_0x5078ce<_0x5afbac[_0xb1da('0x9')];_0x5078ce++){var _0x464b59=_0x5afbac[_0x5078ce][_0xb1da('0xa')](':=');var _0x155b2c=_0x464b59[0x0];var _0x287e31=_0x464b59[_0xb1da('0xb')](0x1);_0x287e31['forEach'](function(_0x55d22b){var _0x55c7f3=_0x55d22b[_0xb1da('0xa')]('[')[_0xb1da('0xc')]();var _0x220f63=_0x55d22b['match'](/\[(.*?)\]/g);_0x220f63[_0xb1da('0xd')](function(_0x2327c5){var _0x2b9f0a=_0x2327c5[_0xb1da('0xa')]('[')[_0xb1da('0xe')](function(_0xd1426c){return _0xd1426c['indexOf'](']')>-0x1;})[_0xb1da('0xf')](function(_0x9d26e){return _0x9d26e[_0xb1da('0xa')](']')[0x0];})[0x0];_0x32919f['conditions'][_0xb1da('0x10')]({'field':_0x155b2c,'operator':_0x55c7f3,'value':_0x2b9f0a});});});}return _0x32919f;};exports[_0xb1da('0x11')]=function(_0x24e168,_0x4bf115,_0xe0870a){var _0x1ca856={};if(_0x4bf115==='DATE'){if(_0xe0870a[_0xb1da('0x12')]==='$eq'){_0xe0870a['operator']=_0xb1da('0x13');_0xe0870a['value']+=','+_0xe0870a[_0xb1da('0x14')];}else if(_['includes']([_0xb1da('0x15'),_0xb1da('0x16')],_0xe0870a[_0xb1da('0x12')])){_0xe0870a[_0xb1da('0x14')]=moment(_0xe0870a['value'])['add'](0x1,_0xb1da('0x17'))[_0xb1da('0x18')]('YYYY-MM-DD');}}if(_0xe0870a[_0xb1da('0x19')]){_0x4bf115=_0xe0870a['castTo'];_0x1ca856[_0xb1da('0x1a')]=_0xb1da('0x1b')+_0x24e168+'.'+_0xe0870a['field']+'\x20AS\x20'+_0xe0870a[_0xb1da('0x19')]+')\x20'+parseOperator(_0xe0870a[_0xb1da('0x12')]);}else{_0x1ca856[_0xb1da('0x1a')]=_0x24e168+'.'+_0xe0870a['field']+'\x20'+parseOperator(_0xe0870a['operator']);}if(_[_0xb1da('0x1c')](['$ne','$notIn'],_0xe0870a[_0xb1da('0x12')]))_0x1ca856[_0xb1da('0x1a')]='('+_0x1ca856[_0xb1da('0x1a')]+_0xb1da('0x1d')+_0x24e168+'.'+_0xe0870a[_0xb1da('0x1e')]+'\x20IS\x20NULL)';_0x1ca856[_0xb1da('0x14')]=parseValue(_0x4bf115,_0xe0870a['operator'],_0xe0870a['value']);return _0x1ca856;};function parseOperator(_0x3ae3da){var _0x4a2391;switch(_0x3ae3da){case _0xb1da('0x1f'):_0x4a2391=_0xb1da('0x20');break;case _0xb1da('0x21'):_0x4a2391=_0xb1da('0x22');break;case _0xb1da('0x23'):_0x4a2391=_0xb1da('0x24');break;case'$ne':_0x4a2391=_0xb1da('0x25');break;case _0xb1da('0x26'):case'$startsWith':case _0xb1da('0x27'):_0x4a2391='LIKE\x20?';break;case _0xb1da('0x28'):_0x4a2391=_0xb1da('0x29');break;case _0xb1da('0x15'):_0x4a2391=_0xb1da('0x2a');break;case _0xb1da('0x16'):_0x4a2391='<=\x20?';break;case _0xb1da('0x2b'):_0x4a2391='>=\x20?';break;case _0xb1da('0x13'):_0x4a2391='BETWEEN\x20?\x20AND\x20?';break;}return _0x4a2391;}function parseValue(_0x555847,_0x5e8f14,_0x268600){var _0x3fb914={'start':undefined,'end':undefined};switch(_0x5e8f14){case _0xb1da('0x1f'):case _0xb1da('0x21'):_0x3fb914[_0xb1da('0x2c')]=_0x268600['split'](',');break;case _0xb1da('0x26'):_0x3fb914[_0xb1da('0x2c')]='%'+_0x268600+'%';break;case _0xb1da('0x2d'):_0x3fb914['start']=_0x268600+'%';break;case'$endsWith':_0x3fb914[_0xb1da('0x2c')]='%'+_0x268600;break;case'$between':var _0xeb6137=_0x268600[_0xb1da('0xa')](',');var _0x268600=_0xeb6137[_0xb1da('0xc')]();var _0x136f77=_0xeb6137[_0xb1da('0x2e')]();if(_0x555847===_0xb1da('0x2f')){_0x268600=moment(_0x268600)[_0xb1da('0x30')](0x0,!![])[_0xb1da('0x18')]();_0x136f77=moment(_0x136f77)['utcOffset'](0x0,!![])[_0xb1da('0x31')](0x17,'hours')[_0xb1da('0x31')](0x3b,_0xb1da('0x32'))['add'](0x3b,_0xb1da('0x33'))[_0xb1da('0x18')]();}_0x3fb914={'start':_0x268600,'end':_0x136f77};break;default:_0x3fb914[_0xb1da('0x2c')]=_0x268600;break;}return _0x3fb914;} \ No newline at end of file +var _0x1848=['parseSearch','startsWith','[$or]','replace','[$and]','split','slice','forEach','shift','map','DATE','operator','value','includes','days','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$eq','=\x20?','$ne','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','$gt','$lte','<=\x20?','$gte','>=\x20?','$between','$in','start','$startsWith','$endsWith','pop','utcOffset','add','hours','minutes','seconds','lodash','moment'];(function(_0x39f5ad,_0x39b70d){var _0x1aa465=function(_0x4b61c7){while(--_0x4b61c7){_0x39f5ad['push'](_0x39f5ad['shift']());}};_0x1aa465(++_0x39b70d);}(_0x1848,0xc6));var _0x8184=function(_0x5dbb5a,_0x5c8b16){_0x5dbb5a=_0x5dbb5a-0x0;var _0xfe18f3=_0x1848[_0x5dbb5a];return _0xfe18f3;};'use strict';var _=require(_0x8184('0x0'));var moment=require(_0x8184('0x1'));exports[_0x8184('0x2')]=function(_0x3046fd){var _0x2e740c={'conditions':[]};_0x2e740c['sqlOperator']=_[_0x8184('0x3')](_0x3046fd,_0x8184('0x4'))?'or':'and';var _0x2a9d3a=_0x3046fd[_0x8184('0x5')](_0x8184('0x6'),'')[_0x8184('0x5')](_0x8184('0x4'),'')[_0x8184('0x7')]('||');for(var _0x51d884=0x0;_0x51d884<_0x2a9d3a['length'];_0x51d884++){var _0x4e719a=_0x2a9d3a[_0x51d884]['split'](':=');var _0x167188=_0x4e719a[0x0];var _0x564e11=_0x4e719a[_0x8184('0x8')](0x1);_0x564e11[_0x8184('0x9')](function(_0x271332){var _0x509c75=_0x271332[_0x8184('0x7')]('[')[_0x8184('0xa')]();var _0x4dab00=_0x271332['match'](/\[(.*?)\]/g);_0x4dab00[_0x8184('0x9')](function(_0x3aa632){var _0x5abf94=_0x3aa632[_0x8184('0x7')]('[')['filter'](function(_0x3fdf58){return _0x3fdf58['indexOf'](']')>-0x1;})[_0x8184('0xb')](function(_0x293227){return _0x293227[_0x8184('0x7')](']')[0x0];})[0x0];_0x2e740c['conditions']['push']({'field':_0x167188,'operator':_0x509c75,'value':_0x5abf94});});});}return _0x2e740c;};exports['buildExpression']=function(_0x457ecb,_0x3ca0c3,_0x46f3b6){var _0x46a591={};if(_0x3ca0c3===_0x8184('0xc')){if(_0x46f3b6['operator']==='$eq'){_0x46f3b6[_0x8184('0xd')]='$between';_0x46f3b6[_0x8184('0xe')]+=','+_0x46f3b6['value'];}else if(_[_0x8184('0xf')](['$gt','$lte'],_0x46f3b6[_0x8184('0xd')])){_0x46f3b6['value']=moment(_0x46f3b6[_0x8184('0xe')])['add'](0x1,_0x8184('0x10'))[_0x8184('0x11')]('YYYY-MM-DD');}}if(_0x46f3b6[_0x8184('0x12')]){_0x3ca0c3=_0x46f3b6['castTo'];_0x46a591[_0x8184('0x13')]=_0x8184('0x14')+_0x457ecb+'.'+_0x46f3b6[_0x8184('0x15')]+_0x8184('0x16')+_0x46f3b6['castTo']+')\x20'+parseOperator(_0x46f3b6[_0x8184('0xd')]);}else{_0x46a591['text']=_0x457ecb+'.'+_0x46f3b6[_0x8184('0x15')]+'\x20'+parseOperator(_0x46f3b6['operator']);}if(_[_0x8184('0xf')](['$ne',_0x8184('0x17')],_0x46f3b6['operator']))_0x46a591[_0x8184('0x13')]='('+_0x46a591['text']+_0x8184('0x18')+_0x457ecb+'.'+_0x46f3b6[_0x8184('0x15')]+_0x8184('0x19');_0x46a591[_0x8184('0xe')]=parseValue(_0x3ca0c3,_0x46f3b6[_0x8184('0xd')],_0x46f3b6[_0x8184('0xe')]);return _0x46a591;};function parseOperator(_0x5e0c54){var _0x4c0b40;switch(_0x5e0c54){case'$in':_0x4c0b40='IN\x20?';break;case'$notIn':_0x4c0b40='NOT\x20IN\x20?';break;case _0x8184('0x1a'):_0x4c0b40=_0x8184('0x1b');break;case _0x8184('0x1c'):_0x4c0b40=_0x8184('0x1d');break;case _0x8184('0x1e'):case'$startsWith':case'$endsWith':_0x4c0b40=_0x8184('0x1f');break;case _0x8184('0x20'):_0x4c0b40=_0x8184('0x21');break;case _0x8184('0x22'):_0x4c0b40='>\x20?';break;case _0x8184('0x23'):_0x4c0b40=_0x8184('0x24');break;case _0x8184('0x25'):_0x4c0b40=_0x8184('0x26');break;case _0x8184('0x27'):_0x4c0b40='BETWEEN\x20?\x20AND\x20?';break;}return _0x4c0b40;}function parseValue(_0x399a50,_0x299f74,_0xb2fedc){var _0x1231f3={'start':undefined,'end':undefined};switch(_0x299f74){case _0x8184('0x28'):case _0x8184('0x17'):_0x1231f3['start']=_0xb2fedc['split'](',');break;case _0x8184('0x1e'):_0x1231f3[_0x8184('0x29')]='%'+_0xb2fedc+'%';break;case _0x8184('0x2a'):_0x1231f3[_0x8184('0x29')]=_0xb2fedc+'%';break;case _0x8184('0x2b'):_0x1231f3[_0x8184('0x29')]='%'+_0xb2fedc;break;case _0x8184('0x27'):var _0x8d0ade=_0xb2fedc[_0x8184('0x7')](',');var _0xb2fedc=_0x8d0ade[_0x8184('0xa')]();var _0x144bd5=_0x8d0ade[_0x8184('0x2c')]();if(_0x399a50===_0x8184('0xc')){_0xb2fedc=moment(_0xb2fedc)[_0x8184('0x2d')](0x0,!![])[_0x8184('0x11')]();_0x144bd5=moment(_0x144bd5)[_0x8184('0x2d')](0x0,!![])[_0x8184('0x2e')](0x17,_0x8184('0x2f'))[_0x8184('0x2e')](0x3b,_0x8184('0x30'))['add'](0x3b,_0x8184('0x31'))[_0x8184('0x11')]();}_0x1231f3={'start':_0xb2fedc,'end':_0x144bd5};break;default:_0x1231f3[_0x8184('0x29')]=_0xb2fedc;break;}return _0x1231f3;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index b7b6a20..da91ad5 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 _0xb488=['getFullTextValue','toString','join','lodash','moment','fields','split','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','subtract','isArray','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[0-9]*$','isEmail','match'];(function(_0x4ce7fc,_0x13f5ad){var _0x56a972=function(_0x408699){while(--_0x408699){_0x4ce7fc['push'](_0x4ce7fc['shift']());}};_0x56a972(++_0x13f5ad);}(_0xb488,0xe7));var _0x8b48=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb488[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8b48('0x0'));var sequelize=require('sequelize');var moment=require(_0x8b48('0x1'));var LIMIT_VALUE=0xfa;exports[_0x8b48('0x2')]=function(_0x2282dc){var _0x2ca7b9=null;if(_0x2282dc){_0x2ca7b9=_0x2282dc[_0x8b48('0x3')](',');}return _0x2ca7b9;};exports['filters']=function(_0x4fd174,_0x4ac3e3){var _0x4d873e={};if(!_['isEmpty'](_0x4fd174)){_['forOwn'](_0x4fd174,function(_0x59294b,_0x2d031c){try{if(_0x4ac3e3){var _0x5828bf=_[_0x8b48('0x4')](_0x4ac3e3,{'name':_0x2d031c})||{};if(_0x5828bf[_0x8b48('0x5')]===_0x8b48('0x6')&&_[_0x8b48('0x7')](_0x59294b)){var _0xaea3a8=JSON[_0x8b48('0x8')](_0x59294b);var _0x284fae={'$gte':moment(moment(_0xaea3a8[_0x8b48('0x9')])[_0x8b48('0xa')](_0x8b48('0xb')))[_0x8b48('0xc')]()['format'](),'$lte':moment(moment(_0xaea3a8['$lte'])['format']('YYYY-MM-DD'))[_0x8b48('0xc')]()[_0x8b48('0xd')](0x1,'s')[_0x8b48('0xa')]()};_0x4d873e[_0x2d031c]=_0x284fae;}else{_0x4d873e[_0x2d031c]=_[_0x8b48('0xe')](_0x59294b)?_0x59294b:JSON[_0x8b48('0x8')](_0x59294b);}}else{_0x4d873e[_0x2d031c]=_[_0x8b48('0xe')](_0x59294b)?_0x59294b:JSON['parse'](_0x59294b);}}catch(_0xd49bb7){_0x4d873e[_0x2d031c]=_0x59294b[_0x8b48('0x3')](',');}});}return _0x4d873e;};exports[_0x8b48('0xf')]=function(_0x4130a0){_0x4130a0=parseInt(_0x4130a0,0xa);if(!_0x4130a0||_0x4130a0<0x0){_0x4130a0=LIMIT_VALUE;}return _0x4130a0;};exports[_0x8b48('0x10')]=function(_0x3884a3){_0x3884a3=parseInt(_0x3884a3,0xa);if(!_0x3884a3||_0x3884a3<0x0){_0x3884a3=0x0;}return _0x3884a3;};exports[_0x8b48('0x11')]=function(_0x1cc933){var _0x22515e,_0x527274=null;if(_0x1cc933){_0x22515e=_0x1cc933[_0x8b48('0x3')](',');_0x527274=_[_0x8b48('0x12')](_0x22515e,function(_0x4875d5){if(_0x4875d5[_0x8b48('0x13')]('-')===0x0){return[_0x4875d5===_0x8b48('0x14')?sequelize['cast'](sequelize[_0x8b48('0x15')](_0x8b48('0x14')),_0x8b48('0x16')):_0x4875d5[_0x8b48('0x17')](0x1),'DESC'];}else{return[_0x4875d5===_0x8b48('0x14')?sequelize['cast'](sequelize[_0x8b48('0x15')](_0x8b48('0x14')),'unsigned'):_0x4875d5,'ASC'];}});}return _0x527274;};exports[_0x8b48('0x18')]=function(_0x1f7b0f,_0x5e5474){if(_[_0x8b48('0x19')](_0x1f7b0f)){return _0x1f7b0f;}if(_['isArray'](_0x1f7b0f)){for(var _0x403487=0x0;_0x403487<_0x1f7b0f[_0x8b48('0x1a')];_0x403487+=0x1){_0x1f7b0f[_0x403487]=this['omit'](_0x1f7b0f[_0x403487],_0x5e5474);}return _0x1f7b0f;}if(!_[_0x8b48('0x1b')](_0x1f7b0f)){return _0x1f7b0f;}if(_[_0x8b48('0x1c')](_0x5e5474)){_0x5e5474=[_0x5e5474];}if(!_[_0x8b48('0xe')](_0x5e5474)){return _0x1f7b0f;}for(var _0x17a782=0x0;_0x17a782<_0x5e5474[_0x8b48('0x1a')];_0x17a782+=0x1){_[_0x8b48('0x1d')](_0x1f7b0f,_0x5e5474[_0x17a782]);}for(var _0x27c85a in _0x1f7b0f){if(_0x1f7b0f[_0x8b48('0x1e')](_0x27c85a)){_0x1f7b0f[_0x27c85a]=this[_0x8b48('0x18')](_0x1f7b0f[_0x27c85a],_0x5e5474);}}return _0x1f7b0f;};exports[_0x8b48('0x1f')]=function(_0x4530a1){return _0x4530a1['match'](RegExp(_0x8b48('0x20')))?!![]:![];};exports[_0x8b48('0x21')]=function(_0x34c4cf){return _0x34c4cf[_0x8b48('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x8b48('0x23')]=function(_0x3b579c){var _0x58a45a=[];_0x3b579c[_0x8b48('0x3')]('\x20')['forEach'](function(_0x12a560){_0x58a45a['push']('+'+_0x12a560[_0x8b48('0x24')]()+'*');});return _0x58a45a[_0x8b48('0x25')]('\x20');}; \ No newline at end of file +var _0x41d5=['substr','DESC','unsigned','omit','length','hasOwnProperty','isNumeric','match','isEmail','push','toString','join','moment','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','offset','sort','map','indexOf','priority','cast','col'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41d5,0x7e));var _0x541d=function(_0x4e559f,_0x3c7238){_0x4e559f=_0x4e559f-0x0;var _0x2d1bec=_0x41d5[_0x4e559f];return _0x2d1bec;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x541d('0x0'));var LIMIT_VALUE=0xfa;exports[_0x541d('0x1')]=function(_0x380b72){var _0x273f1f=null;if(_0x380b72){_0x273f1f=_0x380b72[_0x541d('0x2')](',');}return _0x273f1f;};exports[_0x541d('0x3')]=function(_0x283e3f,_0x1db77d){var _0x1975ca={};if(!_[_0x541d('0x4')](_0x283e3f)){_[_0x541d('0x5')](_0x283e3f,function(_0x4933a5,_0x1256fb){try{if(_0x1db77d){var _0x477d5f=_[_0x541d('0x6')](_0x1db77d,{'name':_0x1256fb})||{};if(_0x477d5f[_0x541d('0x7')]===_0x541d('0x8')&&_[_0x541d('0x9')](_0x4933a5)){var _0x5a2d17=JSON[_0x541d('0xa')](_0x4933a5);var _0x43b6ae={'$gte':moment(moment(_0x5a2d17[_0x541d('0xb')])[_0x541d('0xc')](_0x541d('0xd')))[_0x541d('0xe')]()['format'](),'$lte':moment(moment(_0x5a2d17[_0x541d('0xf')])[_0x541d('0xc')](_0x541d('0xd')))['utc']()[_0x541d('0x10')](0x1,'s')[_0x541d('0xc')]()};_0x1975ca[_0x1256fb]=_0x43b6ae;}else{_0x1975ca[_0x1256fb]=_['isArray'](_0x4933a5)?_0x4933a5:JSON[_0x541d('0xa')](_0x4933a5);}}else{_0x1975ca[_0x1256fb]=_[_0x541d('0x11')](_0x4933a5)?_0x4933a5:JSON[_0x541d('0xa')](_0x4933a5);}}catch(_0x43b1fc){_0x1975ca[_0x1256fb]=_0x4933a5[_0x541d('0x2')](',');}});}return _0x1975ca;};exports[_0x541d('0x12')]=function(_0x19909f){_0x19909f=parseInt(_0x19909f,0xa);if(!_0x19909f||_0x19909f<0x0){_0x19909f=LIMIT_VALUE;}return _0x19909f;};exports[_0x541d('0x13')]=function(_0x15d597){_0x15d597=parseInt(_0x15d597,0xa);if(!_0x15d597||_0x15d597<0x0){_0x15d597=0x0;}return _0x15d597;};exports[_0x541d('0x14')]=function(_0x49bb56){var _0x2f73a2,_0x1e05b7=null;if(_0x49bb56){_0x2f73a2=_0x49bb56['split'](',');_0x1e05b7=_[_0x541d('0x15')](_0x2f73a2,function(_0x28ea31){if(_0x28ea31[_0x541d('0x16')]('-')===0x0){return[_0x28ea31===_0x541d('0x17')?sequelize[_0x541d('0x18')](sequelize[_0x541d('0x19')]('priority'),'unsigned'):_0x28ea31[_0x541d('0x1a')](0x1),_0x541d('0x1b')];}else{return[_0x28ea31===_0x541d('0x17')?sequelize[_0x541d('0x18')](sequelize[_0x541d('0x19')](_0x541d('0x17')),_0x541d('0x1c')):_0x28ea31,'ASC'];}});}return _0x1e05b7;};exports[_0x541d('0x1d')]=function(_0x1ad78c,_0x4965c2){if(_['isEmpty'](_0x1ad78c)){return _0x1ad78c;}if(_[_0x541d('0x11')](_0x1ad78c)){for(var _0x1fd845=0x0;_0x1fd845<_0x1ad78c[_0x541d('0x1e')];_0x1fd845+=0x1){_0x1ad78c[_0x1fd845]=this[_0x541d('0x1d')](_0x1ad78c[_0x1fd845],_0x4965c2);}return _0x1ad78c;}if(!_['isObject'](_0x1ad78c)){return _0x1ad78c;}if(_['isString'](_0x4965c2)){_0x4965c2=[_0x4965c2];}if(!_[_0x541d('0x11')](_0x4965c2)){return _0x1ad78c;}for(var _0x49e607=0x0;_0x49e607<_0x4965c2[_0x541d('0x1e')];_0x49e607+=0x1){_['unset'](_0x1ad78c,_0x4965c2[_0x49e607]);}for(var _0x9c2fe in _0x1ad78c){if(_0x1ad78c[_0x541d('0x1f')](_0x9c2fe)){_0x1ad78c[_0x9c2fe]=this[_0x541d('0x1d')](_0x1ad78c[_0x9c2fe],_0x4965c2);}}return _0x1ad78c;};exports[_0x541d('0x20')]=function(_0x54173d){return _0x54173d[_0x541d('0x21')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x541d('0x22')]=function(_0x16a11e){return _0x16a11e[_0x541d('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2d9a7c){var _0xe920aa=[];_0x2d9a7c[_0x541d('0x2')]('\x20')['forEach'](function(_0x1e3cb7){_0xe920aa[_0x541d('0x23')]('+'+_0x1e3cb7[_0x541d('0x24')]()+'*');});return _0xe920aa[_0x541d('0x25')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 13f1aa4..6c8729e 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cec=['engine','html','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','default','get','env','root','public','development','set','appPath','join','use','json\x20replacer','toISOString','split','static','views'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x6cec,0xee));var _0xc6ce=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0x6cec[_0x47e309];return _0x2e1900;};'use strict';var express=require(_0xc6ce('0x0'));var favicon=require(_0xc6ce('0x1'));var bodyParser=require(_0xc6ce('0x2'));var methodOverride=require(_0xc6ce('0x3'));var cookieParser=require(_0xc6ce('0x4'));var errorHandler=require(_0xc6ce('0x5'));var path=require(_0xc6ce('0x6'));var passport=require(_0xc6ce('0x7'));var cors=require(_0xc6ce('0x8'));var moment=require(_0xc6ce('0x9'));var config=require('./environment');var db=require(_0xc6ce('0xa'))['db'];exports[_0xc6ce('0xb')]=function(_0x27c310){var _0x286611=_0x27c310[_0xc6ce('0xc')](_0xc6ce('0xd'));if(_0x286611==='production'){_0x27c310['set']('appPath',path['join'](config[_0xc6ce('0xe')],_0xc6ce('0xf')));}if(_0x286611===_0xc6ce('0x10')||_0x286611==='test'){_0x27c310[_0xc6ce('0x11')](_0xc6ce('0x12'),path[_0xc6ce('0x13')](config[_0xc6ce('0xe')],'client'));_0x27c310[_0xc6ce('0x14')](errorHandler());}_0x27c310[_0xc6ce('0x11')](_0xc6ce('0x15'),function(_0x515ede,_0x3677d1){if(this[_0x515ede]instanceof Date){_0x3677d1=this[_0x515ede][_0xc6ce('0x16')]()[_0xc6ce('0x17')]('.')[0x0]+'Z';}return _0x3677d1;});_0x27c310[_0xc6ce('0x14')](express[_0xc6ce('0x18')](_0x27c310['get'](_0xc6ce('0x12'))));_0x27c310['set'](_0xc6ce('0x19'),config[_0xc6ce('0xe')]+'/server/views');_0x27c310[_0xc6ce('0x1a')](_0xc6ce('0x1b'),require('ejs')[_0xc6ce('0x1c')]);_0x27c310['set'](_0xc6ce('0x1d'),_0xc6ce('0x1b'));_0x27c310[_0xc6ce('0x14')](bodyParser['urlencoded']({'limit':_0xc6ce('0x1e'),'extended':!![]}));_0x27c310[_0xc6ce('0x14')](bodyParser[_0xc6ce('0x1f')]({'limit':_0xc6ce('0x1e')}));_0x27c310[_0xc6ce('0x14')](cors());_0x27c310['use'](methodOverride());_0x27c310[_0xc6ce('0x14')](cookieParser());_0x27c310[_0xc6ce('0x14')](passport[_0xc6ce('0x20')]());}; \ No newline at end of file +var _0x848e=['path','cors','./environment','../mysqldb','default','get','env','production','set','appPath','root','development','test','client','toISOString','split','use','static','views','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','express','method-override','errorhandler'];(function(_0x30da69,_0x119366){var _0x31a70b=function(_0x53df06){while(--_0x53df06){_0x30da69['push'](_0x30da69['shift']());}};_0x31a70b(++_0x119366);}(_0x848e,0x1cd));var _0xe848=function(_0xc95fe9,_0x36bcb1){_0xc95fe9=_0xc95fe9-0x0;var _0x3761dd=_0x848e[_0xc95fe9];return _0x3761dd;};'use strict';var express=require(_0xe848('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0xe848('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xe848('0x2'));var path=require(_0xe848('0x3'));var passport=require('passport');var cors=require(_0xe848('0x4'));var moment=require('moment');var config=require(_0xe848('0x5'));var db=require(_0xe848('0x6'))['db'];exports[_0xe848('0x7')]=function(_0x1439e3){var _0x2bd53e=_0x1439e3[_0xe848('0x8')](_0xe848('0x9'));if(_0x2bd53e===_0xe848('0xa')){_0x1439e3[_0xe848('0xb')](_0xe848('0xc'),path['join'](config[_0xe848('0xd')],'public'));}if(_0x2bd53e===_0xe848('0xe')||_0x2bd53e===_0xe848('0xf')){_0x1439e3[_0xe848('0xb')](_0xe848('0xc'),path['join'](config['root'],_0xe848('0x10')));_0x1439e3['use'](errorHandler());}_0x1439e3[_0xe848('0xb')]('json\x20replacer',function(_0x4fcea7,_0x148588){if(this[_0x4fcea7]instanceof Date){_0x148588=this[_0x4fcea7][_0xe848('0x11')]()[_0xe848('0x12')]('.')[0x0]+'Z';}return _0x148588;});_0x1439e3[_0xe848('0x13')](express[_0xe848('0x14')](_0x1439e3['get'](_0xe848('0xc'))));_0x1439e3[_0xe848('0xb')](_0xe848('0x15'),config[_0xe848('0xd')]+_0xe848('0x16'));_0x1439e3['engine'](_0xe848('0x17'),require(_0xe848('0x18'))[_0xe848('0x19')]);_0x1439e3[_0xe848('0xb')](_0xe848('0x1a'),'html');_0x1439e3[_0xe848('0x13')](bodyParser[_0xe848('0x1b')]({'limit':_0xe848('0x1c'),'extended':!![]}));_0x1439e3[_0xe848('0x13')](bodyParser['json']({'limit':_0xe848('0x1c')}));_0x1439e3[_0xe848('0x13')](cors());_0x1439e3[_0xe848('0x13')](methodOverride());_0x1439e3[_0xe848('0x13')](cookieParser());_0x1439e3[_0xe848('0x13')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index b38741d..5906151 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 _0x972c=['getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','substring','bimedia-machine-uuid','child_process','orderBy','keys','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','digest','hex'];(function(_0x3929a4,_0x3221ae){var _0x2e9c54=function(_0x320cfd){while(--_0x320cfd){_0x3929a4['push'](_0x3929a4['shift']());}};_0x2e9c54(++_0x3221ae);}(_0x972c,0xf2));var _0xc972=function(_0x4c2d92,_0x3ee395){_0x4c2d92=_0x4c2d92-0x0;var _0x24b2f4=_0x972c[_0x4c2d92];return _0x24b2f4;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0xc972('0x0'));var exec=require(_0xc972('0x1'))['execSync'];function getInterfaces(){var _0x3c04a5=[];var _0x1a41f9=os['networkInterfaces']();var _0x511ad4=_[_0xc972('0x2')](_[_0xc972('0x3')](_0x1a41f9));for(var _0x29b5d1=0x0;_0x29b5d1<_0x511ad4['length'];_0x29b5d1++){var _0xd70261=_0x1a41f9[_0x511ad4[_0x29b5d1]]['filter'](function(_0x1c1a16){return _0x1c1a16[_0xc972('0x4')]===_0xc972('0x5')&&_0x1c1a16['internal']===![];});_0x3c04a5=_0x3c04a5['concat'](_0xd70261);}return _0x3c04a5;}function getFirstInterface(){var _0x48fe12=_[_0xc972('0x6')](getInterfaces());return{'macAddress':_0x48fe12&&_0x48fe12['mac']?_0x48fe12[_0xc972('0x7')]:_0xc972('0x8'),'ipAddress':_0x48fe12&&_0x48fe12[_0xc972('0x9')]?_0x48fe12[_0xc972('0x9')]:_0xc972('0xa')};}exports[_0xc972('0xb')]=getFirstInterface;function getCPUhash(){var _0x233d36=_['orderBy'](os[_0xc972('0xc')]()[_0xc972('0xd')](function(_0x27851c){return _0x27851c['model'];}))[_0xc972('0xe')](':');return crypto[_0xc972('0xf')](_0xc972('0x10'))['update'](_0x233d36)[_0xc972('0x11')](_0xc972('0x12'));}exports[_0xc972('0x13')]=function(){switch(os[_0xc972('0x14')]()){case'win32':return exec(_0xc972('0x15'),{'encoding':_0xc972('0x16')})[_0xc972('0x17')]('\x0d\x0a','');default:var _0x341564=getFirstInterface();var _0x40217e=getCPUhash();var _0x268f04=_0x40217e+'|'+os[_0xc972('0x18')]()+'|'+_0x341564[_0xc972('0x19')]+'|'+_0x341564[_0xc972('0x1a')];var _0x9c986f=crypto[_0xc972('0xf')](_0xc972('0x10'))[_0xc972('0x1b')](_0x268f04)[_0xc972('0x11')](_0xc972('0x12'));return _0x9c986f[_0xc972('0x1c')](0x0,0x8)+'-'+_0x9c986f['substring'](0x8,0xc)+'-'+_0x9c986f[_0xc972('0x1c')](0xc,0x10)+'-'+_0x9c986f[_0xc972('0x1c')](0x10,0x14)+'-'+_0x9c986f[_0xc972('0x1c')](0x14);}}; \ No newline at end of file +var _0x5292=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','model','join','createHash','md5','update','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','hex','substring','lodash','crypto','child_process','networkInterfaces','keys','filter','internal','concat','head'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5292,0xf7));var _0x2529=function(_0x4e668b,_0x35b443){_0x4e668b=_0x4e668b-0x0;var _0xba75aa=_0x5292[_0x4e668b];return _0xba75aa;};'use strict';var _=require(_0x2529('0x0'));var os=require('os');var crypto=require(_0x2529('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x2529('0x2'))['execSync'];function getInterfaces(){var _0x1540a9=[];var _0x2b088=os[_0x2529('0x3')]();var _0x228165=_['orderBy'](_[_0x2529('0x4')](_0x2b088));for(var _0x482dba=0x0;_0x482dba<_0x228165['length'];_0x482dba++){var _0x4e7a9e=_0x2b088[_0x228165[_0x482dba]][_0x2529('0x5')](function(_0x43cbef){return _0x43cbef['family']==='IPv4'&&_0x43cbef[_0x2529('0x6')]===![];});_0x1540a9=_0x1540a9[_0x2529('0x7')](_0x4e7a9e);}return _0x1540a9;}function getFirstInterface(){var _0x5850a7=_[_0x2529('0x8')](getInterfaces());return{'macAddress':_0x5850a7&&_0x5850a7[_0x2529('0x9')]?_0x5850a7[_0x2529('0x9')]:_0x2529('0xa'),'ipAddress':_0x5850a7&&_0x5850a7[_0x2529('0xb')]?_0x5850a7[_0x2529('0xb')]:_0x2529('0xc')};}exports[_0x2529('0xd')]=getFirstInterface;function getCPUhash(){var _0x4f3cf9=_[_0x2529('0xe')](os[_0x2529('0xf')]()['map'](function(_0xe333c9){return _0xe333c9[_0x2529('0x10')];}))[_0x2529('0x11')](':');return crypto[_0x2529('0x12')](_0x2529('0x13'))[_0x2529('0x14')](_0x4f3cf9)[_0x2529('0x15')]('hex');}exports[_0x2529('0x16')]=function(){switch(os[_0x2529('0x17')]()){case _0x2529('0x18'):return exec(_0x2529('0x19'),{'encoding':_0x2529('0x1a')})[_0x2529('0x1b')]('\x0d\x0a','');default:var _0x1a1ccc=getFirstInterface();var _0xf10dfb=getCPUhash();var _0x574975=_0xf10dfb+'|'+os[_0x2529('0x1c')]()+'|'+_0x1a1ccc['macAddress']+'|'+_0x1a1ccc[_0x2529('0x1d')];var _0x3d73c4=crypto[_0x2529('0x12')]('md5')['update'](_0x574975)[_0x2529('0x15')](_0x2529('0x1e'));return _0x3d73c4[_0x2529('0x1f')](0x0,0x8)+'-'+_0x3d73c4[_0x2529('0x1f')](0x8,0xc)+'-'+_0x3d73c4[_0x2529('0x1f')](0xc,0x10)+'-'+_0x3d73c4['substring'](0x10,0x14)+'-'+_0x3d73c4[_0x2529('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index deee258..f8d06c7 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 _0x1623=['YYYY-MM-DD\x20HH:mm','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','aes-256-ctr','session','base64','final','createDecipher','update','utf8','||FIELD||VALUE||\x0a','findOne','email','|machineUuid|','|name|','fullname','|email|','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','license','data2','info','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','diff','days','DEMO\x20START\x20AT\x20%s'];(function(_0x57f86d,_0x30f34c){var _0x116a10=function(_0xd9b64b){while(--_0xd9b64b){_0x57f86d['push'](_0x57f86d['shift']());}};_0x116a10(++_0x30f34c);}(_0x1623,0xab));var _0x3162=function(_0x25854f,_0x5dfb5e){_0x25854f=_0x25854f-0x0;var _0x2b899e=_0x1623[_0x25854f];return _0x2b899e;};'use strict';var util=require(_0x3162('0x0'));var crypto=require('crypto');var moment=require('moment');var rp=require(_0x3162('0x1'));var BPromise=require(_0x3162('0x2'));var pkginfo=require(_0x3162('0x3'))(module,_0x3162('0x4'));var db=require(_0x3162('0x5'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0x3162('0x6'))('license');var jira=require(_0x3162('0x7'));var HOST=_0x3162('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x53260d){return new BPromise(function(_0xffe9b6,_0x2dc07e){var _0x26ee32=util[_0x3162('0x9')](_0x3162('0xa'),HOST,_0x53260d,module[_0x3162('0xb')][_0x3162('0x4')]);if(oldToken){_0x26ee32=util[_0x3162('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x53260d,module['exports'][_0x3162('0x4')],oldToken);}var _0x3106d5={'uri':_0x26ee32,'method':_0x3162('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3106d5)[_0x3162('0xd')](function(_0x813d62){_0xffe9b6(_0x813d62);})[_0x3162('0xe')](function(_0x458a05){_0x2dc07e(_0x458a05);});});}function encryptDate(_0x38da60){var _0x157ab8=crypto['createCipher'](_0x3162('0xf'),config['secrets'][_0x3162('0x10')]);var _0x143c5a=_0x157ab8['update'](_0x38da60,'utf8',_0x3162('0x11'));_0x143c5a+=_0x157ab8[_0x3162('0x12')](_0x3162('0x11'));return _0x143c5a;}function decryptDate(_0x4b8a3b){var _0x15e348=crypto[_0x3162('0x13')](_0x3162('0xf'),config['secrets'][_0x3162('0x10')]);var _0x42cf7d=_0x15e348[_0x3162('0x14')](_0x4b8a3b,_0x3162('0x11'),_0x3162('0x15'));_0x42cf7d+=_0x15e348[_0x3162('0x12')](_0x3162('0x15'));return _0x42cf7d;}function sendJiraAlert(_0x4b2bf3,_0x42f283,_0x1e3d75){var _0x460b7b=_0x3162('0x16');return db['User'][_0x3162('0x17')]({'where':{'role':'admin'},'attributes':['fullname',_0x3162('0x18')],'raw':!![]})[_0x3162('0xd')](function(_0x31946d){ADMIN=_0x31946d;_0x460b7b+='|reason|'+_0x1e3d75+'|\x0a';_0x460b7b+='|uuid|'+_0x4b2bf3+'|\x0a';_0x460b7b+=_0x3162('0x19')+_0x42f283+'|\x0a';_0x460b7b+=_0x3162('0x1a')+ADMIN[_0x3162('0x1b')]+'|\x0a';_0x460b7b+=_0x3162('0x1c')+ADMIN[_0x3162('0x18')]+'|\x0a';return _0x460b7b;})[_0x3162('0xd')](function(_0x52ae25){var _0x1b2713=hardware['getFirstInterface']()[_0x3162('0x1d')];return jira[_0x3162('0x1e')]({'key':_0x3162('0x1f'),'summary':_0x3162('0x20'),'description':_0x52ae25,'issuetype':_0x3162('0x21'),'oldToken':_0x4b2bf3,'newToken':_0x42f283,'email':ADMIN[_0x3162('0x18')],'name':ADMIN[_0x3162('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x1b2713});});}function manageLicense(_0x5f8f7,_0x2a09ad){var _0x356c5d=_0x2a09ad[_0x3162('0x22')]({'plain':!![]});httpRequest(_0x5f8f7)[_0x3162('0xd')](function(_0x1c03a4){if(oldToken){oldToken=undefined;}if(_0x1c03a4['active']){if(!_0x356c5d[_0x3162('0x23')]&&_0x356c5d['license']!=_0x1c03a4[_0x3162('0x23')]||_0x356c5d[_0x3162('0x23')]&&_0x356c5d[_0x3162('0x24')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x356c5d[_0x3162('0x23')]&&!_0x356c5d[_0x3162('0x24')]&&_0x356c5d[_0x3162('0x23')]!=_0x1c03a4[_0x3162('0x23')]){logger[_0x3162('0x25')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x356c5d[_0x3162('0x23')]&&!_0x356c5d['data2']&&_0x356c5d[_0x3162('0x23')]==_0x1c03a4[_0x3162('0x23')]){return _0x2a09ad;}return _0x2a09ad[_0x3162('0x14')]({'data1':_0x5f8f7,'data2':null,'license':_0x1c03a4[_0x3162('0x23')]});}else{if(_0x1c03a4[_0x3162('0x23')]||_0x356c5d[_0x3162('0x23')]){if(!_0x356c5d[_0x3162('0x24')]){if(_0x356c5d[_0x3162('0x26')]==_0x5f8f7){GRAY_PERIOD_REASON='Disabled';logger[_0x3162('0x25')](_0x3162('0x27'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x356c5d[_0x3162('0x26')];logger[_0x3162('0x25')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x356c5d['data1'],_0x5f8f7);}sendJiraAlert(_0x356c5d[_0x3162('0x26')],_0x1c03a4['uuid'],GRAY_PERIOD_REASON);logger[_0x3162('0x25')](_0x3162('0x28'),GRAY_PERIOD_REASON[_0x3162('0x29')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x2a09ad[_0x3162('0x14')]({'data2':encryptDate(moment()[_0x3162('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x3162('0x2a')](decryptDate(_0x356c5d['data2']),_0x3162('0x2b'))>DAYS){logger[_0x3162('0x25')](_0x3162('0x2c'),moment()[_0x3162('0x9')](_0x3162('0x2d')));return _0x2a09ad[_0x3162('0x14')]({'data1':_0x5f8f7,'data2':null,'license':null});}}}else{if(_0x356c5d[_0x3162('0x26')]!=_0x5f8f7){logger[_0x3162('0x25')](_0x3162('0x2e'),_0x356c5d[_0x3162('0x26')],_0x5f8f7);return _0x2a09ad[_0x3162('0x14')]({'data1':_0x5f8f7,'data2':null,'license':null});}}}return _0x2a09ad;})['then'](function(_0x149571){_0x2a09ad=_0x149571;})[_0x3162('0xe')](function(_0x41d93b){logger['error'](_0x41d93b['message']);})[_0x3162('0x2f')](function(){setTimeout(function(){manageLicense(hardware[_0x3162('0x30')](),_0x2a09ad);},TIME);});}function defaultLicense(){var _0x2e1ab5=hardware[_0x3162('0x30')]();if(_0x2e1ab5){return db['License'][_0x3162('0x31')]({'where':{'id':0x1},'defaults':{'data1':_0x2e1ab5}})['spread'](function(_0x59e049,_0x5dee49){logger[_0x3162('0x25')](_0x3162('0x32'),_0x2e1ab5);manageLicense(_0x2e1ab5,_0x59e049);})[_0x3162('0xe')](function(_0x49829f){logger[_0x3162('0x33')](_0x49829f[_0x3162('0x34')]);});}}exports[_0x3162('0x35')]=defaultLicense; \ No newline at end of file +var _0x82d8=['ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','data1','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','findOrCreate','spread','default','util','moment','pkginfo','../../mysqldb','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','catch','createCipher','aes-256-ctr','update','utf8','base64','final','createDecipher','secrets','session','||FIELD||VALUE||\x0a','User','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','then'];(function(_0x4afa79,_0x22c6a4){var _0x274a72=function(_0x59956c){while(--_0x59956c){_0x4afa79['push'](_0x4afa79['shift']());}};_0x274a72(++_0x22c6a4);}(_0x82d8,0xff));var _0x882d=function(_0x431501,_0x46a38c){_0x431501=_0x431501-0x0;var _0x29ac6c=_0x82d8[_0x431501];return _0x29ac6c;};'use strict';var util=require(_0x882d('0x0'));var crypto=require('crypto');var moment=require(_0x882d('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x882d('0x2'))(module,'version');var db=require(_0x882d('0x3'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0x882d('0x4'))(_0x882d('0x5'));var jira=require(_0x882d('0x6'));var HOST=_0x882d('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xb7539b){return new BPromise(function(_0x3c8b67,_0x4067a9){var _0x4ea710=util[_0x882d('0x8')](_0x882d('0x9'),HOST,_0xb7539b,module[_0x882d('0xa')]['version']);if(oldToken){_0x4ea710=util[_0x882d('0x8')](_0x882d('0xb'),HOST,_0xb7539b,module['exports'][_0x882d('0xc')],oldToken);}var _0xa2ca7f={'uri':_0x4ea710,'method':_0x882d('0xd'),'timeout':0xea60,'json':!![]};return rp(_0xa2ca7f)['then'](function(_0x287672){_0x3c8b67(_0x287672);})[_0x882d('0xe')](function(_0x18ce3e){_0x4067a9(_0x18ce3e);});});}function encryptDate(_0x3fffe0){var _0x3bd4d9=crypto[_0x882d('0xf')](_0x882d('0x10'),config['secrets']['session']);var _0x2a7091=_0x3bd4d9[_0x882d('0x11')](_0x3fffe0,_0x882d('0x12'),_0x882d('0x13'));_0x2a7091+=_0x3bd4d9[_0x882d('0x14')]('base64');return _0x2a7091;}function decryptDate(_0x3ce2b0){var _0x2d88e5=crypto[_0x882d('0x15')](_0x882d('0x10'),config[_0x882d('0x16')][_0x882d('0x17')]);var _0x46cfcc=_0x2d88e5[_0x882d('0x11')](_0x3ce2b0,_0x882d('0x13'),'utf8');_0x46cfcc+=_0x2d88e5['final'](_0x882d('0x12'));return _0x46cfcc;}function sendJiraAlert(_0x59aaec,_0x3e4cf5,_0x47d6a0){var _0x36ecd0=_0x882d('0x18');return db[_0x882d('0x19')]['findOne']({'where':{'role':_0x882d('0x1a')},'attributes':[_0x882d('0x1b'),_0x882d('0x1c')],'raw':!![]})['then'](function(_0x3420cd){ADMIN=_0x3420cd;_0x36ecd0+=_0x882d('0x1d')+_0x47d6a0+'|\x0a';_0x36ecd0+=_0x882d('0x1e')+_0x59aaec+'|\x0a';_0x36ecd0+=_0x882d('0x1f')+_0x3e4cf5+'|\x0a';_0x36ecd0+=_0x882d('0x20')+ADMIN[_0x882d('0x1b')]+'|\x0a';_0x36ecd0+=_0x882d('0x21')+ADMIN[_0x882d('0x1c')]+'|\x0a';return _0x36ecd0;})[_0x882d('0x22')](function(_0x57f1d4){var _0x37e6fa=hardware['getFirstInterface']()[_0x882d('0x23')];return jira[_0x882d('0x24')]({'key':_0x882d('0x25'),'summary':_0x882d('0x26'),'description':_0x57f1d4,'issuetype':_0x882d('0x27'),'oldToken':_0x59aaec,'newToken':_0x3e4cf5,'email':ADMIN['email'],'name':ADMIN[_0x882d('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x37e6fa});});}function manageLicense(_0x58ddb2,_0xb49a3c){var _0x3cb1e2=_0xb49a3c['get']({'plain':!![]});httpRequest(_0x58ddb2)['then'](function(_0x508003){if(oldToken){oldToken=undefined;}if(_0x508003['active']){if(!_0x3cb1e2[_0x882d('0x5')]&&_0x3cb1e2[_0x882d('0x5')]!=_0x508003[_0x882d('0x5')]||_0x3cb1e2[_0x882d('0x5')]&&_0x3cb1e2['data2']){logger[_0x882d('0x28')](_0x882d('0x29'));}if(_0x3cb1e2[_0x882d('0x5')]&&!_0x3cb1e2[_0x882d('0x2a')]&&_0x3cb1e2[_0x882d('0x5')]!=_0x508003['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3cb1e2[_0x882d('0x5')]&&!_0x3cb1e2[_0x882d('0x2a')]&&_0x3cb1e2[_0x882d('0x5')]==_0x508003['license']){return _0xb49a3c;}return _0xb49a3c[_0x882d('0x11')]({'data1':_0x58ddb2,'data2':null,'license':_0x508003[_0x882d('0x5')]});}else{if(_0x508003[_0x882d('0x5')]||_0x3cb1e2[_0x882d('0x5')]){if(!_0x3cb1e2[_0x882d('0x2a')]){if(_0x3cb1e2[_0x882d('0x2b')]==_0x58ddb2){GRAY_PERIOD_REASON='Disabled';logger[_0x882d('0x28')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x882d('0x2c');oldToken=_0x3cb1e2['data1'];logger[_0x882d('0x28')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3cb1e2[_0x882d('0x2b')],_0x58ddb2);}sendJiraAlert(_0x3cb1e2[_0x882d('0x2b')],_0x508003[_0x882d('0x2d')],GRAY_PERIOD_REASON);logger[_0x882d('0x28')](_0x882d('0x2e'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x882d('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0xb49a3c[_0x882d('0x11')]({'data2':encryptDate(moment()[_0x882d('0x8')](_0x882d('0x2f')))});}else{if(moment()[_0x882d('0x30')](decryptDate(_0x3cb1e2[_0x882d('0x2a')]),_0x882d('0x31'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x882d('0x2f')));return _0xb49a3c[_0x882d('0x11')]({'data1':_0x58ddb2,'data2':null,'license':null});}}}else{if(_0x3cb1e2[_0x882d('0x2b')]!=_0x58ddb2){logger[_0x882d('0x28')](_0x882d('0x32'),_0x3cb1e2['data1'],_0x58ddb2);return _0xb49a3c[_0x882d('0x11')]({'data1':_0x58ddb2,'data2':null,'license':null});}}}return _0xb49a3c;})[_0x882d('0x22')](function(_0xc412ec){_0xb49a3c=_0xc412ec;})[_0x882d('0xe')](function(_0x335dc0){logger[_0x882d('0x33')](_0x335dc0[_0x882d('0x34')]);})[_0x882d('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x882d('0x36')](),_0xb49a3c);},TIME);});}function defaultLicense(){var _0x56b3fa=hardware['getUuid']();if(_0x56b3fa){return db['License'][_0x882d('0x37')]({'where':{'id':0x1},'defaults':{'data1':_0x56b3fa}})[_0x882d('0x38')](function(_0x1aec6f,_0x6d04f){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x56b3fa);manageLicense(_0x56b3fa,_0x1aec6f);})[_0x882d('0xe')](function(_0x21dd0e){logger[_0x882d('0x33')](_0x21dd0e['message']);});}}exports[_0x882d('0x39')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ecafbac..ed2faab 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 _0xc94e=['utf8','parse','uuid','secrets','update','final','gray','deadline','add','days','machineUuid','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','data1','getUuid','Demo\x20license','getLicense','find','defaults','then','checkLicense','crypto','lodash','moment','./hardware','isEmpty','License\x20key\x20value\x20not\x20found','split','aes-256-ctr','format','base64'];(function(_0x1b14f0,_0x45bfd7){var _0x3a5f7f=function(_0x36d208){while(--_0x36d208){_0x1b14f0['push'](_0x1b14f0['shift']());}};_0x3a5f7f(++_0x45bfd7);}(_0xc94e,0x76));var _0xec94=function(_0x23b283,_0x1640d3){_0x23b283=_0x23b283-0x0;var _0x1be7cd=_0xc94e[_0x23b283];return _0x1be7cd;};'use strict';var crypto=require(_0xec94('0x0'));var util=require('util');var _=require(_0xec94('0x1'));var moment=require(_0xec94('0x2'));var hardware=require(_0xec94('0x3'));var config=require('../environment');var db=require('../../mysqldb')['db'];function checkLicense(_0x557bd4,_0xb55fb){if(_0x557bd4){try{var _0x26e57e=_0xb55fb||_0x557bd4['license'];if(_[_0xec94('0x4')](_0x26e57e)){throw new Error(_0xec94('0x5'));}var _0x3af09f=_0x557bd4['data1'];var _0x5e7a4d=_0x557bd4['data2'];var _0x5a1fa0=_0x3af09f[_0xec94('0x6')]('-')[0x4];var _0x5b19e6=_0x3af09f[_0xec94('0x6')]('-')[0x0];var _0x2763e0=crypto['createDecipher'](_0xec94('0x7'),util[_0xec94('0x8')]('%s:%s:%s',_0x5a1fa0,_0x3af09f,_0x5b19e6));var _0x556725=_0x2763e0['update'](_0x26e57e,_0xec94('0x9'),_0xec94('0xa'));_0x556725+=_0x2763e0['final'](_0xec94('0xa'));var _0x4dad86=JSON[_0xec94('0xb')](_0x556725);_0x4dad86['demo']=![];_0x4dad86[_0xec94('0xc')]=_0x3af09f;_0x4dad86['machineUuid']=hardware['getUuid']();if(_0x5e7a4d){var _0x34b7ec=crypto['createDecipher']('aes-256-ctr',config[_0xec94('0xd')]['session']);var _0x495648=_0x34b7ec[_0xec94('0xe')](_0x5e7a4d,'base64',_0xec94('0xa'));_0x495648+=_0x34b7ec[_0xec94('0xf')](_0xec94('0xa'));_0x4dad86[_0xec94('0x10')]=_0x495648;_0x4dad86[_0xec94('0x11')]=moment(_0x495648)[_0xec94('0x12')](0x7,_0xec94('0x13'))[_0xec94('0x8')]();_0x4dad86['grayReason']=_0x4dad86[_0xec94('0xc')]!=_0x4dad86[_0xec94('0x14')]?'changed':_0xec94('0x15');}return _0x4dad86;}catch(_0x4e9bd1){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xec94('0x16'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xec94('0x17'),'uuid':_0x557bd4[_0xec94('0x18')],'machineUuid':hardware[_0xec94('0x19')](),'message':_0x4e9bd1['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xec94('0x1a'),'uuid':_0x557bd4[_0xec94('0x18')],'machineUuid':hardware[_0xec94('0x19')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0xec94('0x1b')]=function(_0x49c83d){return db['License'][_0xec94('0x1c')](_[_0xec94('0x1d')](_0x49c83d,{'raw':!![],'where':{'id':0x1}}))[_0xec94('0x1e')](function(_0x4fc2c8){return checkLicense(_0x4fc2c8,null);});};exports[_0xec94('0x1f')]=checkLicense; \ No newline at end of file +var _0xcff4=['final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','deadline','add','days','grayReason','disabled','2027-01-01T00:00:00.000Z','License','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8'];(function(_0x225e7c,_0x4f12b9){var _0x3ccc2a=function(_0x3f1cff){while(--_0x3f1cff){_0x225e7c['push'](_0x225e7c['shift']());}};_0x3ccc2a(++_0x4f12b9);}(_0xcff4,0x11e));var _0x4cff=function(_0x10c643,_0x438025){_0x10c643=_0x10c643-0x0;var _0x47596d=_0xcff4[_0x10c643];return _0x47596d;};'use strict';var crypto=require(_0x4cff('0x0'));var util=require(_0x4cff('0x1'));var _=require(_0x4cff('0x2'));var moment=require(_0x4cff('0x3'));var hardware=require(_0x4cff('0x4'));var config=require(_0x4cff('0x5'));var db=require('../../mysqldb')['db'];function checkLicense(_0x20cc97,_0x47a41f){if(_0x20cc97){try{var _0x34a2f1=_0x47a41f||_0x20cc97[_0x4cff('0x6')];if(_[_0x4cff('0x7')](_0x34a2f1)){throw new Error(_0x4cff('0x8'));}var _0x355206=_0x20cc97[_0x4cff('0x9')];var _0x4b4880=_0x20cc97[_0x4cff('0xa')];var _0x85a634=_0x355206[_0x4cff('0xb')]('-')[0x4];var _0x2f475c=_0x355206[_0x4cff('0xb')]('-')[0x0];var _0x126da4=crypto[_0x4cff('0xc')](_0x4cff('0xd'),util[_0x4cff('0xe')](_0x4cff('0xf'),_0x85a634,_0x355206,_0x2f475c));var _0x5f42a9=_0x126da4['update'](_0x34a2f1,_0x4cff('0x10'),_0x4cff('0x11'));_0x5f42a9+=_0x126da4[_0x4cff('0x12')]('utf8');var _0x21057c=JSON[_0x4cff('0x13')](_0x5f42a9);_0x21057c[_0x4cff('0x14')]=![];_0x21057c[_0x4cff('0x15')]=_0x355206;_0x21057c[_0x4cff('0x16')]=hardware[_0x4cff('0x17')]();if(_0x4b4880){var _0x3ac6be=crypto[_0x4cff('0xc')](_0x4cff('0xd'),config[_0x4cff('0x18')][_0x4cff('0x19')]);var _0x3a141d=_0x3ac6be['update'](_0x4b4880,_0x4cff('0x10'),'utf8');_0x3a141d+=_0x3ac6be[_0x4cff('0x12')](_0x4cff('0x11'));_0x21057c[_0x4cff('0x1a')]=_0x3a141d;_0x21057c[_0x4cff('0x1b')]=moment(_0x3a141d)[_0x4cff('0x1c')](0x7,_0x4cff('0x1d'))[_0x4cff('0xe')]();_0x21057c[_0x4cff('0x1e')]=_0x21057c['uuid']!=_0x21057c[_0x4cff('0x16')]?'changed':_0x4cff('0x1f');}return _0x21057c;}catch(_0xa3086c){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4cff('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x20cc97['data1'],'machineUuid':hardware[_0x4cff('0x17')](),'message':_0xa3086c['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4cff('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x20cc97[_0x4cff('0x9')],'machineUuid':hardware[_0x4cff('0x17')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports['getLicense']=function(_0x3e059b){return db[_0x4cff('0x21')][_0x4cff('0x22')](_[_0x4cff('0x23')](_0x3e059b,{'raw':!![],'where':{'id':0x1}}))[_0x4cff('0x24')](function(_0x175c80){return checkLicense(_0x175c80,null);});};exports[_0x4cff('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ea1f5d7..b175c96 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 _0x4490=['app-id','http://localhost:9000','myappanuglar-secret'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4490,0x112));var _0x0449=function(_0x493c9b,_0x51f993){_0x493c9b=_0x493c9b-0x0;var _0x1333c5=_0x4490[_0x493c9b];return _0x1333c5;};'use strict';module['exports']={'DOMAIN':_0x0449('0x0'),'SESSION_SECRET':_0x0449('0x1'),'GOOGLE_ID':_0x0449('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x4e24=['exports','http://localhost:9000','secret'];(function(_0x982f12,_0x2877a6){var _0x340bef=function(_0xf07c50){while(--_0xf07c50){_0x982f12['push'](_0x982f12['shift']());}};_0x340bef(++_0x2877a6);}(_0x4e24,0x1ef));var _0x44e2=function(_0x5ea137,_0x7bdeac){_0x5ea137=_0x5ea137-0x0;var _0x2621b1=_0x4e24[_0x5ea137];return _0x2621b1;};'use strict';module[_0x44e2('0x0')]={'DOMAIN':_0x44e2('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x44e2('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d2e22ba..a2cfb95 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed75=['toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','INFO','join','/var','log','xcally','format','%s-%s.log'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xed75,0x15e));var _0x5ed7=function(_0x471a67,_0x4a1847){_0x471a67=_0x471a67-0x0;var _0x3ef86e=_0xed75[_0x471a67];return _0x3ef86e;};'use strict';var moment=require(_0x5ed7('0x0'));var winston=require(_0x5ed7('0x1'));var util=require(_0x5ed7('0x2'));var path=require('path');var debugLevel=_0x5ed7('0x3');function filename(_0x1e310d,_0x41b86a){return path[_0x5ed7('0x4')](_0x5ed7('0x5'),_0x5ed7('0x6'),_0x5ed7('0x7'),util[_0x5ed7('0x8')](_0x5ed7('0x9'),_0x1e310d,_0x41b86a));}function formatter(_0xf1581d,_0x1d4007){return util[_0x5ed7('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x1d4007['level'][_0x5ed7('0xa')](),_0xf1581d,_0x1d4007['message']);}module[_0x5ed7('0xb')]=function(_0x389980){return new winston[(_0x5ed7('0xc'))]({'transports':[new winston[(_0x5ed7('0xd'))][(_0x5ed7('0xe'))]({'name':util[_0x5ed7('0x8')](_0x5ed7('0xf'),_0x389980,_0x5ed7('0x10')),'filename':filename(_0x389980,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1fc3fb){return formatter(_0x389980,_0x1fc3fb);}}),new winston[(_0x5ed7('0xd'))][(_0x5ed7('0xe'))]({'name':util[_0x5ed7('0x8')](_0x5ed7('0xf'),_0x389980,'info'),'filename':filename(_0x389980,_0x5ed7('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26a1b3){return formatter(_0x389980,_0x26a1b3);}}),new winston['transports'][(_0x5ed7('0x12'))]({'level':process['env'][_0x5ed7('0x13')]||debugLevel,'json':![],'formatter':function(_0x3b2ff4){return formatter(_0x389980,_0x3b2ff4);}})]});}; \ No newline at end of file +var _0xc126=['transports','info','Console','debugLevel','moment','winston','util','path','INFO','/var','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','exports','File','%s-%s','error'];(function(_0x51904f,_0x439694){var _0x24dc27=function(_0x3046b1){while(--_0x3046b1){_0x51904f['push'](_0x51904f['shift']());}};_0x24dc27(++_0x439694);}(_0xc126,0xf4));var _0x6c12=function(_0x491198,_0x2f3a44){_0x491198=_0x491198-0x0;var _0x40bc08=_0xc126[_0x491198];return _0x40bc08;};'use strict';var moment=require(_0x6c12('0x0'));var winston=require(_0x6c12('0x1'));var util=require(_0x6c12('0x2'));var path=require(_0x6c12('0x3'));var debugLevel=_0x6c12('0x4');function filename(_0x3063bc,_0x1232c9){return path['join'](_0x6c12('0x5'),'log',_0x6c12('0x6'),util[_0x6c12('0x7')]('%s-%s.log',_0x3063bc,_0x1232c9));}function formatter(_0x40c2b4,_0x44c2ba){return util['format'](_0x6c12('0x8'),moment()[_0x6c12('0x7')](_0x6c12('0x9')),_0x44c2ba[_0x6c12('0xa')]['toUpperCase'](),_0x40c2b4,_0x44c2ba[_0x6c12('0xb')]);}module[_0x6c12('0xc')]=function(_0x18e455){return new winston['Logger']({'transports':[new winston['transports'][(_0x6c12('0xd'))]({'name':util['format'](_0x6c12('0xe'),_0x18e455,_0x6c12('0xf')),'filename':filename(_0x18e455,_0x6c12('0xf')),'level':_0x6c12('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x20e66b){return formatter(_0x18e455,_0x20e66b);}}),new winston[(_0x6c12('0x10'))][(_0x6c12('0xd'))]({'name':util[_0x6c12('0x7')]('%s-%s',_0x18e455,_0x6c12('0x11')),'filename':filename(_0x18e455,_0x6c12('0x11')),'level':_0x6c12('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x564e42){return formatter(_0x18e455,_0x564e42);}}),new winston[(_0x6c12('0x10'))][(_0x6c12('0x12'))]({'level':process['env'][_0x6c12('0x13')]||debugLevel,'json':![],'formatter':function(_0x4c067b){return formatter(_0x18e455,_0x4c067b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 0c39402..a92ee2b 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 _0x625b=['routing','../../services/routing/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x831f40,_0x5964d9){var _0x6a3ce8=function(_0x3e0b59){while(--_0x3e0b59){_0x831f40['push'](_0x831f40['shift']());}};_0x6a3ce8(++_0x5964d9);}(_0x625b,0x121));var _0xb625=function(_0x18fc56,_0x4e0fc1){_0x18fc56=_0x18fc56-0x0;var _0x58302a=_0x625b[_0x18fc56];return _0x58302a;};'use strict';var path=require(_0xb625('0x0'));var os=require('os');var config={'apps':[{'name':_0xb625('0x1'),'script':path[_0xb625('0x2')](__dirname,_0xb625('0x3'))},{'name':_0xb625('0x4'),'script':path[_0xb625('0x2')](__dirname,_0xb625('0x5'))},{'name':_0xb625('0x6'),'script':path[_0xb625('0x2')](__dirname,_0xb625('0x7'))},{'name':_0xb625('0x8'),'script':path[_0xb625('0x2')](__dirname,_0xb625('0x9'))},{'name':_0xb625('0xa'),'script':path[_0xb625('0x2')](__dirname,_0xb625('0xb'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0xb625('0xc')]=config; \ No newline at end of file +var _0x4f09=['join','../../services/express/index.js','../../services/ami/index.js','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4f09,0x18b));var _0x94f0=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x4f09[_0x368fb9];return _0x4892fb;};'use strict';var path=require(_0x94f0('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x94f0('0x1')](__dirname,_0x94f0('0x2'))},{'name':'ami','script':path[_0x94f0('0x1')](__dirname,_0x94f0('0x3'))},{'name':'agi','script':path['join'](__dirname,_0x94f0('0x4'))},{'name':_0x94f0('0x5'),'script':path[_0x94f0('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x94f0('0x6'),'script':path['join'](__dirname,_0x94f0('0x7'))},{'name':_0x94f0('0x8'),'script':path[_0x94f0('0x1')](__dirname,_0x94f0('0x9'))}]};module[_0x94f0('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 5b49722..802d045 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 _0x71ad=['connect','start','disconnect','stop','then','restart','list','describe','delete','dump','pm2','bluebird'];(function(_0x3eac74,_0x300383){var _0x365ec9=function(_0xd70261){while(--_0xd70261){_0x3eac74['push'](_0x3eac74['shift']());}};_0x365ec9(++_0x300383);}(_0x71ad,0xee));var _0xd71a=function(_0x474f1c,_0x15cb4a){_0x474f1c=_0x474f1c-0x0;var _0x429e8f=_0x71ad[_0x474f1c];return _0x429e8f;};'use strict';var pm2=require(_0xd71a('0x0'));var BPromise=require(_0xd71a('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x30838f,_0x5932b5){return pm2[_0xd71a('0x2')](function(_0x1f5c49){if(_0x1f5c49){return _0x5932b5(_0x1f5c49);}return _0x30838f('connected');});});};exports[_0xd71a('0x3')]=function(_0x5192c5){return connect()['then'](function(){return new BPromise(function(_0x42ddcc,_0x5ec697){return pm2[_0xd71a('0x3')](_0x5192c5,function(_0x371653,_0x1f603d){if(_0x371653){return _0x5ec697(_0x371653);}pm2[_0xd71a('0x4')]();return _0x42ddcc(_0x1f603d);});});});};exports[_0xd71a('0x5')]=function(_0x1591a7){return connect()[_0xd71a('0x6')](function(){return new BPromise(function(_0x4c8d66,_0x26102d){return pm2['stop'](_0x1591a7,function(_0x52aff1,_0x1364b4){if(_0x52aff1){return _0x26102d(_0x52aff1);}pm2[_0xd71a('0x4')]();return _0x4c8d66(_0x1364b4);});});});};exports[_0xd71a('0x7')]=function(_0x2832b3){return connect()[_0xd71a('0x6')](function(){return new BPromise(function(_0x19294e,_0x396c5e){return pm2[_0xd71a('0x7')](_0x2832b3,function(_0x266da5,_0x3a0162){if(_0x266da5){return _0x396c5e(_0x266da5);}pm2['disconnect']();return _0x19294e(_0x3a0162);});});});};exports[_0xd71a('0x8')]=function(){return connect()[_0xd71a('0x6')](function(){return new BPromise(function(_0x3bdeea,_0xc47ea8){return pm2[_0xd71a('0x8')](function(_0x3f6938,_0x10c0de){if(_0x3f6938){return _0xc47ea8(_0x3f6938);}pm2[_0xd71a('0x4')]();return _0x3bdeea(_0x10c0de);});});});};exports[_0xd71a('0x9')]=function(_0xfdcc6d){return connect()[_0xd71a('0x6')](function(){return new BPromise(function(_0x15fd57,_0x2c54c5){return pm2[_0xd71a('0x9')](_0xfdcc6d,function(_0xd16472,_0x53904e){if(_0xd16472){return _0x2c54c5(_0xd16472);}pm2[_0xd71a('0x4')]();return _0x15fd57(_0x53904e);});});});};exports[_0xd71a('0xa')]=function(_0x6abf4f){return connect()['then'](function(){return new BPromise(function(_0x50cceb,_0x4e3832){return pm2[_0xd71a('0xa')](_0x6abf4f,function(_0x139bc8,_0x1aaec8){if(_0x139bc8){return _0x4e3832(_0x139bc8);}pm2[_0xd71a('0x4')]();return _0x50cceb(_0x1aaec8);});});});};exports[_0xd71a('0xb')]=function(){return connect()[_0xd71a('0x6')](function(){return new BPromise(function(_0x5b61a8,_0x408c0d){return pm2[_0xd71a('0xb')](function(_0x4f1eb7){if(_0x4f1eb7){return _0x408c0d(_0x4f1eb7);}return _0x5b61a8('saved');});});});}; \ No newline at end of file +var _0xaf79=['bluebird','./config','connect','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x40733f,_0x1e8c0c){var _0x2ba071=function(_0x138bc4){while(--_0x138bc4){_0x40733f['push'](_0x40733f['shift']());}};_0x2ba071(++_0x1e8c0c);}(_0xaf79,0x82));var _0x9af7=function(_0x1a10ec,_0x1259ee){_0x1a10ec=_0x1a10ec-0x0;var _0x3c5337=_0xaf79[_0x1a10ec];return _0x3c5337;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9af7('0x0'));var config=require(_0x9af7('0x1'));function connect(){return new BPromise(function(_0x3cd2b4,_0x19a247){return pm2[_0x9af7('0x2')](function(_0x216de5){if(_0x216de5){return _0x19a247(_0x216de5);}return _0x3cd2b4('connected');});});};exports[_0x9af7('0x3')]=function(_0xfa2a43){return connect()[_0x9af7('0x4')](function(){return new BPromise(function(_0x114853,_0x52cd01){return pm2['start'](_0xfa2a43,function(_0xbe8dda,_0x1a1abb){if(_0xbe8dda){return _0x52cd01(_0xbe8dda);}pm2[_0x9af7('0x5')]();return _0x114853(_0x1a1abb);});});});};exports[_0x9af7('0x6')]=function(_0x4d7d2f){return connect()[_0x9af7('0x4')](function(){return new BPromise(function(_0xa318a5,_0x3203dd){return pm2[_0x9af7('0x6')](_0x4d7d2f,function(_0x1371cd,_0x6df97b){if(_0x1371cd){return _0x3203dd(_0x1371cd);}pm2[_0x9af7('0x5')]();return _0xa318a5(_0x6df97b);});});});};exports['restart']=function(_0x3615b8){return connect()[_0x9af7('0x4')](function(){return new BPromise(function(_0x1a9473,_0x45c53d){return pm2[_0x9af7('0x7')](_0x3615b8,function(_0x1f76b3,_0x70c042){if(_0x1f76b3){return _0x45c53d(_0x1f76b3);}pm2[_0x9af7('0x5')]();return _0x1a9473(_0x70c042);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x420931,_0x3f7b70){return pm2[_0x9af7('0x8')](function(_0x264344,_0x408492){if(_0x264344){return _0x3f7b70(_0x264344);}pm2[_0x9af7('0x5')]();return _0x420931(_0x408492);});});});};exports[_0x9af7('0x9')]=function(_0x539cd5){return connect()['then'](function(){return new BPromise(function(_0x471c1a,_0x197f67){return pm2['describe'](_0x539cd5,function(_0x229e2f,_0x19f720){if(_0x229e2f){return _0x197f67(_0x229e2f);}pm2[_0x9af7('0x5')]();return _0x471c1a(_0x19f720);});});});};exports[_0x9af7('0xa')]=function(_0x19f539){return connect()[_0x9af7('0x4')](function(){return new BPromise(function(_0x549946,_0x5dc36c){return pm2['delete'](_0x19f539,function(_0x3da4ec,_0x8b1434){if(_0x3da4ec){return _0x5dc36c(_0x3da4ec);}pm2['disconnect']();return _0x549946(_0x8b1434);});});});};exports[_0x9af7('0xb')]=function(){return connect()[_0x9af7('0x4')](function(){return new BPromise(function(_0x164cdb,_0x1302f9){return pm2['dump'](function(_0x5cf9fc){if(_0x5cf9fc){return _0x1302f9(_0x5cf9fc);}return _0x164cdb(_0x9af7('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2488ea8..a029b69 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 _0x24fd=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','lastMsgAt','then','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','catch','error','start','lodash','moment','ioredis'];(function(_0x167926,_0x2e5e15){var _0x56c689=function(_0x937dba){while(--_0x937dba){_0x167926['push'](_0x167926['shift']());}};_0x56c689(++_0x2e5e15);}(_0x24fd,0x1c5));var _0xd24f=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x24fd[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xd24f('0x0'));var moment=require(_0xd24f('0x1'));var Redis=require(_0xd24f('0x2'));var db=require(_0xd24f('0x3'))['db'];var config=require('../../config/environment');config[_0xd24f('0x4')]=_[_0xd24f('0x5')](config[_0xd24f('0x4')],{'host':_0xd24f('0x6'),'port':0x18eb});var io=require(_0xd24f('0x7'))(new Redis(config[_0xd24f('0x4')]));function closeInteractions(){var _0x2c3298=0x0;var _0x3a791e=[];return db[_0xd24f('0x8')][_0xd24f('0x9')]({'raw':!![],'attributes':['id',_0xd24f('0xa')],'where':{'id':0x1}})['then'](function(_0x800cc1){_0x2c3298=_0x800cc1['chatTimeout'];if(_0x2c3298){return db[_0xd24f('0xb')]['findAll']({'raw':!![],'attributes':['id',_0xd24f('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x800cc1[_0xd24f('0xa')],'minutes')}}});}else{return[];}})[_0xd24f('0xd')](function(_0x1b6bc6){_0x3a791e=_0x1b6bc6;if(_0x2c3298){return db[_0xd24f('0xb')][_0xd24f('0xe')]({'closeReason':_0xd24f('0xf'),'disposition':_0xd24f('0x10'),'closed':!![],'closedAt':moment()[_0xd24f('0x11')](_0xd24f('0x12'))},{'where':{'id':_[_0xd24f('0x13')](_0x3a791e||[],'id')}});}})['then'](function(_0x51c770){for(var _0x1dc769=0x0;_0x1dc769<_0x3a791e[_0xd24f('0x14')];_0x1dc769++){io['emit']('chatInteraction:update',{'id':_0x3a791e[_0x1dc769]['id'],'closed':!![]});}})[_0xd24f('0x15')](function(_0x32b07e){console[_0xd24f('0x16')](_0x32b07e);});}exports[_0xd24f('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6f62=['then','ChatInteraction','subtract','update','system','length','chatInteraction:update','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','localhost','socket.io-emitter','find','chatTimeout'];(function(_0x1d848e,_0x3cb976){var _0x3b7ceb=function(_0x37351b){while(--_0x37351b){_0x1d848e['push'](_0x1d848e['shift']());}};_0x3b7ceb(++_0x3cb976);}(_0x6f62,0x1ee));var _0x26f6=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x6f62[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0x26f6('0x0'));var moment=require(_0x26f6('0x1'));var Redis=require(_0x26f6('0x2'));var db=require(_0x26f6('0x3'))['db'];var config=require(_0x26f6('0x4'));config[_0x26f6('0x5')]=_['defaults'](config['redis'],{'host':_0x26f6('0x6'),'port':0x18eb});var io=require(_0x26f6('0x7'))(new Redis(config[_0x26f6('0x5')]));function closeInteractions(){var _0x127759=0x0;var _0x3e3ce4=[];return db['Setting'][_0x26f6('0x8')]({'raw':!![],'attributes':['id',_0x26f6('0x9')],'where':{'id':0x1}})[_0x26f6('0xa')](function(_0x3c50e5){_0x127759=_0x3c50e5['chatTimeout'];if(_0x127759){return db[_0x26f6('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x26f6('0xc')](_0x3c50e5[_0x26f6('0x9')],'minutes')}}});}else{return[];}})[_0x26f6('0xa')](function(_0x43b60d){_0x3e3ce4=_0x43b60d;if(_0x127759){return db[_0x26f6('0xb')][_0x26f6('0xd')]({'closeReason':_0x26f6('0xe'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_['map'](_0x3e3ce4||[],'id')}});}})[_0x26f6('0xa')](function(_0x21ea41){for(var _0x304564=0x0;_0x304564<_0x3e3ce4[_0x26f6('0xf')];_0x304564++){io['emit'](_0x26f6('0x10'),{'id':_0x3e3ce4[_0x304564]['id'],'closed':!![]});}})['catch'](function(_0x1601ee){console['error'](_0x1601ee);});}exports[_0x26f6('0x11')]=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 0b4fe28..2398db3 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 _0x69b7=['port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','basename','zip','join','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','keys','jobs','map','intersection','difference','length','toString','exists','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','stop','deleteJob','stop\x20cron','endAt','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','MailAccount'];(function(_0x290b68,_0x1f82af){var _0x2f23af=function(_0x5efc22){while(--_0x5efc22){_0x290b68['push'](_0x290b68['shift']());}};_0x2f23af(++_0x1f82af);}(_0x69b7,0x15b));var _0x769b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x69b7[_0x17d9e3];return _0x14192d;};'use strict';var fs=require('fs');var util=require(_0x769b('0x0'));var path=require(_0x769b('0x1'));var _=require(_0x769b('0x2'));var moment=require(_0x769b('0x3'));var CronJobManager=require(_0x769b('0x4'));var jayson=require(_0x769b('0x5'));var BPromise=require('bluebird');var logger=require(_0x769b('0x6'))(_0x769b('0x7'));var db=require(_0x769b('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x769b('0x9'));var client=jayson['client'][_0x769b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x18e5ec,_0x5c8042){return function(){logger['info'](_0x769b('0xb'),_0x18e5ec[_0x769b('0xc')]);var _0x4ce7a2=!![];var _0x353daa={'tls':{'rejectUnauthorized':![]}};if(_0x18e5ec['MailAccount'][_0x769b('0xd')]['service']){_0x353daa[_0x769b('0xe')]=_0x18e5ec['MailAccount'][_0x769b('0xd')][_0x769b('0xe')];}else{_0x353daa[_0x769b('0xf')]=_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')]['host'];_0x353daa[_0x769b('0x11')]=_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x11')];_0x353daa['secure']=_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x12')];}if(_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x13')]){_0x353daa[_0x769b('0x14')]={'user':_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x15')],'pass':_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x16')]};}var _0x22ffb2={'account':_0x353daa,'message':{'from':util[_0x769b('0x17')](_0x769b('0x18'),_0x18e5ec['MailAccount'][_0x769b('0x19')],_0x18e5ec['MailAccount'][_0x769b('0xc')]||_0x18e5ec[_0x769b('0x10')][_0x769b('0xd')][_0x769b('0x15')]),'to':_0x18e5ec[_0x769b('0xc')],'cc':_0x18e5ec['cc'],'bcc':_0x18e5ec[_0x769b('0x1a')],'subject':util[_0x769b('0x17')](_0x769b('0x1b'),_0x5c8042['name'],_0x18e5ec['subtractNumber'],_0x18e5ec[_0x769b('0x1c')])}};var _0x1502d3=path['join'](__dirname,_0x769b('0x1d'));var _0x564956=_0x5c8042[_0x769b('0x1e')];var _0x360dfb=util[_0x769b('0x17')]('%s.%s',path[_0x769b('0x1f')](_0x5c8042[_0x769b('0x1e')],path['extname'](_0x5c8042[_0x769b('0x1e')])),_0x769b('0x20'));var _0x121d21=path[_0x769b('0x21')](_0x1502d3,_0x564956);var _0x47ae14=path[_0x769b('0x21')](_0x1502d3,_0x360dfb);if(fs['existsSync'](_0x121d21)){_0x5c8042[_0x769b('0x22')]=_0x769b('0x23');_0x22ffb2[_0x769b('0x24')][_0x769b('0x25')]=[{'filename':_0x564956,'path':_0x121d21}];_0x22ffb2['message'][_0x769b('0x26')]=util[_0x769b('0x17')](_0x769b('0x27'),JSON[_0x769b('0x28')](_0x5c8042,null,0x2));}else if(fs[_0x769b('0x29')](_0x47ae14)){_0x5c8042['status']=_0x769b('0x23');_0x22ffb2[_0x769b('0x24')][_0x769b('0x25')]=[{'filename':_0x360dfb,'path':_0x47ae14}];}else{_0x22ffb2['message'][_0x769b('0x26')]=_0x769b('0x2a');if(!_0x18e5ec[_0x769b('0x2b')]){_0x4ce7a2=![];logger[_0x769b('0x2c')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x4ce7a2){return client[_0x769b('0x2d')](_0x769b('0x2e'),_0x22ffb2)[_0x769b('0x2f')](function(_0x563bc5){if(_0x563bc5[_0x769b('0x30')]){return logger[_0x769b('0x30')](_0x769b('0x31'),JSON['stringify'](_0x563bc5));}return logger['info'](_0x769b('0x32'));})[_0x769b('0x33')](function(_0x4a0c26){return logger['error']('error\x20mail',JSON[_0x769b('0x28')](_0x4a0c26));});}};}function handleError(){return function(_0x9c7f32){return logger[_0x769b('0x30')](JSON['stringify'](_0x9c7f32));};}function handleResult(_0x51d4b1){return function(_0x2bfb53){logger['info']('data',JSON['stringify'](_0x2bfb53));if(_0x51d4b1[_0x769b('0x10')]&&_0x51d4b1[_0x769b('0x10')][_0x769b('0xd')]&&!_[_0x769b('0x34')](_0x51d4b1['email'])){setTimeout(handleSendEmail(_0x51d4b1,_0x2bfb53),0x3c*0x3e8);}};}function handleJob(_0xe11c46){return function(){try{if(_[_0x769b('0x34')](_0xe11c46['subtractNumber'])){return logger[_0x769b('0x2c')](_0x769b('0x35'));}if(_['isNil'](_0xe11c46[_0x769b('0x1c')])){return logger[_0x769b('0x2c')](_0x769b('0x36'));}var _0xa13ed2={'startDate':moment()['subtract'](_0xe11c46['subtractNumber'],_0xe11c46[_0x769b('0x1c')])[_0x769b('0x17')](_0x769b('0x37')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x769b('0x38'),'output':_0xe11c46[_0x769b('0x39')],'name':_0xe11c46[_0x769b('0x19')]};if(!_[_0x769b('0x34')](_0xe11c46[_0x769b('0x3a')])){logger['info'](_0x769b('0x3b'),_0xe11c46['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0xe11c46['DefaultReportId']},_0xa13ed2)[_0x769b('0x2f')](handleResult(_0xe11c46))[_0x769b('0x33')](handleError());}if(!_[_0x769b('0x34')](_0xe11c46[_0x769b('0x3c')])){logger[_0x769b('0x2c')](_0x769b('0x3d'),_0xe11c46['CustomReportId']);return analyticCustomReportController[_0x769b('0x3e')]({'id':_0xe11c46[_0x769b('0x3c')]},_0xa13ed2)[_0x769b('0x2f')](handleResult(_0xe11c46))[_0x769b('0x33')](handleError());}}catch(_0x42e09d){logger[_0x769b('0x30')](JSON[_0x769b('0x28')](_0x42e09d));}return logger['info'](_0x769b('0x3f'));};}function getJobs(_0xaa0ff6){var _0x7b503e={};if(_0xaa0ff6){_0x7b503e['id']=_0xaa0ff6;}return db[_0x769b('0x40')][_0x769b('0x41')]({'where':_0x7b503e,'include':[{'model':db[_0x769b('0x10')],'attributes':['id',_0x769b('0x19'),_0x769b('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x769b('0xd')}]}]})[_0x769b('0x2f')](function(_0x33522c){var _0x17e2f6=_[_0x769b('0x42')](manager[_0x769b('0x43')]);var _0x8978f6=_[_0x769b('0x44')](_0x33522c,function(_0x5b8b23){return _0x5b8b23['id']['toString']();});var _0x56e2c7=_['keyBy'](_0x33522c,function(_0x195112){return _0x195112['id']['toString']();});var _0x19cec2=_0xaa0ff6?_0x8978f6:_['difference'](_0x8978f6,_0x17e2f6);var _0x215cfd=_[_0x769b('0x45')](_0x8978f6,_0x17e2f6);var _0x54864e=_[_0x769b('0x46')](_0x17e2f6,_0x8978f6);var _0x1b7e88;var _0x594779;for(_0x1b7e88=0x0;_0x1b7e88<_0x54864e[_0x769b('0x47')]&&!_0xaa0ff6;_0x1b7e88+=0x1){_0x594779=_0x54864e[_0x1b7e88][_0x769b('0x48')]();if(manager[_0x769b('0x49')](_0x594779)){manager['stop'](_0x594779);manager['deleteJob'](_0x594779);logger[_0x769b('0x2c')](_0x769b('0x4a'),_0x594779);}}logger['info'](_0x769b('0x4b'),JSON[_0x769b('0x28')](_0x19cec2));for(_0x1b7e88=0x0;_0x1b7e88<_0x19cec2[_0x769b('0x47')];_0x1b7e88+=0x1){_0x594779=_0x19cec2[_0x1b7e88][_0x769b('0x48')]();logger[_0x769b('0x2c')](_0x769b('0x4c'),_0x594779);if(_0xaa0ff6){logger[_0x769b('0x2c')](_0x769b('0x4d'),_0xaa0ff6);logger[_0x769b('0x2c')](JSON[_0x769b('0x28')](_0x56e2c7[_0x594779]));BPromise[_0x769b('0x4e')]()[_0x769b('0x2f')](handleJob(_0x56e2c7[_0x594779]));logger[_0x769b('0x2c')](_0x769b('0x4f'),_0x56e2c7[_0x594779][_0x769b('0x19')],_0x56e2c7[_0x594779][_0x769b('0x50')]);}else if(_0x56e2c7[_0x594779][_0x769b('0x50')]&&_0x56e2c7[_0x594779][_0x769b('0x51')]&&moment()[_0x769b('0x52')](_0x56e2c7[_0x594779][_0x769b('0x53')],_0x56e2c7[_0x594779]['endAt'])){manager[_0x769b('0x54')](_0x594779,_0x56e2c7[_0x594779][_0x769b('0x50')],handleJob(_0x56e2c7[_0x594779]));manager[_0x769b('0x55')](_0x594779);logger['info']('add\x20cron',_0x56e2c7[_0x594779][_0x769b('0x19')],_0x56e2c7[_0x594779][_0x769b('0x50')]);}else if(manager[_0x769b('0x49')](_0x594779)){manager[_0x769b('0x56')](_0x594779);manager[_0x769b('0x57')](_0x594779);logger[_0x769b('0x2c')](_0x769b('0x58'),_0x56e2c7[_0x594779][_0x769b('0x19')],_0x56e2c7[_0x594779][_0x769b('0x50')]);}}for(_0x1b7e88=0x0,_0x594779;_0x1b7e88<_0x215cfd[_0x769b('0x47')]&&!_0xaa0ff6;_0x1b7e88+=0x1){_0x594779=_0x215cfd[_0x1b7e88][_0x769b('0x48')]();if(manager[_0x769b('0x49')](_0x594779)){if(_0x56e2c7[_0x594779][_0x769b('0x50')]&&_0x56e2c7[_0x594779][_0x769b('0x51')]&&moment()['isBetween'](_0x56e2c7[_0x594779]['startAt'],_0x56e2c7[_0x594779][_0x769b('0x59')])){manager['update'](_0x594779,_0x56e2c7[_0x594779][_0x769b('0x50')],handleJob(_0x56e2c7[_0x594779]));logger[_0x769b('0x2c')]('update\x20cron',_0x56e2c7[_0x594779][_0x769b('0x19')],_0x56e2c7[_0x594779]['cron']);}else{manager[_0x769b('0x56')](_0x594779);manager[_0x769b('0x57')](_0x594779);logger['info']('stop\x20cron',_0x56e2c7[_0x594779][_0x769b('0x19')],_0x56e2c7[_0x594779][_0x769b('0x50')]);}}}})[_0x769b('0x33')](function(_0xdeb927){logger[_0x769b('0x30')](JSON[_0x769b('0x28')](_0xdeb927));});}exports[_0x769b('0x5a')]=function(_0x48b902){return getJobs(_0x48b902);};exports[_0x769b('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xeb7e=['pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','status','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','update\x20cron','catch','run','path','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','host','port','secure','authentication','user'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeb7e,0x1f2));var _0xeeb7=function(_0x325834,_0x2c65ab){_0x325834=_0x325834-0x0;var _0x25f3d0=_0xeb7e[_0x325834];return _0x25f3d0;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xeeb7('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xeeb7('0x1'));var jayson=require('jayson/promise');var BPromise=require(_0xeeb7('0x2'));var logger=require(_0xeeb7('0x3'))(_0xeeb7('0x4'));var db=require(_0xeeb7('0x5'))['db'];var analyticCustomReportController=require(_0xeeb7('0x6'));var analyticDefaultReportController=require(_0xeeb7('0x7'));var client=jayson[_0xeeb7('0x8')][_0xeeb7('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x51b684,_0x352ab5){return function(){logger['info'](_0xeeb7('0xa'),_0x51b684['email']);var _0x1ee57e=!![];var _0x444dee={'tls':{'rejectUnauthorized':![]}};if(_0x51b684[_0xeeb7('0xb')][_0xeeb7('0xc')]['service']){_0x444dee['service']=_0x51b684[_0xeeb7('0xb')][_0xeeb7('0xc')]['service'];}else{_0x444dee[_0xeeb7('0xd')]=_0x51b684[_0xeeb7('0xb')]['Smtp'][_0xeeb7('0xd')];_0x444dee['port']=_0x51b684[_0xeeb7('0xb')]['Smtp'][_0xeeb7('0xe')];_0x444dee['secure']=_0x51b684['MailAccount']['Smtp'][_0xeeb7('0xf')];}if(_0x51b684['MailAccount'][_0xeeb7('0xc')][_0xeeb7('0x10')]){_0x444dee['auth']={'user':_0x51b684['MailAccount'][_0xeeb7('0xc')][_0xeeb7('0x11')],'pass':_0x51b684[_0xeeb7('0xb')][_0xeeb7('0xc')][_0xeeb7('0x12')]};}var _0x28bdaa={'account':_0x444dee,'message':{'from':util[_0xeeb7('0x13')](_0xeeb7('0x14'),_0x51b684[_0xeeb7('0xb')][_0xeeb7('0x15')],_0x51b684[_0xeeb7('0xb')][_0xeeb7('0x16')]||_0x51b684[_0xeeb7('0xb')][_0xeeb7('0xc')][_0xeeb7('0x11')]),'to':_0x51b684[_0xeeb7('0x16')],'cc':_0x51b684['cc'],'bcc':_0x51b684[_0xeeb7('0x17')],'subject':util[_0xeeb7('0x13')](_0xeeb7('0x18'),_0x352ab5['name'],_0x51b684[_0xeeb7('0x19')],_0x51b684[_0xeeb7('0x1a')])}};var _0x11f75a=path[_0xeeb7('0x1b')](__dirname,_0xeeb7('0x1c'));var _0x31c7d5=_0x352ab5[_0xeeb7('0x1d')];var _0x22c0ab=util[_0xeeb7('0x13')]('%s.%s',path[_0xeeb7('0x1e')](_0x352ab5[_0xeeb7('0x1d')],path[_0xeeb7('0x1f')](_0x352ab5[_0xeeb7('0x1d')])),_0xeeb7('0x20'));var _0x4bae3f=path[_0xeeb7('0x1b')](_0x11f75a,_0x31c7d5);var _0x124abf=path[_0xeeb7('0x1b')](_0x11f75a,_0x22c0ab);if(fs['existsSync'](_0x4bae3f)){_0x352ab5[_0xeeb7('0x21')]=_0xeeb7('0x22');_0x28bdaa['message'][_0xeeb7('0x23')]=[{'filename':_0x31c7d5,'path':_0x4bae3f}];_0x28bdaa['message'][_0xeeb7('0x24')]=util[_0xeeb7('0x13')](_0xeeb7('0x25'),JSON[_0xeeb7('0x26')](_0x352ab5,null,0x2));}else if(fs[_0xeeb7('0x27')](_0x124abf)){_0x352ab5[_0xeeb7('0x21')]=_0xeeb7('0x22');_0x28bdaa['message'][_0xeeb7('0x23')]=[{'filename':_0x22c0ab,'path':_0x124abf}];}else{_0x28bdaa['message'][_0xeeb7('0x24')]=_0xeeb7('0x28');if(!_0x51b684[_0xeeb7('0x29')]){_0x1ee57e=![];logger[_0xeeb7('0x2a')](_0xeeb7('0x2b'));}}if(_0x1ee57e){return client['request'](_0xeeb7('0x2c'),_0x28bdaa)[_0xeeb7('0x2d')](function(_0x24136a){if(_0x24136a[_0xeeb7('0x2e')]){return logger[_0xeeb7('0x2e')]('error\x20mail',JSON[_0xeeb7('0x26')](_0x24136a));}return logger['info'](_0xeeb7('0x2f'));})['catch'](function(_0x1b2dfb){return logger['error']('error\x20mail',JSON['stringify'](_0x1b2dfb));});}};}function handleError(){return function(_0xa8cd03){return logger[_0xeeb7('0x2e')](JSON[_0xeeb7('0x26')](_0xa8cd03));};}function handleResult(_0x51edc4){return function(_0x1b469c){logger['info'](_0xeeb7('0x30'),JSON[_0xeeb7('0x26')](_0x1b469c));if(_0x51edc4['MailAccount']&&_0x51edc4[_0xeeb7('0xb')][_0xeeb7('0xc')]&&!_[_0xeeb7('0x31')](_0x51edc4[_0xeeb7('0x16')])){setTimeout(handleSendEmail(_0x51edc4,_0x1b469c),0x3c*0x3e8);}};}function handleJob(_0x1f0408){return function(){try{if(_[_0xeeb7('0x31')](_0x1f0408[_0xeeb7('0x19')])){return logger[_0xeeb7('0x2a')](_0xeeb7('0x32'));}if(_[_0xeeb7('0x31')](_0x1f0408['subtractUnit'])){return logger[_0xeeb7('0x2a')](_0xeeb7('0x33'));}var _0x546255={'startDate':moment()[_0xeeb7('0x34')](_0x1f0408[_0xeeb7('0x19')],_0x1f0408[_0xeeb7('0x1a')])[_0xeeb7('0x13')](_0xeeb7('0x35')),'endDate':moment()[_0xeeb7('0x13')](_0xeeb7('0x35')),'type':_0xeeb7('0x36'),'output':_0x1f0408[_0xeeb7('0x37')],'name':_0x1f0408[_0xeeb7('0x15')]};if(!_[_0xeeb7('0x31')](_0x1f0408[_0xeeb7('0x38')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x1f0408['DefaultReportId']);return analyticDefaultReportController[_0xeeb7('0x39')]({'id':_0x1f0408[_0xeeb7('0x38')]},_0x546255)[_0xeeb7('0x2d')](handleResult(_0x1f0408))['catch'](handleError());}if(!_[_0xeeb7('0x31')](_0x1f0408[_0xeeb7('0x3a')])){logger[_0xeeb7('0x2a')](_0xeeb7('0x3b'),_0x1f0408[_0xeeb7('0x3a')]);return analyticCustomReportController['runReport']({'id':_0x1f0408[_0xeeb7('0x3a')]},_0x546255)['then'](handleResult(_0x1f0408))['catch'](handleError());}}catch(_0x5ae157){logger['error'](JSON[_0xeeb7('0x26')](_0x5ae157));}return logger[_0xeeb7('0x2a')]('no\x20report\x20id');};}function getJobs(_0x896298){var _0x17ce24={};if(_0x896298){_0x17ce24['id']=_0x896298;}return db[_0xeeb7('0x3c')][_0xeeb7('0x3d')]({'where':_0x17ce24,'include':[{'model':db[_0xeeb7('0xb')],'attributes':['id','name',_0xeeb7('0x16')],'include':[{'model':db[_0xeeb7('0x3e')],'as':_0xeeb7('0xc')}]}]})[_0xeeb7('0x2d')](function(_0x43f30e){var _0x46afc8=_[_0xeeb7('0x3f')](manager[_0xeeb7('0x40')]);var _0x1a00ca=_[_0xeeb7('0x41')](_0x43f30e,function(_0x3d17cd){return _0x3d17cd['id'][_0xeeb7('0x42')]();});var _0x29ef4d=_[_0xeeb7('0x43')](_0x43f30e,function(_0x1368b9){return _0x1368b9['id'][_0xeeb7('0x42')]();});var _0xa70b7b=_0x896298?_0x1a00ca:_['difference'](_0x1a00ca,_0x46afc8);var _0x4e62f6=_['intersection'](_0x1a00ca,_0x46afc8);var _0x2b96a5=_['difference'](_0x46afc8,_0x1a00ca);var _0x7870b5;var _0x51e410;for(_0x7870b5=0x0;_0x7870b5<_0x2b96a5[_0xeeb7('0x44')]&&!_0x896298;_0x7870b5+=0x1){_0x51e410=_0x2b96a5[_0x7870b5][_0xeeb7('0x42')]();if(manager[_0xeeb7('0x45')](_0x51e410)){manager[_0xeeb7('0x46')](_0x51e410);manager[_0xeeb7('0x47')](_0x51e410);logger[_0xeeb7('0x2a')](_0xeeb7('0x48'),_0x51e410);}}logger[_0xeeb7('0x2a')](_0xeeb7('0x49'),JSON[_0xeeb7('0x26')](_0xa70b7b));for(_0x7870b5=0x0;_0x7870b5<_0xa70b7b['length'];_0x7870b5+=0x1){_0x51e410=_0xa70b7b[_0x7870b5]['toString']();logger[_0xeeb7('0x2a')]('index',_0x51e410);if(_0x896298){logger[_0xeeb7('0x2a')]('my\x20id',_0x896298);logger[_0xeeb7('0x2a')](JSON[_0xeeb7('0x26')](_0x29ef4d[_0x51e410]));BPromise[_0xeeb7('0x4a')]()[_0xeeb7('0x2d')](handleJob(_0x29ef4d[_0x51e410]));logger['info'](_0xeeb7('0x4b'),_0x29ef4d[_0x51e410][_0xeeb7('0x15')],_0x29ef4d[_0x51e410]['cron']);}else if(_0x29ef4d[_0x51e410][_0xeeb7('0x4c')]&&_0x29ef4d[_0x51e410][_0xeeb7('0x4d')]&&moment()['isBetween'](_0x29ef4d[_0x51e410][_0xeeb7('0x4e')],_0x29ef4d[_0x51e410][_0xeeb7('0x4f')])){manager[_0xeeb7('0x50')](_0x51e410,_0x29ef4d[_0x51e410][_0xeeb7('0x4c')],handleJob(_0x29ef4d[_0x51e410]));manager[_0xeeb7('0x51')](_0x51e410);logger[_0xeeb7('0x2a')](_0xeeb7('0x52'),_0x29ef4d[_0x51e410][_0xeeb7('0x15')],_0x29ef4d[_0x51e410]['cron']);}else if(manager[_0xeeb7('0x45')](_0x51e410)){manager[_0xeeb7('0x46')](_0x51e410);manager[_0xeeb7('0x47')](_0x51e410);logger[_0xeeb7('0x2a')]('stop\x20cron',_0x29ef4d[_0x51e410][_0xeeb7('0x15')],_0x29ef4d[_0x51e410][_0xeeb7('0x4c')]);}}for(_0x7870b5=0x0,_0x51e410;_0x7870b5<_0x4e62f6[_0xeeb7('0x44')]&&!_0x896298;_0x7870b5+=0x1){_0x51e410=_0x4e62f6[_0x7870b5][_0xeeb7('0x42')]();if(manager[_0xeeb7('0x45')](_0x51e410)){if(_0x29ef4d[_0x51e410][_0xeeb7('0x4c')]&&_0x29ef4d[_0x51e410][_0xeeb7('0x4d')]&&moment()['isBetween'](_0x29ef4d[_0x51e410][_0xeeb7('0x4e')],_0x29ef4d[_0x51e410][_0xeeb7('0x4f')])){manager['update'](_0x51e410,_0x29ef4d[_0x51e410][_0xeeb7('0x4c')],handleJob(_0x29ef4d[_0x51e410]));logger[_0xeeb7('0x2a')](_0xeeb7('0x53'),_0x29ef4d[_0x51e410]['name'],_0x29ef4d[_0x51e410]['cron']);}else{manager[_0xeeb7('0x46')](_0x51e410);manager[_0xeeb7('0x47')](_0x51e410);logger[_0xeeb7('0x2a')]('stop\x20cron',_0x29ef4d[_0x51e410]['name'],_0x29ef4d[_0x51e410]['cron']);}}}})[_0xeeb7('0x54')](function(_0x12dd6e){logger[_0xeeb7('0x2e')](JSON[_0xeeb7('0x26')](_0x12dd6e));});}exports[_0xeeb7('0x55')]=function(_0x5511ad){return getJobs(_0x5511ad);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index deee3ab..09d2b22 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb81b=['../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20configured','Negative','COMPLETED','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach','push','all','start','lodash','request-promise','util','bluebird'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb81b,0x1be));var _0xbb81=function(_0x3a9d35,_0x1c60d6){_0x3a9d35=_0x3a9d35-0x0;var _0x2a7d47=_0xb81b[_0x3a9d35];return _0x2a7d47;};var _=require(_0xbb81('0x0'));var AWS=require('aws-sdk');var rp=require(_0xbb81('0x1'));var util=require(_0xbb81('0x2'));var BPromise=require(_0xbb81('0x3'));var db=require(_0xbb81('0x4'))['db'];var logger=require('../../config/logger')(_0xbb81('0x5'));function getTranscriptionJob(_0x27868f,_0x1ce31e,_0x9f5a23,_0x41ec2){return new Promise(function(_0x372910,_0x5e2ac6){var _0x33864d=new AWS[(_0xbb81('0x6'))]({'accessKeyId':_0x1ce31e,'secretAccessKey':_0x27868f,'region':_0x9f5a23});_0x33864d[_0xbb81('0x7')]({'TranscriptionJobName':_0x41ec2},function(_0x3236c3,_0x13bdeb){if(_0x3236c3){return _0x5e2ac6(_0x3236c3);}else{return _0x372910(_0x13bdeb);}});});}function sentiment(_0x2ee201,_0x166997,_0x2839ec,_0x256999,_0x393f7e){return new Promise(function(_0x4788c4,_0x47a6ad){var _0x5bb6a1=new AWS[(_0xbb81('0x8'))]({'accessKeyId':_0x166997,'secretAccessKey':_0x2ee201,'region':_0x2839ec});_0x5bb6a1[_0xbb81('0x9')]({'Text':_0x256999,'LanguageCode':_0x393f7e[_0xbb81('0xa')](0x0,0x2)},function(_0x57bb47,_0x34e650){if(_0x57bb47){return _0x47a6ad(_0x57bb47);}else{return _0x4788c4(_0x34e650);}});});}function checkTranscribeJob(_0x3c9a16,_0x2a2784,_0x5939f6){var _0x57dedf;return new BPromise(function(_0x5bc168,_0x1e7497){logger['info'](util[_0xbb81('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3c9a16['id'],_0x3c9a16[_0xbb81('0xc')]));return getTranscriptionJob(_0x5939f6[_0xbb81('0xd')],_0x5939f6[_0xbb81('0xe')],_0x2a2784[_0xbb81('0xf')],_0x3c9a16[_0xbb81('0xc')])[_0xbb81('0x10')](function(_0x3c55ce){logger[_0xbb81('0x11')](util[_0xbb81('0xb')](_0xbb81('0x12'),_0x3c9a16['id'],_0x3c9a16[_0xbb81('0xc')],_0x3c55ce[_0xbb81('0x13')][_0xbb81('0x14')]));if(!_0x3c9a16['fileText']){switch(_0x3c55ce['TranscriptionJob'][_0xbb81('0x14')]){case'COMPLETED':var _0x321f83={'transcribeStatus':_0x3c55ce[_0xbb81('0x13')][_0xbb81('0x14')],'fileUri':_0x3c55ce[_0xbb81('0x13')][_0xbb81('0x15')][_0xbb81('0x16')]};logger[_0xbb81('0x11')](util[_0xbb81('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x3c9a16['id']));return rp({'uri':_0x3c55ce[_0xbb81('0x13')][_0xbb81('0x15')][_0xbb81('0x16')],'json':!![]})['then'](function(_0x26bbef){logger['info'](util[_0xbb81('0xb')](_0xbb81('0x17'),_0x3c9a16['id']));if(_0x26bbef&&_0x26bbef[_0xbb81('0x18')]&&_0x26bbef[_0xbb81('0x18')][_0xbb81('0x19')]&&_0x26bbef[_0xbb81('0x18')][_0xbb81('0x19')]['length']){_0x321f83[_0xbb81('0x1a')]='';for(var _0x43feec=0x0;_0x43feec<_0x26bbef[_0xbb81('0x18')][_0xbb81('0x19')][_0xbb81('0x1b')];_0x43feec++){_0x321f83[_0xbb81('0x1a')]+=_0x26bbef[_0xbb81('0x18')][_0xbb81('0x19')][_0x43feec]['transcript']+'';}}return _0x3c9a16['update'](_0x321f83);})[_0xbb81('0x10')](function(){logger['info'](util[_0xbb81('0xb')](_0xbb81('0x1c'),_0x3c9a16['id']));if(!_0x3c9a16['tempSentiment']){throw new db['Sequelize'][(_0xbb81('0x1d'))](_0xbb81('0x1e'));}if(!_0x2a2784[_0xbb81('0x1f')]||!_0x2a2784[_0xbb81('0x20')]||!_0x2a2784[_0xbb81('0x21')]||!_0x2a2784[_0xbb81('0x22')]||!_0x2a2784[_0xbb81('0x23')]){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x321f83['fileText']){throw new Error(_0xbb81('0x25'));}if(_0x2a2784[_0xbb81('0x20')]===_0x5939f6['id']){return _0x5939f6;}else{return db['CloudProvider'][_0xbb81('0x26')]({'where':{'id':_settings[_0xbb81('0x20')]}});}})[_0xbb81('0x10')](function(_0x363e2a){if(!_0x363e2a){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))](_0xbb81('0x27'));}if(!_0x363e2a[_0xbb81('0xd')]||!_0x363e2a['data2']){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))](_0xbb81('0x28'));}_0x57dedf=_0x363e2a;logger[_0xbb81('0x11')](util[_0xbb81('0xb')](_0xbb81('0x29'),_0x3c9a16['id']));return sentiment(_0x57dedf['data1'],_0x57dedf['data2'],_0x2a2784[_0xbb81('0x21')],_0x321f83[_0xbb81('0x1a')],_0x2a2784[_0xbb81('0x22')]);})[_0xbb81('0x10')](function(_0x4836e2){logger[_0xbb81('0x11')](util['format'](_0xbb81('0x2a'),_0x3c9a16['id']));return _0x3c9a16[_0xbb81('0x2b')]({'sentiment':_0x4836e2[_0xbb81('0x2c')],'sPositive':_0x4836e2[_0xbb81('0x2d')][_0xbb81('0x2e')],'sNegative':_0x4836e2[_0xbb81('0x2d')]['Negative'],'sMixed':_0x4836e2['SentimentScore'][_0xbb81('0x2f')],'sNeutral':_0x4836e2[_0xbb81('0x2d')][_0xbb81('0x30')]});})[_0xbb81('0x10')](function(){logger['info'](util[_0xbb81('0xb')](_0xbb81('0x1c'),_0x3c9a16['id']));_0x5bc168();});case _0xbb81('0x31'):return _0x3c9a16[_0xbb81('0x2b')]({'transcribeStatus':_0xbb81('0x31'),'failureReason':_0x3c55ce[_0xbb81('0x13')][_0xbb81('0x32')]})[_0xbb81('0x10')](function(){logger[_0xbb81('0x11')](util[_0xbb81('0xb')](_0xbb81('0x1c'),_0x3c9a16['id']));_0x5bc168();});default:logger[_0xbb81('0x11')](util[_0xbb81('0xb')](_0xbb81('0x33'),_0x3c9a16['id']));break;}}else{return BPromise[_0xbb81('0x34')]()[_0xbb81('0x10')](function(){if(!_0x3c9a16[_0xbb81('0x35')]){throw new db['Sequelize'][(_0xbb81('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2a2784[_0xbb81('0x1f')]||!_0x2a2784['sentimentAccountId']||!_0x2a2784[_0xbb81('0x21')]||!_0x2a2784['language']||!_0x2a2784[_0xbb81('0x23')]){throw new db[(_0xbb81('0x24'))]['ValidationError'](_0xbb81('0x36'));}if(!_0x3c9a16[_0xbb81('0x1a')]){throw new Error('Transcript\x20not\x20available');}if(_0x2a2784[_0xbb81('0x20')]===_0x5939f6['id']){return _0x5939f6;}else{return db['CloudProvider'][_0xbb81('0x26')]({'where':{'id':_settings[_0xbb81('0x20')]}});}})[_0xbb81('0x10')](function(_0xf7b134){if(!_0xf7b134){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))](_0xbb81('0x27'));}if(!_0xf7b134[_0xbb81('0xd')]||!_0xf7b134[_0xbb81('0xe')]){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))](_0xbb81('0x28'));}_0x57dedf=_0xf7b134;logger[_0xbb81('0x11')](util['format'](_0xbb81('0x29'),_0x3c9a16['id']));return sentiment(_0x57dedf[_0xbb81('0xd')],_0x57dedf[_0xbb81('0xe')],_0x2a2784[_0xbb81('0x21')],_0x3c9a16['fileText'],_0x2a2784[_0xbb81('0x22')]);})[_0xbb81('0x10')](function(_0x51b433){logger[_0xbb81('0x11')](util[_0xbb81('0xb')](_0xbb81('0x2a'),_0x3c9a16['id']));return _0x3c9a16[_0xbb81('0x2b')]({'sentiment':_0x51b433['Sentiment'],'sPositive':_0x51b433[_0xbb81('0x2d')][_0xbb81('0x2e')],'sNegative':_0x51b433['SentimentScore'][_0xbb81('0x37')],'sMixed':_0x51b433[_0xbb81('0x2d')][_0xbb81('0x2f')],'sNeutral':_0x51b433[_0xbb81('0x2d')][_0xbb81('0x30')],'transcribeStatus':_0xbb81('0x38')});})['then'](function(){logger['info'](util[_0xbb81('0xb')](_0xbb81('0x1c'),_0x3c9a16['id']));_0x5bc168();});}})[_0xbb81('0x39')](function(_0x475674){if(_0x475674){if(!_0x475674[_0xbb81('0x3a')]||_0x475674[_0xbb81('0x3a')]!==_0xbb81('0x3b')){logger[_0xbb81('0x3c')](util[_0xbb81('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3c9a16['id']),util[_0xbb81('0x3d')](_0x475674,{'showHidden':![],'depth':null}));}}_0x5bc168();});});}function checkTranscribe(){var _0x17b5c2;var _0x15bea8;var _0x4d3119;return db[_0xbb81('0x3e')][_0xbb81('0x3f')]({'where':{'transcribeStatus':_0xbb81('0x40')}})['then'](function(_0x47d4cd){if(!_0x47d4cd||!_0x47d4cd[_0xbb81('0x1b')]){throw new db['Sequelize'][(_0xbb81('0x1d'))](_0xbb81('0x41'));}_0x17b5c2=_0x47d4cd;return db[_0xbb81('0x42')]['findOne']({'where':{'id':0x1}});})[_0xbb81('0x10')](function(_0x2229f8){if(!_0x2229f8){throw new db['Sequelize'][(_0xbb81('0x1d'))](_0xbb81('0x43'));}_0x15bea8=_0x2229f8;if(!_0x15bea8[_0xbb81('0x5')]||!_0x15bea8[_0xbb81('0x44')]||!_0x15bea8['transcribeRegion']||!_0x15bea8['language']||!_0x15bea8['bucket']){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))](_0xbb81('0x45'));}return db[_0xbb81('0x46')][_0xbb81('0x26')]({'where':{'id':_0x15bea8[_0xbb81('0x44')]}});})[_0xbb81('0x10')](function(_0x2b4a02){if(!_0x2b4a02){throw new db[(_0xbb81('0x24'))][(_0xbb81('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2b4a02[_0xbb81('0xd')]||!_0x2b4a02[_0xbb81('0xe')]){throw new db[(_0xbb81('0x24'))]['ValidationError'](_0xbb81('0x28'));}_0x4d3119=_0x2b4a02;var _0x547843=[];_0x17b5c2[_0xbb81('0x47')](function(_0x195436){_0x547843[_0xbb81('0x48')](checkTranscribeJob(_0x195436,_0x15bea8,_0x4d3119));});return BPromise[_0xbb81('0x49')](_0x547843);})[_0xbb81('0x39')](function(_0xfa294){if(_0xfa294){if(!_0xfa294[_0xbb81('0x3a')]||_0xfa294[_0xbb81('0x3a')]!==_0xbb81('0x3b')){logger[_0xbb81('0x3c')](util[_0xbb81('0x3d')](_0xfa294,{'showHidden':![],'depth':null}));}}});}exports[_0xbb81('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x0a67=['FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','bucket','Sentiment\x20Analysis\x20not\x20configured','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sequelize','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral'];(function(_0x2dc621,_0x5b333c){var _0x48f1d8=function(_0x35963f){while(--_0x35963f){_0x2dc621['push'](_0x2dc621['shift']());}};_0x48f1d8(++_0x5b333c);}(_0x0a67,0xa6));var _0x70a6=function(_0xcccdce,_0xf569f8){_0xcccdce=_0xcccdce-0x0;var _0x2c378d=_0x0a67[_0xcccdce];return _0x2c378d;};var _=require(_0x70a6('0x0'));var AWS=require(_0x70a6('0x1'));var rp=require(_0x70a6('0x2'));var util=require(_0x70a6('0x3'));var BPromise=require(_0x70a6('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x70a6('0x5'))(_0x70a6('0x6'));function getTranscriptionJob(_0x3a4af5,_0x57163e,_0x57643c,_0x3bb056){return new Promise(function(_0xf943ac,_0x2d903c){var _0x1cf721=new AWS['TranscribeService']({'accessKeyId':_0x57163e,'secretAccessKey':_0x3a4af5,'region':_0x57643c});_0x1cf721[_0x70a6('0x7')]({'TranscriptionJobName':_0x3bb056},function(_0x4215eb,_0x4f2a49){if(_0x4215eb){return _0x2d903c(_0x4215eb);}else{return _0xf943ac(_0x4f2a49);}});});}function sentiment(_0x444d26,_0x49b5f8,_0x297bfb,_0xe34e5b,_0x4e02d2){return new Promise(function(_0x3c7f19,_0xc27b3c){var _0x2ea6d4=new AWS[(_0x70a6('0x8'))]({'accessKeyId':_0x49b5f8,'secretAccessKey':_0x444d26,'region':_0x297bfb});_0x2ea6d4[_0x70a6('0x9')]({'Text':_0xe34e5b,'LanguageCode':_0x4e02d2['substring'](0x0,0x2)},function(_0x301202,_0xa31c66){if(_0x301202){return _0xc27b3c(_0x301202);}else{return _0x3c7f19(_0xa31c66);}});});}function checkTranscribeJob(_0x47b4b9,_0x3d8f1e,_0x387535){var _0x225f3e;return new BPromise(function(_0x335b7e,_0x546bde){logger[_0x70a6('0xa')](util[_0x70a6('0xb')](_0x70a6('0xc'),_0x47b4b9['id'],_0x47b4b9[_0x70a6('0xd')]));return getTranscriptionJob(_0x387535[_0x70a6('0xe')],_0x387535['data2'],_0x3d8f1e[_0x70a6('0xf')],_0x47b4b9[_0x70a6('0xd')])[_0x70a6('0x10')](function(_0x4e0eda){logger[_0x70a6('0xa')](util['format'](_0x70a6('0x11'),_0x47b4b9['id'],_0x47b4b9[_0x70a6('0xd')],_0x4e0eda['TranscriptionJob'][_0x70a6('0x12')]));if(!_0x47b4b9['fileText']){switch(_0x4e0eda[_0x70a6('0x13')][_0x70a6('0x12')]){case _0x70a6('0x14'):var _0x25e2e9={'transcribeStatus':_0x4e0eda[_0x70a6('0x13')][_0x70a6('0x12')],'fileUri':_0x4e0eda[_0x70a6('0x13')][_0x70a6('0x15')][_0x70a6('0x16')]};logger[_0x70a6('0xa')](util[_0x70a6('0xb')](_0x70a6('0x17'),_0x47b4b9['id']));return rp({'uri':_0x4e0eda[_0x70a6('0x13')][_0x70a6('0x15')][_0x70a6('0x16')],'json':!![]})[_0x70a6('0x10')](function(_0x1dee9a){logger['info'](util[_0x70a6('0xb')](_0x70a6('0x18'),_0x47b4b9['id']));if(_0x1dee9a&&_0x1dee9a[_0x70a6('0x19')]&&_0x1dee9a[_0x70a6('0x19')][_0x70a6('0x1a')]&&_0x1dee9a[_0x70a6('0x19')]['transcripts'][_0x70a6('0x1b')]){_0x25e2e9[_0x70a6('0x1c')]='';for(var _0x2ad201=0x0;_0x2ad201<_0x1dee9a[_0x70a6('0x19')][_0x70a6('0x1a')][_0x70a6('0x1b')];_0x2ad201++){_0x25e2e9[_0x70a6('0x1c')]+=_0x1dee9a[_0x70a6('0x19')][_0x70a6('0x1a')][_0x2ad201][_0x70a6('0x1d')]+'';}}return _0x47b4b9[_0x70a6('0x1e')](_0x25e2e9);})[_0x70a6('0x10')](function(){logger[_0x70a6('0xa')](util[_0x70a6('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x47b4b9['id']));if(!_0x47b4b9[_0x70a6('0x1f')]){throw new db['Sequelize'][(_0x70a6('0x20'))](_0x70a6('0x21'));}if(!_0x3d8f1e[_0x70a6('0x22')]||!_0x3d8f1e[_0x70a6('0x23')]||!_0x3d8f1e[_0x70a6('0x24')]||!_0x3d8f1e[_0x70a6('0x25')]||!_0x3d8f1e['bucket']){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x25e2e9[_0x70a6('0x1c')]){throw new Error(_0x70a6('0x27'));}if(_0x3d8f1e[_0x70a6('0x23')]===_0x387535['id']){return _0x387535;}else{return db[_0x70a6('0x28')][_0x70a6('0x29')]({'where':{'id':_settings[_0x70a6('0x23')]}});}})['then'](function(_0x4ebaaf){if(!_0x4ebaaf){throw new db[(_0x70a6('0x26'))]['ValidationError'](_0x70a6('0x2a'));}if(!_0x4ebaaf['data1']||!_0x4ebaaf[_0x70a6('0x2b')]){throw new db[(_0x70a6('0x26'))]['ValidationError'](_0x70a6('0x2c'));}_0x225f3e=_0x4ebaaf;logger[_0x70a6('0xa')](util[_0x70a6('0xb')](_0x70a6('0x2d'),_0x47b4b9['id']));return sentiment(_0x225f3e['data1'],_0x225f3e[_0x70a6('0x2b')],_0x3d8f1e[_0x70a6('0x24')],_0x25e2e9[_0x70a6('0x1c')],_0x3d8f1e[_0x70a6('0x25')]);})[_0x70a6('0x10')](function(_0x52fe87){logger['info'](util[_0x70a6('0xb')](_0x70a6('0x2e'),_0x47b4b9['id']));return _0x47b4b9['update']({'sentiment':_0x52fe87[_0x70a6('0x2f')],'sPositive':_0x52fe87['SentimentScore'][_0x70a6('0x30')],'sNegative':_0x52fe87[_0x70a6('0x31')][_0x70a6('0x32')],'sMixed':_0x52fe87[_0x70a6('0x31')][_0x70a6('0x33')],'sNeutral':_0x52fe87[_0x70a6('0x31')][_0x70a6('0x34')]});})[_0x70a6('0x10')](function(){logger[_0x70a6('0xa')](util[_0x70a6('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x47b4b9['id']));_0x335b7e();});case _0x70a6('0x35'):return _0x47b4b9['update']({'transcribeStatus':_0x70a6('0x35'),'failureReason':_0x4e0eda[_0x70a6('0x13')][_0x70a6('0x36')]})[_0x70a6('0x10')](function(){logger[_0x70a6('0xa')](util[_0x70a6('0xb')](_0x70a6('0x37'),_0x47b4b9['id']));_0x335b7e();});default:logger[_0x70a6('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x47b4b9['id']));break;}}else{return BPromise['resolve']()[_0x70a6('0x10')](function(){if(!_0x47b4b9[_0x70a6('0x1f')]){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3d8f1e[_0x70a6('0x22')]||!_0x3d8f1e[_0x70a6('0x23')]||!_0x3d8f1e[_0x70a6('0x24')]||!_0x3d8f1e[_0x70a6('0x25')]||!_0x3d8f1e[_0x70a6('0x38')]){throw new db['Sequelize'][(_0x70a6('0x20'))](_0x70a6('0x39'));}if(!_0x47b4b9[_0x70a6('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x3d8f1e[_0x70a6('0x23')]===_0x387535['id']){return _0x387535;}else{return db[_0x70a6('0x28')][_0x70a6('0x29')]({'where':{'id':_settings[_0x70a6('0x23')]}});}})['then'](function(_0x4034ec){if(!_0x4034ec){throw new db[(_0x70a6('0x26'))]['ValidationError'](_0x70a6('0x2a'));}if(!_0x4034ec[_0x70a6('0xe')]||!_0x4034ec[_0x70a6('0x2b')]){throw new db['Sequelize']['ValidationError'](_0x70a6('0x2c'));}_0x225f3e=_0x4034ec;logger[_0x70a6('0xa')](util[_0x70a6('0xb')](_0x70a6('0x2d'),_0x47b4b9['id']));return sentiment(_0x225f3e[_0x70a6('0xe')],_0x225f3e[_0x70a6('0x2b')],_0x3d8f1e[_0x70a6('0x24')],_0x47b4b9['fileText'],_0x3d8f1e[_0x70a6('0x25')]);})[_0x70a6('0x10')](function(_0x231733){logger['info'](util[_0x70a6('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x47b4b9['id']));return _0x47b4b9[_0x70a6('0x1e')]({'sentiment':_0x231733[_0x70a6('0x2f')],'sPositive':_0x231733[_0x70a6('0x31')][_0x70a6('0x30')],'sNegative':_0x231733[_0x70a6('0x31')][_0x70a6('0x32')],'sMixed':_0x231733['SentimentScore']['Mixed'],'sNeutral':_0x231733[_0x70a6('0x31')][_0x70a6('0x34')],'transcribeStatus':_0x70a6('0x14')});})[_0x70a6('0x10')](function(){logger[_0x70a6('0xa')](util['format'](_0x70a6('0x37'),_0x47b4b9['id']));_0x335b7e();});}})['catch'](function(_0x4e11e1){if(_0x4e11e1){if(!_0x4e11e1[_0x70a6('0x3a')]||_0x4e11e1[_0x70a6('0x3a')]!==_0x70a6('0x3b')){logger[_0x70a6('0x3c')](util[_0x70a6('0xb')](_0x70a6('0x3d'),_0x47b4b9['id']),util[_0x70a6('0x3e')](_0x4e11e1,{'showHidden':![],'depth':null}));}}_0x335b7e();});});}function checkTranscribe(){var _0x3af504;var _0x5c8e99;var _0x527b97;return db['VoiceRecording'][_0x70a6('0x3f')]({'where':{'transcribeStatus':_0x70a6('0x40')}})['then'](function(_0x590e45){if(!_0x590e45||!_0x590e45[_0x70a6('0x1b')]){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))]('No\x20transcribe\x20job\x20to\x20check');}_0x3af504=_0x590e45;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x70a6('0x10')](function(_0x1c0497){if(!_0x1c0497){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))](_0x70a6('0x41'));}_0x5c8e99=_0x1c0497;if(!_0x5c8e99[_0x70a6('0x6')]||!_0x5c8e99[_0x70a6('0x42')]||!_0x5c8e99[_0x70a6('0xf')]||!_0x5c8e99[_0x70a6('0x25')]||!_0x5c8e99['bucket']){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))](_0x70a6('0x43'));}return db[_0x70a6('0x28')][_0x70a6('0x29')]({'where':{'id':_0x5c8e99[_0x70a6('0x42')]}});})[_0x70a6('0x10')](function(_0x433693){if(!_0x433693){throw new db['Sequelize'][(_0x70a6('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x433693['data1']||!_0x433693[_0x70a6('0x2b')]){throw new db[(_0x70a6('0x26'))][(_0x70a6('0x20'))](_0x70a6('0x2c'));}_0x527b97=_0x433693;var _0x1061ca=[];_0x3af504[_0x70a6('0x44')](function(_0x4b8adf){_0x1061ca[_0x70a6('0x45')](checkTranscribeJob(_0x4b8adf,_0x5c8e99,_0x527b97));});return BPromise[_0x70a6('0x46')](_0x1061ca);})[_0x70a6('0x47')](function(_0x5ed9c0){if(_0x5ed9c0){if(!_0x5ed9c0[_0x70a6('0x3a')]||_0x5ed9c0['name']!==_0x70a6('0x3b')){logger['error'](util[_0x70a6('0x3e')](_0x5ed9c0,{'showHidden':![],'depth':null}));}}});}exports[_0x70a6('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7264ce9..adb1a9c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb8=['catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2'];(function(_0x698698,_0x5ebb81){var _0x3e6726=function(_0x290afe){while(--_0x290afe){_0x698698['push'](_0x698698['shift']());}};_0x3e6726(++_0x5ebb81);}(_0x1cb8,0xac));var _0x81cb=function(_0x3b47b8,_0x1ca4f3){_0x3b47b8=_0x3b47b8-0x0;var _0x5227ed=_0x1cb8[_0x3b47b8];return _0x5227ed;};'use strict';var util=require(_0x81cb('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x81cb('0x1')]({'id':i,'firstName':_0x81cb('0x2')+i,'lastName':_0x81cb('0x3')+i,'phone':0xf879fb460+i,'email':_0x81cb('0x4')+i+_0x81cb('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x81cb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x81cb('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x81cb('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x81cb('0x1')]({'id':i,'firstName':_0x81cb('0x2')+i,'lastName':_0x81cb('0x3')+i,'phone':0xf879fb460+i,'email':_0x81cb('0x4')+i+_0x81cb('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x81cb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x81cb('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x81cb('0x6')](),'updatedAt':Date[_0x81cb('0x6')]()});}db[_0x81cb('0x7')][_0x81cb('0x8')]({'where':{}})['then'](function(){return db[_0x81cb('0x7')]['bulkCreate'](contacts);})[_0x81cb('0x9')](function(){console[_0x81cb('0xa')](_0x81cb('0xb'),_0x81cb('0xc'));return db[_0x81cb('0xd')][_0x81cb('0x8')]({'where':{}});})[_0x81cb('0x9')](function(){return db[_0x81cb('0xd')][_0x81cb('0xe')](hopper);})[_0x81cb('0x9')](function(){console[_0x81cb('0xa')]('finished\x20populating',_0x81cb('0xf'));return db[_0x81cb('0x7')][_0x81cb('0xe')](contacts2);})['then'](function(){console[_0x81cb('0xa')](_0x81cb('0xb'),_0x81cb('0x10'));return db[_0x81cb('0xd')][_0x81cb('0xe')](hopper2);})[_0x81cb('0x9')](function(){console[_0x81cb('0xa')](_0x81cb('0xb'),_0x81cb('0x11'));})[_0x81cb('0x12')](function(_0x31face){console['log'](_0x31face);}); \ No newline at end of file +var _0xe202=['CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','innocenzo.biondo','now','Biondo','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','destroy'];(function(_0x2bc09e,_0x1ae747){var _0x3f7c75=function(_0x49bed4){while(--_0x49bed4){_0x2bc09e['push'](_0x2bc09e['shift']());}};_0x3f7c75(++_0x1ae747);}(_0xe202,0x149));var _0x2e20=function(_0x4a4519,_0x30f979){_0x4a4519=_0x4a4519-0x0;var _0x1e3e9a=_0xe202[_0x4a4519];return _0x1e3e9a;};'use strict';var util=require('util');var db=require(_0x2e20('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2e20('0x1')]({'id':i,'firstName':_0x2e20('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2e20('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2e20('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x2e20('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2e20('0x4')](),'updatedAt':Date[_0x2e20('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x2e20('0x2')+i,'lastName':_0x2e20('0x5')+i,'phone':0xf879fb460+i,'email':_0x2e20('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2e20('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x2e20('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x2e20('0x4')]()});}db['CmContact']['destroy']({'where':{}})[_0x2e20('0x6')](function(){return db[_0x2e20('0x7')][_0x2e20('0x8')](contacts);})[_0x2e20('0x6')](function(){console[_0x2e20('0x9')](_0x2e20('0xa'),_0x2e20('0xb'));return db['CmHopper'][_0x2e20('0xc')]({'where':{}});})[_0x2e20('0x6')](function(){return db[_0x2e20('0xd')][_0x2e20('0x8')](hopper);})[_0x2e20('0x6')](function(){console[_0x2e20('0x9')]('finished\x20populating',_0x2e20('0xe'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console['log']('finished\x20populating',_0x2e20('0xf'));return db[_0x2e20('0xd')][_0x2e20('0x8')](hopper2);})[_0x2e20('0x6')](function(){console['log'](_0x2e20('0xa'),_0x2e20('0x10'));})[_0x2e20('0x11')](function(_0x482ee6){console[_0x2e20('0x9')](_0x482ee6);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index dfe674a..bb58b86 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7b3=['password','friend','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x14e0b9,_0x3e044d){var _0x147352=function(_0x427c51){while(--_0x427c51){_0x14e0b9['push'](_0x14e0b9['shift']());}};_0x147352(++_0x3e044d);}(_0xd7b3,0x1c7));var _0x3d7b=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xd7b3[_0x145b3c];return _0x1b6e36;};'use strict';var util=require(_0x3d7b('0x0'));var db=require(_0x3d7b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3d7b('0x2')]({'name':util[_0x3d7b('0x3')](_0x3d7b('0x4'),_0x3d7b('0x5'),i),'fullname':util[_0x3d7b('0x3')](_0x3d7b('0x4'),_0x3d7b('0x5'),i),'email':util[_0x3d7b('0x3')](_0x3d7b('0x6'),'agent',i),'role':_0x3d7b('0x5'),'password':_0x3d7b('0x7'),'internal':0xfa0+i,'type':_0x3d7b('0x8'),'transport':['udp','ws',_0x3d7b('0x9')],'disallow':[_0x3d7b('0xa')],'allow':[_0x3d7b('0xb')],'defaultuser':util[_0x3d7b('0x3')](_0x3d7b('0x4'),_0x3d7b('0x5'),i),'encryption':_0x3d7b('0xc'),'avpf':_0x3d7b('0xc'),'force_avp':'yes','icesupport':_0x3d7b('0xc'),'dtlsenable':_0x3d7b('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3d7b('0xd'),'dtlssetup':_0x3d7b('0xe'),'callerid':util['format'](_0x3d7b('0xf'),util['format'](_0x3d7b('0x4'),_0x3d7b('0x5'),i),0xfa0+i)});}db[_0x3d7b('0x10')]['bulkCreate'](users)[_0x3d7b('0x11')](function(){console[_0x3d7b('0x12')](_0x3d7b('0x13'));})[_0x3d7b('0x14')](function(_0x322824){console[_0x3d7b('0x12')](_0x322824);}); \ No newline at end of file +var _0x208b=['wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','catch','log','util','push','agent','%s%s','format','%s%s@xcally.com','password','friend'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0x208b,0x14c));var _0xb208=function(_0x5ccd12,_0x556951){_0x5ccd12=_0x5ccd12-0x0;var _0x3d6732=_0x208b[_0x5ccd12];return _0x3d6732;};'use strict';var util=require(_0xb208('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb208('0x1')]({'name':util['format']('%s%s',_0xb208('0x2'),i),'fullname':util['format'](_0xb208('0x3'),_0xb208('0x2'),i),'email':util[_0xb208('0x4')](_0xb208('0x5'),_0xb208('0x2'),i),'role':_0xb208('0x2'),'password':_0xb208('0x6'),'internal':0xfa0+i,'type':_0xb208('0x7'),'transport':['udp','ws',_0xb208('0x8')],'disallow':[_0xb208('0x9')],'allow':[_0xb208('0xa')],'defaultuser':util[_0xb208('0x4')](_0xb208('0x3'),_0xb208('0x2'),i),'encryption':'yes','avpf':_0xb208('0xb'),'force_avp':_0xb208('0xb'),'icesupport':_0xb208('0xb'),'dtlsenable':_0xb208('0xb'),'dtlsverify':'no','dtlscertfile':_0xb208('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xb208('0xd'),'callerid':util[_0xb208('0x4')]('\x22%s\x22\x20<%s>',util[_0xb208('0x4')](_0xb208('0x3'),'agent',i),0xfa0+i)});}db[_0xb208('0xe')]['bulkCreate'](users)['then'](function(){console['log']('add\x20user');})[_0xb208('0xf')](function(_0x117a75){console[_0xb208('0x10')](_0x117a75);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 386ae3f..2a79445 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48bd=['length','format','user:%s','query','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','Trunk','User','user','ChatQueues','FaxQueue','MailQueue','OpenchannelQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','FaxInteractions','SmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','where','Campaign','%s:queue:%s'];(function(_0x521d4c,_0x2eb55e){var _0x138487=function(_0x1a0f60){while(--_0x1a0f60){_0x521d4c['push'](_0x521d4c['shift']());}};_0x138487(++_0x2eb55e);}(_0x48bd,0xfd));var _0xd48b=function(_0xe4ecfe,_0x325e02){_0xe4ecfe=_0xe4ecfe-0x0;var _0x251a95=_0x48bd[_0xe4ecfe];return _0x251a95;};'use strict';var _=require(_0xd48b('0x0'));var util=require('util');var BPromise=require(_0xd48b('0x1'));var db=require(_0xd48b('0x2'))['db'];var config=require(_0xd48b('0x3'));var queryQueues={'attributes':['id',_0xd48b('0x4')],'include':[{'as':_0xd48b('0x5'),'model':db['User'],'attributes':['id',_0xd48b('0x4'),_0xd48b('0x6')],'raw':!![],'where':{'role':_0xd48b('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd48b('0x4')],'where':{'role':_0xd48b('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd48b('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xd48b('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xd48b('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x277d85,_0x30755c,_0x2c6216){return db['UserProfileSection'][_0xd48b('0xa')]({'where':{'name':_0x277d85,'userProfileId':_0x30755c},'raw':!![]})[_0xd48b('0xb')](function(_0x64af3f){if(_0x64af3f){if(_0x64af3f[_0xd48b('0xc')]){switch(_0x277d85){case _0xd48b('0xd'):case'ChatQueues':case _0xd48b('0xe'):case _0xd48b('0xf'):case'MailQueues':case _0xd48b('0x10'):case'WhatsappQueues':return db[_0x2c6216][_0xd48b('0x11')](queryQueues);case _0xd48b('0x12'):return db[_0x2c6216][_0xd48b('0x11')](queryTelephones);case _0xd48b('0x13'):return db[_0x2c6216][_0xd48b('0x11')](queryTrunks);case _0xd48b('0x14'):return db[_0x2c6216]['findAll'](queryCampaigns);}}else{return db[_0xd48b('0x15')][_0xd48b('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x64af3f['id']},'raw':!![]})[_0xd48b('0xb')](function(_0x14e2e5){if(_0x14e2e5){var _0x48810b={'where':{'id':_[_0xd48b('0x16')](_0x14e2e5,'resourceId')},'raw':!![]};switch(_0x2c6216){case'User':_0x48810b[_0xd48b('0x17')]['role']=_0xd48b('0x8');break;case _0xd48b('0x18'):_0x48810b[_0xd48b('0x17')][_0xd48b('0x9')]='ivr';break;}return db[_0x2c6216]['findAll'](_0x48810b);}else{return[];}});}}else{return[];}})['then'](function(_0x5bc18b){return _0x5bc18b;});}function joinOrLeaveQueues(_0x5e3862,_0x574724,_0x5afd88,_0x959b30){_0x5e3862[_0x574724](util['format'](_0xd48b('0x19'),_0x5afd88,_0x959b30['name']));if(_0x959b30['Agents']){for(var _0x573e98=0x0;_0x573e98<_0x959b30[_0xd48b('0x5')][_0xd48b('0x1a')];_0x573e98+=0x1){_0x5e3862[_0x574724](util[_0xd48b('0x1b')](_0xd48b('0x1c'),_0x959b30['Agents'][_0x573e98][_0xd48b('0x4')]));}}}function joinOrLeave(_0x5d8874,_0x20db91,_0x4451db){var _0x87776;if(_0x5d8874['handshake'][_0xd48b('0x1d')]['id']){db['User']['find']({'attributes':['id',_0xd48b('0x4'),_0xd48b('0x6'),_0xd48b('0x1e')],'where':{'id':_0x5d8874[_0xd48b('0x1f')][_0xd48b('0x1d')]['id']},'include':[{'model':db[_0xd48b('0x20')],'as':_0xd48b('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xd48b('0x22')],'as':_0xd48b('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xd48b('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd48b('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd48b('0x26')],'as':_0xd48b('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xd48b('0x28')],'as':_0xd48b('0x29'),'attributes':['id'],'raw':!![]}]})[_0xd48b('0xb')](function(_0x72b78b){if(_0x72b78b){_0x87776=_0x72b78b;_0x5d8874[_0x20db91](util['format'](_0xd48b('0x1c'),_0x72b78b[_0xd48b('0x4')]));var _0x5174d0=[];switch(_0x72b78b['role']){case _0xd48b('0x2a'):_0x5d8874[_0x20db91](_0xd48b('0x2b'));_0x5d8874[_0x20db91](_0xd48b('0x2c'));if(queryQueues[_0xd48b('0x2d')]('include')){delete queryQueues[_0xd48b('0x2e')];}_0x5174d0['push'](db['VoiceQueue'][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db[_0xd48b('0x30')][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db['FaxQueue'][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db[_0xd48b('0x31')][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db['MailQueue'][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db['OpenchannelQueue']['findAll'](queryQueues));_0x5174d0[_0xd48b('0x2f')](db['WhatsappQueue'][_0xd48b('0x11')](queryQueues));_0x5174d0[_0xd48b('0x2f')](db['User'][_0xd48b('0x11')](queryTelephones));_0x5174d0[_0xd48b('0x2f')](db[_0xd48b('0x32')][_0xd48b('0x11')](queryTrunks));_0x5174d0['push'](db['Campaign'][_0xd48b('0x11')](queryCampaigns));_0x5174d0[_0xd48b('0x2f')](db[_0xd48b('0x33')][_0xd48b('0x11')](queryAgents));break;case _0xd48b('0x34'):_0x5d8874[_0x20db91](_0xd48b('0x2b'));_0x5d8874[_0x20db91]('voice:outbound');_0x5174d0[_0xd48b('0x2f')](getAssociatedResources(_0xd48b('0xd'),_0x72b78b[_0xd48b('0x1e')],'VoiceQueue'));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources(_0xd48b('0x35'),_0x72b78b[_0xd48b('0x1e')],_0xd48b('0x30')));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources(_0xd48b('0xe'),_0x72b78b[_0xd48b('0x1e')],_0xd48b('0x36')));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources(_0xd48b('0xf'),_0x72b78b['userProfileId'],_0xd48b('0x31')));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources('MailQueues',_0x72b78b[_0xd48b('0x1e')],_0xd48b('0x37')));_0x5174d0['push'](getAssociatedResources(_0xd48b('0x10'),_0x72b78b['userProfileId'],_0xd48b('0x38')));_0x5174d0['push'](getAssociatedResources('WhatsappQueues',_0x72b78b['userProfileId'],'WhatsappQueue'));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources(_0xd48b('0x12'),_0x72b78b[_0xd48b('0x1e')],_0xd48b('0x33')));_0x5174d0['push'](getAssociatedResources('Trunks',_0x72b78b['userProfileId'],'Trunk'));_0x5174d0[_0xd48b('0x2f')](getAssociatedResources('IvrCampaigns',_0x72b78b[_0xd48b('0x1e')],_0xd48b('0x18')));_0x5174d0[_0xd48b('0x2f')](db[_0xd48b('0x33')]['findAll'](queryAgents));break;case _0xd48b('0x7'):_0x5d8874[_0x20db91](_0xd48b('0x2b'));_0x5d8874[_0x20db91]('voice:outbound');_0x5174d0[_0xd48b('0x2f')](_0x72b78b[_0xd48b('0x39')]({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0[_0xd48b('0x2f')](_0x72b78b[_0xd48b('0x3a')]({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0[_0xd48b('0x2f')](_0x72b78b[_0xd48b('0x3b')]({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0[_0xd48b('0x2f')](_0x72b78b[_0xd48b('0x3c')]({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0['push'](_0x72b78b[_0xd48b('0x3d')]({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0['push'](_0x72b78b['getOpenchannelQueues']({'attributes':['id',_0xd48b('0x4')]}));_0x5174d0[_0xd48b('0x2f')](_0x72b78b[_0xd48b('0x3e')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x5174d0);}})[_0xd48b('0xb')](function(_0x38663b){if(_0x38663b&&_0x38663b[_0xd48b('0x1a')]){for(var _0x26dc76=0x0;_0x26dc76<_0x38663b[_0xd48b('0x1a')];_0x26dc76+=0x1){for(var _0x3c4f6d=0x0;_0x3c4f6d<_0x38663b[_0x26dc76]['length'];_0x3c4f6d+=0x1){switch(_0x26dc76){case 0x0:joinOrLeaveQueues(_0x5d8874,_0x20db91,_0xd48b('0x3f'),_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x1:joinOrLeaveQueues(_0x5d8874,_0x20db91,'chat',_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x2:joinOrLeaveQueues(_0x5d8874,_0x20db91,_0xd48b('0x40'),_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x3:joinOrLeaveQueues(_0x5d8874,_0x20db91,_0xd48b('0x41'),_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x4:joinOrLeaveQueues(_0x5d8874,_0x20db91,'mail',_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x5:joinOrLeaveQueues(_0x5d8874,_0x20db91,_0xd48b('0x42'),_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x6:joinOrLeaveQueues(_0x5d8874,_0x20db91,_0xd48b('0x43'),_0x38663b[_0x26dc76][_0x3c4f6d]);break;case 0x7:_0x5d8874[_0x20db91](util[_0xd48b('0x1b')](_0xd48b('0x44'),_0x38663b[_0x26dc76][_0x3c4f6d][_0xd48b('0x4')]));break;case 0x8:_0x5d8874[_0x20db91](util[_0xd48b('0x1b')](_0xd48b('0x45'),_0x38663b[_0x26dc76][_0x3c4f6d][_0xd48b('0x4')]));break;case 0x9:_0x5d8874[_0x20db91](util[_0xd48b('0x1b')]('campaign:%s:%s',_0x38663b[_0x26dc76][_0x3c4f6d][_0xd48b('0x9')],_0x38663b[_0x26dc76][_0x3c4f6d][_0xd48b('0x4')]));break;case 0xa:_0x5d8874[_0x20db91](util[_0xd48b('0x1b')](_0xd48b('0x1c'),_0x38663b[_0x26dc76][_0x3c4f6d][_0xd48b('0x4')]));break;}}}}})['then'](function(){if(_0x20db91===_0xd48b('0x46')){var _0x386d2d=_[_0xd48b('0x16')](_0x87776[_0xd48b('0x21')],'id');return _0x87776[_0xd48b('0x47')](_0x386d2d)[_0xd48b('0xb')](function(){for(var _0xb07912=0x0;_0xb07912<_0x386d2d['length'];_0xb07912+=0x1){_0x4451db[_0xd48b('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x386d2d[_0xb07912]),'UserId':Number(_0x87776['id'])});}});}})[_0xd48b('0xb')](function(){if(_0x20db91===_0xd48b('0x46')){var _0x494d23=_[_0xd48b('0x16')](_0x87776[_0xd48b('0x23')],'id');return _0x87776[_0xd48b('0x49')](_0x494d23)['then'](function(){for(var _0x565c56=0x0;_0x565c56<_0x494d23[_0xd48b('0x1a')];_0x565c56+=0x1){_0x4451db[_0xd48b('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x494d23[_0x565c56]),'UserId':Number(_0x87776['id'])});}});}})[_0xd48b('0xb')](function(){if(_0x20db91==='leave'){var _0x3dcab3=_[_0xd48b('0x16')](_0x87776[_0xd48b('0x4a')],'id');return _0x87776['removeFaxInteractions'](_0x3dcab3)[_0xd48b('0xb')](function(){for(var _0x2a4f79=0x0;_0x2a4f79<_0x3dcab3[_0xd48b('0x1a')];_0x2a4f79+=0x1){_0x4451db['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3dcab3[_0x2a4f79]),'UserId':Number(_0x87776['id'])});}});}})[_0xd48b('0xb')](function(){if(_0x20db91==='leave'){var _0x3c218c=_['map'](_0x87776[_0xd48b('0x4b')],'id');return _0x87776['removeSmsInteractions'](_0x3c218c)[_0xd48b('0xb')](function(){for(var _0x154f59=0x0;_0x154f59<_0x3c218c[_0xd48b('0x1a')];_0x154f59+=0x1){_0x4451db[_0xd48b('0x48')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x3c218c[_0x154f59]),'UserId':Number(_0x87776['id'])});}});}})['then'](function(){if(_0x20db91==='leave'){var _0x247650=_[_0xd48b('0x16')](_0x87776[_0xd48b('0x27')],'id');return _0x87776[_0xd48b('0x4c')](_0x247650)[_0xd48b('0xb')](function(){for(var _0xf67ffe=0x0;_0xf67ffe<_0x247650[_0xd48b('0x1a')];_0xf67ffe+=0x1){_0x4451db[_0xd48b('0x48')](_0xd48b('0x4d'),{'OpenchannelInteractionId':Number(_0x247650[_0xf67ffe]),'UserId':Number(_0x87776['id'])});}});}})[_0xd48b('0xb')](function(){if(_0x20db91===_0xd48b('0x46')){var _0x192cce=_['map'](_0x87776['WhatsappInteractions'],'id');return _0x87776[_0xd48b('0x4e')](_0x192cce)[_0xd48b('0xb')](function(){for(var _0x5b6431=0x0;_0x5b6431<_0x192cce[_0xd48b('0x1a')];_0x5b6431+=0x1){_0x4451db[_0xd48b('0x48')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x192cce[_0x5b6431]),'UserId':Number(_0x87776['id'])});}});}})[_0xd48b('0x4f')](function(_0x2a230e){_0x5d8874[_0xd48b('0x50')](_0x2a230e);});}}function onDisconnect(_0x1c3a4e,_0x11a568){joinOrLeave(_0x1c3a4e,'leave',_0x11a568);}function onConnect(_0x442fec){joinOrLeave(_0x442fec,'join');}exports[_0xd48b('0x51')]=function(_0x3297d9){_0x3297d9['on'](_0xd48b('0x52'),function(_0x488dc6){_0x488dc6[_0xd48b('0x53')](0x0);_0x488dc6[_0xd48b('0x54')]=_0x488dc6[_0xd48b('0x55')][_0xd48b('0x52')][_0xd48b('0x56')]+':'+_0x488dc6[_0xd48b('0x55')][_0xd48b('0x52')][_0xd48b('0x57')];_0x488dc6[_0xd48b('0x58')]=new Date();_0x488dc6['log']=function(_0x5dce1d){console[_0xd48b('0x50')](_0xd48b('0x59')+_0x488dc6['nsp'][_0xd48b('0x4')]+'['+_0x488dc6[_0xd48b('0x54')]+']',_0x5dce1d);};_0x488dc6['on'](_0xd48b('0x5a'),function(){onDisconnect(_0x488dc6,_0x3297d9);_0x488dc6[_0xd48b('0x50')](_0xd48b('0x5b'));});onConnect(_0x488dc6);_0x488dc6[_0xd48b('0x50')](_0xd48b('0x5c'));});}; \ No newline at end of file +var _0x7a37=['removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','role','agent','name','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','map','User','Campaign','where','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','voice:outbound','MailQueues','OpenchannelQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','sms','openchannel','whatsapp','telephone:%s','campaign:%s:%s'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x7a37,0xdf));var _0x77a3=function(_0x188c8,_0x575060){_0x188c8=_0x188c8-0x0;var _0x565ea7=_0x7a37[_0x188c8];return _0x565ea7;};'use strict';var _=require(_0x77a3('0x0'));var util=require(_0x77a3('0x1'));var BPromise=require(_0x77a3('0x2'));var db=require(_0x77a3('0x3'))['db'];var config=require(_0x77a3('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x77a3('0x5'),'model':db['User'],'attributes':['id','name',_0x77a3('0x6')],'raw':!![],'where':{'role':_0x77a3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x77a3('0x8')],'where':{'role':_0x77a3('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x77a3('0x8')]};var queryAgents={'raw':!![],'attributes':['id',_0x77a3('0x8')],'where':{'role':_0x77a3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x77a3('0x8'),_0x77a3('0xa')],'where':{'type':_0x77a3('0xb')}};function getAssociatedResources(_0x17eeb2,_0xb05133,_0x3484c8){return db[_0x77a3('0xc')][_0x77a3('0xd')]({'where':{'name':_0x17eeb2,'userProfileId':_0xb05133},'raw':!![]})[_0x77a3('0xe')](function(_0x28797e){if(_0x28797e){if(_0x28797e[_0x77a3('0xf')]){switch(_0x17eeb2){case _0x77a3('0x10'):case _0x77a3('0x11'):case _0x77a3('0x12'):case'SmsQueues':case'MailQueues':case'OpenchannelQueues':case _0x77a3('0x13'):return db[_0x3484c8][_0x77a3('0x14')](queryQueues);case'Telephones':return db[_0x3484c8][_0x77a3('0x14')](queryTelephones);case'Trunks':return db[_0x3484c8][_0x77a3('0x14')](queryTrunks);case _0x77a3('0x15'):return db[_0x3484c8][_0x77a3('0x14')](queryCampaigns);}}else{return db[_0x77a3('0x16')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x28797e['id']},'raw':!![]})[_0x77a3('0xe')](function(_0x4413b5){if(_0x4413b5){var _0x1e3092={'where':{'id':_[_0x77a3('0x17')](_0x4413b5,'resourceId')},'raw':!![]};switch(_0x3484c8){case _0x77a3('0x18'):_0x1e3092['where'][_0x77a3('0x6')]=_0x77a3('0x9');break;case _0x77a3('0x19'):_0x1e3092[_0x77a3('0x1a')][_0x77a3('0xa')]=_0x77a3('0xb');break;}return db[_0x3484c8]['findAll'](_0x1e3092);}else{return[];}});}}else{return[];}})['then'](function(_0x5bc0f1){return _0x5bc0f1;});}function joinOrLeaveQueues(_0x302387,_0x4964a8,_0x1cc107,_0x4e92ea){_0x302387[_0x4964a8](util[_0x77a3('0x1b')](_0x77a3('0x1c'),_0x1cc107,_0x4e92ea[_0x77a3('0x8')]));if(_0x4e92ea[_0x77a3('0x5')]){for(var _0x71a4f=0x0;_0x71a4f<_0x4e92ea[_0x77a3('0x5')]['length'];_0x71a4f+=0x1){_0x302387[_0x4964a8](util['format'](_0x77a3('0x1d'),_0x4e92ea[_0x77a3('0x5')][_0x71a4f][_0x77a3('0x8')]));}}}function joinOrLeave(_0x18c4a6,_0x50d69e,_0x1d72c9){var _0x35ff7f;if(_0x18c4a6[_0x77a3('0x1e')]['query']['id']){db[_0x77a3('0x18')][_0x77a3('0x1f')]({'attributes':['id',_0x77a3('0x8'),_0x77a3('0x6'),_0x77a3('0x20')],'where':{'id':_0x18c4a6[_0x77a3('0x1e')][_0x77a3('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x77a3('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x77a3('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x77a3('0x24')],'as':_0x77a3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x77a3('0x26')],'as':_0x77a3('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x77a3('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x77a3('0x29')],'as':_0x77a3('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x77a3('0xe')](function(_0x16682c){if(_0x16682c){_0x35ff7f=_0x16682c;_0x18c4a6[_0x50d69e](util[_0x77a3('0x1b')](_0x77a3('0x1d'),_0x16682c[_0x77a3('0x8')]));var _0xc9451f=[];switch(_0x16682c['role']){case _0x77a3('0x2b'):_0x18c4a6[_0x50d69e](_0x77a3('0x2c'));_0x18c4a6[_0x50d69e]('voice:outbound');if(queryQueues[_0x77a3('0x2d')]('include')){delete queryQueues[_0x77a3('0x2e')];}_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x30')]['findAll'](queryQueues));_0xc9451f['push'](db[_0x77a3('0x31')]['findAll'](queryQueues));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x32')]['findAll'](queryQueues));_0xc9451f['push'](db[_0x77a3('0x33')][_0x77a3('0x14')](queryQueues));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x34')]['findAll'](queryQueues));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x35')]['findAll'](queryQueues));_0xc9451f[_0x77a3('0x2f')](db['WhatsappQueue'][_0x77a3('0x14')](queryQueues));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x18')][_0x77a3('0x14')](queryTelephones));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x36')][_0x77a3('0x14')](queryTrunks));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x19')]['findAll'](queryCampaigns));_0xc9451f['push'](db[_0x77a3('0x18')][_0x77a3('0x14')](queryAgents));break;case'user':_0x18c4a6[_0x50d69e](_0x77a3('0x2c'));_0x18c4a6[_0x50d69e](_0x77a3('0x37'));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources(_0x77a3('0x10'),_0x16682c[_0x77a3('0x20')],_0x77a3('0x30')));_0xc9451f['push'](getAssociatedResources('ChatQueues',_0x16682c[_0x77a3('0x20')],'ChatQueue'));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('FaxQueues',_0x16682c['userProfileId'],_0x77a3('0x32')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('SmsQueues',_0x16682c[_0x77a3('0x20')],'SmsQueue'));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources(_0x77a3('0x38'),_0x16682c['userProfileId'],_0x77a3('0x34')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources(_0x77a3('0x39'),_0x16682c[_0x77a3('0x20')],_0x77a3('0x35')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('WhatsappQueues',_0x16682c[_0x77a3('0x20')],_0x77a3('0x3a')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('Telephones',_0x16682c['userProfileId'],_0x77a3('0x18')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('Trunks',_0x16682c[_0x77a3('0x20')],_0x77a3('0x36')));_0xc9451f[_0x77a3('0x2f')](getAssociatedResources('IvrCampaigns',_0x16682c[_0x77a3('0x20')],_0x77a3('0x19')));_0xc9451f[_0x77a3('0x2f')](db[_0x77a3('0x18')][_0x77a3('0x14')](queryAgents));break;case _0x77a3('0x7'):_0x18c4a6[_0x50d69e]('voice:inbound');_0x18c4a6[_0x50d69e](_0x77a3('0x37'));_0xc9451f[_0x77a3('0x2f')](_0x16682c[_0x77a3('0x3b')]({'attributes':['id',_0x77a3('0x8')]}));_0xc9451f[_0x77a3('0x2f')](_0x16682c[_0x77a3('0x3c')]({'attributes':['id',_0x77a3('0x8')]}));_0xc9451f[_0x77a3('0x2f')](_0x16682c[_0x77a3('0x3d')]({'attributes':['id',_0x77a3('0x8')]}));_0xc9451f['push'](_0x16682c[_0x77a3('0x3e')]({'attributes':['id','name']}));_0xc9451f['push'](_0x16682c['getMailQueues']({'attributes':['id',_0x77a3('0x8')]}));_0xc9451f[_0x77a3('0x2f')](_0x16682c[_0x77a3('0x3f')]({'attributes':['id',_0x77a3('0x8')]}));_0xc9451f[_0x77a3('0x2f')](_0x16682c[_0x77a3('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0x77a3('0x41')](_0xc9451f);}})['then'](function(_0x325e89){if(_0x325e89&&_0x325e89[_0x77a3('0x42')]){for(var _0x4610af=0x0;_0x4610af<_0x325e89['length'];_0x4610af+=0x1){for(var _0x4edab4=0x0;_0x4edab4<_0x325e89[_0x4610af][_0x77a3('0x42')];_0x4edab4+=0x1){switch(_0x4610af){case 0x0:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,_0x77a3('0x43'),_0x325e89[_0x4610af][_0x4edab4]);break;case 0x1:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,_0x77a3('0x44'),_0x325e89[_0x4610af][_0x4edab4]);break;case 0x2:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,'fax',_0x325e89[_0x4610af][_0x4edab4]);break;case 0x3:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,_0x77a3('0x45'),_0x325e89[_0x4610af][_0x4edab4]);break;case 0x4:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,'mail',_0x325e89[_0x4610af][_0x4edab4]);break;case 0x5:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,_0x77a3('0x46'),_0x325e89[_0x4610af][_0x4edab4]);break;case 0x6:joinOrLeaveQueues(_0x18c4a6,_0x50d69e,_0x77a3('0x47'),_0x325e89[_0x4610af][_0x4edab4]);break;case 0x7:_0x18c4a6[_0x50d69e](util[_0x77a3('0x1b')](_0x77a3('0x48'),_0x325e89[_0x4610af][_0x4edab4][_0x77a3('0x8')]));break;case 0x8:_0x18c4a6[_0x50d69e](util[_0x77a3('0x1b')]('trunk:%s',_0x325e89[_0x4610af][_0x4edab4]['name']));break;case 0x9:_0x18c4a6[_0x50d69e](util[_0x77a3('0x1b')](_0x77a3('0x49'),_0x325e89[_0x4610af][_0x4edab4][_0x77a3('0xa')],_0x325e89[_0x4610af][_0x4edab4][_0x77a3('0x8')]));break;case 0xa:_0x18c4a6[_0x50d69e](util['format'](_0x77a3('0x1d'),_0x325e89[_0x4610af][_0x4edab4][_0x77a3('0x8')]));break;}}}}})[_0x77a3('0xe')](function(){if(_0x50d69e==='leave'){var _0x28118a=_['map'](_0x35ff7f[_0x77a3('0x22')],'id');return _0x35ff7f[_0x77a3('0x4a')](_0x28118a)[_0x77a3('0xe')](function(){for(var _0x3a4f47=0x0;_0x3a4f47<_0x28118a['length'];_0x3a4f47+=0x1){_0x1d72c9[_0x77a3('0x4b')](_0x77a3('0x4c'),{'ChatInteractionId':Number(_0x28118a[_0x3a4f47]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0xe')](function(){if(_0x50d69e===_0x77a3('0x4d')){var _0x5026e7=_[_0x77a3('0x17')](_0x35ff7f[_0x77a3('0x4e')],'id');return _0x35ff7f[_0x77a3('0x4f')](_0x5026e7)[_0x77a3('0xe')](function(){for(var _0x300683=0x0;_0x300683<_0x5026e7['length'];_0x300683+=0x1){_0x1d72c9[_0x77a3('0x4b')](_0x77a3('0x50'),{'MailInteractionId':Number(_0x5026e7[_0x300683]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0xe')](function(){if(_0x50d69e===_0x77a3('0x4d')){var _0x2fd6a5=_[_0x77a3('0x17')](_0x35ff7f[_0x77a3('0x25')],'id');return _0x35ff7f['removeFaxInteractions'](_0x2fd6a5)[_0x77a3('0xe')](function(){for(var _0x4f945f=0x0;_0x4f945f<_0x2fd6a5[_0x77a3('0x42')];_0x4f945f+=0x1){_0x1d72c9['emit'](_0x77a3('0x51'),{'FaxInteractionId':Number(_0x2fd6a5[_0x4f945f]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0xe')](function(){if(_0x50d69e===_0x77a3('0x4d')){var _0x191cd8=_[_0x77a3('0x17')](_0x35ff7f[_0x77a3('0x27')],'id');return _0x35ff7f[_0x77a3('0x52')](_0x191cd8)[_0x77a3('0xe')](function(){for(var _0x9bcad1=0x0;_0x9bcad1<_0x191cd8['length'];_0x9bcad1+=0x1){_0x1d72c9[_0x77a3('0x4b')](_0x77a3('0x53'),{'SmsInteractionId':Number(_0x191cd8[_0x9bcad1]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0xe')](function(){if(_0x50d69e===_0x77a3('0x4d')){var _0x5183e8=_[_0x77a3('0x17')](_0x35ff7f[_0x77a3('0x28')],'id');return _0x35ff7f[_0x77a3('0x54')](_0x5183e8)[_0x77a3('0xe')](function(){for(var _0x27434b=0x0;_0x27434b<_0x5183e8['length'];_0x27434b+=0x1){_0x1d72c9[_0x77a3('0x4b')](_0x77a3('0x55'),{'OpenchannelInteractionId':Number(_0x5183e8[_0x27434b]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0xe')](function(){if(_0x50d69e===_0x77a3('0x4d')){var _0x113ff8=_[_0x77a3('0x17')](_0x35ff7f['WhatsappInteractions'],'id');return _0x35ff7f[_0x77a3('0x56')](_0x113ff8)[_0x77a3('0xe')](function(){for(var _0x38621f=0x0;_0x38621f<_0x113ff8['length'];_0x38621f+=0x1){_0x1d72c9[_0x77a3('0x4b')](_0x77a3('0x57'),{'WhatsappInteractionId':Number(_0x113ff8[_0x38621f]),'UserId':Number(_0x35ff7f['id'])});}});}})[_0x77a3('0x58')](function(_0x981355){_0x18c4a6[_0x77a3('0x59')](_0x981355);});}}function onDisconnect(_0x6a68c0,_0x1555a5){joinOrLeave(_0x6a68c0,_0x77a3('0x4d'),_0x1555a5);}function onConnect(_0x12684a){joinOrLeave(_0x12684a,_0x77a3('0x5a'));}exports['default']=function(_0x563a92){_0x563a92['on'](_0x77a3('0x5b'),function(_0x18e7fb){_0x18e7fb[_0x77a3('0x5c')](0x0);_0x18e7fb[_0x77a3('0x5d')]=_0x18e7fb[_0x77a3('0x5e')][_0x77a3('0x5b')]['remoteAddress']+':'+_0x18e7fb['request'][_0x77a3('0x5b')]['remotePort'];_0x18e7fb['connectedAt']=new Date();_0x18e7fb[_0x77a3('0x59')]=function(_0x6feaf9){console[_0x77a3('0x59')](_0x77a3('0x5f')+_0x18e7fb[_0x77a3('0x60')][_0x77a3('0x8')]+'['+_0x18e7fb[_0x77a3('0x5d')]+']',_0x6feaf9);};_0x18e7fb['on'](_0x77a3('0x61'),function(){onDisconnect(_0x18e7fb,_0x563a92);_0x18e7fb['log']('DISCONNECTED');});onConnect(_0x18e7fb);_0x18e7fb['log'](_0x77a3('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 37bb735..bfc8c2c 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 _0x7f13=['SmsInteraction','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','EventManager','then','info','Trigger,\x20%s','error','code','get','channel','event','direction','UserId','User','find','name','interface','format','SIP/%s','catch','opened','closed','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','newinteraction','closedinteraction','ChatMessage','afterCreate','newmessage'];(function(_0x229a7c,_0x51480b){var _0x5a4114=function(_0xc18df4){while(--_0xc18df4){_0x229a7c['push'](_0x229a7c['shift']());}};_0x5a4114(++_0x51480b);}(_0x7f13,0xfc));var _0x37f1=function(_0x50408f,_0x92ffac){_0x50408f=_0x50408f-0x0;var _0xb02957=_0x7f13[_0x50408f];return _0xb02957;};'use strict';var util=require(_0x37f1('0x0'));var db=require(_0x37f1('0x1'))['db'];var jayson=require(_0x37f1('0x2'));var logger=require(_0x37f1('0x3'))('triggers');var client=jayson[_0x37f1('0x4')][_0x37f1('0x5')]({'port':0x232a});var triggers=[{'channel':_0x37f1('0x6'),'model':_0x37f1('0x7'),'event':'afterCreate','condition':_0x37f1('0x8'),'callback':afterCreate},{'channel':_0x37f1('0x6'),'model':_0x37f1('0x7'),'event':'afterUpdate','condition':_0x37f1('0x9'),'callback':afterUpdate},{'channel':_0x37f1('0x6'),'model':_0x37f1('0xa'),'event':_0x37f1('0xb'),'condition':_0x37f1('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x37f1('0xd'),'event':_0x37f1('0xb'),'condition':_0x37f1('0x8'),'callback':afterCreate},{'channel':_0x37f1('0xe'),'model':_0x37f1('0xd'),'event':_0x37f1('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x37f1('0x10'),'event':_0x37f1('0xb'),'condition':_0x37f1('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x37f1('0xb'),'condition':_0x37f1('0x8'),'callback':afterCreate},{'channel':_0x37f1('0x11'),'model':_0x37f1('0x12'),'event':_0x37f1('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x37f1('0x11'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x37f1('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x37f1('0xb'),'condition':_0x37f1('0x8'),'callback':afterCreate},{'channel':_0x37f1('0x13'),'model':'FaxInteraction','event':_0x37f1('0xf'),'condition':_0x37f1('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0x37f1('0x14'),'event':_0x37f1('0xb'),'condition':_0x37f1('0xc'),'callback':afterCreateMessage},{'channel':_0x37f1('0x15'),'model':_0x37f1('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0x37f1('0x16'),'event':_0x37f1('0xf'),'condition':_0x37f1('0x9'),'callback':afterUpdate},{'channel':_0x37f1('0x15'),'model':_0x37f1('0x17'),'event':_0x37f1('0xb'),'condition':_0x37f1('0xc'),'callback':afterCreateMessage},{'channel':_0x37f1('0x18'),'model':'OpenchannelInteraction','event':_0x37f1('0xb'),'condition':_0x37f1('0x8'),'callback':afterCreate},{'channel':_0x37f1('0x18'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x37f1('0x9'),'callback':afterUpdate},{'channel':_0x37f1('0x18'),'model':'OpenchannelMessage','event':_0x37f1('0xb'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3db47c){return client['request'](_0x37f1('0x19'),_0x3db47c)[_0x37f1('0x1a')](function(_0x39a815){logger[_0x37f1('0x1b')](_0x37f1('0x1c'),_0x37f1('0x19'),_0x39a815);if(_0x39a815[_0x37f1('0x1d')]){if(_0x39a815[_0x37f1('0x1d')][_0x37f1('0x1e')]===0x1f4){logger[_0x37f1('0x1d')](_0x37f1('0x1c'),_0x37f1('0x19'),_0x39a815[_0x37f1('0x1d')]);}}})['catch'](function(_0x53ed63){logger[_0x37f1('0x1d')](_0x37f1('0x1c'),_0x37f1('0x19'),_0x53ed63);});}function afterCreateMessage(_0x106b90,_0x3ed783){return function(_0x33364c,_0x400072){_0x33364c=_0x33364c[_0x37f1('0x1f')]({'plain':!![]});_0x33364c[_0x37f1('0x20')]=_0x106b90;_0x33364c[_0x37f1('0x21')]=_0x33364c[_0x37f1('0x22')];if(_0x33364c[_0x37f1('0x23')]){return db[_0x37f1('0x24')][_0x37f1('0x25')]({'where':{'id':_0x33364c[_0x37f1('0x23')]},'attributes':['id',_0x37f1('0x26')],'raw':!![]})[_0x37f1('0x1a')](function(_0x354db2){_0x33364c[_0x37f1('0x27')]=util[_0x37f1('0x28')](_0x37f1('0x29'),_0x354db2[_0x37f1('0x26')]);_0x33364c[_0x37f1('0x20')]=_0x106b90;return request({'event':'incomingmessage','message':_0x33364c});})[_0x37f1('0x2a')](function(_0x19a230){console[_0x37f1('0x1d')](_0x19a230);});}else{return request({'event':'outgoingmessage','message':_0x33364c});}};}function afterCreate(_0x51eaf6,_0x137464){return function(_0x20aaef,_0x97d24){_0x20aaef=_0x20aaef[_0x37f1('0x1f')]({'plain':!![]});_0x20aaef[_0x37f1('0x20')]=_0x51eaf6;_0x20aaef['event']=_0x37f1('0x2b');return request({'event':_0x137464,'message':_0x20aaef});};}function afterUpdate(_0x3c9566,_0x39ac32){return function(_0x4849f3,_0x5b25f2){if(_0x4849f3['changed'](_0x37f1('0x2c'))&&_0x4849f3[_0x37f1('0x2c')]){_0x4849f3=_0x4849f3[_0x37f1('0x1f')]({'plain':!![]});_0x4849f3[_0x37f1('0x20')]=_0x3c9566;_0x4849f3['event']=_0x37f1('0x2c');if(_0x4849f3[_0x37f1('0x23')]){return db['User'][_0x37f1('0x25')]({'where':{'id':_0x4849f3[_0x37f1('0x23')]},'attributes':['id',_0x37f1('0x26')],'raw':!![]})[_0x37f1('0x1a')](function(_0x3d5d3b){_0x4849f3[_0x37f1('0x27')]=util[_0x37f1('0x28')]('SIP/%s',_0x3d5d3b[_0x37f1('0x26')]);return request({'event':_0x39ac32,'message':_0x4849f3});})['catch'](function(_0x4d64e7){console[_0x37f1('0x1d')](_0x4d64e7);});}else{return request({'event':_0x39ac32,'message':_0x4849f3});}}};}exports[_0x37f1('0x2d')]=function(){for(var _0x4e273c=0x0;_0x4e273c=_0x52baf1[_0xa144('0x15')]){throw Error(_0xa144('0x16'));}_0x20fd75(_0x13abf1);})[_0xa144('0x17')](function(_0x5d300f){_0x3e7126(_0x5d300f);});});}; \ No newline at end of file +var _0x33ad=['../mysqldb','./license/util','mail','chat','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird'];(function(_0x34c825,_0x44cad4){var _0x2fde13=function(_0x5ba245){while(--_0x5ba245){_0x34c825['push'](_0x34c825['shift']());}};_0x2fde13(++_0x44cad4);}(_0x33ad,0xa6));var _0xd33a=function(_0x4af2c6,_0x456362){_0x4af2c6=_0x4af2c6-0x0;var _0x1964ef=_0x33ad[_0x4af2c6];return _0x1964ef;};'use strict';var _=require(_0xd33a('0x0'));var BPromise=require(_0xd33a('0x1'));var db=require(_0xd33a('0x2'))['db'];var util=require(_0xd33a('0x3'));var channels=['voice',_0xd33a('0x4'),_0xd33a('0x5'),'fax',_0xd33a('0x6'),_0xd33a('0x7'),_0xd33a('0x8')];exports['getChannels']=function(){return channels;};exports[_0xd33a('0x9')]=function(_0x766b48){_0x766b48=_0x766b48[_0xd33a('0xa')]();return _[_0xd33a('0xb')](channels,_0x766b48);};exports[_0xd33a('0xc')]=function(_0x59d1c5,_0x17b091,_0x139c80,_0x61935b){var _0x7ec3d={'loginAttempts':_0x17b091,'blocked':_0x139c80};if(!_[_0xd33a('0xd')](_0x61935b)){_0x7ec3d[_0xd33a('0xe')]=_0x61935b;}return _0x59d1c5[_0xd33a('0xf')](_0x7ec3d);};exports[_0xd33a('0x10')]=function(_0x53d676){return new BPromise(function(_0x4e1caf,_0xc4519){var _0x1d03a0=0x0;if(_0x53d676[_0xd33a('0x11')]!==_0xd33a('0x12')){_0x4e1caf(_0x53d676);}db[_0xd33a('0x13')]['count']({'where':{'role':_0xd33a('0x12'),'online':!![],'id':{'$ne':_0x53d676['id']}}})[_0xd33a('0x14')](function(_0x1779e5){_0x1d03a0=_0x1779e5;return util['getLicense']();})[_0xd33a('0x14')](function(_0x35749d){if(_0x35749d&&_0x35749d[_0xd33a('0x15')]&&_0x1d03a0>=_0x35749d['agents']){throw Error(_0xd33a('0x16'));}_0x4e1caf(_0x53d676);})[_0xd33a('0x17')](function(_0x4178e8){_0xc4519(_0x4178e8);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ad9df7f..ab8120f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9178=['exports','render','status','json'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9178,0xe0));var _0x8917=function(_0x13aefe,_0x35e364){_0x13aefe=_0x13aefe-0x0;var _0x108c9f=_0x9178[_0x13aefe];return _0x108c9f;};'use strict';module[_0x8917('0x0')][0x194]=function pageNotFound(_0x148518,_0x40c7ed){var _0x1332b8='404';var _0x22b67a=0x194;var _0x4a50c1={'status':_0x22b67a};_0x40c7ed['status'](_0x4a50c1['status']);_0x40c7ed[_0x8917('0x1')](_0x1332b8,{},function(_0xef914,_0x532d09){if(_0xef914){return _0x40c7ed[_0x8917('0x2')](_0x4a50c1['status'])[_0x8917('0x3')](_0x4a50c1);}_0x40c7ed['send'](_0x532d09);});}; \ No newline at end of file +var _0x9813=['json','send','status','render'];(function(_0x488f4b,_0x2739f3){var _0x14abcc=function(_0x40f0e7){while(--_0x40f0e7){_0x488f4b['push'](_0x488f4b['shift']());}};_0x14abcc(++_0x2739f3);}(_0x9813,0xfa));var _0x3981=function(_0x54fc1f,_0x1703c2){_0x54fc1f=_0x54fc1f-0x0;var _0x53f699=_0x9813[_0x54fc1f];return _0x53f699;};'use strict';module['exports'][0x194]=function pageNotFound(_0x398f91,_0x19fcab){var _0x3ef66d='404';var _0x21e5c8=0x194;var _0x48bcb3={'status':_0x21e5c8};_0x19fcab[_0x3981('0x0')](_0x48bcb3[_0x3981('0x0')]);_0x19fcab[_0x3981('0x1')](_0x3ef66d,{},function(_0x57b9f1,_0x4bd9e8){if(_0x57b9f1){return _0x19fcab[_0x3981('0x0')](_0x48bcb3[_0x3981('0x0')])[_0x3981('0x2')](_0x48bcb3);}_0x19fcab[_0x3981('0x3')](_0x4bd9e8);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b5b731d..fa9fa1c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab3f=['FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','Interactions','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','ChatWebsiteId','ProactiveActions','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','cm_contact_has_tags','Agent','Queue','Campaign','CampaignId','OwnerId','CmHopperBlack','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','Subject','Description','Variable','SubjectId','Field','DeskConfiguration','int_desk_configuration_has_tags','VariableId','ZendeskField','int_zendesk_configuration_has_tags','VtigerAccount','Dynamics365Configuration','SessionId','SmsQueueReport','ProjectId','team_has_voice_queues','team_has_mail_queues','FaxQueues','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','team_has_whatsapp_queues','exports','path','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','mysql','password','options','username','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteractions','Notifications','SenderId','belongsTo','userProfileId','ChatGroup','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueue','ChatQueues','UserChatQueue','FaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','Imap','Dispositions','Answers','List','ListId','TemplateId','Agents','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','restrict','Interval','TagId','Items','Disposition','FaxAccountId'];(function(_0x16dbb2,_0x4be2bf){var _0x3b58ed=function(_0x296fe7){while(--_0x296fe7){_0x16dbb2['push'](_0x16dbb2['shift']());}};_0x3b58ed(++_0x4be2bf);}(_0xab3f,0x72));var _0xfab3=function(_0xf97a4,_0x65e8c6){_0xf97a4=_0xf97a4-0x0;var _0x2bef0a=_0xab3f[_0xf97a4];return _0x2bef0a;};'use strict';var path=require(_0xfab3('0x0'));var config=require('../config/environment');var Sequelize=require(_0xfab3('0x1'));var _=require(_0xfab3('0x2'));var jstz=require(_0xfab3('0x3'));var timezone=jstz[_0xfab3('0x4')]();config[_0xfab3('0x1')]=_[_0xfab3('0x5')](config[_0xfab3('0x1')],{'database':_0xfab3('0x6'),'username':_0xfab3('0x7'),'password':_0xfab3('0x8'),'options':{'host':_0xfab3('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfab3('0xa')},'logging':![],'timezone':timezone[_0xfab3('0xb')](),'define':{'charset':_0xfab3('0xc'),'collate':_0xfab3('0xd')}}});config[_0xfab3('0xe')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xfab3('0x6'),'username':'xcall','password':_0xfab3('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xfab3('0xf'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xfab3('0xb')](),'define':{'charset':_0xfab3('0xc'),'collate':_0xfab3('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfab3('0x1')]['database'],config['sequelize']['username'],config[_0xfab3('0x1')][_0xfab3('0x10')],config[_0xfab3('0x1')][_0xfab3('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0xfab3('0xe')][_0xfab3('0x12')],config[_0xfab3('0xe')][_0xfab3('0x10')],config[_0xfab3('0xe')][_0xfab3('0x11')])};db[_0xfab3('0x13')]=db[_0xfab3('0x1')]['import']('../api/user/user.model');db[_0xfab3('0x14')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x16'));db[_0xfab3('0x17')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x18'));db[_0xfab3('0x19')]=db['sequelize']['import'](_0xfab3('0x1a'));db[_0xfab3('0x1b')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x1c'));db[_0xfab3('0x1d')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x1e'));db['VoiceRecording']=db['sequelize']['import'](_0xfab3('0x1f'));db[_0xfab3('0x20')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/screenRecording/screenRecording.model');db[_0xfab3('0x21')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x22'));db[_0xfab3('0x23')]=db['sequelize']['import'](_0xfab3('0x24'));db[_0xfab3('0x25')]=db['sequelize']['import'](_0xfab3('0x26'));db[_0xfab3('0x27')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x28'));db[_0xfab3('0x29')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xfab3('0x2a')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x2b'));db[_0xfab3('0x2c')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/memberReport/memberReport.model');db[_0xfab3('0x2d')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x2e'));db[_0xfab3('0x2f')]=db['sequelize'][_0xfab3('0x15')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xfab3('0x30')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x31'));db[_0xfab3('0x32')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x33'));db['UserChatQueue']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x34'));db[_0xfab3('0x35')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x36'));db[_0xfab3('0x37')]=db[_0xfab3('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xfab3('0x38')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x39'));db[_0xfab3('0x3a')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x3b'));db['UserWhatsappQueue']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x3c'));db['MailServerIn']=db['sequelize']['import']('../api/mailServerIn/mailServerIn.model');db[_0xfab3('0x3d')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x3e'));db[_0xfab3('0x3f')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x40'));db[_0xfab3('0x41')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x42'));db[_0xfab3('0x43')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x44'));db[_0xfab3('0x45')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x46'));db[_0xfab3('0x47')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x48'));db[_0xfab3('0x49')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x4a'));db[_0xfab3('0x4b')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x4c'));db[_0xfab3('0x4d')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x4e'));db[_0xfab3('0x4f')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x50'));db[_0xfab3('0x51')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x52'));db[_0xfab3('0x53')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x54'));db['FaxInteraction']=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db[_0xfab3('0x55')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x56'));db['FaxQueue']=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x57'));db[_0xfab3('0x58')]=db['sequelize']['import'](_0xfab3('0x59'));db[_0xfab3('0x5a')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x5b'));db[_0xfab3('0x5c')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x5d'));db[_0xfab3('0x5e')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0xfab3('0x5f')]=db['sequelize'][_0xfab3('0x15')]('../api/smsMessage/smsMessage.model');db[_0xfab3('0x60')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x61'));db[_0xfab3('0x62')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x63'));db['OpenchannelApplication']=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xfab3('0x64')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x65'));db[_0xfab3('0x66')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x67'));db[_0xfab3('0x68')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x69'));db['ChatWebsite']=db[_0xfab3('0x1')]['import'](_0xfab3('0x6a'));db[_0xfab3('0x6b')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x6c'));db[_0xfab3('0x6d')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x6e'));db[_0xfab3('0x6f')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/chatInteraction/chatInteraction.model');db[_0xfab3('0x70')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x71'));db[_0xfab3('0x72')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x73'));db['ChatQueue']=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x74'));db['ChatGroup']=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/chatGroup/chatGroup.model');db[_0xfab3('0x75')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x76'));db[_0xfab3('0x77')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x78'));db[_0xfab3('0x79')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x7a'));db[_0xfab3('0x7b')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x7c'));db['CmHopperFinal']=db[_0xfab3('0x1')]['import'](_0xfab3('0x7d'));db[_0xfab3('0x7e')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x7f'));db[_0xfab3('0x80')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x81'));db[_0xfab3('0x82')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/cmCustomField/cmCustomField.model');db[_0xfab3('0x83')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x84'));db[_0xfab3('0x85')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x86'));db[_0xfab3('0x87')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x88'));db['Disposition']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x89'));db[_0xfab3('0x8a')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x8b'));db['Interval']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x8c'));db[_0xfab3('0x8d')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x8e'));db[_0xfab3('0x8f')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x90'));db[_0xfab3('0x91')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x92'));db[_0xfab3('0x93')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/schedule/schedule.model');db['Sound']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x94'));db[_0xfab3('0x95')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x96'));db[_0xfab3('0x97')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x98'));db[_0xfab3('0x99')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x9a'));db['Variable']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x9b'));db[_0xfab3('0x9c')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x9d'));db[_0xfab3('0x9e')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x9f'));db['AnalyticCustomReport']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xa0'));db[_0xfab3('0xa1')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xa2'));db['AnalyticExtractedReport']=db[_0xfab3('0x1')]['import'](_0xfab3('0xa3'));db[_0xfab3('0xa4')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xa5'));db[_0xfab3('0xa6')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xa7'));db[_0xfab3('0xa8')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xfab3('0xa9')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xaa'));db['SalesforceField']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xab'));db[_0xfab3('0xac')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xad'));db[_0xfab3('0xae')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xaf'));db[_0xfab3('0xb0')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xb1'));db[_0xfab3('0xb2')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xb3'));db['DeskConfiguration']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xb4'));db[_0xfab3('0xb5')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/intDeskField/intDeskField.model');db[_0xfab3('0xb6')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0xfab3('0xb7')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xb8'));db[_0xfab3('0xb9')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xba'));db[_0xfab3('0xbb')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xbc'));db[_0xfab3('0xbd')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xbe'));db['ZendeskField']=db[_0xfab3('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0xfab3('0xbf')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xfab3('0xc0')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xc1'));db[_0xfab3('0xc2')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xc3'));db['VtigerAccount']=db[_0xfab3('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xfab3('0xc4')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xc5'));db[_0xfab3('0xc6')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xc7'));db[_0xfab3('0xc8')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xc9'));db[_0xfab3('0xca')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xcb'));db[_0xfab3('0xcc')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xcd'));db[_0xfab3('0xce')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xcf'));db['Dynamics365Configuration']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xd0'));db[_0xfab3('0xd1')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xd2'));db[_0xfab3('0xd3')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xd4'));db[_0xfab3('0xd5')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xd6'));db[_0xfab3('0xd7')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xd8'));db[_0xfab3('0x9c')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x9d'));db[_0xfab3('0xd9')]=db['sequelize']['import'](_0xfab3('0xda'));db[_0xfab3('0xdb')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xdc'));db[_0xfab3('0xdd')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xde'));db[_0xfab3('0xdf')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xe0'));db[_0xfab3('0xe1')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xe2'));db[_0xfab3('0xe3')]=db['sequelize'][_0xfab3('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xe4'));db[_0xfab3('0xe5')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xe6'));db[_0xfab3('0xe7')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xfab3('0xe8')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xe9'));db['Setting']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xea'));db[_0xfab3('0xeb')]=db[_0xfab3('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xec'));db[_0xfab3('0xed')]=db['sequelize'][_0xfab3('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/squareMessage/squareMessage.model');db[_0xfab3('0xee')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0xef'));db[_0xfab3('0xf0')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xf1'));db['Campaign']=db[_0xfab3('0x1')]['import'](_0xfab3('0xf2'));db[_0xfab3('0xf3')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xf4'));db[_0xfab3('0xf5')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/attachment/attachment.model');db[_0xfab3('0xf6')]=db[_0xfab3('0x1')]['import'](_0xfab3('0xf7'));db[_0xfab3('0xf8')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xf9'));db[_0xfab3('0xfa')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xfb'));db[_0xfab3('0xfc')]=db[_0xfab3('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xfab3('0xfd')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0xfe'));db[_0xfab3('0xff')]=db['sequelize'][_0xfab3('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0xfab3('0x100')]=db['sequelize'][_0xfab3('0x15')](_0xfab3('0x101'));db[_0xfab3('0x102')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x103'));db[_0xfab3('0x104')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0xfab3('0x105')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x106'));db[_0xfab3('0x107')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x108'));db[_0xfab3('0x109')]=db['sequelize']['import'](_0xfab3('0x10a'));db[_0xfab3('0x10b')]=db[_0xfab3('0x1')][_0xfab3('0x15')]('../api/whatsappAccount/whatsappAccount.model');db[_0xfab3('0x10c')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x10d'));db[_0xfab3('0x10e')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x10f'));db[_0xfab3('0x110')]=db[_0xfab3('0x1')]['import'](_0xfab3('0x111'));db[_0xfab3('0x112')]=db[_0xfab3('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xfab3('0x113')]=db[_0xfab3('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xfab3('0x114')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x115'));db[_0xfab3('0x116')]=db[_0xfab3('0x1')][_0xfab3('0x15')](_0xfab3('0x117'));db[_0xfab3('0x13')][_0xfab3('0x118')](db['VoiceMail'],{'as':_0xfab3('0x21'),'onDelete':'cascade','foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x11b')],{'as':_0xfab3('0x11c'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')]['hasMany'](db[_0xfab3('0x30')],{'as':_0xfab3('0x11d'),'foreignKey':'UserId'});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x19')],{'as':_0xfab3('0x11e'),'onDelete':_0xfab3('0x11f'),'hooks':!![]});db['User'][_0xfab3('0x11a')](db['CmHopperFinal'],{'as':_0xfab3('0x120'),'foreignKey':'UserId'});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x7e')],{'as':_0xfab3('0x121'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x80')],{'as':'ReportAgentPreview','foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')]['hasMany'](db[_0xfab3('0x64')],{'as':_0xfab3('0x122'),'foreignKey':'UserId'});db['User'][_0xfab3('0x11a')](db[_0xfab3('0x6f')],{'as':_0xfab3('0x123'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')]['hasMany'](db['SmsInteraction'],{'as':_0xfab3('0x124'),'foreignKey':_0xfab3('0x119')});db['User'][_0xfab3('0x11a')](db[_0xfab3('0x125')],{'as':'FaxInteractions','foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')]['hasMany'](db['MailInteraction'],{'as':_0xfab3('0x126'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x10e')],{'as':'WhatsappInteractions','foreignKey':_0xfab3('0x119')});db[_0xfab3('0x13')][_0xfab3('0x11a')](db[_0xfab3('0x109')],{'as':_0xfab3('0x127'),'foreignKey':_0xfab3('0x128')});db[_0xfab3('0x13')][_0xfab3('0x129')](db[_0xfab3('0x104')],{'as':_0xfab3('0x104'),'foreignKey':_0xfab3('0x12a')});db['User']['belongsToMany'](db[_0xfab3('0x12b')],{'as':_0xfab3('0x12c'),'through':_0xfab3('0x12d')});db['User'][_0xfab3('0x12e')](db['CmContact'],{'as':'Contacts','through':_0xfab3('0x12f')});db['User']['belongsToMany'](db[_0xfab3('0x100')],{'as':_0xfab3('0x130'),'through':_0xfab3('0x131')});db['User'][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':_0xfab3('0x132')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['MailInteraction'],{'as':_0xfab3('0x126'),'through':'user_has_mail_interactions'});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x6f')],{'as':_0xfab3('0x123'),'through':_0xfab3('0x133')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x125')],{'as':_0xfab3('0x134'),'through':'user_has_fax_interactions'});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x5e')],{'as':_0xfab3('0x124'),'through':_0xfab3('0x135')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x64')],{'as':_0xfab3('0x122'),'through':_0xfab3('0x136')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['WhatsappInteraction'],{'as':_0xfab3('0x137'),'through':_0xfab3('0x138')});db[_0xfab3('0x13')]['belongsToMany'](db[_0xfab3('0x1d')],{'as':_0xfab3('0x139'),'through':_0xfab3('0x32'),'required':![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x41')],{'as':_0xfab3('0x13a'),'through':_0xfab3('0x35'),'required':![]});db[_0xfab3('0x13')]['belongsToMany'](db[_0xfab3('0x13b')],{'as':_0xfab3('0x13c'),'through':_0xfab3('0x13d'),'required':![],'hooks':!![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x13e')],{'as':'FaxQueues','through':_0xfab3('0x37'),'required':![]});db['User'][_0xfab3('0x12e')](db[_0xfab3('0x60')],{'as':_0xfab3('0x13f'),'through':'UserSmsQueue','required':![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['OpenchannelQueue'],{'as':_0xfab3('0x140'),'through':'UserOpenchannelQueue','required':![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x114')],{'as':_0xfab3('0x141'),'through':_0xfab3('0x142'),'required':![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x100')],{'through':_0xfab3('0x131')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x102')],{'as':_0xfab3('0x143'),'through':_0xfab3('0x144'),'required':![]});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x145')],{'as':'ChatWebsites','through':_0xfab3('0x146')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x51')],{'as':_0xfab3('0x147'),'through':_0xfab3('0x148')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['MailAccount'],{'as':_0xfab3('0x149'),'through':_0xfab3('0x14a')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['OpenchannelAccount'],{'as':_0xfab3('0x14b'),'through':_0xfab3('0x14c')});db['User'][_0xfab3('0x12e')](db[_0xfab3('0x5a')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xfab3('0x13')][_0xfab3('0x12e')](db['WhatsappAccount'],{'as':_0xfab3('0x14d'),'through':_0xfab3('0x14e')});db[_0xfab3('0x13')][_0xfab3('0x12e')](db[_0xfab3('0x14f')],{'as':_0xfab3('0x150'),'through':_0xfab3('0x151')});db['VoiceChanSpy']['hasMany'](db['VoiceExtension'],{'as':_0xfab3('0x152'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x153')});db['VoiceContext'][_0xfab3('0x11a')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xfab3('0x19')][_0xfab3('0x11a')](db[_0xfab3('0x19')],{'as':_0xfab3('0x154'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xfab3('0x12e')](db['Sound'],{'as':_0xfab3('0x155'),'through':_0xfab3('0x156')});db['VoiceQueue'][_0xfab3('0x11a')](db[_0xfab3('0x30')],{'as':_0xfab3('0x157'),'foreignKey':_0xfab3('0x158')});db[_0xfab3('0x1d')][_0xfab3('0x11a')](db[_0xfab3('0x7b')],{'as':_0xfab3('0x159'),'foreignKey':_0xfab3('0x158')});db[_0xfab3('0x1d')][_0xfab3('0x11a')](db[_0xfab3('0x15a')],{'as':_0xfab3('0x120'),'foreignKey':_0xfab3('0x158')});db[_0xfab3('0x1d')][_0xfab3('0x11a')](db['CmHopperHistory'],{'as':_0xfab3('0x15b'),'foreignKey':_0xfab3('0x158')});db[_0xfab3('0x1d')][_0xfab3('0x11a')](db[_0xfab3('0x80')],{'as':_0xfab3('0x80'),'foreignKey':_0xfab3('0x158')});db['VoiceQueue'][_0xfab3('0x11a')](db['CmHopperBlack'],{'as':_0xfab3('0x15c'),'foreignKey':'VoiceQueueId'});db[_0xfab3('0x1d')][_0xfab3('0x11a')](db['JscriptySessionReport'],{'as':_0xfab3('0x15d'),'foreignKey':_0xfab3('0x158')});db[_0xfab3('0x1d')][_0xfab3('0x129')](db[_0xfab3('0x2d')],{'as':_0xfab3('0x2d'),'foreignKey':_0xfab3('0x15e')});db[_0xfab3('0x1d')][_0xfab3('0x129')](db[_0xfab3('0x2d')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xfab3('0x1d')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x1d')][_0xfab3('0x129')](db[_0xfab3('0x8d')],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x1d')][_0xfab3('0x12e')](db[_0xfab3('0x100')],{'as':_0xfab3('0x130'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':'Agents','through':_0xfab3('0x32')});db[_0xfab3('0x1d')][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'as':_0xfab3('0x162'),'through':'team_has_voice_queues'});db[_0xfab3('0x1d')][_0xfab3('0x12e')](db['CmList'],{'as':_0xfab3('0x163'),'through':_0xfab3('0x164')});db[_0xfab3('0x11b')]['belongsTo'](db[_0xfab3('0x13')],{'as':_0xfab3('0x13'),'foreignKey':'UserId'});db['ScreenRecording'][_0xfab3('0x129')](db['User'],{'as':_0xfab3('0x13'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x21')][_0xfab3('0x11a')](db['VoiceMailMessage'],{'as':_0xfab3('0x165'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x166'),'sourceKey':_0xfab3('0x167')});db[_0xfab3('0x23')][_0xfab3('0x129')](db['VoiceMail'],{'foreignKey':_0xfab3('0x166'),'targetKey':'mailbox'});db['VoiceCallReport'][_0xfab3('0x11a')](db['VoiceQueueReport'],{'as':_0xfab3('0x168'),'foreignKey':_0xfab3('0x169'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xfab3('0x29')],{'as':_0xfab3('0x16a'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xfab3('0x13')],{'as':_0xfab3('0x13'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x25')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x16d')][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'as':_0xfab3('0x3f'),'foreignKey':_0xfab3('0x16e')});db['MailServerOut']['belongsTo'](db[_0xfab3('0x3f')],{'as':_0xfab3('0x3f'),'foreignKey':_0xfab3('0x16e')});db[_0xfab3('0x3f')]['hasOne'](db['MailServerIn'],{'as':_0xfab3('0x16f'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x3f')][_0xfab3('0x118')](db[_0xfab3('0x3d')],{'as':'Smtp','onDelete':_0xfab3('0x11f')});db[_0xfab3('0x3f')][_0xfab3('0x11a')](db['Disposition'],{'as':_0xfab3('0x170'),'foreignKey':'MailAccountId'});db[_0xfab3('0x3f')][_0xfab3('0x11a')](db['CannedAnswer'],{'as':_0xfab3('0x171'),'foreignKey':_0xfab3('0x16e')});db[_0xfab3('0x3f')][_0xfab3('0x11a')](db['MailMessage'],{'as':_0xfab3('0x165'),'foreignKey':_0xfab3('0x16e')});db[_0xfab3('0x3f')][_0xfab3('0x11a')](db[_0xfab3('0x45')],{'as':'Interactions'});db['MailAccount'][_0xfab3('0x11a')](db[_0xfab3('0x49')],{'as':'Applications'});db['MailAccount'][_0xfab3('0x129')](db['CmList'],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x3f')][_0xfab3('0x129')](db['Template'],{'as':_0xfab3('0x97'),'foreignKey':_0xfab3('0x174')});db[_0xfab3('0x3f')][_0xfab3('0x129')](db[_0xfab3('0x8d')],{'as':_0xfab3('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':_0xfab3('0x14a')});db[_0xfab3('0x41')][_0xfab3('0x12e')](db['User'],{'as':_0xfab3('0x175'),'through':_0xfab3('0x35')});db[_0xfab3('0x41')][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':'team_has_mail_queues','as':_0xfab3('0x162')});db['MailInteraction']['hasMany'](db[_0xfab3('0x47')],{'as':_0xfab3('0x165'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x176')});db['MailInteraction'][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'as':_0xfab3('0x177'),'foreignKey':'MailAccountId'});db[_0xfab3('0x45')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':'Contact','foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x45')]['belongsTo'](db[_0xfab3('0x13')],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x45')]['belongsToMany'](db[_0xfab3('0x95')],{'through':_0xfab3('0x179'),'as':_0xfab3('0x17a')});db[_0xfab3('0x45')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xfab3('0x17b')});db[_0xfab3('0x45')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'through':_0xfab3('0x17d'),'foreignKey':_0xfab3('0x176')});db[_0xfab3('0x47')][_0xfab3('0x11a')](db['Attachment'],{'as':_0xfab3('0x17e'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x47')]['belongsTo'](db[_0xfab3('0x13')],{'as':_0xfab3('0x13')});db[_0xfab3('0x47')][_0xfab3('0x129')](db['CmContact'],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x16b')});db[_0xfab3('0x47')][_0xfab3('0x129')](db[_0xfab3('0x45')],{'as':'Interaction','foreignKey':_0xfab3('0x176')});db[_0xfab3('0x47')][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x16e')});db[_0xfab3('0x49')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':'restrict'});db[_0xfab3('0x49')][_0xfab3('0x129')](db[_0xfab3('0x41')],{'onDelete':_0xfab3('0x17f')});db['MailApplication'][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x49')][_0xfab3('0x129')](db[_0xfab3('0x180')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x49')][_0xfab3('0x129')](db[_0xfab3('0x95')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x181')});db['MailQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x3f')],{});db['MailQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x4b')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x4b')][_0xfab3('0x129')](db['MailInteraction'],{});db[_0xfab3('0x4b')][_0xfab3('0x129')](db[_0xfab3('0x47')],{});db[_0xfab3('0x4b')][_0xfab3('0x129')](db[_0xfab3('0x13')],{});db[_0xfab3('0x4b')][_0xfab3('0x129')](db['MailQueue'],{});db[_0xfab3('0x4d')]['hasMany'](db[_0xfab3('0x4f')],{'as':_0xfab3('0x182'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x51')][_0xfab3('0x11a')](db[_0xfab3('0x183')],{'as':_0xfab3('0x170'),'foreignKey':_0xfab3('0x184')});db[_0xfab3('0x51')][_0xfab3('0x11a')](db['CannedAnswer'],{'as':_0xfab3('0x171'),'foreignKey':_0xfab3('0x184')});db[_0xfab3('0x51')]['hasMany'](db[_0xfab3('0x125')],{'as':'Interactions'});db[_0xfab3('0x51')][_0xfab3('0x11a')](db[_0xfab3('0x53')],{'as':_0xfab3('0x154')});db[_0xfab3('0x51')]['hasMany'](db[_0xfab3('0x19')],{'as':'Exntensions','onDelete':_0xfab3('0x11f')});db['FaxAccount']['hasMany'](db[_0xfab3('0x55')],{'as':_0xfab3('0x165')});db['FaxAccount'][_0xfab3('0x129')](db[_0xfab3('0x2d')],{'as':_0xfab3('0x2d')});db[_0xfab3('0x51')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x51')]['belongsTo'](db['Pause'],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x51')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':_0xfab3('0x148')});db[_0xfab3('0x53')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db['FaxQueue'],{'onDelete':_0xfab3('0x17f')});db['FaxApplication'][_0xfab3('0x129')](db[_0xfab3('0x51')],{'onDelete':'restrict'});db['FaxApplication'][_0xfab3('0x129')](db[_0xfab3('0x95')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x181')});db['FaxInteraction']['hasMany'](db[_0xfab3('0x55')],{'as':'Messages','onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x185')});db[_0xfab3('0x125')]['belongsTo'](db[_0xfab3('0x51')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x184')});db[_0xfab3('0x125')][_0xfab3('0x129')](db['CmContact'],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x125')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x125')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x186'),'as':_0xfab3('0x17a')});db['FaxInteraction']['belongsToMany'](db[_0xfab3('0x95')],{'through':_0xfab3('0x186'),'as':_0xfab3('0x17b')});db[_0xfab3('0x125')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'through':_0xfab3('0x187'),'foreignKey':'FaxInteractionId'});db[_0xfab3('0x55')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x13')});db[_0xfab3('0x55')][_0xfab3('0x129')](db['FaxInteraction'],{'as':_0xfab3('0x188'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x16b')});db[_0xfab3('0x55')][_0xfab3('0x129')](db[_0xfab3('0xf5')],{'as':_0xfab3('0xf5'),'foreignKey':_0xfab3('0x189')});db[_0xfab3('0x55')][_0xfab3('0x129')](db[_0xfab3('0x51')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x184')});db[_0xfab3('0x13e')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0xfab3('0x13e')][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':_0xfab3('0x18a'),'as':_0xfab3('0x162')});db[_0xfab3('0x58')]['belongsTo'](db[_0xfab3('0x51')],{});db[_0xfab3('0x58')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x58')]['belongsTo'](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0xfab3('0x125')],{});db[_0xfab3('0x58')]['belongsTo'](db['FaxMessage'],{});db[_0xfab3('0x58')][_0xfab3('0x129')](db[_0xfab3('0x13')],{});db['FaxQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x13e')],{});db['SmsAccount']['hasMany'](db[_0xfab3('0x183')],{'as':_0xfab3('0x170'),'foreignKey':_0xfab3('0x18b')});db['SmsAccount'][_0xfab3('0x11a')](db[_0xfab3('0x87')],{'as':'Answers','foreignKey':_0xfab3('0x18b')});db[_0xfab3('0x5a')]['hasMany'](db[_0xfab3('0x5f')],{'as':'Messages','foreignKey':_0xfab3('0x18b')});db['SmsAccount'][_0xfab3('0x11a')](db[_0xfab3('0x5e')],{'as':_0xfab3('0x18c')});db['SmsAccount'][_0xfab3('0x11a')](db[_0xfab3('0x5c')],{'as':'Applications'});db[_0xfab3('0x5a')][_0xfab3('0x129')](db['CmList'],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db['SmsAccount'][_0xfab3('0x129')](db[_0xfab3('0x8d')],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x5a')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':'Agents','through':_0xfab3('0x18d')});db[_0xfab3('0x5c')][_0xfab3('0x129')](db['User'],{'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x5c')]['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db['SmsApplication'][_0xfab3('0x129')](db[_0xfab3('0x5a')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0xfab3('0x180')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x5c')]['belongsTo'](db[_0xfab3('0x95')],{'onDelete':'restrict','foreignKey':_0xfab3('0x181')});db['SmsInteraction'][_0xfab3('0x11a')](db[_0xfab3('0x5f')],{'as':_0xfab3('0x165'),'onDelete':_0xfab3('0x11f'),'foreignKey':'SmsInteractionId'});db[_0xfab3('0x5e')][_0xfab3('0x129')](db[_0xfab3('0x5a')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x18b')});db['SmsInteraction'][_0xfab3('0x129')](db['CmContact'],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x5e')][_0xfab3('0x129')](db['User'],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x119')});db['SmsInteraction'][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x18e'),'as':'Tags'});db[_0xfab3('0x5e')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x18e'),'as':_0xfab3('0x17b')});db['SmsInteraction']['belongsToMany'](db[_0xfab3('0x13')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0xfab3('0x18f')});db[_0xfab3('0x5f')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'as':_0xfab3('0x13')});db['SmsMessage'][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x16b')});db['SmsMessage'][_0xfab3('0x129')](db[_0xfab3('0x5e')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x188'),'foreignKey':_0xfab3('0x18f')});db['SmsMessage'][_0xfab3('0x129')](db[_0xfab3('0x5a')],{'as':'Account','foreignKey':_0xfab3('0x18b')});db['SmsQueue']['belongsToMany'](db['User'],{'as':_0xfab3('0x175'),'through':_0xfab3('0x38'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':_0xfab3('0x190'),'as':_0xfab3('0x162')});db[_0xfab3('0x62')][_0xfab3('0x11a')](db[_0xfab3('0x183')],{'as':_0xfab3('0x170'),'foreignKey':_0xfab3('0x191')});db['OpenchannelAccount'][_0xfab3('0x11a')](db[_0xfab3('0x87')],{'as':_0xfab3('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0xfab3('0x62')][_0xfab3('0x11a')](db[_0xfab3('0x64')],{'as':_0xfab3('0x18c'),'foreignKey':_0xfab3('0x191')});db['OpenchannelAccount'][_0xfab3('0x11a')](db['OpenchannelMessage'],{'as':_0xfab3('0x165'),'foreignKey':'OpenchannelAccountId'});db[_0xfab3('0x62')][_0xfab3('0x11a')](db[_0xfab3('0x192')],{'as':_0xfab3('0x154'),'foreignKey':'OpenchannelAccountId'});db[_0xfab3('0x62')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x62')]['belongsTo'](db[_0xfab3('0x8d')],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x62')][_0xfab3('0x12e')](db['User'],{'as':'Agents','through':_0xfab3('0x14c')});db[_0xfab3('0x192')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x17f')});db['OpenchannelApplication'][_0xfab3('0x129')](db[_0xfab3('0x68')],{'onDelete':_0xfab3('0x17f'),'foreignKey':'OpenchannelQueueId'});db[_0xfab3('0x192')][_0xfab3('0x129')](db[_0xfab3('0x62')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x191')});db['OpenchannelApplication'][_0xfab3('0x129')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xfab3('0x192')][_0xfab3('0x129')](db[_0xfab3('0x95')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x181')});db[_0xfab3('0x64')][_0xfab3('0x11a')](db[_0xfab3('0x66')],{'as':_0xfab3('0x165'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xfab3('0x64')][_0xfab3('0x129')](db[_0xfab3('0x62')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xfab3('0x64')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x64')][_0xfab3('0x129')](db['User'],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x64')]['belongsToMany'](db[_0xfab3('0x95')],{'through':_0xfab3('0x193'),'as':_0xfab3('0x17a')});db[_0xfab3('0x64')][_0xfab3('0x12e')](db['Tag'],{'through':_0xfab3('0x193'),'as':_0xfab3('0x17b')});db['OpenchannelInteraction']['belongsToMany'](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'through':_0xfab3('0x136'),'foreignKey':'OpenchannelInteractionId'});db[_0xfab3('0x66')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x11f'),'as':'User'});db[_0xfab3('0x66')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':_0xfab3('0x11f'),'as':'Contact'});db[_0xfab3('0x66')][_0xfab3('0x129')](db['OpenchannelInteraction'],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x188'),'foreignKey':_0xfab3('0x194')});db['OpenchannelMessage'][_0xfab3('0x129')](db['Attachment'],{'as':_0xfab3('0xf5'),'foreignKey':_0xfab3('0x189')});db[_0xfab3('0x66')]['belongsTo'](db[_0xfab3('0x62')],{'as':_0xfab3('0x177'),'foreignKey':'OpenchannelAccountId'});db[_0xfab3('0x68')][_0xfab3('0x12e')](db['User'],{'as':_0xfab3('0x175'),'through':'UserOpenchannelQueue','foreignKey':_0xfab3('0x195')});db['OpenchannelQueue'][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':'team_has_openchannel_queues','as':_0xfab3('0x162')});db[_0xfab3('0x145')][_0xfab3('0x11a')](db[_0xfab3('0x183')],{'as':'Dispositions','foreignKey':_0xfab3('0x196')});db[_0xfab3('0x145')][_0xfab3('0x11a')](db[_0xfab3('0x87')],{'as':_0xfab3('0x171'),'foreignKey':_0xfab3('0x196')});db[_0xfab3('0x145')][_0xfab3('0x11a')](db[_0xfab3('0x75')],{'as':_0xfab3('0x197')});db[_0xfab3('0x145')][_0xfab3('0x11a')](db[_0xfab3('0x6f')],{'as':_0xfab3('0x18c')});db[_0xfab3('0x145')][_0xfab3('0x11a')](db[_0xfab3('0x6d')],{'as':'Applications'});db[_0xfab3('0x145')][_0xfab3('0x11a')](db['ChatMessage'],{'as':'Messages'});db[_0xfab3('0x145')]['belongsTo'](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x145')][_0xfab3('0x129')](db['Interval'],{'as':_0xfab3('0x180'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x145')][_0xfab3('0x129')](db['Pause'],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x145')][_0xfab3('0x12e')](db['User'],{'as':_0xfab3('0x175'),'through':_0xfab3('0x146')});db[_0xfab3('0x6b')][_0xfab3('0x129')](db[_0xfab3('0x62')],{});db[_0xfab3('0x6b')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x6b')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':'ContactId'});db[_0xfab3('0x6b')]['belongsTo'](db[_0xfab3('0x64')],{});db[_0xfab3('0x6b')]['belongsTo'](db[_0xfab3('0x66')],{});db[_0xfab3('0x6b')][_0xfab3('0x129')](db[_0xfab3('0x13')],{});db['OpenchannelQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x68')],{});db[_0xfab3('0x6d')]['belongsTo'](db[_0xfab3('0x13')],{'as':'Agent','foreignKey':_0xfab3('0x119'),'onDelete':_0xfab3('0x17f')});db['ChatApplication'][_0xfab3('0x129')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xfab3('0x198'),'onDelete':_0xfab3('0x17f')});db['ChatApplication'][_0xfab3('0x129')](db[_0xfab3('0x145')],{'as':_0xfab3('0x199'),'foreignKey':'ChatWebsiteId','onDelete':_0xfab3('0x17f')});db[_0xfab3('0x6d')][_0xfab3('0x129')](db[_0xfab3('0x95')],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x181')});db[_0xfab3('0x6f')]['hasMany'](db[_0xfab3('0x70')],{'as':_0xfab3('0x165'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x19a')});db['ChatInteraction'][_0xfab3('0x129')](db[_0xfab3('0x145')],{'as':_0xfab3('0x177'),'foreignKey':'ChatWebsiteId'});db[_0xfab3('0x6f')][_0xfab3('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0xfab3('0x16c')});db['ChatInteraction']['belongsTo'](db['User'],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x6f')][_0xfab3('0x12e')](db['Tag'],{'through':_0xfab3('0x19b'),'as':_0xfab3('0x17a')});db[_0xfab3('0x6f')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x19b'),'as':_0xfab3('0x17b')});db[_0xfab3('0x6f')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x13')});db[_0xfab3('0x70')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':'cascade','as':_0xfab3('0x16b'),'foreignKey':'ContactId'});db[_0xfab3('0x70')][_0xfab3('0x129')](db[_0xfab3('0x6f')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x188'),'foreignKey':_0xfab3('0x19a')});db[_0xfab3('0x70')][_0xfab3('0x129')](db[_0xfab3('0xf5')],{'as':_0xfab3('0xf5'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xfab3('0x129')](db['ChatWebsite'],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x196')});db[_0xfab3('0x72')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':_0xfab3('0x11f'),'as':'Contact','foreignKey':'ContactId'});db[_0xfab3('0x72')][_0xfab3('0x129')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xfab3('0x196')});db[_0xfab3('0x13b')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':_0xfab3('0x13d'),'hooks':!![]});db[_0xfab3('0x13b')][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':_0xfab3('0x19c'),'as':_0xfab3('0x162')});db['ChatGroup'][_0xfab3('0x11a')](db[_0xfab3('0xdd')],{'as':'Messages','foreignKey':_0xfab3('0x19d'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x12b')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x157'),'through':'chat_group_has_users'});db[_0xfab3('0x75')]['belongsTo'](db[_0xfab3('0x145')],{'as':'Website','foreignKey':_0xfab3('0x196')});db[_0xfab3('0x77')][_0xfab3('0x11a')](db[_0xfab3('0x79')],{'as':_0xfab3('0x19e'),'foreignKey':_0xfab3('0x19f')});db['CmContact'][_0xfab3('0x11a')](db[_0xfab3('0x7b')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0xfab3('0x79')][_0xfab3('0x11a')](db['CmHopperFinal'],{'as':_0xfab3('0x120'),'foreignKey':_0xfab3('0x16c')});db['CmContact'][_0xfab3('0x11a')](db['CmHopperHistory'],{'as':_0xfab3('0x15b'),'foreignKey':_0xfab3('0x16c')});db['CmContact'][_0xfab3('0x11a')](db[_0xfab3('0x80')],{'as':'ReportAgentPreview','foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x79')][_0xfab3('0x11a')](db[_0xfab3('0xe3')],{'as':_0xfab3('0x15d'),'foreignKey':_0xfab3('0x16c')});db['CmContact']['hasMany'](db[_0xfab3('0x64')],{'as':_0xfab3('0x122'),'foreignKey':_0xfab3('0x16c'),'onDelete':_0xfab3('0x17f')});db['CmContact']['hasMany'](db['ChatInteraction'],{'as':_0xfab3('0x123'),'foreignKey':_0xfab3('0x16c'),'onDelete':_0xfab3('0x17f')});db['CmContact'][_0xfab3('0x11a')](db[_0xfab3('0x5e')],{'as':_0xfab3('0x124'),'foreignKey':_0xfab3('0x16c'),'onDelete':_0xfab3('0x17f')});db['CmContact'][_0xfab3('0x11a')](db[_0xfab3('0x125')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xfab3('0x17f')});db[_0xfab3('0x79')]['hasMany'](db[_0xfab3('0x45')],{'as':_0xfab3('0x126'),'foreignKey':'ContactId','onDelete':_0xfab3('0x17f')});db[_0xfab3('0x79')][_0xfab3('0x129')](db[_0xfab3('0x77')],{'as':'Company','foreignKey':_0xfab3('0x19f')});db[_0xfab3('0x79')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x79')][_0xfab3('0x12e')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0xfab3('0x79')]['belongsToMany'](db[_0xfab3('0x95')],{'as':_0xfab3('0x17a'),'through':_0xfab3('0x1a0')});db[_0xfab3('0x79')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x1a0'),'as':_0xfab3('0x17b')});db[_0xfab3('0x7b')][_0xfab3('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0xfab3('0x16c'),'onDelete':'cascade'});db[_0xfab3('0x7b')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x7b')]['belongsTo'](db[_0xfab3('0x13')],{'as':_0xfab3('0x1a1'),'foreignKey':_0xfab3('0x119')});db[_0xfab3('0x7b')][_0xfab3('0x129')](db[_0xfab3('0x1d')],{'as':_0xfab3('0x1a2'),'foreignKey':_0xfab3('0x158'),'onDelete':_0xfab3('0x11f')});db['CmHopper'][_0xfab3('0x129')](db[_0xfab3('0x1a3')],{'as':'Campaign','foreignKey':_0xfab3('0x1a4'),'onDelete':_0xfab3('0x11f')});db['CmHopper'][_0xfab3('0x129')](db[_0xfab3('0x13')],{'as':_0xfab3('0x178'),'foreignKey':_0xfab3('0x1a5')});db['CmHopperBlack'][_0xfab3('0x129')](db['CmContact'],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':'ListId','onDelete':_0xfab3('0x11f')});db[_0xfab3('0x1a6')][_0xfab3('0x129')](db[_0xfab3('0x1d')],{'as':_0xfab3('0x1a2'),'foreignKey':_0xfab3('0x158'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x1a6')]['belongsTo'](db[_0xfab3('0x1a3')],{'as':'Campaign','foreignKey':_0xfab3('0x1a4'),'onDelete':_0xfab3('0x11f')});db['Automation'][_0xfab3('0x11a')](db['Condition'],{'as':{'plural':_0xfab3('0x1a7'),'singular':_0xfab3('0x1a8')},'foreignKey':_0xfab3('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0xfab3('0x85')][_0xfab3('0x11a')](db[_0xfab3('0x8a')],{'as':{'plural':_0xfab3('0x1aa'),'singular':_0xfab3('0x1ab')},'foreignKey':_0xfab3('0x1ac'),'onDelete':_0xfab3('0x11f'),'hooks':!![]});db[_0xfab3('0x85')][_0xfab3('0x11a')](db[_0xfab3('0x83')],{'as':_0xfab3('0x1ad'),'foreignKey':_0xfab3('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0xfab3('0x180')][_0xfab3('0x11a')](db[_0xfab3('0x180')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xfab3('0x11f'),'hooks':!![],'required':![]});db[_0xfab3('0x180')][_0xfab3('0x11a')](db[_0xfab3('0x19')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xfab3('0x17f')});db[_0xfab3('0x180')][_0xfab3('0x11a')](db['MailApplication'],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xfab3('0x180')][_0xfab3('0x11a')](db[_0xfab3('0x6d')],{'as':_0xfab3('0x1af'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x180')][_0xfab3('0x11a')](db[_0xfab3('0x53')],{'as':_0xfab3('0x1b0'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x180')][_0xfab3('0x11a')](db[_0xfab3('0x5c')],{'as':_0xfab3('0x1b1'),'foreignKey':_0xfab3('0x15f')});db['Schedule'][_0xfab3('0x129')](db[_0xfab3('0x3f')],{});db[_0xfab3('0x93')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0xfab3('0x1b2')});db[_0xfab3('0x93')][_0xfab3('0x129')](db[_0xfab3('0x1b3')],{'foreignKey':_0xfab3('0x1b4')});db['Sound'][_0xfab3('0x12e')](db[_0xfab3('0x1b')],{'as':'Mohs','through':_0xfab3('0x156'),'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x95')][_0xfab3('0x12e')](db['CmContact'],{'through':_0xfab3('0x1a0')});db[_0xfab3('0x95')][_0xfab3('0x12e')](db[_0xfab3('0x6f')],{'through':'chat_interaction_has_tags'});db[_0xfab3('0x95')][_0xfab3('0x12e')](db[_0xfab3('0x45')],{'through':_0xfab3('0x179')});db[_0xfab3('0x95')][_0xfab3('0x12e')](db[_0xfab3('0x5e')],{'through':_0xfab3('0x18e')});db['Tag']['belongsToMany'](db[_0xfab3('0x125')],{'through':_0xfab3('0x186')});db['Tag'][_0xfab3('0x12e')](db[_0xfab3('0x64')],{'through':_0xfab3('0x193')});db['Tag'][_0xfab3('0x12e')](db[_0xfab3('0x10e')],{'through':'whatsapp_interaction_has_tags'});db[_0xfab3('0x99')][_0xfab3('0x11a')](db['Condition'],{'as':{'plural':_0xfab3('0x1b5'),'singular':_0xfab3('0x1b6')},'foreignKey':_0xfab3('0x1b7'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xfab3('0x11a')](db[_0xfab3('0x8a')],{'as':{'plural':_0xfab3('0x1b8'),'singular':_0xfab3('0x1b9')},'foreignKey':'TriggerAnyId','onDelete':_0xfab3('0x11f'),'hooks':!![]});db[_0xfab3('0x99')][_0xfab3('0x11a')](db[_0xfab3('0x83')],{'as':_0xfab3('0x1ad'),'foreignKey':_0xfab3('0x1ba'),'onDelete':_0xfab3('0x11f'),'hooks':!![]});db[_0xfab3('0x1b3')][_0xfab3('0x11a')](db['AnalyticFieldReport'],{'as':_0xfab3('0x1bb'),'onDelete':'cascade','foreignKey':_0xfab3('0x1b4'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xfab3('0xa6')],{'as':'Fields','onDelete':_0xfab3('0x11f'),'foreignKey':'DefaultReportId'});db[_0xfab3('0xa4')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1bc')});db[_0xfab3('0xa6')][_0xfab3('0x129')](db[_0xfab3('0xa4')],{'foreignKey':_0xfab3('0x1bc')});db[_0xfab3('0xa9')]['hasMany'](db[_0xfab3('0x1bd')],{'as':_0xfab3('0x1be'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0x1bd')]['hasMany'](db[_0xfab3('0x1c0')],{'as':_0xfab3('0x1c1'),'onDelete':_0xfab3('0x11f'),'foreignKey':'SubjectId'});db[_0xfab3('0x1bd')][_0xfab3('0x11a')](db[_0xfab3('0x1c0')],{'as':_0xfab3('0x1c2'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0x1bd')][_0xfab3('0x11a')](db['SalesforceField'],{'as':_0xfab3('0x1bb'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0x1bd')][_0xfab3('0x129')](db[_0xfab3('0xa9')],{'as':'Account','foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0x1c0')][_0xfab3('0x11a')](db[_0xfab3('0x1c0')],{'as':_0xfab3('0x1c5'),'foreignKey':'SubjectId'});db[_0xfab3('0x1c0')][_0xfab3('0x11a')](db[_0xfab3('0x1c0')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0x1c0')][_0xfab3('0x11a')](db[_0xfab3('0x1c0')],{'as':'Field','foreignKey':_0xfab3('0x1c4')});db['SalesforceField'][_0xfab3('0x129')](db['Variable'],{'as':_0xfab3('0x1c7'),'foreignKey':'VariableId'});db[_0xfab3('0xac')][_0xfab3('0x11a')](db[_0xfab3('0xae')],{'as':_0xfab3('0x1be'),'onDelete':'cascade','foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xae')][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xae')][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':_0xfab3('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':_0xfab3('0x1bb'),'onDelete':_0xfab3('0x11f'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xfab3('0x129')](db['SugarcrmAccount'],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xb0')][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':'Subject','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xb0')][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db['SugarcrmField'][_0xfab3('0x11a')](db[_0xfab3('0xb0')],{'as':_0xfab3('0x1c9'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':'VariableId'});db[_0xfab3('0xb2')]['hasMany'](db[_0xfab3('0x1ca')],{'as':_0xfab3('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db['DeskConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0xb5')],{'as':_0xfab3('0x1c1'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c8')});db['DeskConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0xb5')],{'as':'Descriptions','onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c3')});db['DeskConfiguration'][_0xfab3('0x11a')](db['DeskField'],{'as':_0xfab3('0x1bb'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0x1ca')][_0xfab3('0x129')](db[_0xfab3('0xb2')],{'as':_0xfab3('0x177'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x1cb')});db['DeskField'][_0xfab3('0x11a')](db[_0xfab3('0xb5')],{'as':'Subject','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xb5')]['hasMany'](db[_0xfab3('0xb5')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xb5')][_0xfab3('0x11a')](db['DeskField'],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xb5')][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':_0xfab3('0x1cc')});db['ZohoAccount'][_0xfab3('0x11a')](db[_0xfab3('0xb7')],{'as':_0xfab3('0x1be'),'onDelete':_0xfab3('0x11f'),'foreignKey':'AccountId'});db[_0xfab3('0xb7')][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':_0xfab3('0x1c1'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c8')});db['ZohoConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':_0xfab3('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':_0xfab3('0x1bb'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xb7')]['belongsTo'](db['ZohoAccount'],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xb9')][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':'Subject','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xb9')][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db['ZohoField'][_0xfab3('0x11a')](db[_0xfab3('0xb9')],{'as':_0xfab3('0x1c9'),'foreignKey':'FieldId'});db['ZohoField'][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':'Variable','foreignKey':_0xfab3('0x1cc')});db['ZendeskAccount']['hasMany'](db[_0xfab3('0xbd')],{'as':_0xfab3('0x1be'),'onDelete':_0xfab3('0x11f'),'foreignKey':'AccountId'});db[_0xfab3('0xbd')][_0xfab3('0x11a')](db[_0xfab3('0x1cd')],{'as':_0xfab3('0x1c1'),'foreignKey':_0xfab3('0x1c8')});db['ZendeskConfiguration'][_0xfab3('0x11a')](db[_0xfab3('0x1cd')],{'as':_0xfab3('0x1c2'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xbd')]['hasMany'](db[_0xfab3('0x1cd')],{'as':_0xfab3('0x1bb'),'foreignKey':'FieldId'});db[_0xfab3('0xbd')][_0xfab3('0x129')](db[_0xfab3('0xbb')],{'as':'Account','foreignKey':'AccountId'});db[_0xfab3('0xbd')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x1ce')});db[_0xfab3('0x1cd')][_0xfab3('0x11a')](db[_0xfab3('0x1cd')],{'as':_0xfab3('0x1c5'),'foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0x1cd')][_0xfab3('0x11a')](db[_0xfab3('0x1cd')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0x1cd')][_0xfab3('0x11a')](db['ZendeskField'],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0x1cd')][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':'VariableId'});db[_0xfab3('0xbf')]['hasMany'](db[_0xfab3('0xc0')],{'as':_0xfab3('0x1be'),'onDelete':'cascade','foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xc0')]['hasMany'](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1c1'),'onDelete':'cascade','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xc0')][_0xfab3('0x11a')](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1c2'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c3')});db['FreshdeskConfiguration']['hasMany'](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1bb'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xc0')]['belongsTo'](db[_0xfab3('0xbf')],{'as':_0xfab3('0x177'),'foreignKey':'AccountId'});db[_0xfab3('0xc0')][_0xfab3('0x12e')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0xfab3('0xc2')][_0xfab3('0x11a')](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1c5'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1c6'),'foreignKey':'DescriptionId'});db[_0xfab3('0xc2')][_0xfab3('0x11a')](db[_0xfab3('0xc2')],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db['FreshdeskField'][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':'Variable','foreignKey':_0xfab3('0x1cc')});db[_0xfab3('0x1cf')][_0xfab3('0x11a')](db[_0xfab3('0xc4')],{'as':'Configurations','onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xc4')][_0xfab3('0x11a')](db[_0xfab3('0xc6')],{'as':_0xfab3('0x1c1'),'foreignKey':'SubjectId'});db[_0xfab3('0xc4')][_0xfab3('0x11a')](db['VtigerField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xfab3('0xc4')][_0xfab3('0x11a')](db[_0xfab3('0xc6')],{'as':_0xfab3('0x1bb'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0xfab3('0x1cf')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xc6')][_0xfab3('0x11a')](db[_0xfab3('0xc6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfab3('0xc6')]['hasMany'](db[_0xfab3('0xc6')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xc6')][_0xfab3('0x11a')](db[_0xfab3('0xc6')],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db['VtigerField'][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':_0xfab3('0x1cc')});db['ServicenowAccount']['hasMany'](db[_0xfab3('0xca')],{'as':_0xfab3('0x1be'),'onDelete':_0xfab3('0x11f'),'foreignKey':'AccountId'});db[_0xfab3('0xca')][_0xfab3('0x11a')](db[_0xfab3('0xcc')],{'as':'Subjects','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xca')][_0xfab3('0x11a')](db[_0xfab3('0xcc')],{'as':_0xfab3('0x1c2'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xca')][_0xfab3('0x11a')](db[_0xfab3('0xcc')],{'as':_0xfab3('0x1bb'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xca')]['belongsTo'](db['ServicenowAccount'],{'as':_0xfab3('0x177'),'foreignKey':'AccountId'});db[_0xfab3('0xcc')]['hasMany'](db[_0xfab3('0xcc')],{'as':_0xfab3('0x1c5'),'foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xcc')][_0xfab3('0x11a')](db[_0xfab3('0xcc')],{'as':'Description','foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xcc')][_0xfab3('0x11a')](db['ServicenowField'],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xcc')][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':_0xfab3('0x1cc')});db[_0xfab3('0xce')][_0xfab3('0x11a')](db[_0xfab3('0x1d0')],{'as':'Configurations','onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0x1d0')]['hasMany'](db[_0xfab3('0xd1')],{'as':_0xfab3('0x1c1'),'onDelete':'cascade','foreignKey':_0xfab3('0x1c8')});db['Dynamics365Configuration'][_0xfab3('0x11a')](db[_0xfab3('0xd1')],{'as':_0xfab3('0x1c2'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1c3')});db['Dynamics365Configuration'][_0xfab3('0x11a')](db[_0xfab3('0xd1')],{'as':_0xfab3('0x1bb'),'onDelete':'cascade','foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0x1d0')]['belongsTo'](db[_0xfab3('0xce')],{'as':_0xfab3('0x177'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0xfab3('0x11a')](db[_0xfab3('0xd1')],{'as':'Subject','foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xd1')]['hasMany'](db[_0xfab3('0xd1')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xd1')][_0xfab3('0x11a')](db[_0xfab3('0xd1')],{'as':_0xfab3('0x1c9'),'foreignKey':_0xfab3('0x1c4')});db['Dynamics365Field']['belongsTo'](db[_0xfab3('0x1c7')],{'as':'Variable','foreignKey':_0xfab3('0x1cc')});db[_0xfab3('0xd3')][_0xfab3('0x11a')](db[_0xfab3('0xd5')],{'as':_0xfab3('0x1be'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x1bf')});db[_0xfab3('0xd5')][_0xfab3('0x11a')](db[_0xfab3('0xd7')],{'as':_0xfab3('0x1c1'),'foreignKey':_0xfab3('0x1c8')});db[_0xfab3('0xd5')][_0xfab3('0x11a')](db[_0xfab3('0xd7')],{'as':_0xfab3('0x1c2'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xd5')]['hasMany'](db[_0xfab3('0xd7')],{'as':_0xfab3('0x1bb'),'foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xd5')][_0xfab3('0x129')](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xfab3('0xd7')]['hasMany'](db[_0xfab3('0xd7')],{'as':_0xfab3('0x1c5'),'foreignKey':'SubjectId'});db[_0xfab3('0xd7')][_0xfab3('0x11a')](db[_0xfab3('0xd7')],{'as':_0xfab3('0x1c6'),'foreignKey':_0xfab3('0x1c3')});db[_0xfab3('0xd7')][_0xfab3('0x11a')](db[_0xfab3('0xd7')],{'as':'Field','foreignKey':_0xfab3('0x1c4')});db[_0xfab3('0xd7')][_0xfab3('0x129')](db[_0xfab3('0x1c7')],{'as':_0xfab3('0x1c7'),'foreignKey':_0xfab3('0x1cc')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0xfab3('0xdb')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0xdb')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':'Contact','foreignKey':_0xfab3('0x16c')});db[_0xfab3('0xdb')]['belongsTo'](db[_0xfab3('0x6f')],{});db[_0xfab3('0xdb')][_0xfab3('0x129')](db[_0xfab3('0x70')],{});db[_0xfab3('0xdb')][_0xfab3('0x129')](db[_0xfab3('0x13')],{});db[_0xfab3('0xdb')]['belongsTo'](db[_0xfab3('0x13b')],{});db[_0xfab3('0xdd')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x11f'),'foreignKey':'FromId'});db[_0xfab3('0xdd')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x11f'),'foreignKey':'ToId'});db['JscriptySessionReport']['hasMany'](db[_0xfab3('0xe1')],{'foreignKey':_0xfab3('0x1d1'),'onDelete':'cascade'});db['JscriptySessionReport'][_0xfab3('0x11a')](db[_0xfab3('0xdf')],{'foreignKey':_0xfab3('0x1d1'),'onDelete':_0xfab3('0x11f')});db[_0xfab3('0x1d2')][_0xfab3('0x129')](db[_0xfab3('0x5a')],{});db[_0xfab3('0x1d2')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xfab3('0x173')});db[_0xfab3('0x1d2')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db['SmsQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x5e')],{});db['SmsQueueReport'][_0xfab3('0x129')](db[_0xfab3('0x5f')],{});db['SmsQueueReport']['belongsTo'](db[_0xfab3('0x13')],{});db[_0xfab3('0x1d2')][_0xfab3('0x129')](db[_0xfab3('0x60')],{});db['JscriptyProject'][_0xfab3('0x11a')](db[_0xfab3('0xe3')],{'foreignKey':_0xfab3('0x1d3')});db[_0xfab3('0xe8')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xfab3('0x1d3')});db[_0xfab3('0xe8')][_0xfab3('0x11a')](db[_0xfab3('0xdf')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'through':_0xfab3('0x151')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':'Agents','through':_0xfab3('0x132')});db[_0xfab3('0xee')]['belongsToMany'](db[_0xfab3('0x1d')],{'through':_0xfab3('0x1d4'),'as':_0xfab3('0x139')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db[_0xfab3('0x41')],{'through':_0xfab3('0x1d5'),'as':_0xfab3('0x13a')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db[_0xfab3('0x13b')],{'through':_0xfab3('0x19c'),'as':_0xfab3('0x13c')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db['FaxQueue'],{'through':_0xfab3('0x18a'),'as':_0xfab3('0x1d6')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db[_0xfab3('0x60')],{'through':_0xfab3('0x190'),'as':_0xfab3('0x13f')});db['Team'][_0xfab3('0x12e')](db[_0xfab3('0x68')],{'through':'team_has_openchannel_queues','as':_0xfab3('0x140')});db[_0xfab3('0xee')][_0xfab3('0x12e')](db[_0xfab3('0x114')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xfab3('0x1a3')][_0xfab3('0x11a')](db[_0xfab3('0x7b')],{'as':'Hoppers','foreignKey':_0xfab3('0x1a4')});db['Campaign']['hasMany'](db[_0xfab3('0x15a')],{'as':_0xfab3('0x120'),'foreignKey':_0xfab3('0x1a4')});db[_0xfab3('0x1a3')][_0xfab3('0x11a')](db[_0xfab3('0x7e')],{'as':_0xfab3('0x15b'),'foreignKey':_0xfab3('0x1a4')});db['Campaign']['hasMany'](db[_0xfab3('0x1a6')],{'as':_0xfab3('0x15c'),'foreignKey':_0xfab3('0x1a4')});db[_0xfab3('0x1a3')][_0xfab3('0x129')](db[_0xfab3('0x2d')],{'as':_0xfab3('0x2d'),'foreignKey':_0xfab3('0x15e')});db[_0xfab3('0x1a3')][_0xfab3('0x129')](db[_0xfab3('0x2d')],{'as':_0xfab3('0x1d7'),'foreignKey':_0xfab3('0x1d8')});db['Campaign'][_0xfab3('0x129')](db[_0xfab3('0x180')],{'as':_0xfab3('0x180'),'foreignKey':_0xfab3('0x15f')});db['Campaign'][_0xfab3('0x129')](db['SquareProject'],{'as':_0xfab3('0x14f'),'foreignKey':_0xfab3('0x1d9')});db['Campaign'][_0xfab3('0x12e')](db[_0xfab3('0x100')],{'as':'Lists','through':_0xfab3('0x1da')});db[_0xfab3('0x1a3')][_0xfab3('0x12e')](db['CmList'],{'as':_0xfab3('0x163'),'through':_0xfab3('0x1db')});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x47')],{});db['MailTransferReport'][_0xfab3('0x129')](db['MailInteraction'],{});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'foreignKey':_0xfab3('0x1dc'),'as':_0xfab3('0x1dd')});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1de'),'as':_0xfab3('0x1df')});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1e0'),'as':'ToAgent'});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x41')],{'foreignKey':'ToMailQueueId','as':_0xfab3('0x1e1')});db[_0xfab3('0xf8')][_0xfab3('0x129')](db[_0xfab3('0x3f')],{'foreignKey':'ToMailAccountId','as':_0xfab3('0x1e2')});db[_0xfab3('0xfa')]['belongsTo'](db['ChatMessage'],{});db[_0xfab3('0xfa')][_0xfab3('0x129')](db[_0xfab3('0x6f')],{});db[_0xfab3('0xfa')][_0xfab3('0x129')](db[_0xfab3('0x145')],{'foreignKey':_0xfab3('0x1e3'),'as':'FromAccount'});db[_0xfab3('0xfa')][_0xfab3('0x129')](db['User'],{'foreignKey':_0xfab3('0x1de'),'as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1e0'),'as':_0xfab3('0x1e4')});db[_0xfab3('0xfa')][_0xfab3('0x129')](db[_0xfab3('0x13b')],{'foreignKey':'ToChatQueueId','as':_0xfab3('0x1e1')});db[_0xfab3('0xfa')][_0xfab3('0x129')](db[_0xfab3('0x145')],{'foreignKey':_0xfab3('0x1e5'),'as':_0xfab3('0x1e2')});db[_0xfab3('0xfc')][_0xfab3('0x129')](db['FaxMessage'],{});db[_0xfab3('0xfc')][_0xfab3('0x129')](db[_0xfab3('0x125')],{});db[_0xfab3('0xfc')][_0xfab3('0x129')](db[_0xfab3('0x51')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':'FromUserId','as':_0xfab3('0x1df')});db['FaxTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1e0'),'as':_0xfab3('0x1e4')});db[_0xfab3('0xfc')][_0xfab3('0x129')](db[_0xfab3('0x13e')],{'foreignKey':_0xfab3('0x1e6'),'as':'ToQueue'});db[_0xfab3('0xfc')][_0xfab3('0x129')](db[_0xfab3('0x51')],{'foreignKey':_0xfab3('0x1e7'),'as':_0xfab3('0x1e2')});db[_0xfab3('0xfd')][_0xfab3('0x129')](db[_0xfab3('0x66')],{});db[_0xfab3('0xfd')][_0xfab3('0x129')](db['OpenchannelInteraction'],{});db[_0xfab3('0xfd')][_0xfab3('0x129')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xfab3('0x1dd')});db[_0xfab3('0xfd')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1de'),'as':_0xfab3('0x1df')});db[_0xfab3('0xfd')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1e0'),'as':_0xfab3('0x1e4')});db[_0xfab3('0xfd')][_0xfab3('0x129')](db[_0xfab3('0x68')],{'foreignKey':_0xfab3('0x1e8'),'as':_0xfab3('0x1e1')});db[_0xfab3('0xfd')][_0xfab3('0x129')](db[_0xfab3('0x62')],{'foreignKey':_0xfab3('0x1e9'),'as':_0xfab3('0x1e2')});db['SmsTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x5f')],{});db[_0xfab3('0xff')][_0xfab3('0x129')](db[_0xfab3('0x5e')],{});db[_0xfab3('0xff')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xfab3('0x1ea'),'as':_0xfab3('0x1dd')});db[_0xfab3('0xff')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1de'),'as':_0xfab3('0x1df')});db[_0xfab3('0xff')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'foreignKey':_0xfab3('0x1e0'),'as':_0xfab3('0x1e4')});db[_0xfab3('0xff')]['belongsTo'](db[_0xfab3('0x60')],{'foreignKey':_0xfab3('0x1eb'),'as':_0xfab3('0x1e1')});db[_0xfab3('0xff')][_0xfab3('0x129')](db[_0xfab3('0x5a')],{'foreignKey':_0xfab3('0x1ec'),'as':'ToAccount'});db[_0xfab3('0x100')][_0xfab3('0x11a')](db[_0xfab3('0x183')],{'as':'Dispositions','foreignKey':'ListId'});db[_0xfab3('0x100')][_0xfab3('0x11a')](db[_0xfab3('0x82')],{'as':_0xfab3('0x1ed'),'foreignKey':_0xfab3('0x173')});db['CmList'][_0xfab3('0x11a')](db[_0xfab3('0x79')],{'as':_0xfab3('0x19e'),'onDelete':_0xfab3('0x11f'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x100')][_0xfab3('0x11a')](db[_0xfab3('0x15a')],{'as':_0xfab3('0x120'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x100')][_0xfab3('0x11a')](db[_0xfab3('0x7e')],{'as':'HopperHistory','foreignKey':_0xfab3('0x173')});db[_0xfab3('0x100')][_0xfab3('0x11a')](db['ReportAgentPreview'],{'as':_0xfab3('0x80'),'foreignKey':'ListId'});db[_0xfab3('0x100')][_0xfab3('0x12e')](db[_0xfab3('0x1d')],{'as':_0xfab3('0x1ee'),'through':_0xfab3('0x1ef')});db[_0xfab3('0x100')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':'Agents','through':_0xfab3('0x131')});db[_0xfab3('0x102')][_0xfab3('0x11a')](db['VoiceExtension'],{'as':_0xfab3('0x11e'),'onDelete':'cascade'});db[_0xfab3('0x102')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':_0xfab3('0x144')});db['UserProfile'][_0xfab3('0x11a')](db[_0xfab3('0x13')],{'as':_0xfab3('0x17c'),'foreignKey':_0xfab3('0x12a')});db[_0xfab3('0x104')]['hasMany'](db['UserProfileSection'],{'as':_0xfab3('0x1f0'),'foreignKey':'userProfileId','onDelete':_0xfab3('0x11f')});db[_0xfab3('0x105')][_0xfab3('0x11a')](db[_0xfab3('0x107')],{'as':'Resources','foreignKey':_0xfab3('0x1f1'),'onDelete':'cascade'});db[_0xfab3('0x10b')][_0xfab3('0x11a')](db['Disposition'],{'as':_0xfab3('0x170'),'foreignKey':_0xfab3('0x1f2')});db[_0xfab3('0x10b')][_0xfab3('0x11a')](db[_0xfab3('0x87')],{'as':_0xfab3('0x171'),'foreignKey':_0xfab3('0x1f2')});db[_0xfab3('0x10b')][_0xfab3('0x11a')](db[_0xfab3('0x110')],{'as':_0xfab3('0x165'),'foreignKey':_0xfab3('0x1f2')});db[_0xfab3('0x10b')][_0xfab3('0x11a')](db['WhatsappInteraction'],{'as':_0xfab3('0x18c')});db[_0xfab3('0x10b')]['hasMany'](db['WhatsappApplication'],{'as':_0xfab3('0x154')});db[_0xfab3('0x10b')]['belongsTo'](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':'ListId'});db[_0xfab3('0x10b')][_0xfab3('0x129')](db[_0xfab3('0x8d')],{'as':_0xfab3('0x160'),'foreignKey':_0xfab3('0x161')});db[_0xfab3('0x10b')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':'user_has_whatsapp_accounts'});db[_0xfab3('0x10c')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x10c')][_0xfab3('0x129')](db['WhatsappQueue'],{'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x10c')]['belongsTo'](db[_0xfab3('0x10b')],{'onDelete':_0xfab3('0x17f')});db[_0xfab3('0x10c')]['belongsTo'](db['Interval'],{'onDelete':_0xfab3('0x17f'),'foreignKey':_0xfab3('0x15f')});db[_0xfab3('0x10c')]['belongsTo'](db[_0xfab3('0x95')],{'onDelete':'restrict','foreignKey':_0xfab3('0x181')});db[_0xfab3('0x10e')]['hasMany'](db['WhatsappMessage'],{'as':_0xfab3('0x165'),'onDelete':'cascade','foreignKey':_0xfab3('0x1f3')});db[_0xfab3('0x10e')][_0xfab3('0x129')](db[_0xfab3('0x10b')],{'as':_0xfab3('0x177'),'foreignKey':_0xfab3('0x1f2')});db[_0xfab3('0x10e')]['belongsTo'](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x10e')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'as':'Owner','foreignKey':_0xfab3('0x119')});db[_0xfab3('0x10e')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x1f4'),'as':_0xfab3('0x17a')});db[_0xfab3('0x10e')][_0xfab3('0x12e')](db[_0xfab3('0x95')],{'through':_0xfab3('0x1f4'),'as':_0xfab3('0x17b')});db[_0xfab3('0x10e')][_0xfab3('0x12e')](db['User'],{'as':_0xfab3('0x17c'),'through':_0xfab3('0x138'),'foreignKey':_0xfab3('0x1f3')});db[_0xfab3('0x110')][_0xfab3('0x129')](db[_0xfab3('0x13')],{'as':_0xfab3('0x13')});db[_0xfab3('0x110')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'onDelete':'cascade','as':_0xfab3('0x16b')});db[_0xfab3('0x110')][_0xfab3('0x129')](db[_0xfab3('0x10e')],{'onDelete':_0xfab3('0x11f'),'as':_0xfab3('0x188'),'foreignKey':'WhatsappInteractionId'});db[_0xfab3('0x110')]['belongsTo'](db[_0xfab3('0x10b')],{'as':'Account','foreignKey':_0xfab3('0x1f2')});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x10b')],{});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x100')],{'as':_0xfab3('0x172'),'foreignKey':_0xfab3('0x173')});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x79')],{'as':_0xfab3('0x16b'),'foreignKey':_0xfab3('0x16c')});db[_0xfab3('0x112')][_0xfab3('0x129')](db['WhatsappInteraction'],{});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x114')],{});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x110')],{});db[_0xfab3('0x112')][_0xfab3('0x129')](db[_0xfab3('0x13')],{});db['WhatsappTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x110')],{});db[_0xfab3('0x113')][_0xfab3('0x129')](db['WhatsappInteraction'],{});db[_0xfab3('0x113')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xfab3('0x1dd')});db['WhatsappTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x10b')],{'foreignKey':'ToWhatsappAccountId','as':_0xfab3('0x1e2')});db['WhatsappTransferReport'][_0xfab3('0x129')](db[_0xfab3('0x114')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0xfab3('0x113')]['belongsTo'](db[_0xfab3('0x13')],{'foreignKey':'FromUserId','as':_0xfab3('0x1df')});db[_0xfab3('0x113')][_0xfab3('0x129')](db['User'],{'foreignKey':_0xfab3('0x1e0'),'as':'ToAgent'});db[_0xfab3('0x114')][_0xfab3('0x12e')](db[_0xfab3('0x13')],{'as':_0xfab3('0x175'),'through':_0xfab3('0x142'),'foreignKey':'WhatsappQueueId'});db[_0xfab3('0x114')][_0xfab3('0x12e')](db[_0xfab3('0xee')],{'through':_0xfab3('0x1f5'),'as':_0xfab3('0x162')});module[_0xfab3('0x1f6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x51f2=['../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','VoiceMail','UserId','hasMany','VoiceRecording','VoiceExtension','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','FaxQueues','UserFaxQueue','SmsQueue','SmsQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceCallReport','uniqueid','ContactId','MailAccountId','hasOne','MailServerIn','Imap','Smtp','Dispositions','Interactions','List','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','restrict','IntervalId','TagId','ListId','Items','FaxAccountId','Answers','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','CmHopper','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Fields','MetricId','Configurations','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Variable','VariableId','SugarcrmAccount','Description','Field','int_desk_configuration_has_tags','ZohoField','Subjects','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Account','FreshsalesField','FromId','SessionId','ProjectId','MailQueues','ChatQueues','team_has_whatsapp_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','ToQueueId','UserWhatsappQueue','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','motion2','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Integration','../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/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction'];(function(_0x160c72,_0x54a499){var _0x4a5192=function(_0x433457){while(--_0x433457){_0x160c72['push'](_0x160c72['shift']());}};_0x4a5192(++_0x54a499);}(_0x51f2,0xeb));var _0x251f=function(_0x279268,_0x3f4dd2){_0x279268=_0x279268-0x0;var _0x5e8650=_0x51f2[_0x279268];return _0x5e8650;};'use strict';var path=require(_0x251f('0x0'));var config=require(_0x251f('0x1'));var Sequelize=require(_0x251f('0x2'));var _=require(_0x251f('0x3'));var jstz=require(_0x251f('0x4'));var timezone=jstz[_0x251f('0x5')]();config[_0x251f('0x2')]=_[_0x251f('0x6')](config[_0x251f('0x2')],{'database':'motion2','username':_0x251f('0x7'),'password':_0x251f('0x8'),'options':{'host':_0x251f('0x9'),'port':0xcea,'dialect':_0x251f('0xa'),'dialectOptions':{'charset':_0x251f('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x251f('0xc'),'collate':_0x251f('0xd')}}});config[_0x251f('0xe')]=_[_0x251f('0x6')](config['sequelizeHistory'],{'database':_0x251f('0xf'),'username':_0x251f('0x7'),'password':_0x251f('0x8'),'options':{'host':_0x251f('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x251f('0xb')},'logging':![],'timezone':timezone[_0x251f('0x10')](),'define':{'charset':_0x251f('0xc'),'collate':_0x251f('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x251f('0x11')],config[_0x251f('0x2')][_0x251f('0x12')],config[_0x251f('0x2')][_0x251f('0x13')],config[_0x251f('0x2')][_0x251f('0x14')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x251f('0xe')][_0x251f('0x11')],config[_0x251f('0xe')][_0x251f('0x12')],config['sequelizeHistory'][_0x251f('0x13')],config[_0x251f('0xe')]['options'])};db[_0x251f('0x15')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x17'));db[_0x251f('0x18')]=db['sequelize']['import'](_0x251f('0x19'));db[_0x251f('0x1a')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x1b'));db['VoiceExtension']=db[_0x251f('0x2')][_0x251f('0x16')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x1c'));db[_0x251f('0x1d')]=db[_0x251f('0x2')]['import'](_0x251f('0x1e'));db['VoiceRecording']=db['sequelize'][_0x251f('0x16')](_0x251f('0x1f'));db['ScreenRecording']=db['sequelize'][_0x251f('0x16')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x20'));db['VoiceMailMessage']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x21'));db['VoiceCallReport']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x22'));db[_0x251f('0x23')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x24'));db[_0x251f('0x25')]=db[_0x251f('0x2')]['import'](_0x251f('0x26'));db[_0x251f('0x27')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x28'));db[_0x251f('0x29')]=db['sequelize']['import']('../api/memberReport/memberReport.model');db[_0x251f('0x2a')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x2b'));db['VoiceTransferReport']=db[_0x251f('0x2')][_0x251f('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x251f('0x2c')]=db[_0x251f('0x2')]['import'](_0x251f('0x2d'));db['UserVoiceQueue']=db[_0x251f('0x2')]['import'](_0x251f('0x2e'));db[_0x251f('0x2f')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x30'));db[_0x251f('0x31')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x32'));db['UserFaxQueue']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x33'));db[_0x251f('0x34')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x35'));db[_0x251f('0x36')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x37'));db['UserWhatsappQueue']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x38'));db['MailServerIn']=db[_0x251f('0x2')]['import'](_0x251f('0x39'));db[_0x251f('0x3a')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x3b'));db[_0x251f('0x3c')]=db[_0x251f('0x2')]['import'](_0x251f('0x3d'));db[_0x251f('0x3e')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x3f'));db[_0x251f('0x40')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/mailInteraction/mailInteraction.model');db[_0x251f('0x41')]=db['sequelize'][_0x251f('0x16')]('../api/mailMessage/mailMessage.model');db[_0x251f('0x42')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x43'));db[_0x251f('0x44')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x45'));db[_0x251f('0x46')]=db['sequelize']['import'](_0x251f('0x47'));db[_0x251f('0x48')]=db['sequelize'][_0x251f('0x16')]('../api/dashboardItem/dashboardItem.model');db[_0x251f('0x49')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x4a'));db[_0x251f('0x4b')]=db[_0x251f('0x2')]['import']('../api/faxApplication/faxApplication.model');db[_0x251f('0x4c')]=db[_0x251f('0x2')]['import'](_0x251f('0x4d'));db[_0x251f('0x4e')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x4f'));db[_0x251f('0x50')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x51'));db[_0x251f('0x52')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x53'));db['SmsAccount']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x54'));db[_0x251f('0x55')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x56'));db[_0x251f('0x57')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x58'));db[_0x251f('0x59')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x5a'));db['SmsQueue']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x5b'));db[_0x251f('0x5c')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/openchannelAccount/openchannelAccount.model');db[_0x251f('0x5d')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x5e'));db['OpenchannelInteraction']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x5f'));db[_0x251f('0x60')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x61'));db[_0x251f('0x62')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/openchannelQueue/openchannelQueue.model');db[_0x251f('0x63')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/chatWebsite/chatWebsite.model');db[_0x251f('0x64')]=db[_0x251f('0x2')]['import'](_0x251f('0x65'));db[_0x251f('0x66')]=db['sequelize']['import'](_0x251f('0x67'));db['ChatInteraction']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x68'));db[_0x251f('0x69')]=db[_0x251f('0x2')]['import']('../api/chatMessage/chatMessage.model');db[_0x251f('0x6a')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x6b'));db[_0x251f('0x6c')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x6d'));db[_0x251f('0x6e')]=db[_0x251f('0x2')]['import'](_0x251f('0x6f'));db[_0x251f('0x70')]=db[_0x251f('0x2')]['import'](_0x251f('0x71'));db['CmCompany']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x72'));db[_0x251f('0x73')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x74'));db['CmHopper']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x75'));db[_0x251f('0x76')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x251f('0x77')]=db['sequelize']['import'](_0x251f('0x78'));db[_0x251f('0x79')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x7a'));db[_0x251f('0x7b')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x7c'));db[_0x251f('0x7d')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x7e'));db[_0x251f('0x7f')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x80'));db[_0x251f('0x81')]=db[_0x251f('0x2')]['import'](_0x251f('0x82'));db[_0x251f('0x83')]=db['sequelize'][_0x251f('0x16')]('../api/cannedAnswer/cannedAnswer.model');db[_0x251f('0x84')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x85'));db[_0x251f('0x86')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/condition/condition.model');db[_0x251f('0x87')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x88'));db[_0x251f('0x89')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x8a'));db[_0x251f('0x8b')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x8c'));db[_0x251f('0x8d')]=db[_0x251f('0x2')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0x251f('0x16')](_0x251f('0x8e'));db[_0x251f('0x8f')]=db[_0x251f('0x2')]['import']('../api/sound/sound.model');db[_0x251f('0x90')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x91'));db[_0x251f('0x92')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x93'));db[_0x251f('0x94')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/trigger/trigger.model');db['Variable']=db[_0x251f('0x2')]['import']('../api/variable/variable.model');db[_0x251f('0x95')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x96'));db['IntegrationReport']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x97'));db[_0x251f('0x98')]=db[_0x251f('0x2')]['import'](_0x251f('0x99'));db[_0x251f('0x9a')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x9b'));db[_0x251f('0x9c')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x9d'));db[_0x251f('0x9e')]=db['sequelize'][_0x251f('0x16')](_0x251f('0x9f'));db[_0x251f('0xa0')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0x251f('0x16')](_0x251f('0xa1'));db[_0x251f('0xa2')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xa3'));db[_0x251f('0xa4')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xa5'));db[_0x251f('0xa6')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x251f('0x2')]['import'](_0x251f('0xa7'));db[_0x251f('0xa8')]=db['sequelize'][_0x251f('0x16')](_0x251f('0xa9'));db[_0x251f('0xaa')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xab'));db[_0x251f('0xac')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intDeskAccount/intDeskAccount.model');db[_0x251f('0xad')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xae'));db[_0x251f('0xaf')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intDeskField/intDeskField.model');db[_0x251f('0xb0')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xb1'));db[_0x251f('0xb2')]=db['sequelize'][_0x251f('0x16')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intZohoField/intZohoField.model');db[_0x251f('0xb3')]=db['sequelize'][_0x251f('0x16')](_0x251f('0xb4'));db[_0x251f('0xb5')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xb6'));db['ZendeskField']=db[_0x251f('0x2')]['import'](_0x251f('0xb7'));db['FreshdeskAccount']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xb8'));db[_0x251f('0xb9')]=db[_0x251f('0x2')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x251f('0xba')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xbb'));db[_0x251f('0xbc')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xbd'));db[_0x251f('0xbe')]=db[_0x251f('0x2')]['import'](_0x251f('0xbf'));db[_0x251f('0xc0')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xc1'));db['ServicenowAccount']=db['sequelize']['import'](_0x251f('0xc2'));db[_0x251f('0xc3')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x251f('0xc4')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db['sequelize'][_0x251f('0x16')](_0x251f('0xc5'));db[_0x251f('0xc6')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x251f('0xc7')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x251f('0xc8')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xc9'));db[_0x251f('0xca')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xcb'));db['FreshsalesField']=db['sequelize'][_0x251f('0x16')](_0x251f('0xcc'));db[_0x251f('0x95')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x96'));db['Network']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xcd'));db[_0x251f('0xce')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/chatQueueReport/chatQueueReport.model');db[_0x251f('0xcf')]=db[_0x251f('0x2')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x251f('0xd0')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x251f('0xd1')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xd2'));db[_0x251f('0xd3')]=db[_0x251f('0x2')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x251f('0xd4')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xd5'));db[_0x251f('0xd6')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xd7'));db[_0x251f('0xd8')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/squareReportDetail/squareReportDetail.model');db[_0x251f('0xd9')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xda'));db[_0x251f('0xdb')]=db[_0x251f('0x2')]['import'](_0x251f('0xdc'));db[_0x251f('0xdd')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xde'));db[_0x251f('0xdf')]=db['sequelize'][_0x251f('0x16')](_0x251f('0xe0'));db['SquareRecording']=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xe1'));db[_0x251f('0xe2')]=db[_0x251f('0x2')]['import'](_0x251f('0xe3'));db[_0x251f('0xe4')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/team/team.model');db[_0x251f('0xe5')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xe6'));db[_0x251f('0xe7')]=db[_0x251f('0x2')]['import'](_0x251f('0xe8'));db[_0x251f('0xe9')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xea'));db[_0x251f('0xeb')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/attachment/attachment.model');db[_0x251f('0xec')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize']['import'](_0x251f('0xed'));db[_0x251f('0xee')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xef'));db[_0x251f('0xf0')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xf1'));db[_0x251f('0xf2')]=db['sequelize'][_0x251f('0x16')](_0x251f('0xf3'));db[_0x251f('0xf4')]=db[_0x251f('0x2')]['import'](_0x251f('0xf5'));db[_0x251f('0xf6')]=db[_0x251f('0x2')]['import']('../api/cmList/cmList.model');db[_0x251f('0xf7')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0xf8'));db[_0x251f('0xf9')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0x251f('0xfa')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db['sequelize'][_0x251f('0x16')]('../api/userProfileResource/userProfileResource.model');db[_0x251f('0xfb')]=db['sequelize'][_0x251f('0x16')](_0x251f('0xfc'));db[_0x251f('0xfd')]=db[_0x251f('0x2')]['import'](_0x251f('0xfe'));db[_0x251f('0xff')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x100'));db[_0x251f('0x101')]=db['sequelize'][_0x251f('0x16')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x251f('0x2')][_0x251f('0x16')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db['sequelize'][_0x251f('0x16')](_0x251f('0x102'));db[_0x251f('0x103')]=db['sequelize']['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x251f('0x104')]=db[_0x251f('0x2')][_0x251f('0x16')]('../api/whatsappQueue/whatsappQueue.model');db[_0x251f('0x105')]=db[_0x251f('0x2')][_0x251f('0x16')](_0x251f('0x106'));db[_0x251f('0x15')]['hasOne'](db[_0x251f('0x107')],{'as':_0x251f('0x107'),'onDelete':'cascade','foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x10a')],{'as':'Recordings','foreignKey':'UserId'});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0x251f('0x108')});db[_0x251f('0x15')]['hasMany'](db[_0x251f('0x10b')],{'as':_0x251f('0x10c'),'onDelete':_0x251f('0x10d'),'hooks':!![]});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x77')],{'as':_0x251f('0x10e'),'foreignKey':'UserId'});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x79')],{'as':_0x251f('0x10f'),'foreignKey':'UserId'});db['User'][_0x251f('0x109')](db['ReportAgentPreview'],{'as':_0x251f('0x7b'),'foreignKey':_0x251f('0x108')});db['User'][_0x251f('0x109')](db[_0x251f('0x110')],{'as':'OpenchannelInteractions','foreignKey':_0x251f('0x108')});db['User']['hasMany'](db[_0x251f('0x111')],{'as':_0x251f('0x112'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x57')],{'as':_0x251f('0x113'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x4c')],{'as':_0x251f('0x114'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db['MailInteraction'],{'as':_0x251f('0x115'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db[_0x251f('0x101')],{'as':_0x251f('0x116'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x15')][_0x251f('0x109')](db['Notification'],{'as':_0x251f('0x117'),'foreignKey':'SenderId'});db[_0x251f('0x15')]['belongsTo'](db[_0x251f('0xf9')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x6e')],{'as':_0x251f('0x119'),'through':_0x251f('0x11a')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x73')],{'as':_0x251f('0x11b'),'through':'cm_user_has_contacts'});db['User'][_0x251f('0x118')](db[_0x251f('0xf6')],{'as':_0x251f('0x11c'),'through':_0x251f('0x11d')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0xe4')],{'through':_0x251f('0x11e')});db['User'][_0x251f('0x118')](db[_0x251f('0x40')],{'as':_0x251f('0x115'),'through':_0x251f('0x11f')});db[_0x251f('0x15')]['belongsToMany'](db[_0x251f('0x111')],{'as':_0x251f('0x112'),'through':_0x251f('0x120')});db[_0x251f('0x15')]['belongsToMany'](db[_0x251f('0x4c')],{'as':_0x251f('0x114'),'through':_0x251f('0x121')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x57')],{'as':_0x251f('0x113'),'through':_0x251f('0x122')});db[_0x251f('0x15')][_0x251f('0x118')](db['OpenchannelInteraction'],{'as':_0x251f('0x123'),'through':_0x251f('0x124')});db[_0x251f('0x15')]['belongsToMany'](db[_0x251f('0x101')],{'as':_0x251f('0x116'),'through':_0x251f('0x125')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x1d')],{'as':_0x251f('0x126'),'through':_0x251f('0x127'),'required':![]});db['User'][_0x251f('0x118')](db[_0x251f('0x3e')],{'as':'MailQueues','through':_0x251f('0x31'),'required':![]});db[_0x251f('0x15')][_0x251f('0x118')](db['ChatQueue'],{'as':'ChatQueues','through':_0x251f('0x2f'),'required':![],'hooks':!![]});db[_0x251f('0x15')]['belongsToMany'](db[_0x251f('0x50')],{'as':_0x251f('0x128'),'through':_0x251f('0x129'),'required':![]});db['User'][_0x251f('0x118')](db[_0x251f('0x12a')],{'as':_0x251f('0x12b'),'through':_0x251f('0x34'),'required':![]});db[_0x251f('0x15')]['belongsToMany'](db[_0x251f('0x62')],{'as':_0x251f('0x12c'),'through':'UserOpenchannelQueue','required':![]});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x104')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x251f('0x15')]['belongsToMany'](db['CmList'],{'through':_0x251f('0x11d')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0xf7')],{'as':_0x251f('0x12d'),'through':_0x251f('0x12e'),'required':![]});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x63')],{'as':_0x251f('0x12f'),'through':'user_has_chat_websites'});db[_0x251f('0x15')][_0x251f('0x118')](db['FaxAccount'],{'as':_0x251f('0x130'),'through':'user_has_fax_accounts'});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x3c')],{'as':_0x251f('0x131'),'through':_0x251f('0x132')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x5c')],{'as':_0x251f('0x133'),'through':_0x251f('0x134')});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0x135')],{'as':_0x251f('0x136'),'through':_0x251f('0x137')});db['User'][_0x251f('0x118')](db[_0x251f('0xfd')],{'as':_0x251f('0x138'),'through':'user_has_whatsapp_accounts'});db[_0x251f('0x15')][_0x251f('0x118')](db[_0x251f('0xdf')],{'as':_0x251f('0x139'),'through':_0x251f('0x13a')});db[_0x251f('0x18')]['hasMany'](db['VoiceExtension'],{'as':_0x251f('0x13b'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x13c')});db[_0x251f('0x1a')][_0x251f('0x109')](db[_0x251f('0x10b')],{'onDelete':'cascade'});db[_0x251f('0x10b')][_0x251f('0x109')](db['VoiceExtension'],{'as':_0x251f('0x13d'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x13e')][_0x251f('0x118')](db['Sound'],{'as':_0x251f('0x13f'),'through':_0x251f('0x140')});db[_0x251f('0x1d')][_0x251f('0x109')](db[_0x251f('0x2c')],{'as':_0x251f('0x141'),'foreignKey':'VoiceQueueId'});db[_0x251f('0x1d')][_0x251f('0x109')](db['CmHopper'],{'as':_0x251f('0x142'),'foreignKey':_0x251f('0x143')});db['VoiceQueue'][_0x251f('0x109')](db[_0x251f('0x77')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x251f('0x1d')][_0x251f('0x109')](db['CmHopperHistory'],{'as':_0x251f('0x144'),'foreignKey':_0x251f('0x143')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x251f('0x143')});db[_0x251f('0x1d')][_0x251f('0x109')](db[_0x251f('0x76')],{'as':_0x251f('0x145'),'foreignKey':_0x251f('0x143')});db[_0x251f('0x1d')][_0x251f('0x109')](db[_0x251f('0xd3')],{'as':_0x251f('0x146'),'foreignKey':_0x251f('0x143')});db[_0x251f('0x1d')][_0x251f('0x147')](db['Trunk'],{'as':_0x251f('0x2a'),'foreignKey':_0x251f('0x148')});db['VoiceQueue'][_0x251f('0x147')](db['Trunk'],{'as':_0x251f('0x149'),'foreignKey':_0x251f('0x14a')});db['VoiceQueue'][_0x251f('0x147')](db[_0x251f('0x87')],{'as':_0x251f('0x87'),'foreignKey':'IntervalId'});db[_0x251f('0x1d')][_0x251f('0x147')](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':_0x251f('0x14c')});db[_0x251f('0x1d')][_0x251f('0x118')](db[_0x251f('0xf6')],{'as':_0x251f('0x11c'),'through':_0x251f('0x14d')});db[_0x251f('0x1d')]['belongsToMany'](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x127')});db[_0x251f('0x1d')]['belongsToMany'](db[_0x251f('0xe4')],{'as':_0x251f('0x14f'),'through':_0x251f('0x150')});db[_0x251f('0x1d')][_0x251f('0x118')](db[_0x251f('0xf6')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x251f('0x10a')][_0x251f('0x147')](db['User'],{'as':_0x251f('0x15'),'foreignKey':_0x251f('0x108')});db['ScreenRecording'][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x15'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x107')][_0x251f('0x109')](db[_0x251f('0x151')],{'as':_0x251f('0x152'),'onDelete':'cascade','foreignKey':_0x251f('0x153'),'sourceKey':_0x251f('0x154')});db[_0x251f('0x151')][_0x251f('0x147')](db[_0x251f('0x107')],{'foreignKey':_0x251f('0x153'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x251f('0x109')](db[_0x251f('0x27')],{'as':_0x251f('0x155'),'foreignKey':'uniqueid','constraints':![]});db[_0x251f('0x156')][_0x251f('0x109')](db[_0x251f('0x25')],{'as':'AgentReports','foreignKey':_0x251f('0x157'),'constraints':![]});db[_0x251f('0x156')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x15'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x156')]['belongsTo'](db[_0x251f('0x73')],{'as':'Contact','foreignKey':_0x251f('0x158')});db['MailServerIn']['belongsTo'](db['MailAccount'],{'as':_0x251f('0x3c'),'foreignKey':_0x251f('0x159')});db[_0x251f('0x3a')]['belongsTo'](db['MailAccount'],{'as':_0x251f('0x3c'),'foreignKey':_0x251f('0x159')});db['MailAccount'][_0x251f('0x15a')](db[_0x251f('0x15b')],{'as':_0x251f('0x15c'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x3c')][_0x251f('0x15a')](db[_0x251f('0x3a')],{'as':_0x251f('0x15d'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x3c')][_0x251f('0x109')](db[_0x251f('0x84')],{'as':_0x251f('0x15e'),'foreignKey':_0x251f('0x159')});db['MailAccount'][_0x251f('0x109')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x251f('0x159')});db[_0x251f('0x3c')][_0x251f('0x109')](db[_0x251f('0x41')],{'as':_0x251f('0x152'),'foreignKey':_0x251f('0x159')});db[_0x251f('0x3c')][_0x251f('0x109')](db[_0x251f('0x40')],{'as':_0x251f('0x15f')});db[_0x251f('0x3c')]['hasMany'](db[_0x251f('0x42')],{'as':_0x251f('0x13d')});db[_0x251f('0x3c')]['belongsTo'](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':'ListId'});db[_0x251f('0x3c')][_0x251f('0x147')](db[_0x251f('0x92')],{'as':_0x251f('0x92'),'foreignKey':'TemplateId'});db[_0x251f('0x3c')][_0x251f('0x147')](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':_0x251f('0x14c')});db[_0x251f('0x3c')]['belongsToMany'](db[_0x251f('0x15')],{'as':'Agents','through':_0x251f('0x132')});db['MailQueue'][_0x251f('0x118')](db[_0x251f('0x15')],{'as':'Agents','through':'UserMailQueue'});db[_0x251f('0x3e')][_0x251f('0x118')](db[_0x251f('0xe4')],{'through':_0x251f('0x161'),'as':_0x251f('0x14f')});db[_0x251f('0x40')][_0x251f('0x109')](db['MailMessage'],{'as':_0x251f('0x152'),'onDelete':'cascade','foreignKey':_0x251f('0x162')});db[_0x251f('0x40')][_0x251f('0x147')](db[_0x251f('0x3c')],{'as':_0x251f('0x163'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':'ContactId'});db[_0x251f('0x40')]['belongsTo'](db[_0x251f('0x15')],{'as':_0x251f('0x165'),'foreignKey':'UserId'});db[_0x251f('0x40')]['belongsToMany'](db[_0x251f('0x90')],{'through':_0x251f('0x166'),'as':_0x251f('0x167')});db[_0x251f('0x40')]['belongsToMany'](db[_0x251f('0x90')],{'through':_0x251f('0x166'),'as':_0x251f('0x168')});db['MailInteraction'][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'through':_0x251f('0x11f'),'foreignKey':_0x251f('0x162')});db[_0x251f('0x41')]['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x251f('0x10d')});db[_0x251f('0x41')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x15')});db[_0x251f('0x41')][_0x251f('0x147')](db['CmContact'],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x164')});db[_0x251f('0x41')]['belongsTo'](db[_0x251f('0x40')],{'as':_0x251f('0x16a'),'foreignKey':_0x251f('0x162')});db[_0x251f('0x41')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0x251f('0x42')]['belongsTo'](db[_0x251f('0x15')],{'onDelete':'restrict'});db['MailApplication'][_0x251f('0x147')](db[_0x251f('0x3e')],{'onDelete':_0x251f('0x16b')});db['MailApplication'][_0x251f('0x147')](db[_0x251f('0x3c')],{'onDelete':_0x251f('0x16b')});db[_0x251f('0x42')][_0x251f('0x147')](db[_0x251f('0x87')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16c')});db[_0x251f('0x42')][_0x251f('0x147')](db[_0x251f('0x90')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16d')});db[_0x251f('0x44')][_0x251f('0x147')](db[_0x251f('0x3c')],{});db[_0x251f('0x44')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0x44')][_0x251f('0x147')](db[_0x251f('0x73')],{'as':'Contact','foreignKey':_0x251f('0x158')});db[_0x251f('0x44')][_0x251f('0x147')](db['MailInteraction'],{});db[_0x251f('0x44')]['belongsTo'](db[_0x251f('0x41')],{});db['MailQueueReport'][_0x251f('0x147')](db[_0x251f('0x15')],{});db[_0x251f('0x44')]['belongsTo'](db['MailQueue'],{});db['Dashboard'][_0x251f('0x109')](db[_0x251f('0x48')],{'as':_0x251f('0x16f'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x49')]['hasMany'](db['Disposition'],{'as':_0x251f('0x15e'),'foreignKey':_0x251f('0x170')});db[_0x251f('0x49')][_0x251f('0x109')](db[_0x251f('0x83')],{'as':_0x251f('0x171'),'foreignKey':'FaxAccountId'});db[_0x251f('0x49')]['hasMany'](db[_0x251f('0x4c')],{'as':'Interactions'});db[_0x251f('0x49')]['hasMany'](db[_0x251f('0x4b')],{'as':'Applications'});db[_0x251f('0x49')][_0x251f('0x109')](db[_0x251f('0x10b')],{'as':_0x251f('0x172'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x49')]['hasMany'](db['FaxMessage'],{'as':_0x251f('0x152')});db[_0x251f('0x49')]['belongsTo'](db[_0x251f('0x2a')],{'as':_0x251f('0x2a')});db[_0x251f('0x49')]['belongsTo'](db['CmList'],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db['FaxAccount'][_0x251f('0x147')](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':_0x251f('0x14c')});db[_0x251f('0x49')][_0x251f('0x118')](db['User'],{'as':_0x251f('0x14e'),'through':_0x251f('0x173')});db['FaxApplication'][_0x251f('0x147')](db['User'],{'onDelete':_0x251f('0x16b')});db['FaxApplication'][_0x251f('0x147')](db[_0x251f('0x50')],{'onDelete':_0x251f('0x16b')});db['FaxApplication'][_0x251f('0x147')](db[_0x251f('0x49')],{'onDelete':_0x251f('0x16b')});db[_0x251f('0x4b')][_0x251f('0x147')](db['Tag'],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16d')});db[_0x251f('0x4c')][_0x251f('0x109')](db[_0x251f('0x4e')],{'as':_0x251f('0x152'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x174')});db[_0x251f('0x4c')]['belongsTo'](db[_0x251f('0x49')],{'as':'Account','foreignKey':_0x251f('0x170')});db[_0x251f('0x4c')][_0x251f('0x147')](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x251f('0x147')](db['User'],{'as':'Owner','foreignKey':_0x251f('0x108')});db[_0x251f('0x4c')]['belongsToMany'](db['Tag'],{'through':_0x251f('0x175'),'as':'Tags'});db['FaxInteraction']['belongsToMany'](db[_0x251f('0x90')],{'through':_0x251f('0x175'),'as':_0x251f('0x168')});db[_0x251f('0x4c')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'through':_0x251f('0x121'),'foreignKey':_0x251f('0x174')});db['FaxMessage'][_0x251f('0x147')](db['User'],{'onDelete':_0x251f('0x10d'),'as':'User'});db['FaxMessage'][_0x251f('0x147')](db[_0x251f('0x4c')],{'as':_0x251f('0x16a'),'foreignKey':'FaxInteractionId'});db[_0x251f('0x4e')][_0x251f('0x147')](db[_0x251f('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0x251f('0x4e')]['belongsTo'](db[_0x251f('0xeb')],{'as':_0x251f('0xeb'),'foreignKey':_0x251f('0x176')});db['FaxMessage'][_0x251f('0x147')](db[_0x251f('0x49')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x170')});db[_0x251f('0x50')]['belongsToMany'](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x129')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0x251f('0x177'),'as':'Teams'});db[_0x251f('0x52')]['belongsTo'](db[_0x251f('0x49')],{});db[_0x251f('0x52')]['belongsTo'](db['CmList'],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0x52')][_0x251f('0x147')](db['CmContact'],{'as':_0x251f('0x164'),'foreignKey':'ContactId'});db[_0x251f('0x52')][_0x251f('0x147')](db['FaxInteraction'],{});db[_0x251f('0x52')][_0x251f('0x147')](db['FaxMessage'],{});db[_0x251f('0x52')][_0x251f('0x147')](db['User'],{});db[_0x251f('0x52')][_0x251f('0x147')](db[_0x251f('0x50')],{});db[_0x251f('0x135')]['hasMany'](db[_0x251f('0x84')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0x251f('0x135')][_0x251f('0x109')](db['CannedAnswer'],{'as':_0x251f('0x171'),'foreignKey':_0x251f('0x178')});db[_0x251f('0x135')][_0x251f('0x109')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x251f('0x178')});db[_0x251f('0x135')][_0x251f('0x109')](db['SmsInteraction'],{'as':'Interactions'});db[_0x251f('0x135')][_0x251f('0x109')](db[_0x251f('0x55')],{'as':_0x251f('0x13d')});db[_0x251f('0x135')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0x135')]['belongsTo'](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':_0x251f('0x14c')});db[_0x251f('0x135')]['belongsToMany'](db[_0x251f('0x15')],{'as':'Agents','through':_0x251f('0x137')});db['SmsApplication'][_0x251f('0x147')](db['User'],{'onDelete':_0x251f('0x16b')});db[_0x251f('0x55')]['belongsTo'](db[_0x251f('0x12a')],{'onDelete':'restrict'});db[_0x251f('0x55')][_0x251f('0x147')](db[_0x251f('0x135')],{'onDelete':_0x251f('0x16b')});db['SmsApplication'][_0x251f('0x147')](db[_0x251f('0x87')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16c')});db['SmsApplication'][_0x251f('0x147')](db[_0x251f('0x90')],{'onDelete':_0x251f('0x16b'),'foreignKey':'TagId'});db[_0x251f('0x57')][_0x251f('0x109')](db[_0x251f('0x59')],{'as':_0x251f('0x152'),'onDelete':_0x251f('0x10d'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x251f('0x147')](db[_0x251f('0x135')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x178')});db[_0x251f('0x57')][_0x251f('0x147')](db['CmContact'],{'as':_0x251f('0x164'),'foreignKey':'ContactId'});db[_0x251f('0x57')][_0x251f('0x147')](db['User'],{'as':_0x251f('0x165'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x57')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x179'),'as':_0x251f('0x167')});db[_0x251f('0x57')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x179'),'as':_0x251f('0x168')});db[_0x251f('0x57')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'through':_0x251f('0x122'),'foreignKey':_0x251f('0x17a')});db[_0x251f('0x59')][_0x251f('0x147')](db['User'],{'as':_0x251f('0x15')});db[_0x251f('0x59')][_0x251f('0x147')](db[_0x251f('0x73')],{'onDelete':'cascade','as':_0x251f('0x164')});db[_0x251f('0x59')][_0x251f('0x147')](db['SmsInteraction'],{'onDelete':_0x251f('0x10d'),'as':'Interaction','foreignKey':_0x251f('0x17a')});db[_0x251f('0x59')][_0x251f('0x147')](db[_0x251f('0x135')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x178')});db[_0x251f('0x12a')]['belongsToMany'](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x34'),'foreignKey':'SmsQueueId'});db[_0x251f('0x12a')]['belongsToMany'](db[_0x251f('0xe4')],{'through':_0x251f('0x17b'),'as':_0x251f('0x14f')});db[_0x251f('0x5c')][_0x251f('0x109')](db[_0x251f('0x84')],{'as':_0x251f('0x15e'),'foreignKey':_0x251f('0x17c')});db[_0x251f('0x5c')][_0x251f('0x109')](db['CannedAnswer'],{'as':_0x251f('0x171'),'foreignKey':_0x251f('0x17c')});db[_0x251f('0x5c')][_0x251f('0x109')](db['OpenchannelInteraction'],{'as':_0x251f('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0x251f('0x5c')][_0x251f('0x109')](db[_0x251f('0x60')],{'as':_0x251f('0x152'),'foreignKey':_0x251f('0x17c')});db[_0x251f('0x5c')][_0x251f('0x109')](db['OpenchannelApplication'],{'as':_0x251f('0x13d'),'foreignKey':_0x251f('0x17c')});db[_0x251f('0x5c')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db['OpenchannelAccount'][_0x251f('0x147')](db[_0x251f('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0x251f('0x14c')});db[_0x251f('0x5c')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x134')});db[_0x251f('0x5d')][_0x251f('0x147')](db[_0x251f('0x15')],{'onDelete':'restrict'});db[_0x251f('0x5d')][_0x251f('0x147')](db[_0x251f('0x62')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x17d')});db[_0x251f('0x5d')][_0x251f('0x147')](db[_0x251f('0x5c')],{'onDelete':_0x251f('0x16b'),'foreignKey':'OpenchannelAccountId'});db[_0x251f('0x5d')][_0x251f('0x147')](db[_0x251f('0x87')],{'onDelete':'restrict','foreignKey':_0x251f('0x16c')});db[_0x251f('0x5d')][_0x251f('0x147')](db[_0x251f('0x90')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16d')});db['OpenchannelInteraction'][_0x251f('0x109')](db[_0x251f('0x60')],{'as':_0x251f('0x152'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x17e')});db[_0x251f('0x110')]['belongsTo'](db[_0x251f('0x5c')],{'as':'Account','foreignKey':_0x251f('0x17c')});db['OpenchannelInteraction'][_0x251f('0x147')](db[_0x251f('0x73')],{'as':'Contact','foreignKey':_0x251f('0x158')});db['OpenchannelInteraction'][_0x251f('0x147')](db[_0x251f('0x15')],{'as':'Owner','foreignKey':_0x251f('0x108')});db[_0x251f('0x110')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x17f'),'as':_0x251f('0x167')});db[_0x251f('0x110')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x17f'),'as':'ThroughTags'});db[_0x251f('0x110')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':'Users','through':_0x251f('0x124'),'foreignKey':_0x251f('0x17e')});db['OpenchannelMessage'][_0x251f('0x147')](db[_0x251f('0x15')],{'onDelete':_0x251f('0x10d'),'as':'User'});db['OpenchannelMessage'][_0x251f('0x147')](db['CmContact'],{'onDelete':'cascade','as':_0x251f('0x164')});db[_0x251f('0x60')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x16a'),'foreignKey':'OpenchannelInteractionId'});db[_0x251f('0x60')]['belongsTo'](db[_0x251f('0xeb')],{'as':_0x251f('0xeb'),'foreignKey':'AttachmentId'});db[_0x251f('0x60')][_0x251f('0x147')](db[_0x251f('0x5c')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x251f('0x62')]['belongsToMany'](db[_0x251f('0x15')],{'as':'Agents','through':_0x251f('0x36'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0x251f('0xe4')],{'through':_0x251f('0x180'),'as':_0x251f('0x14f')});db[_0x251f('0x63')][_0x251f('0x109')](db[_0x251f('0x84')],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db[_0x251f('0x63')][_0x251f('0x109')](db['CannedAnswer'],{'as':_0x251f('0x171'),'foreignKey':_0x251f('0x181')});db[_0x251f('0x63')][_0x251f('0x109')](db[_0x251f('0x70')],{'as':_0x251f('0x182')});db[_0x251f('0x63')][_0x251f('0x109')](db[_0x251f('0x111')],{'as':_0x251f('0x15f')});db[_0x251f('0x63')][_0x251f('0x109')](db[_0x251f('0x66')],{'as':'Applications'});db[_0x251f('0x63')][_0x251f('0x109')](db[_0x251f('0x69')],{'as':_0x251f('0x152')});db[_0x251f('0x63')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':'List','foreignKey':_0x251f('0x16e')});db['ChatWebsite'][_0x251f('0x147')](db[_0x251f('0x87')],{'as':_0x251f('0x87'),'foreignKey':_0x251f('0x16c')});db[_0x251f('0x63')][_0x251f('0x147')](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x251f('0x63')]['belongsToMany'](db[_0x251f('0x15')],{'as':'Agents','through':_0x251f('0x183')});db[_0x251f('0x64')]['belongsTo'](db[_0x251f('0x5c')],{});db[_0x251f('0x64')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0x64')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x251f('0x158')});db['OpenchannelQueueReport']['belongsTo'](db[_0x251f('0x110')],{});db['OpenchannelQueueReport'][_0x251f('0x147')](db['OpenchannelMessage'],{});db[_0x251f('0x64')]['belongsTo'](db[_0x251f('0x15')],{});db[_0x251f('0x64')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x251f('0x66')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x184'),'foreignKey':_0x251f('0x108'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x251f('0x6c')],{'as':_0x251f('0x185'),'foreignKey':_0x251f('0x186'),'onDelete':'restrict'});db[_0x251f('0x66')][_0x251f('0x147')](db[_0x251f('0x63')],{'as':'Website','foreignKey':_0x251f('0x181'),'onDelete':_0x251f('0x16b')});db['ChatApplication']['belongsTo'](db[_0x251f('0x90')],{'onDelete':_0x251f('0x16b'),'foreignKey':_0x251f('0x16d')});db[_0x251f('0x111')]['hasMany'](db[_0x251f('0x69')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x251f('0x187')});db[_0x251f('0x111')][_0x251f('0x147')](db[_0x251f('0x63')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x181')});db['ChatInteraction'][_0x251f('0x147')](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':_0x251f('0x158')});db[_0x251f('0x111')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x165'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x111')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x188'),'as':_0x251f('0x167')});db[_0x251f('0x111')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x188'),'as':_0x251f('0x168')});db[_0x251f('0x111')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'through':'user_has_chat_interactions','foreignKey':_0x251f('0x187')});db[_0x251f('0x69')]['belongsTo'](db[_0x251f('0x15')],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x15')});db[_0x251f('0x69')]['belongsTo'](db['CmContact'],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x164'),'foreignKey':_0x251f('0x158')});db[_0x251f('0x69')][_0x251f('0x147')](db['ChatInteraction'],{'onDelete':_0x251f('0x10d'),'as':'Interaction','foreignKey':_0x251f('0x187')});db['ChatMessage'][_0x251f('0x147')](db[_0x251f('0xeb')],{'as':_0x251f('0xeb'),'foreignKey':_0x251f('0x176')});db[_0x251f('0x69')][_0x251f('0x147')](db[_0x251f('0x63')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x181')});db[_0x251f('0x6a')][_0x251f('0x147')](db[_0x251f('0x73')],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x164'),'foreignKey':_0x251f('0x158')});db['ChatOfflineMessage'][_0x251f('0x147')](db[_0x251f('0x63')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x181')});db[_0x251f('0x6c')][_0x251f('0x118')](db['User'],{'as':_0x251f('0x14e'),'through':_0x251f('0x2f'),'hooks':!![]});db[_0x251f('0x6c')][_0x251f('0x118')](db['Team'],{'through':_0x251f('0x189'),'as':'Teams'});db[_0x251f('0x6e')][_0x251f('0x109')](db[_0x251f('0xcf')],{'as':_0x251f('0x152'),'foreignKey':_0x251f('0x18a'),'onDelete':_0x251f('0x10d')});db['ChatGroup'][_0x251f('0x118')](db['User'],{'as':_0x251f('0x141'),'through':_0x251f('0x11a')});db[_0x251f('0x70')][_0x251f('0x147')](db[_0x251f('0x63')],{'as':_0x251f('0x18b'),'foreignKey':_0x251f('0x181')});db['CmCompany'][_0x251f('0x109')](db[_0x251f('0x73')],{'as':_0x251f('0x11b'),'foreignKey':_0x251f('0x18c')});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0x18d')],{'as':_0x251f('0x142'),'foreignKey':_0x251f('0x158')});db['CmContact'][_0x251f('0x109')](db['CmHopperFinal'],{'as':_0x251f('0x10e'),'foreignKey':'ContactId'});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0x79')],{'as':_0x251f('0x144'),'foreignKey':_0x251f('0x158')});db['CmContact'][_0x251f('0x109')](db['ReportAgentPreview'],{'as':_0x251f('0x7b'),'foreignKey':_0x251f('0x158')});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0xd3')],{'as':'JscriptySessions','foreignKey':_0x251f('0x158')});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0x110')],{'as':_0x251f('0x123'),'foreignKey':'ContactId','onDelete':_0x251f('0x16b')});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0x111')],{'as':'ChatInteractions','foreignKey':_0x251f('0x158'),'onDelete':_0x251f('0x16b')});db['CmContact'][_0x251f('0x109')](db[_0x251f('0x57')],{'as':'SmsInteractions','foreignKey':_0x251f('0x158'),'onDelete':'restrict'});db[_0x251f('0x73')][_0x251f('0x109')](db[_0x251f('0x4c')],{'as':'FaxInteractions','foreignKey':_0x251f('0x158'),'onDelete':_0x251f('0x16b')});db[_0x251f('0x73')]['hasMany'](db[_0x251f('0x40')],{'as':'MailInteractions','foreignKey':_0x251f('0x158'),'onDelete':_0x251f('0x16b')});db[_0x251f('0x73')][_0x251f('0x147')](db[_0x251f('0x18e')],{'as':_0x251f('0x18f'),'foreignKey':_0x251f('0x18c')});db[_0x251f('0x73')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':'List','foreignKey':_0x251f('0x16e'),'onDelete':'cascade'});db[_0x251f('0x73')]['belongsToMany'](db[_0x251f('0x15')],{'as':'Users','through':_0x251f('0x190')});db[_0x251f('0x73')]['belongsToMany'](db[_0x251f('0x90')],{'as':_0x251f('0x167'),'through':_0x251f('0x191')});db[_0x251f('0x73')][_0x251f('0x118')](db['Tag'],{'through':_0x251f('0x191'),'as':'ThroughTags'});db[_0x251f('0x18d')][_0x251f('0x147')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x251f('0x10d')});db[_0x251f('0x18d')][_0x251f('0x147')](db['CmList'],{'as':'List','foreignKey':_0x251f('0x16e'),'onDelete':_0x251f('0x10d')});db['CmHopper'][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x184'),'foreignKey':_0x251f('0x108')});db[_0x251f('0x18d')][_0x251f('0x147')](db[_0x251f('0x1d')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x251f('0x10d')});db[_0x251f('0x18d')][_0x251f('0x147')](db[_0x251f('0xe7')],{'as':'Campaign','foreignKey':_0x251f('0x192'),'onDelete':'cascade'});db['CmHopper'][_0x251f('0x147')](db[_0x251f('0x15')],{'as':'Owner','foreignKey':_0x251f('0x193')});db[_0x251f('0x76')][_0x251f('0x147')](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':'ContactId','onDelete':_0x251f('0x10d')});db[_0x251f('0x76')]['belongsTo'](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e'),'onDelete':_0x251f('0x10d')});db[_0x251f('0x76')]['belongsTo'](db[_0x251f('0x1d')],{'as':_0x251f('0x185'),'foreignKey':_0x251f('0x143'),'onDelete':'cascade'});db[_0x251f('0x76')][_0x251f('0x147')](db[_0x251f('0xe7')],{'as':_0x251f('0xe7'),'foreignKey':_0x251f('0x192'),'onDelete':_0x251f('0x10d')});db['Automation'][_0x251f('0x109')](db[_0x251f('0x86')],{'as':{'plural':_0x251f('0x194'),'singular':_0x251f('0x195')},'foreignKey':_0x251f('0x196'),'onDelete':_0x251f('0x10d'),'hooks':!![]});db['Automation'][_0x251f('0x109')](db['Condition'],{'as':{'plural':_0x251f('0x197'),'singular':_0x251f('0x198')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x251f('0x81')][_0x251f('0x109')](db[_0x251f('0x7f')],{'as':_0x251f('0x199'),'foreignKey':_0x251f('0x19a'),'onDelete':'cascade','hooks':!![]});db['Interval'][_0x251f('0x109')](db['Interval'],{'as':_0x251f('0x19b'),'foreignKey':_0x251f('0x16c'),'onDelete':_0x251f('0x10d'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x251f('0x10b')],{'as':'Extensions','foreignKey':_0x251f('0x16c'),'onDelete':_0x251f('0x16b')});db['Interval'][_0x251f('0x109')](db[_0x251f('0x42')],{'as':_0x251f('0x19c'),'foreignKey':'IntervalId'});db[_0x251f('0x87')][_0x251f('0x109')](db[_0x251f('0x66')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x251f('0x87')]['hasMany'](db[_0x251f('0x4b')],{'as':_0x251f('0x19d'),'foreignKey':_0x251f('0x16c')});db[_0x251f('0x87')][_0x251f('0x109')](db[_0x251f('0x55')],{'as':_0x251f('0x19e'),'foreignKey':_0x251f('0x16c')});db['Schedule'][_0x251f('0x147')](db[_0x251f('0x3c')],{});db[_0x251f('0x19f')][_0x251f('0x147')](db[_0x251f('0x9a')],{'foreignKey':_0x251f('0x1a0')});db[_0x251f('0x19f')]['belongsTo'](db[_0x251f('0x98')],{'foreignKey':_0x251f('0x1a1')});db[_0x251f('0x8f')][_0x251f('0x118')](db[_0x251f('0x13e')],{'as':_0x251f('0x1a2'),'through':'moh_has_sounds','onDelete':_0x251f('0x16b')});db[_0x251f('0x90')]['belongsToMany'](db[_0x251f('0x73')],{'through':_0x251f('0x191')});db[_0x251f('0x90')]['belongsToMany'](db[_0x251f('0x111')],{'through':_0x251f('0x188')});db[_0x251f('0x90')][_0x251f('0x118')](db[_0x251f('0x40')],{'through':_0x251f('0x166')});db[_0x251f('0x90')][_0x251f('0x118')](db[_0x251f('0x57')],{'through':_0x251f('0x179')});db[_0x251f('0x90')][_0x251f('0x118')](db[_0x251f('0x4c')],{'through':'fax_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x251f('0x110')],{'through':_0x251f('0x17f')});db[_0x251f('0x90')][_0x251f('0x118')](db[_0x251f('0x101')],{'through':_0x251f('0x1a3')});db[_0x251f('0x94')][_0x251f('0x109')](db['Condition'],{'as':{'plural':_0x251f('0x1a4'),'singular':_0x251f('0x1a5')},'foreignKey':_0x251f('0x1a6'),'onDelete':_0x251f('0x10d'),'hooks':!![]});db[_0x251f('0x94')]['hasMany'](db['Condition'],{'as':{'plural':_0x251f('0x1a7'),'singular':_0x251f('0x1a8')},'foreignKey':'TriggerAnyId','onDelete':_0x251f('0x10d'),'hooks':!![]});db[_0x251f('0x94')]['hasMany'](db['Action'],{'as':_0x251f('0x199'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x251f('0x98')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x251f('0x1a9'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x251f('0x9a')][_0x251f('0x109')](db[_0x251f('0xa0')],{'as':_0x251f('0x1a9'),'onDelete':'cascade','foreignKey':_0x251f('0x1a0')});db['AnalyticMetric'][_0x251f('0x109')](db[_0x251f('0xa0')],{'as':_0x251f('0x1a9'),'onDelete':_0x251f('0x10d'),'foreignKey':'MetricId'});db[_0x251f('0xa0')][_0x251f('0x147')](db[_0x251f('0x9e')],{'foreignKey':_0x251f('0x1aa')});db[_0x251f('0xa2')][_0x251f('0x109')](db[_0x251f('0xa4')],{'as':_0x251f('0x1ab'),'onDelete':_0x251f('0x10d'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x251f('0x109')](db[_0x251f('0xa6')],{'as':'Subjects','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xa4')]['hasMany'](db['SalesforceField'],{'as':_0x251f('0x1ad'),'onDelete':'cascade','foreignKey':_0x251f('0x1ae')});db['SalesforceConfiguration'][_0x251f('0x109')](db[_0x251f('0xa6')],{'as':_0x251f('0x1a9'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1af')});db['SalesforceConfiguration'][_0x251f('0x147')](db['SalesforceAccount'],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xa6')][_0x251f('0x109')](db['SalesforceField'],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xa6')][_0x251f('0x109')](db[_0x251f('0xa6')],{'as':'Description','foreignKey':_0x251f('0x1ae')});db['SalesforceField'][_0x251f('0x109')](db[_0x251f('0xa6')],{'as':'Field','foreignKey':'FieldId'});db[_0x251f('0xa6')][_0x251f('0x147')](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db[_0x251f('0x1b4')][_0x251f('0x109')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1b0')});db['SugarcrmConfiguration'][_0x251f('0x109')](db[_0x251f('0xaa')],{'as':'Subjects','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xa8')][_0x251f('0x109')](db[_0x251f('0xaa')],{'as':'Descriptions','onDelete':_0x251f('0x10d'),'foreignKey':'DescriptionId'});db[_0x251f('0xa8')][_0x251f('0x109')](db[_0x251f('0xaa')],{'as':_0x251f('0x1a9'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0xa8')][_0x251f('0x147')](db[_0x251f('0x1b4')],{'as':'Account','foreignKey':_0x251f('0x1b0')});db[_0x251f('0xaa')][_0x251f('0x109')](db[_0x251f('0xaa')],{'as':_0x251f('0x1b1'),'foreignKey':'SubjectId'});db[_0x251f('0xaa')][_0x251f('0x109')](db[_0x251f('0xaa')],{'as':_0x251f('0x1b5'),'foreignKey':_0x251f('0x1ae')});db['SugarcrmField']['hasMany'](db[_0x251f('0xaa')],{'as':_0x251f('0x1b6'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0xaa')]['belongsTo'](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db['DeskAccount'][_0x251f('0x109')](db[_0x251f('0xad')],{'as':_0x251f('0x1ab'),'onDelete':'cascade','foreignKey':_0x251f('0x1b0')});db[_0x251f('0xad')]['hasMany'](db['DeskField'],{'as':'Subjects','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xad')]['hasMany'](db[_0x251f('0xaf')],{'as':_0x251f('0x1ad'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ae')});db[_0x251f('0xad')][_0x251f('0x109')](db['DeskField'],{'as':_0x251f('0x1a9'),'onDelete':'cascade','foreignKey':_0x251f('0x1af')});db[_0x251f('0xad')]['belongsTo'](db[_0x251f('0xac')],{'as':'Account','foreignKey':_0x251f('0x1b0')});db[_0x251f('0xad')]['belongsToMany'](db[_0x251f('0x90')],{'through':_0x251f('0x1b7')});db['DeskField']['hasMany'](db[_0x251f('0xaf')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xaf')][_0x251f('0x109')](db[_0x251f('0xaf')],{'as':_0x251f('0x1b5'),'foreignKey':_0x251f('0x1ae')});db[_0x251f('0xaf')][_0x251f('0x109')](db[_0x251f('0xaf')],{'as':_0x251f('0x1b6'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0xaf')][_0x251f('0x147')](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x251f('0x109')](db[_0x251f('0xb2')],{'as':_0x251f('0x1ab'),'onDelete':_0x251f('0x10d'),'foreignKey':'AccountId'});db[_0x251f('0xb2')][_0x251f('0x109')](db[_0x251f('0x1b8')],{'as':_0x251f('0x1b9'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xb2')][_0x251f('0x109')](db['ZohoField'],{'as':'Descriptions','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ae')});db[_0x251f('0xb2')][_0x251f('0x109')](db[_0x251f('0x1b8')],{'as':'Fields','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0xb2')][_0x251f('0x147')](db[_0x251f('0xb0')],{'as':'Account','foreignKey':_0x251f('0x1b0')});db[_0x251f('0x1b8')][_0x251f('0x109')](db[_0x251f('0x1b8')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0x1b8')][_0x251f('0x109')](db[_0x251f('0x1b8')],{'as':'Description','foreignKey':_0x251f('0x1ae')});db['ZohoField'][_0x251f('0x109')](db[_0x251f('0x1b8')],{'as':_0x251f('0x1b6'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0x1b8')][_0x251f('0x147')](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db['ZendeskAccount'][_0x251f('0x109')](db['ZendeskConfiguration'],{'as':_0x251f('0x1ab'),'onDelete':'cascade','foreignKey':_0x251f('0x1b0')});db[_0x251f('0xb5')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':_0x251f('0x1b9'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xb5')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':_0x251f('0x1ad'),'foreignKey':'DescriptionId'});db[_0x251f('0xb5')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':_0x251f('0x1a9'),'foreignKey':_0x251f('0x1af')});db['ZendeskConfiguration'][_0x251f('0x147')](db[_0x251f('0xb3')],{'as':'Account','foreignKey':_0x251f('0x1b0')});db['ZendeskConfiguration'][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x1bb')});db[_0x251f('0x1ba')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':'Subject','foreignKey':_0x251f('0x1ac')});db[_0x251f('0x1ba')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':_0x251f('0x1b5'),'foreignKey':'DescriptionId'});db[_0x251f('0x1ba')][_0x251f('0x109')](db[_0x251f('0x1ba')],{'as':_0x251f('0x1b6'),'foreignKey':_0x251f('0x1af')});db['ZendeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x251f('0x1b3')});db[_0x251f('0x1bc')][_0x251f('0x109')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xb9')][_0x251f('0x109')](db['FreshdeskField'],{'as':_0x251f('0x1b9'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xb9')][_0x251f('0x109')](db['FreshdeskField'],{'as':_0x251f('0x1ad'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ae')});db['FreshdeskConfiguration']['hasMany'](db[_0x251f('0xba')],{'as':_0x251f('0x1a9'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x251f('0xb9')]['belongsTo'](db[_0x251f('0x1bc')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xb9')][_0x251f('0x118')](db['Tag'],{'through':_0x251f('0x1bd')});db[_0x251f('0xba')][_0x251f('0x109')](db[_0x251f('0xba')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xba')][_0x251f('0x109')](db[_0x251f('0xba')],{'as':'Description','foreignKey':_0x251f('0x1ae')});db[_0x251f('0xba')][_0x251f('0x109')](db[_0x251f('0xba')],{'as':_0x251f('0x1b6'),'foreignKey':'FieldId'});db[_0x251f('0xba')]['belongsTo'](db[_0x251f('0x1b2')],{'as':'Variable','foreignKey':_0x251f('0x1b3')});db[_0x251f('0xbc')]['hasMany'](db[_0x251f('0xbe')],{'as':_0x251f('0x1ab'),'onDelete':_0x251f('0x10d'),'foreignKey':'AccountId'});db[_0x251f('0xbe')]['hasMany'](db[_0x251f('0xc0')],{'as':_0x251f('0x1b9'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xbe')]['hasMany'](db['VtigerField'],{'as':_0x251f('0x1ad'),'foreignKey':_0x251f('0x1ae')});db[_0x251f('0xbe')][_0x251f('0x109')](db[_0x251f('0xc0')],{'as':'Fields','foreignKey':_0x251f('0x1af')});db['VtigerConfiguration'][_0x251f('0x147')](db[_0x251f('0xbc')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xc0')][_0x251f('0x109')](db[_0x251f('0xc0')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db['VtigerField'][_0x251f('0x109')](db['VtigerField'],{'as':_0x251f('0x1b5'),'foreignKey':_0x251f('0x1ae')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x251f('0x1af')});db[_0x251f('0xc0')][_0x251f('0x147')](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db[_0x251f('0x1be')][_0x251f('0x109')](db[_0x251f('0xc3')],{'as':_0x251f('0x1ab'),'onDelete':_0x251f('0x10d'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x251f('0x109')](db[_0x251f('0xc4')],{'as':_0x251f('0x1b9'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xc3')]['hasMany'](db[_0x251f('0xc4')],{'as':'Descriptions','foreignKey':_0x251f('0x1ae')});db[_0x251f('0xc3')]['hasMany'](db[_0x251f('0xc4')],{'as':_0x251f('0x1a9'),'foreignKey':_0x251f('0x1af')});db['ServicenowConfiguration']['belongsTo'](db[_0x251f('0x1be')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1b0')});db['ServicenowField'][_0x251f('0x109')](db['ServicenowField'],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xc4')][_0x251f('0x109')](db[_0x251f('0xc4')],{'as':_0x251f('0x1b5'),'foreignKey':_0x251f('0x1ae')});db['ServicenowField'][_0x251f('0x109')](db['ServicenowField'],{'as':'Field','foreignKey':_0x251f('0x1af')});db[_0x251f('0xc4')]['belongsTo'](db['Variable'],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db[_0x251f('0x1bf')]['hasMany'](db[_0x251f('0xc6')],{'as':_0x251f('0x1ab'),'onDelete':'cascade','foreignKey':_0x251f('0x1b0')});db['Dynamics365Configuration'][_0x251f('0x109')](db['Dynamics365Field'],{'as':_0x251f('0x1b9'),'onDelete':_0x251f('0x10d'),'foreignKey':'SubjectId'});db[_0x251f('0xc6')][_0x251f('0x109')](db[_0x251f('0xc7')],{'as':_0x251f('0x1ad'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1ae')});db['Dynamics365Configuration'][_0x251f('0x109')](db[_0x251f('0xc7')],{'as':_0x251f('0x1a9'),'onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1af')});db[_0x251f('0xc6')][_0x251f('0x147')](db['Dynamics365Account'],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xc7')][_0x251f('0x109')](db[_0x251f('0xc7')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0xc7')][_0x251f('0x109')](db[_0x251f('0xc7')],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x251f('0x109')](db[_0x251f('0xc7')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x251f('0x147')](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':_0x251f('0x1b3')});db[_0x251f('0xc8')]['hasMany'](db[_0x251f('0xca')],{'as':'Configurations','onDelete':_0x251f('0x10d'),'foreignKey':_0x251f('0x1b0')});db[_0x251f('0xca')][_0x251f('0x109')](db[_0x251f('0x1c0')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x251f('0xca')][_0x251f('0x109')](db[_0x251f('0x1c0')],{'as':_0x251f('0x1ad'),'foreignKey':_0x251f('0x1ae')});db[_0x251f('0xca')]['hasMany'](db[_0x251f('0x1c0')],{'as':'Fields','foreignKey':'FieldId'});db[_0x251f('0xca')][_0x251f('0x147')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x251f('0x1b0')});db[_0x251f('0x1c0')][_0x251f('0x109')](db[_0x251f('0x1c0')],{'as':_0x251f('0x1b1'),'foreignKey':_0x251f('0x1ac')});db[_0x251f('0x1c0')][_0x251f('0x109')](db[_0x251f('0x1c0')],{'as':_0x251f('0x1b5'),'foreignKey':'DescriptionId'});db[_0x251f('0x1c0')][_0x251f('0x109')](db[_0x251f('0x1c0')],{'as':'Field','foreignKey':'FieldId'});db[_0x251f('0x1c0')]['belongsTo'](db[_0x251f('0x1b2')],{'as':_0x251f('0x1b2'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x251f('0x147')](db[_0x251f('0x63')],{});db[_0x251f('0xce')][_0x251f('0x147')](db['CmList'],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0xce')][_0x251f('0x147')](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':'ContactId'});db[_0x251f('0xce')]['belongsTo'](db['ChatInteraction'],{});db['ChatQueueReport'][_0x251f('0x147')](db['ChatMessage'],{});db[_0x251f('0xce')][_0x251f('0x147')](db['User'],{});db[_0x251f('0xce')][_0x251f('0x147')](db['ChatQueue'],{});db[_0x251f('0xcf')][_0x251f('0x147')](db[_0x251f('0x15')],{'onDelete':'cascade','foreignKey':_0x251f('0x1c1')});db['ChatInternalMessage'][_0x251f('0x147')](db[_0x251f('0x15')],{'onDelete':_0x251f('0x10d'),'foreignKey':'ToId'});db[_0x251f('0xd3')][_0x251f('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x251f('0x1c2'),'onDelete':'cascade'});db[_0x251f('0xd3')][_0x251f('0x109')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x251f('0x10d')});db[_0x251f('0xd4')]['belongsTo'](db['SmsAccount'],{});db[_0x251f('0xd4')][_0x251f('0x147')](db[_0x251f('0xf6')],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db['SmsQueueReport'][_0x251f('0x147')](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':_0x251f('0x158')});db[_0x251f('0xd4')][_0x251f('0x147')](db['SmsInteraction'],{});db[_0x251f('0xd4')][_0x251f('0x147')](db[_0x251f('0x59')],{});db[_0x251f('0xd4')][_0x251f('0x147')](db[_0x251f('0x15')],{});db['SmsQueueReport'][_0x251f('0x147')](db[_0x251f('0x12a')],{});db[_0x251f('0xd9')][_0x251f('0x109')](db[_0x251f('0xd3')],{'foreignKey':_0x251f('0x1c3')});db['JscriptyProject'][_0x251f('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x251f('0x1c3')});db[_0x251f('0xd9')][_0x251f('0x109')](db[_0x251f('0xd0')],{'foreignKey':_0x251f('0x1c3')});db[_0x251f('0xdf')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'through':_0x251f('0x13a')});db[_0x251f('0xe4')]['belongsToMany'](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':'user_has_teams'});db['Team']['belongsToMany'](db['VoiceQueue'],{'through':_0x251f('0x150'),'as':_0x251f('0x126')});db[_0x251f('0xe4')]['belongsToMany'](db['MailQueue'],{'through':_0x251f('0x161'),'as':_0x251f('0x1c4')});db[_0x251f('0xe4')][_0x251f('0x118')](db[_0x251f('0x6c')],{'through':_0x251f('0x189'),'as':_0x251f('0x1c5')});db['Team'][_0x251f('0x118')](db[_0x251f('0x50')],{'through':_0x251f('0x177'),'as':_0x251f('0x128')});db['Team'][_0x251f('0x118')](db[_0x251f('0x12a')],{'through':_0x251f('0x17b'),'as':_0x251f('0x12b')});db['Team'][_0x251f('0x118')](db['OpenchannelQueue'],{'through':_0x251f('0x180'),'as':_0x251f('0x12c')});db[_0x251f('0xe4')][_0x251f('0x118')](db[_0x251f('0x104')],{'through':_0x251f('0x1c6'),'as':_0x251f('0x1c7')});db[_0x251f('0xe7')][_0x251f('0x109')](db[_0x251f('0x18d')],{'as':_0x251f('0x142'),'foreignKey':_0x251f('0x192')});db['Campaign'][_0x251f('0x109')](db['CmHopperFinal'],{'as':_0x251f('0x10e'),'foreignKey':'CampaignId'});db[_0x251f('0xe7')][_0x251f('0x109')](db[_0x251f('0x79')],{'as':_0x251f('0x144'),'foreignKey':_0x251f('0x192')});db[_0x251f('0xe7')][_0x251f('0x109')](db[_0x251f('0x76')],{'as':_0x251f('0x145'),'foreignKey':_0x251f('0x192')});db[_0x251f('0xe7')][_0x251f('0x147')](db['Trunk'],{'as':_0x251f('0x2a'),'foreignKey':_0x251f('0x148')});db[_0x251f('0xe7')][_0x251f('0x147')](db[_0x251f('0x2a')],{'as':_0x251f('0x149'),'foreignKey':'TrunkBackupId'});db[_0x251f('0xe7')][_0x251f('0x147')](db[_0x251f('0x87')],{'as':'Interval','foreignKey':_0x251f('0x16c')});db[_0x251f('0xe7')][_0x251f('0x147')](db[_0x251f('0xdf')],{'as':_0x251f('0xdf'),'foreignKey':_0x251f('0x1c8')});db[_0x251f('0xe7')][_0x251f('0x118')](db[_0x251f('0xf6')],{'as':_0x251f('0x11c'),'through':_0x251f('0x1c9')});db[_0x251f('0xe7')][_0x251f('0x118')](db[_0x251f('0xf6')],{'as':_0x251f('0x1ca'),'through':_0x251f('0x1cb')});db[_0x251f('0x1cc')][_0x251f('0x147')](db[_0x251f('0x41')],{});db[_0x251f('0x1cc')][_0x251f('0x147')](db[_0x251f('0x40')],{});db[_0x251f('0x1cc')]['belongsTo'](db[_0x251f('0x3c')],{'foreignKey':_0x251f('0x1cd'),'as':_0x251f('0x1ce')});db[_0x251f('0x1cc')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1cf'),'as':_0x251f('0x1d0')});db[_0x251f('0x1cc')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1d1'),'as':_0x251f('0x1d2')});db[_0x251f('0x1cc')]['belongsTo'](db[_0x251f('0x3e')],{'foreignKey':_0x251f('0x1d3'),'as':_0x251f('0x1d4')});db[_0x251f('0x1cc')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x251f('0x1d5'),'as':_0x251f('0x1d6')});db['ChatTransferReport'][_0x251f('0x147')](db['ChatMessage'],{});db['ChatTransferReport'][_0x251f('0x147')](db[_0x251f('0x111')],{});db[_0x251f('0xee')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x251f('0x1d7'),'as':_0x251f('0x1ce')});db[_0x251f('0xee')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1cf'),'as':_0x251f('0x1d0')});db['ChatTransferReport'][_0x251f('0x147')](db['User'],{'foreignKey':'ToUserId','as':_0x251f('0x1d2')});db[_0x251f('0xee')][_0x251f('0x147')](db['ChatQueue'],{'foreignKey':_0x251f('0x1d8'),'as':'ToQueue'});db[_0x251f('0xee')][_0x251f('0x147')](db['ChatWebsite'],{'foreignKey':_0x251f('0x1d9'),'as':_0x251f('0x1d6')});db[_0x251f('0xf0')][_0x251f('0x147')](db['FaxMessage'],{});db[_0x251f('0xf0')][_0x251f('0x147')](db[_0x251f('0x4c')],{});db['FaxTransferReport'][_0x251f('0x147')](db[_0x251f('0x49')],{'foreignKey':_0x251f('0x1da'),'as':_0x251f('0x1ce')});db['FaxTransferReport'][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1cf'),'as':_0x251f('0x1d0')});db['FaxTransferReport']['belongsTo'](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1d1'),'as':_0x251f('0x1d2')});db['FaxTransferReport'][_0x251f('0x147')](db[_0x251f('0x50')],{'foreignKey':_0x251f('0x1db'),'as':'ToQueue'});db[_0x251f('0xf0')][_0x251f('0x147')](db[_0x251f('0x49')],{'foreignKey':_0x251f('0x1dc'),'as':'ToAccount'});db[_0x251f('0xf2')]['belongsTo'](db[_0x251f('0x60')],{});db[_0x251f('0xf2')]['belongsTo'](db[_0x251f('0x110')],{});db[_0x251f('0xf2')][_0x251f('0x147')](db[_0x251f('0x5c')],{'foreignKey':_0x251f('0x1dd'),'as':'FromAccount'});db[_0x251f('0xf2')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1cf'),'as':_0x251f('0x1d0')});db['OpenchannelTransferReport'][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':_0x251f('0x1d1'),'as':_0x251f('0x1d2')});db['OpenchannelTransferReport']['belongsTo'](db[_0x251f('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':_0x251f('0x1d4')});db['OpenchannelTransferReport'][_0x251f('0x147')](db[_0x251f('0x5c')],{'foreignKey':_0x251f('0x1de'),'as':_0x251f('0x1d6')});db[_0x251f('0xf4')]['belongsTo'](db[_0x251f('0x59')],{});db[_0x251f('0xf4')][_0x251f('0x147')](db[_0x251f('0x57')],{});db[_0x251f('0xf4')][_0x251f('0x147')](db[_0x251f('0x135')],{'foreignKey':_0x251f('0x1df'),'as':_0x251f('0x1ce')});db[_0x251f('0xf4')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':'FromUserId','as':_0x251f('0x1d0')});db[_0x251f('0xf4')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x251f('0xf4')]['belongsTo'](db[_0x251f('0x12a')],{'foreignKey':_0x251f('0x1e0'),'as':_0x251f('0x1d4')});db['SmsTransferReport'][_0x251f('0x147')](db[_0x251f('0x135')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x251f('0xf6')]['hasMany'](db[_0x251f('0x84')],{'as':_0x251f('0x15e'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0xf6')][_0x251f('0x109')](db[_0x251f('0x7d')],{'as':'CustomFields','foreignKey':_0x251f('0x16e')});db['CmList'][_0x251f('0x109')](db[_0x251f('0x73')],{'as':'Contacts','onDelete':_0x251f('0x10d'),'foreignKey':'ListId'});db[_0x251f('0xf6')][_0x251f('0x109')](db[_0x251f('0x77')],{'as':_0x251f('0x10e'),'foreignKey':_0x251f('0x16e')});db[_0x251f('0xf6')][_0x251f('0x109')](db[_0x251f('0x79')],{'as':'HopperHistory','foreignKey':_0x251f('0x16e')});db['CmList']['hasMany'](db[_0x251f('0x7b')],{'as':_0x251f('0x7b'),'foreignKey':'ListId'});db['CmList'][_0x251f('0x118')](db['VoiceQueue'],{'as':'Queues','through':_0x251f('0x14d')});db[_0x251f('0xf6')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x251f('0xf7')]['hasMany'](db['VoiceExtension'],{'as':_0x251f('0x10c'),'onDelete':_0x251f('0x10d')});db[_0x251f('0xf7')]['belongsToMany'](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x12e')});db['UserProfile'][_0x251f('0x109')](db[_0x251f('0x15')],{'as':_0x251f('0x169'),'foreignKey':_0x251f('0x1e1')});db[_0x251f('0xf9')][_0x251f('0x109')](db[_0x251f('0xfa')],{'as':_0x251f('0x1e2'),'foreignKey':_0x251f('0x1e1'),'onDelete':_0x251f('0x10d')});db[_0x251f('0xfa')][_0x251f('0x109')](db[_0x251f('0x1e3')],{'as':_0x251f('0x1e4'),'foreignKey':'sectionId','onDelete':_0x251f('0x10d')});db[_0x251f('0xfd')][_0x251f('0x109')](db[_0x251f('0x84')],{'as':'Dispositions','foreignKey':_0x251f('0x1e5')});db[_0x251f('0xfd')][_0x251f('0x109')](db[_0x251f('0x83')],{'as':_0x251f('0x171'),'foreignKey':_0x251f('0x1e5')});db['WhatsappAccount'][_0x251f('0x109')](db[_0x251f('0x1e6')],{'as':_0x251f('0x152'),'foreignKey':'WhatsappAccountId'});db[_0x251f('0xfd')][_0x251f('0x109')](db['WhatsappInteraction'],{'as':_0x251f('0x15f')});db[_0x251f('0xfd')]['hasMany'](db[_0x251f('0xff')],{'as':_0x251f('0x13d')});db[_0x251f('0xfd')]['belongsTo'](db['CmList'],{'as':_0x251f('0x160'),'foreignKey':_0x251f('0x16e')});db['WhatsappAccount']['belongsTo'](db[_0x251f('0x89')],{'as':_0x251f('0x14b'),'foreignKey':_0x251f('0x14c')});db[_0x251f('0xfd')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x251f('0x147')](db['User'],{'onDelete':_0x251f('0x16b')});db[_0x251f('0xff')][_0x251f('0x147')](db[_0x251f('0x104')],{'onDelete':'restrict'});db[_0x251f('0xff')][_0x251f('0x147')](db['WhatsappAccount'],{'onDelete':_0x251f('0x16b')});db[_0x251f('0xff')]['belongsTo'](db[_0x251f('0x87')],{'onDelete':_0x251f('0x16b'),'foreignKey':'IntervalId'});db[_0x251f('0xff')][_0x251f('0x147')](db[_0x251f('0x90')],{'onDelete':_0x251f('0x16b'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0x251f('0x109')](db['WhatsappMessage'],{'as':_0x251f('0x152'),'onDelete':'cascade','foreignKey':_0x251f('0x1e7')});db[_0x251f('0x101')][_0x251f('0x147')](db[_0x251f('0xfd')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1e5')});db[_0x251f('0x101')]['belongsTo'](db[_0x251f('0x73')],{'as':_0x251f('0x164'),'foreignKey':_0x251f('0x158')});db[_0x251f('0x101')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x165'),'foreignKey':'UserId'});db[_0x251f('0x101')][_0x251f('0x118')](db[_0x251f('0x90')],{'through':_0x251f('0x1a3'),'as':'Tags'});db[_0x251f('0x101')][_0x251f('0x118')](db['Tag'],{'through':_0x251f('0x1a3'),'as':_0x251f('0x168')});db[_0x251f('0x101')][_0x251f('0x118')](db['User'],{'as':'Users','through':_0x251f('0x125'),'foreignKey':_0x251f('0x1e7')});db[_0x251f('0x1e6')][_0x251f('0x147')](db[_0x251f('0x15')],{'as':_0x251f('0x15')});db['WhatsappMessage']['belongsTo'](db[_0x251f('0x73')],{'onDelete':_0x251f('0x10d'),'as':_0x251f('0x164')});db[_0x251f('0x1e6')][_0x251f('0x147')](db[_0x251f('0x101')],{'onDelete':_0x251f('0x10d'),'as':'Interaction','foreignKey':_0x251f('0x1e7')});db['WhatsappMessage'][_0x251f('0x147')](db[_0x251f('0xfd')],{'as':_0x251f('0x163'),'foreignKey':_0x251f('0x1e5')});db[_0x251f('0x1e8')]['belongsTo'](db[_0x251f('0xfd')],{});db['WhatsappQueueReport'][_0x251f('0x147')](db['CmList'],{'as':_0x251f('0x160'),'foreignKey':'ListId'});db[_0x251f('0x1e8')][_0x251f('0x147')](db[_0x251f('0x73')],{'as':'Contact','foreignKey':_0x251f('0x158')});db['WhatsappQueueReport']['belongsTo'](db[_0x251f('0x101')],{});db[_0x251f('0x1e8')][_0x251f('0x147')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x251f('0x147')](db[_0x251f('0x1e6')],{});db['WhatsappQueueReport'][_0x251f('0x147')](db['User'],{});db[_0x251f('0x103')][_0x251f('0x147')](db[_0x251f('0x1e6')],{});db[_0x251f('0x103')][_0x251f('0x147')](db[_0x251f('0x101')],{});db[_0x251f('0x103')][_0x251f('0x147')](db[_0x251f('0xfd')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x251f('0x103')][_0x251f('0x147')](db[_0x251f('0xfd')],{'foreignKey':'ToWhatsappAccountId','as':_0x251f('0x1d6')});db[_0x251f('0x103')]['belongsTo'](db[_0x251f('0x104')],{'foreignKey':_0x251f('0x1e9'),'as':'ToQueue'});db[_0x251f('0x103')][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':'FromUserId','as':'FromAgent'});db['WhatsappTransferReport'][_0x251f('0x147')](db[_0x251f('0x15')],{'foreignKey':'ToUserId','as':_0x251f('0x1d2')});db[_0x251f('0x104')][_0x251f('0x118')](db[_0x251f('0x15')],{'as':_0x251f('0x14e'),'through':_0x251f('0x1ea'),'foreignKey':_0x251f('0x1eb')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':_0x251f('0x1c6'),'as':_0x251f('0x14f')});module[_0x251f('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 21337bb..703fd83 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb58=['./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/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/campaign','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','static','root','/apidoc','/demo','snippet','1.0.16','/plugins','join','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express-winston','util','./config/logger','api','auth','default','logger','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','remoteAddress','device','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsApplication','/api/sms/interactions'];(function(_0x2db4c1,_0x3d87fd){var _0x3fe1c3=function(_0x85a2d2){while(--_0x85a2d2){_0x2db4c1['push'](_0x2db4c1['shift']());}};_0x3fe1c3(++_0x3d87fd);}(_0xfb58,0xcc));var _0x8fb5=function(_0x149f3a,_0xf89e6a){_0x149f3a=_0x149f3a-0x0;var _0x534f64=_0xfb58[_0x149f3a];return _0x534f64;};'use strict';var path=require(_0x8fb5('0x0'));var express=require('express');var ewinston=require(_0x8fb5('0x1'));var util=require(_0x8fb5('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x8fb5('0x3'))(_0x8fb5('0x4'));var authLogger=require(_0x8fb5('0x3'))(_0x8fb5('0x5'));exports[_0x8fb5('0x6')]=function(_0x31bf10){_0x31bf10['use'](ewinston[_0x8fb5('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4100c2,_0x1c8de2){return util[_0x8fb5('0x8')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x4100c2[_0x8fb5('0x9')],_0x4100c2[_0x8fb5('0xa')][_0x8fb5('0xb')]?_0x4100c2[_0x8fb5('0xa')][_0x8fb5('0xb')]:_0x4100c2[_0x8fb5('0xc')]['remoteAddress']||_0x4100c2['ip'],_0x4100c2[_0x8fb5('0xd')],_0x1c8de2[_0x8fb5('0xe')],_0x1c8de2[_0x8fb5('0xf')],_0x4100c2[_0x8fb5('0x10')]?_0x4100c2['user']['id']:null,_0x4100c2['user']?_0x4100c2[_0x8fb5('0x10')][_0x8fb5('0x11')]:null,_0x4100c2[_0x8fb5('0x10')]?_0x4100c2[_0x8fb5('0x10')][_0x8fb5('0x12')]:null);}}));_0x31bf10[_0x8fb5('0x13')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x6bfebb,_0x55c101){var _0x3d8f40=_0x8fb5('0x14');if(_0x6bfebb['body']&&_0x6bfebb[_0x8fb5('0x15')]['device']&&_0x6bfebb['body'][_0x8fb5('0x16')]){_0x3d8f40='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x8fb5('0x8')](_0x3d8f40,_0x6bfebb[_0x8fb5('0x9')],_0x6bfebb['headers'][_0x8fb5('0xb')]?_0x6bfebb[_0x8fb5('0xa')][_0x8fb5('0xb')]:_0x6bfebb[_0x8fb5('0xc')][_0x8fb5('0x17')]||_0x6bfebb['ip'],_0x6bfebb[_0x8fb5('0xd')],_0x55c101[_0x8fb5('0xe')],_0x55c101['responseTime'],_0x6bfebb['user']?_0x6bfebb[_0x8fb5('0x10')]['id']:null,_0x6bfebb[_0x8fb5('0x10')]?_0x6bfebb['user'][_0x8fb5('0x11')]:null,_0x6bfebb[_0x8fb5('0x10')]?_0x6bfebb[_0x8fb5('0x10')][_0x8fb5('0x12')]:null,_0x6bfebb[_0x8fb5('0x15')]&&_0x6bfebb[_0x8fb5('0x15')][_0x8fb5('0x18')]?_0x6bfebb['body'][_0x8fb5('0x18')]:_0x8fb5('0x19'),_0x6bfebb['body']&&_0x6bfebb[_0x8fb5('0x15')][_0x8fb5('0x16')]?_0x6bfebb[_0x8fb5('0x15')][_0x8fb5('0x16')]:'',_0x6bfebb[_0x8fb5('0x15')]&&_0x6bfebb[_0x8fb5('0x15')][_0x8fb5('0x1a')]?_0x6bfebb[_0x8fb5('0x15')][_0x8fb5('0x1a')]:'');},'ignoreRoute':function(_0x1fdcec){var _0x55467b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x55467b[_0x8fb5('0x1b')](_0x1fdcec[_0x8fb5('0xd')]);}}));_0x31bf10[_0x8fb5('0x13')]('/api/users',require(_0x8fb5('0x1c')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x1d'),require('./api/voiceChanSpy'));_0x31bf10[_0x8fb5('0x13')]('/api/voice/contexts',require(_0x8fb5('0x1e')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x1f'),require(_0x8fb5('0x20')));_0x31bf10['use']('/api/voice/mohs',require(_0x8fb5('0x21')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x22'),require(_0x8fb5('0x23')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x24'),require(_0x8fb5('0x25')));_0x31bf10['use'](_0x8fb5('0x26'),require(_0x8fb5('0x27')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x28'),require('./api/voiceMail'));_0x31bf10[_0x8fb5('0x13')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x31bf10[_0x8fb5('0x13')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x29'),require(_0x8fb5('0x2a')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x2b'),require(_0x8fb5('0x2c')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x2d'),require('./api/voiceQueueReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x2e'),require(_0x8fb5('0x2f')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x30'),require(_0x8fb5('0x31')));_0x31bf10['use']('/api/voice/transfers/reports',require(_0x8fb5('0x32')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x33'),require(_0x8fb5('0x34')));_0x31bf10[_0x8fb5('0x13')]('/api/mail/accounts',require(_0x8fb5('0x35')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x36'),require('./api/mailQueue'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x37'),require(_0x8fb5('0x38')));_0x31bf10[_0x8fb5('0x13')]('/api/mail/interactions',require(_0x8fb5('0x39')));_0x31bf10[_0x8fb5('0x13')]('/api/mail/messages',require(_0x8fb5('0x3a')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x3b'),require(_0x8fb5('0x3c')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x3d'),require(_0x8fb5('0x3e')));_0x31bf10['use']('/api/dashboards',require(_0x8fb5('0x3f')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x40'),require(_0x8fb5('0x41')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x42'),require(_0x8fb5('0x43')));_0x31bf10[_0x8fb5('0x13')]('/api/fax/applications',require(_0x8fb5('0x44')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x45'),require('./api/faxInteraction'));_0x31bf10[_0x8fb5('0x13')]('/api/fax/messages',require(_0x8fb5('0x46')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x47'),require(_0x8fb5('0x48')));_0x31bf10[_0x8fb5('0x13')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x49'),require('./api/smsAccount'));_0x31bf10[_0x8fb5('0x13')]('/api/sms/applications',require(_0x8fb5('0x4a')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x4b'),require(_0x8fb5('0x4c')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x4d'),require(_0x8fb5('0x4e')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x4f'),require(_0x8fb5('0x50')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x51'),require('./api/openchannelAccount'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x52'),require(_0x8fb5('0x53')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x54'),require(_0x8fb5('0x55')));_0x31bf10['use'](_0x8fb5('0x56'),require(_0x8fb5('0x57')));_0x31bf10['use'](_0x8fb5('0x58'),require(_0x8fb5('0x59')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x5a'),require(_0x8fb5('0x5b')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x5c'),require(_0x8fb5('0x5d')));_0x31bf10[_0x8fb5('0x13')]('/api/chat/applications',require(_0x8fb5('0x5e')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x5f'),require(_0x8fb5('0x60')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x61'),require(_0x8fb5('0x62')));_0x31bf10[_0x8fb5('0x13')]('/api/chat/offline_messages',require(_0x8fb5('0x63')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x64'),require(_0x8fb5('0x65')));_0x31bf10['use'](_0x8fb5('0x66'),require(_0x8fb5('0x67')));_0x31bf10['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x31bf10['use'](_0x8fb5('0x68'),require('./api/cmCompany'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x69'),require(_0x8fb5('0x6a')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x6b'),require(_0x8fb5('0x6c')));_0x31bf10['use']('/api/cm/hopper_black',require(_0x8fb5('0x6d')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x6e'),require('./api/cmHopperFinal'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x6f'),require('./api/cmHopperHistory'));_0x31bf10['use']('/api/cm/custom_fields',require(_0x8fb5('0x70')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x71'),require(_0x8fb5('0x72')));_0x31bf10['use'](_0x8fb5('0x73'),require(_0x8fb5('0x74')));_0x31bf10[_0x8fb5('0x13')]('/api/canned_answers',require(_0x8fb5('0x75')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x76'),require(_0x8fb5('0x77')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x78'),require(_0x8fb5('0x79')));_0x31bf10['use']('/api/intervals',require(_0x8fb5('0x7a')));_0x31bf10['use'](_0x8fb5('0x7b'),require('./api/pause'));_0x31bf10['use']('/api/cdr',require('./api/cdr'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x7c'),require(_0x8fb5('0x7d')));_0x31bf10['use'](_0x8fb5('0x7e'),require(_0x8fb5('0x7f')));_0x31bf10['use'](_0x8fb5('0x80'),require(_0x8fb5('0x81')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x82'),require(_0x8fb5('0x83')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x84'),require('./api/template'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x85'),require(_0x8fb5('0x86')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x87'),require('./api/variable'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x88'),require('./api/integration'));_0x31bf10['use'](_0x8fb5('0x89'),require(_0x8fb5('0x8a')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x8b'),require('./api/analyticCustomReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x8c'),require(_0x8fb5('0x8d')));_0x31bf10[_0x8fb5('0x13')]('/api/analytics/extracted_reports',require(_0x8fb5('0x8e')));_0x31bf10['use'](_0x8fb5('0x8f'),require(_0x8fb5('0x90')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x91'),require(_0x8fb5('0x92')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x93'),require(_0x8fb5('0x94')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x95'),require('./api/intSalesforceAccount'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x96'),require(_0x8fb5('0x97')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x98'),require(_0x8fb5('0x99')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x9a'),require(_0x8fb5('0x9b')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x9c'),require(_0x8fb5('0x9d')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x9e'),require(_0x8fb5('0x9f')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xa0'),require('./api/intDeskAccount'));_0x31bf10['use'](_0x8fb5('0xa1'),require('./api/intDeskConfiguration'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xa2'),require('./api/intDeskField'));_0x31bf10['use'](_0x8fb5('0xa3'),require(_0x8fb5('0xa4')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xa5'),require(_0x8fb5('0xa6')));_0x31bf10['use']('/api/integrations/zoho/fields',require(_0x8fb5('0xa7')));_0x31bf10['use'](_0x8fb5('0xa8'),require(_0x8fb5('0xa9')));_0x31bf10['use'](_0x8fb5('0xaa'),require(_0x8fb5('0xab')));_0x31bf10[_0x8fb5('0x13')]('/api/integrations/zendesk/fields',require(_0x8fb5('0xac')));_0x31bf10['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x31bf10[_0x8fb5('0x13')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x31bf10['use']('/api/integrations/freshdesk/fields',require(_0x8fb5('0xad')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xae'),require(_0x8fb5('0xaf')));_0x31bf10[_0x8fb5('0x13')]('/api/integrations/vtiger/configurations',require(_0x8fb5('0xb0')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xb1'),require(_0x8fb5('0xb2')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xb3'),require('./api/intServicenowAccount'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xb4'),require(_0x8fb5('0xb5')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xb6'),require(_0x8fb5('0xb7')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xb8'),require('./api/intDynamics365Account'));_0x31bf10['use'](_0x8fb5('0xb9'),require('./api/intDynamics365Configuration'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xba'),require('./api/intDynamics365Field'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xbb'),require(_0x8fb5('0xbc')));_0x31bf10['use'](_0x8fb5('0xbd'),require(_0x8fb5('0xbe')));_0x31bf10['use'](_0x8fb5('0xbf'),require(_0x8fb5('0xc0')));_0x31bf10[_0x8fb5('0x13')]('/api/networks',require(_0x8fb5('0xc1')));_0x31bf10[_0x8fb5('0x13')]('/api/chat/reports/queue',require(_0x8fb5('0xc2')));_0x31bf10[_0x8fb5('0x13')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xc3'),require(_0x8fb5('0xc4')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xc5'),require(_0x8fb5('0xc6')));_0x31bf10[_0x8fb5('0x13')]('/api/jscripty/sessions/reports',require(_0x8fb5('0xc7')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xc8'),require(_0x8fb5('0xc9')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xca'),require('./api/squareReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xcb'),require('./api/squareReportDetail'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xcc'),require(_0x8fb5('0xcd')));_0x31bf10['use'](_0x8fb5('0xce'),require(_0x8fb5('0xcf')));_0x31bf10[_0x8fb5('0x13')]('/api/square/odbc',require(_0x8fb5('0xd0')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xd1'),require('./api/squareProject'));_0x31bf10['use'](_0x8fb5('0xd2'),require(_0x8fb5('0xd3')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xd4'),require(_0x8fb5('0xd5')));_0x31bf10[_0x8fb5('0x13')]('/api/teams',require(_0x8fb5('0xd6')));_0x31bf10['use'](_0x8fb5('0xd7'),require('./api/license'));_0x31bf10[_0x8fb5('0x13')]('/api/campaigns',require(_0x8fb5('0xd8')));_0x31bf10['use']('/api/migrations',require(_0x8fb5('0xd9')));_0x31bf10['use']('/api/attachments',require('./api/attachment'));_0x31bf10['use'](_0x8fb5('0xda'),require(_0x8fb5('0xdb')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xdc'),require(_0x8fb5('0xdd')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xde'),require('./api/chatTransferReport'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xdf'),require(_0x8fb5('0xe0')));_0x31bf10['use'](_0x8fb5('0xe1'),require(_0x8fb5('0xe2')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xe3'),require(_0x8fb5('0xe4')));_0x31bf10['use'](_0x8fb5('0xe5'),require(_0x8fb5('0xe6')));_0x31bf10[_0x8fb5('0x13')]('/api/voice/prefixes',require(_0x8fb5('0xe7')));_0x31bf10[_0x8fb5('0x13')]('/api/userProfiles',require(_0x8fb5('0xe8')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xe9'),require(_0x8fb5('0xea')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xeb'),require(_0x8fb5('0xec')));_0x31bf10['use'](_0x8fb5('0xed'),require('./api/notification'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xee'),require(_0x8fb5('0xef')));_0x31bf10['use'](_0x8fb5('0xf0'),require(_0x8fb5('0xf1')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xf2'),require(_0x8fb5('0xf3')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xf4'),require(_0x8fb5('0xf5')));_0x31bf10['use'](_0x8fb5('0xf6'),require(_0x8fb5('0xf7')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xf8'),require(_0x8fb5('0xf9')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xfa'),require('./api/whatsappQueue'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xfb'),require(_0x8fb5('0xfc')));_0x31bf10['use']('/api/auth/local',require('./api/authLocal'));_0x31bf10[_0x8fb5('0x13')]('/api/auth/google',require(_0x8fb5('0xfd')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0xfe'),require(_0x8fb5('0xff')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x100'),require(_0x8fb5('0x101')));_0x31bf10['use'](_0x8fb5('0x102'),require(_0x8fb5('0x103')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x104'),require(_0x8fb5('0x105')));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x106'),require('./api/pm2'));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x107'),require(_0x8fb5('0x108')));_0x31bf10[_0x8fb5('0x13')]('/apidoc',express[_0x8fb5('0x109')](path['join'](config[_0x8fb5('0x10a')],_0x8fb5('0x10b'))));_0x31bf10[_0x8fb5('0x13')]('/www',express[_0x8fb5('0x109')](path['join'](config[_0x8fb5('0x10a')],'/www')));_0x31bf10[_0x8fb5('0x13')]('/demo',express[_0x8fb5('0x109')](path['join'](config[_0x8fb5('0x10a')],_0x8fb5('0x10c'))));_0x31bf10[_0x8fb5('0x13')]('/snippet',express[_0x8fb5('0x109')](path['join'](config[_0x8fb5('0x10a')],_0x8fb5('0x10d'),_0x8fb5('0x10e'))));_0x31bf10[_0x8fb5('0x13')](_0x8fb5('0x10f'),express['static'](path[_0x8fb5('0x110')](config[_0x8fb5('0x10a')],_0x8fb5('0x111'))));_0x31bf10[_0x8fb5('0x112')](_0x8fb5('0x113'))['get'](errors[0x194]);_0x31bf10[_0x8fb5('0x112')]('/*')[_0x8fb5('0x114')](function(_0x2b24ab,_0x59bf5b){_0x59bf5b[_0x8fb5('0x115')](path['resolve'](_0x31bf10['get'](_0x8fb5('0x116'))+_0x8fb5('0x117')));});}; \ No newline at end of file +var _0xb354=['./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/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/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','util','./config/environment','./config/logger','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','x-forwarded-for','remoteAddress','url','statusCode','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','connection','responseTime','name','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/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/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables'];(function(_0x4c71f9,_0x34cd73){var _0x427fdb=function(_0x3fd83f){while(--_0x3fd83f){_0x4c71f9['push'](_0x4c71f9['shift']());}};_0x427fdb(++_0x34cd73);}(_0xb354,0x95));var _0x4b35=function(_0x4cbe36,_0x31f174){_0x4cbe36=_0x4cbe36-0x0;var _0x1c2aa2=_0xb354[_0x4cbe36];return _0x1c2aa2;};'use strict';var path=require(_0x4b35('0x0'));var express=require(_0x4b35('0x1'));var ewinston=require('express-winston');var util=require(_0x4b35('0x2'));var errors=require('./errors');var config=require(_0x4b35('0x3'));var logger=require(_0x4b35('0x4'))('api');var authLogger=require(_0x4b35('0x4'))('auth');exports[_0x4b35('0x5')]=function(_0x318ef7){_0x318ef7[_0x4b35('0x6')](ewinston[_0x4b35('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1173fc,_0xf2db38){return util[_0x4b35('0x8')](_0x4b35('0x9'),_0x1173fc['method'],_0x1173fc[_0x4b35('0xa')][_0x4b35('0xb')]?_0x1173fc[_0x4b35('0xa')][_0x4b35('0xb')]:_0x1173fc['connection'][_0x4b35('0xc')]||_0x1173fc['ip'],_0x1173fc[_0x4b35('0xd')],_0xf2db38[_0x4b35('0xe')],_0xf2db38['responseTime'],_0x1173fc[_0x4b35('0xf')]?_0x1173fc[_0x4b35('0xf')]['id']:null,_0x1173fc[_0x4b35('0xf')]?_0x1173fc[_0x4b35('0xf')]['name']:null,_0x1173fc[_0x4b35('0xf')]?_0x1173fc[_0x4b35('0xf')][_0x4b35('0x10')]:null);}}));_0x318ef7[_0x4b35('0x6')](ewinston[_0x4b35('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1b3755,_0x1642a3){var _0x50f36c=_0x4b35('0x11');if(_0x1b3755[_0x4b35('0x12')]&&_0x1b3755[_0x4b35('0x12')]['device']&&_0x1b3755[_0x4b35('0x12')][_0x4b35('0x13')]){_0x50f36c=_0x4b35('0x14');}return util[_0x4b35('0x8')](_0x50f36c,_0x1b3755[_0x4b35('0x15')],_0x1b3755[_0x4b35('0xa')][_0x4b35('0xb')]?_0x1b3755[_0x4b35('0xa')]['x-forwarded-for']:_0x1b3755[_0x4b35('0x16')][_0x4b35('0xc')]||_0x1b3755['ip'],_0x1b3755[_0x4b35('0xd')],_0x1642a3[_0x4b35('0xe')],_0x1642a3[_0x4b35('0x17')],_0x1b3755['user']?_0x1b3755[_0x4b35('0xf')]['id']:null,_0x1b3755['user']?_0x1b3755[_0x4b35('0xf')][_0x4b35('0x18')]:null,_0x1b3755[_0x4b35('0xf')]?_0x1b3755['user'][_0x4b35('0x10')]:null,_0x1b3755['body']&&_0x1b3755[_0x4b35('0x12')][_0x4b35('0x19')]?_0x1b3755[_0x4b35('0x12')][_0x4b35('0x19')]:_0x4b35('0x1a'),_0x1b3755[_0x4b35('0x12')]&&_0x1b3755[_0x4b35('0x12')][_0x4b35('0x13')]?_0x1b3755['body'][_0x4b35('0x13')]:'',_0x1b3755['body']&&_0x1b3755[_0x4b35('0x12')][_0x4b35('0x1b')]?_0x1b3755[_0x4b35('0x12')]['agent_name']:'');},'ignoreRoute':function(_0x17666a){var _0x2e86bb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2e86bb[_0x4b35('0x1c')](_0x17666a[_0x4b35('0xd')]);}}));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x1d'),require(_0x4b35('0x1e')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x1f'),require('./api/voiceChanSpy'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x20'),require(_0x4b35('0x21')));_0x318ef7[_0x4b35('0x6')]('/api/voice/extensions',require(_0x4b35('0x22')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x23'),require(_0x4b35('0x24')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x25'),require(_0x4b35('0x26')));_0x318ef7['use'](_0x4b35('0x27'),require(_0x4b35('0x28')));_0x318ef7['use'](_0x4b35('0x29'),require(_0x4b35('0x2a')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x2b'),require(_0x4b35('0x2c')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x2d'),require(_0x4b35('0x2e')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x2f'),require(_0x4b35('0x30')));_0x318ef7['use'](_0x4b35('0x31'),require(_0x4b35('0x32')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x33'),require('./api/voiceAgentReport'));_0x318ef7['use']('/api/voice/queues/reports',require(_0x4b35('0x34')));_0x318ef7['use']('/api/members/reports',require(_0x4b35('0x35')));_0x318ef7[_0x4b35('0x6')]('/api/trunks',require(_0x4b35('0x36')));_0x318ef7[_0x4b35('0x6')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x318ef7['use'](_0x4b35('0x37'),require('./api/mailServerOut'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x38'),require('./api/mailAccount'));_0x318ef7['use'](_0x4b35('0x39'),require(_0x4b35('0x3a')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x3b'),require(_0x4b35('0x3c')));_0x318ef7['use'](_0x4b35('0x3d'),require(_0x4b35('0x3e')));_0x318ef7['use'](_0x4b35('0x3f'),require(_0x4b35('0x40')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x41'),require('./api/mailApplication'));_0x318ef7['use'](_0x4b35('0x42'),require(_0x4b35('0x43')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x44'),require(_0x4b35('0x45')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x46'),require('./api/dashboardItem'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x47'),require(_0x4b35('0x48')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x49'),require(_0x4b35('0x4a')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x4b'),require(_0x4b35('0x4c')));_0x318ef7['use'](_0x4b35('0x4d'),require(_0x4b35('0x4e')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x4f'),require(_0x4b35('0x50')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x51'),require(_0x4b35('0x52')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x53'),require('./api/smsAccount'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x54'),require(_0x4b35('0x55')));_0x318ef7['use']('/api/sms/interactions',require(_0x4b35('0x56')));_0x318ef7['use'](_0x4b35('0x57'),require(_0x4b35('0x58')));_0x318ef7[_0x4b35('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x318ef7['use'](_0x4b35('0x59'),require(_0x4b35('0x5a')));_0x318ef7[_0x4b35('0x6')]('/api/openchannel/applications',require(_0x4b35('0x5b')));_0x318ef7['use'](_0x4b35('0x5c'),require(_0x4b35('0x5d')));_0x318ef7['use'](_0x4b35('0x5e'),require(_0x4b35('0x5f')));_0x318ef7['use'](_0x4b35('0x60'),require(_0x4b35('0x61')));_0x318ef7[_0x4b35('0x6')]('/api/chat/websites',require(_0x4b35('0x62')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x63'),require(_0x4b35('0x64')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x65'),require(_0x4b35('0x66')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x67'),require(_0x4b35('0x68')));_0x318ef7['use']('/api/chat/messages',require(_0x4b35('0x69')));_0x318ef7['use'](_0x4b35('0x6a'),require(_0x4b35('0x6b')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x6c'),require(_0x4b35('0x6d')));_0x318ef7[_0x4b35('0x6')]('/api/chat/groups',require(_0x4b35('0x6e')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x6f'),require(_0x4b35('0x70')));_0x318ef7[_0x4b35('0x6')]('/api/cm/companies',require(_0x4b35('0x71')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x72'),require('./api/cmContact'));_0x318ef7[_0x4b35('0x6')]('/api/cm/hopper',require('./api/cmHopper'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x73'),require(_0x4b35('0x74')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x75'),require('./api/cmHopperFinal'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x76'),require(_0x4b35('0x77')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x78'),require(_0x4b35('0x79')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x7a'),require(_0x4b35('0x7b')));_0x318ef7['use'](_0x4b35('0x7c'),require(_0x4b35('0x7d')));_0x318ef7[_0x4b35('0x6')]('/api/canned_answers',require(_0x4b35('0x7e')));_0x318ef7[_0x4b35('0x6')]('/api/dispositions',require(_0x4b35('0x7f')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x80'),require(_0x4b35('0x81')));_0x318ef7[_0x4b35('0x6')]('/api/intervals',require(_0x4b35('0x82')));_0x318ef7[_0x4b35('0x6')]('/api/pauses',require('./api/pause'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x83'),require(_0x4b35('0x84')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x85'),require(_0x4b35('0x86')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x87'),require('./api/schedule'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x88'),require(_0x4b35('0x89')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x8a'),require(_0x4b35('0x8b')));_0x318ef7['use'](_0x4b35('0x8c'),require(_0x4b35('0x8d')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x8e'),require(_0x4b35('0x8f')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x90'),require(_0x4b35('0x91')));_0x318ef7['use']('/api/integrations',require(_0x4b35('0x92')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x93'),require('./api/integrationReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x94'),require('./api/analyticCustomReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x95'),require(_0x4b35('0x96')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x97'),require(_0x4b35('0x98')));_0x318ef7[_0x4b35('0x6')]('/api/analytics/metrics',require(_0x4b35('0x99')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x9a'),require(_0x4b35('0x9b')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x9c'),require(_0x4b35('0x9d')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x9e'),require('./api/intSalesforceAccount'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x9f'),require('./api/intSalesforceConfiguration'));_0x318ef7[_0x4b35('0x6')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa0'),require('./api/intSugarcrmAccount'));_0x318ef7[_0x4b35('0x6')]('/api/integrations/sugarcrm/configurations',require(_0x4b35('0xa1')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa2'),require('./api/intSugarcrmField'));_0x318ef7[_0x4b35('0x6')]('/api/integrations/desk/accounts',require(_0x4b35('0xa3')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa4'),require(_0x4b35('0xa5')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa6'),require('./api/intDeskField'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa7'),require(_0x4b35('0xa8')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xa9'),require(_0x4b35('0xaa')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xab'),require('./api/intZohoField'));_0x318ef7[_0x4b35('0x6')]('/api/integrations/zendesk/accounts',require(_0x4b35('0xac')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xad'),require('./api/intZendeskConfiguration'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xae'),require('./api/intZendeskField'));_0x318ef7['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xaf'),require(_0x4b35('0xb0')));_0x318ef7['use']('/api/integrations/freshdesk/fields',require(_0x4b35('0xb1')));_0x318ef7['use'](_0x4b35('0xb2'),require(_0x4b35('0xb3')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xb4'),require(_0x4b35('0xb5')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xb6'),require(_0x4b35('0xb7')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xb8'),require(_0x4b35('0xb9')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xba'),require(_0x4b35('0xbb')));_0x318ef7[_0x4b35('0x6')]('/api/integrations/servicenow/fields',require(_0x4b35('0xbc')));_0x318ef7['use'](_0x4b35('0xbd'),require(_0x4b35('0xbe')));_0x318ef7['use'](_0x4b35('0xbf'),require(_0x4b35('0xc0')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xc1'),require('./api/intDynamics365Field'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xc2'),require(_0x4b35('0xc3')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xc4'),require(_0x4b35('0xc5')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xc6'),require(_0x4b35('0xc7')));_0x318ef7['use']('/api/networks',require(_0x4b35('0xc8')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xc9'),require(_0x4b35('0xca')));_0x318ef7[_0x4b35('0x6')]('/api/chat/internal/messages',require(_0x4b35('0xcb')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xcc'),require(_0x4b35('0xcd')));_0x318ef7['use'](_0x4b35('0xce'),require('./api/jscriptyQuestionReport'));_0x318ef7[_0x4b35('0x6')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xcf'),require(_0x4b35('0xd0')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xd1'),require(_0x4b35('0xd2')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xd3'),require(_0x4b35('0xd4')));_0x318ef7['use']('/api/jscripty/projects',require(_0x4b35('0xd5')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xd6'),require(_0x4b35('0xd7')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xd8'),require('./api/squareOdbc'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xd9'),require(_0x4b35('0xda')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xdb'),require(_0x4b35('0xdc')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xdd'),require(_0x4b35('0xde')));_0x318ef7['use'](_0x4b35('0xdf'),require(_0x4b35('0xe0')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xe1'),require(_0x4b35('0xe2')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xe3'),require(_0x4b35('0xe4')));_0x318ef7[_0x4b35('0x6')]('/api/migrations',require('./api/migration'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xe5'),require(_0x4b35('0xe6')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xe7'),require(_0x4b35('0xe8')));_0x318ef7[_0x4b35('0x6')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xe9'),require('./api/chatTransferReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xea'),require('./api/faxTransferReport'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xeb'),require(_0x4b35('0xec')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xed'),require(_0x4b35('0xee')));_0x318ef7['use'](_0x4b35('0xef'),require(_0x4b35('0xf0')));_0x318ef7[_0x4b35('0x6')]('/api/voice/prefixes',require(_0x4b35('0xf1')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xf2'),require(_0x4b35('0xf3')));_0x318ef7['use'](_0x4b35('0xf4'),require('./api/userProfileSection'));_0x318ef7['use'](_0x4b35('0xf5'),require(_0x4b35('0xf6')));_0x318ef7[_0x4b35('0x6')]('/api/notifications',require('./api/notification'));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xf7'),require(_0x4b35('0xf8')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xf9'),require(_0x4b35('0xfa')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xfb'),require(_0x4b35('0xfc')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xfd'),require(_0x4b35('0xfe')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0xff'),require(_0x4b35('0x100')));_0x318ef7[_0x4b35('0x6')]('/api/whatsapp/reports/transfer',require(_0x4b35('0x101')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x102'),require(_0x4b35('0x103')));_0x318ef7['use'](_0x4b35('0x104'),require(_0x4b35('0x105')));_0x318ef7['use'](_0x4b35('0x106'),require(_0x4b35('0x107')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x108'),require(_0x4b35('0x109')));_0x318ef7[_0x4b35('0x6')]('/api/jira',require(_0x4b35('0x10a')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x10b'),require(_0x4b35('0x10c')));_0x318ef7['use'](_0x4b35('0x10d'),require(_0x4b35('0x10e')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x10f'),require(_0x4b35('0x110')));_0x318ef7['use'](_0x4b35('0x111'),require(_0x4b35('0x112')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x113'),require(_0x4b35('0x114')));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x115'),express[_0x4b35('0x116')](path[_0x4b35('0x117')](config[_0x4b35('0x118')],_0x4b35('0x115'))));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x119'),express[_0x4b35('0x116')](path[_0x4b35('0x117')](config[_0x4b35('0x118')],_0x4b35('0x119'))));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x11a'),express[_0x4b35('0x116')](path['join'](config[_0x4b35('0x118')],_0x4b35('0x11a'))));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x11b'),express['static'](path[_0x4b35('0x117')](config[_0x4b35('0x118')],_0x4b35('0x11c'),_0x4b35('0x11d'))));_0x318ef7[_0x4b35('0x6')](_0x4b35('0x11e'),express['static'](path[_0x4b35('0x117')](config['root'],_0x4b35('0x11f'))));_0x318ef7[_0x4b35('0x120')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x4b35('0x121')](errors[0x194]);_0x318ef7[_0x4b35('0x120')]('/*')[_0x4b35('0x121')](function(_0x5e0400,_0x5b2b0d){_0x5b2b0d[_0x4b35('0x122')](path[_0x4b35('0x123')](_0x318ef7[_0x4b35('0x121')](_0x4b35('0x124'))+_0x4b35('0x125')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index dd748be..4cb0949 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e9a=['../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','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/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc'];(function(_0x1e8183,_0x26eae8){var _0xc2a839=function(_0x3dc673){while(--_0x3dc673){_0x1e8183['push'](_0x1e8183['shift']());}};_0xc2a839(++_0x26eae8);}(_0x8e9a,0x1ac));var _0xa8e9=function(_0x126590,_0x3d616f){_0x126590=_0x126590-0x0;var _0x31d849=_0x8e9a[_0x126590];return _0x31d849;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa8e9('0x0'));var _=require(_0xa8e9('0x1'));var config=require(_0xa8e9('0x2'));exports[_0xa8e9('0x3')]=function(){return new BPromise(function(_0x19ee42,_0x1c83d2){var _0x1ad2dc={};_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x4')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x6')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/voiceQueue/voiceQueue.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x7')));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x8')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x9')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0xa')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0xb')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0xc')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0xd')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0xe')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0xf')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/mailQueue/mailQueue.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x10')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/mailMessage/mailMessage.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x11')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x12')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/faxAccount/faxAccount.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x13')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x14')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/faxMessage/faxMessage.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x15')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x16')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x17')));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x18')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/smsMessage/smsMessage.rpc'));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x19')));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x1a')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x1b')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x1c')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x1d')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x1e')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/cmContact/cmContact.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x1f')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x20')));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x21')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x22')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x23')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/interval/interval.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x24')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x25')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/template/template.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/trigger/trigger.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x26')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x27')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x28')));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x29')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2a')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2b')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2c')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2d')));_0x1ad2dc=_['merge'](_0x1ad2dc,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2e')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x2f')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x30')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x31')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x32')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x33')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/campaign/campaign.rpc'));_0x1ad2dc=_['merge'](_0x1ad2dc,require(_0xa8e9('0x34')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x35')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x36')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x37')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x38')));_0x1ad2dc=_[_0xa8e9('0x5')](_0x1ad2dc,require(_0xa8e9('0x39')));var _0x151734=jayson[_0xa8e9('0x3a')](_0x1ad2dc)[_0xa8e9('0x3b')]();var _0x244125=config['rpc'][_0xa8e9('0x3c')]||config['port']+0x1;var _0x49dab5=config[_0xa8e9('0x3d')]['ip']||_0xa8e9('0x3e');_0x151734['on'](_0xa8e9('0x3f'),function(_0x1dedee){return _0x1c83d2(_0x1dedee);});_0x151734[_0xa8e9('0x3')](_0x244125,_0x49dab5,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x49dab5,_0x244125);require(_0xa8e9('0x40'))[_0xa8e9('0x41')]();return _0x19ee42(_0xa8e9('0x42')+_0x49dab5+':'+_0x244125);});});}; \ No newline at end of file +var _0xae27=['../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.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/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.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/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xae27,0xf2));var _0x7ae2=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0xae27[_0x375492];return _0x18ba5b;};'use strict';var jayson=require(_0x7ae2('0x0'));var BPromise=require(_0x7ae2('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0x7ae2('0x2')]=function(){return new BPromise(function(_0x5e3ed7,_0x2ae55a){var _0x557b76={};_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x4')));_0x557b76=_['merge'](_0x557b76,require('../api/voiceExtension/voiceExtension.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x5')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x6')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x7')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x8')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x9')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0xa')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0xb')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/trunk/trunk.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0xc')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0xd')));_0x557b76=_['merge'](_0x557b76,require('../api/mailServerIn/mailServerIn.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0xe')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/mailQueue/mailQueue.rpc'));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0xf')));_0x557b76=_['merge'](_0x557b76,require('../api/mailMessage/mailMessage.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x10')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x11')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x12')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x13')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x14')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x15')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x16')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x17')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x18')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x19')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x1a')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x1b')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x1c')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x1d')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x1e')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x1f')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x20')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x21')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x22')));_0x557b76=_['merge'](_0x557b76,require('../api/chatQueue/chatQueue.rpc'));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x23')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x24')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x25')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x26')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x27')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x28')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/pause/pause.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x29')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2a')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2b')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2c')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2d')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2e')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x2f')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x30')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x31')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x32')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x33')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x34')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x35')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x36')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x37')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/squareReport/squareReport.rpc'));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x38')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x39')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x3a')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x3b')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x3c')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require('../api/campaign/campaign.rpc'));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x3d')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x3e')));_0x557b76=_['merge'](_0x557b76,require(_0x7ae2('0x3f')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x40')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x41')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x42')));_0x557b76=_[_0x7ae2('0x3')](_0x557b76,require(_0x7ae2('0x43')));var _0x1e6db3=jayson[_0x7ae2('0x44')](_0x557b76)[_0x7ae2('0x45')]();var _0x483467=config[_0x7ae2('0x46')][_0x7ae2('0x47')]||config[_0x7ae2('0x47')]+0x1;var _0xe9242b=config[_0x7ae2('0x46')]['ip']||_0x7ae2('0x48');_0x1e6db3['on']('error',function(_0x544531){return _0x2ae55a(_0x544531);});_0x1e6db3['listen'](_0x483467,_0xe9242b,function(){console[_0x7ae2('0x49')](_0x7ae2('0x4a'),_0xe9242b,_0x483467);require(_0x7ae2('0x4b'))['default']();return _0x5e3ed7(_0x7ae2('0x4c')+_0xe9242b+':'+_0x483467);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e23822a..f68be93 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 _0xadf1=['function','no\x20code','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','command=','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','noop','exec','isArray','format','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','getVariable','log','getvariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','exports','events','./reply','./error','utf8','setTimeout','headers','ready','line','toLowerCase','emit','hangup','substring','520-Invalid','520\x20End\x20of\x20proper'];(function(_0x34134f,_0x467b97){var _0x40e107=function(_0x310d6e){while(--_0x310d6e){_0x34134f['push'](_0x34134f['shift']());}};_0x40e107(++_0x467b97);}(_0xadf1,0x84));var _0x1adf=function(_0x3d7231,_0x2c2f06){_0x3d7231=_0x3d7231-0x0;var _0x84ae01=_0xadf1[_0x3d7231];return _0x84ae01;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x1adf('0x0'))['EventEmitter'];var AGIReply=require(_0x1adf('0x1'));var AGIError=require(_0x1adf('0x2'));function AGIChannel(_0x27ad38){var _0x318146=this,_0x18e4d8=new AGIReply(),_0x61d49f=![],_0x509f07={};EventEmitter['call'](_0x318146);_0x27ad38['setEncoding'](_0x1adf('0x3'));_0x27ad38[_0x1adf('0x4')](0x8*0x3c*0x3c*0x3e8);_0x18e4d8['setEncoding'](_0x1adf('0x3'));_0x18e4d8['on'](_0x1adf('0x5'),function(_0x258f4e){for(var _0x5b00f1 in _0x258f4e){_0x318146[_0x5b00f1]=_0x258f4e[_0x5b00f1];}_0x318146['emit'](_0x1adf('0x6'));});_0x18e4d8['on'](_0x1adf('0x7'),function(_0xa9279a){if(_0xa9279a[_0x1adf('0x8')]()=='hangup'){_0x318146[_0x1adf('0x9')](_0x1adf('0xa'));return;}if(_0xa9279a[_0x1adf('0xb')](0x0,0xb)==_0x1adf('0xc')){_0x61d49f=!![];}if(_0x61d49f){_0x509f07['rx']+=_0xa9279a+'\x0a';if(_0xa9279a['search'](_0x1adf('0xd'))!=-0x1){_0x61d49f=![];}}else{_0x509f07['rx']=_0xa9279a;}if(_0x61d49f){return;}if(typeof _0x509f07['cb']==_0x1adf('0xe')){var _0x3db2b9=_0x509f07['rx'][_0x1adf('0xb')](0x0,0x3),_0x28f5ef=null,_0x43aedd=null;_0x3db2b9=parseInt(_0x3db2b9);if(isNaN(_0x3db2b9)){_0x509f07['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1adf('0xf')});return;}if(_0x3db2b9!=0xc8){_0x509f07['cb'](null,{'code':_0x3db2b9,'result':-0x1,'extra':'KO'});return;}_0x28f5ef=_0x509f07['rx'][_0x1adf('0xb')](0x4)['replace'](_0x1adf('0x10'),'');if(_0x28f5ef[_0x1adf('0x11')]('\x20')!=-0x1){_0x28f5ef=_0x28f5ef[_0x1adf('0x12')](0x0,_0x28f5ef['indexOf']('\x20'));}if(_[_0x1adf('0x13')](_0x28f5ef,'-1')){_0x28f5ef=parseInt(_0x28f5ef);}_0x43aedd=_0x509f07['rx'][_0x1adf('0x14')]('\x20');if(_0x43aedd[_0x1adf('0x15')]==0x3){_0x43aedd=_0x43aedd[0x2][_0x1adf('0xb')](0x1,_0x43aedd[0x2][_0x1adf('0x15')]-0x1);}else if(_0x43aedd[_0x1adf('0x15')]>0x3){var _0x2a4d06=/\((.+)\)/;var _0x4278bc=_0x509f07['rx']['match'](_0x2a4d06);if(_0x4278bc){_0x43aedd=_0x4278bc[0x1];}else{_0x43aedd=null;}}else{_0x43aedd=null;}_0x509f07['cb'](null,{'code':_0x3db2b9,'result':_0x28f5ef,'extra':_0x43aedd});}});_0x27ad38['on'](_0x1adf('0x16'),function(_0x3a592b){_0x318146[_0x1adf('0x9')](_0x1adf('0x16'),new AGIError(_0x1adf('0x17'),_0x3a592b['code']));});_0x27ad38['on'](_0x1adf('0x18'),function(){_0x318146['emit'](_0x1adf('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x27ad38['on']('timeout',function(){_0x318146['emit'](_0x1adf('0x19'),new AGIError(_0x1adf('0x1a')));_0x27ad38[_0x1adf('0x1b')]();});_0x27ad38[_0x1adf('0x1c')](_0x18e4d8);this[_0x1adf('0x1d')]=function(_0x4320c8,_0x978385){console['log'](_0x1adf('0x1e'),_0x4320c8);var _0x4320c8=_0x4320c8||'',_0x978385=typeof _0x978385==_0x1adf('0xe')?_0x978385:new Function();_0x509f07={'tx':_0x4320c8,'rx':'','cb':_0x978385};_0x27ad38[_0x1adf('0x1f')](_0x4320c8+'\x0a');},this[_0x1adf('0x18')]=function(){_0x27ad38[_0x1adf('0x1b')]();};}util[_0x1adf('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x1adf('0x21')][_0x1adf('0x22')]=function(_0x573eaf){return this[_0x1adf('0x1d')][_0x1adf('0x23')](this,_0x573eaf);};AGIChannel[_0x1adf('0x21')][_0x1adf('0x24')]=function(){return this[_0x1adf('0x22')](_0x1adf('0x25'));};AGIChannel[_0x1adf('0x21')][_0x1adf('0x26')]=function(_0x42ab59,_0x3ce979,_0x4241e6){_0x42ab59=_0x42ab59===undefined?_0x1adf('0x27'):_0x42ab59;_0x3ce979=_0x3ce979===undefined?'5':_0x3ce979;_0x4241e6=_0x4241e6===undefined?'1':_0x4241e6;return this[_0x1adf('0x22')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x42ab59,_0x3ce979*0x3e8,_0x4241e6));};AGIChannel[_0x1adf('0x21')][_0x1adf('0x28')]=function(_0x5593b8){_0x5593b8=_0x5593b8||'NO\x20MESSAGE';return this[_0x1adf('0x22')](util['format']('VERBOSE\x20\x22%s\x22',_0x5593b8));};AGIChannel['prototype'][_0x1adf('0x29')]=function(_0x21a79c,_0xfb1295){if(_[_0x1adf('0x2a')](_0xfb1295)){return this[_0x1adf('0x22')](util[_0x1adf('0x2b')]('EXEC\x20%s\x20%s',_0x21a79c,_0xfb1295['join'](',')));}return this['sendRequest'](util[_0x1adf('0x2b')](_0x1adf('0x2c'),_0x21a79c,_0xfb1295));};AGIChannel[_0x1adf('0x21')]['setContext']=function(_0x268f9a){return this[_0x1adf('0x22')](util[_0x1adf('0x2b')]('SET\x20CONTEXT\x20%s',_0x268f9a));};AGIChannel['prototype'][_0x1adf('0x2d')]=function(_0x5d0cdf){return this['sendRequest'](util[_0x1adf('0x2b')](_0x1adf('0x2e'),_0x5d0cdf));};AGIChannel[_0x1adf('0x21')][_0x1adf('0x2f')]=function(_0x5755b4){return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x30'),_0x5755b4));};AGIChannel['prototype']['hangup']=function(){return this[_0x1adf('0x22')](_0x1adf('0x31'));};AGIChannel[_0x1adf('0x21')]['setVariable']=function(_0x142375,_0x3c311d){var _0x3dbccd=_[_0x1adf('0x32')](_0x3c311d)||_[_0x1adf('0x33')](_0x3c311d)?_0x3c311d[_0x1adf('0x34')]():_0x3c311d;return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x35'),_0x142375,_0x3dbccd?_0x3dbccd['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1adf('0x21')]['sayNumber']=function(_0x45c58d,_0x399787){return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x36'),_0x45c58d,_0x399787));};AGIChannel[_0x1adf('0x21')]['sayDigits']=function(_0x49a9ac,_0x1a3062){return this['sendRequest'](util['format'](_0x1adf('0x37'),_0x49a9ac,_0x1a3062));};AGIChannel[_0x1adf('0x21')][_0x1adf('0x38')]=function(_0x2225bf,_0x1df1e6){return this[_0x1adf('0x22')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2225bf,_0x1df1e6));};AGIChannel['prototype'][_0x1adf('0x39')]=function(_0x39799a,_0x1d9d05,_0x20e237){_0x1d9d05=_0x1d9d05||this[_0x1adf('0x3a')];_0x20e237=_0x20e237||0x1;this[_0x1adf('0x3b')](_0x39799a);this[_0x1adf('0x2d')](_0x1d9d05);this[_0x1adf('0x2f')](_0x20e237);return this[_0x1adf('0x28')](util[_0x1adf('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x39799a,_0x1d9d05,_0x20e237));};AGIChannel['prototype'][_0x1adf('0x3c')]=function(_0x5e9992){console[_0x1adf('0x3d')](_0x1adf('0x3e'),_0x5e9992);return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x3f'),_0x5e9992));};AGIChannel['prototype'][_0x1adf('0x40')]=function(_0x16255e,_0x1c8241,_0x8df757,_0xa3ced6,_0x12faa8,_0xd4aa04){_0x1c8241=_0x1c8241||_0x1adf('0x41');_0x8df757=_0x8df757||'';_0xa3ced6=_0xa3ced6===undefined?-0x1:_0xa3ced6==='-1'?-0x1:_0xa3ced6*0x3e8;_0x12faa8=_0x12faa8===undefined?'':'s='+_0x12faa8;_0xd4aa04=_0xd4aa04?_0x1adf('0x42'):'';return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x43'),_0x16255e,_0x1c8241,_0x8df757,_0xa3ced6,_0xd4aa04,_0x12faa8));};AGIChannel['prototype']['streamFile']=function(_0x373ba7,_0xf2ac53){_0xf2ac53=_0xf2ac53||'';return this[_0x1adf('0x22')](util[_0x1adf('0x2b')](_0x1adf('0x44'),_0x373ba7,_0xf2ac53));};AGIChannel['prototype'][_0x1adf('0x45')]=function(_0x1bacf5){return this[_0x1adf('0x29')]('AGI',_0x1bacf5);};AGIChannel[_0x1adf('0x21')][_0x1adf('0x46')]=function(_0x95d7f9){return this[_0x1adf('0x29')](_0x1adf('0x47'),_0x95d7f9);};AGIChannel[_0x1adf('0x21')]['error']=function(_0x44ef56,_0x56ba8b){this['noop'](util[_0x1adf('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x44ef56['id'],_0x44ef56['label'],_0x56ba8b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1adf('0x48')]=AGIChannel; \ No newline at end of file +var _0xa6bb=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','getVariable','getvariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','line','toLowerCase','emit','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','log','command=','write','inherits','prototype','sendRequest','sync','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0x5ec142,_0x2bf63f){var _0x17e35f=function(_0x3c20bf){while(--_0x3c20bf){_0x5ec142['push'](_0x5ec142['shift']());}};_0x17e35f(++_0x2bf63f);}(_0xa6bb,0x14e));var _0xba6b=function(_0x3096d0,_0xeea5af){_0x3096d0=_0x3096d0-0x0;var _0x557d26=_0xa6bb[_0x3096d0];return _0x557d26;};'use strict';var util=require(_0xba6b('0x0'));var _=require(_0xba6b('0x1'));var EventEmitter=require(_0xba6b('0x2'))[_0xba6b('0x3')];var AGIReply=require(_0xba6b('0x4'));var AGIError=require(_0xba6b('0x5'));function AGIChannel(_0x5494c7){var _0x206af4=this,_0x28df76=new AGIReply(),_0x279245=![],_0x430fcb={};EventEmitter[_0xba6b('0x6')](_0x206af4);_0x5494c7[_0xba6b('0x7')](_0xba6b('0x8'));_0x5494c7['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x28df76[_0xba6b('0x7')](_0xba6b('0x8'));_0x28df76['on'](_0xba6b('0x9'),function(_0xda2558){for(var _0x32f183 in _0xda2558){_0x206af4[_0x32f183]=_0xda2558[_0x32f183];}_0x206af4['emit']('ready');});_0x28df76['on'](_0xba6b('0xa'),function(_0x2661fb){if(_0x2661fb[_0xba6b('0xb')]()=='hangup'){_0x206af4[_0xba6b('0xc')](_0xba6b('0xd'));return;}if(_0x2661fb[_0xba6b('0xe')](0x0,0xb)=='520-Invalid'){_0x279245=!![];}if(_0x279245){_0x430fcb['rx']+=_0x2661fb+'\x0a';if(_0x2661fb[_0xba6b('0xf')](_0xba6b('0x10'))!=-0x1){_0x279245=![];}}else{_0x430fcb['rx']=_0x2661fb;}if(_0x279245){return;}if(typeof _0x430fcb['cb']==_0xba6b('0x11')){var _0x483467=_0x430fcb['rx'][_0xba6b('0xe')](0x0,0x3),_0x7c1141=null,_0x2aee4a=null;_0x483467=parseInt(_0x483467);if(isNaN(_0x483467)){_0x430fcb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xba6b('0x12')});return;}if(_0x483467!=0xc8){_0x430fcb['cb'](null,{'code':_0x483467,'result':-0x1,'extra':'KO'});return;}_0x7c1141=_0x430fcb['rx'][_0xba6b('0xe')](0x4)[_0xba6b('0x13')](_0xba6b('0x14'),'');if(_0x7c1141[_0xba6b('0x15')]('\x20')!=-0x1){_0x7c1141=_0x7c1141[_0xba6b('0x16')](0x0,_0x7c1141[_0xba6b('0x15')]('\x20'));}if(_[_0xba6b('0x17')](_0x7c1141,'-1')){_0x7c1141=parseInt(_0x7c1141);}_0x2aee4a=_0x430fcb['rx'][_0xba6b('0x18')]('\x20');if(_0x2aee4a[_0xba6b('0x19')]==0x3){_0x2aee4a=_0x2aee4a[0x2][_0xba6b('0xe')](0x1,_0x2aee4a[0x2][_0xba6b('0x19')]-0x1);}else if(_0x2aee4a['length']>0x3){var _0x310572=/\((.+)\)/;var _0x321791=_0x430fcb['rx'][_0xba6b('0x1a')](_0x310572);if(_0x321791){_0x2aee4a=_0x321791[0x1];}else{_0x2aee4a=null;}}else{_0x2aee4a=null;}_0x430fcb['cb'](null,{'code':_0x483467,'result':_0x7c1141,'extra':_0x2aee4a});}});_0x5494c7['on'](_0xba6b('0x1b'),function(_0x5a5795){_0x206af4[_0xba6b('0xc')](_0xba6b('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x5a5795[_0xba6b('0x1c')]));});_0x5494c7['on'](_0xba6b('0x1d'),function(){_0x206af4[_0xba6b('0xc')](_0xba6b('0x1d'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x5494c7['on'](_0xba6b('0x1e'),function(){_0x206af4[_0xba6b('0xc')](_0xba6b('0x1e'),new AGIError(_0xba6b('0x1f')));_0x5494c7[_0xba6b('0x20')]();});_0x5494c7[_0xba6b('0x21')](_0x28df76);this['command']=function(_0x223e72,_0x26a4e9){console[_0xba6b('0x22')](_0xba6b('0x23'),_0x223e72);var _0x223e72=_0x223e72||'',_0x26a4e9=typeof _0x26a4e9==_0xba6b('0x11')?_0x26a4e9:new Function();_0x430fcb={'tx':_0x223e72,'rx':'','cb':_0x26a4e9};_0x5494c7[_0xba6b('0x24')](_0x223e72+'\x0a');},this[_0xba6b('0x1d')]=function(){_0x5494c7[_0xba6b('0x20')]();};}util[_0xba6b('0x25')](AGIChannel,EventEmitter);AGIChannel[_0xba6b('0x26')][_0xba6b('0x27')]=function(_0x436527){return this['command'][_0xba6b('0x28')](this,_0x436527);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0xba6b('0x29'));};AGIChannel['prototype']['getData']=function(_0x1fd1b4,_0x5d5b2c,_0x53a617){_0x1fd1b4=_0x1fd1b4===undefined?_0xba6b('0x2a'):_0x1fd1b4;_0x5d5b2c=_0x5d5b2c===undefined?'5':_0x5d5b2c;_0x53a617=_0x53a617===undefined?'1':_0x53a617;return this[_0xba6b('0x27')](util[_0xba6b('0x2b')](_0xba6b('0x2c'),_0x1fd1b4,_0x5d5b2c*0x3e8,_0x53a617));};AGIChannel['prototype'][_0xba6b('0x2d')]=function(_0x3ad690){_0x3ad690=_0x3ad690||'NO\x20MESSAGE';return this[_0xba6b('0x27')](util['format'](_0xba6b('0x2e'),_0x3ad690));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x2f')]=function(_0x568ce1,_0x4518f3){if(_[_0xba6b('0x30')](_0x4518f3)){return this['sendRequest'](util['format'](_0xba6b('0x31'),_0x568ce1,_0x4518f3[_0xba6b('0x32')](',')));}return this[_0xba6b('0x27')](util['format'](_0xba6b('0x31'),_0x568ce1,_0x4518f3));};AGIChannel['prototype'][_0xba6b('0x33')]=function(_0x35cc38){return this[_0xba6b('0x27')](util[_0xba6b('0x2b')]('SET\x20CONTEXT\x20%s',_0x35cc38));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x34')]=function(_0x349af4){return this['sendRequest'](util[_0xba6b('0x2b')](_0xba6b('0x35'),_0x349af4));};AGIChannel[_0xba6b('0x26')]['setPriority']=function(_0x241812){return this[_0xba6b('0x27')](util['format'](_0xba6b('0x36'),_0x241812));};AGIChannel[_0xba6b('0x26')][_0xba6b('0xd')]=function(){return this[_0xba6b('0x27')](_0xba6b('0x37'));};AGIChannel[_0xba6b('0x26')]['setVariable']=function(_0x302783,_0x410cf2){var _0x1f01f0=_['isBoolean'](_0x410cf2)||_['isNumber'](_0x410cf2)?_0x410cf2[_0xba6b('0x38')]():_0x410cf2;return this[_0xba6b('0x27')](util[_0xba6b('0x2b')](_0xba6b('0x39'),_0x302783,_0x1f01f0?_0x1f01f0[_0xba6b('0x38')]()[_0xba6b('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xba6b('0x26')]['sayNumber']=function(_0x4c2cb6,_0x4e9a90){return this[_0xba6b('0x27')](util[_0xba6b('0x2b')](_0xba6b('0x3a'),_0x4c2cb6,_0x4e9a90));};AGIChannel['prototype'][_0xba6b('0x3b')]=function(_0x31e5e3,_0x396560){return this[_0xba6b('0x27')](util['format'](_0xba6b('0x3c'),_0x31e5e3,_0x396560));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x3d')]=function(_0x4e1adc,_0x173a31){return this[_0xba6b('0x27')](util[_0xba6b('0x2b')](_0xba6b('0x3e'),_0x4e1adc,_0x173a31));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x3f')]=function(_0x4526e0,_0x48ac65,_0x11c00f){_0x48ac65=_0x48ac65||this[_0xba6b('0x40')];_0x11c00f=_0x11c00f||0x1;this[_0xba6b('0x33')](_0x4526e0);this[_0xba6b('0x34')](_0x48ac65);this[_0xba6b('0x41')](_0x11c00f);return this[_0xba6b('0x2d')](util[_0xba6b('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x4526e0,_0x48ac65,_0x11c00f));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x42')]=function(_0x24a060){console['log'](_0xba6b('0x43'),_0x24a060);return this[_0xba6b('0x27')](util[_0xba6b('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x24a060));};AGIChannel[_0xba6b('0x26')][_0xba6b('0x44')]=function(_0x2c264d,_0x18b230,_0x42a750,_0x3d6ee1,_0x2d4ce2,_0xc60bcb){_0x18b230=_0x18b230||_0xba6b('0x45');_0x42a750=_0x42a750||'';_0x3d6ee1=_0x3d6ee1===undefined?-0x1:_0x3d6ee1==='-1'?-0x1:_0x3d6ee1*0x3e8;_0x2d4ce2=_0x2d4ce2===undefined?'':'s='+_0x2d4ce2;_0xc60bcb=_0xc60bcb?_0xba6b('0x46'):'';return this[_0xba6b('0x27')](util[_0xba6b('0x2b')](_0xba6b('0x47'),_0x2c264d,_0x18b230,_0x42a750,_0x3d6ee1,_0xc60bcb,_0x2d4ce2));};AGIChannel['prototype'][_0xba6b('0x48')]=function(_0xe7acaa,_0x2094e4){_0x2094e4=_0x2094e4||'';return this[_0xba6b('0x27')](util[_0xba6b('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xe7acaa,_0x2094e4));};AGIChannel['prototype'][_0xba6b('0x49')]=function(_0x54f399){return this[_0xba6b('0x2f')](_0xba6b('0x4a'),_0x54f399);};AGIChannel['prototype'][_0xba6b('0x4b')]=function(_0x53d3a1){return this[_0xba6b('0x2f')](_0xba6b('0x4c'),_0x53d3a1);};AGIChannel[_0xba6b('0x26')][_0xba6b('0x1b')]=function(_0x1a1712,_0xf0ce06){this[_0xba6b('0x2d')](util['format'](_0xba6b('0x4d'),_0x1a1712['id'],_0x1a1712['label'],_0xf0ce06));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xba6b('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 81a740d..fadb998 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 _0xcabc=['format','apply','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xcabc,0x16a));var _0xccab=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcabc[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xccab('0x0'),'E_AGI_ARGUMENT_PORT':_0xccab('0x1'),'E_AGI_SERVER_ERROR':_0xccab('0x2'),'E_AGI_SERVER_CLOSE':_0xccab('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xccab('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xccab('0x5'),'E_AGI_SOCKET_CLOSE':_0xccab('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xccab('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xccab('0x8'),'E_AGI_IVR_ENTRY':_0xccab('0x9')};function AGIError(_0x492d75){var _0x492d75=_0x492d75||null,_0x29f877=_0x29f877||[],_0x24b95c=0x1,_0x4a6f3c='';if(!error[_0x492d75]){_0x492d75=_0xccab('0xa');}_0x29f877[_0xccab('0xb')](error[_0x492d75]);while(arguments[_0x24b95c]){_0x29f877['push'](arguments[_0x24b95c]);_0x24b95c++;}_0x4a6f3c=util[_0xccab('0xc')][_0xccab('0xd')](util,_0x29f877);this[_0xccab('0xe')]=_0x4a6f3c;this[_0xccab('0xf')]=_0x492d75;}module[_0xccab('0x10')]=AGIError; \ No newline at end of file +var _0x6655=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x249c64,_0x421f9a){var _0x52be10=function(_0x94a670){while(--_0x94a670){_0x249c64['push'](_0x249c64['shift']());}};_0x52be10(++_0x421f9a);}(_0x6655,0x193));var _0x5665=function(_0x506538,_0x2fe4f7){_0x506538=_0x506538-0x0;var _0x360146=_0x6655[_0x506538];return _0x360146;};'use strict';var util=require(_0x5665('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x5665('0x1'),'E_AGI_SERVER_VOICE_DISABLED':_0x5665('0x2'),'E_AGI_SOCKET_ERROR':_0x5665('0x3'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5665('0x4'),'E_AGI_IVR_ENTRY':_0x5665('0x5')};function AGIError(_0x4b3985){var _0x4b3985=_0x4b3985||null,_0x1e0c75=_0x1e0c75||[],_0x50b1f8=0x1,_0x4950db='';if(!error[_0x4b3985]){_0x4b3985=_0x5665('0x6');}_0x1e0c75[_0x5665('0x7')](error[_0x4b3985]);while(arguments[_0x50b1f8]){_0x1e0c75[_0x5665('0x7')](arguments[_0x50b1f8]);_0x50b1f8++;}_0x4950db=util[_0x5665('0x8')]['apply'](util,_0x1e0c75);this[_0x5665('0x9')]=_0x4950db;this[_0x5665('0xa')]=_0x4b3985;}module[_0x5665('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index d4a616b..c489fc9 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 _0x6017=['vswitch','target','menu','invalid','includes','max\x20retry\x20reach','lodash','../../../config/logger','agi','getdigits','getsecretdigits','edges','prototype','vertices','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand'];(function(_0x12c076,_0x5bef17){var _0x2ddd18=function(_0x436336){while(--_0x436336){_0x12c076['push'](_0x12c076['shift']());}};_0x2ddd18(++_0x5bef17);}(_0x6017,0xae));var _0x7601=function(_0x15a916,_0x217dc7){_0x15a916=_0x15a916-0x0;var _0x5bda8b=_0x6017[_0x15a916];return _0x5bda8b;};'use strict';var _=require(_0x7601('0x0'));var logger=require(_0x7601('0x1'))(_0x7601('0x2'));var verticesWithRetry=['menu',_0x7601('0x3'),_0x7601('0x4')];var Graph=function(){this['vertices']={};this[_0x7601('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x7601('0x6')]['addVertex']=function(_0x5080a3){this[_0x7601('0x7')][_0x5080a3['id']]=_0x5080a3;this[_0x7601('0x5')][_0x5080a3['id']]=[];};Graph[_0x7601('0x6')][_0x7601('0x8')]=function(_0x2bc643,_0xe6e524,_0x4ff3e4){this[_0x7601('0x5')][_0x2bc643][_0x7601('0x9')]({'target':_0xe6e524,'condition':_0x4ff3e4});this[_0x7601('0xa')]+=0x1;};Graph['prototype'][_0x7601('0xb')]=function(){return _[_0x7601('0xb')](this[_0x7601('0x7')]);};Graph['prototype'][_0x7601('0xc')]=function(){return this[_0x7601('0xa')];};Graph[_0x7601('0x6')][_0x7601('0xd')]=function(_0x33658f){return this[_0x7601('0x7')][_0x33658f];};Graph[_0x7601('0x6')][_0x7601('0xe')]=function(_0x2f5dbf,_0x40fc89){if(!this['vertices'][_0x2f5dbf]){return logger[_0x7601('0xf')]('no\x20vertex\x20found');}var _0x4be36a=_0x40fc89(this[_0x7601('0x7')][_0x2f5dbf]);if(!_0x4be36a){return logger[_0x7601('0xf')](_0x7601('0x10'));}if(this[_0x7601('0x5')][_0x2f5dbf][_0x7601('0x11')]===0x0){return logger[_0x7601('0xf')](_0x7601('0x12'));}for(var _0xdfb58a=0x0,_0x5e99b9=[],_0xa0e556=![];_0xdfb58a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','catch','createSquareReport','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','sync','production','SQUAREROOT','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','LOOP\x20through\x20graph','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','vresponse','response','code','result','isUndefined','toString','error','finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]'];(function(_0x4df0ac,_0x18f735){var _0x1683d7=function(_0x2994eb){while(--_0x2994eb){_0x4df0ac['push'](_0x4df0ac['shift']());}};_0x1683d7(++_0x18f735);}(_0x1abc,0x107));var _0xc1ab=function(_0x54bb5e,_0xc9513a){_0x54bb5e=_0x54bb5e-0x0;var _0x2cfe75=_0x1abc[_0x54bb5e];return _0x2cfe75;};'use strict';var parser=require(_0xc1ab('0x0'));var _=require(_0xc1ab('0x1'));var syncho=require(_0xc1ab('0x2'));var util=require('util');var moment=require(_0xc1ab('0x3'));var config=require(_0xc1ab('0x4'));var logger=require('../../config/logger')(_0xc1ab('0x5'));var utilLicense=require(_0xc1ab('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xc1ab('0x7'));var Vertices=require(_0xc1ab('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc1ab('0x5')]=_[_0xc1ab('0x9')](config[_0xc1ab('0x5')],{'ip':_0xc1ab('0xa'),'port':0x11dd});function connectionHandler(_0x5fc15){process[_0xc1ab('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5fc15);agiHandler(_0x5fc15);}catch(_0x23dadd){logger['error'](_0x23dadd['stack']);}});});}function listeningHandler(){console[_0xc1ab('0xc')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xc1ab('0x5')]['port']);logger['info'](util[_0xc1ab('0xd')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xc1ab('0x5')]['ip'],config[_0xc1ab('0x5')]['port']));}function errorHandler(_0xb74a85){if(_0xb74a85&&_0xb74a85[_0xc1ab('0xe')]&&_0xb74a85[_0xc1ab('0xf')]){logger['error'](util['format']('[%s]\x20%s',_0xb74a85[_0xc1ab('0xe')],_0xb74a85[_0xc1ab('0xf')]));}else{logger['error'](util[_0xc1ab('0xd')](_0xc1ab('0x10'),_0xb74a85[_0xc1ab('0x11')]));}}function closeHandler(){logger[_0xc1ab('0x12')](util[_0xc1ab('0xd')](_0xc1ab('0x13'),this[_0xc1ab('0x14')],this['calleridname'],this[_0xc1ab('0x15')],this[_0xc1ab('0x16')],this[_0xc1ab('0x17')]));try{createSquareReport(this);}catch(_0x3a0f43){logger['error'](_0x3a0f43['stack']);}}function timeoutHandler(){logger['info'](util[_0xc1ab('0xd')](_0xc1ab('0x18'),this[_0xc1ab('0x14')],this[_0xc1ab('0x19')],this[_0xc1ab('0x15')],this[_0xc1ab('0x16')],this[_0xc1ab('0x17')]));}function hangupHandler(){logger['info'](util[_0xc1ab('0xd')](_0xc1ab('0x1a'),this['arg_1'],this['calleridname'],this[_0xc1ab('0x15')],this[_0xc1ab('0x16')],this[_0xc1ab('0x17')]));this[_0xc1ab('0x1b')]=!![];}function getRoot(_0x51908e){return parser[_0xc1ab('0x1c')](_0x51908e,{'object':!![]})['mxGraphModel'][_0xc1ab('0x1d')];}function addVertex(_0x43be55,_0x53e441,_0x54eeb0){_0x53e441[_0xc1ab('0x1e')]=_0x54eeb0;if(_0x53e441[_0xc1ab('0x1f')](_0xc1ab('0x20'))){_0x53e441['maxRetry']=parseInt(_0x53e441[_0xc1ab('0x20')],0xa);}_0x43be55[_0xc1ab('0x21')](_[_0xc1ab('0x22')](_0x53e441,_0xc1ab('0x23')));}function initGraph(_0x28620c,_0xb870bf){var _0x305f3d=new Graph();for(var _0x226df4 in _0x28620c){if(_0x28620c[_0xc1ab('0x1f')](_0x226df4)){if(_[_0xc1ab('0x24')](_0x28620c[_0x226df4])){for(var _0x2f9942=0x0;_0x2f9942<_0x28620c[_0x226df4][_0xc1ab('0x25')];_0x2f9942+=0x1){addVertex(_0x305f3d,_0x28620c[_0x226df4][_0x2f9942],_0x226df4);}}else{addVertex(_0x305f3d,_0x28620c[_0x226df4],_0x226df4);}}}for(var _0x427d35=0x0;_0x427d35<_0xb870bf[_0xc1ab('0x25')];_0x427d35+=0x1){if(_0xb870bf[_0x427d35][_0xc1ab('0x26')]&&_0xb870bf[_0x427d35]['target']){_0x305f3d[_0xc1ab('0x27')](_0xb870bf[_0x427d35][_0xc1ab('0x26')],_0xb870bf[_0x427d35][_0xc1ab('0x28')],_0xb870bf[_0x427d35][_0xc1ab('0x29')]);}}return _0x305f3d;}function getSquareProject(_0x1fed17,_0x7396b9){rpc['getSquareProject'](_0x1fed17)['then'](function(_0x295466){_0x7396b9(null,_0x295466);})[_0xc1ab('0x2a')](function(_0x21ce61){_0x7396b9(null,_0x21ce61);});}function createSquareReport(_0xa60cfd,_0x2810c2){rpc[_0xc1ab('0x2b')](_0xa60cfd)['then'](function(_0x357e43){if(_0x2810c2){_0x2810c2(null,_0x357e43);}})[_0xc1ab('0x2a')](function(_0xb922dc){if(_0x2810c2){_0x2810c2(null,_0xb922dc);}});}function setChannelVariables(_0x269db4){for(var _0x527fb1 in _0x269db4){if(_0x269db4[_0xc1ab('0x1f')](_0x527fb1)){if(_0x527fb1['indexOf'](_0xc1ab('0x2c'))===0x0){_0x269db4[_0x527fb1[_0xc1ab('0x2d')](0x4)]=_0x269db4[_0x527fb1];delete _0x269db4[_0x527fb1];}}}}function getLogFromObject(_0x116824){return util[_0xc1ab('0x2e')](_0x116824,{'showHidden':![],'depth':null});}function agiHandler(_0x3dc1c0){var _0x57c704,_0x156f18,_0x4a269a,_0x3b8480,_0x257aad;logger[_0xc1ab('0x2f')](_0xc1ab('0x30'),JSON[_0xc1ab('0x31')](_0x3dc1c0,null,0x2));logger['info'](util[_0xc1ab('0xd')](_0xc1ab('0x32'),_0x3dc1c0['arg_1'],_0x3dc1c0[_0xc1ab('0x19')],_0x3dc1c0[_0xc1ab('0x15')],_0x3dc1c0['dnid'],_0x3dc1c0[_0xc1ab('0x17')]));_0x3dc1c0['on']('error',errorHandler);_0x3dc1c0['on'](_0xc1ab('0x33'),closeHandler);_0x3dc1c0['on'](_0xc1ab('0x34'),timeoutHandler);_0x3dc1c0[_0xc1ab('0x1b')]=![];_0x3dc1c0['on'](_0xc1ab('0x35'),hangupHandler);var _0x54427c=getSquareProject[_0xc1ab('0x36')](null,_0x3dc1c0[_0xc1ab('0x14')]);if(_0x54427c){if(_0x54427c[_0xc1ab('0x37')]){_0x57c704=getRoot(_0x54427c[_0xc1ab('0x37')]);console[_0xc1ab('0xc')](_0xc1ab('0x38'),_0x57c704);if(_0x57c704&&_0x57c704[_0xc1ab('0x39')]){logger[_0xc1ab('0x2f')](_0xc1ab('0x1d'),JSON[_0xc1ab('0x31')](_0x57c704,null,0x2));_0x3dc1c0[_0xc1ab('0x3a')]=moment()['format'](_0xc1ab('0x3b'));_0x156f18=initGraph(_[_0xc1ab('0x22')](_0x57c704,_0xc1ab('0x23')),_0x57c704['mxCell']);_0x4a269a=new Vertices(_0x3dc1c0,rpc,mailRpc);console[_0xc1ab('0xc')](_0xc1ab('0x3c'),_0x4a269a);logger[_0xc1ab('0x12')](util[_0xc1ab('0xd')](_0xc1ab('0x3d'),_0x3dc1c0[_0xc1ab('0x14')],_0x3dc1c0['calleridname'],_0x3dc1c0[_0xc1ab('0x15')],_0x3dc1c0[_0xc1ab('0x16')],_0x3dc1c0[_0xc1ab('0x17')]));console[_0xc1ab('0xc')](_0xc1ab('0x3e'));_0x156f18['traverseBFS'](_0x57c704[_0xc1ab('0x39')]['id'],function(_0x20d2a3){try{_0x20d2a3=_0x4a269a[_0xc1ab('0x3f')](_0x20d2a3);logger[_0xc1ab('0x2f')](_0xc1ab('0x40'),JSON[_0xc1ab('0x31')](_0x20d2a3,null,0x2));console['log']('VERTEX',_0x20d2a3);if(_0x20d2a3['agicommand']===_0xc1ab('0x41')){logger[_0xc1ab('0x12')](_0xc1ab('0x42'));_0x3dc1c0['context']=_0x20d2a3['context']||_0x3dc1c0[_0xc1ab('0x43')];_0x3dc1c0[_0xc1ab('0x44')]=_0x20d2a3[_0xc1ab('0x44')];_0x3dc1c0[_0xc1ab('0x45')]=_0x20d2a3[_0xc1ab('0x45')]?_0x20d2a3['priority']-0x1:0x1;return null;}else if(_0x20d2a3&&_0x4a269a[_0x20d2a3[_0xc1ab('0x1e')]]){_0x257aad=_0x4a269a[_0x20d2a3[_0xc1ab('0x1e')]](_0x20d2a3);console[_0xc1ab('0xc')](_0xc1ab('0x46'),_0x257aad);logger['info'](_0xc1ab('0x47'),JSON['stringify'](_0x257aad,null,0x2));if(_0x257aad&&_0x257aad[_0xc1ab('0x48')]===AGI_CODE_SUCCESS&&_0x257aad[_0xc1ab('0x49')]!==AGI_RESULT_ERROR&&!_0x3dc1c0[_0xc1ab('0x1b')]){logger['debug'](_0xc1ab('0x47'),getLogFromObject(_0x257aad));return _[_0xc1ab('0x4a')](_0x257aad['result'])?null:_0x257aad[_0xc1ab('0x49')][_0xc1ab('0x4b')]();}else{logger[_0xc1ab('0x4c')](_0xc1ab('0x47'),getLogFromObject(_0x257aad));return null;}}else{logger[_0xc1ab('0x4c')]('agicommand\x20not\x20found');return null;}}catch(_0x1f7d31){logger[_0xc1ab('0x4c')](_0x1f7d31[_0xc1ab('0x11')]);return null;}});if(_0x57c704[_0xc1ab('0x4d')]){logger['info'](util[_0xc1ab('0xd')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3dc1c0[_0xc1ab('0x14')],_0x3dc1c0[_0xc1ab('0x19')],_0x3dc1c0[_0xc1ab('0x15')],_0x3dc1c0['dnid'],_0x3dc1c0['uniqueid']));_0x156f18['traverseBFS'](_0x57c704[_0xc1ab('0x4d')]['id'],function(_0x2dcdb6){try{_0x2dcdb6=_0x4a269a['clear'](_0x2dcdb6);logger[_0xc1ab('0x2f')](_0xc1ab('0x40'),JSON[_0xc1ab('0x31')](_0x2dcdb6,null,0x2));if(_0x2dcdb6&&_0x4a269a[_0x2dcdb6['agicommand']]){_0x257aad=_0x4a269a[_0x2dcdb6[_0xc1ab('0x1e')]](_0x2dcdb6);if(_0x257aad){logger[_0xc1ab('0x2f')](_0xc1ab('0x47'),getLogFromObject(_0x257aad));return _[_0xc1ab('0x4a')](_0x257aad['result'])?null:_0x257aad[_0xc1ab('0x49')][_0xc1ab('0x4b')]();}else{logger[_0xc1ab('0x4c')]('response',getLogFromObject(_0x257aad));return null;}}else{logger[_0xc1ab('0x4c')]('agicommand\x20not\x20found');return null;}}catch(_0xd86d46){logger[_0xc1ab('0x4c')](_0xd86d46[_0xc1ab('0x11')]);return null;}});}logger['info'](util[_0xc1ab('0xd')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3dc1c0[_0xc1ab('0x14')],_0x3dc1c0[_0xc1ab('0x19')],_0x3dc1c0[_0xc1ab('0x15')],_0x3dc1c0[_0xc1ab('0x16')],_0x3dc1c0[_0xc1ab('0x17')]));logger[_0xc1ab('0x12')](util[_0xc1ab('0xd')](_0xc1ab('0x4e'),_0x3dc1c0[_0xc1ab('0x43')],_0x3dc1c0[_0xc1ab('0x44')],parseInt(_0x3dc1c0[_0xc1ab('0x45')],0xa)+0x1));_0x3dc1c0['continueAt'](_0x3dc1c0['context'],_0x3dc1c0['extension'],parseInt(_0x3dc1c0[_0xc1ab('0x45')],0xa)+0x1);_0x3dc1c0[_0xc1ab('0x33')]();}}else{logger[_0xc1ab('0x4c')](util['format']('Project\x20%s\x20not\x20published',_0x3dc1c0[_0xc1ab('0x14')]));_0x3dc1c0[_0xc1ab('0x4f')](_0x3dc1c0[_0xc1ab('0x43')],_0x3dc1c0[_0xc1ab('0x44')],parseInt(_0x3dc1c0[_0xc1ab('0x45')],0xa)+0x1);_0x3dc1c0[_0xc1ab('0x33')]();}}else{logger[_0xc1ab('0x4c')](util[_0xc1ab('0xd')]('Project\x20%s\x20not\x20found',_0x3dc1c0[_0xc1ab('0x14')]));_0x3dc1c0[_0xc1ab('0x4f')](_0x3dc1c0[_0xc1ab('0x43')],_0x3dc1c0[_0xc1ab('0x44')],parseInt(_0x3dc1c0[_0xc1ab('0x45')],0xa)+0x1);_0x3dc1c0[_0xc1ab('0x33')]();}}function main(){var _0x5690cf;return utilLicense['getLicense']()[_0xc1ab('0x50')](function(_0x4fbe9c){if(_0x4fbe9c){if(_0x4fbe9c['voice']){if(_0x4fbe9c[_0xc1ab('0x51')]&&_0x4fbe9c['callysquare']>0x0){logger['info'](util[_0xc1ab('0xd')](_0xc1ab('0x52'),_0x4fbe9c[_0xc1ab('0x51')]));_0x5690cf=_0x4fbe9c['callysquare'];}else{logger[_0xc1ab('0x12')](_0xc1ab('0x53'));}}else{logger[_0xc1ab('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5690cf=-0x1;}}})[_0xc1ab('0x2a')](function(_0x3f6c73){logger[_0xc1ab('0x4c')](_0xc1ab('0x54'),_0x3f6c73[_0xc1ab('0x11')]);})[_0xc1ab('0x4d')](function(){var _0x8b9660=require(_0xc1ab('0x55'))(config[_0xc1ab('0x5')]['port'],config[_0xc1ab('0x5')]['ip'],_0x5690cf);_0x8b9660['on'](_0xc1ab('0x4c'),errorHandler);_0x8b9660['on']('listening',listeningHandler);_0x8b9660['on'](_0xc1ab('0x56'),connectionHandler);_0x8b9660['on'](_0xc1ab('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0x4c4d=['target','value','getSquareProject','catch','createSquareReport','indexOf','agi_','substring','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','hangup','sync','production','SQUAREROOT','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','LOOP\x20through\x20graph','start','clear','vertex','gotoc','context','extension','priority','vresponse','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','agicommand','hasOwnProperty','maxRetry','addVertex','omit','mxCell','length','source'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x4a6ff0,_0x30ba8a){_0x4a6ff0=_0x4a6ff0-0x0;var _0x4f2db0=_0x4c4d[_0x4a6ff0];return _0x4f2db0;};'use strict';var parser=require(_0xd4c4('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require('util');var moment=require('moment');var config=require(_0xd4c4('0x1'));var logger=require('../../config/logger')(_0xd4c4('0x2'));var utilLicense=require(_0xd4c4('0x3'));var rpc=require(_0xd4c4('0x4'));var mailRpc=require(_0xd4c4('0x5'));var Graph=require(_0xd4c4('0x6'));var Vertices=require(_0xd4c4('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xd4c4('0x8')](config[_0xd4c4('0x2')],{'ip':_0xd4c4('0x9'),'port':0x11dd});function connectionHandler(_0xbe6e8d){process[_0xd4c4('0xa')](function(){syncho(function(){try{setChannelVariables(_0xbe6e8d);agiHandler(_0xbe6e8d);}catch(_0x512f57){logger[_0xd4c4('0xb')](_0x512f57[_0xd4c4('0xc')]);}});});}function listeningHandler(){console[_0xd4c4('0xd')](_0xd4c4('0xe'),config[_0xd4c4('0x2')][_0xd4c4('0xf')]);logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')](_0xd4c4('0x12'),config['agi']['ip'],config[_0xd4c4('0x2')]['port']));}function errorHandler(_0xcb859d){if(_0xcb859d&&_0xcb859d[_0xd4c4('0x13')]&&_0xcb859d['message']){logger[_0xd4c4('0xb')](util['format']('[%s]\x20%s',_0xcb859d['name'],_0xcb859d['message']));}else{logger[_0xd4c4('0xb')](util[_0xd4c4('0x11')]('[ERROR]\x20%s',_0xcb859d[_0xd4c4('0xc')]));}}function closeHandler(){logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')](_0xd4c4('0x14'),this[_0xd4c4('0x15')],this[_0xd4c4('0x16')],this[_0xd4c4('0x17')],this[_0xd4c4('0x18')],this[_0xd4c4('0x19')]));try{createSquareReport(this);}catch(_0x4d6e3b){logger['error'](_0x4d6e3b[_0xd4c4('0xc')]);}}function timeoutHandler(){logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')](_0xd4c4('0x1a'),this[_0xd4c4('0x15')],this['calleridname'],this[_0xd4c4('0x17')],this['dnid'],this[_0xd4c4('0x19')]));}function hangupHandler(){logger[_0xd4c4('0x10')](util['format'](_0xd4c4('0x1b'),this[_0xd4c4('0x15')],this['calleridname'],this[_0xd4c4('0x17')],this[_0xd4c4('0x18')],this[_0xd4c4('0x19')]));this['evtHangup']=!![];}function getRoot(_0x29ea89){return parser[_0xd4c4('0x1c')](_0x29ea89,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x199011,_0x35ad56,_0x4f79b5){_0x35ad56[_0xd4c4('0x1d')]=_0x4f79b5;if(_0x35ad56[_0xd4c4('0x1e')]('retry')){_0x35ad56[_0xd4c4('0x1f')]=parseInt(_0x35ad56['retry'],0xa);}_0x199011[_0xd4c4('0x20')](_[_0xd4c4('0x21')](_0x35ad56,_0xd4c4('0x22')));}function initGraph(_0x5f48a1,_0x1c301b){var _0x5cc6fe=new Graph();for(var _0x491417 in _0x5f48a1){if(_0x5f48a1[_0xd4c4('0x1e')](_0x491417)){if(_['isArray'](_0x5f48a1[_0x491417])){for(var _0x538899=0x0;_0x538899<_0x5f48a1[_0x491417]['length'];_0x538899+=0x1){addVertex(_0x5cc6fe,_0x5f48a1[_0x491417][_0x538899],_0x491417);}}else{addVertex(_0x5cc6fe,_0x5f48a1[_0x491417],_0x491417);}}}for(var _0x5ef28e=0x0;_0x5ef28e<_0x1c301b[_0xd4c4('0x23')];_0x5ef28e+=0x1){if(_0x1c301b[_0x5ef28e][_0xd4c4('0x24')]&&_0x1c301b[_0x5ef28e][_0xd4c4('0x25')]){_0x5cc6fe['addEdge'](_0x1c301b[_0x5ef28e]['source'],_0x1c301b[_0x5ef28e][_0xd4c4('0x25')],_0x1c301b[_0x5ef28e][_0xd4c4('0x26')]);}}return _0x5cc6fe;}function getSquareProject(_0x30dfb8,_0x453399){rpc[_0xd4c4('0x27')](_0x30dfb8)['then'](function(_0x26270d){_0x453399(null,_0x26270d);})[_0xd4c4('0x28')](function(_0x4d48bb){_0x453399(null,_0x4d48bb);});}function createSquareReport(_0x5bf9eb,_0x561e41){rpc[_0xd4c4('0x29')](_0x5bf9eb)['then'](function(_0x1c6b2e){if(_0x561e41){_0x561e41(null,_0x1c6b2e);}})['catch'](function(_0x3333cb){if(_0x561e41){_0x561e41(null,_0x3333cb);}});}function setChannelVariables(_0x5da0bc){for(var _0x3d8329 in _0x5da0bc){if(_0x5da0bc[_0xd4c4('0x1e')](_0x3d8329)){if(_0x3d8329[_0xd4c4('0x2a')](_0xd4c4('0x2b'))===0x0){_0x5da0bc[_0x3d8329[_0xd4c4('0x2c')](0x4)]=_0x5da0bc[_0x3d8329];delete _0x5da0bc[_0x3d8329];}}}}function getLogFromObject(_0x230ec8){return util[_0xd4c4('0x2d')](_0x230ec8,{'showHidden':![],'depth':null});}function agiHandler(_0x4a4be1){var _0x5238e4,_0xd89ae6,_0x3fd903,_0x255b29,_0x266807;logger['debug']('variables',JSON[_0xd4c4('0x2e')](_0x4a4be1,null,0x2));logger['info'](util['format'](_0xd4c4('0x2f'),_0x4a4be1[_0xd4c4('0x15')],_0x4a4be1[_0xd4c4('0x16')],_0x4a4be1['callerid'],_0x4a4be1['dnid'],_0x4a4be1[_0xd4c4('0x19')]));_0x4a4be1['on']('error',errorHandler);_0x4a4be1['on']('close',closeHandler);_0x4a4be1['on'](_0xd4c4('0x30'),timeoutHandler);_0x4a4be1[_0xd4c4('0x31')]=![];_0x4a4be1['on'](_0xd4c4('0x32'),hangupHandler);var _0x328560=getSquareProject[_0xd4c4('0x33')](null,_0x4a4be1['arg_1']);if(_0x328560){if(_0x328560[_0xd4c4('0x34')]){_0x5238e4=getRoot(_0x328560[_0xd4c4('0x34')]);console[_0xd4c4('0xd')](_0xd4c4('0x35'),_0x5238e4);if(_0x5238e4&&_0x5238e4['start']){logger[_0xd4c4('0x36')]('root',JSON[_0xd4c4('0x2e')](_0x5238e4,null,0x2));_0x4a4be1[_0xd4c4('0x37')]=moment()['format'](_0xd4c4('0x38'));_0xd89ae6=initGraph(_['omit'](_0x5238e4,_0xd4c4('0x22')),_0x5238e4['mxCell']);_0x3fd903=new Vertices(_0x4a4be1,rpc,mailRpc);console[_0xd4c4('0xd')](_0xd4c4('0x39'),_0x3fd903);logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')](_0xd4c4('0x3a'),_0x4a4be1[_0xd4c4('0x15')],_0x4a4be1[_0xd4c4('0x16')],_0x4a4be1[_0xd4c4('0x17')],_0x4a4be1['dnid'],_0x4a4be1[_0xd4c4('0x19')]));console[_0xd4c4('0xd')](_0xd4c4('0x3b'));_0xd89ae6['traverseBFS'](_0x5238e4[_0xd4c4('0x3c')]['id'],function(_0x360d7c){try{_0x360d7c=_0x3fd903[_0xd4c4('0x3d')](_0x360d7c);logger[_0xd4c4('0x36')](_0xd4c4('0x3e'),JSON[_0xd4c4('0x2e')](_0x360d7c,null,0x2));console['log']('VERTEX',_0x360d7c);if(_0x360d7c[_0xd4c4('0x1d')]===_0xd4c4('0x3f')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4a4be1[_0xd4c4('0x40')]=_0x360d7c['context']||_0x4a4be1[_0xd4c4('0x40')];_0x4a4be1['extension']=_0x360d7c[_0xd4c4('0x41')];_0x4a4be1[_0xd4c4('0x42')]=_0x360d7c[_0xd4c4('0x42')]?_0x360d7c[_0xd4c4('0x42')]-0x1:0x1;return null;}else if(_0x360d7c&&_0x3fd903[_0x360d7c[_0xd4c4('0x1d')]]){_0x266807=_0x3fd903[_0x360d7c[_0xd4c4('0x1d')]](_0x360d7c);console[_0xd4c4('0xd')](_0xd4c4('0x43'),_0x266807);logger[_0xd4c4('0x10')](_0xd4c4('0x44'),JSON[_0xd4c4('0x2e')](_0x266807,null,0x2));if(_0x266807&&_0x266807[_0xd4c4('0x45')]===AGI_CODE_SUCCESS&&_0x266807[_0xd4c4('0x46')]!==AGI_RESULT_ERROR&&!_0x4a4be1[_0xd4c4('0x31')]){logger[_0xd4c4('0x36')](_0xd4c4('0x44'),getLogFromObject(_0x266807));return _[_0xd4c4('0x47')](_0x266807[_0xd4c4('0x46')])?null:_0x266807[_0xd4c4('0x46')][_0xd4c4('0x48')]();}else{logger['error'](_0xd4c4('0x44'),getLogFromObject(_0x266807));return null;}}else{logger[_0xd4c4('0xb')](_0xd4c4('0x49'));return null;}}catch(_0x1fa421){logger[_0xd4c4('0xb')](_0x1fa421[_0xd4c4('0xc')]);return null;}});if(_0x5238e4[_0xd4c4('0x4a')]){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4a4be1[_0xd4c4('0x15')],_0x4a4be1[_0xd4c4('0x16')],_0x4a4be1[_0xd4c4('0x17')],_0x4a4be1[_0xd4c4('0x18')],_0x4a4be1[_0xd4c4('0x19')]));_0xd89ae6[_0xd4c4('0x4b')](_0x5238e4[_0xd4c4('0x4a')]['id'],function(_0x27d36b){try{_0x27d36b=_0x3fd903['clear'](_0x27d36b);logger['debug'](_0xd4c4('0x3e'),JSON[_0xd4c4('0x2e')](_0x27d36b,null,0x2));if(_0x27d36b&&_0x3fd903[_0x27d36b[_0xd4c4('0x1d')]]){_0x266807=_0x3fd903[_0x27d36b['agicommand']](_0x27d36b);if(_0x266807){logger[_0xd4c4('0x36')](_0xd4c4('0x44'),getLogFromObject(_0x266807));return _[_0xd4c4('0x47')](_0x266807[_0xd4c4('0x46')])?null:_0x266807[_0xd4c4('0x46')]['toString']();}else{logger[_0xd4c4('0xb')](_0xd4c4('0x44'),getLogFromObject(_0x266807));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x17de9d){logger['error'](_0x17de9d[_0xd4c4('0xc')]);return null;}});}logger['info'](util[_0xd4c4('0x11')](_0xd4c4('0x4c'),_0x4a4be1['arg_1'],_0x4a4be1[_0xd4c4('0x16')],_0x4a4be1[_0xd4c4('0x17')],_0x4a4be1[_0xd4c4('0x18')],_0x4a4be1[_0xd4c4('0x19')]));logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4a4be1[_0xd4c4('0x40')],_0x4a4be1['extension'],parseInt(_0x4a4be1[_0xd4c4('0x42')],0xa)+0x1));_0x4a4be1[_0xd4c4('0x4d')](_0x4a4be1[_0xd4c4('0x40')],_0x4a4be1[_0xd4c4('0x41')],parseInt(_0x4a4be1[_0xd4c4('0x42')],0xa)+0x1);_0x4a4be1['close']();}}else{logger[_0xd4c4('0xb')](util['format'](_0xd4c4('0x4e'),_0x4a4be1[_0xd4c4('0x15')]));_0x4a4be1['continueAt'](_0x4a4be1['context'],_0x4a4be1[_0xd4c4('0x41')],parseInt(_0x4a4be1[_0xd4c4('0x42')],0xa)+0x1);_0x4a4be1[_0xd4c4('0x4f')]();}}else{logger[_0xd4c4('0xb')](util[_0xd4c4('0x11')](_0xd4c4('0x50'),_0x4a4be1[_0xd4c4('0x15')]));_0x4a4be1[_0xd4c4('0x4d')](_0x4a4be1[_0xd4c4('0x40')],_0x4a4be1[_0xd4c4('0x41')],parseInt(_0x4a4be1[_0xd4c4('0x42')],0xa)+0x1);_0x4a4be1[_0xd4c4('0x4f')]();}}function main(){var _0x15860e;return utilLicense[_0xd4c4('0x51')]()[_0xd4c4('0x52')](function(_0x1c7b1b){if(_0x1c7b1b){if(_0x1c7b1b[_0xd4c4('0x53')]){if(_0x1c7b1b[_0xd4c4('0x54')]&&_0x1c7b1b['callysquare']>0x0){logger[_0xd4c4('0x10')](util[_0xd4c4('0x11')](_0xd4c4('0x55'),_0x1c7b1b[_0xd4c4('0x54')]));_0x15860e=_0x1c7b1b[_0xd4c4('0x54')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0xd4c4('0x56'));_0x15860e=-0x1;}}})[_0xd4c4('0x28')](function(_0x30b1bc){logger['error'](_0xd4c4('0x57'),_0x30b1bc[_0xd4c4('0xc')]);})[_0xd4c4('0x4a')](function(){var _0x41e4ed=require(_0xd4c4('0x58'))(config[_0xd4c4('0x2')][_0xd4c4('0xf')],config[_0xd4c4('0x2')]['ip'],_0x15860e);_0x41e4ed['on'](_0xd4c4('0xb'),errorHandler);_0x41e4ed['on'](_0xd4c4('0x59'),listeningHandler);_0x41e4ed['on'](_0xd4c4('0x5a'),connectionHandler);_0x41e4ed['on'](_0xd4c4('0x4f'),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 f725544..c867cc0 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(_0x4b4e0,_0x265692){var _0x2f6d41=function(_0x48cbbf){while(--_0x48cbbf){_0x4b4e0['push'](_0x4b4e0['shift']());}};_0x2f6d41(++_0x265692);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0xcceba1,_0x2dabb4){var _0x39d2fb=function(_0x50b43f){while(--_0x50b43f){_0xcceba1['push'](_0xcceba1['shift']());}};_0x39d2fb(++_0x2dabb4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 83df71d..6658d5b 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_0xb10b,0x12a));var _0xbb10=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0xb10b[_0x699200];return _0x266fd1;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x4b5409,_0x472b71){var _0x90b623=function(_0x596445){while(--_0x596445){_0x4b5409['push'](_0x4b5409['shift']());}};_0x90b623(++_0x472b71);}(_0xb10b,0x12a));var _0xbb10=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0xb10b[_0x1aae33];return _0x2e91e9;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 5109657..9d00278 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 _0xf958=['util','jayson/promise','client','http','request','then','error','message','result','catch','production','getMailAccountById','ShowMailAccount','Smtp','name','getSquareProjectById','ShowSquareProject','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','log','rpcreq','GetContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x249e5c,_0x35cf37){var _0x59a706=function(_0x14b673){while(--_0x14b673){_0x249e5c['push'](_0x249e5c['shift']());}};_0x59a706(++_0x35cf37);}(_0xf958,0x1c0));var _0x8f95=function(_0x5e7617,_0x3a10e1){_0x5e7617=_0x5e7617-0x0;var _0x341f5d=_0xf958[_0x5e7617];return _0x341f5d;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0x8f95('0x0'));var jayson=require(_0x8f95('0x1'));var client=jayson[_0x8f95('0x2')][_0x8f95('0x3')]({'port':0x2329});function request(_0x375fac,_0x37eb35){return new BPromise(function(_0x5e82fc,_0x2a4dcd){return client[_0x8f95('0x4')](_0x375fac,_0x37eb35)[_0x8f95('0x5')](function(_0x25f498){if(_0x25f498[_0x8f95('0x6')]){return _0x2a4dcd(_0x25f498[_0x8f95('0x6')][_0x8f95('0x7')]);}else{return _0x5e82fc(_0x25f498[_0x8f95('0x8')]);}})[_0x8f95('0x9')](function(_0x29055f){return _0x2a4dcd(_0x29055f);});});}exports['getSquareProject']=function(_0x2cce47){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2cce47},'attributes':[_0x8f95('0xa')]}});};exports[_0x8f95('0xb')]=function(_0x21ad34){return request(_0x8f95('0xc'),{'options':{'raw':![],'where':{'id':_0x21ad34},'include':[{'model':'MailServerOut','as':_0x8f95('0xd')}],'attributes':['id',_0x8f95('0xe'),'email']}});};exports[_0x8f95('0xf')]=function(_0x95ece9){return request(_0x8f95('0x10'),{'options':{'where':{'id':_0x95ece9},'attributes':[_0x8f95('0xe')]}});};exports['getVoiceQueueById']=function(_0x381fa2){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x381fa2},'attributes':[_0x8f95('0xe')]}});};exports['getVariableById']=function(_0x19d0fc){return request(_0x8f95('0x11'),{'options':{'where':{'id':_0x19d0fc},'attributes':['name']}});};exports[_0x8f95('0x12')]=function(_0x4af84f){return request(_0x8f95('0x13'),{'options':{'where':{'id':_0x4af84f},'attributes':['dsn']}});};exports[_0x8f95('0x14')]=function(_0xe7a992){return request(_0x8f95('0x15'),{'options':{'where':{'id':_0xe7a992},'attributes':[_0x8f95('0xe')]}});};exports['getContactByPhone']=function(_0x242b26){console[_0x8f95('0x16')](_0x8f95('0x17'),_0x242b26);return request(_0x8f95('0x18'),{'options':{'where':{'phone':_0x242b26['phone']},'attributes':['id']}});};exports[_0x8f95('0x19')]=function(_0x216e53){return request('ShowTrunk',{'options':{'where':{'id':_0x216e53},'attributes':[_0x8f95('0xe')]}});};exports[_0x8f95('0x1a')]=function(_0x5e4deb){return request(_0x8f95('0x1b'),{'options':{'where':{'id':_0x5e4deb},'attributes':[_0x8f95('0x1c')]}});};exports[_0x8f95('0x1d')]=function(_0x353c14){return request(_0x8f95('0x1e'),{'options':{'raw':![],'where':{'id':_0x353c14},'include':[{'model':_0x8f95('0x1f'),'as':'Intervals'}]}});};exports[_0x8f95('0x20')]=function(_0xc99d55){return request(_0x8f95('0x21'),{'options':{'where':{'id':_0xc99d55},'attributes':['id',_0x8f95('0xe')]}});};exports[_0x8f95('0x22')]=function(_0x587520){return request(_0x8f95('0x23'),{'body':_0x587520});};exports[_0x8f95('0x24')]=function(_0x3f083d){return request(_0x8f95('0x25'),{'body':_0x3f083d});};exports[_0x8f95('0x26')]=function(_0x32b4b7){return request(_0x8f95('0x27'),{'body':_[_0x8f95('0x28')](_0x32b4b7,{'project_name':_0x32b4b7['arg_1'],'prev_project_name':_0x32b4b7[_0x8f95('0x29')]||'','is_subproject':_0x32b4b7[_0x8f95('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x8f95('0x2a'))})});};exports['createSquareRecording']=function(_0x2df6bd){return request('CreateSquareRecording',{'body':_0x2df6bd});};exports[_0x8f95('0x2b')]=function(_0x65a61d){return request(_0x8f95('0x2c'),{'body':_0x65a61d});};exports[_0x8f95('0x2d')]=function(_0x129117){return request(_0x8f95('0x2e'),{'options':{'raw':![],'where':{'phone':_0x129117['phone'],'ListId':_0x129117[_0x8f95('0x2f')]}}})[_0x8f95('0x5')](function(_0x3062d8){if(_0x3062d8){return _0x3062d8;}return request('CreateCmContact',{'body':_0x129117});});};exports[_0x8f95('0x30')]=function(_0x243adc){return request(_0x8f95('0x31'),{'options':{'where':{'id':_0x243adc},'attributes':['name']}});};exports['agentLogin']=function(_0x4958b3,_0x3c5589){return request(_0x8f95('0x32'),{'body':{'interface':_0x3c5589},'options':{'where':_0x4958b3}});};exports['agentPause']=function(_0x3fb7db,_0x4eb2a7,_0x267a30){return request(_0x8f95('0x33'),{'body':{'type':_0x4eb2a7,'uniqueid':_0x267a30},'options':{'where':_0x3fb7db}});};exports[_0x8f95('0x34')]=function(_0xf9ecd){return request(_0x8f95('0x35'),{'body':{},'options':{'where':_0xf9ecd}});};exports[_0x8f95('0x36')]=function(_0x6c75b5){return request(_0x8f95('0x37'),{'body':{},'options':{'where':_0x6c75b5}});}; \ No newline at end of file +var _0x2ea9=['arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser','bluebird','moment','lodash','util','jayson/promise','request','error','message','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','getContactByPhone','log','rpcreq','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareReport','merge'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ea9,0xc4));var _0x92ea=function(_0xf8fe4e,_0x9afe40){_0xf8fe4e=_0xf8fe4e-0x0;var _0x370bd3=_0x2ea9[_0xf8fe4e];return _0x370bd3;};'use strict';var BPromise=require(_0x92ea('0x0'));var moment=require(_0x92ea('0x1'));var _=require(_0x92ea('0x2'));var util=require(_0x92ea('0x3'));var jayson=require(_0x92ea('0x4'));var client=jayson['client']['http']({'port':0x2329});function request(_0x1785d6,_0x3fb2a1){return new BPromise(function(_0x42b23a,_0x1d9de1){return client[_0x92ea('0x5')](_0x1785d6,_0x3fb2a1)['then'](function(_0x450009){if(_0x450009[_0x92ea('0x6')]){return _0x1d9de1(_0x450009[_0x92ea('0x6')][_0x92ea('0x7')]);}else{return _0x42b23a(_0x450009['result']);}})[_0x92ea('0x8')](function(_0x16b8aa){return _0x1d9de1(_0x16b8aa);});});}exports[_0x92ea('0x9')]=function(_0x3adb71){return request(_0x92ea('0xa'),{'options':{'raw':![],'where':{'name':_0x3adb71},'attributes':[_0x92ea('0xb')]}});};exports['getMailAccountById']=function(_0x46bf5f){return request(_0x92ea('0xc'),{'options':{'raw':![],'where':{'id':_0x46bf5f},'include':[{'model':'MailServerOut','as':_0x92ea('0xd')}],'attributes':['id',_0x92ea('0xe'),_0x92ea('0xf')]}});};exports[_0x92ea('0x10')]=function(_0x3e65b9){return request(_0x92ea('0xa'),{'options':{'where':{'id':_0x3e65b9},'attributes':[_0x92ea('0xe')]}});};exports['getVoiceQueueById']=function(_0x2715d0){return request(_0x92ea('0x11'),{'options':{'where':{'id':_0x2715d0},'attributes':[_0x92ea('0xe')]}});};exports[_0x92ea('0x12')]=function(_0x143936){return request(_0x92ea('0x13'),{'options':{'where':{'id':_0x143936},'attributes':[_0x92ea('0xe')]}});};exports[_0x92ea('0x14')]=function(_0x2437f6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2437f6},'attributes':[_0x92ea('0x15')]}});};exports['getUserById']=function(_0x96cde7){return request(_0x92ea('0x16'),{'options':{'where':{'id':_0x96cde7},'attributes':[_0x92ea('0xe')]}});};exports[_0x92ea('0x17')]=function(_0x2c1c3b){console[_0x92ea('0x18')](_0x92ea('0x19'),_0x2c1c3b);return request(_0x92ea('0x1a'),{'options':{'where':{'phone':_0x2c1c3b[_0x92ea('0x1b')]},'attributes':['id']}});};exports[_0x92ea('0x1c')]=function(_0x1034e8){return request(_0x92ea('0x1d'),{'options':{'where':{'id':_0x1034e8},'attributes':[_0x92ea('0xe')]}});};exports['getSoundById']=function(_0x5d15cf){return request(_0x92ea('0x1e'),{'options':{'where':{'id':_0x5d15cf},'attributes':['save_name']}});};exports[_0x92ea('0x1f')]=function(_0x45d562){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x45d562},'include':[{'model':_0x92ea('0x20'),'as':_0x92ea('0x21')}]}});};exports[_0x92ea('0x22')]=function(_0x336c58){return request(_0x92ea('0x23'),{'options':{'where':{'id':_0x336c58},'attributes':['id','name']}});};exports[_0x92ea('0x24')]=function(_0x503cbe){return request('CreateSmsMessage',{'body':_0x503cbe});};exports[_0x92ea('0x25')]=function(_0xc1124){return request('CreateSquareDetailsReport',{'body':_0xc1124});};exports['createSquareReport']=function(_0x3721d1){return request(_0x92ea('0x26'),{'body':_[_0x92ea('0x27')](_0x3721d1,{'project_name':_0x3721d1[_0x92ea('0x28')],'prev_project_name':_0x3721d1[_0x92ea('0x29')]||'','is_subproject':_0x3721d1[_0x92ea('0x29')]?!![]:![],'leaveAt':moment()[_0x92ea('0x2a')](_0x92ea('0x2b'))})});};exports[_0x92ea('0x2c')]=function(_0xdc05d2){return request(_0x92ea('0x2d'),{'body':_0xdc05d2});};exports[_0x92ea('0x2e')]=function(_0x286304){return request(_0x92ea('0x2f'),{'body':_0x286304});};exports[_0x92ea('0x30')]=function(_0x27b467){return request(_0x92ea('0x31'),{'options':{'raw':![],'where':{'phone':_0x27b467[_0x92ea('0x1b')],'ListId':_0x27b467[_0x92ea('0x32')]}}})[_0x92ea('0x33')](function(_0x1a0939){if(_0x1a0939){return _0x1a0939;}return request(_0x92ea('0x34'),{'body':_0x27b467});});};exports[_0x92ea('0x35')]=function(_0x17ef39){return request(_0x92ea('0x36'),{'options':{'where':{'id':_0x17ef39},'attributes':[_0x92ea('0xe')]}});};exports['agentLogin']=function(_0x45d3b6,_0x4b25c0){return request('LoginUser',{'body':{'interface':_0x4b25c0},'options':{'where':_0x45d3b6}});};exports[_0x92ea('0x37')]=function(_0x34fc10,_0x32ffac,_0x1a7aed){return request(_0x92ea('0x38'),{'body':{'type':_0x32ffac,'uniqueid':_0x1a7aed},'options':{'where':_0x34fc10}});};exports[_0x92ea('0x39')]=function(_0x47ab6f){return request(_0x92ea('0x3a'),{'body':{},'options':{'where':_0x47ab6f}});};exports['agentLogout']=function(_0x308f23){return request('LogoutUser',{'body':{},'options':{'where':_0x308f23}});}; \ 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 5abc735..3c4cf8d 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 _0x68fc=['./polly','./lex','exports'];(function(_0x1c7a2c,_0x7d7ad3){var _0x57b3cd=function(_0x353958){while(--_0x353958){_0x1c7a2c['push'](_0x1c7a2c['shift']());}};_0x57b3cd(++_0x7d7ad3);}(_0x68fc,0xa5));var _0xc68f=function(_0x5807b4,_0x2d2bdc){_0x5807b4=_0x5807b4-0x0;var _0x34806e=_0x68fc[_0x5807b4];return _0x34806e;};var polly=require(_0xc68f('0x0'));var lex=require(_0xc68f('0x1'));module[_0xc68f('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4c6d=['./lex','exports','./polly'];(function(_0x4ef34e,_0x35319a){var _0x452509=function(_0x1dd4d3){while(--_0x1dd4d3){_0x4ef34e['push'](_0x4ef34e['shift']());}};_0x452509(++_0x35319a);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x478489,_0x3cdf57){_0x478489=_0x478489-0x0;var _0x544211=_0x4c6d[_0x478489];return _0x544211;};var polly=require(_0xd4c6('0x0'));var lex=require(_0xd4c6('0x1'));module[_0xd4c6('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 3e1ebdd..e9faafd 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 _0x8c25=['./lib/api','exports'];(function(_0x3c136f,_0x907e4a){var _0x312c40=function(_0x4cd013){while(--_0x4cd013){_0x3c136f['push'](_0x3c136f['shift']());}};_0x312c40(++_0x907e4a);}(_0x8c25,0x15e));var _0x58c2=function(_0x22206a,_0x427496){_0x22206a=_0x22206a-0x0;var _0x38c2b3=_0x8c25[_0x22206a];return _0x38c2b3;};'use strict';var lex=require(_0x58c2('0x0'));module[_0x58c2('0x1')]=function(_0x2c2f26,_0x163893,_0x30dc2c,_0x38dd7c,_0x4e657d,_0x2808d9){return lex(_0x2c2f26,_0x163893,_0x30dc2c,_0x38dd7c,_0x4e657d,_0x2808d9);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x3a81ad,_0x555a17,_0x2411c2,_0x34de1d,_0x4d6507,_0x54d423){return lex(_0x3a81ad,_0x555a17,_0x2411c2,_0x34de1d,_0x4d6507,_0x54d423);}; \ 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 029950e..263f431 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 _0x420b=['postText','slots','hasOwnProperty','exports','LexRuntime','$LATEST'];(function(_0x226cac,_0x1262c6){var _0x517c5b=function(_0xe198b1){while(--_0xe198b1){_0x226cac['push'](_0x226cac['shift']());}};_0x517c5b(++_0x1262c6);}(_0x420b,0x72));var _0xb420=function(_0x2fe62e,_0x5194a9){_0x2fe62e=_0x2fe62e-0x0;var _0x5744f=_0x420b[_0x2fe62e];return _0x5744f;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x5b0f79,_0x5ce28c){return new BPromise(function(_0xbcbd75,_0x48433f){_0x5b0f79[_0xb420('0x0')](_0x5ce28c,function(_0x12c2d9,_0x45c8e9){if(_0x12c2d9){_0x48433f(_0x12c2d9);}if(_0x45c8e9[_0xb420('0x1')]){for(const _0x279a79 in _0x45c8e9[_0xb420('0x1')]){if(_0x45c8e9['slots'][_0xb420('0x2')](_0x279a79)){var _0x4b596c=_0x45c8e9[_0xb420('0x1')][_0x279a79];_0x45c8e9['slot_'+_0x279a79]=_0x4b596c;}}}_0xbcbd75(_0x45c8e9);});});}module[_0xb420('0x3')]=function(_0x1fbe22,_0x220d80,_0x42d7b0,_0x2d6feb,_0xcd00ac,_0x25fa09){var _0xfc6bc7=new AWS[(_0xb420('0x4'))]({'accessKeyId':_0x220d80,'secretAccessKey':_0x42d7b0,'region':_0x2d6feb});var _0x243eee={'botAlias':_0xb420('0x5'),'botName':_0x25fa09,'inputText':_0xcd00ac,'userId':_0x1fbe22};return lexResult(_0xfc6bc7,_0x243eee);}; \ No newline at end of file +var _0xed84=['hasOwnProperty','slot_','exports','$LATEST','aws-sdk','postText','slots'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xed84,0x193));var _0x4ed8=function(_0xcf943f,_0xcad999){_0xcf943f=_0xcf943f-0x0;var _0x15b3e5=_0xed84[_0xcf943f];return _0x15b3e5;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x4ed8('0x0'));function lexResult(_0x42a9ef,_0x537050){return new BPromise(function(_0x44de00,_0x5f26dc){_0x42a9ef[_0x4ed8('0x1')](_0x537050,function(_0x4a67bf,_0x46319a){if(_0x4a67bf){_0x5f26dc(_0x4a67bf);}if(_0x46319a[_0x4ed8('0x2')]){for(const _0x4bb51b in _0x46319a[_0x4ed8('0x2')]){if(_0x46319a['slots'][_0x4ed8('0x3')](_0x4bb51b)){var _0x11732e=_0x46319a[_0x4ed8('0x2')][_0x4bb51b];_0x46319a[_0x4ed8('0x4')+_0x4bb51b]=_0x11732e;}}}_0x44de00(_0x46319a);});});}module[_0x4ed8('0x5')]=function(_0x5a6ad2,_0x32a4a6,_0x550295,_0x3c9fb0,_0xdcae39,_0x59aab7){var _0x432e8b=new AWS['LexRuntime']({'accessKeyId':_0x32a4a6,'secretAccessKey':_0x550295,'region':_0x3c9fb0});var _0x1d6ce2={'botAlias':_0x4ed8('0x6'),'botName':_0x59aab7,'inputText':_0xdcae39,'userId':_0x5a6ad2};return lexResult(_0x432e8b,_0x1d6ce2);}; \ 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 28a8bf1..765cb8f 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 _0xa881=['./lib/api','exports'];(function(_0x1a3448,_0x599ec3){var _0x310730=function(_0x32b956){while(--_0x32b956){_0x1a3448['push'](_0x1a3448['shift']());}};_0x310730(++_0x599ec3);}(_0xa881,0x1da));var _0x1a88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa881[_0x20a584];return _0x4b41a8;};'use strict';var polly=require(_0x1a88('0x0'));module[_0x1a88('0x1')]=function(_0x723009,_0x244cf0,_0x3cf74f,_0x2170bd,_0x33120c,_0x29180e,_0x55c246){return polly(_0x723009,_0x244cf0,_0x3cf74f,_0x2170bd,_0x33120c,_0x29180e,_0x55c246);}; \ No newline at end of file +var _0xc337=['exports'];(function(_0xd4ec15,_0x4852af){var _0x59f78e=function(_0x3b7688){while(--_0x3b7688){_0xd4ec15['push'](_0xd4ec15['shift']());}};_0x59f78e(++_0x4852af);}(_0xc337,0x1de));var _0x7c33=function(_0x2de2f9,_0xa8a2ae){_0x2de2f9=_0x2de2f9-0x0;var _0x520598=_0xc337[_0x2de2f9];return _0x520598;};'use strict';var polly=require('./lib/api');module[_0x7c33('0x0')]=function(_0x4231f9,_0xf9742e,_0x5895cf,_0x35d75e,_0x4ed8fa,_0x205f65,_0x35960a){return polly(_0x4231f9,_0xf9742e,_0x5895cf,_0x35d75e,_0x4ed8fa,_0x205f65,_0x35960a);}; \ 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 a8901c1..2a79769 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 _0xc133=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','randomstring','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0xb5e222,_0x431ee4){var _0xb8501a=function(_0x60a936){while(--_0x60a936){_0xb5e222['push'](_0xb5e222['shift']());}};_0xb8501a(++_0x431ee4);}(_0xc133,0x152));var _0x3c13=function(_0x4dae04,_0x59b969){_0x4dae04=_0x4dae04-0x0;var _0x41674b=_0xc133[_0x4dae04];return _0x41674b;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x3c13('0x0'));var AWS=require('aws-sdk');function pollyResult(_0xb9cbd6,_0x5a399d,_0x203612){return new BPromise(function(_0x401e8b,_0x2c3641){_0xb9cbd6['synthesizeSpeech'](_0x5a399d,function(_0x242a11,_0x24e687){if(_0x242a11){_0x2c3641(_0x242a11);}else if(_0x24e687){if(_0x24e687['AudioStream']instanceof Buffer){fs[_0x3c13('0x1')](_0x203612,_0x24e687[_0x3c13('0x2')],function(_0x27dfda){if(_0x27dfda){_0x2c3641(_0x27dfda);}else{_0x401e8b();}});}else{_0x2c3641(new Error(_0x3c13('0x3')));}}else{_0x2c3641(new Error(_0x3c13('0x4')));}});});}module[_0x3c13('0x5')]=function(_0xf615c1,_0x464444,_0xeef8b2,_0x359fd9,_0x281750,_0x57c9d2,_0xf3042d){var _0x155f9e=new AWS[(_0x3c13('0x6'))]({'accessKeyId':_0xf615c1,'secretAccessKey':_0x464444,'region':_0xeef8b2});var _0x5aa856={'Text':_0x281750,'TextType':_0x57c9d2||_0x3c13('0x7'),'OutputFormat':_0x3c13('0x8'),'VoiceId':_0x359fd9};return pollyResult(_0x155f9e,_0x5aa856,_0xf3042d);}; \ No newline at end of file +var _0xcfb4=['text','mp3','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x3ea022,_0x2d5328){var _0x3b97a2=function(_0x351179){while(--_0x351179){_0x3ea022['push'](_0x3ea022['shift']());}};_0x3b97a2(++_0x2d5328);}(_0xcfb4,0x120));var _0x4cfb=function(_0x2ee48,_0x3a78a9){_0x2ee48=_0x2ee48-0x0;var _0x252153=_0xcfb4[_0x2ee48];return _0x252153;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x4cfb('0x0'));var AWS=require(_0x4cfb('0x1'));function pollyResult(_0x3e7a2d,_0x21de7f,_0x1e28ec){return new BPromise(function(_0x5b0c15,_0x4747b9){_0x3e7a2d[_0x4cfb('0x2')](_0x21de7f,function(_0x361476,_0x4cc450){if(_0x361476){_0x4747b9(_0x361476);}else if(_0x4cc450){if(_0x4cc450[_0x4cfb('0x3')]instanceof Buffer){fs[_0x4cfb('0x4')](_0x1e28ec,_0x4cc450[_0x4cfb('0x3')],function(_0x205afa){if(_0x205afa){_0x4747b9(_0x205afa);}else{_0x5b0c15();}});}else{_0x4747b9(new Error(_0x4cfb('0x5')));}}else{_0x4747b9(new Error(_0x4cfb('0x6')));}});});}module[_0x4cfb('0x7')]=function(_0x25b3f6,_0x577967,_0x5acb89,_0x33aa5d,_0x55a179,_0x3dbc53,_0x4de15c){var _0x3afd8e=new AWS[(_0x4cfb('0x8'))]({'accessKeyId':_0x25b3f6,'secretAccessKey':_0x577967,'region':_0x5acb89});var _0x59989a={'Text':_0x55a179,'TextType':_0x3dbc53||_0x4cfb('0x9'),'OutputFormat':_0x4cfb('0xa'),'VoiceId':_0x33aa5d};return pollyResult(_0x3afd8e,_0x59989a,_0x4de15c);}; \ 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 62f62d0..33f54dd 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 _0xf212=['./lib/api','exports'];(function(_0x59c289,_0x56bf13){var _0x2c1c2e=function(_0x3143ac){while(--_0x3143ac){_0x59c289['push'](_0x59c289['shift']());}};_0x2c1c2e(++_0x56bf13);}(_0xf212,0x1c2));var _0x2f21=function(_0xbd6a78,_0x4e99c2){_0xbd6a78=_0xbd6a78-0x0;var _0x3801f5=_0xf212[_0xbd6a78];return _0x3801f5;};'use strict';var asr=require(_0x2f21('0x0'));module[_0x2f21('0x1')]=function(_0x3f200c,_0x732c3,_0x43e9e1,_0x49247e){return asr(_0x3f200c,_0x732c3,_0x43e9e1);}; \ No newline at end of file +var _0xa969=['./lib/api','exports'];(function(_0x255be9,_0x3345d9){var _0x34fedf=function(_0x2e198c){while(--_0x2e198c){_0x255be9['push'](_0x255be9['shift']());}};_0x34fedf(++_0x3345d9);}(_0xa969,0x13e));var _0x9a96=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xa969[_0x1d1d09];return _0x8827e;};'use strict';var asr=require(_0x9a96('0x0'));module[_0x9a96('0x1')]=function(_0x44c0eb,_0x12f922,_0xd07dea,_0x19bb73){return asr(_0x44c0eb,_0x12f922,_0xd07dea);}; \ 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 7a23791..6759ca4 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 _0x1cf4=['/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x5e1f05,_0x156f00){var _0x578dc6=function(_0x4aa21f){while(--_0x4aa21f){_0x5e1f05['push'](_0x5e1f05['shift']());}};_0x578dc6(++_0x156f00);}(_0x1cf4,0x73));var _0x41cf=function(_0x2d2d50,_0x4c0459){_0x2d2d50=_0x2d2d50-0x0;var _0xe78bee=_0x1cf4[_0x2d2d50];return _0xe78bee;};'use strict';var url=require(_0x41cf('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x41cf('0x1');module['exports']=function(_0x24e406,_0x3cbda2,_0x5e4646){return new BPromise(function(_0x408aae,_0x4c2dc8){var _0x2c351d;if(typeof _0x24e406!=='string'||_0x24e406[_0x41cf('0x2')]===0x0){return _0x4c2dc8(_0x41cf('0x3'));}if(typeof _0x3cbda2!==_0x41cf('0x4')||_0x3cbda2[_0x41cf('0x2')]===0x0){return _0x4c2dc8(_0x41cf('0x5'));}if(typeof _0x5e4646!==_0x41cf('0x6')&&(typeof _0x5e4646!==_0x41cf('0x4')||_0x5e4646[_0x41cf('0x2')]===0x0)){return _0x4c2dc8(_0x41cf('0x7'));}try{_0x2c351d=fs[_0x41cf('0x8')](_0x24e406)[_0x41cf('0x9')](_0x41cf('0xa'));}catch(_0x5050d7){return _0x4c2dc8(_0x5050d7);}return _0x408aae({'method':'POST','uri':host+_0x41cf('0xb')+_0x3cbda2,'body':{'config':{'encoding':_0x41cf('0xc'),'sampleRateHertz':_0x41cf('0xd'),'languageCode':_0x5e4646},'audio':{'content':_0x2c351d}},'json':!![]});});}; \ No newline at end of file +var _0xadb6=['length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','LINEAR16','url','bluebird','exports','string'];(function(_0x57724a,_0x6f76af){var _0x410ced=function(_0x1bcb08){while(--_0x1bcb08){_0x57724a['push'](_0x57724a['shift']());}};_0x410ced(++_0x6f76af);}(_0xadb6,0xe2));var _0x6adb=function(_0x22c0ac,_0x54cbd4){_0x22c0ac=_0x22c0ac-0x0;var _0x3e1955=_0xadb6[_0x22c0ac];return _0x3e1955;};'use strict';var url=require(_0x6adb('0x0'));var BPromise=require(_0x6adb('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x6adb('0x2')]=function(_0x302506,_0x45a1f6,_0x49b456){return new BPromise(function(_0x3ee875,_0x50c671){var _0x1a39c2;if(typeof _0x302506!==_0x6adb('0x3')||_0x302506[_0x6adb('0x4')]===0x0){return _0x50c671('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x45a1f6!==_0x6adb('0x3')||_0x45a1f6[_0x6adb('0x4')]===0x0){return _0x50c671(_0x6adb('0x5'));}if(typeof _0x49b456!==_0x6adb('0x6')&&(typeof _0x49b456!==_0x6adb('0x3')||_0x49b456[_0x6adb('0x4')]===0x0)){return _0x50c671(_0x6adb('0x7'));}try{_0x1a39c2=fs[_0x6adb('0x8')](_0x302506)['toString']('base64');}catch(_0x17dfe4){return _0x50c671(_0x17dfe4);}return _0x3ee875({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x45a1f6,'body':{'config':{'encoding':_0x6adb('0x9'),'sampleRateHertz':'8000','languageCode':_0x49b456},'audio':{'content':_0x1a39c2}},'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 d0ff447..9a539ab 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 _0xf094=['./asr'];(function(_0x3d6626,_0x59da5f){var _0x11fe1e=function(_0x331a4e){while(--_0x331a4e){_0x3d6626['push'](_0x3d6626['shift']());}};_0x11fe1e(++_0x59da5f);}(_0xf094,0x1ee));var _0x4f09=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xf094[_0x5311e8];return _0x582ad8;};var asr=require(_0x4f09('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8322=['./asr','exports'];(function(_0x51c560,_0x4e6c0e){var _0x594579=function(_0x18c6fe){while(--_0x18c6fe){_0x51c560['push'](_0x51c560['shift']());}};_0x594579(++_0x4e6c0e);}(_0x8322,0x186));var _0x2832=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x8322[_0x3f9584];return _0x9d54c;};var asr=require(_0x2832('0x0'));module[_0x2832('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 e97cb8e..ee750f9 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 _0x092d=['lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','stringify','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','https','parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','path','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish\x20download\x20file','close','unlink','https:','data','end','wav','info','finish\x20to\x20convert','generate','base64','then','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','.mp3','audioContent','writeFile','777','tmp','chmodSync','split','googleTTS','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','transcript','join','alternatives','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','result','actionIncomplete','fulfillment','speech','score','status','code','metadata','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly'];(function(_0x1298fb,_0x54aed3){var _0x221b9d=function(_0x45aecc){while(--_0x45aecc){_0x1298fb['push'](_0x1298fb['shift']());}};_0x221b9d(++_0x54aed3);}(_0x092d,0xdc));var _0xd092=function(_0x13d153,_0x3edda1){_0x13d153=_0x13d153-0x0;var _0x508a08=_0x092d[_0x13d153];return _0x508a08;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0xd092('0x0'));var https=require(_0xd092('0x1'));var urlParse=require('url')[_0xd092('0x2')];var BPromise=require(_0xd092('0x3'));var rs=require(_0xd092('0x4'));var sox=require(_0xd092('0x5'));var rp=require(_0xd092('0x6'));var util=require(_0xd092('0x7'));var querystring=require(_0xd092('0x8'));var tts=require(_0xd092('0x9'));var apiai=require(_0xd092('0xa'));var md5=require(_0xd092('0xb'));var google=require(_0xd092('0xc'));var aws=require(_0xd092('0xd'));var tilde=require(_0xd092('0xe'));var sestek=require('./sestek');var logger=require(_0xd092('0xf'))('agi');var ISPEECH_API=_0xd092('0x10');function downloadFile(_0xab88ec,_0x16a745){return new BPromise(function(_0xacb98,_0xd74ac5){var _0xde3a69=urlParse(_0xab88ec);var _0x4ab8a3=_0xde3a69[_0xd092('0x11')]==='https:'?https:http;var _0x4570e8={'host':_0xde3a69[_0xd092('0x12')],'path':_0xde3a69[_0xd092('0x13')],'headers':{'user-agent':_0xd092('0x14')}};_0x4ab8a3['get'](_0x4570e8,function(_0x349c5a){if(_0x349c5a[_0xd092('0x15')]!==0xc8){logger[_0xd092('0x16')](_0xd092('0x17')+_0xab88ec+_0xd092('0x18')+_0x349c5a[_0xd092('0x15')]+'\x20('+_0x349c5a[_0xd092('0x19')]+')');_0xd74ac5(new Error(_0xd092('0x17')+_0xab88ec+_0xd092('0x18')+_0x349c5a[_0xd092('0x15')]+'\x20('+_0x349c5a[_0xd092('0x19')]+')'));return;}var _0x464711=fs['createWriteStream'](_0x16a745);_0x464711['on']('finish',function(){logger['info'](_0xd092('0x1a'));_0x464711[_0xd092('0x1b')](_0xacb98);});_0x464711['on'](_0xd092('0x16'),function(_0x496564){fs[_0xd092('0x1c')](_0x16a745);logger[_0xd092('0x16')]('download\x20error',_0x496564);_0xd74ac5(_0x496564);});_0x349c5a['pipe'](_0x464711);})['on'](_0xd092('0x16'),function(_0x4b4ecf){logger[_0xd092('0x16')](_0x4b4ecf);_0xd74ac5(_0x4b4ecf);})['end']();});}function uploadFile(_0x46d427){return new BPromise(function(_0xe58926,_0x133f6d){var _0x4eb729=urlParse(_0x46d427);var _0x5d64a4=_0x4eb729['protocol']===_0xd092('0x1d')?https:http;var _0x4d123c={'host':_0x4eb729[_0xd092('0x12')],'path':_0x4eb729['path'],'headers':{'user-agent':_0xd092('0x14')}};_0x5d64a4['get'](_0x4d123c,function(_0x4df2a0){if(_0x4df2a0[_0xd092('0x15')]!==0xc8){_0x133f6d(new Error(_0xd092('0x17')+_0x46d427+_0xd092('0x18')+_0x4df2a0[_0xd092('0x15')]+'\x20('+_0x4df2a0['statusMessage']+')'));return;}var _0x22262c='';_0x4df2a0['on'](_0xd092('0x1e'),function(_0xfa0e24){_0x22262c+=_0xfa0e24;});_0x4df2a0['on'](_0xd092('0x1f'),function(){_0xe58926(_0x22262c);});})['on'](_0xd092('0x16'),function(_0x3a0da1){_0x133f6d(_0x3a0da1);})[_0xd092('0x1f')]();});}function convertFile(_0x3310d6,_0x278886){return new BPromise(function(_0x1d8e18,_0x469527){var _0x486cdd=sox['transcode'](_0x3310d6,_0x278886,{'sampleRate':0x1f40,'format':_0xd092('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x486cdd['on'](_0xd092('0x16'),function(_0x410b39){logger[_0xd092('0x16')]('error\x20convert',_0x410b39);_0x469527(_0x410b39);});_0x486cdd['on']('end',function(){logger[_0xd092('0x21')](_0xd092('0x22'));_0x1d8e18();});_0x486cdd['start']();});}function base64Decode(_0x4a04ca,_0x13e186){var _0xd59fa6=path['resolve'](__dirname,'tmp',rs[_0xd092('0x23')](0x4)+'.wav');fs['writeFileSync'](_0xd59fa6,_0x4a04ca,_0xd092('0x24'));return convertFile(_0xd59fa6,_0x13e186)[_0xd092('0x25')](function(){try{fs[_0xd092('0x1c')](_0xd59fa6);fs['chmodSync'](_0x13e186,'777');}catch(_0x2b9fa7){logger[_0xd092('0x16')](_0x2b9fa7);}return _0x13e186['split']('.')[0x0];});}function base64Encode(_0x5980d5){var _0x314406=fs[_0xd092('0x26')](_0x5980d5);return new Buffer(_0x314406)['toString'](_0xd092('0x24'));}exports[_0xd092('0x27')]=function(_0x57274e,_0x7741cd,_0x59c44d,_0x326450,_0x5a103c,_0x3ff21){var _0x4ea8f5,_0x483871;var _0x5984fc=_0xd092('0x28');var _0x17f110=_0xd092('0x29')+_0x57274e;var _0x30b493={};if(_0x7741cd===_0xd092('0x2a')){_0x30b493[_0xd092('0x2b')]={'ssml':_0x59c44d};}else{_0x30b493[_0xd092('0x2b')]={'text':_0x59c44d};};_0x30b493[_0xd092('0x2c')]={'languageCode':_0x326450,'ssmlGender':_0x5a103c};_0x30b493[_0xd092('0x2d')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x31dc02={'url':_0x5984fc+_0xd092('0x2e')+_0x17f110,'method':_0xd092('0x2f'),'json':!![],'body':_0x30b493};return rp(_0x31dc02)[_0xd092('0x25')](function(_0x3a188e){return new BPromise(function(_0x1aee9d,_0x5d86ef){_0x4ea8f5=path[_0xd092('0x30')](__dirname,'tmp',rs[_0xd092('0x23')](0x4)+_0xd092('0x31'));var _0xb64726=Buffer['from'](_0x3a188e[_0xd092('0x32')],'base64');return fs[_0xd092('0x33')](_0x4ea8f5,_0xb64726,function(_0x29b6fe){_0x5d86ef(_0x29b6fe);},function(_0x3d3a3){fs['chmodSync'](_0x4ea8f5,_0xd092('0x34'));_0x1aee9d(_0x3d3a3);});});})[_0xd092('0x25')](function(_0x5e106e){_0x483871=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+'.wav');return convertFile(_0x4ea8f5,_0x483871);})['then'](function(){try{fs[_0xd092('0x1c')](_0x4ea8f5);fs[_0xd092('0x36')](_0x483871,'777');}catch(_0x22c803){logger[_0xd092('0x16')](_0x22c803);}logger[_0xd092('0x21')]('googleCloudTTS\x20path',_0x483871[_0xd092('0x37')]('.')[0x0]);return _0x483871[_0xd092('0x37')]('.')[0x0];});};exports[_0xd092('0x38')]=function(_0x5e9844,_0x421480){var _0x651192,_0x158892;return tts(_0x5e9844,_0x421480||'en',0x1)[_0xd092('0x25')](function(_0x506172){logger[_0xd092('0x21')](_0x506172);_0x651192=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x31'));return downloadFile(_0x506172,_0x651192);})['then'](function(){_0x158892=path['resolve'](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x39'));return convertFile(_0x651192,_0x158892);})[_0xd092('0x25')](function(){try{fs['unlink'](_0x651192);fs[_0xd092('0x36')](_0x158892,'777');}catch(_0x78204e){logger[_0xd092('0x16')](_0x78204e);}logger['info'](_0xd092('0x3a'),_0x158892['split']('.')[0x0]);return _0x158892[_0xd092('0x37')]('.')[0x0];});};exports[_0xd092('0x3b')]=function(_0x15544c,_0x50b91a,_0x470a6c){return google[_0xd092('0x3c')](_0x15544c,_0x50b91a,_0x470a6c)[_0xd092('0x25')](function(_0x401769){logger[_0xd092('0x21')](_0x401769[_0xd092('0x3d')]);return rp(_0x401769);})['then'](function(_0x4e8be2){var _0x2de1fd='';var _0x234d78=0x0;try{fs[_0xd092('0x1c')](_0x15544c);}catch(_0x3b39dd){logger[_0xd092('0x16')](_0x3b39dd);}if(_0x4e8be2&&_0x4e8be2[_0xd092('0x3e')]){_0x2de1fd=_0x4e8be2[_0xd092('0x3e')][_0xd092('0x3f')](function(_0x1912e4){return _0x1912e4&&_0x1912e4['alternatives'][0x0]&&_0x1912e4['alternatives'][0x0][_0xd092('0x40')]?_0x1912e4['alternatives'][0x0]['transcript']:'';})[_0xd092('0x41')]('\x0a');_0x234d78=_0x4e8be2[_0xd092('0x3e')][_0xd092('0x3f')](function(_0x3b77a7){return _0x3b77a7&&_0x3b77a7[_0xd092('0x42')][0x0]&&_0x3b77a7[_0xd092('0x42')][0x0][_0xd092('0x43')]?_0x3b77a7[_0xd092('0x42')][0x0][_0xd092('0x43')]:0x0;})['join']('\x0a');}logger[_0xd092('0x21')](_0xd092('0x44'),_0x2de1fd);logger['info'](_0xd092('0x45'),_0x234d78);return{'transcript':_0x2de1fd,'confidence':_0x234d78};})[_0xd092('0x46')](function(_0xac3c30){logger[_0xd092('0x16')]('[%s]\x20%s:%s',_0xac3c30[_0xd092('0x15')],_0xac3c30['name'],_0xac3c30[_0xd092('0x47')]);});};exports[_0xd092('0x48')]=function(_0x22222a,_0x29ddc3,_0x43a9c2,_0x539e06){var _0x1c8d51=apiai(_0x29ddc3,{'language':_0x539e06||'en'});return _0x1c8d51[_0xd092('0x49')](_0x43a9c2,{'sessionId':md5(_0x22222a)})['then'](function(_0x10511d){logger['info'](JSON['stringify'](_0x10511d));return{'source':_0x10511d[_0xd092('0x4a')]['source'],'resolvedQuery':_0x10511d[_0xd092('0x4a')]['resolvedQuery'],'action':_0x10511d[_0xd092('0x4a')]['action'],'actionIncomplete':_0x10511d[_0xd092('0x4a')][_0xd092('0x4b')],'speech':_0x10511d[_0xd092('0x4a')][_0xd092('0x4c')][_0xd092('0x4d')],'score':_0x10511d[_0xd092('0x4a')][_0xd092('0x4e')],'statusCode':_0x10511d[_0xd092('0x4f')][_0xd092('0x50')],'endConversation':_0x10511d[_0xd092('0x4a')][_0xd092('0x51')]['endConversation']||![],'isFallbackIntent':_0x10511d['result'][_0xd092('0x51')]['isFallbackIntent']};});};exports[_0xd092('0x52')]=function(_0x430087,_0x4eb21d,_0x4e081c,_0x23a466){return tilde[_0xd092('0x3c')](_0x430087,_0x4eb21d,_0x4e081c,_0x23a466)[_0xd092('0x25')](function(_0x38354f){try{fs['unlink'](_0x430087);}catch(_0x359213){logger['error'](_0x359213);}logger[_0xd092('0x21')](_0xd092('0x53'),_0x38354f[_0xd092('0x40')]);logger[_0xd092('0x21')](_0xd092('0x54'),_0x38354f[_0xd092('0x43')]);return _0x38354f;});};exports['awsPolly']=function(_0x51d79f,_0x3e21c7,_0x38fe64,_0x4fc7bd,_0x1914d7,_0x58c254){var _0x5d06e8=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x31'));var _0x1fff8e;return aws[_0xd092('0x55')](_0x51d79f,_0x3e21c7,_0x38fe64,_0x4fc7bd,_0x1914d7,_0x58c254,_0x5d06e8)[_0xd092('0x25')](function(){_0x1fff8e=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x39'));return convertFile(_0x5d06e8,_0x1fff8e);})[_0xd092('0x25')](function(){try{fs[_0xd092('0x1c')](_0x5d06e8);fs[_0xd092('0x36')](_0x1fff8e,_0xd092('0x34'));}catch(_0x2e6e2e){logger[_0xd092('0x16')](_0x2e6e2e);}return _0x1fff8e['split']('.')[0x0];});};exports['awsLex']=function(_0x1f727c,_0x3e6a7e,_0x416fe3,_0x3b09b2,_0x2cea91,_0x6231bb){return aws[_0xd092('0x56')](_0x1f727c,_0x3e6a7e,_0x416fe3,_0x3b09b2,_0x2cea91,_0x6231bb)['then'](function(_0x12e0db){logger[_0xd092('0x21')](JSON['stringify'](_0x12e0db));return _0x12e0db;});};exports[_0xd092('0x57')]=function(_0x4a02a0,_0x561a66,_0x37d471,_0x585889){var _0x5eb22e=util[_0xd092('0x58')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x4a02a0,encodeURIComponent(_0x561a66),_0x37d471,_0x585889);var _0x217968=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x31'));var _0x3636b9;return downloadFile(_0x5eb22e,_0x217968)[_0xd092('0x25')](function(){_0x3636b9=path[_0xd092('0x30')](__dirname,_0xd092('0x35'),rs[_0xd092('0x23')](0x4)+_0xd092('0x39'));return convertFile(_0x217968,_0x3636b9);})[_0xd092('0x25')](function(){try{fs[_0xd092('0x1c')](_0x217968);fs[_0xd092('0x36')](_0x3636b9,'777');}catch(_0x56688a){logger[_0xd092('0x16')](_0x56688a);}return _0x3636b9[_0xd092('0x37')]('.')[0x0];});};exports[_0xd092('0x59')]=function(_0x1148a1,_0x3ac4b6,_0x1f4354,_0x524ed2){var _0x773596=util[_0xd092('0x58')](_0xd092('0x5a'),ISPEECH_API,_0x3ac4b6,_0x1f4354,base64Encode(_0x1148a1),_0x524ed2?util[_0xd092('0x58')]('model=%s',encodeURIComponent(_0x524ed2)):_0xd092('0x5b'));return uploadFile(_0x773596)[_0xd092('0x25')](function(_0x3f4440){return querystring[_0xd092('0x2')](_0x3f4440);});};exports[_0xd092('0x5c')]=function(_0x3dc175,_0x2536c7){return sestek[_0xd092('0x5d')](_0x3dc175,_0x2536c7)[_0xd092('0x25')](function(_0x148814){logger[_0xd092('0x21')](JSON[_0xd092('0x5e')](_0x148814));var _0x3ff145={'speech':_0x148814['text'],'action':_0x148814['channelData']?_0x148814[_0xd092('0x5f')][_0xd092('0x60')]:undefined,'actiondata':_0x148814[_0xd092('0x5f')]?_0x148814[_0xd092('0x5f')][_0xd092('0x61')]:undefined};if(_0x148814[_0xd092('0x5f')]&&_0x148814[_0xd092('0x5f')][_0xd092('0x62')]){return base64Decode(_0x148814['channelData'][_0xd092('0x62')][_0xd092('0x63')],path[_0xd092('0x30')](__dirname,'tmp',rs[_0xd092('0x23')](0x4)+_0xd092('0x39')))[_0xd092('0x25')](function(_0xf76058){_0x3ff145[_0xd092('0x64')]=_0xf76058;return _0x3ff145;});}return _0x3ff145;});};exports[_0xd092('0x65')]=function(){return __dirname;}; \ No newline at end of file +var _0x05d0=['WHAT_EVER','get','statusCode','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','base64','then','chmodSync','777','split','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','generate','.mp3','from','writeFile','tmp','googleTTS','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','stringify','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','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','freeform=3','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','path','http','https','url','parse','bluebird','randomstring','request-promise','util','google-tts-api','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x05d0,0x132));var _0x005d=function(_0x186b4d,_0x375f0c){_0x186b4d=_0x186b4d-0x0;var _0x426d99=_0x05d0[_0x186b4d];return _0x426d99;};'use strict';var fs=require('fs');var path=require(_0x005d('0x0'));var http=require(_0x005d('0x1'));var https=require(_0x005d('0x2'));var urlParse=require(_0x005d('0x3'))[_0x005d('0x4')];var BPromise=require(_0x005d('0x5'));var rs=require(_0x005d('0x6'));var sox=require('sox');var rp=require(_0x005d('0x7'));var util=require(_0x005d('0x8'));var querystring=require('querystring');var tts=require(_0x005d('0x9'));var apiai=require(_0x005d('0xa'));var md5=require('md5');var google=require(_0x005d('0xb'));var aws=require(_0x005d('0xc'));var tilde=require(_0x005d('0xd'));var sestek=require(_0x005d('0xe'));var logger=require(_0x005d('0xf'))(_0x005d('0x10'));var ISPEECH_API=_0x005d('0x11');function downloadFile(_0x5f2838,_0x22210c){return new BPromise(function(_0x2993c6,_0x502cec){var _0x4a63bc=urlParse(_0x5f2838);var _0x1c0505=_0x4a63bc[_0x005d('0x12')]===_0x005d('0x13')?https:http;var _0x3280b4={'host':_0x4a63bc[_0x005d('0x14')],'path':_0x4a63bc[_0x005d('0x0')],'headers':{'user-agent':_0x005d('0x15')}};_0x1c0505[_0x005d('0x16')](_0x3280b4,function(_0xf94d54){if(_0xf94d54[_0x005d('0x17')]!==0xc8){logger[_0x005d('0x18')]('request\x20to\x20'+_0x5f2838+'\x20failed,\x20status\x20code\x20=\x20'+_0xf94d54[_0x005d('0x17')]+'\x20('+_0xf94d54[_0x005d('0x19')]+')');_0x502cec(new Error(_0x005d('0x1a')+_0x5f2838+_0x005d('0x1b')+_0xf94d54[_0x005d('0x17')]+'\x20('+_0xf94d54['statusMessage']+')'));return;}var _0x459b8b=fs[_0x005d('0x1c')](_0x22210c);_0x459b8b['on'](_0x005d('0x1d'),function(){logger[_0x005d('0x1e')](_0x005d('0x1f'));_0x459b8b[_0x005d('0x20')](_0x2993c6);});_0x459b8b['on'](_0x005d('0x18'),function(_0x4f247e){fs[_0x005d('0x21')](_0x22210c);logger[_0x005d('0x18')](_0x005d('0x22'),_0x4f247e);_0x502cec(_0x4f247e);});_0xf94d54[_0x005d('0x23')](_0x459b8b);})['on'](_0x005d('0x18'),function(_0x5d922c){logger[_0x005d('0x18')](_0x5d922c);_0x502cec(_0x5d922c);})[_0x005d('0x24')]();});}function uploadFile(_0x51af2c){return new BPromise(function(_0x375403,_0x5358a4){var _0x57cee5=urlParse(_0x51af2c);var _0x3b17f5=_0x57cee5[_0x005d('0x12')]==='https:'?https:http;var _0x558958={'host':_0x57cee5[_0x005d('0x14')],'path':_0x57cee5[_0x005d('0x0')],'headers':{'user-agent':_0x005d('0x15')}};_0x3b17f5[_0x005d('0x16')](_0x558958,function(_0x4db8a0){if(_0x4db8a0[_0x005d('0x17')]!==0xc8){_0x5358a4(new Error(_0x005d('0x1a')+_0x51af2c+_0x005d('0x1b')+_0x4db8a0[_0x005d('0x17')]+'\x20('+_0x4db8a0['statusMessage']+')'));return;}var _0x41d351='';_0x4db8a0['on'](_0x005d('0x25'),function(_0x361fb9){_0x41d351+=_0x361fb9;});_0x4db8a0['on'](_0x005d('0x24'),function(){_0x375403(_0x41d351);});})['on'](_0x005d('0x18'),function(_0x3ac11b){_0x5358a4(_0x3ac11b);})[_0x005d('0x24')]();});}function convertFile(_0xae8f26,_0x10bd9f){return new BPromise(function(_0x143b5e,_0x432d93){var _0x1d882f=sox[_0x005d('0x26')](_0xae8f26,_0x10bd9f,{'sampleRate':0x1f40,'format':_0x005d('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1d882f['on']('error',function(_0x8faa15){logger[_0x005d('0x18')](_0x005d('0x28'),_0x8faa15);_0x432d93(_0x8faa15);});_0x1d882f['on'](_0x005d('0x24'),function(){logger[_0x005d('0x1e')](_0x005d('0x29'));_0x143b5e();});_0x1d882f[_0x005d('0x2a')]();});}function base64Decode(_0x3bbe7e,_0x1b0fa3){var _0x3b3484=path[_0x005d('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0x005d('0x2c'));fs['writeFileSync'](_0x3b3484,_0x3bbe7e,_0x005d('0x2d'));return convertFile(_0x3b3484,_0x1b0fa3)[_0x005d('0x2e')](function(){try{fs[_0x005d('0x21')](_0x3b3484);fs[_0x005d('0x2f')](_0x1b0fa3,_0x005d('0x30'));}catch(_0x610a35){logger[_0x005d('0x18')](_0x610a35);}return _0x1b0fa3[_0x005d('0x31')]('.')[0x0];});}function base64Encode(_0x49582e){var _0x6ad7d9=fs['readFileSync'](_0x49582e);return new Buffer(_0x6ad7d9)[_0x005d('0x32')](_0x005d('0x2d'));}exports['googleCloudTTS']=function(_0xb569d6,_0x4ee839,_0xad5f87,_0x461e07,_0x13217b,_0x42ee22){var _0x1e43e9,_0x48d6b0;var _0x2e65f8=_0x005d('0x33');var _0xa4dc8e='?key='+_0xb569d6;var _0x297620={};if(_0x4ee839===_0x005d('0x34')){_0x297620[_0x005d('0x35')]={'ssml':_0xad5f87};}else{_0x297620[_0x005d('0x35')]={'text':_0xad5f87};};_0x297620[_0x005d('0x36')]={'languageCode':_0x461e07,'ssmlGender':_0x13217b};_0x297620[_0x005d('0x37')]={'audioEncoding':_0x005d('0x38'),'sampleRateHertz':0x1f40};var _0x2a71aa={'url':_0x2e65f8+_0x005d('0x39')+_0xa4dc8e,'method':'POST','json':!![],'body':_0x297620};return rp(_0x2a71aa)[_0x005d('0x2e')](function(_0x8d7f82){return new BPromise(function(_0x165e4e,_0x1f8c48){_0x1e43e9=path[_0x005d('0x2b')](__dirname,'tmp',rs[_0x005d('0x3a')](0x4)+_0x005d('0x3b'));var _0x5d8e32=Buffer[_0x005d('0x3c')](_0x8d7f82['audioContent'],_0x005d('0x2d'));return fs[_0x005d('0x3d')](_0x1e43e9,_0x5d8e32,function(_0x4fc168){_0x1f8c48(_0x4fc168);},function(_0x11b2d9){fs[_0x005d('0x2f')](_0x1e43e9,_0x005d('0x30'));_0x165e4e(_0x11b2d9);});});})[_0x005d('0x2e')](function(_0x51df0a){_0x48d6b0=path[_0x005d('0x2b')](__dirname,_0x005d('0x3e'),rs[_0x005d('0x3a')](0x4)+_0x005d('0x2c'));return convertFile(_0x1e43e9,_0x48d6b0);})[_0x005d('0x2e')](function(){try{fs[_0x005d('0x21')](_0x1e43e9);fs[_0x005d('0x2f')](_0x48d6b0,_0x005d('0x30'));}catch(_0x8322ca){logger['error'](_0x8322ca);}logger[_0x005d('0x1e')]('googleCloudTTS\x20path',_0x48d6b0[_0x005d('0x31')]('.')[0x0]);return _0x48d6b0[_0x005d('0x31')]('.')[0x0];});};exports[_0x005d('0x3f')]=function(_0x592454,_0x5443f4){var _0x303005,_0x344e97;return tts(_0x592454,_0x5443f4||'en',0x1)['then'](function(_0x16b6e6){logger[_0x005d('0x1e')](_0x16b6e6);_0x303005=path['resolve'](__dirname,_0x005d('0x3e'),rs[_0x005d('0x3a')](0x4)+_0x005d('0x3b'));return downloadFile(_0x16b6e6,_0x303005);})[_0x005d('0x2e')](function(){_0x344e97=path['resolve'](__dirname,_0x005d('0x3e'),rs[_0x005d('0x3a')](0x4)+_0x005d('0x2c'));return convertFile(_0x303005,_0x344e97);})['then'](function(){try{fs[_0x005d('0x21')](_0x303005);fs[_0x005d('0x2f')](_0x344e97,_0x005d('0x30'));}catch(_0xaec53e){logger[_0x005d('0x18')](_0xaec53e);}logger[_0x005d('0x1e')](_0x005d('0x40'),_0x344e97[_0x005d('0x31')]('.')[0x0]);return _0x344e97[_0x005d('0x31')]('.')[0x0];});};exports['googleASR']=function(_0xdcece3,_0x490760,_0x3823c9){return google[_0x005d('0x41')](_0xdcece3,_0x490760,_0x3823c9)[_0x005d('0x2e')](function(_0xf232f1){logger[_0x005d('0x1e')](_0xf232f1[_0x005d('0x42')]);return rp(_0xf232f1);})['then'](function(_0x22006a){var _0x5462e9='';var _0x17087a=0x0;try{fs['unlink'](_0xdcece3);}catch(_0x4226e9){logger[_0x005d('0x18')](_0x4226e9);}if(_0x22006a&&_0x22006a['results']){_0x5462e9=_0x22006a[_0x005d('0x43')][_0x005d('0x44')](function(_0x241f8d){return _0x241f8d&&_0x241f8d[_0x005d('0x45')][0x0]&&_0x241f8d['alternatives'][0x0][_0x005d('0x46')]?_0x241f8d[_0x005d('0x45')][0x0][_0x005d('0x46')]:'';})[_0x005d('0x47')]('\x0a');_0x17087a=_0x22006a[_0x005d('0x43')][_0x005d('0x44')](function(_0x724745){return _0x724745&&_0x724745[_0x005d('0x45')][0x0]&&_0x724745['alternatives'][0x0]['confidence']?_0x724745['alternatives'][0x0][_0x005d('0x48')]:0x0;})[_0x005d('0x47')]('\x0a');}logger[_0x005d('0x1e')]('googleASR\x20transcription',_0x5462e9);logger[_0x005d('0x1e')](_0x005d('0x49'),_0x17087a);return{'transcript':_0x5462e9,'confidence':_0x17087a};})[_0x005d('0x4a')](function(_0xa0d831){logger[_0x005d('0x18')](_0x005d('0x4b'),_0xa0d831[_0x005d('0x17')],_0xa0d831['name'],_0xa0d831[_0x005d('0x4c')]);});};exports[_0x005d('0x4d')]=function(_0x2749e4,_0x193699,_0x194d0e,_0x5dc41c){var _0x2c9481=apiai(_0x193699,{'language':_0x5dc41c||'en'});return _0x2c9481['textRequest'](_0x194d0e,{'sessionId':md5(_0x2749e4)})[_0x005d('0x2e')](function(_0x229a51){logger['info'](JSON[_0x005d('0x4e')](_0x229a51));return{'source':_0x229a51['result'][_0x005d('0x4f')],'resolvedQuery':_0x229a51['result'][_0x005d('0x50')],'action':_0x229a51[_0x005d('0x51')][_0x005d('0x52')],'actionIncomplete':_0x229a51[_0x005d('0x51')][_0x005d('0x53')],'speech':_0x229a51['result'][_0x005d('0x54')][_0x005d('0x55')],'score':_0x229a51['result'][_0x005d('0x56')],'statusCode':_0x229a51['status'][_0x005d('0x57')],'endConversation':_0x229a51[_0x005d('0x51')][_0x005d('0x58')][_0x005d('0x59')]||![],'isFallbackIntent':_0x229a51[_0x005d('0x51')][_0x005d('0x58')]['isFallbackIntent']};});};exports[_0x005d('0x5a')]=function(_0x3df0ea,_0x1261e1,_0xcba01f,_0x1ebb58){return tilde[_0x005d('0x41')](_0x3df0ea,_0x1261e1,_0xcba01f,_0x1ebb58)[_0x005d('0x2e')](function(_0x2feeaf){try{fs[_0x005d('0x21')](_0x3df0ea);}catch(_0x296b46){logger[_0x005d('0x18')](_0x296b46);}logger[_0x005d('0x1e')](_0x005d('0x5b'),_0x2feeaf[_0x005d('0x46')]);logger['info'](_0x005d('0x5c'),_0x2feeaf[_0x005d('0x48')]);return _0x2feeaf;});};exports[_0x005d('0x5d')]=function(_0x309722,_0x417a12,_0x43cd92,_0x4f057b,_0x3a947f,_0xd9c9ac){var _0x2ba8a6=path['resolve'](__dirname,_0x005d('0x3e'),rs['generate'](0x4)+_0x005d('0x3b'));var _0x158468;return aws[_0x005d('0x5e')](_0x309722,_0x417a12,_0x43cd92,_0x4f057b,_0x3a947f,_0xd9c9ac,_0x2ba8a6)[_0x005d('0x2e')](function(){_0x158468=path[_0x005d('0x2b')](__dirname,_0x005d('0x3e'),rs[_0x005d('0x3a')](0x4)+_0x005d('0x2c'));return convertFile(_0x2ba8a6,_0x158468);})[_0x005d('0x2e')](function(){try{fs[_0x005d('0x21')](_0x2ba8a6);fs[_0x005d('0x2f')](_0x158468,_0x005d('0x30'));}catch(_0x198ccc){logger[_0x005d('0x18')](_0x198ccc);}return _0x158468[_0x005d('0x31')]('.')[0x0];});};exports[_0x005d('0x5f')]=function(_0x5e44e9,_0x2c612e,_0x286a2f,_0x2ebb66,_0x869405,_0x1b6510){return aws[_0x005d('0x60')](_0x5e44e9,_0x2c612e,_0x286a2f,_0x2ebb66,_0x869405,_0x1b6510)['then'](function(_0x248b52){logger[_0x005d('0x1e')](JSON[_0x005d('0x4e')](_0x248b52));return _0x248b52;});};exports[_0x005d('0x61')]=function(_0x24b5f4,_0x3e7898,_0x1b8c7b,_0x3cc157){var _0x2c9d78=util[_0x005d('0x62')](_0x005d('0x63'),ISPEECH_API,_0x24b5f4,encodeURIComponent(_0x3e7898),_0x1b8c7b,_0x3cc157);var _0x178744=path[_0x005d('0x2b')](__dirname,'tmp',rs[_0x005d('0x3a')](0x4)+_0x005d('0x3b'));var _0x159d46;return downloadFile(_0x2c9d78,_0x178744)[_0x005d('0x2e')](function(){_0x159d46=path['resolve'](__dirname,'tmp',rs[_0x005d('0x3a')](0x4)+_0x005d('0x2c'));return convertFile(_0x178744,_0x159d46);})[_0x005d('0x2e')](function(){try{fs[_0x005d('0x21')](_0x178744);fs['chmodSync'](_0x159d46,_0x005d('0x30'));}catch(_0x2d1b80){logger[_0x005d('0x18')](_0x2d1b80);}return _0x159d46[_0x005d('0x31')]('.')[0x0];});};exports[_0x005d('0x64')]=function(_0xf31efc,_0x158eb7,_0x3239dd,_0x591460){var _0x3e8220=util[_0x005d('0x62')](_0x005d('0x65'),ISPEECH_API,_0x158eb7,_0x3239dd,base64Encode(_0xf31efc),_0x591460?util[_0x005d('0x62')]('model=%s',encodeURIComponent(_0x591460)):_0x005d('0x66'));return uploadFile(_0x3e8220)['then'](function(_0x185a56){return querystring[_0x005d('0x4')](_0x185a56);});};exports[_0x005d('0x67')]=function(_0x2024f5,_0x59b9ad){return sestek['nda'](_0x2024f5,_0x59b9ad)[_0x005d('0x2e')](function(_0x865fcb){logger[_0x005d('0x1e')](JSON['stringify'](_0x865fcb));var _0x26a432={'speech':_0x865fcb['text'],'action':_0x865fcb['channelData']?_0x865fcb[_0x005d('0x68')][_0x005d('0x69')]:undefined,'actiondata':_0x865fcb[_0x005d('0x68')]?_0x865fcb[_0x005d('0x68')][_0x005d('0x6a')]:undefined};if(_0x865fcb[_0x005d('0x68')]&&_0x865fcb[_0x005d('0x68')]['AudioFromTts']){return base64Decode(_0x865fcb[_0x005d('0x68')][_0x005d('0x6b')]['Data'],path[_0x005d('0x2b')](__dirname,_0x005d('0x3e'),rs[_0x005d('0x3a')](0x4)+_0x005d('0x2c')))[_0x005d('0x2e')](function(_0x18ee83){_0x26a432['audiofile']=_0x18ee83;return _0x26a432;});}return _0x26a432;});};exports[_0x005d('0x6c')]=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 2c29b3d..e2c9580 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 _0x6063=['exports'];(function(_0x55faa5,_0x5ab290){var _0x10b2a2=function(_0x38f672){while(--_0x38f672){_0x55faa5['push'](_0x55faa5['shift']());}};_0x10b2a2(++_0x5ab290);}(_0x6063,0xea));var _0x3606=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6063[_0x167cc1];return _0x10bc4b;};var nda=require('./nda');module[_0x3606('0x0')]={'nda':nda}; \ No newline at end of file +var _0x7d04=['./nda','exports'];(function(_0x47340a,_0x2abfc4){var _0x41967f=function(_0x5d095f){while(--_0x5d095f){_0x47340a['push'](_0x47340a['shift']());}};_0x41967f(++_0x2abfc4);}(_0x7d04,0x15c));var _0x47d0=function(_0x45dadc,_0x4b145d){_0x45dadc=_0x45dadc-0x0;var _0x293cf9=_0x7d04[_0x45dadc];return _0x293cf9;};var nda=require(_0x47d0('0x0'));module[_0x47d0('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 edb27bc..a16d852 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 _0xbd13=['project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','info','stringify','request-promise','url','agi','POST','/token','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','dnid','extension','text','access_token'];(function(_0x3d6cc3,_0x4ec3af){var _0x15fff7=function(_0x1ad672){while(--_0x1ad672){_0x3d6cc3['push'](_0x3d6cc3['shift']());}};_0x15fff7(++_0x4ec3af);}(_0xbd13,0x1a0));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x3bd1('0x0'));var url=require(_0x3bd1('0x1'));var logger=require('../../../../../config/logger')(_0x3bd1('0x2'));module['exports']=function(_0x2ee471,_0x437fbb){var _0x556198={'method':_0x3bd1('0x3'),'uri':url['resolve'](_0x437fbb['ndauth_url'],_0x3bd1('0x4')),'form':{'grant_type':'password','username':_0x437fbb[_0x3bd1('0x5')],'password':_0x437fbb[_0x3bd1('0x6')]},'json':!![]};return rp(_0x556198)[_0x3bd1('0x7')](function(_0x5c8699){var _0x5a1c0c={'method':_0x3bd1('0x3'),'uri':url[_0x3bd1('0x8')](_0x437fbb[_0x3bd1('0x9')],_0x3bd1('0xa')),'body':{'type':_0x437fbb['ndaactivity_type']||_0x3bd1('0xb'),'channelId':'Nda','conversation':{'id':_0x2ee471[_0x3bd1('0xc')]},'from':{'id':_0x2ee471[_0x3bd1('0xd')],'name':_0x2ee471[_0x3bd1('0xe')]},'recipient':{'id':_0x2ee471[_0x3bd1('0xf')],'name':_0x2ee471[_0x3bd1('0x10')]},'text':_0x437fbb[_0x3bd1('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5c8699[_0x3bd1('0x12')]},'json':!![]};if(_0x437fbb[_0x3bd1('0x13')]){_0x5a1c0c['body']['channelData']['ProjectName']=_0x437fbb['project'];}if(_0x437fbb[_0x3bd1('0x14')]=='1'){_0x5a1c0c['body'][_0x3bd1('0x15')][_0x3bd1('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3bd1('0x17')};}if(_0x437fbb[_0x3bd1('0x18')]){_0x5a1c0c[_0x3bd1('0x19')][_0x3bd1('0x15')][_0x3bd1('0x1a')]=_0x437fbb['custom_action'];if(_0x437fbb['custom_action_data']){_0x5a1c0c[_0x3bd1('0x19')][_0x3bd1('0x15')]['CustomActionData']=_0x437fbb['custom_action_data'];}}logger[_0x3bd1('0x1b')](JSON[_0x3bd1('0x1c')](_0x5a1c0c));return rp(_0x5a1c0c);});}; \ No newline at end of file +var _0xbe87=['channelData','audio/wav','CustomAction','custom_action','custom_action_data','stringify','request-promise','../../../../../config/logger','agi','exports','ndauth_url','/token','password','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','access_token','project','body','ProjectName','ndagenerate_audio'];(function(_0x13aa7e,_0x775d0e){var _0x387b57=function(_0x42ac52){while(--_0x42ac52){_0x13aa7e['push'](_0x13aa7e['shift']());}};_0x387b57(++_0x775d0e);}(_0xbe87,0x7e));var _0x7be8=function(_0x57bd0a,_0x2977b9){_0x57bd0a=_0x57bd0a-0x0;var _0x4e994a=_0xbe87[_0x57bd0a];return _0x4e994a;};'use strict';var rp=require(_0x7be8('0x0'));var url=require('url');var logger=require(_0x7be8('0x1'))(_0x7be8('0x2'));module[_0x7be8('0x3')]=function(_0x2b342d,_0x1565a8){var _0x35a413={'method':'POST','uri':url['resolve'](_0x1565a8[_0x7be8('0x4')],_0x7be8('0x5')),'form':{'grant_type':_0x7be8('0x6'),'username':_0x1565a8['username'],'password':_0x1565a8[_0x7be8('0x6')]},'json':!![]};return rp(_0x35a413)['then'](function(_0x27ba42){var _0x1f7293={'method':_0x7be8('0x7'),'uri':url[_0x7be8('0x8')](_0x1565a8[_0x7be8('0x9')],_0x7be8('0xa')),'body':{'type':_0x1565a8[_0x7be8('0xb')]||_0x7be8('0xc'),'channelId':_0x7be8('0xd'),'conversation':{'id':_0x2b342d[_0x7be8('0xe')]},'from':{'id':_0x2b342d[_0x7be8('0xf')],'name':_0x2b342d['calleridname']},'recipient':{'id':_0x2b342d[_0x7be8('0x10')],'name':_0x2b342d[_0x7be8('0x11')]},'text':_0x1565a8[_0x7be8('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x27ba42[_0x7be8('0x13')]},'json':!![]};if(_0x1565a8[_0x7be8('0x14')]){_0x1f7293[_0x7be8('0x15')]['channelData'][_0x7be8('0x16')]=_0x1565a8[_0x7be8('0x14')];}if(_0x1565a8[_0x7be8('0x17')]=='1'){_0x1f7293['body'][_0x7be8('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7be8('0x19')};}if(_0x1565a8['custom_action']){_0x1f7293[_0x7be8('0x15')][_0x7be8('0x18')][_0x7be8('0x1a')]=_0x1565a8[_0x7be8('0x1b')];if(_0x1565a8[_0x7be8('0x1c')]){_0x1f7293[_0x7be8('0x15')][_0x7be8('0x18')]['CustomActionData']=_0x1565a8[_0x7be8('0x1c')];}}logger['info'](JSON[_0x7be8('0x1d')](_0x1f7293));return rp(_0x1f7293);});}; \ 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 c7eb8b2..08b0f6e 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 _0x1310=['./lib/api'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1310,0x1b3));var _0x0131=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1310[_0x321bb2];return _0x9c12ed;};'use strict';var asr=require(_0x0131('0x0'));module['exports']=function(_0xbbd1c7,_0x17c779,_0x22eee8,_0x12e9e0){return asr(_0xbbd1c7,_0x17c779,_0x22eee8,_0x12e9e0);}; \ No newline at end of file +var _0x5557=['./lib/api','exports'];(function(_0x4c6d08,_0x3ed890){var _0x4d7854=function(_0x3eea59){while(--_0x3eea59){_0x4c6d08['push'](_0x4c6d08['shift']());}};_0x4d7854(++_0x3ed890);}(_0x5557,0xa0));var _0x7555=function(_0x2075fa,_0x18958d){_0x2075fa=_0x2075fa-0x0;var _0x5e065d=_0x5557[_0x2075fa];return _0x5e065d;};'use strict';var asr=require(_0x7555('0x0'));module[_0x7555('0x1')]=function(_0x404208,_0x19e8e9,_0x10e678,_0x397ba4){return asr(_0x404208,_0x19e8e9,_0x10e678,_0x397ba4);}; \ 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 a125edb..a5c9292 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 _0x6222=['status','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','lodash','moment','crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','unix','send','stringify','createReadStream','data','close','error','terminate','parse'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6222,0xe2));var _0x2622=function(_0x3b5f05,_0x377f4b){_0x3b5f05=_0x3b5f05-0x0;var _0x16441b=_0x6222[_0x3b5f05];return _0x16441b;};'use strict';var BPromise=require('bluebird');var _=require(_0x2622('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2622('0x1'));var crypto=require(_0x2622('0x2'));var logger=require('../../../../../../config/logger')(_0x2622('0x3'));module['exports']=function(_0x29e7f6,_0x28bcda,_0x59704e,_0x594a87){return new BPromise(function(_0x19d017,_0x1b877a){logger[_0x2622('0x4')](_0x2622('0x5'),_0x594a87||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x223a1d=new WebSocket(_0x594a87||_0x2622('0x6'),{'perMessageDeflate':![]});var _0x34a4f0='';var _0x306ba9='0';var _0xf477ce='1';var _0x382497=_0x2622('0x7');function _0x5ace74(_0x5d6c0f){var _0xa43355=crypto['createHash'](_0x2622('0x8'));_0xa43355['update'](_0x5d6c0f);return _0xa43355[_0x2622('0x9')]('hex');}function _0x4c0dd9(){try{logger[_0x2622('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x184ff9=moment()[_0x2622('0xa')]();var _0x28bd7d=_0x5ace74(_0x184ff9+_0x28bcda+_0x59704e);_0x223a1d[_0x2622('0xb')](JSON[_0x2622('0xc')]({'appID':_0x28bcda,'timestamp':_0x184ff9,'appKey':_0x28bd7d}));var _0x216c70=fs[_0x2622('0xd')](_0x29e7f6);_0x216c70['on'](_0x2622('0xe'),function(_0x3b6ef1){_0x223a1d[_0x2622('0xb')](_0x3b6ef1);});_0x216c70['on'](_0x2622('0xf'),function(){_0x223a1d[_0x2622('0xb')]('EOS');});}catch(_0x179528){logger[_0x2622('0x10')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x179528));_0x223a1d[_0x2622('0x11')]();}}function _0x18e85c(_0x247a34){try{if(_0x247a34){var _0x279143=JSON[_0x2622('0x12')](_0x247a34);switch(_0x279143[_0x2622('0x13')]){case 0x0:if(_0x279143['result']){if(_0x279143['result'][_0x2622('0x14')]){logger['info'](_0x2622('0x15'),JSON[_0x2622('0xc')](_0x279143[_0x2622('0x16')][_0x2622('0x17')]));_0x34a4f0=_0x279143[_0x2622('0x16')][_0x2622('0x17')][0x0][_0x2622('0x18')];_0x306ba9=_0x279143[_0x2622('0x16')][_0x2622('0x17')][0x0][_0x2622('0x19')];_0xf477ce='0';_0x382497=_0x2622('0x1a');_0x223a1d[_0x2622('0x11')]();}}break;case 0x1:logger['info'](_0x2622('0x7'));_0xf477ce='1';_0x382497=_0x2622('0x7');break;case 0x2:logger[_0x2622('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0xf477ce='2';_0x382497=_0x2622('0x1b');break;case 0x9:logger[_0x2622('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xf477ce='9';_0x382497='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x2622('0x4')](_0x2622('0x1c'));_0xf477ce='10';_0x382497='Authentication\x20failed.';break;case 0xb:logger[_0x2622('0x4')](_0x2622('0x1d'));_0xf477ce='11';_0x382497=_0x2622('0x1d');}}}catch(_0x3e84b1){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x2622('0xc')](_0x3e84b1));_0x223a1d['terminate']();}}function _0x16f1c8(){logger[_0x2622('0x4')](_0x2622('0x1e'));_0x19d017({'transcript':_0x34a4f0,'confidence':_0x306ba9,'status':_0xf477ce,'status_message':_0x382497});}function _0x3956bd(_0x1bf298){logger[_0x2622('0x10')](_0x2622('0x1f'));if(!_[_0x2622('0x20')](_0x1bf298)){logger[_0x2622('0x10')](_[_0x2622('0x21')](_0x1bf298)?JSON[_0x2622('0xc')](_0x1bf298):_0x1bf298);}}_0x223a1d['on']('open',_0x4c0dd9);_0x223a1d['on'](_0x2622('0x22'),_0x18e85c);_0x223a1d['on'](_0x2622('0xf'),_0x16f1c8);_0x223a1d['on'](_0x2622('0x10'),_0x3956bd);});}; \ No newline at end of file +var _0xedb0=['message','close','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','Tilde\x20ASR\x20send\x20error','parse','status','result','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.','error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open'];(function(_0x5b3ed1,_0x4e00c4){var _0x2caed4=function(_0x2172f6){while(--_0x2172f6){_0x5b3ed1['push'](_0x5b3ed1['shift']());}};_0x2caed4(++_0x4e00c4);}(_0xedb0,0x160));var _0x0edb=function(_0x51e527,_0x343634){_0x51e527=_0x51e527-0x0;var _0x4de98e=_0xedb0[_0x51e527];return _0x4de98e;};'use strict';var BPromise=require(_0x0edb('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0edb('0x1'));var crypto=require(_0x0edb('0x2'));var logger=require(_0x0edb('0x3'))(_0x0edb('0x4'));module[_0x0edb('0x5')]=function(_0x8dae15,_0x2f066d,_0x2a04ac,_0x4c41da){return new BPromise(function(_0x3d402e,_0x153a6d){logger[_0x0edb('0x6')]('Tilde\x20URI',_0x4c41da||_0x0edb('0x7'));var _0xfa0e51=new WebSocket(_0x4c41da||_0x0edb('0x7'),{'perMessageDeflate':![]});var _0x345a0d='';var _0xeebfd0='0';var _0x50b43b='1';var _0x40dc82=_0x0edb('0x8');function _0x3460e0(_0x55fa74){var _0x4c8391=crypto['createHash']('sha1');_0x4c8391[_0x0edb('0x9')](_0x55fa74);return _0x4c8391[_0x0edb('0xa')]('hex');}function _0x2d48a0(){try{logger[_0x0edb('0x6')](_0x0edb('0xb'));var _0x799a25=moment()['unix']();var _0xff600f=_0x3460e0(_0x799a25+_0x2f066d+_0x2a04ac);_0xfa0e51[_0x0edb('0xc')](JSON[_0x0edb('0xd')]({'appID':_0x2f066d,'timestamp':_0x799a25,'appKey':_0xff600f}));var _0x1461bd=fs[_0x0edb('0xe')](_0x8dae15);_0x1461bd['on'](_0x0edb('0xf'),function(_0x5f1ee6){_0xfa0e51[_0x0edb('0xc')](_0x5f1ee6);});_0x1461bd['on']('close',function(){_0xfa0e51[_0x0edb('0xc')]('EOS');});}catch(_0x497f05){logger['error'](_0x0edb('0x10'),JSON[_0x0edb('0xd')](_0x497f05));_0xfa0e51['terminate']();}}function _0x1e01a8(_0x3e2f9a){try{if(_0x3e2f9a){var _0x149d57=JSON[_0x0edb('0x11')](_0x3e2f9a);switch(_0x149d57[_0x0edb('0x12')]){case 0x0:if(_0x149d57[_0x0edb('0x13')]){if(_0x149d57['result']['final']){logger[_0x0edb('0x6')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x149d57[_0x0edb('0x13')][_0x0edb('0x14')]));_0x345a0d=_0x149d57[_0x0edb('0x13')][_0x0edb('0x14')][0x0][_0x0edb('0x15')];_0xeebfd0=_0x149d57[_0x0edb('0x13')][_0x0edb('0x14')][0x0][_0x0edb('0x16')];_0x50b43b='0';_0x40dc82=_0x0edb('0x17');_0xfa0e51['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x50b43b='1';_0x40dc82=_0x0edb('0x8');break;case 0x2:logger[_0x0edb('0x6')](_0x0edb('0x18'));_0x50b43b='2';_0x40dc82=_0x0edb('0x18');break;case 0x9:logger['info'](_0x0edb('0x19'));_0x50b43b='9';_0x40dc82=_0x0edb('0x19');break;case 0xa:logger[_0x0edb('0x6')]('Authentication\x20failed.');_0x50b43b='10';_0x40dc82=_0x0edb('0x1a');break;case 0xb:logger[_0x0edb('0x6')](_0x0edb('0x1b'));_0x50b43b='11';_0x40dc82=_0x0edb('0x1b');}}}catch(_0x1a81c6){logger[_0x0edb('0x1c')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x0edb('0xd')](_0x1a81c6));_0xfa0e51[_0x0edb('0x1d')]();}}function _0x2f403e(){logger[_0x0edb('0x6')](_0x0edb('0x1e'));_0x3d402e({'transcript':_0x345a0d,'confidence':_0xeebfd0,'status':_0x50b43b,'status_message':_0x40dc82});}function _0x1384ed(_0x5a3c58){logger['error'](_0x0edb('0x1f'));if(!_['isNil'](_0x5a3c58)){logger[_0x0edb('0x1c')](_['isObject'](_0x5a3c58)?JSON[_0x0edb('0xd')](_0x5a3c58):_0x5a3c58);}}_0xfa0e51['on'](_0x0edb('0x20'),_0x2d48a0);_0xfa0e51['on'](_0x0edb('0x21'),_0x1e01a8);_0xfa0e51['on'](_0x0edb('0x22'),_0x2f403e);_0xfa0e51['on'](_0x0edb('0x1c'),_0x1384ed);});}; \ 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 a996a20..0caa3ad 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 _0xe005=['./asr','exports'];(function(_0x51a6fe,_0x43bb1b){var _0x5f15a0=function(_0x1408aa){while(--_0x1408aa){_0x51a6fe['push'](_0x51a6fe['shift']());}};_0x5f15a0(++_0x43bb1b);}(_0xe005,0x17a));var _0x5e00=function(_0x11afeb,_0x5999be){_0x11afeb=_0x11afeb-0x0;var _0x24cca6=_0xe005[_0x11afeb];return _0x24cca6;};var asr=require(_0x5e00('0x0'));module[_0x5e00('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7257=['exports','./asr'];(function(_0x3594bb,_0x2758c4){var _0x783930=function(_0x3dd55c){while(--_0x3dd55c){_0x3594bb['push'](_0x3594bb['shift']());}};_0x783930(++_0x2758c4);}(_0x7257,0x7b));var _0x7725=function(_0x4186c3,_0x1c0521){_0x4186c3=_0x4186c3-0x0;var _0x23ff6c=_0x7257[_0x4186c3];return _0x23ff6c;};var asr=require(_0x7725('0x0'));module[_0x7725('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 327ee9b..9b25bff 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 _0x4a81=['net','events','EventEmitter','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','ready','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util'];(function(_0x2939ff,_0x49c7ad){var _0x1384dc=function(_0xc53aa1){while(--_0xc53aa1){_0x2939ff['push'](_0x2939ff['shift']());}};_0x1384dc(++_0x49c7ad);}(_0x4a81,0x1b7));var _0x14a8=function(_0x8ae2dd,_0x26ed96){_0x8ae2dd=_0x8ae2dd-0x0;var _0x594010=_0x4a81[_0x8ae2dd];return _0x594010;};'use strict';var util=require(_0x14a8('0x0'));var net=require(_0x14a8('0x1'));var EventEmitter=require(_0x14a8('0x2'))[_0x14a8('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x45869b,_0x53309b,_0x39c3d4){var _0x3363f8=this,_0x45869b=_0x45869b||0x11dd,_0x53309b=_0x53309b||_0x14a8('0x4'),_0x2cd6d2=null,_0x4aa19e=0x0;EventEmitter['call'](_0x3363f8);function _0x26e442(){if(!_0x45869b){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError(_0x14a8('0x7')));return![];}_0x2cd6d2=net[_0x14a8('0x8')]();_0x2cd6d2['listen'](_0x45869b,_0x53309b);_0x2cd6d2['on']('listening',function(){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x9'));});_0x2cd6d2['on'](_0x14a8('0xa'),function(_0x5673b7){_0x2cd6d2[_0x14a8('0xb')](function(_0x34f6e1,_0x357bb6){if(_0x34f6e1){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError(_0x14a8('0xc'),_0x34f6e1));}else if(_0x39c3d4&&_0x39c3d4<0x0){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5673b7['destroy']();}else if(_0x39c3d4&&_0x39c3d4>0x0&&_0x39c3d4<_0x357bb6){_0x4aa19e+=0x1;_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4aa19e));_0x5673b7[_0x14a8('0xd')]();}else{var _0x54223b=new AGIChannel(_0x5673b7);_0x54223b['on'](_0x14a8('0xe'),function(){_0x3363f8[_0x14a8('0x5')](_0x14a8('0xa'),_0x54223b);});}});});_0x2cd6d2['on'](_0x14a8('0x6'),function(_0x31ce02){_0x3363f8[_0x14a8('0x5')]('error',new AGIError(_0x14a8('0xc'),_0x31ce02[_0x14a8('0xf')]));});_0x2cd6d2['on']('close',function(){_0x3363f8[_0x14a8('0x5')]('close',new AGIError(_0x14a8('0x10')));});}process[_0x14a8('0x11')](function(){_0x26e442();});};util[_0x14a8('0x12')](AGIServer,EventEmitter);module[_0x14a8('0x13')]=function(_0x2534e0,_0x1e9433,_0x4a87f7){return new AGIServer(_0x2534e0,_0x1e9433,_0x4a87f7);}; \ No newline at end of file +var _0x9bde=['error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','EventEmitter','./channel','127.0.0.1','call','emit'];(function(_0x26cb28,_0x17e7e7){var _0x10061a=function(_0xf77cab){while(--_0xf77cab){_0x26cb28['push'](_0x26cb28['shift']());}};_0x10061a(++_0x17e7e7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x232326,_0x453414){_0x232326=_0x232326-0x0;var _0x18c4a2=_0x9bde[_0x232326];return _0x18c4a2;};'use strict';var util=require('util');var net=require(_0xe9bd('0x0'));var EventEmitter=require('events')[_0xe9bd('0x1')];var AGIError=require('./error');var AGIChannel=require(_0xe9bd('0x2'));var AGIServer=function(_0x3005aa,_0x131f6a,_0x1c1b34){var _0x10822d=this,_0x3005aa=_0x3005aa||0x11dd,_0x131f6a=_0x131f6a||_0xe9bd('0x3'),_0x4fd7b8=null,_0x4763e9=0x0;EventEmitter[_0xe9bd('0x4')](_0x10822d);function _0xa66ae2(){if(!_0x3005aa){_0x10822d[_0xe9bd('0x5')](_0xe9bd('0x6'),new AGIError(_0xe9bd('0x7')));return![];}_0x4fd7b8=net[_0xe9bd('0x8')]();_0x4fd7b8[_0xe9bd('0x9')](_0x3005aa,_0x131f6a);_0x4fd7b8['on'](_0xe9bd('0xa'),function(){_0x10822d['emit']('listening');});_0x4fd7b8['on'](_0xe9bd('0xb'),function(_0x145521){_0x4fd7b8[_0xe9bd('0xc')](function(_0x581ab9,_0x12c96e){if(_0x581ab9){_0x10822d[_0xe9bd('0x5')](_0xe9bd('0x6'),new AGIError(_0xe9bd('0xd'),_0x581ab9));}else if(_0x1c1b34&&_0x1c1b34<0x0){_0x10822d['emit'](_0xe9bd('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x145521[_0xe9bd('0xe')]();}else if(_0x1c1b34&&_0x1c1b34>0x0&&_0x1c1b34<_0x12c96e){_0x4763e9+=0x1;_0x10822d[_0xe9bd('0x5')](_0xe9bd('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4763e9));_0x145521['destroy']();}else{var _0x46a95e=new AGIChannel(_0x145521);_0x46a95e['on'](_0xe9bd('0xf'),function(){_0x10822d[_0xe9bd('0x5')](_0xe9bd('0xb'),_0x46a95e);});}});});_0x4fd7b8['on'](_0xe9bd('0x6'),function(_0x389e7b){_0x10822d[_0xe9bd('0x5')]('error',new AGIError(_0xe9bd('0xd'),_0x389e7b[_0xe9bd('0x10')]));});_0x4fd7b8['on'](_0xe9bd('0x11'),function(){_0x10822d['emit'](_0xe9bd('0x11'),new AGIError(_0xe9bd('0x12')));});}process[_0xe9bd('0x13')](function(){_0xa66ae2();});};util[_0xe9bd('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x20ec32,_0x50a5e8,_0xc6b661){return new AGIServer(_0x20ec32,_0x50a5e8,_0xc6b661);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dd46f03..f7beb68 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 _0x91fa=['no\x20trunk\x20selected','trunk_name','url','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','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','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','wav','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','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','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','lodash','shelljs','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProject','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','save_name','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','log','in\x20createcmcontact','isEmpty','isNil','callback_','random','lastName','list_id','uniqueid','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','has','dialTimezone','VALUE\x20TZ','CALLERID(dialTimezone)','getContactByPhone','phone','RES1','dialtimezone','timezones','scheduledat\x20before','add','minutes','scheduledat\x20after','insertContact','utcOffset','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clear','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','nextbracket','extra','replaceall\x20end','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','label','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id'];(function(_0x420972,_0x57e343){var _0x445598=function(_0x4e4db4){while(--_0x4e4db4){_0x420972['push'](_0x420972['shift']());}};_0x445598(++_0x57e343);}(_0x91fa,0xc2));var _0xa91f=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0x91fa[_0x2860ab];return _0x3037c4;};'use strict';var fs=require('fs');var path=require(_0xa91f('0x0'));var util=require('util');var _=require(_0xa91f('0x1'));var sh=require(_0xa91f('0x2'));var odbc=require('odbc')();var rs=require(_0xa91f('0x3'));var moment=require(_0xa91f('0x4'));var Mustache=require('mustache');var rp=require(_0xa91f('0x5'));var logger=require(_0xa91f('0x6'))(_0xa91f('0x7'));var config=require(_0xa91f('0x8'));var shared=require(_0xa91f('0x9'));var scripts=require(_0xa91f('0xa'));var FILES_PATH=_0xa91f('0xb');var recursiveMapAttributes=[_0xa91f('0xc'),_0xa91f('0xd')];var verticesWithRetry=['menu',_0xa91f('0xe'),_0xa91f('0xf')];var AGIVertices=function(_0x42ec02,_0x58f3ba,_0x566dc0){this['channel']=_0x42ec02;this[_0xa91f('0x10')]=_0x58f3ba;this['mailRpc']=_0x566dc0;};AGIVertices[_0xa91f('0x11')][_0xa91f('0x12')]=function(_0xa32fea,_0x4f1a2b){this['rpc'][_0xa91f('0x13')](_0xa32fea)['then'](function(_0x2fcdd1){_0x4f1a2b(null,_0x2fcdd1?_0x2fcdd1['name']:![]);})['catch'](function(_0x1dd41a){_0x4f1a2b(_0x1dd41a);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x14')]=function(_0x8e2cf4,_0x3e1e18){this[_0xa91f('0x10')][_0xa91f('0x15')](_0x8e2cf4)['then'](function(_0x3d7855){_0x3e1e18(null,_0x3d7855?_0x3d7855[_0xa91f('0x16')]:![]);})[_0xa91f('0x17')](function(_0x46285a){_0x3e1e18(_0x46285a);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x18')]=function(_0x3ed06d,_0x3ad37b){this[_0xa91f('0x10')][_0xa91f('0x19')](_0x3ed06d)[_0xa91f('0x1a')](function(_0x343750){_0x3ad37b(null,_0x343750?_0x343750[_0xa91f('0x16')]:![]);})['catch'](function(_0x23e7d4){_0x3ad37b(_0x23e7d4);});};AGIVertices['prototype'][_0xa91f('0x1b')]=function(_0x269d55,_0x4988d3){this[_0xa91f('0x10')][_0xa91f('0x1c')](_0x269d55)[_0xa91f('0x1a')](function(_0x342b6f){_0x4988d3(null,_0x342b6f?_0x342b6f[_0xa91f('0x1d')]:![]);})[_0xa91f('0x17')](function(_0x49c271){_0x4988d3(_0x49c271);});};AGIVertices['prototype'][_0xa91f('0x1e')]=function(_0x59cb06,_0x30b02b){this[_0xa91f('0x10')]['getUserById'](_0x59cb06)[_0xa91f('0x1a')](function(_0x21c28d){_0x30b02b(null,_0x21c28d?_0x21c28d[_0xa91f('0x16')]:![]);})['catch'](function(_0x1efd4f){_0x30b02b(_0x1efd4f);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1f')]=function(_0x2a64ce,_0x715fc1){this[_0xa91f('0x10')][_0xa91f('0x20')](_0x2a64ce)[_0xa91f('0x1a')](function(_0x26aa26){_0x715fc1(null,_0x26aa26?_0x26aa26[_0xa91f('0x16')]:![]);})[_0xa91f('0x17')](function(_0x103744){_0x715fc1(_0x103744);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x21')]=function(_0x3285d6,_0x32b55e){var _0x1b9877=this;this[_0xa91f('0x10')][_0xa91f('0x22')](_0x3285d6)[_0xa91f('0x1a')](function(_0x292644){_0x32b55e(null,_0x292644?_0x1b9877['getSoundPath'](_0x292644[_0xa91f('0x23')]):![]);})[_0xa91f('0x17')](function(_0x18f65e){_0x32b55e(_0x18f65e);});};AGIVertices[_0xa91f('0x11')]['getMailAccount']=function(_0x22a763,_0x20502e){this[_0xa91f('0x10')]['getMailAccountById'](_0x22a763)[_0xa91f('0x1a')](function(_0x3ce87d){_0x20502e(null,_0x3ce87d?_0x3ce87d:![]);})['catch'](function(_0x410d42){_0x20502e(_0x410d42);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x24')]=function(_0x4daba7,_0x43c6bf,_0x18daae){this[_0xa91f('0x25')][_0xa91f('0x24')](_0x4daba7,_0x43c6bf)['then'](function(){_0x18daae(null);})[_0xa91f('0x17')](function(_0xe78ff1){_0x18daae(_0xe78ff1);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x26')]=function(_0x1ae319,_0x4cc851){this[_0xa91f('0x10')][_0xa91f('0x27')](_0x1ae319)[_0xa91f('0x1a')](function(_0x34d0f2){if(_0x34d0f2){if(_0x34d0f2[_0xa91f('0x28')]){_0x4cc851(null,[_0x34d0f2['interval']]);}else{_0x4cc851(null,_['map'](_0x34d0f2[_0xa91f('0x29')],'interval'));}}else{_0x4cc851(null,![]);}})[_0xa91f('0x17')](function(_0x30e152){_0x4cc851(_0x30e152);});};AGIVertices[_0xa91f('0x11')]['getSoundPath']=function(_0x1a5925){return util[_0xa91f('0x2a')](_0xa91f('0x2b'),FILES_PATH,_0x1a5925);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x2c')]=function(_0x47d4c9,_0x4f5248,_0x12cddf){odbc[_0xa91f('0x2d')](_0x47d4c9,function(_0x5c1aa6){if(_0x5c1aa6){logger[_0xa91f('0x2e')](_0xa91f('0x2f'),_0x5c1aa6);_0x12cddf(_0x5c1aa6);}else{logger[_0xa91f('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xa91f('0x31')](_0x4f5248,function(_0xc5f2fb,_0x3ea46a){if(_0xc5f2fb){logger[_0xa91f('0x30')](_0xa91f('0x32'),_0x4f5248);_0x12cddf(_0xc5f2fb);}else{logger[_0xa91f('0x30')]('Query\x20executed\x20correctly\x20%s',_0x4f5248);odbc[_0xa91f('0x33')](function(_0x31df9b){if(_0x31df9b){logger[_0xa91f('0x2e')](_0xa91f('0x34'),_0x31df9b);}_0x12cddf(null,_0x3ea46a);});}});}});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x35')]=function(_0x34088d,_0x5c0aa0){this[_0xa91f('0x10')]['getSmsAccountById'](_0x34088d)['then'](function(_0x2ee2db){_0x5c0aa0(null,_0x2ee2db?_0x2ee2db:![]);})[_0xa91f('0x17')](function(_0x12f6f3){_0x5c0aa0(_0x12f6f3);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x36')]=function(_0x42d112,_0x4a0684){this[_0xa91f('0x10')][_0xa91f('0x36')](_0x42d112)[_0xa91f('0x1a')](function(_0x3c7d0a){_0x4a0684(null,_0x3c7d0a);})[_0xa91f('0x17')](function(_0x35f80f){_0x4a0684(_0x35f80f);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x37')]=function(_0x3aa806,_0x4bdbd4,_0x414905){this['rpc'][_0xa91f('0x37')]({'uniqueid':this[_0xa91f('0x38')]['uniqueid'],'node':_0x3aa806['label'],'application':_0x3aa806[_0xa91f('0x39')],'data':_0x4bdbd4||null,'project_name':this[_0xa91f('0x38')][_0xa91f('0x3a')],'callerid':this[_0xa91f('0x38')][_0xa91f('0x3b')]})[_0xa91f('0x1a')](function(_0x5d6d14){if(_0x414905){_0x414905(null,_0x5d6d14);}})[_0xa91f('0x17')](function(_0x258ba0){if(_0x414905){_0x414905(_0x258ba0);}});};AGIVertices['prototype'][_0xa91f('0x3c')]=function(_0x49a805,_0x2b8f93,_0x24ecbf,_0x4a2727){this[_0xa91f('0x10')][_0xa91f('0x3c')]({'uniqueid':this[_0xa91f('0x38')]['uniqueid'],'callerid':this['channel'][_0xa91f('0x3b')],'calleridname':this['channel'][_0xa91f('0x3d')],'context':this[_0xa91f('0x38')][_0xa91f('0x3e')],'extension':this['channel'][_0xa91f('0x3f')],'priority':this[_0xa91f('0x38')][_0xa91f('0x40')],'accountcode':this[_0xa91f('0x38')]['accountcode'],'dnid':this[_0xa91f('0x38')][_0xa91f('0x41')],'projectName':this[_0xa91f('0x38')]['arg_1'],'saveName':_0x2b8f93,'filename':_0x49a805[_0xa91f('0x42')]||_0x2b8f93,'savePath':_0x24ecbf})[_0xa91f('0x1a')](function(_0x47043c){_0x4a2727(null,_0x47043c);})['catch'](function(_0x479faa){_0x4a2727(_0x479faa);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x43')]=function(_0x566057,_0x54d29a,_0x3f3314){this['rpc'][_0xa91f('0x43')]({'uniqueid':this['channel']['uniqueid'],'body':_0x566057,'direction':_0x54d29a})[_0xa91f('0x1a')](function(_0x399359){if(_0x3f3314){_0x3f3314(null,_0x399359);}})[_0xa91f('0x17')](function(_0x2edc49){if(_0x3f3314){_0x3f3314(_0x2edc49);}});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x44')]=function(_0x4bff15,_0x114d37){console[_0xa91f('0x45')](_0xa91f('0x46'),_0x4bff15);console['log']('in\x20createcmcontact\x20callback',_0x114d37);var _0x4e508a=this;var _0x5f322b=0x0;var _0xa82f54={'firstName':_[_0xa91f('0x47')](_0x4bff15['name'])||_[_0xa91f('0x48')](_0x4bff15[_0xa91f('0x16')])?_0xa91f('0x49')+Math[_0xa91f('0x4a')]():_0x4bff15[_0xa91f('0x16')],'lastName':_[_0xa91f('0x47')](_0x4bff15['lastName'])||_['isNil'](_0x4bff15['lastName'])?null:_0x4bff15[_0xa91f('0x4b')],'phone':_0x4bff15['phone'],'ListId':_0x4bff15[_0xa91f('0x4c')],'scheduledat':_0x4bff15['scheduledAt'],'callbackUniqueid':this[_0xa91f('0x38')][_0xa91f('0x4d')],'tags':_0xa91f('0x4e'),'description':_0xa91f('0x4f')+_0x4bff15[_0xa91f('0x50')][_0xa91f('0x51')](),'priority':_0x4bff15[_0xa91f('0x52')]};if(_[_0xa91f('0x53')](_0x4bff15,_0xa91f('0x54'))){if(!_[_0xa91f('0x48')](_0x4bff15[_0xa91f('0x54')])){var _0x18d721=_0x4bff15['dialTimezone'];console[_0xa91f('0x45')](_0xa91f('0x55'),_0x18d721);if(_0x4bff15[_0xa91f('0x54')]==_0xa91f('0x56')){this[_0xa91f('0x10')][_0xa91f('0x57')]({'phone':_0x4bff15[_0xa91f('0x58')]})['then'](function(_0x38490f){console[_0xa91f('0x45')](_0xa91f('0x59'),_0x38490f);var _0x57e3fd=_0x38490f[_0xa91f('0x54')];console['log'](_0xa91f('0x5a'),_0x57e3fd);if(!_[_0xa91f('0x48')](_0x57e3fd)){var _0x2c8da1=shared[_0xa91f('0x5b')][_0x57e3fd];console[_0xa91f('0x45')]('tz',_0x2c8da1);if(!_[_0xa91f('0x48')](_0x2c8da1)){var _0x43af3e=-0x1*_0x2c8da1['utcOffset'];console[_0xa91f('0x45')]('minutestoadd',_0x43af3e);console[_0xa91f('0x45')](_0xa91f('0x5c'),_0xa82f54[_0xa91f('0x50')]);_0xa82f54[_0xa91f('0x50')]=moment(_0x4bff15[_0xa91f('0x50')])[_0xa91f('0x5d')](_0x43af3e,_0xa91f('0x5e'));console[_0xa91f('0x45')](_0xa91f('0x5f'),_0xa82f54[_0xa91f('0x50')]);_0x4e508a['rpc'][_0xa91f('0x60')](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x90a647){_0x114d37(null,_0x90a647);})['catch'](function(_0x3cd3df){_0x114d37(_0x3cd3df);});}else{_0x4e508a[_0xa91f('0x10')]['insertContact'](_0xa82f54,_0x4bff15,_0x114d37)['then'](function(_0x1154e7){_0x114d37(null,_0x1154e7);})[_0xa91f('0x17')](function(_0x4f9531){_0x114d37(_0x4f9531);});}}else{_0x4e508a[_0xa91f('0x10')][_0xa91f('0x60')](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x20b8db){_0x114d37(null,_0x20b8db);})[_0xa91f('0x17')](function(_0xf9e818){_0x114d37(_0xf9e818);});}});}else{var _0x5f322b=shared[_0xa91f('0x5b')][_0x18d721];if(!_[_0xa91f('0x48')](_0x5f322b)){var _0x4bb2e0=-0x1*_0x5f322b[_0xa91f('0x61')];_0xa82f54[_0xa91f('0x50')]=moment(_0x4bff15['scheduledAt'])[_0xa91f('0x5d')](_0x4bb2e0,_0xa91f('0x5e'));_0x4e508a[_0xa91f('0x10')]['insertContact'](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x235697){_0x114d37(null,_0x235697);})[_0xa91f('0x17')](function(_0x27b9a2){_0x114d37(_0x27b9a2);});}else{_0x4e508a[_0xa91f('0x10')][_0xa91f('0x60')](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x406561){_0x114d37(null,_0x406561);})[_0xa91f('0x17')](function(_0x247b53){_0x114d37(_0x247b53);});}}}else{_0x4e508a[_0xa91f('0x10')][_0xa91f('0x60')](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x4d42ca){_0x114d37(null,_0x4d42ca);})['catch'](function(_0x116f90){_0x114d37(_0x116f90);});}}else{_0x4e508a['rpc']['insertContact'](_0xa82f54,_0x4bff15,_0x114d37)[_0xa91f('0x1a')](function(_0x44890f){_0x114d37(null,_0x44890f);})[_0xa91f('0x17')](function(_0x3792b3){_0x114d37(_0x3792b3);});}};AGIVertices[_0xa91f('0x11')][_0xa91f('0x60')]=function(_0x5797a5,_0x618ba8,_0x2dff47){this['rpc'][_0xa91f('0x44')](_0x5797a5)[_0xa91f('0x1a')](function(_0x492205){_0x2dff47(null,_0x492205);})['catch'](function(_0x14d6c1){_0x2dff47(_0x14d6c1);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x62')]=function(_0x27b0f4,_0x1f2dd5){this[_0xa91f('0x10')][_0xa91f('0x63')](_0x27b0f4)[_0xa91f('0x1a')](function(_0x74221f){_0x1f2dd5(null,_0x74221f?_0x74221f['name']:![]);})[_0xa91f('0x17')](function(_0x28a444){_0x1f2dd5(_0x28a444);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x64')]=function(_0x5dfacc,_0x3e7178,_0x16a63d){var _0x3e10ef={'role':_0xa91f('0x65')};_0x3e10ef[_0x5dfacc]=this[_0xa91f('0x38')][_0xa91f('0x3b')];this[_0xa91f('0x10')]['agentPause'](_0x3e10ef,_0x3e7178,this[_0xa91f('0x38')][_0xa91f('0x4d')])[_0xa91f('0x1a')](function(_0x27567f){_0x16a63d(null,_['isNil'](_0x27567f)?![]:!![]);})['catch'](function(_0x927bfa){logger[_0xa91f('0x2e')](_0x927bfa);_0x16a63d(null,![]);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x66')]=function(_0x8c5a6d,_0x45169f){var _0x3e1e4c={'role':_0xa91f('0x65')};_0x3e1e4c[_0x8c5a6d]=this[_0xa91f('0x38')][_0xa91f('0x3b')];this[_0xa91f('0x10')][_0xa91f('0x66')](_0x3e1e4c)[_0xa91f('0x1a')](function(_0x2e7194){_0x45169f(null,_['isNil'](_0x2e7194)?![]:!![]);})[_0xa91f('0x17')](function(_0x26a7fe){logger['error'](_0x26a7fe);_0x45169f(null,![]);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x67')]=function(_0x14702f,_0x17685e){var _0x55bd04={'role':_0xa91f('0x65')};_0x55bd04[_0x14702f]=this['channel'][_0xa91f('0x3b')];this['rpc'][_0xa91f('0x67')](_0x55bd04)['then'](function(_0xc93d59){_0x17685e(null,_[_0xa91f('0x48')](_0xc93d59)?![]:!![]);})['catch'](function(_0x5b2e7d){logger[_0xa91f('0x2e')](_0x5b2e7d);_0x17685e(null,![]);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x68')]=function(_0x2635af,_0x1388b9){var _0x167ff3={'role':_0xa91f('0x65')};_0x167ff3[_0x2635af]=this[_0xa91f('0x38')][_0xa91f('0x3b')];var _0x11c451=_0x2635af!=_0xa91f('0x69')?util[_0xa91f('0x2a')]('%s/%s@from-sip/n',_0xa91f('0x6a'),this[_0xa91f('0x38')][_0xa91f('0x3b')]):undefined;this[_0xa91f('0x10')]['agentLogin'](_0x167ff3,_0x11c451)[_0xa91f('0x1a')](function(_0x26f4a6){_0x1388b9(null,_['isNil'](_0x26f4a6)?![]:!![]);})[_0xa91f('0x17')](function(_0x26d920){logger[_0xa91f('0x2e')](_0x26d920);_0x1388b9(null,![]);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x6b')]=function(_0x52bdee,_0x3caa10){sh[_0xa91f('0x6c')](_[_0xa91f('0x6d')](_0x52bdee),function(_0x2c19f3,_0x1976ed){var _0x1734af=_0x1976ed[_0xa91f('0x6e')](/(\r\n|\n|\r)/gm,'');_0x3caa10(null,_0x1734af);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x6f')]=function(_0x5df620,_0x1c0c2e){scripts[_0xa91f('0x6f')](_0x5df620['apiKey'],_0x5df620[_0xa91f('0x70')]||_0xa91f('0x71'),_0x5df620[_0xa91f('0x71')],_0x5df620[_0xa91f('0x72')]||_0xa91f('0x73'),_0x5df620[_0xa91f('0x74')]||_0xa91f('0x75'),_0x5df620[_0xa91f('0x76')]||_0xa91f('0x77'))[_0xa91f('0x1a')](function(_0x4b8b26){_0x1c0c2e(null,_0x4b8b26);})['catch'](function(_0x4f0e58){_0x1c0c2e(_0x4f0e58);});};AGIVertices['prototype'][_0xa91f('0x78')]=function(_0x2f53a2,_0x27906f){scripts['googleTTS'](_0x2f53a2[_0xa91f('0x71')],_0x2f53a2['google_tts_language']||'en',0x1)[_0xa91f('0x1a')](function(_0x216c1a){_0x27906f(null,_0x216c1a);})[_0xa91f('0x17')](function(_0x1b2a82){_0x27906f(_0x1b2a82);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x79')]=function(_0x6bf76a,_0x33434d){var _0x42a5ce={'uri':_0x6bf76a['url'],'method':_0x6bf76a[_0xa91f('0x7a')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x6bf76a[_0xa91f('0x7b')])===_0xa91f('0x7c')&&parseInt(_0x6bf76a[_0xa91f('0x7b')])>=0x1?parseInt(_0x6bf76a['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa91f('0x7d')]([_0xa91f('0x7e'),_0xa91f('0x7f')],_0x42a5ce[_0xa91f('0x7a')][_0xa91f('0x80')]())){try{_0x42a5ce['body']=_0x6bf76a[_0xa91f('0xd')]?JSON['parse'](_0x6bf76a['rawBody']):{};}catch(_0x350314){logger['error'](_0xa91f('0x81'),_0x350314);}}try{_0x42a5ce[_0xa91f('0x82')]=_0x6bf76a[_0xa91f('0xc')]?JSON[_0xa91f('0x83')](_0x6bf76a[_0xa91f('0xc')]):{};}catch(_0x1b07e7){logger[_0xa91f('0x2e')](_0xa91f('0x84'),_0x1b07e7);}if(_0x6bf76a[_0xa91f('0x85')]){try{var _0x19d1bb=require(_0x6bf76a['computedVariables'])[_0xa91f('0x86')](this,_0x42a5ce);_0x42a5ce[_0xa91f('0x87')]=Mustache['render'](_0x6bf76a['url'],_0x19d1bb,{},['$$','$$']);if(_0x42a5ce[_0xa91f('0x82')]){_0x42a5ce[_0xa91f('0x82')]=JSON[_0xa91f('0x83')](Mustache['render'](JSON[_0xa91f('0x88')](_0x42a5ce[_0xa91f('0x82')]),_0x19d1bb,{},['$$','$$']));}if(_0x42a5ce[_0xa91f('0x89')]){_0x42a5ce['body']=JSON[_0xa91f('0x83')](Mustache['render'](JSON[_0xa91f('0x88')](_0x42a5ce[_0xa91f('0x89')]),_0x19d1bb,{},['$$','$$']));}}catch(_0x2df952){logger['error'](_0xa91f('0x8a'),_0x2df952);}}rp(_0x42a5ce)[_0xa91f('0x1a')](function(_0x2db082){var _0x12084d={'statusCode':_0x2db082[_0xa91f('0x8b')]||0xc8,'statusMessage':_0x2db082[_0xa91f('0x8c')]||'OK','headers':_0x2db082[_0xa91f('0x82')]||{},'body':_0x2db082[_0xa91f('0x89')]||{}};_0x33434d(null,_0x12084d);})[_0xa91f('0x17')](function(_0x1ff78e){var _0x274a41={'statusCode':_0x1ff78e[_0xa91f('0x8b')]||0x1f4,'statusMessage':_0x1ff78e[_0xa91f('0x8d')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1ff78e[_0xa91f('0x8e')][_0xa91f('0x82')]||{},'body':_0x1ff78e[_0xa91f('0x8e')][_0xa91f('0x89')]||{}};_0x33434d(null,_0x274a41);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x8f')]=function(_0xfc853f,_0x4258ad){scripts[_0xa91f('0x8f')](this['channel'][_0xa91f('0x4d')],_0xfc853f[_0xa91f('0x90')],_0xfc853f[_0xa91f('0x71')],_0xfc853f['dialogflow_language']||'en')['then'](function(_0x5abe43){_0x4258ad(null,_0x5abe43);})[_0xa91f('0x17')](function(_0xfc0c31){_0x4258ad(_0xfc0c31);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x91')]=function(_0xa3ff58,_0x35f89f){scripts[_0xa91f('0x91')](this[_0xa91f('0x38')],_0xa3ff58)[_0xa91f('0x1a')](function(_0x2e6135){_0x35f89f(null,_0x2e6135);})[_0xa91f('0x17')](function(_0x16cce6){_0x35f89f(_0x16cce6);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x92')]=function(_0x1b6af9,_0x49842c){scripts[_0xa91f('0x92')](_0x1b6af9[_0xa91f('0x90')],_0x1b6af9[_0xa91f('0x71')],_0x1b6af9[_0xa91f('0x93')]||_0xa91f('0x73'),_0x1b6af9[_0xa91f('0x94')])[_0xa91f('0x1a')](function(_0x114d68){_0x49842c(null,_0x114d68);})['catch'](function(_0x468e56){_0x49842c(_0x468e56);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x95')]=function(_0x32f927,_0x5a078d,_0x23277d){scripts[_0xa91f('0x95')](_0x5a078d,_0x32f927[_0xa91f('0x90')],_0x32f927['ispeech_asr_language']||'en-US',this[_0xa91f('0x96')](_0x32f927[_0xa91f('0x97')])?_0x32f927['model']:undefined)[_0xa91f('0x1a')](function(_0x21a23b){_0x23277d(null,_0x21a23b);})[_0xa91f('0x17')](function(_0xf89906){_0x23277d(_0xf89906);});};AGIVertices[_0xa91f('0x11')]['awsPolly']=function(_0x3aaf5b,_0x50d5e6){scripts[_0xa91f('0x98')](_0x3aaf5b[_0xa91f('0x99')],_0x3aaf5b['aws_secret_access_key'],_0x3aaf5b[_0xa91f('0x9a')],_0x3aaf5b[_0xa91f('0x9b')]||_0xa91f('0x9c'),_0x3aaf5b[_0xa91f('0x71')],_0x3aaf5b[_0xa91f('0x9d')]||_0xa91f('0x71'))['then'](function(_0x1ad605){_0x50d5e6(null,_0x1ad605);})[_0xa91f('0x17')](function(_0x6ca13e){_0x50d5e6(_0x6ca13e);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0x9e')]=function(_0x3944cb,_0x3871a5){scripts[_0xa91f('0x9e')](this[_0xa91f('0x38')][_0xa91f('0x4d')],_0x3944cb['aws_access_key_id'],_0x3944cb[_0xa91f('0x9f')],_0x3944cb[_0xa91f('0xa0')],_0x3944cb[_0xa91f('0x71')],_0x3944cb[_0xa91f('0xa1')])[_0xa91f('0x1a')](function(_0x54ee81){_0x3871a5(null,_0x54ee81);})[_0xa91f('0x17')](function(_0x2f70e5){_0x3871a5(_0x2f70e5);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0xa2')]=function(_0x509412,_0x1dbd9e,_0x145fc1){scripts[_0xa91f('0xa2')](_0x1dbd9e,_0x509412[_0xa91f('0x90')],_0x509412['google_asr_language']||'en-US')[_0xa91f('0x1a')](function(_0x30abc4){_0x145fc1(null,_0x30abc4);})[_0xa91f('0x17')](function(_0x5b722e){_0x145fc1(_0x5b722e);});};AGIVertices[_0xa91f('0x11')]['tildeASR']=function(_0x5b9068,_0x38cc3e,_0x5834d7){scripts[_0xa91f('0xa3')](_0x38cc3e,_0x5b9068['appid'],_0x5b9068[_0xa91f('0xa4')],_0x5b9068[_0xa91f('0x87')])[_0xa91f('0x1a')](function(_0x505daa){_0x5834d7(null,_0x505daa);})[_0xa91f('0x17')](function(_0x4a613b){_0x5834d7(_0x4a613b);});};AGIVertices[_0xa91f('0x11')][_0xa91f('0xa5')]=function(_0x464fd6){var _0x435596=_[_0xa91f('0x7d')](verticesWithRetry,_0x464fd6[_0xa91f('0x39')])?_0x464fd6:_['clone'](_0x464fd6);for(var _0x22eeb0 in _0x435596){if(_0x435596[_0xa91f('0xa6')](_0x22eeb0)){if(_0x435596[_0x22eeb0]&&_['isString'](_0x435596[_0x22eeb0])){if(_[_0xa91f('0x7d')](recursiveMapAttributes,_0x22eeb0)){_0x435596[_0x22eeb0]=this[_0xa91f('0xa7')](_0x435596[_0x22eeb0]);}else{_0x435596[_0x22eeb0]=this[_0xa91f('0xa8')](_0x435596[_0x22eeb0]);}}}}return _0x435596;};AGIVertices['prototype'][_0xa91f('0xa9')]=function(_0x203154){for(var _0x63549d in _0x203154){if(_0x203154[_0xa91f('0xa6')](_0x63549d)){if(_[_0xa91f('0xaa')](_0x203154[_0x63549d])){this[_0xa91f('0xa9')](_0x203154[_0x63549d]);}else if(_[_0xa91f('0xab')](_0x203154[_0x63549d])){for(var _0x181f59=0x0;_0x181f59<_0x203154[_0x63549d][_0xa91f('0xac')];_0x181f59++){this[_0xa91f('0xa9')](_0x203154[_0x63549d][_0x181f59]);}}else if(_[_0xa91f('0xad')](_0x203154[_0x63549d])){_0x203154[_0x63549d]=this['replaceAllVariables'](_0x203154[_0x63549d]);}}}};AGIVertices[_0xa91f('0x11')][_0xa91f('0xae')]=function(_0x5782d1,_0x3a6cec){for(var _0x192919 in _0x5782d1){if(_0x5782d1[_0xa91f('0xa6')](_0x192919)){if(_['isPlainObject'](_0x5782d1[_0x192919])){if(!_[_0xa91f('0x47')](_0x5782d1[_0x192919])){this['saveRestApiResult'](_0x5782d1[_0x192919],util[_0xa91f('0x2a')]('%s.%s',_0x3a6cec,_0x192919));}}else if(_[_0xa91f('0xab')](_0x5782d1[_0x192919])){for(var _0x2bd126=0x0;_0x2bd126<_0x5782d1[_0x192919][_0xa91f('0xac')];_0x2bd126++){this[_0xa91f('0xae')](_0x5782d1[_0x192919][_0x2bd126],util['format'](_0xa91f('0xaf'),_0x3a6cec,_0x192919+'['+_0x2bd126+']'));}}else{if(!_[_0xa91f('0x48')](_0x5782d1[_0x192919])){this['channel'][_0xa91f('0xb0')](util[_0xa91f('0x2a')](_0xa91f('0xaf'),_0x3a6cec,_0x192919),_0x5782d1[_0x192919]);}}}}};AGIVertices[_0xa91f('0x11')]['replaceObjectAllVariables']=function(_0x5b0c53){try{var _0x38fb1c=JSON[_0xa91f('0x83')](_0x5b0c53);this['recursiveNodeIndex'](_0x38fb1c);return JSON[_0xa91f('0x88')](_0x38fb1c);}catch(_0xff22fb){return this['replaceAllVariables'](_0x5b0c53);}};AGIVertices[_0xa91f('0x11')]['replaceAllVariables']=function(_0x13482a){console[_0xa91f('0x45')]('replaceall\x20init',_0x13482a);var _0x2c5877=_0x13482a[_0xa91f('0xb1')]('{');for(var _0x5222d2=0x1;_0x5222d2<_0x2c5877[_0xa91f('0xac')];_0x5222d2+=0x1){var _0xbd0927=_0x2c5877[_0x5222d2][_0xa91f('0xb1')]('}');console[_0xa91f('0x45')](_0xa91f('0xb2'),_0xbd0927);if(_0xbd0927[_0xa91f('0xac')]>0x1){_0x13482a=_0x13482a['replaceAll']('{'+_0xbd0927[0x0]+'}',this[_0xa91f('0x38')][_0xa91f('0x12')](_0xbd0927[0x0])[_0xa91f('0xb3')]||_0xbd0927[0x0]);}}if(_0x2c5877[_0xa91f('0xac')]===0x1){return _0x13482a[_0xa91f('0x51')]();}console['log'](_0xa91f('0xb4'),_0x13482a);return this[_0xa91f('0xa8')](_0x13482a);};AGIVertices[_0xa91f('0x11')]['getAndSetVariable']=function(_0x307306,_0x149796){var _0x18b14a=this[_0xa91f('0x38')][_0xa91f('0x12')](_0x307306);if(_0x18b14a['result']===-0x1){return _0x18b14a;}logger[_0xa91f('0x30')](util['format'](_0xa91f('0xb5'),_0x149796,_0x18b14a[_0xa91f('0xb3')]));return this['channel'][_0xa91f('0xb0')](_0x149796,_0x18b14a[_0xa91f('0xb3')]);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x96')]=function(_0x13a4f2){return _0x13a4f2&&_0x13a4f2!=='0'&&_0x13a4f2!=='-1'&&_0x13a4f2!=='';};AGIVertices[_0xa91f('0x11')][_0xa91f('0xb6')]=function(_0x193155){this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x193155,'-');_0x193155[_0xa91f('0xb7')]=_0x193155[_0xa91f('0xb6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa91f('0x11')]['mrcpsynth']=function(_0x1e825b){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x1e825b[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x1e825b[_0xa91f('0x71')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0xba'));}var _0x33e6d1='\x22'+_0x1e825b['text']+'\x22';if(this[_0xa91f('0x96')](_0x1e825b[_0xa91f('0x8e')])){_0x33e6d1+=','+_0x1e825b[_0xa91f('0x8e')];}var _0x210b8c=this[_0xa91f('0x38')]['exec'](_0xa91f('0xbb'),_0x33e6d1);if(_0x210b8c[_0xa91f('0xbc')]===-0x1){return _0x210b8c;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x33e6d1));};AGIVertices[_0xa91f('0x11')][_0xa91f('0xbd')]=function(_0x291ebc){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x291ebc[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x291ebc[_0xa91f('0xbe')])){return this[_0xa91f('0x38')]['noop'](_0xa91f('0xbf'));}var _0x32b6ff=_0x291ebc['grammar'];if(this[_0xa91f('0x96')](_0x291ebc[_0xa91f('0x8e')])){_0x32b6ff+=','+_0x291ebc[_0xa91f('0x8e')];}var _0x5212a6=this[_0xa91f('0x38')]['exec'](_0xa91f('0xc0'),_0x32b6ff);if(_0x5212a6[_0xa91f('0xbc')]===-0x1){return _0x5212a6;}var _0x5b4cfa=this[_0xa91f('0xc1')](_0xa91f('0xc2'),_0xa91f('0xc3'));if(_0x5b4cfa[_0xa91f('0xbc')]===-0x1){return _0x5b4cfa;}var _0x4dea69=this[_0xa91f('0xc1')](_0xa91f('0xc4'),_0xa91f('0xc5'));if(_0x4dea69['result']===-0x1){return _0x4dea69;}var _0x1128c2=this[_0xa91f('0xc1')]('RECOG_INSTANCE()',_0xa91f('0xc6'));if(_0x1128c2['result']===-0x1){return _0x1128c2;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x32b6ff));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x7')]=function(_0x4c20a7){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0xc7'),_0x4c20a7[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0x7')]([_0x4c20a7[_0xa91f('0xc8')],_0x4c20a7[_0xa91f('0xc9')]]);};AGIVertices['prototype'][_0xa91f('0xca')]=function(_0x536a0f){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0xcb'),_0x536a0f[_0xa91f('0xb8')]));if(this['isConfigured'](_0x536a0f[_0xa91f('0x7b')])){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xcc'),_0x536a0f['timeout']));var _0x360319=this[_0xa91f('0x38')][_0xa91f('0xcd')](_0x536a0f[_0xa91f('0x7b')]);if(_0x360319[_0xa91f('0xbc')]===-0x1){return _0x360319;}}return this[_0xa91f('0x38')][_0xa91f('0xca')]();};AGIVertices[_0xa91f('0x11')][_0xa91f('0x4e')]=function(_0x19584f){console['log'](_0xa91f('0xce'),_0x19584f);logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xcf'),_0x19584f[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x19584f[_0xa91f('0x4c')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x19584f,_0xa91f('0xd0'));}_0x19584f[_0xa91f('0x50')]=moment();if(this[_0xa91f('0x96')](_0x19584f[_0xa91f('0xd1')])){_0x19584f['scheduledAt']=moment()[_0xa91f('0x5d')](_0x19584f[_0xa91f('0xd1')],_0xa91f('0x5e'));}if(!this[_0xa91f('0x96')](_0x19584f['callback_priority'])){_0x19584f[_0xa91f('0x52')]=0x2;}console['log'](_0xa91f('0xd2'),_0x19584f);this[_0xa91f('0x44')][_0xa91f('0x86')](this,_0x19584f);return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xd3'),_0x19584f[_0xa91f('0x58')],_0x19584f[_0xa91f('0x4c')],_0x19584f[_0xa91f('0x50')]));};AGIVertices['prototype'][_0xa91f('0xd4')]=function(_0x23ca9d){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x23ca9d[_0xa91f('0xb8')]));var _0x4b792f=this[_0xa91f('0x38')][_0xa91f('0x6c')](_0x23ca9d[_0xa91f('0xd5')],_0x23ca9d[_0xa91f('0x8e')]);if(_0x4b792f['result']===-0x1){return _0x4b792f;}return this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')](_0xa91f('0xd6'),_0x23ca9d['application'],_0x23ca9d[_0xa91f('0x8e')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x1ce317){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xd7'),_0x1ce317['label']));if(!this['isConfigured'](_0x1ce317[_0xa91f('0x71')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')]('no\x20text\x20configured');}var _0x2ee99b='\x22'+_0x1ce317['text']+'\x22';if(this[_0xa91f('0x96')](_0x1ce317[_0xa91f('0x8e')])){_0x2ee99b+=','+_0x1ce317[_0xa91f('0x8e')];}var _0xd86efe=this[_0xa91f('0x38')]['exec']('MRCPSynth',_0x2ee99b);if(_0xd86efe[_0xa91f('0xbc')]===-0x1){return _0xd86efe;}return this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xd8'),_0x2ee99b));};AGIVertices[_0xa91f('0x11')][_0xa91f('0xd9')]=function(_0x349a14){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x349a14['label']));if(!this[_0xa91f('0x96')](_0x349a14[_0xa91f('0x71')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0xba'));}var _0x1c6501='\x22'+_0x349a14[_0xa91f('0x71')]+'\x22';if(this[_0xa91f('0x96')](_0x349a14['options'])){_0x1c6501+=','+_0x349a14[_0xa91f('0x8e')];}var _0x342122=this[_0xa91f('0x38')][_0xa91f('0x6c')](_0xa91f('0xbb'),_0x1c6501);if(_0x342122[_0xa91f('0xbc')]===-0x1){return _0x342122;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xd8'),_0x1c6501));};AGIVertices[_0xa91f('0x11')][_0xa91f('0xda')]=function(_0x59e272){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x59e272['label']));if(!this['isConfigured'](_0x59e272[_0xa91f('0xbe')])){return this[_0xa91f('0x38')]['noop'](_0xa91f('0xbf'));}var _0x42a488=_0x59e272[_0xa91f('0xbe')];if(this[_0xa91f('0x96')](_0x59e272[_0xa91f('0x8e')])){_0x42a488+=','+_0x59e272[_0xa91f('0x8e')];}var _0x35af5a=this[_0xa91f('0x38')][_0xa91f('0x6c')](_0xa91f('0xc0'),_0x42a488);if(_0x35af5a[_0xa91f('0xbc')]===-0x1){return _0x35af5a;}var _0x2ae13e=this['getAndSetVariable'](_0xa91f('0xc2'),_0xa91f('0xdb'));if(_0x2ae13e['result']===-0x1){return _0x2ae13e;}var _0x424ccb=this[_0xa91f('0xc1')]('RECOG_INPUT()',_0xa91f('0xdc'));if(_0x424ccb['result']===-0x1){return _0x424ccb;}var _0xd8d101=this[_0xa91f('0xc1')](_0xa91f('0xdd'),_0xa91f('0xde'));if(_0xd8d101['result']===-0x1){return _0xd8d101;}return this['channel']['noop'](util['format'](_0xa91f('0xdf'),_0x42a488));};AGIVertices[_0xa91f('0x11')]['sestekasr']=function(_0x26765a){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x26765a[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x26765a[_0xa91f('0xbe')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xbf'));}var _0x55c077=_0x26765a[_0xa91f('0xbe')];if(this['isConfigured'](_0x26765a[_0xa91f('0x8e')])){_0x55c077+=','+_0x26765a[_0xa91f('0x8e')];}var _0x49f09b=this[_0xa91f('0x38')][_0xa91f('0x6c')](_0xa91f('0xc0'),_0x55c077);if(_0x49f09b[_0xa91f('0xbc')]===-0x1){return _0x49f09b;}var _0x4998e4=this[_0xa91f('0xc1')](_0xa91f('0xc2'),_0xa91f('0xe0'));if(_0x4998e4[_0xa91f('0xbc')]===-0x1){return _0x4998e4;}var _0x28f3a0=this[_0xa91f('0xc1')](_0xa91f('0xc4'),'SESTEK_ASR_TRANSCRIPT');if(_0x28f3a0[_0xa91f('0xbc')]===-0x1){return _0x28f3a0;}var _0x5c4934=this[_0xa91f('0xc1')](_0xa91f('0xdd'),_0xa91f('0xe1'));if(_0x5c4934[_0xa91f('0xbc')]===-0x1){return _0x5c4934;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xdf'),_0x55c077));};AGIVertices[_0xa91f('0x11')][_0xa91f('0xe2')]=function(_0x4dbd6a){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xe3'),_0x4dbd6a[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x4dbd6a['odbc_id'])){return this[_0xa91f('0x38')]['error'](_0x4dbd6a,_0xa91f('0xe4'));}var _0x5646e9=this[_0xa91f('0x1b')][_0xa91f('0x86')](this,_0x4dbd6a[_0xa91f('0xe5')]);if(!_0x5646e9){return this[_0xa91f('0x38')]['error'](_0x4dbd6a,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x4dbd6a[_0xa91f('0x31')])){return this['channel'][_0xa91f('0x2e')](_0x4dbd6a,_0xa91f('0xe6'));}var _0x58ea2e=_0x4dbd6a['query'][_0xa91f('0x6e')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa91f('0x38')]['noop'](util['format'](_0xa91f('0xe7'),_0x58ea2e));var _0x3b34e5=this[_0xa91f('0x2c')][_0xa91f('0x86')](this,_0x5646e9,_0x58ea2e);this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x4dbd6a,_0x58ea2e);if(!this[_0xa91f('0x96')](_0x4dbd6a[_0xa91f('0xe8')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0xe9'));}var _0x2c2fae=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x4dbd6a[_0xa91f('0xe8')]);if(!_0x2c2fae){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x4dbd6a,_0xa91f('0xea'));}var _0x278dc6=this;_0x3b34e5[_0xa91f('0xeb')](function(_0xac9acd,_0x27a743){Object[_0xa91f('0xec')](_0xac9acd)[_0xa91f('0xeb')](function(_0x21332e){_0x278dc6[_0xa91f('0x38')]['setVariable'](util[_0xa91f('0x2a')]('%s[%s][%s]',_0x2c2fae,_0x27a743,_0x21332e),_0xac9acd[_0x21332e]);});});this[_0xa91f('0x38')][_0xa91f('0xb0')](util['format'](_0xa91f('0xed'),_0x2c2fae),_0x3b34e5[_0xa91f('0xac')]);return this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xee'),_0x2c2fae));};AGIVertices['prototype']['dial']=function(_0x2a7eed){logger[_0xa91f('0xef')](util[_0xa91f('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2a7eed['label']));if(!this[_0xa91f('0x96')](_0x2a7eed[_0xa91f('0xf0')])){return this['channel'][_0xa91f('0x2e')](_0x2a7eed,'no\x20user\x20selected');}var _0x1c4173=this[_0xa91f('0x1e')]['sync'](this,_0x2a7eed[_0xa91f('0xf0')]);if(!_0x1c4173){return this[_0xa91f('0x38')]['error'](_0x2a7eed,_0xa91f('0xf1'));}var _0x302c1d=this['channel']['exec'](_0xa91f('0xf2'),[util[_0xa91f('0x2a')]('SIP/%s',_0x1c4173),_0x2a7eed[_0xa91f('0x7b')],_0x2a7eed[_0xa91f('0xf3')],_0x2a7eed['url']]);if(_0x302c1d[_0xa91f('0xbc')]===-0x1){return _0x302c1d;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xf4'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x4c4d0a){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xf5'),_0x4c4d0a['label']));if(!this[_0xa91f('0x96')](_0x4c4d0a[_0xa91f('0x90')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')]('no\x20key\x20configured');}if(!this[_0xa91f('0x96')](_0x4c4d0a[_0xa91f('0x71')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xba'));}this[_0xa91f('0x38')][_0xa91f('0xf6')]=!![];this[_0xa91f('0x37')](_0x4c4d0a);this['createSquareMessage'](_0x4c4d0a[_0xa91f('0x71')],'in');this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x4c4d0a[_0xa91f('0x71')]));var _0x275b42=this[_0xa91f('0x8f')][_0xa91f('0x86')](this,_0x4c4d0a);if(_0x275b42){for(var _0xad2971 in _0x275b42){if(_0x275b42[_0xa91f('0xa6')](_0xad2971)){this[_0xa91f('0x38')][_0xa91f('0xb0')](util['format'](_0xa91f('0xf7'),_0xad2971['toUpperCase']()),_0x275b42[_0xad2971]);}}this[_0xa91f('0x43')](_0x275b42[_0xa91f('0xf8')],_0xa91f('0xf9'));return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xfa'),_0x275b42['speech']));}return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x4c4d0a,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xa91f('0x11')]['sesteknda']=function(_0x7a03c8){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0xfb'),_0x7a03c8[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x7a03c8[_0xa91f('0xfc')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xfd'));}if(!this[_0xa91f('0x96')](_0x7a03c8[_0xa91f('0xfe')])){return this['channel'][_0xa91f('0xb9')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x7a03c8[_0xa91f('0xff')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x100'));}if(!this['isConfigured'](_0x7a03c8[_0xa91f('0x101')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xba'));}this[_0xa91f('0x38')][_0xa91f('0xf6')]=!![];this[_0xa91f('0x37')](_0x7a03c8);this[_0xa91f('0x43')](_0x7a03c8['text'],'in');this['channel'][_0xa91f('0xb9')](util['format'](_0xa91f('0x102'),_0x7a03c8[_0xa91f('0x71')]));var _0x1bbc0f=this['sestekNDA'][_0xa91f('0x86')](this,_0x7a03c8);if(_0x1bbc0f){for(var _0x563003 in _0x1bbc0f){if(_0x1bbc0f[_0xa91f('0xa6')](_0x563003)){this['channel']['setVariable'](util[_0xa91f('0x2a')](_0xa91f('0x103'),_0x563003['toUpperCase']()),_0x1bbc0f[_0x563003]);}}this[_0xa91f('0x43')](_0x1bbc0f[_0xa91f('0xf8')],_0xa91f('0xf9'));if(_0x1bbc0f['audiofile']){this['channel']['noop'](util[_0xa91f('0x2a')](_0xa91f('0x104'),_0x1bbc0f['audiofile']));var _0xb5b8b2=this[_0xa91f('0x38')][_0xa91f('0x105')](_0x1bbc0f[_0xa91f('0x106')]);try{fs[_0xa91f('0x107')](_0x1bbc0f[_0xa91f('0x106')]+_0xa91f('0x108'));}catch(_0x4eb986){logger[_0xa91f('0x2e')](_0x4eb986);}return _0xb5b8b2;}else{return this[_0xa91f('0x38')][_0xa91f('0xb9')](util['format']('SestekNDA\x20Result\x20%s',_0x1bbc0f[_0xa91f('0xf8')]));}}return this['channel'][_0xa91f('0x2e')](_0x7a03c8,_0xa91f('0x109'));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x10a')]=function(_0x507522){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x10b'),_0x507522[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x10a'));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x10c')]=function(_0x1c283e){logger[_0xa91f('0x30')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1c283e['label']));var _0x5ef66e='';if(_0x1c283e[_0xa91f('0x10d')]){if(!this[_0xa91f('0x96')](_0x1c283e[_0xa91f('0x10d')])){return this[_0xa91f('0x38')]['error'](_0x1c283e,_0xa91f('0x10e'));}else{var _0x17752e=parseInt(_0x1c283e[_0xa91f('0x10d')],0xa);if(isNaN(_0x17752e)){_0x5ef66e=_0x1c283e['trunk_id'];}else{_0x5ef66e=this[_0xa91f('0x1f')][_0xa91f('0x86')](this,_0x1c283e[_0xa91f('0x10d')]);if(!_0x5ef66e){return this['channel'][_0xa91f('0x2e')](_0x1c283e,'no\x20trunk\x20found');}}}}else if(_0x1c283e[_0xa91f('0x10f')]){_0x5ef66e=_0x1c283e[_0xa91f('0x10f')];}else{return this[_0xa91f('0x38')]['error'](_0x1c283e,_0xa91f('0x10e'));}var _0x52c177=this['channel'][_0xa91f('0x6c')]('DIAL',[util[_0xa91f('0x2a')]('SIP/%s/%s',_0x5ef66e,_0x1c283e[_0xa91f('0x58')]),_0x1c283e[_0xa91f('0x7b')],_0x1c283e['opts'],_0x1c283e[_0xa91f('0x110')]]);if(_0x52c177[_0xa91f('0xbc')]===-0x1){return _0x52c177;}return this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')]('Executed\x20command\x20%s',_0xa91f('0xf2')));};AGIVertices['prototype'][_0xa91f('0x111')]=function(_0x3a89ea){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x112'),_0x3a89ea['label']));return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x111'));};AGIVertices['prototype'][_0xa91f('0xe')]=function(_0x7fccd8){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x113'),_0x7fccd8['label']));if(_0x7fccd8['retry']===0x0){return this[_0xa91f('0xb6')](_0x7fccd8);}_0x7fccd8[_0xa91f('0xb7')]-=0x1;if(!this['isConfigured'](_0x7fccd8[_0xa91f('0x114')])){return this[_0xa91f('0x38')]['error'](_0x7fccd8,_0xa91f('0x115'));}var _0x52153f=this[_0xa91f('0x21')][_0xa91f('0x86')](this,_0x7fccd8[_0xa91f('0x114')]);if(!_0x52153f){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x7fccd8,_0xa91f('0x116'));}if(!this[_0xa91f('0x96')](_0x7fccd8[_0xa91f('0xe8')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x153cf4=this['channel'][_0xa91f('0x117')](_0x52153f,_0x7fccd8[_0xa91f('0x118')],_0x7fccd8[_0xa91f('0x119')]);var _0x2a1fd2=_0x153cf4['result']?_0x153cf4[_0xa91f('0xbc')]['toString']():'';logger[_0xa91f('0x30')](_0xa91f('0x11a'),JSON[_0xa91f('0x88')](_0x153cf4));if(_0x153cf4[_0xa91f('0xbc')]===-0x1){this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x7fccd8,_0x2a1fd2);return _0x153cf4;}else if(_0x153cf4[_0xa91f('0xb3')]===_0xa91f('0x7b')){_0x153cf4[_0xa91f('0xbc')]=_0x2a1fd2[_0xa91f('0xac')]>=parseInt(_0x7fccd8[_0xa91f('0x11b')])?'x':'i';}else{_0x153cf4['result']=_0x2a1fd2['length']>=parseInt(_0x7fccd8[_0xa91f('0x11b')])&&_0x2a1fd2[_0xa91f('0xac')]<=parseInt(_0x7fccd8[_0xa91f('0x119')])?'x':'i';}var _0x217f10=this['getVariable']['sync'](this,_0x7fccd8[_0xa91f('0xe8')]);if(!_0x217f10){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x7fccd8,_0xa91f('0xea'));}this[_0xa91f('0x38')][_0xa91f('0xb0')](_0x217f10,_0x2a1fd2);if(this['isConfigured'](_0x7fccd8[_0xa91f('0x11c')])){var _0x355dae=parseInt(_0x7fccd8[_0xa91f('0x11c')],0xa);var _0x4e1e3a=rs[_0xa91f('0x11d')]({'charset':'*','length':_0x355dae});var _0xea14ba=_0x2a1fd2[_0xa91f('0xac')];if(_0xea14ba>0x0){if(_0xea14ba>_0x355dae){this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x7fccd8,_0x7fccd8[_0xa91f('0x11e')]==='first'?_0x4e1e3a+_0x2a1fd2['substr'](_0x355dae):_0x2a1fd2[_0xa91f('0x11f')](0x0,_0xea14ba-_0x355dae)+_0x4e1e3a);}else{this['createSquareDetailsReport'][_0xa91f('0x86')](this,_0x7fccd8,rs[_0xa91f('0x11d')]({'charset':'*','length':_0xea14ba}));}}else{this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x7fccd8,'');}}else{this['createSquareDetailsReport'][_0xa91f('0x86')](this,_0x7fccd8,_0x2a1fd2);}return _0x153cf4;};AGIVertices[_0xa91f('0x11')]['getsecretdigits']=function(_0x1d85f8){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x120'),_0x1d85f8[_0xa91f('0xb8')]));return this[_0xa91f('0xe')](_0x1d85f8);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x121')]=function(_0x524e83){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x122'),_0x524e83[_0xa91f('0xb8')]));this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x524e83,_0x524e83[_0xa91f('0x123')]);return this['channel']['noop'](util[_0xa91f('0x2a')](_0xa91f('0x124'),_0x524e83[_0xa91f('0x123')]));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x125')]=function(_0x227ae4){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x126'),_0x227ae4[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x227ae4[_0xa91f('0x99')])||!this[_0xa91f('0x96')](_0x227ae4[_0xa91f('0x9f')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xa91f('0x96')](_0x227ae4['text'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xba'));}this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')]('Trying\x20aws\x20Polly\x20%s',_0x227ae4[_0xa91f('0x71')]));var _0x1a180e=this['awsPolly'][_0xa91f('0x86')](this,_0x227ae4);if(_0x1a180e){this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x127'),_0x1a180e));var _0x380cda=this[_0xa91f('0x38')][_0xa91f('0x105')](_0x1a180e);try{fs[_0xa91f('0x107')](_0x1a180e+_0xa91f('0x108'));}catch(_0x5e8852){logger['error'](_0x5e8852);}return _0x380cda;}return this['channel'][_0xa91f('0x2e')](_0x227ae4,_0xa91f('0x128'));};AGIVertices['prototype'][_0xa91f('0x129')]=function(_0x161de7){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x12a'),_0x161de7[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x161de7['aws_access_key_id'])||!this['isConfigured'](_0x161de7['aws_secret_access_key'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xa91f('0x96')](_0x161de7['aws_bot_name'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x12b'));}if(!this['isConfigured'](_0x161de7[_0xa91f('0x71')])){return this['channel'][_0xa91f('0xb9')]('no\x20text\x20configured');}this[_0xa91f('0x38')]['bot']=!![];this[_0xa91f('0x37')](_0x161de7);this[_0xa91f('0x43')](_0x161de7[_0xa91f('0x71')],'in');this[_0xa91f('0x38')][_0xa91f('0xb9')](util['format'](_0xa91f('0x12c'),_0x161de7[_0xa91f('0x71')]));var _0x53bbc4=this[_0xa91f('0x9e')][_0xa91f('0x86')](this,_0x161de7);if(_0x53bbc4){for(var _0x50659d in _0x53bbc4){if(_0x53bbc4[_0xa91f('0xa6')](_0x50659d)&&_[_0xa91f('0xad')](_0x53bbc4[_0x50659d])){this[_0xa91f('0x38')][_0xa91f('0xb0')](util[_0xa91f('0x2a')]('AWS_LEX_%s',_0x50659d['toUpperCase']()),_0x53bbc4[_0x50659d]);}}if(_[_0xa91f('0x48')](_0x53bbc4[_0xa91f('0x8d')])){return this['channel']['noop'](_0xa91f('0x12d'));}else{this['createSquareMessage'](_0x53bbc4['message'],_0xa91f('0xf9'));return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x12e'),_0x53bbc4[_0xa91f('0x8d')]));}}return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x161de7,_0xa91f('0x12f'));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x130')]=function(_0x1276e9){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x131'),_0x1276e9[_0xa91f('0xb8')],_0x1276e9[_0xa91f('0x7b')]));if(!this[_0xa91f('0x96')](_0x1276e9[_0xa91f('0x90')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x18efbd='wav';var _0x5c2642=util['format'](_0xa91f('0x132'),FILES_PATH,rs[_0xa91f('0x11d')](0x4));var _0xab358b=util['format'](_0xa91f('0xaf'),_0x5c2642,_0x18efbd);var _0x55683e=!![];if(_0x1276e9[_0xa91f('0x133')]==='NOBEEP'){_0x55683e=![];}var _0x4d74e6=this[_0xa91f('0x38')][_0xa91f('0x134')](_0x5c2642,_0x18efbd,_0x1276e9['intKey'],_0x1276e9[_0xa91f('0x7b')],undefined,_0x55683e);if(_0x4d74e6[_0xa91f('0xbc')]!==-0x1){this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')]('google\x20%s\x20file\x20created',_0xab358b));var _0x50dd24=this[_0xa91f('0xa2')][_0xa91f('0x86')](this,_0x1276e9,_0xab358b);if(_0x50dd24){for(var _0x4fd228 in _0x50dd24){if(_0x50dd24[_0xa91f('0xa6')](_0x4fd228)){this['channel'][_0xa91f('0xb0')](util['format'](_0xa91f('0x135'),_0x4fd228[_0xa91f('0x80')]()),_0x50dd24[_0x4fd228]);}}return this[_0xa91f('0x38')]['noop'](util['format'](_0xa91f('0x136'),JSON[_0xa91f('0x88')](_0x50dd24)));}}return _0x4d74e6;};AGIVertices['prototype'][_0xa91f('0x137')]=function(_0x5e0883){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x138'),_0x5e0883['label']));if(!this[_0xa91f('0x96')](_0x5e0883[_0xa91f('0x139')])){return this[_0xa91f('0x38')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x5e0883['appsecret'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x13a'));}var _0x3a3ee9=_0xa91f('0x13b');var _0x5f5676=util[_0xa91f('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3b67b5=util[_0xa91f('0x2a')](_0xa91f('0xaf'),_0x5f5676,_0x3a3ee9);var _0x32422d=!![];if(_0x5e0883[_0xa91f('0x133')]===_0xa91f('0x13c')){_0x32422d=![];}var _0xfa27f3=this[_0xa91f('0x38')]['recordFile'](_0x5f5676,_0x3a3ee9,_0x5e0883['intKey'],_0x5e0883[_0xa91f('0x7b')],undefined,_0x32422d);if(_0xfa27f3[_0xa91f('0xbc')]!==-0x1){this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('tilde\x20%s\x20file\x20created',_0x3b67b5));var _0x4a8363=this[_0xa91f('0xa3')][_0xa91f('0x86')](this,_0x5e0883,_0x3b67b5);if(_0x4a8363){for(var _0x3e75f0 in _0x4a8363){if(_0x4a8363[_0xa91f('0xa6')](_0x3e75f0)){this[_0xa91f('0x38')]['setVariable'](util['format'](_0xa91f('0x13d'),_0x3e75f0[_0xa91f('0x80')]()),_0x4a8363[_0x3e75f0]);}}return this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x13e'),JSON[_0xa91f('0x88')](_0x4a8363)));}}return _0xfa27f3;};AGIVertices[_0xa91f('0x11')][_0xa91f('0x13f')]=function(_0x4446c5){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x140'),_0x4446c5['label']));return this['channel'][_0xa91f('0x141')](_0x4446c5[_0xa91f('0x3e')],_0x4446c5[_0xa91f('0x3f')],_0x4446c5['priority']);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x142')]=function(_0x3d7f28){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x143'),_0x3d7f28[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x3d7f28[_0xa91f('0x144')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x3d7f28,_0xa91f('0x145'));}try{var _0x2644a2=eval(_0x3d7f28[_0xa91f('0x144')])?_0xa91f('0x146'):_0xa91f('0x147');this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x148'),_0x3d7f28[_0xa91f('0x144')],_0x2644a2));return{'code':0xc8,'result':_0x2644a2};}catch(_0x3bcdc1){return{'code':0xc8,'result':_0xa91f('0x147')};}};AGIVertices[_0xa91f('0x11')][_0xa91f('0x149')]=function(_0x58533d){logger['info'](util['format'](_0xa91f('0x14a'),_0x58533d[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x58533d[_0xa91f('0x14b')])){return this[_0xa91f('0x38')]['error'](_0x58533d,_0xa91f('0x14c'));}var _0x3e1fb7=this[_0xa91f('0x26')][_0xa91f('0x86')](this,_0x58533d[_0xa91f('0x14b')]);if(!_0x3e1fb7){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x58533d,'no\x20intervals\x20found');}for(var _0x50b5cd=0x0;_0x50b5cd<_0x3e1fb7[_0xa91f('0xac')];_0x50b5cd+=0x1){var _0x358aee=this[_0xa91f('0x38')][_0xa91f('0x12')](util[_0xa91f('0x2a')](_0xa91f('0x14d'),_0x3e1fb7[_0x50b5cd]));if(_0x358aee[_0xa91f('0xbc')]===-0x1){return _0x358aee;}logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x14e'),_0x3e1fb7[_0x50b5cd],_0x358aee['extra']));if(_0x358aee[_0xa91f('0xb3')]===_0xa91f('0x146')){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x14e'),_0x3e1fb7[_0x50b5cd],'true'));this[_0xa91f('0x38')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x3e1fb7[_0x50b5cd],_0xa91f('0x146')));return{'code':0xc8,'result':'true'};}else{logger[_0xa91f('0x30')](util['format'](_0xa91f('0x14e'),_0x3e1fb7[_0x50b5cd],_0xa91f('0x147')));this['channel'][_0xa91f('0xb9')](util['format']('IFTIME\x20%s\x20%s',_0x3e1fb7[_0x50b5cd],_0xa91f('0x147')));}}return{'code':0xc8,'result':_0xa91f('0x147')};};AGIVertices[_0xa91f('0x11')][_0xa91f('0x14f')]=function(_0x4df3b1){logger['info'](util[_0xa91f('0x2a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4df3b1[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0x14f')]();};AGIVertices['prototype']['ispeechasr']=function(_0x5ce639){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x150'),_0x5ce639[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x5ce639[_0xa91f('0x90')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x151'));}var _0x597659='wav';var _0x2120c5=util[_0xa91f('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x41fd84=util[_0xa91f('0x2a')](_0xa91f('0xaf'),_0x2120c5,_0x597659);var _0x5ae79b=!![];if(_0x5ce639[_0xa91f('0x133')]==='NOBEEP'){_0x5ae79b=![];}var _0x5abde3=this[_0xa91f('0x38')][_0xa91f('0x134')](_0x2120c5,_0x597659,_0x5ce639[_0xa91f('0x152')],_0x5ce639[_0xa91f('0x7b')],undefined,_0x5ae79b);if(_0x5abde3[_0xa91f('0xbc')]!==-0x1){this['channel'][_0xa91f('0xb9')](util['format'](_0xa91f('0x153'),_0x41fd84));var _0x52e974=this[_0xa91f('0x95')][_0xa91f('0x86')](this,_0x5ce639,_0x41fd84);if(_0x52e974){for(var _0x212c19 in _0x52e974){if(_0x52e974[_0xa91f('0xa6')](_0x212c19)){this[_0xa91f('0x38')][_0xa91f('0xb0')](util['format'](_0xa91f('0x154'),_0x212c19[_0xa91f('0x80')]()),_0x52e974[_0x212c19]);}}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x155'),JSON['stringify'](_0x52e974)));}}return _0x5abde3;};AGIVertices[_0xa91f('0x11')][_0xa91f('0x156')]=function(_0x3f3175){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x157'),_0x3f3175['label']));if(!this['isConfigured'](_0x3f3175[_0xa91f('0x90')])){return this[_0xa91f('0x38')]['noop'](_0xa91f('0x151'));}if(!this[_0xa91f('0x96')](_0x3f3175[_0xa91f('0x71')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xba'));}this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')](_0xa91f('0x158'),_0x3f3175[_0xa91f('0x71')]));var _0x313e7f=this[_0xa91f('0x92')]['sync'](this,_0x3f3175);if(_0x313e7f){this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')](_0xa91f('0x153'),_0x313e7f));var _0x20b71f=this[_0xa91f('0x38')][_0xa91f('0x105')](_0x313e7f,_0x3f3175[_0xa91f('0x152')]);try{fs[_0xa91f('0x107')](_0x313e7f+_0xa91f('0x108'));}catch(_0x593cb8){logger[_0xa91f('0x2e')](_0x593cb8);}return _0x20b71f;}return this['channel'][_0xa91f('0x2e')](_0x3f3175,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xa91f('0x159')]=function(_0x254a30){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x15a'),_0x254a30[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x254a30[_0xa91f('0x15b')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x254a30,_0xa91f('0x15c'));}logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x15d'),this[_0xa91f('0x38')]['callerid'],_0x254a30[_0xa91f('0x15b')]));var _0xfd66d1=this['agentLogin'][_0xa91f('0x86')](this,_0x254a30[_0xa91f('0x15b')]);if(_0xfd66d1){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x15e'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x254a30[_0xa91f('0x15b')]));this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x15e'),this[_0xa91f('0x38')]['callerid'],_0x254a30[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x15f')};}else{logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x160'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x254a30[_0xa91f('0x15b')]));this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x160'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x254a30[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x161')};}};AGIVertices['prototype'][_0xa91f('0x162')]=function(_0x103888){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x163'),_0x103888['label']));if(!this[_0xa91f('0x96')](_0x103888[_0xa91f('0x15b')])){return this['channel'][_0xa91f('0x2e')](_0x103888,_0xa91f('0x15c'));}logger[_0xa91f('0x30')](util['format'](_0xa91f('0x15d'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x103888[_0xa91f('0x15b')]));var _0x2fe2d3=this['agentLogout']['sync'](this,_0x103888['findBy']);if(_0x2fe2d3){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x103888[_0xa91f('0x15b')]));this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa91f('0x3b')],_0x103888[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x15f')};}else{logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x160'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x103888[_0xa91f('0x15b')]));this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa91f('0x38')]['callerid'],_0x103888[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x161')};}};AGIVertices[_0xa91f('0x11')][_0xa91f('0x164')]=function(_0x1d3a31){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1d3a31['label']));if(!this[_0xa91f('0x96')](_0x1d3a31[_0xa91f('0x165')])){return this['channel']['error'](_0x1d3a31,'no\x20operation\x20configured');}this['channel']['noop'](util[_0xa91f('0x2a')]('math\x20%s',_0x1d3a31[_0xa91f('0x165')]));var _0xe679f=eval(_0x1d3a31['operation']);if(!this['isConfigured'](_0x1d3a31[_0xa91f('0xe8')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0xe9'));}var _0x5d3fea=this['getVariable'][_0xa91f('0x86')](this,_0x1d3a31[_0xa91f('0xe8')]);if(!_0x5d3fea){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x1d3a31,_0xa91f('0xea'));}if(_['isArray'](_0xe679f)){var _0x2d746a=this;_0xe679f[_0xa91f('0xeb')](function(_0x4de60e,_0x5049c8){_0x2d746a[_0xa91f('0x38')][_0xa91f('0xb0')](util[_0xa91f('0x2a')](_0xa91f('0x166'),_0x5d3fea,_0x5049c8),_0x4de60e);});return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x167'),_0x5d3fea));}else{return this['channel'][_0xa91f('0xb0')](_0x5d3fea,_0xe679f);}};AGIVertices[_0xa91f('0x11')]['menu']=function(_0x31fe83){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x168'),_0x31fe83[_0xa91f('0xb8')]));if(_0x31fe83['retry']===0x0){return this[_0xa91f('0xb6')](_0x31fe83);}_0x31fe83[_0xa91f('0xb7')]-=0x1;if(!this[_0xa91f('0x96')](_0x31fe83[_0xa91f('0x114')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x31fe83,'no\x20file\x20audio\x20selected');}var _0x5e0b72=this[_0xa91f('0x21')]['sync'](this,_0x31fe83[_0xa91f('0x114')]);if(!_0x5e0b72){return this[_0xa91f('0x38')]['error'](_0x31fe83,_0xa91f('0x116'));}var _0x28a2a0=this['channel'][_0xa91f('0x117')](_0x5e0b72,_0x31fe83[_0xa91f('0x118')],_0x31fe83[_0xa91f('0x169')]);var _0x3117cc=_0x28a2a0[_0xa91f('0xbc')];if(_0x28a2a0['result']===-0x1){this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x31fe83,'-1');return _0x28a2a0;}else if(_0x28a2a0[_0xa91f('0xb3')]==='timeout'){_0x28a2a0[_0xa91f('0xbc')]=_0x28a2a0[_0xa91f('0xbc')][_0xa91f('0xac')]>0x0?_0x28a2a0[_0xa91f('0xbc')]:'t';}else if(_[_0xa91f('0x47')](_0x28a2a0[_0xa91f('0xbc')])){_0x28a2a0[_0xa91f('0xbc')]='#';_0x3117cc='#';}if(!this[_0xa91f('0x96')](_0x31fe83[_0xa91f('0xe8')])){this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0xe9'));}else{var _0x34e605=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x31fe83['variable_id']);if(!_0x34e605){return this[_0xa91f('0x38')]['error'](_0x31fe83,_0xa91f('0xea'));}this[_0xa91f('0x38')]['setVariable'](_0x34e605,_0x3117cc);}this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x31fe83,_0x3117cc);return _0x28a2a0;};AGIVertices[_0xa91f('0x11')][_0xa91f('0xb9')]=function(_0x3b539e){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x16a'),_0x3b539e[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0x3b539e[_0xa91f('0x16b')]||_0x3b539e['label']);};AGIVertices['prototype'][_0xa91f('0x16c')]=function(_0x2f6a86){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x16d'),_0x2f6a86[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x2f6a86[_0xa91f('0x15b')])){return this['channel'][_0xa91f('0x2e')](_0x2f6a86,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x15d'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x2f6a86[_0xa91f('0x15b')]));var _0x49aedb=this[_0xa91f('0x62')][_0xa91f('0x86')](this,_0x2f6a86[_0xa91f('0x16e')]);var _0x4d339a=this['agentPause'][_0xa91f('0x86')](this,_0x2f6a86[_0xa91f('0x15b')],_0x49aedb);if(_0x4d339a){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa91f('0x38')]['callerid'],_0x2f6a86['findBy']));this['channel']['noop'](util[_0xa91f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa91f('0x38')]['callerid'],_0x2f6a86[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x15f')};}else{logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x160'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x2f6a86['findBy']));this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')](_0xa91f('0x15e'),this['channel'][_0xa91f('0x3b')],_0x2f6a86[_0xa91f('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xa91f('0x16f')]=function(_0x367199){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x367199[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x367199['file_id'])){return this[_0xa91f('0x38')]['error'](_0x367199,'no\x20file\x20audio\x20selected');}var _0x434352=this[_0xa91f('0x21')][_0xa91f('0x86')](this,_0x367199[_0xa91f('0x114')]);if(!_0x434352){return this[_0xa91f('0x38')]['error'](_0x367199,_0xa91f('0x116'));}var _0x3aef29=this['channel'][_0xa91f('0x6c')]('PLAYBACK',[_0x434352,_0x367199[_0xa91f('0xf3')]]);if(_0x3aef29[_0xa91f('0xbc')]===-0x1){return _0x3aef29;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xd6'),_0xa91f('0x170'),_0x434352));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x171')]=function(_0x5f4f93){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x172'),_0x5f4f93[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x5f4f93[_0xa91f('0x173')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x5f4f93,'no\x20queue\x20selected');}var _0x15983c='';var _0xd10bf9=parseInt(_0x5f4f93[_0xa91f('0x173')],0xa);if(isNaN(_0xd10bf9)){_0x15983c=_0x5f4f93[_0xa91f('0x173')];}else{_0x15983c=this['getVoiceQueue']['sync'](this,_0x5f4f93[_0xa91f('0x173')]);if(!_0x15983c){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x5f4f93,'no\x20queue\x20found');}}var _0x4a8eb4='';if(this[_0xa91f('0x96')](_0x5f4f93[_0xa91f('0x114')])){var _0x3c297b=this['getSound']['sync'](this,_0x5f4f93[_0xa91f('0x114')]);if(_0x3c297b){_0x4a8eb4=_0x3c297b;}}this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x5f4f93,_0x15983c);if(_0x5f4f93[_0xa91f('0xf3')][_0xa91f('0x174')]('x')<0x0){_0x5f4f93[_0xa91f('0xf3')]+='x';}if(_0x5f4f93[_0xa91f('0xf3')][_0xa91f('0x174')]('X')<0x0){_0x5f4f93['opts']+='X';}this[_0xa91f('0x38')][_0xa91f('0xb0')](_0xa91f('0x175'),_0x15983c?_0x15983c['toLowerCase']():'');var _0x2aa75c=this[_0xa91f('0x38')][_0xa91f('0x6c')](_0xa91f('0x176'),[_0x15983c,_0x5f4f93[_0xa91f('0xf3')],_0x5f4f93[_0xa91f('0x110')],_0x4a8eb4,_0x5f4f93[_0xa91f('0x7b')],_0x5f4f93['agi'],_0x5f4f93[_0xa91f('0x177')],_0x5f4f93[_0xa91f('0x178')],'',_0x5f4f93['position']]);if(_0x2aa75c['result']===-0x1){return _0x2aa75c;}return this['channel']['noop'](util[_0xa91f('0x2a')](_0xa91f('0xd6'),_0xa91f('0x176'),_0x15983c));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x179')]=function(_0x3f7ab6){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x17a'),_0x3f7ab6[_0xa91f('0xb8')]));var _0x5730b0=_0x3f7ab6[_0xa91f('0x17b')]||_0xa91f('0x13b');var _0x4c45e3=util['format']('%s_%s',this[_0xa91f('0x38')][_0xa91f('0x4d')],rs['generate'](0x5));var _0x5688aa=util[_0xa91f('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0x4c45e3,_0x5730b0);var _0x241226=util['format'](_0xa91f('0x132'),FILES_PATH,_0x4c45e3);this[_0xa91f('0x3c')][_0xa91f('0x86')](this,_0x3f7ab6,_0x4c45e3,_0x5688aa);this[_0xa91f('0x38')]['setVariable']('RECORDING_SAVENAME',_0x4c45e3);logger[_0xa91f('0x30')](_0xa91f('0x17c'),_0x241226,_0x5730b0,_0x3f7ab6['escape_digits'],_0x3f7ab6[_0xa91f('0x7b')]);return this[_0xa91f('0x38')][_0xa91f('0x134')](_0x241226,_0x5730b0,_0x3f7ab6[_0xa91f('0x17d')],_0x3f7ab6[_0xa91f('0x7b')],undefined,!![]);};AGIVertices[_0xa91f('0x11')]['restapi']=function(_0x5151f0){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x17e'),_0x5151f0['label']));if(!this[_0xa91f('0x96')](_0x5151f0['url'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')]('no\x20url\x20configured');}var _0x1aad69=this[_0xa91f('0x79')][_0xa91f('0x86')](this,_0x5151f0);logger['info'](util[_0xa91f('0x2a')]('Response:',util[_0xa91f('0x17f')](_0x1aad69,{'showHidden':![],'depth':null})));if(!this[_0xa91f('0x96')](_0x5151f0['variable_id'])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x180'));}var _0x44be9c=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x5151f0[_0xa91f('0xe8')]);if(!_0x44be9c){return this['channel'][_0xa91f('0x2e')](_0x5151f0,_0xa91f('0xea'));}this[_0xa91f('0x38')][_0xa91f('0xb0')](util[_0xa91f('0x2a')](_0xa91f('0x181'),_0x44be9c),_0x1aad69[_0xa91f('0x8b')]?_0x1aad69[_0xa91f('0x8b')]:_0xa91f('0x182'));this[_0xa91f('0x38')][_0xa91f('0xb0')](util[_0xa91f('0x2a')]('%s_STATUS_MESSAGE',_0x44be9c),_0x1aad69[_0xa91f('0x8c')]?_0x1aad69[_0xa91f('0x8c')]:'OK');if(_0x1aad69[_0xa91f('0x89')]){try{this[_0xa91f('0xae')](_0x1aad69[_0xa91f('0x89')],_0x44be9c);}catch(_0x395c1d){logger[_0xa91f('0x2e')](util['format'](_0xa91f('0x183'),_0x44be9c));}}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xee'),_0x44be9c));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x184')]=function(_0x15e352){logger['info'](util[_0xa91f('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x15e352[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0x185')](_0x15e352[_0xa91f('0x186')]['replace'](/\s+/g,''),_0x15e352[_0xa91f('0x17d')]);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x187')]=function(_0x3feca9){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x188'),_0x3feca9[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0x189')](_0x3feca9['number'][_0xa91f('0x6e')](/\s+/g,''),_0x3feca9[_0xa91f('0x17d')]);};AGIVertices['prototype'][_0xa91f('0x18a')]=function(_0x16062f){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x18b'),_0x16062f[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0x18c')](_0x16062f['text'],_0x16062f['escape_digits']);};AGIVertices['prototype'][_0xa91f('0x18d')]=function(_0x590fd2){logger[_0xa91f('0x30')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x590fd2['label']));if(!this['isConfigured'](_0x590fd2[_0xa91f('0x18e')])){return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x18f'));}var _0xac2d35=this[_0xa91f('0x190')]['sync'](this,_0x590fd2[_0xa91f('0x18e')]);if(!_0xac2d35||!_0xac2d35['Smtp']){return this['channel']['error'](_0x590fd2,_0xa91f('0x191'));}var _0x50d1e8={'from':util[_0xa91f('0x2a')](_0xa91f('0x192'),_0xac2d35[_0xa91f('0x16')],_0xac2d35[_0xa91f('0x193')]||_0xac2d35[_0xa91f('0x194')][_0xa91f('0x195')]),'to':_0x590fd2['to']||'','cc':_0x590fd2['cc']||'','bcc':_0x590fd2[_0xa91f('0x196')]||'','subject':_0x590fd2[_0xa91f('0x197')],'html':_0x590fd2['text'],'text':_0x590fd2[_0xa91f('0x71')]};var _0x195603={'tls':{'rejectUnauthorized':![]}};if(_0xac2d35[_0xa91f('0x194')][_0xa91f('0x198')]){_0x195603[_0xa91f('0x198')]=_0xac2d35['Smtp'][_0xa91f('0x198')];}else{_0x195603[_0xa91f('0x199')]=_0xac2d35[_0xa91f('0x194')][_0xa91f('0x199')];_0x195603[_0xa91f('0x19a')]=_0xac2d35['Smtp']['port'];_0x195603[_0xa91f('0x19b')]=_0xac2d35[_0xa91f('0x194')]['secure'];}if(_0xac2d35['Smtp'][_0xa91f('0x19c')]){_0x195603['auth']={'user':_0xac2d35[_0xa91f('0x194')][_0xa91f('0x195')],'pass':_0xac2d35['Smtp'][_0xa91f('0x19d')]};}if(this[_0xa91f('0x96')](_0x590fd2['template_id'])){}logger[_0xa91f('0xef')](_0xa91f('0x19e'),JSON['stringify'](_0x50d1e8));this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x590fd2,_0x590fd2[_0xa91f('0x18e')]);this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xac2d35[_0xa91f('0x16')]));this[_0xa91f('0x24')][_0xa91f('0x86')](this,_0x195603,_0x50d1e8);return this['channel'][_0xa91f('0xb9')](_0xa91f('0x19f'));};AGIVertices['prototype'][_0xa91f('0x1a0')]=function(_0x34f521){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x1a1'),_0x34f521[_0xa91f('0xb8')]));return this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x1a2'));};AGIVertices[_0xa91f('0x11')]['sendSMS']=function(_0x22c66b){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x1a3'),_0x22c66b[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x22c66b[_0xa91f('0x1a4')])){return this[_0xa91f('0x38')]['noop']('no\x20sms\x20account\x20configured');}var _0x3fa9d1=this[_0xa91f('0x35')][_0xa91f('0x86')](this,_0x22c66b['sms_account_id']);if(!_0x3fa9d1){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x22c66b,_0xa91f('0x1a5'));}var _0x4b866c={'body':_0x22c66b[_0xa91f('0x1a6')],'phone':_0x22c66b['to']||'','SmsAccountId':_0x3fa9d1['id']};logger[_0xa91f('0xef')]('sendSMS\x20message',JSON[_0xa91f('0x88')](_0x4b866c));this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x22c66b,_0x22c66b['sms_account_id']);this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x1a7'),_0x3fa9d1[_0xa91f('0x16')]));this[_0xa91f('0x36')][_0xa91f('0x86')](this,_0x4b866c);return this[_0xa91f('0x38')]['noop'](_0xa91f('0x1a8'));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1a9')]=function(_0x434571){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x1aa'),_0x434571[_0xa91f('0xb8')]));if(!this[_0xa91f('0x96')](_0x434571[_0xa91f('0xe8')])){return this['channel']['error'](_0x434571,'no\x20variable\x20selected');}var _0x277036=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x434571[_0xa91f('0xe8')]);if(!_0x277036){return this['channel']['error'](_0x434571,_0xa91f('0xea'));}return this[_0xa91f('0x38')][_0xa91f('0xb0')](_0x277036,_0x434571[_0xa91f('0x1ab')]);};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1ac')]=function(_0x26ae17){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x1ad'),_0x26ae17[_0xa91f('0xb8')]));this[_0xa91f('0x38')][_0xa91f('0xb9')](_0xa91f('0x1ae'));if(_0x26ae17[_0xa91f('0xca')]===_0xa91f('0x1af')){this['channel']['noop'](_0xa91f('0x1b0'));return this[_0xa91f('0x38')]['answer']();}return this[_0xa91f('0x38')]['noop']('Skipped\x20Answer');};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1b1')]=function(_0x4efa10){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x1b2'),_0x4efa10[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x4efa10[_0xa91f('0x1b3')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x4efa10,_0xa91f('0x1b4'));}var _0x16ee6e=this[_0xa91f('0x18')][_0xa91f('0x86')](this,_0x4efa10[_0xa91f('0x1b3')]);if(!this['isConfigured'](_0x16ee6e)){return this[_0xa91f('0x38')]['error'](_0x4efa10,util[_0xa91f('0x2a')](_0xa91f('0x1b5'),_0x4efa10[_0xa91f('0x1b3')]));}if(_0x16ee6e===this[_0xa91f('0x38')][_0xa91f('0x3a')]){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x4efa10,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x4efa10,_0x16ee6e);var _0xafde22=this[_0xa91f('0x38')]['exec'](_0xa91f('0x1b6'),util['format'](_0xa91f('0x1b7'),config[_0xa91f('0x7')]['host']||_0xa91f('0x1b8'),_0x16ee6e,this[_0xa91f('0x38')][_0xa91f('0x3a')]));if(_0xafde22['result']===-0x1){return _0xafde22;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0xd6'),_0xa91f('0x1b6'),_0x16ee6e));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1b9')]=function(_0x1ed506){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x1ba'),_0x1ed506[_0xa91f('0xb8')]));var _0x42f0fd=this[_0xa91f('0x6b')][_0xa91f('0x86')](this,_0x1ed506[_0xa91f('0xc8')]);this[_0xa91f('0x37')][_0xa91f('0x86')](this,_0x1ed506,_0x1ed506[_0xa91f('0xc8')]);if(this[_0xa91f('0x96')](_0x1ed506[_0xa91f('0xe8')])){var _0x36bd6f=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x1ed506[_0xa91f('0xe8')]);if(_0x36bd6f){this['channel'][_0xa91f('0xb0')](_0x36bd6f,_0x42f0fd);return this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x1bb'),_0x1ed506[_0xa91f('0xc8')],_0x36bd6f));}}return this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x1bc'),_0x1ed506[_0xa91f('0xc8')]));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1bd')]=function(_0x1f48a4){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1f48a4[_0xa91f('0xb8')]));_0x1f48a4[_0xa91f('0x71')]=_0x1f48a4[_0xa91f('0x71')][_0xa91f('0x6e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa91f('0x96')](_0x1f48a4[_0xa91f('0x1be')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0x1bf'));}if(!this[_0xa91f('0x96')](_0x1f48a4['text'])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x1c0'),_0x1f48a4['text']));var _0x315a1c=this[_0xa91f('0x6f')][_0xa91f('0x86')](this,_0x1f48a4);if(_0x315a1c){this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x1c1'),_0x315a1c));var _0x596c15=this[_0xa91f('0x38')][_0xa91f('0x105')](_0x315a1c);try{fs[_0xa91f('0x107')](_0x315a1c+_0xa91f('0x108'));}catch(_0x168916){logger['error'](_0x168916);}return _0x596c15;}return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x1f48a4,_0xa91f('0x1c2'));};AGIVertices[_0xa91f('0x11')]['tts']=function(_0x26c708){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x26c708[_0xa91f('0xb8')]));_0x26c708[_0xa91f('0x71')]=_0x26c708['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa91f('0x96')](_0x26c708[_0xa91f('0x71')])){return this['channel'][_0xa91f('0xb9')](_0xa91f('0xba'));}this[_0xa91f('0x38')]['noop'](util[_0xa91f('0x2a')](_0xa91f('0x1c3'),_0x26c708[_0xa91f('0x71')]));var _0x2ed3a3=this[_0xa91f('0x78')][_0xa91f('0x86')](this,_0x26c708);if(_0x2ed3a3){this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('Google\x20TTS\x20%s\x20file\x20created',_0x2ed3a3));var _0x344306=this[_0xa91f('0x38')]['streamFile'](_0x2ed3a3);try{fs[_0xa91f('0x107')](_0x2ed3a3+_0xa91f('0x108'));}catch(_0x3fb609){logger['error'](_0x3fb609);}return _0x344306;}return this[_0xa91f('0x38')]['error'](_0x26c708,_0xa91f('0x1c4'));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1c5')]=function(_0x39d108){logger[_0xa91f('0x30')](util['format'](_0xa91f('0x1c6'),_0x39d108[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x39d108[_0xa91f('0x15b')])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x39d108,_0xa91f('0x15c'));}logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x15d'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x39d108[_0xa91f('0x15b')]));var _0x27f805=this[_0xa91f('0x66')]['sync'](this,_0x39d108[_0xa91f('0x15b')]);if(_0x27f805){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x15e'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x39d108[_0xa91f('0x15b')]));this['channel'][_0xa91f('0xb9')](util[_0xa91f('0x2a')](_0xa91f('0x15e'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x39d108['findBy']));return{'code':0xc8,'result':_0xa91f('0x15f')};}else{logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x160'),this[_0xa91f('0x38')][_0xa91f('0x3b')],_0x39d108['findBy']));this[_0xa91f('0x38')][_0xa91f('0xb9')](util[_0xa91f('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa91f('0x38')]['callerid'],_0x39d108[_0xa91f('0x15b')]));return{'code':0xc8,'result':_0xa91f('0x161')};}};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1c7')]=function(_0xa792b){logger[_0xa91f('0x30')](util[_0xa91f('0x2a')](_0xa91f('0x1c8'),_0xa792b[_0xa91f('0xb8')]));var _0x391233=this[_0xa91f('0x38')][_0xa91f('0x6c')]('VOICEMAIL',[_0xa792b[_0xa91f('0x1c9')],_0xa792b[_0xa91f('0x8e')]]);if(_0x391233[_0xa91f('0xbc')]===-0x1){return _0x391233;}return this[_0xa91f('0x38')][_0xa91f('0xb9')](util['format'](_0xa91f('0xd6'),_0xa91f('0x1ca'),_0xa792b[_0xa91f('0x1c9')]));};AGIVertices[_0xa91f('0x11')][_0xa91f('0x1cb')]=function(_0x5588a2){logger['info'](util[_0xa91f('0x2a')](_0xa91f('0x1cc'),_0x5588a2[_0xa91f('0xb8')]));if(!this['isConfigured'](_0x5588a2['variable_id'])){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x5588a2,_0xa91f('0x1cd'));}var _0x33dcfc=this[_0xa91f('0x12')][_0xa91f('0x86')](this,_0x5588a2['variable_id']);if(!_0x33dcfc){return this[_0xa91f('0x38')][_0xa91f('0x2e')](_0x5588a2,_0xa91f('0xea'));}var _0x3ab64e=this[_0xa91f('0x38')][_0xa91f('0x12')](_0x33dcfc);return{'code':0xc8,'result':_0x3ab64e[_0xa91f('0xb3')]?_0x3ab64e[_0xa91f('0xb3')]:'-'};};String[_0xa91f('0x11')]['replaceAll']=function(_0x2d6617,_0x1bbd64){return this[_0xa91f('0xb1')](_0x2d6617)[_0xa91f('0x1ce')](_0x1bbd64);};module[_0xa91f('0x1cf')]=AGIVertices; \ No newline at end of file +var _0x1678=['timezones','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','speed','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','length','saveRestApiResult','isArray','%s.%s','replaceall\x20init','split','nextbracket','replaceAll','extra','toString','replaceall\x20end','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','callback_priority','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','pass','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','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','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','googleCloudTTS','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','info','ODBC\x20connection\x20successfully','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','createSquareRecording','callerid','context','extension','priority','file','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','dialTimezone','VALUE\x20TZ','CALLERID(dialTimezone)','RES1','dialtimezone','utcOffset','minutestoadd','scheduledat\x20before','scheduledat','add','minutes','scheduledat\x20after','insertContact'];(function(_0x4257b6,_0x2348c7){var _0x4ad68c=function(_0x33a6e8){while(--_0x33a6e8){_0x4257b6['push'](_0x4257b6['shift']());}};_0x4ad68c(++_0x2348c7);}(_0x1678,0x17b));var _0x8167=function(_0x138cd8,_0x571956){_0x138cd8=_0x138cd8-0x0;var _0x17d006=_0x1678[_0x138cd8];return _0x17d006;};'use strict';var fs=require('fs');var path=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var _=require(_0x8167('0x2'));var sh=require(_0x8167('0x3'));var odbc=require(_0x8167('0x4'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x8167('0x5'));var rp=require(_0x8167('0x6'));var logger=require(_0x8167('0x7'))(_0x8167('0x8'));var config=require(_0x8167('0x9'));var shared=require(_0x8167('0xa'));var scripts=require(_0x8167('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x8167('0xc'),_0x8167('0xd')];var verticesWithRetry=[_0x8167('0xe'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x210d5c,_0x381a87,_0x59d897){this[_0x8167('0xf')]=_0x210d5c;this[_0x8167('0x10')]=_0x381a87;this[_0x8167('0x11')]=_0x59d897;};AGIVertices[_0x8167('0x12')][_0x8167('0x13')]=function(_0x2dbfd4,_0x3c21a0){this['rpc']['getVariableById'](_0x2dbfd4)[_0x8167('0x14')](function(_0x4b5b3c){_0x3c21a0(null,_0x4b5b3c?_0x4b5b3c[_0x8167('0x15')]:![]);})[_0x8167('0x16')](function(_0x57753c){_0x3c21a0(_0x57753c);});};AGIVertices[_0x8167('0x12')][_0x8167('0x17')]=function(_0x4abe96,_0x438ee8){this['rpc']['getVoiceQueueById'](_0x4abe96)['then'](function(_0x491703){_0x438ee8(null,_0x491703?_0x491703[_0x8167('0x15')]:![]);})[_0x8167('0x16')](function(_0x2aab53){_0x438ee8(_0x2aab53);});};AGIVertices[_0x8167('0x12')][_0x8167('0x18')]=function(_0x3927ad,_0x271638){this[_0x8167('0x10')][_0x8167('0x19')](_0x3927ad)[_0x8167('0x14')](function(_0x5f4569){_0x271638(null,_0x5f4569?_0x5f4569[_0x8167('0x15')]:![]);})['catch'](function(_0x2c6255){_0x271638(_0x2c6255);});};AGIVertices['prototype'][_0x8167('0x1a')]=function(_0x383763,_0x4a67d2){this[_0x8167('0x10')][_0x8167('0x1b')](_0x383763)[_0x8167('0x14')](function(_0xdec74){_0x4a67d2(null,_0xdec74?_0xdec74[_0x8167('0x1c')]:![]);})[_0x8167('0x16')](function(_0x448cf8){_0x4a67d2(_0x448cf8);});};AGIVertices[_0x8167('0x12')]['getUser']=function(_0x21ac2f,_0x51e7bc){this['rpc'][_0x8167('0x1d')](_0x21ac2f)['then'](function(_0x5024a6){_0x51e7bc(null,_0x5024a6?_0x5024a6[_0x8167('0x15')]:![]);})[_0x8167('0x16')](function(_0xbf60c3){_0x51e7bc(_0xbf60c3);});};AGIVertices['prototype'][_0x8167('0x1e')]=function(_0x4aa682,_0x44e579){this['rpc'][_0x8167('0x1f')](_0x4aa682)[_0x8167('0x14')](function(_0x330883){_0x44e579(null,_0x330883?_0x330883['name']:![]);})[_0x8167('0x16')](function(_0x1cb49c){_0x44e579(_0x1cb49c);});};AGIVertices[_0x8167('0x12')][_0x8167('0x20')]=function(_0x643d1b,_0x10fb6c){var _0x3307ed=this;this['rpc'][_0x8167('0x21')](_0x643d1b)[_0x8167('0x14')](function(_0x5519e6){_0x10fb6c(null,_0x5519e6?_0x3307ed[_0x8167('0x22')](_0x5519e6[_0x8167('0x23')]):![]);})[_0x8167('0x16')](function(_0x23650d){_0x10fb6c(_0x23650d);});};AGIVertices[_0x8167('0x12')][_0x8167('0x24')]=function(_0x1c9968,_0x587f84){this[_0x8167('0x10')][_0x8167('0x25')](_0x1c9968)['then'](function(_0x147fb2){_0x587f84(null,_0x147fb2?_0x147fb2:![]);})[_0x8167('0x16')](function(_0x286aa3){_0x587f84(_0x286aa3);});};AGIVertices[_0x8167('0x12')][_0x8167('0x26')]=function(_0x4850ad,_0x13c927,_0x536f53){this[_0x8167('0x11')][_0x8167('0x26')](_0x4850ad,_0x13c927)[_0x8167('0x14')](function(){_0x536f53(null);})[_0x8167('0x16')](function(_0x423edb){_0x536f53(_0x423edb);});};AGIVertices['prototype']['getIntervals']=function(_0x4c5475,_0x5d936b){this[_0x8167('0x10')][_0x8167('0x27')](_0x4c5475)[_0x8167('0x14')](function(_0x26b22d){if(_0x26b22d){if(_0x26b22d[_0x8167('0x28')]){_0x5d936b(null,[_0x26b22d[_0x8167('0x29')]]);}else{_0x5d936b(null,_['map'](_0x26b22d[_0x8167('0x2a')],'interval'));}}else{_0x5d936b(null,![]);}})[_0x8167('0x16')](function(_0x43e21f){_0x5d936b(_0x43e21f);});};AGIVertices['prototype']['getSoundPath']=function(_0x105e1b){return util[_0x8167('0x2b')](_0x8167('0x2c'),FILES_PATH,_0x105e1b);};AGIVertices[_0x8167('0x12')][_0x8167('0x2d')]=function(_0x5df1d4,_0x4a6665,_0x69742f){odbc['open'](_0x5df1d4,function(_0x10d17b){if(_0x10d17b){logger[_0x8167('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x10d17b);_0x69742f(_0x10d17b);}else{logger[_0x8167('0x2f')](_0x8167('0x30'));odbc[_0x8167('0x31')](_0x4a6665,function(_0x3fe248,_0x445c4d){if(_0x3fe248){logger[_0x8167('0x2f')](_0x8167('0x32'),_0x4a6665);_0x69742f(_0x3fe248);}else{logger[_0x8167('0x2f')](_0x8167('0x33'),_0x4a6665);odbc[_0x8167('0x34')](function(_0x1f5a30){if(_0x1f5a30){logger[_0x8167('0x2e')](_0x8167('0x35'),_0x1f5a30);}_0x69742f(null,_0x445c4d);});}});}});};AGIVertices[_0x8167('0x12')][_0x8167('0x36')]=function(_0x59a194,_0x146ea8){this['rpc'][_0x8167('0x37')](_0x59a194)['then'](function(_0x8de8ab){_0x146ea8(null,_0x8de8ab?_0x8de8ab:![]);})[_0x8167('0x16')](function(_0x5b6d09){_0x146ea8(_0x5b6d09);});};AGIVertices[_0x8167('0x12')]['createSmsMessage']=function(_0x5ed948,_0x40982e){this['rpc'][_0x8167('0x38')](_0x5ed948)['then'](function(_0x3ed87e){_0x40982e(null,_0x3ed87e);})[_0x8167('0x16')](function(_0x5eb774){_0x40982e(_0x5eb774);});};AGIVertices[_0x8167('0x12')][_0x8167('0x39')]=function(_0x2526a4,_0xd321bd,_0x296bcc){this[_0x8167('0x10')][_0x8167('0x39')]({'uniqueid':this[_0x8167('0xf')][_0x8167('0x3a')],'node':_0x2526a4[_0x8167('0x3b')],'application':_0x2526a4[_0x8167('0x3c')],'data':_0xd321bd||null,'project_name':this[_0x8167('0xf')][_0x8167('0x3d')],'callerid':this[_0x8167('0xf')]['callerid']})[_0x8167('0x14')](function(_0x1afcf5){if(_0x296bcc){_0x296bcc(null,_0x1afcf5);}})[_0x8167('0x16')](function(_0x5638c4){if(_0x296bcc){_0x296bcc(_0x5638c4);}});};AGIVertices[_0x8167('0x12')][_0x8167('0x3e')]=function(_0x18371b,_0x444eed,_0x46dec5,_0x214aa1){this[_0x8167('0x10')][_0x8167('0x3e')]({'uniqueid':this[_0x8167('0xf')][_0x8167('0x3a')],'callerid':this[_0x8167('0xf')][_0x8167('0x3f')],'calleridname':this[_0x8167('0xf')]['calleridname'],'context':this[_0x8167('0xf')][_0x8167('0x40')],'extension':this[_0x8167('0xf')][_0x8167('0x41')],'priority':this[_0x8167('0xf')][_0x8167('0x42')],'accountcode':this[_0x8167('0xf')]['accountcode'],'dnid':this[_0x8167('0xf')]['dnid'],'projectName':this[_0x8167('0xf')][_0x8167('0x3d')],'saveName':_0x444eed,'filename':_0x18371b[_0x8167('0x43')]||_0x444eed,'savePath':_0x46dec5})[_0x8167('0x14')](function(_0x46e666){_0x214aa1(null,_0x46e666);})['catch'](function(_0x374e43){_0x214aa1(_0x374e43);});};AGIVertices[_0x8167('0x12')][_0x8167('0x44')]=function(_0x96305,_0x28b70c,_0x50783b){this[_0x8167('0x10')][_0x8167('0x44')]({'uniqueid':this[_0x8167('0xf')][_0x8167('0x3a')],'body':_0x96305,'direction':_0x28b70c})[_0x8167('0x14')](function(_0x1227cd){if(_0x50783b){_0x50783b(null,_0x1227cd);}})[_0x8167('0x16')](function(_0x2bc3af){if(_0x50783b){_0x50783b(_0x2bc3af);}});};AGIVertices[_0x8167('0x12')][_0x8167('0x45')]=function(_0x2a38ef,_0x5b9f7d){console[_0x8167('0x46')](_0x8167('0x47'),_0x2a38ef);console[_0x8167('0x46')](_0x8167('0x48'),_0x5b9f7d);var _0x57126b=this;var _0x472cb2=0x0;var _0x2230b9={'firstName':_[_0x8167('0x49')](_0x2a38ef[_0x8167('0x15')])||_[_0x8167('0x4a')](_0x2a38ef[_0x8167('0x15')])?_0x8167('0x4b')+Math[_0x8167('0x4c')]():_0x2a38ef[_0x8167('0x15')],'lastName':_['isEmpty'](_0x2a38ef[_0x8167('0x4d')])||_['isNil'](_0x2a38ef[_0x8167('0x4d')])?null:_0x2a38ef[_0x8167('0x4d')],'phone':_0x2a38ef[_0x8167('0x4e')],'ListId':_0x2a38ef[_0x8167('0x4f')],'scheduledat':_0x2a38ef[_0x8167('0x50')],'callbackUniqueid':this[_0x8167('0xf')]['uniqueid'],'tags':_0x8167('0x51'),'description':'Callback\x20scheduled\x20at\x20'+_0x2a38ef[_0x8167('0x50')]['toString'](),'priority':_0x2a38ef['callback_priority']};if(_['has'](_0x2a38ef,_0x8167('0x52'))){if(!_['isNil'](_0x2a38ef[_0x8167('0x52')])){var _0x160460=_0x2a38ef['dialTimezone'];console[_0x8167('0x46')](_0x8167('0x53'),_0x160460);if(_0x2a38ef[_0x8167('0x52')]==_0x8167('0x54')){this[_0x8167('0x10')]['getContactByPhone']({'phone':_0x2a38ef['phone']})[_0x8167('0x14')](function(_0x59c776){console['log'](_0x8167('0x55'),_0x59c776);var _0x1efa3d=_0x59c776[_0x8167('0x52')];console[_0x8167('0x46')](_0x8167('0x56'),_0x1efa3d);if(!_[_0x8167('0x4a')](_0x1efa3d)){var _0x2087a4=shared['timezones'][_0x1efa3d];console['log']('tz',_0x2087a4);if(!_[_0x8167('0x4a')](_0x2087a4)){var _0x3c43a7=_0x2087a4[_0x8167('0x57')];console['log'](_0x8167('0x58'),_0x3c43a7);console[_0x8167('0x46')](_0x8167('0x59'),_0x2230b9[_0x8167('0x5a')]);_0x2230b9[_0x8167('0x5a')]=moment(_0x2a38ef[_0x8167('0x5a')])[_0x8167('0x5b')](_0x3c43a7,_0x8167('0x5c'));console[_0x8167('0x46')](_0x8167('0x5d'),_0x2230b9[_0x8167('0x5a')]);_0x57126b[_0x8167('0x10')][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x13338c){_0x5b9f7d(null,_0x13338c);})['catch'](function(_0x3e2f68){_0x5b9f7d(_0x3e2f68);});}else{_0x57126b[_0x8167('0x10')]['insertContact'](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x1c59d0){_0x5b9f7d(null,_0x1c59d0);})['catch'](function(_0xfaf8d1){_0x5b9f7d(_0xfaf8d1);});}}else{_0x57126b['rpc'][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x37b641){_0x5b9f7d(null,_0x37b641);})[_0x8167('0x16')](function(_0x16e5bc){_0x5b9f7d(_0x16e5bc);});}});}else{var _0x472cb2=shared[_0x8167('0x5f')][_0x160460];if(!_[_0x8167('0x4a')](_0x472cb2)){var _0x2e4e07=-0x1*_0x472cb2[_0x8167('0x57')];_0x2230b9[_0x8167('0x5a')]=moment(_0x2a38ef['scheduledat'])[_0x8167('0x5b')](_0x2e4e07,_0x8167('0x5c'));_0x57126b[_0x8167('0x10')][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x3eb887){_0x5b9f7d(null,_0x3eb887);})[_0x8167('0x16')](function(_0x3b6cdd){_0x5b9f7d(_0x3b6cdd);});}else{_0x57126b['rpc'][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x50c706){_0x5b9f7d(null,_0x50c706);})[_0x8167('0x16')](function(_0x3e48fa){_0x5b9f7d(_0x3e48fa);});}}}else{_0x57126b[_0x8167('0x10')][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x54ec97){_0x5b9f7d(null,_0x54ec97);})[_0x8167('0x16')](function(_0x2d9324){_0x5b9f7d(_0x2d9324);});}}else{_0x57126b['rpc'][_0x8167('0x5e')](_0x2230b9,_0x2a38ef,_0x5b9f7d)[_0x8167('0x14')](function(_0x4f944f){_0x5b9f7d(null,_0x4f944f);})[_0x8167('0x16')](function(_0x18a1b2){_0x5b9f7d(_0x18a1b2);});}};AGIVertices[_0x8167('0x12')][_0x8167('0x5e')]=function(_0x412cfe,_0x146a7b,_0x49de94){this[_0x8167('0x10')][_0x8167('0x45')](_0x412cfe)[_0x8167('0x14')](function(_0x26d141){_0x49de94(null,_0x26d141);})['catch'](function(_0x2935fe){_0x49de94(_0x2935fe);});};AGIVertices[_0x8167('0x12')][_0x8167('0x60')]=function(_0x4e1281,_0x16efb4){this[_0x8167('0x10')]['getPauseById'](_0x4e1281)[_0x8167('0x14')](function(_0x28beb1){_0x16efb4(null,_0x28beb1?_0x28beb1['name']:![]);})[_0x8167('0x16')](function(_0x63bd63){_0x16efb4(_0x63bd63);});};AGIVertices['prototype'][_0x8167('0x61')]=function(_0x205f4a,_0x12a83b,_0x37fb6e){var _0x12c2a7={'role':'agent'};_0x12c2a7[_0x205f4a]=this[_0x8167('0xf')]['callerid'];this[_0x8167('0x10')][_0x8167('0x61')](_0x12c2a7,_0x12a83b,this['channel'][_0x8167('0x3a')])[_0x8167('0x14')](function(_0x21c69b){_0x37fb6e(null,_[_0x8167('0x4a')](_0x21c69b)?![]:!![]);})[_0x8167('0x16')](function(_0xfc95fb){logger['error'](_0xfc95fb);_0x37fb6e(null,![]);});};AGIVertices[_0x8167('0x12')][_0x8167('0x62')]=function(_0x3b0456,_0x46accf){var _0x355661={'role':_0x8167('0x63')};_0x355661[_0x3b0456]=this[_0x8167('0xf')][_0x8167('0x3f')];this[_0x8167('0x10')][_0x8167('0x62')](_0x355661)[_0x8167('0x14')](function(_0x2feae6){_0x46accf(null,_[_0x8167('0x4a')](_0x2feae6)?![]:!![]);})[_0x8167('0x16')](function(_0x19e22d){logger[_0x8167('0x2e')](_0x19e22d);_0x46accf(null,![]);});};AGIVertices[_0x8167('0x12')][_0x8167('0x64')]=function(_0x393907,_0x3b2a03){var _0x30ba80={'role':'agent'};_0x30ba80[_0x393907]=this[_0x8167('0xf')][_0x8167('0x3f')];this[_0x8167('0x10')][_0x8167('0x64')](_0x30ba80)['then'](function(_0x15e7c6){_0x3b2a03(null,_[_0x8167('0x4a')](_0x15e7c6)?![]:!![]);})[_0x8167('0x16')](function(_0x498f33){logger[_0x8167('0x2e')](_0x498f33);_0x3b2a03(null,![]);});};AGIVertices[_0x8167('0x12')][_0x8167('0x65')]=function(_0x4544b3,_0x4d5075){var _0x4a5897={'role':_0x8167('0x63')};_0x4a5897[_0x4544b3]=this[_0x8167('0xf')]['callerid'];var _0xc35e78=_0x4544b3!=_0x8167('0x66')?util['format'](_0x8167('0x67'),_0x8167('0x68'),this[_0x8167('0xf')][_0x8167('0x3f')]):undefined;this[_0x8167('0x10')][_0x8167('0x65')](_0x4a5897,_0xc35e78)[_0x8167('0x14')](function(_0x1f5db4){_0x4d5075(null,_[_0x8167('0x4a')](_0x1f5db4)?![]:!![]);})[_0x8167('0x16')](function(_0x4097f4){logger[_0x8167('0x2e')](_0x4097f4);_0x4d5075(null,![]);});};AGIVertices[_0x8167('0x12')][_0x8167('0x69')]=function(_0x14a601,_0x517ed7){sh[_0x8167('0x6a')](_[_0x8167('0x6b')](_0x14a601),function(_0x371a46,_0x2b592c){var _0x5dd04c=_0x2b592c[_0x8167('0x6c')](/(\r\n|\n|\r)/gm,'');_0x517ed7(null,_0x5dd04c);});};AGIVertices[_0x8167('0x12')]['googleCloudTTS']=function(_0x25432d,_0x7d44fa){scripts['googleCloudTTS'](_0x25432d[_0x8167('0x6d')],_0x25432d[_0x8167('0x6e')]||_0x8167('0x6f'),_0x25432d[_0x8167('0x6f')],_0x25432d[_0x8167('0x70')]||_0x8167('0x71'),_0x25432d[_0x8167('0x72')]||_0x8167('0x73'),_0x25432d[_0x8167('0x74')]||_0x8167('0x75'))[_0x8167('0x14')](function(_0xb6017e){_0x7d44fa(null,_0xb6017e);})['catch'](function(_0x1c93ce){_0x7d44fa(_0x1c93ce);});};AGIVertices['prototype'][_0x8167('0x76')]=function(_0x5126dc,_0x213ad3){scripts[_0x8167('0x76')](_0x5126dc[_0x8167('0x6f')],_0x5126dc[_0x8167('0x77')]||'en',0x1)['then'](function(_0x471a96){_0x213ad3(null,_0x471a96);})['catch'](function(_0x44f6f9){_0x213ad3(_0x44f6f9);});};AGIVertices[_0x8167('0x12')][_0x8167('0x78')]=function(_0x5d98cb,_0x279c51){var _0x54fc0e={'uri':_0x5d98cb['url'],'method':_0x5d98cb[_0x8167('0x79')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5d98cb[_0x8167('0x7a')])===_0x8167('0x7b')&&parseInt(_0x5d98cb[_0x8167('0x7a')])>=0x1?parseInt(_0x5d98cb[_0x8167('0x7a')])*0x3e8:0x5*0x3e8};if(_[_0x8167('0x7c')](['POST',_0x8167('0x7d')],_0x54fc0e['method'][_0x8167('0x7e')]())){try{_0x54fc0e[_0x8167('0x7f')]=_0x5d98cb[_0x8167('0xd')]?JSON[_0x8167('0x80')](_0x5d98cb[_0x8167('0xd')]):{};}catch(_0x105a0c){logger[_0x8167('0x2e')](_0x8167('0x81'),_0x105a0c);}}try{_0x54fc0e[_0x8167('0x82')]=_0x5d98cb['rawHeaders']?JSON['parse'](_0x5d98cb[_0x8167('0xc')]):{};}catch(_0x140456){logger[_0x8167('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x140456);}if(_0x5d98cb[_0x8167('0x83')]){try{var _0x6deb0=require(_0x5d98cb[_0x8167('0x83')])[_0x8167('0x84')](this,_0x54fc0e);_0x54fc0e[_0x8167('0x85')]=Mustache[_0x8167('0x86')](_0x5d98cb[_0x8167('0x87')],_0x6deb0,{},['$$','$$']);if(_0x54fc0e[_0x8167('0x82')]){_0x54fc0e['headers']=JSON[_0x8167('0x80')](Mustache['render'](JSON[_0x8167('0x88')](_0x54fc0e[_0x8167('0x82')]),_0x6deb0,{},['$$','$$']));}if(_0x54fc0e['body']){_0x54fc0e['body']=JSON['parse'](Mustache[_0x8167('0x86')](JSON[_0x8167('0x88')](_0x54fc0e[_0x8167('0x7f')]),_0x6deb0,{},['$$','$$']));}}catch(_0x253130){logger[_0x8167('0x2e')](_0x8167('0x89'),_0x253130);}}rp(_0x54fc0e)[_0x8167('0x14')](function(_0x28a945){var _0x5e6229={'statusCode':_0x28a945[_0x8167('0x8a')]||0xc8,'statusMessage':_0x28a945[_0x8167('0x8b')]||'OK','headers':_0x28a945[_0x8167('0x82')]||{},'body':_0x28a945[_0x8167('0x7f')]||{}};_0x279c51(null,_0x5e6229);})[_0x8167('0x16')](function(_0x37573d){var _0x57fbda={'statusCode':_0x37573d[_0x8167('0x8a')]||0x1f4,'statusMessage':_0x37573d[_0x8167('0x8c')]||_0x8167('0x8d'),'headers':_0x37573d[_0x8167('0x8e')][_0x8167('0x82')]||{},'body':_0x37573d[_0x8167('0x8e')][_0x8167('0x7f')]||{}};_0x279c51(null,_0x57fbda);});};AGIVertices['prototype'][_0x8167('0x8f')]=function(_0x267b39,_0x395948){scripts[_0x8167('0x8f')](this['channel'][_0x8167('0x3a')],_0x267b39[_0x8167('0x90')],_0x267b39['text'],_0x267b39[_0x8167('0x91')]||'en')[_0x8167('0x14')](function(_0x440e45){_0x395948(null,_0x440e45);})[_0x8167('0x16')](function(_0x1d797c){_0x395948(_0x1d797c);});};AGIVertices[_0x8167('0x12')][_0x8167('0x92')]=function(_0x3fb461,_0xe2b139){scripts[_0x8167('0x92')](this['channel'],_0x3fb461)[_0x8167('0x14')](function(_0x206c9a){_0xe2b139(null,_0x206c9a);})['catch'](function(_0x36526f){_0xe2b139(_0x36526f);});};AGIVertices['prototype']['ispeechTTS']=function(_0x44b310,_0x366bf6){scripts[_0x8167('0x93')](_0x44b310[_0x8167('0x90')],_0x44b310[_0x8167('0x6f')],_0x44b310['ispeech_tts_language']||_0x8167('0x71'),_0x44b310[_0x8167('0x94')])[_0x8167('0x14')](function(_0x3cc953){_0x366bf6(null,_0x3cc953);})['catch'](function(_0x3cc6c3){_0x366bf6(_0x3cc6c3);});};AGIVertices[_0x8167('0x12')]['ispeechASR']=function(_0x4367f2,_0x5021f2,_0x22e342){scripts['ispeechASR'](_0x5021f2,_0x4367f2[_0x8167('0x90')],_0x4367f2['ispeech_asr_language']||_0x8167('0x71'),this['isConfigured'](_0x4367f2[_0x8167('0x95')])?_0x4367f2['model']:undefined)['then'](function(_0x229ff1){_0x22e342(null,_0x229ff1);})[_0x8167('0x16')](function(_0x40bcf6){_0x22e342(_0x40bcf6);});};AGIVertices['prototype'][_0x8167('0x96')]=function(_0x2c7050,_0x25858e){scripts['awsPolly'](_0x2c7050['aws_access_key_id'],_0x2c7050[_0x8167('0x97')],_0x2c7050[_0x8167('0x98')],_0x2c7050[_0x8167('0x99')]||'Amy',_0x2c7050[_0x8167('0x6f')],_0x2c7050[_0x8167('0x9a')]||'text')[_0x8167('0x14')](function(_0x57387f){_0x25858e(null,_0x57387f);})[_0x8167('0x16')](function(_0x4196ba){_0x25858e(_0x4196ba);});};AGIVertices[_0x8167('0x12')]['awsLex']=function(_0x4ff56e,_0x5ca783){scripts['awsLex'](this['channel'][_0x8167('0x3a')],_0x4ff56e['aws_access_key_id'],_0x4ff56e[_0x8167('0x97')],_0x4ff56e[_0x8167('0x9b')],_0x4ff56e[_0x8167('0x6f')],_0x4ff56e[_0x8167('0x9c')])[_0x8167('0x14')](function(_0x164de7){_0x5ca783(null,_0x164de7);})['catch'](function(_0x3d3e2b){_0x5ca783(_0x3d3e2b);});};AGIVertices['prototype'][_0x8167('0x9d')]=function(_0x3f9bd2,_0x46751a,_0x514ea9){scripts['googleASR'](_0x46751a,_0x3f9bd2[_0x8167('0x90')],_0x3f9bd2[_0x8167('0x9e')]||_0x8167('0x71'))[_0x8167('0x14')](function(_0x503e3b){_0x514ea9(null,_0x503e3b);})['catch'](function(_0x5ae74b){_0x514ea9(_0x5ae74b);});};AGIVertices[_0x8167('0x12')][_0x8167('0x9f')]=function(_0x888250,_0x568b4b,_0x520eb4){scripts['tildeASR'](_0x568b4b,_0x888250[_0x8167('0xa0')],_0x888250[_0x8167('0xa1')],_0x888250['uri'])[_0x8167('0x14')](function(_0x319807){_0x520eb4(null,_0x319807);})[_0x8167('0x16')](function(_0x5d2f37){_0x520eb4(_0x5d2f37);});};AGIVertices[_0x8167('0x12')][_0x8167('0xa2')]=function(_0xb84a9d){var _0x3f858f=_[_0x8167('0x7c')](verticesWithRetry,_0xb84a9d[_0x8167('0x3c')])?_0xb84a9d:_['clone'](_0xb84a9d);for(var _0x154f71 in _0x3f858f){if(_0x3f858f[_0x8167('0xa3')](_0x154f71)){if(_0x3f858f[_0x154f71]&&_[_0x8167('0xa4')](_0x3f858f[_0x154f71])){if(_['includes'](recursiveMapAttributes,_0x154f71)){_0x3f858f[_0x154f71]=this[_0x8167('0xa5')](_0x3f858f[_0x154f71]);}else{_0x3f858f[_0x154f71]=this[_0x8167('0xa6')](_0x3f858f[_0x154f71]);}}}}return _0x3f858f;};AGIVertices[_0x8167('0x12')]['recursiveNodeIndex']=function(_0x1a482c){for(var _0x242971 in _0x1a482c){if(_0x1a482c[_0x8167('0xa3')](_0x242971)){if(_['isPlainObject'](_0x1a482c[_0x242971])){this[_0x8167('0xa7')](_0x1a482c[_0x242971]);}else if(_['isArray'](_0x1a482c[_0x242971])){for(var _0xed2762=0x0;_0xed2762<_0x1a482c[_0x242971][_0x8167('0xa8')];_0xed2762++){this[_0x8167('0xa7')](_0x1a482c[_0x242971][_0xed2762]);}}else if(_[_0x8167('0xa4')](_0x1a482c[_0x242971])){_0x1a482c[_0x242971]=this['replaceAllVariables'](_0x1a482c[_0x242971]);}}}};AGIVertices[_0x8167('0x12')][_0x8167('0xa9')]=function(_0x171c5c,_0x329d4c){for(var _0x153461 in _0x171c5c){if(_0x171c5c[_0x8167('0xa3')](_0x153461)){if(_['isPlainObject'](_0x171c5c[_0x153461])){if(!_[_0x8167('0x49')](_0x171c5c[_0x153461])){this[_0x8167('0xa9')](_0x171c5c[_0x153461],util[_0x8167('0x2b')]('%s.%s',_0x329d4c,_0x153461));}}else if(_[_0x8167('0xaa')](_0x171c5c[_0x153461])){for(var _0x2ddffd=0x0;_0x2ddffd<_0x171c5c[_0x153461]['length'];_0x2ddffd++){this[_0x8167('0xa9')](_0x171c5c[_0x153461][_0x2ddffd],util[_0x8167('0x2b')](_0x8167('0xab'),_0x329d4c,_0x153461+'['+_0x2ddffd+']'));}}else{if(!_[_0x8167('0x4a')](_0x171c5c[_0x153461])){this[_0x8167('0xf')]['setVariable'](util['format'](_0x8167('0xab'),_0x329d4c,_0x153461),_0x171c5c[_0x153461]);}}}}};AGIVertices['prototype'][_0x8167('0xa5')]=function(_0x2abe55){try{var _0x2fd89f=JSON[_0x8167('0x80')](_0x2abe55);this[_0x8167('0xa7')](_0x2fd89f);return JSON[_0x8167('0x88')](_0x2fd89f);}catch(_0x2cdfcf){return this[_0x8167('0xa6')](_0x2abe55);}};AGIVertices[_0x8167('0x12')][_0x8167('0xa6')]=function(_0x454c16){console[_0x8167('0x46')](_0x8167('0xac'),_0x454c16);var _0x6b1791=_0x454c16[_0x8167('0xad')]('{');for(var _0x13b816=0x1;_0x13b816<_0x6b1791['length'];_0x13b816+=0x1){var _0x12971e=_0x6b1791[_0x13b816][_0x8167('0xad')]('}');console[_0x8167('0x46')](_0x8167('0xae'),_0x12971e);if(_0x12971e[_0x8167('0xa8')]>0x1){_0x454c16=_0x454c16[_0x8167('0xaf')]('{'+_0x12971e[0x0]+'}',this[_0x8167('0xf')][_0x8167('0x13')](_0x12971e[0x0])[_0x8167('0xb0')]||_0x12971e[0x0]);}}if(_0x6b1791[_0x8167('0xa8')]===0x1){return _0x454c16[_0x8167('0xb1')]();}console['log'](_0x8167('0xb2'),_0x454c16);return this[_0x8167('0xa6')](_0x454c16);};AGIVertices[_0x8167('0x12')][_0x8167('0xb3')]=function(_0x374ced,_0x532c1e){var _0x29974a=this['channel']['getVariable'](_0x374ced);if(_0x29974a['result']===-0x1){return _0x29974a;}logger[_0x8167('0x2f')](util['format'](_0x8167('0xb4'),_0x532c1e,_0x29974a[_0x8167('0xb0')]));return this['channel']['setVariable'](_0x532c1e,_0x29974a[_0x8167('0xb0')]);};AGIVertices[_0x8167('0x12')][_0x8167('0xb5')]=function(_0x2b6a72){return _0x2b6a72&&_0x2b6a72!=='0'&&_0x2b6a72!=='-1'&&_0x2b6a72!=='';};AGIVertices['prototype'][_0x8167('0xb6')]=function(_0x5d942c){this[_0x8167('0x39')][_0x8167('0x84')](this,_0x5d942c,'-');_0x5d942c['retry']=_0x5d942c[_0x8167('0xb6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8167('0x12')]['mrcpsynth']=function(_0x321c04){logger['info'](util[_0x8167('0x2b')](_0x8167('0xb7'),_0x321c04['label']));if(!this[_0x8167('0xb5')](_0x321c04[_0x8167('0x6f')])){return this[_0x8167('0xf')]['noop'](_0x8167('0xb8'));}var _0x3c8952='\x22'+_0x321c04[_0x8167('0x6f')]+'\x22';if(this[_0x8167('0xb5')](_0x321c04[_0x8167('0x8e')])){_0x3c8952+=','+_0x321c04['options'];}var _0x2250d3=this[_0x8167('0xf')][_0x8167('0x6a')](_0x8167('0xb9'),_0x3c8952);if(_0x2250d3[_0x8167('0xba')]===-0x1){return _0x2250d3;}return this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')](_0x8167('0xbb'),_0x3c8952));};AGIVertices[_0x8167('0x12')][_0x8167('0xbc')]=function(_0x106cc1){logger['info'](util[_0x8167('0x2b')](_0x8167('0xbd'),_0x106cc1[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x106cc1[_0x8167('0xbe')])){return this['channel'][_0x8167('0xbf')](_0x8167('0xc0'));}var _0x2706f8=_0x106cc1[_0x8167('0xbe')];if(this[_0x8167('0xb5')](_0x106cc1[_0x8167('0x8e')])){_0x2706f8+=','+_0x106cc1['options'];}var _0x3dd9d9=this['channel'][_0x8167('0x6a')](_0x8167('0xc1'),_0x2706f8);if(_0x3dd9d9[_0x8167('0xba')]===-0x1){return _0x3dd9d9;}var _0x4f1de0=this['getAndSetVariable'](_0x8167('0xc2'),_0x8167('0xc3'));if(_0x4f1de0[_0x8167('0xba')]===-0x1){return _0x4f1de0;}var _0x2c73f3=this['getAndSetVariable'](_0x8167('0xc4'),'MRCP_RECOG_TRANSCRIPT');if(_0x2c73f3[_0x8167('0xba')]===-0x1){return _0x2c73f3;}var _0x3806af=this[_0x8167('0xb3')]('RECOG_INSTANCE()',_0x8167('0xc5'));if(_0x3806af[_0x8167('0xba')]===-0x1){return _0x3806af;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xc6'),_0x2706f8));};AGIVertices[_0x8167('0x12')]['agi']=function(_0x29fea7){logger[_0x8167('0x2f')](util[_0x8167('0x2b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x29fea7[_0x8167('0x3b')]));return this[_0x8167('0xf')][_0x8167('0x8')]([_0x29fea7[_0x8167('0xc7')],_0x29fea7[_0x8167('0xc8')]]);};AGIVertices['prototype'][_0x8167('0xc9')]=function(_0x5ee4ee){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xca'),_0x5ee4ee['label']));if(this[_0x8167('0xb5')](_0x5ee4ee['timeout'])){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xcb'),_0x5ee4ee[_0x8167('0x7a')]));var _0x21d86c=this['channel'][_0x8167('0xcc')](_0x5ee4ee['timeout']);if(_0x21d86c['result']===-0x1){return _0x21d86c;}}return this[_0x8167('0xf')]['answer']();};AGIVertices[_0x8167('0x12')]['callback']=function(_0x6303e4){console['log']('enter\x20in\x20callbackblock',_0x6303e4);logger['info'](util[_0x8167('0x2b')](_0x8167('0xcd'),_0x6303e4[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x6303e4[_0x8167('0x4f')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x6303e4,_0x8167('0xce'));}_0x6303e4[_0x8167('0x50')]=moment();if(this[_0x8167('0xb5')](_0x6303e4[_0x8167('0xcf')])){_0x6303e4[_0x8167('0x50')]=moment()[_0x8167('0x5b')](_0x6303e4[_0x8167('0xcf')],_0x8167('0x5c'));}if(!this[_0x8167('0xb5')](_0x6303e4[_0x8167('0xd0')])){_0x6303e4['callback_priority']=0x2;}console[_0x8167('0x46')](_0x8167('0xd1'),_0x6303e4);this[_0x8167('0x45')]['sync'](this,_0x6303e4);return this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xd2'),_0x6303e4[_0x8167('0x4e')],_0x6303e4[_0x8167('0x4f')],_0x6303e4[_0x8167('0x50')]));};AGIVertices[_0x8167('0x12')][_0x8167('0xd3')]=function(_0x38ff65){logger[_0x8167('0x2f')](util[_0x8167('0x2b')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x38ff65[_0x8167('0x3b')]));var _0x4bffd5=this[_0x8167('0xf')][_0x8167('0x6a')](_0x38ff65[_0x8167('0xd4')],_0x38ff65[_0x8167('0x8e')]);if(_0x4bffd5[_0x8167('0xba')]===-0x1){return _0x4bffd5;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xd5'),_0x38ff65['application'],_0x38ff65[_0x8167('0x8e')]));};AGIVertices['prototype'][_0x8167('0xd6')]=function(_0x16bd3f){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xd7'),_0x16bd3f[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x16bd3f['text'])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xb8'));}var _0x13f5b5='\x22'+_0x16bd3f[_0x8167('0x6f')]+'\x22';if(this['isConfigured'](_0x16bd3f['options'])){_0x13f5b5+=','+_0x16bd3f[_0x8167('0x8e')];}var _0x56e32f=this[_0x8167('0xf')][_0x8167('0x6a')]('MRCPSynth',_0x13f5b5);if(_0x56e32f[_0x8167('0xba')]===-0x1){return _0x56e32f;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xbb'),_0x13f5b5));};AGIVertices[_0x8167('0x12')][_0x8167('0xd8')]=function(_0x194625){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xd9'),_0x194625[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x194625[_0x8167('0x6f')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xb8'));}var _0x32570e='\x22'+_0x194625[_0x8167('0x6f')]+'\x22';if(this[_0x8167('0xb5')](_0x194625[_0x8167('0x8e')])){_0x32570e+=','+_0x194625['options'];}var _0x2a2c0a=this[_0x8167('0xf')][_0x8167('0x6a')](_0x8167('0xb9'),_0x32570e);if(_0x2a2c0a[_0x8167('0xba')]===-0x1){return _0x2a2c0a;}return this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x32570e));};AGIVertices[_0x8167('0x12')][_0x8167('0xda')]=function(_0x19f2b1){logger['info'](util[_0x8167('0x2b')](_0x8167('0xdb'),_0x19f2b1['label']));if(!this[_0x8167('0xb5')](_0x19f2b1[_0x8167('0xbe')])){return this['channel'][_0x8167('0xbf')](_0x8167('0xc0'));}var _0x34130a=_0x19f2b1[_0x8167('0xbe')];if(this[_0x8167('0xb5')](_0x19f2b1[_0x8167('0x8e')])){_0x34130a+=','+_0x19f2b1[_0x8167('0x8e')];}var _0x3e4b19=this[_0x8167('0xf')][_0x8167('0x6a')]('MRCPRecog',_0x34130a);if(_0x3e4b19[_0x8167('0xba')]===-0x1){return _0x3e4b19;}var _0x505478=this['getAndSetVariable'](_0x8167('0xc2'),_0x8167('0xdc'));if(_0x505478[_0x8167('0xba')]===-0x1){return _0x505478;}var _0x1bd09c=this[_0x8167('0xb3')]('RECOG_INPUT()',_0x8167('0xdd'));if(_0x1bd09c[_0x8167('0xba')]===-0x1){return _0x1bd09c;}var _0x3a57b7=this[_0x8167('0xb3')](_0x8167('0xde'),_0x8167('0xdf'));if(_0x3a57b7[_0x8167('0xba')]===-0x1){return _0x3a57b7;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xc6'),_0x34130a));};AGIVertices[_0x8167('0x12')][_0x8167('0xe0')]=function(_0x175052){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xe1'),_0x175052[_0x8167('0x3b')]));if(!this['isConfigured'](_0x175052['grammar'])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xc0'));}var _0x1dd1f0=_0x175052['grammar'];if(this[_0x8167('0xb5')](_0x175052[_0x8167('0x8e')])){_0x1dd1f0+=','+_0x175052['options'];}var _0x47f952=this[_0x8167('0xf')][_0x8167('0x6a')]('MRCPRecog',_0x1dd1f0);if(_0x47f952[_0x8167('0xba')]===-0x1){return _0x47f952;}var _0x227156=this[_0x8167('0xb3')](_0x8167('0xc2'),'SESTEK_ASR_CONFIDENCE');if(_0x227156['result']===-0x1){return _0x227156;}var _0x743b1c=this[_0x8167('0xb3')](_0x8167('0xc4'),_0x8167('0xe2'));if(_0x743b1c[_0x8167('0xba')]===-0x1){return _0x743b1c;}var _0x359438=this[_0x8167('0xb3')](_0x8167('0xde'),_0x8167('0xe3'));if(_0x359438[_0x8167('0xba')]===-0x1){return _0x359438;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0xc6'),_0x1dd1f0));};AGIVertices[_0x8167('0x12')][_0x8167('0xe4')]=function(_0x4c02fa){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xe5'),_0x4c02fa[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x4c02fa[_0x8167('0xe6')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4c02fa,_0x8167('0xe7'));}var _0x446c63=this[_0x8167('0x1a')][_0x8167('0x84')](this,_0x4c02fa[_0x8167('0xe6')]);if(!_0x446c63){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4c02fa,_0x8167('0xe8'));}if(!this[_0x8167('0xb5')](_0x4c02fa['query'])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4c02fa,_0x8167('0xe9'));}var _0x189a61=_0x4c02fa[_0x8167('0x31')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x8167('0xea'),_0x189a61));var _0x303420=this[_0x8167('0x2d')][_0x8167('0x84')](this,_0x446c63,_0x189a61);this[_0x8167('0x39')]['sync'](this,_0x4c02fa,_0x189a61);if(!this['isConfigured'](_0x4c02fa[_0x8167('0xeb')])){return this[_0x8167('0xf')]['noop'](_0x8167('0xec'));}var _0x5475bd=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x4c02fa[_0x8167('0xeb')]);if(!_0x5475bd){return this['channel'][_0x8167('0x2e')](_0x4c02fa,_0x8167('0xed'));}var _0x314b33=this;_0x303420[_0x8167('0xee')](function(_0x50f66a,_0xc30a27){Object[_0x8167('0xef')](_0x50f66a)[_0x8167('0xee')](function(_0x45fe83){_0x314b33[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0xf1'),_0x5475bd,_0xc30a27,_0x45fe83),_0x50f66a[_0x45fe83]);});});this[_0x8167('0xf')]['setVariable'](util['format'](_0x8167('0xf2'),_0x5475bd),_0x303420['length']);return this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')]('variable\x20%s\x20set',_0x5475bd));};AGIVertices[_0x8167('0x12')][_0x8167('0xf3')]=function(_0x439a47){logger['debug'](util[_0x8167('0x2b')](_0x8167('0xf4'),_0x439a47[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x439a47['sip_id'])){return this[_0x8167('0xf')]['error'](_0x439a47,_0x8167('0xf5'));}var _0x53863f=this[_0x8167('0xf6')][_0x8167('0x84')](this,_0x439a47['sip_id']);if(!_0x53863f){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x439a47,'no\x20user\x20found');}var _0x388078=this[_0x8167('0xf')][_0x8167('0x6a')](_0x8167('0xf7'),[util[_0x8167('0x2b')](_0x8167('0xf8'),_0x53863f),_0x439a47[_0x8167('0x7a')],_0x439a47['opts'],_0x439a47[_0x8167('0x87')]]);if(_0x388078[_0x8167('0xba')]===-0x1){return _0x388078;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('Executed\x20command\x20%s',_0x8167('0xf7')));};AGIVertices[_0x8167('0x12')][_0x8167('0xf9')]=function(_0x5f201d){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0xfa'),_0x5f201d[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x5f201d[_0x8167('0x90')])){return this['channel'][_0x8167('0xbf')]('no\x20key\x20configured');}if(!this[_0x8167('0xb5')](_0x5f201d['text'])){return this[_0x8167('0xf')][_0x8167('0xbf')]('no\x20text\x20configured');}this[_0x8167('0xf')][_0x8167('0xfb')]=!![];this[_0x8167('0x39')](_0x5f201d);this[_0x8167('0x44')](_0x5f201d[_0x8167('0x6f')],'in');this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0xfc'),_0x5f201d['text']));var _0xbdcf79=this[_0x8167('0x8f')][_0x8167('0x84')](this,_0x5f201d);if(_0xbdcf79){for(var _0x58ba5d in _0xbdcf79){if(_0xbdcf79['hasOwnProperty'](_0x58ba5d)){this[_0x8167('0xf')][_0x8167('0xf0')](util['format'](_0x8167('0xfd'),_0x58ba5d[_0x8167('0x7e')]()),_0xbdcf79[_0x58ba5d]);}}this[_0x8167('0x44')](_0xbdcf79[_0x8167('0xfe')],_0x8167('0xff'));return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x100'),_0xbdcf79[_0x8167('0xfe')]));}return this[_0x8167('0xf')][_0x8167('0x2e')](_0x5f201d,_0x8167('0x101'));};AGIVertices[_0x8167('0x12')][_0x8167('0x102')]=function(_0x4ccb77){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x103'),_0x4ccb77[_0x8167('0x3b')]));if(!this['isConfigured'](_0x4ccb77[_0x8167('0x104')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x105'));}if(!this[_0x8167('0xb5')](_0x4ccb77['username'])){return this['channel'][_0x8167('0xbf')]('no\x20username\x20configured');}if(!this[_0x8167('0xb5')](_0x4ccb77['password'])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x106'));}if(!this[_0x8167('0xb5')](_0x4ccb77[_0x8167('0x107')])){return this['channel'][_0x8167('0xbf')]('no\x20text\x20configured');}this[_0x8167('0xf')][_0x8167('0xfb')]=!![];this[_0x8167('0x39')](_0x4ccb77);this[_0x8167('0x44')](_0x4ccb77['text'],'in');this['channel']['noop'](util[_0x8167('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x4ccb77[_0x8167('0x6f')]));var _0x486aa5=this[_0x8167('0x92')][_0x8167('0x84')](this,_0x4ccb77);if(_0x486aa5){for(var _0x51b596 in _0x486aa5){if(_0x486aa5[_0x8167('0xa3')](_0x51b596)){this[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0x108'),_0x51b596['toUpperCase']()),_0x486aa5[_0x51b596]);}}this[_0x8167('0x44')](_0x486aa5[_0x8167('0xfe')],_0x8167('0xff'));if(_0x486aa5[_0x8167('0x109')]){this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0x10a'),_0x486aa5[_0x8167('0x109')]));var _0x2c2474=this[_0x8167('0xf')][_0x8167('0x10b')](_0x486aa5[_0x8167('0x109')]);try{fs[_0x8167('0x10c')](_0x486aa5[_0x8167('0x109')]+_0x8167('0x10d'));}catch(_0x2bc935){logger[_0x8167('0x2e')](_0x2bc935);}return _0x2c2474;}else{return this['channel']['noop'](util['format'](_0x8167('0x10e'),_0x486aa5[_0x8167('0xfe')]));}}return this[_0x8167('0xf')]['error'](_0x4ccb77,_0x8167('0x10f'));};AGIVertices[_0x8167('0x12')][_0x8167('0x110')]=function(_0x3b33fa){logger['info'](util[_0x8167('0x2b')](_0x8167('0x111'),_0x3b33fa[_0x8167('0x3b')]));return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x110'));};AGIVertices['prototype'][_0x8167('0x112')]=function(_0x5f2f98){logger[_0x8167('0x2f')](util['format'](_0x8167('0x113'),_0x5f2f98[_0x8167('0x3b')]));var _0x453203='';if(_0x5f2f98[_0x8167('0x114')]){if(!this[_0x8167('0xb5')](_0x5f2f98[_0x8167('0x114')])){return this[_0x8167('0xf')]['error'](_0x5f2f98,_0x8167('0x115'));}else{var _0x26c74e=parseInt(_0x5f2f98[_0x8167('0x114')],0xa);if(isNaN(_0x26c74e)){_0x453203=_0x5f2f98[_0x8167('0x114')];}else{_0x453203=this[_0x8167('0x1e')][_0x8167('0x84')](this,_0x5f2f98[_0x8167('0x114')]);if(!_0x453203){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x5f2f98,_0x8167('0x116'));}}}}else if(_0x5f2f98['trunk_name']){_0x453203=_0x5f2f98[_0x8167('0x117')];}else{return this['channel'][_0x8167('0x2e')](_0x5f2f98,'no\x20trunk\x20selected');}var _0x3be4b0=this[_0x8167('0xf')][_0x8167('0x6a')]('DIAL',[util['format']('SIP/%s/%s',_0x453203,_0x5f2f98[_0x8167('0x4e')]),_0x5f2f98[_0x8167('0x7a')],_0x5f2f98['opts'],_0x5f2f98[_0x8167('0x87')]]);if(_0x3be4b0[_0x8167('0xba')]===-0x1){return _0x3be4b0;}return this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')]('Executed\x20command\x20%s',_0x8167('0xf7')));};AGIVertices['prototype'][_0x8167('0x118')]=function(_0x2803c5){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x119'),_0x2803c5[_0x8167('0x3b')]));return this[_0x8167('0xf')]['noop'](_0x8167('0x118'));};AGIVertices['prototype'][_0x8167('0x11a')]=function(_0x1794a2){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x11b'),_0x1794a2[_0x8167('0x3b')]));if(_0x1794a2[_0x8167('0x11c')]===0x0){return this[_0x8167('0xb6')](_0x1794a2);}_0x1794a2[_0x8167('0x11c')]-=0x1;if(!this[_0x8167('0xb5')](_0x1794a2[_0x8167('0x11d')])){return this[_0x8167('0xf')]['error'](_0x1794a2,_0x8167('0x11e'));}var _0x19bda4=this['getSound'][_0x8167('0x84')](this,_0x1794a2['file_id']);if(!_0x19bda4){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x1794a2,_0x8167('0x11f'));}if(!this[_0x8167('0xb5')](_0x1794a2[_0x8167('0xeb')])){return this[_0x8167('0xf')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x10b6c4=this[_0x8167('0xf')][_0x8167('0x120')](_0x19bda4,_0x1794a2[_0x8167('0x121')],_0x1794a2[_0x8167('0x122')]);var _0x569ed0=_0x10b6c4[_0x8167('0xba')]?_0x10b6c4[_0x8167('0xba')][_0x8167('0xb1')]():'';logger[_0x8167('0x2f')]('test',JSON[_0x8167('0x88')](_0x10b6c4));if(_0x10b6c4[_0x8167('0xba')]===-0x1){this[_0x8167('0x39')]['sync'](this,_0x1794a2,_0x569ed0);return _0x10b6c4;}else if(_0x10b6c4['extra']==='timeout'){_0x10b6c4[_0x8167('0xba')]=_0x569ed0['length']>=parseInt(_0x1794a2[_0x8167('0x123')])?'x':'i';}else{_0x10b6c4['result']=_0x569ed0['length']>=parseInt(_0x1794a2['mindigit'])&&_0x569ed0[_0x8167('0xa8')]<=parseInt(_0x1794a2['maxdigit'])?'x':'i';}var _0x15c851=this[_0x8167('0x13')]['sync'](this,_0x1794a2[_0x8167('0xeb')]);if(!_0x15c851){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x1794a2,'no\x20variable\x20found');}this[_0x8167('0xf')][_0x8167('0xf0')](_0x15c851,_0x569ed0);if(this['isConfigured'](_0x1794a2[_0x8167('0x124')])){var _0x4675d9=parseInt(_0x1794a2[_0x8167('0x124')],0xa);var _0x274b20=rs[_0x8167('0x125')]({'charset':'*','length':_0x4675d9});var _0x412e33=_0x569ed0[_0x8167('0xa8')];if(_0x412e33>0x0){if(_0x412e33>_0x4675d9){this[_0x8167('0x39')][_0x8167('0x84')](this,_0x1794a2,_0x1794a2[_0x8167('0x126')]===_0x8167('0x127')?_0x274b20+_0x569ed0['substr'](_0x4675d9):_0x569ed0[_0x8167('0x128')](0x0,_0x412e33-_0x4675d9)+_0x274b20);}else{this[_0x8167('0x39')][_0x8167('0x84')](this,_0x1794a2,rs[_0x8167('0x125')]({'charset':'*','length':_0x412e33}));}}else{this[_0x8167('0x39')][_0x8167('0x84')](this,_0x1794a2,'');}}else{this[_0x8167('0x39')][_0x8167('0x84')](this,_0x1794a2,_0x569ed0);}return _0x10b6c4;};AGIVertices[_0x8167('0x12')]['getsecretdigits']=function(_0x59c937){logger[_0x8167('0x2f')](util['format'](_0x8167('0x129'),_0x59c937[_0x8167('0x3b')]));return this[_0x8167('0x11a')](_0x59c937);};AGIVertices['prototype'][_0x8167('0x12a')]=function(_0x5a4605){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x12b'),_0x5a4605[_0x8167('0x3b')]));this['createSquareDetailsReport'][_0x8167('0x84')](this,_0x5a4605,_0x5a4605[_0x8167('0x12c')]);return this[_0x8167('0xf')]['noop'](util['format'](_0x8167('0x12d'),_0x5a4605[_0x8167('0x12c')]));};AGIVertices[_0x8167('0x12')][_0x8167('0x12e')]=function(_0x2b24ea){logger['info'](util[_0x8167('0x2b')](_0x8167('0x12f'),_0x2b24ea[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x2b24ea[_0x8167('0x130')])||!this[_0x8167('0xb5')](_0x2b24ea[_0x8167('0x97')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x131'));}if(!this['isConfigured'](_0x2b24ea[_0x8167('0x6f')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xb8'));}this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x132'),_0x2b24ea['text']));var _0x289f0a=this[_0x8167('0x96')][_0x8167('0x84')](this,_0x2b24ea);if(_0x289f0a){this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('aws\x20Polly\x20%s\x20file\x20created',_0x289f0a));var _0x1706b8=this[_0x8167('0xf')][_0x8167('0x10b')](_0x289f0a);try{fs[_0x8167('0x10c')](_0x289f0a+_0x8167('0x10d'));}catch(_0x729b79){logger['error'](_0x729b79);}return _0x1706b8;}return this[_0x8167('0xf')]['error'](_0x2b24ea,_0x8167('0x133'));};AGIVertices['prototype']['awslex']=function(_0x23d1ad){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x134'),_0x23d1ad[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x23d1ad[_0x8167('0x130')])||!this[_0x8167('0xb5')](_0x23d1ad['aws_secret_access_key'])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x131'));}if(!this[_0x8167('0xb5')](_0x23d1ad[_0x8167('0x9c')])){return this['channel'][_0x8167('0xbf')](_0x8167('0x135'));}if(!this[_0x8167('0xb5')](_0x23d1ad[_0x8167('0x6f')])){return this['channel']['noop'](_0x8167('0xb8'));}this[_0x8167('0xf')][_0x8167('0xfb')]=!![];this['createSquareDetailsReport'](_0x23d1ad);this[_0x8167('0x44')](_0x23d1ad[_0x8167('0x6f')],'in');this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x136'),_0x23d1ad[_0x8167('0x6f')]));var _0x34b8d3=this['awsLex'][_0x8167('0x84')](this,_0x23d1ad);if(_0x34b8d3){for(var _0x1879b9 in _0x34b8d3){if(_0x34b8d3[_0x8167('0xa3')](_0x1879b9)&&_[_0x8167('0xa4')](_0x34b8d3[_0x1879b9])){this[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0x137'),_0x1879b9[_0x8167('0x7e')]()),_0x34b8d3[_0x1879b9]);}}if(_['isNil'](_0x34b8d3[_0x8167('0x8c')])){return this['channel'][_0x8167('0xbf')](_0x8167('0x138'));}else{this['createSquareMessage'](_0x34b8d3[_0x8167('0x8c')],_0x8167('0xff'));return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x34b8d3['message']));}}return this['channel'][_0x8167('0x2e')](_0x23d1ad,_0x8167('0x139'));};AGIVertices[_0x8167('0x12')][_0x8167('0x13a')]=function(_0x5e67f8){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x13b'),_0x5e67f8['label'],_0x5e67f8[_0x8167('0x7a')]));if(!this[_0x8167('0xb5')](_0x5e67f8[_0x8167('0x90')])){return this[_0x8167('0xf')][_0x8167('0xbf')]('no\x20key\x20configured');}var _0x2b6bc8=_0x8167('0x13c');var _0x25070f=util[_0x8167('0x2b')](_0x8167('0x13d'),FILES_PATH,rs[_0x8167('0x125')](0x4));var _0x1185d5=util[_0x8167('0x2b')](_0x8167('0xab'),_0x25070f,_0x2b6bc8);var _0x577412=!![];if(_0x5e67f8[_0x8167('0x13e')]===_0x8167('0x13f')){_0x577412=![];}var _0x158097=this[_0x8167('0xf')][_0x8167('0x140')](_0x25070f,_0x2b6bc8,_0x5e67f8[_0x8167('0x141')],_0x5e67f8[_0x8167('0x7a')],undefined,_0x577412);if(_0x158097['result']!==-0x1){this['channel'][_0x8167('0xbf')](util['format'](_0x8167('0x142'),_0x1185d5));var _0x824976=this[_0x8167('0x9d')][_0x8167('0x84')](this,_0x5e67f8,_0x1185d5);if(_0x824976){for(var _0x301f3d in _0x824976){if(_0x824976[_0x8167('0xa3')](_0x301f3d)){this[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0x143'),_0x301f3d[_0x8167('0x7e')]()),_0x824976[_0x301f3d]);}}return this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0x144'),JSON[_0x8167('0x88')](_0x824976)));}}return _0x158097;};AGIVertices['prototype'][_0x8167('0x145')]=function(_0x5a325c){logger['info'](util[_0x8167('0x2b')](_0x8167('0x146'),_0x5a325c[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x5a325c['appid'])){return this['channel']['noop'](_0x8167('0x147'));}if(!this[_0x8167('0xb5')](_0x5a325c['appsecret'])){return this[_0x8167('0xf')]['noop'](_0x8167('0x148'));}var _0x5874a6=_0x8167('0x13c');var _0x1ec104=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x8167('0x125')](0x4));var _0x541360=util[_0x8167('0x2b')](_0x8167('0xab'),_0x1ec104,_0x5874a6);var _0x2f31af=!![];if(_0x5a325c[_0x8167('0x13e')]===_0x8167('0x13f')){_0x2f31af=![];}var _0x4c7b4e=this[_0x8167('0xf')]['recordFile'](_0x1ec104,_0x5874a6,_0x5a325c['intKey'],_0x5a325c[_0x8167('0x7a')],undefined,_0x2f31af);if(_0x4c7b4e[_0x8167('0xba')]!==-0x1){this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x149'),_0x541360));var _0x517688=this[_0x8167('0x9f')]['sync'](this,_0x5a325c,_0x541360);if(_0x517688){for(var _0x11663b in _0x517688){if(_0x517688[_0x8167('0xa3')](_0x11663b)){this[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0x14a'),_0x11663b[_0x8167('0x7e')]()),_0x517688[_0x11663b]);}}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x14b'),JSON[_0x8167('0x88')](_0x517688)));}}return _0x4c7b4e;};AGIVertices['prototype']['gotoc']=function(_0x42d8fe){logger['info'](util['format'](_0x8167('0x14c'),_0x42d8fe['label']));return this['channel'][_0x8167('0x14d')](_0x42d8fe[_0x8167('0x40')],_0x42d8fe[_0x8167('0x41')],_0x42d8fe[_0x8167('0x42')]);};AGIVertices[_0x8167('0x12')][_0x8167('0x14e')]=function(_0x70cdab){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x14f'),_0x70cdab[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x70cdab[_0x8167('0x150')])){return this['channel']['error'](_0x70cdab,'no\x20condition\x20configured');}try{var _0xcd6cff=eval(_0x70cdab[_0x8167('0x150')])?'true':_0x8167('0x151');this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0x152'),_0x70cdab[_0x8167('0x150')],_0xcd6cff));return{'code':0xc8,'result':_0xcd6cff};}catch(_0x2213d0){return{'code':0xc8,'result':_0x8167('0x151')};}};AGIVertices[_0x8167('0x12')][_0x8167('0x153')]=function(_0x13fefa){logger[_0x8167('0x2f')](util['format'](_0x8167('0x154'),_0x13fefa[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x13fefa[_0x8167('0x155')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x13fefa,'no\x20interval\x20configured');}var _0x52d9ff=this['getIntervals'][_0x8167('0x84')](this,_0x13fefa[_0x8167('0x155')]);if(!_0x52d9ff){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x13fefa,_0x8167('0x156'));}for(var _0x56cb51=0x0;_0x56cb51<_0x52d9ff[_0x8167('0xa8')];_0x56cb51+=0x1){var _0x4a1133=this[_0x8167('0xf')][_0x8167('0x13')](util['format'](_0x8167('0x157'),_0x52d9ff[_0x56cb51]));if(_0x4a1133[_0x8167('0xba')]===-0x1){return _0x4a1133;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x52d9ff[_0x56cb51],_0x4a1133['extra']));if(_0x4a1133[_0x8167('0xb0')]===_0x8167('0x158')){logger['info'](util[_0x8167('0x2b')](_0x8167('0x159'),_0x52d9ff[_0x56cb51],_0x8167('0x158')));this[_0x8167('0xf')]['noop'](util['format'](_0x8167('0x159'),_0x52d9ff[_0x56cb51],_0x8167('0x158')));return{'code':0xc8,'result':_0x8167('0x158')};}else{logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x159'),_0x52d9ff[_0x56cb51],_0x8167('0x151')));this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x159'),_0x52d9ff[_0x56cb51],_0x8167('0x151')));}}return{'code':0xc8,'result':_0x8167('0x151')};};AGIVertices[_0x8167('0x12')][_0x8167('0x15a')]=function(_0x417f6c){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x15b'),_0x417f6c['label']));return this['channel'][_0x8167('0x15a')]();};AGIVertices[_0x8167('0x12')]['ispeechasr']=function(_0x5a8a87){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x15c'),_0x5a8a87[_0x8167('0x3b')]));if(!this['isConfigured'](_0x5a8a87['key'])){return this[_0x8167('0xf')][_0x8167('0xbf')]('no\x20key\x20configured');}var _0x19f749=_0x8167('0x13c');var _0x40f653=util[_0x8167('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0xbeac5=util[_0x8167('0x2b')](_0x8167('0xab'),_0x40f653,_0x19f749);var _0x37544c=!![];if(_0x5a8a87[_0x8167('0x13e')]==='NOBEEP'){_0x37544c=![];}var _0x556224=this[_0x8167('0xf')]['recordFile'](_0x40f653,_0x19f749,_0x5a8a87[_0x8167('0x141')],_0x5a8a87['timeout'],undefined,_0x37544c);if(_0x556224[_0x8167('0xba')]!==-0x1){this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x15d'),_0xbeac5));var _0x1d650a=this[_0x8167('0x15e')][_0x8167('0x84')](this,_0x5a8a87,_0xbeac5);if(_0x1d650a){for(var _0xf2e3b0 in _0x1d650a){if(_0x1d650a['hasOwnProperty'](_0xf2e3b0)){this[_0x8167('0xf')]['setVariable'](util[_0x8167('0x2b')](_0x8167('0x15f'),_0xf2e3b0[_0x8167('0x7e')]()),_0x1d650a[_0xf2e3b0]);}}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0x8167('0x88')](_0x1d650a)));}}return _0x556224;};AGIVertices[_0x8167('0x12')]['ispeechtts']=function(_0x2de94f){logger['info'](util['format'](_0x8167('0x160'),_0x2de94f[_0x8167('0x3b')]));if(!this['isConfigured'](_0x2de94f['key'])){return this[_0x8167('0xf')]['noop'](_0x8167('0x161'));}if(!this['isConfigured'](_0x2de94f['text'])){return this[_0x8167('0xf')]['noop'](_0x8167('0xb8'));}this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x2de94f[_0x8167('0x6f')]));var _0x45a3f9=this[_0x8167('0x93')]['sync'](this,_0x2de94f);if(_0x45a3f9){this['channel'][_0x8167('0xbf')](util['format'](_0x8167('0x15d'),_0x45a3f9));var _0x28d3c3=this['channel']['streamFile'](_0x45a3f9,_0x2de94f[_0x8167('0x141')]);try{fs[_0x8167('0x10c')](_0x45a3f9+_0x8167('0x10d'));}catch(_0x4b97b1){logger[_0x8167('0x2e')](_0x4b97b1);}return _0x28d3c3;}return this['channel'][_0x8167('0x2e')](_0x2de94f,_0x8167('0x162'));};AGIVertices[_0x8167('0x12')][_0x8167('0x163')]=function(_0x5c5387){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x164'),_0x5c5387[_0x8167('0x3b')]));if(!this['isConfigured'](_0x5c5387[_0x8167('0x165')])){return this['channel'][_0x8167('0x2e')](_0x5c5387,'no\x20find\x20by\x20configured');}logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x166'),this['channel']['callerid'],_0x5c5387['findBy']));var _0x5606e7=this['agentLogin'][_0x8167('0x84')](this,_0x5c5387[_0x8167('0x165')]);if(_0x5606e7){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x167'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x5c5387[_0x8167('0x165')]));this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8167('0xf')][_0x8167('0x3f')],_0x5c5387[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x168')};}else{logger[_0x8167('0x2f')](util[_0x8167('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8167('0xf')][_0x8167('0x3f')],_0x5c5387['findBy']));this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x169'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x5c5387[_0x8167('0x165')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8167('0x12')][_0x8167('0x16a')]=function(_0x3ecc89){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x16b'),_0x3ecc89['label']));if(!this[_0x8167('0xb5')](_0x3ecc89[_0x8167('0x165')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x3ecc89,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x8167('0x166'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x3ecc89[_0x8167('0x165')]));var _0x58d962=this[_0x8167('0x64')]['sync'](this,_0x3ecc89[_0x8167('0x165')]);if(_0x58d962){logger['info'](util[_0x8167('0x2b')](_0x8167('0x167'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x3ecc89['findBy']));this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x167'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x3ecc89[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x168')};}else{logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x169'),this[_0x8167('0xf')]['callerid'],_0x3ecc89['findBy']));this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0x169'),this['channel'][_0x8167('0x3f')],_0x3ecc89[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x16c')};}};AGIVertices[_0x8167('0x12')][_0x8167('0x16d')]=function(_0x63bc0a){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x16e'),_0x63bc0a[_0x8167('0x3b')]));if(!this['isConfigured'](_0x63bc0a[_0x8167('0x16f')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x63bc0a,_0x8167('0x170'));}this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x171'),_0x63bc0a[_0x8167('0x16f')]));var _0x3c970a=eval(_0x63bc0a['operation']);if(!this[_0x8167('0xb5')](_0x63bc0a[_0x8167('0xeb')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xec'));}var _0x1b33b9=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x63bc0a['variable_id']);if(!_0x1b33b9){return this[_0x8167('0xf')]['error'](_0x63bc0a,'no\x20variable\x20found');}if(_[_0x8167('0xaa')](_0x3c970a)){var _0x23ddd9=this;_0x3c970a['forEach'](function(_0x3dcd5a,_0x2a535d){_0x23ddd9[_0x8167('0xf')][_0x8167('0xf0')](util[_0x8167('0x2b')]('%s[%s]',_0x1b33b9,_0x2a535d),_0x3dcd5a);});return this['channel']['noop'](util[_0x8167('0x2b')]('variable\x20%s[key]\x20set',_0x1b33b9));}else{return this[_0x8167('0xf')][_0x8167('0xf0')](_0x1b33b9,_0x3c970a);}};AGIVertices['prototype'][_0x8167('0xe')]=function(_0x567a8b){logger['info'](util['format'](_0x8167('0x172'),_0x567a8b[_0x8167('0x3b')]));if(_0x567a8b[_0x8167('0x11c')]===0x0){return this[_0x8167('0xb6')](_0x567a8b);}_0x567a8b[_0x8167('0x11c')]-=0x1;if(!this[_0x8167('0xb5')](_0x567a8b[_0x8167('0x11d')])){return this[_0x8167('0xf')]['error'](_0x567a8b,_0x8167('0x11e'));}var _0x38d676=this['getSound']['sync'](this,_0x567a8b[_0x8167('0x11d')]);if(!_0x38d676){return this[_0x8167('0xf')]['error'](_0x567a8b,_0x8167('0x11f'));}var _0x355209=this[_0x8167('0xf')][_0x8167('0x120')](_0x38d676,_0x567a8b['response'],_0x567a8b['digit']);var _0x28c909=_0x355209[_0x8167('0xba')];if(_0x355209['result']===-0x1){this[_0x8167('0x39')][_0x8167('0x84')](this,_0x567a8b,'-1');return _0x355209;}else if(_0x355209[_0x8167('0xb0')]===_0x8167('0x7a')){_0x355209[_0x8167('0xba')]=_0x355209[_0x8167('0xba')][_0x8167('0xa8')]>0x0?_0x355209[_0x8167('0xba')]:'t';}else if(_['isEmpty'](_0x355209[_0x8167('0xba')])){_0x355209['result']='#';_0x28c909='#';}if(!this[_0x8167('0xb5')](_0x567a8b[_0x8167('0xeb')])){this['channel'][_0x8167('0xbf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x236ab5=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x567a8b[_0x8167('0xeb')]);if(!_0x236ab5){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x567a8b,_0x8167('0xed'));}this[_0x8167('0xf')][_0x8167('0xf0')](_0x236ab5,_0x28c909);}this['createSquareDetailsReport']['sync'](this,_0x567a8b,_0x28c909);return _0x355209;};AGIVertices['prototype']['noop']=function(_0x1a1f29){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x173'),_0x1a1f29['label']));return this[_0x8167('0xf')][_0x8167('0xbf')](_0x1a1f29[_0x8167('0x174')]||_0x1a1f29[_0x8167('0x3b')]);};AGIVertices['prototype'][_0x8167('0x175')]=function(_0x1ab5a4){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x176'),_0x1ab5a4[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x1ab5a4[_0x8167('0x165')])){return this['channel'][_0x8167('0x2e')](_0x1ab5a4,_0x8167('0x177'));}logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x166'),this['channel']['callerid'],_0x1ab5a4['findBy']));var _0x29b91b=this[_0x8167('0x60')][_0x8167('0x84')](this,_0x1ab5a4['pause_id']);var _0x147bd7=this[_0x8167('0x61')][_0x8167('0x84')](this,_0x1ab5a4[_0x8167('0x165')],_0x29b91b);if(_0x147bd7){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x167'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x1ab5a4[_0x8167('0x165')]));this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8167('0xf')][_0x8167('0x3f')],_0x1ab5a4[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x168')};}else{logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x169'),this[_0x8167('0xf')]['callerid'],_0x1ab5a4[_0x8167('0x165')]));this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8167('0xf')][_0x8167('0x3f')],_0x1ab5a4[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x16c')};}};AGIVertices[_0x8167('0x12')]['playback']=function(_0x5a5ae8){logger['info'](util[_0x8167('0x2b')](_0x8167('0x178'),_0x5a5ae8[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x5a5ae8[_0x8167('0x11d')])){return this['channel'][_0x8167('0x2e')](_0x5a5ae8,'no\x20file\x20audio\x20selected');}var _0x373f91=this[_0x8167('0x20')][_0x8167('0x84')](this,_0x5a5ae8[_0x8167('0x11d')]);if(!_0x373f91){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x5a5ae8,_0x8167('0x11f'));}var _0x3a05fc=this[_0x8167('0xf')]['exec'](_0x8167('0x179'),[_0x373f91,_0x5a5ae8[_0x8167('0x17a')]]);if(_0x3a05fc[_0x8167('0xba')]===-0x1){return _0x3a05fc;}return this[_0x8167('0xf')]['noop'](util['format'](_0x8167('0xd5'),_0x8167('0x179'),_0x373f91));};AGIVertices[_0x8167('0x12')][_0x8167('0x17b')]=function(_0x2efb76){logger[_0x8167('0x2f')](util['format'](_0x8167('0x17c'),_0x2efb76['label']));if(!this[_0x8167('0xb5')](_0x2efb76[_0x8167('0x17d')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x2efb76,'no\x20queue\x20selected');}var _0x44d178='';var _0x4cff4c=parseInt(_0x2efb76[_0x8167('0x17d')],0xa);if(isNaN(_0x4cff4c)){_0x44d178=_0x2efb76[_0x8167('0x17d')];}else{_0x44d178=this[_0x8167('0x17')][_0x8167('0x84')](this,_0x2efb76[_0x8167('0x17d')]);if(!_0x44d178){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x2efb76,_0x8167('0x17e'));}}var _0x15c33e='';if(this[_0x8167('0xb5')](_0x2efb76[_0x8167('0x11d')])){var _0x261b18=this['getSound'][_0x8167('0x84')](this,_0x2efb76[_0x8167('0x11d')]);if(_0x261b18){_0x15c33e=_0x261b18;}}this[_0x8167('0x39')][_0x8167('0x84')](this,_0x2efb76,_0x44d178);if(_0x2efb76[_0x8167('0x17a')][_0x8167('0x17f')]('x')<0x0){_0x2efb76[_0x8167('0x17a')]+='x';}if(_0x2efb76['opts']['indexOf']('X')<0x0){_0x2efb76[_0x8167('0x17a')]+='X';}this[_0x8167('0xf')][_0x8167('0xf0')](_0x8167('0x180'),_0x44d178?_0x44d178[_0x8167('0x181')]():'');var _0x322568=this[_0x8167('0xf')][_0x8167('0x6a')]('QUEUE',[_0x44d178,_0x2efb76[_0x8167('0x17a')],_0x2efb76[_0x8167('0x87')],_0x15c33e,_0x2efb76[_0x8167('0x7a')],_0x2efb76[_0x8167('0x8')],_0x2efb76[_0x8167('0x182')],_0x2efb76[_0x8167('0x183')],'',_0x2efb76[_0x8167('0x184')]]);if(_0x322568['result']===-0x1){return _0x322568;}return this['channel']['noop'](util['format'](_0x8167('0xd5'),_0x8167('0x185'),_0x44d178));};AGIVertices['prototype'][_0x8167('0x186')]=function(_0x2e3b3e){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x187'),_0x2e3b3e[_0x8167('0x3b')]));var _0x58b744=_0x2e3b3e[_0x8167('0x188')]||_0x8167('0x13c');var _0x2b23a5=util['format']('%s_%s',this[_0x8167('0xf')]['uniqueid'],rs[_0x8167('0x125')](0x5));var _0x4fc51b=util[_0x8167('0x2b')](_0x8167('0x189'),FILES_PATH,_0x2b23a5,_0x58b744);var _0x49c118=util['format'](_0x8167('0x13d'),FILES_PATH,_0x2b23a5);this[_0x8167('0x3e')][_0x8167('0x84')](this,_0x2e3b3e,_0x2b23a5,_0x4fc51b);this[_0x8167('0xf')][_0x8167('0xf0')](_0x8167('0x18a'),_0x2b23a5);logger['info'](_0x8167('0x18b'),_0x49c118,_0x58b744,_0x2e3b3e[_0x8167('0x18c')],_0x2e3b3e['timeout']);return this[_0x8167('0xf')]['recordFile'](_0x49c118,_0x58b744,_0x2e3b3e[_0x8167('0x18c')],_0x2e3b3e[_0x8167('0x7a')],undefined,!![]);};AGIVertices['prototype'][_0x8167('0x18d')]=function(_0x20aa38){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x18e'),_0x20aa38[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x20aa38['url'])){return this['channel']['noop'](_0x8167('0x18f'));}var _0x3a90f1=this[_0x8167('0x78')][_0x8167('0x84')](this,_0x20aa38);logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x190'),util['inspect'](_0x3a90f1,{'showHidden':![],'depth':null})));if(!this[_0x8167('0xb5')](_0x20aa38[_0x8167('0xeb')])){return this[_0x8167('0xf')]['noop'](_0x8167('0x191'));}var _0x2b4810=this[_0x8167('0x13')]['sync'](this,_0x20aa38['variable_id']);if(!_0x2b4810){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x20aa38,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0x8167('0x2b')]('%s_STATUS_CODE',_0x2b4810),_0x3a90f1[_0x8167('0x8a')]?_0x3a90f1[_0x8167('0x8a')]:_0x8167('0x192'));this['channel'][_0x8167('0xf0')](util[_0x8167('0x2b')](_0x8167('0x193'),_0x2b4810),_0x3a90f1[_0x8167('0x8b')]?_0x3a90f1['statusMessage']:'OK');if(_0x3a90f1[_0x8167('0x7f')]){try{this[_0x8167('0xa9')](_0x3a90f1[_0x8167('0x7f')],_0x2b4810);}catch(_0x177ce1){logger[_0x8167('0x2e')](util[_0x8167('0x2b')](_0x8167('0x194'),_0x2b4810));}}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('variable\x20%s\x20set',_0x2b4810));};AGIVertices[_0x8167('0x12')]['saydigits']=function(_0xcaf7cc){logger[_0x8167('0x2f')](util['format'](_0x8167('0x195'),_0xcaf7cc[_0x8167('0x3b')]));return this[_0x8167('0xf')][_0x8167('0x196')](_0xcaf7cc[_0x8167('0x197')][_0x8167('0x6c')](/\s+/g,''),_0xcaf7cc[_0x8167('0x18c')]);};AGIVertices['prototype'][_0x8167('0x198')]=function(_0x3c5a79){logger['info'](util[_0x8167('0x2b')](_0x8167('0x199'),_0x3c5a79['label']));return this['channel']['sayNumber'](_0x3c5a79[_0x8167('0x7b')][_0x8167('0x6c')](/\s+/g,''),_0x3c5a79[_0x8167('0x18c')]);};AGIVertices[_0x8167('0x12')][_0x8167('0x19a')]=function(_0x1945d1){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x19b'),_0x1945d1['label']));return this['channel'][_0x8167('0x19c')](_0x1945d1['text'],_0x1945d1['escape_digits']);};AGIVertices[_0x8167('0x12')][_0x8167('0x19d')]=function(_0x29bcf6){logger[_0x8167('0x2f')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x29bcf6[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x29bcf6[_0x8167('0x19e')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x19f'));}var _0x2bcf51=this[_0x8167('0x24')][_0x8167('0x84')](this,_0x29bcf6[_0x8167('0x19e')]);if(!_0x2bcf51||!_0x2bcf51[_0x8167('0x1a0')]){return this['channel'][_0x8167('0x2e')](_0x29bcf6,_0x8167('0x1a1'));}var _0x29fb91={'from':util[_0x8167('0x2b')](_0x8167('0x1a2'),_0x2bcf51[_0x8167('0x15')],_0x2bcf51[_0x8167('0x1a3')]||_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1a4')]),'to':_0x29bcf6['to']||'','cc':_0x29bcf6['cc']||'','bcc':_0x29bcf6[_0x8167('0x1a5')]||'','subject':_0x29bcf6['subject'],'html':_0x29bcf6[_0x8167('0x6f')],'text':_0x29bcf6[_0x8167('0x6f')]};var _0x5254bc={'tls':{'rejectUnauthorized':![]}};if(_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1a6')]){_0x5254bc['service']=_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1a6')];}else{_0x5254bc['host']=_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1a7')];_0x5254bc['port']=_0x2bcf51['Smtp'][_0x8167('0x1a8')];_0x5254bc[_0x8167('0x1a9')]=_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1a9')];}if(_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1aa')]){_0x5254bc[_0x8167('0x1ab')]={'user':_0x2bcf51['Smtp'][_0x8167('0x1a4')],'pass':_0x2bcf51[_0x8167('0x1a0')][_0x8167('0x1ac')]};}if(this[_0x8167('0xb5')](_0x29bcf6['template_id'])){}logger[_0x8167('0x1ad')](_0x8167('0x1ae'),JSON[_0x8167('0x88')](_0x29fb91));this['createSquareDetailsReport']['sync'](this,_0x29bcf6,_0x29bcf6[_0x8167('0x19e')]);this[_0x8167('0xf')][_0x8167('0xbf')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x2bcf51['name']));this[_0x8167('0x26')][_0x8167('0x84')](this,_0x5254bc,_0x29fb91);return this['channel']['noop'](_0x8167('0x1af'));};AGIVertices[_0x8167('0x12')]['sendFax']=function(_0x37baa7){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x1b0'),_0x37baa7['label']));return this['channel'][_0x8167('0xbf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x8167('0x1b1')]=function(_0x2a6460){logger[_0x8167('0x2f')](util['format'](_0x8167('0x1b2'),_0x2a6460[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x2a6460[_0x8167('0x1b3')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x1b4'));}var _0x2b4a6d=this[_0x8167('0x36')][_0x8167('0x84')](this,_0x2a6460[_0x8167('0x1b3')]);if(!_0x2b4a6d){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x2a6460,'no\x20sms\x20account\x20found');}var _0x477c97={'body':_0x2a6460[_0x8167('0x1b5')],'phone':_0x2a6460['to']||'','SmsAccountId':_0x2b4a6d['id']};logger[_0x8167('0x1ad')]('sendSMS\x20message',JSON['stringify'](_0x477c97));this[_0x8167('0x39')][_0x8167('0x84')](this,_0x2a6460,_0x2a6460[_0x8167('0x1b3')]);this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x1b6'),_0x2b4a6d[_0x8167('0x15')]));this['createSmsMessage'][_0x8167('0x84')](this,_0x477c97);return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x1b7'));};AGIVertices['prototype'][_0x8167('0x1b8')]=function(_0x27448a){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x1b9'),_0x27448a[_0x8167('0x3b')]));if(!this['isConfigured'](_0x27448a[_0x8167('0xeb')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x27448a,_0x8167('0x1ba'));}var _0x49dab6=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x27448a[_0x8167('0xeb')]);if(!_0x49dab6){return this['channel'][_0x8167('0x2e')](_0x27448a,_0x8167('0xed'));}return this[_0x8167('0xf')][_0x8167('0xf0')](_0x49dab6,_0x27448a['variable_value']);};AGIVertices[_0x8167('0x12')]['start']=function(_0x17d607){logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x1bb'),_0x17d607[_0x8167('0x3b')]));this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x1bc'));if(_0x17d607['answer']===_0x8167('0x1bd')){this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x1be'));return this['channel'][_0x8167('0xc9')]();}return this['channel'][_0x8167('0xbf')](_0x8167('0x1bf'));};AGIVertices['prototype'][_0x8167('0x1c0')]=function(_0x33990c){logger['info'](util[_0x8167('0x2b')](_0x8167('0x1c1'),_0x33990c['label']));if(!this[_0x8167('0xb5')](_0x33990c[_0x8167('0x1c2')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x33990c,'no\x20subproject\x20selected');}var _0x3f4fbd=this['getSquareProject']['sync'](this,_0x33990c[_0x8167('0x1c2')]);if(!this[_0x8167('0xb5')](_0x3f4fbd)){return this[_0x8167('0xf')]['error'](_0x33990c,util['format'](_0x8167('0x1c3'),_0x33990c[_0x8167('0x1c2')]));}if(_0x3f4fbd===this['channel'][_0x8167('0x3d')]){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x33990c,_0x8167('0x1c4'));}this[_0x8167('0x39')][_0x8167('0x84')](this,_0x33990c,_0x3f4fbd);var _0x8cd2c7=this['channel'][_0x8167('0x6a')](_0x8167('0x1c5'),util[_0x8167('0x2b')](_0x8167('0x1c6'),config[_0x8167('0x8')][_0x8167('0x1a7')]||_0x8167('0x1c7'),_0x3f4fbd,this['channel'][_0x8167('0x3d')]));if(_0x8cd2c7[_0x8167('0xba')]===-0x1){return _0x8cd2c7;}return this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8167('0x1c5'),_0x3f4fbd));};AGIVertices['prototype']['system']=function(_0x2cf71b){logger['info'](util[_0x8167('0x2b')](_0x8167('0x1c8'),_0x2cf71b[_0x8167('0x3b')]));var _0x480091=this[_0x8167('0x69')]['sync'](this,_0x2cf71b[_0x8167('0xc7')]);this[_0x8167('0x39')][_0x8167('0x84')](this,_0x2cf71b,_0x2cf71b[_0x8167('0xc7')]);if(this[_0x8167('0xb5')](_0x2cf71b[_0x8167('0xeb')])){var _0x5b2e6c=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x2cf71b[_0x8167('0xeb')]);if(_0x5b2e6c){this[_0x8167('0xf')]['setVariable'](_0x5b2e6c,_0x480091);return this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x1c9'),_0x2cf71b[_0x8167('0xc7')],_0x5b2e6c));}}return this['channel'][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x1ca'),_0x2cf71b[_0x8167('0xc7')]));};AGIVertices[_0x8167('0x12')]['google_cloud_tts']=function(_0x3ab0f6){logger['info'](util[_0x8167('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3ab0f6['label']));_0x3ab0f6[_0x8167('0x6f')]=_0x3ab0f6['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3ab0f6[_0x8167('0x6d')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0x1cb'));}if(!this['isConfigured'](_0x3ab0f6[_0x8167('0x6f')])){return this['channel']['noop'](_0x8167('0xb8'));}this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x1cc'),_0x3ab0f6[_0x8167('0x6f')]));var _0x2c9f01=this[_0x8167('0x1cd')][_0x8167('0x84')](this,_0x3ab0f6);if(_0x2c9f01){this['channel']['noop'](util['format'](_0x8167('0x1ce'),_0x2c9f01));var _0x51919e=this[_0x8167('0xf')][_0x8167('0x10b')](_0x2c9f01);try{fs[_0x8167('0x10c')](_0x2c9f01+_0x8167('0x10d'));}catch(_0x31bb07){logger[_0x8167('0x2e')](_0x31bb07);}return _0x51919e;}return this[_0x8167('0xf')][_0x8167('0x2e')](_0x3ab0f6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8167('0x12')][_0x8167('0x1cf')]=function(_0x43de07){logger['info'](util[_0x8167('0x2b')](_0x8167('0x1d0'),_0x43de07[_0x8167('0x3b')]));_0x43de07[_0x8167('0x6f')]=_0x43de07['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8167('0xb5')](_0x43de07[_0x8167('0x6f')])){return this[_0x8167('0xf')][_0x8167('0xbf')](_0x8167('0xb8'));}this['channel']['noop'](util[_0x8167('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x43de07[_0x8167('0x6f')]));var _0x40f69d=this[_0x8167('0x76')]['sync'](this,_0x43de07);if(_0x40f69d){this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x1d1'),_0x40f69d));var _0x2c9af1=this[_0x8167('0xf')][_0x8167('0x10b')](_0x40f69d);try{fs[_0x8167('0x10c')](_0x40f69d+_0x8167('0x10d'));}catch(_0x568be7){logger[_0x8167('0x2e')](_0x568be7);}return _0x2c9af1;}return this[_0x8167('0xf')][_0x8167('0x2e')](_0x43de07,_0x8167('0x1d2'));};AGIVertices[_0x8167('0x12')][_0x8167('0x1d3')]=function(_0x4807c1){logger['info'](util[_0x8167('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4807c1[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x4807c1[_0x8167('0x165')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4807c1,_0x8167('0x177'));}logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x166'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x4807c1[_0x8167('0x165')]));var _0x1d12df=this[_0x8167('0x62')]['sync'](this,_0x4807c1[_0x8167('0x165')]);if(_0x1d12df){logger[_0x8167('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8167('0x3f')],_0x4807c1['findBy']));this[_0x8167('0xf')][_0x8167('0xbf')](util['format'](_0x8167('0x167'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x4807c1['findBy']));return{'code':0xc8,'result':_0x8167('0x168')};}else{logger[_0x8167('0x2f')](util[_0x8167('0x2b')](_0x8167('0x169'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x4807c1['findBy']));this[_0x8167('0xf')][_0x8167('0xbf')](util[_0x8167('0x2b')](_0x8167('0x169'),this[_0x8167('0xf')][_0x8167('0x3f')],_0x4807c1[_0x8167('0x165')]));return{'code':0xc8,'result':_0x8167('0x16c')};}};AGIVertices[_0x8167('0x12')][_0x8167('0x1d4')]=function(_0x1db757){logger[_0x8167('0x2f')](util[_0x8167('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1db757[_0x8167('0x3b')]));var _0x385430=this[_0x8167('0xf')][_0x8167('0x6a')](_0x8167('0x1d5'),[_0x1db757[_0x8167('0x1d6')],_0x1db757['options']]);if(_0x385430[_0x8167('0xba')]===-0x1){return _0x385430;}return this[_0x8167('0xf')]['noop'](util[_0x8167('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8167('0x1d5'),_0x1db757['mailbox']));};AGIVertices[_0x8167('0x12')][_0x8167('0x1d7')]=function(_0x4ffb35){logger[_0x8167('0x2f')](util['format'](_0x8167('0x1d8'),_0x4ffb35[_0x8167('0x3b')]));if(!this[_0x8167('0xb5')](_0x4ffb35[_0x8167('0xeb')])){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4ffb35,_0x8167('0x1ba'));}var _0x383e50=this[_0x8167('0x13')][_0x8167('0x84')](this,_0x4ffb35[_0x8167('0xeb')]);if(!_0x383e50){return this[_0x8167('0xf')][_0x8167('0x2e')](_0x4ffb35,_0x8167('0xed'));}var _0x1429c3=this[_0x8167('0xf')][_0x8167('0x13')](_0x383e50);return{'code':0xc8,'result':_0x1429c3['extra']?_0x1429c3[_0x8167('0xb0')]:'-'};};String[_0x8167('0x12')]['replaceAll']=function(_0x128b1d,_0x198984){return this['split'](_0x128b1d)['join'](_0x198984);};module[_0x8167('0x1d9')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4ca329a..6909aba 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 _0xac9d=['name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[TIMER][STOP][AGENT:%s]','catch','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x4df063,_0x40bc28){var _0x4dc5e5=function(_0x4b81d4){while(--_0x4b81d4){_0x4df063['push'](_0x4df063['shift']());}};_0x4dc5e5(++_0x40bc28);}(_0xac9d,0x14d));var _0xdac9=function(_0x3f2a44,_0xf70f4b){_0x3f2a44=_0x3f2a44-0x0;var _0x50d3cb=_0xac9d[_0x3f2a44];return _0x50d3cb;};'use strict';var util=require(_0xdac9('0x0'));var _=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var ami=require(_0xdac9('0x3'));var logger=require(_0xdac9('0x4'))(_0xdac9('0x5'));var RpcUser=require(_0xdac9('0x6'));var RpcVoiceAgentReport=require(_0xdac9('0x7'));function Acw(_0x51a5d7){this[_0xdac9('0x8')]=_0x51a5d7['voiceQueues'];this[_0xdac9('0x9')]=_0x51a5d7[_0xdac9('0x9')];this[_0xdac9('0xa')]=_0x51a5d7[_0xdac9('0xa')];this[_0xdac9('0xb')]={};ami['on'](_0xdac9('0xc'),this['syncAgentConnect'][_0xdac9('0xd')](this));ami['on']('hanguprequest',this[_0xdac9('0xe')][_0xdac9('0xd')](this));ami['on'](_0xdac9('0xf'),this[_0xdac9('0x10')][_0xdac9('0xd')](this));ami['on'](_0xdac9('0x11'),this[_0xdac9('0x12')][_0xdac9('0xd')](this));ami['on'](_0xdac9('0x13'),this['syncAttendedTransfer'][_0xdac9('0xd')](this));ami['on'](_0xdac9('0x14'),this['syncBlindTransfer'][_0xdac9('0xd')](this));ami['on'](_0xdac9('0x15'),this[_0xdac9('0x16')]['bind'](this));}function getDiff(_0x16063f){var _0x33ba20=moment()[_0xdac9('0x17')](0x0);var _0x5f0bbd=moment(_0x16063f)['milliseconds'](0x0);return _0x33ba20[_0xdac9('0x18')](_0x5f0bbd,_0xdac9('0x19'));}Acw['prototype'][_0xdac9('0x1a')]=function(_0x36cbe4){try{var _0x152ea5=this;var _0x5b2f1b=this[_0xdac9('0xb')][_0x36cbe4][_0xdac9('0x1b')];var _0x34a85a=this[_0xdac9('0xb')][_0x36cbe4]['queue'];var _0x283343=this[_0xdac9('0x8')][_0x34a85a];var _0x571e07=![];var _0x1cd239=_0xdac9('0x1c');if(_0x283343[_0xdac9('0x1d')]){if(_0x283343[_0xdac9('0x1e')]['name']){_0x571e07=!![];_0x1cd239=_0x283343['mandatoryDispositionPause'][_0xdac9('0x1f')];}}ami[_0xdac9('0x20')]({'action':_0xdac9('0x21'),'interface':_0x5b2f1b,'paused':!![],'reason':_0x1cd239})[_0xdac9('0x22')](function(_0x52fb18){if(_0x152ea5[_0xdac9('0x9')][_0x5b2f1b]){return RpcUser[_0xdac9('0x23')](_0x152ea5[_0xdac9('0x9')][_0x5b2f1b]['id'])[_0xdac9('0x22')](function(_0xe7bd10){if(_0xe7bd10&&!_0xe7bd10[_0xdac9('0x24')]){logger[_0xdac9('0x25')](_0xdac9('0x26'),_0x36cbe4,_0x5b2f1b,_0x34a85a);var _0x419f0c=_0x152ea5[_0xdac9('0xb')][_0x36cbe4]['attended']&&_0x152ea5[_0xdac9('0xb')][_0x36cbe4][_0xdac9('0x27')]?_0x152ea5[_0xdac9('0xb')][_0x36cbe4][_0xdac9('0x27')]:_0x36cbe4;return RpcUser['savePause'](_0x152ea5[_0xdac9('0x9')][_0x5b2f1b],_0x1cd239,_0x419f0c)['then'](function(_0x3ce475){if(!_0x571e07){_0x152ea5[_0xdac9('0xa')][_0x5b2f1b]={};logger['info'](_0xdac9('0x28'),_0x36cbe4,_0x152ea5['voiceQueues'][_0x34a85a][_0xdac9('0x29')],_0x5b2f1b,_0x34a85a);_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2a')]=setTimeout(_0x152ea5[_0xdac9('0x2b')]['bind'](_0x152ea5,_0x5b2f1b),_0x152ea5['voiceQueues'][_0x34a85a][_0xdac9('0x29')]*0x3e8);_0x152ea5[_0xdac9('0xa')][_0x5b2f1b]['lastPauseAt']=moment()['format'](_0xdac9('0x2c'));_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2d')]=_0x36cbe4;_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2e')]=_0x34a85a;_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2f')]=function(){var _0x2cda4d=getDiff(_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x30')]);clearTimeout(_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2a')]);_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2a')]=![];RpcVoiceAgentReport[_0xdac9('0x31')]({'acwtime':_0x2cda4d},_0x152ea5[_0xdac9('0xa')][_0x5b2f1b][_0xdac9('0x2d')],_0x5b2f1b)[_0xdac9('0x22')](function(_0x339f31){logger[_0xdac9('0x25')](_0xdac9('0x32'),_0x36cbe4,_0x2cda4d,_0x339f31);})['catch'](function(_0x5e7ebe){logger[_0xdac9('0x33')](_0xdac9('0x34'),_0x36cbe4,_0x5e7ebe);});delete _0x152ea5[_0xdac9('0xa')][_0x5b2f1b];};}});}else{logger[_0xdac9('0x25')](_0xdac9('0x35'),_0x36cbe4,_0x5b2f1b,_0x34a85a);}});}})['catch'](function(_0x1d125a){logger['error'](_0xdac9('0x28'),_0x36cbe4,_0x152ea5[_0xdac9('0x8')][_0x34a85a]['acwTimeout'],_0x5b2f1b,_0x34a85a);})[_0xdac9('0x36')](function(){delete _0x152ea5['channels'][_0x36cbe4];});}catch(_0x52d758){logger[_0xdac9('0x33')](_0xdac9('0x37'),_0x52d758[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x2b')]=function(_0x363d93){try{var _0x51cde6=this;if(_0x51cde6[_0xdac9('0xa')][_0x363d93]){_0x51cde6[_0xdac9('0xa')][_0x363d93]['timer']=![];var _0x244d1f=_0x51cde6[_0xdac9('0xa')][_0x363d93][_0xdac9('0x2d')];var _0x27bdfb=_0x51cde6[_0xdac9('0xa')][_0x363d93][_0xdac9('0x2e')];var _0x3ac9ae=_0x51cde6['voiceQueues'][_0x27bdfb][_0xdac9('0x29')];logger[_0xdac9('0x25')](_0xdac9('0x3a'),_0x363d93);RpcUser['saveUnpause'](this[_0xdac9('0x9')][_0x363d93]);RpcVoiceAgentReport[_0xdac9('0x31')]({'acwtime':_0x3ac9ae,'agentacw':!![]},_0x244d1f,_0x363d93)[_0xdac9('0x22')](function(_0x1d6f88){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x244d1f,_0x3ac9ae,_0x1d6f88);})[_0xdac9('0x3b')](function(_0xe47a3c){logger[_0xdac9('0x33')](_0xdac9('0x34'),_0x244d1f,_0xe47a3c);});}else{logger[_0xdac9('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x363d93);if(_0x51cde6[_0xdac9('0xa')]){logger['info'](_0xdac9('0x3c'),JSON[_0xdac9('0x3d')](_0x51cde6[_0xdac9('0xa')]));}}}catch(_0x1898e1){logger[_0xdac9('0x33')](_0xdac9('0x3e'),_0x1898e1[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x3f')]=function(_0x8a0538){try{if(this[_0xdac9('0x8')][_0x8a0538[_0xdac9('0x2e')]]&&(this[_0xdac9('0x8')][_0x8a0538[_0xdac9('0x2e')]]['acw']||this[_0xdac9('0x8')][_0x8a0538[_0xdac9('0x2e')]]['mandatoryDisposition'])){if(this[_0xdac9('0x9')][_0x8a0538[_0xdac9('0x1b')]]){this[_0xdac9('0xb')][_0x8a0538[_0xdac9('0x2d')]]={'queue':_0x8a0538[_0xdac9('0x2e')],'interface':_0x8a0538[_0xdac9('0x1b')],'destlinkedid':_0x8a0538['destlinkedid']};}}}catch(_0x1c3f15){logger['error'](_0xdac9('0x40'),_0x1c3f15[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x16')]=function(_0x5e61ac){try{if(this['voiceQueues'][_0x5e61ac['queue']]&&(this[_0xdac9('0x8')][_0x5e61ac['queue']]['acw']||this[_0xdac9('0x8')][_0x5e61ac[_0xdac9('0x2e')]]['mandatoryDisposition'])){if(this['agents'][_0x5e61ac[_0xdac9('0x1b')]]){this[_0xdac9('0xb')][_0x5e61ac[_0xdac9('0x2d')]]={'queue':_0x5e61ac[_0xdac9('0x2e')],'interface':_0x5e61ac[_0xdac9('0x1b')]};}}}catch(_0x2e07bc){logger[_0xdac9('0x33')](_0xdac9('0x41'),_0x2e07bc['message']);}};Acw[_0xdac9('0x39')][_0xdac9('0xe')]=function(_0xfa104f){try{if(this[_0xdac9('0xb')][_0xfa104f[_0xdac9('0x2d')]]&&_[_0xdac9('0x42')](this[_0xdac9('0xb')][_0xfa104f[_0xdac9('0x2d')]][_0xdac9('0x43')])){logger[_0xdac9('0x25')](_0xdac9('0x44'),_0xfa104f[_0xdac9('0x2d')]);this[_0xdac9('0x1a')](_0xfa104f[_0xdac9('0x2d')]);}else if(this['channels'][_0xfa104f['linkedid']]&&_['isUndefined'](this[_0xdac9('0xb')][_0xfa104f[_0xdac9('0x45')]]['attended'])){logger[_0xdac9('0x25')](_0xdac9('0x46'),_0xfa104f[_0xdac9('0x45')]);this['startAcw'](_0xfa104f[_0xdac9('0x45')]);}}catch(_0x9f6e4){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x9f6e4[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x10')]=function(_0x370532){try{if(this[_0xdac9('0xb')][_0x370532[_0xdac9('0x2d')]]&&this[_0xdac9('0xb')][_0x370532[_0xdac9('0x2d')]][_0xdac9('0x43')]){logger[_0xdac9('0x25')](_0xdac9('0x47'),_0x370532[_0xdac9('0x2d')]);this[_0xdac9('0x1a')](_0x370532[_0xdac9('0x2d')]);}else if(this[_0xdac9('0xb')][_0x370532['linkedid']]&&this[_0xdac9('0xb')][_0x370532[_0xdac9('0x45')]][_0xdac9('0x43')]){logger[_0xdac9('0x25')](_0xdac9('0x48'),_0x370532[_0xdac9('0x45')]);this['startAcw'](_0x370532[_0xdac9('0x45')]);}}catch(_0x401ab6){logger[_0xdac9('0x33')](_0xdac9('0x49'),_0x401ab6[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x4a')]=function(_0x243862){try{if(!_[_0xdac9('0x4b')](this['channels'][_0x243862[_0xdac9('0x4c')]])){this[_0xdac9('0x1a')](_0x243862[_0xdac9('0x4c')]);if(this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4d')]]){this[_0xdac9('0xb')][_0x243862['secondtransfereruniqueid']]['attended']=!![];this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4e')]]=this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4d')]];delete this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4d')]];}}else if(!_['isNil'](this['channels'][_0x243862['transfertargetuniqueid']])){this[_0xdac9('0x1a')](_0x243862[_0xdac9('0x4e')]);if(this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4f')]]){this['channels'][_0x243862[_0xdac9('0x4f')]][_0xdac9('0x43')]=!![];this[_0xdac9('0xb')][_0x243862[_0xdac9('0x4c')]]=this[_0xdac9('0xb')][_0x243862['origtransfereruniqueid']];delete this[_0xdac9('0xb')][_0x243862['origtransfereruniqueid']];}}}catch(_0x60b64e){logger['error'](_0xdac9('0x50'),_0x60b64e[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x51')]=function(_0x303008){try{if(this[_0xdac9('0xb')][_0x303008[_0xdac9('0x52')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x303008[_0xdac9('0x52')]));this[_0xdac9('0x1a')](_0x303008[_0xdac9('0x52')]);}else if(this[_0xdac9('0xb')][_0x303008[_0xdac9('0x53')]]){logger[_0xdac9('0x25')](_0xdac9('0x54'),JSON['stringify'](_0x303008[_0xdac9('0x53')]));this['startAcw'](_0x303008['transfererlinkedid']);}}catch(_0x461c96){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x461c96[_0xdac9('0x38')]);}};Acw[_0xdac9('0x39')][_0xdac9('0x12')]=function(_0x55ce14){try{if(this['voiceQueues'][_0x55ce14[_0xdac9('0x2e')]]&&this[_0xdac9('0x8')][_0x55ce14['queue']][_0xdac9('0x55')]===_0xdac9('0x56')){if(this[_0xdac9('0x9')][_0x55ce14[_0xdac9('0x1b')]]){logger[_0xdac9('0x25')](_0xdac9('0x57'),_0x55ce14[_0xdac9('0x2d')],_0x55ce14[_0xdac9('0x1b')],_0x55ce14[_0xdac9('0x2e')]);return RpcUser[_0xdac9('0x58')](this[_0xdac9('0x9')][_0x55ce14[_0xdac9('0x1b')]],'Auto-Pause',_0x55ce14[_0xdac9('0x2d')]);}}}catch(_0x4df310){logger[_0xdac9('0x33')](_0xdac9('0x59'),_0x4df310['message']);}};module[_0xdac9('0x5a')]=Acw; \ No newline at end of file +var _0xd0bb=['name','mandatoryDispositionPause','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','mandatoryDisposition'];(function(_0xd2c1db,_0x45c577){var _0x163f15=function(_0x1713c5){while(--_0x1713c5){_0xd2c1db['push'](_0xd2c1db['shift']());}};_0x163f15(++_0x45c577);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xd0bb[_0x2b1bb9];return _0x59f401;};'use strict';var util=require(_0xbd0b('0x0'));var _=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var ami=require('../ami');var logger=require(_0xbd0b('0x3'))('acw');var RpcUser=require(_0xbd0b('0x4'));var RpcVoiceAgentReport=require(_0xbd0b('0x5'));function Acw(_0x53e6ce){this[_0xbd0b('0x6')]=_0x53e6ce['voiceQueues'];this[_0xbd0b('0x7')]=_0x53e6ce[_0xbd0b('0x7')];this[_0xbd0b('0x8')]=_0x53e6ce[_0xbd0b('0x8')];this[_0xbd0b('0x9')]={};ami['on']('agentconnect',this[_0xbd0b('0xa')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xc'),this[_0xbd0b('0xd')][_0xbd0b('0xb')](this));ami['on']('hangup',this['syncHangup'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xe'),this['syncAgentRingNoAnswer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xf'),this['syncAttendedTransfer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x10'),this[_0xbd0b('0x11')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x12'),this[_0xbd0b('0x13')][_0xbd0b('0xb')](this));}function getDiff(_0x1f25b6){var _0x1a55ab=moment()[_0xbd0b('0x14')](0x0);var _0x2d4664=moment(_0x1f25b6)['milliseconds'](0x0);return _0x1a55ab[_0xbd0b('0x15')](_0x2d4664,'seconds');}Acw['prototype'][_0xbd0b('0x16')]=function(_0x4c0e52){try{var _0x3183cf=this;var _0x40b075=this[_0xbd0b('0x9')][_0x4c0e52]['interface'];var _0x55e0a1=this[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x17')];var _0x1f2a6e=this[_0xbd0b('0x6')][_0x55e0a1];var _0x1c0a7c=![];var _0x40b798='ACW';if(_0x1f2a6e[_0xbd0b('0x18')]){if(_0x1f2a6e['mandatoryDispositionPause'][_0xbd0b('0x19')]){_0x1c0a7c=!![];_0x40b798=_0x1f2a6e[_0xbd0b('0x1a')][_0xbd0b('0x19')];}}ami[_0xbd0b('0x1b')]({'action':'QueuePause','interface':_0x40b075,'paused':!![],'reason':_0x40b798})[_0xbd0b('0x1c')](function(_0x38c27f){if(_0x3183cf[_0xbd0b('0x7')][_0x40b075]){return RpcUser['getAgent'](_0x3183cf[_0xbd0b('0x7')][_0x40b075]['id'])['then'](function(_0xc66b8){if(_0xc66b8&&!_0xc66b8[_0xbd0b('0x1d')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x4c0e52,_0x40b075,_0x55e0a1);var _0x297c85=_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x20')]&&_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x21')]?_0x3183cf[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x21')]:_0x4c0e52;return RpcUser[_0xbd0b('0x22')](_0x3183cf[_0xbd0b('0x7')][_0x40b075],_0x40b798,_0x297c85)[_0xbd0b('0x1c')](function(_0x4fe9ed){if(!_0x1c0a7c){_0x3183cf[_0xbd0b('0x8')][_0x40b075]={};logger[_0xbd0b('0x1e')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);_0x3183cf[_0xbd0b('0x8')][_0x40b075]['timer']=setTimeout(_0x3183cf[_0xbd0b('0x25')][_0xbd0b('0xb')](_0x3183cf,_0x40b075),_0x3183cf[_0xbd0b('0x6')][_0x55e0a1]['acwTimeout']*0x3e8);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x26')]=moment()[_0xbd0b('0x27')](_0xbd0b('0x28'));_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')]=_0x4c0e52;_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x17')]=_0x55e0a1;_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2a')]=function(){var _0x3b70b4=getDiff(_0x3183cf['timers'][_0x40b075]['lastPauseAt']);clearTimeout(_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x2b')]);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2b')]=![];RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x3b70b4},_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')],_0x40b075)[_0xbd0b('0x1c')](function(_0x27c478){logger['info'](_0xbd0b('0x2d'),_0x4c0e52,_0x3b70b4,_0x27c478);})[_0xbd0b('0x2e')](function(_0x32572e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x4c0e52,_0x32572e);});delete _0x3183cf[_0xbd0b('0x8')][_0x40b075];};}});}else{logger[_0xbd0b('0x1e')](_0xbd0b('0x31'),_0x4c0e52,_0x40b075,_0x55e0a1);}});}})[_0xbd0b('0x2e')](function(_0x3ac75f){logger[_0xbd0b('0x2f')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);})['finally'](function(){delete _0x3183cf[_0xbd0b('0x9')][_0x4c0e52];});}catch(_0x23b0fa){logger['error'](_0xbd0b('0x32'),_0x23b0fa[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x25')]=function(_0x27ad8b){try{var _0x288715=this;if(_0x288715['timers'][_0x27ad8b]){_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x2b')]=![];var _0x3b5098=_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x29')];var _0x47c961=_0x288715['timers'][_0x27ad8b][_0xbd0b('0x17')];var _0x8db305=_0x288715[_0xbd0b('0x6')][_0x47c961][_0xbd0b('0x24')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x27ad8b);RpcUser[_0xbd0b('0x35')](this['agents'][_0x27ad8b]);RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x8db305,'agentacw':!![]},_0x3b5098,_0x27ad8b)[_0xbd0b('0x1c')](function(_0x3f34dc){logger[_0xbd0b('0x1e')](_0xbd0b('0x2d'),_0x3b5098,_0x8db305,_0x3f34dc);})[_0xbd0b('0x2e')](function(_0x43115e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x3b5098,_0x43115e);});}else{logger[_0xbd0b('0x2f')](_0xbd0b('0x36'),_0x27ad8b);if(_0x288715[_0xbd0b('0x8')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x37'),JSON[_0xbd0b('0x38')](_0x288715[_0xbd0b('0x8')]));}}}catch(_0x16c77c){logger[_0xbd0b('0x2f')]('[ACW][STOP]\x20%s',_0x16c77c[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xa')]=function(_0x3f4d9b){try{if(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x18')])){if(this['agents'][_0x3f4d9b[_0xbd0b('0x3a')]]){this['channels'][_0x3f4d9b['uniqueid']]={'queue':_0x3f4d9b[_0xbd0b('0x17')],'interface':_0x3f4d9b[_0xbd0b('0x3a')],'destlinkedid':_0x3f4d9b[_0xbd0b('0x21')]};}}}catch(_0x580fa2){logger[_0xbd0b('0x2f')](_0xbd0b('0x3b'),_0x580fa2[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x13')]=function(_0x4f1e3a){try{if(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x4f1e3a['queue']][_0xbd0b('0x18')])){if(this[_0xbd0b('0x7')][_0x4f1e3a[_0xbd0b('0x3a')]]){this[_0xbd0b('0x9')][_0x4f1e3a[_0xbd0b('0x29')]]={'queue':_0x4f1e3a[_0xbd0b('0x17')],'interface':_0x4f1e3a[_0xbd0b('0x3a')]};}}}catch(_0x563c64){logger[_0xbd0b('0x2f')](_0xbd0b('0x3c'),_0x563c64[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xd')]=function(_0x30f77e){try{if(this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]]&&_[_0xbd0b('0x3d')](this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]][_0xbd0b('0x20')])){logger[_0xbd0b('0x1e')](_0xbd0b('0x3e'),_0x30f77e[_0xbd0b('0x29')]);this['startAcw'](_0x30f77e[_0xbd0b('0x29')]);}else if(this[_0xbd0b('0x9')][_0x30f77e['linkedid']]&&_['isUndefined'](this['channels'][_0x30f77e[_0xbd0b('0x3f')]]['attended'])){logger[_0xbd0b('0x1e')](_0xbd0b('0x40'),_0x30f77e[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x30f77e['linkedid']);}}catch(_0x2d2e58){logger['error'](_0xbd0b('0x41'),_0x2d2e58['message']);}};Acw['prototype'][_0xbd0b('0x42')]=function(_0x22f741){try{if(this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22f741['uniqueid']);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x29')]);}else if(this['channels'][_0x22f741['linkedid']]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x3f')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x22f741[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x3f')]);}}catch(_0x183029){logger['error'](_0xbd0b('0x43'),_0x183029[_0xbd0b('0x33')]);}};Acw['prototype'][_0xbd0b('0x44')]=function(_0x1ea443){try{if(!_[_0xbd0b('0x45')](this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x46')]);if(this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']]){this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x47')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x48')]]=this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']];delete this['channels'][_0x1ea443[_0xbd0b('0x47')]];}}else if(!_[_0xbd0b('0x45')](this['channels'][_0x1ea443[_0xbd0b('0x48')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x48')]);if(this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]]){this['channels'][_0x1ea443[_0xbd0b('0x49')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]]=this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];delete this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];}}}catch(_0x429534){logger[_0xbd0b('0x2f')](_0xbd0b('0x4a'),_0x429534[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x11')]=function(_0x164a2e){try{if(this[_0xbd0b('0x9')][_0x164a2e[_0xbd0b('0x4b')]]){logger['info'](_0xbd0b('0x4c'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4b')]));this[_0xbd0b('0x16')](_0x164a2e['transfereruniqueid']);}else if(this['channels'][_0x164a2e[_0xbd0b('0x4d')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x4e'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4d')]));this['startAcw'](_0x164a2e[_0xbd0b('0x4d')]);}}catch(_0x4d3664){logger[_0xbd0b('0x2f')](_0xbd0b('0x4f'),_0x4d3664[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x50')]=function(_0x463db8){try{if(this['voiceQueues'][_0x463db8[_0xbd0b('0x17')]]&&this[_0xbd0b('0x6')][_0x463db8[_0xbd0b('0x17')]][_0xbd0b('0x51')]==='all'){if(this[_0xbd0b('0x7')][_0x463db8[_0xbd0b('0x3a')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x52'),_0x463db8[_0xbd0b('0x29')],_0x463db8['interface'],_0x463db8['queue']);return RpcUser[_0xbd0b('0x22')](this['agents'][_0x463db8[_0xbd0b('0x3a')]],_0xbd0b('0x53'),_0x463db8[_0xbd0b('0x29')]);}}}catch(_0x1876ae){logger[_0xbd0b('0x2f')](_0xbd0b('0x54'),_0x1876ae['message']);}};module[_0xbd0b('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 70d2e93..95a698d 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 _0x6488=['fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionQueueSummary','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionSipPeerStatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x2cebcf,_0x43eeba){var _0x38b76e=function(_0x2084ea){while(--_0x2084ea){_0x2cebcf['push'](_0x2cebcf['shift']());}};_0x38b76e(++_0x43eeba);}(_0x6488,0x1c1));var _0x8648=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x6488[_0x1a5946];return _0x25e9d5;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x8648('0x0'));var moment=require(_0x8648('0x1'));var util=require(_0x8648('0x2'));var _=require(_0x8648('0x3'));var logger=require(_0x8648('0x4'))('ami');var config=require(_0x8648('0x5'));var ami=new Manager(config[_0x8648('0x6')][_0x8648('0x7')],config[_0x8648('0x6')]['ip'],config['asterisk'][_0x8648('0x8')],config[_0x8648('0x6')][_0x8648('0x9')],!![]);ami[_0x8648('0xa')]();ami[_0x8648('0xb')]=BPromise[_0x8648('0xc')](ami[_0x8648('0xd')]);function error(_0x1faac0){logger[_0x8648('0xe')](util[_0x8648('0xf')](_0x8648('0x10'),config[_0x8648('0x6')][_0x8648('0x8')],config[_0x8648('0x6')]['ip'],config['asterisk']['port'],util[_0x8648('0x11')](_0x1faac0,![],null)));}function close(){logger['error'](util[_0x8648('0xf')](_0x8648('0x12'),config[_0x8648('0x6')][_0x8648('0x8')],config[_0x8648('0x6')]['ip'],config[_0x8648('0x6')][_0x8648('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x8648('0xb')]({'action':_0x8648('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x8648('0xb')]({'action':'devicestatelist'});};};ami[_0x8648('0x14')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x8648('0xb')]({'action':_0x8648('0x15')});};};ami[_0x8648('0x16')]=function(){return function(){return ami[_0x8648('0xb')]({'action':_0x8648('0x17')});};};function connect(_0xb57c7){logger[_0x8648('0x18')](util['format'](_0x8648('0x19'),config[_0x8648('0x6')][_0x8648('0x8')],config[_0x8648('0x6')]['ip'],config[_0x8648('0x6')][_0x8648('0x7')]));ami[_0x8648('0x1a')](_0x8648('0xe'),error);ami['once'](_0x8648('0x1b'),close);}ami['on'](_0x8648('0x1c'),connect);ami['on'](_0x8648('0x1d'),function(_0x313970){logger['info'](util[_0x8648('0xf')](_0x8648('0x1e'),config['asterisk'][_0x8648('0x8')],config['asterisk']['ip'],config[_0x8648('0x6')]['port'],util[_0x8648('0x11')](_0x313970,![],null)));});ami['on'](_0x8648('0x1f'),function(_0x185046){logger[_0x8648('0x18')](util[_0x8648('0xf')](_0x8648('0x20'),config[_0x8648('0x6')][_0x8648('0x8')],config[_0x8648('0x6')]['ip'],config[_0x8648('0x6')][_0x8648('0x7')]));return BPromise[_0x8648('0x21')]()[_0x8648('0x22')](ami[_0x8648('0x23')]())[_0x8648('0x22')](ami['actionDeviceStateList']())[_0x8648('0x22')](ami[_0x8648('0x14')]())[_0x8648('0x22')](ami[_0x8648('0x24')]())[_0x8648('0x22')](ami[_0x8648('0x16')]())[_0x8648('0x25')](function(_0x359374){console[_0x8648('0x26')](_0x359374);});});ami[_0x8648('0x1a')]('error',error);ami[_0x8648('0x1a')]('close',close);module[_0x8648('0x27')]=ami; \ No newline at end of file +var _0x8b6a=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','asterisk-manager','bluebird','moment','util','../../config/logger','../../config/environment','asterisk','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus'];(function(_0x1ed742,_0x50ede7){var _0xb08df8=function(_0x5459b9){while(--_0x5459b9){_0x1ed742['push'](_0x1ed742['shift']());}};_0xb08df8(++_0x50ede7);}(_0x8b6a,0x9d));var _0xa8b6=function(_0x103480,_0x8f48fc){_0x103480=_0x103480-0x0;var _0x5d23f6=_0x8b6a[_0x103480];return _0x5d23f6;};'use strict';var Manager=require(_0xa8b6('0x0'));var BPromise=require(_0xa8b6('0x1'));var moment=require(_0xa8b6('0x2'));var util=require(_0xa8b6('0x3'));var _=require('lodash');var logger=require(_0xa8b6('0x4'))('ami');var config=require(_0xa8b6('0x5'));var ami=new Manager(config[_0xa8b6('0x6')]['port'],config[_0xa8b6('0x6')]['ip'],config[_0xa8b6('0x6')][_0xa8b6('0x7')],config['asterisk']['password'],!![]);ami[_0xa8b6('0x8')]();ami[_0xa8b6('0x9')]=BPromise[_0xa8b6('0xa')](ami[_0xa8b6('0xb')]);function error(_0x4ad1e2){logger[_0xa8b6('0xc')](util[_0xa8b6('0xd')](_0xa8b6('0xe'),config['asterisk']['username'],config[_0xa8b6('0x6')]['ip'],config[_0xa8b6('0x6')][_0xa8b6('0xf')],util[_0xa8b6('0x10')](_0x4ad1e2,![],null)));}function close(){logger[_0xa8b6('0xc')](util['format'](_0xa8b6('0x11'),config['asterisk'][_0xa8b6('0x7')],config[_0xa8b6('0x6')]['ip'],config[_0xa8b6('0x6')][_0xa8b6('0xf')]));}ami[_0xa8b6('0x12')]=function(){return function(){return ami[_0xa8b6('0x9')]({'action':_0xa8b6('0x13')});};};ami[_0xa8b6('0x14')]=function(){return function(){return ami[_0xa8b6('0x9')]({'action':_0xa8b6('0x15')});};};ami[_0xa8b6('0x16')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xa8b6('0x17')]=function(){return function(){return ami[_0xa8b6('0x9')]({'action':_0xa8b6('0x18')});};};ami[_0xa8b6('0x19')]=function(){return function(){return ami[_0xa8b6('0x9')]({'action':_0xa8b6('0x1a')});};};function connect(_0x110476){logger['info'](util[_0xa8b6('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa8b6('0x6')]['ip'],config[_0xa8b6('0x6')][_0xa8b6('0xf')]));ami[_0xa8b6('0x1b')](_0xa8b6('0xc'),error);ami[_0xa8b6('0x1b')](_0xa8b6('0x1c'),close);}ami['on'](_0xa8b6('0x1d'),connect);ami['on']('shutdown',function(_0x318437){logger[_0xa8b6('0x1e')](util[_0xa8b6('0xd')](_0xa8b6('0x1f'),config[_0xa8b6('0x6')]['username'],config[_0xa8b6('0x6')]['ip'],config['asterisk'][_0xa8b6('0xf')],util[_0xa8b6('0x10')](_0x318437,![],null)));});ami['on'](_0xa8b6('0x20'),function(_0x422762){logger[_0xa8b6('0x1e')](util[_0xa8b6('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xa8b6('0x6')][_0xa8b6('0x7')],config[_0xa8b6('0x6')]['ip'],config[_0xa8b6('0x6')][_0xa8b6('0xf')]));return BPromise[_0xa8b6('0x21')]()[_0xa8b6('0x22')](ami[_0xa8b6('0x12')]())['then'](ami[_0xa8b6('0x14')]())[_0xa8b6('0x22')](ami[_0xa8b6('0x16')]())['then'](ami[_0xa8b6('0x17')]())[_0xa8b6('0x22')](ami[_0xa8b6('0x19')]())[_0xa8b6('0x23')](function(_0x4bcf42){console['log'](_0x4bcf42);});});ami['once']('error',error);ami[_0xa8b6('0x1b')](_0xa8b6('0x1c'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8c3f708..cd5654a 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 _0x4eb9=['message','result','catch','jayson/promise','bluebird','../../config/logger','client','http','request','then','debug','rpc','error','memberReport'];(function(_0x42b049,_0x1a528b){var _0xaecab4=function(_0x31962a){while(--_0x31962a){_0x42b049['push'](_0x42b049['shift']());}};_0xaecab4(++_0x1a528b);}(_0x4eb9,0x1a7));var _0x94eb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x4eb9[_0x4243a3];return _0x1b2a33;};'use strict';var jayson=require(_0x94eb('0x0'));var BPromise=require(_0x94eb('0x1'));var logger=require(_0x94eb('0x2'))('ami');var client=jayson[_0x94eb('0x3')][_0x94eb('0x4')]({'port':0x2329});client['Request']=function(_0x4ad10f,_0x139ad8){return new BPromise(function(_0x155be9,_0x3d6c7b){return client[_0x94eb('0x5')](_0x4ad10f,_0x139ad8)[_0x94eb('0x6')](function(_0x5f9247){logger[_0x94eb('0x7')](_0x94eb('0x8'),'memberReport',_0x4ad10f,_0x139ad8,_0x5f9247);if(_0x5f9247['error']){logger[_0x94eb('0x9')]('rpc',_0x94eb('0xa'),_0x4ad10f,_0x5f9247['error'][_0x94eb('0xb')],_0x139ad8);return _0x3d6c7b(_0x5f9247['error']['message']);}else{return _0x155be9(_0x5f9247[_0x94eb('0xc')]);}})[_0x94eb('0xd')](function(_0x4f0c16){logger[_0x94eb('0x9')](_0x94eb('0x8'),_0x94eb('0xa'),_0x4ad10f,_0x4f0c16,_0x139ad8);return _0x3d6c7b(_0x4f0c16);});});};module['exports']=client; \ No newline at end of file +var _0x412b=['catch','../../config/logger','client','http','Request','request','rpc','memberReport','error','message','result'];(function(_0x5ebacc,_0x24d8fe){var _0xf55b4e=function(_0x419259){while(--_0x419259){_0x5ebacc['push'](_0x5ebacc['shift']());}};_0xf55b4e(++_0x24d8fe);}(_0x412b,0x1ae));var _0xb412=function(_0x41bf04,_0x293040){_0x41bf04=_0x41bf04-0x0;var _0x665e75=_0x412b[_0x41bf04];return _0x665e75;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xb412('0x0'))('ami');var client=jayson[_0xb412('0x1')][_0xb412('0x2')]({'port':0x2329});client[_0xb412('0x3')]=function(_0x3612d5,_0x2a62b9){return new BPromise(function(_0x1905fb,_0x1a80f4){return client[_0xb412('0x4')](_0x3612d5,_0x2a62b9)['then'](function(_0x1795a5){logger['debug'](_0xb412('0x5'),_0xb412('0x6'),_0x3612d5,_0x2a62b9,_0x1795a5);if(_0x1795a5[_0xb412('0x7')]){logger['error'](_0xb412('0x5'),_0xb412('0x6'),_0x3612d5,_0x1795a5['error'][_0xb412('0x8')],_0x2a62b9);return _0x1a80f4(_0x1795a5[_0xb412('0x7')]['message']);}else{return _0x1905fb(_0x1795a5[_0xb412('0x9')]);}})[_0xb412('0xa')](function(_0xdbccdd){logger['error'](_0xb412('0x5'),_0xb412('0x6'),_0x3612d5,_0xdbccdd,_0x2a62b9);return _0x1a80f4(_0xdbccdd);});});};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 74eb668..e5f3fd5 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 _0x876b=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','moment','isNil','string','voiceQueue','name','Contact','phone','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','callback','callbackuniqueid','callbackat'];(function(_0x553cf9,_0x2b5559){var _0x533a5d=function(_0x51fbb0){while(--_0x51fbb0){_0x553cf9['push'](_0x553cf9['shift']());}};_0x533a5d(++_0x2b5559);}(_0x876b,0x1ba));var _0xb876=function(_0xd864eb,_0x5f14fc){_0xd864eb=_0xd864eb-0x0;var _0x46cf86=_0x876b[_0xd864eb];return _0x46cf86;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb876('0x0'));function checkNameSurname(_0x11fc80,_0x5c6895,_0x569fc2){var _0x34a150='';if(!_[_0xb876('0x1')](_0x5c6895)&&'string'===typeof _0x5c6895){_0x34a150+=_0x5c6895;}if(!_[_0xb876('0x1')](_0x569fc2)&&_0xb876('0x2')===typeof _0x569fc2){_0x34a150+='\x20'+_0x569fc2;}if(_0x34a150!==''){return _0x34a150;}return _0x11fc80;}function Action(_0x19baec,_0x5e1da8,_0x275125){this[_0xb876('0x3')]=_0x19baec;this['uniqueid']=_0x275125||undefined;this[_0xb876('0x4')]=checkNameSurname(_0x5e1da8[_0xb876('0x5')][_0xb876('0x6')],_0x5e1da8[_0xb876('0x5')]['firstName'],_0x5e1da8[_0xb876('0x5')]['lastName']);this[_0xb876('0x7')]=_0x5e1da8[_0xb876('0x5')]['phone'];this['queue']=_0x19baec['name'];this[_0xb876('0x8')]=_0x5e1da8['active']||![];this[_0xb876('0x9')]=_0x19baec[_0xb876('0x9')];this['dialQueueTimeout']=_0x19baec[_0xb876('0xa')]||0x3;this[_0xb876('0xb')]=_0x5e1da8[_0xb876('0xb')];this[_0xb876('0xc')]=_0x5e1da8[_0xb876('0xc')];this[_0xb876('0xd')]=_0x5e1da8[_0xb876('0xd')];this[_0xb876('0xe')]=_0x5e1da8[_0xb876('0xe')];this[_0xb876('0xf')]=_0x5e1da8[_0xb876('0xf')];this[_0xb876('0x10')]=_0x5e1da8['countdropretry'];this[_0xb876('0x11')]=_0x5e1da8[_0xb876('0x11')];this[_0xb876('0x12')]=_0x5e1da8[_0xb876('0x12')];this[_0xb876('0x13')]=_0x5e1da8[_0xb876('0x13')];this['ContactId']=_0x5e1da8[_0xb876('0x14')];this[_0xb876('0x15')]=_0x5e1da8['ListId'];this['UserId']=_0x5e1da8[_0xb876('0x16')];this[_0xb876('0x17')]=_0x5e1da8[_0xb876('0x17')];this['CampaignId']=_0x5e1da8[_0xb876('0x18')];this[_0xb876('0x19')]=_0x5e1da8['id'];this[_0xb876('0x1a')]=_0x5e1da8[_0xb876('0x5')][_0xb876('0x1b')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xb876('0x1c')]=_0x5e1da8[_0xb876('0x1c')];this[_0xb876('0x1d')]=_0x5e1da8[_0xb876('0x1d')];this['callbackat']=_0x5e1da8[_0xb876('0x1e')];this[_0xb876('0x1f')]=_0x5e1da8[_0xb876('0x1f')];this[_0xb876('0x20')]='';this[_0xb876('0x21')]='';}Action[_0xb876('0x22')][_0xb876('0x23')]=function(){return util[_0xb876('0x24')](_0xb876('0x25'),this[_0xb876('0x4')],this[_0xb876('0x3')][_0xb876('0x26')]>0x0?this[_0xb876('0x7')][_0xb876('0x27')](this[_0xb876('0x3')][_0xb876('0x26')]):this[_0xb876('0x7')]);};Action['prototype'][_0xb876('0x28')]=function(){return this[_0xb876('0x29')];};module[_0xb876('0x2a')]=Action; \ No newline at end of file +var _0xaac0=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaac0,0x10c));var _0x0aac=function(_0x5ade35,_0x35cec6){_0x5ade35=_0x5ade35-0x0;var _0x21d317=_0xaac0[_0x5ade35];return _0x21d317;};'use strict';var util=require(_0x0aac('0x0'));var _=require(_0x0aac('0x1'));var moment=require('moment');function checkNameSurname(_0x42ad46,_0x1aa866,_0x348570){var _0x5bfdc7='';if(!_[_0x0aac('0x2')](_0x1aa866)&&'string'===typeof _0x1aa866){_0x5bfdc7+=_0x1aa866;}if(!_[_0x0aac('0x2')](_0x348570)&&_0x0aac('0x3')===typeof _0x348570){_0x5bfdc7+='\x20'+_0x348570;}if(_0x5bfdc7!==''){return _0x5bfdc7;}return _0x42ad46;}function Action(_0x524c40,_0x31c5f4,_0x45c2e0){this[_0x0aac('0x4')]=_0x524c40;this[_0x0aac('0x5')]=_0x45c2e0||undefined;this[_0x0aac('0x6')]=checkNameSurname(_0x31c5f4[_0x0aac('0x7')][_0x0aac('0x8')],_0x31c5f4['Contact']['firstName'],_0x31c5f4['Contact'][_0x0aac('0x9')]);this[_0x0aac('0xa')]=_0x31c5f4[_0x0aac('0x7')]['phone'];this[_0x0aac('0xb')]=_0x524c40[_0x0aac('0x6')];this[_0x0aac('0xc')]=_0x31c5f4['active']||![];this['type']=_0x524c40['type'];this[_0x0aac('0xd')]=_0x524c40['dialQueueTimeout']||0x3;this['scheduledat']=_0x31c5f4[_0x0aac('0xe')];this[_0x0aac('0xf')]=_0x31c5f4['countbusyretry'];this[_0x0aac('0x10')]=_0x31c5f4[_0x0aac('0x10')];this[_0x0aac('0x11')]=_0x31c5f4[_0x0aac('0x11')];this[_0x0aac('0x12')]=_0x31c5f4[_0x0aac('0x12')];this[_0x0aac('0x13')]=_0x31c5f4[_0x0aac('0x13')];this[_0x0aac('0x14')]=_0x31c5f4[_0x0aac('0x14')];this[_0x0aac('0x15')]=_0x31c5f4[_0x0aac('0x15')];this[_0x0aac('0x16')]=_0x31c5f4[_0x0aac('0x16')];this['ContactId']=_0x31c5f4['ContactId'];this[_0x0aac('0x17')]=_0x31c5f4['ListId'];this[_0x0aac('0x18')]=_0x31c5f4[_0x0aac('0x18')];this[_0x0aac('0x19')]=_0x31c5f4[_0x0aac('0x19')];this['CampaignId']=_0x31c5f4[_0x0aac('0x1a')];this[_0x0aac('0x1b')]=_0x31c5f4['id'];this[_0x0aac('0x1c')]=_0x31c5f4['Contact'][_0x0aac('0x1d')]||'';this[_0x0aac('0x1e')]=moment()['format'](_0x0aac('0x1f'));this['callback']=_0x31c5f4['callback'];this[_0x0aac('0x20')]=_0x31c5f4[_0x0aac('0x20')];this[_0x0aac('0x21')]=_0x31c5f4[_0x0aac('0x21')];this['recallme']=_0x31c5f4[_0x0aac('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x0aac('0x23')][_0x0aac('0x24')]=function(){return util[_0x0aac('0x25')](_0x0aac('0x26'),this[_0x0aac('0x6')],this[_0x0aac('0x4')]['dialCutDigit']>0x0?this[_0x0aac('0xa')][_0x0aac('0x27')](this['voiceQueue'][_0x0aac('0x28')]):this[_0x0aac('0xa')]);};Action['prototype']['getQueue']=function(){return this[_0x0aac('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index b56a8a2..56fec63 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa90f=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa90f,0x17c));var _0xfa90=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0xa90f[_0x5a69ab];return _0x27f2f7;};'use strict';var util=require(_0xfa90('0x0'));var _=require(_0xfa90('0x1'));var moment=require(_0xfa90('0x2'));function getSeconds(_0x576575,_0x540d9a){var _0x3943c4=moment(_0x576575)[_0xfa90('0x3')](0x0);var _0x4565fe=moment(_0x540d9a)['milliseconds'](0x0);return _0x3943c4[_0xfa90('0x4')](_0x4565fe,'seconds');}function AdditionalPhone(_0x262519){this[_0xfa90('0x5')]=_0x262519['uniqueid'];this[_0xfa90('0x6')]=_0x262519['scheduledat']||undefined;this[_0xfa90('0x7')]=_0x262519[_0xfa90('0x7')];this[_0xfa90('0x8')]=_0x262519[_0xfa90('0x7')]===_0xfa90('0x9')?_0xfa90('0xa'):_0x262519[_0xfa90('0x7')];this[_0xfa90('0xb')]=_0x262519[_0xfa90('0xb')];this['countcongestionretry']=_0x262519[_0xfa90('0xc')];this['countnoanswerretry']=_0x262519[_0xfa90('0xd')];this[_0xfa90('0xe')]=_0x262519[_0xfa90('0xb')]+_0x262519['countcongestionretry']+_0x262519[_0xfa90('0xd')]+_0x262519['countnosuchnumberretry']+_0x262519[_0xfa90('0xf')]+_0x262519[_0xfa90('0x10')]+_0x262519[_0xfa90('0x11')]+_0x262519[_0xfa90('0x12')];this[_0xfa90('0x13')]=_0x262519[_0xfa90('0x13')];this['countdropretry']=_0x262519[_0xfa90('0xf')];this[_0xfa90('0x10')]=_0x262519[_0xfa90('0x10')];this[_0xfa90('0x11')]=_0x262519[_0xfa90('0x11')];this[_0xfa90('0x12')]=_0x262519[_0xfa90('0x12')];this[_0xfa90('0xa')]=_0x262519[_0xfa90('0xa')];this[_0xfa90('0x14')]=_0x262519[_0xfa90('0x15')];this[_0xfa90('0x16')]=_0x262519['number'];this['starttime']=_0x262519[_0xfa90('0x17')];this[_0xfa90('0x18')]=_0x262519[_0xfa90('0x18')];this[_0xfa90('0x19')]=_0x262519[_0xfa90('0x18')];this[_0xfa90('0x1a')]=getSeconds(_0x262519[_0xfa90('0x18')],_0x262519[_0xfa90('0x17')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0xfa90('0x1b')]=_0x262519[_0xfa90('0x1b')];this['callbackuniqueid']=_0x262519[_0xfa90('0x1c')];this[_0xfa90('0x1d')]=_0x262519[_0xfa90('0x1d')];this[_0xfa90('0x1e')]=_0x262519[_0xfa90('0x1e')];this[_0xfa90('0x1f')]=_0x262519[_0xfa90('0x1f')];this[_0xfa90('0x20')]=_0x262519[_0xfa90('0x20')];this[_0xfa90('0x21')]=_0x262519[_0xfa90('0x21')];this[_0xfa90('0x22')]=_0x262519[_0xfa90('0x22')];this['CampaignId']=_0x262519[_0xfa90('0x23')];this[_0xfa90('0x24')]=_0x262519['originatecalleridnum']||'';this['originatecalleridname']=_0x262519[_0xfa90('0x25')]||'';}module[_0xfa90('0x26')]=History; \ No newline at end of file +var _0x8f9e=['callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countdropretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x322d30,_0x1c20f5){var _0x129079=function(_0x2a98f1){while(--_0x2a98f1){_0x322d30['push'](_0x322d30['shift']());}};_0x129079(++_0x1c20f5);}(_0x8f9e,0xb7));var _0xe8f9=function(_0x26297c,_0x25e593){_0x26297c=_0x26297c-0x0;var _0x47c4c1=_0x8f9e[_0x26297c];return _0x47c4c1;};'use strict';var util=require(_0xe8f9('0x0'));var _=require(_0xe8f9('0x1'));var moment=require('moment');function getSeconds(_0x54d39c,_0x314e63){var _0x5bf3aa=moment(_0x54d39c)['milliseconds'](0x0);var _0x3b3688=moment(_0x314e63)[_0xe8f9('0x2')](0x0);return _0x5bf3aa[_0xe8f9('0x3')](_0x3b3688,_0xe8f9('0x4'));}function AdditionalPhone(_0x231a5f){this[_0xe8f9('0x5')]=_0x231a5f[_0xe8f9('0x5')];this[_0xe8f9('0x6')]=_0x231a5f[_0xe8f9('0x6')]||undefined;this[_0xe8f9('0x7')]=_0x231a5f[_0xe8f9('0x7')];this['campaigntype']=_0x231a5f[_0xe8f9('0x7')]===_0xe8f9('0x8')?_0xe8f9('0x9'):_0x231a5f['type'];this[_0xe8f9('0xa')]=_0x231a5f[_0xe8f9('0xa')];this[_0xe8f9('0xb')]=_0x231a5f[_0xe8f9('0xb')];this['countnoanswerretry']=_0x231a5f['countnoanswerretry'];this[_0xe8f9('0xc')]=_0x231a5f[_0xe8f9('0xa')]+_0x231a5f[_0xe8f9('0xb')]+_0x231a5f['countnoanswerretry']+_0x231a5f['countnosuchnumberretry']+_0x231a5f[_0xe8f9('0xd')]+_0x231a5f[_0xe8f9('0xe')]+_0x231a5f[_0xe8f9('0xf')]+_0x231a5f['countagentrejectretry'];this['countnosuchnumberretry']=_0x231a5f['countnosuchnumberretry'];this[_0xe8f9('0xd')]=_0x231a5f[_0xe8f9('0xd')];this[_0xe8f9('0xe')]=_0x231a5f[_0xe8f9('0xe')];this[_0xe8f9('0xf')]=_0x231a5f[_0xe8f9('0xf')];this['countagentrejectretry']=_0x231a5f['countagentrejectretry'];this[_0xe8f9('0x9')]=_0x231a5f[_0xe8f9('0x9')];this[_0xe8f9('0x10')]=_0x231a5f[_0xe8f9('0x11')];this[_0xe8f9('0x12')]=_0x231a5f['number'];this[_0xe8f9('0x13')]=_0x231a5f['starttime'];this['responsetime']=_0x231a5f[_0xe8f9('0x14')];this[_0xe8f9('0x15')]=_0x231a5f[_0xe8f9('0x14')];this[_0xe8f9('0x16')]=getSeconds(_0x231a5f['responsetime'],_0x231a5f[_0xe8f9('0x13')]);this[_0xe8f9('0x17')]=0x0;this[_0xe8f9('0x18')]=0x0;this[_0xe8f9('0x19')]=_0x231a5f['callback'];this[_0xe8f9('0x1a')]=_0x231a5f[_0xe8f9('0x1a')];this[_0xe8f9('0x1b')]=_0x231a5f[_0xe8f9('0x1b')];this['recallme']=_0x231a5f[_0xe8f9('0x1c')];this[_0xe8f9('0x1d')]=_0x231a5f['ContactId'];this['ListId']=_0x231a5f['ListId'];this[_0xe8f9('0x1e')]=_0x231a5f['UserId'];this['VoiceQueueId']=_0x231a5f['VoiceQueueId'];this[_0xe8f9('0x1f')]=_0x231a5f[_0xe8f9('0x1f')];this[_0xe8f9('0x20')]=_0x231a5f['originatecalleridnum']||'';this['originatecalleridname']=_0x231a5f[_0xe8f9('0x21')]||'';}module[_0xe8f9('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 754682b..1891dd3 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 _0x1769=['talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0x1769,0x1f1));var _0x9176=function(_0x3b8885,_0x390f82){_0x3b8885=_0x3b8885-0x0;var _0x3718de=_0x1769[_0x3b8885];return _0x3718de;};'use strict';var util=require(_0x9176('0x0'));var _=require('lodash');var moment=require(_0x9176('0x1'));function getSeconds(_0xb05c01,_0x57b217){var _0x2a50bb=moment(_0xb05c01)[_0x9176('0x2')](0x0);var _0x37e90b=moment(_0x57b217)[_0x9176('0x2')](0x0);return _0x2a50bb[_0x9176('0x3')](_0x37e90b,_0x9176('0x4'));}function AgentComplete(_0x443701,_0x3a34e2){this['state']=0x4;this[_0x9176('0x5')]=_0x9176('0x6');this[_0x9176('0x7')]=_0x443701['scheduledat'];this[_0x9176('0x8')]=_0x443701[_0x9176('0x8')];this[_0x9176('0x9')]=_0x443701[_0x9176('0x8')]===_0x9176('0xa')?_0x9176('0xb'):_0x443701[_0x9176('0x8')];this[_0x9176('0xc')]=_0x443701['countbusyretry'];this[_0x9176('0xd')]=_0x443701[_0x9176('0xd')];this[_0x9176('0xe')]=_0x443701[_0x9176('0xe')];this[_0x9176('0xf')]=_0x443701[_0x9176('0xc')]+_0x443701[_0x9176('0xd')]+_0x443701[_0x9176('0xe')]+_0x443701[_0x9176('0x10')]+_0x443701['countdropretry']+_0x443701[_0x9176('0x11')]+_0x443701[_0x9176('0x12')]+_0x443701[_0x9176('0x13')];this[_0x9176('0x10')]=_0x443701[_0x9176('0x10')];this['countdropretry']=_0x443701['countdropretry'];this[_0x9176('0x11')]=_0x443701['countabandonedretry'];this[_0x9176('0x12')]=_0x443701[_0x9176('0x12')];this[_0x9176('0x13')]=_0x443701['countagentrejectretry'];this[_0x9176('0x14')]=_0x3a34e2['uniqueid'];this[_0x9176('0x15')]=_0x443701['name'];this[_0x9176('0x16')]=_0x443701[_0x9176('0x17')];this[_0x9176('0x18')]=_0x443701[_0x9176('0x18')];this[_0x9176('0x19')]=_0x443701[_0x9176('0x19')];this['answertime']=_0x443701[_0x9176('0x1a')];this[_0x9176('0x1b')]=moment()['format'](_0x9176('0x1c'));this[_0x9176('0x1d')]=getSeconds(_0x443701['responsetime'],_0x443701[_0x9176('0x18')]);this[_0x9176('0x1e')]=getSeconds(_0x443701[_0x9176('0x1a')],_0x443701[_0x9176('0x19')]);this[_0x9176('0x1f')]=getSeconds(this[_0x9176('0x1b')],_0x443701[_0x9176('0x1a')]);this[_0x9176('0xb')]=_0x3a34e2['queue'];this[_0x9176('0x20')]=_0x3a34e2[_0x9176('0x20')];this[_0x9176('0x21')]=_0x3a34e2[_0x9176('0x21')];this[_0x9176('0x22')]=_0x443701[_0x9176('0x22')];this['callbackuniqueid']=_0x443701['callbackuniqueid'];this[_0x9176('0x23')]=_0x443701[_0x9176('0x23')];this[_0x9176('0x24')]=_0x443701['recallme'];this['ContactId']=_0x443701[_0x9176('0x25')];this['ListId']=_0x443701[_0x9176('0x26')];this[_0x9176('0x27')]=_0x443701['UserId'];this[_0x9176('0x28')]=_0x443701[_0x9176('0x28')];this[_0x9176('0x29')]=_0x443701[_0x9176('0x29')];this[_0x9176('0x2a')]=_0x443701['originatecalleridnum']||'';this[_0x9176('0x2b')]=_0x443701[_0x9176('0x2b')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x911e=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x911e,0x8f));var _0xe911=function(_0x275f3a,_0x59f599){_0x275f3a=_0x275f3a-0x0;var _0xe3c45d=_0x911e[_0x275f3a];return _0xe3c45d;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x4d3134,_0x59c2e6){var _0x34efd9=moment(_0x4d3134)[_0xe911('0x0')](0x0);var _0x2dbd37=moment(_0x59c2e6)[_0xe911('0x0')](0x0);return _0x34efd9['diff'](_0x2dbd37,'seconds');}function AgentComplete(_0x4dd970,_0x140706){this[_0xe911('0x1')]=0x4;this[_0xe911('0x2')]=_0xe911('0x3');this[_0xe911('0x4')]=_0x4dd970[_0xe911('0x4')];this[_0xe911('0x5')]=_0x4dd970[_0xe911('0x5')];this['campaigntype']=_0x4dd970[_0xe911('0x5')]===_0xe911('0x6')?_0xe911('0x7'):_0x4dd970[_0xe911('0x5')];this['countbusyretry']=_0x4dd970[_0xe911('0x8')];this[_0xe911('0x9')]=_0x4dd970[_0xe911('0x9')];this[_0xe911('0xa')]=_0x4dd970[_0xe911('0xa')];this[_0xe911('0xb')]=_0x4dd970[_0xe911('0x8')]+_0x4dd970[_0xe911('0x9')]+_0x4dd970[_0xe911('0xa')]+_0x4dd970[_0xe911('0xc')]+_0x4dd970['countdropretry']+_0x4dd970[_0xe911('0xd')]+_0x4dd970[_0xe911('0xe')]+_0x4dd970['countagentrejectretry'];this[_0xe911('0xc')]=_0x4dd970[_0xe911('0xc')];this[_0xe911('0xf')]=_0x4dd970[_0xe911('0xf')];this[_0xe911('0xd')]=_0x4dd970[_0xe911('0xd')];this[_0xe911('0xe')]=_0x4dd970[_0xe911('0xe')];this[_0xe911('0x10')]=_0x4dd970[_0xe911('0x10')];this[_0xe911('0x11')]=_0x140706[_0xe911('0x11')];this[_0xe911('0x12')]=_0x4dd970[_0xe911('0x13')];this[_0xe911('0x14')]=_0x4dd970[_0xe911('0x15')];this[_0xe911('0x16')]=_0x4dd970[_0xe911('0x16')];this[_0xe911('0x17')]=_0x4dd970['responsetime'];this[_0xe911('0x18')]=_0x4dd970['answertime'];this[_0xe911('0x19')]=moment()[_0xe911('0x1a')](_0xe911('0x1b'));this[_0xe911('0x1c')]=getSeconds(_0x4dd970[_0xe911('0x17')],_0x4dd970[_0xe911('0x16')]);this[_0xe911('0x1d')]=getSeconds(_0x4dd970[_0xe911('0x18')],_0x4dd970[_0xe911('0x17')]);this[_0xe911('0x1e')]=getSeconds(this[_0xe911('0x19')],_0x4dd970[_0xe911('0x18')]);this[_0xe911('0x7')]=_0x140706[_0xe911('0x7')];this[_0xe911('0x1f')]=_0x140706[_0xe911('0x1f')];this[_0xe911('0x20')]=_0x140706[_0xe911('0x20')];this[_0xe911('0x21')]=_0x4dd970[_0xe911('0x21')];this['callbackuniqueid']=_0x4dd970[_0xe911('0x22')];this[_0xe911('0x23')]=_0x4dd970[_0xe911('0x23')];this[_0xe911('0x24')]=_0x4dd970[_0xe911('0x24')];this[_0xe911('0x25')]=_0x4dd970[_0xe911('0x25')];this[_0xe911('0x26')]=_0x4dd970[_0xe911('0x26')];this['UserId']=_0x4dd970[_0xe911('0x27')];this['VoiceQueueId']=_0x4dd970[_0xe911('0x28')];this['CampaignId']=_0x4dd970[_0xe911('0x29')];this[_0xe911('0x2a')]=_0x4dd970[_0xe911('0x2a')]||'';this[_0xe911('0x2b')]=_0x4dd970['originatecalleridname']||'';}module[_0xe911('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 256eb8d..29fd57e 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 _0xb5ed=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xb5ed,0x139));var _0xdb5e=function(_0x33680c,_0x17c254){_0x33680c=_0x33680c-0x0;var _0x37f88a=_0xb5ed[_0x33680c];return _0x37f88a;};'use strict';var util=require('util');var _=require(_0xdb5e('0x0'));var moment=require('moment');function getSeconds(_0x2b7f18,_0x4c0f09){var _0x1ef5e2=moment(_0x2b7f18)[_0xdb5e('0x1')](0x0);var _0x5a530b=moment(_0x4c0f09)['milliseconds'](0x0);return _0x1ef5e2[_0xdb5e('0x2')](_0x5a530b,_0xdb5e('0x3'));}function Final(_0x3c2e57){this['uniqueid']=_0x3c2e57['uniqueid'];this[_0xdb5e('0x4')]=_0x3c2e57[_0xdb5e('0x4')];this[_0xdb5e('0x5')]=_0x3c2e57[_0xdb5e('0x5')];this['campaigntype']=_0x3c2e57[_0xdb5e('0x5')]===_0xdb5e('0x6')?'queue':_0x3c2e57[_0xdb5e('0x5')];this[_0xdb5e('0x7')]=_0x3c2e57[_0xdb5e('0x7')];this['countcongestionretry']=_0x3c2e57[_0xdb5e('0x8')];this[_0xdb5e('0x9')]=_0x3c2e57['countnoanswerretry'];this[_0xdb5e('0xa')]=_0x3c2e57[_0xdb5e('0x7')]+_0x3c2e57[_0xdb5e('0x8')]+_0x3c2e57[_0xdb5e('0x9')]+_0x3c2e57[_0xdb5e('0xb')]+_0x3c2e57[_0xdb5e('0xc')]+_0x3c2e57[_0xdb5e('0xd')]+_0x3c2e57[_0xdb5e('0xe')]+_0x3c2e57[_0xdb5e('0xf')];this[_0xdb5e('0xb')]=_0x3c2e57[_0xdb5e('0xb')];this['countdropretry']=_0x3c2e57[_0xdb5e('0xc')];this[_0xdb5e('0xd')]=_0x3c2e57[_0xdb5e('0xd')];this[_0xdb5e('0xe')]=_0x3c2e57[_0xdb5e('0xe')];this[_0xdb5e('0xf')]=_0x3c2e57['countagentrejectretry'];this['queue']=_0x3c2e57['queue'];this[_0xdb5e('0x10')]=_0x3c2e57[_0xdb5e('0x10')];this['calleridnum']=_0x3c2e57[_0xdb5e('0x11')];this['starttime']=_0x3c2e57[_0xdb5e('0x12')];this[_0xdb5e('0x13')]=_0x3c2e57[_0xdb5e('0x13')];this[_0xdb5e('0x14')]=_0x3c2e57['responsetime'];this['ringtime']=_0x3c2e57[_0xdb5e('0x15')]||0x0;this[_0xdb5e('0x16')]=_0x3c2e57[_0xdb5e('0x16')]||0x0;this['talktime']=_0x3c2e57[_0xdb5e('0x17')]||0x0;this[_0xdb5e('0x18')]=_0x3c2e57['callback'];this[_0xdb5e('0x19')]=_0x3c2e57[_0xdb5e('0x19')];this['callbackat']=_0x3c2e57[_0xdb5e('0x1a')];this[_0xdb5e('0x1b')]=_0x3c2e57['recallme'];this[_0xdb5e('0x1c')]=_0x3c2e57[_0xdb5e('0x1c')];this[_0xdb5e('0x1d')]=_0x3c2e57[_0xdb5e('0x1d')];this[_0xdb5e('0x1e')]=_0x3c2e57[_0xdb5e('0x1e')];this['VoiceQueueId']=_0x3c2e57[_0xdb5e('0x1f')];this['CampaignId']=_0x3c2e57[_0xdb5e('0x20')];this[_0xdb5e('0x21')]=_0x3c2e57[_0xdb5e('0x21')]||'';this['originatecalleridname']=_0x3c2e57[_0xdb5e('0x22')]||'';}module[_0xdb5e('0x23')]=Final; \ No newline at end of file +var _0x19d0=['endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime'];(function(_0x1200e9,_0x1a23a4){var _0x2c1ac4=function(_0x1e87e4){while(--_0x1e87e4){_0x1200e9['push'](_0x1200e9['shift']());}};_0x2c1ac4(++_0x1a23a4);}(_0x19d0,0xc1));var _0x019d=function(_0x43efb5,_0x47b68f){_0x43efb5=_0x43efb5-0x0;var _0xfd7d37=_0x19d0[_0x43efb5];return _0xfd7d37;};'use strict';var util=require(_0x019d('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5633a5,_0x3d38bf){var _0x12620b=moment(_0x5633a5)[_0x019d('0x1')](0x0);var _0x3a60b8=moment(_0x3d38bf)['milliseconds'](0x0);return _0x12620b[_0x019d('0x2')](_0x3a60b8,_0x019d('0x3'));}function Final(_0x5c5a81){this[_0x019d('0x4')]=_0x5c5a81['uniqueid'];this[_0x019d('0x5')]=_0x5c5a81['scheduledat'];this[_0x019d('0x6')]=_0x5c5a81[_0x019d('0x6')];this[_0x019d('0x7')]=_0x5c5a81[_0x019d('0x6')]===_0x019d('0x8')?'queue':_0x5c5a81[_0x019d('0x6')];this[_0x019d('0x9')]=_0x5c5a81[_0x019d('0x9')];this[_0x019d('0xa')]=_0x5c5a81[_0x019d('0xa')];this['countnoanswerretry']=_0x5c5a81[_0x019d('0xb')];this[_0x019d('0xc')]=_0x5c5a81['countbusyretry']+_0x5c5a81[_0x019d('0xa')]+_0x5c5a81['countnoanswerretry']+_0x5c5a81['countnosuchnumberretry']+_0x5c5a81[_0x019d('0xd')]+_0x5c5a81['countabandonedretry']+_0x5c5a81[_0x019d('0xe')]+_0x5c5a81[_0x019d('0xf')];this[_0x019d('0x10')]=_0x5c5a81['countnosuchnumberretry'];this[_0x019d('0xd')]=_0x5c5a81['countdropretry'];this[_0x019d('0x11')]=_0x5c5a81[_0x019d('0x11')];this[_0x019d('0xe')]=_0x5c5a81[_0x019d('0xe')];this[_0x019d('0xf')]=_0x5c5a81['countagentrejectretry'];this[_0x019d('0x12')]=_0x5c5a81['queue'];this['calleridname']=_0x5c5a81[_0x019d('0x13')];this[_0x019d('0x14')]=_0x5c5a81[_0x019d('0x14')];this[_0x019d('0x15')]=_0x5c5a81[_0x019d('0x15')];this[_0x019d('0x16')]=_0x5c5a81[_0x019d('0x16')];this[_0x019d('0x17')]=_0x5c5a81[_0x019d('0x16')];this[_0x019d('0x18')]=_0x5c5a81[_0x019d('0x18')]||0x0;this[_0x019d('0x19')]=_0x5c5a81['holdtime']||0x0;this[_0x019d('0x1a')]=_0x5c5a81[_0x019d('0x1a')]||0x0;this[_0x019d('0x1b')]=_0x5c5a81[_0x019d('0x1b')];this['callbackuniqueid']=_0x5c5a81['callbackuniqueid'];this[_0x019d('0x1c')]=_0x5c5a81[_0x019d('0x1c')];this[_0x019d('0x1d')]=_0x5c5a81[_0x019d('0x1d')];this[_0x019d('0x1e')]=_0x5c5a81[_0x019d('0x1e')];this['ListId']=_0x5c5a81['ListId'];this['UserId']=_0x5c5a81['UserId'];this[_0x019d('0x1f')]=_0x5c5a81['VoiceQueueId'];this[_0x019d('0x20')]=_0x5c5a81['CampaignId'];this[_0x019d('0x21')]=_0x5c5a81[_0x019d('0x21')]||'';this['originatecalleridname']=_0x5c5a81[_0x019d('0x22')]||'';}module[_0x019d('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 c1b9911..2eaf450 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 _0x46af=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','diff','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat'];(function(_0x141910,_0x815a43){var _0x23a2a5=function(_0x1cfd64){while(--_0x1cfd64){_0x141910['push'](_0x141910['shift']());}};_0x23a2a5(++_0x815a43);}(_0x46af,0x189));var _0xf46a=function(_0x1503f6,_0x419b3d){_0x1503f6=_0x1503f6-0x0;var _0x5d8543=_0x46af[_0x1503f6];return _0x5d8543;};'use strict';var util=require(_0xf46a('0x0'));var _=require(_0xf46a('0x1'));var moment=require(_0xf46a('0x2'));function getSeconds(_0x18d0eb,_0x3b9b30){var _0x5c9b79=moment(_0x18d0eb)['milliseconds'](0x0);var _0x2eb532=moment(_0x3b9b30)['milliseconds'](0x0);return _0x5c9b79[_0xf46a('0x3')](_0x2eb532,'seconds');}function Hangup(_0x2f7956,_0x278740){this['state']=0x4;this['statedesc']=_0xf46a('0x4');this['scheduledat']=_0x2f7956[_0xf46a('0x5')];this['type']=_0x2f7956[_0xf46a('0x6')];this['campaigntype']=_0x2f7956[_0xf46a('0x6')]==='outbound'?_0xf46a('0x7'):_0x2f7956['type'];this[_0xf46a('0x8')]=_0x2f7956[_0xf46a('0x8')];this[_0xf46a('0x9')]=_0x2f7956[_0xf46a('0x9')];this['countnoanswerretry']=_0x2f7956[_0xf46a('0xa')];this[_0xf46a('0xb')]=_0x2f7956['countbusyretry']+_0x2f7956[_0xf46a('0x9')]+_0x2f7956[_0xf46a('0xa')]+_0x2f7956[_0xf46a('0xc')]+_0x2f7956[_0xf46a('0xd')]+_0x2f7956['countabandonedretry']+_0x2f7956[_0xf46a('0xe')]+_0x2f7956[_0xf46a('0xf')];this['countnosuchnumberretry']=_0x2f7956[_0xf46a('0xc')];this[_0xf46a('0xd')]=_0x2f7956[_0xf46a('0xd')];this[_0xf46a('0x10')]=_0x2f7956[_0xf46a('0x10')];this[_0xf46a('0xe')]=_0x2f7956[_0xf46a('0xe')];this[_0xf46a('0xf')]=_0x2f7956['countagentrejectretry'];this['uniqueid']=_0x278740[_0xf46a('0x11')];this[_0xf46a('0x12')]=_0x2f7956[_0xf46a('0x13')];this[_0xf46a('0x14')]=_0x2f7956[_0xf46a('0x15')];this[_0xf46a('0x16')]=_0x2f7956['starttime'];this['responsetime']=_0x2f7956['responsetime'];this['endtime']=moment()[_0xf46a('0x17')](_0xf46a('0x18'));this[_0xf46a('0x19')]=getSeconds(_0x2f7956[_0xf46a('0x1a')],_0x2f7956[_0xf46a('0x16')]);this[_0xf46a('0x1b')]=0x0;this[_0xf46a('0x1c')]=getSeconds(this[_0xf46a('0x1d')],_0x2f7956[_0xf46a('0x1a')]);this[_0xf46a('0x7')]=_0x2f7956[_0xf46a('0x7')];this[_0xf46a('0x1e')]=_0xf46a('0x1f');this[_0xf46a('0x20')]=_0x278740[_0xf46a('0x21')];this[_0xf46a('0x22')]=_0x2f7956['callback'];this[_0xf46a('0x23')]=_0x2f7956[_0xf46a('0x23')];this[_0xf46a('0x24')]=_0x2f7956[_0xf46a('0x24')];this[_0xf46a('0x25')]=_0x2f7956[_0xf46a('0x25')];this[_0xf46a('0x26')]=_0x2f7956[_0xf46a('0x26')];this[_0xf46a('0x27')]=_0x2f7956[_0xf46a('0x27')];this[_0xf46a('0x28')]=_0x2f7956[_0xf46a('0x28')];this[_0xf46a('0x29')]=_0x2f7956[_0xf46a('0x29')];this['CampaignId']=_0x2f7956[_0xf46a('0x2a')];}module['exports']=Hangup; \ No newline at end of file +var _0x0f90=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','membername','IVR','reason','cause-txt'];(function(_0x2503f2,_0x305c53){var _0x13ab2c=function(_0x3a9383){while(--_0x3a9383){_0x2503f2['push'](_0x2503f2['shift']());}};_0x13ab2c(++_0x305c53);}(_0x0f90,0xc6));var _0x00f9=function(_0x25f7b7,_0xfe33e){_0x25f7b7=_0x25f7b7-0x0;var _0x4c4432=_0x0f90[_0x25f7b7];return _0x4c4432;};'use strict';var util=require(_0x00f9('0x0'));var _=require(_0x00f9('0x1'));var moment=require(_0x00f9('0x2'));function getSeconds(_0x13d7a7,_0xbe9bca){var _0x13edb9=moment(_0x13d7a7)['milliseconds'](0x0);var _0x4590d3=moment(_0xbe9bca)[_0x00f9('0x3')](0x0);return _0x13edb9['diff'](_0x4590d3,_0x00f9('0x4'));}function Hangup(_0x1d01d6,_0x504de0){this[_0x00f9('0x5')]=0x4;this[_0x00f9('0x6')]='Answer';this[_0x00f9('0x7')]=_0x1d01d6['scheduledat'];this[_0x00f9('0x8')]=_0x1d01d6[_0x00f9('0x8')];this['campaigntype']=_0x1d01d6['type']===_0x00f9('0x9')?_0x00f9('0xa'):_0x1d01d6[_0x00f9('0x8')];this[_0x00f9('0xb')]=_0x1d01d6[_0x00f9('0xb')];this[_0x00f9('0xc')]=_0x1d01d6[_0x00f9('0xc')];this[_0x00f9('0xd')]=_0x1d01d6[_0x00f9('0xd')];this[_0x00f9('0xe')]=_0x1d01d6['countbusyretry']+_0x1d01d6[_0x00f9('0xc')]+_0x1d01d6['countnoanswerretry']+_0x1d01d6[_0x00f9('0xf')]+_0x1d01d6[_0x00f9('0x10')]+_0x1d01d6['countabandonedretry']+_0x1d01d6[_0x00f9('0x11')]+_0x1d01d6[_0x00f9('0x12')];this[_0x00f9('0xf')]=_0x1d01d6[_0x00f9('0xf')];this[_0x00f9('0x10')]=_0x1d01d6['countdropretry'];this[_0x00f9('0x13')]=_0x1d01d6[_0x00f9('0x13')];this['countmachineretry']=_0x1d01d6[_0x00f9('0x11')];this[_0x00f9('0x12')]=_0x1d01d6[_0x00f9('0x12')];this[_0x00f9('0x14')]=_0x504de0[_0x00f9('0x14')];this[_0x00f9('0x15')]=_0x1d01d6[_0x00f9('0x16')];this[_0x00f9('0x17')]=_0x1d01d6[_0x00f9('0x18')];this['starttime']=_0x1d01d6['starttime'];this[_0x00f9('0x19')]=_0x1d01d6[_0x00f9('0x19')];this[_0x00f9('0x1a')]=moment()[_0x00f9('0x1b')](_0x00f9('0x1c'));this[_0x00f9('0x1d')]=getSeconds(_0x1d01d6['responsetime'],_0x1d01d6[_0x00f9('0x1e')]);this[_0x00f9('0x1f')]=0x0;this[_0x00f9('0x20')]=getSeconds(this[_0x00f9('0x1a')],_0x1d01d6[_0x00f9('0x19')]);this[_0x00f9('0xa')]=_0x1d01d6[_0x00f9('0xa')];this[_0x00f9('0x21')]=_0x00f9('0x22');this[_0x00f9('0x23')]=_0x504de0[_0x00f9('0x24')];this[_0x00f9('0x25')]=_0x1d01d6[_0x00f9('0x25')];this[_0x00f9('0x26')]=_0x1d01d6[_0x00f9('0x26')];this['callbackat']=_0x1d01d6[_0x00f9('0x27')];this[_0x00f9('0x28')]=_0x1d01d6[_0x00f9('0x28')];this['ContactId']=_0x1d01d6[_0x00f9('0x29')];this[_0x00f9('0x2a')]=_0x1d01d6[_0x00f9('0x2a')];this[_0x00f9('0x2b')]=_0x1d01d6[_0x00f9('0x2b')];this[_0x00f9('0x2c')]=_0x1d01d6[_0x00f9('0x2c')];this['CampaignId']=_0x1d01d6[_0x00f9('0x2d')];}module[_0x00f9('0x2e')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 223d4bd..1a97fb3 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 _0x1521=['countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2b5ef3,_0x3dc220){var _0x5aa683=function(_0x1b8b07){while(--_0x1b8b07){_0x2b5ef3['push'](_0x2b5ef3['shift']());}};_0x5aa683(++_0x3dc220);}(_0x1521,0x11c));var _0x1152=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x1521[_0x429948];return _0x35d5d1;};'use strict';var util=require('util');var _=require(_0x1152('0x0'));var moment=require(_0x1152('0x1'));function getSeconds(_0x679fb2,_0x3f90d5){var _0x1ee1af=moment(_0x679fb2)[_0x1152('0x2')](0x0);var _0x17b2f1=moment(_0x3f90d5)['milliseconds'](0x0);return _0x1ee1af[_0x1152('0x3')](_0x17b2f1,'seconds');}function History(_0x354b22){this[_0x1152('0x4')]=_0x354b22[_0x1152('0x4')];this['scheduledat']=_0x354b22[_0x1152('0x5')]||undefined;this[_0x1152('0x6')]=_0x354b22[_0x1152('0x6')];this['campaigntype']=_0x354b22[_0x1152('0x6')]===_0x1152('0x7')?_0x1152('0x8'):_0x354b22[_0x1152('0x6')];this[_0x1152('0x9')]=_0x354b22['countbusyretry'];this[_0x1152('0xa')]=_0x354b22[_0x1152('0xa')];this[_0x1152('0xb')]=_0x354b22[_0x1152('0xb')];this[_0x1152('0xc')]=_0x354b22[_0x1152('0x9')]+_0x354b22[_0x1152('0xa')]+_0x354b22[_0x1152('0xb')]+_0x354b22['countnosuchnumberretry']+_0x354b22[_0x1152('0xd')]+_0x354b22[_0x1152('0xe')]+_0x354b22['countmachineretry']+_0x354b22['countagentrejectretry'];this['countnosuchnumberretry']=_0x354b22[_0x1152('0xf')];this['countdropretry']=_0x354b22[_0x1152('0xd')];this['countabandonedretry']=_0x354b22[_0x1152('0xe')];this[_0x1152('0x10')]=_0x354b22['countmachineretry'];this[_0x1152('0x11')]=_0x354b22[_0x1152('0x11')];this[_0x1152('0x8')]=_0x354b22[_0x1152('0x8')];this[_0x1152('0x12')]=_0x354b22['name'];this[_0x1152('0x13')]=_0x354b22['number'];this['starttime']=_0x354b22[_0x1152('0x14')];this['responsetime']=_0x354b22['responsetime'];this[_0x1152('0x15')]=_0x354b22[_0x1152('0x16')];this[_0x1152('0x17')]=getSeconds(_0x354b22[_0x1152('0x16')],_0x354b22[_0x1152('0x14')]);this['holdtime']=0x0;this[_0x1152('0x18')]=0x0;this[_0x1152('0x19')]=_0x354b22[_0x1152('0x19')];this[_0x1152('0x1a')]=_0x354b22[_0x1152('0x1a')];this[_0x1152('0x1b')]=_0x354b22[_0x1152('0x1b')];this['recallme']=_0x354b22[_0x1152('0x1c')];this[_0x1152('0x1d')]=_0x354b22['ContactId'];this[_0x1152('0x1e')]=_0x354b22[_0x1152('0x1e')];this[_0x1152('0x1f')]=_0x354b22[_0x1152('0x1f')];this[_0x1152('0x20')]=_0x354b22['VoiceQueueId'];this['CampaignId']=_0x354b22[_0x1152('0x21')];this[_0x1152('0x22')]=_0x354b22[_0x1152('0x22')]||'';this[_0x1152('0x23')]=_0x354b22[_0x1152('0x23')]||'';}module[_0x1152('0x24')]=History; \ No newline at end of file +var _0x9446=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x25b3d5,_0x4f0a26){var _0x130bd9=function(_0x4ddb14){while(--_0x4ddb14){_0x25b3d5['push'](_0x25b3d5['shift']());}};_0x130bd9(++_0x4f0a26);}(_0x9446,0x170));var _0x6944=function(_0x5be8f8,_0x4e6602){_0x5be8f8=_0x5be8f8-0x0;var _0x5d72ba=_0x9446[_0x5be8f8];return _0x5d72ba;};'use strict';var util=require(_0x6944('0x0'));var _=require(_0x6944('0x1'));var moment=require(_0x6944('0x2'));function getSeconds(_0x5114f5,_0x1de4b0){var _0x46c372=moment(_0x5114f5)[_0x6944('0x3')](0x0);var _0x46f26e=moment(_0x1de4b0)[_0x6944('0x3')](0x0);return _0x46c372[_0x6944('0x4')](_0x46f26e,_0x6944('0x5'));}function History(_0x35f33b){this['uniqueid']=_0x35f33b['uniqueid'];this[_0x6944('0x6')]=_0x35f33b['scheduledat']||undefined;this[_0x6944('0x7')]=_0x35f33b[_0x6944('0x7')];this['campaigntype']=_0x35f33b[_0x6944('0x7')]===_0x6944('0x8')?_0x6944('0x9'):_0x35f33b['type'];this[_0x6944('0xa')]=_0x35f33b[_0x6944('0xa')];this[_0x6944('0xb')]=_0x35f33b['countcongestionretry'];this['countnoanswerretry']=_0x35f33b[_0x6944('0xc')];this[_0x6944('0xd')]=_0x35f33b[_0x6944('0xa')]+_0x35f33b[_0x6944('0xb')]+_0x35f33b[_0x6944('0xc')]+_0x35f33b['countnosuchnumberretry']+_0x35f33b[_0x6944('0xe')]+_0x35f33b[_0x6944('0xf')]+_0x35f33b[_0x6944('0x10')]+_0x35f33b[_0x6944('0x11')];this[_0x6944('0x12')]=_0x35f33b[_0x6944('0x12')];this[_0x6944('0xe')]=_0x35f33b[_0x6944('0xe')];this[_0x6944('0xf')]=_0x35f33b[_0x6944('0xf')];this[_0x6944('0x10')]=_0x35f33b[_0x6944('0x10')];this[_0x6944('0x11')]=_0x35f33b[_0x6944('0x11')];this['queue']=_0x35f33b[_0x6944('0x9')];this[_0x6944('0x13')]=_0x35f33b[_0x6944('0x14')];this[_0x6944('0x15')]=_0x35f33b[_0x6944('0x16')];this[_0x6944('0x17')]=_0x35f33b[_0x6944('0x17')];this[_0x6944('0x18')]=_0x35f33b[_0x6944('0x18')];this['endtime']=_0x35f33b[_0x6944('0x18')];this[_0x6944('0x19')]=getSeconds(_0x35f33b[_0x6944('0x18')],_0x35f33b[_0x6944('0x17')]);this[_0x6944('0x1a')]=0x0;this[_0x6944('0x1b')]=0x0;this[_0x6944('0x1c')]=_0x35f33b['callback'];this[_0x6944('0x1d')]=_0x35f33b[_0x6944('0x1d')];this['callbackat']=_0x35f33b['callbackat'];this[_0x6944('0x1e')]=_0x35f33b[_0x6944('0x1e')];this[_0x6944('0x1f')]=_0x35f33b['ContactId'];this[_0x6944('0x20')]=_0x35f33b[_0x6944('0x20')];this[_0x6944('0x21')]=_0x35f33b[_0x6944('0x21')];this[_0x6944('0x22')]=_0x35f33b[_0x6944('0x22')];this[_0x6944('0x23')]=_0x35f33b[_0x6944('0x23')];this[_0x6944('0x24')]=_0x35f33b[_0x6944('0x24')]||'';this['originatecalleridname']=_0x35f33b[_0x6944('0x25')]||'';}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 18c5835..e1bd215 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 _0x0004=['[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','Machine','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','CampaignId','statedesc','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','add','[rescheduleContact][Machine]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','stateinterface','agents','push','pick','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','buildObj','nosuchnumber','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','check\x20failure','outboundQueuePauses','abandonmentRate','predictiveIntervalPauses','[CatchErlangB]','[getDataPredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncQueueSummary','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','message','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\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','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','endtime','clearZombieChannels','[uniqueid]','hasOwnProperty','isNil','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','unlockContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x124cad,_0x3bd309){var _0x15e8c0=function(_0x593012){while(--_0x593012){_0x124cad['push'](_0x124cad['shift']());}};_0x15e8c0(++_0x3bd309);}(_0x0004,0x152));var _0x4000=function(_0x53dd63,_0x5e1852){_0x53dd63=_0x53dd63-0x0;var _0x460c0a=_0x0004[_0x53dd63];return _0x460c0a;};'use strict';var util=require(_0x4000('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x4000('0x1'));var moment=require(_0x4000('0x2'));var rr=require('rr');var md5=require(_0x4000('0x3'));var Redis=require(_0x4000('0x4'));var ut=require(_0x4000('0x5'));var config=require(_0x4000('0x6'));var logger=require(_0x4000('0x7'))(_0x4000('0x8'));var loggerBooked=require('../../../config/logger')(_0x4000('0x9'));var loggerPredictive=require(_0x4000('0x7'))('predictive');var loggerPredictiveCalls=require(_0x4000('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x4000('0xa'));config[_0x4000('0xb')]=_['defaults'](config['redis'],{'host':_0x4000('0xc'),'port':0x18eb});var io=require(_0x4000('0xd'))(new Redis(config[_0x4000('0xb')]));var cmHopper=require(_0x4000('0xe'));var cmHopperFinal=require(_0x4000('0xf'));var cmHopperHistory=require(_0x4000('0x10'));var cmHopperBlack=require(_0x4000('0x11'));var voiceQueueRt=require(_0x4000('0x12'));var Action=require(_0x4000('0x13'));var History=require(_0x4000('0x14'));var Final=require('./final');var AgentComplete=require(_0x4000('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x4000('0x16'));var ipAgi=process[_0x4000('0x17')]['XCALLY_IP_AGI']||_0x4000('0x18');var strategy={'rrmemory':_0x4000('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x4000('0x1a')][_0x4000('0x1b')]=function(_0x210781){this['tail']=this['tail']?this['tail'][_0x4000('0x1c')](_0x210781):_0x210781();};function Dialer(_0x129f0a,_0x21b47a){this[_0x4000('0x1d')]=new Sequence();this[_0x4000('0x1e')]=_0x21b47a;this[_0x4000('0x1f')]=_0x129f0a[_0x4000('0x1f')];this[_0x4000('0x20')]=_0x129f0a[_0x4000('0x20')];this['agents']=_0x129f0a['agents'];this[_0x4000('0x21')]=_0x129f0a[_0x4000('0x21')];this[_0x4000('0x22')]=config[_0x4000('0x22')]||0x2;this[_0x4000('0x23')]={};this[_0x4000('0x24')]={};this[_0x4000('0x25')]={};this[_0x4000('0x26')]={};this[_0x4000('0x27')]={};this[_0x4000('0x28')]={};this[_0x4000('0x29')]={};this[_0x4000('0x2a')]={};this[_0x4000('0x2b')]={};this[_0x4000('0x2c')]={};ami['on'](_0x4000('0x2d'),this[_0x4000('0x2e')][_0x4000('0x2f')](this));ami['on'](_0x4000('0x30'),this['syncQueueCallerAbandon'][_0x4000('0x2f')](this));ami['on'](_0x4000('0x31'),this[_0x4000('0x32')][_0x4000('0x2f')](this));ami['on'](_0x4000('0x33'),this['syncAgentComplete'][_0x4000('0x2f')](this));ami['on']('custom:queuesummary',this[_0x4000('0x34')][_0x4000('0x2f')](this));ami['on']('hangup',this['syncHangup'][_0x4000('0x2f')](this));ami['on']('newexten',this[_0x4000('0x35')][_0x4000('0x2f')](this));ami['on'](_0x4000('0x36'),this[_0x4000('0x37')][_0x4000('0x2f')](this));ami['on'](_0x4000('0x38'),this[_0x4000('0x39')][_0x4000('0x2f')](this));ami['on'](_0x4000('0x3a'),this[_0x4000('0x3b')][_0x4000('0x2f')](this));this[_0x4000('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x5f5870){return _0x5f5870!==null&&!_[_0x4000('0x3d')](_0x5f5870);}function checkIsLoggedIn(_0x458b52,_0x4fdfd5){return function(){if(_0x4fdfd5<=0x0){_0x458b52['message']='AGENTS_NOT_LOGGED';throw _0x458b52[_0x4000('0x3e')]+_0x4000('0x3f');}};}function isActive(_0x1339af){return _0x1339af;}function checkIsActive(_0x13ff83,_0x57f6fa){return function(){if(!isActive(_0x57f6fa)){_0x13ff83['message']=_0x4000('0x40');throw _0x13ff83[_0x4000('0x3e')]+'\x20NOT\x20Active';}};}function checkInterval(_0x58f444){return function(){if(!isNotNull(_0x58f444[_0x4000('0x41')])){_0x58f444[_0x4000('0x42')]='INTERVAL_IS_NULL';throw _0x58f444['name']+_0x4000('0x43');}if(!isNotNull(_0x58f444['Interval']['Intervals'])){_0x58f444[_0x4000('0x42')]=_0x4000('0x44');throw _0x58f444[_0x4000('0x3e')]+_0x4000('0x43');}if(!isNotNull(_[_0x4000('0x45')](_0x58f444[_0x4000('0x41')][_0x4000('0x46')]))){_0x58f444['message']='INTERVAL_IS_NULL';throw _0x58f444[_0x4000('0x3e')]+_0x4000('0x43');}};}function msgResponse(_0x12148e,_0x1af74e,_0x1816a9){return{'action':_0x12148e,'response':_0x1af74e,'message':_0x1816a9,'stack':_0x1816a9};}function myreject(_0x2f08ee){return function(_0x26e10f){return _0x2f08ee(msgResponse(_0x4000('0x47'),_0x4000('0x48'),JSON[_0x4000('0x49')](_0x26e10f)));};}function getSeconds(_0x29cdea,_0x26a1df){var _0x20b2d8=moment(_0x29cdea)[_0x4000('0x4a')](0x0);var _0x1fe2ff=moment(_0x26a1df)[_0x4000('0x4a')](0x0);return _0x20b2d8[_0x4000('0x4b')](_0x1fe2ff,'seconds');}function emit(_0x266509,_0x59cea3,_0x36884c){io['to'](_0x266509)[_0x4000('0x4c')](_0x59cea3,_0x36884c);}function emitVoiceQueueSummary(_0x3a9a5f){if(_0x3a9a5f[_0x4000('0x4d')]===_0x4000('0x4e')){var _0x4e3a8b={'id':_0x3a9a5f['id'],'name':_0x3a9a5f[_0x4000('0x3e')],'strategy':_0x3a9a5f[_0x4000('0x4f')],'answered':_0x3a9a5f[_0x4000('0x50')],'available':_0x3a9a5f[_0x4000('0x51')],'loggedIn':_0x3a9a5f[_0x4000('0x52')],'pTalking':_0x3a9a5f[_0x4000('0x53')],'sumBillable':_0x3a9a5f['sumBillable'],'sumDuration':_0x3a9a5f[_0x4000('0x54')],'sumHoldTime':_0x3a9a5f['sumHoldTime']||0x0,'talking':_0x3a9a5f[_0x4000('0x55')],'total':_0x3a9a5f[_0x4000('0x56')],'type':_0x3a9a5f[_0x4000('0x4d')],'unmanaged':_0x3a9a5f[_0x4000('0x57')],'abandoned':_0x3a9a5f[_0x4000('0x58')],'waiting':_0x3a9a5f[_0x4000('0x59')],'loggedInDb':_0x3a9a5f[_0x4000('0x5a')],'dialActive':_0x3a9a5f[_0x4000('0x5b')],'dialMethod':_0x3a9a5f[_0x4000('0x5c')],'dialOriginateCallerIdName':_0x3a9a5f[_0x4000('0x5d')],'dialOriginateCallerIdNumber':_0x3a9a5f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3a9a5f[_0x4000('0x5e')],'dialPrefix':_0x3a9a5f[_0x4000('0x5f')],'outboundAnswerAgiCallsDay':_0x3a9a5f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3a9a5f[_0x4000('0x60')],'outboundBlacklistCallsDay':_0x3a9a5f[_0x4000('0x61')],'outboundBusyCallsDay':_0x3a9a5f[_0x4000('0x62')],'outboundCongestionCallsDay':_0x3a9a5f[_0x4000('0x63')],'outboundDropCallsDayACS':_0x3a9a5f[_0x4000('0x64')],'outboundDropCallsDayCallersExit':_0x3a9a5f[_0x4000('0x65')],'outboundDropCallsDayTimeout':_0x3a9a5f[_0x4000('0x66')],'outboundNoAnswerCallsDay':_0x3a9a5f[_0x4000('0x67')],'outboundNoSuchCallsDay':_0x3a9a5f[_0x4000('0x68')],'outboundOriginateFailureCallsDay':_0x3a9a5f[_0x4000('0x69')],'outboundReCallsDay':_0x3a9a5f[_0x4000('0x6a')],'outboundRejectCallsDay':_0x3a9a5f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3a9a5f[_0x4000('0x6b')],'predictiveIntervalAnsweredCalls':_0x3a9a5f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3a9a5f[_0x4000('0x6c')],'predictiveIntervalAvgTalktime':_0x3a9a5f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3a9a5f[_0x4000('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x3a9a5f[_0x4000('0x6e')],'predictiveIntervalErlangCalls':_0x3a9a5f[_0x4000('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a9a5f[_0x4000('0x70')],'predictiveIntervalHitRate':_0x3a9a5f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3a9a5f['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3a9a5f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3a9a5f[_0x4000('0x71')],'predictiveIntervalTotalCalls':_0x3a9a5f[_0x4000('0x72')],'message':_0x3a9a5f[_0x4000('0x42')],'originated':_0x3a9a5f[_0x4000('0x73')],'erlangCalls':_0x3a9a5f['erlangCalls'],'erlangCallToSecond':_0x3a9a5f[_0x4000('0x74')],'erlangAbandonmentRate':_0x3a9a5f['erlangAbandonmentRate'],'erlangBusyFactor':_0x3a9a5f[_0x4000('0x75')],'startPredictive':_0x3a9a5f[_0x4000('0x28')],'startProgressive':_0x3a9a5f['startProgressive']};if(_0x3a9a5f['Trunk']){_0x4e3a8b[_0x4000('0x76')]={'id':_0x3a9a5f[_0x4000('0x76')]['id'],'name':_0x3a9a5f['Trunk'][_0x4000('0x3e')],'active':_0x3a9a5f[_0x4000('0x76')]['active'],'callerid':_0x3a9a5f[_0x4000('0x76')][_0x4000('0x77')]};}if(_0x3a9a5f[_0x4000('0x41')]){_0x4e3a8b['Interval']={'id':_0x3a9a5f[_0x4000('0x41')]['id'],'name':_0x3a9a5f[_0x4000('0x41')][_0x4000('0x3e')]};}var _0x5802cb=md5(JSON[_0x4000('0x49')](_0x4e3a8b));if(_0x3a9a5f[_0x4000('0x3')]!==_0x5802cb){_0x3a9a5f[_0x4000('0x3')]=_0x5802cb;emit(util[_0x4000('0x78')]('voice:queue:%s',_0x4e3a8b[_0x4000('0x3e')]),_0x4000('0x79'),_0x4e3a8b);}}}function emitCampaignSummary(_0x4ca746){if(_0x4ca746[_0x4000('0x4d')]===_0x4000('0x7a')){emit(util[_0x4000('0x78')](_0x4000('0x7b'),_0x4ca746[_0x4000('0x3e')]),_0x4000('0x7c'),_0x4ca746);}}function checkGetDataPredictive(_0xcee4d1){if(isNotNull(_0xcee4d1)){if(!_[_0x4000('0x45')](_0xcee4d1)){loggerPredictive[_0x4000('0x7d')](_0x4000('0x7e'));loggerPredictive[_0x4000('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcee4d1['predictiveIntervalTotalCalls']);loggerPredictive[_0x4000('0x7d')](_0x4000('0x7f'),_0xcee4d1[_0x4000('0x80')]);loggerPredictive['info'](_0x4000('0x81'),_0xcee4d1[_0x4000('0x6e')]);loggerPredictive[_0x4000('0x7d')](_0x4000('0x82'),_0xcee4d1[_0x4000('0x6d')]);loggerPredictive[_0x4000('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcee4d1[_0x4000('0x6c')]);loggerPredictive[_0x4000('0x7d')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcee4d1[_0x4000('0x83')]);loggerPredictive[_0x4000('0x7d')](_0x4000('0x84'));if(_0xcee4d1[_0x4000('0x72')]>0x0){if(!_['isUndefined'](_0xcee4d1[_0x4000('0x83')])&&_0xcee4d1[_0x4000('0x83')]>0x0){return!![];}else{loggerPredictive[_0x4000('0x7d')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x4000('0x3d')](_0xcee4d1[_0x4000('0x6c')])&&_0xcee4d1[_0x4000('0x6c')]>0x0){return!![];}else{loggerPredictive[_0x4000('0x7d')](_0x4000('0x85'));}}else{loggerPredictive[_0x4000('0x7d')](_0x4000('0x86'));}}else{loggerPredictive[_0x4000('0x7d')]('History\x20information\x20are\x20empty');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5926ce){return function(_0xb23b14){loggerPredictive[_0x4000('0x7d')](_0x4000('0x87'));loggerPredictive['info'](_0x4000('0x88'),_0xb23b14['erlangCalls']);loggerPredictive[_0x4000('0x7d')](_0x4000('0x89'),_0xb23b14[_0x4000('0x74')]);loggerPredictive[_0x4000('0x7d')](_0x4000('0x8a'),_0xb23b14['erlangAbandonmentRate']);loggerPredictive['info'](_0x4000('0x8b'),_0xb23b14[_0x4000('0x75')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb23b14['erlangAbandonmentRate']);loggerPredictive['info'](_0x4000('0x84'));_[_0x4000('0x8c')](_0x5926ce,_0xb23b14);};}function getDiff(_0x21ed31){var _0xf2f09f=moment()[_0x4000('0x4a')](0x0);var _0x1e3de7=moment(_0x21ed31)[_0x4000('0x4a')](0x0);return _0xf2f09f[_0x4000('0x4b')](_0x1e3de7,_0x4000('0x8d'));}function ifInterval(_0x51f5ab,_0x2ec641){if(_[_0x4000('0x3d')](_0x2ec641)){return![];}if(getDiff(_0x2ec641)<_0x51f5ab*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2b0d1c){if(isNotNull(_0x2b0d1c)){if(!_['isUndefined'](_0x2b0d1c[_0x4000('0x29')])){_0x2b0d1c[_0x4000('0x29')]=undefined;loggerPredictive[_0x4000('0x7d')](_0x2b0d1c['name'],_0x4000('0x8e'));}if(!_[_0x4000('0x3d')](_0x2b0d1c[_0x4000('0x28')])){_0x2b0d1c[_0x4000('0x28')]=undefined;loggerPredictive[_0x4000('0x7d')](_0x2b0d1c[_0x4000('0x3e')],_0x4000('0x8f'));}if(!_[_0x4000('0x3d')](_0x2b0d1c[_0x4000('0x90')])){clearInterval(_0x2b0d1c['handlePredictive']);_0x2b0d1c[_0x4000('0x90')]=undefined;loggerPredictive[_0x4000('0x7d')](_0x2b0d1c[_0x4000('0x3e')],_0x4000('0x91'));}}}function erlangb(_0x5670c7,_0x1e0a2c){if(_0x1e0a2c===0x0){return 0x0;}var _0x2dd2f7=0x1;for(var _0x29311e=0x1;_0x29311e<=_0x1e0a2c;_0x29311e+=0x1){_0x2dd2f7=0x1+_0x2dd2f7*_0x29311e/_0x5670c7;}return 0x1/_0x2dd2f7;}function isVoiceQueueOutbound(_0x3e5b9c){return _0x3e5b9c===_0x4000('0x4e');}function isNotPreview(_0x4f10c1){return _0x4f10c1!==_0x4000('0x1e');}function isCampaignIvr(_0x429669){return _0x429669==='ivr';}function getCallerId(_0x16d03f,_0x23b740,_0x31792a){if(!_[_0x4000('0x3d')](_0x31792a)&&_0x4000('0x92')===typeof _0x31792a&&!_[_0x4000('0x45')](_0x31792a)){if(!_['isUndefined'](_0x23b740)&&_0x4000('0x92')===typeof _0x23b740&&!_['isEmpty'](_0x23b740)){return util['format'](_0x4000('0x93'),_0x23b740,_0x31792a);}return util['format'](_0x4000('0x93'),_0x31792a,_0x31792a);}if(!_[_0x4000('0x3d')](_0x16d03f)&&'string'===typeof _0x16d03f&&!_[_0x4000('0x45')](_0x16d03f)){return _0x16d03f;}return _0x4000('0x94');}function loggerCatchQueueSummary(_0xf5a123,_0x3a64b0){return function(_0x472955){freeVariablesPredictive(_0x3a64b0);emitVoiceQueueSummary(_0x3a64b0);emitCampaignSummary(_0x3a64b0);loggerSyncQueueSummary[_0x4000('0x95')](_0xf5a123,util[_0x4000('0x96')](_0x472955,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3d9803,_0x51ce7c){return function(_0x22e162){loggerPredictive['error'](_0x51ce7c['name'],_0x3d9803);loggerPredictive[_0x4000('0x95')](_0x22e162[_0x4000('0x97')]);freeVariablesPredictive(_0x51ce7c);};}function loggerCatch(_0x269f18){return function(_0x2dac53){logger['error'](_0x269f18,util[_0x4000('0x96')](_0x2dac53,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x46be38){return _0x46be38&&!_[_0x4000('0x3d')](_0x46be38)&&_0x46be38[_0x4000('0x98')]>0x0;}function decremetOriginate(_0x2a9f59){if(!_[_0x4000('0x3d')](_0x2a9f59)&&_0x2a9f59!==null){if(_0x2a9f59['hasOwnProperty'](_0x4000('0x73'))){if(_0x2a9f59[_0x4000('0x73')]>0x0){_0x2a9f59[_0x4000('0x73')]-=0x1;}else{logger[_0x4000('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4000('0x95')](_0x4000('0x99'));}}function checkContactLowerLimitOriginate(_0x3d74e5,_0x4c23e4,_0x3d5531){if(_0x4c23e4>_0x3d5531){for(var _0x23569a=0x0;_0x23569a<_0x4c23e4-_0x3d5531;_0x23569a+=0x1){decremetOriginate(_0x3d74e5);}}}function loggerGetContactDialer(_0x188f66,_0x48a091,_0x284be4){return function(_0x18bdb4){checkContactLowerLimitOriginate(_0x48a091,_0x284be4,0x0);logger[_0x4000('0x95')](_0x188f66,util[_0x4000('0x96')](_0x18bdb4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x138e89){return function(_0x4bf94c){if(isNotNull(_0x4bf94c)&&isNotNull(_0x4bf94c[0x0])){if(_0x4bf94c[0x0][_0x4000('0x9a')]>0x0){_0x138e89[_0x4000('0x42')]=_0x4000('0x9b');logger[_0x4000('0x7d')]('[getContactDialer2][ReScheduled]'+_0x138e89[_0x4000('0x3e')],_0x4bf94c[0x0][_0x4000('0x9a')],_0x4000('0x9c'));}else{_0x138e89[_0x4000('0x42')]=_0x4000('0x9d');logger['info'](_0x4000('0x9e')+_0x138e89[_0x4000('0x3e')]);}}};}function notSendMessagesQueue(_0x497b4a){if(_0x497b4a['sendMessageOneNotActive']){freeVariablesPredictive(_0x497b4a);if(_0x497b4a['originated']===0x0&&_0x497b4a[_0x4000('0x55')]===0x0&&_0x497b4a[_0x4000('0x59')]===0x0&&(_0x497b4a[_0x4000('0x53')]||0x0)===0x0){_0x497b4a[_0x4000('0x9f')]=![];_0x497b4a['available']=0x0;_0x497b4a[_0x4000('0x42')]=_0x4000('0x40');loggerSyncQueueSummary[_0x4000('0x95')](_0x4000('0xa0'),_0x497b4a[_0x4000('0x3e')],'is\x20not\x20active');}else{_0x497b4a[_0x4000('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x4000('0x95')](_0x4000('0xa0'),_0x497b4a['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x497b4a);}}function notSendMessagesCampaign(_0x17bcc8){if(_0x17bcc8[_0x4000('0x9f')]){if(_0x17bcc8[_0x4000('0x73')]===0x0){_0x17bcc8['sendMessageOneNotActive']=![];_0x17bcc8[_0x4000('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4000('0x95')](_0x4000('0xa1'),_0x17bcc8[_0x4000('0x3e')],_0x4000('0xa2'));}else{_0x17bcc8[_0x4000('0x42')]=_0x4000('0xa3');loggerSyncQueueSummary[_0x4000('0x95')](_0x4000('0xa1'),_0x17bcc8[_0x4000('0x3e')],_0x4000('0xa4'));}emitCampaignSummary(_0x17bcc8);}}function createObjHistory(_0x38a693,_0x200f9d,_0x101fcf,_0x463406,_0x3947eb){_0x38a693['message']=_0x101fcf;var _0xbdc340=new Action(_0x38a693,_0x200f9d);var _0x487df6=new History(_0xbdc340);_0x487df6[_0x4000('0xa5')]=_0x463406;_0x487df6['statedesc']=_0x3947eb;_0x487df6[_0x4000('0xa6')]=_0xbdc340['starttime'];return _0x487df6;}Dialer[_0x4000('0x1a')]['loopClearZombieChannels']=function(){var _0x7dbea8=this;setInterval(function(){_0x7dbea8[_0x4000('0xa7')](_0x7dbea8[_0x4000('0x26')],_0x4000('0xa8'));_0x7dbea8[_0x4000('0xa7')](_0x7dbea8['actions'],'[actions]');},0x32c8);};Dialer[_0x4000('0x1a')][_0x4000('0xa7')]=function(_0x79ba72,_0x24811a){var _0x85e2cd=this;for(var _0x10ce96 in _0x79ba72){if(_0x79ba72[_0x4000('0xa9')](_0x10ce96)){this[_0x4000('0x1d')][_0x4000('0x1b')](function(){if(!_[_0x4000('0xaa')](_0x79ba72[_0x10ce96])){return ami['Action']({'action':_0x4000('0xab'),'channel':_0x79ba72[_0x10ce96][_0x4000('0xac')]})[_0x4000('0xad')](function(_0x4a6fcb){if(_0x4a6fcb[_0x4000('0x42')]===_0x4000('0xae')){setTimeout(function(){if(_0x79ba72[_0x10ce96]&&_0x79ba72[_0x10ce96][_0x4000('0x4d')]!==_0x4000('0x7a')){_0x85e2cd['updateOriginated'](_0x85e2cd[_0x4000('0x1f')][_0x79ba72[_0x10ce96]['queue']]);logger[_0x4000('0x95')](_0x4000('0xaf'),_0x24811a,_0x10ce96,_0x79ba72[_0x10ce96][_0x4000('0xb0')]);delete _0x79ba72[_0x10ce96];}if(_0x79ba72[_0x10ce96]&&_0x79ba72[_0x10ce96]['type']===_0x4000('0x7a')){_0x85e2cd['updateOriginated'](_0x85e2cd['campaigns'][_0x79ba72[_0x10ce96]['queue']]);logger[_0x4000('0x95')](_0x4000('0xb1'),_0x24811a,_0x10ce96,_0x79ba72[_0x10ce96]['queue']);delete _0x79ba72[_0x10ce96];}},0x2328);}});}});}}};Dialer[_0x4000('0x1a')][_0x4000('0xb2')]=function(_0x2e8bc0){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopper[_0x4000('0xb2')](_0x2e8bc0))['catch'](loggerCatch(_0x4000('0xb5')));};Dialer[_0x4000('0x1a')][_0x4000('0xb6')]=function(_0x3260ae){return BPromise['resolve']()[_0x4000('0xb4')](cmHopperBlack[_0x4000('0xb6')](_0x3260ae))[_0x4000('0xad')](loggerCatch(_0x4000('0xb7')));};Dialer[_0x4000('0x1a')][_0x4000('0xb8')]=function(_0x8f1cfd){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopperBlack[_0x4000('0xb8')](_0x8f1cfd))[_0x4000('0xad')](loggerCatch(_0x4000('0xb9')));};Dialer[_0x4000('0x1a')]['averageHandleTime']=function(_0x3438e1){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopperHistory[_0x4000('0xba')](_0x3438e1))[_0x4000('0xad')](loggerCatch(_0x4000('0xbb')));};Dialer[_0x4000('0x1a')]['rescheduleContact']=function(_0x696a41){return BPromise[_0x4000('0xb3')]()['then'](cmHopper['rescheduleContact'](_0x696a41))[_0x4000('0xad')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x4000('0x1a')]['unlockContact']=function(_0x355c86,_0x26831e,_0x5c9a02){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopper[_0x4000('0xbc')](_0x355c86,_0x26831e,_0x5c9a02))[_0x4000('0xad')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x4000('0x1a')][_0x4000('0xbd')]=function(_0xfcd8eb,_0x4abb80,_0x16cce6,_0x1f0b3b){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopper[_0x4000('0xbd')](_0xfcd8eb,_0x4abb80,_0x16cce6,_0x1f0b3b))[_0x4000('0xad')](loggerCatch(_0x4000('0xbe')));};Dialer[_0x4000('0x1a')][_0x4000('0xbf')]=function(_0x32bda3,_0x343174,_0x381421){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopper[_0x4000('0xbf')](_0x32bda3,_0x343174,_0x381421))[_0x4000('0xad')](loggerCatch(_0x4000('0xbe')));};Dialer[_0x4000('0x1a')][_0x4000('0xc0')]=function(_0x166a54){return BPromise['resolve']()[_0x4000('0xb4')](voiceQueueRt[_0x4000('0xc0')](_0x166a54))['catch'](loggerCatch(_0x4000('0xc1')));};Dialer[_0x4000('0x1a')][_0x4000('0xc2')]=function(_0x390098){return BPromise[_0x4000('0xb3')]()[_0x4000('0xb4')](cmHopper[_0x4000('0xc2')](_0x390098))['catch'](loggerCatch(_0x4000('0xc3')));};Dialer['prototype'][_0x4000('0xc4')]=function(_0xcd2ff6){return BPromise['resolve']()[_0x4000('0xb4')](cmHopperHistory[_0x4000('0xc4')](_0xcd2ff6))[_0x4000('0xad')](loggerCatch(_0x4000('0xc5')));};Dialer[_0x4000('0x1a')][_0x4000('0xc6')]=function(_0x423154){if(!_[_0x4000('0x3d')](_0x423154)&&_0x423154!==null){if(_0x423154[_0x4000('0xa9')](_0x4000('0x73'))){if(_0x423154['originated']>0x0){_0x423154[_0x4000('0x73')]-=0x1;}else{logger[_0x4000('0x95')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4000('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x4000('0x1a')]['loggerHandler']=function(_0xf48371,_0x10fdad){var _0x2040c5=this;return function(_0x3bc693){_0x2040c5[_0x4000('0xc6')](_0x10fdad);logger[_0x4000('0x95')](_0xf48371,util[_0x4000('0x96')](_0x3bc693,{'showHidden':![],'depth':null}));};};Dialer[_0x4000('0x1a')][_0x4000('0xc7')]=function(_0x459e44,_0xf6e4d5,_0xb69c6){var _0x5b6be2={'state':0x19,'statedesc':_0x4000('0xc8')};this[_0x4000('0xc6')](_0xf6e4d5);this[_0x4000('0xc9')](_[_0x4000('0x8c')](_0x5b6be2,_['pick'](_0xb69c6,[_0x4000('0xca'),_0x4000('0xcb'),_0x4000('0xcc'),_0x4000('0xcd'),'CampaignId'])),_0x4000('0xce'),_0x4000('0xcf'));logger[_0x4000('0x95')](_0x459e44);};Dialer[_0x4000('0x1a')][_0x4000('0xd0')]=function(_0x18e22b){return _0x18e22b==='Success';};Dialer[_0x4000('0x1a')][_0x4000('0xd1')]=function(_0x39f906){return!_[_0x4000('0x3d')](_0x39f906)&&_0x39f906&&!_['isUndefined'](_0x39f906[_0x4000('0x3e')])&&!_['isUndefined'](_0x39f906[_0x4000('0xd2')])&&_0x39f906[_0x4000('0xd2')]&&(this[_0x4000('0x21')][util[_0x4000('0x78')]('SIP/%s',_0x39f906['name'])][_0x4000('0xab')]==='reachable'||this[_0x4000('0x21')][util[_0x4000('0x78')](_0x4000('0xd3'),_0x39f906[_0x4000('0x3e')])][_0x4000('0xab')]===_0x4000('0xd4'));};Dialer[_0x4000('0x1a')][_0x4000('0xc9')]=function(_0x777f38,_0x3d2bf5,_0x3028f6){this[_0x4000('0xc4')](_0x777f38)[_0x4000('0xad')](loggerCatch(_0x3d2bf5));this[_0x4000('0xc2')](_0x777f38)[_0x4000('0xad')](loggerCatch(_0x3028f6));};Dialer[_0x4000('0x1a')][_0x4000('0x37')]=function(_0x38e3fe){var _0x4f99b9=this[_0x4000('0x26')][_0x38e3fe[_0x4000('0xd5')]];var _0x561df5;if(!_[_0x4000('0xaa')](_0x38e3fe)&&!_['isNil'](_0x38e3fe[_0x4000('0xd6')])&&!_['isNil'](_0x38e3fe[_0x4000('0xd6')][_0x4000('0xd7')])&&_0x38e3fe[_0x4000('0xd8')]===_0x4000('0xd9')&&_0x4f99b9){if(_0x4f99b9[_0x4000('0x4d')]!==_0x4000('0x7a')&&this[_0x4000('0x1f')][_0x4f99b9[_0x4000('0xb0')]]['dialAMDActive']&&_0x38e3fe[_0x4000('0xda')]===_0x4000('0xdb')){delete this[_0x4000('0x26')][_0x38e3fe[_0x4000('0xd5')]];this['updateOriginated'](this[_0x4000('0x1f')][_0x4f99b9['queue']]);this[_0x4000('0x1f')][_0x4f99b9[_0x4000('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x4000('0x1f')][_0x4f99b9[_0x4000('0xb0')]][_0x4000('0xdc')]+=0x1;_0x561df5=new Hangup(_0x4f99b9,_0x38e3fe);_0x561df5[_0x4000('0xa5')]=0x12;_0x561df5['statedesc']=_0x4000('0xdd');_0x561df5[_0x4000('0xde')]=_0x4000('0xdf');this[_0x4000('0xc9')](_0x561df5,_0x4000('0xe0'),'[syncHangupInAMD]');}if(_0x4f99b9[_0x4000('0x4d')]!=='ivr'&&this[_0x4000('0x1f')][_0x4f99b9[_0x4000('0xb0')]][_0x4000('0xe1')]&&_0x38e3fe[_0x4000('0xda')]===_0x4000('0xe2')){var _0x1eaf31=this;return new BPromise(function(_0x257da2,_0x3768ff){delete _0x1eaf31['uniqueId'][_0x38e3fe[_0x4000('0xd5')]];_0x1eaf31[_0x4000('0xc6')](_0x1eaf31[_0x4000('0x1f')][_0x4f99b9['queue']]);_0x1eaf31[_0x4000('0x1f')][_0x4f99b9['queue']]['outboundAnswerCallsDay']+=0x1;_0x1eaf31['voiceQueues'][_0x4f99b9['queue']][_0x4000('0xdc')]+=0x1;var _0x12b07a=_0x1eaf31[_0x4000('0x1f')][_0x4f99b9[_0x4000('0xb0')]];var _0x3dccf5=new Hangup(_0x4f99b9,_0x38e3fe);_0x3dccf5[_0x4000('0xa5')]=0x13;_0x3dccf5['statedesc']=_0x4000('0xe3');_0x3dccf5['membername']=_0x4000('0xdf');_0x3dccf5['countmachineretry']+=0x1;_0x3dccf5[_0x4000('0xe4')]+=0x1;_0x3dccf5[_0x4000('0xe5')]=!![];_0x1eaf31[_0x4000('0xc4')](_0x3dccf5)[_0x4000('0xad')](loggerCatch(_0x4000('0xe6')));if(_0x3dccf5[_0x4000('0xe7')]+_0x3dccf5[_0x4000('0xe8')]+_0x3dccf5['countnoanswerretry']+_0x3dccf5[_0x4000('0xe9')]+_0x3dccf5[_0x4000('0xea')]+_0x3dccf5[_0x4000('0xeb')]+_0x3dccf5['countmachineretry']+_0x3dccf5[_0x4000('0xec')]>=_0x12b07a[_0x4000('0xed')]){_0x1eaf31['stateGlobal'](_0x3dccf5,_0x257da2,_0x3768ff,_0x4000('0xee'));}else{if(_0x3dccf5[_0x4000('0xef')]>=_0x12b07a[_0x4000('0xf0')]){_0x1eaf31[_0x4000('0xf1')](_0x3dccf5,_0x257da2,_0x3768ff,_0x4000('0xf2'));}else{_0x1eaf31[_0x4000('0xf3')]({'active':![],'countmachineretry':_0x3dccf5[_0x4000('0xef')],'scheduledat':moment()['add'](_0x12b07a[_0x4000('0xf4')],'minutes')['format'](_0x4000('0xf5')),'ContactId':_0x3dccf5[_0x4000('0xca')],'ListId':_0x3dccf5[_0x4000('0xcb')],'VoiceQueueId':_0x3dccf5['VoiceQueueId']||undefined,'CampaignId':_0x3dccf5[_0x4000('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x257da2({'reschedule':0x1});}}});}if(_0x4f99b9[_0x4000('0x4d')]===_0x4000('0x7a')&&this['campaigns'][_0x4f99b9[_0x4000('0xb0')]][_0x4000('0xe1')]&&_0x38e3fe[_0x4000('0xda')]==='HANGUP'){delete this[_0x4000('0x26')][_0x38e3fe[_0x4000('0xd5')]];this[_0x4000('0xc6')](this[_0x4000('0x20')][_0x4f99b9['queue']]);_0x561df5=new Hangup(_0x4f99b9,_0x38e3fe);_0x561df5[_0x4000('0xa5')]=0x12;_0x561df5[_0x4000('0xf7')]=_0x4000('0xdd');_0x561df5[_0x4000('0xde')]='AMD';this[_0x4000('0xc9')](_0x561df5,_0x4000('0xf8'),_0x4000('0xf9'));}if(_0x4f99b9['type']==='ivr'&&this[_0x4000('0x20')][_0x4f99b9[_0x4000('0xb0')]][_0x4000('0xe1')]&&_0x38e3fe[_0x4000('0xda')]===_0x4000('0xe2')){var _0x1eaf31=this;return new BPromise(function(_0x4e7f48,_0x231fbd){delete _0x1eaf31[_0x4000('0x26')][_0x38e3fe[_0x4000('0xd5')]];_0x1eaf31[_0x4000('0xc6')](_0x1eaf31[_0x4000('0x20')][_0x4f99b9['queue']]);_0x1eaf31[_0x4000('0x20')][_0x4f99b9[_0x4000('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x1eaf31['campaigns'][_0x4f99b9[_0x4000('0xb0')]][_0x4000('0xdc')]+=0x1;var _0x220f46=_0x1eaf31['campaigns'][_0x4f99b9[_0x4000('0xb0')]];var _0x36966f=new Hangup(_0x4f99b9,_0x38e3fe);_0x36966f[_0x4000('0xa5')]=0x13;_0x36966f[_0x4000('0xf7')]=_0x4000('0xe3');_0x36966f['membername']=_0x4000('0xdf');_0x36966f[_0x4000('0xef')]+=0x1;_0x36966f[_0x4000('0xe4')]+=0x1;_0x36966f[_0x4000('0xe5')]=!![];_0x1eaf31[_0x4000('0xc4')](_0x36966f)['catch'](loggerCatch(_0x4000('0xe6')));if(_0x36966f['countbusyretry']+_0x36966f[_0x4000('0xe8')]+_0x36966f[_0x4000('0xfa')]+_0x36966f['countnosuchnumberretry']+_0x36966f[_0x4000('0xea')]+_0x36966f[_0x4000('0xeb')]+_0x36966f[_0x4000('0xef')]+_0x36966f[_0x4000('0xec')]>=_0x220f46[_0x4000('0xed')]){_0x1eaf31['stateGlobal'](_0x36966f,_0x4e7f48,_0x231fbd,_0x4000('0xee'));}else{if(_0x36966f[_0x4000('0xef')]>=_0x220f46['dialMachineMaxRetry']){_0x1eaf31[_0x4000('0xf1')](_0x36966f,_0x4e7f48,_0x231fbd,_0x4000('0xf2'));}else{_0x1eaf31['rescheduleContact']({'active':![],'countmachineretry':_0x36966f[_0x4000('0xef')],'scheduledat':moment()[_0x4000('0xfb')](_0x220f46[_0x4000('0xf4')],'minutes')[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x36966f[_0x4000('0xca')],'ListId':_0x36966f[_0x4000('0xcb')],'VoiceQueueId':_0x36966f[_0x4000('0xcd')]||undefined,'CampaignId':_0x36966f['CampaignId']||undefined})['catch'](loggerCatch(_0x4000('0xfc')));_0x4e7f48({'reschedule':0x1});}}});}}};Dialer[_0x4000('0x1a')]['syncHangup']=function(_0x9b7316){var _0x488fb3=this[_0x4000('0x26')][_0x9b7316[_0x4000('0xd5')]];var _0x29f15b=this;var _0x38cba3;if(_0x488fb3&&_0x488fb3[_0x4000('0x4d')]===_0x4000('0x7a')){delete this['uniqueId'][_0x9b7316[_0x4000('0xd5')]];this[_0x4000('0xc6')](this[_0x4000('0x20')][_0x488fb3[_0x4000('0xb0')]]);this[_0x4000('0x20')][_0x488fb3[_0x4000('0xb0')]]['ivrAnswerCallsDay']+=0x1;_0x38cba3=new Hangup(_0x488fb3,_0x9b7316);this[_0x4000('0xc4')](_0x38cba3)[_0x4000('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4000('0xc2')](_0x38cba3)[_0x4000('0xad')](loggerCatch(_0x4000('0xfd')));}if(_0x488fb3&&_0x488fb3[_0x4000('0x4d')]!=='ivr'&&isNotNull(this[_0x4000('0x1f')][_0x488fb3['queue']][_0x4000('0xfe')])){delete this[_0x4000('0x26')][_0x9b7316['uniqueid']];this[_0x4000('0xc6')](this[_0x4000('0x1f')][_0x488fb3['queue']]);this[_0x4000('0x1f')][_0x488fb3[_0x4000('0xb0')]][_0x4000('0x60')]+=0x1;this['voiceQueues'][_0x488fb3[_0x4000('0xb0')]][_0x4000('0xdc')]+=0x1;_0x38cba3=new Hangup(_0x488fb3,_0x9b7316);_0x38cba3[_0x4000('0xa5')]=0x10;_0x38cba3[_0x4000('0xf7')]=_0x4000('0xff');_0x38cba3[_0x4000('0xde')]=_0x4000('0x100');this['createHistory'](_0x38cba3)[_0x4000('0xad')](loggerCatch(_0x4000('0x101')));this[_0x4000('0xc2')](_0x38cba3)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x488fb3&&_0x488fb3['type']!=='ivr'&&!isNotNull(this[_0x4000('0x1f')][_0x488fb3[_0x4000('0xb0')]]['dialQueueProject'])){delete this[_0x4000('0x26')][_0x9b7316['uniqueid']];this[_0x4000('0xc6')](this[_0x4000('0x1f')][_0x488fb3[_0x4000('0xb0')]]);this[_0x4000('0x1f')][_0x488fb3[_0x4000('0xb0')]][_0x4000('0x6b')]+=0x1;_0x38cba3=new Hangup(_0x488fb3,_0x9b7316);_0x38cba3[_0x4000('0xa5')]=0xc;_0x38cba3[_0x4000('0xf7')]=_0x9b7316[_0x4000('0x102')];_0x38cba3[_0x4000('0xde')]=_0x4000('0x103');this['createHistory'](_0x38cba3)[_0x4000('0xad')](loggerCatch(_0x4000('0x101')));this[_0x4000('0xc2')](_0x38cba3)['catch'](loggerCatch(_0x4000('0xfd')));}};Dialer[_0x4000('0x1a')][_0x4000('0x104')]=function(_0x1967fc){var _0x10197f=this[_0x4000('0x26')][_0x1967fc[_0x4000('0xd5')]];var _0x50f31a=this;if(this[_0x4000('0x1f')][_0x1967fc['queue']]){if(_0x10197f&&_0x10197f[_0x4000('0x4d')]!==_0x4000('0x7a')){delete this[_0x4000('0x26')][_0x1967fc[_0x4000('0xd5')]];this[_0x4000('0x1f')][_0x1967fc[_0x4000('0xb0')]][_0x4000('0x60')]+=0x1;var _0x10bd68=new AgentComplete(_0x10197f,_0x1967fc);if(_0x1967fc[_0x4000('0x105')]===_0x4000('0x106')){_0x10bd68[_0x4000('0x107')]=this[_0x4000('0x1f')][_0x1967fc[_0x4000('0xb0')]][_0x4000('0x108')]&&this[_0x4000('0x1f')][_0x1967fc['queue']]['dialAgiAfterHangupAgent']?moment()[_0x4000('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x10bd68)[_0x4000('0xad')](loggerCatch(_0x4000('0x109')));this['moveContactManagedDialer'](_0x10bd68)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4000('0x1a')]['syncAgentConnect']=function(_0x5ae6d9){if(this['voiceQueues'][_0x5ae6d9[_0x4000('0xb0')]]){if(this[_0x4000('0x26')][_0x5ae6d9[_0x4000('0xd5')]]&&this['uniqueId'][_0x5ae6d9['uniqueid']]['type']!==_0x4000('0x7a')){this[_0x4000('0xc6')](this['voiceQueues'][_0x5ae6d9[_0x4000('0xb0')]]);this[_0x4000('0x26')][_0x5ae6d9[_0x4000('0xd5')]][_0x4000('0x10a')]=moment()[_0x4000('0x78')](_0x4000('0xf5'));}}};Dialer['prototype'][_0x4000('0x10b')]=function(_0x2101e5){this[_0x4000('0xc4')](_0x2101e5)[_0x4000('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4000('0xc2')](_0x2101e5)[_0x4000('0xad')](loggerCatch(_0x4000('0x10c')));};Dialer[_0x4000('0x1a')][_0x4000('0x10d')]=function(_0x47bc60){var _0x25ec87=this[_0x4000('0x26')][_0x47bc60['uniqueid']];var _0x386df8=this;if(this['voiceQueues'][_0x47bc60[_0x4000('0xb0')]]){if(_0x25ec87&&_0x25ec87['type']!==_0x4000('0x7a')){delete this[_0x4000('0x26')][_0x47bc60[_0x4000('0xd5')]];this[_0x4000('0xc6')](this['voiceQueues'][_0x47bc60[_0x4000('0xb0')]]);_0x25ec87[_0x4000('0x10e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xbaa3fe=new QueueCallerAbandon(_0x25ec87,_0x47bc60);if(getSeconds(_0x25ec87[_0x4000('0x10e')],_0x25ec87[_0x4000('0x10f')])>=_0x25ec87[_0x4000('0x110')]){this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x6e')]+=0x1;this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x66')]+=0x1;this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x70')]+=0x1;_0xbaa3fe[_0x4000('0xa5')]=0xa;_0xbaa3fe['statedesc']=_0x4000('0x111');_0xbaa3fe['dropreason']=_0x4000('0x112');_0xbaa3fe['agiafterat']=this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x108')]?moment()[_0x4000('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xbaa3fe[_0x4000('0xea')]+=0x1;_0xbaa3fe['countglobal']+=0x1;if(_0xbaa3fe[_0x4000('0xea')]>=this['voiceQueues'][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x113')]){this[_0x4000('0x10b')](_0xbaa3fe);}else{this[_0x4000('0xf3')]({'active':![],'countdropretry':_0xbaa3fe[_0x4000('0xea')],'scheduledat':moment()[_0x4000('0xfb')](this['voiceQueues'][_0x47bc60['queue']][_0x4000('0x114')],_0x4000('0x115'))[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x25ec87[_0x4000('0xca')],'ListId':_0x25ec87['ListId'],'VoiceQueueId':_0x25ec87[_0x4000('0xcd')]||undefined,'CampaignId':_0x25ec87[_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x116')));var _0x36f4f9=new History(_0xbaa3fe);_0x36f4f9['state']=0xa;_0x36f4f9['statedesc']='Drop';_0x36f4f9[_0x4000('0x117')]=moment()[_0x4000('0x78')](_0x4000('0xf5'));_0x36f4f9[_0x4000('0xa6')]=_0x36f4f9[_0x4000('0x117')];_0x36f4f9[_0x4000('0x118')]=_0xbaa3fe['calleridname'];_0x36f4f9[_0x4000('0x119')]=_0xbaa3fe['calleridnum'];this['createHistory'](_0x36f4f9)[_0x4000('0xad')](loggerCatch(_0x4000('0x11a')));}}else{this['voiceQueues'][_0x47bc60['queue']][_0x4000('0x6d')]+=0x1;this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]]['outboundDropCallsDayCallersExit']+=0x1;_0xbaa3fe[_0x4000('0xa5')]=0xb;_0xbaa3fe['statedesc']='Abandoned';_0xbaa3fe[_0x4000('0x11b')]=_0x4000('0x11c');_0xbaa3fe[_0x4000('0xeb')]+=0x1;_0xbaa3fe[_0x4000('0xe4')]+=0x1;if(_0xbaa3fe[_0x4000('0xeb')]>=this[_0x4000('0x1f')][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x11d')]){this[_0x4000('0x10b')](_0xbaa3fe);}else{this[_0x4000('0xf3')]({'active':![],'countabandonedretry':_0xbaa3fe[_0x4000('0xeb')],'scheduledat':moment()[_0x4000('0xfb')](this['voiceQueues'][_0x47bc60[_0x4000('0xb0')]][_0x4000('0x11e')],_0x4000('0x115'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x25ec87[_0x4000('0xca')],'ListId':_0x25ec87[_0x4000('0xcb')],'VoiceQueueId':_0x25ec87[_0x4000('0xcd')]||undefined,'CampaignId':_0x25ec87['CampaignId']||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x11f')));var _0x36f4f9=new History(_0xbaa3fe);_0x36f4f9['state']=0xb;_0x36f4f9['statedesc']='Abandoned';_0x36f4f9['starttime']=moment()[_0x4000('0x78')](_0x4000('0xf5'));_0x36f4f9[_0x4000('0xa6')]=_0x36f4f9[_0x4000('0x117')];_0x36f4f9[_0x4000('0x118')]=_0xbaa3fe['calleridname'];_0x36f4f9[_0x4000('0x119')]=_0xbaa3fe[_0x4000('0x119')];this[_0x4000('0xc4')](_0x36f4f9)[_0x4000('0xad')](loggerCatch(_0x4000('0x120')));}}}}};Dialer[_0x4000('0x1a')][_0x4000('0x35')]=function(_0x5e4029){if(this['actions'][_0x5e4029[_0x4000('0xd5')]]){this[_0x4000('0x24')][_0x5e4029['uniqueid']][_0x4000('0xac')]=_0x5e4029[_0x4000('0xac')];}if(this[_0x4000('0x26')][_0x5e4029[_0x4000('0xd5')]]){this[_0x4000('0x26')][_0x5e4029[_0x4000('0xd5')]]['channel']=_0x5e4029[_0x4000('0xac')];}};Dialer[_0x4000('0x1a')][_0x4000('0x39')]=function(_0x598570){if(strategy[this[_0x4000('0x1f')][this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]][_0x4000('0xb0')]][_0x4000('0x4f')]]===_0x4000('0x122')){if(this['actions'][_0x598570[_0x4000('0x121')]]&&_[_0x4000('0xaa')](this['actions'][_0x598570[_0x4000('0x121')]][_0x4000('0x123')])&&_0x598570[_0x4000('0xab')]==='1'&&_0x598570['paused']==='0'){if(this['agents'][_0x598570[_0x4000('0x124')]]){if(!this[_0x4000('0x125')][_0x598570['stateinterface']][_0x4000('0x123')]){this[_0x4000('0x125')][_0x598570[_0x4000('0x124')]][_0x4000('0x123')]=!![];this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]][_0x4000('0x123')]=!![];this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]][_0x4000('0x124')]=_0x598570[_0x4000('0x124')];}}}}else if((strategy[this['voiceQueues'][this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]]['queue']][_0x4000('0x4f')]]||_0x4000('0x19'))===_0x4000('0x19')){if(this[_0x4000('0x24')][_0x598570['actionid']]){if(this['agents'][_0x598570[_0x4000('0x124')]]){this['actions'][_0x598570[_0x4000('0x121')]]['stateinterface']=_0x598570[_0x4000('0x124')];if(_['isNil'](this[_0x4000('0x2b')][this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]]['queue']])){this[_0x4000('0x2b')][this['actions'][_0x598570[_0x4000('0x121')]][_0x4000('0xb0')]]=[];}this[_0x4000('0x2b')][this[_0x4000('0x24')][_0x598570['actionid']][_0x4000('0xb0')]][_0x4000('0x126')](_['merge'](_[_0x4000('0x127')](this[_0x4000('0x24')][_0x598570[_0x4000('0x121')]],[_0x4000('0x128'),_0x4000('0x124')]),{'status':_0x598570['status'],'paused':_0x598570[_0x4000('0x129')]}));}}}};function unlockQueueStatus(_0x225533,_0x4516e5){setTimeout(function(){if(_['isUndefined'](_0x225533['queueStatusComplete'])){loggerBooked['error'](_0x4000('0x12a'),_0x4516e5);}_0x225533[_0x4000('0x12b')]=!![];loggerBooked['info'](_0x4000('0x12c'),_0x4516e5,JSON['stringify'](_['pick'](_0x225533,[_0x4000('0x3e'),_0x4000('0x12b')])));},0x1f3);}Dialer[_0x4000('0x1a')]['syncQueueStatusComplete']=function(_0x45eae3){var _0x3bd165=this;var _0x58a300=_0x3bd165[_0x4000('0x1f')][_0x3bd165['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]];if(strategy[this[_0x4000('0x1f')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]][_0x4000('0x4f')]]==='roundrobin'){if(this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]]&&this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0x124')]){this[_0x4000('0x1e')][_0x4000('0x12d')](this['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0x128')],this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]]['stateinterface'])['catch'](function(_0x23fe3d){logger[_0x4000('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x4000('0x96')](_0x23fe3d,{'showHidden':![],'depth':null}));})[_0x4000('0x1c')](function(){_0x3bd165[_0x4000('0xc6')](_0x3bd165[_0x4000('0x1f')][_0x3bd165[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]);_0x3bd165[_0x4000('0x125')][_0x3bd165[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0x124')]][_0x4000('0x123')]=![];delete _0x3bd165[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]];unlockQueueStatus(_0x58a300);});}else{this[_0x4000('0xc6')](this[_0x4000('0x1f')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0xca')],'ListId':this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xcb')],'VoiceQueueId':this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xcd')]||undefined,'CampaignId':this['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x12e')));delete this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]];unlockQueueStatus(_0x58a300);}}else if((strategy[this[_0x4000('0x1f')][this['actions'][_0x45eae3['actionid']][_0x4000('0xb0')]][_0x4000('0x4f')]]||_0x4000('0x19'))===_0x4000('0x19')){var _0xd02ebe;if(this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]]&&!_[_0x4000('0x45')](this[_0x4000('0x2b')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]])){if(this[_0x4000('0x2c')][_0x3bd165['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]){this[_0x4000('0x2c')][_0x3bd165[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]=this[_0x4000('0x2c')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]?this[_0x4000('0x2c')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]:this[_0x4000('0x2b')][this['actions'][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]]?this[_0x4000('0x2b')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]][_0x4000('0xb0')]][_0x4000('0x12f')]||0x0:0x0;}this['queueBooked'][this[_0x4000('0x24')][_0x45eae3['actionid']][_0x4000('0xb0')]][_0x4000('0x12f')]=this[_0x4000('0x2c')][this[_0x4000('0x24')][_0x45eae3[_0x4000('0x121')]]['queue']];for(var _0x223374=0x0;_0x223374=0x0?!![]:![];})[_0x4000('0xad')](myreject(_0x30a020)));}}else{_0x6f3618[_0x4000('0x126')](ami[_0x4000('0x148')]({'action':_0x4000('0x149'),'command':util[_0x4000('0x78')](_0x4000('0x14a'),_0x3f6baf,!_['isUndefined'](config[_0x4000('0x144')][_0x46fba2])?_0x46fba2:'')})['then'](function(_0x37bf47){return _0x37bf47['content']['indexOf'](_0x4000('0x14c'))>=0x0?!![]:![];})[_0x4000('0xad')](myreject(_0x30a020)));}BPromise[_0x4000('0x14d')](_0x6f3618)[_0x4000('0xb4')](function(_0x1c4cca){var _0x4b8e5a=_[_0x4000('0x14e')](_0x1c4cca);if(_0x4b8e5a){return _0x467e05(_0x4b8e5a);}else{_0x2774bd[_0x4000('0x42')]=_0x39deb7?_0x4000('0x14f'):_0x4000('0x150');return _0x30a020(msgResponse(_0x4000('0x151'),_0x4000('0x140'),'Global:\x20'+_0x39deb7+'\x20'+_0x1a46d1+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x3f6baf,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x46fba2));}})['catch'](function(_0x36308b){return _0x30a020(msgResponse(_0x4000('0x13f'),_0x4000('0x140'),JSON[_0x4000('0x49')](_0x36308b)));});});};Dialer['prototype'][_0x4000('0x152')]=function(_0x32779a){var _0x164f75=this;return function(){switch(_0x32779a[_0x4000('0x5c')]){case _0x4000('0x153'):freeVariablesPredictive(_0x32779a);_0x164f75[_0x4000('0x154')](_0x32779a,0x1);break;case _0x4000('0x155'):freeVariablesPredictive(_0x32779a);_0x164f75[_0x4000('0x154')](_0x32779a,_0x32779a[_0x4000('0x156')]);break;case _0x4000('0x157'):_0x164f75[_0x4000('0x157')](_0x32779a);break;case _0x4000('0x9'):freeVariablesPredictive(_0x32779a);_0x164f75[_0x4000('0x154')](_0x32779a,0x1);break;default:freeVariablesPredictive(_0x32779a);logger['error']('Queue',_0x32779a[_0x4000('0x3e')],_0x4000('0x158'));}};};Dialer[_0x4000('0x1a')][_0x4000('0x159')]=function(_0x45378c){var _0x313b81=this;return function(){_0x313b81[_0x4000('0x15a')](_0x45378c);};};Dialer['prototype']['syncQueueSummary']=function(_0x36a24f){var _0x511266=this;if(isNotPreview(_0x36a24f[_0x4000('0x5c')])){if(isVoiceQueueOutbound(_0x36a24f[_0x4000('0x4d')])&&isActive(_0x36a24f[_0x4000('0x5b')])){_0x36a24f[_0x4000('0x9f')]=!![];BPromise['resolve']()[_0x4000('0xb4')](checkIsLoggedIn(_0x36a24f,_0x36a24f[_0x4000('0x52')]))[_0x4000('0xb4')](checkIsActive(_0x36a24f,_0x36a24f[_0x4000('0x5b')]))[_0x4000('0xb4')](checkInterval(_0x36a24f))['then'](_0x511266[_0x4000('0x139')](_0x36a24f))[_0x4000('0xb4')](_0x511266[_0x4000('0x13d')](_0x36a24f[_0x4000('0x15b')],_0x36a24f['dialTimezone'],_0x36a24f['name'],_0x36a24f))[_0x4000('0xb4')](_0x511266[_0x4000('0x13e')](_0x36a24f[_0x4000('0x41')],_0x36a24f[_0x4000('0x15c')],_0x36a24f['name'],_0x36a24f))[_0x4000('0xb4')](_0x511266[_0x4000('0x152')](_0x36a24f))[_0x4000('0xad')](loggerCatchQueueSummary(_0x4000('0x15d'),_0x36a24f));}else{notSendMessagesQueue(_0x36a24f);}}else{freeVariablesPredictive(_0x36a24f);}};Dialer[_0x4000('0x1a')][_0x4000('0x138')]=function(){var _0x390ee5=this;var _0x430ce6;for(var _0x365e93 in this[_0x4000('0x20')]){if(this[_0x4000('0x20')][_0x4000('0xa9')](_0x365e93)){_0x430ce6=this[_0x4000('0x20')][_0x365e93];if(isCampaignIvr(_0x430ce6[_0x4000('0x4d')])&&isActive(_0x430ce6['active'])){_0x430ce6[_0x4000('0x9f')]=!![];BPromise[_0x4000('0xb3')]()['then'](checkIsActive(_0x430ce6,_0x430ce6[_0x4000('0xd2')]))[_0x4000('0xb4')](checkInterval(_0x430ce6))[_0x4000('0xb4')](_0x390ee5['checkIsTrunkReachable'](_0x430ce6))[_0x4000('0xb4')](_0x390ee5[_0x4000('0x13d')](_0x430ce6[_0x4000('0x15b')],_0x430ce6['dialTimezone'],_0x430ce6[_0x4000('0x3e')],_0x430ce6))[_0x4000('0xb4')](_0x390ee5['checkIfTimeIntervals'](_0x430ce6[_0x4000('0x41')],_0x430ce6['dialTimezone'],_0x430ce6[_0x4000('0x3e')],_0x430ce6))[_0x4000('0xb4')](_0x390ee5[_0x4000('0x159')](_0x430ce6))[_0x4000('0xad')](loggerCatchQueueSummary(_0x4000('0x15e'),_0x430ce6));}else{notSendMessagesCampaign(_0x430ce6);}}}};function getCallerIdRandom(_0x476186,_0x41144a){var _0x193017,_0x2778b0,_0x1600d8;if(_0x41144a<=0x0){_0x41144a=0x1;}_0x193017=new RegExp(_0x4000('0x15f')+_0x41144a+'}$');_0x2778b0=Math[_0x4000('0x160')](0xa,_0x41144a-0x1);_0x1600d8=Math[_0x4000('0x160')](0xa,_0x41144a)-0x1;return util['format']('%s',_[_0x4000('0x161')](_0x476186,_0x193017,_[_0x4000('0x162')](_0x2778b0,_0x1600d8)));}function extractCalleridName(_0x3ce075){var _0x3ccc6b=_0x3ce075['match'](/"(.*?)"/);return _0x3ccc6b?_0x3ccc6b[0x1]:_0x3ce075;}function extractCalleridNumber(_0xb8ab98){var _0x2489af=_0xb8ab98['match'](/<(.*?)>/);return _0x2489af?_0x2489af[0x1]:_0xb8ab98;}Dialer[_0x4000('0x1a')][_0x4000('0x163')]=function(_0x337521,_0x4213b4){var _0x12ac0e=this;var _0x15f8dd=uuid['v4']();this['actions'][_0x15f8dd]=new Action(_0x337521,_0x4213b4,_0x15f8dd);return new BPromise(function(_0x775816,_0x2e1c78){if(_[_0x4000('0x3d')](_0x337521)&&_0x4000('0x164')!==typeof _0x337521){return _0x2e1c78(msgResponse(_0x4000('0x165'),_0x4000('0x140'),_0x4000('0x166')));}if(_[_0x4000('0x3d')](_0x4213b4[_0x4000('0x167')][_0x4000('0x168')])||_0x4213b4[_0x4000('0x167')]['phone']===null){return _0x2e1c78(msgResponse(_0x4000('0x165'),_0x4000('0x140'),_0x4000('0x169')));}var _0x1ba429={'XMD-CALLERID':_0x12ac0e[_0x4000('0x24')][_0x15f8dd][_0x4000('0x16a')](),'XMD-AGI':_0x337521[_0x4000('0xfe')]?util[_0x4000('0x78')](_0x4000('0x16b'),ipAgi,_0x337521['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x337521[_0x4000('0x108')]?util[_0x4000('0x78')](_0x4000('0x16b'),ipAgi,_0x337521[_0x4000('0x108')]):_0x4000('0x16c'),'XMD-QUEUE':_0x337521['type']===_0x4000('0x4e')?util[_0x4000('0x78')](_0x4000('0x16d'),_0x337521[_0x4000('0x3e')],_0x337521[_0x4000('0x16e')]||'',_0x337521[_0x4000('0x16f')]?'c':'',_0x337521['dialQueueTimeout']||0x3):_0x4000('0x16c'),'XMD-CONTACTID':_0x4213b4[_0x4000('0xca')],'XMD-CDRTYPE':_0x4000('0x8'),'CALLERID(all)':_0x12ac0e[_0x4000('0x24')][_0x15f8dd][_0x4000('0x16a')](),'XMD-AMD':_0x337521['dialAMDActive']?_0x4000('0x170'):_0x4000('0x16c'),'XMD-DESTINATION':_0x4000('0xd9')};if(_0x337521[_0x4000('0xe1')]){_0x1ba429['XMD-AMDINITIALSILENCE']=_0x337521[_0x4000('0x171')]||0x9c4;_0x1ba429[_0x4000('0x172')]=_0x337521[_0x4000('0x173')]||0x5dc;_0x1ba429[_0x4000('0x174')]=_0x337521[_0x4000('0x175')]||0x320;_0x1ba429[_0x4000('0x176')]=_0x337521[_0x4000('0x177')]||0x1388;_0x1ba429[_0x4000('0x178')]=_0x337521[_0x4000('0x179')]||0x64;_0x1ba429[_0x4000('0x17a')]=_0x337521[_0x4000('0x17b')]||0x32;_0x1ba429[_0x4000('0x17c')]=_0x337521[_0x4000('0x17d')]||0x3;_0x1ba429[_0x4000('0x17e')]=_0x337521[_0x4000('0x17f')]||0x100;_0x1ba429[_0x4000('0x180')]=_0x337521[_0x4000('0x181')]||0x1388;}if(_0x337521[_0x4000('0x4d')]===_0x4000('0x4e')){_0x1ba429[_0x4000('0x182')]=_0x4213b4[_0x4000('0xcd')];}else{_0x1ba429[_0x4000('0x183')]=_0x4213b4[_0x4000('0xf6')];}for(var _0x51ec9c in _0x4213b4[_0x4000('0x167')]){if(_0x4213b4[_0x4000('0x167')][_0x4000('0xa9')](_0x51ec9c)){if(isNotNull(_0x4213b4[_0x4000('0x167')][_0x51ec9c])&&_0x51ec9c!=='id'&&_0x51ec9c!==_0x4000('0x184')&&_0x51ec9c!=='createdAt'&&_0x51ec9c!==_0x4000('0x185')){_0x1ba429[util['format']('%s%s',_0x4000('0x186'),_[_0x4000('0x187')](_0x51ec9c))]=_0x4213b4[_0x4000('0x167')][_0x51ec9c];}}}var _0x3ba27d=_0x12ac0e[_0x4000('0xd1')](_0x337521[_0x4000('0x76')])?getCallerId(_0x337521['Trunk'][_0x4000('0x77')],_0x337521[_0x4000('0x5d')],_0x337521[_0x4000('0x188')]>0x0?getCallerIdRandom(_0x337521['dialOriginateCallerIdNumber'],_0x337521['dialRandomLastDigitCallerIdNumber']):_0x337521[_0x4000('0x189')]):getCallerId(_['isNil'](_0x337521['TrunkBackup'])?_0x337521[_0x4000('0x76')][_0x4000('0x77')]:_0x337521[_0x4000('0x13a')]['callerid'],_0x337521[_0x4000('0x5d')],_0x337521['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x337521[_0x4000('0x189')],_0x337521[_0x4000('0x188')]):_0x337521[_0x4000('0x189')]);if(_0x3ba27d){_0x1ba429[_0x4000('0x18a')]=_0x12ac0e[_0x4000('0x24')][_0x15f8dd][_0x4000('0x18b')]=extractCalleridName(_0x3ba27d);_0x1ba429[_0x4000('0x18c')]=_0x12ac0e[_0x4000('0x24')][_0x15f8dd]['originatecalleridnum']=extractCalleridNumber(_0x3ba27d);}return ami[_0x4000('0x148')]({'actionid':_0x15f8dd,'action':_0x4000('0x165'),'channel':_0x12ac0e[_0x4000('0xd1')](_0x337521[_0x4000('0x76')])?util[_0x4000('0x78')](_0x4000('0x18d'),_0x337521[_0x4000('0x76')][_0x4000('0x3e')],isNotNull(_0x337521[_0x4000('0x5f')])?_0x337521[_0x4000('0x5f')][_0x4000('0x18e')]()||'':'',_0x337521[_0x4000('0x18f')]>0x0?_0x4213b4['Contact'][_0x4000('0x168')][_0x4000('0x190')](_0x337521[_0x4000('0x18f')]):_0x4213b4[_0x4000('0x167')]['phone']):util['format'](_0x4000('0x18d'),_['isNil'](_0x337521[_0x4000('0x13a')])?_0x337521['Trunk'][_0x4000('0x3e')]:_0x337521[_0x4000('0x13a')][_0x4000('0x3e')],isNotNull(_0x337521[_0x4000('0x5f')])?_0x337521['dialPrefix'][_0x4000('0x18e')]()||'':'',_0x337521[_0x4000('0x18f')]>0x0?_0x4213b4['Contact'][_0x4000('0x168')][_0x4000('0x190')](_0x337521['dialCutDigit']):_0x4213b4[_0x4000('0x167')][_0x4000('0x168')]),'callerid':_0x3ba27d,'Exten':_0x4000('0xd9'),'Context':'from-sip','Priority':'1','variable':_0x1ba429,'timeout':(_0x337521[_0x4000('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x15f8dd})[_0x4000('0xb4')](function(_0x52221e){return _0x775816(_0x52221e);})[_0x4000('0xad')](function(_0x33e1ed){_0x337521[_0x4000('0x69')]+=0x1;var _0x239b95=new History(_0x12ac0e[_0x4000('0x24')][_0x15f8dd]);logger[_0x4000('0x95')](util[_0x4000('0x78')](_0x4000('0x191'),JSON[_0x4000('0x49')](_0x33e1ed)));_0x239b95[_0x4000('0xa5')]=0xe;_0x239b95[_0x4000('0xf7')]=_0x4000('0x192');_0x239b95[_0x4000('0x117')]=moment()[_0x4000('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x239b95[_0x4000('0xa6')]=_0x239b95[_0x4000('0x117')];_0x12ac0e[_0x4000('0xc4')](_0x239b95)[_0x4000('0xad')](loggerCatch(_0x4000('0x193')));_0x12ac0e[_0x4000('0xc2')](_0x239b95)[_0x4000('0xad')](loggerCatch(_0x4000('0x193')))[_0x4000('0x1c')](function(){delete _0x12ac0e['actions'][_0x15f8dd];return _0x2e1c78(msgResponse(_0x4000('0x165'),_0x4000('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0x4000('0x1a')]['syncOriginateResponse']=function(_0x5d1026){var _0x4551c3=this[_0x4000('0x24')][_0x5d1026[_0x4000('0x121')]];var _0x2b6b29=this;if(_0x4551c3){delete this[_0x4000('0x24')][_0x5d1026[_0x4000('0x121')]];_0x4551c3[_0x4000('0x10f')]=moment()[_0x4000('0x78')](_0x4000('0xf5'));var _0x115e83=_0x4551c3[_0x4000('0x4d')]===_0x4000('0x7a')?this[_0x4000('0x20')][_0x4551c3[_0x4000('0xb0')]]:this['voiceQueues'][_0x4551c3[_0x4000('0x194')]()];if(!this['isSuccess'](_0x5d1026[_0x4000('0x195')])){this[_0x4000('0xc6')](_0x115e83);return this[_0x4000('0x196')](_0x4551c3,_0x115e83,_0x5d1026)['then'](function(_0x420df0){})[_0x4000('0xad')](loggerCatch(_0x4000('0x197')));}else{this['uniqueId'][_0x5d1026[_0x4000('0xd5')]]=_0x4551c3;}}};Dialer[_0x4000('0x1a')][_0x4000('0x198')]=function(_0x375ee6,_0x27493c,_0x50e813){var _0x4e2bb0=new History(_0x27493c);if(_0x4e2bb0[_0x4000('0xe7')]+_0x4e2bb0['countcongestionretry']+_0x4e2bb0[_0x4000('0xfa')]+_0x4e2bb0[_0x4000('0xe9')]+_0x4e2bb0[_0x4000('0xea')]+_0x4e2bb0['countabandonedretry']+_0x4e2bb0[_0x4000('0xef')]+_0x4e2bb0[_0x4000('0xec')]>=_0x50e813[_0x4000('0xed')]-0x1){return!![];}switch(_0x375ee6){case 0x3:if(_0x4e2bb0['countnoanswerretry']>=_0x50e813[_0x4000('0x199')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4e2bb0[_0x4000('0xfa')]+=0x1,'scheduledat':moment()['add'](_0x50e813[_0x4000('0x19a')],_0x4000('0x115'))[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0['ListId'],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0['CampaignId']||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x19b')));}break;case 0x5:if(_0x4e2bb0[_0x4000('0xe7')]>=_0x50e813['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countbusyretry':_0x4e2bb0[_0x4000('0xe7')]+=0x1,'scheduledat':moment()[_0x4000('0xfb')](_0x50e813['dialBusyRetryFrequency'],_0x4000('0x115'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e2bb0['ContactId'],'ListId':_0x4e2bb0[_0x4000('0xcb')],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0[_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x19c')));}break;case 0x8:if(_0x4e2bb0[_0x4000('0xe8')]>=_0x50e813[_0x4000('0x19d')]-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countcongestionretry':_0x4e2bb0[_0x4000('0xe8')]+=0x1,'scheduledat':moment()[_0x4000('0xfb')](_0x50e813[_0x4000('0x19e')],_0x4000('0x115'))[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0['ListId'],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0[_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x19f')));}break;case 0x0:if(_0x4e2bb0[_0x4000('0xe9')]>=_0x50e813[_0x4000('0x1a0')]-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countnosuchnumberretry':_0x4e2bb0[_0x4000('0xe9')]+=0x1,'scheduledat':moment()[_0x4000('0xfb')](_0x50e813['dialNoSuchNumberRetryFrequency'],'minutes')[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0[_0x4000('0xcb')],'VoiceQueueId':_0x4e2bb0['VoiceQueueId']||undefined,'CampaignId':_0x4e2bb0[_0x4000('0xf6')]||undefined})['catch'](loggerCatch(_0x4000('0x1a1')));}break;case 0xa:if(_0x4e2bb0[_0x4000('0xea')]>=_0x50e813['dialDropMaxRetry']-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countdropretry':_0x4e2bb0[_0x4000('0xea')]+=0x1,'scheduledat':moment()[_0x4000('0xfb')](_0x50e813[_0x4000('0x114')],_0x4000('0x115'))[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0['ContactId'],'ListId':_0x4e2bb0[_0x4000('0xcb')],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0[_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x116')));}break;case 0xb:if(_0x4e2bb0[_0x4000('0xeb')]>=_0x50e813[_0x4000('0x11d')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x4e2bb0[_0x4000('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x50e813['dialAbandonedRetryFrequency'],_0x4000('0x115'))[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0[_0x4000('0xcb')],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0['CampaignId']||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x11f')));}break;case 0x13:if(_0x4e2bb0[_0x4000('0xef')]>=_0x50e813[_0x4000('0xf0')]-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countmachineretry':_0x4e2bb0[_0x4000('0xef')]+=0x1,'scheduledat':moment()['add'](_0x50e813['dialMachineRetryFrequency'],_0x4000('0x115'))[_0x4000('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0[_0x4000('0xcb')],'VoiceQueueId':_0x4e2bb0[_0x4000('0xcd')]||undefined,'CampaignId':_0x4e2bb0[_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0xfc')));}break;case 0x14:if(_0x4e2bb0[_0x4000('0xec')]>=_0x50e813[_0x4000('0x1a2')]-0x1){return!![];}else{this[_0x4000('0xf3')]({'active':![],'countagentrejectretry':_0x4e2bb0[_0x4000('0xec')]+=0x1,'scheduledat':moment()[_0x4000('0xfb')](_0x50e813[_0x4000('0x1a3')],'minutes')[_0x4000('0x78')](_0x4000('0xf5')),'ContactId':_0x4e2bb0[_0x4000('0xca')],'ListId':_0x4e2bb0['ListId'],'VoiceQueueId':_0x4e2bb0['VoiceQueueId']||undefined,'CampaignId':_0x4e2bb0['CampaignId']||undefined})[_0x4000('0xad')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0x4000('0x1a')][_0x4000('0x196')]=function(_0x19ee57,_0xdd45bf,_0x48ad8a){var _0x4af650=this;var _0x2ed4f0=new History(_0x19ee57);return new BPromise(function(_0x1da7c5,_0x38cabd){if(_['isUndefined'](_0xdd45bf)&&'object'!==typeof _0xdd45bf){return _0x38cabd(msgResponse(_0x4000('0x1a4'),_0x4000('0x140'),_0x4000('0x1a5')));}if(_[_0x4000('0x3d')](_0x48ad8a)&&_0x4000('0x164')!==typeof _0x48ad8a){return _0x38cabd(msgResponse(_0x4000('0x1a4'),_0x4000('0x140'),_0x4000('0x1a6')));}switch(_0x48ad8a[_0x4000('0x105')]){case'0':_0xdd45bf[_0x4000('0x68')]+=0x1;_0x2ed4f0[_0x4000('0xa5')]=0x0;_0x2ed4f0[_0x4000('0xf7')]='NoSuchNumber';_0x2ed4f0[_0x4000('0xe9')]+=0x1;_0x2ed4f0[_0x4000('0xe4')]+=0x1;ami[_0x4000('0x4c')](_0x4000('0x1a7'),ut[_0x4000('0x1a8')](_0x19ee57,_0x4000('0x1a9')));_0x4af650[_0x4000('0xc4')](_0x2ed4f0)['catch'](loggerCatch(_0x4000('0xe6')));if(_0x4af650[_0x4000('0x198')](0x0,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xe9')]>=_0xdd45bf[_0x4000('0x1a0')]){_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,'reason\x200\x20no\x20such\x20number....');}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1ab'));}}break;case'3':_0xdd45bf[_0x4000('0x67')]+=0x1;_0x2ed4f0[_0x4000('0xa5')]=0x3;_0x2ed4f0['statedesc']=_0x4000('0x1ac');_0x2ed4f0['countnoanswerretry']+=0x1;_0x2ed4f0[_0x4000('0xe4')]+=0x1;ami[_0x4000('0x4c')]('custom:agentnoanswer',ut[_0x4000('0x1a8')](_0x19ee57,_0x4000('0x1ad')));_0x4af650[_0x4000('0xc4')](_0x2ed4f0)['catch'](loggerCatch(_0x4000('0x1ae')));if(_0x4af650['checkRetriveMax'](0x3,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xfa')]>=_0xdd45bf['dialNoAnswerMaxRetry']){_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1af'));}}break;case'5':_0xdd45bf[_0x4000('0x62')]+=0x1;_0x2ed4f0['state']=0x5;_0x2ed4f0['statedesc']=_0x4000('0x1b0');_0x2ed4f0[_0x4000('0xe7')]+=0x1;_0x2ed4f0[_0x4000('0xe4')]+=0x1;ami[_0x4000('0x4c')](_0x4000('0x1b1'),ut[_0x4000('0x1a8')](_0x19ee57,'busy'));_0x4af650['createHistory'](_0x2ed4f0)[_0x4000('0xad')](loggerCatch(_0x4000('0x1b2')));if(_0x4af650['checkRetriveMax'](0x5,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xe7')]>=_0xdd45bf[_0x4000('0x1b3')]){_0x4af650['createStateFinal'](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1b4'));}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1b4'));}}break;case'8':_0xdd45bf[_0x4000('0x63')]+=0x1;_0x2ed4f0['state']=0x8;_0x2ed4f0['statedesc']=_0x4000('0x1b5');_0x2ed4f0['countcongestionretry']+=0x1;_0x2ed4f0[_0x4000('0xe4')]+=0x1;ami[_0x4000('0x4c')](_0x4000('0x1b6'),ut[_0x4000('0x1a8')](_0x19ee57,_0x4000('0x1b7')));_0x4af650[_0x4000('0xc4')](_0x2ed4f0)[_0x4000('0xad')](loggerCatch(_0x4000('0x1b8')));if(_0x4af650[_0x4000('0x198')](0x8,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xe8')]>=_0xdd45bf[_0x4000('0x19d')]){_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1b9'));}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1b9'));}}break;case'11':_0xdd45bf[_0x4000('0x1ba')]+=0x1;_0x2ed4f0[_0x4000('0xa5')]=0xb;_0x2ed4f0[_0x4000('0xf7')]=_0x4000('0x1bb');_0x2ed4f0['countabandonedretry']+=0x1;_0x2ed4f0['countglobal']+=0x1;_0x4af650[_0x4000('0xc4')](_0x2ed4f0)['catch'](loggerCatch(_0x4000('0x120')));if(_0x4af650[_0x4000('0x198')](0xb,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xeb')]>=_0xdd45bf[_0x4000('0x11d')]){_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1bc'));}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1bc'));}}break;case'20':_0xdd45bf[_0x4000('0x1bd')]+=0x1;_0x2ed4f0[_0x4000('0xa5')]=0x14;_0x2ed4f0[_0x4000('0xf7')]=_0x4000('0x1be');_0x2ed4f0[_0x4000('0xec')]+=0x1;_0x2ed4f0[_0x4000('0xe4')]+=0x1;ami[_0x4000('0x4c')](_0x4000('0x1bf'),ut[_0x4000('0x1a8')](_0x19ee57,_0x4000('0x1c0')));_0x4af650[_0x4000('0xc4')](_0x2ed4f0)['catch'](loggerCatch(_0x4000('0x1c1')));if(_0x4af650[_0x4000('0x198')](0x14,_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xec')]>=_0xdd45bf[_0x4000('0x1a2')]){_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1c2'));}else{_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x4000('0x1c2'));}}break;default:_0xdd45bf['outboundUnknownCallsDay']+=0x1;_0x2ed4f0[_0x4000('0xa5')]=0xc;_0x2ed4f0['statedesc']=_0x48ad8a['reason'];_0x4af650[_0x4000('0xc4')](_0x2ed4f0)[_0x4000('0xad')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4af650[_0x4000('0x198')](_0x48ad8a[_0x4000('0x105')],_0x19ee57,_0xdd45bf)){if(_0x2ed4f0[_0x4000('0xe7')]+_0x2ed4f0[_0x4000('0xe8')]+_0x2ed4f0[_0x4000('0xfa')]+_0x2ed4f0['countnosuchnumberretry']+_0x2ed4f0[_0x4000('0xea')]+_0x2ed4f0[_0x4000('0xeb')]+_0x2ed4f0[_0x4000('0xef')]+_0x2ed4f0[_0x4000('0xec')]>=_0xdd45bf[_0x4000('0xed')]){_0x4af650[_0x4000('0x1aa')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x48ad8a[_0x4000('0x105')]);}else{_0x4af650[_0x4000('0xf1')](_0x2ed4f0,_0x1da7c5,_0x38cabd,_0x48ad8a['reason']);}}}});};Dialer[_0x4000('0x1a')][_0x4000('0x1aa')]=function(_0x2fd9e1,_0x55c3f1,_0x166665,_0x4b7301){var _0x150ca6=new Final(_0x2fd9e1);_0x150ca6[_0x4000('0xa5')]=0xf;_0x150ca6[_0x4000('0xf7')]=_0x4000('0x1c3');this[_0x4000('0xf1')](_0x150ca6,_0x55c3f1,_0x166665,_0x4b7301);};Dialer[_0x4000('0x1a')][_0x4000('0xf1')]=function(_0xe24f43,_0x55e34b,_0x22a62e,_0x23b2a9){this[_0x4000('0xc2')](_0xe24f43)[_0x4000('0xb4')](function(_0x28b84d){return _0x55e34b(msgResponse(_0x4000('0x1a4'),_0x4000('0x1c4'),_0x23b2a9));})[_0x4000('0xad')](function(_0x5355ac){return _0x22a62e(msgResponse('[moveContactManagedDialer][0]',_0x4000('0x140'),_0x4000('0x1c5')));});};Dialer[_0x4000('0x1a')][_0x4000('0x157')]=function(_0x4bceae){var _0x245b44=this;var _0x1c3304=_0x4bceae[_0x4000('0x1c6')]/0x64;var _0x5782b3=_0x4bceae[_0x4000('0x66')]/(_0x4bceae[_0x4000('0x66')]+_0x4bceae['outboundAnswerCallsDay']);var _0x805ee8=Math[_0x4000('0x1c7')](_0x4bceae[_0x4000('0x71')]*(_0x4bceae[_0x4000('0x1c8')]/0x64));var _0x5b83f5=Math[_0x4000('0x1c7')](_0x4bceae[_0x4000('0x71')]*(_0x4bceae[_0x4000('0x1c9')]/0x64));var _0x124458=_0x4bceae[_0x4000('0x51')]+_0x4bceae[_0x4000('0x55')];var _0x2c1991=Math[_0x4000('0x1ca')](_0x4bceae[_0x4000('0x1cb')]*_0x4bceae['erlangAbandonmentRate']*_0x4bceae[_0x4000('0x1cc')]*_0x4bceae['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x4bceae['startProgressive'])){if(!_[_0x4000('0x3d')](_0x4bceae[_0x4000('0x28')])){_0x4bceae['startPredictive']=undefined;loggerPredictive[_0x4000('0x95')]('[startMethodPredictive][StartProgressive]',_0x4000('0x1cd'));}if(!_[_0x4000('0x3d')](_0x4bceae['handlePredictive'])){loggerPredictive[_0x4000('0x95')](_0x4000('0x1ce'),_0x4000('0x1cf'));clearInterval(_0x4bceae[_0x4000('0x90')]);_0x4bceae[_0x4000('0x90')]=undefined;}_0x4bceae[_0x4000('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4000('0x7d')](_0x4bceae[_0x4000('0x3e')],_0x4000('0x1d0'),_0x4bceae['startProgressive']);this[_0x4000('0x154')](_0x4bceae,0x1);}else if(ifInterval(_0x4bceae[_0x4000('0x1d1')],_0x4bceae[_0x4000('0x29')])){this[_0x4000('0x154')](_0x4bceae,0x1);loggerPredictiveCalls['info'](_0x4000('0x1d2'),_0x4bceae[_0x4000('0x29')],_0x4bceae['name']);_0x4bceae[_0x4000('0x1cb')]=0x0;_0x4bceae[_0x4000('0x70')]=0x0;}else if(_0x1c3304<_0x5782b3&&_0x4bceae[_0x4000('0x1d3')]===_0x4000('0x1d4')){freeVariablesPredictive(_0x4bceae);loggerPredictive[_0x4000('0x7d')](_0x4000('0x1d5'),_0x4000('0x1d6'),_0x5782b3,'startProgressive',_0x4bceae[_0x4000('0x3e')]);}else if(_0x2c1991<_0x4bceae['predictiveIntervalErlangCallsDroppedCalls']&&_0x4bceae['dialPredictiveOptimization']===_0x4000('0x1d4')){freeVariablesPredictive(_0x4bceae);loggerPredictive[_0x4000('0x7d')](_0x4000('0x1d7'),'Max\x20Drop\x20',_0x2c1991,_0x4000('0x1d8'),_0x4bceae[_0x4000('0x70')],_0x4000('0x29'),_0x4bceae['name']);}else if(!ifInterval(_0x4bceae[_0x4000('0x1d1')],_0x4bceae[_0x4000('0x29')])&&_[_0x4000('0x3d')](_0x4bceae['startPredictive'])&&!_[_0x4000('0x3d')](_0x4bceae[_0x4000('0x29')])){_0x4bceae[_0x4000('0x28')]=moment()[_0x4000('0x78')](_0x4000('0xf5'));loggerPredictive['info'](_0x4bceae['name'],'started\x20in\x20predictive\x20at',_0x4bceae[_0x4000('0x28')]);this[_0x4000('0x1d9')](_0x4bceae[_0x4000('0x1d1')])[_0x4000('0xb4')](this[_0x4000('0x1da')](_0x4bceae))[_0x4000('0xb4')](mergeDataErlangB(_0x4bceae))[_0x4000('0xb4')](this[_0x4000('0x1db')](_0x4bceae))[_0x4000('0xad')](loggerCatchPredictive(_0x4000('0x1dc'),_0x4bceae));}else if(!ifInterval(_0x4bceae[_0x4000('0x1d1')],_0x4bceae['startPredictive'])){_0x4bceae[_0x4000('0x70')]=0x0;_0x4bceae[_0x4000('0x28')]=moment()[_0x4000('0x78')](_0x4000('0xf5'));loggerPredictive[_0x4000('0x7d')](_0x4bceae[_0x4000('0x3e')],'recalculate\x20predictive\x20at',_0x4bceae['startPredictive']);clearInterval(_0x4bceae[_0x4000('0x90')]);_0x4bceae[_0x4000('0x90')]=undefined;this[_0x4000('0x1d9')](_0x4bceae[_0x4000('0x1d1')])[_0x4000('0xb4')](this['getDataPredictive'](_0x4bceae))['then'](mergeDataErlangB(_0x4bceae))[_0x4000('0xb4')](this[_0x4000('0x1db')](_0x4bceae))['catch'](loggerCatchPredictive(_0x4000('0x1dd'),_0x4bceae));}else if(_0x4bceae[_0x4000('0x71')]&&_0x124458<_0x4bceae[_0x4000('0x71')]-_0x5b83f5){freeVariablesPredictive(_0x4bceae);loggerPredictive[_0x4000('0x7d')](_0x4bceae[_0x4000('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x124458,_0x4000('0x1de'),_0x4bceae[_0x4000('0x71')],'-',_0x5b83f5,'=',_0x4bceae['predictiveIntervalAvailable']-_0x5b83f5,')');}else if(_0x4bceae[_0x4000('0x71')]&&_0x124458>_0x4bceae[_0x4000('0x71')]+_0x805ee8){freeVariablesPredictive(_0x4bceae);loggerPredictive[_0x4000('0x7d')](_0x4bceae[_0x4000('0x3e')],_0x4000('0x1df'),_0x124458,_0x4000('0x1e0'),_0x4bceae['predictiveIntervalAvailable'],'+',_0x805ee8,'=',_0x4bceae[_0x4000('0x71')]+_0x805ee8,')');}};Dialer[_0x4000('0x1a')][_0x4000('0x1da')]=function(_0x13aa57){var _0xab221a=this;return function(_0x3e5834){return new BPromise(function(_0x1b1c34,_0x41cb77){_['merge'](_0x13aa57,_0x3e5834[0x0]);if(checkGetDataPredictive(_0x3e5834[0x0])){var _0x4e7398=_0x13aa57[_0x4000('0x71')]=_0x13aa57[_0x4000('0x55')]+_0x13aa57[_0x4000('0x51')];var _0x3cd854=_0x13aa57['dialPredictiveInterval']*0x3c;var _0x5f3cd9=_0x3e5834[0x0][_0x4000('0x83')]+_0x3e5834[0x0][_0x4000('0x6c')];var _0x4547e5=(_0x3e5834[0x0][_0x4000('0x80')]+_0x3e5834[0x0][_0x4000('0x6e')]+_0x3e5834[0x0][_0x4000('0x6d')])/_0x3e5834[0x0][_0x4000('0x72')];_0x13aa57['predictiveIntervalHitRate']=_0x4547e5>0x0?_0x4547e5:0x1;switch(_0x13aa57[_0x4000('0x1d3')]){case _0x4000('0x1d4'):var _0x4daa07=_0x13aa57[_0x4000('0x1c6')]/0x64;return _0xab221a['abandonmentRate'](_0x4e7398,_0x3cd854,_0x5f3cd9,_0x4547e5,_0x4daa07)[_0x4000('0xb4')](function(_0xfb06ba){return _0x1b1c34(_0xfb06ba);});case _0x4000('0x1e1'):var _0xd38b3a=_0x13aa57[_0x4000('0x1c6')]/0x64;return _0xab221a[_0x4000('0x1e2')](_0x4e7398,_0x3cd854,_0x5f3cd9,_0x4547e5,_0xd38b3a)[_0x4000('0xb4')](function(_0x41e5d6){return _0x1b1c34(_0x41e5d6);});default:return _0x41cb77(msgResponse('[getDataPredictive]',_0x4000('0x140'),'Unknown\x20Predictive'));}}else{return _0x41cb77(msgResponse('[getDataPredictive]',_0x4000('0x140'),_0x4000('0x1e3')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x5b6714){var _0xa0cdff=this;return function(_0x38e367){return new BPromise(function(_0x33a7a0,_0x25d574){_['merge'](_0x5b6714,_0x38e367[0x0]);if(checkGetDataPredictive(_0x38e367[0x0])){loggerPredictive[_0x4000('0x7d')](JSON[_0x4000('0x49')](_0x38e367[0x0]));if(_0x5b6714[_0x4000('0x1d3')]===_0x4000('0x1d4')){return _0xa0cdff[_0x4000('0xc0')](_0x5b6714['id'])[_0x4000('0xb4')](function(_0x45e756){var _0xce306a=_0x5b6714[_0x4000('0x52')]-_0x45e756[0x0][_0x4000('0x1e4')];var _0x52a550=_0x5b6714[_0x4000('0x1d1')]*0x3c;var _0x5a3d80=_0x38e367[0x0][_0x4000('0x83')]+_0x38e367[0x0][_0x4000('0x6c')];var _0x302677=(_0x38e367[0x0][_0x4000('0x80')]+_0x38e367[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x38e367[0x0][_0x4000('0x6d')])/_0x38e367[0x0][_0x4000('0x72')];var _0x5d3273=_0x5b6714[_0x4000('0x1c6')]/0x64;_0x5b6714['predictiveIntervalPauses']=_0x45e756[0x0][_0x4000('0x1e4')]||0x0;_0x5b6714['predictiveIntervalHitRate']=_0x302677>0x0?_0x302677:0x1;return _0xa0cdff[_0x4000('0x1e5')](_0xce306a,_0x52a550,_0x5a3d80,_0x302677,_0x5d3273);})[_0x4000('0xb4')](function(_0x413477){return _0x33a7a0(_0x413477);})[_0x4000('0xad')](function(_0x3a6b67){return _0x25d574(msgResponse('[CatchErlangB]','Failure',JSON[_0x4000('0x49')](_0x3a6b67)));});}if(_0x5b6714[_0x4000('0x1d3')]===_0x4000('0x1e1')){return _0xa0cdff[_0x4000('0xc0')](_0x5b6714['id'])[_0x4000('0xb4')](function(_0x4d8c43){var _0x25eaa2=_0x5b6714[_0x4000('0x52')]-_0x4d8c43[0x0]['outboundQueuePauses'];var _0x2a15b0=_0x5b6714['dialPredictiveInterval']*0x3c;var _0x45083c=_0x38e367[0x0][_0x4000('0x83')]+_0x38e367[0x0][_0x4000('0x6c')];var _0x438b86=(_0x38e367[0x0][_0x4000('0x80')]+_0x38e367[0x0][_0x4000('0x6e')]+_0x38e367[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x38e367[0x0][_0x4000('0x72')];var _0x46b54b=_0x5b6714[_0x4000('0x1c6')]/0x64;_0x5b6714[_0x4000('0x1e6')]=_0x4d8c43[0x0][_0x4000('0x1e4')]||0x0;_0x5b6714[_0x4000('0x1cc')]=_0x438b86>0x0?_0x438b86:0x1;return _0xa0cdff['busyFactor'](_0x25eaa2,_0x2a15b0,_0x45083c,_0x438b86,_0x46b54b);})['then'](function(_0x560fe7){return _0x33a7a0(_0x560fe7);})['catch'](function(_0x1a16e4){return _0x25d574(msgResponse(_0x4000('0x1e7'),_0x4000('0x140'),JSON[_0x4000('0x49')](_0x1a16e4)));});}}else{return _0x25d574(msgResponse(_0x4000('0x1e8'),_0x4000('0x140'),_0x4000('0x1e3')));}});};};Dialer[_0x4000('0x1a')][_0x4000('0x1db')]=function(_0x2c5ade){var _0x2b54a4=this;return function(){var _0x91f3e3=0x0;var _0x29a3e9=Math[_0x4000('0x1ca')](_0x2c5ade['erlangCallToSecond']*0x3e8);if(_0x29a3e9>0x0){_0x29a3e9=_0x29a3e9<0x64?0x64:_0x29a3e9;loggerPredictive[_0x4000('0x7d')](_0x2c5ade['name'],'one\x20call\x20every:',_0x29a3e9,_0x4000('0x4a'));_0x2c5ade[_0x4000('0x90')]=setInterval(function(){_0x2b54a4[_0x4000('0x90')](_0x2c5ade);loggerPredictiveCalls['info']('[handlePredictive]',_0x91f3e3+=0x1);},_0x29a3e9);}else{loggerPredictive[_0x4000('0x7d')](_0x2c5ade[_0x4000('0x3e')],_0x4000('0x1e9'));}};};Dialer[_0x4000('0x1a')][_0x4000('0x1ea')]=function(_0x4ef758,_0x1eb0ec){var _0x350c22=this;return function(_0x4b8cb3){if(_[_0x4000('0x45')](_0x4b8cb3)){if(_[_0x4000('0xaa')](_0x1eb0ec[_0x4000('0xcc')])||!_0x1eb0ec[_0x4000('0x1eb')]){if(_0x4ef758['dialMethod']===_0x4000('0x9')){_0x4ef758['queueStatusComplete']=_['isUndefined'](_0x4ef758[_0x4000('0x12b')])?!![]:_0x4ef758[_0x4000('0x12b')];var _0x290ba3=uuid['v4']();_0x350c22['actions'][_0x290ba3]=new Action(_0x4ef758,_0x1eb0ec,_0x290ba3);loggerBooked['info'](_0x4000('0x1ec'),_0x290ba3,_0x4000('0x1ed'),JSON[_0x4000('0x49')](_0x4ef758[_0x4000('0x12b')]),_0x4000('0x1ee'),_0x4ef758[_0x4000('0x3e')]);if(_0x4ef758[_0x4000('0x12b')]){_0x4ef758[_0x4000('0x12b')]=![];_0x350c22[_0x4000('0x2b')][_0x350c22[_0x4000('0x24')][_0x290ba3]['queue']]=[];ami['Action']({'actionid':_0x290ba3,'action':'queuestatus','queue':_0x4ef758[_0x4000('0x3e')]})[_0x4000('0xad')](function(_0x52d616){_0x350c22[_0x4000('0xc6')](_0x4ef758);_0x350c22['rescheduleContact']({'active':![],'ContactId':_0x350c22['actions'][_0x290ba3][_0x4000('0xca')],'ListId':_0x350c22[_0x4000('0x24')][_0x290ba3][_0x4000('0xcb')],'VoiceQueueId':_0x350c22[_0x4000('0x24')][_0x290ba3][_0x4000('0xcd')]||undefined,'CampaignId':_0x350c22[_0x4000('0x24')][_0x290ba3][_0x4000('0xf6')]||undefined})[_0x4000('0xad')](loggerCatch(_0x4000('0x1ef')));delete _0x350c22[_0x4000('0x24')][_0x290ba3];});}else{loggerBooked[_0x4000('0x7d')](_0x4000('0x1f0'),JSON['stringify'](_0x4ef758[_0x4000('0x12b')]),'Queue:\x20',_0x4ef758[_0x4000('0x3e')]);_0x350c22[_0x4000('0xc6')](_0x4ef758);_0x350c22[_0x4000('0xf3')]({'active':![],'ContactId':_0x350c22[_0x4000('0x24')][_0x290ba3]['ContactId'],'ListId':_0x350c22[_0x4000('0x24')][_0x290ba3]['ListId'],'VoiceQueueId':_0x350c22['actions'][_0x290ba3][_0x4000('0xcd')]||undefined,'CampaignId':_0x350c22[_0x4000('0x24')][_0x290ba3][_0x4000('0xf6')]||undefined})['catch'](loggerCatch(_0x4000('0x1ef')));delete _0x350c22['actions'][_0x290ba3];}}else{return _0x350c22[_0x4000('0x163')](_0x4ef758,_0x1eb0ec);}}else{if(getDiff(_0x1eb0ec[_0x4000('0x1f1')])<_0x4ef758[_0x4000('0x1f2')]*0x3c){if(_0x1eb0ec[_0x4000('0x1f3')]&&!_0x1eb0ec[_0x4000('0x1f3')][_0x4000('0x1f4')]){_0x350c22[_0x4000('0x1e')][_0x4000('0x12d')](_0x1eb0ec['id'])[_0x4000('0x1c')](function(){_0x350c22['updateOriginated'](_0x4ef758);});}else{_0x350c22[_0x4000('0xbc')]({'active':![]},_0x1eb0ec['id'],0x1)[_0x4000('0x1c')](function(){console[_0x4000('0x1f5')](_0x4000('0x1f6'));_0x350c22[_0x4000('0xc6')](_0x4ef758);});}}else{_0x4ef758['outboundReCallsDay']+=0x1;_0x350c22[_0x4000('0xc6')](_0x4ef758);if(_0x4ef758[_0x4000('0x1f7')]){_0x350c22[_0x4000('0xf3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eb0ec[_0x4000('0xca')],'ListId':_0x1eb0ec['ListId'],'VoiceQueueId':_0x1eb0ec[_0x4000('0xcd')]||undefined,'CampaignId':_0x1eb0ec[_0x4000('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x350c22['createHistory'](createObjHistory(_0x4ef758,_0x1eb0ec,_0x4000('0x1f8'),0x17,_0x4000('0x1f9')))[_0x4000('0xad')](loggerCatch(_0x4000('0x1fa')));}else{_0x350c22[_0x4000('0xc9')](createObjHistory(_0x4ef758,_0x1eb0ec,'RECALLFAILEDTIMEOUT',0x16,_0x4000('0x1fb')),'[Originate][HistoryRecallClose][historyCatch]',_0x4000('0x1fc'));}}}}else{_0x4ef758[_0x4000('0x61')]+=0x1;_0x350c22[_0x4000('0xc9')](createObjHistory(_0x4ef758,_0x1eb0ec,_0x4000('0x1fd'),0xd,_0x4000('0x1fe')),_0x4000('0x1ff'),_0x4000('0x200'));throw'inBlackList';}};};Dialer[_0x4000('0x1a')][_0x4000('0x15a')]=function(_0x23ce80){var _0x486f11=this;var _0x4cb6d2=[];var _0x326263=_0x23ce80[_0x4000('0x201')]-_0x23ce80[_0x4000('0x73')]-_0x23ce80['temp'];emitCampaignSummary(_0x23ce80);if(_0x326263>0x0){if(_0x326263>this['maxNumberOriginate']){_0x326263=this[_0x4000('0x22')];}_0x23ce80[_0x4000('0x202')]+=_0x326263;this[_0x4000('0xbf')](_0x23ce80['id'],_0x326263,_0x23ce80['dialOrderByScheduledAt'])[_0x4000('0xb4')](function(_0x46ab6a){_0x23ce80[_0x4000('0x202')]-=_0x326263;_0x23ce80['temp']=_0x23ce80[_0x4000('0x202')]>0x0?_0x23ce80[_0x4000('0x202')]:0x0;if(!checkContactEmpty(_0x46ab6a)){_0x23ce80[_0x4000('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4000('0x7d')](_0x4000('0x203')+_0x23ce80[_0x4000('0x3e')]);}else{_0x23ce80[_0x4000('0x73')]+=_0x46ab6a[_0x4000('0x98')];_0x23ce80[_0x4000('0x42')]=_0x4000('0x204');for(var _0x5018fe=0x0;_0x5018fe<_0x46ab6a[_0x4000('0x98')];_0x5018fe+=0x1){_0x23ce80[_0x4000('0x205')]+=0x1;if(_[_0x4000('0xaa')](_0x46ab6a[_0x5018fe])||_['isNil'](_0x46ab6a[_0x5018fe][_0x4000('0x167')])||_['isNil'](_0x46ab6a[_0x5018fe][_0x4000('0x167')][_0x4000('0x168')])){_0x486f11[_0x4000('0xc7')](_0x4000('0x206'),_0x23ce80,_0x46ab6a[_0x5018fe]);}else{_0x486f11['checkIsBlackListIvr'](_[_0x4000('0x127')](_0x46ab6a[_0x5018fe],['CampaignId',_0x4000('0x207')]))[_0x4000('0xb4')](_0x486f11['checkContactBlack'](_0x23ce80,_0x46ab6a[_0x5018fe]))['catch'](_0x486f11[_0x4000('0x208')](_0x4000('0x209'),_0x23ce80));}}}})[_0x4000('0xad')](loggerGetContactDialer(_0x4000('0x20a'),_0x23ce80,_0x326263));}};Dialer[_0x4000('0x1a')][_0x4000('0x154')]=function(_0xd4c86,_0x11433c){var _0x5ebd5c=this;var _0x26f628=[];var _0x31abb5=_0x11433c>=0x1?_0x11433c:0x1;var _0x3b6c0d=[];if(_0xd4c86[_0x4000('0x5c')]===_0x4000('0x9')){_0x31abb5=0x1;}var _0x49cdbb=Math[_0x4000('0x1ca')](_0xd4c86[_0x4000('0x51')]*_0x31abb5)-_0xd4c86['originated']-_0xd4c86[_0x4000('0x202')];emitVoiceQueueSummary(_0xd4c86);if(_0xd4c86[_0x4000('0x20b')]>0x0){var _0x4fc664=_0xd4c86[_0x4000('0x20b')]-_0xd4c86['originated']-_0xd4c86['talking']-_0xd4c86[_0x4000('0x202')]-_0xd4c86[_0x4000('0x53')];if(_0x49cdbb>_0x4fc664){_0x49cdbb=_0x4fc664;}}if(_0x49cdbb>0x0){if(_0xd4c86[_0x4000('0x5c')]===_0x4000('0x9')){_0x49cdbb=0x1;}if(_0x49cdbb>this[_0x4000('0x22')]){_0x49cdbb=this[_0x4000('0x22')];}_0xd4c86[_0x4000('0x202')]+=_0x49cdbb;for(var _0x421059 in this['agents']){if(this[_0x4000('0x125')][_0x4000('0xa9')](_0x421059)){if(this[_0x4000('0x125')][_0x421059][_0x4000('0xa5')]==='not_inuse'&&this[_0x4000('0x125')][_0x421059][_0x4000('0xab')]==='reachable'){_0x26f628['push'](this[_0x4000('0x125')][_0x421059]['id']);}}}this[_0x4000('0xbd')](_0xd4c86['id'],_0x26f628,_0x49cdbb,_0xd4c86[_0x4000('0x20c')])[_0x4000('0xb4')](function(_0x39d2a7){_0xd4c86[_0x4000('0x202')]-=_0x49cdbb;_0xd4c86['temp']=_0xd4c86[_0x4000('0x202')]>0x0?_0xd4c86[_0x4000('0x202')]:0x0;if(!checkContactEmpty(_0x39d2a7)){_0x5ebd5c['countReScheduled'](_0xd4c86)[_0x4000('0xb4')](sendMessageReschedule(_0xd4c86))[_0x4000('0xad')](loggerCatch(_0x4000('0xb5')));}else{_0xd4c86[_0x4000('0x73')]+=_0x39d2a7['length'];_0xd4c86['message']=_0xd4c86['dialMethod']==='booked'?_0x4000('0x170'):_0x4000('0x204');for(var _0x1f01bb=0x0;_0x1f01bb<_0x39d2a7[_0x4000('0x98')];_0x1f01bb+=0x1){if(_[_0x4000('0xaa')](_0x39d2a7[_0x1f01bb])||_[_0x4000('0xaa')](_0x39d2a7[_0x1f01bb]['Contact'])||_[_0x4000('0xaa')](_0x39d2a7[_0x1f01bb][_0x4000('0x167')][_0x4000('0x168')])){_0x5ebd5c['emptyContact'](_0x4000('0x206'),_0xd4c86,_0x39d2a7[_0x1f01bb]);}else{_0x5ebd5c['checkIsBlackList'](_['pick'](_0x39d2a7[_0x1f01bb],[_0x4000('0xcd'),_0x4000('0x207')]))[_0x4000('0xb4')](_0x5ebd5c['checkContactBlack'](_0xd4c86,_0x39d2a7[_0x1f01bb]))['catch'](_0x5ebd5c[_0x4000('0x208')]('[actionOriginate]\x20',_0xd4c86));}}}})[_0x4000('0xad')](loggerGetContactDialer(_0x4000('0x20d'),_0xd4c86,_0x49cdbb));}};Dialer[_0x4000('0x1a')][_0x4000('0x90')]=function(_0x11d934){var _0x5c6e52=this;if(_0x11d934[_0x4000('0x20b')]>0x0){var _0x46221d=_0x11d934[_0x4000('0x20b')]-_0x11d934[_0x4000('0x73')]-_0x11d934[_0x4000('0x55')];if(_0x46221d>0x0){this[_0x4000('0x20e')](_0x11d934);}else{loggerPredictiveCalls[_0x4000('0x7d')](_0x4000('0x20f'));}}else{this[_0x4000('0x20e')](_0x11d934);}};Dialer[_0x4000('0x1a')][_0x4000('0x20e')]=function(_0x495ad1){var _0x19035e=this;var _0x4cbf82=[];_0x495ad1[_0x4000('0x73')]+=0x1;for(var _0x167734 in this[_0x4000('0x125')]){if(this[_0x4000('0x125')][_0x4000('0xa9')](_0x167734)){if(this['agents'][_0x167734][_0x4000('0xa5')]===_0x4000('0x210')&&this[_0x4000('0x125')][_0x167734][_0x4000('0xab')]==='reachable'){_0x4cbf82[_0x4000('0x126')](this[_0x4000('0x125')][_0x167734]['id']);}}}this[_0x4000('0xbd')](_0x495ad1['id'],_0x4cbf82,0x1,_0x495ad1[_0x4000('0x20c')])[_0x4000('0xb4')](function(_0xd3057a){if(!checkContactEmpty(_0xd3057a)){checkContactLowerLimitOriginate(_0x495ad1,0x1,0x0);_0x19035e[_0x4000('0xb2')](_0x495ad1)[_0x4000('0xb4')](sendMessageReschedule(_0x495ad1))['catch'](loggerCatch(_0x4000('0xb5')));}else{_0x495ad1['message']=_0x4000('0x204');if(_[_0x4000('0xaa')](_0xd3057a[0x0])||_[_0x4000('0xaa')](_0xd3057a[0x0][_0x4000('0x167')])||_['isNil'](_0xd3057a[0x0][_0x4000('0x167')][_0x4000('0x168')])){_0x19035e[_0x4000('0xc7')](_0x4000('0x206'),_0x495ad1,_0xd3057a[0x0]);}else{_0x19035e[_0x4000('0xb6')](_[_0x4000('0x127')](_0xd3057a[0x0],[_0x4000('0xcd'),_0x4000('0x207')]))[_0x4000('0xb4')](_0x19035e[_0x4000('0x1ea')](_0x495ad1,_0xd3057a[0x0]))[_0x4000('0xad')](_0x19035e['loggerHandler']('[actionOriginatePredictive]\x20',_0x495ad1));}}})[_0x4000('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0x495ad1,0x1));emitVoiceQueueSummary(_0x495ad1);};Dialer[_0x4000('0x1a')]['abandonmentRate']=function(_0x386981,_0x2e3e81,_0x1d4878,_0x53d30a,_0x14d23c,_0x536ac0){loggerPredictive[_0x4000('0x7d')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4000('0x7d')]('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',_0x386981);loggerPredictive[_0x4000('0x7d')](_0x4000('0x211'),_0x2e3e81);loggerPredictive[_0x4000('0x7d')](_0x4000('0x212'),_0x1d4878);loggerPredictive[_0x4000('0x7d')](_0x4000('0x213'),_0x53d30a);loggerPredictive[_0x4000('0x7d')](_0x4000('0x214'),_0x14d23c);loggerPredictive[_0x4000('0x7d')]('---------------------------');return new BPromise(function(_0x43ac46,_0x4ba553){if(_0x386981<=0x0||isNaN(_0x386981)){return _0x4ba553(msgResponse('[abandonmentRate]',_0x4000('0x48'),_0x4000('0x215')+_0x386981));}if(_0x1d4878<=0x0||isNaN(_0x1d4878)){return _0x4ba553(msgResponse(_0x4000('0x216'),'Error',_0x4000('0x217')+_0x1d4878));}if(_0x53d30a<=0x0||isNaN(_0x53d30a)){return _0x4ba553(msgResponse(_0x4000('0x216'),_0x4000('0x48'),'p\x20=\x20'+_0x53d30a));}if(_0x2e3e81<=0x0||isNaN(_0x2e3e81)){return _0x4ba553(msgResponse(_0x4000('0x216'),_0x4000('0x48'),'interval\x20=\x20'+_0x2e3e81));}if(_0x14d23c<=0x0||isNaN(_0x14d23c)){return _0x4ba553(msgResponse(_0x4000('0x216'),_0x4000('0x48'),_0x4000('0x218')+_0x14d23c));}_0x536ac0=_0x536ac0||0x0;var _0x4f310c=0x1/_0x1d4878;var _0x1d28b8=0x0;var _0x247e80=0x0;var _0x2659ee=0x0;var _0x2dacc=0x0;for(var _0x1d459a=0x0;_0x2659ee<_0x14d23c;_0x1d459a+=0x1){_0x247e80=_0x1d459a/_0x2e3e81;_0x1d28b8=(_0x53d30a*_0x247e80+_0x536ac0)/_0x4f310c;_0x2659ee=erlangb(_0x1d28b8,_0x386981);_0x2dacc=_0x1d28b8/_0x386981*(0x1-erlangb(_0x1d28b8,_0x386981));}return _0x43ac46({'erlangCalls':_0x1d459a,'erlangCallToSecond':_0x2e3e81/_0x1d459a,'erlangAbandonmentRate':_0x2659ee,'erlangBusyFactor':_0x2dacc});});};Dialer['prototype'][_0x4000('0x1e2')]=function(_0x5e6237,_0x2fb495,_0x425ab0,_0x38cd51,_0x3eb94f,_0x4a5fdd){loggerPredictive[_0x4000('0x7d')](_0x4000('0x219'));loggerPredictive[_0x4000('0x7d')](_0x4000('0x21a'),_0x5e6237);loggerPredictive[_0x4000('0x7d')](_0x4000('0x211'),_0x2fb495);loggerPredictive[_0x4000('0x7d')](_0x4000('0x212'),_0x425ab0);loggerPredictive[_0x4000('0x7d')](_0x4000('0x213'),_0x38cd51);loggerPredictive[_0x4000('0x7d')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eb94f);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x4a6eac,_0x4f559b){if(_0x5e6237<=0x0||isNaN(_0x5e6237)){return _0x4f559b(msgResponse(_0x4000('0x21b'),_0x4000('0x48'),_0x4000('0x215')+_0x5e6237));}if(_0x425ab0<=0x0||isNaN(_0x425ab0)){return _0x4f559b(msgResponse(_0x4000('0x21b'),_0x4000('0x48'),_0x4000('0x217')+_0x425ab0));}if(_0x38cd51<=0x0||isNaN(_0x38cd51)){return _0x4f559b(msgResponse(_0x4000('0x21b'),_0x4000('0x48'),_0x4000('0x21c')+_0x38cd51));}if(_0x2fb495<=0x0||isNaN(_0x2fb495)){return _0x4f559b(msgResponse('[busyFactor]',_0x4000('0x48'),_0x4000('0x21d')+_0x2fb495));}if(_0x3eb94f<=0x0||isNaN(_0x3eb94f)){return _0x4f559b(msgResponse(_0x4000('0x21b'),_0x4000('0x48'),_0x4000('0x21e')+_0x3eb94f));}_0x4a5fdd=_0x4a5fdd||0x0;var _0x568907=0x1/_0x425ab0;var _0x414a1e=0x0;var _0xd069c6=0x0;var _0x4ff63b=0x0;var _0x4326d8=0x0;for(var _0x843cce=0x0;_0x4326d8<_0x3eb94f;_0x843cce+=0x1){_0xd069c6=_0x843cce/_0x2fb495;_0x414a1e=(_0x38cd51*_0xd069c6+_0x4a5fdd)/_0x568907;_0x4ff63b=erlangb(_0x414a1e,_0x5e6237);_0x4326d8=_0x414a1e/_0x5e6237*(0x1-erlangb(_0x414a1e,_0x5e6237));}return _0x4a6eac({'erlangCalls':_0x843cce,'erlangCallToSecond':_0x2fb495/_0x843cce,'erlangAbandonmentRate':_0x4ff63b,'erlangBusyFactor':_0x4326d8});});};module[_0x4000('0x21f')]=Dialer; \ No newline at end of file +var _0x50d2=['History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','hasOwnProperty','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','is\x20not\x20active','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','pick','ListId','UserId','[emptyContact]','isSuccess','Success','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','dialAMDActive','value','HANGUP','HangupInAMD','[syncHangupInAMD]','MACHINE','AMD','countmachineretry','countglobal','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','rescheduleContact','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','syncAgentComplete','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','rrmemory','push','[unlockQueueStatus][undefined]','queueStatusComplete','run','idHopper','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','[Catch][Preview][syncQueueStatusComplete]','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','true','indexOf','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','getCaller','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','buildObj','[syncAgentComplete][createHistory][0]','checkRetriveMax','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','reason','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','merge','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','Agent','voicePause','finally','Contact\x20updated','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','loggerHandler','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncQueueSummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalTotalCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------'];(function(_0xc00d7c,_0x420406){var _0x44a1b6=function(_0x5ab1bb){while(--_0x5ab1bb){_0xc00d7c['push'](_0xc00d7c['shift']());}};_0x44a1b6(++_0x420406);}(_0x50d2,0x198));var _0x250d=function(_0x4d54b7,_0x46bc80){_0x4d54b7=_0x4d54b7-0x0;var _0x2d6f25=_0x50d2[_0x4d54b7];return _0x2d6f25;};'use strict';var util=require(_0x250d('0x0'));var _=require(_0x250d('0x1'));var BPromise=require(_0x250d('0x2'));var uuid=require('uuid');var moment=require(_0x250d('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x250d('0x4'));var config=require(_0x250d('0x5'));var logger=require(_0x250d('0x6'))('dialer');var loggerBooked=require(_0x250d('0x6'))(_0x250d('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x250d('0x8'));var loggerSyncQueueSummary=require(_0x250d('0x6'))('syncQueueSummary');var ami=require(_0x250d('0x9'));config[_0x250d('0xa')]=_[_0x250d('0xb')](config[_0x250d('0xa')],{'host':_0x250d('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x250d('0xa')]));var cmHopper=require(_0x250d('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x250d('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x250d('0xf'));var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x250d('0x10'));var QueueCallerAbandon=require(_0x250d('0x11'));var Hangup=require('./hangup');var ipAgi=process[_0x250d('0x12')][_0x250d('0x13')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x250d('0x14')};var Sequence=function(){};Sequence[_0x250d('0x15')]['enqueue']=function(_0xdd01b4){this['tail']=this['tail']?this[_0x250d('0x16')]['finally'](_0xdd01b4):_0xdd01b4();};function Dialer(_0x16e484,_0x38fc21){this['sequence']=new Sequence();this[_0x250d('0x17')]=_0x38fc21;this[_0x250d('0x18')]=_0x16e484[_0x250d('0x18')];this[_0x250d('0x19')]=_0x16e484[_0x250d('0x19')];this[_0x250d('0x1a')]=_0x16e484['agents'];this[_0x250d('0x1b')]=_0x16e484[_0x250d('0x1b')];this[_0x250d('0x1c')]=config[_0x250d('0x1c')]||0x2;this[_0x250d('0x1d')]={};this[_0x250d('0x1e')]={};this['contactsId']={};this[_0x250d('0x1f')]={};this[_0x250d('0x20')]={};this[_0x250d('0x21')]={};this[_0x250d('0x22')]={};this[_0x250d('0x23')]={};this[_0x250d('0x24')]={};this[_0x250d('0x25')]={};ami['on'](_0x250d('0x26'),this['syncAgentConnect'][_0x250d('0x27')](this));ami['on'](_0x250d('0x28'),this[_0x250d('0x29')][_0x250d('0x27')](this));ami['on']('originateresponse',this[_0x250d('0x2a')][_0x250d('0x27')](this));ami['on'](_0x250d('0x2b'),this['syncAgentComplete'][_0x250d('0x27')](this));ami['on']('custom:queuesummary',this[_0x250d('0x2c')]['bind'](this));ami['on']('hangup',this[_0x250d('0x2d')][_0x250d('0x27')](this));ami['on'](_0x250d('0x2e'),this[_0x250d('0x2f')][_0x250d('0x27')](this));ami['on'](_0x250d('0x30'),this[_0x250d('0x31')][_0x250d('0x27')](this));ami['on'](_0x250d('0x32'),this[_0x250d('0x33')][_0x250d('0x27')](this));ami['on'](_0x250d('0x34'),this[_0x250d('0x35')][_0x250d('0x27')](this));this['loopCampaigns']();this[_0x250d('0x36')]();}function isNotNull(_0x2d433e){return _0x2d433e!==null&&!_[_0x250d('0x37')](_0x2d433e);}function checkIsLoggedIn(_0x22afdb,_0x508956){return function(){if(_0x508956<=0x0){_0x22afdb[_0x250d('0x38')]=_0x250d('0x39');throw _0x22afdb[_0x250d('0x3a')]+_0x250d('0x3b');}};}function isActive(_0x308dc9){return _0x308dc9;}function checkIsActive(_0x6afb69,_0x489922){return function(){if(!isActive(_0x489922)){_0x6afb69[_0x250d('0x38')]='NOT_ACTIVE';throw _0x6afb69[_0x250d('0x3a')]+'\x20NOT\x20Active';}};}function checkInterval(_0x78962f){return function(){if(!isNotNull(_0x78962f[_0x250d('0x3c')])){_0x78962f[_0x250d('0x38')]=_0x250d('0x3d');throw _0x78962f['name']+_0x250d('0x3e');}if(!isNotNull(_0x78962f[_0x250d('0x3c')][_0x250d('0x3f')])){_0x78962f[_0x250d('0x38')]='INTERVAL_IS_NULL';throw _0x78962f[_0x250d('0x3a')]+_0x250d('0x3e');}if(!isNotNull(_[_0x250d('0x40')](_0x78962f[_0x250d('0x3c')][_0x250d('0x3f')]))){_0x78962f[_0x250d('0x38')]=_0x250d('0x3d');throw _0x78962f['name']+_0x250d('0x3e');}};}function msgResponse(_0x3a80f7,_0x2c962d,_0x248bb0){return{'action':_0x3a80f7,'response':_0x2c962d,'message':_0x248bb0,'stack':_0x248bb0};}function myreject(_0x121e63){return function(_0x60bd3d){return _0x121e63(msgResponse('[ifTime][Action]','Error',JSON[_0x250d('0x41')](_0x60bd3d)));};}function getSeconds(_0x5642a6,_0x4b3efb){var _0x5e2d4b=moment(_0x5642a6)[_0x250d('0x42')](0x0);var _0x35075a=moment(_0x4b3efb)[_0x250d('0x42')](0x0);return _0x5e2d4b[_0x250d('0x43')](_0x35075a,_0x250d('0x44'));}function emit(_0xafd630,_0x2e9a51,_0xeab904){io['to'](_0xafd630)[_0x250d('0x45')](_0x2e9a51,_0xeab904);}function emitVoiceQueueSummary(_0x3028ca){if(_0x3028ca[_0x250d('0x46')]===_0x250d('0x47')){var _0x19d62c={'id':_0x3028ca['id'],'name':_0x3028ca['name'],'strategy':_0x3028ca[_0x250d('0x48')],'answered':_0x3028ca['answered'],'available':_0x3028ca[_0x250d('0x49')],'loggedIn':_0x3028ca[_0x250d('0x4a')],'pTalking':_0x3028ca[_0x250d('0x4b')],'sumBillable':_0x3028ca['sumBillable'],'sumDuration':_0x3028ca[_0x250d('0x4c')],'sumHoldTime':_0x3028ca['sumHoldTime']||0x0,'talking':_0x3028ca[_0x250d('0x4d')],'total':_0x3028ca[_0x250d('0x4e')],'type':_0x3028ca[_0x250d('0x46')],'unmanaged':_0x3028ca[_0x250d('0x4f')],'abandoned':_0x3028ca[_0x250d('0x50')],'waiting':_0x3028ca[_0x250d('0x51')],'loggedInDb':_0x3028ca[_0x250d('0x52')],'dialActive':_0x3028ca[_0x250d('0x53')],'dialMethod':_0x3028ca[_0x250d('0x54')],'dialOriginateCallerIdName':_0x3028ca[_0x250d('0x55')],'dialOriginateCallerIdNumber':_0x3028ca[_0x250d('0x56')],'dialOriginateTimeout':_0x3028ca[_0x250d('0x57')],'dialPrefix':_0x3028ca['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3028ca[_0x250d('0x58')],'outboundAnswerCallsDay':_0x3028ca[_0x250d('0x59')],'outboundBlacklistCallsDay':_0x3028ca['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3028ca[_0x250d('0x5a')],'outboundCongestionCallsDay':_0x3028ca[_0x250d('0x5b')],'outboundDropCallsDayACS':_0x3028ca[_0x250d('0x5c')],'outboundDropCallsDayCallersExit':_0x3028ca[_0x250d('0x5d')],'outboundDropCallsDayTimeout':_0x3028ca[_0x250d('0x5e')],'outboundNoAnswerCallsDay':_0x3028ca[_0x250d('0x5f')],'outboundNoSuchCallsDay':_0x3028ca['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3028ca[_0x250d('0x60')],'outboundReCallsDay':_0x3028ca['outboundReCallsDay'],'outboundRejectCallsDay':_0x3028ca['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3028ca['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3028ca[_0x250d('0x61')],'predictiveIntervalAvgHoldtime':_0x3028ca[_0x250d('0x62')],'predictiveIntervalAvgTalktime':_0x3028ca[_0x250d('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x3028ca[_0x250d('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x3028ca[_0x250d('0x65')],'predictiveIntervalErlangCalls':_0x3028ca[_0x250d('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x3028ca['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3028ca['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3028ca['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3028ca['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3028ca['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3028ca[_0x250d('0x67')],'message':_0x3028ca[_0x250d('0x38')],'originated':_0x3028ca['originated'],'erlangCalls':_0x3028ca['erlangCalls'],'erlangCallToSecond':_0x3028ca['erlangCallToSecond'],'erlangAbandonmentRate':_0x3028ca[_0x250d('0x68')],'erlangBusyFactor':_0x3028ca[_0x250d('0x69')],'startPredictive':_0x3028ca[_0x250d('0x21')],'startProgressive':_0x3028ca[_0x250d('0x22')]};if(_0x3028ca[_0x250d('0x6a')]){_0x19d62c[_0x250d('0x6a')]={'id':_0x3028ca['Trunk']['id'],'name':_0x3028ca[_0x250d('0x6a')][_0x250d('0x3a')],'active':_0x3028ca[_0x250d('0x6a')][_0x250d('0x6b')],'callerid':_0x3028ca[_0x250d('0x6a')][_0x250d('0x6c')]};}if(_0x3028ca['Interval']){_0x19d62c[_0x250d('0x3c')]={'id':_0x3028ca[_0x250d('0x3c')]['id'],'name':_0x3028ca[_0x250d('0x3c')]['name']};}var _0x2a9542=md5(JSON[_0x250d('0x41')](_0x19d62c));if(_0x3028ca[_0x250d('0x6d')]!==_0x2a9542){_0x3028ca[_0x250d('0x6d')]=_0x2a9542;emit(util[_0x250d('0x6e')](_0x250d('0x6f'),_0x19d62c[_0x250d('0x3a')]),_0x250d('0x70'),_0x19d62c);}}}function emitCampaignSummary(_0x52872e){if(_0x52872e['type']==='ivr'){emit(util[_0x250d('0x6e')](_0x250d('0x71'),_0x52872e['name']),_0x250d('0x72'),_0x52872e);}}function checkGetDataPredictive(_0xd7cadb){if(isNotNull(_0xd7cadb)){if(!_[_0x250d('0x40')](_0xd7cadb)){loggerPredictive[_0x250d('0x73')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd7cadb[_0x250d('0x67')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x74'),_0xd7cadb[_0x250d('0x61')]);loggerPredictive['info'](_0x250d('0x75'),_0xd7cadb[_0x250d('0x65')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x76'),_0xd7cadb[_0x250d('0x64')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x77'),_0xd7cadb[_0x250d('0x62')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x78'),_0xd7cadb[_0x250d('0x63')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x79'));if(_0xd7cadb[_0x250d('0x67')]>0x0){if(!_[_0x250d('0x37')](_0xd7cadb[_0x250d('0x63')])&&_0xd7cadb[_0x250d('0x63')]>0x0){return!![];}else{loggerPredictive[_0x250d('0x73')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x250d('0x37')](_0xd7cadb[_0x250d('0x62')])&&_0xd7cadb[_0x250d('0x62')]>0x0){return!![];}else{loggerPredictive[_0x250d('0x73')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x250d('0x73')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x250d('0x73')](_0x250d('0x7a'));}}else{loggerPredictive[_0x250d('0x73')](_0x250d('0x7a'));}return![];}function mergeDataErlangB(_0x151560){return function(_0x5f597f){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x250d('0x7b'),_0x5f597f[_0x250d('0x7c')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x7d'),_0x5f597f['erlangCallToSecond']);loggerPredictive[_0x250d('0x73')](_0x250d('0x7e'),_0x5f597f[_0x250d('0x68')]);loggerPredictive['info'](_0x250d('0x7f'),_0x5f597f[_0x250d('0x69')]);loggerPredictive['info'](_0x250d('0x7e'),_0x5f597f[_0x250d('0x68')]);loggerPredictive[_0x250d('0x73')](_0x250d('0x79'));_['merge'](_0x151560,_0x5f597f);};}function getDiff(_0x421ff6){var _0x3f0c8a=moment()[_0x250d('0x42')](0x0);var _0x431350=moment(_0x421ff6)[_0x250d('0x42')](0x0);return _0x3f0c8a[_0x250d('0x43')](_0x431350,_0x250d('0x44'));}function ifInterval(_0x11a58b,_0x52e3b1){if(_['isUndefined'](_0x52e3b1)){return![];}if(getDiff(_0x52e3b1)<_0x11a58b*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xbbf07a){if(isNotNull(_0xbbf07a)){if(!_['isUndefined'](_0xbbf07a['startProgressive'])){_0xbbf07a['startProgressive']=undefined;loggerPredictive[_0x250d('0x73')](_0xbbf07a[_0x250d('0x3a')],_0x250d('0x80'));}if(!_['isUndefined'](_0xbbf07a[_0x250d('0x21')])){_0xbbf07a['startPredictive']=undefined;loggerPredictive[_0x250d('0x73')](_0xbbf07a[_0x250d('0x3a')],_0x250d('0x81'));}if(!_[_0x250d('0x37')](_0xbbf07a[_0x250d('0x82')])){clearInterval(_0xbbf07a[_0x250d('0x82')]);_0xbbf07a[_0x250d('0x82')]=undefined;loggerPredictive[_0x250d('0x73')](_0xbbf07a['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x3acb76,_0x501808){if(_0x501808===0x0){return 0x0;}var _0x24b5eb=0x1;for(var _0xb04fb9=0x1;_0xb04fb9<=_0x501808;_0xb04fb9+=0x1){_0x24b5eb=0x1+_0x24b5eb*_0xb04fb9/_0x3acb76;}return 0x1/_0x24b5eb;}function isVoiceQueueOutbound(_0xc7c2e4){return _0xc7c2e4===_0x250d('0x47');}function isNotPreview(_0x2394ee){return _0x2394ee!==_0x250d('0x17');}function isCampaignIvr(_0x430283){return _0x430283===_0x250d('0x83');}function getCallerId(_0x553258,_0x5993f8,_0x1c91ac){if(!_['isUndefined'](_0x1c91ac)&&_0x250d('0x84')===typeof _0x1c91ac&&!_[_0x250d('0x40')](_0x1c91ac)){if(!_[_0x250d('0x37')](_0x5993f8)&&_0x250d('0x84')===typeof _0x5993f8&&!_['isEmpty'](_0x5993f8)){return util['format']('\x22%s\x22\x20<%s>',_0x5993f8,_0x1c91ac);}return util[_0x250d('0x6e')](_0x250d('0x85'),_0x1c91ac,_0x1c91ac);}if(!_[_0x250d('0x37')](_0x553258)&&_0x250d('0x84')===typeof _0x553258&&!_['isEmpty'](_0x553258)){return _0x553258;}return _0x250d('0x86');}function loggerCatchQueueSummary(_0x471af9,_0x420053){return function(_0x2e1583){freeVariablesPredictive(_0x420053);emitVoiceQueueSummary(_0x420053);emitCampaignSummary(_0x420053);loggerSyncQueueSummary[_0x250d('0x87')](_0x471af9,util[_0x250d('0x88')](_0x2e1583,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5e382f,_0x1a70bb){return function(_0x1e20de){loggerPredictive[_0x250d('0x87')](_0x1a70bb[_0x250d('0x3a')],_0x5e382f);loggerPredictive[_0x250d('0x87')](_0x1e20de[_0x250d('0x89')]);freeVariablesPredictive(_0x1a70bb);};}function loggerCatch(_0xf2e4f1){return function(_0x152ec4){logger[_0x250d('0x87')](_0xf2e4f1,util['inspect'](_0x152ec4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3573de){return _0x3573de&&!_[_0x250d('0x37')](_0x3573de)&&_0x3573de['length']>0x0;}function decremetOriginate(_0x2730ea){if(!_[_0x250d('0x37')](_0x2730ea)&&_0x2730ea!==null){if(_0x2730ea[_0x250d('0x8a')]('originated')){if(_0x2730ea[_0x250d('0x8b')]>0x0){_0x2730ea[_0x250d('0x8b')]-=0x1;}else{logger[_0x250d('0x87')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x250d('0x87')](_0x250d('0x8c'));}}function checkContactLowerLimitOriginate(_0x10ef67,_0x4bb6f1,_0x42d46f){if(_0x4bb6f1>_0x42d46f){for(var _0x81c2b8=0x0;_0x81c2b8<_0x4bb6f1-_0x42d46f;_0x81c2b8+=0x1){decremetOriginate(_0x10ef67);}}}function loggerGetContactDialer(_0xf14fae,_0x17caf9,_0x4ee300){return function(_0x55213c){checkContactLowerLimitOriginate(_0x17caf9,_0x4ee300,0x0);logger[_0x250d('0x87')](_0xf14fae,util[_0x250d('0x88')](_0x55213c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x89ed80){return function(_0x516581){if(isNotNull(_0x516581)&&isNotNull(_0x516581[0x0])){if(_0x516581[0x0][_0x250d('0x8d')]>0x0){_0x89ed80[_0x250d('0x38')]=_0x250d('0x8e');logger[_0x250d('0x73')](_0x250d('0x8f')+_0x89ed80['name'],_0x516581[0x0][_0x250d('0x8d')],_0x250d('0x90'));}else{_0x89ed80[_0x250d('0x38')]=_0x250d('0x91');logger['info'](_0x250d('0x92')+_0x89ed80[_0x250d('0x3a')]);}}};}function notSendMessagesQueue(_0x56be37){if(_0x56be37[_0x250d('0x93')]){freeVariablesPredictive(_0x56be37);if(_0x56be37['originated']===0x0&&_0x56be37[_0x250d('0x4d')]===0x0&&_0x56be37[_0x250d('0x51')]===0x0&&(_0x56be37[_0x250d('0x4b')]||0x0)===0x0){_0x56be37['sendMessageOneNotActive']=![];_0x56be37[_0x250d('0x49')]=0x0;_0x56be37[_0x250d('0x38')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x250d('0x87')](_0x250d('0x94'),_0x56be37[_0x250d('0x3a')],'is\x20not\x20active');}else{_0x56be37[_0x250d('0x38')]=_0x250d('0x95');loggerSyncQueueSummary[_0x250d('0x87')](_0x250d('0x94'),_0x56be37[_0x250d('0x3a')],_0x250d('0x96'));}emitVoiceQueueSummary(_0x56be37);}}function notSendMessagesCampaign(_0x36fece){if(_0x36fece['sendMessageOneNotActive']){if(_0x36fece[_0x250d('0x8b')]===0x0){_0x36fece[_0x250d('0x93')]=![];_0x36fece[_0x250d('0x38')]=_0x250d('0x97');loggerSyncQueueSummary[_0x250d('0x87')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x36fece[_0x250d('0x3a')],_0x250d('0x98'));}else{_0x36fece[_0x250d('0x38')]=_0x250d('0x95');loggerSyncQueueSummary[_0x250d('0x87')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x36fece['name'],_0x250d('0x96'));}emitCampaignSummary(_0x36fece);}}function createObjHistory(_0x195e05,_0x5c8afe,_0x129fea,_0x186f75,_0x4ed1fb){_0x195e05[_0x250d('0x38')]=_0x129fea;var _0x28940d=new Action(_0x195e05,_0x5c8afe);var _0x37f34e=new History(_0x28940d);_0x37f34e[_0x250d('0x99')]=_0x186f75;_0x37f34e[_0x250d('0x9a')]=_0x4ed1fb;_0x37f34e[_0x250d('0x9b')]=_0x28940d[_0x250d('0x9c')];return _0x37f34e;}Dialer[_0x250d('0x15')][_0x250d('0x36')]=function(){var _0x27035d=this;setInterval(function(){_0x27035d[_0x250d('0x9d')](_0x27035d[_0x250d('0x1f')],_0x250d('0x9e'));_0x27035d[_0x250d('0x9d')](_0x27035d[_0x250d('0x1e')],'[actions]');},0x32c8);};Dialer[_0x250d('0x15')][_0x250d('0x9d')]=function(_0x1c5167,_0x2c4dfa){var _0x39cfa2=this;for(var _0x2f038e in _0x1c5167){if(_0x1c5167['hasOwnProperty'](_0x2f038e)){this[_0x250d('0x9f')]['enqueue'](function(){if(!_[_0x250d('0xa0')](_0x1c5167[_0x2f038e])){return ami[_0x250d('0xa1')]({'action':_0x250d('0xa2'),'channel':_0x1c5167[_0x2f038e][_0x250d('0xa3')]})[_0x250d('0xa4')](function(_0x37c727){if(_0x37c727[_0x250d('0x38')]===_0x250d('0xa5')){setTimeout(function(){if(_0x1c5167[_0x2f038e]&&_0x1c5167[_0x2f038e][_0x250d('0x46')]!=='ivr'){_0x39cfa2['updateOriginated'](_0x39cfa2[_0x250d('0x18')][_0x1c5167[_0x2f038e][_0x250d('0xa6')]]);logger[_0x250d('0x87')](_0x250d('0xa7'),_0x2c4dfa,_0x2f038e,_0x1c5167[_0x2f038e]['queue']);delete _0x1c5167[_0x2f038e];}if(_0x1c5167[_0x2f038e]&&_0x1c5167[_0x2f038e][_0x250d('0x46')]===_0x250d('0x83')){_0x39cfa2[_0x250d('0xa8')](_0x39cfa2['campaigns'][_0x1c5167[_0x2f038e]['queue']]);logger['error'](_0x250d('0xa9'),_0x2c4dfa,_0x2f038e,_0x1c5167[_0x2f038e]['queue']);delete _0x1c5167[_0x2f038e];}},0x2328);}});}});}}};Dialer[_0x250d('0x15')]['countReScheduled']=function(_0x431e8d){return BPromise[_0x250d('0xaa')]()[_0x250d('0xab')](cmHopper[_0x250d('0xac')](_0x431e8d))[_0x250d('0xa4')](loggerCatch(_0x250d('0xad')));};Dialer[_0x250d('0x15')][_0x250d('0xae')]=function(_0x380d4b){return BPromise[_0x250d('0xaa')]()[_0x250d('0xab')](cmHopperBlack[_0x250d('0xae')](_0x380d4b))['catch'](loggerCatch(_0x250d('0xaf')));};Dialer[_0x250d('0x15')][_0x250d('0xb0')]=function(_0x51f9fa){return BPromise[_0x250d('0xaa')]()[_0x250d('0xab')](cmHopperBlack[_0x250d('0xb0')](_0x51f9fa))['catch'](loggerCatch(_0x250d('0xb1')));};Dialer[_0x250d('0x15')]['averageHandleTime']=function(_0x4fe1ab){return BPromise['resolve']()[_0x250d('0xab')](cmHopperHistory[_0x250d('0xb2')](_0x4fe1ab))[_0x250d('0xa4')](loggerCatch(_0x250d('0xb3')));};Dialer['prototype']['rescheduleContact']=function(_0x4de53c){return BPromise[_0x250d('0xaa')]()['then'](cmHopper['rescheduleContact'](_0x4de53c))[_0x250d('0xa4')](loggerCatch(_0x250d('0xb4')));};Dialer[_0x250d('0x15')]['unlockContact']=function(_0x3c7e0d,_0x1d8d94,_0x1caa02){return BPromise['resolve']()[_0x250d('0xab')](cmHopper[_0x250d('0xb5')](_0x3c7e0d,_0x1d8d94,_0x1caa02))['catch'](loggerCatch(_0x250d('0xb6')));};Dialer[_0x250d('0x15')]['getContactDialer']=function(_0x32e466,_0x4fdd45,_0x3b1f82,_0x4e64a9){return BPromise[_0x250d('0xaa')]()[_0x250d('0xab')](cmHopper[_0x250d('0xb7')](_0x32e466,_0x4fdd45,_0x3b1f82,_0x4e64a9))['catch'](loggerCatch(_0x250d('0xb8')));};Dialer[_0x250d('0x15')][_0x250d('0xb9')]=function(_0x2d3a05,_0x35fa5c,_0x2e2bdb){return BPromise['resolve']()[_0x250d('0xab')](cmHopper[_0x250d('0xb9')](_0x2d3a05,_0x35fa5c,_0x2e2bdb))[_0x250d('0xa4')](loggerCatch(_0x250d('0xb8')));};Dialer[_0x250d('0x15')][_0x250d('0xba')]=function(_0x461f6b){return BPromise['resolve']()[_0x250d('0xab')](voiceQueueRt[_0x250d('0xba')](_0x461f6b))[_0x250d('0xa4')](loggerCatch(_0x250d('0xbb')));};Dialer[_0x250d('0x15')][_0x250d('0xbc')]=function(_0x1ac68a){return BPromise[_0x250d('0xaa')]()['then'](cmHopper['moveContactManagedDialer'](_0x1ac68a))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x250d('0x15')][_0x250d('0xbd')]=function(_0x1cc986){return BPromise[_0x250d('0xaa')]()[_0x250d('0xab')](cmHopperHistory[_0x250d('0xbd')](_0x1cc986))['catch'](loggerCatch(_0x250d('0xbe')));};Dialer[_0x250d('0x15')][_0x250d('0xa8')]=function(_0x38c27a){if(!_[_0x250d('0x37')](_0x38c27a)&&_0x38c27a!==null){if(_0x38c27a[_0x250d('0x8a')](_0x250d('0x8b'))){if(_0x38c27a[_0x250d('0x8b')]>0x0){_0x38c27a['originated']-=0x1;}else{logger[_0x250d('0x87')](_0x250d('0xbf'));}}}else{logger[_0x250d('0x87')](_0x250d('0xc0'));}};Dialer[_0x250d('0x15')]['loggerHandler']=function(_0x54134a,_0xf11c11){var _0x4ab5ab=this;return function(_0xc61285){_0x4ab5ab[_0x250d('0xa8')](_0xf11c11);logger[_0x250d('0x87')](_0x54134a,util[_0x250d('0x88')](_0xc61285,{'showHidden':![],'depth':null}));};};Dialer[_0x250d('0x15')][_0x250d('0xc1')]=function(_0x98f638,_0xab0f98,_0x4ab909){var _0x414089={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0xab0f98);this[_0x250d('0xc2')](_['merge'](_0x414089,_[_0x250d('0xc3')](_0x4ab909,['ContactId',_0x250d('0xc4'),_0x250d('0xc5'),'VoiceQueueId','CampaignId'])),'[emptyContact][createHistory]',_0x250d('0xc6'));logger[_0x250d('0x87')](_0x98f638);};Dialer[_0x250d('0x15')][_0x250d('0xc7')]=function(_0x7fdaf9){return _0x7fdaf9===_0x250d('0xc8');};Dialer['prototype']['isTrunkReachable']=function(_0x316f94){return!_['isUndefined'](_0x316f94)&&_0x316f94&&!_[_0x250d('0x37')](_0x316f94[_0x250d('0x3a')])&&!_['isUndefined'](_0x316f94[_0x250d('0x6b')])&&_0x316f94['active']&&(this[_0x250d('0x1b')][util[_0x250d('0x6e')](_0x250d('0xc9'),_0x316f94[_0x250d('0x3a')])][_0x250d('0xa2')]===_0x250d('0xca')||this['trunks'][util[_0x250d('0x6e')](_0x250d('0xc9'),_0x316f94['name'])][_0x250d('0xa2')]===_0x250d('0xcb'));};Dialer[_0x250d('0x15')][_0x250d('0xc2')]=function(_0x3ea0f0,_0x31d079,_0x8fd218){this[_0x250d('0xbd')](_0x3ea0f0)[_0x250d('0xa4')](loggerCatch(_0x31d079));this['moveContactManagedDialer'](_0x3ea0f0)[_0x250d('0xa4')](loggerCatch(_0x8fd218));};Dialer[_0x250d('0x15')][_0x250d('0x31')]=function(_0x1acd8b){var _0x3c2a45=this[_0x250d('0x1f')][_0x1acd8b[_0x250d('0xcc')]];var _0x1e8059;if(!_['isNil'](_0x1acd8b)&&!_[_0x250d('0xa0')](_0x1acd8b[_0x250d('0xcd')])&&!_[_0x250d('0xa0')](_0x1acd8b[_0x250d('0xcd')]['amdstatus'])&&_0x1acd8b[_0x250d('0xce')]==='xcally-motion-dialer'&&_0x3c2a45){if(_0x3c2a45[_0x250d('0x46')]!==_0x250d('0x83')&&this['voiceQueues'][_0x3c2a45['queue']][_0x250d('0xcf')]&&_0x1acd8b[_0x250d('0xd0')]===_0x250d('0xd1')){delete this[_0x250d('0x1f')][_0x1acd8b[_0x250d('0xcc')]];this[_0x250d('0xa8')](this[_0x250d('0x18')][_0x3c2a45[_0x250d('0xa6')]]);this[_0x250d('0x18')][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0x59')]+=0x1;this[_0x250d('0x18')][_0x3c2a45['queue']][_0x250d('0x58')]+=0x1;_0x1e8059=new Hangup(_0x3c2a45,_0x1acd8b);_0x1e8059['state']=0x12;_0x1e8059[_0x250d('0x9a')]=_0x250d('0xd2');_0x1e8059['membername']='AMD';this[_0x250d('0xc2')](_0x1e8059,'[syncHangupInAMD][createHistory]',_0x250d('0xd3'));}if(_0x3c2a45['type']!==_0x250d('0x83')&&this[_0x250d('0x18')][_0x3c2a45[_0x250d('0xa6')]]['dialAMDActive']&&_0x1acd8b['value']===_0x250d('0xd4')){var _0x5f11e4=this;return new BPromise(function(_0x278780,_0xcb0f33){delete _0x5f11e4[_0x250d('0x1f')][_0x1acd8b[_0x250d('0xcc')]];_0x5f11e4[_0x250d('0xa8')](_0x5f11e4[_0x250d('0x18')][_0x3c2a45[_0x250d('0xa6')]]);_0x5f11e4['voiceQueues'][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0x59')]+=0x1;_0x5f11e4[_0x250d('0x18')][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0x58')]+=0x1;var _0x36faa1=_0x5f11e4['voiceQueues'][_0x3c2a45[_0x250d('0xa6')]];var _0x1979b0=new Hangup(_0x3c2a45,_0x1acd8b);_0x1979b0[_0x250d('0x99')]=0x13;_0x1979b0['statedesc']='Machine';_0x1979b0['membername']=_0x250d('0xd5');_0x1979b0[_0x250d('0xd6')]+=0x1;_0x1979b0[_0x250d('0xd7')]+=0x1;_0x1979b0[_0x250d('0xd8')]=!![];_0x5f11e4['createHistory'](_0x1979b0)[_0x250d('0xa4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1979b0[_0x250d('0xd9')]+_0x1979b0['countcongestionretry']+_0x1979b0[_0x250d('0xda')]+_0x1979b0[_0x250d('0xdb')]+_0x1979b0[_0x250d('0xdc')]+_0x1979b0[_0x250d('0xdd')]+_0x1979b0[_0x250d('0xd6')]+_0x1979b0[_0x250d('0xde')]>=_0x36faa1[_0x250d('0xdf')]){_0x5f11e4[_0x250d('0xe0')](_0x1979b0,_0x278780,_0xcb0f33,_0x250d('0xe1'));}else{if(_0x1979b0[_0x250d('0xd6')]>=_0x36faa1[_0x250d('0xe2')]){_0x5f11e4['createStateFinal'](_0x1979b0,_0x278780,_0xcb0f33,_0x250d('0xe3'));}else{_0x5f11e4['rescheduleContact']({'active':![],'countmachineretry':_0x1979b0['countmachineretry'],'scheduledat':moment()[_0x250d('0xe4')](_0x36faa1[_0x250d('0xe5')],_0x250d('0xe6'))[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0x1979b0[_0x250d('0xe8')],'ListId':_0x1979b0['ListId'],'VoiceQueueId':_0x1979b0[_0x250d('0xe9')]||undefined,'CampaignId':_0x1979b0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0xeb')));_0x278780({'reschedule':0x1});}}});}if(_0x3c2a45[_0x250d('0x46')]===_0x250d('0x83')&&this[_0x250d('0x19')][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0xcf')]&&_0x1acd8b['value']===_0x250d('0xd1')){delete this[_0x250d('0x1f')][_0x1acd8b[_0x250d('0xcc')]];this[_0x250d('0xa8')](this[_0x250d('0x19')][_0x3c2a45['queue']]);_0x1e8059=new Hangup(_0x3c2a45,_0x1acd8b);_0x1e8059[_0x250d('0x99')]=0x12;_0x1e8059['statedesc']=_0x250d('0xd2');_0x1e8059[_0x250d('0xec')]=_0x250d('0xd5');this[_0x250d('0xc2')](_0x1e8059,_0x250d('0xed'),_0x250d('0xee'));}if(_0x3c2a45['type']==='ivr'&&this[_0x250d('0x19')][_0x3c2a45['queue']][_0x250d('0xcf')]&&_0x1acd8b[_0x250d('0xd0')]===_0x250d('0xd4')){var _0x5f11e4=this;return new BPromise(function(_0x65685,_0x534b7a){delete _0x5f11e4[_0x250d('0x1f')][_0x1acd8b[_0x250d('0xcc')]];_0x5f11e4[_0x250d('0xa8')](_0x5f11e4[_0x250d('0x19')][_0x3c2a45[_0x250d('0xa6')]]);_0x5f11e4['campaigns'][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0x59')]+=0x1;_0x5f11e4[_0x250d('0x19')][_0x3c2a45[_0x250d('0xa6')]][_0x250d('0x58')]+=0x1;var _0x46f93b=_0x5f11e4[_0x250d('0x19')][_0x3c2a45[_0x250d('0xa6')]];var _0x123c0e=new Hangup(_0x3c2a45,_0x1acd8b);_0x123c0e[_0x250d('0x99')]=0x13;_0x123c0e['statedesc']='Machine';_0x123c0e[_0x250d('0xec')]=_0x250d('0xd5');_0x123c0e[_0x250d('0xd6')]+=0x1;_0x123c0e[_0x250d('0xd7')]+=0x1;_0x123c0e['amd']=!![];_0x5f11e4[_0x250d('0xbd')](_0x123c0e)[_0x250d('0xa4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x123c0e[_0x250d('0xd9')]+_0x123c0e[_0x250d('0xef')]+_0x123c0e['countnoanswerretry']+_0x123c0e['countnosuchnumberretry']+_0x123c0e['countdropretry']+_0x123c0e[_0x250d('0xdd')]+_0x123c0e[_0x250d('0xd6')]+_0x123c0e['countagentrejectretry']>=_0x46f93b[_0x250d('0xdf')]){_0x5f11e4[_0x250d('0xe0')](_0x123c0e,_0x65685,_0x534b7a,'reason19\x20machine....');}else{if(_0x123c0e[_0x250d('0xd6')]>=_0x46f93b[_0x250d('0xe2')]){_0x5f11e4['createStateFinal'](_0x123c0e,_0x65685,_0x534b7a,_0x250d('0xe3'));}else{_0x5f11e4[_0x250d('0xf0')]({'active':![],'countmachineretry':_0x123c0e[_0x250d('0xd6')],'scheduledat':moment()[_0x250d('0xe4')](_0x46f93b[_0x250d('0xe5')],_0x250d('0xe6'))[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0x123c0e[_0x250d('0xe8')],'ListId':_0x123c0e[_0x250d('0xc4')],'VoiceQueueId':_0x123c0e[_0x250d('0xe9')]||undefined,'CampaignId':_0x123c0e['CampaignId']||undefined})[_0x250d('0xa4')](loggerCatch('[rescheduleContact][Machine]'));_0x65685({'reschedule':0x1});}}});}}};Dialer[_0x250d('0x15')][_0x250d('0x2d')]=function(_0x3a34b4){var _0x327ee0=this['uniqueId'][_0x3a34b4['uniqueid']];var _0x544713=this;var _0x15417b;if(_0x327ee0&&_0x327ee0['type']==='ivr'){delete this[_0x250d('0x1f')][_0x3a34b4[_0x250d('0xcc')]];this[_0x250d('0xa8')](this[_0x250d('0x19')][_0x327ee0[_0x250d('0xa6')]]);this[_0x250d('0x19')][_0x327ee0[_0x250d('0xa6')]][_0x250d('0xf1')]+=0x1;_0x15417b=new Hangup(_0x327ee0,_0x3a34b4);this[_0x250d('0xbd')](_0x15417b)[_0x250d('0xa4')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x250d('0xbc')](_0x15417b)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x327ee0&&_0x327ee0[_0x250d('0x46')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x327ee0['queue']][_0x250d('0xf2')])){delete this['uniqueId'][_0x3a34b4[_0x250d('0xcc')]];this[_0x250d('0xa8')](this[_0x250d('0x18')][_0x327ee0[_0x250d('0xa6')]]);this[_0x250d('0x18')][_0x327ee0[_0x250d('0xa6')]]['outboundAnswerCallsDay']+=0x1;this[_0x250d('0x18')][_0x327ee0['queue']][_0x250d('0x58')]+=0x1;_0x15417b=new Hangup(_0x327ee0,_0x3a34b4);_0x15417b[_0x250d('0x99')]=0x10;_0x15417b['statedesc']=_0x250d('0xf3');_0x15417b[_0x250d('0xec')]=_0x250d('0xf4');this[_0x250d('0xbd')](_0x15417b)[_0x250d('0xa4')](loggerCatch(_0x250d('0xf5')));this['moveContactManagedDialer'](_0x15417b)[_0x250d('0xa4')](loggerCatch(_0x250d('0xf6')));}if(_0x327ee0&&_0x327ee0[_0x250d('0x46')]!=='ivr'&&!isNotNull(this[_0x250d('0x18')][_0x327ee0[_0x250d('0xa6')]][_0x250d('0xf2')])){delete this['uniqueId'][_0x3a34b4[_0x250d('0xcc')]];this[_0x250d('0xa8')](this['voiceQueues'][_0x327ee0[_0x250d('0xa6')]]);this[_0x250d('0x18')][_0x327ee0[_0x250d('0xa6')]]['outboundUnknownCallsDay']+=0x1;_0x15417b=new Hangup(_0x327ee0,_0x3a34b4);_0x15417b[_0x250d('0x99')]=0xc;_0x15417b[_0x250d('0x9a')]=_0x3a34b4[_0x250d('0xf7')];_0x15417b[_0x250d('0xec')]=_0x250d('0xf8');this[_0x250d('0xbd')](_0x15417b)[_0x250d('0xa4')](loggerCatch(_0x250d('0xf5')));this[_0x250d('0xbc')](_0x15417b)[_0x250d('0xa4')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x250d('0x15')][_0x250d('0xf9')]=function(_0x29a88c){var _0x31559c=this[_0x250d('0x1f')][_0x29a88c[_0x250d('0xcc')]];var _0x260f42=this;if(this[_0x250d('0x18')][_0x29a88c[_0x250d('0xa6')]]){if(_0x31559c&&_0x31559c[_0x250d('0x46')]!=='ivr'){delete this[_0x250d('0x1f')][_0x29a88c[_0x250d('0xcc')]];this[_0x250d('0x18')][_0x29a88c['queue']]['outboundAnswerCallsDay']+=0x1;var _0x3e7386=new AgentComplete(_0x31559c,_0x29a88c);if(_0x29a88c['reason']===_0x250d('0xfa')){_0x3e7386[_0x250d('0xfb')]=this[_0x250d('0x18')][_0x29a88c[_0x250d('0xa6')]]['dialQueueProject2']&&this[_0x250d('0x18')][_0x29a88c[_0x250d('0xa6')]][_0x250d('0xfc')]?moment()[_0x250d('0x6e')](_0x250d('0xe7')):undefined;}this[_0x250d('0xbd')](_0x3e7386)[_0x250d('0xa4')](loggerCatch(_0x250d('0xfd')));this['moveContactManagedDialer'](_0x3e7386)[_0x250d('0xa4')](loggerCatch(_0x250d('0xfe')));}}};Dialer[_0x250d('0x15')][_0x250d('0xff')]=function(_0x17d5dd){if(this[_0x250d('0x18')][_0x17d5dd[_0x250d('0xa6')]]){if(this[_0x250d('0x1f')][_0x17d5dd['uniqueid']]&&this[_0x250d('0x1f')][_0x17d5dd[_0x250d('0xcc')]][_0x250d('0x46')]!==_0x250d('0x83')){this[_0x250d('0xa8')](this[_0x250d('0x18')][_0x17d5dd[_0x250d('0xa6')]]);this[_0x250d('0x1f')][_0x17d5dd[_0x250d('0xcc')]][_0x250d('0x100')]=moment()[_0x250d('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x250d('0x15')][_0x250d('0x101')]=function(_0x1aa4d1){this['createHistory'](_0x1aa4d1)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x250d('0xbc')](_0x1aa4d1)[_0x250d('0xa4')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x250d('0x29')]=function(_0x225570){var _0xe2a230=this[_0x250d('0x1f')][_0x225570[_0x250d('0xcc')]];var _0x261fe3=this;if(this['voiceQueues'][_0x225570[_0x250d('0xa6')]]){if(_0xe2a230&&_0xe2a230[_0x250d('0x46')]!==_0x250d('0x83')){delete this['uniqueId'][_0x225570[_0x250d('0xcc')]];this[_0x250d('0xa8')](this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]]);_0xe2a230['droptime']=moment()[_0x250d('0x6e')](_0x250d('0xe7'));var _0x31ea89=new QueueCallerAbandon(_0xe2a230,_0x225570);if(getSeconds(_0xe2a230[_0x250d('0x102')],_0xe2a230[_0x250d('0x103')])>=_0xe2a230[_0x250d('0x104')]){this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x225570[_0x250d('0xa6')]][_0x250d('0x5e')]+=0x1;this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]][_0x250d('0x105')]+=0x1;_0x31ea89['state']=0xa;_0x31ea89[_0x250d('0x9a')]=_0x250d('0x106');_0x31ea89[_0x250d('0x107')]=_0x250d('0x108');_0x31ea89[_0x250d('0xfb')]=this[_0x250d('0x18')][_0x225570['queue']][_0x250d('0x109')]?moment()[_0x250d('0x6e')](_0x250d('0xe7')):undefined;_0x31ea89[_0x250d('0xdc')]+=0x1;_0x31ea89[_0x250d('0xd7')]+=0x1;if(_0x31ea89['countdropretry']>=this[_0x250d('0x18')][_0x225570['queue']]['dialDropMaxRetry']){this[_0x250d('0x101')](_0x31ea89);}else{this[_0x250d('0xf0')]({'active':![],'countdropretry':_0x31ea89[_0x250d('0xdc')],'scheduledat':moment()[_0x250d('0xe4')](this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]][_0x250d('0x10a')],_0x250d('0xe6'))[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0xe2a230[_0x250d('0xe8')],'ListId':_0xe2a230[_0x250d('0xc4')],'VoiceQueueId':_0xe2a230[_0x250d('0xe9')]||undefined,'CampaignId':_0xe2a230[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch('[rescheduleContact][Drop]'));var _0x5d70e5=new History(_0x31ea89);_0x5d70e5[_0x250d('0x99')]=0xa;_0x5d70e5['statedesc']=_0x250d('0x106');_0x5d70e5[_0x250d('0x9c')]=moment()[_0x250d('0x6e')](_0x250d('0xe7'));_0x5d70e5[_0x250d('0x9b')]=_0x5d70e5[_0x250d('0x9c')];_0x5d70e5[_0x250d('0x10b')]=_0x31ea89[_0x250d('0x10b')];_0x5d70e5[_0x250d('0x10c')]=_0x31ea89[_0x250d('0x10c')];this[_0x250d('0xbd')](_0x5d70e5)[_0x250d('0xa4')](loggerCatch(_0x250d('0x10d')));}}else{this[_0x250d('0x18')][_0x225570['queue']][_0x250d('0x64')]+=0x1;this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]][_0x250d('0x5d')]+=0x1;_0x31ea89[_0x250d('0x99')]=0xb;_0x31ea89[_0x250d('0x9a')]='Abandoned';_0x31ea89[_0x250d('0x107')]=_0x250d('0x10e');_0x31ea89[_0x250d('0xdd')]+=0x1;_0x31ea89[_0x250d('0xd7')]+=0x1;if(_0x31ea89['countabandonedretry']>=this[_0x250d('0x18')][_0x225570['queue']][_0x250d('0x10f')]){this[_0x250d('0x101')](_0x31ea89);}else{this[_0x250d('0xf0')]({'active':![],'countabandonedretry':_0x31ea89['countabandonedretry'],'scheduledat':moment()[_0x250d('0xe4')](this[_0x250d('0x18')][_0x225570[_0x250d('0xa6')]]['dialAbandonedRetryFrequency'],_0x250d('0xe6'))[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0xe2a230['ContactId'],'ListId':_0xe2a230[_0x250d('0xc4')],'VoiceQueueId':_0xe2a230[_0x250d('0xe9')]||undefined,'CampaignId':_0xe2a230[_0x250d('0xea')]||undefined})['catch'](loggerCatch(_0x250d('0x110')));var _0x5d70e5=new History(_0x31ea89);_0x5d70e5['state']=0xb;_0x5d70e5['statedesc']=_0x250d('0x111');_0x5d70e5[_0x250d('0x9c')]=moment()[_0x250d('0x6e')](_0x250d('0xe7'));_0x5d70e5['endtime']=_0x5d70e5['starttime'];_0x5d70e5[_0x250d('0x10b')]=_0x31ea89[_0x250d('0x10b')];_0x5d70e5['calleridnum']=_0x31ea89[_0x250d('0x10c')];this[_0x250d('0xbd')](_0x5d70e5)[_0x250d('0xa4')](loggerCatch(_0x250d('0x112')));}}}}};Dialer[_0x250d('0x15')][_0x250d('0x2f')]=function(_0x4af600){if(this[_0x250d('0x1e')][_0x4af600[_0x250d('0xcc')]]){this[_0x250d('0x1e')][_0x4af600['uniqueid']]['channel']=_0x4af600[_0x250d('0xa3')];}if(this[_0x250d('0x1f')][_0x4af600[_0x250d('0xcc')]]){this[_0x250d('0x1f')][_0x4af600[_0x250d('0xcc')]][_0x250d('0xa3')]=_0x4af600[_0x250d('0xa3')];}};Dialer['prototype'][_0x250d('0x33')]=function(_0x3caaff){if(strategy[this[_0x250d('0x18')][this['actions'][_0x3caaff[_0x250d('0x113')]][_0x250d('0xa6')]]['strategy']]===_0x250d('0x14')){if(this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]]&&_[_0x250d('0xa0')](this[_0x250d('0x1e')][_0x3caaff['actionid']][_0x250d('0x114')])&&_0x3caaff[_0x250d('0xa2')]==='1'&&_0x3caaff[_0x250d('0x115')]==='0'){if(this[_0x250d('0x1a')][_0x3caaff['stateinterface']]){if(!this[_0x250d('0x1a')][_0x3caaff[_0x250d('0x116')]][_0x250d('0x114')]){this['agents'][_0x3caaff[_0x250d('0x116')]][_0x250d('0x114')]=!![];this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]][_0x250d('0x114')]=!![];this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]][_0x250d('0x116')]=_0x3caaff[_0x250d('0x116')];}}}}else if((strategy[this[_0x250d('0x18')][this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]][_0x250d('0xa6')]]['strategy']]||_0x250d('0x117'))===_0x250d('0x117')){if(this['actions'][_0x3caaff[_0x250d('0x113')]]){if(this[_0x250d('0x1a')][_0x3caaff[_0x250d('0x116')]]){this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]][_0x250d('0x116')]=_0x3caaff[_0x250d('0x116')];if(_['isNil'](this['queueBooked'][this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]][_0x250d('0xa6')]])){this[_0x250d('0x24')][this['actions'][_0x3caaff['actionid']][_0x250d('0xa6')]]=[];}this[_0x250d('0x24')][this['actions'][_0x3caaff[_0x250d('0x113')]]['queue']][_0x250d('0x118')](_['merge'](_['pick'](this[_0x250d('0x1e')][_0x3caaff[_0x250d('0x113')]],['idHopper',_0x250d('0x116')]),{'status':_0x3caaff[_0x250d('0xa2')],'paused':_0x3caaff[_0x250d('0x115')]}));}}}};function unlockQueueStatus(_0x5a88f4,_0xb6e011){setTimeout(function(){if(_['isUndefined'](_0x5a88f4['queueStatusComplete'])){loggerBooked[_0x250d('0x87')](_0x250d('0x119'),_0xb6e011);}_0x5a88f4[_0x250d('0x11a')]=!![];loggerBooked[_0x250d('0x73')]('[booked][unlockQueueStatus]',_0xb6e011,JSON[_0x250d('0x41')](_[_0x250d('0xc3')](_0x5a88f4,[_0x250d('0x3a'),_0x250d('0x11a')])));},0x1f3);}Dialer[_0x250d('0x15')]['syncQueueStatusComplete']=function(_0x1e974b){var _0x315591=this;var _0x574785=_0x315591['voiceQueues'][_0x315591[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]];if(strategy[this[_0x250d('0x18')][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]][_0x250d('0x48')]]==='roundrobin'){if(this[_0x250d('0x1e')][_0x1e974b['actionid']]&&this['actions'][_0x1e974b[_0x250d('0x113')]][_0x250d('0x116')]){this[_0x250d('0x17')][_0x250d('0x11b')](this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0x11c')],this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0x116')])['catch'](function(_0x16da63){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x250d('0x88')](_0x16da63,{'showHidden':![],'depth':null}));})['finally'](function(){_0x315591[_0x250d('0xa8')](_0x315591[_0x250d('0x18')][_0x315591[_0x250d('0x1e')][_0x1e974b['actionid']][_0x250d('0xa6')]]);_0x315591[_0x250d('0x1a')][_0x315591[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0x116')]][_0x250d('0x114')]=![];delete _0x315591[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]];unlockQueueStatus(_0x574785);});}else{this[_0x250d('0xa8')](this[_0x250d('0x18')][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xe8')],'ListId':this['actions'][_0x1e974b[_0x250d('0x113')]][_0x250d('0xc4')],'VoiceQueueId':this['actions'][_0x1e974b['actionid']][_0x250d('0xe9')]||undefined,'CampaignId':this['actions'][_0x1e974b[_0x250d('0x113')]][_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x11d')));delete this[_0x250d('0x1e')][_0x1e974b['actionid']];unlockQueueStatus(_0x574785);}}else if((strategy[this[_0x250d('0x18')][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]][_0x250d('0x48')]]||_0x250d('0x117'))===_0x250d('0x117')){var _0x24e393;if(this[_0x250d('0x1e')][_0x1e974b['actionid']]&&!_[_0x250d('0x40')](this['queueBooked'][this[_0x250d('0x1e')][_0x1e974b['actionid']][_0x250d('0xa6')]])){if(this[_0x250d('0x25')][_0x315591[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]]){this[_0x250d('0x25')][_0x315591[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]]['queue']]=this[_0x250d('0x25')][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]]?this[_0x250d('0x25')][this['actions'][_0x1e974b[_0x250d('0x113')]]['queue']]:this['queueBooked'][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]]?this['queueBooked'][this[_0x250d('0x1e')][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]][_0x250d('0x11e')]||0x0:0x0;}this[_0x250d('0x24')][this['actions'][_0x1e974b[_0x250d('0x113')]][_0x250d('0xa6')]][_0x250d('0x11e')]=this[_0x250d('0x25')][this[_0x250d('0x1e')][_0x1e974b['actionid']]['queue']];for(var _0x1ac90c=0x0;_0x1ac90c=0x0?!![]:![];})[_0x250d('0xa4')](myreject(_0x2e1114)));}}else{_0x1200f0[_0x250d('0x118')](ami[_0x250d('0xa1')]({'action':'command','command':util[_0x250d('0x6e')](_0x250d('0x136'),_0x126692,!_['isUndefined'](config[_0x250d('0x133')][_0xf0414f])?_0xf0414f:'')})['then'](function(_0x21ff95){return _0x21ff95[_0x250d('0x138')][_0x250d('0x13a')]('true')>=0x0?!![]:![];})[_0x250d('0xa4')](myreject(_0x2e1114)));}BPromise['all'](_0x1200f0)['then'](function(_0x25de60){var _0x343964=_[_0x250d('0x13b')](_0x25de60);if(_0x343964){return _0x1744ef(_0x343964);}else{_0xefef16[_0x250d('0x38')]=_0x20799d?'GLOBAL_INTERVAL_IS_OVERTIME':_0x250d('0x13c');return _0x2e1114(msgResponse(_0x250d('0x13d'),_0x250d('0x130'),_0x250d('0x13e')+_0x20799d+'\x20'+_0x1c12b7+_0x250d('0x13f')+util[_0x250d('0x88')](_0x126692,{'showHidden':![],'depth':null})+_0x250d('0x140')+_0xf0414f));}})[_0x250d('0xa4')](function(_0x20f3d1){return _0x2e1114(msgResponse(_0x250d('0x12e'),_0x250d('0x130'),JSON[_0x250d('0x41')](_0x20f3d1)));});});};Dialer['prototype'][_0x250d('0x141')]=function(_0x34d1b2){var _0x2acbb5=this;return function(){switch(_0x34d1b2['dialMethod']){case _0x250d('0x142'):freeVariablesPredictive(_0x34d1b2);_0x2acbb5[_0x250d('0x143')](_0x34d1b2,0x1);break;case'power':freeVariablesPredictive(_0x34d1b2);_0x2acbb5[_0x250d('0x143')](_0x34d1b2,_0x34d1b2[_0x250d('0x144')]);break;case _0x250d('0x145'):_0x2acbb5['predictive'](_0x34d1b2);break;case _0x250d('0x7'):freeVariablesPredictive(_0x34d1b2);_0x2acbb5['handlePower'](_0x34d1b2,0x1);break;default:freeVariablesPredictive(_0x34d1b2);logger['error'](_0x250d('0x146'),_0x34d1b2[_0x250d('0x3a')],_0x250d('0x147'));}};};Dialer[_0x250d('0x15')]['launchHandleIvr']=function(_0x5b5455){var _0x28ad91=this;return function(){_0x28ad91[_0x250d('0x148')](_0x5b5455);};};Dialer['prototype'][_0x250d('0x2c')]=function(_0x13657b){var _0x1c8806=this;if(isNotPreview(_0x13657b[_0x250d('0x54')])){if(isVoiceQueueOutbound(_0x13657b[_0x250d('0x46')])&&isActive(_0x13657b[_0x250d('0x53')])){_0x13657b[_0x250d('0x93')]=!![];BPromise[_0x250d('0xaa')]()['then'](checkIsLoggedIn(_0x13657b,_0x13657b[_0x250d('0x4a')]))[_0x250d('0xab')](checkIsActive(_0x13657b,_0x13657b[_0x250d('0x53')]))[_0x250d('0xab')](checkInterval(_0x13657b))[_0x250d('0xab')](_0x1c8806[_0x250d('0x128')](_0x13657b))[_0x250d('0xab')](_0x1c8806[_0x250d('0x12d')](_0x13657b[_0x250d('0x149')],_0x13657b[_0x250d('0x14a')],_0x13657b[_0x250d('0x3a')],_0x13657b))[_0x250d('0xab')](_0x1c8806[_0x250d('0x12f')](_0x13657b[_0x250d('0x3c')],_0x13657b[_0x250d('0x14a')],_0x13657b[_0x250d('0x3a')],_0x13657b))[_0x250d('0xab')](_0x1c8806['checkDialMethod'](_0x13657b))[_0x250d('0xa4')](loggerCatchQueueSummary('[syncQueueSummary]',_0x13657b));}else{notSendMessagesQueue(_0x13657b);}}else{freeVariablesPredictive(_0x13657b);}};Dialer['prototype'][_0x250d('0x127')]=function(){var _0x31928c=this;var _0xfdece8;for(var _0xad3f8 in this[_0x250d('0x19')]){if(this[_0x250d('0x19')][_0x250d('0x8a')](_0xad3f8)){_0xfdece8=this['campaigns'][_0xad3f8];if(isCampaignIvr(_0xfdece8[_0x250d('0x46')])&&isActive(_0xfdece8[_0x250d('0x6b')])){_0xfdece8[_0x250d('0x93')]=!![];BPromise['resolve']()['then'](checkIsActive(_0xfdece8,_0xfdece8['active']))[_0x250d('0xab')](checkInterval(_0xfdece8))[_0x250d('0xab')](_0x31928c['checkIsTrunkReachable'](_0xfdece8))[_0x250d('0xab')](_0x31928c[_0x250d('0x12d')](_0xfdece8[_0x250d('0x149')],_0xfdece8[_0x250d('0x14a')],_0xfdece8[_0x250d('0x3a')],_0xfdece8))[_0x250d('0xab')](_0x31928c[_0x250d('0x12f')](_0xfdece8[_0x250d('0x3c')],_0xfdece8[_0x250d('0x14a')],_0xfdece8[_0x250d('0x3a')],_0xfdece8))[_0x250d('0xab')](_0x31928c[_0x250d('0x14b')](_0xfdece8))[_0x250d('0xa4')](loggerCatchQueueSummary(_0x250d('0x14c'),_0xfdece8));}else{notSendMessagesCampaign(_0xfdece8);}}}};function getCallerIdRandom(_0x5d447d,_0x8fce2){var _0x11cdb3,_0x3ce48f,_0x1f05c9;if(_0x8fce2<=0x0){_0x8fce2=0x1;}_0x11cdb3=new RegExp('\x5cw{0,'+_0x8fce2+'}$');_0x3ce48f=Math[_0x250d('0x14d')](0xa,_0x8fce2-0x1);_0x1f05c9=Math[_0x250d('0x14d')](0xa,_0x8fce2)-0x1;return util[_0x250d('0x6e')]('%s',_[_0x250d('0x14e')](_0x5d447d,_0x11cdb3,_[_0x250d('0x14f')](_0x3ce48f,_0x1f05c9)));}function extractCalleridName(_0x4c08ae){var _0x39f98f=_0x4c08ae['match'](/"(.*?)"/);return _0x39f98f?_0x39f98f[0x1]:_0x4c08ae;}function extractCalleridNumber(_0x17e723){var _0x596711=_0x17e723[_0x250d('0x150')](/<(.*?)>/);return _0x596711?_0x596711[0x1]:_0x17e723;}Dialer[_0x250d('0x15')]['actionOriginate']=function(_0x1f8e6c,_0x20ec67){var _0x14d4aa=this;var _0x8ea9d2=uuid['v4']();this[_0x250d('0x1e')][_0x8ea9d2]=new Action(_0x1f8e6c,_0x20ec67,_0x8ea9d2);return new BPromise(function(_0x2ec028,_0x456c0d){if(_[_0x250d('0x37')](_0x1f8e6c)&&_0x250d('0x151')!==typeof _0x1f8e6c){return _0x456c0d(msgResponse(_0x250d('0x152'),_0x250d('0x130'),_0x250d('0x153')));}if(_[_0x250d('0x37')](_0x20ec67[_0x250d('0x154')]['phone'])||_0x20ec67[_0x250d('0x154')][_0x250d('0x155')]===null){return _0x456c0d(msgResponse(_0x250d('0x152'),_0x250d('0x130'),'contact\x20is\x20undefine'));}var _0x4a6003={'XMD-CALLERID':_0x14d4aa[_0x250d('0x1e')][_0x8ea9d2]['getCaller'](),'XMD-AGI':_0x1f8e6c[_0x250d('0xf2')]?util['format'](_0x250d('0x156'),ipAgi,_0x1f8e6c[_0x250d('0xf2')]):'NONE','XMD-AGIAFTER':_0x1f8e6c['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1f8e6c[_0x250d('0x109')]):'NONE','XMD-QUEUE':_0x1f8e6c[_0x250d('0x46')]===_0x250d('0x47')?util[_0x250d('0x6e')](_0x250d('0x157'),_0x1f8e6c[_0x250d('0x3a')],_0x1f8e6c[_0x250d('0x158')]||'',_0x1f8e6c['dialAgiAfterHangupAgent']?'c':'',_0x1f8e6c[_0x250d('0x104')]||0x3):_0x250d('0x159'),'XMD-CONTACTID':_0x20ec67[_0x250d('0xe8')],'XMD-CDRTYPE':_0x250d('0x15a'),'CALLERID(all)':_0x14d4aa['actions'][_0x8ea9d2][_0x250d('0x15b')](),'XMD-AMD':_0x1f8e6c['dialAMDActive']?_0x250d('0x15c'):'NONE','XMD-DESTINATION':_0x250d('0x15d')};if(_0x1f8e6c[_0x250d('0xcf')]){_0x4a6003['XMD-AMDINITIALSILENCE']=_0x1f8e6c[_0x250d('0x15e')]||0x9c4;_0x4a6003[_0x250d('0x15f')]=_0x1f8e6c[_0x250d('0x160')]||0x5dc;_0x4a6003['XMD-AMDAFTERGREETINGSILENCE']=_0x1f8e6c[_0x250d('0x161')]||0x320;_0x4a6003[_0x250d('0x162')]=_0x1f8e6c[_0x250d('0x163')]||0x1388;_0x4a6003['XMD-AMDMINWORDLENGTH']=_0x1f8e6c['dialAMDMinWordLength']||0x64;_0x4a6003['XMD-AMDBETWEENWORDSSILENCE']=_0x1f8e6c[_0x250d('0x164')]||0x32;_0x4a6003[_0x250d('0x165')]=_0x1f8e6c[_0x250d('0x166')]||0x3;_0x4a6003[_0x250d('0x167')]=_0x1f8e6c['dialAMDSilenceThreshold']||0x100;_0x4a6003['XMD-AMDMAXIMUMWORDLENGTH']=_0x1f8e6c[_0x250d('0x168')]||0x1388;}if(_0x1f8e6c['type']===_0x250d('0x47')){_0x4a6003[_0x250d('0x169')]=_0x20ec67[_0x250d('0xe9')];}else{_0x4a6003[_0x250d('0x16a')]=_0x20ec67[_0x250d('0xea')];}for(var _0x1813b3 in _0x20ec67['Contact']){if(_0x20ec67[_0x250d('0x154')]['hasOwnProperty'](_0x1813b3)){if(isNotNull(_0x20ec67[_0x250d('0x154')][_0x1813b3])&&_0x1813b3!=='id'&&_0x1813b3!==_0x250d('0x16b')&&_0x1813b3!==_0x250d('0x16c')&&_0x1813b3!==_0x250d('0x16d')){_0x4a6003[util[_0x250d('0x6e')]('%s%s',_0x250d('0x16e'),_[_0x250d('0x16f')](_0x1813b3))]=_0x20ec67[_0x250d('0x154')][_0x1813b3];}}}var _0x47fb1b=_0x14d4aa['isTrunkReachable'](_0x1f8e6c[_0x250d('0x6a')])?getCallerId(_0x1f8e6c[_0x250d('0x6a')][_0x250d('0x6c')],_0x1f8e6c[_0x250d('0x55')],_0x1f8e6c['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1f8e6c[_0x250d('0x56')],_0x1f8e6c[_0x250d('0x170')]):_0x1f8e6c[_0x250d('0x56')]):getCallerId(_[_0x250d('0xa0')](_0x1f8e6c[_0x250d('0x12a')])?_0x1f8e6c['Trunk']['callerid']:_0x1f8e6c[_0x250d('0x12a')][_0x250d('0x6c')],_0x1f8e6c[_0x250d('0x55')],_0x1f8e6c[_0x250d('0x170')]>0x0?getCallerIdRandom(_0x1f8e6c[_0x250d('0x56')],_0x1f8e6c['dialRandomLastDigitCallerIdNumber']):_0x1f8e6c[_0x250d('0x56')]);if(_0x47fb1b){_0x4a6003[_0x250d('0x171')]=_0x14d4aa[_0x250d('0x1e')][_0x8ea9d2][_0x250d('0x172')]=extractCalleridName(_0x47fb1b);_0x4a6003[_0x250d('0x173')]=_0x14d4aa[_0x250d('0x1e')][_0x8ea9d2]['originatecalleridnum']=extractCalleridNumber(_0x47fb1b);}return ami[_0x250d('0xa1')]({'actionid':_0x8ea9d2,'action':_0x250d('0x152'),'channel':_0x14d4aa[_0x250d('0x129')](_0x1f8e6c[_0x250d('0x6a')])?util[_0x250d('0x6e')]('SIP/%s/%s%s',_0x1f8e6c[_0x250d('0x6a')][_0x250d('0x3a')],isNotNull(_0x1f8e6c[_0x250d('0x174')])?_0x1f8e6c[_0x250d('0x174')][_0x250d('0x175')]()||'':'',_0x1f8e6c[_0x250d('0x176')]>0x0?_0x20ec67[_0x250d('0x154')][_0x250d('0x155')][_0x250d('0x177')](_0x1f8e6c[_0x250d('0x176')]):_0x20ec67['Contact'][_0x250d('0x155')]):util[_0x250d('0x6e')](_0x250d('0x178'),_[_0x250d('0xa0')](_0x1f8e6c[_0x250d('0x12a')])?_0x1f8e6c[_0x250d('0x6a')][_0x250d('0x3a')]:_0x1f8e6c[_0x250d('0x12a')][_0x250d('0x3a')],isNotNull(_0x1f8e6c['dialPrefix'])?_0x1f8e6c[_0x250d('0x174')]['trim']()||'':'',_0x1f8e6c[_0x250d('0x176')]>0x0?_0x20ec67['Contact'][_0x250d('0x155')][_0x250d('0x177')](_0x1f8e6c['dialCutDigit']):_0x20ec67[_0x250d('0x154')][_0x250d('0x155')]),'callerid':_0x47fb1b,'Exten':'xcally-motion-dialer','Context':_0x250d('0x179'),'Priority':'1','variable':_0x4a6003,'timeout':(_0x1f8e6c[_0x250d('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x8ea9d2})[_0x250d('0xab')](function(_0xf4dade){return _0x2ec028(_0xf4dade);})[_0x250d('0xa4')](function(_0x31809a){_0x1f8e6c[_0x250d('0x60')]+=0x1;var _0x5d6d8d=new History(_0x14d4aa['actions'][_0x8ea9d2]);logger[_0x250d('0x87')](util[_0x250d('0x6e')](_0x250d('0x17a'),JSON[_0x250d('0x41')](_0x31809a)));_0x5d6d8d[_0x250d('0x99')]=0xe;_0x5d6d8d[_0x250d('0x9a')]='OriginateError';_0x5d6d8d['starttime']=moment()[_0x250d('0x6e')](_0x250d('0xe7'));_0x5d6d8d[_0x250d('0x9b')]=_0x5d6d8d[_0x250d('0x9c')];_0x14d4aa['createHistory'](_0x5d6d8d)[_0x250d('0xa4')](loggerCatch(_0x250d('0x17b')));_0x14d4aa['moveContactManagedDialer'](_0x5d6d8d)[_0x250d('0xa4')](loggerCatch(_0x250d('0x17b')))['finally'](function(){delete _0x14d4aa[_0x250d('0x1e')][_0x8ea9d2];return _0x456c0d(msgResponse(_0x250d('0x152'),_0x250d('0x17c'),_0x250d('0x17d')));});});});};Dialer[_0x250d('0x15')][_0x250d('0x2a')]=function(_0x57285b){var _0xbecc58=this[_0x250d('0x1e')][_0x57285b['actionid']];var _0x347cfa=this;if(_0xbecc58){delete this[_0x250d('0x1e')][_0x57285b[_0x250d('0x113')]];_0xbecc58[_0x250d('0x103')]=moment()[_0x250d('0x6e')](_0x250d('0xe7'));var _0x16dc50=_0xbecc58[_0x250d('0x46')]===_0x250d('0x83')?this['campaigns'][_0xbecc58[_0x250d('0xa6')]]:this[_0x250d('0x18')][_0xbecc58[_0x250d('0x17e')]()];if(!this[_0x250d('0xc7')](_0x57285b[_0x250d('0x17f')])){this[_0x250d('0xa8')](_0x16dc50);return this[_0x250d('0x180')](_0xbecc58,_0x16dc50,_0x57285b)[_0x250d('0xab')](function(_0x1ed546){})[_0x250d('0xa4')](loggerCatch(_0x250d('0x181')));}else{this[_0x250d('0x1f')][_0x57285b['uniqueid']]=_0xbecc58;}}};Dialer[_0x250d('0x15')]['checkRetriveMax']=function(_0x459e81,_0x30c3d3,_0xabd813){var _0x2a54e0=new History(_0x30c3d3);if(_0x2a54e0[_0x250d('0xd9')]+_0x2a54e0[_0x250d('0xef')]+_0x2a54e0['countnoanswerretry']+_0x2a54e0[_0x250d('0xdb')]+_0x2a54e0['countdropretry']+_0x2a54e0['countabandonedretry']+_0x2a54e0[_0x250d('0xd6')]+_0x2a54e0[_0x250d('0xde')]>=_0xabd813[_0x250d('0xdf')]-0x1){return!![];}switch(_0x459e81){case 0x3:if(_0x2a54e0['countnoanswerretry']>=_0xabd813[_0x250d('0x182')]-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countnoanswerretry':_0x2a54e0[_0x250d('0xda')]+=0x1,'scheduledat':moment()[_0x250d('0xe4')](_0xabd813[_0x250d('0x183')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0['ListId'],'VoiceQueueId':_0x2a54e0[_0x250d('0xe9')]||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x184')));}break;case 0x5:if(_0x2a54e0[_0x250d('0xd9')]>=_0xabd813[_0x250d('0x185')]-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countbusyretry':_0x2a54e0['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0xabd813[_0x250d('0x186')],'minutes')[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0['ListId'],'VoiceQueueId':_0x2a54e0[_0x250d('0xe9')]||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})['catch'](loggerCatch(_0x250d('0x187')));}break;case 0x8:if(_0x2a54e0[_0x250d('0xef')]>=_0xabd813[_0x250d('0x188')]-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countcongestionretry':_0x2a54e0[_0x250d('0xef')]+=0x1,'scheduledat':moment()[_0x250d('0xe4')](_0xabd813[_0x250d('0x189')],_0x250d('0xe6'))['format'](_0x250d('0xe7')),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0['VoiceQueueId']||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x18a')));}break;case 0x0:if(_0x2a54e0[_0x250d('0xdb')]>=_0xabd813['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countnosuchnumberretry':_0x2a54e0[_0x250d('0xdb')]+=0x1,'scheduledat':moment()[_0x250d('0xe4')](_0xabd813[_0x250d('0x18b')],_0x250d('0xe6'))['format'](_0x250d('0xe7')),'ContactId':_0x2a54e0['ContactId'],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0['VoiceQueueId']||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x18c')));}break;case 0xa:if(_0x2a54e0[_0x250d('0xdc')]>=_0xabd813['dialDropMaxRetry']-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countdropretry':_0x2a54e0[_0x250d('0xdc')]+=0x1,'scheduledat':moment()['add'](_0xabd813[_0x250d('0x10a')],_0x250d('0xe6'))['format'](_0x250d('0xe7')),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0[_0x250d('0xe9')]||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x18d')));}break;case 0xb:if(_0x2a54e0[_0x250d('0xdd')]>=_0xabd813[_0x250d('0x10f')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x2a54e0[_0x250d('0xdd')]+=0x1,'scheduledat':moment()[_0x250d('0xe4')](_0xabd813[_0x250d('0x18e')],_0x250d('0xe6'))[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0x2a54e0['ContactId'],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0['VoiceQueueId']||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x110')));}break;case 0x13:if(_0x2a54e0[_0x250d('0xd6')]>=_0xabd813[_0x250d('0xe2')]-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countmachineretry':_0x2a54e0[_0x250d('0xd6')]+=0x1,'scheduledat':moment()[_0x250d('0xe4')](_0xabd813[_0x250d('0xe5')],_0x250d('0xe6'))['format'](_0x250d('0xe7')),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0[_0x250d('0xe9')]||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x2a54e0[_0x250d('0xde')]>=_0xabd813[_0x250d('0x18f')]-0x1){return!![];}else{this[_0x250d('0xf0')]({'active':![],'countagentrejectretry':_0x2a54e0[_0x250d('0xde')]+=0x1,'scheduledat':moment()['add'](_0xabd813[_0x250d('0x190')],'minutes')[_0x250d('0x6e')](_0x250d('0xe7')),'ContactId':_0x2a54e0[_0x250d('0xe8')],'ListId':_0x2a54e0[_0x250d('0xc4')],'VoiceQueueId':_0x2a54e0[_0x250d('0xe9')]||undefined,'CampaignId':_0x2a54e0[_0x250d('0xea')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0x250d('0x15')][_0x250d('0x180')]=function(_0x4f0a84,_0x98fc0e,_0x2deb76){var _0x3ac9ec=this;var _0x207f80=new History(_0x4f0a84);return new BPromise(function(_0xba9a42,_0x396b7d){if(_[_0x250d('0x37')](_0x98fc0e)&&'object'!==typeof _0x98fc0e){return _0x396b7d(msgResponse(_0x250d('0x191'),'Failure',_0x250d('0x192')));}if(_[_0x250d('0x37')](_0x2deb76)&&'object'!==typeof _0x2deb76){return _0x396b7d(msgResponse(_0x250d('0x191'),_0x250d('0x130'),_0x250d('0x193')));}switch(_0x2deb76['reason']){case'0':_0x98fc0e[_0x250d('0x194')]+=0x1;_0x207f80[_0x250d('0x99')]=0x0;_0x207f80[_0x250d('0x9a')]='NoSuchNumber';_0x207f80[_0x250d('0xdb')]+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;ami[_0x250d('0x45')](_0x250d('0x195'),ut[_0x250d('0x196')](_0x4f0a84,'nosuchnumber'));_0x3ac9ec[_0x250d('0xbd')](_0x207f80)['catch'](loggerCatch(_0x250d('0x197')));if(_0x3ac9ec[_0x250d('0x198')](0x0,_0x4f0a84,_0x98fc0e)){if(_0x207f80[_0x250d('0xdb')]>=_0x98fc0e[_0x250d('0x199')]){_0x3ac9ec[_0x250d('0x19a')](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x19b'));}else{_0x3ac9ec[_0x250d('0xe0')](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x19b'));}}break;case'3':_0x98fc0e[_0x250d('0x5f')]+=0x1;_0x207f80[_0x250d('0x99')]=0x3;_0x207f80['statedesc']=_0x250d('0x19c');_0x207f80[_0x250d('0xda')]+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;ami[_0x250d('0x45')]('custom:agentnoanswer',ut['buildObj'](_0x4f0a84,_0x250d('0x19d')));_0x3ac9ec[_0x250d('0xbd')](_0x207f80)[_0x250d('0xa4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3ac9ec[_0x250d('0x198')](0x3,_0x4f0a84,_0x98fc0e)){if(_0x207f80[_0x250d('0xda')]>=_0x98fc0e[_0x250d('0x182')]){_0x3ac9ec[_0x250d('0x19a')](_0x207f80,_0xba9a42,_0x396b7d,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3ac9ec[_0x250d('0xe0')](_0x207f80,_0xba9a42,_0x396b7d,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x98fc0e['outboundBusyCallsDay']+=0x1;_0x207f80[_0x250d('0x99')]=0x5;_0x207f80['statedesc']='Busy';_0x207f80[_0x250d('0xd9')]+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;ami[_0x250d('0x45')](_0x250d('0x19e'),ut[_0x250d('0x196')](_0x4f0a84,_0x250d('0x19f')));_0x3ac9ec[_0x250d('0xbd')](_0x207f80)[_0x250d('0xa4')](loggerCatch(_0x250d('0x1a0')));if(_0x3ac9ec[_0x250d('0x198')](0x5,_0x4f0a84,_0x98fc0e)){if(_0x207f80[_0x250d('0xd9')]>=_0x98fc0e[_0x250d('0x185')]){_0x3ac9ec['createStateFinal'](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a1'));}else{_0x3ac9ec['stateGlobal'](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a1'));}}break;case'8':_0x98fc0e[_0x250d('0x5b')]+=0x1;_0x207f80[_0x250d('0x99')]=0x8;_0x207f80['statedesc']='Congestion';_0x207f80[_0x250d('0xef')]+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;ami[_0x250d('0x45')](_0x250d('0x1a2'),ut[_0x250d('0x196')](_0x4f0a84,_0x250d('0x1a3')));_0x3ac9ec[_0x250d('0xbd')](_0x207f80)[_0x250d('0xa4')](loggerCatch(_0x250d('0x1a4')));if(_0x3ac9ec['checkRetriveMax'](0x8,_0x4f0a84,_0x98fc0e)){if(_0x207f80['countcongestionretry']>=_0x98fc0e['dialCongestionMaxRetry']){_0x3ac9ec['createStateFinal'](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a5'));}else{_0x3ac9ec[_0x250d('0xe0')](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a5'));}}break;case'11':_0x98fc0e[_0x250d('0x1a6')]+=0x1;_0x207f80[_0x250d('0x99')]=0xb;_0x207f80[_0x250d('0x9a')]=_0x250d('0x111');_0x207f80['countabandonedretry']+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;_0x3ac9ec['createHistory'](_0x207f80)[_0x250d('0xa4')](loggerCatch(_0x250d('0x112')));if(_0x3ac9ec[_0x250d('0x198')](0xb,_0x4f0a84,_0x98fc0e)){if(_0x207f80[_0x250d('0xdd')]>=_0x98fc0e['dialAbandonedMaxRetry']){_0x3ac9ec[_0x250d('0x19a')](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a7'));}else{_0x3ac9ec['stateGlobal'](_0x207f80,_0xba9a42,_0x396b7d,_0x250d('0x1a7'));}}break;case'20':_0x98fc0e[_0x250d('0x1a8')]+=0x1;_0x207f80[_0x250d('0x99')]=0x14;_0x207f80['statedesc']=_0x250d('0x1a9');_0x207f80[_0x250d('0xde')]+=0x1;_0x207f80[_0x250d('0xd7')]+=0x1;ami['emit'](_0x250d('0x1aa'),ut[_0x250d('0x196')](_0x4f0a84,'agentreject'));_0x3ac9ec[_0x250d('0xbd')](_0x207f80)[_0x250d('0xa4')](loggerCatch(_0x250d('0x1ab')));if(_0x3ac9ec['checkRetriveMax'](0x14,_0x4f0a84,_0x98fc0e)){if(_0x207f80['countagentrejectretry']>=_0x98fc0e[_0x250d('0x18f')]){_0x3ac9ec['createStateFinal'](_0x207f80,_0xba9a42,_0x396b7d,'reason\x2020\x20agentreject');}else{_0x3ac9ec[_0x250d('0xe0')](_0x207f80,_0xba9a42,_0x396b7d,'reason\x2020\x20agentreject');}}break;default:_0x98fc0e[_0x250d('0x1ac')]+=0x1;_0x207f80[_0x250d('0x99')]=0xc;_0x207f80['statedesc']=_0x2deb76[_0x250d('0x1ad')];_0x3ac9ec[_0x250d('0xbd')](_0x207f80)[_0x250d('0xa4')](loggerCatch(_0x250d('0x1ae')));if(_0x3ac9ec['checkRetriveMax'](_0x2deb76['reason'],_0x4f0a84,_0x98fc0e)){if(_0x207f80['countbusyretry']+_0x207f80[_0x250d('0xef')]+_0x207f80[_0x250d('0xda')]+_0x207f80[_0x250d('0xdb')]+_0x207f80['countdropretry']+_0x207f80['countabandonedretry']+_0x207f80[_0x250d('0xd6')]+_0x207f80['countagentrejectretry']>=_0x98fc0e[_0x250d('0xdf')]){_0x3ac9ec[_0x250d('0xe0')](_0x207f80,_0xba9a42,_0x396b7d,_0x2deb76['reason']);}else{_0x3ac9ec[_0x250d('0x19a')](_0x207f80,_0xba9a42,_0x396b7d,_0x2deb76[_0x250d('0x1ad')]);}}}});};Dialer[_0x250d('0x15')][_0x250d('0xe0')]=function(_0xdd07d0,_0x286e39,_0x3555f9,_0x11cca9){var _0x2af909=new Final(_0xdd07d0);_0x2af909[_0x250d('0x99')]=0xf;_0x2af909['statedesc']=_0x250d('0x1af');this['createStateFinal'](_0x2af909,_0x286e39,_0x3555f9,_0x11cca9);};Dialer[_0x250d('0x15')][_0x250d('0x19a')]=function(_0x1c89cf,_0x1ab9f0,_0x455260,_0x40d99b){this[_0x250d('0xbc')](_0x1c89cf)[_0x250d('0xab')](function(_0x1ccf78){return _0x1ab9f0(msgResponse(_0x250d('0x191'),_0x250d('0xc8'),_0x40d99b));})[_0x250d('0xa4')](function(_0x15abcb){return _0x455260(msgResponse(_0x250d('0x1b0'),_0x250d('0x130'),'contact\x20not\x20moved'));});};Dialer[_0x250d('0x15')]['predictive']=function(_0x51f371){var _0x21de70=this;var _0x5c2827=_0x51f371[_0x250d('0x1b1')]/0x64;var _0x1c4c71=_0x51f371[_0x250d('0x5e')]/(_0x51f371[_0x250d('0x5e')]+_0x51f371['outboundAnswerCallsDay']);var _0x5799df=Math[_0x250d('0x1b2')](_0x51f371[_0x250d('0x1b3')]*(_0x51f371[_0x250d('0x1b4')]/0x64));var _0xc36a8c=Math[_0x250d('0x1b2')](_0x51f371['predictiveIntervalAvailable']*(_0x51f371[_0x250d('0x1b5')]/0x64));var _0xb514e0=_0x51f371['available']+_0x51f371[_0x250d('0x4d')];var _0x1f91c9=Math[_0x250d('0x1b6')](_0x51f371['erlangCalls']*_0x51f371[_0x250d('0x68')]*_0x51f371[_0x250d('0x1b7')]*_0x51f371[_0x250d('0x1b8')]);if(_[_0x250d('0x37')](_0x51f371[_0x250d('0x22')])){if(!_[_0x250d('0x37')](_0x51f371[_0x250d('0x21')])){_0x51f371[_0x250d('0x21')]=undefined;loggerPredictive['error'](_0x250d('0x1b9'),_0x250d('0x1ba'));}if(!_['isUndefined'](_0x51f371['handlePredictive'])){loggerPredictive[_0x250d('0x87')](_0x250d('0x1b9'),_0x250d('0x1bb'));clearInterval(_0x51f371[_0x250d('0x82')]);_0x51f371[_0x250d('0x82')]=undefined;}_0x51f371[_0x250d('0x22')]=moment()[_0x250d('0x6e')](_0x250d('0xe7'));loggerPredictive['info'](_0x51f371[_0x250d('0x3a')],'collection\x20data\x20in\x20progressive\x20at',_0x51f371[_0x250d('0x22')]);this[_0x250d('0x143')](_0x51f371,0x1);}else if(ifInterval(_0x51f371[_0x250d('0x1bc')],_0x51f371[_0x250d('0x22')])){this['handlePower'](_0x51f371,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x51f371[_0x250d('0x22')],_0x51f371['name']);_0x51f371[_0x250d('0x7c')]=0x0;_0x51f371[_0x250d('0x105')]=0x0;}else if(_0x5c2827<_0x1c4c71&&_0x51f371[_0x250d('0x1bd')]===_0x250d('0x1be')){freeVariablesPredictive(_0x51f371);loggerPredictive[_0x250d('0x73')](_0x250d('0x1bf'),_0x250d('0x1c0'),_0x1c4c71,_0x250d('0x22'),_0x51f371[_0x250d('0x3a')]);}else if(_0x1f91c9<_0x51f371[_0x250d('0x105')]&&_0x51f371[_0x250d('0x1bd')]===_0x250d('0x1be')){freeVariablesPredictive(_0x51f371);loggerPredictive[_0x250d('0x73')](_0x250d('0x1c1'),_0x250d('0x1c2'),_0x1f91c9,'Drop\x20in\x20this\x20interval',_0x51f371[_0x250d('0x105')],_0x250d('0x22'),_0x51f371[_0x250d('0x3a')]);}else if(!ifInterval(_0x51f371[_0x250d('0x1bc')],_0x51f371['startProgressive'])&&_[_0x250d('0x37')](_0x51f371['startPredictive'])&&!_[_0x250d('0x37')](_0x51f371[_0x250d('0x22')])){_0x51f371[_0x250d('0x21')]=moment()[_0x250d('0x6e')](_0x250d('0xe7'));loggerPredictive['info'](_0x51f371[_0x250d('0x3a')],_0x250d('0x1c3'),_0x51f371['startPredictive']);this['averageHandleTime'](_0x51f371[_0x250d('0x1bc')])[_0x250d('0xab')](this[_0x250d('0x1c4')](_0x51f371))[_0x250d('0xab')](mergeDataErlangB(_0x51f371))[_0x250d('0xab')](this[_0x250d('0x1c5')](_0x51f371))[_0x250d('0xa4')](loggerCatchPredictive(_0x250d('0x1c6'),_0x51f371));}else if(!ifInterval(_0x51f371[_0x250d('0x1bc')],_0x51f371[_0x250d('0x21')])){_0x51f371['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x51f371['startPredictive']=moment()['format'](_0x250d('0xe7'));loggerPredictive[_0x250d('0x73')](_0x51f371[_0x250d('0x3a')],'recalculate\x20predictive\x20at',_0x51f371[_0x250d('0x21')]);clearInterval(_0x51f371['handlePredictive']);_0x51f371[_0x250d('0x82')]=undefined;this[_0x250d('0x1c7')](_0x51f371['dialPredictiveInterval'])[_0x250d('0xab')](this[_0x250d('0x1c4')](_0x51f371))['then'](mergeDataErlangB(_0x51f371))[_0x250d('0xab')](this[_0x250d('0x1c5')](_0x51f371))['catch'](loggerCatchPredictive(_0x250d('0x1c8'),_0x51f371));}else if(_0x51f371[_0x250d('0x1b3')]&&_0xb514e0<_0x51f371[_0x250d('0x1b3')]-_0xc36a8c){freeVariablesPredictive(_0x51f371);loggerPredictive['info'](_0x51f371[_0x250d('0x3a')],_0x250d('0x1c9'),_0xb514e0,_0x250d('0x1ca'),_0x51f371[_0x250d('0x1b3')],'-',_0xc36a8c,'=',_0x51f371['predictiveIntervalAvailable']-_0xc36a8c,')');}else if(_0x51f371[_0x250d('0x1b3')]&&_0xb514e0>_0x51f371[_0x250d('0x1b3')]+_0x5799df){freeVariablesPredictive(_0x51f371);loggerPredictive['info'](_0x51f371[_0x250d('0x3a')],_0x250d('0x1c9'),_0xb514e0,_0x250d('0x1cb'),_0x51f371[_0x250d('0x1b3')],'+',_0x5799df,'=',_0x51f371[_0x250d('0x1b3')]+_0x5799df,')');}};Dialer[_0x250d('0x15')]['getDataPredictive']=function(_0x469b8f){var _0x3ea3d4=this;return function(_0x28f8fc){return new BPromise(function(_0x467091,_0x131e8d){_['merge'](_0x469b8f,_0x28f8fc[0x0]);if(checkGetDataPredictive(_0x28f8fc[0x0])){var _0x3910ab=_0x469b8f['predictiveIntervalAvailable']=_0x469b8f[_0x250d('0x4d')]+_0x469b8f[_0x250d('0x49')];var _0x48f2f2=_0x469b8f[_0x250d('0x1bc')]*0x3c;var _0x2b48ca=_0x28f8fc[0x0][_0x250d('0x63')]+_0x28f8fc[0x0][_0x250d('0x62')];var _0x3a5396=(_0x28f8fc[0x0][_0x250d('0x61')]+_0x28f8fc[0x0][_0x250d('0x65')]+_0x28f8fc[0x0][_0x250d('0x64')])/_0x28f8fc[0x0]['predictiveIntervalTotalCalls'];_0x469b8f[_0x250d('0x1b7')]=_0x3a5396>0x0?_0x3a5396:0x1;switch(_0x469b8f[_0x250d('0x1bd')]){case _0x250d('0x1be'):var _0x381507=_0x469b8f['dialPredictiveOptimizationPercentage']/0x64;return _0x3ea3d4[_0x250d('0x1cc')](_0x3910ab,_0x48f2f2,_0x2b48ca,_0x3a5396,_0x381507)[_0x250d('0xab')](function(_0xecd6d7){return _0x467091(_0xecd6d7);});case _0x250d('0x1cd'):var _0x58f82a=_0x469b8f[_0x250d('0x1b1')]/0x64;return _0x3ea3d4['busyFactor'](_0x3910ab,_0x48f2f2,_0x2b48ca,_0x3a5396,_0x58f82a)[_0x250d('0xab')](function(_0x354d8a){return _0x467091(_0x354d8a);});default:return _0x131e8d(msgResponse(_0x250d('0x1ce'),_0x250d('0x130'),'Unknown\x20Predictive'));}}else{return _0x131e8d(msgResponse(_0x250d('0x1ce'),_0x250d('0x130'),_0x250d('0x1cf')));}});};};Dialer[_0x250d('0x15')][_0x250d('0x1d0')]=function(_0x1e9b6d){var _0x5246d6=this;return function(_0x57d567){return new BPromise(function(_0x5c26fd,_0x47028f){_[_0x250d('0x1d1')](_0x1e9b6d,_0x57d567[0x0]);if(checkGetDataPredictive(_0x57d567[0x0])){loggerPredictive[_0x250d('0x73')](JSON[_0x250d('0x41')](_0x57d567[0x0]));if(_0x1e9b6d[_0x250d('0x1bd')]===_0x250d('0x1be')){return _0x5246d6[_0x250d('0xba')](_0x1e9b6d['id'])['then'](function(_0x337e0a){var _0x56bbec=_0x1e9b6d[_0x250d('0x4a')]-_0x337e0a[0x0][_0x250d('0x1d2')];var _0x4cb01e=_0x1e9b6d[_0x250d('0x1bc')]*0x3c;var _0x255340=_0x57d567[0x0][_0x250d('0x63')]+_0x57d567[0x0][_0x250d('0x62')];var _0x52b724=(_0x57d567[0x0][_0x250d('0x61')]+_0x57d567[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x57d567[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57d567[0x0][_0x250d('0x67')];var _0x1cca98=_0x1e9b6d[_0x250d('0x1b1')]/0x64;_0x1e9b6d[_0x250d('0x1d3')]=_0x337e0a[0x0][_0x250d('0x1d2')]||0x0;_0x1e9b6d[_0x250d('0x1b7')]=_0x52b724>0x0?_0x52b724:0x1;return _0x5246d6[_0x250d('0x1cc')](_0x56bbec,_0x4cb01e,_0x255340,_0x52b724,_0x1cca98);})[_0x250d('0xab')](function(_0x1372ab){return _0x5c26fd(_0x1372ab);})['catch'](function(_0xc13307){return _0x47028f(msgResponse(_0x250d('0x1d4'),_0x250d('0x130'),JSON[_0x250d('0x41')](_0xc13307)));});}if(_0x1e9b6d[_0x250d('0x1bd')]===_0x250d('0x1cd')){return _0x5246d6[_0x250d('0xba')](_0x1e9b6d['id'])[_0x250d('0xab')](function(_0x3b8e69){var _0x2811ab=_0x1e9b6d[_0x250d('0x4a')]-_0x3b8e69[0x0][_0x250d('0x1d2')];var _0x4d61e6=_0x1e9b6d['dialPredictiveInterval']*0x3c;var _0xab1df7=_0x57d567[0x0]['predictiveIntervalAvgTalktime']+_0x57d567[0x0][_0x250d('0x62')];var _0x42648d=(_0x57d567[0x0][_0x250d('0x61')]+_0x57d567[0x0][_0x250d('0x65')]+_0x57d567[0x0][_0x250d('0x64')])/_0x57d567[0x0][_0x250d('0x67')];var _0x3cf720=_0x1e9b6d[_0x250d('0x1b1')]/0x64;_0x1e9b6d[_0x250d('0x1d3')]=_0x3b8e69[0x0]['outboundQueuePauses']||0x0;_0x1e9b6d[_0x250d('0x1b7')]=_0x42648d>0x0?_0x42648d:0x1;return _0x5246d6['busyFactor'](_0x2811ab,_0x4d61e6,_0xab1df7,_0x42648d,_0x3cf720);})[_0x250d('0xab')](function(_0x384bb9){return _0x5c26fd(_0x384bb9);})[_0x250d('0xa4')](function(_0x22d4d4){return _0x47028f(msgResponse(_0x250d('0x1d4'),_0x250d('0x130'),JSON[_0x250d('0x41')](_0x22d4d4)));});}}else{return _0x47028f(msgResponse(_0x250d('0x1ce'),_0x250d('0x130'),'check\x20failure'));}});};};Dialer[_0x250d('0x15')]['startMethodPredictive']=function(_0x52b088){var _0x1b4458=this;return function(){var _0x39b872=0x0;var _0x44110e=Math[_0x250d('0x1b6')](_0x52b088[_0x250d('0x1d5')]*0x3e8);if(_0x44110e>0x0){_0x44110e=_0x44110e<0x64?0x64:_0x44110e;loggerPredictive[_0x250d('0x73')](_0x52b088['name'],_0x250d('0x1d6'),_0x44110e,_0x250d('0x42'));_0x52b088[_0x250d('0x82')]=setInterval(function(){_0x1b4458[_0x250d('0x82')](_0x52b088);loggerPredictiveCalls[_0x250d('0x73')](_0x250d('0x1d7'),_0x39b872+=0x1);},_0x44110e);}else{loggerPredictive[_0x250d('0x73')](_0x52b088[_0x250d('0x3a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x250d('0x15')]['checkContactBlack']=function(_0x1e6826,_0x408421){var _0x3b2dac=this;return function(_0x28b3c9){if(_['isEmpty'](_0x28b3c9)){if(_['isNil'](_0x408421['UserId'])||!_0x408421['recallme']){if(_0x1e6826[_0x250d('0x54')]===_0x250d('0x7')){_0x1e6826[_0x250d('0x11a')]=_[_0x250d('0x37')](_0x1e6826['queueStatusComplete'])?!![]:_0x1e6826['queueStatusComplete'];var _0x97de62=uuid['v4']();_0x3b2dac[_0x250d('0x1e')][_0x97de62]=new Action(_0x1e6826,_0x408421,_0x97de62);loggerBooked[_0x250d('0x73')](_0x250d('0x1d8'),_0x97de62,_0x250d('0x1d9'),JSON[_0x250d('0x41')](_0x1e6826['queueStatusComplete']),_0x250d('0x1da'),_0x1e6826[_0x250d('0x3a')]);if(_0x1e6826['queueStatusComplete']){_0x1e6826[_0x250d('0x11a')]=![];_0x3b2dac[_0x250d('0x24')][_0x3b2dac[_0x250d('0x1e')][_0x97de62][_0x250d('0xa6')]]=[];ami[_0x250d('0xa1')]({'actionid':_0x97de62,'action':_0x250d('0x1db'),'queue':_0x1e6826[_0x250d('0x3a')]})[_0x250d('0xa4')](function(_0x5450ae){_0x3b2dac[_0x250d('0xa8')](_0x1e6826);_0x3b2dac[_0x250d('0xf0')]({'active':![],'ContactId':_0x3b2dac[_0x250d('0x1e')][_0x97de62][_0x250d('0xe8')],'ListId':_0x3b2dac[_0x250d('0x1e')][_0x97de62][_0x250d('0xc4')],'VoiceQueueId':_0x3b2dac[_0x250d('0x1e')][_0x97de62]['VoiceQueueId']||undefined,'CampaignId':_0x3b2dac[_0x250d('0x1e')][_0x97de62]['CampaignId']||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x1dc')));delete _0x3b2dac[_0x250d('0x1e')][_0x97de62];});}else{loggerBooked[_0x250d('0x73')](_0x250d('0x1dd'),JSON[_0x250d('0x41')](_0x1e6826[_0x250d('0x11a')]),_0x250d('0x1da'),_0x1e6826[_0x250d('0x3a')]);_0x3b2dac[_0x250d('0xa8')](_0x1e6826);_0x3b2dac[_0x250d('0xf0')]({'active':![],'ContactId':_0x3b2dac['actions'][_0x97de62][_0x250d('0xe8')],'ListId':_0x3b2dac[_0x250d('0x1e')][_0x97de62][_0x250d('0xc4')],'VoiceQueueId':_0x3b2dac[_0x250d('0x1e')][_0x97de62][_0x250d('0xe9')]||undefined,'CampaignId':_0x3b2dac[_0x250d('0x1e')][_0x97de62]['CampaignId']||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x1dc')));delete _0x3b2dac['actions'][_0x97de62];}}else{return _0x3b2dac[_0x250d('0x1de')](_0x1e6826,_0x408421);}}else{if(getDiff(_0x408421['scheduledat'])<_0x1e6826[_0x250d('0x1df')]*0x3c){if(_0x408421[_0x250d('0x1e0')]&&!_0x408421[_0x250d('0x1e0')][_0x250d('0x1e1')]){_0x3b2dac[_0x250d('0x17')][_0x250d('0x11b')](_0x408421['id'])[_0x250d('0x1e2')](function(){_0x3b2dac['updateOriginated'](_0x1e6826);});}else{_0x3b2dac[_0x250d('0xb5')]({'active':![]},_0x408421['id'],0x1)[_0x250d('0x1e2')](function(){console['log'](_0x250d('0x1e3'));_0x3b2dac[_0x250d('0xa8')](_0x1e6826);});}}else{_0x1e6826[_0x250d('0x1e4')]+=0x1;_0x3b2dac[_0x250d('0xa8')](_0x1e6826);if(_0x1e6826[_0x250d('0x1e5')]){_0x3b2dac[_0x250d('0xf0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x408421[_0x250d('0xe8')],'ListId':_0x408421[_0x250d('0xc4')],'VoiceQueueId':_0x408421[_0x250d('0xe9')]||undefined,'CampaignId':_0x408421[_0x250d('0xea')]||undefined})[_0x250d('0xa4')](loggerCatch(_0x250d('0x1e6')));_0x3b2dac['createHistory'](createObjHistory(_0x1e6826,_0x408421,_0x250d('0x1e7'),0x17,_0x250d('0x1e8')))[_0x250d('0xa4')](loggerCatch(_0x250d('0x1e9')));}else{_0x3b2dac['saveInDb'](createObjHistory(_0x1e6826,_0x408421,_0x250d('0x1ea'),0x16,_0x250d('0x1eb')),'[Originate][HistoryRecallClose][historyCatch]',_0x250d('0x1ec'));}}}}else{_0x1e6826[_0x250d('0x1ed')]+=0x1;_0x3b2dac['saveInDb'](createObjHistory(_0x1e6826,_0x408421,_0x250d('0x1ee'),0xd,_0x250d('0x1ef')),_0x250d('0x1f0'),'[Originate][MoveBlacklist]');throw _0x250d('0x1f1');}};};Dialer[_0x250d('0x15')]['handleIvr']=function(_0x4768ba){var _0x240b65=this;var _0x476002=[];var _0x1d18de=_0x4768ba[_0x250d('0x1f2')]-_0x4768ba[_0x250d('0x8b')]-_0x4768ba[_0x250d('0x1f3')];emitCampaignSummary(_0x4768ba);if(_0x1d18de>0x0){if(_0x1d18de>this[_0x250d('0x1c')]){_0x1d18de=this[_0x250d('0x1c')];}_0x4768ba['temp']+=_0x1d18de;this[_0x250d('0xb9')](_0x4768ba['id'],_0x1d18de,_0x4768ba['dialOrderByScheduledAt'])[_0x250d('0xab')](function(_0x2935ea){_0x4768ba[_0x250d('0x1f3')]-=_0x1d18de;_0x4768ba[_0x250d('0x1f3')]=_0x4768ba[_0x250d('0x1f3')]>0x0?_0x4768ba['temp']:0x0;if(!checkContactEmpty(_0x2935ea)){_0x4768ba[_0x250d('0x38')]=_0x250d('0x91');logger[_0x250d('0x73')](_0x250d('0x1f4')+_0x4768ba[_0x250d('0x3a')]);}else{_0x4768ba[_0x250d('0x8b')]+=_0x2935ea[_0x250d('0x11f')];_0x4768ba[_0x250d('0x38')]=_0x250d('0x1f5');for(var _0x548a47=0x0;_0x548a47<_0x2935ea['length'];_0x548a47+=0x1){_0x4768ba[_0x250d('0x1f6')]+=0x1;if(_[_0x250d('0xa0')](_0x2935ea[_0x548a47])||_[_0x250d('0xa0')](_0x2935ea[_0x548a47]['Contact'])||_[_0x250d('0xa0')](_0x2935ea[_0x548a47]['Contact'][_0x250d('0x155')])){_0x240b65[_0x250d('0xc1')](_0x250d('0x1f7'),_0x4768ba,_0x2935ea[_0x548a47]);}else{_0x240b65[_0x250d('0xb0')](_[_0x250d('0xc3')](_0x2935ea[_0x548a47],[_0x250d('0xea'),_0x250d('0x1f8')]))[_0x250d('0xab')](_0x240b65[_0x250d('0x1f9')](_0x4768ba,_0x2935ea[_0x548a47]))[_0x250d('0xa4')](_0x240b65['loggerHandler']('[actionOriginateIvr]\x20',_0x4768ba));}}}})['catch'](loggerGetContactDialer(_0x250d('0x1fa'),_0x4768ba,_0x1d18de));}};Dialer[_0x250d('0x15')]['handlePower']=function(_0xa3e52e,_0xc44a5b){var _0xf93a28=this;var _0x49be67=[];var _0x1fcbec=_0xc44a5b>=0x1?_0xc44a5b:0x1;var _0x4538d8=[];if(_0xa3e52e[_0x250d('0x54')]===_0x250d('0x7')){_0x1fcbec=0x1;}var _0x54a28b=Math[_0x250d('0x1b6')](_0xa3e52e[_0x250d('0x49')]*_0x1fcbec)-_0xa3e52e[_0x250d('0x8b')]-_0xa3e52e[_0x250d('0x1f3')];emitVoiceQueueSummary(_0xa3e52e);if(_0xa3e52e[_0x250d('0x1fb')]>0x0){var _0x1a8e80=_0xa3e52e['dialLimitQueue']-_0xa3e52e[_0x250d('0x8b')]-_0xa3e52e['talking']-_0xa3e52e['temp']-_0xa3e52e['pTalking'];if(_0x54a28b>_0x1a8e80){_0x54a28b=_0x1a8e80;}}if(_0x54a28b>0x0){if(_0xa3e52e[_0x250d('0x54')]===_0x250d('0x7')){_0x54a28b=0x1;}if(_0x54a28b>this[_0x250d('0x1c')]){_0x54a28b=this[_0x250d('0x1c')];}_0xa3e52e['temp']+=_0x54a28b;for(var _0x113239 in this[_0x250d('0x1a')]){if(this['agents']['hasOwnProperty'](_0x113239)){if(this['agents'][_0x113239][_0x250d('0x99')]===_0x250d('0x1fc')&&this[_0x250d('0x1a')][_0x113239][_0x250d('0xa2')]===_0x250d('0xca')){_0x49be67['push'](this['agents'][_0x113239]['id']);}}}this[_0x250d('0xb7')](_0xa3e52e['id'],_0x49be67,_0x54a28b,_0xa3e52e[_0x250d('0x1fd')])[_0x250d('0xab')](function(_0x111baf){_0xa3e52e[_0x250d('0x1f3')]-=_0x54a28b;_0xa3e52e[_0x250d('0x1f3')]=_0xa3e52e['temp']>0x0?_0xa3e52e[_0x250d('0x1f3')]:0x0;if(!checkContactEmpty(_0x111baf)){_0xf93a28['countReScheduled'](_0xa3e52e)[_0x250d('0xab')](sendMessageReschedule(_0xa3e52e))[_0x250d('0xa4')](loggerCatch(_0x250d('0xad')));}else{_0xa3e52e['originated']+=_0x111baf[_0x250d('0x11f')];_0xa3e52e[_0x250d('0x38')]=_0xa3e52e['dialMethod']===_0x250d('0x7')?_0x250d('0x15c'):_0x250d('0x1f5');for(var _0x3f2b8d=0x0;_0x3f2b8d<_0x111baf[_0x250d('0x11f')];_0x3f2b8d+=0x1){if(_[_0x250d('0xa0')](_0x111baf[_0x3f2b8d])||_[_0x250d('0xa0')](_0x111baf[_0x3f2b8d][_0x250d('0x154')])||_[_0x250d('0xa0')](_0x111baf[_0x3f2b8d][_0x250d('0x154')][_0x250d('0x155')])){_0xf93a28[_0x250d('0xc1')](_0x250d('0x1f7'),_0xa3e52e,_0x111baf[_0x3f2b8d]);}else{_0xf93a28[_0x250d('0xae')](_[_0x250d('0xc3')](_0x111baf[_0x3f2b8d],[_0x250d('0xe9'),_0x250d('0x1f8')]))[_0x250d('0xab')](_0xf93a28[_0x250d('0x1f9')](_0xa3e52e,_0x111baf[_0x3f2b8d]))[_0x250d('0xa4')](_0xf93a28[_0x250d('0x1fe')](_0x250d('0x1f7'),_0xa3e52e));}}}})[_0x250d('0xa4')](loggerGetContactDialer('[getContactDialer2]',_0xa3e52e,_0x54a28b));}};Dialer[_0x250d('0x15')][_0x250d('0x82')]=function(_0x38df57){var _0x3b5c27=this;if(_0x38df57[_0x250d('0x1fb')]>0x0){var _0x53b822=_0x38df57[_0x250d('0x1fb')]-_0x38df57[_0x250d('0x8b')]-_0x38df57['talking'];if(_0x53b822>0x0){this[_0x250d('0x1ff')](_0x38df57);}else{loggerPredictiveCalls['info'](_0x250d('0x200'));}}else{this[_0x250d('0x1ff')](_0x38df57);}};Dialer[_0x250d('0x15')][_0x250d('0x1ff')]=function(_0x16505d){var _0x13b210=this;var _0x5db0a5=[];_0x16505d['originated']+=0x1;for(var _0x4c0a77 in this[_0x250d('0x1a')]){if(this[_0x250d('0x1a')][_0x250d('0x8a')](_0x4c0a77)){if(this[_0x250d('0x1a')][_0x4c0a77][_0x250d('0x99')]===_0x250d('0x1fc')&&this[_0x250d('0x1a')][_0x4c0a77]['status']===_0x250d('0xca')){_0x5db0a5[_0x250d('0x118')](this['agents'][_0x4c0a77]['id']);}}}this['getContactDialer'](_0x16505d['id'],_0x5db0a5,0x1,_0x16505d[_0x250d('0x1fd')])[_0x250d('0xab')](function(_0x2227db){if(!checkContactEmpty(_0x2227db)){checkContactLowerLimitOriginate(_0x16505d,0x1,0x0);_0x13b210[_0x250d('0xac')](_0x16505d)[_0x250d('0xab')](sendMessageReschedule(_0x16505d))[_0x250d('0xa4')](loggerCatch(_0x250d('0xad')));}else{_0x16505d[_0x250d('0x38')]=_0x250d('0x1f5');if(_['isNil'](_0x2227db[0x0])||_['isNil'](_0x2227db[0x0][_0x250d('0x154')])||_[_0x250d('0xa0')](_0x2227db[0x0][_0x250d('0x154')]['phone'])){_0x13b210[_0x250d('0xc1')]('[actionOriginate]\x20',_0x16505d,_0x2227db[0x0]);}else{_0x13b210[_0x250d('0xae')](_[_0x250d('0xc3')](_0x2227db[0x0],[_0x250d('0xe9'),'Contact.phone']))[_0x250d('0xab')](_0x13b210[_0x250d('0x1f9')](_0x16505d,_0x2227db[0x0]))[_0x250d('0xa4')](_0x13b210[_0x250d('0x1fe')]('[actionOriginatePredictive]\x20',_0x16505d));}}})['catch'](loggerGetContactDialer(_0x250d('0x201'),_0x16505d,0x1));emitVoiceQueueSummary(_0x16505d);};Dialer[_0x250d('0x15')][_0x250d('0x1cc')]=function(_0x3fbecd,_0x45043d,_0x23d5c9,_0x87e427,_0x2ba8f6,_0x200d76){loggerPredictive[_0x250d('0x73')](_0x250d('0x202'));loggerPredictive[_0x250d('0x73')](_0x250d('0x203'),_0x3fbecd);loggerPredictive[_0x250d('0x73')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45043d);loggerPredictive['info'](_0x250d('0x204'),_0x23d5c9);loggerPredictive[_0x250d('0x73')](_0x250d('0x205'),_0x87e427);loggerPredictive[_0x250d('0x73')](_0x250d('0x206'),_0x2ba8f6);loggerPredictive[_0x250d('0x73')]('---------------------------');return new BPromise(function(_0x2b77d6,_0x48e59e){if(_0x3fbecd<=0x0||isNaN(_0x3fbecd)){return _0x48e59e(msgResponse(_0x250d('0x207'),_0x250d('0x17c'),'m\x20=\x20'+_0x3fbecd));}if(_0x23d5c9<=0x0||isNaN(_0x23d5c9)){return _0x48e59e(msgResponse(_0x250d('0x207'),'Error',_0x250d('0x208')+_0x23d5c9));}if(_0x87e427<=0x0||isNaN(_0x87e427)){return _0x48e59e(msgResponse(_0x250d('0x207'),_0x250d('0x17c'),'p\x20=\x20'+_0x87e427));}if(_0x45043d<=0x0||isNaN(_0x45043d)){return _0x48e59e(msgResponse(_0x250d('0x207'),_0x250d('0x17c'),_0x250d('0x209')+_0x45043d));}if(_0x2ba8f6<=0x0||isNaN(_0x2ba8f6)){return _0x48e59e(msgResponse(_0x250d('0x207'),'Error',_0x250d('0x20a')+_0x2ba8f6));}_0x200d76=_0x200d76||0x0;var _0x5bb5b6=0x1/_0x23d5c9;var _0xb9cb43=0x0;var _0x3a322e=0x0;var _0x145d97=0x0;var _0x23bd2b=0x0;for(var _0x2b498f=0x0;_0x145d97<_0x2ba8f6;_0x2b498f+=0x1){_0x3a322e=_0x2b498f/_0x45043d;_0xb9cb43=(_0x87e427*_0x3a322e+_0x200d76)/_0x5bb5b6;_0x145d97=erlangb(_0xb9cb43,_0x3fbecd);_0x23bd2b=_0xb9cb43/_0x3fbecd*(0x1-erlangb(_0xb9cb43,_0x3fbecd));}return _0x2b77d6({'erlangCalls':_0x2b498f,'erlangCallToSecond':_0x45043d/_0x2b498f,'erlangAbandonmentRate':_0x145d97,'erlangBusyFactor':_0x23bd2b});});};Dialer[_0x250d('0x15')]['busyFactor']=function(_0x19a6d1,_0x40d41b,_0x5574ef,_0x50fc5b,_0xa92cf,_0x2cfc47){loggerPredictive[_0x250d('0x73')](_0x250d('0x20b'));loggerPredictive[_0x250d('0x73')]('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',_0x19a6d1);loggerPredictive['info'](_0x250d('0x20c'),_0x40d41b);loggerPredictive[_0x250d('0x73')]('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',_0x5574ef);loggerPredictive['info'](_0x250d('0x205'),_0x50fc5b);loggerPredictive[_0x250d('0x73')](_0x250d('0x20d'),_0xa92cf);loggerPredictive[_0x250d('0x73')](_0x250d('0x79'));return new BPromise(function(_0x14d264,_0x2755e7){if(_0x19a6d1<=0x0||isNaN(_0x19a6d1)){return _0x2755e7(msgResponse(_0x250d('0x20e'),_0x250d('0x17c'),_0x250d('0x20f')+_0x19a6d1));}if(_0x5574ef<=0x0||isNaN(_0x5574ef)){return _0x2755e7(msgResponse(_0x250d('0x20e'),_0x250d('0x17c'),_0x250d('0x208')+_0x5574ef));}if(_0x50fc5b<=0x0||isNaN(_0x50fc5b)){return _0x2755e7(msgResponse(_0x250d('0x20e'),'Error','p\x20=\x20'+_0x50fc5b));}if(_0x40d41b<=0x0||isNaN(_0x40d41b)){return _0x2755e7(msgResponse(_0x250d('0x20e'),_0x250d('0x17c'),_0x250d('0x209')+_0x40d41b));}if(_0xa92cf<=0x0||isNaN(_0xa92cf)){return _0x2755e7(msgResponse('[busyFactor]',_0x250d('0x17c'),_0x250d('0x210')+_0xa92cf));}_0x2cfc47=_0x2cfc47||0x0;var _0x3577bd=0x1/_0x5574ef;var _0x45976d=0x0;var _0x2b70b1=0x0;var _0x4fe315=0x0;var _0x4c726d=0x0;for(var _0x4a4e10=0x0;_0x4c726d<_0xa92cf;_0x4a4e10+=0x1){_0x2b70b1=_0x4a4e10/_0x40d41b;_0x45976d=(_0x50fc5b*_0x2b70b1+_0x2cfc47)/_0x3577bd;_0x4fe315=erlangb(_0x45976d,_0x19a6d1);_0x4c726d=_0x45976d/_0x19a6d1*(0x1-erlangb(_0x45976d,_0x19a6d1));}return _0x14d264({'erlangCalls':_0x4a4e10,'erlangCallToSecond':_0x40d41b/_0x4a4e10,'erlangAbandonmentRate':_0x4fe315,'erlangBusyFactor':_0x4c726d});});};module[_0x250d('0x211')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5c08b9c..7df6fa5 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 _0x9812=['scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds'];(function(_0xe22b04,_0x5f3a77){var _0x2ebd8d=function(_0x2572fe){while(--_0x2572fe){_0xe22b04['push'](_0xe22b04['shift']());}};_0x2ebd8d(++_0x5f3a77);}(_0x9812,0x1b4));var _0x2981=function(_0x350945,_0xfffbfa){_0x350945=_0x350945-0x0;var _0x1c72d7=_0x9812[_0x350945];return _0x1c72d7;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2981('0x0'));function getSeconds(_0x24e57c,_0x25aeb2){var _0xf92a5b=moment(_0x24e57c)[_0x2981('0x1')](0x0);var _0x488dbc=moment(_0x25aeb2)[_0x2981('0x1')](0x0);return _0xf92a5b[_0x2981('0x2')](_0x488dbc,_0x2981('0x3'));}function QueueCallerAbandon(_0x54218c,_0x2b90aa){this[_0x2981('0x4')]=_0x54218c['scheduledat'];this[_0x2981('0x5')]=_0x54218c[_0x2981('0x5')];this[_0x2981('0x6')]=_0x54218c[_0x2981('0x5')]===_0x2981('0x7')?_0x2981('0x8'):_0x54218c[_0x2981('0x5')];this['countbusyretry']=_0x54218c['countbusyretry'];this[_0x2981('0x9')]=_0x54218c[_0x2981('0x9')];this['countnoanswerretry']=_0x54218c['countnoanswerretry'];this[_0x2981('0xa')]=_0x54218c['countbusyretry']+_0x54218c[_0x2981('0x9')]+_0x54218c[_0x2981('0xb')]+_0x54218c[_0x2981('0xc')]+_0x54218c[_0x2981('0xd')]+_0x54218c['countabandonedretry']+_0x54218c[_0x2981('0xe')]+_0x54218c[_0x2981('0xf')];this[_0x2981('0xc')]=_0x54218c[_0x2981('0xc')];this[_0x2981('0xd')]=_0x54218c[_0x2981('0xd')];this['countabandonedretry']=_0x54218c[_0x2981('0x10')];this[_0x2981('0xe')]=_0x54218c[_0x2981('0xe')];this[_0x2981('0xf')]=_0x54218c['countagentrejectretry'];this[_0x2981('0x11')]=_0x2b90aa['uniqueid'];this['calleridname']=_0x54218c['name'];this['calleridnum']=_0x54218c['number'];this[_0x2981('0x12')]=_0x54218c['starttime'];this[_0x2981('0x13')]=_0x54218c[_0x2981('0x13')];this[_0x2981('0x14')]=_0x54218c[_0x2981('0x14')];this[_0x2981('0x15')]=this[_0x2981('0x14')];this[_0x2981('0x16')]=getSeconds(_0x54218c[_0x2981('0x13')],_0x54218c[_0x2981('0x12')]);this[_0x2981('0x17')]=getSeconds(this[_0x2981('0x14')],_0x54218c[_0x2981('0x13')]);this[_0x2981('0x18')]=0x0;this[_0x2981('0x8')]=_0x2b90aa[_0x2981('0x8')];this[_0x2981('0x19')]=_0x2b90aa[_0x2981('0x1a')];this[_0x2981('0x1b')]=_0x2b90aa[_0x2981('0x1b')];this[_0x2981('0x1c')]=_0x54218c[_0x2981('0x1c')];this[_0x2981('0x1d')]=_0x54218c[_0x2981('0x1d')];this[_0x2981('0x1e')]=_0x54218c[_0x2981('0x1e')];this['recallme']=_0x54218c[_0x2981('0x1f')];this['ContactId']=_0x54218c[_0x2981('0x20')];this[_0x2981('0x21')]=_0x54218c[_0x2981('0x21')];this[_0x2981('0x22')]=_0x54218c[_0x2981('0x22')];this['VoiceQueueId']=_0x54218c[_0x2981('0x23')];this[_0x2981('0x24')]=_0x54218c[_0x2981('0x24')];this[_0x2981('0x25')]=_0x54218c['originatecalleridnum']||'';this[_0x2981('0x26')]=_0x54218c[_0x2981('0x26')]||'';}module[_0x2981('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x2d23=['lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','droptime','endtime','ringtime','responsetime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x4fff7b,_0x43d15c){var _0x52b1b2=function(_0x1fd726){while(--_0x1fd726){_0x4fff7b['push'](_0x4fff7b['shift']());}};_0x52b1b2(++_0x43d15c);}(_0x2d23,0xcc));var _0x32d2=function(_0x1969f1,_0x33c13c){_0x1969f1=_0x1969f1-0x0;var _0x30db65=_0x2d23[_0x1969f1];return _0x30db65;};'use strict';var util=require(_0x32d2('0x0'));var _=require(_0x32d2('0x1'));var moment=require('moment');function getSeconds(_0x4a5273,_0x48e401){var _0xee5c82=moment(_0x4a5273)['milliseconds'](0x0);var _0x32de79=moment(_0x48e401)[_0x32d2('0x2')](0x0);return _0xee5c82[_0x32d2('0x3')](_0x32de79,_0x32d2('0x4'));}function QueueCallerAbandon(_0x5eb02f,_0x5269e5){this[_0x32d2('0x5')]=_0x5eb02f[_0x32d2('0x5')];this[_0x32d2('0x6')]=_0x5eb02f['type'];this[_0x32d2('0x7')]=_0x5eb02f[_0x32d2('0x6')]==='outbound'?_0x32d2('0x8'):_0x5eb02f[_0x32d2('0x6')];this[_0x32d2('0x9')]=_0x5eb02f['countbusyretry'];this['countcongestionretry']=_0x5eb02f['countcongestionretry'];this[_0x32d2('0xa')]=_0x5eb02f['countnoanswerretry'];this[_0x32d2('0xb')]=_0x5eb02f[_0x32d2('0x9')]+_0x5eb02f['countcongestionretry']+_0x5eb02f[_0x32d2('0xa')]+_0x5eb02f['countnosuchnumberretry']+_0x5eb02f['countdropretry']+_0x5eb02f[_0x32d2('0xc')]+_0x5eb02f[_0x32d2('0xd')]+_0x5eb02f[_0x32d2('0xe')];this[_0x32d2('0xf')]=_0x5eb02f[_0x32d2('0xf')];this['countdropretry']=_0x5eb02f['countdropretry'];this['countabandonedretry']=_0x5eb02f[_0x32d2('0xc')];this[_0x32d2('0xd')]=_0x5eb02f['countmachineretry'];this[_0x32d2('0xe')]=_0x5eb02f[_0x32d2('0xe')];this[_0x32d2('0x10')]=_0x5269e5['uniqueid'];this[_0x32d2('0x11')]=_0x5eb02f['name'];this[_0x32d2('0x12')]=_0x5eb02f[_0x32d2('0x13')];this['starttime']=_0x5eb02f[_0x32d2('0x14')];this['responsetime']=_0x5eb02f['responsetime'];this['droptime']=_0x5eb02f[_0x32d2('0x15')];this[_0x32d2('0x16')]=this['droptime'];this[_0x32d2('0x17')]=getSeconds(_0x5eb02f[_0x32d2('0x18')],_0x5eb02f['starttime']);this[_0x32d2('0x19')]=getSeconds(this['droptime'],_0x5eb02f[_0x32d2('0x18')]);this[_0x32d2('0x1a')]=0x0;this[_0x32d2('0x8')]=_0x5269e5[_0x32d2('0x8')];this[_0x32d2('0x1b')]=_0x5269e5[_0x32d2('0x1c')];this[_0x32d2('0x1d')]=_0x5269e5[_0x32d2('0x1d')];this[_0x32d2('0x1e')]=_0x5eb02f[_0x32d2('0x1e')];this[_0x32d2('0x1f')]=_0x5eb02f[_0x32d2('0x1f')];this[_0x32d2('0x20')]=_0x5eb02f[_0x32d2('0x20')];this[_0x32d2('0x21')]=_0x5eb02f[_0x32d2('0x21')];this[_0x32d2('0x22')]=_0x5eb02f[_0x32d2('0x22')];this[_0x32d2('0x23')]=_0x5eb02f[_0x32d2('0x23')];this[_0x32d2('0x24')]=_0x5eb02f['UserId'];this['VoiceQueueId']=_0x5eb02f['VoiceQueueId'];this[_0x32d2('0x25')]=_0x5eb02f[_0x32d2('0x25')];this['originatecalleridnum']=_0x5eb02f[_0x32d2('0x26')]||'';this[_0x32d2('0x27')]=_0x5eb02f['originatecalleridname']||'';}module[_0x32d2('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6cbe745..131fa69 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 _0x962f=['localstationid','path','AttachmentId','exports','util','lodash','uniqueid','format','%s/%s/%s','Trunk','name','fax'];(function(_0x59a53a,_0x3865ff){var _0x891a8d=function(_0xde67a1){while(--_0xde67a1){_0x59a53a['push'](_0x59a53a['shift']());}};_0x891a8d(++_0x3865ff);}(_0x962f,0x70));var _0xf962=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x962f[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf962('0x0'));var _=require(_0xf962('0x1'));var moment=require('moment');function Action(_0x481808,_0x21af7c,_0x3ef819){this[_0xf962('0x2')]=_0x481808||undefined;this['channel']=util[_0xf962('0x3')](_0xf962('0x4'),_0x21af7c['tech'],_0x21af7c[_0xf962('0x5')][_0xf962('0x6')],_0x3ef819[_0xf962('0x7')]);this[_0xf962('0x8')]=_0x21af7c['localstationid'];this['headerinfo']=_0x21af7c['headerinfo'];this['path']=_0x3ef819[_0xf962('0x9')];this[_0xf962('0xa')]=_0x3ef819[_0xf962('0xa')];}module[_0xf962('0xb')]=Action; \ No newline at end of file +var _0xaa28=['lodash','uniqueid','channel','format','%s/%s/%s','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xaa28,0x1c7));var _0x8aa2=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0xaa28[_0x470f63];return _0x4f09e2;};'use strict';var util=require('util');var _=require(_0x8aa2('0x0'));var moment=require('moment');function Action(_0x3977c2,_0xfb5a7,_0x91eb10){this[_0x8aa2('0x1')]=_0x3977c2||undefined;this[_0x8aa2('0x2')]=util[_0x8aa2('0x3')](_0x8aa2('0x4'),_0xfb5a7['tech'],_0xfb5a7[_0x8aa2('0x5')][_0x8aa2('0x6')],_0x91eb10[_0x8aa2('0x7')]);this['localstationid']=_0xfb5a7[_0x8aa2('0x8')];this[_0x8aa2('0x9')]=_0xfb5a7[_0x8aa2('0x9')];this[_0x8aa2('0xa')]=_0x91eb10['path'];this[_0x8aa2('0xb')]=_0x91eb10[_0x8aa2('0xb')];}module[_0x8aa2('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 76e4c12..1474ad8 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 _0x6e75=['checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','bluebird','uuid','moment','path','./util/gs','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','context','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','catch','error','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received'];(function(_0x25a764,_0x22127b){var _0x2d285d=function(_0x5f1ceb){while(--_0x5f1ceb){_0x25a764['push'](_0x25a764['shift']());}};_0x2d285d(++_0x22127b);}(_0x6e75,0x101));var _0x56e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e75[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x56e7('0x0'));var _=require('lodash');var BPromise=require(_0x56e7('0x1'));var uuid=require(_0x56e7('0x2'));var moment=require(_0x56e7('0x3'));var path=require(_0x56e7('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x56e7('0x5'));var logger=require('../../../config/logger')(_0x56e7('0x6'));var ami=require(_0x56e7('0x7'));var rpcDb=require(_0x56e7('0x8'));var Channel=require(_0x56e7('0x9'));var ut=require('./util/util');var Action=require(_0x56e7('0xa'));var faxAccount=require(_0x56e7('0xb'));var attachment=require(_0x56e7('0xc'));var faxMessage=require(_0x56e7('0xd'));function Fax(_0x1e09ac){this[_0x56e7('0xe')]={};this['faxAccounts']=_0x1e09ac['faxAccounts'];this[_0x56e7('0xf')]=_0x1e09ac['trunks'];this[_0x56e7('0x10')]={};ami['on'](_0x56e7('0x11'),this[_0x56e7('0x12')][_0x56e7('0x13')](this));ami['on'](_0x56e7('0x14'),this[_0x56e7('0x15')][_0x56e7('0x13')](this));ami['on'](_0x56e7('0x16'),this[_0x56e7('0x17')][_0x56e7('0x13')](this));ami['on']('newexten',this[_0x56e7('0x18')][_0x56e7('0x13')](this));ami['on']('faxstatus',this[_0x56e7('0x19')][_0x56e7('0x13')](this));ami['on'](_0x56e7('0x1a'),this[_0x56e7('0x1b')]['bind'](this));ami['on']('hangup',this[_0x56e7('0x1c')]['bind'](this));ami['on'](_0x56e7('0x1d'),this[_0x56e7('0x1e')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0xcb539b){if(_0xcb539b[_0x56e7('0x1f')]==='from-voip-provider'){for(var _0x5e958a in this[_0x56e7('0x20')]){if(this[_0x56e7('0x20')][_0x56e7('0x21')](_0x5e958a)){if(_0xcb539b[_0x56e7('0x22')]===this['faxAccounts'][_0x5e958a][_0x56e7('0x23')]){this[_0x56e7('0xe')][_0xcb539b['uniqueid']]={};this['channels'][_0xcb539b[_0x56e7('0x24')]][_0x56e7('0x25')]=_0xcb539b['channel'];this[_0x56e7('0xe')][_0xcb539b[_0x56e7('0x24')]]['id']=this[_0x56e7('0x20')][_0x5e958a]['id'];this['channels'][_0xcb539b['uniqueid']]['name']=this[_0x56e7('0x20')][_0x5e958a][_0x56e7('0x26')];logger['info'](_0xcb539b[_0x56e7('0x24')],_0x56e7('0x27'));}}}}if(this[_0x56e7('0x10')][_0xcb539b[_0x56e7('0x24')]]){this[_0x56e7('0xe')][_0xcb539b[_0x56e7('0x24')]]={};this[_0x56e7('0xe')][_0xcb539b['uniqueid']][_0x56e7('0x25')]=_0xcb539b[_0x56e7('0x25')];logger[_0x56e7('0x28')](_0xcb539b[_0x56e7('0x24')],_0x56e7('0x27'));}};Fax[_0x56e7('0x29')][_0x56e7('0x15')]=function(_0x478f56){if(this['channels'][_0x478f56[_0x56e7('0x24')]]){for(var _0x579128 in _0x478f56[_0x56e7('0x2a')]){if(_0x478f56['variable'][_0x56e7('0x21')](_0x579128)){this['channels'][_0x478f56['uniqueid']][_0x579128]=_0x478f56['value'];}}}};Fax[_0x56e7('0x29')]['syncNewState']=function(_0xe2c940){if(this[_0x56e7('0xe')][_0xe2c940['uniqueid']]){this['channels'][_0xe2c940['uniqueid']][_0x56e7('0x2b')]=_0xe2c940['channelstate'];this[_0x56e7('0xe')][_0xe2c940[_0x56e7('0x24')]][_0x56e7('0x2c')]=_0xe2c940[_0x56e7('0x2c')];}};Fax[_0x56e7('0x29')][_0x56e7('0x18')]=function(_0x22ed45){if(this[_0x56e7('0xe')][_0x22ed45[_0x56e7('0x24')]]){for(var _0x10f0c9 in _0x22ed45[_0x56e7('0x2a')]){if(_0x22ed45['variable'][_0x56e7('0x21')](_0x10f0c9)){this[_0x56e7('0xe')][_0x22ed45[_0x56e7('0x24')]][_0x10f0c9]=_0x22ed45[_0x56e7('0x2d')];}}}};Fax[_0x56e7('0x29')]['syncFaxStatus']=function(_0x1cc6d4){if(this['channels'][_0x1cc6d4[_0x56e7('0x24')]]){this[_0x56e7('0xe')][_0x1cc6d4['uniqueid']]['operation']=_0x1cc6d4[_0x56e7('0x2e')];this[_0x56e7('0xe')][_0x1cc6d4[_0x56e7('0x24')]][_0x56e7('0x2f')]=_0x1cc6d4['status'];this[_0x56e7('0xe')][_0x1cc6d4[_0x56e7('0x24')]][_0x56e7('0x23')]=_0x1cc6d4[_0x56e7('0x23')];this[_0x56e7('0xe')][_0x1cc6d4[_0x56e7('0x24')]][_0x56e7('0x30')]=_0x1cc6d4['filename'];logger[_0x56e7('0x28')](_0x1cc6d4[_0x56e7('0x24')],_0x56e7('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x264545){var _0x3443a1=this;if(this['channels'][_0x264545['uniqueid']]){var _0x57fca0=this[_0x56e7('0xe')][_0x264545[_0x56e7('0x24')]]['id'];this['channels'][_0x264545['uniqueid']][_0x56e7('0x32')]=_0x264545[_0x56e7('0x32')];this[_0x56e7('0xe')][_0x264545[_0x56e7('0x24')]][_0x56e7('0x33')]=_0x264545[_0x56e7('0x33')];this['channels'][_0x264545['uniqueid']]['localstationid']=_0x264545[_0x56e7('0x23')];this['channels'][_0x264545[_0x56e7('0x24')]][_0x56e7('0x34')]=_0x264545[_0x56e7('0x34')];this['channels'][_0x264545[_0x56e7('0x24')]][_0x56e7('0x35')]=_0x264545[_0x56e7('0x35')];this[_0x56e7('0xe')][_0x264545['uniqueid']]['filename']=_0x264545[_0x56e7('0x30')];this[_0x56e7('0xe')][_0x264545[_0x56e7('0x24')]][_0x56e7('0x36')]=_0x264545[_0x56e7('0x36')];if(this['channels'][_0x264545[_0x56e7('0x24')]][_0x56e7('0x33')]>0x0){tiff2pdf(_0x264545[_0x56e7('0x30')],_0x56e7('0x37'),function(_0x340ec){logger['info'](_0x264545['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x340ec['message']);attachment[_0x56e7('0x38')]({'name':path['parse'](_0x264545[_0x56e7('0x30')])[_0x56e7('0x26')],'basename':path[_0x56e7('0x39')](_0x264545[_0x56e7('0x30')])[_0x56e7('0x26')]+_0x56e7('0x3a'),'type':_0x56e7('0x3b')})[_0x56e7('0x3c')](function(_0x35428b){faxAccount['notify'](_0x57fca0,{'from':_0x264545[_0x56e7('0x36')],'mapKey':_0x56e7('0x6'),'body':path[_0x56e7('0x39')](_0x264545[_0x56e7('0x30')])[_0x56e7('0x26')]+_0x56e7('0x3a'),'AttachmentId':_0x35428b['id']})[_0x56e7('0x3d')](function(_0x1965fe){logger['error'](_0x264545['uniqueid'],'\x20notify\x20',JSON['stringify'](_0x1965fe));});})[_0x56e7('0x3d')](function(_0xf0f320){logger[_0x56e7('0x3e')](_0x264545[_0x56e7('0x24')],_0x56e7('0x3f'),JSON[_0x56e7('0x40')](_0xf0f320));});});}logger[_0x56e7('0x28')](_0x264545[_0x56e7('0x24')],_0x56e7('0x3f'));}};Fax['prototype'][_0x56e7('0x1e')]=function(_0x4ecdf8){if(this[_0x56e7('0x10')][_0x4ecdf8[_0x56e7('0x24')]]){_[_0x56e7('0x41')](this['channels'][_0x4ecdf8[_0x56e7('0x24')]],_[_0x56e7('0x42')](_0x4ecdf8,['response',_0x56e7('0x43')]));}};function updateStatus(_0x1e4a39){if(_0x1e4a39[_0x56e7('0x44')]){faxMessage[_0x56e7('0x45')](_0x1e4a39[_0x56e7('0x44')],{'failMessage':_0x56e7('0x46')})[_0x56e7('0x3c')](function(_0x33831f){ut['logger'](_0x56e7('0x47'),_0x33831f);})[_0x56e7('0x3d')](function(_0x3331df){ut[_0x56e7('0x48')](_0x56e7('0x49'),_0x3331df);});}else{ut[_0x56e7('0x48')](_0x56e7('0x4a'));}}Fax[_0x56e7('0x29')][_0x56e7('0x4b')]=function(_0x4469a7,_0x4d2f5e,_0x358a81){var _0x1e082f=this;var _0x156045={};if(_0x4d2f5e){_0x156045={'read':_0x4d2f5e};}else{_0x156045={'failMessage':_0x358a81};}if(this[_0x56e7('0x10')][_0x4469a7][_0x56e7('0x44')]){faxMessage[_0x56e7('0x45')](this[_0x56e7('0x10')][_0x4469a7][_0x56e7('0x44')],_0x156045)[_0x56e7('0x3c')](function(_0xed8b7e){ut[_0x56e7('0x48')]('[Fax][Message][Updated]',_0xed8b7e);})[_0x56e7('0x3d')](function(_0xcf57fa){ut['logger']('[Fax][Message][NoUpdate1]',_0xcf57fa);})[_0x56e7('0x4c')](function(){delete _0x1e082f[_0x56e7('0xe')][_0x4469a7];delete _0x1e082f[_0x56e7('0x10')][_0x4469a7];});}else{ut[_0x56e7('0x48')](_0x56e7('0x4d'));delete this[_0x56e7('0xe')][_0x4469a7];delete this[_0x56e7('0x10')][_0x4469a7];}};Fax['prototype'][_0x56e7('0x1c')]=function(_0x326516){var _0x5354ef=this;if(this[_0x56e7('0xe')][_0x326516[_0x56e7('0x24')]]){if(this[_0x56e7('0x10')][_0x326516[_0x56e7('0x24')]]){this['channels'][_0x326516[_0x56e7('0x24')]]['id']=this[_0x56e7('0x10')][_0x326516[_0x56e7('0x24')]]['id'];this[_0x56e7('0xe')][_0x326516[_0x56e7('0x24')]][_0x56e7('0x26')]=this['actions'][_0x326516[_0x56e7('0x24')]]['name'];}logger['info'](_0x326516[_0x56e7('0x24')],this[_0x56e7('0x10')][_0x326516['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x56e7('0x4e'),JSON[_0x56e7('0x40')](this[_0x56e7('0xe')][_0x326516[_0x56e7('0x24')]]));if(this[_0x56e7('0x10')][_0x326516[_0x56e7('0x24')]]){if(this['channels'][_0x326516[_0x56e7('0x24')]][_0x56e7('0x4f')]>0x0&&this[_0x56e7('0xe')][_0x326516[_0x56e7('0x24')]]['faxstatus']===_0x56e7('0x50')){this['updateStatus'](_0x326516[_0x56e7('0x24')],!![]);}else{this[_0x56e7('0x4b')](_0x326516[_0x56e7('0x24')],![],this[_0x56e7('0xe')][_0x326516['uniqueid']][_0x56e7('0x51')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x326516[_0x56e7('0x24')]][_0x56e7('0x51')]:_0x56e7('0x52'));}}}};Fax[_0x56e7('0x29')][_0x56e7('0x53')]=function(_0x235f53){var _0x384dde=this;return new BPromise(function(_0x3e6fc7,_0x118b53){_0x384dde[_0x56e7('0x54')](_0x235f53,_0x384dde[_0x56e7('0x20')][_0x235f53['FaxAccountId']])[_0x56e7('0x3c')](function(_0x2fd8c1){ut[_0x56e7('0x48')](_0x56e7('0x55'),_0x2fd8c1);_0x3e6fc7(ut[_0x56e7('0x56')](_0x56e7('0x57')));})[_0x56e7('0x3d')](function(_0x5bdea0){ut[_0x56e7('0x48')]('[Fax][execOriginate][failure]',_0x5bdea0);updateStatus(_0x235f53);_0x118b53(ut['message']('Fax\x20failed'));});});};Fax[_0x56e7('0x29')][_0x56e7('0x58')]=function(_0x2a7287){var _0x9828e2=this;return new BPromise(function(_0x1f7c35,_0x31e215){var _0x11e316=_0x9828e2[_0x56e7('0x59')](_0x9828e2['faxAccounts'][_0x2a7287[_0x56e7('0x5a')]][_0x56e7('0x5b')],_0x2a7287);if(_0x11e316['isValid']){_0x1f7c35(ut[_0x56e7('0x56')](_0x56e7('0x5c')));}else{_0x31e215(ut[_0x56e7('0x56')](_0x11e316['message']));}});};function originate(_0x40f56c,_0x3b76fd,_0x231ecc){return new BPromise(function(_0x3957a6,_0x2c7fbd){if(_0x231ecc){var _0x324528=util[_0x56e7('0x5d')](_0x56e7('0x5e'),path[_0x56e7('0x39')](_0x40f56c['path'])[_0x56e7('0x26')],_0x40f56c[_0x56e7('0x4')]);gs[_0x56e7('0x5f')](_0x324528)[_0x56e7('0x3c')](function(){_0x40f56c[_0x56e7('0x4')]=util['format'](_0x56e7('0x60'),path[_0x56e7('0x39')](_0x40f56c[_0x56e7('0x4')])['dir'],path[_0x56e7('0x39')](_0x40f56c['path'])[_0x56e7('0x26')]);_0x3b76fd[_0x56e7('0x61')]=_0x40f56c['path'];ut['logger'](_0x56e7('0x62'),'');ami[_0x56e7('0x63')](ut[_0x56e7('0x64')](_0x40f56c,_0x3b76fd))[_0x56e7('0x3c')](function(_0x3e2fa9){_0x3957a6(_0x3e2fa9);})[_0x56e7('0x3d')](function(_0x92f7bc){_0x2c7fbd(_0x92f7bc);});})[_0x56e7('0x3d')](function(_0x386750){_0x2c7fbd(_0x386750);});}else{ami[_0x56e7('0x63')](ut[_0x56e7('0x64')](_0x40f56c,_0x3b76fd))[_0x56e7('0x3c')](function(_0x425758){_0x3957a6(_0x425758);})['catch'](function(_0x2a0aa4){_0x2c7fbd(_0x2a0aa4);});}});}Fax[_0x56e7('0x29')][_0x56e7('0x54')]=function(_0x27bcde,_0x16b6ca){var _0x2b149e=this;return new BPromise(function(_0x1396ad,_0x2afdea){var _0x507ac2=uuid['v4']();var _0x151c73=ut[_0x56e7('0x65')](_0x27bcde,_0x16b6ca);_0x2b149e[_0x56e7('0x10')][_0x507ac2]=new Action(_0x507ac2,_0x16b6ca,_0x27bcde);var _0x4dbe37=_0x2b149e[_0x56e7('0x10')][_0x507ac2];if(path[_0x56e7('0x39')](_0x27bcde['path'])[_0x56e7('0x66')]===_0x56e7('0x3a')){originate(_0x4dbe37,_0x151c73,!![])[_0x56e7('0x3c')](function(_0x52e8a4){_0x1396ad(_0x52e8a4);})[_0x56e7('0x3d')](function(_0x1de89f){_0x2afdea(_0x1de89f);});}else{originate(_0x4dbe37,_0x151c73,![])[_0x56e7('0x3c')](function(_0xb84f7f){_0x1396ad(_0xb84f7f);})['catch'](function(_0x2c8d33){_0x2afdea(_0x2c8d33);});}});};Fax[_0x56e7('0x29')][_0x56e7('0x67')]=function(_0x540176){return!_['isNil'](_0x540176)&&!_[_0x56e7('0x68')](_0x540176[_0x56e7('0x26')])&&!_[_0x56e7('0x68')](_0x540176[_0x56e7('0x69')])&&_0x540176[_0x56e7('0x69')]&&!_[_0x56e7('0x68')](this[_0x56e7('0xf')][util[_0x56e7('0x5d')](_0x56e7('0x6a'),_0x540176[_0x56e7('0x26')])])&&!_['isNil'](this[_0x56e7('0xf')][util[_0x56e7('0x5d')](_0x56e7('0x6a'),_0x540176[_0x56e7('0x26')])][_0x56e7('0x2f')])&&(this['trunks'][util[_0x56e7('0x5d')](_0x56e7('0x6a'),_0x540176[_0x56e7('0x26')])][_0x56e7('0x2f')]===_0x56e7('0x6b')||this['trunks'][util['format'](_0x56e7('0x6a'),_0x540176[_0x56e7('0x26')])][_0x56e7('0x2f')]===_0x56e7('0x6c'));};Fax[_0x56e7('0x29')][_0x56e7('0x59')]=function(_0x22ea96,_0x2be6e7){if(!this[_0x56e7('0x67')](_0x22ea96)){ut[_0x56e7('0x48')](_0x56e7('0x6d'),_['isNil'](_0x22ea96)?'':_0x22ea96[_0x56e7('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x56e7('0x6e')};}if(_[_0x56e7('0x68')](_0x2be6e7['fax'])){ut[_0x56e7('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2be6e7));return{'isValid':![],'message':_0x56e7('0x6f')};}if(_[_0x56e7('0x68')](_0x2be6e7['path'])){ut[_0x56e7('0x48')](_0x56e7('0x70'),JSON[_0x56e7('0x40')](_0x2be6e7));return{'isValid':![],'message':_0x56e7('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x56e7('0x72')]=Fax; \ No newline at end of file +var _0xd1b7=['[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId'];(function(_0x101ef2,_0x54d76b){var _0x539471=function(_0x2cf208){while(--_0x2cf208){_0x101ef2['push'](_0x101ef2['shift']());}};_0x539471(++_0x54d76b);}(_0xd1b7,0x10f));var _0x7d1b=function(_0x4d58d7,_0x538a07){_0x4d58d7=_0x4d58d7-0x0;var _0x59e312=_0xd1b7[_0x4d58d7];return _0x59e312;};'use strict';var util=require(_0x7d1b('0x0'));var _=require(_0x7d1b('0x1'));var BPromise=require(_0x7d1b('0x2'));var uuid=require('uuid');var moment=require(_0x7d1b('0x3'));var path=require(_0x7d1b('0x4'));var tiff2pdf=require(_0x7d1b('0x5'));var gs=require(_0x7d1b('0x6'));var logger=require('../../../config/logger')(_0x7d1b('0x7'));var ami=require('../ami');var rpcDb=require(_0x7d1b('0x8'));var Channel=require(_0x7d1b('0x9'));var ut=require(_0x7d1b('0xa'));var Action=require('./action');var faxAccount=require(_0x7d1b('0xb'));var attachment=require(_0x7d1b('0xc'));var faxMessage=require(_0x7d1b('0xd'));function Fax(_0x5ede1b){this[_0x7d1b('0xe')]={};this[_0x7d1b('0xf')]=_0x5ede1b[_0x7d1b('0xf')];this['trunks']=_0x5ede1b[_0x7d1b('0x10')];this[_0x7d1b('0x11')]={};ami['on'](_0x7d1b('0x12'),this[_0x7d1b('0x13')][_0x7d1b('0x14')](this));ami['on'](_0x7d1b('0x15'),this['syncVarSet'][_0x7d1b('0x14')](this));ami['on'](_0x7d1b('0x16'),this[_0x7d1b('0x17')]['bind'](this));ami['on'](_0x7d1b('0x18'),this[_0x7d1b('0x19')][_0x7d1b('0x14')](this));ami['on'](_0x7d1b('0x1a'),this[_0x7d1b('0x1b')]['bind'](this));ami['on'](_0x7d1b('0x1c'),this['syncReceiveFax']['bind'](this));ami['on'](_0x7d1b('0x1d'),this[_0x7d1b('0x1e')]['bind'](this));ami['on'](_0x7d1b('0x1f'),this[_0x7d1b('0x20')][_0x7d1b('0x14')](this));}Fax[_0x7d1b('0x21')][_0x7d1b('0x13')]=function(_0x46a9a1){if(_0x46a9a1[_0x7d1b('0x22')]==='from-voip-provider'){for(var _0x13b8a6 in this[_0x7d1b('0xf')]){if(this[_0x7d1b('0xf')][_0x7d1b('0x23')](_0x13b8a6)){if(_0x46a9a1[_0x7d1b('0x24')]===this[_0x7d1b('0xf')][_0x13b8a6][_0x7d1b('0x25')]){this[_0x7d1b('0xe')][_0x46a9a1[_0x7d1b('0x26')]]={};this[_0x7d1b('0xe')][_0x46a9a1[_0x7d1b('0x26')]][_0x7d1b('0x27')]=_0x46a9a1['channel'];this[_0x7d1b('0xe')][_0x46a9a1[_0x7d1b('0x26')]]['id']=this[_0x7d1b('0xf')][_0x13b8a6]['id'];this['channels'][_0x46a9a1[_0x7d1b('0x26')]][_0x7d1b('0x28')]=this[_0x7d1b('0xf')][_0x13b8a6]['name'];logger[_0x7d1b('0x29')](_0x46a9a1[_0x7d1b('0x26')],_0x7d1b('0x2a'));}}}}if(this['actions'][_0x46a9a1[_0x7d1b('0x26')]]){this['channels'][_0x46a9a1['uniqueid']]={};this[_0x7d1b('0xe')][_0x46a9a1[_0x7d1b('0x26')]]['channel']=_0x46a9a1['channel'];logger['info'](_0x46a9a1[_0x7d1b('0x26')],_0x7d1b('0x2a'));}};Fax['prototype'][_0x7d1b('0x2b')]=function(_0x3b2963){if(this[_0x7d1b('0xe')][_0x3b2963[_0x7d1b('0x26')]]){for(var _0x4fc4f8 in _0x3b2963['variable']){if(_0x3b2963[_0x7d1b('0x2c')][_0x7d1b('0x23')](_0x4fc4f8)){this[_0x7d1b('0xe')][_0x3b2963['uniqueid']][_0x4fc4f8]=_0x3b2963[_0x7d1b('0x2d')];}}}};Fax[_0x7d1b('0x21')]['syncNewState']=function(_0x260479){if(this[_0x7d1b('0xe')][_0x260479['uniqueid']]){this[_0x7d1b('0xe')][_0x260479[_0x7d1b('0x26')]]['channelstate']=_0x260479[_0x7d1b('0x2e')];this[_0x7d1b('0xe')][_0x260479[_0x7d1b('0x26')]][_0x7d1b('0x2f')]=_0x260479[_0x7d1b('0x2f')];}};Fax[_0x7d1b('0x21')]['syncNewExten']=function(_0x46b0f7){if(this[_0x7d1b('0xe')][_0x46b0f7[_0x7d1b('0x26')]]){for(var _0x449dc3 in _0x46b0f7[_0x7d1b('0x2c')]){if(_0x46b0f7['variable'][_0x7d1b('0x23')](_0x449dc3)){this[_0x7d1b('0xe')][_0x46b0f7['uniqueid']][_0x449dc3]=_0x46b0f7[_0x7d1b('0x2d')];}}}};Fax[_0x7d1b('0x21')]['syncFaxStatus']=function(_0x214a7f){if(this[_0x7d1b('0xe')][_0x214a7f[_0x7d1b('0x26')]]){this[_0x7d1b('0xe')][_0x214a7f[_0x7d1b('0x26')]]['operation']=_0x214a7f[_0x7d1b('0x30')];this[_0x7d1b('0xe')][_0x214a7f[_0x7d1b('0x26')]]['status']=_0x214a7f['status'];this[_0x7d1b('0xe')][_0x214a7f['uniqueid']][_0x7d1b('0x25')]=_0x214a7f[_0x7d1b('0x25')];this[_0x7d1b('0xe')][_0x214a7f[_0x7d1b('0x26')]][_0x7d1b('0x31')]=_0x214a7f[_0x7d1b('0x31')];logger['info'](_0x214a7f['uniqueid'],_0x7d1b('0x32'));}};Fax[_0x7d1b('0x21')][_0x7d1b('0x33')]=function(_0x3973bc){var _0x445e52=this;if(this['channels'][_0x3973bc[_0x7d1b('0x26')]]){var _0x3487bc=this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]]['id'];this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x34')]=_0x3973bc[_0x7d1b('0x34')];this[_0x7d1b('0xe')][_0x3973bc['uniqueid']]['pagestransferred']=_0x3973bc['pagestransferred'];this['channels'][_0x3973bc[_0x7d1b('0x26')]]['localstationid']=_0x3973bc['localstationid'];this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x35')]=_0x3973bc[_0x7d1b('0x35')];this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x36')]=_0x3973bc[_0x7d1b('0x36')];this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x31')]=_0x3973bc[_0x7d1b('0x31')];this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x37')]=_0x3973bc[_0x7d1b('0x37')];if(this[_0x7d1b('0xe')][_0x3973bc[_0x7d1b('0x26')]][_0x7d1b('0x38')]>0x0){tiff2pdf(_0x3973bc[_0x7d1b('0x31')],_0x7d1b('0x39'),function(_0x2cf16e){logger['info'](_0x3973bc[_0x7d1b('0x26')],_0x7d1b('0x3a'),_0x2cf16e['message']);attachment[_0x7d1b('0x3b')]({'name':path[_0x7d1b('0x3c')](_0x3973bc['filename'])[_0x7d1b('0x28')],'basename':path[_0x7d1b('0x3c')](_0x3973bc[_0x7d1b('0x31')])['name']+_0x7d1b('0x3d'),'type':_0x7d1b('0x3e')})[_0x7d1b('0x3f')](function(_0x2c075f){faxAccount[_0x7d1b('0x40')](_0x3487bc,{'from':_0x3973bc['calleridnum'],'mapKey':_0x7d1b('0x7'),'body':path[_0x7d1b('0x3c')](_0x3973bc[_0x7d1b('0x31')])[_0x7d1b('0x28')]+'.pdf','AttachmentId':_0x2c075f['id']})['catch'](function(_0x54d9d5){logger[_0x7d1b('0x41')](_0x3973bc[_0x7d1b('0x26')],_0x7d1b('0x42'),JSON[_0x7d1b('0x43')](_0x54d9d5));});})[_0x7d1b('0x44')](function(_0x2a544e){logger[_0x7d1b('0x41')](_0x3973bc[_0x7d1b('0x26')],_0x7d1b('0x45'),JSON[_0x7d1b('0x43')](_0x2a544e));});});}logger[_0x7d1b('0x29')](_0x3973bc[_0x7d1b('0x26')],_0x7d1b('0x45'));}};Fax[_0x7d1b('0x21')][_0x7d1b('0x20')]=function(_0x20c255){if(this[_0x7d1b('0x11')][_0x20c255[_0x7d1b('0x26')]]){_['merge'](this['channels'][_0x20c255[_0x7d1b('0x26')]],_[_0x7d1b('0x46')](_0x20c255,[_0x7d1b('0x47'),_0x7d1b('0x48')]));}};function updateStatus(_0x5c0eba){if(_0x5c0eba[_0x7d1b('0x49')]){faxMessage['update'](_0x5c0eba[_0x7d1b('0x49')],{'failMessage':_0x7d1b('0x4a')})['then'](function(_0x1b6e14){ut[_0x7d1b('0x4b')]('[Fax][Message][Error][Updated]',_0x1b6e14);})[_0x7d1b('0x44')](function(_0x570476){ut[_0x7d1b('0x4b')](_0x7d1b('0x4c'),_0x570476);});}else{ut['logger'](_0x7d1b('0x4d'));}}Fax[_0x7d1b('0x21')][_0x7d1b('0x4e')]=function(_0x30ed70,_0x4c9c13,_0x5ad9ec){var _0x567a49=this;var _0x22c73a={};if(_0x4c9c13){_0x22c73a={'read':_0x4c9c13};}else{_0x22c73a={'failMessage':_0x5ad9ec};}if(this[_0x7d1b('0x11')][_0x30ed70]['AttachmentId']){faxMessage[_0x7d1b('0x4f')](this[_0x7d1b('0x11')][_0x30ed70][_0x7d1b('0x49')],_0x22c73a)['then'](function(_0xc988fb){ut[_0x7d1b('0x4b')](_0x7d1b('0x50'),_0xc988fb);})[_0x7d1b('0x44')](function(_0xe10818){ut['logger'](_0x7d1b('0x51'),_0xe10818);})[_0x7d1b('0x52')](function(){delete _0x567a49[_0x7d1b('0xe')][_0x30ed70];delete _0x567a49[_0x7d1b('0x11')][_0x30ed70];});}else{ut[_0x7d1b('0x4b')](_0x7d1b('0x53'));delete this[_0x7d1b('0xe')][_0x30ed70];delete this['actions'][_0x30ed70];}};Fax[_0x7d1b('0x21')][_0x7d1b('0x1e')]=function(_0x3b8e53){var _0x524234=this;if(this[_0x7d1b('0xe')][_0x3b8e53[_0x7d1b('0x26')]]){if(this['actions'][_0x3b8e53[_0x7d1b('0x26')]]){this[_0x7d1b('0xe')][_0x3b8e53[_0x7d1b('0x26')]]['id']=this[_0x7d1b('0x11')][_0x3b8e53[_0x7d1b('0x26')]]['id'];this['channels'][_0x3b8e53['uniqueid']][_0x7d1b('0x28')]=this[_0x7d1b('0x11')][_0x3b8e53[_0x7d1b('0x26')]][_0x7d1b('0x28')];}logger[_0x7d1b('0x29')](_0x3b8e53['uniqueid'],this[_0x7d1b('0x11')][_0x3b8e53[_0x7d1b('0x26')]]?_0x7d1b('0x54'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x3b8e53['uniqueid']]));if(this[_0x7d1b('0x11')][_0x3b8e53[_0x7d1b('0x26')]]){if(this[_0x7d1b('0xe')][_0x3b8e53['uniqueid']][_0x7d1b('0x55')]>0x0&&this[_0x7d1b('0xe')][_0x3b8e53[_0x7d1b('0x26')]][_0x7d1b('0x1a')]===_0x7d1b('0x56')){this[_0x7d1b('0x4e')](_0x3b8e53['uniqueid'],!![]);}else{this[_0x7d1b('0x4e')](_0x3b8e53[_0x7d1b('0x26')],![],this[_0x7d1b('0xe')][_0x3b8e53['uniqueid']][_0x7d1b('0x57')]?_0x7d1b('0x58')+this[_0x7d1b('0xe')][_0x3b8e53[_0x7d1b('0x26')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x7d1b('0x59')]=function(_0x4f32a9){var _0x16df37=this;return new BPromise(function(_0x496a6e,_0x344ca4){_0x16df37[_0x7d1b('0x5a')](_0x4f32a9,_0x16df37[_0x7d1b('0xf')][_0x4f32a9[_0x7d1b('0x5b')]])[_0x7d1b('0x3f')](function(_0x387158){ut[_0x7d1b('0x4b')](_0x7d1b('0x5c'),_0x387158);_0x496a6e(ut[_0x7d1b('0x5d')]('Fax\x20received'));})[_0x7d1b('0x44')](function(_0x17b31a){ut['logger'](_0x7d1b('0x5e'),_0x17b31a);updateStatus(_0x4f32a9);_0x344ca4(ut[_0x7d1b('0x5d')](_0x7d1b('0x5f')));});});};Fax[_0x7d1b('0x21')][_0x7d1b('0x60')]=function(_0x403751){var _0x372bc3=this;return new BPromise(function(_0x1bbbcc,_0x55cd08){var _0x1c1500=_0x372bc3[_0x7d1b('0x61')](_0x372bc3[_0x7d1b('0xf')][_0x403751[_0x7d1b('0x5b')]]['Trunk'],_0x403751);if(_0x1c1500[_0x7d1b('0x62')]){_0x1bbbcc(ut['message'](_0x7d1b('0x63')));}else{_0x55cd08(ut[_0x7d1b('0x5d')](_0x1c1500['message']));}});};function originate(_0x4bc826,_0x5f0aca,_0x320fc6){return new BPromise(function(_0x377e8c,_0x49081e){if(_0x320fc6){var _0x25a247=util['format'](_0x7d1b('0x64'),path[_0x7d1b('0x3c')](_0x4bc826[_0x7d1b('0x4')])[_0x7d1b('0x28')],_0x4bc826[_0x7d1b('0x4')]);gs['execute'](_0x25a247)[_0x7d1b('0x3f')](function(){_0x4bc826[_0x7d1b('0x4')]=util[_0x7d1b('0x65')](_0x7d1b('0x66'),path[_0x7d1b('0x3c')](_0x4bc826[_0x7d1b('0x4')])['dir'],path[_0x7d1b('0x3c')](_0x4bc826['path'])[_0x7d1b('0x28')]);_0x5f0aca[_0x7d1b('0x67')]=_0x4bc826['path'];ut[_0x7d1b('0x4b')](_0x7d1b('0x68'),'');ami[_0x7d1b('0x69')](ut[_0x7d1b('0x6a')](_0x4bc826,_0x5f0aca))['then'](function(_0x49d433){_0x377e8c(_0x49d433);})['catch'](function(_0x4f57a8){_0x49081e(_0x4f57a8);});})['catch'](function(_0x5ea1df){_0x49081e(_0x5ea1df);});}else{ami[_0x7d1b('0x69')](ut[_0x7d1b('0x6a')](_0x4bc826,_0x5f0aca))[_0x7d1b('0x3f')](function(_0x1da6fe){_0x377e8c(_0x1da6fe);})['catch'](function(_0x513160){_0x49081e(_0x513160);});}});}Fax[_0x7d1b('0x21')][_0x7d1b('0x5a')]=function(_0xc12f8a,_0x126850){var _0x21cf31=this;return new BPromise(function(_0x58e07e,_0x3814d6){var _0x991524=uuid['v4']();var _0x5506e6=ut[_0x7d1b('0x6b')](_0xc12f8a,_0x126850);_0x21cf31[_0x7d1b('0x11')][_0x991524]=new Action(_0x991524,_0x126850,_0xc12f8a);var _0x48ae9f=_0x21cf31[_0x7d1b('0x11')][_0x991524];if(path[_0x7d1b('0x3c')](_0xc12f8a[_0x7d1b('0x4')])[_0x7d1b('0x6c')]===_0x7d1b('0x3d')){originate(_0x48ae9f,_0x5506e6,!![])[_0x7d1b('0x3f')](function(_0x54a3d8){_0x58e07e(_0x54a3d8);})[_0x7d1b('0x44')](function(_0x638642){_0x3814d6(_0x638642);});}else{originate(_0x48ae9f,_0x5506e6,![])[_0x7d1b('0x3f')](function(_0x5f0713){_0x58e07e(_0x5f0713);})[_0x7d1b('0x44')](function(_0x54f719){_0x3814d6(_0x54f719);});}});};Fax[_0x7d1b('0x21')][_0x7d1b('0x6d')]=function(_0x592ed0){return!_['isNil'](_0x592ed0)&&!_[_0x7d1b('0x6e')](_0x592ed0[_0x7d1b('0x28')])&&!_['isNil'](_0x592ed0['active'])&&_0x592ed0[_0x7d1b('0x6f')]&&!_[_0x7d1b('0x6e')](this[_0x7d1b('0x10')][util['format'](_0x7d1b('0x70'),_0x592ed0['name'])])&&!_['isNil'](this['trunks'][util[_0x7d1b('0x65')](_0x7d1b('0x70'),_0x592ed0[_0x7d1b('0x28')])][_0x7d1b('0x71')])&&(this[_0x7d1b('0x10')][util[_0x7d1b('0x65')](_0x7d1b('0x70'),_0x592ed0[_0x7d1b('0x28')])][_0x7d1b('0x71')]==='reachable'||this['trunks'][util[_0x7d1b('0x65')]('SIP/%s',_0x592ed0[_0x7d1b('0x28')])][_0x7d1b('0x71')]==='unmonitored');};Fax[_0x7d1b('0x21')][_0x7d1b('0x61')]=function(_0x235b16,_0x32aa03){if(!this[_0x7d1b('0x6d')](_0x235b16)){ut['logger'](_0x7d1b('0x72'),_['isNil'](_0x235b16)?'':_0x235b16['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x7d1b('0x6e')](_0x32aa03[_0x7d1b('0x7')])){ut[_0x7d1b('0x4b')](_0x7d1b('0x73'),JSON[_0x7d1b('0x43')](_0x32aa03));return{'isValid':![],'message':_0x7d1b('0x74')};}if(_[_0x7d1b('0x6e')](_0x32aa03[_0x7d1b('0x4')])){ut[_0x7d1b('0x4b')](_0x7d1b('0x75'),JSON[_0x7d1b('0x43')](_0x32aa03));return{'isValid':![],'message':_0x7d1b('0x76')};}return{'isValid':!![],'message':_0x7d1b('0x77')};};module[_0x7d1b('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 02ac3cd..bea2297 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 _0xb8df=['inspect','notify','then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash'];(function(_0xe85100,_0x2e3a80){var _0x807d41=function(_0x15cc87){while(--_0x15cc87){_0xe85100['push'](_0xe85100['shift']());}};_0x807d41(++_0x2e3a80);}(_0xb8df,0x191));var _0xfb8d=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xb8df[_0x54b396];return _0x532e6d;};'use strict';var util=require(_0xfb8d('0x0'));var BPromise=require('bluebird');var logger=require(_0xfb8d('0x1'))(_0xfb8d('0x2'));var _=require(_0xfb8d('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0xd4635d){return function(_0x48c445){logger['error'](_0xd4635d,util[_0xfb8d('0x4')](_0x48c445,{'showHidden':![],'depth':null}));};}exports[_0xfb8d('0x5')]=function(_0x244ec2,_0x337ba0){return BPromise['resolve']()[_0xfb8d('0x6')](faxAccount[_0xfb8d('0x5')](_0x244ec2,_0x337ba0))[_0xfb8d('0x7')](loggerCatch(_0xfb8d('0x8')));}; \ No newline at end of file +var _0x6bf5=['error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','../rpc/faxAccount'];(function(_0x5b47bf,_0x2469de){var _0x11b291=function(_0x38132d){while(--_0x38132d){_0x5b47bf['push'](_0x5b47bf['shift']());}};_0x11b291(++_0x2469de);}(_0x6bf5,0x193));var _0x56bf=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x6bf5[_0x400322];return _0xfdd597;};'use strict';var util=require(_0x56bf('0x0'));var BPromise=require(_0x56bf('0x1'));var logger=require(_0x56bf('0x2'))('preview');var _=require('lodash');var faxAccount=require(_0x56bf('0x3'));function loggerCatch(_0x25a3dd){return function(_0x398b94){logger[_0x56bf('0x4')](_0x25a3dd,util[_0x56bf('0x5')](_0x398b94,{'showHidden':![],'depth':null}));};}exports[_0x56bf('0x6')]=function(_0x54b5f0,_0x4a3ddb){return BPromise[_0x56bf('0x7')]()[_0x56bf('0x8')](faxAccount[_0x56bf('0x6')](_0x54b5f0,_0x4a3ddb))[_0x56bf('0x9')](loggerCatch(_0x56bf('0xa')));}; \ 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 c37fb2c..90f5a2b 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 _0x0b68=['fax','child_process','exec','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x17719f,_0x659644){var _0x31a4d2=function(_0x3f7c11){while(--_0x3f7c11){_0x17719f['push'](_0x17719f['shift']());}};_0x31a4d2(++_0x659644);}(_0x0b68,0x73));var _0x80b6=function(_0x3d8821,_0x4dca9d){_0x3d8821=_0x3d8821-0x0;var _0x4f82f9=_0x0b68[_0x3d8821];return _0x4f82f9;};'use strict';var util=require(_0x80b6('0x0'));var logger=require(_0x80b6('0x1'))(_0x80b6('0x2'));var BPromise=require('bluebird');var exec=require(_0x80b6('0x3'))[_0x80b6('0x4')];exports['execute']=function(_0x59da27){return new BPromise(function(_0x4b0004,_0x5e14d1){exec(_0x59da27,function(_0x9f0daf,_0x20811d,_0x5390d2){logger['info'](_0x80b6('0x5'),_0x20811d);if(_0x9f0daf){logger[_0x80b6('0x6')]('Exec\x20gs',_0x80b6('0x7'),util[_0x80b6('0x8')](_0x9f0daf,{'showHidden':![],'depth':null}),_0x20811d,_0x5390d2);_0x5e14d1(_0x9f0daf);}_0x4b0004(_0x20811d);});});}; \ No newline at end of file +var _0xc4f2=['inspect','util','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0xc4f2,0x119));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x2c4f('0x0'));var logger=require(_0x2c4f('0x1'))(_0x2c4f('0x2'));var BPromise=require(_0x2c4f('0x3'));var exec=require(_0x2c4f('0x4'))['exec'];exports[_0x2c4f('0x5')]=function(_0x93abe9){return new BPromise(function(_0x57c194,_0x1eaa36){exec(_0x93abe9,function(_0x2528e0,_0x5394b5,_0x76932c){logger[_0x2c4f('0x6')](_0x2c4f('0x7'),_0x5394b5);if(_0x2528e0){logger[_0x2c4f('0x6')](_0x2c4f('0x7'),_0x2c4f('0x8'),util[_0x2c4f('0x9')](_0x2528e0,{'showHidden':![],'depth':null}),_0x5394b5,_0x76932c);_0x1eaa36(_0x2528e0);}_0x57c194(_0x5394b5);});});}; \ 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 7e599a8..e846ee2 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 _0xb7c8=['logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','faxdetect','t38timeout','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid','lodash','moment','../../../../config/logger','fax','message'];(function(_0x25dea5,_0x440b95){var _0x5cc4af=function(_0x22ad08){while(--_0x22ad08){_0x25dea5['push'](_0x25dea5['shift']());}};_0x5cc4af(++_0x440b95);}(_0xb7c8,0x119));var _0x8b7c=function(_0x19fc13,_0x338343){_0x19fc13=_0x19fc13-0x0;var _0x5bcdb6=_0xb7c8[_0x19fc13];return _0x5bcdb6;};'use strict';var util=require('util');var _=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var logger=require(_0x8b7c('0x2'))(_0x8b7c('0x3'));exports[_0x8b7c('0x4')]=function(_0x31ad24){return{'message':_0x31ad24};};exports[_0x8b7c('0x5')]=function(_0x50113e,_0x38672b){logger[_0x8b7c('0x6')](_0x50113e,util[_0x8b7c('0x7')](_0x38672b,{'showHidden':![],'depth':null}));};exports[_0x8b7c('0x8')]=function(_0x107428,_0x12665c){var _0x7a3850={'XMF-ECM':_0x12665c[_0x8b7c('0x9')],'XMF-HEADERINFO':_0x12665c[_0x8b7c('0xa')],'XMF-MINRATE':_0x12665c[_0x8b7c('0xb')],'XMF-MAXRATE':_0x12665c[_0x8b7c('0xc')],'XMF-MODEM':util[_0x8b7c('0xd')]('\x22%s\x22',_0x12665c[_0x8b7c('0xe')]),'XMF-GATEWAY':_0x12665c['gateway'],'XMF-FAXDETECT':_0x12665c[_0x8b7c('0xf')],'XMF-T38TIMEOUT':_0x12665c[_0x8b7c('0x10')],'XMF-LOCALSTATIONID':_0x12665c['localstationid'],'XMF-PATH':_0x107428[_0x8b7c('0x11')]};return _0x7a3850;};exports[_0x8b7c('0x12')]=function(_0x3594b1,_0x586826){return{'actionid':_0x3594b1['uniqueid'],'action':_0x8b7c('0x13'),'channel':_0x3594b1[_0x8b7c('0x14')],'Exten':_0x8b7c('0x15'),'Context':_0x8b7c('0x16'),'Priority':'1','callerid':util[_0x8b7c('0xd')](_0x8b7c('0x17'),_0x3594b1[_0x8b7c('0xa')]?_0x3594b1['headerinfo']:'',_0x3594b1[_0x8b7c('0x18')]),'variable':_0x586826,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3594b1[_0x8b7c('0x19')]};}; \ No newline at end of file +var _0x2dae=['\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','info','inspect','ecm','headerinfo','minrate','maxrate','format'];(function(_0x808042,_0x3d2f89){var _0x17b09d=function(_0x2dd69c){while(--_0x2dd69c){_0x808042['push'](_0x808042['shift']());}};_0x17b09d(++_0x3d2f89);}(_0x2dae,0xc3));var _0xe2da=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x2dae[_0x247fa1];return _0x244f35;};'use strict';var util=require(_0xe2da('0x0'));var _=require('lodash');var moment=require(_0xe2da('0x1'));var logger=require(_0xe2da('0x2'))(_0xe2da('0x3'));exports[_0xe2da('0x4')]=function(_0x99b46f){return{'message':_0x99b46f};};exports['logger']=function(_0x25b9f2,_0x439b5d){logger[_0xe2da('0x5')](_0x25b9f2,util[_0xe2da('0x6')](_0x439b5d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3e3e25,_0x89c70b){var _0x34cc98={'XMF-ECM':_0x89c70b[_0xe2da('0x7')],'XMF-HEADERINFO':_0x89c70b[_0xe2da('0x8')],'XMF-MINRATE':_0x89c70b[_0xe2da('0x9')],'XMF-MAXRATE':_0x89c70b[_0xe2da('0xa')],'XMF-MODEM':util[_0xe2da('0xb')](_0xe2da('0xc'),_0x89c70b['modem']),'XMF-GATEWAY':_0x89c70b[_0xe2da('0xd')],'XMF-FAXDETECT':_0x89c70b[_0xe2da('0xe')],'XMF-T38TIMEOUT':_0x89c70b[_0xe2da('0xf')],'XMF-LOCALSTATIONID':_0x89c70b[_0xe2da('0x10')],'XMF-PATH':_0x3e3e25[_0xe2da('0x11')]};return _0x34cc98;};exports[_0xe2da('0x12')]=function(_0x1a29b9,_0x173244){return{'actionid':_0x1a29b9['uniqueid'],'action':_0xe2da('0x13'),'channel':_0x1a29b9['channel'],'Exten':_0xe2da('0x14'),'Context':_0xe2da('0x15'),'Priority':'1','callerid':util[_0xe2da('0xb')](_0xe2da('0x16'),_0x1a29b9[_0xe2da('0x8')]?_0x1a29b9[_0xe2da('0x8')]:'',_0x1a29b9[_0xe2da('0x10')]),'variable':_0x173244,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a29b9['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index aa69060..6887c19 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 _0x5233=['./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','log','catch','bluebird','util','moment','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm'];(function(_0x39bb41,_0x449d2e){var _0x2595c1=function(_0x78fd57){while(--_0x78fd57){_0x39bb41['push'](_0x39bb41['shift']());}};_0x2595c1(++_0x449d2e);}(_0x5233,0x193));var _0x3523=function(_0x3775a5,_0x157da7){_0x3775a5=_0x3775a5-0x0;var _0x3233d0=_0x5233[_0x3775a5];return _0x3233d0;};'use strict';var BPromise=require(_0x3523('0x0'));var util=require(_0x3523('0x1'));var moment=require(_0x3523('0x2'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x3523('0x3'));var Acw=require(_0x3523('0x4'));var Trigger=require(_0x3523('0x5'));var Dialer=require(_0x3523('0x6'));var Preview=require(_0x3523('0x7'));var Fax=require(_0x3523('0x8'));var user=require(_0x3523('0x9'));var voiceQueue=require(_0x3523('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x3523('0xb'));var trigger=require(_0x3523('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x3523('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x3523('0xe'));var salesforce=require(_0x3523('0xf'));var sugarcrm=require(_0x3523('0x10'));var freshdesk=require(_0x3523('0x11'));var desk=require(_0x3523('0x12'));var zoho=require(_0x3523('0x13'));var vtiger=require(_0x3523('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x3523('0x15'));var dynamics365=require(_0x3523('0x16'));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()[_0x3523('0x17')](_0x3523('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3523('0x17')](_0x3523('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3523('0x19')]()[_0x3523('0x1a')](user[_0x3523('0x1b')]())[_0x3523('0x1a')](realtime['initAgents']())[_0x3523('0x1a')](user['getTelephones']())[_0x3523('0x1a')](realtime['initTelephones']())[_0x3523('0x1a')](trunk['getTrunks']())[_0x3523('0x1a')](realtime[_0x3523('0x1c')]())[_0x3523('0x1a')](voiceQueue[_0x3523('0x1d')]())[_0x3523('0x1a')](realtime[_0x3523('0x1e')]())[_0x3523('0x1a')](trigger[_0x3523('0x1f')]())[_0x3523('0x1a')](realtime[_0x3523('0x20')]())[_0x3523('0x1a')](template['getTemplates']())['then'](realtime['initTemplates']())[_0x3523('0x1a')](zendesk[_0x3523('0x21')]())['then'](realtime[_0x3523('0x22')]())[_0x3523('0x1a')](salesforce[_0x3523('0x23')]())[_0x3523('0x1a')](realtime[_0x3523('0x24')]())[_0x3523('0x1a')](sugarcrm[_0x3523('0x25')]())['then'](realtime[_0x3523('0x26')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x3523('0x27')]())[_0x3523('0x1a')](desk[_0x3523('0x28')]())[_0x3523('0x1a')](realtime[_0x3523('0x29')]())[_0x3523('0x1a')](zoho['getZohoAccounts']())[_0x3523('0x1a')](realtime[_0x3523('0x2a')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0x3523('0x2b')]())[_0x3523('0x1a')](freshsales[_0x3523('0x2c')]())[_0x3523('0x1a')](realtime['initFreshsalesAccounts']())[_0x3523('0x1a')](servicenow[_0x3523('0x2d')]())[_0x3523('0x1a')](realtime[_0x3523('0x2e')]())[_0x3523('0x1a')](dynamics365['getDynamics365Accounts']())[_0x3523('0x1a')](realtime[_0x3523('0x2f')]())['then'](campaign[_0x3523('0x30')]())[_0x3523('0x1a')](realtime[_0x3523('0x31')]())[_0x3523('0x1a')](voiceExtension[_0x3523('0x32')]())[_0x3523('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x3523('0x33')]())[_0x3523('0x1a')](realtime[_0x3523('0x34')]())[_0x3523('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x3523('0x19')]()[_0x3523('0x1a')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x3523('0x35')]())[_0x3523('0x1a')](cmHopperHistory[_0x3523('0x36')]())['then'](realtime[_0x3523('0x37')]())[_0x3523('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x3523('0x1a')](realtime['initCampaignHopperHistory']())[_0x3523('0x1a')](voiceCallReport[_0x3523('0x38')]())['then'](realtime[_0x3523('0x39')]())[_0x3523('0x1a')](function(_0x1f9465){})['catch'](function(_0x29f447){console[_0x3523('0x3a')](_0x29f447);});}function main(){return server['listen'](realtime,preview,fax)[_0x3523('0x1a')](function(_0x4dd03a){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x3523('0x3b')](function(_0x125388){console[_0x3523('0x3a')](_0x125388);});}main(); \ No newline at end of file +var _0x00d9=['initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts'];(function(_0x591d76,_0x907e9b){var _0x549d7c=function(_0x3e841e){while(--_0x3e841e){_0x591d76['push'](_0x591d76['shift']());}};_0x549d7c(++_0x907e9b);}(_0x00d9,0x10d));var _0x900d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x00d9[_0x513aa5];return _0x1a1a7c;};'use strict';var BPromise=require(_0x900d('0x0'));var util=require(_0x900d('0x1'));var moment=require(_0x900d('0x2'));var server=require(_0x900d('0x3'));var Realtime=require(_0x900d('0x4'));var Report=require(_0x900d('0x5'));var Acw=require(_0x900d('0x6'));var Trigger=require(_0x900d('0x7'));var Dialer=require(_0x900d('0x8'));var Preview=require(_0x900d('0x9'));var Fax=require(_0x900d('0xa'));var user=require(_0x900d('0xb'));var voiceQueue=require(_0x900d('0xc'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x900d('0xd'));var trunk=require(_0x900d('0xe'));var trigger=require(_0x900d('0xf'));var template=require(_0x900d('0x10'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x900d('0x11'));var voiceExtension=require(_0x900d('0x12'));var faxAccount=require(_0x900d('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x900d('0x14'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x900d('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x900d('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x900d('0x17'));var dynamics365=require(_0x900d('0x18'));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()[_0x900d('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x900d('0x1a')]()[_0x900d('0x1b')](user[_0x900d('0x1c')]())[_0x900d('0x1b')](realtime['initAgents']())['then'](user[_0x900d('0x1d')]())['then'](realtime['initTelephones']())['then'](trunk[_0x900d('0x1e')]())[_0x900d('0x1b')](realtime[_0x900d('0x1f')]())[_0x900d('0x1b')](voiceQueue[_0x900d('0x20')]())[_0x900d('0x1b')](realtime['initVoiceQueues']())[_0x900d('0x1b')](trigger[_0x900d('0x21')]())[_0x900d('0x1b')](realtime[_0x900d('0x22')]())[_0x900d('0x1b')](template[_0x900d('0x23')]())[_0x900d('0x1b')](realtime[_0x900d('0x24')]())[_0x900d('0x1b')](zendesk['getZendeskAccounts']())['then'](realtime[_0x900d('0x25')]())[_0x900d('0x1b')](salesforce[_0x900d('0x26')]())[_0x900d('0x1b')](realtime[_0x900d('0x27')]())['then'](sugarcrm[_0x900d('0x28')]())['then'](realtime[_0x900d('0x29')]())['then'](freshdesk[_0x900d('0x2a')]())[_0x900d('0x1b')](realtime['initFreshdeskAccounts']())[_0x900d('0x1b')](desk['getDeskAccounts']())[_0x900d('0x1b')](realtime[_0x900d('0x2b')]())[_0x900d('0x1b')](zoho['getZohoAccounts']())[_0x900d('0x1b')](realtime[_0x900d('0x2c')]())[_0x900d('0x1b')](vtiger[_0x900d('0x2d')]())[_0x900d('0x1b')](realtime[_0x900d('0x2e')]())[_0x900d('0x1b')](freshsales['getFreshsalesAccounts']())[_0x900d('0x1b')](realtime['initFreshsalesAccounts']())[_0x900d('0x1b')](servicenow[_0x900d('0x2f')]())[_0x900d('0x1b')](realtime['initServicenowAccounts']())[_0x900d('0x1b')](dynamics365[_0x900d('0x30')]())[_0x900d('0x1b')](realtime[_0x900d('0x31')]())['then'](campaign[_0x900d('0x32')]())[_0x900d('0x1b')](realtime[_0x900d('0x33')]())[_0x900d('0x1b')](voiceExtension[_0x900d('0x34')]())[_0x900d('0x1b')](realtime[_0x900d('0x35')]())['then'](faxAccount[_0x900d('0x36')]())[_0x900d('0x1b')](realtime[_0x900d('0x37')]())[_0x900d('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x900d('0x1a')]()['then'](voiceQueueReport[_0x900d('0x38')]())[_0x900d('0x1b')](realtime['initVoiceQueueReports']())[_0x900d('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x900d('0x1b')](realtime[_0x900d('0x39')]())[_0x900d('0x1b')](cmHopperHistory[_0x900d('0x3a')]())['then'](realtime['initCampaignHopperHistory']())[_0x900d('0x1b')](voiceCallReport[_0x900d('0x3b')]())[_0x900d('0x1b')](realtime[_0x900d('0x3c')]())[_0x900d('0x1b')](function(_0x15e5e5){})['catch'](function(_0x20b7e3){console['log'](_0x20b7e3);});}function main(){return server['listen'](realtime,preview,fax)[_0x900d('0x1b')](function(_0x2e46c0){return initRealtime();})[_0x900d('0x1b')](function(){return initParams();})[_0x900d('0x1b')](function(){report[_0x900d('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2a5d62){console[_0x900d('0x3e')](_0x2a5d62);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 7915dbd..21ae4b6 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 _0x1d29=['online','voiceStatusCallerIdNumber','local','prototype','not_inuse','idle','voiceStatus','statePause','voiceStatusTime','toNumber','format','accountcode','voiceStatusQueue','onhold','stringify','emit','user:save','exports','lodash','util','md5','ioredis','redis','defaults','localhost','name','email','fullname','state','stateTime','status','unknown','address','phone','mobile','interface'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x1d29,0xa2));var _0x91d2=function(_0x1c490a,_0x217f34){_0x1c490a=_0x1c490a-0x0;var _0x1e0b1d=_0x1d29[_0x1c490a];return _0x1e0b1d;};'use strict';var _=require(_0x91d2('0x0'));var util=require(_0x91d2('0x1'));var moment=require('moment');var md5=require(_0x91d2('0x2'));var Redis=require(_0x91d2('0x3'));var config=require('../../../config/environment');config[_0x91d2('0x4')]=_[_0x91d2('0x5')](config['redis'],{'host':_0x91d2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91d2('0x4')]));function Agent(_0x1ad28f){this['id']=_0x1ad28f['id']||0x0;this[_0x91d2('0x7')]=_0x1ad28f[_0x91d2('0x7')]||'';this[_0x91d2('0x8')]=_0x1ad28f[_0x91d2('0x8')]||'';this['accountcode']=_0x1ad28f['accountcode']||'';this[_0x91d2('0x9')]=_0x1ad28f[_0x91d2('0x9')]||'';this[_0x91d2('0xa')]='unknown';this[_0x91d2('0xb')]=0x0;this[_0x91d2('0xc')]=_0x91d2('0xd');this[_0x91d2('0xe')]='';this[_0x91d2('0xf')]='';this[_0x91d2('0x10')]='';this[_0x91d2('0x11')]='';this[_0x91d2('0x12')]=_0x1ad28f[_0x91d2('0x12')]||![];this['voiceStatus']=_0x91d2('0xd');this['voiceStatusTime']=0x0;this[_0x91d2('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x91d2('0x14')]=![];this[_0x91d2('0x2')]='';}Agent[_0x91d2('0x15')]['updateStatusRealtime']=function(_0x21631e){var _0x46dbd1;if(_0x21631e&&_0x21631e['state']){_0x46dbd1=_0x21631e[_0x91d2('0xa')]['toLowerCase']();switch(_0x46dbd1){case _0x91d2('0x16'):_0x46dbd1=_0x91d2('0x17');break;case'inuse':_0x46dbd1='talking';break;}}if(_0x46dbd1&&this[_0x91d2('0x18')]!==_0x46dbd1||_0x21631e[_0x91d2('0x19')]){this[_0x91d2('0x1a')]=_[_0x91d2('0x1b')](moment()[_0x91d2('0x1c')]('x'));}if(_0x46dbd1){this['voiceStatus']=_0x46dbd1;}var _0x5a902a={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0x91d2('0x1d')],'fullname':this[_0x91d2('0x9')],'state':this['state'],'stateTime':this[_0x91d2('0xb')],'status':this[_0x91d2('0xc')],'address':this['address'],'online':this[_0x91d2('0x12')],'voiceStatus':this[_0x91d2('0x18')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x91d2('0x13')],'voiceStatusQueue':this[_0x91d2('0x1e')],'interface':this[_0x91d2('0x11')],'onhold':this[_0x91d2('0x1f')]};var _0x22192d=md5(JSON[_0x91d2('0x20')](_0x5a902a));if(this[_0x91d2('0x2')]!==_0x22192d){this['md5']=_0x22192d;io['to'](util[_0x91d2('0x1c')]('user:%s',_0x5a902a[_0x91d2('0x7')]))[_0x91d2('0x21')](_0x91d2('0x22'),_0x5a902a);}};module[_0x91d2('0x23')]=Agent; \ No newline at end of file +var _0x733d=['lodash','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','md5','prototype','toLowerCase','idle','inuse','talking','voiceStatus','statePause','toNumber','email','status','stringify','format','user:%s','emit'];(function(_0x43316e,_0x318677){var _0x5b2881=function(_0x2612bb){while(--_0x2612bb){_0x43316e['push'](_0x43316e['shift']());}};_0x5b2881(++_0x318677);}(_0x733d,0x1a2));var _0xd733=function(_0x5b00cc,_0x1831e5){_0x5b00cc=_0x5b00cc-0x0;var _0x889dc9=_0x733d[_0x5b00cc];return _0x889dc9;};'use strict';var _=require(_0xd733('0x0'));var util=require(_0xd733('0x1'));var moment=require(_0xd733('0x2'));var md5=require('md5');var Redis=require(_0xd733('0x3'));var config=require('../../../config/environment');config[_0xd733('0x4')]=_[_0xd733('0x5')](config['redis'],{'host':_0xd733('0x6'),'port':0x18eb});var io=require(_0xd733('0x7'))(new Redis(config[_0xd733('0x4')]));function Agent(_0x2876bf){this['id']=_0x2876bf['id']||0x0;this[_0xd733('0x8')]=_0x2876bf['name']||'';this['email']=_0x2876bf['email']||'';this[_0xd733('0x9')]=_0x2876bf[_0xd733('0x9')]||'';this[_0xd733('0xa')]=_0x2876bf[_0xd733('0xa')]||'';this[_0xd733('0xb')]=_0xd733('0xc');this[_0xd733('0xd')]=0x0;this['status']=_0xd733('0xc');this[_0xd733('0xe')]='';this[_0xd733('0xf')]='';this[_0xd733('0x10')]='';this[_0xd733('0x11')]='';this['online']=_0x2876bf[_0xd733('0x12')]||![];this['voiceStatus']=_0xd733('0xc');this[_0xd733('0x13')]=0x0;this[_0xd733('0x14')]='';this[_0xd733('0x15')]='';this[_0xd733('0x16')]=![];this['local']=![];this[_0xd733('0x17')]='';}Agent[_0xd733('0x18')]['updateStatusRealtime']=function(_0x28d74b){var _0x79a4e;if(_0x28d74b&&_0x28d74b[_0xd733('0xb')]){_0x79a4e=_0x28d74b[_0xd733('0xb')][_0xd733('0x19')]();switch(_0x79a4e){case'not_inuse':_0x79a4e=_0xd733('0x1a');break;case _0xd733('0x1b'):_0x79a4e=_0xd733('0x1c');break;}}if(_0x79a4e&&this[_0xd733('0x1d')]!==_0x79a4e||_0x28d74b[_0xd733('0x1e')]){this[_0xd733('0x13')]=_[_0xd733('0x1f')](moment()['format']('x'));}if(_0x79a4e){this[_0xd733('0x1d')]=_0x79a4e;}var _0x5942f={'id':this['id'],'name':this[_0xd733('0x8')],'email':this[_0xd733('0x20')],'accountcode':this[_0xd733('0x9')],'fullname':this[_0xd733('0xa')],'state':this[_0xd733('0xb')],'stateTime':this['stateTime'],'status':this[_0xd733('0x21')],'address':this[_0xd733('0xe')],'online':this['online'],'voiceStatus':this[_0xd733('0x1d')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xd733('0x14')],'voiceStatusQueue':this[_0xd733('0x15')],'interface':this[_0xd733('0x11')],'onhold':this['onhold']};var _0x327939=md5(JSON[_0xd733('0x22')](_0x5942f));if(this[_0xd733('0x17')]!==_0x327939){this['md5']=_0x327939;io['to'](util[_0xd733('0x23')](_0xd733('0x24'),_0x5942f[_0xd733('0x8')]))[_0xd733('0x25')]('user:save',_0x5942f);}};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 84bed2f..6567123 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 _0xdea1=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xdea1,0x1f4));var _0x1dea=function(_0x5bbeda,_0x553478){_0x5bbeda=_0x5bbeda-0x0;var _0x25e459=_0xdea1[_0x5bbeda];return _0x25e459;};'use strict';function Campaign(_0x453ef6){this['id']=_0x453ef6['id']||0x0;this[_0x1dea('0x0')]=_0x453ef6[_0x1dea('0x0')]||'';this[_0x1dea('0x1')]=_0x453ef6['type']||_0x1dea('0x2');this[_0x1dea('0x3')]=0x0;this[_0x1dea('0x4')]=0x0;this[_0x1dea('0x5')]=0x0;this[_0x1dea('0x6')]=0x0;this['message']='';this[_0x1dea('0x7')]=!![];this[_0x1dea('0x8')]=_0x453ef6[_0x1dea('0x8')];this[_0x1dea('0x9')]=_0x453ef6[_0x1dea('0x9')];this[_0x1dea('0xa')]=_0x453ef6[_0x1dea('0xa')]||null;this[_0x1dea('0xb')]=_0x453ef6[_0x1dea('0xb')]?_0x453ef6[_0x1dea('0xb')]:null;this[_0x1dea('0xc')]=_0x453ef6[_0x1dea('0xc')];this[_0x1dea('0xd')]=_0x453ef6['dialOriginateCallerIdNumber'];this[_0x1dea('0xe')]=_0x453ef6[_0x1dea('0xe')]||0x1e;this[_0x1dea('0xf')]=_0x453ef6[_0x1dea('0xf')];this['dialCongestionRetryFrequency']=_0x453ef6[_0x1dea('0x10')];this[_0x1dea('0x11')]=_0x453ef6[_0x1dea('0x11')];this['dialBusyRetryFrequency']=_0x453ef6[_0x1dea('0x12')];this[_0x1dea('0x13')]=_0x453ef6[_0x1dea('0x13')];this[_0x1dea('0x14')]=_0x453ef6['dialNoAnswerRetryFrequency'];this[_0x1dea('0x15')]=_0x453ef6['dialGlobalMaxRetry'];this[_0x1dea('0x16')]=_0x453ef6[_0x1dea('0x16')]||0x3;this[_0x1dea('0x17')]=_0x453ef6[_0x1dea('0x17')]||0x96;this[_0x1dea('0x18')]=_0x453ef6[_0x1dea('0x18')]||0x3;this[_0x1dea('0x19')]=_0x453ef6[_0x1dea('0x19')]||0x96;this[_0x1dea('0x1a')]=_0x453ef6['dialAbandonedMaxRetry']||0x3;this[_0x1dea('0x1b')]=_0x453ef6[_0x1dea('0x1b')]||0x96;this[_0x1dea('0x1c')]=_0x453ef6[_0x1dea('0x1c')]||0x3;this[_0x1dea('0x1d')]=_0x453ef6[_0x1dea('0x1d')]||0x96;this[_0x1dea('0x1e')]=_0x453ef6[_0x1dea('0x1e')]||0x3;this[_0x1dea('0x1f')]=_0x453ef6[_0x1dea('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x453ef6[_0x1dea('0x20')]||_0x1dea('0x21');this[_0x1dea('0x22')]=_0x453ef6[_0x1dea('0x22')]||undefined;this[_0x1dea('0x23')]=_0x453ef6[_0x1dea('0x23')]||undefined;this[_0x1dea('0x24')]=_0x453ef6['dialCutDigit']||undefined;this['TrunkBackup']=_0x453ef6[_0x1dea('0x25')]?_0x453ef6[_0x1dea('0x25')]:undefined;this['Trunk']=_0x453ef6[_0x1dea('0x26')]?_0x453ef6['Trunk']:undefined;this['Interval']=_0x453ef6[_0x1dea('0x27')]?_0x453ef6['Interval']:undefined;this['SquareProject']=_0x453ef6[_0x1dea('0x28')]?_0x453ef6['SquareProject']:undefined;this['dialQueueProject']=_0x453ef6[_0x1dea('0x28')]?_0x453ef6[_0x1dea('0x28')][_0x1dea('0x0')]:undefined;this[_0x1dea('0x29')]=_0x453ef6[_0x1dea('0x29')]||![];this[_0x1dea('0x2a')]=_0x453ef6[_0x1dea('0x2a')];this['dialAMDGreeting']=_0x453ef6[_0x1dea('0x2b')];this['dialAMDAfterGreetingSilence']=_0x453ef6[_0x1dea('0x2c')];this[_0x1dea('0x2d')]=_0x453ef6[_0x1dea('0x2d')];this[_0x1dea('0x2e')]=_0x453ef6[_0x1dea('0x2e')];this[_0x1dea('0x2f')]=_0x453ef6[_0x1dea('0x2f')];this[_0x1dea('0x30')]=_0x453ef6[_0x1dea('0x30')];this[_0x1dea('0x31')]=_0x453ef6['dialAMDSilenceThreshold'];this[_0x1dea('0x32')]=_0x453ef6['dialAMDMaximumWordLength'];}module[_0x1dea('0x33')]=Campaign; \ No newline at end of file +var _0xde29=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','campaign','originated','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xde29,0xe9));var _0x9de2=function(_0x46b413,_0x5ec5aa){_0x46b413=_0x46b413-0x0;var _0x4eed19=_0xde29[_0x46b413];return _0x4eed19;};'use strict';function Campaign(_0x20c7e8){this['id']=_0x20c7e8['id']||0x0;this['name']=_0x20c7e8['name']||'';this['type']=_0x20c7e8['type']||_0x9de2('0x0');this[_0x9de2('0x1')]=0x0;this[_0x9de2('0x2')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x9de2('0x3')]='';this[_0x9de2('0x4')]=!![];this[_0x9de2('0x5')]=_0x20c7e8[_0x9de2('0x5')];this[_0x9de2('0x6')]=_0x20c7e8[_0x9de2('0x6')];this[_0x9de2('0x7')]=_0x20c7e8[_0x9de2('0x7')]||null;this[_0x9de2('0x8')]=_0x20c7e8['dialGlobalInterval']?_0x20c7e8['dialGlobalInterval']:null;this[_0x9de2('0x9')]=_0x20c7e8[_0x9de2('0x9')];this[_0x9de2('0xa')]=_0x20c7e8[_0x9de2('0xa')];this[_0x9de2('0xb')]=_0x20c7e8['dialOriginateTimeout']||0x1e;this[_0x9de2('0xc')]=_0x20c7e8[_0x9de2('0xc')];this['dialCongestionRetryFrequency']=_0x20c7e8[_0x9de2('0xd')];this[_0x9de2('0xe')]=_0x20c7e8['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x20c7e8[_0x9de2('0xf')];this[_0x9de2('0x10')]=_0x20c7e8[_0x9de2('0x10')];this[_0x9de2('0x11')]=_0x20c7e8[_0x9de2('0x11')];this[_0x9de2('0x12')]=_0x20c7e8[_0x9de2('0x12')];this[_0x9de2('0x13')]=_0x20c7e8[_0x9de2('0x13')]||0x3;this[_0x9de2('0x14')]=_0x20c7e8[_0x9de2('0x14')]||0x96;this[_0x9de2('0x15')]=_0x20c7e8[_0x9de2('0x15')]||0x3;this[_0x9de2('0x16')]=_0x20c7e8[_0x9de2('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x20c7e8[_0x9de2('0x17')]||0x3;this[_0x9de2('0x18')]=_0x20c7e8[_0x9de2('0x18')]||0x96;this[_0x9de2('0x19')]=_0x20c7e8[_0x9de2('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x20c7e8[_0x9de2('0x1a')]||0x96;this[_0x9de2('0x1b')]=_0x20c7e8[_0x9de2('0x1b')]||0x3;this[_0x9de2('0x1c')]=_0x20c7e8[_0x9de2('0x1c')]||0x96;this[_0x9de2('0x1d')]=_0x20c7e8['dialOrderByScheduledAt']||_0x9de2('0x1e');this['dialPrefix']=_0x20c7e8['dialPrefix']||undefined;this[_0x9de2('0x1f')]=_0x20c7e8[_0x9de2('0x1f')]||undefined;this[_0x9de2('0x20')]=_0x20c7e8[_0x9de2('0x20')]||undefined;this[_0x9de2('0x21')]=_0x20c7e8[_0x9de2('0x21')]?_0x20c7e8['TrunkBackup']:undefined;this[_0x9de2('0x22')]=_0x20c7e8[_0x9de2('0x22')]?_0x20c7e8[_0x9de2('0x22')]:undefined;this[_0x9de2('0x23')]=_0x20c7e8[_0x9de2('0x23')]?_0x20c7e8[_0x9de2('0x23')]:undefined;this[_0x9de2('0x24')]=_0x20c7e8[_0x9de2('0x24')]?_0x20c7e8[_0x9de2('0x24')]:undefined;this[_0x9de2('0x25')]=_0x20c7e8[_0x9de2('0x24')]?_0x20c7e8[_0x9de2('0x24')]['name']:undefined;this[_0x9de2('0x26')]=_0x20c7e8['dialAMDActive']||![];this[_0x9de2('0x27')]=_0x20c7e8[_0x9de2('0x27')];this[_0x9de2('0x28')]=_0x20c7e8[_0x9de2('0x28')];this[_0x9de2('0x29')]=_0x20c7e8['dialAMDAfterGreetingSilence'];this[_0x9de2('0x2a')]=_0x20c7e8[_0x9de2('0x2a')];this[_0x9de2('0x2b')]=_0x20c7e8[_0x9de2('0x2b')];this[_0x9de2('0x2c')]=_0x20c7e8['dialAMDBetweenWordsSilence'];this[_0x9de2('0x2d')]=_0x20c7e8[_0x9de2('0x2d')];this[_0x9de2('0x2e')]=_0x20c7e8[_0x9de2('0x2e')];this[_0x9de2('0x2f')]=_0x20c7e8[_0x9de2('0x2f')];}module[_0x9de2('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index f0a86d0..c05fc92 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 _0xb0d2=['transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xb0d2,0x1b4));var _0x2b0d=function(_0x54308d,_0xff1ca4){_0x54308d=_0x54308d-0x0;var _0x4b88e2=_0xb0d2[_0x54308d];return _0x4b88e2;};'use strict';function Channel(){this[_0x2b0d('0x0')]=null;this['channel']='';this[_0x2b0d('0x1')]='';this[_0x2b0d('0x2')]=0x0;this[_0x2b0d('0x3')]='';this['connectedlinenum']=undefined;this[_0x2b0d('0x4')]=undefined;this[_0x2b0d('0x5')]=0x0;this[_0x2b0d('0x6')]='';this[_0x2b0d('0x7')]=0x0;this[_0x2b0d('0x8')]=0x0;this['exten']=0x0;this[_0x2b0d('0x9')]=![];this[_0x2b0d('0xa')]=null;this[_0x2b0d('0xb')]=null;this[_0x2b0d('0xc')]=![];this[_0x2b0d('0xd')]=![];this[_0x2b0d('0xe')]='';this[_0x2b0d('0xf')]='';this[_0x2b0d('0x10')]=0x0;this[_0x2b0d('0x11')]=0x0;this[_0x2b0d('0x12')]=0x0;this['type']=null;this[_0x2b0d('0x13')]=null;this['disposition']=null;this[_0x2b0d('0x14')]=![];this[_0x2b0d('0x15')]=null;this[_0x2b0d('0x16')]=null;this['monitors']=[];this[_0x2b0d('0x17')]=undefined;this[_0x2b0d('0x18')]=undefined;this[_0x2b0d('0x19')]=0x0;}module[_0x2b0d('0x1a')]=Channel; \ No newline at end of file +var _0xd9b4=['unmanaged','abandoned','lastapplication','duration','holdtime','disposition','monitorFilename','queue','transfercalleridnum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','answered','answertime','endtime'];(function(_0x100d5d,_0x14a6dd){var _0x5a0b5a=function(_0x24ebb8){while(--_0x24ebb8){_0x100d5d['push'](_0x100d5d['shift']());}};_0x5a0b5a(++_0x14a6dd);}(_0xd9b4,0x1c0));var _0x4d9b=function(_0x89c6ce,_0x41dbf7){_0x89c6ce=_0x89c6ce-0x0;var _0x564ec1=_0xd9b4[_0x89c6ce];return _0x564ec1;};'use strict';function Channel(){this[_0x4d9b('0x0')]=null;this[_0x4d9b('0x1')]='';this[_0x4d9b('0x2')]='';this[_0x4d9b('0x3')]=0x0;this[_0x4d9b('0x4')]='';this[_0x4d9b('0x5')]=undefined;this[_0x4d9b('0x6')]=undefined;this[_0x4d9b('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x4d9b('0x8')]=0x0;this['exten']=0x0;this[_0x4d9b('0x9')]=![];this[_0x4d9b('0xa')]=null;this[_0x4d9b('0xb')]=null;this[_0x4d9b('0xc')]=![];this[_0x4d9b('0xd')]=![];this[_0x4d9b('0xe')]='';this['lastdata']='';this[_0x4d9b('0xf')]=0x0;this['billableseconds']=0x0;this[_0x4d9b('0x10')]=0x0;this['type']=null;this['tag']=null;this[_0x4d9b('0x11')]=null;this['monitor']=![];this[_0x4d9b('0x12')]=null;this[_0x4d9b('0x13')]=null;this['monitors']=[];this[_0x4d9b('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4d9b('0x15')]=0x0;}module[_0x4d9b('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 37bd268..8f867fe 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 _0xd6d2=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x8ccb99,_0x1568ea){var _0x3f0f26=function(_0x19757b){while(--_0x19757b){_0x8ccb99['push'](_0x8ccb99['shift']());}};_0x3f0f26(++_0x1568ea);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x158003,_0x2f94c8){_0x158003=_0x158003-0x0;var _0x5dd1fe=_0xd6d2[_0x158003];return _0x5dd1fe;};'use strict';function DeskAccount(_0x627178){this['id']=_0x627178['id']||0x0;this[_0x2d6d('0x0')]=_0x627178['name']||'';this[_0x2d6d('0x1')]=_0x627178[_0x2d6d('0x1')]||'';this['remoteUri']=_0x627178[_0x2d6d('0x2')]||'';this['authType']=_0x627178[_0x2d6d('0x3')]||'';this[_0x2d6d('0x4')]=_0x627178[_0x2d6d('0x4')]||'';this['consumerKey']=_0x627178[_0x2d6d('0x5')]||'';this[_0x2d6d('0x6')]=_0x627178[_0x2d6d('0x6')]||'';this[_0x2d6d('0x7')]=_0x627178[_0x2d6d('0x7')]||'';this[_0x2d6d('0x8')]=_0x627178[_0x2d6d('0x8')]||'';this[_0x2d6d('0x9')]=_0x627178[_0x2d6d('0x9')]||'';this[_0x2d6d('0xa')]=_0x627178[_0x2d6d('0xa')]||'';this['Configurations']=_0x627178[_0x2d6d('0xb')]||{};}module[_0x2d6d('0xc')]=DeskAccount; \ No newline at end of file +var _0xdc03=['token','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdc03,0x65));var _0x3dc0=function(_0x249a58,_0x4558ba){_0x249a58=_0x249a58-0x0;var _0x2c00fb=_0xdc03[_0x249a58];return _0x2c00fb;};'use strict';function DeskAccount(_0x3e6545){this['id']=_0x3e6545['id']||0x0;this['name']=_0x3e6545[_0x3dc0('0x0')]||'';this[_0x3dc0('0x1')]=_0x3e6545['username']||'';this[_0x3dc0('0x2')]=_0x3e6545[_0x3dc0('0x2')]||'';this[_0x3dc0('0x3')]=_0x3e6545[_0x3dc0('0x3')]||'';this[_0x3dc0('0x4')]=_0x3e6545[_0x3dc0('0x4')]||'';this['consumerKey']=_0x3e6545[_0x3dc0('0x5')]||'';this[_0x3dc0('0x6')]=_0x3e6545[_0x3dc0('0x6')]||'';this['token']=_0x3e6545[_0x3dc0('0x7')]||'';this['tokenSecret']=_0x3e6545['tokenSecret']||'';this['type']=_0x3e6545[_0x3dc0('0x8')]||'';this[_0x3dc0('0x9')]=_0x3e6545[_0x3dc0('0x9')]||'';this[_0x3dc0('0xa')]=_0x3e6545[_0x3dc0('0xa')]||{};}module[_0x3dc0('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 0d9bb5a..c436e65 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 _0x914c=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x914c,0xcd));var _0xc914=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0x914c[_0x5decec];return _0x35e1b4;};'use strict';function Dynamics365Account(_0x58d2f7){this['id']=_0x58d2f7['id']||0x0;this[_0xc914('0x0')]=_0x58d2f7[_0xc914('0x0')]||'';this[_0xc914('0x1')]=_0x58d2f7['username']||'';this[_0xc914('0x2')]=_0x58d2f7[_0xc914('0x2')]||'';this[_0xc914('0x3')]=_0x58d2f7['remoteUri']||'';this[_0xc914('0x4')]=_0x58d2f7[_0xc914('0x4')]||'';this[_0xc914('0x5')]=_0x58d2f7[_0xc914('0x5')]||'';this['clientSecret']=_0x58d2f7[_0xc914('0x6')]||{};this['serverUrl']=_0x58d2f7[_0xc914('0x7')]||'';this[_0xc914('0x8')]=_0x58d2f7[_0xc914('0x8')]||{};}module[_0xc914('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x1edb=['exports','name','username','remoteUri','tenantId','clientId','serverUrl','Configurations'];(function(_0x5599b4,_0x496915){var _0xc28015=function(_0x35f720){while(--_0x35f720){_0x5599b4['push'](_0x5599b4['shift']());}};_0xc28015(++_0x496915);}(_0x1edb,0x189));var _0xb1ed=function(_0x59258c,_0xea283){_0x59258c=_0x59258c-0x0;var _0x21a95c=_0x1edb[_0x59258c];return _0x21a95c;};'use strict';function Dynamics365Account(_0x333754){this['id']=_0x333754['id']||0x0;this[_0xb1ed('0x0')]=_0x333754[_0xb1ed('0x0')]||'';this['username']=_0x333754[_0xb1ed('0x1')]||'';this['password']=_0x333754['password']||'';this[_0xb1ed('0x2')]=_0x333754[_0xb1ed('0x2')]||'';this[_0xb1ed('0x3')]=_0x333754[_0xb1ed('0x3')]||'';this[_0xb1ed('0x4')]=_0x333754[_0xb1ed('0x4')]||'';this['clientSecret']=_0x333754['clientSecret']||{};this[_0xb1ed('0x5')]=_0x333754[_0xb1ed('0x5')]||'';this[_0xb1ed('0x6')]=_0x333754[_0xb1ed('0x6')]||{};}module[_0xb1ed('0x7')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 710a18d..e3f9f31 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 _0x0626=['description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x5bfa94,_0x5cebe2){var _0x240d7f=function(_0x774e1e){while(--_0x774e1e){_0x5bfa94['push'](_0x5bfa94['shift']());}};_0x240d7f(++_0x5cebe2);}(_0x0626,0x1ef));var _0x6062=function(_0x26109e,_0x23a438){_0x26109e=_0x26109e-0x0;var _0x4e29be=_0x0626[_0x26109e];return _0x4e29be;};'use strict';function FaxAccount(_0x58f44d){this['id']=_0x58f44d['id']||0x0;this[_0x6062('0x0')]=_0x58f44d[_0x6062('0x0')]||'';this[_0x6062('0x1')]=_0x58f44d[_0x6062('0x1')];this[_0x6062('0x2')]=_0x58f44d[_0x6062('0x2')];this['headerinfo']=_0x58f44d['headerinfo'];this[_0x6062('0x3')]=_0x58f44d['localstationid'];this[_0x6062('0x4')]=_0x58f44d[_0x6062('0x4')]||0x960;this[_0x6062('0x5')]=_0x58f44d[_0x6062('0x5')]||0x3840;this['modem']=_0x58f44d[_0x6062('0x6')]||'v17,v27,v29';this[_0x6062('0x7')]=_0x58f44d[_0x6062('0x7')]||'no';this[_0x6062('0x8')]=_0x58f44d[_0x6062('0x8')]||'no';this['t38timeout']=_0x58f44d[_0x6062('0x9')]||0x1388;this[_0x6062('0xa')]=_0x58f44d[_0x6062('0xa')]||_0x6062('0xb');this[_0x6062('0xc')]=_0x58f44d[_0x6062('0xc')]?_0x58f44d[_0x6062('0xc')]:undefined;this[_0x6062('0xd')]=_0x58f44d[_0x6062('0xd')];this[_0x6062('0xe')]=_0x58f44d[_0x6062('0xe')];}module[_0x6062('0xf')]=FaxAccount; \ No newline at end of file +var _0x6df9=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x5e9c85,_0x461674){var _0xcbdcf7=function(_0x2680d9){while(--_0x2680d9){_0x5e9c85['push'](_0x5e9c85['shift']());}};_0xcbdcf7(++_0x461674);}(_0x6df9,0x84));var _0x96df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6df9[_0x4b369d];return _0x571a98;};'use strict';function FaxAccount(_0x3e612e){this['id']=_0x3e612e['id']||0x0;this[_0x96df('0x0')]=_0x3e612e['name']||'';this[_0x96df('0x1')]=_0x3e612e['description'];this['ecm']=_0x3e612e[_0x96df('0x2')];this['headerinfo']=_0x3e612e[_0x96df('0x3')];this['localstationid']=_0x3e612e[_0x96df('0x4')];this['minrate']=_0x3e612e[_0x96df('0x5')]||0x960;this[_0x96df('0x6')]=_0x3e612e['maxrate']||0x3840;this[_0x96df('0x7')]=_0x3e612e[_0x96df('0x7')]||_0x96df('0x8');this[_0x96df('0x9')]=_0x3e612e['gateway']||'no';this[_0x96df('0xa')]=_0x3e612e[_0x96df('0xa')]||'no';this['t38timeout']=_0x3e612e[_0x96df('0xb')]||0x1388;this['tech']=_0x3e612e[_0x96df('0xc')]||'SIP';this['Trunk']=_0x3e612e['Trunk']?_0x3e612e[_0x96df('0xd')]:undefined;this[_0x96df('0xe')]=_0x3e612e[_0x96df('0xe')];this[_0x96df('0xf')]=_0x3e612e[_0x96df('0xf')];}module[_0x96df('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index e0f1357..516d12f 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 _0x8efb=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8efb,0x191));var _0xb8ef=function(_0xac6926,_0x1db50b){_0xac6926=_0xac6926-0x0;var _0x14b67f=_0x8efb[_0xac6926];return _0x14b67f;};'use strict';function FreshdeskAccount(_0x4d9b92){this['id']=_0x4d9b92['id']||0x0;this[_0xb8ef('0x0')]=_0x4d9b92['name']||'';this['username']=_0x4d9b92[_0xb8ef('0x1')]||'';this[_0xb8ef('0x2')]=_0x4d9b92[_0xb8ef('0x3')]||'';this[_0xb8ef('0x4')]=_0x4d9b92['remoteUri']||'';this['serverUrl']=_0x4d9b92[_0xb8ef('0x5')]||'';this['Configurations']=_0x4d9b92[_0xb8ef('0x6')]||{};}module[_0xb8ef('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xf838=['token','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf838,0xcf));var _0x8f83=function(_0x1d35c0,_0x33ae83){_0x1d35c0=_0x1d35c0-0x0;var _0x2380da=_0xf838[_0x1d35c0];return _0x2380da;};'use strict';function FreshdeskAccount(_0x11fa2b){this['id']=_0x11fa2b['id']||0x0;this[_0x8f83('0x0')]=_0x11fa2b[_0x8f83('0x0')]||'';this[_0x8f83('0x1')]=_0x11fa2b[_0x8f83('0x1')]||'';this[_0x8f83('0x2')]=_0x11fa2b[_0x8f83('0x3')]||'';this['remoteUri']=_0x11fa2b['remoteUri']||'';this[_0x8f83('0x4')]=_0x11fa2b[_0x8f83('0x4')]||'';this[_0x8f83('0x5')]=_0x11fa2b[_0x8f83('0x5')]||{};}module[_0x8f83('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 92f0e18..3345079 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 _0xbde4=['exports','name','username','apiKey','token','Configurations'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xbde4,0x1a5));var _0x4bde=function(_0x3f76ab,_0x593837){_0x3f76ab=_0x3f76ab-0x0;var _0xcb666f=_0xbde4[_0x3f76ab];return _0xcb666f;};'use strict';function FreshsalesAccount(_0x14a306){this['id']=_0x14a306['id']||0x0;this[_0x4bde('0x0')]=_0x14a306[_0x4bde('0x0')]||'';this[_0x4bde('0x1')]=_0x14a306[_0x4bde('0x1')]||'';this[_0x4bde('0x2')]=_0x14a306[_0x4bde('0x3')]||'';this['remoteUri']=_0x14a306['remoteUri']||'';this['serverUrl']=_0x14a306['serverUrl']||'';this['Configurations']=_0x14a306[_0x4bde('0x4')]||{};}module[_0x4bde('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x3cda=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x387551,_0x5883a6){var _0x4b5c97=function(_0x15c094){while(--_0x15c094){_0x387551['push'](_0x387551['shift']());}};_0x4b5c97(++_0x5883a6);}(_0x3cda,0x15e));var _0xa3cd=function(_0x3cb5f1,_0x48c50e){_0x3cb5f1=_0x3cb5f1-0x0;var _0x31d0c9=_0x3cda[_0x3cb5f1];return _0x31d0c9;};'use strict';function FreshsalesAccount(_0x10f5cd){this['id']=_0x10f5cd['id']||0x0;this['name']=_0x10f5cd[_0xa3cd('0x0')]||'';this[_0xa3cd('0x1')]=_0x10f5cd[_0xa3cd('0x1')]||'';this[_0xa3cd('0x2')]=_0x10f5cd[_0xa3cd('0x3')]||'';this[_0xa3cd('0x4')]=_0x10f5cd[_0xa3cd('0x4')]||'';this[_0xa3cd('0x5')]=_0x10f5cd[_0xa3cd('0x5')]||'';this[_0xa3cd('0x6')]=_0x10f5cd[_0xa3cd('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 2e9df2b..9e88e0b 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 _0x363f=['originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallerexit'];(function(_0x33be02,_0x1cca56){var _0x4f8de0=function(_0x3ba5a0){while(--_0x3ba5a0){_0x33be02['push'](_0x33be02['shift']());}};_0x4f8de0(++_0x1cca56);}(_0x363f,0x13f));var _0xf363=function(_0x539fa8,_0x334b54){_0x539fa8=_0x539fa8-0x0;var _0x4f90bc=_0x363f[_0x539fa8];return _0x4f90bc;};'use strict';function QueueReport(){this[_0xf363('0x0')]=_0xf363('0x1');this[_0xf363('0x2')]='';this[_0xf363('0x3')]='';this['calleridname']='';this[_0xf363('0x4')]='';this[_0xf363('0x5')]=null;this[_0xf363('0x6')]=null;this[_0xf363('0x7')]=0x1;this['count']=0x1;this[_0xf363('0x8')]=![];this['queuecallerabandonAt']=null;this[_0xf363('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xf363('0xa')]=![];this['queuecallerexitAt']=null;this[_0xf363('0xb')]=0x1;this[_0xf363('0xc')]='';this['connectedlinenum']='';this[_0xf363('0xd')]='';this['accountcode']='';this[_0xf363('0xe')]='';this[_0xf363('0xf')]='';this[_0xf363('0x10')]='';this[_0xf363('0x11')]=0x0;this[_0xf363('0x12')]=![];this['lastAssignedTo']='';this[_0xf363('0x13')]=0x0;this[_0xf363('0x14')]={};}module[_0xf363('0x15')]=QueueReport; \ No newline at end of file +var _0x69fc=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','priority','assigned','lastAssignedTo','mohtime','variables','exports','uniqueid','queuecallerjoinAt','queuecallerabandonAt','queuecallercomplete'];(function(_0x22a409,_0x1e7083){var _0x4ffcf0=function(_0x41b9b7){while(--_0x41b9b7){_0x22a409['push'](_0x22a409['shift']());}};_0x4ffcf0(++_0x1e7083);}(_0x69fc,0x1be));var _0xc69f=function(_0xc5aba7,_0x5147bc){_0xc5aba7=_0xc5aba7-0x0;var _0x364acf=_0x69fc[_0xc5aba7];return _0x364acf;};'use strict';function QueueReport(){this['type']='inbound';this[_0xc69f('0x0')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0xc69f('0x1')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xc69f('0x2')]=null;this[_0xc69f('0x3')]=![];this[_0xc69f('0x4')]=null;this[_0xc69f('0x5')]=![];this[_0xc69f('0x6')]=null;this['originalposition']=0x1;this[_0xc69f('0x7')]='';this[_0xc69f('0x8')]='';this[_0xc69f('0x9')]='';this['accountcode']='';this[_0xc69f('0xa')]='';this[_0xc69f('0xb')]='';this[_0xc69f('0xc')]='';this['holdtime']=0x0;this[_0xc69f('0xd')]=![];this[_0xc69f('0xe')]='';this[_0xc69f('0xf')]=0x0;this[_0xc69f('0x10')]={};}module[_0xc69f('0x11')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9869794..bbb5f3d 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 _0xb5e5=['password','clientSecret','securityToken','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb5e5,0x12f));var _0x5b5e=function(_0x33c602,_0x3b40a3){_0x33c602=_0x33c602-0x0;var _0x1be326=_0xb5e5[_0x33c602];return _0x1be326;};'use strict';function SalesforceAccount(_0x1f160a){this['id']=_0x1f160a['id']||0x0;this['name']=_0x1f160a[_0x5b5e('0x0')]||'';this[_0x5b5e('0x1')]=_0x1f160a[_0x5b5e('0x1')]||'';this[_0x5b5e('0x2')]=_0x1f160a['remoteUri']||'';this[_0x5b5e('0x3')]=_0x1f160a[_0x5b5e('0x3')]||'';this['clientId']=_0x1f160a['clientId']||'';this[_0x5b5e('0x4')]=_0x1f160a[_0x5b5e('0x4')]||'';this[_0x5b5e('0x5')]=_0x1f160a['securityToken']||'';this[_0x5b5e('0x6')]=_0x1f160a[_0x5b5e('0x6')]||'integrationTab';this[_0x5b5e('0x7')]=_0x1f160a[_0x5b5e('0x7')]||'';this[_0x5b5e('0x8')]=_0x1f160a[_0x5b5e('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xdeb3=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','username'];(function(_0x1c4183,_0x33fca6){var _0x52dba9=function(_0x43dc43){while(--_0x43dc43){_0x1c4183['push'](_0x1c4183['shift']());}};_0x52dba9(++_0x33fca6);}(_0xdeb3,0x15f));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'use strict';function SalesforceAccount(_0x1ddbc1){this['id']=_0x1ddbc1['id']||0x0;this['name']=_0x1ddbc1['name']||'';this[_0x3deb('0x0')]=_0x1ddbc1['username']||'';this[_0x3deb('0x1')]=_0x1ddbc1[_0x3deb('0x1')]||'';this[_0x3deb('0x2')]=_0x1ddbc1[_0x3deb('0x2')]||'';this[_0x3deb('0x3')]=_0x1ddbc1[_0x3deb('0x3')]||'';this['clientSecret']=_0x1ddbc1[_0x3deb('0x4')]||'';this[_0x3deb('0x5')]=_0x1ddbc1[_0x3deb('0x5')]||'';this[_0x3deb('0x6')]=_0x1ddbc1[_0x3deb('0x6')]||_0x3deb('0x7');this['serverUrl']=_0x1ddbc1[_0x3deb('0x8')]||'';this[_0x3deb('0x9')]=_0x1ddbc1[_0x3deb('0x9')]||{};}module[_0x3deb('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 97bb510..ae3e63a 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 _0x670e=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x670e,0x118));var _0xe670=function(_0x1fae38,_0x3d9fcc){_0x1fae38=_0x1fae38-0x0;var _0x244017=_0x670e[_0x1fae38];return _0x244017;};'use strict';function ServicenowAccount(_0x421085){this['id']=_0x421085['id']||0x0;this['name']=_0x421085[_0xe670('0x0')]||'';this[_0xe670('0x1')]=_0x421085[_0xe670('0x1')]||'';this[_0xe670('0x2')]=_0x421085[_0xe670('0x2')]||'';this[_0xe670('0x3')]=_0x421085[_0xe670('0x3')]||'';this[_0xe670('0x4')]=_0x421085[_0xe670('0x4')]||'';this[_0xe670('0x5')]=_0x421085[_0xe670('0x5')]||{};}module[_0xe670('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x006e=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x39640f,_0x167d4a){var _0x39c60c=function(_0x26f9b4){while(--_0x26f9b4){_0x39640f['push'](_0x39640f['shift']());}};_0x39c60c(++_0x167d4a);}(_0x006e,0x183));var _0xe006=function(_0x4a8fea,_0x4603f4){_0x4a8fea=_0x4a8fea-0x0;var _0x5e23a4=_0x006e[_0x4a8fea];return _0x5e23a4;};'use strict';function ServicenowAccount(_0x59e01e){this['id']=_0x59e01e['id']||0x0;this[_0xe006('0x0')]=_0x59e01e[_0xe006('0x0')]||'';this[_0xe006('0x1')]=_0x59e01e[_0xe006('0x1')]||'';this[_0xe006('0x2')]=_0x59e01e[_0xe006('0x2')]||'';this[_0xe006('0x3')]=_0x59e01e[_0xe006('0x3')]||'';this[_0xe006('0x4')]=_0x59e01e[_0xe006('0x4')]||'';this[_0xe006('0x5')]=_0x59e01e[_0xe006('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5ef97de..fbb98d1 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 _0x3e71=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x1683cf,_0x20b3cb){var _0x1159ad=function(_0x241e90){while(--_0x241e90){_0x1683cf['push'](_0x1683cf['shift']());}};_0x1159ad(++_0x20b3cb);}(_0x3e71,0x149));var _0x13e7=function(_0x100443,_0x18748a){_0x100443=_0x100443-0x0;var _0x5369e7=_0x3e71[_0x100443];return _0x5369e7;};'use strict';function SugarcrmAccount(_0x3f108b){this['id']=_0x3f108b['id']||0x0;this['name']=_0x3f108b[_0x13e7('0x0')]||'';this[_0x13e7('0x1')]=_0x3f108b[_0x13e7('0x1')]||'';this[_0x13e7('0x2')]=_0x3f108b[_0x13e7('0x2')]||'';this['remoteUri']=_0x3f108b[_0x13e7('0x3')]||'';this[_0x13e7('0x4')]=_0x3f108b[_0x13e7('0x4')]||'';this[_0x13e7('0x5')]=_0x3f108b[_0x13e7('0x5')]||{};}module[_0x13e7('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0581=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x0581,0x1ef));var _0x1058=function(_0x5448a9,_0x4764da){_0x5448a9=_0x5448a9-0x0;var _0x1924af=_0x0581[_0x5448a9];return _0x1924af;};'use strict';function SugarcrmAccount(_0x43e9ec){this['id']=_0x43e9ec['id']||0x0;this[_0x1058('0x0')]=_0x43e9ec[_0x1058('0x0')]||'';this[_0x1058('0x1')]=_0x43e9ec[_0x1058('0x1')]||'';this['password']=_0x43e9ec[_0x1058('0x2')]||'';this[_0x1058('0x3')]=_0x43e9ec[_0x1058('0x3')]||'';this[_0x1058('0x4')]=_0x43e9ec[_0x1058('0x4')]||'';this['Configurations']=_0x43e9ec[_0x1058('0x5')]||{};}module[_0x1058('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 b0af5b8..6dbb720 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 _0x10a8=['exports','name','accountcode','unknown','stateTime'];(function(_0x2f800c,_0x2a7f05){var _0x1268ca=function(_0x3cc49f){while(--_0x3cc49f){_0x2f800c['push'](_0x2f800c['shift']());}};_0x1268ca(++_0x2a7f05);}(_0x10a8,0x119));var _0x810a=function(_0x2e85cc,_0xc500b5){_0x2e85cc=_0x2e85cc-0x0;var _0x2adc53=_0x10a8[_0x2e85cc];return _0x2adc53;};'use strict';function Telephone(_0x4971c8){this['id']=_0x4971c8['id']||0x0;this[_0x810a('0x0')]=_0x4971c8[_0x810a('0x0')]||'';this['accountcode']=_0x4971c8[_0x810a('0x1')]||'';this['state']=_0x810a('0x2');this[_0x810a('0x3')]=0x0;this['status']=_0x810a('0x2');this['address']='';}module[_0x810a('0x4')]=Telephone; \ No newline at end of file +var _0xccf6=['state','unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xccf6,0xa6));var _0x6ccf=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xccf6[_0xbd08b4];return _0x314f1e;};'use strict';function Telephone(_0x495534){this['id']=_0x495534['id']||0x0;this[_0x6ccf('0x0')]=_0x495534['name']||'';this[_0x6ccf('0x1')]=_0x495534[_0x6ccf('0x1')]||'';this[_0x6ccf('0x2')]=_0x6ccf('0x3');this[_0x6ccf('0x4')]=0x0;this[_0x6ccf('0x5')]='unknown';this[_0x6ccf('0x6')]='';}module[_0x6ccf('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 9a58926..d349c1a 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 _0xa3b3=['name','html','exports'];(function(_0x5712d6,_0x240ceb){var _0x370a53=function(_0x4a0ddf){while(--_0x4a0ddf){_0x5712d6['push'](_0x5712d6['shift']());}};_0x370a53(++_0x240ceb);}(_0xa3b3,0x81));var _0x3a3b=function(_0x438a27,_0x2718fd){_0x438a27=_0x438a27-0x0;var _0x4e45dd=_0xa3b3[_0x438a27];return _0x4e45dd;};'use strict';function template(_0x188aba){this['id']=_0x188aba['id']||0x0;this[_0x3a3b('0x0')]=_0x188aba['name']||'';this[_0x3a3b('0x1')]=_0x188aba[_0x3a3b('0x1')]||'';}module[_0x3a3b('0x2')]=template; \ No newline at end of file +var _0x791d=['html','exports','name'];(function(_0x1ea5c5,_0x487bbb){var _0x3c085e=function(_0x933525){while(--_0x933525){_0x1ea5c5['push'](_0x1ea5c5['shift']());}};_0x3c085e(++_0x487bbb);}(_0x791d,0xe9));var _0xd791=function(_0x580720,_0x400faa){_0x580720=_0x580720-0x0;var _0x4bafcc=_0x791d[_0x580720];return _0x4bafcc;};'use strict';function template(_0x2676da){this['id']=_0x2676da['id']||0x0;this[_0xd791('0x0')]=_0x2676da[_0xd791('0x0')]||'';this[_0xd791('0x1')]=_0x2676da['html']||'';}module[_0xd791('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 5c88160..6d8d3ec 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(_0x19763d,_0xe6a0cf){var _0x22189a=function(_0x4dbabc){while(--_0x4dbabc){_0x19763d['push'](_0x19763d['shift']());}};_0x22189a(++_0xe6a0cf);}(_0x4b84,0x1cc));var _0x44b8=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x4b84[_0x487ab4];return _0x3bef77;};'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 _0x6aa7=['voice','status','AllConditions','Actions','exports','name','channel'];(function(_0x73536b,_0x17e09a){var _0xfd965f=function(_0x5486ea){while(--_0x5486ea){_0x73536b['push'](_0x73536b['shift']());}};_0xfd965f(++_0x17e09a);}(_0x6aa7,0x178));var _0x76aa=function(_0x43a387,_0x448932){_0x43a387=_0x43a387-0x0;var _0x1b8839=_0x6aa7[_0x43a387];return _0x1b8839;};'use strict';function Trigger(_0x8de1e4){this['id']=_0x8de1e4['id']||0x0;this['name']=_0x8de1e4[_0x76aa('0x0')]||'';this[_0x76aa('0x1')]=_0x8de1e4[_0x76aa('0x1')]||_0x76aa('0x2');this['status']=_0x8de1e4[_0x76aa('0x3')]||![];this[_0x76aa('0x4')]=_0x8de1e4[_0x76aa('0x4')]||[];this['AnyConditions']=_0x8de1e4['AnyConditions']||[];this[_0x76aa('0x5')]=_0x8de1e4['Actions']||[];}module[_0x76aa('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index cd5f83f..21ce719 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 _0xc833=['active','name','state','stateTime','unknown','registry','split','host','port','domainport','refresh'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xc833,0x1d9));var _0x3c83=function(_0x1a2c2a,_0x37e7c5){_0x1a2c2a=_0x1a2c2a-0x0;var _0x46eeb0=_0xc833[_0x1a2c2a];return _0x46eeb0;};'use strict';function Trunk(_0x40dc44){this['id']=_0x40dc44['id']||0x0;this['active']=_0x40dc44[_0x3c83('0x0')]||![];this[_0x3c83('0x1')]=_0x40dc44['name']||'';this[_0x3c83('0x2')]='unknown';this[_0x3c83('0x3')]=0x0;this['status']=_0x3c83('0x4');this[_0x3c83('0x5')]=_0x40dc44['registry']&&_0x40dc44[_0x3c83('0x5')]['indexOf'](':')?_0x40dc44['registry'][_0x3c83('0x6')](':')[0x0]:'';this[_0x3c83('0x7')]='';this[_0x3c83('0x8')]='';this['domain']='';this[_0x3c83('0x9')]='';this[_0x3c83('0xa')]='';this['stateRegistry']='unknown';this['registrationtime']='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0x8b7a=['indexOf','split','host','port','domainport','refresh','stateRegistry','unknown','exports','active','name','stateTime','status','registry'];(function(_0x50fc27,_0x1b82f6){var _0x3503d2=function(_0xeeab34){while(--_0xeeab34){_0x50fc27['push'](_0x50fc27['shift']());}};_0x3503d2(++_0x1b82f6);}(_0x8b7a,0x1f3));var _0xa8b7=function(_0x1929cd,_0x8b0d6a){_0x1929cd=_0x1929cd-0x0;var _0x48c29f=_0x8b7a[_0x1929cd];return _0x48c29f;};'use strict';function Trunk(_0x331cbd){this['id']=_0x331cbd['id']||0x0;this[_0xa8b7('0x0')]=_0x331cbd['active']||![];this[_0xa8b7('0x1')]=_0x331cbd['name']||'';this['state']='unknown';this[_0xa8b7('0x2')]=0x0;this[_0xa8b7('0x3')]='unknown';this[_0xa8b7('0x4')]=_0x331cbd[_0xa8b7('0x4')]&&_0x331cbd[_0xa8b7('0x4')][_0xa8b7('0x5')](':')?_0x331cbd[_0xa8b7('0x4')][_0xa8b7('0x6')](':')[0x0]:'';this[_0xa8b7('0x7')]='';this[_0xa8b7('0x8')]='';this['domain']='';this[_0xa8b7('0x9')]='';this[_0xa8b7('0xa')]='';this[_0xa8b7('0xb')]=_0xa8b7('0xc');this['registrationtime']='';this['address']='';}module[_0xa8b7('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 485c090..9daf012 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 _0xbe4b=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x57e37a,_0x1d64b4){var _0x4ed71c=function(_0xb8c843){while(--_0xb8c843){_0x57e37a['push'](_0x57e37a['shift']());}};_0x4ed71c(++_0x1d64b4);}(_0xbe4b,0x1cf));var _0xbbe4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbe4b[_0x465a0c];return _0x1e202e;};'use strict';function voiceExtension(_0x18bd58){this['id']=_0x18bd58['id']||0x0;this[_0xbbe4('0x0')]=_0x18bd58[_0xbbe4('0x0')]||'';this[_0xbbe4('0x1')]=_0x18bd58['recordingFormat']||'none';this['mandatoryDisposition']=_0x18bd58[_0xbbe4('0x2')]||![];}module[_0xbbe4('0x3')]=voiceExtension; \ No newline at end of file +var _0xed66=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x570716,_0x23569e){var _0x1b3125=function(_0x196f84){while(--_0x196f84){_0x570716['push'](_0x570716['shift']());}};_0x1b3125(++_0x23569e);}(_0xed66,0x184));var _0x6ed6=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xed66[_0x4bd950];return _0x5dc59a;};'use strict';function voiceExtension(_0x22fbf4){this['id']=_0x22fbf4['id']||0x0;this[_0x6ed6('0x0')]=_0x22fbf4[_0x6ed6('0x0')]||'';this[_0x6ed6('0x1')]=_0x22fbf4[_0x6ed6('0x1')]||'none';this['mandatoryDisposition']=_0x22fbf4[_0x6ed6('0x2')]||![];}module[_0x6ed6('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ced4ae2..801def5 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 _0x13c3=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','unavailable','ringinuse','onhold','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','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','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls'];(function(_0x11b3f4,_0x371c17){var _0x47af1d=function(_0x11d38d){while(--_0x11d38d){_0x11b3f4['push'](_0x11b3f4['shift']());}};_0x47af1d(++_0x371c17);}(_0x13c3,0x81));var _0x313c=function(_0x5228a8,_0x11a1a4){_0x5228a8=_0x5228a8-0x0;var _0x4b99a3=_0x13c3[_0x5228a8];return _0x4b99a3;};'use strict';var statusDesc=['unknown',_0x313c('0x0'),_0x313c('0x1'),'busy','invalid',_0x313c('0x2'),'ringing',_0x313c('0x3'),_0x313c('0x4')];var monitorFormat={'wav':'wav','wav49':_0x313c('0x5'),'gsm':'gsm'};var strategy={'rrmemory':_0x313c('0x6'),'roundrobin':_0x313c('0x7')};function VoiceQueue(_0x166c66){this['id']=_0x166c66['id']||0x0;this[_0x313c('0x8')]=_0x166c66['name']||'';this[_0x313c('0x9')]=_0x166c66[_0x313c('0x9')]||'';this[_0x313c('0xa')]=_0x166c66[_0x313c('0xa')]||_0x313c('0xb');this[_0x313c('0xc')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0x313c('0xd')]=0x0;this['sumDuration']=0x0;this[_0x313c('0xe')]=0x0;this[_0x313c('0xf')]=0x0;this[_0x313c('0x10')]=0x0;this[_0x313c('0x11')]=0x0;this['loggedIn']=0x0;this[_0x313c('0x12')]=0x0;this[_0x313c('0x13')]=_0x166c66[_0x313c('0x13')]||![];this['acwTimeout']=_0x166c66['acwTimeout']||0xa;this[_0x313c('0x14')]=_0x166c66[_0x313c('0x14')]||'no';this[_0x313c('0x15')]=!![];this[_0x313c('0x16')]='';this[_0x313c('0x17')]=0x0;this[_0x313c('0x18')]=0x0;this[_0x313c('0x19')]=_0x166c66[_0x313c('0x19')]||null;this[_0x313c('0x1a')]=_0x166c66['dialGlobalInterval']?_0x166c66[_0x313c('0x1a')]:null;this[_0x313c('0x1b')]=_0x166c66[_0x313c('0x1b')];this[_0x313c('0x1c')]=_0x166c66[_0x313c('0x1c')]||_0x313c('0x1d');this['dialLimitChannel']=_0x166c66['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x166c66[_0x313c('0x1e')]||0x0;this['dialPowerLevel']=_0x166c66[_0x313c('0x1f')]||0x1;this[_0x313c('0x20')]=_0x166c66[_0x313c('0x20')]||_0x313c('0x21');this['dialPredictiveOptimizationPercentage']=_0x166c66['dialPredictiveOptimizationPercentage']||0.03;this[_0x313c('0x22')]=_0x166c66[_0x313c('0x22')]||0x258;this[_0x313c('0x23')]=_0x166c66['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x166c66[_0x313c('0x24')]||_0x313c('0x25');this[_0x313c('0x26')]=_0x166c66[_0x313c('0x26')]||0x1e;this[_0x313c('0x27')]=_0x166c66[_0x313c('0x27')]||'tTxX';this[_0x313c('0x28')]=_0x166c66[_0x313c('0x28')]||0x3;this['dialQueueProject']=_0x166c66['dialQueueProject']||undefined;this[_0x313c('0x29')]=_0x166c66['dialCongestionMaxRetry']||0x3;this[_0x313c('0x2a')]=_0x166c66[_0x313c('0x2a')]||0x96;this['dialBusyMaxRetry']=_0x166c66['dialBusyMaxRetry']||0x3;this[_0x313c('0x2b')]=_0x166c66[_0x313c('0x2b')]||0x96;this[_0x313c('0x2c')]=_0x166c66[_0x313c('0x2c')]||0x3;this[_0x313c('0x2d')]=_0x166c66['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x166c66['dialNoSuchNumberMaxRetry']||0x3;this[_0x313c('0x2e')]=_0x166c66[_0x313c('0x2e')]||0x96;this[_0x313c('0x2f')]=_0x166c66['dialDropMaxRetry']||0x3;this[_0x313c('0x30')]=_0x166c66['dialDropRetryFrequency']||0x96;this[_0x313c('0x31')]=_0x166c66['dialAbandonedMaxRetry']||0x3;this[_0x313c('0x32')]=_0x166c66[_0x313c('0x32')]||0x96;this[_0x313c('0x33')]=_0x166c66[_0x313c('0x33')]||0x3;this[_0x313c('0x34')]=_0x166c66['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x166c66[_0x313c('0x35')]||0x3;this[_0x313c('0x36')]=_0x166c66[_0x313c('0x36')]||0x96;this['dialGlobalMaxRetry']=_0x166c66[_0x313c('0x37')]||0x4;this[_0x313c('0x38')]=_0x166c66[_0x313c('0x38')]?_0x166c66['Trunk']:undefined;this[_0x313c('0x39')]=_0x166c66[_0x313c('0x39')]?_0x166c66[_0x313c('0x39')]:undefined;this[_0x313c('0x3a')]=_0x166c66[_0x313c('0x3a')]||undefined;this[_0x313c('0x3b')]=_0x166c66[_0x313c('0x3b')]?_0x166c66['Interval']:undefined;this[_0x313c('0x3c')]=_0x166c66[_0x313c('0x3c')]||_0x313c('0x3d');this['dialRandomLastDigitCallerIdNumber']=_0x166c66[_0x313c('0x3e')]||undefined;this[_0x313c('0x3f')]=_0x166c66[_0x313c('0x3f')]||undefined;this[_0x313c('0x40')]=strategy[_0x166c66['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x166c66[_0x313c('0x41')]||![];this[_0x313c('0x42')]=_0x166c66[_0x313c('0x42')];this['dialAMDGreeting']=_0x166c66[_0x313c('0x43')];this[_0x313c('0x44')]=_0x166c66[_0x313c('0x44')];this[_0x313c('0x45')]=_0x166c66['dialAMDTotalAnalysisTime'];this[_0x313c('0x46')]=_0x166c66[_0x313c('0x46')];this[_0x313c('0x47')]=_0x166c66[_0x313c('0x47')];this['dialAMDMaximumNumberOfWords']=_0x166c66[_0x313c('0x48')];this[_0x313c('0x49')]=_0x166c66[_0x313c('0x49')];this[_0x313c('0x4a')]=_0x166c66[_0x313c('0x4a')];this[_0x313c('0x4b')]=0x0;this['pTalking']=0x0;this[_0x313c('0x4c')]=_0x166c66[_0x313c('0x4c')];this[_0x313c('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x313c('0x4e')]=0x0;this[_0x313c('0x4f')]=0x0;this[_0x313c('0x50')]=0x0;this[_0x313c('0x51')]=0x0;this[_0x313c('0x52')]=0x0;this[_0x313c('0x53')]=0x0;this[_0x313c('0x54')]=0x0;this[_0x313c('0x55')]=0x0;this[_0x313c('0x56')]=0x0;this[_0x313c('0x57')]=0x0;this[_0x313c('0x58')]=0x0;this[_0x313c('0x59')]=0x0;this[_0x313c('0x5a')]=undefined;this['startPredictive']=undefined;this[_0x313c('0x5b')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x313c('0x5c')]=0x0;this[_0x313c('0x5d')]=0x0;this[_0x313c('0x5e')]=0x0;this[_0x313c('0x5f')]=0x0;this[_0x313c('0x60')]=0x0;this[_0x313c('0x61')]=0x0;this[_0x313c('0x62')]=0x0;this[_0x313c('0x63')]=0x0;this[_0x313c('0x64')]=_0x166c66[_0x313c('0x65')]||0x14;this['predictiveIntervalMinThreshold']=_0x166c66[_0x313c('0x65')]||0xa;this[_0x313c('0x66')]=0x0;this[_0x313c('0x67')]=0x0;this[_0x313c('0x68')]=0x1;this[_0x313c('0x69')]=0x0;this['erlangCallToSecond']=0x0;this[_0x313c('0x6a')]=0x0;this[_0x313c('0x6b')]=0x0;this[_0x313c('0x6c')]=_0x166c66[_0x313c('0x6c')]||0x1e;this[_0x313c('0x6d')]=_0x166c66['dialRecallInQueue']||![];this[_0x313c('0x6e')]=_0x166c66['dialQueueProject2']||undefined;this[_0x313c('0x6f')]=_0x166c66['dialAgiAfterHangupClient']||![];this[_0x313c('0x70')]=_0x166c66[_0x313c('0x70')]||![];this[_0x313c('0x9')]=monitorFormat[_0x166c66[_0x313c('0x9')]]?monitorFormat[_0x166c66[_0x313c('0x9')]]:undefined;this[_0x313c('0x71')]=_0x166c66[_0x313c('0x71')]||![];this[_0x313c('0x72')]=_0x166c66[_0x313c('0x72')]?_0x166c66[_0x313c('0x72')]:undefined;}module[_0x313c('0x73')]=VoiceQueue; \ No newline at end of file +var _0x7d75=['dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','wav','wav49','gsm','roundrobin','name','monitor_format','type','talking','total','sumHoldTime','sumBillable','unmanaged','acw','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x2c3142,_0x109e26){var _0x132a81=function(_0x54077c){while(--_0x54077c){_0x2c3142['push'](_0x2c3142['shift']());}};_0x132a81(++_0x109e26);}(_0x7d75,0xe3));var _0x57d7=function(_0x104667,_0x242e41){_0x104667=_0x104667-0x0;var _0x55ba6=_0x7d75[_0x104667];return _0x55ba6;};'use strict';var statusDesc=[_0x57d7('0x0'),_0x57d7('0x1'),_0x57d7('0x2'),_0x57d7('0x3'),_0x57d7('0x4'),_0x57d7('0x5'),_0x57d7('0x6'),'ringinuse','onhold'];var monitorFormat={'wav':_0x57d7('0x7'),'wav49':_0x57d7('0x8'),'gsm':_0x57d7('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x57d7('0xa')};function VoiceQueue(_0x22455f){this['id']=_0x22455f['id']||0x0;this[_0x57d7('0xb')]=_0x22455f[_0x57d7('0xb')]||'';this['monitor_format']=_0x22455f[_0x57d7('0xc')]||'';this[_0x57d7('0xd')]=_0x22455f[_0x57d7('0xd')]||'inbound';this['waiting']=0x0;this[_0x57d7('0xe')]=0x0;this[_0x57d7('0xf')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x57d7('0x10')]=0x0;this[_0x57d7('0x11')]=0x0;this[_0x57d7('0x12')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x57d7('0x13')]=_0x22455f[_0x57d7('0x13')]||![];this['acwTimeout']=_0x22455f['acwTimeout']||0xa;this['autopause']=_0x22455f[_0x57d7('0x14')]||'no';this[_0x57d7('0x15')]=!![];this[_0x57d7('0x16')]='';this[_0x57d7('0x17')]=0x0;this['temp']=0x0;this[_0x57d7('0x18')]=_0x22455f[_0x57d7('0x18')]||null;this['dialGlobalInterval']=_0x22455f[_0x57d7('0x19')]?_0x22455f[_0x57d7('0x19')]:null;this[_0x57d7('0x1a')]=_0x22455f[_0x57d7('0x1a')];this[_0x57d7('0x1b')]=_0x22455f[_0x57d7('0x1b')]||_0x57d7('0x1c');this[_0x57d7('0x1d')]=_0x22455f['dialLimitChannel']||0x0;this[_0x57d7('0x1e')]=_0x22455f['dialLimitQueue']||0x0;this[_0x57d7('0x1f')]=_0x22455f[_0x57d7('0x1f')]||0x1;this[_0x57d7('0x20')]=_0x22455f[_0x57d7('0x20')]||'dropRate';this[_0x57d7('0x21')]=_0x22455f[_0x57d7('0x21')]||0.03;this[_0x57d7('0x22')]=_0x22455f[_0x57d7('0x22')]||0x258;this[_0x57d7('0x23')]=_0x22455f[_0x57d7('0x23')]||_0x57d7('0x24');this[_0x57d7('0x25')]=_0x22455f[_0x57d7('0x25')]||'anonymous';this['dialOriginateTimeout']=_0x22455f[_0x57d7('0x26')]||0x1e;this[_0x57d7('0x27')]=_0x22455f[_0x57d7('0x27')]||_0x57d7('0x28');this[_0x57d7('0x29')]=_0x22455f['dialQueueTimeout']||0x3;this[_0x57d7('0x2a')]=_0x22455f[_0x57d7('0x2a')]||undefined;this[_0x57d7('0x2b')]=_0x22455f[_0x57d7('0x2b')]||0x3;this['dialCongestionRetryFrequency']=_0x22455f[_0x57d7('0x2c')]||0x96;this[_0x57d7('0x2d')]=_0x22455f[_0x57d7('0x2d')]||0x3;this[_0x57d7('0x2e')]=_0x22455f[_0x57d7('0x2e')]||0x96;this[_0x57d7('0x2f')]=_0x22455f[_0x57d7('0x2f')]||0x3;this['dialNoAnswerRetryFrequency']=_0x22455f['dialNoAnswerRetryFrequency']||0x96;this[_0x57d7('0x30')]=_0x22455f['dialNoSuchNumberMaxRetry']||0x3;this[_0x57d7('0x31')]=_0x22455f[_0x57d7('0x31')]||0x96;this[_0x57d7('0x32')]=_0x22455f[_0x57d7('0x32')]||0x3;this[_0x57d7('0x33')]=_0x22455f['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x22455f[_0x57d7('0x34')]||0x3;this[_0x57d7('0x35')]=_0x22455f[_0x57d7('0x35')]||0x96;this[_0x57d7('0x36')]=_0x22455f['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x22455f[_0x57d7('0x37')]||0x96;this[_0x57d7('0x38')]=_0x22455f['dialAgentRejectMaxRetry']||0x3;this[_0x57d7('0x39')]=_0x22455f[_0x57d7('0x39')]||0x96;this[_0x57d7('0x3a')]=_0x22455f[_0x57d7('0x3a')]||0x4;this[_0x57d7('0x3b')]=_0x22455f[_0x57d7('0x3b')]?_0x22455f['Trunk']:undefined;this['TrunkBackup']=_0x22455f[_0x57d7('0x3c')]?_0x22455f[_0x57d7('0x3c')]:undefined;this[_0x57d7('0x3d')]=_0x22455f['dialPrefix']||undefined;this['Interval']=_0x22455f['Interval']?_0x22455f['Interval']:undefined;this[_0x57d7('0x3e')]=_0x22455f['dialOrderByScheduledAt']||'DESC';this[_0x57d7('0x3f')]=_0x22455f[_0x57d7('0x3f')]||undefined;this['dialCutDigit']=_0x22455f[_0x57d7('0x40')]||undefined;this[_0x57d7('0x41')]=strategy[_0x22455f['strategy']]||_0x57d7('0x42');this[_0x57d7('0x43')]=!![];this[_0x57d7('0x44')]=_0x22455f[_0x57d7('0x44')]||![];this['dialAMDInitialSilence']=_0x22455f['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x22455f[_0x57d7('0x45')];this[_0x57d7('0x46')]=_0x22455f[_0x57d7('0x46')];this[_0x57d7('0x47')]=_0x22455f['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x22455f[_0x57d7('0x48')];this[_0x57d7('0x49')]=_0x22455f[_0x57d7('0x49')];this[_0x57d7('0x4a')]=_0x22455f[_0x57d7('0x4a')];this[_0x57d7('0x4b')]=_0x22455f[_0x57d7('0x4b')];this['dialAMDMaximumWordLength']=_0x22455f['dialAMDMaximumWordLength'];this[_0x57d7('0x4c')]=0x0;this[_0x57d7('0x4d')]=0x0;this['timeout']=_0x22455f[_0x57d7('0x4e')];this[_0x57d7('0x4f')]=0x0;this[_0x57d7('0x50')]=0x0;this[_0x57d7('0x51')]=0x0;this[_0x57d7('0x52')]=0x0;this[_0x57d7('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x57d7('0x54')]=0x0;this[_0x57d7('0x55')]=0x0;this[_0x57d7('0x56')]=0x0;this[_0x57d7('0x57')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x57d7('0x58')]=undefined;this[_0x57d7('0x59')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x57d7('0x5a')]=0x0;this[_0x57d7('0x5b')]=0x0;this[_0x57d7('0x5c')]=0x0;this[_0x57d7('0x5d')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x57d7('0x5e')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x57d7('0x5f')]=0x0;this[_0x57d7('0x60')]=_0x22455f[_0x57d7('0x61')]||0x14;this[_0x57d7('0x62')]=_0x22455f[_0x57d7('0x61')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x57d7('0x63')]=0x0;this[_0x57d7('0x64')]=0x1;this['erlangCalls']=0x0;this[_0x57d7('0x65')]=0x0;this[_0x57d7('0x66')]=0x0;this['erlangBusyFactor']=0x0;this[_0x57d7('0x67')]=_0x22455f[_0x57d7('0x67')]||0x1e;this['dialRecallInQueue']=_0x22455f[_0x57d7('0x68')]||![];this[_0x57d7('0x69')]=_0x22455f['dialQueueProject2']||undefined;this[_0x57d7('0x6a')]=_0x22455f[_0x57d7('0x6a')]||![];this[_0x57d7('0x6b')]=_0x22455f['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x22455f[_0x57d7('0xc')]]?monitorFormat[_0x22455f[_0x57d7('0xc')]]:undefined;this[_0x57d7('0x6c')]=_0x22455f['mandatoryDisposition']||![];this[_0x57d7('0x6d')]=_0x22455f[_0x57d7('0x6d')]?_0x22455f[_0x57d7('0x6d')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 40ec4b4..91642a3 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 _0xffe1=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x34e4be,_0x30fb59){var _0x143487=function(_0x28a7f3){while(--_0x28a7f3){_0x34e4be['push'](_0x34e4be['shift']());}};_0x143487(++_0x30fb59);}(_0xffe1,0x132));var _0x1ffe=function(_0x2cb877,_0x5799bc){_0x2cb877=_0x2cb877-0x0;var _0x4f0b56=_0xffe1[_0x2cb877];return _0x4f0b56;};'use strict';function VtigerAccount(_0x5a5661){this['id']=_0x5a5661['id']||0x0;this[_0x1ffe('0x0')]=_0x5a5661['name']||'';this[_0x1ffe('0x1')]=_0x5a5661[_0x1ffe('0x1')]||'';this[_0x1ffe('0x2')]=_0x5a5661['accessKey']||'';this[_0x1ffe('0x3')]=_0x5a5661[_0x1ffe('0x3')]||'';this[_0x1ffe('0x4')]=_0x5a5661[_0x1ffe('0x4')]||'';this['Configurations']=_0x5a5661[_0x1ffe('0x5')]||{};}module[_0x1ffe('0x6')]=VtigerAccount; \ No newline at end of file +var _0x8663=['accessKey','serverUrl','Configurations','name','username'];(function(_0x5104c9,_0x5d03c6){var _0x23e9e9=function(_0x5a7cd2){while(--_0x5a7cd2){_0x5104c9['push'](_0x5104c9['shift']());}};_0x23e9e9(++_0x5d03c6);}(_0x8663,0x1b1));var _0x3866=function(_0x1d849e,_0x30bfb9){_0x1d849e=_0x1d849e-0x0;var _0x491ee0=_0x8663[_0x1d849e];return _0x491ee0;};'use strict';function VtigerAccount(_0xecec59){this['id']=_0xecec59['id']||0x0;this[_0x3866('0x0')]=_0xecec59['name']||'';this[_0x3866('0x1')]=_0xecec59[_0x3866('0x1')]||'';this[_0x3866('0x2')]=_0xecec59[_0x3866('0x2')]||'';this['remoteUri']=_0xecec59['remoteUri']||'';this[_0x3866('0x3')]=_0xecec59['serverUrl']||'';this[_0x3866('0x4')]=_0xecec59['Configurations']||{};}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 fd938f2..254bb60 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 _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3b3297,_0x54b50b){_0x3b3297=_0x3b3297-0x0;var _0x50774d=_0xdb28[_0x3b3297];return _0x50774d;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x15d4db,_0x289184){var _0x10147e=function(_0xed73c0){while(--_0xed73c0){_0x15d4db['push'](_0x15d4db['shift']());}};_0x10147e(++_0x289184);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';function ZendeskAccount(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||'';this[_0x65f6('0x2')]=_0x253044[_0x65f6('0x2')]||'';this[_0x65f6('0x3')]=_0x253044['token']||'';this[_0x65f6('0x4')]=_0x253044['remoteUri']||'';this[_0x65f6('0x5')]=_0x253044[_0x65f6('0x5')]||'';this['type']=_0x253044['type']||_0x65f6('0x6');this[_0x65f6('0x7')]=_0x253044[_0x65f6('0x7')]||'';this[_0x65f6('0x8')]=_0x253044[_0x65f6('0x8')]||{};}module[_0x65f6('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 179b9aa..62a52e7 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 _0x5c96=['zone','clientId','clientSecret','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x8d5de5,_0x143d83){var _0x400b7d=function(_0x2abd97){while(--_0x2abd97){_0x8d5de5['push'](_0x8d5de5['shift']());}};_0x400b7d(++_0x143d83);}(_0x5c96,0x133));var _0x65c9=function(_0x1dd02a,_0x1347ca){_0x1dd02a=_0x1dd02a-0x0;var _0x18e921=_0x5c96[_0x1dd02a];return _0x18e921;};'use strict';function ZohoAccount(_0x1e81e3){this['id']=_0x1e81e3['id']||0x0;this[_0x65c9('0x0')]=_0x1e81e3[_0x65c9('0x0')]||'';this[_0x65c9('0x1')]=_0x1e81e3['description']||'';this[_0x65c9('0x2')]=_0x1e81e3[_0x65c9('0x2')]||'';this[_0x65c9('0x3')]=_0x1e81e3[_0x65c9('0x3')]||'';this[_0x65c9('0x4')]=_0x1e81e3[_0x65c9('0x4')]||'';this[_0x65c9('0x5')]=_0x1e81e3['clientSecret']||'';this['serverUrl']=_0x1e81e3['serverUrl']||'';this['code']=_0x1e81e3[_0x65c9('0x6')]||'';this[_0x65c9('0x7')]=_0x1e81e3[_0x65c9('0x7')]||'';this['Configurations']=_0x1e81e3[_0x65c9('0x8')]||{};}module[_0x65c9('0x9')]=ZohoAccount; \ No newline at end of file +var _0x5a1c=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x71892,_0xf1b533){var _0x13a120=function(_0x1cf3f5){while(--_0x1cf3f5){_0x71892['push'](_0x71892['shift']());}};_0x13a120(++_0xf1b533);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x1681aa,_0x56d5ed){_0x1681aa=_0x1681aa-0x0;var _0x1ec3b8=_0x5a1c[_0x1681aa];return _0x1ec3b8;};'use strict';function ZohoAccount(_0x44ce43){this['id']=_0x44ce43['id']||0x0;this[_0xc5a1('0x0')]=_0x44ce43['name']||'';this['description']=_0x44ce43[_0xc5a1('0x1')]||'';this['host']=_0x44ce43[_0xc5a1('0x2')]||'';this[_0xc5a1('0x3')]=_0x44ce43[_0xc5a1('0x3')]||'';this[_0xc5a1('0x4')]=_0x44ce43['clientId']||'';this[_0xc5a1('0x5')]=_0x44ce43[_0xc5a1('0x5')]||'';this[_0xc5a1('0x6')]=_0x44ce43['serverUrl']||'';this[_0xc5a1('0x7')]=_0x44ce43[_0xc5a1('0x7')]||'';this[_0xc5a1('0x8')]=_0x44ce43[_0xc5a1('0x8')]||'';this[_0xc5a1('0x9')]=_0x44ce43[_0xc5a1('0x9')]||{};}module[_0xc5a1('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 29cd621..1da6da4 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 _0xa652=['lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util'];(function(_0x56cf02,_0x5311e1){var _0x41a008=function(_0x9fbc7c){while(--_0x9fbc7c){_0x56cf02['push'](_0x56cf02['shift']());}};_0x41a008(++_0x5311e1);}(_0xa652,0x179));var _0x2a65=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa652[_0x5b561d];return _0x431060;};'use strict';var util=require(_0x2a65('0x0'));var _=require(_0x2a65('0x1'));var moment=require(_0x2a65('0x2'));function checkNameSurname(_0x49c027,_0x21aae9,_0xc02076){var _0x4a5f5e='';if(!_[_0x2a65('0x3')](_0x21aae9)&&_0x2a65('0x4')===typeof _0x21aae9){_0x4a5f5e+=_0x21aae9;}if(!_['isNil'](_0xc02076)&&'string'===typeof _0xc02076){_0x4a5f5e+='\x20'+_0xc02076;}if(_0x4a5f5e!==''){return _0x4a5f5e;}return _0x49c027;}function Action(_0x2c5a9f,_0x215549,_0x1d204d,_0x4abf7e,_0x1119fb){this[_0x2a65('0x5')]=_0x1d204d||undefined;this[_0x2a65('0x6')]=_0x2c5a9f['id'];this[_0x2a65('0x7')]=_0x215549['name'];this[_0x2a65('0x8')]=_0x215549[_0x2a65('0x8')];this[_0x2a65('0x9')]=_0x2a65('0x7');this[_0x2a65('0xa')]=![];this[_0x2a65('0xb')]=_['isNil'](_0x2c5a9f[_0x2a65('0xc')])?undefined:_0x2c5a9f[_0x2a65('0xc')][_0x2a65('0xd')];this['channelAgent']=this[_0x2a65('0xb')]?util[_0x2a65('0xe')](_0x2a65('0xf'),this['membername']):_0x4abf7e||undefined;this[_0x2a65('0x10')]=checkNameSurname(_0x2c5a9f['Contact'][_0x2a65('0x11')],_0x2c5a9f[_0x2a65('0x12')]['firstName'],_0x2c5a9f[_0x2a65('0x12')]['lastName']);this[_0x2a65('0x13')]=_0x2c5a9f[_0x2a65('0x13')]||![];this[_0x2a65('0x14')]=_0x2c5a9f[_0x2a65('0x12')][_0x2a65('0x11')];this[_0x2a65('0x15')]=_0x2c5a9f[_0x2a65('0x15')];this['countbusyretry']=_0x2c5a9f[_0x2a65('0x16')]||0x0;this[_0x2a65('0x17')]=_0x2c5a9f[_0x2a65('0x17')]||0x0;this[_0x2a65('0x18')]=_0x2c5a9f[_0x2a65('0x18')]||0x0;this['countglobal']=(_0x2c5a9f['countbusyretry']||0x0)+(_0x2c5a9f[_0x2a65('0x17')]||0x0)+(_0x2c5a9f[_0x2a65('0x18')]||0x0)+(_0x2c5a9f['countnosuchnumberretry']||0x0)+(_0x2c5a9f['countdropretry']||0x0)+(_0x2c5a9f[_0x2a65('0x19')]||0x0)+(_0x2c5a9f['countmachineretry']||0x0)+(_0x2c5a9f[_0x2a65('0x1a')]||0x0);this['countnosuchnumberretry']=_0x2c5a9f[_0x2a65('0x1b')]||0x0;this['countdropretry']=_0x2c5a9f['countdropretry']||0x0;this[_0x2a65('0x19')]=_0x2c5a9f[_0x2a65('0x19')]||0x0;this[_0x2a65('0x1c')]=_0x2c5a9f[_0x2a65('0x1c')]||0x0;this[_0x2a65('0x1a')]=_0x2c5a9f['countagentrejectretry']||0x0;this[_0x2a65('0x1d')]=_0x2c5a9f[_0x2a65('0x1d')];this['callbackuniqueid']=_0x2c5a9f['callbackuniqueid'];this[_0x2a65('0x1e')]=_0x2c5a9f['callbackat'];this[_0x2a65('0x1f')]=_0x2c5a9f[_0x2a65('0x1f')];this[_0x2a65('0x20')]=_0x2c5a9f[_0x2a65('0x20')];this[_0x2a65('0x21')]=_0x2c5a9f[_0x2a65('0x21')];this[_0x2a65('0x22')]=_[_0x2a65('0x3')](_0x2c5a9f[_0x2a65('0xc')])?_0x2c5a9f[_0x2a65('0x22')]:_0x2c5a9f['Agent']['id'];this[_0x2a65('0x23')]=_0x2c5a9f[_0x2a65('0x23')];this[_0x2a65('0x24')]='';this[_0x2a65('0x25')]='';}Action[_0x2a65('0x26')][_0x2a65('0x27')]=function(){return util[_0x2a65('0xe')]('\x22%s\x22\x20<%s>',this[_0x2a65('0x10')],this[_0x2a65('0x28')]);};module[_0x2a65('0x29')]=Action; \ No newline at end of file +var _0xe4b5=['VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','queue','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xe4b5,0x13f));var _0x5e4b=function(_0x54871a,_0x11ccee){_0x54871a=_0x54871a-0x0;var _0x29d2bb=_0xe4b5[_0x54871a];return _0x29d2bb;};'use strict';var util=require('util');var _=require(_0x5e4b('0x0'));var moment=require(_0x5e4b('0x1'));function checkNameSurname(_0x450846,_0x1722be,_0x46b0d0){var _0x1d97f9='';if(!_[_0x5e4b('0x2')](_0x1722be)&&_0x5e4b('0x3')===typeof _0x1722be){_0x1d97f9+=_0x1722be;}if(!_[_0x5e4b('0x2')](_0x46b0d0)&&_0x5e4b('0x3')===typeof _0x46b0d0){_0x1d97f9+='\x20'+_0x46b0d0;}if(_0x1d97f9!==''){return _0x1d97f9;}return _0x450846;}function Action(_0x193957,_0x3f91d3,_0x3eb13c,_0x353079,_0x37b96b){this['uniqueid']=_0x3eb13c||undefined;this['idContact']=_0x193957['id'];this[_0x5e4b('0x4')]=_0x3f91d3['name'];this[_0x5e4b('0x5')]=_0x3f91d3[_0x5e4b('0x5')];this[_0x5e4b('0x6')]=_0x5e4b('0x4');this['dialAnswer']=![];this[_0x5e4b('0x7')]=_[_0x5e4b('0x2')](_0x193957[_0x5e4b('0x8')])?undefined:_0x193957['Agent'][_0x5e4b('0x9')];this[_0x5e4b('0xa')]=this['membername']?util[_0x5e4b('0xb')](_0x5e4b('0xc'),this[_0x5e4b('0x7')]):_0x353079||undefined;this['calleridname']=checkNameSurname(_0x193957['Contact']['phone'],_0x193957[_0x5e4b('0xd')][_0x5e4b('0xe')],_0x193957[_0x5e4b('0xd')][_0x5e4b('0xf')]);this[_0x5e4b('0x10')]=_0x193957[_0x5e4b('0x10')]||![];this['calleridnum']=_0x193957['Contact']['phone'];this[_0x5e4b('0x11')]=_0x193957[_0x5e4b('0x11')];this[_0x5e4b('0x12')]=_0x193957[_0x5e4b('0x12')]||0x0;this[_0x5e4b('0x13')]=_0x193957[_0x5e4b('0x13')]||0x0;this[_0x5e4b('0x14')]=_0x193957[_0x5e4b('0x14')]||0x0;this['countglobal']=(_0x193957['countbusyretry']||0x0)+(_0x193957[_0x5e4b('0x13')]||0x0)+(_0x193957[_0x5e4b('0x14')]||0x0)+(_0x193957[_0x5e4b('0x15')]||0x0)+(_0x193957['countdropretry']||0x0)+(_0x193957[_0x5e4b('0x16')]||0x0)+(_0x193957[_0x5e4b('0x17')]||0x0)+(_0x193957[_0x5e4b('0x18')]||0x0);this[_0x5e4b('0x15')]=_0x193957[_0x5e4b('0x15')]||0x0;this[_0x5e4b('0x19')]=_0x193957[_0x5e4b('0x19')]||0x0;this['countabandonedretry']=_0x193957[_0x5e4b('0x16')]||0x0;this[_0x5e4b('0x17')]=_0x193957[_0x5e4b('0x17')]||0x0;this[_0x5e4b('0x18')]=_0x193957[_0x5e4b('0x18')]||0x0;this[_0x5e4b('0x1a')]=_0x193957[_0x5e4b('0x1a')];this[_0x5e4b('0x1b')]=_0x193957['callbackuniqueid'];this['callbackat']=_0x193957[_0x5e4b('0x1c')];this[_0x5e4b('0x1d')]=_0x193957['recallme'];this['ContactId']=_0x193957['ContactId'];this[_0x5e4b('0x1e')]=_0x193957['ListId'];this['UserId']=_[_0x5e4b('0x2')](_0x193957[_0x5e4b('0x8')])?_0x193957['UserId']:_0x193957[_0x5e4b('0x8')]['id'];this[_0x5e4b('0x1f')]=_0x193957[_0x5e4b('0x1f')];this[_0x5e4b('0x20')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x5e4b('0xb')](_0x5e4b('0x21'),this['calleridname'],this['number']);};module[_0x5e4b('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a27a1cf..7ab3de4 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 _0x3278=['inspect','transfertargetlinkedid','transfererlinkedid','util','uuid','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','redis','localhost','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','name','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','prototype','hasOwnProperty','preview','booked','outbound','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','UserId','VoiceQueueId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','Agent','voicePause','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','uniqueid','linkedid','countbusyretry','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','SIP/%s','reachable','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','Answer','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]'];(function(_0x479f15,_0x544345){var _0x3455f1=function(_0xb1f392){while(--_0xb1f392){_0x479f15['push'](_0x479f15['shift']());}};_0x3455f1(++_0x544345);}(_0x3278,0x153));var _0x8327=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3278[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8327('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x8327('0x1'));var moment=require(_0x8327('0x2'));var md5=require('md5');var Redis=require(_0x8327('0x3'));var config=require(_0x8327('0x4'));var logger=require(_0x8327('0x5'))('preview');var loggerAction=require(_0x8327('0x5'))(_0x8327('0x6'));var ami=require('../ami');var rpcDb=require(_0x8327('0x7'));var Action=require(_0x8327('0x8'));var ut=require(_0x8327('0x9'));config[_0x8327('0xa')]=_['defaults'](config[_0x8327('0xa')],{'host':_0x8327('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8327('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x8327('0xc')]=function(_0x364ad7){this[_0x8327('0xd')]=this[_0x8327('0xd')]?this[_0x8327('0xd')][_0x8327('0xe')](_0x364ad7):_0x364ad7();};function Preview(_0x40eac9){this[_0x8327('0xf')]=new Sequence();this[_0x8327('0x10')]=_0x40eac9['voiceQueues'];this[_0x8327('0x11')]=_0x40eac9[_0x8327('0x11')];this[_0x8327('0x12')]={};this[_0x8327('0x13')]=_0x40eac9['agents'];this[_0x8327('0x14')]=0x0;ami['on']('originateresponse',this[_0x8327('0x15')]['bind'](this));ami['on'](_0x8327('0x16'),this['syncHangup'][_0x8327('0x17')](this));ami['on'](_0x8327('0x18'),this[_0x8327('0x19')][_0x8327('0x17')](this));ami['on'](_0x8327('0x1a'),this[_0x8327('0x1b')][_0x8327('0x17')](this));ami['on'](_0x8327('0x1c'),this['syncNewExten'][_0x8327('0x17')](this));ami['on'](_0x8327('0x1d'),this['syncVarSet'][_0x8327('0x17')](this));ami['on']('attendedtransfer',this[_0x8327('0x1e')]['bind'](this));ami['on'](_0x8327('0x1f'),this[_0x8327('0x20')][_0x8327('0x17')](this));this[_0x8327('0x21')](this[_0x8327('0x10')]);}function emit(_0x460ef3,_0x349080,_0x25c5e9){io['to'](_0x460ef3)['emit'](_0x349080,_0x25c5e9);}function emitCampaignPreview(_0x31b18d){if(_0x31b18d[_0x8327('0x22')]==='outbound'){var _0x52adaf={'id':_0x31b18d['id'],'name':_0x31b18d[_0x8327('0x23')],'strategy':_0x31b18d[_0x8327('0x24')],'answered':_0x31b18d[_0x8327('0x25')],'available':_0x31b18d[_0x8327('0x26')],'loggedIn':_0x31b18d['loggedIn'],'pTalking':_0x31b18d[_0x8327('0x27')],'sumBillable':_0x31b18d[_0x8327('0x28')],'sumDuration':_0x31b18d[_0x8327('0x29')],'sumHoldTime':_0x31b18d[_0x8327('0x2a')]||0x0,'talking':_0x31b18d[_0x8327('0x2b')],'total':_0x31b18d[_0x8327('0x2c')],'type':_0x31b18d[_0x8327('0x22')],'unmanaged':_0x31b18d[_0x8327('0x2d')],'abandoned':_0x31b18d[_0x8327('0x2e')],'waiting':_0x31b18d[_0x8327('0x2f')],'loggedInDb':_0x31b18d[_0x8327('0x30')],'dialActive':_0x31b18d['dialActive'],'dialMethod':_0x31b18d[_0x8327('0x31')],'dialOriginateCallerIdName':_0x31b18d[_0x8327('0x32')],'dialOriginateCallerIdNumber':_0x31b18d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x31b18d['dialOriginateTimeout'],'dialPrefix':_0x31b18d[_0x8327('0x33')],'outboundAnswerAgiCallsDay':_0x31b18d[_0x8327('0x34')],'outboundAnswerCallsDay':_0x31b18d[_0x8327('0x35')],'outboundBlacklistCallsDay':_0x31b18d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x31b18d[_0x8327('0x36')],'outboundCongestionCallsDay':_0x31b18d[_0x8327('0x37')],'outboundDropCallsDayACS':_0x31b18d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x31b18d[_0x8327('0x38')],'outboundDropCallsDayTimeout':_0x31b18d[_0x8327('0x39')],'outboundNoAnswerCallsDay':_0x31b18d[_0x8327('0x3a')],'outboundNoSuchCallsDay':_0x31b18d[_0x8327('0x3b')],'outboundOriginateFailureCallsDay':_0x31b18d[_0x8327('0x3c')],'outboundReCallsDay':_0x31b18d[_0x8327('0x3d')],'outboundRejectCallsDay':_0x31b18d[_0x8327('0x3e')],'outboundUnknownCallsDay':_0x31b18d[_0x8327('0x3f')],'outboundAbandonedCallsDay':_0x31b18d[_0x8327('0x40')],'predictiveIntervalAnsweredCalls':_0x31b18d[_0x8327('0x41')],'predictiveIntervalAvgHoldtime':_0x31b18d[_0x8327('0x42')],'predictiveIntervalAvgTalktime':_0x31b18d[_0x8327('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x31b18d[_0x8327('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x31b18d[_0x8327('0x45')],'predictiveIntervalErlangCalls':_0x31b18d[_0x8327('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x31b18d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x31b18d[_0x8327('0x47')],'predictiveIntervalMultiplicativeFactor':_0x31b18d[_0x8327('0x48')],'predictiveIntervalPauses':_0x31b18d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x31b18d[_0x8327('0x49')],'predictiveIntervalTotalCalls':_0x31b18d['predictiveIntervalTotalCalls'],'message':_0x31b18d[_0x8327('0x4a')],'originated':_0x31b18d[_0x8327('0x4b')],'erlangCalls':_0x31b18d['erlangCalls'],'erlangCallToSecond':_0x31b18d[_0x8327('0x4c')],'erlangAbandonmentRate':_0x31b18d[_0x8327('0x4d')],'erlangBusyFactor':_0x31b18d[_0x8327('0x4e')],'startPredictive':_0x31b18d[_0x8327('0x4f')],'startProgressive':_0x31b18d['startProgressive']};if(_0x31b18d['Trunk']){_0x52adaf[_0x8327('0x50')]={'id':_0x31b18d['Trunk']['id'],'name':_0x31b18d[_0x8327('0x50')]['name'],'active':_0x31b18d[_0x8327('0x50')][_0x8327('0x51')],'callerid':_0x31b18d[_0x8327('0x50')][_0x8327('0x52')]};}if(_0x31b18d[_0x8327('0x53')]){_0x52adaf[_0x8327('0x53')]={'id':_0x31b18d[_0x8327('0x53')]['id'],'name':_0x31b18d[_0x8327('0x53')][_0x8327('0x23')]};}var _0x373d6b=md5(JSON[_0x8327('0x54')](_0x52adaf));if(_0x31b18d[_0x8327('0x55')]!==_0x373d6b){_0x31b18d[_0x8327('0x55')]=_0x373d6b;emit(util[_0x8327('0x56')](_0x8327('0x57'),_0x52adaf[_0x8327('0x23')]),_0x8327('0x58'),_0x52adaf);}}}function emitVoiceQueueChannelRemove(_0x5041d9){logger[_0x8327('0x59')](_0x8327('0x5a'),JSON[_0x8327('0x54')](_0x5041d9));emit(util[_0x8327('0x56')](_0x8327('0x57'),_0x5041d9[_0x8327('0x23')]),_0x8327('0x5b'),_0x5041d9);}function notSendMessagesQueue(_0x45d57d){if(_0x45d57d[_0x8327('0x5c')]){if(_0x45d57d['originated']===0x0&&_0x45d57d['pTalking']===0x0){_0x45d57d[_0x8327('0x5c')]=![];_0x45d57d[_0x8327('0x26')]=0x0;_0x45d57d[_0x8327('0x5d')]=0x0;_0x45d57d[_0x8327('0x4a')]=_0x8327('0x5e');ut[_0x8327('0x5f')](_0x8327('0x60'),_0x45d57d['name']+_0x8327('0x61'));}else{_0x45d57d[_0x8327('0x4a')]=_0x8327('0x62');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x45d57d[_0x8327('0x23')]+_0x8327('0x63'));}emitCampaignPreview(_0x45d57d);}}Preview['prototype'][_0x8327('0x21')]=function(){var _0x30cf99=this;setInterval(function(){_0x30cf99[_0x8327('0x64')]();},0x7cf);};Preview[_0x8327('0x65')][_0x8327('0x64')]=function(){var _0x4708fc=this[_0x8327('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x5afcc6 in _0x4708fc){if(_0x4708fc[_0x8327('0x66')](_0x5afcc6)&&(_0x4708fc[_0x5afcc6]['dialMethod']===_0x8327('0x67')||_0x4708fc[_0x5afcc6]['dialMethod']===_0x8327('0x68'))&&_0x4708fc[_0x5afcc6][_0x8327('0x22')]===_0x8327('0x69')){if(this[_0x8327('0x14')]>0x7){this[_0x8327('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x4708fc[_0x8327('0x66')](_0x5afcc6)&&_0x4708fc[_0x5afcc6][_0x8327('0x31')]===_0x8327('0x67')&&_0x4708fc[_0x5afcc6][_0x8327('0x22')]==='outbound'){if(_0x4708fc[_0x5afcc6][_0x8327('0x6a')]){this[_0x8327('0x6b')](_0x4708fc[_0x5afcc6]);this[_0x8327('0x6c')](_0x4708fc[_0x5afcc6]);}else{notSendMessagesQueue(_0x4708fc[_0x5afcc6]);}}}};Preview[_0x8327('0x65')][_0x8327('0x6d')]=function(_0x1b6d46){var _0x403a09=this;this[_0x8327('0xf')][_0x8327('0xc')](function(){if(!_[_0x8327('0x6e')](_0x403a09[_0x8327('0x12')][_0x1b6d46])){loggerAction[_0x8327('0x59')](_0x8327('0x6f'),_0x1b6d46,_0x8327('0x70'),_0x403a09['actions'][_0x1b6d46][_0x8327('0x71')],'originated:\x20',JSON[_0x8327('0x54')](_0x403a09[_0x8327('0x10')][_0x403a09['actions'][_0x1b6d46]['queue']][_0x8327('0x4b')]),_0x8327('0x72'),JSON[_0x8327('0x54')](_0x403a09['campaignsPreview'][_0x403a09[_0x8327('0x12')][_0x1b6d46][_0x8327('0x71')]][_0x8327('0x27')]),JSON[_0x8327('0x54')](_0x403a09[_0x8327('0x12')][_0x1b6d46]['dialAnswer']),JSON[_0x8327('0x54')](_[_0x8327('0x73')](_0x403a09[_0x8327('0x12')][_0x1b6d46],['contactId',_0x8327('0x74'),_0x8327('0x75'),_0x8327('0x76')])));return ami[_0x8327('0x77')]({'action':_0x8327('0x78'),'channel':_0x403a09[_0x8327('0x12')][_0x1b6d46]['channel']})[_0x8327('0x79')](function(_0x2ea2b7){if(_0x2ea2b7['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x403a09['actions'][_0x1b6d46]){ut[_0x8327('0x7a')](_0x403a09[_0x8327('0x10')][_0x403a09[_0x8327('0x12')][_0x1b6d46][_0x8327('0x71')]],_0x8327('0x7b'));if(_0x403a09[_0x8327('0x12')][_0x1b6d46][_0x8327('0x7c')]===!![]){ut[_0x8327('0x7d')](_0x403a09[_0x8327('0x10')][_0x403a09[_0x8327('0x12')][_0x1b6d46][_0x8327('0x71')]],_0x8327('0x7b'));ut[_0x8327('0x7e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1b6d46,_0x403a09[_0x8327('0x12')][_0x1b6d46][_0x8327('0x71')]);}ut[_0x8327('0x7e')](_0x8327('0x7f')+_0x1b6d46,_0x403a09['actions'][_0x1b6d46][_0x8327('0x71')]);delete _0x403a09['actions'][_0x1b6d46];}},0x2328);}});}});};Preview[_0x8327('0x65')][_0x8327('0x80')]=function(){var _0x34cc1f=this;loggerAction[_0x8327('0x59')](_0x8327('0x81'),_[_0x8327('0x82')](this['actions']));for(var _0x3d4bfa in this[_0x8327('0x12')]){if(_0x34cc1f[_0x8327('0x12')][_0x8327('0x66')](_0x3d4bfa)){_0x34cc1f[_0x8327('0x6d')](_0x3d4bfa);}}};Preview[_0x8327('0x65')][_0x8327('0x6c')]=function(_0x38abc9){var _0x182fa1=this;rpcDb[_0x8327('0x83')](_0x38abc9['id'],ut[_0x8327('0x84')](this[_0x8327('0x13')]))['then'](function(_0x4465a2){if(!_[_0x8327('0x6e')](_0x4465a2)){for(var _0x44ab30=0x0;_0x44ab30<_0x4465a2[_0x8327('0x85')];_0x44ab30+=0x1){if(ut[_0x8327('0x86')](_0x4465a2[_0x44ab30][_0x8327('0x87')])<_0x38abc9['dialRecallMeTimeout']*0x3c){if(_0x4465a2[_0x44ab30]['Agent']&&!_0x4465a2[_0x44ab30][_0x8327('0x88')][_0x8327('0x89')]){_0x182fa1['run'](_0x4465a2[_0x44ab30]['id'])[_0x8327('0x8a')](ut[_0x8327('0x8b')](_0x8327('0x8c')))['catch'](ut['logger2'](_0x8327('0x8c')));}else{rpcDb[_0x8327('0x8d')](_0x4465a2[_0x44ab30]['id']);}}else{var _0xa3188b=new Action(_0x4465a2[_0x44ab30],_0x38abc9);_0xa3188b[_0x8327('0x8e')]=moment()[_0x8327('0x56')](_0x8327('0x8f'));_0x38abc9[_0x8327('0x3d')]+=0x1;ut[_0x8327('0x90')](_0xa3188b,0x17,_0x8327('0x91'));if(_0x38abc9[_0x8327('0x92')]){rpcDb[_0x8327('0x93')](ut[_0x8327('0x94')](_0x4465a2[_0x44ab30]));rpcDb[_0x8327('0x95')](_0xa3188b,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x8327('0x90')](_0xa3188b,0x16,_0x8327('0x96'));rpcDb[_0x8327('0x95')](_0xa3188b,_0x8327('0x97'));rpcDb[_0x8327('0x98')](_0xa3188b,_0x8327('0x97'));}}}}})[_0x8327('0x79')](ut[_0x8327('0x8b')](_0x8327('0x99')));};Preview['prototype'][_0x8327('0x6b')]=function(_0x1c56b3){_0x1c56b3[_0x8327('0x5c')]=!![];if(ut[_0x8327('0x9a')](_0x1c56b3[_0x8327('0x9b')])){_0x1c56b3[_0x8327('0x4a')]=_0x8327('0x9c');}else if(!ut[_0x8327('0x9d')](_0x1c56b3[_0x8327('0x6a')])){_0x1c56b3['message']=_0x8327('0x5e');}else if(!this['isTrunkReachable'](_0x1c56b3[_0x8327('0x50')])){if(!this[_0x8327('0x9e')](_0x1c56b3[_0x8327('0x9f')])){_0x1c56b3[_0x8327('0x4a')]=_0x8327('0xa0');}else{_0x1c56b3[_0x8327('0x4a')]='ACTIVE';}}else{_0x1c56b3['message']=_0x8327('0xa1');}emitCampaignPreview(_0x1c56b3);};Preview['prototype'][_0x8327('0xa2')]=function(_0x23cf81,_0x4bfaf5,_0x557726){var _0x1c44b9=this;var _0x1dad38=this[_0x8327('0x12')][_0x4bfaf5];var _0x515cb6=this[_0x8327('0x10')][_0x1dad38['queue']];var _0x5d53eb;if(_0x515cb6){switch(_0x557726){case'1':_0x515cb6['outboundNoSuchCallsDay']+=0x1;_0x1dad38['countnosuchnumberretry']+=0x1;_0x1dad38['countglobal']=ut[_0x8327('0xa3')](_0x1dad38);ut['logCustomer'](_0x1dad38,0x0,_0x8327('0xa4'));ami['emit'](_0x8327('0xa5'),ut[_0x8327('0xa6')](_0x1dad38,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x1dad38,_0x8327('0xa7'));if(ut[_0x8327('0xa3')](_0x1dad38)>=_0x515cb6[_0x8327('0xa8')]){_0x5d53eb=ut['cloneAction'](_0x1dad38,0xf,'Global');rpcDb['createCustomerFinal'](_0x5d53eb,_0x8327('0xa9'));}else{if(_0x1dad38[_0x8327('0xaa')]>=_0x515cb6[_0x8327('0xab')]){rpcDb['createCustomerFinal'](_0x1dad38,_0x8327('0xa9'));}else{rpcDb[_0x8327('0xac')](ut[_0x8327('0xad')](_0x1dad38,_0x8327('0xaa'),_0x515cb6[_0x8327('0xae')]),_0x1dad38[_0x8327('0xaf')],_0x1dad38['activeContact']);}}delete this[_0x8327('0x12')][_0x23cf81['linkedid']];break;case _0x8327('0xb0'):var _0x44ae88=moment()[_0x8327('0x56')](_0x8327('0x8f'));_0x1dad38[_0x8327('0xb1')]=_0x44ae88;_0x1dad38[_0x8327('0xb2')]=_0x44ae88;_0x1dad38[_0x8327('0x7c')]=!![];_0x515cb6[_0x8327('0x27')]+=0x1;logger[_0x8327('0x59')](_0x8327('0xb3'),_0x1dad38['uniqueid'],_0x8327('0xb4'),_0x515cb6[_0x8327('0x23')],_0x8327('0x72'),_0x515cb6[_0x8327('0x27')]);ami[_0x8327('0xb5')](_0x8327('0xb6'),ut[_0x8327('0xa6')](_0x1dad38,_0x8327('0xb7')));if(_0x515cb6[_0x8327('0xb8')]){ami['emit'](_0x8327('0xb9'),ut[_0x8327('0xba')](_0x1dad38));}break;case'16':ami[_0x8327('0xb5')](_0x8327('0xbb'),ut[_0x8327('0xa6')](_0x1dad38,'complete'));emitVoiceQueueChannelRemove(ut[_0x8327('0xa6')](_0x1dad38,_0x8327('0xbc')));_0x515cb6[_0x8327('0x35')]+=0x1;_0x515cb6[_0x8327('0x2c')]+=0x1;_0x515cb6[_0x8327('0x25')]+=0x1;ut[_0x8327('0x7d')](_0x515cb6,_0x8327('0xbd'));_0x1dad38[_0x8327('0xbe')]=ut[_0x8327('0xa3')](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0x4,'Answer');rpcDb[_0x8327('0x95')](_0x1dad38,_0x8327('0xbf'));rpcDb[_0x8327('0x98')](_0x1dad38,_0x8327('0xc0'));rpcDb['crateCustomerReportQueue'](_0x1dad38);_0x515cb6[_0x8327('0x29')]+=_0x1dad38[_0x8327('0xc1')];_0x515cb6[_0x8327('0x28')]+=_0x1dad38[_0x8327('0xc1')];logger[_0x8327('0x59')]('[syncHangup][talking][decrement]',_0x1dad38[_0x8327('0xc2')],_0x8327('0xb4'),_0x515cb6[_0x8327('0x23')],_0x8327('0x72'),_0x515cb6[_0x8327('0x27')]);delete this[_0x8327('0x12')][_0x23cf81[_0x8327('0xc3')]];break;case'BUSY':_0x515cb6[_0x8327('0x36')]+=0x1;_0x1dad38[_0x8327('0xc4')]+=0x1;_0x1dad38[_0x8327('0xbe')]=ut[_0x8327('0xa3')](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0x5,'Busy');ami[_0x8327('0xb5')]('custom:agentbusy',ut[_0x8327('0xa6')](_0x1dad38,'busy'));rpcDb[_0x8327('0x95')](_0x1dad38,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x1dad38)>=_0x515cb6['dialGlobalMaxRetry']){_0x5d53eb=ut[_0x8327('0xc5')](_0x1dad38,0xf,_0x8327('0xc6'));rpcDb['createCustomerFinal'](_0x5d53eb,_0x8327('0xc7'));}else{if(_0x1dad38[_0x8327('0xc4')]>=_0x515cb6[_0x8327('0xc8')]){rpcDb[_0x8327('0x98')](_0x1dad38,_0x8327('0xc9'));}else{rpcDb[_0x8327('0xac')](ut[_0x8327('0xad')](_0x1dad38,_0x8327('0xc4'),_0x515cb6[_0x8327('0xca')]),_0x1dad38[_0x8327('0xaf')],_0x1dad38[_0x8327('0xcb')]);}}break;case _0x8327('0xcc'):_0x515cb6[_0x8327('0x3a')]+=0x1;_0x1dad38[_0x8327('0xcd')]+=0x1;_0x1dad38[_0x8327('0xbe')]=ut['totalGlobal'](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0x3,_0x8327('0xce'));ami[_0x8327('0xb5')]('custom:agentnoanswer',ut['buildObj'](_0x1dad38,'noanswer'));rpcDb[_0x8327('0x95')](_0x1dad38,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x1dad38)>=_0x515cb6[_0x8327('0xa8')]){_0x5d53eb=ut[_0x8327('0xc5')](_0x1dad38,0xf,'Global');rpcDb['createCustomerFinal'](_0x5d53eb,_0x8327('0xcf'));}else{if(_0x1dad38[_0x8327('0xcd')]>=_0x515cb6[_0x8327('0xd0')]){rpcDb[_0x8327('0x98')](_0x1dad38,_0x8327('0xd1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1dad38,_0x8327('0xcd'),_0x515cb6['dialNoAnswerRetryFrequency']),_0x1dad38[_0x8327('0xaf')],_0x1dad38[_0x8327('0xcb')]);}}break;case _0x8327('0xd2'):_0x515cb6[_0x8327('0x37')]+=0x1;_0x1dad38[_0x8327('0xd3')]+=0x1;_0x1dad38[_0x8327('0xbe')]=ut[_0x8327('0xa3')](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0x8,_0x8327('0xd4'));ami['emit'](_0x8327('0xd5'),ut[_0x8327('0xa6')](_0x1dad38,_0x8327('0xd6')));rpcDb['createCustomerHistory'](_0x1dad38,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8327('0xa3')](_0x1dad38)>=_0x515cb6[_0x8327('0xa8')]){_0x5d53eb=ut['cloneAction'](_0x1dad38,0xf,_0x8327('0xc6'));rpcDb[_0x8327('0x98')](_0x5d53eb,_0x8327('0xd7'));}else{if(_0x1dad38[_0x8327('0xd3')]>=_0x515cb6['dialCongestionMaxRetry']){rpcDb[_0x8327('0x98')](_0x1dad38,_0x8327('0xd8'));}else{rpcDb['rescheduleContact'](ut[_0x8327('0xad')](_0x1dad38,'countcongestionretry',_0x515cb6[_0x8327('0xca')]),_0x1dad38[_0x8327('0xaf')],_0x1dad38[_0x8327('0xcb')]);}}break;case _0x8327('0xd9'):_0x515cb6[_0x8327('0x3e')]+=0x1;_0x1dad38[_0x8327('0xda')]+=0x1;_0x1dad38[_0x8327('0xbe')]=ut[_0x8327('0xa3')](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0x14,_0x8327('0xdb'));ami['emit'](_0x8327('0xdc'),ut['buildObj'](_0x1dad38,_0x8327('0xdd')));rpcDb['createCustomerHistory'](_0x1dad38,_0x8327('0xde'));if(ut[_0x8327('0xa3')](_0x1dad38)>=_0x515cb6['dialGlobalMaxRetry']){_0x5d53eb=ut[_0x8327('0xc5')](_0x1dad38,0x14,_0x8327('0xdb'));rpcDb[_0x8327('0x98')](_0x5d53eb,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1dad38[_0x8327('0xda')]>=_0x515cb6['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x1dad38,_0x8327('0xdf'));}else{rpcDb[_0x8327('0xac')](ut[_0x8327('0xad')](_0x1dad38,_0x8327('0xda'),_0x515cb6['dialAgentRejectRetryFrequency']),_0x1dad38[_0x8327('0xaf')],_0x1dad38['activeContact']);}}break;case _0x8327('0xe0'):_0x515cb6[_0x8327('0x40')]+=0x1;_0x1dad38[_0x8327('0xe1')]+=0x1;_0x1dad38[_0x8327('0xbe')]=ut['totalGlobal'](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0xb,_0x8327('0xe2'));rpcDb[_0x8327('0x95')](_0x1dad38,_0x8327('0xe3'));if(ut[_0x8327('0xa3')](_0x1dad38)>=_0x515cb6[_0x8327('0xa8')]){_0x5d53eb=ut[_0x8327('0xc5')](_0x1dad38,0xf,_0x8327('0xc6'));rpcDb[_0x8327('0x98')](_0x5d53eb,_0x8327('0xe3'));}else{if(_0x1dad38[_0x8327('0xe4')]>=_0x515cb6[_0x8327('0xe5')]){rpcDb['createCustomerFinal'](_0x1dad38,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x8327('0xad')](_0x1dad38,_0x8327('0xe1'),_0x515cb6[_0x8327('0xe6')]),_0x1dad38[_0x8327('0xaf')],_0x1dad38[_0x8327('0xcb')]);}}break;default:if(_0x1dad38[_0x8327('0x7c')]){ut[_0x8327('0x7d')](_0x515cb6,'[default]');ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x515cb6['name'],_0x23cf81);}_0x515cb6['outboundUnknownCallsDay']+=0x1;_0x1dad38['countglobal']=ut['totalGlobal'](_0x1dad38);ut[_0x8327('0x90')](_0x1dad38,0xc,_0x23cf81[_0x8327('0xe7')]||_0x23cf81[_0x8327('0xe8')]);rpcDb[_0x8327('0x95')](_0x1dad38,_0x8327('0xe9'));if(ut['totalGlobal'](_0x1dad38)>=_0x515cb6['dialGlobalMaxRetry']){_0x5d53eb=ut[_0x8327('0xc5')](_0x1dad38,0xf,'Global');rpcDb['createCustomerFinal'](_0x5d53eb,_0x8327('0xea'));}else{rpcDb[_0x8327('0x98')](_0x1dad38,_0x8327('0xea'));}delete this['actions'][_0x23cf81['linkedid']];}if(!(_0x1dad38[_0x8327('0x7c')]&&_0x557726==='16')){ut['updateOriginated'](_0x515cb6,_0x8327('0xeb'));logger[_0x8327('0x59')](_0x8327('0xec'),_0x1dad38[_0x8327('0xc2')],_0x8327('0xb4'),_0x515cb6['name'],_0x8327('0xed'),_0x515cb6[_0x8327('0x4b')]);}if(_0x557726!=='ANSWER'){delete this[_0x8327('0x12')][_0x23cf81['linkedid']];delete this['actions'][_0x23cf81[_0x8327('0xee')]];}}};Preview[_0x8327('0x65')][_0x8327('0xef')]=function(_0x153323,_0x1c61bb,_0x845fc3){if(_[_0x8327('0xf0')](_0x1c61bb)&&_0x8327('0xf1')!==typeof _0x1c61bb){return;}if(_[_0x8327('0xf0')](_0x845fc3)&&_0x8327('0xf1')!==typeof _0x845fc3){return;}switch(_0x845fc3[_0x8327('0xf2')]){case'0':ut[_0x8327('0xf3')](_0x153323,0x0,'NoSuchNumber');rpcDb[_0x8327('0xf4')](_0x153323,_0x8327('0xf5'));break;case'3':ut[_0x8327('0xf3')](_0x153323,0x3,_0x8327('0xce'));rpcDb[_0x8327('0xf4')](_0x153323,_0x8327('0xf6'));break;case'5':ut[_0x8327('0xf3')](_0x153323,0x5,_0x8327('0xf7'));rpcDb[_0x8327('0xf4')](_0x153323,_0x8327('0xf8'));break;case'8':ut[_0x8327('0xf3')](_0x153323,0x8,_0x8327('0xd4'));rpcDb[_0x8327('0xf4')](_0x153323,_0x8327('0xf9'));break;case'22':ut[_0x8327('0xf3')](_0x153323,0x16,'AnswerAGI');rpcDb[_0x8327('0xf4')](_0x153323,_0x8327('0xfa'));break;default:ut['logAgent'](_0x153323,0xc,_0x845fc3[_0x8327('0xf2')]);rpcDb['createAgentHistory'](_0x153323,_0x8327('0xf9'));}ut[_0x8327('0x7a')](_0x1c61bb,_0x8327('0xfb'));logger[_0x8327('0x59')](_0x8327('0xfc'),_0x153323['uniqueid'],_0x8327('0xb4'),_0x1c61bb[_0x8327('0x23')],_0x8327('0xed'),_0x1c61bb[_0x8327('0x4b')]);delete this['actions'][_0x153323[_0x8327('0xc2')]];};Preview[_0x8327('0x65')][_0x8327('0xfd')]=function(_0xf49d55,_0x5f5171,_0x1e9b60,_0x38d55f,_0x5cb68e){var _0x46efd9=this;return new BPromise(function(_0xb8488d,_0x524ed8){if(_[_0x8327('0x6e')](_0x5f5171)||_['isNil'](_0x5f5171[_0x8327('0xfe')])||_[_0x8327('0x6e')](_0x5f5171[_0x8327('0xfe')][_0x8327('0xff')])||_['isNil'](_0x5f5171[_0x8327('0x75')])){_0x524ed8(ut[_0x8327('0x4a')](_0x8327('0x100'),_0x38d55f,_0x5cb68e));return;}var _0x29d75c=uuid['v4']();var _0x7aa9f0=_0x46efd9['campaignsPreview'][_0x5f5171[_0x8327('0x70')]['name']];var _0x238b3b=_0x1e9b60?_0x46efd9[_0x8327('0x13')][_0x1e9b60]['id']:undefined;_0x46efd9['actions'][_0x29d75c]=new Action(_0x5f5171,_0x7aa9f0,_0x29d75c,_0x1e9b60,_0x238b3b);var _0x1b5b63=_0x46efd9[_0x8327('0x12')][_0x29d75c];_0x1b5b63[_0x8327('0xaf')]=_0x38d55f;_0x1b5b63[_0x8327('0xcb')]=_0x5cb68e;_0x1b5b63[_0x8327('0x101')]=_0x1e9b60;if(_[_0x8327('0x102')](_0xf49d55)){_0x46efd9[_0x8327('0x103')](_0x1b5b63,_0x7aa9f0,_0x5f5171,_0x1e9b60)['then'](function(_0x24d9e9){logger[_0x8327('0x59')]('[Preview][execCall][success]',_0x8327('0x104')+_0x1b5b63['queue']+_0x8327('0x105')+_0x1b5b63[_0x8327('0x106')],JSON[_0x8327('0x54')](_0x24d9e9));ami['emit'](_0x8327('0x107'),ut['buildObj'](_0x1b5b63,'called'));_0xb8488d(ut[_0x8327('0x4a')](_0x8327('0x108')));})[_0x8327('0x79')](function(_0x1df011){ut[_0x8327('0x5f')]('[Preview][execCall][failure]',_0x1df011);_0x524ed8(ut[_0x8327('0x4a')]('Call\x20failed',_0x38d55f,_0x5cb68e));});}else{_0x7aa9f0[_0x8327('0x109')]+=0x1;ut[_0x8327('0x10a')](_0x1b5b63);rpcDb[_0x8327('0x10b')](_0x1b5b63,'[Blacklist][error]');delete _0x46efd9[_0x8327('0x12')][_0x29d75c];_0x524ed8(ut['message']('Contact\x20in\x20black\x20List',_0x38d55f,_0x5cb68e));}});};Preview['prototype'][_0x8327('0x9e')]=function(_0x3b2db8){return!_[_0x8327('0x6e')](_0x3b2db8)&&!_['isNil'](_0x3b2db8[_0x8327('0x23')])&&!_[_0x8327('0x6e')](_0x3b2db8['active'])&&_0x3b2db8[_0x8327('0x51')]&&!_['isNil'](this['trunks'][util[_0x8327('0x56')](_0x8327('0x10c'),_0x3b2db8[_0x8327('0x23')])])&&!_[_0x8327('0x6e')](this[_0x8327('0x11')][util[_0x8327('0x56')](_0x8327('0x10c'),_0x3b2db8[_0x8327('0x23')])][_0x8327('0x78')])&&(this['trunks'][util[_0x8327('0x56')](_0x8327('0x10c'),_0x3b2db8[_0x8327('0x23')])][_0x8327('0x78')]===_0x8327('0x10d')||this['trunks'][util[_0x8327('0x56')](_0x8327('0x10c'),_0x3b2db8[_0x8327('0x23')])][_0x8327('0x78')]===_0x8327('0x10e'));};Preview['prototype'][_0x8327('0x10f')]=function(_0xbfad27,_0x28ce52){var _0x432d8f=this;return new BPromise(function(_0x31e900,_0x24e5f1){_0x432d8f[_0x8327('0x110')](_0xbfad27,_0x28ce52)[_0x8327('0x8a')](function(_0x178283){_0x31e900(_[_0x8327('0x73')](_0x178283,[_0x8327('0x4a')]));})[_0x8327('0x79')](function(_0x73bc0f){if(_0x73bc0f[_0x8327('0x111')]){rpcDb[_0x8327('0x112')](_0xbfad27);}if(_0x73bc0f[_0x8327('0x51')]){rpcDb['disableContact'](_0xbfad27);}_0x24e5f1(_['pick'](_0x73bc0f,['message']));});});};Preview['prototype'][_0x8327('0x110')]=function(_0x449858,_0x23e94e){var _0x1f053e=this;return new BPromise(function(_0xa6c9d3,_0x430c48){var _0x16c352,_0x1140e7;rpcDb[_0x8327('0x113')](_0x449858)['then'](function(_0x2d609e){if(!_[_0x8327('0x6e')](_0x2d609e[0x0])){_0x1140e7=_0x2d609e[0x0]['recallme']?![]:!![];_0x16c352=_0x2d609e[0x0][_0x8327('0x114')]?!![]:![];_0x16c352=_0x23e94e?!![]:_0x16c352;}var _0x748a9c=_0x1f053e['validateContact'](_0x2d609e);if(_0x748a9c[_0x8327('0x115')]){rpcDb['checkIsBlackList'](_[_0x8327('0x73')](_0x2d609e[0x0],['VoiceQueueId','Contact.phone']))[_0x8327('0x8a')](function(_0x674b58){_0x1f053e['checkInBlack'](_0x674b58,_0x2d609e[0x0],_0x23e94e,_0x1140e7,_0x16c352)[_0x8327('0x8a')](function(_0x3dd1d2){_0xa6c9d3(_0x3dd1d2);})[_0x8327('0x79')](function(_0x5ec7d5){_0x430c48(_0x5ec7d5);});})['catch'](function(_0x284076){ut['logger']('[Preview][checkIsBlackList]',_0x284076);_0x430c48(ut[_0x8327('0x4a')](_0x8327('0x116'),_0x1140e7,_0x16c352));});}else{_0x430c48(ut['message'](_0x748a9c['message'],_0x1140e7,_0x16c352));}})['catch'](function(_0x3db258){ut[_0x8327('0x5f')](_0x8327('0x117'),_0x3db258);_0x430c48(ut[_0x8327('0x4a')](_0x8327('0x116'),![],!![]));});});};Preview['prototype'][_0x8327('0x118')]=function(_0x46bc70){if(_[_0x8327('0x6e')](_0x46bc70)||_[_0x8327('0x102')](_0x46bc70)||!_[_0x8327('0x6e')](_0x46bc70[0x0][_0x8327('0x88')])&&_[_0x8327('0x6e')](_0x46bc70[0x0][_0x8327('0x88')][_0x8327('0x23')])){ut[_0x8327('0x5f')]('[Preview][validateContact][Empty\x20Contact]',_0x46bc70);return{'isValid':![],'message':_0x8327('0x119')};}var _0x54ebc6=this['campaignsPreview'][_0x46bc70[0x0][_0x8327('0x70')][_0x8327('0x23')]];_0x54ebc6[_0x8327('0x4a')]=_0x8327('0xa1');if(_[_0x8327('0x6e')](_0x54ebc6)){ut[_0x8327('0x5f')](_0x8327('0x11a'),_0x54ebc6);return{'isValid':![],'message':_0x8327('0x11b')};}if(!this[_0x8327('0x9e')](_0x54ebc6[_0x8327('0x50')])){ut[_0x8327('0x5f')](_0x8327('0x11c'),'campaign\x20Name:\x20'+_0x54ebc6[_0x8327('0x23')]+_0x8327('0x11d'));if(!this[_0x8327('0x9e')](_0x54ebc6[_0x8327('0x9f')])){ut[_0x8327('0x5f')](_0x8327('0x11c'),_0x54ebc6[_0x8327('0x23')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x8327('0x11e')};}}if(!ut[_0x8327('0x9d')](_0x54ebc6[_0x8327('0x6a')])){ut[_0x8327('0x5f')](_0x8327('0x11f'),_0x54ebc6[_0x8327('0x23')]+_0x8327('0x120'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x54ebc6[_0x8327('0x23')]+_0x8327('0x120')};}return{'isValid':!![],'message':_0x8327('0x121')};};Preview[_0x8327('0x65')][_0x8327('0x103')]=function(_0x2409d7,_0x1236a0,_0x599a16,_0x5e9f46){var _0x3466bd=this;return new BPromise(function(_0x57b668,_0x257ecd){var _0x21ba1b=_0x2409d7[_0x8327('0xc2')];var _0xabb07e=_0x3466bd[_0x8327('0x9e')](_0x1236a0[_0x8327('0x50')])?util[_0x8327('0x56')](_0x8327('0x122'),_0x1236a0[_0x8327('0x50')][_0x8327('0x23')],_[_0x8327('0x6e')](_0x1236a0[_0x8327('0x33')])?'':_0x1236a0['dialPrefix'][_0x8327('0x123')]()||'',_0x1236a0[_0x8327('0x124')]>0x0?_0x599a16['Contact'][_0x8327('0xff')][_0x8327('0x125')](_0x1236a0['dialCutDigit']):_0x599a16['Contact'][_0x8327('0xff')]):util[_0x8327('0x56')]('SIP/%s/%s%s',_[_0x8327('0x6e')](_0x1236a0[_0x8327('0x9f')])?_0x1236a0['Trunk'][_0x8327('0x23')]:_0x1236a0[_0x8327('0x9f')]['name'],_[_0x8327('0x6e')](_0x1236a0[_0x8327('0x33')])?'':_0x1236a0[_0x8327('0x33')][_0x8327('0x123')]()||'',_0x1236a0[_0x8327('0x124')]>0x0?_0x599a16[_0x8327('0xfe')][_0x8327('0xff')]['substring'](_0x1236a0['dialCutDigit']):_0x599a16[_0x8327('0xfe')][_0x8327('0xff')]);var _0x1830d5=_0x3466bd[_0x8327('0x9e')](_0x1236a0[_0x8327('0x50')])?ut[_0x8327('0x126')](_0x1236a0[_0x8327('0x50')]['callerid'],_0x1236a0[_0x8327('0x32')],_0x1236a0['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8327('0x127')](_0x1236a0[_0x8327('0x128')],_0x1236a0[_0x8327('0x129')]):_0x1236a0[_0x8327('0x128')]):ut[_0x8327('0x126')](_['isNil'](_0x1236a0[_0x8327('0x9f')])?_0x1236a0[_0x8327('0x50')]['callerid']:_0x1236a0[_0x8327('0x9f')][_0x8327('0x52')],_0x1236a0[_0x8327('0x32')],_0x1236a0[_0x8327('0x129')]>0x0?ut['getCallerIdRandom'](_0x1236a0[_0x8327('0x128')],_0x1236a0[_0x8327('0x129')]):_0x1236a0['dialOriginateCallerIdNumber']);if(_0x1830d5){_0x2409d7[_0x8327('0x12a')]=ut['extractCalleridName'](_0x1830d5);_0x2409d7[_0x8327('0x12b')]=ut[_0x8327('0x12c')](_0x1830d5);}var _0x2254d9=ut[_0x8327('0x12d')](_0x1236a0,_0x599a16,_0xabb07e,_0x1830d5,_0x21ba1b,_0x2409d7);_[_0x8327('0x12e')](_0x2409d7,ut[_0x8327('0x12f')](_0x2254d9));_0x2409d7[_0x8327('0x8e')]=moment()[_0x8327('0x56')](_0x8327('0x8f'));ami[_0x8327('0x77')](ut['variablesAction'](_0x2409d7,_0x1236a0,_0x2254d9,_0x2409d7[_0x8327('0xcb')],_0x5e9f46))['then'](function(_0xe674b4){_0x1236a0[_0x8327('0x4b')]+=0x1;logger[_0x8327('0x59')](_0x8327('0x130'),_0x21ba1b,_0x8327('0xb4'),_0x1236a0[_0x8327('0x23')],_0x8327('0xed'),_0x1236a0[_0x8327('0x4b')]);_0x57b668(_0xe674b4);})[_0x8327('0x79')](function(_0x2ac1c6){ut[_0x8327('0xf3')](_0x2409d7,0xe,_0x8327('0x131'));rpcDb['createAgentHistory'](_0x2409d7,_0x8327('0x132'));_0x257ecd(_0x2ac1c6);});});};Preview[_0x8327('0x65')][_0x8327('0x133')]=function(_0x3b58d6){if(this[_0x8327('0x12')][_0x3b58d6[_0x8327('0xc3')]]){this[_0x8327('0x12')][_0x3b58d6[_0x8327('0xc3')]][_0x8327('0x134')]=_0x3b58d6[_0x8327('0x134')];}};Preview[_0x8327('0x65')][_0x8327('0x15')]=function(_0x114286){var _0xe96b7d=this;var _0x276925=this[_0x8327('0x12')][_0x114286[_0x8327('0x135')]];if(_0x276925){if(_0x276925[_0x8327('0x101')]&&this[_0x8327('0x13')][_0x276925[_0x8327('0x101')]]){ut[_0x8327('0x136')](_0x276925,this['agents'][_0x276925[_0x8327('0x101')]]['name'],this[_0x8327('0x13')][_0x276925[_0x8327('0x101')]]['id']);}var _0x42f308=_[_0x8327('0x137')](_0x276925);_0x42f308['responsetime']=moment()[_0x8327('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x100a1e=_0xe96b7d[_0x8327('0x10')][_0x276925['queue']];if(ut[_0x8327('0x138')](_0x114286[_0x8327('0x139')])){if(_0x276925[_0x8327('0xaf')]){rpcDb[_0x8327('0x112')](_0x276925[_0x8327('0x106')]);}if(_0x276925[_0x8327('0xcb')]){rpcDb[_0x8327('0x8d')](_0x276925[_0x8327('0x106')]);}ami[_0x8327('0xb5')]('custom:agentringnoanswer',ut[_0x8327('0xa6')](_0x276925,'rejected'));this[_0x8327('0xef')](_0x42f308,_0x100a1e,_0x114286);}else{_0x276925[_0x8327('0x8e')]=moment()['format'](_0x8327('0x8f'));ut['logAgent'](_0x42f308,0x4,_0x8327('0x13a'));rpcDb[_0x8327('0xf4')](_0x42f308,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x8327('0x13b')]=function(_0xfdbd1e){var _0x273fce=this;var _0x5a0c8c=this[_0x8327('0x12')][_0xfdbd1e[_0x8327('0xc3')]];var _0x2a171c;if(_0x5a0c8c){_0x2a171c=this[_0x8327('0x10')][_0x5a0c8c[_0x8327('0x71')]];logger[_0x8327('0x59')](_0x8327('0x13c'),_0xfdbd1e['linkedid'],_0x8327('0xb4'),_0x2a171c[_0x8327('0x23')],_0x8327('0x72'),_0x2a171c[_0x8327('0x27')]);}if(this['actions'][_0xfdbd1e['linkedid']]&&_0xfdbd1e[_0x8327('0xc3')]!==_0xfdbd1e[_0x8327('0xc2')]){if(_0xfdbd1e[_0x8327('0x13d')]==='16'&&this[_0x8327('0x12')][_0xfdbd1e[_0x8327('0xc3')]][_0x8327('0x7c')]){this[_0x8327('0xa2')](_0xfdbd1e,_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e['cause']);}else if(this[_0x8327('0x12')][_0xfdbd1e[_0x8327('0xc3')]]['dialAnswer']){logger['info'](_0x8327('0x13e'),_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e[_0x8327('0x13d')],'\x20Queue',_0x2a171c[_0x8327('0x23')],'pTalking:\x20',_0x2a171c['pTalking']);this['callProgressDetectingCustomer'](_0xfdbd1e,_0xfdbd1e['linkedid'],_0xfdbd1e[_0x8327('0x13d')]);}}else if(_0x5a0c8c&&_[_0x8327('0x6e')](_0x5a0c8c[_0x8327('0x13f')])&&_0x2a171c[_0x8327('0x140')]&&_0xfdbd1e[_0x8327('0xc3')]===_0xfdbd1e[_0x8327('0xc2')]&&_['isNil'](_0xfdbd1e[_0x8327('0xf2')])&&_0xfdbd1e['cause']==='16'&&_0xfdbd1e['channelstate']==='6'&&_['isUndefined'](_0x5a0c8c[_0x8327('0x141')])){if(_0x5a0c8c[_0x8327('0xaf')]){rpcDb['unlockContact'](_0x5a0c8c[_0x8327('0x106')]);}if(_0x5a0c8c[_0x8327('0xcb')]){rpcDb[_0x8327('0x8d')](_0x5a0c8c[_0x8327('0x106')]);}_0xfdbd1e[_0x8327('0xf2')]='22';this['callProgressDetectingAgent'](_0x5a0c8c,_0x2a171c,_0xfdbd1e);}else if(_0x5a0c8c&&_0x5a0c8c[_0x8327('0x141')]){if(_0xfdbd1e[_0x8327('0x13d')]==='16'&&this[_0x8327('0x12')][_0xfdbd1e['linkedid']]['dialAnswer']){logger['info'](_0x8327('0x142'),_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e['cause'],_0x8327('0xb4'),_0x2a171c['name'],'pTalking:\x20',_0x2a171c['pTalking']);this[_0x8327('0xa2')](_0xfdbd1e,_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e[_0x8327('0x13d')]);}else if(this[_0x8327('0x12')][_0xfdbd1e[_0x8327('0xc3')]][_0x8327('0x7c')]){logger[_0x8327('0x59')]('[syncHangup][talking][cause]',_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e[_0x8327('0x13d')],_0x8327('0xb4'),_0x2a171c[_0x8327('0x23')],_0x8327('0x72'),_0x2a171c[_0x8327('0x27')]);this['callProgressDetectingCustomer'](_0xfdbd1e,_0xfdbd1e[_0x8327('0xc3')],_0xfdbd1e[_0x8327('0x13d')]);}}};Preview[_0x8327('0x65')][_0x8327('0x1b')]=function(_0x33afa1){if(this['actions'][_0x33afa1['destlinkedid']]&&_0x33afa1[_0x8327('0xee')]!==_0x33afa1[_0x8327('0x143')]){this[_0x8327('0xa2')](_0x33afa1,_0x33afa1[_0x8327('0xee')],_0x33afa1[_0x8327('0xe8')]);}};Preview[_0x8327('0x65')]['syncHangupRequest']=function(_0x4c6b8d){if(this[_0x8327('0x12')][_0x4c6b8d['linkedid']]&&_0x4c6b8d[_0x8327('0xc3')]!==_0x4c6b8d[_0x8327('0xc2')]&&!this[_0x8327('0x12')][_0x4c6b8d['linkedid']][_0x8327('0x7c')]){if(_0x4c6b8d['cause']==='1'){this['callProgressDetectingCustomer'](_0x4c6b8d,_0x4c6b8d[_0x8327('0xc3')],_0x4c6b8d['cause']);}}};Preview[_0x8327('0x65')][_0x8327('0x144')]=function(_0x41bea1,_0x30c40b,_0x53fb21){if(this[_0x8327('0x12')][_0x41bea1]){if(_[_0x8327('0x6e')](this[_0x8327('0x12')][_0x41bea1][_0x8327('0x145')])){this[_0x8327('0x12')][_0x41bea1]['variables']={};}this[_0x8327('0x12')][_0x41bea1]['variables'][_0x30c40b]=_0x53fb21;}};Preview[_0x8327('0x65')][_0x8327('0x146')]=function(_0x599acb){try{if(!_[_0x8327('0x6e')](_0x599acb)){if(ut[_0x8327('0x147')](_[_0x8327('0x148')](_0x599acb['variable'])[0x0])){this[_0x8327('0x144')](_0x599acb[_0x8327('0xc2')],_[_0x8327('0x148')](_0x599acb[_0x8327('0x149')])[0x0],_0x599acb[_0x8327('0x14a')]);}}}catch(_0x196b42){logger[_0x8327('0x14b')](_0x8327('0x14c'),util[_0x8327('0x14d')](_0x196b42,{'showHidden':![],'depth':null}));}};Preview[_0x8327('0x65')][_0x8327('0x1e')]=function(_0x1f7ff5){if(_0x1f7ff5){if(this[_0x8327('0x12')][_0x1f7ff5[_0x8327('0x14e')]]){this[_0x8327('0x12')][_0x1f7ff5[_0x8327('0x14e')]][_0x8327('0x141')]=!![];}}};Preview['prototype'][_0x8327('0x20')]=function(_0x4a40f5){if(_0x4a40f5){if(this[_0x8327('0x12')][_0x4a40f5[_0x8327('0x14f')]]){this['actions'][_0x4a40f5[_0x8327('0x14f')]][_0x8327('0x141')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x9f8b=['[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','substring','trim','phone','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','disableContact','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','keys','variable','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./action','redis','localhost','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','dialend','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','dialMethod','clearZombieChannels','hasOwnProperty','outbound','setMessage','recallMe','clearZombieChannel','enqueue','isNil','actions','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','sendMessageOneNotActive','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','pTalking:\x20','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','dialBusyMaxRetry','rescheduleContact','scheduledAt','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','custom:agentreject','agentreject'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9f8b,0x77));var _0xb9f8=function(_0x33bad8,_0xa77a59){_0x33bad8=_0x33bad8-0x0;var _0xed1658=_0x9f8b[_0x33bad8];return _0xed1658;};'use strict';var util=require(_0xb9f8('0x0'));var _=require(_0xb9f8('0x1'));var BPromise=require(_0xb9f8('0x2'));var uuid=require(_0xb9f8('0x3'));var moment=require(_0xb9f8('0x4'));var md5=require(_0xb9f8('0x5'));var Redis=require(_0xb9f8('0x6'));var config=require(_0xb9f8('0x7'));var logger=require(_0xb9f8('0x8'))(_0xb9f8('0x9'));var loggerAction=require(_0xb9f8('0x8'))(_0xb9f8('0xa'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xb9f8('0xb'));var ut=require('./util/util');config[_0xb9f8('0xc')]=_['defaults'](config[_0xb9f8('0xc')],{'host':_0xb9f8('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb9f8('0xe')]['enqueue']=function(_0x29402e){this[_0xb9f8('0xf')]=this[_0xb9f8('0xf')]?this[_0xb9f8('0xf')]['finally'](_0x29402e):_0x29402e();};function Preview(_0x125d99){this[_0xb9f8('0x10')]=new Sequence();this[_0xb9f8('0x11')]=_0x125d99[_0xb9f8('0x12')];this[_0xb9f8('0x13')]=_0x125d99[_0xb9f8('0x13')];this['actions']={};this[_0xb9f8('0x14')]=_0x125d99[_0xb9f8('0x14')];this[_0xb9f8('0x15')]=0x0;ami['on']('originateresponse',this[_0xb9f8('0x16')][_0xb9f8('0x17')](this));ami['on'](_0xb9f8('0x18'),this['syncHangup']['bind'](this));ami['on'](_0xb9f8('0x19'),this['syncHangupRequest']['bind'](this));ami['on'](_0xb9f8('0x1a'),this['syncDialEnd'][_0xb9f8('0x17')](this));ami['on']('newexten',this[_0xb9f8('0x1b')][_0xb9f8('0x17')](this));ami['on'](_0xb9f8('0x1c'),this['syncVarSet'][_0xb9f8('0x17')](this));ami['on'](_0xb9f8('0x1d'),this['syncAttendedTransfer'][_0xb9f8('0x17')](this));ami['on'](_0xb9f8('0x1e'),this[_0xb9f8('0x1f')][_0xb9f8('0x17')](this));this[_0xb9f8('0x20')](this[_0xb9f8('0x11')]);}function emit(_0x13730c,_0x4109d4,_0x94f5a7){io['to'](_0x13730c)[_0xb9f8('0x21')](_0x4109d4,_0x94f5a7);}function emitCampaignPreview(_0x1d31b4){if(_0x1d31b4[_0xb9f8('0x22')]==='outbound'){var _0x5117f7={'id':_0x1d31b4['id'],'name':_0x1d31b4[_0xb9f8('0x23')],'strategy':_0x1d31b4[_0xb9f8('0x24')],'answered':_0x1d31b4[_0xb9f8('0x25')],'available':_0x1d31b4[_0xb9f8('0x26')],'loggedIn':_0x1d31b4[_0xb9f8('0x27')],'pTalking':_0x1d31b4[_0xb9f8('0x28')],'sumBillable':_0x1d31b4['sumBillable'],'sumDuration':_0x1d31b4['sumDuration'],'sumHoldTime':_0x1d31b4[_0xb9f8('0x29')]||0x0,'talking':_0x1d31b4['talking'],'total':_0x1d31b4[_0xb9f8('0x2a')],'type':_0x1d31b4[_0xb9f8('0x22')],'unmanaged':_0x1d31b4[_0xb9f8('0x2b')],'abandoned':_0x1d31b4[_0xb9f8('0x2c')],'waiting':_0x1d31b4[_0xb9f8('0x2d')],'loggedInDb':_0x1d31b4[_0xb9f8('0x2e')],'dialActive':_0x1d31b4[_0xb9f8('0x2f')],'dialMethod':_0x1d31b4['dialMethod'],'dialOriginateCallerIdName':_0x1d31b4['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1d31b4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1d31b4['dialOriginateTimeout'],'dialPrefix':_0x1d31b4[_0xb9f8('0x30')],'outboundAnswerAgiCallsDay':_0x1d31b4[_0xb9f8('0x31')],'outboundAnswerCallsDay':_0x1d31b4[_0xb9f8('0x32')],'outboundBlacklistCallsDay':_0x1d31b4[_0xb9f8('0x33')],'outboundBusyCallsDay':_0x1d31b4['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1d31b4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1d31b4[_0xb9f8('0x34')],'outboundDropCallsDayCallersExit':_0x1d31b4['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1d31b4[_0xb9f8('0x35')],'outboundNoAnswerCallsDay':_0x1d31b4[_0xb9f8('0x36')],'outboundNoSuchCallsDay':_0x1d31b4[_0xb9f8('0x37')],'outboundOriginateFailureCallsDay':_0x1d31b4[_0xb9f8('0x38')],'outboundReCallsDay':_0x1d31b4[_0xb9f8('0x39')],'outboundRejectCallsDay':_0x1d31b4[_0xb9f8('0x3a')],'outboundUnknownCallsDay':_0x1d31b4[_0xb9f8('0x3b')],'outboundAbandonedCallsDay':_0x1d31b4[_0xb9f8('0x3c')],'predictiveIntervalAnsweredCalls':_0x1d31b4[_0xb9f8('0x3d')],'predictiveIntervalAvgHoldtime':_0x1d31b4[_0xb9f8('0x3e')],'predictiveIntervalAvgTalktime':_0x1d31b4[_0xb9f8('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x1d31b4[_0xb9f8('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x1d31b4[_0xb9f8('0x41')],'predictiveIntervalErlangCalls':_0x1d31b4[_0xb9f8('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d31b4[_0xb9f8('0x43')],'predictiveIntervalHitRate':_0x1d31b4['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1d31b4[_0xb9f8('0x44')],'predictiveIntervalPauses':_0x1d31b4[_0xb9f8('0x45')],'predictiveIntervalAvailable':_0x1d31b4[_0xb9f8('0x46')],'predictiveIntervalTotalCalls':_0x1d31b4[_0xb9f8('0x47')],'message':_0x1d31b4[_0xb9f8('0x48')],'originated':_0x1d31b4[_0xb9f8('0x49')],'erlangCalls':_0x1d31b4[_0xb9f8('0x4a')],'erlangCallToSecond':_0x1d31b4['erlangCallToSecond'],'erlangAbandonmentRate':_0x1d31b4[_0xb9f8('0x4b')],'erlangBusyFactor':_0x1d31b4[_0xb9f8('0x4c')],'startPredictive':_0x1d31b4[_0xb9f8('0x4d')],'startProgressive':_0x1d31b4[_0xb9f8('0x4e')]};if(_0x1d31b4[_0xb9f8('0x4f')]){_0x5117f7[_0xb9f8('0x4f')]={'id':_0x1d31b4['Trunk']['id'],'name':_0x1d31b4['Trunk'][_0xb9f8('0x23')],'active':_0x1d31b4['Trunk'][_0xb9f8('0x50')],'callerid':_0x1d31b4[_0xb9f8('0x4f')]['callerid']};}if(_0x1d31b4[_0xb9f8('0x51')]){_0x5117f7[_0xb9f8('0x51')]={'id':_0x1d31b4[_0xb9f8('0x51')]['id'],'name':_0x1d31b4[_0xb9f8('0x51')][_0xb9f8('0x23')]};}var _0x5576d8=md5(JSON[_0xb9f8('0x52')](_0x5117f7));if(_0x1d31b4[_0xb9f8('0x5')]!==_0x5576d8){_0x1d31b4[_0xb9f8('0x5')]=_0x5576d8;emit(util['format'](_0xb9f8('0x53'),_0x5117f7[_0xb9f8('0x23')]),_0xb9f8('0x54'),_0x5117f7);}}}function emitVoiceQueueChannelRemove(_0x1cdb8c){logger[_0xb9f8('0x55')](_0xb9f8('0x56'),JSON['stringify'](_0x1cdb8c));emit(util[_0xb9f8('0x57')](_0xb9f8('0x53'),_0x1cdb8c['name']),_0xb9f8('0x58'),_0x1cdb8c);}function notSendMessagesQueue(_0x323887){if(_0x323887['sendMessageOneNotActive']){if(_0x323887[_0xb9f8('0x49')]===0x0&&_0x323887[_0xb9f8('0x28')]===0x0){_0x323887['sendMessageOneNotActive']=![];_0x323887[_0xb9f8('0x26')]=0x0;_0x323887['paused']=0x0;_0x323887[_0xb9f8('0x48')]=_0xb9f8('0x59');ut[_0xb9f8('0x5a')](_0xb9f8('0x5b'),_0x323887['name']+_0xb9f8('0x5c'));}else{_0x323887[_0xb9f8('0x48')]='IS_DISACTIVED';ut[_0xb9f8('0x5a')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x323887[_0xb9f8('0x23')]+_0xb9f8('0x5d'));}emitCampaignPreview(_0x323887);}}Preview['prototype'][_0xb9f8('0x20')]=function(){var _0x4f9e05=this;setInterval(function(){_0x4f9e05[_0xb9f8('0x5e')]();},0x7cf);};Preview[_0xb9f8('0xe')][_0xb9f8('0x5e')]=function(){var _0x31969c=this['campaignsPreview'];this[_0xb9f8('0x15')]+=0x1;for(var _0x2f4878 in _0x31969c){if(_0x31969c['hasOwnProperty'](_0x2f4878)&&(_0x31969c[_0x2f4878][_0xb9f8('0x5f')]===_0xb9f8('0x9')||_0x31969c[_0x2f4878][_0xb9f8('0x5f')]==='booked')&&_0x31969c[_0x2f4878][_0xb9f8('0x22')]==='outbound'){if(this[_0xb9f8('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xb9f8('0x60')]();}}if(_0x31969c[_0xb9f8('0x61')](_0x2f4878)&&_0x31969c[_0x2f4878][_0xb9f8('0x5f')]===_0xb9f8('0x9')&&_0x31969c[_0x2f4878]['type']===_0xb9f8('0x62')){if(_0x31969c[_0x2f4878]['dialActive']){this[_0xb9f8('0x63')](_0x31969c[_0x2f4878]);this[_0xb9f8('0x64')](_0x31969c[_0x2f4878]);}else{notSendMessagesQueue(_0x31969c[_0x2f4878]);}}}};Preview[_0xb9f8('0xe')][_0xb9f8('0x65')]=function(_0x1582c1){var _0x4a50d3=this;this[_0xb9f8('0x10')][_0xb9f8('0x66')](function(){if(!_[_0xb9f8('0x67')](_0x4a50d3[_0xb9f8('0x68')][_0x1582c1])){loggerAction['info']('[clearZombieChannels][talking]',_0x1582c1,_0xb9f8('0x69'),_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6a')],_0xb9f8('0x6b'),JSON[_0xb9f8('0x52')](_0x4a50d3[_0xb9f8('0x11')][_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6a')]][_0xb9f8('0x49')]),'pTalking:\x20',JSON['stringify'](_0x4a50d3['campaignsPreview'][_0x4a50d3[_0xb9f8('0x68')][_0x1582c1]['queue']]['pTalking']),JSON[_0xb9f8('0x52')](_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6c')]),JSON[_0xb9f8('0x52')](_[_0xb9f8('0x6d')](_0x4a50d3[_0xb9f8('0x68')][_0x1582c1],[_0xb9f8('0x6e'),_0xb9f8('0x6f'),_0xb9f8('0x70'),'ListId'])));return ami[_0xb9f8('0x71')]({'action':'status','channel':_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x72')]})[_0xb9f8('0x73')](function(_0x1701f3){if(_0x1701f3[_0xb9f8('0x48')]===_0xb9f8('0x74')){setTimeout(function(){if(_0x4a50d3[_0xb9f8('0x68')][_0x1582c1]){ut['updateOriginated'](_0x4a50d3['campaignsPreview'][_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6a')]],_0xb9f8('0x75'));if(_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6c')]===!![]){ut[_0xb9f8('0x76')](_0x4a50d3['campaignsPreview'][_0x4a50d3[_0xb9f8('0x68')][_0x1582c1]['queue']],_0xb9f8('0x75'));ut[_0xb9f8('0x77')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1582c1,_0x4a50d3['actions'][_0x1582c1]['queue']);}ut[_0xb9f8('0x77')](_0xb9f8('0x78')+_0x1582c1,_0x4a50d3[_0xb9f8('0x68')][_0x1582c1][_0xb9f8('0x6a')]);delete _0x4a50d3[_0xb9f8('0x68')][_0x1582c1];}},0x2328);}});}});};Preview[_0xb9f8('0xe')]['clearZombieChannels']=function(){var _0x164dc9=this;loggerAction[_0xb9f8('0x55')](_0xb9f8('0x79'),_[_0xb9f8('0x7a')](this[_0xb9f8('0x68')]));for(var _0x17ab68 in this[_0xb9f8('0x68')]){if(_0x164dc9[_0xb9f8('0x68')][_0xb9f8('0x61')](_0x17ab68)){_0x164dc9[_0xb9f8('0x65')](_0x17ab68);}}};Preview[_0xb9f8('0xe')][_0xb9f8('0x64')]=function(_0x541d13){var _0x2c203c=this;rpcDb[_0xb9f8('0x7b')](_0x541d13['id'],ut[_0xb9f8('0x7c')](this[_0xb9f8('0x14')]))[_0xb9f8('0x7d')](function(_0x187506){if(!_[_0xb9f8('0x67')](_0x187506)){for(var _0x5f19ea=0x0;_0x5f19ea<_0x187506['length'];_0x5f19ea+=0x1){if(ut[_0xb9f8('0x7e')](_0x187506[_0x5f19ea][_0xb9f8('0x7f')])<_0x541d13[_0xb9f8('0x80')]*0x3c){if(_0x187506[_0x5f19ea][_0xb9f8('0x81')]&&!_0x187506[_0x5f19ea]['Agent'][_0xb9f8('0x82')]){_0x2c203c['run'](_0x187506[_0x5f19ea]['id'])[_0xb9f8('0x7d')](ut[_0xb9f8('0x83')](_0xb9f8('0x84')))['catch'](ut[_0xb9f8('0x83')](_0xb9f8('0x84')));}else{rpcDb['disableContact'](_0x187506[_0x5f19ea]['id']);}}else{var _0x383076=new Action(_0x187506[_0x5f19ea],_0x541d13);_0x383076['starttime']=moment()[_0xb9f8('0x57')](_0xb9f8('0x85'));_0x541d13[_0xb9f8('0x39')]+=0x1;ut[_0xb9f8('0x86')](_0x383076,0x17,_0xb9f8('0x87'));if(_0x541d13[_0xb9f8('0x88')]){rpcDb[_0xb9f8('0x89')](ut['createBody'](_0x187506[_0x5f19ea]));rpcDb['createCustomerHistory'](_0x383076,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xb9f8('0x86')](_0x383076,0x16,_0xb9f8('0x8a'));rpcDb[_0xb9f8('0x8b')](_0x383076,_0xb9f8('0x8c'));rpcDb['createCustomerFinal'](_0x383076,'[HistoryRecallClose]');}}}}})[_0xb9f8('0x73')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xb9f8('0xe')]['setMessage']=function(_0x2daf95){_0x2daf95[_0xb9f8('0x8d')]=!![];if(ut['IsNotLoggedIn'](_0x2daf95[_0xb9f8('0x27')])){_0x2daf95[_0xb9f8('0x48')]=_0xb9f8('0x8e');}else if(!ut[_0xb9f8('0x8f')](_0x2daf95['dialActive'])){_0x2daf95[_0xb9f8('0x48')]=_0xb9f8('0x59');}else if(!this[_0xb9f8('0x90')](_0x2daf95[_0xb9f8('0x4f')])){if(!this['isTrunkReachable'](_0x2daf95[_0xb9f8('0x91')])){_0x2daf95[_0xb9f8('0x48')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2daf95['message']=_0xb9f8('0x92');}}else{_0x2daf95['message']=_0xb9f8('0x92');}emitCampaignPreview(_0x2daf95);};Preview[_0xb9f8('0xe')][_0xb9f8('0x93')]=function(_0x1353b7,_0x280563,_0x23dddd){var _0x5e79b3=this;var _0x5784f4=this[_0xb9f8('0x68')][_0x280563];var _0x39f1f5=this[_0xb9f8('0x11')][_0x5784f4[_0xb9f8('0x6a')]];var _0xf3417d;if(_0x39f1f5){switch(_0x23dddd){case'1':_0x39f1f5[_0xb9f8('0x37')]+=0x1;_0x5784f4[_0xb9f8('0x94')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x0,_0xb9f8('0x97'));ami[_0xb9f8('0x21')](_0xb9f8('0x98'),ut[_0xb9f8('0x99')](_0x5784f4,'nosuchnumber'));rpcDb[_0xb9f8('0x8b')](_0x5784f4,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5['dialGlobalMaxRetry']){_0xf3417d=ut[_0xb9f8('0x9a')](_0x5784f4,0xf,'Global');rpcDb[_0xb9f8('0x9b')](_0xf3417d,_0xb9f8('0x9c'));}else{if(_0x5784f4['countnosuchnumberretry']>=_0x39f1f5[_0xb9f8('0x9d')]){rpcDb[_0xb9f8('0x9b')](_0x5784f4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5784f4,_0xb9f8('0x94'),_0x39f1f5['dialNoSuchNumberRetryFrequency']),_0x5784f4['unlockAgent'],_0x5784f4[_0xb9f8('0x9e')]);}}delete this[_0xb9f8('0x68')][_0x1353b7[_0xb9f8('0x9f')]];break;case _0xb9f8('0xa0'):var _0x5389ca=moment()[_0xb9f8('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x5784f4[_0xb9f8('0xa1')]=_0x5389ca;_0x5784f4[_0xb9f8('0xa2')]=_0x5389ca;_0x5784f4['dialAnswer']=!![];_0x39f1f5[_0xb9f8('0x28')]+=0x1;logger[_0xb9f8('0x55')](_0xb9f8('0xa3'),_0x5784f4['uniqueid'],_0xb9f8('0xa4'),_0x39f1f5[_0xb9f8('0x23')],'pTalking:\x20',_0x39f1f5['pTalking']);ami['emit'](_0xb9f8('0xa5'),ut['buildObj'](_0x5784f4,_0xb9f8('0xa6')));if(_0x39f1f5[_0xb9f8('0xa7')]){ami[_0xb9f8('0x21')](_0xb9f8('0xa8'),ut[_0xb9f8('0xa9')](_0x5784f4));}break;case'16':ami[_0xb9f8('0x21')](_0xb9f8('0xaa'),ut['buildObj'](_0x5784f4,'complete'));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5784f4,'complete'));_0x39f1f5[_0xb9f8('0x32')]+=0x1;_0x39f1f5[_0xb9f8('0x2a')]+=0x1;_0x39f1f5['answered']+=0x1;ut[_0xb9f8('0x76')](_0x39f1f5,'[16]');_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x4,_0xb9f8('0xab'));rpcDb[_0xb9f8('0x8b')](_0x5784f4,_0xb9f8('0xac'));rpcDb[_0xb9f8('0x9b')](_0x5784f4,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x5784f4);_0x39f1f5[_0xb9f8('0xad')]+=_0x5784f4[_0xb9f8('0xae')];_0x39f1f5[_0xb9f8('0xaf')]+=_0x5784f4[_0xb9f8('0xae')];logger['info'](_0xb9f8('0xb0'),_0x5784f4[_0xb9f8('0xb1')],_0xb9f8('0xa4'),_0x39f1f5[_0xb9f8('0x23')],_0xb9f8('0xb2'),_0x39f1f5[_0xb9f8('0x28')]);delete this[_0xb9f8('0x68')][_0x1353b7[_0xb9f8('0x9f')]];break;case _0xb9f8('0xb3'):_0x39f1f5['outboundBusyCallsDay']+=0x1;_0x5784f4[_0xb9f8('0xb4')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x5,_0xb9f8('0xb5'));ami['emit'](_0xb9f8('0xb6'),ut['buildObj'](_0x5784f4,_0xb9f8('0xb7')));rpcDb['createCustomerHistory'](_0x5784f4,_0xb9f8('0xb8'));if(ut['totalGlobal'](_0x5784f4)>=_0x39f1f5[_0xb9f8('0xb9')]){_0xf3417d=ut[_0xb9f8('0x9a')](_0x5784f4,0xf,_0xb9f8('0xba'));rpcDb[_0xb9f8('0x9b')](_0xf3417d,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5784f4[_0xb9f8('0xb4')]>=_0x39f1f5[_0xb9f8('0xbb')]){rpcDb['createCustomerFinal'](_0x5784f4,_0xb9f8('0xb8'));}else{rpcDb[_0xb9f8('0xbc')](ut[_0xb9f8('0xbd')](_0x5784f4,'countbusyretry',_0x39f1f5['dialBusyRetryFrequency']),_0x5784f4[_0xb9f8('0xbe')],_0x5784f4['activeContact']);}}break;case _0xb9f8('0xbf'):_0x39f1f5[_0xb9f8('0x36')]+=0x1;_0x5784f4[_0xb9f8('0xc0')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x3,_0xb9f8('0xc1'));ami[_0xb9f8('0x21')](_0xb9f8('0xc2'),ut[_0xb9f8('0x99')](_0x5784f4,_0xb9f8('0xc3')));rpcDb['createCustomerHistory'](_0x5784f4,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5[_0xb9f8('0xb9')]){_0xf3417d=ut['cloneAction'](_0x5784f4,0xf,'Global');rpcDb[_0xb9f8('0x9b')](_0xf3417d,_0xb9f8('0xc4'));}else{if(_0x5784f4[_0xb9f8('0xc0')]>=_0x39f1f5['dialNoAnswerMaxRetry']){rpcDb[_0xb9f8('0x9b')](_0x5784f4,_0xb9f8('0xc5'));}else{rpcDb[_0xb9f8('0xbc')](ut[_0xb9f8('0xbd')](_0x5784f4,_0xb9f8('0xc0'),_0x39f1f5[_0xb9f8('0xc6')]),_0x5784f4[_0xb9f8('0xbe')],_0x5784f4[_0xb9f8('0x9e')]);}}break;case _0xb9f8('0xc7'):_0x39f1f5[_0xb9f8('0xc8')]+=0x1;_0x5784f4['countcongestionretry']+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut['totalGlobal'](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x8,'Congestion');ami[_0xb9f8('0x21')]('custom:agentcongestion',ut[_0xb9f8('0x99')](_0x5784f4,_0xb9f8('0xc9')));rpcDb[_0xb9f8('0x8b')](_0x5784f4,_0xb9f8('0xca'));if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5[_0xb9f8('0xb9')]){_0xf3417d=ut[_0xb9f8('0x9a')](_0x5784f4,0xf,_0xb9f8('0xba'));rpcDb[_0xb9f8('0x9b')](_0xf3417d,_0xb9f8('0xcb'));}else{if(_0x5784f4[_0xb9f8('0xcc')]>=_0x39f1f5[_0xb9f8('0xcd')]){rpcDb[_0xb9f8('0x9b')](_0x5784f4,_0xb9f8('0xca'));}else{rpcDb[_0xb9f8('0xbc')](ut[_0xb9f8('0xbd')](_0x5784f4,_0xb9f8('0xcc'),_0x39f1f5[_0xb9f8('0xce')]),_0x5784f4[_0xb9f8('0xbe')],_0x5784f4[_0xb9f8('0x9e')]);}}break;case _0xb9f8('0xcf'):_0x39f1f5[_0xb9f8('0x3a')]+=0x1;_0x5784f4[_0xb9f8('0xd0')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0x14,'AgentReject');ami[_0xb9f8('0x21')](_0xb9f8('0xd1'),ut['buildObj'](_0x5784f4,_0xb9f8('0xd2')));rpcDb[_0xb9f8('0x8b')](_0x5784f4,_0xb9f8('0xd3'));if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5['dialGlobalMaxRetry']){_0xf3417d=ut[_0xb9f8('0x9a')](_0x5784f4,0x14,_0xb9f8('0xd4'));rpcDb[_0xb9f8('0x9b')](_0xf3417d,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x5784f4['countagentrejectretry']>=_0x39f1f5[_0xb9f8('0xd5')]){rpcDb[_0xb9f8('0x9b')](_0x5784f4,_0xb9f8('0xd6'));}else{rpcDb['rescheduleContact'](ut[_0xb9f8('0xbd')](_0x5784f4,_0xb9f8('0xd0'),_0x39f1f5['dialAgentRejectRetryFrequency']),_0x5784f4[_0xb9f8('0xbe')],_0x5784f4['activeContact']);}}break;case _0xb9f8('0xd7'):_0x39f1f5[_0xb9f8('0x3c')]+=0x1;_0x5784f4[_0xb9f8('0xd8')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut[_0xb9f8('0x96')](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0xb,'Abandoned');rpcDb[_0xb9f8('0x8b')](_0x5784f4,_0xb9f8('0xd9'));if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5['dialGlobalMaxRetry']){_0xf3417d=ut[_0xb9f8('0x9a')](_0x5784f4,0xf,_0xb9f8('0xba'));rpcDb[_0xb9f8('0x9b')](_0xf3417d,_0xb9f8('0xd9'));}else{if(_0x5784f4[_0xb9f8('0xda')]>=_0x39f1f5[_0xb9f8('0xdb')]){rpcDb['createCustomerFinal'](_0x5784f4,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb9f8('0xbc')](ut[_0xb9f8('0xbd')](_0x5784f4,_0xb9f8('0xd8'),_0x39f1f5[_0xb9f8('0xdc')]),_0x5784f4[_0xb9f8('0xbe')],_0x5784f4[_0xb9f8('0x9e')]);}}break;default:if(_0x5784f4['dialAnswer']){ut['decrementTalkink'](_0x39f1f5,_0xb9f8('0xdd'));ut['loggerError'](_0xb9f8('0xde')+_0x39f1f5[_0xb9f8('0x23')],_0x1353b7);}_0x39f1f5[_0xb9f8('0x3b')]+=0x1;_0x5784f4[_0xb9f8('0x95')]=ut['totalGlobal'](_0x5784f4);ut[_0xb9f8('0x86')](_0x5784f4,0xc,_0x1353b7[_0xb9f8('0xdf')]||_0x1353b7[_0xb9f8('0xe0')]);rpcDb[_0xb9f8('0x8b')](_0x5784f4,_0xb9f8('0xe1'));if(ut[_0xb9f8('0x96')](_0x5784f4)>=_0x39f1f5[_0xb9f8('0xb9')]){_0xf3417d=ut['cloneAction'](_0x5784f4,0xf,_0xb9f8('0xba'));rpcDb[_0xb9f8('0x9b')](_0xf3417d,_0xb9f8('0xe2'));}else{rpcDb[_0xb9f8('0x9b')](_0x5784f4,_0xb9f8('0xe2'));}delete this[_0xb9f8('0x68')][_0x1353b7[_0xb9f8('0x9f')]];}if(!(_0x5784f4[_0xb9f8('0x6c')]&&_0x23dddd==='16')){ut[_0xb9f8('0xe3')](_0x39f1f5,_0xb9f8('0xe4'));logger['info'](_0xb9f8('0xe5'),_0x5784f4[_0xb9f8('0xb1')],_0xb9f8('0xa4'),_0x39f1f5['name'],_0xb9f8('0x6b'),_0x39f1f5['originated']);}if(_0x23dddd!=='ANSWER'){delete this[_0xb9f8('0x68')][_0x1353b7[_0xb9f8('0x9f')]];delete this['actions'][_0x1353b7[_0xb9f8('0xe6')]];}}};Preview['prototype'][_0xb9f8('0xe7')]=function(_0x44a7b1,_0x1801fd,_0x26bc37){if(_['isUndefined'](_0x1801fd)&&'object'!==typeof _0x1801fd){return;}if(_[_0xb9f8('0xe8')](_0x26bc37)&&_0xb9f8('0xe9')!==typeof _0x26bc37){return;}switch(_0x26bc37[_0xb9f8('0xea')]){case'0':ut[_0xb9f8('0xeb')](_0x44a7b1,0x0,_0xb9f8('0x97'));rpcDb[_0xb9f8('0xec')](_0x44a7b1,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x44a7b1,0x3,'NoAnswer');rpcDb[_0xb9f8('0xec')](_0x44a7b1,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x44a7b1,0x5,'Busy');rpcDb[_0xb9f8('0xec')](_0x44a7b1,_0xb9f8('0xed'));break;case'8':ut[_0xb9f8('0xeb')](_0x44a7b1,0x8,_0xb9f8('0xee'));rpcDb['createAgentHistory'](_0x44a7b1,_0xb9f8('0xef'));break;case'22':ut['logAgent'](_0x44a7b1,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x44a7b1,_0xb9f8('0xf0'));break;default:ut[_0xb9f8('0xeb')](_0x44a7b1,0xc,_0x26bc37[_0xb9f8('0xea')]);rpcDb[_0xb9f8('0xec')](_0x44a7b1,_0xb9f8('0xef'));}ut[_0xb9f8('0xe3')](_0x1801fd,'[callProgressDetectingAgent]');logger[_0xb9f8('0x55')]('[originated][decrement][callProgressDetectingAgent]',_0x44a7b1[_0xb9f8('0xb1')],'\x20Queue',_0x1801fd[_0xb9f8('0x23')],_0xb9f8('0x6b'),_0x1801fd[_0xb9f8('0x49')]);delete this[_0xb9f8('0x68')][_0x44a7b1[_0xb9f8('0xb1')]];};Preview[_0xb9f8('0xe')][_0xb9f8('0xf1')]=function(_0x6ad902,_0x31c163,_0x164c38,_0x319455,_0x114206){var _0x30919e=this;return new BPromise(function(_0x162e6a,_0x2b64cf){if(_[_0xb9f8('0x67')](_0x31c163)||_[_0xb9f8('0x67')](_0x31c163['Contact'])||_[_0xb9f8('0x67')](_0x31c163[_0xb9f8('0xf2')]['phone'])||_[_0xb9f8('0x67')](_0x31c163[_0xb9f8('0x70')])){_0x2b64cf(ut[_0xb9f8('0x48')](_0xb9f8('0xf3'),_0x319455,_0x114206));return;}var _0xb4e6cb=uuid['v4']();var _0x11c51b=_0x30919e['campaignsPreview'][_0x31c163['Queue'][_0xb9f8('0x23')]];var _0x5bb2cb=_0x164c38?_0x30919e[_0xb9f8('0x14')][_0x164c38]['id']:undefined;_0x30919e[_0xb9f8('0x68')][_0xb4e6cb]=new Action(_0x31c163,_0x11c51b,_0xb4e6cb,_0x164c38,_0x5bb2cb);var _0x1226a2=_0x30919e['actions'][_0xb4e6cb];_0x1226a2[_0xb9f8('0xbe')]=_0x319455;_0x1226a2[_0xb9f8('0x9e')]=_0x114206;_0x1226a2[_0xb9f8('0xf4')]=_0x164c38;if(_[_0xb9f8('0xf5')](_0x6ad902)){_0x30919e[_0xb9f8('0xf6')](_0x1226a2,_0x11c51b,_0x31c163,_0x164c38)['then'](function(_0x2af519){logger[_0xb9f8('0x55')](_0xb9f8('0xf7'),_0xb9f8('0xf8')+_0x1226a2['queue']+'\x20IdHopper:\x20'+_0x1226a2[_0xb9f8('0xf9')],JSON['stringify'](_0x2af519));ami['emit'](_0xb9f8('0xfa'),ut[_0xb9f8('0x99')](_0x1226a2,_0xb9f8('0xfb')));_0x162e6a(ut[_0xb9f8('0x48')](_0xb9f8('0xfc')));})[_0xb9f8('0x73')](function(_0x6801b8){ut['logger'](_0xb9f8('0xfd'),_0x6801b8);_0x2b64cf(ut[_0xb9f8('0x48')]('Call\x20failed',_0x319455,_0x114206));});}else{_0x11c51b[_0xb9f8('0x33')]+=0x1;ut[_0xb9f8('0xfe')](_0x1226a2);rpcDb['createHistory'](_0x1226a2,'[Blacklist][error]');delete _0x30919e['actions'][_0xb4e6cb];_0x2b64cf(ut['message'](_0xb9f8('0xff'),_0x319455,_0x114206));}});};Preview['prototype'][_0xb9f8('0x90')]=function(_0x1f015){return!_['isNil'](_0x1f015)&&!_['isNil'](_0x1f015[_0xb9f8('0x23')])&&!_[_0xb9f8('0x67')](_0x1f015[_0xb9f8('0x50')])&&_0x1f015[_0xb9f8('0x50')]&&!_[_0xb9f8('0x67')](this['trunks'][util['format'](_0xb9f8('0x100'),_0x1f015[_0xb9f8('0x23')])])&&!_[_0xb9f8('0x67')](this[_0xb9f8('0x13')][util[_0xb9f8('0x57')]('SIP/%s',_0x1f015[_0xb9f8('0x23')])][_0xb9f8('0x101')])&&(this[_0xb9f8('0x13')][util[_0xb9f8('0x57')](_0xb9f8('0x100'),_0x1f015[_0xb9f8('0x23')])][_0xb9f8('0x101')]===_0xb9f8('0x102')||this[_0xb9f8('0x13')][util[_0xb9f8('0x57')]('SIP/%s',_0x1f015[_0xb9f8('0x23')])][_0xb9f8('0x101')]===_0xb9f8('0x103'));};Preview[_0xb9f8('0xe')]['run']=function(_0x114055,_0x398d43){var _0xc85df5=this;return new BPromise(function(_0xb798b5,_0x33d608){_0xc85df5[_0xb9f8('0x104')](_0x114055,_0x398d43)[_0xb9f8('0x7d')](function(_0x4956c8){_0xb798b5(_[_0xb9f8('0x6d')](_0x4956c8,['message']));})[_0xb9f8('0x73')](function(_0x149a24){if(_0x149a24[_0xb9f8('0x105')]){rpcDb[_0xb9f8('0x106')](_0x114055);}if(_0x149a24[_0xb9f8('0x50')]){rpcDb['disableContact'](_0x114055);}_0x33d608(_['pick'](_0x149a24,[_0xb9f8('0x48')]));});});};Preview[_0xb9f8('0xe')][_0xb9f8('0x104')]=function(_0x1eccc9,_0x17c5ae){var _0xa51e91=this;return new BPromise(function(_0xd21b29,_0x5af9d3){var _0xc0a1b,_0x2d2c07;rpcDb[_0xb9f8('0x107')](_0x1eccc9)[_0xb9f8('0x7d')](function(_0x45cf81){if(!_[_0xb9f8('0x67')](_0x45cf81[0x0])){_0x2d2c07=_0x45cf81[0x0][_0xb9f8('0x108')]?![]:!![];_0xc0a1b=_0x45cf81[0x0][_0xb9f8('0x108')]?!![]:![];_0xc0a1b=_0x17c5ae?!![]:_0xc0a1b;}var _0x27c42f=_0xa51e91['validateContact'](_0x45cf81);if(_0x27c42f[_0xb9f8('0x109')]){rpcDb[_0xb9f8('0x10a')](_[_0xb9f8('0x6d')](_0x45cf81[0x0],['VoiceQueueId',_0xb9f8('0x10b')]))[_0xb9f8('0x7d')](function(_0x42c471){_0xa51e91[_0xb9f8('0xf1')](_0x42c471,_0x45cf81[0x0],_0x17c5ae,_0x2d2c07,_0xc0a1b)[_0xb9f8('0x7d')](function(_0x16c043){_0xd21b29(_0x16c043);})[_0xb9f8('0x73')](function(_0x43c31b){_0x5af9d3(_0x43c31b);});})[_0xb9f8('0x73')](function(_0x4a6c92){ut['logger'](_0xb9f8('0x10c'),_0x4a6c92);_0x5af9d3(ut[_0xb9f8('0x48')]('Call\x20unsuccessful',_0x2d2c07,_0xc0a1b));});}else{_0x5af9d3(ut[_0xb9f8('0x48')](_0x27c42f[_0xb9f8('0x48')],_0x2d2c07,_0xc0a1b));}})[_0xb9f8('0x73')](function(_0x36fd53){ut[_0xb9f8('0x5a')](_0xb9f8('0x10d'),_0x36fd53);_0x5af9d3(ut[_0xb9f8('0x48')](_0xb9f8('0x10e'),![],!![]));});});};Preview[_0xb9f8('0xe')]['validateContact']=function(_0x4b69c1){if(_[_0xb9f8('0x67')](_0x4b69c1)||_[_0xb9f8('0xf5')](_0x4b69c1)||!_[_0xb9f8('0x67')](_0x4b69c1[0x0][_0xb9f8('0x81')])&&_[_0xb9f8('0x67')](_0x4b69c1[0x0][_0xb9f8('0x81')][_0xb9f8('0x23')])){ut['logger'](_0xb9f8('0x10f'),_0x4b69c1);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x24e900=this[_0xb9f8('0x11')][_0x4b69c1[0x0]['Queue'][_0xb9f8('0x23')]];_0x24e900[_0xb9f8('0x48')]=_0xb9f8('0x92');if(_[_0xb9f8('0x67')](_0x24e900)){ut[_0xb9f8('0x5a')](_0xb9f8('0x110'),_0x24e900);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xb9f8('0x90')](_0x24e900[_0xb9f8('0x4f')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x24e900[_0xb9f8('0x23')]+_0xb9f8('0x111'));if(!this['isTrunkReachable'](_0x24e900[_0xb9f8('0x91')])){ut[_0xb9f8('0x5a')](_0xb9f8('0x112'),_0x24e900['name']+_0xb9f8('0x113'));return{'isValid':![],'message':_0xb9f8('0x114')};}}if(!ut[_0xb9f8('0x8f')](_0x24e900[_0xb9f8('0x2f')])){ut[_0xb9f8('0x5a')](_0xb9f8('0x115'),_0x24e900[_0xb9f8('0x23')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xb9f8('0x116')+_0x24e900[_0xb9f8('0x23')]+_0xb9f8('0x117')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xb9f8('0xf6')]=function(_0x48a195,_0x29273e,_0xab0492,_0x454f62){var _0x1164a6=this;return new BPromise(function(_0x25d346,_0x32b04f){var _0x932d1=_0x48a195['uniqueid'];var _0x5efd62=_0x1164a6[_0xb9f8('0x90')](_0x29273e[_0xb9f8('0x4f')])?util[_0xb9f8('0x57')](_0xb9f8('0x118'),_0x29273e[_0xb9f8('0x4f')][_0xb9f8('0x23')],_['isNil'](_0x29273e['dialPrefix'])?'':_0x29273e[_0xb9f8('0x30')]['trim']()||'',_0x29273e[_0xb9f8('0x119')]>0x0?_0xab0492['Contact']['phone'][_0xb9f8('0x11a')](_0x29273e['dialCutDigit']):_0xab0492[_0xb9f8('0xf2')]['phone']):util[_0xb9f8('0x57')]('SIP/%s/%s%s',_[_0xb9f8('0x67')](_0x29273e[_0xb9f8('0x91')])?_0x29273e[_0xb9f8('0x4f')][_0xb9f8('0x23')]:_0x29273e['TrunkBackup'][_0xb9f8('0x23')],_[_0xb9f8('0x67')](_0x29273e[_0xb9f8('0x30')])?'':_0x29273e[_0xb9f8('0x30')][_0xb9f8('0x11b')]()||'',_0x29273e[_0xb9f8('0x119')]>0x0?_0xab0492[_0xb9f8('0xf2')][_0xb9f8('0x11c')][_0xb9f8('0x11a')](_0x29273e[_0xb9f8('0x119')]):_0xab0492['Contact']['phone']);var _0x15b4c5=_0x1164a6[_0xb9f8('0x90')](_0x29273e[_0xb9f8('0x4f')])?ut['getCallerId'](_0x29273e[_0xb9f8('0x4f')][_0xb9f8('0x11d')],_0x29273e[_0xb9f8('0x11e')],_0x29273e[_0xb9f8('0x11f')]>0x0?ut[_0xb9f8('0x120')](_0x29273e[_0xb9f8('0x121')],_0x29273e[_0xb9f8('0x11f')]):_0x29273e[_0xb9f8('0x121')]):ut[_0xb9f8('0x122')](_[_0xb9f8('0x67')](_0x29273e[_0xb9f8('0x91')])?_0x29273e['Trunk']['callerid']:_0x29273e[_0xb9f8('0x91')][_0xb9f8('0x11d')],_0x29273e[_0xb9f8('0x11e')],_0x29273e[_0xb9f8('0x11f')]>0x0?ut[_0xb9f8('0x120')](_0x29273e['dialOriginateCallerIdNumber'],_0x29273e[_0xb9f8('0x11f')]):_0x29273e[_0xb9f8('0x121')]);if(_0x15b4c5){_0x48a195[_0xb9f8('0x123')]=ut[_0xb9f8('0x124')](_0x15b4c5);_0x48a195[_0xb9f8('0x125')]=ut[_0xb9f8('0x126')](_0x15b4c5);}var _0x48e3dd=ut['addVariables'](_0x29273e,_0xab0492,_0x5efd62,_0x15b4c5,_0x932d1,_0x48a195);_[_0xb9f8('0x127')](_0x48a195,ut[_0xb9f8('0x128')](_0x48e3dd));_0x48a195[_0xb9f8('0x129')]=moment()[_0xb9f8('0x57')](_0xb9f8('0x85'));ami[_0xb9f8('0x71')](ut[_0xb9f8('0x12a')](_0x48a195,_0x29273e,_0x48e3dd,_0x48a195[_0xb9f8('0x9e')],_0x454f62))[_0xb9f8('0x7d')](function(_0x54d952){_0x29273e[_0xb9f8('0x49')]+=0x1;logger[_0xb9f8('0x55')](_0xb9f8('0x12b'),_0x932d1,_0xb9f8('0xa4'),_0x29273e[_0xb9f8('0x23')],_0xb9f8('0x6b'),_0x29273e['originated']);_0x25d346(_0x54d952);})[_0xb9f8('0x73')](function(_0x4974d2){ut[_0xb9f8('0xeb')](_0x48a195,0xe,_0xb9f8('0x12c'));rpcDb[_0xb9f8('0xec')](_0x48a195,_0xb9f8('0x12d'));_0x32b04f(_0x4974d2);});});};Preview[_0xb9f8('0xe')][_0xb9f8('0x1b')]=function(_0x3a1c15){if(this[_0xb9f8('0x68')][_0x3a1c15[_0xb9f8('0x9f')]]){this[_0xb9f8('0x68')][_0x3a1c15['linkedid']][_0xb9f8('0x72')]=_0x3a1c15[_0xb9f8('0x72')];}};Preview['prototype'][_0xb9f8('0x16')]=function(_0x5e93e5){var _0x42f9d3=this;var _0x407a8d=this['actions'][_0x5e93e5[_0xb9f8('0x12e')]];if(_0x407a8d){if(_0x407a8d['lookAgent']&&this[_0xb9f8('0x14')][_0x407a8d[_0xb9f8('0xf4')]]){ut[_0xb9f8('0x12f')](_0x407a8d,this[_0xb9f8('0x14')][_0x407a8d[_0xb9f8('0xf4')]][_0xb9f8('0x23')],this[_0xb9f8('0x14')][_0x407a8d['lookAgent']]['id']);}var _0x512374=_[_0xb9f8('0x130')](_0x407a8d);_0x512374['responsetime']=moment()[_0xb9f8('0x57')](_0xb9f8('0x85'));var _0x3eb0cb=_0x42f9d3[_0xb9f8('0x11')][_0x407a8d[_0xb9f8('0x6a')]];if(ut['isFailure'](_0x5e93e5[_0xb9f8('0x131')])){if(_0x407a8d[_0xb9f8('0xbe')]){rpcDb[_0xb9f8('0x106')](_0x407a8d[_0xb9f8('0xf9')]);}if(_0x407a8d['activeContact']){rpcDb['disableContact'](_0x407a8d[_0xb9f8('0xf9')]);}ami[_0xb9f8('0x21')](_0xb9f8('0x132'),ut['buildObj'](_0x407a8d,_0xb9f8('0x133')));this[_0xb9f8('0xe7')](_0x512374,_0x3eb0cb,_0x5e93e5);}else{_0x407a8d[_0xb9f8('0x129')]=moment()[_0xb9f8('0x57')](_0xb9f8('0x85'));ut[_0xb9f8('0xeb')](_0x512374,0x4,'Answer');rpcDb['createAgentHistory'](_0x512374,_0xb9f8('0x134'));}}};Preview['prototype'][_0xb9f8('0x135')]=function(_0x32af63){var _0x12bca0=this;var _0x88b610=this['actions'][_0x32af63[_0xb9f8('0x9f')]];var _0x9dfaf7;if(_0x88b610){_0x9dfaf7=this[_0xb9f8('0x11')][_0x88b610['queue']];logger[_0xb9f8('0x55')](_0xb9f8('0x136'),_0x32af63[_0xb9f8('0x9f')],_0xb9f8('0xa4'),_0x9dfaf7['name'],'pTalking:\x20',_0x9dfaf7[_0xb9f8('0x28')]);}if(this[_0xb9f8('0x68')][_0x32af63[_0xb9f8('0x9f')]]&&_0x32af63['linkedid']!==_0x32af63[_0xb9f8('0xb1')]){if(_0x32af63[_0xb9f8('0x137')]==='16'&&this[_0xb9f8('0x68')][_0x32af63[_0xb9f8('0x9f')]][_0xb9f8('0x6c')]){this[_0xb9f8('0x93')](_0x32af63,_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')]);}else if(this[_0xb9f8('0x68')][_0x32af63['linkedid']][_0xb9f8('0x6c')]){logger['info'](_0xb9f8('0x138'),_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')],_0xb9f8('0xa4'),_0x9dfaf7['name'],_0xb9f8('0xb2'),_0x9dfaf7[_0xb9f8('0x28')]);this[_0xb9f8('0x93')](_0x32af63,_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')]);}}else if(_0x88b610&&_[_0xb9f8('0x67')](_0x88b610['statedesc'])&&_0x9dfaf7['dialQueueProject']&&_0x32af63[_0xb9f8('0x9f')]===_0x32af63[_0xb9f8('0xb1')]&&_[_0xb9f8('0x67')](_0x32af63[_0xb9f8('0xea')])&&_0x32af63[_0xb9f8('0x137')]==='16'&&_0x32af63[_0xb9f8('0x139')]==='6'&&_[_0xb9f8('0xe8')](_0x88b610[_0xb9f8('0x13a')])){if(_0x88b610[_0xb9f8('0xbe')]){rpcDb[_0xb9f8('0x106')](_0x88b610['idContact']);}if(_0x88b610[_0xb9f8('0x9e')]){rpcDb[_0xb9f8('0x13b')](_0x88b610[_0xb9f8('0xf9')]);}_0x32af63[_0xb9f8('0xea')]='22';this[_0xb9f8('0xe7')](_0x88b610,_0x9dfaf7,_0x32af63);}else if(_0x88b610&&_0x88b610[_0xb9f8('0x13a')]){if(_0x32af63['cause']==='16'&&this[_0xb9f8('0x68')][_0x32af63[_0xb9f8('0x9f')]]['dialAnswer']){logger[_0xb9f8('0x55')](_0xb9f8('0x13c'),_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')],'\x20Queue',_0x9dfaf7[_0xb9f8('0x23')],_0xb9f8('0xb2'),_0x9dfaf7[_0xb9f8('0x28')]);this[_0xb9f8('0x93')](_0x32af63,_0x32af63[_0xb9f8('0x9f')],_0x32af63['cause']);}else if(this[_0xb9f8('0x68')][_0x32af63['linkedid']]['dialAnswer']){logger[_0xb9f8('0x55')](_0xb9f8('0x138'),_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')],_0xb9f8('0xa4'),_0x9dfaf7[_0xb9f8('0x23')],_0xb9f8('0xb2'),_0x9dfaf7[_0xb9f8('0x28')]);this[_0xb9f8('0x93')](_0x32af63,_0x32af63[_0xb9f8('0x9f')],_0x32af63[_0xb9f8('0x137')]);}}};Preview[_0xb9f8('0xe')][_0xb9f8('0x13d')]=function(_0x8328ff){if(this[_0xb9f8('0x68')][_0x8328ff[_0xb9f8('0xe6')]]&&_0x8328ff[_0xb9f8('0xe6')]!==_0x8328ff[_0xb9f8('0x13e')]){this[_0xb9f8('0x93')](_0x8328ff,_0x8328ff[_0xb9f8('0xe6')],_0x8328ff[_0xb9f8('0xe0')]);}};Preview[_0xb9f8('0xe')][_0xb9f8('0x13f')]=function(_0x26389c){if(this[_0xb9f8('0x68')][_0x26389c[_0xb9f8('0x9f')]]&&_0x26389c['linkedid']!==_0x26389c['uniqueid']&&!this['actions'][_0x26389c[_0xb9f8('0x9f')]][_0xb9f8('0x6c')]){if(_0x26389c[_0xb9f8('0x137')]==='1'){this[_0xb9f8('0x93')](_0x26389c,_0x26389c['linkedid'],_0x26389c[_0xb9f8('0x137')]);}}};Preview[_0xb9f8('0xe')][_0xb9f8('0x140')]=function(_0x20baa1,_0x4835b2,_0x348961){if(this['actions'][_0x20baa1]){if(_[_0xb9f8('0x67')](this[_0xb9f8('0x68')][_0x20baa1][_0xb9f8('0x141')])){this[_0xb9f8('0x68')][_0x20baa1][_0xb9f8('0x141')]={};}this[_0xb9f8('0x68')][_0x20baa1][_0xb9f8('0x141')][_0x4835b2]=_0x348961;}};Preview[_0xb9f8('0xe')]['syncVarSet']=function(_0x387b96){try{if(!_[_0xb9f8('0x67')](_0x387b96)){if(ut['filterKey'](_[_0xb9f8('0x142')](_0x387b96[_0xb9f8('0x143')])[0x0])){this['addVariable'](_0x387b96[_0xb9f8('0xb1')],_[_0xb9f8('0x142')](_0x387b96[_0xb9f8('0x143')])[0x0],_0x387b96['value']);}}}catch(_0x1d2630){logger[_0xb9f8('0x144')](_0xb9f8('0x145'),util['inspect'](_0x1d2630,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xb9f8('0x146')]=function(_0x4f13c1){if(_0x4f13c1){if(this[_0xb9f8('0x68')][_0x4f13c1[_0xb9f8('0x147')]]){this[_0xb9f8('0x68')][_0x4f13c1[_0xb9f8('0x147')]][_0xb9f8('0x13a')]=!![];}}};Preview[_0xb9f8('0xe')]['syncBlindTransfer']=function(_0x279d95){if(_0x279d95){if(this[_0xb9f8('0x68')][_0x279d95[_0xb9f8('0x148')]]){this[_0xb9f8('0x68')][_0x279d95[_0xb9f8('0x148')]][_0xb9f8('0x13a')]=!![];}}};module[_0xb9f8('0x149')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b5dac26..d4cdc17 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 _0x84e7=['calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','exten','holdtime','lastAssignedTo','membername','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x84e7,0x122));var _0x784e=function(_0x46157f,_0x1a57df){_0x46157f=_0x46157f-0x0;var _0xe3408c=_0x84e7[_0x46157f];return _0xe3408c;};'use strict';var util=require('util');var BPromise=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('preview');var _=require(_0x784e('0x2'));var cmHopper=require(_0x784e('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x784e('0x4'));var cmHopperBlack=require(_0x784e('0x5'));var voiceQueueRt=require(_0x784e('0x6'));var agentReportPreview=require(_0x784e('0x7'));var voiceQueueReport=require(_0x784e('0x8'));function loggerCatch(_0x133296){return function(_0x48ed22){logger[_0x784e('0x9')](_0x133296,util['inspect'](_0x48ed22,{'showHidden':![],'depth':null}));};}function create(_0xfaa170){return BPromise[_0x784e('0xa')]()['then'](cmHopperHistory[_0x784e('0xb')](_0xfaa170))[_0x784e('0xc')](loggerCatch(_0x784e('0xd')));}function createAgent(_0x3ddd55){return BPromise['resolve']()['then'](agentReportPreview[_0x784e('0xb')](_0x3ddd55))[_0x784e('0xc')](loggerCatch(_0x784e('0xd')));}function moveContact(_0x2fd1b5){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0xf')](_0x2fd1b5,!![]))[_0x784e('0xc')](loggerCatch(_0x784e('0x10')));}exports[_0x784e('0x11')]=function(_0x208d24){return BPromise['resolve']()[_0x784e('0xe')](cmHopperBlack['checkIsBlackList'](_0x208d24))[_0x784e('0xc')](loggerCatch(_0x784e('0x12')));};exports[_0x784e('0x13')]=function(_0x21e844){return BPromise[_0x784e('0xa')]()[_0x784e('0xe')](cmHopper[_0x784e('0x13')](_0x21e844))[_0x784e('0xc')](loggerCatch(_0x784e('0x14')));};exports['createHistory']=function(_0x519059,_0x112ba1){create(_0x519059)[_0x784e('0xc')](loggerCatch(_0x112ba1));moveContact(_0x519059)[_0x784e('0xc')](loggerCatch(_0x112ba1));};exports[_0x784e('0x15')]=function(_0x3ac83,_0x19072b){createAgent(_0x3ac83)[_0x784e('0xc')](loggerCatch(_0x19072b));};exports['createCustomerHistory']=function(_0x2524d0,_0x285ddd){create(_0x2524d0)[_0x784e('0xc')](loggerCatch(_0x285ddd));};exports[_0x784e('0x16')]=function(_0x440cd6,_0x42f894){moveContact(_0x440cd6)[_0x784e('0xc')](loggerCatch(_0x42f894));};exports['rescheduleContact']=function(_0x5add8f,_0x12aacb,_0x52bc9d){if(_0x12aacb){_0x5add8f[_0x784e('0x17')]=null;}if(_0x52bc9d){_0x5add8f[_0x784e('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x784e('0x19')](_0x5add8f))[_0x784e('0xc')](loggerCatch(_0x784e('0x1a')));};exports[_0x784e('0x1b')]=function(_0x51f452){return BPromise['resolve']()['then'](cmHopper[_0x784e('0x1b')](_0x51f452))[_0x784e('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x784e('0x1c')]=function(_0x5e809a){return BPromise[_0x784e('0xa')]()['then'](cmHopper[_0x784e('0x1c')]({'UserId':null},_0x5e809a,0x1))[_0x784e('0xc')](loggerCatch(_0x784e('0x1d')));};exports[_0x784e('0x1e')]=function(_0x5cb14f){return BPromise[_0x784e('0xa')]()[_0x784e('0xe')](cmHopper[_0x784e('0x1c')]({'active':![]},_0x5cb14f,0x1))[_0x784e('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x784e('0x1f')]=function(_0xa3603f){var _0x5f3da2={};_0x5f3da2['type']=_0xa3603f[_0x784e('0x20')];_0x5f3da2[_0x784e('0x21')]=_0xa3603f[_0x784e('0x21')];_0x5f3da2[_0x784e('0x22')]=_0xa3603f[_0x784e('0x22')];_0x5f3da2[_0x784e('0x23')]=_0xa3603f[_0x784e('0x23')];_0x5f3da2[_0x784e('0x24')]=_0xa3603f[_0x784e('0x24')];_0x5f3da2[_0x784e('0x25')]=_0xa3603f[_0x784e('0x26')];_0x5f3da2[_0x784e('0x27')]=_0xa3603f[_0x784e('0x26')];_0x5f3da2[_0x784e('0x28')]=0x1;_0x5f3da2[_0x784e('0x29')]=_0xa3603f['endtime'];_0x5f3da2[_0x784e('0x2a')]=_0xa3603f['membername'];_0x5f3da2[_0x784e('0x2b')]=_0x784e('0x2c');_0x5f3da2[_0x784e('0x2d')]='xcally-motion-preview';_0x5f3da2[_0x784e('0x2e')]=0x0;_0x5f3da2['assigned']=0x1;_0x5f3da2[_0x784e('0x2f')]=_0xa3603f[_0x784e('0x30')];_0x5f3da2['queuecallerexitreason']=_0x784e('0x31');return BPromise[_0x784e('0xa')]()['then'](voiceQueueReport['create'](_0x5f3da2))[_0x784e('0xc')](loggerCatch(_0x784e('0x32')));};exports[_0x784e('0x33')]=function(_0x4724af,_0x33b2a6){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0x33')](_0x4724af,_0x33b2a6))['catch'](loggerCatch(_0x784e('0x34')));};exports['rescheduleContactInQueue']=function(_0x4adb1f){return BPromise['resolve']()[_0x784e('0xe')](cmHopper[_0x784e('0x19')](_0x4adb1f,!![],!![]))['catch'](loggerCatch(_0x784e('0x35')));}; \ 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(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xf69d,0xd3));var _0xdf69=function(_0x1436c8,_0x481609){_0x1436c8=_0x1436c8-0x0;var _0x30bb8b=_0xf69d[_0x1436c8];return _0x30bb8b;};'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 92ff653..c24cde4 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 _0x9c1d=['diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue','buildAcw','interface','not_inuse','status','reachable','push','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','127.0.0.1','milliseconds'];(function(_0x3dd388,_0x19d76b){var _0x2db118=function(_0x59afa6){while(--_0x59afa6){_0x3dd388['push'](_0x3dd388['shift']());}};_0x2db118(++_0x19d76b);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x52d47d,_0x1310e5){_0x52d47d=_0x52d47d-0x0;var _0x2add6b=_0x9c1d[_0x52d47d];return _0x2add6b;};'use strict';var util=require(_0xd9c1('0x0'));var _=require(_0xd9c1('0x1'));var moment=require(_0xd9c1('0x2'));var logger=require('../../../../config/logger')(_0xd9c1('0x3'));var ipAgi=process[_0xd9c1('0x4')]['XCALLY_IP_AGI']||_0xd9c1('0x5');function getSeconds(_0x89163b,_0x4fb977){var _0x233f23=moment(_0x89163b)[_0xd9c1('0x6')](0x0);var _0x206639=moment(_0x4fb977)[_0xd9c1('0x6')](0x0);return _0x233f23[_0xd9c1('0x7')](_0x206639,_0xd9c1('0x8'));}exports[_0xd9c1('0x9')]=function(_0x56e650){return function(_0x3aae47){logger['error'](_0x56e650,util[_0xd9c1('0xa')](_0x3aae47,{'showHidden':![],'depth':null}));};};exports[_0xd9c1('0xb')]=function(_0x1b0050,_0x19bc13){logger[_0xd9c1('0xc')](_0x1b0050,util[_0xd9c1('0xa')](_0x19bc13,{'showHidden':![],'depth':null}));};exports[_0xd9c1('0xd')]=function(_0x51c217,_0x1c5ade){logger[_0xd9c1('0xe')](_0x51c217,util[_0xd9c1('0xa')](_0x1c5ade,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1ead8c){return function(_0x50b02c){logger[_0xd9c1('0xc')](_0x1ead8c,util[_0xd9c1('0xa')](_0x50b02c,{'showHidden':![],'depth':null}));};};exports[_0xd9c1('0xf')]=function(_0x3eb09d,_0xb9cb5d,_0x221a24){return{'message':_0x3eb09d,'unlock':_0xb9cb5d,'active':_0x221a24};};exports[_0xd9c1('0x10')]=function(_0x13b927,_0xf95f06,_0x259305){if(!_[_0xd9c1('0x11')](_0x259305)&&_0xd9c1('0x12')===typeof _0x259305&&!_[_0xd9c1('0x13')](_0x259305)){if(!_[_0xd9c1('0x11')](_0xf95f06)&&_0xd9c1('0x12')===typeof _0xf95f06&&!_['isEmpty'](_0xf95f06)){return util['format'](_0xd9c1('0x14'),_0xf95f06,_0x259305);}return util[_0xd9c1('0x15')](_0xd9c1('0x14'),_0x259305,_0x259305);}if(!_[_0xd9c1('0x11')](_0x13b927)&&_0xd9c1('0x12')===typeof _0x13b927&&!_[_0xd9c1('0x13')](_0x13b927)){return _0x13b927;}return _0xd9c1('0x16');};exports[_0xd9c1('0x17')]=function(_0x3a8830){if(_['isNil'](_0x3a8830)){return![];}return _0x3a8830;};exports[_0xd9c1('0x18')]=function(_0x11611d,_0x37701d,_0x2aea78,_0x4643ad,_0x36728a,_0x509502){var _0x28f523={'XMD-QUEUE':_0x37701d[_0xd9c1('0x19')]?_0x37701d[_0xd9c1('0x19')]['name']:'','XMD-CALLERID':_0x4643ad,'XMD-CALLERID-PREVIEW':_0x509502?util['format'](_0xd9c1('0x14'),_0x509502[_0xd9c1('0x1a')],_0x509502[_0xd9c1('0x1b')]):_0x4643ad,'XMD-DIALID':_0x36728a,'XMD-CONTACTID':_0x37701d[_0xd9c1('0x1c')],'XMD-CDRTYPE':_0xd9c1('0x1d'),'CALLERID(all)':_0x4643ad,'XMD-VOICEQUEUEID':_0x37701d[_0xd9c1('0x1e')],'XMD-DIALCHANNEL':_0x2aea78,'XMD-DIALTIMEOUT':_0x11611d[_0xd9c1('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd9c1('0x20'),_0x11611d[_0xd9c1('0x21')]?'g':'',_['isEmpty'](_0x11611d['monitor_format'])?'':_0xd9c1('0x22')),'XMD-DIALURL':_0x11611d[_0xd9c1('0x23')]||'','XMD-AGI':_0x11611d[_0xd9c1('0x24')]?util['format'](_0xd9c1('0x25'),ipAgi,_0x11611d[_0xd9c1('0x24')]):'NONE','XMD-AGIAFTER':_0x11611d['dialQueueProject2']?util[_0xd9c1('0x15')](_0xd9c1('0x25'),ipAgi,_0x11611d[_0xd9c1('0x21')]):_0xd9c1('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x509502?_0x509502[_0xd9c1('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x509502?_0x509502[_0xd9c1('0x28')]:'','XMD-DESTINATION':_0xd9c1('0x29')};if(!_['isEmpty'](_0x11611d[_0xd9c1('0x2a')])){_0x28f523[util[_0xd9c1('0x15')]('%s',_0xd9c1('0x2b'))]=_0x11611d[_0xd9c1('0x2a')];_0x28f523[util[_0xd9c1('0x15')]('%s',_0xd9c1('0x2c'))]=_0x36728a;}if(_0x37701d&&_0x37701d[_0xd9c1('0x2d')]){for(var _0x313f05 in _0x37701d['Contact']){if(_0x37701d['Contact']['hasOwnProperty'](_0x313f05)){if(!_[_0xd9c1('0x2e')](_0x37701d['Contact'][_0x313f05])&&_0x313f05!=='id'&&_0x313f05!==_0xd9c1('0x2f')&&_0x313f05!==_0xd9c1('0x30')&&_0x313f05!=='updatedAt'){_0x28f523[util[_0xd9c1('0x15')](_0xd9c1('0x31'),_0xd9c1('0x32'),_[_0xd9c1('0x33')](_0x313f05))]=_0x37701d[_0xd9c1('0x2d')][_0x313f05];}}}}return _0x28f523;};exports[_0xd9c1('0x34')]=function(_0xa0f03e){var _0x25e0e7={};for(var _0x2c5974 in _0xa0f03e){if(_0xa0f03e[_0xd9c1('0x35')](_0x2c5974)){_0x25e0e7[util[_0xd9c1('0x15')]('%s',_[_0xd9c1('0x36')](_0x2c5974))]=_0xa0f03e[_0x2c5974];}}return{'variables':_0x25e0e7};};exports['updateOriginated']=function(_0x580dc0,_0x10c6d3){if(!_[_0xd9c1('0x2e')](_0x580dc0)){if(_0x580dc0[_0xd9c1('0x35')]('originated')){if(_0x580dc0[_0xd9c1('0x37')]>0x0){_0x580dc0[_0xd9c1('0x37')]-=0x1;}else{logger['error'](_0xd9c1('0x38'),_0x10c6d3);}}}else{logger[_0xd9c1('0xe')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x10c6d3);}};exports['logBlacklist']=function(_0x339084){var _0xbdfa7=moment()[_0xd9c1('0x15')](_0xd9c1('0x39'));_0x339084[_0xd9c1('0x3a')]=0xd;_0x339084[_0xd9c1('0x3b')]='Blacklist';_0x339084[_0xd9c1('0x3c')]=_0xbdfa7;_0x339084[_0xd9c1('0x3d')]=_0xbdfa7;_0x339084[_0xd9c1('0x3e')]=_0xbdfa7;};exports['logAgent']=function(_0xe0d4a5,_0x13b41f,_0x1e765e){var _0xb70af2=moment()[_0xd9c1('0x15')](_0xd9c1('0x39'));_0xe0d4a5[_0xd9c1('0x3a')]=_0x13b41f;_0xe0d4a5[_0xd9c1('0x3b')]=_0x1e765e;_0xe0d4a5[_0xd9c1('0x3d')]=_0xb70af2;_0xe0d4a5[_0xd9c1('0x3f')]=getSeconds(_0xe0d4a5['responsetime'],_0xe0d4a5[_0xd9c1('0x3c')]);};exports[_0xd9c1('0x40')]=function(_0x5ddcb6,_0x4e8ce6,_0x54d5b0){_0x5ddcb6[_0xd9c1('0x41')]=_0x4e8ce6;_0x5ddcb6[_0xd9c1('0x42')]=_0x54d5b0;};exports[_0xd9c1('0x43')]=function(_0x20ce58,_0x518cfa,_0x14d6dd){var _0x418a64=moment()[_0xd9c1('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x20ce58['state']=_0x518cfa;_0x20ce58[_0xd9c1('0x3b')]=_0x14d6dd;_0x20ce58[_0xd9c1('0x3d')]=_0x20ce58[_0xd9c1('0x3d')]?_0x20ce58[_0xd9c1('0x3d')]:_0x418a64;_0x20ce58[_0xd9c1('0x3e')]=_0x20ce58[_0xd9c1('0x3e')]?_0x20ce58[_0xd9c1('0x3e')]:_0x418a64;_0x20ce58[_0xd9c1('0x3f')]=getSeconds(_0x20ce58[_0xd9c1('0x3d')]||0x0,_0x20ce58['starttime']||0x0);_0x20ce58[_0xd9c1('0x44')]=_0x20ce58[_0xd9c1('0x45')]?getSeconds(_0x20ce58[_0xd9c1('0x3e')],_0x20ce58['answertime']):0x0;};exports['isFailure']=function(_0x1a830d){return _0x1a830d==='Failure';};exports[_0xd9c1('0x46')]=function(_0x4b86ad,_0x5a933f,_0x29551b,_0x4fb98a,_0x3fd92a){var _0x43c85c=_0x4fb98a?_0xd9c1('0x47'):_0x4b86ad[_0xd9c1('0x1a')];_0x43c85c=_0x3fd92a?_0xd9c1('0x48'):_0x43c85c;return{'actionid':_0x4b86ad[_0xd9c1('0x49')],'action':_0xd9c1('0x4a'),'channel':_0x4b86ad[_0xd9c1('0x4b')],'callerid':util[_0xd9c1('0x15')](_0xd9c1('0x14'),_0x43c85c,_0x4b86ad[_0xd9c1('0x1b')]),'Exten':_0xd9c1('0x29'),'Context':_0xd9c1('0x4c'),'Priority':'1','variable':_0x29551b,'timeout':(_0x5a933f[_0xd9c1('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4b86ad['uniqueid']};};exports[_0xd9c1('0x4e')]=function(_0x4966fc){return _0x4966fc['countbusyretry']+_0x4966fc[_0xd9c1('0x4f')]+_0x4966fc[_0xd9c1('0x50')]+_0x4966fc[_0xd9c1('0x51')]+_0x4966fc[_0xd9c1('0x52')];};exports[_0xd9c1('0x53')]=function(_0x46cb82){var _0xdc46d7=_[_0xd9c1('0x54')](_0x46cb82);_0xdc46d7[_0xd9c1('0x3a')]=0xf;_0xdc46d7[_0xd9c1('0x3b')]='Global';return _0xdc46d7;};exports[_0xd9c1('0x55')]=function(_0x5834e5,_0x4ae001,_0xb8bf25){var _0x2f89a1={};_0x2f89a1[_0x4ae001]=_0x5834e5[_0x4ae001];_0x2f89a1[_0xd9c1('0x56')]=![];_0x2f89a1[_0xd9c1('0x57')]=moment()[_0xd9c1('0x58')](_0xb8bf25,'minutes')[_0xd9c1('0x15')](_0xd9c1('0x39'));_0x2f89a1['ContactId']=_0x5834e5[_0xd9c1('0x1c')];_0x2f89a1[_0xd9c1('0x59')]=_0x5834e5[_0xd9c1('0x59')];_0x2f89a1[_0xd9c1('0x1e')]=_0x5834e5[_0xd9c1('0x1e')]||undefined;return _0x2f89a1;};exports['decrementTalkink']=function(_0x15a566,_0x30b3a0){if(!_[_0xd9c1('0x2e')](_0x15a566)){if(_0x15a566[_0xd9c1('0x5a')]>0x0){_0x15a566['pTalking']-=0x1;}else{logger[_0xd9c1('0xe')](_0x30b3a0,_0xd9c1('0x5b'));}}else{logger[_0xd9c1('0xe')](_0x30b3a0,_0xd9c1('0x5c'));}};exports[_0xd9c1('0x5d')]=function(_0x2b5be7){if(_0x2b5be7<=0x0){return!![];}return![];};exports[_0xd9c1('0x5e')]=function(_0x765e00,_0x12fdab){_0x765e00['lastevent']=_0x12fdab;_0x765e00[_0xd9c1('0x5f')]=_0x765e00[_0xd9c1('0x60')];_0x765e00['interface']=_0x765e00[_0xd9c1('0x4b')];return _0x765e00;};exports[_0xd9c1('0x61')]=function(_0x4038f9){var _0x168e70={};_0x168e70[_0xd9c1('0x60')]=_0x4038f9[_0xd9c1('0x60')];_0x168e70[_0xd9c1('0x62')]=_0x4038f9[_0xd9c1('0x4b')];_0x168e70[_0xd9c1('0x49')]=_0x4038f9[_0xd9c1('0x49')];return _0x168e70;};exports['agentReadyId']=function(_0x10f67b){var _0x3429c5=[];for(var _0xc06968 in _0x10f67b){if(_0x10f67b[_0xd9c1('0x35')](_0xc06968)){if(!_[_0xd9c1('0x2e')](_0x10f67b[_0xc06968])&&_0x10f67b[_0xc06968][_0xd9c1('0x3a')]===_0xd9c1('0x63')&&_0x10f67b[_0xc06968][_0xd9c1('0x64')]===_0xd9c1('0x65')){_0x3429c5[_0xd9c1('0x66')](_0x10f67b[_0xc06968]['id']);}}}return _0x3429c5;};exports['getDiff']=function(_0x38af4e){var _0x4de746=moment()[_0xd9c1('0x6')](0x0);var _0x37475b=moment(_0x38af4e)[_0xd9c1('0x6')](0x0);return _0x4de746[_0xd9c1('0x7')](_0x37475b,'seconds');};exports[_0xd9c1('0x67')]=function(_0x148c50){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x148c50[_0xd9c1('0x1c')],'ListId':_0x148c50['ListId'],'VoiceQueueId':_0x148c50[_0xd9c1('0x1e')]||undefined,'CampaignId':_0x148c50[_0xd9c1('0x68')]||undefined};};exports['filterKey']=function(_0x22ef09){if(_0x22ef09===_0xd9c1('0x49')||_0x22ef09===_0xd9c1('0x69')||_0x22ef09===_0xd9c1('0x60')||_0x22ef09===_0xd9c1('0x6a')||_0x22ef09===_0xd9c1('0x6b')||_0x22ef09===_0xd9c1('0x6c')||_0x22ef09===_0xd9c1('0x41')||_0x22ef09==='channelAgent'||_0x22ef09==='calleridname'||_0x22ef09==='active'||_0x22ef09===_0xd9c1('0x1b')||_0x22ef09===_0xd9c1('0x57')||_0x22ef09===_0xd9c1('0x6d')||_0x22ef09===_0xd9c1('0x4f')||_0x22ef09==='countnoanswerretry'||_0x22ef09===_0xd9c1('0x6e')||_0x22ef09===_0xd9c1('0x6f')||_0x22ef09===_0xd9c1('0x70')||_0x22ef09===_0xd9c1('0x71')||_0x22ef09===_0xd9c1('0x72')||_0x22ef09==='ContactId'||_0x22ef09===_0xd9c1('0x59')||_0x22ef09==='UserId'||_0x22ef09===_0xd9c1('0x1e')||_0x22ef09===_0xd9c1('0x73')||_0x22ef09===_0xd9c1('0x74')||_0x22ef09==='xmd-queue'||_0x22ef09===_0xd9c1('0x75')||_0x22ef09===_0xd9c1('0x76')||_0x22ef09===_0xd9c1('0x77')||_0x22ef09===_0xd9c1('0x78')||_0x22ef09===_0xd9c1('0x79')||_0x22ef09===_0xd9c1('0x7a')||_0x22ef09===_0xd9c1('0x7b')||_0x22ef09===_0xd9c1('0x7c')||_0x22ef09==='xmd-cdrtype'||_0x22ef09===_0xd9c1('0x7d')||_0x22ef09==='xmd-agiafter'||_0x22ef09===_0xd9c1('0x7e')||_0x22ef09===_0xd9c1('0x7f')||_0x22ef09===_0xd9c1('0x80')||_0x22ef09===_0xd9c1('0x81')||_0x22ef09===_0xd9c1('0x82')||_0x22ef09===_0xd9c1('0x83')||_0x22ef09===_0xd9c1('0x84')||_0x22ef09===_0xd9c1('0x85')||_0x22ef09===_0xd9c1('0x86')||_0x22ef09===_0xd9c1('0x7f')||_0x22ef09===_0xd9c1('0x80')||_0x22ef09==='rtpaudioqosjitter'||_0x22ef09===_0xd9c1('0x82')||_0x22ef09==='rtpaudioqosloss'||_0x22ef09===_0xd9c1('0x84')||_0x22ef09==='rtpaudioqosrtt'||_0x22ef09===_0xd9c1('0x86')||_0x22ef09==='bridgepeer'||_0x22ef09===_0xd9c1('0x87')||_0x22ef09===_0xd9c1('0x3a')||_0x22ef09===_0xd9c1('0x3b')){return![];}return!![];};exports[_0xd9c1('0x88')]=function(_0x10e68c,_0x10b0ba){var _0xc91efc,_0x234484,_0x227d74;if(_0x10b0ba<=0x0){_0x10b0ba=0x1;}_0xc91efc=new RegExp(_0xd9c1('0x89')+_0x10b0ba+'}$');_0x234484=Math[_0xd9c1('0x8a')](0xa,_0x10b0ba-0x1);_0x227d74=Math[_0xd9c1('0x8a')](0xa,_0x10b0ba)-0x1;return util[_0xd9c1('0x15')]('%s',_[_0xd9c1('0x8b')](_0x10e68c,_0xc91efc,_[_0xd9c1('0x8c')](_0x234484,_0x227d74)));};exports[_0xd9c1('0x8d')]=function(_0x5e6ba1){var _0x3d80b6=_0x5e6ba1[_0xd9c1('0x8e')](/"(.*?)"/);return _0x3d80b6?_0x3d80b6[0x1]:_0x5e6ba1;};exports[_0xd9c1('0x8f')]=function(_0x2afc6c){var _0x42c14c=_0x2afc6c[_0xd9c1('0x8e')](/<(.*?)>/);return _0x42c14c?_0x42c14c[0x1]:_0x2afc6c;}; \ No newline at end of file +var _0x762e=['addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','originate','channelAgent','calleridnum','timeout','uniqueid','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','push','CampaignId','idContact','type','campaigntype','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>'];(function(_0x1e4c84,_0x154e15){var _0x1161af=function(_0x3f9483){while(--_0x3f9483){_0x1e4c84['push'](_0x1e4c84['shift']());}};_0x1161af(++_0x154e15);}(_0x762e,0xea));var _0xe762=function(_0x6a474,_0x3b8732){_0x6a474=_0x6a474-0x0;var _0x4c65a6=_0x762e[_0x6a474];return _0x4c65a6;};'use strict';var util=require(_0xe762('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xe762('0x1'))('preview');var ipAgi=process['env'][_0xe762('0x2')]||_0xe762('0x3');function getSeconds(_0x2a390a,_0x59723c){var _0xe78ccf=moment(_0x2a390a)[_0xe762('0x4')](0x0);var _0x48995a=moment(_0x59723c)['milliseconds'](0x0);return _0xe78ccf[_0xe762('0x5')](_0x48995a,_0xe762('0x6'));}exports[_0xe762('0x7')]=function(_0xf20548){return function(_0x26a4fc){logger[_0xe762('0x8')](_0xf20548,util['inspect'](_0x26a4fc,{'showHidden':![],'depth':null}));};};exports[_0xe762('0x9')]=function(_0x2c0793,_0x177ad9){logger[_0xe762('0xa')](_0x2c0793,util[_0xe762('0xb')](_0x177ad9,{'showHidden':![],'depth':null}));};exports[_0xe762('0xc')]=function(_0x224a19,_0x4938e5){logger[_0xe762('0x8')](_0x224a19,util[_0xe762('0xb')](_0x4938e5,{'showHidden':![],'depth':null}));};exports[_0xe762('0xd')]=function(_0x4a7d2f){return function(_0x340573){logger['info'](_0x4a7d2f,util[_0xe762('0xb')](_0x340573,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x12d8d8,_0x25a6cf,_0x1ebf3d){return{'message':_0x12d8d8,'unlock':_0x25a6cf,'active':_0x1ebf3d};};exports['getCallerId']=function(_0x50aa09,_0x35be11,_0x417be3){if(!_[_0xe762('0xe')](_0x417be3)&&_0xe762('0xf')===typeof _0x417be3&&!_[_0xe762('0x10')](_0x417be3)){if(!_[_0xe762('0xe')](_0x35be11)&&_0xe762('0xf')===typeof _0x35be11&&!_[_0xe762('0x10')](_0x35be11)){return util['format'](_0xe762('0x11'),_0x35be11,_0x417be3);}return util[_0xe762('0x12')](_0xe762('0x11'),_0x417be3,_0x417be3);}if(!_[_0xe762('0xe')](_0x50aa09)&&'string'===typeof _0x50aa09&&!_[_0xe762('0x10')](_0x50aa09)){return _0x50aa09;}return _0xe762('0x13');};exports['isActive']=function(_0x5c6350){if(_['isNil'](_0x5c6350)){return![];}return _0x5c6350;};exports[_0xe762('0x14')]=function(_0x5505b1,_0x428a59,_0x5bd84e,_0x8775aa,_0x57ad0d,_0x11ad31){var _0x190aa3={'XMD-QUEUE':_0x428a59[_0xe762('0x15')]?_0x428a59[_0xe762('0x15')][_0xe762('0x16')]:'','XMD-CALLERID':_0x8775aa,'XMD-CALLERID-PREVIEW':_0x11ad31?util['format']('\x22%s\x22\x20<%s>',_0x11ad31['calleridname'],_0x11ad31['calleridnum']):_0x8775aa,'XMD-DIALID':_0x57ad0d,'XMD-CONTACTID':_0x428a59[_0xe762('0x17')],'XMD-CDRTYPE':_0xe762('0x18'),'CALLERID(all)':_0x8775aa,'XMD-VOICEQUEUEID':_0x428a59[_0xe762('0x19')],'XMD-DIALCHANNEL':_0x5bd84e,'XMD-DIALTIMEOUT':_0x5505b1[_0xe762('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xe762('0x12')]('\x22rtTxX%s%s\x22',_0x5505b1[_0xe762('0x1b')]?'g':'',_[_0xe762('0x10')](_0x5505b1[_0xe762('0x1c')])?'':_0xe762('0x1d')),'XMD-DIALURL':_0x5505b1[_0xe762('0x1e')]||'','XMD-AGI':_0x5505b1[_0xe762('0x1f')]?util[_0xe762('0x12')](_0xe762('0x20'),ipAgi,_0x5505b1[_0xe762('0x1f')]):_0xe762('0x21'),'XMD-AGIAFTER':_0x5505b1[_0xe762('0x1b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5505b1[_0xe762('0x1b')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x11ad31?_0x11ad31[_0xe762('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x11ad31?_0x11ad31[_0xe762('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xe762('0x10')](_0x5505b1[_0xe762('0x1c')])){_0x190aa3[util[_0xe762('0x12')]('%s',_0xe762('0x24'))]=_0x5505b1[_0xe762('0x1c')];_0x190aa3[util[_0xe762('0x12')]('%s',_0xe762('0x25'))]=_0x57ad0d;}if(_0x428a59&&_0x428a59[_0xe762('0x26')]){for(var _0x26dbd3 in _0x428a59[_0xe762('0x26')]){if(_0x428a59['Contact'][_0xe762('0x27')](_0x26dbd3)){if(!_[_0xe762('0x28')](_0x428a59[_0xe762('0x26')][_0x26dbd3])&&_0x26dbd3!=='id'&&_0x26dbd3!==_0xe762('0x29')&&_0x26dbd3!==_0xe762('0x2a')&&_0x26dbd3!==_0xe762('0x2b')){_0x190aa3[util[_0xe762('0x12')](_0xe762('0x2c'),'XMD-',_['toUpper'](_0x26dbd3))]=_0x428a59[_0xe762('0x26')][_0x26dbd3];}}}}return _0x190aa3;};exports[_0xe762('0x2d')]=function(_0x105941){var _0x31a9d9={};for(var _0x1e8c3f in _0x105941){if(_0x105941[_0xe762('0x27')](_0x1e8c3f)){_0x31a9d9[util[_0xe762('0x12')]('%s',_['toLower'](_0x1e8c3f))]=_0x105941[_0x1e8c3f];}}return{'variables':_0x31a9d9};};exports[_0xe762('0x2e')]=function(_0x1c0821,_0xc4f64e){if(!_['isNil'](_0x1c0821)){if(_0x1c0821[_0xe762('0x27')](_0xe762('0x2f'))){if(_0x1c0821[_0xe762('0x2f')]>0x0){_0x1c0821[_0xe762('0x2f')]-=0x1;}else{logger[_0xe762('0x8')](_0xe762('0x30'),_0xc4f64e);}}}else{logger[_0xe762('0x8')](_0xe762('0x31'),_0xc4f64e);}};exports[_0xe762('0x32')]=function(_0x46f7cd){var _0x4e6fa9=moment()[_0xe762('0x12')](_0xe762('0x33'));_0x46f7cd[_0xe762('0x34')]=0xd;_0x46f7cd[_0xe762('0x35')]=_0xe762('0x36');_0x46f7cd[_0xe762('0x37')]=_0x4e6fa9;_0x46f7cd[_0xe762('0x38')]=_0x4e6fa9;_0x46f7cd[_0xe762('0x39')]=_0x4e6fa9;};exports[_0xe762('0x3a')]=function(_0x45872b,_0xafa2d6,_0x45c131){var _0xa7cb9c=moment()[_0xe762('0x12')](_0xe762('0x33'));_0x45872b[_0xe762('0x34')]=_0xafa2d6;_0x45872b[_0xe762('0x35')]=_0x45c131;_0x45872b[_0xe762('0x38')]=_0xa7cb9c;_0x45872b[_0xe762('0x3b')]=getSeconds(_0x45872b[_0xe762('0x38')],_0x45872b[_0xe762('0x37')]);};exports['logLookAgent']=function(_0x5abccb,_0x19cfb0,_0xfafbf3){_0x5abccb[_0xe762('0x3c')]=_0x19cfb0;_0x5abccb[_0xe762('0x3d')]=_0xfafbf3;};exports[_0xe762('0x3e')]=function(_0x2a5b71,_0x3c7755,_0x43fe46){var _0x394f46=moment()[_0xe762('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a5b71['state']=_0x3c7755;_0x2a5b71[_0xe762('0x35')]=_0x43fe46;_0x2a5b71[_0xe762('0x38')]=_0x2a5b71['responsetime']?_0x2a5b71[_0xe762('0x38')]:_0x394f46;_0x2a5b71[_0xe762('0x39')]=_0x2a5b71[_0xe762('0x39')]?_0x2a5b71[_0xe762('0x39')]:_0x394f46;_0x2a5b71['ringtime']=getSeconds(_0x2a5b71['responsetime']||0x0,_0x2a5b71[_0xe762('0x37')]||0x0);_0x2a5b71[_0xe762('0x3f')]=_0x2a5b71['answertime']?getSeconds(_0x2a5b71[_0xe762('0x39')],_0x2a5b71[_0xe762('0x40')]):0x0;};exports[_0xe762('0x41')]=function(_0x3f6848){return _0x3f6848===_0xe762('0x42');};exports[_0xe762('0x43')]=function(_0x435005,_0x163bd4,_0x281398,_0x3efbad,_0x15a9ea){var _0xcaf61f=_0x3efbad?_0xe762('0x44'):_0x435005['calleridname'];_0xcaf61f=_0x15a9ea?'BOOKED':_0xcaf61f;return{'actionid':_0x435005['uniqueid'],'action':_0xe762('0x45'),'channel':_0x435005[_0xe762('0x46')],'callerid':util[_0xe762('0x12')](_0xe762('0x11'),_0xcaf61f,_0x435005[_0xe762('0x47')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x281398,'timeout':(_0x163bd4[_0xe762('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x435005[_0xe762('0x49')]};};exports['totalGlobal']=function(_0xec8de2){return _0xec8de2['countbusyretry']+_0xec8de2['countcongestionretry']+_0xec8de2[_0xe762('0x4a')]+_0xec8de2[_0xe762('0x4b')]+_0xec8de2['countnosuchnumberretry'];};exports[_0xe762('0x4c')]=function(_0x2b3b1d){var _0x26d591=_[_0xe762('0x4d')](_0x2b3b1d);_0x26d591['state']=0xf;_0x26d591[_0xe762('0x35')]=_0xe762('0x4e');return _0x26d591;};exports['scheduledAt']=function(_0x2eb2fb,_0x8be01b,_0x101db6){var _0x23447d={};_0x23447d[_0x8be01b]=_0x2eb2fb[_0x8be01b];_0x23447d[_0xe762('0x4f')]=![];_0x23447d[_0xe762('0x50')]=moment()['add'](_0x101db6,_0xe762('0x51'))[_0xe762('0x12')](_0xe762('0x33'));_0x23447d[_0xe762('0x17')]=_0x2eb2fb['ContactId'];_0x23447d[_0xe762('0x52')]=_0x2eb2fb['ListId'];_0x23447d[_0xe762('0x19')]=_0x2eb2fb[_0xe762('0x19')]||undefined;return _0x23447d;};exports[_0xe762('0x53')]=function(_0x39c92d,_0x142c08){if(!_[_0xe762('0x28')](_0x39c92d)){if(_0x39c92d[_0xe762('0x54')]>0x0){_0x39c92d[_0xe762('0x54')]-=0x1;}else{logger[_0xe762('0x8')](_0x142c08,_0xe762('0x55'));}}else{logger[_0xe762('0x8')](_0x142c08,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xe762('0x56')]=function(_0x253bb6){if(_0x253bb6<=0x0){return!![];}return![];};exports[_0xe762('0x57')]=function(_0xa82691,_0x4f1fea){_0xa82691[_0xe762('0x58')]=_0x4f1fea;_0xa82691[_0xe762('0x16')]=_0xa82691[_0xe762('0x59')];_0xa82691[_0xe762('0x5a')]=_0xa82691[_0xe762('0x46')];return _0xa82691;};exports[_0xe762('0x5b')]=function(_0x3346dd){var _0x206b11={};_0x206b11[_0xe762('0x59')]=_0x3346dd[_0xe762('0x59')];_0x206b11['interface']=_0x3346dd[_0xe762('0x46')];_0x206b11[_0xe762('0x49')]=_0x3346dd[_0xe762('0x49')];return _0x206b11;};exports[_0xe762('0x5c')]=function(_0xfbc228){var _0x4168e7=[];for(var _0x3de12d in _0xfbc228){if(_0xfbc228[_0xe762('0x27')](_0x3de12d)){if(!_['isNil'](_0xfbc228[_0x3de12d])&&_0xfbc228[_0x3de12d]['state']===_0xe762('0x5d')&&_0xfbc228[_0x3de12d][_0xe762('0x5e')]==='reachable'){_0x4168e7[_0xe762('0x5f')](_0xfbc228[_0x3de12d]['id']);}}}return _0x4168e7;};exports['getDiff']=function(_0x195572){var _0x9a3925=moment()[_0xe762('0x4')](0x0);var _0x1de7f4=moment(_0x195572)[_0xe762('0x4')](0x0);return _0x9a3925[_0xe762('0x5')](_0x1de7f4,_0xe762('0x6'));};exports['createBody']=function(_0x5b4bf7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5b4bf7[_0xe762('0x17')],'ListId':_0x5b4bf7['ListId'],'VoiceQueueId':_0x5b4bf7[_0xe762('0x19')]||undefined,'CampaignId':_0x5b4bf7[_0xe762('0x60')]||undefined};};exports['filterKey']=function(_0x2b8575){if(_0x2b8575===_0xe762('0x49')||_0x2b8575===_0xe762('0x61')||_0x2b8575===_0xe762('0x59')||_0x2b8575===_0xe762('0x62')||_0x2b8575===_0xe762('0x63')||_0x2b8575==='dialAnswer'||_0x2b8575===_0xe762('0x3c')||_0x2b8575===_0xe762('0x46')||_0x2b8575==='calleridname'||_0x2b8575===_0xe762('0x4f')||_0x2b8575===_0xe762('0x47')||_0x2b8575===_0xe762('0x50')||_0x2b8575==='countbusyretry'||_0x2b8575==='countcongestionretry'||_0x2b8575===_0xe762('0x4a')||_0x2b8575==='countglobal'||_0x2b8575===_0xe762('0x64')||_0x2b8575===_0xe762('0x65')||_0x2b8575===_0xe762('0x66')||_0x2b8575==='recallme'||_0x2b8575===_0xe762('0x17')||_0x2b8575==='ListId'||_0x2b8575==='UserId'||_0x2b8575===_0xe762('0x19')||_0x2b8575===_0xe762('0x67')||_0x2b8575==='xmd-voicequeueid'||_0x2b8575===_0xe762('0x68')||_0x2b8575===_0xe762('0x69')||_0x2b8575==='xmd-listid'||_0x2b8575==='xmd-dialurl'||_0x2b8575==='xmd-dialtimeout'||_0x2b8575==='xmd-dialoptions'||_0x2b8575===_0xe762('0x6a')||_0x2b8575==='xmd-dialchannel'||_0x2b8575===_0xe762('0x6b')||_0x2b8575===_0xe762('0x6c')||_0x2b8575===_0xe762('0x6d')||_0x2b8575===_0xe762('0x6e')||_0x2b8575===_0xe762('0x6f')||_0x2b8575===_0xe762('0x70')||_0x2b8575===_0xe762('0x71')||_0x2b8575===_0xe762('0x72')||_0x2b8575===_0xe762('0x73')||_0x2b8575==='rtpaudioqosloss'||_0x2b8575===_0xe762('0x74')||_0x2b8575==='rtpaudioqosrtt'||_0x2b8575===_0xe762('0x75')||_0x2b8575===_0xe762('0x70')||_0x2b8575===_0xe762('0x71')||_0x2b8575===_0xe762('0x72')||_0x2b8575===_0xe762('0x73')||_0x2b8575==='rtpaudioqosloss'||_0x2b8575===_0xe762('0x74')||_0x2b8575===_0xe762('0x76')||_0x2b8575===_0xe762('0x75')||_0x2b8575==='bridgepeer'||_0x2b8575===_0xe762('0x77')||_0x2b8575===_0xe762('0x34')||_0x2b8575==='statedesc'){return![];}return!![];};exports[_0xe762('0x78')]=function(_0x376d59,_0x47ae3e){var _0x5bd363,_0x4da689,_0x2ac902;if(_0x47ae3e<=0x0){_0x47ae3e=0x1;}_0x5bd363=new RegExp('\x5cw{0,'+_0x47ae3e+'}$');_0x4da689=Math[_0xe762('0x79')](0xa,_0x47ae3e-0x1);_0x2ac902=Math[_0xe762('0x79')](0xa,_0x47ae3e)-0x1;return util[_0xe762('0x12')]('%s',_[_0xe762('0x7a')](_0x376d59,_0x5bd363,_[_0xe762('0x7b')](_0x4da689,_0x2ac902)));};exports[_0xe762('0x7c')]=function(_0x730b1d){var _0x226180=_0x730b1d[_0xe762('0x7d')](/"(.*?)"/);return _0x226180?_0x226180[0x1]:_0x730b1d;};exports[_0xe762('0x7e')]=function(_0x370da0){var _0x5597d7=_0x370da0[_0xe762('0x7d')](/<(.*?)>/);return _0x5597d7?_0x5597d7[0x1]:_0x370da0;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 4420b97..8ffe811 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(_0x566aa7,_0x148031){var _0x55bc17=function(_0x1088e6){while(--_0x1088e6){_0x566aa7['push'](_0x566aa7['shift']());}};_0x55bc17(++_0x148031);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a7d9d,_0x52acf8){_0x4a7d9d=_0x4a7d9d-0x0;var _0x167e3f=_0x5f2f[_0x4a7d9d];return _0x167e3f;};'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 _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x35374e,_0x4d17f5){var _0x136a5f=function(_0x660998){while(--_0x660998){_0x35374e['push'](_0x35374e['shift']());}};_0x136a5f(++_0x4d17f5);}(_0x7a54,0x106));var _0x47a5=function(_0x1218d3,_0x17092c){_0x1218d3=_0x1218d3-0x0;var _0x4765cb=_0x7a54[_0x1218d3];return _0x4765cb;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index eaf82b8..0ee0caf 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 _0x9ca9=['../model/servicenowAccount','../model/freshsalesAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','interface','answered','sumHoldTime','isEmpty','hasOwnProperty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','mergeFromDatabase','prototype','initAgents','length','isNil','format','initTelephones','telephones','initTrunks','isUndefined','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','sugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercompleteAt','initVoiceCallReports','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount'];(function(_0x55417e,_0x3ebc03){var _0x513aa7=function(_0x2ed62d){while(--_0x2ed62d){_0x55417e['push'](_0x55417e['shift']());}};_0x513aa7(++_0x3ebc03);}(_0x9ca9,0x189));var _0x99ca=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x9ca9[_0x3e0dc4];return _0x586111;};'use strict';var BPromise=require(_0x99ca('0x0'));var util=require(_0x99ca('0x1'));var _=require(_0x99ca('0x2'));var moment=require(_0x99ca('0x3'));var Agent=require(_0x99ca('0x4'));var Telephone=require(_0x99ca('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x99ca('0x6'));var Trigger=require(_0x99ca('0x7'));var Template=require(_0x99ca('0x8'));var Campaign=require(_0x99ca('0x9'));var VoiceExtension=require(_0x99ca('0xa'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x99ca('0xb'));var FreshdeskAccount=require(_0x99ca('0xc'));var SugarcrmAccount=require(_0x99ca('0xd'));var ZohoAccount=require(_0x99ca('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x99ca('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x99ca('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x99ca('0x11')]={};this['telephones']={};this[_0x99ca('0x12')]={};this[_0x99ca('0x13')]={};this[_0x99ca('0x14')]={};this[_0x99ca('0x15')]={};this[_0x99ca('0x16')]={};this[_0x99ca('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x99ca('0x18')]={};this[_0x99ca('0x19')]={};this['outboundChannels']={};this[_0x99ca('0x1a')]={};this[_0x99ca('0x1b')]={};this[_0x99ca('0x1c')]={};this['sugarcrmAccounts']={};this[_0x99ca('0x1d')]={};this[_0x99ca('0x1e')]={};this[_0x99ca('0x1f')]={};this['vtigerAccounts']={};this[_0x99ca('0x20')]={};this['dynamics365Accounts']={};this[_0x99ca('0x21')]={};this[_0x99ca('0x22')]={};};function freeIsNotKey(_0xd0ca95,_0xe74b11,_0x4669ff){var _0x34de30=_[_0x99ca('0x23')](_0xd0ca95,function(_0x1d38d0,_0x4b8816){return _0x1d38d0[_0x4669ff];});for(var _0x99e77e in _0xe74b11){if(_0xe74b11['hasOwnProperty'](_0x99e77e)){if(!_0x34de30[_0x99e77e]){delete _0xe74b11[_0x99e77e];}}}}function freeIsNotKeySip(_0x2bbdb0,_0x218936){var _0x1ec638=_[_0x99ca('0x23')](_0x2bbdb0,function(_0x59bf1a,_0x5d8fdb){return util['format'](_0x99ca('0x24'),_0x59bf1a[_0x99ca('0x25')]);});for(var _0x12e4a0 in _0x218936){if(_0x218936['hasOwnProperty'](_0x12e4a0)){if(!_0x1ec638[_0x12e4a0]){delete _0x218936[_0x12e4a0];}}}}function freeIsNotKeyAgent(_0x16fee8,_0x423076){var _0x55240c=_[_0x99ca('0x23')](_0x16fee8,function(_0x5e341e,_0x1498c2){var _0x3f8d64=_['isNil'](_0x5e341e[_0x99ca('0x26')])?util['format'](_0x99ca('0x24'),_0x5e341e[_0x99ca('0x25')]):_0x5e341e[_0x99ca('0x26')];return _0x3f8d64;});for(var _0x5f215a in _0x423076){if(_0x423076['hasOwnProperty'](_0x5f215a)){if(!_0x55240c[_0x5f215a]){delete _0x423076[_0x5f215a];}}}}function clearVoiceCallReports(_0x370f17){_0x370f17['total']=0x0;_0x370f17[_0x99ca('0x27')]=0x0;_0x370f17[_0x99ca('0x28')]=0x0;_0x370f17['sumDuration']=0x0;_0x370f17['sumBillable']=0x0;}function clearCampaigns(_0x342cb5){if(!_[_0x99ca('0x29')](_0x342cb5)){for(var _0x11c6ca in _0x342cb5){if(_0x342cb5[_0x99ca('0x2a')](_0x11c6ca)){_0x342cb5[_0x11c6ca][_0x99ca('0x2b')]=0x0;_0x342cb5[_0x11c6ca][_0x99ca('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x35f572){if(!_[_0x99ca('0x29')](_0x35f572)){for(var _0x18e2f5 in _0x35f572){if(_0x35f572[_0x99ca('0x2a')](_0x18e2f5)){_0x35f572[_0x18e2f5][_0x99ca('0x2d')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x27')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x2e')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x2f')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x28')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x30')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x31')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x32')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x33')]=0x0;_0x35f572[_0x18e2f5]['outboundBusyCallsDay']=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x34')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x35')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x36')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x37')]=0x0;_0x35f572[_0x18e2f5]['outboundDropCallsDayCallersExit']=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x38')]=0x0;_0x35f572[_0x18e2f5]['outboundOriginateFailureCallsDay']=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x39')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x3a')]=0x0;_0x35f572[_0x18e2f5][_0x99ca('0x32')]=0x0;_0x35f572[_0x18e2f5]['outboundAnswerCallsDay']=0x0;_0x35f572[_0x18e2f5]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x99ca('0x3b')]=function(_0x27ecf9,_0x25ae09){for(var _0x478519 in _0x25ae09){if(_0x27ecf9[_0x99ca('0x2a')](_0x478519)){_0x27ecf9[_0x478519]=_0x25ae09[_0x478519];}}};Realtime[_0x99ca('0x3c')][_0x99ca('0x3d')]=function(){var _0x353e08=this;return function(_0x5d4f0a){if(_0x5d4f0a){freeIsNotKeyAgent(_0x5d4f0a,_0x353e08[_0x99ca('0x11')]);for(var _0x3c1092=0x0,_0x482fb9={},_0x5483ce={};_0x3c1092<_0x5d4f0a[_0x99ca('0x3e')];_0x3c1092+=0x1){_0x482fb9=_0x5d4f0a[_0x3c1092];var _0x141fe3=_[_0x99ca('0x3f')](_0x482fb9[_0x99ca('0x26')])?util[_0x99ca('0x40')](_0x99ca('0x24'),_0x482fb9[_0x99ca('0x25')]):_0x482fb9[_0x99ca('0x26')];if(_['isUndefined'](_0x353e08['agents'][_0x141fe3])){_0x353e08[_0x99ca('0x11')][_0x141fe3]=new Agent(_0x482fb9);}else{_0x353e08[_0x99ca('0x3b')](_0x353e08[_0x99ca('0x11')][_0x141fe3],_0x482fb9);}}}return _0x353e08['agents'];};};Realtime['prototype'][_0x99ca('0x41')]=function(){var _0x281899=this;return function(_0x13e2cc){if(_0x13e2cc){freeIsNotKeySip(_0x13e2cc,_0x281899[_0x99ca('0x42')]);for(var _0x3d9393=0x0,_0x28cc8f={},_0x1c4e5e={};_0x3d9393<_0x13e2cc[_0x99ca('0x3e')];_0x3d9393+=0x1){_0x28cc8f=_0x13e2cc[_0x3d9393];if(_['isUndefined'](_0x281899['telephones'][util[_0x99ca('0x40')]('SIP/%s',_0x28cc8f['name'])])){_0x281899['telephones'][util[_0x99ca('0x40')](_0x99ca('0x24'),_0x28cc8f[_0x99ca('0x25')])]=new Telephone(_0x28cc8f);}else{_0x281899['mergeFromDatabase'](_0x281899[_0x99ca('0x42')][util[_0x99ca('0x40')](_0x99ca('0x24'),_0x28cc8f[_0x99ca('0x25')])],_0x28cc8f);}}}return _0x281899['telephones'];};};Realtime['prototype'][_0x99ca('0x43')]=function(){var _0x26f468=this;return function(_0xa55d79){if(_0xa55d79){freeIsNotKeySip(_0xa55d79,_0x26f468['trunks']);for(var _0x5b6938=0x0,_0x20c8fa={},_0x10ea71={};_0x5b6938<_0xa55d79[_0x99ca('0x3e')];_0x5b6938+=0x1){_0x20c8fa=_0xa55d79[_0x5b6938];if(_['isUndefined'](_0x26f468[_0x99ca('0x12')][util['format']('SIP/%s',_0x20c8fa['name'])])){_0x26f468[_0x99ca('0x12')][util[_0x99ca('0x40')](_0x99ca('0x24'),_0x20c8fa['name'])]=new Trunk(_0x20c8fa);}else{_0x26f468[_0x99ca('0x3b')](_0x26f468[_0x99ca('0x12')][util[_0x99ca('0x40')](_0x99ca('0x24'),_0x20c8fa[_0x99ca('0x25')])],_0x20c8fa);}}}return _0x26f468[_0x99ca('0x12')];};};Realtime[_0x99ca('0x3c')]['initVoiceQueues']=function(){var _0xe7b516=this;return function(_0x5e0005){if(_0x5e0005){freeIsNotKey(_0x5e0005,_0xe7b516[_0x99ca('0x13')],_0x99ca('0x25'));for(var _0x2d4162=0x0,_0x357f35={},_0x588306={};_0x2d4162<_0x5e0005[_0x99ca('0x3e')];_0x2d4162+=0x1){_0x357f35=_0x5e0005[_0x2d4162];if(_[_0x99ca('0x44')](_0xe7b516[_0x99ca('0x13')][_0x357f35[_0x99ca('0x25')]])){_0xe7b516[_0x99ca('0x13')][_0x357f35[_0x99ca('0x25')]]=new VoiceQueue(_0x357f35);}else{_0xe7b516[_0x99ca('0x3b')](_0xe7b516['voiceQueues'][_0x357f35[_0x99ca('0x25')]],_0x357f35);}}}return _0xe7b516['voiceQueues'];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x45')]=function(){var _0x51234e=this;return function(_0x138eab){if(_0x138eab){freeIsNotKey(_0x138eab,_0x51234e['triggers'],'id');for(var _0x4428ed=0x0,_0x380e22={},_0x41e1c6={};_0x4428ed<_0x138eab[_0x99ca('0x3e')];_0x4428ed+=0x1){_0x380e22=_0x138eab[_0x4428ed];if(_[_0x99ca('0x44')](_0x51234e['triggers'][_0x380e22['id']])){_0x51234e['triggers'][_0x380e22['id']]=new Trigger(_0x380e22);}else{_0x51234e[_0x99ca('0x3b')](_0x51234e[_0x99ca('0x14')][_0x380e22['id']],_0x380e22);}}}return _0x51234e[_0x99ca('0x14')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x46')]=function(){var _0xbd5b92=this;return function(_0x15cb47){if(_0x15cb47){freeIsNotKey(_0x15cb47,_0xbd5b92[_0x99ca('0x16')],'id');for(var _0x3a998a=0x0,_0x2655ea={},_0x36b466={};_0x3a998a<_0x15cb47[_0x99ca('0x3e')];_0x3a998a+=0x1){_0x2655ea=_0x15cb47[_0x3a998a];if(_[_0x99ca('0x44')](_0xbd5b92['templates'][_0x2655ea['id']])){_0xbd5b92[_0x99ca('0x16')][_0x2655ea['id']]=new Template(_0x2655ea);}else{_0xbd5b92[_0x99ca('0x3b')](_0xbd5b92[_0x99ca('0x16')][_0x2655ea['id']],_0x2655ea);}}}return _0xbd5b92[_0x99ca('0x16')];};};Realtime['prototype'][_0x99ca('0x47')]=function(){var _0x2b20df=this;return function(_0x2d4f25){if(_0x2d4f25){freeIsNotKey(_0x2d4f25,_0x2b20df['zendeskAccounts'],'id');for(var _0x33f861=0x0,_0x48b7f7={},_0x3d8c9a={};_0x33f861<_0x2d4f25[_0x99ca('0x3e')];_0x33f861+=0x1){_0x48b7f7=_0x2d4f25[_0x33f861];if(_[_0x99ca('0x44')](_0x2b20df[_0x99ca('0x1b')][_0x48b7f7['id']])){_0x2b20df[_0x99ca('0x1b')][_0x48b7f7['id']]=new ZendeskAccount(_0x48b7f7);}else{_0x2b20df[_0x99ca('0x3b')](_0x2b20df[_0x99ca('0x1b')][_0x48b7f7['id']],_0x48b7f7);}}}return _0x2b20df[_0x99ca('0x1b')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x48')]=function(){var _0x5c6298=this;return function(_0x16e338){if(_0x16e338){freeIsNotKey(_0x16e338,_0x5c6298['salesforceAccounts'],'id');for(var _0x47a54d=0x0,_0x4d12c5={},_0xd0bf07={};_0x47a54d<_0x16e338['length'];_0x47a54d+=0x1){_0x4d12c5=_0x16e338[_0x47a54d];if(_[_0x99ca('0x44')](_0x5c6298[_0x99ca('0x1c')][_0x4d12c5['id']])){_0x5c6298[_0x99ca('0x1c')][_0x4d12c5['id']]=new SalesforceAccount(_0x4d12c5);}else{_0x5c6298[_0x99ca('0x3b')](_0x5c6298[_0x99ca('0x1c')][_0x4d12c5['id']],_0x4d12c5);}}}return _0x5c6298[_0x99ca('0x1c')];};};Realtime['prototype'][_0x99ca('0x49')]=function(){var _0x165424=this;return function(_0x4e60de){if(_0x4e60de){freeIsNotKey(_0x4e60de,_0x165424[_0x99ca('0x1d')],'id');for(var _0x3d03dc=0x0,_0xab191b={},_0x25e3b4={};_0x3d03dc<_0x4e60de[_0x99ca('0x3e')];_0x3d03dc+=0x1){_0xab191b=_0x4e60de[_0x3d03dc];if(_[_0x99ca('0x44')](_0x165424['freshdeskAccounts'][_0xab191b['id']])){_0x165424[_0x99ca('0x1d')][_0xab191b['id']]=new FreshdeskAccount(_0xab191b);}else{_0x165424[_0x99ca('0x3b')](_0x165424[_0x99ca('0x1d')][_0xab191b['id']],_0xab191b);}}}return _0x165424[_0x99ca('0x1d')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x4a')]=function(){var _0xfffe48=this;return function(_0x3377e5){if(_0x3377e5){freeIsNotKey(_0x3377e5,_0xfffe48[_0x99ca('0x1e')],'id');for(var _0x3bc642=0x0,_0x102846={},_0x2ccbe9={};_0x3bc642<_0x3377e5[_0x99ca('0x3e')];_0x3bc642+=0x1){_0x102846=_0x3377e5[_0x3bc642];if(_[_0x99ca('0x44')](_0xfffe48[_0x99ca('0x1e')][_0x102846['id']])){_0xfffe48[_0x99ca('0x1e')][_0x102846['id']]=new ZohoAccount(_0x102846);}else{_0xfffe48['mergeFromDatabase'](_0xfffe48[_0x99ca('0x1e')][_0x102846['id']],_0x102846);}}}return _0xfffe48['zohoAccounts'];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x33faab=this;return function(_0x2fc4f7){if(_0x2fc4f7){freeIsNotKey(_0x2fc4f7,_0x33faab[_0x99ca('0x1f')],'id');for(var _0x43a1b2=0x0,_0x17b49d={},_0x213ea0={};_0x43a1b2<_0x2fc4f7[_0x99ca('0x3e')];_0x43a1b2+=0x1){_0x17b49d=_0x2fc4f7[_0x43a1b2];if(_[_0x99ca('0x44')](_0x33faab[_0x99ca('0x1f')][_0x17b49d['id']])){_0x33faab['deskAccounts'][_0x17b49d['id']]=new DeskAccount(_0x17b49d);}else{_0x33faab[_0x99ca('0x3b')](_0x33faab[_0x99ca('0x1f')][_0x17b49d['id']],_0x17b49d);}}}return _0x33faab[_0x99ca('0x1f')];};};Realtime[_0x99ca('0x3c')]['initSugarcrmAccounts']=function(){var _0x24f61c=this;return function(_0x410a96){if(_0x410a96){freeIsNotKey(_0x410a96,_0x24f61c[_0x99ca('0x4b')],'id');for(var _0x3a78ab=0x0,_0x4e70df={},_0x23b04e={};_0x3a78ab<_0x410a96[_0x99ca('0x3e')];_0x3a78ab+=0x1){_0x4e70df=_0x410a96[_0x3a78ab];if(_[_0x99ca('0x44')](_0x24f61c[_0x99ca('0x4b')][_0x4e70df['id']])){_0x24f61c[_0x99ca('0x4b')][_0x4e70df['id']]=new SugarcrmAccount(_0x4e70df);}else{_0x24f61c['mergeFromDatabase'](_0x24f61c[_0x99ca('0x4b')][_0x4e70df['id']],_0x4e70df);}}}return _0x24f61c['sugarcrmAccounts'];};};Realtime[_0x99ca('0x3c')]['initVtigerAccounts']=function(){var _0xe692f6=this;return function(_0xf719c4){if(_0xf719c4){freeIsNotKey(_0xf719c4,_0xe692f6[_0x99ca('0x4c')],'id');for(var _0x373e9e=0x0,_0x2beeaf={},_0x32d6ff={};_0x373e9e<_0xf719c4[_0x99ca('0x3e')];_0x373e9e+=0x1){_0x2beeaf=_0xf719c4[_0x373e9e];if(_[_0x99ca('0x44')](_0xe692f6[_0x99ca('0x4c')][_0x2beeaf['id']])){_0xe692f6[_0x99ca('0x4c')][_0x2beeaf['id']]=new VtigerAccount(_0x2beeaf);}else{_0xe692f6[_0x99ca('0x3b')](_0xe692f6[_0x99ca('0x4c')][_0x2beeaf['id']],_0x2beeaf);}}}return _0xe692f6[_0x99ca('0x4c')];};};Realtime['prototype'][_0x99ca('0x4d')]=function(){var _0x5c847a=this;return function(_0x1e7093){if(_0x1e7093){freeIsNotKey(_0x1e7093,_0x5c847a['servicenowAccounts'],'id');for(var _0x56d0e2=0x0,_0x1b30fb={},_0x3eaad1={};_0x56d0e2<_0x1e7093[_0x99ca('0x3e')];_0x56d0e2+=0x1){_0x1b30fb=_0x1e7093[_0x56d0e2];if(_['isUndefined'](_0x5c847a[_0x99ca('0x20')][_0x1b30fb['id']])){_0x5c847a[_0x99ca('0x20')][_0x1b30fb['id']]=new ServicenowAccount(_0x1b30fb);}else{_0x5c847a['mergeFromDatabase'](_0x5c847a[_0x99ca('0x20')][_0x1b30fb['id']],_0x1b30fb);}}}return _0x5c847a[_0x99ca('0x20')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x4e')]=function(){var _0x17554d=this;return function(_0x588a51){if(_0x588a51){freeIsNotKey(_0x588a51,_0x17554d[_0x99ca('0x4f')],'id');for(var _0x6218b7=0x0,_0x1c99ed={},_0x5d435b={};_0x6218b7<_0x588a51[_0x99ca('0x3e')];_0x6218b7+=0x1){_0x1c99ed=_0x588a51[_0x6218b7];if(_[_0x99ca('0x44')](_0x17554d[_0x99ca('0x4f')][_0x1c99ed['id']])){_0x17554d[_0x99ca('0x4f')][_0x1c99ed['id']]=new Dynamics365Account(_0x1c99ed);}else{_0x17554d[_0x99ca('0x3b')](_0x17554d[_0x99ca('0x4f')][_0x1c99ed['id']],_0x1c99ed);}}}return _0x17554d[_0x99ca('0x4f')];};};Realtime[_0x99ca('0x3c')]['initFreshsalesAccounts']=function(){var _0x14dc7c=this;return function(_0x21e31d){if(_0x21e31d){freeIsNotKey(_0x21e31d,_0x14dc7c[_0x99ca('0x21')],'id');for(var _0x5c48b7=0x0,_0x4b5a1e={},_0x3a52c8={};_0x5c48b7<_0x21e31d[_0x99ca('0x3e')];_0x5c48b7+=0x1){_0x4b5a1e=_0x21e31d[_0x5c48b7];if(_[_0x99ca('0x44')](_0x14dc7c[_0x99ca('0x21')][_0x4b5a1e['id']])){_0x14dc7c[_0x99ca('0x21')][_0x4b5a1e['id']]=new FreshsalesAccount(_0x4b5a1e);}else{_0x14dc7c[_0x99ca('0x3b')](_0x14dc7c[_0x99ca('0x21')][_0x4b5a1e['id']],_0x4b5a1e);}}}return _0x14dc7c[_0x99ca('0x21')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x50')]=function(){var _0x360485=this;return function(_0x58d157){for(var _0x38a6f5=0x0;_0x38a6f5<_0x58d157[_0x99ca('0x3e')];_0x38a6f5+=0x1){_[_0x99ca('0x51')](_0x360485[_0x99ca('0x13')][_0x58d157[_0x38a6f5][_0x99ca('0x25')]],_0x58d157[_0x38a6f5]);}return _0x360485[_0x99ca('0x13')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x52')]=function(){var _0x1652b9=this;return function(_0x2f8da0){clearVoiceQueues(_0x1652b9[_0x99ca('0x13')]);if(_0x2f8da0){_0x2f8da0=_[_0x99ca('0x53')](_0x2f8da0,_0x99ca('0x54'));for(var _0x283d23 in _0x2f8da0){if(_0x2f8da0['hasOwnProperty'](_0x283d23)){var _0x1b34ff={};for(var _0x2ba511=0x0;_0x2ba511<_0x2f8da0[_0x283d23][_0x99ca('0x3e')];_0x2ba511+=0x1){var _0x13f46e=_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x55')];if(_0x1652b9[_0x99ca('0x13')][_0x13f46e]){if(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallerexit']){_0x1652b9[_0x99ca('0x13')][_0x13f46e][_0x99ca('0x2e')]+=0x1;}if(_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x56')]){_0x1652b9[_0x99ca('0x13')][_0x13f46e][_0x99ca('0x2f')]+=0x1;}_0x1652b9[_0x99ca('0x13')][_0x13f46e][_0x99ca('0x28')]+=moment(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallerleaveAt'])[_0x99ca('0x57')](moment(_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x58')]),_0x99ca('0x59'))||0x0;if(_0x2ba511===_0x2f8da0[_0x283d23][_0x99ca('0x3e')]-0x1){_0x1652b9[_0x99ca('0x13')][_0x13f46e]['sumDuration']+=moment(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallercompleteAt']||_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x5a')]||_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x5b')])[_0x99ca('0x57')](moment(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallerjoinAt']),_0x99ca('0x59'))||0x0;_0x1652b9[_0x99ca('0x13')][_0x13f46e]['total']+=0x1;if(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallercomplete']){_0x1652b9[_0x99ca('0x13')][_0x13f46e][_0x99ca('0x27')]+=0x1;_0x1652b9[_0x99ca('0x13')][_0x13f46e][_0x99ca('0x31')]+=moment(_0x2f8da0[_0x283d23][_0x2ba511][_0x99ca('0x5c')])[_0x99ca('0x57')](moment(_0x2f8da0[_0x283d23][_0x2ba511]['queuecallerleaveAt']),_0x99ca('0x59'))||0x0;}}else{_0x1652b9[_0x99ca('0x13')][_0x13f46e]['sumDuration']+=_0x1652b9['voiceQueues'][_0x13f46e][_0x99ca('0x28')]||0x0;}}}}}}return _0x1652b9[_0x99ca('0x13')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x5d')]=function(){var _0x3bd5c3=this;return function(_0x48d827){clearVoiceCallReports(_0x3bd5c3[_0x99ca('0x17')]);if(_0x48d827){for(var _0x4d2338=0x0;_0x4d2338<_0x48d827[_0x99ca('0x3e')];_0x4d2338+=0x1){_0x3bd5c3[_0x99ca('0x17')][_0x99ca('0x2d')]+=0x1;_0x3bd5c3[_0x99ca('0x17')]['sumDuration']+=_0x48d827[_0x4d2338][_0x99ca('0x5e')];if(_0x48d827[_0x4d2338]['disposition']==='ANSWERED'){_0x3bd5c3['outbound'][_0x99ca('0x27')]+=0x1;_0x3bd5c3[_0x99ca('0x17')][_0x99ca('0x28')]+=_0x48d827[_0x4d2338][_0x99ca('0x5e')]-_0x48d827[_0x4d2338][_0x99ca('0x5f')]||0x0;_0x3bd5c3[_0x99ca('0x17')][_0x99ca('0x31')]+=_0x48d827[_0x4d2338][_0x99ca('0x5f')];}}}return _0x3bd5c3[_0x99ca('0x17')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x60')]=function(){var _0x41107c=this;return function(_0x438ae9){if(_0x438ae9){freeIsNotKey(_0x438ae9,_0x41107c[_0x99ca('0x15')],'name');for(var _0x1b5240=0x0,_0x213dc3={};_0x1b5240<_0x438ae9[_0x99ca('0x3e')];_0x1b5240+=0x1){_0x213dc3=_0x438ae9[_0x1b5240];if(_[_0x99ca('0x44')](_0x41107c[_0x99ca('0x15')][_0x213dc3[_0x99ca('0x25')]])){_0x41107c[_0x99ca('0x15')][_0x213dc3[_0x99ca('0x25')]]=new Campaign(_0x213dc3);}else{_0x41107c['mergeFromDatabase'](_0x41107c[_0x99ca('0x15')][_0x213dc3[_0x99ca('0x25')]],_0x213dc3);_0x41107c[_0x99ca('0x15')][_0x213dc3['name']]['dialQueueProject']=_0x213dc3[_0x99ca('0x61')]?_0x213dc3[_0x99ca('0x61')][_0x99ca('0x25')]:undefined;}}}return _0x41107c[_0x99ca('0x15')];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x62')]=function(){var _0x3c3f57=this;return function(_0x559623){if(_0x559623){freeIsNotKey(_0x559623,_0x3c3f57['voiceExtensions'],'id');for(var _0x33941f=0x0,_0x2f89e8={};_0x33941f<_0x559623[_0x99ca('0x3e')];_0x33941f+=0x1){_0x2f89e8=_0x559623[_0x33941f];if(_[_0x99ca('0x44')](_0x3c3f57['voiceExtensions'][_0x2f89e8['id']])){_0x3c3f57[_0x99ca('0x63')][_0x2f89e8['id']]=new VoiceExtension(_0x2f89e8);}else{_0x3c3f57['mergeFromDatabase'](_0x3c3f57['voiceExtensions'][_0x2f89e8['id']],_0x2f89e8);}}}return _0x3c3f57[_0x99ca('0x63')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x1e9b15=this;return function(_0x58c6df){clearCampaigns(_0x1e9b15[_0x99ca('0x15')]);for(var _0x3e6550=0x0;_0x3e6550<_0x58c6df['length'];_0x3e6550+=0x1){_['merge'](_0x1e9b15[_0x99ca('0x15')][_0x58c6df[_0x3e6550][_0x99ca('0x25')]],_0x58c6df[_0x3e6550]);}return _0x1e9b15['campaigns'];};};Realtime[_0x99ca('0x3c')][_0x99ca('0x64')]=function(){var _0x2742fa=this;return function(_0x1fcaec){if(_0x1fcaec){freeIsNotKey(_0x1fcaec,_0x2742fa['faxAccounts'],'id');for(var _0x28f3c1=0x0,_0x48eb6f={},_0x21b212={};_0x28f3c1<_0x1fcaec[_0x99ca('0x3e')];_0x28f3c1+=0x1){_0x48eb6f=_0x1fcaec[_0x28f3c1];if(_[_0x99ca('0x44')](_0x2742fa[_0x99ca('0x22')][_0x48eb6f['id']])){_0x2742fa['faxAccounts'][_0x48eb6f['id']]=new FaxAccount(_0x48eb6f);}else{_0x2742fa[_0x99ca('0x3b')](_0x2742fa[_0x99ca('0x22')][_0x48eb6f['id']],_0x48eb6f);}}}return _0x2742fa['faxAccounts'];};};module[_0x99ca('0x65')]=Realtime; \ No newline at end of file +var _0xc882=['triggers','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','timers','zendeskAccounts','salesforceAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','mapKeys','isNil','interface','name','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','abandoned','outboundAnswerAgiCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','mergeFromDatabase','initTelephones','length','isUndefined','initTrunks','initVoiceQueues','initTriggers'];(function(_0x2b1563,_0x247bae){var _0x5e156a=function(_0x17d5ec){while(--_0x17d5ec){_0x2b1563['push'](_0x2b1563['shift']());}};_0x5e156a(++_0x247bae);}(_0xc882,0xff));var _0x2c88=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc882[_0x432682];return _0x463d05;};'use strict';var BPromise=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var _=require(_0x2c88('0x2'));var moment=require(_0x2c88('0x3'));var Agent=require(_0x2c88('0x4'));var Telephone=require(_0x2c88('0x5'));var Trunk=require(_0x2c88('0x6'));var VoiceQueue=require(_0x2c88('0x7'));var Trigger=require(_0x2c88('0x8'));var Template=require(_0x2c88('0x9'));var Campaign=require(_0x2c88('0xa'));var VoiceExtension=require(_0x2c88('0xb'));var ZendeskAccount=require(_0x2c88('0xc'));var SalesforceAccount=require(_0x2c88('0xd'));var FreshdeskAccount=require(_0x2c88('0xe'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x2c88('0xf'));var ServicenowAccount=require(_0x2c88('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x2c88('0x11'));var FaxAccount=require(_0x2c88('0x12'));var Realtime=function(){this['agents']={};this[_0x2c88('0x13')]={};this[_0x2c88('0x14')]={};this[_0x2c88('0x15')]={};this['triggers']={};this[_0x2c88('0x16')]={};this[_0x2c88('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2c88('0x18')]={};this[_0x2c88('0x19')]={};this['queueChannels']={};this['outboundChannels']={};this[_0x2c88('0x1a')]={};this[_0x2c88('0x1b')]={};this[_0x2c88('0x1c')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x2c88('0x1d')]={};this['deskAccounts']={};this[_0x2c88('0x1e')]={};this[_0x2c88('0x1f')]={};this[_0x2c88('0x20')]={};this[_0x2c88('0x21')]={};this[_0x2c88('0x22')]={};};function freeIsNotKey(_0xa3f02,_0x5039d8,_0x4e13dc){var _0x37b8fe=_['mapKeys'](_0xa3f02,function(_0x5d77d8,_0x332896){return _0x5d77d8[_0x4e13dc];});for(var _0xa4cf77 in _0x5039d8){if(_0x5039d8[_0x2c88('0x23')](_0xa4cf77)){if(!_0x37b8fe[_0xa4cf77]){delete _0x5039d8[_0xa4cf77];}}}}function freeIsNotKeySip(_0x31d543,_0x3a4690){var _0x26a9b5=_['mapKeys'](_0x31d543,function(_0x1125ef,_0x1ca00f){return util[_0x2c88('0x24')](_0x2c88('0x25'),_0x1125ef['name']);});for(var _0x1b0260 in _0x3a4690){if(_0x3a4690[_0x2c88('0x23')](_0x1b0260)){if(!_0x26a9b5[_0x1b0260]){delete _0x3a4690[_0x1b0260];}}}}function freeIsNotKeyAgent(_0x201cb6,_0x414d9a){var _0x57c057=_[_0x2c88('0x26')](_0x201cb6,function(_0x5743a5,_0x14449b){var _0x598b4a=_[_0x2c88('0x27')](_0x5743a5[_0x2c88('0x28')])?util[_0x2c88('0x24')](_0x2c88('0x25'),_0x5743a5[_0x2c88('0x29')]):_0x5743a5['interface'];return _0x598b4a;});for(var _0x51f30b in _0x414d9a){if(_0x414d9a[_0x2c88('0x23')](_0x51f30b)){if(!_0x57c057[_0x51f30b]){delete _0x414d9a[_0x51f30b];}}}}function clearVoiceCallReports(_0x36df18){_0x36df18['total']=0x0;_0x36df18['answered']=0x0;_0x36df18[_0x2c88('0x2a')]=0x0;_0x36df18[_0x2c88('0x2b')]=0x0;_0x36df18[_0x2c88('0x2c')]=0x0;}function clearCampaigns(_0xa00955){if(!_[_0x2c88('0x2d')](_0xa00955)){for(var _0x323f32 in _0xa00955){if(_0xa00955[_0x2c88('0x23')](_0x323f32)){_0xa00955[_0x323f32][_0x2c88('0x2e')]=0x0;_0xa00955[_0x323f32][_0x2c88('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x49a144){if(!_['isEmpty'](_0x49a144)){for(var _0x5d2a2a in _0x49a144){if(_0x49a144[_0x2c88('0x23')](_0x5d2a2a)){_0x49a144[_0x5d2a2a][_0x2c88('0x30')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x31')]=0x0;_0x49a144[_0x5d2a2a]['unmanaged']=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x32')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x2a')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x2b')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x2c')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x33')]=0x0;_0x49a144[_0x5d2a2a]['outboundNoAnswerCallsDay']=0x0;_0x49a144[_0x5d2a2a]['outboundBusyCallsDay']=0x0;_0x49a144[_0x5d2a2a]['outboundCongestionCallsDay']=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x34')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x35')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x36')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x37')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x38')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x39')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x3a')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x3b')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x33')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x3c')]=0x0;_0x49a144[_0x5d2a2a][_0x2c88('0x3d')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x4dacf6,_0x18d08b){for(var _0x5a91b0 in _0x18d08b){if(_0x4dacf6['hasOwnProperty'](_0x5a91b0)){_0x4dacf6[_0x5a91b0]=_0x18d08b[_0x5a91b0];}}};Realtime[_0x2c88('0x3e')][_0x2c88('0x3f')]=function(){var _0x15df5d=this;return function(_0x12559b){if(_0x12559b){freeIsNotKeyAgent(_0x12559b,_0x15df5d['agents']);for(var _0x59086f=0x0,_0x633639={},_0x5e17d0={};_0x59086f<_0x12559b['length'];_0x59086f+=0x1){_0x633639=_0x12559b[_0x59086f];var _0x227115=_[_0x2c88('0x27')](_0x633639[_0x2c88('0x28')])?util[_0x2c88('0x24')](_0x2c88('0x25'),_0x633639['name']):_0x633639[_0x2c88('0x28')];if(_['isUndefined'](_0x15df5d['agents'][_0x227115])){_0x15df5d[_0x2c88('0x40')][_0x227115]=new Agent(_0x633639);}else{_0x15df5d[_0x2c88('0x41')](_0x15df5d[_0x2c88('0x40')][_0x227115],_0x633639);}}}return _0x15df5d[_0x2c88('0x40')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x42')]=function(){var _0x4332d4=this;return function(_0x2450ee){if(_0x2450ee){freeIsNotKeySip(_0x2450ee,_0x4332d4[_0x2c88('0x13')]);for(var _0x553134=0x0,_0xfcc297={},_0x138255={};_0x553134<_0x2450ee[_0x2c88('0x43')];_0x553134+=0x1){_0xfcc297=_0x2450ee[_0x553134];if(_[_0x2c88('0x44')](_0x4332d4[_0x2c88('0x13')][util['format']('SIP/%s',_0xfcc297[_0x2c88('0x29')])])){_0x4332d4[_0x2c88('0x13')][util[_0x2c88('0x24')](_0x2c88('0x25'),_0xfcc297['name'])]=new Telephone(_0xfcc297);}else{_0x4332d4[_0x2c88('0x41')](_0x4332d4[_0x2c88('0x13')][util[_0x2c88('0x24')](_0x2c88('0x25'),_0xfcc297[_0x2c88('0x29')])],_0xfcc297);}}}return _0x4332d4[_0x2c88('0x13')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x45')]=function(){var _0x429661=this;return function(_0x25a0ad){if(_0x25a0ad){freeIsNotKeySip(_0x25a0ad,_0x429661[_0x2c88('0x14')]);for(var _0x19da26=0x0,_0x32db4a={},_0x543932={};_0x19da26<_0x25a0ad[_0x2c88('0x43')];_0x19da26+=0x1){_0x32db4a=_0x25a0ad[_0x19da26];if(_[_0x2c88('0x44')](_0x429661[_0x2c88('0x14')][util['format'](_0x2c88('0x25'),_0x32db4a[_0x2c88('0x29')])])){_0x429661[_0x2c88('0x14')][util[_0x2c88('0x24')](_0x2c88('0x25'),_0x32db4a[_0x2c88('0x29')])]=new Trunk(_0x32db4a);}else{_0x429661[_0x2c88('0x41')](_0x429661['trunks'][util[_0x2c88('0x24')](_0x2c88('0x25'),_0x32db4a['name'])],_0x32db4a);}}}return _0x429661['trunks'];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x46')]=function(){var _0x493076=this;return function(_0x3e5ade){if(_0x3e5ade){freeIsNotKey(_0x3e5ade,_0x493076[_0x2c88('0x15')],'name');for(var _0x53569d=0x0,_0x4af687={},_0x163ee0={};_0x53569d<_0x3e5ade[_0x2c88('0x43')];_0x53569d+=0x1){_0x4af687=_0x3e5ade[_0x53569d];if(_['isUndefined'](_0x493076[_0x2c88('0x15')][_0x4af687['name']])){_0x493076[_0x2c88('0x15')][_0x4af687[_0x2c88('0x29')]]=new VoiceQueue(_0x4af687);}else{_0x493076[_0x2c88('0x41')](_0x493076[_0x2c88('0x15')][_0x4af687['name']],_0x4af687);}}}return _0x493076[_0x2c88('0x15')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x47')]=function(){var _0x452f77=this;return function(_0x27bd1d){if(_0x27bd1d){freeIsNotKey(_0x27bd1d,_0x452f77[_0x2c88('0x48')],'id');for(var _0xc49b77=0x0,_0xb92033={},_0x371f5e={};_0xc49b77<_0x27bd1d[_0x2c88('0x43')];_0xc49b77+=0x1){_0xb92033=_0x27bd1d[_0xc49b77];if(_[_0x2c88('0x44')](_0x452f77[_0x2c88('0x48')][_0xb92033['id']])){_0x452f77[_0x2c88('0x48')][_0xb92033['id']]=new Trigger(_0xb92033);}else{_0x452f77[_0x2c88('0x41')](_0x452f77[_0x2c88('0x48')][_0xb92033['id']],_0xb92033);}}}return _0x452f77[_0x2c88('0x48')];};};Realtime[_0x2c88('0x3e')]['initTemplates']=function(){var _0x393d0a=this;return function(_0x103666){if(_0x103666){freeIsNotKey(_0x103666,_0x393d0a['templates'],'id');for(var _0x6d15bc=0x0,_0xb2970a={},_0x20655e={};_0x6d15bc<_0x103666[_0x2c88('0x43')];_0x6d15bc+=0x1){_0xb2970a=_0x103666[_0x6d15bc];if(_['isUndefined'](_0x393d0a[_0x2c88('0x17')][_0xb2970a['id']])){_0x393d0a[_0x2c88('0x17')][_0xb2970a['id']]=new Template(_0xb2970a);}else{_0x393d0a[_0x2c88('0x41')](_0x393d0a[_0x2c88('0x17')][_0xb2970a['id']],_0xb2970a);}}}return _0x393d0a[_0x2c88('0x17')];};};Realtime[_0x2c88('0x3e')]['initZendeskAccounts']=function(){var _0x5acf4e=this;return function(_0x353299){if(_0x353299){freeIsNotKey(_0x353299,_0x5acf4e[_0x2c88('0x1b')],'id');for(var _0x5e6a2a=0x0,_0x537f81={},_0x4dd4e4={};_0x5e6a2a<_0x353299['length'];_0x5e6a2a+=0x1){_0x537f81=_0x353299[_0x5e6a2a];if(_['isUndefined'](_0x5acf4e[_0x2c88('0x1b')][_0x537f81['id']])){_0x5acf4e[_0x2c88('0x1b')][_0x537f81['id']]=new ZendeskAccount(_0x537f81);}else{_0x5acf4e[_0x2c88('0x41')](_0x5acf4e['zendeskAccounts'][_0x537f81['id']],_0x537f81);}}}return _0x5acf4e[_0x2c88('0x1b')];};};Realtime['prototype'][_0x2c88('0x49')]=function(){var _0x3f8c9a=this;return function(_0x47abdb){if(_0x47abdb){freeIsNotKey(_0x47abdb,_0x3f8c9a['salesforceAccounts'],'id');for(var _0x2e224c=0x0,_0x387ede={},_0x2145ec={};_0x2e224c<_0x47abdb['length'];_0x2e224c+=0x1){_0x387ede=_0x47abdb[_0x2e224c];if(_['isUndefined'](_0x3f8c9a[_0x2c88('0x1c')][_0x387ede['id']])){_0x3f8c9a['salesforceAccounts'][_0x387ede['id']]=new SalesforceAccount(_0x387ede);}else{_0x3f8c9a[_0x2c88('0x41')](_0x3f8c9a[_0x2c88('0x1c')][_0x387ede['id']],_0x387ede);}}}return _0x3f8c9a[_0x2c88('0x1c')];};};Realtime['prototype'][_0x2c88('0x4a')]=function(){var _0x34796e=this;return function(_0x1bb5ad){if(_0x1bb5ad){freeIsNotKey(_0x1bb5ad,_0x34796e[_0x2c88('0x4b')],'id');for(var _0x29a19c=0x0,_0x45a9c9={},_0x7f416c={};_0x29a19c<_0x1bb5ad[_0x2c88('0x43')];_0x29a19c+=0x1){_0x45a9c9=_0x1bb5ad[_0x29a19c];if(_[_0x2c88('0x44')](_0x34796e['freshdeskAccounts'][_0x45a9c9['id']])){_0x34796e[_0x2c88('0x4b')][_0x45a9c9['id']]=new FreshdeskAccount(_0x45a9c9);}else{_0x34796e[_0x2c88('0x41')](_0x34796e[_0x2c88('0x4b')][_0x45a9c9['id']],_0x45a9c9);}}}return _0x34796e[_0x2c88('0x4b')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x4c')]=function(){var _0x55f87e=this;return function(_0x5cde71){if(_0x5cde71){freeIsNotKey(_0x5cde71,_0x55f87e[_0x2c88('0x1d')],'id');for(var _0x40595f=0x0,_0x190a71={},_0x245c47={};_0x40595f<_0x5cde71[_0x2c88('0x43')];_0x40595f+=0x1){_0x190a71=_0x5cde71[_0x40595f];if(_[_0x2c88('0x44')](_0x55f87e[_0x2c88('0x1d')][_0x190a71['id']])){_0x55f87e[_0x2c88('0x1d')][_0x190a71['id']]=new ZohoAccount(_0x190a71);}else{_0x55f87e[_0x2c88('0x41')](_0x55f87e[_0x2c88('0x1d')][_0x190a71['id']],_0x190a71);}}}return _0x55f87e[_0x2c88('0x1d')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x4d')]=function(){var _0x2b33a4=this;return function(_0xc35b43){if(_0xc35b43){freeIsNotKey(_0xc35b43,_0x2b33a4[_0x2c88('0x4e')],'id');for(var _0x913bff=0x0,_0x52503e={},_0x46a063={};_0x913bff<_0xc35b43['length'];_0x913bff+=0x1){_0x52503e=_0xc35b43[_0x913bff];if(_['isUndefined'](_0x2b33a4[_0x2c88('0x4e')][_0x52503e['id']])){_0x2b33a4[_0x2c88('0x4e')][_0x52503e['id']]=new DeskAccount(_0x52503e);}else{_0x2b33a4[_0x2c88('0x41')](_0x2b33a4[_0x2c88('0x4e')][_0x52503e['id']],_0x52503e);}}}return _0x2b33a4[_0x2c88('0x4e')];};};Realtime[_0x2c88('0x3e')]['initSugarcrmAccounts']=function(){var _0x1a02ed=this;return function(_0x55173a){if(_0x55173a){freeIsNotKey(_0x55173a,_0x1a02ed['sugarcrmAccounts'],'id');for(var _0x1d396e=0x0,_0xf36221={},_0x2f9be6={};_0x1d396e<_0x55173a[_0x2c88('0x43')];_0x1d396e+=0x1){_0xf36221=_0x55173a[_0x1d396e];if(_[_0x2c88('0x44')](_0x1a02ed['sugarcrmAccounts'][_0xf36221['id']])){_0x1a02ed[_0x2c88('0x4f')][_0xf36221['id']]=new SugarcrmAccount(_0xf36221);}else{_0x1a02ed['mergeFromDatabase'](_0x1a02ed[_0x2c88('0x4f')][_0xf36221['id']],_0xf36221);}}}return _0x1a02ed[_0x2c88('0x4f')];};};Realtime['prototype'][_0x2c88('0x50')]=function(){var _0x8855c=this;return function(_0x30a642){if(_0x30a642){freeIsNotKey(_0x30a642,_0x8855c[_0x2c88('0x1e')],'id');for(var _0x5a9da2=0x0,_0x125711={},_0x8baa73={};_0x5a9da2<_0x30a642[_0x2c88('0x43')];_0x5a9da2+=0x1){_0x125711=_0x30a642[_0x5a9da2];if(_[_0x2c88('0x44')](_0x8855c[_0x2c88('0x1e')][_0x125711['id']])){_0x8855c[_0x2c88('0x1e')][_0x125711['id']]=new VtigerAccount(_0x125711);}else{_0x8855c['mergeFromDatabase'](_0x8855c[_0x2c88('0x1e')][_0x125711['id']],_0x125711);}}}return _0x8855c[_0x2c88('0x1e')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x51')]=function(){var _0x13fac0=this;return function(_0x56fb86){if(_0x56fb86){freeIsNotKey(_0x56fb86,_0x13fac0[_0x2c88('0x1f')],'id');for(var _0x412347=0x0,_0x2bfc9d={},_0x2cc74d={};_0x412347<_0x56fb86['length'];_0x412347+=0x1){_0x2bfc9d=_0x56fb86[_0x412347];if(_[_0x2c88('0x44')](_0x13fac0['servicenowAccounts'][_0x2bfc9d['id']])){_0x13fac0[_0x2c88('0x1f')][_0x2bfc9d['id']]=new ServicenowAccount(_0x2bfc9d);}else{_0x13fac0[_0x2c88('0x41')](_0x13fac0[_0x2c88('0x1f')][_0x2bfc9d['id']],_0x2bfc9d);}}}return _0x13fac0[_0x2c88('0x1f')];};};Realtime['prototype'][_0x2c88('0x52')]=function(){var _0x2b2887=this;return function(_0x5257be){if(_0x5257be){freeIsNotKey(_0x5257be,_0x2b2887[_0x2c88('0x20')],'id');for(var _0x30fe81=0x0,_0x5b0e37={},_0x43dc62={};_0x30fe81<_0x5257be[_0x2c88('0x43')];_0x30fe81+=0x1){_0x5b0e37=_0x5257be[_0x30fe81];if(_[_0x2c88('0x44')](_0x2b2887[_0x2c88('0x20')][_0x5b0e37['id']])){_0x2b2887[_0x2c88('0x20')][_0x5b0e37['id']]=new Dynamics365Account(_0x5b0e37);}else{_0x2b2887['mergeFromDatabase'](_0x2b2887['dynamics365Accounts'][_0x5b0e37['id']],_0x5b0e37);}}}return _0x2b2887[_0x2c88('0x20')];};};Realtime[_0x2c88('0x3e')]['initFreshsalesAccounts']=function(){var _0x2e5bd2=this;return function(_0x1e038d){if(_0x1e038d){freeIsNotKey(_0x1e038d,_0x2e5bd2[_0x2c88('0x21')],'id');for(var _0x56858f=0x0,_0x9c3de9={},_0x51b12d={};_0x56858f<_0x1e038d[_0x2c88('0x43')];_0x56858f+=0x1){_0x9c3de9=_0x1e038d[_0x56858f];if(_['isUndefined'](_0x2e5bd2[_0x2c88('0x21')][_0x9c3de9['id']])){_0x2e5bd2[_0x2c88('0x21')][_0x9c3de9['id']]=new FreshsalesAccount(_0x9c3de9);}else{_0x2e5bd2[_0x2c88('0x41')](_0x2e5bd2[_0x2c88('0x21')][_0x9c3de9['id']],_0x9c3de9);}}}return _0x2e5bd2[_0x2c88('0x21')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x53')]=function(){var _0x377d54=this;return function(_0xe05a2f){for(var _0x3a569c=0x0;_0x3a569c<_0xe05a2f[_0x2c88('0x43')];_0x3a569c+=0x1){_[_0x2c88('0x54')](_0x377d54['voiceQueues'][_0xe05a2f[_0x3a569c][_0x2c88('0x29')]],_0xe05a2f[_0x3a569c]);}return _0x377d54[_0x2c88('0x15')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3aa5e2=this;return function(_0x1020de){clearVoiceQueues(_0x3aa5e2[_0x2c88('0x15')]);if(_0x1020de){_0x1020de=_[_0x2c88('0x55')](_0x1020de,'uniqueid');for(var _0xd1a949 in _0x1020de){if(_0x1020de[_0x2c88('0x23')](_0xd1a949)){var _0x59fcdb={};for(var _0x483bd4=0x0;_0x483bd4<_0x1020de[_0xd1a949][_0x2c88('0x43')];_0x483bd4+=0x1){var _0x569c46=_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x56')];if(_0x3aa5e2[_0x2c88('0x15')][_0x569c46]){if(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x57')]){_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x58')]+=0x1;}if(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x59')]){_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x32')]+=0x1;}_0x3aa5e2['voiceQueues'][_0x569c46]['sumHoldTime']+=moment(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5a')])[_0x2c88('0x5b')](moment(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5c')]),_0x2c88('0x5d'))||0x0;if(_0x483bd4===_0x1020de[_0xd1a949][_0x2c88('0x43')]-0x1){_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x2b')]+=moment(_0x1020de[_0xd1a949][_0x483bd4]['queuecallercompleteAt']||_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5e')]||_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5f')])['diff'](moment(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5c')]),_0x2c88('0x5d'))||0x0;_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x30')]+=0x1;if(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x60')]){_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x31')]+=0x1;_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x2c')]+=moment(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x61')])[_0x2c88('0x5b')](moment(_0x1020de[_0xd1a949][_0x483bd4][_0x2c88('0x5a')]),_0x2c88('0x5d'))||0x0;}}else{_0x3aa5e2[_0x2c88('0x15')][_0x569c46]['sumDuration']+=_0x3aa5e2[_0x2c88('0x15')][_0x569c46][_0x2c88('0x2a')]||0x0;}}}}}}return _0x3aa5e2[_0x2c88('0x15')];};};Realtime[_0x2c88('0x3e')]['initVoiceCallReports']=function(){var _0x31b1fd=this;return function(_0x37d9ca){clearVoiceCallReports(_0x31b1fd['outbound']);if(_0x37d9ca){for(var _0x1250a7=0x0;_0x1250a7<_0x37d9ca[_0x2c88('0x43')];_0x1250a7+=0x1){_0x31b1fd[_0x2c88('0x62')]['total']+=0x1;_0x31b1fd[_0x2c88('0x62')][_0x2c88('0x2b')]+=_0x37d9ca[_0x1250a7][_0x2c88('0x63')];if(_0x37d9ca[_0x1250a7][_0x2c88('0x64')]===_0x2c88('0x65')){_0x31b1fd['outbound']['answered']+=0x1;_0x31b1fd[_0x2c88('0x62')]['sumHoldTime']+=_0x37d9ca[_0x1250a7][_0x2c88('0x63')]-_0x37d9ca[_0x1250a7][_0x2c88('0x66')]||0x0;_0x31b1fd['outbound'][_0x2c88('0x2c')]+=_0x37d9ca[_0x1250a7][_0x2c88('0x66')];}}}return _0x31b1fd[_0x2c88('0x62')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x67')]=function(){var _0x415de5=this;return function(_0x2a6125){if(_0x2a6125){freeIsNotKey(_0x2a6125,_0x415de5[_0x2c88('0x16')],'name');for(var _0x2c7600=0x0,_0x5b0dbe={};_0x2c7600<_0x2a6125[_0x2c88('0x43')];_0x2c7600+=0x1){_0x5b0dbe=_0x2a6125[_0x2c7600];if(_[_0x2c88('0x44')](_0x415de5['campaigns'][_0x5b0dbe[_0x2c88('0x29')]])){_0x415de5[_0x2c88('0x16')][_0x5b0dbe[_0x2c88('0x29')]]=new Campaign(_0x5b0dbe);}else{_0x415de5[_0x2c88('0x41')](_0x415de5[_0x2c88('0x16')][_0x5b0dbe['name']],_0x5b0dbe);_0x415de5[_0x2c88('0x16')][_0x5b0dbe[_0x2c88('0x29')]][_0x2c88('0x68')]=_0x5b0dbe['SquareProject']?_0x5b0dbe[_0x2c88('0x69')][_0x2c88('0x29')]:undefined;}}}return _0x415de5['campaigns'];};};Realtime[_0x2c88('0x3e')]['initVoiceExtensions']=function(){var _0x4eb04e=this;return function(_0x1d31aa){if(_0x1d31aa){freeIsNotKey(_0x1d31aa,_0x4eb04e['voiceExtensions'],'id');for(var _0xe8eb7c=0x0,_0x47b7ac={};_0xe8eb7c<_0x1d31aa[_0x2c88('0x43')];_0xe8eb7c+=0x1){_0x47b7ac=_0x1d31aa[_0xe8eb7c];if(_[_0x2c88('0x44')](_0x4eb04e[_0x2c88('0x18')][_0x47b7ac['id']])){_0x4eb04e['voiceExtensions'][_0x47b7ac['id']]=new VoiceExtension(_0x47b7ac);}else{_0x4eb04e[_0x2c88('0x41')](_0x4eb04e[_0x2c88('0x18')][_0x47b7ac['id']],_0x47b7ac);}}}return _0x4eb04e['voiceExtensions'];};};Realtime['prototype'][_0x2c88('0x6a')]=function(){var _0x36751=this;return function(_0x320109){clearCampaigns(_0x36751[_0x2c88('0x16')]);for(var _0x3642a8=0x0;_0x3642a8<_0x320109[_0x2c88('0x43')];_0x3642a8+=0x1){_['merge'](_0x36751[_0x2c88('0x16')][_0x320109[_0x3642a8][_0x2c88('0x29')]],_0x320109[_0x3642a8]);}return _0x36751[_0x2c88('0x16')];};};Realtime[_0x2c88('0x3e')][_0x2c88('0x6b')]=function(){var _0x35b531=this;return function(_0x33293a){if(_0x33293a){freeIsNotKey(_0x33293a,_0x35b531[_0x2c88('0x22')],'id');for(var _0x57c4a3=0x0,_0x1689c2={},_0x34cc2e={};_0x57c4a3<_0x33293a[_0x2c88('0x43')];_0x57c4a3+=0x1){_0x1689c2=_0x33293a[_0x57c4a3];if(_[_0x2c88('0x44')](_0x35b531[_0x2c88('0x22')][_0x1689c2['id']])){_0x35b531['faxAccounts'][_0x1689c2['id']]=new FaxAccount(_0x1689c2);}else{_0x35b531['mergeFromDatabase'](_0x35b531[_0x2c88('0x22')][_0x1689c2['id']],_0x1689c2);}}}return _0x35b531[_0x2c88('0x22')];};};module[_0x2c88('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1fcd3f3..9604842 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 _0xb307=['createdAt','xcally-motion-preview','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','substring','blindTransfer','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','voiceQueueReport','voiceCallReport','bind','voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','findAgent','accountcode','name','isNil','find','interface','format','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','\x22%s\x22\x20<%s>','length','monitorFilename','monitors'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0xb307,0x10c));var _0x7b30=function(_0x1d75c9,_0x358245){_0x1d75c9=_0x1d75c9-0x0;var _0x253547=_0xb307[_0x1d75c9];return _0x253547;};'use strict';var BPromise=require('bluebird');var _=require(_0x7b30('0x0'));var moment=require(_0x7b30('0x1'));var util=require(_0x7b30('0x2'));var config=require(_0x7b30('0x3'));var logger=require(_0x7b30('0x4'))(_0x7b30('0x5'));var ami=require(_0x7b30('0x6'));var RpcVoiceAgentReport=require(_0x7b30('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x7b30('0x8'));var RpcMemberReport=require(_0x7b30('0x9'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x7b30('0xa'));var RpcVoiceTransferReport=require(_0x7b30('0xb'));var VoiceQueueReport=require(_0x7b30('0xc'));var VoiceCallReport=require(_0x7b30('0xd'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x7b30('0xe'));var UserReport=require(_0x7b30('0xf'));function Report(_0x5c5f21){this['realtime']=_0x5c5f21;this[_0x7b30('0x10')]=_0x5c5f21[_0x7b30('0x10')];this[_0x7b30('0x11')]=_0x5c5f21['telephones'];}Report[_0x7b30('0x12')][_0x7b30('0x13')]=function(_0x1a2b98){var _0x547623=new VoiceQueueReport(this['realtime']);var _0x5c8102=new VoiceAgentReport(this[_0x7b30('0x14')]);var _0x174b1c=new VoiceDialReport(this[_0x7b30('0x14')]);var _0x640362=new VoiceCallReport(this['realtime']);var _0x1acd48=new UserReport(this[_0x7b30('0x14')]);if(config[_0x7b30('0x15')]&&config[_0x7b30('0x15')][_0x7b30('0x16')]){ami['on']('custom:voiceQueueReport',this[_0x7b30('0x17')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x7b30('0x18')][_0x7b30('0x19')](this));ami['on']('custom:voiceAgentReport',this[_0x7b30('0x1a')][_0x7b30('0x19')](this));ami['on']('custom:voiceDialReport',this[_0x7b30('0x1b')]['bind'](this));ami['on'](_0x7b30('0x1c'),this['blindTransfer']['bind'](this));ami['on'](_0x7b30('0x1d'),this['attendedTransfer']['bind'](this));}};Report[_0x7b30('0x12')][_0x7b30('0x1e')]=function(_0xc0c94c){var _0x347a05=undefined;_0x347a05=_['find'](this[_0x7b30('0x10')],function(_0x39e369){return _0x39e369[_0x7b30('0x1f')]==_0xc0c94c||_0x39e369[_0x7b30('0x20')]==_0xc0c94c;});if(_[_0x7b30('0x21')](_0x347a05)){var _0x34bdc3=_['find'](this[_0x7b30('0x11')],function(_0x4fc494){return _0x4fc494[_0x7b30('0x1f')]==_0xc0c94c||_0x4fc494[_0x7b30('0x20')]==_0xc0c94c;});if(_0x34bdc3){_0x347a05=_[_0x7b30('0x22')](this['agents'],function(_0x4e8ad1){return _0x4e8ad1[_0x7b30('0x23')]==util[_0x7b30('0x24')]('SIP/%s',_0x34bdc3[_0x7b30('0x20')]);});}}return _0x347a05;};Report[_0x7b30('0x12')][_0x7b30('0x17')]=function(_0x34e5af){for(var _0x5ef57f=0x0;_0x5ef57f<_0x34e5af['length'];_0x5ef57f+=0x1){var _0x4bbdb6=this[_0x7b30('0x1e')](_0x34e5af[_0x5ef57f][_0x7b30('0x25')]);if(_0x4bbdb6){_0x34e5af[_0x5ef57f][_0x7b30('0x1f')]=_0x4bbdb6[_0x7b30('0x1f')];_0x34e5af[_0x5ef57f][_0x7b30('0x26')]=!![];_0x34e5af[_0x5ef57f][_0x7b30('0x27')]=_0x4bbdb6[_0x7b30('0x20')];_0x34e5af[_0x5ef57f][_0x7b30('0x23')]=_[_0x7b30('0x21')](_0x4bbdb6[_0x7b30('0x23')])?util['format'](_0x7b30('0x28'),_0x4bbdb6[_0x7b30('0x20')]):_0x4bbdb6['interface'];if(_0x34e5af[_0x5ef57f][_0x7b30('0x29')]){_0x34e5af[_0x5ef57f][_0x7b30('0x2a')]=moment()[_0x7b30('0x24')](_0x7b30('0x2b'));}if(_0x34e5af[_0x5ef57f]['queuecallerexit']){_0x34e5af[_0x5ef57f][_0x7b30('0x2c')]=moment()[_0x7b30('0x24')](_0x7b30('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x34e5af[_0x5ef57f]);}RpcVoiceQueueReport[_0x7b30('0x2d')](_0x34e5af[_0x5ef57f]);}};function extractCalleridNumber(_0x11caf2){var _0x251284=_0x11caf2[_0x7b30('0x2e')](/<(.*?)>/);return _0x251284?_0x251284[0x1]:_0x11caf2;}Report[_0x7b30('0x12')][_0x7b30('0x18')]=function(_0x28fe4f){_0x28fe4f[_0x7b30('0x2f')]=_0x28fe4f[_0x7b30('0x2f')]||_0x28fe4f[_0x7b30('0x30')];if(_0x28fe4f[_0x7b30('0x31')]==_0x7b30('0x32')){_0x28fe4f[_0x7b30('0x33')]=_0x7b30('0x34');_0x28fe4f[_0x7b30('0x35')]=_0x28fe4f[_0x7b30('0x34')];if(_0x28fe4f[_0x7b30('0x36')]==_0x7b30('0x37')){_0x28fe4f[_0x7b30('0x1f')]='';_0x28fe4f[_0x7b30('0x2f')]=extractCalleridNumber(_0x28fe4f[_0x7b30('0x38')]);}else if(_0x28fe4f['context']==_0x7b30('0x39')){if(_0x28fe4f['destination']=='xcally-motion-preview'){_0x28fe4f[_0x7b30('0x2f')]=extractCalleridNumber(_0x28fe4f[_0x7b30('0x3a')]);_0x28fe4f[_0x7b30('0x3b')]=_0x28fe4f[_0x7b30('0x3c')];_0x28fe4f[_0x7b30('0x3d')]=[_0x28fe4f['channel'],_0x28fe4f[_0x7b30('0x3e')]=_0x28fe4f[_0x7b30('0x3d')]][0x0];_0x28fe4f[_0x7b30('0x38')]=_0x28fe4f['calleridpreview'];}else{_0x28fe4f['destination']=_0x28fe4f[_0x7b30('0x3b')];_0x28fe4f[_0x7b30('0x3b')]=_0x28fe4f[_0x7b30('0x3c')];if(_0x28fe4f[_0x7b30('0x3f')]=='ANSWERED'){_0x28fe4f['accountcode']=_0x28fe4f['connectedlinenum'];}else{_0x28fe4f[_0x7b30('0x1f')]='';}}}}else{_0x28fe4f[_0x7b30('0x38')]=util[_0x7b30('0x24')](_0x7b30('0x40'),_0x28fe4f['calleridname'],_0x28fe4f[_0x7b30('0x3b')]);}RpcVoiceCallReport[_0x7b30('0x2d')](_0x28fe4f);if(_0x28fe4f['monitor']){for(var _0x23c677=0x0;_0x23c677<_0x28fe4f['monitors'][_0x7b30('0x41')];_0x23c677+=0x1){_0x28fe4f[_0x7b30('0x42')]=_0x28fe4f[_0x7b30('0x43')][_0x23c677]['filename'];_0x28fe4f['createdAt']=_0x28fe4f[_0x7b30('0x43')][_0x23c677][_0x7b30('0x44')];if(_0x28fe4f['exten']==_0x7b30('0x45')){_0x28fe4f[_0x7b30('0x3b')]=_0x28fe4f[_0x7b30('0x25')];_0x28fe4f[_0x7b30('0x46')]=_0x28fe4f[_0x7b30('0x47')];_0x28fe4f[_0x7b30('0x25')]=_0x28fe4f[_0x7b30('0x1f')];_0x28fe4f['connectedlinename']=_0x28fe4f[_0x7b30('0x48')];_0x28fe4f[_0x7b30('0x30')]=_0x28fe4f[_0x7b30('0x3c')];}else if(_0x28fe4f[_0x7b30('0x30')]==_0x7b30('0x49')){_0x28fe4f[_0x7b30('0x3b')]=_0x28fe4f['destination'];_0x28fe4f['exten']=_0x28fe4f[_0x7b30('0x3c')];}RpcVoiceRecording[_0x7b30('0x2d')](_0x28fe4f);}}};Report[_0x7b30('0x12')]['voiceAgentReport']=function(_0x207a6a){if(_[_0x7b30('0x4a')](_0x207a6a)){_0x207a6a[_0x7b30('0x4b')](function(_0x53e515){RpcVoiceAgentReport['create'](_0x53e515);});}else{RpcVoiceAgentReport[_0x7b30('0x2d')](_0x207a6a);}};Report['prototype'][_0x7b30('0x1b')]=function(_0x56ef53){RpcVoiceDialReport[_0x7b30('0x2d')](_0x56ef53);var _0x30e0d9=undefined;var _0x46c257=_0x56ef53[_0x7b30('0x3e')];if(_[_0x7b30('0x4c')](_0x46c257,_0x7b30('0x4d'))){var _0x41b0b5=_0x46c257['substring'](_0x46c257[_0x7b30('0x4e')]('/')+0x1,_0x46c257[_0x7b30('0x4e')]('@'));_0x30e0d9=_[_0x7b30('0x22')](this[_0x7b30('0x10')],function(_0x4f2765){return _0x4f2765[_0x7b30('0x4f')]==_0x41b0b5||_0x4f2765['phone']==_0x41b0b5||_0x4f2765[_0x7b30('0x1f')]==_0x41b0b5;});}else{var _0x41b0b5=_0x46c257[_0x7b30('0x50')](_0x46c257[_0x7b30('0x4e')]('/')+0x1,_0x46c257['lastIndexOf']('-'));_0x30e0d9=this[_0x7b30('0x1e')](_0x41b0b5);}if(_0x30e0d9){_0x56ef53[_0x7b30('0x23')]=_['isNil'](_0x30e0d9[_0x7b30('0x23')])?util[_0x7b30('0x24')](_0x7b30('0x28'),_0x30e0d9[_0x7b30('0x20')]):_0x30e0d9[_0x7b30('0x23')];_0x56ef53[_0x7b30('0x48')]=_0x30e0d9[_0x7b30('0x20')];_0x56ef53['accountcode']=_0x30e0d9[_0x7b30('0x1f')];RpcMemberReport[_0x7b30('0x1b')](_0x56ef53);}};Report[_0x7b30('0x12')][_0x7b30('0x51')]=function(_0x3b1735){RpcVoiceTransferReport[_0x7b30('0x51')](_0x3b1735);};Report['prototype'][_0x7b30('0x52')]=function(_0x2f7c07){RpcVoiceTransferReport[_0x7b30('0x52')](_0x2f7c07);};module[_0x7b30('0x53')]=Report; \ No newline at end of file +var _0xc901=['dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitors','length','monitorFilename','filename','createdAt','exten','connectedlinenum','calleridname','connectedlinename','membername','create','voiceAgentReport','isArray','startsWith','Local','substring','indexOf','interface','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedTransfer','prototype','findAgent','find','isNil','name','format','SIP/%s','accountcode','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc901,0x129));var _0x1c90=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc901[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require(_0x1c90('0x0'));var _=require(_0x1c90('0x1'));var moment=require(_0x1c90('0x2'));var util=require(_0x1c90('0x3'));var config=require(_0x1c90('0x4'));var logger=require(_0x1c90('0x5'))(_0x1c90('0x6'));var ami=require(_0x1c90('0x7'));var RpcVoiceAgentReport=require(_0x1c90('0x8'));var RpcVoiceCallReport=require(_0x1c90('0x9'));var RpcVoiceDialReport=require(_0x1c90('0xa'));var RpcMemberReport=require(_0x1c90('0xb'));var RpcVoiceQueueReport=require(_0x1c90('0xc'));var RpcVoiceRecording=require(_0x1c90('0xd'));var RpcVoiceTransferReport=require(_0x1c90('0xe'));var VoiceQueueReport=require(_0x1c90('0xf'));var VoiceCallReport=require(_0x1c90('0x10'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x1c90('0x11'));var UserReport=require(_0x1c90('0x12'));function Report(_0x1ce379){this[_0x1c90('0x13')]=_0x1ce379;this[_0x1c90('0x14')]=_0x1ce379['agents'];this[_0x1c90('0x15')]=_0x1ce379[_0x1c90('0x15')];}Report['prototype'][_0x1c90('0x16')]=function(_0x45e96a){var _0x261665=new VoiceQueueReport(this[_0x1c90('0x13')]);var _0x548f14=new VoiceAgentReport(this['realtime']);var _0x2ed9f7=new VoiceDialReport(this[_0x1c90('0x13')]);var _0x57a9a6=new VoiceCallReport(this[_0x1c90('0x13')]);var _0x514cb3=new UserReport(this[_0x1c90('0x13')]);if(config[_0x1c90('0x17')]&&config[_0x1c90('0x17')][_0x1c90('0x18')]){ami['on'](_0x1c90('0x19'),this[_0x1c90('0x1a')][_0x1c90('0x1b')](this));ami['on'](_0x1c90('0x1c'),this[_0x1c90('0x1d')]['bind'](this));ami['on'](_0x1c90('0x1e'),this['voiceAgentReport'][_0x1c90('0x1b')](this));ami['on'](_0x1c90('0x1f'),this[_0x1c90('0x20')]['bind'](this));ami['on']('blindtransfer',this[_0x1c90('0x21')][_0x1c90('0x1b')](this));ami['on']('attendedtransfer',this[_0x1c90('0x22')]['bind'](this));}};Report[_0x1c90('0x23')][_0x1c90('0x24')]=function(_0x5095d2){var _0x2c6ad2=undefined;_0x2c6ad2=_[_0x1c90('0x25')](this[_0x1c90('0x14')],function(_0x55b89f){return _0x55b89f['accountcode']==_0x5095d2||_0x55b89f['name']==_0x5095d2;});if(_[_0x1c90('0x26')](_0x2c6ad2)){var _0x2c1e8e=_[_0x1c90('0x25')](this[_0x1c90('0x15')],function(_0x10ac07){return _0x10ac07['accountcode']==_0x5095d2||_0x10ac07[_0x1c90('0x27')]==_0x5095d2;});if(_0x2c1e8e){_0x2c6ad2=_['find'](this[_0x1c90('0x14')],function(_0x2e84eb){return _0x2e84eb['interface']==util[_0x1c90('0x28')](_0x1c90('0x29'),_0x2c1e8e[_0x1c90('0x27')]);});}}return _0x2c6ad2;};Report[_0x1c90('0x23')][_0x1c90('0x1a')]=function(_0x363b7b){for(var _0x4a19a9=0x0;_0x4a19a9<_0x363b7b['length'];_0x4a19a9+=0x1){var _0x1e274f=this['findAgent'](_0x363b7b[_0x4a19a9]['connectedlinenum']);if(_0x1e274f){_0x363b7b[_0x4a19a9][_0x1c90('0x2a')]=_0x1e274f[_0x1c90('0x2a')];_0x363b7b[_0x4a19a9][_0x1c90('0x2b')]=!![];_0x363b7b[_0x4a19a9][_0x1c90('0x2c')]=_0x1e274f['name'];_0x363b7b[_0x4a19a9]['interface']=_['isNil'](_0x1e274f['interface'])?util[_0x1c90('0x28')]('SIP/%s',_0x1e274f[_0x1c90('0x27')]):_0x1e274f['interface'];if(_0x363b7b[_0x4a19a9][_0x1c90('0x2d')]){_0x363b7b[_0x4a19a9]['queuecallercompleteAt']=moment()[_0x1c90('0x28')](_0x1c90('0x2e'));}if(_0x363b7b[_0x4a19a9][_0x1c90('0x2f')]){_0x363b7b[_0x4a19a9][_0x1c90('0x30')]=moment()['format'](_0x1c90('0x2e'));}RpcMemberReport[_0x1c90('0x1a')](_0x363b7b[_0x4a19a9]);}RpcVoiceQueueReport['create'](_0x363b7b[_0x4a19a9]);}};function extractCalleridNumber(_0x1eab93){var _0x451b82=_0x1eab93[_0x1c90('0x31')](/<(.*?)>/);return _0x451b82?_0x451b82[0x1]:_0x1eab93;}Report[_0x1c90('0x23')][_0x1c90('0x1d')]=function(_0x321848){_0x321848[_0x1c90('0x32')]=_0x321848[_0x1c90('0x32')]||_0x321848['exten'];if(_0x321848['type']==_0x1c90('0x33')){_0x321848[_0x1c90('0x34')]='queue';_0x321848[_0x1c90('0x35')]=_0x321848[_0x1c90('0x36')];if(_0x321848[_0x1c90('0x37')]==_0x1c90('0x38')){_0x321848[_0x1c90('0x2a')]='';_0x321848[_0x1c90('0x32')]=extractCalleridNumber(_0x321848[_0x1c90('0x39')]);}else if(_0x321848[_0x1c90('0x37')]==_0x1c90('0x3a')){if(_0x321848[_0x1c90('0x32')]==_0x1c90('0x3b')){_0x321848[_0x1c90('0x32')]=extractCalleridNumber(_0x321848[_0x1c90('0x3c')]);_0x321848[_0x1c90('0x3d')]=_0x321848[_0x1c90('0x3e')];_0x321848[_0x1c90('0x3f')]=[_0x321848[_0x1c90('0x40')],_0x321848['channel']=_0x321848['destinationchannel']][0x0];_0x321848['callerid']=_0x321848['calleridpreview'];}else{_0x321848[_0x1c90('0x32')]=_0x321848[_0x1c90('0x3d')];_0x321848[_0x1c90('0x3d')]=_0x321848[_0x1c90('0x3e')];if(_0x321848['disposition']==_0x1c90('0x41')){_0x321848[_0x1c90('0x2a')]=_0x321848['connectedlinenum'];}else{_0x321848[_0x1c90('0x2a')]='';}}}}else{_0x321848[_0x1c90('0x39')]=util[_0x1c90('0x28')](_0x1c90('0x42'),_0x321848['calleridname'],_0x321848[_0x1c90('0x3d')]);}RpcVoiceCallReport['create'](_0x321848);if(_0x321848[_0x1c90('0x43')]){for(var _0x3af777=0x0;_0x3af777<_0x321848[_0x1c90('0x44')][_0x1c90('0x45')];_0x3af777+=0x1){_0x321848[_0x1c90('0x46')]=_0x321848[_0x1c90('0x44')][_0x3af777][_0x1c90('0x47')];_0x321848['createdAt']=_0x321848[_0x1c90('0x44')][_0x3af777][_0x1c90('0x48')];if(_0x321848[_0x1c90('0x49')]==_0x1c90('0x3b')){_0x321848[_0x1c90('0x3d')]=_0x321848[_0x1c90('0x4a')];_0x321848[_0x1c90('0x4b')]=_0x321848[_0x1c90('0x4c')];_0x321848[_0x1c90('0x4a')]=_0x321848[_0x1c90('0x2a')];_0x321848[_0x1c90('0x4c')]=_0x321848[_0x1c90('0x4d')];_0x321848[_0x1c90('0x49')]=_0x321848[_0x1c90('0x3e')];}else if(_0x321848[_0x1c90('0x49')]=='xcally-motion-dialer'){_0x321848['calleridnum']=_0x321848[_0x1c90('0x32')];_0x321848[_0x1c90('0x49')]=_0x321848[_0x1c90('0x3e')];}RpcVoiceRecording[_0x1c90('0x4e')](_0x321848);}}};Report['prototype'][_0x1c90('0x4f')]=function(_0xcc0377){if(_[_0x1c90('0x50')](_0xcc0377)){_0xcc0377['forEach'](function(_0x32a16d){RpcVoiceAgentReport['create'](_0x32a16d);});}else{RpcVoiceAgentReport[_0x1c90('0x4e')](_0xcc0377);}};Report[_0x1c90('0x23')][_0x1c90('0x20')]=function(_0x45a1d5){RpcVoiceDialReport[_0x1c90('0x4e')](_0x45a1d5);var _0x3c913e=undefined;var _0x2b31de=_0x45a1d5['channel'];if(_[_0x1c90('0x51')](_0x2b31de,_0x1c90('0x52'))){var _0x354d80=_0x2b31de[_0x1c90('0x53')](_0x2b31de[_0x1c90('0x54')]('/')+0x1,_0x2b31de[_0x1c90('0x54')]('@'));_0x3c913e=_[_0x1c90('0x25')](this[_0x1c90('0x14')],function(_0x2dd7be){return _0x2dd7be['mobile']==_0x354d80||_0x2dd7be['phone']==_0x354d80||_0x2dd7be[_0x1c90('0x2a')]==_0x354d80;});}else{var _0x354d80=_0x2b31de['substring'](_0x2b31de['indexOf']('/')+0x1,_0x2b31de['lastIndexOf']('-'));_0x3c913e=this[_0x1c90('0x24')](_0x354d80);}if(_0x3c913e){_0x45a1d5['interface']=_[_0x1c90('0x26')](_0x3c913e[_0x1c90('0x55')])?util['format'](_0x1c90('0x29'),_0x3c913e['name']):_0x3c913e['interface'];_0x45a1d5[_0x1c90('0x4d')]=_0x3c913e['name'];_0x45a1d5[_0x1c90('0x2a')]=_0x3c913e[_0x1c90('0x2a')];RpcMemberReport[_0x1c90('0x20')](_0x45a1d5);}};Report[_0x1c90('0x23')][_0x1c90('0x21')]=function(_0x521845){RpcVoiceTransferReport['blindTransfer'](_0x521845);};Report[_0x1c90('0x23')][_0x1c90('0x22')]=function(_0x14b770){RpcVoiceTransferReport['attendedTransfer'](_0x14b770);};module[_0x1c90('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 8e70339..733f62a 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 _0x756a=['toNumber','startsWith','Queue','Local','indexOf','mobile','phone','accountcode','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','stateRegistry','merge','omit','state','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x756a,0x14e));var _0xa756=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x756a[_0x541ea6];return _0x3c3e84;};'use strict';var _=require(_0xa756('0x0'));var moment=require(_0xa756('0x1'));var BPromise=require(_0xa756('0x2'));var util=require('util');var Redis=require(_0xa756('0x3'));var config=require(_0xa756('0x4'));var logger=require(_0xa756('0x5'))('ami');var ami=require('../ami');config['redis']=_[_0xa756('0x6')](config[_0xa756('0x7')],{'host':_0xa756('0x8'),'port':0x18eb});var io=require(_0xa756('0x9'))(new Redis(config[_0xa756('0x7')]));function UserReport(_0x4cfa87){this[_0xa756('0xa')]=_0x4cfa87['trunks'];this[_0xa756('0xb')]=_0x4cfa87['agents'];this[_0xa756('0xc')]=_0x4cfa87[_0xa756('0xc')];ami['on']('registryentry',this[_0xa756('0xd')][_0xa756('0xe')](this));ami['on'](_0xa756('0xf'),this[_0xa756('0xd')]['bind'](this));ami['on'](_0xa756('0x10'),this[_0xa756('0x11')][_0xa756('0xe')](this));ami['on'](_0xa756('0x12'),this[_0xa756('0x13')][_0xa756('0xe')](this));this[_0xa756('0x14')]();return BPromise[_0xa756('0x15')]()[_0xa756('0x16')](ami[_0xa756('0x17')]())[_0xa756('0x16')](ami[_0xa756('0x18')]())[_0xa756('0x16')](ami[_0xa756('0x19')]())[_0xa756('0x1a')](loggerCatch(_0xa756('0x1b')));}function loggerCatch(_0x36d668){return function(_0x30587e){logger[_0xa756('0x1c')](_0x36d668,util[_0xa756('0x1d')](_0x30587e,{'showHidden':![],'depth':null}));};}UserReport[_0xa756('0x1e')][_0xa756('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0xa756('0x16')](ami[_0xa756('0x17')]())[_0xa756('0x16')](ami[_0xa756('0x18')]())['then'](ami[_0xa756('0x19')]())['catch'](loggerCatch(_0xa756('0x1b')));},0x32c8);};UserReport[_0xa756('0x1e')][_0xa756('0x1f')]=function(_0xc3d924){return _0xc3d924!==null&&!_[_0xa756('0x20')](_0xc3d924);};UserReport[_0xa756('0x1e')][_0xa756('0x21')]=function(_0x3af063,_0xab9825,_0x555fa2){io['to'](_0x3af063)[_0xa756('0x21')](_0xab9825,_0x555fa2);};UserReport['prototype'][_0xa756('0xd')]=function(_0x18295c){try{if(this[_0xa756('0x1f')](_0x18295c)){var _0x3f9d5a=_[_0xa756('0x22')](this[_0xa756('0xa')],{'registry':_0x18295c['username']});if(_0x3f9d5a){_0x18295c[_0xa756('0x23')]=_0x18295c['state'];_[_0xa756('0x24')](_0x3f9d5a,_[_0xa756('0x25')](_0x18295c,['event','actionid','username',_0xa756('0x26')]));this[_0xa756('0x21')](util[_0xa756('0x27')](_0xa756('0x28'),_0x3f9d5a[_0xa756('0x29')]),_0xa756('0x2a'),_0x3f9d5a);}}}catch(_0x759dd4){logger[_0xa756('0x1c')](_0xa756('0x2b'),util['inspect'](_0x759dd4,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa756('0x11')]=function(_0x4153c8){try{if(this[_0xa756('0x1f')](_0x4153c8)){if(this['agents'][_0x4153c8[_0xa756('0x2c')]]){if(!this['agents'][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x2d')]||_0x4153c8['state'][_0xa756('0x2e')]()==_0xa756('0x2f')){this['agents'][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x2d')]=![];if(this[_0xa756('0xb')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]!==_0x4153c8[_0xa756('0x26')][_0xa756('0x2e')]()){this[_0xa756('0xb')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x30')]=_['toNumber'](moment()[_0xa756('0x27')]('x'));}this['agents'][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]=_0x4153c8['state'][_0xa756('0x2e')]();this[_0xa756('0xb')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x31')](_0x4153c8);}}else if(this['telephones'][_0x4153c8[_0xa756('0x2c')]]){if(this[_0xa756('0xc')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]!==_0x4153c8[_0xa756('0x26')][_0xa756('0x2e')]()){this[_0xa756('0xc')][_0x4153c8['device']]['stateTime']=_['toNumber'](moment()[_0xa756('0x27')]('x'));}this[_0xa756('0xc')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]=_0x4153c8[_0xa756('0x26')]['toLowerCase']();this[_0xa756('0x21')](util[_0xa756('0x27')]('telephone:%s',this[_0xa756('0xc')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x29')]),'telephone:save',this['telephones'][_0x4153c8['device']]);}else if(this[_0xa756('0xa')][_0x4153c8[_0xa756('0x2c')]]){if(this[_0xa756('0xa')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]!==_0x4153c8[_0xa756('0x26')]['toLowerCase']()){this[_0xa756('0xa')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x30')]=_[_0xa756('0x32')](moment()[_0xa756('0x27')]('x'));}this[_0xa756('0xa')][_0x4153c8[_0xa756('0x2c')]][_0xa756('0x26')]=_0x4153c8[_0xa756('0x26')]['toLowerCase']();this[_0xa756('0x21')](util[_0xa756('0x27')](_0xa756('0x28'),this[_0xa756('0xa')][_0x4153c8[_0xa756('0x2c')]]['name']),_0xa756('0x2a'),this['trunks'][_0x4153c8[_0xa756('0x2c')]]);}else if(_[_0xa756('0x33')](_0x4153c8['device'],_0xa756('0x34'))){}else if(_[_0xa756('0x33')](_0x4153c8['device'],_0xa756('0x35'))){var _0x2d6861=_0x4153c8[_0xa756('0x2c')];var _0x3e2019=_0x2d6861['substring'](_0x2d6861['indexOf']('/')+0x1,_0x2d6861[_0xa756('0x36')]('@'));var _0x2190b2=_[_0xa756('0x22')](this[_0xa756('0xb')],function(_0x2f1d0c){return _0x2f1d0c[_0xa756('0x37')]==_0x3e2019||_0x2f1d0c[_0xa756('0x38')]==_0x3e2019||_0x2f1d0c[_0xa756('0x39')]==_0x3e2019;});if(_0x2190b2){if(_0x2190b2['state']!==_0x4153c8[_0xa756('0x26')]['toLowerCase']()){_0x2190b2[_0xa756('0x30')]=_[_0xa756('0x32')](moment()[_0xa756('0x27')]('x'));}_0x2190b2[_0xa756('0x26')]=_0x4153c8[_0xa756('0x26')][_0xa756('0x2e')]();_0x2190b2[_0xa756('0x2d')]=!![];_0x2190b2['updateStatusRealtime'](_0x4153c8);}}else{}}}catch(_0x4309cb){logger[_0xa756('0x1c')]('[syncDeviceState][UserReport]',util[_0xa756('0x1d')](_0x4309cb,{'showHidden':![],'depth':null}));}};UserReport[_0xa756('0x1e')][_0xa756('0x13')]=function(_0x7cf301){try{if(this['isNotNull'](_0x7cf301)&&this[_0xa756('0x1f')](_0x7cf301[_0xa756('0x12')])){if(this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]]){if(!this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x2d')]||_0x7cf301[_0xa756('0x12')][_0xa756('0x2e')]()==_0xa756('0x3b')){this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x2d')]=![];this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x3c')]=_0x7cf301[_0xa756('0x12')][_0xa756('0x2e')]();this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x3d')]=_0x7cf301[_0xa756('0x3d')];this[_0xa756('0xb')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x31')](_0x7cf301);}}else if(this[_0xa756('0xc')][_0x7cf301[_0xa756('0x3a')]]){this[_0xa756('0xc')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x3c')]=_0x7cf301[_0xa756('0x12')][_0xa756('0x2e')]();this['telephones'][_0x7cf301['peer']][_0xa756('0x3d')]=_0x7cf301['address'];this[_0xa756('0x21')](util['format']('telephone:%s',this['telephones'][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x29')]),_0xa756('0x3e'),this[_0xa756('0xc')][_0x7cf301['peer']]);}else if(this[_0xa756('0xa')][_0x7cf301['peer']]){this[_0xa756('0xa')][_0x7cf301[_0xa756('0x3a')]][_0xa756('0x3c')]=_0x7cf301[_0xa756('0x12')][_0xa756('0x2e')]();this[_0xa756('0xa')][_0x7cf301[_0xa756('0x3a')]]['address']=_0x7cf301['address'];this[_0xa756('0x21')](util['format']('trunk:%s',this[_0xa756('0xa')][_0x7cf301['peer']][_0xa756('0x29')]),'trunk:save',this[_0xa756('0xa')][_0x7cf301[_0xa756('0x3a')]]);}else{}}}catch(_0x4ddcbb){logger['error'](_0xa756('0x3f'),util[_0xa756('0x1d')](_0x4ddcbb,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xb271=['loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','error','inspect','catch','prototype','isNotNull','isUndefined','emit','find','stateRegistry','state','event','actionid','format','trunk:%s','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephones','name','telephone:save','trunk:save','startsWith','Local','mobile','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peerstatus','peer','registered','address','status','telephone:%s','[syncPeerStatus][UserReport]','exports','lodash','bluebird','util','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','registryentry','syncRegistry','registry','bind','devicestatechange'];(function(_0x1283d4,_0x36b6f1){var _0x433643=function(_0x4c9fbe){while(--_0x4c9fbe){_0x1283d4['push'](_0x1283d4['shift']());}};_0x433643(++_0x36b6f1);}(_0xb271,0x1b6));var _0x1b27=function(_0x7ab248,_0x46a6a0){_0x7ab248=_0x7ab248-0x0;var _0xc03622=_0xb271[_0x7ab248];return _0xc03622;};'use strict';var _=require(_0x1b27('0x0'));var moment=require('moment');var BPromise=require(_0x1b27('0x1'));var util=require(_0x1b27('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1b27('0x3'))(_0x1b27('0x4'));var ami=require(_0x1b27('0x5'));config[_0x1b27('0x6')]=_[_0x1b27('0x7')](config['redis'],{'host':_0x1b27('0x8'),'port':0x18eb});var io=require(_0x1b27('0x9'))(new Redis(config[_0x1b27('0x6')]));function UserReport(_0x2977f3){this[_0x1b27('0xa')]=_0x2977f3[_0x1b27('0xa')];this[_0x1b27('0xb')]=_0x2977f3[_0x1b27('0xb')];this['telephones']=_0x2977f3['telephones'];ami['on'](_0x1b27('0xc'),this[_0x1b27('0xd')]['bind'](this));ami['on'](_0x1b27('0xe'),this[_0x1b27('0xd')][_0x1b27('0xf')](this));ami['on'](_0x1b27('0x10'),this['syncDeviceState'][_0x1b27('0xf')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x1b27('0xf')](this));this[_0x1b27('0x11')]();return BPromise[_0x1b27('0x12')]()[_0x1b27('0x13')](ami[_0x1b27('0x14')]())['then'](ami[_0x1b27('0x15')]())[_0x1b27('0x13')](ami[_0x1b27('0x16')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5d068a){return function(_0x14f8a1){logger[_0x1b27('0x17')](_0x5d068a,util[_0x1b27('0x18')](_0x14f8a1,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x1b27('0x11')]=function(){setInterval(function(){BPromise[_0x1b27('0x12')]()[_0x1b27('0x13')](ami[_0x1b27('0x14')]())[_0x1b27('0x13')](ami[_0x1b27('0x15')]())[_0x1b27('0x13')](ami['actionSipPeerStatus']())[_0x1b27('0x19')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x1b27('0x1a')][_0x1b27('0x1b')]=function(_0x3e3dde){return _0x3e3dde!==null&&!_[_0x1b27('0x1c')](_0x3e3dde);};UserReport[_0x1b27('0x1a')]['emit']=function(_0x21d21f,_0x5b7b5e,_0x35afb1){io['to'](_0x21d21f)[_0x1b27('0x1d')](_0x5b7b5e,_0x35afb1);};UserReport['prototype'][_0x1b27('0xd')]=function(_0x31a2e7){try{if(this[_0x1b27('0x1b')](_0x31a2e7)){var _0x15be04=_[_0x1b27('0x1e')](this[_0x1b27('0xa')],{'registry':_0x31a2e7['username']});if(_0x15be04){_0x31a2e7[_0x1b27('0x1f')]=_0x31a2e7[_0x1b27('0x20')];_['merge'](_0x15be04,_['omit'](_0x31a2e7,[_0x1b27('0x21'),_0x1b27('0x22'),'username',_0x1b27('0x20')]));this[_0x1b27('0x1d')](util[_0x1b27('0x23')](_0x1b27('0x24'),_0x15be04['name']),'trunk:save',_0x15be04);}}}catch(_0x4783c4){logger[_0x1b27('0x17')](_0x1b27('0x25'),util[_0x1b27('0x18')](_0x4783c4,{'showHidden':![],'depth':null}));}};UserReport[_0x1b27('0x1a')][_0x1b27('0x26')]=function(_0x36e122){try{if(this[_0x1b27('0x1b')](_0x36e122)){if(this['agents'][_0x36e122[_0x1b27('0x27')]]){if(!this['agents'][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x28')]||_0x36e122[_0x1b27('0x20')][_0x1b27('0x29')]()==_0x1b27('0x2a')){this[_0x1b27('0xb')][_0x36e122[_0x1b27('0x27')]]['local']=![];if(this[_0x1b27('0xb')][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x20')]!==_0x36e122[_0x1b27('0x20')][_0x1b27('0x29')]()){this[_0x1b27('0xb')][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x2b')]=_[_0x1b27('0x2c')](moment()['format']('x'));}this[_0x1b27('0xb')][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x20')]=_0x36e122['state'][_0x1b27('0x29')]();this[_0x1b27('0xb')][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x2d')](_0x36e122);}}else if(this[_0x1b27('0x2e')][_0x36e122[_0x1b27('0x27')]]){if(this[_0x1b27('0x2e')][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x20')]!==_0x36e122[_0x1b27('0x20')][_0x1b27('0x29')]()){this['telephones'][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x2b')]=_['toNumber'](moment()[_0x1b27('0x23')]('x'));}this['telephones'][_0x36e122[_0x1b27('0x27')]]['state']=_0x36e122[_0x1b27('0x20')]['toLowerCase']();this[_0x1b27('0x1d')](util[_0x1b27('0x23')]('telephone:%s',this[_0x1b27('0x2e')][_0x36e122['device']][_0x1b27('0x2f')]),_0x1b27('0x30'),this[_0x1b27('0x2e')][_0x36e122[_0x1b27('0x27')]]);}else if(this['trunks'][_0x36e122[_0x1b27('0x27')]]){if(this[_0x1b27('0xa')][_0x36e122[_0x1b27('0x27')]]['state']!==_0x36e122['state'][_0x1b27('0x29')]()){this['trunks'][_0x36e122['device']][_0x1b27('0x2b')]=_['toNumber'](moment()[_0x1b27('0x23')]('x'));}this['trunks'][_0x36e122[_0x1b27('0x27')]][_0x1b27('0x20')]=_0x36e122[_0x1b27('0x20')]['toLowerCase']();this[_0x1b27('0x1d')](util[_0x1b27('0x23')](_0x1b27('0x24'),this[_0x1b27('0xa')][_0x36e122[_0x1b27('0x27')]]['name']),_0x1b27('0x31'),this[_0x1b27('0xa')][_0x36e122['device']]);}else if(_[_0x1b27('0x32')](_0x36e122[_0x1b27('0x27')],'Queue')){}else if(_[_0x1b27('0x32')](_0x36e122[_0x1b27('0x27')],_0x1b27('0x33'))){var _0xcd17ae=_0x36e122[_0x1b27('0x27')];var _0x4c93a2=_0xcd17ae['substring'](_0xcd17ae['indexOf']('/')+0x1,_0xcd17ae['indexOf']('@'));var _0x36eaa0=_['find'](this['agents'],function(_0xb660f1){return _0xb660f1[_0x1b27('0x34')]==_0x4c93a2||_0xb660f1[_0x1b27('0x35')]==_0x4c93a2||_0xb660f1[_0x1b27('0x36')]==_0x4c93a2;});if(_0x36eaa0){if(_0x36eaa0[_0x1b27('0x20')]!==_0x36e122[_0x1b27('0x20')][_0x1b27('0x29')]()){_0x36eaa0[_0x1b27('0x2b')]=_[_0x1b27('0x2c')](moment()[_0x1b27('0x23')]('x'));}_0x36eaa0[_0x1b27('0x20')]=_0x36e122[_0x1b27('0x20')][_0x1b27('0x29')]();_0x36eaa0[_0x1b27('0x28')]=!![];_0x36eaa0[_0x1b27('0x2d')](_0x36e122);}}else{}}}catch(_0x59c8b6){logger[_0x1b27('0x17')](_0x1b27('0x37'),util[_0x1b27('0x18')](_0x59c8b6,{'showHidden':![],'depth':null}));}};UserReport[_0x1b27('0x1a')][_0x1b27('0x38')]=function(_0x17fb6b){try{if(this[_0x1b27('0x1b')](_0x17fb6b)&&this[_0x1b27('0x1b')](_0x17fb6b[_0x1b27('0x39')])){if(this[_0x1b27('0xb')][_0x17fb6b[_0x1b27('0x3a')]]){if(!this['agents'][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x28')]||_0x17fb6b[_0x1b27('0x39')][_0x1b27('0x29')]()==_0x1b27('0x3b')){this['agents'][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x28')]=![];this[_0x1b27('0xb')][_0x17fb6b[_0x1b27('0x3a')]]['status']=_0x17fb6b['peerstatus'][_0x1b27('0x29')]();this[_0x1b27('0xb')][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x3c')]=_0x17fb6b[_0x1b27('0x3c')];this[_0x1b27('0xb')][_0x17fb6b['peer']]['updateStatusRealtime'](_0x17fb6b);}}else if(this['telephones'][_0x17fb6b[_0x1b27('0x3a')]]){this[_0x1b27('0x2e')][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x3d')]=_0x17fb6b[_0x1b27('0x39')]['toLowerCase']();this['telephones'][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x3c')]=_0x17fb6b['address'];this['emit'](util[_0x1b27('0x23')](_0x1b27('0x3e'),this[_0x1b27('0x2e')][_0x17fb6b[_0x1b27('0x3a')]][_0x1b27('0x2f')]),'telephone:save',this[_0x1b27('0x2e')][_0x17fb6b[_0x1b27('0x3a')]]);}else if(this[_0x1b27('0xa')][_0x17fb6b[_0x1b27('0x3a')]]){this[_0x1b27('0xa')][_0x17fb6b[_0x1b27('0x3a')]]['status']=_0x17fb6b[_0x1b27('0x39')][_0x1b27('0x29')]();this['trunks'][_0x17fb6b[_0x1b27('0x3a')]]['address']=_0x17fb6b[_0x1b27('0x3c')];this[_0x1b27('0x1d')](util[_0x1b27('0x23')](_0x1b27('0x24'),this[_0x1b27('0xa')][_0x17fb6b[_0x1b27('0x3a')]]['name']),_0x1b27('0x31'),this[_0x1b27('0xa')][_0x17fb6b['peer']]);}else{}}}catch(_0x4ced70){logger[_0x1b27('0x17')](_0x1b27('0x3f'),util[_0x1b27('0x18')](_0x4ced70,{'showHidden':![],'depth':null}));}};module[_0x1b27('0x40')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 6c0e61e..2504889 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 _0xeb3b=['agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStop','blindtransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','privilege','custom:agentcalled','user:%s','membername','user:called','error','inspect','hasOwnProperty','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','reason','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','complete','talktime','transfer','agent','acw','acwTimeout','omit','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','values','syncAttendedTransfer','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','voiceQueues'];(function(_0x434007,_0x5356cd){var _0x17ab31=function(_0x280b5c){while(--_0x280b5c){_0x434007['push'](_0x434007['shift']());}};_0x17ab31(++_0x5356cd);}(_0xeb3b,0x15a));var _0xbeb3=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xeb3b[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xbeb3('0x0'));var moment=require(_0xbeb3('0x1'));var util=require(_0xbeb3('0x2'));var Redis=require('ioredis');var config=require(_0xbeb3('0x3'));var logger=require(_0xbeb3('0x4'))(_0xbeb3('0x5'));var ami=require(_0xbeb3('0x6'));config[_0xbeb3('0x7')]=_[_0xbeb3('0x8')](config[_0xbeb3('0x7')],{'host':_0xbeb3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbeb3('0x7')]));function VoiceAgentReport(_0x4cc117){this['channels']={};this[_0xbeb3('0xa')]=_0x4cc117[_0xbeb3('0xa')];this[_0xbeb3('0xb')]=_0x4cc117['agents'];this[_0xbeb3('0xc')]={};ami['on'](_0xbeb3('0xd'),this[_0xbeb3('0xe')][_0xbeb3('0xf')](this));ami['on']('agentconnect',this[_0xbeb3('0x10')][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x11'),this[_0xbeb3('0x12')]['bind'](this));ami['on'](_0xbeb3('0x13'),this[_0xbeb3('0x14')][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x15'),this[_0xbeb3('0x16')][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x17'),this['syncVarSet'][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x18'),this[_0xbeb3('0x19')][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x1a'),this['syncMusicOnHoldStart'][_0xbeb3('0xf')](this));ami['on']('musiconholdstop',this[_0xbeb3('0x1b')][_0xbeb3('0xf')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xbeb3('0xf')](this));ami['on'](_0xbeb3('0x1c'),this['syncBlindTransfer'][_0xbeb3('0xf')](this));}VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x1e')]=function(_0x562d11,_0x4ee006,_0x1e2ca8){io['to'](_0x562d11)[_0xbeb3('0x1e')](_0x4ee006,_0x1e2ca8);};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x1f')]=function(_0x1e498f){return _0x1e498f!==null&&!_['isUndefined'](_0x1e498f);};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0xe')]=function(_0x5cd021){try{if(this['isNotNull'](_0x5cd021)){if(_[_0xbeb3('0x20')](this[_0xbeb3('0x21')][_0x5cd021['uniqueid']])){this[_0xbeb3('0x21')][_0x5cd021[_0xbeb3('0x22')]]={};}if(_[_0xbeb3('0x20')](this[_0xbeb3('0x21')][_0x5cd021['uniqueid']][_0x5cd021['destuniqueid']])){this['channels'][_0x5cd021[_0xbeb3('0x22')]][_0x5cd021[_0xbeb3('0x23')]]={'agentcalledAt':moment()[_0xbeb3('0x24')](_0xbeb3('0x25')),'lastevent':_0xbeb3('0x26'),'variables':this[_0xbeb3('0xc')][_0x5cd021[_0xbeb3('0x22')]],'type':this[_0xbeb3('0xa')][_0x5cd021[_0xbeb3('0x27')]]?this[_0xbeb3('0xa')][_0x5cd021[_0xbeb3('0x27')]][_0xbeb3('0x28')]||_0xbeb3('0x29'):_0xbeb3('0x29')};}_['merge'](this[_0xbeb3('0x21')][_0x5cd021[_0xbeb3('0x22')]][_0x5cd021[_0xbeb3('0x23')]],_['omit'](_0x5cd021,['event',_0xbeb3('0x2a')]));ami[_0xbeb3('0x1e')](_0xbeb3('0x2b'),this[_0xbeb3('0x21')][_0x5cd021[_0xbeb3('0x22')]][_0x5cd021[_0xbeb3('0x23')]]);this[_0xbeb3('0x1e')](util[_0xbeb3('0x24')](_0xbeb3('0x2c'),_0x5cd021[_0xbeb3('0x2d')]),_0xbeb3('0x2e'),this[_0xbeb3('0x21')][_0x5cd021[_0xbeb3('0x22')]][_0x5cd021[_0xbeb3('0x23')]]);}}catch(_0x78ab26){logger[_0xbeb3('0x2f')]('[syncAgentCalled][VoiceAgentReport]',util[_0xbeb3('0x30')](_0x78ab26,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x10')]=function(_0x10651a){try{if(this[_0xbeb3('0x1f')](_0x10651a)){if(this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]]){for(var _0x32fab7 in this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]]){if(this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0xbeb3('0x31')](_0x32fab7)){if(_0x10651a[_0xbeb3('0x23')]===_0x32fab7){this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7]['agentconnectAt']=moment()[_0xbeb3('0x24')](_0xbeb3('0x25'));this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x32')]='connect';this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x33')]=_0x10651a['holdtime'];this['channels'][_0x10651a['uniqueid']][_0x32fab7][_0xbeb3('0x34')]=_0x10651a[_0xbeb3('0x34')];this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x35')]=_0x10651a['connectedlinename'];this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7]['destchannelstate']=_0x10651a[_0xbeb3('0x36')];this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0x32fab7][_0xbeb3('0x37')]=_0x10651a[_0xbeb3('0x37')];_[_0xbeb3('0x38')](this[_0xbeb3('0xb')][_0x10651a[_0xbeb3('0x39')]],_[_0xbeb3('0x3a')](_0x10651a,[_0xbeb3('0x27'),_0xbeb3('0x3b')]));this[_0xbeb3('0x1e')](util[_0xbeb3('0x24')](_0xbeb3('0x2c'),_0x10651a[_0xbeb3('0x2d')]),_0xbeb3('0x3c'),this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0x10651a[_0xbeb3('0x23')]]);ami[_0xbeb3('0x1e')](_0xbeb3('0x3d'),this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7]);}else if(!this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0x32fab7][_0xbeb3('0x11')]&&!this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x15')]){this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x11')]=!![];this['channels'][_0x10651a['uniqueid']][_0x32fab7][_0xbeb3('0x3e')]=moment()[_0xbeb3('0x24')](_0xbeb3('0x25'));this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7]['reason']=_0xbeb3('0x3f');this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0x32fab7][_0xbeb3('0x32')]='answered_elsewhere';this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7][_0xbeb3('0x40')]=_0x10651a[_0xbeb3('0x23')];this[_0xbeb3('0x21')][_0x10651a[_0xbeb3('0x22')]][_0x32fab7]['answeredelsewheremembername']=_0x10651a['membername'];ami[_0xbeb3('0x1e')](_0xbeb3('0x41'),this[_0xbeb3('0x21')][_0x10651a['uniqueid']][_0x32fab7]);}}}}}}catch(_0x57f4e7){logger[_0xbeb3('0x2f')](_0xbeb3('0x42'),util['inspect'](_0x57f4e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')]['syncAgentRingNoAnswer']=function(_0x38d354){try{if(this[_0xbeb3('0x1f')](_0x38d354)){if(this[_0xbeb3('0x21')][_0x38d354[_0xbeb3('0x22')]]&&this['channels'][_0x38d354[_0xbeb3('0x22')]][_0x38d354[_0xbeb3('0x23')]]){this['channels'][_0x38d354[_0xbeb3('0x22')]][_0x38d354[_0xbeb3('0x23')]][_0xbeb3('0x11')]=!![];this[_0xbeb3('0x21')][_0x38d354[_0xbeb3('0x22')]][_0x38d354['destuniqueid']]['agentringnoanswerAt']=moment()[_0xbeb3('0x24')](_0xbeb3('0x25'));this[_0xbeb3('0x21')][_0x38d354[_0xbeb3('0x22')]][_0x38d354[_0xbeb3('0x23')]][_0xbeb3('0x43')]=_0xbeb3('0x44');this[_0xbeb3('0x21')][_0x38d354[_0xbeb3('0x22')]][_0x38d354[_0xbeb3('0x23')]][_0xbeb3('0x32')]=_0xbeb3('0x44');ami[_0xbeb3('0x1e')]('custom:agentringnoanswer',this['channels'][_0x38d354['uniqueid']][_0x38d354[_0xbeb3('0x23')]]);}}}catch(_0x4602ed){logger[_0xbeb3('0x2f')](_0xbeb3('0x45'),util['inspect'](_0x4602ed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x14')]=function(_0xa8f9dc){try{if(this[_0xbeb3('0x1f')](_0xa8f9dc)){if(this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]]){for(var _0x1f83b0 in this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]]){if(this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]]['hasOwnProperty'](_0x1f83b0)&&!this[_0xbeb3('0x21')][_0xa8f9dc['uniqueid']][_0x1f83b0][_0xbeb3('0x11')]&&!this['channels'][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0][_0xbeb3('0x15')]){this['channels'][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0]['agentringnoanswer']=!![];this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0][_0xbeb3('0x3e')]=moment()['format'](_0xbeb3('0x25'));this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0][_0xbeb3('0x43')]=_0xbeb3('0x46');this[_0xbeb3('0x21')][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0][_0xbeb3('0x32')]=_0xbeb3('0x46');ami['emit'](_0xbeb3('0x47'),this['channels'][_0xa8f9dc[_0xbeb3('0x22')]][_0x1f83b0]);}}}}}catch(_0x2dea33){logger[_0xbeb3('0x2f')](_0xbeb3('0x48'),util[_0xbeb3('0x30')](_0x2dea33,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xbeb3('0x16')]=function(_0x16cefd){try{if(this['isNotNull'](_0x16cefd)){if(this['channels'][_0x16cefd[_0xbeb3('0x22')]]){for(var _0x3e3857 in this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]]){if(this[_0xbeb3('0x21')][_0x16cefd['uniqueid']][_0xbeb3('0x31')](_0x3e3857)){if(this['channels'][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x49')]&&!this['channels'][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x15')]){this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x15')]=!![];this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x4a')]=moment()['format'](_0xbeb3('0x25'));this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x32')]=_0xbeb3('0x4b');this['channels'][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x4c')]=_0x16cefd[_0xbeb3('0x4c')];this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857][_0xbeb3('0x43')]=_0x16cefd[_0xbeb3('0x43')]==_0xbeb3('0x4d')?_0xbeb3('0x4e'):_0x16cefd['reason'];if(this[_0xbeb3('0xa')][_0x16cefd['queue']]&&this[_0xbeb3('0xa')][_0x16cefd[_0xbeb3('0x27')]][_0xbeb3('0x4f')]){this['channels'][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857]['agentacw']=!![];this['channels'][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857]['acwtime']=this['voiceQueues'][_0x16cefd[_0xbeb3('0x27')]][_0xbeb3('0x50')];}this[_0xbeb3('0xb')][_0x16cefd[_0xbeb3('0x39')]]=_[_0xbeb3('0x51')](this[_0xbeb3('0xb')][_0x16cefd['interface']],[_0xbeb3('0x27'),'destconnectedlinenum']);this[_0xbeb3('0x1e')](util[_0xbeb3('0x24')](_0xbeb3('0x2c'),_0x16cefd['membername']),'user:agentcomplete',this[_0xbeb3('0x21')][_0x16cefd['uniqueid']][_0x3e3857]);ami['emit'](_0xbeb3('0x52'),this[_0xbeb3('0x21')][_0x16cefd[_0xbeb3('0x22')]][_0x3e3857]);}}}}}}catch(_0x5ded8f){logger[_0xbeb3('0x2f')](_0xbeb3('0x53'),util[_0xbeb3('0x30')](_0x5ded8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xbeb3('0x54')]=function(_0x230894){try{if(this['isNotNull'](_0x230894)){this[_0xbeb3('0x55')](_0x230894[_0xbeb3('0x22')],_[_0xbeb3('0x56')](_0x230894[_0xbeb3('0x57')])[0x0],_0x230894['value']);if(this[_0xbeb3('0x21')][_0x230894[_0xbeb3('0x22')]]){for(var _0x49e6ad in this[_0xbeb3('0x21')][_0x230894['uniqueid']]){if(this['channels'][_0x230894['uniqueid']][_0xbeb3('0x31')](_0x49e6ad)){if(_[_0xbeb3('0x20')](this[_0xbeb3('0x21')][_0x230894['uniqueid']][_0x49e6ad][_0xbeb3('0xc')])){this[_0xbeb3('0x21')][_0x230894[_0xbeb3('0x22')]][_0x49e6ad]['variables']={};}this[_0xbeb3('0x21')][_0x230894['uniqueid']][_0x49e6ad][_0xbeb3('0xc')]=this[_0xbeb3('0xc')][_0x230894[_0xbeb3('0x22')]];}}}}}catch(_0x530c98){logger[_0xbeb3('0x2f')](_0xbeb3('0x58'),util[_0xbeb3('0x30')](_0x530c98,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x55')]=function(_0x26d598,_0x41784d,_0x3529f0){var _0x3934c0=['rtpaudioqos','rtpaudioqosbridged',_0xbeb3('0x59'),_0xbeb3('0x5a'),'rtpaudioqosloss',_0xbeb3('0x5b'),_0xbeb3('0x5c'),_0xbeb3('0x5d'),'sipcallid',_0xbeb3('0x5e'),'bridgepeer','bridgepvtcallid',_0xbeb3('0x5f'),_0xbeb3('0x60'),'memberinterface',_0xbeb3('0x61'),_0xbeb3('0x2d'),_0xbeb3('0x62'),'memberrealtime'];if(!_[_0xbeb3('0x63')](_0x41784d)&&!_[_0xbeb3('0x64')](_0x3934c0,_0x41784d)){if(_['isUndefined'](this['variables'][_0x26d598])){this[_0xbeb3('0xc')][_0x26d598]={};}this['variables'][_0x26d598][_0x41784d]=_0x3529f0;}};VoiceAgentReport['prototype'][_0xbeb3('0x19')]=function(_0x2c1839){try{if(this[_0xbeb3('0x1f')](_0x2c1839)){if(this[_0xbeb3('0x21')][_0x2c1839['uniqueid']]){for(var _0x4f74da in this[_0xbeb3('0x21')][_0x2c1839[_0xbeb3('0x22')]]){if(this[_0xbeb3('0x21')][_0x2c1839[_0xbeb3('0x22')]]['hasOwnProperty'](_0x4f74da)){if(this[_0xbeb3('0x21')][_0x2c1839[_0xbeb3('0x22')]][_0x4f74da]['reason']==_0xbeb3('0x4d')&&this[_0xbeb3('0x21')][_0x2c1839['uniqueid']][_0x4f74da][_0xbeb3('0x15')]){this['channels'][_0x2c1839[_0xbeb3('0x22')]][_0x4f74da][_0xbeb3('0x4a')]=moment()['format'](_0xbeb3('0x25'));}}}ami[_0xbeb3('0x1e')]('custom:voiceAgentReport',_[_0xbeb3('0x65')](this['channels'][_0x2c1839['uniqueid']]));delete this[_0xbeb3('0x21')][_0x2c1839[_0xbeb3('0x22')]];}if(this['variables'][_0x2c1839[_0xbeb3('0x22')]]){delete this[_0xbeb3('0xc')][_0x2c1839[_0xbeb3('0x22')]];}}}catch(_0x2f94ab){logger[_0xbeb3('0x2f')]('[syncHangup][VoiceAgentReport]',util[_0xbeb3('0x30')](_0x2f94ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x66')]=function(_0x4155f3){try{if(this[_0xbeb3('0x1f')](_0x4155f3)){if(this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]]){for(var _0x28afc0 in this['channels'][_0x4155f3[_0xbeb3('0x67')]]){if(this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0xbeb3('0x31')](_0x28afc0)){if(_0x4155f3['origtransfereruniqueid']===_0x28afc0){var _0x98bd89=moment();this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0x28afc0][_0xbeb3('0x15')]=!![];this[_0xbeb3('0x21')][_0x4155f3['transfereeuniqueid']][_0x28afc0][_0xbeb3('0x4a')]=moment()[_0xbeb3('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0x28afc0][_0xbeb3('0x43')]='transfer';this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0x28afc0][_0xbeb3('0x32')]=_0xbeb3('0x4b');this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0x28afc0][_0xbeb3('0x4c')]=_0x98bd89[_0xbeb3('0x68')](this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]][_0x28afc0][_0xbeb3('0x49')],_0xbeb3('0x69'));}}}}if(this['channels'][_0x4155f3[_0xbeb3('0x6a')]]){var _0x4bf60a=this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x6a')]];this['channels'][_0x4155f3[_0xbeb3('0x6a')]]=this[_0xbeb3('0x21')][_0x4155f3[_0xbeb3('0x67')]];this['channels'][_0x4155f3[_0xbeb3('0x67')]]=_0x4bf60a;}}}catch(_0x2ec96a){logger['error'](_0xbeb3('0x6b'),util[_0xbeb3('0x30')](_0x2ec96a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x6c')]=function(_0x568152){try{if(this[_0xbeb3('0x1f')](_0x568152)){if(this['channels'][_0x568152[_0xbeb3('0x67')]]){for(var _0x42493f in this[_0xbeb3('0x21')][_0x568152['transfereeuniqueid']]){if(this['channels'][_0x568152['transfereeuniqueid']][_0xbeb3('0x31')](_0x42493f)){if(_0x568152[_0xbeb3('0x6d')]===_0x42493f){var _0xcf2d80=moment();this['channels'][_0x568152[_0xbeb3('0x67')]][_0x42493f][_0xbeb3('0x15')]=!![];this[_0xbeb3('0x21')][_0x568152[_0xbeb3('0x67')]][_0x42493f][_0xbeb3('0x4a')]=_0xcf2d80;this['channels'][_0x568152[_0xbeb3('0x67')]][_0x42493f][_0xbeb3('0x43')]='transfer';this[_0xbeb3('0x21')][_0x568152[_0xbeb3('0x67')]][_0x42493f]['lastevent']=_0xbeb3('0x4b');this['channels'][_0x568152['transfereeuniqueid']][_0x42493f][_0xbeb3('0x4c')]=_0xcf2d80[_0xbeb3('0x68')](this['channels'][_0x568152[_0xbeb3('0x67')]][_0x42493f][_0xbeb3('0x49')],_0xbeb3('0x69'));}}}}}}catch(_0x1784fd){logger[_0xbeb3('0x2f')](_0xbeb3('0x6e'),util['inspect'](_0x1784fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x6f')]=function(_0x346c64){var _0x46fa49='';try{if(this[_0xbeb3('0x1f')](_0x346c64)){if(_0x346c64[_0xbeb3('0x70')]){_0x46fa49=_0x346c64[_0xbeb3('0x70')][_0xbeb3('0x71')](0x0,_0x346c64['channel'][_0xbeb3('0x72')]('-'));if(this[_0xbeb3('0xb')][_0x46fa49]){this['agents'][_0x46fa49][_0xbeb3('0x73')]=!![];}}}}catch(_0x6167e3){logger['error'](_0xbeb3('0x74'),util['inspect'](_0x6167e3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbeb3('0x1d')][_0xbeb3('0x1b')]=function(_0x2d0d5f){var _0x306bb2='';try{if(this[_0xbeb3('0x1f')](_0x2d0d5f)){if(_0x2d0d5f[_0xbeb3('0x70')]){_0x306bb2=_0x2d0d5f[_0xbeb3('0x70')][_0xbeb3('0x71')](0x0,_0x2d0d5f[_0xbeb3('0x70')][_0xbeb3('0x72')]('-'));if(this['agents'][_0x306bb2]){this[_0xbeb3('0xb')][_0x306bb2][_0xbeb3('0x73')]=![];}}}}catch(_0x141415){logger['error'](_0xbeb3('0x75'),util[_0xbeb3('0x30')](_0x141415,{'showHidden':![],'depth':null}));}};module[_0xbeb3('0x76')]=VoiceAgentReport; \ No newline at end of file +var _0x157b=['destchannelstatedesc','interface','pick','destconnectedlinenum','user:%s','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','acw','acwTimeout','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','localhost','socket.io-emitter','redis','channels','voiceQueues','agents','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','privilege','custom:agentcalled','membername','user:called','error','inspect','agentconnectAt','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate'];(function(_0x2b34df,_0x3dd0b5){var _0x225802=function(_0x4965ab){while(--_0x4965ab){_0x2b34df['push'](_0x2b34df['shift']());}};_0x225802(++_0x3dd0b5);}(_0x157b,0x1b5));var _0xb157=function(_0x1db0e7,_0x1fc9fe){_0x1db0e7=_0x1db0e7-0x0;var _0x56a60c=_0x157b[_0x1db0e7];return _0x56a60c;};'use strict';var _=require('lodash');var moment=require(_0xb157('0x0'));var util=require(_0xb157('0x1'));var Redis=require(_0xb157('0x2'));var config=require(_0xb157('0x3'));var logger=require(_0xb157('0x4'))(_0xb157('0x5'));var ami=require(_0xb157('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xb157('0x7'),'port':0x18eb});var io=require(_0xb157('0x8'))(new Redis(config[_0xb157('0x9')]));function VoiceAgentReport(_0x512d58){this[_0xb157('0xa')]={};this['voiceQueues']=_0x512d58[_0xb157('0xb')];this[_0xb157('0xc')]=_0x512d58[_0xb157('0xc')];this[_0xb157('0xd')]={};ami['on'](_0xb157('0xe'),this['syncAgentCalled'][_0xb157('0xf')](this));ami['on']('agentconnect',this[_0xb157('0x10')][_0xb157('0xf')](this));ami['on'](_0xb157('0x11'),this[_0xb157('0x12')][_0xb157('0xf')](this));ami['on'](_0xb157('0x13'),this[_0xb157('0x14')][_0xb157('0xf')](this));ami['on'](_0xb157('0x15'),this[_0xb157('0x16')][_0xb157('0xf')](this));ami['on'](_0xb157('0x17'),this[_0xb157('0x18')][_0xb157('0xf')](this));ami['on'](_0xb157('0x19'),this['syncHangup'][_0xb157('0xf')](this));ami['on'](_0xb157('0x1a'),this[_0xb157('0x1b')]['bind'](this));ami['on'](_0xb157('0x1c'),this['syncMusicOnHoldStop'][_0xb157('0xf')](this));ami['on'](_0xb157('0x1d'),this[_0xb157('0x1e')][_0xb157('0xf')](this));ami['on']('blindtransfer',this[_0xb157('0x1f')][_0xb157('0xf')](this));}VoiceAgentReport[_0xb157('0x20')]['emit']=function(_0x2dd048,_0x1d9065,_0x3ebd74){io['to'](_0x2dd048)[_0xb157('0x21')](_0x1d9065,_0x3ebd74);};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x22')]=function(_0x453e98){return _0x453e98!==null&&!_[_0xb157('0x23')](_0x453e98);};VoiceAgentReport['prototype'][_0xb157('0x24')]=function(_0xc9fdac){try{if(this['isNotNull'](_0xc9fdac)){if(_[_0xb157('0x23')](this[_0xb157('0xa')][_0xc9fdac[_0xb157('0x25')]])){this[_0xb157('0xa')][_0xc9fdac['uniqueid']]={};}if(_[_0xb157('0x23')](this[_0xb157('0xa')][_0xc9fdac[_0xb157('0x25')]][_0xc9fdac[_0xb157('0x26')]])){this['channels'][_0xc9fdac[_0xb157('0x25')]][_0xc9fdac[_0xb157('0x26')]]={'agentcalledAt':moment()[_0xb157('0x27')](_0xb157('0x28')),'lastevent':_0xb157('0x29'),'variables':this[_0xb157('0xd')][_0xc9fdac[_0xb157('0x25')]],'type':this[_0xb157('0xb')][_0xc9fdac['queue']]?this['voiceQueues'][_0xc9fdac[_0xb157('0x2a')]][_0xb157('0x2b')]||'inbound':_0xb157('0x2c')};}_[_0xb157('0x2d')](this[_0xb157('0xa')][_0xc9fdac[_0xb157('0x25')]][_0xc9fdac[_0xb157('0x26')]],_[_0xb157('0x2e')](_0xc9fdac,['event',_0xb157('0x2f')]));ami[_0xb157('0x21')](_0xb157('0x30'),this[_0xb157('0xa')][_0xc9fdac['uniqueid']][_0xc9fdac[_0xb157('0x26')]]);this['emit'](util[_0xb157('0x27')]('user:%s',_0xc9fdac[_0xb157('0x31')]),_0xb157('0x32'),this['channels'][_0xc9fdac[_0xb157('0x25')]][_0xc9fdac[_0xb157('0x26')]]);}}catch(_0x311f5f){logger[_0xb157('0x33')]('[syncAgentCalled][VoiceAgentReport]',util[_0xb157('0x34')](_0x311f5f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x10')]=function(_0x1b8ca5){try{if(this[_0xb157('0x22')](_0x1b8ca5)){if(this[_0xb157('0xa')][_0x1b8ca5['uniqueid']]){for(var _0x529909 in this['channels'][_0x1b8ca5[_0xb157('0x25')]]){if(this[_0xb157('0xa')][_0x1b8ca5['uniqueid']]['hasOwnProperty'](_0x529909)){if(_0x1b8ca5[_0xb157('0x26')]===_0x529909){this['channels'][_0x1b8ca5['uniqueid']][_0x529909][_0xb157('0x35')]=moment()[_0xb157('0x27')](_0xb157('0x28'));this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x36')]='connect';this['channels'][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x37')]=_0x1b8ca5[_0xb157('0x37')];this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x38')]=_0x1b8ca5[_0xb157('0x38')];this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x39')]=_0x1b8ca5[_0xb157('0x39')];this[_0xb157('0xa')][_0x1b8ca5['uniqueid']][_0x529909][_0xb157('0x3a')]=_0x1b8ca5[_0xb157('0x3a')];this[_0xb157('0xa')][_0x1b8ca5['uniqueid']][_0x529909][_0xb157('0x3b')]=_0x1b8ca5['destchannelstatedesc'];_[_0xb157('0x2d')](this[_0xb157('0xc')][_0x1b8ca5[_0xb157('0x3c')]],_[_0xb157('0x3d')](_0x1b8ca5,[_0xb157('0x2a'),_0xb157('0x3e')]));this[_0xb157('0x21')](util[_0xb157('0x27')](_0xb157('0x3f'),_0x1b8ca5[_0xb157('0x31')]),'user:agentconnect',this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x1b8ca5[_0xb157('0x26')]]);ami['emit'](_0xb157('0x40'),this[_0xb157('0xa')][_0x1b8ca5['uniqueid']][_0x529909]);}else if(!this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x11')]&&!this['channels'][_0x1b8ca5['uniqueid']][_0x529909][_0xb157('0x15')]){this['channels'][_0x1b8ca5['uniqueid']][_0x529909]['agentringnoanswer']=!![];this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x41')]=moment()[_0xb157('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb157('0xa')][_0x1b8ca5['uniqueid']][_0x529909][_0xb157('0x42')]=_0xb157('0x43');this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x36')]=_0xb157('0x43');this['channels'][_0x1b8ca5[_0xb157('0x25')]][_0x529909][_0xb157('0x44')]=_0x1b8ca5['destuniqueid'];this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909]['answeredelsewheremembername']=_0x1b8ca5[_0xb157('0x31')];ami[_0xb157('0x21')]('custom:agentansweredelsewhere',this[_0xb157('0xa')][_0x1b8ca5[_0xb157('0x25')]][_0x529909]);}}}}}}catch(_0xfb0072){logger[_0xb157('0x33')](_0xb157('0x45'),util[_0xb157('0x34')](_0xfb0072,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x12')]=function(_0x34e1fd){try{if(this['isNotNull'](_0x34e1fd)){if(this[_0xb157('0xa')][_0x34e1fd[_0xb157('0x25')]]&&this['channels'][_0x34e1fd[_0xb157('0x25')]][_0x34e1fd[_0xb157('0x26')]]){this[_0xb157('0xa')][_0x34e1fd[_0xb157('0x25')]][_0x34e1fd['destuniqueid']][_0xb157('0x11')]=!![];this[_0xb157('0xa')][_0x34e1fd['uniqueid']][_0x34e1fd[_0xb157('0x26')]][_0xb157('0x41')]=moment()[_0xb157('0x27')](_0xb157('0x28'));this['channels'][_0x34e1fd['uniqueid']][_0x34e1fd[_0xb157('0x26')]][_0xb157('0x42')]=_0xb157('0x46');this['channels'][_0x34e1fd[_0xb157('0x25')]][_0x34e1fd[_0xb157('0x26')]]['lastevent']=_0xb157('0x46');ami[_0xb157('0x21')](_0xb157('0x47'),this[_0xb157('0xa')][_0x34e1fd[_0xb157('0x25')]][_0x34e1fd[_0xb157('0x26')]]);}}}catch(_0x505e22){logger[_0xb157('0x33')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util['inspect'](_0x505e22,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb157('0x14')]=function(_0x32f736){try{if(this[_0xb157('0x22')](_0x32f736)){if(this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]]){for(var _0x56e852 in this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]]){if(this[_0xb157('0xa')][_0x32f736['uniqueid']][_0xb157('0x48')](_0x56e852)&&!this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]][_0x56e852][_0xb157('0x11')]&&!this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]][_0x56e852][_0xb157('0x15')]){this['channels'][_0x32f736['uniqueid']][_0x56e852]['agentringnoanswer']=!![];this[_0xb157('0xa')][_0x32f736['uniqueid']][_0x56e852][_0xb157('0x41')]=moment()[_0xb157('0x27')](_0xb157('0x28'));this['channels'][_0x32f736['uniqueid']][_0x56e852]['reason']=_0xb157('0x49');this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]][_0x56e852]['lastevent']=_0xb157('0x49');ami['emit'](_0xb157('0x4a'),this[_0xb157('0xa')][_0x32f736[_0xb157('0x25')]][_0x56e852]);}}}}}catch(_0x50eb30){logger[_0xb157('0x33')](_0xb157('0x4b'),util['inspect'](_0x50eb30,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x16')]=function(_0x233d36){try{if(this[_0xb157('0x22')](_0x233d36)){if(this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]]){for(var _0x22b295 in this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]]){if(this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]]['hasOwnProperty'](_0x22b295)){if(this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295][_0xb157('0x35')]&&!this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295][_0xb157('0x15')]){this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295][_0xb157('0x15')]=!![];this[_0xb157('0xa')][_0x233d36['uniqueid']][_0x22b295][_0xb157('0x4c')]=moment()['format'](_0xb157('0x28'));this['channels'][_0x233d36['uniqueid']][_0x22b295][_0xb157('0x36')]=_0xb157('0x4d');this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295][_0xb157('0x4e')]=_0x233d36['talktime'];this['channels'][_0x233d36[_0xb157('0x25')]][_0x22b295]['reason']=_0x233d36['reason']==_0xb157('0x4f')?_0xb157('0x50'):_0x233d36[_0xb157('0x42')];if(this[_0xb157('0xb')][_0x233d36[_0xb157('0x2a')]]&&this[_0xb157('0xb')][_0x233d36[_0xb157('0x2a')]][_0xb157('0x51')]){this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295]['agentacw']=!![];this[_0xb157('0xa')][_0x233d36[_0xb157('0x25')]][_0x22b295]['acwtime']=this['voiceQueues'][_0x233d36[_0xb157('0x2a')]][_0xb157('0x52')];}this[_0xb157('0xc')][_0x233d36[_0xb157('0x3c')]]=_[_0xb157('0x2e')](this['agents'][_0x233d36[_0xb157('0x3c')]],[_0xb157('0x2a'),_0xb157('0x3e')]);this['emit'](util['format']('user:%s',_0x233d36[_0xb157('0x31')]),'user:agentcomplete',this[_0xb157('0xa')][_0x233d36['uniqueid']][_0x22b295]);ami['emit'](_0xb157('0x53'),this[_0xb157('0xa')][_0x233d36['uniqueid']][_0x22b295]);}}}}}}catch(_0x3701d2){logger[_0xb157('0x33')](_0xb157('0x54'),util[_0xb157('0x34')](_0x3701d2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x18')]=function(_0x487dc4){try{if(this[_0xb157('0x22')](_0x487dc4)){this[_0xb157('0x55')](_0x487dc4[_0xb157('0x25')],_[_0xb157('0x56')](_0x487dc4[_0xb157('0x57')])[0x0],_0x487dc4[_0xb157('0x58')]);if(this[_0xb157('0xa')][_0x487dc4[_0xb157('0x25')]]){for(var _0x2eb511 in this[_0xb157('0xa')][_0x487dc4[_0xb157('0x25')]]){if(this[_0xb157('0xa')][_0x487dc4[_0xb157('0x25')]][_0xb157('0x48')](_0x2eb511)){if(_['isUndefined'](this[_0xb157('0xa')][_0x487dc4['uniqueid']][_0x2eb511]['variables'])){this[_0xb157('0xa')][_0x487dc4[_0xb157('0x25')]][_0x2eb511][_0xb157('0xd')]={};}this[_0xb157('0xa')][_0x487dc4[_0xb157('0x25')]][_0x2eb511]['variables']=this[_0xb157('0xd')][_0x487dc4[_0xb157('0x25')]];}}}}}catch(_0x37b325){logger[_0xb157('0x33')](_0xb157('0x59'),util[_0xb157('0x34')](_0x37b325,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb157('0x55')]=function(_0x7adef3,_0x6fa077,_0x4bb76b){var _0x5a0500=[_0xb157('0x5a'),_0xb157('0x5b'),_0xb157('0x5c'),_0xb157('0x5d'),'rtpaudioqosloss',_0xb157('0x5e'),_0xb157('0x5f'),_0xb157('0x60'),_0xb157('0x61'),_0xb157('0x62'),_0xb157('0x63'),_0xb157('0x64'),_0xb157('0x65'),_0xb157('0x66'),'memberinterface','memberlastcall',_0xb157('0x31'),_0xb157('0x67'),_0xb157('0x68')];if(!_[_0xb157('0x69')](_0x6fa077)&&!_[_0xb157('0x6a')](_0x5a0500,_0x6fa077)){if(_[_0xb157('0x23')](this[_0xb157('0xd')][_0x7adef3])){this[_0xb157('0xd')][_0x7adef3]={};}this[_0xb157('0xd')][_0x7adef3][_0x6fa077]=_0x4bb76b;}};VoiceAgentReport[_0xb157('0x20')]['syncHangup']=function(_0x305c75){try{if(this[_0xb157('0x22')](_0x305c75)){if(this[_0xb157('0xa')][_0x305c75[_0xb157('0x25')]]){for(var _0x35b182 in this['channels'][_0x305c75[_0xb157('0x25')]]){if(this[_0xb157('0xa')][_0x305c75['uniqueid']]['hasOwnProperty'](_0x35b182)){if(this['channels'][_0x305c75['uniqueid']][_0x35b182][_0xb157('0x42')]==_0xb157('0x4f')&&this[_0xb157('0xa')][_0x305c75['uniqueid']][_0x35b182]['agentcomplete']){this[_0xb157('0xa')][_0x305c75['uniqueid']][_0x35b182][_0xb157('0x4c')]=moment()[_0xb157('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami['emit'](_0xb157('0x6b'),_[_0xb157('0x6c')](this[_0xb157('0xa')][_0x305c75['uniqueid']]));delete this['channels'][_0x305c75[_0xb157('0x25')]];}if(this[_0xb157('0xd')][_0x305c75[_0xb157('0x25')]]){delete this[_0xb157('0xd')][_0x305c75[_0xb157('0x25')]];}}}catch(_0x44b43f){logger[_0xb157('0x33')](_0xb157('0x6d'),util[_0xb157('0x34')](_0x44b43f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x1e')]=function(_0x4fa6af){try{if(this['isNotNull'](_0x4fa6af)){if(this[_0xb157('0xa')][_0x4fa6af['transfereeuniqueid']]){for(var _0x44db52 in this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x6e')]]){if(this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x6e')]]['hasOwnProperty'](_0x44db52)){if(_0x4fa6af[_0xb157('0x6f')]===_0x44db52){var _0x54b9b4=moment();this[_0xb157('0xa')][_0x4fa6af['transfereeuniqueid']][_0x44db52][_0xb157('0x15')]=!![];this['channels'][_0x4fa6af[_0xb157('0x6e')]][_0x44db52][_0xb157('0x4c')]=moment()[_0xb157('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x6e')]][_0x44db52]['reason']=_0xb157('0x4f');this[_0xb157('0xa')][_0x4fa6af['transfereeuniqueid']][_0x44db52][_0xb157('0x36')]=_0xb157('0x4d');this['channels'][_0x4fa6af[_0xb157('0x6e')]][_0x44db52]['talktime']=_0x54b9b4[_0xb157('0x70')](this['channels'][_0x4fa6af[_0xb157('0x6e')]][_0x44db52]['agentconnectAt'],_0xb157('0x71'));}}}}if(this[_0xb157('0xa')][_0x4fa6af['secondtransfereruniqueid']]){var _0x327322=this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x72')]];this[_0xb157('0xa')][_0x4fa6af['secondtransfereruniqueid']]=this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x6e')]];this[_0xb157('0xa')][_0x4fa6af[_0xb157('0x6e')]]=_0x327322;}}}catch(_0x47da56){logger['error'](_0xb157('0x73'),util[_0xb157('0x34')](_0x47da56,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x1f')]=function(_0x3dca2b){try{if(this[_0xb157('0x22')](_0x3dca2b)){if(this['channels'][_0x3dca2b['transfereeuniqueid']]){for(var _0x341330 in this[_0xb157('0xa')][_0x3dca2b[_0xb157('0x6e')]]){if(this['channels'][_0x3dca2b[_0xb157('0x6e')]][_0xb157('0x48')](_0x341330)){if(_0x3dca2b['transfereruniqueid']===_0x341330){var _0x39e90f=moment();this['channels'][_0x3dca2b[_0xb157('0x6e')]][_0x341330]['agentcomplete']=!![];this[_0xb157('0xa')][_0x3dca2b[_0xb157('0x6e')]][_0x341330][_0xb157('0x4c')]=_0x39e90f;this[_0xb157('0xa')][_0x3dca2b[_0xb157('0x6e')]][_0x341330][_0xb157('0x42')]=_0xb157('0x4f');this[_0xb157('0xa')][_0x3dca2b['transfereeuniqueid']][_0x341330][_0xb157('0x36')]=_0xb157('0x4d');this[_0xb157('0xa')][_0x3dca2b[_0xb157('0x6e')]][_0x341330][_0xb157('0x4e')]=_0x39e90f['diff'](this[_0xb157('0xa')][_0x3dca2b[_0xb157('0x6e')]][_0x341330][_0xb157('0x35')],_0xb157('0x71'));}}}}}}catch(_0x32b143){logger[_0xb157('0x33')](_0xb157('0x74'),util[_0xb157('0x34')](_0x32b143,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x1b')]=function(_0x4d86f6){var _0x5e2a03='';try{if(this[_0xb157('0x22')](_0x4d86f6)){if(_0x4d86f6['channel']){_0x5e2a03=_0x4d86f6[_0xb157('0x75')][_0xb157('0x76')](0x0,_0x4d86f6[_0xb157('0x75')][_0xb157('0x77')]('-'));if(this[_0xb157('0xc')][_0x5e2a03]){this[_0xb157('0xc')][_0x5e2a03][_0xb157('0x78')]=!![];}}}}catch(_0x4944a7){logger['error']('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0xb157('0x34')](_0x4944a7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb157('0x20')][_0xb157('0x79')]=function(_0x44bba1){var _0x29e5dd='';try{if(this[_0xb157('0x22')](_0x44bba1)){if(_0x44bba1['channel']){_0x29e5dd=_0x44bba1[_0xb157('0x75')][_0xb157('0x76')](0x0,_0x44bba1['channel'][_0xb157('0x77')]('-'));if(this[_0xb157('0xc')][_0x29e5dd]){this[_0xb157('0xc')][_0x29e5dd][_0xb157('0x78')]=![];}}}}catch(_0xaa01c8){logger['error'](_0xb157('0x7a'),util[_0xb157('0x34')](_0xaa01c8,{'showHidden':![],'depth':null}));}};module[_0xb157('0x7b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index b724c0e..a74c663 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 _0xabe7=['[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','answertime','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','bind','newstate','syncNewState','varset','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','isUndefined','uniqueid','merge','pick','[syncNewCallerId][VoiceCallReport]','linkedid','channel','starttime','format','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','name','accountcode','error','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','keys','includes','lastapplication','lastdata','startsWith','match','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','UserId','membername'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xabe7,0xce));var _0x7abe=function(_0x4cbef2,_0x4206e2){_0x4cbef2=_0x4cbef2-0x0;var _0x3a79a4=_0xabe7[_0x4cbef2];return _0x3a79a4;};'use strict';var BPromise=require(_0x7abe('0x0'));var _=require(_0x7abe('0x1'));var moment=require(_0x7abe('0x2'));var util=require(_0x7abe('0x3'));var path=require(_0x7abe('0x4'));var Redis=require(_0x7abe('0x5'));var config=require(_0x7abe('0x6'));var logger=require(_0x7abe('0x7'))(_0x7abe('0x8'));var ami=require(_0x7abe('0x9'));var Channel=require(_0x7abe('0xa'));var statusDesc=[_0x7abe('0xb'),_0x7abe('0xc'),_0x7abe('0xd'),_0x7abe('0xe'),_0x7abe('0xf'),_0x7abe('0x10'),'ringing',_0x7abe('0x11'),_0x7abe('0x12')];var applications=[_0x7abe('0x13'),_0x7abe('0x14'),_0x7abe('0x15'),_0x7abe('0x16'),'playback','voicemail'];var dispositions=[_0x7abe('0x17'),_0x7abe('0x18'),_0x7abe('0x18'),_0x7abe('0x17'),_0x7abe('0x17'),_0x7abe('0x17'),_0x7abe('0x19'),_0x7abe('0x1a'),_0x7abe('0x18'),_0x7abe('0x18'),'FAILED'];var actions={};config['redis']=_['defaults'](config[_0x7abe('0x1b')],{'host':'localhost','port':0x18eb});var io=require(_0x7abe('0x1c'))(new Redis(config['redis']));function VoiceCallReport(_0x158e12){this['channels']=_0x158e12[_0x7abe('0x1d')];this[_0x7abe('0x1e')]=_0x158e12['agents'];ami['on'](_0x7abe('0x1f'),this[_0x7abe('0x20')]['bind'](this));ami['on'](_0x7abe('0x21'),this[_0x7abe('0x20')]['bind'](this));ami['on'](_0x7abe('0x22'),this[_0x7abe('0x23')][_0x7abe('0x24')](this));ami['on'](_0x7abe('0x25'),this[_0x7abe('0x26')][_0x7abe('0x24')](this));ami['on'](_0x7abe('0x27'),this[_0x7abe('0x28')][_0x7abe('0x24')](this));ami['on']('hangup',this[_0x7abe('0x29')][_0x7abe('0x24')](this));ami['on']('newcallerid',this[_0x7abe('0x2a')][_0x7abe('0x24')](this));ami['on'](_0x7abe('0x2b'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x7abe('0x2c'),this['syncBlindTransfer'][_0x7abe('0x24')](this));ami['on'](_0x7abe('0x2d'),this['syncMusicOnHoldStart'][_0x7abe('0x24')](this));ami['on'](_0x7abe('0x2e'),this[_0x7abe('0x2f')][_0x7abe('0x24')](this));return BPromise[_0x7abe('0x30')]()['then'](ami[_0x7abe('0x31')]())[_0x7abe('0x32')](function(_0x5eafb3){console[_0x7abe('0x33')](_0x5eafb3);});}VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x35')]=function(_0x238016){return _0x238016!==null&&!_['isUndefined'](_0x238016);};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x36')]=function(_0x24e0e4,_0x523c62,_0x40ec51){io['to'](_0x24e0e4)['emit'](_0x523c62,_0x40ec51);};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x2a')]=function(_0x3f90c3){try{if(this['isNotNull'](_0x3f90c3)){if(_0x3f90c3['uniqueid']===_0x3f90c3['linkedid']){if(!_[_0x7abe('0x37')](this[_0x7abe('0x1d')][_0x3f90c3[_0x7abe('0x38')]])){_[_0x7abe('0x39')](this[_0x7abe('0x1d')][_0x3f90c3[_0x7abe('0x38')]],_[_0x7abe('0x3a')](_0x3f90c3,_['keys'](this['channels'][_0x3f90c3['uniqueid']])));}}}}catch(_0x4f3c3d){logger['error'](_0x7abe('0x3b'),util['inspect'](_0x4f3c3d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x23')]=function(_0x2674a8){try{if(this[_0x7abe('0x35')](_0x2674a8)){if(_0x2674a8[_0x7abe('0x38')]===_0x2674a8[_0x7abe('0x3c')]&&_0x2674a8[_0x7abe('0x3d')]!='OutgoingSpoolFailed'){if(_[_0x7abe('0x37')](this[_0x7abe('0x1d')][_0x2674a8[_0x7abe('0x38')]])){this[_0x7abe('0x1d')][_0x2674a8['uniqueid']]=new Channel();this['channels'][_0x2674a8[_0x7abe('0x38')]][_0x7abe('0x3e')]=moment()[_0x7abe('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7abe('0x1d')][_0x2674a8['uniqueid']][_0x7abe('0x40')]=dispositions[_[_0x7abe('0x41')](_0x2674a8[_0x7abe('0x42')])];_[_0x7abe('0x39')](this[_0x7abe('0x1d')][_0x2674a8[_0x7abe('0x38')]],_[_0x7abe('0x3a')](_0x2674a8,_['keys'](this[_0x7abe('0x1d')][_0x2674a8[_0x7abe('0x38')]])));if(_0x2674a8[_0x7abe('0x43')]===_0x7abe('0x44')){if(this[_0x7abe('0x1e')][_0x2674a8[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]]){this[_0x7abe('0x1e')][_0x2674a8[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x46')]=_0x2674a8[_0x7abe('0x47')];this[_0x7abe('0x36')](util[_0x7abe('0x3f')](_0x7abe('0x48'),this['agents'][_0x2674a8[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x49')]),'user:agentconnect',{'destaccountcode':this[_0x7abe('0x1e')][_0x2674a8['channel'][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x4a')],'destconnectedlinenum':_0x2674a8[_0x7abe('0x47')]});}}}}}}catch(_0x4e444c){logger[_0x7abe('0x4b')](_0x7abe('0x4c'),util[_0x7abe('0x4d')](_0x4e444c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x20')]=function(_0x1e1850){try{if(this[_0x7abe('0x35')](_0x1e1850)){if(_0x1e1850[_0x7abe('0x38')]===_0x1e1850[_0x7abe('0x3c')]&&_0x1e1850['exten']!='h'&&_0x1e1850[_0x7abe('0x3d')]!=_0x7abe('0x4e')){_0x1e1850[_0x7abe('0x4f')]=_0x1e1850[_0x7abe('0x4f')]['toLowerCase']();_0x1e1850[_0x7abe('0x50')]=(_0x1e1850[_0x7abe('0x51')]||_0x1e1850[_0x7abe('0x50')])['toLowerCase']();if(_[_0x7abe('0x37')](this['channels'][_0x1e1850[_0x7abe('0x38')]])){this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]]=new Channel();this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]]['starttime']=_0x1e1850[_0x7abe('0x52')]?moment()[_0x7abe('0x53')](moment['duration'](_0x1e1850[_0x7abe('0x52')])['seconds'](),_0x7abe('0x54'))[_0x7abe('0x3f')](_0x7abe('0x55')):moment()[_0x7abe('0x3f')](_0x7abe('0x55'));this[_0x7abe('0x1d')][_0x1e1850['uniqueid']][_0x7abe('0x40')]=_0x7abe('0x17');}_[_0x7abe('0x39')](this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]],_[_0x7abe('0x3a')](_0x1e1850,_[_0x7abe('0x56')](this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]])));if(_[_0x7abe('0x57')](applications,_0x1e1850[_0x7abe('0x4f')])){this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]][_0x7abe('0x58')]=_0x1e1850[_0x7abe('0x4f')];this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]][_0x7abe('0x59')]=_0x1e1850[_0x7abe('0x50')];if(_0x1e1850[_0x7abe('0x4f')]===_0x7abe('0x13')&&_[_0x7abe('0x5a')](_0x1e1850[_0x7abe('0x50')],'cdr(')){var _0xaf4d6d=_0x1e1850[_0x7abe('0x50')][_0x7abe('0x45')]('=');var _0x303e4d=_0xaf4d6d[0x0][_0x7abe('0x5b')](/cdr\((.*)\)/);if(_0x303e4d){this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]][_0x303e4d[0x1]]=_0xaf4d6d[0x1];}}else if(_0x1e1850[_0x7abe('0x4f')]===_0x7abe('0x14')){this[_0x7abe('0x1d')][_0x1e1850[_0x7abe('0x38')]][_0x7abe('0x14')]=_0x1e1850['applicationdata']['split'](',')[0x0];}}}}}catch(_0x273fa8){logger[_0x7abe('0x4b')]('[syncNewExten][VoiceCallReport]',util[_0x7abe('0x4d')](_0x273fa8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x7ec978){try{if(this[_0x7abe('0x35')](_0x7ec978)){if(_0x7ec978[_0x7abe('0x38')]!==_0x7ec978[_0x7abe('0x3c')]){if(this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x3c')]]){if(_0x7ec978[_0x7abe('0x42')]==='6'){if(!this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x5c')]){var _0xcd122=moment();this['channels'][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x5c')]=!![];this[_0x7abe('0x1d')][_0x7ec978['linkedid']]['answertime']=_0xcd122[_0x7abe('0x3f')](_0x7abe('0x55'));if(this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x3c')]]['starttime']){this[_0x7abe('0x1d')][_0x7ec978['linkedid']][_0x7abe('0x5d')]=_0xcd122[_0x7abe('0x5e')](this[_0x7abe('0x1d')][_0x7ec978['linkedid']]['starttime'],_0x7abe('0x54'));}}this['channels'][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x3c')]=_0x7ec978[_0x7abe('0x38')];if(_0x7ec978[_0x7abe('0x5f')]!==_0x7abe('0x60')){this['channels'][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x61')]=_0x7ec978[_0x7abe('0x5f')];}this['channels'][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x62')]=_0x7ec978['calleridname'];this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x63')]=_0x7ec978['channel'];this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x3c')]]['disposition']=dispositions[_[_0x7abe('0x41')](_0x7ec978['channelstate'])];if(this[_0x7abe('0x1e')][_0x7ec978['channel'][_0x7abe('0x45')]('-')[0x0]]){this['channels'][_0x7ec978[_0x7abe('0x3c')]][_0x7abe('0x64')]=this['agents'][_0x7ec978[_0x7abe('0x3d')]['split']('-')[0x0]]['id'];this[_0x7abe('0x1d')][_0x7ec978['linkedid']][_0x7abe('0x65')]=this[_0x7abe('0x1e')][_0x7ec978[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x49')];}}}}else{if(this['channels'][_0x7ec978[_0x7abe('0x38')]]){if(_0x7ec978[_0x7abe('0x42')]==='6'){if(this[_0x7abe('0x1e')][_0x7ec978['channel'][_0x7abe('0x45')]('-')[0x0]]){this[_0x7abe('0x1d')][_0x7ec978[_0x7abe('0x38')]][_0x7abe('0x64')]=this[_0x7abe('0x1e')][_0x7ec978['channel'][_0x7abe('0x45')]('-')[0x0]]['id'];this['channels'][_0x7ec978[_0x7abe('0x38')]][_0x7abe('0x65')]=this[_0x7abe('0x1e')][_0x7ec978[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x49')];}}}}}}catch(_0x3d19a8){logger[_0x7abe('0x4b')](_0x7abe('0x66'),util[_0x7abe('0x4d')](_0x3d19a8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x67')]=function(_0xc7481c,_0x486f5d){if(this[_0x7abe('0x1d')][_0xc7481c]){this['channels'][_0xc7481c][_0x7abe('0x68')]=!![];if(_[_0x7abe('0x69')](_0x486f5d,_0x7abe('0x6a'))){_0x486f5d=_0x486f5d[_0x7abe('0x6b')](_0x7abe('0x6a'),_0x7abe('0x6c'));}this[_0x7abe('0x1d')][_0xc7481c]['monitorFilename']=_0x486f5d;var _0x1e1c63=_[_0x7abe('0x6d')](this[_0x7abe('0x1d')][_0xc7481c][_0x7abe('0x6e')],{'filename':_0x486f5d});if(_[_0x7abe('0x6f')](_0x1e1c63)){this[_0x7abe('0x1d')][_0xc7481c][_0x7abe('0x6e')][_0x7abe('0x70')]({'filename':_0x486f5d,'createdAt':moment()[_0x7abe('0x3f')](_0x7abe('0x55')),'mixmonitorid':'','status':_0x7abe('0x71')});}}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x28')]=function(_0x26542a){try{if(this[_0x7abe('0x35')](_0x26542a)){if(this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]]&&_0x26542a['channel']!=_0x7abe('0x4e')){if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')])){if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')][_0x7abe('0x73')])){this[_0x7abe('0x67')](_0x26542a[_0x7abe('0x38')],_0x26542a[_0x7abe('0x74')]);}else if(this[_0x7abe('0x35')](_0x26542a['variable'][_0x7abe('0x75')])){this['channels'][_0x26542a[_0x7abe('0x38')]]['calleridnum']=_0x26542a[_0x7abe('0x74')];}else if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')][_0x7abe('0x76')])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]][_0x7abe('0x77')]=_0x26542a[_0x7abe('0x74')];}else if(this['isNotNull'](_0x26542a[_0x7abe('0x72')]['xmd-cdrtype'])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]][_0x7abe('0x78')]=_0x26542a[_0x7abe('0x74')];}else if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')][_0x7abe('0x79')])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]]['queue']=_0x26542a[_0x7abe('0x74')][_0x7abe('0x45')](',')[0x0];}else if(this['isNotNull'](_0x26542a[_0x7abe('0x72')][_0x7abe('0x7a')])){this['channels'][_0x26542a['uniqueid']][_0x7abe('0x7b')]=_0x26542a[_0x7abe('0x74')];}else if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')][_0x7abe('0x7c')])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]][_0x7abe('0x7d')]=_0x26542a[_0x7abe('0x74')];}else if(this['isNotNull'](_0x26542a[_0x7abe('0x72')]['xmd-callerid-preview'])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]][_0x7abe('0x7e')]=_0x26542a[_0x7abe('0x74')];}else if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')][_0x7abe('0x7f')])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x38')]]['queue']=_0x26542a[_0x7abe('0x74')];}else if(this[_0x7abe('0x35')](_0x26542a[_0x7abe('0x72')]['sipcallid'])){this['channels'][_0x26542a['uniqueid']]['sipcalluniqueid']=_0x26542a[_0x7abe('0x74')];}}}else if(this['isNotNull'](_0x26542a[_0x7abe('0x72')][_0x7abe('0x73')])){if(_0x26542a[_0x7abe('0x74')]){var _0x3a7261=path['parse'](_0x26542a[_0x7abe('0x74')])[_0x7abe('0x49')];this[_0x7abe('0x67')](_0x3a7261,_0x26542a[_0x7abe('0x74')]);}}else if(this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x3c')]]){if(this['isNotNull'](_0x26542a[_0x7abe('0x72')])){if(this[_0x7abe('0x35')](_0x26542a['variable'][_0x7abe('0x80')])){this[_0x7abe('0x1d')][_0x26542a[_0x7abe('0x3c')]][_0x7abe('0x81')]=_0x26542a[_0x7abe('0x74')];}}}}}catch(_0x33fbbd){logger[_0x7abe('0x4b')](_0x7abe('0x82'),util[_0x7abe('0x4d')](_0x33fbbd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x29')]=function(_0x33cd64){try{if(this[_0x7abe('0x35')](_0x33cd64)){if(this[_0x7abe('0x1d')][_0x33cd64['uniqueid']]){var _0x111e81=moment();this[_0x7abe('0x1d')][_0x33cd64['uniqueid']]['endtime']=_0x111e81[_0x7abe('0x3f')](_0x7abe('0x55'));this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]]['duration']=_0x111e81[_0x7abe('0x5e')](this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]][_0x7abe('0x3e')],_0x7abe('0x54'));if(this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]]['answered']){this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]][_0x7abe('0x83')]=_0x111e81[_0x7abe('0x5e')](this[_0x7abe('0x1d')][_0x33cd64['uniqueid']][_0x7abe('0x84')],_0x7abe('0x54'));this[_0x7abe('0x1d')][_0x33cd64['uniqueid']][_0x7abe('0x5d')]=this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]][_0x7abe('0x52')]-this['channels'][_0x33cd64[_0x7abe('0x38')]][_0x7abe('0x83')];}if(_0x33cd64[_0x7abe('0x43')]===_0x7abe('0x44')){if(this[_0x7abe('0x1e')][_0x33cd64['channel'][_0x7abe('0x45')]('-')[0x0]]){this[_0x7abe('0x1e')][_0x33cd64['channel']['split']('-')[0x0]]=_['omit'](this[_0x7abe('0x1e')][_0x33cd64[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]],[_0x7abe('0x46')]);this[_0x7abe('0x36')](util[_0x7abe('0x3f')](_0x7abe('0x48'),this[_0x7abe('0x1e')][_0x33cd64[_0x7abe('0x3d')][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x49')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x33cd64['channel'][_0x7abe('0x45')]('-')[0x0]][_0x7abe('0x4a')]});}}ami[_0x7abe('0x36')](_0x7abe('0x85'),this[_0x7abe('0x1d')][_0x33cd64[_0x7abe('0x38')]]);delete this['channels'][_0x33cd64[_0x7abe('0x38')]];}}}catch(_0x4c61ca){logger[_0x7abe('0x4b')](_0x7abe('0x86'),util['inspect'](_0x4c61ca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x87')]=function(_0x127209){try{if(this[_0x7abe('0x35')](_0x127209)){if(this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x88')]]){this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x88')]]['transfercalleridnum']=_0x127209[_0x7abe('0x89')];this[_0x7abe('0x1d')][_0x127209['transfereeuniqueid']][_0x7abe('0x8a')]=_0x127209[_0x7abe('0x8b')];if(this['channels'][_0x127209[_0x7abe('0x8c')]]){var _0xf98472=this[_0x7abe('0x1d')][_0x127209['secondtransfereruniqueid']];this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x8c')]]=this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x88')]];this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x88')]]=_0xf98472;}}else if(this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x8d')]]){this[_0x7abe('0x1d')][_0x127209['transfertargetuniqueid']][_0x7abe('0x8e')]=_0x127209[_0x7abe('0x89')];this[_0x7abe('0x1d')][_0x127209['transfertargetuniqueid']][_0x7abe('0x8a')]=_0x127209['transfertargetcalleridnum'];if(this[_0x7abe('0x1d')][_0x127209['origtransfereruniqueid']]){var _0xf98472=this['channels'][_0x127209[_0x7abe('0x8f')]];this[_0x7abe('0x1d')][_0x127209['origtransfereruniqueid']]=this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x8d')]];this[_0x7abe('0x1d')][_0x127209[_0x7abe('0x8d')]]=_0xf98472;}}}}catch(_0x1ff976){logger[_0x7abe('0x4b')](_0x7abe('0x90'),util[_0x7abe('0x4d')](_0x1ff976,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x91')]=function(_0x1e5a34){try{if(this[_0x7abe('0x35')](_0x1e5a34)){if(this[_0x7abe('0x1d')][_0x1e5a34[_0x7abe('0x88')]]){this[_0x7abe('0x1d')][_0x1e5a34[_0x7abe('0x88')]][_0x7abe('0x8e')]=_0x1e5a34['transfereecalleridnum'];this['channels'][_0x1e5a34[_0x7abe('0x88')]][_0x7abe('0x8a')]=_0x1e5a34['extension'];this[_0x7abe('0x29')]({'event':_0x7abe('0x92'),'uniqueid':_0x1e5a34['transfereeuniqueid'],'context':_0x1e5a34[_0x7abe('0x43')],'channel':_0x1e5a34[_0x7abe('0x93')]});}}}catch(_0x5e32b8){logger[_0x7abe('0x4b')](_0x7abe('0x94'),util['inspect'](_0x5e32b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')]['syncMusicOnHoldStart']=function(_0x44b635){try{if(this[_0x7abe('0x35')](_0x44b635)){if(this[_0x7abe('0x1d')][_0x44b635[_0x7abe('0x38')]]){if(!_['isNil'](this[_0x7abe('0x1d')][_0x44b635[_0x7abe('0x38')]][_0x7abe('0x84')])){this['channels'][_0x44b635['uniqueid']]['mohstarttime']=moment()['format'](_0x7abe('0x55'));}}}}catch(_0x3ca5e9){logger[_0x7abe('0x4b')](_0x7abe('0x95'),util[_0x7abe('0x4d')](_0x3ca5e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7abe('0x34')][_0x7abe('0x2f')]=function(_0x4f09e0){try{if(this['isNotNull'](_0x4f09e0)){if(this[_0x7abe('0x1d')][_0x4f09e0[_0x7abe('0x38')]]){if(!_[_0x7abe('0x6f')](this['channels'][_0x4f09e0[_0x7abe('0x38')]][_0x7abe('0x96')])){this[_0x7abe('0x1d')][_0x4f09e0[_0x7abe('0x38')]][_0x7abe('0x97')]+=moment()[_0x7abe('0x98')](0x0)[_0x7abe('0x5e')](this['channels'][_0x4f09e0[_0x7abe('0x38')]][_0x7abe('0x96')],'seconds');delete this[_0x7abe('0x1d')][_0x4f09e0[_0x7abe('0x38')]][_0x7abe('0x96')];}}}}catch(_0x56afc3){logger[_0x7abe('0x4b')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x7abe('0x4d')](_0x56afc3,{'showHidden':![],'depth':null}));}};module[_0x7abe('0x99')]=VoiceCallReport; \ No newline at end of file +var _0x8075=['transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','util','ioredis','../../../config/environment','ami','../ami','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','prototype','isNotNull','linkedid','uniqueid','merge','pick','keys','inspect','channel','OutgoingSpoolFailed','isUndefined','starttime','format','disposition','toNumber','channelstate','context','split','exten','emit','user:%s','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','toLowerCase','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','application','lastapplication','lastdata','startsWith','cdr(','queue','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','endtime','billableseconds','answertime','from-sip','omit','destconnectedlinenum','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum'];(function(_0x3a1b13,_0x196daa){var _0xd620ca=function(_0x25909b){while(--_0x25909b){_0x3a1b13['push'](_0x3a1b13['shift']());}};_0xd620ca(++_0x196daa);}(_0x8075,0xab));var _0x5807=function(_0x5f419f,_0xe9b7fd){_0x5f419f=_0x5f419f-0x0;var _0x4c37f0=_0x8075[_0x5f419f];return _0x4c37f0;};'use strict';var BPromise=require(_0x5807('0x0'));var _=require(_0x5807('0x1'));var moment=require('moment');var util=require(_0x5807('0x2'));var path=require('path');var Redis=require(_0x5807('0x3'));var config=require(_0x5807('0x4'));var logger=require('../../../config/logger')(_0x5807('0x5'));var ami=require(_0x5807('0x6'));var Channel=require('../model/channel');var statusDesc=['unknown',_0x5807('0x7'),'inuse',_0x5807('0x8'),_0x5807('0x9'),_0x5807('0xa'),_0x5807('0xb'),_0x5807('0xc'),_0x5807('0xd')];var applications=['set','queue',_0x5807('0xe'),_0x5807('0xf'),_0x5807('0x10'),_0x5807('0x11')];var dispositions=[_0x5807('0x12'),_0x5807('0x13'),_0x5807('0x13'),_0x5807('0x12'),_0x5807('0x12'),_0x5807('0x12'),_0x5807('0x14'),'BUSY',_0x5807('0x13'),_0x5807('0x13'),_0x5807('0x13')];var actions={};config[_0x5807('0x15')]=_[_0x5807('0x16')](config[_0x5807('0x15')],{'host':_0x5807('0x17'),'port':0x18eb});var io=require(_0x5807('0x18'))(new Redis(config[_0x5807('0x15')]));function VoiceCallReport(_0x3d5972){this[_0x5807('0x19')]=_0x3d5972[_0x5807('0x19')];this[_0x5807('0x1a')]=_0x3d5972[_0x5807('0x1a')];ami['on'](_0x5807('0x1b'),this[_0x5807('0x1c')][_0x5807('0x1d')](this));ami['on'](_0x5807('0x1e'),this['syncNewExten'][_0x5807('0x1d')](this));ami['on'](_0x5807('0x1f'),this[_0x5807('0x20')][_0x5807('0x1d')](this));ami['on'](_0x5807('0x21'),this['syncNewState'][_0x5807('0x1d')](this));ami['on'](_0x5807('0x22'),this[_0x5807('0x23')][_0x5807('0x1d')](this));ami['on']('hangup',this[_0x5807('0x24')][_0x5807('0x1d')](this));ami['on'](_0x5807('0x25'),this[_0x5807('0x26')][_0x5807('0x1d')](this));ami['on'](_0x5807('0x27'),this[_0x5807('0x28')][_0x5807('0x1d')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x5807('0x1d')](this));ami['on'](_0x5807('0x29'),this[_0x5807('0x2a')]['bind'](this));ami['on'](_0x5807('0x2b'),this[_0x5807('0x2c')]['bind'](this));return BPromise[_0x5807('0x2d')]()[_0x5807('0x2e')](ami[_0x5807('0x2f')]())['catch'](function(_0x4410ca){console[_0x5807('0x30')](_0x4410ca);});}VoiceCallReport[_0x5807('0x31')][_0x5807('0x32')]=function(_0x5a42b9){return _0x5a42b9!==null&&!_['isUndefined'](_0x5a42b9);};VoiceCallReport[_0x5807('0x31')]['emit']=function(_0x6c3519,_0x73ac38,_0x2532e2){io['to'](_0x6c3519)['emit'](_0x73ac38,_0x2532e2);};VoiceCallReport[_0x5807('0x31')]['syncNewCallerId']=function(_0x4c7550){try{if(this[_0x5807('0x32')](_0x4c7550)){if(_0x4c7550['uniqueid']===_0x4c7550[_0x5807('0x33')]){if(!_['isUndefined'](this[_0x5807('0x19')][_0x4c7550[_0x5807('0x34')]])){_[_0x5807('0x35')](this[_0x5807('0x19')][_0x4c7550[_0x5807('0x34')]],_[_0x5807('0x36')](_0x4c7550,_[_0x5807('0x37')](this['channels'][_0x4c7550[_0x5807('0x34')]])));}}}}catch(_0xbd762c){logger['error']('[syncNewCallerId][VoiceCallReport]',util[_0x5807('0x38')](_0xbd762c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x20')]=function(_0x1bb0cf){try{if(this[_0x5807('0x32')](_0x1bb0cf)){if(_0x1bb0cf[_0x5807('0x34')]===_0x1bb0cf['linkedid']&&_0x1bb0cf[_0x5807('0x39')]!=_0x5807('0x3a')){if(_[_0x5807('0x3b')](this[_0x5807('0x19')][_0x1bb0cf['uniqueid']])){this[_0x5807('0x19')][_0x1bb0cf[_0x5807('0x34')]]=new Channel();this[_0x5807('0x19')][_0x1bb0cf[_0x5807('0x34')]][_0x5807('0x3c')]=moment()[_0x5807('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5807('0x19')][_0x1bb0cf[_0x5807('0x34')]][_0x5807('0x3e')]=dispositions[_[_0x5807('0x3f')](_0x1bb0cf[_0x5807('0x40')])];_[_0x5807('0x35')](this[_0x5807('0x19')][_0x1bb0cf['uniqueid']],_[_0x5807('0x36')](_0x1bb0cf,_[_0x5807('0x37')](this['channels'][_0x1bb0cf[_0x5807('0x34')]])));if(_0x1bb0cf[_0x5807('0x41')]==='from-sip'){if(this[_0x5807('0x1a')][_0x1bb0cf[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]){this['agents'][_0x1bb0cf['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x1bb0cf[_0x5807('0x43')];this[_0x5807('0x44')](util[_0x5807('0x3d')](_0x5807('0x45'),this[_0x5807('0x1a')][_0x1bb0cf[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]][_0x5807('0x46')]),_0x5807('0x47'),{'destaccountcode':this[_0x5807('0x1a')][_0x1bb0cf[_0x5807('0x39')]['split']('-')[0x0]][_0x5807('0x48')],'destconnectedlinenum':_0x1bb0cf[_0x5807('0x43')]});}}}}}}catch(_0x32769e){logger[_0x5807('0x49')](_0x5807('0x4a'),util[_0x5807('0x38')](_0x32769e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x1c')]=function(_0x116bab){try{if(this['isNotNull'](_0x116bab)){if(_0x116bab[_0x5807('0x34')]===_0x116bab[_0x5807('0x33')]&&_0x116bab['exten']!='h'&&_0x116bab[_0x5807('0x39')]!=_0x5807('0x3a')){_0x116bab['application']=_0x116bab['application'][_0x5807('0x4b')]();_0x116bab[_0x5807('0x4c')]=(_0x116bab[_0x5807('0x4d')]||_0x116bab[_0x5807('0x4c')])[_0x5807('0x4b')]();if(_[_0x5807('0x3b')](this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]])){this['channels'][_0x116bab[_0x5807('0x34')]]=new Channel();this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]][_0x5807('0x3c')]=_0x116bab[_0x5807('0x4e')]?moment()[_0x5807('0x4f')](moment['duration'](_0x116bab['duration'])[_0x5807('0x50')](),_0x5807('0x50'))[_0x5807('0x3d')](_0x5807('0x51')):moment()['format'](_0x5807('0x51'));this['channels'][_0x116bab[_0x5807('0x34')]]['disposition']=_0x5807('0x12');}_[_0x5807('0x35')](this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]],_[_0x5807('0x36')](_0x116bab,_[_0x5807('0x37')](this[_0x5807('0x19')][_0x116bab['uniqueid']])));if(_[_0x5807('0x52')](applications,_0x116bab[_0x5807('0x53')])){this['channels'][_0x116bab[_0x5807('0x34')]][_0x5807('0x54')]=_0x116bab[_0x5807('0x53')];this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]][_0x5807('0x55')]=_0x116bab[_0x5807('0x4c')];if(_0x116bab[_0x5807('0x53')]==='set'&&_[_0x5807('0x56')](_0x116bab[_0x5807('0x4c')],_0x5807('0x57'))){var _0x4b086b=_0x116bab['applicationdata']['split']('=');var _0x538435=_0x4b086b[0x0]['match'](/cdr\((.*)\)/);if(_0x538435){this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]][_0x538435[0x1]]=_0x4b086b[0x1];}}else if(_0x116bab['application']===_0x5807('0x58')){this[_0x5807('0x19')][_0x116bab[_0x5807('0x34')]][_0x5807('0x58')]=_0x116bab[_0x5807('0x4c')]['split'](',')[0x0];}}}}}catch(_0x5e54fd){logger[_0x5807('0x49')](_0x5807('0x59'),util[_0x5807('0x38')](_0x5e54fd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')]['syncNewState']=function(_0x16cee4){try{if(this[_0x5807('0x32')](_0x16cee4)){if(_0x16cee4[_0x5807('0x34')]!==_0x16cee4[_0x5807('0x33')]){if(this['channels'][_0x16cee4['linkedid']]){if(_0x16cee4['channelstate']==='6'){if(!this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x5a')]){var _0x5cff22=moment();this['channels'][_0x16cee4[_0x5807('0x33')]][_0x5807('0x5a')]=!![];this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]]['answertime']=_0x5cff22[_0x5807('0x3d')](_0x5807('0x51'));if(this['channels'][_0x16cee4[_0x5807('0x33')]][_0x5807('0x3c')]){this[_0x5807('0x19')][_0x16cee4['linkedid']][_0x5807('0x5b')]=_0x5cff22[_0x5807('0x5c')](this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x3c')],_0x5807('0x50'));}}this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]]['linkedid']=_0x16cee4[_0x5807('0x34')];if(_0x16cee4[_0x5807('0x5d')]!==_0x5807('0x5e')){this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x5f')]=_0x16cee4[_0x5807('0x5d')];}this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x60')]=_0x16cee4['calleridname'];this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x61')]=_0x16cee4['channel'];this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]][_0x5807('0x3e')]=dispositions[_[_0x5807('0x3f')](_0x16cee4[_0x5807('0x40')])];if(this[_0x5807('0x1a')][_0x16cee4[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]){this[_0x5807('0x19')][_0x16cee4[_0x5807('0x33')]]['UserId']=this[_0x5807('0x1a')][_0x16cee4[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]['id'];this['channels'][_0x16cee4[_0x5807('0x33')]][_0x5807('0x62')]=this[_0x5807('0x1a')][_0x16cee4['channel']['split']('-')[0x0]]['name'];}}}}else{if(this[_0x5807('0x19')][_0x16cee4['uniqueid']]){if(_0x16cee4[_0x5807('0x40')]==='6'){if(this[_0x5807('0x1a')][_0x16cee4[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]){this[_0x5807('0x19')][_0x16cee4[_0x5807('0x34')]][_0x5807('0x63')]=this[_0x5807('0x1a')][_0x16cee4[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]['id'];this[_0x5807('0x19')][_0x16cee4[_0x5807('0x34')]][_0x5807('0x62')]=this[_0x5807('0x1a')][_0x16cee4[_0x5807('0x39')]['split']('-')[0x0]]['name'];}}}}}}catch(_0x1af270){logger[_0x5807('0x49')](_0x5807('0x64'),util[_0x5807('0x38')](_0x1af270,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5807('0x65')]=function(_0x17124a,_0x371a0f){if(this[_0x5807('0x19')][_0x17124a]){this[_0x5807('0x19')][_0x17124a]['monitor']=!![];if(_[_0x5807('0x66')](_0x371a0f,'.wav49')){_0x371a0f=_0x371a0f[_0x5807('0x67')]('.wav49',_0x5807('0x68'));}this[_0x5807('0x19')][_0x17124a][_0x5807('0x69')]=_0x371a0f;var _0x94d186=_[_0x5807('0x6a')](this['channels'][_0x17124a][_0x5807('0x6b')],{'filename':_0x371a0f});if(_[_0x5807('0x6c')](_0x94d186)){this[_0x5807('0x19')][_0x17124a][_0x5807('0x6b')][_0x5807('0x6d')]({'filename':_0x371a0f,'createdAt':moment()[_0x5807('0x3d')](_0x5807('0x51')),'mixmonitorid':'','status':_0x5807('0x6e')});}}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x23')]=function(_0x1d6626){try{if(this['isNotNull'](_0x1d6626)){if(this[_0x5807('0x19')][_0x1d6626[_0x5807('0x34')]]&&_0x1d6626[_0x5807('0x39')]!=_0x5807('0x3a')){if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')])){if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')][_0x5807('0x70')])){this[_0x5807('0x65')](_0x1d6626[_0x5807('0x34')],_0x1d6626[_0x5807('0x71')]);}else if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')]['xmd-phone'])){this[_0x5807('0x19')][_0x1d6626['uniqueid']][_0x5807('0x5d')]=_0x1d6626[_0x5807('0x71')];}else if(this['isNotNull'](_0x1d6626[_0x5807('0x6f')][_0x5807('0x72')])){this[_0x5807('0x19')][_0x1d6626['uniqueid']][_0x5807('0x73')]=_0x1d6626[_0x5807('0x71')];}else if(this[_0x5807('0x32')](_0x1d6626['variable'][_0x5807('0x74')])){this['channels'][_0x1d6626['uniqueid']][_0x5807('0x75')]=_0x1d6626['value'];}else if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')][_0x5807('0x76')])){this[_0x5807('0x19')][_0x1d6626[_0x5807('0x34')]]['queue']=_0x1d6626[_0x5807('0x71')][_0x5807('0x42')](',')[0x0];}else if(this['isNotNull'](_0x1d6626[_0x5807('0x6f')][_0x5807('0x77')])){this[_0x5807('0x19')][_0x1d6626['uniqueid']][_0x5807('0x78')]=_0x1d6626[_0x5807('0x71')];}else if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')][_0x5807('0x79')])){this[_0x5807('0x19')][_0x1d6626['uniqueid']][_0x5807('0x7a')]=_0x1d6626['value'];}else if(this[_0x5807('0x32')](_0x1d6626['variable'][_0x5807('0x7b')])){this[_0x5807('0x19')][_0x1d6626['uniqueid']]['calleridpreview']=_0x1d6626['value'];}else if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')]['xmcs-queue'])){this[_0x5807('0x19')][_0x1d6626['uniqueid']][_0x5807('0x58')]=_0x1d6626[_0x5807('0x71')];}else if(this[_0x5807('0x32')](_0x1d6626['variable'][_0x5807('0x7c')])){this[_0x5807('0x19')][_0x1d6626[_0x5807('0x34')]][_0x5807('0x7d')]=_0x1d6626[_0x5807('0x71')];}}}else if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')]['mixmonitor_filename'])){if(_0x1d6626[_0x5807('0x71')]){var _0x18a957=path[_0x5807('0x7e')](_0x1d6626[_0x5807('0x71')])[_0x5807('0x46')];this[_0x5807('0x65')](_0x18a957,_0x1d6626[_0x5807('0x71')]);}}else if(this[_0x5807('0x19')][_0x1d6626[_0x5807('0x33')]]){if(this[_0x5807('0x32')](_0x1d6626['variable'])){if(this[_0x5807('0x32')](_0x1d6626[_0x5807('0x6f')][_0x5807('0x7c')])){this[_0x5807('0x19')][_0x1d6626['linkedid']]['sipcalllinkedid']=_0x1d6626[_0x5807('0x71')];}}}}}catch(_0x30798a){logger[_0x5807('0x49')](_0x5807('0x7f'),util[_0x5807('0x38')](_0x30798a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x24')]=function(_0x6992ef){try{if(this[_0x5807('0x32')](_0x6992ef)){if(this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]]){var _0x5cf35f=moment();this[_0x5807('0x19')][_0x6992ef['uniqueid']][_0x5807('0x80')]=_0x5cf35f[_0x5807('0x3d')](_0x5807('0x51'));this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x4e')]=_0x5cf35f[_0x5807('0x5c')](this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x3c')],_0x5807('0x50'));if(this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x5a')]){this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x81')]=_0x5cf35f[_0x5807('0x5c')](this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x82')],_0x5807('0x50'));this[_0x5807('0x19')][_0x6992ef['uniqueid']]['holdtime']=this[_0x5807('0x19')][_0x6992ef['uniqueid']]['duration']-this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]][_0x5807('0x81')];}if(_0x6992ef[_0x5807('0x41')]===_0x5807('0x83')){if(this[_0x5807('0x1a')][_0x6992ef[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]){this[_0x5807('0x1a')][_0x6992ef[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]]=_[_0x5807('0x84')](this[_0x5807('0x1a')][_0x6992ef[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]],[_0x5807('0x85')]);this['emit'](util[_0x5807('0x3d')]('user:%s',this['agents'][_0x6992ef[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]][_0x5807('0x46')]),_0x5807('0x86'),{'destaccountcode':this[_0x5807('0x1a')][_0x6992ef[_0x5807('0x39')][_0x5807('0x42')]('-')[0x0]][_0x5807('0x48')]});}}ami[_0x5807('0x44')](_0x5807('0x87'),this['channels'][_0x6992ef[_0x5807('0x34')]]);delete this[_0x5807('0x19')][_0x6992ef[_0x5807('0x34')]];}}}catch(_0x46537b){logger[_0x5807('0x49')](_0x5807('0x88'),util[_0x5807('0x38')](_0x46537b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')]['syncAttendedTransfer']=function(_0x36083b){try{if(this['isNotNull'](_0x36083b)){if(this['channels'][_0x36083b[_0x5807('0x89')]]){this[_0x5807('0x19')][_0x36083b[_0x5807('0x89')]][_0x5807('0x8a')]=_0x36083b['origtransferercalleridnum'];this[_0x5807('0x19')][_0x36083b['transfereeuniqueid']][_0x5807('0x8b')]=_0x36083b['transfertargetcalleridnum'];if(this[_0x5807('0x19')][_0x36083b['secondtransfereruniqueid']]){var _0x5ab20e=this[_0x5807('0x19')][_0x36083b[_0x5807('0x8c')]];this[_0x5807('0x19')][_0x36083b['secondtransfereruniqueid']]=this[_0x5807('0x19')][_0x36083b[_0x5807('0x89')]];this['channels'][_0x36083b[_0x5807('0x89')]]=_0x5ab20e;}}else if(this[_0x5807('0x19')][_0x36083b[_0x5807('0x8d')]]){this['channels'][_0x36083b['transfertargetuniqueid']][_0x5807('0x8a')]=_0x36083b[_0x5807('0x8e')];this[_0x5807('0x19')][_0x36083b[_0x5807('0x8d')]][_0x5807('0x8b')]=_0x36083b[_0x5807('0x8f')];if(this[_0x5807('0x19')][_0x36083b[_0x5807('0x90')]]){var _0x5ab20e=this[_0x5807('0x19')][_0x36083b[_0x5807('0x90')]];this[_0x5807('0x19')][_0x36083b[_0x5807('0x90')]]=this['channels'][_0x36083b[_0x5807('0x8d')]];this['channels'][_0x36083b['transfertargetuniqueid']]=_0x5ab20e;}}}}catch(_0x436b68){logger[_0x5807('0x49')](_0x5807('0x91'),util['inspect'](_0x436b68,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')]['syncBlindTransfer']=function(_0x17e696){try{if(this['isNotNull'](_0x17e696)){if(this['channels'][_0x17e696[_0x5807('0x89')]]){this['channels'][_0x17e696['transfereeuniqueid']][_0x5807('0x8a')]=_0x17e696[_0x5807('0x92')];this[_0x5807('0x19')][_0x17e696[_0x5807('0x89')]]['transferconnectedlinenum']=_0x17e696[_0x5807('0x93')];this[_0x5807('0x24')]({'event':'BlindTransfer','uniqueid':_0x17e696[_0x5807('0x89')],'context':_0x17e696[_0x5807('0x41')],'channel':_0x17e696[_0x5807('0x94')]});}}}catch(_0x5386a8){logger[_0x5807('0x49')](_0x5807('0x95'),util[_0x5807('0x38')](_0x5386a8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x2a')]=function(_0x32b843){try{if(this[_0x5807('0x32')](_0x32b843)){if(this[_0x5807('0x19')][_0x32b843[_0x5807('0x34')]]){if(!_['isNil'](this[_0x5807('0x19')][_0x32b843[_0x5807('0x34')]][_0x5807('0x82')])){this[_0x5807('0x19')][_0x32b843[_0x5807('0x34')]]['mohstarttime']=moment()['format'](_0x5807('0x51'));}}}}catch(_0x2fc4af){logger[_0x5807('0x49')](_0x5807('0x96'),util[_0x5807('0x38')](_0x2fc4af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5807('0x31')][_0x5807('0x2c')]=function(_0x3c0519){try{if(this['isNotNull'](_0x3c0519)){if(this[_0x5807('0x19')][_0x3c0519[_0x5807('0x34')]]){if(!_[_0x5807('0x6c')](this[_0x5807('0x19')][_0x3c0519[_0x5807('0x34')]][_0x5807('0x97')])){this['channels'][_0x3c0519[_0x5807('0x34')]][_0x5807('0x98')]+=moment()['milliseconds'](0x0)[_0x5807('0x5c')](this[_0x5807('0x19')][_0x3c0519['uniqueid']][_0x5807('0x97')],_0x5807('0x50'));delete this['channels'][_0x3c0519['uniqueid']][_0x5807('0x97')];}}}}catch(_0x505ee1){logger[_0x5807('0x49')](_0x5807('0x99'),util[_0x5807('0x38')](_0x505ee1,{'showHidden':![],'depth':null}));}};module[_0x5807('0x9a')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index c3fb485..f8f13b4 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 _0x6d4e=['memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','syncHangup','endtime','duration','diff','starttime','seconds','complete','total','answered','holdtime','answertime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','isNotNull','isUndefined','prototype','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','custom:dialconnect','[syncDialEnd][VoiceDialReport]','inspect','addVariable','variable','value','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls'];(function(_0x1bf3df,_0x45b20d){var _0x4e937e=function(_0x4711d6){while(--_0x4711d6){_0x1bf3df['push'](_0x1bf3df['shift']());}};_0x4e937e(++_0x45b20d);}(_0x6d4e,0x12e));var _0xe6d4=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0x6d4e[_0xf5d71c];return _0x5af672;};'use strict';var _=require(_0xe6d4('0x0'));var moment=require(_0xe6d4('0x1'));var util=require(_0xe6d4('0x2'));var Redis=require(_0xe6d4('0x3'));var config=require(_0xe6d4('0x4'));var logger=require(_0xe6d4('0x5'))(_0xe6d4('0x6'));var ami=require(_0xe6d4('0x7'));config[_0xe6d4('0x8')]=_[_0xe6d4('0x9')](config[_0xe6d4('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe6d4('0xa'))(new Redis(config[_0xe6d4('0x8')]));function VoiceDialReport(_0x5e56b2){this[_0xe6d4('0xb')]=_0x5e56b2[_0xe6d4('0xc')];this[_0xe6d4('0xd')]=_0x5e56b2[_0xe6d4('0xd')];this[_0xe6d4('0xe')]={};ami['on'](_0xe6d4('0xf'),this[_0xe6d4('0x10')][_0xe6d4('0x11')](this));ami['on'](_0xe6d4('0x12'),this['syncDialEnd'][_0xe6d4('0x11')](this));ami['on'](_0xe6d4('0x13'),this[_0xe6d4('0x14')][_0xe6d4('0x11')](this));ami['on']('hangup',this['syncHangup'][_0xe6d4('0x11')](this));}VoiceDialReport['prototype'][_0xe6d4('0x15')]=function(_0x5a6189){return _0x5a6189!==null&&!_[_0xe6d4('0x16')](_0x5a6189);};VoiceDialReport[_0xe6d4('0x17')][_0xe6d4('0x18')]=function(_0x3eefc7,_0x45a10e,_0x704b9b){io['to'](_0x3eefc7)[_0xe6d4('0x18')](_0x45a10e,_0x704b9b);};VoiceDialReport[_0xe6d4('0x17')][_0xe6d4('0x10')]=function(_0x38cd9c){try{if(this[_0xe6d4('0x15')](_0x38cd9c)){if(this['channels'][_0x38cd9c[_0xe6d4('0x19')]]){_[_0xe6d4('0x1a')](this[_0xe6d4('0xb')][_0x38cd9c[_0xe6d4('0x19')]],{'starttime':moment()[_0xe6d4('0x1b')](_0xe6d4('0x1c')),'lastevent':_0xe6d4('0x1d'),'interface':_0x38cd9c[_0xe6d4('0x1e')][_0xe6d4('0x1f')](0x0,_0x38cd9c[_0xe6d4('0x1e')][_0xe6d4('0x20')]('-')),'membername':_0x38cd9c[_0xe6d4('0x1e')][_0xe6d4('0x1f')](_0x38cd9c[_0xe6d4('0x1e')][_0xe6d4('0x20')]('/')+0x1,_0x38cd9c[_0xe6d4('0x1e')]['lastIndexOf']('-'))},_[_0xe6d4('0x21')](_0x38cd9c,[_0xe6d4('0x22'),'privilege']));this[_0xe6d4('0x18')](_0xe6d4('0x23'),_0xe6d4('0x24'),this[_0xe6d4('0xb')][_0x38cd9c[_0xe6d4('0x19')]]);ami[_0xe6d4('0x18')](_0xe6d4('0x25'),this[_0xe6d4('0xb')][_0x38cd9c[_0xe6d4('0x19')]]);}}}catch(_0x415815){logger[_0xe6d4('0x26')](_0xe6d4('0x27'),util['inspect'](_0x415815,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe6d4('0x17')][_0xe6d4('0x28')]=function(_0x1c51af){try{if(this[_0xe6d4('0x15')](_0x1c51af)){if(this[_0xe6d4('0xb')][_0x1c51af[_0xe6d4('0x19')]]){this['channels'][_0x1c51af[_0xe6d4('0x19')]][_0xe6d4('0x29')]=_0x1c51af[_0xe6d4('0x29')];if(_0x1c51af[_0xe6d4('0x29')]===_0xe6d4('0x2a')){this['channels'][_0x1c51af['uniqueid']][_0xe6d4('0x2b')]=_0x1c51af['connectedlinenum'];this['channels'][_0x1c51af[_0xe6d4('0x19')]][_0xe6d4('0x2c')]=_0x1c51af[_0xe6d4('0x2c')];this['channels'][_0x1c51af[_0xe6d4('0x19')]]['answertime']=moment()[_0xe6d4('0x1b')](_0xe6d4('0x1c'));this['channels'][_0x1c51af[_0xe6d4('0x19')]][_0xe6d4('0x2d')]='connect';ami[_0xe6d4('0x18')](_0xe6d4('0x2e'),this[_0xe6d4('0xb')][_0x1c51af['uniqueid']]);}this['emit']('voice:outbound',_0xe6d4('0x24'),this[_0xe6d4('0xb')][_0x1c51af[_0xe6d4('0x19')]]);}}}catch(_0x4260f2){logger[_0xe6d4('0x26')](_0xe6d4('0x2f'),util[_0xe6d4('0x30')](_0x4260f2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe6d4('0x17')][_0xe6d4('0x14')]=function(_0x59e9ad){try{if(this[_0xe6d4('0x15')](_0x59e9ad)){this[_0xe6d4('0x31')](_0x59e9ad[_0xe6d4('0x19')],_['keys'](_0x59e9ad[_0xe6d4('0x32')])[0x0],_0x59e9ad[_0xe6d4('0x33')]);if(this['isNotNull'](_0x59e9ad[_0xe6d4('0x32')])&&this[_0xe6d4('0x15')](_0x59e9ad['variable']['outboundrouteid'])){if(_[_0xe6d4('0x16')](this[_0xe6d4('0xb')][_0x59e9ad[_0xe6d4('0x19')]])){this['channels'][_0x59e9ad[_0xe6d4('0x19')]]={'routeId':_0x59e9ad[_0xe6d4('0x33')],'variables':this[_0xe6d4('0xe')][_0x59e9ad[_0xe6d4('0x19')]]};this[_0xe6d4('0x18')](_0xe6d4('0x23'),_0xe6d4('0x24'),this[_0xe6d4('0xb')][_0x59e9ad[_0xe6d4('0x19')]]);}}}}catch(_0x24c1d1){logger[_0xe6d4('0x26')](_0xe6d4('0x34'),util[_0xe6d4('0x30')](_0x24c1d1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe6d4('0x17')][_0xe6d4('0x31')]=function(_0x39c592,_0x17693b,_0x45d73f){var _0x1c36eb=['rtpaudioqos',_0xe6d4('0x35'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xe6d4('0x36'),_0xe6d4('0x37'),_0xe6d4('0x38'),_0xe6d4('0x39'),_0xe6d4('0x3a'),_0xe6d4('0x3b'),'bridgepeer',_0xe6d4('0x3c'),_0xe6d4('0x3d'),'memberdynamic','memberinterface',_0xe6d4('0x3e'),_0xe6d4('0x3f'),_0xe6d4('0x40'),_0xe6d4('0x41')];if(!_[_0xe6d4('0x42')](_0x17693b)&&!_[_0xe6d4('0x43')](_0x1c36eb,_0x17693b)){if(_[_0xe6d4('0x16')](this['variables'][_0x39c592])){this[_0xe6d4('0xe')][_0x39c592]={};}this[_0xe6d4('0xe')][_0x39c592][_0x17693b]=_0x45d73f;}};VoiceDialReport['prototype'][_0xe6d4('0x44')]=function(_0x345d6f){try{if(this[_0xe6d4('0x15')](_0x345d6f)){if(this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]){this[_0xe6d4('0xb')][_0x345d6f['uniqueid']][_0xe6d4('0x45')]=moment()[_0xe6d4('0x1b')](_0xe6d4('0x1c'));this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x46')]=moment(this[_0xe6d4('0xb')][_0x345d6f['uniqueid']]['endtime'])[_0xe6d4('0x47')](this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x48')],_0xe6d4('0x49'));this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x2d')]=_0xe6d4('0x4a');this[_0xe6d4('0xd')][_0xe6d4('0x4b')]+=0x1;if(this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]['answertime']){this[_0xe6d4('0xd')][_0xe6d4('0x4c')]+=0x1;this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x4d')]=moment(this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x4e')])[_0xe6d4('0x47')](this['channels'][_0x345d6f['uniqueid']]['starttime'],_0xe6d4('0x49'));this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x4f')]=moment(this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]][_0xe6d4('0x45')])['diff'](this[_0xe6d4('0xb')][_0x345d6f['uniqueid']]['answertime'],'seconds');this[_0xe6d4('0xd')][_0xe6d4('0x50')]+=this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]['holdtime']||0x0;this[_0xe6d4('0xd')][_0xe6d4('0x51')]+=this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]['billableseconds'];}this[_0xe6d4('0xd')][_0xe6d4('0x52')]+=this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]['duration'];ami[_0xe6d4('0x18')](_0xe6d4('0x53'),this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]);ami['emit'](_0xe6d4('0x54'),this[_0xe6d4('0xb')][_0x345d6f['uniqueid']]);this[_0xe6d4('0x18')](_0xe6d4('0x23'),'voice_outbound:save',this['outbound']);logger[_0xe6d4('0x55')](_0xe6d4('0x56'),JSON[_0xe6d4('0x57')](this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]));this['emit']('voice:outbound',_0xe6d4('0x58'),this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]]);delete this[_0xe6d4('0xb')][_0x345d6f[_0xe6d4('0x19')]];}if(this[_0xe6d4('0xe')][_0x345d6f[_0xe6d4('0x19')]]){delete this['variables'][_0x345d6f['uniqueid']];}}}catch(_0x10e253){logger[_0xe6d4('0x26')](_0xe6d4('0x59'),util['inspect'](_0x10e253,{'showHidden':![],'depth':null}));}};module[_0xe6d4('0x5a')]=VoiceDialReport; \ No newline at end of file +var _0xfef5=['memberpenalty','memberrealtime','isNil','includes','endtime','duration','seconds','complete','total','answertime','answered','holdtime','diff','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:dialend','voice_outbound:save','info','stringify','voice_outbound_channel:remove','lodash','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','syncDialEnd','bind','varset','syncVarSet','hangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','channels','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','format','lastevent','connect','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','memberdynamic','memberlastcall','membername'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xfef5,0x6d));var _0x5fef=function(_0xab7dec,_0x1a9c27){_0xab7dec=_0xab7dec-0x0;var _0x42b3da=_0xfef5[_0xab7dec];return _0x42b3da;};'use strict';var _=require(_0x5fef('0x0'));var moment=require('moment');var util=require(_0x5fef('0x1'));var Redis=require(_0x5fef('0x2'));var config=require(_0x5fef('0x3'));var logger=require(_0x5fef('0x4'))('ami');var ami=require(_0x5fef('0x5'));config[_0x5fef('0x6')]=_[_0x5fef('0x7')](config[_0x5fef('0x6')],{'host':_0x5fef('0x8'),'port':0x18eb});var io=require(_0x5fef('0x9'))(new Redis(config[_0x5fef('0x6')]));function VoiceDialReport(_0x5e550b){this['channels']=_0x5e550b[_0x5fef('0xa')];this[_0x5fef('0xb')]=_0x5e550b[_0x5fef('0xb')];this[_0x5fef('0xc')]={};ami['on'](_0x5fef('0xd'),this[_0x5fef('0xe')]['bind'](this));ami['on']('dialend',this[_0x5fef('0xf')][_0x5fef('0x10')](this));ami['on'](_0x5fef('0x11'),this[_0x5fef('0x12')][_0x5fef('0x10')](this));ami['on'](_0x5fef('0x13'),this['syncHangup'][_0x5fef('0x10')](this));}VoiceDialReport[_0x5fef('0x14')][_0x5fef('0x15')]=function(_0x317a76){return _0x317a76!==null&&!_[_0x5fef('0x16')](_0x317a76);};VoiceDialReport[_0x5fef('0x14')][_0x5fef('0x17')]=function(_0x42d67b,_0x564ca1,_0x596998){io['to'](_0x42d67b)[_0x5fef('0x17')](_0x564ca1,_0x596998);};VoiceDialReport['prototype'][_0x5fef('0xe')]=function(_0x42c7a5){try{if(this['isNotNull'](_0x42c7a5)){if(this['channels'][_0x42c7a5[_0x5fef('0x18')]]){_[_0x5fef('0x19')](this[_0x5fef('0x1a')][_0x42c7a5[_0x5fef('0x18')]],{'starttime':moment()['format'](_0x5fef('0x1b')),'lastevent':_0x5fef('0x1c'),'interface':_0x42c7a5['channel'][_0x5fef('0x1d')](0x0,_0x42c7a5[_0x5fef('0x1e')][_0x5fef('0x1f')]('-')),'membername':_0x42c7a5['channel'][_0x5fef('0x1d')](_0x42c7a5[_0x5fef('0x1e')][_0x5fef('0x1f')]('/')+0x1,_0x42c7a5[_0x5fef('0x1e')][_0x5fef('0x1f')]('-'))},_[_0x5fef('0x20')](_0x42c7a5,['event','privilege']));this[_0x5fef('0x17')](_0x5fef('0x21'),_0x5fef('0x22'),this[_0x5fef('0x1a')][_0x42c7a5[_0x5fef('0x18')]]);ami[_0x5fef('0x17')](_0x5fef('0x23'),this['channels'][_0x42c7a5[_0x5fef('0x18')]]);}}}catch(_0xfb2331){logger['error'](_0x5fef('0x24'),util[_0x5fef('0x25')](_0xfb2331,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5fef('0x14')][_0x5fef('0xf')]=function(_0x533c71){try{if(this['isNotNull'](_0x533c71)){if(this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]]){this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]]['dialstatus']=_0x533c71[_0x5fef('0x26')];if(_0x533c71['dialstatus']===_0x5fef('0x27')){this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]][_0x5fef('0x28')]=_0x533c71['connectedlinenum'];this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]][_0x5fef('0x29')]=_0x533c71[_0x5fef('0x29')];this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]]['answertime']=moment()[_0x5fef('0x2a')](_0x5fef('0x1b'));this[_0x5fef('0x1a')][_0x533c71[_0x5fef('0x18')]][_0x5fef('0x2b')]=_0x5fef('0x2c');ami[_0x5fef('0x17')](_0x5fef('0x2d'),this[_0x5fef('0x1a')][_0x533c71['uniqueid']]);}this[_0x5fef('0x17')](_0x5fef('0x21'),'voice_outbound_channel:save',this[_0x5fef('0x1a')][_0x533c71['uniqueid']]);}}}catch(_0x47794e){logger[_0x5fef('0x2e')](_0x5fef('0x2f'),util[_0x5fef('0x25')](_0x47794e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5fef('0x14')]['syncVarSet']=function(_0x5ab28a){try{if(this['isNotNull'](_0x5ab28a)){this[_0x5fef('0x30')](_0x5ab28a[_0x5fef('0x18')],_[_0x5fef('0x31')](_0x5ab28a[_0x5fef('0x32')])[0x0],_0x5ab28a[_0x5fef('0x33')]);if(this[_0x5fef('0x15')](_0x5ab28a[_0x5fef('0x32')])&&this[_0x5fef('0x15')](_0x5ab28a[_0x5fef('0x32')][_0x5fef('0x34')])){if(_['isUndefined'](this[_0x5fef('0x1a')][_0x5ab28a[_0x5fef('0x18')]])){this['channels'][_0x5ab28a[_0x5fef('0x18')]]={'routeId':_0x5ab28a[_0x5fef('0x33')],'variables':this[_0x5fef('0xc')][_0x5ab28a[_0x5fef('0x18')]]};this[_0x5fef('0x17')]('voice:outbound',_0x5fef('0x22'),this[_0x5fef('0x1a')][_0x5ab28a['uniqueid']]);}}}}catch(_0x2a727c){logger['error'](_0x5fef('0x35'),util[_0x5fef('0x25')](_0x2a727c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5fef('0x14')][_0x5fef('0x30')]=function(_0x523a76,_0x4cde7d,_0x15fcad){var _0x3e3ad1=['rtpaudioqos',_0x5fef('0x36'),_0x5fef('0x37'),_0x5fef('0x38'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x5fef('0x39'),_0x5fef('0x3a'),_0x5fef('0x3b'),'sipuri','bridgepeer','bridgepvtcallid','membercalls',_0x5fef('0x3c'),'memberinterface',_0x5fef('0x3d'),_0x5fef('0x3e'),_0x5fef('0x3f'),_0x5fef('0x40')];if(!_[_0x5fef('0x41')](_0x4cde7d)&&!_[_0x5fef('0x42')](_0x3e3ad1,_0x4cde7d)){if(_[_0x5fef('0x16')](this['variables'][_0x523a76])){this[_0x5fef('0xc')][_0x523a76]={};}this[_0x5fef('0xc')][_0x523a76][_0x4cde7d]=_0x15fcad;}};VoiceDialReport[_0x5fef('0x14')]['syncHangup']=function(_0xfb4ec1){try{if(this[_0x5fef('0x15')](_0xfb4ec1)){if(this[_0x5fef('0x1a')][_0xfb4ec1['uniqueid']]){this[_0x5fef('0x1a')][_0xfb4ec1['uniqueid']][_0x5fef('0x43')]=moment()[_0x5fef('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x44')]=moment(this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x43')])['diff'](this[_0x5fef('0x1a')][_0xfb4ec1['uniqueid']]['starttime'],_0x5fef('0x45'));this[_0x5fef('0x1a')][_0xfb4ec1['uniqueid']][_0x5fef('0x2b')]=_0x5fef('0x46');this['outbound'][_0x5fef('0x47')]+=0x1;if(this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x48')]){this[_0x5fef('0xb')][_0x5fef('0x49')]+=0x1;this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x4a')]=moment(this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x48')])[_0x5fef('0x4b')](this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x4c')],_0x5fef('0x45'));this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x4d')]=moment(this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x43')])[_0x5fef('0x4b')](this['channels'][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x48')],_0x5fef('0x45'));this[_0x5fef('0xb')][_0x5fef('0x4e')]+=this['channels'][_0xfb4ec1['uniqueid']]['holdtime']||0x0;this[_0x5fef('0xb')][_0x5fef('0x4f')]+=this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]]['billableseconds'];}this[_0x5fef('0xb')][_0x5fef('0x50')]+=this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]][_0x5fef('0x44')];ami[_0x5fef('0x17')]('custom:voiceDialReport',this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]]);ami[_0x5fef('0x17')](_0x5fef('0x51'),this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]]);this[_0x5fef('0x17')](_0x5fef('0x21'),_0x5fef('0x52'),this[_0x5fef('0xb')]);logger[_0x5fef('0x53')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x5fef('0x54')](this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]]));this[_0x5fef('0x17')](_0x5fef('0x21'),_0x5fef('0x55'),this[_0x5fef('0x1a')][_0xfb4ec1[_0x5fef('0x18')]]);delete this['channels'][_0xfb4ec1['uniqueid']];}if(this['variables'][_0xfb4ec1[_0x5fef('0x18')]]){delete this['variables'][_0xfb4ec1[_0x5fef('0x18')]];}}}catch(_0x11b638){logger[_0x5fef('0x2e')]('[syncHangup][VoiceDialReport]',util['inspect'](_0x11b638,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 72a4e9c..f06b5d9 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 _0x3abe=['countBy','callers','toNumber','talking','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfer','transfertype','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','value','variable','queuestatus','CONTINUE','lastevent','timeout','custom:timeout','queuecallerleaveAt','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','length','abandoned','diff','milliseconds','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','transferexten','ATTENDED','secondtransfereruniqueid','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','context','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','localhost','prototype','enqueue','finally','queueReports','agents','queueChannels','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','isNil','Action','status','channel','message','No\x20such\x20channel','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','error','[voiceQueueReport][checkVariables]','clearQueueReport','voiceQueues','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','Trunk','callerid','Interval','voice_queue:save','isNotNull','catch','then','[queuesummary]','syncQueueSummary','queue'];(function(_0x4bc1ba,_0x4b05c3){var _0xe303ff=function(_0x309167){while(--_0x309167){_0x4bc1ba['push'](_0x4bc1ba['shift']());}};_0xe303ff(++_0x4b05c3);}(_0x3abe,0x12a));var _0xe3ab=function(_0xd753d0,_0x58d909){_0xd753d0=_0xd753d0-0x0;var _0x3b0510=_0x3abe[_0xd753d0];return _0x3b0510;};'use strict';var _=require(_0xe3ab('0x0'));var moment=require(_0xe3ab('0x1'));var BPromise=require(_0xe3ab('0x2'));var util=require(_0xe3ab('0x3'));var md5=require(_0xe3ab('0x4'));var Redis=require(_0xe3ab('0x5'));var config=require(_0xe3ab('0x6'));var logger=require(_0xe3ab('0x7'))(_0xe3ab('0x8'));var ami=require(_0xe3ab('0x9'));var QueueReport=require('../model/queueReport');config['redis']=_[_0xe3ab('0xa')](config['redis'],{'host':_0xe3ab('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe3ab('0xc')][_0xe3ab('0xd')]=function(_0x32992c){this['tail']=this['tail']?this['tail'][_0xe3ab('0xe')](_0x32992c):_0x32992c();};function VoiceQueueReport(_0xa041c9){this['sequence']=new Sequence();this[_0xe3ab('0xf')]={};this['agents']=_0xa041c9[_0xe3ab('0x10')];this['channels']=_0xa041c9[_0xe3ab('0x11')];this['voiceQueues']=_0xa041c9['voiceQueues'];this[_0xe3ab('0x12')]=!![];this['campaigns']=_0xa041c9[_0xe3ab('0x13')];this[_0xe3ab('0x14')]={};ami['on'](_0xe3ab('0x15'),this['syncQueueSummary'][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x17'),this[_0xe3ab('0x18')][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x19'),this[_0xe3ab('0x1a')][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x1b'),this[_0xe3ab('0x1c')][_0xe3ab('0x16')](this));ami['on']('queuecallerleave',this[_0xe3ab('0x1d')][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x1e'),this[_0xe3ab('0x1f')]['bind'](this));ami['on'](_0xe3ab('0x20'),this[_0xe3ab('0x21')][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x22'),this[_0xe3ab('0x23')][_0xe3ab('0x16')](this));ami['on']('hangup',this[_0xe3ab('0x24')][_0xe3ab('0x16')](this));ami['on']('fullybooted',this[_0xe3ab('0x25')][_0xe3ab('0x16')](this));ami['on']('musiconholdstart',this[_0xe3ab('0x26')][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x27'),this[_0xe3ab('0x28')]['bind'](this));ami['on'](_0xe3ab('0x29'),this['syncAttendedTransfer'][_0xe3ab('0x16')](this));ami['on'](_0xe3ab('0x2a'),this['syncBlindTransfer'][_0xe3ab('0x16')](this));this[_0xe3ab('0x2b')]();this['loopQueueShow']();}function isNotNull(_0x3b40b0){return _0x3b40b0!==null&&!_[_0xe3ab('0x2c')](_0x3b40b0);}function clearChannels(_0x577682){if(!_[_0xe3ab('0x2d')](_0x577682)){for(var _0x3a9da1 in _0x577682){if(_0x577682[_0xe3ab('0x2e')](_0x3a9da1)){delete _0x577682[_0x3a9da1];}}}}function clearCampaigns(_0x51dc7a){if(!_['isEmpty'](_0x51dc7a)){for(var _0x519cb6 in _0x51dc7a){if(_0x51dc7a[_0xe3ab('0x2e')](_0x519cb6)){_0x51dc7a[_0x519cb6]['originated']=0x0;}}}}function clearVoiceQueues(_0x49105e){if(!_[_0xe3ab('0x2d')](_0x49105e)){for(var _0x40ddc2 in _0x49105e){if(_0x49105e[_0xe3ab('0x2e')](_0x40ddc2)){_0x49105e[_0x40ddc2][_0xe3ab('0x2f')]=0x0;_0x49105e[_0x40ddc2]['talking']=0x0;_0x49105e[_0x40ddc2][_0xe3ab('0x30')]=0x0;_0x49105e[_0x40ddc2][_0xe3ab('0x31')]=0x0;_0x49105e[_0x40ddc2][_0xe3ab('0x32')]=!![];}}}}function clearAgentBooked(_0x11fb50){if(!_['isEmpty'](_0x11fb50)){for(var _0x1139dd in _0x11fb50){if(_0x11fb50[_0xe3ab('0x2e')](_0x1139dd)){_0x11fb50[_0x1139dd][_0xe3ab('0x33')]=!![];}}}}VoiceQueueReport['prototype'][_0xe3ab('0x34')]=function(){var _0xb5f9ad=this;for(var _0x227ec8 in this[_0xe3ab('0x35')]){if(this[_0xe3ab('0x35')]['hasOwnProperty'](_0x227ec8)&&!this[_0xe3ab('0x35')][_0x227ec8]['switch']){this['sequence'][_0xe3ab('0xd')](function(){if(!_[_0xe3ab('0x36')](_0xb5f9ad[_0xe3ab('0x35')][_0x227ec8])){return ami[_0xe3ab('0x37')]({'action':_0xe3ab('0x38'),'channel':_0xb5f9ad['channels'][_0x227ec8][_0xe3ab('0x39')]})['catch'](function(_0x5ddd19){if(_0x5ddd19[_0xe3ab('0x3a')]===_0xe3ab('0x3b')){setTimeout(function(){if(_0xb5f9ad[_0xe3ab('0x35')][_0x227ec8]){delete _0xb5f9ad[_0xe3ab('0x35')][_0x227ec8];logger['error'](_0xe3ab('0x3c'),_0x227ec8);}if(_0xb5f9ad[_0xe3ab('0xf')][_0x227ec8]){delete _0xb5f9ad[_0xe3ab('0xf')][_0x227ec8];logger['error'](_0xe3ab('0x3d'),_0x227ec8);}if(_0xb5f9ad[_0xe3ab('0x14')][_0x227ec8]){delete _0xb5f9ad[_0xe3ab('0x14')][_0x227ec8];logger[_0xe3ab('0x3e')](_0xe3ab('0x3f'),_0x227ec8);}},0x1f40);}});}});}}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x25')]=function(){logger[_0xe3ab('0x3e')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xe3ab('0x35')]);this[_0xe3ab('0x40')](this[_0xe3ab('0xf')]);clearAgentBooked(this[_0xe3ab('0x10')]);clearVoiceQueues(this[_0xe3ab('0x41')]);clearCampaigns(this[_0xe3ab('0x13')]);};VoiceQueueReport[_0xe3ab('0xc')]['clearQueueReport']=function(_0x1164e9){var _0x584137=this;if(!_[_0xe3ab('0x2d')](_0x1164e9)){for(var _0x5d758c in _0x1164e9){if(_0x1164e9[_0xe3ab('0x2e')](_0x5d758c)){_0x584137['emitVoiceQueueChannelRemove'](_0x1164e9[_0x5d758c]);delete _0x1164e9[_0x5d758c];}}}};function loggerCatch(_0x36ae00){return function(_0xbcd5ef){logger[_0xe3ab('0x3e')](_0x36ae00,util[_0xe3ab('0x42')](_0xbcd5ef,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x43')]=function(_0x242eac,_0x2fceb4,_0x3b44e7){io['to'](_0x242eac)[_0xe3ab('0x43')](_0x2fceb4,_0x3b44e7);};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x44')]=function(_0x3015c3){this[_0xe3ab('0x43')](util[_0xe3ab('0x45')](_0xe3ab('0x46'),_0x3015c3[_0xe3ab('0x47')]),_0xe3ab('0x48'),_0x3015c3);};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x49')]=function(_0x173b3b){logger[_0xe3ab('0x4a')](_0xe3ab('0x4b'),JSON[_0xe3ab('0x4c')](_0x173b3b));this[_0xe3ab('0x43')](util[_0xe3ab('0x45')]('voice:queue:%s',_0x173b3b[_0xe3ab('0x47')]),'voice_queue_channel:remove',_0x173b3b);};VoiceQueueReport[_0xe3ab('0xc')]['emitVoiceQueueSummary']=function(_0x1af1e7){if(_0x1af1e7['type']===_0xe3ab('0x4d')){var _0x56c93f={'id':_0x1af1e7['id'],'name':_0x1af1e7[_0xe3ab('0x47')],'strategy':_0x1af1e7[_0xe3ab('0x4e')],'answered':_0x1af1e7[_0xe3ab('0x4f')],'available':_0x1af1e7[_0xe3ab('0x50')],'loggedIn':_0x1af1e7[_0xe3ab('0x51')],'pTalking':_0x1af1e7[_0xe3ab('0x30')],'sumBillable':_0x1af1e7[_0xe3ab('0x52')],'sumDuration':_0x1af1e7[_0xe3ab('0x53')],'sumHoldTime':_0x1af1e7[_0xe3ab('0x54')]||0x0,'talking':_0x1af1e7['talking'],'total':_0x1af1e7[_0xe3ab('0x55')],'type':_0x1af1e7[_0xe3ab('0x56')],'unmanaged':_0x1af1e7[_0xe3ab('0x57')],'abandoned':_0x1af1e7['abandoned'],'waiting':_0x1af1e7[_0xe3ab('0x31')]};if(_0x1af1e7[_0xe3ab('0x58')]){_0x56c93f[_0xe3ab('0x58')]={'id':_0x1af1e7[_0xe3ab('0x58')]['id'],'name':_0x1af1e7[_0xe3ab('0x58')][_0xe3ab('0x47')],'active':_0x1af1e7[_0xe3ab('0x58')]['active'],'callerid':_0x1af1e7[_0xe3ab('0x58')][_0xe3ab('0x59')]};}if(_0x1af1e7[_0xe3ab('0x5a')]){_0x56c93f[_0xe3ab('0x5a')]={'id':_0x1af1e7['Interval']['id'],'name':_0x1af1e7[_0xe3ab('0x5a')][_0xe3ab('0x47')]};}var _0x56bb12=md5(JSON[_0xe3ab('0x4c')](_0x56c93f));if(_0x1af1e7[_0xe3ab('0x4')]!==_0x56bb12){_0x1af1e7[_0xe3ab('0x4')]=_0x56bb12;this[_0xe3ab('0x43')](util[_0xe3ab('0x45')](_0xe3ab('0x46'),_0x56c93f[_0xe3ab('0x47')]),_0xe3ab('0x5b'),_0x56c93f);}}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x5c')]=function(_0x8a96da){return _0x8a96da!==null&&!_[_0xe3ab('0x2c')](_0x8a96da);};VoiceQueueReport[_0xe3ab('0xc')]['loopQueueShow']=function(){var _0x5eb440=this;setInterval(function(){_0x5eb440['clearZombieChannels']();ami['Action']({'action':'queues'})[_0xe3ab('0x5d')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x2b')]=function(){var _0x40b394=this;setInterval(function(){if(_0x40b394[_0xe3ab('0x12')]){return ami[_0xe3ab('0x37')]({'action':_0xe3ab('0x15')})[_0xe3ab('0x5e')](function(_0x4e64aa){_0x40b394[_0xe3ab('0x12')]=![];})[_0xe3ab('0x5d')](loggerCatch(_0xe3ab('0x5f')));}},0x3e8);};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x60')]=function(_0x1b154d){try{if(this[_0xe3ab('0x5c')](_0x1b154d)&&this[_0xe3ab('0x5c')](_0x1b154d[_0xe3ab('0x61')])){if(this['voiceQueues'][_0x1b154d[_0xe3ab('0x61')]]){var _0xc0bed3=_[_0xe3ab('0x62')](this[_0xe3ab('0x35')],_0xe3ab('0x61'))[_0x1b154d['queue']]||0x0;var _0x11a42d=_0xc0bed3-_0x1b154d[_0xe3ab('0x63')];if(this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x31')]!==_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x63')])||this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]]['loggedIn']!==_[_0xe3ab('0x64')](_0x1b154d['loggedin'])||this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x50')]!==_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x50')])||this[_0xe3ab('0x41')][_0x1b154d['queue']][_0xe3ab('0x65')]!==_0x11a42d){this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]]['waiting']=_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x63')]);this['voiceQueues'][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x51')]=_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x66')]);this[_0xe3ab('0x41')][_0x1b154d['queue']][_0xe3ab('0x50')]=_[_0xe3ab('0x64')](_0x1b154d['available']);this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x65')]=_0x11a42d>0x0?_0x11a42d:0x0;this[_0xe3ab('0x41')][_0x1b154d['queue']]['talking']=this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x65')]>_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x66')])?_[_0xe3ab('0x64')](_0x1b154d[_0xe3ab('0x66')]):this['voiceQueues'][_0x1b154d[_0xe3ab('0x61')]][_0xe3ab('0x65')];this['emitVoiceQueueSummary'](this[_0xe3ab('0x41')][_0x1b154d[_0xe3ab('0x61')]]);}ami[_0xe3ab('0x43')](_0xe3ab('0x67'),this[_0xe3ab('0x41')][_0x1b154d['queue']]);}}}catch(_0x2c24df){logger[_0xe3ab('0x3e')](_0xe3ab('0x68'),util['inspect'](_0x2c24df,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x18')]=function(_0x3afacc){this[_0xe3ab('0x12')]=!![];};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x69')]=function(_0x36abe5){};VoiceQueueReport['prototype'][_0xe3ab('0x1a')]=function(_0x50fe63){try{if(this['isNotNull'](_0x50fe63)){if(_[_0xe3ab('0x2c')](this['queueReports'][_0x50fe63[_0xe3ab('0x6a')]])){this[_0xe3ab('0xf')][_0x50fe63[_0xe3ab('0x6a')]]=[];this[_0xe3ab('0x35')][_0x50fe63[_0xe3ab('0x6a')]]={};}var _0x537806=new QueueReport();_0x537806['name']=_0x50fe63['queue'];_0x537806[_0xe3ab('0x56')]=this[_0xe3ab('0x41')][_0x537806[_0xe3ab('0x47')]]&&this[_0xe3ab('0x41')][_0x537806['name']][_0xe3ab('0x56')]?this[_0xe3ab('0x41')][_0x537806[_0xe3ab('0x47')]][_0xe3ab('0x56')]||_0xe3ab('0x4d'):_0xe3ab('0x4d');_0x537806[_0xe3ab('0x61')]=_0x50fe63[_0xe3ab('0x61')];_0x537806['queuecallerjoinAt']=moment()[_0xe3ab('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x537806[_0xe3ab('0x6b')]=_0x50fe63['position'];_0x537806[_0xe3ab('0x6c')]=_0x50fe63[_0xe3ab('0x6c')];_[_0xe3ab('0x6d')](_0x537806,_[_0xe3ab('0x6e')](_0x50fe63,_[_0xe3ab('0x6f')](_0x537806)));this[_0xe3ab('0xf')][_0x50fe63[_0xe3ab('0x6a')]][_0xe3ab('0x70')](_0x537806);this[_0xe3ab('0x35')][_0x50fe63[_0xe3ab('0x6a')]]=_0x537806;this[_0xe3ab('0x44')](_0x537806);}}catch(_0x462d41){logger[_0xe3ab('0x3e')](_0xe3ab('0x71'),util[_0xe3ab('0x42')](_0x462d41,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x1c')]=function(_0x2f6613){try{if(this['isNotNull'](_0x2f6613)){if(this[_0xe3ab('0xf')][_0x2f6613[_0xe3ab('0x6a')]]){var _0x32f147=_[_0xe3ab('0x72')](this['queueReports'][_0x2f6613[_0xe3ab('0x6a')]]);_0x32f147[_0xe3ab('0x73')]=![];_0x32f147['queuecallercompleteAt']=null;_0x32f147[_0xe3ab('0x74')]=_0x2f6613[_0xe3ab('0x74')];_0x32f147[_0xe3ab('0x75')]=_0x2f6613['originalposition'];_0x32f147['queuecallerabandon']=!![];_0x32f147['queuecallerabandonAt']=moment()[_0xe3ab('0x45')](_0xe3ab('0x76'));_0x32f147[_0xe3ab('0x77')]=_0xe3ab('0x78');_0x32f147[_0xe3ab('0x79')]=null;this[_0xe3ab('0x35')][_0x2f6613[_0xe3ab('0x6a')]]=_0x32f147;this[_0xe3ab('0x49')](_0x32f147);}}}catch(_0x300f90){logger[_0xe3ab('0x3e')]('[syncQueueCallerAbandon][VoiceQueueReport]',util['inspect'](_0x300f90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3ab('0xc')]['syncQueueCallerLeave']=function(_0x41d3cc){try{if(this[_0xe3ab('0x5c')](_0x41d3cc)){if(this[_0xe3ab('0xf')][_0x41d3cc[_0xe3ab('0x6a')]]){var _0xe06175=_['last'](this[_0xe3ab('0xf')][_0x41d3cc[_0xe3ab('0x6a')]]);_0xe06175['queuecallerleaveAt']=moment()[_0xe3ab('0x45')](_0xe3ab('0x76'));_0xe06175['connectedlinenum']=_0x41d3cc[_0xe3ab('0x7a')];_0xe06175[_0xe3ab('0x7b')]=_0x41d3cc[_0xe3ab('0x7b')];this[_0xe3ab('0x35')][_0x41d3cc['uniqueid']]=_0xe06175;this[_0xe3ab('0x44')](_0xe06175);}}}catch(_0x405b92){logger[_0xe3ab('0x3e')](_0xe3ab('0x7c'),util[_0xe3ab('0x42')](_0x405b92,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x21')]=function(_0xc75fd4){try{if(this[_0xe3ab('0x5c')](_0xc75fd4)){if(this[_0xe3ab('0xf')][_0xc75fd4[_0xe3ab('0x6a')]]){var _0x169a59=_[_0xe3ab('0x72')](this[_0xe3ab('0xf')][_0xc75fd4['uniqueid']]);_0x169a59[_0xe3ab('0x73')]=!![];_0x169a59[_0xe3ab('0x77')]=_0xe3ab('0x7d');}}}catch(_0x594817){logger[_0xe3ab('0x3e')]('[syncAgentConnect][VoiceQueueReport]',util[_0xe3ab('0x42')](_0x594817,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3ab('0xc')][_0xe3ab('0x1f')]=function(_0xdc2198){try{if(this[_0xe3ab('0x5c')](_0xdc2198)){if(this[_0xe3ab('0xf')][_0xdc2198[_0xe3ab('0x6a')]]){var _0x452773=_[_0xe3ab('0x72')](this[_0xe3ab('0xf')][_0xdc2198[_0xe3ab('0x6a')]]);_0x452773[_0xe3ab('0x1b')]=![];_0x452773[_0xe3ab('0x7e')]=null;_0x452773['assigned']=!![];_0x452773[_0xe3ab('0x79')]=_0xdc2198['membername'];_0x452773[_0xe3ab('0x74')]=_0xdc2198[_0xe3ab('0x74')];_0x452773[_0xe3ab('0x73')]=!![];_0x452773[_0xe3ab('0x7f')]=![];_0x452773[_0xe3ab('0x80')]=null;if(!_0x452773['transfer']){if(_0xdc2198[_0xe3ab('0x81')]=='transfer'){_0x452773[_0xe3ab('0x77')]=_0xe3ab('0x82');}else{if(_[_0xe3ab('0x83')](_0xdc2198['channel'][_0xe3ab('0x84')](),_0xe3ab('0x85'))){if(this['queueReports'][_0xdc2198[_0xe3ab('0x86')]]){var _0x1c29cb=_[_0xe3ab('0x72')](this[_0xe3ab('0xf')][_0xdc2198[_0xe3ab('0x86')]]);_0x1c29cb[_0xe3ab('0x73')]=![];_0x1c29cb[_0xe3ab('0x7f')]=!![];_0x1c29cb[_0xe3ab('0x80')]=moment(_0x452773[_0xe3ab('0x87')])[_0xe3ab('0x88')](_0xdc2198[_0xe3ab('0x74')],_0xe3ab('0x89'))[_0xe3ab('0x45')](_0xe3ab('0x76'));_0x1c29cb['queuecallerexitreason']=_0xe3ab('0x8a');_0x1c29cb[_0xe3ab('0x8b')]=!![];_0x1c29cb[_0xe3ab('0x8c')]='FORWARD';_0x1c29cb['transferexten']=_0xdc2198[_0xe3ab('0x8d')];_0x1c29cb[_0xe3ab('0x8e')]=_0xdc2198[_0xe3ab('0x6a')];var _0x30d3f7=this['queueReports'][_0xdc2198[_0xe3ab('0x86')]];this[_0xe3ab('0xf')][_0xdc2198['linkedid']]=this['queueReports'][_0xdc2198[_0xe3ab('0x6a')]];this[_0xe3ab('0xf')][_0xdc2198[_0xe3ab('0x6a')]]=_0x30d3f7;}}else{_0x452773[_0xe3ab('0x77')]=_0xe3ab('0x8f')+_0xdc2198['reason'][_0xe3ab('0x90')]();}}}this['channels'][_0xdc2198[_0xe3ab('0x6a')]]=_0x452773;this[_0xe3ab('0x49')](_0x452773);}}}catch(_0x211767){logger[_0xe3ab('0x3e')](_0xe3ab('0x91'),util['inspect'](_0x211767,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe3ab('0x23')]=function(_0x361d6f){try{if(this['isNotNull'](_0x361d6f)){this['addVariable'](_0x361d6f[_0xe3ab('0x6a')],_[_0xe3ab('0x6f')](_0x361d6f['variable'])[0x0],_0x361d6f[_0xe3ab('0x92')]);if(this[_0xe3ab('0xf')][_0x361d6f[_0xe3ab('0x6a')]]){var _0x417cd1=_[_0xe3ab('0x72')](this['queueReports'][_0x361d6f[_0xe3ab('0x6a')]]);if(_0x417cd1){if(this[_0xe3ab('0x5c')](_0x361d6f[_0xe3ab('0x93')])&&this[_0xe3ab('0x5c')](_0x361d6f['variable'][_0xe3ab('0x94')])){switch(_0x361d6f[_0xe3ab('0x92')]){case _0xe3ab('0x95'):_0x417cd1['queuecallerexit']=![];_0x417cd1[_0xe3ab('0x80')]=null;break;case'TIMEOUT':_0x417cd1[_0xe3ab('0x96')]=_0xe3ab('0x97');ami[_0xe3ab('0x43')](_0xe3ab('0x98'),_0x417cd1);break;default:_0x417cd1[_0xe3ab('0x7f')]=!![];_0x417cd1['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x417cd1['queuecallerleaveAt']=moment()['format'](_0xe3ab('0x76'));}_0x417cd1[_0xe3ab('0x1b')]=![];_0x417cd1[_0xe3ab('0x7e')]=null;_0x417cd1[_0xe3ab('0x77')]=_0x361d6f['value'];this[_0xe3ab('0x35')][_0x361d6f[_0xe3ab('0x6a')]]=_0x417cd1;this[_0xe3ab('0x49')](_0x417cd1);}else if(this['isNotNull'](_0x361d6f['variable'])&&this[_0xe3ab('0x5c')](_0x361d6f[_0xe3ab('0x93')]['queueposition'])){if(!_0x417cd1[_0xe3ab('0x1b')]){_0x417cd1[_0xe3ab('0x7f')]=!![];_0x417cd1[_0xe3ab('0x80')]=moment()[_0xe3ab('0x45')](_0xe3ab('0x76'));_0x417cd1[_0xe3ab('0x77')]='EXITWITHKEY';_0x417cd1[_0xe3ab('0x99')]=moment()[_0xe3ab('0x45')](_0xe3ab('0x76'));this['channels'][_0x361d6f['uniqueid']]=_0x417cd1;}}_0x417cd1[_0xe3ab('0x14')]=this[_0xe3ab('0x14')][_0x361d6f[_0xe3ab('0x6a')]];}}}}catch(_0x44aec9){logger['error'](_0xe3ab('0x9a'),util[_0xe3ab('0x42')](_0x44aec9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe3ab('0x9b')]=function(_0x1a1378,_0x426c28,_0x3d7d8d){var _0x5a66f6=['rtpaudioqos','rtpaudioqosbridged',_0xe3ab('0x9c'),_0xe3ab('0x9d'),_0xe3ab('0x9e'),'rtpaudioqoslossbridged',_0xe3ab('0x9f'),'rtpaudioqosrttbridged',_0xe3ab('0xa0'),_0xe3ab('0xa1'),_0xe3ab('0xa2'),_0xe3ab('0xa3'),_0xe3ab('0xa4'),_0xe3ab('0xa5'),_0xe3ab('0xa6'),'memberlastcall','membername',_0xe3ab('0xa7'),_0xe3ab('0xa8')];if(!_[_0xe3ab('0x36')](_0x426c28)&&!_[_0xe3ab('0xa9')](_0x5a66f6,_0x426c28)){if(_[_0xe3ab('0x2c')](this[_0xe3ab('0x14')][_0x1a1378])){this[_0xe3ab('0x14')][_0x1a1378]={};}this['variables'][_0x1a1378][_0x426c28]=_0x3d7d8d;}};VoiceQueueReport['prototype'][_0xe3ab('0x24')]=function(_0x4b8398){try{if(this['isNotNull'](_0x4b8398)){if(this[_0xe3ab('0xf')][_0x4b8398['uniqueid']]){for(var _0x227334=0x0,_0x5f0b77={};_0x2273340x0?_0xeede3d:0x0;this[_0xfbd2('0x11')][_0x20cda5[_0xfbd2('0x61')]][_0xfbd2('0x4c')]=this[_0xfbd2('0x11')][_0x20cda5[_0xfbd2('0x61')]]['talking']>_[_0xfbd2('0x64')](_0x20cda5[_0xfbd2('0x65')])?_[_0xfbd2('0x64')](_0x20cda5[_0xfbd2('0x65')]):this['voiceQueues'][_0x20cda5['queue']][_0xfbd2('0x4c')];this[_0xfbd2('0x48')](this['voiceQueues'][_0x20cda5[_0xfbd2('0x61')]]);}ami['emit'](_0xfbd2('0x66'),this[_0xfbd2('0x11')][_0x20cda5['queue']]);}}}catch(_0x32448d){logger[_0xfbd2('0x36')](_0xfbd2('0x67'),util[_0xfbd2('0x3c')](_0x32448d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')]['syncQueueSummaryComplete']=function(_0x53b174){this[_0xfbd2('0x5d')]=!![];};VoiceQueueReport['prototype'][_0xfbd2('0x68')]=function(_0x320b13){};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x17')]=function(_0x56623d){try{if(this[_0xfbd2('0x57')](_0x56623d)){if(_['isUndefined'](this[_0xfbd2('0x35')][_0x56623d[_0xfbd2('0x69')]])){this[_0xfbd2('0x35')][_0x56623d['uniqueid']]=[];this[_0xfbd2('0xf')][_0x56623d[_0xfbd2('0x69')]]={};}var _0x274bf9=new QueueReport();_0x274bf9[_0xfbd2('0x46')]=_0x56623d[_0xfbd2('0x61')];_0x274bf9[_0xfbd2('0x4e')]=this['voiceQueues'][_0x274bf9[_0xfbd2('0x46')]]&&this['voiceQueues'][_0x274bf9[_0xfbd2('0x46')]][_0xfbd2('0x4e')]?this['voiceQueues'][_0x274bf9[_0xfbd2('0x46')]][_0xfbd2('0x4e')]||_0xfbd2('0x6a'):_0xfbd2('0x6a');_0x274bf9[_0xfbd2('0x61')]=_0x56623d[_0xfbd2('0x61')];_0x274bf9[_0xfbd2('0x6b')]=moment()[_0xfbd2('0x3f')](_0xfbd2('0x6c'));_0x274bf9[_0xfbd2('0x6d')]=_0x56623d[_0xfbd2('0x6d')];_0x274bf9['count']=_0x56623d[_0xfbd2('0x6e')];_[_0xfbd2('0x6f')](_0x274bf9,_[_0xfbd2('0x70')](_0x56623d,_[_0xfbd2('0x71')](_0x274bf9)));this['queueReports'][_0x56623d[_0xfbd2('0x69')]][_0xfbd2('0x72')](_0x274bf9);this['channels'][_0x56623d['uniqueid']]=_0x274bf9;this[_0xfbd2('0x3e')](_0x274bf9);}}catch(_0x44866a){logger['error'](_0xfbd2('0x73'),util[_0xfbd2('0x3c')](_0x44866a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')]['syncQueueCallerAbandon']=function(_0x571928){try{if(this[_0xfbd2('0x57')](_0x571928)){if(this[_0xfbd2('0x35')][_0x571928[_0xfbd2('0x69')]]){var _0x176c2=_['last'](this[_0xfbd2('0x35')][_0x571928[_0xfbd2('0x69')]]);_0x176c2['queuecallercomplete']=![];_0x176c2['queuecallercompleteAt']=null;_0x176c2['holdtime']=_0x571928[_0xfbd2('0x74')];_0x176c2['originalposition']=_0x571928[_0xfbd2('0x75')];_0x176c2[_0xfbd2('0x18')]=!![];_0x176c2[_0xfbd2('0x76')]=moment()[_0xfbd2('0x3f')](_0xfbd2('0x6c'));_0x176c2[_0xfbd2('0x77')]=_0xfbd2('0x78');_0x176c2['lastAssignedTo']=null;this[_0xfbd2('0xf')][_0x571928[_0xfbd2('0x69')]]=_0x176c2;this[_0xfbd2('0x41')](_0x176c2);}}}catch(_0x1a807a){logger[_0xfbd2('0x36')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xfbd2('0x3c')](_0x1a807a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x1a')]=function(_0x1b124d){try{if(this['isNotNull'](_0x1b124d)){if(this[_0xfbd2('0x35')][_0x1b124d['uniqueid']]){var _0x3a46f5=_[_0xfbd2('0x79')](this[_0xfbd2('0x35')][_0x1b124d['uniqueid']]);_0x3a46f5[_0xfbd2('0x7a')]=moment()[_0xfbd2('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a46f5[_0xfbd2('0x7b')]=_0x1b124d['connectedlinenum'];_0x3a46f5[_0xfbd2('0x7c')]=_0x1b124d[_0xfbd2('0x7c')];this[_0xfbd2('0xf')][_0x1b124d[_0xfbd2('0x69')]]=_0x3a46f5;this[_0xfbd2('0x3e')](_0x3a46f5);}}}catch(_0x19198b){logger[_0xfbd2('0x36')](_0xfbd2('0x7d'),util[_0xfbd2('0x3c')](_0x19198b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x3fd50f){try{if(this[_0xfbd2('0x57')](_0x3fd50f)){if(this[_0xfbd2('0x35')][_0x3fd50f[_0xfbd2('0x69')]]){var _0x4bfbe2=_[_0xfbd2('0x79')](this['queueReports'][_0x3fd50f['uniqueid']]);_0x4bfbe2[_0xfbd2('0x7e')]=!![];_0x4bfbe2[_0xfbd2('0x77')]=_0xfbd2('0x7f');}}}catch(_0x511f2c){logger[_0xfbd2('0x36')](_0xfbd2('0x80'),util[_0xfbd2('0x3c')](_0x511f2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x81')]=function(_0x4f5688){try{if(this[_0xfbd2('0x57')](_0x4f5688)){if(this[_0xfbd2('0x35')][_0x4f5688['uniqueid']]){var _0x436f77=_['last'](this[_0xfbd2('0x35')][_0x4f5688[_0xfbd2('0x69')]]);_0x436f77[_0xfbd2('0x18')]=![];_0x436f77[_0xfbd2('0x76')]=null;_0x436f77['assigned']=!![];_0x436f77['lastAssignedTo']=_0x4f5688[_0xfbd2('0x82')];_0x436f77[_0xfbd2('0x74')]=_0x4f5688[_0xfbd2('0x74')];_0x436f77[_0xfbd2('0x7e')]=!![];_0x436f77[_0xfbd2('0x83')]=![];_0x436f77[_0xfbd2('0x84')]=null;if(!_0x436f77[_0xfbd2('0x85')]){if(_0x4f5688[_0xfbd2('0x86')]=='transfer'){_0x436f77[_0xfbd2('0x77')]=_0xfbd2('0x87');}else{if(_[_0xfbd2('0x88')](_0x4f5688['channel']['toLowerCase'](),_0xfbd2('0x89'))){if(this['queueReports'][_0x4f5688[_0xfbd2('0x8a')]]){var _0x5a10c3=_['last'](this[_0xfbd2('0x35')][_0x4f5688[_0xfbd2('0x8a')]]);_0x5a10c3[_0xfbd2('0x7e')]=![];_0x5a10c3[_0xfbd2('0x83')]=!![];_0x5a10c3[_0xfbd2('0x84')]=moment(_0x436f77['queuecallerjoinAt'])[_0xfbd2('0x8b')](_0x4f5688[_0xfbd2('0x74')],_0xfbd2('0x8c'))[_0xfbd2('0x3f')](_0xfbd2('0x6c'));_0x5a10c3[_0xfbd2('0x77')]=_0xfbd2('0x8d');_0x5a10c3[_0xfbd2('0x85')]=!![];_0x5a10c3[_0xfbd2('0x8e')]=_0xfbd2('0x8f');_0x5a10c3[_0xfbd2('0x90')]=_0x4f5688[_0xfbd2('0x91')];_0x5a10c3['transferuniqueid']=_0x4f5688[_0xfbd2('0x69')];var _0xfe6b57=this[_0xfbd2('0x35')][_0x4f5688[_0xfbd2('0x8a')]];this[_0xfbd2('0x35')][_0x4f5688[_0xfbd2('0x8a')]]=this['queueReports'][_0x4f5688[_0xfbd2('0x69')]];this[_0xfbd2('0x35')][_0x4f5688[_0xfbd2('0x69')]]=_0xfe6b57;}}else{_0x436f77[_0xfbd2('0x77')]=_0xfbd2('0x92')+_0x4f5688[_0xfbd2('0x86')][_0xfbd2('0x93')]();}}}this[_0xfbd2('0xf')][_0x4f5688[_0xfbd2('0x69')]]=_0x436f77;this['emitVoiceQueueChannelRemove'](_0x436f77);}}}catch(_0x9d39d5){logger['error'](_0xfbd2('0x94'),util[_0xfbd2('0x3c')](_0x9d39d5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x1d')]=function(_0x28f316){try{if(this['isNotNull'](_0x28f316)){this['addVariable'](_0x28f316[_0xfbd2('0x69')],_[_0xfbd2('0x71')](_0x28f316[_0xfbd2('0x95')])[0x0],_0x28f316['value']);if(this[_0xfbd2('0x35')][_0x28f316[_0xfbd2('0x69')]]){var _0x9c2ad6=_[_0xfbd2('0x79')](this[_0xfbd2('0x35')][_0x28f316[_0xfbd2('0x69')]]);if(_0x9c2ad6){if(this[_0xfbd2('0x57')](_0x28f316['variable'])&&this[_0xfbd2('0x57')](_0x28f316[_0xfbd2('0x95')][_0xfbd2('0x96')])){switch(_0x28f316[_0xfbd2('0x97')]){case'CONTINUE':_0x9c2ad6[_0xfbd2('0x83')]=![];_0x9c2ad6[_0xfbd2('0x84')]=null;break;case _0xfbd2('0x98'):_0x9c2ad6[_0xfbd2('0x99')]=_0xfbd2('0x9a');ami['emit'](_0xfbd2('0x9b'),_0x9c2ad6);break;default:_0x9c2ad6[_0xfbd2('0x83')]=!![];_0x9c2ad6[_0xfbd2('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9c2ad6[_0xfbd2('0x7a')]=moment()[_0xfbd2('0x3f')](_0xfbd2('0x6c'));}_0x9c2ad6['queuecallerabandon']=![];_0x9c2ad6['queuecallerabandonAt']=null;_0x9c2ad6[_0xfbd2('0x77')]=_0x28f316['value'];this[_0xfbd2('0xf')][_0x28f316['uniqueid']]=_0x9c2ad6;this[_0xfbd2('0x41')](_0x9c2ad6);}else if(this[_0xfbd2('0x57')](_0x28f316[_0xfbd2('0x95')])&&this[_0xfbd2('0x57')](_0x28f316[_0xfbd2('0x95')][_0xfbd2('0x9c')])){if(!_0x9c2ad6[_0xfbd2('0x18')]){_0x9c2ad6[_0xfbd2('0x83')]=!![];_0x9c2ad6[_0xfbd2('0x84')]=moment()[_0xfbd2('0x3f')](_0xfbd2('0x6c'));_0x9c2ad6[_0xfbd2('0x77')]='EXITWITHKEY';_0x9c2ad6[_0xfbd2('0x7a')]=moment()['format'](_0xfbd2('0x6c'));this['channels'][_0x28f316[_0xfbd2('0x69')]]=_0x9c2ad6;}}_0x9c2ad6['variables']=this[_0xfbd2('0x38')][_0x28f316[_0xfbd2('0x69')]];}}}}catch(_0xc5d4b1){logger[_0xfbd2('0x36')](_0xfbd2('0x9d'),util['inspect'](_0xc5d4b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x9e')]=function(_0x1e1759,_0x20dad,_0xcd062d){var _0x4f04c5=[_0xfbd2('0x9f'),_0xfbd2('0xa0'),_0xfbd2('0xa1'),'rtpaudioqosjitterbridged',_0xfbd2('0xa2'),'rtpaudioqoslossbridged',_0xfbd2('0xa3'),'rtpaudioqosrttbridged',_0xfbd2('0xa4'),'sipuri',_0xfbd2('0xa5'),_0xfbd2('0xa6'),_0xfbd2('0xa7'),_0xfbd2('0xa8'),_0xfbd2('0xa9'),_0xfbd2('0xaa'),_0xfbd2('0x82'),_0xfbd2('0xab'),'memberrealtime'];if(!_[_0xfbd2('0x32')](_0x20dad)&&!_[_0xfbd2('0xac')](_0x4f04c5,_0x20dad)){if(_[_0xfbd2('0x29')](this[_0xfbd2('0x38')][_0x1e1759])){this[_0xfbd2('0x38')][_0x1e1759]={};}this[_0xfbd2('0x38')][_0x1e1759][_0x20dad]=_0xcd062d;}};VoiceQueueReport[_0xfbd2('0x9')][_0xfbd2('0x1f')]=function(_0x40f09c){try{if(this[_0xfbd2('0x57')](_0x40f09c)){if(this[_0xfbd2('0x35')][_0x40f09c[_0xfbd2('0x69')]]){for(var _0x36a0aa=0x0,_0x201221={};_0x36a0aa=0x0?moment(_0x1e8374['endtime'])['diff'](_0x1e8374[_0x1b5e('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x1e8374['accountcode'],'data3':_0x1e8374[_0x1b5e('0x1c')],'data4':_0x1e8374['dialstring']||null,'role':_0x1b5e('0x14'),'internal':_0x1e8374[_0x1b5e('0x15')]?_[_0x1b5e('0x16')](_0x1e8374['accountcode']):undefined,'uniqueid':_0x1e8374[_0x1b5e('0x17')]},'log':_0x1b5e('0x7')});}; \ No newline at end of file +var _0x26e8=['interface','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','agent','accountcode','CreateMemberReport','voiceDialReport','membername','starttime','endtime','seconds','outbound','dialstring','toNumber','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','SIP/%s'];(function(_0x16c67e,_0x10fb30){var _0x30d60c=function(_0x49a0ea){while(--_0x49a0ea){_0x16c67e['push'](_0x16c67e['shift']());}};_0x30d60c(++_0x10fb30);}(_0x26e8,0x6c));var _0x826e=function(_0x511f28,_0x172aad){_0x511f28=_0x511f28-0x0;var _0x55a3ee=_0x26e8[_0x511f28];return _0x55a3ee;};'use strict';var moment=require(_0x826e('0x0'));var _=require(_0x826e('0x1'));var util=require(_0x826e('0x2'));var client=require(_0x826e('0x3'));exports[_0x826e('0x4')]=function(_0x3fe5dc){var _0x2c1753=_0x3fe5dc[_0x826e('0x5')]||_0x3fe5dc[_0x826e('0x6')];return client[_0x826e('0x7')]('CreateMemberReport',{'body':{'channel':_0x826e('0x8'),'membername':_0x3fe5dc[_0x826e('0x9')],'interface':_[_0x826e('0xa')](_0x3fe5dc['interface'])?util['format'](_0x826e('0xb'),_0x3fe5dc[_0x826e('0x9')]):_0x3fe5dc[_0x826e('0xc')],'type':_0x826e('0xd'),'enterAt':_0x3fe5dc[_0x826e('0xe')],'exitAt':_0x2c1753,'duration':moment(_0x2c1753)[_0x826e('0xf')](_0x3fe5dc[_0x826e('0xe')],'seconds'),'data1':_0x826e('0x10'),'data2':_0x3fe5dc[_0x826e('0x11')],'data3':_0x3fe5dc[_0x826e('0x12')],'data4':null,'data5':_0x3fe5dc['queue'],'role':_0x826e('0x13'),'internal':_0x3fe5dc['accountcode']?_['toNumber'](_0x3fe5dc[_0x826e('0x14')]):undefined,'uniqueid':_0x3fe5dc['uniqueid']},'log':_0x826e('0x15')});};exports[_0x826e('0x16')]=function(_0x14da3e){return client[_0x826e('0x7')]('CreateMemberReport',{'body':{'channel':_0x826e('0x8'),'membername':_0x14da3e[_0x826e('0x17')],'interface':_0x14da3e[_0x826e('0xc')],'type':_0x826e('0xd'),'enterAt':_0x14da3e[_0x826e('0x18')],'exitAt':_0x14da3e[_0x826e('0x19')],'duration':moment(_0x14da3e[_0x826e('0x19')])['diff'](_0x14da3e[_0x826e('0x18')],'seconds')>=0x0?moment(_0x14da3e[_0x826e('0x19')])['diff'](_0x14da3e[_0x826e('0x18')],_0x826e('0x1a')):null,'data1':_0x826e('0x1b'),'data2':_0x14da3e[_0x826e('0x14')],'data3':_0x14da3e[_0x826e('0x12')],'data4':_0x14da3e[_0x826e('0x1c')]||null,'role':_0x826e('0x13'),'internal':_0x14da3e[_0x826e('0x14')]?_[_0x826e('0x1d')](_0x14da3e['accountcode']):undefined,'uniqueid':_0x14da3e['uniqueid']},'log':_0x826e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index dbbbd62..1a539f6 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 _0x2bc6=['html','../client','getTemplates'];(function(_0x4613ae,_0xd99114){var _0x29eb26=function(_0x355fe8){while(--_0x355fe8){_0x4613ae['push'](_0x4613ae['shift']());}};_0x29eb26(++_0xd99114);}(_0x2bc6,0x163));var _0x62bc=function(_0x3ba671,_0x40d517){_0x3ba671=_0x3ba671-0x0;var _0x1a610d=_0x2bc6[_0x3ba671];return _0x1a610d;};'use strict';var client=require(_0x62bc('0x0'));exports[_0x62bc('0x1')]=function(_0x3b71d5){return function(_0x56939b){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x62bc('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xc29b=['html','../client','getTemplates','Request','GetTemplate'];(function(_0x568fce,_0x17ffd5){var _0x489b7d=function(_0x3e5c3b){while(--_0x3e5c3b){_0x568fce['push'](_0x568fce['shift']());}};_0x489b7d(++_0x17ffd5);}(_0xc29b,0x12d));var _0xbc29=function(_0x38466f,_0x501279){_0x38466f=_0x38466f-0x0;var _0x4c57d3=_0xc29b[_0x38466f];return _0x4c57d3;};'use strict';var client=require(_0xbc29('0x0'));exports[_0xbc29('0x1')]=function(_0x45edb6){return function(_0x5d2fef){return client[_0xbc29('0x2')](_0xbc29('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xbc29('0x4')]},'log':_0xbc29('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 57c72ec..4411072 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 _0xb279=['channel','status','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data4','data5','data6','../client','getTriggers','GetTrigger'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xb279,0x165));var _0x9b27=function(_0x417f13,_0x5821b9){_0x417f13=_0x417f13-0x0;var _0x326c65=_0xb279[_0x417f13];return _0x326c65;};'use strict';var client=require(_0x9b27('0x0'));exports[_0x9b27('0x1')]=function(_0x5491c9){return function(_0x3a3368){return client['Request'](_0x9b27('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9b27('0x3'),_0x9b27('0x4')],'include':[{'model':_0x9b27('0x5'),'as':_0x9b27('0x6'),'attributes':['id',_0x9b27('0x7'),_0x9b27('0x8'),_0x9b27('0x9')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x9b27('0x7'),_0x9b27('0x8'),_0x9b27('0x9')]},{'model':_0x9b27('0xa'),'as':_0x9b27('0xb'),'attributes':['id',_0x9b27('0xc'),_0x9b27('0xd'),_0x9b27('0xe'),'data3',_0x9b27('0xf'),_0x9b27('0x10'),_0x9b27('0x11'),'data7']}]},'log':_0x9b27('0x2')});};}; \ No newline at end of file +var _0x89c1=['name','channel','Condition','field','operator','value','AnyConditions','Action','Actions','action','data2','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x122c58,_0xc9eaaa){var _0x4a1463=function(_0x60abb7){while(--_0x60abb7){_0x122c58['push'](_0x122c58['shift']());}};_0x4a1463(++_0xc9eaaa);}(_0x89c1,0x94));var _0x189c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x89c1[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x189c('0x0'));exports[_0x189c('0x1')]=function(_0x507401){return function(_0x52104f){return client[_0x189c('0x2')](_0x189c('0x3'),{'options':{'raw':![],'attributes':['id',_0x189c('0x4'),_0x189c('0x5'),'status'],'include':[{'model':_0x189c('0x6'),'as':'AllConditions','attributes':['id',_0x189c('0x7'),_0x189c('0x8'),_0x189c('0x9')]},{'model':_0x189c('0x6'),'as':_0x189c('0xa'),'attributes':['id',_0x189c('0x7'),_0x189c('0x8'),_0x189c('0x9')]},{'model':_0x189c('0xb'),'as':_0x189c('0xc'),'attributes':['id',_0x189c('0xd'),'data1',_0x189c('0xe'),_0x189c('0xf'),'data4',_0x189c('0x10'),_0x189c('0x11'),_0x189c('0x12')]}]},'log':_0x189c('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f34ec95..29cf043 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 _0xcd5c=['name','getTrunks','Request','GetTrunk'];(function(_0x54b76c,_0x4596b6){var _0x355906=function(_0x3d32a7){while(--_0x3d32a7){_0x54b76c['push'](_0x54b76c['shift']());}};_0x355906(++_0x4596b6);}(_0xcd5c,0x69));var _0xccd5=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcd5c[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0xccd5('0x0')]=function(_0x3e1fca){return function(_0x265820){return client[_0xccd5('0x1')](_0xccd5('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xccd5('0x3'),'registry']},'log':_0xccd5('0x2')});};}; \ No newline at end of file +var _0xaf4c=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x22182f,_0x4b985e){var _0x2e4536=function(_0x304b67){while(--_0x304b67){_0x22182f['push'](_0x22182f['shift']());}};_0x2e4536(++_0x4b985e);}(_0xaf4c,0x17f));var _0xcaf4=function(_0x51422f,_0x5d884a){_0x51422f=_0x51422f-0x0;var _0x2ce606=_0xaf4c[_0x51422f];return _0x2ce606;};'use strict';var client=require(_0xcaf4('0x0'));exports[_0xcaf4('0x1')]=function(_0x3a9a54){return function(_0x36287c){return client[_0xcaf4('0x2')](_0xcaf4('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcaf4('0x4'),_0xcaf4('0x5')]},'log':_0xcaf4('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index c6b16fa..cd4d383 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 _0xf8a8=['voicePause','phone','mobile','interface','getTelephones','GetUser','telephone','accountcode','internal','savePause','PauseUser','saveUnpause','Request','UnpauseUser','getAgent','ShowUser','agent','lastLoginAt','lastPauseAt','../client','name','email','fullname','online','pauseType'];(function(_0x35b190,_0x340522){var _0x322e9e=function(_0x8911ab){while(--_0x8911ab){_0x35b190['push'](_0x35b190['shift']());}};_0x322e9e(++_0x340522);}(_0xf8a8,0x126));var _0x8f8a=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xf8a8[_0x4c7fb5];return _0x2e10ac;};'use strict';var client=require(_0x8f8a('0x0'));exports['getAgents']=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x8f8a('0x1'),_0x8f8a('0x2'),'accountcode',_0x8f8a('0x3'),_0x8f8a('0x4'),'lastLoginAt',_0x8f8a('0x5'),'lastPauseAt',_0x8f8a('0x6'),_0x8f8a('0x7'),_0x8f8a('0x8'),_0x8f8a('0x9')]},'log':'getAgents'});};};exports[_0x8f8a('0xa')]=function(){return function(){return client['Request'](_0x8f8a('0xb'),{'options':{'raw':!![],'where':{'role':_0x8f8a('0xc')},'attributes':['id',_0x8f8a('0x1'),_0x8f8a('0xd'),_0x8f8a('0xe')]},'log':_0x8f8a('0xa')});};};exports[_0x8f8a('0xf')]=function(_0x5c31aa,_0x1a78d5,_0x4bcfd4){return client['Request'](_0x8f8a('0x10'),{'body':{'type':_0x1a78d5,'uniqueid':_0x4bcfd4},'options':{'where':{'id':_0x5c31aa['id']}},'log':_0x8f8a('0xf')});};exports[_0x8f8a('0x11')]=function(_0x29faae){return client[_0x8f8a('0x12')](_0x8f8a('0x13'),{'body':{},'options':{'where':{'id':_0x29faae['id']}},'log':_0x8f8a('0xf')});};exports[_0x8f8a('0x14')]=function(_0x33d6d7){return client[_0x8f8a('0x12')](_0x8f8a('0x15'),{'options':{'raw':![],'where':{'role':_0x8f8a('0x16'),'id':_0x33d6d7},'attributes':['id',_0x8f8a('0x1'),'email',_0x8f8a('0xd'),_0x8f8a('0x3'),'online',_0x8f8a('0x17'),_0x8f8a('0x5'),_0x8f8a('0x18'),_0x8f8a('0x6'),_0x8f8a('0x9')]},'log':_0x8f8a('0x14')});}; \ No newline at end of file +var _0x2277=['Request','GetUser','agent','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','UnpauseUser','getAgent','email','lastPauseAt','../client','getAgents'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x2277,0xb6));var _0x7227=function(_0x335564,_0x4a2cd1){_0x335564=_0x335564-0x0;var _0x4aeb30=_0x2277[_0x335564];return _0x4aeb30;};'use strict';var client=require(_0x7227('0x0'));exports[_0x7227('0x1')]=function(){return function(){return client[_0x7227('0x2')](_0x7227('0x3'),{'options':{'raw':![],'where':{'role':_0x7227('0x4')},'attributes':['id',_0x7227('0x5'),'email',_0x7227('0x6'),_0x7227('0x7'),_0x7227('0x8'),_0x7227('0x9'),_0x7227('0xa'),'lastPauseAt',_0x7227('0xb'),'phone',_0x7227('0xc'),_0x7227('0xd')]},'log':_0x7227('0x1')});};};exports[_0x7227('0xe')]=function(){return function(){return client[_0x7227('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x7227('0xf')},'attributes':['id',_0x7227('0x5'),'accountcode',_0x7227('0x10')]},'log':_0x7227('0xe')});};};exports[_0x7227('0x11')]=function(_0x13b771,_0x55e156,_0xbae23d){return client[_0x7227('0x2')](_0x7227('0x12'),{'body':{'type':_0x55e156,'uniqueid':_0xbae23d},'options':{'where':{'id':_0x13b771['id']}},'log':'savePause'});};exports['saveUnpause']=function(_0x21e605){return client['Request'](_0x7227('0x13'),{'body':{},'options':{'where':{'id':_0x21e605['id']}},'log':_0x7227('0x11')});};exports[_0x7227('0x14')]=function(_0x50067c){return client[_0x7227('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x7227('0x4'),'id':_0x50067c},'attributes':['id',_0x7227('0x5'),_0x7227('0x15'),'accountcode',_0x7227('0x7'),'online',_0x7227('0x9'),'pauseType',_0x7227('0x16'),'voicePause',_0x7227('0xd')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 22ac16e..957af2e 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 _0x62ed=['update','UpdateVoiceAgentReport','create','CreateVoiceAgentReport'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x62ed,0x18e));var _0xd62e=function(_0x117f99,_0x32cea4){_0x117f99=_0x117f99-0x0;var _0x27dd8c=_0x62ed[_0x117f99];return _0x27dd8c;};'use strict';var client=require('../client');exports[_0xd62e('0x0')]=function(_0xe2aebc){return client['Request'](_0xd62e('0x1'),{'body':_0xe2aebc,'log':_0xd62e('0x1')});};exports[_0xd62e('0x2')]=function(_0x94c426,_0x2c395c,_0x53f931){return client['Request'](_0xd62e('0x3'),{'body':_0x94c426,'options':{'where':{'uniqueid':_0x2c395c,'interface':_0x53f931,'agentcomplete':!![]}},'log':_0xd62e('0x3')});}; \ No newline at end of file +var _0xe5af=['CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','create'];(function(_0x1e0543,_0x4e200d){var _0x21a58e=function(_0x15eba6){while(--_0x15eba6){_0x1e0543['push'](_0x1e0543['shift']());}};_0x21a58e(++_0x4e200d);}(_0xe5af,0xff));var _0xfe5a=function(_0x5c9d6f,_0x5d0b11){_0x5c9d6f=_0x5c9d6f-0x0;var _0x1cdff8=_0xe5af[_0x5c9d6f];return _0x1cdff8;};'use strict';var client=require('../client');exports[_0xfe5a('0x0')]=function(_0x2007b1){return client['Request']('CreateVoiceAgentReport',{'body':_0x2007b1,'log':_0xfe5a('0x1')});};exports['update']=function(_0x5a1f5b,_0x353533,_0x408168){return client[_0xfe5a('0x2')](_0xfe5a('0x3'),{'body':_0x5a1f5b,'options':{'where':{'uniqueid':_0x353533,'interface':_0x408168,'agentcomplete':!![]}},'log':_0xfe5a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ba9864a..a075454 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 _0x4157=['disposition','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format'];(function(_0x188887,_0x1511ad){var _0x1af43a=function(_0x40c630){while(--_0x40c630){_0x188887['push'](_0x188887['shift']());}};_0x1af43a(++_0x1511ad);}(_0x4157,0x1ba));var _0x7415=function(_0x2f49a7,_0xe63f9e){_0x2f49a7=_0x2f49a7-0x0;var _0x551aeb=_0x4157[_0x2f49a7];return _0x551aeb;};'use strict';var moment=require(_0x7415('0x0'));var util=require('util');var _=require(_0x7415('0x1'));var client=require(_0x7415('0x2'));exports[_0x7415('0x3')]=function(_0x46e0c4){return client[_0x7415('0x4')](_0x7415('0x5'),{'body':_[_0x7415('0x6')](_0x46e0c4,{'source':_0x46e0c4[_0x7415('0x7')],'destinationcontext':_0x46e0c4[_0x7415('0x8')],'callerid':_0x46e0c4[_0x7415('0x9')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x7415('0xa')]=function(){return function(){return client[_0x7415('0x4')](_0x7415('0xb'),{'options':{'where':{'type':[_0x7415('0xc')],'createdAt':{'$between':[moment()[_0x7415('0xd')](_0x7415('0xe'))['format'](_0x7415('0xf')),moment()[_0x7415('0x10')](_0x7415('0xe'))[_0x7415('0x11')](_0x7415('0xf'))]}},'attributes':['type',_0x7415('0x12'),'duration','billableseconds']},'log':_0x7415('0x13')});};}; \ No newline at end of file +var _0x6e29=['moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','GetVoiceCallReports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6e29,0x10a));var _0x96e2=function(_0x3c60f7,_0x3ad048){_0x3c60f7=_0x3c60f7-0x0;var _0x46f167=_0x6e29[_0x3c60f7];return _0x46f167;};'use strict';var moment=require(_0x96e2('0x0'));var util=require(_0x96e2('0x1'));var _=require(_0x96e2('0x2'));var client=require('../client');exports['create']=function(_0x2e4b06){return client[_0x96e2('0x3')](_0x96e2('0x4'),{'body':_[_0x96e2('0x5')](_0x2e4b06,{'source':_0x2e4b06[_0x96e2('0x6')],'destinationcontext':_0x2e4b06['context'],'callerid':_0x2e4b06[_0x96e2('0x7')],'amaflags':_0x96e2('0x8')}),'log':_0x96e2('0x4')});};exports[_0x96e2('0x9')]=function(){return function(){return client[_0x96e2('0x3')](_0x96e2('0xa'),{'options':{'where':{'type':[_0x96e2('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x96e2('0xc'))['format'](_0x96e2('0xd')),moment()[_0x96e2('0xe')](_0x96e2('0xc'))[_0x96e2('0xf')](_0x96e2('0xd'))]}},'attributes':[_0x96e2('0x10'),_0x96e2('0x11'),'duration','billableseconds']},'log':_0x96e2('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b2b30cc..26de8b3 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 _0xe2b1=['CreateVoiceDialReport','create','Request'];(function(_0x5f0d4d,_0x4a30d2){var _0xd14c2=function(_0x450232){while(--_0x450232){_0x5f0d4d['push'](_0x5f0d4d['shift']());}};_0xd14c2(++_0x4a30d2);}(_0xe2b1,0x1a8));var _0x1e2b=function(_0x326142,_0x31bb07){_0x326142=_0x326142-0x0;var _0x16ebf5=_0xe2b1[_0x326142];return _0x16ebf5;};'use strict';var client=require('../client');exports[_0x1e2b('0x0')]=function(_0x5ed26c){return client[_0x1e2b('0x1')](_0x1e2b('0x2'),{'body':_0x5ed26c,'log':_0x1e2b('0x2')});}; \ No newline at end of file +var _0x5cc6=['CreateVoiceDialReport','../client','create','Request'];(function(_0x461546,_0x152a89){var _0xf9e527=function(_0x3ff0e5){while(--_0x3ff0e5){_0x461546['push'](_0x461546['shift']());}};_0xf9e527(++_0x152a89);}(_0x5cc6,0x12d));var _0x65cc=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0x5cc6[_0x2142c8];return _0x4286e9;};'use strict';var client=require(_0x65cc('0x0'));exports[_0x65cc('0x1')]=function(_0x5bae03){return client[_0x65cc('0x2')](_0x65cc('0x3'),{'body':_0x5bae03,'log':_0x65cc('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c8c851b..a8efa26 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 _0x0962=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x46828d,_0x155a60){var _0x75212f=function(_0x43fc48){while(--_0x43fc48){_0x46828d['push'](_0x46828d['shift']());}};_0x75212f(++_0x155a60);}(_0x0962,0x116));var _0x2096=function(_0x1f638f,_0xb06346){_0x1f638f=_0x1f638f-0x0;var _0x583077=_0x0962[_0x1f638f];return _0x583077;};'use strict';var client=require(_0x2096('0x0'));exports[_0x2096('0x1')]=function(){return function(){return client[_0x2096('0x2')](_0x2096('0x3'),{'options':{'raw':!![],'attributes':['id',_0x2096('0x4'),_0x2096('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x2096('0x1')});};}; \ No newline at end of file +var _0xc2da=['../client','Request','exten','getVoiceExtensions'];(function(_0x17fbd5,_0x3e8bba){var _0x1aa294=function(_0x173c08){while(--_0x173c08){_0x17fbd5['push'](_0x17fbd5['shift']());}};_0x1aa294(++_0x3e8bba);}(_0xc2da,0x124));var _0xac2d=function(_0x2430de,_0x40394d){_0x2430de=_0x2430de-0x0;var _0x30d356=_0xc2da[_0x2430de];return _0x30d356;};'use strict';var client=require(_0xac2d('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xac2d('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xac2d('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xac2d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e92fc74..80a4682 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 _0x7584=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','mandatoryDispositionPause','active','Interval','Intervals','../client','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject'];(function(_0x6ae7be,_0x3830b2){var _0xff7e70=function(_0x55ce46){while(--_0x55ce46){_0x6ae7be['push'](_0x6ae7be['shift']());}};_0xff7e70(++_0x3830b2);}(_0x7584,0xd4));var _0x4758=function(_0x10c115,_0x147ec2){_0x10c115=_0x10c115-0x0;var _0x165f36=_0x7584[_0x10c115];return _0x165f36;};'use strict';var client=require(_0x4758('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x4758('0x1'),{'options':{'raw':![],'attributes':['id',_0x4758('0x2'),'acw',_0x4758('0x3'),_0x4758('0x4'),_0x4758('0x5'),_0x4758('0x6'),'dialActive',_0x4758('0x7'),'dialLimitChannel',_0x4758('0x8'),_0x4758('0x9'),_0x4758('0xa'),'dialPredictiveOptimizationPercentage',_0x4758('0xb'),'dialOriginateCallerIdName',_0x4758('0xc'),_0x4758('0xd'),_0x4758('0xe'),'dialQueueTimeout',_0x4758('0xf'),_0x4758('0x10'),_0x4758('0x11'),'dialBusyMaxRetry',_0x4758('0x12'),_0x4758('0x13'),_0x4758('0x14'),_0x4758('0x15'),_0x4758('0x16'),_0x4758('0x17'),_0x4758('0x18'),'dialCheckDuplicateType',_0x4758('0x19'),'dialAMDInitialSilence',_0x4758('0x1a'),_0x4758('0x1b'),_0x4758('0x1c'),_0x4758('0x1d'),_0x4758('0x1e'),_0x4758('0x1f'),'dialAMDSilenceThreshold',_0x4758('0x20'),'timeout',_0x4758('0x21'),'dialRecallInQueue','dialOrderByScheduledAt',_0x4758('0x22'),_0x4758('0x23'),_0x4758('0x24'),_0x4758('0x5'),_0x4758('0x25'),_0x4758('0x26'),_0x4758('0x27'),'dialNoSuchNumberMaxRetry',_0x4758('0x28'),_0x4758('0x29'),_0x4758('0x2a'),'dialAbandonedMaxRetry',_0x4758('0x2b'),_0x4758('0x2c'),_0x4758('0x2d'),_0x4758('0x2e'),_0x4758('0x2f'),_0x4758('0x30'),_0x4758('0x31'),_0x4758('0x32')],'include':[{'model':_0x4758('0x33'),'as':_0x4758('0x33'),'attributes':['id','name',_0x4758('0x34'),'active']},{'model':'Pause','as':_0x4758('0x35'),'attributes':['id',_0x4758('0x2')]},{'model':_0x4758('0x33'),'as':'TrunkBackup','attributes':['id',_0x4758('0x2'),'callerid',_0x4758('0x36')]},{'model':'Interval','as':_0x4758('0x37'),'attributes':['id',_0x4758('0x2')],'include':[{'model':_0x4758('0x37'),'as':_0x4758('0x38'),'attributes':['id',_0x4758('0x2'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xd882=['type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','Request','GetVoiceQueue','name','acw','monitor_format'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xd882,0x113));var _0x2d88=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0xd882[_0x561f25];return _0x150e4c;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x2d88('0x0')](_0x2d88('0x1'),{'options':{'raw':![],'attributes':['id',_0x2d88('0x2'),_0x2d88('0x3'),'acwTimeout','autopause',_0x2d88('0x4'),_0x2d88('0x5'),'dialActive',_0x2d88('0x6'),_0x2d88('0x7'),_0x2d88('0x8'),_0x2d88('0x9'),_0x2d88('0xa'),'dialPredictiveOptimizationPercentage',_0x2d88('0xb'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x2d88('0xc'),'dialQueueOptions',_0x2d88('0xd'),_0x2d88('0xe'),'dialCongestionMaxRetry',_0x2d88('0xf'),'dialBusyMaxRetry',_0x2d88('0x10'),_0x2d88('0x11'),_0x2d88('0x12'),'dialGlobalMaxRetry',_0x2d88('0x13'),_0x2d88('0x14'),'dialPrefix',_0x2d88('0x15'),'dialAMDActive',_0x2d88('0x16'),_0x2d88('0x17'),_0x2d88('0x18'),_0x2d88('0x19'),_0x2d88('0x1a'),'dialAMDBetweenWordsSilence',_0x2d88('0x1b'),_0x2d88('0x1c'),'dialAMDMaximumWordLength',_0x2d88('0x1d'),_0x2d88('0x1e'),'dialRecallInQueue',_0x2d88('0x1f'),_0x2d88('0x20'),_0x2d88('0x21'),_0x2d88('0x22'),_0x2d88('0x4'),'strategy',_0x2d88('0x23'),_0x2d88('0x24'),_0x2d88('0x25'),_0x2d88('0x26'),_0x2d88('0x27'),_0x2d88('0x28'),_0x2d88('0x29'),_0x2d88('0x2a'),_0x2d88('0x2b'),'dialMachineRetryFrequency',_0x2d88('0x2c'),'dialAgentRejectRetryFrequency',_0x2d88('0x2d'),_0x2d88('0x2e'),_0x2d88('0x2f')],'include':[{'model':'Trunk','as':_0x2d88('0x30'),'attributes':['id',_0x2d88('0x2'),_0x2d88('0x31'),'active']},{'model':_0x2d88('0x32'),'as':_0x2d88('0x33'),'attributes':['id',_0x2d88('0x2')]},{'model':_0x2d88('0x30'),'as':_0x2d88('0x34'),'attributes':['id',_0x2d88('0x2'),_0x2d88('0x31'),'active']},{'model':'Interval','as':_0x2d88('0x35'),'attributes':['id',_0x2d88('0x2')],'include':[{'model':_0x2d88('0x35'),'as':_0x2d88('0x36'),'attributes':['id',_0x2d88('0x2'),_0x2d88('0x37')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 889ab3e..4f13a0c 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 _0x44f6=['queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandonAt','GetVoiceQueueReports','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerjoinAt'];(function(_0x346e50,_0x498042){var _0x5b2edc=function(_0x1bb5fd){while(--_0x1bb5fd){_0x346e50['push'](_0x346e50['shift']());}};_0x5b2edc(++_0x498042);}(_0x44f6,0x116));var _0x644f=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x44f6[_0x599e60];return _0x468e19;};'use strict';var moment=require('moment');var _=require('lodash');var client=require('../client');exports[_0x644f('0x0')]=function(_0x1ae0c4){return client[_0x644f('0x1')](_0x644f('0x2'),{'body':_0x1ae0c4,'log':_0x644f('0x2')});};exports[_0x644f('0x3')]=function(){return function(){return client[_0x644f('0x1')](_0x644f('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x644f('0x5'))[_0x644f('0x6')](_0x644f('0x7')),moment()[_0x644f('0x8')]('day')[_0x644f('0x6')](_0x644f('0x7'))]}},'attributes':['uniqueid',_0x644f('0x9'),_0x644f('0xa'),_0x644f('0xb'),_0x644f('0xc'),_0x644f('0xd'),_0x644f('0xe'),'queuecallerexitAt','queuecallerabandon',_0x644f('0xf')]},'log':_0x644f('0x10')});};}; \ No newline at end of file +var _0xf70f=['lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0xf70f,0x1b5));var _0xff70=function(_0x110230,_0x9327b4){_0x110230=_0x110230-0x0;var _0xef860f=_0xf70f[_0x110230];return _0xef860f;};'use strict';var moment=require('moment');var _=require(_0xff70('0x0'));var client=require(_0xff70('0x1'));exports[_0xff70('0x2')]=function(_0x1b9e43){return client[_0xff70('0x3')](_0xff70('0x4'),{'body':_0x1b9e43,'log':_0xff70('0x4')});};exports[_0xff70('0x5')]=function(){return function(){return client['Request'](_0xff70('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xff70('0x7')](_0xff70('0x8'))[_0xff70('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xff70('0xa')]('day')['format'](_0xff70('0xb'))]}},'attributes':[_0xff70('0xc'),_0xff70('0xd'),_0xff70('0xe'),'queuecallerleaveAt','queuecallercomplete',_0xff70('0xf'),_0xff70('0x10'),_0xff70('0x11'),'queuecallerabandon',_0xff70('0x12')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 3781ac4..a73c0dc 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 _0xb635=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0xb635,0x11b));var _0x5b63=function(_0x3eba35,_0x1e4788){_0x3eba35=_0x3eba35-0x0;var _0x4ad432=_0xb635[_0x3eba35];return _0x4ad432;};'use strict';var client=require('../client');exports[_0x5b63('0x0')]=function(_0x29f176){return function(){return client[_0x5b63('0x1')](_0x5b63('0x2'),{'options':{'where':{'VoiceQueueId':_0x29f176,'paused':!![]},'raw':!![]},'log':_0x5b63('0x0')});};}; \ No newline at end of file +var _0x2fc2=['Request','getVoiceQueueRtPauses'];(function(_0x473fde,_0x4bc212){var _0x1f34b2=function(_0x3bda4c){while(--_0x3bda4c){_0x473fde['push'](_0x473fde['shift']());}};_0x1f34b2(++_0x4bc212);}(_0x2fc2,0xa7));var _0x22fc=function(_0x4c46de,_0x19f7d5){_0x4c46de=_0x4c46de-0x0;var _0x52b083=_0x2fc2[_0x4c46de];return _0x52b083;};'use strict';var client=require('../client');exports[_0x22fc('0x0')]=function(_0x1426fb){return function(){return client[_0x22fc('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1426fb,'paused':!![]},'raw':!![]},'log':_0x22fc('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index da899a7..be92b30 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 _0x8966=['create','Request','monitorFilename','lodash','../client'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x8966,0x1ed));var _0x6896=function(_0x1f9996,_0x4ba9bb){_0x1f9996=_0x1f9996-0x0;var _0x23c175=_0x8966[_0x1f9996];return _0x23c175;};'use strict';var _=require(_0x6896('0x0'));var client=require(_0x6896('0x1'));exports[_0x6896('0x2')]=function(_0x299b3d){return client[_0x6896('0x3')]('CreateVoiceRecording',{'body':_['merge'](_0x299b3d,{'value':_0x299b3d[_0x6896('0x4')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x2ec3=['merge','lodash','../client','CreateVoiceRecording'];(function(_0x4f41fe,_0x452d4){var _0x1d34ee=function(_0x5a077c){while(--_0x5a077c){_0x4f41fe['push'](_0x4f41fe['shift']());}};_0x1d34ee(++_0x452d4);}(_0x2ec3,0x1c9));var _0x32ec=function(_0x3cd56f,_0x4aed1e){_0x3cd56f=_0x3cd56f-0x0;var _0x37ad71=_0x2ec3[_0x3cd56f];return _0x37ad71;};'use strict';var _=require(_0x32ec('0x0'));var client=require(_0x32ec('0x1'));exports['create']=function(_0x510c6c){return client['Request'](_0x32ec('0x2'),{'body':_[_0x32ec('0x3')](_0x510c6c,{'value':_0x510c6c['monitorFilename']}),'log':_0x32ec('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index b07f421..e773d96 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 _0x3440=['transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename'];(function(_0xff6511,_0x703fd5){var _0x40be3a=function(_0x190615){while(--_0x190615){_0xff6511['push'](_0xff6511['shift']());}};_0x40be3a(++_0x703fd5);}(_0x3440,0xbc));var _0x0344=function(_0x350f68,_0x5b7fe3){_0x350f68=_0x350f68-0x0;var _0x25c858=_0x3440[_0x350f68];return _0x25c858;};'use strict';var client=require(_0x0344('0x0'));exports[_0x0344('0x1')]=function(_0x52adce){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x52adce[_0x0344('0x2')],'transfererchannel':_0x52adce[_0x0344('0x3')],'transferercalleridnum':_0x52adce[_0x0344('0x4')],'transferercalleridname':_0x52adce[_0x0344('0x5')],'transfererconnectedlinenum':_0x52adce['transfererconnectedlinenum'],'transfererconnectedlinename':_0x52adce[_0x0344('0x6')],'transfereraccountcode':_0x52adce[_0x0344('0x7')],'transferercontext':_0x52adce[_0x0344('0x8')],'transfererexten':_0x52adce[_0x0344('0x9')],'transfererlinkedid':_0x52adce[_0x0344('0xa')],'transfereechannel':_0x52adce[_0x0344('0xb')],'transfereecalleridnum':_0x52adce[_0x0344('0xc')],'transfereecalleridname':_0x52adce[_0x0344('0xd')],'transfereeconnectedlinenum':_0x52adce[_0x0344('0xe')],'transfereeconnectedlinename':_0x52adce['transfereeconnectedlinename'],'transfereeaccountcode':_0x52adce[_0x0344('0xf')],'transfereecontext':_0x52adce[_0x0344('0x10')],'transfereeexten':_0x52adce['transfereeexten'],'transfereelinkedid':_0x52adce[_0x0344('0x11')],'isexternal':_0x52adce[_0x0344('0x12')],'context':_0x52adce[_0x0344('0x13')],'extension':_0x52adce[_0x0344('0x14')],'type':_0x0344('0x15')},'log':_0x0344('0x16')});};exports[_0x0344('0x17')]=function(_0x49531d){return client[_0x0344('0x18')](_0x0344('0x16'),{'body':{'result':_0x49531d[_0x0344('0x2')],'transfererchannel':_0x49531d[_0x0344('0x19')],'transferercalleridnum':_0x49531d[_0x0344('0x1a')],'transferercalleridname':_0x49531d[_0x0344('0x1b')],'transfererconnectedlinenum':_0x49531d[_0x0344('0x1c')],'transfererconnectedlinename':_0x49531d['secondtransfererconnectedlinename'],'transfereraccountcode':_0x49531d[_0x0344('0x1d')],'transferercontext':_0x49531d[_0x0344('0x1e')],'transfererexten':_0x49531d[_0x0344('0x1f')],'transfererlinkedid':_0x49531d['origtransfererlinkedid'],'transfereechannel':_0x49531d['transfertargetchannel'],'transfereecalleridnum':_0x49531d['transfertargetcalleridnum'],'transfereecalleridname':_0x49531d[_0x0344('0x20')],'transfereeconnectedlinenum':_0x49531d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x49531d[_0x0344('0x21')],'transfereeaccountcode':_0x49531d[_0x0344('0x22')],'transfereecontext':_0x49531d['transfertargetcontext'],'transfereeexten':_0x49531d[_0x0344('0x23')],'transfereelinkedid':_0x49531d[_0x0344('0x24')],'isexternal':_0x49531d['isexternal'],'context':_0x49531d[_0x0344('0x25')],'extension':_0x49531d[_0x0344('0x26')],'type':'attended'},'log':_0x0344('0x16')});}; \ No newline at end of file +var _0xf21f=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','blind','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x18ea66,_0x2a6ddc){var _0x10f636=function(_0x1c5b43){while(--_0x1c5b43){_0x18ea66['push'](_0x18ea66['shift']());}};_0x10f636(++_0x2a6ddc);}(_0xf21f,0x102));var _0xff21=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0xf21f[_0x51f632];return _0x24cf36;};'use strict';var client=require(_0xff21('0x0'));exports[_0xff21('0x1')]=function(_0x273a04){return client['Request'](_0xff21('0x2'),{'body':{'result':_0x273a04['result'],'transfererchannel':_0x273a04[_0xff21('0x3')],'transferercalleridnum':_0x273a04['transferercalleridnum'],'transferercalleridname':_0x273a04[_0xff21('0x4')],'transfererconnectedlinenum':_0x273a04['transfererconnectedlinenum'],'transfererconnectedlinename':_0x273a04[_0xff21('0x5')],'transfereraccountcode':_0x273a04[_0xff21('0x6')],'transferercontext':_0x273a04[_0xff21('0x7')],'transfererexten':_0x273a04[_0xff21('0x8')],'transfererlinkedid':_0x273a04['transfererlinkedid'],'transfereechannel':_0x273a04[_0xff21('0x9')],'transfereecalleridnum':_0x273a04[_0xff21('0xa')],'transfereecalleridname':_0x273a04[_0xff21('0xb')],'transfereeconnectedlinenum':_0x273a04[_0xff21('0xc')],'transfereeconnectedlinename':_0x273a04[_0xff21('0xd')],'transfereeaccountcode':_0x273a04['transfereeaccountcode'],'transfereecontext':_0x273a04[_0xff21('0xe')],'transfereeexten':_0x273a04['transfereeexten'],'transfereelinkedid':_0x273a04['transfereelinkedid'],'isexternal':_0x273a04['isexternal'],'context':_0x273a04['context'],'extension':_0x273a04['extension'],'type':_0xff21('0xf')},'log':_0xff21('0x2')});};exports[_0xff21('0x10')]=function(_0x1f577e){return client[_0xff21('0x11')](_0xff21('0x2'),{'body':{'result':_0x1f577e[_0xff21('0x12')],'transfererchannel':_0x1f577e[_0xff21('0x13')],'transferercalleridnum':_0x1f577e['origtransferercalleridnum'],'transferercalleridname':_0x1f577e[_0xff21('0x14')],'transfererconnectedlinenum':_0x1f577e[_0xff21('0x15')],'transfererconnectedlinename':_0x1f577e[_0xff21('0x16')],'transfereraccountcode':_0x1f577e[_0xff21('0x17')],'transferercontext':_0x1f577e[_0xff21('0x18')],'transfererexten':_0x1f577e[_0xff21('0x19')],'transfererlinkedid':_0x1f577e[_0xff21('0x1a')],'transfereechannel':_0x1f577e[_0xff21('0x1b')],'transfereecalleridnum':_0x1f577e[_0xff21('0x1c')],'transfereecalleridname':_0x1f577e[_0xff21('0x1d')],'transfereeconnectedlinenum':_0x1f577e[_0xff21('0x1e')],'transfereeconnectedlinename':_0x1f577e[_0xff21('0x1f')],'transfereeaccountcode':_0x1f577e['transfertargetaccountcode'],'transfereecontext':_0x1f577e[_0xff21('0x20')],'transfereeexten':_0x1f577e['transfertargetexten'],'transfereelinkedid':_0x1f577e['transfertargetlinkedid'],'isexternal':_0x1f577e['isexternal'],'context':_0x1f577e[_0xff21('0x21')],'extension':_0x1f577e[_0xff21('0x22')],'type':_0xff21('0x23')},'log':_0xff21('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 367484f..e8d6c45 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 _0x004d=['module','action','Reload','Action','then','message','catch','error','isConnected','ami\x20disconnected','command','content','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','trunks','outbound','run','event','emit','custom:','faxAccounts','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','QueuePause','asterisk','username','join','pick'];(function(_0x4f4b99,_0xb89ce6){var _0x489dfe=function(_0x14578c){while(--_0x14578c){_0x4f4b99['push'](_0x4f4b99['shift']());}};_0x489dfe(++_0xb89ce6);}(_0x004d,0xfb));var _0xd004=function(_0x28c40e,_0x2d2390){_0x28c40e=_0x28c40e-0x0;var _0x53380c=_0x004d[_0x28c40e];return _0x53380c;};'use strict';var _=require(_0xd004('0x0'));var util=require(_0xd004('0x1'));var jayson=require(_0xd004('0x2'));var schema=require('validate');var BPromise=require(_0xd004('0x3'));var moment=require(_0xd004('0x4'));var config=require(_0xd004('0x5'));var properties=require('../properties');var ami=require(_0xd004('0x6'));exports[_0xd004('0x7')]=function(_0x2392aa,_0x15ba36,_0x16889f){return new BPromise(function(_0x37af7b,_0x3de0b5){var _0x1a82d7={'QueuePause':function(_0x6f5d1){return new Promise(function(_0x1ab23b,_0x45699a){var _0x404772=util['format'](_0xd004('0x8'),'SIP',_0x6f5d1[_0xd004('0x9')]);if(_0x2392aa[_0xd004('0xa')]&&_0x2392aa[_0xd004('0xa')][_0x404772]&&_0x2392aa['timers'][_0x404772][_0xd004('0xb')]){_0x2392aa[_0xd004('0xa')][_0x404772][_0xd004('0xc')]();}if(_0x2392aa[_0xd004('0xd')][_0x404772]){_0x2392aa[_0xd004('0xd')][_0x404772]['updateStatusRealtime']({'statePause':_0x6f5d1['pause']?!![]:![]});}_0x1ab23b({'code':0xc8,'message':_0xd004('0xe')});});},'Reload':function(_0x1149b8){var _0x55e5c2=this;return new Promise(function(_0x127292,_0x465c05){if(ami['isConnected']()==![]){return _0x465c05(_0x55e5c2['error'](0x1f4,[config[_0xd004('0xf')]['ip'],config[_0xd004('0xf')][_0xd004('0x10')],'ami\x20disconnected'][_0xd004('0x11')]('\x20')));}_0x1149b8=_[_0xd004('0x12')](_0x1149b8,_['keys'](properties[_0xd004('0x13')]));_0x1149b8[_0xd004('0x14')]=_0xd004('0x15');return ami[_0xd004('0x16')](_0x1149b8)[_0xd004('0x17')](function(_0x117c3e){_0x127292({'code':0xc8,'message':_0x117c3e[_0xd004('0x18')]});})[_0xd004('0x19')](function(_0x2581f2){_0x465c05(_0x55e5c2[_0xd004('0x1a')](0x1f5,_0x2581f2['message']));});});},'Command':function(_0x1a1283){var _0x389d63=this;return new Promise(function(_0x4cfa64,_0x477ec1){if(ami[_0xd004('0x1b')]()==![]){return _0x477ec1(_0x389d63['error'](0x1f4,[config[_0xd004('0xf')]['ip'],config[_0xd004('0xf')]['username'],_0xd004('0x1c')][_0xd004('0x11')]('\x20')));}_0x1a1283=_[_0xd004('0x12')](_0x1a1283,_0xd004('0x1d'));_0x1a1283['action']='Command';return ami[_0xd004('0x16')](_0x1a1283)['then'](function(_0x6e0a0e){_0x4cfa64({'code':0xc8,'message':_0x6e0a0e[_0xd004('0x1e')]});})[_0xd004('0x19')](function(_0x146ea5){_0x477ec1(_0x389d63[_0xd004('0x1a')](0x1f5,_0x146ea5['message']));});});},'VoiceQueues':function(_0x3cb7d6){return new Promise(function(_0x15b001,_0x170b97){var _0x4a1b43=[];for(var _0x16d5b6 in _0x2392aa[_0xd004('0x1f')]){if(_0x2392aa['voiceQueues']['hasOwnProperty'](_0x16d5b6)){var _0x1388c1=_0x2392aa['voiceQueues'][_0x16d5b6];var _0x2a8572={'id':_0x1388c1['id'],'name':_0x1388c1[_0xd004('0x9')],'strategy':_0x1388c1['strategy'],'answered':_0x1388c1[_0xd004('0x20')],'available':_0x1388c1[_0xd004('0x21')],'loggedIn':_0x1388c1[_0xd004('0x22')],'pTalking':_0x1388c1[_0xd004('0x23')],'sumBillable':_0x1388c1[_0xd004('0x24')],'sumDuration':_0x1388c1['sumDuration'],'sumHoldTime':_0x1388c1[_0xd004('0x25')]||0x0,'talking':_0x1388c1['talking'],'total':_0x1388c1[_0xd004('0x26')],'type':_0x1388c1[_0xd004('0x27')],'unmanaged':_0x1388c1[_0xd004('0x28')],'abandoned':_0x1388c1[_0xd004('0x29')],'waiting':_0x1388c1[_0xd004('0x2a')],'loggedInDb':_0x1388c1[_0xd004('0x2b')]};if(_0x1388c1[_0xd004('0x27')]==='outbound'){_0x2a8572[_0xd004('0x2c')]=_0x1388c1[_0xd004('0x2c')];_0x2a8572[_0xd004('0x2d')]=_0x1388c1[_0xd004('0x2d')];_0x2a8572['dialOriginateCallerIdName']=_0x1388c1['dialOriginateCallerIdName'];_0x2a8572['dialOriginateCallerIdNumber']=_0x1388c1[_0xd004('0x2e')];_0x2a8572[_0xd004('0x2f')]=_0x1388c1[_0xd004('0x2f')];_0x2a8572[_0xd004('0x30')]=_0x1388c1[_0xd004('0x30')];_0x2a8572[_0xd004('0x31')]=_0x1388c1[_0xd004('0x31')];_0x2a8572['outboundAnswerCallsDay']=_0x1388c1[_0xd004('0x32')];_0x2a8572[_0xd004('0x33')]=_0x1388c1[_0xd004('0x33')];_0x2a8572[_0xd004('0x34')]=_0x1388c1[_0xd004('0x34')];_0x2a8572[_0xd004('0x35')]=_0x1388c1[_0xd004('0x35')];_0x2a8572[_0xd004('0x36')]=_0x1388c1['outboundDropCallsDayACS'];_0x2a8572[_0xd004('0x37')]=_0x1388c1[_0xd004('0x37')];_0x2a8572[_0xd004('0x38')]=_0x1388c1[_0xd004('0x38')];_0x2a8572[_0xd004('0x39')]=_0x1388c1[_0xd004('0x39')];_0x2a8572[_0xd004('0x3a')]=_0x1388c1[_0xd004('0x3a')];_0x2a8572['outboundOriginateFailureCallsDay']=_0x1388c1[_0xd004('0x3b')];_0x2a8572[_0xd004('0x3c')]=_0x1388c1[_0xd004('0x3c')];_0x2a8572['outboundRejectCallsDay']=_0x1388c1['outboundRejectCallsDay'];_0x2a8572['outboundUnknownCallsDay']=_0x1388c1[_0xd004('0x3d')];_0x2a8572['predictiveIntervalAnsweredCalls']=_0x1388c1[_0xd004('0x3e')];_0x2a8572[_0xd004('0x3f')]=_0x1388c1['predictiveIntervalAvgHoldtime'];_0x2a8572[_0xd004('0x40')]=_0x1388c1[_0xd004('0x40')];_0x2a8572[_0xd004('0x41')]=_0x1388c1['predictiveIntervalDroppedCallsCallersExit'];_0x2a8572[_0xd004('0x42')]=_0x1388c1[_0xd004('0x42')];_0x2a8572[_0xd004('0x43')]=_0x1388c1[_0xd004('0x43')];_0x2a8572[_0xd004('0x44')]=_0x1388c1['predictiveIntervalErlangCallsDroppedCalls'];_0x2a8572[_0xd004('0x45')]=_0x1388c1[_0xd004('0x45')];_0x2a8572[_0xd004('0x46')]=_0x1388c1['predictiveIntervalMultiplicativeFactor'];_0x2a8572[_0xd004('0x47')]=_0x1388c1[_0xd004('0x47')];_0x2a8572[_0xd004('0x48')]=_0x1388c1[_0xd004('0x48')];_0x2a8572[_0xd004('0x49')]=_0x1388c1[_0xd004('0x49')];_0x2a8572[_0xd004('0x18')]=_0x1388c1['message'];_0x2a8572[_0xd004('0x4a')]=_0x1388c1[_0xd004('0x4a')];_0x2a8572[_0xd004('0x4b')]=_0x1388c1[_0xd004('0x4b')];_0x2a8572[_0xd004('0x4c')]=_0x1388c1[_0xd004('0x4c')];_0x2a8572[_0xd004('0x4d')]=_0x1388c1['erlangAbandonmentRate'];_0x2a8572[_0xd004('0x4e')]=_0x1388c1[_0xd004('0x4e')];_0x2a8572[_0xd004('0x4f')]=_0x1388c1['startPredictive'];_0x2a8572[_0xd004('0x50')]=_0x1388c1[_0xd004('0x50')];}if(_0x1388c1[_0xd004('0x51')]){_0x2a8572[_0xd004('0x51')]={'id':_0x1388c1[_0xd004('0x51')]['id'],'name':_0x1388c1[_0xd004('0x51')][_0xd004('0x9')],'active':_0x1388c1['Trunk'][_0xd004('0x52')],'callerid':_0x1388c1['Trunk'][_0xd004('0x53')]};}if(_0x1388c1[_0xd004('0x54')]){_0x2a8572[_0xd004('0x54')]={'id':_0x1388c1[_0xd004('0x54')]['id'],'name':_0x1388c1[_0xd004('0x54')]['name']};}_0x4a1b43[_0xd004('0x55')](_0x2a8572);}}_0x15b001({'count':_0x4a1b43[_0xd004('0x56')],'rows':_0x4a1b43});});},'VoiceChannels':function(_0x58ee0a){return new Promise(function(_0x2678db,_0x210ebc){var _0x3bc093=_[_0xd004('0x57')](_0x2392aa[_0xd004('0x58')]);_0x2678db({'count':_0x3bc093[_0xd004('0x56')],'rows':_0x3bc093});});},'VoiceChannelMixMonitor':function(_0x54cfaa){var _0x1277f4=this;return new Promise(function(_0x103f0d,_0x532d6d){if(ami[_0xd004('0x1b')]()==![]){return _0x532d6d(_0x1277f4[_0xd004('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0xd004('0xf')][_0xd004('0x10')],_0xd004('0x1c')]['join']('\x20')));}var _0x32b6d2=schema(properties[_0xd004('0x59')])['validate'](_0x54cfaa);if(_0x32b6d2['length']>0x0){return _0x532d6d(_0x1277f4[_0xd004('0x1a')](0x1f4,_[_0xd004('0x5a')](_0x32b6d2,_0xd004('0x18'))['join'](',\x20')));}var _0x858974=_[_0xd004('0x5b')](_0x2392aa[_0xd004('0x58')],{'uniqueid':_0x54cfaa[_0xd004('0x5c')]});if(_0x858974&&_0x858974[_0xd004('0x5d')]){var _0x2ebcfb=util[_0xd004('0x5e')](_0xd004('0x5f'),_0x54cfaa[_0xd004('0x60')]||_0x54cfaa[_0xd004('0x5c')],_0x54cfaa[_0xd004('0x5e')]||_0xd004('0x61'));return ami[_0xd004('0x16')]({'action':_0xd004('0x62'),'channel':_0x858974[_0xd004('0x5d')],'file':_0x2ebcfb,'options':_0xd004('0x63')})['then'](function(_0x2fdb4f){var _0x318a81=_[_0xd004('0x5b')](_0x858974[_0xd004('0x64')],{'filename':_0xd004('0x65')+_0x2ebcfb[_0xd004('0x66')]()});if(_[_0xd004('0x67')](_0x318a81)){_0x858974[_0xd004('0x64')]['push']({'filename':_0xd004('0x65')+_0x2ebcfb['toLowerCase'](),'createdAt':moment()[_0xd004('0x5e')](_0xd004('0x68')),'mixmonitorid':_0x2fdb4f['mixmonitorid'],'status':_0xd004('0x69')});}else{_0x318a81[_0xd004('0x6a')]=_0x2fdb4f['mixmonitorid'];_0x318a81[_0xd004('0x6b')]='rec';}_0x103f0d({'code':0xc8,'message':[_0x54cfaa['uniqueid'],_0xd004('0x6c'),_0x2fdb4f['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x2fdb4f[_0xd004('0x6a')]});})[_0xd004('0x19')](function(_0x411da4){_0x532d6d(_0x1277f4['error'](0x1f5,[_0x54cfaa['uniqueid'],_0x411da4[_0xd004('0x18')][_0xd004('0x66')]()][_0xd004('0x11')]('\x20')));});}else{return _0x532d6d(_0x1277f4['error'](0x1f5,_0xd004('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x196a3e){var _0x497298=this;return new Promise(function(_0x441fd2,_0x3bde5f){if(ami['isConnected']()==![]){return _0x3bde5f(_0x497298[_0xd004('0x1a')](0x1f4,[config[_0xd004('0xf')]['ip'],config[_0xd004('0xf')][_0xd004('0x10')],_0xd004('0x1c')][_0xd004('0x11')]('\x20')));}var _0x270e01=schema(properties[_0xd004('0x59')])[_0xd004('0x6e')](_0x196a3e);if(_0x270e01[_0xd004('0x56')]>0x0){return _0x3bde5f(_0x497298[_0xd004('0x1a')](0x1f4,_[_0xd004('0x5a')](_0x270e01,_0xd004('0x18'))[_0xd004('0x11')](',\x20')));}var _0x30d466=_[_0xd004('0x5b')](_0x2392aa['channels'],{'uniqueid':_0x196a3e[_0xd004('0x5c')]});if(_0x30d466){return BPromise[_0xd004('0x6f')]()['then'](function(){if(_0x30d466[_0xd004('0x5d')]){return ami[_0xd004('0x16')]({'action':_0xd004('0x70'),'channel':_0x30d466[_0xd004('0x5d')],'mixmonitorid':_0x196a3e[_0xd004('0x6a')]})['catch'](function(_0xda957d){});}})[_0xd004('0x17')](function(){if(_0x30d466[_0xd004('0x71')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x30d466[_0xd004('0x71')],'mixmonitorid':_0x196a3e[_0xd004('0x6a')]})[_0xd004('0x19')](function(_0xcf203a){});}})['then'](function(_0x2d5b2b){var _0x29fabf=_['find'](_0x30d466['monitors'],{'mixmonitorid':_0x196a3e[_0xd004('0x6a')]});if(_0x29fabf){_0x29fabf[_0xd004('0x6b')]=_0xd004('0x72');}})[_0xd004('0x17')](function(){var _0xbdf40f=util[_0xd004('0x5e')](_0xd004('0x5f'),_0x196a3e[_0xd004('0x60')]||_0x196a3e[_0xd004('0x5c')],_0x196a3e[_0xd004('0x5e')]||_0xd004('0x61'));var _0x1a6459=_['find'](_0x30d466[_0xd004('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0xbdf40f[_0xd004('0x66')]()});if(_0x1a6459){_0x1a6459[_0xd004('0x6b')]=_0xd004('0x72');}})[_0xd004('0x17')](function(){_0x441fd2({'code':0xc8,'message':[_0x196a3e['uniqueid'],_0xd004('0x73')][_0xd004('0x11')]('\x20')});})['catch'](function(_0x5e2bfc){_0x3bde5f(_0x497298[_0xd004('0x1a')](0x1f5,[_0x196a3e[_0xd004('0x5c')],_0x5e2bfc[_0xd004('0x18')][_0xd004('0x66')]()][_0xd004('0x11')]('\x20')));});}else{return _0x3bde5f(_0x497298['error'](0x1f5,_0xd004('0x6d')));}});},'VoiceQueuesChannels':function(_0x14fb8b){return new Promise(function(_0x554fa3,_0x5a760d){var _0x53cd84=_['values'](_0x2392aa[_0xd004('0x74')]);_0x554fa3({'count':_0x53cd84['length'],'rows':_0x53cd84});});},'VoiceQueuesChannel':function(_0x4d7662){var _0x3bbbb8=this;return new Promise(function(_0x4e44cb,_0xb50ea4){var _0x5964ed=schema(properties[_0xd004('0x75')])[_0xd004('0x6e')](_0x4d7662);if(_0x5964ed['length']>0x0){return _0xb50ea4(_0x3bbbb8['error'](0x1f4,_['map'](_0x5964ed,'message')['join'](',\x20')));}var _0x1fac56=_[_0xd004('0x5b')](_0x2392aa[_0xd004('0x74')],{'uniqueid':_0x4d7662[_0xd004('0x5c')]});if(_0x1fac56){_0x4e44cb(_0x1fac56);}else{return _0xb50ea4(_0x3bbbb8['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x540862){var _0x37df78=this;return new Promise(function(_0x3e1f18,_0x5b15e5){if(ami[_0xd004('0x1b')]()==![]){return _0x5b15e5(_0x37df78[_0xd004('0x1a')](0x1f4,[config[_0xd004('0xf')]['ip'],config[_0xd004('0xf')][_0xd004('0x10')],_0xd004('0x1c')][_0xd004('0x11')]('\x20')));}var _0x6db25d=schema(properties[_0xd004('0x76')])[_0xd004('0x6e')](_0x540862);if(_0x6db25d[_0xd004('0x56')]>0x0){return _0x5b15e5(_0x37df78[_0xd004('0x1a')](0x1f4,_['map'](_0x6db25d,'message')[_0xd004('0x11')](',\x20')));}var _0x207772=_[_0xd004('0x5b')](_0x2392aa[_0xd004('0x74')],{'uniqueid':_0x540862['uniqueid']});if(_0x207772&&_0x207772[_0xd004('0x5d')]){return ami[_0xd004('0x16')]({'action':_0xd004('0x77'),'channel':_0x207772[_0xd004('0x5d')]})[_0xd004('0x17')](function(_0x31ed47){_0x3e1f18({'code':0xc8,'message':[_0x540862[_0xd004('0x5c')],_0x31ed47[_0xd004('0x18')][_0xd004('0x66')]()]['join']('\x20')});})[_0xd004('0x19')](function(_0x5a61fd){_0x5b15e5(_0x37df78['error'](0x1f5,[_0x540862['uniqueid'],_0x5a61fd[_0xd004('0x18')][_0xd004('0x66')]()][_0xd004('0x11')]('\x20')));});}else{return _0x5b15e5(_0x37df78['error'](0x1f5,_0xd004('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x2111e0){var _0x52dece=this;return new Promise(function(_0x448267,_0x16ef2f){if(ami['isConnected']()==![]){return _0x16ef2f(_0x52dece[_0xd004('0x1a')](0x1f4,[config[_0xd004('0xf')]['ip'],config[_0xd004('0xf')][_0xd004('0x10')],_0xd004('0x1c')][_0xd004('0x11')]('\x20')));}var _0x2cdfca=schema(properties[_0xd004('0x78')])[_0xd004('0x6e')](_0x2111e0);if(_0x2cdfca['length']>0x0){return _0x16ef2f(_0x52dece[_0xd004('0x1a')](0x1f4,_['map'](_0x2cdfca,_0xd004('0x18'))[_0xd004('0x11')](',\x20')));}var _0x2845b6=_[_0xd004('0x5b')](_0x2392aa['queueChannels'],{'uniqueid':_0x2111e0[_0xd004('0x5c')]});if(_0x2845b6&&_0x2845b6[_0xd004('0x5d')]){return ami[_0xd004('0x16')]({'action':_0xd004('0x79'),'channel':_0x2845b6[_0xd004('0x5d')],'exten':_0x2111e0['exten'],'context':_0x2111e0['context']||_0x2845b6[_0xd004('0x7a')],'priority':0x1})[_0xd004('0x17')](function(_0x3a6220){_0x448267({'code':0xc8,'message':[_0x2111e0[_0xd004('0x5c')],_0x3a6220[_0xd004('0x18')]['toLowerCase']()][_0xd004('0x11')]('\x20')});})[_0xd004('0x19')](function(_0x440e56){_0x16ef2f(_0x52dece[_0xd004('0x1a')](0x1f5,[_0x2111e0[_0xd004('0x5c')],_0x440e56['message'][_0xd004('0x66')]()]['join']('\x20')));});}else{return _0x16ef2f(_0x52dece[_0xd004('0x1a')](0x1f5,_0xd004('0x6d')));}});},'Agents':function(_0xce1586){return new Promise(function(_0x340e12,_0x4deb12){var _0x155cc4=_[_0xd004('0x57')](_0x2392aa[_0xd004('0xd')]);_0x340e12({'count':_0x155cc4[_0xd004('0x56')],'rows':_0x155cc4});});},'Telephones':function(_0xd081c3){return new Promise(function(_0x565a2a,_0x251842){var _0x41f27e=_['values'](_0x2392aa['telephones']);_0x565a2a({'count':_0x41f27e['length'],'rows':_0x41f27e});});},'Trunks':function(_0x3a9092){return new Promise(function(_0x502689,_0x669116){var _0x179b44=_[_0xd004('0x57')](_0x2392aa[_0xd004('0x7b')]);_0x502689({'count':_0x179b44[_0xd004('0x56')],'rows':_0x179b44});});},'OutboundChannels':function(_0x518b15){return new Promise(function(_0x1c03f5,_0x49ad23){var _0x20ef52=_[_0xd004('0x57')](_0x2392aa['outboundChannels']);_0x1c03f5({'count':_0x20ef52[_0xd004('0x56')],'rows':_0x20ef52});});},'Outbound':function(_0xf1896b){return new Promise(function(_0x5dd76d,_0x24f0be){_0x5dd76d(_0x2392aa[_0xd004('0x7c')]);});},'Campaigns':function(_0x1d6cb5){return new Promise(function(_0x33f8bf,_0x3b0770){var _0x575453=_[_0xd004('0x57')](_0x2392aa['campaigns']);_0x33f8bf({'count':_0x575453['length'],'rows':_0x575453});});},'VoiceQueuesPreview':function(_0x25fe01){var _0x235800=this;return new Promise(function(_0x37975a,_0x52e73f){_0x15ba36[_0xd004('0x7d')](_0x25fe01['id'])[_0xd004('0x17')](function(_0x9cccfa){_0x37975a({'code':0xc8,'message':_0x9cccfa['message']});})[_0xd004('0x19')](function(_0x334024){_0x52e73f(_0x235800[_0xd004('0x1a')](0x1f4,_0x334024['message']));});});},'EventManager':function(_0x235307){var _0x5b03dd=this;return new Promise(function(_0x328daa,_0x199d1f){if(!_0x235307[_0xd004('0x7e')]){return _0x199d1f(_0x5b03dd['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xd004('0x7f')](_0xd004('0x80')+_0x235307[_0xd004('0x7e')],_0x235307[_0xd004('0x18')]);_0x328daa({'code':0xc8,'message':_0x235307});});},'FaxAccounts':function(_0x431ec0){return new Promise(function(_0x1cc64f,_0x328f12){var _0x1c5478=_[_0xd004('0x57')](_0x2392aa[_0xd004('0x81')]);_0x1cc64f({'count':_0x1c5478[_0xd004('0x56')],'rows':_0x1c5478});});},'SendFax':function(_0x1d2769){var _0x370f64=this;return new Promise(function(_0x5516a1,_0x33f305){_0x16889f['send'](_0x1d2769)[_0xd004('0x17')](function(_0x267cd4){_0x5516a1({'code':0xc8,'message':_0x267cd4[_0xd004('0x18')]});})['catch'](function(_0x2b555d){_0x33f305(_0x370f64[_0xd004('0x1a')](0x1f4,_0x2b555d[_0xd004('0x18')]));});});},'CheckAfterSend':function(_0x114739){var _0x3ef293=this;return new Promise(function(_0x5e900d,_0x9ca988){_0x16889f['checkAfterSend'](_0x114739)[_0xd004('0x17')](function(_0x463fac){_0x5e900d({'code':0xc8,'message':_0x463fac[_0xd004('0x18')]});})[_0xd004('0x19')](function(_0x4d7348){_0x9ca988(_0x3ef293[_0xd004('0x1a')](0x1f4,_0x4d7348[_0xd004('0x18')]));});});}};var _0x345066=jayson[_0xd004('0x82')](_0x1a82d7)[_0xd004('0x83')]();_0x345066['on']('error',function(_0x2c6861){return _0x3de0b5(_0x2c6861);});_0x345066[_0xd004('0x7')](0x232a,_0xd004('0x84'),function(){console[_0xd004('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x37af7b(_0xd004('0x86')+0x232a);});});}; \ No newline at end of file +var _0xb0d4=['monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','emit','event','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','error','username','pick','command','Command','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','unmanaged','abandoned','waiting','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','push','values','channels','length','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)'];(function(_0x48f1db,_0x554c57){var _0x27de48=function(_0x3cd347){while(--_0x3cd347){_0x48f1db['push'](_0x48f1db['shift']());}};_0x27de48(++_0x554c57);}(_0xb0d4,0x1ba));var _0x4b0d=function(_0x2d48a2,_0x34ffa6){_0x2d48a2=_0x2d48a2-0x0;var _0x2ba1cb=_0xb0d4[_0x2d48a2];return _0x2ba1cb;};'use strict';var _=require(_0x4b0d('0x0'));var util=require(_0x4b0d('0x1'));var jayson=require('jayson/promise');var schema=require(_0x4b0d('0x2'));var BPromise=require(_0x4b0d('0x3'));var moment=require(_0x4b0d('0x4'));var config=require(_0x4b0d('0x5'));var properties=require(_0x4b0d('0x6'));var ami=require(_0x4b0d('0x7'));exports['listen']=function(_0xd9e767,_0x49eb9f,_0x49ab42){return new BPromise(function(_0x57186c,_0x368fb5){var _0x10977e={'QueuePause':function(_0x15a0ea){return new Promise(function(_0x4efef1,_0xbc67f7){var _0x6ba00=util[_0x4b0d('0x8')]('%s/%s','SIP',_0x15a0ea[_0x4b0d('0x9')]);if(_0xd9e767[_0x4b0d('0xa')]&&_0xd9e767[_0x4b0d('0xa')][_0x6ba00]&&_0xd9e767[_0x4b0d('0xa')][_0x6ba00][_0x4b0d('0xb')]){_0xd9e767[_0x4b0d('0xa')][_0x6ba00][_0x4b0d('0xc')]();}if(_0xd9e767[_0x4b0d('0xd')][_0x6ba00]){_0xd9e767[_0x4b0d('0xd')][_0x6ba00][_0x4b0d('0xe')]({'statePause':_0x15a0ea[_0x4b0d('0xf')]?!![]:![]});}_0x4efef1({'code':0xc8,'message':_0x4b0d('0x10')});});},'Reload':function(_0x4314c0){var _0x31044c=this;return new Promise(function(_0xf60338,_0x355595){if(ami[_0x4b0d('0x11')]()==![]){return _0x355595(_0x31044c['error'](0x1f4,[config[_0x4b0d('0x12')]['ip'],config[_0x4b0d('0x12')]['username'],_0x4b0d('0x13')][_0x4b0d('0x14')]('\x20')));}_0x4314c0=_['pick'](_0x4314c0,_[_0x4b0d('0x15')](properties[_0x4b0d('0x16')]));_0x4314c0[_0x4b0d('0x17')]=_0x4b0d('0x18');return ami[_0x4b0d('0x19')](_0x4314c0)[_0x4b0d('0x1a')](function(_0x293238){_0xf60338({'code':0xc8,'message':_0x293238[_0x4b0d('0x1b')]});})['catch'](function(_0x48deff){_0x355595(_0x31044c[_0x4b0d('0x1c')](0x1f5,_0x48deff[_0x4b0d('0x1b')]));});});},'Command':function(_0x370811){var _0xd35d20=this;return new Promise(function(_0x58d803,_0x4e5ae8){if(ami[_0x4b0d('0x11')]()==![]){return _0x4e5ae8(_0xd35d20[_0x4b0d('0x1c')](0x1f4,[config[_0x4b0d('0x12')]['ip'],config[_0x4b0d('0x12')][_0x4b0d('0x1d')],_0x4b0d('0x13')]['join']('\x20')));}_0x370811=_[_0x4b0d('0x1e')](_0x370811,_0x4b0d('0x1f'));_0x370811['action']=_0x4b0d('0x20');return ami[_0x4b0d('0x19')](_0x370811)[_0x4b0d('0x1a')](function(_0x2513d4){_0x58d803({'code':0xc8,'message':_0x2513d4['content']});})[_0x4b0d('0x21')](function(_0x5f18c6){_0x4e5ae8(_0xd35d20[_0x4b0d('0x1c')](0x1f5,_0x5f18c6[_0x4b0d('0x1b')]));});});},'VoiceQueues':function(_0x100b6d){return new Promise(function(_0x9bc6b0,_0x2d9a08){var _0x9a9415=[];for(var _0x4ebaf2 in _0xd9e767[_0x4b0d('0x22')]){if(_0xd9e767[_0x4b0d('0x22')][_0x4b0d('0x23')](_0x4ebaf2)){var _0xe4059d=_0xd9e767[_0x4b0d('0x22')][_0x4ebaf2];var _0x2b8b66={'id':_0xe4059d['id'],'name':_0xe4059d['name'],'strategy':_0xe4059d[_0x4b0d('0x24')],'answered':_0xe4059d[_0x4b0d('0x25')],'available':_0xe4059d[_0x4b0d('0x26')],'loggedIn':_0xe4059d[_0x4b0d('0x27')],'pTalking':_0xe4059d[_0x4b0d('0x28')],'sumBillable':_0xe4059d['sumBillable'],'sumDuration':_0xe4059d['sumDuration'],'sumHoldTime':_0xe4059d[_0x4b0d('0x29')]||0x0,'talking':_0xe4059d[_0x4b0d('0x2a')],'total':_0xe4059d['total'],'type':_0xe4059d['type'],'unmanaged':_0xe4059d[_0x4b0d('0x2b')],'abandoned':_0xe4059d[_0x4b0d('0x2c')],'waiting':_0xe4059d[_0x4b0d('0x2d')],'loggedInDb':_0xe4059d['loggedInDb']};if(_0xe4059d[_0x4b0d('0x2e')]==='outbound'){_0x2b8b66[_0x4b0d('0x2f')]=_0xe4059d[_0x4b0d('0x2f')];_0x2b8b66[_0x4b0d('0x30')]=_0xe4059d['dialMethod'];_0x2b8b66[_0x4b0d('0x31')]=_0xe4059d['dialOriginateCallerIdName'];_0x2b8b66[_0x4b0d('0x32')]=_0xe4059d[_0x4b0d('0x32')];_0x2b8b66[_0x4b0d('0x33')]=_0xe4059d[_0x4b0d('0x33')];_0x2b8b66[_0x4b0d('0x34')]=_0xe4059d[_0x4b0d('0x34')];_0x2b8b66[_0x4b0d('0x35')]=_0xe4059d[_0x4b0d('0x35')];_0x2b8b66[_0x4b0d('0x36')]=_0xe4059d[_0x4b0d('0x36')];_0x2b8b66[_0x4b0d('0x37')]=_0xe4059d[_0x4b0d('0x37')];_0x2b8b66[_0x4b0d('0x38')]=_0xe4059d['outboundBusyCallsDay'];_0x2b8b66['outboundCongestionCallsDay']=_0xe4059d[_0x4b0d('0x39')];_0x2b8b66[_0x4b0d('0x3a')]=_0xe4059d['outboundDropCallsDayACS'];_0x2b8b66[_0x4b0d('0x3b')]=_0xe4059d['outboundDropCallsDayCallersExit'];_0x2b8b66['outboundDropCallsDayTimeout']=_0xe4059d[_0x4b0d('0x3c')];_0x2b8b66[_0x4b0d('0x3d')]=_0xe4059d[_0x4b0d('0x3d')];_0x2b8b66[_0x4b0d('0x3e')]=_0xe4059d[_0x4b0d('0x3e')];_0x2b8b66[_0x4b0d('0x3f')]=_0xe4059d[_0x4b0d('0x3f')];_0x2b8b66[_0x4b0d('0x40')]=_0xe4059d[_0x4b0d('0x40')];_0x2b8b66[_0x4b0d('0x41')]=_0xe4059d['outboundRejectCallsDay'];_0x2b8b66['outboundUnknownCallsDay']=_0xe4059d[_0x4b0d('0x42')];_0x2b8b66['predictiveIntervalAnsweredCalls']=_0xe4059d[_0x4b0d('0x43')];_0x2b8b66['predictiveIntervalAvgHoldtime']=_0xe4059d[_0x4b0d('0x44')];_0x2b8b66[_0x4b0d('0x45')]=_0xe4059d[_0x4b0d('0x45')];_0x2b8b66[_0x4b0d('0x46')]=_0xe4059d['predictiveIntervalDroppedCallsCallersExit'];_0x2b8b66['predictiveIntervalDroppedCallsTimeout']=_0xe4059d[_0x4b0d('0x47')];_0x2b8b66[_0x4b0d('0x48')]=_0xe4059d[_0x4b0d('0x48')];_0x2b8b66[_0x4b0d('0x49')]=_0xe4059d['predictiveIntervalErlangCallsDroppedCalls'];_0x2b8b66[_0x4b0d('0x4a')]=_0xe4059d[_0x4b0d('0x4a')];_0x2b8b66[_0x4b0d('0x4b')]=_0xe4059d[_0x4b0d('0x4b')];_0x2b8b66[_0x4b0d('0x4c')]=_0xe4059d[_0x4b0d('0x4c')];_0x2b8b66[_0x4b0d('0x4d')]=_0xe4059d[_0x4b0d('0x4d')];_0x2b8b66['predictiveIntervalTotalCalls']=_0xe4059d[_0x4b0d('0x4e')];_0x2b8b66[_0x4b0d('0x1b')]=_0xe4059d[_0x4b0d('0x1b')];_0x2b8b66[_0x4b0d('0x4f')]=_0xe4059d[_0x4b0d('0x4f')];_0x2b8b66[_0x4b0d('0x50')]=_0xe4059d[_0x4b0d('0x50')];_0x2b8b66[_0x4b0d('0x51')]=_0xe4059d[_0x4b0d('0x51')];_0x2b8b66[_0x4b0d('0x52')]=_0xe4059d[_0x4b0d('0x52')];_0x2b8b66[_0x4b0d('0x53')]=_0xe4059d[_0x4b0d('0x53')];_0x2b8b66[_0x4b0d('0x54')]=_0xe4059d['startPredictive'];_0x2b8b66['startProgressive']=_0xe4059d['startProgressive'];}if(_0xe4059d['Trunk']){_0x2b8b66[_0x4b0d('0x55')]={'id':_0xe4059d['Trunk']['id'],'name':_0xe4059d[_0x4b0d('0x55')][_0x4b0d('0x9')],'active':_0xe4059d[_0x4b0d('0x55')][_0x4b0d('0x56')],'callerid':_0xe4059d[_0x4b0d('0x55')][_0x4b0d('0x57')]};}if(_0xe4059d[_0x4b0d('0x58')]){_0x2b8b66[_0x4b0d('0x58')]={'id':_0xe4059d['Interval']['id'],'name':_0xe4059d[_0x4b0d('0x58')][_0x4b0d('0x9')]};}_0x9a9415[_0x4b0d('0x59')](_0x2b8b66);}}_0x9bc6b0({'count':_0x9a9415['length'],'rows':_0x9a9415});});},'VoiceChannels':function(_0x186b7e){return new Promise(function(_0x2e71b9,_0x50f422){var _0x2b8e15=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x5b')]);_0x2e71b9({'count':_0x2b8e15[_0x4b0d('0x5c')],'rows':_0x2b8e15});});},'VoiceChannelMixMonitor':function(_0x6f4ab4){var _0x46cec1=this;return new Promise(function(_0x53e4c1,_0x353e98){if(ami['isConnected']()==![]){return _0x353e98(_0x46cec1['error'](0x1f4,[config['asterisk']['ip'],config[_0x4b0d('0x12')][_0x4b0d('0x1d')],'ami\x20disconnected'][_0x4b0d('0x14')]('\x20')));}var _0x424870=schema(properties['voicechannel'])['validate'](_0x6f4ab4);if(_0x424870[_0x4b0d('0x5c')]>0x0){return _0x353e98(_0x46cec1['error'](0x1f4,_[_0x4b0d('0x5d')](_0x424870,_0x4b0d('0x1b'))[_0x4b0d('0x14')](',\x20')));}var _0x2be2bb=_[_0x4b0d('0x5e')](_0xd9e767[_0x4b0d('0x5b')],{'uniqueid':_0x6f4ab4[_0x4b0d('0x5f')]});if(_0x2be2bb&&_0x2be2bb[_0x4b0d('0x60')]){var _0x437f3d=util[_0x4b0d('0x8')](_0x4b0d('0x61'),_0x6f4ab4[_0x4b0d('0x62')]||_0x6f4ab4[_0x4b0d('0x5f')],_0x6f4ab4[_0x4b0d('0x8')]||_0x4b0d('0x63'));return ami[_0x4b0d('0x19')]({'action':_0x4b0d('0x64'),'channel':_0x2be2bb[_0x4b0d('0x60')],'file':_0x437f3d,'options':_0x4b0d('0x65')})[_0x4b0d('0x1a')](function(_0x170fc5){var _0x5d24d0=_[_0x4b0d('0x5e')](_0x2be2bb[_0x4b0d('0x66')],{'filename':_0x4b0d('0x67')+_0x437f3d[_0x4b0d('0x68')]()});if(_[_0x4b0d('0x69')](_0x5d24d0)){_0x2be2bb[_0x4b0d('0x66')][_0x4b0d('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x437f3d[_0x4b0d('0x68')](),'createdAt':moment()[_0x4b0d('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x170fc5[_0x4b0d('0x6a')],'status':_0x4b0d('0x6b')});}else{_0x5d24d0[_0x4b0d('0x6a')]=_0x170fc5['mixmonitorid'];_0x5d24d0[_0x4b0d('0x6c')]=_0x4b0d('0x6b');}_0x53e4c1({'code':0xc8,'message':[_0x6f4ab4['uniqueid'],'MixMonitor\x20Success',_0x170fc5['mixmonitorid']][_0x4b0d('0x14')]('\x20'),'mixmonitorid':_0x170fc5[_0x4b0d('0x6a')]});})[_0x4b0d('0x21')](function(_0x405718){_0x353e98(_0x46cec1['error'](0x1f5,[_0x6f4ab4[_0x4b0d('0x5f')],_0x405718['message'][_0x4b0d('0x68')]()][_0x4b0d('0x14')]('\x20')));});}else{return _0x353e98(_0x46cec1[_0x4b0d('0x1c')](0x1f5,_0x4b0d('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x189ccb){var _0x3d9b43=this;return new Promise(function(_0x5a6301,_0x308afe){if(ami[_0x4b0d('0x11')]()==![]){return _0x308afe(_0x3d9b43[_0x4b0d('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x4b0d('0x12')][_0x4b0d('0x1d')],'ami\x20disconnected']['join']('\x20')));}var _0x451213=schema(properties[_0x4b0d('0x6e')])[_0x4b0d('0x2')](_0x189ccb);if(_0x451213[_0x4b0d('0x5c')]>0x0){return _0x308afe(_0x3d9b43[_0x4b0d('0x1c')](0x1f4,_[_0x4b0d('0x5d')](_0x451213,_0x4b0d('0x1b'))[_0x4b0d('0x14')](',\x20')));}var _0x3af08a=_['find'](_0xd9e767['channels'],{'uniqueid':_0x189ccb[_0x4b0d('0x5f')]});if(_0x3af08a){return BPromise['resolve']()['then'](function(){if(_0x3af08a[_0x4b0d('0x60')]){return ami[_0x4b0d('0x19')]({'action':_0x4b0d('0x6f'),'channel':_0x3af08a[_0x4b0d('0x60')],'mixmonitorid':_0x189ccb['mixmonitorid']})[_0x4b0d('0x21')](function(_0x3037e8){});}})[_0x4b0d('0x1a')](function(){if(_0x3af08a[_0x4b0d('0x70')]){return ami[_0x4b0d('0x19')]({'action':_0x4b0d('0x6f'),'channel':_0x3af08a[_0x4b0d('0x70')],'mixmonitorid':_0x189ccb[_0x4b0d('0x6a')]})[_0x4b0d('0x21')](function(_0x19bf35){});}})['then'](function(_0x56d501){var _0x1ece7d=_[_0x4b0d('0x5e')](_0x3af08a[_0x4b0d('0x66')],{'mixmonitorid':_0x189ccb['mixmonitorid']});if(_0x1ece7d){_0x1ece7d[_0x4b0d('0x6c')]=_0x4b0d('0x71');}})[_0x4b0d('0x1a')](function(){var _0x5e00f5=util[_0x4b0d('0x8')](_0x4b0d('0x61'),_0x189ccb['filename']||_0x189ccb['uniqueid'],_0x189ccb[_0x4b0d('0x8')]||_0x4b0d('0x63'));var _0x464172=_[_0x4b0d('0x5e')](_0x3af08a[_0x4b0d('0x66')],{'filename':_0x4b0d('0x67')+_0x5e00f5[_0x4b0d('0x68')]()});if(_0x464172){_0x464172[_0x4b0d('0x6c')]='stop';}})[_0x4b0d('0x1a')](function(){_0x5a6301({'code':0xc8,'message':[_0x189ccb['uniqueid'],_0x4b0d('0x72')][_0x4b0d('0x14')]('\x20')});})[_0x4b0d('0x21')](function(_0x4c2901){_0x308afe(_0x3d9b43[_0x4b0d('0x1c')](0x1f5,[_0x189ccb[_0x4b0d('0x5f')],_0x4c2901[_0x4b0d('0x1b')][_0x4b0d('0x68')]()]['join']('\x20')));});}else{return _0x308afe(_0x3d9b43[_0x4b0d('0x1c')](0x1f5,_0x4b0d('0x6d')));}});},'VoiceQueuesChannels':function(_0x318cca){return new Promise(function(_0xc1a052,_0x4f18c2){var _0x5e31c8=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x73')]);_0xc1a052({'count':_0x5e31c8[_0x4b0d('0x5c')],'rows':_0x5e31c8});});},'VoiceQueuesChannel':function(_0x2916a8){var _0x317886=this;return new Promise(function(_0x4917fd,_0x58c9a6){var _0x3e7615=schema(properties['voicequeuechannel'])['validate'](_0x2916a8);if(_0x3e7615[_0x4b0d('0x5c')]>0x0){return _0x58c9a6(_0x317886['error'](0x1f4,_[_0x4b0d('0x5d')](_0x3e7615,_0x4b0d('0x1b'))['join'](',\x20')));}var _0x4be489=_['find'](_0xd9e767[_0x4b0d('0x73')],{'uniqueid':_0x2916a8[_0x4b0d('0x5f')]});if(_0x4be489){_0x4917fd(_0x4be489);}else{return _0x58c9a6(_0x317886['error'](0x1f5,_0x4b0d('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0xf795b1){var _0x4ec1a2=this;return new Promise(function(_0x29f562,_0x5c142e){if(ami[_0x4b0d('0x11')]()==![]){return _0x5c142e(_0x4ec1a2[_0x4b0d('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x4b0d('0x12')][_0x4b0d('0x1d')],_0x4b0d('0x13')][_0x4b0d('0x14')]('\x20')));}var _0x515d6b=schema(properties['voicequeuechannelhangup'])['validate'](_0xf795b1);if(_0x515d6b[_0x4b0d('0x5c')]>0x0){return _0x5c142e(_0x4ec1a2[_0x4b0d('0x1c')](0x1f4,_[_0x4b0d('0x5d')](_0x515d6b,'message')[_0x4b0d('0x14')](',\x20')));}var _0x15c58d=_[_0x4b0d('0x5e')](_0xd9e767[_0x4b0d('0x73')],{'uniqueid':_0xf795b1[_0x4b0d('0x5f')]});if(_0x15c58d&&_0x15c58d[_0x4b0d('0x60')]){return ami[_0x4b0d('0x19')]({'action':'Hangup','channel':_0x15c58d['channel']})['then'](function(_0x4a271c){_0x29f562({'code':0xc8,'message':[_0xf795b1['uniqueid'],_0x4a271c['message'][_0x4b0d('0x68')]()][_0x4b0d('0x14')]('\x20')});})[_0x4b0d('0x21')](function(_0x3affe3){_0x5c142e(_0x4ec1a2[_0x4b0d('0x1c')](0x1f5,[_0xf795b1[_0x4b0d('0x5f')],_0x3affe3[_0x4b0d('0x1b')][_0x4b0d('0x68')]()][_0x4b0d('0x14')]('\x20')));});}else{return _0x5c142e(_0x4ec1a2[_0x4b0d('0x1c')](0x1f5,_0x4b0d('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x2c18f6){var _0x7fc769=this;return new Promise(function(_0x5689dc,_0x39a6e8){if(ami['isConnected']()==![]){return _0x39a6e8(_0x7fc769[_0x4b0d('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x4b0d('0x12')][_0x4b0d('0x1d')],_0x4b0d('0x13')][_0x4b0d('0x14')]('\x20')));}var _0x3c6d29=schema(properties[_0x4b0d('0x74')])[_0x4b0d('0x2')](_0x2c18f6);if(_0x3c6d29[_0x4b0d('0x5c')]>0x0){return _0x39a6e8(_0x7fc769[_0x4b0d('0x1c')](0x1f4,_[_0x4b0d('0x5d')](_0x3c6d29,_0x4b0d('0x1b'))[_0x4b0d('0x14')](',\x20')));}var _0x5f53b4=_[_0x4b0d('0x5e')](_0xd9e767['queueChannels'],{'uniqueid':_0x2c18f6[_0x4b0d('0x5f')]});if(_0x5f53b4&&_0x5f53b4[_0x4b0d('0x60')]){return ami[_0x4b0d('0x19')]({'action':_0x4b0d('0x75'),'channel':_0x5f53b4[_0x4b0d('0x60')],'exten':_0x2c18f6[_0x4b0d('0x76')],'context':_0x2c18f6[_0x4b0d('0x77')]||_0x5f53b4[_0x4b0d('0x77')],'priority':0x1})[_0x4b0d('0x1a')](function(_0x26d11e){_0x5689dc({'code':0xc8,'message':[_0x2c18f6[_0x4b0d('0x5f')],_0x26d11e[_0x4b0d('0x1b')]['toLowerCase']()][_0x4b0d('0x14')]('\x20')});})['catch'](function(_0x25032e){_0x39a6e8(_0x7fc769[_0x4b0d('0x1c')](0x1f5,[_0x2c18f6[_0x4b0d('0x5f')],_0x25032e['message'][_0x4b0d('0x68')]()][_0x4b0d('0x14')]('\x20')));});}else{return _0x39a6e8(_0x7fc769[_0x4b0d('0x1c')](0x1f5,_0x4b0d('0x6d')));}});},'Agents':function(_0x14d9fa){return new Promise(function(_0x1a7307,_0x55a516){var _0x8ad47d=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0xd')]);_0x1a7307({'count':_0x8ad47d[_0x4b0d('0x5c')],'rows':_0x8ad47d});});},'Telephones':function(_0x18651f){return new Promise(function(_0x4f16b0,_0x45b14e){var _0x5dcd58=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x78')]);_0x4f16b0({'count':_0x5dcd58['length'],'rows':_0x5dcd58});});},'Trunks':function(_0x50bc6a){return new Promise(function(_0x1fcf5d,_0xab49e0){var _0x183fdd=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x79')]);_0x1fcf5d({'count':_0x183fdd['length'],'rows':_0x183fdd});});},'OutboundChannels':function(_0x3407e8){return new Promise(function(_0x50f76a,_0x5d9be3){var _0x2d3a45=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x7a')]);_0x50f76a({'count':_0x2d3a45[_0x4b0d('0x5c')],'rows':_0x2d3a45});});},'Outbound':function(_0x59eca3){return new Promise(function(_0x43f333,_0x1f1882){_0x43f333(_0xd9e767[_0x4b0d('0x7b')]);});},'Campaigns':function(_0x27ccc4){return new Promise(function(_0x64debc,_0x32a806){var _0x5a5ef0=_[_0x4b0d('0x5a')](_0xd9e767[_0x4b0d('0x7c')]);_0x64debc({'count':_0x5a5ef0[_0x4b0d('0x5c')],'rows':_0x5a5ef0});});},'VoiceQueuesPreview':function(_0x58d2bf){var _0x3173f6=this;return new Promise(function(_0x4d0b47,_0x33b520){_0x49eb9f[_0x4b0d('0x7d')](_0x58d2bf['id'])[_0x4b0d('0x1a')](function(_0x4069fe){_0x4d0b47({'code':0xc8,'message':_0x4069fe[_0x4b0d('0x1b')]});})[_0x4b0d('0x21')](function(_0x1eb660){_0x33b520(_0x3173f6[_0x4b0d('0x1c')](0x1f4,_0x1eb660[_0x4b0d('0x1b')]));});});},'EventManager':function(_0x5d89e4){var _0x7adb0e=this;return new Promise(function(_0x34d76f,_0x1310d9){if(!_0x5d89e4['event']){return _0x1310d9(_0x7adb0e[_0x4b0d('0x1c')](0x1f4,_0x4b0d('0x7e')));}ami[_0x4b0d('0x7f')]('custom:'+_0x5d89e4[_0x4b0d('0x80')],_0x5d89e4['message']);_0x34d76f({'code':0xc8,'message':_0x5d89e4});});},'FaxAccounts':function(_0x5484a6){return new Promise(function(_0x8d98c4,_0x4456fb){var _0x2b45c6=_[_0x4b0d('0x5a')](_0xd9e767['faxAccounts']);_0x8d98c4({'count':_0x2b45c6[_0x4b0d('0x5c')],'rows':_0x2b45c6});});},'SendFax':function(_0x57a8a5){var _0x5a7711=this;return new Promise(function(_0x4478fc,_0x3ab5f0){_0x49ab42['send'](_0x57a8a5)[_0x4b0d('0x1a')](function(_0x2a0051){_0x4478fc({'code':0xc8,'message':_0x2a0051[_0x4b0d('0x1b')]});})[_0x4b0d('0x21')](function(_0x4b5494){_0x3ab5f0(_0x5a7711['error'](0x1f4,_0x4b5494[_0x4b0d('0x1b')]));});});},'CheckAfterSend':function(_0x185624){var _0x3af5d9=this;return new Promise(function(_0x3396f8,_0xb8614e){_0x49ab42[_0x4b0d('0x81')](_0x185624)[_0x4b0d('0x1a')](function(_0x5add17){_0x3396f8({'code':0xc8,'message':_0x5add17['message']});})[_0x4b0d('0x21')](function(_0x1285c6){_0xb8614e(_0x3af5d9['error'](0x1f4,_0x1285c6[_0x4b0d('0x1b')]));});});}};var _0x314f36=jayson[_0x4b0d('0x82')](_0x10977e)[_0x4b0d('0x83')]();_0x314f36['on'](_0x4b0d('0x1c'),function(_0xda7a28){return _0x368fb5(_0xda7a28);});_0x314f36[_0x4b0d('0x84')](0x232a,_0x4b0d('0x85'),function(){console[_0x4b0d('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x57186c(_0x4b0d('0x87')+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 4cc6624..db34e59 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 _0xf4b9=['then','[%s][%s]\x20Contact\x20found:%s','format','user:%s','name','trigger:%s','toLowerCase','createContact','[%s][%s]\x20Contact\x20created:%s','xmd-contactid2','action','merge','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','util','lodash','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','calleridname','','uniqueid','firstName','destcalleridname','destcalleridnum','phone','showContact','omit'];(function(_0x4a15e2,_0x4816fc){var _0x243935=function(_0x2e252d){while(--_0x2e252d){_0x4a15e2['push'](_0x4a15e2['shift']());}};_0x243935(++_0x4816fc);}(_0xf4b9,0xbc));var _0x9f4b=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf4b9[_0xd0b415];return _0x2bdf2c;};'use strict';var BPromise=require('bluebird');var util=require(_0x9f4b('0x0'));var _=require(_0x9f4b('0x1'));var Redis=require('ioredis');var config=require(_0x9f4b('0x2'));var logger=require(_0x9f4b('0x3'))('trigger');var cmContactRpc=require(_0x9f4b('0x4'));config['redis']=_[_0x9f4b('0x5')](config[_0x9f4b('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x9f4b('0x7'))(new Redis(config[_0x9f4b('0x6')]));function emit(_0x38f3cb,_0x95d27a,_0x4c0a1c,_0x12ce7){logger[_0x9f4b('0x8')](_0x9f4b('0x9'),_0x38f3cb,'',_0x95d27a,_0x4c0a1c,JSON[_0x9f4b('0xa')](_0x12ce7));io['to'](_0x95d27a)[_0x9f4b('0xb')](_0x4c0a1c,_0x12ce7);}exports[_0x9f4b('0xc')]=function(_0xa8bb9f,_0x503f93,_0x4558af){_0x4558af[_0x9f4b('0xd')]=0x0;if(_0x503f93[_0x9f4b('0xe')]&&parseInt(_0x503f93[_0x9f4b('0xe')],0xa)){var _0x3b7941={'ListId':parseInt(_0x503f93[_0x9f4b('0xf')],0xa),'phone':_0x4558af[_0x9f4b('0x10')]};if(_[_0x9f4b('0x11')](_0x4558af['routeId'])){_0x3b7941['firstName']=_0x4558af['calleridname']&&_0x4558af[_0x9f4b('0x12')]!==_0x9f4b('0x13')?_0x4558af[_0x9f4b('0x12')]:_0x4558af[_0x9f4b('0x10')]||_0x4558af[_0x9f4b('0x14')];}else{_0x3b7941[_0x9f4b('0x15')]=_0x4558af[_0x9f4b('0x16')]&&_0x4558af[_0x9f4b('0x16')]!==_0x9f4b('0x13')?_0x4558af[_0x9f4b('0x16')]:_0x4558af[_0x9f4b('0x17')]||_0x4558af['uniqueid'];_0x3b7941[_0x9f4b('0x18')]=_0x4558af[_0x9f4b('0x16')]&&_0x4558af[_0x9f4b('0x16')]!==_0x9f4b('0x13')?_0x4558af['destcalleridname']:_0x4558af[_0x9f4b('0x17')]||_0x4558af['uniqueid'];}BPromise['resolve']()['then'](cmContactRpc[_0x9f4b('0x19')]({'where':_[_0x9f4b('0x1a')](_0x3b7941,[_0x9f4b('0x15')])}))[_0x9f4b('0x1b')](function(_0x303fe0){if(_0x303fe0){logger['info'](_0x9f4b('0x1c'),_0x4558af['uniqueid'],'',_0x303fe0['id']);if(_0xa8bb9f){_0x4558af['xmd-contactid2']=_0x303fe0['id'];emit(_0x4558af[_0x9f4b('0x14')],util[_0x9f4b('0x1d')](_0x9f4b('0x1e'),_0xa8bb9f[_0x9f4b('0x1f')]),util[_0x9f4b('0x1d')](_0x9f4b('0x20'),_0x503f93['action'][_0x9f4b('0x21')]()),_['merge'](_0x4558af,{'ListId':parseInt(_0x503f93[_0x9f4b('0xf')],0xa)}));}return;}else{logger['info']('[%s][%s]\x20Contact\x20not\x20found',_0x4558af[_0x9f4b('0x14')],'');return BPromise['resolve']()['then'](cmContactRpc[_0x9f4b('0x22')](_0x3b7941));}})['then'](function(_0x38ec55){if(_0x38ec55){logger[_0x9f4b('0x8')](_0x9f4b('0x23'),_0x4558af[_0x9f4b('0x14')],'',_0x38ec55['id']);if(_0xa8bb9f){_0x4558af[_0x9f4b('0x24')]=_0x38ec55['id'];emit(_0x4558af['uniqueid'],util[_0x9f4b('0x1d')](_0x9f4b('0x1e'),_0xa8bb9f[_0x9f4b('0x1f')]),util['format'](_0x9f4b('0x20'),_0x503f93[_0x9f4b('0x25')][_0x9f4b('0x21')]()),_[_0x9f4b('0x26')](_0x4558af,{'ListId':parseInt(_0x503f93[_0x9f4b('0xf')],0xa)}));}}})[_0x9f4b('0x27')](function(_0x3ad0f8){logger[_0x9f4b('0x28')](_0x9f4b('0x29'),_0x4558af['uniqueid'],'',JSON[_0x9f4b('0xa')](_0x3ad0f8));});}else{if(_0xa8bb9f){logger[_0x9f4b('0x8')](_0x9f4b('0x2a'),_0x4558af[_0x9f4b('0x14')],'');emit(_0x4558af[_0x9f4b('0x14')],util[_0x9f4b('0x1d')](_0x9f4b('0x1e'),_0xa8bb9f['name']),util[_0x9f4b('0x1d')](_0x9f4b('0x20'),_0x503f93[_0x9f4b('0x25')][_0x9f4b('0x21')]()),_['merge']({'ListId':parseInt(_0x503f93['data1'],0xa)},_0x4558af));}}}; \ No newline at end of file +var _0x1798=['../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','calleridnum','routeId','calleridname','','destcalleridname','destcalleridnum','uniqueid','phone','then','showContact','omit','firstName','xmd-contactid2','format','action','toLowerCase','merge','data1','[%s][%s]\x20Contact\x20not\x20found','resolve','createContact','name','trigger:%s','catch','[%s][%s]\x20Error\x20creating\x20contact','user:%s','bluebird','util','lodash','../../../../config/logger','trigger'];(function(_0x323fbe,_0x49950e){var _0xf491ed=function(_0x3a6169){while(--_0x3a6169){_0x323fbe['push'](_0x323fbe['shift']());}};_0xf491ed(++_0x49950e);}(_0x1798,0xa7));var _0x8179=function(_0x47668e,_0x4e33da){_0x47668e=_0x47668e-0x0;var _0x1b8abf=_0x1798[_0x47668e];return _0x1b8abf;};'use strict';var BPromise=require(_0x8179('0x0'));var util=require(_0x8179('0x1'));var _=require(_0x8179('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x8179('0x3'))(_0x8179('0x4'));var cmContactRpc=require(_0x8179('0x5'));config[_0x8179('0x6')]=_[_0x8179('0x7')](config[_0x8179('0x6')],{'host':_0x8179('0x8'),'port':0x18eb});var io=require(_0x8179('0x9'))(new Redis(config[_0x8179('0x6')]));function emit(_0x35335b,_0x3d5eaf,_0x1ab939,_0x13e69e){logger[_0x8179('0xa')](_0x8179('0xb'),_0x35335b,'',_0x3d5eaf,_0x1ab939,JSON[_0x8179('0xc')](_0x13e69e));io['to'](_0x3d5eaf)[_0x8179('0xd')](_0x1ab939,_0x13e69e);}exports[_0x8179('0xe')]=function(_0x21b973,_0x3b1ecd,_0x577ce5){_0x577ce5[_0x8179('0xf')]=0x0;if(_0x3b1ecd['data2']&&parseInt(_0x3b1ecd[_0x8179('0x10')],0xa)){var _0xd5c09e={'ListId':parseInt(_0x3b1ecd['data1'],0xa),'phone':_0x577ce5[_0x8179('0x11')]};if(_['isNil'](_0x577ce5[_0x8179('0x12')])){_0xd5c09e['firstName']=_0x577ce5[_0x8179('0x13')]&&_0x577ce5[_0x8179('0x13')]!==_0x8179('0x14')?_0x577ce5[_0x8179('0x13')]:_0x577ce5[_0x8179('0x11')]||_0x577ce5['uniqueid'];}else{_0xd5c09e['firstName']=_0x577ce5['destcalleridname']&&_0x577ce5[_0x8179('0x15')]!==_0x8179('0x14')?_0x577ce5[_0x8179('0x15')]:_0x577ce5[_0x8179('0x16')]||_0x577ce5[_0x8179('0x17')];_0xd5c09e[_0x8179('0x18')]=_0x577ce5[_0x8179('0x15')]&&_0x577ce5['destcalleridname']!==_0x8179('0x14')?_0x577ce5['destcalleridname']:_0x577ce5[_0x8179('0x16')]||_0x577ce5[_0x8179('0x17')];}BPromise['resolve']()[_0x8179('0x19')](cmContactRpc[_0x8179('0x1a')]({'where':_[_0x8179('0x1b')](_0xd5c09e,[_0x8179('0x1c')])}))['then'](function(_0x56a038){if(_0x56a038){logger[_0x8179('0xa')]('[%s][%s]\x20Contact\x20found:%s',_0x577ce5[_0x8179('0x17')],'',_0x56a038['id']);if(_0x21b973){_0x577ce5[_0x8179('0x1d')]=_0x56a038['id'];emit(_0x577ce5[_0x8179('0x17')],util[_0x8179('0x1e')]('user:%s',_0x21b973['name']),util['format']('trigger:%s',_0x3b1ecd[_0x8179('0x1f')][_0x8179('0x20')]()),_[_0x8179('0x21')](_0x577ce5,{'ListId':parseInt(_0x3b1ecd[_0x8179('0x22')],0xa)}));}return;}else{logger[_0x8179('0xa')](_0x8179('0x23'),_0x577ce5['uniqueid'],'');return BPromise[_0x8179('0x24')]()[_0x8179('0x19')](cmContactRpc[_0x8179('0x25')](_0xd5c09e));}})[_0x8179('0x19')](function(_0x56c027){if(_0x56c027){logger[_0x8179('0xa')]('[%s][%s]\x20Contact\x20created:%s',_0x577ce5[_0x8179('0x17')],'',_0x56c027['id']);if(_0x21b973){_0x577ce5[_0x8179('0x1d')]=_0x56c027['id'];emit(_0x577ce5[_0x8179('0x17')],util['format']('user:%s',_0x21b973[_0x8179('0x26')]),util[_0x8179('0x1e')](_0x8179('0x27'),_0x3b1ecd['action']['toLowerCase']()),_['merge'](_0x577ce5,{'ListId':parseInt(_0x3b1ecd[_0x8179('0x22')],0xa)}));}}})[_0x8179('0x28')](function(_0x5db153){logger['error'](_0x8179('0x29'),_0x577ce5[_0x8179('0x17')],'',JSON[_0x8179('0xc')](_0x5db153));});}else{if(_0x21b973){logger[_0x8179('0xa')]('[%s][%s]\x20Autocreate\x20disabled',_0x577ce5['uniqueid'],'');emit(_0x577ce5[_0x8179('0x17')],util[_0x8179('0x1e')](_0x8179('0x2a'),_0x21b973[_0x8179('0x26')]),util[_0x8179('0x1e')](_0x8179('0x27'),_0x3b1ecd[_0x8179('0x1f')][_0x8179('0x20')]()),_[_0x8179('0x21')]({'ListId':parseInt(_0x3b1ecd[_0x8179('0x22')],0xa)},_0x577ce5));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 24c6e9b..940c9b1 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 _0x55e2=['queue','routeId','query','search','replace','checkTrigger','every','AllConditions','channel','AnyConditions','some','checkConditions','account','operator','value','ChatWebsiteId','AccountId','upperFirst','agent','membername','lastevent','util','lodash','url','mustache','ioredis','./urlforward','./integration','./script','../rpc/cmContact','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','vtigerAccounts','custom:agentcalled','bind','custom:agentcomplete','syncCustomEvent','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','status','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','html','data2','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','800','data5','windowHeight','data6','600','winArguments','render','format','name','trigger:%s:%s','user:%s','merge','trigger:%s','exec'];(function(_0x4eefa,_0xb748e5){var _0x52210f=function(_0x4a77a9){while(--_0x4a77a9){_0x4eefa['push'](_0x4eefa['shift']());}};_0x52210f(++_0xb748e5);}(_0x55e2,0xef));var _0x255e=function(_0x2a65f7,_0xbaae8b){_0x2a65f7=_0x2a65f7-0x0;var _0x14db28=_0x55e2[_0x2a65f7];return _0x14db28;};'use strict';var util=require(_0x255e('0x0'));var _=require(_0x255e('0x1'));var url=require(_0x255e('0x2'));var Mustache=require(_0x255e('0x3'));var Redis=require(_0x255e('0x4'));var urlforward=require(_0x255e('0x5'));var integration=require(_0x255e('0x6'));var cmContact=require('./cmContact');var script=require(_0x255e('0x7'));var cmContactRpc=require(_0x255e('0x8'));var config=require('../../../config/environment');var logger=require(_0x255e('0x9'))(_0x255e('0xa'));var ami=require('../ami');config[_0x255e('0xb')]=_[_0x255e('0xc')](config['redis'],{'host':_0x255e('0xd'),'port':0x18eb});var io=require(_0x255e('0xe'))(new Redis(config['redis']));var operators={'equals':function(_0x4a64da,_0x149fd7){return _0x4a64da==_0x149fd7;},'not_equals':function(_0x4e2cd5,_0x1f9587){return _0x4e2cd5!=_0x1f9587;}};var barAndWebActions=[_0x255e('0xf'),_0x255e('0x2'),_0x255e('0x10')];function Trigger(_0x311d4c){this['triggers']=_0x311d4c[_0x255e('0x11')];this[_0x255e('0x12')]=_0x311d4c[_0x255e('0x12')];this['voiceQueues']=_0x311d4c[_0x255e('0x13')];this[_0x255e('0x14')]=_0x311d4c[_0x255e('0x14')];this[_0x255e('0x15')]=_0x311d4c[_0x255e('0x15')];this[_0x255e('0x16')]=_0x311d4c['zendeskAccounts'];this['freshdeskAccounts']=_0x311d4c['freshdeskAccounts'];this[_0x255e('0x17')]=_0x311d4c[_0x255e('0x17')];this[_0x255e('0x18')]=_0x311d4c[_0x255e('0x18')];this['zohoAccounts']=_0x311d4c['zohoAccounts'];this[_0x255e('0x19')]=_0x311d4c[_0x255e('0x19')];this['vtigerAccounts']=_0x311d4c['vtigerAccounts'];this[_0x255e('0x1a')]=_0x311d4c['servicenowAccounts'];this[_0x255e('0x1b')]=_0x311d4c[_0x255e('0x1b')];this[_0x255e('0x1c')]=_0x311d4c['freshsalesAccounts'];this[_0x255e('0x1d')]={'zendesk':this[_0x255e('0x16')],'salesforce':this[_0x255e('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x255e('0x18')],'zoho':this[_0x255e('0x1e')],'desk':this[_0x255e('0x19')],'vtiger':this[_0x255e('0x1f')],'dynamics365':this[_0x255e('0x1b')],'freshsales':this[_0x255e('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x255e('0x20'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x255e('0x21')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent']['bind'](this));ami['on'](_0x255e('0x22'),this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on'](_0x255e('0x24'),this['syncCustomEvent'][_0x255e('0x21')](this));ami['on']('custom:agentnoanswer',this[_0x255e('0x23')]['bind'](this));ami['on'](_0x255e('0x25'),this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on'](_0x255e('0x26'),this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on'](_0x255e('0x27'),this['syncCustomEvent'][_0x255e('0x21')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x255e('0x21')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x255e('0x21')](this));ami['on']('custom:dialbegin',this[_0x255e('0x28')][_0x255e('0x21')](this));ami['on']('custom:dialconnect',this[_0x255e('0x28')][_0x255e('0x21')](this));ami['on'](_0x255e('0x29'),this[_0x255e('0x28')][_0x255e('0x21')](this));ami['on'](_0x255e('0x2a'),this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on']('custom:closedinteraction',this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on'](_0x255e('0x2b'),this[_0x255e('0x23')]['bind'](this));ami['on'](_0x255e('0x2c'),this['syncCustomEvent'][_0x255e('0x21')](this));ami['on'](_0x255e('0x2d'),this[_0x255e('0x23')][_0x255e('0x21')](this));ami['on']('custom:rejectmessage',this[_0x255e('0x23')][_0x255e('0x21')](this));}Trigger[_0x255e('0x2e')][_0x255e('0x2f')]=function(_0x148d61,_0x52606f,_0x1663b7){logger[_0x255e('0x30')](_0x148d61,_0x52606f,JSON[_0x255e('0x31')](_0x1663b7));io['to'](_0x148d61)['emit'](_0x52606f,_0x1663b7);};Trigger[_0x255e('0x2e')]['syncCustomEvent']=function(_0x56ba2d){var _0x2af0d8=_[_0x255e('0x32')](_0x56ba2d);this[_0x255e('0x33')](_0x2af0d8);};Trigger[_0x255e('0x2e')]['syncAgentDial']=function(_0xd66b9f){if(this[_0x255e('0x12')][_0xd66b9f[_0x255e('0x34')]]){this[_0x255e('0x23')](_0xd66b9f);}};Trigger['prototype']['checkTriggers']=function(_0x18e479){var _0x1c2608;for(var _0x329ea0 in this[_0x255e('0x11')]){if(this[_0x255e('0x11')]['hasOwnProperty'](_0x329ea0)){if(this[_0x255e('0x11')][_0x329ea0][_0x255e('0x35')]){_0x1c2608=this['checkTrigger'](this[_0x255e('0x11')][_0x329ea0],_0x18e479);if(_0x1c2608){_['merge'](_0x18e479,_0x18e479[_0x255e('0x36')]);for(var _0x36c1c5=0x0,_0x5201ce,_0x5db6f7,_0x4852e6;_0x36c1c50x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ No newline at end of file +var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ 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 191b127..f1b0934 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 _0x8c57=['inspect','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','clientId','remoteUri','username','clientSecret','access_token','error','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','userEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','Bearer\x20','4.0','headers','substring','lastIndexOf','enduserId','catch','telephone1','contactid',']\x20Enduser\x20Created!','type','string','nameField','customField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','Fields','ticketType','phonecall','phonecalls','callDirection','queue','/contacts(','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','serverUrl','stripTrailingSlash','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x2ee973,_0x284293){var _0x2b5468=function(_0x1edf6b){while(--_0x1edf6b){_0x2ee973['push'](_0x2ee973['shift']());}};_0x2b5468(++_0x284293);}(_0x8c57,0x181));var _0x78c5=function(_0x4d41b2,_0x3d7483){_0x4d41b2=_0x4d41b2-0x0;var _0xcd37fc=_0x8c57[_0x4d41b2];return _0xcd37fc;};'use strict';var _=require(_0x78c5('0x0'));var BPromise=require(_0x78c5('0x1'));var rp=require(_0x78c5('0x2'));var util=require(_0x78c5('0x3'));var intUtil=require(_0x78c5('0x4'));var md5=require(_0x78c5('0x5'));var Redis=require('ioredis');var logger=require(_0x78c5('0x6'))(_0x78c5('0x7'));var config=require(_0x78c5('0x8'));config[_0x78c5('0x9')]=_[_0x78c5('0xa')](config[_0x78c5('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x78c5('0xb'))(new Redis(config[_0x78c5('0x9')]));function getAuthToken(_0x24a286,_0x73779c,_0x5d3bd5){var _0x1f04b5={'method':'POST','uri':_0x73779c,'form':{'client_id':_0x24a286[_0x78c5('0xc')],'resource':_0x24a286[_0x78c5('0xd')],'username':_0x24a286[_0x78c5('0xe')],'password':_0x24a286['password'],'grant_type':'password','client_secret':_0x24a286[_0x78c5('0xf')]},'json':!![]};return rp(_0x1f04b5)['then'](function(_0x5a32e8){return _0x5a32e8[_0x78c5('0x10')];})['catch'](function(_0x2678c3){logger[_0x78c5('0x11')]('['+[_0x5d3bd5['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x2678c3[_0x78c5('0x12')];});}function getUser(_0x208ac0,_0x21687a,_0x1d8408,_0x29064f,_0x1cdf7e,_0x11b411){return new BPromise(function(_0x3cb3fe,_0x1651d4){return getAuthToken(_0x21687a,_0x29064f,_0x11b411)[_0x78c5('0x13')](function(_0x41e886){var _0x24b5ca={'method':_0x78c5('0x14'),'uri':_0x1cdf7e+_0x78c5('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x41e886,'OData-Version':'4.0'},'json':!![]};return rp(_0x24b5ca);})['then'](function(_0x41414b){var _0x1ec1d0=_0x41414b[_0x78c5('0x16')];var _0x171533=![];var _0x2e6caa=null;if(!_[_0x78c5('0x17')](_0x1d8408)){if(intUtil[_0x78c5('0x18')](_0x1d8408['email'])){_0x208ac0[_0x78c5('0x19')]=_0x1d8408['email'];for(_0x2e6caa=0x0;_0x2e6caa<_0x1ec1d0[_0x78c5('0x1a')];_0x2e6caa++){if(_0x1ec1d0[_0x2e6caa][_0x78c5('0x1b')]===_0x1d8408[_0x78c5('0x1c')]&&!_0x1ec1d0[_0x2e6caa][_0x78c5('0x1d')]){_0x171533=!![];logger[_0x78c5('0x1e')]('['+[_0x11b411['toUpperCase']()]+_0x78c5('0x1f')+_0x1ec1d0[_0x2e6caa]['systemuserid']+'!');_0x208ac0['userId']=_0x1ec1d0[_0x2e6caa][_0x78c5('0x20')];}}}}if(!_0x171533){logger[_0x78c5('0x1e')]('['+[_0x11b411[_0x78c5('0x21')]()]+_0x78c5('0x22'));_0x208ac0['userEmail']=_0x21687a['username'];for(_0x2e6caa=0x0;_0x2e6caa<_0x1ec1d0['length'];_0x2e6caa++){if(_0x1ec1d0[_0x2e6caa][_0x78c5('0x1b')]===_0x21687a[_0x78c5('0xe')]){_0x208ac0[_0x78c5('0x23')]=_0x1ec1d0[_0x2e6caa][_0x78c5('0x20')];}}}_0x3cb3fe(_0x208ac0);})['catch'](function(_0x110ac7){_0x1651d4(_0x110ac7[_0x78c5('0x12')]);});});}function createEndUser(_0x5dfec7,_0x190f8d,_0x1342c4,_0x393280,_0x5ca89e,_0x2d951c){return new BPromise(function(_0x445db4,_0x52904f){return getAuthToken(_0x190f8d,_0x1342c4,_0x2d951c)['then'](function(_0x41e763){var _0x321185=_0x2d951c[_0x78c5('0x24')]()===_0x78c5('0x25')?_0x5ca89e[_0x78c5('0x26')]:_0x5ca89e[_0x78c5('0x27')];var _0x141c8e={'method':_0x78c5('0x28'),'uri':_0x393280+_0x78c5('0x29'),'body':{'telephone1':_0x321185,'fullname':_0x321185,'firstname':_0x321185,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x78c5('0x2a')+_0x5dfec7['userId']+')'},'headers':{'Authorization':_0x78c5('0x2b')+_0x41e763,'OData-Version':_0x78c5('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x141c8e);})['then'](function(_0x5f4de9){var _0x3878f3=_0x5f4de9[_0x78c5('0x2d')]['odata-entityid'];var _0x2d871d=_0x3878f3[_0x78c5('0x2e')](_0x3878f3[_0x78c5('0x2f')]('(')+0x1,_0x3878f3['lastIndexOf'](')'));_0x5dfec7[_0x78c5('0x30')]=_0x2d871d;_0x445db4(_0x5dfec7);})[_0x78c5('0x31')](function(_0x316c0f){_0x52904f(_0x316c0f['message']);});});}function getEndUser(_0x23a6b1,_0x36c33c,_0x269131,_0x169b05,_0x557c61,_0x5d8459){return new BPromise(function(_0x19d3cf,_0x3eaf6e){return getAuthToken(_0x36c33c,_0x269131,_0x5d8459)[_0x78c5('0x13')](function(_0x4a9a92){var _0x4eb30f={'method':'GET','uri':_0x169b05+'contacts?$select=telephone1','headers':{'Authorization':_0x78c5('0x2b')+_0x4a9a92,'If-None-Match':null,'OData-Version':_0x78c5('0x2c')},'json':!![]};return rp(_0x4eb30f);})[_0x78c5('0x13')](function(_0x47e961){var _0x9c7ca6=null;if(_0x47e961){var _0x1746ea=_0x47e961['value'];var _0x5358eb=![];for(_0x9c7ca6=0x0;_0x9c7ca6<_0x1746ea[_0x78c5('0x1a')];_0x9c7ca6++){var _0x320c17=_0x5d8459[_0x78c5('0x24')]()===_0x78c5('0x25')?_0x557c61['destcalleridnum']:_0x557c61[_0x78c5('0x27')];if(_0x1746ea[_0x9c7ca6][_0x78c5('0x32')]===_0x320c17){_0x5358eb=!![];_0x23a6b1[_0x78c5('0x30')]=_0x1746ea[_0x9c7ca6][_0x78c5('0x33')];}}if(_0x5358eb){_0x19d3cf(_0x23a6b1);}else{return createEndUser(_0x23a6b1,_0x36c33c,_0x269131,_0x169b05,_0x557c61,_0x5d8459)[_0x78c5('0x13')](function(_0x5d76ad){logger[_0x78c5('0x1e')]('['+[_0x5d8459[_0x78c5('0x21')]()]+']\x20Enduser\x20created!',_0x5d76ad[_0x78c5('0x30')]);_0x19d3cf(_0x5d76ad);});}}else{return createEndUser(_0x23a6b1,_0x36c33c,_0x269131,_0x169b05,_0x557c61,_0x5d8459)[_0x78c5('0x13')](function(_0x34d567){logger['info']('['+[_0x5d8459['toUpperCase']()]+_0x78c5('0x34'),_0x34d567['enduserId']);_0x19d3cf(_0x34d567);});}});});}function getCustomFields(_0x440b4a,_0x3666f1,_0x5240e0){var _0x36b138={};if(_0x440b4a[_0x78c5('0x1a')]>0x0){_['forEach'](_0x440b4a,function(_0x4413ef){if(_0x4413ef[_0x78c5('0x35')]===_0x78c5('0x36')&&_0x4413ef[_0x78c5('0x37')]&&!_0x4413ef[_0x78c5('0x38')]){var _0x14e42f=_0x4413ef['idField'][_0x78c5('0x24')]();var _0xb05179=_0x14e42f[_0x78c5('0x2e')](0x0,_0x14e42f['indexOf']('_'));var _0xf5978a=_0x14e42f[_0x78c5('0x2e')](_0x14e42f[_0x78c5('0x39')]('_')+0x1);if(_0xb05179===_0x5240e0){_0x36b138[_0xf5978a]=_0x4413ef[_0x78c5('0x3a')];}}});}return _0x36b138;}function getTicket(_0x3247a7,_0x553fe7,_0x5a24e0,_0xc795f8,_0x1988db,_0x310dec,_0x3ab373){return new BPromise(function(_0x2fbc7c,_0x2f5722){var _0x1df445;return getAuthToken(_0x553fe7,_0x5a24e0,_0x3ab373)['then'](function(_0x4b6f73){if(_0x310dec['ticketType']===_0x78c5('0x3b')){_0x1df445={'method':'POST','uri':_0xc795f8+_0x78c5('0x3c'),'body':Object[_0x78c5('0x3d')]({},{'title':intUtil[_0x78c5('0x3e')](_0x310dec[_0x78c5('0x3f')],_0x1988db,'\x20'),'description':intUtil[_0x78c5('0x3e')](_0x310dec[_0x78c5('0x40')],_0x1988db,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x3247a7[_0x78c5('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x3247a7['userId']+')','caseorigincode':'1'},getCustomFields(_0x310dec[_0x78c5('0x41')],_0x1988db,_0x310dec[_0x78c5('0x42')])),'headers':{'Authorization':_0x78c5('0x2b')+_0x4b6f73,'OData-Version':_0x78c5('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x310dec[_0x78c5('0x42')]===_0x78c5('0x43')){_0x1df445={'method':'POST','uri':_0xc795f8+_0x78c5('0x44'),'body':Object['assign']({},{'subject':intUtil[_0x78c5('0x3e')](_0x310dec['Subjects'],_0x1988db,'\x20'),'phonenumber':String(_0x1988db[_0x78c5('0x27')]),'description':intUtil[_0x78c5('0x3e')](_0x310dec[_0x78c5('0x40')],_0x1988db,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x3247a7[_0x78c5('0x30')]+')','ownerid@odata.bind':_0x78c5('0x2a')+_0x3247a7[_0x78c5('0x23')]+')','directioncode':_0x3247a7[_0x78c5('0x45')]===_0x78c5('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x78c5('0x2a')+_0x3247a7[_0x78c5('0x23')]+')','participationtypemask':_0x3247a7[_0x78c5('0x45')]===_0x78c5('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x78c5('0x47')+_0x3247a7[_0x78c5('0x30')]+')','participationtypemask':_0x3247a7[_0x78c5('0x45')]===_0x78c5('0x46')?0x1:0x2}]},getCustomFields(_0x310dec[_0x78c5('0x41')],_0x1988db,_0x310dec[_0x78c5('0x42')])),'headers':{'Authorization':_0x78c5('0x2b')+_0x4b6f73,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1df445);})['then'](function(_0x1ce6f3){var _0x2fb1a5=_0x1ce6f3[_0x78c5('0x2d')][_0x78c5('0x48')];var _0x986a35=_0x2fb1a5[_0x78c5('0x2e')](_0x2fb1a5['lastIndexOf']('(')+0x1,_0x2fb1a5[_0x78c5('0x2f')](')'));_0x3247a7['ticketId']=_0x986a35;_0x2fbc7c(_0x3247a7);})[_0x78c5('0x31')](function(_0x3409da){_0x2f5722(_0x3409da['message']);});});}function emit(_0x5c9a21,_0x12db6e,_0x32d346,_0x152706){var _0x57f769={'uri':util[_0x78c5('0x49')](_0x78c5('0x4a'),_0x5c9a21,_0x32d346,_0x152706)};io['to'](util[_0x78c5('0x49')](_0x78c5('0x4b'),_0x12db6e))[_0x78c5('0x4c')]('trigger:browser:url',_0x57f769);}exports['cs']=function(_0x308387,_0x51fda1,_0x5b2fdb,_0x2c658c,_0x227ff1,_0x208b86,_0x616d36,_0x17eb0b){var _0x5f483c={};_0x208b86['remoteUri']=intUtil['stripTrailingSlash'](_0x208b86[_0x78c5('0xd')]);_0x208b86[_0x78c5('0x4d')]=intUtil[_0x78c5('0x4e')](_0x208b86[_0x78c5('0x4d')]);_0x5f483c[_0x78c5('0x45')]=_0x17eb0b===_0x78c5('0x46')||_0x17eb0b===_0x78c5('0x4f')?_0x78c5('0x46'):_0x78c5('0x25');var _0x469bea=util[_0x78c5('0x49')]('%s/api/data/v9.0/',_0x208b86['remoteUri']);var _0x4b9490=util[_0x78c5('0x49')](_0x78c5('0x50'),_0x208b86['tenantId']);var _0x562f4e=util[_0x78c5('0x49')](_0x78c5('0x51'),_0x208b86[_0x78c5('0x4d')],_0x51fda1[_0x78c5('0x52')],md5(_0x51fda1['uniqueid']));if(_0x227ff1&&_0x227ff1[_0x78c5('0x53')]){logger[_0x78c5('0x1e')](_0x78c5('0x54'),'Recording\x20is\x20enabled!');_0x51fda1[_0x78c5('0x55')]=_0x562f4e;}else if(_0x616d36&&_0x616d36['recordingFormat']&&_0x616d36[_0x78c5('0x56')]!==_0x78c5('0x57')){logger['info'](_0x78c5('0x58'),'Recording\x20is\x20enabled!');_0x51fda1[_0x78c5('0x55')]=_0x562f4e;}else{_0x51fda1[_0x78c5('0x55')]='';}return getUser(_0x5f483c,_0x208b86,_0x2c658c,_0x4b9490,_0x469bea,_0x17eb0b)['then'](function(_0x456c21){logger[_0x78c5('0x1e')]('['+_0x17eb0b['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x456c21['userId']);logger[_0x78c5('0x1e')]('['+_0x17eb0b[_0x78c5('0x21')]()+_0x78c5('0x59'),_0x456c21[_0x78c5('0x19')]);return getEndUser(_0x456c21,_0x208b86,_0x4b9490,_0x469bea,_0x51fda1,_0x17eb0b);})[_0x78c5('0x13')](function(_0x4cb5f5){logger['info']('['+_0x17eb0b[_0x78c5('0x21')]()+_0x78c5('0x5a'),_0x4cb5f5[_0x78c5('0x30')]);logger[_0x78c5('0x1e')]('['+_0x17eb0b[_0x78c5('0x21')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x51fda1['calleridnum']);return getTicket(_0x4cb5f5,_0x208b86,_0x4b9490,_0x469bea,_0x51fda1,_0x5b2fdb,_0x17eb0b);})['then'](function(_0xa654f5){logger[_0x78c5('0x1e')](util['format']('['+_0x17eb0b[_0x78c5('0x21')]()+_0x78c5('0x5b'),_0x5b2fdb['ticketType'],_0xa654f5[_0x78c5('0x5c')]));logger['info'](util['format']('['+_0x17eb0b[_0x78c5('0x21')]()+_0x78c5('0x5d'),_0x17eb0b));if(_0x17eb0b!=='unmanaged'){logger[_0x78c5('0x1e')]('['+_0x17eb0b[_0x78c5('0x21')]()+']',_0x78c5('0x5e'));emit(_0x208b86[_0x78c5('0xd')],_0x2c658c['name'],_0x5b2fdb[_0x78c5('0x42')],_0xa654f5[_0x78c5('0x5c')]);}})[_0x78c5('0x31')](function(_0x54bf3e){logger[_0x78c5('0x11')]('['+_0x17eb0b[_0x78c5('0x21')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x78c5('0x5f')](_0x54bf3e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xea45=['userEmail','length','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info','toLowerCase','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','catch','outbound','destcalleridnum','telephone1',']\x20Enduser\x20created!','string','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','callDirection','queue','ticketId','format','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email'];(function(_0x3cee22,_0x54ad32){var _0x286fa5=function(_0x3026e5){while(--_0x3026e5){_0x3cee22['push'](_0x3cee22['shift']());}};_0x286fa5(++_0x54ad32);}(_0xea45,0x14f));var _0x5ea4=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0xea45[_0x36f641];return _0x39b299;};'use strict';var _=require(_0x5ea4('0x0'));var BPromise=require(_0x5ea4('0x1'));var rp=require(_0x5ea4('0x2'));var util=require('util');var intUtil=require(_0x5ea4('0x3'));var md5=require(_0x5ea4('0x4'));var Redis=require(_0x5ea4('0x5'));var logger=require(_0x5ea4('0x6'))('dynamics365');var config=require(_0x5ea4('0x7'));config[_0x5ea4('0x8')]=_[_0x5ea4('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5ea4('0xa'))(new Redis(config['redis']));function getAuthToken(_0x1a8d67,_0x3365ea,_0x24c440){var _0x157e77={'method':_0x5ea4('0xb'),'uri':_0x3365ea,'form':{'client_id':_0x1a8d67[_0x5ea4('0xc')],'resource':_0x1a8d67[_0x5ea4('0xd')],'username':_0x1a8d67[_0x5ea4('0xe')],'password':_0x1a8d67[_0x5ea4('0xf')],'grant_type':_0x5ea4('0xf'),'client_secret':_0x1a8d67[_0x5ea4('0x10')]},'json':!![]};return rp(_0x157e77)[_0x5ea4('0x11')](function(_0xb83098){return _0xb83098['access_token'];})['catch'](function(_0x5b28e8){logger[_0x5ea4('0x12')]('['+[_0x24c440[_0x5ea4('0x13')]()]+_0x5ea4('0x14'));return _0x5b28e8[_0x5ea4('0x15')];});}function getUser(_0x2a63a0,_0x320126,_0x2ffb81,_0x2bafa7,_0x14c9e3,_0x12b4e2){return new BPromise(function(_0x326683,_0x1ed78d){return getAuthToken(_0x320126,_0x2bafa7,_0x12b4e2)[_0x5ea4('0x11')](function(_0x7b6003){var _0x764f3c={'method':'GET','uri':_0x14c9e3+_0x5ea4('0x16'),'headers':{'Authorization':_0x5ea4('0x17')+_0x7b6003,'OData-Version':_0x5ea4('0x18')},'json':!![]};return rp(_0x764f3c);})[_0x5ea4('0x11')](function(_0x3dbf0e){var _0x518590=_0x3dbf0e[_0x5ea4('0x19')];var _0xe9e09e=![];var _0x2bd85e=null;if(!_[_0x5ea4('0x1a')](_0x2ffb81)){if(intUtil[_0x5ea4('0x1b')](_0x2ffb81[_0x5ea4('0x1c')])){_0x2a63a0[_0x5ea4('0x1d')]=_0x2ffb81[_0x5ea4('0x1c')];for(_0x2bd85e=0x0;_0x2bd85e<_0x518590[_0x5ea4('0x1e')];_0x2bd85e++){if(_0x518590[_0x2bd85e]['internalemailaddress']===_0x2ffb81[_0x5ea4('0x1c')]&&!_0x518590[_0x2bd85e][_0x5ea4('0x1f')]){_0xe9e09e=!![];logger['info']('['+[_0x12b4e2[_0x5ea4('0x13')]()]+_0x5ea4('0x20')+_0x518590[_0x2bd85e][_0x5ea4('0x21')]+'!');_0x2a63a0[_0x5ea4('0x22')]=_0x518590[_0x2bd85e]['systemuserid'];}}}}if(!_0xe9e09e){logger[_0x5ea4('0x23')]('['+[_0x12b4e2[_0x5ea4('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2a63a0[_0x5ea4('0x1d')]=_0x320126[_0x5ea4('0xe')];for(_0x2bd85e=0x0;_0x2bd85e<_0x518590[_0x5ea4('0x1e')];_0x2bd85e++){if(_0x518590[_0x2bd85e]['internalemailaddress']===_0x320126[_0x5ea4('0xe')]){_0x2a63a0[_0x5ea4('0x22')]=_0x518590[_0x2bd85e][_0x5ea4('0x21')];}}}_0x326683(_0x2a63a0);})['catch'](function(_0x1c6e39){_0x1ed78d(_0x1c6e39['message']);});});}function createEndUser(_0xf54ae6,_0x512a2a,_0x54c67d,_0xac4ccc,_0x74a722,_0x483652){return new BPromise(function(_0x2e3576,_0x556f51){return getAuthToken(_0x512a2a,_0x54c67d,_0x483652)[_0x5ea4('0x11')](function(_0x4466bd){var _0x237258=_0x483652[_0x5ea4('0x24')]()==='outbound'?_0x74a722['destcalleridnum']:_0x74a722[_0x5ea4('0x25')];var _0xf45459={'method':_0x5ea4('0xb'),'uri':_0xac4ccc+_0x5ea4('0x26'),'body':{'telephone1':_0x237258,'fullname':_0x237258,'firstname':_0x237258,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5ea4('0x27')+_0xf54ae6['userId']+')'},'headers':{'Authorization':_0x5ea4('0x17')+_0x4466bd,'OData-Version':_0x5ea4('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf45459);})['then'](function(_0x38d03c){var _0x4c51c6=_0x38d03c[_0x5ea4('0x28')][_0x5ea4('0x29')];var _0x1063c5=_0x4c51c6[_0x5ea4('0x2a')](_0x4c51c6[_0x5ea4('0x2b')]('(')+0x1,_0x4c51c6[_0x5ea4('0x2b')](')'));_0xf54ae6[_0x5ea4('0x2c')]=_0x1063c5;_0x2e3576(_0xf54ae6);})[_0x5ea4('0x2d')](function(_0x20e309){_0x556f51(_0x20e309[_0x5ea4('0x15')]);});});}function getEndUser(_0x4819f5,_0x70088e,_0x2ff198,_0x416be4,_0x121c90,_0x1a256b){return new BPromise(function(_0x2f3ca6,_0x3150f6){return getAuthToken(_0x70088e,_0x2ff198,_0x1a256b)[_0x5ea4('0x11')](function(_0x353d14){var _0x243e6d={'method':'GET','uri':_0x416be4+'contacts?$select=telephone1','headers':{'Authorization':_0x5ea4('0x17')+_0x353d14,'If-None-Match':null,'OData-Version':_0x5ea4('0x18')},'json':!![]};return rp(_0x243e6d);})[_0x5ea4('0x11')](function(_0x48cd34){var _0x5c1c68=null;if(_0x48cd34){var _0x58e435=_0x48cd34[_0x5ea4('0x19')];var _0x5bc7e0=![];for(_0x5c1c68=0x0;_0x5c1c68<_0x58e435[_0x5ea4('0x1e')];_0x5c1c68++){var _0xa7310c=_0x1a256b[_0x5ea4('0x24')]()===_0x5ea4('0x2e')?_0x121c90[_0x5ea4('0x2f')]:_0x121c90[_0x5ea4('0x25')];if(_0x58e435[_0x5c1c68][_0x5ea4('0x30')]===_0xa7310c){_0x5bc7e0=!![];_0x4819f5[_0x5ea4('0x2c')]=_0x58e435[_0x5c1c68]['contactid'];}}if(_0x5bc7e0){_0x2f3ca6(_0x4819f5);}else{return createEndUser(_0x4819f5,_0x70088e,_0x2ff198,_0x416be4,_0x121c90,_0x1a256b)[_0x5ea4('0x11')](function(_0x589ee2){logger[_0x5ea4('0x23')]('['+[_0x1a256b[_0x5ea4('0x13')]()]+_0x5ea4('0x31'),_0x589ee2[_0x5ea4('0x2c')]);_0x2f3ca6(_0x589ee2);});}}else{return createEndUser(_0x4819f5,_0x70088e,_0x2ff198,_0x416be4,_0x121c90,_0x1a256b)[_0x5ea4('0x11')](function(_0x107ea8){logger[_0x5ea4('0x23')]('['+[_0x1a256b[_0x5ea4('0x13')]()]+']\x20Enduser\x20Created!',_0x107ea8[_0x5ea4('0x2c')]);_0x2f3ca6(_0x107ea8);});}});});}function getCustomFields(_0x5cf3cc,_0x407755,_0x55c737){var _0x2421ec={};if(_0x5cf3cc[_0x5ea4('0x1e')]>0x0){_['forEach'](_0x5cf3cc,function(_0x4cc9ab){if(_0x4cc9ab['type']===_0x5ea4('0x32')&&_0x4cc9ab['nameField']&&!_0x4cc9ab[_0x5ea4('0x33')]){var _0x221c5f=_0x4cc9ab[_0x5ea4('0x34')]['toLowerCase']();var _0x4b73b3=_0x221c5f[_0x5ea4('0x2a')](0x0,_0x221c5f[_0x5ea4('0x35')]('_'));var _0x28b2b4=_0x221c5f[_0x5ea4('0x2a')](_0x221c5f['indexOf']('_')+0x1);if(_0x4b73b3===_0x55c737){_0x2421ec[_0x28b2b4]=_0x4cc9ab[_0x5ea4('0x36')];}}});}return _0x2421ec;}function getTicket(_0x302e39,_0x59958e,_0x3f27be,_0x4332ca,_0x51ab22,_0x212e66,_0x15b31d){return new BPromise(function(_0x5e29c7,_0x37ec25){var _0x52d341;return getAuthToken(_0x59958e,_0x3f27be,_0x15b31d)[_0x5ea4('0x11')](function(_0x5a450b){if(_0x212e66[_0x5ea4('0x37')]===_0x5ea4('0x38')){_0x52d341={'method':_0x5ea4('0xb'),'uri':_0x4332ca+_0x5ea4('0x39'),'body':Object['assign']({},{'title':intUtil[_0x5ea4('0x3a')](_0x212e66[_0x5ea4('0x3b')],_0x51ab22,'\x20'),'description':intUtil['getString'](_0x212e66[_0x5ea4('0x3c')],_0x51ab22,'\x0a'),'customerid_contact@odata.bind':_0x5ea4('0x3d')+_0x302e39['enduserId']+')','ownerid@odata.bind':_0x5ea4('0x27')+_0x302e39[_0x5ea4('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x212e66[_0x5ea4('0x3e')],_0x51ab22,_0x212e66[_0x5ea4('0x37')])),'headers':{'Authorization':'Bearer\x20'+_0x5a450b,'OData-Version':_0x5ea4('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x212e66['ticketType']==='phonecall'){_0x52d341={'method':'POST','uri':_0x4332ca+_0x5ea4('0x3f'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x212e66[_0x5ea4('0x3b')],_0x51ab22,'\x20'),'phonenumber':String(_0x51ab22[_0x5ea4('0x25')]),'description':intUtil['getString'](_0x212e66[_0x5ea4('0x3c')],_0x51ab22,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5ea4('0x3d')+_0x302e39[_0x5ea4('0x2c')]+')','ownerid@odata.bind':_0x5ea4('0x27')+_0x302e39[_0x5ea4('0x22')]+')','directioncode':_0x302e39[_0x5ea4('0x40')]===_0x5ea4('0x41')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5ea4('0x27')+_0x302e39['userId']+')','participationtypemask':_0x302e39[_0x5ea4('0x40')]===_0x5ea4('0x41')?0x2:0x1},{'partyid_contact@odata.bind':_0x5ea4('0x3d')+_0x302e39[_0x5ea4('0x2c')]+')','participationtypemask':_0x302e39['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x212e66[_0x5ea4('0x3e')],_0x51ab22,_0x212e66[_0x5ea4('0x37')])),'headers':{'Authorization':_0x5ea4('0x17')+_0x5a450b,'OData-Version':_0x5ea4('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x52d341);})[_0x5ea4('0x11')](function(_0x33ec6f){var _0x1b985b=_0x33ec6f[_0x5ea4('0x28')]['odata-entityid'];var _0x17904a=_0x1b985b[_0x5ea4('0x2a')](_0x1b985b[_0x5ea4('0x2b')]('(')+0x1,_0x1b985b['lastIndexOf'](')'));_0x302e39[_0x5ea4('0x42')]=_0x17904a;_0x5e29c7(_0x302e39);})[_0x5ea4('0x2d')](function(_0x279d2f){_0x37ec25(_0x279d2f[_0x5ea4('0x15')]);});});}function emit(_0x171ec0,_0xf8fcff,_0x323f1b,_0x4d0c08){var _0x103f64={'uri':util[_0x5ea4('0x43')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x171ec0,_0x323f1b,_0x4d0c08)};io['to'](util[_0x5ea4('0x43')]('user:%s',_0xf8fcff))[_0x5ea4('0x44')]('trigger:browser:url',_0x103f64);}exports['cs']=function(_0x4c0ce6,_0xd00572,_0x36da01,_0xb23e95,_0x33bcbd,_0x1013f4,_0x5d5121,_0x32a5e3){var _0x4bd384={};_0x1013f4[_0x5ea4('0xd')]=intUtil['stripTrailingSlash'](_0x1013f4[_0x5ea4('0xd')]);_0x1013f4['serverUrl']=intUtil[_0x5ea4('0x45')](_0x1013f4[_0x5ea4('0x46')]);_0x4bd384[_0x5ea4('0x40')]=_0x32a5e3===_0x5ea4('0x41')||_0x32a5e3===_0x5ea4('0x47')?_0x5ea4('0x41'):_0x5ea4('0x2e');var _0x720e0c=util[_0x5ea4('0x43')](_0x5ea4('0x48'),_0x1013f4[_0x5ea4('0xd')]);var _0x3fad1c=util[_0x5ea4('0x43')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1013f4[_0x5ea4('0x49')]);var _0x2989c7=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1013f4[_0x5ea4('0x46')],_0xd00572[_0x5ea4('0x4a')],md5(_0xd00572['uniqueid']));if(_0x33bcbd&&_0x33bcbd[_0x5ea4('0x4b')]){logger['info'](_0x5ea4('0x4c'),'Recording\x20is\x20enabled!');_0xd00572[_0x5ea4('0x4d')]=_0x2989c7;}else if(_0x5d5121&&_0x5d5121['recordingFormat']&&_0x5d5121[_0x5ea4('0x4e')]!==_0x5ea4('0x4f')){logger[_0x5ea4('0x23')](_0x5ea4('0x50'),_0x5ea4('0x51'));_0xd00572['recordingURL']=_0x2989c7;}else{_0xd00572[_0x5ea4('0x4d')]='';}return getUser(_0x4bd384,_0x1013f4,_0xb23e95,_0x3fad1c,_0x720e0c,_0x32a5e3)[_0x5ea4('0x11')](function(_0x230edd){logger[_0x5ea4('0x23')]('['+_0x32a5e3[_0x5ea4('0x13')]()+_0x5ea4('0x52'),_0x230edd[_0x5ea4('0x22')]);logger[_0x5ea4('0x23')]('['+_0x32a5e3['toUpperCase']()+_0x5ea4('0x53'),_0x230edd[_0x5ea4('0x1d')]);return getEndUser(_0x230edd,_0x1013f4,_0x3fad1c,_0x720e0c,_0xd00572,_0x32a5e3);})['then'](function(_0x241112){logger[_0x5ea4('0x23')]('['+_0x32a5e3[_0x5ea4('0x13')]()+_0x5ea4('0x54'),_0x241112['enduserId']);logger[_0x5ea4('0x23')]('['+_0x32a5e3[_0x5ea4('0x13')]()+_0x5ea4('0x55'),_0xd00572[_0x5ea4('0x25')]);return getTicket(_0x241112,_0x1013f4,_0x3fad1c,_0x720e0c,_0xd00572,_0x36da01,_0x32a5e3);})[_0x5ea4('0x11')](function(_0x5be6f7){logger[_0x5ea4('0x23')](util['format']('['+_0x32a5e3[_0x5ea4('0x13')]()+_0x5ea4('0x56'),_0x36da01[_0x5ea4('0x37')],_0x5be6f7[_0x5ea4('0x42')]));logger[_0x5ea4('0x23')](util[_0x5ea4('0x43')]('['+_0x32a5e3['toUpperCase']()+_0x5ea4('0x57'),_0x32a5e3));if(_0x32a5e3!==_0x5ea4('0x47')){logger[_0x5ea4('0x23')]('['+_0x32a5e3[_0x5ea4('0x13')]()+']',_0x5ea4('0x58'));emit(_0x1013f4[_0x5ea4('0xd')],_0xb23e95[_0x5ea4('0x59')],_0x36da01[_0x5ea4('0x37')],_0x5be6f7[_0x5ea4('0x42')]);}})[_0x5ea4('0x2d')](function(_0x4f7d14){logger[_0x5ea4('0x12')]('['+_0x32a5e3[_0x5ea4('0x13')]()+_0x5ea4('0x5a'),util['inspect'](_0x4f7d14,{'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 84d32b7..7508739 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 _0xe2ef=['../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','
','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','apiKey','base64','debug','[HTTP]','GET','map','forEach','type','customField','nameField','content','string','idField','toString','variable','variableName','Variable','toLowerCase','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','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','The\x20Enduser\x20ID\x20is:','stringify','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xe2ef,0x171));var _0xfe2e=function(_0x4a03bb,_0x51aff1){_0x4a03bb=_0x4a03bb-0x0;var _0x4b1da3=_0xe2ef[_0x4a03bb];return _0x4b1da3;};'use strict';var _=require(_0xfe2e('0x0'));var rp=require(_0xfe2e('0x1'));var md5=require(_0xfe2e('0x2'));var util=require(_0xfe2e('0x3'));var Redis=require(_0xfe2e('0x4'));var intUtil=require(_0xfe2e('0x5'));var config=require(_0xfe2e('0x6'));var logger=require(_0xfe2e('0x7'))('freshdesk');config['redis']=_[_0xfe2e('0x8')](config[_0xfe2e('0x9')],{'host':_0xfe2e('0xa'),'port':0x18eb});var io=require(_0xfe2e('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xfe2e('0xc'),'Accept':_0xfe2e('0xc')};function emit(_0xdd0214,_0x11cb3d,_0x3ae7ad){io['to'](_0xdd0214)['emit'](_0x11cb3d,_0x3ae7ad);}function getTicket(_0xcf8942,_0x32cf93,_0x525bc6,_0x54ea04,_0xa274e1){logger[_0xfe2e('0xd')](_0xfe2e('0xe'));var _0x43ea06=_[_0xfe2e('0xf')]({'responder_id':_0x32cf93['id'],'requester_id':_0x525bc6['id'],'name':util[_0xfe2e('0x10')](_0xfe2e('0x11'),_0xa274e1[_0xfe2e('0x12')]),'phone':_0xa274e1['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfe2e('0x13')](_0x54ea04[_0xfe2e('0x14')],_0xa274e1,'\x20'),'description':intUtil[_0xfe2e('0x13')](_0x54ea04['Descriptions'],_0xa274e1,_0xfe2e('0x15')),'tags':getTags(_0x54ea04[_0xfe2e('0x16')],_0xfe2e('0x17'))},getCustomFields(_0x54ea04[_0xfe2e('0x18')],_0xa274e1));_0x43ea06[_0xfe2e('0x19')]=_['mapValues'](_[_0xfe2e('0x1a')](_0x43ea06[_0xfe2e('0x19')],'id'),'value');return request({'uri':util['format'](_0xfe2e('0x1b'),_0xcf8942['remoteUri']),'method':_0xfe2e('0x1c'),'body':_0x43ea06})['then'](function(_0x5501e6){logger[_0xfe2e('0xd')](_0xfe2e('0x1d'));return _0x5501e6;});}function getUser(_0x5c2850,_0x4f2186){if(intUtil[_0xfe2e('0x1e')](_0x4f2186)){return request({'uri':util[_0xfe2e('0x10')](_0xfe2e('0x1f'),_0x5c2850[_0xfe2e('0x20')]),'qs':{'email':_0x4f2186}})[_0xfe2e('0x21')](function(_0x4f452f){if(_0x4f452f[_0xfe2e('0x22')]){logger[_0xfe2e('0xd')](_0xfe2e('0x23'));return _[_0xfe2e('0x24')](_0x4f452f,function(_0x59e82a){return _0x59e82a[_0xfe2e('0x25')][_0xfe2e('0x26')]===_0x4f2186;});}else{logger['info'](_0xfe2e('0x27'));return request({'uri':util[_0xfe2e('0x10')](_0xfe2e('0x28'),_0x5c2850['remoteUri'])})[_0xfe2e('0x21')](function(_0xd25c87){logger[_0xfe2e('0xd')](_0xfe2e('0x29'));return _0xd25c87;});}});}else{logger[_0xfe2e('0xd')](_0xfe2e('0x2a'));return request({'uri':util['format'](_0xfe2e('0x28'),_0x5c2850['remoteUri'])})[_0xfe2e('0x21')](function(_0x27185b){logger['info']('Admin\x20account\x20selected.');return _0x27185b;});}}function getEndUser(_0x156423,_0x31eb9e,_0x2ea6f8){logger[_0xfe2e('0xd')]('Searching\x20enduser\x20with\x20phone',_0x2ea6f8);return request({'uri':util[_0xfe2e('0x10')](_0xfe2e('0x2b'),_0x156423[_0xfe2e('0x20')]),'qs':{'phone':_0x2ea6f8}})[_0xfe2e('0x21')](function(_0x25957a){if(_0x25957a[_0xfe2e('0x22')]){logger[_0xfe2e('0xd')](_0xfe2e('0x2c'));return _[_0xfe2e('0x24')](_0x25957a,{'phone':_0x2ea6f8});}else{logger[_0xfe2e('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xfe2e('0x10')](_0xfe2e('0x2b'),_0x156423[_0xfe2e('0x20')]),'method':_0xfe2e('0x1c'),'body':{'name':_0x31eb9e,'phone':_0x2ea6f8}})[_0xfe2e('0x21')](function(_0x2063db){logger[_0xfe2e('0xd')]('Enduser\x20created.');return _0x2063db;});}});}function getAuth(_0x415442){return util[_0xfe2e('0x10')](_0xfe2e('0x2d'),new Buffer(_0x415442[_0xfe2e('0x2e')]+':X')['toString'](_0xfe2e('0x2f')));}function request(_0xa17c69){logger[_0xfe2e('0x30')](_0xfe2e('0x31'),JSON['stringify'](_0xa17c69));return rp(_[_0xfe2e('0x8')](_0xa17c69,{'method':_0xfe2e('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x1ee7c6,_0x2f77a2){var _0x50a8a4=[];if(_0x1ee7c6&&_0x1ee7c6[_0xfe2e('0x22')]>0x0){_0x50a8a4=_[_0xfe2e('0x33')](_0x1ee7c6,_0x2f77a2);}return _0x50a8a4;}function getCustomFields(_0x4bee66,_0x53a9c5){var _0x47a1cc=[];var _0x160e7f={'custom_fields':[]};if(_0x4bee66[_0xfe2e('0x22')]>0x0){_[_0xfe2e('0x34')](_0x4bee66,function(_0x4608c2){if(_0x4608c2[_0xfe2e('0x35')]==='string'&&_0x4608c2['nameField']&&!_0x4608c2[_0xfe2e('0x36')]){_0x160e7f[_0x4608c2[_0xfe2e('0x37')]['toLowerCase']()]=_0x4608c2[_0xfe2e('0x38')]['toString']();}else if(_0x4608c2[_0xfe2e('0x35')]===_0xfe2e('0x39')&&_0x4608c2[_0xfe2e('0x3a')]&&_0x4608c2['customField']){_0x160e7f[_0xfe2e('0x19')]['push']({'id':_0x4608c2[_0xfe2e('0x3a')],'value':_0x4608c2[_0xfe2e('0x38')][_0xfe2e('0x3b')]()});}else if(_0x4608c2[_0xfe2e('0x35')]===_0xfe2e('0x3c')&&_0x4608c2[_0xfe2e('0x3d')]&&_0x4608c2['idField']&&_0x4608c2[_0xfe2e('0x36')]){_0x53a9c5[_0x4608c2['variableName']]&&_0x160e7f[_0xfe2e('0x19')]['push']({'id':_0x4608c2[_0xfe2e('0x3a')],'value':_0x53a9c5[_0x4608c2[_0xfe2e('0x3d')]][_0xfe2e('0x3b')]()});}else if(_0x4608c2[_0xfe2e('0x35')]==='customVariable'&&_0x4608c2['Variable']&&_0x4608c2[_0xfe2e('0x3e')]['name']&&_0x4608c2[_0xfe2e('0x3a')]&&_0x4608c2['customField']){_0x53a9c5[_0x4608c2[_0xfe2e('0x3e')][_0xfe2e('0x17')][_0xfe2e('0x3f')]()]&&_0x160e7f[_0xfe2e('0x19')][_0xfe2e('0x40')]({'id':_0x4608c2[_0xfe2e('0x3a')],'value':_0x53a9c5[_0x4608c2[_0xfe2e('0x3e')][_0xfe2e('0x17')][_0xfe2e('0x3f')]()][_0xfe2e('0x3b')]()});}});}return _0x160e7f;}exports[_0xfe2e('0x41')]=function(_0x2a0e00,_0x5c2ef0,_0x363921,_0x17fe5c,_0x3adcf9,_0x1c6bd8){var _0x3675b4,_0x271cf3;_0x1c6bd8['remoteUri']=intUtil['stripTrailingSlash'](_0x1c6bd8[_0xfe2e('0x20')]);_0x1c6bd8['serverUrl']=intUtil[_0xfe2e('0x42')](_0x1c6bd8[_0xfe2e('0x43')]);if(_0x3adcf9&&_0x3adcf9[_0xfe2e('0x44')]){logger[_0xfe2e('0xd')](_0xfe2e('0x45'),_0xfe2e('0x46'));_0x5c2ef0[_0xfe2e('0x47')]=util[_0xfe2e('0x10')](_0xfe2e('0x48'),_0x1c6bd8[_0xfe2e('0x43')],_0x5c2ef0[_0xfe2e('0x49')],md5(_0x5c2ef0[_0xfe2e('0x49')]));}else{_0x5c2ef0[_0xfe2e('0x47')]='';}headers['Authorization']=getAuth(_0x1c6bd8);return getUser(_0x1c6bd8,_0x17fe5c[_0xfe2e('0x26')])[_0xfe2e('0x21')](function(_0x946c2c){_0x3675b4=_0x946c2c;logger[_0xfe2e('0xd')](_0xfe2e('0x4a'),_0x3675b4['id']);return getEndUser(_0x1c6bd8,_0x5c2ef0[_0xfe2e('0x12')],_0x5c2ef0['calleridnum']);})[_0xfe2e('0x21')](function(_0x59fda4){_0x271cf3=_0x59fda4;logger[_0xfe2e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x271cf3['id']);return getTicket(_0x1c6bd8,_0x3675b4,_0x271cf3,_0x363921,_0x5c2ef0);})['then'](function(_0x126053){if(_0x126053&&_0x126053['id']){logger[_0xfe2e('0xd')](_0xfe2e('0x1d'));logger[_0xfe2e('0xd')](_0xfe2e('0x4b'),_0x126053['id']);logger[_0xfe2e('0xd')](_0xfe2e('0x45'),_0xfe2e('0x4c'));emit(util[_0xfe2e('0x10')](_0xfe2e('0x4d'),_0x17fe5c['name']),_0xfe2e('0x4e'),{'uri':util[_0xfe2e('0x10')](_0xfe2e('0x4f'),_0x1c6bd8[_0xfe2e('0x20')],_0x126053['id'])});}})[_0xfe2e('0x50')](function(_0x124853){logger[_0xfe2e('0x51')](_0xfe2e('0x45'),JSON['stringify'](_0x124853));});};exports[_0xfe2e('0x52')]=function(_0x422f9a,_0xab8988,_0x11f024,_0x32d1dd,_0x4c5135,_0x4dcf22,_0x483ef0){var _0x3d3c66,_0x42a772;_0x4dcf22[_0xfe2e('0x20')]=intUtil[_0xfe2e('0x42')](_0x4dcf22[_0xfe2e('0x20')]);_0x4dcf22[_0xfe2e('0x43')]=intUtil[_0xfe2e('0x42')](_0x4dcf22[_0xfe2e('0x43')]);if(_0x483ef0&&_0x483ef0[_0xfe2e('0x53')]&&_0x483ef0['recordingFormat']!==_0xfe2e('0x54')){logger[_0xfe2e('0xd')](_0xfe2e('0x55'),_0xfe2e('0x46'));_0xab8988['recordingURL']=util[_0xfe2e('0x10')](_0xfe2e('0x48'),_0x4dcf22[_0xfe2e('0x43')],_0xab8988[_0xfe2e('0x49')],md5(_0xab8988['uniqueid']));}headers['Authorization']=getAuth(_0x4dcf22);return getUser(_0x4dcf22,_0x32d1dd['email'])[_0xfe2e('0x21')](function(_0x3353bf){_0x3d3c66=_0x3353bf;logger[_0xfe2e('0xd')](_0xfe2e('0x4a'),_0x3d3c66['id']);return getEndUser(_0x4dcf22,_0xab8988[_0xfe2e('0x56')],_0xab8988[_0xfe2e('0x57')]);})[_0xfe2e('0x21')](function(_0x38642f){_0x42a772=_0x38642f;logger['info'](_0xfe2e('0x58'),_0x42a772['id']);return getTicket(_0x4dcf22,_0x3d3c66,_0x42a772,_0x11f024,_0xab8988);})[_0xfe2e('0x21')](function(_0x5b53c2){if(_0x5b53c2&&_0x5b53c2['id']){logger['info'](_0xfe2e('0x1d'));logger[_0xfe2e('0xd')](_0xfe2e('0x4b'),_0x5b53c2['id']);logger[_0xfe2e('0xd')](_0xfe2e('0x55'),_0xfe2e('0x4c'));emit(util[_0xfe2e('0x10')]('user:%s',_0x32d1dd['name']),_0xfe2e('0x4e'),{'uri':util[_0xfe2e('0x10')]('%s/helpdesk/tickets/%d',_0x4dcf22[_0xfe2e('0x20')],_0x5b53c2['id'])});}})[_0xfe2e('0x50')](function(_0x50a52c){logger[_0xfe2e('0x51')](_0xfe2e('0x55'),JSON[_0xfe2e('0x59')](_0x50a52c));});};exports[_0xfe2e('0x5a')]=function(_0x4592f9,_0x12e954,_0x4a264c,_0x7eedf6,_0x1f470a,_0x20f2a7){var _0x5696dd,_0x4912db;_0x20f2a7['remoteUri']=intUtil['stripTrailingSlash'](_0x20f2a7[_0xfe2e('0x20')]);_0x20f2a7[_0xfe2e('0x43')]=intUtil[_0xfe2e('0x42')](_0x20f2a7['serverUrl']);if(_0x1f470a&&_0x1f470a['monitor_format']){logger[_0xfe2e('0xd')]('['+_0x12e954[_0xfe2e('0x5b')][_0xfe2e('0x5c')]()+']',_0xfe2e('0x46'));_0x12e954[_0xfe2e('0x47')]=util[_0xfe2e('0x10')](_0xfe2e('0x48'),_0x20f2a7['serverUrl'],_0x12e954[_0xfe2e('0x49')],md5(_0x12e954['uniqueid']));}else{_0x12e954[_0xfe2e('0x47')]='';}headers['Authorization']=getAuth(_0x20f2a7);return getUser(_0x20f2a7,'')[_0xfe2e('0x21')](function(_0x115ed6){_0x5696dd=_0x115ed6;logger['info'](_0xfe2e('0x4a'),_0x5696dd['id']);return getEndUser(_0x20f2a7,_0x12e954[_0xfe2e('0x12')],_0x12e954[_0xfe2e('0x5d')]);})[_0xfe2e('0x21')](function(_0xc91b7b){_0x4912db=_0xc91b7b;logger[_0xfe2e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4912db['id']);return getTicket(_0x20f2a7,_0x5696dd,_0x4912db,_0x4a264c,_0x12e954);})[_0xfe2e('0x21')](function(_0x4b77ad){if(_0x4b77ad){logger['info'](_0xfe2e('0x1d'));logger[_0xfe2e('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4b77ad['id']);}})['catch'](function(_0x5e74c1){logger['error']('['+_0x12e954[_0xfe2e('0x5b')][_0xfe2e('0x5c')]()+']',JSON['stringify'](_0x5e74c1));});}; \ No newline at end of file +var _0x25c9=['queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','calleridname','catch','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','custom_fields','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','toString','push','idField','content','variable','variableName','customVariable','Variable'];(function(_0x2c51fc,_0x50c85f){var _0x454949=function(_0x156218){while(--_0x156218){_0x2c51fc['push'](_0x2c51fc['shift']());}};_0x454949(++_0x50c85f);}(_0x25c9,0x18a));var _0x925c=function(_0x4a4071,_0x27ba64){_0x4a4071=_0x4a4071-0x0;var _0xb7270a=_0x25c9[_0x4a4071];return _0xb7270a;};'use strict';var _=require(_0x925c('0x0'));var rp=require('request-promise');var md5=require(_0x925c('0x1'));var util=require(_0x925c('0x2'));var Redis=require(_0x925c('0x3'));var intUtil=require(_0x925c('0x4'));var config=require(_0x925c('0x5'));var logger=require(_0x925c('0x6'))(_0x925c('0x7'));config[_0x925c('0x8')]=_[_0x925c('0x9')](config[_0x925c('0x8')],{'host':_0x925c('0xa'),'port':0x18eb});var io=require(_0x925c('0xb'))(new Redis(config[_0x925c('0x8')]));var headers={'Content-Type':_0x925c('0xc'),'Accept':_0x925c('0xc')};function emit(_0x292627,_0x219dc1,_0x16baf2){io['to'](_0x292627)[_0x925c('0xd')](_0x219dc1,_0x16baf2);}function getTicket(_0x55dc96,_0x5405aa,_0x157f3c,_0x32bc7b,_0x173061){logger[_0x925c('0xe')]('Creating\x20new\x20ticket...');var _0xbf3218=_[_0x925c('0xf')]({'responder_id':_0x5405aa['id'],'requester_id':_0x157f3c['id'],'name':util[_0x925c('0x10')](_0x925c('0x11'),_0x173061['calleridname']),'phone':_0x173061[_0x925c('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x925c('0x13')](_0x32bc7b[_0x925c('0x14')],_0x173061,'\x20'),'description':intUtil[_0x925c('0x13')](_0x32bc7b[_0x925c('0x15')],_0x173061,_0x925c('0x16')),'tags':getTags(_0x32bc7b[_0x925c('0x17')],_0x925c('0x18'))},getCustomFields(_0x32bc7b[_0x925c('0x19')],_0x173061));_0xbf3218['custom_fields']=_[_0x925c('0x1a')](_['keyBy'](_0xbf3218[_0x925c('0x1b')],'id'),'value');return request({'uri':util[_0x925c('0x10')]('%s/api/v2/tickets',_0x55dc96[_0x925c('0x1c')]),'method':_0x925c('0x1d'),'body':_0xbf3218})[_0x925c('0x1e')](function(_0x5e7c0a){logger[_0x925c('0xe')](_0x925c('0x1f'));return _0x5e7c0a;});}function getUser(_0x17a2f5,_0x11252a){if(intUtil[_0x925c('0x20')](_0x11252a)){return request({'uri':util[_0x925c('0x10')](_0x925c('0x21'),_0x17a2f5[_0x925c('0x1c')]),'qs':{'email':_0x11252a}})['then'](function(_0x45089f){if(_0x45089f['length']){logger[_0x925c('0xe')](_0x925c('0x22'));return _[_0x925c('0x23')](_0x45089f,function(_0x2274b7){return _0x2274b7[_0x925c('0x24')][_0x925c('0x25')]===_0x11252a;});}else{logger[_0x925c('0xe')](_0x925c('0x26'));return request({'uri':util['format'](_0x925c('0x27'),_0x17a2f5[_0x925c('0x1c')])})[_0x925c('0x1e')](function(_0x3807e5){logger['info']('Admin\x20account\x20selected.');return _0x3807e5;});}});}else{logger[_0x925c('0xe')](_0x925c('0x28'));return request({'uri':util[_0x925c('0x10')](_0x925c('0x27'),_0x17a2f5[_0x925c('0x1c')])})['then'](function(_0x2f1c7d){logger[_0x925c('0xe')](_0x925c('0x29'));return _0x2f1c7d;});}}function getEndUser(_0x34183a,_0x25f4ad,_0x17f7b2){logger['info'](_0x925c('0x2a'),_0x17f7b2);return request({'uri':util[_0x925c('0x10')](_0x925c('0x2b'),_0x34183a[_0x925c('0x1c')]),'qs':{'phone':_0x17f7b2}})['then'](function(_0x1c3b55){if(_0x1c3b55[_0x925c('0x2c')]){logger['info']('Enduser\x20found!');return _[_0x925c('0x23')](_0x1c3b55,{'phone':_0x17f7b2});}else{logger['info'](_0x925c('0x2d'));return request({'uri':util[_0x925c('0x10')]('%s/api/v2/contacts',_0x34183a[_0x925c('0x1c')]),'method':_0x925c('0x1d'),'body':{'name':_0x25f4ad,'phone':_0x17f7b2}})[_0x925c('0x1e')](function(_0x4ca865){logger[_0x925c('0xe')]('Enduser\x20created.');return _0x4ca865;});}});}function getAuth(_0x315648){return util[_0x925c('0x10')]('Basic\x20%s',new Buffer(_0x315648[_0x925c('0x2e')]+':X')['toString']('base64'));}function request(_0x3c75f9){logger[_0x925c('0x2f')](_0x925c('0x30'),JSON[_0x925c('0x31')](_0x3c75f9));return rp(_[_0x925c('0x9')](_0x3c75f9,{'method':_0x925c('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x21abba,_0x3b22ca){var _0x227b25=[];if(_0x21abba&&_0x21abba[_0x925c('0x2c')]>0x0){_0x227b25=_[_0x925c('0x33')](_0x21abba,_0x3b22ca);}return _0x227b25;}function getCustomFields(_0x2476fd,_0x55b28d){var _0x463fac=[];var _0x3dcd11={'custom_fields':[]};if(_0x2476fd[_0x925c('0x2c')]>0x0){_[_0x925c('0x34')](_0x2476fd,function(_0x4ec00e){if(_0x4ec00e[_0x925c('0x35')]===_0x925c('0x36')&&_0x4ec00e[_0x925c('0x37')]&&!_0x4ec00e[_0x925c('0x38')]){_0x3dcd11[_0x4ec00e[_0x925c('0x37')][_0x925c('0x39')]()]=_0x4ec00e['content'][_0x925c('0x3a')]();}else if(_0x4ec00e['type']===_0x925c('0x36')&&_0x4ec00e['idField']&&_0x4ec00e['customField']){_0x3dcd11[_0x925c('0x1b')][_0x925c('0x3b')]({'id':_0x4ec00e[_0x925c('0x3c')],'value':_0x4ec00e[_0x925c('0x3d')][_0x925c('0x3a')]()});}else if(_0x4ec00e['type']===_0x925c('0x3e')&&_0x4ec00e[_0x925c('0x3f')]&&_0x4ec00e[_0x925c('0x3c')]&&_0x4ec00e[_0x925c('0x38')]){_0x55b28d[_0x4ec00e[_0x925c('0x3f')]]&&_0x3dcd11['custom_fields'][_0x925c('0x3b')]({'id':_0x4ec00e[_0x925c('0x3c')],'value':_0x55b28d[_0x4ec00e[_0x925c('0x3f')]]['toString']()});}else if(_0x4ec00e[_0x925c('0x35')]===_0x925c('0x40')&&_0x4ec00e[_0x925c('0x41')]&&_0x4ec00e['Variable'][_0x925c('0x18')]&&_0x4ec00e[_0x925c('0x3c')]&&_0x4ec00e[_0x925c('0x38')]){_0x55b28d[_0x4ec00e[_0x925c('0x41')]['name'][_0x925c('0x39')]()]&&_0x3dcd11[_0x925c('0x1b')][_0x925c('0x3b')]({'id':_0x4ec00e[_0x925c('0x3c')],'value':_0x55b28d[_0x4ec00e[_0x925c('0x41')]['name']['toLowerCase']()][_0x925c('0x3a')]()});}});}return _0x3dcd11;}exports[_0x925c('0x42')]=function(_0x3d9996,_0xf15b86,_0x3f8928,_0x4d2fb1,_0x51f4b3,_0x1a3324){var _0x1ece6c,_0x38feec;_0x1a3324[_0x925c('0x1c')]=intUtil[_0x925c('0x43')](_0x1a3324[_0x925c('0x1c')]);_0x1a3324[_0x925c('0x44')]=intUtil['stripTrailingSlash'](_0x1a3324[_0x925c('0x44')]);if(_0x51f4b3&&_0x51f4b3[_0x925c('0x45')]){logger[_0x925c('0xe')]('[QUEUE]',_0x925c('0x46'));_0xf15b86[_0x925c('0x47')]=util[_0x925c('0x10')](_0x925c('0x48'),_0x1a3324[_0x925c('0x44')],_0xf15b86[_0x925c('0x49')],md5(_0xf15b86[_0x925c('0x49')]));}else{_0xf15b86[_0x925c('0x47')]='';}headers[_0x925c('0x4a')]=getAuth(_0x1a3324);return getUser(_0x1a3324,_0x4d2fb1['email'])['then'](function(_0x6091dd){_0x1ece6c=_0x6091dd;logger[_0x925c('0xe')](_0x925c('0x4b'),_0x1ece6c['id']);return getEndUser(_0x1a3324,_0xf15b86['calleridname'],_0xf15b86['calleridnum']);})[_0x925c('0x1e')](function(_0x25fe5e){_0x38feec=_0x25fe5e;logger['info'](_0x925c('0x4c'),_0x38feec['id']);return getTicket(_0x1a3324,_0x1ece6c,_0x38feec,_0x3f8928,_0xf15b86);})[_0x925c('0x1e')](function(_0x57caad){if(_0x57caad&&_0x57caad['id']){logger[_0x925c('0xe')](_0x925c('0x1f'));logger[_0x925c('0xe')](_0x925c('0x4d'),_0x57caad['id']);logger[_0x925c('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x925c('0x10')](_0x925c('0x4e'),_0x4d2fb1[_0x925c('0x18')]),_0x925c('0x4f'),{'uri':util[_0x925c('0x10')](_0x925c('0x50'),_0x1a3324['remoteUri'],_0x57caad['id'])});}})['catch'](function(_0x250d7b){logger[_0x925c('0x51')]('[QUEUE]',JSON[_0x925c('0x31')](_0x250d7b));});};exports['outbound']=function(_0x5e3631,_0x21e1ad,_0x22b4d0,_0x28e0a0,_0x5dc24a,_0xde6063,_0x123b41){var _0x3c60a6,_0x5a187b;_0xde6063['remoteUri']=intUtil[_0x925c('0x43')](_0xde6063[_0x925c('0x1c')]);_0xde6063[_0x925c('0x44')]=intUtil['stripTrailingSlash'](_0xde6063['serverUrl']);if(_0x123b41&&_0x123b41[_0x925c('0x52')]&&_0x123b41[_0x925c('0x52')]!==_0x925c('0x53')){logger[_0x925c('0xe')](_0x925c('0x54'),'Recording\x20is\x20enabled!');_0x21e1ad[_0x925c('0x47')]=util[_0x925c('0x10')](_0x925c('0x48'),_0xde6063[_0x925c('0x44')],_0x21e1ad[_0x925c('0x49')],md5(_0x21e1ad[_0x925c('0x49')]));}headers[_0x925c('0x4a')]=getAuth(_0xde6063);return getUser(_0xde6063,_0x28e0a0[_0x925c('0x25')])[_0x925c('0x1e')](function(_0x582729){_0x3c60a6=_0x582729;logger['info'](_0x925c('0x4b'),_0x3c60a6['id']);return getEndUser(_0xde6063,_0x21e1ad['destcalleridname'],_0x21e1ad[_0x925c('0x55')]);})[_0x925c('0x1e')](function(_0x412517){_0x5a187b=_0x412517;logger['info'](_0x925c('0x4c'),_0x5a187b['id']);return getTicket(_0xde6063,_0x3c60a6,_0x5a187b,_0x22b4d0,_0x21e1ad);})[_0x925c('0x1e')](function(_0xe059a1){if(_0xe059a1&&_0xe059a1['id']){logger[_0x925c('0xe')](_0x925c('0x1f'));logger[_0x925c('0xe')]('The\x20Ticket\x20ID\x20is:',_0xe059a1['id']);logger['info'](_0x925c('0x54'),_0x925c('0x56'));emit(util['format'](_0x925c('0x4e'),_0x28e0a0[_0x925c('0x18')]),_0x925c('0x4f'),{'uri':util[_0x925c('0x10')](_0x925c('0x50'),_0xde6063[_0x925c('0x1c')],_0xe059a1['id'])});}})['catch'](function(_0x1602a9){logger[_0x925c('0x51')](_0x925c('0x54'),JSON[_0x925c('0x31')](_0x1602a9));});};exports[_0x925c('0x57')]=function(_0x46a09f,_0x10501e,_0x5693be,_0x4a1690,_0x35aac5,_0x5afaf7){var _0x4efae4,_0x44b3a2;_0x5afaf7[_0x925c('0x1c')]=intUtil[_0x925c('0x43')](_0x5afaf7['remoteUri']);_0x5afaf7[_0x925c('0x44')]=intUtil['stripTrailingSlash'](_0x5afaf7[_0x925c('0x44')]);if(_0x35aac5&&_0x35aac5[_0x925c('0x45')]){logger['info']('['+_0x10501e[_0x925c('0x58')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x10501e[_0x925c('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5afaf7[_0x925c('0x44')],_0x10501e[_0x925c('0x49')],md5(_0x10501e['uniqueid']));}else{_0x10501e[_0x925c('0x47')]='';}headers[_0x925c('0x4a')]=getAuth(_0x5afaf7);return getUser(_0x5afaf7,'')[_0x925c('0x1e')](function(_0x36370d){_0x4efae4=_0x36370d;logger['info'](_0x925c('0x4b'),_0x4efae4['id']);return getEndUser(_0x5afaf7,_0x10501e[_0x925c('0x59')],_0x10501e[_0x925c('0x12')]);})['then'](function(_0x156508){_0x44b3a2=_0x156508;logger[_0x925c('0xe')](_0x925c('0x4c'),_0x44b3a2['id']);return getTicket(_0x5afaf7,_0x4efae4,_0x44b3a2,_0x5693be,_0x10501e);})[_0x925c('0x1e')](function(_0x4552a6){if(_0x4552a6){logger[_0x925c('0xe')](_0x925c('0x1f'));logger[_0x925c('0xe')](_0x925c('0x4d'),_0x4552a6['id']);}})[_0x925c('0x5a')](function(_0x4df38f){logger[_0x925c('0x51')]('['+_0x10501e[_0x925c('0x58')][_0x925c('0x5b')]()+']',JSON['stringify'](_0x4df38f));});}; \ 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 1c86b4b..0bfeb2c 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 _0x9bec=['defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','adminEmail','Admin\x20found:','adminId','catch','error','toUpperCase','message','Getting\x20user\x20list','then','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','Requested\x20Resource\x20not\x20Found','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','All\x20Contacts','Searching\x20contact\x20with\x20phone','contactNumber','contacts','length','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','Task\x20created:','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','callDirection','queue','unmanaged','outbound','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','bluebird','./util','redis'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9bec,0x147));var _0xc9be=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9bec[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xc9be('0x0'));var rp=require(_0xc9be('0x1'));var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0xc9be('0x2'));var Redis=require('ioredis');var intUtil=require(_0xc9be('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0xc9be('0x4')]=_[_0xc9be('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc9be('0x6'))(new Redis(config[_0xc9be('0x4')]));function getAdminId(_0x1390d4,_0x399a85,_0x15fee9,_0x10a634){return new Promise(function(_0x49c067,_0x105e0d){var _0x48b3a6=![];var _0xd958={'method':_0xc9be('0x7'),'uri':_0x10a634+_0xc9be('0x8'),'json':!![]};_0xd958[_0xc9be('0x9')]=_0x15fee9;logger[_0xc9be('0xa')](_0xc9be('0xb'));return rp(_0xd958)['then'](function(_0x59eb65){if(_0x59eb65){var _0x4c4ef1=_0x59eb65['users'];var _0x36f58c=null;for(_0x36f58c=0x0;_0x36f58c<_0x4c4ef1['length'];_0x36f58c++){if(_0x4c4ef1[_0x36f58c]['email']===_0x1390d4[_0xc9be('0xc')]){_0x1390d4['adminId']=_0x4c4ef1[_0x36f58c]['id'];_0x48b3a6=!![];}}if(_0x48b3a6){logger[_0xc9be('0xa')](_0xc9be('0xd'),_0x1390d4[_0xc9be('0xe')]);_0x49c067(_0x1390d4);}else{_0x105e0d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x105e0d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc9be('0xf')](function(_0x3be298){logger[_0xc9be('0x10')]('['+[_0x399a85[_0xc9be('0x11')]()]+']',_0x3be298[_0xc9be('0x12')]);_0x105e0d(_0x3be298);});});}function getUser(_0x5e3173,_0x1cc22c,_0x1cd27d){return function(_0x3af05c){return new Promise(function(_0x2db683,_0x2864fd){var _0x1d6c96={'method':'GET','uri':_0x1cd27d+_0xc9be('0x8'),'json':!![]};_0x1d6c96[_0xc9be('0x9')]=_0x1cc22c;logger['info'](_0xc9be('0x13'));return rp(_0x1d6c96)[_0xc9be('0x14')](function(_0xa474a0){if(_0xa474a0){var _0xf229=_0xa474a0[_0xc9be('0x15')];var _0x262244=![];var _0x3f39e3=null;if(_0x3af05c['agentEmail']!==null){logger['info'](_0xc9be('0x16'),_0x3af05c[_0xc9be('0x17')]);_0x3af05c[_0xc9be('0x18')]=_0x3af05c[_0xc9be('0x17')];for(_0x3f39e3=0x0;_0x3f39e3<_0xf229['length'];_0x3f39e3++){if(_0xf229[_0x3f39e3]['email']===_0x3af05c[_0xc9be('0x17')]){_0x262244=!![];_0x3af05c[_0xc9be('0x19')]=_0xf229[_0x3f39e3]['id'];logger['info']('User\x20found:',_0x3af05c[_0xc9be('0x19')]);}}}if(!_0x262244){logger['info'](_0xc9be('0x1a'));_0x3af05c[_0xc9be('0x18')]=_0x3af05c[_0xc9be('0xc')];_0x3af05c[_0xc9be('0x19')]=_0x3af05c[_0xc9be('0xe')];_0x262244=!![];}if(_0x262244){_0x2db683(_0x3af05c);}else{_0x2864fd({'statusCode':0x194,'message':_0xc9be('0x1b')});}}else{_0x2864fd({'statusCode':0x194,'message':_0xc9be('0x1b')});}})['catch'](function(_0x2cb266){logger['error']('['+[_0x5e3173['toUpperCase']()]+']',_0x2cb266['message']);_0x2864fd(_0x2cb266);});});};}function getEndUser(_0x526606,_0x5289c3,_0x4b2c8c){return function(_0x2637ee){return new Promise(function(_0x23e47d,_0xf4fc4d){var _0x2e41e8=0x0;var _0x129b16={'method':_0xc9be('0x7'),'uri':_0x4b2c8c+_0xc9be('0x1c'),'json':!![]};_0x129b16[_0xc9be('0x9')]=_0x5289c3;logger[_0xc9be('0xa')](_0xc9be('0x1d'));return rp(_0x129b16)['then'](function(_0x1dc78c){_0x1dc78c[_0xc9be('0x1e')][_0xc9be('0x1f')](function(_0x4dbec2){if(_0x4dbec2['name']===_0xc9be('0x20')){_0x2e41e8=_0x4dbec2['id'];}});})['then'](function(){logger[_0xc9be('0xa')]('Getting\x20contact\x20list');var _0x24fc42={'method':_0xc9be('0x7'),'uri':_0x4b2c8c+'/api/contacts/view/'+_0x2e41e8,'json':!![]};_0x24fc42[_0xc9be('0x9')]=_0x5289c3;return rp(_0x24fc42);})[_0xc9be('0x14')](function(_0x56d334){logger['info'](_0xc9be('0x21'),_0x2637ee[_0xc9be('0x22')]);if(_0x56d334[_0xc9be('0x23')][_0xc9be('0x24')]>0x0){var _0x37cc60=_[_0xc9be('0x25')](_0x56d334[_0xc9be('0x23')],function(_0x56ab58){if(_0x56ab58[_0xc9be('0x26')]===_0x2637ee[_0xc9be('0x22')]||_0x56ab58[_0xc9be('0x27')]===_0x2637ee[_0xc9be('0x22')]){return _0x56ab58;}});if(_0x37cc60){_0x2637ee[_0xc9be('0x28')]=_0x37cc60['id'];logger[_0xc9be('0xa')](_0xc9be('0x29'),_0x2637ee[_0xc9be('0x28')]);_0x23e47d(_0x2637ee);}else{return createEndUser(_0x2637ee,_0x526606,_0x5289c3,_0x4b2c8c)[_0xc9be('0x14')](function(_0x4fdbc4){logger[_0xc9be('0xa')]('Contact\x20created:',_0x2637ee['endUserId']);_0x23e47d(_0x4fdbc4);});}}else{return createEndUser(_0x2637ee,_0x526606,_0x5289c3,_0x4b2c8c)[_0xc9be('0x14')](function(_0x32048b){logger[_0xc9be('0xa')](_0xc9be('0x2a'),_0x2637ee[_0xc9be('0x28')]);_0x23e47d(_0x32048b);});}})['catch'](function(_0x4e03e5){throw new Error(_0x4e03e5[_0xc9be('0x12')]);});});};}function createEndUser(_0x1e5a53,_0x59e984,_0x28dcb7,_0x2ccde7){return new Promise(function(_0x5c2ca5,_0xcefe56){var _0x1b4018=moment();var _0x2150fc={'method':_0xc9be('0x2b'),'uri':_0x2ccde7+_0xc9be('0x2c'),'body':{'contact':{'last_name':_0x1e5a53['contactNumber'],'work_number':_0x1e5a53['contactNumber'],'mobile_number':_0x1e5a53[_0xc9be('0x22')],'owner_id':_0x1e5a53[_0xc9be('0x19')],'created_at':_0x1b4018[_0xc9be('0x2d')](_0xc9be('0x2e'))}},'json':!![]};_0x2150fc[_0xc9be('0x9')]=_0x28dcb7;logger[_0xc9be('0xa')](_0xc9be('0x2f'));return rp(_0x2150fc)['then'](function(_0x403462){_0x1e5a53[_0xc9be('0x28')]=_0x403462[_0xc9be('0x30')]['id'];_0x5c2ca5(_0x1e5a53);})['catch'](function(_0x3ad7a1){logger['error']('['+[_0x59e984[_0xc9be('0x11')]()]+']',_0x3ad7a1[_0xc9be('0x12')]);_0xcefe56(_0x3ad7a1[_0xc9be('0x12')]);});});}function getTicket(_0x2050c1,_0x1b54b2,_0x463e6e,_0x1b9e00,_0x3c97e5){return function(_0x5df76f){logger[_0xc9be('0xa')](_0xc9be('0x31'));return new Promise(function(_0x3329ca,_0x389e20){var _0x10ef15=moment();var _0x140ae5={'method':'POST','uri':_0x463e6e+_0xc9be('0x32'),'body':{'title':intUtil[_0xc9be('0x33')](_0x1b9e00[_0xc9be('0x34')],_0x3c97e5,'\x20'),'description':intUtil[_0xc9be('0x33')](_0x1b9e00[_0xc9be('0x35')],_0x3c97e5,'\x0a'),'owner_id':_0x5df76f[_0xc9be('0x19')],'creater_id':_0x5df76f[_0xc9be('0xe')],'targetable_id':_0x5df76f['endUserId'],'targetable_type':_0xc9be('0x36'),'created_at':_0x10ef15[_0xc9be('0x2d')](_0xc9be('0x2e')),'due_date':_0x10ef15[_0xc9be('0x37')](0x1e,'m')[_0xc9be('0x2d')](_0xc9be('0x2e'))},'json':!![]};_0x140ae5[_0xc9be('0x9')]=_0x1b54b2;return rp(_0x140ae5)[_0xc9be('0x14')](function(_0x302ae3){_0x5df76f[_0xc9be('0x38')]=_0x302ae3['task']['id'];logger[_0xc9be('0xa')](_0xc9be('0x39'),_0x5df76f[_0xc9be('0x38')]);_0x3329ca(_0x5df76f);})[_0xc9be('0xf')](function(_0x4f7e5f){logger[_0xc9be('0x10')]('['+[_0x2050c1['toUpperCase']()]+']',_0x4f7e5f[_0xc9be('0x12')]);_0x389e20(_0x4f7e5f['message']);});});};}function emit(_0x4a643f,_0x122df0,_0x48c21b){var _0x58cbc4={'uri':_0x4a643f+'/contacts/'+_0x48c21b};io['to'](util['format']('user:%s',_0x122df0))[_0xc9be('0x3a')](_0xc9be('0x3b'),_0x58cbc4);}exports['cs']=function(_0x5b19cc,_0x28de69,_0xcad508,_0x264159,_0x46f368,_0x343955,_0x2c4156,_0x33089d){var _0x2d1d31={};var _0x3a7c35={'Authorization':'Token\x20token='+_0x343955[_0xc9be('0x3c')]};_0x343955[_0xc9be('0x3d')]=intUtil[_0xc9be('0x3e')](_0x343955[_0xc9be('0x3d')]);_0x343955[_0xc9be('0x3f')]=intUtil[_0xc9be('0x3e')](_0x343955['serverUrl']);var _0xa8e6c4=_0x343955[_0xc9be('0x3d')];_0x2d1d31[_0xc9be('0xc')]=_0x343955[_0xc9be('0x40')];_0x2d1d31[_0xc9be('0x22')]=_0x33089d[_0xc9be('0x41')]()==='outbound'?_0x28de69['destcalleridnum']:_0x28de69['calleridnum'];_0x2d1d31[_0xc9be('0x42')]=_0x33089d===_0xc9be('0x43')||_0x33089d===_0xc9be('0x44')?_0xc9be('0x43'):_0xc9be('0x45');if(_0x264159){_0x2d1d31[_0xc9be('0x17')]=_0x264159[_0xc9be('0x46')];}var _0x3a2f86=util[_0xc9be('0x2d')](_0xc9be('0x47'),_0x343955[_0xc9be('0x3f')],_0x28de69['uniqueid'],md5(_0x28de69['uniqueid']));if(_0x46f368&&_0x46f368[_0xc9be('0x48')]){logger['info'](_0xc9be('0x49'),_0xc9be('0x4a'));_0x28de69[_0xc9be('0x4b')]=_0x3a2f86;}else if(_0x2c4156&&_0x2c4156[_0xc9be('0x4c')]&&_0x2c4156['recordingFormat']!==_0xc9be('0x4d')){logger['info'](_0xc9be('0x4e'),_0xc9be('0x4a'));_0x28de69[_0xc9be('0x4b')]=_0x3a2f86;}else{_0x28de69['recordingURL']='';}return getAdminId(_0x2d1d31,_0x33089d,_0x3a7c35,_0xa8e6c4)['then'](getUser(_0x33089d,_0x3a7c35,_0xa8e6c4))[_0xc9be('0x14')](getEndUser(_0x33089d,_0x3a7c35,_0xa8e6c4))[_0xc9be('0x14')](getTicket(_0x33089d,_0x3a7c35,_0xa8e6c4,_0xcad508,_0x28de69))[_0xc9be('0x14')](function(_0x1dea9f){logger['info'](util[_0xc9be('0x2d')](_0xc9be('0x4f'),_0x1dea9f['ticketId']));if(_0x33089d!==_0xc9be('0x44')){logger[_0xc9be('0xa')]('['+[_0x33089d[_0xc9be('0x11')]()]+']',_0xc9be('0x50'));emit(_0xa8e6c4,_0x264159['name'],_0x1dea9f['endUserId']);}})[_0xc9be('0xf')](function(_0x54c9ec){logger[_0xc9be('0x10')]('['+[_0x33089d[_0xc9be('0x11')]()]+_0xc9be('0x51'),util[_0xc9be('0x52')](_0x54c9ec,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3118=['callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','socket.io-emitter','redis','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','headers','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','error','message','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','work_number','mobile_number','Contact\x20created:','endUserId','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','getString','Subjects','Contact','format','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound','destcalleridnum','calleridnum'];(function(_0x558f80,_0x26c352){var _0xb0794f=function(_0x484d85){while(--_0x484d85){_0x558f80['push'](_0x558f80['shift']());}};_0xb0794f(++_0x26c352);}(_0x3118,0x1da));var _0x8311=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3118[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x8311('0x0'));var rp=require(_0x8311('0x1'));var md5=require(_0x8311('0x2'));var util=require(_0x8311('0x3'));var moment=require(_0x8311('0x4'));var Promise=require('bluebird');var Redis=require(_0x8311('0x5'));var intUtil=require(_0x8311('0x6'));var config=require(_0x8311('0x7'));var logger=require(_0x8311('0x8'))(_0x8311('0x9'));config['redis']=_[_0x8311('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8311('0xb'))(new Redis(config[_0x8311('0xc')]));function getAdminId(_0x2c0efa,_0x5bfb78,_0x58c08c,_0x8d10dc){return new Promise(function(_0x3df7c7,_0x3de019){var _0x46b83f=![];var _0x158968={'method':_0x8311('0xd'),'uri':_0x8d10dc+_0x8311('0xe'),'json':!![]};_0x158968['headers']=_0x58c08c;logger[_0x8311('0xf')](_0x8311('0x10'));return rp(_0x158968)[_0x8311('0x11')](function(_0x193d38){if(_0x193d38){var _0x301540=_0x193d38['users'];var _0x3aab12=null;for(_0x3aab12=0x0;_0x3aab12<_0x301540[_0x8311('0x12')];_0x3aab12++){if(_0x301540[_0x3aab12][_0x8311('0x13')]===_0x2c0efa['adminEmail']){_0x2c0efa[_0x8311('0x14')]=_0x301540[_0x3aab12]['id'];_0x46b83f=!![];}}if(_0x46b83f){logger[_0x8311('0xf')](_0x8311('0x15'),_0x2c0efa[_0x8311('0x14')]);_0x3df7c7(_0x2c0efa);}else{_0x3de019({'statusCode':0x194,'message':_0x8311('0x16')});}}else{_0x3de019({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x8311('0x17')](function(_0x37ad84){logger['error']('['+[_0x5bfb78[_0x8311('0x18')]()]+']',_0x37ad84['message']);_0x3de019(_0x37ad84);});});}function getUser(_0x1db798,_0x42ac7e,_0x594f45){return function(_0x35c7be){return new Promise(function(_0x2bd8e6,_0x291d2c){var _0x234c68={'method':_0x8311('0xd'),'uri':_0x594f45+'/api/selector/owners','json':!![]};_0x234c68[_0x8311('0x19')]=_0x42ac7e;logger['info'](_0x8311('0x1a'));return rp(_0x234c68)[_0x8311('0x11')](function(_0x32467f){if(_0x32467f){var _0x5c1c0b=_0x32467f[_0x8311('0x1b')];var _0x4b39ef=![];var _0x51cb17=null;if(_0x35c7be[_0x8311('0x1c')]!==null){logger[_0x8311('0xf')](_0x8311('0x1d'),_0x35c7be['agentEmail']);_0x35c7be[_0x8311('0x1e')]=_0x35c7be[_0x8311('0x1c')];for(_0x51cb17=0x0;_0x51cb17<_0x5c1c0b[_0x8311('0x12')];_0x51cb17++){if(_0x5c1c0b[_0x51cb17][_0x8311('0x13')]===_0x35c7be[_0x8311('0x1c')]){_0x4b39ef=!![];_0x35c7be['userId']=_0x5c1c0b[_0x51cb17]['id'];logger['info']('User\x20found:',_0x35c7be[_0x8311('0x1f')]);}}}if(!_0x4b39ef){logger['info'](_0x8311('0x20'));_0x35c7be[_0x8311('0x1e')]=_0x35c7be[_0x8311('0x21')];_0x35c7be[_0x8311('0x1f')]=_0x35c7be['adminId'];_0x4b39ef=!![];}if(_0x4b39ef){_0x2bd8e6(_0x35c7be);}else{_0x291d2c({'statusCode':0x194,'message':_0x8311('0x16')});}}else{_0x291d2c({'statusCode':0x194,'message':_0x8311('0x16')});}})[_0x8311('0x17')](function(_0xb69337){logger[_0x8311('0x22')]('['+[_0x1db798[_0x8311('0x18')]()]+']',_0xb69337[_0x8311('0x23')]);_0x291d2c(_0xb69337);});});};}function getEndUser(_0x343abf,_0x1a1be4,_0x32b01c){return function(_0x4e6556){return new Promise(function(_0x3fffc2,_0x5a7b74){var _0x632d9f=0x0;var _0x506828={'method':_0x8311('0xd'),'uri':_0x32b01c+_0x8311('0x24'),'json':!![]};_0x506828[_0x8311('0x19')]=_0x1a1be4;logger[_0x8311('0xf')](_0x8311('0x25'));return rp(_0x506828)['then'](function(_0x118d0f){_0x118d0f[_0x8311('0x26')][_0x8311('0x27')](function(_0x2a7f01){if(_0x2a7f01[_0x8311('0x28')]===_0x8311('0x29')){_0x632d9f=_0x2a7f01['id'];}});})[_0x8311('0x11')](function(){logger[_0x8311('0xf')]('Getting\x20contact\x20list');var _0x222cd4={'method':_0x8311('0xd'),'uri':_0x32b01c+_0x8311('0x2a')+_0x632d9f,'json':!![]};_0x222cd4['headers']=_0x1a1be4;return rp(_0x222cd4);})['then'](function(_0x12f503){logger['info'](_0x8311('0x2b'),_0x4e6556[_0x8311('0x2c')]);if(_0x12f503[_0x8311('0x2d')][_0x8311('0x12')]>0x0){var _0x40594e=_[_0x8311('0x2e')](_0x12f503['contacts'],function(_0x4cc759){if(_0x4cc759[_0x8311('0x2f')]===_0x4e6556[_0x8311('0x2c')]||_0x4cc759[_0x8311('0x30')]===_0x4e6556[_0x8311('0x2c')]){return _0x4cc759;}});if(_0x40594e){_0x4e6556['endUserId']=_0x40594e['id'];logger['info']('Contact\x20found:',_0x4e6556['endUserId']);_0x3fffc2(_0x4e6556);}else{return createEndUser(_0x4e6556,_0x343abf,_0x1a1be4,_0x32b01c)[_0x8311('0x11')](function(_0x4d3221){logger[_0x8311('0xf')](_0x8311('0x31'),_0x4e6556[_0x8311('0x32')]);_0x3fffc2(_0x4d3221);});}}else{return createEndUser(_0x4e6556,_0x343abf,_0x1a1be4,_0x32b01c)[_0x8311('0x11')](function(_0x57e344){logger['info'](_0x8311('0x31'),_0x4e6556['endUserId']);_0x3fffc2(_0x57e344);});}})[_0x8311('0x17')](function(_0x52e365){throw new Error(_0x52e365[_0x8311('0x23')]);});});};}function createEndUser(_0xc15f8a,_0x38d715,_0x1b38fe,_0x208a54){return new Promise(function(_0x19bf80,_0x4fd2c1){var _0xcc7d5f=moment();var _0x1755da={'method':'POST','uri':_0x208a54+_0x8311('0x33'),'body':{'contact':{'last_name':_0xc15f8a[_0x8311('0x2c')],'work_number':_0xc15f8a['contactNumber'],'mobile_number':_0xc15f8a[_0x8311('0x2c')],'owner_id':_0xc15f8a[_0x8311('0x1f')],'created_at':_0xcc7d5f['format'](_0x8311('0x34'))}},'json':!![]};_0x1755da['headers']=_0x1b38fe;logger[_0x8311('0xf')](_0x8311('0x35'));return rp(_0x1755da)[_0x8311('0x11')](function(_0x28d36d){_0xc15f8a[_0x8311('0x32')]=_0x28d36d[_0x8311('0x36')]['id'];_0x19bf80(_0xc15f8a);})['catch'](function(_0x3c7b52){logger[_0x8311('0x22')]('['+[_0x38d715[_0x8311('0x18')]()]+']',_0x3c7b52[_0x8311('0x23')]);_0x4fd2c1(_0x3c7b52[_0x8311('0x23')]);});});}function getTicket(_0x27186b,_0x34f73e,_0x45dccf,_0x247879,_0x289971){return function(_0x897a86){logger[_0x8311('0xf')](_0x8311('0x37'));return new Promise(function(_0x133de1,_0x1b850f){var _0x421d95=moment();var _0x4b3ebb={'method':_0x8311('0x38'),'uri':_0x45dccf+'/api/tasks','body':{'title':intUtil[_0x8311('0x39')](_0x247879[_0x8311('0x3a')],_0x289971,'\x20'),'description':intUtil['getString'](_0x247879['Descriptions'],_0x289971,'\x0a'),'owner_id':_0x897a86['userId'],'creater_id':_0x897a86['adminId'],'targetable_id':_0x897a86[_0x8311('0x32')],'targetable_type':_0x8311('0x3b'),'created_at':_0x421d95[_0x8311('0x3c')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x421d95[_0x8311('0x3d')](0x1e,'m')['format'](_0x8311('0x34'))},'json':!![]};_0x4b3ebb[_0x8311('0x19')]=_0x34f73e;return rp(_0x4b3ebb)[_0x8311('0x11')](function(_0x32c4a7){_0x897a86[_0x8311('0x3e')]=_0x32c4a7[_0x8311('0x3f')]['id'];logger[_0x8311('0xf')](_0x8311('0x40'),_0x897a86[_0x8311('0x3e')]);_0x133de1(_0x897a86);})[_0x8311('0x17')](function(_0x436387){logger['error']('['+[_0x27186b['toUpperCase']()]+']',_0x436387[_0x8311('0x23')]);_0x1b850f(_0x436387[_0x8311('0x23')]);});});};}function emit(_0x50ac52,_0x1fee6e,_0xa90741){var _0x4e351f={'uri':_0x50ac52+_0x8311('0x41')+_0xa90741};io['to'](util['format'](_0x8311('0x42'),_0x1fee6e))[_0x8311('0x43')](_0x8311('0x44'),_0x4e351f);}exports['cs']=function(_0x4ad4d4,_0x49a106,_0x50d25b,_0x32d234,_0x4cb126,_0x3223c7,_0x55dd64,_0x288b60){var _0x2de56f={};var _0x2f8cd2={'Authorization':_0x8311('0x45')+_0x3223c7[_0x8311('0x46')]};_0x3223c7['remoteUri']=intUtil['stripTrailingSlash'](_0x3223c7[_0x8311('0x47')]);_0x3223c7[_0x8311('0x48')]=intUtil[_0x8311('0x49')](_0x3223c7[_0x8311('0x48')]);var _0x56dcf5=_0x3223c7[_0x8311('0x47')];_0x2de56f[_0x8311('0x21')]=_0x3223c7['username'];_0x2de56f['contactNumber']=_0x288b60[_0x8311('0x4a')]()===_0x8311('0x4b')?_0x49a106[_0x8311('0x4c')]:_0x49a106[_0x8311('0x4d')];_0x2de56f[_0x8311('0x4e')]=_0x288b60===_0x8311('0x4f')||_0x288b60==='unmanaged'?_0x8311('0x4f'):_0x8311('0x4b');if(_0x32d234){_0x2de56f[_0x8311('0x1c')]=_0x32d234[_0x8311('0x13')];}var _0x30989b=util['format'](_0x8311('0x50'),_0x3223c7['serverUrl'],_0x49a106[_0x8311('0x51')],md5(_0x49a106[_0x8311('0x51')]));if(_0x4cb126&&_0x4cb126[_0x8311('0x52')]){logger[_0x8311('0xf')](_0x8311('0x53'),_0x8311('0x54'));_0x49a106[_0x8311('0x55')]=_0x30989b;}else if(_0x55dd64&&_0x55dd64[_0x8311('0x56')]&&_0x55dd64[_0x8311('0x56')]!==_0x8311('0x57')){logger[_0x8311('0xf')](_0x8311('0x58'),_0x8311('0x54'));_0x49a106['recordingURL']=_0x30989b;}else{_0x49a106[_0x8311('0x55')]='';}return getAdminId(_0x2de56f,_0x288b60,_0x2f8cd2,_0x56dcf5)['then'](getUser(_0x288b60,_0x2f8cd2,_0x56dcf5))[_0x8311('0x11')](getEndUser(_0x288b60,_0x2f8cd2,_0x56dcf5))[_0x8311('0x11')](getTicket(_0x288b60,_0x2f8cd2,_0x56dcf5,_0x50d25b,_0x49a106))[_0x8311('0x11')](function(_0x324f71){logger[_0x8311('0xf')](util['format'](_0x8311('0x59'),_0x324f71[_0x8311('0x3e')]));if(_0x288b60!=='unmanaged'){logger[_0x8311('0xf')]('['+[_0x288b60[_0x8311('0x18')]()]+']',_0x8311('0x5a'));emit(_0x56dcf5,_0x32d234[_0x8311('0x28')],_0x324f71[_0x8311('0x32')]);}})[_0x8311('0x17')](function(_0x37fe3b){logger[_0x8311('0x22')]('['+[_0x288b60[_0x8311('0x18')]()]+_0x8311('0x5b'),util['inspect'](_0x37fe3b,{'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 556f763..d37793e 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 _0xefda=['./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','desk','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./salesforce'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xefda,0x96));var _0xaefd=function(_0x310a54,_0x212d9a){_0x310a54=_0x310a54-0x0;var _0x4e4caa=_0xefda[_0x310a54];return _0x4e4caa;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0xaefd('0x1'));var sugarcrm=require(_0xaefd('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0xaefd('0x3'));var desk=require(_0xaefd('0x4'));var vtiger=require(_0xaefd('0x5'));var servicenow=require(_0xaefd('0x6'));var dynamics365=require(_0xaefd('0x7'));var freshsales=require(_0xaefd('0x8'));var integrations=['zendesk',_0xaefd('0x9'),_0xaefd('0xa'),_0xaefd('0xb'),_0xaefd('0xc'),'desk',_0xaefd('0xd'),_0xaefd('0xe'),_0xaefd('0xf'),'servicenow'];exports['exec']=function(_0x54a3b1,_0xa6239d,_0x16b36e,_0x20135c,_0x35eea5,_0x10272a){if(_0x16b36e){if(_[_0xaefd('0x10')](integrations,_0x54a3b1[_0xaefd('0x11')][_0xaefd('0x12')]())){try{var _0x27be0f=null;var _0x382983='';var _0x2a310c=_0x16b36e[_0x54a3b1['data1'][_0xaefd('0x12')]()];if(_0x2a310c){var _0x4ac467=_0x2a310c[_0x54a3b1[_0xaefd('0x13')]];if(_0x4ac467){var _0x1725af=_[_0xaefd('0x14')](_0x4ac467[_0xaefd('0x15')],{'id':parseInt(_0x54a3b1['data3'],0xa)});if(_0x1725af){if(_0x20135c){if(_0x35eea5&&_0xa6239d[_0xaefd('0x16')]){_0x382983=_0xaefd('0x16');}else if(_0xa6239d[_0xaefd('0x17')]){_0x382983=_0xaefd('0x18');}else{console[_0xaefd('0x19')](_0xaefd('0x1a'),_0xa6239d);}}else{_0x382983=_0xaefd('0x1b');}switch(_0x54a3b1[_0xaefd('0x11')]['toLowerCase']()){case _0xaefd('0x1c'):zendesk[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0x9'):salesforce[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0xa'):sugarcrm[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0xb'):freshdesk[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0xc'):zoho[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0x1d'):desk[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case'vtiger':vtiger[_0x382983](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a);break;case _0xaefd('0xf'):freshsales['cs'](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a,_0x382983);break;case _0xaefd('0x1e'):servicenow['cs'](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a,_0x382983);break;case _0xaefd('0xe'):dynamics365['cs'](_0x54a3b1,_0xa6239d,_0x1725af,_0x20135c,_0x35eea5,_0x4ac467,_0x10272a,_0x382983);break;default:console[_0xaefd('0x19')](_0xaefd('0x1f'));}}else{_0x27be0f=require(_0xaefd('0x20'))(_0x54a3b1['data1'][_0xaefd('0x12')]());_0x27be0f[_0xaefd('0x21')](_0xaefd('0x22'),util[_0xaefd('0x23')](_0xaefd('0x24'),_0x54a3b1['data1']['toLowerCase'](),_0x54a3b1['data3']));}}else{_0x27be0f=require(_0xaefd('0x20'))(_0x54a3b1[_0xaefd('0x11')][_0xaefd('0x12')]());_0x27be0f['error'](_0xaefd('0x22'),util['format'](_0xaefd('0x25'),_0x54a3b1[_0xaefd('0x11')][_0xaefd('0x12')](),_0x54a3b1['data2']));}}else{}}catch(_0x435413){console[_0xaefd('0x21')](_0x435413);}}}}; \ No newline at end of file +var _0x087b=['format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','error','[EXEC]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x087b,0x11a));var _0xb087=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x087b[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xb087('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0xb087('0x3'));var desk=require(_0xb087('0x4'));var vtiger=require(_0xb087('0x5'));var servicenow=require(_0xb087('0x6'));var dynamics365=require(_0xb087('0x7'));var freshsales=require(_0xb087('0x8'));var integrations=[_0xb087('0x9'),_0xb087('0xa'),_0xb087('0xb'),_0xb087('0xc'),_0xb087('0xd'),_0xb087('0xe'),_0xb087('0xf'),_0xb087('0x10'),_0xb087('0x11'),_0xb087('0x12')];exports[_0xb087('0x13')]=function(_0x583d25,_0x244abc,_0x108451,_0x903a16,_0x3bce7a,_0x3b45c1){if(_0x108451){if(_[_0xb087('0x14')](integrations,_0x583d25[_0xb087('0x15')]['toLowerCase']())){try{var _0x189e2b=null;var _0x31f977='';var _0x323656=_0x108451[_0x583d25['data1'][_0xb087('0x16')]()];if(_0x323656){var _0x3f145e=_0x323656[_0x583d25[_0xb087('0x17')]];if(_0x3f145e){var _0x46410b=_[_0xb087('0x18')](_0x3f145e[_0xb087('0x19')],{'id':parseInt(_0x583d25[_0xb087('0x1a')],0xa)});if(_0x46410b){if(_0x903a16){if(_0x3bce7a&&_0x244abc[_0xb087('0x1b')]){_0x31f977=_0xb087('0x1b');}else if(_0x244abc[_0xb087('0x1c')]){_0x31f977='outbound';}else{console[_0xb087('0x1d')](_0xb087('0x1e'),_0x244abc);}}else{_0x31f977='unmanaged';}switch(_0x583d25[_0xb087('0x15')][_0xb087('0x16')]()){case _0xb087('0x9'):zendesk[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case'salesforce':salesforce[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case _0xb087('0xb'):sugarcrm[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case _0xb087('0xc'):freshdesk[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case _0xb087('0xd'):zoho[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case _0xb087('0xe'):desk[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case'vtiger':vtiger[_0x31f977](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1);break;case _0xb087('0x11'):freshsales['cs'](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1,_0x31f977);break;case _0xb087('0x12'):servicenow['cs'](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1,_0x31f977);break;case _0xb087('0x10'):dynamics365['cs'](_0x583d25,_0x244abc,_0x46410b,_0x903a16,_0x3bce7a,_0x3f145e,_0x3b45c1,_0x31f977);break;default:console[_0xb087('0x1d')]('unknown\x20integration');}}else{_0x189e2b=require('../../../../config/logger')(_0x583d25['data1']['toLowerCase']());_0x189e2b[_0xb087('0x1f')](_0xb087('0x20'),util[_0xb087('0x21')](_0xb087('0x22'),_0x583d25[_0xb087('0x15')][_0xb087('0x16')](),_0x583d25[_0xb087('0x1a')]));}}else{_0x189e2b=require('../../../../config/logger')(_0x583d25[_0xb087('0x15')][_0xb087('0x16')]());_0x189e2b[_0xb087('0x1f')](_0xb087('0x20'),util[_0xb087('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x583d25[_0xb087('0x15')][_0xb087('0x16')](),_0x583d25['data2']));}}else{}}catch(_0x5a2dc6){console['error'](_0x5a2dc6);}}}}; \ 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 ca97c68..5b04051 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 _0x629e=['none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','bluebird','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','ticketType','assign','utc','getString','Subjects','Descriptions','Case','ContactId','sobject','create','isNil','validateEmail','User','find','execute','then','info','Agent\x20%s\x20found.','Name','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Task','moduleSearch','contact_lead','Contact','length','Lead','contact','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','idField','content','toString','type','variableName','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat'];(function(_0xab635a,_0x3ca754){var _0x345e0f=function(_0x57fdbf){while(--_0x57fdbf){_0xab635a['push'](_0xab635a['shift']());}};_0x345e0f(++_0x3ca754);}(_0x629e,0x160));var _0xe629=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x629e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe629('0x0'));var rp=require(_0xe629('0x1'));var moment=require('moment');var BPromise=require(_0xe629('0x2'));var md5=require('md5');var jsforce=require(_0xe629('0x3'));var util=require(_0xe629('0x4'));var Redis=require('ioredis');var intUtil=require(_0xe629('0x5'));var config=require(_0xe629('0x6'));var logger=require(_0xe629('0x7'))(_0xe629('0x8'));config[_0xe629('0x9')]=_[_0xe629('0xa')](config[_0xe629('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe629('0xb'))(new Redis(config['redis']));function emit(_0x32c7d4,_0x5d1b79,_0x3c83b2){io['to'](_0x32c7d4)[_0xe629('0xc')](_0x5d1b79,_0x3c83b2);}function getTicket(_0x4ba46d,_0x2e8a75,_0x290a5d,_0x3b90e1,_0x34282a,_0x3f44df,_0x3f7e8c,_0x1fa1fe){var _0xfc9d2={};if(_0x3b90e1[_0xe629('0xd')]==='Task'){_0xfc9d2=Object[_0xe629('0xe')]({},{'OwnerId':_0x2e8a75['id'],'ActivityDate':moment[_0xe629('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xe629('0x10')](_0x3b90e1[_0xe629('0x11')],_0x34282a,'\x20'),'Description':intUtil['getString'](_0x3b90e1[_0xe629('0x12')],_0x34282a,'\x0a')},getCustomFields(_0x3f44df,_0x34282a));if(_0x290a5d){_0xfc9d2['WhoId']=_0x290a5d['id'];}}else if(_0x3b90e1[_0xe629('0xd')]===_0xe629('0x13')){_0xfc9d2=Object['assign']({},{'OwnerId':_0x2e8a75['id'],'Subject':intUtil['getString'](_0x3b90e1['Subjects'],_0x34282a,'\x20'),'Description':intUtil[_0xe629('0x10')](_0x3b90e1[_0xe629('0x12')],_0x34282a,'\x0a')},getCustomFields(_0x3f44df,_0x34282a));if(_0x290a5d){_0xfc9d2[_0xe629('0x14')]=_0x290a5d['id'];}}return _0x3f7e8c[_0xe629('0x15')](_0x3b90e1[_0xe629('0xd')])[_0xe629('0x16')](_0xfc9d2);}function getUser(_0x1c9be1,_0x3870bd,_0x588e01){if(!_[_0xe629('0x17')](_0x3870bd)&&intUtil[_0xe629('0x18')](_0x3870bd)){var _0x1cf74e={'Email':_0x3870bd};var _0x2da0e3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x588e01['sobject'](_0xe629('0x19'))[_0xe629('0x1a')](_0x1cf74e,_0x2da0e3)[_0xe629('0x1b')]()[_0xe629('0x1c')](function(_0x19b72a){if(_0x19b72a['length']){var _0x4748b7=_['find'](_0x19b72a,function(_0x3c9538){return _0x3c9538['Email']===_0x3870bd;});if(_0x4748b7){logger[_0xe629('0x1d')](_0xe629('0x1e'),_0x3870bd);return BPromise['resolve']({'id':_0x4748b7['Id'],'name':_0x4748b7[_0xe629('0x1f')]});}}else{logger[_0xe629('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3870bd);return _0x588e01[_0xe629('0x20')]()[_0xe629('0x1c')](function(_0x13cce9){return BPromise[_0xe629('0x21')]({'id':_0x13cce9[_0xe629('0x22')],'name':_0x13cce9[_0xe629('0x23')]});});}});}else{logger[_0xe629('0x1d')](_0xe629('0x24'),_0x3870bd);return _0x588e01[_0xe629('0x20')]()[_0xe629('0x1c')](function(_0x1335ce){return BPromise[_0xe629('0x21')]({'id':_0x1335ce['user_id'],'name':_0x1335ce['display_name']});});}}function getEndUser(_0x5db6c3,_0x5436fa,_0x568ff4,_0x5305a3,_0x3e6cbe){var _0x2abf37={'Phone':_0x5305a3};var _0x504c31={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe629('0x21')]()['then'](function(){if(_0x5436fa[_0xe629('0xd')]===_0xe629('0x25')){logger[_0xe629('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5305a3,_0x5436fa[_0xe629('0x26')]);switch(_0x5436fa[_0xe629('0x26')]){case _0xe629('0x27'):return _0x3e6cbe[_0xe629('0x15')](_0xe629('0x28'))[_0xe629('0x1a')](_0x2abf37,_0x504c31)[_0xe629('0x1b')]()[_0xe629('0x1c')](function(_0x45fb9d){if(_0x45fb9d&&_0x45fb9d[_0xe629('0x29')]){return _0x45fb9d;}else{return _0x3e6cbe[_0xe629('0x15')](_0xe629('0x2a'))[_0xe629('0x1a')](_0x2abf37,_0x504c31);}});case _0xe629('0x2b'):return _0x3e6cbe[_0xe629('0x15')](_0xe629('0x28'))[_0xe629('0x1a')](_0x2abf37,_0x504c31)[_0xe629('0x1b')]();case _0xe629('0x2c'):return _0x3e6cbe['sobject']('Lead')[_0xe629('0x1a')](_0x2abf37,_0x504c31);default:return null;}}else if(_0x5436fa[_0xe629('0xd')]===_0xe629('0x13')){logger[_0xe629('0x1d')](_0xe629('0x2d'),_0x5305a3,_0xe629('0x2b'));return _0x3e6cbe[_0xe629('0x15')](_0xe629('0x28'))['find'](_0x2abf37,_0x504c31)[_0xe629('0x1b')]();}})[_0xe629('0x1c')](function(_0x585897){if(_0x585897&&_0x585897[_0xe629('0x29')]){var _0x5261d6=_[_0xe629('0x1a')](_0x585897,function(_0x3f4574){return _0x3f4574[_0xe629('0x2e')]===_0x5305a3;});if(_0x5261d6){return BPromise[_0xe629('0x21')]({'id':_0x5261d6['Id'],'name':_0x5261d6[_0xe629('0x1f')],'phone':_0x5261d6[_0xe629('0x2e')]});}}})[_0xe629('0x1c')](function(_0x3fccd6){if(_0x3fccd6){logger[_0xe629('0x1d')](_0xe629('0x2f'),_0x5305a3);return BPromise[_0xe629('0x21')](_0x3fccd6);}else{logger[_0xe629('0x1d')](_0xe629('0x30'),_0x5305a3);var _0x3a512a={'LastName':_0x568ff4!==_0xe629('0x31')?_0x568ff4:util[_0xe629('0x32')]('Caller\x20-\x20%s',_0x5305a3),'Phone':_0x5305a3};if(_0x5436fa[_0xe629('0x33')]){if(_0x5436fa['moduleCreate']==='contact'){logger['info'](_0xe629('0x34'),_0x5305a3,_0x5436fa[_0xe629('0x33')]);}else if(_0x5436fa[_0xe629('0x33')]==='lead'&&_0x5436fa[_0xe629('0xd')]===_0xe629('0x25')){logger[_0xe629('0x1d')](_0xe629('0x34'),_0x5305a3,_0x5436fa['moduleCreate']);_0x3a512a[_0xe629('0x35')]=_0xe629('0x36');}else{return null;}}return _0x3e6cbe['sobject'](_[_0xe629('0x37')](_0x5436fa['moduleCreate']))[_0xe629('0x16')](_0x3a512a);}});}function getCustomFields(_0x492157,_0x205569){var _0x54089b={};if(_0x492157[_0xe629('0x29')]>0x0){_[_0xe629('0x38')](_0x492157,function(_0x5e0d75){if(_0x5e0d75['type']==='string'&&_0x5e0d75[_0xe629('0x39')]){_0x54089b[_0x5e0d75['idField']]=_0x5e0d75[_0xe629('0x3a')][_0xe629('0x3b')]();}else if(_0x5e0d75[_0xe629('0x3c')]==='variable'&&_0x5e0d75[_0xe629('0x3d')]&&_0x5e0d75[_0xe629('0x39')]){_0x205569[_0x5e0d75['variableName']]&&(_0x54089b[_0x5e0d75['idField']]=_0x205569[_0x5e0d75[_0xe629('0x3d')]][_0xe629('0x3b')]());}else if(_0x5e0d75['type']==='customVariable'&&_0x5e0d75[_0xe629('0x3e')]&&_0x5e0d75[_0xe629('0x3e')][_0xe629('0x3f')]&&_0x5e0d75[_0xe629('0x39')]){_0x205569[_0x5e0d75[_0xe629('0x3e')][_0xe629('0x3f')][_0xe629('0x40')]()]&&(_0x54089b[_0x5e0d75['idField']]=_0x205569[_0x5e0d75[_0xe629('0x3e')]['name']['toLowerCase']()][_0xe629('0x3b')]());}});}return _0x54089b;}function getConnection(_0x3840ce){var _0x512940=_0x3840ce[_0xe629('0x41')]['concat'](_0x3840ce[_0xe629('0x42')]);var _0x436b4c=new jsforce[(_0xe629('0x43'))]({'oauth2':{'loginUrl':_0x3840ce[_0xe629('0x44')]||'https://login.salesforce.com','clientId':_0x3840ce[_0xe629('0x45')],'clientSecret':_0x3840ce[_0xe629('0x46')]}});return _0x436b4c[_0xe629('0x47')](_0x3840ce[_0xe629('0x48')],_0x512940)['then'](function(){logger[_0xe629('0x1d')](_0xe629('0x49'));return _0x436b4c;});}exports[_0xe629('0x4a')]=function(_0xa53b21,_0x6e1836,_0xd729b9,_0xd61dd7,_0x50e9f8,_0x164e3f){var _0xf5f306,_0x5f0e27,_0x1ce04e,_0x4e0310;_0x164e3f[_0xe629('0x4b')]=intUtil[_0xe629('0x4c')](_0x164e3f[_0xe629('0x4b')]);_0x164e3f[_0xe629('0x44')]=intUtil[_0xe629('0x4c')](_0x164e3f['remoteUri']);if(_0x50e9f8&&_0x50e9f8[_0xe629('0x4d')]){logger[_0xe629('0x1d')]('[QUEUE]',_0xe629('0x4e'));_0x6e1836[_0xe629('0x4f')]=util[_0xe629('0x32')](_0xe629('0x50'),_0x164e3f[_0xe629('0x4b')],_0x6e1836[_0xe629('0x51')],md5(_0x6e1836[_0xe629('0x51')]));}else{_0x6e1836[_0xe629('0x4f')]='';}return getConnection(_0x164e3f)[_0xe629('0x1c')](function(_0xdab0d2){_0x4e0310=_0xdab0d2;return getUser(_0x164e3f,_0xd61dd7[_0xe629('0x52')],_0x4e0310);})[_0xe629('0x1c')](function(_0x816ab7){_0xf5f306=_0x816ab7;return getEndUser(_0x164e3f,_0xd729b9,_0x6e1836[_0xe629('0x53')],_0x6e1836[_0xe629('0x54')],_0x4e0310);})[_0xe629('0x1c')](function(_0x221b64){_0x5f0e27=_0x221b64;return getTicket(_0x164e3f,_0xf5f306,_0x5f0e27,_0xd729b9,_0x6e1836,_0xd729b9[_0xe629('0x55')],_0x4e0310,_0xe629('0x4a'));})[_0xe629('0x1c')](function(_0x214708){_0x1ce04e=_0x214708;logger['info'](_0xe629('0x56'),_0x1ce04e['id']);logger[_0xe629('0x1d')](_0xe629('0x57'),_0x1ce04e['id'],_0xd61dd7[_0xe629('0x3f')],_0x164e3f[_0xe629('0x3c')]);switch(_0x164e3f[_0xe629('0x3c')]){case _0xe629('0x58'):emit(util[_0xe629('0x32')](_0xe629('0x59'),_0xd61dd7[_0xe629('0x3f')]),_0xe629('0x5a'),{'recordId':_0x1ce04e['id']});break;case _0xe629('0x5b'):emit(util[_0xe629('0x32')](_0xe629('0x59'),_0xd61dd7[_0xe629('0x3f')]),'trigger:browser:url',{'uri':util[_0xe629('0x32')](_0xe629('0x5c'),_0x4e0310[_0xe629('0x5d')],_0x1ce04e['id'])});break;default:logger[_0xe629('0x5e')](_0xe629('0x5f'));}})['catch'](function(_0x16d376){logger[_0xe629('0x5e')](_0xe629('0x60'),JSON[_0xe629('0x61')](_0x16d376));});};exports[_0xe629('0x62')]=function(_0x545310,_0x36aaf4,_0x30bda6,_0x5281b3,_0x406319,_0x42ce19,_0x558f20){var _0x514936,_0x3f3a46,_0x201080,_0x174dc3;_0x42ce19[_0xe629('0x4b')]=intUtil[_0xe629('0x4c')](_0x42ce19[_0xe629('0x4b')]);_0x42ce19[_0xe629('0x44')]=intUtil[_0xe629('0x4c')](_0x42ce19['remoteUri']);if(_0x558f20&&_0x558f20[_0xe629('0x63')]&&_0x558f20['recordingFormat']!==_0xe629('0x64')){logger[_0xe629('0x1d')](_0xe629('0x65'),'Recording\x20is\x20enabled!');_0x36aaf4[_0xe629('0x4f')]=util[_0xe629('0x32')](_0xe629('0x50'),_0x42ce19[_0xe629('0x4b')],_0x36aaf4[_0xe629('0x51')],md5(_0x36aaf4[_0xe629('0x51')]));}return getConnection(_0x42ce19)['then'](function(_0x2eceb2){_0x174dc3=_0x2eceb2;return getUser(_0x42ce19,_0x5281b3[_0xe629('0x52')],_0x174dc3);})[_0xe629('0x1c')](function(_0x16551b){_0x514936=_0x16551b;return getEndUser(_0x42ce19,_0x30bda6,_0x36aaf4[_0xe629('0x66')],_0x36aaf4[_0xe629('0x67')],_0x174dc3);})[_0xe629('0x1c')](function(_0xd922db){_0x3f3a46=_0xd922db;return getTicket(_0x42ce19,_0x514936,_0x3f3a46,_0x30bda6,_0x36aaf4,_0x30bda6[_0xe629('0x55')],_0x174dc3,_0xe629('0x62'));})[_0xe629('0x1c')](function(_0x306827){_0x201080=_0x306827;logger['info'](_0xe629('0x68'),_0x201080['id']);logger[_0xe629('0x1d')](_0xe629('0x69'),_0x201080['id'],_0x5281b3['name'],_0x42ce19[_0xe629('0x3c')]);switch(_0x42ce19[_0xe629('0x3c')]){case'integrationTab':emit(util[_0xe629('0x32')](_0xe629('0x59'),_0x5281b3[_0xe629('0x3f')]),_0xe629('0x5a'),{'recordId':_0x201080['id']});break;case _0xe629('0x5b'):emit(util[_0xe629('0x32')]('user:%s',_0x5281b3[_0xe629('0x3f')]),'trigger:browser:url',{'uri':util['format'](_0xe629('0x5c'),_0x174dc3[_0xe629('0x5d')],_0x201080['id'])});break;default:logger[_0xe629('0x5e')](_0xe629('0x65'),_0xe629('0x6a'));}})['catch'](function(_0x5363ef){logger['error'](_0xe629('0x65'),JSON[_0xe629('0x61')](_0x5363ef));});};exports[_0xe629('0x6b')]=function(_0x102855,_0x55e2ba,_0x121cc2,_0x1e5b8e,_0x3db91f,_0x5accfc){var _0xb41efc,_0x245d06,_0x1ce1b4,_0x53ce46;_0x5accfc[_0xe629('0x4b')]=intUtil['stripTrailingSlash'](_0x5accfc[_0xe629('0x4b')]);_0x5accfc[_0xe629('0x44')]=intUtil[_0xe629('0x4c')](_0x5accfc[_0xe629('0x44')]);if(_0x3db91f&&_0x3db91f[_0xe629('0x4d')]){logger['info']('['+_0x55e2ba['lastevent'][_0xe629('0x6c')]()+']',_0xe629('0x4e'));_0x55e2ba[_0xe629('0x4f')]=util[_0xe629('0x32')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5accfc[_0xe629('0x4b')],_0x55e2ba[_0xe629('0x51')],md5(_0x55e2ba[_0xe629('0x51')]));}else{_0x55e2ba[_0xe629('0x4f')]='';}return getConnection(_0x5accfc)[_0xe629('0x1c')](function(_0x66bc6){_0x53ce46=_0x66bc6;if(!_[_0xe629('0x17')](_0x1e5b8e)){return getUser(_0x5accfc,_0x1e5b8e['name'],_0x53ce46);}else{return getUser(_0x5accfc,null,_0x53ce46);}})[_0xe629('0x1c')](function(_0x2dc58e){_0xb41efc=_0x2dc58e;return getEndUser(_0x5accfc,_0x121cc2,_0x55e2ba[_0xe629('0x53')],_0x55e2ba[_0xe629('0x54')],_0x53ce46);})[_0xe629('0x1c')](function(_0x43ada7){_0x245d06=_0x43ada7;return getTicket(_0x5accfc,_0xb41efc,_0x245d06,_0x121cc2,_0x55e2ba,_0x121cc2[_0xe629('0x55')],_0x53ce46);})[_0xe629('0x1c')](function(_0x46f9b2){_0x1ce1b4=_0x46f9b2;logger['info']('['+_0x55e2ba[_0xe629('0x6d')]['toUpperCase']()+_0xe629('0x6e'),_0x1ce1b4['id']);logger[_0xe629('0x1d')]('['+_0x55e2ba[_0xe629('0x6d')][_0xe629('0x6c')]()+_0xe629('0x6f'),_0x5accfc[_0xe629('0x3c')]);})[_0xe629('0x70')](function(_0x3076bf){logger[_0xe629('0x5e')]('['+_0x55e2ba[_0xe629('0x6d')]['toUpperCase']()+']',JSON[_0xe629('0x61')](_0x3076bf));});}; \ No newline at end of file +var _0xbc40=['calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','stringify','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','Task','assign','getString','Subjects','Descriptions','WhoId','ticketType','Case','create','isNil','validateEmail','sobject','User','find','then','length','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','string','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','recordingURL','uniqueid','email','calleridname'];(function(_0x411be6,_0x9b926){var _0xf61a3a=function(_0x4930a8){while(--_0x4930a8){_0x411be6['push'](_0x411be6['shift']());}};_0xf61a3a(++_0x9b926);}(_0xbc40,0x162));var _0x0bc4=function(_0x20d2e9,_0x49664e){_0x20d2e9=_0x20d2e9-0x0;var _0x56d870=_0xbc40[_0x20d2e9];return _0x56d870;};'use strict';var _=require(_0x0bc4('0x0'));var rp=require(_0x0bc4('0x1'));var moment=require(_0x0bc4('0x2'));var BPromise=require(_0x0bc4('0x3'));var md5=require('md5');var jsforce=require(_0x0bc4('0x4'));var util=require(_0x0bc4('0x5'));var Redis=require(_0x0bc4('0x6'));var intUtil=require(_0x0bc4('0x7'));var config=require('../../../../config/environment');var logger=require(_0x0bc4('0x8'))(_0x0bc4('0x9'));config['redis']=_['defaults'](config[_0x0bc4('0xa')],{'host':_0x0bc4('0xb'),'port':0x18eb});var io=require(_0x0bc4('0xc'))(new Redis(config[_0x0bc4('0xa')]));function emit(_0x19077e,_0x189675,_0x565058){io['to'](_0x19077e)[_0x0bc4('0xd')](_0x189675,_0x565058);}function getTicket(_0x184076,_0xa3174c,_0x3deb63,_0x15e184,_0x3d7adb,_0x43bf66,_0x21a46f,_0x44ee05){var _0x1b1845={};if(_0x15e184['ticketType']===_0x0bc4('0xe')){_0x1b1845=Object[_0x0bc4('0xf')]({},{'OwnerId':_0xa3174c['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0bc4('0x10')](_0x15e184[_0x0bc4('0x11')],_0x3d7adb,'\x20'),'Description':intUtil[_0x0bc4('0x10')](_0x15e184[_0x0bc4('0x12')],_0x3d7adb,'\x0a')},getCustomFields(_0x43bf66,_0x3d7adb));if(_0x3deb63){_0x1b1845[_0x0bc4('0x13')]=_0x3deb63['id'];}}else if(_0x15e184[_0x0bc4('0x14')]===_0x0bc4('0x15')){_0x1b1845=Object['assign']({},{'OwnerId':_0xa3174c['id'],'Subject':intUtil[_0x0bc4('0x10')](_0x15e184['Subjects'],_0x3d7adb,'\x20'),'Description':intUtil[_0x0bc4('0x10')](_0x15e184[_0x0bc4('0x12')],_0x3d7adb,'\x0a')},getCustomFields(_0x43bf66,_0x3d7adb));if(_0x3deb63){_0x1b1845['ContactId']=_0x3deb63['id'];}}return _0x21a46f['sobject'](_0x15e184['ticketType'])[_0x0bc4('0x16')](_0x1b1845);}function getUser(_0x478bd4,_0x2e611e,_0x54c400){if(!_[_0x0bc4('0x17')](_0x2e611e)&&intUtil[_0x0bc4('0x18')](_0x2e611e)){var _0x20fa30={'Email':_0x2e611e};var _0x4b81a9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x54c400[_0x0bc4('0x19')](_0x0bc4('0x1a'))[_0x0bc4('0x1b')](_0x20fa30,_0x4b81a9)['execute']()[_0x0bc4('0x1c')](function(_0x4f881a){if(_0x4f881a[_0x0bc4('0x1d')]){var _0xfd1895=_[_0x0bc4('0x1b')](_0x4f881a,function(_0x4cf688){return _0x4cf688[_0x0bc4('0x1e')]===_0x2e611e;});if(_0xfd1895){logger[_0x0bc4('0x1f')]('Agent\x20%s\x20found.',_0x2e611e);return BPromise[_0x0bc4('0x20')]({'id':_0xfd1895['Id'],'name':_0xfd1895[_0x0bc4('0x21')]});}}else{logger[_0x0bc4('0x1f')](_0x0bc4('0x22'),_0x2e611e);return _0x54c400[_0x0bc4('0x23')]()[_0x0bc4('0x1c')](function(_0x1d9323){return BPromise['resolve']({'id':_0x1d9323[_0x0bc4('0x24')],'name':_0x1d9323['display_name']});});}});}else{logger[_0x0bc4('0x1f')](_0x0bc4('0x22'),_0x2e611e);return _0x54c400[_0x0bc4('0x23')]()[_0x0bc4('0x1c')](function(_0x1777c4){return BPromise[_0x0bc4('0x20')]({'id':_0x1777c4['user_id'],'name':_0x1777c4[_0x0bc4('0x25')]});});}}function getEndUser(_0x2f2033,_0x20187d,_0x497389,_0x47cf14,_0x1f5efa){var _0x13f878={'Phone':_0x47cf14};var _0x3ecead={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0bc4('0x20')]()['then'](function(){if(_0x20187d[_0x0bc4('0x14')]===_0x0bc4('0xe')){logger[_0x0bc4('0x1f')](_0x0bc4('0x26'),_0x47cf14,_0x20187d[_0x0bc4('0x27')]);switch(_0x20187d[_0x0bc4('0x27')]){case _0x0bc4('0x28'):return _0x1f5efa['sobject'](_0x0bc4('0x29'))['find'](_0x13f878,_0x3ecead)[_0x0bc4('0x2a')]()[_0x0bc4('0x1c')](function(_0x2869bc){if(_0x2869bc&&_0x2869bc[_0x0bc4('0x1d')]){return _0x2869bc;}else{return _0x1f5efa[_0x0bc4('0x19')](_0x0bc4('0x2b'))['find'](_0x13f878,_0x3ecead);}});case _0x0bc4('0x2c'):return _0x1f5efa[_0x0bc4('0x19')](_0x0bc4('0x29'))[_0x0bc4('0x1b')](_0x13f878,_0x3ecead)[_0x0bc4('0x2a')]();case _0x0bc4('0x2d'):return _0x1f5efa[_0x0bc4('0x19')]('Lead')[_0x0bc4('0x1b')](_0x13f878,_0x3ecead);default:return null;}}else if(_0x20187d['ticketType']===_0x0bc4('0x15')){logger[_0x0bc4('0x1f')](_0x0bc4('0x26'),_0x47cf14,_0x0bc4('0x2c'));return _0x1f5efa[_0x0bc4('0x19')](_0x0bc4('0x29'))[_0x0bc4('0x1b')](_0x13f878,_0x3ecead)[_0x0bc4('0x2a')]();}})[_0x0bc4('0x1c')](function(_0x100dd1){if(_0x100dd1&&_0x100dd1['length']){var _0x404896=_[_0x0bc4('0x1b')](_0x100dd1,function(_0x87142a){return _0x87142a['Phone']===_0x47cf14;});if(_0x404896){return BPromise[_0x0bc4('0x20')]({'id':_0x404896['Id'],'name':_0x404896[_0x0bc4('0x21')],'phone':_0x404896[_0x0bc4('0x2e')]});}}})[_0x0bc4('0x1c')](function(_0x464929){if(_0x464929){logger[_0x0bc4('0x1f')](_0x0bc4('0x2f'),_0x47cf14);return BPromise[_0x0bc4('0x20')](_0x464929);}else{logger[_0x0bc4('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x47cf14);var _0x254de6={'LastName':_0x497389!==_0x0bc4('0x30')?_0x497389:util[_0x0bc4('0x31')](_0x0bc4('0x32'),_0x47cf14),'Phone':_0x47cf14};if(_0x20187d[_0x0bc4('0x33')]){if(_0x20187d[_0x0bc4('0x33')]===_0x0bc4('0x2c')){logger[_0x0bc4('0x1f')](_0x0bc4('0x34'),_0x47cf14,_0x20187d[_0x0bc4('0x33')]);}else if(_0x20187d['moduleCreate']===_0x0bc4('0x2d')&&_0x20187d[_0x0bc4('0x14')]===_0x0bc4('0xe')){logger[_0x0bc4('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x47cf14,_0x20187d[_0x0bc4('0x33')]);_0x254de6[_0x0bc4('0x35')]=_0x0bc4('0x36');}else{return null;}}return _0x1f5efa['sobject'](_[_0x0bc4('0x37')](_0x20187d[_0x0bc4('0x33')]))[_0x0bc4('0x16')](_0x254de6);}});}function getCustomFields(_0x458fc6,_0x2a6a05){var _0x1f69de={};if(_0x458fc6[_0x0bc4('0x1d')]>0x0){_[_0x0bc4('0x38')](_0x458fc6,function(_0x16bdb6){if(_0x16bdb6['type']===_0x0bc4('0x39')&&_0x16bdb6[_0x0bc4('0x3a')]){_0x1f69de[_0x16bdb6[_0x0bc4('0x3a')]]=_0x16bdb6[_0x0bc4('0x3b')][_0x0bc4('0x3c')]();}else if(_0x16bdb6[_0x0bc4('0x3d')]==='variable'&&_0x16bdb6[_0x0bc4('0x3e')]&&_0x16bdb6[_0x0bc4('0x3a')]){_0x2a6a05[_0x16bdb6['variableName']]&&(_0x1f69de[_0x16bdb6[_0x0bc4('0x3a')]]=_0x2a6a05[_0x16bdb6[_0x0bc4('0x3e')]][_0x0bc4('0x3c')]());}else if(_0x16bdb6[_0x0bc4('0x3d')]===_0x0bc4('0x3f')&&_0x16bdb6[_0x0bc4('0x40')]&&_0x16bdb6[_0x0bc4('0x40')][_0x0bc4('0x41')]&&_0x16bdb6[_0x0bc4('0x3a')]){_0x2a6a05[_0x16bdb6[_0x0bc4('0x40')][_0x0bc4('0x41')][_0x0bc4('0x42')]()]&&(_0x1f69de[_0x16bdb6[_0x0bc4('0x3a')]]=_0x2a6a05[_0x16bdb6['Variable'][_0x0bc4('0x41')][_0x0bc4('0x42')]()][_0x0bc4('0x3c')]());}});}return _0x1f69de;}function getConnection(_0x65aed1){var _0x41c8ea=_0x65aed1[_0x0bc4('0x43')]['concat'](_0x65aed1[_0x0bc4('0x44')]);var _0xd9b7a0=new jsforce[(_0x0bc4('0x45'))]({'oauth2':{'loginUrl':_0x65aed1['remoteUri']||_0x0bc4('0x46'),'clientId':_0x65aed1['clientId'],'clientSecret':_0x65aed1[_0x0bc4('0x47')]}});return _0xd9b7a0[_0x0bc4('0x48')](_0x65aed1['username'],_0x41c8ea)[_0x0bc4('0x1c')](function(){logger[_0x0bc4('0x1f')](_0x0bc4('0x49'));return _0xd9b7a0;});}exports[_0x0bc4('0x4a')]=function(_0xbf54f1,_0x365276,_0x57bf1e,_0x3141e6,_0x5f1b34,_0x2b9723){var _0xe178bf,_0x2fb631,_0x236582,_0x5689fd;_0x2b9723[_0x0bc4('0x4b')]=intUtil[_0x0bc4('0x4c')](_0x2b9723[_0x0bc4('0x4b')]);_0x2b9723[_0x0bc4('0x4d')]=intUtil['stripTrailingSlash'](_0x2b9723[_0x0bc4('0x4d')]);if(_0x5f1b34&&_0x5f1b34['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x365276[_0x0bc4('0x4e')]=util[_0x0bc4('0x31')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b9723[_0x0bc4('0x4b')],_0x365276[_0x0bc4('0x4f')],md5(_0x365276[_0x0bc4('0x4f')]));}else{_0x365276[_0x0bc4('0x4e')]='';}return getConnection(_0x2b9723)[_0x0bc4('0x1c')](function(_0xcf81e3){_0x5689fd=_0xcf81e3;return getUser(_0x2b9723,_0x3141e6[_0x0bc4('0x50')],_0x5689fd);})[_0x0bc4('0x1c')](function(_0x2a6e62){_0xe178bf=_0x2a6e62;return getEndUser(_0x2b9723,_0x57bf1e,_0x365276[_0x0bc4('0x51')],_0x365276[_0x0bc4('0x52')],_0x5689fd);})[_0x0bc4('0x1c')](function(_0x2eb6c9){_0x2fb631=_0x2eb6c9;return getTicket(_0x2b9723,_0xe178bf,_0x2fb631,_0x57bf1e,_0x365276,_0x57bf1e[_0x0bc4('0x53')],_0x5689fd,_0x0bc4('0x4a'));})[_0x0bc4('0x1c')](function(_0x27b7a5){_0x236582=_0x27b7a5;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x236582['id']);logger[_0x0bc4('0x1f')](_0x0bc4('0x54'),_0x236582['id'],_0x3141e6['name'],_0x2b9723[_0x0bc4('0x3d')]);switch(_0x2b9723[_0x0bc4('0x3d')]){case _0x0bc4('0x55'):emit(util[_0x0bc4('0x31')]('user:%s',_0x3141e6[_0x0bc4('0x41')]),_0x0bc4('0x56'),{'recordId':_0x236582['id']});break;case'newTab':emit(util[_0x0bc4('0x31')]('user:%s',_0x3141e6[_0x0bc4('0x41')]),_0x0bc4('0x57'),{'uri':util[_0x0bc4('0x31')]('%s/%s/e',_0x5689fd[_0x0bc4('0x58')],_0x236582['id'])});break;default:logger[_0x0bc4('0x59')](_0x0bc4('0x5a'));}})[_0x0bc4('0x5b')](function(_0x2dfddb){logger['error'](_0x0bc4('0x5c'),JSON[_0x0bc4('0x5d')](_0x2dfddb));});};exports['outbound']=function(_0x117b3c,_0x5f3a96,_0x23e884,_0xe0b901,_0x27edd1,_0x2e5947,_0x4856b5){var _0x1f45b4,_0x1cd726,_0xdab1d0,_0x383bef;_0x2e5947[_0x0bc4('0x4b')]=intUtil[_0x0bc4('0x4c')](_0x2e5947[_0x0bc4('0x4b')]);_0x2e5947[_0x0bc4('0x4d')]=intUtil['stripTrailingSlash'](_0x2e5947[_0x0bc4('0x4d')]);if(_0x4856b5&&_0x4856b5[_0x0bc4('0x5e')]&&_0x4856b5[_0x0bc4('0x5e')]!==_0x0bc4('0x5f')){logger[_0x0bc4('0x1f')]('[OUTBOUND]',_0x0bc4('0x60'));_0x5f3a96['recordingURL']=util[_0x0bc4('0x31')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e5947[_0x0bc4('0x4b')],_0x5f3a96[_0x0bc4('0x4f')],md5(_0x5f3a96[_0x0bc4('0x4f')]));}return getConnection(_0x2e5947)['then'](function(_0x1985c0){_0x383bef=_0x1985c0;return getUser(_0x2e5947,_0xe0b901['email'],_0x383bef);})[_0x0bc4('0x1c')](function(_0x354454){_0x1f45b4=_0x354454;return getEndUser(_0x2e5947,_0x23e884,_0x5f3a96['destcalleridname'],_0x5f3a96[_0x0bc4('0x61')],_0x383bef);})['then'](function(_0x2dd720){_0x1cd726=_0x2dd720;return getTicket(_0x2e5947,_0x1f45b4,_0x1cd726,_0x23e884,_0x5f3a96,_0x23e884[_0x0bc4('0x53')],_0x383bef,'outbound');})[_0x0bc4('0x1c')](function(_0xc53a12){_0xdab1d0=_0xc53a12;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xdab1d0['id']);logger[_0x0bc4('0x1f')](_0x0bc4('0x62'),_0xdab1d0['id'],_0xe0b901[_0x0bc4('0x41')],_0x2e5947['type']);switch(_0x2e5947['type']){case'integrationTab':emit(util[_0x0bc4('0x31')](_0x0bc4('0x63'),_0xe0b901[_0x0bc4('0x41')]),'trigger:salesforce:display',{'recordId':_0xdab1d0['id']});break;case'newTab':emit(util[_0x0bc4('0x31')]('user:%s',_0xe0b901[_0x0bc4('0x41')]),_0x0bc4('0x57'),{'uri':util[_0x0bc4('0x31')](_0x0bc4('0x64'),_0x383bef[_0x0bc4('0x58')],_0xdab1d0['id'])});break;default:logger[_0x0bc4('0x59')](_0x0bc4('0x65'),_0x0bc4('0x66'));}})[_0x0bc4('0x5b')](function(_0xe2863f){logger[_0x0bc4('0x59')](_0x0bc4('0x65'),JSON[_0x0bc4('0x5d')](_0xe2863f));});};exports[_0x0bc4('0x67')]=function(_0x59870b,_0x92cf09,_0xed2078,_0x41f08a,_0x441393,_0x4be1ea){var _0x2cd882,_0x2124e4,_0x443ca9,_0x1851dd;_0x4be1ea[_0x0bc4('0x4b')]=intUtil[_0x0bc4('0x4c')](_0x4be1ea['serverUrl']);_0x4be1ea[_0x0bc4('0x4d')]=intUtil[_0x0bc4('0x4c')](_0x4be1ea[_0x0bc4('0x4d')]);if(_0x441393&&_0x441393['monitor_format']){logger[_0x0bc4('0x1f')]('['+_0x92cf09['lastevent'][_0x0bc4('0x68')]()+']','Recording\x20is\x20enabled!');_0x92cf09[_0x0bc4('0x4e')]=util[_0x0bc4('0x31')](_0x0bc4('0x69'),_0x4be1ea['serverUrl'],_0x92cf09['uniqueid'],md5(_0x92cf09['uniqueid']));}else{_0x92cf09[_0x0bc4('0x4e')]='';}return getConnection(_0x4be1ea)[_0x0bc4('0x1c')](function(_0x32336d){_0x1851dd=_0x32336d;if(!_[_0x0bc4('0x17')](_0x41f08a)){return getUser(_0x4be1ea,_0x41f08a[_0x0bc4('0x41')],_0x1851dd);}else{return getUser(_0x4be1ea,null,_0x1851dd);}})[_0x0bc4('0x1c')](function(_0x16b1b2){_0x2cd882=_0x16b1b2;return getEndUser(_0x4be1ea,_0xed2078,_0x92cf09[_0x0bc4('0x51')],_0x92cf09['calleridnum'],_0x1851dd);})[_0x0bc4('0x1c')](function(_0x3b6c87){_0x2124e4=_0x3b6c87;return getTicket(_0x4be1ea,_0x2cd882,_0x2124e4,_0xed2078,_0x92cf09,_0xed2078[_0x0bc4('0x53')],_0x1851dd);})['then'](function(_0x321313){_0x443ca9=_0x321313;logger[_0x0bc4('0x1f')]('['+_0x92cf09[_0x0bc4('0x6a')][_0x0bc4('0x68')]()+_0x0bc4('0x6b'),_0x443ca9['id']);logger[_0x0bc4('0x1f')]('['+_0x92cf09[_0x0bc4('0x6a')][_0x0bc4('0x68')]()+_0x0bc4('0x6c'),_0x4be1ea[_0x0bc4('0x3d')]);})[_0x0bc4('0x5b')](function(_0x17f98d){logger[_0x0bc4('0x59')]('['+_0x92cf09[_0x0bc4('0x6a')]['toUpperCase']()+']',JSON['stringify'](_0x17f98d));});}; \ 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 5836329..5ad8b7c 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 _0x5fc3=['],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','nameField','customField','idField','content','toString','string','toLowerCase','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%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','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','socket.io-emitter','GET','then','length','adminId','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','userEmail','],\x20getUser\x20entity','result','active','true','sys_id','userId','message','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System'];(function(_0x14eb03,_0x8d5034){var _0x21ce5d=function(_0x34beaa){while(--_0x34beaa){_0x14eb03['push'](_0x14eb03['shift']());}};_0x21ce5d(++_0x8d5034);}(_0x5fc3,0xa8));var _0x35fc=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x5fc3[_0x47c5bf];return _0x11b779;};'use strict';var _=require(_0x35fc('0x0'));var Promise=require(_0x35fc('0x1'));var rp=require('request-promise');var util=require(_0x35fc('0x2'));var md5=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var intUtil=require(_0x35fc('0x5'));var config=require(_0x35fc('0x6'));var logger=require('../../../../config/logger')(_0x35fc('0x7'));config[_0x35fc('0x8')]=_[_0x35fc('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0xa'))(new Redis(config['redis']));function getAdminUser(_0x16e153,_0x27524f,_0xc72d93,_0x1e5f90,_0x34ff19,_0xf9d3a6){return new Promise(function(_0x2051ab,_0x565f95){var _0x1083a9={'method':_0x35fc('0xb'),'uri':_0x1e5f90+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x34ff19+'&'+_0xf9d3a6,'auth':_0x27524f,'json':!![]};return rp(_0x1083a9)[_0x35fc('0xc')](function(_0x33f491){if(_0x33f491['result'][_0x35fc('0xd')]>0x0){_0xc72d93[_0x35fc('0xe')]=_0x33f491['result'][0x0]['sys_id'];}logger[_0x35fc('0xf')]('['+[_0x16e153['toUpperCase']()]+_0x35fc('0x10'),_0xc72d93);_0x2051ab(_0xc72d93);})[_0x35fc('0x11')](function(_0x2a6ad2){logger[_0x35fc('0x12')]('['+[_0x16e153[_0x35fc('0x13')]()]+']',_0x2a6ad2['message']);_0x565f95(_0x2a6ad2['message']);});});}function getUser(_0x5eac0f,_0x558364,_0x398b67,_0x229d56,_0x53b898){return function(_0x154958){logger[_0x35fc('0xf')]('['+[_0x5eac0f[_0x35fc('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x154958);return new Promise(function(_0x26ba54,_0x45c8b7){if(intUtil['validateEmail'](_0x154958[_0x35fc('0x14')])){var _0x363e47={'method':_0x35fc('0xb'),'uri':_0x398b67+'sys_user?sysparm_query=email%3D'+_0x154958[_0x35fc('0x14')]+'&'+_0x229d56+'&'+_0x53b898,'auth':_0x558364,'json':!![]};logger[_0x35fc('0xf')]('['+[_0x5eac0f[_0x35fc('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x363e47);return rp(_0x363e47)[_0x35fc('0xc')](function(_0x350a27){logger[_0x35fc('0xf')]('['+[_0x5eac0f[_0x35fc('0x13')]()]+_0x35fc('0x15'),_0x350a27);if(_0x350a27[_0x35fc('0x16')][_0x35fc('0xd')]>0x0&&String(_0x350a27[_0x35fc('0x16')][0x0][_0x35fc('0x17')])===_0x35fc('0x18')){_0x154958['userId']=_0x350a27[_0x35fc('0x16')][0x0][_0x35fc('0x19')];}else{_0x154958[_0x35fc('0x1a')]=_0x154958[_0x35fc('0xe')];_0x154958[_0x35fc('0x14')]=_0x154958['adminEmail'];}logger[_0x35fc('0xf')]('['+[_0x5eac0f[_0x35fc('0x13')]()]+'],\x20getUser\x20crm',_0x154958);_0x26ba54(_0x154958);})[_0x35fc('0x11')](function(_0x5a93df){logger[_0x35fc('0x12')]('['+[_0x5eac0f['toUpperCase']()]+']',_0x5a93df[_0x35fc('0x1b')]);_0x45c8b7(_0x5a93df['message']);});}else{logger[_0x35fc('0xf')]('['+[_0x5eac0f[_0x35fc('0x13')]()]+']\x20using\x20admin\x20profile');_0x154958['userId']=_0x154958[_0x35fc('0xe')];_0x154958['userEmail']=_0x154958[_0x35fc('0x1c')];_0x26ba54(_0x154958);}});};}function createEndUser(_0x1a5d92,_0x57001c,_0x26b7cb,_0x645eac,_0x383837){logger[_0x35fc('0xf')]('['+[_0x1a5d92[_0x35fc('0x13')]()]+_0x35fc('0x1d'),_0x26b7cb);return new Promise(function(_0x11ccdb,_0x451f0c){var _0x54aedc={'method':_0x35fc('0x1e'),'uri':_0x645eac+_0x35fc('0x1f')+_0x383837,'body':{'user_name':_0x26b7cb[_0x35fc('0x20')],'roles':'user','first_name':_0x26b7cb[_0x35fc('0x20')],'active':_0x35fc('0x18'),'date_format':_0x35fc('0x21'),'phone':_0x26b7cb[_0x35fc('0x20')]},'auth':_0x57001c,'json':!![]};return rp(_0x54aedc)[_0x35fc('0xc')](function(_0x103181){logger[_0x35fc('0xf')]('['+[_0x1a5d92[_0x35fc('0x13')]()]+_0x35fc('0x22'),_0x103181[_0x35fc('0x16')]);_0x26b7cb['endUserId']=_0x103181['result'][_0x35fc('0x19')];_0x11ccdb(_0x26b7cb);})['catch'](function(_0x37b394){logger[_0x35fc('0x12')]('['+[_0x1a5d92[_0x35fc('0x13')]()]+']',_0x37b394[_0x35fc('0x1b')]);_0x451f0c(_0x37b394[_0x35fc('0x1b')]);});});}function getEndUser(_0x12e78f,_0x4e43b4,_0x3fe193,_0x330a14,_0x46b9ef){return function(_0x4441d8){logger[_0x35fc('0xf')]('['+[_0x12e78f[_0x35fc('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x4441d8);return new Promise(function(_0x2483be,_0x38193d){var _0x1fecdf={'method':'GET','uri':_0x3fe193+_0x35fc('0x23')+_0x4441d8['endUserNumber']+'&'+_0x330a14+'&'+_0x46b9ef,'auth':_0x4e43b4,'json':!![]};return rp(_0x1fecdf)[_0x35fc('0xc')](function(_0x33a377){if(_0x33a377[_0x35fc('0x16')][_0x35fc('0xd')]>0x0){_0x4441d8['endUserId']=_0x33a377['result'][0x0]['sys_id'];logger[_0x35fc('0xf')]('['+[_0x12e78f['toUpperCase']()]+_0x35fc('0x24'),_0x4441d8);_0x2483be(_0x4441d8);}else{return createEndUser(_0x12e78f,_0x4e43b4,_0x4441d8,_0x3fe193,_0x330a14)['then'](function(_0x9c6b65){logger[_0x35fc('0xf')]('['+[_0x12e78f[_0x35fc('0x13')]()]+_0x35fc('0x25'),_0x9c6b65);_0x2483be(_0x9c6b65);});}})[_0x35fc('0x11')](function(_0x3313fa){logger[_0x35fc('0x12')]('['+[_0x12e78f['toUpperCase']()]+']',_0x3313fa[_0x35fc('0x1b')]);_0x38193d(_0x3313fa[_0x35fc('0x1b')]);});});};}function getCustomFields(_0x4e0ce3,_0x1feda5){var _0x1ccc41={};if(_0x4e0ce3[_0x35fc('0xd')]>0x0){_[_0x35fc('0x26')](_0x4e0ce3,function(_0x813866){if(_0x813866[_0x35fc('0x27')]==='string'&&_0x813866[_0x35fc('0x28')]&&!_0x813866[_0x35fc('0x29')]){_0x1ccc41[_0x813866[_0x35fc('0x2a')]['toLowerCase']()]=_0x813866[_0x35fc('0x2b')][_0x35fc('0x2c')]();}else if(_0x813866['type']===_0x35fc('0x2d')&&_0x813866[_0x35fc('0x2a')]&&_0x813866[_0x35fc('0x29')]){_0x1ccc41[_0x813866[_0x35fc('0x2a')][_0x35fc('0x2e')]()]=_0x813866[_0x35fc('0x2b')][_0x35fc('0x2c')]();}else if(_0x813866[_0x35fc('0x27')]==='variable'&&_0x813866['variableName']&&_0x813866[_0x35fc('0x2a')]&&_0x813866[_0x35fc('0x29')]){_0x1ccc41[_0x813866['idField']['toLowerCase']()]=_0x1feda5[_0x813866['variableName']][_0x35fc('0x2c')]();}else if(_0x813866[_0x35fc('0x27')]==='customVariable'&&_0x813866[_0x35fc('0x2f')]&&_0x813866[_0x35fc('0x2f')][_0x35fc('0x30')]&&_0x813866[_0x35fc('0x2a')]&&_0x813866['customField']){_0x1ccc41[_0x813866['idField']['toLowerCase']()]=_0x1feda5[_0x813866['Variable']['name'][_0x35fc('0x2e')]()][_0x35fc('0x2c')]();}});}return _0x1ccc41;}function getTicket(_0x4fc5bc,_0x119925,_0x56cf1f,_0x13d16c,_0x40797d,_0x350237){return function(_0x2de5d1){logger[_0x35fc('0xf')]('['+[_0x4fc5bc['toUpperCase']()]+_0x35fc('0x31'),_0x2de5d1);return new Promise(function(_0x2c25d5,_0x4fd3d8){var _0x18181b=_0x4fc5bc[_0x35fc('0x2e')]()===_0x35fc('0x32')?_0x2de5d1[_0x35fc('0x1a')]:_0x2de5d1['endUserId'];var _0x3666a5={'method':'POST','uri':_0x56cf1f+'incident'+'?'+_0x350237,'body':Object[_0x35fc('0x33')]({},{'active':_0x35fc('0x18'),'caller_id':_0x18181b,'assigned_to':_0x2de5d1[_0x35fc('0x1a')],'short_description':intUtil[_0x35fc('0x34')](_0x13d16c[_0x35fc('0x35')],_0x40797d,'\x20'),'description':intUtil[_0x35fc('0x34')](_0x13d16c[_0x35fc('0x36')],_0x40797d,'\x0a')},getCustomFields(_0x13d16c[_0x35fc('0x37')],_0x40797d)),'auth':_0x119925,'json':!![]};return rp(_0x3666a5)['then'](function(_0x3e2961){logger[_0x35fc('0xf')]('['+[_0x4fc5bc[_0x35fc('0x13')]()]+_0x35fc('0x38'),_0x3e2961[_0x35fc('0x16')]);_0x2de5d1[_0x35fc('0x39')]=_0x3e2961[_0x35fc('0x16')][_0x35fc('0x19')];_0x2de5d1[_0x35fc('0x3a')]=_0x3e2961[_0x35fc('0x16')][_0x35fc('0x3b')];logger[_0x35fc('0xf')]('['+[_0x4fc5bc[_0x35fc('0x13')]()]+_0x35fc('0x3c'),_0x2de5d1);_0x2c25d5(_0x2de5d1);})['catch'](function(_0x553ed6){logger[_0x35fc('0x12')]('['+[_0x4fc5bc[_0x35fc('0x13')]()]+']',_0x553ed6[_0x35fc('0x1b')]);_0x4fd3d8(_0x553ed6[_0x35fc('0x1b')]);});});};}function createRemoteTag(_0x3ee296,_0x3e6494,_0x4a4798,_0x4f024c){return new Promise(function(_0x388521,_0x19b2ce){var _0x395d63={'method':_0x35fc('0x1e'),'uri':_0x4a4798+'label'+'?'+_0x4f024c,'body':{'short_description':_0x3ee296,'global':!![],'active':!![],'name':_0x3ee296},'auth':_0x3e6494,'json':!![]};return rp(_0x395d63)[_0x35fc('0xc')](function(_0x13281f){var _0x4965d2=_0x13281f[_0x35fc('0x16')][_0x35fc('0x19')];_0x388521(_0x4965d2);});});}function getRemoteTag(_0x590faa,_0x3e12e4,_0x1ab472,_0x26118e,_0x18f18b){return new Promise(function(_0x5e4018,_0x4de34b){var _0x502a15={'method':_0x35fc('0xb'),'uri':_0x1ab472+_0x35fc('0x3d')+'?sysparm_query=name%3D'+_0x590faa+'&'+_0x26118e,'auth':_0x3e12e4,'json':!![]};return rp(_0x502a15)[_0x35fc('0xc')](function(_0x1f89b3){if(_0x1f89b3[_0x35fc('0x16')][_0x35fc('0xd')]>0x0){var _0x46c59b=_0x1f89b3['result'][0x0][_0x35fc('0x19')];_0x5e4018(_0x46c59b);}else{return createRemoteTag(_0x590faa,_0x3e12e4,_0x1ab472,_0x26118e)[_0x35fc('0xc')](function(_0x39d470){_0x5e4018(_0x39d470);});}});});}function assignTagToIncident(_0x509e77,_0x304dba,_0x1dbf5a,_0x47fb1a,_0x35a676){return new Promise(function(_0x164c7b,_0x1c46b1){var _0x1c4c33={'method':_0x35fc('0x1e'),'uri':_0x1dbf5a+_0x35fc('0x3e')+'?'+_0x35a676,'body':{'label':_0x509e77,'table':_0x35fc('0x3f'),'id_type':_0x35fc('0x40'),'table_key':_0x47fb1a['ticketId'],'title':_0x35fc('0x41')+_0x47fb1a[_0x35fc('0x3a')],'id_display':_0x47fb1a[_0x35fc('0x3a')]},'auth':_0x304dba,'json':!![]};return rp(_0x1c4c33)['then'](function(_0x243871){_0x164c7b();})['catch'](function(){_0x164c7b();});});}function manageTags(_0x4ceacc,_0x5d4a39,_0x23b54f,_0xb1c68a,_0x39a1ee,_0x13901c,_0x3d06b8){return new Promise(function(_0x4bbea0,_0x579f5a){var _0x5353ea=[];_0x5d4a39['forEach'](function(_0x51d231){_0x5353ea[_0x35fc('0x42')](getRemoteTag(_0x51d231,_0x23b54f,_0xb1c68a,_0x13901c,_0x3d06b8));});return Promise[_0x35fc('0x43')](_0x5353ea)[_0x35fc('0xc')](function(_0x3ef680){if(_0x3ef680['length']){logger[_0x35fc('0xf')]('['+[_0x4ceacc[_0x35fc('0x13')]()]+_0x35fc('0x44'),_0x3ef680);var _0x1b0063=[];_0x3ef680[_0x35fc('0x26')](function(_0x1d0e53){_0x1b0063[_0x35fc('0x42')](assignTagToIncident(_0x1d0e53,_0x23b54f,_0xb1c68a,_0x39a1ee,_0x13901c));});return Promise[_0x35fc('0x43')](_0x1b0063)[_0x35fc('0xc')](function(){_0x4bbea0();})['catch'](function(){_0x4bbea0();});}else{_0x4bbea0();}});});}function getTags(_0x35d7c8,_0x47c75f,_0xfbd737,_0x9029e3,_0x2ac8e1,_0x2bc76c){return function(_0x4bdde7){return new Promise(function(_0x465c14,_0x4af592){var _0x4e2835=[];var _0x5f1d4a=_0x9029e3[_0x35fc('0x45')];if(_0x5f1d4a&&_0x5f1d4a['length']>0x0){_0x4e2835=_[_0x35fc('0x46')](_0x5f1d4a,'name');}if(_0x4e2835[_0x35fc('0xd')]>0x0){return manageTags(_0x35d7c8,_0x4e2835,_0x47c75f,_0xfbd737,_0x4bdde7,_0x2ac8e1,_0x2bc76c)['then'](function(){_0x465c14(_0x4bdde7);});}else{_0x465c14(_0x4bdde7);}});};}function emit(_0x42a53a,_0x455b84,_0x3400f0){var _0x1d81a5='%26sysparm_record_target%3Dincident'+_0x35fc('0x47')+_0x35fc('0x48')+_0x35fc('0x49');var _0x5df92d={'uri':_0x42a53a+_0x35fc('0x4a')+_0x3400f0+_0x1d81a5};io['to'](util[_0x35fc('0x4b')](_0x35fc('0x4c'),_0x455b84))[_0x35fc('0x4d')](_0x35fc('0x4e'),_0x5df92d);}exports['cs']=function(_0x2c4309,_0x2ee98b,_0x4464d5,_0x5159a0,_0x28a44b,_0x2008b3,_0x2600d2,_0x4a926d){var _0x1c88d8={};var _0x1b76f0={'user':_0x2008b3['username'],'pass':_0x2008b3['password']};var _0x3969d3='sysparm_limit=1';var _0x223ad3=_0x35fc('0x4f');_0x2008b3[_0x35fc('0x50')]=intUtil[_0x35fc('0x51')](_0x2008b3[_0x35fc('0x50')]);_0x2008b3[_0x35fc('0x52')]=intUtil[_0x35fc('0x51')](_0x2008b3[_0x35fc('0x52')]);var _0x10b725=util[_0x35fc('0x4b')](_0x35fc('0x53'),_0x2008b3[_0x35fc('0x50')]);_0x1c88d8[_0x35fc('0x14')]=!_[_0x35fc('0x54')](_0x5159a0)?_0x5159a0[_0x35fc('0x55')]:null;_0x1c88d8[_0x35fc('0x1c')]=_0x2008b3[_0x35fc('0x55')];_0x1c88d8[_0x35fc('0x20')]=_0x4a926d[_0x35fc('0x2e')]()===_0x35fc('0x32')?_0x2ee98b['destcalleridnum']:_0x2ee98b[_0x35fc('0x56')];_0x1c88d8['callDirection']=_0x4a926d===_0x35fc('0x57')||_0x4a926d===_0x35fc('0x58')?_0x35fc('0x57'):_0x35fc('0x32');var _0x25af78=util[_0x35fc('0x4b')](_0x35fc('0x59'),_0x2008b3[_0x35fc('0x52')],_0x2ee98b[_0x35fc('0x5a')],md5(_0x2ee98b[_0x35fc('0x5a')]));if(_0x28a44b&&_0x28a44b[_0x35fc('0x5b')]){logger['info'](_0x35fc('0x5c'),_0x35fc('0x5d'));_0x2ee98b[_0x35fc('0x5e')]=_0x25af78;}else if(_0x2600d2&&_0x2600d2[_0x35fc('0x5f')]&&_0x2600d2[_0x35fc('0x5f')]!==_0x35fc('0x60')){logger['info'](_0x35fc('0x61'),_0x35fc('0x5d'));_0x2ee98b[_0x35fc('0x5e')]=_0x25af78;}else{_0x2ee98b[_0x35fc('0x5e')]='';}return getAdminUser(_0x4a926d,_0x1b76f0,_0x1c88d8,_0x10b725,_0x223ad3,_0x3969d3)[_0x35fc('0xc')](getUser(_0x4a926d,_0x1b76f0,_0x10b725,_0x223ad3,_0x3969d3))[_0x35fc('0xc')](getEndUser(_0x4a926d,_0x1b76f0,_0x10b725,_0x223ad3,_0x3969d3))[_0x35fc('0xc')](getTicket(_0x4a926d,_0x1b76f0,_0x10b725,_0x4464d5,_0x2ee98b,_0x223ad3))[_0x35fc('0xc')](function(_0xa92234){logger['info'](util[_0x35fc('0x4b')]('The\x20ticket\x20ID\x20is:\x20%s',_0xa92234[_0x35fc('0x39')]));logger[_0x35fc('0xf')](util['format'](_0x35fc('0x62'),_0x4a926d));if(_0x4a926d!==_0x35fc('0x58')){logger[_0x35fc('0xf')]('['+[_0x4a926d[_0x35fc('0x13')]()]+']',_0x35fc('0x63'));emit(_0x2008b3[_0x35fc('0x50')],_0x5159a0[_0x35fc('0x30')],_0xa92234[_0x35fc('0x39')]);}})[_0x35fc('0x11')](function(_0x5806bf){logger['error']('['+[_0x4a926d['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x35fc('0x64')](_0x5806bf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xadb5=['endUserNumber','user','System','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','incident','Incident','Incident\x20-\x20','forEach','push','length','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','userEmail','GET','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xadb5,0xad));var _0x5adb=function(_0x32e611,_0x509ce6){_0x32e611=_0x32e611-0x0;var _0x542aec=_0xadb5[_0x32e611];return _0x542aec;};'use strict';var _=require('lodash');var Promise=require(_0x5adb('0x0'));var rp=require('request-promise');var util=require(_0x5adb('0x1'));var md5=require(_0x5adb('0x2'));var Redis=require(_0x5adb('0x3'));var intUtil=require('./util');var config=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var io=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));function getAdminUser(_0x353885,_0x47228a,_0x6d1b45,_0x41261c,_0x7293ab,_0x34f59d){return new Promise(function(_0x336bad,_0x129f5a){var _0x275428={'method':'GET','uri':_0x41261c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x7293ab+'&'+_0x34f59d,'auth':_0x47228a,'json':!![]};return rp(_0x275428)[_0x5adb('0xb')](function(_0x1ea238){if(_0x1ea238[_0x5adb('0xc')]['length']>0x0){_0x6d1b45[_0x5adb('0xd')]=_0x1ea238['result'][0x0][_0x5adb('0xe')];}logger['info']('['+[_0x353885[_0x5adb('0xf')]()]+_0x5adb('0x10'),_0x6d1b45);_0x336bad(_0x6d1b45);})[_0x5adb('0x11')](function(_0x5c929a){logger[_0x5adb('0x12')]('['+[_0x353885[_0x5adb('0xf')]()]+']',_0x5c929a[_0x5adb('0x13')]);_0x129f5a(_0x5c929a['message']);});});}function getUser(_0x2312de,_0x518823,_0x367d82,_0x42a482,_0x30614e){return function(_0x304784){logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+_0x5adb('0x15'),_0x304784);return new Promise(function(_0x42f4c6,_0xb953a6){if(intUtil['validateEmail'](_0x304784[_0x5adb('0x16')])){var _0x5de028={'method':_0x5adb('0x17'),'uri':_0x367d82+'sys_user?sysparm_query=email%3D'+_0x304784[_0x5adb('0x16')]+'&'+_0x42a482+'&'+_0x30614e,'auth':_0x518823,'json':!![]};logger['info']('['+[_0x2312de['toUpperCase']()]+_0x5adb('0x18'),_0x5de028);return rp(_0x5de028)[_0x5adb('0xb')](function(_0x438671){logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+'],\x20getUser\x20entity',_0x438671);if(_0x438671[_0x5adb('0xc')]['length']>0x0&&String(_0x438671['result'][0x0][_0x5adb('0x19')])===_0x5adb('0x1a')){_0x304784[_0x5adb('0x1b')]=_0x438671[_0x5adb('0xc')][0x0][_0x5adb('0xe')];}else{_0x304784[_0x5adb('0x1b')]=_0x304784[_0x5adb('0xd')];_0x304784['userEmail']=_0x304784[_0x5adb('0x1c')];}logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+_0x5adb('0x1d'),_0x304784);_0x42f4c6(_0x304784);})[_0x5adb('0x11')](function(_0x49f203){logger[_0x5adb('0x12')]('['+[_0x2312de[_0x5adb('0xf')]()]+']',_0x49f203['message']);_0xb953a6(_0x49f203[_0x5adb('0x13')]);});}else{logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+']\x20using\x20admin\x20profile');_0x304784[_0x5adb('0x1b')]=_0x304784[_0x5adb('0xd')];_0x304784[_0x5adb('0x16')]=_0x304784[_0x5adb('0x1c')];_0x42f4c6(_0x304784);}});};}function createEndUser(_0x36459b,_0x1c06c4,_0x4a5d46,_0x49992e,_0x5d457e){logger[_0x5adb('0x14')]('['+[_0x36459b[_0x5adb('0xf')]()]+_0x5adb('0x1e'),_0x4a5d46);return new Promise(function(_0x512bab,_0x137a5c){var _0x4de310={'method':_0x5adb('0x1f'),'uri':_0x49992e+_0x5adb('0x20')+_0x5d457e,'body':{'user_name':_0x4a5d46[_0x5adb('0x21')],'roles':_0x5adb('0x22'),'first_name':_0x4a5d46[_0x5adb('0x21')],'active':_0x5adb('0x1a'),'date_format':_0x5adb('0x23'),'phone':_0x4a5d46[_0x5adb('0x21')]},'auth':_0x1c06c4,'json':!![]};return rp(_0x4de310)[_0x5adb('0xb')](function(_0x260295){logger['info']('['+[_0x36459b[_0x5adb('0xf')]()]+'],\x20EndUser\x20schema',_0x260295[_0x5adb('0xc')]);_0x4a5d46[_0x5adb('0x24')]=_0x260295['result'][_0x5adb('0xe')];_0x512bab(_0x4a5d46);})[_0x5adb('0x11')](function(_0x461a39){logger['error']('['+[_0x36459b[_0x5adb('0xf')]()]+']',_0x461a39[_0x5adb('0x13')]);_0x137a5c(_0x461a39['message']);});});}function getEndUser(_0x5bb227,_0x1ed9ea,_0x49dd03,_0x663ea0,_0x222568){return function(_0x3c2b07){logger[_0x5adb('0x14')]('['+[_0x5bb227[_0x5adb('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x3c2b07);return new Promise(function(_0x2f7abe,_0x215b88){var _0x1c3a5c={'method':'GET','uri':_0x49dd03+'sys_user?sysparm_query=phone%3D'+_0x3c2b07[_0x5adb('0x21')]+'&'+_0x663ea0+'&'+_0x222568,'auth':_0x1ed9ea,'json':!![]};return rp(_0x1c3a5c)[_0x5adb('0xb')](function(_0x586820){if(_0x586820[_0x5adb('0xc')]['length']>0x0){_0x3c2b07[_0x5adb('0x24')]=_0x586820['result'][0x0][_0x5adb('0xe')];logger['info']('['+[_0x5bb227[_0x5adb('0xf')]()]+_0x5adb('0x25'),_0x3c2b07);_0x2f7abe(_0x3c2b07);}else{return createEndUser(_0x5bb227,_0x1ed9ea,_0x3c2b07,_0x49dd03,_0x663ea0)['then'](function(_0x4761e3){logger['info']('['+[_0x5bb227[_0x5adb('0xf')]()]+_0x5adb('0x26'),_0x4761e3);_0x2f7abe(_0x4761e3);});}})[_0x5adb('0x11')](function(_0x50edd1){logger[_0x5adb('0x12')]('['+[_0x5bb227[_0x5adb('0xf')]()]+']',_0x50edd1[_0x5adb('0x13')]);_0x215b88(_0x50edd1[_0x5adb('0x13')]);});});};}function getCustomFields(_0x22aa95,_0x52d74f){var _0x50fe99={};if(_0x22aa95['length']>0x0){_['forEach'](_0x22aa95,function(_0x427c71){if(_0x427c71[_0x5adb('0x27')]===_0x5adb('0x28')&&_0x427c71[_0x5adb('0x29')]&&!_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x427c71[_0x5adb('0x2d')]['toString']();}else if(_0x427c71['type']===_0x5adb('0x28')&&_0x427c71['idField']&&_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x427c71[_0x5adb('0x2d')][_0x5adb('0x2e')]();}else if(_0x427c71['type']===_0x5adb('0x2f')&&_0x427c71[_0x5adb('0x30')]&&_0x427c71['idField']&&_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')]['toLowerCase']()]=_0x52d74f[_0x427c71[_0x5adb('0x30')]][_0x5adb('0x2e')]();}else if(_0x427c71[_0x5adb('0x27')]===_0x5adb('0x31')&&_0x427c71[_0x5adb('0x32')]&&_0x427c71[_0x5adb('0x32')][_0x5adb('0x33')]&&_0x427c71['idField']&&_0x427c71['customField']){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x52d74f[_0x427c71[_0x5adb('0x32')][_0x5adb('0x33')]['toLowerCase']()]['toString']();}});}return _0x50fe99;}function getTicket(_0xaa32e4,_0x4d7d86,_0x264dfd,_0x72218,_0x1713bc,_0x5358c0){return function(_0x182cbc){logger[_0x5adb('0x14')]('['+[_0xaa32e4['toUpperCase']()]+_0x5adb('0x34'),_0x182cbc);return new Promise(function(_0x251f45,_0x1cdb03){var _0x24758f=_0xaa32e4[_0x5adb('0x2c')]()===_0x5adb('0x35')?_0x182cbc[_0x5adb('0x1b')]:_0x182cbc[_0x5adb('0x24')];var _0x49e1a1={'method':_0x5adb('0x1f'),'uri':_0x264dfd+'incident'+'?'+_0x5358c0,'body':Object['assign']({},{'active':'true','caller_id':_0x24758f,'assigned_to':_0x182cbc[_0x5adb('0x1b')],'short_description':intUtil[_0x5adb('0x36')](_0x72218[_0x5adb('0x37')],_0x1713bc,'\x20'),'description':intUtil['getString'](_0x72218[_0x5adb('0x38')],_0x1713bc,'\x0a')},getCustomFields(_0x72218['Fields'],_0x1713bc)),'auth':_0x4d7d86,'json':!![]};return rp(_0x49e1a1)[_0x5adb('0xb')](function(_0x2c3f21){logger[_0x5adb('0x14')]('['+[_0xaa32e4['toUpperCase']()]+_0x5adb('0x39'),_0x2c3f21['result']);_0x182cbc[_0x5adb('0x3a')]=_0x2c3f21[_0x5adb('0xc')]['sys_id'];_0x182cbc[_0x5adb('0x3b')]=_0x2c3f21[_0x5adb('0xc')][_0x5adb('0x3c')];logger[_0x5adb('0x14')]('['+[_0xaa32e4[_0x5adb('0xf')]()]+']\x20getTicket\x20crm',_0x182cbc);_0x251f45(_0x182cbc);})[_0x5adb('0x11')](function(_0x3a5703){logger[_0x5adb('0x12')]('['+[_0xaa32e4[_0x5adb('0xf')]()]+']',_0x3a5703['message']);_0x1cdb03(_0x3a5703[_0x5adb('0x13')]);});});};}function createRemoteTag(_0x14a46f,_0x3b4794,_0x4d98d0,_0x2b34a8){return new Promise(function(_0xd0e5b7,_0x444a6c){var _0xfd3471={'method':'POST','uri':_0x4d98d0+_0x5adb('0x3d')+'?'+_0x2b34a8,'body':{'short_description':_0x14a46f,'global':!![],'active':!![],'name':_0x14a46f},'auth':_0x3b4794,'json':!![]};return rp(_0xfd3471)[_0x5adb('0xb')](function(_0x28b291){var _0x2cee37=_0x28b291[_0x5adb('0xc')]['sys_id'];_0xd0e5b7(_0x2cee37);});});}function getRemoteTag(_0x378938,_0x4b8d28,_0x2b790d,_0x4f7227,_0x31ae72){return new Promise(function(_0x35df22,_0x1a9358){var _0x42f6d9={'method':'GET','uri':_0x2b790d+_0x5adb('0x3d')+_0x5adb('0x3e')+_0x378938+'&'+_0x4f7227,'auth':_0x4b8d28,'json':!![]};return rp(_0x42f6d9)[_0x5adb('0xb')](function(_0x53d262){if(_0x53d262['result']['length']>0x0){var _0x18ee9a=_0x53d262[_0x5adb('0xc')][0x0][_0x5adb('0xe')];_0x35df22(_0x18ee9a);}else{return createRemoteTag(_0x378938,_0x4b8d28,_0x2b790d,_0x4f7227)[_0x5adb('0xb')](function(_0xa833f4){_0x35df22(_0xa833f4);});}});});}function assignTagToIncident(_0xb06bee,_0x204b9b,_0x8d7810,_0xc880af,_0x380d76){return new Promise(function(_0x452767,_0x1df439){var _0x2c2357={'method':'POST','uri':_0x8d7810+'label_entry'+'?'+_0x380d76,'body':{'label':_0xb06bee,'table':_0x5adb('0x3f'),'id_type':_0x5adb('0x40'),'table_key':_0xc880af[_0x5adb('0x3a')],'title':_0x5adb('0x41')+_0xc880af['ticketNumber'],'id_display':_0xc880af[_0x5adb('0x3b')]},'auth':_0x204b9b,'json':!![]};return rp(_0x2c2357)[_0x5adb('0xb')](function(_0x5d2d2f){_0x452767();})[_0x5adb('0x11')](function(){_0x452767();});});}function manageTags(_0x476e62,_0x1505f7,_0x5edd60,_0x30d185,_0x409357,_0x19df2f,_0x30c92c){return new Promise(function(_0x330290,_0x428019){var _0x513f26=[];_0x1505f7[_0x5adb('0x42')](function(_0x1f042f){_0x513f26[_0x5adb('0x43')](getRemoteTag(_0x1f042f,_0x5edd60,_0x30d185,_0x19df2f,_0x30c92c));});return Promise['all'](_0x513f26)[_0x5adb('0xb')](function(_0x239862){if(_0x239862[_0x5adb('0x44')]){logger['info']('['+[_0x476e62[_0x5adb('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x239862);var _0xa8ff64=[];_0x239862[_0x5adb('0x42')](function(_0x24e1ab){_0xa8ff64['push'](assignTagToIncident(_0x24e1ab,_0x5edd60,_0x30d185,_0x409357,_0x19df2f));});return Promise[_0x5adb('0x45')](_0xa8ff64)[_0x5adb('0xb')](function(){_0x330290();})['catch'](function(){_0x330290();});}else{_0x330290();}});});}function getTags(_0x12711e,_0x432a3e,_0x248739,_0x3fcad5,_0x55cd0a,_0x4290bb){return function(_0x2b8298){return new Promise(function(_0x307f07,_0x16716e){var _0x5b7556=[];var _0x53a4bc=_0x3fcad5[_0x5adb('0x46')];if(_0x53a4bc&&_0x53a4bc['length']>0x0){_0x5b7556=_['map'](_0x53a4bc,'name');}if(_0x5b7556[_0x5adb('0x44')]>0x0){return manageTags(_0x12711e,_0x5b7556,_0x432a3e,_0x248739,_0x2b8298,_0x55cd0a,_0x4290bb)[_0x5adb('0xb')](function(){_0x307f07(_0x2b8298);});}else{_0x307f07(_0x2b8298);}});};}function emit(_0x48bb5c,_0x395350,_0x91e023){var _0xcdde17=_0x5adb('0x47')+_0x5adb('0x48')+_0x5adb('0x49')+_0x5adb('0x4a');var _0x1ffcd3={'uri':_0x48bb5c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x91e023+_0xcdde17};io['to'](util['format']('user:%s',_0x395350))[_0x5adb('0x4b')](_0x5adb('0x4c'),_0x1ffcd3);}exports['cs']=function(_0x3a0d1b,_0x2a55a3,_0x1f59bb,_0x2f6ef7,_0x386c76,_0x25f761,_0x58455b,_0x5e55c2){var _0x1fc73b={};var _0x56df90={'user':_0x25f761[_0x5adb('0x4d')],'pass':_0x25f761[_0x5adb('0x4e')]};var _0x2146f0=_0x5adb('0x4f');var _0x40140f=_0x5adb('0x50');_0x25f761[_0x5adb('0x51')]=intUtil[_0x5adb('0x52')](_0x25f761['remoteUri']);_0x25f761[_0x5adb('0x53')]=intUtil[_0x5adb('0x52')](_0x25f761[_0x5adb('0x53')]);var _0x5d3aa4=util[_0x5adb('0x54')](_0x5adb('0x55'),_0x25f761['remoteUri']);_0x1fc73b[_0x5adb('0x16')]=!_['isNil'](_0x2f6ef7)?_0x2f6ef7[_0x5adb('0x56')]:null;_0x1fc73b[_0x5adb('0x1c')]=_0x25f761['email'];_0x1fc73b[_0x5adb('0x21')]=_0x5e55c2[_0x5adb('0x2c')]()===_0x5adb('0x35')?_0x2a55a3[_0x5adb('0x57')]:_0x2a55a3[_0x5adb('0x58')];_0x1fc73b[_0x5adb('0x59')]=_0x5e55c2===_0x5adb('0x5a')||_0x5e55c2===_0x5adb('0x5b')?'queue':_0x5adb('0x35');var _0x31345d=util[_0x5adb('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25f761['serverUrl'],_0x2a55a3[_0x5adb('0x5c')],md5(_0x2a55a3['uniqueid']));if(_0x386c76&&_0x386c76[_0x5adb('0x5d')]){logger[_0x5adb('0x14')](_0x5adb('0x5e'),'Recording\x20is\x20enabled!');_0x2a55a3[_0x5adb('0x5f')]=_0x31345d;}else if(_0x58455b&&_0x58455b[_0x5adb('0x60')]&&_0x58455b[_0x5adb('0x60')]!==_0x5adb('0x61')){logger[_0x5adb('0x14')]('[OUTBOUND]',_0x5adb('0x62'));_0x2a55a3[_0x5adb('0x5f')]=_0x31345d;}else{_0x2a55a3[_0x5adb('0x5f')]='';}return getAdminUser(_0x5e55c2,_0x56df90,_0x1fc73b,_0x5d3aa4,_0x40140f,_0x2146f0)[_0x5adb('0xb')](getUser(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x40140f,_0x2146f0))['then'](getEndUser(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x40140f,_0x2146f0))[_0x5adb('0xb')](getTicket(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x1f59bb,_0x2a55a3,_0x40140f))[_0x5adb('0xb')](function(_0x182873){logger[_0x5adb('0x14')](util[_0x5adb('0x54')](_0x5adb('0x63'),_0x182873[_0x5adb('0x3a')]));logger['info'](util[_0x5adb('0x54')](_0x5adb('0x64'),_0x5e55c2));if(_0x5e55c2!=='unmanaged'){logger[_0x5adb('0x14')]('['+[_0x5e55c2[_0x5adb('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x25f761[_0x5adb('0x51')],_0x2f6ef7['name'],_0x182873[_0x5adb('0x3a')]);}})[_0x5adb('0x11')](function(_0x4a2ebc){logger[_0x5adb('0x12')]('['+[_0x5e55c2['toUpperCase']()]+_0x5adb('0x65'),util[_0x5adb('0x66')](_0x4a2ebc,{'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 02881cd..26bba6c 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 _0x0272=['description','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','push','variableName','set_entry','JSON','Calls','format','apiKey','toString','base64','Getting\x20agent\x20with\x20name','stringify','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','idField','variable','custom_fields','customVariable','Variable','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','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...','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','contacts','version','user:%s','trigger:browser:url','catch','unmanaged','toUpperCase','isNil','calleridnum','Inbound','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by'];(function(_0x58de4a,_0x564dbc){var _0x178820=function(_0x3576ef){while(--_0x3576ef){_0x58de4a['push'](_0x58de4a['shift']());}};_0x178820(++_0x564dbc);}(_0x0272,0x15a));var _0x2027=function(_0x2d8909,_0x18926d){_0x2d8909=_0x2d8909-0x0;var _0x4956f6=_0x0272[_0x2d8909];return _0x4956f6;};'use strict';var _=require(_0x2027('0x0'));var rp=require(_0x2027('0x1'));var BPromise=require('bluebird');var md5=require(_0x2027('0x2'));var util=require(_0x2027('0x3'));var Redis=require(_0x2027('0x4'));var intUtil=require(_0x2027('0x5'));var config=require(_0x2027('0x6'));var logger=require(_0x2027('0x7'))('sugarcrm');config['redis']=_[_0x2027('0x8')](config[_0x2027('0x9')],{'host':_0x2027('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2ac3bd,_0x4eb86c,_0x756027){io['to'](_0x2ac3bd)['emit'](_0x4eb86c,_0x756027);}function getTicket(_0x2f549d,_0x2323d7,_0x16240b,_0x16785,_0x5e74f4,_0x42a771,_0x3e9c64,_0x88a0b7){logger[_0x2027('0xb')](_0x2027('0xc'));var _0x218a75=new Date();var _0x564d24=[{'name':_0x2027('0xd'),'value':intUtil[_0x2027('0xe')](_0x16785['Subjects'],_0x5e74f4,'\x20')},{'name':_0x2027('0xf'),'value':_0x2323d7['id']},{'name':_0x2027('0x10'),'value':_0x2323d7['id']},{'name':_0x2027('0x11'),'value':intUtil[_0x2027('0xe')](_0x16785['Descriptions'],_0x5e74f4,'\x0a')},{'name':_0x2027('0x12'),'value':_0x218a75['toISOString']()[_0x2027('0x13')](0x0,0x13)[_0x2027('0x14')]('T','\x20')},{'name':_0x2027('0x15'),'value':'0'},{'name':_0x2027('0x16'),'value':'15'},{'name':_0x2027('0x17'),'value':_0x16240b['id']},{'name':_0x2027('0x18'),'value':_0x2027('0x19')},{'name':'parent_name','value':_0x16240b[_0x2027('0xd')]},{'name':_0x2027('0x1a'),'value':_0x88a0b7}];if(_0x42a771[_0x2027('0x1b')]){_['forEach'](_0x42a771,function(_0x3bd053){if(_0x5e74f4[_0x3bd053['variableName']]){_0x564d24[_0x2027('0x1c')]({'name':_0x3bd053['idField'],'value':_0x5e74f4[_0x3bd053[_0x2027('0x1d')]]});}});}return request({'form':{'method':_0x2027('0x1e'),'input_type':_0x2027('0x1f'),'response_type':_0x2027('0x1f'),'rest_data':JSON['stringify']({'session':_0x3e9c64['id'],'module_name':_0x2027('0x20'),'name_value_list':_0x564d24})}});}function getAuth(_0x372d0b){return util[_0x2027('0x21')]('Basic\x20%s',new Buffer(_0x372d0b[_0x2027('0x22')]+':X')[_0x2027('0x23')](_0x2027('0x24')));}function getServerInfo(_0x1e049c){return request({'form':{'method':'get_server_info','input_type':_0x2027('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1e049c['id']})}});}function getUser(_0x1a8b7f,_0x277880,_0x462ff){if(!_['isNil'](_0x277880)){logger['info'](_0x2027('0x25'),_0x277880);return request({'form':{'method':'get_entry_list','input_type':_0x2027('0x1f'),'response_type':_0x2027('0x1f'),'rest_data':JSON[_0x2027('0x26')]({'session':_0x462ff['id'],'module_name':_0x2027('0x27'),'query':util[_0x2027('0x21')](_0x2027('0x28'),_0x277880),'order_by':'','offset':'0','select_fields':['id',_0x2027('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2027('0x29')](function(_0x126fdd){if(_0x126fdd[_0x2027('0x2a')]['length']){var _0x482ed1=_[_0x2027('0x2b')](_0x126fdd['entry_list'],function(_0x90a6ae){return _0x90a6ae['name_value_list']['user_name'][_0x2027('0x2c')]===_0x277880;});if(_0x482ed1){logger[_0x2027('0xb')](_0x2027('0x2d'));return BPromise[_0x2027('0x2e')]({'id':_0x482ed1[_0x2027('0x2f')]['id'][_0x2027('0x2c')],'name':_0x482ed1[_0x2027('0x2f')][_0x2027('0xd')]['value']});}}logger[_0x2027('0xb')](_0x2027('0x30'));return BPromise[_0x2027('0x2e')]({'id':_0x462ff[_0x2027('0x2f')]['user_id']['value'],'name':_0x462ff[_0x2027('0x2f')][_0x2027('0x31')][_0x2027('0x2c')]});});}else{logger[_0x2027('0xb')](_0x2027('0x32'));return BPromise['resolve']({'id':_0x462ff['name_value_list'][_0x2027('0x33')]['value'],'name':_0x462ff[_0x2027('0x2f')][_0x2027('0x31')][_0x2027('0x2c')]});}}function getEndUser(_0x177618,_0x10afc7,_0x4afd07,_0x2b9653){logger[_0x2027('0xb')](_0x2027('0x34'),_0x4afd07);return request({'form':{'method':'get_entry_list','input_type':_0x2027('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2b9653['id'],'module_name':_0x2027('0x19'),'query':util[_0x2027('0x21')](_0x2027('0x35'),_0x4afd07),'order_by':'','offset':'0','select_fields':['id',_0x2027('0xd'),_0x2027('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x56cf49){if(_0x56cf49[_0x2027('0x2a')][_0x2027('0x1b')]){var _0x2734c4=_[_0x2027('0x2b')](_0x56cf49['entry_list'],function(_0x521bca){return _0x521bca[_0x2027('0x2f')][_0x2027('0x36')]['value']===_0x4afd07;});if(_0x2734c4){logger[_0x2027('0xb')](_0x2027('0x37'));return BPromise[_0x2027('0x2e')]({'id':_0x2734c4[_0x2027('0x2f')]['id'][_0x2027('0x2c')],'name':_0x2734c4[_0x2027('0x2f')][_0x2027('0xd')][_0x2027('0x2c')],'phone':_0x2734c4[_0x2027('0x2f')][_0x2027('0x36')]['value']});}}else{logger[_0x2027('0xb')](_0x2027('0x38'));return request({'form':{'method':_0x2027('0x1e'),'input_type':_0x2027('0x1f'),'response_type':'JSON','rest_data':JSON[_0x2027('0x26')]({'session':_0x2b9653['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x10afc7!==''?_0x10afc7:util['format'](_0x2027('0x39'),_0x4afd07)},{'name':_0x2027('0x36'),'value':_0x4afd07}]})}})[_0x2027('0x29')](function(_0x447f70){logger['info'](_0x2027('0x3a'));return BPromise[_0x2027('0x2e')]({'id':_0x447f70['id'],'name':_0x447f70[_0x2027('0x2a')][_0x2027('0x3b')][_0x2027('0x2c')],'phone':_0x447f70['entry_list'][_0x2027('0x36')]['value']});});}});}function request(_0x5a6e2f){logger[_0x2027('0x3c')](_0x2027('0x3d'),JSON[_0x2027('0x26')](_0x5a6e2f));return rp(_[_0x2027('0x3e')](def,_0x5a6e2f));}function getTags(_0xb138e6,_0x371147){var _0x38a801=[];if(_0xb138e6&&_0xb138e6[_0x2027('0x1b')]>0x0){_0x38a801=_[_0x2027('0x3f')](_0xb138e6,_0x371147);}return _0x38a801;}function getCustomFields(_0x376572,_0x1bdbd0){var _0x4404e9=[];var _0x32ee2c={'custom_fields':[]};if(_0x376572[_0x2027('0x1b')]>0x0){_['forEach'](_0x376572,function(_0x7ad40){if(_0x7ad40[_0x2027('0x40')]===_0x2027('0x41')&&_0x7ad40[_0x2027('0x42')]&&!_0x7ad40[_0x2027('0x43')]){_0x32ee2c[_0x7ad40[_0x2027('0x42')][_0x2027('0x44')]()]=_0x7ad40[_0x2027('0x45')][_0x2027('0x23')]();}else if(_0x7ad40[_0x2027('0x40')]===_0x2027('0x41')&&_0x7ad40[_0x2027('0x46')]&&_0x7ad40['customField']){_0x32ee2c['custom_fields'][_0x2027('0x1c')]({'id':_0x7ad40['idField'],'value':_0x7ad40['content']['toString']()});}else if(_0x7ad40[_0x2027('0x40')]===_0x2027('0x47')&&_0x7ad40[_0x2027('0x1d')]&&_0x7ad40[_0x2027('0x46')]&&_0x7ad40['customField']){_0x1bdbd0[_0x7ad40[_0x2027('0x1d')]]&&_0x32ee2c[_0x2027('0x48')][_0x2027('0x1c')]({'id':_0x7ad40[_0x2027('0x46')],'value':_0x1bdbd0[_0x7ad40['variableName']][_0x2027('0x23')]()});}else if(_0x7ad40[_0x2027('0x40')]===_0x2027('0x49')&&_0x7ad40[_0x2027('0x4a')]&&_0x7ad40[_0x2027('0x4a')]['name']&&_0x7ad40[_0x2027('0x46')]&&_0x7ad40[_0x2027('0x43')]){_0x1bdbd0[_0x7ad40[_0x2027('0x4a')][_0x2027('0xd')]['toLowerCase']()]&&_0x32ee2c[_0x2027('0x48')]['push']({'id':_0x7ad40['idField'],'value':_0x1bdbd0[_0x7ad40[_0x2027('0x4a')][_0x2027('0xd')]['toLowerCase']()]['toString']()});}});}return _0x32ee2c;}function getConnection(_0x1f7c3a){return request({'method':_0x2027('0x4b'),'form':{'method':'login','input_type':_0x2027('0x1f'),'response_type':_0x2027('0x1f'),'rest_data':JSON[_0x2027('0x26')]({'user_auth':{'user_name':_0x1f7c3a[_0x2027('0x4c')],'password':_0x1f7c3a[_0x2027('0x4d')],'encryption':_0x2027('0x4e')},'application':_0x2027('0x4f')})}})[_0x2027('0x29')](function(_0x23b894){var _0x24b58f=_0x23b894;if(_0x24b58f['id']){def[_0x2027('0x50')]=_0x24b58f['id'];return BPromise['resolve'](_0x24b58f);}else{throw new Error(util[_0x2027('0x21')](_0x2027('0x51'),_0x1f7c3a['id']));}});}function setRelationship(_0xec64de,_0x3e5cd7,_0x21c139,_0x3ec290){return request({'form':{'method':_0x2027('0x52'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0xec64de['id'],'module_name':_0x2027('0x20'),'module_id':_0x21c139['id'],'link_field_name':_0x3ec290,'related_ids':[_0x3e5cd7['id']]})}});}exports['queue']=function(_0x4f564b,_0xa10d53,_0xd6e8f5,_0x5399ed,_0x254a43,_0x5f3fe3){var _0x291aa0,_0x394f61,_0x4abc8f,_0x24e529;_0x5f3fe3[_0x2027('0x53')]=intUtil[_0x2027('0x54')](_0x5f3fe3[_0x2027('0x53')]);_0x5f3fe3[_0x2027('0x55')]=intUtil[_0x2027('0x54')](_0x5f3fe3[_0x2027('0x55')]);def[_0x2027('0x56')]=util[_0x2027('0x21')](_0x2027('0x57'),_0x5f3fe3['remoteUri']);if(_0x254a43&&_0x254a43['monitor_format']){logger[_0x2027('0xb')](_0x2027('0x58'),_0x2027('0x59'));_0xa10d53['recordingURL']=util[_0x2027('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f3fe3[_0x2027('0x55')],_0xa10d53['uniqueid'],md5(_0xa10d53[_0x2027('0x5a')]));}else{_0xa10d53[_0x2027('0x5b')]='';}return getConnection(_0x5f3fe3)[_0x2027('0x29')](function(_0x1897c7){_0x24e529=_0x1897c7;return getUser(_0x5f3fe3,_0x5399ed['name'],_0x24e529);})[_0x2027('0x29')](function(_0x324cea){_0x291aa0=_0x324cea;logger['info']('The\x20User\x20ID\x20is:',_0x291aa0['id']);return getEndUser(_0x5f3fe3,_0xa10d53[_0x2027('0x5c')],_0xa10d53['calleridnum'],_0x24e529);})[_0x2027('0x29')](function(_0x5e07c4){_0x394f61=_0x5e07c4;logger[_0x2027('0xb')](_0x2027('0x5d'),_0x394f61['id']);return getTicket(_0x5f3fe3,_0x291aa0,_0x394f61,_0xd6e8f5,_0xa10d53,_0xd6e8f5[_0x2027('0x5e')],_0x24e529,'Inbound');})['then'](function(_0x188bd1){_0x4abc8f=_0x188bd1;logger[_0x2027('0xb')](_0x2027('0x5f'));logger[_0x2027('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4abc8f['id']);return setRelationship(_0x24e529,_0x291aa0,_0x4abc8f,_0x2027('0x60'));})[_0x2027('0x29')](function(){return setRelationship(_0x24e529,_0x394f61,_0x4abc8f,'contacts');})['then'](function(){return getServerInfo(_0x24e529);})[_0x2027('0x29')](function(_0x1e064e){var _0x273cbd=parseInt(_0x1e064e['version'][_0x2027('0x61')](0x0));var _0x4ba460=util['format'](_0x2027('0x62'),_0x5f3fe3[_0x2027('0x53')],_0x4abc8f['id']);if(_0x273cbd>0x6){_0x4ba460=util[_0x2027('0x21')](_0x2027('0x63'),_0x5f3fe3[_0x2027('0x53')],_0x4abc8f['id']);}logger['info'](_0x2027('0x58'),_0x2027('0x64'));emit(util[_0x2027('0x21')]('user:%s',_0x5399ed[_0x2027('0xd')]),'trigger:browser:url',{'uri':_0x4ba460});})['catch'](function(_0xf3bdb4){logger[_0x2027('0x65')]('[QUEUE]',JSON['stringify'](_0xf3bdb4));});};exports['outbound']=function(_0xb3a3a1,_0x6cab,_0x15caa9,_0x350751,_0xe0ecc3,_0x16dcd3,_0x3e0fa5){var _0x256993,_0x2a2d86,_0x578249,_0x42ceb8;_0x16dcd3[_0x2027('0x53')]=intUtil[_0x2027('0x54')](_0x16dcd3[_0x2027('0x53')]);_0x16dcd3['serverUrl']=intUtil[_0x2027('0x54')](_0x16dcd3[_0x2027('0x55')]);def['uri']=util[_0x2027('0x21')](_0x2027('0x57'),_0x16dcd3[_0x2027('0x53')]);if(_0x3e0fa5&&_0x3e0fa5['recordingFormat']&&_0x3e0fa5[_0x2027('0x66')]!==_0x2027('0x67')){logger[_0x2027('0xb')](_0x2027('0x68'),_0x2027('0x59'));_0x6cab['recordingURL']=util[_0x2027('0x21')](_0x2027('0x69'),_0x16dcd3[_0x2027('0x55')],_0x6cab['uniqueid'],md5(_0x6cab[_0x2027('0x5a')]));}return getConnection(_0x16dcd3)[_0x2027('0x29')](function(_0x156704){_0x42ceb8=_0x156704;return getUser(_0x16dcd3,_0x350751[_0x2027('0xd')],_0x42ceb8);})['then'](function(_0x3389c0){_0x256993=_0x3389c0;logger[_0x2027('0xb')]('The\x20User\x20ID\x20is:',_0x256993['id']);return getEndUser(_0x16dcd3,_0x6cab[_0x2027('0x6a')],_0x6cab[_0x2027('0x6b')],_0x42ceb8);})[_0x2027('0x29')](function(_0x2cebf6){_0x2a2d86=_0x2cebf6;logger[_0x2027('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2a2d86['id']);return getTicket(_0x16dcd3,_0x256993,_0x2a2d86,_0x15caa9,_0x6cab,_0x15caa9['Fields'],_0x42ceb8,_0x2027('0x6c'));})['then'](function(_0x4e25c5){_0x578249=_0x4e25c5;logger[_0x2027('0xb')]('Ticket\x20created!');logger[_0x2027('0xb')](_0x2027('0x6d'),_0x578249['id']);return setRelationship(_0x42ceb8,_0x256993,_0x578249,_0x2027('0x60'));})[_0x2027('0x29')](function(){return setRelationship(_0x42ceb8,_0x2a2d86,_0x578249,_0x2027('0x6e'));})[_0x2027('0x29')](function(){return getServerInfo(_0x42ceb8);})[_0x2027('0x29')](function(_0x286e52){var _0x226c1b=parseInt(_0x286e52[_0x2027('0x6f')]['charAt'](0x0));var _0xe4670c=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x16dcd3['remoteUri'],_0x578249['id']);if(_0x226c1b>0x6){_0xe4670c=util[_0x2027('0x21')](_0x2027('0x63'),_0x16dcd3['remoteUri'],_0x578249['id']);}logger[_0x2027('0xb')](_0x2027('0x68'),_0x2027('0x64'));emit(util['format'](_0x2027('0x70'),_0x350751[_0x2027('0xd')]),_0x2027('0x71'),{'uri':_0xe4670c});})[_0x2027('0x72')](function(_0x4a22cb){logger[_0x2027('0x65')]('[OUTBOUND]',JSON['stringify'](_0x4a22cb));});};exports[_0x2027('0x73')]=function(_0x42f98e,_0x39bf75,_0x3c2689,_0x3b9fc4,_0x412e24,_0x1bbd72){var _0x8308a7,_0x2c43e8,_0x5e2201,_0x498ebc;_0x1bbd72[_0x2027('0x53')]=intUtil[_0x2027('0x54')](_0x1bbd72[_0x2027('0x53')]);_0x1bbd72[_0x2027('0x55')]=intUtil[_0x2027('0x54')](_0x1bbd72[_0x2027('0x55')]);def[_0x2027('0x56')]=util['format'](_0x2027('0x57'),_0x1bbd72['remoteUri']);if(_0x412e24&&_0x412e24['monitor_format']){logger['info']('['+_0x39bf75['lastevent'][_0x2027('0x74')]()+']',_0x2027('0x59'));_0x39bf75[_0x2027('0x5b')]=util['format'](_0x2027('0x69'),_0x1bbd72[_0x2027('0x55')],_0x39bf75[_0x2027('0x5a')],md5(_0x39bf75[_0x2027('0x5a')]));}else{_0x39bf75['recordingURL']='';}return getConnection(_0x1bbd72)['then'](function(_0x31d548){_0x498ebc=_0x31d548;if(!_[_0x2027('0x75')](_0x3b9fc4)){return getUser(_0x1bbd72,_0x3b9fc4[_0x2027('0xd')],_0x498ebc);}else{return getUser(_0x1bbd72,null,_0x498ebc);}})['then'](function(_0x201188){_0x8308a7=_0x201188;logger[_0x2027('0xb')]('The\x20User\x20ID\x20is:',_0x8308a7['id']);return getEndUser(_0x1bbd72,_0x39bf75[_0x2027('0x5c')],_0x39bf75[_0x2027('0x76')],_0x498ebc);})[_0x2027('0x29')](function(_0x230a80){_0x2c43e8=_0x230a80;logger[_0x2027('0xb')](_0x2027('0x5d'),_0x2c43e8['id']);return getTicket(_0x1bbd72,_0x8308a7,_0x2c43e8,_0x3c2689,_0x39bf75,_0x3c2689[_0x2027('0x5e')],_0x498ebc,_0x2027('0x77'));})[_0x2027('0x29')](function(_0x521611){_0x5e2201=_0x521611;logger[_0x2027('0xb')](_0x2027('0x5f'));logger[_0x2027('0xb')]('The\x20Ticket\x20ID\x20is:',_0x5e2201['id']);return setRelationship(_0x498ebc,_0x8308a7,_0x5e2201,'users');})[_0x2027('0x29')](function(){return setRelationship(_0x498ebc,_0x2c43e8,_0x5e2201,_0x2027('0x6e'));})[_0x2027('0x29')](function(){return getServerInfo(_0x498ebc);})[_0x2027('0x72')](function(_0x4d9556){logger['error']('['+_0x39bf75[_0x2027('0x78')][_0x2027('0x74')]()+']',JSON[_0x2027('0x26')](_0x4d9556));});}; \ No newline at end of file +var _0x5a5a=['variableName','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','name_value_list','user_name','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','[HTTP]','map','string','nameField','customField','toLowerCase','type','custom_fields','content','toString','variable','push','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','uri','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','isNil','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','name','direction','length','forEach'];(function(_0x356776,_0x1e4931){var _0x40f2b5=function(_0x49c26a){while(--_0x49c26a){_0x356776['push'](_0x356776['shift']());}};_0x40f2b5(++_0x1e4931);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x505df9,_0x14138e){_0x505df9=_0x505df9-0x0;var _0x1cc025=_0x5a5a[_0x505df9];return _0x1cc025;};'use strict';var _=require('lodash');var rp=require(_0xa5a5('0x0'));var BPromise=require(_0xa5a5('0x1'));var md5=require(_0xa5a5('0x2'));var util=require(_0xa5a5('0x3'));var Redis=require(_0xa5a5('0x4'));var intUtil=require('./util');var config=require(_0xa5a5('0x5'));var logger=require(_0xa5a5('0x6'))(_0xa5a5('0x7'));config['redis']=_['defaults'](config[_0xa5a5('0x8')],{'host':_0xa5a5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa5a5('0x8')]));var def={'method':_0xa5a5('0xa'),'json':!![]};function emit(_0x1234c2,_0x3a23f4,_0x458bbd){io['to'](_0x1234c2)['emit'](_0x3a23f4,_0x458bbd);}function getTicket(_0x158a80,_0x15ab15,_0x18f261,_0x2dace1,_0xed7e19,_0x1b4247,_0x2b1098,_0x27bd72){logger[_0xa5a5('0xb')](_0xa5a5('0xc'));var _0x457da1=new Date();var _0x36b56c=[{'name':'name','value':intUtil[_0xa5a5('0xd')](_0x2dace1[_0xa5a5('0xe')],_0xed7e19,'\x20')},{'name':_0xa5a5('0xf'),'value':_0x15ab15['id']},{'name':_0xa5a5('0x10'),'value':_0x15ab15['id']},{'name':_0xa5a5('0x11'),'value':intUtil[_0xa5a5('0xd')](_0x2dace1['Descriptions'],_0xed7e19,'\x0a')},{'name':_0xa5a5('0x12'),'value':_0x457da1[_0xa5a5('0x13')]()[_0xa5a5('0x14')](0x0,0x13)[_0xa5a5('0x15')]('T','\x20')},{'name':_0xa5a5('0x16'),'value':'0'},{'name':_0xa5a5('0x17'),'value':'15'},{'name':_0xa5a5('0x18'),'value':_0x18f261['id']},{'name':_0xa5a5('0x19'),'value':'Contacts'},{'name':_0xa5a5('0x1a'),'value':_0x18f261[_0xa5a5('0x1b')]},{'name':_0xa5a5('0x1c'),'value':_0x27bd72}];if(_0x1b4247[_0xa5a5('0x1d')]){_[_0xa5a5('0x1e')](_0x1b4247,function(_0x12e2f2){if(_0xed7e19[_0x12e2f2[_0xa5a5('0x1f')]]){_0x36b56c['push']({'name':_0x12e2f2[_0xa5a5('0x20')],'value':_0xed7e19[_0x12e2f2[_0xa5a5('0x1f')]]});}});}return request({'form':{'method':_0xa5a5('0x21'),'input_type':_0xa5a5('0x22'),'response_type':'JSON','rest_data':JSON[_0xa5a5('0x23')]({'session':_0x2b1098['id'],'module_name':'Calls','name_value_list':_0x36b56c})}});}function getAuth(_0x2554c0){return util[_0xa5a5('0x24')](_0xa5a5('0x25'),new Buffer(_0x2554c0[_0xa5a5('0x26')]+':X')['toString']('base64'));}function getServerInfo(_0x2001ed){return request({'form':{'method':_0xa5a5('0x27'),'input_type':_0xa5a5('0x22'),'response_type':'JSON','rest_data':JSON[_0xa5a5('0x23')]({'session':_0x2001ed['id']})}});}function getUser(_0x4b4613,_0x337e52,_0x4996b3){if(!_['isNil'](_0x337e52)){logger[_0xa5a5('0xb')](_0xa5a5('0x28'),_0x337e52);return request({'form':{'method':_0xa5a5('0x29'),'input_type':_0xa5a5('0x22'),'response_type':'JSON','rest_data':JSON[_0xa5a5('0x23')]({'session':_0x4996b3['id'],'module_name':'Employees','query':util[_0xa5a5('0x24')](_0xa5a5('0x2a'),_0x337e52),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa5a5('0x2b')](function(_0xdfa813){if(_0xdfa813['entry_list']['length']){var _0x36d2a5=_[_0xa5a5('0x2c')](_0xdfa813[_0xa5a5('0x2d')],function(_0x4d1201){return _0x4d1201[_0xa5a5('0x2e')][_0xa5a5('0x2f')]['value']===_0x337e52;});if(_0x36d2a5){logger[_0xa5a5('0xb')]('Agent\x20found!');return BPromise[_0xa5a5('0x30')]({'id':_0x36d2a5['name_value_list']['id'][_0xa5a5('0x31')],'name':_0x36d2a5[_0xa5a5('0x2e')]['name']['value']});}}logger['info'](_0xa5a5('0x32'));return BPromise['resolve']({'id':_0x4996b3[_0xa5a5('0x2e')][_0xa5a5('0x33')]['value'],'name':_0x4996b3[_0xa5a5('0x2e')][_0xa5a5('0x2f')]['value']});});}else{logger[_0xa5a5('0xb')](_0xa5a5('0x34'));return BPromise[_0xa5a5('0x30')]({'id':_0x4996b3[_0xa5a5('0x2e')][_0xa5a5('0x33')][_0xa5a5('0x31')],'name':_0x4996b3[_0xa5a5('0x2e')]['user_name'][_0xa5a5('0x31')]});}}function getEndUser(_0xa3c416,_0x1a34cd,_0x1507b7,_0x18c61e){logger[_0xa5a5('0xb')](_0xa5a5('0x35'),_0x1507b7);return request({'form':{'method':_0xa5a5('0x29'),'input_type':_0xa5a5('0x22'),'response_type':_0xa5a5('0x22'),'rest_data':JSON[_0xa5a5('0x23')]({'session':_0x18c61e['id'],'module_name':_0xa5a5('0x36'),'query':util[_0xa5a5('0x24')](_0xa5a5('0x37'),_0x1507b7),'order_by':'','offset':'0','select_fields':['id',_0xa5a5('0x1b'),_0xa5a5('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa5a5('0x2b')](function(_0x4b538c){if(_0x4b538c[_0xa5a5('0x2d')]['length']){var _0x49c55d=_['find'](_0x4b538c[_0xa5a5('0x2d')],function(_0x5625bd){return _0x5625bd[_0xa5a5('0x2e')][_0xa5a5('0x38')][_0xa5a5('0x31')]===_0x1507b7;});if(_0x49c55d){logger['info'](_0xa5a5('0x39'));return BPromise['resolve']({'id':_0x49c55d['name_value_list']['id'][_0xa5a5('0x31')],'name':_0x49c55d[_0xa5a5('0x2e')]['name'][_0xa5a5('0x31')],'phone':_0x49c55d['name_value_list']['phone_home'][_0xa5a5('0x31')]});}}else{logger['info'](_0xa5a5('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xa5a5('0x22'),'response_type':_0xa5a5('0x22'),'rest_data':JSON[_0xa5a5('0x23')]({'session':_0x18c61e['id'],'module_name':_0xa5a5('0x36'),'name_value_list':[{'name':_0xa5a5('0x3b'),'value':_0x1a34cd!==_0xa5a5('0x3c')?_0x1a34cd:util[_0xa5a5('0x24')](_0xa5a5('0x3d'),_0x1507b7)},{'name':_0xa5a5('0x38'),'value':_0x1507b7}]})}})[_0xa5a5('0x2b')](function(_0x569e8d){logger[_0xa5a5('0xb')]('Enduser\x20created.');return BPromise[_0xa5a5('0x30')]({'id':_0x569e8d['id'],'name':_0x569e8d[_0xa5a5('0x2d')]['first_name'][_0xa5a5('0x31')],'phone':_0x569e8d[_0xa5a5('0x2d')][_0xa5a5('0x38')][_0xa5a5('0x31')]});});}});}function request(_0x4780b9){logger['debug'](_0xa5a5('0x3e'),JSON[_0xa5a5('0x23')](_0x4780b9));return rp(_['merge'](def,_0x4780b9));}function getTags(_0xc630e8,_0x24a96d){var _0x283f2e=[];if(_0xc630e8&&_0xc630e8[_0xa5a5('0x1d')]>0x0){_0x283f2e=_[_0xa5a5('0x3f')](_0xc630e8,_0x24a96d);}return _0x283f2e;}function getCustomFields(_0x408006,_0xfa3609){var _0x5a9a7f=[];var _0x16c579={'custom_fields':[]};if(_0x408006['length']>0x0){_[_0xa5a5('0x1e')](_0x408006,function(_0x5b476d){if(_0x5b476d['type']===_0xa5a5('0x40')&&_0x5b476d[_0xa5a5('0x41')]&&!_0x5b476d[_0xa5a5('0x42')]){_0x16c579[_0x5b476d['nameField'][_0xa5a5('0x43')]()]=_0x5b476d['content']['toString']();}else if(_0x5b476d[_0xa5a5('0x44')]===_0xa5a5('0x40')&&_0x5b476d[_0xa5a5('0x20')]&&_0x5b476d['customField']){_0x16c579[_0xa5a5('0x45')]['push']({'id':_0x5b476d['idField'],'value':_0x5b476d[_0xa5a5('0x46')][_0xa5a5('0x47')]()});}else if(_0x5b476d[_0xa5a5('0x44')]===_0xa5a5('0x48')&&_0x5b476d[_0xa5a5('0x1f')]&&_0x5b476d[_0xa5a5('0x20')]&&_0x5b476d[_0xa5a5('0x42')]){_0xfa3609[_0x5b476d[_0xa5a5('0x1f')]]&&_0x16c579['custom_fields'][_0xa5a5('0x49')]({'id':_0x5b476d[_0xa5a5('0x20')],'value':_0xfa3609[_0x5b476d[_0xa5a5('0x1f')]][_0xa5a5('0x47')]()});}else if(_0x5b476d[_0xa5a5('0x44')]===_0xa5a5('0x4a')&&_0x5b476d['Variable']&&_0x5b476d[_0xa5a5('0x4b')][_0xa5a5('0x1b')]&&_0x5b476d['idField']&&_0x5b476d[_0xa5a5('0x42')]){_0xfa3609[_0x5b476d[_0xa5a5('0x4b')][_0xa5a5('0x1b')]['toLowerCase']()]&&_0x16c579[_0xa5a5('0x45')][_0xa5a5('0x49')]({'id':_0x5b476d[_0xa5a5('0x20')],'value':_0xfa3609[_0x5b476d[_0xa5a5('0x4b')]['name']['toLowerCase']()][_0xa5a5('0x47')]()});}});}return _0x16c579;}function getConnection(_0x2811ae){return request({'method':_0xa5a5('0xa'),'form':{'method':'login','input_type':_0xa5a5('0x22'),'response_type':_0xa5a5('0x22'),'rest_data':JSON[_0xa5a5('0x23')]({'user_auth':{'user_name':_0x2811ae[_0xa5a5('0x4c')],'password':_0x2811ae[_0xa5a5('0x4d')],'encryption':_0xa5a5('0x4e')},'application':_0xa5a5('0x4f')})}})['then'](function(_0x33e128){var _0x22776f=_0x33e128;if(_0x22776f['id']){def[_0xa5a5('0x50')]=_0x22776f['id'];return BPromise[_0xa5a5('0x30')](_0x22776f);}else{throw new Error(util[_0xa5a5('0x24')](_0xa5a5('0x51'),_0x2811ae['id']));}});}function setRelationship(_0x54b422,_0x3dcf1f,_0x5f72b4,_0x12d24e){return request({'form':{'method':'set_relationship','input_type':_0xa5a5('0x22'),'response_type':_0xa5a5('0x22'),'rest_data':JSON['stringify']({'session':_0x54b422['id'],'module_name':_0xa5a5('0x52'),'module_id':_0x5f72b4['id'],'link_field_name':_0x12d24e,'related_ids':[_0x3dcf1f['id']]})}});}exports[_0xa5a5('0x53')]=function(_0x148ab0,_0xd22d24,_0x4d9b44,_0x488276,_0x20187c,_0x3b5a7a){var _0x21d940,_0x1cb977,_0x227337,_0x140256;_0x3b5a7a['remoteUri']=intUtil['stripTrailingSlash'](_0x3b5a7a[_0xa5a5('0x54')]);_0x3b5a7a[_0xa5a5('0x55')]=intUtil[_0xa5a5('0x56')](_0x3b5a7a['serverUrl']);def['uri']=util['format'](_0xa5a5('0x57'),_0x3b5a7a[_0xa5a5('0x54')]);if(_0x20187c&&_0x20187c[_0xa5a5('0x58')]){logger[_0xa5a5('0xb')](_0xa5a5('0x59'),_0xa5a5('0x5a'));_0xd22d24[_0xa5a5('0x5b')]=util[_0xa5a5('0x24')](_0xa5a5('0x5c'),_0x3b5a7a[_0xa5a5('0x55')],_0xd22d24['uniqueid'],md5(_0xd22d24[_0xa5a5('0x5d')]));}else{_0xd22d24['recordingURL']='';}return getConnection(_0x3b5a7a)[_0xa5a5('0x2b')](function(_0x1a78ed){_0x140256=_0x1a78ed;return getUser(_0x3b5a7a,_0x488276[_0xa5a5('0x1b')],_0x140256);})['then'](function(_0x3abbb7){_0x21d940=_0x3abbb7;logger[_0xa5a5('0xb')]('The\x20User\x20ID\x20is:',_0x21d940['id']);return getEndUser(_0x3b5a7a,_0xd22d24[_0xa5a5('0x5e')],_0xd22d24[_0xa5a5('0x5f')],_0x140256);})[_0xa5a5('0x2b')](function(_0x19910c){_0x1cb977=_0x19910c;logger[_0xa5a5('0xb')](_0xa5a5('0x60'),_0x1cb977['id']);return getTicket(_0x3b5a7a,_0x21d940,_0x1cb977,_0x4d9b44,_0xd22d24,_0x4d9b44[_0xa5a5('0x61')],_0x140256,_0xa5a5('0x62'));})[_0xa5a5('0x2b')](function(_0x13a2c2){_0x227337=_0x13a2c2;logger['info'](_0xa5a5('0x63'));logger[_0xa5a5('0xb')](_0xa5a5('0x64'),_0x227337['id']);return setRelationship(_0x140256,_0x21d940,_0x227337,'users');})[_0xa5a5('0x2b')](function(){return setRelationship(_0x140256,_0x1cb977,_0x227337,_0xa5a5('0x65'));})[_0xa5a5('0x2b')](function(){return getServerInfo(_0x140256);})[_0xa5a5('0x2b')](function(_0x2e732a){var _0x2ad297=parseInt(_0x2e732a[_0xa5a5('0x66')][_0xa5a5('0x67')](0x0));var _0x111728=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3b5a7a[_0xa5a5('0x54')],_0x227337['id']);if(_0x2ad297>0x6){_0x111728=util[_0xa5a5('0x24')](_0xa5a5('0x68'),_0x3b5a7a['remoteUri'],_0x227337['id']);}logger[_0xa5a5('0xb')]('[QUEUE]',_0xa5a5('0x69'));emit(util[_0xa5a5('0x24')](_0xa5a5('0x6a'),_0x488276[_0xa5a5('0x1b')]),'trigger:browser:url',{'uri':_0x111728});})['catch'](function(_0x1d4878){logger[_0xa5a5('0x6b')]('[QUEUE]',JSON[_0xa5a5('0x23')](_0x1d4878));});};exports[_0xa5a5('0x6c')]=function(_0xfb357b,_0x284888,_0x56157e,_0x5b8e94,_0x24a270,_0x5266e5,_0x2a5277){var _0x425eb2,_0x6c7c28,_0x1fd1d2,_0x48a14b;_0x5266e5[_0xa5a5('0x54')]=intUtil['stripTrailingSlash'](_0x5266e5[_0xa5a5('0x54')]);_0x5266e5[_0xa5a5('0x55')]=intUtil[_0xa5a5('0x56')](_0x5266e5[_0xa5a5('0x55')]);def[_0xa5a5('0x6d')]=util[_0xa5a5('0x24')](_0xa5a5('0x57'),_0x5266e5['remoteUri']);if(_0x2a5277&&_0x2a5277[_0xa5a5('0x6e')]&&_0x2a5277['recordingFormat']!==_0xa5a5('0x6f')){logger[_0xa5a5('0xb')](_0xa5a5('0x70'),_0xa5a5('0x5a'));_0x284888[_0xa5a5('0x5b')]=util[_0xa5a5('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5266e5[_0xa5a5('0x55')],_0x284888[_0xa5a5('0x5d')],md5(_0x284888['uniqueid']));}return getConnection(_0x5266e5)[_0xa5a5('0x2b')](function(_0x2f39f1){_0x48a14b=_0x2f39f1;return getUser(_0x5266e5,_0x5b8e94[_0xa5a5('0x1b')],_0x48a14b);})[_0xa5a5('0x2b')](function(_0x49e6c1){_0x425eb2=_0x49e6c1;logger[_0xa5a5('0xb')](_0xa5a5('0x71'),_0x425eb2['id']);return getEndUser(_0x5266e5,_0x284888[_0xa5a5('0x72')],_0x284888[_0xa5a5('0x73')],_0x48a14b);})['then'](function(_0x13540c){_0x6c7c28=_0x13540c;logger[_0xa5a5('0xb')]('The\x20Enduser\x20ID\x20is:',_0x6c7c28['id']);return getTicket(_0x5266e5,_0x425eb2,_0x6c7c28,_0x56157e,_0x284888,_0x56157e[_0xa5a5('0x61')],_0x48a14b,_0xa5a5('0x74'));})['then'](function(_0x4a032e){_0x1fd1d2=_0x4a032e;logger[_0xa5a5('0xb')]('Ticket\x20created!');logger[_0xa5a5('0xb')](_0xa5a5('0x64'),_0x1fd1d2['id']);return setRelationship(_0x48a14b,_0x425eb2,_0x1fd1d2,_0xa5a5('0x75'));})['then'](function(){return setRelationship(_0x48a14b,_0x6c7c28,_0x1fd1d2,_0xa5a5('0x65'));})[_0xa5a5('0x2b')](function(){return getServerInfo(_0x48a14b);})[_0xa5a5('0x2b')](function(_0x3fb819){var _0x3fb90e=parseInt(_0x3fb819[_0xa5a5('0x66')]['charAt'](0x0));var _0x503cca=util[_0xa5a5('0x24')](_0xa5a5('0x76'),_0x5266e5[_0xa5a5('0x54')],_0x1fd1d2['id']);if(_0x3fb90e>0x6){_0x503cca=util[_0xa5a5('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5266e5[_0xa5a5('0x54')],_0x1fd1d2['id']);}logger[_0xa5a5('0xb')]('[OUTBOUND]',_0xa5a5('0x69'));emit(util[_0xa5a5('0x24')](_0xa5a5('0x6a'),_0x5b8e94[_0xa5a5('0x1b')]),_0xa5a5('0x77'),{'uri':_0x503cca});})['catch'](function(_0x28de32){logger[_0xa5a5('0x6b')]('[OUTBOUND]',JSON['stringify'](_0x28de32));});};exports[_0xa5a5('0x78')]=function(_0x4832a8,_0x1eac19,_0x12d529,_0x17f683,_0x1227b9,_0x387676){var _0x1573e0,_0x4bf339,_0x32ef99,_0x2ac7a6;_0x387676[_0xa5a5('0x54')]=intUtil[_0xa5a5('0x56')](_0x387676[_0xa5a5('0x54')]);_0x387676[_0xa5a5('0x55')]=intUtil[_0xa5a5('0x56')](_0x387676[_0xa5a5('0x55')]);def[_0xa5a5('0x6d')]=util[_0xa5a5('0x24')](_0xa5a5('0x57'),_0x387676[_0xa5a5('0x54')]);if(_0x1227b9&&_0x1227b9['monitor_format']){logger['info']('['+_0x1eac19[_0xa5a5('0x79')][_0xa5a5('0x7a')]()+']',_0xa5a5('0x5a'));_0x1eac19[_0xa5a5('0x5b')]=util[_0xa5a5('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x387676[_0xa5a5('0x55')],_0x1eac19['uniqueid'],md5(_0x1eac19[_0xa5a5('0x5d')]));}else{_0x1eac19[_0xa5a5('0x5b')]='';}return getConnection(_0x387676)[_0xa5a5('0x2b')](function(_0x2f72ee){_0x2ac7a6=_0x2f72ee;if(!_[_0xa5a5('0x7b')](_0x17f683)){return getUser(_0x387676,_0x17f683[_0xa5a5('0x1b')],_0x2ac7a6);}else{return getUser(_0x387676,null,_0x2ac7a6);}})['then'](function(_0x30550e){_0x1573e0=_0x30550e;logger[_0xa5a5('0xb')](_0xa5a5('0x71'),_0x1573e0['id']);return getEndUser(_0x387676,_0x1eac19[_0xa5a5('0x5e')],_0x1eac19[_0xa5a5('0x5f')],_0x2ac7a6);})[_0xa5a5('0x2b')](function(_0x27a667){_0x4bf339=_0x27a667;logger[_0xa5a5('0xb')](_0xa5a5('0x60'),_0x4bf339['id']);return getTicket(_0x387676,_0x1573e0,_0x4bf339,_0x12d529,_0x1eac19,_0x12d529[_0xa5a5('0x61')],_0x2ac7a6,'Inbound');})['then'](function(_0x45358a){_0x32ef99=_0x45358a;logger['info']('Ticket\x20created!');logger[_0xa5a5('0xb')](_0xa5a5('0x64'),_0x32ef99['id']);return setRelationship(_0x2ac7a6,_0x1573e0,_0x32ef99,_0xa5a5('0x75'));})[_0xa5a5('0x2b')](function(){return setRelationship(_0x2ac7a6,_0x4bf339,_0x32ef99,_0xa5a5('0x65'));})[_0xa5a5('0x2b')](function(){return getServerInfo(_0x2ac7a6);})['catch'](function(_0x1abc89){logger[_0xa5a5('0x6b')]('['+_0x1eac19[_0xa5a5('0x79')]['toUpperCase']()+']',JSON[_0xa5a5('0x23')](_0x1abc89));});}; \ 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 e59951b..7afe377 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 _0xdd29=['Variable','name','toLowerCase','type','keyValue','keyType','key','%s:\x20%s','format','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util','sortBy','length','string','content','variable','variableName','push','toString','customVariable'];(function(_0xe86041,_0x2fbd7b){var _0x1230a9=function(_0x1366e8){while(--_0x1366e8){_0xe86041['push'](_0xe86041['shift']());}};_0x1230a9(++_0x2fbd7b);}(_0xdd29,0x1a5));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9dd2('0x0'));var util=require(_0x9dd2('0x1'));exports['getString']=function(_0x11338f,_0x513bf2,_0x1dd8c4){var _0x2fdcc7=[];if(_0x11338f['length']>0x0){var _0x54b8b1=_[_0x9dd2('0x2')](_0x11338f,['id']);for(var _0x155f68=0x0;_0x155f68<_0x54b8b1[_0x9dd2('0x3')];_0x155f68++){var _0x21ee79=_0x54b8b1[_0x155f68];if(_0x21ee79['type']===_0x9dd2('0x4')){_0x2fdcc7['push'](_0x21ee79[_0x9dd2('0x5')]);}else if(_0x21ee79['type']===_0x9dd2('0x6')&&_0x21ee79[_0x9dd2('0x7')]){_0x513bf2[_0x21ee79['variableName']]&&_0x2fdcc7[_0x9dd2('0x8')](_0x513bf2[_0x21ee79[_0x9dd2('0x7')]][_0x9dd2('0x9')]());}else if(_0x21ee79['type']===_0x9dd2('0xa')&&_0x21ee79[_0x9dd2('0xb')]&&_0x21ee79['Variable'][_0x9dd2('0xc')]){_0x513bf2[_0x21ee79[_0x9dd2('0xb')]['name'][_0x9dd2('0xd')]()]&&_0x2fdcc7[_0x9dd2('0x8')](_0x513bf2[_0x21ee79['Variable'][_0x9dd2('0xc')][_0x9dd2('0xd')]()][_0x9dd2('0x9')]());}else if(_0x21ee79[_0x9dd2('0xe')]===_0x9dd2('0xf')){if(_0x21ee79[_0x9dd2('0x10')]===_0x9dd2('0x4')&&_0x21ee79['key']){_0x2fdcc7[_0x9dd2('0x8')](util['format']('%s:\x20%s',_0x21ee79[_0x9dd2('0x11')],_0x21ee79['keyContent']));}else if(_0x21ee79[_0x9dd2('0x10')]===_0x9dd2('0x6')&&_0x21ee79[_0x9dd2('0x7')]&&_0x21ee79['key']){_0x513bf2[_0x21ee79[_0x9dd2('0x7')]]&&_0x2fdcc7['push'](util['format'](_0x9dd2('0x12'),_0x21ee79['key'],_0x513bf2[_0x21ee79[_0x9dd2('0x7')]]));}else if(_0x21ee79[_0x9dd2('0x10')]===_0x9dd2('0xa')&&_0x21ee79['Variable']&&_0x21ee79[_0x9dd2('0xb')][_0x9dd2('0xc')]&&_0x21ee79[_0x9dd2('0x11')]){_0x513bf2[_0x21ee79['Variable'][_0x9dd2('0xc')]['toLowerCase']()]&&_0x2fdcc7[_0x9dd2('0x8')](util[_0x9dd2('0x13')]('%s:\x20%s',_0x21ee79[_0x9dd2('0x11')],_0x513bf2[_0x21ee79[_0x9dd2('0xb')][_0x9dd2('0xc')][_0x9dd2('0xd')]()]));}}}}return _0x2fdcc7[_0x9dd2('0x14')](_0x1dd8c4);};exports[_0x9dd2('0x15')]=function(_0x2256d4){var _0x4c639a=_0x2256d4[_0x9dd2('0x16')](-0x1);if(_0x4c639a==='/'){_0x2256d4=_0x2256d4[_0x9dd2('0x17')](0x0,_0x2256d4[_0x9dd2('0x18')](_0x4c639a));}return _0x2256d4;};exports['validateEmail']=function(_0x2a080e){if(!_[_0x9dd2('0x19')](_0x2a080e)&&_0x2a080e!==''){var _0x4d8c24=/^(([^<>()\[\]\\.,;:\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 _0x4d8c24[_0x9dd2('0x1a')](String(_0x2a080e)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x07ad=['test','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil'];(function(_0x8fd06,_0x33eea1){var _0x429e9b=function(_0x5072ac){while(--_0x5072ac){_0x8fd06['push'](_0x8fd06['shift']());}};_0x429e9b(++_0x33eea1);}(_0x07ad,0x1e7));var _0xd07a=function(_0x184681,_0x29846f){_0x184681=_0x184681-0x0;var _0x41bf68=_0x07ad[_0x184681];return _0x41bf68;};'use strict';var _=require('lodash');var util=require(_0xd07a('0x0'));exports['getString']=function(_0x308e09,_0x4a5460,_0x591db8){var _0x404448=[];if(_0x308e09[_0xd07a('0x1')]>0x0){var _0x14a74d=_[_0xd07a('0x2')](_0x308e09,['id']);for(var _0x292547=0x0;_0x292547<_0x14a74d[_0xd07a('0x1')];_0x292547++){var _0x4eb011=_0x14a74d[_0x292547];if(_0x4eb011[_0xd07a('0x3')]===_0xd07a('0x4')){_0x404448[_0xd07a('0x5')](_0x4eb011[_0xd07a('0x6')]);}else if(_0x4eb011[_0xd07a('0x3')]===_0xd07a('0x7')&&_0x4eb011[_0xd07a('0x8')]){_0x4a5460[_0x4eb011[_0xd07a('0x8')]]&&_0x404448[_0xd07a('0x5')](_0x4a5460[_0x4eb011[_0xd07a('0x8')]][_0xd07a('0x9')]());}else if(_0x4eb011[_0xd07a('0x3')]===_0xd07a('0xa')&&_0x4eb011[_0xd07a('0xb')]&&_0x4eb011[_0xd07a('0xb')][_0xd07a('0xc')]){_0x4a5460[_0x4eb011[_0xd07a('0xb')][_0xd07a('0xc')][_0xd07a('0xd')]()]&&_0x404448['push'](_0x4a5460[_0x4eb011[_0xd07a('0xb')]['name'][_0xd07a('0xd')]()][_0xd07a('0x9')]());}else if(_0x4eb011[_0xd07a('0x3')]===_0xd07a('0xe')){if(_0x4eb011[_0xd07a('0xf')]==='string'&&_0x4eb011[_0xd07a('0x10')]){_0x404448[_0xd07a('0x5')](util[_0xd07a('0x11')]('%s:\x20%s',_0x4eb011[_0xd07a('0x10')],_0x4eb011[_0xd07a('0x12')]));}else if(_0x4eb011['keyType']===_0xd07a('0x7')&&_0x4eb011[_0xd07a('0x8')]&&_0x4eb011[_0xd07a('0x10')]){_0x4a5460[_0x4eb011[_0xd07a('0x8')]]&&_0x404448['push'](util['format']('%s:\x20%s',_0x4eb011['key'],_0x4a5460[_0x4eb011[_0xd07a('0x8')]]));}else if(_0x4eb011[_0xd07a('0xf')]===_0xd07a('0xa')&&_0x4eb011[_0xd07a('0xb')]&&_0x4eb011[_0xd07a('0xb')]['name']&&_0x4eb011[_0xd07a('0x10')]){_0x4a5460[_0x4eb011[_0xd07a('0xb')][_0xd07a('0xc')]['toLowerCase']()]&&_0x404448[_0xd07a('0x5')](util[_0xd07a('0x11')](_0xd07a('0x13'),_0x4eb011[_0xd07a('0x10')],_0x4a5460[_0x4eb011[_0xd07a('0xb')][_0xd07a('0xc')]['toLowerCase']()]));}}}}return _0x404448[_0xd07a('0x14')](_0x591db8);};exports[_0xd07a('0x15')]=function(_0x4001f2){var _0x1adba6=_0x4001f2[_0xd07a('0x16')](-0x1);if(_0x1adba6==='/'){_0x4001f2=_0x4001f2['substring'](0x0,_0x4001f2[_0xd07a('0x17')](_0x1adba6));}return _0x4001f2;};exports[_0xd07a('0x18')]=function(_0x50ba31){if(!_[_0xd07a('0x19')](_0x50ba31)&&_0x50ba31!==''){var _0x4561db=/^(([^<>()\[\]\\.,;:\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 _0x4561db[_0xd07a('0x1a')](String(_0x50ba31)[_0xd07a('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 87a7313..b393078 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 _0x8bca=['variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','sessionName','HelpDesk','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','admin','getUser','length','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','create','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','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','[QUEUE]','trigger:browser:url','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','toUpperCase','recordingURL','calleridname','lastevent','lodash','request-promise','bluebird','./util','../../../../config/environment','../../../../config/logger','vTiger','defaults','redis','localhost','socket.io-emitter','forEach','type','string','idField','content','toString','variable'];(function(_0x5cecad,_0x38181f){var _0x2e01fe=function(_0x3d9dd6){while(--_0x3d9dd6){_0x5cecad['push'](_0x5cecad['shift']());}};_0x2e01fe(++_0x38181f);}(_0x8bca,0x126));var _0xa8bc=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x8bca[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xa8bc('0x0'));var rp=require(_0xa8bc('0x1'));var BPromise=require(_0xa8bc('0x2'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa8bc('0x3'));var config=require(_0xa8bc('0x4'));var logger=require(_0xa8bc('0x5'))(_0xa8bc('0x6'));config['redis']=_[_0xa8bc('0x7')](config[_0xa8bc('0x8')],{'host':_0xa8bc('0x9'),'port':0x18eb});var io=require(_0xa8bc('0xa'))(new Redis(config[_0xa8bc('0x8')]));function emit(_0x269e06,_0x57ae61,_0xb03e3a){io['to'](_0x269e06)['emit'](_0x57ae61,_0xb03e3a);}function getCustomFields(_0xbc2470,_0x59a325){var _0x328f55={};if(_0xbc2470['length']>0x0){_[_0xa8bc('0xb')](_0xbc2470,function(_0xac1100){if(_0xac1100[_0xa8bc('0xc')]===_0xa8bc('0xd')&&_0xac1100['idField']){_0x328f55[_0xac1100[_0xa8bc('0xe')]]=_0xac1100[_0xa8bc('0xf')][_0xa8bc('0x10')]();}else if(_0xac1100[_0xa8bc('0xc')]===_0xa8bc('0x11')&&_0xac1100[_0xa8bc('0x12')]&&_0xac1100[_0xa8bc('0xe')]&&_0x59a325[_0xac1100[_0xa8bc('0x12')]]){_0x328f55[_0xac1100[_0xa8bc('0xe')]]=_0x59a325[_0xac1100['variableName']][_0xa8bc('0x10')]();}else if(_0xac1100[_0xa8bc('0xc')]===_0xa8bc('0x13')&&_0xac1100[_0xa8bc('0x14')]&&_0xac1100[_0xa8bc('0x14')][_0xa8bc('0x15')]&&_0xac1100[_0xa8bc('0xe')]&&_0x59a325[_0xac1100[_0xa8bc('0x14')][_0xa8bc('0x15')][_0xa8bc('0x16')]()]){_0x328f55[_0xac1100['idField']]=_0x59a325[_0xac1100[_0xa8bc('0x14')][_0xa8bc('0x15')][_0xa8bc('0x16')]()][_0xa8bc('0x10')]();}});}return _0x328f55;}function createTicket(_0x4cdbb0,_0x5be23b,_0xce8598,_0x105bf1,_0x5251ad,_0x4fbec9,_0x108811){logger[_0xa8bc('0x17')](_0xa8bc('0x18'));var _0xce75be=_[_0xa8bc('0x19')]({'parent_id':'','assigned_user_id':_0x5be23b['id'],'ticketpriorities':_0xa8bc('0x1a'),'ticketstatus':'Open','ticket_title':intUtil[_0xa8bc('0x1b')](_0x105bf1[_0xa8bc('0x1c')],_0x5251ad,'\x20'),'description':intUtil[_0xa8bc('0x1b')](_0x105bf1[_0xa8bc('0x1d')],_0x5251ad,'\x0a'),'contact_id':_0xce8598['id']},getCustomFields(_0x4fbec9,_0x5251ad));var _0x528667={'method':'POST','uri':util[_0xa8bc('0x1e')](_0xa8bc('0x1f'),_0x4cdbb0[_0xa8bc('0x20')]),'form':{'operation':'create','username':_0x4cdbb0['username'],'sessionName':_0x108811[_0xa8bc('0x21')],'elementType':_0xa8bc('0x22'),'element':JSON['stringify'](_0xce75be)},'json':!![]};return request(_0x528667)[_0xa8bc('0x23')](function(_0x2a737a){if(_0x2a737a[_0xa8bc('0x24')]){return BPromise[_0xa8bc('0x25')]({'id':_0x2a737a[_0xa8bc('0x26')]['id']});}else{throw new Error(util['format'](_0xa8bc('0x27'),JSON[_0xa8bc('0x28')](_0x2a737a['error'])));}})[_0xa8bc('0x29')](function(_0x375436){var _0x415960=_0x375436[_0xa8bc('0x2a')]||0x1f4;logger[_0xa8bc('0x2b')](_0xa8bc('0x2c'),'createTicket',_0x415960,JSON['stringify'](_0x375436));});}function getUser(_0x642ee0,_0x191115,_0x181696){if(intUtil[_0xa8bc('0x2d')](_0x191115)){logger['info']('Getting\x20agent\x20with\x20email',_0x191115);return request({'method':_0xa8bc('0x2e'),'uri':util[_0xa8bc('0x1e')](_0xa8bc('0x1f'),_0x642ee0[_0xa8bc('0x20')]),'qs':{'operation':_0xa8bc('0x2f'),'username':_0x642ee0['username'],'sessionName':_0x181696[_0xa8bc('0x21')],'query':util['format'](_0xa8bc('0x30'),_0x191115)},'json':!![]})[_0xa8bc('0x23')](function(_0x337dee){if(_0x337dee[_0xa8bc('0x24')]&&_0x337dee[_0xa8bc('0x26')]['length']){logger['info'](_0xa8bc('0x31'));return BPromise[_0xa8bc('0x25')]({'id':_0x337dee['result'][0x0]['id'],'email':_0x337dee['result'][0x0][_0xa8bc('0x32')],'name':_0x337dee['result'][0x0][_0xa8bc('0x33')]+'\x20'+_0x337dee[_0xa8bc('0x26')][_0xa8bc('0x34')]});}else{logger['info'](_0xa8bc('0x35'));return BPromise[_0xa8bc('0x25')]({'id':_0x181696[_0xa8bc('0x36')],'email':_0x642ee0[_0xa8bc('0x37')],'name':_0xa8bc('0x38')});}})['catch'](function(_0x24f2f3){var _0x190306=_0x24f2f3[_0xa8bc('0x2a')]||0x1f4;logger[_0xa8bc('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa8bc('0x39'),_0x190306,JSON['stringify'](_0x24f2f3));});}else{logger['info'](_0xa8bc('0x35'));return BPromise[_0xa8bc('0x25')]({'id':_0x181696['userId'],'email':_0x642ee0[_0xa8bc('0x37')],'name':'admin'})[_0xa8bc('0x29')](function(_0x53dbe1){var _0x2ede3a=_0x53dbe1['statusCode']||0x1f4;logger[_0xa8bc('0x2b')](_0xa8bc('0x2c'),_0xa8bc('0x39'),_0x2ede3a,JSON['stringify'](_0x53dbe1));});}}function getEndUser(_0x172231,_0x184c21,_0x4adbdd,_0x1219e6){logger[_0xa8bc('0x17')]('Searching\x20end\x20user\x20with\x20phone',_0x4adbdd);return request({'method':_0xa8bc('0x2e'),'uri':util[_0xa8bc('0x1e')]('%s/webservice.php',_0x172231[_0xa8bc('0x20')]),'qs':{'operation':_0xa8bc('0x2f'),'username':_0x172231[_0xa8bc('0x37')],'sessionName':_0x1219e6[_0xa8bc('0x21')],'query':util['format']('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;',_0x4adbdd,_0x4adbdd,_0x4adbdd,_0x4adbdd,_0x4adbdd)},'json':!![]})[_0xa8bc('0x23')](function(_0x80e439){if(_0x80e439['success']&&_0x80e439[_0xa8bc('0x26')][_0xa8bc('0x3a')]){logger[_0xa8bc('0x17')](_0xa8bc('0x3b'));return BPromise[_0xa8bc('0x25')]({'id':_0x80e439[_0xa8bc('0x26')][0x0]['id'],'name':_0x80e439[_0xa8bc('0x26')][0x0][_0xa8bc('0x3c')]+'\x20'+_0x80e439[_0xa8bc('0x26')][0x0][_0xa8bc('0x3d')],'phone':_0x4adbdd});}else{logger[_0xa8bc('0x17')](_0xa8bc('0x3e'));return request({'method':_0xa8bc('0x3f'),'uri':util[_0xa8bc('0x1e')](_0xa8bc('0x1f'),_0x172231['remoteUri']),'form':{'operation':_0xa8bc('0x40'),'sessionName':_0x1219e6[_0xa8bc('0x21')],'elementType':_0xa8bc('0x41'),'element':JSON['stringify']({'lastname':_0x184c21,'phone':_0x4adbdd,'assigned_user_id':'\x20'})},'json':!![]})[_0xa8bc('0x23')](function(_0x1044ae){logger[_0xa8bc('0x17')](_0xa8bc('0x42'));return BPromise[_0xa8bc('0x25')]({'id':_0x1044ae[_0xa8bc('0x26')]['id'],'name':_0x1044ae[_0xa8bc('0x26')][_0xa8bc('0x3d')],'phone':_0x1044ae['result'][_0xa8bc('0x43')]});})[_0xa8bc('0x29')](function(_0x382329){var _0x5071a0=_0x382329[_0xa8bc('0x2a')]||0x1f4;logger[_0xa8bc('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa8bc('0x44'),_0x5071a0,JSON[_0xa8bc('0x28')](_0x382329));});}});}function getConnection(_0x5841d5){var _0x51d7a6=_0x5841d5[_0xa8bc('0x37')];var _0x4694cb=_0x5841d5[_0xa8bc('0x45')];return request({'method':_0xa8bc('0x2e'),'uri':util[_0xa8bc('0x1e')](_0xa8bc('0x1f'),_0x5841d5[_0xa8bc('0x20')]),'qs':{'operation':_0xa8bc('0x46'),'username':_0x51d7a6},'json':!![]})[_0xa8bc('0x23')](function(_0x36c491){if(_0x36c491[_0xa8bc('0x24')]){return request({'method':'POST','uri':util['format'](_0xa8bc('0x1f'),_0x5841d5[_0xa8bc('0x20')]),'form':{'operation':_0xa8bc('0x47'),'username':_0x51d7a6,'accessKey':md5(_0x36c491['result']['token']+_0x4694cb)},'json':!![]});}})[_0xa8bc('0x23')](function(_0x1f1e36){if(_0x1f1e36[_0xa8bc('0x24')]){return BPromise[_0xa8bc('0x25')](_0x1f1e36[_0xa8bc('0x26')]);}else{throw new Error(util[_0xa8bc('0x1e')](_0xa8bc('0x48'),_0x5841d5['id']));}})[_0xa8bc('0x29')](function(_0x58429d){var _0x269922=_0x58429d[_0xa8bc('0x2a')]||0x1f4;logger['error'](_0xa8bc('0x2c'),_0xa8bc('0x49'),_0x269922,JSON[_0xa8bc('0x28')](_0x58429d));});}function request(_0x560d18){logger[_0xa8bc('0x17')](_0xa8bc('0x4a'),JSON[_0xa8bc('0x28')](_0x560d18));return rp(_0x560d18);}exports[_0xa8bc('0x4b')]=function(_0x451c71,_0x4f1612,_0x573f03,_0x9f42ff,_0x31b51b,_0x25f881){var _0xff7006,_0x3cd9db,_0x2df362,_0x17faa3;_0x25f881[_0xa8bc('0x20')]=intUtil[_0xa8bc('0x4c')](_0x25f881['remoteUri']);if(_0x31b51b&&_0x31b51b['monitor_format']){logger[_0xa8bc('0x17')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4f1612['recordingURL']=util[_0xa8bc('0x1e')](_0xa8bc('0x4d'),_0x25f881[_0xa8bc('0x4e')],_0x4f1612[_0xa8bc('0x4f')],md5(_0x4f1612[_0xa8bc('0x4f')]));}else{_0x4f1612['recordingURL']='';}return getConnection(_0x25f881)['then'](function(_0x40daf6){_0x17faa3=_0x40daf6;return getUser(_0x25f881,_0x9f42ff[_0xa8bc('0x50')],_0x17faa3);})[_0xa8bc('0x23')](function(_0x2bb7ee){_0xff7006=_0x2bb7ee;logger[_0xa8bc('0x17')]('The\x20User\x20ID\x20is:',_0xff7006['id']);return getEndUser(_0x25f881,_0x4f1612['calleridname'],_0x4f1612[_0xa8bc('0x51')],_0x17faa3);})[_0xa8bc('0x23')](function(_0x261354){_0x3cd9db=_0x261354;logger[_0xa8bc('0x17')](_0xa8bc('0x52'),_0x3cd9db['id']);return createTicket(_0x25f881,_0xff7006,_0x3cd9db,_0x573f03,_0x4f1612,_0x573f03[_0xa8bc('0x53')],_0x17faa3);})[_0xa8bc('0x23')](function(_0x2c6d15){_0x2df362=_0x2c6d15;logger[_0xa8bc('0x17')](_0xa8bc('0x54'));logger['info'](_0xa8bc('0x55'),_0x2df362['id']);var _0x4bb002=util[_0xa8bc('0x1e')](_0xa8bc('0x56'),_0x25f881[_0xa8bc('0x20')],_['split'](_0x2df362['id'],'x')[0x1]);logger[_0xa8bc('0x17')](_0xa8bc('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x9f42ff['name']),_0xa8bc('0x58'),{'uri':_0x4bb002});})['catch'](function(_0x484858){logger[_0xa8bc('0x2b')](_0xa8bc('0x57'),JSON[_0xa8bc('0x28')](_0x484858));});};exports['outbound']=function(_0xd671fc,_0x57c2d3,_0x965559,_0x5a6318,_0x274faa,_0x3be4b6,_0x2164a4){var _0x43f116,_0x453796,_0x2594ac,_0x596486;_0x3be4b6[_0xa8bc('0x20')]=intUtil[_0xa8bc('0x4c')](_0x3be4b6[_0xa8bc('0x20')]);_0x3be4b6[_0xa8bc('0x4e')]=intUtil[_0xa8bc('0x4c')](_0x3be4b6[_0xa8bc('0x4e')]);if(_0x2164a4&&_0x2164a4[_0xa8bc('0x59')]&&_0x2164a4[_0xa8bc('0x59')]!==_0xa8bc('0x5a')){logger[_0xa8bc('0x17')](_0xa8bc('0x5b'),_0xa8bc('0x5c'));_0x57c2d3['recordingURL']=util['format'](_0xa8bc('0x4d'),_0x3be4b6[_0xa8bc('0x4e')],_0x57c2d3[_0xa8bc('0x4f')],md5(_0x57c2d3['uniqueid']));}return getConnection(_0x3be4b6)[_0xa8bc('0x23')](function(_0x31be41){_0x596486=_0x31be41;return getUser(_0x3be4b6,_0x5a6318[_0xa8bc('0x50')],_0x596486);})[_0xa8bc('0x23')](function(_0xdef08){_0x43f116=_0xdef08;logger[_0xa8bc('0x17')](_0xa8bc('0x5d'),_0x43f116['id']);return getEndUser(_0x3be4b6,_0x57c2d3[_0xa8bc('0x5e')],_0x57c2d3[_0xa8bc('0x5f')],_0x596486);})[_0xa8bc('0x23')](function(_0x5970ed){_0x453796=_0x5970ed;logger[_0xa8bc('0x17')](_0xa8bc('0x52'),_0x453796['id']);return createTicket(_0x3be4b6,_0x43f116,_0x453796,_0x965559,_0x57c2d3,_0x965559[_0xa8bc('0x53')],_0x596486);})[_0xa8bc('0x23')](function(_0x132c9c){_0x2594ac=_0x132c9c;logger[_0xa8bc('0x17')](_0xa8bc('0x54'));logger[_0xa8bc('0x17')](_0xa8bc('0x55'),_0x2594ac['id']);var _0x1ab752=util[_0xa8bc('0x1e')](_0xa8bc('0x56'),_0x3be4b6[_0xa8bc('0x20')],_[_0xa8bc('0x60')](_0x2594ac['id'],'x')[0x1]);logger[_0xa8bc('0x17')](_0xa8bc('0x5b'),_0xa8bc('0x61'));emit(util[_0xa8bc('0x1e')]('user:%s',_0x5a6318[_0xa8bc('0x15')]),_0xa8bc('0x58'),{'uri':_0x1ab752});})[_0xa8bc('0x29')](function(_0x5ac693){logger['error'](_0xa8bc('0x5b'),JSON[_0xa8bc('0x28')](_0x5ac693));});};exports[_0xa8bc('0x62')]=function(_0x16ca11,_0x1943e7,_0x3b53c1,_0x51993e,_0x495495,_0x4131c1){var _0x2527b8,_0x2c91c1,_0x154fc0,_0x4d5b5e;_0x4131c1[_0xa8bc('0x20')]=intUtil[_0xa8bc('0x4c')](_0x4131c1[_0xa8bc('0x20')]);_0x4131c1[_0xa8bc('0x4e')]=intUtil[_0xa8bc('0x4c')](_0x4131c1['serverUrl']);if(_0x495495&&_0x495495[_0xa8bc('0x63')]){logger[_0xa8bc('0x17')]('['+_0x1943e7['lastevent'][_0xa8bc('0x64')]()+']',_0xa8bc('0x5c'));_0x1943e7[_0xa8bc('0x65')]=util[_0xa8bc('0x1e')](_0xa8bc('0x4d'),_0x4131c1[_0xa8bc('0x4e')],_0x1943e7['uniqueid'],md5(_0x1943e7[_0xa8bc('0x4f')]));}else{_0x1943e7[_0xa8bc('0x65')]='';}return getConnection(_0x4131c1)['then'](function(_0x2fbed6){_0x4d5b5e=_0x2fbed6;return getUser(_0x4131c1,'',_0x4d5b5e);})[_0xa8bc('0x23')](function(_0xd4cccf){_0x2527b8=_0xd4cccf;logger[_0xa8bc('0x17')](_0xa8bc('0x5d'),_0x2527b8['id']);return getEndUser(_0x4131c1,_0x1943e7[_0xa8bc('0x66')],_0x1943e7['calleridnum'],_0x4d5b5e);})[_0xa8bc('0x23')](function(_0x2882ce){_0x2c91c1=_0x2882ce;logger[_0xa8bc('0x17')](_0xa8bc('0x52'),_0x2c91c1['id']);return createTicket(_0x4131c1,_0x2527b8,_0x2c91c1,_0x3b53c1,_0x1943e7,_0x3b53c1[_0xa8bc('0x53')],_0x4d5b5e);})['then'](function(_0x57355f){_0x154fc0=_0x57355f;logger[_0xa8bc('0x17')]('Ticket\x20created!');logger[_0xa8bc('0x17')](_0xa8bc('0x55'),_0x154fc0['id']);})[_0xa8bc('0x29')](function(_0x287ec8){logger['error']('['+_0x1943e7[_0xa8bc('0x67')][_0xa8bc('0x64')]()+']',JSON[_0xa8bc('0x28')](_0x287ec8));});}; \ No newline at end of file +var _0x2ce9=['calleridname','lastevent','request-promise','bluebird','./util','../../../../config/environment','vTiger','defaults','redis','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','variable','variableName','toString','customVariable','name','Variable','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Descriptions','remoteUri','create','username','HelpDesk','stringify','then','success','resolve','result','format','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','getUser','userId','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/webservice.php','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','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','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridnum','trigger:browser:url','unmanaged','toUpperCase'];(function(_0x186aea,_0x531a10){var _0x946abc=function(_0x10e3bc){while(--_0x10e3bc){_0x186aea['push'](_0x186aea['shift']());}};_0x946abc(++_0x531a10);}(_0x2ce9,0x19a));var _0x92ce=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x2ce9[_0x470e67];return _0x28bbde;};'use strict';var _=require('lodash');var rp=require(_0x92ce('0x0'));var BPromise=require(_0x92ce('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x92ce('0x2'));var config=require(_0x92ce('0x3'));var logger=require('../../../../config/logger')(_0x92ce('0x4'));config['redis']=_[_0x92ce('0x5')](config[_0x92ce('0x6')],{'host':_0x92ce('0x7'),'port':0x18eb});var io=require(_0x92ce('0x8'))(new Redis(config[_0x92ce('0x6')]));function emit(_0xd27d06,_0x440509,_0x3d87f9){io['to'](_0xd27d06)[_0x92ce('0x9')](_0x440509,_0x3d87f9);}function getCustomFields(_0x1217d5,_0x5e0684){var _0x7827e9={};if(_0x1217d5[_0x92ce('0xa')]>0x0){_[_0x92ce('0xb')](_0x1217d5,function(_0x269b6b){if(_0x269b6b[_0x92ce('0xc')]===_0x92ce('0xd')&&_0x269b6b[_0x92ce('0xe')]){_0x7827e9[_0x269b6b[_0x92ce('0xe')]]=_0x269b6b[_0x92ce('0xf')]['toString']();}else if(_0x269b6b['type']===_0x92ce('0x10')&&_0x269b6b[_0x92ce('0x11')]&&_0x269b6b[_0x92ce('0xe')]&&_0x5e0684[_0x269b6b['variableName']]){_0x7827e9[_0x269b6b[_0x92ce('0xe')]]=_0x5e0684[_0x269b6b[_0x92ce('0x11')]][_0x92ce('0x12')]();}else if(_0x269b6b[_0x92ce('0xc')]===_0x92ce('0x13')&&_0x269b6b['Variable']&&_0x269b6b['Variable'][_0x92ce('0x14')]&&_0x269b6b[_0x92ce('0xe')]&&_0x5e0684[_0x269b6b[_0x92ce('0x15')][_0x92ce('0x14')][_0x92ce('0x16')]()]){_0x7827e9[_0x269b6b[_0x92ce('0xe')]]=_0x5e0684[_0x269b6b[_0x92ce('0x15')][_0x92ce('0x14')]['toLowerCase']()][_0x92ce('0x12')]();}});}return _0x7827e9;}function createTicket(_0x479701,_0x10b67d,_0x31e675,_0x89296e,_0x10c3db,_0x118206,_0x305293){logger[_0x92ce('0x17')](_0x92ce('0x18'));var _0x4d11fe=_[_0x92ce('0x19')]({'parent_id':'','assigned_user_id':_0x10b67d['id'],'ticketpriorities':_0x92ce('0x1a'),'ticketstatus':_0x92ce('0x1b'),'ticket_title':intUtil[_0x92ce('0x1c')](_0x89296e['Subjects'],_0x10c3db,'\x20'),'description':intUtil[_0x92ce('0x1c')](_0x89296e[_0x92ce('0x1d')],_0x10c3db,'\x0a'),'contact_id':_0x31e675['id']},getCustomFields(_0x118206,_0x10c3db));var _0x3a78c8={'method':'POST','uri':util['format']('%s/webservice.php',_0x479701[_0x92ce('0x1e')]),'form':{'operation':_0x92ce('0x1f'),'username':_0x479701[_0x92ce('0x20')],'sessionName':_0x305293['sessionName'],'elementType':_0x92ce('0x21'),'element':JSON[_0x92ce('0x22')](_0x4d11fe)},'json':!![]};return request(_0x3a78c8)[_0x92ce('0x23')](function(_0x358522){if(_0x358522[_0x92ce('0x24')]){return BPromise[_0x92ce('0x25')]({'id':_0x358522[_0x92ce('0x26')]['id']});}else{throw new Error(util[_0x92ce('0x27')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x92ce('0x22')](_0x358522[_0x92ce('0x28')])));}})['catch'](function(_0x497c00){var _0x3503e6=_0x497c00[_0x92ce('0x29')]||0x1f4;logger[_0x92ce('0x28')](_0x92ce('0x2a'),_0x92ce('0x2b'),_0x3503e6,JSON[_0x92ce('0x22')](_0x497c00));});}function getUser(_0x21bd39,_0x1f23f2,_0x532221){if(intUtil[_0x92ce('0x2c')](_0x1f23f2)){logger[_0x92ce('0x17')](_0x92ce('0x2d'),_0x1f23f2);return request({'method':_0x92ce('0x2e'),'uri':util[_0x92ce('0x27')]('%s/webservice.php',_0x21bd39[_0x92ce('0x1e')]),'qs':{'operation':'query','username':_0x21bd39[_0x92ce('0x20')],'sessionName':_0x532221[_0x92ce('0x2f')],'query':util['format'](_0x92ce('0x30'),_0x1f23f2)},'json':!![]})['then'](function(_0x10af86){if(_0x10af86[_0x92ce('0x24')]&&_0x10af86[_0x92ce('0x26')]['length']){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x10af86[_0x92ce('0x26')][0x0]['id'],'email':_0x10af86['result'][0x0][_0x92ce('0x31')],'name':_0x10af86['result'][0x0][_0x92ce('0x32')]+'\x20'+_0x10af86[_0x92ce('0x26')][_0x92ce('0x33')]});}else{logger[_0x92ce('0x17')](_0x92ce('0x34'));return BPromise[_0x92ce('0x25')]({'id':_0x532221['userId'],'email':_0x21bd39['username'],'name':_0x92ce('0x35')});}})[_0x92ce('0x36')](function(_0x3c86ed){var _0x2b557b=_0x3c86ed['statusCode']||0x1f4;logger[_0x92ce('0x28')](_0x92ce('0x2a'),_0x92ce('0x37'),_0x2b557b,JSON['stringify'](_0x3c86ed));});}else{logger[_0x92ce('0x17')](_0x92ce('0x34'));return BPromise[_0x92ce('0x25')]({'id':_0x532221[_0x92ce('0x38')],'email':_0x21bd39['username'],'name':_0x92ce('0x35')})[_0x92ce('0x36')](function(_0x4d0934){var _0x67e2ae=_0x4d0934[_0x92ce('0x29')]||0x1f4;logger[_0x92ce('0x28')](_0x92ce('0x2a'),_0x92ce('0x37'),_0x67e2ae,JSON[_0x92ce('0x22')](_0x4d0934));});}}function getEndUser(_0x5f53d5,_0x5cecb0,_0x2e47d5,_0x1d03d0){logger[_0x92ce('0x17')](_0x92ce('0x39'),_0x2e47d5);return request({'method':_0x92ce('0x2e'),'uri':util[_0x92ce('0x27')]('%s/webservice.php',_0x5f53d5[_0x92ce('0x1e')]),'qs':{'operation':_0x92ce('0x3a'),'username':_0x5f53d5['username'],'sessionName':_0x1d03d0['sessionName'],'query':util[_0x92ce('0x27')](_0x92ce('0x3b'),_0x2e47d5,_0x2e47d5,_0x2e47d5,_0x2e47d5,_0x2e47d5)},'json':!![]})['then'](function(_0x498c8a){if(_0x498c8a[_0x92ce('0x24')]&&_0x498c8a[_0x92ce('0x26')][_0x92ce('0xa')]){logger[_0x92ce('0x17')](_0x92ce('0x3c'));return BPromise[_0x92ce('0x25')]({'id':_0x498c8a[_0x92ce('0x26')][0x0]['id'],'name':_0x498c8a[_0x92ce('0x26')][0x0][_0x92ce('0x3d')]+'\x20'+_0x498c8a[_0x92ce('0x26')][0x0]['lastname'],'phone':_0x2e47d5});}else{logger[_0x92ce('0x17')](_0x92ce('0x3e'));return request({'method':'POST','uri':util['format'](_0x92ce('0x3f'),_0x5f53d5[_0x92ce('0x1e')]),'form':{'operation':_0x92ce('0x1f'),'sessionName':_0x1d03d0[_0x92ce('0x2f')],'elementType':'Contacts','element':JSON[_0x92ce('0x22')]({'lastname':_0x5cecb0,'phone':_0x2e47d5,'assigned_user_id':'\x20'})},'json':!![]})[_0x92ce('0x23')](function(_0x51a14c){logger[_0x92ce('0x17')](_0x92ce('0x40'));return BPromise[_0x92ce('0x25')]({'id':_0x51a14c[_0x92ce('0x26')]['id'],'name':_0x51a14c['result'][_0x92ce('0x41')],'phone':_0x51a14c[_0x92ce('0x26')][_0x92ce('0x42')]});})[_0x92ce('0x36')](function(_0x17b86e){var _0x22fe24=_0x17b86e[_0x92ce('0x29')]||0x1f4;logger['error'](_0x92ce('0x2a'),_0x92ce('0x43'),_0x22fe24,JSON[_0x92ce('0x22')](_0x17b86e));});}});}function getConnection(_0x4beb5c){var _0x445cb6=_0x4beb5c[_0x92ce('0x20')];var _0x1b64b9=_0x4beb5c['accessKey'];return request({'method':_0x92ce('0x2e'),'uri':util[_0x92ce('0x27')]('%s/webservice.php',_0x4beb5c['remoteUri']),'qs':{'operation':_0x92ce('0x44'),'username':_0x445cb6},'json':!![]})[_0x92ce('0x23')](function(_0x453e20){if(_0x453e20[_0x92ce('0x24')]){return request({'method':'POST','uri':util[_0x92ce('0x27')](_0x92ce('0x3f'),_0x4beb5c['remoteUri']),'form':{'operation':_0x92ce('0x45'),'username':_0x445cb6,'accessKey':md5(_0x453e20[_0x92ce('0x26')][_0x92ce('0x46')]+_0x1b64b9)},'json':!![]});}})[_0x92ce('0x23')](function(_0x2044bb){if(_0x2044bb[_0x92ce('0x24')]){return BPromise[_0x92ce('0x25')](_0x2044bb[_0x92ce('0x26')]);}else{throw new Error(util[_0x92ce('0x27')](_0x92ce('0x47'),_0x4beb5c['id']));}})[_0x92ce('0x36')](function(_0x208407){var _0x560876=_0x208407['statusCode']||0x1f4;logger[_0x92ce('0x28')](_0x92ce('0x2a'),_0x92ce('0x48'),_0x560876,JSON[_0x92ce('0x22')](_0x208407));});}function request(_0x19c403){logger[_0x92ce('0x17')]('[HTTP]',JSON[_0x92ce('0x22')](_0x19c403));return rp(_0x19c403);}exports[_0x92ce('0x49')]=function(_0x557679,_0x1b0220,_0x548a96,_0x44810d,_0x154aa8,_0xc3d44c){var _0x3af9c3,_0x5729ae,_0x2d135d,_0x109012;_0xc3d44c[_0x92ce('0x1e')]=intUtil['stripTrailingSlash'](_0xc3d44c[_0x92ce('0x1e')]);if(_0x154aa8&&_0x154aa8[_0x92ce('0x4a')]){logger[_0x92ce('0x17')](_0x92ce('0x4b'),_0x92ce('0x4c'));_0x1b0220[_0x92ce('0x4d')]=util[_0x92ce('0x27')](_0x92ce('0x4e'),_0xc3d44c[_0x92ce('0x4f')],_0x1b0220[_0x92ce('0x50')],md5(_0x1b0220[_0x92ce('0x50')]));}else{_0x1b0220[_0x92ce('0x4d')]='';}return getConnection(_0xc3d44c)['then'](function(_0x15e726){_0x109012=_0x15e726;return getUser(_0xc3d44c,_0x44810d[_0x92ce('0x51')],_0x109012);})[_0x92ce('0x23')](function(_0xa21c04){_0x3af9c3=_0xa21c04;logger[_0x92ce('0x17')](_0x92ce('0x52'),_0x3af9c3['id']);return getEndUser(_0xc3d44c,_0x1b0220['calleridname'],_0x1b0220[_0x92ce('0x53')],_0x109012);})[_0x92ce('0x23')](function(_0x2610af){_0x5729ae=_0x2610af;logger[_0x92ce('0x17')](_0x92ce('0x54'),_0x5729ae['id']);return createTicket(_0xc3d44c,_0x3af9c3,_0x5729ae,_0x548a96,_0x1b0220,_0x548a96[_0x92ce('0x55')],_0x109012);})[_0x92ce('0x23')](function(_0x537cb7){_0x2d135d=_0x537cb7;logger[_0x92ce('0x17')](_0x92ce('0x56'));logger[_0x92ce('0x17')](_0x92ce('0x57'),_0x2d135d['id']);var _0x21e898=util[_0x92ce('0x27')](_0x92ce('0x58'),_0xc3d44c[_0x92ce('0x1e')],_[_0x92ce('0x59')](_0x2d135d['id'],'x')[0x1]);logger[_0x92ce('0x17')](_0x92ce('0x4b'),_0x92ce('0x5a'));emit(util['format'](_0x92ce('0x5b'),_0x44810d[_0x92ce('0x14')]),'trigger:browser:url',{'uri':_0x21e898});})['catch'](function(_0x31cb1f){logger[_0x92ce('0x28')](_0x92ce('0x4b'),JSON[_0x92ce('0x22')](_0x31cb1f));});};exports['outbound']=function(_0x1fa40a,_0x30b8e9,_0x4d42b1,_0x871151,_0x33593f,_0x1ba9fb,_0xb3930e){var _0x26ba4c,_0x40651b,_0x78d13f,_0x811f04;_0x1ba9fb['remoteUri']=intUtil[_0x92ce('0x5c')](_0x1ba9fb[_0x92ce('0x1e')]);_0x1ba9fb[_0x92ce('0x4f')]=intUtil[_0x92ce('0x5c')](_0x1ba9fb['serverUrl']);if(_0xb3930e&&_0xb3930e[_0x92ce('0x5d')]&&_0xb3930e[_0x92ce('0x5d')]!==_0x92ce('0x5e')){logger[_0x92ce('0x17')](_0x92ce('0x5f'),_0x92ce('0x4c'));_0x30b8e9[_0x92ce('0x4d')]=util[_0x92ce('0x27')](_0x92ce('0x4e'),_0x1ba9fb[_0x92ce('0x4f')],_0x30b8e9[_0x92ce('0x50')],md5(_0x30b8e9[_0x92ce('0x50')]));}return getConnection(_0x1ba9fb)['then'](function(_0x3959c3){_0x811f04=_0x3959c3;return getUser(_0x1ba9fb,_0x871151[_0x92ce('0x51')],_0x811f04);})[_0x92ce('0x23')](function(_0x5c04f5){_0x26ba4c=_0x5c04f5;logger['info'](_0x92ce('0x52'),_0x26ba4c['id']);return getEndUser(_0x1ba9fb,_0x30b8e9['destcalleridname'],_0x30b8e9[_0x92ce('0x60')],_0x811f04);})[_0x92ce('0x23')](function(_0x33841b){_0x40651b=_0x33841b;logger['info'](_0x92ce('0x54'),_0x40651b['id']);return createTicket(_0x1ba9fb,_0x26ba4c,_0x40651b,_0x4d42b1,_0x30b8e9,_0x4d42b1[_0x92ce('0x55')],_0x811f04);})[_0x92ce('0x23')](function(_0x3b188a){_0x78d13f=_0x3b188a;logger[_0x92ce('0x17')](_0x92ce('0x56'));logger['info'](_0x92ce('0x57'),_0x78d13f['id']);var _0x35fabe=util[_0x92ce('0x27')](_0x92ce('0x58'),_0x1ba9fb[_0x92ce('0x1e')],_['split'](_0x78d13f['id'],'x')[0x1]);logger[_0x92ce('0x17')](_0x92ce('0x5f'),_0x92ce('0x5a'));emit(util['format'](_0x92ce('0x5b'),_0x871151[_0x92ce('0x14')]),_0x92ce('0x61'),{'uri':_0x35fabe});})[_0x92ce('0x36')](function(_0x5f25c1){logger[_0x92ce('0x28')](_0x92ce('0x5f'),JSON[_0x92ce('0x22')](_0x5f25c1));});};exports[_0x92ce('0x62')]=function(_0x37b1ba,_0x36bf2a,_0x40a11d,_0x1e1e28,_0x163dd4,_0x4fa5b5){var _0x120537,_0x5e8b50,_0x84fc46,_0x2c87f6;_0x4fa5b5['remoteUri']=intUtil[_0x92ce('0x5c')](_0x4fa5b5['remoteUri']);_0x4fa5b5[_0x92ce('0x4f')]=intUtil[_0x92ce('0x5c')](_0x4fa5b5[_0x92ce('0x4f')]);if(_0x163dd4&&_0x163dd4['monitor_format']){logger[_0x92ce('0x17')]('['+_0x36bf2a['lastevent'][_0x92ce('0x63')]()+']',_0x92ce('0x4c'));_0x36bf2a['recordingURL']=util[_0x92ce('0x27')](_0x92ce('0x4e'),_0x4fa5b5[_0x92ce('0x4f')],_0x36bf2a[_0x92ce('0x50')],md5(_0x36bf2a[_0x92ce('0x50')]));}else{_0x36bf2a[_0x92ce('0x4d')]='';}return getConnection(_0x4fa5b5)['then'](function(_0x508839){_0x2c87f6=_0x508839;return getUser(_0x4fa5b5,'',_0x2c87f6);})[_0x92ce('0x23')](function(_0x3793a2){_0x120537=_0x3793a2;logger['info']('The\x20User\x20ID\x20is:',_0x120537['id']);return getEndUser(_0x4fa5b5,_0x36bf2a[_0x92ce('0x64')],_0x36bf2a[_0x92ce('0x53')],_0x2c87f6);})[_0x92ce('0x23')](function(_0x1efe68){_0x5e8b50=_0x1efe68;logger['info'](_0x92ce('0x54'),_0x5e8b50['id']);return createTicket(_0x4fa5b5,_0x120537,_0x5e8b50,_0x40a11d,_0x36bf2a,_0x40a11d[_0x92ce('0x55')],_0x2c87f6);})[_0x92ce('0x23')](function(_0x552f08){_0x84fc46=_0x552f08;logger[_0x92ce('0x17')](_0x92ce('0x56'));logger[_0x92ce('0x17')](_0x92ce('0x57'),_0x84fc46['id']);})['catch'](function(_0x11afb6){logger['error']('['+_0x36bf2a[_0x92ce('0x65')][_0x92ce('0x63')]()+']',JSON[_0x92ce('0x22')](_0x11afb6));});}; \ 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 78a19b6..1986941 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 _0x6ae2=['Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','emit','application/json','Creating\x20new\x20ticket...','%s/tickets.json','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','forEach','type','string','toLowerCase','content','customField','custom_fields','push','idField','variableName','customVariable'];(function(_0x3e978c,_0x1d5774){var _0x295585=function(_0x309460){while(--_0x309460){_0x3e978c['push'](_0x3e978c['shift']());}};_0x295585(++_0x1d5774);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x198a60,_0x33fca7){_0x198a60=_0x198a60-0x0;var _0x45dfa8=_0x6ae2[_0x198a60];return _0x45dfa8;};'use strict';var _=require(_0x26ae('0x0'));var rp=require(_0x26ae('0x1'));var md5=require(_0x26ae('0x2'));var util=require(_0x26ae('0x3'));var Redis=require(_0x26ae('0x4'));var intUtil=require(_0x26ae('0x5'));var config=require(_0x26ae('0x6'));var logger=require(_0x26ae('0x7'))(_0x26ae('0x8'));config['redis']=_[_0x26ae('0x9')](config[_0x26ae('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26ae('0xa')]));function emit(_0xde4226,_0x473907,_0x151de3){io['to'](_0xde4226)[_0x26ae('0xb')](_0x473907,_0x151de3);}var headers={'Content-Type':_0x26ae('0xc'),'Accept':_0x26ae('0xc')};function getTicket(_0x4b3eca,_0x3d165a,_0x18baac,_0x1f8dff,_0x4061ad){logger['info'](_0x26ae('0xd'));return request({'uri':util['format'](_0x26ae('0xe'),_0x4b3eca['remoteUri']),'method':'POST','body':{'ticket':_[_0x26ae('0xf')]({'requester_id':_0x18baac['id'],'submitter_id':_0x3d165a?_0x3d165a['id']:undefined,'assignee_id':_0x3d165a?_0x3d165a['id']:undefined,'tags':getTags(_0x1f8dff[_0x26ae('0x10')],_0x26ae('0x11')),'subject':intUtil[_0x26ae('0x12')](_0x1f8dff[_0x26ae('0x13')],_0x4061ad,'\x20'),'description':intUtil[_0x26ae('0x12')](_0x1f8dff[_0x26ae('0x14')],_0x4061ad,'\x0a'),'comment':{'public':![],'body':intUtil[_0x26ae('0x12')](_0x1f8dff[_0x26ae('0x14')],_0x4061ad,'\x0a')}},getCustomFields(_0x1f8dff[_0x26ae('0x15')],_0x4061ad))}})[_0x26ae('0x16')](function(_0xe264da){logger['info'](_0x26ae('0x17'));return _0xe264da[_0x26ae('0x18')];});}function getUser(_0x497974,_0x444397){if(intUtil[_0x26ae('0x19')](_0x444397)){logger[_0x26ae('0x1a')](_0x26ae('0x1b'),_0x444397);return request({'uri':util[_0x26ae('0x1c')](_0x26ae('0x1d'),_0x497974[_0x26ae('0x1e')]),'qs':{'query':util[_0x26ae('0x1c')](_0x26ae('0x1f'),_0x444397)}})[_0x26ae('0x16')](function(_0x1e5cf5){if(_0x1e5cf5[_0x26ae('0x20')]){logger[_0x26ae('0x1a')](_0x26ae('0x21'));return _[_0x26ae('0x22')](_0x1e5cf5[_0x26ae('0x23')],{'email':_0x444397,'role':_0x26ae('0x24')});}else{logger[_0x26ae('0x1a')](_0x26ae('0x25'));return request({'uri':util[_0x26ae('0x1c')](_0x26ae('0x26'),_0x497974['remoteUri'])})['then'](function(_0x2a2ba5){logger['info'](_0x26ae('0x27'));return _0x2a2ba5['user'];});}});}else{logger[_0x26ae('0x1a')](_0x26ae('0x25'));return request({'uri':util[_0x26ae('0x1c')]('%s/users/me.json',_0x497974['remoteUri'])})[_0x26ae('0x16')](function(_0x377a09){logger[_0x26ae('0x1a')]('Admin\x20account\x20selected.');return _0x377a09[_0x26ae('0x28')];});}}function getEndUser(_0x295cc2,_0x53e0da,_0x1a0a32){logger[_0x26ae('0x1a')](_0x26ae('0x29'),_0x1a0a32);return request({'uri':util['format'](_0x26ae('0x1d'),_0x295cc2['remoteUri']),'qs':{'query':util[_0x26ae('0x1c')](_0x26ae('0x2a'),_0x1a0a32)}})[_0x26ae('0x16')](function(_0x4cef91){var _0x29eeb4;if(_0x4cef91['results']['length']){_0x4cef91[_0x26ae('0x23')]=_[_0x26ae('0x2b')](_0x4cef91['results'],{'suspended':![],'role':_0x26ae('0x2c')});if(_0x4cef91[_0x26ae('0x23')][_0x26ae('0x2d')]){_0x29eeb4=_[_0x26ae('0x2e')](_0x4cef91[_0x26ae('0x23')]);}}if(_0x29eeb4){logger['info'](_0x26ae('0x2f'));return _0x29eeb4;}else{logger[_0x26ae('0x1a')](_0x26ae('0x30'));return request({'uri':util[_0x26ae('0x1c')](_0x26ae('0x31'),_0x295cc2['remoteUri']),'method':_0x26ae('0x32'),'body':{'user':{'role':_0x26ae('0x2c'),'name':util[_0x26ae('0x1c')](_0x26ae('0x33'),_0x53e0da||_0x1a0a32),'phone':_0x1a0a32}}})[_0x26ae('0x16')](function(_0x298df4){logger[_0x26ae('0x1a')](_0x26ae('0x34'));return _0x298df4['user'];});}});}function getAuth(_0x170dd4){var _0x543044;if(_0x170dd4['authType']===_0x26ae('0x35')){_0x543044=util[_0x26ae('0x1c')](_0x26ae('0x36'),_0x170dd4['username'],_0x170dd4[_0x26ae('0x35')]);}else if(_0x170dd4[_0x26ae('0x37')]===_0x26ae('0x38')){_0x543044=util[_0x26ae('0x1c')](_0x26ae('0x39'),_0x170dd4[_0x26ae('0x3a')],_0x170dd4[_0x26ae('0x38')]);}return util[_0x26ae('0x1c')](_0x26ae('0x3b'),new Buffer(_0x543044)[_0x26ae('0x3c')](_0x26ae('0x3d')));}function request(_0x778a7a){logger[_0x26ae('0x3e')](_0x26ae('0x3f'),JSON['stringify'](_0x778a7a));return rp(_[_0x26ae('0x9')](_0x778a7a,{'method':_0x26ae('0x40'),'headers':headers,'json':!![]}));}function getTags(_0x2e5d70,_0x484dec){var _0x20c60a=[];if(_0x2e5d70&&_0x2e5d70[_0x26ae('0x2d')]>0x0){_0x20c60a=_[_0x26ae('0x41')](_0x2e5d70,_0x484dec);}return _0x20c60a;}function getCustomFields(_0x40c3df,_0xf4a40f){var _0x4e3f44=[];var _0x3d4e10={'custom_fields':[]};if(_0x40c3df[_0x26ae('0x2d')]>0x0){_[_0x26ae('0x42')](_0x40c3df,function(_0x2ef6f4){if(_0x2ef6f4[_0x26ae('0x43')]===_0x26ae('0x44')&&_0x2ef6f4['nameField']&&!_0x2ef6f4['customField']){_0x3d4e10[_0x2ef6f4['nameField'][_0x26ae('0x45')]()]=_0x2ef6f4[_0x26ae('0x46')][_0x26ae('0x3c')]();}else if(_0x2ef6f4[_0x26ae('0x43')]===_0x26ae('0x44')&&_0x2ef6f4['idField']&&_0x2ef6f4[_0x26ae('0x47')]){_0x3d4e10[_0x26ae('0x48')][_0x26ae('0x49')]({'id':_0x2ef6f4[_0x26ae('0x4a')],'value':_0x2ef6f4[_0x26ae('0x46')][_0x26ae('0x3c')]()});}else if(_0x2ef6f4[_0x26ae('0x43')]==='variable'&&_0x2ef6f4[_0x26ae('0x4b')]&&_0x2ef6f4[_0x26ae('0x4a')]&&_0x2ef6f4['customField']){_0xf4a40f[_0x2ef6f4[_0x26ae('0x4b')]]&&_0x3d4e10['custom_fields'][_0x26ae('0x49')]({'id':_0x2ef6f4[_0x26ae('0x4a')],'value':_0xf4a40f[_0x2ef6f4[_0x26ae('0x4b')]]['toString']()});}else if(_0x2ef6f4[_0x26ae('0x43')]===_0x26ae('0x4c')&&_0x2ef6f4[_0x26ae('0x4d')]&&_0x2ef6f4[_0x26ae('0x4d')][_0x26ae('0x11')]&&_0x2ef6f4[_0x26ae('0x4a')]&&_0x2ef6f4['customField']){_0xf4a40f[_0x2ef6f4['Variable']['name'][_0x26ae('0x45')]()]&&_0x3d4e10[_0x26ae('0x48')][_0x26ae('0x49')]({'id':_0x2ef6f4[_0x26ae('0x4a')],'value':_0xf4a40f[_0x2ef6f4[_0x26ae('0x4d')]['name']['toLowerCase']()][_0x26ae('0x3c')]()});}});}return _0x3d4e10;}exports[_0x26ae('0x4e')]=function(_0x686879,_0x4d0093,_0x434396,_0x50317d,_0xcbc76e,_0x42d40b){var _0x53f9d1,_0x507d42;_0x42d40b[_0x26ae('0x1e')]=intUtil['stripTrailingSlash'](_0x42d40b[_0x26ae('0x1e')]);_0x42d40b[_0x26ae('0x4f')]=intUtil[_0x26ae('0x50')](_0x42d40b[_0x26ae('0x4f')]);if(_0xcbc76e&&_0xcbc76e[_0x26ae('0x51')]){logger[_0x26ae('0x1a')](_0x26ae('0x52'),_0x26ae('0x53'));_0x4d0093[_0x26ae('0x54')]=util[_0x26ae('0x1c')](_0x26ae('0x55'),_0x42d40b['serverUrl'],_0x4d0093[_0x26ae('0x56')],md5(_0x4d0093[_0x26ae('0x56')]));}else{_0x4d0093[_0x26ae('0x54')]='';}headers[_0x26ae('0x57')]=getAuth(_0x42d40b);return getUser(_0x42d40b,_0x50317d[_0x26ae('0x58')])[_0x26ae('0x16')](function(_0x2af049){_0x53f9d1=_0x2af049;logger[_0x26ae('0x1a')](_0x26ae('0x59'),_0x53f9d1['id']);return getEndUser(_0x42d40b,_0x4d0093[_0x26ae('0x5a')],_0x4d0093[_0x26ae('0x5b')]);})[_0x26ae('0x16')](function(_0x2790de){_0x507d42=_0x2790de;logger['info'](_0x26ae('0x5c'),_0x507d42['id']);return getTicket(_0x42d40b,_0x53f9d1,_0x507d42,_0x434396,_0x4d0093);})['then'](function(_0x3dd581){if(_0x3dd581){logger[_0x26ae('0x1a')](_0x26ae('0x5d'),_0x3dd581['id']);switch(_0x42d40b[_0x26ae('0x43')]){case _0x26ae('0x5e'):logger[_0x26ae('0x1a')]('[QUEUE]',_0x26ae('0x5f'));return request({'uri':util['format'](_0x26ae('0x60'),_0x42d40b['remoteUri'],_0x53f9d1['id'],_0x3dd581['id']),'method':_0x26ae('0x32')});case _0x26ae('0x61'):logger['info'](_0x26ae('0x52'),_0x26ae('0x62'));emit(util[_0x26ae('0x1c')](_0x26ae('0x63'),_0x50317d[_0x26ae('0x11')]),'trigger:browser:url',{'uri':util['format'](_0x26ae('0x64'),_0x42d40b[_0x26ae('0x1e')],_0x3dd581['id'])});break;default:logger['error'](_0x26ae('0x52'),_0x26ae('0x65'));}}})[_0x26ae('0x66')](function(_0x51b9ec){logger[_0x26ae('0x67')](_0x26ae('0x68'),util[_0x26ae('0x69')](_0x51b9ec,{'showHidden':!![],'depth':null}));});};exports[_0x26ae('0x6a')]=function(_0x1c47e9,_0xe4f3a3,_0x162d68,_0x2312e4,_0x3ca5a1,_0x4302a6,_0x3e4506){var _0x441a74,_0x38815a;_0x4302a6[_0x26ae('0x1e')]=intUtil[_0x26ae('0x50')](_0x4302a6[_0x26ae('0x1e')]);_0x4302a6[_0x26ae('0x4f')]=intUtil[_0x26ae('0x50')](_0x4302a6[_0x26ae('0x4f')]);if(_0x3e4506&&_0x3e4506[_0x26ae('0x6b')]&&_0x3e4506['recordingFormat']!=='none'){logger[_0x26ae('0x1a')](_0x26ae('0x6c'),_0x26ae('0x53'));_0xe4f3a3['recordingURL']=util[_0x26ae('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4302a6[_0x26ae('0x4f')],_0xe4f3a3[_0x26ae('0x56')],md5(_0xe4f3a3['uniqueid']));}headers[_0x26ae('0x57')]=getAuth(_0x4302a6);return getUser(_0x4302a6,_0x2312e4[_0x26ae('0x58')])[_0x26ae('0x16')](function(_0x2cfd47){_0x441a74=_0x2cfd47;logger[_0x26ae('0x1a')](_0x26ae('0x59'),_0x441a74['id']);return getEndUser(_0x4302a6,_0xe4f3a3[_0x26ae('0x6d')],_0xe4f3a3[_0x26ae('0x6e')]);})[_0x26ae('0x16')](function(_0x4c183a){_0x38815a=_0x4c183a;logger[_0x26ae('0x1a')](_0x26ae('0x5c'),_0x38815a['id']);return getTicket(_0x4302a6,_0x441a74,_0x38815a,_0x162d68,_0xe4f3a3);})[_0x26ae('0x16')](function(_0x1a99a2){if(_0x1a99a2){logger[_0x26ae('0x1a')]('The\x20Ticket\x20ID\x20is:',_0x1a99a2['id']);switch(_0x4302a6[_0x26ae('0x43')]){case'integrationTab':logger[_0x26ae('0x1a')]('[OUTBOUND]',_0x26ae('0x5f'));return request({'uri':util[_0x26ae('0x1c')](_0x26ae('0x60'),_0x4302a6[_0x26ae('0x1e')],_0x441a74['id'],_0x1a99a2['id']),'method':_0x26ae('0x32')});case'newTab':logger['info'](_0x26ae('0x6c'),_0x26ae('0x62'));emit(util[_0x26ae('0x1c')]('user:%s',_0x2312e4['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x4302a6[_0x26ae('0x1e')],_0x1a99a2['id'])});break;default:logger['error'](_0x26ae('0x6c'),_0x26ae('0x65'));}}})['catch'](function(_0x285db3){logger[_0x26ae('0x67')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x26ae('0x69')](_0x285db3,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3f071f,_0x27e66f,_0xea38b5,_0x3990c3,_0x475376,_0x1d890c){var _0x2dea1f,_0x2d3685;_0x1d890c[_0x26ae('0x1e')]=intUtil['stripTrailingSlash'](_0x1d890c['remoteUri']);_0x1d890c[_0x26ae('0x4f')]=intUtil[_0x26ae('0x50')](_0x1d890c[_0x26ae('0x4f')]);if(_0x475376&&_0x475376[_0x26ae('0x51')]){logger[_0x26ae('0x1a')]('['+_0x27e66f[_0x26ae('0x6f')][_0x26ae('0x70')]()+']',_0x26ae('0x53'));_0x27e66f[_0x26ae('0x54')]=util[_0x26ae('0x1c')](_0x26ae('0x55'),_0x1d890c['serverUrl'],_0x27e66f['uniqueid'],md5(_0x27e66f['uniqueid']));}else{_0x27e66f[_0x26ae('0x54')]='';}headers[_0x26ae('0x57')]=getAuth(_0x1d890c);return getUser(_0x1d890c)['then'](function(_0x5ab688){_0x2dea1f=_0x5ab688;logger['info']('The\x20User\x20ID\x20is:',_0x2dea1f['id']);return getEndUser(_0x1d890c,_0x27e66f[_0x26ae('0x5a')],_0x27e66f[_0x26ae('0x5b')]);})['then'](function(_0x4ec8e7){_0x2d3685=_0x4ec8e7;logger[_0x26ae('0x1a')](_0x26ae('0x5c'),_0x2d3685['id']);return getTicket(_0x1d890c,_0x2dea1f,_0x2d3685,_0xea38b5,_0x27e66f);})[_0x26ae('0x16')](function(_0x33be99){if(_0x33be99){logger[_0x26ae('0x1a')](_0x26ae('0x5d'),_0x33be99['id']);}})[_0x26ae('0x66')](function(_0x479647){logger[_0x26ae('0x67')]('['+_0x27e66f[_0x26ae('0x6f')]['toUpperCase']()+']'+_0x26ae('0x71'),util[_0x26ae('0x69')](_0x479647,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xaa88=['remoteUri','merge','Tags','name','Subjects','getString','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','results','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','Enduser\x20created.','user','password','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','base64','debug','GET','map','forEach','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','toString','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','Recording\x20is\x20enabled!','destcalleridnum','[OUTBOUND]','newTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaa88,0x137));var _0x8aa8=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0xaa88[_0xa990b7];return _0x52c99c;};'use strict';var _=require(_0x8aa8('0x0'));var rp=require(_0x8aa8('0x1'));var md5=require(_0x8aa8('0x2'));var util=require(_0x8aa8('0x3'));var Redis=require('ioredis');var intUtil=require(_0x8aa8('0x4'));var config=require(_0x8aa8('0x5'));var logger=require(_0x8aa8('0x6'))(_0x8aa8('0x7'));config[_0x8aa8('0x8')]=_[_0x8aa8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8aa8('0xa'))(new Redis(config['redis']));function emit(_0x449d2d,_0x1ed84d,_0x27c08d){io['to'](_0x449d2d)[_0x8aa8('0xb')](_0x1ed84d,_0x27c08d);}var headers={'Content-Type':'application/json','Accept':_0x8aa8('0xc')};function getTicket(_0x2d974c,_0x224f25,_0x5c94d4,_0x4702ab,_0x9f78f5){logger[_0x8aa8('0xd')](_0x8aa8('0xe'));return request({'uri':util['format'](_0x8aa8('0xf'),_0x2d974c[_0x8aa8('0x10')]),'method':'POST','body':{'ticket':_[_0x8aa8('0x11')]({'requester_id':_0x5c94d4['id'],'submitter_id':_0x224f25?_0x224f25['id']:undefined,'assignee_id':_0x224f25?_0x224f25['id']:undefined,'tags':getTags(_0x4702ab[_0x8aa8('0x12')],_0x8aa8('0x13')),'subject':intUtil['getString'](_0x4702ab[_0x8aa8('0x14')],_0x9f78f5,'\x20'),'description':intUtil[_0x8aa8('0x15')](_0x4702ab[_0x8aa8('0x16')],_0x9f78f5,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4702ab[_0x8aa8('0x16')],_0x9f78f5,'\x0a')}},getCustomFields(_0x4702ab['Fields'],_0x9f78f5))}})['then'](function(_0x433e95){logger[_0x8aa8('0xd')](_0x8aa8('0x17'));return _0x433e95[_0x8aa8('0x18')];});}function getUser(_0x42a6a4,_0x3778f4){if(intUtil[_0x8aa8('0x19')](_0x3778f4)){logger[_0x8aa8('0xd')](_0x8aa8('0x1a'),_0x3778f4);return request({'uri':util['format']('%s/search.json',_0x42a6a4[_0x8aa8('0x10')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x3778f4)}})[_0x8aa8('0x1b')](function(_0x5ac0d9){if(_0x5ac0d9[_0x8aa8('0x1c')]){logger[_0x8aa8('0xd')](_0x8aa8('0x1d'));return _[_0x8aa8('0x1e')](_0x5ac0d9['results'],{'email':_0x3778f4,'role':_0x8aa8('0x1f')});}else{logger[_0x8aa8('0xd')](_0x8aa8('0x20'));return request({'uri':util[_0x8aa8('0x21')](_0x8aa8('0x22'),_0x42a6a4[_0x8aa8('0x10')])})['then'](function(_0x26cf63){logger['info'](_0x8aa8('0x23'));return _0x26cf63['user'];});}});}else{logger[_0x8aa8('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8aa8('0x21')](_0x8aa8('0x22'),_0x42a6a4[_0x8aa8('0x10')])})['then'](function(_0x24f428){logger[_0x8aa8('0xd')](_0x8aa8('0x23'));return _0x24f428['user'];});}}function getEndUser(_0x57acd2,_0x2d1508,_0x44e2d8){logger[_0x8aa8('0xd')](_0x8aa8('0x24'),_0x44e2d8);return request({'uri':util[_0x8aa8('0x21')]('%s/search.json',_0x57acd2[_0x8aa8('0x10')]),'qs':{'query':util['format'](_0x8aa8('0x25'),_0x44e2d8)}})[_0x8aa8('0x1b')](function(_0x15ff33){var _0x519ac0;if(_0x15ff33['results'][_0x8aa8('0x26')]){_0x15ff33['results']=_[_0x8aa8('0x27')](_0x15ff33[_0x8aa8('0x28')],{'suspended':![],'role':_0x8aa8('0x29')});if(_0x15ff33[_0x8aa8('0x28')][_0x8aa8('0x26')]){_0x519ac0=_['first'](_0x15ff33[_0x8aa8('0x28')]);}}if(_0x519ac0){logger[_0x8aa8('0xd')]('Enduser\x20found!');return _0x519ac0;}else{logger[_0x8aa8('0xd')](_0x8aa8('0x2a'));return request({'uri':util[_0x8aa8('0x21')]('%s/users.json',_0x57acd2[_0x8aa8('0x10')]),'method':_0x8aa8('0x2b'),'body':{'user':{'role':_0x8aa8('0x29'),'name':util[_0x8aa8('0x21')](_0x8aa8('0x2c'),_0x2d1508||_0x44e2d8),'phone':_0x44e2d8}}})[_0x8aa8('0x1b')](function(_0x370401){logger[_0x8aa8('0xd')](_0x8aa8('0x2d'));return _0x370401[_0x8aa8('0x2e')];});}});}function getAuth(_0x3e069a){var _0x5bf1a7;if(_0x3e069a['authType']===_0x8aa8('0x2f')){_0x5bf1a7=util[_0x8aa8('0x21')](_0x8aa8('0x30'),_0x3e069a[_0x8aa8('0x31')],_0x3e069a[_0x8aa8('0x2f')]);}else if(_0x3e069a[_0x8aa8('0x32')]==='token'){_0x5bf1a7=util['format'](_0x8aa8('0x33'),_0x3e069a['username'],_0x3e069a[_0x8aa8('0x34')]);}return util[_0x8aa8('0x21')](_0x8aa8('0x35'),new Buffer(_0x5bf1a7)['toString'](_0x8aa8('0x36')));}function request(_0x38b8d4){logger[_0x8aa8('0x37')]('[HTTP]',JSON['stringify'](_0x38b8d4));return rp(_[_0x8aa8('0x9')](_0x38b8d4,{'method':_0x8aa8('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x52f87d,_0x24eb18){var _0x2e1f52=[];if(_0x52f87d&&_0x52f87d['length']>0x0){_0x2e1f52=_[_0x8aa8('0x39')](_0x52f87d,_0x24eb18);}return _0x2e1f52;}function getCustomFields(_0x48c3ba,_0x530a66){var _0x2f8f19=[];var _0x5537ff={'custom_fields':[]};if(_0x48c3ba[_0x8aa8('0x26')]>0x0){_[_0x8aa8('0x3a')](_0x48c3ba,function(_0x926ff2){if(_0x926ff2[_0x8aa8('0x3b')]==='string'&&_0x926ff2[_0x8aa8('0x3c')]&&!_0x926ff2[_0x8aa8('0x3d')]){_0x5537ff[_0x926ff2['nameField'][_0x8aa8('0x3e')]()]=_0x926ff2[_0x8aa8('0x3f')]['toString']();}else if(_0x926ff2[_0x8aa8('0x3b')]===_0x8aa8('0x40')&&_0x926ff2[_0x8aa8('0x41')]&&_0x926ff2[_0x8aa8('0x3d')]){_0x5537ff[_0x8aa8('0x42')][_0x8aa8('0x43')]({'id':_0x926ff2[_0x8aa8('0x41')],'value':_0x926ff2[_0x8aa8('0x3f')][_0x8aa8('0x44')]()});}else if(_0x926ff2[_0x8aa8('0x3b')]===_0x8aa8('0x45')&&_0x926ff2[_0x8aa8('0x46')]&&_0x926ff2[_0x8aa8('0x41')]&&_0x926ff2[_0x8aa8('0x3d')]){_0x530a66[_0x926ff2[_0x8aa8('0x46')]]&&_0x5537ff[_0x8aa8('0x42')]['push']({'id':_0x926ff2[_0x8aa8('0x41')],'value':_0x530a66[_0x926ff2['variableName']]['toString']()});}else if(_0x926ff2['type']===_0x8aa8('0x47')&&_0x926ff2['Variable']&&_0x926ff2['Variable'][_0x8aa8('0x13')]&&_0x926ff2['idField']&&_0x926ff2[_0x8aa8('0x3d')]){_0x530a66[_0x926ff2['Variable']['name'][_0x8aa8('0x3e')]()]&&_0x5537ff[_0x8aa8('0x42')][_0x8aa8('0x43')]({'id':_0x926ff2[_0x8aa8('0x41')],'value':_0x530a66[_0x926ff2[_0x8aa8('0x48')][_0x8aa8('0x13')][_0x8aa8('0x3e')]()]['toString']()});}});}return _0x5537ff;}exports[_0x8aa8('0x49')]=function(_0x53a7a4,_0x2aec13,_0x1367db,_0x44ba22,_0x2bc6d3,_0x2a0a14){var _0x44f2b4,_0x5adcda;_0x2a0a14['remoteUri']=intUtil[_0x8aa8('0x4a')](_0x2a0a14[_0x8aa8('0x10')]);_0x2a0a14['serverUrl']=intUtil[_0x8aa8('0x4a')](_0x2a0a14[_0x8aa8('0x4b')]);if(_0x2bc6d3&&_0x2bc6d3[_0x8aa8('0x4c')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x2aec13['recordingURL']=util[_0x8aa8('0x21')](_0x8aa8('0x4d'),_0x2a0a14['serverUrl'],_0x2aec13[_0x8aa8('0x4e')],md5(_0x2aec13[_0x8aa8('0x4e')]));}else{_0x2aec13[_0x8aa8('0x4f')]='';}headers[_0x8aa8('0x50')]=getAuth(_0x2a0a14);return getUser(_0x2a0a14,_0x44ba22[_0x8aa8('0x51')])[_0x8aa8('0x1b')](function(_0x4e6b80){_0x44f2b4=_0x4e6b80;logger['info'](_0x8aa8('0x52'),_0x44f2b4['id']);return getEndUser(_0x2a0a14,_0x2aec13['calleridname'],_0x2aec13[_0x8aa8('0x53')]);})['then'](function(_0x1b4843){_0x5adcda=_0x1b4843;logger[_0x8aa8('0xd')](_0x8aa8('0x54'),_0x5adcda['id']);return getTicket(_0x2a0a14,_0x44f2b4,_0x5adcda,_0x1367db,_0x2aec13);})[_0x8aa8('0x1b')](function(_0x36de37){if(_0x36de37){logger[_0x8aa8('0xd')](_0x8aa8('0x55'),_0x36de37['id']);switch(_0x2a0a14[_0x8aa8('0x3b')]){case _0x8aa8('0x56'):logger[_0x8aa8('0xd')](_0x8aa8('0x57'),_0x8aa8('0x58'));return request({'uri':util['format'](_0x8aa8('0x59'),_0x2a0a14['remoteUri'],_0x44f2b4['id'],_0x36de37['id']),'method':'POST'});case'newTab':logger[_0x8aa8('0xd')]('[QUEUE]',_0x8aa8('0x5a'));emit(util[_0x8aa8('0x21')](_0x8aa8('0x5b'),_0x44ba22['name']),_0x8aa8('0x5c'),{'uri':util[_0x8aa8('0x21')](_0x8aa8('0x5d'),_0x2a0a14[_0x8aa8('0x10')],_0x36de37['id'])});break;default:logger['error']('[QUEUE]',_0x8aa8('0x5e'));}}})[_0x8aa8('0x5f')](function(_0x45ef2d){logger[_0x8aa8('0x60')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x45ef2d,{'showHidden':!![],'depth':null}));});};exports[_0x8aa8('0x61')]=function(_0x1bd389,_0x26eb56,_0x4bf6bc,_0x33e9ae,_0x3a814f,_0x501805,_0x5aa8a5){var _0x4b6fd7,_0x55e186;_0x501805[_0x8aa8('0x10')]=intUtil['stripTrailingSlash'](_0x501805[_0x8aa8('0x10')]);_0x501805[_0x8aa8('0x4b')]=intUtil['stripTrailingSlash'](_0x501805['serverUrl']);if(_0x5aa8a5&&_0x5aa8a5[_0x8aa8('0x62')]&&_0x5aa8a5[_0x8aa8('0x62')]!=='none'){logger['info']('[OUTBOUND]',_0x8aa8('0x63'));_0x26eb56[_0x8aa8('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x501805[_0x8aa8('0x4b')],_0x26eb56[_0x8aa8('0x4e')],md5(_0x26eb56['uniqueid']));}headers[_0x8aa8('0x50')]=getAuth(_0x501805);return getUser(_0x501805,_0x33e9ae[_0x8aa8('0x51')])['then'](function(_0x4c8431){_0x4b6fd7=_0x4c8431;logger['info'](_0x8aa8('0x52'),_0x4b6fd7['id']);return getEndUser(_0x501805,_0x26eb56['destcalleridname'],_0x26eb56[_0x8aa8('0x64')]);})[_0x8aa8('0x1b')](function(_0x3e105e){_0x55e186=_0x3e105e;logger[_0x8aa8('0xd')](_0x8aa8('0x54'),_0x55e186['id']);return getTicket(_0x501805,_0x4b6fd7,_0x55e186,_0x4bf6bc,_0x26eb56);})['then'](function(_0x379c66){if(_0x379c66){logger[_0x8aa8('0xd')](_0x8aa8('0x55'),_0x379c66['id']);switch(_0x501805[_0x8aa8('0x3b')]){case'integrationTab':logger[_0x8aa8('0xd')](_0x8aa8('0x65'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8aa8('0x21')](_0x8aa8('0x59'),_0x501805[_0x8aa8('0x10')],_0x4b6fd7['id'],_0x379c66['id']),'method':_0x8aa8('0x2b')});case _0x8aa8('0x66'):logger[_0x8aa8('0xd')](_0x8aa8('0x65'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x33e9ae[_0x8aa8('0x13')]),_0x8aa8('0x5c'),{'uri':util[_0x8aa8('0x21')](_0x8aa8('0x5d'),_0x501805[_0x8aa8('0x10')],_0x379c66['id'])});break;default:logger[_0x8aa8('0x60')](_0x8aa8('0x65'),_0x8aa8('0x5e'));}}})[_0x8aa8('0x5f')](function(_0x3cc282){logger[_0x8aa8('0x60')](_0x8aa8('0x67'),util[_0x8aa8('0x68')](_0x3cc282,{'showHidden':!![],'depth':null}));});};exports[_0x8aa8('0x69')]=function(_0x3e80ac,_0x36523a,_0x84c520,_0x2f561d,_0x28cf8a,_0x57c6f5){var _0x3b0e4d,_0x233169;_0x57c6f5[_0x8aa8('0x10')]=intUtil[_0x8aa8('0x4a')](_0x57c6f5[_0x8aa8('0x10')]);_0x57c6f5[_0x8aa8('0x4b')]=intUtil[_0x8aa8('0x4a')](_0x57c6f5[_0x8aa8('0x4b')]);if(_0x28cf8a&&_0x28cf8a[_0x8aa8('0x4c')]){logger['info']('['+_0x36523a[_0x8aa8('0x6a')][_0x8aa8('0x6b')]()+']','Recording\x20is\x20enabled!');_0x36523a[_0x8aa8('0x4f')]=util['format'](_0x8aa8('0x4d'),_0x57c6f5[_0x8aa8('0x4b')],_0x36523a['uniqueid'],md5(_0x36523a[_0x8aa8('0x4e')]));}else{_0x36523a[_0x8aa8('0x4f')]='';}headers[_0x8aa8('0x50')]=getAuth(_0x57c6f5);return getUser(_0x57c6f5)[_0x8aa8('0x1b')](function(_0xd136db){_0x3b0e4d=_0xd136db;logger[_0x8aa8('0xd')](_0x8aa8('0x52'),_0x3b0e4d['id']);return getEndUser(_0x57c6f5,_0x36523a['calleridname'],_0x36523a[_0x8aa8('0x53')]);})[_0x8aa8('0x1b')](function(_0x300ab8){_0x233169=_0x300ab8;logger[_0x8aa8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x233169['id']);return getTicket(_0x57c6f5,_0x3b0e4d,_0x233169,_0x84c520,_0x36523a);})['then'](function(_0x284600){if(_0x284600){logger[_0x8aa8('0xd')](_0x8aa8('0x55'),_0x284600['id']);}})[_0x8aa8('0x5f')](function(_0x486e83){logger['error']('['+_0x36523a['lastevent'][_0x8aa8('0x6b')]()+']'+_0x8aa8('0x6c'),util[_0x8aa8('0x68')](_0x486e83,{'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 72a9a52..3d575fb 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 _0x7ae6=['calleridname','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','name','indexOf','split','isNil','access_token','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','refreshToken','clientId','clientSecret','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','stack','https://www.zohoapis.%s/crm/v2/users','users','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','/crm/v2/','startCase','first_name','last_name','Zoho-oauthtoken\x20','code','CREATE\x20ERROR','GET','contact_lead','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','moduleCreate','lead','Owner','role','administrator','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','format','lastevent','called','Called','complete','connect','Call_Result','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','user:%s','trigger:browser:url','unmanaged','toUpperCase'];(function(_0x3755f3,_0xcce3d5){var _0x551500=function(_0x448fb4){while(--_0x448fb4){_0x3755f3['push'](_0x3755f3['shift']());}};_0x551500(++_0xcce3d5);}(_0x7ae6,0x94));var _0x67ae=function(_0x503a8c,_0x46d5d1){_0x503a8c=_0x503a8c-0x0;var _0x493b8a=_0x7ae6[_0x503a8c];return _0x493b8a;};'use strict';var _=require('lodash');var rp=require(_0x67ae('0x0'));var md5=require('md5');var util=require(_0x67ae('0x1'));var intUtil=require(_0x67ae('0x2'));var moment=require(_0x67ae('0x3'));var Redis=require(_0x67ae('0x4'));var BPromise=require(_0x67ae('0x5'));var config=require(_0x67ae('0x6'));var logger=require('../../../../config/logger')(_0x67ae('0x7'));config[_0x67ae('0x8')]=_[_0x67ae('0x9')](config[_0x67ae('0x8')],{'host':_0x67ae('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x67ae('0x8')]));function emit(_0x460304,_0x2591a1,_0x20b931){io['to'](_0x460304)[_0x67ae('0xb')](_0x2591a1,_0x20b931);}function request(_0x11c49a){logger[_0x67ae('0xc')](_0x67ae('0xd'),JSON[_0x67ae('0xe')](_0x11c49a));return rp(_0x11c49a);}function getCustomFields(_0x28d20a,_0x3143cb){var _0x109d16={};if(_0x28d20a[_0x67ae('0xf')]>0x0){_[_0x67ae('0x10')](_0x28d20a,function(_0x16b364){if(_0x16b364[_0x67ae('0x11')]===_0x67ae('0x12')&&_0x16b364[_0x67ae('0x13')]){_0x109d16[_0x16b364[_0x67ae('0x13')]]=_0x16b364[_0x67ae('0x14')][_0x67ae('0x15')]();}else if(_0x16b364[_0x67ae('0x11')]===_0x67ae('0x16')&&_0x16b364[_0x67ae('0x17')]&&_0x16b364['idField']&&_0x3143cb[_0x16b364[_0x67ae('0x17')]]){_0x109d16[_0x16b364[_0x67ae('0x13')]]=_0x3143cb[_0x16b364[_0x67ae('0x17')]]['toString']();}else if(_0x16b364['type']===_0x67ae('0x18')&&_0x16b364['Variable']&&_0x16b364['Variable'][_0x67ae('0x19')]&&_0x16b364[_0x67ae('0x13')]&&_0x3143cb[_0x16b364['Variable']['name']['toLowerCase']()]){_0x109d16[_0x16b364[_0x67ae('0x13')]]=_0x3143cb[_0x16b364['Variable'][_0x67ae('0x19')]['toLowerCase']()][_0x67ae('0x15')]();}});}return _0x109d16;}function getName(_0x415e37){if(_0x415e37[_0x67ae('0x1a')]('\x20')>0x0){var _0x5d63fe=_0x415e37[_0x67ae('0x1b')](/ (.+)/);if(_0x5d63fe[0x1]){return _0x5d63fe;}}return[_0x415e37,_0x415e37];}var accountsTokens={};function getAccessToken(_0x18876d){return new Promise(function(_0x23ca2c,_0xbe6112){if(!_[_0x67ae('0x1c')](accountsTokens[_0x18876d['id']])&&!_[_0x67ae('0x1c')](accountsTokens[_0x18876d['id']][_0x67ae('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x18876d['id']][_0x67ae('0x1e')])){_0x23ca2c(accountsTokens[_0x18876d['id']][_0x67ae('0x1d')]);}}var _0x54163c;switch(_0x18876d['zone']){case'US':_0x54163c='https://accounts.zoho.com';break;case'AU':_0x54163c=_0x67ae('0x1f');break;case'EU':_0x54163c=_0x67ae('0x20');break;case'IN':_0x54163c=_0x67ae('0x21');break;case'CN':_0x54163c='https://accounts.zoho.com.cn';break;default:_0x54163c=_0x67ae('0x20');break;}var _0x5ac25d={'method':'POST','uri':_0x54163c+'/oauth/v2/token','qs':{'refresh_token':_0x18876d[_0x67ae('0x22')],'client_id':_0x18876d[_0x67ae('0x23')],'client_secret':_0x18876d[_0x67ae('0x24')],'grant_type':_0x67ae('0x25')},'json':!![]};return rp(_0x5ac25d)[_0x67ae('0x26')](function(_0x4000e5){accountsTokens[_0x18876d['id']]={'access_token':_0x4000e5[_0x67ae('0x1d')],'expires_in':moment()[_0x67ae('0x27')](_0x4000e5[_0x67ae('0x1e')],'seconds')};_0x23ca2c(_0x4000e5[_0x67ae('0x1d')]);})['catch'](function(_0xe7fce1){logger[_0x67ae('0x28')](_0x67ae('0x29'),_0xe7fce1[_0x67ae('0x2a')]);_0xbe6112(_0xe7fce1);});});}function getUser(_0xf5b101,_0x320274,_0x13d219,_0x361f98){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format'](_0x67ae('0x2b'),_0x320274),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xf5b101},'json':!![]})[_0x67ae('0x26')](function(_0x4b9962){if(_0x4b9962[_0x67ae('0x2c')]){var _0x4f204d=-0x1;if(_['isArrayLikeObject'](_0x4b9962[_0x67ae('0x2c')])){if(!_[_0x67ae('0x1c')](_0x361f98)){_0x4f204d=_['findIndex'](_0x4b9962['users'],function(_0x416e23){return _0x416e23['email']===_0x361f98;});}if(_0x4f204d>=0x0){logger[_0x67ae('0x2d')](_0x67ae('0x2e'));}else{logger[_0x67ae('0x2d')](_0x67ae('0x2f'));_0x4f204d=_[_0x67ae('0x30')](_0x4b9962['users'],function(_0x1c4fd6){return _0x1c4fd6[_0x67ae('0x31')][_0x67ae('0x19')]===_0x67ae('0x32');});}return _0x4b9962[_0x67ae('0x2c')][_0x4f204d];}else{if(_0x4b9962[_0x67ae('0x33')]['profile'][_0x67ae('0x19')]==='Administrator'){logger[_0x67ae('0x2d')](_0x67ae('0x2f'));user=_0x4b9962[_0x67ae('0x33')];return user;}else{logger['error'](_0x67ae('0x34'),JSON[_0x67ae('0xe')](_0x4b9962));throw new Error(_0x67ae('0x35')+JSON[_0x67ae('0xe')](_0x4b9962));}}}else{logger[_0x67ae('0x28')](_0x67ae('0x34'),JSON[_0x67ae('0xe')](_0x4b9962));throw new Error(_0x67ae('0x35')+JSON['stringify'](_0x4b9962));}})[_0x67ae('0x36')](function(_0x4e6083){console[_0x67ae('0x28')](_0x4e6083);});}function getZohoUser(_0x3834ce,_0x82ba8c){return new BPromise(function(_0x6439d,_0x4f5681){request(_0x3834ce)['then'](function(_0x567f10){var _0x9d3d6=null;if(_0x567f10){_0x9d3d6=_0x567f10[_0x67ae('0x37')][0x0];_0x9d3d6[_0x67ae('0x38')]=_0x82ba8c;}_0x6439d(_0x9d3d6);})['catch'](function(_0x59f336){_0x4f5681(_0x59f336);});});}function createEndUser(_0x26a6d7,_0x188ec0,_0x4440c5,_0x4d140f,_0x39268e,_0x24b0df){var _0x4440c5=getName(_0x4440c5);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x188ec0+_0x67ae('0x39')+_[_0x67ae('0x3a')](_0x24b0df['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4440c5[0x1],'First_Name':_0x4440c5[0x0],'Phone':_0x4d140f,'Owner':{'name':!_[_0x67ae('0x1c')](_0x39268e['role'][_0x67ae('0x19')])?_0x39268e['role'][_0x67ae('0x19')]:!_['isNil'](_0x39268e['first_name'])?_0x39268e[_0x67ae('0x3b')]+'\x20'+_0x39268e[_0x67ae('0x3c')]:_0x39268e[_0x67ae('0x3c')],'id':_0x39268e['id']}}]},'headers':{'Authorization':_0x67ae('0x3d')+_0x26a6d7},'json':!![]})[_0x67ae('0x26')](function(_0x58bb2c){if(_0x58bb2c&&_0x58bb2c[_0x67ae('0x37')][0x0][_0x67ae('0x3e')]==='SUCCESS'){var _0x1253bf=_0x58bb2c[_0x67ae('0x37')][0x0]['details'];_0x1253bf[_0x67ae('0x38')]=_[_0x67ae('0x3a')](_0x24b0df['moduleCreate'])+'s';return _0x1253bf;}logger['error'](_0x67ae('0x34'),JSON[_0x67ae('0xe')](data));throw new Error('Error:\x20'+JSON[_0x67ae('0xe')](data));})['catch'](function(_0x3e8760){console['log'](_0x67ae('0x3f'),_0x3e8760);});}function getEndUser(_0x4868a5,_0x3edcaa,_0x5bc221,_0xe1d058,_0x15e414,_0x39f232,_0xe4b971){var _0x4424b3={'method':_0x67ae('0x40'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4868a5},'json':!![]};switch(_0xe4b971['moduleSearch']){case _0x67ae('0x41'):_0x4424b3[_0x67ae('0x42')]=_0x67ae('0x43')+_0x3edcaa+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x15e414+'))';return getZohoUser(_0x4424b3,_0x67ae('0x44'))['then'](function(_0x11046e){if(_0x11046e)return _0x11046e;_0x4424b3[_0x67ae('0x42')]=_0x67ae('0x43')+_0x3edcaa+_0x67ae('0x45')+_0x15e414+'))';return getZohoUser(_0x4424b3,_0x67ae('0x46'))[_0x67ae('0x26')](function(_0x91a770){if(_0x91a770)return _0x91a770;if(_0xe4b971['moduleCreate']!=_0x67ae('0x47')){return createEndUser(_0x4868a5,_0x3edcaa,_0xe1d058,_0x15e414,_0x39f232,_0xe4b971);}else{return{};}});});break;case'contact':_0x4424b3[_0x67ae('0x42')]=_0x67ae('0x43')+_0x3edcaa+_0x67ae('0x48')+_0x15e414+'))';return getZohoUser(_0x4424b3,'Contacts')[_0x67ae('0x26')](function(_0xc65ec3){if(_0xc65ec3)return _0xc65ec3;if(_0xe4b971[_0x67ae('0x49')]!=_0x67ae('0x47')){return createEndUser(_0x4868a5,_0x3edcaa,_0xe1d058,_0x15e414,_0x39f232,_0xe4b971);}else{return{};}});break;case _0x67ae('0x4a'):_0x4424b3[_0x67ae('0x42')]='https://www.zohoapis.'+_0x3edcaa+_0x67ae('0x45')+_0x15e414+'))';return getZohoUser(_0x4424b3,_0x67ae('0x46'))[_0x67ae('0x26')](function(_0x3b66dc){if(_0x3b66dc)return _0x3b66dc;if(_0xe4b971[_0x67ae('0x49')]!=_0x67ae('0x47')){return createEndUser(_0x4868a5,_0x3edcaa,_0xe1d058,_0x15e414,_0x39f232,_0xe4b971);}else{return{};}});break;}}function getCall(_0x3a730c,_0x498adf,_0x21f4ce,_0x31d96c,_0x4da3f3,_0xa8569e,_0x266aef,_0x3a3ac6){logger[_0x67ae('0x2d')]('Creating\x20new\x20call...');var _0x36b39b={};_0x36b39b[_0x67ae('0x4b')]={'name':!_[_0x67ae('0x1c')](_0x31d96c[_0x67ae('0x4c')]['name'])&&!_['isNil'](_0x31d96c[_0x67ae('0x31')][_0x67ae('0x19')])&&_0x31d96c[_0x67ae('0x31')][_0x67ae('0x19')]===_0x67ae('0x4d')?_0x31d96c[_0x67ae('0x4c')]['name']:!_['isNil'](_0x31d96c[_0x67ae('0x3b')])?_0x31d96c['first_name']+'\x20'+_0x31d96c['last_name']:_0x31d96c['last_name'],'id':_0x31d96c['id']};_0x36b39b[_0x67ae('0x4e')]=intUtil[_0x67ae('0x4f')](_0xa8569e['Subjects'],_0x266aef,'\x20');_0x36b39b[_0x67ae('0x50')]=intUtil[_0x67ae('0x4f')](_0xa8569e[_0x67ae('0x51')],_0x266aef,'\x0a');if(_0x4da3f3['enduserType']==='Contacts'){_0x36b39b['Who_Id']={'name':!_[_0x67ae('0x1c')](_0x4da3f3[_0x67ae('0x52')])?_0x4da3f3[_0x67ae('0x52')]:!_[_0x67ae('0x1c')](_0x4da3f3['First_Name'])?_0x4da3f3[_0x67ae('0x53')]+'\x20'+_0x4da3f3[_0x67ae('0x54')]:_0x4da3f3[_0x67ae('0x54')],'id':_0x4da3f3['id']};}if(_0x4da3f3[_0x67ae('0x38')]===_0x67ae('0x46')){_0x36b39b[_0x67ae('0x55')]={'name':!_[_0x67ae('0x1c')](_0x4da3f3[_0x67ae('0x52')])?_0x4da3f3[_0x67ae('0x52')]:!_[_0x67ae('0x1c')](_0x4da3f3[_0x67ae('0x53')])?_0x4da3f3['First_Name']+'\x20'+_0x4da3f3[_0x67ae('0x54')]:_0x4da3f3['Last_Name'],'id':_0x4da3f3['id']};_0x36b39b[_0x67ae('0x56')]=_[_0x67ae('0x3a')](_0x4da3f3[_0x67ae('0x38')]);}if(_0x266aef['talktime']){_0x36b39b[_0x67ae('0x57')]=moment[_0x67ae('0x58')](parseInt(_0x266aef[_0x67ae('0x59')])*0x3e8)['format'](_0x67ae('0x5a'));}else if(_0x266aef[_0x67ae('0x5b')]&&_0x266aef[_0x67ae('0x5c')]){_0x36b39b[_0x67ae('0x57')]=moment['utc'](moment(_0x266aef[_0x67ae('0x5c')],'YYYY-MM-DDTHH:mm:ss')[_0x67ae('0x5d')](moment(_0x266aef[_0x67ae('0x5e')],_0x67ae('0x5f'))))[_0x67ae('0x60')](_0x67ae('0x5a'));}switch(_0x266aef[_0x67ae('0x61')]){case _0x67ae('0x62'):_0x36b39b['Call_Result']=_0x67ae('0x63');break;case _0x67ae('0x64'):case _0x67ae('0x65'):_0x36b39b[_0x67ae('0x66')]='Answered';break;case _0x67ae('0x67'):_0x36b39b[_0x67ae('0x66')]='Rejected';break;case _0x67ae('0x68'):_0x36b39b[_0x67ae('0x66')]=_0x67ae('0x69');break;case _0x67ae('0x6a'):_0x36b39b[_0x67ae('0x66')]=_0x67ae('0x6b');default:}_0x36b39b[_0x67ae('0x6c')]=(_0x3a3ac6===_0x67ae('0x6d')?moment(_0x266aef[_0x67ae('0x5e')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x266aef[_0x67ae('0x6e')])[_0x67ae('0x60')](_0x67ae('0x5f')))||moment()[_0x67ae('0x60')]('YYYY-MM-DDTHH:mm:ss');_0x36b39b[_0x67ae('0x6f')]=_0x3a3ac6||_0x67ae('0x70');_0x36b39b=_['merge'](_0x36b39b,getCustomFields(_0xa8569e[_0x67ae('0x71')],_0x266aef));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x498adf+_0x67ae('0x72'),'headers':{'Authorization':_0x67ae('0x3d')+_0x3a730c},'body':{'data':[_0x36b39b]},'json':!![]})['then'](function(_0x4cce71){if(_0x4cce71&&_0x4cce71[_0x67ae('0x37')][0x0]['code']==='SUCCESS'){logger['info'](_0x67ae('0x73'));return{'id':_0x4cce71['data'][0x0][_0x67ae('0x74')]['id']};}})[_0x67ae('0x36')](function(_0x401a92){logger[_0x67ae('0x2d')](_0x67ae('0x75'),_0x401a92['stack']);console[_0x67ae('0x76')]('err',_0x401a92);});}exports[_0x67ae('0x77')]=function(_0x2d6f38,_0x50c7bb,_0x103834,_0x594418,_0x39ad02,_0xa0a90a){var _0xbc7f0,_0x5e0d6a,_0x440188;_0xa0a90a[_0x67ae('0x78')]=intUtil[_0x67ae('0x79')](_0xa0a90a[_0x67ae('0x78')]);_0xa0a90a[_0x67ae('0x7a')]=intUtil['stripTrailingSlash'](_0xa0a90a['serverUrl']);if(_0x39ad02&&_0x39ad02[_0x67ae('0x7b')]){logger['info'](_0x67ae('0x7c'),_0x67ae('0x7d'));_0x50c7bb[_0x67ae('0x7e')]=_0xa0a90a[_0x67ae('0x7a')]+_0x67ae('0x7f')+_0x50c7bb[_0x67ae('0x80')]+_0x67ae('0x81')+md5(_0x50c7bb[_0x67ae('0x80')]);}else{_0x50c7bb[_0x67ae('0x7e')]='';}var _0x49563a=_0xa0a90a[_0x67ae('0x78')]===_0x67ae('0x82')?'eu':'com';return getAccessToken(_0xa0a90a)[_0x67ae('0x26')](function(_0x3e6bfa){_0x440188=_0x3e6bfa;return getUser(_0x440188,_0x49563a,_0xa0a90a,_0x594418[_0x67ae('0x83')]);})['then'](function(_0x3d80d5){_0xbc7f0=_0x3d80d5;logger[_0x67ae('0x2d')](_0x67ae('0x84'),_0xbc7f0['id']);return getEndUser(_0x440188,_0x49563a,_0xa0a90a,_0x50c7bb['calleridname'],_0x50c7bb[_0x67ae('0x85')],_0xbc7f0,_0x103834);})[_0x67ae('0x26')](function(_0x37ee65){_0x5e0d6a=_0x37ee65;return getCall(_0x440188,_0x49563a,_0xa0a90a,_0xbc7f0,_0x5e0d6a,_0x103834,_0x50c7bb,_0x67ae('0x70'));})[_0x67ae('0x26')](function(_0x29012a){if(_0x29012a){logger[_0x67ae('0x2d')](_0x67ae('0x86'),_0x29012a['id']);logger['info'](_0x67ae('0x7c'),_0x67ae('0x87'));emit(util[_0x67ae('0x60')]('user:%s',_0x594418[_0x67ae('0x19')]),'trigger:browser:url',{'uri':_0x67ae('0x88')+_0xa0a90a[_0x67ae('0x78')]+_0x67ae('0x89')+_0x29012a['id']});}})[_0x67ae('0x36')](function(_0x3bf393){logger['error'](_0x67ae('0x7c'),JSON[_0x67ae('0xe')](_0x3bf393));});};exports[_0x67ae('0x6d')]=function(_0x175ad7,_0x12a9fc,_0x4ff10d,_0x34c4c0,_0x20a938,_0x11a5c9,_0x42ab3d){var _0x50fec1,_0x4bc91d,_0x8573b6;_0x11a5c9[_0x67ae('0x78')]=intUtil[_0x67ae('0x79')](_0x11a5c9[_0x67ae('0x78')]);_0x11a5c9[_0x67ae('0x7a')]=intUtil[_0x67ae('0x79')](_0x11a5c9['serverUrl']);if(_0x42ab3d&&_0x42ab3d[_0x67ae('0x8a')]&&_0x42ab3d['recordingFormat']!==_0x67ae('0x8b')){logger['info'](_0x67ae('0x8c'),_0x67ae('0x7d'));_0x12a9fc['recordingURL']=_0x11a5c9[_0x67ae('0x7a')]+'/api/voice/recordings/'+_0x12a9fc[_0x67ae('0x80')]+_0x67ae('0x81')+md5(_0x12a9fc[_0x67ae('0x80')]);}var _0x283c00=_0x11a5c9[_0x67ae('0x78')]===_0x67ae('0x82')?'eu':_0x67ae('0x8d');return getAccessToken(_0x11a5c9)['then'](function(_0x53a670){_0x8573b6=_0x53a670;return getUser(_0x8573b6,_0x283c00,_0x11a5c9,_0x34c4c0[_0x67ae('0x83')]);})[_0x67ae('0x26')](function(_0x1f88e1){_0x50fec1=_0x1f88e1;logger[_0x67ae('0x2d')](_0x67ae('0x84'),_0x50fec1['id']);return getEndUser(_0x8573b6,_0x283c00,_0x11a5c9,_0x12a9fc['destcalleridname'],_0x12a9fc['destcalleridnum'],_0x50fec1,_0x4ff10d);})[_0x67ae('0x26')](function(_0x4ebdd0){_0x4bc91d=_0x4ebdd0;return getCall(_0x8573b6,_0x283c00,_0x11a5c9,_0x50fec1,_0x4bc91d,_0x4ff10d,_0x12a9fc,'Outbound');})['then'](function(_0x2df164){if(_0x2df164){logger[_0x67ae('0x2d')]('The\x20Call\x20ID\x20is:',_0x2df164['id']);logger[_0x67ae('0x2d')](_0x67ae('0x8c'),_0x67ae('0x87'));emit(util[_0x67ae('0x60')](_0x67ae('0x8e'),_0x34c4c0[_0x67ae('0x19')]),_0x67ae('0x8f'),{'uri':_0x67ae('0x88')+_0x11a5c9[_0x67ae('0x78')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2df164['id']});}})['catch'](function(_0x45fa47){logger[_0x67ae('0x28')](_0x67ae('0x8c'),JSON['stringify'](_0x45fa47));});};exports[_0x67ae('0x90')]=function(_0x20f286,_0x18835e,_0x17a306,_0x58781c,_0x3c9b6d,_0xada10f){var _0x558d77,_0x3f25bf,_0x4f83ca;_0xada10f[_0x67ae('0x78')]=intUtil[_0x67ae('0x79')](_0xada10f[_0x67ae('0x78')]);_0xada10f[_0x67ae('0x7a')]=intUtil['stripTrailingSlash'](_0xada10f[_0x67ae('0x7a')]);if(_0x3c9b6d&&_0x3c9b6d[_0x67ae('0x7b')]){logger[_0x67ae('0x2d')]('['+_0x18835e[_0x67ae('0x61')][_0x67ae('0x91')]()+']',_0x67ae('0x7d'));_0x18835e[_0x67ae('0x7e')]=_0xada10f[_0x67ae('0x7a')]+_0x67ae('0x7f')+_0x18835e['uniqueid']+_0x67ae('0x81')+md5(_0x18835e[_0x67ae('0x80')]);}else{_0x18835e[_0x67ae('0x7e')]='';}var _0x41b07c=_0xada10f['host']===_0x67ae('0x82')?'eu':_0x67ae('0x8d');return getAccessToken(_0xada10f)[_0x67ae('0x26')](function(_0x483005){_0x4f83ca=_0x483005;return getUser(_0x4f83ca,_0x41b07c,_0xada10f);})[_0x67ae('0x26')](function(_0x295139){_0x558d77=_0x295139;logger[_0x67ae('0x2d')](_0x67ae('0x84'),_0x558d77['id']);return getEndUser(_0x4f83ca,_0x41b07c,_0xada10f,_0x18835e[_0x67ae('0x92')],_0x18835e['calleridnum'],_0x558d77,_0x17a306);})[_0x67ae('0x26')](function(_0x28167c){_0x3f25bf=_0x28167c;return getCall(_0x4f83ca,_0x41b07c,_0xada10f,_0x558d77,_0x3f25bf,_0x17a306,_0x18835e,_0x67ae('0x70'));})[_0x67ae('0x26')](function(_0x2c7902){if(_0x2c7902){logger[_0x67ae('0x2d')](_0x67ae('0x86'),_0x2c7902['id']);}})[_0x67ae('0x36')](function(_0xbefed0){logger['error']('['+_0x18835e[_0x67ae('0x61')][_0x67ae('0x91')]()+']',JSON[_0x67ae('0xe')](_0xbefed0));});}; \ No newline at end of file +var _0x2cf5=['length','type','string','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','enduserType','What_Id','$se_module','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','connect','Answered','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Fields','err','stack','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','The\x20User\x20ID\x20is:','calleridname','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','com','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','[OUTBOUND]','toUpperCase','calleridnum','lodash','request-promise','util','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify'];(function(_0x142669,_0xc273d8){var _0x13dac5=function(_0x4b6fef){while(--_0x4b6fef){_0x142669['push'](_0x142669['shift']());}};_0x13dac5(++_0xc273d8);}(_0x2cf5,0x19f));var _0x52cf=function(_0x1943be,_0x4d8990){_0x1943be=_0x1943be-0x0;var _0x1b0e3b=_0x2cf5[_0x1943be];return _0x1b0e3b;};'use strict';var _=require(_0x52cf('0x0'));var rp=require(_0x52cf('0x1'));var md5=require('md5');var util=require(_0x52cf('0x2'));var intUtil=require('./util');var moment=require(_0x52cf('0x3'));var Redis=require(_0x52cf('0x4'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x52cf('0x5'))(_0x52cf('0x6'));config[_0x52cf('0x7')]=_[_0x52cf('0x8')](config[_0x52cf('0x7')],{'host':_0x52cf('0x9'),'port':0x18eb});var io=require(_0x52cf('0xa'))(new Redis(config[_0x52cf('0x7')]));function emit(_0x41d874,_0x23b2ab,_0x17e1b0){io['to'](_0x41d874)['emit'](_0x23b2ab,_0x17e1b0);}function request(_0x46d7ac){logger[_0x52cf('0xb')](_0x52cf('0xc'),JSON[_0x52cf('0xd')](_0x46d7ac));return rp(_0x46d7ac);}function getCustomFields(_0x4e5b19,_0xadb2a6){var _0x154197={};if(_0x4e5b19[_0x52cf('0xe')]>0x0){_['forEach'](_0x4e5b19,function(_0x18167b){if(_0x18167b[_0x52cf('0xf')]===_0x52cf('0x10')&&_0x18167b[_0x52cf('0x11')]){_0x154197[_0x18167b[_0x52cf('0x11')]]=_0x18167b[_0x52cf('0x12')]['toString']();}else if(_0x18167b['type']===_0x52cf('0x13')&&_0x18167b[_0x52cf('0x14')]&&_0x18167b[_0x52cf('0x11')]&&_0xadb2a6[_0x18167b[_0x52cf('0x14')]]){_0x154197[_0x18167b[_0x52cf('0x11')]]=_0xadb2a6[_0x18167b[_0x52cf('0x14')]][_0x52cf('0x15')]();}else if(_0x18167b[_0x52cf('0xf')]==='customVariable'&&_0x18167b[_0x52cf('0x16')]&&_0x18167b[_0x52cf('0x16')][_0x52cf('0x17')]&&_0x18167b['idField']&&_0xadb2a6[_0x18167b[_0x52cf('0x16')]['name'][_0x52cf('0x18')]()]){_0x154197[_0x18167b[_0x52cf('0x11')]]=_0xadb2a6[_0x18167b[_0x52cf('0x16')][_0x52cf('0x17')]['toLowerCase']()][_0x52cf('0x15')]();}});}return _0x154197;}function getName(_0x1ce14a){if(_0x1ce14a[_0x52cf('0x19')]('\x20')>0x0){var _0x180df8=_0x1ce14a['split'](/ (.+)/);if(_0x180df8[0x1]){return _0x180df8;}}return[_0x1ce14a,_0x1ce14a];}var accountsTokens={};function getAccessToken(_0x326311){return new Promise(function(_0x5f5200,_0x1d9fdd){if(!_[_0x52cf('0x1a')](accountsTokens[_0x326311['id']])&&!_[_0x52cf('0x1a')](accountsTokens[_0x326311['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x326311['id']][_0x52cf('0x1b')])){_0x5f5200(accountsTokens[_0x326311['id']][_0x52cf('0x1c')]);}}var _0x1676e6;switch(_0x326311[_0x52cf('0x1d')]){case'US':_0x1676e6=_0x52cf('0x1e');break;case'AU':_0x1676e6=_0x52cf('0x1f');break;case'EU':_0x1676e6=_0x52cf('0x20');break;case'IN':_0x1676e6=_0x52cf('0x21');break;case'CN':_0x1676e6=_0x52cf('0x22');break;default:_0x1676e6=_0x52cf('0x20');break;}var _0x57e910={'method':'POST','uri':_0x1676e6+_0x52cf('0x23'),'qs':{'refresh_token':_0x326311[_0x52cf('0x24')],'client_id':_0x326311[_0x52cf('0x25')],'client_secret':_0x326311[_0x52cf('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x57e910)['then'](function(_0x40eec3){accountsTokens[_0x326311['id']]={'access_token':_0x40eec3[_0x52cf('0x1c')],'expires_in':moment()[_0x52cf('0x27')](_0x40eec3[_0x52cf('0x1b')],_0x52cf('0x28'))};_0x5f5200(_0x40eec3[_0x52cf('0x1c')]);})[_0x52cf('0x29')](function(_0x1f6b75){logger[_0x52cf('0x2a')]('Failing\x20creating\x20the\x20access_token',_0x1f6b75['stack']);_0x1d9fdd(_0x1f6b75);});});}function getUser(_0x3dee68,_0x8b859d,_0x38ad05,_0x1e1318){logger['info'](_0x52cf('0x2b'));return request({'method':_0x52cf('0x2c'),'uri':util[_0x52cf('0x2d')](_0x52cf('0x2e'),_0x8b859d),'qs':{'type':_0x52cf('0x2f')},'headers':{'Authorization':_0x52cf('0x30')+_0x3dee68},'json':!![]})['then'](function(_0x30bf56){if(_0x30bf56[_0x52cf('0x31')]){var _0x386fef=-0x1;if(_[_0x52cf('0x32')](_0x30bf56['users'])){if(!_[_0x52cf('0x1a')](_0x1e1318)){_0x386fef=_[_0x52cf('0x33')](_0x30bf56[_0x52cf('0x31')],function(_0x141871){return _0x141871[_0x52cf('0x34')]===_0x1e1318;});}if(_0x386fef>=0x0){logger[_0x52cf('0x35')](_0x52cf('0x36'));}else{logger[_0x52cf('0x35')](_0x52cf('0x37'));_0x386fef=_[_0x52cf('0x33')](_0x30bf56['users'],function(_0x5f2c33){return _0x5f2c33[_0x52cf('0x38')][_0x52cf('0x17')]===_0x52cf('0x39');});}return _0x30bf56[_0x52cf('0x31')][_0x386fef];}else{if(_0x30bf56['user']['profile'][_0x52cf('0x17')]===_0x52cf('0x39')){logger[_0x52cf('0x35')](_0x52cf('0x37'));user=_0x30bf56[_0x52cf('0x3a')];return user;}else{logger[_0x52cf('0x2a')](_0x52cf('0x3b'),JSON[_0x52cf('0xd')](_0x30bf56));throw new Error(_0x52cf('0x3c')+JSON[_0x52cf('0xd')](_0x30bf56));}}}else{logger[_0x52cf('0x2a')](_0x52cf('0x3b'),JSON[_0x52cf('0xd')](_0x30bf56));throw new Error(_0x52cf('0x3c')+JSON[_0x52cf('0xd')](_0x30bf56));}})['catch'](function(_0x3f8420){console[_0x52cf('0x2a')](_0x3f8420);});}function getZohoUser(_0x3424d0,_0x2f9a0a){return new BPromise(function(_0x46e014,_0x158f7d){request(_0x3424d0)[_0x52cf('0x3d')](function(_0x57895a){var _0x3f04dd=null;if(_0x57895a){_0x3f04dd=_0x57895a[_0x52cf('0x3e')][0x0];_0x3f04dd['enduserType']=_0x2f9a0a;}_0x46e014(_0x3f04dd);})['catch'](function(_0x1e1303){_0x158f7d(_0x1e1303);});});}function createEndUser(_0x4fccf2,_0x50d45f,_0x12f43d,_0x32be3a,_0x180fe5,_0x8853ed){var _0x12f43d=getName(_0x12f43d);return request({'method':_0x52cf('0x3f'),'uri':_0x52cf('0x40')+_0x50d45f+_0x52cf('0x41')+_[_0x52cf('0x42')](_0x8853ed[_0x52cf('0x43')])+'s','body':{'data':[{'Last_Name':_0x12f43d[0x1],'First_Name':_0x12f43d[0x0],'Phone':_0x32be3a,'Owner':{'name':!_[_0x52cf('0x1a')](_0x180fe5[_0x52cf('0x44')][_0x52cf('0x17')])?_0x180fe5[_0x52cf('0x44')][_0x52cf('0x17')]:!_[_0x52cf('0x1a')](_0x180fe5['first_name'])?_0x180fe5[_0x52cf('0x45')]+'\x20'+_0x180fe5['last_name']:_0x180fe5[_0x52cf('0x46')],'id':_0x180fe5['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4fccf2},'json':!![]})[_0x52cf('0x3d')](function(_0x160d32){if(_0x160d32&&_0x160d32['data'][0x0][_0x52cf('0x47')]==='SUCCESS'){var _0xaab554=_0x160d32[_0x52cf('0x3e')][0x0][_0x52cf('0x48')];_0xaab554['enduserType']=_[_0x52cf('0x42')](_0x8853ed['moduleCreate'])+'s';return _0xaab554;}logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x52cf('0xd')](data));})[_0x52cf('0x29')](function(_0x516ca1){console[_0x52cf('0x49')](_0x52cf('0x4a'),_0x516ca1);});}function getEndUser(_0x39b56a,_0x2bd68c,_0x2fa1c9,_0x4e765b,_0x297887,_0x1094da,_0x303759){var _0x3dff2d={'method':_0x52cf('0x2c'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x39b56a},'json':!![]};switch(_0x303759[_0x52cf('0x4b')]){case _0x52cf('0x4c'):_0x3dff2d['uri']=_0x52cf('0x40')+_0x2bd68c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x297887+'))';return getZohoUser(_0x3dff2d,_0x52cf('0x4d'))[_0x52cf('0x3d')](function(_0x3f8e85){if(_0x3f8e85)return _0x3f8e85;_0x3dff2d[_0x52cf('0x4e')]=_0x52cf('0x40')+_0x2bd68c+_0x52cf('0x4f')+_0x297887+'))';return getZohoUser(_0x3dff2d,_0x52cf('0x50'))['then'](function(_0x4a60d6){if(_0x4a60d6)return _0x4a60d6;if(_0x303759['moduleCreate']!=_0x52cf('0x51')){return createEndUser(_0x39b56a,_0x2bd68c,_0x4e765b,_0x297887,_0x1094da,_0x303759);}else{return{};}});});break;case'contact':_0x3dff2d['uri']=_0x52cf('0x40')+_0x2bd68c+_0x52cf('0x52')+_0x297887+'))';return getZohoUser(_0x3dff2d,'Contacts')['then'](function(_0x30f142){if(_0x30f142)return _0x30f142;if(_0x303759[_0x52cf('0x43')]!=_0x52cf('0x51')){return createEndUser(_0x39b56a,_0x2bd68c,_0x4e765b,_0x297887,_0x1094da,_0x303759);}else{return{};}});break;case'lead':_0x3dff2d[_0x52cf('0x4e')]=_0x52cf('0x40')+_0x2bd68c+_0x52cf('0x4f')+_0x297887+'))';return getZohoUser(_0x3dff2d,_0x52cf('0x50'))[_0x52cf('0x3d')](function(_0x4eef8f){if(_0x4eef8f)return _0x4eef8f;if(_0x303759[_0x52cf('0x43')]!=_0x52cf('0x51')){return createEndUser(_0x39b56a,_0x2bd68c,_0x4e765b,_0x297887,_0x1094da,_0x303759);}else{return{};}});break;}}function getCall(_0x2f6310,_0x3b4114,_0x59fb6d,_0x56289c,_0x302510,_0x4c526d,_0x153fe3,_0x38e6d2){logger[_0x52cf('0x35')]('Creating\x20new\x20call...');var _0x45a3a9={};_0x45a3a9['Owner']={'name':!_[_0x52cf('0x1a')](_0x56289c[_0x52cf('0x44')][_0x52cf('0x17')])&&!_['isNil'](_0x56289c[_0x52cf('0x38')][_0x52cf('0x17')])&&_0x56289c[_0x52cf('0x38')]['name']==='administrator'?_0x56289c[_0x52cf('0x44')][_0x52cf('0x17')]:!_[_0x52cf('0x1a')](_0x56289c[_0x52cf('0x45')])?_0x56289c['first_name']+'\x20'+_0x56289c['last_name']:_0x56289c[_0x52cf('0x46')],'id':_0x56289c['id']};_0x45a3a9['Subject']=intUtil[_0x52cf('0x53')](_0x4c526d['Subjects'],_0x153fe3,'\x20');_0x45a3a9[_0x52cf('0x54')]=intUtil[_0x52cf('0x53')](_0x4c526d['Descriptions'],_0x153fe3,'\x0a');if(_0x302510['enduserType']===_0x52cf('0x4d')){_0x45a3a9[_0x52cf('0x55')]={'name':!_[_0x52cf('0x1a')](_0x302510[_0x52cf('0x56')])?_0x302510[_0x52cf('0x56')]:!_['isNil'](_0x302510[_0x52cf('0x57')])?_0x302510[_0x52cf('0x57')]+'\x20'+_0x302510[_0x52cf('0x58')]:_0x302510[_0x52cf('0x58')],'id':_0x302510['id']};}if(_0x302510[_0x52cf('0x59')]===_0x52cf('0x50')){_0x45a3a9[_0x52cf('0x5a')]={'name':!_[_0x52cf('0x1a')](_0x302510[_0x52cf('0x56')])?_0x302510[_0x52cf('0x56')]:!_[_0x52cf('0x1a')](_0x302510[_0x52cf('0x57')])?_0x302510[_0x52cf('0x57')]+'\x20'+_0x302510[_0x52cf('0x58')]:_0x302510[_0x52cf('0x58')],'id':_0x302510['id']};_0x45a3a9[_0x52cf('0x5b')]=_[_0x52cf('0x42')](_0x302510['enduserType']);}if(_0x153fe3['talktime']){_0x45a3a9[_0x52cf('0x5c')]=moment['utc'](parseInt(_0x153fe3['talktime'])*0x3e8)[_0x52cf('0x2d')](_0x52cf('0x5d'));}else if(_0x153fe3[_0x52cf('0x5e')]&&_0x153fe3[_0x52cf('0x5f')]){_0x45a3a9[_0x52cf('0x5c')]=moment['utc'](moment(_0x153fe3[_0x52cf('0x5f')],_0x52cf('0x60'))[_0x52cf('0x61')](moment(_0x153fe3[_0x52cf('0x62')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x52cf('0x5d'));}switch(_0x153fe3[_0x52cf('0x63')]){case'called':_0x45a3a9[_0x52cf('0x64')]=_0x52cf('0x65');break;case'complete':case _0x52cf('0x66'):_0x45a3a9[_0x52cf('0x64')]=_0x52cf('0x67');break;case'rejected':_0x45a3a9[_0x52cf('0x64')]=_0x52cf('0x68');break;case'abandoned':_0x45a3a9[_0x52cf('0x64')]=_0x52cf('0x69');break;case _0x52cf('0x6a'):_0x45a3a9[_0x52cf('0x64')]=_0x52cf('0x6b');default:}_0x45a3a9[_0x52cf('0x6c')]=(_0x38e6d2===_0x52cf('0x6d')?moment(_0x153fe3[_0x52cf('0x62')])[_0x52cf('0x2d')](_0x52cf('0x60')):moment(_0x153fe3[_0x52cf('0x6e')])[_0x52cf('0x2d')](_0x52cf('0x60')))||moment()['format'](_0x52cf('0x60'));_0x45a3a9['Call_Type']=_0x38e6d2||'Inbound';_0x45a3a9=_['merge'](_0x45a3a9,getCustomFields(_0x4c526d[_0x52cf('0x6f')],_0x153fe3));return request({'method':'POST','uri':_0x52cf('0x40')+_0x3b4114+'/crm/v2/Calls','headers':{'Authorization':_0x52cf('0x30')+_0x2f6310},'body':{'data':[_0x45a3a9]},'json':!![]})[_0x52cf('0x3d')](function(_0x21f3b5){if(_0x21f3b5&&_0x21f3b5[_0x52cf('0x3e')][0x0][_0x52cf('0x47')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0x21f3b5['data'][0x0][_0x52cf('0x48')]['id']};}})[_0x52cf('0x29')](function(_0x17bf31){logger[_0x52cf('0x35')](_0x52cf('0x70'),_0x17bf31[_0x52cf('0x71')]);console[_0x52cf('0x49')](_0x52cf('0x70'),_0x17bf31);});}exports[_0x52cf('0x72')]=function(_0x3eff6a,_0x23649a,_0x5b51b3,_0x249bda,_0x5b54cf,_0x14d5fc){var _0x1cd38a,_0x166b0f,_0x1a6789;_0x14d5fc['host']=intUtil[_0x52cf('0x73')](_0x14d5fc['host']);_0x14d5fc[_0x52cf('0x74')]=intUtil[_0x52cf('0x73')](_0x14d5fc[_0x52cf('0x74')]);if(_0x5b54cf&&_0x5b54cf[_0x52cf('0x75')]){logger[_0x52cf('0x35')](_0x52cf('0x76'),_0x52cf('0x77'));_0x23649a[_0x52cf('0x78')]=_0x14d5fc[_0x52cf('0x74')]+_0x52cf('0x79')+_0x23649a[_0x52cf('0x7a')]+_0x52cf('0x7b')+md5(_0x23649a['uniqueid']);}else{_0x23649a['recordingURL']='';}var _0x80f692=_0x14d5fc[_0x52cf('0x7c')]===_0x52cf('0x7d')?'eu':'com';return getAccessToken(_0x14d5fc)[_0x52cf('0x3d')](function(_0x530dae){_0x1a6789=_0x530dae;return getUser(_0x1a6789,_0x80f692,_0x14d5fc,_0x249bda[_0x52cf('0x34')]);})[_0x52cf('0x3d')](function(_0x32dc36){_0x1cd38a=_0x32dc36;logger['info'](_0x52cf('0x7e'),_0x1cd38a['id']);return getEndUser(_0x1a6789,_0x80f692,_0x14d5fc,_0x23649a[_0x52cf('0x7f')],_0x23649a['calleridnum'],_0x1cd38a,_0x5b51b3);})[_0x52cf('0x3d')](function(_0x1fe3fc){_0x166b0f=_0x1fe3fc;return getCall(_0x1a6789,_0x80f692,_0x14d5fc,_0x1cd38a,_0x166b0f,_0x5b51b3,_0x23649a,_0x52cf('0x80'));})[_0x52cf('0x3d')](function(_0x576e1f){if(_0x576e1f){logger[_0x52cf('0x35')]('The\x20Call\x20ID\x20is:',_0x576e1f['id']);logger[_0x52cf('0x35')](_0x52cf('0x76'),_0x52cf('0x81'));emit(util[_0x52cf('0x2d')](_0x52cf('0x82'),_0x249bda[_0x52cf('0x17')]),_0x52cf('0x83'),{'uri':_0x52cf('0x84')+_0x14d5fc['host']+_0x52cf('0x85')+_0x576e1f['id']});}})[_0x52cf('0x29')](function(_0x29ee77){logger['error']('[QUEUE]',JSON[_0x52cf('0xd')](_0x29ee77));});};exports['outbound']=function(_0x497326,_0x12d9ca,_0x54efc2,_0x418ffb,_0x46b916,_0x46e6e6,_0x36de0e){var _0x1eb1fc,_0x45cecf,_0x45e3be;_0x46e6e6['host']=intUtil[_0x52cf('0x73')](_0x46e6e6['host']);_0x46e6e6[_0x52cf('0x74')]=intUtil[_0x52cf('0x73')](_0x46e6e6[_0x52cf('0x74')]);if(_0x36de0e&&_0x36de0e['recordingFormat']&&_0x36de0e[_0x52cf('0x86')]!==_0x52cf('0x87')){logger[_0x52cf('0x35')]('[OUTBOUND]',_0x52cf('0x77'));_0x12d9ca['recordingURL']=_0x46e6e6[_0x52cf('0x74')]+_0x52cf('0x79')+_0x12d9ca[_0x52cf('0x7a')]+_0x52cf('0x7b')+md5(_0x12d9ca['uniqueid']);}var _0x688ee0=_0x46e6e6[_0x52cf('0x7c')]===_0x52cf('0x7d')?'eu':_0x52cf('0x88');return getAccessToken(_0x46e6e6)['then'](function(_0x14acd1){_0x45e3be=_0x14acd1;return getUser(_0x45e3be,_0x688ee0,_0x46e6e6,_0x418ffb['email']);})[_0x52cf('0x3d')](function(_0x2956dd){_0x1eb1fc=_0x2956dd;logger[_0x52cf('0x35')](_0x52cf('0x7e'),_0x1eb1fc['id']);return getEndUser(_0x45e3be,_0x688ee0,_0x46e6e6,_0x12d9ca[_0x52cf('0x89')],_0x12d9ca[_0x52cf('0x8a')],_0x1eb1fc,_0x54efc2);})[_0x52cf('0x3d')](function(_0x5572df){_0x45cecf=_0x5572df;return getCall(_0x45e3be,_0x688ee0,_0x46e6e6,_0x1eb1fc,_0x45cecf,_0x54efc2,_0x12d9ca,'Outbound');})[_0x52cf('0x3d')](function(_0x28d1b4){if(_0x28d1b4){logger['info'](_0x52cf('0x8b'),_0x28d1b4['id']);logger[_0x52cf('0x35')](_0x52cf('0x8c'),_0x52cf('0x81'));emit(util[_0x52cf('0x2d')]('user:%s',_0x418ffb[_0x52cf('0x17')]),_0x52cf('0x83'),{'uri':_0x52cf('0x84')+_0x46e6e6[_0x52cf('0x7c')]+_0x52cf('0x85')+_0x28d1b4['id']});}})['catch'](function(_0xc38732){logger[_0x52cf('0x2a')](_0x52cf('0x8c'),JSON[_0x52cf('0xd')](_0xc38732));});};exports['unmanaged']=function(_0x581a03,_0x3b2427,_0x4b2d05,_0x28bf80,_0x5c5663,_0x218db8){var _0x33427c,_0x4c3fde,_0x19201d;_0x218db8[_0x52cf('0x7c')]=intUtil['stripTrailingSlash'](_0x218db8['host']);_0x218db8[_0x52cf('0x74')]=intUtil[_0x52cf('0x73')](_0x218db8[_0x52cf('0x74')]);if(_0x5c5663&&_0x5c5663[_0x52cf('0x75')]){logger[_0x52cf('0x35')]('['+_0x3b2427[_0x52cf('0x63')][_0x52cf('0x8d')]()+']',_0x52cf('0x77'));_0x3b2427['recordingURL']=_0x218db8[_0x52cf('0x74')]+_0x52cf('0x79')+_0x3b2427[_0x52cf('0x7a')]+_0x52cf('0x7b')+md5(_0x3b2427[_0x52cf('0x7a')]);}else{_0x3b2427[_0x52cf('0x78')]='';}var _0x1e09ca=_0x218db8[_0x52cf('0x7c')]===_0x52cf('0x7d')?'eu':_0x52cf('0x88');return getAccessToken(_0x218db8)[_0x52cf('0x3d')](function(_0x11b556){_0x19201d=_0x11b556;return getUser(_0x19201d,_0x1e09ca,_0x218db8);})[_0x52cf('0x3d')](function(_0x25e065){_0x33427c=_0x25e065;logger[_0x52cf('0x35')]('The\x20User\x20ID\x20is:',_0x33427c['id']);return getEndUser(_0x19201d,_0x1e09ca,_0x218db8,_0x3b2427[_0x52cf('0x7f')],_0x3b2427[_0x52cf('0x8e')],_0x33427c,_0x4b2d05);})[_0x52cf('0x3d')](function(_0x27361e){_0x4c3fde=_0x27361e;return getCall(_0x19201d,_0x1e09ca,_0x218db8,_0x33427c,_0x4c3fde,_0x4b2d05,_0x3b2427,_0x52cf('0x80'));})[_0x52cf('0x3d')](function(_0x4b3a51){if(_0x4b3a51){logger[_0x52cf('0x35')](_0x52cf('0x8b'),_0x4b3a51['id']);}})[_0x52cf('0x29')](function(_0x4c141e){logger[_0x52cf('0x2a')]('['+_0x3b2427[_0x52cf('0x63')]['toUpperCase']()+']',JSON['stringify'](_0x4c141e));});}; \ 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 9b426bc..781164f 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(_0x24d3ab,_0x45bb09){var _0x6fc4e7=function(_0x202fd6){while(--_0x202fd6){_0x24d3ab['push'](_0x24d3ab['shift']());}};_0x6fc4e7(++_0x45bb09);}(_0x7a54,0x106));var _0x47a5=function(_0x2a810e,_0x4ce547){_0x2a810e=_0x2a810e-0x0;var _0x4ffde0=_0x7a54[_0x2a810e];return _0x4ffde0;};'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(_0x325fa2,_0x4d446d){var _0x7ca4b8=function(_0xa945ed){while(--_0xa945ed){_0x325fa2['push'](_0x325fa2['shift']());}};_0x7ca4b8(++_0x4d446d);}(_0x7a54,0x106));var _0x47a5=function(_0x81907e,_0x3b4ef8){_0x81907e=_0x81907e-0x0;var _0x1d14b3=_0x7a54[_0x81907e];return _0x1d14b3;};'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 b92c66c..8f2bcd7 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(_0x478596,_0x1329fd){var _0x125d65=function(_0x4c9306){while(--_0x4c9306){_0x478596['push'](_0x478596['shift']());}};_0x125d65(++_0x1329fd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x55aea5,_0x167e99){_0x55aea5=_0x55aea5-0x0;var _0x1ee183=_0x5f2f[_0x55aea5];return _0x1ee183;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x2842df,_0x2f33a2){var _0x2db88=function(_0x263bc5){while(--_0x263bc5){_0x2842df['push'](_0x2842df['shift']());}};_0x2db88(++_0x2f33a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3039e0,_0x155469){_0x3039e0=_0x3039e0-0x0;var _0x3d817f=_0x5f2f[_0x3039e0];return _0x3d817f;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4c71bbf..d7fa4dd 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 _0x95f4=['exports','jayson/promise','bluebird','../../config/logger','http','Request','request','debug','rpc','error','message','catch'];(function(_0x1d5d49,_0x2c2b65){var _0x3cfb67=function(_0x2c829a){while(--_0x2c829a){_0x1d5d49['push'](_0x1d5d49['shift']());}};_0x3cfb67(++_0x2c2b65);}(_0x95f4,0xf1));var _0x495f=function(_0x1059f5,_0x302f68){_0x1059f5=_0x1059f5-0x0;var _0x38e23c=_0x95f4[_0x1059f5];return _0x38e23c;};'use strict';var jayson=require(_0x495f('0x0'));var BPromise=require(_0x495f('0x1'));var logger=require(_0x495f('0x2'))('routing');var client=jayson['client'][_0x495f('0x3')]({'port':0x2329});client[_0x495f('0x4')]=function(_0x5edb36,_0x501377){return new BPromise(function(_0x87cc22,_0x22465d){return client[_0x495f('0x5')](_0x5edb36,_0x501377)['then'](function(_0x704a46){logger[_0x495f('0x6')](_0x495f('0x7'),'routing',_0x5edb36,_0x501377,_0x704a46);if(_0x704a46[_0x495f('0x8')]){logger[_0x495f('0x8')](_0x495f('0x7'),'routing',_0x5edb36,_0x704a46['error'][_0x495f('0x9')],_0x501377);return _0x22465d(_0x704a46['error'][_0x495f('0x9')]);}else{return _0x87cc22(_0x704a46['result']);}})[_0x495f('0xa')](function(_0x41aa07){logger[_0x495f('0x8')](_0x495f('0x7'),'routing',_0x5edb36,_0x41aa07,_0x501377);return _0x22465d(_0x41aa07);});});};module[_0x495f('0xb')]=client; \ No newline at end of file +var _0xf698=['rpc','error','message','result','catch','jayson/promise','bluebird','routing','client','Request','request'];(function(_0x470487,_0x100b7a){var _0xa54074=function(_0xfb0736){while(--_0xfb0736){_0x470487['push'](_0x470487['shift']());}};_0xa54074(++_0x100b7a);}(_0xf698,0x1de));var _0x8f69=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xf698[_0x148c09];return _0x18e613;};'use strict';var jayson=require(_0x8f69('0x0'));var BPromise=require(_0x8f69('0x1'));var logger=require('../../config/logger')(_0x8f69('0x2'));var client=jayson[_0x8f69('0x3')]['http']({'port':0x2329});client[_0x8f69('0x4')]=function(_0x220362,_0x83c2db){return new BPromise(function(_0x355676,_0x51d187){return client[_0x8f69('0x5')](_0x220362,_0x83c2db)['then'](function(_0x56df1b){logger['debug'](_0x8f69('0x6'),_0x8f69('0x2'),_0x220362,_0x83c2db,_0x56df1b);if(_0x56df1b[_0x8f69('0x7')]){logger[_0x8f69('0x7')](_0x8f69('0x6'),_0x8f69('0x2'),_0x220362,_0x56df1b[_0x8f69('0x7')][_0x8f69('0x8')],_0x83c2db);return _0x51d187(_0x56df1b[_0x8f69('0x7')][_0x8f69('0x8')]);}else{return _0x355676(_0x56df1b[_0x8f69('0x9')]);}})[_0x8f69('0xa')](function(_0x5ba793){logger[_0x8f69('0x7')]('rpc',_0x8f69('0x2'),_0x220362,_0x5ba793,_0x83c2db);return _0x51d187(_0x5ba793);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b3889d9..c93ee5b 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 _0x8a5c=['catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency'];(function(_0x5664f6,_0x2a7278){var _0x3a1996=function(_0x566f33){while(--_0x566f33){_0x5664f6['push'](_0x5664f6['shift']());}};_0x3a1996(++_0x2a7278);}(_0x8a5c,0x112));var _0xc8a5=function(_0x2e2cd0,_0x2d726b){_0x2e2cd0=_0x2e2cd0-0x0;var _0x59d31c=_0x8a5c[_0x2e2cd0];return _0x59d31c;};'use strict';var BPromise=require('bluebird');var server=require(_0xc8a5('0x0'));var Realtime=require(_0xc8a5('0x1'));var EmailChannel=require(_0xc8a5('0x2'));var mailAccount=require(_0xc8a5('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc8a5('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0xc8a5('0x5')](mailAccount[_0xc8a5('0x6')]())['then'](realtime[_0xc8a5('0x7')]())['then'](function(){email[_0xc8a5('0x8')](realtime[_0xc8a5('0x9')]);return realtime;});}function main(){return server[_0xc8a5('0xa')](realtime,email)[_0xc8a5('0x5')](function(_0x276c15){return initRealtime();})[_0xc8a5('0x5')](function(_0x1de487){return db[_0xc8a5('0xb')][_0xc8a5('0xc')]({'attributes':['id',_0xc8a5('0xd')],'raw':!![]});})[_0xc8a5('0x5')](function(_0x1a5d79){return setInterval(initRealtime,_0x1a5d79[_0xc8a5('0xd')]*0x3e8);})[_0xc8a5('0xe')](function(_0x270030){console[_0xc8a5('0xf')](_0x270030);});}main(); \ No newline at end of file +var _0x00b3=['refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./lib/email','./rpc/mailAccount','then','getMailAccounts'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x00b3,0x97));var _0x300b=function(_0x5b50eb,_0x1c7885){_0x5b50eb=_0x5b50eb-0x0;var _0x580b0c=_0x00b3[_0x5b50eb];return _0x580b0c;};'use strict';var BPromise=require(_0x300b('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x300b('0x1'));var mailAccount=require(_0x300b('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise['resolve']()[_0x300b('0x3')](mailAccount[_0x300b('0x4')]())[_0x300b('0x3')](realtime['initMailAccounts']())[_0x300b('0x3')](function(){email[_0x300b('0x5')](realtime[_0x300b('0x6')]);return realtime;});}function main(){return server[_0x300b('0x7')](realtime,email)[_0x300b('0x3')](function(_0x2cf1c5){return initRealtime();})[_0x300b('0x3')](function(_0xcd2a68){return db[_0x300b('0x8')][_0x300b('0x9')]({'attributes':['id',_0x300b('0xa')],'raw':!![]});})[_0x300b('0x3')](function(_0x474b99){return setInterval(initRealtime,_0x474b99['loginMailFrequency']*0x3e8);})[_0x300b('0xb')](function(_0x181152){console[_0x300b('0xc')](_0x181152);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5d1c85b..8d494f1 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 _0xde82=['catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','email','defaults','redis','localhost','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','messageStatus','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','status','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing'];(function(_0x3a10e3,_0x3cdb35){var _0xf067c8=function(_0x184beb){while(--_0x184beb){_0x3a10e3['push'](_0x3a10e3['shift']());}};_0xf067c8(++_0x3cdb35);}(_0xde82,0x1c4));var _0x2de8=function(_0x18a36b,_0x2d3e5f){_0x18a36b=_0x18a36b-0x0;var _0x58d4c3=_0xde82[_0x18a36b];return _0x58d4c3;};'use strict';var _=require(_0x2de8('0x0'));var moment=require(_0x2de8('0x1'));var BPromise=require('bluebird');var md5=require(_0x2de8('0x2'));var Redis=require(_0x2de8('0x3'));var config=require(_0x2de8('0x4'));var logger=require('../../../config/logger')(_0x2de8('0x5'));config['redis']=_[_0x2de8('0x6')](config[_0x2de8('0x7')],{'host':_0x2de8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2de8('0x7')]));var EmailImap=require(_0x2de8('0x9'));var EmailSmtp=require(_0x2de8('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3aba5b){logger[_0x2de8('0xb')]('start\x20email\x20channel');this[_0x2de8('0xc')]=_0x3aba5b['mailAccounts'];this[_0x2de8('0xd')]={};this[_0x2de8('0xe')]=new EmailSmtp();}EmailChannel[_0x2de8('0xf')]['emit']=function(_0x5a17fe){var _0x251f0f=this[_0x2de8('0xc')][_0x5a17fe];var _0x5db200={'id':_0x251f0f['id'],'name':_0x251f0f[_0x2de8('0x10')],'key':_0x251f0f[_0x2de8('0x11')],'active':_0x251f0f[_0x2de8('0x12')],'Imap':{'status':_0x251f0f[_0x2de8('0x13')]['status'],'messageStatus':_0x251f0f[_0x2de8('0x13')][_0x2de8('0x14')],'total':_0x251f0f[_0x2de8('0x13')]['total']}};if(_[_0x2de8('0x15')](md5Accounts[_0x5a17fe])){md5Accounts[_0x5a17fe]={};}var _0x5b30d7=md5(JSON[_0x2de8('0x16')](_0x5db200));if(md5Accounts[_0x5a17fe][_0x2de8('0x2')]!==_0x5b30d7){md5Accounts[_0x5a17fe][_0x2de8('0x2')]=_0x5b30d7;io[_0x2de8('0x17')](_0x2de8('0x18'),_0x5db200);}};EmailChannel[_0x2de8('0xf')][_0x2de8('0x19')]=function(_0x507810){for(var _0x3a65f9 in _0x507810){if(_0x507810[_0x2de8('0x1a')](_0x3a65f9)){if(_0x507810[_0x3a65f9][_0x2de8('0x13')]&&_0x507810[_0x3a65f9][_0x2de8('0x12')]){var _0x18fbc6=_0x507810[_0x3a65f9]['Imap'];if(!this['imapAccounts'][_0x2de8('0x1a')](_0x18fbc6['id'])){this['imapAccounts'][_0x18fbc6['id']]=new EmailImap(_0x18fbc6,_0x507810[_0x3a65f9][_0x2de8('0x5')]);this[_0x2de8('0xd')][_0x18fbc6['id']]['on']('box',this[_0x2de8('0x1b')][_0x2de8('0x1c')](this,_0x3a65f9));this['imapAccounts'][_0x18fbc6['id']]['on'](_0x2de8('0x5'),this[_0x2de8('0x1d')][_0x2de8('0x1c')](this,_0x3a65f9));this[_0x2de8('0xd')][_0x18fbc6['id']]['on'](_0x2de8('0x1e'),this['handleImapEnd'][_0x2de8('0x1c')](this,_0x3a65f9));this[_0x2de8('0xd')][_0x18fbc6['id']]['on'](_0x2de8('0x1f'),this['handleImapError'][_0x2de8('0x1c')](this,_0x3a65f9));}}else{if(_['isNil'](this['mailAccounts'][_0x3a65f9]['Imap'])){this[_0x2de8('0xc')][_0x3a65f9][_0x2de8('0x13')]={};}this[_0x2de8('0xc')][_0x3a65f9][_0x2de8('0x13')][_0x2de8('0x20')]=_0x2de8('0x21');this['mailAccounts'][_0x3a65f9]['Imap'][_0x2de8('0x14')]='';this[_0x2de8('0x17')](_0x3a65f9);}}}};EmailChannel[_0x2de8('0xf')][_0x2de8('0x1b')]=function(_0x1b1b18,_0x22c7b5){if(this[_0x2de8('0xc')][_0x1b1b18]){this[_0x2de8('0xc')][_0x1b1b18][_0x2de8('0x13')][_0x2de8('0x20')]=_0x2de8('0x22');this[_0x2de8('0xc')][_0x1b1b18][_0x2de8('0x13')][_0x2de8('0x14')]=_0x22c7b5[_0x2de8('0x10')];if(_0x22c7b5[_0x2de8('0x23')]){this['mailAccounts'][_0x1b1b18][_0x2de8('0x13')]['total']=_0x22c7b5['messages'][_0x2de8('0x24')];}return this[_0x2de8('0x17')](_0x1b1b18);}};EmailChannel[_0x2de8('0xf')][_0x2de8('0x1d')]=function(_0xdf6a82,_0xa873da){logger[_0x2de8('0xb')](_0x2de8('0x25'),_0xa873da[_0x2de8('0x26')],_0xa873da['lastName'],_0xa873da[_0x2de8('0x27')],_0xdf6a82);if(this[_0x2de8('0xc')][_0xdf6a82]){return mailAccount[_0x2de8('0x28')](_0xdf6a82,_0xa873da)[_0x2de8('0x29')](function(_0xc18996){if(_0xc18996){logger['info'](_0x2de8('0x2a'));}})[_0x2de8('0x2b')](function(_0x5ed9cb){logger[_0x2de8('0x1f')](_0x2de8('0x2c'),JSON[_0x2de8('0x16')](_0x5ed9cb));});}};EmailChannel['prototype'][_0x2de8('0x2d')]=function(_0x4904f0){if(this[_0x2de8('0xc')][_0x4904f0]&&this[_0x2de8('0xc')][_0x4904f0][_0x2de8('0x13')]){if(this[_0x2de8('0xd')][this[_0x2de8('0xc')][_0x4904f0][_0x2de8('0x13')]['id']]){delete this['imapAccounts'][this[_0x2de8('0xc')][_0x4904f0][_0x2de8('0x13')]['id']];}this[_0x2de8('0xc')][_0x4904f0][_0x2de8('0x13')][_0x2de8('0x2e')]=moment();this[_0x2de8('0x17')](_0x4904f0);}};EmailChannel['prototype'][_0x2de8('0x2f')]=function(_0x428198,_0x455b9c){if(this['mailAccounts'][_0x428198]){this[_0x2de8('0xc')][_0x428198][_0x2de8('0x13')][_0x2de8('0x20')]=_0x2de8('0x1f');this[_0x2de8('0xc')][_0x428198][_0x2de8('0x13')]['messageStatus']=_0x455b9c;return this[_0x2de8('0x17')](_0x428198);}};EmailChannel['prototype'][_0x2de8('0x30')]=function(_0x303005,_0x536324){return this[_0x2de8('0xe')][_0x2de8('0x31')](_0x303005,_0x536324);};EmailChannel[_0x2de8('0xf')][_0x2de8('0x32')]=function(_0x40c8bc){var _0x3a63c4=this;if(this[_0x2de8('0xc')][_0x40c8bc['id']]){if(_[_0x2de8('0x15')](this['mailAccounts'][_0x40c8bc['id']][_0x2de8('0x33')])){this[_0x2de8('0xc')][_0x40c8bc['id']][_0x2de8('0x33')]={};}this[_0x2de8('0xc')][_0x40c8bc['id']]['Smtp'][_0x2de8('0x2e')]=moment();return new BPromise(function(_0x12364f,_0x37ce5c){return _0x3a63c4[_0x2de8('0xe')][_0x2de8('0x34')](_0x40c8bc)[_0x2de8('0x29')](function(_0x5908bc){_0x3a63c4['mailAccounts'][_0x40c8bc['id']][_0x2de8('0x33')]['status']=_0x2de8('0x35');_0x3a63c4['mailAccounts'][_0x40c8bc['id']][_0x2de8('0x33')][_0x2de8('0x14')]='';_0x3a63c4[_0x2de8('0x17')](_0x40c8bc['id']);_0x12364f(_0x5908bc);})['catch'](function(_0x3bc65a){_0x3a63c4[_0x2de8('0xc')][_0x40c8bc['id']][_0x2de8('0x33')][_0x2de8('0x20')]=_0x2de8('0x1f');_0x3a63c4[_0x2de8('0xc')][_0x40c8bc['id']][_0x2de8('0x33')]['messageStatus']=_0x3bc65a;_0x3a63c4[_0x2de8('0x17')](_0x40c8bc['id']);_0x37ce5c(_0x3bc65a);});});}return this[_0x2de8('0xe')][_0x2de8('0x34')](_0x40c8bc);};module[_0x2de8('0x36')]=EmailChannel; \ No newline at end of file +var _0xe82b=['box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','isNil','disabled','connected','messages','prototype','info','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','smtp','verifySmtp','Smtp','lastSync','verify','verified','catch','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','name','key','active','Imap','status','messageStatus','total','stringify','emit','refresh','hasOwnProperty','imapAccounts'];(function(_0x42cf0a,_0x2d9a16){var _0x30058e=function(_0x472ce2){while(--_0x472ce2){_0x42cf0a['push'](_0x42cf0a['shift']());}};_0x30058e(++_0x2d9a16);}(_0xe82b,0x135));var _0xbe82=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xe82b[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xbe82('0x0'));var moment=require(_0xbe82('0x1'));var BPromise=require('bluebird');var md5=require(_0xbe82('0x2'));var Redis=require(_0xbe82('0x3'));var config=require(_0xbe82('0x4'));var logger=require(_0xbe82('0x5'))(_0xbe82('0x6'));config[_0xbe82('0x7')]=_['defaults'](config[_0xbe82('0x7')],{'host':_0xbe82('0x8'),'port':0x18eb});var io=require(_0xbe82('0x9'))(new Redis(config[_0xbe82('0x7')]));var EmailImap=require(_0xbe82('0xa'));var EmailSmtp=require(_0xbe82('0xb'));var mailAccount=require(_0xbe82('0xc'));var md5Accounts={};function EmailChannel(_0x5dfc80){logger['info'](_0xbe82('0xd'));this[_0xbe82('0xe')]=_0x5dfc80[_0xbe82('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x56c4ad){var _0x442afb=this[_0xbe82('0xe')][_0x56c4ad];var _0x46060f={'id':_0x442afb['id'],'name':_0x442afb[_0xbe82('0xf')],'key':_0x442afb[_0xbe82('0x10')],'active':_0x442afb[_0xbe82('0x11')],'Imap':{'status':_0x442afb[_0xbe82('0x12')][_0xbe82('0x13')],'messageStatus':_0x442afb[_0xbe82('0x12')][_0xbe82('0x14')],'total':_0x442afb[_0xbe82('0x12')][_0xbe82('0x15')]}};if(_['isNil'](md5Accounts[_0x56c4ad])){md5Accounts[_0x56c4ad]={};}var _0x1e3473=md5(JSON[_0xbe82('0x16')](_0x46060f));if(md5Accounts[_0x56c4ad][_0xbe82('0x2')]!==_0x1e3473){md5Accounts[_0x56c4ad][_0xbe82('0x2')]=_0x1e3473;io[_0xbe82('0x17')]('mailAccount:update',_0x46060f);}};EmailChannel['prototype'][_0xbe82('0x18')]=function(_0x305b2b){for(var _0x150c55 in _0x305b2b){if(_0x305b2b[_0xbe82('0x19')](_0x150c55)){if(_0x305b2b[_0x150c55][_0xbe82('0x12')]&&_0x305b2b[_0x150c55][_0xbe82('0x11')]){var _0x1ee91b=_0x305b2b[_0x150c55][_0xbe82('0x12')];if(!this[_0xbe82('0x1a')][_0xbe82('0x19')](_0x1ee91b['id'])){this[_0xbe82('0x1a')][_0x1ee91b['id']]=new EmailImap(_0x1ee91b,_0x305b2b[_0x150c55]['email']);this[_0xbe82('0x1a')][_0x1ee91b['id']]['on'](_0xbe82('0x1b'),this[_0xbe82('0x1c')][_0xbe82('0x1d')](this,_0x150c55));this[_0xbe82('0x1a')][_0x1ee91b['id']]['on'](_0xbe82('0x6'),this[_0xbe82('0x1e')][_0xbe82('0x1d')](this,_0x150c55));this[_0xbe82('0x1a')][_0x1ee91b['id']]['on'](_0xbe82('0x1f'),this[_0xbe82('0x20')][_0xbe82('0x1d')](this,_0x150c55));this[_0xbe82('0x1a')][_0x1ee91b['id']]['on']('error',this[_0xbe82('0x21')][_0xbe82('0x1d')](this,_0x150c55));}}else{if(_[_0xbe82('0x22')](this[_0xbe82('0xe')][_0x150c55][_0xbe82('0x12')])){this[_0xbe82('0xe')][_0x150c55][_0xbe82('0x12')]={};}this['mailAccounts'][_0x150c55]['Imap'][_0xbe82('0x13')]=_0xbe82('0x23');this[_0xbe82('0xe')][_0x150c55][_0xbe82('0x12')][_0xbe82('0x14')]='';this['emit'](_0x150c55);}}}};EmailChannel['prototype'][_0xbe82('0x1c')]=function(_0x2b4597,_0x38c987){if(this[_0xbe82('0xe')][_0x2b4597]){this[_0xbe82('0xe')][_0x2b4597]['Imap']['status']=_0xbe82('0x24');this[_0xbe82('0xe')][_0x2b4597][_0xbe82('0x12')][_0xbe82('0x14')]=_0x38c987[_0xbe82('0xf')];if(_0x38c987[_0xbe82('0x25')]){this[_0xbe82('0xe')][_0x2b4597][_0xbe82('0x12')]['total']=_0x38c987[_0xbe82('0x25')][_0xbe82('0x15')];}return this['emit'](_0x2b4597);}};EmailChannel[_0xbe82('0x26')][_0xbe82('0x1e')]=function(_0x5b1dc8,_0x4cd8c6){logger[_0xbe82('0x27')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x4cd8c6[_0xbe82('0x28')],_0x4cd8c6['lastName'],_0x4cd8c6[_0xbe82('0x29')],_0x5b1dc8);if(this[_0xbe82('0xe')][_0x5b1dc8]){return mailAccount[_0xbe82('0x2a')](_0x5b1dc8,_0x4cd8c6)[_0xbe82('0x2b')](function(_0x1b4359){if(_0x1b4359){logger[_0xbe82('0x27')](_0xbe82('0x2c'));}})['catch'](function(_0x39d246){logger[_0xbe82('0x2d')](_0xbe82('0x2e'),JSON['stringify'](_0x39d246));});}};EmailChannel[_0xbe82('0x26')][_0xbe82('0x20')]=function(_0x202cb5){if(this[_0xbe82('0xe')][_0x202cb5]&&this['mailAccounts'][_0x202cb5][_0xbe82('0x12')]){if(this[_0xbe82('0x1a')][this[_0xbe82('0xe')][_0x202cb5][_0xbe82('0x12')]['id']]){delete this[_0xbe82('0x1a')][this[_0xbe82('0xe')][_0x202cb5][_0xbe82('0x12')]['id']];}this['mailAccounts'][_0x202cb5][_0xbe82('0x12')]['lastSync']=moment();this[_0xbe82('0x17')](_0x202cb5);}};EmailChannel['prototype'][_0xbe82('0x21')]=function(_0x2afb24,_0x353992){if(this[_0xbe82('0xe')][_0x2afb24]){this[_0xbe82('0xe')][_0x2afb24]['Imap'][_0xbe82('0x13')]=_0xbe82('0x2d');this[_0xbe82('0xe')][_0x2afb24][_0xbe82('0x12')]['messageStatus']=_0x353992;return this[_0xbe82('0x17')](_0x2afb24);}};EmailChannel[_0xbe82('0x26')][_0xbe82('0x2f')]=function(_0x4b4ec5,_0x50c328){return this[_0xbe82('0x30')]['send'](_0x4b4ec5,_0x50c328);};EmailChannel[_0xbe82('0x26')][_0xbe82('0x31')]=function(_0x365fbd){var _0x5c4dfb=this;if(this[_0xbe82('0xe')][_0x365fbd['id']]){if(_[_0xbe82('0x22')](this['mailAccounts'][_0x365fbd['id']][_0xbe82('0x32')])){this[_0xbe82('0xe')][_0x365fbd['id']]['Smtp']={};}this[_0xbe82('0xe')][_0x365fbd['id']][_0xbe82('0x32')][_0xbe82('0x33')]=moment();return new BPromise(function(_0x5afdfc,_0x29ee85){return _0x5c4dfb[_0xbe82('0x30')][_0xbe82('0x34')](_0x365fbd)[_0xbe82('0x2b')](function(_0x8d3fdb){_0x5c4dfb[_0xbe82('0xe')][_0x365fbd['id']][_0xbe82('0x32')][_0xbe82('0x13')]=_0xbe82('0x35');_0x5c4dfb[_0xbe82('0xe')][_0x365fbd['id']]['Smtp']['messageStatus']='';_0x5c4dfb[_0xbe82('0x17')](_0x365fbd['id']);_0x5afdfc(_0x8d3fdb);})[_0xbe82('0x36')](function(_0x50b7dc){_0x5c4dfb[_0xbe82('0xe')][_0x365fbd['id']][_0xbe82('0x32')]['status']=_0xbe82('0x2d');_0x5c4dfb[_0xbe82('0xe')][_0x365fbd['id']]['Smtp'][_0xbe82('0x14')]=_0x50b7dc;_0x5c4dfb[_0xbe82('0x17')](_0x365fbd['id']);_0x29ee85(_0x50b7dc);});});}return this[_0xbe82('0x30')][_0xbe82('0x34')](_0x365fbd);};module[_0xbe82('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b2020e8..a5c478e 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 _0xfce8=['handleSimpleParser','stringify','textCode','upperFirst','exports','path','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','email','anonymous@xcally.com','prototype','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfce8,0xf9));var _0x8fce=function(_0x1c1f72,_0x219e0b){_0x1c1f72=_0x1c1f72-0x0;var _0x4baf14=_0xfce8[_0x1c1f72];return _0x4baf14;};'use strict';var fs=require('fs');var path=require(_0x8fce('0x0'));var util=require('util');var Imap=require(_0x8fce('0x1'));var _=require(_0x8fce('0x2'));var rs=require(_0x8fce('0x3'));var simpleParser=require(_0x8fce('0x4'))[_0x8fce('0x5')];var Iconv=require(_0x8fce('0x6'))[_0x8fce('0x7')];var EventEmitter=require(_0x8fce('0x8'))[_0x8fce('0x9')];var utils=require(_0x8fce('0xa'));var logger=require(_0x8fce('0xb'))('email');function EmailImap(_0x392070,_0x822489){this['mailbox']='INBOX';this[_0x8fce('0xc')]=this[_0x8fce('0xd')](_0x392070,_0x822489);this[_0x8fce('0x1')]=new Imap(this['account']);this[_0x8fce('0x1')][_0x8fce('0xe')](_0x8fce('0xf'),this[_0x8fce('0x10')][_0x8fce('0x11')](this));this[_0x8fce('0x1')][_0x8fce('0xe')](_0x8fce('0x12'),this[_0x8fce('0x13')]['bind'](this));this['imap']['on'](_0x8fce('0x14'),this[_0x8fce('0x15')][_0x8fce('0x11')](this));this[_0x8fce('0x1')][_0x8fce('0x16')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x8fce('0xd')]=function(_0x580102,_0x86dc8f){var _0x4b9947={'connTimeout':_0x580102['connTimeout']?_0x580102[_0x8fce('0x17')]*0x3e8:0x2710,'authTimeout':_0x580102['authTimeout']?_0x580102[_0x8fce('0x18')]*0x3e8:0x1388};if(_[_0x8fce('0x19')](_0x580102[_0x8fce('0x1a')])){if(_0x580102[_0x8fce('0x1b')]){_0x4b9947[_0x8fce('0x1c')]=_0x580102['user'];_0x4b9947[_0x8fce('0x1d')]=_0x580102['password'];}_0x4b9947['host']=_0x580102[_0x8fce('0x1e')];_0x4b9947[_0x8fce('0x1f')]=_0x580102[_0x8fce('0x1f')]||0x3e1;if(_0x580102[_0x8fce('0x20')]){_0x4b9947['tls']=!![];}else{_0x4b9947[_0x8fce('0x20')]=![];_0x4b9947['autotls']=_0x8fce('0x21');}}else{_0x4b9947[_0x8fce('0x1c')]=_0x580102[_0x8fce('0x1c')];_0x4b9947['password']=_0x580102[_0x8fce('0x1d')];_0x4b9947[_0x8fce('0x1e')]=utils[_0x8fce('0x22')](_0x580102[_0x8fce('0x1a')]);_0x4b9947[_0x8fce('0x1f')]=0x3e1;_0x4b9947[_0x8fce('0x20')]=!![];}_0x4b9947[_0x8fce('0x23')]=_0x86dc8f||_0x580102[_0x8fce('0x1c')]||_0x8fce('0x24');return _0x4b9947;};EmailImap[_0x8fce('0x25')][_0x8fce('0x10')]=function(){this[_0x8fce('0x1')][_0x8fce('0x26')](this[_0x8fce('0x27')],![],this['handleOpenBox'][_0x8fce('0x11')](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x28')]=function(_0x23ca9e,_0x20a102){if(_0x23ca9e){this['handleError'](_0x23ca9e,!![]);}else{this[_0x8fce('0x29')](_0x8fce('0x2a'),_0x20a102);this[_0x8fce('0x2b')]();}};EmailImap[_0x8fce('0x25')][_0x8fce('0x2c')]=function(_0x2487ef){if(_0x2487ef){this[_0x8fce('0x15')](_0x2487ef,!![]);}else{this[_0x8fce('0x1')][_0x8fce('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x8fce('0x2d')]([_0x8fce('0x2e')],this['handleReadUnseen'][_0x8fce('0x11')](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x2f')]=function(_0x312a83,_0x99329c){if(_0x312a83){this[_0x8fce('0x15')](_0x312a83,!![]);}else{if(_0x99329c['length']){try{var _0x54171f=this[_0x8fce('0x1')]['fetch'](_0x99329c,{'bodies':'','markSeen':!![]});_0x54171f['on']('message',this['handleFetchMessage']['bind'](this));_0x54171f[_0x8fce('0xe')]('error',this[_0x8fce('0x30')][_0x8fce('0x11')](this));_0x54171f['once'](_0x8fce('0x12'),this[_0x8fce('0x31')]['bind'](this));}catch(_0x208819){logger[_0x8fce('0x14')](_0x208819);}}else{this[_0x8fce('0x1')][_0x8fce('0x32')](!![],this[_0x8fce('0x2c')][_0x8fce('0x11')](this));}}};EmailImap['prototype'][_0x8fce('0x33')]=function(_0x47c3e3,_0x213c91){_0x47c3e3['on']('body',this['handleMessageBody'][_0x8fce('0x11')](this));_0x47c3e3['once'](_0x8fce('0x34'),this[_0x8fce('0x35')][_0x8fce('0x11')](this));_0x47c3e3[_0x8fce('0xe')](_0x8fce('0x12'),this[_0x8fce('0x36')]['bind'](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x37')]=function(_0x36764c,_0xe2ccc2){simpleParser(_0x36764c,{'Iconv':Iconv},this[_0x8fce('0x38')]['bind'](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x35')]=function(_0x5a0ce8){};EmailImap[_0x8fce('0x25')]['handleMessageEnd']=function(){};EmailImap[_0x8fce('0x25')]['handleSimpleParser']=function(_0x4655b5,_0xe21588){if(_0x4655b5){logger[_0x8fce('0x14')](_0x4655b5);}else{var _0x2aec37=this;utils['parser'](this[_0x8fce('0xc')],_0xe21588,function(_0x2cdb70){_0x2aec37[_0x8fce('0x29')]('email',_0x2cdb70);});}};EmailImap[_0x8fce('0x25')]['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this[_0x8fce('0x2c')][_0x8fce('0x11')](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x30')]=function(_0x29d52f){this[_0x8fce('0x15')](_0x29d52f);this['imap']['closeBox'](!![],this[_0x8fce('0x2c')]['bind'](this));};EmailImap[_0x8fce('0x25')][_0x8fce('0x13')]=function(){this[_0x8fce('0x29')](_0x8fce('0x12'));};EmailImap['prototype'][_0x8fce('0x15')]=function(_0x3a756f,_0x3b0e9f){logger[_0x8fce('0x14')]('handleError',this[_0x8fce('0xc')][_0x8fce('0x23')],JSON[_0x8fce('0x39')](_0x3a756f));var _0x2ed9f0='';if(_0x3a756f){if(_0x3a756f[_0x8fce('0x3a')]){_0x2ed9f0=_0x3a756f['textCode'];}else{for(var _0x40790c in _0x3a756f){if(_0x3a756f['hasOwnProperty'](_0x40790c)){_0x2ed9f0+=_[_0x8fce('0x3b')](_0x40790c)+':\x20'+_0x3a756f[_0x40790c]+'\x0a';}}}}if(_0x3b0e9f){this[_0x8fce('0x1')][_0x8fce('0x12')]();}else{this[_0x8fce('0x29')](_0x8fce('0x14'),_0x2ed9f0);this[_0x8fce('0x29')]('end');}};module[_0x8fce('0x3c')]=EmailImap; \ No newline at end of file +var _0xd4f7=['isNil','service','authentication','password','host','port','tls','autotls','required','user','getHost','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','path','util','lodash','randomstring','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','connTimeout','authTimeout'];(function(_0x1134aa,_0x217163){var _0x4480d6=function(_0x565f4a){while(--_0x565f4a){_0x1134aa['push'](_0x1134aa['shift']());}};_0x4480d6(++_0x217163);}(_0xd4f7,0xa5));var _0x7d4f=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xd4f7[_0x59d0cc];return _0x2ae79f;};'use strict';var fs=require('fs');var path=require(_0x7d4f('0x0'));var util=require(_0x7d4f('0x1'));var Imap=require('imap');var _=require(_0x7d4f('0x2'));var rs=require(_0x7d4f('0x3'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x7d4f('0x4'))[_0x7d4f('0x5')];var EventEmitter=require(_0x7d4f('0x6'))[_0x7d4f('0x7')];var utils=require('./utils');var logger=require(_0x7d4f('0x8'))(_0x7d4f('0x9'));function EmailImap(_0x4920c0,_0x500b4d){this[_0x7d4f('0xa')]=_0x7d4f('0xb');this[_0x7d4f('0xc')]=this[_0x7d4f('0xd')](_0x4920c0,_0x500b4d);this[_0x7d4f('0xe')]=new Imap(this[_0x7d4f('0xc')]);this[_0x7d4f('0xe')][_0x7d4f('0xf')](_0x7d4f('0x10'),this[_0x7d4f('0x11')]['bind'](this));this[_0x7d4f('0xe')][_0x7d4f('0xf')](_0x7d4f('0x12'),this[_0x7d4f('0x13')][_0x7d4f('0x14')](this));this['imap']['on'](_0x7d4f('0x15'),this[_0x7d4f('0x16')][_0x7d4f('0x14')](this));this[_0x7d4f('0xe')][_0x7d4f('0x17')]();}util[_0x7d4f('0x18')](EmailImap,EventEmitter);EmailImap['prototype'][_0x7d4f('0xd')]=function(_0x34dc71,_0x2a4297){var _0x5769da={'connTimeout':_0x34dc71['connTimeout']?_0x34dc71[_0x7d4f('0x19')]*0x3e8:0x2710,'authTimeout':_0x34dc71[_0x7d4f('0x1a')]?_0x34dc71['authTimeout']*0x3e8:0x1388};if(_[_0x7d4f('0x1b')](_0x34dc71[_0x7d4f('0x1c')])){if(_0x34dc71[_0x7d4f('0x1d')]){_0x5769da['user']=_0x34dc71['user'];_0x5769da[_0x7d4f('0x1e')]=_0x34dc71[_0x7d4f('0x1e')];}_0x5769da['host']=_0x34dc71[_0x7d4f('0x1f')];_0x5769da[_0x7d4f('0x20')]=_0x34dc71[_0x7d4f('0x20')]||0x3e1;if(_0x34dc71['tls']){_0x5769da[_0x7d4f('0x21')]=!![];}else{_0x5769da['tls']=![];_0x5769da[_0x7d4f('0x22')]=_0x7d4f('0x23');}}else{_0x5769da[_0x7d4f('0x24')]=_0x34dc71[_0x7d4f('0x24')];_0x5769da[_0x7d4f('0x1e')]=_0x34dc71[_0x7d4f('0x1e')];_0x5769da[_0x7d4f('0x1f')]=utils[_0x7d4f('0x25')](_0x34dc71['service']);_0x5769da[_0x7d4f('0x20')]=0x3e1;_0x5769da['tls']=!![];}_0x5769da[_0x7d4f('0x9')]=_0x2a4297||_0x34dc71[_0x7d4f('0x24')]||'anonymous@xcally.com';return _0x5769da;};EmailImap[_0x7d4f('0x26')]['handleReady']=function(){this[_0x7d4f('0xe')][_0x7d4f('0x27')](this['mailbox'],![],this[_0x7d4f('0x28')][_0x7d4f('0x14')](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x28')]=function(_0x26e275,_0x26eccc){if(_0x26e275){this[_0x7d4f('0x16')](_0x26e275,!![]);}else{this[_0x7d4f('0x29')](_0x7d4f('0x2a'),_0x26eccc);this[_0x7d4f('0x2b')]();}};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x2c')]=function(_0x8395d0){if(_0x8395d0){this[_0x7d4f('0x16')](_0x8395d0,!![]);}else{this[_0x7d4f('0xe')]['end']();}};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x2b')]=function(){this[_0x7d4f('0xe')][_0x7d4f('0x2d')]([_0x7d4f('0x2e')],this[_0x7d4f('0x2f')][_0x7d4f('0x14')](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x2f')]=function(_0x1e617f,_0x2cb5da){if(_0x1e617f){this[_0x7d4f('0x16')](_0x1e617f,!![]);}else{if(_0x2cb5da[_0x7d4f('0x30')]){try{var _0x22991b=this[_0x7d4f('0xe')][_0x7d4f('0x31')](_0x2cb5da,{'bodies':'','markSeen':!![]});_0x22991b['on'](_0x7d4f('0x32'),this['handleFetchMessage']['bind'](this));_0x22991b['once'](_0x7d4f('0x15'),this['handleFetchError']['bind'](this));_0x22991b[_0x7d4f('0xf')]('end',this['handleFetchEnd'][_0x7d4f('0x14')](this));}catch(_0x19fbe5){logger[_0x7d4f('0x15')](_0x19fbe5);}}else{this[_0x7d4f('0xe')]['closeBox'](!![],this[_0x7d4f('0x2c')][_0x7d4f('0x14')](this));}}};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x33')]=function(_0x5868f0,_0x524987){_0x5868f0['on']('body',this[_0x7d4f('0x34')][_0x7d4f('0x14')](this));_0x5868f0[_0x7d4f('0xf')]('attributes',this[_0x7d4f('0x35')][_0x7d4f('0x14')](this));_0x5868f0[_0x7d4f('0xf')]('end',this[_0x7d4f('0x36')]['bind'](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x34')]=function(_0xe63df5,_0x51e0ac){simpleParser(_0xe63df5,{'Iconv':Iconv},this[_0x7d4f('0x37')][_0x7d4f('0x14')](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x35')]=function(_0x244ef0){};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x36')]=function(){};EmailImap['prototype'][_0x7d4f('0x37')]=function(_0x5f09e2,_0x41b060){if(_0x5f09e2){logger[_0x7d4f('0x15')](_0x5f09e2);}else{var _0x21720b=this;utils[_0x7d4f('0x38')](this[_0x7d4f('0xc')],_0x41b060,function(_0x3797cf){_0x21720b[_0x7d4f('0x29')](_0x7d4f('0x9'),_0x3797cf);});}};EmailImap['prototype'][_0x7d4f('0x39')]=function(){this['imap'][_0x7d4f('0x3a')](!![],this['handleCloseBox'][_0x7d4f('0x14')](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x3b')]=function(_0x1fb02f){this[_0x7d4f('0x16')](_0x1fb02f);this[_0x7d4f('0xe')][_0x7d4f('0x3a')](!![],this[_0x7d4f('0x2c')]['bind'](this));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x13')]=function(){this[_0x7d4f('0x29')](_0x7d4f('0x12'));};EmailImap[_0x7d4f('0x26')][_0x7d4f('0x16')]=function(_0x1180b4,_0x12d59a){logger[_0x7d4f('0x15')](_0x7d4f('0x16'),this[_0x7d4f('0xc')][_0x7d4f('0x9')],JSON[_0x7d4f('0x3c')](_0x1180b4));var _0x5494cf='';if(_0x1180b4){if(_0x1180b4[_0x7d4f('0x3d')]){_0x5494cf=_0x1180b4['textCode'];}else{for(var _0x1be6d5 in _0x1180b4){if(_0x1180b4[_0x7d4f('0x3e')](_0x1be6d5)){_0x5494cf+=_[_0x7d4f('0x3f')](_0x1be6d5)+':\x20'+_0x1180b4[_0x1be6d5]+'\x0a';}}}}if(_0x12d59a){this[_0x7d4f('0xe')][_0x7d4f('0x12')]();}else{this[_0x7d4f('0x29')](_0x7d4f('0x15'),_0x5494cf);this[_0x7d4f('0x29')](_0x7d4f('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 4262d5d..4a5ad04 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 _0x21b3=['sendMail','toString','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','compile'];(function(_0x1dce91,_0x175f4b){var _0x33653d=function(_0x145108){while(--_0x145108){_0x1dce91['push'](_0x1dce91['shift']());}};_0x33653d(++_0x175f4b);}(_0x21b3,0x1d2));var _0x321b=function(_0x34b4a4,_0x5decf4){_0x34b4a4=_0x34b4a4-0x0;var _0x2e849d=_0x21b3[_0x34b4a4];return _0x2e849d;};'use strict';var nodemailer=require(_0x321b('0x0'));var BPromise=require(_0x321b('0x1'));var inlineBase64=require(_0x321b('0x2'));function EmailSmtp(){}EmailSmtp[_0x321b('0x3')][_0x321b('0x4')]=function(_0x4c0d61,_0x34694a){return new BPromise(function(_0x238156,_0x2f9eaf){var _0x291bdb=nodemailer['createTransport'](_0x4c0d61);_0x291bdb[_0x321b('0x5')](_0x321b('0x6'),inlineBase64());_0x291bdb[_0x321b('0x7')](_0x34694a,function(_0x1928e7,_0x34af13){if(_0x1928e7){_0x2f9eaf(_0x1928e7[_0x321b('0x8')]());}else{_0x238156(_0x34af13);}});});};EmailSmtp['prototype'][_0x321b('0x9')]=function(_0x2ed685){return new BPromise(function(_0x24655e,_0x39f933){var _0x46a698=nodemailer['createTransport'](_0x2ed685);_0x46a698[_0x321b('0x9')](function(_0x253272,_0x3bb187){if(_0x253272){_0x39f933(_0x253272['toString']());}else{if(_0x3bb187){_0x24655e(_0x3bb187);}else{_0x39f933(_0x321b('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xdbde=['send','createTransport','use','sendMail','toString','prototype','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x51ab5b,_0x10e70f){var _0x32d89b=function(_0x40cff0){while(--_0x40cff0){_0x51ab5b['push'](_0x51ab5b['shift']());}};_0x32d89b(++_0x10e70f);}(_0xdbde,0xda));var _0xedbd=function(_0x471488,_0x4385c6){_0x471488=_0x471488-0x0;var _0x5d5951=_0xdbde[_0x471488];return _0x5d5951;};'use strict';var nodemailer=require(_0xedbd('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xedbd('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xedbd('0x2')]=function(_0x2c6808,_0x20f7bf){return new BPromise(function(_0x15b176,_0x1b207e){var _0x3c4280=nodemailer[_0xedbd('0x3')](_0x2c6808);_0x3c4280[_0xedbd('0x4')]('compile',inlineBase64());_0x3c4280[_0xedbd('0x5')](_0x20f7bf,function(_0x4d1e82,_0x5eaaf3){if(_0x4d1e82){_0x1b207e(_0x4d1e82[_0xedbd('0x6')]());}else{_0x15b176(_0x5eaaf3);}});});};EmailSmtp[_0xedbd('0x7')]['verify']=function(_0x4712a7){return new BPromise(function(_0x11ded4,_0x1331db){var _0x180359=nodemailer['createTransport'](_0x4712a7);_0x180359['verify'](function(_0xe5d947,_0x1c12d5){if(_0xe5d947){_0x1331db(_0xe5d947['toString']());}else{if(_0x1c12d5){_0x11ded4(_0x1c12d5);}else{_0x1331db(_0xedbd('0x8'));}}});});};module[_0xedbd('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 8ee8438..efc43f5 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 _0x3afa=['attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','push','contentType','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','outlook365','lodash','moment','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','slice','join','Anonymous','length','pop','isEmpty','html','test','replace','body','textAsHtml','0x1?_0x2a5be1[_0xa3af('0x13')]():'';}return'';}function getMails(_0x117782,_0xf09d86){var _0x7ad952='';for(var _0x167937=0x0;_0x167937<_0xf09d86[_0xa3af('0x8')][_0xa3af('0x12')];_0x167937+=0x1){if(_0xf09d86['value'][_0x167937][_0xa3af('0x9')]!==_0x117782){if(!_[_0xa3af('0x14')](_0x7ad952)){_0x7ad952+=',';}_0x7ad952+=_0xf09d86[_0xa3af('0x8')][_0x167937][_0xa3af('0xd')]||_0xf09d86['value'][_0x167937][_0xa3af('0x9')]||'';_0x7ad952+='\x20<';_0x7ad952+=_0xf09d86[_0xa3af('0x8')][_0x167937][_0xa3af('0x9')]?_0xf09d86[_0xa3af('0x8')][_0x167937][_0xa3af('0x9')]:'anonymous'+random['generate'](0x6)+_0xa3af('0xc');_0x7ad952+='>';}}return _0x7ad952;}function parseEmail(_0x2f61b4,_0x5a9421,_0x5dfb4c){if(_0x5a9421[_0xa3af('0x15')]){var _0x55619c=/)<[^<]*)*<\/script>/gi;while(_0x55619c[_0xa3af('0x16')](_0x5a9421[_0xa3af('0x15')])){_0x5a9421[_0xa3af('0x15')]=_0x5a9421['html'][_0xa3af('0x17')](_0x55619c,'');}_0x5dfb4c[_0xa3af('0x18')]=_0x5a9421['html'];}else{_0x5dfb4c[_0xa3af('0x18')]=_0x5a9421[_0xa3af('0x19')];}if(_0x5dfb4c[_0xa3af('0x18')]){_0x5dfb4c[_0xa3af('0x18')]=_0x5dfb4c[_0xa3af('0x18')][_0xa3af('0x17')](/Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','hotmail','outlook365','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','head','address','anonymous','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','pop','html','test','replace','body','textAsHtml','0x1?_0x55e69b[_0x235f('0x13')]():'';}return'';}function getMails(_0x800c8a,_0x45ccc5){var _0x2aa503='';for(var _0x4bced3=0x0;_0x4bced3<_0x45ccc5[_0x235f('0xc')][_0x235f('0xf')];_0x4bced3+=0x1){if(_0x45ccc5[_0x235f('0xc')][_0x4bced3][_0x235f('0x8')]!==_0x800c8a){if(!_['isEmpty'](_0x2aa503)){_0x2aa503+=',';}_0x2aa503+=_0x45ccc5['value'][_0x4bced3][_0x235f('0xd')]||_0x45ccc5['value'][_0x4bced3][_0x235f('0x8')]||'';_0x2aa503+='\x20<';_0x2aa503+=_0x45ccc5[_0x235f('0xc')][_0x4bced3][_0x235f('0x8')]?_0x45ccc5['value'][_0x4bced3]['address']:_0x235f('0x9')+random[_0x235f('0xa')](0x6)+_0x235f('0xb');_0x2aa503+='>';}}return _0x2aa503;}function parseEmail(_0x281ff4,_0x3caba1,_0x5a48a5){if(_0x3caba1[_0x235f('0x14')]){var _0x2525d6=/)<[^<]*)*<\/script>/gi;while(_0x2525d6[_0x235f('0x15')](_0x3caba1[_0x235f('0x14')])){_0x3caba1['html']=_0x3caba1[_0x235f('0x14')][_0x235f('0x16')](_0x2525d6,'');}_0x5a48a5[_0x235f('0x17')]=_0x3caba1['html'];}else{_0x5a48a5[_0x235f('0x17')]=_0x3caba1[_0x235f('0x18')];}if(_0x5a48a5[_0x235f('0x17')]){_0x5a48a5[_0x235f('0x17')]=_0x5a48a5[_0x235f('0x17')][_0x235f('0x16')](/0x0){if(this[_0x37c972+_0xbe5f('0x29')]>0x0&&this[_0x37c972+_0xbe5f('0x28')]>=this[_0x37c972+_0xbe5f('0x29')]){return _0xbe5f('0x2a');}else{return'working';}}else{return _0xbe5f('0x2b');}};Agent[_0xbe5f('0x2c')]['updateRealtime']=function(){var _0x37b5a9=[_0xbe5f('0x2d'),_0xbe5f('0x2e'),_0xbe5f('0x2f'),_0xbe5f('0x30'),_0xbe5f('0x31'),_0xbe5f('0x32')];for(var _0x5326a5=0x0;_0x5326a5<_0x37b5a9['length'];_0x5326a5+=0x1){var _0x5e85f7=this['getChannelStatus'](_0x37b5a9[_0x5326a5]);if(this[_0x37b5a9[_0x5326a5]+_0xbe5f('0x33')]!==_0x5e85f7){this[_0x37b5a9[_0x5326a5]+_0xbe5f('0x34')]=_[_0xbe5f('0x35')](moment()[_0xbe5f('0x36')]('x'));}this[_0x37b5a9[_0x5326a5]+_0xbe5f('0x33')]=_0x5e85f7;}var _0x1ca5ef={'id':this['id'],'name':this[_0xbe5f('0x7')],'online':this[_0xbe5f('0x8')],'voicePause':this[_0xbe5f('0x9')],'chatPause':this[_0xbe5f('0xa')],'mailPause':this[_0xbe5f('0xb')],'smsPause':this[_0xbe5f('0xd')],'faxPause':this[_0xbe5f('0xc')],'openchannelPause':this[_0xbe5f('0xe')],'chatStatus':this[_0xbe5f('0xf')],'chatStatusTime':this[_0xbe5f('0x11')],'chatCapacity':this[_0xbe5f('0x12')],'chatCurrentCapacity':this[_0xbe5f('0x13')],'mailStatus':this[_0xbe5f('0x14')],'mailStatusTime':this[_0xbe5f('0x15')],'mailCapacity':this[_0xbe5f('0x16')],'mailCurrentCapacity':this[_0xbe5f('0x17')],'faxStatus':this[_0xbe5f('0x18')],'faxStatusTime':this[_0xbe5f('0x19')],'faxCapacity':this[_0xbe5f('0x1a')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xbe5f('0x1d')],'smsCapacity':this[_0xbe5f('0x1e')],'smsCurrentCapacity':this[_0xbe5f('0x37')],'whatsappStatus':this[_0xbe5f('0x38')],'whatsappStatusTime':this[_0xbe5f('0x39')],'whatsappCapacity':this[_0xbe5f('0x1f')],'whatsappCurrentCapacity':this[_0xbe5f('0x20')],'openchannelStatus':this[_0xbe5f('0x3a')],'openchannelStatusTime':this[_0xbe5f('0x3b')],'openchannelCapacity':this[_0xbe5f('0x21')],'openchannelCurrentCapacity':this[_0xbe5f('0x22')],'busy':this['busy'],'busyQueue':this[_0xbe5f('0x24')]};var _0x48c8ed=md5(JSON[_0xbe5f('0x3c')](_0x1ca5ef));if(this[_0xbe5f('0x25')]!==_0x48c8ed){this[_0xbe5f('0x25')]=_0x48c8ed;io[_0xbe5f('0x3d')](_0xbe5f('0x3e'),_0x1ca5ef);}};module[_0xbe5f('0x3f')]=Agent; \ No newline at end of file +var _0x19e1=['format','faxPause','busy','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','working','chat','fax','length','getChannelStatus','Status','StatusTime'];(function(_0x1d106c,_0xa3fbea){var _0x3d77c5=function(_0x26fe0e){while(--_0x26fe0e){_0x1d106c['push'](_0x1d106c['shift']());}};_0x3d77c5(++_0xa3fbea);}(_0x19e1,0x163));var _0x119e=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x19e1[_0x35f7f5];return _0x5567a4;};'use strict';var _=require(_0x119e('0x0'));var moment=require(_0x119e('0x1'));var md5=require(_0x119e('0x2'));var Redis=require(_0x119e('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x119e('0x4')](config[_0x119e('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x119e('0x6'))(new Redis(config[_0x119e('0x5')]));function Agent(_0x4e2d98){this['id']=_0x4e2d98['id']||0x0;this[_0x119e('0x7')]=_0x4e2d98['name']||'';this[_0x119e('0x8')]=_0x4e2d98[_0x119e('0x8')]||!![];this[_0x119e('0x9')]=_0x4e2d98[_0x119e('0x9')]||![];this['chatPause']=_0x4e2d98[_0x119e('0xa')]||![];this[_0x119e('0xb')]=_0x4e2d98[_0x119e('0xb')]||![];this['faxPause']=_0x4e2d98['faxPause']||![];this[_0x119e('0xc')]=_0x4e2d98[_0x119e('0xc')]||![];this[_0x119e('0xd')]=_0x4e2d98[_0x119e('0xd')]||![];this[_0x119e('0xe')]=_0x119e('0xf');this[_0x119e('0x10')]=0x0;this['chatCapacity']=_0x4e2d98[_0x119e('0x11')]||0x0;this[_0x119e('0x12')]=0x0;this[_0x119e('0x13')]=_0x119e('0xf');this[_0x119e('0x14')]=0x0;this[_0x119e('0x15')]=_0x4e2d98['mailCapacity']||0x0;this[_0x119e('0x16')]=0x0;this[_0x119e('0x17')]=_0x119e('0xf');this[_0x119e('0x18')]=0x0;this[_0x119e('0x19')]=_0x4e2d98[_0x119e('0x19')]||0x0;this[_0x119e('0x1a')]=0x0;this[_0x119e('0x1b')]=_0x119e('0xf');this[_0x119e('0x1c')]=0x0;this[_0x119e('0x1d')]=_0x4e2d98['smsCapacity']||0x0;this[_0x119e('0x1e')]=0x0;this[_0x119e('0x1f')]=_0x119e('0xf');this[_0x119e('0x20')]=0x0;this[_0x119e('0x21')]=_0x4e2d98[_0x119e('0x21')]||0x0;this[_0x119e('0x22')]=0x0;this[_0x119e('0x23')]=_0x119e('0xf');this[_0x119e('0x24')]=0x0;this[_0x119e('0x25')]=_0x4e2d98['openchannelCapacity']||0x0;this[_0x119e('0x26')]=0x0;this['busy']=![];this[_0x119e('0x27')]=undefined;this['md5']='';this[_0x119e('0x28')]();}Agent[_0x119e('0x29')]['getChannelStatus']=function(_0x4d41f0){if(this[_0x4d41f0+_0x119e('0x2a')]>0x0){if(this[_0x4d41f0+_0x119e('0x2b')]>0x0&&this[_0x4d41f0+_0x119e('0x2a')]>=this[_0x4d41f0+'Capacity']){return'maxcapacity';}else{return _0x119e('0x2c');}}else{return'idle';}};Agent[_0x119e('0x29')][_0x119e('0x28')]=function(){var _0x198f7b=['mail',_0x119e('0x2d'),'openchannel',_0x119e('0x2e'),'sms','whatsapp'];for(var _0xdc170f=0x0;_0xdc170f<_0x198f7b[_0x119e('0x2f')];_0xdc170f+=0x1){var _0x1a7dea=this[_0x119e('0x30')](_0x198f7b[_0xdc170f]);if(this[_0x198f7b[_0xdc170f]+_0x119e('0x31')]!==_0x1a7dea){this[_0x198f7b[_0xdc170f]+_0x119e('0x32')]=_['toNumber'](moment()[_0x119e('0x33')]('x'));}this[_0x198f7b[_0xdc170f]+_0x119e('0x31')]=_0x1a7dea;}var _0x58aa83={'id':this['id'],'name':this[_0x119e('0x7')],'online':this[_0x119e('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x119e('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x119e('0xc')],'faxPause':this[_0x119e('0x34')],'openchannelPause':this[_0x119e('0xd')],'chatStatus':this[_0x119e('0xe')],'chatStatusTime':this[_0x119e('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x119e('0x12')],'mailStatus':this[_0x119e('0x13')],'mailStatusTime':this[_0x119e('0x14')],'mailCapacity':this[_0x119e('0x15')],'mailCurrentCapacity':this[_0x119e('0x16')],'faxStatus':this[_0x119e('0x17')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x119e('0x1c')],'smsCapacity':this[_0x119e('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x119e('0x20')],'whatsappCapacity':this[_0x119e('0x21')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x119e('0x23')],'openchannelStatusTime':this[_0x119e('0x24')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x119e('0x26')],'busy':this[_0x119e('0x35')],'busyQueue':this[_0x119e('0x27')]};var _0x1b4458=md5(JSON[_0x119e('0x36')](_0x58aa83));if(this[_0x119e('0x2')]!==_0x1b4458){this[_0x119e('0x2')]=_0x1b4458;io[_0x119e('0x37')](_0x119e('0x38'),_0x58aa83);}};module[_0x119e('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ee33a46..c32973c 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 _0x9199=['online','chatPause','paused','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','strategy','beepall','Agents','updateRouting','mapAgentsId','_rr','updateRealtime','loggedIn'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x9199,0xe2));var _0x9919=function(_0x175f1b,_0x1a7de0){_0x175f1b=_0x175f1b-0x0;var _0x2da79a=_0x9199[_0x175f1b];return _0x2da79a;};'use strict';var _=require(_0x9919('0x0'));var md5=require(_0x9919('0x1'));var util=require(_0x9919('0x2'));var Redis=require(_0x9919('0x3'));var config=require(_0x9919('0x4'));config[_0x9919('0x5')]=_[_0x9919('0x6')](config[_0x9919('0x5')],{'host':_0x9919('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9919('0x5')]));function ChatQueue(_0x99e668){this['id']=_0x99e668['id']||0x0;this[_0x9919('0x8')]=_0x99e668[_0x9919('0x8')]||'';this['timeout']=_0x99e668['timeout']||0xa;this[_0x9919('0x9')]=_0x99e668['strategy']||_0x9919('0xa');this[_0x9919('0xb')]=_0x99e668[_0x9919('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x9919('0x1')]='';this[_0x9919('0xc')]();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0x3b4d04=this[_0x9919('0xd')][_0x9919('0xe')];this[_0x9919('0xd')]=_['map'](this['Agents'],'id');this[_0x9919('0xd')][_0x9919('0xe')]=_0x3b4d04;};ChatQueue['prototype'][_0x9919('0xf')]=function(){this[_0x9919('0x10')]=0x0;this['paused']=0x0;for(var _0x2d5c38=0x0;_0x2d5c38=0x0?this[_0x9919('0x14')]:0x0;var _0xfb4410={'id':this['id'],'available':this[_0x9919('0x14')],'loggedIn':this[_0x9919('0x10')],'name':this[_0x9919('0x8')],'paused':this['paused'],'waiting':this[_0x9919('0x15')]};var _0x6afecb=md5(JSON[_0x9919('0x16')](_0xfb4410));if(this['md5']!==_0x6afecb){this[_0x9919('0x1')]=_0x6afecb;io['to'](util[_0x9919('0x17')](_0x9919('0x18'),_0xfb4410[_0x9919('0x8')]))['emit'](_0x9919('0x19'),_0xfb4410);}};module[_0x9919('0x1a')]=ChatQueue; \ No newline at end of file +var _0xa333=['loggedIn','chatPause','paused','available','waiting','stringify','emit','chat_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype'];(function(_0x3e7451,_0x42ce79){var _0x4032d8=function(_0x453437){while(--_0x453437){_0x3e7451['push'](_0x3e7451['shift']());}};_0x4032d8(++_0x42ce79);}(_0xa333,0x128));var _0x3a33=function(_0x450233,_0x2e77d9){_0x450233=_0x450233-0x0;var _0x1dc4f4=_0xa333[_0x450233];return _0x1dc4f4;};'use strict';var _=require(_0x3a33('0x0'));var md5=require(_0x3a33('0x1'));var util=require(_0x3a33('0x2'));var Redis=require(_0x3a33('0x3'));var config=require('../../../config/environment');config[_0x3a33('0x4')]=_[_0x3a33('0x5')](config[_0x3a33('0x4')],{'host':_0x3a33('0x6'),'port':0x18eb});var io=require(_0x3a33('0x7'))(new Redis(config['redis']));function ChatQueue(_0x1d9c5f){this['id']=_0x1d9c5f['id']||0x0;this[_0x3a33('0x8')]=_0x1d9c5f[_0x3a33('0x8')]||'';this['timeout']=_0x1d9c5f['timeout']||0xa;this['strategy']=_0x1d9c5f[_0x3a33('0x9')]||'beepall';this[_0x3a33('0xa')]=_0x1d9c5f[_0x3a33('0xa')];this[_0x3a33('0xb')]={};this['waiting']=0x0;this[_0x3a33('0x1')]='';this[_0x3a33('0xc')]();this[_0x3a33('0xd')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x3353d3=this[_0x3a33('0xb')][_0x3a33('0xe')];this[_0x3a33('0xb')]=_['map'](this['Agents'],'id');this[_0x3a33('0xb')][_0x3a33('0xe')]=_0x3353d3;};ChatQueue[_0x3a33('0xf')][_0x3a33('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1beff1=0x0;_0x1beff1=0x0?this[_0x3a33('0x13')]:0x0;var _0x558aa3={'id':this['id'],'available':this[_0x3a33('0x13')],'loggedIn':this[_0x3a33('0x10')],'name':this[_0x3a33('0x8')],'paused':this[_0x3a33('0x12')],'waiting':this[_0x3a33('0x14')]};var _0xcf726b=md5(JSON[_0x3a33('0x15')](_0x558aa3));if(this['md5']!==_0xcf726b){this[_0x3a33('0x1')]=_0xcf726b;io['to'](util['format']('chat:queue:%s',_0x558aa3[_0x3a33('0x8')]))[_0x3a33('0x16')](_0x3a33('0x17'),_0x558aa3);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 3dc761a..d9749f0 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(_0x313fa9,_0x2fbd07){var _0x2b7fdd=function(_0x434464){while(--_0x434464){_0x313fa9['push'](_0x313fa9['shift']());}};_0x2b7fdd(++_0x2fbd07);}(_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 +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(_0x5e4b03,_0x56eb9d){var _0x14db80=function(_0x18440b){while(--_0x18440b){_0x5e4b03['push'](_0x5e4b03['shift']());}};_0x14db80(++_0x56eb9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 b84b9f2..17b77ed 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 _0xea97=['exports','name','Intervals'];(function(_0x480a80,_0x34891c){var _0x4636eb=function(_0x1b4b1e){while(--_0x1b4b1e){_0x480a80['push'](_0x480a80['shift']());}};_0x4636eb(++_0x34891c);}(_0xea97,0xeb));var _0x7ea9=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xea97[_0x403c20];return _0x2b271a;};'use strict';function Interval(_0x111d76){this['id']=_0x111d76['id']||0x0;this['name']=_0x111d76[_0x7ea9('0x0')]||'';this['Intervals']=_0x111d76[_0x7ea9('0x1')]||{};}module[_0x7ea9('0x2')]=Interval; \ No newline at end of file +var _0x93c0=['Intervals','name'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0x93c0,0xc1));var _0x093c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x93c0[_0x19e35c];return _0x3e1fe8;};'use strict';function Interval(_0x13ed17){this['id']=_0x13ed17['id']||0x0;this[_0x093c('0x0')]=_0x13ed17['name']||'';this[_0x093c('0x1')]=_0x13ed17[_0x093c('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index e88bafa..556ce79 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 _0x4a6d=['updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn','mailPause','available','stringify','format','emit','mail_queue:save','exports','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x2f419d,_0x14ad0c){var _0x561965=function(_0x278de9){while(--_0x278de9){_0x2f419d['push'](_0x2f419d['shift']());}};_0x561965(++_0x14ad0c);}(_0x4a6d,0x121));var _0xd4a6=function(_0x665699,_0x3a0aec){_0x665699=_0x665699-0x0;var _0xf86c65=_0x4a6d[_0x665699];return _0xf86c65;};'use strict';var _=require('lodash');var md5=require(_0xd4a6('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xd4a6('0x1'));config[_0xd4a6('0x2')]=_[_0xd4a6('0x3')](config[_0xd4a6('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xd4a6('0x4'))(new Redis(config['redis']));function MailQueue(_0x48bbfe){this['id']=_0x48bbfe['id']||0x0;this['name']=_0x48bbfe[_0xd4a6('0x5')]||'';this[_0xd4a6('0x6')]=_0x48bbfe[_0xd4a6('0x6')]||0xa;this[_0xd4a6('0x7')]=_0x48bbfe['strategy']||'beepall';this[_0xd4a6('0x8')]=_0x48bbfe[_0xd4a6('0x8')];this[_0xd4a6('0x9')]={};this[_0xd4a6('0xa')]=0x0;this['md5']='';this[_0xd4a6('0xb')]();this[_0xd4a6('0xc')]();}MailQueue[_0xd4a6('0xd')][_0xd4a6('0xb')]=function(){var _0x2714d7=this['mapAgentsId'][_0xd4a6('0xe')];this[_0xd4a6('0x9')]=_['map'](this[_0xd4a6('0x8')],'id');this[_0xd4a6('0x9')][_0xd4a6('0xe')]=_0x2714d7;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd4a6('0xf')]=0x0;for(var _0xeafa3f=0x0;_0xeafa3f=0x0?this[_0xd4a6('0x13')]:0x0;var _0x1b456d={'id':this['id'],'available':this[_0xd4a6('0x13')],'loggedIn':this[_0xd4a6('0x11')],'name':this[_0xd4a6('0x5')],'paused':this[_0xd4a6('0xf')],'waiting':this[_0xd4a6('0xa')]};var _0x44713d=md5(JSON[_0xd4a6('0x14')](_0x1b456d));if(this[_0xd4a6('0x0')]!==_0x44713d){this[_0xd4a6('0x0')]=_0x44713d;io['to'](util[_0xd4a6('0x15')]('mail:queue:%s',_0x1b456d[_0xd4a6('0x5')]))[_0xd4a6('0x16')](_0xd4a6('0x17'),_0x1b456d);}};module[_0xd4a6('0x18')]=MailQueue; \ No newline at end of file +var _0xeae7=['strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','paused','available','name','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','timeout'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xeae7,0x1a1));var _0x7eae=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xeae7[_0x259d17];return _0x407535;};'use strict';var _=require('lodash');var md5=require(_0x7eae('0x0'));var util=require(_0x7eae('0x1'));var Redis=require(_0x7eae('0x2'));var config=require('../../../config/environment');config[_0x7eae('0x3')]=_[_0x7eae('0x4')](config[_0x7eae('0x3')],{'host':_0x7eae('0x5'),'port':0x18eb});var io=require(_0x7eae('0x6'))(new Redis(config[_0x7eae('0x3')]));function MailQueue(_0x353de6){this['id']=_0x353de6['id']||0x0;this['name']=_0x353de6['name']||'';this[_0x7eae('0x7')]=_0x353de6[_0x7eae('0x7')]||0xa;this['strategy']=_0x353de6[_0x7eae('0x8')]||'beepall';this[_0x7eae('0x9')]=_0x353de6[_0x7eae('0x9')];this[_0x7eae('0xa')]={};this[_0x7eae('0xb')]=0x0;this[_0x7eae('0x0')]='';this[_0x7eae('0xc')]();this[_0x7eae('0xd')]();}MailQueue[_0x7eae('0xe')][_0x7eae('0xc')]=function(){var _0x3758e4=this[_0x7eae('0xa')][_0x7eae('0xf')];this[_0x7eae('0xa')]=_['map'](this[_0x7eae('0x9')],'id');this[_0x7eae('0xa')][_0x7eae('0xf')]=_0x3758e4;};MailQueue[_0x7eae('0xe')][_0x7eae('0xd')]=function(){this[_0x7eae('0x10')]=0x0;this['paused']=0x0;for(var _0x658a7c=0x0;_0x658a7c=0x0?this[_0x7eae('0x13')]:0x0;var _0x5635be={'id':this['id'],'available':this[_0x7eae('0x13')],'loggedIn':this[_0x7eae('0x10')],'name':this[_0x7eae('0x14')],'paused':this['paused'],'waiting':this[_0x7eae('0xb')]};var _0xc2ebbe=md5(JSON['stringify'](_0x5635be));if(this[_0x7eae('0x0')]!==_0xc2ebbe){this['md5']=_0xc2ebbe;io['to'](util[_0x7eae('0x15')](_0x7eae('0x16'),_0x5635be[_0x7eae('0x14')]))['emit'](_0x7eae('0x17'),_0x5635be);}};module[_0x7eae('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ffffb6c..6899c56 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 _0xfa4d=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','online','available','emit','openchannel_queue:save','exports','lodash','ioredis'];(function(_0x5084a8,_0x35f0b3){var _0x2be01e=function(_0x34c054){while(--_0x34c054){_0x5084a8['push'](_0x5084a8['shift']());}};_0x2be01e(++_0x35f0b3);}(_0xfa4d,0xe8));var _0xdfa4=function(_0x384d38,_0x2acf8a){_0x384d38=_0x384d38-0x0;var _0x1cecd6=_0xfa4d[_0x384d38];return _0x1cecd6;};'use strict';var _=require(_0xdfa4('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xdfa4('0x1'));var config=require('../../../config/environment');config[_0xdfa4('0x2')]=_[_0xdfa4('0x3')](config[_0xdfa4('0x2')],{'host':_0xdfa4('0x4'),'port':0x18eb});var io=require(_0xdfa4('0x5'))(new Redis(config[_0xdfa4('0x2')]));function OpenchannelQueue(_0x243b9e){this['id']=_0x243b9e['id']||0x0;this['name']=_0x243b9e[_0xdfa4('0x6')]||'';this[_0xdfa4('0x7')]=_0x243b9e[_0xdfa4('0x7')]||0xa;this[_0xdfa4('0x8')]=_0x243b9e[_0xdfa4('0x8')]||_0xdfa4('0x9');this[_0xdfa4('0xa')]=_0x243b9e[_0xdfa4('0xa')];this[_0xdfa4('0xb')]={};this[_0xdfa4('0xc')]=0x0;this[_0xdfa4('0xd')]='';this[_0xdfa4('0xe')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0xdfa4('0xe')]=function(){var _0x4a1413=this[_0xdfa4('0xb')][_0xdfa4('0xf')];this[_0xdfa4('0xb')]=_['map'](this[_0xdfa4('0xa')],'id');this[_0xdfa4('0xb')][_0xdfa4('0xf')]=_0x4a1413;};OpenchannelQueue[_0xdfa4('0x10')][_0xdfa4('0x11')]=function(){this[_0xdfa4('0x12')]=0x0;this[_0xdfa4('0x13')]=0x0;for(var _0x4d53d3=0x0;_0x4d53d3=0x0?this['available']:0x0;var _0x591fcc={'id':this['id'],'available':this[_0xdfa4('0x16')],'loggedIn':this[_0xdfa4('0x12')],'name':this[_0xdfa4('0x6')],'paused':this[_0xdfa4('0x13')],'waiting':this[_0xdfa4('0xc')]};var _0x3c22f7=md5(JSON['stringify'](_0x591fcc));if(this[_0xdfa4('0xd')]!==_0x3c22f7){this[_0xdfa4('0xd')]=_0x3c22f7;io['to'](util['format']('openchannel:queue:%s',_0x591fcc[_0xdfa4('0x6')]))[_0xdfa4('0x17')](_0xdfa4('0x18'),_0x591fcc);}};module[_0xdfa4('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x288c=['length','online','openchannelPause','available','stringify','md5','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','updateRealtime','_rr','prototype','loggedIn','paused'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x288c,0x129));var _0xc288=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0x288c[_0x406fbb];return _0x8e921d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xc288('0x0'));var Redis=require(_0xc288('0x1'));var config=require(_0xc288('0x2'));config[_0xc288('0x3')]=_['defaults'](config['redis'],{'host':_0xc288('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x5b004f){this['id']=_0x5b004f['id']||0x0;this[_0xc288('0x5')]=_0x5b004f[_0xc288('0x5')]||'';this['timeout']=_0x5b004f[_0xc288('0x6')]||0xa;this['strategy']=_0x5b004f[_0xc288('0x7')]||'beepall';this[_0xc288('0x8')]=_0x5b004f['Agents'];this[_0xc288('0x9')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xc288('0xa')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0xa857d1=this[_0xc288('0x9')][_0xc288('0xb')];this[_0xc288('0x9')]=_['map'](this[_0xc288('0x8')],'id');this[_0xc288('0x9')]['_rr']=_0xa857d1;};OpenchannelQueue[_0xc288('0xc')][_0xc288('0xa')]=function(){this[_0xc288('0xd')]=0x0;this[_0xc288('0xe')]=0x0;for(var _0x352d42=0x0;_0x352d42=0x0?this[_0xc288('0x12')]:0x0;var _0xf38cc7={'id':this['id'],'available':this[_0xc288('0x12')],'loggedIn':this[_0xc288('0xd')],'name':this[_0xc288('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x2c197a=md5(JSON[_0xc288('0x13')](_0xf38cc7));if(this[_0xc288('0x14')]!==_0x2c197a){this[_0xc288('0x14')]=_0x2c197a;io['to'](util[_0xc288('0x15')](_0xc288('0x16'),_0xf38cc7['name']))[_0xc288('0x17')](_0xc288('0x18'),_0xf38cc7);}};module[_0xc288('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6f814e4..b77866c 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 _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x321592,_0x198cc3){var _0x5b7250=function(_0x427bde){while(--_0x427bde){_0x321592['push'](_0x321592['shift']());}};_0x5b7250(++_0x198cc3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file +var _0xb7e7=['util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','stringify','sms:queue:%s','emit','exports','lodash'];(function(_0x48301a,_0x5a0ddc){var _0x350723=function(_0x1268e2){while(--_0x1268e2){_0x48301a['push'](_0x48301a['shift']());}};_0x350723(++_0x5a0ddc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb7e7[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x7b7e('0x0'));var md5=require('md5');var util=require(_0x7b7e('0x1'));var Redis=require('ioredis');var config=require(_0x7b7e('0x2'));config['redis']=_[_0x7b7e('0x3')](config['redis'],{'host':_0x7b7e('0x4'),'port':0x18eb});var io=require(_0x7b7e('0x5'))(new Redis(config[_0x7b7e('0x6')]));function SmsQueue(_0x52047f){this['id']=_0x52047f['id']||0x0;this['name']=_0x52047f[_0x7b7e('0x7')]||'';this[_0x7b7e('0x8')]=_0x52047f[_0x7b7e('0x8')]||0xa;this['strategy']=_0x52047f[_0x7b7e('0x9')]||_0x7b7e('0xa');this[_0x7b7e('0xb')]=_0x52047f[_0x7b7e('0xb')];this[_0x7b7e('0xc')]={};this[_0x7b7e('0xd')]=0x0;this[_0x7b7e('0xe')]='';this['updateRouting']();this[_0x7b7e('0xf')]();}SmsQueue[_0x7b7e('0x10')][_0x7b7e('0x11')]=function(){var _0x29b622=this[_0x7b7e('0xc')][_0x7b7e('0x12')];this[_0x7b7e('0xc')]=_[_0x7b7e('0x13')](this[_0x7b7e('0xb')],'id');this['mapAgentsId'][_0x7b7e('0x12')]=_0x29b622;};SmsQueue[_0x7b7e('0x10')]['updateRealtime']=function(){this[_0x7b7e('0x14')]=0x0;this['paused']=0x0;for(var _0x4c6011=0x0;_0x4c6011=0x0?this[_0x7b7e('0x18')]:0x0;var _0x200ef7={'id':this['id'],'available':this[_0x7b7e('0x18')],'loggedIn':this[_0x7b7e('0x14')],'name':this[_0x7b7e('0x7')],'paused':this[_0x7b7e('0x17')],'waiting':this[_0x7b7e('0xd')]};var _0x3bec7d=md5(JSON[_0x7b7e('0x19')](_0x200ef7));if(this[_0x7b7e('0xe')]!==_0x3bec7d){this[_0x7b7e('0xe')]=_0x3bec7d;io['to'](util['format'](_0x7b7e('0x1a'),_0x200ef7[_0x7b7e('0x7')]))[_0x7b7e('0x1b')]('sms_queue:save',_0x200ef7);}};module[_0x7b7e('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index f273a34..7a499a1 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd988=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn','whatsappPause','available','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd988,0x17d));var _0x8d98=function(_0x58b21c,_0x57b83b){_0x58b21c=_0x58b21c-0x0;var _0x6682d3=_0xd988[_0x58b21c];return _0x6682d3;};'use strict';var _=require('lodash');var md5=require(_0x8d98('0x0'));var util=require('util');var Redis=require(_0x8d98('0x1'));var config=require(_0x8d98('0x2'));config[_0x8d98('0x3')]=_['defaults'](config[_0x8d98('0x3')],{'host':_0x8d98('0x4'),'port':0x18eb});var io=require(_0x8d98('0x5'))(new Redis(config[_0x8d98('0x3')]));function WhatsappQueue(_0x3b6c60){this['id']=_0x3b6c60['id']||0x0;this['name']=_0x3b6c60[_0x8d98('0x6')]||'';this[_0x8d98('0x7')]=_0x3b6c60[_0x8d98('0x7')]||0xa;this[_0x8d98('0x8')]=_0x3b6c60[_0x8d98('0x8')]||_0x8d98('0x9');this[_0x8d98('0xa')]=_0x3b6c60[_0x8d98('0xa')];this[_0x8d98('0xb')]={};this[_0x8d98('0xc')]=0x0;this[_0x8d98('0x0')]='';this[_0x8d98('0xd')]();this[_0x8d98('0xe')]();}WhatsappQueue[_0x8d98('0xf')]['updateRouting']=function(){var _0x4b806b=this['mapAgentsId'][_0x8d98('0x10')];this['mapAgentsId']=_['map'](this[_0x8d98('0xa')],'id');this[_0x8d98('0xb')][_0x8d98('0x10')]=_0x4b806b;};WhatsappQueue[_0x8d98('0xf')][_0x8d98('0xe')]=function(){this['loggedIn']=0x0;this[_0x8d98('0x11')]=0x0;for(var _0x5a4205=0x0;_0x5a4205=0x0?this[_0x8d98('0x15')]:0x0;var _0x9b2e9f={'id':this['id'],'available':this[_0x8d98('0x15')],'loggedIn':this[_0x8d98('0x13')],'name':this[_0x8d98('0x6')],'paused':this[_0x8d98('0x11')],'waiting':this['waiting']};var _0x34e7d5=md5(JSON['stringify'](_0x9b2e9f));if(this[_0x8d98('0x0')]!==_0x34e7d5){this[_0x8d98('0x0')]=_0x34e7d5;io['to'](util['format'](_0x8d98('0x16'),_0x9b2e9f[_0x8d98('0x6')]))[_0x8d98('0x17')](_0x8d98('0x18'),_0x9b2e9f);}};module[_0x8d98('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x54e5=['paused','length','online','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn'];(function(_0x4e7544,_0x17891b){var _0x1c20ee=function(_0x2c068b){while(--_0x2c068b){_0x4e7544['push'](_0x4e7544['shift']());}};_0x1c20ee(++_0x17891b);}(_0x54e5,0x7e));var _0x554e=function(_0x1652b7,_0xcd7dd5){_0x1652b7=_0x1652b7-0x0;var _0x54632e=_0x54e5[_0x1652b7];return _0x54632e;};'use strict';var _=require(_0x554e('0x0'));var md5=require(_0x554e('0x1'));var util=require(_0x554e('0x2'));var Redis=require('ioredis');var config=require(_0x554e('0x3'));config[_0x554e('0x4')]=_[_0x554e('0x5')](config[_0x554e('0x4')],{'host':_0x554e('0x6'),'port':0x18eb});var io=require(_0x554e('0x7'))(new Redis(config[_0x554e('0x4')]));function WhatsappQueue(_0x5d152f){this['id']=_0x5d152f['id']||0x0;this[_0x554e('0x8')]=_0x5d152f['name']||'';this['timeout']=_0x5d152f[_0x554e('0x9')]||0xa;this[_0x554e('0xa')]=_0x5d152f[_0x554e('0xa')]||'beepall';this['Agents']=_0x5d152f[_0x554e('0xb')];this[_0x554e('0xc')]={};this[_0x554e('0xd')]=0x0;this[_0x554e('0x1')]='';this[_0x554e('0xe')]();this[_0x554e('0xf')]();}WhatsappQueue[_0x554e('0x10')]['updateRouting']=function(){var _0x1d624b=this['mapAgentsId'][_0x554e('0x11')];this[_0x554e('0xc')]=_['map'](this[_0x554e('0xb')],'id');this['mapAgentsId'][_0x554e('0x11')]=_0x1d624b;};WhatsappQueue['prototype'][_0x554e('0xf')]=function(){this[_0x554e('0x12')]=0x0;this[_0x554e('0x13')]=0x0;for(var _0x37f63c=0x0;_0x37f63c=0x0?this['available']:0x0;var _0x1b4cc2={'id':this['id'],'available':this[_0x554e('0x17')],'loggedIn':this[_0x554e('0x12')],'name':this['name'],'paused':this[_0x554e('0x13')],'waiting':this['waiting']};var _0x2a5191=md5(JSON[_0x554e('0x18')](_0x1b4cc2));if(this['md5']!==_0x2a5191){this[_0x554e('0x1')]=_0x2a5191;io['to'](util[_0x554e('0x19')]('whatsapp:queue:%s',_0x1b4cc2[_0x554e('0x8')]))[_0x554e('0x1a')](_0x554e('0x1b'),_0x1b4cc2);}};module[_0x554e('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 165941c..b49928f 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 _0x4b84=['../model/agent','../model/chatQueue','../model/smsQueue','../model/mailQueue','intervals','chatQueues','mailQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','prototype','hasOwnProperty','agents','isUndefined','mergeFromDatabase','length','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','faxQueues','initWhatsappQueues','whatsappQueues','bluebird','util'];(function(_0x4d112e,_0x1b4c32){var _0x13908f=function(_0x4193b6){while(--_0x4193b6){_0x4d112e['push'](_0x4d112e['shift']());}};_0x13908f(++_0x1b4c32);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x4b84[_0x1a72b8];return _0x39f72d;};'use strict';var BPromise=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x44b8('0x2'));var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x44b8('0x3'));var SmsQueue=require(_0x44b8('0x4'));var MailQueue=require(_0x44b8('0x5'));var FaxQueue=require('../model/faxQueue');var WhatsappQueue=require('../model/whatsappQueue');var Realtime=function(){this['agents']={};this[_0x44b8('0x6')]={};this['openchannelQueues']={};this[_0x44b8('0x7')]={};this['smsQueues']={};this[_0x44b8('0x8')]={};this['faxQueues']={};this['whatsappQueues']={};this[_0x44b8('0x9')]={};this[_0x44b8('0xa')]={};this[_0x44b8('0xb')]={};this['smsQueuesWaitingInteractions']={};this[_0x44b8('0xc')]={};this[_0x44b8('0xd')]={};};function freeIsNotKey(_0x4315f6,_0x9b6048,_0x24dd10){var _0x37e471=_[_0x44b8('0xe')](_0x4315f6,function(_0x4ae8a1,_0x147529){return _0x4ae8a1[_0x24dd10];});for(var _0x4301a6 in _0x9b6048){if(_0x9b6048['hasOwnProperty'](_0x4301a6)){if(!_0x37e471[_0x4301a6]){delete _0x9b6048[_0x4301a6];}}}}Realtime[_0x44b8('0xf')]['mergeFromDatabase']=function(_0x833ea3,_0x18d642){for(var _0x4df670 in _0x18d642){if(_0x833ea3[_0x44b8('0x10')](_0x4df670)){_0x833ea3[_0x4df670]=_0x18d642[_0x4df670];}}};Realtime['prototype']['initAgents']=function(){var _0x2a3e4c=this;return function(_0x2af0ad){if(_0x2af0ad){freeIsNotKey(_0x2af0ad,_0x2a3e4c[_0x44b8('0x11')],'id');for(var _0x41ab46=0x0,_0x5e52f2={},_0x495c74={};_0x41ab46<_0x2af0ad['length'];_0x41ab46+=0x1){_0x5e52f2=_0x2af0ad[_0x41ab46];if(_[_0x44b8('0x12')](_0x2a3e4c['agents'][_0x5e52f2['id']])){_0x2a3e4c[_0x44b8('0x11')][_0x5e52f2['id']]=new Agent(_0x5e52f2);}else{_0x2a3e4c[_0x44b8('0x13')](_0x2a3e4c['agents'][_0x5e52f2['id']],_0x5e52f2);}}}return _0x2a3e4c[_0x44b8('0x11')];};};Realtime[_0x44b8('0xf')]['initIntervals']=function(){var _0x89bc30=this;return function(_0x3f4688){if(_0x3f4688){freeIsNotKey(_0x3f4688,_0x89bc30['intervals'],'id');for(var _0xcce202=0x0,_0x8b4301={},_0xebfe79={};_0xcce202<_0x3f4688[_0x44b8('0x14')];_0xcce202+=0x1){_0x8b4301=_0x3f4688[_0xcce202];if(_[_0x44b8('0x12')](_0x89bc30[_0x44b8('0x6')][_0x8b4301['id']])){_0x89bc30[_0x44b8('0x6')][_0x8b4301['id']]=new Interval(_0x8b4301);}else{_0x89bc30[_0x44b8('0x13')](_0x89bc30[_0x44b8('0x6')][_0x8b4301['id']],_0x8b4301);}}}return _0x89bc30[_0x44b8('0x6')];};};Realtime[_0x44b8('0xf')][_0x44b8('0x15')]=function(){var _0x48327e=this;return function(_0x56549a){if(_0x56549a){freeIsNotKey(_0x56549a,_0x48327e[_0x44b8('0x16')],'id');for(var _0x416b34=0x0,_0x1418db={},_0x305a5c={};_0x416b34<_0x56549a['length'];_0x416b34+=0x1){_0x1418db=_0x56549a[_0x416b34];if(_[_0x44b8('0x12')](_0x48327e['openchannelQueues'][_0x1418db['id']])){_0x48327e[_0x44b8('0x16')][_0x1418db['id']]=new OpenchannelQueue(_0x1418db);}else{_0x48327e[_0x44b8('0x13')](_0x48327e[_0x44b8('0x16')][_0x1418db['id']],_0x1418db);}_0x48327e[_0x44b8('0x16')][_0x1418db['id']][_0x44b8('0x17')]();_0x48327e['openchannelQueues'][_0x1418db['id']][_0x44b8('0x18')]();}}return _0x48327e['openchannelQueues'];};};Realtime[_0x44b8('0xf')][_0x44b8('0x19')]=function(){var _0x549a26=this;return function(_0x17ac44){if(_0x17ac44){freeIsNotKey(_0x17ac44,_0x549a26[_0x44b8('0x7')],'id');for(var _0x2656d7=0x0,_0x59c1bf={},_0xb22107={};_0x2656d7<_0x17ac44[_0x44b8('0x14')];_0x2656d7+=0x1){_0x59c1bf=_0x17ac44[_0x2656d7];if(_['isUndefined'](_0x549a26[_0x44b8('0x7')][_0x59c1bf['id']])){_0x549a26['chatQueues'][_0x59c1bf['id']]=new ChatQueue(_0x59c1bf);}else{_0x549a26[_0x44b8('0x13')](_0x549a26['chatQueues'][_0x59c1bf['id']],_0x59c1bf);}_0x549a26['chatQueues'][_0x59c1bf['id']]['updateRouting']();_0x549a26[_0x44b8('0x7')][_0x59c1bf['id']][_0x44b8('0x18')]();}}return _0x549a26[_0x44b8('0x7')];};};Realtime[_0x44b8('0xf')][_0x44b8('0x1a')]=function(){var _0xc3f667=this;return function(_0x2cf205){if(_0x2cf205){freeIsNotKey(_0x2cf205,_0xc3f667[_0x44b8('0x1b')],'id');for(var _0xd1d320=0x0,_0x28f918={},_0x5e1129={};_0xd1d320<_0x2cf205[_0x44b8('0x14')];_0xd1d320+=0x1){_0x28f918=_0x2cf205[_0xd1d320];if(_[_0x44b8('0x12')](_0xc3f667['smsQueues'][_0x28f918['id']])){_0xc3f667[_0x44b8('0x1b')][_0x28f918['id']]=new SmsQueue(_0x28f918);}else{_0xc3f667['mergeFromDatabase'](_0xc3f667[_0x44b8('0x1b')][_0x28f918['id']],_0x28f918);}_0xc3f667[_0x44b8('0x1b')][_0x28f918['id']][_0x44b8('0x17')]();_0xc3f667[_0x44b8('0x1b')][_0x28f918['id']][_0x44b8('0x18')]();}}return _0xc3f667['smsQueues'];};};Realtime[_0x44b8('0xf')][_0x44b8('0x1c')]=function(){var _0x26265f=this;return function(_0x339f0f){if(_0x339f0f){freeIsNotKey(_0x339f0f,_0x26265f[_0x44b8('0x8')],'id');for(var _0x5f541d=0x0,_0x3875a5={},_0x400edc={};_0x5f541d<_0x339f0f[_0x44b8('0x14')];_0x5f541d+=0x1){_0x3875a5=_0x339f0f[_0x5f541d];if(_[_0x44b8('0x12')](_0x26265f[_0x44b8('0x8')][_0x3875a5['id']])){_0x26265f[_0x44b8('0x8')][_0x3875a5['id']]=new MailQueue(_0x3875a5);}else{_0x26265f[_0x44b8('0x13')](_0x26265f[_0x44b8('0x8')][_0x3875a5['id']],_0x3875a5);}_0x26265f[_0x44b8('0x8')][_0x3875a5['id']][_0x44b8('0x17')]();_0x26265f[_0x44b8('0x8')][_0x3875a5['id']][_0x44b8('0x18')]();}}return _0x26265f[_0x44b8('0x8')];};};Realtime[_0x44b8('0xf')][_0x44b8('0x1d')]=function(){var _0x1becb0=this;return function(_0x323c50){if(_0x323c50){freeIsNotKey(_0x323c50,_0x1becb0[_0x44b8('0x1e')],'id');for(var _0x28faa9=0x0,_0x3984f8={},_0x2c02d6={};_0x28faa9<_0x323c50[_0x44b8('0x14')];_0x28faa9+=0x1){_0x3984f8=_0x323c50[_0x28faa9];if(_['isUndefined'](_0x1becb0[_0x44b8('0x1e')][_0x3984f8['id']])){_0x1becb0[_0x44b8('0x1e')][_0x3984f8['id']]=new FaxQueue(_0x3984f8);}else{_0x1becb0['mergeFromDatabase'](_0x1becb0[_0x44b8('0x1e')][_0x3984f8['id']],_0x3984f8);}_0x1becb0[_0x44b8('0x1e')][_0x3984f8['id']][_0x44b8('0x17')]();_0x1becb0[_0x44b8('0x1e')][_0x3984f8['id']]['updateRealtime']();}}return _0x1becb0[_0x44b8('0x1e')];};};Realtime[_0x44b8('0xf')][_0x44b8('0x1f')]=function(){var _0x1ee3cc=this;return function(_0x9cb2a){if(_0x9cb2a){freeIsNotKey(_0x9cb2a,_0x1ee3cc[_0x44b8('0x20')],'id');for(var _0x46aadd=0x0,_0x3581b8={},_0x209039={};_0x46aadd<_0x9cb2a[_0x44b8('0x14')];_0x46aadd+=0x1){_0x3581b8=_0x9cb2a[_0x46aadd];if(_[_0x44b8('0x12')](_0x1ee3cc[_0x44b8('0x20')][_0x3581b8['id']])){_0x1ee3cc[_0x44b8('0x20')][_0x3581b8['id']]=new WhatsappQueue(_0x3581b8);}else{_0x1ee3cc[_0x44b8('0x13')](_0x1ee3cc[_0x44b8('0x20')][_0x3581b8['id']],_0x3581b8);}_0x1ee3cc[_0x44b8('0x20')][_0x3581b8['id']]['updateRouting']();_0x1ee3cc[_0x44b8('0x20')][_0x3581b8['id']][_0x44b8('0x18')]();}}return _0x1ee3cc[_0x44b8('0x20')];};};module['exports']=Realtime; \ No newline at end of file +var _0x9957=['../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/faxQueue'];(function(_0x22f77b,_0x24343a){var _0x12f047=function(_0x228469){while(--_0x228469){_0x22f77b['push'](_0x22f77b['shift']());}};_0x12f047(++_0x24343a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var _=require(_0x7995('0x2'));var moment=require(_0x7995('0x3'));var Agent=require('../model/agent');var Interval=require(_0x7995('0x4'));var OpenchannelQueue=require(_0x7995('0x5'));var ChatQueue=require(_0x7995('0x6'));var SmsQueue=require(_0x7995('0x7'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x7995('0x8'));var WhatsappQueue=require(_0x7995('0x9'));var Realtime=function(){this[_0x7995('0xa')]={};this[_0x7995('0xb')]={};this[_0x7995('0xc')]={};this[_0x7995('0xd')]={};this['smsQueues']={};this[_0x7995('0xe')]={};this[_0x7995('0xf')]={};this['whatsappQueues']={};this[_0x7995('0x10')]={};this[_0x7995('0x11')]={};this[_0x7995('0x12')]={};this[_0x7995('0x13')]={};this[_0x7995('0x14')]={};this[_0x7995('0x15')]={};};function freeIsNotKey(_0x341672,_0x524f7b,_0x245143){var _0x41c652=_['mapKeys'](_0x341672,function(_0xb0c872,_0x2cb37a){return _0xb0c872[_0x245143];});for(var _0x19a27e in _0x524f7b){if(_0x524f7b[_0x7995('0x16')](_0x19a27e)){if(!_0x41c652[_0x19a27e]){delete _0x524f7b[_0x19a27e];}}}}Realtime[_0x7995('0x17')][_0x7995('0x18')]=function(_0x2bbe7a,_0x4cc004){for(var _0x58f5ad in _0x4cc004){if(_0x2bbe7a[_0x7995('0x16')](_0x58f5ad)){_0x2bbe7a[_0x58f5ad]=_0x4cc004[_0x58f5ad];}}};Realtime[_0x7995('0x17')][_0x7995('0x19')]=function(){var _0x321ae8=this;return function(_0x3f1d3e){if(_0x3f1d3e){freeIsNotKey(_0x3f1d3e,_0x321ae8[_0x7995('0xa')],'id');for(var _0x2202ce=0x0,_0x41cbf0={},_0x5377e5={};_0x2202ce<_0x3f1d3e[_0x7995('0x1a')];_0x2202ce+=0x1){_0x41cbf0=_0x3f1d3e[_0x2202ce];if(_['isUndefined'](_0x321ae8[_0x7995('0xa')][_0x41cbf0['id']])){_0x321ae8[_0x7995('0xa')][_0x41cbf0['id']]=new Agent(_0x41cbf0);}else{_0x321ae8[_0x7995('0x18')](_0x321ae8[_0x7995('0xa')][_0x41cbf0['id']],_0x41cbf0);}}}return _0x321ae8[_0x7995('0xa')];};};Realtime[_0x7995('0x17')]['initIntervals']=function(){var _0x54c9ae=this;return function(_0x2536c8){if(_0x2536c8){freeIsNotKey(_0x2536c8,_0x54c9ae['intervals'],'id');for(var _0x555f74=0x0,_0x3ec178={},_0x3d463e={};_0x555f74<_0x2536c8['length'];_0x555f74+=0x1){_0x3ec178=_0x2536c8[_0x555f74];if(_[_0x7995('0x1b')](_0x54c9ae['intervals'][_0x3ec178['id']])){_0x54c9ae['intervals'][_0x3ec178['id']]=new Interval(_0x3ec178);}else{_0x54c9ae[_0x7995('0x18')](_0x54c9ae[_0x7995('0xb')][_0x3ec178['id']],_0x3ec178);}}}return _0x54c9ae[_0x7995('0xb')];};};Realtime[_0x7995('0x17')][_0x7995('0x1c')]=function(){var _0x1c278a=this;return function(_0x5d40ae){if(_0x5d40ae){freeIsNotKey(_0x5d40ae,_0x1c278a[_0x7995('0xc')],'id');for(var _0x46ee4b=0x0,_0x204507={},_0x285437={};_0x46ee4b<_0x5d40ae[_0x7995('0x1a')];_0x46ee4b+=0x1){_0x204507=_0x5d40ae[_0x46ee4b];if(_[_0x7995('0x1b')](_0x1c278a[_0x7995('0xc')][_0x204507['id']])){_0x1c278a[_0x7995('0xc')][_0x204507['id']]=new OpenchannelQueue(_0x204507);}else{_0x1c278a['mergeFromDatabase'](_0x1c278a[_0x7995('0xc')][_0x204507['id']],_0x204507);}_0x1c278a[_0x7995('0xc')][_0x204507['id']][_0x7995('0x1d')]();_0x1c278a[_0x7995('0xc')][_0x204507['id']][_0x7995('0x1e')]();}}return _0x1c278a[_0x7995('0xc')];};};Realtime['prototype'][_0x7995('0x1f')]=function(){var _0x5911c3=this;return function(_0x229742){if(_0x229742){freeIsNotKey(_0x229742,_0x5911c3[_0x7995('0xd')],'id');for(var _0xf16cc2=0x0,_0x132a42={},_0x11c1eb={};_0xf16cc2<_0x229742['length'];_0xf16cc2+=0x1){_0x132a42=_0x229742[_0xf16cc2];if(_[_0x7995('0x1b')](_0x5911c3['chatQueues'][_0x132a42['id']])){_0x5911c3[_0x7995('0xd')][_0x132a42['id']]=new ChatQueue(_0x132a42);}else{_0x5911c3[_0x7995('0x18')](_0x5911c3[_0x7995('0xd')][_0x132a42['id']],_0x132a42);}_0x5911c3['chatQueues'][_0x132a42['id']]['updateRouting']();_0x5911c3['chatQueues'][_0x132a42['id']][_0x7995('0x1e')]();}}return _0x5911c3[_0x7995('0xd')];};};Realtime[_0x7995('0x17')][_0x7995('0x20')]=function(){var _0x2e3493=this;return function(_0x1ca460){if(_0x1ca460){freeIsNotKey(_0x1ca460,_0x2e3493['smsQueues'],'id');for(var _0x481c74=0x0,_0xfa8f15={},_0x5524af={};_0x481c74<_0x1ca460[_0x7995('0x1a')];_0x481c74+=0x1){_0xfa8f15=_0x1ca460[_0x481c74];if(_[_0x7995('0x1b')](_0x2e3493[_0x7995('0x21')][_0xfa8f15['id']])){_0x2e3493[_0x7995('0x21')][_0xfa8f15['id']]=new SmsQueue(_0xfa8f15);}else{_0x2e3493[_0x7995('0x18')](_0x2e3493['smsQueues'][_0xfa8f15['id']],_0xfa8f15);}_0x2e3493[_0x7995('0x21')][_0xfa8f15['id']][_0x7995('0x1d')]();_0x2e3493['smsQueues'][_0xfa8f15['id']]['updateRealtime']();}}return _0x2e3493['smsQueues'];};};Realtime[_0x7995('0x17')][_0x7995('0x22')]=function(){var _0x4a176f=this;return function(_0x3e7020){if(_0x3e7020){freeIsNotKey(_0x3e7020,_0x4a176f['mailQueues'],'id');for(var _0x37917b=0x0,_0x1cb058={},_0x177cb4={};_0x37917b<_0x3e7020['length'];_0x37917b+=0x1){_0x1cb058=_0x3e7020[_0x37917b];if(_['isUndefined'](_0x4a176f[_0x7995('0xe')][_0x1cb058['id']])){_0x4a176f['mailQueues'][_0x1cb058['id']]=new MailQueue(_0x1cb058);}else{_0x4a176f['mergeFromDatabase'](_0x4a176f[_0x7995('0xe')][_0x1cb058['id']],_0x1cb058);}_0x4a176f[_0x7995('0xe')][_0x1cb058['id']]['updateRouting']();_0x4a176f[_0x7995('0xe')][_0x1cb058['id']][_0x7995('0x1e')]();}}return _0x4a176f[_0x7995('0xe')];};};Realtime[_0x7995('0x17')][_0x7995('0x23')]=function(){var _0x53002a=this;return function(_0x2d4285){if(_0x2d4285){freeIsNotKey(_0x2d4285,_0x53002a[_0x7995('0xf')],'id');for(var _0xf612e6=0x0,_0x1d60b8={},_0x4b1541={};_0xf612e6<_0x2d4285[_0x7995('0x1a')];_0xf612e6+=0x1){_0x1d60b8=_0x2d4285[_0xf612e6];if(_[_0x7995('0x1b')](_0x53002a[_0x7995('0xf')][_0x1d60b8['id']])){_0x53002a[_0x7995('0xf')][_0x1d60b8['id']]=new FaxQueue(_0x1d60b8);}else{_0x53002a[_0x7995('0x18')](_0x53002a[_0x7995('0xf')][_0x1d60b8['id']],_0x1d60b8);}_0x53002a['faxQueues'][_0x1d60b8['id']][_0x7995('0x1d')]();_0x53002a[_0x7995('0xf')][_0x1d60b8['id']][_0x7995('0x1e')]();}}return _0x53002a[_0x7995('0xf')];};};Realtime[_0x7995('0x17')][_0x7995('0x24')]=function(){var _0x14d638=this;return function(_0x270c0e){if(_0x270c0e){freeIsNotKey(_0x270c0e,_0x14d638[_0x7995('0x25')],'id');for(var _0x447981=0x0,_0x6fe77b={},_0x270d52={};_0x447981<_0x270c0e[_0x7995('0x1a')];_0x447981+=0x1){_0x6fe77b=_0x270c0e[_0x447981];if(_['isUndefined'](_0x14d638['whatsappQueues'][_0x6fe77b['id']])){_0x14d638[_0x7995('0x25')][_0x6fe77b['id']]=new WhatsappQueue(_0x6fe77b);}else{_0x14d638[_0x7995('0x18')](_0x14d638['whatsappQueues'][_0x6fe77b['id']],_0x6fe77b);}_0x14d638['whatsappQueues'][_0x6fe77b['id']][_0x7995('0x1d')]();_0x14d638['whatsappQueues'][_0x6fe77b['id']]['updateRealtime']();}}return _0x14d638[_0x7995('0x25')];};};module[_0x7995('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 67bce09..5bc3119 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 _0xe8d7=['addTags','AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x460dae,_0x3a907f){var _0x36e6d0=function(_0x447057){while(--_0x447057){_0x460dae['push'](_0x460dae['shift']());}};_0x36e6d0(++_0x3a907f);}(_0xe8d7,0x136));var _0x7e8d=function(_0x38b5c2,_0x7d4968){_0x38b5c2=_0x38b5c2-0x0;var _0x318136=_0xe8d7[_0x38b5c2];return _0x318136;};'use strict';var client=require(_0x7e8d('0x0'));exports[_0x7e8d('0x1')]=function(_0x1928b3,_0x31b39e){return client[_0x7e8d('0x2')](_0x7e8d('0x3'),{'body':_0x31b39e,'options':{'where':{'id':_0x1928b3}},'log':_0x7e8d('0x4')});};exports[_0x7e8d('0x5')]=function(_0x3430e0,_0x922550){return client[_0x7e8d('0x2')](_0x7e8d('0x6'),{'body':_0x922550,'options':{'where':{'id':_0x3430e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xea48=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x373222,_0x5a4d08){var _0x10f86e=function(_0x49f448){while(--_0x49f448){_0x373222['push'](_0x373222['shift']());}};_0x10f86e(++_0x5a4d08);}(_0xea48,0x1d7));var _0x8ea4=function(_0x305ba2,_0x197701){_0x305ba2=_0x305ba2-0x0;var _0x3e797f=_0xea48[_0x305ba2];return _0x3e797f;};'use strict';var client=require(_0x8ea4('0x0'));exports[_0x8ea4('0x1')]=function(_0x266a93,_0x3046c3){return client[_0x8ea4('0x2')](_0x8ea4('0x3'),{'body':_0x3046c3,'options':{'where':{'id':_0x266a93}},'log':_0x8ea4('0x4')});};exports[_0x8ea4('0x5')]=function(_0xbf6b44,_0x58f66b){return client[_0x8ea4('0x2')]('AddTagsToChatInteraction',{'body':_0x58f66b,'options':{'where':{'id':_0xbf6b44}},'log':_0x8ea4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d78f217..4a6a173 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 _0xee0f=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0xee0f,0x153));var _0xfee0=function(_0x41a3ab,_0x4bb061){_0x41a3ab=_0x41a3ab-0x0;var _0x3c9da9=_0xee0f[_0x41a3ab];return _0x3c9da9;};'use strict';var client=require(_0xfee0('0x0'));exports[_0xfee0('0x1')]=function(_0x1b7869){return client[_0xfee0('0x2')](_0xfee0('0x3'),{'body':_0x1b7869,'log':_0xfee0('0x4')});}; \ No newline at end of file +var _0xd7c2=['createChatMessage','create','CreateChatMessage'];(function(_0xbab353,_0x37e159){var _0x56871e=function(_0x474f77){while(--_0x474f77){_0xbab353['push'](_0xbab353['shift']());}};_0x56871e(++_0x37e159);}(_0xd7c2,0x190));var _0x2d7c=function(_0x5a9461,_0x30e8dc){_0x5a9461=_0x5a9461-0x0;var _0x39a3be=_0xd7c2[_0x5a9461];return _0x39a3be;};'use strict';var client=require('../client');exports[_0x2d7c('0x0')]=function(_0x42d714){return client['Request'](_0x2d7c('0x1'),{'body':_0x42d714,'log':_0x2d7c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 936c420..4208728 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 _0x2fd2=['chatPause','getChatQueues','../client','Request','timeout','strategy','User','Agents','online'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2fd2,0x1b2));var _0x22fd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2fd2[_0x432682];return _0x463d05;};'use strict';var client=require(_0x22fd('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x22fd('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x22fd('0x2'),_0x22fd('0x3')],'include':[{'model':_0x22fd('0x4'),'as':_0x22fd('0x5'),'attributes':['id','name',_0x22fd('0x6'),_0x22fd('0x7')]}]},'log':_0x22fd('0x8')});};}; \ No newline at end of file +var _0x3fa9=['User','Agents','name','../client','getChatQueues','Request','GetChatQueue','strategy'];(function(_0xa646c,_0x6c0ef1){var _0x4f5719=function(_0x3c894a){while(--_0x3c894a){_0xa646c['push'](_0xa646c['shift']());}};_0x4f5719(++_0x6c0ef1);}(_0x3fa9,0x163));var _0x93fa=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3fa9[_0x513aa5];return _0x1a1a7c;};'use strict';var client=require(_0x93fa('0x0'));exports[_0x93fa('0x1')]=function(){return function(){return client[_0x93fa('0x2')](_0x93fa('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x93fa('0x4')],'include':[{'model':_0x93fa('0x5'),'as':_0x93fa('0x6'),'attributes':['id',_0x93fa('0x7'),'online','chatPause']}]},'log':_0x93fa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 3245e46..7e6d527 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 _0xf194=['DESC','../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x3fcf7a,_0x599ecc){var _0x34cc20=function(_0x1df993){while(--_0x1df993){_0x3fcf7a['push'](_0x3fcf7a['shift']());}};_0x34cc20(++_0x599ecc);}(_0xf194,0x91));var _0x4f19=function(_0x4c59ed,_0x5242bf){_0x4c59ed=_0x4c59ed-0x0;var _0x59af1b=_0xf194[_0x4c59ed];return _0x59af1b;};'use strict';var client=require(_0x4f19('0x0'));exports[_0x4f19('0x1')]=function(_0x1ab42a){return client[_0x4f19('0x2')]('CreateChatQueueReport',{'body':_0x1ab42a,'log':_0x4f19('0x3')});};exports['update']=function(_0x5db065,_0x5c0587){return client[_0x4f19('0x2')](_0x4f19('0x4'),{'body':_0x5c0587,'options':{'where':{'uniqueid':_0x5db065},'order':[['id',_0x4f19('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xb4e6=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x52fcc8,_0x2864c5){var _0x5736d0=function(_0x2f5a4c){while(--_0x2f5a4c){_0x52fcc8['push'](_0x52fcc8['shift']());}};_0x5736d0(++_0x2864c5);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xb4e6[_0x29e35f];return _0x266b74;};'use strict';var client=require(_0x6b4e('0x0'));exports[_0x6b4e('0x1')]=function(_0x3c385b){return client[_0x6b4e('0x2')](_0x6b4e('0x3'),{'body':_0x3c385b,'log':_0x6b4e('0x3')});};exports['update']=function(_0x3f36b2,_0x55df8c){return client[_0x6b4e('0x2')](_0x6b4e('0x4'),{'body':_0x55df8c,'options':{'where':{'uniqueid':_0x3f36b2},'order':[['id',_0x6b4e('0x5')]],'limit':0x1},'log':_0x6b4e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 732b930..a35683c 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 _0x5df6=['updateFaxInteraction','addTags','addTagsToFaxInteraction','../client','update','Request'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x5df6,0x15f));var _0x65df=function(_0x195686,_0xd329df){_0x195686=_0x195686-0x0;var _0xaf27a1=_0x5df6[_0x195686];return _0xaf27a1;};'use strict';var client=require(_0x65df('0x0'));exports[_0x65df('0x1')]=function(_0x4d7572,_0x4362f6){return client[_0x65df('0x2')]('UpdateFaxInteraction',{'body':_0x4362f6,'options':{'where':{'id':_0x4d7572}},'log':_0x65df('0x3')});};exports[_0x65df('0x4')]=function(_0x5610f6,_0x344d1f){return client[_0x65df('0x2')]('AddTagsToFaxInteraction',{'body':_0x344d1f,'options':{'where':{'id':_0x5610f6}},'log':_0x65df('0x5')});}; \ No newline at end of file +var _0xc3b9=['update','Request','updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x1ccb6b,_0x4e91e6){var _0x4c316=function(_0x324f8c){while(--_0x324f8c){_0x1ccb6b['push'](_0x1ccb6b['shift']());}};_0x4c316(++_0x4e91e6);}(_0xc3b9,0xef));var _0x9c3b=function(_0x4f22fe,_0x23f451){_0x4f22fe=_0x4f22fe-0x0;var _0x12adca=_0xc3b9[_0x4f22fe];return _0x12adca;};'use strict';var client=require(_0x9c3b('0x0'));exports[_0x9c3b('0x1')]=function(_0x17c71c,_0x359032){return client[_0x9c3b('0x2')]('UpdateFaxInteraction',{'body':_0x359032,'options':{'where':{'id':_0x17c71c}},'log':_0x9c3b('0x3')});};exports['addTags']=function(_0x20c61a,_0x10385b){return client[_0x9c3b('0x2')](_0x9c3b('0x4'),{'body':_0x10385b,'options':{'where':{'id':_0x20c61a}},'log':_0x9c3b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 006c86a..2ed983a 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 _0xba2a=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x2a555a,_0x194f35){var _0x4dc4fd=function(_0x3faf62){while(--_0x3faf62){_0x2a555a['push'](_0x2a555a['shift']());}};_0x4dc4fd(++_0x194f35);}(_0xba2a,0x86));var _0xaba2=function(_0xb61562,_0x1c8d99){_0xb61562=_0xb61562-0x0;var _0x4f73c0=_0xba2a[_0xb61562];return _0x4f73c0;};'use strict';var client=require(_0xaba2('0x0'));exports[_0xaba2('0x1')]=function(_0x3ec2d1){return client[_0xaba2('0x2')](_0xaba2('0x3'),{'body':_0x3ec2d1,'log':_0xaba2('0x4')});}; \ No newline at end of file +var _0x2f0d=['../client','create','Request','createFaxMessage'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2f0d,0xd8));var _0xd2f0=function(_0x32c1ba,_0xa53c77){_0x32c1ba=_0x32c1ba-0x0;var _0x1ae6ca=_0x2f0d[_0x32c1ba];return _0x1ae6ca;};'use strict';var client=require(_0xd2f0('0x0'));exports[_0xd2f0('0x1')]=function(_0x3a01b9){return client[_0xd2f0('0x2')]('CreateFaxMessage',{'body':_0x3a01b9,'log':_0xd2f0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 16bd17f..1fd2bde 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 _0x898a=['timeout','strategy','User','name','online','../client','getFaxQueues'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x898a,0x1e1));var _0xa898=function(_0xf656b3,_0xc8dc48){_0xf656b3=_0xf656b3-0x0;var _0x467a5f=_0x898a[_0xf656b3];return _0x467a5f;};'use strict';var client=require(_0xa898('0x0'));exports[_0xa898('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xa898('0x2'),_0xa898('0x3')],'include':[{'model':_0xa898('0x4'),'as':'Agents','attributes':['id',_0xa898('0x5'),_0xa898('0x6'),'faxPause']}]},'log':_0xa898('0x1')});};}; \ No newline at end of file +var _0xe99c=['name','timeout','strategy','User','online','faxPause','getFaxQueues','../client'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0xe99c,0x87));var _0xce99=function(_0x1a2bd6,_0x482a90){_0x1a2bd6=_0x1a2bd6-0x0;var _0x4096d1=_0xe99c[_0x1a2bd6];return _0x4096d1;};'use strict';var client=require(_0xce99('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xce99('0x1'),_0xce99('0x2'),_0xce99('0x3')],'include':[{'model':_0xce99('0x4'),'as':'Agents','attributes':['id',_0xce99('0x1'),_0xce99('0x5'),_0xce99('0x6')]}]},'log':_0xce99('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c2c60cb..516e405 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 _0xc96b=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x1e39dc,_0x38a8ae){var _0xd2c696=function(_0x264c19){while(--_0x264c19){_0x1e39dc['push'](_0x1e39dc['shift']());}};_0xd2c696(++_0x38a8ae);}(_0xc96b,0x16d));var _0xbc96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc96b[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xbc96('0x0'));exports[_0xbc96('0x1')]=function(_0x477287){return client[_0xbc96('0x2')](_0xbc96('0x3'),{'body':_0x477287,'log':_0xbc96('0x3')});};exports[_0xbc96('0x4')]=function(_0xb855a4,_0xa0bba6){return client[_0xbc96('0x2')](_0xbc96('0x5'),{'body':_0xa0bba6,'options':{'where':{'uniqueid':_0xb855a4},'order':[['id',_0xbc96('0x6')]],'limit':0x1},'log':_0xbc96('0x5')});}; \ No newline at end of file +var _0x43fd=['UpdateFaxQueueReport','DESC','create','CreateFaxQueueReport','Request'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x43fd,0x1ec));var _0xd43f=function(_0x483a7d,_0x53784e){_0x483a7d=_0x483a7d-0x0;var _0xb4e520=_0x43fd[_0x483a7d];return _0xb4e520;};'use strict';var client=require('../client');exports[_0xd43f('0x0')]=function(_0x4c8461){return client['Request'](_0xd43f('0x1'),{'body':_0x4c8461,'log':_0xd43f('0x1')});};exports['update']=function(_0x3df2bd,_0x48f953){return client[_0xd43f('0x2')](_0xd43f('0x3'),{'body':_0x48f953,'options':{'where':{'uniqueid':_0x3df2bd},'order':[['id',_0xd43f('0x4')]],'limit':0x1},'log':_0xd43f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6f152ff..d67f0d4 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 _0xb9be=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x512c74,_0x104492){var _0x1a4cd8=function(_0x7c30e4){while(--_0x7c30e4){_0x512c74['push'](_0x512c74['shift']());}};_0x1a4cd8(++_0x104492);}(_0xb9be,0xc5));var _0xeb9b=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xb9be[_0x59e821];return _0x5333f6;};'use strict';var client=require(_0xeb9b('0x0'));exports[_0xeb9b('0x1')]=function(){return function(){return client[_0xeb9b('0x2')](_0xeb9b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xeb9b('0x4')],'include':[{'model':_0xeb9b('0x5'),'as':_0xeb9b('0x6'),'attributes':['id',_0xeb9b('0x4'),_0xeb9b('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x9e0d=['getIntervals','Request','GetInterval','Interval','Intervals','name','interval','../client'];(function(_0x453222,_0xd17a0e){var _0x236ed6=function(_0x35bb82){while(--_0x35bb82){_0x453222['push'](_0x453222['shift']());}};_0x236ed6(++_0xd17a0e);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x572743,_0x2cc13c){_0x572743=_0x572743-0x0;var _0x3abb61=_0x9e0d[_0x572743];return _0x3abb61;};'use strict';var client=require(_0xd9e0('0x0'));exports[_0xd9e0('0x1')]=function(){return function(){return client[_0xd9e0('0x2')](_0xd9e0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xd9e0('0x4'),'as':_0xd9e0('0x5'),'attributes':['id',_0xd9e0('0x6'),_0xd9e0('0x7')]}]},'log':_0xd9e0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f1e9819..9c72ad3 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 _0xabb7=['UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xabb7,0x13a));var _0x7abb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xabb7[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require('../client');exports[_0x7abb('0x0')]=function(_0x2dbf69,_0x46a71e){return client['Request'](_0x7abb('0x1'),{'body':_0x46a71e,'options':{'where':{'id':_0x2dbf69}},'log':_0x7abb('0x2')});};exports[_0x7abb('0x3')]=function(_0x820863,_0x3395f5){return client[_0x7abb('0x4')](_0x7abb('0x5'),{'body':_0x3395f5,'options':{'where':{'id':_0x820863}},'log':_0x7abb('0x6')});}; \ No newline at end of file +var _0x242b=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x1df787,_0x24e8df){var _0x25a24b=function(_0x2e961d){while(--_0x2e961d){_0x1df787['push'](_0x1df787['shift']());}};_0x25a24b(++_0x24e8df);}(_0x242b,0x132));var _0xb242=function(_0x27e6c4,_0x5c26dd){_0x27e6c4=_0x27e6c4-0x0;var _0x33011c=_0x242b[_0x27e6c4];return _0x33011c;};'use strict';var client=require('../client');exports[_0xb242('0x0')]=function(_0x42c874,_0x35712e){return client[_0xb242('0x1')](_0xb242('0x2'),{'body':_0x35712e,'options':{'where':{'id':_0x42c874}},'log':_0xb242('0x3')});};exports['addTags']=function(_0x3de8f3,_0xcecf30){return client[_0xb242('0x1')](_0xb242('0x4'),{'body':_0xcecf30,'options':{'where':{'id':_0x3de8f3}},'log':_0xb242('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e06fe15..05ff584 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 _0xd4b7=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x629c83,_0x367800){var _0x315d48=function(_0x571bb9){while(--_0x571bb9){_0x629c83['push'](_0x629c83['shift']());}};_0x315d48(++_0x367800);}(_0xd4b7,0xf4));var _0x7d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7d4b('0x0'));exports[_0x7d4b('0x1')]=function(_0x2a59cb){return client['Request'](_0x7d4b('0x2'),{'body':_0x2a59cb,'log':_0x7d4b('0x3')});}; \ No newline at end of file +var _0xdf3d=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xdf3d,0x96));var _0xddf3=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xdf3d[_0x9df060];return _0x338dfe;};'use strict';var client=require(_0xddf3('0x0'));exports['create']=function(_0x5cf156){return client[_0xddf3('0x1')](_0xddf3('0x2'),{'body':_0x5cf156,'log':_0xddf3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 131bead..7d20511 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 _0x4153=['name','online','mailPause','getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents'];(function(_0x5bd1a9,_0x313714){var _0x2ba345=function(_0x21b4af){while(--_0x21b4af){_0x5bd1a9['push'](_0x5bd1a9['shift']());}};_0x2ba345(++_0x313714);}(_0x4153,0x176));var _0x3415=function(_0x13c65a,_0x571ca1){_0x13c65a=_0x13c65a-0x0;var _0x1337b3=_0x4153[_0x13c65a];return _0x1337b3;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x3415('0x0')](_0x3415('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x3415('0x2'),_0x3415('0x3')],'include':[{'model':_0x3415('0x4'),'as':_0x3415('0x5'),'attributes':['id',_0x3415('0x6'),_0x3415('0x7'),_0x3415('0x8')]}]},'log':_0x3415('0x9')});};}; \ No newline at end of file +var _0x7c78=['getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x23ce41,_0x12c0f7){var _0x2212a1=function(_0x332a62){while(--_0x332a62){_0x23ce41['push'](_0x23ce41['shift']());}};_0x2212a1(++_0x12c0f7);}(_0x7c78,0x1f3));var _0x87c7=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0x7c78[_0x5111a9];return _0x59a15a;};'use strict';var client=require(_0x87c7('0x0'));exports[_0x87c7('0x1')]=function(){return function(){return client['Request'](_0x87c7('0x2'),{'options':{'raw':![],'attributes':['id',_0x87c7('0x3'),_0x87c7('0x4'),_0x87c7('0x5')],'include':[{'model':_0x87c7('0x6'),'as':_0x87c7('0x7'),'attributes':['id',_0x87c7('0x3'),_0x87c7('0x8'),_0x87c7('0x9')]}]},'log':_0x87c7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e963d1f..1f1f021 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 _0x89b5=['UpdateMailQueueReport','create','CreateMailQueueReport','update','Request','DESC'];(function(_0x2213ab,_0x487773){var _0x5b6403=function(_0x289005){while(--_0x289005){_0x2213ab['push'](_0x2213ab['shift']());}};_0x5b6403(++_0x487773);}(_0x89b5,0xfd));var _0x589b=function(_0x4abbca,_0x11ba72){_0x4abbca=_0x4abbca-0x0;var _0x4a7a44=_0x89b5[_0x4abbca];return _0x4a7a44;};'use strict';var client=require('../client');exports[_0x589b('0x0')]=function(_0x2fb95a){return client['Request']('CreateMailQueueReport',{'body':_0x2fb95a,'log':_0x589b('0x1')});};exports[_0x589b('0x2')]=function(_0x4d48e4,_0x12c72d){return client[_0x589b('0x3')]('UpdateMailQueueReport',{'body':_0x12c72d,'options':{'where':{'uniqueid':_0x4d48e4},'order':[['id',_0x589b('0x4')]],'limit':0x1},'log':_0x589b('0x5')});}; \ No newline at end of file +var _0x2a4a=['UpdateMailQueueReport','../client','CreateMailQueueReport','Request','DESC'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x2a4a,0x141));var _0xa2a4=function(_0x43d081,_0x2952ed){_0x43d081=_0x43d081-0x0;var _0x473771=_0x2a4a[_0x43d081];return _0x473771;};'use strict';var client=require(_0xa2a4('0x0'));exports['create']=function(_0x2f5b58){return client['Request'](_0xa2a4('0x1'),{'body':_0x2f5b58,'log':'CreateMailQueueReport'});};exports['update']=function(_0x254fef,_0x555520){return client[_0xa2a4('0x2')]('UpdateMailQueueReport',{'body':_0x555520,'options':{'where':{'uniqueid':_0x254fef},'order':[['id',_0xa2a4('0x3')]],'limit':0x1},'log':_0xa2a4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 98ccdc7..d5e9bf9 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 _0x8e63=['Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','updateOpenchannelInteraction'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x8e63,0x83));var _0x38e6=function(_0x5be2f7,_0x1d4d63){_0x5be2f7=_0x5be2f7-0x0;var _0x432e78=_0x8e63[_0x5be2f7];return _0x432e78;};'use strict';var client=require('../client');exports['update']=function(_0x16971a,_0x512186){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x512186,'options':{'where':{'id':_0x16971a}},'log':_0x38e6('0x0')});};exports['addTags']=function(_0x456fd9,_0x5c212f){return client[_0x38e6('0x1')](_0x38e6('0x2'),{'body':_0x5c212f,'options':{'where':{'id':_0x456fd9}},'log':_0x38e6('0x3')});}; \ No newline at end of file +var _0xb04d=['addTagsToChatInteraction','../client','update','Request','AddTagsToOpenchannelInteraction'];(function(_0x39ddd8,_0x378f5c){var _0x150db0=function(_0x4d2990){while(--_0x4d2990){_0x39ddd8['push'](_0x39ddd8['shift']());}};_0x150db0(++_0x378f5c);}(_0xb04d,0x150));var _0xdb04=function(_0x51d678,_0x1a2f97){_0x51d678=_0x51d678-0x0;var _0x4d31cb=_0xb04d[_0x51d678];return _0x4d31cb;};'use strict';var client=require(_0xdb04('0x0'));exports[_0xdb04('0x1')]=function(_0x3bacbd,_0x52c21){return client[_0xdb04('0x2')]('UpdateOpenchannelInteraction',{'body':_0x52c21,'options':{'where':{'id':_0x3bacbd}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3299a8,_0x22e6d7){return client[_0xdb04('0x2')](_0xdb04('0x3'),{'body':_0x22e6d7,'options':{'where':{'id':_0x3299a8}},'log':_0xdb04('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 21d5261..fe0b432 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 _0xe706=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x461d62,_0x5041bf){var _0x5deb71=function(_0x50b84a){while(--_0x50b84a){_0x461d62['push'](_0x461d62['shift']());}};_0x5deb71(++_0x5041bf);}(_0xe706,0xa3));var _0x6e70=function(_0x141310,_0x4fb243){_0x141310=_0x141310-0x0;var _0x4680ae=_0xe706[_0x141310];return _0x4680ae;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(_0x311951){return client['Request'](_0x6e70('0x2'),{'body':_0x311951,'log':_0x6e70('0x3')});}; \ No newline at end of file +var _0x9bde=['create','Request','createOpenchannelMessage'];(function(_0x481159,_0x14f64e){var _0x5a7ba7=function(_0x184948){while(--_0x184948){_0x481159['push'](_0x481159['shift']());}};_0x5a7ba7(++_0x14f64e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5bfb40,_0x184b43){_0x5bfb40=_0x5bfb40-0x0;var _0x393065=_0x9bde[_0x5bfb40];return _0x393065;};'use strict';var client=require('../client');exports[_0xe9bd('0x0')]=function(_0x4defda){return client[_0xe9bd('0x1')]('CreateOpenchannelMessage',{'body':_0x4defda,'log':_0xe9bd('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 4849a75..d3e1f02 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 _0xeb70=['getOpenchannelQueues','Request','name','strategy','User','online','../client'];(function(_0x35f8bf,_0x8bfff1){var _0x6cf3f4=function(_0x22ffa6){while(--_0x22ffa6){_0x35f8bf['push'](_0x35f8bf['shift']());}};_0x6cf3f4(++_0x8bfff1);}(_0xeb70,0xca));var _0x0eb7=function(_0x857df7,_0x5068ce){_0x857df7=_0x857df7-0x0;var _0x1da2ca=_0xeb70[_0x857df7];return _0x1da2ca;};'use strict';var client=require(_0x0eb7('0x0'));exports[_0x0eb7('0x1')]=function(){return function(){return client[_0x0eb7('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x0eb7('0x3'),'timeout',_0x0eb7('0x4')],'include':[{'model':_0x0eb7('0x5'),'as':'Agents','attributes':['id','name',_0x0eb7('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x3a27=['name','online','openchannelPause','../client','getOpenchannelQueues','strategy','Agents'];(function(_0x349d54,_0xcbb074){var _0x3fbb79=function(_0x4c157a){while(--_0x4c157a){_0x349d54['push'](_0x349d54['shift']());}};_0x3fbb79(++_0xcbb074);}(_0x3a27,0x96));var _0x73a2=function(_0x1bd3b8,_0x5dacb3){_0x1bd3b8=_0x1bd3b8-0x0;var _0x3ffb5d=_0x3a27[_0x1bd3b8];return _0x3ffb5d;};'use strict';var client=require(_0x73a2('0x0'));exports[_0x73a2('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x73a2('0x2')],'include':[{'model':'User','as':_0x73a2('0x3'),'attributes':['id',_0x73a2('0x4'),_0x73a2('0x5'),_0x73a2('0x6')]}]},'log':_0x73a2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 91a4186..3e0d882 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 _0xb73e=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x57d567,_0x633013){var _0x16f031=function(_0x5a13ce){while(--_0x5a13ce){_0x57d567['push'](_0x57d567['shift']());}};_0x16f031(++_0x633013);}(_0xb73e,0x101));var _0xeb73=function(_0x280377,_0x456bce){_0x280377=_0x280377-0x0;var _0x40836d=_0xb73e[_0x280377];return _0x40836d;};'use strict';var client=require(_0xeb73('0x0'));exports[_0xeb73('0x1')]=function(_0x276ff6){return client[_0xeb73('0x2')]('CreateOpenchannelQueueReport',{'body':_0x276ff6,'log':_0xeb73('0x3')});};exports[_0xeb73('0x4')]=function(_0x45b4d9,_0x51c538){return client[_0xeb73('0x2')](_0xeb73('0x5'),{'body':_0x51c538,'options':{'where':{'uniqueid':_0x45b4d9},'order':[['id',_0xeb73('0x6')]],'limit':0x1},'log':_0xeb73('0x5')});}; \ No newline at end of file +var _0xbf1b=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','Request'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xbf1b,0x6b));var _0xbbf1=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xbf1b[_0x5f3f88];return _0xd08119;};'use strict';var client=require('../client');exports['create']=function(_0x15811b){return client[_0xbbf1('0x0')](_0xbbf1('0x1'),{'body':_0x15811b,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x5e2b84,_0x4fbc82){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x4fbc82,'options':{'where':{'uniqueid':_0x5e2b84},'order':[['id','DESC']],'limit':0x1},'log':_0xbbf1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c4b54be..00de064 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 _0xf831=['addTags','AddTagsToSmsInteraction','update','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf831,0x72));var _0x1f83=function(_0x35a6f5,_0x18f43c){_0x35a6f5=_0x35a6f5-0x0;var _0x314baf=_0xf831[_0x35a6f5];return _0x314baf;};'use strict';var client=require('../client');exports[_0x1f83('0x0')]=function(_0x297356,_0x5136fa){return client[_0x1f83('0x1')]('UpdateSmsInteraction',{'body':_0x5136fa,'options':{'where':{'id':_0x297356}},'log':'updateSmsInteraction'});};exports[_0x1f83('0x2')]=function(_0x196085,_0x2a3ac3){return client[_0x1f83('0x1')](_0x1f83('0x3'),{'body':_0x2a3ac3,'options':{'where':{'id':_0x196085}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xad3d=['addTagsToSmsInteraction','../client','update','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0xad3d,0xb7));var _0xdad3=function(_0x1c4670,_0x5676d4){_0x1c4670=_0x1c4670-0x0;var _0x5ee67f=_0xad3d[_0x1c4670];return _0x5ee67f;};'use strict';var client=require(_0xdad3('0x0'));exports[_0xdad3('0x1')]=function(_0x228735,_0xbd25be){return client['Request']('UpdateSmsInteraction',{'body':_0xbd25be,'options':{'where':{'id':_0x228735}},'log':_0xdad3('0x2')});};exports[_0xdad3('0x3')]=function(_0x4baf72,_0xc3a665){return client[_0xdad3('0x4')](_0xdad3('0x5'),{'body':_0xc3a665,'options':{'where':{'id':_0x4baf72}},'log':_0xdad3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 656b0d4..d389dad 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 _0xc282=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x235071,_0x30b4d2){var _0x5cc2c5=function(_0x3887ad){while(--_0x3887ad){_0x235071['push'](_0x235071['shift']());}};_0x5cc2c5(++_0x30b4d2);}(_0xc282,0x1b5));var _0x2c28=function(_0x5e09bf,_0x5dfc6f){_0x5e09bf=_0x5e09bf-0x0;var _0x18cc19=_0xc282[_0x5e09bf];return _0x18cc19;};'use strict';var client=require('../client');exports[_0x2c28('0x0')]=function(_0x76818a){return client[_0x2c28('0x1')](_0x2c28('0x2'),{'body':_0x76818a,'log':_0x2c28('0x3')});}; \ No newline at end of file +var _0xf0b7=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0b7,0xec));var _0x7f0b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf0b7[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0x7f0b('0x0')]=function(_0x38e77e){return client[_0x7f0b('0x1')](_0x7f0b('0x2'),{'body':_0x38e77e,'log':_0x7f0b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0359960..28c5ced 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 _0xf2f2=['../client','getSmsQueues','GetSmsQueue','timeout','strategy','User','online'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xf2f2,0x70));var _0x2f2f=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0xf2f2[_0x4e11d5];return _0x5e4e4c;};'use strict';var client=require(_0x2f2f('0x0'));exports[_0x2f2f('0x1')]=function(){return function(){return client['Request'](_0x2f2f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2f2f('0x3'),_0x2f2f('0x4')],'include':[{'model':_0x2f2f('0x5'),'as':'Agents','attributes':['id','name',_0x2f2f('0x6'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x4c50=['Request','GetSmsQueue','strategy','User','Agents','name','smsPause','getSmsQueues'];(function(_0x357cf,_0x210512){var _0x41dc97=function(_0x4f6627){while(--_0x4f6627){_0x357cf['push'](_0x357cf['shift']());}};_0x41dc97(++_0x210512);}(_0x4c50,0xf7));var _0x04c5=function(_0x2b8362,_0x3dc061){_0x2b8362=_0x2b8362-0x0;var _0x257e17=_0x4c50[_0x2b8362];return _0x257e17;};'use strict';var client=require('../client');exports[_0x04c5('0x0')]=function(){return function(){return client[_0x04c5('0x1')](_0x04c5('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x04c5('0x3')],'include':[{'model':_0x04c5('0x4'),'as':_0x04c5('0x5'),'attributes':['id',_0x04c5('0x6'),'online',_0x04c5('0x7')]}]},'log':_0x04c5('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 68d510e..586d474 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 _0x8ac5=['DESC','UpdateSmsQueueReport','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ac5,0x105));var _0x58ac=function(_0x348683,_0x3ec631){_0x348683=_0x348683-0x0;var _0x35f06a=_0x8ac5[_0x348683];return _0x35f06a;};'use strict';var client=require(_0x58ac('0x0'));exports[_0x58ac('0x1')]=function(_0xff25a2){return client[_0x58ac('0x2')](_0x58ac('0x3'),{'body':_0xff25a2,'log':_0x58ac('0x3')});};exports[_0x58ac('0x4')]=function(_0x276bc0,_0x474fa3){return client[_0x58ac('0x2')]('UpdateSmsQueueReport',{'body':_0x474fa3,'options':{'where':{'uniqueid':_0x276bc0},'order':[['id',_0x58ac('0x5')]],'limit':0x1},'log':_0x58ac('0x6')});}; \ No newline at end of file +var _0x3ec5=['Request','CreateSmsQueueReport','DESC','UpdateSmsQueueReport','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ec5,0x176));var _0x53ec=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3ec5[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports[_0x53ec('0x0')]=function(_0x5ef2dc){return client[_0x53ec('0x1')](_0x53ec('0x2'),{'body':_0x5ef2dc,'log':_0x53ec('0x2')});};exports['update']=function(_0x3c89a8,_0x2424c7){return client[_0x53ec('0x1')]('UpdateSmsQueueReport',{'body':_0x2424c7,'options':{'where':{'uniqueid':_0x3c89a8},'order':[['id',_0x53ec('0x3')]],'limit':0x1},'log':_0x53ec('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 10ffa06..80e57d1 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 _0xa581=['agent','name','pauseType','lastPauseAt','mailPause','smsPause','whatsappPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa581,0x194));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x1a58('0x0'));exports[_0x1a58('0x1')]=function(){return function(){return client[_0x1a58('0x2')](_0x1a58('0x3'),{'options':{'raw':!![],'where':{'role':_0x1a58('0x4')},'attributes':['id',_0x1a58('0x5'),'online',_0x1a58('0x6'),_0x1a58('0x7'),'voicePause','chatPause',_0x1a58('0x8'),'faxPause',_0x1a58('0x9'),_0x1a58('0xa'),_0x1a58('0xb'),_0x1a58('0xc'),_0x1a58('0xd'),_0x1a58('0xe'),_0x1a58('0xf'),'whatsappCapacity',_0x1a58('0x10')]},'log':_0x1a58('0x1')});};}; \ No newline at end of file +var _0x8a09=['faxPause','smsPause','whatsappPause','mailCapacity','faxCapacity','smsCapacity','whatsappCapacity','openchannelCapacity','../client','getAgents','GetUser','agent','name','pauseType','lastPauseAt','voicePause','chatPause'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x8a09,0xf6));var _0x98a0=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8a09[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x98a0('0x0'));exports[_0x98a0('0x1')]=function(){return function(){return client['Request'](_0x98a0('0x2'),{'options':{'raw':!![],'where':{'role':_0x98a0('0x3')},'attributes':['id',_0x98a0('0x4'),'online',_0x98a0('0x5'),_0x98a0('0x6'),_0x98a0('0x7'),_0x98a0('0x8'),'mailPause',_0x98a0('0x9'),_0x98a0('0xa'),_0x98a0('0xb'),'openchannelPause','chatCapacity',_0x98a0('0xc'),_0x98a0('0xd'),_0x98a0('0xe'),_0x98a0('0xf'),_0x98a0('0x10')]},'log':_0x98a0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index eb4b9ec..2085644 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf296=['updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','../client','update'];(function(_0x12e682,_0x33f3a3){var _0x26e600=function(_0x4d79dc){while(--_0x4d79dc){_0x12e682['push'](_0x12e682['shift']());}};_0x26e600(++_0x33f3a3);}(_0xf296,0x94));var _0x6f29=function(_0x2eedb5,_0x2e1801){_0x2eedb5=_0x2eedb5-0x0;var _0x534cd6=_0xf296[_0x2eedb5];return _0x534cd6;};'use strict';var client=require(_0x6f29('0x0'));exports[_0x6f29('0x1')]=function(_0x4e5239,_0x45ff60){return client['Request']('UpdateWhatsappInteraction',{'body':_0x45ff60,'options':{'where':{'id':_0x4e5239}},'log':_0x6f29('0x2')});};exports[_0x6f29('0x3')]=function(_0x4cdc12,_0x15e80c){return client[_0x6f29('0x4')](_0x6f29('0x5'),{'body':_0x15e80c,'options':{'where':{'id':_0x4cdc12}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x5a8c=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x26f956,_0x4421c1){_0x26f956=_0x26f956-0x0;var _0x468c52=_0x5a8c[_0x26f956];return _0x468c52;};'use strict';var client=require(_0xc5a8('0x0'));exports[_0xc5a8('0x1')]=function(_0x4de0b0,_0x38dc02){return client[_0xc5a8('0x2')](_0xc5a8('0x3'),{'body':_0x38dc02,'options':{'where':{'id':_0x4de0b0}},'log':_0xc5a8('0x4')});};exports['addTags']=function(_0x2d862c,_0x4310e4){return client['Request'](_0xc5a8('0x5'),{'body':_0x4310e4,'options':{'where':{'id':_0x2d862c}},'log':_0xc5a8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f238fab..fff6388 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x714d=['CreateWhatsappMessage','Request'];(function(_0x3c3b7a,_0x545178){var _0x28eaa2=function(_0x1f4b99){while(--_0x1f4b99){_0x3c3b7a['push'](_0x3c3b7a['shift']());}};_0x28eaa2(++_0x545178);}(_0x714d,0x1ed));var _0xd714=function(_0x2420b7,_0x3e4150){_0x2420b7=_0x2420b7-0x0;var _0x2251c1=_0x714d[_0x2420b7];return _0x2251c1;};'use strict';var client=require('../client');exports['create']=function(_0xaecb0a){return client[_0xd714('0x0')](_0xd714('0x1'),{'body':_0xaecb0a,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xc927=['CreateWhatsappMessage','createWhatsappMessage','../client','Request'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0xc927,0x14e));var _0x7c92=function(_0x50925f,_0x2d01b1){_0x50925f=_0x50925f-0x0;var _0x59ad78=_0xc927[_0x50925f];return _0x59ad78;};'use strict';var client=require(_0x7c92('0x0'));exports['create']=function(_0x3c22c9){return client[_0x7c92('0x1')](_0x7c92('0x2'),{'body':_0x3c22c9,'log':_0x7c92('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 0fe4561..1744697 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['../client','getWhatsappQueues','name','timeout','User','Agents','online','whatsappPause'];(function(_0x1f38c6,_0x428650){var _0x259367=function(_0x22bad0){while(--_0x22bad0){_0x1f38c6['push'](_0x1f38c6['shift']());}};_0x259367(++_0x428650);}(_0x9c00,0x1a0));var _0x09c0=function(_0x16df8f,_0x3dbe15){_0x16df8f=_0x16df8f-0x0;var _0x56ffee=_0x9c00[_0x16df8f];return _0x56ffee;};'use strict';var client=require(_0x09c0('0x0'));exports[_0x09c0('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x09c0('0x2'),_0x09c0('0x3'),'strategy'],'include':[{'model':_0x09c0('0x4'),'as':_0x09c0('0x5'),'attributes':['id',_0x09c0('0x2'),_0x09c0('0x6'),_0x09c0('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x823c=['online','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x524130,_0x261843){var _0x12496f=function(_0x9442c0){while(--_0x9442c0){_0x524130['push'](_0x524130['shift']());}};_0x12496f(++_0x261843);}(_0x823c,0x143));var _0xc823=function(_0x4913bf,_0x3137c7){_0x4913bf=_0x4913bf-0x0;var _0x134be3=_0x823c[_0x4913bf];return _0x134be3;};'use strict';var client=require(_0xc823('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xc823('0x1')](_0xc823('0x2'),{'options':{'raw':![],'attributes':['id',_0xc823('0x3'),_0xc823('0x4'),_0xc823('0x5')],'include':[{'model':_0xc823('0x6'),'as':'Agents','attributes':['id',_0xc823('0x3'),_0xc823('0x7'),_0xc823('0x8')]}]},'log':_0xc823('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 3dbad53..d1fb8b5 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f45=['CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','../client','create'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x0f45,0x9a));var _0x50f4=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x0f45[_0x1762b4];return _0x29beda;};'use strict';var client=require(_0x50f4('0x0'));exports[_0x50f4('0x1')]=function(_0x135f73){return client['Request'](_0x50f4('0x2'),{'body':_0x135f73,'log':'CreateWhatsappQueueReport'});};exports[_0x50f4('0x3')]=function(_0x1c05e0,_0x180c92){return client[_0x50f4('0x4')]('UpdateWhatsappQueueReport',{'body':_0x180c92,'options':{'where':{'uniqueid':_0x1c05e0},'order':[['id','DESC']],'limit':0x1},'log':_0x50f4('0x5')});}; \ No newline at end of file +var _0x0b9b=['DESC','../client','Request','update','UpdateWhatsappQueueReport'];(function(_0x128a4c,_0x246df6){var _0x514d6c=function(_0xb0387b){while(--_0xb0387b){_0x128a4c['push'](_0x128a4c['shift']());}};_0x514d6c(++_0x246df6);}(_0x0b9b,0x6a));var _0xb0b9=function(_0x36e48d,_0x367d95){_0x36e48d=_0x36e48d-0x0;var _0x3bcc55=_0x0b9b[_0x36e48d];return _0x3bcc55;};'use strict';var client=require(_0xb0b9('0x0'));exports['create']=function(_0x471dbf){return client[_0xb0b9('0x1')]('CreateWhatsappQueueReport',{'body':_0x471dbf,'log':'CreateWhatsappQueueReport'});};exports[_0xb0b9('0x2')]=function(_0x1d33ad,_0x4517e2){return client[_0xb0b9('0x1')](_0xb0b9('0x3'),{'body':_0x4517e2,'options':{'where':{'uniqueid':_0x1d33ad},'order':[['id',_0xb0b9('0x4')]],'limit':0x1},'log':_0xb0b9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 1218693..9f928bc 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 _0x5cd9=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','stop','find','timeout','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','info','close','next','agent','error','log','stack','validate','seq-queue','../../../../config/logger','routing','./strategy'];(function(_0x274b55,_0x2823fe){var _0x1bafce=function(_0x19524b){while(--_0x19524b){_0x274b55['push'](_0x274b55['shift']());}};_0x1bafce(++_0x2823fe);}(_0x5cd9,0xcd));var _0x95cd=function(_0x5237fa,_0x2219d8){_0x5237fa=_0x5237fa-0x0;var _0x3f1a66=_0x5cd9[_0x5237fa];return _0x3f1a66;};'use strict';var schema=require(_0x95cd('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x95cd('0x1'));var logger=require(_0x95cd('0x2'))(_0x95cd('0x3'));var strategy=require(_0x95cd('0x4'));var queue=schema({'name':{'type':_0x95cd('0x5'),'required':!![],'message':_0x95cd('0x6')},'timeout':{'type':_0x95cd('0x7'),'message':_0x95cd('0x8')}});function writeLog(_0x55d299,_0x455f7d,_0x3f03d7){return logger['info'](util[_0x95cd('0x9')](_0x95cd('0xa'),_0x55d299,_0x455f7d[_0x95cd('0xb')],_0x3f03d7));}function handleFindAgent(_0x450e54){return function(_0x4e236f){return _0x4e236f[_0x95cd('0xb')][_0x95cd('0xc')]()===_0x450e54[_0x95cd('0xc')]();};}exports[_0x95cd('0xd')]=function(_0x121a4e,_0x294e54,_0x6b9610,_0x511cf2){return function(_0x1fbab8){try{var _0x1d3edd={'name':_0x294e54[0x0],'timeout':_0x294e54[0x1]};var _0x510ce8=queue[_0x95cd('0x0')](_0x1d3edd,{'typecast':!![]});if(_0x510ce8[_0x95cd('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0x121a4e,_[_0x95cd('0xf')](_0x510ce8,_0x95cd('0x10'))[_0x95cd('0x11')](',\x20'));_0x1fbab8[_0x95cd('0x12')]();}else{var _0x3fd28b=_[_0x95cd('0x13')](_0x6b9610['agents'],handleFindAgent(_0x1d3edd[_0x95cd('0xb')]));if(_0x3fd28b){var _0xf1483c=(_0x1d3edd[_0x95cd('0x14')]||0xa)*0x3e8;var _0x46d790,_0x1c9812;var _0x56ff86=seqqueue['createQueue'](_0xf1483c);_0x56ff86['id']=_0x121a4e;_0x56ff86[_0x95cd('0x15')]=_0xf1483c;_0x56ff86[_0x95cd('0x16')]=_0x511cf2['channel'];writeLog(_0x121a4e,_0x3fd28b,util['format'](_0x95cd('0x17'),_0xf1483c));_0x6b9610['rules'][_0x121a4e]['on'](_0x95cd('0x18'),function(){logger['info'](_0x95cd('0x19'),_0x121a4e);clearTimeout(_0x1c9812);_0x1c9812=undefined;_0x56ff86['close']();if(_0x6b9610[_0x95cd('0x1a')][_0x121a4e]){delete _0x6b9610['rules'][_0x121a4e];}_0x1fbab8[_0x95cd('0x12')]();});_0x6b9610[_0x95cd('0x1a')][_0x121a4e]['on'](_0x95cd('0x1b'),function(){if(_0x6b9610[_0x95cd('0x1a')][_0x121a4e]){delete _0x6b9610[_0x95cd('0x1a')][_0x121a4e];}});_0x1c9812=setTimeout(function(){logger[_0x95cd('0x1c')]('[%s][AGENT]\x20ROUTING\x20END',_0x121a4e);clearTimeout(_0x1c9812);_0x56ff86[_0x95cd('0x1d')]();_0x1fbab8[_0x95cd('0x1e')]();},_0xf1483c);strategy[_0x95cd('0x1f')](_0x56ff86,_0x3fd28b,_0x6b9610,_0x511cf2);}else{logger[_0x95cd('0x20')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x121a4e,_0x1d3edd['name']);_0x1fbab8['stop']();}}}catch(_0x38912b){console[_0x95cd('0x21')](_0x38912b);logger[_0x95cd('0x20')]('[%s][QUEUE]\x20%s',_0x121a4e,_0x38912b[_0x95cd('0x22')]);_0x1fbab8[_0x95cd('0x12')]();}};}; \ No newline at end of file +var _0xc535=['atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','join','stop','find','timeout','createQueue'];(function(_0x570bfa,_0x44a280){var _0x5d7348=function(_0x4c6fab){while(--_0x4c6fab){_0x570bfa['push'](_0x570bfa['shift']());}};_0x5d7348(++_0x44a280);}(_0xc535,0x1e4));var _0x5c53=function(_0x30c373,_0x3805c6){_0x30c373=_0x30c373-0x0;var _0x2d0763=_0xc535[_0x30c373];return _0x2d0763;};'use strict';var schema=require(_0x5c53('0x0'));var _=require(_0x5c53('0x1'));var util=require('util');var seqqueue=require(_0x5c53('0x2'));var logger=require(_0x5c53('0x3'))(_0x5c53('0x4'));var strategy=require(_0x5c53('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x5c53('0x6')}});function writeLog(_0xa39c3b,_0x29e1ba,_0x52e0de){return logger[_0x5c53('0x7')](util[_0x5c53('0x8')](_0x5c53('0x9'),_0xa39c3b,_0x29e1ba[_0x5c53('0xa')],_0x52e0de));}function handleFindAgent(_0x2c602a){return function(_0x59bfb3){return _0x59bfb3[_0x5c53('0xa')]['toLowerCase']()===_0x2c602a[_0x5c53('0xb')]();};}exports[_0x5c53('0xc')]=function(_0xd39c1,_0x2c55d2,_0xde673d,_0x3468d0){return function(_0x1e14c2){try{var _0x446d95={'name':_0x2c55d2[0x0],'timeout':_0x2c55d2[0x1]};var _0x280ccd=queue['validate'](_0x446d95,{'typecast':!![]});if(_0x280ccd[_0x5c53('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0xd39c1,_[_0x5c53('0xe')](_0x280ccd,'message')[_0x5c53('0xf')](',\x20'));_0x1e14c2[_0x5c53('0x10')]();}else{var _0x161110=_[_0x5c53('0x11')](_0xde673d['agents'],handleFindAgent(_0x446d95[_0x5c53('0xa')]));if(_0x161110){var _0x1a0a4e=(_0x446d95[_0x5c53('0x12')]||0xa)*0x3e8;var _0x3315b0,_0x3b0a01;var _0x3f0cbc=seqqueue[_0x5c53('0x13')](_0x1a0a4e);_0x3f0cbc['id']=_0xd39c1;_0x3f0cbc[_0x5c53('0x14')]=_0x1a0a4e;_0x3f0cbc[_0x5c53('0x15')]=_0x3468d0[_0x5c53('0x15')];writeLog(_0xd39c1,_0x161110,util[_0x5c53('0x8')](_0x5c53('0x16'),_0x1a0a4e));_0xde673d[_0x5c53('0x17')][_0xd39c1]['on'](_0x5c53('0x18'),function(){logger[_0x5c53('0x7')](_0x5c53('0x19'),_0xd39c1);clearTimeout(_0x3b0a01);_0x3b0a01=undefined;_0x3f0cbc['close']();if(_0xde673d[_0x5c53('0x17')][_0xd39c1]){delete _0xde673d[_0x5c53('0x17')][_0xd39c1];}_0x1e14c2[_0x5c53('0x10')]();});_0xde673d[_0x5c53('0x17')][_0xd39c1]['on'](_0x5c53('0x1a'),function(){if(_0xde673d[_0x5c53('0x17')][_0xd39c1]){delete _0xde673d[_0x5c53('0x17')][_0xd39c1];}});_0x3b0a01=setTimeout(function(){logger[_0x5c53('0x7')](_0x5c53('0x1b'),_0xd39c1);clearTimeout(_0x3b0a01);_0x3f0cbc[_0x5c53('0x1c')]();_0x1e14c2[_0x5c53('0x1d')]();},_0x1a0a4e);strategy[_0x5c53('0x1e')](_0x3f0cbc,_0x161110,_0xde673d,_0x3468d0);}else{logger[_0x5c53('0x1f')](_0x5c53('0x20'),_0xd39c1,_0x446d95[_0x5c53('0xa')]);_0x1e14c2[_0x5c53('0x10')]();}}}catch(_0x5f4303){console[_0x5c53('0x21')](_0x5f4303);logger[_0x5c53('0x1f')](_0x5c53('0x22'),_0xd39c1,_0x5f4303[_0x5c53('0x23')]);_0x1e14c2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index d880450..75a48f0 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 _0x4975=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','amazonlex','Failed','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','account','upperFirst','AccountId','InteractionId','created','body','Message','create','then','[%s][AMAZONLEX]\x20%s','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x394dcf,_0x37546a){_0x394dcf=_0x394dcf-0x0;var _0x5406a8=_0x4975[_0x394dcf];return _0x5406a8;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var AWS=require(_0x5497('0x1'));var utils=require(_0x5497('0x2'));var logger=require(_0x5497('0x3'))(_0x5497('0x4'));var rpc={'chatMessage':require(_0x5497('0x5')),'openchannelMessage':require(_0x5497('0x6')),'mailMessage':require(_0x5497('0x7')),'smsMessage':require(_0x5497('0x8')),'faxMessage':require(_0x5497('0x9')),'whatsappMessage':require(_0x5497('0xa'))};exports['consequence']=function(_0x37e48d,_0x4f563d){return function(_0x1d0019){try{if(!_[_0x5497('0xb')](this[_0x5497('0xc')]['UserId'])){logger[_0x5497('0xd')]('[%s][AMAZONLEX]\x20%s',_0x37e48d,_0x5497('0xe'));return _0x1d0019[_0x5497('0xf')]();}var _0x2ec5a4={'ContactId':this[_0x5497('0x10')]['id'],'sentAt':moment()[_0x5497('0x11')](_0x5497('0x12')),'direction':_0x5497('0x13')};var _0x769e11=this['channel'];if(_0x769e11==='chat'){_0x2ec5a4['ChatWebsiteId']=this[_0x5497('0x14')]['id'];}else{_0x2ec5a4[_[_0x5497('0x15')](_0x769e11)+_0x5497('0x16')]=this[_0x5497('0x14')]['id'];}_0x2ec5a4[_[_0x5497('0x15')](_0x769e11)+_0x5497('0x17')]=this[_0x5497('0xc')]['id'];if(this[_0x5497('0xc')][_0x5497('0x18')]){var _0x1a4c74=_0x4f563d[0x4];if(!_['isEmpty'](_0x1a4c74)){_0x2ec5a4[_0x5497('0x19')]=utils['getMustacheRender'](_0x1a4c74,this);return rpc[_0x769e11+_0x5497('0x1a')][_0x5497('0x1b')](_0x2ec5a4)[_0x5497('0x1c')](function(_0x3ce50b){logger[_0x5497('0xd')](_0x5497('0x1d'),_0x37e48d,_0x2ec5a4[_0x5497('0x19')]);})['catch'](function(_0x56a788){logger[_0x5497('0x1e')](_0x5497('0x1d'),_0x37e48d,JSON[_0x5497('0x1f')](_0x56a788));})['finally'](function(){logger[_0x5497('0xd')](_0x5497('0x20'),_0x37e48d);_0x1d0019[_0x5497('0x21')]();});}else{logger[_0x5497('0xd')](_0x5497('0x22'),_0x37e48d);_0x1d0019[_0x5497('0x21')]();}}else{var _0x16d378=this;var _0x10226f=new AWS[(_0x5497('0x23'))]({'accessKeyId':_0x4f563d[0x0],'secretAccessKey':_0x4f563d[0x1],'region':_0x4f563d[0x2]});var _0x3f54ef={'botAlias':_0x5497('0x24'),'botName':_0x4f563d[0x3],'inputText':this['message'][_0x5497('0x19')],'userId':this['channel']+':'+this[_0x5497('0xc')]['id'][_0x5497('0x25')]()};_0x10226f[_0x5497('0x26')](_0x3f54ef,function(_0x2f587d,_0x35ecd9){if(_0x2f587d){logger[_0x5497('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x37e48d,_0x2f587d['message']);_0x1d0019[_0x5497('0xf')]();}else if(_0x35ecd9&&_0x35ecd9[_0x5497('0x27')]){_0x16d378[_0x5497('0x19')][_0x5497('0x28')]=_0x35ecd9;_0x2ec5a4['body']=_0x35ecd9[_0x5497('0x27')];return rpc[_0x769e11+'Message'][_0x5497('0x1b')](_0x2ec5a4)[_0x5497('0x1c')](function(_0x429d36){logger[_0x5497('0xd')](_0x5497('0x1d'),_0x37e48d,_0x2ec5a4[_0x5497('0x19')]);if(_0x35ecd9['dialogState']==_0x5497('0x29')){_0x1d0019['next']();}else{_0x1d0019['stop']();}})['catch'](function(_0x39a2b7){logger['error']('[%s][AMAZONLEX]\x20%s',_0x37e48d,JSON[_0x5497('0x1f')](_0x39a2b7));_0x1d0019[_0x5497('0xf')]();});}else{_0x1d0019[_0x5497('0xf')]();}});}}catch(_0x4c442a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x37e48d,JSON[_0x5497('0x1f')](_0x4c442a));_0x1d0019[_0x5497('0x21')]();}};}; \ No newline at end of file +var _0x1261=['error','amazonlex','Message','then','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','create','catch','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText'];(function(_0x101152,_0x397ab0){var _0xe1c465=function(_0x25de02){while(--_0x25de02){_0x101152['push'](_0x101152['shift']());}};_0xe1c465(++_0x397ab0);}(_0x1261,0x144));var _0x1126=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0x1261[_0x3e6647];return _0x46bddd;};'use strict';var _=require('lodash');var moment=require(_0x1126('0x0'));var AWS=require(_0x1126('0x1'));var utils=require(_0x1126('0x2'));var logger=require(_0x1126('0x3'))(_0x1126('0x4'));var rpc={'chatMessage':require(_0x1126('0x5')),'openchannelMessage':require(_0x1126('0x6')),'mailMessage':require(_0x1126('0x7')),'smsMessage':require(_0x1126('0x8')),'faxMessage':require(_0x1126('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x40ba58,_0x907180){return function(_0x4f239c){try{if(!_[_0x1126('0xa')](this[_0x1126('0xb')][_0x1126('0xc')])){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4f239c[_0x1126('0xf')]();}var _0x18dbe6={'ContactId':this[_0x1126('0x10')]['id'],'sentAt':moment()['format'](_0x1126('0x11')),'direction':'out'};var _0x52ef15=this[_0x1126('0x12')];if(_0x52ef15==='chat'){_0x18dbe6[_0x1126('0x13')]=this[_0x1126('0x14')]['id'];}else{_0x18dbe6[_[_0x1126('0x15')](_0x52ef15)+_0x1126('0x16')]=this[_0x1126('0x14')]['id'];}_0x18dbe6[_[_0x1126('0x15')](_0x52ef15)+_0x1126('0x17')]=this[_0x1126('0xb')]['id'];if(this[_0x1126('0xb')]['created']){var _0x5de9a7=_0x907180[0x4];if(!_[_0x1126('0x18')](_0x5de9a7)){_0x18dbe6[_0x1126('0x19')]=utils[_0x1126('0x1a')](_0x5de9a7,this);return rpc[_0x52ef15+'Message'][_0x1126('0x1b')](_0x18dbe6)['then'](function(_0x35fe9f){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,_0x18dbe6['body']);})[_0x1126('0x1c')](function(_0x1695f6){logger['error']('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x1695f6));})[_0x1126('0x1e')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x40ba58);_0x4f239c[_0x1126('0x1f')]();});}else{logger['info'](_0x1126('0x20'),_0x40ba58);_0x4f239c[_0x1126('0x1f')]();}}else{var _0x2f70ac=this;var _0x54400a=new AWS[(_0x1126('0x21'))]({'accessKeyId':_0x907180[0x0],'secretAccessKey':_0x907180[0x1],'region':_0x907180[0x2]});var _0x49d209={'botAlias':'$LATEST','botName':_0x907180[0x3],'inputText':this[_0x1126('0x22')][_0x1126('0x19')],'userId':this[_0x1126('0x12')]+':'+this[_0x1126('0xb')]['id']['toString']()};_0x54400a[_0x1126('0x23')](_0x49d209,function(_0x477e6a,_0x48a08d){if(_0x477e6a){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,_0x477e6a['message']);_0x4f239c['next']();}else if(_0x48a08d&&_0x48a08d[_0x1126('0x22')]){_0x2f70ac[_0x1126('0x19')][_0x1126('0x25')]=_0x48a08d;_0x18dbe6[_0x1126('0x19')]=_0x48a08d[_0x1126('0x22')];return rpc[_0x52ef15+_0x1126('0x26')][_0x1126('0x1b')](_0x18dbe6)[_0x1126('0x27')](function(_0x589725){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,_0x18dbe6[_0x1126('0x19')]);if(_0x48a08d['dialogState']=='Failed'){_0x4f239c[_0x1126('0xf')]();}else{_0x4f239c[_0x1126('0x1f')]();}})['catch'](function(_0x2fb797){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x2fb797));_0x4f239c['next']();});}else{_0x4f239c[_0x1126('0xf')]();}});}}catch(_0x4bd50b){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x4bd50b));_0x4f239c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 7e4a038..3dd29fd 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 _0xcfab=['../../rpc/whatsappMessage','../../mailRpc','consequence','created','interaction','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','mail','service','Smtp','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','next','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x14d76a,_0x38c683){var _0x5baef8=function(_0x4cb8ae){while(--_0x4cb8ae){_0x14d76a['push'](_0x14d76a['shift']());}};_0x5baef8(++_0x38c683);}(_0xcfab,0x12e));var _0xbcfa=function(_0x372a8e,_0x16a38d){_0x372a8e=_0x372a8e-0x0;var _0x39aa2d=_0xcfab[_0x372a8e];return _0x39aa2d;};'use strict';var _=require(_0xbcfa('0x0'));var moment=require('moment');var utils=require(_0xbcfa('0x1'));var logger=require(_0xbcfa('0x2'))(_0xbcfa('0x3'));var rpc={'chatMessage':require(_0xbcfa('0x4')),'openchannelMessage':require(_0xbcfa('0x5')),'mailMessage':require(_0xbcfa('0x6')),'smsMessage':require(_0xbcfa('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xbcfa('0x8'))};var mailRpc=require(_0xbcfa('0x9'));exports[_0xbcfa('0xa')]=function(_0x54edc,_0x46744a){return function(_0x207bf6){try{if(_0x46744a[0x0]==='1'&&(_['isNil'](this['interaction'][_0xbcfa('0xb')])||!this[_0xbcfa('0xc')][_0xbcfa('0xb')])){logger[_0xbcfa('0xd')](_0xbcfa('0xe'),_0x54edc,_0xbcfa('0xf'));return _0x207bf6['next']();}var _0x224353=this[_0xbcfa('0x10')];var _0x3fd8a9={'body':utils[_0xbcfa('0x11')](_0x46744a[0x1],this),'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xbcfa('0x12')),'direction':_0xbcfa('0x13')};if(this[_0xbcfa('0x14')]){_0x3fd8a9['to']=this[_0xbcfa('0x14')][_0xbcfa('0x15')]||'';_0x3fd8a9['cc']=this[_0xbcfa('0x14')]['cc']||'';_0x3fd8a9['from']=this[_0xbcfa('0x14')]['to']||'';_0x3fd8a9[_0xbcfa('0x16')]=this[_0xbcfa('0x14')][_0xbcfa('0x16')]||'';_0x3fd8a9[_0xbcfa('0x17')]=!![];if(this[_0xbcfa('0x14')]['subject']){_0x3fd8a9[_0xbcfa('0x18')]='';_0x3fd8a9[_0xbcfa('0x18')]+=_[_0xbcfa('0x19')](this[_0xbcfa('0x14')][_0xbcfa('0x18')],_0xbcfa('0x1a'))?'':_0xbcfa('0x1b');_0x3fd8a9[_0xbcfa('0x18')]+=this[_0xbcfa('0x14')][_0xbcfa('0x18')];}}if(this[_0xbcfa('0x10')]===_0xbcfa('0x1c')){_0x3fd8a9[_0xbcfa('0x1d')]=this[_0xbcfa('0x1e')]['id'];}else{_0x3fd8a9[_['upperFirst'](this[_0xbcfa('0x10')])+_0xbcfa('0x1f')]=this[_0xbcfa('0x1e')]['id'];}_0x3fd8a9[_[_0xbcfa('0x20')](this[_0xbcfa('0x10')])+_0xbcfa('0x21')]=this[_0xbcfa('0xc')]['id'];if(rpc[this[_0xbcfa('0x10')]+'Message']){if(this[_0xbcfa('0x10')]===_0xbcfa('0x22')){var _0x348f5a={'tls':{'rejectUnauthorized':![]}};if(this[_0xbcfa('0x1e')]['Smtp']['service']){_0x348f5a[_0xbcfa('0x23')]=this[_0xbcfa('0x1e')][_0xbcfa('0x24')][_0xbcfa('0x23')];}else{_0x348f5a[_0xbcfa('0x25')]=this['account'][_0xbcfa('0x24')]['host'];_0x348f5a[_0xbcfa('0x26')]=this['account'][_0xbcfa('0x24')][_0xbcfa('0x26')];_0x348f5a[_0xbcfa('0x27')]=this[_0xbcfa('0x1e')][_0xbcfa('0x24')][_0xbcfa('0x27')];}if(this[_0xbcfa('0x1e')][_0xbcfa('0x24')]['authentication']){_0x348f5a[_0xbcfa('0x28')]={'user':this['account'][_0xbcfa('0x24')][_0xbcfa('0x29')],'pass':this[_0xbcfa('0x1e')][_0xbcfa('0x24')][_0xbcfa('0x2a')]};}_0x3fd8a9[_0xbcfa('0x2b')]=this[_0xbcfa('0x14')][_0xbcfa('0x2c')];_0x3fd8a9[_0xbcfa('0x2d')]=_0xbcfa('0x2e')+_[_0xbcfa('0x2f')](_0x3fd8a9[_0xbcfa('0x30')],'','replace','body','';return mailRpc['sendMailMessage'](_0x59eb07,_0x1844de)['then'](function(_0x34f5b4){logger[_0x4eee('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x551154);_0x1844de['messageId']=_0x34f5b4[_0x4eee('0x17')][_0x4eee('0x30')];return rpc[_0x3a7139+'Message'][_0x4eee('0x37')](_0x1844de);})[_0x4eee('0x38')](function(_0x5651de){logger[_0x4eee('0x10')](_0x4eee('0x39'),_0x551154,JSON[_0x4eee('0x3a')](_0x5651de));})[_0x4eee('0x3b')](function(_0x2370dc){logger[_0x4eee('0x3c')](_0x4eee('0x3d'),_0x551154,JSON[_0x4eee('0x3a')](_0x2370dc));})[_0x4eee('0x3e')](function(){_0xa874ef[_0x4eee('0x11')]();});}else{return rpc[this[_0x4eee('0x12')]+'Message']['create'](_0x1844de)[_0x4eee('0x38')](function(_0x4dbca9){logger['info'](_0x4eee('0x39'),_0x551154,_0x1844de[_0x4eee('0x34')]);})[_0x4eee('0x3b')](function(_0x3c8a80){logger['error'](_0x4eee('0x39'),_0x551154,JSON[_0x4eee('0x3a')](_0x3c8a80));})['finally'](function(){_0xa874ef[_0x4eee('0x11')]();});}}}catch(_0xde236d){logger['error'](_0x4eee('0x39'),_0x551154,JSON[_0x4eee('0x3a')](_0xde236d));_0xa874ef[_0x4eee('0x3f')]();}};}; \ 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 9808e7e..45ce2f5 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 _0x9536=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x9536,0x179));var _0x6953=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x9536[_0x1e03a6];return _0x295b64;};'use strict';var moment=require(_0x6953('0x0'));var logger=require(_0x6953('0x1'))(_0x6953('0x2'));var rpc={'chatInteraction':require(_0x6953('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6953('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x6953('0x5')),'whatsappInteraction':require(_0x6953('0x6'))};exports[_0x6953('0x7')]=function(_0x3ba964,_0x2f3cc3,_0x494ac2,_0x2b273e){return function(_0x2bb026){try{logger[_0x6953('0x8')](_0x6953('0x9'),_0x3ba964,_0x2f3cc3[0x0]);var _0x1c8225={'closed':0x1,'closedAt':moment()['format'](_0x6953('0xa')),'closeReason':_0x6953('0xb'),'disposition':_0x2f3cc3[0x0]};if(rpc[_0x2b273e[_0x6953('0xc')]+'Interaction']){rpc[_0x2b273e[_0x6953('0xc')]+_0x6953('0xd')][_0x6953('0xe')](_0x2b273e[_0x6953('0xf')]['id'],_0x1c8225)[_0x6953('0x10')](function(_0x1f3062){logger[_0x6953('0x8')](_0x6953('0x11'),_0x3ba964,_0x2b273e[_0x6953('0xf')]['id']);})['catch'](function(_0x358388){logger['error'](_0x6953('0x12'),_0x3ba964,JSON[_0x6953('0x13')](_0x358388));})[_0x6953('0x14')](function(){_0x2bb026[_0x6953('0x15')]();});}}catch(_0x1b5221){logger[_0x6953('0x16')](_0x6953('0x12'),_0x3ba964,JSON[_0x6953('0x13')](_0x1b5221));_0x2bb026[_0x6953('0x15')]();}};}; \ No newline at end of file +var _0x8b52=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','system','channel','Interaction','interaction','then','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x4f457c,_0x15cdeb){var _0x3046a0=function(_0x314c65){while(--_0x314c65){_0x4f457c['push'](_0x4f457c['shift']());}};_0x3046a0(++_0x15cdeb);}(_0x8b52,0x151));var _0x28b5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b52[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x28b5('0x0'));var logger=require(_0x28b5('0x1'))(_0x28b5('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x28b5('0x3')),'smsInteraction':require(_0x28b5('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x28b5('0x5')),'whatsappInteraction':require(_0x28b5('0x6'))};exports[_0x28b5('0x7')]=function(_0x226981,_0x2f9c42,_0x17c21a,_0x42573d){return function(_0xca79de){try{logger[_0x28b5('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x226981,_0x2f9c42[0x0]);var _0x1fc3a0={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x28b5('0x9'),'disposition':_0x2f9c42[0x0]};if(rpc[_0x42573d[_0x28b5('0xa')]+'Interaction']){rpc[_0x42573d[_0x28b5('0xa')]+_0x28b5('0xb')]['update'](_0x42573d[_0x28b5('0xc')]['id'],_0x1fc3a0)[_0x28b5('0xd')](function(_0x3e6ef){logger[_0x28b5('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x226981,_0x42573d[_0x28b5('0xc')]['id']);})['catch'](function(_0xc18108){logger[_0x28b5('0xe')]('[%s][CLOSE]\x20%s',_0x226981,JSON[_0x28b5('0xf')](_0xc18108));})['finally'](function(){_0xca79de[_0x28b5('0x10')]();});}}catch(_0x4a684e){logger['error'](_0x28b5('0x11'),_0x226981,JSON[_0x28b5('0xf')](_0x4a684e));_0xca79de['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 1abefee..680791f 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 _0xdb41=['metadata','endConversation','stringify','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','body','Message','then','catch','error','[%s][DIALOGFLOW]\x20%s','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','speech','create'];(function(_0x2ba44d,_0x2d5b06){var _0x40b306=function(_0x47be27){while(--_0x47be27){_0x2ba44d['push'](_0x2ba44d['shift']());}};_0x40b306(++_0x2d5b06);}(_0xdb41,0x7e));var _0x1db4=function(_0x1630f1,_0x2eba83){_0x1630f1=_0x1630f1-0x0;var _0x1531e6=_0xdb41[_0x1630f1];return _0x1531e6;};'use strict';var _=require('lodash');var moment=require(_0x1db4('0x0'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require('./utils');var logger=require(_0x1db4('0x1'))(_0x1db4('0x2'));var rpc={'chatMessage':require(_0x1db4('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1db4('0x4')),'smsMessage':require(_0x1db4('0x5')),'faxMessage':require(_0x1db4('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xc2ab76,_0x2d8e4a){return function(_0xc994bd){try{if(!_[_0x1db4('0x7')](this[_0x1db4('0x8')][_0x1db4('0x9')])){logger[_0x1db4('0xa')]('[%s][DIALOGFLOW]\x20%s',_0xc2ab76,_0x1db4('0xb'));return _0xc994bd[_0x1db4('0xc')]();}var _0x78e3e5={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1db4('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1db4('0xe')};var _0x2e8bf1=this[_0x1db4('0xf')];if(_0x2e8bf1===_0x1db4('0x10')){_0x78e3e5[_0x1db4('0x11')]=this[_0x1db4('0x12')]['id'];}else{_0x78e3e5[_['upperFirst'](_0x2e8bf1)+_0x1db4('0x13')]=this['account']['id'];}_0x78e3e5[_[_0x1db4('0x14')](_0x2e8bf1)+_0x1db4('0x15')]=this[_0x1db4('0x8')]['id'];if(this['interaction'][_0x1db4('0x16')]){var _0x21853f=_0x2d8e4a[0x2];if(!_['isEmpty'](_0x21853f)){_0x78e3e5[_0x1db4('0x17')]=utils['getMustacheRender'](_0x21853f,this);return rpc[_0x2e8bf1+_0x1db4('0x18')]['create'](_0x78e3e5)[_0x1db4('0x19')](function(_0x1b9106){logger[_0x1db4('0xa')]('[%s][DIALOGFLOW]\x20%s',_0xc2ab76,_0x78e3e5[_0x1db4('0x17')]);})[_0x1db4('0x1a')](function(_0x46376f){logger[_0x1db4('0x1b')](_0x1db4('0x1c'),_0xc2ab76,JSON['stringify'](_0x46376f));})[_0x1db4('0x1d')](function(){logger[_0x1db4('0xa')](_0x1db4('0x1e'),_0xc2ab76);_0xc994bd['stop']();});}else{logger[_0x1db4('0xa')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xc2ab76);_0xc994bd[_0x1db4('0x1f')]();}}else{var _0x150e3b=this;var _0x548b29=apiai(_0x2d8e4a[0x0],{'language':_0x2d8e4a[0x1]||'en'});return _0x548b29[_0x1db4('0x20')](this[_0x1db4('0x21')][_0x1db4('0x17')],{'sessionId':md5(this['interaction']['id'])})[_0x1db4('0x19')](function(_0x447827){_0x150e3b['body'][_0x1db4('0x22')]=_0x447827;_0x78e3e5[_0x1db4('0x17')]=_0x447827[_0x1db4('0x23')]['fulfillment'][_0x1db4('0x24')];return rpc[_0x2e8bf1+_0x1db4('0x18')][_0x1db4('0x25')](_0x78e3e5)[_0x1db4('0x19')](function(_0x510862){logger['info']('[%s][DIALOGFLOW]\x20%s',_0xc2ab76,_0x78e3e5[_0x1db4('0x17')]);if(_0x447827[_0x1db4('0x23')][_0x1db4('0x26')][_0x1db4('0x27')]){_0xc994bd[_0x1db4('0xc')]();}else{_0xc994bd[_0x1db4('0x1f')]();}})[_0x1db4('0x1a')](function(_0x4e3fa5){logger[_0x1db4('0x1b')](_0x1db4('0x1c'),_0xc2ab76,JSON[_0x1db4('0x28')](_0x4e3fa5));_0xc994bd[_0x1db4('0xc')]();});})[_0x1db4('0x1a')](function(_0x4ac6b){logger[_0x1db4('0x1b')](_0x1db4('0x1c'),_0xc2ab76,_0x4ac6b[_0x1db4('0x21')]);_0xc994bd[_0x1db4('0xc')]();});}}catch(_0x3e5560){logger['error'](_0x1db4('0x1c'),_0xc2ab76,JSON['stringify'](_0x3e5560));_0xc994bd['stop']();}};}; \ No newline at end of file +var _0xb15d=['finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','chat','upperFirst','AccountId','account','InteractionId','interaction','created','body','Message','then','catch','error','stringify'];(function(_0x54fcca,_0x440202){var _0x152ece=function(_0x1480a){while(--_0x1480a){_0x54fcca['push'](_0x54fcca['shift']());}};_0x152ece(++_0x440202);}(_0xb15d,0x1a2));var _0xdb15=function(_0x42c967,_0x3d0a7c){_0x42c967=_0x42c967-0x0;var _0x150a97=_0xb15d[_0x42c967];return _0x150a97;};'use strict';var _=require(_0xdb15('0x0'));var moment=require(_0xdb15('0x1'));var apiai=require(_0xdb15('0x2'));var md5=require(_0xdb15('0x3'));var utils=require(_0xdb15('0x4'));var logger=require(_0xdb15('0x5'))(_0xdb15('0x6'));var rpc={'chatMessage':require(_0xdb15('0x7')),'openchannelMessage':require(_0xdb15('0x8')),'mailMessage':require(_0xdb15('0x9')),'smsMessage':require(_0xdb15('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdb15('0xb')]=function(_0x4ba61f,_0x329a50){return function(_0x1f687e){try{if(!_[_0xdb15('0xc')](this['interaction'][_0xdb15('0xd')])){logger[_0xdb15('0xe')](_0xdb15('0xf'),_0x4ba61f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1f687e[_0xdb15('0x10')]();}var _0x10705d={'ContactId':this[_0xdb15('0x11')]['id'],'sentAt':moment()[_0xdb15('0x12')](_0xdb15('0x13')),'direction':'out'};var _0x3346ed=this['channel'];if(_0x3346ed===_0xdb15('0x14')){_0x10705d['ChatWebsiteId']=this['account']['id'];}else{_0x10705d[_[_0xdb15('0x15')](_0x3346ed)+_0xdb15('0x16')]=this[_0xdb15('0x17')]['id'];}_0x10705d[_[_0xdb15('0x15')](_0x3346ed)+_0xdb15('0x18')]=this[_0xdb15('0x19')]['id'];if(this[_0xdb15('0x19')][_0xdb15('0x1a')]){var _0x2c37a8=_0x329a50[0x2];if(!_['isEmpty'](_0x2c37a8)){_0x10705d[_0xdb15('0x1b')]=utils['getMustacheRender'](_0x2c37a8,this);return rpc[_0x3346ed+_0xdb15('0x1c')]['create'](_0x10705d)[_0xdb15('0x1d')](function(_0x1a52d4){logger[_0xdb15('0xe')](_0xdb15('0xf'),_0x4ba61f,_0x10705d[_0xdb15('0x1b')]);})[_0xdb15('0x1e')](function(_0x2be951){logger[_0xdb15('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x4ba61f,JSON[_0xdb15('0x20')](_0x2be951));})[_0xdb15('0x21')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4ba61f);_0x1f687e[_0xdb15('0x22')]();});}else{logger['info'](_0xdb15('0x23'),_0x4ba61f);_0x1f687e[_0xdb15('0x22')]();}}else{var _0x326aa9=this;var _0x24626c=apiai(_0x329a50[0x0],{'language':_0x329a50[0x1]||'en'});return _0x24626c[_0xdb15('0x24')](this[_0xdb15('0x25')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0xdb15('0x1d')](function(_0x4f837e){_0x326aa9['body'][_0xdb15('0x26')]=_0x4f837e;_0x10705d[_0xdb15('0x1b')]=_0x4f837e['result'][_0xdb15('0x27')]['speech'];return rpc[_0x3346ed+'Message']['create'](_0x10705d)[_0xdb15('0x1d')](function(_0x1df16a){logger[_0xdb15('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4ba61f,_0x10705d[_0xdb15('0x1b')]);if(_0x4f837e['result']['metadata'][_0xdb15('0x28')]){_0x1f687e['next']();}else{_0x1f687e['stop']();}})[_0xdb15('0x1e')](function(_0x4f4e2b){logger[_0xdb15('0x1f')](_0xdb15('0xf'),_0x4ba61f,JSON[_0xdb15('0x20')](_0x4f4e2b));_0x1f687e[_0xdb15('0x10')]();});})[_0xdb15('0x1e')](function(_0x4c29d2){logger[_0xdb15('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x4ba61f,_0x4c29d2[_0xdb15('0x25')]);_0x1f687e[_0xdb15('0x10')]();});}}catch(_0x4f14b2){logger['error'](_0xdb15('0xf'),_0x4ba61f,JSON[_0xdb15('0x20')](_0x4f14b2));_0x1f687e[_0xdb15('0x22')]();}};}; \ 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 3d89a4d..d58f83a 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 _0x4559=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','error','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','length','map','message','join','stop','condition','priorityTrue','next','findIndex','rules','info'];(function(_0x244439,_0x3dcf7d){var _0x5da463=function(_0x5c20c9){while(--_0x5c20c9){_0x244439['push'](_0x244439['shift']());}};_0x5da463(++_0x3dcf7d);}(_0x4559,0x13d));var _0x9455=function(_0x35e6db,_0x53779d){_0x35e6db=_0x35e6db-0x0;var _0x249409=_0x4559[_0x35e6db];return _0x249409;};'use strict';var schema=require(_0x9455('0x0'));var _=require(_0x9455('0x1'));var htmlToText=require(_0x9455('0x2'));var utils=require('./utils');var logger=require(_0x9455('0x3'))(_0x9455('0x4'));var gotoif=schema({'condition':{'type':_0x9455('0x5'),'required':!![],'message':_0x9455('0x6')},'priorityTrue':{'type':_0x9455('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x9455('0x7'),'message':_0x9455('0x8')}});exports['consequence']=function(_0x36131b,_0x53c1cf){return function(_0x4d6abb){try{var _0x50bae6={'condition':htmlToText[_0x9455('0x9')](utils['getMustacheRender'](_0x53c1cf[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x53c1cf[0x1],'priorityFalse':_0x53c1cf[0x2]};var _0x213271=gotoif['validate'](_0x50bae6,{'typecast':!![]});if(_0x213271[_0x9455('0xa')]){logger['error']('[%s][GOTOIF]\x20%s',_0x36131b,_[_0x9455('0xb')](_0x213271,_0x9455('0xc'))[_0x9455('0xd')](',\x20'));_0x4d6abb[_0x9455('0xe')]();}else{try{var _0x11a262=eval('('+_0x50bae6[_0x9455('0xf')]+')');var _0x5d2ba0=_0x11a262?_0x50bae6[_0x9455('0x10')]:_0x50bae6['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x36131b,_0x50bae6[_0x9455('0xf')],_0x11a262,_0x5d2ba0||_0x9455('0x11'));if(_0x5d2ba0){var _0x3290c5=_[_0x9455('0x12')](_0x4d6abb[_0x9455('0x13')](),{'p':_0x5d2ba0});if(_0x3290c5>=0x0){logger[_0x9455('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x36131b,_0x5d2ba0||_0x9455('0x11'),_0x3290c5);_0x4d6abb[_0x9455('0x11')](_0x3290c5);}else{logger[_0x9455('0x14')](_0x9455('0x15'),_0x36131b,_0x5d2ba0||_0x9455('0x11'));_0x4d6abb[_0x9455('0xe')]();}}else{_0x4d6abb[_0x9455('0x11')]();}}catch(_0x498961){logger['error'](_0x9455('0x16'),_0x36131b,_0x498961['message']);_0x4d6abb['stop']();}}}catch(_0x3f21c0){logger[_0x9455('0x17')](_0x9455('0x18'),_0x36131b,JSON[_0x9455('0x19')](_0x3f21c0));_0x4d6abb[_0x9455('0xe')]();}};}; \ No newline at end of file +var _0x5675=['consequence','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','info','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','lodash','html-to-text','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number'];(function(_0x2d851a,_0x4c581f){var _0x50fccc=function(_0x789f6f){while(--_0x789f6f){_0x2d851a['push'](_0x2d851a['shift']());}};_0x50fccc(++_0x4c581f);}(_0x5675,0xe9));var _0x5567=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x5675[_0x15bc81];return _0x59440e;};'use strict';var schema=require('validate');var _=require(_0x5567('0x0'));var htmlToText=require(_0x5567('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x5567('0x2'),'required':!![],'message':_0x5567('0x3')},'priorityTrue':{'type':_0x5567('0x4'),'message':_0x5567('0x5')},'priorityFalse':{'type':_0x5567('0x4'),'message':_0x5567('0x6')}});exports[_0x5567('0x7')]=function(_0x81fbbc,_0x24e7e7){return function(_0x3f9cb3){try{var _0x354b33={'condition':htmlToText[_0x5567('0x8')](utils[_0x5567('0x9')](_0x24e7e7[0x0],this),{'wordwrap':![]})[_0x5567('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x24e7e7[0x1],'priorityFalse':_0x24e7e7[0x2]};var _0x490971=gotoif[_0x5567('0xb')](_0x354b33,{'typecast':!![]});if(_0x490971[_0x5567('0xc')]){logger[_0x5567('0xd')](_0x5567('0xe'),_0x81fbbc,_[_0x5567('0xf')](_0x490971,'message')[_0x5567('0x10')](',\x20'));_0x3f9cb3[_0x5567('0x11')]();}else{try{var _0x1a118a=eval('('+_0x354b33['condition']+')');var _0x1aef49=_0x1a118a?_0x354b33[_0x5567('0x12')]:_0x354b33[_0x5567('0x13')];logger[_0x5567('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x81fbbc,_0x354b33[_0x5567('0x15')],_0x1a118a,_0x1aef49||_0x5567('0x16'));if(_0x1aef49){var _0x2083f9=_[_0x5567('0x17')](_0x3f9cb3[_0x5567('0x18')](),{'p':_0x1aef49});if(_0x2083f9>=0x0){logger['info'](_0x5567('0x19'),_0x81fbbc,_0x1aef49||_0x5567('0x16'),_0x2083f9);_0x3f9cb3[_0x5567('0x16')](_0x2083f9);}else{logger[_0x5567('0x14')](_0x5567('0x1a'),_0x81fbbc,_0x1aef49||'next');_0x3f9cb3[_0x5567('0x11')]();}}else{_0x3f9cb3[_0x5567('0x16')]();}}catch(_0x53a963){logger[_0x5567('0xd')](_0x5567('0x1b'),_0x81fbbc,_0x53a963[_0x5567('0x1c')]);_0x3f9cb3[_0x5567('0x11')]();}}}catch(_0x589285){logger[_0x5567('0xd')](_0x5567('0xe'),_0x81fbbc,JSON[_0x5567('0x1d')](_0x589285));_0x3f9cb3[_0x5567('0x11')]();}};}; \ 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 0686a74..68e9518 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 _0x942f=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x942f,0x10c));var _0xf942=function(_0xf878f4,_0x4bce12){_0xf878f4=_0xf878f4-0x0;var _0x3703bb=_0x942f[_0xf878f4];return _0x3703bb;};'use strict';var schema=require(_0xf942('0x0'));var _=require(_0xf942('0x1'));var logger=require(_0xf942('0x2'))(_0xf942('0x3'));var gotop=schema({'priority':{'type':_0xf942('0x4'),'required':!![],'message':_0xf942('0x5')}});exports['consequence']=function(_0x3f857c,_0x31be85){return function(_0x40b841){try{var _0x43927d={'priority':_0x31be85[0x0]};var _0x5e0591=gotop[_0xf942('0x0')](_0x43927d,{'typecast':!![]});if(_0x5e0591[_0xf942('0x6')]){logger[_0xf942('0x7')]('[%s][GOTOP]\x20%s',_0x3f857c,_['map'](_0x5e0591,_0xf942('0x8'))[_0xf942('0x9')](',\x20'));_0x40b841[_0xf942('0xa')]();}else{logger['info'](_0xf942('0xb'),_0x3f857c,_0x43927d[_0xf942('0xc')]);if(_0x43927d['priority']){var _0x5ecdda=_['findIndex'](_0x40b841[_0xf942('0xd')](),{'p':_0x43927d[_0xf942('0xc')]});if(_0x5ecdda>=0x0){logger[_0xf942('0xe')](_0xf942('0xf'),_0x3f857c,_0x43927d[_0xf942('0xc')]||_0xf942('0x10'),_0x5ecdda);_0x40b841['next'](_0x5ecdda);}else{logger[_0xf942('0xe')](_0xf942('0x11'),_0x3f857c,_0x43927d[_0xf942('0xc')]||_0xf942('0x10'));_0x40b841[_0xf942('0xa')]();}}else{_0x40b841[_0xf942('0x10')]();}}}catch(_0x4d683b){logger[_0xf942('0x7')]('[%s][GOTOP]\x20%s',_0x3f857c,JSON[_0xf942('0x12')](_0x4d683b));_0x40b841['stop']();}};}; \ No newline at end of file +var _0x2493=['lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2493,0x1cb));var _0x3249=function(_0x528851,_0x2ef14a){_0x528851=_0x528851-0x0;var _0x1fac65=_0x2493[_0x528851];return _0x1fac65;};'use strict';var schema=require(_0x3249('0x0'));var _=require(_0x3249('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x3249('0x2'),'required':!![],'message':_0x3249('0x3')}});exports[_0x3249('0x4')]=function(_0x484fc8,_0x1b1962){return function(_0x20dce1){try{var _0x2a97a2={'priority':_0x1b1962[0x0]};var _0x593fcb=gotop[_0x3249('0x0')](_0x2a97a2,{'typecast':!![]});if(_0x593fcb[_0x3249('0x5')]){logger[_0x3249('0x6')](_0x3249('0x7'),_0x484fc8,_[_0x3249('0x8')](_0x593fcb,_0x3249('0x9'))[_0x3249('0xa')](',\x20'));_0x20dce1[_0x3249('0xb')]();}else{logger[_0x3249('0xc')](_0x3249('0xd'),_0x484fc8,_0x2a97a2['priority']);if(_0x2a97a2[_0x3249('0xe')]){var _0x42571c=_[_0x3249('0xf')](_0x20dce1[_0x3249('0x10')](),{'p':_0x2a97a2[_0x3249('0xe')]});if(_0x42571c>=0x0){logger[_0x3249('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x484fc8,_0x2a97a2['priority']||_0x3249('0x11'),_0x42571c);_0x20dce1['next'](_0x42571c);}else{logger[_0x3249('0xc')](_0x3249('0x12'),_0x484fc8,_0x2a97a2[_0x3249('0xe')]||_0x3249('0x11'));_0x20dce1['stop']();}}else{_0x20dce1['next']();}}}catch(_0x32c8dc){logger[_0x3249('0x6')](_0x3249('0x7'),_0x484fc8,JSON[_0x3249('0x13')](_0x32c8dc));_0x20dce1[_0x3249('0xb')]();}};}; \ 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 1c1f727..eadcb33 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 _0x2f71=['Message','then','info','next','catch','stringify','stop','error','[%s][MESSAGE]\x20%s','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','channel','AccountId','account','InteractionId','interaction'];(function(_0x5caaa0,_0x393cc3){var _0x46b273=function(_0x4056ce){while(--_0x4056ce){_0x5caaa0['push'](_0x5caaa0['shift']());}};_0x46b273(++_0x393cc3);}(_0x2f71,0x8b));var _0x12f7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2f71[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var utils=require(_0x12f7('0x0'));var logger=require(_0x12f7('0x1'))('routing');var rpc={'chatMessage':require(_0x12f7('0x2')),'openchannelMessage':require(_0x12f7('0x3')),'mailMessage':require(_0x12f7('0x4')),'smsMessage':require(_0x12f7('0x5')),'faxMessage':require(_0x12f7('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x12f7('0x7')]=function(_0x5b977a,_0x671aab){return function(_0x2fdfbb){try{var _0x344bde={'body':utils[_0x12f7('0x8')](_0x671aab[0x0],this),'ContactId':this[_0x12f7('0x9')]['id']};if(this['channel']===_0x12f7('0xa')){_0x344bde[_0x12f7('0xb')]=this['account']['id'];}else{_0x344bde[_['upperFirst'](this[_0x12f7('0xc')])+_0x12f7('0xd')]=this[_0x12f7('0xe')]['id'];}_0x344bde[_['upperFirst'](this['channel'])+_0x12f7('0xf')]=this[_0x12f7('0x10')]['id'];if(rpc[this['channel']+_0x12f7('0x11')]){return rpc[this['channel']+_0x12f7('0x11')]['create'](_0x344bde)[_0x12f7('0x12')](function(_0x5d5289){logger[_0x12f7('0x13')]('[%s][MESSAGE]\x20%s',_0x5b977a,_0x344bde['body']);_0x2fdfbb[_0x12f7('0x14')]();})[_0x12f7('0x15')](function(_0x5ebe01){logger['error']('[%s][MESSAGE]\x20%s',_0x5b977a,JSON[_0x12f7('0x16')](_0x5ebe01));_0x2fdfbb[_0x12f7('0x17')]();});}}catch(_0x5f12a1){logger[_0x12f7('0x18')](_0x12f7('0x19'),_0x5b977a,JSON['stringify'](_0x5f12a1));_0x2fdfbb[_0x12f7('0x17')]();}};}; \ No newline at end of file +var _0x9b93=['../../rpc/whatsappMessage','getMustacheRender','channel','chat','account','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage'];(function(_0x56a020,_0x3065c6){var _0xc4220c=function(_0x2c15d6){while(--_0x2c15d6){_0x56a020['push'](_0x56a020['shift']());}};_0xc4220c(++_0x3065c6);}(_0x9b93,0xfd));var _0x39b9=function(_0xc694ff,_0x1498ad){_0xc694ff=_0xc694ff-0x0;var _0x59dba2=_0x9b93[_0xc694ff];return _0x59dba2;};'use strict';var _=require(_0x39b9('0x0'));var utils=require(_0x39b9('0x1'));var logger=require(_0x39b9('0x2'))('routing');var rpc={'chatMessage':require(_0x39b9('0x3')),'openchannelMessage':require(_0x39b9('0x4')),'mailMessage':require(_0x39b9('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x39b9('0x6')),'whatsappMessage':require(_0x39b9('0x7'))};exports['consequence']=function(_0xc460f7,_0x541aed){return function(_0x9b1724){try{var _0x57001e={'body':utils[_0x39b9('0x8')](_0x541aed[0x0],this),'ContactId':this['contact']['id']};if(this[_0x39b9('0x9')]===_0x39b9('0xa')){_0x57001e['ChatWebsiteId']=this[_0x39b9('0xb')]['id'];}else{_0x57001e[_['upperFirst'](this[_0x39b9('0x9')])+_0x39b9('0xc')]=this[_0x39b9('0xb')]['id'];}_0x57001e[_['upperFirst'](this['channel'])+_0x39b9('0xd')]=this[_0x39b9('0xe')]['id'];if(rpc[this[_0x39b9('0x9')]+_0x39b9('0xf')]){return rpc[this[_0x39b9('0x9')]+_0x39b9('0xf')][_0x39b9('0x10')](_0x57001e)[_0x39b9('0x11')](function(_0x430441){logger[_0x39b9('0x12')](_0x39b9('0x13'),_0xc460f7,_0x57001e[_0x39b9('0x14')]);_0x9b1724[_0x39b9('0x15')]();})[_0x39b9('0x16')](function(_0x233524){logger[_0x39b9('0x17')](_0x39b9('0x13'),_0xc460f7,JSON[_0x39b9('0x18')](_0x233524));_0x9b1724[_0x39b9('0x19')]();});}}catch(_0xa949f6){logger[_0x39b9('0x17')]('[%s][MESSAGE]\x20%s',_0xc460f7,JSON[_0x39b9('0x18')](_0xa949f6));_0x9b1724[_0x39b9('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 2303d9a..1692586 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 _0xa1f0=['info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','../../../../config/logger','consequence'];(function(_0x5065a8,_0x5d2a33){var _0x34d49b=function(_0x490015){while(--_0x490015){_0x5065a8['push'](_0x5065a8['shift']());}};_0x34d49b(++_0x5d2a33);}(_0xa1f0,0x7e));var _0x0a1f=function(_0x10271c,_0x55778c){_0x10271c=_0x10271c-0x0;var _0x3b9803=_0xa1f0[_0x10271c];return _0x3b9803;};'use strict';var utils=require('./utils');var logger=require(_0x0a1f('0x0'))('routing');exports[_0x0a1f('0x1')]=function(_0x274af3,_0x21e48c){return function(_0x240e4e){try{logger[_0x0a1f('0x2')](_0x0a1f('0x3'),_0x274af3,utils[_0x0a1f('0x4')](_0x21e48c[0x0],this));_0x240e4e[_0x0a1f('0x5')]();}catch(_0x5161e0){logger[_0x0a1f('0x6')]('[%s][NOOP]\x20%s',_0x274af3,JSON[_0x0a1f('0x7')](_0x5161e0));_0x240e4e['stop']();}};}; \ No newline at end of file +var _0x41dd=['getMustacheRender','next','error','stringify','stop','./utils','routing','info','[%s][NOOP]\x20%s'];(function(_0x118355,_0x201311){var _0x32f7ea=function(_0x4fd55b){while(--_0x4fd55b){_0x118355['push'](_0x118355['shift']());}};_0x32f7ea(++_0x201311);}(_0x41dd,0x11c));var _0xd41d=function(_0x1d0e52,_0x369837){_0x1d0e52=_0x1d0e52-0x0;var _0x4c5800=_0x41dd[_0x1d0e52];return _0x4c5800;};'use strict';var utils=require(_0xd41d('0x0'));var logger=require('../../../../config/logger')(_0xd41d('0x1'));exports['consequence']=function(_0x52200e,_0x3baec2){return function(_0x24b0c8){try{logger[_0xd41d('0x2')](_0xd41d('0x3'),_0x52200e,utils[_0xd41d('0x4')](_0x3baec2[0x0],this));_0x24b0c8[_0xd41d('0x5')]();}catch(_0x49af7f){logger[_0xd41d('0x6')](_0xd41d('0x3'),_0x52200e,JSON[_0xd41d('0x7')](_0x49af7f));_0x24b0c8[_0xd41d('0x8')]();}};}; \ 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 8275986..b392052 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 _0xedd9=['[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','close','rules','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','account','queue','from','joinAt','emit','clone','queue_id','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','chat','AccountId','info','name','message','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted'];(function(_0x57aa2f,_0x397f18){var _0x27ddca=function(_0x2b9c2a){while(--_0x2b9c2a){_0x57aa2f['push'](_0x57aa2f['shift']());}};_0x27ddca(++_0x397f18);}(_0xedd9,0xfc));var _0x9edd=function(_0x52d098,_0x4e2b52){_0x52d098=_0x52d098-0x0;var _0x2f0b4e=_0xedd9[_0x52d098];return _0x2f0b4e;};'use strict';var schema=require('validate');var _=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var seqqueue=require(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var config=require(_0x9edd('0x5'));var logger=require(_0x9edd('0x6'))(_0x9edd('0x7'));var strategy=require('./strategy');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));var attributes=['id','queue_id',_0x9edd('0xb'),_0x9edd('0xc'),_0x9edd('0xd'),_0x9edd('0xe')];function emit(_0x49d5e3,_0x494a24,_0x5d2f90){io['to'](_0x49d5e3)[_0x9edd('0xf')](_0x494a24,_0x5d2f90);}function emitChannelQueueInteraction(_0x138767,_0x523026,_0xbf9da6,_0x13dc4f,_0x5b6c00,_0x30c0d7,_0x1b73d1,_0x25e64c){var _0xfd544a=_[_0x9edd('0x10')](_0xbf9da6);_0xfd544a[_0x9edd('0x11')]=_0x25e64c;_0xfd544a[_0x9edd('0xc')]=_0x523026;_0xfd544a[_0x9edd('0xb')]=_0x13dc4f;_0xfd544a['id']=_0x5b6c00;if(_0x30c0d7){_0x1b73d1[util['format'](_0x9edd('0x12'),_0x138767)][_0x5b6c00]=_[_0x9edd('0x13')](_0xfd544a,attributes);}else{delete _0x1b73d1[util[_0x9edd('0x14')](_0x9edd('0x12'),_0x138767)][_0x5b6c00];}emit(util[_0x9edd('0x14')](_0x9edd('0x15'),_0x138767,_0x523026),util[_0x9edd('0x14')](_0x9edd('0x16'),_0x138767,_0x30c0d7?'save':_0x9edd('0x17')),_[_0x9edd('0x13')](_0xfd544a,attributes));}var rpc={'openchannelQueueReport':require(_0x9edd('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x9edd('0x19')),'smsQueueReport':require(_0x9edd('0x1a')),'faxQueueReport':require(_0x9edd('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x9edd('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9edd('0x1d'),'message':_0x9edd('0x1e')}});function startRouting(_0x4bdb88,_0x498977,_0x45c3ab,_0x50338f){if(_0x4bdb88&&_0x498977&&_0x45c3ab){_0x498977[_0x9edd('0x1f')]+=0x1;var _0x54a03f={'uniqueid':_0x4bdb88,'from':_0x45c3ab['body']?_0x45c3ab[_0x9edd('0x20')][_0x9edd('0xd')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45c3ab[_0x9edd('0x21')]?_0x45c3ab[_0x9edd('0x21')]['id']:null,'ListId':_0x45c3ab[_0x9edd('0x22')]?_0x45c3ab['list']['id']:null};_0x54a03f[_[_0x9edd('0x23')](_0x45c3ab[_0x9edd('0x24')])+_0x9edd('0x25')]=_0x498977['id']||null;_0x54a03f[_[_0x9edd('0x23')](_0x45c3ab[_0x9edd('0x24')])+'InteractionId']=_0x45c3ab[_0x9edd('0x26')]?_0x45c3ab[_0x9edd('0x26')]['id']:null;_0x54a03f[_[_0x9edd('0x23')](_0x45c3ab[_0x9edd('0x24')])+_0x9edd('0x27')]=_0x45c3ab['message']?_0x45c3ab['message']['id']:null;_0x54a03f[_[_0x9edd('0x23')](_0x45c3ab[_0x9edd('0x24')])+(_0x45c3ab[_0x9edd('0x24')]!==_0x9edd('0x28')?_0x9edd('0x29'):'WebsiteId')]=_0x45c3ab['account']?_0x45c3ab[_0x9edd('0xb')]['id']:null;logger[_0x9edd('0x2a')](util[_0x9edd('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x4bdb88,_0x498977[_0x9edd('0x2b')]));emitChannelQueueInteraction(_0x45c3ab[_0x9edd('0x24')],_0x498977[_0x9edd('0x2b')],_0x54a03f,_0x45c3ab[_0x9edd('0xb')]['name'],_0x45c3ab[_0x9edd('0x2c')]['id'],!![],_0x50338f,_0x498977['id']);if(rpc[_0x45c3ab[_0x9edd('0x24')]+_0x9edd('0x2d')]){return rpc[_0x45c3ab[_0x9edd('0x24')]+_0x9edd('0x2d')][_0x9edd('0x2e')](_0x54a03f)[_0x9edd('0x2f')](function(_0x1fba7b){logger[_0x9edd('0x30')](_0x9edd('0x31'));});}}}function stopRouting(_0x4fd03f,_0x138002,_0x6907a5,_0xa55906){if(_0x4fd03f&&_0x138002){_0x138002[_0x9edd('0x1f')]-=0x1;var _0x5af178={'leaveAt':moment()[_0x9edd('0x14')](_0x9edd('0x32')),'acceptAt':moment()[_0x9edd('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x9edd('0x33')};logger[_0x9edd('0x2a')](util[_0x9edd('0x14')](_0x9edd('0x34'),_0x4fd03f,_0x138002[_0x9edd('0x2b')]));emitChannelQueueInteraction(_0x6907a5[_0x9edd('0x24')],_0x138002[_0x9edd('0x2b')],_0x6907a5[_0x9edd('0x20')],_0x6907a5[_0x9edd('0xb')][_0x9edd('0x2b')],_0x6907a5[_0x9edd('0x2c')]['id'],![],_0xa55906,_0x138002['id']);if(rpc[_0x6907a5[_0x9edd('0x24')]+_0x9edd('0x2d')]){return rpc[_0x6907a5[_0x9edd('0x24')]+'QueueReport'][_0x9edd('0x35')](_0x4fd03f,_0x5af178)['catch'](function(_0x968303){logger[_0x9edd('0x30')](_0x9edd('0x36'));});}}}function endRouting(_0x434d26,_0x16770e,_0x4fa5ab,_0x6de835){if(_0x434d26&&_0x16770e){_0x16770e[_0x9edd('0x1f')]-=0x1;var _0x2b3469={'leaveAt':moment()[_0x9edd('0x14')](_0x9edd('0x32')),'exitAt':moment()[_0x9edd('0x14')](_0x9edd('0x32')),'reason':_0x9edd('0x37')};logger[_0x9edd('0x2a')](util[_0x9edd('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x434d26,_0x16770e[_0x9edd('0x2b')]));emitChannelQueueInteraction(_0x4fa5ab['channel'],_0x16770e[_0x9edd('0x2b')],_0x4fa5ab['body'],_0x4fa5ab[_0x9edd('0xb')][_0x9edd('0x2b')],_0x4fa5ab[_0x9edd('0x2c')]['id'],![],_0x6de835);if(rpc[_0x4fa5ab['channel']+_0x9edd('0x2d')]){return rpc[_0x4fa5ab[_0x9edd('0x24')]+_0x9edd('0x2d')]['update'](_0x434d26,_0x2b3469)[_0x9edd('0x2f')](function(_0x51ad91){logger[_0x9edd('0x30')](_0x9edd('0x36'));});}}}function handleFindQueue(_0x50be2c){return function(_0x315f52){return _0x315f52[_0x9edd('0x2b')][_0x9edd('0x38')]()===_0x50be2c[_0x9edd('0x38')]();};}exports['consequence']=function(_0x449f01,_0x5bbdf8,_0x2bdb3f,_0xc1e657){return function(_0x587d74){try{var _0x318757={'name':_0x5bbdf8[0x0],'timeout':_0x5bbdf8[0x1]};var _0x49a128=queue['validate'](_0x318757,{'typecast':!![]});if(_0x49a128[_0x9edd('0x39')]){logger[_0x9edd('0x30')](_0x9edd('0x3a'),_0x449f01,_[_0x9edd('0x3b')](_0x49a128,_0x9edd('0x2c'))[_0x9edd('0x3c')](',\x20'));_0x587d74[_0x9edd('0x3d')]();}else{var _0x75efbe=_[_0x9edd('0x3e')](_0x2bdb3f[_0xc1e657[_0x9edd('0x24')]+_0x9edd('0x3f')],handleFindQueue(_0x318757[_0x9edd('0x2b')]));if(_0x75efbe){startRouting(_0x449f01,_0x75efbe,_0xc1e657,_0x2bdb3f);var _0x3d5eba=(_0x75efbe[_0x9edd('0x37')]||0xa)*0x3e8;var _0x46e9f4=(_0x318757['timeout']||0x14)*0x3e8;var _0x13197d,_0x2570e3;if(_0x3d5eba>_0x46e9f4){_0x46e9f4=_0x3d5eba;}var _0x2231c1=seqqueue[_0x9edd('0x40')](_0x3d5eba);_0x2231c1['id']=_0x449f01;_0x2231c1[_0x9edd('0x41')]=_0x3d5eba;_0x2231c1[_0x9edd('0x42')]=_0x46e9f4;_0x2231c1[_0x9edd('0x24')]=_0xc1e657['channel'];_0x2bdb3f['rules'][_0x449f01]['on']('end',function(){logger[_0x9edd('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x449f01);stopRouting(_0x449f01,_0x75efbe,_0xc1e657,_0x2bdb3f);clearTimeout(_0x13197d);_0x13197d=undefined;_0x2231c1[_0x9edd('0x43')](!![]);if(_0x2bdb3f[_0x9edd('0x44')][_0x449f01]){delete _0x2bdb3f[_0x9edd('0x44')][_0x449f01];}_0x587d74[_0x9edd('0x3d')]();});_0x2bdb3f[_0x9edd('0x44')][_0x449f01]['on']('complete',function(){if(_0x2bdb3f[_0x9edd('0x44')][_0x449f01]){delete _0x2bdb3f[_0x9edd('0x44')][_0x449f01];}});_0x13197d=setTimeout(function(){logger[_0x9edd('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x449f01);endRouting(_0x449f01,_0x75efbe,_0xc1e657,_0x2bdb3f);clearTimeout(_0x13197d);_0x2231c1[_0x9edd('0x43')](!![]);_0x587d74[_0x9edd('0x45')]();},_0x46e9f4);switch(_0x75efbe[_0x9edd('0x46')]){case _0x9edd('0x47'):strategy[_0x9edd('0x47')](_0x2231c1,_0x75efbe,_0x2bdb3f,_0xc1e657);break;default:strategy[_0x9edd('0x48')](_0x2231c1,_0x75efbe,_0x2bdb3f,_0xc1e657);}}else{logger['error'](_0x9edd('0x49'),_0x449f01,_0x318757[_0x9edd('0x2b')]);_0x587d74['stop']();}}}catch(_0xb93816){console[_0x9edd('0x4a')](_0xb93816);logger['error'](_0x9edd('0x3a'),_0x449f01,_0xb93816[_0x9edd('0x4b')]);_0x587d74[_0x9edd('0x3d')]();}};}; \ No newline at end of file +var _0x34e8=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','InteractionId','interaction','channel','MessageId','chat','AccountId','WebsiteId','name','message','QueueReport','create','catch','error','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport'];(function(_0x6af11c,_0x3b9497){var _0x394134=function(_0x2489d3){while(--_0x2489d3){_0x6af11c['push'](_0x6af11c['shift']());}};_0x394134(++_0x3b9497);}(_0x34e8,0x12c));var _0x834e=function(_0x184645,_0x2100fe){_0x184645=_0x184645-0x0;var _0x162308=_0x34e8[_0x184645];return _0x162308;};'use strict';var schema=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var seqqueue=require(_0x834e('0x3'));var moment=require('moment');var Redis=require(_0x834e('0x4'));var config=require(_0x834e('0x5'));var logger=require(_0x834e('0x6'))(_0x834e('0x7'));var strategy=require(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));var attributes=['id',_0x834e('0xc'),_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10')];function emit(_0x363786,_0x1af45a,_0x3bdda9){io['to'](_0x363786)[_0x834e('0x11')](_0x1af45a,_0x3bdda9);}function emitChannelQueueInteraction(_0x1e41fe,_0x36e124,_0x14038b,_0x2e1a37,_0x293514,_0x1e00de,_0x2fd95c,_0x538bb3){var _0x5e5b6d=_[_0x834e('0x12')](_0x14038b);_0x5e5b6d['queue_id']=_0x538bb3;_0x5e5b6d[_0x834e('0xe')]=_0x36e124;_0x5e5b6d[_0x834e('0xd')]=_0x2e1a37;_0x5e5b6d['id']=_0x293514;if(_0x1e00de){_0x2fd95c[util[_0x834e('0x13')](_0x834e('0x14'),_0x1e41fe)][_0x293514]=_['pick'](_0x5e5b6d,attributes);}else{delete _0x2fd95c[util[_0x834e('0x13')](_0x834e('0x14'),_0x1e41fe)][_0x293514];}emit(util['format'](_0x834e('0x15'),_0x1e41fe,_0x36e124),util['format'](_0x834e('0x16'),_0x1e41fe,_0x1e00de?_0x834e('0x17'):'remove'),_[_0x834e('0x18')](_0x5e5b6d,attributes));}var rpc={'openchannelQueueReport':require(_0x834e('0x19')),'mailQueueReport':require(_0x834e('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x834e('0x1b')),'faxQueueReport':require(_0x834e('0x1c')),'whatsappQueueReport':require(_0x834e('0x1d'))};var queue=schema({'name':{'type':_0x834e('0x1e'),'required':!![],'message':_0x834e('0x1f')},'timeout':{'type':_0x834e('0x20'),'message':_0x834e('0x21')}});function startRouting(_0x595515,_0x2545b4,_0x1fd2c6,_0x113ff4){if(_0x595515&&_0x2545b4&&_0x1fd2c6){_0x2545b4[_0x834e('0x22')]+=0x1;var _0x4ab05d={'uniqueid':_0x595515,'from':_0x1fd2c6[_0x834e('0x23')]?_0x1fd2c6[_0x834e('0x23')]['from']:'','joinAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'ContactId':_0x1fd2c6[_0x834e('0x25')]?_0x1fd2c6['contact']['id']:null,'ListId':_0x1fd2c6['list']?_0x1fd2c6[_0x834e('0x26')]['id']:null};_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+_0x834e('0x28')]=_0x2545b4['id']||null;_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+_0x834e('0x29')]=_0x1fd2c6[_0x834e('0x2a')]?_0x1fd2c6[_0x834e('0x2a')]['id']:null;_0x4ab05d[_['upperFirst'](_0x1fd2c6[_0x834e('0x2b')])+_0x834e('0x2c')]=_0x1fd2c6['message']?_0x1fd2c6['message']['id']:null;_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+(_0x1fd2c6[_0x834e('0x2b')]!==_0x834e('0x2d')?_0x834e('0x2e'):_0x834e('0x2f'))]=_0x1fd2c6[_0x834e('0xd')]?_0x1fd2c6[_0x834e('0xd')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x595515,_0x2545b4['name']));emitChannelQueueInteraction(_0x1fd2c6[_0x834e('0x2b')],_0x2545b4[_0x834e('0x30')],_0x4ab05d,_0x1fd2c6[_0x834e('0xd')]['name'],_0x1fd2c6[_0x834e('0x31')]['id'],!![],_0x113ff4,_0x2545b4['id']);if(rpc[_0x1fd2c6[_0x834e('0x2b')]+_0x834e('0x32')]){return rpc[_0x1fd2c6[_0x834e('0x2b')]+_0x834e('0x32')][_0x834e('0x33')](_0x4ab05d)[_0x834e('0x34')](function(_0xfaf716){logger[_0x834e('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0xef9ec2,_0x5cad11,_0x2c75c2,_0x3787b0){if(_0xef9ec2&&_0x5cad11){_0x5cad11[_0x834e('0x22')]-=0x1;var _0x2b3418={'leaveAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'acceptAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'reason':_0x834e('0x36')};logger[_0x834e('0x37')](util['format'](_0x834e('0x38'),_0xef9ec2,_0x5cad11[_0x834e('0x30')]));emitChannelQueueInteraction(_0x2c75c2[_0x834e('0x2b')],_0x5cad11[_0x834e('0x30')],_0x2c75c2['body'],_0x2c75c2[_0x834e('0xd')][_0x834e('0x30')],_0x2c75c2['message']['id'],![],_0x3787b0,_0x5cad11['id']);if(rpc[_0x2c75c2['channel']+'QueueReport']){return rpc[_0x2c75c2[_0x834e('0x2b')]+_0x834e('0x32')][_0x834e('0x39')](_0xef9ec2,_0x2b3418)[_0x834e('0x34')](function(_0x339e28){logger[_0x834e('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0x2c2d94,_0x513f36,_0xe103fe,_0x6a3ac){if(_0x2c2d94&&_0x513f36){_0x513f36['waiting']-=0x1;var _0x18ac3b={'leaveAt':moment()[_0x834e('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x834e('0x24')),'reason':_0x834e('0x3a')};logger[_0x834e('0x37')](util[_0x834e('0x13')](_0x834e('0x3b'),_0x2c2d94,_0x513f36['name']));emitChannelQueueInteraction(_0xe103fe[_0x834e('0x2b')],_0x513f36['name'],_0xe103fe['body'],_0xe103fe[_0x834e('0xd')]['name'],_0xe103fe[_0x834e('0x31')]['id'],![],_0x6a3ac);if(rpc[_0xe103fe[_0x834e('0x2b')]+_0x834e('0x32')]){return rpc[_0xe103fe[_0x834e('0x2b')]+_0x834e('0x32')]['update'](_0x2c2d94,_0x18ac3b)[_0x834e('0x34')](function(_0x26b847){logger[_0x834e('0x35')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x35380e){return function(_0x16ac45){return _0x16ac45['name'][_0x834e('0x3c')]()===_0x35380e['toLowerCase']();};}exports[_0x834e('0x3d')]=function(_0x585335,_0x4a18bb,_0x4a6942,_0x22ea21){return function(_0x16969b){try{var _0x3bcbf4={'name':_0x4a18bb[0x0],'timeout':_0x4a18bb[0x1]};var _0xbc1571=queue[_0x834e('0x0')](_0x3bcbf4,{'typecast':!![]});if(_0xbc1571[_0x834e('0x3e')]){logger[_0x834e('0x35')]('[%s][QUEUE]\x20%s',_0x585335,_[_0x834e('0x3f')](_0xbc1571,'message')[_0x834e('0x40')](',\x20'));_0x16969b['stop']();}else{var _0x1df5b0=_['find'](_0x4a6942[_0x22ea21[_0x834e('0x2b')]+_0x834e('0x41')],handleFindQueue(_0x3bcbf4['name']));if(_0x1df5b0){startRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);var _0x39e7b9=(_0x1df5b0[_0x834e('0x3a')]||0xa)*0x3e8;var _0xa880cb=(_0x3bcbf4[_0x834e('0x3a')]||0x14)*0x3e8;var _0x252ea0,_0x1a7149;if(_0x39e7b9>_0xa880cb){_0xa880cb=_0x39e7b9;}var _0xfa28da=seqqueue[_0x834e('0x42')](_0x39e7b9);_0xfa28da['id']=_0x585335;_0xfa28da[_0x834e('0x43')]=_0x39e7b9;_0xfa28da[_0x834e('0x44')]=_0xa880cb;_0xfa28da['channel']=_0x22ea21[_0x834e('0x2b')];_0x4a6942[_0x834e('0x45')][_0x585335]['on']('end',function(){logger[_0x834e('0x37')](_0x834e('0x46'),_0x585335);stopRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);clearTimeout(_0x252ea0);_0x252ea0=undefined;_0xfa28da[_0x834e('0x47')](!![]);if(_0x4a6942[_0x834e('0x45')][_0x585335]){delete _0x4a6942[_0x834e('0x45')][_0x585335];}_0x16969b[_0x834e('0x48')]();});_0x4a6942['rules'][_0x585335]['on']('complete',function(){if(_0x4a6942[_0x834e('0x45')][_0x585335]){delete _0x4a6942[_0x834e('0x45')][_0x585335];}});_0x252ea0=setTimeout(function(){logger[_0x834e('0x37')](_0x834e('0x49'),_0x585335);endRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);clearTimeout(_0x252ea0);_0xfa28da[_0x834e('0x47')](!![]);_0x16969b[_0x834e('0x4a')]();},_0xa880cb);switch(_0x1df5b0[_0x834e('0x4b')]){case _0x834e('0x4c'):strategy[_0x834e('0x4c')](_0xfa28da,_0x1df5b0,_0x4a6942,_0x22ea21);break;default:strategy[_0x834e('0x4d')](_0xfa28da,_0x1df5b0,_0x4a6942,_0x22ea21);}}else{logger[_0x834e('0x35')](_0x834e('0x4e'),_0x585335,_0x3bcbf4[_0x834e('0x30')]);_0x16969b[_0x834e('0x48')]();}}}catch(_0x2aa072){console[_0x834e('0x4f')](_0x2aa072);logger[_0x834e('0x35')](_0x834e('0x50'),_0x585335,_0x2aa072[_0x834e('0x51')]);_0x16969b[_0x834e('0x48')]();}};}; \ 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 fea26e3..df76c73 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 _0xe3e0=['push','handleRun','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','bind','handleTimeout','drained','handleDrained'];(function(_0x21d249,_0x42b4d6){var _0x4cf81c=function(_0xfb938b){while(--_0xfb938b){_0x21d249['push'](_0x21d249['shift']());}};_0x4cf81c(++_0x42b4d6);}(_0xe3e0,0x188));var _0x0e3e=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xe3e0[_0x57d13b];return _0x467696;};'use strict';var _=require('lodash');var uuid=require(_0x0e3e('0x0'));var util=require(_0x0e3e('0x1'));var logger=require(_0x0e3e('0x2'))(_0x0e3e('0x3'));var Agent=function(_0x4e2434,_0x2de472,_0x3a700c,_0x474777){this[_0x0e3e('0x4')]=uuid['v4']();this[_0x0e3e('0x5')]=_0x4e2434;this[_0x0e3e('0x6')]=_0x2de472;this['realtime']=_0x3a700c;this[_0x0e3e('0x3')]=_0x474777;this[_0x0e3e('0x5')]['push'](this['handleRun'][_0x0e3e('0x7')](this),this[_0x0e3e('0x8')]['bind'](this));this[_0x0e3e('0x5')]['on']('timeout',this[_0x0e3e('0x8')][_0x0e3e('0x7')](this));this['squeue']['on'](_0x0e3e('0x9'),this[_0x0e3e('0xa')][_0x0e3e('0x7')](this));};Agent['prototype'][_0x0e3e('0xb')]=function(){this[_0x0e3e('0x5')][_0x0e3e('0xb')](this[_0x0e3e('0xc')]['bind'](this),this[_0x0e3e('0x8')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x0e3e('0x8')](!![]);};Agent[_0x0e3e('0xd')]['handleRun']=function(_0x5d8f06){logger['info'](_0x0e3e('0xe'),this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0x6')]['id']);if(_['isNil'](this[_0x0e3e('0xf')][_0x0e3e('0x10')][this[_0x0e3e('0x6')]['id']])){logger[_0x0e3e('0x11')](_0x0e3e('0x12'),this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0x6')]['id']);setTimeout(this[_0x0e3e('0xb')][_0x0e3e('0x7')](this),0x3e8);}else{if(this['routing'][_0x0e3e('0x13')]||util[_0x0e3e('0x14')](this[_0x0e3e('0x5')]['id'],this['realtime'][_0x0e3e('0x10')][this[_0x0e3e('0x6')]['id']],this[_0x0e3e('0x5')]['channel'],![])){this[_0x0e3e('0xf')]['agents'][this['agent']['id']][_0x0e3e('0x15')]=!![];this[_0x0e3e('0xf')][_0x0e3e('0x10')][this['agent']['id']]['busyQueue']=undefined;util[_0x0e3e('0x16')](this['notificationId'],this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0xf')][_0x0e3e('0x10')][this[_0x0e3e('0x6')]['id']],null,this[_0x0e3e('0x3')]);util['writeLog'](this[_0x0e3e('0x5')]['id'],this['realtime'][_0x0e3e('0x10')][this['agent']['id']],_0x0e3e('0x17')+(this['routing'][_0x0e3e('0x13')]?_0x0e3e('0x18'):''));}else{logger[_0x0e3e('0x11')](_0x0e3e('0x19'),this[_0x0e3e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x0e3e('0xb')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x0e3e('0x8')]=function(_0x1052d4){if(_['isNil'](this[_0x0e3e('0xf')][_0x0e3e('0x10')][this[_0x0e3e('0x6')]['id']])){return logger['info'](_0x0e3e('0x12'),this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0x6')]['id']);}else{logger[_0x0e3e('0x11')](_0x0e3e('0x1a'),this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0x6')]['id']);util[_0x0e3e('0x1b')](this[_0x0e3e('0x4')],this['squeue']['id'],this['realtime'][_0x0e3e('0x10')][this[_0x0e3e('0x6')]['id']],null,this[_0x0e3e('0x3')]);this[_0x0e3e('0xf')][_0x0e3e('0x10')][this['agent']['id']][_0x0e3e('0x15')]=![];this[_0x0e3e('0xf')]['agents'][this[_0x0e3e('0x6')]['id']][_0x0e3e('0x1c')]=undefined;util[_0x0e3e('0x1d')](this[_0x0e3e('0x5')]['id'],this[_0x0e3e('0xf')]['agents'][this['agent']['id']],_0x1052d4?'STOP':'TIMEOUT');}if(!_0x1052d4){setTimeout(this['push'][_0x0e3e('0x7')](this),0x3e8);}};function agent(_0x4b0606,_0x5318a1,_0x163fc3,_0x13fea7){return new Agent(_0x4b0606,_0x5318a1,_0x163fc3,_0x13fea7);}module[_0x0e3e('0x1e')]=agent; \ No newline at end of file +var _0xf0a4=['handleTimeout','bind','drained','push','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','busyQueue','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','exports','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','handleRun'];(function(_0x7b69cf,_0x7096c1){var _0x78b929=function(_0x4cf89a){while(--_0x4cf89a){_0x7b69cf['push'](_0x7b69cf['shift']());}};_0x78b929(++_0x7096c1);}(_0xf0a4,0x1c4));var _0x4f0a=function(_0x39f06b,_0x1aa75b){_0x39f06b=_0x39f06b-0x0;var _0x44e986=_0xf0a4[_0x39f06b];return _0x44e986;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require(_0x4f0a('0x0'))(_0x4f0a('0x1'));var Agent=function(_0x2ea730,_0x309ebf,_0x45b1d6,_0x4d4231){this[_0x4f0a('0x2')]=uuid['v4']();this['squeue']=_0x2ea730;this[_0x4f0a('0x3')]=_0x309ebf;this[_0x4f0a('0x4')]=_0x45b1d6;this['routing']=_0x4d4231;this[_0x4f0a('0x5')]['push'](this[_0x4f0a('0x6')]['bind'](this),this[_0x4f0a('0x7')]['bind'](this));this['squeue']['on']('timeout',this['handleTimeout'][_0x4f0a('0x8')](this));this[_0x4f0a('0x5')]['on'](_0x4f0a('0x9'),this['handleDrained'][_0x4f0a('0x8')](this));};Agent['prototype'][_0x4f0a('0xa')]=function(){this['squeue'][_0x4f0a('0xa')](this[_0x4f0a('0x6')]['bind'](this),this[_0x4f0a('0x7')]['bind'](this));};Agent[_0x4f0a('0xb')]['handleDrained']=function(){this[_0x4f0a('0x7')](!![]);};Agent[_0x4f0a('0xb')][_0x4f0a('0x6')]=function(_0x4cde74){logger[_0x4f0a('0xc')](_0x4f0a('0xd'),this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x3')]['id']);if(_[_0x4f0a('0xe')](this['realtime'][_0x4f0a('0xf')][this['agent']['id']])){logger[_0x4f0a('0xc')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x3')]['id']);setTimeout(this['push'][_0x4f0a('0x8')](this),0x3e8);}else{if(this[_0x4f0a('0x1')][_0x4f0a('0x10')]||util[_0x4f0a('0x11')](this['squeue']['id'],this[_0x4f0a('0x4')]['agents'][this[_0x4f0a('0x3')]['id']],this[_0x4f0a('0x5')]['channel'],![])){this['realtime'][_0x4f0a('0xf')][this['agent']['id']]['busy']=!![];this[_0x4f0a('0x4')]['agents'][this['agent']['id']][_0x4f0a('0x12')]=undefined;util['showNotification'](this[_0x4f0a('0x2')],this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x4')]['agents'][this[_0x4f0a('0x3')]['id']],null,this[_0x4f0a('0x1')]);util['writeLog'](this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x4')]['agents'][this[_0x4f0a('0x3')]['id']],_0x4f0a('0x13')+(this['routing'][_0x4f0a('0x10')]?':FORCED':''));}else{logger[_0x4f0a('0xc')](_0x4f0a('0x14'),this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x3')]['id']);setTimeout(this[_0x4f0a('0xa')][_0x4f0a('0x8')](this),0x3e8);}}};Agent['prototype'][_0x4f0a('0x7')]=function(_0x5a6d25){if(_[_0x4f0a('0xe')](this[_0x4f0a('0x4')][_0x4f0a('0xf')][this[_0x4f0a('0x3')]['id']])){return logger[_0x4f0a('0xc')](_0x4f0a('0x15'),this[_0x4f0a('0x5')]['id'],this['agent']['id']);}else{logger['info'](_0x4f0a('0x16'),this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x3')]['id']);util[_0x4f0a('0x17')](this['notificationId'],this[_0x4f0a('0x5')]['id'],this[_0x4f0a('0x4')]['agents'][this[_0x4f0a('0x3')]['id']],null,this[_0x4f0a('0x1')]);this[_0x4f0a('0x4')][_0x4f0a('0xf')][this[_0x4f0a('0x3')]['id']]['busy']=![];this[_0x4f0a('0x4')][_0x4f0a('0xf')][this['agent']['id']][_0x4f0a('0x12')]=undefined;util[_0x4f0a('0x18')](this[_0x4f0a('0x5')]['id'],this['realtime']['agents'][this[_0x4f0a('0x3')]['id']],_0x5a6d25?'STOP':_0x4f0a('0x19'));}if(!_0x5a6d25){setTimeout(this[_0x4f0a('0xa')][_0x4f0a('0x8')](this),0x3e8);}};function agent(_0x11fbc9,_0x56ae1,_0x5850aa,_0xe40310){return new Agent(_0x11fbc9,_0x56ae1,_0x5850aa,_0xe40310);}module[_0x4f0a('0x1a')]=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 6be1a33..aa9bac9 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 _0xc4f0=['hideNotification','notificationId','STOP','TIMEOUT','./util','routing','squeue','queue','realtime','push','handleRun','handleTimeout','timeout','bind','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY'];(function(_0x5dad62,_0x4470c5){var _0x1a6890=function(_0x59fac5){while(--_0x59fac5){_0x5dad62['push'](_0x5dad62['shift']());}};_0x1a6890(++_0x4470c5);}(_0xc4f0,0x164));var _0x0c4f=function(_0x1df5a5,_0x5aa8b4){_0x1df5a5=_0x1df5a5-0x0;var _0x20aea4=_0xc4f0[_0x1df5a5];return _0x20aea4;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x0c4f('0x0'));var logger=require('../../../../../config/logger')(_0x0c4f('0x1'));var Beepall=function(_0x2ee6e6,_0x36d035,_0x1bc9a6,_0x3cf817){this['notificationId']=uuid['v4']();this[_0x0c4f('0x2')]=_0x2ee6e6;this[_0x0c4f('0x3')]=_0x36d035;this[_0x0c4f('0x4')]=_0x1bc9a6;this[_0x0c4f('0x1')]=_0x3cf817;this[_0x0c4f('0x2')][_0x0c4f('0x5')](this[_0x0c4f('0x6')]['bind'](this),this[_0x0c4f('0x7')]['bind'](this));this[_0x0c4f('0x2')]['on'](_0x0c4f('0x8'),this['handleTimeout'][_0x0c4f('0x9')](this));this[_0x0c4f('0x2')]['on'](_0x0c4f('0xa'),this[_0x0c4f('0xb')][_0x0c4f('0x9')](this));};Beepall[_0x0c4f('0xc')]['push']=function(){this[_0x0c4f('0x2')]['push'](this['handleRun'][_0x0c4f('0x9')](this),this[_0x0c4f('0x7')][_0x0c4f('0x9')](this));};Beepall[_0x0c4f('0xc')][_0x0c4f('0xb')]=function(_0x43efb0){this['handleTimeout'](!![]);};Beepall[_0x0c4f('0xc')][_0x0c4f('0x6')]=function(_0x29ab02){var _0x3a118d=!![];if(!_[_0x0c4f('0xd')](this[_0x0c4f('0x3')])&&!_['isNil'](this['queue'][_0x0c4f('0xe')])&&this['queue'][_0x0c4f('0xe')][_0x0c4f('0xf')]>0x0){for(var _0x11fcf2=0x0,_0x421a19;_0x11fcf20x0){for(var _0x280b7e=0x0,_0x2a8264;_0x280b7e0x0&&_0x163908[_0x55464b+_0x091d('0x24')]>=_0x163908[_0x55464b+_0x091d('0x22')]){writeLog(_0x381358,_0x163908,_0x55464b['toUpperCase']()+_0x091d('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x455529,_0x4452e6,_0x6476e9,_0x5a50db,_0x2df900){return sendNotification(!![],_0x455529,_0x4452e6,_0x6476e9,_0x5a50db,_0x2df900);};exports[_0x091d('0x26')]=function(_0x37a5b5,_0x4934ce,_0x1a23a5,_0x61e16c,_0x49eb1e){return sendNotification(![],_0x37a5b5,_0x4934ce,_0x1a23a5,_0x61e16c,_0x49eb1e);};exports[_0x091d('0x27')]=writeLog; \ No newline at end of file +var _0xe495=['../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','\x20interaction','name','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','remove','info','isAgentAvailable','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','mustache','../../../../../config/environment'];(function(_0x15e3a0,_0x337d60){var _0x5eda6b=function(_0x1be348){while(--_0x1be348){_0x15e3a0['push'](_0x15e3a0['shift']());}};_0x5eda6b(++_0x337d60);}(_0xe495,0xfe));var _0x5e49=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xe495[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x5e49('0x0'));var util=require('util');var utils=require(_0x5e49('0x1'));var Mustache=require(_0x5e49('0x2'));var Redis=require('ioredis');var config=require(_0x5e49('0x3'));var logger=require(_0x5e49('0x4'))(_0x5e49('0x5'));config['redis']=_[_0x5e49('0x6')](config[_0x5e49('0x7')],{'host':_0x5e49('0x8'),'port':0x18eb});var io=require(_0x5e49('0x9'))(new Redis(config[_0x5e49('0x7')]));function emit(_0xae637a,_0x53d14e,_0x5d45be){io['to'](_0xae637a)[_0x5e49('0xa')](_0x53d14e,_0x5d45be);}function sendNotification(_0x153761,_0x4f9bc1,_0x48f36d,_0x2c3519,_0x4edf25,_0x36ed51){io['to'](util[_0x5e49('0xb')](_0x5e49('0xc'),_0x2c3519['name']))[_0x5e49('0xa')](_0x5e49('0xd'),_0x2c3519);var _0x21184a=_0x36ed51||{};var _0xd757b0=_0x48f36d[_0x5e49('0xe')]('.');var _0x526d73={'uniqueid':_0x4f9bc1,'channel':_0xd757b0[0x0],'id':_0xd757b0[0x1],'title':_0xd757b0[0x0]+_0x5e49('0xf'),'interactionId':_0xd757b0[0x2],'queue':_0x4edf25?_0x4edf25[_0x5e49('0x10')]:null,'sound':_0x21184a[_0x5e49('0x11')][_0x5e49('0x12')],'shake':_0x21184a[_0x5e49('0x11')]['notificationShake']};try{if(!_0x21184a[_0x5e49('0x13')]){_0x21184a['body']={};}if(_0x4edf25){_0x21184a[_0x5e49('0x13')][_0x5e49('0x14')]=_0x4edf25;}else if(_0x21184a[_0x5e49('0x13')][_0x5e49('0x14')]){delete _0x21184a[_0x5e49('0x13')][_0x5e49('0x14')];}_0x526d73['msg']=utils[_0x5e49('0x15')](_0x21184a['account'][_0x5e49('0x16')],_0x21184a);}catch(_0x4633ed){_0x526d73[_0x5e49('0x17')]=_0x5e49('0x18');logger[_0x5e49('0x19')](util[_0x5e49('0xb')]('[%s][QUEUE]\x20%s',_0x4f9bc1,_0x4633ed[_0x5e49('0x1a')]));}io['to'](util[_0x5e49('0xb')](_0x5e49('0xc'),_0x2c3519[_0x5e49('0x10')]))[_0x5e49('0xa')](util['format'](_0x5e49('0x1b'),_0x153761?'save':_0x5e49('0x1c')),_0x526d73);}function writeLog(_0x574b96,_0x2dee45,_0x1468a3){return logger[_0x5e49('0x1d')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x574b96,_0x2dee45[_0x5e49('0x10')],_0x1468a3));}exports[_0x5e49('0x1e')]=function(_0x4bb544,_0x40acf7,_0x125933,_0x9ba537){if(_0x40acf7[_0x5e49('0x1f')]){writeLog(_0x4bb544,_0x40acf7,_0x5e49('0x20'));return![];}if(!_0x40acf7['online']){writeLog(_0x4bb544,_0x40acf7,'OFFLINE');return![];}if(_0x40acf7[_0x125933+_0x5e49('0x21')]){writeLog(_0x4bb544,_0x40acf7,_0x5e49('0x22'));return![];}if(_0x9ba537&&_0x40acf7[_0x5e49('0x23')](_0x125933+_0x5e49('0x24'))&&_0x40acf7[_0x5e49('0x23')](_0x125933+'CurrentCapacity')){if(_0x40acf7[_0x125933+_0x5e49('0x24')]>0x0&&_0x40acf7[_0x125933+_0x5e49('0x25')]>=_0x40acf7[_0x125933+'Capacity']){writeLog(_0x4bb544,_0x40acf7,_0x125933[_0x5e49('0x26')]()+_0x5e49('0x27'));return![];}}return!![];};exports[_0x5e49('0x28')]=function(_0x2014d7,_0x1daf4f,_0x154092,_0x59e78d,_0x446dee){return sendNotification(!![],_0x2014d7,_0x1daf4f,_0x154092,_0x59e78d,_0x446dee);};exports[_0x5e49('0x29')]=function(_0x4d3846,_0x40a4e1,_0x215a9d,_0x487e1d,_0x3756ab){return sendNotification(![],_0x4d3846,_0x40a4e1,_0x215a9d,_0x487e1d,_0x3756ab);};exports[_0x5e49('0x2a')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index e147555..08d6bcd 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 _0xfcc1=['validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xfcc1,0x144));var _0x1fcc=function(_0x3ad191,_0x29e58b){_0x3ad191=_0x3ad191-0x0;var _0x4384e5=_0xfcc1[_0x3ad191];return _0x4384e5;};'use strict';var schema=require(_0x1fcc('0x0'));var sh=require(_0x1fcc('0x1'));var _=require(_0x1fcc('0x2'));var utils=require(_0x1fcc('0x3'));var logger=require(_0x1fcc('0x4'))(_0x1fcc('0x5'));var system=schema({'command':{'type':_0x1fcc('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x1fcc('0x7')]=function(_0x9897a7,_0x27d3c3){return function(_0x2ecc94){try{var _0x5089ad={'command':_0x27d3c3[0x0]};var _0x35f509=system[_0x1fcc('0x0')](_0x5089ad,{'typecast':!![]});if(_0x35f509[_0x1fcc('0x8')]){logger['error'](_0x1fcc('0x9'),_0x9897a7,_[_0x1fcc('0xa')](_0x35f509,_0x1fcc('0xb'))[_0x1fcc('0xc')](',\x20'));logger[_0x1fcc('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x9897a7);_0x2ecc94['next']();}else{var _0xd22421=this;var _0x593963=utils[_0x1fcc('0xe')](_0x27d3c3[0x0],this);logger[_0x1fcc('0xd')](_0x1fcc('0xf'),_0x9897a7,_0x593963);sh['exec'](_[_0x1fcc('0x10')](_0x593963),function(_0x5a5f99,_0x58f252){logger[_0x1fcc('0xd')](_0x1fcc('0x11'),_0x9897a7,_0x5a5f99);if(_0x5a5f99==0x0){var _0x30bd38=_0x58f252['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x1fcc('0x12')](_0x27d3c3[0x1])||_[_0x1fcc('0x13')](_0x27d3c3[0x1])){logger[_0x1fcc('0xd')](_0x1fcc('0x14'),_0x9897a7);_0xd22421[_0x1fcc('0x15')][_0x27d3c3[0x1]]=_0x30bd38;}else{logger[_0x1fcc('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x9897a7,_0x27d3c3[0x1],_0x30bd38);_0xd22421['body'][_0x27d3c3[0x1]]=_0x30bd38;}}_0x2ecc94[_0x1fcc('0x16')]();});}}catch(_0x4e2c3b){logger[_0x1fcc('0x17')](_0x1fcc('0x9'),_0x9897a7,_[_0x1fcc('0x18')](_0x4e2c3b)?JSON[_0x1fcc('0x19')](_0x4e2c3b):_0x4e2c3b);logger['info'](_0x1fcc('0x1a'),_0x9897a7);_0x2ecc94[_0x1fcc('0x16')]();}};}; \ No newline at end of file +var _0xb1fc=['lodash','./utils','routing','consequence','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','exec','isEmpty','body','error','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs'];(function(_0x10cc40,_0x191a2e){var _0x2631a8=function(_0x3e8ee9){while(--_0x3e8ee9){_0x10cc40['push'](_0x10cc40['shift']());}};_0x2631a8(++_0x191a2e);}(_0xb1fc,0x154));var _0xcb1f=function(_0x1f3d12,_0x1ff5b8){_0x1f3d12=_0x1f3d12-0x0;var _0x31d169=_0xb1fc[_0x1f3d12];return _0x31d169;};'use strict';var schema=require(_0xcb1f('0x0'));var sh=require(_0xcb1f('0x1'));var _=require(_0xcb1f('0x2'));var utils=require(_0xcb1f('0x3'));var logger=require('../../../../config/logger')(_0xcb1f('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xcb1f('0x5')]=function(_0x216437,_0x43b95c){return function(_0x122c2e){try{var _0x3ed0ea={'command':_0x43b95c[0x0]};var _0x412f1e=system[_0xcb1f('0x0')](_0x3ed0ea,{'typecast':!![]});if(_0x412f1e['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x216437,_[_0xcb1f('0x6')](_0x412f1e,'message')[_0xcb1f('0x7')](',\x20'));logger[_0xcb1f('0x8')](_0xcb1f('0x9'),_0x216437);_0x122c2e['next']();}else{var _0x187575=this;var _0x3ccafa=utils[_0xcb1f('0xa')](_0x43b95c[0x0],this);logger[_0xcb1f('0x8')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x216437,_0x3ccafa);sh[_0xcb1f('0xb')](_['trim'](_0x3ccafa),function(_0x101837,_0x825538){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x216437,_0x101837);if(_0x101837==0x0){var _0x31b806=_0x825538['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x43b95c[0x1])||_[_0xcb1f('0xc')](_0x43b95c[0x1])){logger[_0xcb1f('0x8')]('[%s][SYSTEM]\x20no\x20variable',_0x216437);_0x187575[_0xcb1f('0xd')][_0x43b95c[0x1]]=_0x31b806;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x216437,_0x43b95c[0x1],_0x31b806);_0x187575['body'][_0x43b95c[0x1]]=_0x31b806;}}_0x122c2e['next']();});}}catch(_0x564ef9){logger[_0xcb1f('0xe')](_0xcb1f('0xf'),_0x216437,_[_0xcb1f('0x10')](_0x564ef9)?JSON[_0xcb1f('0x11')](_0x564ef9):_0x564ef9);logger[_0xcb1f('0x8')](_0xcb1f('0x9'),_0x216437);_0x122c2e['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index e6991af..b91bf31 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 _0x392e=['interaction','then','catch','error','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags'];(function(_0x22ca53,_0x30e1a9){var _0x80aacf=function(_0x55f0b9){while(--_0x55f0b9){_0x22ca53['push'](_0x22ca53['shift']());}};_0x80aacf(++_0x30e1a9);}(_0x392e,0x6b));var _0xe392=function(_0x145eb4,_0x48ba65){_0x145eb4=_0x145eb4-0x0;var _0x3a1fe3=_0x392e[_0x145eb4];return _0x3a1fe3;};'use strict';var schema=require(_0xe392('0x0'));var _=require(_0xe392('0x1'));var rpc={'chatInteraction':require(_0xe392('0x2')),'openchannelInteraction':require(_0xe392('0x3')),'smsInteraction':require(_0xe392('0x4')),'mailInteraction':require(_0xe392('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xe392('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xe392('0x7')}});exports['consequence']=function(_0x1fcad7,_0x3c7ee4,_0x544468,_0x5f56d4){return function(_0x58c3b0){try{var _0x2d97fd={'tag':_0x3c7ee4[0x0]};var _0x4785a1=tag[_0xe392('0x0')](_0x2d97fd,{'typecast':!![]});if(_0x4785a1[_0xe392('0x8')]){logger['error'](_0xe392('0x9'),_0x1fcad7,_[_0xe392('0xa')](_0x4785a1,_0xe392('0xb'))[_0xe392('0xc')](',\x20'));logger[_0xe392('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fcad7);_0x58c3b0[_0xe392('0xe')]();}else{var _0x361dc9={'ids':[_0x3c7ee4[0x0]]};if(rpc[_0x5f56d4[_0xe392('0xf')]+_0xe392('0x10')]){rpc[_0x5f56d4[_0xe392('0xf')]+_0xe392('0x10')][_0xe392('0x11')](_0x5f56d4[_0xe392('0x12')]['id'],_0x361dc9)[_0xe392('0x13')](function(_0x14bfb7){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x1fcad7,_0x3c7ee4[0x1],_0x5f56d4[_0xe392('0xf')],_0x5f56d4[_0xe392('0x12')]['id']);})[_0xe392('0x14')](function(_0x338703){logger[_0xe392('0x15')](_0xe392('0x9'),_0x1fcad7,JSON[_0xe392('0x16')](_0x338703));logger[_0xe392('0xd')](_0xe392('0x17'),_0x1fcad7);})[_0xe392('0x18')](function(){_0x58c3b0[_0xe392('0xe')]();});}}}catch(_0x4a0de4){logger[_0xe392('0x15')]('[%s][TAG]\x20%s',_0x1fcad7,_['isObject'](_0x4a0de4)?JSON[_0xe392('0x16')](_0x4a0de4):_0x4a0de4);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fcad7);_0x58c3b0[_0xe392('0xe')]();}};}; \ No newline at end of file +var _0xdd1b=['Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next'];(function(_0x56da20,_0x480281){var _0x2cadb9=function(_0x44776e){while(--_0x44776e){_0x56da20['push'](_0x56da20['shift']());}};_0x2cadb9(++_0x480281);}(_0xdd1b,0x6c));var _0xbdd1=function(_0x1b8ad9,_0x301373){_0x1b8ad9=_0x1b8ad9-0x0;var _0x279227=_0xdd1b[_0x1b8ad9];return _0x279227;};'use strict';var schema=require('validate');var _=require(_0xbdd1('0x0'));var rpc={'chatInteraction':require(_0xbdd1('0x1')),'openchannelInteraction':require(_0xbdd1('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xbdd1('0x3')),'faxInteraction':require(_0xbdd1('0x4')),'whatsappInteraction':require(_0xbdd1('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xbdd1('0x6'),'required':!![],'message':_0xbdd1('0x7')}});exports[_0xbdd1('0x8')]=function(_0x1d3ebc,_0xdd0fd5,_0x3ebaa8,_0xd06cd5){return function(_0x298d74){try{var _0x56fa05={'tag':_0xdd0fd5[0x0]};var _0x6c6af1=tag['validate'](_0x56fa05,{'typecast':!![]});if(_0x6c6af1[_0xbdd1('0x9')]){logger[_0xbdd1('0xa')](_0xbdd1('0xb'),_0x1d3ebc,_[_0xbdd1('0xc')](_0x6c6af1,'message')[_0xbdd1('0xd')](',\x20'));logger[_0xbdd1('0xe')](_0xbdd1('0xf'),_0x1d3ebc);_0x298d74[_0xbdd1('0x10')]();}else{var _0xa780f2={'ids':[_0xdd0fd5[0x0]]};if(rpc[_0xd06cd5['channel']+_0xbdd1('0x11')]){rpc[_0xd06cd5[_0xbdd1('0x12')]+'Interaction'][_0xbdd1('0x13')](_0xd06cd5[_0xbdd1('0x14')]['id'],_0xa780f2)[_0xbdd1('0x15')](function(_0x3f6d79){logger[_0xbdd1('0xe')](_0xbdd1('0x16'),_0x1d3ebc,_0xdd0fd5[0x1],_0xd06cd5[_0xbdd1('0x12')],_0xd06cd5[_0xbdd1('0x14')]['id']);})['catch'](function(_0x49903b){logger[_0xbdd1('0xa')](_0xbdd1('0xb'),_0x1d3ebc,JSON[_0xbdd1('0x17')](_0x49903b));logger[_0xbdd1('0xe')](_0xbdd1('0xf'),_0x1d3ebc);})['finally'](function(){_0x298d74[_0xbdd1('0x10')]();});}}}catch(_0x24f21d){logger[_0xbdd1('0xa')](_0xbdd1('0xb'),_0x1d3ebc,_[_0xbdd1('0x18')](_0x24f21d)?JSON['stringify'](_0x24f21d):_0x24f21d);logger[_0xbdd1('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1d3ebc);_0x298d74[_0xbdd1('0x10')]();}};}; \ 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 f378900..5a216aa 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 _0x885e=['body','account','interaction','list','mustache','lodash','render','merge'];(function(_0x38cb4c,_0x27e17a){var _0x16c7cf=function(_0x249145){while(--_0x249145){_0x38cb4c['push'](_0x38cb4c['shift']());}};_0x16c7cf(++_0x27e17a);}(_0x885e,0xe4));var _0xe885=function(_0x4be318,_0x3f9877){_0x4be318=_0x4be318-0x0;var _0x19926b=_0x885e[_0x4be318];return _0x19926b;};'use strict';var Mustache=require(_0xe885('0x0'));var _=require(_0xe885('0x1'));module['exports']={'getMustacheRender':function(_0x45b20b,_0x1cd11a){return Mustache[_0xe885('0x2')](_0x45b20b,_[_0xe885('0x3')](_0x1cd11a[_0xe885('0x4')],{'contact':_0x1cd11a['contact'],'message':_0x1cd11a['message'],'account':_0x1cd11a[_0xe885('0x5')],'interaction':_0x1cd11a[_0xe885('0x6')],'list':_0x1cd11a[_0xe885('0x7')]}))||'';}}; \ No newline at end of file +var _0x167e=['list','mustache','lodash','exports','render','merge','body','message','interaction'];(function(_0x2a0346,_0x2c1300){var _0x1f5232=function(_0x345c8e){while(--_0x345c8e){_0x2a0346['push'](_0x2a0346['shift']());}};_0x1f5232(++_0x2c1300);}(_0x167e,0xa3));var _0xe167=function(_0x3c673c,_0x748bb6){_0x3c673c=_0x3c673c-0x0;var _0x5d9fe8=_0x167e[_0x3c673c];return _0x5d9fe8;};'use strict';var Mustache=require(_0xe167('0x0'));var _=require(_0xe167('0x1'));module[_0xe167('0x2')]={'getMustacheRender':function(_0x38b912,_0x14457a){return Mustache[_0xe167('0x3')](_0x38b912,_[_0xe167('0x4')](_0x14457a[_0xe167('0x5')],{'contact':_0x14457a['contact'],'message':_0x14457a[_0xe167('0x6')],'account':_0x14457a['account'],'interaction':_0x14457a[_0xe167('0x7')],'list':_0x14457a[_0xe167('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 35e3347..e9cb617 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 _0x30dd=['channel','end','QueueReport','UserId','catch','message\x20is\x20empty','agent','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','push','slice','appdata','split','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','emit','complete','stack','routing\x20is\x20empty'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x30dd,0xd8));var _0xd30d=function(_0x1182e8,_0x14cc0e){_0x1182e8=_0x1182e8-0x0;var _0x4deabd=_0x30dd[_0x1182e8];return _0x4deabd;};'use strict';var _=require(_0xd30d('0x0'));var util=require(_0xd30d('0x1'));var path=require(_0xd30d('0x2'));var fs=require('fs');var jayson=require(_0xd30d('0x3'));var BPromise=require(_0xd30d('0x4'));var uuid=require(_0xd30d('0x5'));var config=require(_0xd30d('0x6'));var logger=require(_0xd30d('0x7'))(_0xd30d('0x8'));var rpc={'openchannelQueueReport':require(_0xd30d('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd30d('0xa')),'smsQueueReport':require(_0xd30d('0xb')),'faxQueueReport':require(_0xd30d('0xc')),'whatsappQueueReport':require(_0xd30d('0xd'))};var RuleEngine=require(_0xd30d('0xe'));function getId(_0x2d4f5c,_0x34b0f3,_0x5a6cff){return util[_0xd30d('0xf')](_0xd30d('0x10'),_0x2d4f5c,_0x34b0f3||0x0,_0x5a6cff||0x0);}function getIntervals(_0x2b8b56,_0x2b9ad8){var _0x5c26f0=[];if(!_[_0xd30d('0x11')](_0x2b9ad8[_0xd30d('0x12')])&&!_[_0xd30d('0x11')](_0x2b8b56[_0x2b9ad8['IntervalId']])&&!_[_0xd30d('0x11')](_0x2b8b56[_0x2b9ad8[_0xd30d('0x12')]][_0xd30d('0x13')])){_0x5c26f0=_[_0xd30d('0x14')](_0x2b8b56[_0x2b9ad8[_0xd30d('0x12')]][_0xd30d('0x13')],_0xd30d('0x15'));}else if(!_[_0xd30d('0x11')](_0x2b9ad8[_0xd30d('0x15')])){_0x5c26f0=[_0x2b9ad8[_0xd30d('0x15')]];}return _0x5c26f0;}exports[_0xd30d('0x16')]=function(_0x48bab0){_0x48bab0[_0xd30d('0x17')]={};return new BPromise(function(_0x4a8251,_0x16c1e0){var _0x22dd9e={'Start':function(_0x21dc8a){var _0x29cb40=this;return new Promise(function(_0x1f56a1,_0xf22db4){if(_0x21dc8a){try{var _0x20bbf5=[];var _0x44ccec=getId(_0x21dc8a['channel'],_0x21dc8a[_0xd30d('0x18')]?_0x21dc8a[_0xd30d('0x18')]['id']:0x0,_0x21dc8a['interaction']?_0x21dc8a[_0xd30d('0x19')]['id']:0x0);if(_0x21dc8a[_0xd30d('0x1a')]&&_[_0xd30d('0x1b')](_0x21dc8a[_0xd30d('0x1a')])&&_0x21dc8a[_0xd30d('0x1a')][_0xd30d('0x1c')]){for(var _0x2934ce=0x0;_0x2934ce<_0x21dc8a[_0xd30d('0x1a')][_0xd30d('0x1c')];_0x2934ce+=0x1){var _0x3c5556=_0x21dc8a[_0xd30d('0x1a')][_0x2934ce];if(fs[_0xd30d('0x1d')](path[_0xd30d('0x1e')](__dirname,_0xd30d('0x1a'),_0x3c5556[_0xd30d('0x1f')]+'.js'))){var _0x2ced8b=[];switch(_0x3c5556[_0xd30d('0x1f')][_0xd30d('0x20')]()){case _0xd30d('0x21'):var _0x349f0c=_0x3c5556['appdata']['split'](',');_0x2ced8b[_0xd30d('0x22')](_0x349f0c[0x0]);_0x2ced8b[_0xd30d('0x22')](_0x349f0c[_0xd30d('0x23')](0x1,_0x349f0c['length'])[_0xd30d('0x1e')](','));break;case'dialogflow':var _0x1fd449=_0x3c5556[_0xd30d('0x24')][_0xd30d('0x25')](',');_0x2ced8b[_0xd30d('0x22')](_0x1fd449[0x0]);_0x2ced8b['push'](_0x1fd449[0x1]);_0x2ced8b[_0xd30d('0x22')](_0x1fd449[_0xd30d('0x23')](0x2,_0x1fd449['length'])[_0xd30d('0x1e')](','));break;case'amazonlex':var _0x4ad420=_0x3c5556['appdata'][_0xd30d('0x25')](',');_0x2ced8b['push'](_0x4ad420[0x0]);_0x2ced8b[_0xd30d('0x22')](_0x4ad420[0x1]);_0x2ced8b[_0xd30d('0x22')](_0x4ad420[0x2]);_0x2ced8b[_0xd30d('0x22')](_0x4ad420[0x3]);_0x2ced8b['push'](_0x4ad420[_0xd30d('0x23')](0x4,_0x4ad420[_0xd30d('0x1c')])[_0xd30d('0x1e')](','));break;case'message':_0x2ced8b[_0xd30d('0x22')](_0x3c5556[_0xd30d('0x24')]);break;case'tag':_0x2ced8b[_0xd30d('0x22')](_0x3c5556[_0xd30d('0x26')]);_0x2ced8b[_0xd30d('0x22')](_0x3c5556[_0xd30d('0x24')]);break;default:_0x2ced8b=_['isNil'](_0x3c5556[_0xd30d('0x24')])?[]:_0x3c5556[_0xd30d('0x24')][_0xd30d('0x25')](',');}var _0x389821={'id':util[_0xd30d('0xf')](_0xd30d('0x27'),_0x44ccec,_0x3c5556['id'],_0x3c5556['app']),'condition':require(_0xd30d('0x28'))[_0xd30d('0x29')](_0x44ccec,getIntervals(_0x48bab0[_0xd30d('0x2a')],_0x3c5556),_0x48bab0),'consequence':require(_0xd30d('0x2b')+_0x3c5556[_0xd30d('0x1f')])[_0xd30d('0x2c')](_0x44ccec,_0x2ced8b,_0x48bab0,_0x21dc8a),'p':_0x3c5556['priority']||0x0};logger[_0xd30d('0x2d')](_0xd30d('0x2e'),_0x389821['id'],_0xd30d('0x2f'),getIntervals(_0x48bab0[_0xd30d('0x2a')],_0x3c5556)[_0xd30d('0x1e')](_0xd30d('0x30')));_0x20bbf5[_0xd30d('0x22')](_0x389821);}else{logger[_0xd30d('0x31')](_0xd30d('0x32'),path[_0xd30d('0x1e')](__dirname,_0xd30d('0x1a'),_0x3c5556[_0xd30d('0x1f')]+_0xd30d('0x33')));}}_0x48bab0[_0xd30d('0x17')][_0x44ccec]=new RuleEngine(_0x20bbf5);_0x48bab0[_0xd30d('0x17')][_0x44ccec][_0xd30d('0x34')](_0x21dc8a,function(_0x18a68d){logger[_0xd30d('0x2d')]('Applications\x20executed',JSON['stringify'](_0x18a68d['matchPath']));if(_0x48bab0[_0xd30d('0x17')][_0x44ccec]){_0x48bab0['rules'][_0x44ccec][_0xd30d('0x35')](_0xd30d('0x36'));}});return _0x1f56a1({'code':0xc8,'message':_0x21dc8a});}else{logger[_0xd30d('0x2d')]('No\x20applications\x20to\x20execute');return _0x1f56a1({'code':0xc8,'message':_0x21dc8a});}}catch(_0x31c2a9){logger[_0xd30d('0x31')](_0x31c2a9[_0xd30d('0x37')]);return _0xf22db4(_0x29cb40[_0xd30d('0x31')](0x1f4,_0x31c2a9));}}return _0xf22db4(_0xd30d('0x38'));});},'AcceptMessage':function(_0x13df74){var _0x1271c0=this;return new Promise(function(_0x13671e,_0x377fec){if(_0x13df74[_0xd30d('0x18')]&&_0x13df74['message']['id']){try{var _0x9537d3=getId(_0x13df74[_0xd30d('0x39')],_0x13df74['message']?_0x13df74[_0xd30d('0x18')]['id']:0x0,_0x13df74['interaction']?_0x13df74['interaction']['id']:0x0);if(_0x48bab0[_0xd30d('0x17')][_0x9537d3]){_0x48bab0[_0xd30d('0x17')][_0x9537d3]['emit'](_0xd30d('0x3a'));if(rpc[_0x13df74[_0xd30d('0x39')]+_0xd30d('0x3b')]){rpc[_0x13df74[_0xd30d('0x39')]+_0xd30d('0x3b')]['update'](_0x9537d3,{'UserId':_0x13df74[_0xd30d('0x18')][_0xd30d('0x3c')]})[_0xd30d('0x3d')](function(_0x31febd){logger[_0xd30d('0x31')]('error\x20update\x20queue\x20report');});}}return _0x13671e({'code':0xc8,'message':_0x13df74});}catch(_0x3e41a9){logger[_0xd30d('0x31')](_0x3e41a9[_0xd30d('0x37')]);return _0x377fec(_0x1271c0['error'](0x1f4,_0x3e41a9));}}logger['error'](_0xd30d('0x3e'));return _0x377fec(_0x1271c0[_0xd30d('0x31')](0x1f4,_0xd30d('0x3e')));});},'RejectMessage':function(_0x44914b){var _0x3fefaf=this;return new Promise(function(_0x463dd4,_0x2da361){if(_0x44914b[_0xd30d('0x3f')]&&_0x44914b[_0xd30d('0x3f')]['id']){try{if(_0x48bab0['agents'][_0x44914b[_0xd30d('0x3f')]['id']]){_0x48bab0[_0xd30d('0x40')][_0x44914b[_0xd30d('0x3f')]['id']]['busy']=![];_0x48bab0[_0xd30d('0x40')][_0x44914b['agent']['id']]['busyQueue']=undefined;}return _0x463dd4({'code':0xc8,'message':_0x44914b});}catch(_0x2d328a){logger[_0xd30d('0x31')](_0x2d328a['stack']);return _0x2da361(_0x3fefaf[_0xd30d('0x31')](0x1f4,_0x2d328a));}}logger['error'](_0xd30d('0x3e'));return _0x2da361(_0x3fefaf[_0xd30d('0x31')](0x1f4,_0xd30d('0x3e')));});},'AbandonInteraction':function(_0x241e18){var _0x40e1df=this;return new Promise(function(_0x15c448,_0x42840c){if(_0x241e18[_0xd30d('0x39')]&&_0x241e18['interaction']&&_0x241e18[_0xd30d('0x19')]['id']){try{var _0x21d6b3=getId(_0x241e18[_0xd30d('0x39')],_0x241e18['message']?_0x241e18[_0xd30d('0x18')]['id']:0x0,_0x241e18[_0xd30d('0x19')]?_0x241e18[_0xd30d('0x19')]['id']:0x0);if(_0x48bab0[_0xd30d('0x17')][_0x21d6b3]){_0x48bab0[_0xd30d('0x17')][_0x21d6b3][_0xd30d('0x35')](_0xd30d('0x3a'));}return _0x15c448({'code':0xc8,'message':_0x241e18});}catch(_0x1cccaa){logger[_0xd30d('0x31')](_0x1cccaa[_0xd30d('0x37')]);return _0x42840c(_0x40e1df[_0xd30d('0x31')](0x1f4,_0x1cccaa));}}logger[_0xd30d('0x31')]('message\x20is\x20empty');return _0x42840c(_0x40e1df['error'](0x1f4,_0xd30d('0x3e')));});},'AgentCapacity':function(_0x2ffaca){var _0x1a69a0=this;return new Promise(function(_0x2dadda,_0x34fdb0){if(_0x48bab0[_0xd30d('0x40')][_0xd30d('0x41')](_0x2ffaca['id'])){for(var _0x3b99c1 in _0x2ffaca['capacity']){if(_0x2ffaca[_0xd30d('0x42')][_0xd30d('0x41')](_0x3b99c1)){if(_0x48bab0[_0xd30d('0x40')][_0x2ffaca['id']]['hasOwnProperty'](_0x3b99c1+'CurrentCapacity')){_0x48bab0[_0xd30d('0x40')][_0x2ffaca['id']][_0x3b99c1+_0xd30d('0x43')]=parseInt(_0x2ffaca[_0xd30d('0x42')][_0x3b99c1],0xa);}}}_0x48bab0[_0xd30d('0x40')][_0x2ffaca['id']][_0xd30d('0x44')]();return _0x2dadda({'code':0xc8,'message':_0x48bab0['agents'][_0x2ffaca['id']]});}else{return _0x34fdb0(_0x1a69a0[_0xd30d('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x243960){return new Promise(function(_0x54c123,_0x3ebceb){var _0x437a16=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x40')]);_0x54c123({'count':_0x437a16[_0xd30d('0x1c')],'rows':_0x437a16});});},'ChatQueues':function(_0x43bff4){return new Promise(function(_0x40eafc,_0x75ec10){var _0x5280d8=[];for(var _0x57122a in _0x48bab0['chatQueues']){if(_0x48bab0[_0xd30d('0x46')][_0xd30d('0x41')](_0x57122a)){var _0x18b7c8=_0x48bab0['chatQueues'][_0x57122a];var _0x5be42d={'id':_0x18b7c8['id'],'available':_0x18b7c8[_0xd30d('0x47')],'loggedIn':_0x18b7c8[_0xd30d('0x48')],'name':_0x18b7c8[_0xd30d('0x49')],'paused':_0x18b7c8[_0xd30d('0x4a')],'waiting':_0x18b7c8[_0xd30d('0x4b')]};_0x5280d8['push'](_0x5be42d);}}_0x40eafc({'count':_0x5280d8[_0xd30d('0x1c')],'rows':_0x5280d8});});},'MailQueues':function(_0x2e0837){return new Promise(function(_0x3716ed,_0x2fda80){var _0x4c2e21=[];for(var _0x530faf in _0x48bab0['mailQueues']){if(_0x48bab0[_0xd30d('0x4c')][_0xd30d('0x41')](_0x530faf)){var _0x5ca0f5=_0x48bab0[_0xd30d('0x4c')][_0x530faf];var _0x39fc54={'id':_0x5ca0f5['id'],'available':_0x5ca0f5[_0xd30d('0x47')],'loggedIn':_0x5ca0f5['loggedIn'],'name':_0x5ca0f5[_0xd30d('0x49')],'paused':_0x5ca0f5[_0xd30d('0x4a')],'waiting':_0x5ca0f5[_0xd30d('0x4b')]};_0x4c2e21[_0xd30d('0x22')](_0x39fc54);}}_0x3716ed({'count':_0x4c2e21[_0xd30d('0x1c')],'rows':_0x4c2e21});});},'OpenchannelQueues':function(_0x2f960f){return new Promise(function(_0x5ed096,_0x44ae84){var _0x36cacf=[];for(var _0x4bb4a8 in _0x48bab0['openchannelQueues']){if(_0x48bab0[_0xd30d('0x4d')][_0xd30d('0x41')](_0x4bb4a8)){var _0x4b90b1=_0x48bab0[_0xd30d('0x4d')][_0x4bb4a8];var _0x352e82={'id':_0x4b90b1['id'],'available':_0x4b90b1[_0xd30d('0x47')],'loggedIn':_0x4b90b1[_0xd30d('0x48')],'name':_0x4b90b1[_0xd30d('0x49')],'paused':_0x4b90b1[_0xd30d('0x4a')],'waiting':_0x4b90b1[_0xd30d('0x4b')]};_0x36cacf['push'](_0x352e82);}}_0x5ed096({'count':_0x36cacf['length'],'rows':_0x36cacf});});},'SmsQueues':function(_0x4ab97f){return new Promise(function(_0xcdd149,_0x1f601b){var _0x300154=[];for(var _0x5b156d in _0x48bab0[_0xd30d('0x4e')]){if(_0x48bab0['smsQueues'][_0xd30d('0x41')](_0x5b156d)){var _0x4c9cef=_0x48bab0['smsQueues'][_0x5b156d];var _0x2c3408={'id':_0x4c9cef['id'],'available':_0x4c9cef[_0xd30d('0x47')],'loggedIn':_0x4c9cef[_0xd30d('0x48')],'name':_0x4c9cef['name'],'paused':_0x4c9cef[_0xd30d('0x4a')],'waiting':_0x4c9cef[_0xd30d('0x4b')]};_0x300154['push'](_0x2c3408);}}_0xcdd149({'count':_0x300154[_0xd30d('0x1c')],'rows':_0x300154});});},'FaxQueues':function(_0x3c67cd){return new Promise(function(_0x95d797,_0x4de3ff){var _0x54c03c=[];for(var _0x3c3f08 in _0x48bab0[_0xd30d('0x4f')]){if(_0x48bab0[_0xd30d('0x4f')]['hasOwnProperty'](_0x3c3f08)){var _0x31ab14=_0x48bab0['faxQueues'][_0x3c3f08];var _0x41f4b9={'id':_0x31ab14['id'],'available':_0x31ab14[_0xd30d('0x47')],'loggedIn':_0x31ab14[_0xd30d('0x48')],'name':_0x31ab14[_0xd30d('0x49')],'paused':_0x31ab14['paused'],'waiting':_0x31ab14[_0xd30d('0x4b')]};_0x54c03c['push'](_0x41f4b9);}}_0x95d797({'count':_0x54c03c[_0xd30d('0x1c')],'rows':_0x54c03c});});},'WhatsappQueues':function(_0x29629a){return new Promise(function(_0x2516c6,_0x1b2a8b){var _0x17141e=[];for(var _0x557c82 in _0x48bab0[_0xd30d('0x50')]){if(_0x48bab0[_0xd30d('0x50')][_0xd30d('0x41')](_0x557c82)){var _0x2ef8ca=_0x48bab0[_0xd30d('0x50')][_0x557c82];var _0x4381ef={'id':_0x2ef8ca['id'],'available':_0x2ef8ca[_0xd30d('0x47')],'loggedIn':_0x2ef8ca[_0xd30d('0x48')],'name':_0x2ef8ca[_0xd30d('0x49')],'paused':_0x2ef8ca['paused'],'waiting':_0x2ef8ca[_0xd30d('0x4b')]};_0x17141e[_0xd30d('0x22')](_0x4381ef);}}_0x2516c6({'count':_0x17141e[_0xd30d('0x1c')],'rows':_0x17141e});});},'ChatQueuesWaitingInteractions':function(_0x17a1d9){return new Promise(function(_0x3d09a3,_0x23cb0c){var _0x103edc=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x51')]);_0x3d09a3({'count':_0x103edc[_0xd30d('0x1c')],'rows':_0x103edc});});},'MailQueuesWaitingInteractions':function(_0x90e7da){return new Promise(function(_0x33d063,_0x339e8f){var _0x5a8cf7=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x52')]);_0x33d063({'count':_0x5a8cf7[_0xd30d('0x1c')],'rows':_0x5a8cf7});});},'OpenchannelQueuesWaitingInteractions':function(_0xcaec2f){return new Promise(function(_0x5a71a9,_0x502b70){var _0x2c74c2=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x53')]);_0x5a71a9({'count':_0x2c74c2[_0xd30d('0x1c')],'rows':_0x2c74c2});});},'SmsQueuesWaitingInteractions':function(_0x291904){return new Promise(function(_0x4eef5e,_0x333fdd){var _0x4f689b=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x54')]);_0x4eef5e({'count':_0x4f689b[_0xd30d('0x1c')],'rows':_0x4f689b});});},'FaxQueuesWaitingInteractions':function(_0xbd3074){return new Promise(function(_0x5194e1,_0x1e0139){var _0x126bb5=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x55')]);_0x5194e1({'count':_0x126bb5[_0xd30d('0x1c')],'rows':_0x126bb5});});},'WhatsappQueuesWaitingInteractions':function(_0x577fb4){return new Promise(function(_0x2985c7,_0x1d2f4d){var _0x396492=_[_0xd30d('0x45')](_0x48bab0[_0xd30d('0x56')]);_0x2985c7({'count':_0x396492[_0xd30d('0x1c')],'rows':_0x396492});});}};var _0x50a2ab=jayson[_0xd30d('0x57')](_0x22dd9e)['http']();_0x50a2ab['on'](_0xd30d('0x31'),function(_0x4c24eb){logger['error'](JSON[_0xd30d('0x58')](_0x4c24eb));return _0x16c1e0(_0x4c24eb);});_0x50a2ab[_0xd30d('0x16')](0x232c,_0xd30d('0x59'),function(){console['log'](_0xd30d('0x5a'),0x232c);return _0x4a8251('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x096f=['stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','bluebird','uuid','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','push','join','dialogflow','slice','split','tag','TagId','format','%s:%s:%s','./interval','intervals','consequence','priority','info','on\x20interval','error','.js','Applications\x20executed'];(function(_0x18542f,_0x44d4ea){var _0x570f24=function(_0x3957e9){while(--_0x3957e9){_0x18542f['push'](_0x18542f['shift']());}};_0x570f24(++_0x44d4ea);}(_0x096f,0xe5));var _0xf096=function(_0x516ead,_0x3614a0){_0x516ead=_0x516ead-0x0;var _0x59c622=_0x096f[_0x516ead];return _0x59c622;};'use strict';var _=require(_0xf096('0x0'));var util=require('util');var path=require(_0xf096('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xf096('0x2'));var uuid=require(_0xf096('0x3'));var config=require(_0xf096('0x4'));var logger=require('../../../config/logger')(_0xf096('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf096('0x6')),'chatQueueReport':require(_0xf096('0x7')),'smsQueueReport':require(_0xf096('0x8')),'faxQueueReport':require(_0xf096('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xf096('0xa'));function getId(_0x2036ac,_0x27aa87,_0x524cb3){return util['format']('%s.%s.%s',_0x2036ac,_0x27aa87||0x0,_0x524cb3||0x0);}function getIntervals(_0x4c2b91,_0x541a16){var _0x2eb460=[];if(!_[_0xf096('0xb')](_0x541a16[_0xf096('0xc')])&&!_[_0xf096('0xb')](_0x4c2b91[_0x541a16[_0xf096('0xc')]])&&!_[_0xf096('0xb')](_0x4c2b91[_0x541a16['IntervalId']][_0xf096('0xd')])){_0x2eb460=_[_0xf096('0xe')](_0x4c2b91[_0x541a16[_0xf096('0xc')]][_0xf096('0xd')],_0xf096('0xf'));}else if(!_[_0xf096('0xb')](_0x541a16[_0xf096('0xf')])){_0x2eb460=[_0x541a16[_0xf096('0xf')]];}return _0x2eb460;}exports[_0xf096('0x10')]=function(_0x212575){_0x212575[_0xf096('0x11')]={};return new BPromise(function(_0x25101a,_0x36ba27){var _0x3994dc={'Start':function(_0xdcec64){var _0x8587e8=this;return new Promise(function(_0x3ec8ed,_0x1a5c91){if(_0xdcec64){try{var _0x242b13=[];var _0x3907b0=getId(_0xdcec64[_0xf096('0x12')],_0xdcec64[_0xf096('0x13')]?_0xdcec64[_0xf096('0x13')]['id']:0x0,_0xdcec64[_0xf096('0x14')]?_0xdcec64[_0xf096('0x14')]['id']:0x0);if(_0xdcec64[_0xf096('0x15')]&&_[_0xf096('0x16')](_0xdcec64['applications'])&&_0xdcec64['applications'][_0xf096('0x17')]){for(var _0x1ea74f=0x0;_0x1ea74f<_0xdcec64[_0xf096('0x15')][_0xf096('0x17')];_0x1ea74f+=0x1){var _0x3d64ff=_0xdcec64[_0xf096('0x15')][_0x1ea74f];if(fs[_0xf096('0x18')](path['join'](__dirname,_0xf096('0x15'),_0x3d64ff['app']+'.js'))){var _0x817839=[];switch(_0x3d64ff[_0xf096('0x19')][_0xf096('0x1a')]()){case _0xf096('0x1b'):var _0x93e228=_0x3d64ff[_0xf096('0x1c')]['split'](',');_0x817839['push'](_0x93e228[0x0]);_0x817839[_0xf096('0x1d')](_0x93e228['slice'](0x1,_0x93e228[_0xf096('0x17')])[_0xf096('0x1e')](','));break;case _0xf096('0x1f'):var _0x34d08a=_0x3d64ff[_0xf096('0x1c')]['split'](',');_0x817839[_0xf096('0x1d')](_0x34d08a[0x0]);_0x817839['push'](_0x34d08a[0x1]);_0x817839['push'](_0x34d08a[_0xf096('0x20')](0x2,_0x34d08a[_0xf096('0x17')])[_0xf096('0x1e')](','));break;case'amazonlex':var _0x84289c=_0x3d64ff[_0xf096('0x1c')][_0xf096('0x21')](',');_0x817839['push'](_0x84289c[0x0]);_0x817839[_0xf096('0x1d')](_0x84289c[0x1]);_0x817839[_0xf096('0x1d')](_0x84289c[0x2]);_0x817839[_0xf096('0x1d')](_0x84289c[0x3]);_0x817839[_0xf096('0x1d')](_0x84289c[_0xf096('0x20')](0x4,_0x84289c[_0xf096('0x17')])[_0xf096('0x1e')](','));break;case _0xf096('0x13'):_0x817839[_0xf096('0x1d')](_0x3d64ff[_0xf096('0x1c')]);break;case _0xf096('0x22'):_0x817839[_0xf096('0x1d')](_0x3d64ff[_0xf096('0x23')]);_0x817839[_0xf096('0x1d')](_0x3d64ff[_0xf096('0x1c')]);break;default:_0x817839=_['isNil'](_0x3d64ff[_0xf096('0x1c')])?[]:_0x3d64ff[_0xf096('0x1c')][_0xf096('0x21')](',');}var _0x2912d9={'id':util[_0xf096('0x24')](_0xf096('0x25'),_0x3907b0,_0x3d64ff['id'],_0x3d64ff['app']),'condition':require(_0xf096('0x26'))['condition'](_0x3907b0,getIntervals(_0x212575[_0xf096('0x27')],_0x3d64ff),_0x212575),'consequence':require('./applications/'+_0x3d64ff[_0xf096('0x19')])[_0xf096('0x28')](_0x3907b0,_0x817839,_0x212575,_0xdcec64),'p':_0x3d64ff[_0xf096('0x29')]||0x0};logger[_0xf096('0x2a')]('Push\x20new\x20rule',_0x2912d9['id'],_0xf096('0x2b'),getIntervals(_0x212575['intervals'],_0x3d64ff)[_0xf096('0x1e')]('\x20|\x20'));_0x242b13[_0xf096('0x1d')](_0x2912d9);}else{logger[_0xf096('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xf096('0x1e')](__dirname,'applications',_0x3d64ff[_0xf096('0x19')]+_0xf096('0x2d')));}}_0x212575[_0xf096('0x11')][_0x3907b0]=new RuleEngine(_0x242b13);_0x212575[_0xf096('0x11')][_0x3907b0]['execute'](_0xdcec64,function(_0x5e8150){logger[_0xf096('0x2a')](_0xf096('0x2e'),JSON[_0xf096('0x2f')](_0x5e8150[_0xf096('0x30')]));if(_0x212575[_0xf096('0x11')][_0x3907b0]){_0x212575['rules'][_0x3907b0][_0xf096('0x31')](_0xf096('0x32'));}});return _0x3ec8ed({'code':0xc8,'message':_0xdcec64});}else{logger[_0xf096('0x2a')](_0xf096('0x33'));return _0x3ec8ed({'code':0xc8,'message':_0xdcec64});}}catch(_0x25a005){logger['error'](_0x25a005['stack']);return _0x1a5c91(_0x8587e8['error'](0x1f4,_0x25a005));}}return _0x1a5c91(_0xf096('0x34'));});},'AcceptMessage':function(_0x13dfba){var _0x124807=this;return new Promise(function(_0x309cbd,_0x1aedca){if(_0x13dfba[_0xf096('0x13')]&&_0x13dfba[_0xf096('0x13')]['id']){try{var _0x4ce611=getId(_0x13dfba['channel'],_0x13dfba['message']?_0x13dfba[_0xf096('0x13')]['id']:0x0,_0x13dfba[_0xf096('0x14')]?_0x13dfba[_0xf096('0x14')]['id']:0x0);if(_0x212575[_0xf096('0x11')][_0x4ce611]){_0x212575[_0xf096('0x11')][_0x4ce611][_0xf096('0x31')](_0xf096('0x35'));if(rpc[_0x13dfba[_0xf096('0x12')]+_0xf096('0x36')]){rpc[_0x13dfba[_0xf096('0x12')]+_0xf096('0x36')][_0xf096('0x37')](_0x4ce611,{'UserId':_0x13dfba[_0xf096('0x13')][_0xf096('0x38')]})[_0xf096('0x39')](function(_0x4704d3){logger[_0xf096('0x2c')](_0xf096('0x3a'));});}}return _0x309cbd({'code':0xc8,'message':_0x13dfba});}catch(_0x327d49){logger[_0xf096('0x2c')](_0x327d49[_0xf096('0x3b')]);return _0x1aedca(_0x124807[_0xf096('0x2c')](0x1f4,_0x327d49));}}logger['error'](_0xf096('0x3c'));return _0x1aedca(_0x124807['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x27ceb0){var _0x1c649a=this;return new Promise(function(_0x52fe4f,_0x284f2e){if(_0x27ceb0[_0xf096('0x3d')]&&_0x27ceb0[_0xf096('0x3d')]['id']){try{if(_0x212575[_0xf096('0x3e')][_0x27ceb0[_0xf096('0x3d')]['id']]){_0x212575['agents'][_0x27ceb0[_0xf096('0x3d')]['id']][_0xf096('0x3f')]=![];_0x212575[_0xf096('0x3e')][_0x27ceb0[_0xf096('0x3d')]['id']][_0xf096('0x40')]=undefined;}return _0x52fe4f({'code':0xc8,'message':_0x27ceb0});}catch(_0x3b1288){logger[_0xf096('0x2c')](_0x3b1288['stack']);return _0x284f2e(_0x1c649a[_0xf096('0x2c')](0x1f4,_0x3b1288));}}logger[_0xf096('0x2c')](_0xf096('0x3c'));return _0x284f2e(_0x1c649a[_0xf096('0x2c')](0x1f4,_0xf096('0x3c')));});},'AbandonInteraction':function(_0x49618e){var _0x5dcce8=this;return new Promise(function(_0xc375ff,_0x5e6040){if(_0x49618e[_0xf096('0x12')]&&_0x49618e[_0xf096('0x14')]&&_0x49618e[_0xf096('0x14')]['id']){try{var _0x459532=getId(_0x49618e[_0xf096('0x12')],_0x49618e[_0xf096('0x13')]?_0x49618e[_0xf096('0x13')]['id']:0x0,_0x49618e[_0xf096('0x14')]?_0x49618e[_0xf096('0x14')]['id']:0x0);if(_0x212575[_0xf096('0x11')][_0x459532]){_0x212575[_0xf096('0x11')][_0x459532]['emit'](_0xf096('0x35'));}return _0xc375ff({'code':0xc8,'message':_0x49618e});}catch(_0x1152d2){logger[_0xf096('0x2c')](_0x1152d2[_0xf096('0x3b')]);return _0x5e6040(_0x5dcce8['error'](0x1f4,_0x1152d2));}}logger[_0xf096('0x2c')]('message\x20is\x20empty');return _0x5e6040(_0x5dcce8[_0xf096('0x2c')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4ab213){var _0x2ee034=this;return new Promise(function(_0x1cf5e3,_0x4be402){if(_0x212575['agents'][_0xf096('0x41')](_0x4ab213['id'])){for(var _0x4567df in _0x4ab213[_0xf096('0x42')]){if(_0x4ab213[_0xf096('0x42')][_0xf096('0x41')](_0x4567df)){if(_0x212575[_0xf096('0x3e')][_0x4ab213['id']][_0xf096('0x41')](_0x4567df+_0xf096('0x43'))){_0x212575['agents'][_0x4ab213['id']][_0x4567df+_0xf096('0x43')]=parseInt(_0x4ab213['capacity'][_0x4567df],0xa);}}}_0x212575[_0xf096('0x3e')][_0x4ab213['id']][_0xf096('0x44')]();return _0x1cf5e3({'code':0xc8,'message':_0x212575['agents'][_0x4ab213['id']]});}else{return _0x4be402(_0x2ee034[_0xf096('0x2c')](0x1f4,_0xf096('0x45')));}});},'Agents':function(_0x5794c2){return new Promise(function(_0x4b0c7a,_0x39726f){var _0x120c73=_[_0xf096('0x46')](_0x212575['agents']);_0x4b0c7a({'count':_0x120c73[_0xf096('0x17')],'rows':_0x120c73});});},'ChatQueues':function(_0x3750e0){return new Promise(function(_0x20feab,_0x1e9f37){var _0x2bafe0=[];for(var _0x3a5ad8 in _0x212575[_0xf096('0x47')]){if(_0x212575['chatQueues']['hasOwnProperty'](_0x3a5ad8)){var _0x3bba17=_0x212575[_0xf096('0x47')][_0x3a5ad8];var _0x4bbe08={'id':_0x3bba17['id'],'available':_0x3bba17[_0xf096('0x48')],'loggedIn':_0x3bba17[_0xf096('0x49')],'name':_0x3bba17[_0xf096('0x4a')],'paused':_0x3bba17[_0xf096('0x4b')],'waiting':_0x3bba17[_0xf096('0x4c')]};_0x2bafe0[_0xf096('0x1d')](_0x4bbe08);}}_0x20feab({'count':_0x2bafe0[_0xf096('0x17')],'rows':_0x2bafe0});});},'MailQueues':function(_0x4c44a6){return new Promise(function(_0x106413,_0x31b967){var _0x460ee4=[];for(var _0x44076c in _0x212575['mailQueues']){if(_0x212575['mailQueues']['hasOwnProperty'](_0x44076c)){var _0x2ebee6=_0x212575[_0xf096('0x4d')][_0x44076c];var _0x582751={'id':_0x2ebee6['id'],'available':_0x2ebee6[_0xf096('0x48')],'loggedIn':_0x2ebee6[_0xf096('0x49')],'name':_0x2ebee6[_0xf096('0x4a')],'paused':_0x2ebee6[_0xf096('0x4b')],'waiting':_0x2ebee6[_0xf096('0x4c')]};_0x460ee4[_0xf096('0x1d')](_0x582751);}}_0x106413({'count':_0x460ee4[_0xf096('0x17')],'rows':_0x460ee4});});},'OpenchannelQueues':function(_0x546243){return new Promise(function(_0x4f79b2,_0x33de2f){var _0x8897c8=[];for(var _0x31c31a in _0x212575[_0xf096('0x4e')]){if(_0x212575[_0xf096('0x4e')]['hasOwnProperty'](_0x31c31a)){var _0xb40f76=_0x212575[_0xf096('0x4e')][_0x31c31a];var _0x3d9019={'id':_0xb40f76['id'],'available':_0xb40f76['available'],'loggedIn':_0xb40f76['loggedIn'],'name':_0xb40f76['name'],'paused':_0xb40f76[_0xf096('0x4b')],'waiting':_0xb40f76['waiting']};_0x8897c8['push'](_0x3d9019);}}_0x4f79b2({'count':_0x8897c8[_0xf096('0x17')],'rows':_0x8897c8});});},'SmsQueues':function(_0x150e69){return new Promise(function(_0x5e9b34,_0xce81a6){var _0xb4a2f7=[];for(var _0x25eb53 in _0x212575[_0xf096('0x4f')]){if(_0x212575[_0xf096('0x4f')][_0xf096('0x41')](_0x25eb53)){var _0x47ec19=_0x212575[_0xf096('0x4f')][_0x25eb53];var _0x477cf2={'id':_0x47ec19['id'],'available':_0x47ec19[_0xf096('0x48')],'loggedIn':_0x47ec19[_0xf096('0x49')],'name':_0x47ec19[_0xf096('0x4a')],'paused':_0x47ec19['paused'],'waiting':_0x47ec19['waiting']};_0xb4a2f7[_0xf096('0x1d')](_0x477cf2);}}_0x5e9b34({'count':_0xb4a2f7[_0xf096('0x17')],'rows':_0xb4a2f7});});},'FaxQueues':function(_0x48fe9e){return new Promise(function(_0x211dca,_0xe565fa){var _0x3bb95f=[];for(var _0x2d7cab in _0x212575[_0xf096('0x50')]){if(_0x212575[_0xf096('0x50')][_0xf096('0x41')](_0x2d7cab)){var _0x28324b=_0x212575[_0xf096('0x50')][_0x2d7cab];var _0x4bdebc={'id':_0x28324b['id'],'available':_0x28324b['available'],'loggedIn':_0x28324b[_0xf096('0x49')],'name':_0x28324b[_0xf096('0x4a')],'paused':_0x28324b['paused'],'waiting':_0x28324b['waiting']};_0x3bb95f['push'](_0x4bdebc);}}_0x211dca({'count':_0x3bb95f[_0xf096('0x17')],'rows':_0x3bb95f});});},'WhatsappQueues':function(_0x450c8c){return new Promise(function(_0x4d55fa,_0x1db6ba){var _0x1a60ea=[];for(var _0x172de8 in _0x212575[_0xf096('0x51')]){if(_0x212575[_0xf096('0x51')]['hasOwnProperty'](_0x172de8)){var _0x9febd8=_0x212575[_0xf096('0x51')][_0x172de8];var _0x4bcfe0={'id':_0x9febd8['id'],'available':_0x9febd8['available'],'loggedIn':_0x9febd8[_0xf096('0x49')],'name':_0x9febd8[_0xf096('0x4a')],'paused':_0x9febd8[_0xf096('0x4b')],'waiting':_0x9febd8[_0xf096('0x4c')]};_0x1a60ea['push'](_0x4bcfe0);}}_0x4d55fa({'count':_0x1a60ea[_0xf096('0x17')],'rows':_0x1a60ea});});},'ChatQueuesWaitingInteractions':function(_0x540442){return new Promise(function(_0x2310ef,_0x3eef2c){var _0x204c0c=_['values'](_0x212575[_0xf096('0x52')]);_0x2310ef({'count':_0x204c0c[_0xf096('0x17')],'rows':_0x204c0c});});},'MailQueuesWaitingInteractions':function(_0x118be5){return new Promise(function(_0x21a677,_0x394df7){var _0x3b4959=_[_0xf096('0x46')](_0x212575['mailQueuesWaitingInteractions']);_0x21a677({'count':_0x3b4959[_0xf096('0x17')],'rows':_0x3b4959});});},'OpenchannelQueuesWaitingInteractions':function(_0x72b63e){return new Promise(function(_0x3eef8f,_0x3a9ac0){var _0x17fcd2=_[_0xf096('0x46')](_0x212575[_0xf096('0x53')]);_0x3eef8f({'count':_0x17fcd2['length'],'rows':_0x17fcd2});});},'SmsQueuesWaitingInteractions':function(_0x6e2a56){return new Promise(function(_0x355a66,_0x2daa25){var _0x32e428=_['values'](_0x212575[_0xf096('0x54')]);_0x355a66({'count':_0x32e428[_0xf096('0x17')],'rows':_0x32e428});});},'FaxQueuesWaitingInteractions':function(_0x19dd42){return new Promise(function(_0x19da3f,_0x5675c6){var _0x23d992=_[_0xf096('0x46')](_0x212575[_0xf096('0x55')]);_0x19da3f({'count':_0x23d992[_0xf096('0x17')],'rows':_0x23d992});});},'WhatsappQueuesWaitingInteractions':function(_0x7271fb){return new Promise(function(_0x235175,_0x3924b6){var _0x29c89a=_[_0xf096('0x46')](_0x212575[_0xf096('0x56')]);_0x235175({'count':_0x29c89a[_0xf096('0x17')],'rows':_0x29c89a});});}};var _0x5543b3=jayson[_0xf096('0x57')](_0x3994dc)[_0xf096('0x58')]();_0x5543b3['on']('error',function(_0x359b4b){logger['error'](JSON[_0xf096('0x2f')](_0x359b4b));return _0x36ba27(_0x359b4b);});_0x5543b3[_0xf096('0x10')](0x232c,_0xf096('0x59'),function(){console[_0xf096('0x5a')](_0xf096('0x5b'),0x232c);return _0x25101a('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7e9cb27..b9b0aca 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 _0xe2ab=['stop','length','push','Command','format','indexOf','true','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe2ab,0x127));var _0xbe2a=function(_0x30bd36,_0x1b934b){_0x30bd36=_0x30bd36-0x0;var _0x5976b1=_0xe2ab[_0x30bd36];return _0x5976b1;};'use strict';var util=require(_0xbe2a('0x0'));var BPromise=require(_0xbe2a('0x1'));var jayson=require(_0xbe2a('0x2'));var _=require(_0xbe2a('0x3'));var logger=require(_0xbe2a('0x4'))(_0xbe2a('0x5'));var client=jayson['client'][_0xbe2a('0x6')]({'port':0x232a});function request(_0x65d4f0,_0x121e20){return new BPromise(function(_0x5bcb99,_0x48a9d8){return client[_0xbe2a('0x7')](_0x65d4f0,_0x121e20)[_0xbe2a('0x8')](function(_0x2d7bf2){if(_0x2d7bf2[_0xbe2a('0x9')]){return _0x48a9d8(_0x2d7bf2[_0xbe2a('0x9')][_0xbe2a('0xa')]);}else{return _0x5bcb99(_0x2d7bf2[_0xbe2a('0xb')]);}})['catch'](function(_0x251e0a){return _0x48a9d8(_0x251e0a);});});}exports['condition']=function(_0x69d1e2,_0x1f91c4,_0x2509ce){return function(_0xea4374){if(_0x2509ce[_0xbe2a('0xc')]&&!_0x2509ce[_0xbe2a('0xc')][_0x69d1e2]){logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x69d1e2);return _0xea4374[_0xbe2a('0xf')]();}var _0x16df36=[];for(var _0x3146de=0x0;_0x3146de<_0x1f91c4[_0xbe2a('0x10')];_0x3146de+=0x1){_0x16df36[_0xbe2a('0x11')](request(_0xbe2a('0x12'),{'command':util[_0xbe2a('0x13')]('iftime\x20%s',_0x1f91c4[_0x3146de])})[_0xbe2a('0x8')](function(_0x3817e8){return _0x3817e8&&_0x3817e8[_0xbe2a('0xa')]&&_0x3817e8[_0xbe2a('0xa')][_0xbe2a('0x14')](_0xbe2a('0x15'))>=0x0?!![]:![];})[_0xbe2a('0x16')](function(_0x235687){logger[_0xbe2a('0x9')](_0xbe2a('0x17'),_0x69d1e2,_0x1f91c4[_0x3146de]);}));}BPromise['all'](_0x16df36)['then'](function(_0xe28c6e){var _0xb074ee=_[_0xbe2a('0x18')](_0xe28c6e);logger[_0xbe2a('0xd')](_0xbe2a('0x19'),_0x69d1e2,_0x1f91c4['join'](_0xbe2a('0x1a')),_0xb074ee);_0xea4374[_0xbe2a('0x1b')](_0xb074ee);})[_0xbe2a('0x16')](function(_0x28ba9c){console[_0xbe2a('0x1c')](_0x28ba9c);logger[_0xbe2a('0x9')](_0xbe2a('0x19'),_0x69d1e2,_0x1f91c4[_0xbe2a('0x1d')](_0xbe2a('0x1a')),_0x28ba9c[_0xbe2a('0x1e')]);_0xea4374[_0xbe2a('0xf')]();});};}; \ No newline at end of file +var _0x1a71=['when','util','bluebird','jayson/promise','../../../config/logger','routing','http','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0xdd7a7b,_0x254b3a){var _0x40ca7d=function(_0x4c2744){while(--_0x4c2744){_0xdd7a7b['push'](_0xdd7a7b['shift']());}};_0x40ca7d(++_0x254b3a);}(_0x1a71,0x8d));var _0x11a7=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0x1a71[_0x526786];return _0x3a512d;};'use strict';var util=require(_0x11a7('0x0'));var BPromise=require(_0x11a7('0x1'));var jayson=require(_0x11a7('0x2'));var _=require('lodash');var logger=require(_0x11a7('0x3'))(_0x11a7('0x4'));var client=jayson['client'][_0x11a7('0x5')]({'port':0x232a});function request(_0x5f38c4,_0x248739){return new BPromise(function(_0x10c9d5,_0x2e3b7d){return client['request'](_0x5f38c4,_0x248739)[_0x11a7('0x6')](function(_0x5df8e0){if(_0x5df8e0[_0x11a7('0x7')]){return _0x2e3b7d(_0x5df8e0['error'][_0x11a7('0x8')]);}else{return _0x10c9d5(_0x5df8e0[_0x11a7('0x9')]);}})[_0x11a7('0xa')](function(_0x18f86c){return _0x2e3b7d(_0x18f86c);});});}exports[_0x11a7('0xb')]=function(_0x39b37c,_0x15818c,_0x1f6187){return function(_0xcaab2a){if(_0x1f6187[_0x11a7('0xc')]&&!_0x1f6187[_0x11a7('0xc')][_0x39b37c]){logger['info'](_0x11a7('0xd'),_0x39b37c);return _0xcaab2a[_0x11a7('0xe')]();}var _0x15d5dd=[];for(var _0x277a7e=0x0;_0x277a7e<_0x15818c['length'];_0x277a7e+=0x1){_0x15d5dd[_0x11a7('0xf')](request(_0x11a7('0x10'),{'command':util[_0x11a7('0x11')](_0x11a7('0x12'),_0x15818c[_0x277a7e])})[_0x11a7('0x6')](function(_0x5b2aac){return _0x5b2aac&&_0x5b2aac[_0x11a7('0x8')]&&_0x5b2aac[_0x11a7('0x8')][_0x11a7('0x13')](_0x11a7('0x14'))>=0x0?!![]:![];})[_0x11a7('0xa')](function(_0x1e5899){logger[_0x11a7('0x7')](_0x11a7('0x15'),_0x39b37c,_0x15818c[_0x277a7e]);}));}BPromise[_0x11a7('0x16')](_0x15d5dd)[_0x11a7('0x6')](function(_0x12d9e8){var _0x3f6c04=_[_0x11a7('0x17')](_0x12d9e8);logger['info'](_0x11a7('0x18'),_0x39b37c,_0x15818c[_0x11a7('0x19')](_0x11a7('0x1a')),_0x3f6c04);_0xcaab2a[_0x11a7('0x1b')](_0x3f6c04);})[_0x11a7('0xa')](function(_0x1eddc3){console['log'](_0x1eddc3);logger[_0x11a7('0x7')](_0x11a7('0x18'),_0x39b37c,_0x15818c[_0x11a7('0x19')](_0x11a7('0x1a')),_0x1eddc3['stack']);_0xcaab2a[_0x11a7('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b9fd595..488d7fb 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 _0xb5d1=['agentcalled','agentcalledAt','now','called','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','error','forIn','includes','abandoned','holdtime','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','complete','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf','splice','diffTime','agent','util','./utils','format','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid'];(function(_0x51e91e,_0x3554aa){var _0x12c6a1=function(_0xe0e608){while(--_0xe0e608){_0x51e91e['push'](_0x51e91e['shift']());}};_0x12c6a1(++_0x3554aa);}(_0xb5d1,0x147));var _0x1b5d=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0xb5d1[_0x498b38];return _0x10feb7;};'use strict';var _=require('lodash');var util=require(_0x1b5d('0x0'));var utils=require(_0x1b5d('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x172d5f,_0x4ba3c3){utils['info'](util[_0x1b5d('0x2')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x172d5f['uniqueid'],_0x172d5f[_0x1b5d('0x3')],_0x172d5f[_0x1b5d('0x4')],_0x172d5f[_0x1b5d('0x5')],_0x172d5f['interface'],_0x172d5f['calleridnum'],_0x172d5f[_0x1b5d('0x6')],_0x172d5f[_0x1b5d('0x7')]));if(_0x172d5f[_0x1b5d('0x4')]){utils[_0x1b5d('0x8')](_0x172d5f['queue'])['then'](function(_0x5eda61){if(_0x5eda61){_0x172d5f['type']=_0x5eda61[_0x1b5d('0x9')];_0x172d5f[_0x1b5d('0xa')]=_0x172d5f[_0x1b5d('0xb')]?_0x5eda61[_0x1b5d('0xc')]:![];_0x172d5f[_0x1b5d('0xd')]=_0x172d5f[_0x1b5d('0xa')]?_0x5eda61['acwTimeout']:0x0;}utils[_0x1b5d('0xe')](_0x1b5d('0xf'),_0x172d5f);});}else{utils[_0x1b5d('0xe')](_0x1b5d('0xf'),_0x172d5f);}if(_0x4ba3c3){delete transfers[_0x172d5f[_0x1b5d('0x10')]];}else{delete agents[_0x172d5f[_0x1b5d('0x11')]];}}exports[_0x1b5d('0x12')]=function(_0x25f320){try{agents[_0x25f320[_0x1b5d('0x11')]]=_0x25f320;agents[_0x25f320['destuniqueid']][_0x1b5d('0x13')]=utils[_0x1b5d('0x14')]();agents[_0x25f320[_0x1b5d('0x11')]][_0x1b5d('0x7')]=_0x1b5d('0x15');agents[_0x25f320[_0x1b5d('0x11')]][_0x1b5d('0x6')]=null;agents[_0x25f320[_0x1b5d('0x11')]]['connectedlinename']=null;}catch(_0x5a0b0e){utils['error'](_0x5a0b0e[_0x1b5d('0x16')]);}};exports[_0x1b5d('0x17')]=function(_0x30c3db){try{if(!_[_0x1b5d('0x18')](agents[_0x30c3db[_0x1b5d('0x11')]])){agents[_0x30c3db[_0x1b5d('0x11')]][_0x1b5d('0x17')]=!![];agents[_0x30c3db[_0x1b5d('0x11')]][_0x1b5d('0x19')]=utils['now']();agents[_0x30c3db['destuniqueid']][_0x1b5d('0x7')]=_0x1b5d('0x1a');agents[_0x30c3db['destuniqueid']][_0x1b5d('0x1b')]=_0x1b5d('0x1a');agents[_0x30c3db['destuniqueid']]['holdtime']=_0x30c3db[_0x1b5d('0x1c')]?parseInt(_0x30c3db[_0x1b5d('0x1c')])/0x3e8:0x0;agents[_0x30c3db['destuniqueid']][_0x1b5d('0x1d')]=0x0;unanswered[_0x1b5d('0x1e')](_0x30c3db[_0x1b5d('0x11')]);}}catch(_0x2c717f){utils[_0x1b5d('0x1f')](_0x2c717f[_0x1b5d('0x16')]);}};exports['queuecallerabandon']=function(_0x128ec8){try{_[_0x1b5d('0x20')](agents,function(_0x150399,_0x2fc5b5){if(_0x150399[_0x1b5d('0x10')]==_0x128ec8[_0x1b5d('0x10')]&&!_[_0x1b5d('0x21')](unanswered,_0x150399[_0x1b5d('0x11')])){_0x150399[_0x1b5d('0x17')]=!![];_0x150399['agentringnoanswerAt']=utils[_0x1b5d('0x14')]();_0x150399[_0x1b5d('0x7')]=_0x1b5d('0x22');_0x150399[_0x1b5d('0x1b')]=_0x1b5d('0x22');_0x150399[_0x1b5d('0x23')]=_0x128ec8[_0x1b5d('0x23')];_0x150399[_0x1b5d('0x1d')]=0x0;writeDB(_0x150399);}});}catch(_0x5bf231){utils['error'](_0x5bf231['stack']);}};exports[_0x1b5d('0x24')]=function(_0x30a15e){try{if(agents[_0x30a15e[_0x1b5d('0x11')]]){agents[_0x30a15e[_0x1b5d('0x11')]][_0x1b5d('0x25')]=utils[_0x1b5d('0x14')]();agents[_0x30a15e[_0x1b5d('0x11')]][_0x1b5d('0x6')]=_0x30a15e['connectedlinenum'];agents[_0x30a15e[_0x1b5d('0x11')]][_0x1b5d('0x26')]=_0x30a15e[_0x1b5d('0x26')];agents[_0x30a15e[_0x1b5d('0x11')]][_0x1b5d('0x23')]=_0x30a15e['ringtime'];agents[_0x30a15e[_0x1b5d('0x11')]]['lastevent']='connect';_[_0x1b5d('0x20')](agents,function(_0x7dcfb1,_0x4dc9c0){if(_0x7dcfb1[_0x1b5d('0x11')]!=_0x30a15e['destuniqueid']&&_0x7dcfb1[_0x1b5d('0x10')]==_0x30a15e['uniqueid']){_0x7dcfb1['talktime']=0x0;_0x7dcfb1[_0x1b5d('0x23')]=_0x30a15e[_0x1b5d('0x1c')];_0x7dcfb1[_0x1b5d('0x17')]=!![];_0x7dcfb1['agentringnoanswerAt']=utils[_0x1b5d('0x14')]();_0x7dcfb1['lastevent']=_0x1b5d('0x27');_0x7dcfb1['reason']=_0x1b5d('0x27');_0x7dcfb1['answeredelsewheredestinationuniqueid']=_0x30a15e[_0x1b5d('0x11')];_0x7dcfb1[_0x1b5d('0x28')]=_0x30a15e[_0x1b5d('0x5')];writeDB(_0x7dcfb1);}});}}catch(_0x1a6891){utils[_0x1b5d('0x1f')](_0x1a6891[_0x1b5d('0x16')]);}};exports[_0x1b5d('0xb')]=function(_0x3c328b){try{if(!_[_0x1b5d('0x18')](agents[_0x3c328b[_0x1b5d('0x11')]])){agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0xb')]=!![];agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x29')]=utils[_0x1b5d('0x14')]();agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x1d')]=utils['diffTime'](agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x29')],agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x25')]);agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x1b')]=_0x3c328b[_0x1b5d('0x1b')];agents[_0x3c328b[_0x1b5d('0x11')]][_0x1b5d('0x7')]=_0x1b5d('0x2a');writeDB(agents[_0x3c328b['destuniqueid']]);}}catch(_0x458a41){utils[_0x1b5d('0x1f')](_0x458a41[_0x1b5d('0x16')]);}};exports['blindtransfer']=function(_0x29e0ad){try{if(!_[_0x1b5d('0x18')](agents[_0x29e0ad[_0x1b5d('0x2b')]])){agents[_0x29e0ad['transfereruniqueid']][_0x1b5d('0x2c')]=!![];agents[_0x29e0ad[_0x1b5d('0x2b')]][_0x1b5d('0x2d')]=_0x1b5d('0x2e');agents[_0x29e0ad['transfereruniqueid']][_0x1b5d('0x2f')]=_0x29e0ad['extension'];agents[_0x29e0ad[_0x1b5d('0x2b')]][_0x1b5d('0x30')]=agents[_0x29e0ad[_0x1b5d('0x2b')]][_0x1b5d('0x10')];}}catch(_0x570414){utils[_0x1b5d('0x1f')](_0x570414[_0x1b5d('0x16')]);}};exports[_0x1b5d('0x31')]=function(_0x351634){try{if(_0x351634[_0x1b5d('0x32')]==_0x351634[_0x1b5d('0x33')]){if(!_[_0x1b5d('0x18')](agents[_0x351634[_0x1b5d('0x34')]])){agents[_0x351634[_0x1b5d('0x34')]][_0x1b5d('0x2c')]=!![];agents[_0x351634['secondtransfereruniqueid']][_0x1b5d('0x2d')]=_0x1b5d('0x35');agents[_0x351634[_0x1b5d('0x34')]][_0x1b5d('0x2f')]=_0x351634[_0x1b5d('0x36')];agents[_0x351634[_0x1b5d('0x34')]]['transferuniqueid']=_0x351634[_0x1b5d('0x32')];}if(_0x351634['transfereeuniqueid']&&agents[_0x351634['transfereeuniqueid']]){agents[_0x351634[_0x1b5d('0x37')]][_0x1b5d('0x38')]=0x1;transfers[_0x351634['transfereeuniqueid']]=_[_0x1b5d('0x39')](agents[_0x351634[_0x1b5d('0x37')]]);transfers[_0x351634[_0x1b5d('0x37')]]['calleridnum']=agents[_0x351634[_0x1b5d('0x34')]][_0x1b5d('0x3a')];transfers[_0x351634['transfereeuniqueid']][_0x1b5d('0x3b')]=agents[_0x351634[_0x1b5d('0x34')]]['calleridname'];transfers[_0x351634[_0x1b5d('0x37')]][_0x1b5d('0x13')]=utils['now']();transfers[_0x351634['transfereeuniqueid']][_0x1b5d('0x25')]=utils[_0x1b5d('0x14')]();transfers[_0x351634[_0x1b5d('0x37')]][_0x1b5d('0x23')]=0x0;transfers[_0x351634[_0x1b5d('0x37')]]['agententerreason']=0x2;}}else if(_0x351634[_0x1b5d('0x34')]==_0x351634['secondtransfererlinkedid']){if(!_[_0x1b5d('0x18')](agents[_0x351634['origtransfereruniqueid']])){agents[_0x351634[_0x1b5d('0x32')]]['transfer']=!![];agents[_0x351634['origtransfereruniqueid']][_0x1b5d('0x2d')]=_0x1b5d('0x35');agents[_0x351634[_0x1b5d('0x32')]][_0x1b5d('0x2f')]=_0x351634[_0x1b5d('0x3c')];agents[_0x351634['origtransfereruniqueid']][_0x1b5d('0x30')]=_0x351634[_0x1b5d('0x34')];}if(_0x351634[_0x1b5d('0x3d')]&&agents[_0x351634[_0x1b5d('0x3d')]]){agents[_0x351634[_0x1b5d('0x3d')]][_0x1b5d('0x38')]=0x1;transfers[_0x351634[_0x1b5d('0x3d')]]=_['clone'](agents[_0x351634[_0x1b5d('0x3d')]]);transfers[_0x351634[_0x1b5d('0x3d')]][_0x1b5d('0x3a')]=agents[_0x351634[_0x1b5d('0x32')]][_0x1b5d('0x3a')];transfers[_0x351634['transfertargetuniqueid']][_0x1b5d('0x3b')]=agents[_0x351634[_0x1b5d('0x32')]][_0x1b5d('0x3b')];transfers[_0x351634[_0x1b5d('0x3d')]]['agentcalledAt']=utils[_0x1b5d('0x14')]();transfers[_0x351634[_0x1b5d('0x3d')]]['agentconnectAt']=utils[_0x1b5d('0x14')]();transfers[_0x351634[_0x1b5d('0x3d')]][_0x1b5d('0x23')]=0x0;transfers[_0x351634['transfertargetuniqueid']][_0x1b5d('0x38')]=0x2;}}}catch(_0x24fd31){utils[_0x1b5d('0x1f')](_0x24fd31[_0x1b5d('0x16')]);}};exports[_0x1b5d('0x3e')]=function(_0x3c0d26){try{if(agents[_0x3c0d26[_0x1b5d('0x10')]]&&agents[_0x3c0d26['uniqueid']][_0x1b5d('0x1b')]===_0x1b5d('0x1a')){if(_0x3c0d26[_0x1b5d('0x3f')]==='21'){agents[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x1b')]=_0x1b5d('0x40');agents[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x7')]='rejected';}writeDB(agents[_0x3c0d26[_0x1b5d('0x10')]]);var _0x2a07a9=unanswered[_0x1b5d('0x41')](_0x3c0d26[_0x1b5d('0x10')]);if(_0x2a07a9>-0x1)unanswered[_0x1b5d('0x42')](_0x2a07a9,0x1);}if(transfers[_0x3c0d26[_0x1b5d('0x10')]]){transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0xb')]=!![];transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x29')]=utils[_0x1b5d('0x14')]();transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x1d')]=utils[_0x1b5d('0x43')](transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x29')],transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x25')]);transfers[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x1b')]=_0x1b5d('0x44');transfers[_0x3c0d26['uniqueid']][_0x1b5d('0x7')]=_0x1b5d('0x2a');writeDB(transfers[_0x3c0d26[_0x1b5d('0x10')]],!![]);}if(agents[_0x3c0d26[_0x1b5d('0x10')]]&&agents[_0x3c0d26['uniqueid']]['agentconnectAt']){agents[_0x3c0d26[_0x1b5d('0x10')]]['agentcomplete']=!![];agents[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x29')]=utils['now']();agents[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x1d')]=utils[_0x1b5d('0x43')](agents[_0x3c0d26[_0x1b5d('0x10')]]['agentcompleteAt'],agents[_0x3c0d26[_0x1b5d('0x10')]][_0x1b5d('0x25')]);agents[_0x3c0d26[_0x1b5d('0x10')]]['reason']=agents[_0x3c0d26[_0x1b5d('0x10')]]['transfer']?_0x1b5d('0x2c'):_0x1b5d('0x44');agents[_0x3c0d26[_0x1b5d('0x10')]]['lastevent']=_0x1b5d('0x2a');writeDB(agents[_0x3c0d26['uniqueid']]);}}catch(_0x147ad8){utils[_0x1b5d('0x1f')](_0x147ad8[_0x1b5d('0x16')]);}}; \ No newline at end of file +var _0x377a=['complete','blindtransfer','transfereruniqueid','transfer','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','rejected','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','now','called','connectedlinename','error','stack','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','includes','abandoned','holdtime','agentconnect','agentconnectAt','forIn','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime'];(function(_0x37f66a,_0x43d36c){var _0x3478a1=function(_0x4386e5){while(--_0x4386e5){_0x37f66a['push'](_0x37f66a['shift']());}};_0x3478a1(++_0x43d36c);}(_0x377a,0xe4));var _0xa377=function(_0x2fba2b,_0x4977bf){_0x2fba2b=_0x2fba2b-0x0;var _0x438896=_0x377a[_0x2fba2b];return _0x438896;};'use strict';var _=require('lodash');var util=require(_0xa377('0x0'));var utils=require(_0xa377('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x409dcb,_0x15dffe){utils[_0xa377('0x2')](util['format'](_0xa377('0x3'),_0x409dcb[_0xa377('0x4')],_0x409dcb[_0xa377('0x5')],_0x409dcb[_0xa377('0x6')],_0x409dcb[_0xa377('0x7')],_0x409dcb[_0xa377('0x8')],_0x409dcb[_0xa377('0x9')],_0x409dcb[_0xa377('0xa')],_0x409dcb[_0xa377('0xb')]));if(_0x409dcb['queue']){utils[_0xa377('0xc')](_0x409dcb[_0xa377('0x6')])['then'](function(_0x3d2b83){if(_0x3d2b83){_0x409dcb[_0xa377('0xd')]=_0x3d2b83[_0xa377('0xd')];_0x409dcb[_0xa377('0xe')]=_0x409dcb[_0xa377('0xf')]?_0x3d2b83[_0xa377('0x10')]:![];_0x409dcb[_0xa377('0x11')]=_0x409dcb['agentacw']?_0x3d2b83[_0xa377('0x12')]:0x0;}utils[_0xa377('0x13')]('CreateVoiceAgentReport',_0x409dcb);});}else{utils[_0xa377('0x13')](_0xa377('0x14'),_0x409dcb);}if(_0x15dffe){delete transfers[_0x409dcb[_0xa377('0x4')]];}else{delete agents[_0x409dcb['destuniqueid']];}}exports[_0xa377('0x15')]=function(_0x2e0cd9){try{agents[_0x2e0cd9['destuniqueid']]=_0x2e0cd9;agents[_0x2e0cd9[_0xa377('0x16')]]['agentcalledAt']=utils[_0xa377('0x17')]();agents[_0x2e0cd9[_0xa377('0x16')]]['lastevent']=_0xa377('0x18');agents[_0x2e0cd9[_0xa377('0x16')]][_0xa377('0xa')]=null;agents[_0x2e0cd9[_0xa377('0x16')]][_0xa377('0x19')]=null;}catch(_0x18a1fa){utils[_0xa377('0x1a')](_0x18a1fa[_0xa377('0x1b')]);}};exports['agentringnoanswer']=function(_0x249ca3){try{if(!_[_0xa377('0x1c')](agents[_0x249ca3[_0xa377('0x16')]])){agents[_0x249ca3[_0xa377('0x16')]][_0xa377('0x1d')]=!![];agents[_0x249ca3['destuniqueid']][_0xa377('0x1e')]=utils[_0xa377('0x17')]();agents[_0x249ca3[_0xa377('0x16')]][_0xa377('0xb')]=_0xa377('0x1f');agents[_0x249ca3[_0xa377('0x16')]][_0xa377('0x20')]='timeout';agents[_0x249ca3['destuniqueid']]['holdtime']=_0x249ca3['ringtime']?parseInt(_0x249ca3[_0xa377('0x21')])/0x3e8:0x0;agents[_0x249ca3[_0xa377('0x16')]]['talktime']=0x0;unanswered[_0xa377('0x22')](_0x249ca3['destuniqueid']);}}catch(_0x1b78c2){utils['error'](_0x1b78c2[_0xa377('0x1b')]);}};exports[_0xa377('0x23')]=function(_0xddab84){try{_['forIn'](agents,function(_0x16f5a0,_0x871c0f){if(_0x16f5a0['uniqueid']==_0xddab84[_0xa377('0x4')]&&!_[_0xa377('0x24')](unanswered,_0x16f5a0['destuniqueid'])){_0x16f5a0[_0xa377('0x1d')]=!![];_0x16f5a0[_0xa377('0x1e')]=utils['now']();_0x16f5a0[_0xa377('0xb')]=_0xa377('0x25');_0x16f5a0['reason']=_0xa377('0x25');_0x16f5a0[_0xa377('0x26')]=_0xddab84[_0xa377('0x26')];_0x16f5a0['talktime']=0x0;writeDB(_0x16f5a0);}});}catch(_0x199bde){utils[_0xa377('0x1a')](_0x199bde[_0xa377('0x1b')]);}};exports[_0xa377('0x27')]=function(_0x4163c0){try{if(agents[_0x4163c0[_0xa377('0x16')]]){agents[_0x4163c0['destuniqueid']][_0xa377('0x28')]=utils['now']();agents[_0x4163c0[_0xa377('0x16')]]['connectedlinenum']=_0x4163c0[_0xa377('0xa')];agents[_0x4163c0[_0xa377('0x16')]][_0xa377('0x19')]=_0x4163c0[_0xa377('0x19')];agents[_0x4163c0[_0xa377('0x16')]][_0xa377('0x26')]=_0x4163c0[_0xa377('0x21')];agents[_0x4163c0[_0xa377('0x16')]]['lastevent']='connect';_[_0xa377('0x29')](agents,function(_0x55328f,_0x48cf53){if(_0x55328f[_0xa377('0x16')]!=_0x4163c0[_0xa377('0x16')]&&_0x55328f[_0xa377('0x4')]==_0x4163c0[_0xa377('0x4')]){_0x55328f[_0xa377('0x2a')]=0x0;_0x55328f[_0xa377('0x26')]=_0x4163c0['ringtime'];_0x55328f[_0xa377('0x1d')]=!![];_0x55328f[_0xa377('0x1e')]=utils[_0xa377('0x17')]();_0x55328f[_0xa377('0xb')]=_0xa377('0x2b');_0x55328f[_0xa377('0x20')]=_0xa377('0x2b');_0x55328f[_0xa377('0x2c')]=_0x4163c0['destuniqueid'];_0x55328f[_0xa377('0x2d')]=_0x4163c0[_0xa377('0x7')];writeDB(_0x55328f);}});}}catch(_0xd18d82){utils[_0xa377('0x1a')](_0xd18d82[_0xa377('0x1b')]);}};exports[_0xa377('0xf')]=function(_0x23d6dc){try{if(!_[_0xa377('0x1c')](agents[_0x23d6dc[_0xa377('0x16')]])){agents[_0x23d6dc['destuniqueid']][_0xa377('0xf')]=!![];agents[_0x23d6dc[_0xa377('0x16')]][_0xa377('0x2e')]=utils[_0xa377('0x17')]();agents[_0x23d6dc['destuniqueid']][_0xa377('0x2a')]=utils[_0xa377('0x2f')](agents[_0x23d6dc[_0xa377('0x16')]][_0xa377('0x2e')],agents[_0x23d6dc[_0xa377('0x16')]][_0xa377('0x28')]);agents[_0x23d6dc['destuniqueid']][_0xa377('0x20')]=_0x23d6dc[_0xa377('0x20')];agents[_0x23d6dc[_0xa377('0x16')]][_0xa377('0xb')]=_0xa377('0x30');writeDB(agents[_0x23d6dc[_0xa377('0x16')]]);}}catch(_0x325a71){utils[_0xa377('0x1a')](_0x325a71['stack']);}};exports[_0xa377('0x31')]=function(_0x58d73b){try{if(!_['isNil'](agents[_0x58d73b['transfereruniqueid']])){agents[_0x58d73b[_0xa377('0x32')]][_0xa377('0x33')]=!![];agents[_0x58d73b[_0xa377('0x32')]]['transfertype']='blind';agents[_0x58d73b[_0xa377('0x32')]][_0xa377('0x34')]=_0x58d73b[_0xa377('0x35')];agents[_0x58d73b['transfereruniqueid']][_0xa377('0x36')]=agents[_0x58d73b['transfereruniqueid']]['uniqueid'];}}catch(_0x51a704){utils[_0xa377('0x1a')](_0x51a704[_0xa377('0x1b')]);}};exports['attendedtransfer']=function(_0x233ec2){try{if(_0x233ec2[_0xa377('0x37')]==_0x233ec2[_0xa377('0x38')]){if(!_[_0xa377('0x1c')](agents[_0x233ec2['secondtransfereruniqueid']])){agents[_0x233ec2[_0xa377('0x39')]][_0xa377('0x33')]=!![];agents[_0x233ec2['secondtransfereruniqueid']][_0xa377('0x3a')]='ATTENDED';agents[_0x233ec2[_0xa377('0x39')]]['transferexten']=_0x233ec2[_0xa377('0x3b')];agents[_0x233ec2[_0xa377('0x39')]][_0xa377('0x36')]=_0x233ec2['origtransfereruniqueid'];}if(_0x233ec2[_0xa377('0x3c')]&&agents[_0x233ec2['transfereeuniqueid']]){agents[_0x233ec2['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x233ec2['transfereeuniqueid']]=_[_0xa377('0x3d')](agents[_0x233ec2[_0xa377('0x3c')]]);transfers[_0x233ec2[_0xa377('0x3c')]][_0xa377('0x9')]=agents[_0x233ec2[_0xa377('0x39')]][_0xa377('0x9')];transfers[_0x233ec2[_0xa377('0x3c')]][_0xa377('0x3e')]=agents[_0x233ec2[_0xa377('0x39')]][_0xa377('0x3e')];transfers[_0x233ec2['transfereeuniqueid']][_0xa377('0x3f')]=utils[_0xa377('0x17')]();transfers[_0x233ec2[_0xa377('0x3c')]][_0xa377('0x28')]=utils[_0xa377('0x17')]();transfers[_0x233ec2[_0xa377('0x3c')]]['holdtime']=0x0;transfers[_0x233ec2[_0xa377('0x3c')]][_0xa377('0x40')]=0x2;}}else if(_0x233ec2['secondtransfereruniqueid']==_0x233ec2['secondtransfererlinkedid']){if(!_[_0xa377('0x1c')](agents[_0x233ec2[_0xa377('0x37')]])){agents[_0x233ec2[_0xa377('0x37')]]['transfer']=!![];agents[_0x233ec2[_0xa377('0x37')]][_0xa377('0x3a')]='ATTENDED';agents[_0x233ec2['origtransfereruniqueid']][_0xa377('0x34')]=_0x233ec2[_0xa377('0x41')];agents[_0x233ec2['origtransfereruniqueid']][_0xa377('0x36')]=_0x233ec2[_0xa377('0x39')];}if(_0x233ec2['transfertargetuniqueid']&&agents[_0x233ec2[_0xa377('0x42')]]){agents[_0x233ec2['transfertargetuniqueid']][_0xa377('0x40')]=0x1;transfers[_0x233ec2[_0xa377('0x42')]]=_[_0xa377('0x3d')](agents[_0x233ec2[_0xa377('0x42')]]);transfers[_0x233ec2[_0xa377('0x42')]][_0xa377('0x9')]=agents[_0x233ec2[_0xa377('0x37')]][_0xa377('0x9')];transfers[_0x233ec2[_0xa377('0x42')]][_0xa377('0x3e')]=agents[_0x233ec2['origtransfereruniqueid']][_0xa377('0x3e')];transfers[_0x233ec2['transfertargetuniqueid']][_0xa377('0x3f')]=utils[_0xa377('0x17')]();transfers[_0x233ec2[_0xa377('0x42')]]['agentconnectAt']=utils[_0xa377('0x17')]();transfers[_0x233ec2['transfertargetuniqueid']][_0xa377('0x26')]=0x0;transfers[_0x233ec2['transfertargetuniqueid']][_0xa377('0x40')]=0x2;}}}catch(_0x172c61){utils[_0xa377('0x1a')](_0x172c61[_0xa377('0x1b')]);}};exports[_0xa377('0x43')]=function(_0x2b71a3){try{if(agents[_0x2b71a3[_0xa377('0x4')]]&&agents[_0x2b71a3[_0xa377('0x4')]]['reason']===_0xa377('0x1f')){if(_0x2b71a3['cause']==='21'){agents[_0x2b71a3[_0xa377('0x4')]][_0xa377('0x20')]=_0xa377('0x44');agents[_0x2b71a3[_0xa377('0x4')]][_0xa377('0xb')]=_0xa377('0x44');}writeDB(agents[_0x2b71a3[_0xa377('0x4')]]);var _0x10bc03=unanswered['indexOf'](_0x2b71a3[_0xa377('0x4')]);if(_0x10bc03>-0x1)unanswered['splice'](_0x10bc03,0x1);}if(transfers[_0x2b71a3['uniqueid']]){transfers[_0x2b71a3[_0xa377('0x4')]]['agentcomplete']=!![];transfers[_0x2b71a3['uniqueid']][_0xa377('0x2e')]=utils[_0xa377('0x17')]();transfers[_0x2b71a3[_0xa377('0x4')]]['talktime']=utils['diffTime'](transfers[_0x2b71a3['uniqueid']][_0xa377('0x2e')],transfers[_0x2b71a3[_0xa377('0x4')]][_0xa377('0x28')]);transfers[_0x2b71a3[_0xa377('0x4')]][_0xa377('0x20')]='agent';transfers[_0x2b71a3[_0xa377('0x4')]][_0xa377('0xb')]='complete';writeDB(transfers[_0x2b71a3[_0xa377('0x4')]],!![]);}if(agents[_0x2b71a3['uniqueid']]&&agents[_0x2b71a3[_0xa377('0x4')]]['agentconnectAt']){agents[_0x2b71a3['uniqueid']][_0xa377('0xf')]=!![];agents[_0x2b71a3[_0xa377('0x4')]]['agentcompleteAt']=utils[_0xa377('0x17')]();agents[_0x2b71a3['uniqueid']][_0xa377('0x2a')]=utils[_0xa377('0x2f')](agents[_0x2b71a3['uniqueid']][_0xa377('0x2e')],agents[_0x2b71a3['uniqueid']]['agentconnectAt']);agents[_0x2b71a3[_0xa377('0x4')]]['reason']=agents[_0x2b71a3[_0xa377('0x4')]][_0xa377('0x33')]?_0xa377('0x33'):'agent';agents[_0x2b71a3[_0xa377('0x4')]][_0xa377('0xb')]=_0xa377('0x30');writeDB(agents[_0x2b71a3[_0xa377('0x4')]]);}}catch(_0x57586b){utils[_0xa377('0x1a')](_0x57586b[_0xa377('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index c00d289..6b5efad 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 _0xc032=['lastapplication','lastdata','xmd-contactid','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','noop','gotoif','application','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','then','UserId','CreateVoiceCallReport','request','newchannel','OutgoingSpoolFailed','calleridnum','exten','context','now','error','stack','newstate','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue'];(function(_0xf44608,_0x4d8e55){var _0x129f91=function(_0x2dda9a){while(--_0x2dda9a){_0xf44608['push'](_0xf44608['shift']());}};_0x129f91(++_0x4d8e55);}(_0xc032,0x1e6));var _0x2c03=function(_0x529097,_0x50777a){_0x529097=_0x529097-0x0;var _0x3e525a=_0xc032[_0x529097];return _0x3e525a;};'use strict';var _=require('lodash');var util=require(_0x2c03('0x0'));var utils=require(_0x2c03('0x1'));var dispositions=[_0x2c03('0x2'),_0x2c03('0x3'),_0x2c03('0x3'),_0x2c03('0x2'),_0x2c03('0x2'),_0x2c03('0x2'),_0x2c03('0x4'),_0x2c03('0x5'),'FAILED','FAILED',_0x2c03('0x3')];var channels={};function writeDB(_0x50e448){utils['info'](util['format']('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x50e448[_0x2c03('0x6')],_0x50e448[_0x2c03('0x7')],_0x50e448[_0x2c03('0x8')],_0x50e448[_0x2c03('0x9')],_0x50e448[_0x2c03('0xa')],_0x50e448[_0x2c03('0xb')],_0x50e448[_0x2c03('0xc')],_0x50e448[_0x2c03('0xd')]));if(_0x50e448[_0x2c03('0x9')]){utils['getUserByInternal'](_0x50e448[_0x2c03('0x9')])[_0x2c03('0xe')](function(_0x59cecb){if(_0x59cecb){_0x50e448[_0x2c03('0xf')]=_0x59cecb['id'];}utils['request'](_0x2c03('0x10'),_0x50e448);});}else{utils[_0x2c03('0x11')](_0x2c03('0x10'),_0x50e448);}if(channels[_0x50e448[_0x2c03('0x6')]]){delete channels[_0x50e448[_0x2c03('0x6')]];}}exports[_0x2c03('0x12')]=function(_0x3c86eb){try{if(_0x3c86eb[_0x2c03('0x6')]==_0x3c86eb['linkedid']&&_0x3c86eb[_0x2c03('0x7')]!=_0x2c03('0x13')){channels[_0x3c86eb['uniqueid']]={'uniqueid':_0x3c86eb[_0x2c03('0x6')],'accountcode':_0x3c86eb[_0x2c03('0x9')],'source':_0x3c86eb[_0x2c03('0x14')],'destination':_0x3c86eb[_0x2c03('0x15')],'destinationcontext':_0x3c86eb[_0x2c03('0x16')],'channel':_0x3c86eb[_0x2c03('0x7')],'starttime':utils[_0x2c03('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2c03('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x5b0209){utils[_0x2c03('0x18')](_0x5b0209[_0x2c03('0x19')]);}};exports[_0x2c03('0x1a')]=function(_0x462b91){try{if(!_[_0x2c03('0x1b')](channels[_0x462b91[_0x2c03('0x6')]])&&_0x462b91[_0x2c03('0x1c')]==0x6){if(_[_0x2c03('0x1b')](channels[_0x462b91[_0x2c03('0x6')]][_0x2c03('0x1d')])){channels[_0x462b91['uniqueid']][_0x2c03('0x1d')]=utils[_0x2c03('0x17')]();}}else if(!_[_0x2c03('0x1b')](channels[_0x462b91[_0x2c03('0x1e')]])&&_0x462b91[_0x2c03('0x1c')]==0x6&&_0x462b91[_0x2c03('0x16')]!=_0x2c03('0x1f')){channels[_0x462b91[_0x2c03('0x1e')]][_0x2c03('0x9')]=_0x462b91[_0x2c03('0x9')];channels[_0x462b91[_0x2c03('0x1e')]][_0x2c03('0x20')]=_0x462b91[_0x2c03('0x7')];if(_[_0x2c03('0x1b')](channels[_0x462b91[_0x2c03('0x1e')]][_0x2c03('0x21')])){channels[_0x462b91['linkedid']][_0x2c03('0x21')]=utils[_0x2c03('0x17')]();}channels[_0x462b91[_0x2c03('0x1e')]][_0x2c03('0xd')]=dispositions[_['toNumber'](_0x462b91[_0x2c03('0x1c')])]||'ANSWERED';}}catch(_0x2ebdda){utils[_0x2c03('0x18')](_0x2ebdda[_0x2c03('0x19')]);}};exports['hangup']=function(_0x26f540){try{if(!_[_0x2c03('0x1b')](channels[_0x26f540[_0x2c03('0x6')]])){if(_[_0x2c03('0x1b')](channels[_0x26f540[_0x2c03('0x6')]]['callerid'])){channels[_0x26f540[_0x2c03('0x6')]][_0x2c03('0xc')]=_0x26f540[_0x2c03('0x22')]+'\x20<'+_0x26f540[_0x2c03('0x14')]+'>';}channels[_0x26f540[_0x2c03('0x6')]][_0x2c03('0x23')]=utils['now']();channels[_0x26f540[_0x2c03('0x6')]][_0x2c03('0x24')]=utils[_0x2c03('0x25')](channels[_0x26f540['uniqueid']][_0x2c03('0x23')],channels[_0x26f540[_0x2c03('0x6')]][_0x2c03('0x26')]);channels[_0x26f540[_0x2c03('0x6')]][_0x2c03('0x27')]=channels[_0x26f540['uniqueid']][_0x2c03('0x21')]?utils[_0x2c03('0x25')](channels[_0x26f540['uniqueid']][_0x2c03('0x23')],channels[_0x26f540['uniqueid']]['answertime']):0x0;writeDB(channels[_0x26f540[_0x2c03('0x6')]]);}}catch(_0x5ba75d){utils[_0x2c03('0x18')](_0x5ba75d[_0x2c03('0x19')]);}};exports[_0x2c03('0x28')]=function(_0x97b9a){try{if(!_['isNil'](channels[_0x97b9a[_0x2c03('0x29')]])){if(channels[_0x97b9a['localtwolinkedid']][_0x2c03('0x7')]==_0x97b9a[_0x2c03('0x2a')]){channels[_0x97b9a[_0x2c03('0x29')]]['destinationchannel']=_0x97b9a[_0x2c03('0x2b')];channels[_0x97b9a[_0x2c03('0x29')]][_0x2c03('0x2c')]=_0x2c03('0x2d');}else if(channels[_0x97b9a[_0x2c03('0x29')]][_0x2c03('0x7')]=_0x97b9a['transfertargetchannel']){channels[_0x97b9a[_0x2c03('0x29')]][_0x2c03('0x20')]=_0x97b9a[_0x2c03('0x2e')];channels[_0x97b9a['localtwolinkedid']][_0x2c03('0x2c')]=_0x2c03('0x2d');}}}catch(_0x1404fd){utils[_0x2c03('0x18')](_0x1404fd[_0x2c03('0x19')]);}};exports[_0x2c03('0x2f')]=function(_0x397174){try{if(!_['isNil'](channels[_0x397174[_0x2c03('0x6')]])){channels[_0x397174[_0x2c03('0x6')]][_0x2c03('0x30')]=utils['now']();}}catch(_0x13f345){utils['error'](_0x13f345['stack']);}};exports[_0x2c03('0x31')]=function(_0x9b0512){try{if(!_['isNil'](channels[_0x9b0512[_0x2c03('0x6')]])){if(!_[_0x2c03('0x1b')](channels[_0x9b0512[_0x2c03('0x6')]][_0x2c03('0x30')])){channels[_0x9b0512[_0x2c03('0x6')]]['mohtime']+=utils[_0x2c03('0x25')](utils[_0x2c03('0x17')](),channels[_0x9b0512[_0x2c03('0x6')]][_0x2c03('0x30')]);delete channels[_0x9b0512['uniqueid']]['musiconholdstartAt'];}}}catch(_0xd7ce9){utils['error'](_0xd7ce9['stack']);}};exports[_0x2c03('0x32')]=function(_0x969c4c){try{if(!_[_0x2c03('0x1b')](channels[_0x969c4c[_0x2c03('0x6')]])){if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x34')])){channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0xa')]=_0x969c4c[_0x2c03('0x35')];}if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x36')])){channels[_0x969c4c['uniqueid']][_0x2c03('0xb')]=_0x969c4c[_0x2c03('0x35')];channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0xc')]='\x22'+_0x969c4c['value']+_0x2c03('0x37')+_0x969c4c[_0x2c03('0x35')]+'>';}if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x38')])||!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x39')])){channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0xc')]=_0x969c4c[_0x2c03('0x35')];}if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x3a')])||!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x3b')])){channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0x3c')]='Queue';channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0x3d')]=_0x969c4c[_0x2c03('0x35')];channels[_0x969c4c[_0x2c03('0x6')]]['queue']=!![];}if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x3e')])){channels[_0x969c4c['uniqueid']]['ContactId']=_0x969c4c[_0x2c03('0x35')];}if(!_[_0x2c03('0x1b')](_0x969c4c['variable'][_0x2c03('0x3f')])){channels[_0x969c4c['uniqueid']][_0x2c03('0x8')]=_0x969c4c[_0x2c03('0x35')];}if(!_['isNil'](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x40')])){channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0x41')]=_0x969c4c['value'];}if(!_[_0x2c03('0x1b')](_0x969c4c[_0x2c03('0x33')][_0x2c03('0x42')])){channels[_0x969c4c[_0x2c03('0x6')]][_0x2c03('0x42')]=_0x969c4c[_0x2c03('0x35')];}}}catch(_0x24cc64){utils['error'](_0x24cc64[_0x2c03('0x19')]);}};exports[_0x2c03('0x43')]=function(_0x3f33b2){try{if(!_[_0x2c03('0x1b')](channels[_0x3f33b2[_0x2c03('0x6')]])){if(_0x3f33b2['application'][_0x2c03('0x44')]()==_0x2c03('0x45')&&_['startsWith'](_0x3f33b2[_0x2c03('0x46')][_0x2c03('0x44')](),_0x2c03('0x47'))){var _0x4dbb77=_0x3f33b2[_0x2c03('0x46')][_0x2c03('0x48')]('=');var _0x46c529=_0x4dbb77[0x0][_0x2c03('0x49')](_0x4dbb77[0x0][_0x2c03('0x4a')]('(')+0x1,_0x4dbb77[0x0][_0x2c03('0x4a')](')'));var _0x348f0f=_0x4dbb77[0x1];channels[_0x3f33b2['uniqueid']][_0x46c529]=_0x348f0f;}if(!_['includes'](['hangup',_0x2c03('0x4b'),'execif','set',_0x2c03('0x4c')],_0x3f33b2[_0x2c03('0x4d')][_0x2c03('0x44')]())){channels[_0x3f33b2[_0x2c03('0x6')]][_0x2c03('0x3c')]=_0x3f33b2[_0x2c03('0x4d')];channels[_0x3f33b2[_0x2c03('0x6')]][_0x2c03('0x3d')]=_0x3f33b2[_0x2c03('0x46')];}}}catch(_0xaf7aee){utils[_0x2c03('0x18')](_0xaf7aee[_0x2c03('0x19')]);}}; \ No newline at end of file +var _0x2821=['starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstart','musiconholdstartAt','stack','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','newexten','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','NO\x20ANSWER','FAILED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','callerid','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','ANSWERED','hangup','calleridname','duration','endtime'];(function(_0x486e7a,_0x43144d){var _0x56e2ff=function(_0x46464e){while(--_0x46464e){_0x486e7a['push'](_0x486e7a['shift']());}};_0x56e2ff(++_0x43144d);}(_0x2821,0x81));var _0x1282=function(_0x31b89c,_0x598284){_0x31b89c=_0x31b89c-0x0;var _0x46d3c0=_0x2821[_0x31b89c];return _0x46d3c0;};'use strict';var _=require(_0x1282('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x1282('0x1'),'FAILED',_0x1282('0x2'),_0x1282('0x1'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x1282('0x3'),_0x1282('0x2'),_0x1282('0x2'),_0x1282('0x2')];var channels={};function writeDB(_0x52393a){utils[_0x1282('0x4')](util['format'](_0x1282('0x5'),_0x52393a[_0x1282('0x6')],_0x52393a[_0x1282('0x7')],_0x52393a['type'],_0x52393a[_0x1282('0x8')],_0x52393a[_0x1282('0x9')],_0x52393a['destination'],_0x52393a[_0x1282('0xa')],_0x52393a['disposition']));if(_0x52393a[_0x1282('0x8')]){utils[_0x1282('0xb')](_0x52393a[_0x1282('0x8')])[_0x1282('0xc')](function(_0x32f5d7){if(_0x32f5d7){_0x52393a[_0x1282('0xd')]=_0x32f5d7['id'];}utils[_0x1282('0xe')](_0x1282('0xf'),_0x52393a);});}else{utils[_0x1282('0xe')](_0x1282('0xf'),_0x52393a);}if(channels[_0x52393a[_0x1282('0x6')]]){delete channels[_0x52393a[_0x1282('0x6')]];}}exports[_0x1282('0x10')]=function(_0x3bccc6){try{if(_0x3bccc6[_0x1282('0x6')]==_0x3bccc6[_0x1282('0x11')]&&_0x3bccc6['channel']!=_0x1282('0x12')){channels[_0x3bccc6['uniqueid']]={'uniqueid':_0x3bccc6[_0x1282('0x6')],'accountcode':_0x3bccc6[_0x1282('0x8')],'source':_0x3bccc6[_0x1282('0x13')],'destination':_0x3bccc6['exten'],'destinationcontext':_0x3bccc6[_0x1282('0x14')],'channel':_0x3bccc6['channel'],'starttime':utils[_0x1282('0x15')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1282('0x1'),'amaflags':_0x1282('0x16')};}}catch(_0x487e2c){utils[_0x1282('0x17')](_0x487e2c['stack']);}};exports[_0x1282('0x18')]=function(_0x1588c4){try{if(!_[_0x1282('0x19')](channels[_0x1588c4[_0x1282('0x6')]])&&_0x1588c4[_0x1282('0x1a')]==0x6){if(_[_0x1282('0x19')](channels[_0x1588c4[_0x1282('0x6')]][_0x1282('0x1b')])){channels[_0x1588c4[_0x1282('0x6')]][_0x1282('0x1b')]=utils['now']();}}else if(!_[_0x1282('0x19')](channels[_0x1588c4[_0x1282('0x11')]])&&_0x1588c4[_0x1282('0x1a')]==0x6&&_0x1588c4[_0x1282('0x14')]!=_0x1282('0x1c')){channels[_0x1588c4[_0x1282('0x11')]][_0x1282('0x8')]=_0x1588c4['accountcode'];channels[_0x1588c4[_0x1282('0x11')]][_0x1282('0x1d')]=_0x1588c4['channel'];if(_['isNil'](channels[_0x1588c4[_0x1282('0x11')]][_0x1282('0x1e')])){channels[_0x1588c4['linkedid']][_0x1282('0x1e')]=utils[_0x1282('0x15')]();}channels[_0x1588c4['linkedid']]['disposition']=dispositions[_[_0x1282('0x1f')](_0x1588c4[_0x1282('0x1a')])]||_0x1282('0x20');}}catch(_0x8a94d6){utils['error'](_0x8a94d6['stack']);}};exports[_0x1282('0x21')]=function(_0x408b81){try{if(!_[_0x1282('0x19')](channels[_0x408b81[_0x1282('0x6')]])){if(_[_0x1282('0x19')](channels[_0x408b81['uniqueid']][_0x1282('0xa')])){channels[_0x408b81[_0x1282('0x6')]][_0x1282('0xa')]=_0x408b81[_0x1282('0x22')]+'\x20<'+_0x408b81[_0x1282('0x13')]+'>';}channels[_0x408b81[_0x1282('0x6')]]['endtime']=utils[_0x1282('0x15')]();channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x23')]=utils['diffTime'](channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x24')],channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x25')]);channels[_0x408b81['uniqueid']][_0x1282('0x26')]=channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x1e')]?utils[_0x1282('0x27')](channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x24')],channels[_0x408b81[_0x1282('0x6')]][_0x1282('0x1e')]):0x0;writeDB(channels[_0x408b81[_0x1282('0x6')]]);}}catch(_0xe91373){utils[_0x1282('0x17')](_0xe91373['stack']);}};exports[_0x1282('0x28')]=function(_0x11e4fe){try{if(!_[_0x1282('0x19')](channels[_0x11e4fe[_0x1282('0x29')]])){if(channels[_0x11e4fe['localtwolinkedid']]['channel']==_0x11e4fe[_0x1282('0x2a')]){channels[_0x11e4fe[_0x1282('0x29')]][_0x1282('0x1d')]=_0x11e4fe[_0x1282('0x2b')];channels[_0x11e4fe[_0x1282('0x29')]][_0x1282('0x2c')]=_0x1282('0x2d');}else if(channels[_0x11e4fe[_0x1282('0x29')]][_0x1282('0x7')]=_0x11e4fe[_0x1282('0x2e')]){channels[_0x11e4fe[_0x1282('0x29')]][_0x1282('0x1d')]=_0x11e4fe['origtransfererchannel'];channels[_0x11e4fe['localtwolinkedid']][_0x1282('0x2c')]=_0x1282('0x2d');}}}catch(_0x137181){utils[_0x1282('0x17')](_0x137181['stack']);}};exports[_0x1282('0x2f')]=function(_0x5df192){try{if(!_[_0x1282('0x19')](channels[_0x5df192[_0x1282('0x6')]])){channels[_0x5df192[_0x1282('0x6')]][_0x1282('0x30')]=utils[_0x1282('0x15')]();}}catch(_0x234972){utils['error'](_0x234972[_0x1282('0x31')]);}};exports['musiconholdstop']=function(_0x464ec6){try{if(!_[_0x1282('0x19')](channels[_0x464ec6[_0x1282('0x6')]])){if(!_[_0x1282('0x19')](channels[_0x464ec6[_0x1282('0x6')]]['musiconholdstartAt'])){channels[_0x464ec6['uniqueid']][_0x1282('0x32')]+=utils['diffTime'](utils['now'](),channels[_0x464ec6[_0x1282('0x6')]][_0x1282('0x30')]);delete channels[_0x464ec6[_0x1282('0x6')]][_0x1282('0x30')];}}}catch(_0xe589b5){utils[_0x1282('0x17')](_0xe589b5[_0x1282('0x31')]);}};exports[_0x1282('0x33')]=function(_0xd1d192){try{if(!_[_0x1282('0x19')](channels[_0xd1d192[_0x1282('0x6')]])){if(!_[_0x1282('0x19')](_0xd1d192[_0x1282('0x34')][_0x1282('0x35')])){channels[_0xd1d192['uniqueid']][_0x1282('0x9')]=_0xd1d192[_0x1282('0x36')];}if(!_[_0x1282('0x19')](_0xd1d192['variable'][_0x1282('0x37')])){channels[_0xd1d192[_0x1282('0x6')]][_0x1282('0x38')]=_0xd1d192[_0x1282('0x36')];channels[_0xd1d192[_0x1282('0x6')]][_0x1282('0xa')]='\x22'+_0xd1d192[_0x1282('0x36')]+'\x22\x20<'+_0xd1d192[_0x1282('0x36')]+'>';}if(!_['isNil'](_0xd1d192[_0x1282('0x34')][_0x1282('0x39')])||!_[_0x1282('0x19')](_0xd1d192['variable'][_0x1282('0x3a')])){channels[_0xd1d192[_0x1282('0x6')]]['callerid']=_0xd1d192[_0x1282('0x36')];}if(!_[_0x1282('0x19')](_0xd1d192[_0x1282('0x34')][_0x1282('0x3b')])||!_[_0x1282('0x19')](_0xd1d192[_0x1282('0x34')][_0x1282('0x3c')])){channels[_0xd1d192[_0x1282('0x6')]]['lastapplication']=_0x1282('0x3d');channels[_0xd1d192['uniqueid']][_0x1282('0x3e')]=_0xd1d192[_0x1282('0x36')];channels[_0xd1d192[_0x1282('0x6')]]['queue']=!![];}if(!_[_0x1282('0x19')](_0xd1d192['variable'][_0x1282('0x3f')])){channels[_0xd1d192['uniqueid']][_0x1282('0x40')]=_0xd1d192['value'];}if(!_['isNil'](_0xd1d192[_0x1282('0x34')][_0x1282('0x41')])){channels[_0xd1d192[_0x1282('0x6')]]['type']=_0xd1d192[_0x1282('0x36')];}if(!_[_0x1282('0x19')](_0xd1d192[_0x1282('0x34')][_0x1282('0x42')])){channels[_0xd1d192[_0x1282('0x6')]]['routeid']=_0xd1d192['value'];}if(!_[_0x1282('0x19')](_0xd1d192[_0x1282('0x34')][_0x1282('0x43')])){channels[_0xd1d192['uniqueid']][_0x1282('0x43')]=_0xd1d192[_0x1282('0x36')];}}}catch(_0x4e0d6f){utils[_0x1282('0x17')](_0x4e0d6f[_0x1282('0x31')]);}};exports[_0x1282('0x44')]=function(_0x16e2ee){try{if(!_[_0x1282('0x19')](channels[_0x16e2ee[_0x1282('0x6')]])){if(_0x16e2ee[_0x1282('0x45')]['toLowerCase']()==_0x1282('0x46')&&_[_0x1282('0x47')](_0x16e2ee[_0x1282('0x48')][_0x1282('0x49')](),_0x1282('0x4a'))){var _0x297950=_0x16e2ee[_0x1282('0x48')][_0x1282('0x4b')]('=');var _0x19b0a1=_0x297950[0x0][_0x1282('0x4c')](_0x297950[0x0][_0x1282('0x4d')]('(')+0x1,_0x297950[0x0][_0x1282('0x4d')](')'));var _0x19db94=_0x297950[0x1];channels[_0x16e2ee[_0x1282('0x6')]][_0x19b0a1]=_0x19db94;}if(!_[_0x1282('0x4e')](['hangup',_0x1282('0x4f'),_0x1282('0x50'),'set',_0x1282('0x51')],_0x16e2ee[_0x1282('0x45')]['toLowerCase']())){channels[_0x16e2ee[_0x1282('0x6')]][_0x1282('0x52')]=_0x16e2ee[_0x1282('0x45')];channels[_0x16e2ee['uniqueid']]['lastdata']=_0x16e2ee[_0x1282('0x48')];}}}catch(_0x39b914){utils[_0x1282('0x17')](_0x39b914[_0x1282('0x31')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 796de0a..d4b0502 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 _0xbff5=['error','close','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xbff5,0x1bc));var _0x5bff=function(_0x49f566,_0x21b58b){_0x49f566=_0x49f566-0x0;var _0x3b54dd=_0xbff5[_0x49f566];return _0x3b54dd;};'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 +var _0x5075=['shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED'];(function(_0x347498,_0x332242){var _0x334f2b=function(_0x4156d1){while(--_0x4156d1){_0x347498['push'](_0x347498['shift']());}};_0x334f2b(++_0x332242);}(_0x5075,0x73));var _0x5507=function(_0x27787d,_0x3c832a){_0x27787d=_0x27787d-0x0;var _0x2ec19c=_0x5075[_0x27787d];return _0x2ec19c;};'use strict';var utils=require(_0x5507('0x0'));var _=require(_0x5507('0x1'));exports[_0x5507('0x2')]=function(){utils[_0x5507('0x3')](_0x5507('0x4'));};exports[_0x5507('0x5')]=function(){utils[_0x5507('0x3')]('SHUTDOWN');};exports[_0x5507('0x6')]=function(){utils[_0x5507('0x3')](_0x5507('0x7'));};exports['error']=function(_0x5b6d7f){utils[_0x5507('0x8')](_0x5b6d7f);};exports[_0x5507('0x9')]=function(){utils['info'](_0x5507('0xa'));};exports[_0x5507('0xb')]=function(_0xbf4b50){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b8af840..295d001 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 _0x8d39=['connect','hangup','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','isNil','variable','outboundrouteid','dialbegin','assign','starttime','now','lastevent','dialend','ANSWER','answertime'];(function(_0x1079f9,_0x4c825c){var _0x4aa21f=function(_0x4de028){while(--_0x4de028){_0x1079f9['push'](_0x1079f9['shift']());}};_0x4aa21f(++_0x4c825c);}(_0x8d39,0x120));var _0x98d3=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x8d39[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0x98d3('0x0'));var util=require(_0x98d3('0x1'));var utils=require(_0x98d3('0x2'));var dials={};function writeDB(_0x2ad0a1){utils['info'](util[_0x98d3('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x2ad0a1['uniqueid'],_0x2ad0a1[_0x98d3('0x4')],_0x2ad0a1[_0x98d3('0x5')],_0x2ad0a1[_0x98d3('0x6')],_0x2ad0a1[_0x98d3('0x7')],_0x2ad0a1[_0x98d3('0x8')]));utils[_0x98d3('0x9')](_0x98d3('0xa'),_0x2ad0a1);delete dials[_0x2ad0a1[_0x98d3('0xb')]];}exports['newexten']=function(_0x1dbbf8){try{if(_0x1dbbf8[_0x98d3('0xc')][_0x98d3('0xd')]()==_0x98d3('0xe')&&_[_0x98d3('0xf')](_0x1dbbf8[_0x98d3('0x10')]['toLowerCase'](),_0x98d3('0x11'))){var _0x4bb40b=_0x1dbbf8[_0x98d3('0x10')][_0x98d3('0x12')]('=');dials[_0x1dbbf8['uniqueid']]={'routeId':_0x4bb40b[0x1]};}}catch(_0x307884){utils[_0x98d3('0x13')](_0x307884[_0x98d3('0x14')]);}};exports['varset']=function(_0x1737c6){try{if(!_[_0x98d3('0x15')](_0x1737c6[_0x98d3('0x16')][_0x98d3('0x17')])){dials[_0x1737c6[_0x98d3('0xb')]]={'routeId':_0x1737c6['value']};}}catch(_0xab6a3e){utils[_0x98d3('0x13')](_0xab6a3e['stack']);}};exports[_0x98d3('0x18')]=function(_0x59728e){try{if(!_[_0x98d3('0x15')](dials[_0x59728e['uniqueid']])){dials[_0x59728e[_0x98d3('0xb')]]=_[_0x98d3('0x19')](dials[_0x59728e[_0x98d3('0xb')]],_0x59728e);dials[_0x59728e['uniqueid']][_0x98d3('0x1a')]=utils[_0x98d3('0x1b')]();dials[_0x59728e[_0x98d3('0xb')]][_0x98d3('0x1c')]='called';}}catch(_0x4cb0ba){utils[_0x98d3('0x13')](_0x4cb0ba[_0x98d3('0x14')]);}};exports[_0x98d3('0x1d')]=function(_0x2e2234){try{if(!_[_0x98d3('0x15')](dials[_0x2e2234[_0x98d3('0xb')]])){dials[_0x2e2234[_0x98d3('0xb')]][_0x98d3('0x8')]=_0x2e2234[_0x98d3('0x8')];if(_0x2e2234[_0x98d3('0x8')]==_0x98d3('0x1e')){dials[_0x2e2234[_0x98d3('0xb')]]=_[_0x98d3('0x19')](dials[_0x2e2234[_0x98d3('0xb')]],_0x2e2234);dials[_0x2e2234['uniqueid']][_0x98d3('0x1f')]=utils[_0x98d3('0x1b')]();dials[_0x2e2234['uniqueid']][_0x98d3('0x1c')]=_0x98d3('0x20');}}}catch(_0x56914a){utils[_0x98d3('0x13')](_0x56914a['stack']);}};exports[_0x98d3('0x21')]=function(_0xf64b30){try{if(!_[_0x98d3('0x15')](dials[_0xf64b30['uniqueid']])){dials[_0xf64b30[_0x98d3('0xb')]]=_[_0x98d3('0x19')](dials[_0xf64b30['uniqueid']],{'endtime':utils[_0x98d3('0x1b')](),'lastevent':_0x98d3('0x22')});dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x23')]=utils[_0x98d3('0x24')](dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x25')],dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x1a')]);dials[_0xf64b30['uniqueid']][_0x98d3('0x26')]=utils[_0x98d3('0x24')](dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x1f')]||dials[_0xf64b30[_0x98d3('0xb')]]['endtime'],dials[_0xf64b30[_0x98d3('0xb')]]['starttime']);dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x27')]=dials[_0xf64b30['uniqueid']][_0x98d3('0x1f')]?utils[_0x98d3('0x24')](dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x25')],dials[_0xf64b30[_0x98d3('0xb')]][_0x98d3('0x1f')]):0x0;writeDB(dials[_0xf64b30['uniqueid']]);}}catch(_0x226a78){utils[_0x98d3('0x13')](_0x226a78[_0x98d3('0x14')]);}}; \ No newline at end of file +var _0x2700=['value','stack','assign','now','lastevent','called','dialend','dialstatus','answertime','connect','complete','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','util','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','request','CreateVoiceDialReport','newexten','set','startsWith','cdr(routeid)','appdata','error','varset','isNil','variable'];(function(_0x967d1a,_0x48dd36){var _0x21dd69=function(_0x512c43){while(--_0x512c43){_0x967d1a['push'](_0x967d1a['shift']());}};_0x21dd69(++_0x48dd36);}(_0x2700,0xc0));var _0x0270=function(_0xc1861d,_0x45aebb){_0xc1861d=_0xc1861d-0x0;var _0x41376a=_0x2700[_0xc1861d];return _0x41376a;};'use strict';var _=require(_0x0270('0x0'));var util=require(_0x0270('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x433261){utils[_0x0270('0x2')](util[_0x0270('0x3')](_0x0270('0x4'),_0x433261[_0x0270('0x5')],_0x433261['channel'],_0x433261[_0x0270('0x6')],_0x433261['calleridnum'],_0x433261['connectedlinenum'],_0x433261['dialstatus']));utils[_0x0270('0x7')](_0x0270('0x8'),_0x433261);delete dials[_0x433261[_0x0270('0x5')]];}exports[_0x0270('0x9')]=function(_0x5b8cd6){try{if(_0x5b8cd6['application']['toLowerCase']()==_0x0270('0xa')&&_[_0x0270('0xb')](_0x5b8cd6['appdata']['toLowerCase'](),_0x0270('0xc'))){var _0x211dfb=_0x5b8cd6[_0x0270('0xd')]['split']('=');dials[_0x5b8cd6[_0x0270('0x5')]]={'routeId':_0x211dfb[0x1]};}}catch(_0xd393a){utils[_0x0270('0xe')](_0xd393a['stack']);}};exports[_0x0270('0xf')]=function(_0x4c870e){try{if(!_[_0x0270('0x10')](_0x4c870e[_0x0270('0x11')]['outboundrouteid'])){dials[_0x4c870e['uniqueid']]={'routeId':_0x4c870e[_0x0270('0x12')]};}}catch(_0x36df1e){utils[_0x0270('0xe')](_0x36df1e[_0x0270('0x13')]);}};exports['dialbegin']=function(_0xf85974){try{if(!_['isNil'](dials[_0xf85974['uniqueid']])){dials[_0xf85974[_0x0270('0x5')]]=_[_0x0270('0x14')](dials[_0xf85974[_0x0270('0x5')]],_0xf85974);dials[_0xf85974[_0x0270('0x5')]]['starttime']=utils[_0x0270('0x15')]();dials[_0xf85974[_0x0270('0x5')]][_0x0270('0x16')]=_0x0270('0x17');}}catch(_0x3550ab){utils['error'](_0x3550ab['stack']);}};exports[_0x0270('0x18')]=function(_0x45e27d){try{if(!_[_0x0270('0x10')](dials[_0x45e27d[_0x0270('0x5')]])){dials[_0x45e27d[_0x0270('0x5')]]['dialstatus']=_0x45e27d[_0x0270('0x19')];if(_0x45e27d[_0x0270('0x19')]=='ANSWER'){dials[_0x45e27d[_0x0270('0x5')]]=_[_0x0270('0x14')](dials[_0x45e27d['uniqueid']],_0x45e27d);dials[_0x45e27d[_0x0270('0x5')]][_0x0270('0x1a')]=utils['now']();dials[_0x45e27d[_0x0270('0x5')]][_0x0270('0x16')]=_0x0270('0x1b');}}}catch(_0x2beaf9){utils['error'](_0x2beaf9['stack']);}};exports['hangup']=function(_0x2ce605){try{if(!_[_0x0270('0x10')](dials[_0x2ce605[_0x0270('0x5')]])){dials[_0x2ce605[_0x0270('0x5')]]=_['assign'](dials[_0x2ce605[_0x0270('0x5')]],{'endtime':utils['now'](),'lastevent':_0x0270('0x1c')});dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x1d')]=utils[_0x0270('0x1e')](dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x1f')],dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x20')]);dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x21')]=utils[_0x0270('0x1e')](dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x1a')]||dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x1f')],dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x20')]);dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x22')]=dials[_0x2ce605[_0x0270('0x5')]][_0x0270('0x1a')]?utils[_0x0270('0x1e')](dials[_0x2ce605['uniqueid']][_0x0270('0x1f')],dials[_0x2ce605['uniqueid']][_0x0270('0x1a')]):0x0;writeDB(dials[_0x2ce605['uniqueid']]);}}catch(_0x1d5524){utils[_0x0270('0xe')](_0x1d5524['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 16cdd84..6165edc 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 _0x486f=['connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','password','xdr','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller'];(function(_0xf2d1bf,_0x19c53a){var _0x388d2c=function(_0x217e55){while(--_0x217e55){_0xf2d1bf['push'](_0xf2d1bf['shift']());}};_0x388d2c(++_0x19c53a);}(_0x486f,0x1e1));var _0xf486=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x486f[_0x4a9fb1];return _0x348672;};var AsteriskManager=require(_0xf486('0x0'));var config=require(_0xf486('0x1'));var utils=require(_0xf486('0x2'));var ami=new AsteriskManager(config[_0xf486('0x3')]['port'],config[_0xf486('0x3')]['ip'],config[_0xf486('0x3')]['username'],config['asterisk'][_0xf486('0x4')],!![]);ami['keepConnected']();if(config[_0xf486('0x5')]&&config['xdr']['disabled']){utils[_0xf486('0x6')](_0xf486('0x7'));}else{var agents=require('./agents.controller');var calls=require(_0xf486('0x8'));var queues=require('./queues.controller');var recordings=require(_0xf486('0x9'));var members=require(_0xf486('0xa'));var dials=require('./dials.controller');var transfers=require(_0xf486('0xb'));var core=require(_0xf486('0xc'));ami['on'](_0xf486('0xd'),core[_0xf486('0xd')]);ami['on'](_0xf486('0xe'),core['shutdown']);ami['on'](_0xf486('0xf'),core['fullybooted']);ami['on'](_0xf486('0x10'),core[_0xf486('0x10')]);ami['on'](_0xf486('0x11'),core[_0xf486('0x11')]);ami['on'](_0xf486('0x12'),core[_0xf486('0x12')]);ami['on'](_0xf486('0x13'),function(_0x29ea80){try{members['devicestatechange'](_0x29ea80);}catch(_0x87da5){utils[_0xf486('0x10')](_0x87da5);}});ami['on'](_0xf486('0x14'),function(_0x239561){try{agents[_0xf486('0x14')](_0x239561);}catch(_0x152051){utils['error'](_0x152051);}});ami['on']('agentringnoanswer',function(_0x1b3059){try{agents[_0xf486('0x15')](_0x1b3059);}catch(_0x29ab76){utils['error'](_0x29ab76);}});ami['on'](_0xf486('0x16'),function(_0x2d9e4a){try{agents[_0xf486('0x16')](_0x2d9e4a);queues['agentconnect'](_0x2d9e4a);}catch(_0x8497dd){utils[_0xf486('0x10')](_0x8497dd);}});ami['on']('agentcomplete',function(_0x151ff3){try{agents[_0xf486('0x17')](_0x151ff3);queues['agentcomplete'](_0x151ff3);members[_0xf486('0x17')](_0x151ff3);}catch(_0x31130b){utils[_0xf486('0x10')](_0x31130b);}});ami['on'](_0xf486('0x18'),function(_0x4d5cc6){try{agents[_0xf486('0x18')](_0x4d5cc6);queues[_0xf486('0x18')](_0x4d5cc6);}catch(_0x3b1851){utils[_0xf486('0x10')](_0x3b1851);}});ami['on'](_0xf486('0x19'),function(_0x40e4d8){try{queues[_0xf486('0x19')](_0x40e4d8);recordings[_0xf486('0x19')](_0x40e4d8);}catch(_0x198f9b){utils['error'](_0x198f9b);}});ami['on']('queuecallerleave',function(_0x129a87){try{queues['queuecallerleave'](_0x129a87);}catch(_0x35a46a){utils['error'](_0x35a46a);}});ami['on'](_0xf486('0x1a'),function(_0x5545ad){try{queues['musiconholdstart'](_0x5545ad);calls[_0xf486('0x1a')](_0x5545ad);}catch(_0x10516d){utils[_0xf486('0x10')](_0x10516d);}});ami['on'](_0xf486('0x1b'),function(_0x39bd70){try{queues[_0xf486('0x1b')](_0x39bd70);calls[_0xf486('0x1b')](_0x39bd70);}catch(_0x21755a){utils[_0xf486('0x10')](_0x21755a);}});ami['on'](_0xf486('0x1c'),function(_0x274dc7){try{calls[_0xf486('0x1c')](_0x274dc7);recordings[_0xf486('0x1c')](_0x274dc7);}catch(_0x546566){utils['error'](_0x546566);}});ami['on'](_0xf486('0x1d'),function(_0x322ede){try{calls[_0xf486('0x1d')](_0x322ede);recordings[_0xf486('0x1d')](_0x322ede);dials[_0xf486('0x1d')](_0x322ede);agents['hangup'](_0x322ede);queues[_0xf486('0x1d')](_0x322ede);}catch(_0x4dd6a6){utils[_0xf486('0x10')](_0x4dd6a6);}});ami['on'](_0xf486('0x1e'),function(_0x35bf32){try{members['cdr'](_0x35bf32);}catch(_0x3328f6){utils[_0xf486('0x10')](_0x3328f6);}});ami['on'](_0xf486('0x1f'),function(_0x417946){try{queues[_0xf486('0x1f')](_0x417946);agents[_0xf486('0x1f')](_0x417946);transfers[_0xf486('0x1f')](_0x417946);}catch(_0x404e8f){utils[_0xf486('0x10')](_0x404e8f);}});ami['on'](_0xf486('0x20'),function(_0x35fd66){try{queues[_0xf486('0x20')](_0x35fd66);transfers['attendedtransfer'](_0x35fd66);agents[_0xf486('0x20')](_0x35fd66);calls[_0xf486('0x20')](_0x35fd66);}catch(_0x878443){utils[_0xf486('0x10')](_0x878443);}});ami['on']('varset',function(_0xf5425){try{queues[_0xf486('0x21')](_0xf5425);recordings[_0xf486('0x21')](_0xf5425);calls['varset'](_0xf5425);dials[_0xf486('0x21')](_0xf5425);}catch(_0x5075c6){utils[_0xf486('0x10')](_0x5075c6);}});ami['on'](_0xf486('0x22'),function(_0x5732a3){try{calls[_0xf486('0x22')](_0x5732a3);recordings[_0xf486('0x22')](_0x5732a3);dials[_0xf486('0x22')](_0x5732a3);}catch(_0xa377c7){utils['error'](_0xa377c7);}});ami['on'](_0xf486('0x23'),function(_0x24102e){try{calls[_0xf486('0x23')](_0x24102e);recordings['newchannel'](_0x24102e);}catch(_0x41ce96){utils['error'](_0x41ce96);}});ami['on']('dialbegin',function(_0x1299cd){try{dials[_0xf486('0x24')](_0x1299cd);}catch(_0x55f59e){utils[_0xf486('0x10')](_0x55f59e);}});ami['on']('dialend',function(_0x1f6ab2){try{dials[_0xf486('0x25')](_0x1f6ab2);}catch(_0x4927e4){utils[_0xf486('0x10')](_0x4927e4);}});} \ No newline at end of file +var _0x0983=['dialend','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin'];(function(_0x4ad553,_0x586c5a){var _0x136750=function(_0x11dfbc){while(--_0x11dfbc){_0x4ad553['push'](_0x4ad553['shift']());}};_0x136750(++_0x586c5a);}(_0x0983,0x151));var _0x3098=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x0983[_0xbd08b4];return _0x314f1e;};var AsteriskManager=require(_0x3098('0x0'));var config=require('../../config/environment');var utils=require(_0x3098('0x1'));var ami=new AsteriskManager(config[_0x3098('0x2')][_0x3098('0x3')],config[_0x3098('0x2')]['ip'],config[_0x3098('0x2')][_0x3098('0x4')],config['asterisk'][_0x3098('0x5')],!![]);ami[_0x3098('0x6')]();if(config[_0x3098('0x7')]&&config[_0x3098('0x7')][_0x3098('0x8')]){utils[_0x3098('0x9')](_0x3098('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x3098('0xb'));var queues=require('./queues.controller');var recordings=require(_0x3098('0xc'));var members=require(_0x3098('0xd'));var dials=require('./dials.controller');var transfers=require(_0x3098('0xe'));var core=require(_0x3098('0xf'));ami['on'](_0x3098('0x10'),core[_0x3098('0x10')]);ami['on']('shutdown',core[_0x3098('0x11')]);ami['on']('fullybooted',core[_0x3098('0x12')]);ami['on'](_0x3098('0x13'),core['error']);ami['on'](_0x3098('0x14'),core['close']);ami['on'](_0x3098('0x15'),core['managerevent']);ami['on']('devicestatechange',function(_0x3a12db){try{members[_0x3098('0x16')](_0x3a12db);}catch(_0x2530b0){utils[_0x3098('0x13')](_0x2530b0);}});ami['on'](_0x3098('0x17'),function(_0x58a6fe){try{agents[_0x3098('0x17')](_0x58a6fe);}catch(_0x526a84){utils[_0x3098('0x13')](_0x526a84);}});ami['on'](_0x3098('0x18'),function(_0x50fbf7){try{agents['agentringnoanswer'](_0x50fbf7);}catch(_0x3c9766){utils[_0x3098('0x13')](_0x3c9766);}});ami['on'](_0x3098('0x19'),function(_0x869728){try{agents[_0x3098('0x19')](_0x869728);queues[_0x3098('0x19')](_0x869728);}catch(_0x28e6bc){utils[_0x3098('0x13')](_0x28e6bc);}});ami['on'](_0x3098('0x1a'),function(_0x4e15dc){try{agents['agentcomplete'](_0x4e15dc);queues['agentcomplete'](_0x4e15dc);members[_0x3098('0x1a')](_0x4e15dc);}catch(_0x174a6b){utils[_0x3098('0x13')](_0x174a6b);}});ami['on'](_0x3098('0x1b'),function(_0x435a26){try{agents['queuecallerabandon'](_0x435a26);queues[_0x3098('0x1b')](_0x435a26);}catch(_0x545ff2){utils[_0x3098('0x13')](_0x545ff2);}});ami['on']('queuecallerjoin',function(_0x1d6e56){try{queues[_0x3098('0x1c')](_0x1d6e56);recordings[_0x3098('0x1c')](_0x1d6e56);}catch(_0xedf698){utils['error'](_0xedf698);}});ami['on'](_0x3098('0x1d'),function(_0x39ab49){try{queues[_0x3098('0x1d')](_0x39ab49);}catch(_0x621042){utils[_0x3098('0x13')](_0x621042);}});ami['on'](_0x3098('0x1e'),function(_0xbfbde5){try{queues[_0x3098('0x1e')](_0xbfbde5);calls['musiconholdstart'](_0xbfbde5);}catch(_0x52f573){utils[_0x3098('0x13')](_0x52f573);}});ami['on'](_0x3098('0x1f'),function(_0x31897c){try{queues['musiconholdstop'](_0x31897c);calls[_0x3098('0x1f')](_0x31897c);}catch(_0xa3cc28){utils[_0x3098('0x13')](_0xa3cc28);}});ami['on'](_0x3098('0x20'),function(_0x5396af){try{calls[_0x3098('0x20')](_0x5396af);recordings[_0x3098('0x20')](_0x5396af);}catch(_0x29877d){utils[_0x3098('0x13')](_0x29877d);}});ami['on'](_0x3098('0x21'),function(_0x21f216){try{calls[_0x3098('0x21')](_0x21f216);recordings[_0x3098('0x21')](_0x21f216);dials[_0x3098('0x21')](_0x21f216);agents[_0x3098('0x21')](_0x21f216);queues[_0x3098('0x21')](_0x21f216);}catch(_0x554f6c){utils[_0x3098('0x13')](_0x554f6c);}});ami['on'](_0x3098('0x22'),function(_0x50436d){try{members[_0x3098('0x22')](_0x50436d);}catch(_0x46d2aa){utils[_0x3098('0x13')](_0x46d2aa);}});ami['on'](_0x3098('0x23'),function(_0x36d4e0){try{queues[_0x3098('0x23')](_0x36d4e0);agents['blindtransfer'](_0x36d4e0);transfers[_0x3098('0x23')](_0x36d4e0);}catch(_0x4c81e8){utils[_0x3098('0x13')](_0x4c81e8);}});ami['on'](_0x3098('0x24'),function(_0x3c69f9){try{queues[_0x3098('0x24')](_0x3c69f9);transfers[_0x3098('0x24')](_0x3c69f9);agents[_0x3098('0x24')](_0x3c69f9);calls[_0x3098('0x24')](_0x3c69f9);}catch(_0x44e7c9){utils['error'](_0x44e7c9);}});ami['on'](_0x3098('0x25'),function(_0x299c68){try{queues[_0x3098('0x25')](_0x299c68);recordings[_0x3098('0x25')](_0x299c68);calls[_0x3098('0x25')](_0x299c68);dials['varset'](_0x299c68);}catch(_0x5dd2f2){utils[_0x3098('0x13')](_0x5dd2f2);}});ami['on'](_0x3098('0x26'),function(_0x4953a0){try{calls[_0x3098('0x26')](_0x4953a0);recordings[_0x3098('0x26')](_0x4953a0);dials['newexten'](_0x4953a0);}catch(_0x4e2713){utils[_0x3098('0x13')](_0x4e2713);}});ami['on'](_0x3098('0x27'),function(_0x151b35){try{calls[_0x3098('0x27')](_0x151b35);recordings['newchannel'](_0x151b35);}catch(_0x10cf44){utils[_0x3098('0x13')](_0x10cf44);}});ami['on'](_0x3098('0x28'),function(_0x5848ff){try{dials[_0x3098('0x28')](_0x5848ff);}catch(_0x1345f8){utils[_0x3098('0x13')](_0x1345f8);}});ami['on']('dialend',function(_0x32a895){try{dials[_0x3098('0x29')](_0x32a895);}catch(_0x5c3b40){utils[_0x3098('0x13')](_0x5c3b40);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 45a07be..67603c4 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 _0xee0d=['BUSY','device','voice','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','queue','cdr','assign','data1','source','data3','destination','destinationchannel','data2','lodash','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','split','then','startsWith','devicestatechange','state'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xee0d,0x66));var _0xdee0=function(_0x21f822,_0x138136){_0x21f822=_0x21f822-0x0;var _0x4abd1b=_0xee0d[_0x21f822];return _0x4abd1b;};'use strict';var _=require(_0xdee0('0x0'));var util=require('util');var utils=require(_0xdee0('0x1'));var members={};var exclude=[_0xdee0('0x2'),_0xdee0('0x3')];function writeDB(_0x10ae9e){utils[_0xdee0('0x4')](util[_0xdee0('0x5')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x10ae9e[_0xdee0('0x6')],_0x10ae9e[_0xdee0('0x7')],_0x10ae9e[_0xdee0('0x8')],_0x10ae9e['data2'],_0x10ae9e[_0xdee0('0x9')],_0x10ae9e[_0xdee0('0xa')]));if(_0x10ae9e[_0xdee0('0x7')]){utils[_0xdee0('0xb')](_0x10ae9e[_0xdee0('0x7')])['then'](function(_0x59dd8a){if(_0x59dd8a){_0x10ae9e['membername']=_0x59dd8a[_0xdee0('0xc')];_0x10ae9e[_0xdee0('0xd')]=_0x59dd8a[_0xdee0('0xd')];utils[_0xdee0('0xe')](_0xdee0('0xf'),_0x10ae9e);}else{utils['getUserByName'](_0x10ae9e[_0xdee0('0x7')][_0xdee0('0x10')]('/')[0x1])[_0xdee0('0x11')](function(_0x44f4be){if(_0x44f4be){_0x10ae9e[_0xdee0('0x9')]=_0x44f4be[_0xdee0('0xc')];_0x10ae9e[_0xdee0('0xd')]=_0x44f4be[_0xdee0('0xd')];utils[_0xdee0('0xe')](_0xdee0('0xf'),_0x10ae9e);}});}})['catch'](function(_0x4cce73){utils['error'](_0x4cce73);});}delete members[_0x10ae9e[_0xdee0('0x7')]];}function startsWith(_0x4e7fe1,_0x286967){return _['some'](_0x4e7fe1,function(_0x285b2c){return _[_0xdee0('0x12')](_0x286967,_0x285b2c);});}exports[_0xdee0('0x13')]=function(_0x4d0e03){switch(_0x4d0e03[_0xdee0('0x14')]){case'INUSE':case _0xdee0('0x15'):if(!startsWith(exclude,_0x4d0e03[_0xdee0('0x16')])){members[_0x4d0e03[_0xdee0('0x16')]]={'channel':_0xdee0('0x17'),'interface':_0x4d0e03[_0xdee0('0x16')],'type':'TALKING','enterAt':utils[_0xdee0('0x18')](),'role':_0xdee0('0x19')};}break;case'NOT_INUSE':if(!_[_0xdee0('0x1a')](members[_0x4d0e03[_0xdee0('0x16')]])){members[_0x4d0e03[_0xdee0('0x16')]][_0xdee0('0x1b')]=utils[_0xdee0('0x18')]();members[_0x4d0e03['device']][_0xdee0('0x1c')]=utils[_0xdee0('0x1d')](members[_0x4d0e03['device']][_0xdee0('0x1b')],members[_0x4d0e03[_0xdee0('0x16')]][_0xdee0('0x1e')]);if(members[_0x4d0e03[_0xdee0('0x16')]][_0xdee0('0x6')]){writeDB(members[_0x4d0e03[_0xdee0('0x16')]]);}}default:break;}};exports[_0xdee0('0x1f')]=function(_0x1041cb){if(!_[_0xdee0('0x1a')](members[_0x1041cb[_0xdee0('0x7')]])){members[_0x1041cb[_0xdee0('0x7')]]=_['assign'](members[_0x1041cb[_0xdee0('0x7')]],{'data4':_0x1041cb[_0xdee0('0x20')],'uniqueid':_0x1041cb[_0xdee0('0x6')]});}};exports[_0xdee0('0x21')]=function(_0x494e6a){if(_0x494e6a[_0xdee0('0x8')]){var _0x4534d2=_0x494e6a[_0xdee0('0x8')][_0xdee0('0x10')]('-')[0x0];if(!_[_0xdee0('0x1a')](members[_0x4534d2])){members[_0x4534d2]=_[_0xdee0('0x22')](members[_0x4534d2],{'data1':members[_0x4534d2][_0xdee0('0x23')]||_0x494e6a[_0xdee0('0xa')],'data2':members[_0x4534d2]['data2']||_0x494e6a[_0xdee0('0x24')],'data3':members[_0x4534d2][_0xdee0('0x25')]||_0x494e6a[_0xdee0('0x26')],'uniqueid':members[_0x4534d2]['uniqueid']||_0x494e6a[_0xdee0('0x6')]});if(members[_0x4534d2][_0xdee0('0x1b')]){writeDB(members[_0x4534d2]);}}}if(_0x494e6a[_0xdee0('0x27')]){var _0x5dccbb=_0x494e6a[_0xdee0('0x27')]['split']('-')[0x0];if(!_[_0xdee0('0x1a')](members[_0x5dccbb])){members[_0x5dccbb]=_[_0xdee0('0x22')](members[_0x5dccbb],{'data1':members[_0x5dccbb][_0xdee0('0x23')]||_0x494e6a[_0xdee0('0xa')],'data2':members[_0x5dccbb][_0xdee0('0x28')]||_0x494e6a[_0xdee0('0x24')],'data3':members[_0x5dccbb][_0xdee0('0x25')]||_0x494e6a[_0xdee0('0x26')],'uniqueid':members[_0x5dccbb]['uniqueid']||_0x494e6a[_0xdee0('0x6')]});if(members[_0x5dccbb]['exitAt']){writeDB(members[_0x5dccbb]);}}}}; \ No newline at end of file +var _0xf124=['then','name','CreateMemberReport','split','internal','request','catch','error','some','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','isNil','exitAt','enterAt','cdr','assign','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','data2','membername','type','getUserByInterface','interface'];(function(_0x43f32c,_0x2a941d){var _0xafa630=function(_0x2a9c04){while(--_0x2a9c04){_0x43f32c['push'](_0x43f32c['shift']());}};_0xafa630(++_0x2a941d);}(_0xf124,0xba));var _0x4f12=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0xf124[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0x4f12('0x0'));var util=require(_0x4f12('0x1'));var utils=require(_0x4f12('0x2'));var members={};var exclude=[_0x4f12('0x3'),_0x4f12('0x4')];function writeDB(_0x122d37){utils[_0x4f12('0x5')](util[_0x4f12('0x6')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x122d37[_0x4f12('0x7')],_0x122d37['interface'],_0x122d37[_0x4f12('0x8')],_0x122d37[_0x4f12('0x9')],_0x122d37[_0x4f12('0xa')],_0x122d37[_0x4f12('0xb')]));if(_0x122d37['interface']){utils[_0x4f12('0xc')](_0x122d37[_0x4f12('0xd')])[_0x4f12('0xe')](function(_0x58a0b0){if(_0x58a0b0){_0x122d37[_0x4f12('0xa')]=_0x58a0b0[_0x4f12('0xf')];_0x122d37['internal']=_0x58a0b0['internal'];utils['request'](_0x4f12('0x10'),_0x122d37);}else{utils['getUserByName'](_0x122d37[_0x4f12('0xd')][_0x4f12('0x11')]('/')[0x1])[_0x4f12('0xe')](function(_0x1a7fef){if(_0x1a7fef){_0x122d37[_0x4f12('0xa')]=_0x1a7fef['name'];_0x122d37[_0x4f12('0x12')]=_0x1a7fef[_0x4f12('0x12')];utils[_0x4f12('0x13')](_0x4f12('0x10'),_0x122d37);}});}})[_0x4f12('0x14')](function(_0x36edac){utils[_0x4f12('0x15')](_0x36edac);});}delete members[_0x122d37[_0x4f12('0xd')]];}function startsWith(_0x1f665a,_0x1be0e8){return _[_0x4f12('0x16')](_0x1f665a,function(_0x343ce0){return _[_0x4f12('0x17')](_0x1be0e8,_0x343ce0);});}exports[_0x4f12('0x18')]=function(_0x5ddbe8){switch(_0x5ddbe8[_0x4f12('0x19')]){case'INUSE':case _0x4f12('0x1a'):if(!startsWith(exclude,_0x5ddbe8['device'])){members[_0x5ddbe8[_0x4f12('0x1b')]]={'channel':_0x4f12('0x1c'),'interface':_0x5ddbe8['device'],'type':_0x4f12('0x1d'),'enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x4f12('0x1e')](members[_0x5ddbe8[_0x4f12('0x1b')]])){members[_0x5ddbe8[_0x4f12('0x1b')]][_0x4f12('0x1f')]=utils['now']();members[_0x5ddbe8[_0x4f12('0x1b')]]['duration']=utils['diffTime'](members[_0x5ddbe8[_0x4f12('0x1b')]][_0x4f12('0x1f')],members[_0x5ddbe8[_0x4f12('0x1b')]][_0x4f12('0x20')]);if(members[_0x5ddbe8['device']][_0x4f12('0x7')]){writeDB(members[_0x5ddbe8[_0x4f12('0x1b')]]);}}default:break;}};exports['agentcomplete']=function(_0x4305e5){if(!_[_0x4f12('0x1e')](members[_0x4305e5[_0x4f12('0xd')]])){members[_0x4305e5[_0x4f12('0xd')]]=_['assign'](members[_0x4305e5[_0x4f12('0xd')]],{'data4':_0x4305e5['queue'],'uniqueid':_0x4305e5[_0x4f12('0x7')]});}};exports[_0x4f12('0x21')]=function(_0x11446c){if(_0x11446c[_0x4f12('0x8')]){var _0x570a57=_0x11446c[_0x4f12('0x8')][_0x4f12('0x11')]('-')[0x0];if(!_['isNil'](members[_0x570a57])){members[_0x570a57]=_[_0x4f12('0x22')](members[_0x570a57],{'data1':members[_0x570a57][_0x4f12('0x23')]||_0x11446c['type'],'data2':members[_0x570a57][_0x4f12('0x9')]||_0x11446c[_0x4f12('0x24')],'data3':members[_0x570a57][_0x4f12('0x25')]||_0x11446c[_0x4f12('0x26')],'uniqueid':members[_0x570a57][_0x4f12('0x7')]||_0x11446c[_0x4f12('0x7')]});if(members[_0x570a57][_0x4f12('0x1f')]){writeDB(members[_0x570a57]);}}}if(_0x11446c[_0x4f12('0x27')]){var _0x4356f8=_0x11446c[_0x4f12('0x27')][_0x4f12('0x11')]('-')[0x0];if(!_['isNil'](members[_0x4356f8])){members[_0x4356f8]=_[_0x4f12('0x22')](members[_0x4356f8],{'data1':members[_0x4356f8][_0x4f12('0x23')]||_0x11446c[_0x4f12('0xb')],'data2':members[_0x4356f8][_0x4f12('0x9')]||_0x11446c[_0x4f12('0x24')],'data3':members[_0x4356f8][_0x4f12('0x25')]||_0x11446c[_0x4f12('0x26')],'uniqueid':members[_0x4356f8]['uniqueid']||_0x11446c['uniqueid']});if(members[_0x4356f8][_0x4f12('0x1f')]){writeDB(members[_0x4356f8]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 085fba6..e23a13c 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 _0xea5f=['lastAssignedTo','agentcomplete','membername','transfer','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transferexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','lodash','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queuecallerexitreason','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode'];(function(_0x16098e,_0x54c595){var _0x4474cb=function(_0x47bb1d){while(--_0x47bb1d){_0x16098e['push'](_0x16098e['shift']());}};_0x4474cb(++_0x54c595);}(_0xea5f,0x1a7));var _0xfea5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xea5f[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xfea5('0x0'));var util=require('util');var utils=require(_0xfea5('0x1'));var queues={};function writeDB(_0x4c6011){utils[_0xfea5('0x2')](util[_0xfea5('0x3')](_0xfea5('0x4'),_0x4c6011[_0xfea5('0x5')],_0x4c6011[_0xfea5('0x6')],_0x4c6011[_0xfea5('0x7')],_0x4c6011['lastAssignedTo'],_0x4c6011[_0xfea5('0x8')],_0x4c6011[_0xfea5('0x9')],_0x4c6011['queuecallerexitreason']));if(_0x4c6011['queue']){utils[_0xfea5('0xa')](_0x4c6011['queue'])[_0xfea5('0xb')](function(_0x41f34e){if(_0x41f34e){_0x4c6011[_0xfea5('0xc')]=_0x41f34e[_0xfea5('0xc')];}utils['request'](_0xfea5('0xd'),_0x4c6011);});}else{utils[_0xfea5('0xe')](_0xfea5('0xd'),_0x4c6011);}if(_0x4c6011[_0xfea5('0xf')]){delete queues[_0x4c6011[_0xfea5('0xf')]];}else{delete queues[_0x4c6011[_0xfea5('0x5')]];}}exports[_0xfea5('0x10')]=function(_0x34ab36){queues[_0x34ab36['uniqueid']]=_[_0xfea5('0x11')](_0x34ab36,{'originalposition':_0x34ab36['position'],'queuecallerjoinAt':utils[_0xfea5('0x12')](),'mohtime':0x0});};exports[_0xfea5('0x13')]=function(_0x352db3){if(!_[_0xfea5('0x14')](queues[_0x352db3[_0xfea5('0x5')]])){if(queues[_0x352db3[_0xfea5('0x5')]][_0xfea5('0x15')]){if(!queues[_0x352db3[_0xfea5('0x5')]][_0xfea5('0x16')]&&!queues[_0x352db3[_0xfea5('0x5')]][_0xfea5('0x17')]){queues[_0x352db3[_0xfea5('0x5')]][_0xfea5('0x18')]=!![];queues[_0x352db3['uniqueid']][_0xfea5('0x19')]=utils[_0xfea5('0x12')]();queues[_0x352db3[_0xfea5('0x5')]]['queuecallerexitreason']=_0xfea5('0x1a');}writeDB(queues[_0x352db3[_0xfea5('0x5')]]);}else{if(queues[_0x352db3['uniqueid']]['transfereduniqueid']){queues[queues[_0x352db3[_0xfea5('0x5')]][_0xfea5('0xf')]]=queues[_0x352db3[_0xfea5('0x5')]];queues[queues[_0x352db3['uniqueid']]['transfereduniqueid']][_0xfea5('0x1b')]=0x2;delete queues[_0x352db3[_0xfea5('0x5')]];}}}};exports[_0xfea5('0x1c')]=function(_0x20b082){if(!_[_0xfea5('0x14')](_0x20b082[_0xfea5('0x1d')][_0xfea5('0x1e')])&&_0x20b082[_0xfea5('0x1f')]['toUpperCase']()!==_0xfea5('0x20')){if(!_[_0xfea5('0x14')](queues[_0x20b082['uniqueid']])){queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x16')]=![];queues[_0x20b082['uniqueid']][_0xfea5('0x21')]=null;queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x17')]=!![];queues[_0x20b082['uniqueid']][_0xfea5('0x22')]=utils[_0xfea5('0x12')]();queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x23')]=_0x20b082[_0xfea5('0x1f')][_0xfea5('0x24')]();writeDB(queues[_0x20b082[_0xfea5('0x5')]]);}}else if(!_[_0xfea5('0x14')](_0x20b082[_0xfea5('0x1d')][_0xfea5('0x25')])){if(!_[_0xfea5('0x14')](queues[_0x20b082[_0xfea5('0x5')]])&&!queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x16')]){queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x16')]=![];queues[_0x20b082[_0xfea5('0x5')]]['queuecallerabandonAt']=null;queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x17')]=!![];queues[_0x20b082[_0xfea5('0x5')]][_0xfea5('0x22')]=utils[_0xfea5('0x12')]();queues[_0x20b082['uniqueid']]['queuecallerexitreason']=_0xfea5('0x26');}}};exports[_0xfea5('0x16')]=function(_0x3b3884){if(!_[_0xfea5('0x14')](queues[_0x3b3884[_0xfea5('0x5')]])){queues[_0x3b3884[_0xfea5('0x5')]][_0xfea5('0x17')]=![];queues[_0x3b3884[_0xfea5('0x5')]][_0xfea5('0x22')]=null;queues[_0x3b3884['uniqueid']][_0xfea5('0x16')]=!![];queues[_0x3b3884['uniqueid']][_0xfea5('0x21')]=utils[_0xfea5('0x12')]();queues[_0x3b3884[_0xfea5('0x5')]][_0xfea5('0x23')]=_0xfea5('0x27');}};exports['queuecallerleave']=function(_0x37af40){if(!_[_0xfea5('0x14')](queues[_0x37af40['uniqueid']])){queues[_0x37af40['uniqueid']][_0xfea5('0x28')]=!![];queues[_0x37af40[_0xfea5('0x5')]]['queuecallerleaveAt']=utils[_0xfea5('0x12')]();queues[_0x37af40[_0xfea5('0x5')]][_0xfea5('0x29')]=utils[_0xfea5('0x2a')](queues[_0x37af40['uniqueid']]['queuecallerleaveAt'],queues[_0x37af40[_0xfea5('0x5')]][_0xfea5('0x2b')]);queues[_0x37af40[_0xfea5('0x5')]][_0xfea5('0x2c')]=_0x37af40[_0xfea5('0x2c')];queues[_0x37af40['uniqueid']][_0xfea5('0x2d')]=_0x37af40['count'];queues[_0x37af40[_0xfea5('0x5')]][_0xfea5('0x2e')]=_0x37af40[_0xfea5('0x2e')];queues[_0x37af40[_0xfea5('0x5')]][_0xfea5('0x2f')]=_0x37af40[_0xfea5('0x2f')];}};exports[_0xfea5('0x30')]=function(_0x2c025a){if(!_[_0xfea5('0x14')](queues[_0x2c025a[_0xfea5('0x5')]])){queues[_0x2c025a[_0xfea5('0x5')]]['queuecallerabandon']=![];queues[_0x2c025a[_0xfea5('0x5')]][_0xfea5('0x16')]=![];queues[_0x2c025a[_0xfea5('0x5')]]['queuecallerabandonAt']=null;queues[_0x2c025a['uniqueid']][_0xfea5('0x17')]=![];queues[_0x2c025a[_0xfea5('0x5')]][_0xfea5('0x23')]=null;queues[_0x2c025a['uniqueid']][_0xfea5('0x22')]=null;queues[_0x2c025a[_0xfea5('0x5')]][_0xfea5('0x31')]=!![];queues[_0x2c025a[_0xfea5('0x5')]][_0xfea5('0x9')]=_0x2c025a[_0xfea5('0x32')];queues[_0x2c025a['uniqueid']][_0xfea5('0x33')]=_0x2c025a['membername'];}};exports[_0xfea5('0x34')]=function(_0x2cb21a){if(!_[_0xfea5('0x14')](queues[_0x2cb21a[_0xfea5('0x5')]])){if(queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x15')]){queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x16')]=![];queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x16')]=![];queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x21')]=null;queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x17')]=![];queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x22')]=null;queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x31')]=!![];queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x33')]=_0x2cb21a[_0xfea5('0x35')];queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x18')]=!![];queues[_0x2cb21a[_0xfea5('0x5')]]['queuecallercompleteAt']=utils[_0xfea5('0x12')]();if(_0x2cb21a['reason']==_0xfea5('0x36')){if(!queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x36')]){queues[_0x2cb21a[_0xfea5('0x5')]][_0xfea5('0x23')]='TRANSFER';}}else{queues[_0x2cb21a['uniqueid']][_0xfea5('0x23')]='COMPLETEDBY'+_0x2cb21a['reason'][_0xfea5('0x24')]();}writeDB(queues[_0x2cb21a[_0xfea5('0x5')]]);}}};exports[_0xfea5('0x37')]=function(_0x5ce9e7){if(!_[_0xfea5('0x14')](queues[_0x5ce9e7[_0xfea5('0x38')]])){queues[_0x5ce9e7[_0xfea5('0x38')]][_0xfea5('0x36')]=!![];queues[_0x5ce9e7[_0xfea5('0x38')]][_0xfea5('0x39')]='BLIND';queues[_0x5ce9e7[_0xfea5('0x38')]]['transferexten']=_0x5ce9e7[_0xfea5('0x3a')];queues[_0x5ce9e7[_0xfea5('0x38')]][_0xfea5('0x3b')]=_0x5ce9e7[_0xfea5('0x38')];queues[_0x5ce9e7[_0xfea5('0x38')]][_0xfea5('0x23')]=_0xfea5('0x3c');}};exports[_0xfea5('0x3d')]=function(_0x2cd4a1){try{if(_0x2cd4a1[_0xfea5('0x3e')]==_0x2cd4a1[_0xfea5('0x3f')]){if(!_[_0xfea5('0x14')](queues[_0x2cd4a1[_0xfea5('0x40')]])){queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0x36')]=!![];queues[_0x2cd4a1['secondtransfererlinkedid']][_0xfea5('0x39')]='ATTENDED';queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0x41')]=_0x2cd4a1['origtransfererexten'];queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0x3b')]=_0x2cd4a1[_0xfea5('0x3e')];queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0x23')]='ATTENDEDTRANSFER';}if(!_[_0xfea5('0x14')](queues[_0x2cd4a1[_0xfea5('0x3f')]])){if(_0x2cd4a1[_0xfea5('0x42')]&&queues[_0x2cd4a1['transfereelinkedid']]){queues[_0x2cd4a1['transfereelinkedid']][_0xfea5('0x1b')]=0x1;queues[_0x2cd4a1[_0xfea5('0x38')]]=_[_0xfea5('0x43')](queues[_0x2cd4a1[_0xfea5('0x42')]]);queues[_0x2cd4a1['transfereeuniqueid']][_0xfea5('0xf')]=_0x2cd4a1[_0xfea5('0x44')];queues[_0x2cd4a1[_0xfea5('0x38')]][_0xfea5('0x1b')]=0x2;queues[_0x2cd4a1['transfereeuniqueid']][_0xfea5('0x8')]=queues[_0x2cd4a1['secondtransfererlinkedid']][_0xfea5('0x8')];queues[_0x2cd4a1[_0xfea5('0x38')]]['calleridname']=queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0x45')];queues[_0x2cd4a1[_0xfea5('0x38')]][_0xfea5('0x2b')]=utils[_0xfea5('0x12')]();queues[_0x2cd4a1[_0xfea5('0x38')]][_0xfea5('0x15')]=utils[_0xfea5('0x12')]();queues[_0x2cd4a1[_0xfea5('0x38')]]['holdtime']=0x0;queues[_0x2cd4a1[_0xfea5('0x38')]][_0xfea5('0x46')]=0x0;}else{queues[_0x2cd4a1['origtransfererlinkedid']][_0xfea5('0xf')]=_0x2cd4a1[_0xfea5('0x40')];}}}else if(_0x2cd4a1[_0xfea5('0x47')]==_0x2cd4a1[_0xfea5('0x40')]){if(!_['isNil'](queues[_0x2cd4a1['origtransfererlinkedid']])){queues[_0x2cd4a1['origtransfererlinkedid']]['transfer']=!![];queues[_0x2cd4a1['origtransfererlinkedid']][_0xfea5('0x39')]=_0xfea5('0x48');queues[_0x2cd4a1[_0xfea5('0x3f')]][_0xfea5('0x41')]=_0x2cd4a1[_0xfea5('0x49')];queues[_0x2cd4a1[_0xfea5('0x3f')]][_0xfea5('0x3b')]=_0x2cd4a1[_0xfea5('0x47')];queues[_0x2cd4a1[_0xfea5('0x3f')]][_0xfea5('0x23')]='ATTENDEDTRANSFER';}if(!_[_0xfea5('0x14')](queues[_0x2cd4a1[_0xfea5('0x40')]])){if(_0x2cd4a1['transfertargetlinkedid']&&queues[_0x2cd4a1[_0xfea5('0x4a')]]){queues[_0x2cd4a1['transfertargetlinkedid']][_0xfea5('0x1b')]=0x1;queues[_0x2cd4a1[_0xfea5('0x44')]]=_[_0xfea5('0x43')](queues[_0x2cd4a1['transfertargetlinkedid']]);queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0xf')]=_0x2cd4a1[_0xfea5('0x44')];queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x1b')]=0x2;queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x8')]=queues[_0x2cd4a1[_0xfea5('0x3f')]][_0xfea5('0x8')];queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x45')]=queues[_0x2cd4a1[_0xfea5('0x3f')]][_0xfea5('0x45')];queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x2b')]=utils[_0xfea5('0x12')]();queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x15')]=utils['now']();queues[_0x2cd4a1[_0xfea5('0x44')]][_0xfea5('0x29')]=0x0;queues[_0x2cd4a1['transfertargetuniqueid']][_0xfea5('0x46')]=0x0;}else{queues[_0x2cd4a1[_0xfea5('0x40')]][_0xfea5('0xf')]=_0x2cd4a1['origtransfererlinkedid'];}}}}catch(_0x412646){utils[_0xfea5('0x4b')](_0x412646[_0xfea5('0x4c')]);}};exports[_0xfea5('0x4d')]=function(_0xba55a5){if(!_[_0xfea5('0x14')](queues[_0xba55a5[_0xfea5('0x5')]])){queues[_0xba55a5[_0xfea5('0x5')]][_0xfea5('0x4e')]=utils['now']();}};exports['musiconholdstop']=function(_0x822369){if(!_[_0xfea5('0x14')](queues[_0x822369[_0xfea5('0x5')]])){if(!_['isNil'](queues[_0x822369['uniqueid']][_0xfea5('0x4e')])){queues[_0x822369[_0xfea5('0x5')]][_0xfea5('0x46')]+=utils[_0xfea5('0x2a')](utils['now'](),queues[_0x822369[_0xfea5('0x5')]][_0xfea5('0x4e')]);delete queues[_0x822369[_0xfea5('0x5')]]['musiconholdstartAt'];}}}; \ No newline at end of file +var _0x5cf9=['ATTENDED','transferexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','calleridname','secondtransfereruniqueid','transfertargetlinkedid','transfertargetuniqueid','clone','mohtime','error','stack','musiconholdstart','musiconholdstartAt','util','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','assign','position','hangup','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerexitAt','variable','queueposition','queuecallerexit','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','queuecallerabandonAt','assigned','destaccountcode','membername','agentcomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid'];(function(_0x2cd2f0,_0x2c1a55){var _0x137160=function(_0x62979c){while(--_0x62979c){_0x2cd2f0['push'](_0x2cd2f0['shift']());}};_0x137160(++_0x2c1a55);}(_0x5cf9,0x13f));var _0x95cf=function(_0x3af4e5,_0x3009b0){_0x3af4e5=_0x3af4e5-0x0;var _0x31d2be=_0x5cf9[_0x3af4e5];return _0x31d2be;};'use strict';var _=require('lodash');var util=require(_0x95cf('0x0'));var utils=require(_0x95cf('0x1'));var queues={};function writeDB(_0x2d25eb){utils['info'](util[_0x95cf('0x2')](_0x95cf('0x3'),_0x2d25eb['uniqueid'],_0x2d25eb['channel'],_0x2d25eb['queue'],_0x2d25eb[_0x95cf('0x4')],_0x2d25eb[_0x95cf('0x5')],_0x2d25eb[_0x95cf('0x6')],_0x2d25eb['queuecallerexitreason']));if(_0x2d25eb[_0x95cf('0x7')]){utils[_0x95cf('0x8')](_0x2d25eb[_0x95cf('0x7')])[_0x95cf('0x9')](function(_0xcd1ed8){if(_0xcd1ed8){_0x2d25eb['type']=_0xcd1ed8[_0x95cf('0xa')];}utils[_0x95cf('0xb')](_0x95cf('0xc'),_0x2d25eb);});}else{utils[_0x95cf('0xb')](_0x95cf('0xc'),_0x2d25eb);}if(_0x2d25eb[_0x95cf('0xd')]){delete queues[_0x2d25eb['transfereduniqueid']];}else{delete queues[_0x2d25eb[_0x95cf('0xe')]];}}exports['queuecallerjoin']=function(_0x129235){queues[_0x129235[_0x95cf('0xe')]]=_[_0x95cf('0xf')](_0x129235,{'originalposition':_0x129235[_0x95cf('0x10')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x95cf('0x11')]=function(_0x399fc2){if(!_['isNil'](queues[_0x399fc2[_0x95cf('0xe')]])){if(queues[_0x399fc2[_0x95cf('0xe')]]['queuecallerleaveAt']){if(!queues[_0x399fc2[_0x95cf('0xe')]]['queuecallerabandon']&&!queues[_0x399fc2[_0x95cf('0xe')]]['queuecallerexit']){queues[_0x399fc2['uniqueid']][_0x95cf('0x12')]=!![];queues[_0x399fc2[_0x95cf('0xe')]][_0x95cf('0x13')]=utils[_0x95cf('0x14')]();queues[_0x399fc2['uniqueid']][_0x95cf('0x15')]=_0x95cf('0x16');}writeDB(queues[_0x399fc2[_0x95cf('0xe')]]);}else{if(queues[_0x399fc2[_0x95cf('0xe')]][_0x95cf('0xd')]){queues[queues[_0x399fc2[_0x95cf('0xe')]][_0x95cf('0xd')]]=queues[_0x399fc2[_0x95cf('0xe')]];queues[queues[_0x399fc2['uniqueid']][_0x95cf('0xd')]][_0x95cf('0x17')]=0x2;delete queues[_0x399fc2['uniqueid']];}}}};exports['varset']=function(_0x1fb22d){if(!_[_0x95cf('0x18')](_0x1fb22d['variable'][_0x95cf('0x19')])&&_0x1fb22d[_0x95cf('0x1a')][_0x95cf('0x1b')]()!==_0x95cf('0x1c')){if(!_[_0x95cf('0x18')](queues[_0x1fb22d[_0x95cf('0xe')]])){queues[_0x1fb22d[_0x95cf('0xe')]][_0x95cf('0x1d')]=![];queues[_0x1fb22d[_0x95cf('0xe')]]['queuecallerabandonAt']=null;queues[_0x1fb22d['uniqueid']]['queuecallerexit']=!![];queues[_0x1fb22d['uniqueid']][_0x95cf('0x1e')]=utils[_0x95cf('0x14')]();queues[_0x1fb22d[_0x95cf('0xe')]][_0x95cf('0x15')]=_0x1fb22d['value'][_0x95cf('0x1b')]();writeDB(queues[_0x1fb22d['uniqueid']]);}}else if(!_[_0x95cf('0x18')](_0x1fb22d[_0x95cf('0x1f')][_0x95cf('0x20')])){if(!_[_0x95cf('0x18')](queues[_0x1fb22d['uniqueid']])&&!queues[_0x1fb22d[_0x95cf('0xe')]][_0x95cf('0x1d')]){queues[_0x1fb22d[_0x95cf('0xe')]][_0x95cf('0x1d')]=![];queues[_0x1fb22d['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1fb22d['uniqueid']][_0x95cf('0x21')]=!![];queues[_0x1fb22d[_0x95cf('0xe')]][_0x95cf('0x1e')]=utils[_0x95cf('0x14')]();queues[_0x1fb22d[_0x95cf('0xe')]]['queuecallerexitreason']=_0x95cf('0x22');}}};exports['queuecallerabandon']=function(_0x4d349e){if(!_[_0x95cf('0x18')](queues[_0x4d349e[_0x95cf('0xe')]])){queues[_0x4d349e[_0x95cf('0xe')]][_0x95cf('0x21')]=![];queues[_0x4d349e[_0x95cf('0xe')]][_0x95cf('0x1e')]=null;queues[_0x4d349e[_0x95cf('0xe')]]['queuecallerabandon']=!![];queues[_0x4d349e[_0x95cf('0xe')]]['queuecallerabandonAt']=utils['now']();queues[_0x4d349e[_0x95cf('0xe')]][_0x95cf('0x15')]=_0x95cf('0x23');}};exports[_0x95cf('0x24')]=function(_0x258336){if(!_[_0x95cf('0x18')](queues[_0x258336[_0x95cf('0xe')]])){queues[_0x258336['uniqueid']][_0x95cf('0x24')]=!![];queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x25')]=utils[_0x95cf('0x14')]();queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x26')]=utils[_0x95cf('0x27')](queues[_0x258336['uniqueid']][_0x95cf('0x25')],queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x28')]);queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x10')]=_0x258336[_0x95cf('0x10')];queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x29')]=_0x258336['count'];queues[_0x258336[_0x95cf('0xe')]][_0x95cf('0x2a')]=_0x258336[_0x95cf('0x2a')];queues[_0x258336[_0x95cf('0xe')]]['connectedlinename']=_0x258336[_0x95cf('0x2b')];}};exports[_0x95cf('0x2c')]=function(_0x477c17){if(!_[_0x95cf('0x18')](queues[_0x477c17[_0x95cf('0xe')]])){queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x1d')]=![];queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x1d')]=![];queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x2d')]=null;queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x21')]=![];queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x15')]=null;queues[_0x477c17[_0x95cf('0xe')]]['queuecallerexitAt']=null;queues[_0x477c17[_0x95cf('0xe')]][_0x95cf('0x2e')]=!![];queues[_0x477c17['uniqueid']]['accountcode']=_0x477c17[_0x95cf('0x2f')];queues[_0x477c17['uniqueid']][_0x95cf('0x4')]=_0x477c17[_0x95cf('0x30')];}};exports[_0x95cf('0x31')]=function(_0x24c79d){if(!_[_0x95cf('0x18')](queues[_0x24c79d[_0x95cf('0xe')]])){if(queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x25')]){queues[_0x24c79d[_0x95cf('0xe')]]['queuecallerabandon']=![];queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x1d')]=![];queues[_0x24c79d[_0x95cf('0xe')]]['queuecallerabandonAt']=null;queues[_0x24c79d['uniqueid']][_0x95cf('0x21')]=![];queues[_0x24c79d[_0x95cf('0xe')]]['queuecallerexitAt']=null;queues[_0x24c79d['uniqueid']][_0x95cf('0x2e')]=!![];queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x4')]=_0x24c79d[_0x95cf('0x30')];queues[_0x24c79d[_0x95cf('0xe')]]['queuecallercomplete']=!![];queues[_0x24c79d[_0x95cf('0xe')]]['queuecallercompleteAt']=utils[_0x95cf('0x14')]();if(_0x24c79d[_0x95cf('0x32')]==_0x95cf('0x33')){if(!queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x33')]){queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x15')]='TRANSFER';}}else{queues[_0x24c79d[_0x95cf('0xe')]][_0x95cf('0x15')]=_0x95cf('0x34')+_0x24c79d[_0x95cf('0x32')][_0x95cf('0x1b')]();}writeDB(queues[_0x24c79d[_0x95cf('0xe')]]);}}};exports[_0x95cf('0x35')]=function(_0x1cd06f){if(!_[_0x95cf('0x18')](queues[_0x1cd06f[_0x95cf('0x36')]])){queues[_0x1cd06f[_0x95cf('0x36')]]['transfer']=!![];queues[_0x1cd06f['transfereeuniqueid']][_0x95cf('0x37')]='BLIND';queues[_0x1cd06f[_0x95cf('0x36')]]['transferexten']=_0x1cd06f[_0x95cf('0x38')];queues[_0x1cd06f['transfereeuniqueid']][_0x95cf('0x39')]=_0x1cd06f[_0x95cf('0x36')];queues[_0x1cd06f['transfereeuniqueid']][_0x95cf('0x15')]='BLINDTRANSFER';}};exports[_0x95cf('0x3a')]=function(_0x115e36){try{if(_0x115e36['origtransfereruniqueid']==_0x115e36[_0x95cf('0x3b')]){if(!_[_0x95cf('0x18')](queues[_0x115e36[_0x95cf('0x3c')]])){queues[_0x115e36[_0x95cf('0x3c')]][_0x95cf('0x33')]=!![];queues[_0x115e36['secondtransfererlinkedid']]['transfertype']=_0x95cf('0x3d');queues[_0x115e36[_0x95cf('0x3c')]][_0x95cf('0x3e')]=_0x115e36['origtransfererexten'];queues[_0x115e36['secondtransfererlinkedid']][_0x95cf('0x39')]=_0x115e36[_0x95cf('0x3f')];queues[_0x115e36[_0x95cf('0x3c')]][_0x95cf('0x15')]=_0x95cf('0x40');}if(!_['isNil'](queues[_0x115e36[_0x95cf('0x3b')]])){if(_0x115e36[_0x95cf('0x41')]&&queues[_0x115e36['transfereelinkedid']]){queues[_0x115e36[_0x95cf('0x41')]][_0x95cf('0x17')]=0x1;queues[_0x115e36[_0x95cf('0x36')]]=_['clone'](queues[_0x115e36[_0x95cf('0x41')]]);queues[_0x115e36[_0x95cf('0x36')]][_0x95cf('0xd')]=_0x115e36['transfertargetuniqueid'];queues[_0x115e36[_0x95cf('0x36')]][_0x95cf('0x17')]=0x2;queues[_0x115e36[_0x95cf('0x36')]][_0x95cf('0x5')]=queues[_0x115e36[_0x95cf('0x3c')]]['calleridnum'];queues[_0x115e36['transfereeuniqueid']][_0x95cf('0x42')]=queues[_0x115e36[_0x95cf('0x3c')]][_0x95cf('0x42')];queues[_0x115e36[_0x95cf('0x36')]]['queuecallerjoinAt']=utils[_0x95cf('0x14')]();queues[_0x115e36[_0x95cf('0x36')]][_0x95cf('0x25')]=utils['now']();queues[_0x115e36[_0x95cf('0x36')]][_0x95cf('0x26')]=0x0;queues[_0x115e36['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0x115e36[_0x95cf('0x3b')]][_0x95cf('0xd')]=_0x115e36['secondtransfererlinkedid'];}}}else if(_0x115e36[_0x95cf('0x43')]==_0x115e36[_0x95cf('0x3c')]){if(!_[_0x95cf('0x18')](queues[_0x115e36['origtransfererlinkedid']])){queues[_0x115e36[_0x95cf('0x3b')]][_0x95cf('0x33')]=!![];queues[_0x115e36[_0x95cf('0x3b')]][_0x95cf('0x37')]='ATTENDED';queues[_0x115e36[_0x95cf('0x3b')]][_0x95cf('0x3e')]=_0x115e36['secondtransfererexten'];queues[_0x115e36['origtransfererlinkedid']]['transferuniqueid']=_0x115e36[_0x95cf('0x43')];queues[_0x115e36['origtransfererlinkedid']][_0x95cf('0x15')]=_0x95cf('0x40');}if(!_[_0x95cf('0x18')](queues[_0x115e36['secondtransfererlinkedid']])){if(_0x115e36[_0x95cf('0x44')]&&queues[_0x115e36[_0x95cf('0x44')]]){queues[_0x115e36[_0x95cf('0x44')]]['queuecallerenterreason']=0x1;queues[_0x115e36[_0x95cf('0x45')]]=_[_0x95cf('0x46')](queues[_0x115e36[_0x95cf('0x44')]]);queues[_0x115e36['transfertargetuniqueid']]['transfereduniqueid']=_0x115e36[_0x95cf('0x45')];queues[_0x115e36['transfertargetuniqueid']][_0x95cf('0x17')]=0x2;queues[_0x115e36[_0x95cf('0x45')]]['calleridnum']=queues[_0x115e36[_0x95cf('0x3b')]][_0x95cf('0x5')];queues[_0x115e36[_0x95cf('0x45')]][_0x95cf('0x42')]=queues[_0x115e36[_0x95cf('0x3b')]]['calleridname'];queues[_0x115e36['transfertargetuniqueid']][_0x95cf('0x28')]=utils[_0x95cf('0x14')]();queues[_0x115e36[_0x95cf('0x45')]][_0x95cf('0x25')]=utils['now']();queues[_0x115e36[_0x95cf('0x45')]][_0x95cf('0x26')]=0x0;queues[_0x115e36['transfertargetuniqueid']][_0x95cf('0x47')]=0x0;}else{queues[_0x115e36['secondtransfererlinkedid']]['transfereduniqueid']=_0x115e36[_0x95cf('0x3b')];}}}}catch(_0x3d894f){utils[_0x95cf('0x48')](_0x3d894f[_0x95cf('0x49')]);}};exports[_0x95cf('0x4a')]=function(_0x534e73){if(!_[_0x95cf('0x18')](queues[_0x534e73['uniqueid']])){queues[_0x534e73[_0x95cf('0xe')]][_0x95cf('0x4b')]=utils[_0x95cf('0x14')]();}};exports['musiconholdstop']=function(_0x3e1867){if(!_['isNil'](queues[_0x3e1867[_0x95cf('0xe')]])){if(!_[_0x95cf('0x18')](queues[_0x3e1867[_0x95cf('0xe')]]['musiconholdstartAt'])){queues[_0x3e1867[_0x95cf('0xe')]][_0x95cf('0x47')]+=utils[_0x95cf('0x27')](utils['now'](),queues[_0x3e1867[_0x95cf('0xe')]]['musiconholdstartAt']);delete queues[_0x3e1867[_0x95cf('0xe')]][_0x95cf('0x4b')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 2fc6651..62067a8 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 _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x5cd9b2,_0x26f267){var _0x37002b=function(_0x107d66){while(--_0x107d66){_0x5cd9b2['push'](_0x5cd9b2['shift']());}};_0x37002b(++_0x26f267);}(_0x70e0,0x17b));var _0x070e=function(_0x238423,_0x5ddc28){_0x238423=_0x238423-0x0;var _0x3ec89e=_0x70e0[_0x238423];return _0x3ec89e;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x2d167b,_0x43578c){var _0x57810e=function(_0x32e32a){while(--_0x32e32a){_0x2d167b['push'](_0x2d167b['shift']());}};_0x57810e(++_0x43578c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xcb91[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a479a05..4e7f817 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 _0x9ec3=['transfertargetlinkedid','error','lodash','util','info','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','stack','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten'];(function(_0x525276,_0xd269da){var _0x49d8e2=function(_0x4725b0){while(--_0x4725b0){_0x525276['push'](_0x525276['shift']());}};_0x49d8e2(++_0xd269da);}(_0x9ec3,0xcd));var _0x39ec=function(_0x440723,_0x411fec){_0x440723=_0x440723-0x0;var _0xb3cc53=_0x9ec3[_0x440723];return _0xb3cc53;};'use strict';var _=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var utils=require('./utils');function writeDB(_0x4dfde3){utils[_0x39ec('0x2')](util['format'](_0x39ec('0x3'),_0x4dfde3[_0x39ec('0x4')]));utils[_0x39ec('0x5')](_0x39ec('0x6'),_0x4dfde3);}exports[_0x39ec('0x7')]=function(_0x32c897){try{_0x32c897[_0x39ec('0x4')]=_0x39ec('0x8');writeDB(_0x32c897);}catch(_0x58db37){utils['error'](_0x58db37[_0x39ec('0x9')]);}};exports['attendedtransfer']=function(_0x272a29){try{_0x272a29=_[_0x39ec('0xa')](_0x272a29,{'transfererchannel':_0x272a29[_0x39ec('0xb')],'transferercalleridnum':_0x272a29['origtransferercalleridnum'],'transferercalleridname':_0x272a29[_0x39ec('0xc')],'transfererconnectedlinenum':_0x272a29['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x272a29[_0x39ec('0xd')],'transfereraccountcode':_0x272a29[_0x39ec('0xe')],'transferercontext':_0x272a29['secondtransferercontext'],'transfererexten':_0x272a29[_0x39ec('0xf')],'transfererlinkedid':_0x272a29[_0x39ec('0x10')],'context':_0x272a29[_0x39ec('0x11')],'extension':_0x272a29['origtransfererexten'],'type':'attended'});if(_[_0x39ec('0x12')](_0x272a29[_0x39ec('0x13')])){_0x272a29=_['assign'](_0x272a29,{'transfereechannel':_0x272a29[_0x39ec('0x14')],'transfereecalleridnum':_0x272a29[_0x39ec('0x15')],'transfereecalleridname':_0x272a29[_0x39ec('0x16')],'transfereeconnectedlinenum':_0x272a29['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x272a29[_0x39ec('0x17')],'transfereeaccountcode':_0x272a29[_0x39ec('0x18')],'transfereecontext':_0x272a29[_0x39ec('0x19')],'transfereeexten':_0x272a29[_0x39ec('0x1a')],'transfereelinkedid':_0x272a29[_0x39ec('0x1b')]});}writeDB(_0x272a29);}catch(_0x50ce3c){utils[_0x39ec('0x1c')](_0x50ce3c[_0x39ec('0x9')]);}}; \ No newline at end of file +var _0x2e3b=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','util','./utils','info','format','TRANSFER|%s','type','request','blindtransfer','blind','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x4b2341,_0x2e2f20){var _0x59eed4=function(_0x17f887){while(--_0x17f887){_0x4b2341['push'](_0x4b2341['shift']());}};_0x59eed4(++_0x2e2f20);}(_0x2e3b,0x81));var _0xb2e3=function(_0x5664aa,_0x1d8fdd){_0x5664aa=_0x5664aa-0x0;var _0x31cd6a=_0x2e3b[_0x5664aa];return _0x31cd6a;};'use strict';var _=require('lodash');var util=require(_0xb2e3('0x0'));var utils=require(_0xb2e3('0x1'));function writeDB(_0x236bdb){utils[_0xb2e3('0x2')](util[_0xb2e3('0x3')](_0xb2e3('0x4'),_0x236bdb[_0xb2e3('0x5')]));utils[_0xb2e3('0x6')]('CreateVoiceTransferReport',_0x236bdb);}exports[_0xb2e3('0x7')]=function(_0x1e2afd){try{_0x1e2afd['type']=_0xb2e3('0x8');writeDB(_0x1e2afd);}catch(_0x108b1c){utils['error'](_0x108b1c[_0xb2e3('0x9')]);}};exports[_0xb2e3('0xa')]=function(_0x4fbc94){try{_0x4fbc94=_[_0xb2e3('0xb')](_0x4fbc94,{'transfererchannel':_0x4fbc94[_0xb2e3('0xc')],'transferercalleridnum':_0x4fbc94[_0xb2e3('0xd')],'transferercalleridname':_0x4fbc94[_0xb2e3('0xe')],'transfererconnectedlinenum':_0x4fbc94[_0xb2e3('0xf')],'transfererconnectedlinename':_0x4fbc94['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4fbc94[_0xb2e3('0x10')],'transferercontext':_0x4fbc94['secondtransferercontext'],'transfererexten':_0x4fbc94[_0xb2e3('0x11')],'transfererlinkedid':_0x4fbc94[_0xb2e3('0x12')],'context':_0x4fbc94[_0xb2e3('0x13')],'extension':_0x4fbc94[_0xb2e3('0x14')],'type':_0xb2e3('0x15')});if(_[_0xb2e3('0x16')](_0x4fbc94[_0xb2e3('0x17')])){_0x4fbc94=_['assign'](_0x4fbc94,{'transfereechannel':_0x4fbc94['transfertargetchannel'],'transfereecalleridnum':_0x4fbc94['transfertargetcalleridnum'],'transfereecalleridname':_0x4fbc94[_0xb2e3('0x18')],'transfereeconnectedlinenum':_0x4fbc94[_0xb2e3('0x19')],'transfereeconnectedlinename':_0x4fbc94[_0xb2e3('0x1a')],'transfereeaccountcode':_0x4fbc94[_0xb2e3('0x1b')],'transfereecontext':_0x4fbc94['transfertargetcontext'],'transfereeexten':_0x4fbc94[_0xb2e3('0x1c')],'transfereelinkedid':_0x4fbc94[_0xb2e3('0x1d')]});}writeDB(_0x4fbc94);}catch(_0x2f40ed){utils[_0xb2e3('0x1e')](_0x2f40ed[_0xb2e3('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e582bf4..b8a1411 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 _0xfa3c=['stack','request','catch','internal','name','then','GETUSER|','result','NOTFOUND','length','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','acw','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','addTime','seconds','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','isAfter','isBefore','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa3c,0x143));var _0xcfa3=function(_0xa6a23e,_0x8b657a){_0xa6a23e=_0xa6a23e-0x0;var _0x210e65=_0xfa3c[_0xa6a23e];return _0x210e65;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xcfa3('0x0'));var BPromise=require(_0xcfa3('0x1'));var client=jayson[_0xcfa3('0x2')][_0xcfa3('0x3')]({'port':0x2329});var logger=require(_0xcfa3('0x4'))(_0xcfa3('0x5'));exports[_0xcfa3('0x6')]=function(_0x3640ea){logger['info'](_0x3640ea);};exports[_0xcfa3('0x7')]=function(_0xc96c1c){logger['debug'](JSON[_0xcfa3('0x8')](_0xc96c1c));};exports[_0xcfa3('0x9')]=function(_0x3ad268){logger['error'](_0x3ad268[_0xcfa3('0xa')]);};exports[_0xcfa3('0xb')]=function(_0x172349,_0x5771d7){return client[_0xcfa3('0xb')](_0x172349,{'body':_0x5771d7})['then'](function(_0x1e869e){logger[_0xcfa3('0x7')](JSON[_0xcfa3('0x8')](_0x1e869e));})[_0xcfa3('0xc')](function(_0x4edaa7){logger[_0xcfa3('0x9')](_0x4edaa7[_0xcfa3('0xa')]);});};function getUser(_0x1920b8){return client[_0xcfa3('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xcfa3('0xd'),_0xcfa3('0xe'),'interface'],'where':_0x1920b8,'limit':0x1}})[_0xcfa3('0xf')](function(_0x1fbf21){logger['info'](_0xcfa3('0x10')+JSON['stringify'](_0x1920b8)+'|'+(_0x1fbf21[_0xcfa3('0x11')]['length']?'FOUND':_0xcfa3('0x12')));return _0x1fbf21['result'][_0xcfa3('0x13')]?_0x1fbf21[_0xcfa3('0x11')][0x0]:null;});}exports[_0xcfa3('0x14')]=function(_0x2c1a47){return new BPromise(function(_0x8ad8af,_0xee20cb){if(_0x2c1a47){return getUser({'internal':_0x2c1a47})[_0xcfa3('0xf')](function(_0x529faa){return _0x8ad8af(_0x529faa);})[_0xcfa3('0xc')](function(_0x2a141c){logger[_0xcfa3('0x9')](_0x2a141c[_0xcfa3('0xa')]);return _0x8ad8af(null);});}else{return _0x8ad8af(null);}});};exports[_0xcfa3('0x15')]=function(_0x4d0c62){return new BPromise(function(_0x586338,_0x4cd633){if(_0x4d0c62){return getUser({'interface':_0x4d0c62})[_0xcfa3('0xf')](function(_0x1356dd){return _0x586338(_0x1356dd);})[_0xcfa3('0xc')](function(_0x1543fc){logger[_0xcfa3('0x9')](_0x1543fc[_0xcfa3('0xa')]);return _0x586338(null);});}else{return _0x586338(null);}});};exports[_0xcfa3('0x16')]=function(_0x4820b6){return new BPromise(function(_0x3d15bb,_0x12751a){if(_0x4820b6){return getUser({'name':_0x4820b6})['then'](function(_0x24d493){return _0x3d15bb(_0x24d493);})[_0xcfa3('0xc')](function(_0x2e624e){logger[_0xcfa3('0x9')](_0x2e624e['stack']);return _0x3d15bb(null);});}else{return _0x3d15bb(null);}});};exports[_0xcfa3('0x17')]=function(_0x4dd5d5){return new BPromise(function(_0x199c65,_0x5d6b5e){if(_0x4dd5d5){return client[_0xcfa3('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xcfa3('0xe'),'type',_0xcfa3('0x18'),_0xcfa3('0x19')],'where':{'name':_0x4dd5d5},'limit':0x1}})[_0xcfa3('0xf')](function(_0x566441){logger[_0xcfa3('0x6')](_0xcfa3('0x1a')+_0x4dd5d5+'|'+(_0x566441[_0xcfa3('0x11')][_0xcfa3('0x13')]?_0xcfa3('0x1b'):_0xcfa3('0x12')));return _0x199c65(_0x566441[_0xcfa3('0x11')][_0xcfa3('0x13')]?_0x566441['result'][0x0]:null);})[_0xcfa3('0xc')](function(_0x3422d8){logger[_0xcfa3('0x9')](_0x3422d8[_0xcfa3('0xa')]);return _0x199c65(null);});}else{return _0x199c65(null);}});};exports[_0xcfa3('0x1c')]=function(_0x1a503a,_0xd31010){return moment(_0x1a503a)['add'](_0xd31010,_0xcfa3('0x1d'))[_0xcfa3('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x395fa3,_0xaeaf2b){return moment(_0x395fa3)[_0xcfa3('0x1f')](_0xaeaf2b,_0xcfa3('0x1d'))[_0xcfa3('0x1e')](_0xcfa3('0x20'));};exports['diffTime']=function(_0xb810ef,_0x5e0e2d){return moment(_0xb810ef)[_0xcfa3('0x21')](moment(_0x5e0e2d),'seconds');};exports[_0xcfa3('0x22')]=function(_0x5b68fd,_0x1c5a29){return parseInt(_0x5b68fd,0xa)+parseInt(_0x1c5a29,0xa);};exports['now']=function(){return moment()[_0xcfa3('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xcfa3('0x23')]=function(_0x2b29e5,_0x29aa19){if(_0x29aa19){return moment(_0x2b29e5)[_0xcfa3('0x23')](_0x29aa19);}else{return!![];}};exports['isBefore']=function(_0x2c77ee,_0x26d814){if(_0x26d814){return moment(_0x2c77ee)[_0xcfa3('0x24')](_0x26d814);}else if(_0x2c77ee){return!![];}else{return![];}}; \ No newline at end of file +var _0x6102=['stack','request','then','GetUser','internal','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','catch','getUserByInterface','getUserByName','getVoiceQueueByName','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','isAfter','isBefore','jayson/promise','bluebird','client','../../config/logger','xdr','info','debug','stringify','error'];(function(_0x360063,_0x33554b){var _0x1e6be2=function(_0x58e464){while(--_0x58e464){_0x360063['push'](_0x360063['shift']());}};_0x1e6be2(++_0x33554b);}(_0x6102,0x199));var _0x2610=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x6102[_0x2d34d6];return _0x1d3d12;};'use strict';var jayson=require(_0x2610('0x0'));var moment=require('moment');var BPromise=require(_0x2610('0x1'));var client=jayson[_0x2610('0x2')]['http']({'port':0x2329});var logger=require(_0x2610('0x3'))(_0x2610('0x4'));exports[_0x2610('0x5')]=function(_0x45f10a){logger[_0x2610('0x5')](_0x45f10a);};exports['debug']=function(_0x5c3f0d){logger[_0x2610('0x6')](JSON[_0x2610('0x7')](_0x5c3f0d));};exports[_0x2610('0x8')]=function(_0x5bea45){logger[_0x2610('0x8')](_0x5bea45[_0x2610('0x9')]);};exports['request']=function(_0x5c2984,_0x38aa88){return client[_0x2610('0xa')](_0x5c2984,{'body':_0x38aa88})[_0x2610('0xb')](function(_0x4735ce){logger[_0x2610('0x6')](JSON[_0x2610('0x7')](_0x4735ce));})['catch'](function(_0x56c596){logger['error'](_0x56c596[_0x2610('0x9')]);});};function getUser(_0x5ef288){return client['request'](_0x2610('0xc'),{'options':{'raw':!![],'attributes':['id',_0x2610('0xd'),_0x2610('0xe'),_0x2610('0xf')],'where':_0x5ef288,'limit':0x1}})['then'](function(_0x432e28){logger['info'](_0x2610('0x10')+JSON[_0x2610('0x7')](_0x5ef288)+'|'+(_0x432e28[_0x2610('0x11')][_0x2610('0x12')]?_0x2610('0x13'):_0x2610('0x14')));return _0x432e28[_0x2610('0x11')][_0x2610('0x12')]?_0x432e28['result'][0x0]:null;});}exports[_0x2610('0x15')]=function(_0x149ed5){return new BPromise(function(_0x138283,_0x2c2ea9){if(_0x149ed5){return getUser({'internal':_0x149ed5})[_0x2610('0xb')](function(_0xfabf16){return _0x138283(_0xfabf16);})[_0x2610('0x16')](function(_0x591583){logger[_0x2610('0x8')](_0x591583[_0x2610('0x9')]);return _0x138283(null);});}else{return _0x138283(null);}});};exports[_0x2610('0x17')]=function(_0x4ffdc6){return new BPromise(function(_0x1bbfeb,_0x98f979){if(_0x4ffdc6){return getUser({'interface':_0x4ffdc6})['then'](function(_0x3ca63a){return _0x1bbfeb(_0x3ca63a);})[_0x2610('0x16')](function(_0x539e15){logger['error'](_0x539e15[_0x2610('0x9')]);return _0x1bbfeb(null);});}else{return _0x1bbfeb(null);}});};exports[_0x2610('0x18')]=function(_0x256002){return new BPromise(function(_0x30990d,_0x472885){if(_0x256002){return getUser({'name':_0x256002})[_0x2610('0xb')](function(_0x25fda1){return _0x30990d(_0x25fda1);})['catch'](function(_0x5e6337){logger['error'](_0x5e6337[_0x2610('0x9')]);return _0x30990d(null);});}else{return _0x30990d(null);}});};exports[_0x2610('0x19')]=function(_0x36112a){return new BPromise(function(_0x552638,_0x4d631b){if(_0x36112a){return client[_0x2610('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x2610('0x1a'),_0x2610('0x1b'),_0x2610('0x1c')],'where':{'name':_0x36112a},'limit':0x1}})['then'](function(_0x75de53){logger[_0x2610('0x5')](_0x2610('0x1d')+_0x36112a+'|'+(_0x75de53[_0x2610('0x11')]['length']?_0x2610('0x13'):'NOTFOUND'));return _0x552638(_0x75de53[_0x2610('0x11')]['length']?_0x75de53[_0x2610('0x11')][0x0]:null);})[_0x2610('0x16')](function(_0x1aaf68){logger[_0x2610('0x8')](_0x1aaf68[_0x2610('0x9')]);return _0x552638(null);});}else{return _0x552638(null);}});};exports['addTime']=function(_0x2f34c5,_0x323f84){return moment(_0x2f34c5)['add'](_0x323f84,_0x2610('0x1e'))[_0x2610('0x1f')](_0x2610('0x20'));};exports[_0x2610('0x21')]=function(_0xde1708,_0x16ed9a){return moment(_0xde1708)['subtract'](_0x16ed9a,_0x2610('0x1e'))[_0x2610('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2610('0x22')]=function(_0x3b7d9e,_0x17636a){return moment(_0x3b7d9e)[_0x2610('0x23')](moment(_0x17636a),_0x2610('0x1e'));};exports['sumTime']=function(_0x5a04e8,_0x39aa22){return parseInt(_0x5a04e8,0xa)+parseInt(_0x39aa22,0xa);};exports['now']=function(){return moment()[_0x2610('0x1f')](_0x2610('0x20'));};exports[_0x2610('0x24')]=function(_0x1629a5,_0x427e02){if(_0x427e02){return moment(_0x1629a5)['isAfter'](_0x427e02);}else{return!![];}};exports[_0x2610('0x25')]=function(_0x1570b9,_0xf9fbcf){if(_0xf9fbcf){return moment(_0x1570b9)[_0x2610('0x25')](_0xf9fbcf);}else if(_0x1570b9){return!![];}else{return![];}}; \ No newline at end of file